From ff2020674f98ad5ac2fbeb007bc74a3efb000fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 10 Nov 2022 16:07:47 +0100 Subject: [PATCH 0001/2542] winevulkan: Add vk.xml / video.xml version 1.4.303. --- dlls/winevulkan/video.xml | 1830 +++ dlls/winevulkan/vk.xml | 29084 ++++++++++++++++++++++++++++++++++++ 2 files changed, 30914 insertions(+) create mode 100644 dlls/winevulkan/video.xml create mode 100644 dlls/winevulkan/vk.xml diff --git a/dlls/winevulkan/video.xml b/dlls/winevulkan/video.xml new file mode 100644 index 000000000000..cc629c209ec2 --- /dev/null +++ b/dlls/winevulkan/video.xml @@ -0,0 +1,1830 @@ + + + +Copyright 2021-2024 The Khronos Group Inc. +SPDX-License-Identifier: Apache-2.0 OR MIT + + + +This file, video.xml, provides the machine readable definition of data +structures and enumerations that are related to the externally-provided +video compression standards. + +The current public version of video.xml is maintained in the default branch +(currently named main) of the Khronos Vulkan GitHub project. + + + + + #if !defined(VK_NO_STDINT_H) + #include <stdint.h> +#endif + + + + + + + + #include "vulkan_video_codecs_common.h" + #include "vulkan_video_codec_h264std.h" + #include "vulkan_video_codec_h265std.h" + #include "vulkan_video_codec_av1std.h" + + + #define VK_MAKE_VIDEO_STD_VERSION(major, minor, patch) \ + ((((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch))) + + + +#define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) + + + +#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) + + + +#define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) + + + +#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) + + + +#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) + + + +#define VK_STD_VULKAN_VIDEO_CODEC_AV1_ENCODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) + + + + + + + + + + + + + + + + + + + uint32_t aspect_ratio_info_present_flag : 1 + uint32_t overscan_info_present_flag : 1 + uint32_t overscan_appropriate_flag : 1 + uint32_t video_signal_type_present_flag : 1 + uint32_t video_full_range_flag : 1 + uint32_t color_description_present_flag : 1colour_description_present_flag + uint32_t chroma_loc_info_present_flag : 1 + uint32_t timing_info_present_flag : 1 + uint32_t fixed_frame_rate_flag : 1 + uint32_t bitstream_restriction_flag : 1 + uint32_t nal_hrd_parameters_present_flag : 1 + uint32_t vcl_hrd_parameters_present_flag : 1 + + + uint8_t cpb_cnt_minus1 + uint8_t bit_rate_scale + uint8_t cpb_size_scale + uint8_t reserved1Reserved for future use and must be initialized with 0. + uint32_t bit_rate_value_minus1[STD_VIDEO_H264_CPB_CNT_LIST_SIZE]cpb_cnt_minus1 number of valid elements + uint32_t cpb_size_value_minus1[STD_VIDEO_H264_CPB_CNT_LIST_SIZE]cpb_cnt_minus1 number of valid elements + uint8_t cbr_flag[STD_VIDEO_H264_CPB_CNT_LIST_SIZE]cpb_cnt_minus1 number of valid elements + uint32_t initial_cpb_removal_delay_length_minus1 + uint32_t cpb_removal_delay_length_minus1 + uint32_t dpb_output_delay_length_minus1 + uint32_t time_offset_length + + + StdVideoH264SpsVuiFlags flags + StdVideoH264AspectRatioIdc aspect_ratio_idc + uint16_t sar_width + uint16_t sar_height + uint8_t video_format + uint8_t colour_primaries + uint8_t transfer_characteristics + uint8_t matrix_coefficients + uint32_t num_units_in_tick + uint32_t time_scale + uint8_t max_num_reorder_frames + uint8_t max_dec_frame_buffering + uint8_t chroma_sample_loc_type_top_field + uint8_t chroma_sample_loc_type_bottom_field + uint32_t reserved1Reserved for future use and must be initialized with 0. + const StdVideoH264HrdParameters* pHrdParametersmust be a valid ptr to hrd_parameters, if nal_hrd_parameters_present_flag or vcl_hrd_parameters_present_flag are set + + + uint32_t constraint_set0_flag : 1 + uint32_t constraint_set1_flag : 1 + uint32_t constraint_set2_flag : 1 + uint32_t constraint_set3_flag : 1 + uint32_t constraint_set4_flag : 1 + uint32_t constraint_set5_flag : 1 + uint32_t direct_8x8_inference_flag : 1 + uint32_t mb_adaptive_frame_field_flag : 1 + uint32_t frame_mbs_only_flag : 1 + uint32_t delta_pic_order_always_zero_flag : 1 + uint32_t separate_colour_plane_flag : 1 + uint32_t gaps_in_frame_num_value_allowed_flag : 1 + uint32_t qpprime_y_zero_transform_bypass_flag : 1 + uint32_t frame_cropping_flag : 1 + uint32_t seq_scaling_matrix_present_flag : 1 + uint32_t vui_parameters_present_flag : 1 + + + + scaling_list_present_mask has one bit for each + seq_scaling_list_present_flag[i] for SPS OR + pic_scaling_list_present_flag[i] for PPS, + bit 0 - 5 are for each entry of ScalingList4x4 + bit 6 - 11 are for each entry plus 6 for ScalingList8x8 + + uint16_t scaling_list_present_mask + + use_default_scaling_matrix_mask has one bit for each + UseDefaultScalingMatrix4x4Flag[ i ] and + UseDefaultScalingMatrix8x8Flag[ i - 6 ] for SPS OR PPS + bit 0 - 5 are for each entry of ScalingList4x4 + bit 6 - 11 are for each entry plus 6 for ScalingList8x8 + + uint16_t use_default_scaling_matrix_mask + uint8_t ScalingList4x4[STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS][STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS] + uint8_t ScalingList8x8[STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS][STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS] + + + StdVideoH264SpsFlags flags + StdVideoH264ProfileIdc profile_idc + StdVideoH264LevelIdc level_idc + StdVideoH264ChromaFormatIdc chroma_format_idc + uint8_t seq_parameter_set_id + uint8_t bit_depth_luma_minus8 + uint8_t bit_depth_chroma_minus8 + uint8_t log2_max_frame_num_minus4 + StdVideoH264PocType pic_order_cnt_type + int32_t offset_for_non_ref_pic + int32_t offset_for_top_to_bottom_field + uint8_t log2_max_pic_order_cnt_lsb_minus4 + uint8_t num_ref_frames_in_pic_order_cnt_cycle + uint8_t max_num_ref_frames + uint8_t reserved1Reserved for future use and must be initialized with 0. + uint32_t pic_width_in_mbs_minus1 + uint32_t pic_height_in_map_units_minus1 + uint32_t frame_crop_left_offset + uint32_t frame_crop_right_offset + uint32_t frame_crop_top_offset + uint32_t frame_crop_bottom_offset + uint32_t reserved2Reserved for future use and must be initialized with 0. + + pOffsetForRefFrame is a pointer representing the offset_for_ref_frame array with num_ref_frames_in_pic_order_cnt_cycle number of elements. + If pOffsetForRefFrame has nullptr value, then num_ref_frames_in_pic_order_cnt_cycle must also be "0". + + const int32_t* pOffsetForRefFrame + const StdVideoH264ScalingLists* pScalingListsMust be a valid pointer if seq_scaling_matrix_present_flag is set + const StdVideoH264SequenceParameterSetVui* pSequenceParameterSetVuiMust be a valid pointer if StdVideoH264SpsFlags:vui_parameters_present_flag is set + + + uint32_t transform_8x8_mode_flag : 1 + uint32_t redundant_pic_cnt_present_flag : 1 + uint32_t constrained_intra_pred_flag : 1 + uint32_t deblocking_filter_control_present_flag : 1 + uint32_t weighted_pred_flag : 1 + uint32_t bottom_field_pic_order_in_frame_present_flag : 1 + uint32_t entropy_coding_mode_flag : 1 + uint32_t pic_scaling_matrix_present_flag : 1 + + + StdVideoH264PpsFlags flags + uint8_t seq_parameter_set_id + uint8_t pic_parameter_set_id + uint8_t num_ref_idx_l0_default_active_minus1 + uint8_t num_ref_idx_l1_default_active_minus1 + StdVideoH264WeightedBipredIdc weighted_bipred_idc + int8_t pic_init_qp_minus26 + int8_t pic_init_qs_minus26 + int8_t chroma_qp_index_offset + int8_t second_chroma_qp_index_offset + const StdVideoH264ScalingLists* pScalingListsMust be a valid pointer if StdVideoH264PpsFlags::pic_scaling_matrix_present_flag is set. + + + + + + + + uint32_t field_pic_flag : 1Is field picture + uint32_t is_intra : 1Is intra picture + uint32_t IdrPicFlag : 1instantaneous decoding refresh (IDR) picture + uint32_t bottom_field_flag : 1bottom (true) or top (false) field if field_pic_flag is set. + uint32_t is_reference : 1This only applies to picture info, and not to the DPB lists. + uint32_t complementary_field_pair : 1complementary field pair, complementary non-reference field pair, complementary reference field pair + + + StdVideoDecodeH264PictureInfoFlags flags + uint8_t seq_parameter_set_idSelecting SPS id from the Sequence Parameters Set + uint8_t pic_parameter_set_idSelecting PPS id from the Picture Parameters Set + uint8_t reserved1Reserved for future use and must be initialized with 0. + uint8_t reserved2Reserved for future use and must be initialized with 0. + uint16_t frame_num7.4.3 Slice header semantics + uint16_t idr_pic_id7.4.3 Slice header semantics + + PicOrderCnt is based on TopFieldOrderCnt and BottomFieldOrderCnt. See 8.2.1 Decoding process for picture order count type 0 - 2 + + int32_t PicOrderCnt[STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE]TopFieldOrderCnt and BottomFieldOrderCnt fields. + + + uint32_t top_field_flag : 1Reference is used for top field reference. + uint32_t bottom_field_flag : 1Reference is used for bottom field reference. + uint32_t used_for_long_term_reference : 1A picture that is marked as "used for long-term reference", derived binary value from clause 8.2.5.1 Sequence of operations for decoded reference picture marking process + uint32_t is_non_existing : 1Must be handled in accordance with 8.2.5.2: Decoding process for gaps in frame_num + + + StdVideoDecodeH264ReferenceInfoFlags flags + + FrameNum = used_for_long_term_reference ? long_term_frame_idx : frame_num + + uint16_t FrameNum7.4.3.3 Decoded reference picture marking semantics + uint16_t reservedfor structure members 32-bit packing/alignment + int32_t PicOrderCnt[STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE]TopFieldOrderCnt and BottomFieldOrderCnt fields. + + + + + uint32_t luma_weight_l0_flageach bit n represents the nth entry in reference list l0, n <= num_ref_idx_l0_active_minus1 + uint32_t chroma_weight_l0_flageach bit n represents the nth entry in reference list l0, n <= num_ref_idx_l0_active_minus1 + uint32_t luma_weight_l1_flageach bit n represents the nth entry in reference list l1, n <= num_ref_idx_l1_active_minus1 + uint32_t chroma_weight_l1_flageach bit n represents the nth entry in reference list l1, n <= num_ref_idx_l1_active_minus1 + + + + + StdVideoEncodeH264WeightTable corresponds to the values produced by pred_weight_table() for the h.264 specification. + For details, refer to weighted_pred_flag, weighted_bipred_idc, pre_pred_weight_table_src and pred_weight_table(). + + StdVideoEncodeH264WeightTableFlags flags + uint8_t luma_log2_weight_denom + uint8_t chroma_log2_weight_denom + int8_t luma_weight_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF]valid entry range is [0, num_ref_idx_l0_active_minus1] + int8_t luma_offset_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF]valid entry range is [0, num_ref_idx_l0_active_minus1] + int8_t chroma_weight_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES][i][j]: valid entry range for i is [0, num_ref_idx_l0_active_minus1]; j = 0 for Cb, j = 1 for Cr + int8_t chroma_offset_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES][i][j]: valid entry range for i is [0, num_ref_idx_l0_active_minus1]; j = 0 for Cb, j = 1 for Cr + int8_t luma_weight_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF]valid entry range is [0, num_ref_idx_l1_active_minus1] + int8_t luma_offset_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF]valid entry range is [0, num_ref_idx_l1_active_minus1] + int8_t chroma_weight_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES][i][j]: valid entry range for i is [0, num_ref_idx_l1_active_minus1]; j = 0 for Cb, j = 1 for Cr + int8_t chroma_offset_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES][i][j]: valid entry range for i is [0, num_ref_idx_l1_active_minus1]; j = 0 for Cb, j = 1 for Cr + + + + uint32_t direct_spatial_mv_pred_flag : 1 + uint32_t num_ref_idx_active_override_flag : 1 + uint32_t reserved : 30 + + + uint32_t IdrPicFlag : 1 + uint32_t is_reference : 1A reference picture, i.e. a picture with nal_ref_idc not equal to 0, as defined in clause 3.136 + uint32_t no_output_of_prior_pics_flag : 1 + uint32_t long_term_reference_flag : 1 + uint32_t adaptive_ref_pic_marking_mode_flag : 1 + uint32_t reserved : 27 + + + uint32_t used_for_long_term_reference : 1A picture that is marked as "used for long-term reference", derived binary value from clause 8.2.5.1 Sequence of operations for decoded reference picture marking process + uint32_t reserved : 31 + + + uint32_t ref_pic_list_modification_flag_l0 : 1 + uint32_t ref_pic_list_modification_flag_l1 : 1 + uint32_t reserved : 30 + + + StdVideoH264ModificationOfPicNumsIdc modification_of_pic_nums_idc + uint16_t abs_diff_pic_num_minus1 + uint16_t long_term_pic_num + + + StdVideoH264MemMgmtControlOp memory_management_control_operation + uint16_t difference_of_pic_nums_minus1 + uint16_t long_term_pic_num + uint16_t long_term_frame_idx + uint16_t max_long_term_frame_idx_plus1 + + + StdVideoEncodeH264ReferenceListsInfoFlags flags + uint8_t num_ref_idx_l0_active_minus1 + uint8_t num_ref_idx_l1_active_minus1 + uint8_t RefPicList0[STD_VIDEO_H264_MAX_NUM_LIST_REF]slotIndex as used in VkVideoReferenceSlotInfoKHR structures or STD_VIDEO_H264_NO_REFERENCE_PICTURE + uint8_t RefPicList1[STD_VIDEO_H264_MAX_NUM_LIST_REF]slotIndex as used in VkVideoReferenceSlotInfoKHR structures or STD_VIDEO_H264_NO_REFERENCE_PICTURE + uint8_t refList0ModOpCount + uint8_t refList1ModOpCount + uint8_t refPicMarkingOpCount + uint8_t reserved1[7]Reserved for future use and must be initialized with 0. + const StdVideoEncodeH264RefListModEntry* pRefList0ModOperationsMust be a valid pointer to an array with size refList0ModOpCount if ref_pic_list_modification_flag_l0 is set and contains the RefList0 modification parameters as defined in section 7.4.3.1 + const StdVideoEncodeH264RefListModEntry* pRefList1ModOperationsMust be a valid pointer to an array with size refList1ModOpCount if ref_pic_list_modification_flag_l1 is set and contains the RefList1 modification parameters as defined in section 7.4.3.1 + const StdVideoEncodeH264RefPicMarkingEntry* pRefPicMarkingOperationsMust be a valid pointer to an array with size refPicMarkingOpCount and contains the reference picture markings as defined in section 7.4.3.3 + + + StdVideoEncodeH264PictureInfoFlags flags + uint8_t seq_parameter_set_idSelecting SPS id from the Sequence Parameters Set + uint8_t pic_parameter_set_idSelecting PPS from the Picture Parameters for all StdVideoEncodeH264SliceHeader(s) + uint16_t idr_pic_id + StdVideoH264PictureType primary_pic_type + uint32_t frame_num + int32_t PicOrderCntPicture order count, as defined in 8.2 + uint8_t temporal_idTemporal identifier of the picture, as defined in G.7.3.1.1 / G.7.4.1.1 + uint8_t reserved1[3]Reserved for future use and must be initialized with 0. + const StdVideoEncodeH264ReferenceListsInfo* pRefLists + + + StdVideoEncodeH264ReferenceInfoFlags flags + StdVideoH264PictureType primary_pic_type + uint32_t FrameNumFrame number, as defined in 8.2 + int32_t PicOrderCntPicture order count, as defined in 8.2 + uint16_t long_term_pic_num + uint16_t long_term_frame_idx + uint8_t temporal_idTemporal identifier of the picture, as defined in G.7.3.1.1 / G.7.4.1.1 + + + StdVideoEncodeH264SliceHeaderFlags flags + uint32_t first_mb_in_slice + StdVideoH264SliceType slice_type + int8_t slice_alpha_c0_offset_div2 + int8_t slice_beta_offset_div2 + int8_t slice_qp_delta + uint8_t reserved1Reserved for future use and must be initialized with 0. + StdVideoH264CabacInitIdc cabac_init_idc + StdVideoH264DisableDeblockingFilterIdc disable_deblocking_filter_idc + const StdVideoEncodeH264WeightTable* pWeightTable + + + + + + + + + + + + + uint32_t general_tier_flag : 1 + uint32_t general_progressive_source_flag : 1 + uint32_t general_interlaced_source_flag : 1 + uint32_t general_non_packed_constraint_flag : 1 + uint32_t general_frame_only_constraint_flag : 1 + + + StdVideoH265ProfileTierLevelFlags flags + StdVideoH265ProfileIdc general_profile_idc + StdVideoH265LevelIdc general_level_idc + + + uint32_t max_latency_increase_plus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]represents sps_max_latency_increase_plus1 or vps_max_latency_increase_plus1 + uint8_t max_dec_pic_buffering_minus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]represents sps_max_dec_pic_buffering_minus1 or vps_max_dec_pic_buffering_minus1 + uint8_t max_num_reorder_pics[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]represents sps_max_num_reorder_pics or vps_max_num_reorder_pics + + + uint32_t bit_rate_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE] + uint32_t cpb_size_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE] + uint32_t cpb_size_du_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE] + uint32_t bit_rate_du_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE] + uint32_t cbr_flageach bit represents a range of CpbCounts (bit 0 - cpb_cnt_minus1) per sub-layer + + + uint32_t nal_hrd_parameters_present_flag : 1 + uint32_t vcl_hrd_parameters_present_flag : 1 + uint32_t sub_pic_hrd_params_present_flag : 1 + uint32_t sub_pic_cpb_params_in_pic_timing_sei_flag : 1 + uint32_t fixed_pic_rate_general_flag : 8each bit represents a sublayer, bit 0 - vps_max_sub_layers_minus1 + uint32_t fixed_pic_rate_within_cvs_flag : 8each bit represents a sublayer, bit 0 - vps_max_sub_layers_minus1 + uint32_t low_delay_hrd_flag : 8each bit represents a sublayer, bit 0 - vps_max_sub_layers_minus1 + + + StdVideoH265HrdFlags flags + uint8_t tick_divisor_minus2 + uint8_t du_cpb_removal_delay_increment_length_minus1 + uint8_t dpb_output_delay_du_length_minus1 + uint8_t bit_rate_scale + uint8_t cpb_size_scale + uint8_t cpb_size_du_scale + uint8_t initial_cpb_removal_delay_length_minus1 + uint8_t au_cpb_removal_delay_length_minus1 + uint8_t dpb_output_delay_length_minus1 + uint8_t cpb_cnt_minus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE] + uint16_t elemental_duration_in_tc_minus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE] + uint16_t reserved[3]Reserved for future use and must be initialized with 0. + const StdVideoH265SubLayerHrdParameters* pSubLayerHrdParametersNalif flags.nal_hrd_parameters_present_flag is set, then this must be a ptr to an array of StdVideoH265SubLayerHrdParameters with a size specified by sps_max_sub_layers_minus1 + 1 or vps_max_sub_layers_minus1 + 1, depending on whether the HRD parameters are part of the SPS or VPS, respectively. + const StdVideoH265SubLayerHrdParameters* pSubLayerHrdParametersVclif flags.vcl_hrd_parameters_present_flag is set, then this must be a ptr to an array of StdVideoH265SubLayerHrdParameters with a size specified by sps_max_sub_layers_minus1 + 1 or vps_max_sub_layers_minus1 + 1, depending on whether the HRD parameters are part of the SPS or VPS, respectively. + + + uint32_t vps_temporal_id_nesting_flag : 1 + uint32_t vps_sub_layer_ordering_info_present_flag : 1 + uint32_t vps_timing_info_present_flag : 1 + uint32_t vps_poc_proportional_to_timing_flag : 1 + + + StdVideoH265VpsFlags flags + uint8_t vps_video_parameter_set_id + uint8_t vps_max_sub_layers_minus1 + uint8_t reserved1Reserved for future use and must be initialized with 0. + uint8_t reserved2Reserved for future use and must be initialized with 0. + uint32_t vps_num_units_in_tick + uint32_t vps_time_scale + uint32_t vps_num_ticks_poc_diff_one_minus1 + uint32_t reserved3Reserved for future use and must be initialized with 0. + const StdVideoH265DecPicBufMgr* pDecPicBufMgr + const StdVideoH265HrdParameters* pHrdParameters + const StdVideoH265ProfileTierLevel* pProfileTierLevel + + + uint8_t ScalingList4x4[STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS]ScalingList[ 0 ][ MatrixID ][ i ] (sizeID = 0) + uint8_t ScalingList8x8[STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS]ScalingList[ 1 ][ MatrixID ][ i ] (sizeID = 1) + uint8_t ScalingList16x16[STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS]ScalingList[ 2 ][ Matri]xID ][ i ] (sizeID = 2) + uint8_t ScalingList32x32[STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS]ScalingList[ 3 ][ MatrixID ][ i ] (sizeID = 3) + uint8_t ScalingListDCCoef16x16[STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS]scaling_list_dc_coef_minus8[ sizeID - 2 ][ matrixID ] + 8, sizeID = 2 + uint8_t ScalingListDCCoef32x32[STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS]scaling_list_dc_coef_minus8[ sizeID - 2 ][ matrixID ] + 8. sizeID = 3 + + + uint32_t inter_ref_pic_set_prediction_flag : 1 + uint32_t delta_rps_sign : 1 + + + StdVideoH265ShortTermRefPicSetFlags flags + uint32_t delta_idx_minus1 + uint16_t use_delta_flageach bit represents a use_delta_flag[j] syntax + uint16_t abs_delta_rps_minus1 + uint16_t used_by_curr_pic_flageach bit represents a used_by_curr_pic_flag[j] syntax + uint16_t used_by_curr_pic_s0_flageach bit represents a used_by_curr_pic_s0_flag[i] syntax + uint16_t used_by_curr_pic_s1_flageach bit represents a used_by_curr_pic_s1_flag[i] syntax + uint16_t reserved1Reserved for future use and must be initialized with 0. + uint8_t reserved2Reserved for future use and must be initialized with 0. + uint8_t reserved3Reserved for future use and must be initialized with 0. + uint8_t num_negative_pics + uint8_t num_positive_pics + uint16_t delta_poc_s0_minus1[STD_VIDEO_H265_MAX_DPB_SIZE] + uint16_t delta_poc_s1_minus1[STD_VIDEO_H265_MAX_DPB_SIZE] + + + uint32_t used_by_curr_pic_lt_sps_flageach bit represents a used_by_curr_pic_lt_sps_flag[i] syntax + uint32_t lt_ref_pic_poc_lsb_sps[STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS] + + + uint32_t aspect_ratio_info_present_flag : 1 + uint32_t overscan_info_present_flag : 1 + uint32_t overscan_appropriate_flag : 1 + uint32_t video_signal_type_present_flag : 1 + uint32_t video_full_range_flag : 1 + uint32_t colour_description_present_flag : 1 + uint32_t chroma_loc_info_present_flag : 1 + uint32_t neutral_chroma_indication_flag : 1 + uint32_t field_seq_flag : 1 + uint32_t frame_field_info_present_flag : 1 + uint32_t default_display_window_flag : 1 + uint32_t vui_timing_info_present_flag : 1 + uint32_t vui_poc_proportional_to_timing_flag : 1 + uint32_t vui_hrd_parameters_present_flag : 1 + uint32_t bitstream_restriction_flag : 1 + uint32_t tiles_fixed_structure_flag : 1 + uint32_t motion_vectors_over_pic_boundaries_flag : 1 + uint32_t restricted_ref_pic_lists_flag : 1 + + + StdVideoH265SpsVuiFlags flags + StdVideoH265AspectRatioIdc aspect_ratio_idc + uint16_t sar_width + uint16_t sar_height + uint8_t video_format + uint8_t colour_primaries + uint8_t transfer_characteristics + uint8_t matrix_coeffs + uint8_t chroma_sample_loc_type_top_field + uint8_t chroma_sample_loc_type_bottom_field + uint8_t reserved1Reserved for future use and must be initialized with 0. + uint8_t reserved2Reserved for future use and must be initialized with 0. + uint16_t def_disp_win_left_offset + uint16_t def_disp_win_right_offset + uint16_t def_disp_win_top_offset + uint16_t def_disp_win_bottom_offset + uint32_t vui_num_units_in_tick + uint32_t vui_time_scale + uint32_t vui_num_ticks_poc_diff_one_minus1 + uint16_t min_spatial_segmentation_idc + uint16_t reserved3Reserved for future use and must be initialized with 0. + uint8_t max_bytes_per_pic_denom + uint8_t max_bits_per_min_cu_denom + uint8_t log2_max_mv_length_horizontal + uint8_t log2_max_mv_length_vertical + const StdVideoH265HrdParameters* pHrdParameters + + + uint16_t PredictorPaletteEntries[STD_VIDEO_H265_PREDICTOR_PALETTE_COMPONENTS_LIST_SIZE][STD_VIDEO_H265_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE] + + + uint32_t sps_temporal_id_nesting_flag : 1 + uint32_t separate_colour_plane_flag : 1 + uint32_t conformance_window_flag : 1 + uint32_t sps_sub_layer_ordering_info_present_flag : 1 + uint32_t scaling_list_enabled_flag : 1 + uint32_t sps_scaling_list_data_present_flag : 1 + uint32_t amp_enabled_flag : 1 + uint32_t sample_adaptive_offset_enabled_flag : 1 + uint32_t pcm_enabled_flag : 1 + uint32_t pcm_loop_filter_disabled_flag : 1 + uint32_t long_term_ref_pics_present_flag : 1 + uint32_t sps_temporal_mvp_enabled_flag : 1 + uint32_t strong_intra_smoothing_enabled_flag : 1 + uint32_t vui_parameters_present_flag : 1 + uint32_t sps_extension_present_flag : 1 + uint32_t sps_range_extension_flag : 1 + + extension SPS flags, valid when STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS is set + + uint32_t transform_skip_rotation_enabled_flag : 1 + uint32_t transform_skip_context_enabled_flag : 1 + uint32_t implicit_rdpcm_enabled_flag : 1 + uint32_t explicit_rdpcm_enabled_flag : 1 + uint32_t extended_precision_processing_flag : 1 + uint32_t intra_smoothing_disabled_flag : 1 + uint32_t high_precision_offsets_enabled_flag : 1 + uint32_t persistent_rice_adaptation_enabled_flag : 1 + uint32_t cabac_bypass_alignment_enabled_flag : 1 + + extension SPS flags, valid when STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS is set + + uint32_t sps_scc_extension_flag : 1 + uint32_t sps_curr_pic_ref_enabled_flag : 1 + uint32_t palette_mode_enabled_flag : 1 + uint32_t sps_palette_predictor_initializers_present_flag : 1 + uint32_t intra_boundary_filtering_disabled_flag : 1 + + + StdVideoH265SpsFlags flags + StdVideoH265ChromaFormatIdc chroma_format_idc + uint32_t pic_width_in_luma_samples + uint32_t pic_height_in_luma_samples + uint8_t sps_video_parameter_set_id + uint8_t sps_max_sub_layers_minus1 + uint8_t sps_seq_parameter_set_id + uint8_t bit_depth_luma_minus8 + uint8_t bit_depth_chroma_minus8 + uint8_t log2_max_pic_order_cnt_lsb_minus4 + uint8_t log2_min_luma_coding_block_size_minus3 + uint8_t log2_diff_max_min_luma_coding_block_size + uint8_t log2_min_luma_transform_block_size_minus2 + uint8_t log2_diff_max_min_luma_transform_block_size + uint8_t max_transform_hierarchy_depth_inter + uint8_t max_transform_hierarchy_depth_intra + uint8_t num_short_term_ref_pic_sets + uint8_t num_long_term_ref_pics_sps + uint8_t pcm_sample_bit_depth_luma_minus1 + uint8_t pcm_sample_bit_depth_chroma_minus1 + uint8_t log2_min_pcm_luma_coding_block_size_minus3 + uint8_t log2_diff_max_min_pcm_luma_coding_block_size + uint8_t reserved1Reserved for future use and must be initialized with 0. + uint8_t reserved2Reserved for future use and must be initialized with 0. + + Start extension SPS flags, valid when STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS is set + + uint8_t palette_max_size + uint8_t delta_palette_max_predictor_size + uint8_t motion_vector_resolution_control_idc + uint8_t sps_num_palette_predictor_initializers_minus1 + + End extension SPS flags, valid when STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS is set + + uint32_t conf_win_left_offset + uint32_t conf_win_right_offset + uint32_t conf_win_top_offset + uint32_t conf_win_bottom_offset + const StdVideoH265ProfileTierLevel* pProfileTierLevel + const StdVideoH265DecPicBufMgr* pDecPicBufMgr + const StdVideoH265ScalingLists* pScalingListsMust be a valid pointer if sps_scaling_list_data_present_flag is set + const StdVideoH265ShortTermRefPicSet* pShortTermRefPicSetMust be a valid pointer to an array with size num_short_term_ref_pic_sets if num_short_term_ref_pic_sets is not 0. + const StdVideoH265LongTermRefPicsSps* pLongTermRefPicsSpsMust be a valid pointer if long_term_ref_pics_present_flag is set + const StdVideoH265SequenceParameterSetVui* pSequenceParameterSetVuiMust be a valid pointer if StdVideoH265SpsFlags:vui_parameters_present_flag is set palette_max_size + const StdVideoH265PredictorPaletteEntries* pPredictorPaletteEntriesMust be a valid pointer if sps_palette_predictor_initializer_present_flag is set + + + uint32_t dependent_slice_segments_enabled_flag : 1 + uint32_t output_flag_present_flag : 1 + uint32_t sign_data_hiding_enabled_flag : 1 + uint32_t cabac_init_present_flag : 1 + uint32_t constrained_intra_pred_flag : 1 + uint32_t transform_skip_enabled_flag : 1 + uint32_t cu_qp_delta_enabled_flag : 1 + uint32_t pps_slice_chroma_qp_offsets_present_flag : 1 + uint32_t weighted_pred_flag : 1 + uint32_t weighted_bipred_flag : 1 + uint32_t transquant_bypass_enabled_flag : 1 + uint32_t tiles_enabled_flag : 1 + uint32_t entropy_coding_sync_enabled_flag : 1 + uint32_t uniform_spacing_flag : 1 + uint32_t loop_filter_across_tiles_enabled_flag : 1 + uint32_t pps_loop_filter_across_slices_enabled_flag : 1 + uint32_t deblocking_filter_control_present_flag : 1 + uint32_t deblocking_filter_override_enabled_flag : 1 + uint32_t pps_deblocking_filter_disabled_flag : 1 + uint32_t pps_scaling_list_data_present_flag : 1 + uint32_t lists_modification_present_flag : 1 + uint32_t slice_segment_header_extension_present_flag : 1 + uint32_t pps_extension_present_flag : 1 + + extension PPS flags, valid when STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS is set + + uint32_t cross_component_prediction_enabled_flag : 1 + uint32_t chroma_qp_offset_list_enabled_flag : 1 + + extension PPS flags, valid when STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS is set + + uint32_t pps_curr_pic_ref_enabled_flag : 1 + uint32_t residual_adaptive_colour_transform_enabled_flag : 1 + uint32_t pps_slice_act_qp_offsets_present_flag : 1 + uint32_t pps_palette_predictor_initializers_present_flag : 1 + uint32_t monochrome_palette_flag : 1 + uint32_t pps_range_extension_flag : 1 + + + StdVideoH265PpsFlags flags + uint8_t pps_pic_parameter_set_id + uint8_t pps_seq_parameter_set_id + uint8_t sps_video_parameter_set_id + uint8_t num_extra_slice_header_bits + uint8_t num_ref_idx_l0_default_active_minus1 + uint8_t num_ref_idx_l1_default_active_minus1 + int8_t init_qp_minus26 + uint8_t diff_cu_qp_delta_depth + int8_t pps_cb_qp_offset + int8_t pps_cr_qp_offset + int8_t pps_beta_offset_div2 + int8_t pps_tc_offset_div2 + uint8_t log2_parallel_merge_level_minus2 + + extension PPS, valid when STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS is set + + uint8_t log2_max_transform_skip_block_size_minus2 + uint8_t diff_cu_chroma_qp_offset_depth + uint8_t chroma_qp_offset_list_len_minus1 + int8_t cb_qp_offset_list[STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE] + int8_t cr_qp_offset_list[STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE] + uint8_t log2_sao_offset_scale_luma + uint8_t log2_sao_offset_scale_chroma + + extension PPS, valid when STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS is set + + int8_t pps_act_y_qp_offset_plus5 + int8_t pps_act_cb_qp_offset_plus5 + int8_t pps_act_cr_qp_offset_plus3 + uint8_t pps_num_palette_predictor_initializers + uint8_t luma_bit_depth_entry_minus8 + uint8_t chroma_bit_depth_entry_minus8 + uint8_t num_tile_columns_minus1 + uint8_t num_tile_rows_minus1 + uint8_t reserved1Reserved for future use and must be initialized with 0. + uint8_t reserved2Reserved for future use and must be initialized with 0. + uint16_t column_width_minus1[STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_COLS_LIST_SIZE] + uint16_t row_height_minus1[STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_ROWS_LIST_SIZE] + uint32_t reserved3Reserved for future use and must be initialized with 0. + const StdVideoH265ScalingLists* pScalingListsMust be a valid pointer if pps_scaling_list_data_present_flag is set + const StdVideoH265PredictorPaletteEntries* pPredictorPaletteEntriesMust be a valid pointer if pps_palette_predictor_initializer_present_flag is set + + + + + uint32_t IrapPicFlag : 1 + uint32_t IdrPicFlag : 1 + uint32_t IsReference : 1 + uint32_t short_term_ref_pic_set_sps_flag : 1 + + + StdVideoDecodeH265PictureInfoFlags flags + uint8_t sps_video_parameter_set_idSelecting VPS id from the Video Parameters Set + uint8_t pps_seq_parameter_set_idSelecting SPS id from the Sequence Parameters Set + uint8_t pps_pic_parameter_set_idSelecting PPS id from the Picture Parameters Set + uint8_t NumDeltaPocsOfRefRpsIdxNumDeltaPocs[ RefRpsIdx ] when short_term_ref_pic_set_sps_flag = 1, otherwise 0 + int32_t PicOrderCntVal + uint16_t NumBitsForSTRefPicSetInSlicenumber of bits used in st_ref_pic_set() when short_term_ref_pic_set_sps_flag is 0otherwise set to 0. + uint16_t reserved + uint8_t RefPicSetStCurrBefore[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE]slotIndex as used in VkVideoReferenceSlotInfoKHR structures representing pReferenceSlots in VkVideoDecodeInfoKHR or STD_VIDEO_H265_NO_REFERENCE_PICTURE + uint8_t RefPicSetStCurrAfter[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE]slotIndex as used in VkVideoReferenceSlotInfoKHR structures representing pReferenceSlots in VkVideoDecodeInfoKHR or STD_VIDEO_H265_NO_REFERENCE_PICTURE + uint8_t RefPicSetLtCurr[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE]slotIndex as used in VkVideoReferenceSlotInfoKHR structures representing pReferenceSlots in VkVideoDecodeInfoKHR or STD_VIDEO_H265_NO_REFERENCE_PICTURE + + + uint32_t used_for_long_term_reference : 1A picture that is marked as "used for long-term reference", derived binary value from clause 8.3.2 Decoding process for reference picture set + uint32_t unused_for_reference : 1A picture that is marked as "unused for reference", derived binary value from clause 8.3.2 Decoding process for reference picture set + + + StdVideoDecodeH265ReferenceInfoFlags flags + int32_t PicOrderCntVal + + + + + uint16_t luma_weight_l0_flageach bit n represents the nth entry in reference list l0, n <= num_ref_idx_l0_active_minus1 + uint16_t chroma_weight_l0_flageach bit n represents the nth entry in reference list l0, n <= num_ref_idx_l0_active_minus1 + uint16_t luma_weight_l1_flageach bit n represents the nth entry in reference list l1, n <= num_ref_idx_l1_active_minus1 + uint16_t chroma_weight_l1_flageach bit n represents the nth entry in reference list l1, n <= num_ref_idx_l1_active_minus1 + + + + + StdVideoEncodeH265WeightTable corresponds to the values produced by pred_weight_table() for the h.265 specification. + For details, refer to weighted_pred_flag, weighted_bipred_flag and pred_weight_table(). + + StdVideoEncodeH265WeightTableFlags flags + uint8_t luma_log2_weight_denom[0, 7] + int8_t delta_chroma_log2_weight_denom + int8_t delta_luma_weight_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF]comment + int8_t luma_offset_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF]comment + int8_t delta_chroma_weight_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES][i][j]: valid entry range for i is [0, num_ref_idx_l0_active_minus1]; j = 0 for Cb, j = 1 for Cr + int8_t delta_chroma_offset_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES][i][j]: valid entry range for i is [0, num_ref_idx_l0_active_minus1]; j = 0 for Cb, j = 1 for Cr + int8_t delta_luma_weight_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF] + int8_t luma_offset_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF] + int8_t delta_chroma_weight_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES][i][j]: valid entry range for i is [0, num_ref_idx_l1_active_minus1]; j = 0 for Cb, j = 1 for Cr + int8_t delta_chroma_offset_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES][i][j]: valid entry range for i is [0, num_ref_idx_l1_active_minus1]; j = 0 for Cb, j = 1 for Cr + + + + uint8_t num_long_term_sps + uint8_t num_long_term_pics + uint8_t lt_idx_sps[STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS] + uint8_t poc_lsb_lt[STD_VIDEO_H265_MAX_LONG_TERM_PICS] + uint16_t used_by_curr_pic_lt_flageach bit represents a used_by_curr_pic_lt_flag[i] syntax + uint8_t delta_poc_msb_present_flag[STD_VIDEO_H265_MAX_DELTA_POC] + uint8_t delta_poc_msb_cycle_lt[STD_VIDEO_H265_MAX_DELTA_POC] + + + + uint32_t first_slice_segment_in_pic_flag : 1 + uint32_t dependent_slice_segment_flag : 1 + uint32_t slice_sao_luma_flag : 1 + uint32_t slice_sao_chroma_flag : 1 + uint32_t num_ref_idx_active_override_flag : 1 + uint32_t mvd_l1_zero_flag : 1 + uint32_t cabac_init_flag : 1 + uint32_t cu_chroma_qp_offset_enabled_flag : 1 + uint32_t deblocking_filter_override_flag : 1 + uint32_t slice_deblocking_filter_disabled_flag : 1 + uint32_t collocated_from_l0_flag : 1 + uint32_t slice_loop_filter_across_slices_enabled_flag : 1 + uint32_t reserved : 20 + + + StdVideoEncodeH265SliceSegmentHeaderFlags flags + StdVideoH265SliceType slice_type + uint32_t slice_segment_address + uint8_t collocated_ref_idx + uint8_t MaxNumMergeCand + int8_t slice_cb_qp_offset[-12, 12] + int8_t slice_cr_qp_offset[-12, 12] + int8_t slice_beta_offset_div2[-6, 6] + int8_t slice_tc_offset_div2[-6, 6] + int8_t slice_act_y_qp_offset + int8_t slice_act_cb_qp_offset + int8_t slice_act_cr_qp_offset + int8_t slice_qp_delta + uint16_t reserved1Reserved for future use and must be initialized with 0. + const StdVideoEncodeH265WeightTable* pWeightTable + + + uint32_t ref_pic_list_modification_flag_l0 : 1 + uint32_t ref_pic_list_modification_flag_l1 : 1 + uint32_t reserved : 30 + + + StdVideoEncodeH265ReferenceListsInfoFlags flags + uint8_t num_ref_idx_l0_active_minus1 + uint8_t num_ref_idx_l1_active_minus1 + uint8_t RefPicList0[STD_VIDEO_H265_MAX_NUM_LIST_REF]slotIndex as used in VkVideoReferenceSlotInfoKHR structures or STD_VIDEO_H265_NO_REFERENCE_PICTURE + uint8_t RefPicList1[STD_VIDEO_H265_MAX_NUM_LIST_REF]slotIndex as used in VkVideoReferenceSlotInfoKHR structures or STD_VIDEO_H265_NO_REFERENCE_PICTURE + uint8_t list_entry_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF] + uint8_t list_entry_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF] + + + uint32_t is_reference : 1A reference picture, as defined in clause 3.132 + uint32_t IrapPicFlag : 1A reference picture, as defined in clause 3.73 + uint32_t used_for_long_term_reference : 1A picture that is marked as "used for long-term reference", derived binary value from clause 8.3.2 Decoding process for reference picture set + uint32_t discardable_flag : 1 + uint32_t cross_layer_bla_flag : 1 + uint32_t pic_output_flag : 1 + uint32_t no_output_of_prior_pics_flag : 1 + uint32_t short_term_ref_pic_set_sps_flag : 1 + uint32_t slice_temporal_mvp_enabled_flag : 1 + uint32_t reserved : 23 + + + StdVideoEncodeH265PictureInfoFlags flags + StdVideoH265PictureType pic_type + uint8_t sps_video_parameter_set_idSelecting VPS id from the Video Parameters Set + uint8_t pps_seq_parameter_set_idSelecting SPS id from the Sequence Parameters Set + uint8_t pps_pic_parameter_set_idSelecting PPS id from the Picture Parameters Set + uint8_t short_term_ref_pic_set_idx + int32_t PicOrderCntValPicture order count derived as specified in 8.3.1 + uint8_t TemporalIdTemporal ID, as defined in 7.4.2.2 + uint8_t reserved1[7]Reserved for future use and must be initialized with 0. + const StdVideoEncodeH265ReferenceListsInfo* pRefLists + const StdVideoH265ShortTermRefPicSet* pShortTermRefPicSetMust be a valid pointer if short_term_ref_pic_set_sps_flag is not set + const StdVideoEncodeH265LongTermRefPics* pLongTermRefPicsMust be a valid pointer if long_term_ref_pics_present_flag is set + + + uint32_t used_for_long_term_reference : 1A picture that is marked as "used for long-term reference", derived binary value from clause 8.3.2 Decoding process for reference picture set + uint32_t unused_for_reference : 1A picture that is marked as "unused for reference", derived binary value from clause 8.3.2 Decoding process for reference picture set + uint32_t reserved : 30 + + + + StdVideoEncodeH265ReferenceInfoFlags flags + StdVideoH265PictureType pic_type + int32_t PicOrderCntValPicture order count derived as specified in 8.3.1 + uint8_t TemporalIdTemporal ID, as defined in 7.4.2.2 + + + + + + + + + + + + + + + + + Syntax defined in section 5.5.2, semantics defined in section 6.4.2 + uint32_t mono_chrome : 1 + uint32_t color_range : 1 + uint32_t separate_uv_delta_q : 1 + uint32_t color_description_present_flag : 1 + uint32_t reserved : 28 + + + Syntax defined in section 5.5.2, semantics defined in section 6.4.2 + StdVideoAV1ColorConfigFlags flags + uint8_t BitDepth + uint8_t subsampling_x + uint8_t subsampling_y + uint8_t reserved1Reserved for future use and must be initialized with 0. + StdVideoAV1ColorPrimaries color_primaries + StdVideoAV1TransferCharacteristics transfer_characteristics + StdVideoAV1MatrixCoefficients matrix_coefficients + StdVideoAV1ChromaSamplePosition chroma_sample_position + + + Syntax defined in section 5.5.3, semantics defined in section 6.4.3 + uint32_t equal_picture_interval : 1 + uint32_t reserved : 31 + + + Syntax defined in section 5.5.3, semantics defined in section 6.4.3 + StdVideoAV1TimingInfoFlags flags + uint32_t num_units_in_display_tick + uint32_t time_scale + uint32_t num_ticks_per_picture_minus_1 + + + Syntax defined in section 5.5, semantics defined in section 6.4 + uint32_t still_picture : 1 + uint32_t reduced_still_picture_header : 1 + uint32_t use_128x128_superblock : 1 + uint32_t enable_filter_intra : 1 + uint32_t enable_intra_edge_filter : 1 + uint32_t enable_interintra_compound : 1 + uint32_t enable_masked_compound : 1 + uint32_t enable_warped_motion : 1 + uint32_t enable_dual_filter : 1 + uint32_t enable_order_hint : 1 + uint32_t enable_jnt_comp : 1 + uint32_t enable_ref_frame_mvs : 1 + uint32_t frame_id_numbers_present_flag : 1 + uint32_t enable_superres : 1 + uint32_t enable_cdef : 1 + uint32_t enable_restoration : 1 + uint32_t film_grain_params_present : 1 + uint32_t timing_info_present_flag : 1 + uint32_t initial_display_delay_present_flag : 1 + uint32_t reserved : 13 + + + Syntax defined in section 5.5, semantics defined in section 6.4 + StdVideoAV1SequenceHeaderFlags flags + StdVideoAV1Profile seq_profile + uint8_t frame_width_bits_minus_1 + uint8_t frame_height_bits_minus_1 + uint16_t max_frame_width_minus_1 + uint16_t max_frame_height_minus_1 + uint8_t delta_frame_id_length_minus_2 + uint8_t additional_frame_id_length_minus_1 + uint8_t order_hint_bits_minus_1 + uint8_t seq_force_integer_mvThe final value of of seq_force_integer_mv per the value of seq_choose_integer_mv. + uint8_t seq_force_screen_content_toolsThe final value of of seq_force_screen_content_tools per the value of seq_choose_screen_content_tools. + uint8_t reserved1[5]Reserved for future use and must be initialized with 0. + const StdVideoAV1ColorConfig* pColorConfig + const StdVideoAV1TimingInfo* pTimingInfo + + + Syntax defined in section 5.9.11, semantics defined in section 6.8.10 + uint32_t loop_filter_delta_enabled : 1 + uint32_t loop_filter_delta_update : 1 + uint32_t reserved : 30 + + + Syntax defined in section 5.9.11, semantics defined in section 6.8.10 + StdVideoAV1LoopFilterFlags flags + uint8_t loop_filter_level[STD_VIDEO_AV1_MAX_LOOP_FILTER_STRENGTHS] + uint8_t loop_filter_sharpness + uint8_t update_ref_delta + int8_t loop_filter_ref_deltas[STD_VIDEO_AV1_TOTAL_REFS_PER_FRAME] + uint8_t update_mode_delta + int8_t loop_filter_mode_deltas[STD_VIDEO_AV1_LOOP_FILTER_ADJUSTMENTS] + + + Syntax defined in section 5.9.12, semantics defined in section 6.8.11 + uint32_t using_qmatrix : 1 + uint32_t diff_uv_delta : 1 + uint32_t reserved : 30 + + + Syntax defined in section 5.9.12, semantics defined in section 6.8.11 + StdVideoAV1QuantizationFlags flags + uint8_t base_q_idx + int8_t DeltaQYDc + int8_t DeltaQUDc + int8_t DeltaQUAc + int8_t DeltaQVDc + int8_t DeltaQVAc + uint8_t qm_y + uint8_t qm_u + uint8_t qm_v + + + Syntax defined in section 5.9.14, semantics defined in section 6.8.13 + uint8_t FeatureEnabled[STD_VIDEO_AV1_MAX_SEGMENTS]Each element contains 8 (SEG_LVL_MAX) bits, one bit for each feature within the segment + int16_t FeatureData[STD_VIDEO_AV1_MAX_SEGMENTS][STD_VIDEO_AV1_SEG_LVL_MAX] + + + Syntax defined in section 5.9.15, semantics defined in section 6.8.14 + uint32_t uniform_tile_spacing_flag : 1 + uint32_t reserved : 31 + + + Syntax defined in section 5.9.15, semantics defined in section 6.8.14 + StdVideoAV1TileInfoFlags flags + uint8_t TileCols + uint8_t TileRows + uint16_t context_update_tile_id + uint8_t tile_size_bytes_minus_1 + uint8_t reserved1[7]Reserved for future use and must be initialized with 0. + const uint16_t* pMiColStartsTileCols number of elements + const uint16_t* pMiRowStartsTileRows number of elements + const uint16_t* pWidthInSbsMinus1TileCols number of elements + const uint16_t* pHeightInSbsMinus1TileRows number of elements + + + Syntax defined in section 5.9.19, semantics defined in section 6.10.14 + uint8_t cdef_damping_minus_3 + uint8_t cdef_bits + uint8_t cdef_y_pri_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS] + uint8_t cdef_y_sec_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS] + uint8_t cdef_uv_pri_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS] + uint8_t cdef_uv_sec_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS] + + + Syntax defined in section 5.9.20, semantics defined in section 6.10.15 + StdVideoAV1FrameRestorationType FrameRestorationType[STD_VIDEO_AV1_MAX_NUM_PLANES] + uint16_t LoopRestorationSize[STD_VIDEO_AV1_MAX_NUM_PLANES] + + + Syntax defined in section 5.9.24, semantics defined in section 7.10 + uint8_t GmType[STD_VIDEO_AV1_NUM_REF_FRAMES] + int32_t gm_params[STD_VIDEO_AV1_NUM_REF_FRAMES][STD_VIDEO_AV1_GLOBAL_MOTION_PARAMS] + + + Syntax defined in section 5.9.30, semantics defined in section 6.8.20 + uint32_t chroma_scaling_from_luma : 1 + uint32_t overlap_flag : 1 + uint32_t clip_to_restricted_range : 1 + uint32_t update_grain : 1 + uint32_t reserved : 28 + + + Syntax defined in section 5.9.30, semantics defined in section 6.8.20 + StdVideoAV1FilmGrainFlags flags + uint8_t grain_scaling_minus_8 + uint8_t ar_coeff_lag + uint8_t ar_coeff_shift_minus_6 + uint8_t grain_scale_shift + uint16_t grain_seed + uint8_t film_grain_params_ref_idx + uint8_t num_y_points + uint8_t point_y_value[STD_VIDEO_AV1_MAX_NUM_Y_POINTS] + uint8_t point_y_scaling[STD_VIDEO_AV1_MAX_NUM_Y_POINTS] + uint8_t num_cb_points + uint8_t point_cb_value[STD_VIDEO_AV1_MAX_NUM_CB_POINTS] + uint8_t point_cb_scaling[STD_VIDEO_AV1_MAX_NUM_CB_POINTS] + uint8_t num_cr_points + uint8_t point_cr_value[STD_VIDEO_AV1_MAX_NUM_CR_POINTS] + uint8_t point_cr_scaling[STD_VIDEO_AV1_MAX_NUM_CR_POINTS] + int8_t ar_coeffs_y_plus_128[STD_VIDEO_AV1_MAX_NUM_POS_LUMA] + int8_t ar_coeffs_cb_plus_128[STD_VIDEO_AV1_MAX_NUM_POS_CHROMA] + int8_t ar_coeffs_cr_plus_128[STD_VIDEO_AV1_MAX_NUM_POS_CHROMA] + uint8_t cb_mult + uint8_t cb_luma_mult + uint16_t cb_offset + uint8_t cr_mult + uint8_t cr_luma_mult + uint16_t cr_offset + + + Syntax defined in section 5.9, semantics defined in section 6.8 + uint32_t error_resilient_mode : 1 + uint32_t disable_cdf_update : 1 + uint32_t use_superres : 1 + uint32_t render_and_frame_size_different : 1 + uint32_t allow_screen_content_tools : 1 + uint32_t is_filter_switchable : 1 + uint32_t force_integer_mv : 1 + uint32_t frame_size_override_flag : 1 + uint32_t buffer_removal_time_present_flag : 1 + uint32_t allow_intrabc : 1 + uint32_t frame_refs_short_signaling : 1 + uint32_t allow_high_precision_mv : 1 + uint32_t is_motion_mode_switchable : 1 + uint32_t use_ref_frame_mvs : 1 + uint32_t disable_frame_end_update_cdf : 1 + uint32_t allow_warped_motion : 1 + uint32_t reduced_tx_set : 1 + uint32_t reference_select : 1 + uint32_t skip_mode_present : 1 + uint32_t delta_q_present : 1 + uint32_t delta_lf_present : 1 + uint32_t delta_lf_multi : 1 + uint32_t segmentation_enabled : 1 + uint32_t segmentation_update_map : 1 + uint32_t segmentation_temporal_update : 1 + uint32_t segmentation_update_data : 1 + uint32_t UsesLr : 1 + uint32_t usesChromaLr : 1 + uint32_t apply_grain : 1 + uint32_t reserved : 3 + + + Syntax defined in sections 5.9 and 5.11.1, semantics defined in sections 6.8 and 6.10.1 + StdVideoDecodeAV1PictureInfoFlags flags + StdVideoAV1FrameType frame_type + uint32_t current_frame_id + uint8_t OrderHint + uint8_t primary_ref_frame + uint8_t refresh_frame_flags + uint8_t reserved1Reserved for future use and must be initialized with 0. + StdVideoAV1InterpolationFilter interpolation_filter + StdVideoAV1TxMode TxMode + uint8_t delta_q_res + uint8_t delta_lf_res + uint8_t SkipModeFrame[STD_VIDEO_AV1_SKIP_MODE_FRAMES] + uint8_t coded_denom + uint8_t reserved2[3]Reserved for future use and must be initialized with 0. + uint8_t OrderHints[STD_VIDEO_AV1_NUM_REF_FRAMES] + uint32_t expectedFrameId[STD_VIDEO_AV1_NUM_REF_FRAMES] + const StdVideoAV1TileInfo* pTileInfo + const StdVideoAV1Quantization* pQuantization + const StdVideoAV1Segmentation* pSegmentation + const StdVideoAV1LoopFilter* pLoopFilter + const StdVideoAV1CDEF* pCDEF + const StdVideoAV1LoopRestoration* pLoopRestoration + const StdVideoAV1GlobalMotion* pGlobalMotion + const StdVideoAV1FilmGrain* pFilmGrain + + + uint32_t disable_frame_end_update_cdf : 1 + uint32_t segmentation_enabled : 1 + uint32_t reserved : 30 + + + StdVideoDecodeAV1ReferenceInfoFlags flags + uint8_t frame_type + uint8_t RefFrameSignBias + uint8_t OrderHint + uint8_t SavedOrderHints[STD_VIDEO_AV1_NUM_REF_FRAMES] + + + Syntax defined in section 5.3.3, semantics defined in section 6.2.3 + uint8_t temporal_id + uint8_t spatial_id + + + uint8_t buffer_delay_length_minus_1 + uint8_t buffer_removal_time_length_minus_1 + uint8_t frame_presentation_time_length_minus_1 + uint8_t reserved1Reserved for future use and must be initialized with 0. + uint32_t num_units_in_decoding_tick + + + uint32_t decoder_model_present_for_this_op : 1 + uint32_t low_delay_mode_flag : 1 + uint32_t initial_display_delay_present_for_this_op : 1 + uint32_t reserved : 29 + + + StdVideoEncodeAV1OperatingPointInfoFlags flags + uint16_t operating_point_idc + uint8_t seq_level_idx + uint8_t seq_tier + uint32_t decoder_buffer_delay + uint32_t encoder_buffer_delay + uint8_t initial_display_delay_minus_1 + + + Syntax defined in section 5.9, semantics defined in section 6.8 + uint32_t error_resilient_mode : 1 + uint32_t disable_cdf_update : 1 + uint32_t use_superres : 1 + uint32_t render_and_frame_size_different : 1 + uint32_t allow_screen_content_tools : 1 + uint32_t is_filter_switchable : 1 + uint32_t force_integer_mv : 1 + uint32_t frame_size_override_flag : 1 + uint32_t buffer_removal_time_present_flag : 1 + uint32_t allow_intrabc : 1 + uint32_t frame_refs_short_signaling : 1 + uint32_t allow_high_precision_mv : 1 + uint32_t is_motion_mode_switchable : 1 + uint32_t use_ref_frame_mvs : 1 + uint32_t disable_frame_end_update_cdf : 1 + uint32_t allow_warped_motion : 1 + uint32_t reduced_tx_set : 1 + uint32_t skip_mode_present : 1 + uint32_t delta_q_present : 1 + uint32_t delta_lf_present : 1 + uint32_t delta_lf_multi : 1 + uint32_t segmentation_enabled : 1 + uint32_t segmentation_update_map : 1 + uint32_t segmentation_temporal_update : 1 + uint32_t segmentation_update_data : 1 + uint32_t UsesLr : 1 + uint32_t usesChromaLr : 1 + uint32_t show_frame : 1 + uint32_t showable_frame : 1 + uint32_t reserved : 3 + + + Syntax defined in sections 5.9 and 5.11.1, semantics defined in sections 6.8 and 6.10.1 + StdVideoEncodeAV1PictureInfoFlags flags + StdVideoAV1FrameType frame_type + uint32_t frame_presentation_time + uint32_t current_frame_id + uint8_t order_hint + uint8_t primary_ref_frame + uint8_t refresh_frame_flags + uint8_t coded_denom + uint16_t render_width_minus_1 + uint16_t render_height_minus_1 + StdVideoAV1InterpolationFilter interpolation_filter + StdVideoAV1TxMode TxMode + uint8_t delta_q_res + uint8_t delta_lf_res + uint8_t ref_order_hint[STD_VIDEO_AV1_NUM_REF_FRAMES] + int8_t ref_frame_idx[STD_VIDEO_AV1_REFS_PER_FRAME] + uint8_t reserved1[3]Reserved for future use and must be initialized with 0. + uint32_t delta_frame_id_minus_1[STD_VIDEO_AV1_REFS_PER_FRAME] + const StdVideoAV1TileInfo* pTileInfo + const StdVideoAV1Quantization* pQuantization + const StdVideoAV1Segmentation* pSegmentation + const StdVideoAV1LoopFilter* pLoopFilter + const StdVideoAV1CDEF* pCDEF + const StdVideoAV1LoopRestoration* pLoopRestoration + const StdVideoAV1GlobalMotion* pGlobalMotion + const StdVideoEncodeAV1ExtensionHeader* pExtensionHeader + const uint32_t* pBufferRemovalTimes + + + + uint32_t disable_frame_end_update_cdf : 1 + uint32_t segmentation_enabled : 1 + uint32_t reserved : 30 + + + StdVideoEncodeAV1ReferenceInfoFlags flags + uint32_t RefFrameId + StdVideoAV1FrameType frame_type + uint8_t OrderHint + uint8_t reserved1[3]Reserved for future use and must be initialized with 0. + const StdVideoEncodeAV1ExtensionHeader* pExtensionHeader + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + reserved STD_VIDEO_H264_SLICE_TYPE_SP = 3 + reserved STD_VIDEO_H264_SLICE_TYPE_SI = 4 + + + + + + + + + reserved STD_VIDEO_H264_PICTURE_TYPE_SP = 3 + reserved STD_VIDEO_H264_PICTURE_TYPE_SI = 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dlls/winevulkan/vk.xml b/dlls/winevulkan/vk.xml new file mode 100644 index 000000000000..8d90b8d1eb3a --- /dev/null +++ b/dlls/winevulkan/vk.xml @@ -0,0 +1,29084 @@ + + + +Copyright 2015-2024 The Khronos Group Inc. + +SPDX-License-Identifier: Apache-2.0 OR MIT + + + +This file, vk.xml, is the Vulkan API Registry. It is a critically important +and normative part of the Vulkan Specification, including a canonical +machine-readable definition of the API, parameter and member validation +language incorporated into the Specification and reference pages, and other +material which is registered by Khronos, such as tags used by extension and +layer authors. The authoritative public version of vk.xml is maintained in +the default branch (currently named main) of the Khronos Vulkan GitHub +project. The authoritative private version is maintained in the default +branch of the member gitlab server. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #include "vk_platform.h" + + WSI extensions + + + + + + + + + + + + + + In the current header structure, each platform's interfaces + are confined to a platform-specific header (vulkan_xlib.h, + vulkan_win32.h, etc.). These headers are not self-contained, + and should not include native headers (X11/Xlib.h, + windows.h, etc.). Code should either include vulkan.h after + defining the appropriate VK_USE_PLATFORM_platform + macros, or include the required native headers prior to + explicitly including the corresponding platform header. + + To accomplish this, the dependencies of native types require + native headers, but the XML defines the content for those + native headers as empty. The actual native header includes + can be restored by modifying the native header tags above + to #include the header file in the 'name' attribute. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + // DEPRECATED: This define is deprecated. VK_MAKE_API_VERSION should be used instead. +#define VK_MAKE_VERSION(major, minor, patch) \ + ((((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch))) + // DEPRECATED: This define is deprecated. VK_API_VERSION_MAJOR should be used instead. +#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22U) + // DEPRECATED: This define is deprecated. VK_API_VERSION_MINOR should be used instead. +#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU) + // DEPRECATED: This define is deprecated. VK_API_VERSION_PATCH should be used instead. +#define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU) + + #define VK_MAKE_API_VERSION(variant, major, minor, patch) \ + ((((uint32_t)(variant)) << 29U) | (((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch))) + #define VK_API_VERSION_VARIANT(version) ((uint32_t)(version) >> 29U) + #define VK_API_VERSION_MAJOR(version) (((uint32_t)(version) >> 22U) & 0x7FU) + #define VK_API_VERSION_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU) + #define VK_API_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU) + + // Vulkan SC variant number +#define VKSC_API_VARIANT 1 + + // DEPRECATED: This define has been removed. Specific version defines (e.g. VK_API_VERSION_1_0), or the VK_MAKE_VERSION macro, should be used instead. +//#define VK_API_VERSION VK_MAKE_API_VERSION(0, 1, 0, 0) // Patch version should always be set to 0 + // Vulkan 1.0 version number +#define VK_API_VERSION_1_0 VK_MAKE_API_VERSION(0, 1, 0, 0)// Patch version should always be set to 0 + // Vulkan 1.1 version number +#define VK_API_VERSION_1_1 VK_MAKE_API_VERSION(0, 1, 1, 0)// Patch version should always be set to 0 + // Vulkan 1.2 version number +#define VK_API_VERSION_1_2 VK_MAKE_API_VERSION(0, 1, 2, 0)// Patch version should always be set to 0 + // Vulkan 1.3 version number +#define VK_API_VERSION_1_3 VK_MAKE_API_VERSION(0, 1, 3, 0)// Patch version should always be set to 0 + // Vulkan 1.4 version number +#define VK_API_VERSION_1_4 VK_MAKE_API_VERSION(0, 1, 4, 0)// Patch version should always be set to 0 + // Vulkan SC 1.0 version number +#define VKSC_API_VERSION_1_0 VK_MAKE_API_VERSION(VKSC_API_VARIANT, 1, 0, 0)// Patch version should always be set to 0 + + // Version of this file +#define VK_HEADER_VERSION 303 + // Complete version of this file +#define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 4, VK_HEADER_VERSION) + // Version of this file +#define VK_HEADER_VERSION 16 + // Complete version of this file +#define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(VKSC_API_VARIANT, 1, 0, VK_HEADER_VERSION) + + +#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; + +#define VK_DEFINE_HANDLE(object) typedef struct object##_T* (object); + + +#ifndef VK_USE_64_BIT_PTR_DEFINES + #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) || (defined(__riscv) && __riscv_xlen == 64) + #define VK_USE_64_BIT_PTR_DEFINES 1 + #else + #define VK_USE_64_BIT_PTR_DEFINES 0 + #endif +#endif + +#ifndef VK_DEFINE_NON_DISPATCHABLE_HANDLE + #if (VK_USE_64_BIT_PTR_DEFINES==1) + #if (defined(__cplusplus) && (__cplusplus >= 201103L)) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201103L)) + #define VK_NULL_HANDLE nullptr + #else + #define VK_NULL_HANDLE ((void*)0) + #endif + #else + #define VK_NULL_HANDLE 0ULL + #endif +#endif +#ifndef VK_NULL_HANDLE + #define VK_NULL_HANDLE 0 +#endif + +#ifndef VK_DEFINE_NON_DISPATCHABLE_HANDLE + #if (VK_USE_64_BIT_PTR_DEFINES==1) + #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object; + #else + #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; + #endif +#endif + +#ifndef VK_DEFINE_NON_DISPATCHABLE_HANDLE + #if (VK_USE_64_BIT_PTR_DEFINES==1) + #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *(object); + #else + #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t (object); + #endif +#endif + + struct ANativeWindow; + struct AHardwareBuffer; + #ifdef __OBJC__ +@class CAMetalLayer; +#else +typedef void CAMetalLayer; +#endif + #ifdef __OBJC__ +@protocol MTLDevice; +typedef __unsafe_unretained id<MTLDevice> MTLDevice_id; +#else +typedef void* MTLDevice_id; +#endif + #ifdef __OBJC__ +@protocol MTLCommandQueue; +typedef __unsafe_unretained id<MTLCommandQueue> MTLCommandQueue_id; +#else +typedef void* MTLCommandQueue_id; +#endif + #ifdef __OBJC__ +@protocol MTLBuffer; +typedef __unsafe_unretained id<MTLBuffer> MTLBuffer_id; +#else +typedef void* MTLBuffer_id; +#endif + #ifdef __OBJC__ +@protocol MTLTexture; +typedef __unsafe_unretained id<MTLTexture> MTLTexture_id; +#else +typedef void* MTLTexture_id; +#endif + #ifdef __OBJC__ +@protocol MTLSharedEvent; +typedef __unsafe_unretained id<MTLSharedEvent> MTLSharedEvent_id; +#else +typedef void* MTLSharedEvent_id; +#endif + typedef struct __IOSurface* IOSurfaceRef; + + typedef uint32_t VkSampleMask; + typedef uint32_t VkBool32; + typedef uint32_t VkFlags; + typedef uint64_t VkFlags64; + typedef uint64_t VkDeviceSize; + typedef uint64_t VkDeviceAddress; + + Basic C types, pulled in via vk_platform.h + + + + + + + + + + + + + + + + Bitmask types + typedef VkFlags VkFramebufferCreateFlags; + typedef VkFlags VkQueryPoolCreateFlags; + typedef VkFlags VkRenderPassCreateFlags; + typedef VkFlags VkSamplerCreateFlags; + typedef VkFlags VkPipelineLayoutCreateFlags; + typedef VkFlags VkPipelineCacheCreateFlags; + typedef VkFlags VkPipelineDepthStencilStateCreateFlags; + typedef VkFlags VkPipelineDepthStencilStateCreateFlags; + typedef VkFlags VkPipelineDynamicStateCreateFlags; + typedef VkFlags VkPipelineColorBlendStateCreateFlags; + typedef VkFlags VkPipelineColorBlendStateCreateFlags; + typedef VkFlags VkPipelineMultisampleStateCreateFlags; + typedef VkFlags VkPipelineRasterizationStateCreateFlags; + typedef VkFlags VkPipelineViewportStateCreateFlags; + typedef VkFlags VkPipelineTessellationStateCreateFlags; + typedef VkFlags VkPipelineInputAssemblyStateCreateFlags; + typedef VkFlags VkPipelineVertexInputStateCreateFlags; + typedef VkFlags VkPipelineShaderStageCreateFlags; + typedef VkFlags VkDescriptorSetLayoutCreateFlags; + typedef VkFlags VkBufferViewCreateFlags; + typedef VkFlags VkInstanceCreateFlags; + typedef VkFlags VkDeviceCreateFlags; + typedef VkFlags VkDeviceQueueCreateFlags; + typedef VkFlags VkQueueFlags; + typedef VkFlags VkMemoryPropertyFlags; + typedef VkFlags VkMemoryHeapFlags; + typedef VkFlags VkAccessFlags; + typedef VkFlags VkBufferUsageFlags; + typedef VkFlags VkBufferCreateFlags; + typedef VkFlags VkShaderStageFlags; + typedef VkFlags VkImageUsageFlags; + typedef VkFlags VkImageCreateFlags; + typedef VkFlags VkImageViewCreateFlags; + typedef VkFlags VkPipelineCreateFlags; + typedef VkFlags VkColorComponentFlags; + typedef VkFlags VkFenceCreateFlags; + typedef VkFlags VkSemaphoreCreateFlags; + typedef VkFlags VkFormatFeatureFlags; + typedef VkFlags VkQueryControlFlags; + typedef VkFlags VkQueryResultFlags; + typedef VkFlags VkShaderModuleCreateFlags; + typedef VkFlags VkEventCreateFlags; + typedef VkFlags VkCommandPoolCreateFlags; + typedef VkFlags VkCommandPoolResetFlags; + typedef VkFlags VkCommandBufferResetFlags; + typedef VkFlags VkCommandBufferUsageFlags; + typedef VkFlags VkQueryPipelineStatisticFlags; + typedef VkFlags VkMemoryMapFlags; + typedef VkFlags VkMemoryUnmapFlags; + + typedef VkFlags VkImageAspectFlags; + typedef VkFlags VkSparseMemoryBindFlags; + typedef VkFlags VkSparseImageFormatFlags; + typedef VkFlags VkSubpassDescriptionFlags; + typedef VkFlags VkPipelineStageFlags; + typedef VkFlags VkSampleCountFlags; + typedef VkFlags VkAttachmentDescriptionFlags; + typedef VkFlags VkStencilFaceFlags; + typedef VkFlags VkCullModeFlags; + typedef VkFlags VkDescriptorPoolCreateFlags; + typedef VkFlags VkDescriptorPoolResetFlags; + typedef VkFlags VkDependencyFlags; + typedef VkFlags VkSubgroupFeatureFlags; + typedef VkFlags VkIndirectCommandsLayoutUsageFlagsNV; + typedef VkFlags VkIndirectStateFlagsNV; + typedef VkFlags VkGeometryFlagsKHR; + + typedef VkFlags VkGeometryInstanceFlagsKHR; + + typedef VkFlags VkBuildAccelerationStructureFlagsKHR; + + typedef VkFlags VkPrivateDataSlotCreateFlags; + + typedef VkFlags VkAccelerationStructureCreateFlagsKHR; + typedef VkFlags VkDescriptorUpdateTemplateCreateFlags; + + typedef VkFlags VkPipelineCreationFeedbackFlags; + + typedef VkFlags VkPerformanceCounterDescriptionFlagsKHR; + typedef VkFlags VkAcquireProfilingLockFlagsKHR; + typedef VkFlags VkSemaphoreWaitFlags; + + typedef VkFlags VkPipelineCompilerControlFlagsAMD; + typedef VkFlags VkShaderCorePropertiesFlagsAMD; + typedef VkFlags VkDeviceDiagnosticsConfigFlagsNV; + typedef VkFlags VkRefreshObjectFlagsKHR; + typedef VkFlags64 VkAccessFlags2; + + typedef VkFlags64 VkPipelineStageFlags2; + + typedef VkFlags VkAccelerationStructureMotionInfoFlagsNV; + typedef VkFlags VkAccelerationStructureMotionInstanceFlagsNV; + typedef VkFlags64 VkFormatFeatureFlags2; + + typedef VkFlags VkRenderingFlags; + typedef VkFlags64 VkMemoryDecompressionMethodFlagsNV; + + typedef VkFlags VkBuildMicromapFlagsEXT; + typedef VkFlags VkMicromapCreateFlagsEXT; + typedef VkFlags VkIndirectCommandsLayoutUsageFlagsEXT; + typedef VkFlags VkIndirectCommandsInputModeFlagsEXT; + typedef VkFlags VkDirectDriverLoadingFlagsLUNARG; + typedef VkFlags64 VkPipelineCreateFlags2; + + typedef VkFlags64 VkBufferUsageFlags2; + + + WSI extensions + typedef VkFlags VkCompositeAlphaFlagsKHR; + typedef VkFlags VkDisplayPlaneAlphaFlagsKHR; + typedef VkFlags VkSurfaceTransformFlagsKHR; + typedef VkFlags VkSwapchainCreateFlagsKHR; + typedef VkFlags VkDisplayModeCreateFlagsKHR; + typedef VkFlags VkDisplaySurfaceCreateFlagsKHR; + typedef VkFlags VkAndroidSurfaceCreateFlagsKHR; + typedef VkFlags VkViSurfaceCreateFlagsNN; + typedef VkFlags VkWaylandSurfaceCreateFlagsKHR; + typedef VkFlags VkWin32SurfaceCreateFlagsKHR; + typedef VkFlags VkXlibSurfaceCreateFlagsKHR; + typedef VkFlags VkXcbSurfaceCreateFlagsKHR; + typedef VkFlags VkDirectFBSurfaceCreateFlagsEXT; + typedef VkFlags VkIOSSurfaceCreateFlagsMVK; + typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; + typedef VkFlags VkMetalSurfaceCreateFlagsEXT; + typedef VkFlags VkImagePipeSurfaceCreateFlagsFUCHSIA; + typedef VkFlags VkStreamDescriptorSurfaceCreateFlagsGGP; + typedef VkFlags VkHeadlessSurfaceCreateFlagsEXT; + typedef VkFlags VkScreenSurfaceCreateFlagsQNX; + typedef VkFlags VkPeerMemoryFeatureFlags; + + typedef VkFlags VkMemoryAllocateFlags; + + typedef VkFlags VkDeviceGroupPresentModeFlagsKHR; + + typedef VkFlags VkDebugReportFlagsEXT; + typedef VkFlags VkCommandPoolTrimFlags; + + typedef VkFlags VkExternalMemoryHandleTypeFlagsNV; + typedef VkFlags VkExternalMemoryFeatureFlagsNV; + typedef VkFlags VkExternalMemoryHandleTypeFlags; + + typedef VkFlags VkExternalMemoryFeatureFlags; + + typedef VkFlags VkExternalSemaphoreHandleTypeFlags; + + typedef VkFlags VkExternalSemaphoreFeatureFlags; + + typedef VkFlags VkSemaphoreImportFlags; + + typedef VkFlags VkExternalFenceHandleTypeFlags; + + typedef VkFlags VkExternalFenceFeatureFlags; + + typedef VkFlags VkFenceImportFlags; + + typedef VkFlags VkSurfaceCounterFlagsEXT; + typedef VkFlags VkPipelineViewportSwizzleStateCreateFlagsNV; + typedef VkFlags VkPipelineDiscardRectangleStateCreateFlagsEXT; + typedef VkFlags VkPipelineCoverageToColorStateCreateFlagsNV; + typedef VkFlags VkPipelineCoverageModulationStateCreateFlagsNV; + typedef VkFlags VkPipelineCoverageReductionStateCreateFlagsNV; + typedef VkFlags VkValidationCacheCreateFlagsEXT; + typedef VkFlags VkDebugUtilsMessageSeverityFlagsEXT; + typedef VkFlags VkDebugUtilsMessageTypeFlagsEXT; + typedef VkFlags VkDebugUtilsMessengerCreateFlagsEXT; + typedef VkFlags VkDebugUtilsMessengerCallbackDataFlagsEXT; + typedef VkFlags VkDeviceMemoryReportFlagsEXT; + typedef VkFlags VkPipelineRasterizationConservativeStateCreateFlagsEXT; + typedef VkFlags VkDescriptorBindingFlags; + + typedef VkFlags VkConditionalRenderingFlagsEXT; + typedef VkFlags VkResolveModeFlags; + + typedef VkFlags VkPipelineRasterizationStateStreamCreateFlagsEXT; + typedef VkFlags VkPipelineRasterizationDepthClipStateCreateFlagsEXT; + typedef VkFlags VkSwapchainImageUsageFlagsANDROID; + typedef VkFlags VkToolPurposeFlags; + + typedef VkFlags VkSubmitFlags; + + typedef VkFlags VkImageFormatConstraintsFlagsFUCHSIA; + typedef VkFlags VkHostImageCopyFlags; + + typedef VkFlags VkImageConstraintsInfoFlagsFUCHSIA; + typedef VkFlags VkGraphicsPipelineLibraryFlagsEXT; + typedef VkFlags VkImageCompressionFlagsEXT; + typedef VkFlags VkImageCompressionFixedRateFlagsEXT; + typedef VkFlags VkExportMetalObjectTypeFlagsEXT; + typedef VkFlags VkDeviceAddressBindingFlagsEXT; + typedef VkFlags VkOpticalFlowGridSizeFlagsNV; + typedef VkFlags VkOpticalFlowUsageFlagsNV; + typedef VkFlags VkOpticalFlowSessionCreateFlagsNV; + typedef VkFlags VkOpticalFlowExecuteFlagsNV; + typedef VkFlags VkFrameBoundaryFlagsEXT; + typedef VkFlags VkPresentScalingFlagsEXT; + typedef VkFlags VkPresentGravityFlagsEXT; + typedef VkFlags VkShaderCreateFlagsEXT; + typedef VkFlags64 VkPhysicalDeviceSchedulingControlsFlagsARM; + + Video Core extension + typedef VkFlags VkVideoCodecOperationFlagsKHR; + typedef VkFlags VkVideoCapabilityFlagsKHR; + typedef VkFlags VkVideoSessionCreateFlagsKHR; + typedef VkFlags VkVideoSessionParametersCreateFlagsKHR; + typedef VkFlags VkVideoBeginCodingFlagsKHR; + typedef VkFlags VkVideoEndCodingFlagsKHR; + typedef VkFlags VkVideoCodingControlFlagsKHR; + + Video Decode Core extension + typedef VkFlags VkVideoDecodeUsageFlagsKHR; + typedef VkFlags VkVideoDecodeCapabilityFlagsKHR; + typedef VkFlags VkVideoDecodeFlagsKHR; + + Video Decode H.264 extension + typedef VkFlags VkVideoDecodeH264PictureLayoutFlagsKHR; + + Video Encode Core extension + typedef VkFlags VkVideoEncodeFlagsKHR; + typedef VkFlags VkVideoEncodeUsageFlagsKHR; + typedef VkFlags VkVideoEncodeContentFlagsKHR; + typedef VkFlags VkVideoEncodeCapabilityFlagsKHR; + typedef VkFlags VkVideoEncodeFeedbackFlagsKHR; + typedef VkFlags VkVideoEncodeRateControlFlagsKHR; + typedef VkFlags VkVideoEncodeRateControlModeFlagsKHR; + typedef VkFlags VkVideoChromaSubsamplingFlagsKHR; + typedef VkFlags VkVideoComponentBitDepthFlagsKHR; + + Video Encode H.264 extension + typedef VkFlags VkVideoEncodeH264CapabilityFlagsKHR; + typedef VkFlags VkVideoEncodeH264StdFlagsKHR; + typedef VkFlags VkVideoEncodeH264RateControlFlagsKHR; + + Video Encode H.265 extension + typedef VkFlags VkVideoEncodeH265CapabilityFlagsKHR; + typedef VkFlags VkVideoEncodeH265StdFlagsKHR; + typedef VkFlags VkVideoEncodeH265RateControlFlagsKHR; + typedef VkFlags VkVideoEncodeH265CtbSizeFlagsKHR; + typedef VkFlags VkVideoEncodeH265TransformBlockSizeFlagsKHR; + + Video Encode AV1 extension + typedef VkFlags VkVideoEncodeAV1CapabilityFlagsKHR; + typedef VkFlags VkVideoEncodeAV1StdFlagsKHR; + typedef VkFlags VkVideoEncodeAV1RateControlFlagsKHR; + typedef VkFlags VkVideoEncodeAV1SuperblockSizeFlagsKHR; + + Types which can be void pointers or class pointers, selected at compile time + VK_DEFINE_HANDLE(VkInstance) + VK_DEFINE_HANDLE(VkPhysicalDevice) + VK_DEFINE_HANDLE(VkDevice) + VK_DEFINE_HANDLE(VkQueue) + VK_DEFINE_HANDLE(VkCommandBuffer) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeviceMemory) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBuffer) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferView) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImageView) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderModule) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipeline) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineLayout) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSampler) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFence) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphore) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkEvent) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkQueryPool) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFramebuffer) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkRenderPass) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineCache) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineBinaryKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectCommandsLayoutNV) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectCommandsLayoutEXT) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectExecutionSetEXT) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplate) + + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSamplerYcbcrConversion) + + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkValidationCacheEXT) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureNV) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPerformanceConfigurationINTEL) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferCollectionFUCHSIA) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeferredOperationKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPrivateDataSlot) + + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCuModuleNVX) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCuFunctionNVX) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkOpticalFlowSessionNV) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkMicromapEXT) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderEXT) + + WSI extensions + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayModeKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugUtilsMessengerEXT) + + Video extensions + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkVideoSessionKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkVideoSessionParametersKHR) + + VK_NV_external_sci_sync2 + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphoreSciSyncPoolNV) + + Types generated from corresponding enums tags below + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WSI extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Enumerated types in the header, but not used by the API + + + + + + + + Video Core extensions + + + + + + + + + + Video Decode extensions + + + + Video H.264 Decode extensions + + + Video H.265 Decode extensions + + Video Encode extensions + + + + + + + + + Video H.264 Encode extensions + + + + + Video H.265 Encode extensions + + + + + + + Video AV1 Encode extensions + + + + + + + + The PFN_vk*Function types are used by VkAllocationCallbacks below + typedef void (VKAPI_PTR *PFN_vkInternalAllocationNotification)( + void* pUserData, + size_t size, + VkInternalAllocationType allocationType, + VkSystemAllocationScope allocationScope); + typedef void (VKAPI_PTR *PFN_vkInternalFreeNotification)( + void* pUserData, + size_t size, + VkInternalAllocationType allocationType, + VkSystemAllocationScope allocationScope); + typedef void* (VKAPI_PTR *PFN_vkReallocationFunction)( + void* pUserData, + void* pOriginal, + size_t size, + size_t alignment, + VkSystemAllocationScope allocationScope); + typedef void* (VKAPI_PTR *PFN_vkAllocationFunction)( + void* pUserData, + size_t size, + size_t alignment, + VkSystemAllocationScope allocationScope); + typedef void (VKAPI_PTR *PFN_vkFreeFunction)( + void* pUserData, + void* pMemory); + + The PFN_vkVoidFunction type are used by VkGet*ProcAddr below + typedef void (VKAPI_PTR *PFN_vkVoidFunction)(void); + + The PFN_vkDebugReportCallbackEXT type are used by the DEBUG_REPORT extension + typedef VkBool32 (VKAPI_PTR *PFN_vkDebugReportCallbackEXT)( + VkDebugReportFlagsEXT flags, + VkDebugReportObjectTypeEXT objectType, + uint64_t object, + size_t location, + int32_t messageCode, + const char* pLayerPrefix, + const char* pMessage, + void* pUserData); + + The PFN_vkDebugUtilsMessengerCallbackEXT type are used by the VK_EXT_debug_utils extension + typedef VkBool32 (VKAPI_PTR *PFN_vkDebugUtilsMessengerCallbackEXT)( + VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, + VkDebugUtilsMessageTypeFlagsEXT messageTypes, + const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, + void* pUserData); + + The PFN_vkFaultCallbackFunction type is used by VKSC_VERSION_1_0 + typedef void (VKAPI_PTR *PFN_vkFaultCallbackFunction)( + VkBool32 unrecordedFaults, + uint32_t faultCount, + const VkFaultData* pFaults); + + The PFN_vkDeviceMemoryReportCallbackEXT type is used by the VK_EXT_device_memory_report extension + typedef void (VKAPI_PTR *PFN_vkDeviceMemoryReportCallbackEXT)( + const VkDeviceMemoryReportCallbackDataEXT* pCallbackData, + void* pUserData); + + The PFN_vkGetInstanceProcAddrLUNARG type is used by the + VkDirectDriverLoadingInfoLUNARG structure. + We cannot introduce an explicit dependency on the + equivalent PFN_vkGetInstanceProcAddr type, even though + it is implicitly generated in the C header, because + that results in multiple definitions. + typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetInstanceProcAddrLUNARG)( + VkInstance instance, const char* pName); + + Struct types + + VkStructureType sType + struct VkBaseOutStructure* pNext + + + VkStructureType sType + const struct VkBaseInStructure* pNext + + + int32_t x + int32_t y + + + int32_t x + int32_t y + int32_t z + + + uint32_t width + uint32_t height + + + uint32_t width + uint32_t height + uint32_t depth + + + float x + float y + float width + float height + float minDepth + float maxDepth + + + VkOffset2D offset + VkExtent2D extent + + + VkRect2D rect + uint32_t baseArrayLayer + uint32_t layerCount + + + VkComponentSwizzle r + VkComponentSwizzle g + VkComponentSwizzle b + VkComponentSwizzle a + + + uint32_t apiVersion + uint32_t driverVersion + uint32_t vendorID + uint32_t deviceID + VkPhysicalDeviceType deviceType + char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] + uint8_t pipelineCacheUUID[VK_UUID_SIZE] + VkPhysicalDeviceLimits limits + VkPhysicalDeviceSparseProperties sparseProperties + + + char extensionName[VK_MAX_EXTENSION_NAME_SIZE]extension name + uint32_t specVersionversion of the extension specification implemented + + + char layerName[VK_MAX_EXTENSION_NAME_SIZE]layer name + uint32_t specVersionversion of the layer specification implemented + uint32_t implementationVersionbuild or release version of the layer's library + char description[VK_MAX_DESCRIPTION_SIZE]Free-form description of the layer + + + VkStructureType sType + const void* pNext + const char* pApplicationName + uint32_t applicationVersion + const char* pEngineName + uint32_t engineVersion + uint32_t apiVersion + + + void* pUserData + PFN_vkAllocationFunction pfnAllocation + PFN_vkReallocationFunction pfnReallocation + PFN_vkFreeFunction pfnFree + PFN_vkInternalAllocationNotification pfnInternalAllocation + PFN_vkInternalFreeNotification pfnInternalFree + + + VkStructureType sType + const void* pNext + VkDeviceQueueCreateFlags flags + uint32_t queueFamilyIndex + uint32_t queueCount + const float* pQueuePriorities + + + VkStructureType sType + const void* pNext + VkDeviceCreateFlags flags + uint32_t queueCreateInfoCount + const VkDeviceQueueCreateInfo* pQueueCreateInfos + uint32_t enabledLayerCount + const char* const* ppEnabledLayerNamesOrdered list of layer names to be enabled + uint32_t enabledExtensionCount + const char* const* ppEnabledExtensionNames + const VkPhysicalDeviceFeatures* pEnabledFeatures + + + VkStructureType sType + const void* pNext + VkInstanceCreateFlags flags + const VkApplicationInfo* pApplicationInfo + uint32_t enabledLayerCount + const char* const* ppEnabledLayerNamesOrdered list of layer names to be enabled + uint32_t enabledExtensionCount + const char* const* ppEnabledExtensionNamesExtension names to be enabled + + + VkQueueFlags queueFlagsQueue flags + uint32_t queueCount + uint32_t timestampValidBits + VkExtent3D minImageTransferGranularityMinimum alignment requirement for image transfers + + + uint32_t memoryTypeCount + VkMemoryType memoryTypes[VK_MAX_MEMORY_TYPES] + uint32_t memoryHeapCount + VkMemoryHeap memoryHeaps[VK_MAX_MEMORY_HEAPS] + + + VkStructureType sType + const void* pNext + VkDeviceSize allocationSizeSize of memory allocation + uint32_t memoryTypeIndexIndex of the of the memory type to allocate from + + + VkDeviceSize sizeSpecified in bytes + VkDeviceSize alignmentSpecified in bytes + uint32_t memoryTypeBitsBitmask of the allowed memory type indices into memoryTypes[] for this object + + + VkImageAspectFlags aspectMask + VkExtent3D imageGranularity + VkSparseImageFormatFlags flags + + + VkSparseImageFormatProperties formatProperties + uint32_t imageMipTailFirstLod + VkDeviceSize imageMipTailSizeSpecified in bytes, must be a multiple of sparse block size in bytes / alignment + VkDeviceSize imageMipTailOffsetSpecified in bytes, must be a multiple of sparse block size in bytes / alignment + VkDeviceSize imageMipTailStrideSpecified in bytes, must be a multiple of sparse block size in bytes / alignment + + + VkMemoryPropertyFlags propertyFlagsMemory properties of this memory type + uint32_t heapIndexIndex of the memory heap allocations of this memory type are taken from + + + VkDeviceSize sizeAvailable memory in the heap + VkMemoryHeapFlags flagsFlags for the heap + + + VkStructureType sType + const void* pNext + VkDeviceMemory memoryMapped memory object + VkDeviceSize offsetOffset within the memory object where the range starts + VkDeviceSize sizeSize of the range within the memory object + + + VkFormatFeatureFlags linearTilingFeaturesFormat features in case of linear tiling + VkFormatFeatureFlags optimalTilingFeaturesFormat features in case of optimal tiling + VkFormatFeatureFlags bufferFeaturesFormat features supported by buffers + + + VkExtent3D maxExtentmax image dimensions for this resource type + uint32_t maxMipLevelsmax number of mipmap levels for this resource type + uint32_t maxArrayLayersmax array size for this resource type + VkSampleCountFlags sampleCountssupported sample counts for this resource type + VkDeviceSize maxResourceSizemax size (in bytes) of this resource type + + + VkBuffer bufferBuffer used for this descriptor slot. + VkDeviceSize offsetBase offset from buffer start in bytes to update in the descriptor set. + VkDeviceSize rangeSize in bytes of the buffer resource for this descriptor update. + + + VkSampler samplerSampler to write to the descriptor in case it is a SAMPLER or COMBINED_IMAGE_SAMPLER descriptor. Ignored otherwise. + VkImageView imageViewImage view to write to the descriptor in case it is a SAMPLED_IMAGE, STORAGE_IMAGE, COMBINED_IMAGE_SAMPLER, or INPUT_ATTACHMENT descriptor. Ignored otherwise. + VkImageLayout imageLayoutLayout the image is expected to be in when accessed using this descriptor (only used if imageView is not VK_NULL_HANDLE). + + + VkStructureType sType + const void* pNext + VkDescriptorSet dstSetDestination descriptor set + uint32_t dstBindingBinding within the destination descriptor set to write + uint32_t dstArrayElementArray element within the destination binding to write + uint32_t descriptorCountNumber of descriptors to write (determines the size of the array pointed by pDescriptors) + VkDescriptorType descriptorTypeDescriptor type to write (determines which members of the array pointed by pDescriptors are going to be used) + const VkDescriptorImageInfo* pImageInfoSampler, image view, and layout for SAMPLER, COMBINED_IMAGE_SAMPLER, {SAMPLED,STORAGE}_IMAGE, and INPUT_ATTACHMENT descriptor types. + const VkDescriptorBufferInfo* pBufferInfoRaw buffer, size, and offset for {UNIFORM,STORAGE}_BUFFER[_DYNAMIC] descriptor types. + const VkBufferView* pTexelBufferViewBuffer view to write to the descriptor for {UNIFORM,STORAGE}_TEXEL_BUFFER descriptor types. + + + VkStructureType sType + const void* pNext + VkDescriptorSet srcSetSource descriptor set + uint32_t srcBindingBinding within the source descriptor set to copy from + uint32_t srcArrayElementArray element within the source binding to copy from + VkDescriptorSet dstSetDestination descriptor set + uint32_t dstBindingBinding within the destination descriptor set to copy to + uint32_t dstArrayElementArray element within the destination binding to copy to + uint32_t descriptorCountNumber of descriptors to write (determines the size of the array pointed by pDescriptors) + + + VkStructureType sType + const void* pNext + VkBufferUsageFlags2 usage + + + + VkStructureType sType + const void* pNext + VkBufferCreateFlags flagsBuffer creation flags + VkDeviceSize sizeSpecified in bytes + VkBufferUsageFlags usageBuffer usage flags + VkSharingMode sharingMode + uint32_t queueFamilyIndexCount + const uint32_t* pQueueFamilyIndices + + + VkStructureType sType + const void* pNext + VkBufferViewCreateFlags flags + VkBuffer buffer + VkFormat formatOptionally specifies format of elements + VkDeviceSize offsetSpecified in bytes + VkDeviceSize rangeView size specified in bytes + + + VkImageAspectFlags aspectMask + uint32_t mipLevel + uint32_t arrayLayer + + + VkImageAspectFlags aspectMask + uint32_t mipLevel + uint32_t baseArrayLayer + uint32_t layerCount + + + VkImageAspectFlags aspectMask + uint32_t baseMipLevel + uint32_t levelCount + uint32_t baseArrayLayer + uint32_t layerCount + + + VkStructureType sType + const void* pNext + VkAccessFlags srcAccessMaskMemory accesses from the source of the dependency to synchronize + VkAccessFlags dstAccessMaskMemory accesses from the destination of the dependency to synchronize + + + VkStructureType sType + const void* pNext + VkAccessFlags srcAccessMaskMemory accesses from the source of the dependency to synchronize + VkAccessFlags dstAccessMaskMemory accesses from the destination of the dependency to synchronize + uint32_t srcQueueFamilyIndexQueue family to transition ownership from + uint32_t dstQueueFamilyIndexQueue family to transition ownership to + VkBuffer bufferBuffer to sync + VkDeviceSize offsetOffset within the buffer to sync + VkDeviceSize sizeAmount of bytes to sync + + + VkStructureType sType + const void* pNext + VkAccessFlags srcAccessMaskMemory accesses from the source of the dependency to synchronize + VkAccessFlags dstAccessMaskMemory accesses from the destination of the dependency to synchronize + VkImageLayout oldLayoutCurrent layout of the image + VkImageLayout newLayoutNew layout to transition the image to + uint32_t srcQueueFamilyIndexQueue family to transition ownership from + uint32_t dstQueueFamilyIndexQueue family to transition ownership to + VkImage imageImage to sync + VkImageSubresourceRange subresourceRangeSubresource range to sync + + + VkStructureType sType + const void* pNext + VkImageCreateFlags flagsImage creation flags + VkImageType imageType + VkFormat format + VkExtent3D extent + uint32_t mipLevels + uint32_t arrayLayers + VkSampleCountFlagBits samples + VkImageTiling tiling + VkImageUsageFlags usageImage usage flags + VkSharingMode sharingModeCross-queue-family sharing mode + uint32_t queueFamilyIndexCountNumber of queue families to share across + const uint32_t* pQueueFamilyIndicesArray of queue family indices to share across + VkImageLayout initialLayoutInitial image layout for all subresources + + + VkDeviceSize offsetSpecified in bytes + VkDeviceSize sizeSpecified in bytes + VkDeviceSize rowPitchSpecified in bytes + VkDeviceSize arrayPitchSpecified in bytes + VkDeviceSize depthPitchSpecified in bytes + + + VkStructureType sType + const void* pNext + VkImageViewCreateFlags flags + VkImage image + VkImageViewType viewType + VkFormat format + VkComponentMapping components + VkImageSubresourceRange subresourceRange + + + VkDeviceSize srcOffsetSpecified in bytes + VkDeviceSize dstOffsetSpecified in bytes + VkDeviceSize sizeSpecified in bytes + + + VkDeviceSize resourceOffsetSpecified in bytes + VkDeviceSize sizeSpecified in bytes + VkDeviceMemory memory + VkDeviceSize memoryOffsetSpecified in bytes + VkSparseMemoryBindFlags flags + + + VkImageSubresource subresource + VkOffset3D offset + VkExtent3D extent + VkDeviceMemory memory + VkDeviceSize memoryOffsetSpecified in bytes + VkSparseMemoryBindFlags flags + + + VkBuffer buffer + uint32_t bindCount + const VkSparseMemoryBind* pBinds + + + VkImage image + uint32_t bindCount + const VkSparseMemoryBind* pBinds + + + VkImage image + uint32_t bindCount + const VkSparseImageMemoryBind* pBinds + + + VkStructureType sType + const void* pNext + uint32_t waitSemaphoreCount + const VkSemaphore* pWaitSemaphores + uint32_t bufferBindCount + const VkSparseBufferMemoryBindInfo* pBufferBinds + uint32_t imageOpaqueBindCount + const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds + uint32_t imageBindCount + const VkSparseImageMemoryBindInfo* pImageBinds + uint32_t signalSemaphoreCount + const VkSemaphore* pSignalSemaphores + + + VkImageSubresourceLayers srcSubresource + VkOffset3D srcOffsetSpecified in pixels for both compressed and uncompressed images + VkImageSubresourceLayers dstSubresource + VkOffset3D dstOffsetSpecified in pixels for both compressed and uncompressed images + VkExtent3D extentSpecified in pixels for both compressed and uncompressed images + + + VkImageSubresourceLayers srcSubresource + VkOffset3D srcOffsets[2]Specified in pixels for both compressed and uncompressed images + VkImageSubresourceLayers dstSubresource + VkOffset3D dstOffsets[2]Specified in pixels for both compressed and uncompressed images + + + VkDeviceSize bufferOffsetSpecified in bytes + uint32_t bufferRowLengthSpecified in texels + uint32_t bufferImageHeight + VkImageSubresourceLayers imageSubresource + VkOffset3D imageOffsetSpecified in pixels for both compressed and uncompressed images + VkExtent3D imageExtentSpecified in pixels for both compressed and uncompressed images + + + VkDeviceAddress srcAddress + VkDeviceAddress dstAddress + VkDeviceSize sizeSpecified in bytes + + + VkDeviceAddress srcAddress + uint32_t bufferRowLengthSpecified in texels + uint32_t bufferImageHeight + VkImageSubresourceLayers imageSubresource + VkOffset3D imageOffsetSpecified in pixels for both compressed and uncompressed images + VkExtent3D imageExtentSpecified in pixels for both compressed and uncompressed images + + + VkImageSubresourceLayers srcSubresource + VkOffset3D srcOffset + VkImageSubresourceLayers dstSubresource + VkOffset3D dstOffset + VkExtent3D extent + + + VkStructureType sType + const void* pNextnoautovalidity because this structure can be either an explicit parameter, or passed in a pNext chain + VkShaderModuleCreateFlags flags + size_t codeSizeSpecified in bytes + const uint32_t* pCodeBinary code of size codeSize + + + uint32_t bindingBinding number for this entry + VkDescriptorType descriptorTypeType of the descriptors in this binding + uint32_t descriptorCountNumber of descriptors in this binding + VkShaderStageFlags stageFlagsShader stages this binding is visible to + const VkSampler* pImmutableSamplersImmutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains count number of elements) + + + VkStructureType sType + const void* pNext + VkDescriptorSetLayoutCreateFlags flags + uint32_t bindingCountNumber of bindings in the descriptor set layout + const VkDescriptorSetLayoutBinding* pBindingsArray of descriptor set layout bindings + + + VkDescriptorType type + uint32_t descriptorCount + + + VkStructureType sType + const void* pNext + VkDescriptorPoolCreateFlags flags + uint32_t maxSets + uint32_t poolSizeCount + const VkDescriptorPoolSize* pPoolSizes + + + VkStructureType sType + const void* pNext + VkDescriptorPool descriptorPool + uint32_t descriptorSetCount + const VkDescriptorSetLayout* pSetLayouts + + + uint32_t constantIDThe SpecConstant ID specified in the BIL + uint32_t offsetOffset of the value in the data block + size_t sizeSize in bytes of the SpecConstant + + + uint32_t mapEntryCountNumber of entries in the map + const VkSpecializationMapEntry* pMapEntriesArray of map entries + size_t dataSizeSize in bytes of pData + const void* pDataPointer to SpecConstant data + + + VkStructureType sType + const void* pNext + VkPipelineShaderStageCreateFlags flags + VkShaderStageFlagBits stageShader stage + VkShaderModule moduleModule containing entry point + const char* pNameNull-terminated entry point name + const char* pNameNull-terminated entry point name + const VkSpecializationInfo* pSpecializationInfo + + + VkStructureType sType + const void* pNext + VkPipelineCreateFlags flagsPipeline creation flags + VkPipelineShaderStageCreateInfo stage + VkPipelineLayout layoutInterface layout of the pipeline + VkPipeline basePipelineHandleIf VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of + int32_t basePipelineIndexIf VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of + + + VkStructureType sType + const void* pNext + VkDeviceAddress deviceAddress + VkDeviceSize size + VkDeviceAddress pipelineDeviceAddressCaptureReplay + + + VkStructureType sType + const void* pNext + VkPipelineCreateFlags2 flags + + + + uint32_t bindingVertex buffer binding id + uint32_t strideDistance between vertices in bytes (0 = no advancement) + VkVertexInputRate inputRateThe rate at which the vertex data is consumed + + + uint32_t locationlocation of the shader vertex attrib + uint32_t bindingVertex buffer binding id + VkFormat formatformat of source data + uint32_t offsetOffset of first element in bytes from base of vertex + + + VkStructureType sType + const void* pNext + VkPipelineVertexInputStateCreateFlags flags + uint32_t vertexBindingDescriptionCountnumber of bindings + const VkVertexInputBindingDescription* pVertexBindingDescriptions + uint32_t vertexAttributeDescriptionCountnumber of attributes + const VkVertexInputAttributeDescription* pVertexAttributeDescriptions + + + VkStructureType sType + const void* pNext + VkPipelineInputAssemblyStateCreateFlags flags + VkPrimitiveTopology topology + VkBool32 primitiveRestartEnable + + + VkStructureType sType + const void* pNext + VkPipelineTessellationStateCreateFlags flags + uint32_t patchControlPoints + + + VkStructureType sType + const void* pNext + VkPipelineViewportStateCreateFlags flags + uint32_t viewportCount + const VkViewport* pViewports + uint32_t scissorCount + const VkRect2D* pScissors + + + VkStructureType sType + const void* pNext + VkPipelineRasterizationStateCreateFlags flags + VkBool32 depthClampEnable + VkBool32 rasterizerDiscardEnable + VkPolygonMode polygonModeoptional (GL45) + VkCullModeFlags cullMode + VkFrontFace frontFace + VkBool32 depthBiasEnable + float depthBiasConstantFactor + float depthBiasClamp + float depthBiasSlopeFactor + float lineWidth + + + VkStructureType sType + const void* pNext + VkPipelineMultisampleStateCreateFlags flags + VkSampleCountFlagBits rasterizationSamplesNumber of samples used for rasterization + VkBool32 sampleShadingEnableoptional (GL45) + float minSampleShadingoptional (GL45) + const VkSampleMask* pSampleMaskArray of sampleMask words + VkBool32 alphaToCoverageEnable + VkBool32 alphaToOneEnable + + + VkBool32 blendEnable + VkBlendFactor srcColorBlendFactor + VkBlendFactor dstColorBlendFactor + VkBlendOp colorBlendOp + VkBlendFactor srcAlphaBlendFactor + VkBlendFactor dstAlphaBlendFactor + VkBlendOp alphaBlendOp + VkColorComponentFlags colorWriteMask + + + VkStructureType sType + const void* pNext + VkPipelineColorBlendStateCreateFlags flags + VkBool32 logicOpEnable + VkLogicOp logicOp + uint32_t attachmentCount# of pAttachments + const VkPipelineColorBlendAttachmentState* pAttachments + float blendConstants[4] + + + VkStructureType sType + const void* pNext + VkPipelineDynamicStateCreateFlags flags + uint32_t dynamicStateCount + const VkDynamicState* pDynamicStates + + + VkStencilOp failOp + VkStencilOp passOp + VkStencilOp depthFailOp + VkCompareOp compareOp + uint32_t compareMask + uint32_t writeMask + uint32_t reference + + + VkStructureType sType + const void* pNext + VkPipelineDepthStencilStateCreateFlags flags + VkBool32 depthTestEnable + VkBool32 depthWriteEnable + VkCompareOp depthCompareOp + VkBool32 depthBoundsTestEnableoptional (depth_bounds_test) + VkBool32 stencilTestEnable + VkStencilOpState front + VkStencilOpState back + float minDepthBounds + float maxDepthBounds + + + VkStructureType sType + const void* pNext + VkPipelineCreateFlags flagsPipeline creation flags + uint32_t stageCount + const VkPipelineShaderStageCreateInfo* pStagesOne entry for each active shader stage + const VkPipelineShaderStageCreateInfo* pStagesOne entry for each active shader stage + const VkPipelineVertexInputStateCreateInfo* pVertexInputState + const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState + const VkPipelineTessellationStateCreateInfo* pTessellationState + const VkPipelineViewportStateCreateInfo* pViewportState + const VkPipelineRasterizationStateCreateInfo* pRasterizationState + const VkPipelineMultisampleStateCreateInfo* pMultisampleState + const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState + const VkPipelineColorBlendStateCreateInfo* pColorBlendState + const VkPipelineDynamicStateCreateInfo* pDynamicState + VkPipelineLayout layoutInterface layout of the pipeline + VkRenderPass renderPass + uint32_t subpass + VkPipeline basePipelineHandleIf VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of + int32_t basePipelineIndexIf VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of + + + VkStructureType sType + const void* pNext + VkPipelineCacheCreateFlags flags + size_t initialDataSizeSize of initial data to populate cache, in bytes + size_t initialDataSizeSize of initial data to populate cache, in bytes + const void* pInitialDataInitial data to populate cache + + + The fields in this structure are non-normative since structure packing is implementation-defined in C. The specification defines the normative layout. + uint32_t headerSize + VkPipelineCacheHeaderVersion headerVersion + uint32_t vendorID + uint32_t deviceID + uint8_t pipelineCacheUUID[VK_UUID_SIZE] + + + The fields in this structure are non-normative since structure packing is implementation-defined in C. The specification defines the normative layout. + uint64_t codeSize + uint64_t codeOffset + + + The fields in this structure are non-normative since structure packing is implementation-defined in C. The specification defines the normative layout. + uint8_t pipelineIdentifier[VK_UUID_SIZE] + uint64_t pipelineMemorySize + uint64_t jsonSize + uint64_t jsonOffset + uint32_t stageIndexCount + uint32_t stageIndexStride + uint64_t stageIndexOffset + + + The fields in this structure are non-normative since structure packing is implementation-defined in C. The specification defines the normative layout. + VkPipelineCacheHeaderVersionOne headerVersionOne + VkPipelineCacheValidationVersion validationVersion + uint32_t implementationData + uint32_t pipelineIndexCount + uint32_t pipelineIndexStride + uint64_t pipelineIndexOffset + + + VkShaderStageFlags stageFlagsWhich stages use the range + uint32_t offsetStart of the range, in bytes + uint32_t sizeSize of the range, in bytes + + + VkStructureType sType + const void* pNext + const VkPipelineBinaryKeysAndDataKHR* pKeysAndDataInfo + VkPipeline pipeline + const VkPipelineCreateInfoKHR* pPipelineCreateInfo + + + VkStructureType sType + const void* pNext + uint32_t pipelineBinaryCount + VkPipelineBinaryKHR* pPipelineBinaries + + + size_t dataSize + void* pData + + + uint32_t binaryCount + const VkPipelineBinaryKeyKHR* pPipelineBinaryKeys + const VkPipelineBinaryDataKHR* pPipelineBinaryData + + + VkStructureType sType + void* pNext + uint32_t keySize + uint8_t key[VK_MAX_PIPELINE_BINARY_KEY_SIZE_KHR] + + + VkStructureType sType + const void* pNext + uint32_t binaryCount + const VkPipelineBinaryKHR* pPipelineBinaries + + + VkStructureType sType + void* pNext + VkPipeline pipeline + + + VkStructureType sType + void* pNext + VkPipelineBinaryKHR pipelineBinary + + + VkStructureType sType + void* pNext + + + VkStructureType sType + const void* pNext + VkPipelineLayoutCreateFlags flags + uint32_t setLayoutCountNumber of descriptor sets interfaced by the pipeline + const VkDescriptorSetLayout* pSetLayoutsArray of setCount number of descriptor set layout objects defining the layout of the + uint32_t pushConstantRangeCountNumber of push-constant ranges used by the pipeline + const VkPushConstantRange* pPushConstantRangesArray of pushConstantRangeCount number of ranges used by various shader stages + + + VkStructureType sType + const void* pNext + VkSamplerCreateFlags flags + VkFilter magFilterFilter mode for magnification + VkFilter minFilterFilter mode for minifiation + VkSamplerMipmapMode mipmapModeMipmap selection mode + VkSamplerAddressMode addressModeU + VkSamplerAddressMode addressModeV + VkSamplerAddressMode addressModeW + float mipLodBias + VkBool32 anisotropyEnable + float maxAnisotropy + VkBool32 compareEnable + VkCompareOp compareOp + float minLod + float maxLod + VkBorderColor borderColor + VkBool32 unnormalizedCoordinates + + + VkStructureType sType + const void* pNext + VkCommandPoolCreateFlags flagsCommand pool creation flags + uint32_t queueFamilyIndex + + + VkStructureType sType + const void* pNext + VkCommandPool commandPool + VkCommandBufferLevel level + uint32_t commandBufferCount + + + VkStructureType sType + const void* pNext + VkRenderPass renderPassRender pass for secondary command buffers + uint32_t subpass + VkFramebuffer framebufferFramebuffer for secondary command buffers + VkBool32 occlusionQueryEnableWhether this secondary command buffer may be executed during an occlusion query + VkQueryControlFlags queryFlagsQuery flags used by this secondary command buffer, if executed during an occlusion query + VkQueryPipelineStatisticFlags pipelineStatisticsPipeline statistics that may be counted for this secondary command buffer + + + VkStructureType sType + const void* pNext + VkCommandBufferUsageFlags flagsCommand buffer usage flags + const VkCommandBufferInheritanceInfo* pInheritanceInfoPointer to inheritance info for secondary command buffers + + + VkStructureType sType + const void* pNext + VkRenderPass renderPass + VkFramebuffer framebuffer + VkRect2D renderArea + uint32_t clearValueCount + const VkClearValue* pClearValues + + + float float32[4] + int32_t int32[4] + uint32_t uint32[4] + + + float depth + uint32_t stencil + + + VkClearColorValue color + VkClearDepthStencilValue depthStencil + + + VkImageAspectFlags aspectMask + uint32_t colorAttachment + VkClearValue clearValue + + + VkAttachmentDescriptionFlags flags + VkFormat format + VkSampleCountFlagBits samples + VkAttachmentLoadOp loadOpLoad operation for color or depth data + VkAttachmentStoreOp storeOpStore operation for color or depth data + VkAttachmentLoadOp stencilLoadOpLoad operation for stencil data + VkAttachmentStoreOp stencilStoreOpStore operation for stencil data + VkImageLayout initialLayout + VkImageLayout finalLayout + + + uint32_t attachment + VkImageLayout layout + + + VkSubpassDescriptionFlags flags + VkPipelineBindPoint pipelineBindPointMust be VK_PIPELINE_BIND_POINT_GRAPHICS for now + uint32_t inputAttachmentCount + const VkAttachmentReference* pInputAttachments + uint32_t colorAttachmentCount + const VkAttachmentReference* pColorAttachments + const VkAttachmentReference* pResolveAttachments + const VkAttachmentReference* pDepthStencilAttachment + uint32_t preserveAttachmentCount + const uint32_t* pPreserveAttachments + + + uint32_t srcSubpass + uint32_t dstSubpass + VkPipelineStageFlags srcStageMask + VkPipelineStageFlags dstStageMask + VkAccessFlags srcAccessMaskMemory accesses from the source of the dependency to synchronize + VkAccessFlags dstAccessMaskMemory accesses from the destination of the dependency to synchronize + VkDependencyFlags dependencyFlags + + + VkStructureType sType + const void* pNext + VkRenderPassCreateFlags flags + uint32_t attachmentCount + const VkAttachmentDescription* pAttachments + uint32_t subpassCount + const VkSubpassDescription* pSubpasses + uint32_t dependencyCount + const VkSubpassDependency* pDependencies + + + VkStructureType sType + const void* pNext + VkEventCreateFlags flagsEvent creation flags + + + VkStructureType sType + const void* pNext + VkFenceCreateFlags flagsFence creation flags + + + VkBool32 robustBufferAccessout of bounds buffer accesses are well defined + VkBool32 fullDrawIndexUint32full 32-bit range of indices for indexed draw calls + VkBool32 imageCubeArrayimage views which are arrays of cube maps + VkBool32 independentBlendblending operations are controlled per-attachment + VkBool32 geometryShadergeometry stage + VkBool32 tessellationShadertessellation control and evaluation stage + VkBool32 sampleRateShadingper-sample shading and interpolation + VkBool32 dualSrcBlendblend operations which take two sources + VkBool32 logicOplogic operations + VkBool32 multiDrawIndirectmulti draw indirect + VkBool32 drawIndirectFirstInstanceindirect drawing can use non-zero firstInstance + VkBool32 depthClampdepth clamping + VkBool32 depthBiasClampdepth bias clamping + VkBool32 fillModeNonSolidpoint and wireframe fill modes + VkBool32 depthBoundsdepth bounds test + VkBool32 wideLineslines with width greater than 1 + VkBool32 largePointspoints with size greater than 1 + VkBool32 alphaToOnethe fragment alpha component can be forced to maximum representable alpha value + VkBool32 multiViewportviewport arrays + VkBool32 samplerAnisotropyanisotropic sampler filtering + VkBool32 textureCompressionETC2ETC texture compression formats + VkBool32 textureCompressionASTC_LDRASTC LDR texture compression formats + VkBool32 textureCompressionBCBC1-7 texture compressed formats + VkBool32 occlusionQueryPreciseprecise occlusion queries returning actual sample counts + VkBool32 pipelineStatisticsQuerypipeline statistics query + VkBool32 vertexPipelineStoresAndAtomicsstores and atomic ops on storage buffers and images are supported in vertex, tessellation, and geometry stages + VkBool32 fragmentStoresAndAtomicsstores and atomic ops on storage buffers and images are supported in the fragment stage + VkBool32 shaderTessellationAndGeometryPointSizetessellation and geometry stages can export point size + VkBool32 shaderImageGatherExtendedimage gather with runtime values and independent offsets + VkBool32 shaderStorageImageExtendedFormatsthe extended set of formats can be used for storage images + VkBool32 shaderStorageImageMultisamplemultisample images can be used for storage images + VkBool32 shaderStorageImageReadWithoutFormatread from storage image does not require format qualifier + VkBool32 shaderStorageImageWriteWithoutFormatwrite to storage image does not require format qualifier + VkBool32 shaderUniformBufferArrayDynamicIndexingarrays of uniform buffers can be accessed with dynamically uniform indices + VkBool32 shaderSampledImageArrayDynamicIndexingarrays of sampled images can be accessed with dynamically uniform indices + VkBool32 shaderStorageBufferArrayDynamicIndexingarrays of storage buffers can be accessed with dynamically uniform indices + VkBool32 shaderStorageImageArrayDynamicIndexingarrays of storage images can be accessed with dynamically uniform indices + VkBool32 shaderClipDistanceclip distance in shaders + VkBool32 shaderCullDistancecull distance in shaders + VkBool32 shaderFloat6464-bit floats (doubles) in shaders + VkBool32 shaderInt6464-bit integers in shaders + VkBool32 shaderInt1616-bit integers in shaders + VkBool32 shaderResourceResidencyshader can use texture operations that return resource residency information (requires sparseNonResident support) + VkBool32 shaderResourceMinLodshader can use texture operations that specify minimum resource LOD + VkBool32 sparseBindingSparse resources support: Resource memory can be managed at opaque page level rather than object level + VkBool32 sparseResidencyBufferSparse resources support: GPU can access partially resident buffers + VkBool32 sparseResidencyImage2DSparse resources support: GPU can access partially resident 2D (non-MSAA non-depth/stencil) images + VkBool32 sparseResidencyImage3DSparse resources support: GPU can access partially resident 3D images + VkBool32 sparseResidency2SamplesSparse resources support: GPU can access partially resident MSAA 2D images with 2 samples + VkBool32 sparseResidency4SamplesSparse resources support: GPU can access partially resident MSAA 2D images with 4 samples + VkBool32 sparseResidency8SamplesSparse resources support: GPU can access partially resident MSAA 2D images with 8 samples + VkBool32 sparseResidency16SamplesSparse resources support: GPU can access partially resident MSAA 2D images with 16 samples + VkBool32 sparseResidencyAliasedSparse resources support: GPU can correctly access data aliased into multiple locations (opt-in) + VkBool32 variableMultisampleRatemultisample rate must be the same for all pipelines in a subpass + VkBool32 inheritedQueriesQueries may be inherited from primary to secondary command buffers + + + VkBool32 residencyStandard2DBlockShapeSparse resources support: GPU will access all 2D (single sample) sparse resources using the standard sparse image block shapes (based on pixel format) + VkBool32 residencyStandard2DMultisampleBlockShapeSparse resources support: GPU will access all 2D (multisample) sparse resources using the standard sparse image block shapes (based on pixel format) + VkBool32 residencyStandard3DBlockShapeSparse resources support: GPU will access all 3D sparse resources using the standard sparse image block shapes (based on pixel format) + VkBool32 residencyAlignedMipSizeSparse resources support: Images with mip level dimensions that are NOT a multiple of the sparse image block dimensions will be placed in the mip tail + VkBool32 residencyNonResidentStrictSparse resources support: GPU can consistently access non-resident regions of a resource, all reads return as if data is 0, writes are discarded + + + resource maximum sizes + uint32_t maxImageDimension1Dmax 1D image dimension + uint32_t maxImageDimension2Dmax 2D image dimension + uint32_t maxImageDimension3Dmax 3D image dimension + uint32_t maxImageDimensionCubemax cube map image dimension + uint32_t maxImageArrayLayersmax layers for image arrays + uint32_t maxTexelBufferElementsmax texel buffer size (fstexels) + uint32_t maxUniformBufferRangemax uniform buffer range (bytes) + uint32_t maxStorageBufferRangemax storage buffer range (bytes) + uint32_t maxPushConstantsSizemax size of the push constants pool (bytes) + memory limits + uint32_t maxMemoryAllocationCountmax number of device memory allocations supported + uint32_t maxSamplerAllocationCountmax number of samplers that can be allocated on a device + VkDeviceSize bufferImageGranularityGranularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage + VkDeviceSize sparseAddressSpaceSizeTotal address space available for sparse allocations (bytes) + descriptor set limits + uint32_t maxBoundDescriptorSetsmax number of descriptors sets that can be bound to a pipeline + uint32_t maxPerStageDescriptorSamplersmax number of samplers allowed per-stage in a descriptor set + uint32_t maxPerStageDescriptorUniformBuffersmax number of uniform buffers allowed per-stage in a descriptor set + uint32_t maxPerStageDescriptorStorageBuffersmax number of storage buffers allowed per-stage in a descriptor set + uint32_t maxPerStageDescriptorSampledImagesmax number of sampled images allowed per-stage in a descriptor set + uint32_t maxPerStageDescriptorStorageImagesmax number of storage images allowed per-stage in a descriptor set + uint32_t maxPerStageDescriptorInputAttachmentsmax number of input attachments allowed per-stage in a descriptor set + uint32_t maxPerStageResourcesmax number of resources allowed by a single stage + uint32_t maxDescriptorSetSamplersmax number of samplers allowed in all stages in a descriptor set + uint32_t maxDescriptorSetUniformBuffersmax number of uniform buffers allowed in all stages in a descriptor set + uint32_t maxDescriptorSetUniformBuffersDynamicmax number of dynamic uniform buffers allowed in all stages in a descriptor set + uint32_t maxDescriptorSetStorageBuffersmax number of storage buffers allowed in all stages in a descriptor set + uint32_t maxDescriptorSetStorageBuffersDynamicmax number of dynamic storage buffers allowed in all stages in a descriptor set + uint32_t maxDescriptorSetSampledImagesmax number of sampled images allowed in all stages in a descriptor set + uint32_t maxDescriptorSetStorageImagesmax number of storage images allowed in all stages in a descriptor set + uint32_t maxDescriptorSetInputAttachmentsmax number of input attachments allowed in all stages in a descriptor set + vertex stage limits + uint32_t maxVertexInputAttributesmax number of vertex input attribute slots + uint32_t maxVertexInputBindingsmax number of vertex input binding slots + uint32_t maxVertexInputAttributeOffsetmax vertex input attribute offset added to vertex buffer offset + uint32_t maxVertexInputBindingStridemax vertex input binding stride + uint32_t maxVertexOutputComponentsmax number of output components written by vertex shader + tessellation control stage limits + uint32_t maxTessellationGenerationLevelmax level supported by tessellation primitive generator + uint32_t maxTessellationPatchSizemax patch size (vertices) + uint32_t maxTessellationControlPerVertexInputComponentsmax number of input components per-vertex in TCS + uint32_t maxTessellationControlPerVertexOutputComponentsmax number of output components per-vertex in TCS + uint32_t maxTessellationControlPerPatchOutputComponentsmax number of output components per-patch in TCS + uint32_t maxTessellationControlTotalOutputComponentsmax total number of per-vertex and per-patch output components in TCS + tessellation evaluation stage limits + uint32_t maxTessellationEvaluationInputComponentsmax number of input components per vertex in TES + uint32_t maxTessellationEvaluationOutputComponentsmax number of output components per vertex in TES + geometry stage limits + uint32_t maxGeometryShaderInvocationsmax invocation count supported in geometry shader + uint32_t maxGeometryInputComponentsmax number of input components read in geometry stage + uint32_t maxGeometryOutputComponentsmax number of output components written in geometry stage + uint32_t maxGeometryOutputVerticesmax number of vertices that can be emitted in geometry stage + uint32_t maxGeometryTotalOutputComponentsmax total number of components (all vertices) written in geometry stage + fragment stage limits + uint32_t maxFragmentInputComponentsmax number of input components read in fragment stage + uint32_t maxFragmentOutputAttachmentsmax number of output attachments written in fragment stage + uint32_t maxFragmentDualSrcAttachmentsmax number of output attachments written when using dual source blending + uint32_t maxFragmentCombinedOutputResourcesmax total number of storage buffers, storage images and output buffers + compute stage limits + uint32_t maxComputeSharedMemorySizemax total storage size of work group local storage (bytes) + uint32_t maxComputeWorkGroupCount[3]max num of compute work groups that may be dispatched by a single command (x,y,z) + uint32_t maxComputeWorkGroupInvocationsmax total compute invocations in a single local work group + uint32_t maxComputeWorkGroupSize[3]max local size of a compute work group (x,y,z) + uint32_t subPixelPrecisionBitsnumber bits of subpixel precision in screen x and y + uint32_t subTexelPrecisionBitsnumber bits of precision for selecting texel weights + uint32_t mipmapPrecisionBitsnumber bits of precision for selecting mipmap weights + uint32_t maxDrawIndexedIndexValuemax index value for indexed draw calls (for 32-bit indices) + uint32_t maxDrawIndirectCountmax draw count for indirect drawing calls + float maxSamplerLodBiasmax absolute sampler LOD bias + float maxSamplerAnisotropymax degree of sampler anisotropy + uint32_t maxViewportsmax number of active viewports + uint32_t maxViewportDimensions[2]max viewport dimensions (x,y) + float viewportBoundsRange[2]viewport bounds range (min,max) + uint32_t viewportSubPixelBitsnumber bits of subpixel precision for viewport + size_t minMemoryMapAlignmentmin required alignment of pointers returned by MapMemory (bytes) + VkDeviceSize minTexelBufferOffsetAlignmentmin required alignment for texel buffer offsets (bytes) + VkDeviceSize minUniformBufferOffsetAlignmentmin required alignment for uniform buffer sizes and offsets (bytes) + VkDeviceSize minStorageBufferOffsetAlignmentmin required alignment for storage buffer offsets (bytes) + int32_t minTexelOffsetmin texel offset for OpTextureSampleOffset + uint32_t maxTexelOffsetmax texel offset for OpTextureSampleOffset + int32_t minTexelGatherOffsetmin texel offset for OpTextureGatherOffset + uint32_t maxTexelGatherOffsetmax texel offset for OpTextureGatherOffset + float minInterpolationOffsetfurthest negative offset for interpolateAtOffset + float maxInterpolationOffsetfurthest positive offset for interpolateAtOffset + uint32_t subPixelInterpolationOffsetBitsnumber of subpixel bits for interpolateAtOffset + uint32_t maxFramebufferWidthmax width for a framebuffer + uint32_t maxFramebufferHeightmax height for a framebuffer + uint32_t maxFramebufferLayersmax layer count for a layered framebuffer + VkSampleCountFlags framebufferColorSampleCountssupported color sample counts for a framebuffer + VkSampleCountFlags framebufferDepthSampleCountssupported depth sample counts for a framebuffer + VkSampleCountFlags framebufferStencilSampleCountssupported stencil sample counts for a framebuffer + VkSampleCountFlags framebufferNoAttachmentsSampleCountssupported sample counts for a subpass which uses no attachments + uint32_t maxColorAttachmentsmax number of color attachments per subpass + VkSampleCountFlags sampledImageColorSampleCountssupported color sample counts for a non-integer sampled image + VkSampleCountFlags sampledImageIntegerSampleCountssupported sample counts for an integer image + VkSampleCountFlags sampledImageDepthSampleCountssupported depth sample counts for a sampled image + VkSampleCountFlags sampledImageStencilSampleCountssupported stencil sample counts for a sampled image + VkSampleCountFlags storageImageSampleCountssupported sample counts for a storage image + uint32_t maxSampleMaskWordsmax number of sample mask words + VkBool32 timestampComputeAndGraphicstimestamps on graphics and compute queues + float timestampPeriodnumber of nanoseconds it takes for timestamp query value to increment by 1 + uint32_t maxClipDistancesmax number of clip distances + uint32_t maxCullDistancesmax number of cull distances + uint32_t maxCombinedClipAndCullDistancesmax combined number of user clipping + uint32_t discreteQueuePrioritiesdistinct queue priorities available + float pointSizeRange[2]range (min,max) of supported point sizes + float lineWidthRange[2]range (min,max) of supported line widths + float pointSizeGranularitygranularity of supported point sizes + float lineWidthGranularitygranularity of supported line widths + VkBool32 strictLinesline rasterization follows preferred rules + VkBool32 standardSampleLocationssupports standard sample locations for all supported sample counts + VkDeviceSize optimalBufferCopyOffsetAlignmentoptimal offset of buffer copies + VkDeviceSize optimalBufferCopyRowPitchAlignmentoptimal pitch of buffer copies + VkDeviceSize nonCoherentAtomSizeminimum size and alignment for non-coherent host-mapped device memory access + + + VkStructureType sType + const void* pNext + VkSemaphoreCreateFlags flagsSemaphore creation flags + + + VkStructureType sType + const void* pNext + VkQueryPoolCreateFlags flags + VkQueryType queryType + uint32_t queryCount + VkQueryPipelineStatisticFlags pipelineStatisticsOptional + + + VkStructureType sType + const void* pNext + VkFramebufferCreateFlags flags + VkRenderPass renderPass + uint32_t attachmentCount + const VkImageView* pAttachments + uint32_t width + uint32_t height + uint32_t layers + + + uint32_t vertexCount + uint32_t instanceCount + uint32_t firstVertex + uint32_t firstInstance + + + uint32_t indexCount + uint32_t instanceCount + uint32_t firstIndex + int32_t vertexOffset + uint32_t firstInstance + + + uint32_t x + uint32_t y + uint32_t z + + + uint32_t firstVertex + uint32_t vertexCount + + + uint32_t firstIndex + uint32_t indexCount + int32_t vertexOffset + + + VkStructureType sType + const void* pNext + uint32_t waitSemaphoreCount + const VkSemaphore* pWaitSemaphores + const VkPipelineStageFlags* pWaitDstStageMask + uint32_t commandBufferCount + const VkCommandBuffer* pCommandBuffers + uint32_t signalSemaphoreCount + const VkSemaphore* pSignalSemaphores + + WSI extensions + + VkDisplayKHR displayHandle of the display object + const char* displayNameName of the display + VkExtent2D physicalDimensionsIn millimeters? + VkExtent2D physicalResolutionMax resolution for CRT? + VkSurfaceTransformFlagsKHR supportedTransformsone or more bits from VkSurfaceTransformFlagsKHR + VkBool32 planeReorderPossibleVK_TRUE if the overlay plane's z-order can be changed on this display. + VkBool32 persistentContentVK_TRUE if this is a "smart" display that supports self-refresh/internal buffering. + + + VkDisplayKHR currentDisplayDisplay the plane is currently associated with. Will be VK_NULL_HANDLE if the plane is not in use. + uint32_t currentStackIndexCurrent z-order of the plane. + + + VkExtent2D visibleRegionVisible scanout region. + uint32_t refreshRateNumber of times per second the display is updated. + + + VkDisplayModeKHR displayModeHandle of this display mode. + VkDisplayModeParametersKHR parametersThe parameters this mode uses. + + + VkStructureType sType + const void* pNext + VkDisplayModeCreateFlagsKHR flags + VkDisplayModeParametersKHR parametersThe parameters this mode uses. + + + VkDisplayPlaneAlphaFlagsKHR supportedAlphaTypes of alpha blending supported, if any. + VkOffset2D minSrcPositionDoes the plane have any position and extent restrictions? + VkOffset2D maxSrcPosition + VkExtent2D minSrcExtent + VkExtent2D maxSrcExtent + VkOffset2D minDstPosition + VkOffset2D maxDstPosition + VkExtent2D minDstExtent + VkExtent2D maxDstExtent + + + VkStructureType sType + const void* pNext + VkDisplaySurfaceCreateFlagsKHR flags + VkDisplayModeKHR displayModeThe mode to use when displaying this surface + uint32_t planeIndexThe plane on which this surface appears. Must be between 0 and the value returned by vkGetPhysicalDeviceDisplayPlanePropertiesKHR() in pPropertyCount. + uint32_t planeStackIndexThe z-order of the plane. + VkSurfaceTransformFlagBitsKHR transformTransform to apply to the images as part of the scanout operation + float globalAlphaGlobal alpha value. Must be between 0 and 1, inclusive. Ignored if alphaMode is not VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR + VkDisplayPlaneAlphaFlagBitsKHR alphaModeThe type of alpha blending to use. Must be one of the bits from VkDisplayPlaneCapabilitiesKHR::supportedAlpha for this display plane + VkExtent2D imageExtentsize of the images to use with this surface + + + VkStructureType sType + const void* pNext + VkDisplaySurfaceStereoTypeNV stereoTypeThe 3D stereo type to use when presenting this surface. + + + VkStructureType sType + const void* pNext + VkRect2D srcRectRectangle within the presentable image to read pixel data from when presenting to the display. + VkRect2D dstRectRectangle within the current display mode's visible region to display srcRectangle in. + VkBool32 persistentFor smart displays, use buffered mode. If the display properties member "persistentMode" is VK_FALSE, this member must always be VK_FALSE. + + + uint32_t minImageCountSupported minimum number of images for the surface + uint32_t maxImageCountSupported maximum number of images for the surface, 0 for unlimited + VkExtent2D currentExtentCurrent image width and height for the surface, (0, 0) if undefined + VkExtent2D minImageExtentSupported minimum image width and height for the surface + VkExtent2D maxImageExtentSupported maximum image width and height for the surface + uint32_t maxImageArrayLayersSupported maximum number of image layers for the surface + VkSurfaceTransformFlagsKHR supportedTransforms1 or more bits representing the transforms supported + VkSurfaceTransformFlagBitsKHR currentTransformThe surface's current transform relative to the device's natural orientation + VkCompositeAlphaFlagsKHR supportedCompositeAlpha1 or more bits representing the alpha compositing modes supported + VkImageUsageFlags supportedUsageFlagsSupported image usage flags for the surface + + + VkStructureType sType + const void* pNext + VkAndroidSurfaceCreateFlagsKHR flags + struct ANativeWindow* window + + + VkStructureType sType + const void* pNext + VkViSurfaceCreateFlagsNN flags + void* window + + + VkStructureType sType + const void* pNext + VkWaylandSurfaceCreateFlagsKHR flags + struct wl_display* display + struct wl_surface* surface + + + VkStructureType sType + const void* pNext + VkWin32SurfaceCreateFlagsKHR flags + HINSTANCE hinstance + HWND hwnd + + + VkStructureType sType + const void* pNext + VkXlibSurfaceCreateFlagsKHR flags + Display* dpy + Window window + + + VkStructureType sType + const void* pNext + VkXcbSurfaceCreateFlagsKHR flags + xcb_connection_t* connection + xcb_window_t window + + + VkStructureType sType + const void* pNext + VkDirectFBSurfaceCreateFlagsEXT flags + IDirectFB* dfb + IDirectFBSurface* surface + + + VkStructureType sType + const void* pNext + VkImagePipeSurfaceCreateFlagsFUCHSIA flags + zx_handle_t imagePipeHandle + + + VkStructureType sType + const void* pNext + VkStreamDescriptorSurfaceCreateFlagsGGP flags + GgpStreamDescriptor streamDescriptor + + + VkStructureType sType + const void* pNext + VkScreenSurfaceCreateFlagsQNX flags + struct _screen_context* context + struct _screen_window* window + + + VkFormat formatSupported pair of rendering format + VkColorSpaceKHR colorSpaceand color space for the surface + + + VkStructureType sType + const void* pNext + VkSwapchainCreateFlagsKHR flags + VkSurfaceKHR surfaceThe swapchain's target surface + uint32_t minImageCountMinimum number of presentation images the application needs + VkFormat imageFormatFormat of the presentation images + VkColorSpaceKHR imageColorSpaceColorspace of the presentation images + VkExtent2D imageExtentDimensions of the presentation images + uint32_t imageArrayLayersDetermines the number of views for multiview/stereo presentation + VkImageUsageFlags imageUsageBits indicating how the presentation images will be used + VkSharingMode imageSharingModeSharing mode used for the presentation images + uint32_t queueFamilyIndexCountNumber of queue families having access to the images in case of concurrent sharing mode + const uint32_t* pQueueFamilyIndicesArray of queue family indices having access to the images in case of concurrent sharing mode + VkSurfaceTransformFlagBitsKHR preTransformThe transform, relative to the device's natural orientation, applied to the image content prior to presentation + VkCompositeAlphaFlagBitsKHR compositeAlphaThe alpha blending mode used when compositing this surface with other surfaces in the window system + VkPresentModeKHR presentModeWhich presentation mode to use for presents on this swap chain + VkBool32 clippedSpecifies whether presentable images may be affected by window clip regions + VkSwapchainKHR oldSwapchainExisting swap chain to replace, if any + VkSwapchainKHR oldSwapchainExisting swap chain to replace, if any + + + VkStructureType sType + const void* pNext + uint32_t waitSemaphoreCountNumber of semaphores to wait for before presenting + const VkSemaphore* pWaitSemaphoresSemaphores to wait for before presenting + uint32_t swapchainCountNumber of swapchains to present in this call + const VkSwapchainKHR* pSwapchainsSwapchains to present an image from + const uint32_t* pImageIndicesIndices of which presentable images to present + VkResult* pResultsOptional (i.e. if non-NULL) VkResult for each swapchain + + + VkStructureType sType + const void* pNext + VkDebugReportFlagsEXT flagsIndicates which events call this callback + PFN_vkDebugReportCallbackEXT pfnCallbackFunction pointer of a callback function + void* pUserDataData provided to callback function + + + VkStructureType sTypeMust be VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT + const void* pNext + uint32_t disabledValidationCheckCountNumber of validation checks to disable + const VkValidationCheckEXT* pDisabledValidationChecksValidation checks to disable + + + VkStructureType sTypeMust be VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT + const void* pNext + uint32_t enabledValidationFeatureCountNumber of validation features to enable + const VkValidationFeatureEnableEXT* pEnabledValidationFeaturesValidation features to enable + uint32_t disabledValidationFeatureCountNumber of validation features to disable + const VkValidationFeatureDisableEXT* pDisabledValidationFeaturesValidation features to disable + + + VkStructureType sTypeMust be VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT + const void* pNext + uint32_t settingCountNumber of settings to configure + const VkLayerSettingEXT* pSettingsValidation features to enable + + + const char* pLayerName + const char* pSettingName + VkLayerSettingTypeEXT typeThe type of the object + uint32_t valueCountNumber of values of the setting + const void* pValuesValues to pass for a setting + + + VkStructureType sType + const void* pNext + uint32_t vendorID + uint32_t deviceID + uint32_t key + uint64_t value + + + VkStructureType sType + const void* pNext + VkRasterizationOrderAMD rasterizationOrderRasterization order to use for the pipeline + + + VkStructureType sType + const void* pNext + VkDebugReportObjectTypeEXT objectTypeThe type of the object + uint64_t objectThe handle of the object, cast to uint64_t + const char* pObjectNameName to apply to the object + + + VkStructureType sType + const void* pNext + VkDebugReportObjectTypeEXT objectTypeThe type of the object + uint64_t objectThe handle of the object, cast to uint64_t + uint64_t tagNameThe name of the tag to set on the object + size_t tagSizeThe length in bytes of the tag data + const void* pTagTag data to attach to the object + + + VkStructureType sType + const void* pNext + const char* pMarkerNameName of the debug marker + float color[4]Optional color for debug marker + + + VkStructureType sType + const void* pNext + VkBool32 dedicatedAllocationWhether this image uses a dedicated allocation + + + VkStructureType sType + const void* pNext + VkBool32 dedicatedAllocationWhether this buffer uses a dedicated allocation + + + VkStructureType sType + const void* pNext + VkImage imageImage that this allocation will be bound to + VkBuffer bufferBuffer that this allocation will be bound to + + + VkImageFormatProperties imageFormatProperties + VkExternalMemoryFeatureFlagsNV externalMemoryFeatures + VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes + VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagsNV handleTypes + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagsNV handleTypes + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagsNV handleType + HANDLE handle + + + VkStructureType sType + const void* pNext + const SECURITY_ATTRIBUTES* pAttributes + DWORD dwAccess + + + VkStructureType sType + const void* pNext + NvSciBufAttrList pAttributes + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagBits handleType + NvSciBufObj handle + + + VkStructureType sType + const void* pNext + VkDeviceMemory memory + VkExternalMemoryHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + uint32_t memoryTypeBits + + + VkStructureType sType + void* pNext + VkBool32 sciBufImport + VkBool32 sciBufExport + + + + VkStructureType sType + const void* pNext + uint32_t acquireCount + const VkDeviceMemory* pAcquireSyncs + const uint64_t* pAcquireKeys + const uint32_t* pAcquireTimeoutMilliseconds + uint32_t releaseCount + const VkDeviceMemory* pReleaseSyncs + const uint64_t* pReleaseKeys + + + VkStructureType sType + void* pNext + VkBool32 deviceGeneratedCommands + + + VkStructureType sType + void* pNext + VkBool32 deviceGeneratedCompute + VkBool32 deviceGeneratedComputePipelines + VkBool32 deviceGeneratedComputeCaptureReplay + + + VkStructureType sType + const void* pNext + uint32_t privateDataSlotRequestCount + + + + VkStructureType sType + const void* pNext + VkPrivateDataSlotCreateFlags flags + + + + VkStructureType sType + void* pNext + VkBool32 privateData + + + + VkStructureType sType + void* pNext + uint32_t maxGraphicsShaderGroupCount + uint32_t maxIndirectSequenceCount + uint32_t maxIndirectCommandsTokenCount + uint32_t maxIndirectCommandsStreamCount + uint32_t maxIndirectCommandsTokenOffset + uint32_t maxIndirectCommandsStreamStride + uint32_t minSequencesCountBufferOffsetAlignment + uint32_t minSequencesIndexBufferOffsetAlignment + uint32_t minIndirectCommandsBufferOffsetAlignment + + + VkStructureType sType + void* pNext + uint32_t maxMultiDrawCount + + + VkStructureType sType + const void* pNext + uint32_t stageCount + const VkPipelineShaderStageCreateInfo* pStages + const VkPipelineVertexInputStateCreateInfo* pVertexInputState + const VkPipelineTessellationStateCreateInfo* pTessellationState + + + VkStructureType sType + const void* pNext + uint32_t groupCount + const VkGraphicsShaderGroupCreateInfoNV* pGroups + uint32_t pipelineCount + const VkPipeline* pPipelines + + + uint32_t groupIndex + + + VkDeviceAddress bufferAddress + uint32_t size + VkIndexType indexType + + + VkDeviceAddress bufferAddress + uint32_t size + uint32_t stride + + + uint32_t data + + + VkBuffer buffer + VkDeviceSize offset + + + VkStructureType sType + const void* pNext + VkIndirectCommandsTokenTypeNV tokenType + uint32_t stream + uint32_t offset + uint32_t vertexBindingUnit + VkBool32 vertexDynamicStride + VkPipelineLayout pushconstantPipelineLayout + VkShaderStageFlags pushconstantShaderStageFlags + uint32_t pushconstantOffset + uint32_t pushconstantSize + VkIndirectStateFlagsNV indirectStateFlags + uint32_t indexTypeCount + const VkIndexType* pIndexTypes + const uint32_t* pIndexTypeValues + + + VkStructureType sType + const void* pNext + VkIndirectCommandsLayoutUsageFlagsNV flags + VkPipelineBindPoint pipelineBindPoint + uint32_t tokenCount + const VkIndirectCommandsLayoutTokenNV* pTokens + uint32_t streamCount + const uint32_t* pStreamStrides + + + VkStructureType sType + const void* pNext + VkPipelineBindPoint pipelineBindPoint + VkPipeline pipeline + VkIndirectCommandsLayoutNV indirectCommandsLayout + uint32_t streamCount + const VkIndirectCommandsStreamNV* pStreams + uint32_t sequencesCount + VkBuffer preprocessBuffer + VkDeviceSize preprocessOffset + VkDeviceSize preprocessSize + VkBuffer sequencesCountBuffer + VkDeviceSize sequencesCountOffset + VkBuffer sequencesIndexBuffer + VkDeviceSize sequencesIndexOffset + + + VkStructureType sType + const void* pNext + VkPipelineBindPoint pipelineBindPoint + VkPipeline pipeline + VkIndirectCommandsLayoutNV indirectCommandsLayout + uint32_t maxSequencesCount + + + VkStructureType sType + const void* pNext + VkPipelineBindPoint pipelineBindPoint + VkPipeline pipeline + + + VkDeviceAddress pipelineAddress + + + VkStructureType sType + void* pNext + VkPhysicalDeviceFeatures features + + + + VkStructureType sType + void* pNext + VkPhysicalDeviceProperties properties + + + + VkStructureType sType + void* pNext + VkFormatProperties formatProperties + + + + VkStructureType sType + void* pNext + VkImageFormatProperties imageFormatProperties + + + + VkStructureType sType + const void* pNext + VkFormat format + VkImageType type + VkImageTiling tiling + VkImageUsageFlags usage + VkImageCreateFlags flags + + + + VkStructureType sType + void* pNext + VkQueueFamilyProperties queueFamilyProperties + + + + VkStructureType sType + void* pNext + VkPhysicalDeviceMemoryProperties memoryProperties + + + + VkStructureType sType + void* pNext + VkSparseImageFormatProperties properties + + + + VkStructureType sType + const void* pNext + VkFormat format + VkImageType type + VkSampleCountFlagBits samples + VkImageUsageFlags usage + VkImageTiling tiling + + + + VkStructureType sType + void* pNext + uint32_t maxPushDescriptors + + + + uint8_t major + uint8_t minor + uint8_t subminor + uint8_t patch + + + + VkStructureType sType + void* pNext + VkDriverId driverID + char driverName[VK_MAX_DRIVER_NAME_SIZE] + char driverInfo[VK_MAX_DRIVER_INFO_SIZE] + VkConformanceVersion conformanceVersion + + + + VkStructureType sType + const void* pNext + uint32_t swapchainCountCopy of VkPresentInfoKHR::swapchainCount + const VkPresentRegionKHR* pRegionsThe regions that have changed + + + uint32_t rectangleCountNumber of rectangles in pRectangles + const VkRectLayerKHR* pRectanglesArray of rectangles that have changed in a swapchain's image(s) + + + VkOffset2D offsetupper-left corner of a rectangle that has not changed, in pixels of a presentation images + VkExtent2D extentDimensions of a rectangle that has not changed, in pixels of a presentation images + uint32_t layerLayer of a swapchain's image(s), for stereoscopic-3D images + + + VkStructureType sType + void* pNext + VkBool32 variablePointersStorageBuffer + VkBool32 variablePointers + + + + + + VkExternalMemoryFeatureFlags externalMemoryFeatures + VkExternalMemoryHandleTypeFlags exportFromImportedHandleTypes + VkExternalMemoryHandleTypeFlags compatibleHandleTypes + + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagBits handleType + + + + VkStructureType sType + void* pNext + VkExternalMemoryProperties externalMemoryProperties + + + + VkStructureType sType + const void* pNext + VkBufferCreateFlags flags + VkBufferUsageFlags usage + VkExternalMemoryHandleTypeFlagBits handleType + + + + VkStructureType sType + void* pNext + VkExternalMemoryProperties externalMemoryProperties + + + + VkStructureType sType + void* pNext + uint8_t deviceUUID[VK_UUID_SIZE] + uint8_t driverUUID[VK_UUID_SIZE] + uint8_t deviceLUID[VK_LUID_SIZE] + uint32_t deviceNodeMask + VkBool32 deviceLUIDValid + + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlags handleTypes + + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlags handleTypes + + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlags handleTypes + + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagBits handleType + HANDLE handle + LPCWSTR name + + + VkStructureType sType + const void* pNext + const SECURITY_ATTRIBUTES* pAttributes + DWORD dwAccess + LPCWSTR name + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagBits handleType + zx_handle_t handle + + + VkStructureType sType + void* pNext + uint32_t memoryTypeBits + + + VkStructureType sType + const void* pNext + VkDeviceMemory memory + VkExternalMemoryHandleTypeFlagBits handleType + + + VkStructureType sType + void* pNext + uint32_t memoryTypeBits + + + VkStructureType sType + const void* pNext + VkDeviceMemory memory + VkExternalMemoryHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagBits handleType + int fd + + + VkStructureType sType + void* pNext + uint32_t memoryTypeBits + + + VkStructureType sType + const void* pNext + VkDeviceMemory memory + VkExternalMemoryHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + uint32_t acquireCount + const VkDeviceMemory* pAcquireSyncs + const uint64_t* pAcquireKeys + const uint32_t* pAcquireTimeouts + uint32_t releaseCount + const VkDeviceMemory* pReleaseSyncs + const uint64_t* pReleaseKeys + + + VkStructureType sType + const void* pNext + VkExternalSemaphoreHandleTypeFlagBits handleType + + + + VkStructureType sType + void* pNext + VkExternalSemaphoreHandleTypeFlags exportFromImportedHandleTypes + VkExternalSemaphoreHandleTypeFlags compatibleHandleTypes + VkExternalSemaphoreFeatureFlags externalSemaphoreFeatures + + + + VkStructureType sType + const void* pNext + VkExternalSemaphoreHandleTypeFlags handleTypes + + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + VkSemaphoreImportFlags flags + VkExternalSemaphoreHandleTypeFlagBits handleType + HANDLE handle + LPCWSTR name + + + VkStructureType sType + const void* pNext + const SECURITY_ATTRIBUTES* pAttributes + DWORD dwAccess + LPCWSTR name + + + VkStructureType sType + const void* pNext + uint32_t waitSemaphoreValuesCount + const uint64_t* pWaitSemaphoreValues + uint32_t signalSemaphoreValuesCount + const uint64_t* pSignalSemaphoreValues + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + VkExternalSemaphoreHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + VkSemaphoreImportFlags flags + VkExternalSemaphoreHandleTypeFlagBits handleType + int fd + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + VkExternalSemaphoreHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + VkSemaphoreImportFlags flags + VkExternalSemaphoreHandleTypeFlagBits handleType + zx_handle_t zirconHandle + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + VkExternalSemaphoreHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + VkExternalFenceHandleTypeFlagBits handleType + + + + VkStructureType sType + void* pNext + VkExternalFenceHandleTypeFlags exportFromImportedHandleTypes + VkExternalFenceHandleTypeFlags compatibleHandleTypes + VkExternalFenceFeatureFlags externalFenceFeatures + + + + VkStructureType sType + const void* pNext + VkExternalFenceHandleTypeFlags handleTypes + + + + VkStructureType sType + const void* pNext + VkFence fence + VkFenceImportFlags flags + VkExternalFenceHandleTypeFlagBits handleType + HANDLE handle + LPCWSTR name + + + VkStructureType sType + const void* pNext + const SECURITY_ATTRIBUTES* pAttributes + DWORD dwAccess + LPCWSTR name + + + VkStructureType sType + const void* pNext + VkFence fence + VkExternalFenceHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + VkFence fence + VkFenceImportFlags flags + VkExternalFenceHandleTypeFlagBits handleType + int fd + + + VkStructureType sType + const void* pNext + VkFence fence + VkExternalFenceHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + NvSciSyncAttrList pAttributes + + + VkStructureType sType + const void* pNext + VkFence fence + VkExternalFenceHandleTypeFlagBits handleType + void* handle + + + VkStructureType sType + const void* pNext + VkFence fence + VkExternalFenceHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + NvSciSyncAttrList pAttributes + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + VkExternalSemaphoreHandleTypeFlagBits handleType + void* handle + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + VkExternalSemaphoreHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + VkSciSyncClientTypeNV clientType + VkSciSyncPrimitiveTypeNV primitiveType + + + VkStructureType sType + void* pNext + VkBool32 sciSyncFence + VkBool32 sciSyncSemaphore + VkBool32 sciSyncImport + VkBool32 sciSyncExport + + + VkStructureType sType + void* pNext + VkBool32 sciSyncFence + VkBool32 sciSyncSemaphore2 + VkBool32 sciSyncImport + VkBool32 sciSyncExport + + + VkStructureType sType + const void* pNext + NvSciSyncObj handle + + + VkStructureType sType + const void* pNext + VkSemaphoreSciSyncPoolNV semaphorePool + const NvSciSyncFence* pFence + + + VkStructureType sType + const void* pNext + uint32_t semaphoreSciSyncPoolRequestCount + + + VkStructureType sType + void* pNext + VkBool32 multiviewMultiple views in a render pass + VkBool32 multiviewGeometryShaderMultiple views in a render pass w/ geometry shader + VkBool32 multiviewTessellationShaderMultiple views in a render pass w/ tessellation shader + + + + VkStructureType sType + void* pNext + uint32_t maxMultiviewViewCountmax number of views in a subpass + uint32_t maxMultiviewInstanceIndexmax instance index for a draw in a multiview subpass + + + + VkStructureType sType + const void* pNext + uint32_t subpassCount + const uint32_t* pViewMasks + uint32_t dependencyCount + const int32_t* pViewOffsets + uint32_t correlationMaskCount + const uint32_t* pCorrelationMasks + + + + VkStructureType sType + void* pNext + uint32_t minImageCountSupported minimum number of images for the surface + uint32_t maxImageCountSupported maximum number of images for the surface, 0 for unlimited + VkExtent2D currentExtentCurrent image width and height for the surface, (0, 0) if undefined + VkExtent2D minImageExtentSupported minimum image width and height for the surface + VkExtent2D maxImageExtentSupported maximum image width and height for the surface + uint32_t maxImageArrayLayersSupported maximum number of image layers for the surface + VkSurfaceTransformFlagsKHR supportedTransforms1 or more bits representing the transforms supported + VkSurfaceTransformFlagBitsKHR currentTransformThe surface's current transform relative to the device's natural orientation + VkCompositeAlphaFlagsKHR supportedCompositeAlpha1 or more bits representing the alpha compositing modes supported + VkImageUsageFlags supportedUsageFlagsSupported image usage flags for the surface + VkSurfaceCounterFlagsEXT supportedSurfaceCounters + + + VkStructureType sType + const void* pNext + VkDisplayPowerStateEXT powerState + + + VkStructureType sType + const void* pNext + VkDeviceEventTypeEXT deviceEvent + + + VkStructureType sType + const void* pNext + VkDisplayEventTypeEXT displayEvent + + + VkStructureType sType + const void* pNext + VkSurfaceCounterFlagsEXT surfaceCounters + + + VkStructureType sType + void* pNext + uint32_t physicalDeviceCount + VkPhysicalDevice physicalDevices[VK_MAX_DEVICE_GROUP_SIZE] + VkBool32 subsetAllocation + + + + VkStructureType sType + const void* pNext + VkMemoryAllocateFlags flags + uint32_t deviceMask + + + + VkStructureType sType + const void* pNext + VkBuffer buffer + VkDeviceMemory memory + VkDeviceSize memoryOffset + + + + VkStructureType sType + const void* pNext + uint32_t deviceIndexCount + const uint32_t* pDeviceIndices + + + + VkStructureType sType + const void* pNext + VkImage image + VkDeviceMemory memory + VkDeviceSize memoryOffset + + + + VkStructureType sType + const void* pNext + uint32_t deviceIndexCount + const uint32_t* pDeviceIndices + uint32_t splitInstanceBindRegionCount + const VkRect2D* pSplitInstanceBindRegions + + + + VkStructureType sType + const void* pNext + uint32_t deviceMask + uint32_t deviceRenderAreaCount + const VkRect2D* pDeviceRenderAreas + + + + VkStructureType sType + const void* pNext + uint32_t deviceMask + + + + VkStructureType sType + const void* pNext + uint32_t waitSemaphoreCount + const uint32_t* pWaitSemaphoreDeviceIndices + uint32_t commandBufferCount + const uint32_t* pCommandBufferDeviceMasks + uint32_t signalSemaphoreCount + const uint32_t* pSignalSemaphoreDeviceIndices + + + + VkStructureType sType + const void* pNext + uint32_t resourceDeviceIndex + uint32_t memoryDeviceIndex + + + + VkStructureType sType + void* pNext + uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE] + VkDeviceGroupPresentModeFlagsKHR modes + + + VkStructureType sType + const void* pNext + VkSwapchainKHR swapchain + + + VkStructureType sType + const void* pNext + VkSwapchainKHR swapchain + uint32_t imageIndex + + + VkStructureType sType + const void* pNext + VkSwapchainKHR swapchain + uint64_t timeout + VkSemaphore semaphore + VkFence fence + uint32_t deviceMask + + + VkStructureType sType + const void* pNext + uint32_t swapchainCount + const uint32_t* pDeviceMasks + VkDeviceGroupPresentModeFlagBitsKHR mode + + + VkStructureType sType + const void* pNext + uint32_t physicalDeviceCount + const VkPhysicalDevice* pPhysicalDevices + + + + VkStructureType sType + const void* pNext + VkDeviceGroupPresentModeFlagsKHR modes + + + uint32_t dstBindingBinding within the destination descriptor set to write + uint32_t dstArrayElementArray element within the destination binding to write + uint32_t descriptorCountNumber of descriptors to write + VkDescriptorType descriptorTypeDescriptor type to write + size_t offsetOffset into pData where the descriptors to update are stored + size_t strideStride between two descriptors in pData when writing more than one descriptor + + + + VkStructureType sType + const void* pNext + VkDescriptorUpdateTemplateCreateFlags flags + uint32_t descriptorUpdateEntryCountNumber of descriptor update entries to use for the update template + const VkDescriptorUpdateTemplateEntry* pDescriptorUpdateEntriesDescriptor update entries for the template + VkDescriptorUpdateTemplateType templateType + VkDescriptorSetLayout descriptorSetLayout + VkPipelineBindPoint pipelineBindPoint + VkPipelineLayout pipelineLayoutIf used for push descriptors, this is the only allowed layout + uint32_t set + + + + float x + float y + + + VkStructureType sType + void* pNext + VkBool32 presentIdPresent ID in VkPresentInfoKHR + + + VkStructureType sType + const void* pNext + uint32_t swapchainCountCopy of VkPresentInfoKHR::swapchainCount + const uint64_t* pPresentIdsPresent ID values for each swapchain + + + VkStructureType sType + void* pNext + VkBool32 presentWaitvkWaitForPresentKHR is supported + + + Display primary in chromaticity coordinates + VkStructureType sType + const void* pNext + From SMPTE 2086 + VkXYColorEXT displayPrimaryRedDisplay primary's Red + VkXYColorEXT displayPrimaryGreenDisplay primary's Green + VkXYColorEXT displayPrimaryBlueDisplay primary's Blue + VkXYColorEXT whitePointDisplay primary's Blue + float maxLuminanceDisplay maximum luminance + float minLuminanceDisplay minimum luminance + From CTA 861.3 + float maxContentLightLevelContent maximum luminance + float maxFrameAverageLightLevel + + + VkStructureType sType + const void* pNext + size_t dynamicMetadataSizeSpecified in bytes + const void* pDynamicMetadataBinary code of size dynamicMetadataSize + + + VkStructureType sType + void* pNext + VkBool32 localDimmingSupport + + + VkStructureType sType + const void* pNext + VkBool32 localDimmingEnable + + + uint64_t refreshDurationNumber of nanoseconds from the start of one refresh cycle to the next + + + uint32_t presentIDApplication-provided identifier, previously given to vkQueuePresentKHR + uint64_t desiredPresentTimeEarliest time an image should have been presented, previously given to vkQueuePresentKHR + uint64_t actualPresentTimeTime the image was actually displayed + uint64_t earliestPresentTimeEarliest time the image could have been displayed + uint64_t presentMarginHow early vkQueuePresentKHR was processed vs. how soon it needed to be and make earliestPresentTime + + + VkStructureType sType + const void* pNext + uint32_t swapchainCountCopy of VkPresentInfoKHR::swapchainCount + const VkPresentTimeGOOGLE* pTimesThe earliest times to present images + + + uint32_t presentIDApplication-provided identifier + uint64_t desiredPresentTimeEarliest time an image should be presented + + + VkStructureType sType + const void* pNext + VkIOSSurfaceCreateFlagsMVK flags + const void* pView + + + VkStructureType sType + const void* pNext + VkMacOSSurfaceCreateFlagsMVK flags + const void* pView + + + VkStructureType sType + const void* pNext + VkMetalSurfaceCreateFlagsEXT flags + const CAMetalLayer* pLayer + + + float xcoeff + float ycoeff + + + VkStructureType sType + const void* pNext + VkBool32 viewportWScalingEnable + uint32_t viewportCount + const VkViewportWScalingNV* pViewportWScalings + + + VkViewportCoordinateSwizzleNV x + VkViewportCoordinateSwizzleNV y + VkViewportCoordinateSwizzleNV z + VkViewportCoordinateSwizzleNV w + + + VkStructureType sType + const void* pNext + VkPipelineViewportSwizzleStateCreateFlagsNV flags + uint32_t viewportCount + const VkViewportSwizzleNV* pViewportSwizzles + + + VkStructureType sType + void* pNext + uint32_t maxDiscardRectanglesmax number of active discard rectangles + + + VkStructureType sType + const void* pNext + VkPipelineDiscardRectangleStateCreateFlagsEXT flags + VkDiscardRectangleModeEXT discardRectangleMode + uint32_t discardRectangleCount + const VkRect2D* pDiscardRectangles + + + VkStructureType sType + void* pNext + VkBool32 perViewPositionAllComponents + + + uint32_t subpass + uint32_t inputAttachmentIndex + VkImageAspectFlags aspectMask + + + + VkStructureType sType + const void* pNext + uint32_t aspectReferenceCount + const VkInputAttachmentAspectReference* pAspectReferences + + + + VkStructureType sType + const void* pNext + VkSurfaceKHR surface + + + VkStructureType sType + void* pNext + VkSurfaceCapabilitiesKHR surfaceCapabilities + + + VkStructureType sType + void* pNext + VkSurfaceFormatKHR surfaceFormat + + + VkStructureType sType + void* pNext + VkDisplayPropertiesKHR displayProperties + + + VkStructureType sType + void* pNext + VkDisplayPlanePropertiesKHR displayPlaneProperties + + + VkStructureType sType + void* pNext + VkDisplayModePropertiesKHR displayModeProperties + + + VkStructureType sType + const void* pNext + VkBool32 hdmi3DSupportedWhether this mode supports HDMI 3D stereo rendering. + + + VkStructureType sType + const void* pNext + VkDisplayModeKHR mode + uint32_t planeIndex + + + VkStructureType sType + void* pNext + VkDisplayPlaneCapabilitiesKHR capabilities + + + VkStructureType sType + void* pNext + VkImageUsageFlags sharedPresentSupportedUsageFlagsSupported image usage flags if swapchain created using a shared present mode + + + VkStructureType sType + void* pNext + VkBool32 storageBuffer16BitAccess16-bit integer/floating-point variables supported in BufferBlock + VkBool32 uniformAndStorageBuffer16BitAccess16-bit integer/floating-point variables supported in BufferBlock and Block + VkBool32 storagePushConstant1616-bit integer/floating-point variables supported in PushConstant + VkBool32 storageInputOutput1616-bit integer/floating-point variables supported in shader inputs and outputs + + + + VkStructureType sType + void* pNext + uint32_t subgroupSizeThe size of a subgroup for this queue. + VkShaderStageFlags supportedStagesBitfield of what shader stages support subgroup operations + VkSubgroupFeatureFlags supportedOperationsBitfield of what subgroup operations are supported. + VkBool32 quadOperationsInAllStagesFlag to specify whether quad operations are available in all stages. + + + VkStructureType sType + void* pNext + VkBool32 shaderSubgroupExtendedTypesFlag to specify whether subgroup operations with extended types are supported + + + + VkStructureType sType + const void* pNext + VkBuffer buffer + + + + VkStructureType sType + const void* pNext + const VkBufferCreateInfo* pCreateInfo + + + + VkStructureType sType + const void* pNext + VkImage image + + + + VkStructureType sType + const void* pNext + VkImage image + + + + VkStructureType sType + const void* pNext + const VkImageCreateInfo* pCreateInfo + VkImageAspectFlagBits planeAspect + + + + VkStructureType sType + void* pNext + VkMemoryRequirements memoryRequirements + + + + VkStructureType sType + void* pNext + VkSparseImageMemoryRequirements memoryRequirements + + + + VkStructureType sType + void* pNext + VkPointClippingBehavior pointClippingBehavior + + + + VkStructureType sType + void* pNext + VkBool32 prefersDedicatedAllocation + VkBool32 requiresDedicatedAllocation + + + + VkStructureType sType + const void* pNext + VkImage imageImage that this allocation will be bound to + VkBuffer bufferBuffer that this allocation will be bound to + + + + VkStructureType sType + const void* pNext + VkImageUsageFlags usage + + + VkStructureType sType + const void* pNext + uint32_t sliceOffset + uint32_t sliceCount + + + + VkStructureType sType + const void* pNext + VkTessellationDomainOrigin domainOrigin + + + + VkStructureType sType + const void* pNext + VkSamplerYcbcrConversion conversion + + + + VkStructureType sType + const void* pNext + VkFormat format + VkSamplerYcbcrModelConversion ycbcrModel + VkSamplerYcbcrRange ycbcrRange + VkComponentMapping components + VkChromaLocation xChromaOffset + VkChromaLocation yChromaOffset + VkFilter chromaFilter + VkBool32 forceExplicitReconstruction + + + + VkStructureType sType + const void* pNext + VkImageAspectFlagBits planeAspect + + + + VkStructureType sType + const void* pNext + VkImageAspectFlagBits planeAspect + + + + VkStructureType sType + void* pNext + VkBool32 samplerYcbcrConversionSampler color conversion supported + + + + VkStructureType sType + void* pNext + uint32_t combinedImageSamplerDescriptorCount + + + + VkStructureType sType + void* pNext + VkBool32 supportsTextureGatherLODBiasAMD + + + VkStructureType sType + const void* pNext + VkBuffer buffer + VkDeviceSize offset + VkConditionalRenderingFlagsEXT flags + + + VkStructureType sType + const void* pNext + VkBool32 protectedSubmitSubmit protected command buffers + + + VkStructureType sType + void* pNext + VkBool32 protectedMemory + + + VkStructureType sType + void* pNext + VkBool32 protectedNoFault + + + VkStructureType sType + const void* pNext + VkDeviceQueueCreateFlags flags + uint32_t queueFamilyIndex + uint32_t queueIndex + + + VkStructureType sType + const void* pNext + VkPipelineCoverageToColorStateCreateFlagsNV flags + VkBool32 coverageToColorEnable + uint32_t coverageToColorLocation + + + VkStructureType sType + void* pNext + VkBool32 filterMinmaxSingleComponentFormats + VkBool32 filterMinmaxImageComponentMapping + + + + float x + float y + + + VkStructureType sType + const void* pNext + VkSampleCountFlagBits sampleLocationsPerPixel + VkExtent2D sampleLocationGridSize + uint32_t sampleLocationsCount + const VkSampleLocationEXT* pSampleLocations + + + uint32_t attachmentIndex + VkSampleLocationsInfoEXT sampleLocationsInfo + + + uint32_t subpassIndex + VkSampleLocationsInfoEXT sampleLocationsInfo + + + VkStructureType sType + const void* pNext + uint32_t attachmentInitialSampleLocationsCount + const VkAttachmentSampleLocationsEXT* pAttachmentInitialSampleLocations + uint32_t postSubpassSampleLocationsCount + const VkSubpassSampleLocationsEXT* pPostSubpassSampleLocations + + + VkStructureType sType + const void* pNext + VkBool32 sampleLocationsEnable + VkSampleLocationsInfoEXT sampleLocationsInfo + + + VkStructureType sType + void* pNext + VkSampleCountFlags sampleLocationSampleCounts + VkExtent2D maxSampleLocationGridSize + float sampleLocationCoordinateRange[2] + uint32_t sampleLocationSubPixelBits + VkBool32 variableSampleLocations + + + VkStructureType sType + void* pNext + VkExtent2D maxSampleLocationGridSize + + + VkStructureType sType + const void* pNext + VkSamplerReductionMode reductionMode + + + + VkStructureType sType + void* pNext + VkBool32 advancedBlendCoherentOperations + + + VkStructureType sType + void* pNext + VkBool32 multiDraw + + + VkStructureType sType + void* pNext + uint32_t advancedBlendMaxColorAttachments + VkBool32 advancedBlendIndependentBlend + VkBool32 advancedBlendNonPremultipliedSrcColor + VkBool32 advancedBlendNonPremultipliedDstColor + VkBool32 advancedBlendCorrelatedOverlap + VkBool32 advancedBlendAllOperations + + + VkStructureType sType + const void* pNext + VkBool32 srcPremultiplied + VkBool32 dstPremultiplied + VkBlendOverlapEXT blendOverlap + + + VkStructureType sType + void* pNext + VkBool32 inlineUniformBlock + VkBool32 descriptorBindingInlineUniformBlockUpdateAfterBind + + + + VkStructureType sType + void* pNext + uint32_t maxInlineUniformBlockSize + uint32_t maxPerStageDescriptorInlineUniformBlocks + uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks + uint32_t maxDescriptorSetInlineUniformBlocks + uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks + + + + VkStructureType sType + const void* pNext + uint32_t dataSize + const void* pData + + + + VkStructureType sType + const void* pNext + uint32_t maxInlineUniformBlockBindings + + + + VkStructureType sType + const void* pNext + VkPipelineCoverageModulationStateCreateFlagsNV flags + VkCoverageModulationModeNV coverageModulationMode + VkBool32 coverageModulationTableEnable + uint32_t coverageModulationTableCount + const float* pCoverageModulationTable + + + VkStructureType sType + const void* pNext + uint32_t viewFormatCount + const VkFormat* pViewFormats + + + + VkStructureType sType + const void* pNext + VkValidationCacheCreateFlagsEXT flags + size_t initialDataSize + const void* pInitialData + + + VkStructureType sType + const void* pNext + VkValidationCacheEXT validationCache + + + VkStructureType sType + void* pNext + uint32_t maxPerSetDescriptors + VkDeviceSize maxMemoryAllocationSize + + + + VkStructureType sType + void* pNext + VkBool32 maintenance4 + + + + VkStructureType sType + void* pNext + VkDeviceSize maxBufferSize + + + + VkStructureType sType + void* pNext + VkBool32 maintenance5 + + + + VkStructureType sType + void* pNext + VkBool32 earlyFragmentMultisampleCoverageAfterSampleCounting + VkBool32 earlyFragmentSampleMaskTestBeforeSampleCounting + VkBool32 depthStencilSwizzleOneSupport + VkBool32 polygonModePointSize + VkBool32 nonStrictSinglePixelWideLinesUseParallelogram + VkBool32 nonStrictWideLinesUseParallelogram + + + + VkStructureType sType + void* pNext + VkBool32 maintenance6 + + + + VkStructureType sType + void* pNext + VkBool32 blockTexelViewCompatibleMultipleLayers + uint32_t maxCombinedImageSamplerDescriptorCount + VkBool32 fragmentShadingRateClampCombinerInputs + + + + VkStructureType sType + void* pNext + VkBool32 maintenance7 + + + VkStructureType sType + void* pNext + VkBool32 robustFragmentShadingRateAttachmentAccess + VkBool32 separateDepthStencilAttachmentAccess + uint32_t maxDescriptorSetTotalUniformBuffersDynamic + uint32_t maxDescriptorSetTotalStorageBuffersDynamic + uint32_t maxDescriptorSetTotalBuffersDynamic + uint32_t maxDescriptorSetUpdateAfterBindTotalUniformBuffersDynamic + uint32_t maxDescriptorSetUpdateAfterBindTotalStorageBuffersDynamic + uint32_t maxDescriptorSetUpdateAfterBindTotalBuffersDynamic + + + VkStructureType sType + void* pNext + uint32_t layeredApiCount + VkPhysicalDeviceLayeredApiPropertiesKHR* pLayeredApisOutput list of layered implementations underneath the physical device + + + VkStructureType sType + void* pNext + uint32_t vendorID + uint32_t deviceID + VkPhysicalDeviceLayeredApiKHR layeredAPI + char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] + + + VkStructureType sType + void* pNext + VkPhysicalDeviceProperties2 properties + + + VkStructureType sType + const void* pNext + uint32_t viewMask + uint32_t colorAttachmentCount + const VkFormat* pColorAttachmentFormats + VkFormat depthAttachmentFormat + VkFormat stencilAttachmentFormat + + + + VkStructureType sType + void* pNext + VkBool32 supported + + + + VkStructureType sType + void* pNext + VkBool32 shaderDrawParameters + + + + VkStructureType sType + void* pNext + VkBool32 shaderFloat1616-bit floats (halfs) in shaders + VkBool32 shaderInt88-bit integers in shaders + + + + + VkStructureType sType + void* pNext + VkShaderFloatControlsIndependence denormBehaviorIndependence + VkShaderFloatControlsIndependence roundingModeIndependence + VkBool32 shaderSignedZeroInfNanPreserveFloat16An implementation can preserve signed zero, nan, inf + VkBool32 shaderSignedZeroInfNanPreserveFloat32An implementation can preserve signed zero, nan, inf + VkBool32 shaderSignedZeroInfNanPreserveFloat64An implementation can preserve signed zero, nan, inf + VkBool32 shaderDenormPreserveFloat16An implementation can preserve denormals + VkBool32 shaderDenormPreserveFloat32An implementation can preserve denormals + VkBool32 shaderDenormPreserveFloat64An implementation can preserve denormals + VkBool32 shaderDenormFlushToZeroFloat16An implementation can flush to zero denormals + VkBool32 shaderDenormFlushToZeroFloat32An implementation can flush to zero denormals + VkBool32 shaderDenormFlushToZeroFloat64An implementation can flush to zero denormals + VkBool32 shaderRoundingModeRTEFloat16An implementation can support RTE + VkBool32 shaderRoundingModeRTEFloat32An implementation can support RTE + VkBool32 shaderRoundingModeRTEFloat64An implementation can support RTE + VkBool32 shaderRoundingModeRTZFloat16An implementation can support RTZ + VkBool32 shaderRoundingModeRTZFloat32An implementation can support RTZ + VkBool32 shaderRoundingModeRTZFloat64An implementation can support RTZ + + + + VkStructureType sType + void* pNext + VkBool32 hostQueryReset + + + + uint64_t consumer + uint64_t producer + + + VkStructureType sType + const void* pNext + const void* handle + int stride + int format + int usage + VkNativeBufferUsage2ANDROID usage2 + + + VkStructureType sType + const void* pNext + VkSwapchainImageUsageFlagsANDROID usage + + + VkStructureType sType + const void* pNext + VkBool32 sharedImage + + + uint32_t numUsedVgprs + uint32_t numUsedSgprs + uint32_t ldsSizePerLocalWorkGroup + size_t ldsUsageSizeInBytes + size_t scratchMemUsageInBytes + + + VkShaderStageFlags shaderStageMask + VkShaderResourceUsageAMD resourceUsage + uint32_t numPhysicalVgprs + uint32_t numPhysicalSgprs + uint32_t numAvailableVgprs + uint32_t numAvailableSgprs + uint32_t computeWorkGroupSize[3] + + + VkStructureType sType + const void* pNext + VkQueueGlobalPriority globalPriority + + + + + VkStructureType sType + void* pNext + VkBool32 globalPriorityQuery + + + + + VkStructureType sType + void* pNext + uint32_t priorityCount + VkQueueGlobalPriority priorities[VK_MAX_GLOBAL_PRIORITY_SIZE] + + + + + VkStructureType sType + const void* pNext + VkObjectType objectType + uint64_t objectHandle + const char* pObjectName + + + VkStructureType sType + const void* pNext + VkObjectType objectType + uint64_t objectHandle + uint64_t tagName + size_t tagSize + const void* pTag + + + VkStructureType sType + const void* pNext + const char* pLabelName + float color[4] + + + VkStructureType sType + const void* pNext + VkDebugUtilsMessengerCreateFlagsEXT flags + VkDebugUtilsMessageSeverityFlagsEXT messageSeverity + VkDebugUtilsMessageTypeFlagsEXT messageType + PFN_vkDebugUtilsMessengerCallbackEXT pfnUserCallback + void* pUserData + + + VkStructureType sType + const void* pNext + VkDebugUtilsMessengerCallbackDataFlagsEXT flags + const char* pMessageIdName + int32_t messageIdNumber + const char* pMessage + uint32_t queueLabelCount + const VkDebugUtilsLabelEXT* pQueueLabels + uint32_t cmdBufLabelCount + const VkDebugUtilsLabelEXT* pCmdBufLabels + uint32_t objectCount + const VkDebugUtilsObjectNameInfoEXT* pObjects + + + VkStructureType sType + void* pNext + VkBool32 deviceMemoryReport + + + VkStructureType sType + const void* pNext + VkDeviceMemoryReportFlagsEXT flags + PFN_vkDeviceMemoryReportCallbackEXT pfnUserCallback + void* pUserData + + + VkStructureType sType + void* pNext + VkDeviceMemoryReportFlagsEXT flags + VkDeviceMemoryReportEventTypeEXT type + uint64_t memoryObjectId + VkDeviceSize size + VkObjectType objectType + uint64_t objectHandle + uint32_t heapIndex + + + VkStructureType sType + const void* pNext + VkExternalMemoryHandleTypeFlagBits handleType + void* pHostPointer + + + VkStructureType sType + void* pNext + uint32_t memoryTypeBits + + + VkStructureType sType + void* pNext + VkDeviceSize minImportedHostPointerAlignment + + + VkStructureType sType + void* pNext + float primitiveOverestimationSizeThe size in pixels the primitive is enlarged at each edge during conservative rasterization + float maxExtraPrimitiveOverestimationSizeThe maximum additional overestimation the client can specify in the pipeline state + float extraPrimitiveOverestimationSizeGranularityThe granularity of extra overestimation sizes the implementations supports between 0 and maxExtraOverestimationSize + VkBool32 primitiveUnderestimationtrue if the implementation supports conservative rasterization underestimation mode + VkBool32 conservativePointAndLineRasterizationtrue if conservative rasterization also applies to points and lines + VkBool32 degenerateTrianglesRasterizedtrue if degenerate triangles (those with zero area after snap) are rasterized + VkBool32 degenerateLinesRasterizedtrue if degenerate lines (those with zero length after snap) are rasterized + VkBool32 fullyCoveredFragmentShaderInputVariabletrue if the implementation supports the FullyCoveredEXT SPIR-V builtin fragment shader input variable + VkBool32 conservativeRasterizationPostDepthCoveragetrue if the implementation supports both conservative rasterization and post depth coverage sample coverage mask + + + VkStructureType sType + const void* pNext + VkTimeDomainKHR timeDomain + + + + VkStructureType sType + void* pNext + uint32_t shaderEngineCountnumber of shader engines + uint32_t shaderArraysPerEngineCountnumber of shader arrays + uint32_t computeUnitsPerShaderArraynumber of physical CUs per shader array + uint32_t simdPerComputeUnitnumber of SIMDs per compute unit + uint32_t wavefrontsPerSimdnumber of wavefront slots in each SIMD + uint32_t wavefrontSizemaximum number of threads per wavefront + uint32_t sgprsPerSimdnumber of physical SGPRs per SIMD + uint32_t minSgprAllocationminimum number of SGPRs that can be allocated by a wave + uint32_t maxSgprAllocationnumber of available SGPRs + uint32_t sgprAllocationGranularitySGPRs are allocated in groups of this size + uint32_t vgprsPerSimdnumber of physical VGPRs per SIMD + uint32_t minVgprAllocationminimum number of VGPRs that can be allocated by a wave + uint32_t maxVgprAllocationnumber of available VGPRs + uint32_t vgprAllocationGranularityVGPRs are allocated in groups of this size + + + VkStructureType sType + void* pNextPointer to next structure + VkShaderCorePropertiesFlagsAMD shaderCoreFeaturesfeatures supported by the shader core + uint32_t activeComputeUnitCountnumber of active compute units across all shader engines/arrays + + + VkStructureType sType + const void* pNext + VkPipelineRasterizationConservativeStateCreateFlagsEXT flagsReserved + VkConservativeRasterizationModeEXT conservativeRasterizationModeConservative rasterization mode + float extraPrimitiveOverestimationSizeExtra overestimation to add to the primitive + + + VkStructureType sType + void* pNext + VkBool32 shaderInputAttachmentArrayDynamicIndexing + VkBool32 shaderUniformTexelBufferArrayDynamicIndexing + VkBool32 shaderStorageTexelBufferArrayDynamicIndexing + VkBool32 shaderUniformBufferArrayNonUniformIndexing + VkBool32 shaderSampledImageArrayNonUniformIndexing + VkBool32 shaderStorageBufferArrayNonUniformIndexing + VkBool32 shaderStorageImageArrayNonUniformIndexing + VkBool32 shaderInputAttachmentArrayNonUniformIndexing + VkBool32 shaderUniformTexelBufferArrayNonUniformIndexing + VkBool32 shaderStorageTexelBufferArrayNonUniformIndexing + VkBool32 descriptorBindingUniformBufferUpdateAfterBind + VkBool32 descriptorBindingSampledImageUpdateAfterBind + VkBool32 descriptorBindingStorageImageUpdateAfterBind + VkBool32 descriptorBindingStorageBufferUpdateAfterBind + VkBool32 descriptorBindingUniformTexelBufferUpdateAfterBind + VkBool32 descriptorBindingStorageTexelBufferUpdateAfterBind + VkBool32 descriptorBindingUpdateUnusedWhilePending + VkBool32 descriptorBindingPartiallyBound + VkBool32 descriptorBindingVariableDescriptorCount + VkBool32 runtimeDescriptorArray + + + + VkStructureType sType + void* pNext + uint32_t maxUpdateAfterBindDescriptorsInAllPools + VkBool32 shaderUniformBufferArrayNonUniformIndexingNative + VkBool32 shaderSampledImageArrayNonUniformIndexingNative + VkBool32 shaderStorageBufferArrayNonUniformIndexingNative + VkBool32 shaderStorageImageArrayNonUniformIndexingNative + VkBool32 shaderInputAttachmentArrayNonUniformIndexingNative + VkBool32 robustBufferAccessUpdateAfterBind + VkBool32 quadDivergentImplicitLod + uint32_t maxPerStageDescriptorUpdateAfterBindSamplers + uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers + uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers + uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages + uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages + uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments + uint32_t maxPerStageUpdateAfterBindResources + uint32_t maxDescriptorSetUpdateAfterBindSamplers + uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers + uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic + uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers + uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic + uint32_t maxDescriptorSetUpdateAfterBindSampledImages + uint32_t maxDescriptorSetUpdateAfterBindStorageImages + uint32_t maxDescriptorSetUpdateAfterBindInputAttachments + + + + VkStructureType sType + const void* pNext + uint32_t bindingCount + const VkDescriptorBindingFlags* pBindingFlags + + + + VkStructureType sType + const void* pNext + uint32_t descriptorSetCount + const uint32_t* pDescriptorCounts + + + + VkStructureType sType + void* pNext + uint32_t maxVariableDescriptorCount + + + + VkStructureType sType + const void* pNext + VkAttachmentDescriptionFlags flags + VkFormat format + VkSampleCountFlagBits samples + VkAttachmentLoadOp loadOpLoad operation for color or depth data + VkAttachmentStoreOp storeOpStore operation for color or depth data + VkAttachmentLoadOp stencilLoadOpLoad operation for stencil data + VkAttachmentStoreOp stencilStoreOpStore operation for stencil data + VkImageLayout initialLayout + VkImageLayout finalLayout + + + + VkStructureType sType + const void* pNext + uint32_t attachment + VkImageLayout layout + VkImageAspectFlags aspectMask + + + + VkStructureType sType + const void* pNext + VkSubpassDescriptionFlags flags + VkPipelineBindPoint pipelineBindPoint + uint32_t viewMask + uint32_t inputAttachmentCount + const VkAttachmentReference2* pInputAttachments + uint32_t colorAttachmentCount + const VkAttachmentReference2* pColorAttachments + const VkAttachmentReference2* pResolveAttachments + const VkAttachmentReference2* pDepthStencilAttachment + uint32_t preserveAttachmentCount + const uint32_t* pPreserveAttachments + + + + VkStructureType sType + const void* pNext + uint32_t srcSubpass + uint32_t dstSubpass + VkPipelineStageFlags srcStageMask + VkPipelineStageFlags dstStageMask + VkAccessFlags srcAccessMask + VkAccessFlags dstAccessMask + VkDependencyFlags dependencyFlags + int32_t viewOffset + + + + VkStructureType sType + const void* pNext + VkRenderPassCreateFlags flags + uint32_t attachmentCount + const VkAttachmentDescription2* pAttachments + uint32_t subpassCount + const VkSubpassDescription2* pSubpasses + uint32_t dependencyCount + const VkSubpassDependency2* pDependencies + uint32_t correlatedViewMaskCount + const uint32_t* pCorrelatedViewMasks + + + + VkStructureType sType + const void* pNext + VkSubpassContents contents + + + + VkStructureType sType + const void* pNext + + + + VkStructureType sType + void* pNext + VkBool32 timelineSemaphore + + + + VkStructureType sType + void* pNext + uint64_t maxTimelineSemaphoreValueDifference + + + + VkStructureType sType + const void* pNext + VkSemaphoreType semaphoreType + uint64_t initialValue + + + + VkStructureType sType + const void* pNext + uint32_t waitSemaphoreValueCount + const uint64_t* pWaitSemaphoreValues + uint32_t signalSemaphoreValueCount + const uint64_t* pSignalSemaphoreValues + + + + VkStructureType sType + const void* pNext + VkSemaphoreWaitFlags flags + uint32_t semaphoreCount + const VkSemaphore* pSemaphores + const uint64_t* pValues + + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + uint64_t value + + + + uint32_t binding + uint32_t divisor + + + + + VkStructureType sType + const void* pNext + uint32_t vertexBindingDivisorCount + const VkVertexInputBindingDivisorDescription* pVertexBindingDivisors + + + + + VkStructureType sType + void* pNext + uint32_t maxVertexAttribDivisormax value of vertex attribute divisor + + + VkStructureType sType + void* pNext + uint32_t maxVertexAttribDivisormax value of vertex attribute divisor + VkBool32 supportsNonZeroFirstInstance + + + + VkStructureType sType + void* pNext + uint32_t pciDomain + uint32_t pciBus + uint32_t pciDevice + uint32_t pciFunction + + + VkStructureType sType + const void* pNext + struct AHardwareBuffer* buffer + + + VkStructureType sType + void* pNext + uint64_t androidHardwareBufferUsage + + + VkStructureType sType + void* pNext + VkDeviceSize allocationSize + uint32_t memoryTypeBits + + + VkStructureType sType + const void* pNext + VkDeviceMemory memory + + + VkStructureType sType + void* pNext + VkFormat format + uint64_t externalFormat + VkFormatFeatureFlags formatFeatures + VkComponentMapping samplerYcbcrConversionComponents + VkSamplerYcbcrModelConversion suggestedYcbcrModel + VkSamplerYcbcrRange suggestedYcbcrRange + VkChromaLocation suggestedXChromaOffset + VkChromaLocation suggestedYChromaOffset + + + VkStructureType sType + const void* pNext + VkBool32 conditionalRenderingEnableWhether this secondary command buffer may be executed during an active conditional rendering + + + VkStructureType sType + void* pNext + uint64_t externalFormat + + + VkStructureType sType + void* pNext + VkBool32 storageBuffer8BitAccess8-bit integer variables supported in StorageBuffer + VkBool32 uniformAndStorageBuffer8BitAccess8-bit integer variables supported in StorageBuffer and Uniform + VkBool32 storagePushConstant88-bit integer variables supported in PushConstant + + + + VkStructureType sType + void* pNext + VkBool32 conditionalRendering + VkBool32 inheritedConditionalRendering + + + VkStructureType sType + void* pNext + VkBool32 vulkanMemoryModel + VkBool32 vulkanMemoryModelDeviceScope + VkBool32 vulkanMemoryModelAvailabilityVisibilityChains + + + + VkStructureType sType + void* pNext + VkBool32 shaderBufferInt64Atomics + VkBool32 shaderSharedInt64Atomics + + + + VkStructureType sType + void* pNext + VkBool32 shaderBufferFloat32Atomics + VkBool32 shaderBufferFloat32AtomicAdd + VkBool32 shaderBufferFloat64Atomics + VkBool32 shaderBufferFloat64AtomicAdd + VkBool32 shaderSharedFloat32Atomics + VkBool32 shaderSharedFloat32AtomicAdd + VkBool32 shaderSharedFloat64Atomics + VkBool32 shaderSharedFloat64AtomicAdd + VkBool32 shaderImageFloat32Atomics + VkBool32 shaderImageFloat32AtomicAdd + VkBool32 sparseImageFloat32Atomics + VkBool32 sparseImageFloat32AtomicAdd + + + VkStructureType sType + void* pNext + VkBool32 shaderBufferFloat16Atomics + VkBool32 shaderBufferFloat16AtomicAdd + VkBool32 shaderBufferFloat16AtomicMinMax + VkBool32 shaderBufferFloat32AtomicMinMax + VkBool32 shaderBufferFloat64AtomicMinMax + VkBool32 shaderSharedFloat16Atomics + VkBool32 shaderSharedFloat16AtomicAdd + VkBool32 shaderSharedFloat16AtomicMinMax + VkBool32 shaderSharedFloat32AtomicMinMax + VkBool32 shaderSharedFloat64AtomicMinMax + VkBool32 shaderImageFloat32AtomicMinMax + VkBool32 sparseImageFloat32AtomicMinMax + + + VkStructureType sType + void* pNext + VkBool32 vertexAttributeInstanceRateDivisor + VkBool32 vertexAttributeInstanceRateZeroDivisor + + + + + VkStructureType sType + void* pNext + VkPipelineStageFlags checkpointExecutionStageMask + + + VkStructureType sType + void* pNext + VkPipelineStageFlagBits stage + void* pCheckpointMarker + + + VkStructureType sType + void* pNext + VkResolveModeFlags supportedDepthResolveModessupported depth resolve modes + VkResolveModeFlags supportedStencilResolveModessupported stencil resolve modes + VkBool32 independentResolveNonedepth and stencil resolve modes can be set independently if one of them is none + VkBool32 independentResolvedepth and stencil resolve modes can be set independently + + + + VkStructureType sType + const void* pNext + VkResolveModeFlagBits depthResolveModedepth resolve mode + VkResolveModeFlagBits stencilResolveModestencil resolve mode + const VkAttachmentReference2* pDepthStencilResolveAttachmentdepth/stencil resolve attachment + + + + VkStructureType sType + const void* pNext + VkFormat decodeMode + + + VkStructureType sType + void* pNext + VkBool32 decodeModeSharedExponent + + + VkStructureType sType + void* pNext + VkBool32 transformFeedback + VkBool32 geometryStreams + + + VkStructureType sType + void* pNext + uint32_t maxTransformFeedbackStreams + uint32_t maxTransformFeedbackBuffers + VkDeviceSize maxTransformFeedbackBufferSize + uint32_t maxTransformFeedbackStreamDataSize + uint32_t maxTransformFeedbackBufferDataSize + uint32_t maxTransformFeedbackBufferDataStride + VkBool32 transformFeedbackQueries + VkBool32 transformFeedbackStreamsLinesTriangles + VkBool32 transformFeedbackRasterizationStreamSelect + VkBool32 transformFeedbackDraw + + + VkStructureType sType + const void* pNext + VkPipelineRasterizationStateStreamCreateFlagsEXT flags + uint32_t rasterizationStream + + + VkStructureType sType + void* pNext + VkBool32 representativeFragmentTest + + + VkStructureType sType + const void* pNext + VkBool32 representativeFragmentTestEnable + + + VkStructureType sType + void* pNext + VkBool32 exclusiveScissor + + + VkStructureType sType + const void* pNext + uint32_t exclusiveScissorCount + const VkRect2D* pExclusiveScissors + + + VkStructureType sType + void* pNext + VkBool32 cornerSampledImage + + + VkStructureType sType + void* pNext + VkBool32 computeDerivativeGroupQuads + VkBool32 computeDerivativeGroupLinear + + + + VkStructureType sType + void* pNext + VkBool32 meshAndTaskShaderDerivatives + + + + VkStructureType sType + void* pNext + VkBool32 imageFootprint + + + VkStructureType sType + void* pNext + VkBool32 dedicatedAllocationImageAliasing + + + VkStructureType sType + void* pNext + VkBool32 indirectCopy + + + VkStructureType sType + void* pNext + VkQueueFlags supportedQueuesBitfield of which queues are supported for indirect copy + + + VkStructureType sType + void* pNext + VkBool32 memoryDecompression + + + VkStructureType sType + void* pNext + VkMemoryDecompressionMethodFlagsNV decompressionMethods + uint64_t maxDecompressionIndirectCount + + + uint32_t shadingRatePaletteEntryCount + const VkShadingRatePaletteEntryNV* pShadingRatePaletteEntries + + + VkStructureType sType + const void* pNext + VkBool32 shadingRateImageEnable + uint32_t viewportCount + const VkShadingRatePaletteNV* pShadingRatePalettes + + + VkStructureType sType + void* pNext + VkBool32 shadingRateImage + VkBool32 shadingRateCoarseSampleOrder + + + VkStructureType sType + void* pNext + VkExtent2D shadingRateTexelSize + uint32_t shadingRatePaletteSize + uint32_t shadingRateMaxCoarseSamples + + + VkStructureType sType + void* pNext + VkBool32 invocationMask + + + uint32_t pixelX + uint32_t pixelY + uint32_t sample + + + VkShadingRatePaletteEntryNV shadingRate + uint32_t sampleCount + uint32_t sampleLocationCount + const VkCoarseSampleLocationNV* pSampleLocations + + + VkStructureType sType + const void* pNext + VkCoarseSampleOrderTypeNV sampleOrderType + uint32_t customSampleOrderCount + const VkCoarseSampleOrderCustomNV* pCustomSampleOrders + + + VkStructureType sType + void* pNext + VkBool32 taskShader + VkBool32 meshShader + + + VkStructureType sType + void* pNext + uint32_t maxDrawMeshTasksCount + uint32_t maxTaskWorkGroupInvocations + uint32_t maxTaskWorkGroupSize[3] + uint32_t maxTaskTotalMemorySize + uint32_t maxTaskOutputCount + uint32_t maxMeshWorkGroupInvocations + uint32_t maxMeshWorkGroupSize[3] + uint32_t maxMeshTotalMemorySize + uint32_t maxMeshOutputVertices + uint32_t maxMeshOutputPrimitives + uint32_t maxMeshMultiviewViewCount + uint32_t meshOutputPerVertexGranularity + uint32_t meshOutputPerPrimitiveGranularity + + + uint32_t taskCount + uint32_t firstTask + + + VkStructureType sType + void* pNext + VkBool32 taskShader + VkBool32 meshShader + VkBool32 multiviewMeshShader + VkBool32 primitiveFragmentShadingRateMeshShader + VkBool32 meshShaderQueries + + + VkStructureType sType + void* pNext + uint32_t maxTaskWorkGroupTotalCount + uint32_t maxTaskWorkGroupCount[3] + uint32_t maxTaskWorkGroupInvocations + uint32_t maxTaskWorkGroupSize[3] + uint32_t maxTaskPayloadSize + uint32_t maxTaskSharedMemorySize + uint32_t maxTaskPayloadAndSharedMemorySize + uint32_t maxMeshWorkGroupTotalCount + uint32_t maxMeshWorkGroupCount[3] + uint32_t maxMeshWorkGroupInvocations + uint32_t maxMeshWorkGroupSize[3] + uint32_t maxMeshSharedMemorySize + uint32_t maxMeshPayloadAndSharedMemorySize + uint32_t maxMeshOutputMemorySize + uint32_t maxMeshPayloadAndOutputMemorySize + uint32_t maxMeshOutputComponents + uint32_t maxMeshOutputVertices + uint32_t maxMeshOutputPrimitives + uint32_t maxMeshOutputLayers + uint32_t maxMeshMultiviewViewCount + uint32_t meshOutputPerVertexGranularity + uint32_t meshOutputPerPrimitiveGranularity + uint32_t maxPreferredTaskWorkGroupInvocations + uint32_t maxPreferredMeshWorkGroupInvocations + VkBool32 prefersLocalInvocationVertexOutput + VkBool32 prefersLocalInvocationPrimitiveOutput + VkBool32 prefersCompactVertexOutput + VkBool32 prefersCompactPrimitiveOutput + + + uint32_t groupCountX + uint32_t groupCountY + uint32_t groupCountZ + + + VkStructureType sType + const void* pNext + VkRayTracingShaderGroupTypeKHR type + uint32_t generalShader + uint32_t closestHitShader + uint32_t anyHitShader + uint32_t intersectionShader + + + VkStructureType sType + const void* pNext + VkRayTracingShaderGroupTypeKHR type + uint32_t generalShader + uint32_t closestHitShader + uint32_t anyHitShader + uint32_t intersectionShader + const void* pShaderGroupCaptureReplayHandle + + + VkStructureType sType + const void* pNext + VkPipelineCreateFlags flagsPipeline creation flags + uint32_t stageCount + const VkPipelineShaderStageCreateInfo* pStagesOne entry for each active shader stage + uint32_t groupCount + const VkRayTracingShaderGroupCreateInfoNV* pGroups + uint32_t maxRecursionDepth + VkPipelineLayout layoutInterface layout of the pipeline + VkPipeline basePipelineHandleIf VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of + int32_t basePipelineIndexIf VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of + + + VkStructureType sType + const void* pNext + VkPipelineCreateFlags flagsPipeline creation flags + uint32_t stageCount + const VkPipelineShaderStageCreateInfo* pStagesOne entry for each active shader stage + uint32_t groupCount + const VkRayTracingShaderGroupCreateInfoKHR* pGroups + uint32_t maxPipelineRayRecursionDepth + const VkPipelineLibraryCreateInfoKHR* pLibraryInfo + const VkRayTracingPipelineInterfaceCreateInfoKHR* pLibraryInterface + const VkPipelineDynamicStateCreateInfo* pDynamicState + VkPipelineLayout layoutInterface layout of the pipeline + VkPipeline basePipelineHandleIf VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of + int32_t basePipelineIndexIf VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of + + + VkStructureType sType + const void* pNext + VkBuffer vertexData + VkDeviceSize vertexOffset + uint32_t vertexCount + VkDeviceSize vertexStride + VkFormat vertexFormat + VkBuffer indexData + VkDeviceSize indexOffset + uint32_t indexCount + VkIndexType indexType + VkBuffer transformDataOptional reference to array of floats representing a 3x4 row major affine transformation matrix. + VkDeviceSize transformOffset + + + VkStructureType sType + const void* pNext + VkBuffer aabbData + uint32_t numAABBs + uint32_t strideStride in bytes between AABBs + VkDeviceSize offsetOffset in bytes of the first AABB in aabbData + + + VkGeometryTrianglesNV triangles + VkGeometryAABBNV aabbs + + + VkStructureType sType + const void* pNext + VkGeometryTypeKHR geometryType + VkGeometryDataNV geometry + VkGeometryFlagsKHR flags + + + VkStructureType sType + const void* pNext + VkAccelerationStructureTypeNV type + VkBuildAccelerationStructureFlagsNV flags + uint32_t instanceCount + uint32_t geometryCount + const VkGeometryNV* pGeometries + + + VkStructureType sType + const void* pNext + VkDeviceSize compactedSize + VkAccelerationStructureInfoNV info + + + VkStructureType sType + const void* pNext + VkAccelerationStructureNV accelerationStructure + VkDeviceMemory memory + VkDeviceSize memoryOffset + uint32_t deviceIndexCount + const uint32_t* pDeviceIndices + + + VkStructureType sType + const void* pNext + uint32_t accelerationStructureCount + const VkAccelerationStructureKHR* pAccelerationStructures + + + VkStructureType sType + const void* pNext + uint32_t accelerationStructureCount + const VkAccelerationStructureNV* pAccelerationStructures + + + VkStructureType sType + const void* pNext + VkAccelerationStructureMemoryRequirementsTypeNV type + VkAccelerationStructureNV accelerationStructure + + + VkStructureType sType + void* pNext + VkBool32 accelerationStructure + VkBool32 accelerationStructureCaptureReplay + VkBool32 accelerationStructureIndirectBuild + VkBool32 accelerationStructureHostCommands + VkBool32 descriptorBindingAccelerationStructureUpdateAfterBind + + + VkStructureType sType + void* pNext + VkBool32 rayTracingPipeline + VkBool32 rayTracingPipelineShaderGroupHandleCaptureReplay + VkBool32 rayTracingPipelineShaderGroupHandleCaptureReplayMixed + VkBool32 rayTracingPipelineTraceRaysIndirect + VkBool32 rayTraversalPrimitiveCulling + + + VkStructureType sType + void* pNext + VkBool32 rayQuery + + + VkStructureType sType + void* pNext + uint64_t maxGeometryCount + uint64_t maxInstanceCount + uint64_t maxPrimitiveCount + uint32_t maxPerStageDescriptorAccelerationStructures + uint32_t maxPerStageDescriptorUpdateAfterBindAccelerationStructures + uint32_t maxDescriptorSetAccelerationStructures + uint32_t maxDescriptorSetUpdateAfterBindAccelerationStructures + uint32_t minAccelerationStructureScratchOffsetAlignment + + + VkStructureType sType + void* pNext + uint32_t shaderGroupHandleSize + uint32_t maxRayRecursionDepth + uint32_t maxShaderGroupStride + uint32_t shaderGroupBaseAlignment + uint32_t shaderGroupHandleCaptureReplaySize + uint32_t maxRayDispatchInvocationCount + uint32_t shaderGroupHandleAlignment + uint32_t maxRayHitAttributeSize + + + VkStructureType sType + void* pNext + uint32_t shaderGroupHandleSize + uint32_t maxRecursionDepth + uint32_t maxShaderGroupStride + uint32_t shaderGroupBaseAlignment + uint64_t maxGeometryCount + uint64_t maxInstanceCount + uint64_t maxTriangleCount + uint32_t maxDescriptorSetAccelerationStructures + + + VkDeviceAddress deviceAddress + VkDeviceSize stride + VkDeviceSize size + + + uint32_t width + uint32_t height + uint32_t depth + + + VkDeviceAddress raygenShaderRecordAddress + VkDeviceSize raygenShaderRecordSize + VkDeviceAddress missShaderBindingTableAddress + VkDeviceSize missShaderBindingTableSize + VkDeviceSize missShaderBindingTableStride + VkDeviceAddress hitShaderBindingTableAddress + VkDeviceSize hitShaderBindingTableSize + VkDeviceSize hitShaderBindingTableStride + VkDeviceAddress callableShaderBindingTableAddress + VkDeviceSize callableShaderBindingTableSize + VkDeviceSize callableShaderBindingTableStride + uint32_t width + uint32_t height + uint32_t depth + + + VkStructureType sType + void* pNext + VkBool32 rayTracingMaintenance1 + VkBool32 rayTracingPipelineTraceRaysIndirect2 + + + VkStructureType sType + void* pNext + uint32_t drmFormatModifierCount + VkDrmFormatModifierPropertiesEXT* pDrmFormatModifierProperties + + + uint64_t drmFormatModifier + uint32_t drmFormatModifierPlaneCount + VkFormatFeatureFlags drmFormatModifierTilingFeatures + + + VkStructureType sType + const void* pNext + uint64_t drmFormatModifier + VkSharingMode sharingMode + uint32_t queueFamilyIndexCount + const uint32_t* pQueueFamilyIndices + + + VkStructureType sType + const void* pNext + uint32_t drmFormatModifierCount + const uint64_t* pDrmFormatModifiers + + + VkStructureType sType + const void* pNext + uint64_t drmFormatModifier + uint32_t drmFormatModifierPlaneCount + const VkSubresourceLayout* pPlaneLayouts + + + VkStructureType sType + void* pNext + uint64_t drmFormatModifier + + + VkStructureType sType + const void* pNext + VkImageUsageFlags stencilUsage + + + + VkStructureType sType + const void* pNext + VkMemoryOverallocationBehaviorAMD overallocationBehavior + + + VkStructureType sType + void* pNext + VkBool32 fragmentDensityMap + VkBool32 fragmentDensityMapDynamic + VkBool32 fragmentDensityMapNonSubsampledImages + + + VkStructureType sType + void* pNext + VkBool32 fragmentDensityMapDeferred + + + VkStructureType sType + void* pNext + VkBool32 fragmentDensityMapOffset + + + VkStructureType sType + void* pNext + VkExtent2D minFragmentDensityTexelSize + VkExtent2D maxFragmentDensityTexelSize + VkBool32 fragmentDensityInvocations + + + VkStructureType sType + void* pNext + VkBool32 subsampledLoads + VkBool32 subsampledCoarseReconstructionEarlyAccess + uint32_t maxSubsampledArrayLayers + uint32_t maxDescriptorSetSubsampledSamplers + + + VkStructureType sType + void* pNext + VkExtent2D fragmentDensityOffsetGranularity + + + VkStructureType sType + const void* pNext + VkAttachmentReference fragmentDensityMapAttachment + + + VkStructureType sType + const void* pNext + uint32_t fragmentDensityOffsetCount + const VkOffset2D* pFragmentDensityOffsets + + + VkStructureType sType + void* pNext + VkBool32 scalarBlockLayout + + + + VkStructureType sType + const void* pNext + VkBool32 supportsProtectedRepresents if surface can be protected + + + VkStructureType sType + void* pNext + VkBool32 uniformBufferStandardLayout + + + + VkStructureType sType + void* pNext + VkBool32 depthClipEnable + + + VkStructureType sType + const void* pNext + VkPipelineRasterizationDepthClipStateCreateFlagsEXT flagsReserved + VkBool32 depthClipEnable + + + VkStructureType sType + void* pNext + VkDeviceSize heapBudget[VK_MAX_MEMORY_HEAPS] + VkDeviceSize heapUsage[VK_MAX_MEMORY_HEAPS] + + + VkStructureType sType + void* pNext + VkBool32 memoryPriority + + + VkStructureType sType + const void* pNext + float priority + + + VkStructureType sType + void* pNext + VkBool32 pageableDeviceLocalMemory + + + VkStructureType sType + void* pNext + VkBool32 bufferDeviceAddress + VkBool32 bufferDeviceAddressCaptureReplay + VkBool32 bufferDeviceAddressMultiDevice + + + + VkStructureType sType + void* pNext + VkBool32 bufferDeviceAddress + VkBool32 bufferDeviceAddressCaptureReplay + VkBool32 bufferDeviceAddressMultiDevice + + + + VkStructureType sType + const void* pNext + VkBuffer buffer + + + + + VkStructureType sType + const void* pNext + uint64_t opaqueCaptureAddress + + + + VkStructureType sType + const void* pNext + VkDeviceAddress deviceAddress + + + VkStructureType sType + void* pNext + VkImageViewType imageViewType + + + VkStructureType sType + void* pNext + VkBool32 filterCubicThe combinations of format, image type (and image view type if provided) can be filtered with VK_FILTER_CUBIC_EXT + VkBool32 filterCubicMinmaxThe combination of format, image type (and image view type if provided) can be filtered with VK_FILTER_CUBIC_EXT and ReductionMode of Min or Max + + + VkStructureType sType + void* pNext + VkBool32 imagelessFramebuffer + + + + VkStructureType sType + const void* pNext + uint32_t attachmentImageInfoCount + const VkFramebufferAttachmentImageInfo* pAttachmentImageInfos + + + + VkStructureType sType + const void* pNext + VkImageCreateFlags flagsImage creation flags + VkImageUsageFlags usageImage usage flags + uint32_t width + uint32_t height + uint32_t layerCount + uint32_t viewFormatCount + const VkFormat* pViewFormats + + + + VkStructureType sType + const void* pNext + uint32_t attachmentCount + const VkImageView* pAttachments + + + + VkStructureType sType + void* pNext + VkBool32 textureCompressionASTC_HDR + + + + VkStructureType sType + void* pNext + VkBool32 cooperativeMatrix + VkBool32 cooperativeMatrixRobustBufferAccess + + + VkStructureType sType + void* pNext + VkShaderStageFlags cooperativeMatrixSupportedStages + + + VkStructureType sType + void* pNext + uint32_t MSize + uint32_t NSize + uint32_t KSize + VkComponentTypeNV AType + VkComponentTypeNV BType + VkComponentTypeNV CType + VkComponentTypeNV DType + VkScopeNV scope + + + VkStructureType sType + void* pNext + VkBool32 ycbcrImageArrays + + + VkStructureType sType + const void* pNext + VkImageView imageView + VkDescriptorType descriptorType + VkSampler sampler + + + VkStructureType sType + void* pNext + VkDeviceAddress deviceAddress + VkDeviceSize size + + + VkStructureType sType + const void* pNext + GgpFrameToken frameToken + + + VkPipelineCreationFeedbackFlags flags + uint64_t duration + + + + VkStructureType sType + const void* pNext + VkPipelineCreationFeedback* pPipelineCreationFeedbackOutput pipeline creation feedback. + uint32_t pipelineStageCreationFeedbackCount + VkPipelineCreationFeedback* pPipelineStageCreationFeedbacksOne entry for each shader stage specified in the parent Vk*PipelineCreateInfo struct + + + + VkStructureType sType + void* pNext + VkFullScreenExclusiveEXT fullScreenExclusive + + + VkStructureType sType + const void* pNext + HMONITOR hmonitor + + + VkStructureType sType + void* pNext + VkBool32 fullScreenExclusiveSupported + + + VkStructureType sType + void* pNext + VkBool32 presentBarrier + + + VkStructureType sType + void* pNext + VkBool32 presentBarrierSupported + + + VkStructureType sType + void* pNext + VkBool32 presentBarrierEnable + + + VkStructureType sType + void* pNext + VkBool32 performanceCounterQueryPoolsperformance counters supported in query pools + VkBool32 performanceCounterMultipleQueryPoolsperformance counters from multiple query pools can be accessed in the same primary command buffer + + + VkStructureType sType + void* pNext + VkBool32 allowCommandBufferQueryCopiesFlag to specify whether performance queries are allowed to be used in vkCmdCopyQueryPoolResults + + + VkStructureType sType + void* pNext + VkPerformanceCounterUnitKHR unit + VkPerformanceCounterScopeKHR scope + VkPerformanceCounterStorageKHR storage + uint8_t uuid[VK_UUID_SIZE] + + + VkStructureType sType + void* pNext + VkPerformanceCounterDescriptionFlagsKHR flags + char name[VK_MAX_DESCRIPTION_SIZE] + char category[VK_MAX_DESCRIPTION_SIZE] + char description[VK_MAX_DESCRIPTION_SIZE] + + + VkStructureType sType + const void* pNext + uint32_t queueFamilyIndex + uint32_t counterIndexCount + const uint32_t* pCounterIndices + + + int32_t int32 + int64_t int64 + uint32_t uint32 + uint64_t uint64 + float float32 + double float64 + + + VkStructureType sType + const void* pNext + VkAcquireProfilingLockFlagsKHR flagsAcquire profiling lock flags + uint64_t timeout + + + VkStructureType sType + const void* pNext + uint32_t counterPassIndexIndex for which counter pass to submit + + + VkStructureType sType + const void* pNext + uint32_t maxPerformanceQueriesPerPoolMaximum number of VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR queries in a query pool + + + VkStructureType sType + const void* pNext + VkHeadlessSurfaceCreateFlagsEXT flags + + + VkStructureType sType + void* pNext + VkBool32 coverageReductionMode + + + VkStructureType sType + const void* pNext + VkPipelineCoverageReductionStateCreateFlagsNV flags + VkCoverageReductionModeNV coverageReductionMode + + + VkStructureType sType + void* pNext + VkCoverageReductionModeNV coverageReductionMode + VkSampleCountFlagBits rasterizationSamples + VkSampleCountFlags depthStencilSamples + VkSampleCountFlags colorSamples + + + VkStructureType sType + void* pNext + VkBool32 shaderIntegerFunctions2 + + + uint32_t value32 + uint64_t value64 + float valueFloat + VkBool32 valueBool + const char* valueString + + + VkPerformanceValueTypeINTEL type + VkPerformanceValueDataINTEL data + + + VkStructureType sType + const void* pNext + void* pUserData + + + VkStructureType sType + const void* pNext + VkQueryPoolSamplingModeINTEL performanceCountersSampling + + + + VkStructureType sType + const void* pNext + uint64_t marker + + + VkStructureType sType + const void* pNext + uint32_t marker + + + VkStructureType sType + const void* pNext + VkPerformanceOverrideTypeINTEL type + VkBool32 enable + uint64_t parameter + + + VkStructureType sType + const void* pNext + VkPerformanceConfigurationTypeINTEL type + + + VkStructureType sType + void* pNext + VkBool32 shaderSubgroupClock + VkBool32 shaderDeviceClock + + + VkStructureType sType + void* pNext + VkBool32 indexTypeUint8 + + + + + VkStructureType sType + void* pNext + uint32_t shaderSMCount + uint32_t shaderWarpsPerSM + + + VkStructureType sType + void* pNext + VkBool32 shaderSMBuiltins + + + VkStructureType sType + void* pNextPointer to next structure + VkBool32 fragmentShaderSampleInterlock + VkBool32 fragmentShaderPixelInterlock + VkBool32 fragmentShaderShadingRateInterlock + + + VkStructureType sType + void* pNext + VkBool32 separateDepthStencilLayouts + + + + VkStructureType sType + void* pNext + VkImageLayout stencilLayout + + + VkStructureType sType + void* pNext + VkBool32 primitiveTopologyListRestart + VkBool32 primitiveTopologyPatchListRestart + + + + VkStructureType sType + void* pNext + VkImageLayout stencilInitialLayout + VkImageLayout stencilFinalLayout + + + + VkStructureType sType + void* pNext + VkBool32 pipelineExecutableInfo + + + VkStructureType sType + const void* pNext + VkPipeline pipeline + + + + VkStructureType sType + void* pNext + VkShaderStageFlags stages + char name[VK_MAX_DESCRIPTION_SIZE] + char description[VK_MAX_DESCRIPTION_SIZE] + uint32_t subgroupSize + + + VkStructureType sType + const void* pNext + VkPipeline pipeline + uint32_t executableIndex + + + VkBool32 b32 + int64_t i64 + uint64_t u64 + double f64 + + + VkStructureType sType + void* pNext + char name[VK_MAX_DESCRIPTION_SIZE] + char description[VK_MAX_DESCRIPTION_SIZE] + VkPipelineExecutableStatisticFormatKHR format + VkPipelineExecutableStatisticValueKHR value + + + VkStructureType sType + void* pNext + char name[VK_MAX_DESCRIPTION_SIZE] + char description[VK_MAX_DESCRIPTION_SIZE] + VkBool32 isText + size_t dataSize + void* pData + + + VkStructureType sType + void* pNext + VkBool32 shaderDemoteToHelperInvocation + + + + VkStructureType sType + void* pNext + VkBool32 texelBufferAlignment + + + VkStructureType sType + void* pNext + VkDeviceSize storageTexelBufferOffsetAlignmentBytes + VkBool32 storageTexelBufferOffsetSingleTexelAlignment + VkDeviceSize uniformTexelBufferOffsetAlignmentBytes + VkBool32 uniformTexelBufferOffsetSingleTexelAlignment + + + + VkStructureType sType + void* pNext + VkBool32 subgroupSizeControl + VkBool32 computeFullSubgroups + + + + VkStructureType sType + void* pNext + uint32_t minSubgroupSizeThe minimum subgroup size supported by this device + uint32_t maxSubgroupSizeThe maximum subgroup size supported by this device + uint32_t maxComputeWorkgroupSubgroupsThe maximum number of subgroups supported in a workgroup + VkShaderStageFlags requiredSubgroupSizeStagesThe shader stages that support specifying a subgroup size + + + + VkStructureType sType + void* pNext + uint32_t requiredSubgroupSize + + + + + VkStructureType sType + void* pNext + VkRenderPass renderPass + uint32_t subpass + + + VkStructureType sType + void* pNext + uint32_t maxSubpassShadingWorkgroupSizeAspectRatio + + + VkStructureType sType + void* pNext + uint32_t maxWorkGroupCount[3] + uint32_t maxWorkGroupSize[3] + uint32_t maxOutputClusterCount + VkDeviceSize indirectBufferOffsetAlignment + + + VkStructureType sType + const void* pNext + uint64_t opaqueCaptureAddress + + + + VkStructureType sType + const void* pNext + VkDeviceMemory memory + + + + VkStructureType sType + void* pNext + VkBool32 rectangularLines + VkBool32 bresenhamLines + VkBool32 smoothLines + VkBool32 stippledRectangularLines + VkBool32 stippledBresenhamLines + VkBool32 stippledSmoothLines + + + + + VkStructureType sType + void* pNext + uint32_t lineSubPixelPrecisionBits + + + + + VkStructureType sType + const void* pNext + VkLineRasterizationMode lineRasterizationMode + VkBool32 stippledLineEnable + uint32_t lineStippleFactor + uint16_t lineStipplePattern + + + + + VkStructureType sType + void* pNext + VkBool32 pipelineCreationCacheControl + + + + VkStructureType sType + void* pNext + VkBool32 storageBuffer16BitAccess16-bit integer/floating-point variables supported in BufferBlock + VkBool32 uniformAndStorageBuffer16BitAccess16-bit integer/floating-point variables supported in BufferBlock and Block + VkBool32 storagePushConstant1616-bit integer/floating-point variables supported in PushConstant + VkBool32 storageInputOutput1616-bit integer/floating-point variables supported in shader inputs and outputs + VkBool32 multiviewMultiple views in a render pass + VkBool32 multiviewGeometryShaderMultiple views in a render pass w/ geometry shader + VkBool32 multiviewTessellationShaderMultiple views in a render pass w/ tessellation shader + VkBool32 variablePointersStorageBuffer + VkBool32 variablePointers + VkBool32 protectedMemory + VkBool32 samplerYcbcrConversionSampler color conversion supported + VkBool32 shaderDrawParameters + + + VkStructureType sType + void* pNext + uint8_t deviceUUID[VK_UUID_SIZE] + uint8_t driverUUID[VK_UUID_SIZE] + uint8_t deviceLUID[VK_LUID_SIZE] + uint32_t deviceNodeMask + VkBool32 deviceLUIDValid + uint32_t subgroupSizeThe size of a subgroup for this queue. + VkShaderStageFlags subgroupSupportedStagesBitfield of what shader stages support subgroup operations + VkSubgroupFeatureFlags subgroupSupportedOperationsBitfield of what subgroup operations are supported. + VkBool32 subgroupQuadOperationsInAllStagesFlag to specify whether quad operations are available in all stages. + VkPointClippingBehavior pointClippingBehavior + uint32_t maxMultiviewViewCountmax number of views in a subpass + uint32_t maxMultiviewInstanceIndexmax instance index for a draw in a multiview subpass + VkBool32 protectedNoFault + uint32_t maxPerSetDescriptors + VkDeviceSize maxMemoryAllocationSize + + + VkStructureType sType + void* pNext + VkBool32 samplerMirrorClampToEdge + VkBool32 drawIndirectCount + VkBool32 storageBuffer8BitAccess8-bit integer variables supported in StorageBuffer + VkBool32 uniformAndStorageBuffer8BitAccess8-bit integer variables supported in StorageBuffer and Uniform + VkBool32 storagePushConstant88-bit integer variables supported in PushConstant + VkBool32 shaderBufferInt64Atomics + VkBool32 shaderSharedInt64Atomics + VkBool32 shaderFloat1616-bit floats (halfs) in shaders + VkBool32 shaderInt88-bit integers in shaders + VkBool32 descriptorIndexing + VkBool32 shaderInputAttachmentArrayDynamicIndexing + VkBool32 shaderUniformTexelBufferArrayDynamicIndexing + VkBool32 shaderStorageTexelBufferArrayDynamicIndexing + VkBool32 shaderUniformBufferArrayNonUniformIndexing + VkBool32 shaderSampledImageArrayNonUniformIndexing + VkBool32 shaderStorageBufferArrayNonUniformIndexing + VkBool32 shaderStorageImageArrayNonUniformIndexing + VkBool32 shaderInputAttachmentArrayNonUniformIndexing + VkBool32 shaderUniformTexelBufferArrayNonUniformIndexing + VkBool32 shaderStorageTexelBufferArrayNonUniformIndexing + VkBool32 descriptorBindingUniformBufferUpdateAfterBind + VkBool32 descriptorBindingSampledImageUpdateAfterBind + VkBool32 descriptorBindingStorageImageUpdateAfterBind + VkBool32 descriptorBindingStorageBufferUpdateAfterBind + VkBool32 descriptorBindingUniformTexelBufferUpdateAfterBind + VkBool32 descriptorBindingStorageTexelBufferUpdateAfterBind + VkBool32 descriptorBindingUpdateUnusedWhilePending + VkBool32 descriptorBindingPartiallyBound + VkBool32 descriptorBindingVariableDescriptorCount + VkBool32 runtimeDescriptorArray + VkBool32 samplerFilterMinmax + VkBool32 scalarBlockLayout + VkBool32 imagelessFramebuffer + VkBool32 uniformBufferStandardLayout + VkBool32 shaderSubgroupExtendedTypes + VkBool32 separateDepthStencilLayouts + VkBool32 hostQueryReset + VkBool32 timelineSemaphore + VkBool32 bufferDeviceAddress + VkBool32 bufferDeviceAddressCaptureReplay + VkBool32 bufferDeviceAddressMultiDevice + VkBool32 vulkanMemoryModel + VkBool32 vulkanMemoryModelDeviceScope + VkBool32 vulkanMemoryModelAvailabilityVisibilityChains + VkBool32 shaderOutputViewportIndex + VkBool32 shaderOutputLayer + VkBool32 subgroupBroadcastDynamicId + + + VkStructureType sType + void* pNext + VkDriverId driverID + char driverName[VK_MAX_DRIVER_NAME_SIZE] + char driverInfo[VK_MAX_DRIVER_INFO_SIZE] + VkConformanceVersion conformanceVersion + VkShaderFloatControlsIndependence denormBehaviorIndependence + VkShaderFloatControlsIndependence roundingModeIndependence + VkBool32 shaderSignedZeroInfNanPreserveFloat16An implementation can preserve signed zero, nan, inf + VkBool32 shaderSignedZeroInfNanPreserveFloat32An implementation can preserve signed zero, nan, inf + VkBool32 shaderSignedZeroInfNanPreserveFloat64An implementation can preserve signed zero, nan, inf + VkBool32 shaderDenormPreserveFloat16An implementation can preserve denormals + VkBool32 shaderDenormPreserveFloat32An implementation can preserve denormals + VkBool32 shaderDenormPreserveFloat64An implementation can preserve denormals + VkBool32 shaderDenormFlushToZeroFloat16An implementation can flush to zero denormals + VkBool32 shaderDenormFlushToZeroFloat32An implementation can flush to zero denormals + VkBool32 shaderDenormFlushToZeroFloat64An implementation can flush to zero denormals + VkBool32 shaderRoundingModeRTEFloat16An implementation can support RTE + VkBool32 shaderRoundingModeRTEFloat32An implementation can support RTE + VkBool32 shaderRoundingModeRTEFloat64An implementation can support RTE + VkBool32 shaderRoundingModeRTZFloat16An implementation can support RTZ + VkBool32 shaderRoundingModeRTZFloat32An implementation can support RTZ + VkBool32 shaderRoundingModeRTZFloat64An implementation can support RTZ + uint32_t maxUpdateAfterBindDescriptorsInAllPools + VkBool32 shaderUniformBufferArrayNonUniformIndexingNative + VkBool32 shaderSampledImageArrayNonUniformIndexingNative + VkBool32 shaderStorageBufferArrayNonUniformIndexingNative + VkBool32 shaderStorageImageArrayNonUniformIndexingNative + VkBool32 shaderInputAttachmentArrayNonUniformIndexingNative + VkBool32 robustBufferAccessUpdateAfterBind + VkBool32 quadDivergentImplicitLod + uint32_t maxPerStageDescriptorUpdateAfterBindSamplers + uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers + uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers + uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages + uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages + uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments + uint32_t maxPerStageUpdateAfterBindResources + uint32_t maxDescriptorSetUpdateAfterBindSamplers + uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers + uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic + uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers + uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic + uint32_t maxDescriptorSetUpdateAfterBindSampledImages + uint32_t maxDescriptorSetUpdateAfterBindStorageImages + uint32_t maxDescriptorSetUpdateAfterBindInputAttachments + VkResolveModeFlags supportedDepthResolveModessupported depth resolve modes + VkResolveModeFlags supportedStencilResolveModessupported stencil resolve modes + VkBool32 independentResolveNonedepth and stencil resolve modes can be set independently if one of them is none + VkBool32 independentResolvedepth and stencil resolve modes can be set independently + VkBool32 filterMinmaxSingleComponentFormats + VkBool32 filterMinmaxImageComponentMapping + uint64_t maxTimelineSemaphoreValueDifference + VkSampleCountFlags framebufferIntegerColorSampleCounts + + + VkStructureType sType + void* pNext + VkBool32 robustImageAccess + VkBool32 inlineUniformBlock + VkBool32 descriptorBindingInlineUniformBlockUpdateAfterBind + VkBool32 pipelineCreationCacheControl + VkBool32 privateData + VkBool32 shaderDemoteToHelperInvocation + VkBool32 shaderTerminateInvocation + VkBool32 subgroupSizeControl + VkBool32 computeFullSubgroups + VkBool32 synchronization2 + VkBool32 textureCompressionASTC_HDR + VkBool32 shaderZeroInitializeWorkgroupMemory + VkBool32 dynamicRendering + VkBool32 shaderIntegerDotProduct + VkBool32 maintenance4 + + + VkStructureType sType + void* pNext + uint32_t minSubgroupSizeThe minimum subgroup size supported by this device + uint32_t maxSubgroupSizeThe maximum subgroup size supported by this device + uint32_t maxComputeWorkgroupSubgroupsThe maximum number of subgroups supported in a workgroup + VkShaderStageFlags requiredSubgroupSizeStagesThe shader stages that support specifying a subgroup size + uint32_t maxInlineUniformBlockSize + uint32_t maxPerStageDescriptorInlineUniformBlocks + uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks + uint32_t maxDescriptorSetInlineUniformBlocks + uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks + uint32_t maxInlineUniformTotalSize + VkBool32 integerDotProduct8BitUnsignedAccelerated + VkBool32 integerDotProduct8BitSignedAccelerated + VkBool32 integerDotProduct8BitMixedSignednessAccelerated + VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated + VkBool32 integerDotProduct4x8BitPackedSignedAccelerated + VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated + VkBool32 integerDotProduct16BitUnsignedAccelerated + VkBool32 integerDotProduct16BitSignedAccelerated + VkBool32 integerDotProduct16BitMixedSignednessAccelerated + VkBool32 integerDotProduct32BitUnsignedAccelerated + VkBool32 integerDotProduct32BitSignedAccelerated + VkBool32 integerDotProduct32BitMixedSignednessAccelerated + VkBool32 integerDotProduct64BitUnsignedAccelerated + VkBool32 integerDotProduct64BitSignedAccelerated + VkBool32 integerDotProduct64BitMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated + VkDeviceSize storageTexelBufferOffsetAlignmentBytes + VkBool32 storageTexelBufferOffsetSingleTexelAlignment + VkDeviceSize uniformTexelBufferOffsetAlignmentBytes + VkBool32 uniformTexelBufferOffsetSingleTexelAlignment + VkDeviceSize maxBufferSize + + + VkStructureType sType + void* pNext + VkBool32 globalPriorityQuery + VkBool32 shaderSubgroupRotate + VkBool32 shaderSubgroupRotateClustered + VkBool32 shaderFloatControls2 + VkBool32 shaderExpectAssume + VkBool32 rectangularLines + VkBool32 bresenhamLines + VkBool32 smoothLines + VkBool32 stippledRectangularLines + VkBool32 stippledBresenhamLines + VkBool32 stippledSmoothLines + VkBool32 vertexAttributeInstanceRateDivisor + VkBool32 vertexAttributeInstanceRateZeroDivisor + VkBool32 indexTypeUint8 + VkBool32 dynamicRenderingLocalRead + VkBool32 maintenance5 + VkBool32 maintenance6 + VkBool32 pipelineProtectedAccess + VkBool32 pipelineRobustness + VkBool32 hostImageCopy + VkBool32 pushDescriptor + + + VkStructureType sType + void* pNext + uint32_t lineSubPixelPrecisionBits + uint32_t maxVertexAttribDivisormax value of vertex attribute divisor + VkBool32 supportsNonZeroFirstInstance + uint32_t maxPushDescriptors + VkBool32 dynamicRenderingLocalReadDepthStencilAttachments + VkBool32 dynamicRenderingLocalReadMultisampledAttachments + VkBool32 earlyFragmentMultisampleCoverageAfterSampleCounting + VkBool32 earlyFragmentSampleMaskTestBeforeSampleCounting + VkBool32 depthStencilSwizzleOneSupport + VkBool32 polygonModePointSize + VkBool32 nonStrictSinglePixelWideLinesUseParallelogram + VkBool32 nonStrictWideLinesUseParallelogram + VkBool32 blockTexelViewCompatibleMultipleLayers + uint32_t maxCombinedImageSamplerDescriptorCount + VkBool32 fragmentShadingRateClampCombinerInputs + VkPipelineRobustnessBufferBehavior defaultRobustnessStorageBuffers + VkPipelineRobustnessBufferBehavior defaultRobustnessUniformBuffers + VkPipelineRobustnessBufferBehavior defaultRobustnessVertexInputs + VkPipelineRobustnessImageBehavior defaultRobustnessImages + uint32_t copySrcLayoutCount + VkImageLayout* pCopySrcLayouts + uint32_t copyDstLayoutCount + VkImageLayout* pCopyDstLayouts + uint8_t optimalTilingLayoutUUID[VK_UUID_SIZE] + VkBool32 identicalMemoryTypeRequirements + + + VkStructureType sType + const void* pNext + VkPipelineCompilerControlFlagsAMD compilerControlFlags + + + VkStructureType sType + void* pNext + VkBool32 deviceCoherentMemory + + + VkStructureType sType + void* pNext + VkFaultLevel faultLevel + VkFaultType faultType + + + VkStructureType sType + const void* pNext + uint32_t faultCount + VkFaultData*pFaults + PFN_vkFaultCallbackFunction pfnFaultCallback + + + VkStructureType sType + void* pNext + char name[VK_MAX_EXTENSION_NAME_SIZE] + char version[VK_MAX_EXTENSION_NAME_SIZE] + VkToolPurposeFlags purposes + char description[VK_MAX_DESCRIPTION_SIZE] + char layer[VK_MAX_EXTENSION_NAME_SIZE] + + + + VkStructureType sType + const void* pNext + VkClearColorValue customBorderColor + VkFormat format + + + VkStructureType sType + void* pNext + uint32_t maxCustomBorderColorSamplers + + + VkStructureType sType + void* pNext + VkBool32 customBorderColors + VkBool32 customBorderColorWithoutFormat + + + VkStructureType sType + const void* pNext + VkComponentMapping components + VkBool32 srgb + + + VkStructureType sType + void* pNext + VkBool32 borderColorSwizzle + VkBool32 borderColorSwizzleFromImage + + + VkDeviceAddress deviceAddress + void* hostAddress + + + VkDeviceAddress deviceAddress + const void* hostAddress + + + VkDeviceAddress deviceAddress + const void* hostAddress + + + VkStructureType sType + const void* pNext + VkFormat vertexFormat + VkDeviceOrHostAddressConstKHR vertexData + VkDeviceSize vertexStride + uint32_t maxVertex + VkIndexType indexType + VkDeviceOrHostAddressConstKHR indexData + VkDeviceOrHostAddressConstKHR transformData + + + VkStructureType sType + const void* pNext + VkDeviceOrHostAddressConstKHR data + VkDeviceSize stride + + + VkStructureType sType + const void* pNext + VkBool32 arrayOfPointers + VkDeviceOrHostAddressConstKHR data + + + VkAccelerationStructureGeometryTrianglesDataKHR triangles + VkAccelerationStructureGeometryAabbsDataKHR aabbs + VkAccelerationStructureGeometryInstancesDataKHR instances + + + VkStructureType sType + const void* pNext + VkGeometryTypeKHR geometryType + VkAccelerationStructureGeometryDataKHR geometry + VkGeometryFlagsKHR flags + + + VkStructureType sType + const void* pNext + VkAccelerationStructureTypeKHR type + VkBuildAccelerationStructureFlagsKHR flags + VkBuildAccelerationStructureModeKHR mode + VkAccelerationStructureKHR srcAccelerationStructure + VkAccelerationStructureKHR dstAccelerationStructure + uint32_t geometryCount + const VkAccelerationStructureGeometryKHR* pGeometries + const VkAccelerationStructureGeometryKHR* const* ppGeometries + VkDeviceOrHostAddressKHR scratchData + + + uint32_t primitiveCount + uint32_t primitiveOffset + uint32_t firstVertex + uint32_t transformOffset + + + VkStructureType sType + const void* pNext + VkAccelerationStructureCreateFlagsKHR createFlags + VkBuffer buffer + VkDeviceSize offsetSpecified in bytes + VkDeviceSize size + VkAccelerationStructureTypeKHR type + VkDeviceAddress deviceAddress + + + float minX + float minY + float minZ + float maxX + float maxY + float maxZ + + + + float matrix[3][4] + + + + The bitfields in this structure are non-normative since bitfield ordering is implementation-defined in C. The specification defines the normative layout. + VkTransformMatrixKHR transform + uint32_t instanceCustomIndex:24 + uint32_t mask:8 + uint32_t instanceShaderBindingTableRecordOffset:24 + VkGeometryInstanceFlagsKHR flags:8 + uint64_t accelerationStructureReference + + + + VkStructureType sType + const void* pNext + VkAccelerationStructureKHR accelerationStructure + + + VkStructureType sType + const void* pNext + const uint8_t* pVersionData + + + VkStructureType sType + const void* pNext + VkAccelerationStructureKHR src + VkAccelerationStructureKHR dst + VkCopyAccelerationStructureModeKHR mode + + + VkStructureType sType + const void* pNext + VkAccelerationStructureKHR src + VkDeviceOrHostAddressKHR dst + VkCopyAccelerationStructureModeKHR mode + + + VkStructureType sType + const void* pNext + VkDeviceOrHostAddressConstKHR src + VkAccelerationStructureKHR dst + VkCopyAccelerationStructureModeKHR mode + + + VkStructureType sType + const void* pNext + uint32_t maxPipelineRayPayloadSize + uint32_t maxPipelineRayHitAttributeSize + + + VkStructureType sType + const void* pNext + uint32_t libraryCount + const VkPipeline* pLibraries + + + VkObjectType objectType + uint64_t objectHandle + VkRefreshObjectFlagsKHR flags + + + VkStructureType sType + const void* pNext + uint32_t objectCount + const VkRefreshObjectKHR* pObjects + + + VkStructureType sType + void* pNext + VkBool32 extendedDynamicState + + + VkStructureType sType + void* pNext + VkBool32 extendedDynamicState2 + VkBool32 extendedDynamicState2LogicOp + VkBool32 extendedDynamicState2PatchControlPoints + + + VkStructureType sType + void* pNext + VkBool32 extendedDynamicState3TessellationDomainOrigin + VkBool32 extendedDynamicState3DepthClampEnable + VkBool32 extendedDynamicState3PolygonMode + VkBool32 extendedDynamicState3RasterizationSamples + VkBool32 extendedDynamicState3SampleMask + VkBool32 extendedDynamicState3AlphaToCoverageEnable + VkBool32 extendedDynamicState3AlphaToOneEnable + VkBool32 extendedDynamicState3LogicOpEnable + VkBool32 extendedDynamicState3ColorBlendEnable + VkBool32 extendedDynamicState3ColorBlendEquation + VkBool32 extendedDynamicState3ColorWriteMask + VkBool32 extendedDynamicState3RasterizationStream + VkBool32 extendedDynamicState3ConservativeRasterizationMode + VkBool32 extendedDynamicState3ExtraPrimitiveOverestimationSize + VkBool32 extendedDynamicState3DepthClipEnable + VkBool32 extendedDynamicState3SampleLocationsEnable + VkBool32 extendedDynamicState3ColorBlendAdvanced + VkBool32 extendedDynamicState3ProvokingVertexMode + VkBool32 extendedDynamicState3LineRasterizationMode + VkBool32 extendedDynamicState3LineStippleEnable + VkBool32 extendedDynamicState3DepthClipNegativeOneToOne + VkBool32 extendedDynamicState3ViewportWScalingEnable + VkBool32 extendedDynamicState3ViewportSwizzle + VkBool32 extendedDynamicState3CoverageToColorEnable + VkBool32 extendedDynamicState3CoverageToColorLocation + VkBool32 extendedDynamicState3CoverageModulationMode + VkBool32 extendedDynamicState3CoverageModulationTableEnable + VkBool32 extendedDynamicState3CoverageModulationTable + VkBool32 extendedDynamicState3CoverageReductionMode + VkBool32 extendedDynamicState3RepresentativeFragmentTestEnable + VkBool32 extendedDynamicState3ShadingRateImageEnable + + + VkStructureType sType + void* pNext + VkBool32 dynamicPrimitiveTopologyUnrestricted + + + VkBlendFactor srcColorBlendFactor + VkBlendFactor dstColorBlendFactor + VkBlendOp colorBlendOp + VkBlendFactor srcAlphaBlendFactor + VkBlendFactor dstAlphaBlendFactor + VkBlendOp alphaBlendOp + + + VkBlendOp advancedBlendOp + VkBool32 srcPremultiplied + VkBool32 dstPremultiplied + VkBlendOverlapEXT blendOverlap + VkBool32 clampResults + + + VkStructureType sType + void* pNextPointer to next structure + VkSurfaceTransformFlagBitsKHR transform + + + VkStructureType sType + const void* pNext + VkSurfaceTransformFlagBitsKHR transform + + + VkStructureType sType + void* pNextPointer to next structure + VkSurfaceTransformFlagBitsKHR transform + VkRect2D renderArea + + + VkStructureType sType + void* pNext + VkBool32 diagnosticsConfig + + + VkStructureType sType + const void* pNext + VkDeviceDiagnosticsConfigFlagsNV flags + + + VkStructureType sType + const void* pNext + uint8_t pipelineIdentifier[VK_UUID_SIZE] + VkPipelineMatchControl matchControl + VkDeviceSize poolEntrySize + + + VkStructureType sType + void* pNext + VkBool32 shaderZeroInitializeWorkgroupMemory + + + + VkStructureType sType + void* pNext + VkBool32 shaderSubgroupUniformControlFlow + + + VkStructureType sType + void* pNext + VkBool32 robustBufferAccess2 + VkBool32 robustImageAccess2 + VkBool32 nullDescriptor + + + VkStructureType sType + void* pNext + VkDeviceSize robustStorageBufferAccessSizeAlignment + VkDeviceSize robustUniformBufferAccessSizeAlignment + + + VkStructureType sType + void* pNext + VkBool32 robustImageAccess + + + + VkStructureType sType + void* pNext + VkBool32 workgroupMemoryExplicitLayout + VkBool32 workgroupMemoryExplicitLayoutScalarBlockLayout + VkBool32 workgroupMemoryExplicitLayout8BitAccess + VkBool32 workgroupMemoryExplicitLayout16BitAccess + + + VkStructureType sType + void* pNext + VkBool32 constantAlphaColorBlendFactors + VkBool32 events + VkBool32 imageViewFormatReinterpretation + VkBool32 imageViewFormatSwizzle + VkBool32 imageView2DOn3DImage + VkBool32 multisampleArrayImage + VkBool32 mutableComparisonSamplers + VkBool32 pointPolygons + VkBool32 samplerMipLodBias + VkBool32 separateStencilMaskRef + VkBool32 shaderSampleRateInterpolationFunctions + VkBool32 tessellationIsolines + VkBool32 tessellationPointMode + VkBool32 triangleFans + VkBool32 vertexAttributeAccessBeyondStride + + + VkStructureType sType + void* pNext + uint32_t minVertexInputBindingStrideAlignment + + + VkStructureType sType + void* pNext + VkBool32 formatA4R4G4B4 + VkBool32 formatA4B4G4R4 + + + VkStructureType sType + void* pNext + VkBool32 subpassShading + + + VkStructureType sType + void*pNext + VkBool32 clustercullingShader + VkBool32 multiviewClusterCullingShader + + + VkStructureType sType + void*pNext + VkBool32 clusterShadingRate + + + VkStructureType sType + const void* pNext + VkDeviceSize srcOffsetSpecified in bytes + VkDeviceSize dstOffsetSpecified in bytes + VkDeviceSize sizeSpecified in bytes + + + + VkStructureType sType + const void* pNext + VkImageSubresourceLayers srcSubresource + VkOffset3D srcOffsetSpecified in pixels for both compressed and uncompressed images + VkImageSubresourceLayers dstSubresource + VkOffset3D dstOffsetSpecified in pixels for both compressed and uncompressed images + VkExtent3D extentSpecified in pixels for both compressed and uncompressed images + + + + VkStructureType sType + const void* pNext + VkImageSubresourceLayers srcSubresource + VkOffset3D srcOffsets[2]Specified in pixels for both compressed and uncompressed images + VkImageSubresourceLayers dstSubresource + VkOffset3D dstOffsets[2]Specified in pixels for both compressed and uncompressed images + + + + VkStructureType sType + const void* pNext + VkDeviceSize bufferOffsetSpecified in bytes + uint32_t bufferRowLengthSpecified in texels + uint32_t bufferImageHeight + VkImageSubresourceLayers imageSubresource + VkOffset3D imageOffsetSpecified in pixels for both compressed and uncompressed images + VkExtent3D imageExtentSpecified in pixels for both compressed and uncompressed images + + + + VkStructureType sType + const void* pNext + VkImageSubresourceLayers srcSubresource + VkOffset3D srcOffset + VkImageSubresourceLayers dstSubresource + VkOffset3D dstOffset + VkExtent3D extent + + + + VkStructureType sType + const void* pNext + VkBuffer srcBuffer + VkBuffer dstBuffer + uint32_t regionCount + const VkBufferCopy2* pRegions + + + + VkStructureType sType + const void* pNext + VkImage srcImage + VkImageLayout srcImageLayout + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkImageCopy2* pRegions + + + + VkStructureType sType + const void* pNext + VkImage srcImage + VkImageLayout srcImageLayout + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkImageBlit2* pRegions + VkFilter filter + + + + VkStructureType sType + const void* pNext + VkBuffer srcBuffer + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkBufferImageCopy2* pRegions + + + + VkStructureType sType + const void* pNext + VkImage srcImage + VkImageLayout srcImageLayout + VkBuffer dstBuffer + uint32_t regionCount + const VkBufferImageCopy2* pRegions + + + + VkStructureType sType + const void* pNext + VkImage srcImage + VkImageLayout srcImageLayout + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkImageResolve2* pRegions + + + + VkStructureType sType + void* pNext + VkBool32 shaderImageInt64Atomics + VkBool32 sparseImageInt64Atomics + + + VkStructureType sType + const void* pNext + const VkAttachmentReference2* pFragmentShadingRateAttachment + VkExtent2D shadingRateAttachmentTexelSize + + + VkStructureType sType + const void* pNext + VkExtent2D fragmentSize + VkFragmentShadingRateCombinerOpKHR combinerOps[2] + + + VkStructureType sType + void* pNext + VkBool32 pipelineFragmentShadingRate + VkBool32 primitiveFragmentShadingRate + VkBool32 attachmentFragmentShadingRate + + + VkStructureType sType + void* pNext + VkExtent2D minFragmentShadingRateAttachmentTexelSize + VkExtent2D maxFragmentShadingRateAttachmentTexelSize + uint32_t maxFragmentShadingRateAttachmentTexelSizeAspectRatio + VkBool32 primitiveFragmentShadingRateWithMultipleViewports + VkBool32 layeredShadingRateAttachments + VkBool32 fragmentShadingRateNonTrivialCombinerOps + VkExtent2D maxFragmentSize + uint32_t maxFragmentSizeAspectRatio + uint32_t maxFragmentShadingRateCoverageSamples + VkSampleCountFlagBits maxFragmentShadingRateRasterizationSamples + VkBool32 fragmentShadingRateWithShaderDepthStencilWrites + VkBool32 fragmentShadingRateWithSampleMask + VkBool32 fragmentShadingRateWithShaderSampleMask + VkBool32 fragmentShadingRateWithConservativeRasterization + VkBool32 fragmentShadingRateWithFragmentShaderInterlock + VkBool32 fragmentShadingRateWithCustomSampleLocations + VkBool32 fragmentShadingRateStrictMultiplyCombiner + + + VkStructureType sType + void* pNext + VkSampleCountFlags sampleCounts + VkExtent2D fragmentSize + + + VkStructureType sType + void* pNext + VkBool32 shaderTerminateInvocation + + + + VkStructureType sType + void* pNext + VkBool32 fragmentShadingRateEnums + VkBool32 supersampleFragmentShadingRates + VkBool32 noInvocationFragmentShadingRates + + + VkStructureType sType + void* pNext + VkSampleCountFlagBits maxFragmentShadingRateInvocationCount + + + VkStructureType sType + const void* pNext + VkFragmentShadingRateTypeNV shadingRateType + VkFragmentShadingRateNV shadingRate + VkFragmentShadingRateCombinerOpKHR combinerOps[2] + + + VkStructureType sType + const void* pNext + VkDeviceSize accelerationStructureSize + VkDeviceSize updateScratchSize + VkDeviceSize buildScratchSize + + + VkStructureType sType + void* pNext + VkBool32 image2DViewOf3D + VkBool32 sampler2DViewOf3D + + + VkStructureType sType + void* pNext + VkBool32 imageSlicedViewOf3D + + + VkStructureType sType + void* pNext + VkBool32 attachmentFeedbackLoopDynamicState + + + VkStructureType sType + void* pNext + VkBool32 legacyVertexAttributes + + + VkStructureType sType + void* pNext + VkBool32 nativeUnalignedPerformance + + + VkStructureType sType + void* pNext + VkBool32 mutableDescriptorType + + + + uint32_t descriptorTypeCount + const VkDescriptorType* pDescriptorTypes + + + + VkStructureType sType + const void* pNext + uint32_t mutableDescriptorTypeListCount + const VkMutableDescriptorTypeListEXT* pMutableDescriptorTypeLists + + + + VkStructureType sType + void* pNext + VkBool32 depthClipControl + + + VkStructureType sType + void* pNext + VkBool32 deviceGeneratedCommands + VkBool32 dynamicGeneratedPipelineLayout + + + VkStructureType sType + void* pNext + uint32_t maxIndirectPipelineCount + uint32_t maxIndirectShaderObjectCount + uint32_t maxIndirectSequenceCount + uint32_t maxIndirectCommandsTokenCount + uint32_t maxIndirectCommandsTokenOffset + uint32_t maxIndirectCommandsIndirectStride + VkIndirectCommandsInputModeFlagsEXT supportedIndirectCommandsInputModes + VkShaderStageFlags supportedIndirectCommandsShaderStages + VkShaderStageFlags supportedIndirectCommandsShaderStagesPipelineBinding + VkShaderStageFlags supportedIndirectCommandsShaderStagesShaderBinding + VkBool32 deviceGeneratedCommandsTransformFeedback + VkBool32 deviceGeneratedCommandsMultiDrawIndirectCount + + + VkStructureType sType + void* pNext + VkPipeline pipeline + + + VkStructureType sType + void* pNext + uint32_t shaderCount + const VkShaderEXT* pShaders + + + VkStructureType sType + const void* pNext + VkIndirectExecutionSetEXT indirectExecutionSet + VkIndirectCommandsLayoutEXT indirectCommandsLayout + uint32_t maxSequenceCount + uint32_t maxDrawCount + + + VkStructureType sType + const void* pNext + VkPipeline initialPipeline + uint32_t maxPipelineCount + + + VkStructureType sType + const void* pNext + uint32_t setLayoutCount + const VkDescriptorSetLayout* pSetLayouts + + + VkStructureType sType + const void* pNext + uint32_t shaderCount + const VkShaderEXT* pInitialShaders + const VkIndirectExecutionSetShaderLayoutInfoEXT* pSetLayoutInfos + uint32_t maxShaderCount + uint32_t pushConstantRangeCount + const VkPushConstantRange* pPushConstantRanges + + + const VkIndirectExecutionSetPipelineInfoEXT* pPipelineInfo + const VkIndirectExecutionSetShaderInfoEXT* pShaderInfo + + + VkStructureType sType + const void* pNext + VkIndirectExecutionSetInfoTypeEXT type + VkIndirectExecutionSetInfoEXT info + + + VkStructureType sType + const void* pNext + VkShaderStageFlags shaderStages + VkIndirectExecutionSetEXT indirectExecutionSet + VkIndirectCommandsLayoutEXT indirectCommandsLayout + VkDeviceAddress indirectAddress + VkDeviceSize indirectAddressSize + VkDeviceAddress preprocessAddress + VkDeviceSize preprocessSize + uint32_t maxSequenceCount + VkDeviceAddress sequenceCountAddress + uint32_t maxDrawCount + + + VkStructureType sType + const void* pNext + uint32_t index + VkPipeline pipeline + + + VkStructureType sType + const void* pNext + uint32_t index + VkShaderEXT shader + + + VkStructureType sType + const void* pNext + VkIndirectCommandsLayoutUsageFlagsEXT flags + VkShaderStageFlags shaderStages + uint32_t indirectStride + VkPipelineLayout pipelineLayout + uint32_t tokenCount + const VkIndirectCommandsLayoutTokenEXT* pTokens + + + VkStructureType sType + const void* pNext + VkIndirectCommandsTokenTypeEXT type + VkIndirectCommandsTokenDataEXT data + uint32_t offset + + + VkDeviceAddress bufferAddress + uint32_t stride + uint32_t commandCount + + + uint32_t vertexBindingUnit + + + VkDeviceAddress bufferAddress + uint32_t size + uint32_t stride + + + VkIndirectCommandsInputModeFlagBitsEXT mode + + + VkDeviceAddress bufferAddress + uint32_t size + VkIndexType indexType + + + VkPushConstantRange updateRange + + + VkIndirectExecutionSetInfoTypeEXT type + VkShaderStageFlags shaderStages + + + const VkIndirectCommandsPushConstantTokenEXT* pPushConstant + const VkIndirectCommandsVertexBufferTokenEXT* pVertexBuffer + const VkIndirectCommandsIndexBufferTokenEXT* pIndexBuffer + const VkIndirectCommandsExecutionSetTokenEXT* pExecutionSet + + + VkStructureType sType + const void* pNext + VkBool32 negativeOneToOne + + + VkStructureType sType + void* pNext + VkBool32 depthClampControl + + + VkStructureType sType + const void* pNext + VkDepthClampModeEXT depthClampMode + const VkDepthClampRangeEXT* pDepthClampRange + + + VkStructureType sType + void* pNext + VkBool32 vertexInputDynamicState + + + VkStructureType sType + void* pNext + VkBool32 externalMemoryRDMA + + + VkStructureType sType + void* pNext + VkBool32 shaderRelaxedExtendedInstruction + + + VkStructureType sType + void* pNext + uint32_t binding + uint32_t stride + VkVertexInputRate inputRate + uint32_t divisor + + + VkStructureType sType + void* pNext + uint32_t locationlocation of the shader vertex attrib + uint32_t bindingVertex buffer binding id + VkFormat formatformat of source data + uint32_t offsetOffset of first element in bytes from base of vertex + + + VkStructureType sType + void* pNext + VkBool32 colorWriteEnable + + + VkStructureType sType + const void* pNext + uint32_t attachmentCount# of pAttachments + const VkBool32* pColorWriteEnables + + + VkStructureType sType + const void* pNext + VkPipelineStageFlags2 srcStageMask + VkAccessFlags2 srcAccessMask + VkPipelineStageFlags2 dstStageMask + VkAccessFlags2 dstAccessMask + + + + VkStructureType sType + const void* pNext + VkPipelineStageFlags2 srcStageMask + VkAccessFlags2 srcAccessMask + VkPipelineStageFlags2 dstStageMask + VkAccessFlags2 dstAccessMask + VkImageLayout oldLayout + VkImageLayout newLayout + uint32_t srcQueueFamilyIndex + uint32_t dstQueueFamilyIndex + VkImage image + VkImageSubresourceRange subresourceRange + + + + VkStructureType sType + const void* pNext + VkPipelineStageFlags2 srcStageMask + VkAccessFlags2 srcAccessMask + VkPipelineStageFlags2 dstStageMask + VkAccessFlags2 dstAccessMask + uint32_t srcQueueFamilyIndex + uint32_t dstQueueFamilyIndex + VkBuffer buffer + VkDeviceSize offset + VkDeviceSize size + + + + VkStructureType sType + const void* pNext + VkDependencyFlags dependencyFlags + uint32_t memoryBarrierCount + const VkMemoryBarrier2* pMemoryBarriers + uint32_t bufferMemoryBarrierCount + const VkBufferMemoryBarrier2* pBufferMemoryBarriers + uint32_t imageMemoryBarrierCount + const VkImageMemoryBarrier2* pImageMemoryBarriers + + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + uint64_t value + VkPipelineStageFlags2 stageMask + uint32_t deviceIndex + + + + VkStructureType sType + const void* pNext + VkCommandBuffer commandBuffer + uint32_t deviceMask + + + + VkStructureType sType + const void* pNext + VkSubmitFlags flags + uint32_t waitSemaphoreInfoCount + const VkSemaphoreSubmitInfo* pWaitSemaphoreInfos + uint32_t commandBufferInfoCount + const VkCommandBufferSubmitInfo* pCommandBufferInfos + uint32_t signalSemaphoreInfoCount + const VkSemaphoreSubmitInfo* pSignalSemaphoreInfos + + + + VkStructureType sType + void* pNext + VkPipelineStageFlags2 checkpointExecutionStageMask + + + VkStructureType sType + void* pNext + VkPipelineStageFlags2 stage + void* pCheckpointMarker + + + VkStructureType sType + void* pNext + VkBool32 synchronization2 + + + + VkStructureType sType + void* pNext + VkBool32 hostImageCopy + + + + VkStructureType sType + void* pNext + uint32_t copySrcLayoutCount + VkImageLayout* pCopySrcLayouts + uint32_t copyDstLayoutCount + VkImageLayout* pCopyDstLayouts + uint8_t optimalTilingLayoutUUID[VK_UUID_SIZE] + VkBool32 identicalMemoryTypeRequirements + + + + VkStructureType sType + const void* pNext + const void* pHostPointer + uint32_t memoryRowLengthSpecified in texels + uint32_t memoryImageHeight + VkImageSubresourceLayers imageSubresource + VkOffset3D imageOffset + VkExtent3D imageExtent + + + + VkStructureType sType + const void* pNext + void* pHostPointer + uint32_t memoryRowLengthSpecified in texels + uint32_t memoryImageHeight + VkImageSubresourceLayers imageSubresource + VkOffset3D imageOffset + VkExtent3D imageExtent + + + + VkStructureType sType + const void* pNext + VkHostImageCopyFlags flags + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkMemoryToImageCopy* pRegions + + + + VkStructureType sType + const void* pNext + VkHostImageCopyFlags flags + VkImage srcImage + VkImageLayout srcImageLayout + uint32_t regionCount + const VkImageToMemoryCopy* pRegions + + + + VkStructureType sType + const void* pNext + VkHostImageCopyFlags flags + VkImage srcImage + VkImageLayout srcImageLayout + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkImageCopy2* pRegions + + + + VkStructureType sType + const void* pNext + VkImage image + VkImageLayout oldLayout + VkImageLayout newLayout + VkImageSubresourceRange subresourceRange + + + + VkStructureType sType + void* pNext + VkDeviceSize sizeSpecified in bytes + + + + VkStructureType sType + void* pNext + VkBool32 optimalDeviceAccessSpecifies if device access is optimal + VkBool32 identicalMemoryLayoutSpecifies if memory layout is identical + + + + VkStructureType sType + void* pNext + VkBool32 deviceNoDynamicHostAllocations + VkBool32 deviceDestroyFreesMemory + VkBool32 commandPoolMultipleCommandBuffersRecording + VkBool32 commandPoolResetCommandBuffer + VkBool32 commandBufferSimultaneousUse + VkBool32 secondaryCommandBufferNullOrImagelessFramebuffer + VkBool32 recycleDescriptorSetMemory + VkBool32 recyclePipelineMemory + uint32_t maxRenderPassSubpasses + uint32_t maxRenderPassDependencies + uint32_t maxSubpassInputAttachments + uint32_t maxSubpassPreserveAttachments + uint32_t maxFramebufferAttachments + uint32_t maxDescriptorSetLayoutBindings + uint32_t maxQueryFaultCount + uint32_t maxCallbackFaultCount + uint32_t maxCommandPoolCommandBuffers + VkDeviceSize maxCommandBufferSize + + + VkStructureType sType + const void* pNext + VkDeviceSize poolEntrySize + uint32_t poolEntryCount + + + VkStructureType sType + const void* pNext + uint32_t pipelineCacheCreateInfoCount + const VkPipelineCacheCreateInfo* pPipelineCacheCreateInfos + uint32_t pipelinePoolSizeCount + const VkPipelinePoolSize* pPipelinePoolSizes + uint32_t semaphoreRequestCount + uint32_t commandBufferRequestCount + uint32_t fenceRequestCount + uint32_t deviceMemoryRequestCount + uint32_t bufferRequestCount + uint32_t imageRequestCount + uint32_t eventRequestCount + uint32_t queryPoolRequestCount + uint32_t bufferViewRequestCount + uint32_t imageViewRequestCount + uint32_t layeredImageViewRequestCount + uint32_t pipelineCacheRequestCount + uint32_t pipelineLayoutRequestCount + uint32_t renderPassRequestCount + uint32_t graphicsPipelineRequestCount + uint32_t computePipelineRequestCount + uint32_t descriptorSetLayoutRequestCount + uint32_t samplerRequestCount + uint32_t descriptorPoolRequestCount + uint32_t descriptorSetRequestCount + uint32_t framebufferRequestCount + uint32_t commandPoolRequestCount + uint32_t samplerYcbcrConversionRequestCount + uint32_t surfaceRequestCount + uint32_t swapchainRequestCount + uint32_t displayModeRequestCount + uint32_t subpassDescriptionRequestCount + uint32_t attachmentDescriptionRequestCount + uint32_t descriptorSetLayoutBindingRequestCount + uint32_t descriptorSetLayoutBindingLimit + uint32_t maxImageViewMipLevels + uint32_t maxImageViewArrayLayers + uint32_t maxLayeredImageViewMipLevels + uint32_t maxOcclusionQueriesPerPool + uint32_t maxPipelineStatisticsQueriesPerPool + uint32_t maxTimestampQueriesPerPool + uint32_t maxImmutableSamplersPerDescriptorSetLayout + + + VkStructureType sType + const void* pNext + VkDeviceSize commandPoolReservedSize + uint32_t commandPoolMaxCommandBuffers + + + VkStructureType sType + void* pNext + VkDeviceSize commandPoolAllocated + VkDeviceSize commandPoolReservedSize + VkDeviceSize commandBufferAllocated + + + VkStructureType sType + void* pNext + VkBool32 shaderAtomicInstructions + + + VkStructureType sType + void* pNext + VkBool32 primitivesGeneratedQuery + VkBool32 primitivesGeneratedQueryWithRasterizerDiscard + VkBool32 primitivesGeneratedQueryWithNonZeroStreams + + + VkStructureType sType + void* pNext + VkBool32 legacyDithering + + + VkStructureType sType + void* pNext + VkBool32 multisampledRenderToSingleSampled + + + VkStructureType sType + void* pNext + VkBool32 optimal + + + VkStructureType sType + const void* pNext + VkBool32 multisampledRenderToSingleSampledEnable + VkSampleCountFlagBits rasterizationSamples + + + VkStructureType sType + void* pNext + VkBool32 pipelineProtectedAccess + + + + VkStructureType sType + void* pNext + VkVideoCodecOperationFlagsKHR videoCodecOperations + + + VkStructureType sType + void* pNext + VkBool32 queryResultStatusSupport + + + VkStructureType sType + const void* pNext + uint32_t profileCount + const VkVideoProfileInfoKHR* pProfiles + + + VkStructureType sType + const void* pNext + VkImageUsageFlags imageUsage + + + VkStructureType sType + void* pNext + VkFormat format + VkComponentMapping componentMapping + VkImageCreateFlags imageCreateFlags + VkImageType imageType + VkImageTiling imageTiling + VkImageUsageFlags imageUsageFlags + + + VkStructureType sType + void* pNext + VkExtent2D maxQuantizationMapExtent + + + VkStructureType sType + void* pNext + int32_t minQpDelta + int32_t maxQpDelta + + + VkStructureType sType + void* pNext + int32_t minQpDelta + int32_t maxQpDelta + + + VkStructureType sType + void* pNext + int32_t minQIndexDelta + int32_t maxQIndexDelta + + + VkStructureType sType + void* pNext + VkExtent2D quantizationMapTexelSize + + + VkStructureType sType + void* pNext + VkVideoEncodeH265CtbSizeFlagsKHR compatibleCtbSizes + + + VkStructureType sType + void* pNext + VkVideoEncodeAV1SuperblockSizeFlagsKHR compatibleSuperblockSizes + + + VkStructureType sType + const void* pNext + VkVideoCodecOperationFlagBitsKHR videoCodecOperation + VkVideoChromaSubsamplingFlagsKHR chromaSubsampling + VkVideoComponentBitDepthFlagsKHR lumaBitDepth + VkVideoComponentBitDepthFlagsKHR chromaBitDepth + + + VkStructureType sType + void* pNext + VkVideoCapabilityFlagsKHR flags + VkDeviceSize minBitstreamBufferOffsetAlignment + VkDeviceSize minBitstreamBufferSizeAlignment + VkExtent2D pictureAccessGranularity + VkExtent2D minCodedExtent + VkExtent2D maxCodedExtent + uint32_t maxDpbSlots + uint32_t maxActiveReferencePictures + VkExtensionProperties stdHeaderVersion + + + VkStructureType sType + void* pNext + uint32_t memoryBindIndex + VkMemoryRequirements memoryRequirements + + + VkStructureType sType + const void* pNext + uint32_t memoryBindIndex + VkDeviceMemory memory + VkDeviceSize memoryOffset + VkDeviceSize memorySize + + + VkStructureType sType + const void* pNext + VkOffset2D codedOffsetThe offset to be used for the picture resource, currently only used in field mode + VkExtent2D codedExtentThe extent to be used for the picture resource + uint32_t baseArrayLayerThe first array layer to be accessed for the Decode or Encode Operations + VkImageView imageViewBindingThe ImageView binding of the resource + + + VkStructureType sType + const void* pNext + int32_t slotIndexThe reference slot index + const VkVideoPictureResourceInfoKHR* pPictureResourceThe reference picture resource + + + VkStructureType sType + void* pNext + VkVideoDecodeCapabilityFlagsKHR flags + + + VkStructureType sType + const void* pNext + VkVideoDecodeUsageFlagsKHR videoUsageHints + + + VkStructureType sType + const void* pNext + VkVideoDecodeFlagsKHR flags + VkBuffer srcBuffer + VkDeviceSize srcBufferOffset + VkDeviceSize srcBufferRange + VkVideoPictureResourceInfoKHR dstPictureResource + const VkVideoReferenceSlotInfoKHR* pSetupReferenceSlot + uint32_t referenceSlotCount + const VkVideoReferenceSlotInfoKHR* pReferenceSlots + + + VkStructureType sType + void* pNext + VkBool32 videoMaintenance1 + + + VkStructureType sType + const void* pNext + VkQueryPool queryPool + uint32_t firstQuery + uint32_t queryCount + + Video Decode Codec Standard specific structures + #include "vk_video/vulkan_video_codec_h264std.h" + + + #include "vk_video/vulkan_video_codec_h264std_decode.h" + + + + VkStructureType sType + const void* pNext + StdVideoH264ProfileIdc stdProfileIdc + VkVideoDecodeH264PictureLayoutFlagBitsKHR pictureLayout + + + VkStructureType sType + void* pNext + StdVideoH264LevelIdc maxLevelIdc + VkOffset2D fieldOffsetGranularity + + + + + VkStructureType sType + const void* pNext + uint32_t stdSPSCount + const StdVideoH264SequenceParameterSet* pStdSPSs + uint32_t stdPPSCount + const StdVideoH264PictureParameterSet* pStdPPSsList of Picture Parameters associated with the spsStd, above + + + VkStructureType sType + const void* pNext + uint32_t maxStdSPSCount + uint32_t maxStdPPSCount + const VkVideoDecodeH264SessionParametersAddInfoKHR* pParametersAddInfo + + + VkStructureType sType + const void* pNext + const StdVideoDecodeH264PictureInfo* pStdPictureInfo + uint32_t sliceCount + const uint32_t* pSliceOffsets + + + VkStructureType sType + const void* pNext + const StdVideoDecodeH264ReferenceInfo* pStdReferenceInfo + + #include "vk_video/vulkan_video_codec_h265std.h" + + + + + + #include "vk_video/vulkan_video_codec_h265std_decode.h" + + + + VkStructureType sType + const void* pNext + StdVideoH265ProfileIdc stdProfileIdc + + + VkStructureType sType + void* pNext + StdVideoH265LevelIdc maxLevelIdc + + + VkStructureType sType + const void* pNext + uint32_t stdVPSCount + const StdVideoH265VideoParameterSet* pStdVPSs + uint32_t stdSPSCount + const StdVideoH265SequenceParameterSet* pStdSPSs + uint32_t stdPPSCount + const StdVideoH265PictureParameterSet* pStdPPSsList of Picture Parameters associated with the spsStd, above + + + VkStructureType sType + const void* pNext + uint32_t maxStdVPSCount + uint32_t maxStdSPSCount + uint32_t maxStdPPSCount + const VkVideoDecodeH265SessionParametersAddInfoKHR* pParametersAddInfo + + + VkStructureType sType + const void* pNext + const StdVideoDecodeH265PictureInfo* pStdPictureInfo + uint32_t sliceSegmentCount + const uint32_t* pSliceSegmentOffsets + + + VkStructureType sType + const void* pNext + const StdVideoDecodeH265ReferenceInfo* pStdReferenceInfo + + #include "vk_video/vulkan_video_codec_av1std.h" + + + + #include "vk_video/vulkan_video_codec_av1std_decode.h" + + + + VkStructureType sType + const void* pNext + StdVideoAV1Profile stdProfile + VkBool32 filmGrainSupport + + + VkStructureType sType + void* pNext + StdVideoAV1Level maxLevel + + + VkStructureType sType + const void* pNext + const StdVideoAV1SequenceHeader* pStdSequenceHeader + + + VkStructureType sType + const void* pNext + const StdVideoDecodeAV1PictureInfo* pStdPictureInfo + int32_t referenceNameSlotIndices[VK_MAX_VIDEO_AV1_REFERENCES_PER_FRAME_KHR] + uint32_t frameHeaderOffset + uint32_t tileCount + const uint32_t* pTileOffsets + const uint32_t* pTileSizes + + + VkStructureType sType + const void* pNext + const StdVideoDecodeAV1ReferenceInfo* pStdReferenceInfo + + + VkStructureType sType + const void* pNext + uint32_t queueFamilyIndex + VkVideoSessionCreateFlagsKHR flags + const VkVideoProfileInfoKHR* pVideoProfile + VkFormat pictureFormat + VkExtent2D maxCodedExtent + VkFormat referencePictureFormat + uint32_t maxDpbSlots + uint32_t maxActiveReferencePictures + const VkExtensionProperties* pStdHeaderVersion + + + VkStructureType sType + const void* pNext + VkVideoSessionParametersCreateFlagsKHR flags + VkVideoSessionParametersKHR videoSessionParametersTemplate + VkVideoSessionKHR videoSession + + + VkStructureType sType + const void* pNext + uint32_t updateSequenceCount + + + VkStructureType sType + const void* pNext + VkVideoSessionParametersKHR videoSessionParameters + + + VkStructureType sType + void* pNext + VkBool32 hasOverrides + + + VkStructureType sType + const void* pNext + VkVideoBeginCodingFlagsKHR flags + VkVideoSessionKHR videoSession + VkVideoSessionParametersKHR videoSessionParameters + uint32_t referenceSlotCount + const VkVideoReferenceSlotInfoKHR* pReferenceSlots + + + VkStructureType sType + const void* pNext + VkVideoEndCodingFlagsKHR flags + + + VkStructureType sType + const void* pNext + VkVideoCodingControlFlagsKHR flags + + + VkStructureType sType + const void* pNext + VkVideoEncodeUsageFlagsKHR videoUsageHints + VkVideoEncodeContentFlagsKHR videoContentHints + VkVideoEncodeTuningModeKHR tuningMode + + + VkStructureType sType + const void* pNext + VkVideoEncodeFlagsKHR flags + VkBuffer dstBuffer + VkDeviceSize dstBufferOffset + VkDeviceSize dstBufferRange + VkVideoPictureResourceInfoKHR srcPictureResource + const VkVideoReferenceSlotInfoKHR* pSetupReferenceSlot + uint32_t referenceSlotCount + const VkVideoReferenceSlotInfoKHR* pReferenceSlots + uint32_t precedingExternallyEncodedBytes + + + VkStructureType sType + const void* pNext + VkImageView quantizationMap + VkExtent2D quantizationMapExtent + + + VkStructureType sType + const void* pNext + VkExtent2D quantizationMapTexelSize + + + VkStructureType sType + void* pNext + VkBool32 videoEncodeQuantizationMap + + + VkStructureType sType + const void* pNext + VkVideoEncodeFeedbackFlagsKHR encodeFeedbackFlags + + + VkStructureType sType + const void* pNext + uint32_t qualityLevel + + + VkStructureType sType + const void* pNext + const VkVideoProfileInfoKHR* pVideoProfile + uint32_t qualityLevel + + + VkStructureType sType + void* pNext + VkVideoEncodeRateControlModeFlagBitsKHR preferredRateControlMode + uint32_t preferredRateControlLayerCount + + + VkStructureType sType + const void* pNext + VkVideoEncodeRateControlFlagsKHR flags + VkVideoEncodeRateControlModeFlagBitsKHR rateControlMode + uint32_t layerCount + const VkVideoEncodeRateControlLayerInfoKHR* pLayers + uint32_t virtualBufferSizeInMs + uint32_t initialVirtualBufferSizeInMs + + + VkStructureType sType + const void* pNext + uint64_t averageBitrate + uint64_t maxBitrate + uint32_t frameRateNumerator + uint32_t frameRateDenominator + + + VkStructureType sType + void* pNext + VkVideoEncodeCapabilityFlagsKHR flags + VkVideoEncodeRateControlModeFlagsKHR rateControlModes + uint32_t maxRateControlLayers + uint64_t maxBitrate + uint32_t maxQualityLevels + VkExtent2D encodeInputPictureGranularity + VkVideoEncodeFeedbackFlagsKHR supportedEncodeFeedbackFlags + + + VkStructureType sType + void* pNext + VkVideoEncodeH264CapabilityFlagsKHR flags + StdVideoH264LevelIdc maxLevelIdc + uint32_t maxSliceCount + uint32_t maxPPictureL0ReferenceCount + uint32_t maxBPictureL0ReferenceCount + uint32_t maxL1ReferenceCount + uint32_t maxTemporalLayerCount + VkBool32 expectDyadicTemporalLayerPattern + int32_t minQp + int32_t maxQp + VkBool32 prefersGopRemainingFrames + VkBool32 requiresGopRemainingFrames + VkVideoEncodeH264StdFlagsKHR stdSyntaxFlags + + + VkStructureType sType + void* pNext + VkVideoEncodeH264RateControlFlagsKHR preferredRateControlFlags + uint32_t preferredGopFrameCount + uint32_t preferredIdrPeriod + uint32_t preferredConsecutiveBFrameCount + uint32_t preferredTemporalLayerCount + VkVideoEncodeH264QpKHR preferredConstantQp + uint32_t preferredMaxL0ReferenceCount + uint32_t preferredMaxL1ReferenceCount + VkBool32 preferredStdEntropyCodingModeFlag + + #include "vk_video/vulkan_video_codec_h264std_encode.h" + + + + + VkStructureType sType + const void* pNext + VkBool32 useMaxLevelIdc + StdVideoH264LevelIdc maxLevelIdc + + + VkStructureType sType + const void* pNext + uint32_t stdSPSCount + const StdVideoH264SequenceParameterSet* pStdSPSs + uint32_t stdPPSCount + const StdVideoH264PictureParameterSet* pStdPPSsList of Picture Parameters associated with the spsStd, above + + + VkStructureType sType + const void* pNext + uint32_t maxStdSPSCount + uint32_t maxStdPPSCount + const VkVideoEncodeH264SessionParametersAddInfoKHR* pParametersAddInfo + + + VkStructureType sType + const void* pNext + VkBool32 writeStdSPS + VkBool32 writeStdPPS + uint32_t stdSPSId + uint32_t stdPPSId + + + VkStructureType sType + void* pNext + VkBool32 hasStdSPSOverrides + VkBool32 hasStdPPSOverrides + + + VkStructureType sType + const void* pNext + const StdVideoEncodeH264ReferenceInfo* pStdReferenceInfo + + + VkStructureType sType + const void* pNext + uint32_t naluSliceEntryCount + const VkVideoEncodeH264NaluSliceInfoKHR* pNaluSliceEntries + const StdVideoEncodeH264PictureInfo* pStdPictureInfo + VkBool32 generatePrefixNalu + + + VkStructureType sType + const void* pNext + StdVideoH264ProfileIdc stdProfileIdc + + + VkStructureType sType + const void* pNext + int32_t constantQp + const StdVideoEncodeH264SliceHeader* pStdSliceHeader + + + VkStructureType sType + const void* pNext + VkVideoEncodeH264RateControlFlagsKHR flags + uint32_t gopFrameCount + uint32_t idrPeriod + uint32_t consecutiveBFrameCount + uint32_t temporalLayerCount + + + int32_t qpI + int32_t qpP + int32_t qpB + + + uint32_t frameISize + uint32_t framePSize + uint32_t frameBSize + + + VkStructureType sType + const void* pNext + VkBool32 useGopRemainingFrames + uint32_t gopRemainingI + uint32_t gopRemainingP + uint32_t gopRemainingB + + + VkStructureType sType + const void* pNext + VkBool32 useMinQp + VkVideoEncodeH264QpKHR minQp + VkBool32 useMaxQp + VkVideoEncodeH264QpKHR maxQp + VkBool32 useMaxFrameSize + VkVideoEncodeH264FrameSizeKHR maxFrameSize + + + VkStructureType sType + void* pNext + VkVideoEncodeH265CapabilityFlagsKHR flags + StdVideoH265LevelIdc maxLevelIdc + uint32_t maxSliceSegmentCount + VkExtent2D maxTiles + VkVideoEncodeH265CtbSizeFlagsKHR ctbSizes + VkVideoEncodeH265TransformBlockSizeFlagsKHR transformBlockSizes + uint32_t maxPPictureL0ReferenceCount + uint32_t maxBPictureL0ReferenceCount + uint32_t maxL1ReferenceCount + uint32_t maxSubLayerCount + VkBool32 expectDyadicTemporalSubLayerPattern + int32_t minQp + int32_t maxQp + VkBool32 prefersGopRemainingFrames + VkBool32 requiresGopRemainingFrames + VkVideoEncodeH265StdFlagsKHR stdSyntaxFlags + + + VkStructureType sType + void* pNext + VkVideoEncodeH265RateControlFlagsKHR preferredRateControlFlags + uint32_t preferredGopFrameCount + uint32_t preferredIdrPeriod + uint32_t preferredConsecutiveBFrameCount + uint32_t preferredSubLayerCount + VkVideoEncodeH265QpKHR preferredConstantQp + uint32_t preferredMaxL0ReferenceCount + uint32_t preferredMaxL1ReferenceCount + + #include "vk_video/vulkan_video_codec_h265std_encode.h" + + + + + VkStructureType sType + const void* pNext + VkBool32 useMaxLevelIdc + StdVideoH265LevelIdc maxLevelIdc + + + VkStructureType sType + const void* pNext + uint32_t stdVPSCount + const StdVideoH265VideoParameterSet* pStdVPSs + uint32_t stdSPSCount + const StdVideoH265SequenceParameterSet* pStdSPSs + uint32_t stdPPSCount + const StdVideoH265PictureParameterSet* pStdPPSsList of Picture Parameters associated with the spsStd, above + + + VkStructureType sType + const void* pNext + uint32_t maxStdVPSCount + uint32_t maxStdSPSCount + uint32_t maxStdPPSCount + const VkVideoEncodeH265SessionParametersAddInfoKHR* pParametersAddInfo + + + VkStructureType sType + const void* pNext + VkBool32 writeStdVPS + VkBool32 writeStdSPS + VkBool32 writeStdPPS + uint32_t stdVPSId + uint32_t stdSPSId + uint32_t stdPPSId + + + VkStructureType sType + void* pNext + VkBool32 hasStdVPSOverrides + VkBool32 hasStdSPSOverrides + VkBool32 hasStdPPSOverrides + + + VkStructureType sType + const void* pNext + uint32_t naluSliceSegmentEntryCount + const VkVideoEncodeH265NaluSliceSegmentInfoKHR* pNaluSliceSegmentEntries + const StdVideoEncodeH265PictureInfo* pStdPictureInfo + + + VkStructureType sType + const void* pNext + int32_t constantQp + const StdVideoEncodeH265SliceSegmentHeader* pStdSliceSegmentHeader + + + VkStructureType sType + const void* pNext + VkVideoEncodeH265RateControlFlagsKHR flags + uint32_t gopFrameCount + uint32_t idrPeriod + uint32_t consecutiveBFrameCount + uint32_t subLayerCount + + + int32_t qpI + int32_t qpP + int32_t qpB + + + uint32_t frameISize + uint32_t framePSize + uint32_t frameBSize + + + VkStructureType sType + const void* pNext + VkBool32 useGopRemainingFrames + uint32_t gopRemainingI + uint32_t gopRemainingP + uint32_t gopRemainingB + + + VkStructureType sType + const void* pNext + VkBool32 useMinQp + VkVideoEncodeH265QpKHR minQp + VkBool32 useMaxQp + VkVideoEncodeH265QpKHR maxQp + VkBool32 useMaxFrameSize + VkVideoEncodeH265FrameSizeKHR maxFrameSize + + + VkStructureType sType + const void* pNext + StdVideoH265ProfileIdc stdProfileIdc + + + VkStructureType sType + const void* pNext + const StdVideoEncodeH265ReferenceInfo* pStdReferenceInfo + + + VkStructureType sType + void* pNext + VkVideoEncodeAV1CapabilityFlagsKHR flags + StdVideoAV1Level maxLevel + VkExtent2D codedPictureAlignment + VkExtent2D maxTiles + VkExtent2D minTileSize + VkExtent2D maxTileSize + VkVideoEncodeAV1SuperblockSizeFlagsKHR superblockSizes + uint32_t maxSingleReferenceCount + uint32_t singleReferenceNameMask + uint32_t maxUnidirectionalCompoundReferenceCount + uint32_t maxUnidirectionalCompoundGroup1ReferenceCount + uint32_t unidirectionalCompoundReferenceNameMask + uint32_t maxBidirectionalCompoundReferenceCount + uint32_t maxBidirectionalCompoundGroup1ReferenceCount + uint32_t maxBidirectionalCompoundGroup2ReferenceCount + uint32_t bidirectionalCompoundReferenceNameMask + uint32_t maxTemporalLayerCount + uint32_t maxSpatialLayerCount + uint32_t maxOperatingPoints + uint32_t minQIndex + uint32_t maxQIndex + VkBool32 prefersGopRemainingFrames + VkBool32 requiresGopRemainingFrames + VkVideoEncodeAV1StdFlagsKHR stdSyntaxFlags + + + VkStructureType sType + void* pNext + VkVideoEncodeAV1RateControlFlagsKHR preferredRateControlFlags + uint32_t preferredGopFrameCount + uint32_t preferredKeyFramePeriod + uint32_t preferredConsecutiveBipredictiveFrameCount + uint32_t preferredTemporalLayerCount + VkVideoEncodeAV1QIndexKHR preferredConstantQIndex + uint32_t preferredMaxSingleReferenceCount + uint32_t preferredSingleReferenceNameMask + uint32_t preferredMaxUnidirectionalCompoundReferenceCount + uint32_t preferredMaxUnidirectionalCompoundGroup1ReferenceCount + uint32_t preferredUnidirectionalCompoundReferenceNameMask + uint32_t preferredMaxBidirectionalCompoundReferenceCount + uint32_t preferredMaxBidirectionalCompoundGroup1ReferenceCount + uint32_t preferredMaxBidirectionalCompoundGroup2ReferenceCount + uint32_t preferredBidirectionalCompoundReferenceNameMask + + #include "vk_video/vulkan_video_codec_av1std_encode.h" + + + + + + + VkStructureType sType + void* pNext + VkBool32 videoEncodeAV1 + + + VkStructureType sType + const void* pNext + VkBool32 useMaxLevel + StdVideoAV1Level maxLevel + + + VkStructureType sType + const void* pNext + const StdVideoAV1SequenceHeader* pStdSequenceHeader + const StdVideoEncodeAV1DecoderModelInfo* pStdDecoderModelInfo + uint32_t stdOperatingPointCount + const StdVideoEncodeAV1OperatingPointInfo* pStdOperatingPoints + + + VkStructureType sType + const void* pNext + const StdVideoEncodeAV1ReferenceInfo* pStdReferenceInfo + + + VkStructureType sType + const void* pNext + VkVideoEncodeAV1PredictionModeKHR predictionMode + VkVideoEncodeAV1RateControlGroupKHR rateControlGroup + uint32_t constantQIndex + const StdVideoEncodeAV1PictureInfo* pStdPictureInfo + int32_t referenceNameSlotIndices[VK_MAX_VIDEO_AV1_REFERENCES_PER_FRAME_KHR] + VkBool32 primaryReferenceCdfOnly + VkBool32 generateObuExtensionHeader + + + VkStructureType sType + const void* pNext + StdVideoAV1Profile stdProfile + + + VkStructureType sType + const void* pNext + VkVideoEncodeAV1RateControlFlagsKHR flags + uint32_t gopFrameCount + uint32_t keyFramePeriod + uint32_t consecutiveBipredictiveFrameCount + uint32_t temporalLayerCount + + + uint32_t intraQIndex + uint32_t predictiveQIndex + uint32_t bipredictiveQIndex + + + uint32_t intraFrameSize + uint32_t predictiveFrameSize + uint32_t bipredictiveFrameSize + + + VkStructureType sType + const void* pNext + VkBool32 useGopRemainingFrames + uint32_t gopRemainingIntra + uint32_t gopRemainingPredictive + uint32_t gopRemainingBipredictive + + + VkStructureType sType + const void* pNext + VkBool32 useMinQIndex + VkVideoEncodeAV1QIndexKHR minQIndex + VkBool32 useMaxQIndex + VkVideoEncodeAV1QIndexKHR maxQIndex + VkBool32 useMaxFrameSize + VkVideoEncodeAV1FrameSizeKHR maxFrameSize + + + VkStructureType sType + void* pNext + VkBool32 inheritedViewportScissor2D + + + VkStructureType sType + const void* pNext + VkBool32 viewportScissor2D + uint32_t viewportDepthCount + const VkViewport* pViewportDepths + + + VkStructureType sType + void* pNext + VkBool32 ycbcr2plane444Formats + + + VkStructureType sType + void* pNext + VkBool32 provokingVertexLast + VkBool32 transformFeedbackPreservesProvokingVertex + + + VkStructureType sType + void* pNext + VkBool32 provokingVertexModePerPipeline + VkBool32 transformFeedbackPreservesTriangleFanProvokingVertex + + + VkStructureType sType + const void* pNext + VkProvokingVertexModeEXT provokingVertexMode + + + VkStructureType sType + const void* pNext + size_t dataSize + const void* pData + + + VkStructureType sType + const void* pNext + VkBool32 use64bitTexturing + + + VkStructureType sType + const void* pNext + VkCuModuleNVX module + const char* pName + + + VkStructureType sType + const void* pNext + VkCuFunctionNVX function + uint32_t gridDimX + uint32_t gridDimY + uint32_t gridDimZ + uint32_t blockDimX + uint32_t blockDimY + uint32_t blockDimZ + uint32_t sharedMemBytes + size_t paramCount + const void* const * pParams + size_t extraCount + const void* const * pExtras + + + VkStructureType sType + void* pNext + VkBool32 descriptorBuffer + VkBool32 descriptorBufferCaptureReplay + VkBool32 descriptorBufferImageLayoutIgnored + VkBool32 descriptorBufferPushDescriptors + + + VkStructureType sType + void* pNext + VkBool32 combinedImageSamplerDescriptorSingleArray + VkBool32 bufferlessPushDescriptors + VkBool32 allowSamplerImageViewPostSubmitCreation + VkDeviceSize descriptorBufferOffsetAlignment + uint32_t maxDescriptorBufferBindings + uint32_t maxResourceDescriptorBufferBindings + uint32_t maxSamplerDescriptorBufferBindings + uint32_t maxEmbeddedImmutableSamplerBindings + uint32_t maxEmbeddedImmutableSamplers + size_t bufferCaptureReplayDescriptorDataSize + size_t imageCaptureReplayDescriptorDataSize + size_t imageViewCaptureReplayDescriptorDataSize + size_t samplerCaptureReplayDescriptorDataSize + size_t accelerationStructureCaptureReplayDescriptorDataSize + size_t samplerDescriptorSize + size_t combinedImageSamplerDescriptorSize + size_t sampledImageDescriptorSize + size_t storageImageDescriptorSize + size_t uniformTexelBufferDescriptorSize + size_t robustUniformTexelBufferDescriptorSize + size_t storageTexelBufferDescriptorSize + size_t robustStorageTexelBufferDescriptorSize + size_t uniformBufferDescriptorSize + size_t robustUniformBufferDescriptorSize + size_t storageBufferDescriptorSize + size_t robustStorageBufferDescriptorSize + size_t inputAttachmentDescriptorSize + size_t accelerationStructureDescriptorSize + VkDeviceSize maxSamplerDescriptorBufferRange + VkDeviceSize maxResourceDescriptorBufferRange + VkDeviceSize samplerDescriptorBufferAddressSpaceSize + VkDeviceSize resourceDescriptorBufferAddressSpaceSize + VkDeviceSize descriptorBufferAddressSpaceSize + + + VkStructureType sType + void* pNext + size_t combinedImageSamplerDensityMapDescriptorSize + + + VkStructureType sType + void* pNext + VkDeviceAddress address + VkDeviceSize range + VkFormat format + + + VkStructureType sType + const void* pNext + VkDeviceAddress address + VkBufferUsageFlags usage + + + VkStructureType sType + const void* pNext + VkBuffer buffer + + + const VkSampler* pSampler + const VkDescriptorImageInfo* pCombinedImageSampler + const VkDescriptorImageInfo* pInputAttachmentImage + const VkDescriptorImageInfo* pSampledImage + const VkDescriptorImageInfo* pStorageImage + const VkDescriptorAddressInfoEXT* pUniformTexelBuffer + const VkDescriptorAddressInfoEXT* pStorageTexelBuffer + const VkDescriptorAddressInfoEXT* pUniformBuffer + const VkDescriptorAddressInfoEXT* pStorageBuffer + VkDeviceAddress accelerationStructure + + + VkStructureType sType + const void* pNext + VkDescriptorType type + VkDescriptorDataEXT data + + + VkStructureType sType + const void* pNext + VkBuffer buffer + + + VkStructureType sType + const void* pNext + VkImage image + + + VkStructureType sType + const void* pNext + VkImageView imageView + + + VkStructureType sType + const void* pNext + VkSampler sampler + + + VkStructureType sType + const void* pNext + VkAccelerationStructureKHR accelerationStructure + VkAccelerationStructureNV accelerationStructureNV + + + VkStructureType sType + const void* pNext + const void* opaqueCaptureDescriptorData + + + VkStructureType sType + void* pNext + VkBool32 shaderIntegerDotProduct + + + + VkStructureType sType + void* pNext + VkBool32 integerDotProduct8BitUnsignedAccelerated + VkBool32 integerDotProduct8BitSignedAccelerated + VkBool32 integerDotProduct8BitMixedSignednessAccelerated + VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated + VkBool32 integerDotProduct4x8BitPackedSignedAccelerated + VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated + VkBool32 integerDotProduct16BitUnsignedAccelerated + VkBool32 integerDotProduct16BitSignedAccelerated + VkBool32 integerDotProduct16BitMixedSignednessAccelerated + VkBool32 integerDotProduct32BitUnsignedAccelerated + VkBool32 integerDotProduct32BitSignedAccelerated + VkBool32 integerDotProduct32BitMixedSignednessAccelerated + VkBool32 integerDotProduct64BitUnsignedAccelerated + VkBool32 integerDotProduct64BitSignedAccelerated + VkBool32 integerDotProduct64BitMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated + VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated + VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated + + + + VkStructureType sType + void* pNext + VkBool32 hasPrimary + VkBool32 hasRender + int64_t primaryMajor + int64_t primaryMinor + int64_t renderMajor + int64_t renderMinor + + + VkStructureType sType + void* pNext + VkBool32 fragmentShaderBarycentric + + + VkStructureType sType + void* pNext + VkBool32 triStripVertexOrderIndependentOfProvokingVertex + + + VkStructureType sType + void* pNext + VkBool32 rayTracingMotionBlur + VkBool32 rayTracingMotionBlurPipelineTraceRaysIndirect + + + VkStructureType sType + void* pNext + VkBool32 rayTracingValidation + + + + VkStructureType sType + const void* pNext + VkDeviceOrHostAddressConstKHR vertexData + + + VkStructureType sType + const void* pNext + uint32_t maxInstances + VkAccelerationStructureMotionInfoFlagsNV flags + + + float sx + float a + float b + float pvx + float sy + float c + float pvy + float sz + float pvz + float qx + float qy + float qz + float qw + float tx + float ty + float tz + + + The bitfields in this structure are non-normative since bitfield ordering is implementation-defined in C. The specification defines the normative layout. + VkSRTDataNV transformT0 + VkSRTDataNV transformT1 + uint32_t instanceCustomIndex:24 + uint32_t mask:8 + uint32_t instanceShaderBindingTableRecordOffset:24 + VkGeometryInstanceFlagsKHR flags:8 + uint64_t accelerationStructureReference + + + The bitfields in this structure are non-normative since bitfield ordering is implementation-defined in C. The specification defines the normative layout. + VkTransformMatrixKHR transformT0 + VkTransformMatrixKHR transformT1 + uint32_t instanceCustomIndex:24 + uint32_t mask:8 + uint32_t instanceShaderBindingTableRecordOffset:24 + VkGeometryInstanceFlagsKHR flags:8 + uint64_t accelerationStructureReference + + + VkAccelerationStructureInstanceKHR staticInstance + VkAccelerationStructureMatrixMotionInstanceNV matrixMotionInstance + VkAccelerationStructureSRTMotionInstanceNV srtMotionInstance + + + VkAccelerationStructureMotionInstanceTypeNV type + VkAccelerationStructureMotionInstanceFlagsNV flags + VkAccelerationStructureMotionInstanceDataNV data + + typedef void* VkRemoteAddressNV; + + VkStructureType sType + const void* pNext + VkDeviceMemory memory + VkExternalMemoryHandleTypeFlagBits handleType + + + VkStructureType sType + const void* pNext + VkBufferCollectionFUCHSIA collection + uint32_t index + + + VkStructureType sType + const void* pNext + VkBufferCollectionFUCHSIA collection + uint32_t index + + + VkStructureType sType + const void* pNext + VkBufferCollectionFUCHSIA collection + uint32_t index + + + VkStructureType sType + const void* pNext + zx_handle_t collectionToken + + + VkStructureType sType + void* pNext + uint32_t memoryTypeBits + uint32_t bufferCount + uint32_t createInfoIndex + uint64_t sysmemPixelFormat + VkFormatFeatureFlags formatFeatures + VkSysmemColorSpaceFUCHSIA sysmemColorSpaceIndex + VkComponentMapping samplerYcbcrConversionComponents + VkSamplerYcbcrModelConversion suggestedYcbcrModel + VkSamplerYcbcrRange suggestedYcbcrRange + VkChromaLocation suggestedXChromaOffset + VkChromaLocation suggestedYChromaOffset + + + VkStructureType sType + const void* pNext + VkBufferCreateInfo createInfo + VkFormatFeatureFlags requiredFormatFeatures + VkBufferCollectionConstraintsInfoFUCHSIA bufferCollectionConstraints + + + VkStructureType sType + const void* pNext + uint32_t colorSpace + + + VkStructureType sType + const void* pNext + VkImageCreateInfo imageCreateInfo + VkFormatFeatureFlags requiredFormatFeatures + VkImageFormatConstraintsFlagsFUCHSIA flags + uint64_t sysmemPixelFormat + uint32_t colorSpaceCount + const VkSysmemColorSpaceFUCHSIA* pColorSpaces + + + VkStructureType sType + const void* pNext + uint32_t formatConstraintsCount + const VkImageFormatConstraintsInfoFUCHSIA* pFormatConstraints + VkBufferCollectionConstraintsInfoFUCHSIA bufferCollectionConstraints + VkImageConstraintsInfoFlagsFUCHSIA flags + + + VkStructureType sType + const void* pNext + uint32_t minBufferCount + uint32_t maxBufferCount + uint32_t minBufferCountForCamping + uint32_t minBufferCountForDedicatedSlack + uint32_t minBufferCountForSharedSlack + + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCudaModuleNV) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCudaFunctionNV) + + VkStructureType sType + const void* pNext + size_t dataSize + const void* pData + + + VkStructureType sType + const void* pNext + VkCudaModuleNV module + const char* pName + + + VkStructureType sType + const void* pNext + VkCudaFunctionNV function + uint32_t gridDimX + uint32_t gridDimY + uint32_t gridDimZ + uint32_t blockDimX + uint32_t blockDimY + uint32_t blockDimZ + uint32_t sharedMemBytes + size_t paramCount + const void* const * pParams + size_t extraCount + const void* const * pExtras + + + VkStructureType sType + void* pNext + VkBool32 formatRgba10x6WithoutYCbCrSampler + + + VkStructureType sType + void* pNext + VkFormatFeatureFlags2 linearTilingFeatures + VkFormatFeatureFlags2 optimalTilingFeatures + VkFormatFeatureFlags2 bufferFeatures + + + + VkStructureType sType + void* pNext + uint32_t drmFormatModifierCount + VkDrmFormatModifierProperties2EXT* pDrmFormatModifierProperties + + + uint64_t drmFormatModifier + uint32_t drmFormatModifierPlaneCount + VkFormatFeatureFlags2 drmFormatModifierTilingFeatures + + + VkStructureType sType + void* pNext + VkFormat format + uint64_t externalFormat + VkFormatFeatureFlags2 formatFeatures + VkComponentMapping samplerYcbcrConversionComponents + VkSamplerYcbcrModelConversion suggestedYcbcrModel + VkSamplerYcbcrRange suggestedYcbcrRange + VkChromaLocation suggestedXChromaOffset + VkChromaLocation suggestedYChromaOffset + + + VkStructureType sType + const void* pNext + uint32_t viewMask + uint32_t colorAttachmentCount + const VkFormat* pColorAttachmentFormats + VkFormat depthAttachmentFormat + VkFormat stencilAttachmentFormat + + + + VkStructureType sType + const void* pNext + VkRenderingFlags flags + VkRect2D renderArea + uint32_t layerCount + uint32_t viewMask + uint32_t colorAttachmentCount + const VkRenderingAttachmentInfo* pColorAttachments + const VkRenderingAttachmentInfo* pDepthAttachment + const VkRenderingAttachmentInfo* pStencilAttachment + + + + VkStructureType sType + const void* pNext + VkImageView imageView + VkImageLayout imageLayout + VkResolveModeFlagBits resolveMode + VkImageView resolveImageView + VkImageLayout resolveImageLayout + VkAttachmentLoadOp loadOp + VkAttachmentStoreOp storeOp + VkClearValue clearValue + + + + VkStructureType sType + const void* pNext + VkImageView imageView + VkImageLayout imageLayout + VkExtent2D shadingRateAttachmentTexelSize + + + VkStructureType sType + const void* pNext + VkImageView imageView + VkImageLayout imageLayout + + + VkStructureType sType + void* pNext + VkBool32 dynamicRendering + + + + VkStructureType sType + const void* pNext + VkRenderingFlags flags + uint32_t viewMask + uint32_t colorAttachmentCount + uint32_t colorAttachmentCount + const VkFormat* pColorAttachmentFormats + VkFormat depthAttachmentFormat + VkFormat stencilAttachmentFormat + VkSampleCountFlagBits rasterizationSamples + + + + VkStructureType sType + const void* pNext + uint32_t colorAttachmentCount + const VkSampleCountFlagBits* pColorAttachmentSamples + VkSampleCountFlagBits depthStencilAttachmentSamples + + + + VkStructureType sType + const void* pNext + VkBool32 perViewAttributes + VkBool32 perViewAttributesPositionXOnly + + + VkStructureType sType + void* pNext + VkBool32 minLod + + + VkStructureType sType + const void* pNext + float minLod + + + VkStructureType sType + void* pNext + VkBool32 rasterizationOrderColorAttachmentAccess + VkBool32 rasterizationOrderDepthAttachmentAccess + VkBool32 rasterizationOrderStencilAttachmentAccess + + + + VkStructureType sType + void* pNext + VkBool32 linearColorAttachment + + + VkStructureType sType + void* pNext + VkBool32 graphicsPipelineLibrary + + + VkStructureType sType + void* pNext + VkBool32 pipelineBinaries + + + VkStructureType sType + const void* pNext + VkBool32 disableInternalCache + + + VkStructureType sType + void* pNext + VkBool32 pipelineBinaryInternalCache + VkBool32 pipelineBinaryInternalCacheControl + VkBool32 pipelineBinaryPrefersInternalCache + VkBool32 pipelineBinaryPrecompiledInternalCache + VkBool32 pipelineBinaryCompressedData + + + VkStructureType sType + void* pNext + VkBool32 graphicsPipelineLibraryFastLinking + VkBool32 graphicsPipelineLibraryIndependentInterpolationDecoration + + + VkStructureType sType + const void* pNext + VkGraphicsPipelineLibraryFlagsEXT flags + + + VkStructureType sType + void* pNext + VkBool32 descriptorSetHostMapping + + + VkStructureType sType + const void* pNext + VkDescriptorSetLayout descriptorSetLayout + uint32_t binding + + + VkStructureType sType + void* pNext + size_t descriptorOffset + uint32_t descriptorSize + + + VkStructureType sType + void* pNext + VkBool32 nestedCommandBuffer + VkBool32 nestedCommandBufferRendering + VkBool32 nestedCommandBufferSimultaneousUse + + + VkStructureType sType + void* pNext + uint32_t maxCommandBufferNestingLevel + + + VkStructureType sType + void* pNext + VkBool32 shaderModuleIdentifier + + + VkStructureType sType + void* pNext + uint8_t shaderModuleIdentifierAlgorithmUUID[VK_UUID_SIZE] + + + VkStructureType sType + const void* pNext + uint32_t identifierSize + const uint8_t* pIdentifier + + + VkStructureType sType + void* pNext + uint32_t identifierSize + uint8_t identifier[VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT] + + + VkStructureType sType + const void* pNext + VkImageCompressionFlagsEXT flags + uint32_t compressionControlPlaneCount + VkImageCompressionFixedRateFlagsEXT* pFixedRateFlags + + + VkStructureType sType + void* pNext + VkBool32 imageCompressionControl + + + VkStructureType sType + void* pNext + VkImageCompressionFlagsEXT imageCompressionFlags + VkImageCompressionFixedRateFlagsEXT imageCompressionFixedRateFlags + + + VkStructureType sType + void* pNext + VkBool32 imageCompressionControlSwapchain + + + VkStructureType sType + void* pNext + VkImageSubresource imageSubresource + + + + + VkStructureType sType + void* pNext + VkSubresourceLayout subresourceLayout + + + + + VkStructureType sType + const void* pNext + VkBool32 disallowMerging + + + uint32_t postMergeSubpassCount + + + VkStructureType sType + const void* pNext + VkRenderPassCreationFeedbackInfoEXT* pRenderPassFeedback + + + VkSubpassMergeStatusEXT subpassMergeStatus + char description[VK_MAX_DESCRIPTION_SIZE] + uint32_t postMergeIndex + + + VkStructureType sType + const void* pNext + VkRenderPassSubpassFeedbackInfoEXT* pSubpassFeedback + + + VkStructureType sType + void* pNext + VkBool32 subpassMergeFeedback + + + VkStructureType sType + const void* pNext + VkMicromapTypeEXT type + VkBuildMicromapFlagsEXT flags + VkBuildMicromapModeEXT mode + VkMicromapEXT dstMicromap + uint32_t usageCountsCount + const VkMicromapUsageEXT* pUsageCounts + const VkMicromapUsageEXT* const* ppUsageCounts + VkDeviceOrHostAddressConstKHR data + VkDeviceOrHostAddressKHR scratchData + VkDeviceOrHostAddressConstKHR triangleArray + VkDeviceSize triangleArrayStride + + + VkStructureType sType + const void* pNext + VkMicromapCreateFlagsEXT createFlags + VkBuffer buffer + VkDeviceSize offsetSpecified in bytes + VkDeviceSize size + VkMicromapTypeEXT type + VkDeviceAddress deviceAddress + + + VkStructureType sType + const void* pNext + const uint8_t* pVersionData + + + VkStructureType sType + const void* pNext + VkMicromapEXT src + VkMicromapEXT dst + VkCopyMicromapModeEXT mode + + + VkStructureType sType + const void* pNext + VkMicromapEXT src + VkDeviceOrHostAddressKHR dst + VkCopyMicromapModeEXT mode + + + VkStructureType sType + const void* pNext + VkDeviceOrHostAddressConstKHR src + VkMicromapEXT dst + VkCopyMicromapModeEXT mode + + + VkStructureType sType + const void* pNext + VkDeviceSize micromapSize + VkDeviceSize buildScratchSize + VkBool32 discardable + + + uint32_t count + uint32_t subdivisionLevel + uint32_t formatInterpretation depends on parent type + + + uint32_t dataOffsetSpecified in bytes + uint16_t subdivisionLevel + uint16_t format + + + VkStructureType sType + void* pNext + VkBool32 micromap + VkBool32 micromapCaptureReplay + VkBool32 micromapHostCommands + + + VkStructureType sType + void* pNext + uint32_t maxOpacity2StateSubdivisionLevel + uint32_t maxOpacity4StateSubdivisionLevel + + + VkStructureType sType + void* pNext + VkIndexType indexType + VkDeviceOrHostAddressConstKHR indexBuffer + VkDeviceSize indexStride + uint32_t baseTriangle + uint32_t usageCountsCount + const VkMicromapUsageEXT* pUsageCounts + const VkMicromapUsageEXT* const* ppUsageCounts + VkMicromapEXT micromap + + + VkStructureType sType + void* pNext + VkBool32 displacementMicromap + + + VkStructureType sType + void* pNext + uint32_t maxDisplacementMicromapSubdivisionLevel + + + VkStructureType sType + void* pNext + + VkFormat displacementBiasAndScaleFormat + VkFormat displacementVectorFormat + + VkDeviceOrHostAddressConstKHR displacementBiasAndScaleBuffer + VkDeviceSize displacementBiasAndScaleStride + VkDeviceOrHostAddressConstKHR displacementVectorBuffer + VkDeviceSize displacementVectorStride + VkDeviceOrHostAddressConstKHR displacedMicromapPrimitiveFlags + VkDeviceSize displacedMicromapPrimitiveFlagsStride + VkIndexType indexType + VkDeviceOrHostAddressConstKHR indexBuffer + VkDeviceSize indexStride + + uint32_t baseTriangle + + uint32_t usageCountsCount + const VkMicromapUsageEXT* pUsageCounts + const VkMicromapUsageEXT* const* ppUsageCounts + + VkMicromapEXT micromap + + + VkStructureType sType + void* pNext + uint8_t pipelineIdentifier[VK_UUID_SIZE] + + + VkStructureType sType + void* pNext + VkBool32 pipelinePropertiesIdentifier + + + VkStructureType sType + void* pNext + VkBool32 shaderEarlyAndLateFragmentTests + + + VkStructureType sType + const void* pNext + VkBool32 acquireUnmodifiedMemory + + + VkStructureType sType + const void* pNext + VkExportMetalObjectTypeFlagBitsEXT exportObjectType + + + VkStructureType sType + const void* pNext + + + VkStructureType sType + const void* pNext + MTLDevice_id mtlDevice + + + VkStructureType sType + const void* pNext + VkQueue queue + MTLCommandQueue_id mtlCommandQueue + + + VkStructureType sType + const void* pNext + VkDeviceMemory memory + MTLBuffer_id mtlBuffer + + + VkStructureType sType + const void* pNext + MTLBuffer_id mtlBuffer + + + VkStructureType sType + const void* pNext + VkImage image + VkImageView imageView + VkBufferView bufferView + VkImageAspectFlagBits plane + MTLTexture_id mtlTexture + + + VkStructureType sType + const void* pNext + VkImageAspectFlagBits plane + MTLTexture_id mtlTexture + + + VkStructureType sType + const void* pNext + VkImage image + IOSurfaceRef ioSurface + + + VkStructureType sType + const void* pNext + IOSurfaceRef ioSurface + + + VkStructureType sType + const void* pNext + VkSemaphore semaphore + VkEvent event + MTLSharedEvent_id mtlSharedEvent + + + VkStructureType sType + const void* pNext + MTLSharedEvent_id mtlSharedEvent + + + VkStructureType sType + void* pNext + VkBool32 nonSeamlessCubeMap + + + VkStructureType sType + void* pNext + VkBool32 pipelineRobustness + + + + VkStructureType sType + const void* pNext + VkPipelineRobustnessBufferBehavior storageBuffers + VkPipelineRobustnessBufferBehavior uniformBuffers + VkPipelineRobustnessBufferBehavior vertexInputs + VkPipelineRobustnessImageBehavior images + + + + VkStructureType sType + void* pNext + VkPipelineRobustnessBufferBehavior defaultRobustnessStorageBuffers + VkPipelineRobustnessBufferBehavior defaultRobustnessUniformBuffers + VkPipelineRobustnessBufferBehavior defaultRobustnessVertexInputs + VkPipelineRobustnessImageBehavior defaultRobustnessImages + + + + VkStructureType sType + const void* pNext + VkOffset2D filterCenter + VkExtent2D filterSize + uint32_t numPhases + + + VkStructureType sType + void* pNext + VkBool32 textureSampleWeighted + VkBool32 textureBoxFilter + VkBool32 textureBlockMatch + + + VkStructureType sType + void* pNext + uint32_t maxWeightFilterPhases + VkExtent2D maxWeightFilterDimension + VkExtent2D maxBlockMatchRegion + VkExtent2D maxBoxFilterBlockSize + + + VkStructureType sType + void* pNext + VkBool32 tileProperties + + + VkStructureType sType + void* pNext + VkExtent3D tileSize + VkExtent2D apronSize + VkOffset2D origin + + + VkStructureType sType + void* pNext + VkBool32 amigoProfiling + + + VkStructureType sType + const void* pNext + uint64_t firstDrawTimestamp + uint64_t swapBufferTimestamp + + + VkStructureType sType + void* pNext + VkBool32 attachmentFeedbackLoopLayout + + + VkStructureType sType + void* pNext + VkBool32 depthClampZeroOne + + + VkStructureType sType + void* pNext + VkBool32 reportAddressBinding + + + VkStructureType sType + void* pNext + VkDeviceAddressBindingFlagsEXT flags + VkDeviceAddress baseAddress + VkDeviceSize size + VkDeviceAddressBindingTypeEXT bindingType + + + VkStructureType sType + void* pNext + VkBool32 opticalFlow + + + VkStructureType sType + void* pNext + VkOpticalFlowGridSizeFlagsNV supportedOutputGridSizes + VkOpticalFlowGridSizeFlagsNV supportedHintGridSizes + VkBool32 hintSupported + VkBool32 costSupported + VkBool32 bidirectionalFlowSupported + VkBool32 globalFlowSupported + uint32_t minWidth + uint32_t minHeight + uint32_t maxWidth + uint32_t maxHeight + uint32_t maxNumRegionsOfInterest + + + VkStructureType sType + const void* pNext + VkOpticalFlowUsageFlagsNV usage + + + VkStructureType sType + const void* pNext + VkFormat format + + + VkStructureType sType + void* pNext + uint32_t width + uint32_t height + VkFormat imageFormat + VkFormat flowVectorFormat + VkFormat costFormat + VkOpticalFlowGridSizeFlagsNV outputGridSize + VkOpticalFlowGridSizeFlagsNV hintGridSize + VkOpticalFlowPerformanceLevelNV performanceLevel + VkOpticalFlowSessionCreateFlagsNV flags + + NV internal use only + VkStructureType sType + void* pNext + uint32_t id + uint32_t size + const void* pPrivateData + + + VkStructureType sType + void* pNext + VkOpticalFlowExecuteFlagsNV flags + uint32_t regionCount + const VkRect2D* pRegions + + + VkStructureType sType + void* pNext + VkBool32 deviceFault + VkBool32 deviceFaultVendorBinary + + + VkDeviceFaultAddressTypeEXT addressType + VkDeviceAddress reportedAddress + VkDeviceSize addressPrecision + + + char description[VK_MAX_DESCRIPTION_SIZE]Free-form description of the fault + uint64_t vendorFaultCode + uint64_t vendorFaultData + + + VkStructureType sType + void* pNext + uint32_t addressInfoCount + uint32_t vendorInfoCount + VkDeviceSize vendorBinarySizeSpecified in bytes + + + VkStructureType sType + void* pNext + char description[VK_MAX_DESCRIPTION_SIZE]Free-form description of the fault + VkDeviceFaultAddressInfoEXT* pAddressInfos + VkDeviceFaultVendorInfoEXT* pVendorInfos + void* pVendorBinaryData + + + The fields in this structure are non-normative since structure packing is implementation-defined in C. The specification defines the normative layout. + uint32_t headerSize + VkDeviceFaultVendorBinaryHeaderVersionEXT headerVersion + uint32_t vendorID + uint32_t deviceID + uint32_t driverVersion + uint8_t pipelineCacheUUID[VK_UUID_SIZE] + uint32_t applicationNameOffset + uint32_t applicationVersion + uint32_t engineNameOffset + uint32_t engineVersion + uint32_t apiVersion + + + VkStructureType sType + void* pNext + VkBool32 pipelineLibraryGroupHandles + + + VkStructureType sType + const void* pNext + float depthBiasConstantFactor + float depthBiasClamp + float depthBiasSlopeFactor + + + VkStructureType sType + const void* pNext + VkDepthBiasRepresentationEXT depthBiasRepresentation + VkBool32 depthBiasExact + + + VkDeviceAddress srcAddress + VkDeviceAddress dstAddress + VkDeviceSize compressedSizeSpecified in bytes + VkDeviceSize decompressedSizeSpecified in bytes + VkMemoryDecompressionMethodFlagsNV decompressionMethod + + + VkStructureType sType + void* pNext + uint64_t shaderCoreMask + uint32_t shaderCoreCount + uint32_t shaderWarpsPerCore + + + VkStructureType sType + void* pNext + VkBool32 shaderCoreBuiltins + + + VkStructureType sType + const void* pNext + VkFrameBoundaryFlagsEXT flags + uint64_t frameID + uint32_t imageCount + const VkImage* pImages + uint32_t bufferCount + const VkBuffer* pBuffers + uint64_t tagName + size_t tagSize + const void* pTag + + + VkStructureType sType + void* pNext + VkBool32 frameBoundary + + + VkStructureType sType + void* pNext + VkBool32 dynamicRenderingUnusedAttachments + + + VkStructureType sType + void* pNext + VkPresentModeKHR presentMode + + + VkStructureType sType + void* pNext + VkPresentScalingFlagsEXT supportedPresentScaling + VkPresentGravityFlagsEXT supportedPresentGravityX + VkPresentGravityFlagsEXT supportedPresentGravityY + VkExtent2D minScaledImageExtentSupported minimum image width and height for the surface when scaling is used + VkExtent2D maxScaledImageExtentSupported maximum image width and height for the surface when scaling is used + + + VkStructureType sType + void* pNext + uint32_t presentModeCount + VkPresentModeKHR* pPresentModesOutput list of present modes compatible with the one specified in VkSurfacePresentModeEXT + + + VkStructureType sType + void* pNext + VkBool32 swapchainMaintenance1 + + + VkStructureType sType + const void* pNext + uint32_t swapchainCountCopy of VkPresentInfoKHR::swapchainCount + const VkFence* pFencesFence to signal for each swapchain + + + VkStructureType sType + const void* pNext + uint32_t presentModeCountLength of the pPresentModes array + const VkPresentModeKHR* pPresentModesPresentation modes which will be usable with this swapchain + + + VkStructureType sType + const void* pNext + uint32_t swapchainCountCopy of VkPresentInfoKHR::swapchainCount + const VkPresentModeKHR* pPresentModesPresentation mode for each swapchain + + + VkStructureType sType + const void* pNext + VkPresentScalingFlagsEXT scalingBehavior + VkPresentGravityFlagsEXT presentGravityX + VkPresentGravityFlagsEXT presentGravityY + + + VkStructureType sType + const void* pNext + VkSwapchainKHR swapchainSwapchain for which images are being released + uint32_t imageIndexCountNumber of indices to release + const uint32_t* pImageIndicesIndices of which presentable images to release + + + VkStructureType sType + void* pNext + VkBool32 depthBiasControl + VkBool32 leastRepresentableValueForceUnormRepresentation + VkBool32 floatRepresentation + VkBool32 depthBiasExact + + + VkStructureType sType + void* pNext + VkBool32 rayTracingInvocationReorder + + + VkStructureType sType + void* pNext + VkRayTracingInvocationReorderModeNV rayTracingInvocationReorderReorderingHint + + + VkStructureType sType + void* pNext + VkBool32 extendedSparseAddressSpace + + + VkStructureType sType + void* pNext + VkDeviceSize extendedSparseAddressSpaceSizeTotal address space available for extended sparse allocations (bytes) + VkImageUsageFlags extendedSparseImageUsageFlagsBitfield of which image usages are supported for extended sparse allocations + VkBufferUsageFlags extendedSparseBufferUsageFlagsBitfield of which buffer usages are supported for extended sparse allocations + + + VkStructureType sType + void* pNext + VkDirectDriverLoadingFlagsLUNARG flags + PFN_vkGetInstanceProcAddrLUNARG pfnGetInstanceProcAddr + + + VkStructureType sType + const void* pNext + VkDirectDriverLoadingModeLUNARG mode + uint32_t driverCount + const VkDirectDriverLoadingInfoLUNARG* pDrivers + + + VkStructureType sType + void* pNext + VkBool32 multiviewPerViewViewports + + + VkStructureType sType + void* pNext + VkBool32 rayTracingPositionFetch + + + VkStructureType sType + const void* pNext + const VkImageCreateInfo* pCreateInfo + const VkImageSubresource2* pSubresource + + + + VkStructureType sType + void* pNext + uint32_t pixelRate + uint32_t texelRate + uint32_t fmaRate + + + VkStructureType sType + void* pNext + VkBool32 multiviewPerViewRenderAreas + + + VkStructureType sType + const void* pNext + uint32_t perViewRenderAreaCount + const VkRect2D* pPerViewRenderAreas + + + VkStructureType sType + const void* pNext + void* pQueriedLowLatencyData + + + VkStructureType sType + const void* pNext + VkMemoryMapFlags flags + VkDeviceMemory memory + VkDeviceSize offset + VkDeviceSize size + + + + VkStructureType sType + const void* pNext + VkMemoryUnmapFlags flags + VkDeviceMemory memory + + + + VkStructureType sType + void* pNext + VkBool32 shaderObject + + + VkStructureType sType + void* pNext + uint8_t shaderBinaryUUID[VK_UUID_SIZE] + uint32_t shaderBinaryVersion + + + VkStructureType sType + const void* pNext + VkShaderCreateFlagsEXT flags + VkShaderStageFlagBits stage + VkShaderStageFlags nextStage + VkShaderCodeTypeEXT codeType + size_t codeSize + const void* pCode + const char* pName + uint32_t setLayoutCount + const VkDescriptorSetLayout* pSetLayouts + uint32_t pushConstantRangeCount + const VkPushConstantRange* pPushConstantRanges + const VkSpecializationInfo* pSpecializationInfo + + + VkStructureType sType + void* pNext + VkBool32 shaderTileImageColorReadAccess + VkBool32 shaderTileImageDepthReadAccess + VkBool32 shaderTileImageStencilReadAccess + + + VkStructureType sType + void* pNext + VkBool32 shaderTileImageCoherentReadAccelerated + VkBool32 shaderTileImageReadSampleFromPixelRateInvocation + VkBool32 shaderTileImageReadFromHelperInvocation + + + VkStructureType sType + const void* pNext + struct _screen_buffer* buffer + + + VkStructureType sType + void* pNext + VkDeviceSize allocationSize + uint32_t memoryTypeBits + + + VkStructureType sType + void* pNext + VkFormat format + uint64_t externalFormat + uint64_t screenUsage + VkFormatFeatureFlags formatFeatures + VkComponentMapping samplerYcbcrConversionComponents + VkSamplerYcbcrModelConversion suggestedYcbcrModel + VkSamplerYcbcrRange suggestedYcbcrRange + VkChromaLocation suggestedXChromaOffset + VkChromaLocation suggestedYChromaOffset + + + VkStructureType sType + void* pNext + uint64_t externalFormat + + + VkStructureType sType + void* pNext + VkBool32 screenBufferImport + + + VkStructureType sType + void* pNext + VkBool32 cooperativeMatrix + VkBool32 cooperativeMatrixRobustBufferAccess + + + VkStructureType sType + void* pNext + uint32_t MSize + uint32_t NSize + uint32_t KSize + VkComponentTypeKHR AType + VkComponentTypeKHR BType + VkComponentTypeKHR CType + VkComponentTypeKHR ResultType + VkBool32 saturatingAccumulation + VkScopeKHR scope + + + VkStructureType sType + void* pNext + VkShaderStageFlags cooperativeMatrixSupportedStages + + + VkStructureType sType + void* pNext + uint32_t maxExecutionGraphDepth + uint32_t maxExecutionGraphShaderOutputNodes + uint32_t maxExecutionGraphShaderPayloadSize + uint32_t maxExecutionGraphShaderPayloadCount + uint32_t executionGraphDispatchAddressAlignment + uint32_t maxExecutionGraphWorkgroupCount[3] + uint32_t maxExecutionGraphWorkgroups + + + VkStructureType sType + void* pNext + VkBool32 shaderEnqueue + VkBool32 shaderMeshEnqueue + + + VkStructureType sType + const void* pNext + VkPipelineCreateFlags flags + uint32_t stageCount + const VkPipelineShaderStageCreateInfo* pStages + const VkPipelineLibraryCreateInfoKHR* pLibraryInfo + VkPipelineLayout layout + VkPipeline basePipelineHandle + int32_t basePipelineIndex + + + VkStructureType sType + const void* pNext + const char* pName + uint32_t index + + + VkStructureType sType + void* pNext + VkDeviceSize minSize + VkDeviceSize maxSize + VkDeviceSize sizeGranularity + + + uint32_t nodeIndex + uint32_t payloadCount + VkDeviceOrHostAddressConstAMDX payloads + uint64_t payloadStride + + + uint32_t count + VkDeviceOrHostAddressConstAMDX infos + uint64_t stride + + + VkStructureType sType + void* pNext + VkBool32 antiLag + + + VkStructureType sType + const void* pNext + VkAntiLagModeAMD mode + uint32_t maxFPS + const VkAntiLagPresentationInfoAMD* pPresentationInfo + + + VkStructureType sType + void* pNext + VkAntiLagStageAMD stage + uint64_t frameIndex + + + VkStructureType sType + const void* pNext + VkResult* pResult + + + + VkStructureType sType + const void* pNext + VkShaderStageFlags stageFlags + VkPipelineLayout layout + uint32_t firstSet + uint32_t descriptorSetCount + const VkDescriptorSet* pDescriptorSets + uint32_t dynamicOffsetCount + const uint32_t* pDynamicOffsets + + + + VkStructureType sType + const void* pNext + VkPipelineLayout layout + VkShaderStageFlags stageFlags + uint32_t offset + uint32_t size + const void* pValues + + + + VkStructureType sType + const void* pNext + VkShaderStageFlags stageFlags + VkPipelineLayout layout + uint32_t set + uint32_t descriptorWriteCount + const VkWriteDescriptorSet* pDescriptorWrites + + + + VkStructureType sType + const void* pNext + VkDescriptorUpdateTemplate descriptorUpdateTemplate + VkPipelineLayout layout + uint32_t set + const void* pData + + + + VkStructureType sType + const void* pNext + VkShaderStageFlags stageFlags + VkPipelineLayout layout + uint32_t firstSet + uint32_t setCount + const uint32_t* pBufferIndices + const VkDeviceSize* pOffsets + + + VkStructureType sType + const void* pNext + VkShaderStageFlags stageFlags + VkPipelineLayout layout + uint32_t set + + + VkStructureType sType + void* pNext + VkBool32 cubicRangeClamp + + + VkStructureType sType + void* pNext + VkBool32 ycbcrDegamma + + + VkStructureType sType + void* pNext + VkBool32 enableYDegamma + VkBool32 enableCbCrDegamma + + + VkStructureType sType + void* pNext + VkBool32 selectableCubicWeights + + + VkStructureType sType + const void* pNext + VkCubicFilterWeightsQCOM cubicWeights + + + VkStructureType sType + const void* pNext + VkCubicFilterWeightsQCOM cubicWeights + + + VkStructureType sType + void* pNext + VkBool32 textureBlockMatch2 + + + VkStructureType sType + void* pNext + VkExtent2D maxBlockMatchWindow + + + VkStructureType sType + const void* pNext + VkExtent2D windowExtent + VkBlockMatchWindowCompareModeQCOM windowCompareMode + + + VkStructureType sType + void* pNext + VkBool32 descriptorPoolOverallocation + + + VkStructureType sType + void* pNext + VkLayeredDriverUnderlyingApiMSFT underlyingAPI + + + VkStructureType sType + void* pNext + VkBool32 perStageDescriptorSet + VkBool32 dynamicPipelineLayout + + + VkStructureType sType + void* pNext + VkBool32 externalFormatResolve + + + VkStructureType sType + void* pNext + VkBool32 nullColorAttachmentWithExternalFormatResolve + VkChromaLocation externalFormatResolveChromaOffsetX + VkChromaLocation externalFormatResolveChromaOffsetY + + + VkStructureType sType + void* pNext + VkFormat colorAttachmentFormat + + + VkStructureType sType + const void* pNext + VkBool32 lowLatencyMode + VkBool32 lowLatencyBoost + uint32_t minimumIntervalUs + + + VkStructureType sType + const void* pNext + VkSemaphore signalSemaphore + uint64_t value + + + VkStructureType sType + const void* pNext + uint64_t presentID + VkLatencyMarkerNV marker + + + VkStructureType sType + const void* pNext + uint32_t timingCount + VkLatencyTimingsFrameReportNV* pTimings + + + VkStructureType sType + const void* pNext + uint64_t presentID + uint64_t inputSampleTimeUs + uint64_t simStartTimeUs + uint64_t simEndTimeUs + uint64_t renderSubmitStartTimeUs + uint64_t renderSubmitEndTimeUs + uint64_t presentStartTimeUs + uint64_t presentEndTimeUs + uint64_t driverStartTimeUs + uint64_t driverEndTimeUs + uint64_t osRenderQueueStartTimeUs + uint64_t osRenderQueueEndTimeUs + uint64_t gpuRenderStartTimeUs + uint64_t gpuRenderEndTimeUs + + + VkStructureType sType + const void* pNext + VkOutOfBandQueueTypeNV queueType + + + VkStructureType sType + const void* pNext + uint64_t presentID + + + VkStructureType sType + const void* pNext + VkBool32 latencyModeEnable + + + VkStructureType sType + const void* pNext + uint32_t presentModeCount + VkPresentModeKHR* pPresentModes + + + VkStructureType sType + void* pNext + VkBool32 cudaKernelLaunchFeatures + + + VkStructureType sType + void* pNext + uint32_t computeCapabilityMinor + uint32_t computeCapabilityMajor + + + VkStructureType sType + void* pNext + uint32_t shaderCoreCount + + + VkStructureType sType + void* pNext + VkBool32 schedulingControls + + + VkStructureType sType + void* pNext + VkPhysicalDeviceSchedulingControlsFlagsARM schedulingControlsFlags + + + VkStructureType sType + void* pNext + VkBool32 relaxedLineRasterization + + + VkStructureType sType + void* pNext + VkBool32 renderPassStriped + + + VkStructureType sType + void* pNext + VkExtent2D renderPassStripeGranularity + uint32_t maxRenderPassStripes + + + VkStructureType sType + const void* pNext + VkRect2D stripeArea + + + VkStructureType sType + const void* pNext + uint32_t stripeInfoCount + const VkRenderPassStripeInfoARM* pStripeInfos + + + VkStructureType sType + const void* pNext + uint32_t stripeSemaphoreInfoCount + const VkSemaphoreSubmitInfo* pStripeSemaphoreInfos + + + VkStructureType sType + void* pNext + VkBool32 shaderMaximalReconvergence + + + VkStructureType sType + void* pNext + VkBool32 shaderSubgroupRotate + VkBool32 shaderSubgroupRotateClustered + + + + VkStructureType sType + void* pNext + VkBool32 shaderExpectAssume + + + + VkStructureType sType + void* pNext + VkBool32 shaderFloatControls2 + + + + VkStructureType sType + void* pNext + VkBool32 dynamicRenderingLocalRead + + + + VkStructureType sType + const void* pNext + uint32_t colorAttachmentCount + const uint32_t* pColorAttachmentLocations + + + + VkStructureType sType + const void* pNext + uint32_t colorAttachmentCount + const uint32_t* pColorAttachmentInputIndices + const uint32_t* pDepthInputAttachmentIndex + const uint32_t* pStencilInputAttachmentIndex + + + + VkStructureType sType + void* pNext + VkBool32 shaderQuadControl + + + VkStructureType sType + void* pNext + VkBool32 shaderFloat16VectorAtomics + + + VkStructureType sType + void* pNext + VkBool32 memoryMapPlaced + VkBool32 memoryMapRangePlaced + VkBool32 memoryUnmapReserve + + + VkStructureType sType + void* pNext + VkDeviceSize minPlacedMemoryMapAlignment + + + VkStructureType sType + const void* pNext + void* pPlacedAddress + + + VkStructureType sType + void* pNext + VkBool32 shaderRawAccessChains + + + VkStructureType sType + void* pNext + VkBool32 commandBufferInheritance + + + VkStructureType sType + void* pNext + VkBool32 imageAlignmentControl + + + VkStructureType sType + void* pNext + uint32_t supportedImageAlignmentMask + + + VkStructureType sType + const void* pNext + uint32_t maximumRequestedAlignment + + + VkStructureType sType + void* pNext + VkBool32 shaderReplicatedComposites + + + VkStructureType sType + void* pNext + VkBool32 presentModeFifoLatestReady + + + float minDepthClamp + float maxDepthClamp + + + VkStructureType sType + void* pNext + VkBool32 cooperativeMatrixWorkgroupScope + VkBool32 cooperativeMatrixFlexibleDimensions + VkBool32 cooperativeMatrixReductions + VkBool32 cooperativeMatrixConversions + VkBool32 cooperativeMatrixPerElementOperations + VkBool32 cooperativeMatrixTensorAddressing + VkBool32 cooperativeMatrixBlockLoads + + + VkStructureType sType + void* pNext + uint32_t cooperativeMatrixWorkgroupScopeMaxWorkgroupSize + uint32_t cooperativeMatrixFlexibleDimensionsMaxDimension + uint32_t cooperativeMatrixWorkgroupScopeReservedSharedMemory + + + VkStructureType sType + void* pNext + uint32_t MGranularity + uint32_t NGranularity + uint32_t KGranularity + VkComponentTypeKHR AType + VkComponentTypeKHR BType + VkComponentTypeKHR CType + VkComponentTypeKHR ResultType + VkBool32 saturatingAccumulation + VkScopeKHR scope + uint32_t workgroupInvocations + + + VkStructureType sType + void* pNext + VkBool32 hdrVivid + + + VkStructureType sType + void* pNext + VkBool32 vertexAttributeRobustness + + + + + Vulkan enumerant (token) definitions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unlike OpenGL, most tokens in Vulkan are actual typed enumerants in + their own numeric namespaces. The "name" attribute is the C enum + type name, and is pulled in from a type tag definition above + (slightly clunky, but retains the type / enum distinction). "type" + attributes of "enum" or "bitmask" indicate that these values should + be generated inside an appropriate definition. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + value="4" reserved for VK_KHR_sampler_mirror_clamp_to_edge + enum VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE; do not + alias! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Return codes (positive values) + + + + + + + Error codes (negative values) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Flags + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WSI Extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NVX_device_generated_commands formerly used these enum values, but that extension has been removed + value 31 / name VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT + value 32 / name VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Vendor IDs are now represented as enums instead of the old + <vendorids> tag, allowing them to be included in the + API headers. + + + + + + + + + + + + Driver IDs are now represented as enums instead of the old + <driverids> tag, allowing them to be included in the + API headers. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bitpos 17-31 are specified by extensions to the original VkAccessFlagBits enum + + + + + + + + + + + + + + + + + + + + + + + + + bitpos 17-31 are specified by extensions to the original VkPipelineStageFlagBits enum + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bitpos 13 is an extension interaction with VK_EXT_filter_cubic" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VkResult vkCreateInstance + const VkInstanceCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkInstance* pInstance + + + void vkDestroyInstance + VkInstance instance + const VkAllocationCallbacks* pAllocator + + all sname:VkPhysicalDevice objects enumerated from pname:instance + + + + VkResult vkEnumeratePhysicalDevices + VkInstance instance + uint32_t* pPhysicalDeviceCount + VkPhysicalDevice* pPhysicalDevices + + + PFN_vkVoidFunction vkGetDeviceProcAddr + VkDevice device + const char* pName + + + PFN_vkVoidFunction vkGetInstanceProcAddr + VkInstance instance + const char* pName + + + void vkGetPhysicalDeviceProperties + VkPhysicalDevice physicalDevice + VkPhysicalDeviceProperties* pProperties + + + void vkGetPhysicalDeviceQueueFamilyProperties + VkPhysicalDevice physicalDevice + uint32_t* pQueueFamilyPropertyCount + VkQueueFamilyProperties* pQueueFamilyProperties + + + void vkGetPhysicalDeviceMemoryProperties + VkPhysicalDevice physicalDevice + VkPhysicalDeviceMemoryProperties* pMemoryProperties + + + void vkGetPhysicalDeviceFeatures + VkPhysicalDevice physicalDevice + VkPhysicalDeviceFeatures* pFeatures + + + void vkGetPhysicalDeviceFormatProperties + VkPhysicalDevice physicalDevice + VkFormat format + VkFormatProperties* pFormatProperties + + + VkResult vkGetPhysicalDeviceImageFormatProperties + VkPhysicalDevice physicalDevice + VkFormat format + VkImageType type + VkImageTiling tiling + VkImageUsageFlags usage + VkImageCreateFlags flags + VkImageFormatProperties* pImageFormatProperties + + + VkResult vkCreateDevice + VkPhysicalDevice physicalDevice + const VkDeviceCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDevice* pDevice + + + VkResult vkCreateDevice + VkPhysicalDevice physicalDevice + const VkDeviceCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDevice* pDevice + + + void vkDestroyDevice + VkDevice device + const VkAllocationCallbacks* pAllocator + + all sname:VkQueue objects created from pname:device + + + + VkResult vkEnumerateInstanceVersion + uint32_t* pApiVersion + + + VkResult vkEnumerateInstanceLayerProperties + uint32_t* pPropertyCount + VkLayerProperties* pProperties + + + VkResult vkEnumerateInstanceExtensionProperties + const char* pLayerName + uint32_t* pPropertyCount + VkExtensionProperties* pProperties + + + VkResult vkEnumerateDeviceLayerProperties + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkLayerProperties* pProperties + + + VkResult vkEnumerateDeviceLayerProperties + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkLayerProperties* pProperties + + + + VkResult vkEnumerateDeviceExtensionProperties + VkPhysicalDevice physicalDevice + const char* pLayerName + uint32_t* pPropertyCount + VkExtensionProperties* pProperties + + + void vkGetDeviceQueue + VkDevice device + uint32_t queueFamilyIndex + uint32_t queueIndex + VkQueue* pQueue + + + VkResult vkQueueSubmit + VkQueue queue + uint32_t submitCount + const VkSubmitInfo* pSubmits + VkFence fence + + + VkResult vkQueueWaitIdle + VkQueue queue + + + VkResult vkDeviceWaitIdle + VkDevice device + + all sname:VkQueue objects created from pname:device + + + + VkResult vkAllocateMemory + VkDevice device + const VkMemoryAllocateInfo* pAllocateInfo + const VkAllocationCallbacks* pAllocator + VkDeviceMemory* pMemory + + + void vkFreeMemory + VkDevice device + VkDeviceMemory memory + const VkAllocationCallbacks* pAllocator + + + VkResult vkMapMemory + VkDevice device + VkDeviceMemory memory + VkDeviceSize offset + VkDeviceSize size + VkMemoryMapFlags flags + void** ppData + + + void vkUnmapMemory + VkDevice device + VkDeviceMemory memory + + + VkResult vkFlushMappedMemoryRanges + VkDevice device + uint32_t memoryRangeCount + const VkMappedMemoryRange* pMemoryRanges + + + VkResult vkInvalidateMappedMemoryRanges + VkDevice device + uint32_t memoryRangeCount + const VkMappedMemoryRange* pMemoryRanges + + + void vkGetDeviceMemoryCommitment + VkDevice device + VkDeviceMemory memory + VkDeviceSize* pCommittedMemoryInBytes + + + void vkGetBufferMemoryRequirements + VkDevice device + VkBuffer buffer + VkMemoryRequirements* pMemoryRequirements + + + VkResult vkBindBufferMemory + VkDevice device + VkBuffer buffer + VkDeviceMemory memory + VkDeviceSize memoryOffset + + + void vkGetImageMemoryRequirements + VkDevice device + VkImage image + VkMemoryRequirements* pMemoryRequirements + + + VkResult vkBindImageMemory + VkDevice device + VkImage image + VkDeviceMemory memory + VkDeviceSize memoryOffset + + + void vkGetImageSparseMemoryRequirements + VkDevice device + VkImage image + uint32_t* pSparseMemoryRequirementCount + VkSparseImageMemoryRequirements* pSparseMemoryRequirements + + + void vkGetPhysicalDeviceSparseImageFormatProperties + VkPhysicalDevice physicalDevice + VkFormat format + VkImageType type + VkSampleCountFlagBits samples + VkImageUsageFlags usage + VkImageTiling tiling + uint32_t* pPropertyCount + VkSparseImageFormatProperties* pProperties + + + VkResult vkQueueBindSparse + VkQueue queue + uint32_t bindInfoCount + const VkBindSparseInfo* pBindInfo + VkFence fence + + + VkResult vkCreateFence + VkDevice device + const VkFenceCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkFence* pFence + + + void vkDestroyFence + VkDevice device + VkFence fence + const VkAllocationCallbacks* pAllocator + + + VkResult vkResetFences + VkDevice device + uint32_t fenceCount + const VkFence* pFences + + + VkResult vkGetFenceStatus + VkDevice device + VkFence fence + + + VkResult vkWaitForFences + VkDevice device + uint32_t fenceCount + const VkFence* pFences + VkBool32 waitAll + uint64_t timeout + + + VkResult vkCreateSemaphore + VkDevice device + const VkSemaphoreCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSemaphore* pSemaphore + + + void vkDestroySemaphore + VkDevice device + VkSemaphore semaphore + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateEvent + VkDevice device + const VkEventCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkEvent* pEvent + + + void vkDestroyEvent + VkDevice device + VkEvent event + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetEventStatus + VkDevice device + VkEvent event + + + VkResult vkSetEvent + VkDevice device + VkEvent event + + + VkResult vkResetEvent + VkDevice device + VkEvent event + + + VkResult vkCreateQueryPool + VkDevice device + const VkQueryPoolCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkQueryPool* pQueryPool + + + void vkDestroyQueryPool + VkDevice device + VkQueryPool queryPool + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetQueryPoolResults + VkDevice device + VkQueryPool queryPool + uint32_t firstQuery + uint32_t queryCount + size_t dataSize + void* pData + VkDeviceSize stride + VkQueryResultFlags flags + + + void vkResetQueryPool + VkDevice device + VkQueryPool queryPool + uint32_t firstQuery + uint32_t queryCount + + + + VkResult vkCreateBuffer + VkDevice device + const VkBufferCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkBuffer* pBuffer + + + void vkDestroyBuffer + VkDevice device + VkBuffer buffer + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateBufferView + VkDevice device + const VkBufferViewCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkBufferView* pView + + + void vkDestroyBufferView + VkDevice device + VkBufferView bufferView + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateImage + VkDevice device + const VkImageCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkImage* pImage + + + void vkDestroyImage + VkDevice device + VkImage image + const VkAllocationCallbacks* pAllocator + + + void vkGetImageSubresourceLayout + VkDevice device + VkImage image + const VkImageSubresource* pSubresource + VkSubresourceLayout* pLayout + + + VkResult vkCreateImageView + VkDevice device + const VkImageViewCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkImageView* pView + + + void vkDestroyImageView + VkDevice device + VkImageView imageView + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateShaderModule + VkDevice device + const VkShaderModuleCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkShaderModule* pShaderModule + + + void vkDestroyShaderModule + VkDevice device + VkShaderModule shaderModule + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreatePipelineCache + VkDevice device + const VkPipelineCacheCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkPipelineCache* pPipelineCache + + + VkResult vkCreatePipelineCache + VkDevice device + const VkPipelineCacheCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkPipelineCache* pPipelineCache + + + void vkDestroyPipelineCache + VkDevice device + VkPipelineCache pipelineCache + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetPipelineCacheData + VkDevice device + VkPipelineCache pipelineCache + size_t* pDataSize + void* pData + + + VkResult vkMergePipelineCaches + VkDevice device + VkPipelineCache dstCache + uint32_t srcCacheCount + const VkPipelineCache* pSrcCaches + + + VkResult vkCreatePipelineBinariesKHR + VkDevice device + const VkPipelineBinaryCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkPipelineBinaryHandlesInfoKHR* pBinaries + + + void vkDestroyPipelineBinaryKHR + VkDevice device + VkPipelineBinaryKHR pipelineBinary + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetPipelineKeyKHR + VkDevice device + const VkPipelineCreateInfoKHR* pPipelineCreateInfo + VkPipelineBinaryKeyKHR* pPipelineKey + + + VkResult vkGetPipelineBinaryDataKHR + VkDevice device + const VkPipelineBinaryDataInfoKHR* pInfo + VkPipelineBinaryKeyKHR* pPipelineBinaryKey + size_t* pPipelineBinaryDataSize + void* pPipelineBinaryData + + + VkResult vkReleaseCapturedPipelineDataKHR + VkDevice device + const VkReleaseCapturedPipelineDataInfoKHR* pInfo + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateGraphicsPipelines + VkDevice device + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkGraphicsPipelineCreateInfo* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + + VkResult vkCreateGraphicsPipelines + VkDevice device + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkGraphicsPipelineCreateInfo* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + + VkResult vkCreateComputePipelines + VkDevice device + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkComputePipelineCreateInfo* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + + VkResult vkCreateComputePipelines + VkDevice device + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkComputePipelineCreateInfo* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + + VkResult vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI + VkDevice device + VkRenderPass renderpass + VkExtent2D* pMaxWorkgroupSize + + + void vkDestroyPipeline + VkDevice device + VkPipeline pipeline + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreatePipelineLayout + VkDevice device + const VkPipelineLayoutCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkPipelineLayout* pPipelineLayout + + + void vkDestroyPipelineLayout + VkDevice device + VkPipelineLayout pipelineLayout + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateSampler + VkDevice device + const VkSamplerCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSampler* pSampler + + + void vkDestroySampler + VkDevice device + VkSampler sampler + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateDescriptorSetLayout + VkDevice device + const VkDescriptorSetLayoutCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDescriptorSetLayout* pSetLayout + + + void vkDestroyDescriptorSetLayout + VkDevice device + VkDescriptorSetLayout descriptorSetLayout + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateDescriptorPool + VkDevice device + const VkDescriptorPoolCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDescriptorPool* pDescriptorPool + + + void vkDestroyDescriptorPool + VkDevice device + VkDescriptorPool descriptorPool + const VkAllocationCallbacks* pAllocator + + + VkResult vkResetDescriptorPool + VkDevice device + VkDescriptorPool descriptorPool + VkDescriptorPoolResetFlags flags + + any sname:VkDescriptorSet objects allocated from pname:descriptorPool + + + + VkResult vkAllocateDescriptorSets + VkDevice device + const VkDescriptorSetAllocateInfo* pAllocateInfo + VkDescriptorSet* pDescriptorSets + + + VkResult vkFreeDescriptorSets + VkDevice device + VkDescriptorPool descriptorPool + uint32_t descriptorSetCount + const VkDescriptorSet* pDescriptorSets + + + void vkUpdateDescriptorSets + VkDevice device + uint32_t descriptorWriteCount + const VkWriteDescriptorSet* pDescriptorWrites + uint32_t descriptorCopyCount + const VkCopyDescriptorSet* pDescriptorCopies + + + VkResult vkCreateFramebuffer + VkDevice device + const VkFramebufferCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkFramebuffer* pFramebuffer + + + void vkDestroyFramebuffer + VkDevice device + VkFramebuffer framebuffer + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateRenderPass + VkDevice device + const VkRenderPassCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkRenderPass* pRenderPass + + + void vkDestroyRenderPass + VkDevice device + VkRenderPass renderPass + const VkAllocationCallbacks* pAllocator + + + void vkGetRenderAreaGranularity + VkDevice device + VkRenderPass renderPass + VkExtent2D* pGranularity + + + void vkGetRenderingAreaGranularity + VkDevice device + const VkRenderingAreaInfo* pRenderingAreaInfo + VkExtent2D* pGranularity + + + + VkResult vkCreateCommandPool + VkDevice device + const VkCommandPoolCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkCommandPool* pCommandPool + + + void vkDestroyCommandPool + VkDevice device + VkCommandPool commandPool + const VkAllocationCallbacks* pAllocator + + + VkResult vkResetCommandPool + VkDevice device + VkCommandPool commandPool + VkCommandPoolResetFlags flags + + + VkResult vkAllocateCommandBuffers + VkDevice device + const VkCommandBufferAllocateInfo* pAllocateInfo + VkCommandBuffer* pCommandBuffers + + + void vkFreeCommandBuffers + VkDevice device + VkCommandPool commandPool + uint32_t commandBufferCount + const VkCommandBuffer* pCommandBuffers + + + VkResult vkBeginCommandBuffer + VkCommandBuffer commandBuffer + const VkCommandBufferBeginInfo* pBeginInfo + + the sname:VkCommandPool that pname:commandBuffer was allocated from + + + + VkResult vkEndCommandBuffer + VkCommandBuffer commandBuffer + + the sname:VkCommandPool that pname:commandBuffer was allocated from + + + + VkResult vkResetCommandBuffer + VkCommandBuffer commandBuffer + VkCommandBufferResetFlags flags + + the sname:VkCommandPool that pname:commandBuffer was allocated from + + + + void vkCmdBindPipeline + VkCommandBuffer commandBuffer + VkPipelineBindPoint pipelineBindPoint + VkPipeline pipeline + + + void vkCmdSetAttachmentFeedbackLoopEnableEXT + VkCommandBuffer commandBuffer + VkImageAspectFlags aspectMask + + + void vkCmdSetViewport + VkCommandBuffer commandBuffer + uint32_t firstViewport + uint32_t viewportCount + const VkViewport* pViewports + + + void vkCmdSetScissor + VkCommandBuffer commandBuffer + uint32_t firstScissor + uint32_t scissorCount + const VkRect2D* pScissors + + + void vkCmdSetLineWidth + VkCommandBuffer commandBuffer + float lineWidth + + + void vkCmdSetDepthBias + VkCommandBuffer commandBuffer + float depthBiasConstantFactor + float depthBiasClamp + float depthBiasSlopeFactor + + + void vkCmdSetBlendConstants + VkCommandBuffer commandBuffer + const float blendConstants[4] + + + void vkCmdSetDepthBounds + VkCommandBuffer commandBuffer + float minDepthBounds + float maxDepthBounds + + + void vkCmdSetStencilCompareMask + VkCommandBuffer commandBuffer + VkStencilFaceFlags faceMask + uint32_t compareMask + + + void vkCmdSetStencilWriteMask + VkCommandBuffer commandBuffer + VkStencilFaceFlags faceMask + uint32_t writeMask + + + void vkCmdSetStencilReference + VkCommandBuffer commandBuffer + VkStencilFaceFlags faceMask + uint32_t reference + + + void vkCmdBindDescriptorSets + VkCommandBuffer commandBuffer + VkPipelineBindPoint pipelineBindPoint + VkPipelineLayout layout + uint32_t firstSet + uint32_t descriptorSetCount + const VkDescriptorSet* pDescriptorSets + uint32_t dynamicOffsetCount + const uint32_t* pDynamicOffsets + + + void vkCmdBindIndexBuffer + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + VkIndexType indexType + + + void vkCmdBindVertexBuffers + VkCommandBuffer commandBuffer + uint32_t firstBinding + uint32_t bindingCount + const VkBuffer* pBuffers + const VkDeviceSize* pOffsets + + + void vkCmdDraw + VkCommandBuffer commandBuffer + uint32_t vertexCount + uint32_t instanceCount + uint32_t firstVertex + uint32_t firstInstance + + + void vkCmdDrawIndexed + VkCommandBuffer commandBuffer + uint32_t indexCount + uint32_t instanceCount + uint32_t firstIndex + int32_t vertexOffset + uint32_t firstInstance + + + void vkCmdDrawMultiEXT + VkCommandBuffer commandBuffer + uint32_t drawCount + const VkMultiDrawInfoEXT* pVertexInfo + uint32_t instanceCount + uint32_t firstInstance + uint32_t stride + + + void vkCmdDrawMultiIndexedEXT + VkCommandBuffer commandBuffer + uint32_t drawCount + const VkMultiDrawIndexedInfoEXT* pIndexInfo + uint32_t instanceCount + uint32_t firstInstance + uint32_t stride + const int32_t* pVertexOffset + + + void vkCmdDrawIndirect + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + uint32_t drawCount + uint32_t stride + + + void vkCmdDrawIndexedIndirect + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + uint32_t drawCount + uint32_t stride + + + void vkCmdDispatch + VkCommandBuffer commandBuffer + uint32_t groupCountX + uint32_t groupCountY + uint32_t groupCountZ + + + void vkCmdDispatchIndirect + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + + + void vkCmdSubpassShadingHUAWEI + VkCommandBuffer commandBuffer + + + void vkCmdDrawClusterHUAWEI + VkCommandBuffer commandBuffer + uint32_t groupCountX + uint32_t groupCountY + uint32_t groupCountZ + + + void vkCmdDrawClusterIndirectHUAWEI + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + + + void vkCmdUpdatePipelineIndirectBufferNV + VkCommandBuffer commandBuffer + VkPipelineBindPoint pipelineBindPoint + VkPipeline pipeline + + + void vkCmdCopyBuffer + VkCommandBuffer commandBuffer + VkBuffer srcBuffer + VkBuffer dstBuffer + uint32_t regionCount + const VkBufferCopy* pRegions + + + void vkCmdCopyImage + VkCommandBuffer commandBuffer + VkImage srcImage + VkImageLayout srcImageLayout + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkImageCopy* pRegions + + + void vkCmdBlitImage + VkCommandBuffer commandBuffer + VkImage srcImage + VkImageLayout srcImageLayout + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkImageBlit* pRegions + VkFilter filter + + + void vkCmdCopyBufferToImage + VkCommandBuffer commandBuffer + VkBuffer srcBuffer + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkBufferImageCopy* pRegions + + + void vkCmdCopyImageToBuffer + VkCommandBuffer commandBuffer + VkImage srcImage + VkImageLayout srcImageLayout + VkBuffer dstBuffer + uint32_t regionCount + const VkBufferImageCopy* pRegions + + + void vkCmdCopyMemoryIndirectNV + VkCommandBuffer commandBuffer + VkDeviceAddress copyBufferAddress + uint32_t copyCount + uint32_t stride + + + void vkCmdCopyMemoryToImageIndirectNV + VkCommandBuffer commandBuffer + VkDeviceAddress copyBufferAddress + uint32_t copyCount + uint32_t stride + VkImage dstImage + VkImageLayout dstImageLayout + const VkImageSubresourceLayers* pImageSubresources + + + void vkCmdUpdateBuffer + VkCommandBuffer commandBuffer + VkBuffer dstBuffer + VkDeviceSize dstOffset + VkDeviceSize dataSize + const void* pData + + + void vkCmdFillBuffer + VkCommandBuffer commandBuffer + VkBuffer dstBuffer + VkDeviceSize dstOffset + VkDeviceSize size + uint32_t data + + + void vkCmdClearColorImage + VkCommandBuffer commandBuffer + VkImage image + VkImageLayout imageLayout + const VkClearColorValue* pColor + uint32_t rangeCount + const VkImageSubresourceRange* pRanges + + + void vkCmdClearDepthStencilImage + VkCommandBuffer commandBuffer + VkImage image + VkImageLayout imageLayout + const VkClearDepthStencilValue* pDepthStencil + uint32_t rangeCount + const VkImageSubresourceRange* pRanges + + + void vkCmdClearAttachments + VkCommandBuffer commandBuffer + uint32_t attachmentCount + const VkClearAttachment* pAttachments + uint32_t rectCount + const VkClearRect* pRects + + + void vkCmdResolveImage + VkCommandBuffer commandBuffer + VkImage srcImage + VkImageLayout srcImageLayout + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkImageResolve* pRegions + + + void vkCmdSetEvent + VkCommandBuffer commandBuffer + VkEvent event + VkPipelineStageFlags stageMask + + + void vkCmdResetEvent + VkCommandBuffer commandBuffer + VkEvent event + VkPipelineStageFlags stageMask + + + void vkCmdWaitEvents + VkCommandBuffer commandBuffer + uint32_t eventCount + const VkEvent* pEvents + VkPipelineStageFlags srcStageMask + VkPipelineStageFlags dstStageMask + uint32_t memoryBarrierCount + const VkMemoryBarrier* pMemoryBarriers + uint32_t bufferMemoryBarrierCount + const VkBufferMemoryBarrier* pBufferMemoryBarriers + uint32_t imageMemoryBarrierCount + const VkImageMemoryBarrier* pImageMemoryBarriers + + + void vkCmdPipelineBarrier + VkCommandBuffer commandBuffer + VkPipelineStageFlags srcStageMask + VkPipelineStageFlags dstStageMask + VkDependencyFlags dependencyFlags + uint32_t memoryBarrierCount + const VkMemoryBarrier* pMemoryBarriers + uint32_t bufferMemoryBarrierCount + const VkBufferMemoryBarrier* pBufferMemoryBarriers + uint32_t imageMemoryBarrierCount + const VkImageMemoryBarrier* pImageMemoryBarriers + + + void vkCmdBeginQuery + VkCommandBuffer commandBuffer + VkQueryPool queryPool + uint32_t query + VkQueryControlFlags flags + + + void vkCmdEndQuery + VkCommandBuffer commandBuffer + VkQueryPool queryPool + uint32_t query + + + void vkCmdBeginConditionalRenderingEXT + VkCommandBuffer commandBuffer + const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin + + + void vkCmdEndConditionalRenderingEXT + VkCommandBuffer commandBuffer + + + void vkCmdResetQueryPool + VkCommandBuffer commandBuffer + VkQueryPool queryPool + uint32_t firstQuery + uint32_t queryCount + + + void vkCmdWriteTimestamp + VkCommandBuffer commandBuffer + VkPipelineStageFlagBits pipelineStage + VkQueryPool queryPool + uint32_t query + + + void vkCmdCopyQueryPoolResults + VkCommandBuffer commandBuffer + VkQueryPool queryPool + uint32_t firstQuery + uint32_t queryCount + VkBuffer dstBuffer + VkDeviceSize dstOffset + VkDeviceSize stride + VkQueryResultFlags flags + + + void vkCmdPushConstants + VkCommandBuffer commandBuffer + VkPipelineLayout layout + VkShaderStageFlags stageFlags + uint32_t offset + uint32_t size + const void* pValues + + + void vkCmdBeginRenderPass + VkCommandBuffer commandBuffer + const VkRenderPassBeginInfo* pRenderPassBegin + VkSubpassContents contents + + + void vkCmdNextSubpass + VkCommandBuffer commandBuffer + VkSubpassContents contents + + + void vkCmdEndRenderPass + VkCommandBuffer commandBuffer + + + void vkCmdExecuteCommands + VkCommandBuffer commandBuffer + uint32_t commandBufferCount + const VkCommandBuffer* pCommandBuffers + + + VkResult vkCreateAndroidSurfaceKHR + VkInstance instance + const VkAndroidSurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkResult vkGetPhysicalDeviceDisplayPropertiesKHR + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkDisplayPropertiesKHR* pProperties + + + VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkDisplayPlanePropertiesKHR* pProperties + + + VkResult vkGetDisplayPlaneSupportedDisplaysKHR + VkPhysicalDevice physicalDevice + uint32_t planeIndex + uint32_t* pDisplayCount + VkDisplayKHR* pDisplays + + + VkResult vkGetDisplayModePropertiesKHR + VkPhysicalDevice physicalDevice + VkDisplayKHR display + uint32_t* pPropertyCount + VkDisplayModePropertiesKHR* pProperties + + + VkResult vkCreateDisplayModeKHR + VkPhysicalDevice physicalDevice + VkDisplayKHR display + const VkDisplayModeCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDisplayModeKHR* pMode + + + VkResult vkGetDisplayPlaneCapabilitiesKHR + VkPhysicalDevice physicalDevice + VkDisplayModeKHR mode + uint32_t planeIndex + VkDisplayPlaneCapabilitiesKHR* pCapabilities + + + VkResult vkCreateDisplayPlaneSurfaceKHR + VkInstance instance + const VkDisplaySurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkResult vkCreateSharedSwapchainsKHR + VkDevice device + uint32_t swapchainCount + const VkSwapchainCreateInfoKHR* pCreateInfos + const VkSwapchainCreateInfoKHR* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkSwapchainKHR* pSwapchains + + + void vkDestroySurfaceKHR + VkInstance instance + VkSurfaceKHR surface + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetPhysicalDeviceSurfaceSupportKHR + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + VkSurfaceKHR surface + VkBool32* pSupported + + + VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR + VkPhysicalDevice physicalDevice + VkSurfaceKHR surface + VkSurfaceCapabilitiesKHR* pSurfaceCapabilities + + + VkResult vkGetPhysicalDeviceSurfaceFormatsKHR + VkPhysicalDevice physicalDevice + VkSurfaceKHR surface + uint32_t* pSurfaceFormatCount + VkSurfaceFormatKHR* pSurfaceFormats + + + VkResult vkGetPhysicalDeviceSurfacePresentModesKHR + VkPhysicalDevice physicalDevice + VkSurfaceKHR surface + uint32_t* pPresentModeCount + VkPresentModeKHR* pPresentModes + + + VkResult vkCreateSwapchainKHR + VkDevice device + const VkSwapchainCreateInfoKHR* pCreateInfo + const VkSwapchainCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSwapchainKHR* pSwapchain + + + void vkDestroySwapchainKHR + VkDevice device + VkSwapchainKHR swapchain + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetSwapchainImagesKHR + VkDevice device + VkSwapchainKHR swapchain + uint32_t* pSwapchainImageCount + VkImage* pSwapchainImages + + + VkResult vkAcquireNextImageKHR + VkDevice device + VkSwapchainKHR swapchain + uint64_t timeout + VkSemaphore semaphore + VkFence fence + uint32_t* pImageIndex + + + VkResult vkQueuePresentKHR + VkQueue queue + const VkPresentInfoKHR* pPresentInfo + + + VkResult vkCreateViSurfaceNN + VkInstance instance + const VkViSurfaceCreateInfoNN* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkResult vkCreateWaylandSurfaceKHR + VkInstance instance + const VkWaylandSurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + struct wl_display* display + + + VkResult vkCreateWin32SurfaceKHR + VkInstance instance + const VkWin32SurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + + + VkResult vkCreateXlibSurfaceKHR + VkInstance instance + const VkXlibSurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + Display* dpy + VisualID visualID + + + VkResult vkCreateXcbSurfaceKHR + VkInstance instance + const VkXcbSurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + xcb_connection_t* connection + xcb_visualid_t visual_id + + + VkResult vkCreateDirectFBSurfaceEXT + VkInstance instance + const VkDirectFBSurfaceCreateInfoEXT* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkBool32 vkGetPhysicalDeviceDirectFBPresentationSupportEXT + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + IDirectFB* dfb + + + VkResult vkCreateImagePipeSurfaceFUCHSIA + VkInstance instance + const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkResult vkCreateStreamDescriptorSurfaceGGP + VkInstance instance + const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkResult vkCreateScreenSurfaceQNX + VkInstance instance + const VkScreenSurfaceCreateInfoQNX* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkBool32 vkGetPhysicalDeviceScreenPresentationSupportQNX + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + struct _screen_window* window + + + VkResult vkCreateDebugReportCallbackEXT + VkInstance instance + const VkDebugReportCallbackCreateInfoEXT* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDebugReportCallbackEXT* pCallback + + + void vkDestroyDebugReportCallbackEXT + VkInstance instance + VkDebugReportCallbackEXT callback + const VkAllocationCallbacks* pAllocator + + + void vkDebugReportMessageEXT + VkInstance instance + VkDebugReportFlagsEXT flags + VkDebugReportObjectTypeEXT objectType + uint64_t object + size_t location + int32_t messageCode + const char* pLayerPrefix + const char* pMessage + + + VkResult vkDebugMarkerSetObjectNameEXT + VkDevice device + const VkDebugMarkerObjectNameInfoEXT* pNameInfo + + + VkResult vkDebugMarkerSetObjectTagEXT + VkDevice device + const VkDebugMarkerObjectTagInfoEXT* pTagInfo + + + void vkCmdDebugMarkerBeginEXT + VkCommandBuffer commandBuffer + const VkDebugMarkerMarkerInfoEXT* pMarkerInfo + + + void vkCmdDebugMarkerEndEXT + VkCommandBuffer commandBuffer + + + void vkCmdDebugMarkerInsertEXT + VkCommandBuffer commandBuffer + const VkDebugMarkerMarkerInfoEXT* pMarkerInfo + + + VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV + VkPhysicalDevice physicalDevice + VkFormat format + VkImageType type + VkImageTiling tiling + VkImageUsageFlags usage + VkImageCreateFlags flags + VkExternalMemoryHandleTypeFlagsNV externalHandleType + VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties + + + VkResult vkGetMemoryWin32HandleNV + VkDevice device + VkDeviceMemory memory + VkExternalMemoryHandleTypeFlagsNV handleType + HANDLE* pHandle + + + void vkCmdExecuteGeneratedCommandsNV + VkCommandBuffer commandBuffer + VkBool32 isPreprocessed + const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo + + + void vkCmdPreprocessGeneratedCommandsNV + VkCommandBuffer commandBuffer + const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo + + + void vkCmdBindPipelineShaderGroupNV + VkCommandBuffer commandBuffer + VkPipelineBindPoint pipelineBindPoint + VkPipeline pipeline + uint32_t groupIndex + + + void vkGetGeneratedCommandsMemoryRequirementsNV + VkDevice device + const VkGeneratedCommandsMemoryRequirementsInfoNV* pInfo + VkMemoryRequirements2* pMemoryRequirements + + + VkResult vkCreateIndirectCommandsLayoutNV + VkDevice device + const VkIndirectCommandsLayoutCreateInfoNV* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkIndirectCommandsLayoutNV* pIndirectCommandsLayout + + + void vkDestroyIndirectCommandsLayoutNV + VkDevice device + VkIndirectCommandsLayoutNV indirectCommandsLayout + const VkAllocationCallbacks* pAllocator + + + + void vkCmdExecuteGeneratedCommandsEXT + VkCommandBuffer commandBuffer + VkBool32 isPreprocessed + const VkGeneratedCommandsInfoEXT* pGeneratedCommandsInfo + + + void vkCmdPreprocessGeneratedCommandsEXT + VkCommandBuffer commandBuffer + const VkGeneratedCommandsInfoEXT* pGeneratedCommandsInfo + VkCommandBuffer stateCommandBuffer + + + void vkGetGeneratedCommandsMemoryRequirementsEXT + VkDevice device + const VkGeneratedCommandsMemoryRequirementsInfoEXT* pInfo + VkMemoryRequirements2* pMemoryRequirements + + + VkResult vkCreateIndirectCommandsLayoutEXT + VkDevice device + const VkIndirectCommandsLayoutCreateInfoEXT* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkIndirectCommandsLayoutEXT* pIndirectCommandsLayout + + + void vkDestroyIndirectCommandsLayoutEXT + VkDevice device + VkIndirectCommandsLayoutEXT indirectCommandsLayout + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateIndirectExecutionSetEXT + VkDevice device + const VkIndirectExecutionSetCreateInfoEXT* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkIndirectExecutionSetEXT* pIndirectExecutionSet + + + void vkDestroyIndirectExecutionSetEXT + VkDevice device + VkIndirectExecutionSetEXT indirectExecutionSet + const VkAllocationCallbacks* pAllocator + + + void vkUpdateIndirectExecutionSetPipelineEXT + VkDevice device + VkIndirectExecutionSetEXT indirectExecutionSet + uint32_t executionSetWriteCount + const VkWriteIndirectExecutionSetPipelineEXT* pExecutionSetWrites + + + void vkUpdateIndirectExecutionSetShaderEXT + VkDevice device + VkIndirectExecutionSetEXT indirectExecutionSet + uint32_t executionSetWriteCount + const VkWriteIndirectExecutionSetShaderEXT* pExecutionSetWrites + + + + void vkGetPhysicalDeviceFeatures2 + VkPhysicalDevice physicalDevice + VkPhysicalDeviceFeatures2* pFeatures + + + + void vkGetPhysicalDeviceProperties2 + VkPhysicalDevice physicalDevice + VkPhysicalDeviceProperties2* pProperties + + + + void vkGetPhysicalDeviceFormatProperties2 + VkPhysicalDevice physicalDevice + VkFormat format + VkFormatProperties2* pFormatProperties + + + + VkResult vkGetPhysicalDeviceImageFormatProperties2 + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo + VkImageFormatProperties2* pImageFormatProperties + + + + void vkGetPhysicalDeviceQueueFamilyProperties2 + VkPhysicalDevice physicalDevice + uint32_t* pQueueFamilyPropertyCount + VkQueueFamilyProperties2* pQueueFamilyProperties + + + + void vkGetPhysicalDeviceMemoryProperties2 + VkPhysicalDevice physicalDevice + VkPhysicalDeviceMemoryProperties2* pMemoryProperties + + + + void vkGetPhysicalDeviceSparseImageFormatProperties2 + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo + uint32_t* pPropertyCount + VkSparseImageFormatProperties2* pProperties + + + + void vkCmdPushDescriptorSet + VkCommandBuffer commandBuffer + VkPipelineBindPoint pipelineBindPoint + VkPipelineLayout layout + uint32_t set + uint32_t descriptorWriteCount + const VkWriteDescriptorSet* pDescriptorWrites + + + + void vkTrimCommandPool + VkDevice device + VkCommandPool commandPool + VkCommandPoolTrimFlags flags + + + + void vkGetPhysicalDeviceExternalBufferProperties + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo + VkExternalBufferProperties* pExternalBufferProperties + + + + VkResult vkGetMemoryWin32HandleKHR + VkDevice device + const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo + HANDLE* pHandle + + + VkResult vkGetMemoryWin32HandlePropertiesKHR + VkDevice device + VkExternalMemoryHandleTypeFlagBits handleType + HANDLE handle + VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties + + + VkResult vkGetMemoryFdKHR + VkDevice device + const VkMemoryGetFdInfoKHR* pGetFdInfo + int* pFd + + + VkResult vkGetMemoryFdPropertiesKHR + VkDevice device + VkExternalMemoryHandleTypeFlagBits handleType + int fd + VkMemoryFdPropertiesKHR* pMemoryFdProperties + + + VkResult vkGetMemoryZirconHandleFUCHSIA + VkDevice device + const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo + zx_handle_t* pZirconHandle + + + VkResult vkGetMemoryZirconHandlePropertiesFUCHSIA + VkDevice device + VkExternalMemoryHandleTypeFlagBits handleType + zx_handle_t zirconHandle + VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties + + + VkResult vkGetMemoryRemoteAddressNV + VkDevice device + const VkMemoryGetRemoteAddressInfoNV* pMemoryGetRemoteAddressInfo + VkRemoteAddressNV* pAddress + + + VkResult vkGetMemorySciBufNV + VkDevice device + const VkMemoryGetSciBufInfoNV* pGetSciBufInfo + NvSciBufObj* pHandle + + + VkResult vkGetPhysicalDeviceExternalMemorySciBufPropertiesNV + VkPhysicalDevice physicalDevice + VkExternalMemoryHandleTypeFlagBits handleType + NvSciBufObj handle + VkMemorySciBufPropertiesNV* pMemorySciBufProperties + + + VkResult vkGetPhysicalDeviceSciBufAttributesNV + VkPhysicalDevice physicalDevice + NvSciBufAttrList pAttributes + + + void vkGetPhysicalDeviceExternalSemaphoreProperties + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo + VkExternalSemaphoreProperties* pExternalSemaphoreProperties + + + + VkResult vkGetSemaphoreWin32HandleKHR + VkDevice device + const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo + HANDLE* pHandle + + + VkResult vkImportSemaphoreWin32HandleKHR + VkDevice device + const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo + + + VkResult vkGetSemaphoreFdKHR + VkDevice device + const VkSemaphoreGetFdInfoKHR* pGetFdInfo + int* pFd + + + VkResult vkImportSemaphoreFdKHR + VkDevice device + const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo + + + VkResult vkGetSemaphoreZirconHandleFUCHSIA + VkDevice device + const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo + zx_handle_t* pZirconHandle + + + VkResult vkImportSemaphoreZirconHandleFUCHSIA + VkDevice device + const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo + + + void vkGetPhysicalDeviceExternalFenceProperties + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo + VkExternalFenceProperties* pExternalFenceProperties + + + + VkResult vkGetFenceWin32HandleKHR + VkDevice device + const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo + HANDLE* pHandle + + + VkResult vkImportFenceWin32HandleKHR + VkDevice device + const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo + + + VkResult vkGetFenceFdKHR + VkDevice device + const VkFenceGetFdInfoKHR* pGetFdInfo + int* pFd + + + VkResult vkImportFenceFdKHR + VkDevice device + const VkImportFenceFdInfoKHR* pImportFenceFdInfo + + + VkResult vkGetFenceSciSyncFenceNV + VkDevice device + const VkFenceGetSciSyncInfoNV* pGetSciSyncHandleInfo + void* pHandle + + + VkResult vkGetFenceSciSyncObjNV + VkDevice device + const VkFenceGetSciSyncInfoNV* pGetSciSyncHandleInfo + void* pHandle + + + VkResult vkImportFenceSciSyncFenceNV + VkDevice device + const VkImportFenceSciSyncInfoNV* pImportFenceSciSyncInfo + + + VkResult vkImportFenceSciSyncObjNV + VkDevice device + const VkImportFenceSciSyncInfoNV* pImportFenceSciSyncInfo + + + VkResult vkGetSemaphoreSciSyncObjNV + VkDevice device + const VkSemaphoreGetSciSyncInfoNV* pGetSciSyncInfo + void* pHandle + + + VkResult vkImportSemaphoreSciSyncObjNV + VkDevice device + const VkImportSemaphoreSciSyncInfoNV* pImportSemaphoreSciSyncInfo + + + VkResult vkGetPhysicalDeviceSciSyncAttributesNV + VkPhysicalDevice physicalDevice + const VkSciSyncAttributesInfoNV* pSciSyncAttributesInfo + NvSciSyncAttrList pAttributes + + + VkResult vkCreateSemaphoreSciSyncPoolNV + VkDevice device + const VkSemaphoreSciSyncPoolCreateInfoNV* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSemaphoreSciSyncPoolNV* pSemaphorePool + + + void vkDestroySemaphoreSciSyncPoolNV + VkDevice device + VkSemaphoreSciSyncPoolNV semaphorePool + const VkAllocationCallbacks* pAllocator + + + VkResult vkReleaseDisplayEXT + VkPhysicalDevice physicalDevice + VkDisplayKHR display + + + VkResult vkAcquireXlibDisplayEXT + VkPhysicalDevice physicalDevice + Display* dpy + VkDisplayKHR display + + + VkResult vkGetRandROutputDisplayEXT + VkPhysicalDevice physicalDevice + Display* dpy + RROutput rrOutput + VkDisplayKHR* pDisplay + + + VkResult vkAcquireWinrtDisplayNV + VkPhysicalDevice physicalDevice + VkDisplayKHR display + + + VkResult vkGetWinrtDisplayNV + VkPhysicalDevice physicalDevice + uint32_t deviceRelativeId + VkDisplayKHR* pDisplay + + + VkResult vkDisplayPowerControlEXT + VkDevice device + VkDisplayKHR display + const VkDisplayPowerInfoEXT* pDisplayPowerInfo + + + VkResult vkRegisterDeviceEventEXT + VkDevice device + const VkDeviceEventInfoEXT* pDeviceEventInfo + const VkAllocationCallbacks* pAllocator + VkFence* pFence + + + VkResult vkRegisterDisplayEventEXT + VkDevice device + VkDisplayKHR display + const VkDisplayEventInfoEXT* pDisplayEventInfo + const VkAllocationCallbacks* pAllocator + VkFence* pFence + + + VkResult vkGetSwapchainCounterEXT + VkDevice device + VkSwapchainKHR swapchain + VkSurfaceCounterFlagBitsEXT counter + uint64_t* pCounterValue + + + VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT + VkPhysicalDevice physicalDevice + VkSurfaceKHR surface + VkSurfaceCapabilities2EXT* pSurfaceCapabilities + + + VkResult vkEnumeratePhysicalDeviceGroups + VkInstance instance + uint32_t* pPhysicalDeviceGroupCount + VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties + + + + void vkGetDeviceGroupPeerMemoryFeatures + VkDevice device + uint32_t heapIndex + uint32_t localDeviceIndex + uint32_t remoteDeviceIndex + VkPeerMemoryFeatureFlags* pPeerMemoryFeatures + + + + VkResult vkBindBufferMemory2 + VkDevice device + uint32_t bindInfoCount + const VkBindBufferMemoryInfo* pBindInfos + + + + VkResult vkBindImageMemory2 + VkDevice device + uint32_t bindInfoCount + const VkBindImageMemoryInfo* pBindInfos + + + + void vkCmdSetDeviceMask + VkCommandBuffer commandBuffer + uint32_t deviceMask + + + + VkResult vkGetDeviceGroupPresentCapabilitiesKHR + VkDevice device + VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities + + + VkResult vkGetDeviceGroupSurfacePresentModesKHR + VkDevice device + VkSurfaceKHR surface + VkDeviceGroupPresentModeFlagsKHR* pModes + + + VkResult vkAcquireNextImage2KHR + VkDevice device + const VkAcquireNextImageInfoKHR* pAcquireInfo + uint32_t* pImageIndex + + + void vkCmdDispatchBase + VkCommandBuffer commandBuffer + uint32_t baseGroupX + uint32_t baseGroupY + uint32_t baseGroupZ + uint32_t groupCountX + uint32_t groupCountY + uint32_t groupCountZ + + + + VkResult vkGetPhysicalDevicePresentRectanglesKHR + VkPhysicalDevice physicalDevice + VkSurfaceKHR surface + uint32_t* pRectCount + VkRect2D* pRects + + + VkResult vkCreateDescriptorUpdateTemplate + VkDevice device + const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate + + + + void vkDestroyDescriptorUpdateTemplate + VkDevice device + VkDescriptorUpdateTemplate descriptorUpdateTemplate + const VkAllocationCallbacks* pAllocator + + + + void vkUpdateDescriptorSetWithTemplate + VkDevice device + VkDescriptorSet descriptorSet + VkDescriptorUpdateTemplate descriptorUpdateTemplate + const void* pData + + + + void vkCmdPushDescriptorSetWithTemplate + VkCommandBuffer commandBuffer + VkDescriptorUpdateTemplate descriptorUpdateTemplate + VkPipelineLayout layout + uint32_t set + const void* pData + + + + void vkSetHdrMetadataEXT + VkDevice device + uint32_t swapchainCount + const VkSwapchainKHR* pSwapchains + const VkHdrMetadataEXT* pMetadata + + + VkResult vkGetSwapchainStatusKHR + VkDevice device + VkSwapchainKHR swapchain + + + VkResult vkGetRefreshCycleDurationGOOGLE + VkDevice device + VkSwapchainKHR swapchain + VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties + + + VkResult vkGetPastPresentationTimingGOOGLE + VkDevice device + VkSwapchainKHR swapchain + uint32_t* pPresentationTimingCount + VkPastPresentationTimingGOOGLE* pPresentationTimings + + + VkResult vkCreateIOSSurfaceMVK + VkInstance instance + const VkIOSSurfaceCreateInfoMVK* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkResult vkCreateMacOSSurfaceMVK + VkInstance instance + const VkMacOSSurfaceCreateInfoMVK* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkResult vkCreateMetalSurfaceEXT + VkInstance instance + const VkMetalSurfaceCreateInfoEXT* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + void vkCmdSetViewportWScalingNV + VkCommandBuffer commandBuffer + uint32_t firstViewport + uint32_t viewportCount + const VkViewportWScalingNV* pViewportWScalings + + + void vkCmdSetDiscardRectangleEXT + VkCommandBuffer commandBuffer + uint32_t firstDiscardRectangle + uint32_t discardRectangleCount + const VkRect2D* pDiscardRectangles + + + void vkCmdSetDiscardRectangleEnableEXT + VkCommandBuffer commandBuffer + VkBool32 discardRectangleEnable + + + void vkCmdSetDiscardRectangleModeEXT + VkCommandBuffer commandBuffer + VkDiscardRectangleModeEXT discardRectangleMode + + + void vkCmdSetSampleLocationsEXT + VkCommandBuffer commandBuffer + const VkSampleLocationsInfoEXT* pSampleLocationsInfo + + + void vkGetPhysicalDeviceMultisamplePropertiesEXT + VkPhysicalDevice physicalDevice + VkSampleCountFlagBits samples + VkMultisamplePropertiesEXT* pMultisampleProperties + + + VkResult vkGetPhysicalDeviceSurfaceCapabilities2KHR + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo + VkSurfaceCapabilities2KHR* pSurfaceCapabilities + + + VkResult vkGetPhysicalDeviceSurfaceFormats2KHR + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo + uint32_t* pSurfaceFormatCount + VkSurfaceFormat2KHR* pSurfaceFormats + + + VkResult vkGetPhysicalDeviceDisplayProperties2KHR + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkDisplayProperties2KHR* pProperties + + + VkResult vkGetPhysicalDeviceDisplayPlaneProperties2KHR + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkDisplayPlaneProperties2KHR* pProperties + + + VkResult vkGetDisplayModeProperties2KHR + VkPhysicalDevice physicalDevice + VkDisplayKHR display + uint32_t* pPropertyCount + VkDisplayModeProperties2KHR* pProperties + + + VkResult vkGetDisplayPlaneCapabilities2KHR + VkPhysicalDevice physicalDevice + const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo + VkDisplayPlaneCapabilities2KHR* pCapabilities + + + void vkGetBufferMemoryRequirements2 + VkDevice device + const VkBufferMemoryRequirementsInfo2* pInfo + VkMemoryRequirements2* pMemoryRequirements + + + + void vkGetImageMemoryRequirements2 + VkDevice device + const VkImageMemoryRequirementsInfo2* pInfo + VkMemoryRequirements2* pMemoryRequirements + + + + void vkGetImageSparseMemoryRequirements2 + VkDevice device + const VkImageSparseMemoryRequirementsInfo2* pInfo + uint32_t* pSparseMemoryRequirementCount + VkSparseImageMemoryRequirements2* pSparseMemoryRequirements + + + + void vkGetDeviceBufferMemoryRequirements + VkDevice device + const VkDeviceBufferMemoryRequirements* pInfo + VkMemoryRequirements2* pMemoryRequirements + + + + void vkGetDeviceImageMemoryRequirements + VkDevice device + const VkDeviceImageMemoryRequirements* pInfo + VkMemoryRequirements2* pMemoryRequirements + + + + void vkGetDeviceImageSparseMemoryRequirements + VkDevice device + const VkDeviceImageMemoryRequirements* pInfo + uint32_t* pSparseMemoryRequirementCount + VkSparseImageMemoryRequirements2* pSparseMemoryRequirements + + + + VkResult vkCreateSamplerYcbcrConversion + VkDevice device + const VkSamplerYcbcrConversionCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSamplerYcbcrConversion* pYcbcrConversion + + + + void vkDestroySamplerYcbcrConversion + VkDevice device + VkSamplerYcbcrConversion ycbcrConversion + const VkAllocationCallbacks* pAllocator + + + + void vkGetDeviceQueue2 + VkDevice device + const VkDeviceQueueInfo2* pQueueInfo + VkQueue* pQueue + + + VkResult vkCreateValidationCacheEXT + VkDevice device + const VkValidationCacheCreateInfoEXT* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkValidationCacheEXT* pValidationCache + + + void vkDestroyValidationCacheEXT + VkDevice device + VkValidationCacheEXT validationCache + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetValidationCacheDataEXT + VkDevice device + VkValidationCacheEXT validationCache + size_t* pDataSize + void* pData + + + VkResult vkMergeValidationCachesEXT + VkDevice device + VkValidationCacheEXT dstCache + uint32_t srcCacheCount + const VkValidationCacheEXT* pSrcCaches + + + void vkGetDescriptorSetLayoutSupport + VkDevice device + const VkDescriptorSetLayoutCreateInfo* pCreateInfo + VkDescriptorSetLayoutSupport* pSupport + + + + VkResult vkGetSwapchainGrallocUsageANDROID + VkDevice device + VkFormat format + VkImageUsageFlags imageUsage + int* grallocUsage + + + VkResult vkGetSwapchainGrallocUsage2ANDROID + VkDevice device + VkFormat format + VkImageUsageFlags imageUsage + VkSwapchainImageUsageFlagsANDROID swapchainImageUsage + uint64_t* grallocConsumerUsage + uint64_t* grallocProducerUsage + + + VkResult vkAcquireImageANDROID + VkDevice device + VkImage image + int nativeFenceFd + VkSemaphore semaphore + VkFence fence + + + VkResult vkQueueSignalReleaseImageANDROID + VkQueue queue + uint32_t waitSemaphoreCount + const VkSemaphore* pWaitSemaphores + VkImage image + int* pNativeFenceFd + + + VkResult vkGetShaderInfoAMD + VkDevice device + VkPipeline pipeline + VkShaderStageFlagBits shaderStage + VkShaderInfoTypeAMD infoType + size_t* pInfoSize + void* pInfo + + + void vkSetLocalDimmingAMD + VkDevice device + VkSwapchainKHR swapChain + VkBool32 localDimmingEnable + + + VkResult vkGetPhysicalDeviceCalibrateableTimeDomainsKHR + VkPhysicalDevice physicalDevice + uint32_t* pTimeDomainCount + VkTimeDomainKHR* pTimeDomains + + + + VkResult vkGetCalibratedTimestampsKHR + VkDevice device + uint32_t timestampCount + const VkCalibratedTimestampInfoKHR* pTimestampInfos + uint64_t* pTimestamps + uint64_t* pMaxDeviation + + + + VkResult vkSetDebugUtilsObjectNameEXT + VkDevice device + const VkDebugUtilsObjectNameInfoEXT* pNameInfo + + + VkResult vkSetDebugUtilsObjectTagEXT + VkDevice device + const VkDebugUtilsObjectTagInfoEXT* pTagInfo + + + void vkQueueBeginDebugUtilsLabelEXT + VkQueue queue + const VkDebugUtilsLabelEXT* pLabelInfo + + + void vkQueueEndDebugUtilsLabelEXT + VkQueue queue + + + void vkQueueInsertDebugUtilsLabelEXT + VkQueue queue + const VkDebugUtilsLabelEXT* pLabelInfo + + + void vkCmdBeginDebugUtilsLabelEXT + VkCommandBuffer commandBuffer + const VkDebugUtilsLabelEXT* pLabelInfo + + + void vkCmdEndDebugUtilsLabelEXT + VkCommandBuffer commandBuffer + + + void vkCmdInsertDebugUtilsLabelEXT + VkCommandBuffer commandBuffer + const VkDebugUtilsLabelEXT* pLabelInfo + + + VkResult vkCreateDebugUtilsMessengerEXT + VkInstance instance + const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDebugUtilsMessengerEXT* pMessenger + + + void vkDestroyDebugUtilsMessengerEXT + VkInstance instance + VkDebugUtilsMessengerEXT messenger + const VkAllocationCallbacks* pAllocator + + + void vkSubmitDebugUtilsMessageEXT + VkInstance instance + VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity + VkDebugUtilsMessageTypeFlagsEXT messageTypes + const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData + + + VkResult vkGetMemoryHostPointerPropertiesEXT + VkDevice device + VkExternalMemoryHandleTypeFlagBits handleType + const void* pHostPointer + VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties + + + void vkCmdWriteBufferMarkerAMD + VkCommandBuffer commandBuffer + VkPipelineStageFlagBits pipelineStage + VkBuffer dstBuffer + VkDeviceSize dstOffset + uint32_t marker + + + VkResult vkCreateRenderPass2 + VkDevice device + const VkRenderPassCreateInfo2* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkRenderPass* pRenderPass + + + + void vkCmdBeginRenderPass2 + VkCommandBuffer commandBuffer + const VkRenderPassBeginInfo* pRenderPassBegin + const VkSubpassBeginInfo* pSubpassBeginInfo + + + + void vkCmdNextSubpass2 + VkCommandBuffer commandBuffer + const VkSubpassBeginInfo* pSubpassBeginInfo + const VkSubpassEndInfo* pSubpassEndInfo + + + + void vkCmdEndRenderPass2 + VkCommandBuffer commandBuffer + const VkSubpassEndInfo* pSubpassEndInfo + + + + VkResult vkGetSemaphoreCounterValue + VkDevice device + VkSemaphore semaphore + uint64_t* pValue + + + + VkResult vkWaitSemaphores + VkDevice device + const VkSemaphoreWaitInfo* pWaitInfo + uint64_t timeout + + + + VkResult vkSignalSemaphore + VkDevice device + const VkSemaphoreSignalInfo* pSignalInfo + + + + VkResult vkGetAndroidHardwareBufferPropertiesANDROID + VkDevice device + const struct AHardwareBuffer* buffer + VkAndroidHardwareBufferPropertiesANDROID* pProperties + + + VkResult vkGetMemoryAndroidHardwareBufferANDROID + VkDevice device + const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo + struct AHardwareBuffer** pBuffer + + + void vkCmdDrawIndirectCount + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + VkBuffer countBuffer + VkDeviceSize countBufferOffset + uint32_t maxDrawCount + uint32_t stride + + + + + void vkCmdDrawIndexedIndirectCount + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + VkBuffer countBuffer + VkDeviceSize countBufferOffset + uint32_t maxDrawCount + uint32_t stride + + + + + void vkCmdSetCheckpointNV + VkCommandBuffer commandBuffer + const void* pCheckpointMarker + + + void vkGetQueueCheckpointDataNV + VkQueue queue + uint32_t* pCheckpointDataCount + VkCheckpointDataNV* pCheckpointData + + + void vkCmdBindTransformFeedbackBuffersEXT + VkCommandBuffer commandBuffer + uint32_t firstBinding + uint32_t bindingCount + const VkBuffer* pBuffers + const VkDeviceSize* pOffsets + const VkDeviceSize* pSizes + + + void vkCmdBeginTransformFeedbackEXT + VkCommandBuffer commandBuffer + uint32_t firstCounterBuffer + uint32_t counterBufferCount + const VkBuffer* pCounterBuffers + const VkDeviceSize* pCounterBufferOffsets + + + void vkCmdEndTransformFeedbackEXT + VkCommandBuffer commandBuffer + uint32_t firstCounterBuffer + uint32_t counterBufferCount + const VkBuffer* pCounterBuffers + const VkDeviceSize* pCounterBufferOffsets + + + void vkCmdBeginQueryIndexedEXT + VkCommandBuffer commandBuffer + VkQueryPool queryPool + uint32_t query + VkQueryControlFlags flags + uint32_t index + + + void vkCmdEndQueryIndexedEXT + VkCommandBuffer commandBuffer + VkQueryPool queryPool + uint32_t query + uint32_t index + + + void vkCmdDrawIndirectByteCountEXT + VkCommandBuffer commandBuffer + uint32_t instanceCount + uint32_t firstInstance + VkBuffer counterBuffer + VkDeviceSize counterBufferOffset + uint32_t counterOffset + uint32_t vertexStride + + + void vkCmdSetExclusiveScissorNV + VkCommandBuffer commandBuffer + uint32_t firstExclusiveScissor + uint32_t exclusiveScissorCount + const VkRect2D* pExclusiveScissors + + + void vkCmdSetExclusiveScissorEnableNV + VkCommandBuffer commandBuffer + uint32_t firstExclusiveScissor + uint32_t exclusiveScissorCount + const VkBool32* pExclusiveScissorEnables + + + void vkCmdBindShadingRateImageNV + VkCommandBuffer commandBuffer + VkImageView imageView + VkImageLayout imageLayout + + + void vkCmdSetViewportShadingRatePaletteNV + VkCommandBuffer commandBuffer + uint32_t firstViewport + uint32_t viewportCount + const VkShadingRatePaletteNV* pShadingRatePalettes + + + void vkCmdSetCoarseSampleOrderNV + VkCommandBuffer commandBuffer + VkCoarseSampleOrderTypeNV sampleOrderType + uint32_t customSampleOrderCount + const VkCoarseSampleOrderCustomNV* pCustomSampleOrders + + + void vkCmdDrawMeshTasksNV + VkCommandBuffer commandBuffer + uint32_t taskCount + uint32_t firstTask + + + void vkCmdDrawMeshTasksIndirectNV + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + uint32_t drawCount + uint32_t stride + + + void vkCmdDrawMeshTasksIndirectCountNV + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + VkBuffer countBuffer + VkDeviceSize countBufferOffset + uint32_t maxDrawCount + uint32_t stride + + + void vkCmdDrawMeshTasksEXT + VkCommandBuffer commandBuffer + uint32_t groupCountX + uint32_t groupCountY + uint32_t groupCountZ + + + void vkCmdDrawMeshTasksIndirectEXT + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + uint32_t drawCount + uint32_t stride + + + void vkCmdDrawMeshTasksIndirectCountEXT + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + VkBuffer countBuffer + VkDeviceSize countBufferOffset + uint32_t maxDrawCount + uint32_t stride + + + VkResult vkCompileDeferredNV + VkDevice device + VkPipeline pipeline + uint32_t shader + + + VkResult vkCreateAccelerationStructureNV + VkDevice device + const VkAccelerationStructureCreateInfoNV* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkAccelerationStructureNV* pAccelerationStructure + + + void vkCmdBindInvocationMaskHUAWEI + VkCommandBuffer commandBuffer + VkImageView imageView + VkImageLayout imageLayout + + + void vkDestroyAccelerationStructureKHR + VkDevice device + VkAccelerationStructureKHR accelerationStructure + const VkAllocationCallbacks* pAllocator + + + void vkDestroyAccelerationStructureNV + VkDevice device + VkAccelerationStructureNV accelerationStructure + const VkAllocationCallbacks* pAllocator + + + void vkGetAccelerationStructureMemoryRequirementsNV + VkDevice device + const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo + VkMemoryRequirements2KHR* pMemoryRequirements + + + VkResult vkBindAccelerationStructureMemoryNV + VkDevice device + uint32_t bindInfoCount + const VkBindAccelerationStructureMemoryInfoNV* pBindInfos + + + void vkCmdCopyAccelerationStructureNV + VkCommandBuffer commandBuffer + VkAccelerationStructureNV dst + VkAccelerationStructureNV src + VkCopyAccelerationStructureModeKHR mode + + + void vkCmdCopyAccelerationStructureKHR + VkCommandBuffer commandBuffer + const VkCopyAccelerationStructureInfoKHR* pInfo + + + VkResult vkCopyAccelerationStructureKHR + VkDevice device + VkDeferredOperationKHR deferredOperation + const VkCopyAccelerationStructureInfoKHR* pInfo + + + void vkCmdCopyAccelerationStructureToMemoryKHR + VkCommandBuffer commandBuffer + const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo + + + VkResult vkCopyAccelerationStructureToMemoryKHR + VkDevice device + VkDeferredOperationKHR deferredOperation + const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo + + + void vkCmdCopyMemoryToAccelerationStructureKHR + VkCommandBuffer commandBuffer + const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo + + + VkResult vkCopyMemoryToAccelerationStructureKHR + VkDevice device + VkDeferredOperationKHR deferredOperation + const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo + + + void vkCmdWriteAccelerationStructuresPropertiesKHR + VkCommandBuffer commandBuffer + uint32_t accelerationStructureCount + const VkAccelerationStructureKHR* pAccelerationStructures + VkQueryType queryType + VkQueryPool queryPool + uint32_t firstQuery + + + void vkCmdWriteAccelerationStructuresPropertiesNV + VkCommandBuffer commandBuffer + uint32_t accelerationStructureCount + const VkAccelerationStructureNV* pAccelerationStructures + VkQueryType queryType + VkQueryPool queryPool + uint32_t firstQuery + + + void vkCmdBuildAccelerationStructureNV + VkCommandBuffer commandBuffer + const VkAccelerationStructureInfoNV* pInfo + VkBuffer instanceData + VkDeviceSize instanceOffset + VkBool32 update + VkAccelerationStructureNV dst + VkAccelerationStructureNV src + VkBuffer scratch + VkDeviceSize scratchOffset + + + VkResult vkWriteAccelerationStructuresPropertiesKHR + VkDevice device + uint32_t accelerationStructureCount + const VkAccelerationStructureKHR* pAccelerationStructures + VkQueryType queryType + size_t dataSize + void* pData + size_t stride + + + void vkCmdTraceRaysKHR + VkCommandBuffer commandBuffer + const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable + const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable + const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable + const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable + uint32_t width + uint32_t height + uint32_t depth + + + void vkCmdTraceRaysNV + VkCommandBuffer commandBuffer + VkBuffer raygenShaderBindingTableBuffer + VkDeviceSize raygenShaderBindingOffset + VkBuffer missShaderBindingTableBuffer + VkDeviceSize missShaderBindingOffset + VkDeviceSize missShaderBindingStride + VkBuffer hitShaderBindingTableBuffer + VkDeviceSize hitShaderBindingOffset + VkDeviceSize hitShaderBindingStride + VkBuffer callableShaderBindingTableBuffer + VkDeviceSize callableShaderBindingOffset + VkDeviceSize callableShaderBindingStride + uint32_t width + uint32_t height + uint32_t depth + + + VkResult vkGetRayTracingShaderGroupHandlesKHR + VkDevice device + VkPipeline pipeline + uint32_t firstGroup + uint32_t groupCount + size_t dataSize + void* pData + + + + VkResult vkGetRayTracingCaptureReplayShaderGroupHandlesKHR + VkDevice device + VkPipeline pipeline + uint32_t firstGroup + uint32_t groupCount + size_t dataSize + void* pData + + + VkResult vkGetAccelerationStructureHandleNV + VkDevice device + VkAccelerationStructureNV accelerationStructure + size_t dataSize + void* pData + + + VkResult vkCreateRayTracingPipelinesNV + VkDevice device + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkRayTracingPipelineCreateInfoNV* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + + VkResult vkCreateRayTracingPipelinesNV + VkDevice device + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkRayTracingPipelineCreateInfoNV* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + + VkResult vkCreateRayTracingPipelinesKHR + VkDevice device + VkDeferredOperationKHR deferredOperation + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkRayTracingPipelineCreateInfoKHR* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + + VkResult vkCreateRayTracingPipelinesKHR + VkDevice device + VkDeferredOperationKHR deferredOperation + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkRayTracingPipelineCreateInfoKHR* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + + VkResult vkGetPhysicalDeviceCooperativeMatrixPropertiesNV + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkCooperativeMatrixPropertiesNV* pProperties + + + void vkCmdTraceRaysIndirectKHR + VkCommandBuffer commandBuffer + const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable + const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable + const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable + const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable + VkDeviceAddress indirectDeviceAddress + + + void vkCmdTraceRaysIndirect2KHR + VkCommandBuffer commandBuffer + VkDeviceAddress indirectDeviceAddress + + + void vkGetDeviceAccelerationStructureCompatibilityKHR + VkDevice device + const VkAccelerationStructureVersionInfoKHR* pVersionInfo + VkAccelerationStructureCompatibilityKHR* pCompatibility + + + VkDeviceSize vkGetRayTracingShaderGroupStackSizeKHR + VkDevice device + VkPipeline pipeline + uint32_t group + VkShaderGroupShaderKHR groupShader + + + void vkCmdSetRayTracingPipelineStackSizeKHR + VkCommandBuffer commandBuffer + uint32_t pipelineStackSize + + + uint32_t vkGetImageViewHandleNVX + VkDevice device + const VkImageViewHandleInfoNVX* pInfo + + + uint64_t vkGetImageViewHandle64NVX + VkDevice device + const VkImageViewHandleInfoNVX* pInfo + + + VkResult vkGetImageViewAddressNVX + VkDevice device + VkImageView imageView + VkImageViewAddressPropertiesNVX* pProperties + + + VkResult vkGetPhysicalDeviceSurfacePresentModes2EXT + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo + uint32_t* pPresentModeCount + VkPresentModeKHR* pPresentModes + + + VkResult vkGetDeviceGroupSurfacePresentModes2EXT + VkDevice device + const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo + VkDeviceGroupPresentModeFlagsKHR* pModes + + + VkResult vkAcquireFullScreenExclusiveModeEXT + VkDevice device + VkSwapchainKHR swapchain + + + VkResult vkReleaseFullScreenExclusiveModeEXT + VkDevice device + VkSwapchainKHR swapchain + + + VkResult vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + uint32_t* pCounterCount + VkPerformanceCounterKHR* pCounters + VkPerformanceCounterDescriptionKHR* pCounterDescriptions + + + void vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR + VkPhysicalDevice physicalDevice + const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo + uint32_t* pNumPasses + + + VkResult vkAcquireProfilingLockKHR + VkDevice device + const VkAcquireProfilingLockInfoKHR* pInfo + + + void vkReleaseProfilingLockKHR + VkDevice device + + + VkResult vkGetImageDrmFormatModifierPropertiesEXT + VkDevice device + VkImage image + VkImageDrmFormatModifierPropertiesEXT* pProperties + + + uint64_t vkGetBufferOpaqueCaptureAddress + VkDevice device + const VkBufferDeviceAddressInfo* pInfo + + + + VkDeviceAddress vkGetBufferDeviceAddress + VkDevice device + const VkBufferDeviceAddressInfo* pInfo + + + + + VkResult vkCreateHeadlessSurfaceEXT + VkInstance instance + const VkHeadlessSurfaceCreateInfoEXT* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkResult vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV + VkPhysicalDevice physicalDevice + uint32_t* pCombinationCount + VkFramebufferMixedSamplesCombinationNV* pCombinations + + + VkResult vkInitializePerformanceApiINTEL + VkDevice device + const VkInitializePerformanceApiInfoINTEL* pInitializeInfo + + + void vkUninitializePerformanceApiINTEL + VkDevice device + + + VkResult vkCmdSetPerformanceMarkerINTEL + VkCommandBuffer commandBuffer + const VkPerformanceMarkerInfoINTEL* pMarkerInfo + + + VkResult vkCmdSetPerformanceStreamMarkerINTEL + VkCommandBuffer commandBuffer + const VkPerformanceStreamMarkerInfoINTEL* pMarkerInfo + + + VkResult vkCmdSetPerformanceOverrideINTEL + VkCommandBuffer commandBuffer + const VkPerformanceOverrideInfoINTEL* pOverrideInfo + + + VkResult vkAcquirePerformanceConfigurationINTEL + VkDevice device + const VkPerformanceConfigurationAcquireInfoINTEL* pAcquireInfo + VkPerformanceConfigurationINTEL* pConfiguration + + + VkResult vkReleasePerformanceConfigurationINTEL + VkDevice device + VkPerformanceConfigurationINTEL configuration + + + VkResult vkQueueSetPerformanceConfigurationINTEL + VkQueue queue + VkPerformanceConfigurationINTEL configuration + + + VkResult vkGetPerformanceParameterINTEL + VkDevice device + VkPerformanceParameterTypeINTEL parameter + VkPerformanceValueINTEL* pValue + + + uint64_t vkGetDeviceMemoryOpaqueCaptureAddress + VkDevice device + const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo + + + + VkResult vkGetPipelineExecutablePropertiesKHR + VkDevice device + const VkPipelineInfoKHR* pPipelineInfo + uint32_t* pExecutableCount + VkPipelineExecutablePropertiesKHR* pProperties + + + VkResult vkGetPipelineExecutableStatisticsKHR + VkDevice device + const VkPipelineExecutableInfoKHR* pExecutableInfo + uint32_t* pStatisticCount + VkPipelineExecutableStatisticKHR* pStatistics + + + VkResult vkGetPipelineExecutableInternalRepresentationsKHR + VkDevice device + const VkPipelineExecutableInfoKHR* pExecutableInfo + uint32_t* pInternalRepresentationCount + VkPipelineExecutableInternalRepresentationKHR* pInternalRepresentations + + + void vkCmdSetLineStipple + VkCommandBuffer commandBuffer + uint32_t lineStippleFactor + uint16_t lineStipplePattern + + + + + VkResult vkGetFaultData + VkDevice device + VkFaultQueryBehavior faultQueryBehavior + VkBool32* pUnrecordedFaults + uint32_t* pFaultCount + VkFaultData* pFaults + + + VkResult vkGetPhysicalDeviceToolProperties + VkPhysicalDevice physicalDevice + uint32_t* pToolCount + VkPhysicalDeviceToolProperties* pToolProperties + + + + VkResult vkCreateAccelerationStructureKHR + VkDevice device + const VkAccelerationStructureCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkAccelerationStructureKHR* pAccelerationStructure + + + void vkCmdBuildAccelerationStructuresKHR + VkCommandBuffer commandBuffer + uint32_t infoCount + const VkAccelerationStructureBuildGeometryInfoKHR* pInfos + const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos + + + void vkCmdBuildAccelerationStructuresIndirectKHR + VkCommandBuffer commandBuffer + uint32_t infoCount + const VkAccelerationStructureBuildGeometryInfoKHR* pInfos + const VkDeviceAddress* pIndirectDeviceAddresses + const uint32_t* pIndirectStrides + const uint32_t* const* ppMaxPrimitiveCounts + + + VkResult vkBuildAccelerationStructuresKHR + VkDevice device + VkDeferredOperationKHR deferredOperation + uint32_t infoCount + const VkAccelerationStructureBuildGeometryInfoKHR* pInfos + const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos + + + VkDeviceAddress vkGetAccelerationStructureDeviceAddressKHR + VkDevice device + const VkAccelerationStructureDeviceAddressInfoKHR* pInfo + + + VkResult vkCreateDeferredOperationKHR + VkDevice device + const VkAllocationCallbacks* pAllocator + VkDeferredOperationKHR* pDeferredOperation + + + void vkDestroyDeferredOperationKHR + VkDevice device + VkDeferredOperationKHR operation + const VkAllocationCallbacks* pAllocator + + + uint32_t vkGetDeferredOperationMaxConcurrencyKHR + VkDevice device + VkDeferredOperationKHR operation + + + VkResult vkGetDeferredOperationResultKHR + VkDevice device + VkDeferredOperationKHR operation + + + VkResult vkDeferredOperationJoinKHR + VkDevice device + VkDeferredOperationKHR operation + + + void vkGetPipelineIndirectMemoryRequirementsNV + VkDevice device + const VkComputePipelineCreateInfo* pCreateInfo + VkMemoryRequirements2* pMemoryRequirements + + + VkDeviceAddress vkGetPipelineIndirectDeviceAddressNV + VkDevice device + const VkPipelineIndirectDeviceAddressInfoNV* pInfo + + + void vkAntiLagUpdateAMD + VkDevice device + const VkAntiLagDataAMD* pData + + + void vkCmdSetCullMode + VkCommandBuffer commandBuffer + VkCullModeFlags cullMode + + + + void vkCmdSetFrontFace + VkCommandBuffer commandBuffer + VkFrontFace frontFace + + + + void vkCmdSetPrimitiveTopology + VkCommandBuffer commandBuffer + VkPrimitiveTopology primitiveTopology + + + + void vkCmdSetViewportWithCount + VkCommandBuffer commandBuffer + uint32_t viewportCount + const VkViewport* pViewports + + + + void vkCmdSetScissorWithCount + VkCommandBuffer commandBuffer + uint32_t scissorCount + const VkRect2D* pScissors + + + + void vkCmdBindIndexBuffer2 + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + VkDeviceSize size + VkIndexType indexType + + + + void vkCmdBindVertexBuffers2 + VkCommandBuffer commandBuffer + uint32_t firstBinding + uint32_t bindingCount + const VkBuffer* pBuffers + const VkDeviceSize* pOffsets + const VkDeviceSize* pSizes + const VkDeviceSize* pStrides + + + + void vkCmdSetDepthTestEnable + VkCommandBuffer commandBuffer + VkBool32 depthTestEnable + + + + void vkCmdSetDepthWriteEnable + VkCommandBuffer commandBuffer + VkBool32 depthWriteEnable + + + + void vkCmdSetDepthCompareOp + VkCommandBuffer commandBuffer + VkCompareOp depthCompareOp + + + + void vkCmdSetDepthBoundsTestEnable + VkCommandBuffer commandBuffer + VkBool32 depthBoundsTestEnable + + + + void vkCmdSetStencilTestEnable + VkCommandBuffer commandBuffer + VkBool32 stencilTestEnable + + + + void vkCmdSetStencilOp + VkCommandBuffer commandBuffer + VkStencilFaceFlags faceMask + VkStencilOp failOp + VkStencilOp passOp + VkStencilOp depthFailOp + VkCompareOp compareOp + + + + void vkCmdSetPatchControlPointsEXT + VkCommandBuffer commandBuffer + uint32_t patchControlPoints + + + void vkCmdSetRasterizerDiscardEnable + VkCommandBuffer commandBuffer + VkBool32 rasterizerDiscardEnable + + + + void vkCmdSetDepthBiasEnable + VkCommandBuffer commandBuffer + VkBool32 depthBiasEnable + + + + void vkCmdSetLogicOpEXT + VkCommandBuffer commandBuffer + VkLogicOp logicOp + + + void vkCmdSetPrimitiveRestartEnable + VkCommandBuffer commandBuffer + VkBool32 primitiveRestartEnable + + + + void vkCmdSetTessellationDomainOriginEXT + VkCommandBuffer commandBuffer + VkTessellationDomainOrigin domainOrigin + + + void vkCmdSetDepthClampEnableEXT + VkCommandBuffer commandBuffer + VkBool32 depthClampEnable + + + void vkCmdSetPolygonModeEXT + VkCommandBuffer commandBuffer + VkPolygonMode polygonMode + + + void vkCmdSetRasterizationSamplesEXT + VkCommandBuffer commandBuffer + VkSampleCountFlagBits rasterizationSamples + + + void vkCmdSetSampleMaskEXT + VkCommandBuffer commandBuffer + VkSampleCountFlagBits samples + const VkSampleMask* pSampleMask + + + void vkCmdSetAlphaToCoverageEnableEXT + VkCommandBuffer commandBuffer + VkBool32 alphaToCoverageEnable + + + void vkCmdSetAlphaToOneEnableEXT + VkCommandBuffer commandBuffer + VkBool32 alphaToOneEnable + + + void vkCmdSetLogicOpEnableEXT + VkCommandBuffer commandBuffer + VkBool32 logicOpEnable + + + void vkCmdSetColorBlendEnableEXT + VkCommandBuffer commandBuffer + uint32_t firstAttachment + uint32_t attachmentCount + const VkBool32* pColorBlendEnables + + + void vkCmdSetColorBlendEquationEXT + VkCommandBuffer commandBuffer + uint32_t firstAttachment + uint32_t attachmentCount + const VkColorBlendEquationEXT* pColorBlendEquations + + + void vkCmdSetColorWriteMaskEXT + VkCommandBuffer commandBuffer + uint32_t firstAttachment + uint32_t attachmentCount + const VkColorComponentFlags* pColorWriteMasks + + + void vkCmdSetRasterizationStreamEXT + VkCommandBuffer commandBuffer + uint32_t rasterizationStream + + + void vkCmdSetConservativeRasterizationModeEXT + VkCommandBuffer commandBuffer + VkConservativeRasterizationModeEXT conservativeRasterizationMode + + + void vkCmdSetExtraPrimitiveOverestimationSizeEXT + VkCommandBuffer commandBuffer + float extraPrimitiveOverestimationSize + + + void vkCmdSetDepthClipEnableEXT + VkCommandBuffer commandBuffer + VkBool32 depthClipEnable + + + void vkCmdSetSampleLocationsEnableEXT + VkCommandBuffer commandBuffer + VkBool32 sampleLocationsEnable + + + void vkCmdSetColorBlendAdvancedEXT + VkCommandBuffer commandBuffer + uint32_t firstAttachment + uint32_t attachmentCount + const VkColorBlendAdvancedEXT* pColorBlendAdvanced + + + void vkCmdSetProvokingVertexModeEXT + VkCommandBuffer commandBuffer + VkProvokingVertexModeEXT provokingVertexMode + + + void vkCmdSetLineRasterizationModeEXT + VkCommandBuffer commandBuffer + VkLineRasterizationModeEXT lineRasterizationMode + + + void vkCmdSetLineStippleEnableEXT + VkCommandBuffer commandBuffer + VkBool32 stippledLineEnable + + + void vkCmdSetDepthClipNegativeOneToOneEXT + VkCommandBuffer commandBuffer + VkBool32 negativeOneToOne + + + void vkCmdSetViewportWScalingEnableNV + VkCommandBuffer commandBuffer + VkBool32 viewportWScalingEnable + + + void vkCmdSetViewportSwizzleNV + VkCommandBuffer commandBuffer + uint32_t firstViewport + uint32_t viewportCount + const VkViewportSwizzleNV* pViewportSwizzles + + + void vkCmdSetCoverageToColorEnableNV + VkCommandBuffer commandBuffer + VkBool32 coverageToColorEnable + + + void vkCmdSetCoverageToColorLocationNV + VkCommandBuffer commandBuffer + uint32_t coverageToColorLocation + + + void vkCmdSetCoverageModulationModeNV + VkCommandBuffer commandBuffer + VkCoverageModulationModeNV coverageModulationMode + + + void vkCmdSetCoverageModulationTableEnableNV + VkCommandBuffer commandBuffer + VkBool32 coverageModulationTableEnable + + + void vkCmdSetCoverageModulationTableNV + VkCommandBuffer commandBuffer + uint32_t coverageModulationTableCount + const float* pCoverageModulationTable + + + void vkCmdSetShadingRateImageEnableNV + VkCommandBuffer commandBuffer + VkBool32 shadingRateImageEnable + + + void vkCmdSetCoverageReductionModeNV + VkCommandBuffer commandBuffer + VkCoverageReductionModeNV coverageReductionMode + + + void vkCmdSetRepresentativeFragmentTestEnableNV + VkCommandBuffer commandBuffer + VkBool32 representativeFragmentTestEnable + + + VkResult vkCreatePrivateDataSlot + VkDevice device + const VkPrivateDataSlotCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkPrivateDataSlot* pPrivateDataSlot + + + + void vkDestroyPrivateDataSlot + VkDevice device + VkPrivateDataSlot privateDataSlot + const VkAllocationCallbacks* pAllocator + + + + VkResult vkSetPrivateData + VkDevice device + VkObjectType objectType + uint64_t objectHandle + VkPrivateDataSlot privateDataSlot + uint64_t data + + + + void vkGetPrivateData + VkDevice device + VkObjectType objectType + uint64_t objectHandle + VkPrivateDataSlot privateDataSlot + uint64_t* pData + + + + void vkCmdCopyBuffer2 + VkCommandBuffer commandBuffer + const VkCopyBufferInfo2* pCopyBufferInfo + + + + void vkCmdCopyImage2 + VkCommandBuffer commandBuffer + const VkCopyImageInfo2* pCopyImageInfo + + + + void vkCmdBlitImage2 + VkCommandBuffer commandBuffer + const VkBlitImageInfo2* pBlitImageInfo + + + + void vkCmdCopyBufferToImage2 + VkCommandBuffer commandBuffer + const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo + + + + void vkCmdCopyImageToBuffer2 + VkCommandBuffer commandBuffer + const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo + + + + void vkCmdResolveImage2 + VkCommandBuffer commandBuffer + const VkResolveImageInfo2* pResolveImageInfo + + + + void vkCmdRefreshObjectsKHR + VkCommandBuffer commandBuffer + const VkRefreshObjectListKHR* pRefreshObjects + + + VkResult vkGetPhysicalDeviceRefreshableObjectTypesKHR + VkPhysicalDevice physicalDevice + uint32_t* pRefreshableObjectTypeCount + VkObjectType* pRefreshableObjectTypes + + + void vkCmdSetFragmentShadingRateKHR + VkCommandBuffer commandBuffer + const VkExtent2D* pFragmentSize + const VkFragmentShadingRateCombinerOpKHR combinerOps[2] + + + VkResult vkGetPhysicalDeviceFragmentShadingRatesKHR + VkPhysicalDevice physicalDevice + uint32_t* pFragmentShadingRateCount + VkPhysicalDeviceFragmentShadingRateKHR* pFragmentShadingRates + + + void vkCmdSetFragmentShadingRateEnumNV + VkCommandBuffer commandBuffer + VkFragmentShadingRateNV shadingRate + const VkFragmentShadingRateCombinerOpKHR combinerOps[2] + + + void vkGetAccelerationStructureBuildSizesKHR + VkDevice device + VkAccelerationStructureBuildTypeKHR buildType + const VkAccelerationStructureBuildGeometryInfoKHR* pBuildInfo + const uint32_t* pMaxPrimitiveCounts + VkAccelerationStructureBuildSizesInfoKHR* pSizeInfo + + + void vkCmdSetVertexInputEXT + VkCommandBuffer commandBuffer + uint32_t vertexBindingDescriptionCount + const VkVertexInputBindingDescription2EXT* pVertexBindingDescriptions + uint32_t vertexAttributeDescriptionCount + const VkVertexInputAttributeDescription2EXT* pVertexAttributeDescriptions + + + void vkCmdSetColorWriteEnableEXT + VkCommandBuffer commandBuffer + uint32_t attachmentCount + const VkBool32* pColorWriteEnables + + + void vkCmdSetEvent2 + VkCommandBuffer commandBuffer + VkEvent event + const VkDependencyInfo* pDependencyInfo + + + + void vkCmdResetEvent2 + VkCommandBuffer commandBuffer + VkEvent event + VkPipelineStageFlags2 stageMask + + + + void vkCmdWaitEvents2 + VkCommandBuffer commandBuffer + uint32_t eventCount + const VkEvent* pEvents + const VkDependencyInfo* pDependencyInfos + + + + void vkCmdPipelineBarrier2 + VkCommandBuffer commandBuffer + const VkDependencyInfo* pDependencyInfo + + + + VkResult vkQueueSubmit2 + VkQueue queue + uint32_t submitCount + const VkSubmitInfo2* pSubmits + VkFence fence + + + + void vkCmdWriteTimestamp2 + VkCommandBuffer commandBuffer + VkPipelineStageFlags2 stage + VkQueryPool queryPool + uint32_t query + + + + void vkCmdWriteBufferMarker2AMD + VkCommandBuffer commandBuffer + VkPipelineStageFlags2 stage + VkBuffer dstBuffer + VkDeviceSize dstOffset + uint32_t marker + + + void vkGetQueueCheckpointData2NV + VkQueue queue + uint32_t* pCheckpointDataCount + VkCheckpointData2NV* pCheckpointData + + + VkResult vkCopyMemoryToImage + VkDevice device + const VkCopyMemoryToImageInfo* pCopyMemoryToImageInfo + + + + VkResult vkCopyImageToMemory + VkDevice device + const VkCopyImageToMemoryInfo* pCopyImageToMemoryInfo + + + + VkResult vkCopyImageToImage + VkDevice device + const VkCopyImageToImageInfo* pCopyImageToImageInfo + + + + VkResult vkTransitionImageLayout + VkDevice device + uint32_t transitionCount + const VkHostImageLayoutTransitionInfo* pTransitions + + + + void vkGetCommandPoolMemoryConsumption + VkDevice device + VkCommandPool commandPool + VkCommandBuffer commandBuffer + VkCommandPoolMemoryConsumption* pConsumption + + + VkResult vkGetPhysicalDeviceVideoCapabilitiesKHR + VkPhysicalDevice physicalDevice + const VkVideoProfileInfoKHR* pVideoProfile + VkVideoCapabilitiesKHR* pCapabilities + + + VkResult vkGetPhysicalDeviceVideoFormatPropertiesKHR + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceVideoFormatInfoKHR* pVideoFormatInfo + uint32_t* pVideoFormatPropertyCount + VkVideoFormatPropertiesKHR* pVideoFormatProperties + + + VkResult vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR + VkPhysicalDevice physicalDevice + const VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR* pQualityLevelInfo + VkVideoEncodeQualityLevelPropertiesKHR* pQualityLevelProperties + + + VkResult vkCreateVideoSessionKHR + VkDevice device + const VkVideoSessionCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkVideoSessionKHR* pVideoSession + + + void vkDestroyVideoSessionKHR + VkDevice device + VkVideoSessionKHR videoSession + const VkAllocationCallbacks* pAllocator + + + VkResult vkCreateVideoSessionParametersKHR + VkDevice device + const VkVideoSessionParametersCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkVideoSessionParametersKHR* pVideoSessionParameters + + + VkResult vkUpdateVideoSessionParametersKHR + VkDevice device + VkVideoSessionParametersKHR videoSessionParameters + const VkVideoSessionParametersUpdateInfoKHR* pUpdateInfo + + + VkResult vkGetEncodedVideoSessionParametersKHR + VkDevice device + const VkVideoEncodeSessionParametersGetInfoKHR* pVideoSessionParametersInfo + VkVideoEncodeSessionParametersFeedbackInfoKHR* pFeedbackInfo + size_t* pDataSize + void* pData + + + void vkDestroyVideoSessionParametersKHR + VkDevice device + VkVideoSessionParametersKHR videoSessionParameters + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetVideoSessionMemoryRequirementsKHR + VkDevice device + VkVideoSessionKHR videoSession + uint32_t* pMemoryRequirementsCount + VkVideoSessionMemoryRequirementsKHR* pMemoryRequirements + + + VkResult vkBindVideoSessionMemoryKHR + VkDevice device + VkVideoSessionKHR videoSession + uint32_t bindSessionMemoryInfoCount + const VkBindVideoSessionMemoryInfoKHR* pBindSessionMemoryInfos + + + void vkCmdDecodeVideoKHR + VkCommandBuffer commandBuffer + const VkVideoDecodeInfoKHR* pDecodeInfo + + + void vkCmdBeginVideoCodingKHR + VkCommandBuffer commandBuffer + const VkVideoBeginCodingInfoKHR* pBeginInfo + + + void vkCmdControlVideoCodingKHR + VkCommandBuffer commandBuffer + const VkVideoCodingControlInfoKHR* pCodingControlInfo + + + void vkCmdEndVideoCodingKHR + VkCommandBuffer commandBuffer + const VkVideoEndCodingInfoKHR* pEndCodingInfo + + + void vkCmdEncodeVideoKHR + VkCommandBuffer commandBuffer + const VkVideoEncodeInfoKHR* pEncodeInfo + + + void vkCmdDecompressMemoryNV + VkCommandBuffer commandBuffer + uint32_t decompressRegionCount + const VkDecompressMemoryRegionNV* pDecompressMemoryRegions + + + void vkCmdDecompressMemoryIndirectCountNV + VkCommandBuffer commandBuffer + VkDeviceAddress indirectCommandsAddress + VkDeviceAddress indirectCommandsCountAddress + uint32_t stride + + + VkResult vkCreateCuModuleNVX + VkDevice device + const VkCuModuleCreateInfoNVX* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkCuModuleNVX* pModule + + + VkResult vkCreateCuFunctionNVX + VkDevice device + const VkCuFunctionCreateInfoNVX* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkCuFunctionNVX* pFunction + + + void vkDestroyCuModuleNVX + VkDevice device + VkCuModuleNVX module + const VkAllocationCallbacks* pAllocator + + + void vkDestroyCuFunctionNVX + VkDevice device + VkCuFunctionNVX function + const VkAllocationCallbacks* pAllocator + + + void vkCmdCuLaunchKernelNVX + VkCommandBuffer commandBuffer + const VkCuLaunchInfoNVX* pLaunchInfo + + + void vkGetDescriptorSetLayoutSizeEXT + VkDevice device + VkDescriptorSetLayout layout + VkDeviceSize* pLayoutSizeInBytes + + + void vkGetDescriptorSetLayoutBindingOffsetEXT + VkDevice device + VkDescriptorSetLayout layout + uint32_t binding + VkDeviceSize* pOffset + + + void vkGetDescriptorEXT + VkDevice device + const VkDescriptorGetInfoEXT* pDescriptorInfo + size_t dataSize + void* pDescriptor + + + void vkCmdBindDescriptorBuffersEXT + VkCommandBuffer commandBuffer + uint32_t bufferCount + const VkDescriptorBufferBindingInfoEXT* pBindingInfos + + + void vkCmdSetDescriptorBufferOffsetsEXT + VkCommandBuffer commandBuffer + VkPipelineBindPoint pipelineBindPoint + VkPipelineLayout layout + uint32_t firstSet + uint32_t setCount + const uint32_t* pBufferIndices + const VkDeviceSize* pOffsets + + + void vkCmdBindDescriptorBufferEmbeddedSamplersEXT + VkCommandBuffer commandBuffer + VkPipelineBindPoint pipelineBindPoint + VkPipelineLayout layout + uint32_t set + + + VkResult vkGetBufferOpaqueCaptureDescriptorDataEXT + VkDevice device + const VkBufferCaptureDescriptorDataInfoEXT* pInfo + void* pData + + + VkResult vkGetImageOpaqueCaptureDescriptorDataEXT + VkDevice device + const VkImageCaptureDescriptorDataInfoEXT* pInfo + void* pData + + + VkResult vkGetImageViewOpaqueCaptureDescriptorDataEXT + VkDevice device + const VkImageViewCaptureDescriptorDataInfoEXT* pInfo + void* pData + + + VkResult vkGetSamplerOpaqueCaptureDescriptorDataEXT + VkDevice device + const VkSamplerCaptureDescriptorDataInfoEXT* pInfo + void* pData + + + VkResult vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT + VkDevice device + const VkAccelerationStructureCaptureDescriptorDataInfoEXT* pInfo + void* pData + + + void vkSetDeviceMemoryPriorityEXT + VkDevice device + VkDeviceMemory memory + float priority + + + VkResult vkAcquireDrmDisplayEXT + VkPhysicalDevice physicalDevice + int32_t drmFd + VkDisplayKHR display + + + VkResult vkGetDrmDisplayEXT + VkPhysicalDevice physicalDevice + int32_t drmFd + uint32_t connectorId + VkDisplayKHR* display + + + VkResult vkWaitForPresentKHR + VkDevice device + VkSwapchainKHR swapchain + uint64_t presentId + uint64_t timeout + + + VkResult vkCreateBufferCollectionFUCHSIA + VkDevice device + const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkBufferCollectionFUCHSIA* pCollection + + + VkResult vkSetBufferCollectionBufferConstraintsFUCHSIA + VkDevice device + VkBufferCollectionFUCHSIA collection + const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo + + + VkResult vkSetBufferCollectionImageConstraintsFUCHSIA + VkDevice device + VkBufferCollectionFUCHSIA collection + const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo + + + void vkDestroyBufferCollectionFUCHSIA + VkDevice device + VkBufferCollectionFUCHSIA collection + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetBufferCollectionPropertiesFUCHSIA + VkDevice device + VkBufferCollectionFUCHSIA collection + VkBufferCollectionPropertiesFUCHSIA* pProperties + + + VkResult vkCreateCudaModuleNV + VkDevice device + const VkCudaModuleCreateInfoNV* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkCudaModuleNV* pModule + + + VkResult vkGetCudaModuleCacheNV + VkDevice device + VkCudaModuleNV module + size_t* pCacheSize + void* pCacheData + + + VkResult vkCreateCudaFunctionNV + VkDevice device + const VkCudaFunctionCreateInfoNV* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkCudaFunctionNV* pFunction + + + void vkDestroyCudaModuleNV + VkDevice device + VkCudaModuleNV module + const VkAllocationCallbacks* pAllocator + + + void vkDestroyCudaFunctionNV + VkDevice device + VkCudaFunctionNV function + const VkAllocationCallbacks* pAllocator + + + void vkCmdCudaLaunchKernelNV + VkCommandBuffer commandBuffer + const VkCudaLaunchInfoNV* pLaunchInfo + + + void vkCmdBeginRendering + VkCommandBuffer commandBuffer + const VkRenderingInfo* pRenderingInfo + + + + void vkCmdEndRendering + VkCommandBuffer commandBuffer + + + + + void vkGetDescriptorSetLayoutHostMappingInfoVALVE + VkDevice device + const VkDescriptorSetBindingReferenceVALVE* pBindingReference + VkDescriptorSetLayoutHostMappingInfoVALVE* pHostMapping + + + void vkGetDescriptorSetHostMappingVALVE + VkDevice device + VkDescriptorSet descriptorSet + void** ppData + + + VkResult vkCreateMicromapEXT + VkDevice device + const VkMicromapCreateInfoEXT* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkMicromapEXT* pMicromap + + + void vkCmdBuildMicromapsEXT + VkCommandBuffer commandBuffer + uint32_t infoCount + const VkMicromapBuildInfoEXT* pInfos + + + VkResult vkBuildMicromapsEXT + VkDevice device + VkDeferredOperationKHR deferredOperation + uint32_t infoCount + const VkMicromapBuildInfoEXT* pInfos + + + void vkDestroyMicromapEXT + VkDevice device + VkMicromapEXT micromap + const VkAllocationCallbacks* pAllocator + + + void vkCmdCopyMicromapEXT + VkCommandBuffer commandBuffer + const VkCopyMicromapInfoEXT* pInfo + + + VkResult vkCopyMicromapEXT + VkDevice device + VkDeferredOperationKHR deferredOperation + const VkCopyMicromapInfoEXT* pInfo + + + void vkCmdCopyMicromapToMemoryEXT + VkCommandBuffer commandBuffer + const VkCopyMicromapToMemoryInfoEXT* pInfo + + + VkResult vkCopyMicromapToMemoryEXT + VkDevice device + VkDeferredOperationKHR deferredOperation + const VkCopyMicromapToMemoryInfoEXT* pInfo + + + void vkCmdCopyMemoryToMicromapEXT + VkCommandBuffer commandBuffer + const VkCopyMemoryToMicromapInfoEXT* pInfo + + + VkResult vkCopyMemoryToMicromapEXT + VkDevice device + VkDeferredOperationKHR deferredOperation + const VkCopyMemoryToMicromapInfoEXT* pInfo + + + void vkCmdWriteMicromapsPropertiesEXT + VkCommandBuffer commandBuffer + uint32_t micromapCount + const VkMicromapEXT* pMicromaps + VkQueryType queryType + VkQueryPool queryPool + uint32_t firstQuery + + + VkResult vkWriteMicromapsPropertiesEXT + VkDevice device + uint32_t micromapCount + const VkMicromapEXT* pMicromaps + VkQueryType queryType + size_t dataSize + void* pData + size_t stride + + + void vkGetDeviceMicromapCompatibilityEXT + VkDevice device + const VkMicromapVersionInfoEXT* pVersionInfo + VkAccelerationStructureCompatibilityKHR* pCompatibility + + + void vkGetMicromapBuildSizesEXT + VkDevice device + VkAccelerationStructureBuildTypeKHR buildType + const VkMicromapBuildInfoEXT* pBuildInfo + VkMicromapBuildSizesInfoEXT* pSizeInfo + + + void vkGetShaderModuleIdentifierEXT + VkDevice device + VkShaderModule shaderModule + VkShaderModuleIdentifierEXT* pIdentifier + + + void vkGetShaderModuleCreateInfoIdentifierEXT + VkDevice device + const VkShaderModuleCreateInfo* pCreateInfo + VkShaderModuleIdentifierEXT* pIdentifier + + + void vkGetImageSubresourceLayout2 + VkDevice device + VkImage image + const VkImageSubresource2* pSubresource + VkSubresourceLayout2* pLayout + + + + + VkResult vkGetPipelinePropertiesEXT + VkDevice device + const VkPipelineInfoEXT* pPipelineInfo + VkBaseOutStructure* pPipelineProperties + + + void vkExportMetalObjectsEXT + VkDevice device + VkExportMetalObjectsInfoEXT* pMetalObjectsInfo + + + VkResult vkGetFramebufferTilePropertiesQCOM + VkDevice device + VkFramebuffer framebuffer + uint32_t* pPropertiesCount + VkTilePropertiesQCOM* pProperties + + + VkResult vkGetDynamicRenderingTilePropertiesQCOM + VkDevice device + const VkRenderingInfo* pRenderingInfo + VkTilePropertiesQCOM* pProperties + + + VkResult vkGetPhysicalDeviceOpticalFlowImageFormatsNV + VkPhysicalDevice physicalDevice + const VkOpticalFlowImageFormatInfoNV* pOpticalFlowImageFormatInfo + uint32_t* pFormatCount + VkOpticalFlowImageFormatPropertiesNV* pImageFormatProperties + + + VkResult vkCreateOpticalFlowSessionNV + VkDevice device + const VkOpticalFlowSessionCreateInfoNV* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkOpticalFlowSessionNV* pSession + + + void vkDestroyOpticalFlowSessionNV + VkDevice device + VkOpticalFlowSessionNV session + const VkAllocationCallbacks* pAllocator + + + VkResult vkBindOpticalFlowSessionImageNV + VkDevice device + VkOpticalFlowSessionNV session + VkOpticalFlowSessionBindingPointNV bindingPoint + VkImageView view + VkImageLayout layout + + + void vkCmdOpticalFlowExecuteNV + VkCommandBuffer commandBuffer + VkOpticalFlowSessionNV session + const VkOpticalFlowExecuteInfoNV* pExecuteInfo + + + VkResult vkGetDeviceFaultInfoEXT + VkDevice device + VkDeviceFaultCountsEXT* pFaultCounts + VkDeviceFaultInfoEXT* pFaultInfo + + + void vkCmdSetDepthBias2EXT + VkCommandBuffer commandBuffer + const VkDepthBiasInfoEXT* pDepthBiasInfo + + + VkResult vkReleaseSwapchainImagesEXT + VkDevice device + const VkReleaseSwapchainImagesInfoEXT* pReleaseInfo + + + void vkGetDeviceImageSubresourceLayout + VkDevice device + const VkDeviceImageSubresourceInfo* pInfo + VkSubresourceLayout2* pLayout + + + + VkResult vkMapMemory2 + VkDevice device + const VkMemoryMapInfo* pMemoryMapInfo + void** ppData + + + + VkResult vkUnmapMemory2 + VkDevice device + const VkMemoryUnmapInfo* pMemoryUnmapInfo + + + + VkResult vkCreateShadersEXT + VkDevice device + uint32_t createInfoCount + const VkShaderCreateInfoEXT* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkShaderEXT* pShaders + + + void vkDestroyShaderEXT + VkDevice device + VkShaderEXT shader + const VkAllocationCallbacks* pAllocator + + + VkResult vkGetShaderBinaryDataEXT + VkDevice device + VkShaderEXT shader + size_t* pDataSize + void* pData + + + void vkCmdBindShadersEXT + VkCommandBuffer commandBuffer + uint32_t stageCount + const VkShaderStageFlagBits* pStages + const VkShaderEXT* pShaders + + + VkResult vkGetScreenBufferPropertiesQNX + VkDevice device + const struct _screen_buffer* buffer + VkScreenBufferPropertiesQNX* pProperties + + + VkResult vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkCooperativeMatrixPropertiesKHR* pProperties + + + VkResult vkGetExecutionGraphPipelineScratchSizeAMDX + VkDevice device + VkPipeline executionGraph + VkExecutionGraphPipelineScratchSizeAMDX* pSizeInfo + + + VkResult vkGetExecutionGraphPipelineNodeIndexAMDX + VkDevice device + VkPipeline executionGraph + const VkPipelineShaderStageNodeCreateInfoAMDX* pNodeInfo + uint32_t* pNodeIndex + + + VkResult vkCreateExecutionGraphPipelinesAMDX + VkDevice device + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkExecutionGraphPipelineCreateInfoAMDX* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + + void vkCmdInitializeGraphScratchMemoryAMDX + VkCommandBuffer commandBuffer + VkPipeline executionGraph + VkDeviceAddress scratch + VkDeviceSize scratchSize + + + void vkCmdDispatchGraphAMDX + VkCommandBuffer commandBuffer + VkDeviceAddress scratch + VkDeviceSize scratchSize + const VkDispatchGraphCountInfoAMDX* pCountInfo + + + void vkCmdDispatchGraphIndirectAMDX + VkCommandBuffer commandBuffer + VkDeviceAddress scratch + VkDeviceSize scratchSize + const VkDispatchGraphCountInfoAMDX* pCountInfo + + + void vkCmdDispatchGraphIndirectCountAMDX + VkCommandBuffer commandBuffer + VkDeviceAddress scratch + VkDeviceSize scratchSize + VkDeviceAddress countInfo + + + void vkCmdBindDescriptorSets2 + VkCommandBuffer commandBuffer + const VkBindDescriptorSetsInfo* pBindDescriptorSetsInfo + + + + void vkCmdPushConstants2 + VkCommandBuffer commandBuffer + const VkPushConstantsInfo* pPushConstantsInfo + + + + void vkCmdPushDescriptorSet2 + VkCommandBuffer commandBuffer + const VkPushDescriptorSetInfo* pPushDescriptorSetInfo + + + + void vkCmdPushDescriptorSetWithTemplate2 + VkCommandBuffer commandBuffer + const VkPushDescriptorSetWithTemplateInfo* pPushDescriptorSetWithTemplateInfo + + + + void vkCmdSetDescriptorBufferOffsets2EXT + VkCommandBuffer commandBuffer + const VkSetDescriptorBufferOffsetsInfoEXT* pSetDescriptorBufferOffsetsInfo + + + void vkCmdBindDescriptorBufferEmbeddedSamplers2EXT + VkCommandBuffer commandBuffer + const VkBindDescriptorBufferEmbeddedSamplersInfoEXT* pBindDescriptorBufferEmbeddedSamplersInfo + + + VkResult vkSetLatencySleepModeNV + VkDevice device + VkSwapchainKHR swapchain + const VkLatencySleepModeInfoNV* pSleepModeInfo + + + VkResult vkLatencySleepNV + VkDevice device + VkSwapchainKHR swapchain + const VkLatencySleepInfoNV* pSleepInfo + + + void vkSetLatencyMarkerNV + VkDevice device + VkSwapchainKHR swapchain + const VkSetLatencyMarkerInfoNV* pLatencyMarkerInfo + + + void vkGetLatencyTimingsNV + VkDevice device + VkSwapchainKHR swapchain + VkGetLatencyMarkerInfoNV* pLatencyMarkerInfo + + + void vkQueueNotifyOutOfBandNV + VkQueue queue + const VkOutOfBandQueueTypeInfoNV* pQueueTypeInfo + + + void vkCmdSetRenderingAttachmentLocations + VkCommandBuffer commandBuffer + const VkRenderingAttachmentLocationInfo* pLocationInfo + + + + void vkCmdSetRenderingInputAttachmentIndices + VkCommandBuffer commandBuffer + const VkRenderingInputAttachmentIndexInfo* pInputAttachmentIndexInfo + + + + void vkCmdSetDepthClampRangeEXT + VkCommandBuffer commandBuffer + VkDepthClampModeEXT depthClampMode + const VkDepthClampRangeEXT* pDepthClampRange + + + VkResult vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkCooperativeMatrixFlexibleDimensionsPropertiesNV* pProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + offset 1 reserved for the old VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHX enum + offset 2 reserved for the old VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHX enum + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Additional dependent types / tokens extending enumerants, not explicitly mentioned + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Additional dependent types / tokens extending enumerants, not explicitly mentioned + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This duplicates definitions in VK_KHR_device_group below + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VK_ANDROID_native_buffer is used between the Android Vulkan loader and drivers to implement the WSI extensions. It is not exposed to applications and uses types that are not part of Android's stable public API, so it is left disabled to keep it out of the standard Vulkan headers. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This duplicates definitions in other extensions, below + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + enum offset=0 was mistakenly used for the 1.1 core enum + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES + (value=1000094000). Fortunately, no conflict resulted. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This extension requires buffer_device_address functionality. + VK_EXT_buffer_device_address is also acceptable, but since it is deprecated the KHR version is preferred. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + These enums are present only to inform downstream + consumers like KTX2. There is no actual Vulkan extension + corresponding to the enums. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT and + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT + were not promoted to Vulkan 1.3. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VkPhysicalDevice4444FormatsFeaturesEXT and + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT + were not promoted to Vulkan 1.3. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NV internal use only + + + + + + + + + + + + + + + + + + + + + + + + + + + NV internal use only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fragment shader stage is added by the VK_EXT_shader_tile_image extension + + + + + + + Fragment shader stage is added by the VK_EXT_shader_tile_image extension + + + + + + + + + + + + + + + + + + + TODO/Suggestion. Introduce 'synclist' (could be a different name) element + that specifies the list of stages, accesses, etc. This list can be used by + 'syncaccess' or 'syncstage' elements. For example, 'syncsupport' in addition to the + 'stage' attribute can support 'list' attribute to reference 'synclist'. + We can have the lists defined for ALL stages and it can be shared between MEMORY_READ + and MEMORY_WRITE accesses. Similarly, ALL shader stages list is often used. This proposal + is a way to fix duplication problem. When new stage is added multiple places needs to be + updated. It is potential source of bugs. The expectation such setup will produce more + robust system and also more simple structure to review and validate. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT + VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT + VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT + VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT + VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT + VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT + VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT + VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT + VK_PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR + VK_PIPELINE_STAGE_2_FRAGMENT_DENSITY_PROCESS_BIT_EXT + VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT + VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT + VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT + VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT + VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT + + + VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT + VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_EXT + VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_EXT + VK_PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR + VK_PIPELINE_STAGE_2_FRAGMENT_DENSITY_PROCESS_BIT_EXT + VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT + VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT + VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT + VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT + VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT + + + VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT + VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT + VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT + + + VK_PIPELINE_STAGE_2_TRANSFER_BIT + + + VK_PIPELINE_STAGE_2_HOST_BIT + + + VK_PIPELINE_STAGE_2_SUBPASS_SHADER_BIT_HUAWEI + + + VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_EXT + + + VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_KHR + + + VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHR + + + VK_PIPELINE_STAGE_2_MICROMAP_BUILD_BIT_EXT + + + VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT + VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR + + + VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR + + + VK_PIPELINE_STAGE_2_VIDEO_ENCODE_BIT_KHR + + + VK_PIPELINE_STAGE_2_OPTICAL_FLOW_BIT_NV + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From cd2727547748d503d2cc34250cb4c297fbf76802 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Mon, 12 Dec 2022 05:35:07 +0200 Subject: [PATCH 0002/2542] winevulkan: Remove autogenerated files. Proton's build system creates them anyway. They are getting outdated pretty fast and are confusing at best. --- dlls/vulkan-1/vulkan-1.spec | 278 - dlls/winevulkan/loader_thunks.c | 7413 ---- dlls/winevulkan/loader_thunks.h | 5520 --- dlls/winevulkan/vulkan_thunks.c | 56497 ------------------------------ dlls/winevulkan/vulkan_thunks.h | 68 - dlls/winevulkan/winevulkan.json | 7 - dlls/winevulkan/winevulkan.spec | 283 - include/wine/vulkan.h | 18981 ---------- 8 files changed, 89047 deletions(-) delete mode 100644 dlls/vulkan-1/vulkan-1.spec delete mode 100644 dlls/winevulkan/loader_thunks.c delete mode 100644 dlls/winevulkan/loader_thunks.h delete mode 100644 dlls/winevulkan/vulkan_thunks.c delete mode 100644 dlls/winevulkan/vulkan_thunks.h delete mode 100644 dlls/winevulkan/winevulkan.json delete mode 100644 dlls/winevulkan/winevulkan.spec delete mode 100644 include/wine/vulkan.h diff --git a/dlls/vulkan-1/vulkan-1.spec b/dlls/vulkan-1/vulkan-1.spec deleted file mode 100644 index e20caa91a5f0..000000000000 --- a/dlls/vulkan-1/vulkan-1.spec +++ /dev/null @@ -1,278 +0,0 @@ -# Automatically generated from Vulkan vk.xml and video.xml; DO NOT EDIT! -# -# This file is generated from Vulkan vk.xml file covered -# by the following copyright and permission notice: -# -# Copyright 2015-2024 The Khronos Group Inc. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# and from Vulkan video.xml file covered -# by the following copyright and permission notice: -# -# Copyright 2021-2024 The Khronos Group Inc. -# SPDX-License-Identifier: Apache-2.0 OR MIT -# - -@ stdcall vkAcquireNextImage2KHR(ptr ptr ptr) winevulkan.vkAcquireNextImage2KHR -@ stdcall vkAcquireNextImageKHR(ptr int64 int64 int64 int64 ptr) winevulkan.vkAcquireNextImageKHR -@ stdcall vkAllocateCommandBuffers(ptr ptr ptr) winevulkan.vkAllocateCommandBuffers -@ stdcall vkAllocateDescriptorSets(ptr ptr ptr) winevulkan.vkAllocateDescriptorSets -@ stdcall vkAllocateMemory(ptr ptr ptr ptr) winevulkan.vkAllocateMemory -@ stdcall vkBeginCommandBuffer(ptr ptr) winevulkan.vkBeginCommandBuffer -@ stdcall vkBindBufferMemory(ptr int64 int64 int64) winevulkan.vkBindBufferMemory -@ stdcall vkBindBufferMemory2(ptr long ptr) winevulkan.vkBindBufferMemory2 -@ stdcall vkBindImageMemory(ptr int64 int64 int64) winevulkan.vkBindImageMemory -@ stdcall vkBindImageMemory2(ptr long ptr) winevulkan.vkBindImageMemory2 -@ stdcall vkCmdBeginQuery(ptr int64 long long) winevulkan.vkCmdBeginQuery -@ stdcall vkCmdBeginRenderPass(ptr ptr long) winevulkan.vkCmdBeginRenderPass -@ stdcall vkCmdBeginRenderPass2(ptr ptr ptr) winevulkan.vkCmdBeginRenderPass2 -@ stdcall vkCmdBeginRendering(ptr ptr) winevulkan.vkCmdBeginRendering -@ stdcall vkCmdBindDescriptorSets(ptr long int64 long long ptr long ptr) winevulkan.vkCmdBindDescriptorSets -@ stdcall vkCmdBindDescriptorSets2(ptr ptr) winevulkan.vkCmdBindDescriptorSets2 -@ stdcall vkCmdBindIndexBuffer(ptr int64 int64 long) winevulkan.vkCmdBindIndexBuffer -@ stdcall vkCmdBindIndexBuffer2(ptr int64 int64 int64 long) winevulkan.vkCmdBindIndexBuffer2 -@ stdcall vkCmdBindPipeline(ptr long int64) winevulkan.vkCmdBindPipeline -@ stdcall vkCmdBindVertexBuffers(ptr long long ptr ptr) winevulkan.vkCmdBindVertexBuffers -@ stdcall vkCmdBindVertexBuffers2(ptr long long ptr ptr ptr ptr) winevulkan.vkCmdBindVertexBuffers2 -@ stdcall vkCmdBlitImage(ptr int64 long int64 long long ptr long) winevulkan.vkCmdBlitImage -@ stdcall vkCmdBlitImage2(ptr ptr) winevulkan.vkCmdBlitImage2 -@ stdcall vkCmdClearAttachments(ptr long ptr long ptr) winevulkan.vkCmdClearAttachments -@ stdcall vkCmdClearColorImage(ptr int64 long ptr long ptr) winevulkan.vkCmdClearColorImage -@ stdcall vkCmdClearDepthStencilImage(ptr int64 long ptr long ptr) winevulkan.vkCmdClearDepthStencilImage -@ stdcall vkCmdCopyBuffer(ptr int64 int64 long ptr) winevulkan.vkCmdCopyBuffer -@ stdcall vkCmdCopyBuffer2(ptr ptr) winevulkan.vkCmdCopyBuffer2 -@ stdcall vkCmdCopyBufferToImage(ptr int64 int64 long long ptr) winevulkan.vkCmdCopyBufferToImage -@ stdcall vkCmdCopyBufferToImage2(ptr ptr) winevulkan.vkCmdCopyBufferToImage2 -@ stdcall vkCmdCopyImage(ptr int64 long int64 long long ptr) winevulkan.vkCmdCopyImage -@ stdcall vkCmdCopyImage2(ptr ptr) winevulkan.vkCmdCopyImage2 -@ stdcall vkCmdCopyImageToBuffer(ptr int64 long int64 long ptr) winevulkan.vkCmdCopyImageToBuffer -@ stdcall vkCmdCopyImageToBuffer2(ptr ptr) winevulkan.vkCmdCopyImageToBuffer2 -@ stdcall vkCmdCopyQueryPoolResults(ptr int64 long long int64 int64 int64 long) winevulkan.vkCmdCopyQueryPoolResults -@ stdcall vkCmdDispatch(ptr long long long) winevulkan.vkCmdDispatch -@ stdcall vkCmdDispatchBase(ptr long long long long long long) winevulkan.vkCmdDispatchBase -@ stdcall vkCmdDispatchIndirect(ptr int64 int64) winevulkan.vkCmdDispatchIndirect -@ stdcall vkCmdDraw(ptr long long long long) winevulkan.vkCmdDraw -@ stdcall vkCmdDrawIndexed(ptr long long long long long) winevulkan.vkCmdDrawIndexed -@ stdcall vkCmdDrawIndexedIndirect(ptr int64 int64 long long) winevulkan.vkCmdDrawIndexedIndirect -@ stdcall vkCmdDrawIndexedIndirectCount(ptr int64 int64 int64 int64 long long) winevulkan.vkCmdDrawIndexedIndirectCount -@ stdcall vkCmdDrawIndirect(ptr int64 int64 long long) winevulkan.vkCmdDrawIndirect -@ stdcall vkCmdDrawIndirectCount(ptr int64 int64 int64 int64 long long) winevulkan.vkCmdDrawIndirectCount -@ stdcall vkCmdEndQuery(ptr int64 long) winevulkan.vkCmdEndQuery -@ stdcall vkCmdEndRenderPass(ptr) winevulkan.vkCmdEndRenderPass -@ stdcall vkCmdEndRenderPass2(ptr ptr) winevulkan.vkCmdEndRenderPass2 -@ stdcall vkCmdEndRendering(ptr) winevulkan.vkCmdEndRendering -@ stdcall vkCmdExecuteCommands(ptr long ptr) winevulkan.vkCmdExecuteCommands -@ stdcall vkCmdFillBuffer(ptr int64 int64 int64 long) winevulkan.vkCmdFillBuffer -@ stdcall vkCmdNextSubpass(ptr long) winevulkan.vkCmdNextSubpass -@ stdcall vkCmdNextSubpass2(ptr ptr ptr) winevulkan.vkCmdNextSubpass2 -@ stdcall vkCmdPipelineBarrier(ptr long long long long ptr long ptr long ptr) winevulkan.vkCmdPipelineBarrier -@ stdcall vkCmdPipelineBarrier2(ptr ptr) winevulkan.vkCmdPipelineBarrier2 -@ stdcall vkCmdPushConstants(ptr int64 long long long ptr) winevulkan.vkCmdPushConstants -@ stdcall vkCmdPushConstants2(ptr ptr) winevulkan.vkCmdPushConstants2 -@ stdcall vkCmdPushDescriptorSet(ptr long int64 long long ptr) winevulkan.vkCmdPushDescriptorSet -@ stdcall vkCmdPushDescriptorSet2(ptr ptr) winevulkan.vkCmdPushDescriptorSet2 -@ stdcall vkCmdPushDescriptorSetWithTemplate(ptr int64 int64 long ptr) winevulkan.vkCmdPushDescriptorSetWithTemplate -@ stdcall vkCmdPushDescriptorSetWithTemplate2(ptr ptr) winevulkan.vkCmdPushDescriptorSetWithTemplate2 -@ stdcall vkCmdResetEvent(ptr int64 long) winevulkan.vkCmdResetEvent -@ stdcall vkCmdResetEvent2(ptr int64 int64) winevulkan.vkCmdResetEvent2 -@ stdcall vkCmdResetQueryPool(ptr int64 long long) winevulkan.vkCmdResetQueryPool -@ stdcall vkCmdResolveImage(ptr int64 long int64 long long ptr) winevulkan.vkCmdResolveImage -@ stdcall vkCmdResolveImage2(ptr ptr) winevulkan.vkCmdResolveImage2 -@ stdcall vkCmdSetBlendConstants(ptr ptr) winevulkan.vkCmdSetBlendConstants -@ stdcall vkCmdSetCullMode(ptr long) winevulkan.vkCmdSetCullMode -@ stdcall vkCmdSetDepthBias(ptr float float float) winevulkan.vkCmdSetDepthBias -@ stdcall vkCmdSetDepthBiasEnable(ptr long) winevulkan.vkCmdSetDepthBiasEnable -@ stdcall vkCmdSetDepthBounds(ptr float float) winevulkan.vkCmdSetDepthBounds -@ stdcall vkCmdSetDepthBoundsTestEnable(ptr long) winevulkan.vkCmdSetDepthBoundsTestEnable -@ stdcall vkCmdSetDepthCompareOp(ptr long) winevulkan.vkCmdSetDepthCompareOp -@ stdcall vkCmdSetDepthTestEnable(ptr long) winevulkan.vkCmdSetDepthTestEnable -@ stdcall vkCmdSetDepthWriteEnable(ptr long) winevulkan.vkCmdSetDepthWriteEnable -@ stdcall vkCmdSetDeviceMask(ptr long) winevulkan.vkCmdSetDeviceMask -@ stdcall vkCmdSetEvent(ptr int64 long) winevulkan.vkCmdSetEvent -@ stdcall vkCmdSetEvent2(ptr int64 ptr) winevulkan.vkCmdSetEvent2 -@ stdcall vkCmdSetFrontFace(ptr long) winevulkan.vkCmdSetFrontFace -@ stdcall vkCmdSetLineStipple(ptr long long) winevulkan.vkCmdSetLineStipple -@ stdcall vkCmdSetLineWidth(ptr float) winevulkan.vkCmdSetLineWidth -@ stdcall vkCmdSetPrimitiveRestartEnable(ptr long) winevulkan.vkCmdSetPrimitiveRestartEnable -@ stdcall vkCmdSetPrimitiveTopology(ptr long) winevulkan.vkCmdSetPrimitiveTopology -@ stdcall vkCmdSetRasterizerDiscardEnable(ptr long) winevulkan.vkCmdSetRasterizerDiscardEnable -@ stdcall vkCmdSetRenderingAttachmentLocations(ptr ptr) winevulkan.vkCmdSetRenderingAttachmentLocations -@ stdcall vkCmdSetRenderingInputAttachmentIndices(ptr ptr) winevulkan.vkCmdSetRenderingInputAttachmentIndices -@ stdcall vkCmdSetScissor(ptr long long ptr) winevulkan.vkCmdSetScissor -@ stdcall vkCmdSetScissorWithCount(ptr long ptr) winevulkan.vkCmdSetScissorWithCount -@ stdcall vkCmdSetStencilCompareMask(ptr long long) winevulkan.vkCmdSetStencilCompareMask -@ stdcall vkCmdSetStencilOp(ptr long long long long long) winevulkan.vkCmdSetStencilOp -@ stdcall vkCmdSetStencilReference(ptr long long) winevulkan.vkCmdSetStencilReference -@ stdcall vkCmdSetStencilTestEnable(ptr long) winevulkan.vkCmdSetStencilTestEnable -@ stdcall vkCmdSetStencilWriteMask(ptr long long) winevulkan.vkCmdSetStencilWriteMask -@ stdcall vkCmdSetViewport(ptr long long ptr) winevulkan.vkCmdSetViewport -@ stdcall vkCmdSetViewportWithCount(ptr long ptr) winevulkan.vkCmdSetViewportWithCount -@ stdcall vkCmdUpdateBuffer(ptr int64 int64 int64 ptr) winevulkan.vkCmdUpdateBuffer -@ stdcall vkCmdWaitEvents(ptr long ptr long long long ptr long ptr long ptr) winevulkan.vkCmdWaitEvents -@ stdcall vkCmdWaitEvents2(ptr long ptr ptr) winevulkan.vkCmdWaitEvents2 -@ stdcall vkCmdWriteTimestamp(ptr long int64 long) winevulkan.vkCmdWriteTimestamp -@ stdcall vkCmdWriteTimestamp2(ptr int64 int64 long) winevulkan.vkCmdWriteTimestamp2 -@ stdcall vkCopyImageToImage(ptr ptr) winevulkan.vkCopyImageToImage -@ stdcall vkCopyImageToMemory(ptr ptr) winevulkan.vkCopyImageToMemory -@ stdcall vkCopyMemoryToImage(ptr ptr) winevulkan.vkCopyMemoryToImage -@ stdcall vkCreateBuffer(ptr ptr ptr ptr) winevulkan.vkCreateBuffer -@ stdcall vkCreateBufferView(ptr ptr ptr ptr) winevulkan.vkCreateBufferView -@ stdcall vkCreateCommandPool(ptr ptr ptr ptr) winevulkan.vkCreateCommandPool -@ stdcall vkCreateComputePipelines(ptr int64 long ptr ptr ptr) winevulkan.vkCreateComputePipelines -@ stdcall vkCreateDescriptorPool(ptr ptr ptr ptr) winevulkan.vkCreateDescriptorPool -@ stdcall vkCreateDescriptorSetLayout(ptr ptr ptr ptr) winevulkan.vkCreateDescriptorSetLayout -@ stdcall vkCreateDescriptorUpdateTemplate(ptr ptr ptr ptr) winevulkan.vkCreateDescriptorUpdateTemplate -@ stdcall vkCreateDevice(ptr ptr ptr ptr) winevulkan.vkCreateDevice -@ stub vkCreateDisplayModeKHR -@ stub vkCreateDisplayPlaneSurfaceKHR -@ stdcall vkCreateEvent(ptr ptr ptr ptr) winevulkan.vkCreateEvent -@ stdcall vkCreateFence(ptr ptr ptr ptr) winevulkan.vkCreateFence -@ stdcall vkCreateFramebuffer(ptr ptr ptr ptr) winevulkan.vkCreateFramebuffer -@ stdcall vkCreateGraphicsPipelines(ptr int64 long ptr ptr ptr) winevulkan.vkCreateGraphicsPipelines -@ stdcall vkCreateImage(ptr ptr ptr ptr) winevulkan.vkCreateImage -@ stdcall vkCreateImageView(ptr ptr ptr ptr) winevulkan.vkCreateImageView -@ stdcall vkCreateInstance(ptr ptr ptr) winevulkan.vkCreateInstance -@ stdcall vkCreatePipelineCache(ptr ptr ptr ptr) winevulkan.vkCreatePipelineCache -@ stdcall vkCreatePipelineLayout(ptr ptr ptr ptr) winevulkan.vkCreatePipelineLayout -@ stdcall vkCreatePrivateDataSlot(ptr ptr ptr ptr) winevulkan.vkCreatePrivateDataSlot -@ stdcall vkCreateQueryPool(ptr ptr ptr ptr) winevulkan.vkCreateQueryPool -@ stdcall vkCreateRenderPass(ptr ptr ptr ptr) winevulkan.vkCreateRenderPass -@ stdcall vkCreateRenderPass2(ptr ptr ptr ptr) winevulkan.vkCreateRenderPass2 -@ stdcall vkCreateSampler(ptr ptr ptr ptr) winevulkan.vkCreateSampler -@ stdcall vkCreateSamplerYcbcrConversion(ptr ptr ptr ptr) winevulkan.vkCreateSamplerYcbcrConversion -@ stdcall vkCreateSemaphore(ptr ptr ptr ptr) winevulkan.vkCreateSemaphore -@ stdcall vkCreateShaderModule(ptr ptr ptr ptr) winevulkan.vkCreateShaderModule -@ stub vkCreateSharedSwapchainsKHR -@ stdcall vkCreateSwapchainKHR(ptr ptr ptr ptr) winevulkan.vkCreateSwapchainKHR -@ stdcall vkCreateWin32SurfaceKHR(ptr ptr ptr ptr) winevulkan.vkCreateWin32SurfaceKHR -@ stdcall vkDestroyBuffer(ptr int64 ptr) winevulkan.vkDestroyBuffer -@ stdcall vkDestroyBufferView(ptr int64 ptr) winevulkan.vkDestroyBufferView -@ stdcall vkDestroyCommandPool(ptr int64 ptr) winevulkan.vkDestroyCommandPool -@ stdcall vkDestroyDescriptorPool(ptr int64 ptr) winevulkan.vkDestroyDescriptorPool -@ stdcall vkDestroyDescriptorSetLayout(ptr int64 ptr) winevulkan.vkDestroyDescriptorSetLayout -@ stdcall vkDestroyDescriptorUpdateTemplate(ptr int64 ptr) winevulkan.vkDestroyDescriptorUpdateTemplate -@ stdcall vkDestroyDevice(ptr ptr) winevulkan.vkDestroyDevice -@ stdcall vkDestroyEvent(ptr int64 ptr) winevulkan.vkDestroyEvent -@ stdcall vkDestroyFence(ptr int64 ptr) winevulkan.vkDestroyFence -@ stdcall vkDestroyFramebuffer(ptr int64 ptr) winevulkan.vkDestroyFramebuffer -@ stdcall vkDestroyImage(ptr int64 ptr) winevulkan.vkDestroyImage -@ stdcall vkDestroyImageView(ptr int64 ptr) winevulkan.vkDestroyImageView -@ stdcall vkDestroyInstance(ptr ptr) winevulkan.vkDestroyInstance -@ stdcall vkDestroyPipeline(ptr int64 ptr) winevulkan.vkDestroyPipeline -@ stdcall vkDestroyPipelineCache(ptr int64 ptr) winevulkan.vkDestroyPipelineCache -@ stdcall vkDestroyPipelineLayout(ptr int64 ptr) winevulkan.vkDestroyPipelineLayout -@ stdcall vkDestroyPrivateDataSlot(ptr int64 ptr) winevulkan.vkDestroyPrivateDataSlot -@ stdcall vkDestroyQueryPool(ptr int64 ptr) winevulkan.vkDestroyQueryPool -@ stdcall vkDestroyRenderPass(ptr int64 ptr) winevulkan.vkDestroyRenderPass -@ stdcall vkDestroySampler(ptr int64 ptr) winevulkan.vkDestroySampler -@ stdcall vkDestroySamplerYcbcrConversion(ptr int64 ptr) winevulkan.vkDestroySamplerYcbcrConversion -@ stdcall vkDestroySemaphore(ptr int64 ptr) winevulkan.vkDestroySemaphore -@ stdcall vkDestroyShaderModule(ptr int64 ptr) winevulkan.vkDestroyShaderModule -@ stdcall vkDestroySurfaceKHR(ptr int64 ptr) winevulkan.vkDestroySurfaceKHR -@ stdcall vkDestroySwapchainKHR(ptr int64 ptr) winevulkan.vkDestroySwapchainKHR -@ stdcall vkDeviceWaitIdle(ptr) winevulkan.vkDeviceWaitIdle -@ stdcall vkEndCommandBuffer(ptr) winevulkan.vkEndCommandBuffer -@ stdcall vkEnumerateDeviceExtensionProperties(ptr str ptr ptr) winevulkan.vkEnumerateDeviceExtensionProperties -@ stdcall vkEnumerateDeviceLayerProperties(ptr ptr ptr) winevulkan.vkEnumerateDeviceLayerProperties -@ stdcall vkEnumerateInstanceExtensionProperties(str ptr ptr) winevulkan.vkEnumerateInstanceExtensionProperties -@ stdcall vkEnumerateInstanceLayerProperties(ptr ptr) winevulkan.vkEnumerateInstanceLayerProperties -@ stdcall vkEnumerateInstanceVersion(ptr) winevulkan.vkEnumerateInstanceVersion -@ stdcall vkEnumeratePhysicalDeviceGroups(ptr ptr ptr) winevulkan.vkEnumeratePhysicalDeviceGroups -@ stdcall vkEnumeratePhysicalDevices(ptr ptr ptr) winevulkan.vkEnumeratePhysicalDevices -@ stdcall vkFlushMappedMemoryRanges(ptr long ptr) winevulkan.vkFlushMappedMemoryRanges -@ stdcall vkFreeCommandBuffers(ptr int64 long ptr) winevulkan.vkFreeCommandBuffers -@ stdcall vkFreeDescriptorSets(ptr int64 long ptr) winevulkan.vkFreeDescriptorSets -@ stdcall vkFreeMemory(ptr int64 ptr) winevulkan.vkFreeMemory -@ stdcall vkGetBufferDeviceAddress(ptr ptr) winevulkan.vkGetBufferDeviceAddress -@ stdcall vkGetBufferMemoryRequirements(ptr int64 ptr) winevulkan.vkGetBufferMemoryRequirements -@ stdcall vkGetBufferMemoryRequirements2(ptr ptr ptr) winevulkan.vkGetBufferMemoryRequirements2 -@ stdcall vkGetBufferOpaqueCaptureAddress(ptr ptr) winevulkan.vkGetBufferOpaqueCaptureAddress -@ stub vkGetCommandPoolMemoryConsumption -@ stdcall vkGetDescriptorSetLayoutSupport(ptr ptr ptr) winevulkan.vkGetDescriptorSetLayoutSupport -@ stdcall vkGetDeviceBufferMemoryRequirements(ptr ptr ptr) winevulkan.vkGetDeviceBufferMemoryRequirements -@ stdcall vkGetDeviceGroupPeerMemoryFeatures(ptr long long long ptr) winevulkan.vkGetDeviceGroupPeerMemoryFeatures -@ stdcall vkGetDeviceGroupPresentCapabilitiesKHR(ptr ptr) winevulkan.vkGetDeviceGroupPresentCapabilitiesKHR -@ stdcall vkGetDeviceGroupSurfacePresentModesKHR(ptr int64 ptr) winevulkan.vkGetDeviceGroupSurfacePresentModesKHR -@ stdcall vkGetDeviceImageMemoryRequirements(ptr ptr ptr) winevulkan.vkGetDeviceImageMemoryRequirements -@ stdcall vkGetDeviceImageSparseMemoryRequirements(ptr ptr ptr ptr) winevulkan.vkGetDeviceImageSparseMemoryRequirements -@ stdcall vkGetDeviceImageSubresourceLayout(ptr ptr ptr) winevulkan.vkGetDeviceImageSubresourceLayout -@ stdcall vkGetDeviceMemoryCommitment(ptr int64 ptr) winevulkan.vkGetDeviceMemoryCommitment -@ stdcall vkGetDeviceMemoryOpaqueCaptureAddress(ptr ptr) winevulkan.vkGetDeviceMemoryOpaqueCaptureAddress -@ stdcall vkGetDeviceProcAddr(ptr str) winevulkan.vkGetDeviceProcAddr -@ stdcall vkGetDeviceQueue(ptr long long ptr) winevulkan.vkGetDeviceQueue -@ stdcall vkGetDeviceQueue2(ptr ptr ptr) winevulkan.vkGetDeviceQueue2 -@ stub vkGetDisplayModePropertiesKHR -@ stub vkGetDisplayPlaneCapabilitiesKHR -@ stub vkGetDisplayPlaneSupportedDisplaysKHR -@ stdcall vkGetEventStatus(ptr int64) winevulkan.vkGetEventStatus -@ stub vkGetFaultData -@ stdcall vkGetFenceStatus(ptr int64) winevulkan.vkGetFenceStatus -@ stdcall vkGetImageMemoryRequirements(ptr int64 ptr) winevulkan.vkGetImageMemoryRequirements -@ stdcall vkGetImageMemoryRequirements2(ptr ptr ptr) winevulkan.vkGetImageMemoryRequirements2 -@ stdcall vkGetImageSparseMemoryRequirements(ptr int64 ptr ptr) winevulkan.vkGetImageSparseMemoryRequirements -@ stdcall vkGetImageSparseMemoryRequirements2(ptr ptr ptr ptr) winevulkan.vkGetImageSparseMemoryRequirements2 -@ stdcall vkGetImageSubresourceLayout(ptr int64 ptr ptr) winevulkan.vkGetImageSubresourceLayout -@ stdcall vkGetImageSubresourceLayout2(ptr int64 ptr ptr) winevulkan.vkGetImageSubresourceLayout2 -@ stdcall vkGetInstanceProcAddr(ptr str) winevulkan.vkGetInstanceProcAddr -@ stub vkGetPhysicalDeviceDisplayPlanePropertiesKHR -@ stub vkGetPhysicalDeviceDisplayPropertiesKHR -@ stdcall vkGetPhysicalDeviceExternalBufferProperties(ptr ptr ptr) winevulkan.vkGetPhysicalDeviceExternalBufferProperties -@ stdcall vkGetPhysicalDeviceExternalFenceProperties(ptr ptr ptr) winevulkan.vkGetPhysicalDeviceExternalFenceProperties -@ stdcall vkGetPhysicalDeviceExternalSemaphoreProperties(ptr ptr ptr) winevulkan.vkGetPhysicalDeviceExternalSemaphoreProperties -@ stdcall vkGetPhysicalDeviceFeatures(ptr ptr) winevulkan.vkGetPhysicalDeviceFeatures -@ stdcall vkGetPhysicalDeviceFeatures2(ptr ptr) winevulkan.vkGetPhysicalDeviceFeatures2 -@ stdcall vkGetPhysicalDeviceFormatProperties(ptr long ptr) winevulkan.vkGetPhysicalDeviceFormatProperties -@ stdcall vkGetPhysicalDeviceFormatProperties2(ptr long ptr) winevulkan.vkGetPhysicalDeviceFormatProperties2 -@ stdcall vkGetPhysicalDeviceImageFormatProperties(ptr long long long long long ptr) winevulkan.vkGetPhysicalDeviceImageFormatProperties -@ stdcall vkGetPhysicalDeviceImageFormatProperties2(ptr ptr ptr) winevulkan.vkGetPhysicalDeviceImageFormatProperties2 -@ stdcall vkGetPhysicalDeviceMemoryProperties(ptr ptr) winevulkan.vkGetPhysicalDeviceMemoryProperties -@ stdcall vkGetPhysicalDeviceMemoryProperties2(ptr ptr) winevulkan.vkGetPhysicalDeviceMemoryProperties2 -@ stdcall vkGetPhysicalDevicePresentRectanglesKHR(ptr int64 ptr ptr) winevulkan.vkGetPhysicalDevicePresentRectanglesKHR -@ stdcall vkGetPhysicalDeviceProperties(ptr ptr) winevulkan.vkGetPhysicalDeviceProperties -@ stdcall vkGetPhysicalDeviceProperties2(ptr ptr) winevulkan.vkGetPhysicalDeviceProperties2 -@ stdcall vkGetPhysicalDeviceQueueFamilyProperties(ptr ptr ptr) winevulkan.vkGetPhysicalDeviceQueueFamilyProperties -@ stdcall vkGetPhysicalDeviceQueueFamilyProperties2(ptr ptr ptr) winevulkan.vkGetPhysicalDeviceQueueFamilyProperties2 -@ stdcall vkGetPhysicalDeviceSparseImageFormatProperties(ptr long long long long long ptr ptr) winevulkan.vkGetPhysicalDeviceSparseImageFormatProperties -@ stdcall vkGetPhysicalDeviceSparseImageFormatProperties2(ptr ptr ptr ptr) winevulkan.vkGetPhysicalDeviceSparseImageFormatProperties2 -@ stdcall vkGetPhysicalDeviceSurfaceCapabilities2KHR(ptr ptr ptr) winevulkan.vkGetPhysicalDeviceSurfaceCapabilities2KHR -@ stdcall vkGetPhysicalDeviceSurfaceCapabilitiesKHR(ptr int64 ptr) winevulkan.vkGetPhysicalDeviceSurfaceCapabilitiesKHR -@ stdcall vkGetPhysicalDeviceSurfaceFormats2KHR(ptr ptr ptr ptr) winevulkan.vkGetPhysicalDeviceSurfaceFormats2KHR -@ stdcall vkGetPhysicalDeviceSurfaceFormatsKHR(ptr int64 ptr ptr) winevulkan.vkGetPhysicalDeviceSurfaceFormatsKHR -@ stdcall vkGetPhysicalDeviceSurfacePresentModesKHR(ptr int64 ptr ptr) winevulkan.vkGetPhysicalDeviceSurfacePresentModesKHR -@ stdcall vkGetPhysicalDeviceSurfaceSupportKHR(ptr long int64 ptr) winevulkan.vkGetPhysicalDeviceSurfaceSupportKHR -@ stdcall vkGetPhysicalDeviceToolProperties(ptr ptr ptr) winevulkan.vkGetPhysicalDeviceToolProperties -@ stdcall vkGetPhysicalDeviceWin32PresentationSupportKHR(ptr long) winevulkan.vkGetPhysicalDeviceWin32PresentationSupportKHR -@ stdcall vkGetPipelineCacheData(ptr int64 ptr ptr) winevulkan.vkGetPipelineCacheData -@ stdcall vkGetPrivateData(ptr long int64 int64 ptr) winevulkan.vkGetPrivateData -@ stdcall vkGetQueryPoolResults(ptr int64 long long long ptr int64 long) winevulkan.vkGetQueryPoolResults -@ stdcall vkGetRenderAreaGranularity(ptr int64 ptr) winevulkan.vkGetRenderAreaGranularity -@ stdcall vkGetRenderingAreaGranularity(ptr ptr ptr) winevulkan.vkGetRenderingAreaGranularity -@ stdcall vkGetSemaphoreCounterValue(ptr int64 ptr) winevulkan.vkGetSemaphoreCounterValue -@ stdcall vkGetSwapchainImagesKHR(ptr int64 ptr ptr) winevulkan.vkGetSwapchainImagesKHR -@ stdcall vkInvalidateMappedMemoryRanges(ptr long ptr) winevulkan.vkInvalidateMappedMemoryRanges -@ stdcall vkMapMemory(ptr int64 int64 int64 long ptr) winevulkan.vkMapMemory -@ stdcall vkMapMemory2(ptr ptr ptr) winevulkan.vkMapMemory2 -@ stdcall vkMergePipelineCaches(ptr int64 long ptr) winevulkan.vkMergePipelineCaches -@ stdcall vkQueueBindSparse(ptr long ptr int64) winevulkan.vkQueueBindSparse -@ stdcall vkQueuePresentKHR(ptr ptr) winevulkan.vkQueuePresentKHR -@ stdcall vkQueueSubmit(ptr long ptr int64) winevulkan.vkQueueSubmit -@ stdcall vkQueueSubmit2(ptr long ptr int64) winevulkan.vkQueueSubmit2 -@ stdcall vkQueueWaitIdle(ptr) winevulkan.vkQueueWaitIdle -@ stdcall vkResetCommandBuffer(ptr long) winevulkan.vkResetCommandBuffer -@ stdcall vkResetCommandPool(ptr int64 long) winevulkan.vkResetCommandPool -@ stdcall vkResetDescriptorPool(ptr int64 long) winevulkan.vkResetDescriptorPool -@ stdcall vkResetEvent(ptr int64) winevulkan.vkResetEvent -@ stdcall vkResetFences(ptr long ptr) winevulkan.vkResetFences -@ stdcall vkResetQueryPool(ptr int64 long long) winevulkan.vkResetQueryPool -@ stdcall vkSetEvent(ptr int64) winevulkan.vkSetEvent -@ stdcall vkSetPrivateData(ptr long int64 int64 int64) winevulkan.vkSetPrivateData -@ stdcall vkSignalSemaphore(ptr ptr) winevulkan.vkSignalSemaphore -@ stdcall vkTransitionImageLayout(ptr long ptr) winevulkan.vkTransitionImageLayout -@ stdcall vkTrimCommandPool(ptr int64 long) winevulkan.vkTrimCommandPool -@ stdcall vkUnmapMemory(ptr int64) winevulkan.vkUnmapMemory -@ stdcall vkUnmapMemory2(ptr ptr) winevulkan.vkUnmapMemory2 -@ stdcall vkUpdateDescriptorSetWithTemplate(ptr int64 int64 ptr) winevulkan.vkUpdateDescriptorSetWithTemplate -@ stdcall vkUpdateDescriptorSets(ptr long ptr long ptr) winevulkan.vkUpdateDescriptorSets -@ stdcall vkWaitForFences(ptr long ptr long int64) winevulkan.vkWaitForFences -@ stdcall vkWaitSemaphores(ptr ptr int64) winevulkan.vkWaitSemaphores diff --git a/dlls/winevulkan/loader_thunks.c b/dlls/winevulkan/loader_thunks.c deleted file mode 100644 index dd997b54b682..000000000000 --- a/dlls/winevulkan/loader_thunks.c +++ /dev/null @@ -1,7413 +0,0 @@ -/* Automatically generated from Vulkan vk.xml and video.xml; DO NOT EDIT! - * - * This file is generated from Vulkan vk.xml file covered - * by the following copyright and permission notice: - * - * Copyright 2015-2024 The Khronos Group Inc. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - * and from Vulkan video.xml file covered - * by the following copyright and permission notice: - * - * Copyright 2021-2024 The Khronos Group Inc. - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include "vulkan_loader.h" - -WINE_DEFAULT_DEBUG_CHANNEL(vulkan); - -VkResult WINAPI vkAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR *pAcquireInfo, uint32_t *pImageIndex) -{ - struct vkAcquireNextImage2KHR_params params; - NTSTATUS status; - params.device = device; - params.pAcquireInfo = pAcquireInfo; - params.pImageIndex = pImageIndex; - status = UNIX_CALL(vkAcquireNextImage2KHR, ¶ms); - assert(!status && "vkAcquireNextImage2KHR"); - return params.result; -} - -VkResult WINAPI vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex) -{ - struct vkAcquireNextImageKHR_params params; - NTSTATUS status; - params.device = device; - params.swapchain = swapchain; - params.timeout = timeout; - params.semaphore = semaphore; - params.fence = fence; - params.pImageIndex = pImageIndex; - status = UNIX_CALL(vkAcquireNextImageKHR, ¶ms); - assert(!status && "vkAcquireNextImageKHR"); - return params.result; -} - -VkResult WINAPI vkAcquirePerformanceConfigurationINTEL(VkDevice device, const VkPerformanceConfigurationAcquireInfoINTEL *pAcquireInfo, VkPerformanceConfigurationINTEL *pConfiguration) -{ - struct vkAcquirePerformanceConfigurationINTEL_params params; - NTSTATUS status; - params.device = device; - params.pAcquireInfo = pAcquireInfo; - params.pConfiguration = pConfiguration; - status = UNIX_CALL(vkAcquirePerformanceConfigurationINTEL, ¶ms); - assert(!status && "vkAcquirePerformanceConfigurationINTEL"); - return params.result; -} - -VkResult WINAPI vkAcquireProfilingLockKHR(VkDevice device, const VkAcquireProfilingLockInfoKHR *pInfo) -{ - struct vkAcquireProfilingLockKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkAcquireProfilingLockKHR, ¶ms); - assert(!status && "vkAcquireProfilingLockKHR"); - return params.result; -} - -VkResult WINAPI vkAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo *pAllocateInfo, VkDescriptorSet *pDescriptorSets) -{ - struct vkAllocateDescriptorSets_params params; - NTSTATUS status; - params.device = device; - params.pAllocateInfo = pAllocateInfo; - params.pDescriptorSets = pDescriptorSets; - status = UNIX_CALL(vkAllocateDescriptorSets, ¶ms); - assert(!status && "vkAllocateDescriptorSets"); - return params.result; -} - -VkResult WINAPI vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory) -{ - struct vkAllocateMemory_params params; - NTSTATUS status; - params.device = device; - params.pAllocateInfo = pAllocateInfo; - params.pAllocator = pAllocator; - params.pMemory = pMemory; - status = UNIX_CALL(vkAllocateMemory, ¶ms); - assert(!status && "vkAllocateMemory"); - return params.result; -} - -void WINAPI vkAntiLagUpdateAMD(VkDevice device, const VkAntiLagDataAMD *pData) -{ - struct vkAntiLagUpdateAMD_params params; - NTSTATUS status; - params.device = device; - params.pData = pData; - status = UNIX_CALL(vkAntiLagUpdateAMD, ¶ms); - assert(!status && "vkAntiLagUpdateAMD"); -} - -VkResult WINAPI vkBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo) -{ - struct vkBeginCommandBuffer_params params; - NTSTATUS status; - params.commandBuffer = commandBuffer; - params.pBeginInfo = pBeginInfo; - status = UNIX_CALL(vkBeginCommandBuffer, ¶ms); - assert(!status && "vkBeginCommandBuffer"); - return params.result; -} - -VkResult WINAPI vkBindAccelerationStructureMemoryNV(VkDevice device, uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoNV *pBindInfos) -{ - struct vkBindAccelerationStructureMemoryNV_params params; - NTSTATUS status; - params.device = device; - params.bindInfoCount = bindInfoCount; - params.pBindInfos = pBindInfos; - status = UNIX_CALL(vkBindAccelerationStructureMemoryNV, ¶ms); - assert(!status && "vkBindAccelerationStructureMemoryNV"); - return params.result; -} - -VkResult WINAPI vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset) -{ - struct vkBindBufferMemory_params params; - NTSTATUS status; - params.device = device; - params.buffer = buffer; - params.memory = memory; - params.memoryOffset = memoryOffset; - status = UNIX_CALL(vkBindBufferMemory, ¶ms); - assert(!status && "vkBindBufferMemory"); - return params.result; -} - -VkResult WINAPI vkBindBufferMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo *pBindInfos) -{ - struct vkBindBufferMemory2_params params; - NTSTATUS status; - params.device = device; - params.bindInfoCount = bindInfoCount; - params.pBindInfos = pBindInfos; - status = UNIX_CALL(vkBindBufferMemory2, ¶ms); - assert(!status && "vkBindBufferMemory2"); - return params.result; -} - -VkResult WINAPI vkBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo *pBindInfos) -{ - struct vkBindBufferMemory2KHR_params params; - NTSTATUS status; - params.device = device; - params.bindInfoCount = bindInfoCount; - params.pBindInfos = pBindInfos; - status = UNIX_CALL(vkBindBufferMemory2KHR, ¶ms); - assert(!status && "vkBindBufferMemory2KHR"); - return params.result; -} - -VkResult WINAPI vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset) -{ - struct vkBindImageMemory_params params; - NTSTATUS status; - params.device = device; - params.image = image; - params.memory = memory; - params.memoryOffset = memoryOffset; - status = UNIX_CALL(vkBindImageMemory, ¶ms); - assert(!status && "vkBindImageMemory"); - return params.result; -} - -VkResult WINAPI vkBindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo *pBindInfos) -{ - struct vkBindImageMemory2_params params; - NTSTATUS status; - params.device = device; - params.bindInfoCount = bindInfoCount; - params.pBindInfos = pBindInfos; - status = UNIX_CALL(vkBindImageMemory2, ¶ms); - assert(!status && "vkBindImageMemory2"); - return params.result; -} - -VkResult WINAPI vkBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo *pBindInfos) -{ - struct vkBindImageMemory2KHR_params params; - NTSTATUS status; - params.device = device; - params.bindInfoCount = bindInfoCount; - params.pBindInfos = pBindInfos; - status = UNIX_CALL(vkBindImageMemory2KHR, ¶ms); - assert(!status && "vkBindImageMemory2KHR"); - return params.result; -} - -VkResult WINAPI vkBindOpticalFlowSessionImageNV(VkDevice device, VkOpticalFlowSessionNV session, VkOpticalFlowSessionBindingPointNV bindingPoint, VkImageView view, VkImageLayout layout) -{ - struct vkBindOpticalFlowSessionImageNV_params params; - NTSTATUS status; - params.device = device; - params.session = session; - params.bindingPoint = bindingPoint; - params.view = view; - params.layout = layout; - status = UNIX_CALL(vkBindOpticalFlowSessionImageNV, ¶ms); - assert(!status && "vkBindOpticalFlowSessionImageNV"); - return params.result; -} - -VkResult WINAPI vkBindVideoSessionMemoryKHR(VkDevice device, VkVideoSessionKHR videoSession, uint32_t bindSessionMemoryInfoCount, const VkBindVideoSessionMemoryInfoKHR *pBindSessionMemoryInfos) -{ - struct vkBindVideoSessionMemoryKHR_params params; - NTSTATUS status; - params.device = device; - params.videoSession = videoSession; - params.bindSessionMemoryInfoCount = bindSessionMemoryInfoCount; - params.pBindSessionMemoryInfos = pBindSessionMemoryInfos; - status = UNIX_CALL(vkBindVideoSessionMemoryKHR, ¶ms); - assert(!status && "vkBindVideoSessionMemoryKHR"); - return params.result; -} - -VkResult WINAPI vkBuildAccelerationStructuresKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, const VkAccelerationStructureBuildRangeInfoKHR * const*ppBuildRangeInfos) -{ - struct vkBuildAccelerationStructuresKHR_params params; - NTSTATUS status; - params.device = device; - params.deferredOperation = deferredOperation; - params.infoCount = infoCount; - params.pInfos = pInfos; - params.ppBuildRangeInfos = ppBuildRangeInfos; - status = UNIX_CALL(vkBuildAccelerationStructuresKHR, ¶ms); - assert(!status && "vkBuildAccelerationStructuresKHR"); - return params.result; -} - -VkResult WINAPI vkBuildMicromapsEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, const VkMicromapBuildInfoEXT *pInfos) -{ - struct vkBuildMicromapsEXT_params params; - NTSTATUS status; - params.device = device; - params.deferredOperation = deferredOperation; - params.infoCount = infoCount; - params.pInfos = pInfos; - status = UNIX_CALL(vkBuildMicromapsEXT, ¶ms); - assert(!status && "vkBuildMicromapsEXT"); - return params.result; -} - -void WINAPI vkCmdBeginConditionalRenderingEXT(VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT *pConditionalRenderingBegin) -{ - struct vkCmdBeginConditionalRenderingEXT_params params; - params.commandBuffer = commandBuffer; - params.pConditionalRenderingBegin = pConditionalRenderingBegin; - UNIX_CALL(vkCmdBeginConditionalRenderingEXT, ¶ms); -} - -void WINAPI vkCmdBeginDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT *pLabelInfo) -{ - struct vkCmdBeginDebugUtilsLabelEXT_params params; - params.commandBuffer = commandBuffer; - params.pLabelInfo = pLabelInfo; - UNIX_CALL(vkCmdBeginDebugUtilsLabelEXT, ¶ms); -} - -void WINAPI vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags) -{ - struct vkCmdBeginQuery_params params; - params.commandBuffer = commandBuffer; - params.queryPool = queryPool; - params.query = query; - params.flags = flags; - UNIX_CALL(vkCmdBeginQuery, ¶ms); -} - -void WINAPI vkCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags, uint32_t index) -{ - struct vkCmdBeginQueryIndexedEXT_params params; - params.commandBuffer = commandBuffer; - params.queryPool = queryPool; - params.query = query; - params.flags = flags; - params.index = index; - UNIX_CALL(vkCmdBeginQueryIndexedEXT, ¶ms); -} - -void WINAPI vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, VkSubpassContents contents) -{ - struct vkCmdBeginRenderPass_params params; - params.commandBuffer = commandBuffer; - params.pRenderPassBegin = pRenderPassBegin; - params.contents = contents; - UNIX_CALL(vkCmdBeginRenderPass, ¶ms); -} - -void WINAPI vkCmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, const VkSubpassBeginInfo *pSubpassBeginInfo) -{ - struct vkCmdBeginRenderPass2_params params; - params.commandBuffer = commandBuffer; - params.pRenderPassBegin = pRenderPassBegin; - params.pSubpassBeginInfo = pSubpassBeginInfo; - UNIX_CALL(vkCmdBeginRenderPass2, ¶ms); -} - -void WINAPI vkCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, const VkSubpassBeginInfo *pSubpassBeginInfo) -{ - struct vkCmdBeginRenderPass2KHR_params params; - params.commandBuffer = commandBuffer; - params.pRenderPassBegin = pRenderPassBegin; - params.pSubpassBeginInfo = pSubpassBeginInfo; - UNIX_CALL(vkCmdBeginRenderPass2KHR, ¶ms); -} - -void WINAPI vkCmdBeginRendering(VkCommandBuffer commandBuffer, const VkRenderingInfo *pRenderingInfo) -{ - struct vkCmdBeginRendering_params params; - params.commandBuffer = commandBuffer; - params.pRenderingInfo = pRenderingInfo; - UNIX_CALL(vkCmdBeginRendering, ¶ms); -} - -void WINAPI vkCmdBeginRenderingKHR(VkCommandBuffer commandBuffer, const VkRenderingInfo *pRenderingInfo) -{ - struct vkCmdBeginRenderingKHR_params params; - params.commandBuffer = commandBuffer; - params.pRenderingInfo = pRenderingInfo; - UNIX_CALL(vkCmdBeginRenderingKHR, ¶ms); -} - -void WINAPI vkCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer *pCounterBuffers, const VkDeviceSize *pCounterBufferOffsets) -{ - struct vkCmdBeginTransformFeedbackEXT_params params; - params.commandBuffer = commandBuffer; - params.firstCounterBuffer = firstCounterBuffer; - params.counterBufferCount = counterBufferCount; - params.pCounterBuffers = pCounterBuffers; - params.pCounterBufferOffsets = pCounterBufferOffsets; - UNIX_CALL(vkCmdBeginTransformFeedbackEXT, ¶ms); -} - -void WINAPI vkCmdBeginVideoCodingKHR(VkCommandBuffer commandBuffer, const VkVideoBeginCodingInfoKHR *pBeginInfo) -{ - struct vkCmdBeginVideoCodingKHR_params params; - params.commandBuffer = commandBuffer; - params.pBeginInfo = pBeginInfo; - UNIX_CALL(vkCmdBeginVideoCodingKHR, ¶ms); -} - -void WINAPI vkCmdBindDescriptorBufferEmbeddedSamplers2EXT(VkCommandBuffer commandBuffer, const VkBindDescriptorBufferEmbeddedSamplersInfoEXT *pBindDescriptorBufferEmbeddedSamplersInfo) -{ - struct vkCmdBindDescriptorBufferEmbeddedSamplers2EXT_params params; - params.commandBuffer = commandBuffer; - params.pBindDescriptorBufferEmbeddedSamplersInfo = pBindDescriptorBufferEmbeddedSamplersInfo; - UNIX_CALL(vkCmdBindDescriptorBufferEmbeddedSamplers2EXT, ¶ms); -} - -void WINAPI vkCmdBindDescriptorBufferEmbeddedSamplersEXT(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set) -{ - struct vkCmdBindDescriptorBufferEmbeddedSamplersEXT_params params; - params.commandBuffer = commandBuffer; - params.pipelineBindPoint = pipelineBindPoint; - params.layout = layout; - params.set = set; - UNIX_CALL(vkCmdBindDescriptorBufferEmbeddedSamplersEXT, ¶ms); -} - -void WINAPI vkCmdBindDescriptorBuffersEXT(VkCommandBuffer commandBuffer, uint32_t bufferCount, const VkDescriptorBufferBindingInfoEXT *pBindingInfos) -{ - struct vkCmdBindDescriptorBuffersEXT_params params; - params.commandBuffer = commandBuffer; - params.bufferCount = bufferCount; - params.pBindingInfos = pBindingInfos; - UNIX_CALL(vkCmdBindDescriptorBuffersEXT, ¶ms); -} - -void WINAPI vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet *pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t *pDynamicOffsets) -{ - struct vkCmdBindDescriptorSets_params params; - params.commandBuffer = commandBuffer; - params.pipelineBindPoint = pipelineBindPoint; - params.layout = layout; - params.firstSet = firstSet; - params.descriptorSetCount = descriptorSetCount; - params.pDescriptorSets = pDescriptorSets; - params.dynamicOffsetCount = dynamicOffsetCount; - params.pDynamicOffsets = pDynamicOffsets; - UNIX_CALL(vkCmdBindDescriptorSets, ¶ms); -} - -void WINAPI vkCmdBindDescriptorSets2(VkCommandBuffer commandBuffer, const VkBindDescriptorSetsInfo *pBindDescriptorSetsInfo) -{ - struct vkCmdBindDescriptorSets2_params params; - params.commandBuffer = commandBuffer; - params.pBindDescriptorSetsInfo = pBindDescriptorSetsInfo; - UNIX_CALL(vkCmdBindDescriptorSets2, ¶ms); -} - -void WINAPI vkCmdBindDescriptorSets2KHR(VkCommandBuffer commandBuffer, const VkBindDescriptorSetsInfo *pBindDescriptorSetsInfo) -{ - struct vkCmdBindDescriptorSets2KHR_params params; - params.commandBuffer = commandBuffer; - params.pBindDescriptorSetsInfo = pBindDescriptorSetsInfo; - UNIX_CALL(vkCmdBindDescriptorSets2KHR, ¶ms); -} - -void WINAPI vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) -{ - struct vkCmdBindIndexBuffer_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.indexType = indexType; - UNIX_CALL(vkCmdBindIndexBuffer, ¶ms); -} - -void WINAPI vkCmdBindIndexBuffer2(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize size, VkIndexType indexType) -{ - struct vkCmdBindIndexBuffer2_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.size = size; - params.indexType = indexType; - UNIX_CALL(vkCmdBindIndexBuffer2, ¶ms); -} - -void WINAPI vkCmdBindIndexBuffer2KHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize size, VkIndexType indexType) -{ - struct vkCmdBindIndexBuffer2KHR_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.size = size; - params.indexType = indexType; - UNIX_CALL(vkCmdBindIndexBuffer2KHR, ¶ms); -} - -void WINAPI vkCmdBindInvocationMaskHUAWEI(VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout) -{ - struct vkCmdBindInvocationMaskHUAWEI_params params; - params.commandBuffer = commandBuffer; - params.imageView = imageView; - params.imageLayout = imageLayout; - UNIX_CALL(vkCmdBindInvocationMaskHUAWEI, ¶ms); -} - -void WINAPI vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) -{ - struct vkCmdBindPipeline_params params; - params.commandBuffer = commandBuffer; - params.pipelineBindPoint = pipelineBindPoint; - params.pipeline = pipeline; - UNIX_CALL(vkCmdBindPipeline, ¶ms); -} - -void WINAPI vkCmdBindPipelineShaderGroupNV(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline, uint32_t groupIndex) -{ - struct vkCmdBindPipelineShaderGroupNV_params params; - params.commandBuffer = commandBuffer; - params.pipelineBindPoint = pipelineBindPoint; - params.pipeline = pipeline; - params.groupIndex = groupIndex; - UNIX_CALL(vkCmdBindPipelineShaderGroupNV, ¶ms); -} - -void WINAPI vkCmdBindShadersEXT(VkCommandBuffer commandBuffer, uint32_t stageCount, const VkShaderStageFlagBits *pStages, const VkShaderEXT *pShaders) -{ - struct vkCmdBindShadersEXT_params params; - params.commandBuffer = commandBuffer; - params.stageCount = stageCount; - params.pStages = pStages; - params.pShaders = pShaders; - UNIX_CALL(vkCmdBindShadersEXT, ¶ms); -} - -void WINAPI vkCmdBindShadingRateImageNV(VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout) -{ - struct vkCmdBindShadingRateImageNV_params params; - params.commandBuffer = commandBuffer; - params.imageView = imageView; - params.imageLayout = imageLayout; - UNIX_CALL(vkCmdBindShadingRateImageNV, ¶ms); -} - -void WINAPI vkCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes) -{ - struct vkCmdBindTransformFeedbackBuffersEXT_params params; - params.commandBuffer = commandBuffer; - params.firstBinding = firstBinding; - params.bindingCount = bindingCount; - params.pBuffers = pBuffers; - params.pOffsets = pOffsets; - params.pSizes = pSizes; - UNIX_CALL(vkCmdBindTransformFeedbackBuffersEXT, ¶ms); -} - -void WINAPI vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets) -{ - struct vkCmdBindVertexBuffers_params params; - params.commandBuffer = commandBuffer; - params.firstBinding = firstBinding; - params.bindingCount = bindingCount; - params.pBuffers = pBuffers; - params.pOffsets = pOffsets; - UNIX_CALL(vkCmdBindVertexBuffers, ¶ms); -} - -void WINAPI vkCmdBindVertexBuffers2(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes, const VkDeviceSize *pStrides) -{ - struct vkCmdBindVertexBuffers2_params params; - params.commandBuffer = commandBuffer; - params.firstBinding = firstBinding; - params.bindingCount = bindingCount; - params.pBuffers = pBuffers; - params.pOffsets = pOffsets; - params.pSizes = pSizes; - params.pStrides = pStrides; - UNIX_CALL(vkCmdBindVertexBuffers2, ¶ms); -} - -void WINAPI vkCmdBindVertexBuffers2EXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes, const VkDeviceSize *pStrides) -{ - struct vkCmdBindVertexBuffers2EXT_params params; - params.commandBuffer = commandBuffer; - params.firstBinding = firstBinding; - params.bindingCount = bindingCount; - params.pBuffers = pBuffers; - params.pOffsets = pOffsets; - params.pSizes = pSizes; - params.pStrides = pStrides; - UNIX_CALL(vkCmdBindVertexBuffers2EXT, ¶ms); -} - -void WINAPI vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit *pRegions, VkFilter filter) -{ - struct vkCmdBlitImage_params params; - params.commandBuffer = commandBuffer; - params.srcImage = srcImage; - params.srcImageLayout = srcImageLayout; - params.dstImage = dstImage; - params.dstImageLayout = dstImageLayout; - params.regionCount = regionCount; - params.pRegions = pRegions; - params.filter = filter; - UNIX_CALL(vkCmdBlitImage, ¶ms); -} - -void WINAPI vkCmdBlitImage2(VkCommandBuffer commandBuffer, const VkBlitImageInfo2 *pBlitImageInfo) -{ - struct vkCmdBlitImage2_params params; - params.commandBuffer = commandBuffer; - params.pBlitImageInfo = pBlitImageInfo; - UNIX_CALL(vkCmdBlitImage2, ¶ms); -} - -void WINAPI vkCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2 *pBlitImageInfo) -{ - struct vkCmdBlitImage2KHR_params params; - params.commandBuffer = commandBuffer; - params.pBlitImageInfo = pBlitImageInfo; - UNIX_CALL(vkCmdBlitImage2KHR, ¶ms); -} - -void WINAPI vkCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV *pInfo, VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkBuffer scratch, VkDeviceSize scratchOffset) -{ - struct vkCmdBuildAccelerationStructureNV_params params; - params.commandBuffer = commandBuffer; - params.pInfo = pInfo; - params.instanceData = instanceData; - params.instanceOffset = instanceOffset; - params.update = update; - params.dst = dst; - params.src = src; - params.scratch = scratch; - params.scratchOffset = scratchOffset; - UNIX_CALL(vkCmdBuildAccelerationStructureNV, ¶ms); -} - -void WINAPI vkCmdBuildAccelerationStructuresIndirectKHR(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, const VkDeviceAddress *pIndirectDeviceAddresses, const uint32_t *pIndirectStrides, const uint32_t * const*ppMaxPrimitiveCounts) -{ - struct vkCmdBuildAccelerationStructuresIndirectKHR_params params; - params.commandBuffer = commandBuffer; - params.infoCount = infoCount; - params.pInfos = pInfos; - params.pIndirectDeviceAddresses = pIndirectDeviceAddresses; - params.pIndirectStrides = pIndirectStrides; - params.ppMaxPrimitiveCounts = ppMaxPrimitiveCounts; - UNIX_CALL(vkCmdBuildAccelerationStructuresIndirectKHR, ¶ms); -} - -void WINAPI vkCmdBuildAccelerationStructuresKHR(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, const VkAccelerationStructureBuildRangeInfoKHR * const*ppBuildRangeInfos) -{ - struct vkCmdBuildAccelerationStructuresKHR_params params; - params.commandBuffer = commandBuffer; - params.infoCount = infoCount; - params.pInfos = pInfos; - params.ppBuildRangeInfos = ppBuildRangeInfos; - UNIX_CALL(vkCmdBuildAccelerationStructuresKHR, ¶ms); -} - -void WINAPI vkCmdBuildMicromapsEXT(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkMicromapBuildInfoEXT *pInfos) -{ - struct vkCmdBuildMicromapsEXT_params params; - params.commandBuffer = commandBuffer; - params.infoCount = infoCount; - params.pInfos = pInfos; - UNIX_CALL(vkCmdBuildMicromapsEXT, ¶ms); -} - -void WINAPI vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment *pAttachments, uint32_t rectCount, const VkClearRect *pRects) -{ - struct vkCmdClearAttachments_params params; - params.commandBuffer = commandBuffer; - params.attachmentCount = attachmentCount; - params.pAttachments = pAttachments; - params.rectCount = rectCount; - params.pRects = pRects; - UNIX_CALL(vkCmdClearAttachments, ¶ms); -} - -void WINAPI vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue *pColor, uint32_t rangeCount, const VkImageSubresourceRange *pRanges) -{ - struct vkCmdClearColorImage_params params; - params.commandBuffer = commandBuffer; - params.image = image; - params.imageLayout = imageLayout; - params.pColor = pColor; - params.rangeCount = rangeCount; - params.pRanges = pRanges; - UNIX_CALL(vkCmdClearColorImage, ¶ms); -} - -void WINAPI vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue *pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange *pRanges) -{ - struct vkCmdClearDepthStencilImage_params params; - params.commandBuffer = commandBuffer; - params.image = image; - params.imageLayout = imageLayout; - params.pDepthStencil = pDepthStencil; - params.rangeCount = rangeCount; - params.pRanges = pRanges; - UNIX_CALL(vkCmdClearDepthStencilImage, ¶ms); -} - -void WINAPI vkCmdControlVideoCodingKHR(VkCommandBuffer commandBuffer, const VkVideoCodingControlInfoKHR *pCodingControlInfo) -{ - struct vkCmdControlVideoCodingKHR_params params; - params.commandBuffer = commandBuffer; - params.pCodingControlInfo = pCodingControlInfo; - UNIX_CALL(vkCmdControlVideoCodingKHR, ¶ms); -} - -void WINAPI vkCmdCopyAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureInfoKHR *pInfo) -{ - struct vkCmdCopyAccelerationStructureKHR_params params; - params.commandBuffer = commandBuffer; - params.pInfo = pInfo; - UNIX_CALL(vkCmdCopyAccelerationStructureKHR, ¶ms); -} - -void WINAPI vkCmdCopyAccelerationStructureNV(VkCommandBuffer commandBuffer, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkCopyAccelerationStructureModeKHR mode) -{ - struct vkCmdCopyAccelerationStructureNV_params params; - params.commandBuffer = commandBuffer; - params.dst = dst; - params.src = src; - params.mode = mode; - UNIX_CALL(vkCmdCopyAccelerationStructureNV, ¶ms); -} - -void WINAPI vkCmdCopyAccelerationStructureToMemoryKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo) -{ - struct vkCmdCopyAccelerationStructureToMemoryKHR_params params; - params.commandBuffer = commandBuffer; - params.pInfo = pInfo; - UNIX_CALL(vkCmdCopyAccelerationStructureToMemoryKHR, ¶ms); -} - -void WINAPI vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy *pRegions) -{ - struct vkCmdCopyBuffer_params params; - params.commandBuffer = commandBuffer; - params.srcBuffer = srcBuffer; - params.dstBuffer = dstBuffer; - params.regionCount = regionCount; - params.pRegions = pRegions; - UNIX_CALL(vkCmdCopyBuffer, ¶ms); -} - -void WINAPI vkCmdCopyBuffer2(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2 *pCopyBufferInfo) -{ - struct vkCmdCopyBuffer2_params params; - params.commandBuffer = commandBuffer; - params.pCopyBufferInfo = pCopyBufferInfo; - UNIX_CALL(vkCmdCopyBuffer2, ¶ms); -} - -void WINAPI vkCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2 *pCopyBufferInfo) -{ - struct vkCmdCopyBuffer2KHR_params params; - params.commandBuffer = commandBuffer; - params.pCopyBufferInfo = pCopyBufferInfo; - UNIX_CALL(vkCmdCopyBuffer2KHR, ¶ms); -} - -void WINAPI vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy *pRegions) -{ - struct vkCmdCopyBufferToImage_params params; - params.commandBuffer = commandBuffer; - params.srcBuffer = srcBuffer; - params.dstImage = dstImage; - params.dstImageLayout = dstImageLayout; - params.regionCount = regionCount; - params.pRegions = pRegions; - UNIX_CALL(vkCmdCopyBufferToImage, ¶ms); -} - -void WINAPI vkCmdCopyBufferToImage2(VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2 *pCopyBufferToImageInfo) -{ - struct vkCmdCopyBufferToImage2_params params; - params.commandBuffer = commandBuffer; - params.pCopyBufferToImageInfo = pCopyBufferToImageInfo; - UNIX_CALL(vkCmdCopyBufferToImage2, ¶ms); -} - -void WINAPI vkCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2 *pCopyBufferToImageInfo) -{ - struct vkCmdCopyBufferToImage2KHR_params params; - params.commandBuffer = commandBuffer; - params.pCopyBufferToImageInfo = pCopyBufferToImageInfo; - UNIX_CALL(vkCmdCopyBufferToImage2KHR, ¶ms); -} - -void WINAPI vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy *pRegions) -{ - struct vkCmdCopyImage_params params; - params.commandBuffer = commandBuffer; - params.srcImage = srcImage; - params.srcImageLayout = srcImageLayout; - params.dstImage = dstImage; - params.dstImageLayout = dstImageLayout; - params.regionCount = regionCount; - params.pRegions = pRegions; - UNIX_CALL(vkCmdCopyImage, ¶ms); -} - -void WINAPI vkCmdCopyImage2(VkCommandBuffer commandBuffer, const VkCopyImageInfo2 *pCopyImageInfo) -{ - struct vkCmdCopyImage2_params params; - params.commandBuffer = commandBuffer; - params.pCopyImageInfo = pCopyImageInfo; - UNIX_CALL(vkCmdCopyImage2, ¶ms); -} - -void WINAPI vkCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2 *pCopyImageInfo) -{ - struct vkCmdCopyImage2KHR_params params; - params.commandBuffer = commandBuffer; - params.pCopyImageInfo = pCopyImageInfo; - UNIX_CALL(vkCmdCopyImage2KHR, ¶ms); -} - -void WINAPI vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy *pRegions) -{ - struct vkCmdCopyImageToBuffer_params params; - params.commandBuffer = commandBuffer; - params.srcImage = srcImage; - params.srcImageLayout = srcImageLayout; - params.dstBuffer = dstBuffer; - params.regionCount = regionCount; - params.pRegions = pRegions; - UNIX_CALL(vkCmdCopyImageToBuffer, ¶ms); -} - -void WINAPI vkCmdCopyImageToBuffer2(VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2 *pCopyImageToBufferInfo) -{ - struct vkCmdCopyImageToBuffer2_params params; - params.commandBuffer = commandBuffer; - params.pCopyImageToBufferInfo = pCopyImageToBufferInfo; - UNIX_CALL(vkCmdCopyImageToBuffer2, ¶ms); -} - -void WINAPI vkCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2 *pCopyImageToBufferInfo) -{ - struct vkCmdCopyImageToBuffer2KHR_params params; - params.commandBuffer = commandBuffer; - params.pCopyImageToBufferInfo = pCopyImageToBufferInfo; - UNIX_CALL(vkCmdCopyImageToBuffer2KHR, ¶ms); -} - -void WINAPI vkCmdCopyMemoryIndirectNV(VkCommandBuffer commandBuffer, VkDeviceAddress copyBufferAddress, uint32_t copyCount, uint32_t stride) -{ - struct vkCmdCopyMemoryIndirectNV_params params; - params.commandBuffer = commandBuffer; - params.copyBufferAddress = copyBufferAddress; - params.copyCount = copyCount; - params.stride = stride; - UNIX_CALL(vkCmdCopyMemoryIndirectNV, ¶ms); -} - -void WINAPI vkCmdCopyMemoryToAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo) -{ - struct vkCmdCopyMemoryToAccelerationStructureKHR_params params; - params.commandBuffer = commandBuffer; - params.pInfo = pInfo; - UNIX_CALL(vkCmdCopyMemoryToAccelerationStructureKHR, ¶ms); -} - -void WINAPI vkCmdCopyMemoryToImageIndirectNV(VkCommandBuffer commandBuffer, VkDeviceAddress copyBufferAddress, uint32_t copyCount, uint32_t stride, VkImage dstImage, VkImageLayout dstImageLayout, const VkImageSubresourceLayers *pImageSubresources) -{ - struct vkCmdCopyMemoryToImageIndirectNV_params params; - params.commandBuffer = commandBuffer; - params.copyBufferAddress = copyBufferAddress; - params.copyCount = copyCount; - params.stride = stride; - params.dstImage = dstImage; - params.dstImageLayout = dstImageLayout; - params.pImageSubresources = pImageSubresources; - UNIX_CALL(vkCmdCopyMemoryToImageIndirectNV, ¶ms); -} - -void WINAPI vkCmdCopyMemoryToMicromapEXT(VkCommandBuffer commandBuffer, const VkCopyMemoryToMicromapInfoEXT *pInfo) -{ - struct vkCmdCopyMemoryToMicromapEXT_params params; - params.commandBuffer = commandBuffer; - params.pInfo = pInfo; - UNIX_CALL(vkCmdCopyMemoryToMicromapEXT, ¶ms); -} - -void WINAPI vkCmdCopyMicromapEXT(VkCommandBuffer commandBuffer, const VkCopyMicromapInfoEXT *pInfo) -{ - struct vkCmdCopyMicromapEXT_params params; - params.commandBuffer = commandBuffer; - params.pInfo = pInfo; - UNIX_CALL(vkCmdCopyMicromapEXT, ¶ms); -} - -void WINAPI vkCmdCopyMicromapToMemoryEXT(VkCommandBuffer commandBuffer, const VkCopyMicromapToMemoryInfoEXT *pInfo) -{ - struct vkCmdCopyMicromapToMemoryEXT_params params; - params.commandBuffer = commandBuffer; - params.pInfo = pInfo; - UNIX_CALL(vkCmdCopyMicromapToMemoryEXT, ¶ms); -} - -void WINAPI vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags) -{ - struct vkCmdCopyQueryPoolResults_params params; - params.commandBuffer = commandBuffer; - params.queryPool = queryPool; - params.firstQuery = firstQuery; - params.queryCount = queryCount; - params.dstBuffer = dstBuffer; - params.dstOffset = dstOffset; - params.stride = stride; - params.flags = flags; - UNIX_CALL(vkCmdCopyQueryPoolResults, ¶ms); -} - -void WINAPI vkCmdCuLaunchKernelNVX(VkCommandBuffer commandBuffer, const VkCuLaunchInfoNVX *pLaunchInfo) -{ - struct vkCmdCuLaunchKernelNVX_params params; - params.commandBuffer = commandBuffer; - params.pLaunchInfo = pLaunchInfo; - UNIX_CALL(vkCmdCuLaunchKernelNVX, ¶ms); -} - -void WINAPI vkCmdCudaLaunchKernelNV(VkCommandBuffer commandBuffer, const VkCudaLaunchInfoNV *pLaunchInfo) -{ - struct vkCmdCudaLaunchKernelNV_params params; - params.commandBuffer = commandBuffer; - params.pLaunchInfo = pLaunchInfo; - UNIX_CALL(vkCmdCudaLaunchKernelNV, ¶ms); -} - -void WINAPI vkCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT *pMarkerInfo) -{ - struct vkCmdDebugMarkerBeginEXT_params params; - params.commandBuffer = commandBuffer; - params.pMarkerInfo = pMarkerInfo; - UNIX_CALL(vkCmdDebugMarkerBeginEXT, ¶ms); -} - -void WINAPI vkCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer) -{ - struct vkCmdDebugMarkerEndEXT_params params; - params.commandBuffer = commandBuffer; - UNIX_CALL(vkCmdDebugMarkerEndEXT, ¶ms); -} - -void WINAPI vkCmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT *pMarkerInfo) -{ - struct vkCmdDebugMarkerInsertEXT_params params; - params.commandBuffer = commandBuffer; - params.pMarkerInfo = pMarkerInfo; - UNIX_CALL(vkCmdDebugMarkerInsertEXT, ¶ms); -} - -void WINAPI vkCmdDecodeVideoKHR(VkCommandBuffer commandBuffer, const VkVideoDecodeInfoKHR *pDecodeInfo) -{ - struct vkCmdDecodeVideoKHR_params params; - params.commandBuffer = commandBuffer; - params.pDecodeInfo = pDecodeInfo; - UNIX_CALL(vkCmdDecodeVideoKHR, ¶ms); -} - -void WINAPI vkCmdDecompressMemoryIndirectCountNV(VkCommandBuffer commandBuffer, VkDeviceAddress indirectCommandsAddress, VkDeviceAddress indirectCommandsCountAddress, uint32_t stride) -{ - struct vkCmdDecompressMemoryIndirectCountNV_params params; - params.commandBuffer = commandBuffer; - params.indirectCommandsAddress = indirectCommandsAddress; - params.indirectCommandsCountAddress = indirectCommandsCountAddress; - params.stride = stride; - UNIX_CALL(vkCmdDecompressMemoryIndirectCountNV, ¶ms); -} - -void WINAPI vkCmdDecompressMemoryNV(VkCommandBuffer commandBuffer, uint32_t decompressRegionCount, const VkDecompressMemoryRegionNV *pDecompressMemoryRegions) -{ - struct vkCmdDecompressMemoryNV_params params; - params.commandBuffer = commandBuffer; - params.decompressRegionCount = decompressRegionCount; - params.pDecompressMemoryRegions = pDecompressMemoryRegions; - UNIX_CALL(vkCmdDecompressMemoryNV, ¶ms); -} - -void WINAPI vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) -{ - struct vkCmdDispatch_params params; - params.commandBuffer = commandBuffer; - params.groupCountX = groupCountX; - params.groupCountY = groupCountY; - params.groupCountZ = groupCountZ; - UNIX_CALL(vkCmdDispatch, ¶ms); -} - -void WINAPI vkCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) -{ - struct vkCmdDispatchBase_params params; - params.commandBuffer = commandBuffer; - params.baseGroupX = baseGroupX; - params.baseGroupY = baseGroupY; - params.baseGroupZ = baseGroupZ; - params.groupCountX = groupCountX; - params.groupCountY = groupCountY; - params.groupCountZ = groupCountZ; - UNIX_CALL(vkCmdDispatchBase, ¶ms); -} - -void WINAPI vkCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) -{ - struct vkCmdDispatchBaseKHR_params params; - params.commandBuffer = commandBuffer; - params.baseGroupX = baseGroupX; - params.baseGroupY = baseGroupY; - params.baseGroupZ = baseGroupZ; - params.groupCountX = groupCountX; - params.groupCountY = groupCountY; - params.groupCountZ = groupCountZ; - UNIX_CALL(vkCmdDispatchBaseKHR, ¶ms); -} - -void WINAPI vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) -{ - struct vkCmdDispatchIndirect_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - UNIX_CALL(vkCmdDispatchIndirect, ¶ms); -} - -void WINAPI vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) -{ - struct vkCmdDraw_params params; - params.commandBuffer = commandBuffer; - params.vertexCount = vertexCount; - params.instanceCount = instanceCount; - params.firstVertex = firstVertex; - params.firstInstance = firstInstance; - UNIX_CALL(vkCmdDraw, ¶ms); -} - -void WINAPI vkCmdDrawClusterHUAWEI(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) -{ - struct vkCmdDrawClusterHUAWEI_params params; - params.commandBuffer = commandBuffer; - params.groupCountX = groupCountX; - params.groupCountY = groupCountY; - params.groupCountZ = groupCountZ; - UNIX_CALL(vkCmdDrawClusterHUAWEI, ¶ms); -} - -void WINAPI vkCmdDrawClusterIndirectHUAWEI(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) -{ - struct vkCmdDrawClusterIndirectHUAWEI_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - UNIX_CALL(vkCmdDrawClusterIndirectHUAWEI, ¶ms); -} - -void WINAPI vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) -{ - struct vkCmdDrawIndexed_params params; - params.commandBuffer = commandBuffer; - params.indexCount = indexCount; - params.instanceCount = instanceCount; - params.firstIndex = firstIndex; - params.vertexOffset = vertexOffset; - params.firstInstance = firstInstance; - UNIX_CALL(vkCmdDrawIndexed, ¶ms); -} - -void WINAPI vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) -{ - struct vkCmdDrawIndexedIndirect_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.drawCount = drawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawIndexedIndirect, ¶ms); -} - -void WINAPI vkCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) -{ - struct vkCmdDrawIndexedIndirectCount_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.countBuffer = countBuffer; - params.countBufferOffset = countBufferOffset; - params.maxDrawCount = maxDrawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawIndexedIndirectCount, ¶ms); -} - -void WINAPI vkCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) -{ - struct vkCmdDrawIndexedIndirectCountAMD_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.countBuffer = countBuffer; - params.countBufferOffset = countBufferOffset; - params.maxDrawCount = maxDrawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawIndexedIndirectCountAMD, ¶ms); -} - -void WINAPI vkCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) -{ - struct vkCmdDrawIndexedIndirectCountKHR_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.countBuffer = countBuffer; - params.countBufferOffset = countBufferOffset; - params.maxDrawCount = maxDrawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawIndexedIndirectCountKHR, ¶ms); -} - -void WINAPI vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) -{ - struct vkCmdDrawIndirect_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.drawCount = drawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawIndirect, ¶ms); -} - -void WINAPI vkCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance, VkBuffer counterBuffer, VkDeviceSize counterBufferOffset, uint32_t counterOffset, uint32_t vertexStride) -{ - struct vkCmdDrawIndirectByteCountEXT_params params; - params.commandBuffer = commandBuffer; - params.instanceCount = instanceCount; - params.firstInstance = firstInstance; - params.counterBuffer = counterBuffer; - params.counterBufferOffset = counterBufferOffset; - params.counterOffset = counterOffset; - params.vertexStride = vertexStride; - UNIX_CALL(vkCmdDrawIndirectByteCountEXT, ¶ms); -} - -void WINAPI vkCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) -{ - struct vkCmdDrawIndirectCount_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.countBuffer = countBuffer; - params.countBufferOffset = countBufferOffset; - params.maxDrawCount = maxDrawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawIndirectCount, ¶ms); -} - -void WINAPI vkCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) -{ - struct vkCmdDrawIndirectCountAMD_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.countBuffer = countBuffer; - params.countBufferOffset = countBufferOffset; - params.maxDrawCount = maxDrawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawIndirectCountAMD, ¶ms); -} - -void WINAPI vkCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) -{ - struct vkCmdDrawIndirectCountKHR_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.countBuffer = countBuffer; - params.countBufferOffset = countBufferOffset; - params.maxDrawCount = maxDrawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawIndirectCountKHR, ¶ms); -} - -void WINAPI vkCmdDrawMeshTasksEXT(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) -{ - struct vkCmdDrawMeshTasksEXT_params params; - params.commandBuffer = commandBuffer; - params.groupCountX = groupCountX; - params.groupCountY = groupCountY; - params.groupCountZ = groupCountZ; - UNIX_CALL(vkCmdDrawMeshTasksEXT, ¶ms); -} - -void WINAPI vkCmdDrawMeshTasksIndirectCountEXT(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) -{ - struct vkCmdDrawMeshTasksIndirectCountEXT_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.countBuffer = countBuffer; - params.countBufferOffset = countBufferOffset; - params.maxDrawCount = maxDrawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawMeshTasksIndirectCountEXT, ¶ms); -} - -void WINAPI vkCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) -{ - struct vkCmdDrawMeshTasksIndirectCountNV_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.countBuffer = countBuffer; - params.countBufferOffset = countBufferOffset; - params.maxDrawCount = maxDrawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawMeshTasksIndirectCountNV, ¶ms); -} - -void WINAPI vkCmdDrawMeshTasksIndirectEXT(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) -{ - struct vkCmdDrawMeshTasksIndirectEXT_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.drawCount = drawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawMeshTasksIndirectEXT, ¶ms); -} - -void WINAPI vkCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) -{ - struct vkCmdDrawMeshTasksIndirectNV_params params; - params.commandBuffer = commandBuffer; - params.buffer = buffer; - params.offset = offset; - params.drawCount = drawCount; - params.stride = stride; - UNIX_CALL(vkCmdDrawMeshTasksIndirectNV, ¶ms); -} - -void WINAPI vkCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask) -{ - struct vkCmdDrawMeshTasksNV_params params; - params.commandBuffer = commandBuffer; - params.taskCount = taskCount; - params.firstTask = firstTask; - UNIX_CALL(vkCmdDrawMeshTasksNV, ¶ms); -} - -void WINAPI vkCmdDrawMultiEXT(VkCommandBuffer commandBuffer, uint32_t drawCount, const VkMultiDrawInfoEXT *pVertexInfo, uint32_t instanceCount, uint32_t firstInstance, uint32_t stride) -{ - struct vkCmdDrawMultiEXT_params params; - params.commandBuffer = commandBuffer; - params.drawCount = drawCount; - params.pVertexInfo = pVertexInfo; - params.instanceCount = instanceCount; - params.firstInstance = firstInstance; - params.stride = stride; - UNIX_CALL(vkCmdDrawMultiEXT, ¶ms); -} - -void WINAPI vkCmdDrawMultiIndexedEXT(VkCommandBuffer commandBuffer, uint32_t drawCount, const VkMultiDrawIndexedInfoEXT *pIndexInfo, uint32_t instanceCount, uint32_t firstInstance, uint32_t stride, const int32_t *pVertexOffset) -{ - struct vkCmdDrawMultiIndexedEXT_params params; - params.commandBuffer = commandBuffer; - params.drawCount = drawCount; - params.pIndexInfo = pIndexInfo; - params.instanceCount = instanceCount; - params.firstInstance = firstInstance; - params.stride = stride; - params.pVertexOffset = pVertexOffset; - UNIX_CALL(vkCmdDrawMultiIndexedEXT, ¶ms); -} - -void WINAPI vkCmdEncodeVideoKHR(VkCommandBuffer commandBuffer, const VkVideoEncodeInfoKHR *pEncodeInfo) -{ - struct vkCmdEncodeVideoKHR_params params; - params.commandBuffer = commandBuffer; - params.pEncodeInfo = pEncodeInfo; - UNIX_CALL(vkCmdEncodeVideoKHR, ¶ms); -} - -void WINAPI vkCmdEndConditionalRenderingEXT(VkCommandBuffer commandBuffer) -{ - struct vkCmdEndConditionalRenderingEXT_params params; - params.commandBuffer = commandBuffer; - UNIX_CALL(vkCmdEndConditionalRenderingEXT, ¶ms); -} - -void WINAPI vkCmdEndDebugUtilsLabelEXT(VkCommandBuffer commandBuffer) -{ - struct vkCmdEndDebugUtilsLabelEXT_params params; - params.commandBuffer = commandBuffer; - UNIX_CALL(vkCmdEndDebugUtilsLabelEXT, ¶ms); -} - -void WINAPI vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query) -{ - struct vkCmdEndQuery_params params; - params.commandBuffer = commandBuffer; - params.queryPool = queryPool; - params.query = query; - UNIX_CALL(vkCmdEndQuery, ¶ms); -} - -void WINAPI vkCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index) -{ - struct vkCmdEndQueryIndexedEXT_params params; - params.commandBuffer = commandBuffer; - params.queryPool = queryPool; - params.query = query; - params.index = index; - UNIX_CALL(vkCmdEndQueryIndexedEXT, ¶ms); -} - -void WINAPI vkCmdEndRenderPass(VkCommandBuffer commandBuffer) -{ - struct vkCmdEndRenderPass_params params; - params.commandBuffer = commandBuffer; - UNIX_CALL(vkCmdEndRenderPass, ¶ms); -} - -void WINAPI vkCmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfo *pSubpassEndInfo) -{ - struct vkCmdEndRenderPass2_params params; - params.commandBuffer = commandBuffer; - params.pSubpassEndInfo = pSubpassEndInfo; - UNIX_CALL(vkCmdEndRenderPass2, ¶ms); -} - -void WINAPI vkCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfo *pSubpassEndInfo) -{ - struct vkCmdEndRenderPass2KHR_params params; - params.commandBuffer = commandBuffer; - params.pSubpassEndInfo = pSubpassEndInfo; - UNIX_CALL(vkCmdEndRenderPass2KHR, ¶ms); -} - -void WINAPI vkCmdEndRendering(VkCommandBuffer commandBuffer) -{ - struct vkCmdEndRendering_params params; - params.commandBuffer = commandBuffer; - UNIX_CALL(vkCmdEndRendering, ¶ms); -} - -void WINAPI vkCmdEndRenderingKHR(VkCommandBuffer commandBuffer) -{ - struct vkCmdEndRenderingKHR_params params; - params.commandBuffer = commandBuffer; - UNIX_CALL(vkCmdEndRenderingKHR, ¶ms); -} - -void WINAPI vkCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer *pCounterBuffers, const VkDeviceSize *pCounterBufferOffsets) -{ - struct vkCmdEndTransformFeedbackEXT_params params; - params.commandBuffer = commandBuffer; - params.firstCounterBuffer = firstCounterBuffer; - params.counterBufferCount = counterBufferCount; - params.pCounterBuffers = pCounterBuffers; - params.pCounterBufferOffsets = pCounterBufferOffsets; - UNIX_CALL(vkCmdEndTransformFeedbackEXT, ¶ms); -} - -void WINAPI vkCmdEndVideoCodingKHR(VkCommandBuffer commandBuffer, const VkVideoEndCodingInfoKHR *pEndCodingInfo) -{ - struct vkCmdEndVideoCodingKHR_params params; - params.commandBuffer = commandBuffer; - params.pEndCodingInfo = pEndCodingInfo; - UNIX_CALL(vkCmdEndVideoCodingKHR, ¶ms); -} - -void WINAPI vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers) -{ - struct vkCmdExecuteCommands_params params; - params.commandBuffer = commandBuffer; - params.commandBufferCount = commandBufferCount; - params.pCommandBuffers = pCommandBuffers; - UNIX_CALL(vkCmdExecuteCommands, ¶ms); -} - -void WINAPI vkCmdExecuteGeneratedCommandsEXT(VkCommandBuffer commandBuffer, VkBool32 isPreprocessed, const VkGeneratedCommandsInfoEXT *pGeneratedCommandsInfo) -{ - struct vkCmdExecuteGeneratedCommandsEXT_params params; - params.commandBuffer = commandBuffer; - params.isPreprocessed = isPreprocessed; - params.pGeneratedCommandsInfo = pGeneratedCommandsInfo; - UNIX_CALL(vkCmdExecuteGeneratedCommandsEXT, ¶ms); -} - -void WINAPI vkCmdExecuteGeneratedCommandsNV(VkCommandBuffer commandBuffer, VkBool32 isPreprocessed, const VkGeneratedCommandsInfoNV *pGeneratedCommandsInfo) -{ - struct vkCmdExecuteGeneratedCommandsNV_params params; - params.commandBuffer = commandBuffer; - params.isPreprocessed = isPreprocessed; - params.pGeneratedCommandsInfo = pGeneratedCommandsInfo; - UNIX_CALL(vkCmdExecuteGeneratedCommandsNV, ¶ms); -} - -void WINAPI vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data) -{ - struct vkCmdFillBuffer_params params; - params.commandBuffer = commandBuffer; - params.dstBuffer = dstBuffer; - params.dstOffset = dstOffset; - params.size = size; - params.data = data; - UNIX_CALL(vkCmdFillBuffer, ¶ms); -} - -void WINAPI vkCmdInsertDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT *pLabelInfo) -{ - struct vkCmdInsertDebugUtilsLabelEXT_params params; - params.commandBuffer = commandBuffer; - params.pLabelInfo = pLabelInfo; - UNIX_CALL(vkCmdInsertDebugUtilsLabelEXT, ¶ms); -} - -void WINAPI vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) -{ - struct vkCmdNextSubpass_params params; - params.commandBuffer = commandBuffer; - params.contents = contents; - UNIX_CALL(vkCmdNextSubpass, ¶ms); -} - -void WINAPI vkCmdNextSubpass2(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo *pSubpassBeginInfo, const VkSubpassEndInfo *pSubpassEndInfo) -{ - struct vkCmdNextSubpass2_params params; - params.commandBuffer = commandBuffer; - params.pSubpassBeginInfo = pSubpassBeginInfo; - params.pSubpassEndInfo = pSubpassEndInfo; - UNIX_CALL(vkCmdNextSubpass2, ¶ms); -} - -void WINAPI vkCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo *pSubpassBeginInfo, const VkSubpassEndInfo *pSubpassEndInfo) -{ - struct vkCmdNextSubpass2KHR_params params; - params.commandBuffer = commandBuffer; - params.pSubpassBeginInfo = pSubpassBeginInfo; - params.pSubpassEndInfo = pSubpassEndInfo; - UNIX_CALL(vkCmdNextSubpass2KHR, ¶ms); -} - -void WINAPI vkCmdOpticalFlowExecuteNV(VkCommandBuffer commandBuffer, VkOpticalFlowSessionNV session, const VkOpticalFlowExecuteInfoNV *pExecuteInfo) -{ - struct vkCmdOpticalFlowExecuteNV_params params; - params.commandBuffer = commandBuffer; - params.session = session; - params.pExecuteInfo = pExecuteInfo; - UNIX_CALL(vkCmdOpticalFlowExecuteNV, ¶ms); -} - -void WINAPI vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers) -{ - struct vkCmdPipelineBarrier_params params; - params.commandBuffer = commandBuffer; - params.srcStageMask = srcStageMask; - params.dstStageMask = dstStageMask; - params.dependencyFlags = dependencyFlags; - params.memoryBarrierCount = memoryBarrierCount; - params.pMemoryBarriers = pMemoryBarriers; - params.bufferMemoryBarrierCount = bufferMemoryBarrierCount; - params.pBufferMemoryBarriers = pBufferMemoryBarriers; - params.imageMemoryBarrierCount = imageMemoryBarrierCount; - params.pImageMemoryBarriers = pImageMemoryBarriers; - UNIX_CALL(vkCmdPipelineBarrier, ¶ms); -} - -void WINAPI vkCmdPipelineBarrier2(VkCommandBuffer commandBuffer, const VkDependencyInfo *pDependencyInfo) -{ - struct vkCmdPipelineBarrier2_params params; - params.commandBuffer = commandBuffer; - params.pDependencyInfo = pDependencyInfo; - UNIX_CALL(vkCmdPipelineBarrier2, ¶ms); -} - -void WINAPI vkCmdPipelineBarrier2KHR(VkCommandBuffer commandBuffer, const VkDependencyInfo *pDependencyInfo) -{ - struct vkCmdPipelineBarrier2KHR_params params; - params.commandBuffer = commandBuffer; - params.pDependencyInfo = pDependencyInfo; - UNIX_CALL(vkCmdPipelineBarrier2KHR, ¶ms); -} - -void WINAPI vkCmdPreprocessGeneratedCommandsEXT(VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoEXT *pGeneratedCommandsInfo, VkCommandBuffer stateCommandBuffer) -{ - struct vkCmdPreprocessGeneratedCommandsEXT_params params; - params.commandBuffer = commandBuffer; - params.pGeneratedCommandsInfo = pGeneratedCommandsInfo; - params.stateCommandBuffer = stateCommandBuffer; - UNIX_CALL(vkCmdPreprocessGeneratedCommandsEXT, ¶ms); -} - -void WINAPI vkCmdPreprocessGeneratedCommandsNV(VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoNV *pGeneratedCommandsInfo) -{ - struct vkCmdPreprocessGeneratedCommandsNV_params params; - params.commandBuffer = commandBuffer; - params.pGeneratedCommandsInfo = pGeneratedCommandsInfo; - UNIX_CALL(vkCmdPreprocessGeneratedCommandsNV, ¶ms); -} - -void WINAPI vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void *pValues) -{ - struct vkCmdPushConstants_params params; - params.commandBuffer = commandBuffer; - params.layout = layout; - params.stageFlags = stageFlags; - params.offset = offset; - params.size = size; - params.pValues = pValues; - UNIX_CALL(vkCmdPushConstants, ¶ms); -} - -void WINAPI vkCmdPushConstants2(VkCommandBuffer commandBuffer, const VkPushConstantsInfo *pPushConstantsInfo) -{ - struct vkCmdPushConstants2_params params; - params.commandBuffer = commandBuffer; - params.pPushConstantsInfo = pPushConstantsInfo; - UNIX_CALL(vkCmdPushConstants2, ¶ms); -} - -void WINAPI vkCmdPushConstants2KHR(VkCommandBuffer commandBuffer, const VkPushConstantsInfo *pPushConstantsInfo) -{ - struct vkCmdPushConstants2KHR_params params; - params.commandBuffer = commandBuffer; - params.pPushConstantsInfo = pPushConstantsInfo; - UNIX_CALL(vkCmdPushConstants2KHR, ¶ms); -} - -void WINAPI vkCmdPushDescriptorSet(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites) -{ - struct vkCmdPushDescriptorSet_params params; - params.commandBuffer = commandBuffer; - params.pipelineBindPoint = pipelineBindPoint; - params.layout = layout; - params.set = set; - params.descriptorWriteCount = descriptorWriteCount; - params.pDescriptorWrites = pDescriptorWrites; - UNIX_CALL(vkCmdPushDescriptorSet, ¶ms); -} - -void WINAPI vkCmdPushDescriptorSet2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetInfo *pPushDescriptorSetInfo) -{ - struct vkCmdPushDescriptorSet2_params params; - params.commandBuffer = commandBuffer; - params.pPushDescriptorSetInfo = pPushDescriptorSetInfo; - UNIX_CALL(vkCmdPushDescriptorSet2, ¶ms); -} - -void WINAPI vkCmdPushDescriptorSet2KHR(VkCommandBuffer commandBuffer, const VkPushDescriptorSetInfo *pPushDescriptorSetInfo) -{ - struct vkCmdPushDescriptorSet2KHR_params params; - params.commandBuffer = commandBuffer; - params.pPushDescriptorSetInfo = pPushDescriptorSetInfo; - UNIX_CALL(vkCmdPushDescriptorSet2KHR, ¶ms); -} - -void WINAPI vkCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites) -{ - struct vkCmdPushDescriptorSetKHR_params params; - params.commandBuffer = commandBuffer; - params.pipelineBindPoint = pipelineBindPoint; - params.layout = layout; - params.set = set; - params.descriptorWriteCount = descriptorWriteCount; - params.pDescriptorWrites = pDescriptorWrites; - UNIX_CALL(vkCmdPushDescriptorSetKHR, ¶ms); -} - -void WINAPI vkCmdPushDescriptorSetWithTemplate(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void *pData) -{ - struct vkCmdPushDescriptorSetWithTemplate_params params; - params.commandBuffer = commandBuffer; - params.descriptorUpdateTemplate = descriptorUpdateTemplate; - params.layout = layout; - params.set = set; - params.pData = pData; - UNIX_CALL(vkCmdPushDescriptorSetWithTemplate, ¶ms); -} - -void WINAPI vkCmdPushDescriptorSetWithTemplate2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo *pPushDescriptorSetWithTemplateInfo) -{ - struct vkCmdPushDescriptorSetWithTemplate2_params params; - params.commandBuffer = commandBuffer; - params.pPushDescriptorSetWithTemplateInfo = pPushDescriptorSetWithTemplateInfo; - UNIX_CALL(vkCmdPushDescriptorSetWithTemplate2, ¶ms); -} - -void WINAPI vkCmdPushDescriptorSetWithTemplate2KHR(VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo *pPushDescriptorSetWithTemplateInfo) -{ - struct vkCmdPushDescriptorSetWithTemplate2KHR_params params; - params.commandBuffer = commandBuffer; - params.pPushDescriptorSetWithTemplateInfo = pPushDescriptorSetWithTemplateInfo; - UNIX_CALL(vkCmdPushDescriptorSetWithTemplate2KHR, ¶ms); -} - -void WINAPI vkCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void *pData) -{ - struct vkCmdPushDescriptorSetWithTemplateKHR_params params; - params.commandBuffer = commandBuffer; - params.descriptorUpdateTemplate = descriptorUpdateTemplate; - params.layout = layout; - params.set = set; - params.pData = pData; - UNIX_CALL(vkCmdPushDescriptorSetWithTemplateKHR, ¶ms); -} - -void WINAPI vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) -{ - struct vkCmdResetEvent_params params; - params.commandBuffer = commandBuffer; - params.event = event; - params.stageMask = stageMask; - UNIX_CALL(vkCmdResetEvent, ¶ms); -} - -void WINAPI vkCmdResetEvent2(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask) -{ - struct vkCmdResetEvent2_params params; - params.commandBuffer = commandBuffer; - params.event = event; - params.stageMask = stageMask; - UNIX_CALL(vkCmdResetEvent2, ¶ms); -} - -void WINAPI vkCmdResetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask) -{ - struct vkCmdResetEvent2KHR_params params; - params.commandBuffer = commandBuffer; - params.event = event; - params.stageMask = stageMask; - UNIX_CALL(vkCmdResetEvent2KHR, ¶ms); -} - -void WINAPI vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) -{ - struct vkCmdResetQueryPool_params params; - params.commandBuffer = commandBuffer; - params.queryPool = queryPool; - params.firstQuery = firstQuery; - params.queryCount = queryCount; - UNIX_CALL(vkCmdResetQueryPool, ¶ms); -} - -void WINAPI vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve *pRegions) -{ - struct vkCmdResolveImage_params params; - params.commandBuffer = commandBuffer; - params.srcImage = srcImage; - params.srcImageLayout = srcImageLayout; - params.dstImage = dstImage; - params.dstImageLayout = dstImageLayout; - params.regionCount = regionCount; - params.pRegions = pRegions; - UNIX_CALL(vkCmdResolveImage, ¶ms); -} - -void WINAPI vkCmdResolveImage2(VkCommandBuffer commandBuffer, const VkResolveImageInfo2 *pResolveImageInfo) -{ - struct vkCmdResolveImage2_params params; - params.commandBuffer = commandBuffer; - params.pResolveImageInfo = pResolveImageInfo; - UNIX_CALL(vkCmdResolveImage2, ¶ms); -} - -void WINAPI vkCmdResolveImage2KHR(VkCommandBuffer commandBuffer, const VkResolveImageInfo2 *pResolveImageInfo) -{ - struct vkCmdResolveImage2KHR_params params; - params.commandBuffer = commandBuffer; - params.pResolveImageInfo = pResolveImageInfo; - UNIX_CALL(vkCmdResolveImage2KHR, ¶ms); -} - -void WINAPI vkCmdSetAlphaToCoverageEnableEXT(VkCommandBuffer commandBuffer, VkBool32 alphaToCoverageEnable) -{ - struct vkCmdSetAlphaToCoverageEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.alphaToCoverageEnable = alphaToCoverageEnable; - UNIX_CALL(vkCmdSetAlphaToCoverageEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetAlphaToOneEnableEXT(VkCommandBuffer commandBuffer, VkBool32 alphaToOneEnable) -{ - struct vkCmdSetAlphaToOneEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.alphaToOneEnable = alphaToOneEnable; - UNIX_CALL(vkCmdSetAlphaToOneEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetAttachmentFeedbackLoopEnableEXT(VkCommandBuffer commandBuffer, VkImageAspectFlags aspectMask) -{ - struct vkCmdSetAttachmentFeedbackLoopEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.aspectMask = aspectMask; - UNIX_CALL(vkCmdSetAttachmentFeedbackLoopEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]) -{ - struct vkCmdSetBlendConstants_params params; - params.commandBuffer = commandBuffer; - params.blendConstants = blendConstants; - UNIX_CALL(vkCmdSetBlendConstants, ¶ms); -} - -void WINAPI vkCmdSetCheckpointNV(VkCommandBuffer commandBuffer, const void *pCheckpointMarker) -{ - struct vkCmdSetCheckpointNV_params params; - params.commandBuffer = commandBuffer; - params.pCheckpointMarker = pCheckpointMarker; - UNIX_CALL(vkCmdSetCheckpointNV, ¶ms); -} - -void WINAPI vkCmdSetCoarseSampleOrderNV(VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType, uint32_t customSampleOrderCount, const VkCoarseSampleOrderCustomNV *pCustomSampleOrders) -{ - struct vkCmdSetCoarseSampleOrderNV_params params; - params.commandBuffer = commandBuffer; - params.sampleOrderType = sampleOrderType; - params.customSampleOrderCount = customSampleOrderCount; - params.pCustomSampleOrders = pCustomSampleOrders; - UNIX_CALL(vkCmdSetCoarseSampleOrderNV, ¶ms); -} - -void WINAPI vkCmdSetColorBlendAdvancedEXT(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorBlendAdvancedEXT *pColorBlendAdvanced) -{ - struct vkCmdSetColorBlendAdvancedEXT_params params; - params.commandBuffer = commandBuffer; - params.firstAttachment = firstAttachment; - params.attachmentCount = attachmentCount; - params.pColorBlendAdvanced = pColorBlendAdvanced; - UNIX_CALL(vkCmdSetColorBlendAdvancedEXT, ¶ms); -} - -void WINAPI vkCmdSetColorBlendEnableEXT(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkBool32 *pColorBlendEnables) -{ - struct vkCmdSetColorBlendEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.firstAttachment = firstAttachment; - params.attachmentCount = attachmentCount; - params.pColorBlendEnables = pColorBlendEnables; - UNIX_CALL(vkCmdSetColorBlendEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetColorBlendEquationEXT(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorBlendEquationEXT *pColorBlendEquations) -{ - struct vkCmdSetColorBlendEquationEXT_params params; - params.commandBuffer = commandBuffer; - params.firstAttachment = firstAttachment; - params.attachmentCount = attachmentCount; - params.pColorBlendEquations = pColorBlendEquations; - UNIX_CALL(vkCmdSetColorBlendEquationEXT, ¶ms); -} - -void WINAPI vkCmdSetColorWriteEnableEXT(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkBool32 *pColorWriteEnables) -{ - struct vkCmdSetColorWriteEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.attachmentCount = attachmentCount; - params.pColorWriteEnables = pColorWriteEnables; - UNIX_CALL(vkCmdSetColorWriteEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetColorWriteMaskEXT(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorComponentFlags *pColorWriteMasks) -{ - struct vkCmdSetColorWriteMaskEXT_params params; - params.commandBuffer = commandBuffer; - params.firstAttachment = firstAttachment; - params.attachmentCount = attachmentCount; - params.pColorWriteMasks = pColorWriteMasks; - UNIX_CALL(vkCmdSetColorWriteMaskEXT, ¶ms); -} - -void WINAPI vkCmdSetConservativeRasterizationModeEXT(VkCommandBuffer commandBuffer, VkConservativeRasterizationModeEXT conservativeRasterizationMode) -{ - struct vkCmdSetConservativeRasterizationModeEXT_params params; - params.commandBuffer = commandBuffer; - params.conservativeRasterizationMode = conservativeRasterizationMode; - UNIX_CALL(vkCmdSetConservativeRasterizationModeEXT, ¶ms); -} - -void WINAPI vkCmdSetCoverageModulationModeNV(VkCommandBuffer commandBuffer, VkCoverageModulationModeNV coverageModulationMode) -{ - struct vkCmdSetCoverageModulationModeNV_params params; - params.commandBuffer = commandBuffer; - params.coverageModulationMode = coverageModulationMode; - UNIX_CALL(vkCmdSetCoverageModulationModeNV, ¶ms); -} - -void WINAPI vkCmdSetCoverageModulationTableEnableNV(VkCommandBuffer commandBuffer, VkBool32 coverageModulationTableEnable) -{ - struct vkCmdSetCoverageModulationTableEnableNV_params params; - params.commandBuffer = commandBuffer; - params.coverageModulationTableEnable = coverageModulationTableEnable; - UNIX_CALL(vkCmdSetCoverageModulationTableEnableNV, ¶ms); -} - -void WINAPI vkCmdSetCoverageModulationTableNV(VkCommandBuffer commandBuffer, uint32_t coverageModulationTableCount, const float *pCoverageModulationTable) -{ - struct vkCmdSetCoverageModulationTableNV_params params; - params.commandBuffer = commandBuffer; - params.coverageModulationTableCount = coverageModulationTableCount; - params.pCoverageModulationTable = pCoverageModulationTable; - UNIX_CALL(vkCmdSetCoverageModulationTableNV, ¶ms); -} - -void WINAPI vkCmdSetCoverageReductionModeNV(VkCommandBuffer commandBuffer, VkCoverageReductionModeNV coverageReductionMode) -{ - struct vkCmdSetCoverageReductionModeNV_params params; - params.commandBuffer = commandBuffer; - params.coverageReductionMode = coverageReductionMode; - UNIX_CALL(vkCmdSetCoverageReductionModeNV, ¶ms); -} - -void WINAPI vkCmdSetCoverageToColorEnableNV(VkCommandBuffer commandBuffer, VkBool32 coverageToColorEnable) -{ - struct vkCmdSetCoverageToColorEnableNV_params params; - params.commandBuffer = commandBuffer; - params.coverageToColorEnable = coverageToColorEnable; - UNIX_CALL(vkCmdSetCoverageToColorEnableNV, ¶ms); -} - -void WINAPI vkCmdSetCoverageToColorLocationNV(VkCommandBuffer commandBuffer, uint32_t coverageToColorLocation) -{ - struct vkCmdSetCoverageToColorLocationNV_params params; - params.commandBuffer = commandBuffer; - params.coverageToColorLocation = coverageToColorLocation; - UNIX_CALL(vkCmdSetCoverageToColorLocationNV, ¶ms); -} - -void WINAPI vkCmdSetCullMode(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode) -{ - struct vkCmdSetCullMode_params params; - params.commandBuffer = commandBuffer; - params.cullMode = cullMode; - UNIX_CALL(vkCmdSetCullMode, ¶ms); -} - -void WINAPI vkCmdSetCullModeEXT(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode) -{ - struct vkCmdSetCullModeEXT_params params; - params.commandBuffer = commandBuffer; - params.cullMode = cullMode; - UNIX_CALL(vkCmdSetCullModeEXT, ¶ms); -} - -void WINAPI vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor) -{ - struct vkCmdSetDepthBias_params params; - params.commandBuffer = commandBuffer; - params.depthBiasConstantFactor = depthBiasConstantFactor; - params.depthBiasClamp = depthBiasClamp; - params.depthBiasSlopeFactor = depthBiasSlopeFactor; - UNIX_CALL(vkCmdSetDepthBias, ¶ms); -} - -void WINAPI vkCmdSetDepthBias2EXT(VkCommandBuffer commandBuffer, const VkDepthBiasInfoEXT *pDepthBiasInfo) -{ - struct vkCmdSetDepthBias2EXT_params params; - params.commandBuffer = commandBuffer; - params.pDepthBiasInfo = pDepthBiasInfo; - UNIX_CALL(vkCmdSetDepthBias2EXT, ¶ms); -} - -void WINAPI vkCmdSetDepthBiasEnable(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable) -{ - struct vkCmdSetDepthBiasEnable_params params; - params.commandBuffer = commandBuffer; - params.depthBiasEnable = depthBiasEnable; - UNIX_CALL(vkCmdSetDepthBiasEnable, ¶ms); -} - -void WINAPI vkCmdSetDepthBiasEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable) -{ - struct vkCmdSetDepthBiasEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.depthBiasEnable = depthBiasEnable; - UNIX_CALL(vkCmdSetDepthBiasEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds) -{ - struct vkCmdSetDepthBounds_params params; - params.commandBuffer = commandBuffer; - params.minDepthBounds = minDepthBounds; - params.maxDepthBounds = maxDepthBounds; - UNIX_CALL(vkCmdSetDepthBounds, ¶ms); -} - -void WINAPI vkCmdSetDepthBoundsTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable) -{ - struct vkCmdSetDepthBoundsTestEnable_params params; - params.commandBuffer = commandBuffer; - params.depthBoundsTestEnable = depthBoundsTestEnable; - UNIX_CALL(vkCmdSetDepthBoundsTestEnable, ¶ms); -} - -void WINAPI vkCmdSetDepthBoundsTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable) -{ - struct vkCmdSetDepthBoundsTestEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.depthBoundsTestEnable = depthBoundsTestEnable; - UNIX_CALL(vkCmdSetDepthBoundsTestEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetDepthClampEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthClampEnable) -{ - struct vkCmdSetDepthClampEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.depthClampEnable = depthClampEnable; - UNIX_CALL(vkCmdSetDepthClampEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetDepthClampRangeEXT(VkCommandBuffer commandBuffer, VkDepthClampModeEXT depthClampMode, const VkDepthClampRangeEXT *pDepthClampRange) -{ - struct vkCmdSetDepthClampRangeEXT_params params; - params.commandBuffer = commandBuffer; - params.depthClampMode = depthClampMode; - params.pDepthClampRange = pDepthClampRange; - UNIX_CALL(vkCmdSetDepthClampRangeEXT, ¶ms); -} - -void WINAPI vkCmdSetDepthClipEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthClipEnable) -{ - struct vkCmdSetDepthClipEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.depthClipEnable = depthClipEnable; - UNIX_CALL(vkCmdSetDepthClipEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetDepthClipNegativeOneToOneEXT(VkCommandBuffer commandBuffer, VkBool32 negativeOneToOne) -{ - struct vkCmdSetDepthClipNegativeOneToOneEXT_params params; - params.commandBuffer = commandBuffer; - params.negativeOneToOne = negativeOneToOne; - UNIX_CALL(vkCmdSetDepthClipNegativeOneToOneEXT, ¶ms); -} - -void WINAPI vkCmdSetDepthCompareOp(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp) -{ - struct vkCmdSetDepthCompareOp_params params; - params.commandBuffer = commandBuffer; - params.depthCompareOp = depthCompareOp; - UNIX_CALL(vkCmdSetDepthCompareOp, ¶ms); -} - -void WINAPI vkCmdSetDepthCompareOpEXT(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp) -{ - struct vkCmdSetDepthCompareOpEXT_params params; - params.commandBuffer = commandBuffer; - params.depthCompareOp = depthCompareOp; - UNIX_CALL(vkCmdSetDepthCompareOpEXT, ¶ms); -} - -void WINAPI vkCmdSetDepthTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable) -{ - struct vkCmdSetDepthTestEnable_params params; - params.commandBuffer = commandBuffer; - params.depthTestEnable = depthTestEnable; - UNIX_CALL(vkCmdSetDepthTestEnable, ¶ms); -} - -void WINAPI vkCmdSetDepthTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable) -{ - struct vkCmdSetDepthTestEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.depthTestEnable = depthTestEnable; - UNIX_CALL(vkCmdSetDepthTestEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetDepthWriteEnable(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable) -{ - struct vkCmdSetDepthWriteEnable_params params; - params.commandBuffer = commandBuffer; - params.depthWriteEnable = depthWriteEnable; - UNIX_CALL(vkCmdSetDepthWriteEnable, ¶ms); -} - -void WINAPI vkCmdSetDepthWriteEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable) -{ - struct vkCmdSetDepthWriteEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.depthWriteEnable = depthWriteEnable; - UNIX_CALL(vkCmdSetDepthWriteEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetDescriptorBufferOffsets2EXT(VkCommandBuffer commandBuffer, const VkSetDescriptorBufferOffsetsInfoEXT *pSetDescriptorBufferOffsetsInfo) -{ - struct vkCmdSetDescriptorBufferOffsets2EXT_params params; - params.commandBuffer = commandBuffer; - params.pSetDescriptorBufferOffsetsInfo = pSetDescriptorBufferOffsetsInfo; - UNIX_CALL(vkCmdSetDescriptorBufferOffsets2EXT, ¶ms); -} - -void WINAPI vkCmdSetDescriptorBufferOffsetsEXT(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const uint32_t *pBufferIndices, const VkDeviceSize *pOffsets) -{ - struct vkCmdSetDescriptorBufferOffsetsEXT_params params; - params.commandBuffer = commandBuffer; - params.pipelineBindPoint = pipelineBindPoint; - params.layout = layout; - params.firstSet = firstSet; - params.setCount = setCount; - params.pBufferIndices = pBufferIndices; - params.pOffsets = pOffsets; - UNIX_CALL(vkCmdSetDescriptorBufferOffsetsEXT, ¶ms); -} - -void WINAPI vkCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask) -{ - struct vkCmdSetDeviceMask_params params; - params.commandBuffer = commandBuffer; - params.deviceMask = deviceMask; - UNIX_CALL(vkCmdSetDeviceMask, ¶ms); -} - -void WINAPI vkCmdSetDeviceMaskKHR(VkCommandBuffer commandBuffer, uint32_t deviceMask) -{ - struct vkCmdSetDeviceMaskKHR_params params; - params.commandBuffer = commandBuffer; - params.deviceMask = deviceMask; - UNIX_CALL(vkCmdSetDeviceMaskKHR, ¶ms); -} - -void WINAPI vkCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D *pDiscardRectangles) -{ - struct vkCmdSetDiscardRectangleEXT_params params; - params.commandBuffer = commandBuffer; - params.firstDiscardRectangle = firstDiscardRectangle; - params.discardRectangleCount = discardRectangleCount; - params.pDiscardRectangles = pDiscardRectangles; - UNIX_CALL(vkCmdSetDiscardRectangleEXT, ¶ms); -} - -void WINAPI vkCmdSetDiscardRectangleEnableEXT(VkCommandBuffer commandBuffer, VkBool32 discardRectangleEnable) -{ - struct vkCmdSetDiscardRectangleEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.discardRectangleEnable = discardRectangleEnable; - UNIX_CALL(vkCmdSetDiscardRectangleEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetDiscardRectangleModeEXT(VkCommandBuffer commandBuffer, VkDiscardRectangleModeEXT discardRectangleMode) -{ - struct vkCmdSetDiscardRectangleModeEXT_params params; - params.commandBuffer = commandBuffer; - params.discardRectangleMode = discardRectangleMode; - UNIX_CALL(vkCmdSetDiscardRectangleModeEXT, ¶ms); -} - -void WINAPI vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) -{ - struct vkCmdSetEvent_params params; - params.commandBuffer = commandBuffer; - params.event = event; - params.stageMask = stageMask; - UNIX_CALL(vkCmdSetEvent, ¶ms); -} - -void WINAPI vkCmdSetEvent2(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfo *pDependencyInfo) -{ - struct vkCmdSetEvent2_params params; - params.commandBuffer = commandBuffer; - params.event = event; - params.pDependencyInfo = pDependencyInfo; - UNIX_CALL(vkCmdSetEvent2, ¶ms); -} - -void WINAPI vkCmdSetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfo *pDependencyInfo) -{ - struct vkCmdSetEvent2KHR_params params; - params.commandBuffer = commandBuffer; - params.event = event; - params.pDependencyInfo = pDependencyInfo; - UNIX_CALL(vkCmdSetEvent2KHR, ¶ms); -} - -void WINAPI vkCmdSetExclusiveScissorEnableNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkBool32 *pExclusiveScissorEnables) -{ - struct vkCmdSetExclusiveScissorEnableNV_params params; - params.commandBuffer = commandBuffer; - params.firstExclusiveScissor = firstExclusiveScissor; - params.exclusiveScissorCount = exclusiveScissorCount; - params.pExclusiveScissorEnables = pExclusiveScissorEnables; - UNIX_CALL(vkCmdSetExclusiveScissorEnableNV, ¶ms); -} - -void WINAPI vkCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkRect2D *pExclusiveScissors) -{ - struct vkCmdSetExclusiveScissorNV_params params; - params.commandBuffer = commandBuffer; - params.firstExclusiveScissor = firstExclusiveScissor; - params.exclusiveScissorCount = exclusiveScissorCount; - params.pExclusiveScissors = pExclusiveScissors; - UNIX_CALL(vkCmdSetExclusiveScissorNV, ¶ms); -} - -void WINAPI vkCmdSetExtraPrimitiveOverestimationSizeEXT(VkCommandBuffer commandBuffer, float extraPrimitiveOverestimationSize) -{ - struct vkCmdSetExtraPrimitiveOverestimationSizeEXT_params params; - params.commandBuffer = commandBuffer; - params.extraPrimitiveOverestimationSize = extraPrimitiveOverestimationSize; - UNIX_CALL(vkCmdSetExtraPrimitiveOverestimationSizeEXT, ¶ms); -} - -void WINAPI vkCmdSetFragmentShadingRateEnumNV(VkCommandBuffer commandBuffer, VkFragmentShadingRateNV shadingRate, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]) -{ - struct vkCmdSetFragmentShadingRateEnumNV_params params; - params.commandBuffer = commandBuffer; - params.shadingRate = shadingRate; - params.combinerOps = combinerOps; - UNIX_CALL(vkCmdSetFragmentShadingRateEnumNV, ¶ms); -} - -void WINAPI vkCmdSetFragmentShadingRateKHR(VkCommandBuffer commandBuffer, const VkExtent2D *pFragmentSize, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]) -{ - struct vkCmdSetFragmentShadingRateKHR_params params; - params.commandBuffer = commandBuffer; - params.pFragmentSize = pFragmentSize; - params.combinerOps = combinerOps; - UNIX_CALL(vkCmdSetFragmentShadingRateKHR, ¶ms); -} - -void WINAPI vkCmdSetFrontFace(VkCommandBuffer commandBuffer, VkFrontFace frontFace) -{ - struct vkCmdSetFrontFace_params params; - params.commandBuffer = commandBuffer; - params.frontFace = frontFace; - UNIX_CALL(vkCmdSetFrontFace, ¶ms); -} - -void WINAPI vkCmdSetFrontFaceEXT(VkCommandBuffer commandBuffer, VkFrontFace frontFace) -{ - struct vkCmdSetFrontFaceEXT_params params; - params.commandBuffer = commandBuffer; - params.frontFace = frontFace; - UNIX_CALL(vkCmdSetFrontFaceEXT, ¶ms); -} - -void WINAPI vkCmdSetLineRasterizationModeEXT(VkCommandBuffer commandBuffer, VkLineRasterizationModeEXT lineRasterizationMode) -{ - struct vkCmdSetLineRasterizationModeEXT_params params; - params.commandBuffer = commandBuffer; - params.lineRasterizationMode = lineRasterizationMode; - UNIX_CALL(vkCmdSetLineRasterizationModeEXT, ¶ms); -} - -void WINAPI vkCmdSetLineStipple(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) -{ - struct vkCmdSetLineStipple_params params; - params.commandBuffer = commandBuffer; - params.lineStippleFactor = lineStippleFactor; - params.lineStipplePattern = lineStipplePattern; - UNIX_CALL(vkCmdSetLineStipple, ¶ms); -} - -void WINAPI vkCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) -{ - struct vkCmdSetLineStippleEXT_params params; - params.commandBuffer = commandBuffer; - params.lineStippleFactor = lineStippleFactor; - params.lineStipplePattern = lineStipplePattern; - UNIX_CALL(vkCmdSetLineStippleEXT, ¶ms); -} - -void WINAPI vkCmdSetLineStippleEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stippledLineEnable) -{ - struct vkCmdSetLineStippleEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.stippledLineEnable = stippledLineEnable; - UNIX_CALL(vkCmdSetLineStippleEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetLineStippleKHR(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) -{ - struct vkCmdSetLineStippleKHR_params params; - params.commandBuffer = commandBuffer; - params.lineStippleFactor = lineStippleFactor; - params.lineStipplePattern = lineStipplePattern; - UNIX_CALL(vkCmdSetLineStippleKHR, ¶ms); -} - -void WINAPI vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) -{ - struct vkCmdSetLineWidth_params params; - params.commandBuffer = commandBuffer; - params.lineWidth = lineWidth; - UNIX_CALL(vkCmdSetLineWidth, ¶ms); -} - -void WINAPI vkCmdSetLogicOpEXT(VkCommandBuffer commandBuffer, VkLogicOp logicOp) -{ - struct vkCmdSetLogicOpEXT_params params; - params.commandBuffer = commandBuffer; - params.logicOp = logicOp; - UNIX_CALL(vkCmdSetLogicOpEXT, ¶ms); -} - -void WINAPI vkCmdSetLogicOpEnableEXT(VkCommandBuffer commandBuffer, VkBool32 logicOpEnable) -{ - struct vkCmdSetLogicOpEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.logicOpEnable = logicOpEnable; - UNIX_CALL(vkCmdSetLogicOpEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetPatchControlPointsEXT(VkCommandBuffer commandBuffer, uint32_t patchControlPoints) -{ - struct vkCmdSetPatchControlPointsEXT_params params; - params.commandBuffer = commandBuffer; - params.patchControlPoints = patchControlPoints; - UNIX_CALL(vkCmdSetPatchControlPointsEXT, ¶ms); -} - -VkResult WINAPI vkCmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer, const VkPerformanceMarkerInfoINTEL *pMarkerInfo) -{ - struct vkCmdSetPerformanceMarkerINTEL_params params; - NTSTATUS status; - params.commandBuffer = commandBuffer; - params.pMarkerInfo = pMarkerInfo; - status = UNIX_CALL(vkCmdSetPerformanceMarkerINTEL, ¶ms); - assert(!status && "vkCmdSetPerformanceMarkerINTEL"); - return params.result; -} - -VkResult WINAPI vkCmdSetPerformanceOverrideINTEL(VkCommandBuffer commandBuffer, const VkPerformanceOverrideInfoINTEL *pOverrideInfo) -{ - struct vkCmdSetPerformanceOverrideINTEL_params params; - NTSTATUS status; - params.commandBuffer = commandBuffer; - params.pOverrideInfo = pOverrideInfo; - status = UNIX_CALL(vkCmdSetPerformanceOverrideINTEL, ¶ms); - assert(!status && "vkCmdSetPerformanceOverrideINTEL"); - return params.result; -} - -VkResult WINAPI vkCmdSetPerformanceStreamMarkerINTEL(VkCommandBuffer commandBuffer, const VkPerformanceStreamMarkerInfoINTEL *pMarkerInfo) -{ - struct vkCmdSetPerformanceStreamMarkerINTEL_params params; - NTSTATUS status; - params.commandBuffer = commandBuffer; - params.pMarkerInfo = pMarkerInfo; - status = UNIX_CALL(vkCmdSetPerformanceStreamMarkerINTEL, ¶ms); - assert(!status && "vkCmdSetPerformanceStreamMarkerINTEL"); - return params.result; -} - -void WINAPI vkCmdSetPolygonModeEXT(VkCommandBuffer commandBuffer, VkPolygonMode polygonMode) -{ - struct vkCmdSetPolygonModeEXT_params params; - params.commandBuffer = commandBuffer; - params.polygonMode = polygonMode; - UNIX_CALL(vkCmdSetPolygonModeEXT, ¶ms); -} - -void WINAPI vkCmdSetPrimitiveRestartEnable(VkCommandBuffer commandBuffer, VkBool32 primitiveRestartEnable) -{ - struct vkCmdSetPrimitiveRestartEnable_params params; - params.commandBuffer = commandBuffer; - params.primitiveRestartEnable = primitiveRestartEnable; - UNIX_CALL(vkCmdSetPrimitiveRestartEnable, ¶ms); -} - -void WINAPI vkCmdSetPrimitiveRestartEnableEXT(VkCommandBuffer commandBuffer, VkBool32 primitiveRestartEnable) -{ - struct vkCmdSetPrimitiveRestartEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.primitiveRestartEnable = primitiveRestartEnable; - UNIX_CALL(vkCmdSetPrimitiveRestartEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetPrimitiveTopology(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology) -{ - struct vkCmdSetPrimitiveTopology_params params; - params.commandBuffer = commandBuffer; - params.primitiveTopology = primitiveTopology; - UNIX_CALL(vkCmdSetPrimitiveTopology, ¶ms); -} - -void WINAPI vkCmdSetPrimitiveTopologyEXT(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology) -{ - struct vkCmdSetPrimitiveTopologyEXT_params params; - params.commandBuffer = commandBuffer; - params.primitiveTopology = primitiveTopology; - UNIX_CALL(vkCmdSetPrimitiveTopologyEXT, ¶ms); -} - -void WINAPI vkCmdSetProvokingVertexModeEXT(VkCommandBuffer commandBuffer, VkProvokingVertexModeEXT provokingVertexMode) -{ - struct vkCmdSetProvokingVertexModeEXT_params params; - params.commandBuffer = commandBuffer; - params.provokingVertexMode = provokingVertexMode; - UNIX_CALL(vkCmdSetProvokingVertexModeEXT, ¶ms); -} - -void WINAPI vkCmdSetRasterizationSamplesEXT(VkCommandBuffer commandBuffer, VkSampleCountFlagBits rasterizationSamples) -{ - struct vkCmdSetRasterizationSamplesEXT_params params; - params.commandBuffer = commandBuffer; - params.rasterizationSamples = rasterizationSamples; - UNIX_CALL(vkCmdSetRasterizationSamplesEXT, ¶ms); -} - -void WINAPI vkCmdSetRasterizationStreamEXT(VkCommandBuffer commandBuffer, uint32_t rasterizationStream) -{ - struct vkCmdSetRasterizationStreamEXT_params params; - params.commandBuffer = commandBuffer; - params.rasterizationStream = rasterizationStream; - UNIX_CALL(vkCmdSetRasterizationStreamEXT, ¶ms); -} - -void WINAPI vkCmdSetRasterizerDiscardEnable(VkCommandBuffer commandBuffer, VkBool32 rasterizerDiscardEnable) -{ - struct vkCmdSetRasterizerDiscardEnable_params params; - params.commandBuffer = commandBuffer; - params.rasterizerDiscardEnable = rasterizerDiscardEnable; - UNIX_CALL(vkCmdSetRasterizerDiscardEnable, ¶ms); -} - -void WINAPI vkCmdSetRasterizerDiscardEnableEXT(VkCommandBuffer commandBuffer, VkBool32 rasterizerDiscardEnable) -{ - struct vkCmdSetRasterizerDiscardEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.rasterizerDiscardEnable = rasterizerDiscardEnable; - UNIX_CALL(vkCmdSetRasterizerDiscardEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetRayTracingPipelineStackSizeKHR(VkCommandBuffer commandBuffer, uint32_t pipelineStackSize) -{ - struct vkCmdSetRayTracingPipelineStackSizeKHR_params params; - params.commandBuffer = commandBuffer; - params.pipelineStackSize = pipelineStackSize; - UNIX_CALL(vkCmdSetRayTracingPipelineStackSizeKHR, ¶ms); -} - -void WINAPI vkCmdSetRenderingAttachmentLocations(VkCommandBuffer commandBuffer, const VkRenderingAttachmentLocationInfo *pLocationInfo) -{ - struct vkCmdSetRenderingAttachmentLocations_params params; - params.commandBuffer = commandBuffer; - params.pLocationInfo = pLocationInfo; - UNIX_CALL(vkCmdSetRenderingAttachmentLocations, ¶ms); -} - -void WINAPI vkCmdSetRenderingAttachmentLocationsKHR(VkCommandBuffer commandBuffer, const VkRenderingAttachmentLocationInfo *pLocationInfo) -{ - struct vkCmdSetRenderingAttachmentLocationsKHR_params params; - params.commandBuffer = commandBuffer; - params.pLocationInfo = pLocationInfo; - UNIX_CALL(vkCmdSetRenderingAttachmentLocationsKHR, ¶ms); -} - -void WINAPI vkCmdSetRenderingInputAttachmentIndices(VkCommandBuffer commandBuffer, const VkRenderingInputAttachmentIndexInfo *pInputAttachmentIndexInfo) -{ - struct vkCmdSetRenderingInputAttachmentIndices_params params; - params.commandBuffer = commandBuffer; - params.pInputAttachmentIndexInfo = pInputAttachmentIndexInfo; - UNIX_CALL(vkCmdSetRenderingInputAttachmentIndices, ¶ms); -} - -void WINAPI vkCmdSetRenderingInputAttachmentIndicesKHR(VkCommandBuffer commandBuffer, const VkRenderingInputAttachmentIndexInfo *pInputAttachmentIndexInfo) -{ - struct vkCmdSetRenderingInputAttachmentIndicesKHR_params params; - params.commandBuffer = commandBuffer; - params.pInputAttachmentIndexInfo = pInputAttachmentIndexInfo; - UNIX_CALL(vkCmdSetRenderingInputAttachmentIndicesKHR, ¶ms); -} - -void WINAPI vkCmdSetRepresentativeFragmentTestEnableNV(VkCommandBuffer commandBuffer, VkBool32 representativeFragmentTestEnable) -{ - struct vkCmdSetRepresentativeFragmentTestEnableNV_params params; - params.commandBuffer = commandBuffer; - params.representativeFragmentTestEnable = representativeFragmentTestEnable; - UNIX_CALL(vkCmdSetRepresentativeFragmentTestEnableNV, ¶ms); -} - -void WINAPI vkCmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT *pSampleLocationsInfo) -{ - struct vkCmdSetSampleLocationsEXT_params params; - params.commandBuffer = commandBuffer; - params.pSampleLocationsInfo = pSampleLocationsInfo; - UNIX_CALL(vkCmdSetSampleLocationsEXT, ¶ms); -} - -void WINAPI vkCmdSetSampleLocationsEnableEXT(VkCommandBuffer commandBuffer, VkBool32 sampleLocationsEnable) -{ - struct vkCmdSetSampleLocationsEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.sampleLocationsEnable = sampleLocationsEnable; - UNIX_CALL(vkCmdSetSampleLocationsEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetSampleMaskEXT(VkCommandBuffer commandBuffer, VkSampleCountFlagBits samples, const VkSampleMask *pSampleMask) -{ - struct vkCmdSetSampleMaskEXT_params params; - params.commandBuffer = commandBuffer; - params.samples = samples; - params.pSampleMask = pSampleMask; - UNIX_CALL(vkCmdSetSampleMaskEXT, ¶ms); -} - -void WINAPI vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D *pScissors) -{ - struct vkCmdSetScissor_params params; - params.commandBuffer = commandBuffer; - params.firstScissor = firstScissor; - params.scissorCount = scissorCount; - params.pScissors = pScissors; - UNIX_CALL(vkCmdSetScissor, ¶ms); -} - -void WINAPI vkCmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D *pScissors) -{ - struct vkCmdSetScissorWithCount_params params; - params.commandBuffer = commandBuffer; - params.scissorCount = scissorCount; - params.pScissors = pScissors; - UNIX_CALL(vkCmdSetScissorWithCount, ¶ms); -} - -void WINAPI vkCmdSetScissorWithCountEXT(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D *pScissors) -{ - struct vkCmdSetScissorWithCountEXT_params params; - params.commandBuffer = commandBuffer; - params.scissorCount = scissorCount; - params.pScissors = pScissors; - UNIX_CALL(vkCmdSetScissorWithCountEXT, ¶ms); -} - -void WINAPI vkCmdSetShadingRateImageEnableNV(VkCommandBuffer commandBuffer, VkBool32 shadingRateImageEnable) -{ - struct vkCmdSetShadingRateImageEnableNV_params params; - params.commandBuffer = commandBuffer; - params.shadingRateImageEnable = shadingRateImageEnable; - UNIX_CALL(vkCmdSetShadingRateImageEnableNV, ¶ms); -} - -void WINAPI vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask) -{ - struct vkCmdSetStencilCompareMask_params params; - params.commandBuffer = commandBuffer; - params.faceMask = faceMask; - params.compareMask = compareMask; - UNIX_CALL(vkCmdSetStencilCompareMask, ¶ms); -} - -void WINAPI vkCmdSetStencilOp(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp) -{ - struct vkCmdSetStencilOp_params params; - params.commandBuffer = commandBuffer; - params.faceMask = faceMask; - params.failOp = failOp; - params.passOp = passOp; - params.depthFailOp = depthFailOp; - params.compareOp = compareOp; - UNIX_CALL(vkCmdSetStencilOp, ¶ms); -} - -void WINAPI vkCmdSetStencilOpEXT(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp) -{ - struct vkCmdSetStencilOpEXT_params params; - params.commandBuffer = commandBuffer; - params.faceMask = faceMask; - params.failOp = failOp; - params.passOp = passOp; - params.depthFailOp = depthFailOp; - params.compareOp = compareOp; - UNIX_CALL(vkCmdSetStencilOpEXT, ¶ms); -} - -void WINAPI vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference) -{ - struct vkCmdSetStencilReference_params params; - params.commandBuffer = commandBuffer; - params.faceMask = faceMask; - params.reference = reference; - UNIX_CALL(vkCmdSetStencilReference, ¶ms); -} - -void WINAPI vkCmdSetStencilTestEnable(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable) -{ - struct vkCmdSetStencilTestEnable_params params; - params.commandBuffer = commandBuffer; - params.stencilTestEnable = stencilTestEnable; - UNIX_CALL(vkCmdSetStencilTestEnable, ¶ms); -} - -void WINAPI vkCmdSetStencilTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable) -{ - struct vkCmdSetStencilTestEnableEXT_params params; - params.commandBuffer = commandBuffer; - params.stencilTestEnable = stencilTestEnable; - UNIX_CALL(vkCmdSetStencilTestEnableEXT, ¶ms); -} - -void WINAPI vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask) -{ - struct vkCmdSetStencilWriteMask_params params; - params.commandBuffer = commandBuffer; - params.faceMask = faceMask; - params.writeMask = writeMask; - UNIX_CALL(vkCmdSetStencilWriteMask, ¶ms); -} - -void WINAPI vkCmdSetTessellationDomainOriginEXT(VkCommandBuffer commandBuffer, VkTessellationDomainOrigin domainOrigin) -{ - struct vkCmdSetTessellationDomainOriginEXT_params params; - params.commandBuffer = commandBuffer; - params.domainOrigin = domainOrigin; - UNIX_CALL(vkCmdSetTessellationDomainOriginEXT, ¶ms); -} - -void WINAPI vkCmdSetVertexInputEXT(VkCommandBuffer commandBuffer, uint32_t vertexBindingDescriptionCount, const VkVertexInputBindingDescription2EXT *pVertexBindingDescriptions, uint32_t vertexAttributeDescriptionCount, const VkVertexInputAttributeDescription2EXT *pVertexAttributeDescriptions) -{ - struct vkCmdSetVertexInputEXT_params params; - params.commandBuffer = commandBuffer; - params.vertexBindingDescriptionCount = vertexBindingDescriptionCount; - params.pVertexBindingDescriptions = pVertexBindingDescriptions; - params.vertexAttributeDescriptionCount = vertexAttributeDescriptionCount; - params.pVertexAttributeDescriptions = pVertexAttributeDescriptions; - UNIX_CALL(vkCmdSetVertexInputEXT, ¶ms); -} - -void WINAPI vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport *pViewports) -{ - struct vkCmdSetViewport_params params; - params.commandBuffer = commandBuffer; - params.firstViewport = firstViewport; - params.viewportCount = viewportCount; - params.pViewports = pViewports; - UNIX_CALL(vkCmdSetViewport, ¶ms); -} - -void WINAPI vkCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkShadingRatePaletteNV *pShadingRatePalettes) -{ - struct vkCmdSetViewportShadingRatePaletteNV_params params; - params.commandBuffer = commandBuffer; - params.firstViewport = firstViewport; - params.viewportCount = viewportCount; - params.pShadingRatePalettes = pShadingRatePalettes; - UNIX_CALL(vkCmdSetViewportShadingRatePaletteNV, ¶ms); -} - -void WINAPI vkCmdSetViewportSwizzleNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportSwizzleNV *pViewportSwizzles) -{ - struct vkCmdSetViewportSwizzleNV_params params; - params.commandBuffer = commandBuffer; - params.firstViewport = firstViewport; - params.viewportCount = viewportCount; - params.pViewportSwizzles = pViewportSwizzles; - UNIX_CALL(vkCmdSetViewportSwizzleNV, ¶ms); -} - -void WINAPI vkCmdSetViewportWScalingEnableNV(VkCommandBuffer commandBuffer, VkBool32 viewportWScalingEnable) -{ - struct vkCmdSetViewportWScalingEnableNV_params params; - params.commandBuffer = commandBuffer; - params.viewportWScalingEnable = viewportWScalingEnable; - UNIX_CALL(vkCmdSetViewportWScalingEnableNV, ¶ms); -} - -void WINAPI vkCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV *pViewportWScalings) -{ - struct vkCmdSetViewportWScalingNV_params params; - params.commandBuffer = commandBuffer; - params.firstViewport = firstViewport; - params.viewportCount = viewportCount; - params.pViewportWScalings = pViewportWScalings; - UNIX_CALL(vkCmdSetViewportWScalingNV, ¶ms); -} - -void WINAPI vkCmdSetViewportWithCount(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport *pViewports) -{ - struct vkCmdSetViewportWithCount_params params; - params.commandBuffer = commandBuffer; - params.viewportCount = viewportCount; - params.pViewports = pViewports; - UNIX_CALL(vkCmdSetViewportWithCount, ¶ms); -} - -void WINAPI vkCmdSetViewportWithCountEXT(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport *pViewports) -{ - struct vkCmdSetViewportWithCountEXT_params params; - params.commandBuffer = commandBuffer; - params.viewportCount = viewportCount; - params.pViewports = pViewports; - UNIX_CALL(vkCmdSetViewportWithCountEXT, ¶ms); -} - -void WINAPI vkCmdSubpassShadingHUAWEI(VkCommandBuffer commandBuffer) -{ - struct vkCmdSubpassShadingHUAWEI_params params; - params.commandBuffer = commandBuffer; - UNIX_CALL(vkCmdSubpassShadingHUAWEI, ¶ms); -} - -void WINAPI vkCmdTraceRaysIndirect2KHR(VkCommandBuffer commandBuffer, VkDeviceAddress indirectDeviceAddress) -{ - struct vkCmdTraceRaysIndirect2KHR_params params; - params.commandBuffer = commandBuffer; - params.indirectDeviceAddress = indirectDeviceAddress; - UNIX_CALL(vkCmdTraceRaysIndirect2KHR, ¶ms); -} - -void WINAPI vkCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable, VkDeviceAddress indirectDeviceAddress) -{ - struct vkCmdTraceRaysIndirectKHR_params params; - params.commandBuffer = commandBuffer; - params.pRaygenShaderBindingTable = pRaygenShaderBindingTable; - params.pMissShaderBindingTable = pMissShaderBindingTable; - params.pHitShaderBindingTable = pHitShaderBindingTable; - params.pCallableShaderBindingTable = pCallableShaderBindingTable; - params.indirectDeviceAddress = indirectDeviceAddress; - UNIX_CALL(vkCmdTraceRaysIndirectKHR, ¶ms); -} - -void WINAPI vkCmdTraceRaysKHR(VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable, uint32_t width, uint32_t height, uint32_t depth) -{ - struct vkCmdTraceRaysKHR_params params; - params.commandBuffer = commandBuffer; - params.pRaygenShaderBindingTable = pRaygenShaderBindingTable; - params.pMissShaderBindingTable = pMissShaderBindingTable; - params.pHitShaderBindingTable = pHitShaderBindingTable; - params.pCallableShaderBindingTable = pCallableShaderBindingTable; - params.width = width; - params.height = height; - params.depth = depth; - UNIX_CALL(vkCmdTraceRaysKHR, ¶ms); -} - -void WINAPI vkCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, uint32_t width, uint32_t height, uint32_t depth) -{ - struct vkCmdTraceRaysNV_params params; - params.commandBuffer = commandBuffer; - params.raygenShaderBindingTableBuffer = raygenShaderBindingTableBuffer; - params.raygenShaderBindingOffset = raygenShaderBindingOffset; - params.missShaderBindingTableBuffer = missShaderBindingTableBuffer; - params.missShaderBindingOffset = missShaderBindingOffset; - params.missShaderBindingStride = missShaderBindingStride; - params.hitShaderBindingTableBuffer = hitShaderBindingTableBuffer; - params.hitShaderBindingOffset = hitShaderBindingOffset; - params.hitShaderBindingStride = hitShaderBindingStride; - params.callableShaderBindingTableBuffer = callableShaderBindingTableBuffer; - params.callableShaderBindingOffset = callableShaderBindingOffset; - params.callableShaderBindingStride = callableShaderBindingStride; - params.width = width; - params.height = height; - params.depth = depth; - UNIX_CALL(vkCmdTraceRaysNV, ¶ms); -} - -void WINAPI vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void *pData) -{ - struct vkCmdUpdateBuffer_params params; - params.commandBuffer = commandBuffer; - params.dstBuffer = dstBuffer; - params.dstOffset = dstOffset; - params.dataSize = dataSize; - params.pData = pData; - UNIX_CALL(vkCmdUpdateBuffer, ¶ms); -} - -void WINAPI vkCmdUpdatePipelineIndirectBufferNV(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) -{ - struct vkCmdUpdatePipelineIndirectBufferNV_params params; - params.commandBuffer = commandBuffer; - params.pipelineBindPoint = pipelineBindPoint; - params.pipeline = pipeline; - UNIX_CALL(vkCmdUpdatePipelineIndirectBufferNV, ¶ms); -} - -void WINAPI vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers) -{ - struct vkCmdWaitEvents_params params; - params.commandBuffer = commandBuffer; - params.eventCount = eventCount; - params.pEvents = pEvents; - params.srcStageMask = srcStageMask; - params.dstStageMask = dstStageMask; - params.memoryBarrierCount = memoryBarrierCount; - params.pMemoryBarriers = pMemoryBarriers; - params.bufferMemoryBarrierCount = bufferMemoryBarrierCount; - params.pBufferMemoryBarriers = pBufferMemoryBarriers; - params.imageMemoryBarrierCount = imageMemoryBarrierCount; - params.pImageMemoryBarriers = pImageMemoryBarriers; - UNIX_CALL(vkCmdWaitEvents, ¶ms); -} - -void WINAPI vkCmdWaitEvents2(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, const VkDependencyInfo *pDependencyInfos) -{ - struct vkCmdWaitEvents2_params params; - params.commandBuffer = commandBuffer; - params.eventCount = eventCount; - params.pEvents = pEvents; - params.pDependencyInfos = pDependencyInfos; - UNIX_CALL(vkCmdWaitEvents2, ¶ms); -} - -void WINAPI vkCmdWaitEvents2KHR(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, const VkDependencyInfo *pDependencyInfos) -{ - struct vkCmdWaitEvents2KHR_params params; - params.commandBuffer = commandBuffer; - params.eventCount = eventCount; - params.pEvents = pEvents; - params.pDependencyInfos = pDependencyInfos; - UNIX_CALL(vkCmdWaitEvents2KHR, ¶ms); -} - -void WINAPI vkCmdWriteAccelerationStructuresPropertiesKHR(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR *pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery) -{ - struct vkCmdWriteAccelerationStructuresPropertiesKHR_params params; - params.commandBuffer = commandBuffer; - params.accelerationStructureCount = accelerationStructureCount; - params.pAccelerationStructures = pAccelerationStructures; - params.queryType = queryType; - params.queryPool = queryPool; - params.firstQuery = firstQuery; - UNIX_CALL(vkCmdWriteAccelerationStructuresPropertiesKHR, ¶ms); -} - -void WINAPI vkCmdWriteAccelerationStructuresPropertiesNV(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureNV *pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery) -{ - struct vkCmdWriteAccelerationStructuresPropertiesNV_params params; - params.commandBuffer = commandBuffer; - params.accelerationStructureCount = accelerationStructureCount; - params.pAccelerationStructures = pAccelerationStructures; - params.queryType = queryType; - params.queryPool = queryPool; - params.firstQuery = firstQuery; - UNIX_CALL(vkCmdWriteAccelerationStructuresPropertiesNV, ¶ms); -} - -void WINAPI vkCmdWriteBufferMarker2AMD(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker) -{ - struct vkCmdWriteBufferMarker2AMD_params params; - params.commandBuffer = commandBuffer; - params.stage = stage; - params.dstBuffer = dstBuffer; - params.dstOffset = dstOffset; - params.marker = marker; - UNIX_CALL(vkCmdWriteBufferMarker2AMD, ¶ms); -} - -void WINAPI vkCmdWriteBufferMarkerAMD(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker) -{ - struct vkCmdWriteBufferMarkerAMD_params params; - params.commandBuffer = commandBuffer; - params.pipelineStage = pipelineStage; - params.dstBuffer = dstBuffer; - params.dstOffset = dstOffset; - params.marker = marker; - UNIX_CALL(vkCmdWriteBufferMarkerAMD, ¶ms); -} - -void WINAPI vkCmdWriteMicromapsPropertiesEXT(VkCommandBuffer commandBuffer, uint32_t micromapCount, const VkMicromapEXT *pMicromaps, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery) -{ - struct vkCmdWriteMicromapsPropertiesEXT_params params; - params.commandBuffer = commandBuffer; - params.micromapCount = micromapCount; - params.pMicromaps = pMicromaps; - params.queryType = queryType; - params.queryPool = queryPool; - params.firstQuery = firstQuery; - UNIX_CALL(vkCmdWriteMicromapsPropertiesEXT, ¶ms); -} - -void WINAPI vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query) -{ - struct vkCmdWriteTimestamp_params params; - params.commandBuffer = commandBuffer; - params.pipelineStage = pipelineStage; - params.queryPool = queryPool; - params.query = query; - UNIX_CALL(vkCmdWriteTimestamp, ¶ms); -} - -void WINAPI vkCmdWriteTimestamp2(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkQueryPool queryPool, uint32_t query) -{ - struct vkCmdWriteTimestamp2_params params; - params.commandBuffer = commandBuffer; - params.stage = stage; - params.queryPool = queryPool; - params.query = query; - UNIX_CALL(vkCmdWriteTimestamp2, ¶ms); -} - -void WINAPI vkCmdWriteTimestamp2KHR(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkQueryPool queryPool, uint32_t query) -{ - struct vkCmdWriteTimestamp2KHR_params params; - params.commandBuffer = commandBuffer; - params.stage = stage; - params.queryPool = queryPool; - params.query = query; - UNIX_CALL(vkCmdWriteTimestamp2KHR, ¶ms); -} - -VkResult WINAPI vkCompileDeferredNV(VkDevice device, VkPipeline pipeline, uint32_t shader) -{ - struct vkCompileDeferredNV_params params; - NTSTATUS status; - params.device = device; - params.pipeline = pipeline; - params.shader = shader; - status = UNIX_CALL(vkCompileDeferredNV, ¶ms); - assert(!status && "vkCompileDeferredNV"); - return params.result; -} - -VkResult WINAPI vkCopyAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureInfoKHR *pInfo) -{ - struct vkCopyAccelerationStructureKHR_params params; - NTSTATUS status; - params.device = device; - params.deferredOperation = deferredOperation; - params.pInfo = pInfo; - status = UNIX_CALL(vkCopyAccelerationStructureKHR, ¶ms); - assert(!status && "vkCopyAccelerationStructureKHR"); - return params.result; -} - -VkResult WINAPI vkCopyAccelerationStructureToMemoryKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo) -{ - struct vkCopyAccelerationStructureToMemoryKHR_params params; - NTSTATUS status; - params.device = device; - params.deferredOperation = deferredOperation; - params.pInfo = pInfo; - status = UNIX_CALL(vkCopyAccelerationStructureToMemoryKHR, ¶ms); - assert(!status && "vkCopyAccelerationStructureToMemoryKHR"); - return params.result; -} - -VkResult WINAPI vkCopyImageToImage(VkDevice device, const VkCopyImageToImageInfo *pCopyImageToImageInfo) -{ - struct vkCopyImageToImage_params params; - NTSTATUS status; - params.device = device; - params.pCopyImageToImageInfo = pCopyImageToImageInfo; - status = UNIX_CALL(vkCopyImageToImage, ¶ms); - assert(!status && "vkCopyImageToImage"); - return params.result; -} - -VkResult WINAPI vkCopyImageToImageEXT(VkDevice device, const VkCopyImageToImageInfo *pCopyImageToImageInfo) -{ - struct vkCopyImageToImageEXT_params params; - NTSTATUS status; - params.device = device; - params.pCopyImageToImageInfo = pCopyImageToImageInfo; - status = UNIX_CALL(vkCopyImageToImageEXT, ¶ms); - assert(!status && "vkCopyImageToImageEXT"); - return params.result; -} - -VkResult WINAPI vkCopyImageToMemory(VkDevice device, const VkCopyImageToMemoryInfo *pCopyImageToMemoryInfo) -{ - struct vkCopyImageToMemory_params params; - NTSTATUS status; - params.device = device; - params.pCopyImageToMemoryInfo = pCopyImageToMemoryInfo; - status = UNIX_CALL(vkCopyImageToMemory, ¶ms); - assert(!status && "vkCopyImageToMemory"); - return params.result; -} - -VkResult WINAPI vkCopyImageToMemoryEXT(VkDevice device, const VkCopyImageToMemoryInfo *pCopyImageToMemoryInfo) -{ - struct vkCopyImageToMemoryEXT_params params; - NTSTATUS status; - params.device = device; - params.pCopyImageToMemoryInfo = pCopyImageToMemoryInfo; - status = UNIX_CALL(vkCopyImageToMemoryEXT, ¶ms); - assert(!status && "vkCopyImageToMemoryEXT"); - return params.result; -} - -VkResult WINAPI vkCopyMemoryToAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo) -{ - struct vkCopyMemoryToAccelerationStructureKHR_params params; - NTSTATUS status; - params.device = device; - params.deferredOperation = deferredOperation; - params.pInfo = pInfo; - status = UNIX_CALL(vkCopyMemoryToAccelerationStructureKHR, ¶ms); - assert(!status && "vkCopyMemoryToAccelerationStructureKHR"); - return params.result; -} - -VkResult WINAPI vkCopyMemoryToImage(VkDevice device, const VkCopyMemoryToImageInfo *pCopyMemoryToImageInfo) -{ - struct vkCopyMemoryToImage_params params; - NTSTATUS status; - params.device = device; - params.pCopyMemoryToImageInfo = pCopyMemoryToImageInfo; - status = UNIX_CALL(vkCopyMemoryToImage, ¶ms); - assert(!status && "vkCopyMemoryToImage"); - return params.result; -} - -VkResult WINAPI vkCopyMemoryToImageEXT(VkDevice device, const VkCopyMemoryToImageInfo *pCopyMemoryToImageInfo) -{ - struct vkCopyMemoryToImageEXT_params params; - NTSTATUS status; - params.device = device; - params.pCopyMemoryToImageInfo = pCopyMemoryToImageInfo; - status = UNIX_CALL(vkCopyMemoryToImageEXT, ¶ms); - assert(!status && "vkCopyMemoryToImageEXT"); - return params.result; -} - -VkResult WINAPI vkCopyMemoryToMicromapEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToMicromapInfoEXT *pInfo) -{ - struct vkCopyMemoryToMicromapEXT_params params; - NTSTATUS status; - params.device = device; - params.deferredOperation = deferredOperation; - params.pInfo = pInfo; - status = UNIX_CALL(vkCopyMemoryToMicromapEXT, ¶ms); - assert(!status && "vkCopyMemoryToMicromapEXT"); - return params.result; -} - -VkResult WINAPI vkCopyMicromapEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMicromapInfoEXT *pInfo) -{ - struct vkCopyMicromapEXT_params params; - NTSTATUS status; - params.device = device; - params.deferredOperation = deferredOperation; - params.pInfo = pInfo; - status = UNIX_CALL(vkCopyMicromapEXT, ¶ms); - assert(!status && "vkCopyMicromapEXT"); - return params.result; -} - -VkResult WINAPI vkCopyMicromapToMemoryEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMicromapToMemoryInfoEXT *pInfo) -{ - struct vkCopyMicromapToMemoryEXT_params params; - NTSTATUS status; - params.device = device; - params.deferredOperation = deferredOperation; - params.pInfo = pInfo; - status = UNIX_CALL(vkCopyMicromapToMemoryEXT, ¶ms); - assert(!status && "vkCopyMicromapToMemoryEXT"); - return params.result; -} - -VkResult WINAPI vkCreateAccelerationStructureKHR(VkDevice device, const VkAccelerationStructureCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkAccelerationStructureKHR *pAccelerationStructure) -{ - struct vkCreateAccelerationStructureKHR_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pAccelerationStructure = pAccelerationStructure; - status = UNIX_CALL(vkCreateAccelerationStructureKHR, ¶ms); - assert(!status && "vkCreateAccelerationStructureKHR"); - return params.result; -} - -VkResult WINAPI vkCreateAccelerationStructureNV(VkDevice device, const VkAccelerationStructureCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkAccelerationStructureNV *pAccelerationStructure) -{ - struct vkCreateAccelerationStructureNV_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pAccelerationStructure = pAccelerationStructure; - status = UNIX_CALL(vkCreateAccelerationStructureNV, ¶ms); - assert(!status && "vkCreateAccelerationStructureNV"); - return params.result; -} - -VkResult WINAPI vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer) -{ - struct vkCreateBuffer_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pBuffer = pBuffer; - status = UNIX_CALL(vkCreateBuffer, ¶ms); - assert(!status && "vkCreateBuffer"); - return params.result; -} - -VkResult WINAPI vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBufferView *pView) -{ - struct vkCreateBufferView_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pView = pView; - status = UNIX_CALL(vkCreateBufferView, ¶ms); - assert(!status && "vkCreateBufferView"); - return params.result; -} - -VkResult WINAPI vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) -{ - struct vkCreateComputePipelines_params params; - NTSTATUS status; - params.device = device; - params.pipelineCache = pipelineCache; - params.createInfoCount = createInfoCount; - params.pCreateInfos = pCreateInfos; - params.pAllocator = pAllocator; - params.pPipelines = pPipelines; - status = UNIX_CALL(vkCreateComputePipelines, ¶ms); - assert(!status && "vkCreateComputePipelines"); - return params.result; -} - -VkResult WINAPI vkCreateCuFunctionNVX(VkDevice device, const VkCuFunctionCreateInfoNVX *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCuFunctionNVX *pFunction) -{ - struct vkCreateCuFunctionNVX_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pFunction = pFunction; - status = UNIX_CALL(vkCreateCuFunctionNVX, ¶ms); - assert(!status && "vkCreateCuFunctionNVX"); - return params.result; -} - -VkResult WINAPI vkCreateCuModuleNVX(VkDevice device, const VkCuModuleCreateInfoNVX *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCuModuleNVX *pModule) -{ - struct vkCreateCuModuleNVX_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pModule = pModule; - status = UNIX_CALL(vkCreateCuModuleNVX, ¶ms); - assert(!status && "vkCreateCuModuleNVX"); - return params.result; -} - -VkResult WINAPI vkCreateCudaFunctionNV(VkDevice device, const VkCudaFunctionCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCudaFunctionNV *pFunction) -{ - struct vkCreateCudaFunctionNV_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pFunction = pFunction; - status = UNIX_CALL(vkCreateCudaFunctionNV, ¶ms); - assert(!status && "vkCreateCudaFunctionNV"); - return params.result; -} - -VkResult WINAPI vkCreateCudaModuleNV(VkDevice device, const VkCudaModuleCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCudaModuleNV *pModule) -{ - struct vkCreateCudaModuleNV_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pModule = pModule; - status = UNIX_CALL(vkCreateCudaModuleNV, ¶ms); - assert(!status && "vkCreateCudaModuleNV"); - return params.result; -} - -VkResult WINAPI vkCreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT *pCallback) -{ - struct vkCreateDebugReportCallbackEXT_params params; - NTSTATUS status; - params.instance = instance; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pCallback = pCallback; - status = UNIX_CALL(vkCreateDebugReportCallbackEXT, ¶ms); - assert(!status && "vkCreateDebugReportCallbackEXT"); - return params.result; -} - -VkResult WINAPI vkCreateDebugUtilsMessengerEXT(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerEXT *pMessenger) -{ - struct vkCreateDebugUtilsMessengerEXT_params params; - NTSTATUS status; - params.instance = instance; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pMessenger = pMessenger; - status = UNIX_CALL(vkCreateDebugUtilsMessengerEXT, ¶ms); - assert(!status && "vkCreateDebugUtilsMessengerEXT"); - return params.result; -} - -VkResult WINAPI vkCreateDeferredOperationKHR(VkDevice device, const VkAllocationCallbacks *pAllocator, VkDeferredOperationKHR *pDeferredOperation) -{ - struct vkCreateDeferredOperationKHR_params params; - NTSTATUS status; - params.device = device; - params.pAllocator = pAllocator; - params.pDeferredOperation = pDeferredOperation; - status = UNIX_CALL(vkCreateDeferredOperationKHR, ¶ms); - assert(!status && "vkCreateDeferredOperationKHR"); - return params.result; -} - -VkResult WINAPI vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorPool *pDescriptorPool) -{ - struct vkCreateDescriptorPool_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pDescriptorPool = pDescriptorPool; - status = UNIX_CALL(vkCreateDescriptorPool, ¶ms); - assert(!status && "vkCreateDescriptorPool"); - return params.result; -} - -VkResult WINAPI vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorSetLayout *pSetLayout) -{ - struct vkCreateDescriptorSetLayout_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pSetLayout = pSetLayout; - status = UNIX_CALL(vkCreateDescriptorSetLayout, ¶ms); - assert(!status && "vkCreateDescriptorSetLayout"); - return params.result; -} - -VkResult WINAPI vkCreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorUpdateTemplate *pDescriptorUpdateTemplate) -{ - struct vkCreateDescriptorUpdateTemplate_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pDescriptorUpdateTemplate = pDescriptorUpdateTemplate; - status = UNIX_CALL(vkCreateDescriptorUpdateTemplate, ¶ms); - assert(!status && "vkCreateDescriptorUpdateTemplate"); - return params.result; -} - -VkResult WINAPI vkCreateDescriptorUpdateTemplateKHR(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorUpdateTemplate *pDescriptorUpdateTemplate) -{ - struct vkCreateDescriptorUpdateTemplateKHR_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pDescriptorUpdateTemplate = pDescriptorUpdateTemplate; - status = UNIX_CALL(vkCreateDescriptorUpdateTemplateKHR, ¶ms); - assert(!status && "vkCreateDescriptorUpdateTemplateKHR"); - return params.result; -} - -VkResult WINAPI vkCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkEvent *pEvent) -{ - struct vkCreateEvent_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pEvent = pEvent; - status = UNIX_CALL(vkCreateEvent, ¶ms); - assert(!status && "vkCreateEvent"); - return params.result; -} - -VkResult WINAPI vkCreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFence *pFence) -{ - struct vkCreateFence_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pFence = pFence; - status = UNIX_CALL(vkCreateFence, ¶ms); - assert(!status && "vkCreateFence"); - return params.result; -} - -VkResult WINAPI vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFramebuffer *pFramebuffer) -{ - struct vkCreateFramebuffer_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pFramebuffer = pFramebuffer; - status = UNIX_CALL(vkCreateFramebuffer, ¶ms); - assert(!status && "vkCreateFramebuffer"); - return params.result; -} - -VkResult WINAPI vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) -{ - struct vkCreateGraphicsPipelines_params params; - NTSTATUS status; - params.device = device; - params.pipelineCache = pipelineCache; - params.createInfoCount = createInfoCount; - params.pCreateInfos = pCreateInfos; - params.pAllocator = pAllocator; - params.pPipelines = pPipelines; - status = UNIX_CALL(vkCreateGraphicsPipelines, ¶ms); - assert(!status && "vkCreateGraphicsPipelines"); - return params.result; -} - -VkResult WINAPI vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImage *pImage) -{ - struct vkCreateImage_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pImage = pImage; - status = UNIX_CALL(vkCreateImage, ¶ms); - assert(!status && "vkCreateImage"); - return params.result; -} - -VkResult WINAPI vkCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImageView *pView) -{ - struct vkCreateImageView_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pView = pView; - status = UNIX_CALL(vkCreateImageView, ¶ms); - assert(!status && "vkCreateImageView"); - return params.result; -} - -VkResult WINAPI vkCreateIndirectCommandsLayoutEXT(VkDevice device, const VkIndirectCommandsLayoutCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkIndirectCommandsLayoutEXT *pIndirectCommandsLayout) -{ - struct vkCreateIndirectCommandsLayoutEXT_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pIndirectCommandsLayout = pIndirectCommandsLayout; - status = UNIX_CALL(vkCreateIndirectCommandsLayoutEXT, ¶ms); - assert(!status && "vkCreateIndirectCommandsLayoutEXT"); - return params.result; -} - -VkResult WINAPI vkCreateIndirectCommandsLayoutNV(VkDevice device, const VkIndirectCommandsLayoutCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkIndirectCommandsLayoutNV *pIndirectCommandsLayout) -{ - struct vkCreateIndirectCommandsLayoutNV_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pIndirectCommandsLayout = pIndirectCommandsLayout; - status = UNIX_CALL(vkCreateIndirectCommandsLayoutNV, ¶ms); - assert(!status && "vkCreateIndirectCommandsLayoutNV"); - return params.result; -} - -VkResult WINAPI vkCreateIndirectExecutionSetEXT(VkDevice device, const VkIndirectExecutionSetCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkIndirectExecutionSetEXT *pIndirectExecutionSet) -{ - struct vkCreateIndirectExecutionSetEXT_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pIndirectExecutionSet = pIndirectExecutionSet; - status = UNIX_CALL(vkCreateIndirectExecutionSetEXT, ¶ms); - assert(!status && "vkCreateIndirectExecutionSetEXT"); - return params.result; -} - -VkResult WINAPI vkCreateMicromapEXT(VkDevice device, const VkMicromapCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkMicromapEXT *pMicromap) -{ - struct vkCreateMicromapEXT_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pMicromap = pMicromap; - status = UNIX_CALL(vkCreateMicromapEXT, ¶ms); - assert(!status && "vkCreateMicromapEXT"); - return params.result; -} - -VkResult WINAPI vkCreateOpticalFlowSessionNV(VkDevice device, const VkOpticalFlowSessionCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkOpticalFlowSessionNV *pSession) -{ - struct vkCreateOpticalFlowSessionNV_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pSession = pSession; - status = UNIX_CALL(vkCreateOpticalFlowSessionNV, ¶ms); - assert(!status && "vkCreateOpticalFlowSessionNV"); - return params.result; -} - -VkResult WINAPI vkCreatePipelineBinariesKHR(VkDevice device, const VkPipelineBinaryCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineBinaryHandlesInfoKHR *pBinaries) -{ - struct vkCreatePipelineBinariesKHR_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pBinaries = pBinaries; - status = UNIX_CALL(vkCreatePipelineBinariesKHR, ¶ms); - assert(!status && "vkCreatePipelineBinariesKHR"); - return params.result; -} - -VkResult WINAPI vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineCache *pPipelineCache) -{ - struct vkCreatePipelineCache_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pPipelineCache = pPipelineCache; - status = UNIX_CALL(vkCreatePipelineCache, ¶ms); - assert(!status && "vkCreatePipelineCache"); - return params.result; -} - -VkResult WINAPI vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineLayout *pPipelineLayout) -{ - struct vkCreatePipelineLayout_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pPipelineLayout = pPipelineLayout; - status = UNIX_CALL(vkCreatePipelineLayout, ¶ms); - assert(!status && "vkCreatePipelineLayout"); - return params.result; -} - -VkResult WINAPI vkCreatePrivateDataSlot(VkDevice device, const VkPrivateDataSlotCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPrivateDataSlot *pPrivateDataSlot) -{ - struct vkCreatePrivateDataSlot_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pPrivateDataSlot = pPrivateDataSlot; - status = UNIX_CALL(vkCreatePrivateDataSlot, ¶ms); - assert(!status && "vkCreatePrivateDataSlot"); - return params.result; -} - -VkResult WINAPI vkCreatePrivateDataSlotEXT(VkDevice device, const VkPrivateDataSlotCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPrivateDataSlot *pPrivateDataSlot) -{ - struct vkCreatePrivateDataSlotEXT_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pPrivateDataSlot = pPrivateDataSlot; - status = UNIX_CALL(vkCreatePrivateDataSlotEXT, ¶ms); - assert(!status && "vkCreatePrivateDataSlotEXT"); - return params.result; -} - -VkResult WINAPI vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkQueryPool *pQueryPool) -{ - struct vkCreateQueryPool_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pQueryPool = pQueryPool; - status = UNIX_CALL(vkCreateQueryPool, ¶ms); - assert(!status && "vkCreateQueryPool"); - return params.result; -} - -VkResult WINAPI vkCreateRayTracingPipelinesKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) -{ - struct vkCreateRayTracingPipelinesKHR_params params; - NTSTATUS status; - params.device = device; - params.deferredOperation = deferredOperation; - params.pipelineCache = pipelineCache; - params.createInfoCount = createInfoCount; - params.pCreateInfos = pCreateInfos; - params.pAllocator = pAllocator; - params.pPipelines = pPipelines; - status = UNIX_CALL(vkCreateRayTracingPipelinesKHR, ¶ms); - assert(!status && "vkCreateRayTracingPipelinesKHR"); - return params.result; -} - -VkResult WINAPI vkCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) -{ - struct vkCreateRayTracingPipelinesNV_params params; - NTSTATUS status; - params.device = device; - params.pipelineCache = pipelineCache; - params.createInfoCount = createInfoCount; - params.pCreateInfos = pCreateInfos; - params.pAllocator = pAllocator; - params.pPipelines = pPipelines; - status = UNIX_CALL(vkCreateRayTracingPipelinesNV, ¶ms); - assert(!status && "vkCreateRayTracingPipelinesNV"); - return params.result; -} - -VkResult WINAPI vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass) -{ - struct vkCreateRenderPass_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pRenderPass = pRenderPass; - status = UNIX_CALL(vkCreateRenderPass, ¶ms); - assert(!status && "vkCreateRenderPass"); - return params.result; -} - -VkResult WINAPI vkCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2 *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass) -{ - struct vkCreateRenderPass2_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pRenderPass = pRenderPass; - status = UNIX_CALL(vkCreateRenderPass2, ¶ms); - assert(!status && "vkCreateRenderPass2"); - return params.result; -} - -VkResult WINAPI vkCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2 *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass) -{ - struct vkCreateRenderPass2KHR_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pRenderPass = pRenderPass; - status = UNIX_CALL(vkCreateRenderPass2KHR, ¶ms); - assert(!status && "vkCreateRenderPass2KHR"); - return params.result; -} - -VkResult WINAPI vkCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSampler *pSampler) -{ - struct vkCreateSampler_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pSampler = pSampler; - status = UNIX_CALL(vkCreateSampler, ¶ms); - assert(!status && "vkCreateSampler"); - return params.result; -} - -VkResult WINAPI vkCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSamplerYcbcrConversion *pYcbcrConversion) -{ - struct vkCreateSamplerYcbcrConversion_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pYcbcrConversion = pYcbcrConversion; - status = UNIX_CALL(vkCreateSamplerYcbcrConversion, ¶ms); - assert(!status && "vkCreateSamplerYcbcrConversion"); - return params.result; -} - -VkResult WINAPI vkCreateSamplerYcbcrConversionKHR(VkDevice device, const VkSamplerYcbcrConversionCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSamplerYcbcrConversion *pYcbcrConversion) -{ - struct vkCreateSamplerYcbcrConversionKHR_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pYcbcrConversion = pYcbcrConversion; - status = UNIX_CALL(vkCreateSamplerYcbcrConversionKHR, ¶ms); - assert(!status && "vkCreateSamplerYcbcrConversionKHR"); - return params.result; -} - -VkResult WINAPI vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSemaphore *pSemaphore) -{ - struct vkCreateSemaphore_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pSemaphore = pSemaphore; - status = UNIX_CALL(vkCreateSemaphore, ¶ms); - assert(!status && "vkCreateSemaphore"); - return params.result; -} - -VkResult WINAPI vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkShaderModule *pShaderModule) -{ - struct vkCreateShaderModule_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pShaderModule = pShaderModule; - status = UNIX_CALL(vkCreateShaderModule, ¶ms); - assert(!status && "vkCreateShaderModule"); - return params.result; -} - -VkResult WINAPI vkCreateShadersEXT(VkDevice device, uint32_t createInfoCount, const VkShaderCreateInfoEXT *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkShaderEXT *pShaders) -{ - struct vkCreateShadersEXT_params params; - NTSTATUS status; - params.device = device; - params.createInfoCount = createInfoCount; - params.pCreateInfos = pCreateInfos; - params.pAllocator = pAllocator; - params.pShaders = pShaders; - status = UNIX_CALL(vkCreateShadersEXT, ¶ms); - assert(!status && "vkCreateShadersEXT"); - return params.result; -} - -VkResult WINAPI vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain) -{ - struct vkCreateSwapchainKHR_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pSwapchain = pSwapchain; - status = UNIX_CALL(vkCreateSwapchainKHR, ¶ms); - assert(!status && "vkCreateSwapchainKHR"); - return params.result; -} - -VkResult WINAPI vkCreateValidationCacheEXT(VkDevice device, const VkValidationCacheCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkValidationCacheEXT *pValidationCache) -{ - struct vkCreateValidationCacheEXT_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pValidationCache = pValidationCache; - status = UNIX_CALL(vkCreateValidationCacheEXT, ¶ms); - assert(!status && "vkCreateValidationCacheEXT"); - return params.result; -} - -VkResult WINAPI vkCreateVideoSessionKHR(VkDevice device, const VkVideoSessionCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkVideoSessionKHR *pVideoSession) -{ - struct vkCreateVideoSessionKHR_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pVideoSession = pVideoSession; - status = UNIX_CALL(vkCreateVideoSessionKHR, ¶ms); - assert(!status && "vkCreateVideoSessionKHR"); - return params.result; -} - -VkResult WINAPI vkCreateVideoSessionParametersKHR(VkDevice device, const VkVideoSessionParametersCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkVideoSessionParametersKHR *pVideoSessionParameters) -{ - struct vkCreateVideoSessionParametersKHR_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pVideoSessionParameters = pVideoSessionParameters; - status = UNIX_CALL(vkCreateVideoSessionParametersKHR, ¶ms); - assert(!status && "vkCreateVideoSessionParametersKHR"); - return params.result; -} - -VkResult WINAPI vkCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) -{ - struct vkCreateWin32SurfaceKHR_params params; - NTSTATUS status; - params.instance = instance; - params.pCreateInfo = pCreateInfo; - params.pAllocator = pAllocator; - params.pSurface = pSurface; - status = UNIX_CALL(vkCreateWin32SurfaceKHR, ¶ms); - assert(!status && "vkCreateWin32SurfaceKHR"); - return params.result; -} - -VkResult WINAPI vkDebugMarkerSetObjectNameEXT(VkDevice device, const VkDebugMarkerObjectNameInfoEXT *pNameInfo) -{ - struct vkDebugMarkerSetObjectNameEXT_params params; - NTSTATUS status; - params.device = device; - params.pNameInfo = pNameInfo; - status = UNIX_CALL(vkDebugMarkerSetObjectNameEXT, ¶ms); - assert(!status && "vkDebugMarkerSetObjectNameEXT"); - return params.result; -} - -VkResult WINAPI vkDebugMarkerSetObjectTagEXT(VkDevice device, const VkDebugMarkerObjectTagInfoEXT *pTagInfo) -{ - struct vkDebugMarkerSetObjectTagEXT_params params; - NTSTATUS status; - params.device = device; - params.pTagInfo = pTagInfo; - status = UNIX_CALL(vkDebugMarkerSetObjectTagEXT, ¶ms); - assert(!status && "vkDebugMarkerSetObjectTagEXT"); - return params.result; -} - -void WINAPI vkDebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char *pLayerPrefix, const char *pMessage) -{ - struct vkDebugReportMessageEXT_params params; - NTSTATUS status; - params.instance = instance; - params.flags = flags; - params.objectType = objectType; - params.object = object; - params.location = location; - params.messageCode = messageCode; - params.pLayerPrefix = pLayerPrefix; - params.pMessage = pMessage; - status = UNIX_CALL(vkDebugReportMessageEXT, ¶ms); - assert(!status && "vkDebugReportMessageEXT"); -} - -VkResult WINAPI vkDeferredOperationJoinKHR(VkDevice device, VkDeferredOperationKHR operation) -{ - struct vkDeferredOperationJoinKHR_params params; - NTSTATUS status; - params.device = device; - params.operation = operation; - status = UNIX_CALL(vkDeferredOperationJoinKHR, ¶ms); - assert(!status && "vkDeferredOperationJoinKHR"); - return params.result; -} - -void WINAPI vkDestroyAccelerationStructureKHR(VkDevice device, VkAccelerationStructureKHR accelerationStructure, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyAccelerationStructureKHR_params params; - NTSTATUS status; - params.device = device; - params.accelerationStructure = accelerationStructure; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyAccelerationStructureKHR, ¶ms); - assert(!status && "vkDestroyAccelerationStructureKHR"); -} - -void WINAPI vkDestroyAccelerationStructureNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyAccelerationStructureNV_params params; - NTSTATUS status; - params.device = device; - params.accelerationStructure = accelerationStructure; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyAccelerationStructureNV, ¶ms); - assert(!status && "vkDestroyAccelerationStructureNV"); -} - -void WINAPI vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyBuffer_params params; - NTSTATUS status; - params.device = device; - params.buffer = buffer; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyBuffer, ¶ms); - assert(!status && "vkDestroyBuffer"); -} - -void WINAPI vkDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyBufferView_params params; - NTSTATUS status; - params.device = device; - params.bufferView = bufferView; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyBufferView, ¶ms); - assert(!status && "vkDestroyBufferView"); -} - -void WINAPI vkDestroyCuFunctionNVX(VkDevice device, VkCuFunctionNVX function, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyCuFunctionNVX_params params; - NTSTATUS status; - params.device = device; - params.function = function; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyCuFunctionNVX, ¶ms); - assert(!status && "vkDestroyCuFunctionNVX"); -} - -void WINAPI vkDestroyCuModuleNVX(VkDevice device, VkCuModuleNVX module, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyCuModuleNVX_params params; - NTSTATUS status; - params.device = device; - params.module = module; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyCuModuleNVX, ¶ms); - assert(!status && "vkDestroyCuModuleNVX"); -} - -void WINAPI vkDestroyCudaFunctionNV(VkDevice device, VkCudaFunctionNV function, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyCudaFunctionNV_params params; - NTSTATUS status; - params.device = device; - params.function = function; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyCudaFunctionNV, ¶ms); - assert(!status && "vkDestroyCudaFunctionNV"); -} - -void WINAPI vkDestroyCudaModuleNV(VkDevice device, VkCudaModuleNV module, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyCudaModuleNV_params params; - NTSTATUS status; - params.device = device; - params.module = module; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyCudaModuleNV, ¶ms); - assert(!status && "vkDestroyCudaModuleNV"); -} - -void WINAPI vkDestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyDebugReportCallbackEXT_params params; - NTSTATUS status; - params.instance = instance; - params.callback = callback; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyDebugReportCallbackEXT, ¶ms); - assert(!status && "vkDestroyDebugReportCallbackEXT"); -} - -void WINAPI vkDestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyDebugUtilsMessengerEXT_params params; - NTSTATUS status; - params.instance = instance; - params.messenger = messenger; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyDebugUtilsMessengerEXT, ¶ms); - assert(!status && "vkDestroyDebugUtilsMessengerEXT"); -} - -void WINAPI vkDestroyDeferredOperationKHR(VkDevice device, VkDeferredOperationKHR operation, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyDeferredOperationKHR_params params; - NTSTATUS status; - params.device = device; - params.operation = operation; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyDeferredOperationKHR, ¶ms); - assert(!status && "vkDestroyDeferredOperationKHR"); -} - -void WINAPI vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyDescriptorPool_params params; - NTSTATUS status; - params.device = device; - params.descriptorPool = descriptorPool; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyDescriptorPool, ¶ms); - assert(!status && "vkDestroyDescriptorPool"); -} - -void WINAPI vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyDescriptorSetLayout_params params; - NTSTATUS status; - params.device = device; - params.descriptorSetLayout = descriptorSetLayout; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyDescriptorSetLayout, ¶ms); - assert(!status && "vkDestroyDescriptorSetLayout"); -} - -void WINAPI vkDestroyDescriptorUpdateTemplate(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyDescriptorUpdateTemplate_params params; - NTSTATUS status; - params.device = device; - params.descriptorUpdateTemplate = descriptorUpdateTemplate; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyDescriptorUpdateTemplate, ¶ms); - assert(!status && "vkDestroyDescriptorUpdateTemplate"); -} - -void WINAPI vkDestroyDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyDescriptorUpdateTemplateKHR_params params; - NTSTATUS status; - params.device = device; - params.descriptorUpdateTemplate = descriptorUpdateTemplate; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyDescriptorUpdateTemplateKHR, ¶ms); - assert(!status && "vkDestroyDescriptorUpdateTemplateKHR"); -} - -void WINAPI vkDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyEvent_params params; - NTSTATUS status; - params.device = device; - params.event = event; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyEvent, ¶ms); - assert(!status && "vkDestroyEvent"); -} - -void WINAPI vkDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyFence_params params; - NTSTATUS status; - params.device = device; - params.fence = fence; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyFence, ¶ms); - assert(!status && "vkDestroyFence"); -} - -void WINAPI vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyFramebuffer_params params; - NTSTATUS status; - params.device = device; - params.framebuffer = framebuffer; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyFramebuffer, ¶ms); - assert(!status && "vkDestroyFramebuffer"); -} - -void WINAPI vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyImage_params params; - NTSTATUS status; - params.device = device; - params.image = image; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyImage, ¶ms); - assert(!status && "vkDestroyImage"); -} - -void WINAPI vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyImageView_params params; - NTSTATUS status; - params.device = device; - params.imageView = imageView; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyImageView, ¶ms); - assert(!status && "vkDestroyImageView"); -} - -void WINAPI vkDestroyIndirectCommandsLayoutEXT(VkDevice device, VkIndirectCommandsLayoutEXT indirectCommandsLayout, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyIndirectCommandsLayoutEXT_params params; - NTSTATUS status; - params.device = device; - params.indirectCommandsLayout = indirectCommandsLayout; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyIndirectCommandsLayoutEXT, ¶ms); - assert(!status && "vkDestroyIndirectCommandsLayoutEXT"); -} - -void WINAPI vkDestroyIndirectCommandsLayoutNV(VkDevice device, VkIndirectCommandsLayoutNV indirectCommandsLayout, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyIndirectCommandsLayoutNV_params params; - NTSTATUS status; - params.device = device; - params.indirectCommandsLayout = indirectCommandsLayout; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyIndirectCommandsLayoutNV, ¶ms); - assert(!status && "vkDestroyIndirectCommandsLayoutNV"); -} - -void WINAPI vkDestroyIndirectExecutionSetEXT(VkDevice device, VkIndirectExecutionSetEXT indirectExecutionSet, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyIndirectExecutionSetEXT_params params; - NTSTATUS status; - params.device = device; - params.indirectExecutionSet = indirectExecutionSet; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyIndirectExecutionSetEXT, ¶ms); - assert(!status && "vkDestroyIndirectExecutionSetEXT"); -} - -void WINAPI vkDestroyMicromapEXT(VkDevice device, VkMicromapEXT micromap, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyMicromapEXT_params params; - NTSTATUS status; - params.device = device; - params.micromap = micromap; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyMicromapEXT, ¶ms); - assert(!status && "vkDestroyMicromapEXT"); -} - -void WINAPI vkDestroyOpticalFlowSessionNV(VkDevice device, VkOpticalFlowSessionNV session, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyOpticalFlowSessionNV_params params; - NTSTATUS status; - params.device = device; - params.session = session; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyOpticalFlowSessionNV, ¶ms); - assert(!status && "vkDestroyOpticalFlowSessionNV"); -} - -void WINAPI vkDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyPipeline_params params; - NTSTATUS status; - params.device = device; - params.pipeline = pipeline; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyPipeline, ¶ms); - assert(!status && "vkDestroyPipeline"); -} - -void WINAPI vkDestroyPipelineBinaryKHR(VkDevice device, VkPipelineBinaryKHR pipelineBinary, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyPipelineBinaryKHR_params params; - NTSTATUS status; - params.device = device; - params.pipelineBinary = pipelineBinary; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyPipelineBinaryKHR, ¶ms); - assert(!status && "vkDestroyPipelineBinaryKHR"); -} - -void WINAPI vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyPipelineCache_params params; - NTSTATUS status; - params.device = device; - params.pipelineCache = pipelineCache; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyPipelineCache, ¶ms); - assert(!status && "vkDestroyPipelineCache"); -} - -void WINAPI vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyPipelineLayout_params params; - NTSTATUS status; - params.device = device; - params.pipelineLayout = pipelineLayout; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyPipelineLayout, ¶ms); - assert(!status && "vkDestroyPipelineLayout"); -} - -void WINAPI vkDestroyPrivateDataSlot(VkDevice device, VkPrivateDataSlot privateDataSlot, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyPrivateDataSlot_params params; - NTSTATUS status; - params.device = device; - params.privateDataSlot = privateDataSlot; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyPrivateDataSlot, ¶ms); - assert(!status && "vkDestroyPrivateDataSlot"); -} - -void WINAPI vkDestroyPrivateDataSlotEXT(VkDevice device, VkPrivateDataSlot privateDataSlot, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyPrivateDataSlotEXT_params params; - NTSTATUS status; - params.device = device; - params.privateDataSlot = privateDataSlot; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyPrivateDataSlotEXT, ¶ms); - assert(!status && "vkDestroyPrivateDataSlotEXT"); -} - -void WINAPI vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyQueryPool_params params; - NTSTATUS status; - params.device = device; - params.queryPool = queryPool; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyQueryPool, ¶ms); - assert(!status && "vkDestroyQueryPool"); -} - -void WINAPI vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyRenderPass_params params; - NTSTATUS status; - params.device = device; - params.renderPass = renderPass; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyRenderPass, ¶ms); - assert(!status && "vkDestroyRenderPass"); -} - -void WINAPI vkDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroySampler_params params; - NTSTATUS status; - params.device = device; - params.sampler = sampler; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroySampler, ¶ms); - assert(!status && "vkDestroySampler"); -} - -void WINAPI vkDestroySamplerYcbcrConversion(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroySamplerYcbcrConversion_params params; - NTSTATUS status; - params.device = device; - params.ycbcrConversion = ycbcrConversion; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroySamplerYcbcrConversion, ¶ms); - assert(!status && "vkDestroySamplerYcbcrConversion"); -} - -void WINAPI vkDestroySamplerYcbcrConversionKHR(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroySamplerYcbcrConversionKHR_params params; - NTSTATUS status; - params.device = device; - params.ycbcrConversion = ycbcrConversion; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroySamplerYcbcrConversionKHR, ¶ms); - assert(!status && "vkDestroySamplerYcbcrConversionKHR"); -} - -void WINAPI vkDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroySemaphore_params params; - NTSTATUS status; - params.device = device; - params.semaphore = semaphore; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroySemaphore, ¶ms); - assert(!status && "vkDestroySemaphore"); -} - -void WINAPI vkDestroyShaderEXT(VkDevice device, VkShaderEXT shader, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyShaderEXT_params params; - NTSTATUS status; - params.device = device; - params.shader = shader; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyShaderEXT, ¶ms); - assert(!status && "vkDestroyShaderEXT"); -} - -void WINAPI vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyShaderModule_params params; - NTSTATUS status; - params.device = device; - params.shaderModule = shaderModule; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyShaderModule, ¶ms); - assert(!status && "vkDestroyShaderModule"); -} - -void WINAPI vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroySurfaceKHR_params params; - NTSTATUS status; - params.instance = instance; - params.surface = surface; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroySurfaceKHR, ¶ms); - assert(!status && "vkDestroySurfaceKHR"); -} - -void WINAPI vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroySwapchainKHR_params params; - NTSTATUS status; - params.device = device; - params.swapchain = swapchain; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroySwapchainKHR, ¶ms); - assert(!status && "vkDestroySwapchainKHR"); -} - -void WINAPI vkDestroyValidationCacheEXT(VkDevice device, VkValidationCacheEXT validationCache, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyValidationCacheEXT_params params; - NTSTATUS status; - params.device = device; - params.validationCache = validationCache; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyValidationCacheEXT, ¶ms); - assert(!status && "vkDestroyValidationCacheEXT"); -} - -void WINAPI vkDestroyVideoSessionKHR(VkDevice device, VkVideoSessionKHR videoSession, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyVideoSessionKHR_params params; - NTSTATUS status; - params.device = device; - params.videoSession = videoSession; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyVideoSessionKHR, ¶ms); - assert(!status && "vkDestroyVideoSessionKHR"); -} - -void WINAPI vkDestroyVideoSessionParametersKHR(VkDevice device, VkVideoSessionParametersKHR videoSessionParameters, const VkAllocationCallbacks *pAllocator) -{ - struct vkDestroyVideoSessionParametersKHR_params params; - NTSTATUS status; - params.device = device; - params.videoSessionParameters = videoSessionParameters; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkDestroyVideoSessionParametersKHR, ¶ms); - assert(!status && "vkDestroyVideoSessionParametersKHR"); -} - -VkResult WINAPI vkDeviceWaitIdle(VkDevice device) -{ - struct vkDeviceWaitIdle_params params; - NTSTATUS status; - params.device = device; - status = UNIX_CALL(vkDeviceWaitIdle, ¶ms); - assert(!status && "vkDeviceWaitIdle"); - return params.result; -} - -VkResult WINAPI vkEndCommandBuffer(VkCommandBuffer commandBuffer) -{ - struct vkEndCommandBuffer_params params; - NTSTATUS status; - params.commandBuffer = commandBuffer; - status = UNIX_CALL(vkEndCommandBuffer, ¶ms); - assert(!status && "vkEndCommandBuffer"); - return params.result; -} - -VkResult WINAPI vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties) -{ - struct vkEnumerateDeviceExtensionProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pLayerName = pLayerName; - params.pPropertyCount = pPropertyCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkEnumerateDeviceExtensionProperties, ¶ms); - assert(!status && "vkEnumerateDeviceExtensionProperties"); - return params.result; -} - -VkResult WINAPI vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkLayerProperties *pProperties) -{ - struct vkEnumerateDeviceLayerProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pPropertyCount = pPropertyCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkEnumerateDeviceLayerProperties, ¶ms); - assert(!status && "vkEnumerateDeviceLayerProperties"); - return params.result; -} - -VkResult WINAPI vkEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties) -{ - struct vkEnumeratePhysicalDeviceGroups_params params; - NTSTATUS status; - params.instance = instance; - params.pPhysicalDeviceGroupCount = pPhysicalDeviceGroupCount; - params.pPhysicalDeviceGroupProperties = pPhysicalDeviceGroupProperties; - status = UNIX_CALL(vkEnumeratePhysicalDeviceGroups, ¶ms); - assert(!status && "vkEnumeratePhysicalDeviceGroups"); - return params.result; -} - -VkResult WINAPI vkEnumeratePhysicalDeviceGroupsKHR(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties) -{ - struct vkEnumeratePhysicalDeviceGroupsKHR_params params; - NTSTATUS status; - params.instance = instance; - params.pPhysicalDeviceGroupCount = pPhysicalDeviceGroupCount; - params.pPhysicalDeviceGroupProperties = pPhysicalDeviceGroupProperties; - status = UNIX_CALL(vkEnumeratePhysicalDeviceGroupsKHR, ¶ms); - assert(!status && "vkEnumeratePhysicalDeviceGroupsKHR"); - return params.result; -} - -VkResult WINAPI vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, uint32_t *pCounterCount, VkPerformanceCounterKHR *pCounters, VkPerformanceCounterDescriptionKHR *pCounterDescriptions) -{ - struct vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.queueFamilyIndex = queueFamilyIndex; - params.pCounterCount = pCounterCount; - params.pCounters = pCounters; - params.pCounterDescriptions = pCounterDescriptions; - status = UNIX_CALL(vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR, ¶ms); - assert(!status && "vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR"); - return params.result; -} - -VkResult WINAPI vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, VkPhysicalDevice *pPhysicalDevices) -{ - struct vkEnumeratePhysicalDevices_params params; - NTSTATUS status; - params.instance = instance; - params.pPhysicalDeviceCount = pPhysicalDeviceCount; - params.pPhysicalDevices = pPhysicalDevices; - status = UNIX_CALL(vkEnumeratePhysicalDevices, ¶ms); - assert(!status && "vkEnumeratePhysicalDevices"); - return params.result; -} - -VkResult WINAPI vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange *pMemoryRanges) -{ - struct vkFlushMappedMemoryRanges_params params; - NTSTATUS status; - params.device = device; - params.memoryRangeCount = memoryRangeCount; - params.pMemoryRanges = pMemoryRanges; - status = UNIX_CALL(vkFlushMappedMemoryRanges, ¶ms); - assert(!status && "vkFlushMappedMemoryRanges"); - return params.result; -} - -VkResult WINAPI vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet *pDescriptorSets) -{ - struct vkFreeDescriptorSets_params params; - NTSTATUS status; - params.device = device; - params.descriptorPool = descriptorPool; - params.descriptorSetCount = descriptorSetCount; - params.pDescriptorSets = pDescriptorSets; - status = UNIX_CALL(vkFreeDescriptorSets, ¶ms); - assert(!status && "vkFreeDescriptorSets"); - return params.result; -} - -void WINAPI vkFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks *pAllocator) -{ - struct vkFreeMemory_params params; - NTSTATUS status; - params.device = device; - params.memory = memory; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkFreeMemory, ¶ms); - assert(!status && "vkFreeMemory"); -} - -void WINAPI vkGetAccelerationStructureBuildSizesKHR(VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, const VkAccelerationStructureBuildGeometryInfoKHR *pBuildInfo, const uint32_t *pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR *pSizeInfo) -{ - struct vkGetAccelerationStructureBuildSizesKHR_params params; - NTSTATUS status; - params.device = device; - params.buildType = buildType; - params.pBuildInfo = pBuildInfo; - params.pMaxPrimitiveCounts = pMaxPrimitiveCounts; - params.pSizeInfo = pSizeInfo; - status = UNIX_CALL(vkGetAccelerationStructureBuildSizesKHR, ¶ms); - assert(!status && "vkGetAccelerationStructureBuildSizesKHR"); -} - -VkDeviceAddress WINAPI vkGetAccelerationStructureDeviceAddressKHR(VkDevice device, const VkAccelerationStructureDeviceAddressInfoKHR *pInfo) -{ - struct vkGetAccelerationStructureDeviceAddressKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetAccelerationStructureDeviceAddressKHR, ¶ms); - assert(!status && "vkGetAccelerationStructureDeviceAddressKHR"); - return params.result; -} - -VkResult WINAPI vkGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, size_t dataSize, void *pData) -{ - struct vkGetAccelerationStructureHandleNV_params params; - NTSTATUS status; - params.device = device; - params.accelerationStructure = accelerationStructure; - params.dataSize = dataSize; - params.pData = pData; - status = UNIX_CALL(vkGetAccelerationStructureHandleNV, ¶ms); - assert(!status && "vkGetAccelerationStructureHandleNV"); - return params.result; -} - -void WINAPI vkGetAccelerationStructureMemoryRequirementsNV(VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNV *pInfo, VkMemoryRequirements2KHR *pMemoryRequirements) -{ - struct vkGetAccelerationStructureMemoryRequirementsNV_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetAccelerationStructureMemoryRequirementsNV, ¶ms); - assert(!status && "vkGetAccelerationStructureMemoryRequirementsNV"); -} - -VkResult WINAPI vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkAccelerationStructureCaptureDescriptorDataInfoEXT *pInfo, void *pData) -{ - struct vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pData = pData; - status = UNIX_CALL(vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT, ¶ms); - assert(!status && "vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT"); - return params.result; -} - -VkDeviceAddress WINAPI vkGetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo *pInfo) -{ - struct vkGetBufferDeviceAddress_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetBufferDeviceAddress, ¶ms); - assert(!status && "vkGetBufferDeviceAddress"); - return params.result; -} - -VkDeviceAddress WINAPI vkGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfo *pInfo) -{ - struct vkGetBufferDeviceAddressEXT_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetBufferDeviceAddressEXT, ¶ms); - assert(!status && "vkGetBufferDeviceAddressEXT"); - return params.result; -} - -VkDeviceAddress WINAPI vkGetBufferDeviceAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo *pInfo) -{ - struct vkGetBufferDeviceAddressKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetBufferDeviceAddressKHR, ¶ms); - assert(!status && "vkGetBufferDeviceAddressKHR"); - return params.result; -} - -void WINAPI vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements *pMemoryRequirements) -{ - struct vkGetBufferMemoryRequirements_params params; - NTSTATUS status; - params.device = device; - params.buffer = buffer; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetBufferMemoryRequirements, ¶ms); - assert(!status && "vkGetBufferMemoryRequirements"); -} - -void WINAPI vkGetBufferMemoryRequirements2(VkDevice device, const VkBufferMemoryRequirementsInfo2 *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetBufferMemoryRequirements2_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetBufferMemoryRequirements2, ¶ms); - assert(!status && "vkGetBufferMemoryRequirements2"); -} - -void WINAPI vkGetBufferMemoryRequirements2KHR(VkDevice device, const VkBufferMemoryRequirementsInfo2 *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetBufferMemoryRequirements2KHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetBufferMemoryRequirements2KHR, ¶ms); - assert(!status && "vkGetBufferMemoryRequirements2KHR"); -} - -uint64_t WINAPI vkGetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfo *pInfo) -{ - struct vkGetBufferOpaqueCaptureAddress_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetBufferOpaqueCaptureAddress, ¶ms); - assert(!status && "vkGetBufferOpaqueCaptureAddress"); - return params.result; -} - -uint64_t WINAPI vkGetBufferOpaqueCaptureAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo *pInfo) -{ - struct vkGetBufferOpaqueCaptureAddressKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetBufferOpaqueCaptureAddressKHR, ¶ms); - assert(!status && "vkGetBufferOpaqueCaptureAddressKHR"); - return params.result; -} - -VkResult WINAPI vkGetBufferOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkBufferCaptureDescriptorDataInfoEXT *pInfo, void *pData) -{ - struct vkGetBufferOpaqueCaptureDescriptorDataEXT_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pData = pData; - status = UNIX_CALL(vkGetBufferOpaqueCaptureDescriptorDataEXT, ¶ms); - assert(!status && "vkGetBufferOpaqueCaptureDescriptorDataEXT"); - return params.result; -} - -VkResult WINAPI vkGetCalibratedTimestampsEXT(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoKHR *pTimestampInfos, uint64_t *pTimestamps, uint64_t *pMaxDeviation) -{ - struct vkGetCalibratedTimestampsEXT_params params; - NTSTATUS status; - params.device = device; - params.timestampCount = timestampCount; - params.pTimestampInfos = pTimestampInfos; - params.pTimestamps = pTimestamps; - params.pMaxDeviation = pMaxDeviation; - status = UNIX_CALL(vkGetCalibratedTimestampsEXT, ¶ms); - assert(!status && "vkGetCalibratedTimestampsEXT"); - return params.result; -} - -VkResult WINAPI vkGetCalibratedTimestampsKHR(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoKHR *pTimestampInfos, uint64_t *pTimestamps, uint64_t *pMaxDeviation) -{ - struct vkGetCalibratedTimestampsKHR_params params; - NTSTATUS status; - params.device = device; - params.timestampCount = timestampCount; - params.pTimestampInfos = pTimestampInfos; - params.pTimestamps = pTimestamps; - params.pMaxDeviation = pMaxDeviation; - status = UNIX_CALL(vkGetCalibratedTimestampsKHR, ¶ms); - assert(!status && "vkGetCalibratedTimestampsKHR"); - return params.result; -} - -VkResult WINAPI vkGetCudaModuleCacheNV(VkDevice device, VkCudaModuleNV module, size_t *pCacheSize, void *pCacheData) -{ - struct vkGetCudaModuleCacheNV_params params; - NTSTATUS status; - params.device = device; - params.module = module; - params.pCacheSize = pCacheSize; - params.pCacheData = pCacheData; - status = UNIX_CALL(vkGetCudaModuleCacheNV, ¶ms); - assert(!status && "vkGetCudaModuleCacheNV"); - return params.result; -} - -uint32_t WINAPI vkGetDeferredOperationMaxConcurrencyKHR(VkDevice device, VkDeferredOperationKHR operation) -{ - struct vkGetDeferredOperationMaxConcurrencyKHR_params params; - NTSTATUS status; - params.device = device; - params.operation = operation; - status = UNIX_CALL(vkGetDeferredOperationMaxConcurrencyKHR, ¶ms); - assert(!status && "vkGetDeferredOperationMaxConcurrencyKHR"); - return params.result; -} - -VkResult WINAPI vkGetDeferredOperationResultKHR(VkDevice device, VkDeferredOperationKHR operation) -{ - struct vkGetDeferredOperationResultKHR_params params; - NTSTATUS status; - params.device = device; - params.operation = operation; - status = UNIX_CALL(vkGetDeferredOperationResultKHR, ¶ms); - assert(!status && "vkGetDeferredOperationResultKHR"); - return params.result; -} - -void WINAPI vkGetDescriptorEXT(VkDevice device, const VkDescriptorGetInfoEXT *pDescriptorInfo, size_t dataSize, void *pDescriptor) -{ - struct vkGetDescriptorEXT_params params; - params.device = device; - params.pDescriptorInfo = pDescriptorInfo; - params.dataSize = dataSize; - params.pDescriptor = pDescriptor; - UNIX_CALL(vkGetDescriptorEXT, ¶ms); -} - -void WINAPI vkGetDescriptorSetHostMappingVALVE(VkDevice device, VkDescriptorSet descriptorSet, void **ppData) -{ - struct vkGetDescriptorSetHostMappingVALVE_params params; - NTSTATUS status; - params.device = device; - params.descriptorSet = descriptorSet; - params.ppData = ppData; - status = UNIX_CALL(vkGetDescriptorSetHostMappingVALVE, ¶ms); - assert(!status && "vkGetDescriptorSetHostMappingVALVE"); -} - -void WINAPI vkGetDescriptorSetLayoutBindingOffsetEXT(VkDevice device, VkDescriptorSetLayout layout, uint32_t binding, VkDeviceSize *pOffset) -{ - struct vkGetDescriptorSetLayoutBindingOffsetEXT_params params; - NTSTATUS status; - params.device = device; - params.layout = layout; - params.binding = binding; - params.pOffset = pOffset; - status = UNIX_CALL(vkGetDescriptorSetLayoutBindingOffsetEXT, ¶ms); - assert(!status && "vkGetDescriptorSetLayoutBindingOffsetEXT"); -} - -void WINAPI vkGetDescriptorSetLayoutHostMappingInfoVALVE(VkDevice device, const VkDescriptorSetBindingReferenceVALVE *pBindingReference, VkDescriptorSetLayoutHostMappingInfoVALVE *pHostMapping) -{ - struct vkGetDescriptorSetLayoutHostMappingInfoVALVE_params params; - NTSTATUS status; - params.device = device; - params.pBindingReference = pBindingReference; - params.pHostMapping = pHostMapping; - status = UNIX_CALL(vkGetDescriptorSetLayoutHostMappingInfoVALVE, ¶ms); - assert(!status && "vkGetDescriptorSetLayoutHostMappingInfoVALVE"); -} - -void WINAPI vkGetDescriptorSetLayoutSizeEXT(VkDevice device, VkDescriptorSetLayout layout, VkDeviceSize *pLayoutSizeInBytes) -{ - struct vkGetDescriptorSetLayoutSizeEXT_params params; - NTSTATUS status; - params.device = device; - params.layout = layout; - params.pLayoutSizeInBytes = pLayoutSizeInBytes; - status = UNIX_CALL(vkGetDescriptorSetLayoutSizeEXT, ¶ms); - assert(!status && "vkGetDescriptorSetLayoutSizeEXT"); -} - -void WINAPI vkGetDescriptorSetLayoutSupport(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, VkDescriptorSetLayoutSupport *pSupport) -{ - struct vkGetDescriptorSetLayoutSupport_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pSupport = pSupport; - status = UNIX_CALL(vkGetDescriptorSetLayoutSupport, ¶ms); - assert(!status && "vkGetDescriptorSetLayoutSupport"); -} - -void WINAPI vkGetDescriptorSetLayoutSupportKHR(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, VkDescriptorSetLayoutSupport *pSupport) -{ - struct vkGetDescriptorSetLayoutSupportKHR_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pSupport = pSupport; - status = UNIX_CALL(vkGetDescriptorSetLayoutSupportKHR, ¶ms); - assert(!status && "vkGetDescriptorSetLayoutSupportKHR"); -} - -void WINAPI vkGetDeviceAccelerationStructureCompatibilityKHR(VkDevice device, const VkAccelerationStructureVersionInfoKHR *pVersionInfo, VkAccelerationStructureCompatibilityKHR *pCompatibility) -{ - struct vkGetDeviceAccelerationStructureCompatibilityKHR_params params; - NTSTATUS status; - params.device = device; - params.pVersionInfo = pVersionInfo; - params.pCompatibility = pCompatibility; - status = UNIX_CALL(vkGetDeviceAccelerationStructureCompatibilityKHR, ¶ms); - assert(!status && "vkGetDeviceAccelerationStructureCompatibilityKHR"); -} - -void WINAPI vkGetDeviceBufferMemoryRequirements(VkDevice device, const VkDeviceBufferMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetDeviceBufferMemoryRequirements_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetDeviceBufferMemoryRequirements, ¶ms); - assert(!status && "vkGetDeviceBufferMemoryRequirements"); -} - -void WINAPI vkGetDeviceBufferMemoryRequirementsKHR(VkDevice device, const VkDeviceBufferMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetDeviceBufferMemoryRequirementsKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetDeviceBufferMemoryRequirementsKHR, ¶ms); - assert(!status && "vkGetDeviceBufferMemoryRequirementsKHR"); -} - -VkResult WINAPI vkGetDeviceFaultInfoEXT(VkDevice device, VkDeviceFaultCountsEXT *pFaultCounts, VkDeviceFaultInfoEXT *pFaultInfo) -{ - struct vkGetDeviceFaultInfoEXT_params params; - NTSTATUS status; - params.device = device; - params.pFaultCounts = pFaultCounts; - params.pFaultInfo = pFaultInfo; - status = UNIX_CALL(vkGetDeviceFaultInfoEXT, ¶ms); - assert(!status && "vkGetDeviceFaultInfoEXT"); - return params.result; -} - -void WINAPI vkGetDeviceGroupPeerMemoryFeatures(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags *pPeerMemoryFeatures) -{ - struct vkGetDeviceGroupPeerMemoryFeatures_params params; - NTSTATUS status; - params.device = device; - params.heapIndex = heapIndex; - params.localDeviceIndex = localDeviceIndex; - params.remoteDeviceIndex = remoteDeviceIndex; - params.pPeerMemoryFeatures = pPeerMemoryFeatures; - status = UNIX_CALL(vkGetDeviceGroupPeerMemoryFeatures, ¶ms); - assert(!status && "vkGetDeviceGroupPeerMemoryFeatures"); -} - -void WINAPI vkGetDeviceGroupPeerMemoryFeaturesKHR(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags *pPeerMemoryFeatures) -{ - struct vkGetDeviceGroupPeerMemoryFeaturesKHR_params params; - NTSTATUS status; - params.device = device; - params.heapIndex = heapIndex; - params.localDeviceIndex = localDeviceIndex; - params.remoteDeviceIndex = remoteDeviceIndex; - params.pPeerMemoryFeatures = pPeerMemoryFeatures; - status = UNIX_CALL(vkGetDeviceGroupPeerMemoryFeaturesKHR, ¶ms); - assert(!status && "vkGetDeviceGroupPeerMemoryFeaturesKHR"); -} - -VkResult WINAPI vkGetDeviceGroupPresentCapabilitiesKHR(VkDevice device, VkDeviceGroupPresentCapabilitiesKHR *pDeviceGroupPresentCapabilities) -{ - struct vkGetDeviceGroupPresentCapabilitiesKHR_params params; - NTSTATUS status; - params.device = device; - params.pDeviceGroupPresentCapabilities = pDeviceGroupPresentCapabilities; - status = UNIX_CALL(vkGetDeviceGroupPresentCapabilitiesKHR, ¶ms); - assert(!status && "vkGetDeviceGroupPresentCapabilitiesKHR"); - return params.result; -} - -VkResult WINAPI vkGetDeviceGroupSurfacePresentModesKHR(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR *pModes) -{ - struct vkGetDeviceGroupSurfacePresentModesKHR_params params; - NTSTATUS status; - params.device = device; - params.surface = surface; - params.pModes = pModes; - status = UNIX_CALL(vkGetDeviceGroupSurfacePresentModesKHR, ¶ms); - assert(!status && "vkGetDeviceGroupSurfacePresentModesKHR"); - return params.result; -} - -void WINAPI vkGetDeviceImageMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetDeviceImageMemoryRequirements_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetDeviceImageMemoryRequirements, ¶ms); - assert(!status && "vkGetDeviceImageMemoryRequirements"); -} - -void WINAPI vkGetDeviceImageMemoryRequirementsKHR(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetDeviceImageMemoryRequirementsKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetDeviceImageMemoryRequirementsKHR, ¶ms); - assert(!status && "vkGetDeviceImageMemoryRequirementsKHR"); -} - -void WINAPI vkGetDeviceImageSparseMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements) -{ - struct vkGetDeviceImageSparseMemoryRequirements_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pSparseMemoryRequirementCount = pSparseMemoryRequirementCount; - params.pSparseMemoryRequirements = pSparseMemoryRequirements; - status = UNIX_CALL(vkGetDeviceImageSparseMemoryRequirements, ¶ms); - assert(!status && "vkGetDeviceImageSparseMemoryRequirements"); -} - -void WINAPI vkGetDeviceImageSparseMemoryRequirementsKHR(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements) -{ - struct vkGetDeviceImageSparseMemoryRequirementsKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pSparseMemoryRequirementCount = pSparseMemoryRequirementCount; - params.pSparseMemoryRequirements = pSparseMemoryRequirements; - status = UNIX_CALL(vkGetDeviceImageSparseMemoryRequirementsKHR, ¶ms); - assert(!status && "vkGetDeviceImageSparseMemoryRequirementsKHR"); -} - -void WINAPI vkGetDeviceImageSubresourceLayout(VkDevice device, const VkDeviceImageSubresourceInfo *pInfo, VkSubresourceLayout2 *pLayout) -{ - struct vkGetDeviceImageSubresourceLayout_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pLayout = pLayout; - status = UNIX_CALL(vkGetDeviceImageSubresourceLayout, ¶ms); - assert(!status && "vkGetDeviceImageSubresourceLayout"); -} - -void WINAPI vkGetDeviceImageSubresourceLayoutKHR(VkDevice device, const VkDeviceImageSubresourceInfo *pInfo, VkSubresourceLayout2 *pLayout) -{ - struct vkGetDeviceImageSubresourceLayoutKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pLayout = pLayout; - status = UNIX_CALL(vkGetDeviceImageSubresourceLayoutKHR, ¶ms); - assert(!status && "vkGetDeviceImageSubresourceLayoutKHR"); -} - -void WINAPI vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize *pCommittedMemoryInBytes) -{ - struct vkGetDeviceMemoryCommitment_params params; - NTSTATUS status; - params.device = device; - params.memory = memory; - params.pCommittedMemoryInBytes = pCommittedMemoryInBytes; - status = UNIX_CALL(vkGetDeviceMemoryCommitment, ¶ms); - assert(!status && "vkGetDeviceMemoryCommitment"); -} - -uint64_t WINAPI vkGetDeviceMemoryOpaqueCaptureAddress(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo *pInfo) -{ - struct vkGetDeviceMemoryOpaqueCaptureAddress_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetDeviceMemoryOpaqueCaptureAddress, ¶ms); - assert(!status && "vkGetDeviceMemoryOpaqueCaptureAddress"); - return params.result; -} - -uint64_t WINAPI vkGetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo *pInfo) -{ - struct vkGetDeviceMemoryOpaqueCaptureAddressKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetDeviceMemoryOpaqueCaptureAddressKHR, ¶ms); - assert(!status && "vkGetDeviceMemoryOpaqueCaptureAddressKHR"); - return params.result; -} - -void WINAPI vkGetDeviceMicromapCompatibilityEXT(VkDevice device, const VkMicromapVersionInfoEXT *pVersionInfo, VkAccelerationStructureCompatibilityKHR *pCompatibility) -{ - struct vkGetDeviceMicromapCompatibilityEXT_params params; - NTSTATUS status; - params.device = device; - params.pVersionInfo = pVersionInfo; - params.pCompatibility = pCompatibility; - status = UNIX_CALL(vkGetDeviceMicromapCompatibilityEXT, ¶ms); - assert(!status && "vkGetDeviceMicromapCompatibilityEXT"); -} - -void WINAPI vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue *pQueue) -{ - struct vkGetDeviceQueue_params params; - NTSTATUS status; - params.device = device; - params.queueFamilyIndex = queueFamilyIndex; - params.queueIndex = queueIndex; - params.pQueue = pQueue; - status = UNIX_CALL(vkGetDeviceQueue, ¶ms); - assert(!status && "vkGetDeviceQueue"); -} - -void WINAPI vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2 *pQueueInfo, VkQueue *pQueue) -{ - struct vkGetDeviceQueue2_params params; - NTSTATUS status; - params.device = device; - params.pQueueInfo = pQueueInfo; - params.pQueue = pQueue; - status = UNIX_CALL(vkGetDeviceQueue2, ¶ms); - assert(!status && "vkGetDeviceQueue2"); -} - -VkResult WINAPI vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(VkDevice device, VkRenderPass renderpass, VkExtent2D *pMaxWorkgroupSize) -{ - struct vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI_params params; - NTSTATUS status; - params.device = device; - params.renderpass = renderpass; - params.pMaxWorkgroupSize = pMaxWorkgroupSize; - status = UNIX_CALL(vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI, ¶ms); - assert(!status && "vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI"); - return params.result; -} - -VkResult WINAPI vkGetDynamicRenderingTilePropertiesQCOM(VkDevice device, const VkRenderingInfo *pRenderingInfo, VkTilePropertiesQCOM *pProperties) -{ - struct vkGetDynamicRenderingTilePropertiesQCOM_params params; - NTSTATUS status; - params.device = device; - params.pRenderingInfo = pRenderingInfo; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetDynamicRenderingTilePropertiesQCOM, ¶ms); - assert(!status && "vkGetDynamicRenderingTilePropertiesQCOM"); - return params.result; -} - -VkResult WINAPI vkGetEncodedVideoSessionParametersKHR(VkDevice device, const VkVideoEncodeSessionParametersGetInfoKHR *pVideoSessionParametersInfo, VkVideoEncodeSessionParametersFeedbackInfoKHR *pFeedbackInfo, size_t *pDataSize, void *pData) -{ - struct vkGetEncodedVideoSessionParametersKHR_params params; - NTSTATUS status; - params.device = device; - params.pVideoSessionParametersInfo = pVideoSessionParametersInfo; - params.pFeedbackInfo = pFeedbackInfo; - params.pDataSize = pDataSize; - params.pData = pData; - status = UNIX_CALL(vkGetEncodedVideoSessionParametersKHR, ¶ms); - assert(!status && "vkGetEncodedVideoSessionParametersKHR"); - return params.result; -} - -VkResult WINAPI vkGetEventStatus(VkDevice device, VkEvent event) -{ - struct vkGetEventStatus_params params; - NTSTATUS status; - params.device = device; - params.event = event; - status = UNIX_CALL(vkGetEventStatus, ¶ms); - assert(!status && "vkGetEventStatus"); - return params.result; -} - -VkResult WINAPI vkGetFenceStatus(VkDevice device, VkFence fence) -{ - struct vkGetFenceStatus_params params; - NTSTATUS status; - params.device = device; - params.fence = fence; - status = UNIX_CALL(vkGetFenceStatus, ¶ms); - assert(!status && "vkGetFenceStatus"); - return params.result; -} - -VkResult WINAPI vkGetFramebufferTilePropertiesQCOM(VkDevice device, VkFramebuffer framebuffer, uint32_t *pPropertiesCount, VkTilePropertiesQCOM *pProperties) -{ - struct vkGetFramebufferTilePropertiesQCOM_params params; - NTSTATUS status; - params.device = device; - params.framebuffer = framebuffer; - params.pPropertiesCount = pPropertiesCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetFramebufferTilePropertiesQCOM, ¶ms); - assert(!status && "vkGetFramebufferTilePropertiesQCOM"); - return params.result; -} - -void WINAPI vkGetGeneratedCommandsMemoryRequirementsEXT(VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoEXT *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetGeneratedCommandsMemoryRequirementsEXT_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetGeneratedCommandsMemoryRequirementsEXT, ¶ms); - assert(!status && "vkGetGeneratedCommandsMemoryRequirementsEXT"); -} - -void WINAPI vkGetGeneratedCommandsMemoryRequirementsNV(VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoNV *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetGeneratedCommandsMemoryRequirementsNV_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetGeneratedCommandsMemoryRequirementsNV, ¶ms); - assert(!status && "vkGetGeneratedCommandsMemoryRequirementsNV"); -} - -void WINAPI vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements *pMemoryRequirements) -{ - struct vkGetImageMemoryRequirements_params params; - NTSTATUS status; - params.device = device; - params.image = image; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetImageMemoryRequirements, ¶ms); - assert(!status && "vkGetImageMemoryRequirements"); -} - -void WINAPI vkGetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetImageMemoryRequirements2_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetImageMemoryRequirements2, ¶ms); - assert(!status && "vkGetImageMemoryRequirements2"); -} - -void WINAPI vkGetImageMemoryRequirements2KHR(VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetImageMemoryRequirements2KHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetImageMemoryRequirements2KHR, ¶ms); - assert(!status && "vkGetImageMemoryRequirements2KHR"); -} - -VkResult WINAPI vkGetImageOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkImageCaptureDescriptorDataInfoEXT *pInfo, void *pData) -{ - struct vkGetImageOpaqueCaptureDescriptorDataEXT_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pData = pData; - status = UNIX_CALL(vkGetImageOpaqueCaptureDescriptorDataEXT, ¶ms); - assert(!status && "vkGetImageOpaqueCaptureDescriptorDataEXT"); - return params.result; -} - -void WINAPI vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements *pSparseMemoryRequirements) -{ - struct vkGetImageSparseMemoryRequirements_params params; - NTSTATUS status; - params.device = device; - params.image = image; - params.pSparseMemoryRequirementCount = pSparseMemoryRequirementCount; - params.pSparseMemoryRequirements = pSparseMemoryRequirements; - status = UNIX_CALL(vkGetImageSparseMemoryRequirements, ¶ms); - assert(!status && "vkGetImageSparseMemoryRequirements"); -} - -void WINAPI vkGetImageSparseMemoryRequirements2(VkDevice device, const VkImageSparseMemoryRequirementsInfo2 *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements) -{ - struct vkGetImageSparseMemoryRequirements2_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pSparseMemoryRequirementCount = pSparseMemoryRequirementCount; - params.pSparseMemoryRequirements = pSparseMemoryRequirements; - status = UNIX_CALL(vkGetImageSparseMemoryRequirements2, ¶ms); - assert(!status && "vkGetImageSparseMemoryRequirements2"); -} - -void WINAPI vkGetImageSparseMemoryRequirements2KHR(VkDevice device, const VkImageSparseMemoryRequirementsInfo2 *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements) -{ - struct vkGetImageSparseMemoryRequirements2KHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pSparseMemoryRequirementCount = pSparseMemoryRequirementCount; - params.pSparseMemoryRequirements = pSparseMemoryRequirements; - status = UNIX_CALL(vkGetImageSparseMemoryRequirements2KHR, ¶ms); - assert(!status && "vkGetImageSparseMemoryRequirements2KHR"); -} - -void WINAPI vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource *pSubresource, VkSubresourceLayout *pLayout) -{ - struct vkGetImageSubresourceLayout_params params; - NTSTATUS status; - params.device = device; - params.image = image; - params.pSubresource = pSubresource; - params.pLayout = pLayout; - status = UNIX_CALL(vkGetImageSubresourceLayout, ¶ms); - assert(!status && "vkGetImageSubresourceLayout"); -} - -void WINAPI vkGetImageSubresourceLayout2(VkDevice device, VkImage image, const VkImageSubresource2 *pSubresource, VkSubresourceLayout2 *pLayout) -{ - struct vkGetImageSubresourceLayout2_params params; - NTSTATUS status; - params.device = device; - params.image = image; - params.pSubresource = pSubresource; - params.pLayout = pLayout; - status = UNIX_CALL(vkGetImageSubresourceLayout2, ¶ms); - assert(!status && "vkGetImageSubresourceLayout2"); -} - -void WINAPI vkGetImageSubresourceLayout2EXT(VkDevice device, VkImage image, const VkImageSubresource2 *pSubresource, VkSubresourceLayout2 *pLayout) -{ - struct vkGetImageSubresourceLayout2EXT_params params; - NTSTATUS status; - params.device = device; - params.image = image; - params.pSubresource = pSubresource; - params.pLayout = pLayout; - status = UNIX_CALL(vkGetImageSubresourceLayout2EXT, ¶ms); - assert(!status && "vkGetImageSubresourceLayout2EXT"); -} - -void WINAPI vkGetImageSubresourceLayout2KHR(VkDevice device, VkImage image, const VkImageSubresource2 *pSubresource, VkSubresourceLayout2 *pLayout) -{ - struct vkGetImageSubresourceLayout2KHR_params params; - NTSTATUS status; - params.device = device; - params.image = image; - params.pSubresource = pSubresource; - params.pLayout = pLayout; - status = UNIX_CALL(vkGetImageSubresourceLayout2KHR, ¶ms); - assert(!status && "vkGetImageSubresourceLayout2KHR"); -} - -VkResult WINAPI vkGetImageViewAddressNVX(VkDevice device, VkImageView imageView, VkImageViewAddressPropertiesNVX *pProperties) -{ - struct vkGetImageViewAddressNVX_params params; - NTSTATUS status; - params.device = device; - params.imageView = imageView; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetImageViewAddressNVX, ¶ms); - assert(!status && "vkGetImageViewAddressNVX"); - return params.result; -} - -uint64_t WINAPI vkGetImageViewHandle64NVX(VkDevice device, const VkImageViewHandleInfoNVX *pInfo) -{ - struct vkGetImageViewHandle64NVX_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetImageViewHandle64NVX, ¶ms); - assert(!status && "vkGetImageViewHandle64NVX"); - return params.result; -} - -uint32_t WINAPI vkGetImageViewHandleNVX(VkDevice device, const VkImageViewHandleInfoNVX *pInfo) -{ - struct vkGetImageViewHandleNVX_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetImageViewHandleNVX, ¶ms); - assert(!status && "vkGetImageViewHandleNVX"); - return params.result; -} - -VkResult WINAPI vkGetImageViewOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkImageViewCaptureDescriptorDataInfoEXT *pInfo, void *pData) -{ - struct vkGetImageViewOpaqueCaptureDescriptorDataEXT_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pData = pData; - status = UNIX_CALL(vkGetImageViewOpaqueCaptureDescriptorDataEXT, ¶ms); - assert(!status && "vkGetImageViewOpaqueCaptureDescriptorDataEXT"); - return params.result; -} - -void WINAPI vkGetLatencyTimingsNV(VkDevice device, VkSwapchainKHR swapchain, VkGetLatencyMarkerInfoNV *pLatencyMarkerInfo) -{ - struct vkGetLatencyTimingsNV_params params; - NTSTATUS status; - params.device = device; - params.swapchain = swapchain; - params.pLatencyMarkerInfo = pLatencyMarkerInfo; - status = UNIX_CALL(vkGetLatencyTimingsNV, ¶ms); - assert(!status && "vkGetLatencyTimingsNV"); -} - -VkResult WINAPI vkGetMemoryHostPointerPropertiesEXT(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void *pHostPointer, VkMemoryHostPointerPropertiesEXT *pMemoryHostPointerProperties) -{ - struct vkGetMemoryHostPointerPropertiesEXT_params params; - NTSTATUS status; - params.device = device; - params.handleType = handleType; - params.pHostPointer = pHostPointer; - params.pMemoryHostPointerProperties = pMemoryHostPointerProperties; - status = UNIX_CALL(vkGetMemoryHostPointerPropertiesEXT, ¶ms); - assert(!status && "vkGetMemoryHostPointerPropertiesEXT"); - return params.result; -} - -void WINAPI vkGetMicromapBuildSizesEXT(VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, const VkMicromapBuildInfoEXT *pBuildInfo, VkMicromapBuildSizesInfoEXT *pSizeInfo) -{ - struct vkGetMicromapBuildSizesEXT_params params; - NTSTATUS status; - params.device = device; - params.buildType = buildType; - params.pBuildInfo = pBuildInfo; - params.pSizeInfo = pSizeInfo; - status = UNIX_CALL(vkGetMicromapBuildSizesEXT, ¶ms); - assert(!status && "vkGetMicromapBuildSizesEXT"); -} - -VkResult WINAPI vkGetPerformanceParameterINTEL(VkDevice device, VkPerformanceParameterTypeINTEL parameter, VkPerformanceValueINTEL *pValue) -{ - struct vkGetPerformanceParameterINTEL_params params; - NTSTATUS status; - params.device = device; - params.parameter = parameter; - params.pValue = pValue; - status = UNIX_CALL(vkGetPerformanceParameterINTEL, ¶ms); - assert(!status && "vkGetPerformanceParameterINTEL"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice physicalDevice, uint32_t *pTimeDomainCount, VkTimeDomainKHR *pTimeDomains) -{ - struct vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pTimeDomainCount = pTimeDomainCount; - params.pTimeDomains = pTimeDomains; - status = UNIX_CALL(vkGetPhysicalDeviceCalibrateableTimeDomainsEXT, ¶ms); - assert(!status && "vkGetPhysicalDeviceCalibrateableTimeDomainsEXT"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceCalibrateableTimeDomainsKHR(VkPhysicalDevice physicalDevice, uint32_t *pTimeDomainCount, VkTimeDomainKHR *pTimeDomains) -{ - struct vkGetPhysicalDeviceCalibrateableTimeDomainsKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pTimeDomainCount = pTimeDomainCount; - params.pTimeDomains = pTimeDomains; - status = UNIX_CALL(vkGetPhysicalDeviceCalibrateableTimeDomainsKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceCalibrateableTimeDomainsKHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkCooperativeMatrixFlexibleDimensionsPropertiesNV *pProperties) -{ - struct vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pPropertyCount = pPropertyCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV, ¶ms); - assert(!status && "vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkCooperativeMatrixPropertiesKHR *pProperties) -{ - struct vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pPropertyCount = pPropertyCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceCooperativeMatrixPropertiesNV(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkCooperativeMatrixPropertiesNV *pProperties) -{ - struct vkGetPhysicalDeviceCooperativeMatrixPropertiesNV_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pPropertyCount = pPropertyCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetPhysicalDeviceCooperativeMatrixPropertiesNV, ¶ms); - assert(!status && "vkGetPhysicalDeviceCooperativeMatrixPropertiesNV"); - return params.result; -} - -void WINAPI vkGetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, VkExternalBufferProperties *pExternalBufferProperties) -{ - struct vkGetPhysicalDeviceExternalBufferProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pExternalBufferInfo = pExternalBufferInfo; - params.pExternalBufferProperties = pExternalBufferProperties; - status = UNIX_CALL(vkGetPhysicalDeviceExternalBufferProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceExternalBufferProperties"); -} - -void WINAPI vkGetPhysicalDeviceExternalBufferPropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, VkExternalBufferProperties *pExternalBufferProperties) -{ - struct vkGetPhysicalDeviceExternalBufferPropertiesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pExternalBufferInfo = pExternalBufferInfo; - params.pExternalBufferProperties = pExternalBufferProperties; - status = UNIX_CALL(vkGetPhysicalDeviceExternalBufferPropertiesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceExternalBufferPropertiesKHR"); -} - -void WINAPI vkGetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties) -{ - struct vkGetPhysicalDeviceExternalFenceProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pExternalFenceInfo = pExternalFenceInfo; - params.pExternalFenceProperties = pExternalFenceProperties; - status = UNIX_CALL(vkGetPhysicalDeviceExternalFenceProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceExternalFenceProperties"); -} - -void WINAPI vkGetPhysicalDeviceExternalFencePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties) -{ - struct vkGetPhysicalDeviceExternalFencePropertiesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pExternalFenceInfo = pExternalFenceInfo; - params.pExternalFenceProperties = pExternalFenceProperties; - status = UNIX_CALL(vkGetPhysicalDeviceExternalFencePropertiesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceExternalFencePropertiesKHR"); -} - -void WINAPI vkGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties) -{ - struct vkGetPhysicalDeviceExternalSemaphoreProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pExternalSemaphoreInfo = pExternalSemaphoreInfo; - params.pExternalSemaphoreProperties = pExternalSemaphoreProperties; - status = UNIX_CALL(vkGetPhysicalDeviceExternalSemaphoreProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceExternalSemaphoreProperties"); -} - -void WINAPI vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties) -{ - struct vkGetPhysicalDeviceExternalSemaphorePropertiesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pExternalSemaphoreInfo = pExternalSemaphoreInfo; - params.pExternalSemaphoreProperties = pExternalSemaphoreProperties; - status = UNIX_CALL(vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR"); -} - -void WINAPI vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures *pFeatures) -{ - struct vkGetPhysicalDeviceFeatures_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pFeatures = pFeatures; - status = UNIX_CALL(vkGetPhysicalDeviceFeatures, ¶ms); - assert(!status && "vkGetPhysicalDeviceFeatures"); -} - -void WINAPI vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2 *pFeatures) -{ - struct vkGetPhysicalDeviceFeatures2_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pFeatures = pFeatures; - status = UNIX_CALL(vkGetPhysicalDeviceFeatures2, ¶ms); - assert(!status && "vkGetPhysicalDeviceFeatures2"); -} - -void WINAPI vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2 *pFeatures) -{ - struct vkGetPhysicalDeviceFeatures2KHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pFeatures = pFeatures; - status = UNIX_CALL(vkGetPhysicalDeviceFeatures2KHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceFeatures2KHR"); -} - -void WINAPI vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties *pFormatProperties) -{ - struct vkGetPhysicalDeviceFormatProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.format = format; - params.pFormatProperties = pFormatProperties; - status = UNIX_CALL(vkGetPhysicalDeviceFormatProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceFormatProperties"); -} - -void WINAPI vkGetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2 *pFormatProperties) -{ - struct vkGetPhysicalDeviceFormatProperties2_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.format = format; - params.pFormatProperties = pFormatProperties; - status = UNIX_CALL(vkGetPhysicalDeviceFormatProperties2, ¶ms); - assert(!status && "vkGetPhysicalDeviceFormatProperties2"); -} - -void WINAPI vkGetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2 *pFormatProperties) -{ - struct vkGetPhysicalDeviceFormatProperties2KHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.format = format; - params.pFormatProperties = pFormatProperties; - status = UNIX_CALL(vkGetPhysicalDeviceFormatProperties2KHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceFormatProperties2KHR"); -} - -VkResult WINAPI vkGetPhysicalDeviceFragmentShadingRatesKHR(VkPhysicalDevice physicalDevice, uint32_t *pFragmentShadingRateCount, VkPhysicalDeviceFragmentShadingRateKHR *pFragmentShadingRates) -{ - struct vkGetPhysicalDeviceFragmentShadingRatesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pFragmentShadingRateCount = pFragmentShadingRateCount; - params.pFragmentShadingRates = pFragmentShadingRates; - status = UNIX_CALL(vkGetPhysicalDeviceFragmentShadingRatesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceFragmentShadingRatesKHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties *pImageFormatProperties) -{ - struct vkGetPhysicalDeviceImageFormatProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.format = format; - params.type = type; - params.tiling = tiling; - params.usage = usage; - params.flags = flags; - params.pImageFormatProperties = pImageFormatProperties; - status = UNIX_CALL(vkGetPhysicalDeviceImageFormatProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceImageFormatProperties"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties) -{ - struct vkGetPhysicalDeviceImageFormatProperties2_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pImageFormatInfo = pImageFormatInfo; - params.pImageFormatProperties = pImageFormatProperties; - status = UNIX_CALL(vkGetPhysicalDeviceImageFormatProperties2, ¶ms); - assert(!status && "vkGetPhysicalDeviceImageFormatProperties2"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties) -{ - struct vkGetPhysicalDeviceImageFormatProperties2KHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pImageFormatInfo = pImageFormatInfo; - params.pImageFormatProperties = pImageFormatProperties; - status = UNIX_CALL(vkGetPhysicalDeviceImageFormatProperties2KHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceImageFormatProperties2KHR"); - return params.result; -} - -void WINAPI vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties *pMemoryProperties) -{ - struct vkGetPhysicalDeviceMemoryProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pMemoryProperties = pMemoryProperties; - status = UNIX_CALL(vkGetPhysicalDeviceMemoryProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceMemoryProperties"); -} - -void WINAPI vkGetPhysicalDeviceMemoryProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2 *pMemoryProperties) -{ - struct vkGetPhysicalDeviceMemoryProperties2_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pMemoryProperties = pMemoryProperties; - status = UNIX_CALL(vkGetPhysicalDeviceMemoryProperties2, ¶ms); - assert(!status && "vkGetPhysicalDeviceMemoryProperties2"); -} - -void WINAPI vkGetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2 *pMemoryProperties) -{ - struct vkGetPhysicalDeviceMemoryProperties2KHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pMemoryProperties = pMemoryProperties; - status = UNIX_CALL(vkGetPhysicalDeviceMemoryProperties2KHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceMemoryProperties2KHR"); -} - -void WINAPI vkGetPhysicalDeviceMultisamplePropertiesEXT(VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT *pMultisampleProperties) -{ - struct vkGetPhysicalDeviceMultisamplePropertiesEXT_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.samples = samples; - params.pMultisampleProperties = pMultisampleProperties; - status = UNIX_CALL(vkGetPhysicalDeviceMultisamplePropertiesEXT, ¶ms); - assert(!status && "vkGetPhysicalDeviceMultisamplePropertiesEXT"); -} - -VkResult WINAPI vkGetPhysicalDeviceOpticalFlowImageFormatsNV(VkPhysicalDevice physicalDevice, const VkOpticalFlowImageFormatInfoNV *pOpticalFlowImageFormatInfo, uint32_t *pFormatCount, VkOpticalFlowImageFormatPropertiesNV *pImageFormatProperties) -{ - struct vkGetPhysicalDeviceOpticalFlowImageFormatsNV_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pOpticalFlowImageFormatInfo = pOpticalFlowImageFormatInfo; - params.pFormatCount = pFormatCount; - params.pImageFormatProperties = pImageFormatProperties; - status = UNIX_CALL(vkGetPhysicalDeviceOpticalFlowImageFormatsNV, ¶ms); - assert(!status && "vkGetPhysicalDeviceOpticalFlowImageFormatsNV"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pRectCount, VkRect2D *pRects) -{ - struct vkGetPhysicalDevicePresentRectanglesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.surface = surface; - params.pRectCount = pRectCount; - params.pRects = pRects; - status = UNIX_CALL(vkGetPhysicalDevicePresentRectanglesKHR, ¶ms); - assert(!status && "vkGetPhysicalDevicePresentRectanglesKHR"); - return params.result; -} - -void WINAPI vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties) -{ - struct vkGetPhysicalDeviceProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetPhysicalDeviceProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceProperties"); -} - -void WINAPI vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(VkPhysicalDevice physicalDevice, const VkQueryPoolPerformanceCreateInfoKHR *pPerformanceQueryCreateInfo, uint32_t *pNumPasses) -{ - struct vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pPerformanceQueryCreateInfo = pPerformanceQueryCreateInfo; - params.pNumPasses = pNumPasses; - status = UNIX_CALL(vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR"); -} - -void WINAPI vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties *pQueueFamilyProperties) -{ - struct vkGetPhysicalDeviceQueueFamilyProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pQueueFamilyPropertyCount = pQueueFamilyPropertyCount; - params.pQueueFamilyProperties = pQueueFamilyProperties; - status = UNIX_CALL(vkGetPhysicalDeviceQueueFamilyProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceQueueFamilyProperties"); -} - -void WINAPI vkGetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties2 *pQueueFamilyProperties) -{ - struct vkGetPhysicalDeviceQueueFamilyProperties2_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pQueueFamilyPropertyCount = pQueueFamilyPropertyCount; - params.pQueueFamilyProperties = pQueueFamilyProperties; - status = UNIX_CALL(vkGetPhysicalDeviceQueueFamilyProperties2, ¶ms); - assert(!status && "vkGetPhysicalDeviceQueueFamilyProperties2"); -} - -void WINAPI vkGetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties2 *pQueueFamilyProperties) -{ - struct vkGetPhysicalDeviceQueueFamilyProperties2KHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pQueueFamilyPropertyCount = pQueueFamilyPropertyCount; - params.pQueueFamilyProperties = pQueueFamilyProperties; - status = UNIX_CALL(vkGetPhysicalDeviceQueueFamilyProperties2KHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceQueueFamilyProperties2KHR"); -} - -void WINAPI vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t *pPropertyCount, VkSparseImageFormatProperties *pProperties) -{ - struct vkGetPhysicalDeviceSparseImageFormatProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.format = format; - params.type = type; - params.samples = samples; - params.usage = usage; - params.tiling = tiling; - params.pPropertyCount = pPropertyCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetPhysicalDeviceSparseImageFormatProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceSparseImageFormatProperties"); -} - -void WINAPI vkGetPhysicalDeviceSparseImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *pFormatInfo, uint32_t *pPropertyCount, VkSparseImageFormatProperties2 *pProperties) -{ - struct vkGetPhysicalDeviceSparseImageFormatProperties2_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pFormatInfo = pFormatInfo; - params.pPropertyCount = pPropertyCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetPhysicalDeviceSparseImageFormatProperties2, ¶ms); - assert(!status && "vkGetPhysicalDeviceSparseImageFormatProperties2"); -} - -void WINAPI vkGetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *pFormatInfo, uint32_t *pPropertyCount, VkSparseImageFormatProperties2 *pProperties) -{ - struct vkGetPhysicalDeviceSparseImageFormatProperties2KHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pFormatInfo = pFormatInfo; - params.pPropertyCount = pPropertyCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetPhysicalDeviceSparseImageFormatProperties2KHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceSparseImageFormatProperties2KHR"); -} - -VkResult WINAPI vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(VkPhysicalDevice physicalDevice, uint32_t *pCombinationCount, VkFramebufferMixedSamplesCombinationNV *pCombinations) -{ - struct vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pCombinationCount = pCombinationCount; - params.pCombinations = pCombinations; - status = UNIX_CALL(vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV, ¶ms); - assert(!status && "vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, VkSurfaceCapabilities2KHR *pSurfaceCapabilities) -{ - struct vkGetPhysicalDeviceSurfaceCapabilities2KHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pSurfaceInfo = pSurfaceInfo; - params.pSurfaceCapabilities = pSurfaceCapabilities; - status = UNIX_CALL(vkGetPhysicalDeviceSurfaceCapabilities2KHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceSurfaceCapabilities2KHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *pSurfaceCapabilities) -{ - struct vkGetPhysicalDeviceSurfaceCapabilitiesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.surface = surface; - params.pSurfaceCapabilities = pSurfaceCapabilities; - status = UNIX_CALL(vkGetPhysicalDeviceSurfaceCapabilitiesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceSurfaceCapabilitiesKHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, uint32_t *pSurfaceFormatCount, VkSurfaceFormat2KHR *pSurfaceFormats) -{ - struct vkGetPhysicalDeviceSurfaceFormats2KHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pSurfaceInfo = pSurfaceInfo; - params.pSurfaceFormatCount = pSurfaceFormatCount; - params.pSurfaceFormats = pSurfaceFormats; - status = UNIX_CALL(vkGetPhysicalDeviceSurfaceFormats2KHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceSurfaceFormats2KHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats) -{ - struct vkGetPhysicalDeviceSurfaceFormatsKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.surface = surface; - params.pSurfaceFormatCount = pSurfaceFormatCount; - params.pSurfaceFormats = pSurfaceFormats; - status = UNIX_CALL(vkGetPhysicalDeviceSurfaceFormatsKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceSurfaceFormatsKHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes) -{ - struct vkGetPhysicalDeviceSurfacePresentModesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.surface = surface; - params.pPresentModeCount = pPresentModeCount; - params.pPresentModes = pPresentModes; - status = UNIX_CALL(vkGetPhysicalDeviceSurfacePresentModesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceSurfacePresentModesKHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32 *pSupported) -{ - struct vkGetPhysicalDeviceSurfaceSupportKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.queueFamilyIndex = queueFamilyIndex; - params.surface = surface; - params.pSupported = pSupported; - status = UNIX_CALL(vkGetPhysicalDeviceSurfaceSupportKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceSurfaceSupportKHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceToolProperties(VkPhysicalDevice physicalDevice, uint32_t *pToolCount, VkPhysicalDeviceToolProperties *pToolProperties) -{ - struct vkGetPhysicalDeviceToolProperties_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pToolCount = pToolCount; - params.pToolProperties = pToolProperties; - status = UNIX_CALL(vkGetPhysicalDeviceToolProperties, ¶ms); - assert(!status && "vkGetPhysicalDeviceToolProperties"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceToolPropertiesEXT(VkPhysicalDevice physicalDevice, uint32_t *pToolCount, VkPhysicalDeviceToolProperties *pToolProperties) -{ - struct vkGetPhysicalDeviceToolPropertiesEXT_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pToolCount = pToolCount; - params.pToolProperties = pToolProperties; - status = UNIX_CALL(vkGetPhysicalDeviceToolPropertiesEXT, ¶ms); - assert(!status && "vkGetPhysicalDeviceToolPropertiesEXT"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceVideoCapabilitiesKHR(VkPhysicalDevice physicalDevice, const VkVideoProfileInfoKHR *pVideoProfile, VkVideoCapabilitiesKHR *pCapabilities) -{ - struct vkGetPhysicalDeviceVideoCapabilitiesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pVideoProfile = pVideoProfile; - params.pCapabilities = pCapabilities; - status = UNIX_CALL(vkGetPhysicalDeviceVideoCapabilitiesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceVideoCapabilitiesKHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR *pQualityLevelInfo, VkVideoEncodeQualityLevelPropertiesKHR *pQualityLevelProperties) -{ - struct vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pQualityLevelInfo = pQualityLevelInfo; - params.pQualityLevelProperties = pQualityLevelProperties; - status = UNIX_CALL(vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR"); - return params.result; -} - -VkResult WINAPI vkGetPhysicalDeviceVideoFormatPropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceVideoFormatInfoKHR *pVideoFormatInfo, uint32_t *pVideoFormatPropertyCount, VkVideoFormatPropertiesKHR *pVideoFormatProperties) -{ - struct vkGetPhysicalDeviceVideoFormatPropertiesKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.pVideoFormatInfo = pVideoFormatInfo; - params.pVideoFormatPropertyCount = pVideoFormatPropertyCount; - params.pVideoFormatProperties = pVideoFormatProperties; - status = UNIX_CALL(vkGetPhysicalDeviceVideoFormatPropertiesKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceVideoFormatPropertiesKHR"); - return params.result; -} - -VkBool32 WINAPI vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex) -{ - struct vkGetPhysicalDeviceWin32PresentationSupportKHR_params params; - NTSTATUS status; - params.physicalDevice = physicalDevice; - params.queueFamilyIndex = queueFamilyIndex; - status = UNIX_CALL(vkGetPhysicalDeviceWin32PresentationSupportKHR, ¶ms); - assert(!status && "vkGetPhysicalDeviceWin32PresentationSupportKHR"); - return params.result; -} - -VkResult WINAPI vkGetPipelineBinaryDataKHR(VkDevice device, const VkPipelineBinaryDataInfoKHR *pInfo, VkPipelineBinaryKeyKHR *pPipelineBinaryKey, size_t *pPipelineBinaryDataSize, void *pPipelineBinaryData) -{ - struct vkGetPipelineBinaryDataKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pPipelineBinaryKey = pPipelineBinaryKey; - params.pPipelineBinaryDataSize = pPipelineBinaryDataSize; - params.pPipelineBinaryData = pPipelineBinaryData; - status = UNIX_CALL(vkGetPipelineBinaryDataKHR, ¶ms); - assert(!status && "vkGetPipelineBinaryDataKHR"); - return params.result; -} - -VkResult WINAPI vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t *pDataSize, void *pData) -{ - struct vkGetPipelineCacheData_params params; - NTSTATUS status; - params.device = device; - params.pipelineCache = pipelineCache; - params.pDataSize = pDataSize; - params.pData = pData; - status = UNIX_CALL(vkGetPipelineCacheData, ¶ms); - assert(!status && "vkGetPipelineCacheData"); - return params.result; -} - -VkResult WINAPI vkGetPipelineExecutableInternalRepresentationsKHR(VkDevice device, const VkPipelineExecutableInfoKHR *pExecutableInfo, uint32_t *pInternalRepresentationCount, VkPipelineExecutableInternalRepresentationKHR *pInternalRepresentations) -{ - struct vkGetPipelineExecutableInternalRepresentationsKHR_params params; - NTSTATUS status; - params.device = device; - params.pExecutableInfo = pExecutableInfo; - params.pInternalRepresentationCount = pInternalRepresentationCount; - params.pInternalRepresentations = pInternalRepresentations; - status = UNIX_CALL(vkGetPipelineExecutableInternalRepresentationsKHR, ¶ms); - assert(!status && "vkGetPipelineExecutableInternalRepresentationsKHR"); - return params.result; -} - -VkResult WINAPI vkGetPipelineExecutablePropertiesKHR(VkDevice device, const VkPipelineInfoKHR *pPipelineInfo, uint32_t *pExecutableCount, VkPipelineExecutablePropertiesKHR *pProperties) -{ - struct vkGetPipelineExecutablePropertiesKHR_params params; - NTSTATUS status; - params.device = device; - params.pPipelineInfo = pPipelineInfo; - params.pExecutableCount = pExecutableCount; - params.pProperties = pProperties; - status = UNIX_CALL(vkGetPipelineExecutablePropertiesKHR, ¶ms); - assert(!status && "vkGetPipelineExecutablePropertiesKHR"); - return params.result; -} - -VkResult WINAPI vkGetPipelineExecutableStatisticsKHR(VkDevice device, const VkPipelineExecutableInfoKHR *pExecutableInfo, uint32_t *pStatisticCount, VkPipelineExecutableStatisticKHR *pStatistics) -{ - struct vkGetPipelineExecutableStatisticsKHR_params params; - NTSTATUS status; - params.device = device; - params.pExecutableInfo = pExecutableInfo; - params.pStatisticCount = pStatisticCount; - params.pStatistics = pStatistics; - status = UNIX_CALL(vkGetPipelineExecutableStatisticsKHR, ¶ms); - assert(!status && "vkGetPipelineExecutableStatisticsKHR"); - return params.result; -} - -VkDeviceAddress WINAPI vkGetPipelineIndirectDeviceAddressNV(VkDevice device, const VkPipelineIndirectDeviceAddressInfoNV *pInfo) -{ - struct vkGetPipelineIndirectDeviceAddressNV_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetPipelineIndirectDeviceAddressNV, ¶ms); - assert(!status && "vkGetPipelineIndirectDeviceAddressNV"); - return params.result; -} - -void WINAPI vkGetPipelineIndirectMemoryRequirementsNV(VkDevice device, const VkComputePipelineCreateInfo *pCreateInfo, VkMemoryRequirements2 *pMemoryRequirements) -{ - struct vkGetPipelineIndirectMemoryRequirementsNV_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetPipelineIndirectMemoryRequirementsNV, ¶ms); - assert(!status && "vkGetPipelineIndirectMemoryRequirementsNV"); -} - -VkResult WINAPI vkGetPipelineKeyKHR(VkDevice device, const VkPipelineCreateInfoKHR *pPipelineCreateInfo, VkPipelineBinaryKeyKHR *pPipelineKey) -{ - struct vkGetPipelineKeyKHR_params params; - NTSTATUS status; - params.device = device; - params.pPipelineCreateInfo = pPipelineCreateInfo; - params.pPipelineKey = pPipelineKey; - status = UNIX_CALL(vkGetPipelineKeyKHR, ¶ms); - assert(!status && "vkGetPipelineKeyKHR"); - return params.result; -} - -VkResult WINAPI vkGetPipelinePropertiesEXT(VkDevice device, const VkPipelineInfoEXT *pPipelineInfo, VkBaseOutStructure *pPipelineProperties) -{ - struct vkGetPipelinePropertiesEXT_params params; - NTSTATUS status; - params.device = device; - params.pPipelineInfo = pPipelineInfo; - params.pPipelineProperties = pPipelineProperties; - status = UNIX_CALL(vkGetPipelinePropertiesEXT, ¶ms); - assert(!status && "vkGetPipelinePropertiesEXT"); - return params.result; -} - -void WINAPI vkGetPrivateData(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t *pData) -{ - struct vkGetPrivateData_params params; - NTSTATUS status; - params.device = device; - params.objectType = objectType; - params.objectHandle = objectHandle; - params.privateDataSlot = privateDataSlot; - params.pData = pData; - status = UNIX_CALL(vkGetPrivateData, ¶ms); - assert(!status && "vkGetPrivateData"); -} - -void WINAPI vkGetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t *pData) -{ - struct vkGetPrivateDataEXT_params params; - NTSTATUS status; - params.device = device; - params.objectType = objectType; - params.objectHandle = objectHandle; - params.privateDataSlot = privateDataSlot; - params.pData = pData; - status = UNIX_CALL(vkGetPrivateDataEXT, ¶ms); - assert(!status && "vkGetPrivateDataEXT"); -} - -VkResult WINAPI vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void *pData, VkDeviceSize stride, VkQueryResultFlags flags) -{ - struct vkGetQueryPoolResults_params params; - NTSTATUS status; - params.device = device; - params.queryPool = queryPool; - params.firstQuery = firstQuery; - params.queryCount = queryCount; - params.dataSize = dataSize; - params.pData = pData; - params.stride = stride; - params.flags = flags; - status = UNIX_CALL(vkGetQueryPoolResults, ¶ms); - assert(!status && "vkGetQueryPoolResults"); - return params.result; -} - -void WINAPI vkGetQueueCheckpointData2NV(VkQueue queue, uint32_t *pCheckpointDataCount, VkCheckpointData2NV *pCheckpointData) -{ - struct vkGetQueueCheckpointData2NV_params params; - NTSTATUS status; - params.queue = queue; - params.pCheckpointDataCount = pCheckpointDataCount; - params.pCheckpointData = pCheckpointData; - status = UNIX_CALL(vkGetQueueCheckpointData2NV, ¶ms); - assert(!status && "vkGetQueueCheckpointData2NV"); -} - -void WINAPI vkGetQueueCheckpointDataNV(VkQueue queue, uint32_t *pCheckpointDataCount, VkCheckpointDataNV *pCheckpointData) -{ - struct vkGetQueueCheckpointDataNV_params params; - NTSTATUS status; - params.queue = queue; - params.pCheckpointDataCount = pCheckpointDataCount; - params.pCheckpointData = pCheckpointData; - status = UNIX_CALL(vkGetQueueCheckpointDataNV, ¶ms); - assert(!status && "vkGetQueueCheckpointDataNV"); -} - -VkResult WINAPI vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void *pData) -{ - struct vkGetRayTracingCaptureReplayShaderGroupHandlesKHR_params params; - NTSTATUS status; - params.device = device; - params.pipeline = pipeline; - params.firstGroup = firstGroup; - params.groupCount = groupCount; - params.dataSize = dataSize; - params.pData = pData; - status = UNIX_CALL(vkGetRayTracingCaptureReplayShaderGroupHandlesKHR, ¶ms); - assert(!status && "vkGetRayTracingCaptureReplayShaderGroupHandlesKHR"); - return params.result; -} - -VkResult WINAPI vkGetRayTracingShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void *pData) -{ - struct vkGetRayTracingShaderGroupHandlesKHR_params params; - NTSTATUS status; - params.device = device; - params.pipeline = pipeline; - params.firstGroup = firstGroup; - params.groupCount = groupCount; - params.dataSize = dataSize; - params.pData = pData; - status = UNIX_CALL(vkGetRayTracingShaderGroupHandlesKHR, ¶ms); - assert(!status && "vkGetRayTracingShaderGroupHandlesKHR"); - return params.result; -} - -VkResult WINAPI vkGetRayTracingShaderGroupHandlesNV(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void *pData) -{ - struct vkGetRayTracingShaderGroupHandlesNV_params params; - NTSTATUS status; - params.device = device; - params.pipeline = pipeline; - params.firstGroup = firstGroup; - params.groupCount = groupCount; - params.dataSize = dataSize; - params.pData = pData; - status = UNIX_CALL(vkGetRayTracingShaderGroupHandlesNV, ¶ms); - assert(!status && "vkGetRayTracingShaderGroupHandlesNV"); - return params.result; -} - -VkDeviceSize WINAPI vkGetRayTracingShaderGroupStackSizeKHR(VkDevice device, VkPipeline pipeline, uint32_t group, VkShaderGroupShaderKHR groupShader) -{ - struct vkGetRayTracingShaderGroupStackSizeKHR_params params; - NTSTATUS status; - params.device = device; - params.pipeline = pipeline; - params.group = group; - params.groupShader = groupShader; - status = UNIX_CALL(vkGetRayTracingShaderGroupStackSizeKHR, ¶ms); - assert(!status && "vkGetRayTracingShaderGroupStackSizeKHR"); - return params.result; -} - -void WINAPI vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D *pGranularity) -{ - struct vkGetRenderAreaGranularity_params params; - NTSTATUS status; - params.device = device; - params.renderPass = renderPass; - params.pGranularity = pGranularity; - status = UNIX_CALL(vkGetRenderAreaGranularity, ¶ms); - assert(!status && "vkGetRenderAreaGranularity"); -} - -void WINAPI vkGetRenderingAreaGranularity(VkDevice device, const VkRenderingAreaInfo *pRenderingAreaInfo, VkExtent2D *pGranularity) -{ - struct vkGetRenderingAreaGranularity_params params; - NTSTATUS status; - params.device = device; - params.pRenderingAreaInfo = pRenderingAreaInfo; - params.pGranularity = pGranularity; - status = UNIX_CALL(vkGetRenderingAreaGranularity, ¶ms); - assert(!status && "vkGetRenderingAreaGranularity"); -} - -void WINAPI vkGetRenderingAreaGranularityKHR(VkDevice device, const VkRenderingAreaInfo *pRenderingAreaInfo, VkExtent2D *pGranularity) -{ - struct vkGetRenderingAreaGranularityKHR_params params; - NTSTATUS status; - params.device = device; - params.pRenderingAreaInfo = pRenderingAreaInfo; - params.pGranularity = pGranularity; - status = UNIX_CALL(vkGetRenderingAreaGranularityKHR, ¶ms); - assert(!status && "vkGetRenderingAreaGranularityKHR"); -} - -VkResult WINAPI vkGetSamplerOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkSamplerCaptureDescriptorDataInfoEXT *pInfo, void *pData) -{ - struct vkGetSamplerOpaqueCaptureDescriptorDataEXT_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pData = pData; - status = UNIX_CALL(vkGetSamplerOpaqueCaptureDescriptorDataEXT, ¶ms); - assert(!status && "vkGetSamplerOpaqueCaptureDescriptorDataEXT"); - return params.result; -} - -VkResult WINAPI vkGetSemaphoreCounterValue(VkDevice device, VkSemaphore semaphore, uint64_t *pValue) -{ - struct vkGetSemaphoreCounterValue_params params; - NTSTATUS status; - params.device = device; - params.semaphore = semaphore; - params.pValue = pValue; - status = UNIX_CALL(vkGetSemaphoreCounterValue, ¶ms); - assert(!status && "vkGetSemaphoreCounterValue"); - return params.result; -} - -VkResult WINAPI vkGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore semaphore, uint64_t *pValue) -{ - struct vkGetSemaphoreCounterValueKHR_params params; - NTSTATUS status; - params.device = device; - params.semaphore = semaphore; - params.pValue = pValue; - status = UNIX_CALL(vkGetSemaphoreCounterValueKHR, ¶ms); - assert(!status && "vkGetSemaphoreCounterValueKHR"); - return params.result; -} - -VkResult WINAPI vkGetShaderBinaryDataEXT(VkDevice device, VkShaderEXT shader, size_t *pDataSize, void *pData) -{ - struct vkGetShaderBinaryDataEXT_params params; - NTSTATUS status; - params.device = device; - params.shader = shader; - params.pDataSize = pDataSize; - params.pData = pData; - status = UNIX_CALL(vkGetShaderBinaryDataEXT, ¶ms); - assert(!status && "vkGetShaderBinaryDataEXT"); - return params.result; -} - -VkResult WINAPI vkGetShaderInfoAMD(VkDevice device, VkPipeline pipeline, VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType, size_t *pInfoSize, void *pInfo) -{ - struct vkGetShaderInfoAMD_params params; - NTSTATUS status; - params.device = device; - params.pipeline = pipeline; - params.shaderStage = shaderStage; - params.infoType = infoType; - params.pInfoSize = pInfoSize; - params.pInfo = pInfo; - status = UNIX_CALL(vkGetShaderInfoAMD, ¶ms); - assert(!status && "vkGetShaderInfoAMD"); - return params.result; -} - -void WINAPI vkGetShaderModuleCreateInfoIdentifierEXT(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo, VkShaderModuleIdentifierEXT *pIdentifier) -{ - struct vkGetShaderModuleCreateInfoIdentifierEXT_params params; - NTSTATUS status; - params.device = device; - params.pCreateInfo = pCreateInfo; - params.pIdentifier = pIdentifier; - status = UNIX_CALL(vkGetShaderModuleCreateInfoIdentifierEXT, ¶ms); - assert(!status && "vkGetShaderModuleCreateInfoIdentifierEXT"); -} - -void WINAPI vkGetShaderModuleIdentifierEXT(VkDevice device, VkShaderModule shaderModule, VkShaderModuleIdentifierEXT *pIdentifier) -{ - struct vkGetShaderModuleIdentifierEXT_params params; - NTSTATUS status; - params.device = device; - params.shaderModule = shaderModule; - params.pIdentifier = pIdentifier; - status = UNIX_CALL(vkGetShaderModuleIdentifierEXT, ¶ms); - assert(!status && "vkGetShaderModuleIdentifierEXT"); -} - -VkResult WINAPI vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pSwapchainImageCount, VkImage *pSwapchainImages) -{ - struct vkGetSwapchainImagesKHR_params params; - NTSTATUS status; - params.device = device; - params.swapchain = swapchain; - params.pSwapchainImageCount = pSwapchainImageCount; - params.pSwapchainImages = pSwapchainImages; - status = UNIX_CALL(vkGetSwapchainImagesKHR, ¶ms); - assert(!status && "vkGetSwapchainImagesKHR"); - return params.result; -} - -VkResult WINAPI vkGetValidationCacheDataEXT(VkDevice device, VkValidationCacheEXT validationCache, size_t *pDataSize, void *pData) -{ - struct vkGetValidationCacheDataEXT_params params; - NTSTATUS status; - params.device = device; - params.validationCache = validationCache; - params.pDataSize = pDataSize; - params.pData = pData; - status = UNIX_CALL(vkGetValidationCacheDataEXT, ¶ms); - assert(!status && "vkGetValidationCacheDataEXT"); - return params.result; -} - -VkResult WINAPI vkGetVideoSessionMemoryRequirementsKHR(VkDevice device, VkVideoSessionKHR videoSession, uint32_t *pMemoryRequirementsCount, VkVideoSessionMemoryRequirementsKHR *pMemoryRequirements) -{ - struct vkGetVideoSessionMemoryRequirementsKHR_params params; - NTSTATUS status; - params.device = device; - params.videoSession = videoSession; - params.pMemoryRequirementsCount = pMemoryRequirementsCount; - params.pMemoryRequirements = pMemoryRequirements; - status = UNIX_CALL(vkGetVideoSessionMemoryRequirementsKHR, ¶ms); - assert(!status && "vkGetVideoSessionMemoryRequirementsKHR"); - return params.result; -} - -VkResult WINAPI vkInitializePerformanceApiINTEL(VkDevice device, const VkInitializePerformanceApiInfoINTEL *pInitializeInfo) -{ - struct vkInitializePerformanceApiINTEL_params params; - NTSTATUS status; - params.device = device; - params.pInitializeInfo = pInitializeInfo; - status = UNIX_CALL(vkInitializePerformanceApiINTEL, ¶ms); - assert(!status && "vkInitializePerformanceApiINTEL"); - return params.result; -} - -VkResult WINAPI vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange *pMemoryRanges) -{ - struct vkInvalidateMappedMemoryRanges_params params; - NTSTATUS status; - params.device = device; - params.memoryRangeCount = memoryRangeCount; - params.pMemoryRanges = pMemoryRanges; - status = UNIX_CALL(vkInvalidateMappedMemoryRanges, ¶ms); - assert(!status && "vkInvalidateMappedMemoryRanges"); - return params.result; -} - -VkResult WINAPI vkLatencySleepNV(VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepInfoNV *pSleepInfo) -{ - struct vkLatencySleepNV_params params; - NTSTATUS status; - params.device = device; - params.swapchain = swapchain; - params.pSleepInfo = pSleepInfo; - status = UNIX_CALL(vkLatencySleepNV, ¶ms); - assert(!status && "vkLatencySleepNV"); - return params.result; -} - -VkResult WINAPI vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void **ppData) -{ - struct vkMapMemory_params params; - NTSTATUS status; - params.device = device; - params.memory = memory; - params.offset = offset; - params.size = size; - params.flags = flags; - params.ppData = ppData; - status = UNIX_CALL(vkMapMemory, ¶ms); - assert(!status && "vkMapMemory"); - return params.result; -} - -VkResult WINAPI vkMapMemory2(VkDevice device, const VkMemoryMapInfo *pMemoryMapInfo, void **ppData) -{ - struct vkMapMemory2_params params; - NTSTATUS status; - params.device = device; - params.pMemoryMapInfo = pMemoryMapInfo; - params.ppData = ppData; - status = UNIX_CALL(vkMapMemory2, ¶ms); - assert(!status && "vkMapMemory2"); - return params.result; -} - -VkResult WINAPI vkMapMemory2KHR(VkDevice device, const VkMemoryMapInfo *pMemoryMapInfo, void **ppData) -{ - struct vkMapMemory2KHR_params params; - NTSTATUS status; - params.device = device; - params.pMemoryMapInfo = pMemoryMapInfo; - params.ppData = ppData; - status = UNIX_CALL(vkMapMemory2KHR, ¶ms); - assert(!status && "vkMapMemory2KHR"); - return params.result; -} - -VkResult WINAPI vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache *pSrcCaches) -{ - struct vkMergePipelineCaches_params params; - NTSTATUS status; - params.device = device; - params.dstCache = dstCache; - params.srcCacheCount = srcCacheCount; - params.pSrcCaches = pSrcCaches; - status = UNIX_CALL(vkMergePipelineCaches, ¶ms); - assert(!status && "vkMergePipelineCaches"); - return params.result; -} - -VkResult WINAPI vkMergeValidationCachesEXT(VkDevice device, VkValidationCacheEXT dstCache, uint32_t srcCacheCount, const VkValidationCacheEXT *pSrcCaches) -{ - struct vkMergeValidationCachesEXT_params params; - NTSTATUS status; - params.device = device; - params.dstCache = dstCache; - params.srcCacheCount = srcCacheCount; - params.pSrcCaches = pSrcCaches; - status = UNIX_CALL(vkMergeValidationCachesEXT, ¶ms); - assert(!status && "vkMergeValidationCachesEXT"); - return params.result; -} - -void WINAPI vkQueueBeginDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT *pLabelInfo) -{ - struct vkQueueBeginDebugUtilsLabelEXT_params params; - NTSTATUS status; - params.queue = queue; - params.pLabelInfo = pLabelInfo; - status = UNIX_CALL(vkQueueBeginDebugUtilsLabelEXT, ¶ms); - assert(!status && "vkQueueBeginDebugUtilsLabelEXT"); -} - -VkResult WINAPI vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo *pBindInfo, VkFence fence) -{ - struct vkQueueBindSparse_params params; - NTSTATUS status; - params.queue = queue; - params.bindInfoCount = bindInfoCount; - params.pBindInfo = pBindInfo; - params.fence = fence; - status = UNIX_CALL(vkQueueBindSparse, ¶ms); - assert(!status && "vkQueueBindSparse"); - return params.result; -} - -void WINAPI vkQueueEndDebugUtilsLabelEXT(VkQueue queue) -{ - struct vkQueueEndDebugUtilsLabelEXT_params params; - NTSTATUS status; - params.queue = queue; - status = UNIX_CALL(vkQueueEndDebugUtilsLabelEXT, ¶ms); - assert(!status && "vkQueueEndDebugUtilsLabelEXT"); -} - -void WINAPI vkQueueInsertDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT *pLabelInfo) -{ - struct vkQueueInsertDebugUtilsLabelEXT_params params; - NTSTATUS status; - params.queue = queue; - params.pLabelInfo = pLabelInfo; - status = UNIX_CALL(vkQueueInsertDebugUtilsLabelEXT, ¶ms); - assert(!status && "vkQueueInsertDebugUtilsLabelEXT"); -} - -void WINAPI vkQueueNotifyOutOfBandNV(VkQueue queue, const VkOutOfBandQueueTypeInfoNV *pQueueTypeInfo) -{ - struct vkQueueNotifyOutOfBandNV_params params; - NTSTATUS status; - params.queue = queue; - params.pQueueTypeInfo = pQueueTypeInfo; - status = UNIX_CALL(vkQueueNotifyOutOfBandNV, ¶ms); - assert(!status && "vkQueueNotifyOutOfBandNV"); -} - -VkResult WINAPI vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo) -{ - struct vkQueuePresentKHR_params params; - NTSTATUS status; - params.queue = queue; - params.pPresentInfo = pPresentInfo; - status = UNIX_CALL(vkQueuePresentKHR, ¶ms); - assert(!status && "vkQueuePresentKHR"); - return params.result; -} - -VkResult WINAPI vkQueueSetPerformanceConfigurationINTEL(VkQueue queue, VkPerformanceConfigurationINTEL configuration) -{ - struct vkQueueSetPerformanceConfigurationINTEL_params params; - NTSTATUS status; - params.queue = queue; - params.configuration = configuration; - status = UNIX_CALL(vkQueueSetPerformanceConfigurationINTEL, ¶ms); - assert(!status && "vkQueueSetPerformanceConfigurationINTEL"); - return params.result; -} - -VkResult WINAPI vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence) -{ - struct vkQueueSubmit_params params; - NTSTATUS status; - params.queue = queue; - params.submitCount = submitCount; - params.pSubmits = pSubmits; - params.fence = fence; - status = UNIX_CALL(vkQueueSubmit, ¶ms); - assert(!status && "vkQueueSubmit"); - return params.result; -} - -VkResult WINAPI vkQueueSubmit2(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2 *pSubmits, VkFence fence) -{ - struct vkQueueSubmit2_params params; - NTSTATUS status; - params.queue = queue; - params.submitCount = submitCount; - params.pSubmits = pSubmits; - params.fence = fence; - status = UNIX_CALL(vkQueueSubmit2, ¶ms); - assert(!status && "vkQueueSubmit2"); - return params.result; -} - -VkResult WINAPI vkQueueSubmit2KHR(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2 *pSubmits, VkFence fence) -{ - struct vkQueueSubmit2KHR_params params; - NTSTATUS status; - params.queue = queue; - params.submitCount = submitCount; - params.pSubmits = pSubmits; - params.fence = fence; - status = UNIX_CALL(vkQueueSubmit2KHR, ¶ms); - assert(!status && "vkQueueSubmit2KHR"); - return params.result; -} - -VkResult WINAPI vkQueueWaitIdle(VkQueue queue) -{ - struct vkQueueWaitIdle_params params; - NTSTATUS status; - params.queue = queue; - status = UNIX_CALL(vkQueueWaitIdle, ¶ms); - assert(!status && "vkQueueWaitIdle"); - return params.result; -} - -VkResult WINAPI vkReleaseCapturedPipelineDataKHR(VkDevice device, const VkReleaseCapturedPipelineDataInfoKHR *pInfo, const VkAllocationCallbacks *pAllocator) -{ - struct vkReleaseCapturedPipelineDataKHR_params params; - NTSTATUS status; - params.device = device; - params.pInfo = pInfo; - params.pAllocator = pAllocator; - status = UNIX_CALL(vkReleaseCapturedPipelineDataKHR, ¶ms); - assert(!status && "vkReleaseCapturedPipelineDataKHR"); - return params.result; -} - -VkResult WINAPI vkReleasePerformanceConfigurationINTEL(VkDevice device, VkPerformanceConfigurationINTEL configuration) -{ - struct vkReleasePerformanceConfigurationINTEL_params params; - NTSTATUS status; - params.device = device; - params.configuration = configuration; - status = UNIX_CALL(vkReleasePerformanceConfigurationINTEL, ¶ms); - assert(!status && "vkReleasePerformanceConfigurationINTEL"); - return params.result; -} - -void WINAPI vkReleaseProfilingLockKHR(VkDevice device) -{ - struct vkReleaseProfilingLockKHR_params params; - NTSTATUS status; - params.device = device; - status = UNIX_CALL(vkReleaseProfilingLockKHR, ¶ms); - assert(!status && "vkReleaseProfilingLockKHR"); -} - -VkResult WINAPI vkReleaseSwapchainImagesEXT(VkDevice device, const VkReleaseSwapchainImagesInfoEXT *pReleaseInfo) -{ - struct vkReleaseSwapchainImagesEXT_params params; - NTSTATUS status; - params.device = device; - params.pReleaseInfo = pReleaseInfo; - status = UNIX_CALL(vkReleaseSwapchainImagesEXT, ¶ms); - assert(!status && "vkReleaseSwapchainImagesEXT"); - return params.result; -} - -VkResult WINAPI vkResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags) -{ - struct vkResetCommandBuffer_params params; - NTSTATUS status; - params.commandBuffer = commandBuffer; - params.flags = flags; - status = UNIX_CALL(vkResetCommandBuffer, ¶ms); - assert(!status && "vkResetCommandBuffer"); - return params.result; -} - -VkResult WINAPI vkResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags) -{ - struct vkResetCommandPool_params params; - NTSTATUS status; - params.device = device; - params.commandPool = commandPool; - params.flags = flags; - status = UNIX_CALL(vkResetCommandPool, ¶ms); - assert(!status && "vkResetCommandPool"); - return params.result; -} - -VkResult WINAPI vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags) -{ - struct vkResetDescriptorPool_params params; - NTSTATUS status; - params.device = device; - params.descriptorPool = descriptorPool; - params.flags = flags; - status = UNIX_CALL(vkResetDescriptorPool, ¶ms); - assert(!status && "vkResetDescriptorPool"); - return params.result; -} - -VkResult WINAPI vkResetEvent(VkDevice device, VkEvent event) -{ - struct vkResetEvent_params params; - NTSTATUS status; - params.device = device; - params.event = event; - status = UNIX_CALL(vkResetEvent, ¶ms); - assert(!status && "vkResetEvent"); - return params.result; -} - -VkResult WINAPI vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences) -{ - struct vkResetFences_params params; - NTSTATUS status; - params.device = device; - params.fenceCount = fenceCount; - params.pFences = pFences; - status = UNIX_CALL(vkResetFences, ¶ms); - assert(!status && "vkResetFences"); - return params.result; -} - -void WINAPI vkResetQueryPool(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) -{ - struct vkResetQueryPool_params params; - NTSTATUS status; - params.device = device; - params.queryPool = queryPool; - params.firstQuery = firstQuery; - params.queryCount = queryCount; - status = UNIX_CALL(vkResetQueryPool, ¶ms); - assert(!status && "vkResetQueryPool"); -} - -void WINAPI vkResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) -{ - struct vkResetQueryPoolEXT_params params; - NTSTATUS status; - params.device = device; - params.queryPool = queryPool; - params.firstQuery = firstQuery; - params.queryCount = queryCount; - status = UNIX_CALL(vkResetQueryPoolEXT, ¶ms); - assert(!status && "vkResetQueryPoolEXT"); -} - -VkResult WINAPI vkSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT *pNameInfo) -{ - struct vkSetDebugUtilsObjectNameEXT_params params; - NTSTATUS status; - params.device = device; - params.pNameInfo = pNameInfo; - status = UNIX_CALL(vkSetDebugUtilsObjectNameEXT, ¶ms); - assert(!status && "vkSetDebugUtilsObjectNameEXT"); - return params.result; -} - -VkResult WINAPI vkSetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT *pTagInfo) -{ - struct vkSetDebugUtilsObjectTagEXT_params params; - NTSTATUS status; - params.device = device; - params.pTagInfo = pTagInfo; - status = UNIX_CALL(vkSetDebugUtilsObjectTagEXT, ¶ms); - assert(!status && "vkSetDebugUtilsObjectTagEXT"); - return params.result; -} - -void WINAPI vkSetDeviceMemoryPriorityEXT(VkDevice device, VkDeviceMemory memory, float priority) -{ - struct vkSetDeviceMemoryPriorityEXT_params params; - NTSTATUS status; - params.device = device; - params.memory = memory; - params.priority = priority; - status = UNIX_CALL(vkSetDeviceMemoryPriorityEXT, ¶ms); - assert(!status && "vkSetDeviceMemoryPriorityEXT"); -} - -VkResult WINAPI vkSetEvent(VkDevice device, VkEvent event) -{ - struct vkSetEvent_params params; - NTSTATUS status; - params.device = device; - params.event = event; - status = UNIX_CALL(vkSetEvent, ¶ms); - assert(!status && "vkSetEvent"); - return params.result; -} - -void WINAPI vkSetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR *pSwapchains, const VkHdrMetadataEXT *pMetadata) -{ - struct vkSetHdrMetadataEXT_params params; - NTSTATUS status; - params.device = device; - params.swapchainCount = swapchainCount; - params.pSwapchains = pSwapchains; - params.pMetadata = pMetadata; - status = UNIX_CALL(vkSetHdrMetadataEXT, ¶ms); - assert(!status && "vkSetHdrMetadataEXT"); -} - -void WINAPI vkSetLatencyMarkerNV(VkDevice device, VkSwapchainKHR swapchain, const VkSetLatencyMarkerInfoNV *pLatencyMarkerInfo) -{ - struct vkSetLatencyMarkerNV_params params; - NTSTATUS status; - params.device = device; - params.swapchain = swapchain; - params.pLatencyMarkerInfo = pLatencyMarkerInfo; - status = UNIX_CALL(vkSetLatencyMarkerNV, ¶ms); - assert(!status && "vkSetLatencyMarkerNV"); -} - -VkResult WINAPI vkSetLatencySleepModeNV(VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepModeInfoNV *pSleepModeInfo) -{ - struct vkSetLatencySleepModeNV_params params; - NTSTATUS status; - params.device = device; - params.swapchain = swapchain; - params.pSleepModeInfo = pSleepModeInfo; - status = UNIX_CALL(vkSetLatencySleepModeNV, ¶ms); - assert(!status && "vkSetLatencySleepModeNV"); - return params.result; -} - -VkResult WINAPI vkSetPrivateData(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t data) -{ - struct vkSetPrivateData_params params; - NTSTATUS status; - params.device = device; - params.objectType = objectType; - params.objectHandle = objectHandle; - params.privateDataSlot = privateDataSlot; - params.data = data; - status = UNIX_CALL(vkSetPrivateData, ¶ms); - assert(!status && "vkSetPrivateData"); - return params.result; -} - -VkResult WINAPI vkSetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t data) -{ - struct vkSetPrivateDataEXT_params params; - NTSTATUS status; - params.device = device; - params.objectType = objectType; - params.objectHandle = objectHandle; - params.privateDataSlot = privateDataSlot; - params.data = data; - status = UNIX_CALL(vkSetPrivateDataEXT, ¶ms); - assert(!status && "vkSetPrivateDataEXT"); - return params.result; -} - -VkResult WINAPI vkSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo *pSignalInfo) -{ - struct vkSignalSemaphore_params params; - NTSTATUS status; - params.device = device; - params.pSignalInfo = pSignalInfo; - status = UNIX_CALL(vkSignalSemaphore, ¶ms); - assert(!status && "vkSignalSemaphore"); - return params.result; -} - -VkResult WINAPI vkSignalSemaphoreKHR(VkDevice device, const VkSemaphoreSignalInfo *pSignalInfo) -{ - struct vkSignalSemaphoreKHR_params params; - NTSTATUS status; - params.device = device; - params.pSignalInfo = pSignalInfo; - status = UNIX_CALL(vkSignalSemaphoreKHR, ¶ms); - assert(!status && "vkSignalSemaphoreKHR"); - return params.result; -} - -void WINAPI vkSubmitDebugUtilsMessageEXT(VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData) -{ - struct vkSubmitDebugUtilsMessageEXT_params params; - NTSTATUS status; - params.instance = instance; - params.messageSeverity = messageSeverity; - params.messageTypes = messageTypes; - params.pCallbackData = pCallbackData; - status = UNIX_CALL(vkSubmitDebugUtilsMessageEXT, ¶ms); - assert(!status && "vkSubmitDebugUtilsMessageEXT"); -} - -VkResult WINAPI vkTransitionImageLayout(VkDevice device, uint32_t transitionCount, const VkHostImageLayoutTransitionInfo *pTransitions) -{ - struct vkTransitionImageLayout_params params; - NTSTATUS status; - params.device = device; - params.transitionCount = transitionCount; - params.pTransitions = pTransitions; - status = UNIX_CALL(vkTransitionImageLayout, ¶ms); - assert(!status && "vkTransitionImageLayout"); - return params.result; -} - -VkResult WINAPI vkTransitionImageLayoutEXT(VkDevice device, uint32_t transitionCount, const VkHostImageLayoutTransitionInfo *pTransitions) -{ - struct vkTransitionImageLayoutEXT_params params; - NTSTATUS status; - params.device = device; - params.transitionCount = transitionCount; - params.pTransitions = pTransitions; - status = UNIX_CALL(vkTransitionImageLayoutEXT, ¶ms); - assert(!status && "vkTransitionImageLayoutEXT"); - return params.result; -} - -void WINAPI vkTrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags) -{ - struct vkTrimCommandPool_params params; - NTSTATUS status; - params.device = device; - params.commandPool = commandPool; - params.flags = flags; - status = UNIX_CALL(vkTrimCommandPool, ¶ms); - assert(!status && "vkTrimCommandPool"); -} - -void WINAPI vkTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags) -{ - struct vkTrimCommandPoolKHR_params params; - NTSTATUS status; - params.device = device; - params.commandPool = commandPool; - params.flags = flags; - status = UNIX_CALL(vkTrimCommandPoolKHR, ¶ms); - assert(!status && "vkTrimCommandPoolKHR"); -} - -void WINAPI vkUninitializePerformanceApiINTEL(VkDevice device) -{ - struct vkUninitializePerformanceApiINTEL_params params; - NTSTATUS status; - params.device = device; - status = UNIX_CALL(vkUninitializePerformanceApiINTEL, ¶ms); - assert(!status && "vkUninitializePerformanceApiINTEL"); -} - -void WINAPI vkUnmapMemory(VkDevice device, VkDeviceMemory memory) -{ - struct vkUnmapMemory_params params; - NTSTATUS status; - params.device = device; - params.memory = memory; - status = UNIX_CALL(vkUnmapMemory, ¶ms); - assert(!status && "vkUnmapMemory"); -} - -VkResult WINAPI vkUnmapMemory2(VkDevice device, const VkMemoryUnmapInfo *pMemoryUnmapInfo) -{ - struct vkUnmapMemory2_params params; - NTSTATUS status; - params.device = device; - params.pMemoryUnmapInfo = pMemoryUnmapInfo; - status = UNIX_CALL(vkUnmapMemory2, ¶ms); - assert(!status && "vkUnmapMemory2"); - return params.result; -} - -VkResult WINAPI vkUnmapMemory2KHR(VkDevice device, const VkMemoryUnmapInfo *pMemoryUnmapInfo) -{ - struct vkUnmapMemory2KHR_params params; - NTSTATUS status; - params.device = device; - params.pMemoryUnmapInfo = pMemoryUnmapInfo; - status = UNIX_CALL(vkUnmapMemory2KHR, ¶ms); - assert(!status && "vkUnmapMemory2KHR"); - return params.result; -} - -void WINAPI vkUpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void *pData) -{ - struct vkUpdateDescriptorSetWithTemplate_params params; - params.device = device; - params.descriptorSet = descriptorSet; - params.descriptorUpdateTemplate = descriptorUpdateTemplate; - params.pData = pData; - UNIX_CALL(vkUpdateDescriptorSetWithTemplate, ¶ms); -} - -void WINAPI vkUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void *pData) -{ - struct vkUpdateDescriptorSetWithTemplateKHR_params params; - NTSTATUS status; - params.device = device; - params.descriptorSet = descriptorSet; - params.descriptorUpdateTemplate = descriptorUpdateTemplate; - params.pData = pData; - status = UNIX_CALL(vkUpdateDescriptorSetWithTemplateKHR, ¶ms); - assert(!status && "vkUpdateDescriptorSetWithTemplateKHR"); -} - -void WINAPI vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet *pDescriptorCopies) -{ - struct vkUpdateDescriptorSets_params params; - params.device = device; - params.descriptorWriteCount = descriptorWriteCount; - params.pDescriptorWrites = pDescriptorWrites; - params.descriptorCopyCount = descriptorCopyCount; - params.pDescriptorCopies = pDescriptorCopies; - UNIX_CALL(vkUpdateDescriptorSets, ¶ms); -} - -void WINAPI vkUpdateIndirectExecutionSetPipelineEXT(VkDevice device, VkIndirectExecutionSetEXT indirectExecutionSet, uint32_t executionSetWriteCount, const VkWriteIndirectExecutionSetPipelineEXT *pExecutionSetWrites) -{ - struct vkUpdateIndirectExecutionSetPipelineEXT_params params; - NTSTATUS status; - params.device = device; - params.indirectExecutionSet = indirectExecutionSet; - params.executionSetWriteCount = executionSetWriteCount; - params.pExecutionSetWrites = pExecutionSetWrites; - status = UNIX_CALL(vkUpdateIndirectExecutionSetPipelineEXT, ¶ms); - assert(!status && "vkUpdateIndirectExecutionSetPipelineEXT"); -} - -void WINAPI vkUpdateIndirectExecutionSetShaderEXT(VkDevice device, VkIndirectExecutionSetEXT indirectExecutionSet, uint32_t executionSetWriteCount, const VkWriteIndirectExecutionSetShaderEXT *pExecutionSetWrites) -{ - struct vkUpdateIndirectExecutionSetShaderEXT_params params; - NTSTATUS status; - params.device = device; - params.indirectExecutionSet = indirectExecutionSet; - params.executionSetWriteCount = executionSetWriteCount; - params.pExecutionSetWrites = pExecutionSetWrites; - status = UNIX_CALL(vkUpdateIndirectExecutionSetShaderEXT, ¶ms); - assert(!status && "vkUpdateIndirectExecutionSetShaderEXT"); -} - -VkResult WINAPI vkUpdateVideoSessionParametersKHR(VkDevice device, VkVideoSessionParametersKHR videoSessionParameters, const VkVideoSessionParametersUpdateInfoKHR *pUpdateInfo) -{ - struct vkUpdateVideoSessionParametersKHR_params params; - NTSTATUS status; - params.device = device; - params.videoSessionParameters = videoSessionParameters; - params.pUpdateInfo = pUpdateInfo; - status = UNIX_CALL(vkUpdateVideoSessionParametersKHR, ¶ms); - assert(!status && "vkUpdateVideoSessionParametersKHR"); - return params.result; -} - -VkResult WINAPI vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences, VkBool32 waitAll, uint64_t timeout) -{ - struct vkWaitForFences_params params; - NTSTATUS status; - params.device = device; - params.fenceCount = fenceCount; - params.pFences = pFences; - params.waitAll = waitAll; - params.timeout = timeout; - status = UNIX_CALL(vkWaitForFences, ¶ms); - assert(!status && "vkWaitForFences"); - return params.result; -} - -VkResult WINAPI vkWaitForPresentKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t presentId, uint64_t timeout) -{ - struct vkWaitForPresentKHR_params params; - NTSTATUS status; - params.device = device; - params.swapchain = swapchain; - params.presentId = presentId; - params.timeout = timeout; - status = UNIX_CALL(vkWaitForPresentKHR, ¶ms); - assert(!status && "vkWaitForPresentKHR"); - return params.result; -} - -VkResult WINAPI vkWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo *pWaitInfo, uint64_t timeout) -{ - struct vkWaitSemaphores_params params; - NTSTATUS status; - params.device = device; - params.pWaitInfo = pWaitInfo; - params.timeout = timeout; - status = UNIX_CALL(vkWaitSemaphores, ¶ms); - assert(!status && "vkWaitSemaphores"); - return params.result; -} - -VkResult WINAPI vkWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfo *pWaitInfo, uint64_t timeout) -{ - struct vkWaitSemaphoresKHR_params params; - NTSTATUS status; - params.device = device; - params.pWaitInfo = pWaitInfo; - params.timeout = timeout; - status = UNIX_CALL(vkWaitSemaphoresKHR, ¶ms); - assert(!status && "vkWaitSemaphoresKHR"); - return params.result; -} - -VkResult WINAPI vkWriteAccelerationStructuresPropertiesKHR(VkDevice device, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR *pAccelerationStructures, VkQueryType queryType, size_t dataSize, void *pData, size_t stride) -{ - struct vkWriteAccelerationStructuresPropertiesKHR_params params; - NTSTATUS status; - params.device = device; - params.accelerationStructureCount = accelerationStructureCount; - params.pAccelerationStructures = pAccelerationStructures; - params.queryType = queryType; - params.dataSize = dataSize; - params.pData = pData; - params.stride = stride; - status = UNIX_CALL(vkWriteAccelerationStructuresPropertiesKHR, ¶ms); - assert(!status && "vkWriteAccelerationStructuresPropertiesKHR"); - return params.result; -} - -VkResult WINAPI vkWriteMicromapsPropertiesEXT(VkDevice device, uint32_t micromapCount, const VkMicromapEXT *pMicromaps, VkQueryType queryType, size_t dataSize, void *pData, size_t stride) -{ - struct vkWriteMicromapsPropertiesEXT_params params; - NTSTATUS status; - params.device = device; - params.micromapCount = micromapCount; - params.pMicromaps = pMicromaps; - params.queryType = queryType; - params.dataSize = dataSize; - params.pData = pData; - params.stride = stride; - status = UNIX_CALL(vkWriteMicromapsPropertiesEXT, ¶ms); - assert(!status && "vkWriteMicromapsPropertiesEXT"); - return params.result; -} - -static const struct vulkan_func vk_device_dispatch_table[] = -{ - {"vkAcquireNextImage2KHR", vkAcquireNextImage2KHR}, - {"vkAcquireNextImageKHR", vkAcquireNextImageKHR}, - {"vkAcquirePerformanceConfigurationINTEL", vkAcquirePerformanceConfigurationINTEL}, - {"vkAcquireProfilingLockKHR", vkAcquireProfilingLockKHR}, - {"vkAllocateCommandBuffers", vkAllocateCommandBuffers}, - {"vkAllocateDescriptorSets", vkAllocateDescriptorSets}, - {"vkAllocateMemory", vkAllocateMemory}, - {"vkAntiLagUpdateAMD", vkAntiLagUpdateAMD}, - {"vkBeginCommandBuffer", vkBeginCommandBuffer}, - {"vkBindAccelerationStructureMemoryNV", vkBindAccelerationStructureMemoryNV}, - {"vkBindBufferMemory", vkBindBufferMemory}, - {"vkBindBufferMemory2", vkBindBufferMemory2}, - {"vkBindBufferMemory2KHR", vkBindBufferMemory2KHR}, - {"vkBindImageMemory", vkBindImageMemory}, - {"vkBindImageMemory2", vkBindImageMemory2}, - {"vkBindImageMemory2KHR", vkBindImageMemory2KHR}, - {"vkBindOpticalFlowSessionImageNV", vkBindOpticalFlowSessionImageNV}, - {"vkBindVideoSessionMemoryKHR", vkBindVideoSessionMemoryKHR}, - {"vkBuildAccelerationStructuresKHR", vkBuildAccelerationStructuresKHR}, - {"vkBuildMicromapsEXT", vkBuildMicromapsEXT}, - {"vkCmdBeginConditionalRenderingEXT", vkCmdBeginConditionalRenderingEXT}, - {"vkCmdBeginDebugUtilsLabelEXT", vkCmdBeginDebugUtilsLabelEXT}, - {"vkCmdBeginQuery", vkCmdBeginQuery}, - {"vkCmdBeginQueryIndexedEXT", vkCmdBeginQueryIndexedEXT}, - {"vkCmdBeginRenderPass", vkCmdBeginRenderPass}, - {"vkCmdBeginRenderPass2", vkCmdBeginRenderPass2}, - {"vkCmdBeginRenderPass2KHR", vkCmdBeginRenderPass2KHR}, - {"vkCmdBeginRendering", vkCmdBeginRendering}, - {"vkCmdBeginRenderingKHR", vkCmdBeginRenderingKHR}, - {"vkCmdBeginTransformFeedbackEXT", vkCmdBeginTransformFeedbackEXT}, - {"vkCmdBeginVideoCodingKHR", vkCmdBeginVideoCodingKHR}, - {"vkCmdBindDescriptorBufferEmbeddedSamplers2EXT", vkCmdBindDescriptorBufferEmbeddedSamplers2EXT}, - {"vkCmdBindDescriptorBufferEmbeddedSamplersEXT", vkCmdBindDescriptorBufferEmbeddedSamplersEXT}, - {"vkCmdBindDescriptorBuffersEXT", vkCmdBindDescriptorBuffersEXT}, - {"vkCmdBindDescriptorSets", vkCmdBindDescriptorSets}, - {"vkCmdBindDescriptorSets2", vkCmdBindDescriptorSets2}, - {"vkCmdBindDescriptorSets2KHR", vkCmdBindDescriptorSets2KHR}, - {"vkCmdBindIndexBuffer", vkCmdBindIndexBuffer}, - {"vkCmdBindIndexBuffer2", vkCmdBindIndexBuffer2}, - {"vkCmdBindIndexBuffer2KHR", vkCmdBindIndexBuffer2KHR}, - {"vkCmdBindInvocationMaskHUAWEI", vkCmdBindInvocationMaskHUAWEI}, - {"vkCmdBindPipeline", vkCmdBindPipeline}, - {"vkCmdBindPipelineShaderGroupNV", vkCmdBindPipelineShaderGroupNV}, - {"vkCmdBindShadersEXT", vkCmdBindShadersEXT}, - {"vkCmdBindShadingRateImageNV", vkCmdBindShadingRateImageNV}, - {"vkCmdBindTransformFeedbackBuffersEXT", vkCmdBindTransformFeedbackBuffersEXT}, - {"vkCmdBindVertexBuffers", vkCmdBindVertexBuffers}, - {"vkCmdBindVertexBuffers2", vkCmdBindVertexBuffers2}, - {"vkCmdBindVertexBuffers2EXT", vkCmdBindVertexBuffers2EXT}, - {"vkCmdBlitImage", vkCmdBlitImage}, - {"vkCmdBlitImage2", vkCmdBlitImage2}, - {"vkCmdBlitImage2KHR", vkCmdBlitImage2KHR}, - {"vkCmdBuildAccelerationStructureNV", vkCmdBuildAccelerationStructureNV}, - {"vkCmdBuildAccelerationStructuresIndirectKHR", vkCmdBuildAccelerationStructuresIndirectKHR}, - {"vkCmdBuildAccelerationStructuresKHR", vkCmdBuildAccelerationStructuresKHR}, - {"vkCmdBuildMicromapsEXT", vkCmdBuildMicromapsEXT}, - {"vkCmdClearAttachments", vkCmdClearAttachments}, - {"vkCmdClearColorImage", vkCmdClearColorImage}, - {"vkCmdClearDepthStencilImage", vkCmdClearDepthStencilImage}, - {"vkCmdControlVideoCodingKHR", vkCmdControlVideoCodingKHR}, - {"vkCmdCopyAccelerationStructureKHR", vkCmdCopyAccelerationStructureKHR}, - {"vkCmdCopyAccelerationStructureNV", vkCmdCopyAccelerationStructureNV}, - {"vkCmdCopyAccelerationStructureToMemoryKHR", vkCmdCopyAccelerationStructureToMemoryKHR}, - {"vkCmdCopyBuffer", vkCmdCopyBuffer}, - {"vkCmdCopyBuffer2", vkCmdCopyBuffer2}, - {"vkCmdCopyBuffer2KHR", vkCmdCopyBuffer2KHR}, - {"vkCmdCopyBufferToImage", vkCmdCopyBufferToImage}, - {"vkCmdCopyBufferToImage2", vkCmdCopyBufferToImage2}, - {"vkCmdCopyBufferToImage2KHR", vkCmdCopyBufferToImage2KHR}, - {"vkCmdCopyImage", vkCmdCopyImage}, - {"vkCmdCopyImage2", vkCmdCopyImage2}, - {"vkCmdCopyImage2KHR", vkCmdCopyImage2KHR}, - {"vkCmdCopyImageToBuffer", vkCmdCopyImageToBuffer}, - {"vkCmdCopyImageToBuffer2", vkCmdCopyImageToBuffer2}, - {"vkCmdCopyImageToBuffer2KHR", vkCmdCopyImageToBuffer2KHR}, - {"vkCmdCopyMemoryIndirectNV", vkCmdCopyMemoryIndirectNV}, - {"vkCmdCopyMemoryToAccelerationStructureKHR", vkCmdCopyMemoryToAccelerationStructureKHR}, - {"vkCmdCopyMemoryToImageIndirectNV", vkCmdCopyMemoryToImageIndirectNV}, - {"vkCmdCopyMemoryToMicromapEXT", vkCmdCopyMemoryToMicromapEXT}, - {"vkCmdCopyMicromapEXT", vkCmdCopyMicromapEXT}, - {"vkCmdCopyMicromapToMemoryEXT", vkCmdCopyMicromapToMemoryEXT}, - {"vkCmdCopyQueryPoolResults", vkCmdCopyQueryPoolResults}, - {"vkCmdCuLaunchKernelNVX", vkCmdCuLaunchKernelNVX}, - {"vkCmdCudaLaunchKernelNV", vkCmdCudaLaunchKernelNV}, - {"vkCmdDebugMarkerBeginEXT", vkCmdDebugMarkerBeginEXT}, - {"vkCmdDebugMarkerEndEXT", vkCmdDebugMarkerEndEXT}, - {"vkCmdDebugMarkerInsertEXT", vkCmdDebugMarkerInsertEXT}, - {"vkCmdDecodeVideoKHR", vkCmdDecodeVideoKHR}, - {"vkCmdDecompressMemoryIndirectCountNV", vkCmdDecompressMemoryIndirectCountNV}, - {"vkCmdDecompressMemoryNV", vkCmdDecompressMemoryNV}, - {"vkCmdDispatch", vkCmdDispatch}, - {"vkCmdDispatchBase", vkCmdDispatchBase}, - {"vkCmdDispatchBaseKHR", vkCmdDispatchBaseKHR}, - {"vkCmdDispatchIndirect", vkCmdDispatchIndirect}, - {"vkCmdDraw", vkCmdDraw}, - {"vkCmdDrawClusterHUAWEI", vkCmdDrawClusterHUAWEI}, - {"vkCmdDrawClusterIndirectHUAWEI", vkCmdDrawClusterIndirectHUAWEI}, - {"vkCmdDrawIndexed", vkCmdDrawIndexed}, - {"vkCmdDrawIndexedIndirect", vkCmdDrawIndexedIndirect}, - {"vkCmdDrawIndexedIndirectCount", vkCmdDrawIndexedIndirectCount}, - {"vkCmdDrawIndexedIndirectCountAMD", vkCmdDrawIndexedIndirectCountAMD}, - {"vkCmdDrawIndexedIndirectCountKHR", vkCmdDrawIndexedIndirectCountKHR}, - {"vkCmdDrawIndirect", vkCmdDrawIndirect}, - {"vkCmdDrawIndirectByteCountEXT", vkCmdDrawIndirectByteCountEXT}, - {"vkCmdDrawIndirectCount", vkCmdDrawIndirectCount}, - {"vkCmdDrawIndirectCountAMD", vkCmdDrawIndirectCountAMD}, - {"vkCmdDrawIndirectCountKHR", vkCmdDrawIndirectCountKHR}, - {"vkCmdDrawMeshTasksEXT", vkCmdDrawMeshTasksEXT}, - {"vkCmdDrawMeshTasksIndirectCountEXT", vkCmdDrawMeshTasksIndirectCountEXT}, - {"vkCmdDrawMeshTasksIndirectCountNV", vkCmdDrawMeshTasksIndirectCountNV}, - {"vkCmdDrawMeshTasksIndirectEXT", vkCmdDrawMeshTasksIndirectEXT}, - {"vkCmdDrawMeshTasksIndirectNV", vkCmdDrawMeshTasksIndirectNV}, - {"vkCmdDrawMeshTasksNV", vkCmdDrawMeshTasksNV}, - {"vkCmdDrawMultiEXT", vkCmdDrawMultiEXT}, - {"vkCmdDrawMultiIndexedEXT", vkCmdDrawMultiIndexedEXT}, - {"vkCmdEncodeVideoKHR", vkCmdEncodeVideoKHR}, - {"vkCmdEndConditionalRenderingEXT", vkCmdEndConditionalRenderingEXT}, - {"vkCmdEndDebugUtilsLabelEXT", vkCmdEndDebugUtilsLabelEXT}, - {"vkCmdEndQuery", vkCmdEndQuery}, - {"vkCmdEndQueryIndexedEXT", vkCmdEndQueryIndexedEXT}, - {"vkCmdEndRenderPass", vkCmdEndRenderPass}, - {"vkCmdEndRenderPass2", vkCmdEndRenderPass2}, - {"vkCmdEndRenderPass2KHR", vkCmdEndRenderPass2KHR}, - {"vkCmdEndRendering", vkCmdEndRendering}, - {"vkCmdEndRenderingKHR", vkCmdEndRenderingKHR}, - {"vkCmdEndTransformFeedbackEXT", vkCmdEndTransformFeedbackEXT}, - {"vkCmdEndVideoCodingKHR", vkCmdEndVideoCodingKHR}, - {"vkCmdExecuteCommands", vkCmdExecuteCommands}, - {"vkCmdExecuteGeneratedCommandsEXT", vkCmdExecuteGeneratedCommandsEXT}, - {"vkCmdExecuteGeneratedCommandsNV", vkCmdExecuteGeneratedCommandsNV}, - {"vkCmdFillBuffer", vkCmdFillBuffer}, - {"vkCmdInsertDebugUtilsLabelEXT", vkCmdInsertDebugUtilsLabelEXT}, - {"vkCmdNextSubpass", vkCmdNextSubpass}, - {"vkCmdNextSubpass2", vkCmdNextSubpass2}, - {"vkCmdNextSubpass2KHR", vkCmdNextSubpass2KHR}, - {"vkCmdOpticalFlowExecuteNV", vkCmdOpticalFlowExecuteNV}, - {"vkCmdPipelineBarrier", vkCmdPipelineBarrier}, - {"vkCmdPipelineBarrier2", vkCmdPipelineBarrier2}, - {"vkCmdPipelineBarrier2KHR", vkCmdPipelineBarrier2KHR}, - {"vkCmdPreprocessGeneratedCommandsEXT", vkCmdPreprocessGeneratedCommandsEXT}, - {"vkCmdPreprocessGeneratedCommandsNV", vkCmdPreprocessGeneratedCommandsNV}, - {"vkCmdPushConstants", vkCmdPushConstants}, - {"vkCmdPushConstants2", vkCmdPushConstants2}, - {"vkCmdPushConstants2KHR", vkCmdPushConstants2KHR}, - {"vkCmdPushDescriptorSet", vkCmdPushDescriptorSet}, - {"vkCmdPushDescriptorSet2", vkCmdPushDescriptorSet2}, - {"vkCmdPushDescriptorSet2KHR", vkCmdPushDescriptorSet2KHR}, - {"vkCmdPushDescriptorSetKHR", vkCmdPushDescriptorSetKHR}, - {"vkCmdPushDescriptorSetWithTemplate", vkCmdPushDescriptorSetWithTemplate}, - {"vkCmdPushDescriptorSetWithTemplate2", vkCmdPushDescriptorSetWithTemplate2}, - {"vkCmdPushDescriptorSetWithTemplate2KHR", vkCmdPushDescriptorSetWithTemplate2KHR}, - {"vkCmdPushDescriptorSetWithTemplateKHR", vkCmdPushDescriptorSetWithTemplateKHR}, - {"vkCmdResetEvent", vkCmdResetEvent}, - {"vkCmdResetEvent2", vkCmdResetEvent2}, - {"vkCmdResetEvent2KHR", vkCmdResetEvent2KHR}, - {"vkCmdResetQueryPool", vkCmdResetQueryPool}, - {"vkCmdResolveImage", vkCmdResolveImage}, - {"vkCmdResolveImage2", vkCmdResolveImage2}, - {"vkCmdResolveImage2KHR", vkCmdResolveImage2KHR}, - {"vkCmdSetAlphaToCoverageEnableEXT", vkCmdSetAlphaToCoverageEnableEXT}, - {"vkCmdSetAlphaToOneEnableEXT", vkCmdSetAlphaToOneEnableEXT}, - {"vkCmdSetAttachmentFeedbackLoopEnableEXT", vkCmdSetAttachmentFeedbackLoopEnableEXT}, - {"vkCmdSetBlendConstants", vkCmdSetBlendConstants}, - {"vkCmdSetCheckpointNV", vkCmdSetCheckpointNV}, - {"vkCmdSetCoarseSampleOrderNV", vkCmdSetCoarseSampleOrderNV}, - {"vkCmdSetColorBlendAdvancedEXT", vkCmdSetColorBlendAdvancedEXT}, - {"vkCmdSetColorBlendEnableEXT", vkCmdSetColorBlendEnableEXT}, - {"vkCmdSetColorBlendEquationEXT", vkCmdSetColorBlendEquationEXT}, - {"vkCmdSetColorWriteEnableEXT", vkCmdSetColorWriteEnableEXT}, - {"vkCmdSetColorWriteMaskEXT", vkCmdSetColorWriteMaskEXT}, - {"vkCmdSetConservativeRasterizationModeEXT", vkCmdSetConservativeRasterizationModeEXT}, - {"vkCmdSetCoverageModulationModeNV", vkCmdSetCoverageModulationModeNV}, - {"vkCmdSetCoverageModulationTableEnableNV", vkCmdSetCoverageModulationTableEnableNV}, - {"vkCmdSetCoverageModulationTableNV", vkCmdSetCoverageModulationTableNV}, - {"vkCmdSetCoverageReductionModeNV", vkCmdSetCoverageReductionModeNV}, - {"vkCmdSetCoverageToColorEnableNV", vkCmdSetCoverageToColorEnableNV}, - {"vkCmdSetCoverageToColorLocationNV", vkCmdSetCoverageToColorLocationNV}, - {"vkCmdSetCullMode", vkCmdSetCullMode}, - {"vkCmdSetCullModeEXT", vkCmdSetCullModeEXT}, - {"vkCmdSetDepthBias", vkCmdSetDepthBias}, - {"vkCmdSetDepthBias2EXT", vkCmdSetDepthBias2EXT}, - {"vkCmdSetDepthBiasEnable", vkCmdSetDepthBiasEnable}, - {"vkCmdSetDepthBiasEnableEXT", vkCmdSetDepthBiasEnableEXT}, - {"vkCmdSetDepthBounds", vkCmdSetDepthBounds}, - {"vkCmdSetDepthBoundsTestEnable", vkCmdSetDepthBoundsTestEnable}, - {"vkCmdSetDepthBoundsTestEnableEXT", vkCmdSetDepthBoundsTestEnableEXT}, - {"vkCmdSetDepthClampEnableEXT", vkCmdSetDepthClampEnableEXT}, - {"vkCmdSetDepthClampRangeEXT", vkCmdSetDepthClampRangeEXT}, - {"vkCmdSetDepthClipEnableEXT", vkCmdSetDepthClipEnableEXT}, - {"vkCmdSetDepthClipNegativeOneToOneEXT", vkCmdSetDepthClipNegativeOneToOneEXT}, - {"vkCmdSetDepthCompareOp", vkCmdSetDepthCompareOp}, - {"vkCmdSetDepthCompareOpEXT", vkCmdSetDepthCompareOpEXT}, - {"vkCmdSetDepthTestEnable", vkCmdSetDepthTestEnable}, - {"vkCmdSetDepthTestEnableEXT", vkCmdSetDepthTestEnableEXT}, - {"vkCmdSetDepthWriteEnable", vkCmdSetDepthWriteEnable}, - {"vkCmdSetDepthWriteEnableEXT", vkCmdSetDepthWriteEnableEXT}, - {"vkCmdSetDescriptorBufferOffsets2EXT", vkCmdSetDescriptorBufferOffsets2EXT}, - {"vkCmdSetDescriptorBufferOffsetsEXT", vkCmdSetDescriptorBufferOffsetsEXT}, - {"vkCmdSetDeviceMask", vkCmdSetDeviceMask}, - {"vkCmdSetDeviceMaskKHR", vkCmdSetDeviceMaskKHR}, - {"vkCmdSetDiscardRectangleEXT", vkCmdSetDiscardRectangleEXT}, - {"vkCmdSetDiscardRectangleEnableEXT", vkCmdSetDiscardRectangleEnableEXT}, - {"vkCmdSetDiscardRectangleModeEXT", vkCmdSetDiscardRectangleModeEXT}, - {"vkCmdSetEvent", vkCmdSetEvent}, - {"vkCmdSetEvent2", vkCmdSetEvent2}, - {"vkCmdSetEvent2KHR", vkCmdSetEvent2KHR}, - {"vkCmdSetExclusiveScissorEnableNV", vkCmdSetExclusiveScissorEnableNV}, - {"vkCmdSetExclusiveScissorNV", vkCmdSetExclusiveScissorNV}, - {"vkCmdSetExtraPrimitiveOverestimationSizeEXT", vkCmdSetExtraPrimitiveOverestimationSizeEXT}, - {"vkCmdSetFragmentShadingRateEnumNV", vkCmdSetFragmentShadingRateEnumNV}, - {"vkCmdSetFragmentShadingRateKHR", vkCmdSetFragmentShadingRateKHR}, - {"vkCmdSetFrontFace", vkCmdSetFrontFace}, - {"vkCmdSetFrontFaceEXT", vkCmdSetFrontFaceEXT}, - {"vkCmdSetLineRasterizationModeEXT", vkCmdSetLineRasterizationModeEXT}, - {"vkCmdSetLineStipple", vkCmdSetLineStipple}, - {"vkCmdSetLineStippleEXT", vkCmdSetLineStippleEXT}, - {"vkCmdSetLineStippleEnableEXT", vkCmdSetLineStippleEnableEXT}, - {"vkCmdSetLineStippleKHR", vkCmdSetLineStippleKHR}, - {"vkCmdSetLineWidth", vkCmdSetLineWidth}, - {"vkCmdSetLogicOpEXT", vkCmdSetLogicOpEXT}, - {"vkCmdSetLogicOpEnableEXT", vkCmdSetLogicOpEnableEXT}, - {"vkCmdSetPatchControlPointsEXT", vkCmdSetPatchControlPointsEXT}, - {"vkCmdSetPerformanceMarkerINTEL", vkCmdSetPerformanceMarkerINTEL}, - {"vkCmdSetPerformanceOverrideINTEL", vkCmdSetPerformanceOverrideINTEL}, - {"vkCmdSetPerformanceStreamMarkerINTEL", vkCmdSetPerformanceStreamMarkerINTEL}, - {"vkCmdSetPolygonModeEXT", vkCmdSetPolygonModeEXT}, - {"vkCmdSetPrimitiveRestartEnable", vkCmdSetPrimitiveRestartEnable}, - {"vkCmdSetPrimitiveRestartEnableEXT", vkCmdSetPrimitiveRestartEnableEXT}, - {"vkCmdSetPrimitiveTopology", vkCmdSetPrimitiveTopology}, - {"vkCmdSetPrimitiveTopologyEXT", vkCmdSetPrimitiveTopologyEXT}, - {"vkCmdSetProvokingVertexModeEXT", vkCmdSetProvokingVertexModeEXT}, - {"vkCmdSetRasterizationSamplesEXT", vkCmdSetRasterizationSamplesEXT}, - {"vkCmdSetRasterizationStreamEXT", vkCmdSetRasterizationStreamEXT}, - {"vkCmdSetRasterizerDiscardEnable", vkCmdSetRasterizerDiscardEnable}, - {"vkCmdSetRasterizerDiscardEnableEXT", vkCmdSetRasterizerDiscardEnableEXT}, - {"vkCmdSetRayTracingPipelineStackSizeKHR", vkCmdSetRayTracingPipelineStackSizeKHR}, - {"vkCmdSetRenderingAttachmentLocations", vkCmdSetRenderingAttachmentLocations}, - {"vkCmdSetRenderingAttachmentLocationsKHR", vkCmdSetRenderingAttachmentLocationsKHR}, - {"vkCmdSetRenderingInputAttachmentIndices", vkCmdSetRenderingInputAttachmentIndices}, - {"vkCmdSetRenderingInputAttachmentIndicesKHR", vkCmdSetRenderingInputAttachmentIndicesKHR}, - {"vkCmdSetRepresentativeFragmentTestEnableNV", vkCmdSetRepresentativeFragmentTestEnableNV}, - {"vkCmdSetSampleLocationsEXT", vkCmdSetSampleLocationsEXT}, - {"vkCmdSetSampleLocationsEnableEXT", vkCmdSetSampleLocationsEnableEXT}, - {"vkCmdSetSampleMaskEXT", vkCmdSetSampleMaskEXT}, - {"vkCmdSetScissor", vkCmdSetScissor}, - {"vkCmdSetScissorWithCount", vkCmdSetScissorWithCount}, - {"vkCmdSetScissorWithCountEXT", vkCmdSetScissorWithCountEXT}, - {"vkCmdSetShadingRateImageEnableNV", vkCmdSetShadingRateImageEnableNV}, - {"vkCmdSetStencilCompareMask", vkCmdSetStencilCompareMask}, - {"vkCmdSetStencilOp", vkCmdSetStencilOp}, - {"vkCmdSetStencilOpEXT", vkCmdSetStencilOpEXT}, - {"vkCmdSetStencilReference", vkCmdSetStencilReference}, - {"vkCmdSetStencilTestEnable", vkCmdSetStencilTestEnable}, - {"vkCmdSetStencilTestEnableEXT", vkCmdSetStencilTestEnableEXT}, - {"vkCmdSetStencilWriteMask", vkCmdSetStencilWriteMask}, - {"vkCmdSetTessellationDomainOriginEXT", vkCmdSetTessellationDomainOriginEXT}, - {"vkCmdSetVertexInputEXT", vkCmdSetVertexInputEXT}, - {"vkCmdSetViewport", vkCmdSetViewport}, - {"vkCmdSetViewportShadingRatePaletteNV", vkCmdSetViewportShadingRatePaletteNV}, - {"vkCmdSetViewportSwizzleNV", vkCmdSetViewportSwizzleNV}, - {"vkCmdSetViewportWScalingEnableNV", vkCmdSetViewportWScalingEnableNV}, - {"vkCmdSetViewportWScalingNV", vkCmdSetViewportWScalingNV}, - {"vkCmdSetViewportWithCount", vkCmdSetViewportWithCount}, - {"vkCmdSetViewportWithCountEXT", vkCmdSetViewportWithCountEXT}, - {"vkCmdSubpassShadingHUAWEI", vkCmdSubpassShadingHUAWEI}, - {"vkCmdTraceRaysIndirect2KHR", vkCmdTraceRaysIndirect2KHR}, - {"vkCmdTraceRaysIndirectKHR", vkCmdTraceRaysIndirectKHR}, - {"vkCmdTraceRaysKHR", vkCmdTraceRaysKHR}, - {"vkCmdTraceRaysNV", vkCmdTraceRaysNV}, - {"vkCmdUpdateBuffer", vkCmdUpdateBuffer}, - {"vkCmdUpdatePipelineIndirectBufferNV", vkCmdUpdatePipelineIndirectBufferNV}, - {"vkCmdWaitEvents", vkCmdWaitEvents}, - {"vkCmdWaitEvents2", vkCmdWaitEvents2}, - {"vkCmdWaitEvents2KHR", vkCmdWaitEvents2KHR}, - {"vkCmdWriteAccelerationStructuresPropertiesKHR", vkCmdWriteAccelerationStructuresPropertiesKHR}, - {"vkCmdWriteAccelerationStructuresPropertiesNV", vkCmdWriteAccelerationStructuresPropertiesNV}, - {"vkCmdWriteBufferMarker2AMD", vkCmdWriteBufferMarker2AMD}, - {"vkCmdWriteBufferMarkerAMD", vkCmdWriteBufferMarkerAMD}, - {"vkCmdWriteMicromapsPropertiesEXT", vkCmdWriteMicromapsPropertiesEXT}, - {"vkCmdWriteTimestamp", vkCmdWriteTimestamp}, - {"vkCmdWriteTimestamp2", vkCmdWriteTimestamp2}, - {"vkCmdWriteTimestamp2KHR", vkCmdWriteTimestamp2KHR}, - {"vkCompileDeferredNV", vkCompileDeferredNV}, - {"vkCopyAccelerationStructureKHR", vkCopyAccelerationStructureKHR}, - {"vkCopyAccelerationStructureToMemoryKHR", vkCopyAccelerationStructureToMemoryKHR}, - {"vkCopyImageToImage", vkCopyImageToImage}, - {"vkCopyImageToImageEXT", vkCopyImageToImageEXT}, - {"vkCopyImageToMemory", vkCopyImageToMemory}, - {"vkCopyImageToMemoryEXT", vkCopyImageToMemoryEXT}, - {"vkCopyMemoryToAccelerationStructureKHR", vkCopyMemoryToAccelerationStructureKHR}, - {"vkCopyMemoryToImage", vkCopyMemoryToImage}, - {"vkCopyMemoryToImageEXT", vkCopyMemoryToImageEXT}, - {"vkCopyMemoryToMicromapEXT", vkCopyMemoryToMicromapEXT}, - {"vkCopyMicromapEXT", vkCopyMicromapEXT}, - {"vkCopyMicromapToMemoryEXT", vkCopyMicromapToMemoryEXT}, - {"vkCreateAccelerationStructureKHR", vkCreateAccelerationStructureKHR}, - {"vkCreateAccelerationStructureNV", vkCreateAccelerationStructureNV}, - {"vkCreateBuffer", vkCreateBuffer}, - {"vkCreateBufferView", vkCreateBufferView}, - {"vkCreateCommandPool", vkCreateCommandPool}, - {"vkCreateComputePipelines", vkCreateComputePipelines}, - {"vkCreateCuFunctionNVX", vkCreateCuFunctionNVX}, - {"vkCreateCuModuleNVX", vkCreateCuModuleNVX}, - {"vkCreateCudaFunctionNV", vkCreateCudaFunctionNV}, - {"vkCreateCudaModuleNV", vkCreateCudaModuleNV}, - {"vkCreateDeferredOperationKHR", vkCreateDeferredOperationKHR}, - {"vkCreateDescriptorPool", vkCreateDescriptorPool}, - {"vkCreateDescriptorSetLayout", vkCreateDescriptorSetLayout}, - {"vkCreateDescriptorUpdateTemplate", vkCreateDescriptorUpdateTemplate}, - {"vkCreateDescriptorUpdateTemplateKHR", vkCreateDescriptorUpdateTemplateKHR}, - {"vkCreateEvent", vkCreateEvent}, - {"vkCreateFence", vkCreateFence}, - {"vkCreateFramebuffer", vkCreateFramebuffer}, - {"vkCreateGraphicsPipelines", vkCreateGraphicsPipelines}, - {"vkCreateImage", vkCreateImage}, - {"vkCreateImageView", vkCreateImageView}, - {"vkCreateIndirectCommandsLayoutEXT", vkCreateIndirectCommandsLayoutEXT}, - {"vkCreateIndirectCommandsLayoutNV", vkCreateIndirectCommandsLayoutNV}, - {"vkCreateIndirectExecutionSetEXT", vkCreateIndirectExecutionSetEXT}, - {"vkCreateMicromapEXT", vkCreateMicromapEXT}, - {"vkCreateOpticalFlowSessionNV", vkCreateOpticalFlowSessionNV}, - {"vkCreatePipelineBinariesKHR", vkCreatePipelineBinariesKHR}, - {"vkCreatePipelineCache", vkCreatePipelineCache}, - {"vkCreatePipelineLayout", vkCreatePipelineLayout}, - {"vkCreatePrivateDataSlot", vkCreatePrivateDataSlot}, - {"vkCreatePrivateDataSlotEXT", vkCreatePrivateDataSlotEXT}, - {"vkCreateQueryPool", vkCreateQueryPool}, - {"vkCreateRayTracingPipelinesKHR", vkCreateRayTracingPipelinesKHR}, - {"vkCreateRayTracingPipelinesNV", vkCreateRayTracingPipelinesNV}, - {"vkCreateRenderPass", vkCreateRenderPass}, - {"vkCreateRenderPass2", vkCreateRenderPass2}, - {"vkCreateRenderPass2KHR", vkCreateRenderPass2KHR}, - {"vkCreateSampler", vkCreateSampler}, - {"vkCreateSamplerYcbcrConversion", vkCreateSamplerYcbcrConversion}, - {"vkCreateSamplerYcbcrConversionKHR", vkCreateSamplerYcbcrConversionKHR}, - {"vkCreateSemaphore", vkCreateSemaphore}, - {"vkCreateShaderModule", vkCreateShaderModule}, - {"vkCreateShadersEXT", vkCreateShadersEXT}, - {"vkCreateSwapchainKHR", vkCreateSwapchainKHR}, - {"vkCreateValidationCacheEXT", vkCreateValidationCacheEXT}, - {"vkCreateVideoSessionKHR", vkCreateVideoSessionKHR}, - {"vkCreateVideoSessionParametersKHR", vkCreateVideoSessionParametersKHR}, - {"vkDebugMarkerSetObjectNameEXT", vkDebugMarkerSetObjectNameEXT}, - {"vkDebugMarkerSetObjectTagEXT", vkDebugMarkerSetObjectTagEXT}, - {"vkDeferredOperationJoinKHR", vkDeferredOperationJoinKHR}, - {"vkDestroyAccelerationStructureKHR", vkDestroyAccelerationStructureKHR}, - {"vkDestroyAccelerationStructureNV", vkDestroyAccelerationStructureNV}, - {"vkDestroyBuffer", vkDestroyBuffer}, - {"vkDestroyBufferView", vkDestroyBufferView}, - {"vkDestroyCommandPool", vkDestroyCommandPool}, - {"vkDestroyCuFunctionNVX", vkDestroyCuFunctionNVX}, - {"vkDestroyCuModuleNVX", vkDestroyCuModuleNVX}, - {"vkDestroyCudaFunctionNV", vkDestroyCudaFunctionNV}, - {"vkDestroyCudaModuleNV", vkDestroyCudaModuleNV}, - {"vkDestroyDeferredOperationKHR", vkDestroyDeferredOperationKHR}, - {"vkDestroyDescriptorPool", vkDestroyDescriptorPool}, - {"vkDestroyDescriptorSetLayout", vkDestroyDescriptorSetLayout}, - {"vkDestroyDescriptorUpdateTemplate", vkDestroyDescriptorUpdateTemplate}, - {"vkDestroyDescriptorUpdateTemplateKHR", vkDestroyDescriptorUpdateTemplateKHR}, - {"vkDestroyDevice", vkDestroyDevice}, - {"vkDestroyEvent", vkDestroyEvent}, - {"vkDestroyFence", vkDestroyFence}, - {"vkDestroyFramebuffer", vkDestroyFramebuffer}, - {"vkDestroyImage", vkDestroyImage}, - {"vkDestroyImageView", vkDestroyImageView}, - {"vkDestroyIndirectCommandsLayoutEXT", vkDestroyIndirectCommandsLayoutEXT}, - {"vkDestroyIndirectCommandsLayoutNV", vkDestroyIndirectCommandsLayoutNV}, - {"vkDestroyIndirectExecutionSetEXT", vkDestroyIndirectExecutionSetEXT}, - {"vkDestroyMicromapEXT", vkDestroyMicromapEXT}, - {"vkDestroyOpticalFlowSessionNV", vkDestroyOpticalFlowSessionNV}, - {"vkDestroyPipeline", vkDestroyPipeline}, - {"vkDestroyPipelineBinaryKHR", vkDestroyPipelineBinaryKHR}, - {"vkDestroyPipelineCache", vkDestroyPipelineCache}, - {"vkDestroyPipelineLayout", vkDestroyPipelineLayout}, - {"vkDestroyPrivateDataSlot", vkDestroyPrivateDataSlot}, - {"vkDestroyPrivateDataSlotEXT", vkDestroyPrivateDataSlotEXT}, - {"vkDestroyQueryPool", vkDestroyQueryPool}, - {"vkDestroyRenderPass", vkDestroyRenderPass}, - {"vkDestroySampler", vkDestroySampler}, - {"vkDestroySamplerYcbcrConversion", vkDestroySamplerYcbcrConversion}, - {"vkDestroySamplerYcbcrConversionKHR", vkDestroySamplerYcbcrConversionKHR}, - {"vkDestroySemaphore", vkDestroySemaphore}, - {"vkDestroyShaderEXT", vkDestroyShaderEXT}, - {"vkDestroyShaderModule", vkDestroyShaderModule}, - {"vkDestroySwapchainKHR", vkDestroySwapchainKHR}, - {"vkDestroyValidationCacheEXT", vkDestroyValidationCacheEXT}, - {"vkDestroyVideoSessionKHR", vkDestroyVideoSessionKHR}, - {"vkDestroyVideoSessionParametersKHR", vkDestroyVideoSessionParametersKHR}, - {"vkDeviceWaitIdle", vkDeviceWaitIdle}, - {"vkEndCommandBuffer", vkEndCommandBuffer}, - {"vkFlushMappedMemoryRanges", vkFlushMappedMemoryRanges}, - {"vkFreeCommandBuffers", vkFreeCommandBuffers}, - {"vkFreeDescriptorSets", vkFreeDescriptorSets}, - {"vkFreeMemory", vkFreeMemory}, - {"vkGetAccelerationStructureBuildSizesKHR", vkGetAccelerationStructureBuildSizesKHR}, - {"vkGetAccelerationStructureDeviceAddressKHR", vkGetAccelerationStructureDeviceAddressKHR}, - {"vkGetAccelerationStructureHandleNV", vkGetAccelerationStructureHandleNV}, - {"vkGetAccelerationStructureMemoryRequirementsNV", vkGetAccelerationStructureMemoryRequirementsNV}, - {"vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT", vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT}, - {"vkGetBufferDeviceAddress", vkGetBufferDeviceAddress}, - {"vkGetBufferDeviceAddressEXT", vkGetBufferDeviceAddressEXT}, - {"vkGetBufferDeviceAddressKHR", vkGetBufferDeviceAddressKHR}, - {"vkGetBufferMemoryRequirements", vkGetBufferMemoryRequirements}, - {"vkGetBufferMemoryRequirements2", vkGetBufferMemoryRequirements2}, - {"vkGetBufferMemoryRequirements2KHR", vkGetBufferMemoryRequirements2KHR}, - {"vkGetBufferOpaqueCaptureAddress", vkGetBufferOpaqueCaptureAddress}, - {"vkGetBufferOpaqueCaptureAddressKHR", vkGetBufferOpaqueCaptureAddressKHR}, - {"vkGetBufferOpaqueCaptureDescriptorDataEXT", vkGetBufferOpaqueCaptureDescriptorDataEXT}, - {"vkGetCalibratedTimestampsEXT", vkGetCalibratedTimestampsEXT}, - {"vkGetCalibratedTimestampsKHR", vkGetCalibratedTimestampsKHR}, - {"vkGetCudaModuleCacheNV", vkGetCudaModuleCacheNV}, - {"vkGetDeferredOperationMaxConcurrencyKHR", vkGetDeferredOperationMaxConcurrencyKHR}, - {"vkGetDeferredOperationResultKHR", vkGetDeferredOperationResultKHR}, - {"vkGetDescriptorEXT", vkGetDescriptorEXT}, - {"vkGetDescriptorSetHostMappingVALVE", vkGetDescriptorSetHostMappingVALVE}, - {"vkGetDescriptorSetLayoutBindingOffsetEXT", vkGetDescriptorSetLayoutBindingOffsetEXT}, - {"vkGetDescriptorSetLayoutHostMappingInfoVALVE", vkGetDescriptorSetLayoutHostMappingInfoVALVE}, - {"vkGetDescriptorSetLayoutSizeEXT", vkGetDescriptorSetLayoutSizeEXT}, - {"vkGetDescriptorSetLayoutSupport", vkGetDescriptorSetLayoutSupport}, - {"vkGetDescriptorSetLayoutSupportKHR", vkGetDescriptorSetLayoutSupportKHR}, - {"vkGetDeviceAccelerationStructureCompatibilityKHR", vkGetDeviceAccelerationStructureCompatibilityKHR}, - {"vkGetDeviceBufferMemoryRequirements", vkGetDeviceBufferMemoryRequirements}, - {"vkGetDeviceBufferMemoryRequirementsKHR", vkGetDeviceBufferMemoryRequirementsKHR}, - {"vkGetDeviceFaultInfoEXT", vkGetDeviceFaultInfoEXT}, - {"vkGetDeviceGroupPeerMemoryFeatures", vkGetDeviceGroupPeerMemoryFeatures}, - {"vkGetDeviceGroupPeerMemoryFeaturesKHR", vkGetDeviceGroupPeerMemoryFeaturesKHR}, - {"vkGetDeviceGroupPresentCapabilitiesKHR", vkGetDeviceGroupPresentCapabilitiesKHR}, - {"vkGetDeviceGroupSurfacePresentModesKHR", vkGetDeviceGroupSurfacePresentModesKHR}, - {"vkGetDeviceImageMemoryRequirements", vkGetDeviceImageMemoryRequirements}, - {"vkGetDeviceImageMemoryRequirementsKHR", vkGetDeviceImageMemoryRequirementsKHR}, - {"vkGetDeviceImageSparseMemoryRequirements", vkGetDeviceImageSparseMemoryRequirements}, - {"vkGetDeviceImageSparseMemoryRequirementsKHR", vkGetDeviceImageSparseMemoryRequirementsKHR}, - {"vkGetDeviceImageSubresourceLayout", vkGetDeviceImageSubresourceLayout}, - {"vkGetDeviceImageSubresourceLayoutKHR", vkGetDeviceImageSubresourceLayoutKHR}, - {"vkGetDeviceMemoryCommitment", vkGetDeviceMemoryCommitment}, - {"vkGetDeviceMemoryOpaqueCaptureAddress", vkGetDeviceMemoryOpaqueCaptureAddress}, - {"vkGetDeviceMemoryOpaqueCaptureAddressKHR", vkGetDeviceMemoryOpaqueCaptureAddressKHR}, - {"vkGetDeviceMicromapCompatibilityEXT", vkGetDeviceMicromapCompatibilityEXT}, - {"vkGetDeviceProcAddr", vkGetDeviceProcAddr}, - {"vkGetDeviceQueue", vkGetDeviceQueue}, - {"vkGetDeviceQueue2", vkGetDeviceQueue2}, - {"vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI", vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI}, - {"vkGetDynamicRenderingTilePropertiesQCOM", vkGetDynamicRenderingTilePropertiesQCOM}, - {"vkGetEncodedVideoSessionParametersKHR", vkGetEncodedVideoSessionParametersKHR}, - {"vkGetEventStatus", vkGetEventStatus}, - {"vkGetFenceStatus", vkGetFenceStatus}, - {"vkGetFramebufferTilePropertiesQCOM", vkGetFramebufferTilePropertiesQCOM}, - {"vkGetGeneratedCommandsMemoryRequirementsEXT", vkGetGeneratedCommandsMemoryRequirementsEXT}, - {"vkGetGeneratedCommandsMemoryRequirementsNV", vkGetGeneratedCommandsMemoryRequirementsNV}, - {"vkGetImageMemoryRequirements", vkGetImageMemoryRequirements}, - {"vkGetImageMemoryRequirements2", vkGetImageMemoryRequirements2}, - {"vkGetImageMemoryRequirements2KHR", vkGetImageMemoryRequirements2KHR}, - {"vkGetImageOpaqueCaptureDescriptorDataEXT", vkGetImageOpaqueCaptureDescriptorDataEXT}, - {"vkGetImageSparseMemoryRequirements", vkGetImageSparseMemoryRequirements}, - {"vkGetImageSparseMemoryRequirements2", vkGetImageSparseMemoryRequirements2}, - {"vkGetImageSparseMemoryRequirements2KHR", vkGetImageSparseMemoryRequirements2KHR}, - {"vkGetImageSubresourceLayout", vkGetImageSubresourceLayout}, - {"vkGetImageSubresourceLayout2", vkGetImageSubresourceLayout2}, - {"vkGetImageSubresourceLayout2EXT", vkGetImageSubresourceLayout2EXT}, - {"vkGetImageSubresourceLayout2KHR", vkGetImageSubresourceLayout2KHR}, - {"vkGetImageViewAddressNVX", vkGetImageViewAddressNVX}, - {"vkGetImageViewHandle64NVX", vkGetImageViewHandle64NVX}, - {"vkGetImageViewHandleNVX", vkGetImageViewHandleNVX}, - {"vkGetImageViewOpaqueCaptureDescriptorDataEXT", vkGetImageViewOpaqueCaptureDescriptorDataEXT}, - {"vkGetLatencyTimingsNV", vkGetLatencyTimingsNV}, - {"vkGetMemoryHostPointerPropertiesEXT", vkGetMemoryHostPointerPropertiesEXT}, - {"vkGetMicromapBuildSizesEXT", vkGetMicromapBuildSizesEXT}, - {"vkGetPerformanceParameterINTEL", vkGetPerformanceParameterINTEL}, - {"vkGetPipelineBinaryDataKHR", vkGetPipelineBinaryDataKHR}, - {"vkGetPipelineCacheData", vkGetPipelineCacheData}, - {"vkGetPipelineExecutableInternalRepresentationsKHR", vkGetPipelineExecutableInternalRepresentationsKHR}, - {"vkGetPipelineExecutablePropertiesKHR", vkGetPipelineExecutablePropertiesKHR}, - {"vkGetPipelineExecutableStatisticsKHR", vkGetPipelineExecutableStatisticsKHR}, - {"vkGetPipelineIndirectDeviceAddressNV", vkGetPipelineIndirectDeviceAddressNV}, - {"vkGetPipelineIndirectMemoryRequirementsNV", vkGetPipelineIndirectMemoryRequirementsNV}, - {"vkGetPipelineKeyKHR", vkGetPipelineKeyKHR}, - {"vkGetPipelinePropertiesEXT", vkGetPipelinePropertiesEXT}, - {"vkGetPrivateData", vkGetPrivateData}, - {"vkGetPrivateDataEXT", vkGetPrivateDataEXT}, - {"vkGetQueryPoolResults", vkGetQueryPoolResults}, - {"vkGetQueueCheckpointData2NV", vkGetQueueCheckpointData2NV}, - {"vkGetQueueCheckpointDataNV", vkGetQueueCheckpointDataNV}, - {"vkGetRayTracingCaptureReplayShaderGroupHandlesKHR", vkGetRayTracingCaptureReplayShaderGroupHandlesKHR}, - {"vkGetRayTracingShaderGroupHandlesKHR", vkGetRayTracingShaderGroupHandlesKHR}, - {"vkGetRayTracingShaderGroupHandlesNV", vkGetRayTracingShaderGroupHandlesNV}, - {"vkGetRayTracingShaderGroupStackSizeKHR", vkGetRayTracingShaderGroupStackSizeKHR}, - {"vkGetRenderAreaGranularity", vkGetRenderAreaGranularity}, - {"vkGetRenderingAreaGranularity", vkGetRenderingAreaGranularity}, - {"vkGetRenderingAreaGranularityKHR", vkGetRenderingAreaGranularityKHR}, - {"vkGetSamplerOpaqueCaptureDescriptorDataEXT", vkGetSamplerOpaqueCaptureDescriptorDataEXT}, - {"vkGetSemaphoreCounterValue", vkGetSemaphoreCounterValue}, - {"vkGetSemaphoreCounterValueKHR", vkGetSemaphoreCounterValueKHR}, - {"vkGetShaderBinaryDataEXT", vkGetShaderBinaryDataEXT}, - {"vkGetShaderInfoAMD", vkGetShaderInfoAMD}, - {"vkGetShaderModuleCreateInfoIdentifierEXT", vkGetShaderModuleCreateInfoIdentifierEXT}, - {"vkGetShaderModuleIdentifierEXT", vkGetShaderModuleIdentifierEXT}, - {"vkGetSwapchainImagesKHR", vkGetSwapchainImagesKHR}, - {"vkGetValidationCacheDataEXT", vkGetValidationCacheDataEXT}, - {"vkGetVideoSessionMemoryRequirementsKHR", vkGetVideoSessionMemoryRequirementsKHR}, - {"vkInitializePerformanceApiINTEL", vkInitializePerformanceApiINTEL}, - {"vkInvalidateMappedMemoryRanges", vkInvalidateMappedMemoryRanges}, - {"vkLatencySleepNV", vkLatencySleepNV}, - {"vkMapMemory", vkMapMemory}, - {"vkMapMemory2", vkMapMemory2}, - {"vkMapMemory2KHR", vkMapMemory2KHR}, - {"vkMergePipelineCaches", vkMergePipelineCaches}, - {"vkMergeValidationCachesEXT", vkMergeValidationCachesEXT}, - {"vkQueueBeginDebugUtilsLabelEXT", vkQueueBeginDebugUtilsLabelEXT}, - {"vkQueueBindSparse", vkQueueBindSparse}, - {"vkQueueEndDebugUtilsLabelEXT", vkQueueEndDebugUtilsLabelEXT}, - {"vkQueueInsertDebugUtilsLabelEXT", vkQueueInsertDebugUtilsLabelEXT}, - {"vkQueueNotifyOutOfBandNV", vkQueueNotifyOutOfBandNV}, - {"vkQueuePresentKHR", vkQueuePresentKHR}, - {"vkQueueSetPerformanceConfigurationINTEL", vkQueueSetPerformanceConfigurationINTEL}, - {"vkQueueSubmit", vkQueueSubmit}, - {"vkQueueSubmit2", vkQueueSubmit2}, - {"vkQueueSubmit2KHR", vkQueueSubmit2KHR}, - {"vkQueueWaitIdle", vkQueueWaitIdle}, - {"vkReleaseCapturedPipelineDataKHR", vkReleaseCapturedPipelineDataKHR}, - {"vkReleasePerformanceConfigurationINTEL", vkReleasePerformanceConfigurationINTEL}, - {"vkReleaseProfilingLockKHR", vkReleaseProfilingLockKHR}, - {"vkReleaseSwapchainImagesEXT", vkReleaseSwapchainImagesEXT}, - {"vkResetCommandBuffer", vkResetCommandBuffer}, - {"vkResetCommandPool", vkResetCommandPool}, - {"vkResetDescriptorPool", vkResetDescriptorPool}, - {"vkResetEvent", vkResetEvent}, - {"vkResetFences", vkResetFences}, - {"vkResetQueryPool", vkResetQueryPool}, - {"vkResetQueryPoolEXT", vkResetQueryPoolEXT}, - {"vkSetDebugUtilsObjectNameEXT", vkSetDebugUtilsObjectNameEXT}, - {"vkSetDebugUtilsObjectTagEXT", vkSetDebugUtilsObjectTagEXT}, - {"vkSetDeviceMemoryPriorityEXT", vkSetDeviceMemoryPriorityEXT}, - {"vkSetEvent", vkSetEvent}, - {"vkSetHdrMetadataEXT", vkSetHdrMetadataEXT}, - {"vkSetLatencyMarkerNV", vkSetLatencyMarkerNV}, - {"vkSetLatencySleepModeNV", vkSetLatencySleepModeNV}, - {"vkSetPrivateData", vkSetPrivateData}, - {"vkSetPrivateDataEXT", vkSetPrivateDataEXT}, - {"vkSignalSemaphore", vkSignalSemaphore}, - {"vkSignalSemaphoreKHR", vkSignalSemaphoreKHR}, - {"vkTransitionImageLayout", vkTransitionImageLayout}, - {"vkTransitionImageLayoutEXT", vkTransitionImageLayoutEXT}, - {"vkTrimCommandPool", vkTrimCommandPool}, - {"vkTrimCommandPoolKHR", vkTrimCommandPoolKHR}, - {"vkUninitializePerformanceApiINTEL", vkUninitializePerformanceApiINTEL}, - {"vkUnmapMemory", vkUnmapMemory}, - {"vkUnmapMemory2", vkUnmapMemory2}, - {"vkUnmapMemory2KHR", vkUnmapMemory2KHR}, - {"vkUpdateDescriptorSetWithTemplate", vkUpdateDescriptorSetWithTemplate}, - {"vkUpdateDescriptorSetWithTemplateKHR", vkUpdateDescriptorSetWithTemplateKHR}, - {"vkUpdateDescriptorSets", vkUpdateDescriptorSets}, - {"vkUpdateIndirectExecutionSetPipelineEXT", vkUpdateIndirectExecutionSetPipelineEXT}, - {"vkUpdateIndirectExecutionSetShaderEXT", vkUpdateIndirectExecutionSetShaderEXT}, - {"vkUpdateVideoSessionParametersKHR", vkUpdateVideoSessionParametersKHR}, - {"vkWaitForFences", vkWaitForFences}, - {"vkWaitForPresentKHR", vkWaitForPresentKHR}, - {"vkWaitSemaphores", vkWaitSemaphores}, - {"vkWaitSemaphoresKHR", vkWaitSemaphoresKHR}, - {"vkWriteAccelerationStructuresPropertiesKHR", vkWriteAccelerationStructuresPropertiesKHR}, - {"vkWriteMicromapsPropertiesEXT", vkWriteMicromapsPropertiesEXT}, -}; - -static const struct vulkan_func vk_phys_dev_dispatch_table[] = -{ - {"vkCreateDevice", vkCreateDevice}, - {"vkEnumerateDeviceExtensionProperties", vkEnumerateDeviceExtensionProperties}, - {"vkEnumerateDeviceLayerProperties", vkEnumerateDeviceLayerProperties}, - {"vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR", vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR}, - {"vkGetPhysicalDeviceCalibrateableTimeDomainsEXT", vkGetPhysicalDeviceCalibrateableTimeDomainsEXT}, - {"vkGetPhysicalDeviceCalibrateableTimeDomainsKHR", vkGetPhysicalDeviceCalibrateableTimeDomainsKHR}, - {"vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV", vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV}, - {"vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR", vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR}, - {"vkGetPhysicalDeviceCooperativeMatrixPropertiesNV", vkGetPhysicalDeviceCooperativeMatrixPropertiesNV}, - {"vkGetPhysicalDeviceExternalBufferProperties", vkGetPhysicalDeviceExternalBufferProperties}, - {"vkGetPhysicalDeviceExternalBufferPropertiesKHR", vkGetPhysicalDeviceExternalBufferPropertiesKHR}, - {"vkGetPhysicalDeviceExternalFenceProperties", vkGetPhysicalDeviceExternalFenceProperties}, - {"vkGetPhysicalDeviceExternalFencePropertiesKHR", vkGetPhysicalDeviceExternalFencePropertiesKHR}, - {"vkGetPhysicalDeviceExternalSemaphoreProperties", vkGetPhysicalDeviceExternalSemaphoreProperties}, - {"vkGetPhysicalDeviceExternalSemaphorePropertiesKHR", vkGetPhysicalDeviceExternalSemaphorePropertiesKHR}, - {"vkGetPhysicalDeviceFeatures", vkGetPhysicalDeviceFeatures}, - {"vkGetPhysicalDeviceFeatures2", vkGetPhysicalDeviceFeatures2}, - {"vkGetPhysicalDeviceFeatures2KHR", vkGetPhysicalDeviceFeatures2KHR}, - {"vkGetPhysicalDeviceFormatProperties", vkGetPhysicalDeviceFormatProperties}, - {"vkGetPhysicalDeviceFormatProperties2", vkGetPhysicalDeviceFormatProperties2}, - {"vkGetPhysicalDeviceFormatProperties2KHR", vkGetPhysicalDeviceFormatProperties2KHR}, - {"vkGetPhysicalDeviceFragmentShadingRatesKHR", vkGetPhysicalDeviceFragmentShadingRatesKHR}, - {"vkGetPhysicalDeviceImageFormatProperties", vkGetPhysicalDeviceImageFormatProperties}, - {"vkGetPhysicalDeviceImageFormatProperties2", vkGetPhysicalDeviceImageFormatProperties2}, - {"vkGetPhysicalDeviceImageFormatProperties2KHR", vkGetPhysicalDeviceImageFormatProperties2KHR}, - {"vkGetPhysicalDeviceMemoryProperties", vkGetPhysicalDeviceMemoryProperties}, - {"vkGetPhysicalDeviceMemoryProperties2", vkGetPhysicalDeviceMemoryProperties2}, - {"vkGetPhysicalDeviceMemoryProperties2KHR", vkGetPhysicalDeviceMemoryProperties2KHR}, - {"vkGetPhysicalDeviceMultisamplePropertiesEXT", vkGetPhysicalDeviceMultisamplePropertiesEXT}, - {"vkGetPhysicalDeviceOpticalFlowImageFormatsNV", vkGetPhysicalDeviceOpticalFlowImageFormatsNV}, - {"vkGetPhysicalDevicePresentRectanglesKHR", vkGetPhysicalDevicePresentRectanglesKHR}, - {"vkGetPhysicalDeviceProperties", vkGetPhysicalDeviceProperties}, - {"vkGetPhysicalDeviceProperties2", vkGetPhysicalDeviceProperties2}, - {"vkGetPhysicalDeviceProperties2KHR", vkGetPhysicalDeviceProperties2KHR}, - {"vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR", vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR}, - {"vkGetPhysicalDeviceQueueFamilyProperties", vkGetPhysicalDeviceQueueFamilyProperties}, - {"vkGetPhysicalDeviceQueueFamilyProperties2", vkGetPhysicalDeviceQueueFamilyProperties2}, - {"vkGetPhysicalDeviceQueueFamilyProperties2KHR", vkGetPhysicalDeviceQueueFamilyProperties2KHR}, - {"vkGetPhysicalDeviceSparseImageFormatProperties", vkGetPhysicalDeviceSparseImageFormatProperties}, - {"vkGetPhysicalDeviceSparseImageFormatProperties2", vkGetPhysicalDeviceSparseImageFormatProperties2}, - {"vkGetPhysicalDeviceSparseImageFormatProperties2KHR", vkGetPhysicalDeviceSparseImageFormatProperties2KHR}, - {"vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV", vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV}, - {"vkGetPhysicalDeviceSurfaceCapabilities2KHR", vkGetPhysicalDeviceSurfaceCapabilities2KHR}, - {"vkGetPhysicalDeviceSurfaceCapabilitiesKHR", vkGetPhysicalDeviceSurfaceCapabilitiesKHR}, - {"vkGetPhysicalDeviceSurfaceFormats2KHR", vkGetPhysicalDeviceSurfaceFormats2KHR}, - {"vkGetPhysicalDeviceSurfaceFormatsKHR", vkGetPhysicalDeviceSurfaceFormatsKHR}, - {"vkGetPhysicalDeviceSurfacePresentModesKHR", vkGetPhysicalDeviceSurfacePresentModesKHR}, - {"vkGetPhysicalDeviceSurfaceSupportKHR", vkGetPhysicalDeviceSurfaceSupportKHR}, - {"vkGetPhysicalDeviceToolProperties", vkGetPhysicalDeviceToolProperties}, - {"vkGetPhysicalDeviceToolPropertiesEXT", vkGetPhysicalDeviceToolPropertiesEXT}, - {"vkGetPhysicalDeviceVideoCapabilitiesKHR", vkGetPhysicalDeviceVideoCapabilitiesKHR}, - {"vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR", vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR}, - {"vkGetPhysicalDeviceVideoFormatPropertiesKHR", vkGetPhysicalDeviceVideoFormatPropertiesKHR}, - {"vkGetPhysicalDeviceWin32PresentationSupportKHR", vkGetPhysicalDeviceWin32PresentationSupportKHR}, -}; - -static const struct vulkan_func vk_instance_dispatch_table[] = -{ - {"vkCreateDebugReportCallbackEXT", vkCreateDebugReportCallbackEXT}, - {"vkCreateDebugUtilsMessengerEXT", vkCreateDebugUtilsMessengerEXT}, - {"vkCreateWin32SurfaceKHR", vkCreateWin32SurfaceKHR}, - {"vkDebugReportMessageEXT", vkDebugReportMessageEXT}, - {"vkDestroyDebugReportCallbackEXT", vkDestroyDebugReportCallbackEXT}, - {"vkDestroyDebugUtilsMessengerEXT", vkDestroyDebugUtilsMessengerEXT}, - {"vkDestroyInstance", vkDestroyInstance}, - {"vkDestroySurfaceKHR", vkDestroySurfaceKHR}, - {"vkEnumeratePhysicalDeviceGroups", vkEnumeratePhysicalDeviceGroups}, - {"vkEnumeratePhysicalDeviceGroupsKHR", vkEnumeratePhysicalDeviceGroupsKHR}, - {"vkEnumeratePhysicalDevices", vkEnumeratePhysicalDevices}, - {"vkSubmitDebugUtilsMessageEXT", vkSubmitDebugUtilsMessageEXT}, -}; - -void *wine_vk_get_device_proc_addr(const char *name) -{ - unsigned int i; - for (i = 0; i < ARRAY_SIZE(vk_device_dispatch_table); i++) - { - if (strcmp(vk_device_dispatch_table[i].name, name) == 0) - { - TRACE("Found name=%s in device table\n", debugstr_a(name)); - return vk_device_dispatch_table[i].func; - } - } - return NULL; -} - -void *wine_vk_get_phys_dev_proc_addr(const char *name) -{ - unsigned int i; - for (i = 0; i < ARRAY_SIZE(vk_phys_dev_dispatch_table); i++) - { - if (strcmp(vk_phys_dev_dispatch_table[i].name, name) == 0) - { - TRACE("Found name=%s in physical device table\n", debugstr_a(name)); - return vk_phys_dev_dispatch_table[i].func; - } - } - return NULL; -} - -void *wine_vk_get_instance_proc_addr(const char *name) -{ - unsigned int i; - for (i = 0; i < ARRAY_SIZE(vk_instance_dispatch_table); i++) - { - if (strcmp(vk_instance_dispatch_table[i].name, name) == 0) - { - TRACE("Found name=%s in instance table\n", debugstr_a(name)); - return vk_instance_dispatch_table[i].func; - } - } - return NULL; -} diff --git a/dlls/winevulkan/loader_thunks.h b/dlls/winevulkan/loader_thunks.h deleted file mode 100644 index a82b17ddf19b..000000000000 --- a/dlls/winevulkan/loader_thunks.h +++ /dev/null @@ -1,5520 +0,0 @@ -/* Automatically generated from Vulkan vk.xml and video.xml; DO NOT EDIT! - * - * This file is generated from Vulkan vk.xml file covered - * by the following copyright and permission notice: - * - * Copyright 2015-2024 The Khronos Group Inc. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - * and from Vulkan video.xml file covered - * by the following copyright and permission notice: - * - * Copyright 2021-2024 The Khronos Group Inc. - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#ifndef __WINE_VULKAN_LOADER_THUNKS_H -#define __WINE_VULKAN_LOADER_THUNKS_H - -enum unix_call -{ - unix_init, - unix_is_available_instance_function, - unix_is_available_device_function, - unix_vkAcquireNextImage2KHR, - unix_vkAcquireNextImageKHR, - unix_vkAcquirePerformanceConfigurationINTEL, - unix_vkAcquireProfilingLockKHR, - unix_vkAllocateCommandBuffers, - unix_vkAllocateDescriptorSets, - unix_vkAllocateMemory, - unix_vkAntiLagUpdateAMD, - unix_vkBeginCommandBuffer, - unix_vkBindAccelerationStructureMemoryNV, - unix_vkBindBufferMemory, - unix_vkBindBufferMemory2, - unix_vkBindBufferMemory2KHR, - unix_vkBindImageMemory, - unix_vkBindImageMemory2, - unix_vkBindImageMemory2KHR, - unix_vkBindOpticalFlowSessionImageNV, - unix_vkBindVideoSessionMemoryKHR, - unix_vkBuildAccelerationStructuresKHR, - unix_vkBuildMicromapsEXT, - unix_vkCmdBeginConditionalRenderingEXT, - unix_vkCmdBeginDebugUtilsLabelEXT, - unix_vkCmdBeginQuery, - unix_vkCmdBeginQueryIndexedEXT, - unix_vkCmdBeginRenderPass, - unix_vkCmdBeginRenderPass2, - unix_vkCmdBeginRenderPass2KHR, - unix_vkCmdBeginRendering, - unix_vkCmdBeginRenderingKHR, - unix_vkCmdBeginTransformFeedbackEXT, - unix_vkCmdBeginVideoCodingKHR, - unix_vkCmdBindDescriptorBufferEmbeddedSamplers2EXT, - unix_vkCmdBindDescriptorBufferEmbeddedSamplersEXT, - unix_vkCmdBindDescriptorBuffersEXT, - unix_vkCmdBindDescriptorSets, - unix_vkCmdBindDescriptorSets2, - unix_vkCmdBindDescriptorSets2KHR, - unix_vkCmdBindIndexBuffer, - unix_vkCmdBindIndexBuffer2, - unix_vkCmdBindIndexBuffer2KHR, - unix_vkCmdBindInvocationMaskHUAWEI, - unix_vkCmdBindPipeline, - unix_vkCmdBindPipelineShaderGroupNV, - unix_vkCmdBindShadersEXT, - unix_vkCmdBindShadingRateImageNV, - unix_vkCmdBindTransformFeedbackBuffersEXT, - unix_vkCmdBindVertexBuffers, - unix_vkCmdBindVertexBuffers2, - unix_vkCmdBindVertexBuffers2EXT, - unix_vkCmdBlitImage, - unix_vkCmdBlitImage2, - unix_vkCmdBlitImage2KHR, - unix_vkCmdBuildAccelerationStructureNV, - unix_vkCmdBuildAccelerationStructuresIndirectKHR, - unix_vkCmdBuildAccelerationStructuresKHR, - unix_vkCmdBuildMicromapsEXT, - unix_vkCmdClearAttachments, - unix_vkCmdClearColorImage, - unix_vkCmdClearDepthStencilImage, - unix_vkCmdControlVideoCodingKHR, - unix_vkCmdCopyAccelerationStructureKHR, - unix_vkCmdCopyAccelerationStructureNV, - unix_vkCmdCopyAccelerationStructureToMemoryKHR, - unix_vkCmdCopyBuffer, - unix_vkCmdCopyBuffer2, - unix_vkCmdCopyBuffer2KHR, - unix_vkCmdCopyBufferToImage, - unix_vkCmdCopyBufferToImage2, - unix_vkCmdCopyBufferToImage2KHR, - unix_vkCmdCopyImage, - unix_vkCmdCopyImage2, - unix_vkCmdCopyImage2KHR, - unix_vkCmdCopyImageToBuffer, - unix_vkCmdCopyImageToBuffer2, - unix_vkCmdCopyImageToBuffer2KHR, - unix_vkCmdCopyMemoryIndirectNV, - unix_vkCmdCopyMemoryToAccelerationStructureKHR, - unix_vkCmdCopyMemoryToImageIndirectNV, - unix_vkCmdCopyMemoryToMicromapEXT, - unix_vkCmdCopyMicromapEXT, - unix_vkCmdCopyMicromapToMemoryEXT, - unix_vkCmdCopyQueryPoolResults, - unix_vkCmdCuLaunchKernelNVX, - unix_vkCmdCudaLaunchKernelNV, - unix_vkCmdDebugMarkerBeginEXT, - unix_vkCmdDebugMarkerEndEXT, - unix_vkCmdDebugMarkerInsertEXT, - unix_vkCmdDecodeVideoKHR, - unix_vkCmdDecompressMemoryIndirectCountNV, - unix_vkCmdDecompressMemoryNV, - unix_vkCmdDispatch, - unix_vkCmdDispatchBase, - unix_vkCmdDispatchBaseKHR, - unix_vkCmdDispatchIndirect, - unix_vkCmdDraw, - unix_vkCmdDrawClusterHUAWEI, - unix_vkCmdDrawClusterIndirectHUAWEI, - unix_vkCmdDrawIndexed, - unix_vkCmdDrawIndexedIndirect, - unix_vkCmdDrawIndexedIndirectCount, - unix_vkCmdDrawIndexedIndirectCountAMD, - unix_vkCmdDrawIndexedIndirectCountKHR, - unix_vkCmdDrawIndirect, - unix_vkCmdDrawIndirectByteCountEXT, - unix_vkCmdDrawIndirectCount, - unix_vkCmdDrawIndirectCountAMD, - unix_vkCmdDrawIndirectCountKHR, - unix_vkCmdDrawMeshTasksEXT, - unix_vkCmdDrawMeshTasksIndirectCountEXT, - unix_vkCmdDrawMeshTasksIndirectCountNV, - unix_vkCmdDrawMeshTasksIndirectEXT, - unix_vkCmdDrawMeshTasksIndirectNV, - unix_vkCmdDrawMeshTasksNV, - unix_vkCmdDrawMultiEXT, - unix_vkCmdDrawMultiIndexedEXT, - unix_vkCmdEncodeVideoKHR, - unix_vkCmdEndConditionalRenderingEXT, - unix_vkCmdEndDebugUtilsLabelEXT, - unix_vkCmdEndQuery, - unix_vkCmdEndQueryIndexedEXT, - unix_vkCmdEndRenderPass, - unix_vkCmdEndRenderPass2, - unix_vkCmdEndRenderPass2KHR, - unix_vkCmdEndRendering, - unix_vkCmdEndRenderingKHR, - unix_vkCmdEndTransformFeedbackEXT, - unix_vkCmdEndVideoCodingKHR, - unix_vkCmdExecuteCommands, - unix_vkCmdExecuteGeneratedCommandsEXT, - unix_vkCmdExecuteGeneratedCommandsNV, - unix_vkCmdFillBuffer, - unix_vkCmdInsertDebugUtilsLabelEXT, - unix_vkCmdNextSubpass, - unix_vkCmdNextSubpass2, - unix_vkCmdNextSubpass2KHR, - unix_vkCmdOpticalFlowExecuteNV, - unix_vkCmdPipelineBarrier, - unix_vkCmdPipelineBarrier2, - unix_vkCmdPipelineBarrier2KHR, - unix_vkCmdPreprocessGeneratedCommandsEXT, - unix_vkCmdPreprocessGeneratedCommandsNV, - unix_vkCmdPushConstants, - unix_vkCmdPushConstants2, - unix_vkCmdPushConstants2KHR, - unix_vkCmdPushDescriptorSet, - unix_vkCmdPushDescriptorSet2, - unix_vkCmdPushDescriptorSet2KHR, - unix_vkCmdPushDescriptorSetKHR, - unix_vkCmdPushDescriptorSetWithTemplate, - unix_vkCmdPushDescriptorSetWithTemplate2, - unix_vkCmdPushDescriptorSetWithTemplate2KHR, - unix_vkCmdPushDescriptorSetWithTemplateKHR, - unix_vkCmdResetEvent, - unix_vkCmdResetEvent2, - unix_vkCmdResetEvent2KHR, - unix_vkCmdResetQueryPool, - unix_vkCmdResolveImage, - unix_vkCmdResolveImage2, - unix_vkCmdResolveImage2KHR, - unix_vkCmdSetAlphaToCoverageEnableEXT, - unix_vkCmdSetAlphaToOneEnableEXT, - unix_vkCmdSetAttachmentFeedbackLoopEnableEXT, - unix_vkCmdSetBlendConstants, - unix_vkCmdSetCheckpointNV, - unix_vkCmdSetCoarseSampleOrderNV, - unix_vkCmdSetColorBlendAdvancedEXT, - unix_vkCmdSetColorBlendEnableEXT, - unix_vkCmdSetColorBlendEquationEXT, - unix_vkCmdSetColorWriteEnableEXT, - unix_vkCmdSetColorWriteMaskEXT, - unix_vkCmdSetConservativeRasterizationModeEXT, - unix_vkCmdSetCoverageModulationModeNV, - unix_vkCmdSetCoverageModulationTableEnableNV, - unix_vkCmdSetCoverageModulationTableNV, - unix_vkCmdSetCoverageReductionModeNV, - unix_vkCmdSetCoverageToColorEnableNV, - unix_vkCmdSetCoverageToColorLocationNV, - unix_vkCmdSetCullMode, - unix_vkCmdSetCullModeEXT, - unix_vkCmdSetDepthBias, - unix_vkCmdSetDepthBias2EXT, - unix_vkCmdSetDepthBiasEnable, - unix_vkCmdSetDepthBiasEnableEXT, - unix_vkCmdSetDepthBounds, - unix_vkCmdSetDepthBoundsTestEnable, - unix_vkCmdSetDepthBoundsTestEnableEXT, - unix_vkCmdSetDepthClampEnableEXT, - unix_vkCmdSetDepthClampRangeEXT, - unix_vkCmdSetDepthClipEnableEXT, - unix_vkCmdSetDepthClipNegativeOneToOneEXT, - unix_vkCmdSetDepthCompareOp, - unix_vkCmdSetDepthCompareOpEXT, - unix_vkCmdSetDepthTestEnable, - unix_vkCmdSetDepthTestEnableEXT, - unix_vkCmdSetDepthWriteEnable, - unix_vkCmdSetDepthWriteEnableEXT, - unix_vkCmdSetDescriptorBufferOffsets2EXT, - unix_vkCmdSetDescriptorBufferOffsetsEXT, - unix_vkCmdSetDeviceMask, - unix_vkCmdSetDeviceMaskKHR, - unix_vkCmdSetDiscardRectangleEXT, - unix_vkCmdSetDiscardRectangleEnableEXT, - unix_vkCmdSetDiscardRectangleModeEXT, - unix_vkCmdSetEvent, - unix_vkCmdSetEvent2, - unix_vkCmdSetEvent2KHR, - unix_vkCmdSetExclusiveScissorEnableNV, - unix_vkCmdSetExclusiveScissorNV, - unix_vkCmdSetExtraPrimitiveOverestimationSizeEXT, - unix_vkCmdSetFragmentShadingRateEnumNV, - unix_vkCmdSetFragmentShadingRateKHR, - unix_vkCmdSetFrontFace, - unix_vkCmdSetFrontFaceEXT, - unix_vkCmdSetLineRasterizationModeEXT, - unix_vkCmdSetLineStipple, - unix_vkCmdSetLineStippleEXT, - unix_vkCmdSetLineStippleEnableEXT, - unix_vkCmdSetLineStippleKHR, - unix_vkCmdSetLineWidth, - unix_vkCmdSetLogicOpEXT, - unix_vkCmdSetLogicOpEnableEXT, - unix_vkCmdSetPatchControlPointsEXT, - unix_vkCmdSetPerformanceMarkerINTEL, - unix_vkCmdSetPerformanceOverrideINTEL, - unix_vkCmdSetPerformanceStreamMarkerINTEL, - unix_vkCmdSetPolygonModeEXT, - unix_vkCmdSetPrimitiveRestartEnable, - unix_vkCmdSetPrimitiveRestartEnableEXT, - unix_vkCmdSetPrimitiveTopology, - unix_vkCmdSetPrimitiveTopologyEXT, - unix_vkCmdSetProvokingVertexModeEXT, - unix_vkCmdSetRasterizationSamplesEXT, - unix_vkCmdSetRasterizationStreamEXT, - unix_vkCmdSetRasterizerDiscardEnable, - unix_vkCmdSetRasterizerDiscardEnableEXT, - unix_vkCmdSetRayTracingPipelineStackSizeKHR, - unix_vkCmdSetRenderingAttachmentLocations, - unix_vkCmdSetRenderingAttachmentLocationsKHR, - unix_vkCmdSetRenderingInputAttachmentIndices, - unix_vkCmdSetRenderingInputAttachmentIndicesKHR, - unix_vkCmdSetRepresentativeFragmentTestEnableNV, - unix_vkCmdSetSampleLocationsEXT, - unix_vkCmdSetSampleLocationsEnableEXT, - unix_vkCmdSetSampleMaskEXT, - unix_vkCmdSetScissor, - unix_vkCmdSetScissorWithCount, - unix_vkCmdSetScissorWithCountEXT, - unix_vkCmdSetShadingRateImageEnableNV, - unix_vkCmdSetStencilCompareMask, - unix_vkCmdSetStencilOp, - unix_vkCmdSetStencilOpEXT, - unix_vkCmdSetStencilReference, - unix_vkCmdSetStencilTestEnable, - unix_vkCmdSetStencilTestEnableEXT, - unix_vkCmdSetStencilWriteMask, - unix_vkCmdSetTessellationDomainOriginEXT, - unix_vkCmdSetVertexInputEXT, - unix_vkCmdSetViewport, - unix_vkCmdSetViewportShadingRatePaletteNV, - unix_vkCmdSetViewportSwizzleNV, - unix_vkCmdSetViewportWScalingEnableNV, - unix_vkCmdSetViewportWScalingNV, - unix_vkCmdSetViewportWithCount, - unix_vkCmdSetViewportWithCountEXT, - unix_vkCmdSubpassShadingHUAWEI, - unix_vkCmdTraceRaysIndirect2KHR, - unix_vkCmdTraceRaysIndirectKHR, - unix_vkCmdTraceRaysKHR, - unix_vkCmdTraceRaysNV, - unix_vkCmdUpdateBuffer, - unix_vkCmdUpdatePipelineIndirectBufferNV, - unix_vkCmdWaitEvents, - unix_vkCmdWaitEvents2, - unix_vkCmdWaitEvents2KHR, - unix_vkCmdWriteAccelerationStructuresPropertiesKHR, - unix_vkCmdWriteAccelerationStructuresPropertiesNV, - unix_vkCmdWriteBufferMarker2AMD, - unix_vkCmdWriteBufferMarkerAMD, - unix_vkCmdWriteMicromapsPropertiesEXT, - unix_vkCmdWriteTimestamp, - unix_vkCmdWriteTimestamp2, - unix_vkCmdWriteTimestamp2KHR, - unix_vkCompileDeferredNV, - unix_vkCopyAccelerationStructureKHR, - unix_vkCopyAccelerationStructureToMemoryKHR, - unix_vkCopyImageToImage, - unix_vkCopyImageToImageEXT, - unix_vkCopyImageToMemory, - unix_vkCopyImageToMemoryEXT, - unix_vkCopyMemoryToAccelerationStructureKHR, - unix_vkCopyMemoryToImage, - unix_vkCopyMemoryToImageEXT, - unix_vkCopyMemoryToMicromapEXT, - unix_vkCopyMicromapEXT, - unix_vkCopyMicromapToMemoryEXT, - unix_vkCreateAccelerationStructureKHR, - unix_vkCreateAccelerationStructureNV, - unix_vkCreateBuffer, - unix_vkCreateBufferView, - unix_vkCreateCommandPool, - unix_vkCreateComputePipelines, - unix_vkCreateCuFunctionNVX, - unix_vkCreateCuModuleNVX, - unix_vkCreateCudaFunctionNV, - unix_vkCreateCudaModuleNV, - unix_vkCreateDebugReportCallbackEXT, - unix_vkCreateDebugUtilsMessengerEXT, - unix_vkCreateDeferredOperationKHR, - unix_vkCreateDescriptorPool, - unix_vkCreateDescriptorSetLayout, - unix_vkCreateDescriptorUpdateTemplate, - unix_vkCreateDescriptorUpdateTemplateKHR, - unix_vkCreateDevice, - unix_vkCreateEvent, - unix_vkCreateFence, - unix_vkCreateFramebuffer, - unix_vkCreateGraphicsPipelines, - unix_vkCreateImage, - unix_vkCreateImageView, - unix_vkCreateIndirectCommandsLayoutEXT, - unix_vkCreateIndirectCommandsLayoutNV, - unix_vkCreateIndirectExecutionSetEXT, - unix_vkCreateInstance, - unix_vkCreateMicromapEXT, - unix_vkCreateOpticalFlowSessionNV, - unix_vkCreatePipelineBinariesKHR, - unix_vkCreatePipelineCache, - unix_vkCreatePipelineLayout, - unix_vkCreatePrivateDataSlot, - unix_vkCreatePrivateDataSlotEXT, - unix_vkCreateQueryPool, - unix_vkCreateRayTracingPipelinesKHR, - unix_vkCreateRayTracingPipelinesNV, - unix_vkCreateRenderPass, - unix_vkCreateRenderPass2, - unix_vkCreateRenderPass2KHR, - unix_vkCreateSampler, - unix_vkCreateSamplerYcbcrConversion, - unix_vkCreateSamplerYcbcrConversionKHR, - unix_vkCreateSemaphore, - unix_vkCreateShaderModule, - unix_vkCreateShadersEXT, - unix_vkCreateSwapchainKHR, - unix_vkCreateValidationCacheEXT, - unix_vkCreateVideoSessionKHR, - unix_vkCreateVideoSessionParametersKHR, - unix_vkCreateWin32SurfaceKHR, - unix_vkDebugMarkerSetObjectNameEXT, - unix_vkDebugMarkerSetObjectTagEXT, - unix_vkDebugReportMessageEXT, - unix_vkDeferredOperationJoinKHR, - unix_vkDestroyAccelerationStructureKHR, - unix_vkDestroyAccelerationStructureNV, - unix_vkDestroyBuffer, - unix_vkDestroyBufferView, - unix_vkDestroyCommandPool, - unix_vkDestroyCuFunctionNVX, - unix_vkDestroyCuModuleNVX, - unix_vkDestroyCudaFunctionNV, - unix_vkDestroyCudaModuleNV, - unix_vkDestroyDebugReportCallbackEXT, - unix_vkDestroyDebugUtilsMessengerEXT, - unix_vkDestroyDeferredOperationKHR, - unix_vkDestroyDescriptorPool, - unix_vkDestroyDescriptorSetLayout, - unix_vkDestroyDescriptorUpdateTemplate, - unix_vkDestroyDescriptorUpdateTemplateKHR, - unix_vkDestroyDevice, - unix_vkDestroyEvent, - unix_vkDestroyFence, - unix_vkDestroyFramebuffer, - unix_vkDestroyImage, - unix_vkDestroyImageView, - unix_vkDestroyIndirectCommandsLayoutEXT, - unix_vkDestroyIndirectCommandsLayoutNV, - unix_vkDestroyIndirectExecutionSetEXT, - unix_vkDestroyInstance, - unix_vkDestroyMicromapEXT, - unix_vkDestroyOpticalFlowSessionNV, - unix_vkDestroyPipeline, - unix_vkDestroyPipelineBinaryKHR, - unix_vkDestroyPipelineCache, - unix_vkDestroyPipelineLayout, - unix_vkDestroyPrivateDataSlot, - unix_vkDestroyPrivateDataSlotEXT, - unix_vkDestroyQueryPool, - unix_vkDestroyRenderPass, - unix_vkDestroySampler, - unix_vkDestroySamplerYcbcrConversion, - unix_vkDestroySamplerYcbcrConversionKHR, - unix_vkDestroySemaphore, - unix_vkDestroyShaderEXT, - unix_vkDestroyShaderModule, - unix_vkDestroySurfaceKHR, - unix_vkDestroySwapchainKHR, - unix_vkDestroyValidationCacheEXT, - unix_vkDestroyVideoSessionKHR, - unix_vkDestroyVideoSessionParametersKHR, - unix_vkDeviceWaitIdle, - unix_vkEndCommandBuffer, - unix_vkEnumerateDeviceExtensionProperties, - unix_vkEnumerateDeviceLayerProperties, - unix_vkEnumerateInstanceExtensionProperties, - unix_vkEnumerateInstanceVersion, - unix_vkEnumeratePhysicalDeviceGroups, - unix_vkEnumeratePhysicalDeviceGroupsKHR, - unix_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR, - unix_vkEnumeratePhysicalDevices, - unix_vkFlushMappedMemoryRanges, - unix_vkFreeCommandBuffers, - unix_vkFreeDescriptorSets, - unix_vkFreeMemory, - unix_vkGetAccelerationStructureBuildSizesKHR, - unix_vkGetAccelerationStructureDeviceAddressKHR, - unix_vkGetAccelerationStructureHandleNV, - unix_vkGetAccelerationStructureMemoryRequirementsNV, - unix_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT, - unix_vkGetBufferDeviceAddress, - unix_vkGetBufferDeviceAddressEXT, - unix_vkGetBufferDeviceAddressKHR, - unix_vkGetBufferMemoryRequirements, - unix_vkGetBufferMemoryRequirements2, - unix_vkGetBufferMemoryRequirements2KHR, - unix_vkGetBufferOpaqueCaptureAddress, - unix_vkGetBufferOpaqueCaptureAddressKHR, - unix_vkGetBufferOpaqueCaptureDescriptorDataEXT, - unix_vkGetCalibratedTimestampsEXT, - unix_vkGetCalibratedTimestampsKHR, - unix_vkGetCudaModuleCacheNV, - unix_vkGetDeferredOperationMaxConcurrencyKHR, - unix_vkGetDeferredOperationResultKHR, - unix_vkGetDescriptorEXT, - unix_vkGetDescriptorSetHostMappingVALVE, - unix_vkGetDescriptorSetLayoutBindingOffsetEXT, - unix_vkGetDescriptorSetLayoutHostMappingInfoVALVE, - unix_vkGetDescriptorSetLayoutSizeEXT, - unix_vkGetDescriptorSetLayoutSupport, - unix_vkGetDescriptorSetLayoutSupportKHR, - unix_vkGetDeviceAccelerationStructureCompatibilityKHR, - unix_vkGetDeviceBufferMemoryRequirements, - unix_vkGetDeviceBufferMemoryRequirementsKHR, - unix_vkGetDeviceFaultInfoEXT, - unix_vkGetDeviceGroupPeerMemoryFeatures, - unix_vkGetDeviceGroupPeerMemoryFeaturesKHR, - unix_vkGetDeviceGroupPresentCapabilitiesKHR, - unix_vkGetDeviceGroupSurfacePresentModesKHR, - unix_vkGetDeviceImageMemoryRequirements, - unix_vkGetDeviceImageMemoryRequirementsKHR, - unix_vkGetDeviceImageSparseMemoryRequirements, - unix_vkGetDeviceImageSparseMemoryRequirementsKHR, - unix_vkGetDeviceImageSubresourceLayout, - unix_vkGetDeviceImageSubresourceLayoutKHR, - unix_vkGetDeviceMemoryCommitment, - unix_vkGetDeviceMemoryOpaqueCaptureAddress, - unix_vkGetDeviceMemoryOpaqueCaptureAddressKHR, - unix_vkGetDeviceMicromapCompatibilityEXT, - unix_vkGetDeviceQueue, - unix_vkGetDeviceQueue2, - unix_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI, - unix_vkGetDynamicRenderingTilePropertiesQCOM, - unix_vkGetEncodedVideoSessionParametersKHR, - unix_vkGetEventStatus, - unix_vkGetFenceStatus, - unix_vkGetFramebufferTilePropertiesQCOM, - unix_vkGetGeneratedCommandsMemoryRequirementsEXT, - unix_vkGetGeneratedCommandsMemoryRequirementsNV, - unix_vkGetImageMemoryRequirements, - unix_vkGetImageMemoryRequirements2, - unix_vkGetImageMemoryRequirements2KHR, - unix_vkGetImageOpaqueCaptureDescriptorDataEXT, - unix_vkGetImageSparseMemoryRequirements, - unix_vkGetImageSparseMemoryRequirements2, - unix_vkGetImageSparseMemoryRequirements2KHR, - unix_vkGetImageSubresourceLayout, - unix_vkGetImageSubresourceLayout2, - unix_vkGetImageSubresourceLayout2EXT, - unix_vkGetImageSubresourceLayout2KHR, - unix_vkGetImageViewAddressNVX, - unix_vkGetImageViewHandle64NVX, - unix_vkGetImageViewHandleNVX, - unix_vkGetImageViewOpaqueCaptureDescriptorDataEXT, - unix_vkGetLatencyTimingsNV, - unix_vkGetMemoryHostPointerPropertiesEXT, - unix_vkGetMicromapBuildSizesEXT, - unix_vkGetPerformanceParameterINTEL, - unix_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT, - unix_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR, - unix_vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV, - unix_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR, - unix_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV, - unix_vkGetPhysicalDeviceExternalBufferProperties, - unix_vkGetPhysicalDeviceExternalBufferPropertiesKHR, - unix_vkGetPhysicalDeviceExternalFenceProperties, - unix_vkGetPhysicalDeviceExternalFencePropertiesKHR, - unix_vkGetPhysicalDeviceExternalSemaphoreProperties, - unix_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, - unix_vkGetPhysicalDeviceFeatures, - unix_vkGetPhysicalDeviceFeatures2, - unix_vkGetPhysicalDeviceFeatures2KHR, - unix_vkGetPhysicalDeviceFormatProperties, - unix_vkGetPhysicalDeviceFormatProperties2, - unix_vkGetPhysicalDeviceFormatProperties2KHR, - unix_vkGetPhysicalDeviceFragmentShadingRatesKHR, - unix_vkGetPhysicalDeviceImageFormatProperties, - unix_vkGetPhysicalDeviceImageFormatProperties2, - unix_vkGetPhysicalDeviceImageFormatProperties2KHR, - unix_vkGetPhysicalDeviceMemoryProperties, - unix_vkGetPhysicalDeviceMemoryProperties2, - unix_vkGetPhysicalDeviceMemoryProperties2KHR, - unix_vkGetPhysicalDeviceMultisamplePropertiesEXT, - unix_vkGetPhysicalDeviceOpticalFlowImageFormatsNV, - unix_vkGetPhysicalDevicePresentRectanglesKHR, - unix_vkGetPhysicalDeviceProperties, - unix_vkGetPhysicalDeviceProperties2, - unix_vkGetPhysicalDeviceProperties2KHR, - unix_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR, - unix_vkGetPhysicalDeviceQueueFamilyProperties, - unix_vkGetPhysicalDeviceQueueFamilyProperties2, - unix_vkGetPhysicalDeviceQueueFamilyProperties2KHR, - unix_vkGetPhysicalDeviceSparseImageFormatProperties, - unix_vkGetPhysicalDeviceSparseImageFormatProperties2, - unix_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, - unix_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV, - unix_vkGetPhysicalDeviceSurfaceCapabilities2KHR, - unix_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, - unix_vkGetPhysicalDeviceSurfaceFormats2KHR, - unix_vkGetPhysicalDeviceSurfaceFormatsKHR, - unix_vkGetPhysicalDeviceSurfacePresentModesKHR, - unix_vkGetPhysicalDeviceSurfaceSupportKHR, - unix_vkGetPhysicalDeviceToolProperties, - unix_vkGetPhysicalDeviceToolPropertiesEXT, - unix_vkGetPhysicalDeviceVideoCapabilitiesKHR, - unix_vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR, - unix_vkGetPhysicalDeviceVideoFormatPropertiesKHR, - unix_vkGetPhysicalDeviceWin32PresentationSupportKHR, - unix_vkGetPipelineBinaryDataKHR, - unix_vkGetPipelineCacheData, - unix_vkGetPipelineExecutableInternalRepresentationsKHR, - unix_vkGetPipelineExecutablePropertiesKHR, - unix_vkGetPipelineExecutableStatisticsKHR, - unix_vkGetPipelineIndirectDeviceAddressNV, - unix_vkGetPipelineIndirectMemoryRequirementsNV, - unix_vkGetPipelineKeyKHR, - unix_vkGetPipelinePropertiesEXT, - unix_vkGetPrivateData, - unix_vkGetPrivateDataEXT, - unix_vkGetQueryPoolResults, - unix_vkGetQueueCheckpointData2NV, - unix_vkGetQueueCheckpointDataNV, - unix_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR, - unix_vkGetRayTracingShaderGroupHandlesKHR, - unix_vkGetRayTracingShaderGroupHandlesNV, - unix_vkGetRayTracingShaderGroupStackSizeKHR, - unix_vkGetRenderAreaGranularity, - unix_vkGetRenderingAreaGranularity, - unix_vkGetRenderingAreaGranularityKHR, - unix_vkGetSamplerOpaqueCaptureDescriptorDataEXT, - unix_vkGetSemaphoreCounterValue, - unix_vkGetSemaphoreCounterValueKHR, - unix_vkGetShaderBinaryDataEXT, - unix_vkGetShaderInfoAMD, - unix_vkGetShaderModuleCreateInfoIdentifierEXT, - unix_vkGetShaderModuleIdentifierEXT, - unix_vkGetSwapchainImagesKHR, - unix_vkGetValidationCacheDataEXT, - unix_vkGetVideoSessionMemoryRequirementsKHR, - unix_vkInitializePerformanceApiINTEL, - unix_vkInvalidateMappedMemoryRanges, - unix_vkLatencySleepNV, - unix_vkMapMemory, - unix_vkMapMemory2, - unix_vkMapMemory2KHR, - unix_vkMergePipelineCaches, - unix_vkMergeValidationCachesEXT, - unix_vkQueueBeginDebugUtilsLabelEXT, - unix_vkQueueBindSparse, - unix_vkQueueEndDebugUtilsLabelEXT, - unix_vkQueueInsertDebugUtilsLabelEXT, - unix_vkQueueNotifyOutOfBandNV, - unix_vkQueuePresentKHR, - unix_vkQueueSetPerformanceConfigurationINTEL, - unix_vkQueueSubmit, - unix_vkQueueSubmit2, - unix_vkQueueSubmit2KHR, - unix_vkQueueWaitIdle, - unix_vkReleaseCapturedPipelineDataKHR, - unix_vkReleasePerformanceConfigurationINTEL, - unix_vkReleaseProfilingLockKHR, - unix_vkReleaseSwapchainImagesEXT, - unix_vkResetCommandBuffer, - unix_vkResetCommandPool, - unix_vkResetDescriptorPool, - unix_vkResetEvent, - unix_vkResetFences, - unix_vkResetQueryPool, - unix_vkResetQueryPoolEXT, - unix_vkSetDebugUtilsObjectNameEXT, - unix_vkSetDebugUtilsObjectTagEXT, - unix_vkSetDeviceMemoryPriorityEXT, - unix_vkSetEvent, - unix_vkSetHdrMetadataEXT, - unix_vkSetLatencyMarkerNV, - unix_vkSetLatencySleepModeNV, - unix_vkSetPrivateData, - unix_vkSetPrivateDataEXT, - unix_vkSignalSemaphore, - unix_vkSignalSemaphoreKHR, - unix_vkSubmitDebugUtilsMessageEXT, - unix_vkTransitionImageLayout, - unix_vkTransitionImageLayoutEXT, - unix_vkTrimCommandPool, - unix_vkTrimCommandPoolKHR, - unix_vkUninitializePerformanceApiINTEL, - unix_vkUnmapMemory, - unix_vkUnmapMemory2, - unix_vkUnmapMemory2KHR, - unix_vkUpdateDescriptorSetWithTemplate, - unix_vkUpdateDescriptorSetWithTemplateKHR, - unix_vkUpdateDescriptorSets, - unix_vkUpdateIndirectExecutionSetPipelineEXT, - unix_vkUpdateIndirectExecutionSetShaderEXT, - unix_vkUpdateVideoSessionParametersKHR, - unix_vkWaitForFences, - unix_vkWaitForPresentKHR, - unix_vkWaitSemaphores, - unix_vkWaitSemaphoresKHR, - unix_vkWriteAccelerationStructuresPropertiesKHR, - unix_vkWriteMicromapsPropertiesEXT, - unix_count, -}; - -struct vkAcquireNextImage2KHR_params -{ - VkDevice device; - const VkAcquireNextImageInfoKHR *pAcquireInfo; - uint32_t *pImageIndex; - VkResult result; -}; - -struct vkAcquireNextImageKHR_params -{ - VkDevice device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - VkFence DECLSPEC_ALIGN(8) fence; - uint32_t *pImageIndex; - VkResult result; -}; - -struct vkAcquirePerformanceConfigurationINTEL_params -{ - VkDevice device; - const VkPerformanceConfigurationAcquireInfoINTEL *pAcquireInfo; - VkPerformanceConfigurationINTEL *pConfiguration; - VkResult result; -}; - -struct vkAcquireProfilingLockKHR_params -{ - VkDevice device; - const VkAcquireProfilingLockInfoKHR *pInfo; - VkResult result; -}; - -struct vkAllocateCommandBuffers_params -{ - VkDevice device; - const VkCommandBufferAllocateInfo *pAllocateInfo; - VkCommandBuffer *pCommandBuffers; - VkResult result; -}; - -struct vkAllocateDescriptorSets_params -{ - VkDevice device; - const VkDescriptorSetAllocateInfo *pAllocateInfo; - VkDescriptorSet *pDescriptorSets; - VkResult result; -}; - -struct vkAllocateMemory_params -{ - VkDevice device; - const VkMemoryAllocateInfo *pAllocateInfo; - const VkAllocationCallbacks *pAllocator; - VkDeviceMemory *pMemory; - VkResult result; -}; - -struct vkAntiLagUpdateAMD_params -{ - VkDevice device; - const VkAntiLagDataAMD *pData; -}; - -struct vkBeginCommandBuffer_params -{ - VkCommandBuffer commandBuffer; - const VkCommandBufferBeginInfo *pBeginInfo; - VkResult result; -}; - -struct vkBindAccelerationStructureMemoryNV_params -{ - VkDevice device; - uint32_t bindInfoCount; - const VkBindAccelerationStructureMemoryInfoNV *pBindInfos; - VkResult result; -}; - -struct vkBindBufferMemory_params -{ - VkDevice device; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; - VkResult result; -}; - -struct vkBindBufferMemory2_params -{ - VkDevice device; - uint32_t bindInfoCount; - const VkBindBufferMemoryInfo *pBindInfos; - VkResult result; -}; - -struct vkBindBufferMemory2KHR_params -{ - VkDevice device; - uint32_t bindInfoCount; - const VkBindBufferMemoryInfo *pBindInfos; - VkResult result; -}; - -struct vkBindImageMemory_params -{ - VkDevice device; - VkImage DECLSPEC_ALIGN(8) image; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; - VkResult result; -}; - -struct vkBindImageMemory2_params -{ - VkDevice device; - uint32_t bindInfoCount; - const VkBindImageMemoryInfo *pBindInfos; - VkResult result; -}; - -struct vkBindImageMemory2KHR_params -{ - VkDevice device; - uint32_t bindInfoCount; - const VkBindImageMemoryInfo *pBindInfos; - VkResult result; -}; - -struct vkBindOpticalFlowSessionImageNV_params -{ - VkDevice device; - VkOpticalFlowSessionNV DECLSPEC_ALIGN(8) session; - VkOpticalFlowSessionBindingPointNV bindingPoint; - VkImageView DECLSPEC_ALIGN(8) view; - VkImageLayout layout; - VkResult result; -}; - -struct vkBindVideoSessionMemoryKHR_params -{ - VkDevice device; - VkVideoSessionKHR DECLSPEC_ALIGN(8) videoSession; - uint32_t bindSessionMemoryInfoCount; - const VkBindVideoSessionMemoryInfoKHR *pBindSessionMemoryInfos; - VkResult result; -}; - -struct vkBuildAccelerationStructuresKHR_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - uint32_t infoCount; - const VkAccelerationStructureBuildGeometryInfoKHR *pInfos; - const VkAccelerationStructureBuildRangeInfoKHR * const*ppBuildRangeInfos; - VkResult result; -}; - -struct vkBuildMicromapsEXT_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - uint32_t infoCount; - const VkMicromapBuildInfoEXT *pInfos; - VkResult result; -}; - -struct vkCmdBeginConditionalRenderingEXT_params -{ - VkCommandBuffer commandBuffer; - const VkConditionalRenderingBeginInfoEXT *pConditionalRenderingBegin; -}; - -struct vkCmdBeginDebugUtilsLabelEXT_params -{ - VkCommandBuffer commandBuffer; - const VkDebugUtilsLabelEXT *pLabelInfo; -}; - -struct vkCmdBeginQuery_params -{ - VkCommandBuffer commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - VkQueryControlFlags flags; -}; - -struct vkCmdBeginQueryIndexedEXT_params -{ - VkCommandBuffer commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - VkQueryControlFlags flags; - uint32_t index; -}; - -struct vkCmdBeginRenderPass_params -{ - VkCommandBuffer commandBuffer; - const VkRenderPassBeginInfo *pRenderPassBegin; - VkSubpassContents contents; -}; - -struct vkCmdBeginRenderPass2_params -{ - VkCommandBuffer commandBuffer; - const VkRenderPassBeginInfo *pRenderPassBegin; - const VkSubpassBeginInfo *pSubpassBeginInfo; -}; - -struct vkCmdBeginRenderPass2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkRenderPassBeginInfo *pRenderPassBegin; - const VkSubpassBeginInfo *pSubpassBeginInfo; -}; - -struct vkCmdBeginRendering_params -{ - VkCommandBuffer commandBuffer; - const VkRenderingInfo *pRenderingInfo; -}; - -struct vkCmdBeginRenderingKHR_params -{ - VkCommandBuffer commandBuffer; - const VkRenderingInfo *pRenderingInfo; -}; - -struct vkCmdBeginTransformFeedbackEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstCounterBuffer; - uint32_t counterBufferCount; - const VkBuffer *pCounterBuffers; - const VkDeviceSize *pCounterBufferOffsets; -}; - -struct vkCmdBeginVideoCodingKHR_params -{ - VkCommandBuffer commandBuffer; - const VkVideoBeginCodingInfoKHR *pBeginInfo; -}; - -struct vkCmdBindDescriptorBufferEmbeddedSamplers2EXT_params -{ - VkCommandBuffer commandBuffer; - const VkBindDescriptorBufferEmbeddedSamplersInfoEXT *pBindDescriptorBufferEmbeddedSamplersInfo; -}; - -struct vkCmdBindDescriptorBufferEmbeddedSamplersEXT_params -{ - VkCommandBuffer commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; -}; - -struct vkCmdBindDescriptorBuffersEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t bufferCount; - const VkDescriptorBufferBindingInfoEXT *pBindingInfos; -}; - -struct vkCmdBindDescriptorSets_params -{ - VkCommandBuffer commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t firstSet; - uint32_t descriptorSetCount; - const VkDescriptorSet *pDescriptorSets; - uint32_t dynamicOffsetCount; - const uint32_t *pDynamicOffsets; -}; - -struct vkCmdBindDescriptorSets2_params -{ - VkCommandBuffer commandBuffer; - const VkBindDescriptorSetsInfo *pBindDescriptorSetsInfo; -}; - -struct vkCmdBindDescriptorSets2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkBindDescriptorSetsInfo *pBindDescriptorSetsInfo; -}; - -struct vkCmdBindIndexBuffer_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkIndexType indexType; -}; - -struct vkCmdBindIndexBuffer2_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkIndexType indexType; -}; - -struct vkCmdBindIndexBuffer2KHR_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkIndexType indexType; -}; - -struct vkCmdBindInvocationMaskHUAWEI_params -{ - VkCommandBuffer commandBuffer; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkImageLayout imageLayout; -}; - -struct vkCmdBindPipeline_params -{ - VkCommandBuffer commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline DECLSPEC_ALIGN(8) pipeline; -}; - -struct vkCmdBindPipelineShaderGroupNV_params -{ - VkCommandBuffer commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t groupIndex; -}; - -struct vkCmdBindShadersEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t stageCount; - const VkShaderStageFlagBits *pStages; - const VkShaderEXT *pShaders; -}; - -struct vkCmdBindShadingRateImageNV_params -{ - VkCommandBuffer commandBuffer; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkImageLayout imageLayout; -}; - -struct vkCmdBindTransformFeedbackBuffersEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstBinding; - uint32_t bindingCount; - const VkBuffer *pBuffers; - const VkDeviceSize *pOffsets; - const VkDeviceSize *pSizes; -}; - -struct vkCmdBindVertexBuffers_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstBinding; - uint32_t bindingCount; - const VkBuffer *pBuffers; - const VkDeviceSize *pOffsets; -}; - -struct vkCmdBindVertexBuffers2_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstBinding; - uint32_t bindingCount; - const VkBuffer *pBuffers; - const VkDeviceSize *pOffsets; - const VkDeviceSize *pSizes; - const VkDeviceSize *pStrides; -}; - -struct vkCmdBindVertexBuffers2EXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstBinding; - uint32_t bindingCount; - const VkBuffer *pBuffers; - const VkDeviceSize *pOffsets; - const VkDeviceSize *pSizes; - const VkDeviceSize *pStrides; -}; - -struct vkCmdBlitImage_params -{ - VkCommandBuffer commandBuffer; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkImageBlit *pRegions; - VkFilter filter; -}; - -struct vkCmdBlitImage2_params -{ - VkCommandBuffer commandBuffer; - const VkBlitImageInfo2 *pBlitImageInfo; -}; - -struct vkCmdBlitImage2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkBlitImageInfo2 *pBlitImageInfo; -}; - -struct vkCmdBuildAccelerationStructureNV_params -{ - VkCommandBuffer commandBuffer; - const VkAccelerationStructureInfoNV *pInfo; - VkBuffer DECLSPEC_ALIGN(8) instanceData; - VkDeviceSize DECLSPEC_ALIGN(8) instanceOffset; - VkBool32 update; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) dst; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) src; - VkBuffer DECLSPEC_ALIGN(8) scratch; - VkDeviceSize DECLSPEC_ALIGN(8) scratchOffset; -}; - -struct vkCmdBuildAccelerationStructuresIndirectKHR_params -{ - VkCommandBuffer commandBuffer; - uint32_t infoCount; - const VkAccelerationStructureBuildGeometryInfoKHR *pInfos; - const VkDeviceAddress *pIndirectDeviceAddresses; - const uint32_t *pIndirectStrides; - const uint32_t * const*ppMaxPrimitiveCounts; -}; - -struct vkCmdBuildAccelerationStructuresKHR_params -{ - VkCommandBuffer commandBuffer; - uint32_t infoCount; - const VkAccelerationStructureBuildGeometryInfoKHR *pInfos; - const VkAccelerationStructureBuildRangeInfoKHR * const*ppBuildRangeInfos; -}; - -struct vkCmdBuildMicromapsEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t infoCount; - const VkMicromapBuildInfoEXT *pInfos; -}; - -struct vkCmdClearAttachments_params -{ - VkCommandBuffer commandBuffer; - uint32_t attachmentCount; - const VkClearAttachment *pAttachments; - uint32_t rectCount; - const VkClearRect *pRects; -}; - -struct vkCmdClearColorImage_params -{ - VkCommandBuffer commandBuffer; - VkImage DECLSPEC_ALIGN(8) image; - VkImageLayout imageLayout; - const VkClearColorValue *pColor; - uint32_t rangeCount; - const VkImageSubresourceRange *pRanges; -}; - -struct vkCmdClearDepthStencilImage_params -{ - VkCommandBuffer commandBuffer; - VkImage DECLSPEC_ALIGN(8) image; - VkImageLayout imageLayout; - const VkClearDepthStencilValue *pDepthStencil; - uint32_t rangeCount; - const VkImageSubresourceRange *pRanges; -}; - -struct vkCmdControlVideoCodingKHR_params -{ - VkCommandBuffer commandBuffer; - const VkVideoCodingControlInfoKHR *pCodingControlInfo; -}; - -struct vkCmdCopyAccelerationStructureKHR_params -{ - VkCommandBuffer commandBuffer; - const VkCopyAccelerationStructureInfoKHR *pInfo; -}; - -struct vkCmdCopyAccelerationStructureNV_params -{ - VkCommandBuffer commandBuffer; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) dst; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) src; - VkCopyAccelerationStructureModeKHR mode; -}; - -struct vkCmdCopyAccelerationStructureToMemoryKHR_params -{ - VkCommandBuffer commandBuffer; - const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo; -}; - -struct vkCmdCopyBuffer_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) srcBuffer; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - uint32_t regionCount; - const VkBufferCopy *pRegions; -}; - -struct vkCmdCopyBuffer2_params -{ - VkCommandBuffer commandBuffer; - const VkCopyBufferInfo2 *pCopyBufferInfo; -}; - -struct vkCmdCopyBuffer2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkCopyBufferInfo2 *pCopyBufferInfo; -}; - -struct vkCmdCopyBufferToImage_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) srcBuffer; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkBufferImageCopy *pRegions; -}; - -struct vkCmdCopyBufferToImage2_params -{ - VkCommandBuffer commandBuffer; - const VkCopyBufferToImageInfo2 *pCopyBufferToImageInfo; -}; - -struct vkCmdCopyBufferToImage2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkCopyBufferToImageInfo2 *pCopyBufferToImageInfo; -}; - -struct vkCmdCopyImage_params -{ - VkCommandBuffer commandBuffer; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkImageCopy *pRegions; -}; - -struct vkCmdCopyImage2_params -{ - VkCommandBuffer commandBuffer; - const VkCopyImageInfo2 *pCopyImageInfo; -}; - -struct vkCmdCopyImage2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkCopyImageInfo2 *pCopyImageInfo; -}; - -struct vkCmdCopyImageToBuffer_params -{ - VkCommandBuffer commandBuffer; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - uint32_t regionCount; - const VkBufferImageCopy *pRegions; -}; - -struct vkCmdCopyImageToBuffer2_params -{ - VkCommandBuffer commandBuffer; - const VkCopyImageToBufferInfo2 *pCopyImageToBufferInfo; -}; - -struct vkCmdCopyImageToBuffer2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkCopyImageToBufferInfo2 *pCopyImageToBufferInfo; -}; - -struct vkCmdCopyMemoryIndirectNV_params -{ - VkCommandBuffer commandBuffer; - VkDeviceAddress DECLSPEC_ALIGN(8) copyBufferAddress; - uint32_t copyCount; - uint32_t stride; -}; - -struct vkCmdCopyMemoryToAccelerationStructureKHR_params -{ - VkCommandBuffer commandBuffer; - const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo; -}; - -struct vkCmdCopyMemoryToImageIndirectNV_params -{ - VkCommandBuffer commandBuffer; - VkDeviceAddress DECLSPEC_ALIGN(8) copyBufferAddress; - uint32_t copyCount; - uint32_t stride; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - const VkImageSubresourceLayers *pImageSubresources; -}; - -struct vkCmdCopyMemoryToMicromapEXT_params -{ - VkCommandBuffer commandBuffer; - const VkCopyMemoryToMicromapInfoEXT *pInfo; -}; - -struct vkCmdCopyMicromapEXT_params -{ - VkCommandBuffer commandBuffer; - const VkCopyMicromapInfoEXT *pInfo; -}; - -struct vkCmdCopyMicromapToMemoryEXT_params -{ - VkCommandBuffer commandBuffer; - const VkCopyMicromapToMemoryInfoEXT *pInfo; -}; - -struct vkCmdCopyQueryPoolResults_params -{ - VkCommandBuffer commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - VkDeviceSize DECLSPEC_ALIGN(8) stride; - VkQueryResultFlags flags; -}; - -struct vkCmdCuLaunchKernelNVX_params -{ - VkCommandBuffer commandBuffer; - const VkCuLaunchInfoNVX *pLaunchInfo; -}; - -struct vkCmdCudaLaunchKernelNV_params -{ - VkCommandBuffer commandBuffer; - const VkCudaLaunchInfoNV *pLaunchInfo; -}; - -struct vkCmdDebugMarkerBeginEXT_params -{ - VkCommandBuffer commandBuffer; - const VkDebugMarkerMarkerInfoEXT *pMarkerInfo; -}; - -struct vkCmdDebugMarkerEndEXT_params -{ - VkCommandBuffer commandBuffer; -}; - -struct vkCmdDebugMarkerInsertEXT_params -{ - VkCommandBuffer commandBuffer; - const VkDebugMarkerMarkerInfoEXT *pMarkerInfo; -}; - -struct vkCmdDecodeVideoKHR_params -{ - VkCommandBuffer commandBuffer; - const VkVideoDecodeInfoKHR *pDecodeInfo; -}; - -struct vkCmdDecompressMemoryIndirectCountNV_params -{ - VkCommandBuffer commandBuffer; - VkDeviceAddress DECLSPEC_ALIGN(8) indirectCommandsAddress; - VkDeviceAddress DECLSPEC_ALIGN(8) indirectCommandsCountAddress; - uint32_t stride; -}; - -struct vkCmdDecompressMemoryNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t decompressRegionCount; - const VkDecompressMemoryRegionNV *pDecompressMemoryRegions; -}; - -struct vkCmdDispatch_params -{ - VkCommandBuffer commandBuffer; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; -}; - -struct vkCmdDispatchBase_params -{ - VkCommandBuffer commandBuffer; - uint32_t baseGroupX; - uint32_t baseGroupY; - uint32_t baseGroupZ; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; -}; - -struct vkCmdDispatchBaseKHR_params -{ - VkCommandBuffer commandBuffer; - uint32_t baseGroupX; - uint32_t baseGroupY; - uint32_t baseGroupZ; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; -}; - -struct vkCmdDispatchIndirect_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; -}; - -struct vkCmdDraw_params -{ - VkCommandBuffer commandBuffer; - uint32_t vertexCount; - uint32_t instanceCount; - uint32_t firstVertex; - uint32_t firstInstance; -}; - -struct vkCmdDrawClusterHUAWEI_params -{ - VkCommandBuffer commandBuffer; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; -}; - -struct vkCmdDrawClusterIndirectHUAWEI_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; -}; - -struct vkCmdDrawIndexed_params -{ - VkCommandBuffer commandBuffer; - uint32_t indexCount; - uint32_t instanceCount; - uint32_t firstIndex; - int32_t vertexOffset; - uint32_t firstInstance; -}; - -struct vkCmdDrawIndexedIndirect_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - uint32_t drawCount; - uint32_t stride; -}; - -struct vkCmdDrawIndexedIndirectCount_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; -}; - -struct vkCmdDrawIndexedIndirectCountAMD_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; -}; - -struct vkCmdDrawIndexedIndirectCountKHR_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; -}; - -struct vkCmdDrawIndirect_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - uint32_t drawCount; - uint32_t stride; -}; - -struct vkCmdDrawIndirectByteCountEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t instanceCount; - uint32_t firstInstance; - VkBuffer DECLSPEC_ALIGN(8) counterBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) counterBufferOffset; - uint32_t counterOffset; - uint32_t vertexStride; -}; - -struct vkCmdDrawIndirectCount_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; -}; - -struct vkCmdDrawIndirectCountAMD_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; -}; - -struct vkCmdDrawIndirectCountKHR_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; -}; - -struct vkCmdDrawMeshTasksEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; -}; - -struct vkCmdDrawMeshTasksIndirectCountEXT_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; -}; - -struct vkCmdDrawMeshTasksIndirectCountNV_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; -}; - -struct vkCmdDrawMeshTasksIndirectEXT_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - uint32_t drawCount; - uint32_t stride; -}; - -struct vkCmdDrawMeshTasksIndirectNV_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - uint32_t drawCount; - uint32_t stride; -}; - -struct vkCmdDrawMeshTasksNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t taskCount; - uint32_t firstTask; -}; - -struct vkCmdDrawMultiEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t drawCount; - const VkMultiDrawInfoEXT *pVertexInfo; - uint32_t instanceCount; - uint32_t firstInstance; - uint32_t stride; -}; - -struct vkCmdDrawMultiIndexedEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t drawCount; - const VkMultiDrawIndexedInfoEXT *pIndexInfo; - uint32_t instanceCount; - uint32_t firstInstance; - uint32_t stride; - const int32_t *pVertexOffset; -}; - -struct vkCmdEncodeVideoKHR_params -{ - VkCommandBuffer commandBuffer; - const VkVideoEncodeInfoKHR *pEncodeInfo; -}; - -struct vkCmdEndConditionalRenderingEXT_params -{ - VkCommandBuffer commandBuffer; -}; - -struct vkCmdEndDebugUtilsLabelEXT_params -{ - VkCommandBuffer commandBuffer; -}; - -struct vkCmdEndQuery_params -{ - VkCommandBuffer commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; -}; - -struct vkCmdEndQueryIndexedEXT_params -{ - VkCommandBuffer commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - uint32_t index; -}; - -struct vkCmdEndRenderPass_params -{ - VkCommandBuffer commandBuffer; -}; - -struct vkCmdEndRenderPass2_params -{ - VkCommandBuffer commandBuffer; - const VkSubpassEndInfo *pSubpassEndInfo; -}; - -struct vkCmdEndRenderPass2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkSubpassEndInfo *pSubpassEndInfo; -}; - -struct vkCmdEndRendering_params -{ - VkCommandBuffer commandBuffer; -}; - -struct vkCmdEndRenderingKHR_params -{ - VkCommandBuffer commandBuffer; -}; - -struct vkCmdEndTransformFeedbackEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstCounterBuffer; - uint32_t counterBufferCount; - const VkBuffer *pCounterBuffers; - const VkDeviceSize *pCounterBufferOffsets; -}; - -struct vkCmdEndVideoCodingKHR_params -{ - VkCommandBuffer commandBuffer; - const VkVideoEndCodingInfoKHR *pEndCodingInfo; -}; - -struct vkCmdExecuteCommands_params -{ - VkCommandBuffer commandBuffer; - uint32_t commandBufferCount; - const VkCommandBuffer *pCommandBuffers; -}; - -struct vkCmdExecuteGeneratedCommandsEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 isPreprocessed; - const VkGeneratedCommandsInfoEXT *pGeneratedCommandsInfo; -}; - -struct vkCmdExecuteGeneratedCommandsNV_params -{ - VkCommandBuffer commandBuffer; - VkBool32 isPreprocessed; - const VkGeneratedCommandsInfoNV *pGeneratedCommandsInfo; -}; - -struct vkCmdFillBuffer_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - uint32_t data; -}; - -struct vkCmdInsertDebugUtilsLabelEXT_params -{ - VkCommandBuffer commandBuffer; - const VkDebugUtilsLabelEXT *pLabelInfo; -}; - -struct vkCmdNextSubpass_params -{ - VkCommandBuffer commandBuffer; - VkSubpassContents contents; -}; - -struct vkCmdNextSubpass2_params -{ - VkCommandBuffer commandBuffer; - const VkSubpassBeginInfo *pSubpassBeginInfo; - const VkSubpassEndInfo *pSubpassEndInfo; -}; - -struct vkCmdNextSubpass2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkSubpassBeginInfo *pSubpassBeginInfo; - const VkSubpassEndInfo *pSubpassEndInfo; -}; - -struct vkCmdOpticalFlowExecuteNV_params -{ - VkCommandBuffer commandBuffer; - VkOpticalFlowSessionNV DECLSPEC_ALIGN(8) session; - const VkOpticalFlowExecuteInfoNV *pExecuteInfo; -}; - -struct vkCmdPipelineBarrier_params -{ - VkCommandBuffer commandBuffer; - VkPipelineStageFlags srcStageMask; - VkPipelineStageFlags dstStageMask; - VkDependencyFlags dependencyFlags; - uint32_t memoryBarrierCount; - const VkMemoryBarrier *pMemoryBarriers; - uint32_t bufferMemoryBarrierCount; - const VkBufferMemoryBarrier *pBufferMemoryBarriers; - uint32_t imageMemoryBarrierCount; - const VkImageMemoryBarrier *pImageMemoryBarriers; -}; - -struct vkCmdPipelineBarrier2_params -{ - VkCommandBuffer commandBuffer; - const VkDependencyInfo *pDependencyInfo; -}; - -struct vkCmdPipelineBarrier2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkDependencyInfo *pDependencyInfo; -}; - -struct vkCmdPreprocessGeneratedCommandsEXT_params -{ - VkCommandBuffer commandBuffer; - const VkGeneratedCommandsInfoEXT *pGeneratedCommandsInfo; - VkCommandBuffer stateCommandBuffer; -}; - -struct vkCmdPreprocessGeneratedCommandsNV_params -{ - VkCommandBuffer commandBuffer; - const VkGeneratedCommandsInfoNV *pGeneratedCommandsInfo; -}; - -struct vkCmdPushConstants_params -{ - VkCommandBuffer commandBuffer; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - VkShaderStageFlags stageFlags; - uint32_t offset; - uint32_t size; - const void *pValues; -}; - -struct vkCmdPushConstants2_params -{ - VkCommandBuffer commandBuffer; - const VkPushConstantsInfo *pPushConstantsInfo; -}; - -struct vkCmdPushConstants2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkPushConstantsInfo *pPushConstantsInfo; -}; - -struct vkCmdPushDescriptorSet_params -{ - VkCommandBuffer commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; - uint32_t descriptorWriteCount; - const VkWriteDescriptorSet *pDescriptorWrites; -}; - -struct vkCmdPushDescriptorSet2_params -{ - VkCommandBuffer commandBuffer; - const VkPushDescriptorSetInfo *pPushDescriptorSetInfo; -}; - -struct vkCmdPushDescriptorSet2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkPushDescriptorSetInfo *pPushDescriptorSetInfo; -}; - -struct vkCmdPushDescriptorSetKHR_params -{ - VkCommandBuffer commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; - uint32_t descriptorWriteCount; - const VkWriteDescriptorSet *pDescriptorWrites; -}; - -struct vkCmdPushDescriptorSetWithTemplate_params -{ - VkCommandBuffer commandBuffer; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; - const void *pData; -}; - -struct vkCmdPushDescriptorSetWithTemplate2_params -{ - VkCommandBuffer commandBuffer; - const VkPushDescriptorSetWithTemplateInfo *pPushDescriptorSetWithTemplateInfo; -}; - -struct vkCmdPushDescriptorSetWithTemplate2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkPushDescriptorSetWithTemplateInfo *pPushDescriptorSetWithTemplateInfo; -}; - -struct vkCmdPushDescriptorSetWithTemplateKHR_params -{ - VkCommandBuffer commandBuffer; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; - const void *pData; -}; - -struct vkCmdResetEvent_params -{ - VkCommandBuffer commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - VkPipelineStageFlags stageMask; -}; - -struct vkCmdResetEvent2_params -{ - VkCommandBuffer commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stageMask; -}; - -struct vkCmdResetEvent2KHR_params -{ - VkCommandBuffer commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stageMask; -}; - -struct vkCmdResetQueryPool_params -{ - VkCommandBuffer commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; -}; - -struct vkCmdResolveImage_params -{ - VkCommandBuffer commandBuffer; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkImageResolve *pRegions; -}; - -struct vkCmdResolveImage2_params -{ - VkCommandBuffer commandBuffer; - const VkResolveImageInfo2 *pResolveImageInfo; -}; - -struct vkCmdResolveImage2KHR_params -{ - VkCommandBuffer commandBuffer; - const VkResolveImageInfo2 *pResolveImageInfo; -}; - -struct vkCmdSetAlphaToCoverageEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 alphaToCoverageEnable; -}; - -struct vkCmdSetAlphaToOneEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 alphaToOneEnable; -}; - -struct vkCmdSetAttachmentFeedbackLoopEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkImageAspectFlags aspectMask; -}; - -struct vkCmdSetBlendConstants_params -{ - VkCommandBuffer commandBuffer; - const float *blendConstants; -}; - -struct vkCmdSetCheckpointNV_params -{ - VkCommandBuffer commandBuffer; - const void *pCheckpointMarker; -}; - -struct vkCmdSetCoarseSampleOrderNV_params -{ - VkCommandBuffer commandBuffer; - VkCoarseSampleOrderTypeNV sampleOrderType; - uint32_t customSampleOrderCount; - const VkCoarseSampleOrderCustomNV *pCustomSampleOrders; -}; - -struct vkCmdSetColorBlendAdvancedEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstAttachment; - uint32_t attachmentCount; - const VkColorBlendAdvancedEXT *pColorBlendAdvanced; -}; - -struct vkCmdSetColorBlendEnableEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstAttachment; - uint32_t attachmentCount; - const VkBool32 *pColorBlendEnables; -}; - -struct vkCmdSetColorBlendEquationEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstAttachment; - uint32_t attachmentCount; - const VkColorBlendEquationEXT *pColorBlendEquations; -}; - -struct vkCmdSetColorWriteEnableEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t attachmentCount; - const VkBool32 *pColorWriteEnables; -}; - -struct vkCmdSetColorWriteMaskEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstAttachment; - uint32_t attachmentCount; - const VkColorComponentFlags *pColorWriteMasks; -}; - -struct vkCmdSetConservativeRasterizationModeEXT_params -{ - VkCommandBuffer commandBuffer; - VkConservativeRasterizationModeEXT conservativeRasterizationMode; -}; - -struct vkCmdSetCoverageModulationModeNV_params -{ - VkCommandBuffer commandBuffer; - VkCoverageModulationModeNV coverageModulationMode; -}; - -struct vkCmdSetCoverageModulationTableEnableNV_params -{ - VkCommandBuffer commandBuffer; - VkBool32 coverageModulationTableEnable; -}; - -struct vkCmdSetCoverageModulationTableNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t coverageModulationTableCount; - const float *pCoverageModulationTable; -}; - -struct vkCmdSetCoverageReductionModeNV_params -{ - VkCommandBuffer commandBuffer; - VkCoverageReductionModeNV coverageReductionMode; -}; - -struct vkCmdSetCoverageToColorEnableNV_params -{ - VkCommandBuffer commandBuffer; - VkBool32 coverageToColorEnable; -}; - -struct vkCmdSetCoverageToColorLocationNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t coverageToColorLocation; -}; - -struct vkCmdSetCullMode_params -{ - VkCommandBuffer commandBuffer; - VkCullModeFlags cullMode; -}; - -struct vkCmdSetCullModeEXT_params -{ - VkCommandBuffer commandBuffer; - VkCullModeFlags cullMode; -}; - -struct vkCmdSetDepthBias_params -{ - VkCommandBuffer commandBuffer; - float depthBiasConstantFactor; - float depthBiasClamp; - float depthBiasSlopeFactor; -}; - -struct vkCmdSetDepthBias2EXT_params -{ - VkCommandBuffer commandBuffer; - const VkDepthBiasInfoEXT *pDepthBiasInfo; -}; - -struct vkCmdSetDepthBiasEnable_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthBiasEnable; -}; - -struct vkCmdSetDepthBiasEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthBiasEnable; -}; - -struct vkCmdSetDepthBounds_params -{ - VkCommandBuffer commandBuffer; - float minDepthBounds; - float maxDepthBounds; -}; - -struct vkCmdSetDepthBoundsTestEnable_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthBoundsTestEnable; -}; - -struct vkCmdSetDepthBoundsTestEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthBoundsTestEnable; -}; - -struct vkCmdSetDepthClampEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthClampEnable; -}; - -struct vkCmdSetDepthClampRangeEXT_params -{ - VkCommandBuffer commandBuffer; - VkDepthClampModeEXT depthClampMode; - const VkDepthClampRangeEXT *pDepthClampRange; -}; - -struct vkCmdSetDepthClipEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthClipEnable; -}; - -struct vkCmdSetDepthClipNegativeOneToOneEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 negativeOneToOne; -}; - -struct vkCmdSetDepthCompareOp_params -{ - VkCommandBuffer commandBuffer; - VkCompareOp depthCompareOp; -}; - -struct vkCmdSetDepthCompareOpEXT_params -{ - VkCommandBuffer commandBuffer; - VkCompareOp depthCompareOp; -}; - -struct vkCmdSetDepthTestEnable_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthTestEnable; -}; - -struct vkCmdSetDepthTestEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthTestEnable; -}; - -struct vkCmdSetDepthWriteEnable_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthWriteEnable; -}; - -struct vkCmdSetDepthWriteEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 depthWriteEnable; -}; - -struct vkCmdSetDescriptorBufferOffsets2EXT_params -{ - VkCommandBuffer commandBuffer; - const VkSetDescriptorBufferOffsetsInfoEXT *pSetDescriptorBufferOffsetsInfo; -}; - -struct vkCmdSetDescriptorBufferOffsetsEXT_params -{ - VkCommandBuffer commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t firstSet; - uint32_t setCount; - const uint32_t *pBufferIndices; - const VkDeviceSize *pOffsets; -}; - -struct vkCmdSetDeviceMask_params -{ - VkCommandBuffer commandBuffer; - uint32_t deviceMask; -}; - -struct vkCmdSetDeviceMaskKHR_params -{ - VkCommandBuffer commandBuffer; - uint32_t deviceMask; -}; - -struct vkCmdSetDiscardRectangleEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstDiscardRectangle; - uint32_t discardRectangleCount; - const VkRect2D *pDiscardRectangles; -}; - -struct vkCmdSetDiscardRectangleEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 discardRectangleEnable; -}; - -struct vkCmdSetDiscardRectangleModeEXT_params -{ - VkCommandBuffer commandBuffer; - VkDiscardRectangleModeEXT discardRectangleMode; -}; - -struct vkCmdSetEvent_params -{ - VkCommandBuffer commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - VkPipelineStageFlags stageMask; -}; - -struct vkCmdSetEvent2_params -{ - VkCommandBuffer commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - const VkDependencyInfo *pDependencyInfo; -}; - -struct vkCmdSetEvent2KHR_params -{ - VkCommandBuffer commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - const VkDependencyInfo *pDependencyInfo; -}; - -struct vkCmdSetExclusiveScissorEnableNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstExclusiveScissor; - uint32_t exclusiveScissorCount; - const VkBool32 *pExclusiveScissorEnables; -}; - -struct vkCmdSetExclusiveScissorNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstExclusiveScissor; - uint32_t exclusiveScissorCount; - const VkRect2D *pExclusiveScissors; -}; - -struct vkCmdSetExtraPrimitiveOverestimationSizeEXT_params -{ - VkCommandBuffer commandBuffer; - float extraPrimitiveOverestimationSize; -}; - -struct vkCmdSetFragmentShadingRateEnumNV_params -{ - VkCommandBuffer commandBuffer; - VkFragmentShadingRateNV shadingRate; - const VkFragmentShadingRateCombinerOpKHR *combinerOps; -}; - -struct vkCmdSetFragmentShadingRateKHR_params -{ - VkCommandBuffer commandBuffer; - const VkExtent2D *pFragmentSize; - const VkFragmentShadingRateCombinerOpKHR *combinerOps; -}; - -struct vkCmdSetFrontFace_params -{ - VkCommandBuffer commandBuffer; - VkFrontFace frontFace; -}; - -struct vkCmdSetFrontFaceEXT_params -{ - VkCommandBuffer commandBuffer; - VkFrontFace frontFace; -}; - -struct vkCmdSetLineRasterizationModeEXT_params -{ - VkCommandBuffer commandBuffer; - VkLineRasterizationModeEXT lineRasterizationMode; -}; - -struct vkCmdSetLineStipple_params -{ - VkCommandBuffer commandBuffer; - uint32_t lineStippleFactor; - uint16_t lineStipplePattern; -}; - -struct vkCmdSetLineStippleEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t lineStippleFactor; - uint16_t lineStipplePattern; -}; - -struct vkCmdSetLineStippleEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 stippledLineEnable; -}; - -struct vkCmdSetLineStippleKHR_params -{ - VkCommandBuffer commandBuffer; - uint32_t lineStippleFactor; - uint16_t lineStipplePattern; -}; - -struct vkCmdSetLineWidth_params -{ - VkCommandBuffer commandBuffer; - float lineWidth; -}; - -struct vkCmdSetLogicOpEXT_params -{ - VkCommandBuffer commandBuffer; - VkLogicOp logicOp; -}; - -struct vkCmdSetLogicOpEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 logicOpEnable; -}; - -struct vkCmdSetPatchControlPointsEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t patchControlPoints; -}; - -struct vkCmdSetPerformanceMarkerINTEL_params -{ - VkCommandBuffer commandBuffer; - const VkPerformanceMarkerInfoINTEL *pMarkerInfo; - VkResult result; -}; - -struct vkCmdSetPerformanceOverrideINTEL_params -{ - VkCommandBuffer commandBuffer; - const VkPerformanceOverrideInfoINTEL *pOverrideInfo; - VkResult result; -}; - -struct vkCmdSetPerformanceStreamMarkerINTEL_params -{ - VkCommandBuffer commandBuffer; - const VkPerformanceStreamMarkerInfoINTEL *pMarkerInfo; - VkResult result; -}; - -struct vkCmdSetPolygonModeEXT_params -{ - VkCommandBuffer commandBuffer; - VkPolygonMode polygonMode; -}; - -struct vkCmdSetPrimitiveRestartEnable_params -{ - VkCommandBuffer commandBuffer; - VkBool32 primitiveRestartEnable; -}; - -struct vkCmdSetPrimitiveRestartEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 primitiveRestartEnable; -}; - -struct vkCmdSetPrimitiveTopology_params -{ - VkCommandBuffer commandBuffer; - VkPrimitiveTopology primitiveTopology; -}; - -struct vkCmdSetPrimitiveTopologyEXT_params -{ - VkCommandBuffer commandBuffer; - VkPrimitiveTopology primitiveTopology; -}; - -struct vkCmdSetProvokingVertexModeEXT_params -{ - VkCommandBuffer commandBuffer; - VkProvokingVertexModeEXT provokingVertexMode; -}; - -struct vkCmdSetRasterizationSamplesEXT_params -{ - VkCommandBuffer commandBuffer; - VkSampleCountFlagBits rasterizationSamples; -}; - -struct vkCmdSetRasterizationStreamEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t rasterizationStream; -}; - -struct vkCmdSetRasterizerDiscardEnable_params -{ - VkCommandBuffer commandBuffer; - VkBool32 rasterizerDiscardEnable; -}; - -struct vkCmdSetRasterizerDiscardEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 rasterizerDiscardEnable; -}; - -struct vkCmdSetRayTracingPipelineStackSizeKHR_params -{ - VkCommandBuffer commandBuffer; - uint32_t pipelineStackSize; -}; - -struct vkCmdSetRenderingAttachmentLocations_params -{ - VkCommandBuffer commandBuffer; - const VkRenderingAttachmentLocationInfo *pLocationInfo; -}; - -struct vkCmdSetRenderingAttachmentLocationsKHR_params -{ - VkCommandBuffer commandBuffer; - const VkRenderingAttachmentLocationInfo *pLocationInfo; -}; - -struct vkCmdSetRenderingInputAttachmentIndices_params -{ - VkCommandBuffer commandBuffer; - const VkRenderingInputAttachmentIndexInfo *pInputAttachmentIndexInfo; -}; - -struct vkCmdSetRenderingInputAttachmentIndicesKHR_params -{ - VkCommandBuffer commandBuffer; - const VkRenderingInputAttachmentIndexInfo *pInputAttachmentIndexInfo; -}; - -struct vkCmdSetRepresentativeFragmentTestEnableNV_params -{ - VkCommandBuffer commandBuffer; - VkBool32 representativeFragmentTestEnable; -}; - -struct vkCmdSetSampleLocationsEXT_params -{ - VkCommandBuffer commandBuffer; - const VkSampleLocationsInfoEXT *pSampleLocationsInfo; -}; - -struct vkCmdSetSampleLocationsEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 sampleLocationsEnable; -}; - -struct vkCmdSetSampleMaskEXT_params -{ - VkCommandBuffer commandBuffer; - VkSampleCountFlagBits samples; - const VkSampleMask *pSampleMask; -}; - -struct vkCmdSetScissor_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstScissor; - uint32_t scissorCount; - const VkRect2D *pScissors; -}; - -struct vkCmdSetScissorWithCount_params -{ - VkCommandBuffer commandBuffer; - uint32_t scissorCount; - const VkRect2D *pScissors; -}; - -struct vkCmdSetScissorWithCountEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t scissorCount; - const VkRect2D *pScissors; -}; - -struct vkCmdSetShadingRateImageEnableNV_params -{ - VkCommandBuffer commandBuffer; - VkBool32 shadingRateImageEnable; -}; - -struct vkCmdSetStencilCompareMask_params -{ - VkCommandBuffer commandBuffer; - VkStencilFaceFlags faceMask; - uint32_t compareMask; -}; - -struct vkCmdSetStencilOp_params -{ - VkCommandBuffer commandBuffer; - VkStencilFaceFlags faceMask; - VkStencilOp failOp; - VkStencilOp passOp; - VkStencilOp depthFailOp; - VkCompareOp compareOp; -}; - -struct vkCmdSetStencilOpEXT_params -{ - VkCommandBuffer commandBuffer; - VkStencilFaceFlags faceMask; - VkStencilOp failOp; - VkStencilOp passOp; - VkStencilOp depthFailOp; - VkCompareOp compareOp; -}; - -struct vkCmdSetStencilReference_params -{ - VkCommandBuffer commandBuffer; - VkStencilFaceFlags faceMask; - uint32_t reference; -}; - -struct vkCmdSetStencilTestEnable_params -{ - VkCommandBuffer commandBuffer; - VkBool32 stencilTestEnable; -}; - -struct vkCmdSetStencilTestEnableEXT_params -{ - VkCommandBuffer commandBuffer; - VkBool32 stencilTestEnable; -}; - -struct vkCmdSetStencilWriteMask_params -{ - VkCommandBuffer commandBuffer; - VkStencilFaceFlags faceMask; - uint32_t writeMask; -}; - -struct vkCmdSetTessellationDomainOriginEXT_params -{ - VkCommandBuffer commandBuffer; - VkTessellationDomainOrigin domainOrigin; -}; - -struct vkCmdSetVertexInputEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t vertexBindingDescriptionCount; - const VkVertexInputBindingDescription2EXT *pVertexBindingDescriptions; - uint32_t vertexAttributeDescriptionCount; - const VkVertexInputAttributeDescription2EXT *pVertexAttributeDescriptions; -}; - -struct vkCmdSetViewport_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstViewport; - uint32_t viewportCount; - const VkViewport *pViewports; -}; - -struct vkCmdSetViewportShadingRatePaletteNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstViewport; - uint32_t viewportCount; - const VkShadingRatePaletteNV *pShadingRatePalettes; -}; - -struct vkCmdSetViewportSwizzleNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstViewport; - uint32_t viewportCount; - const VkViewportSwizzleNV *pViewportSwizzles; -}; - -struct vkCmdSetViewportWScalingEnableNV_params -{ - VkCommandBuffer commandBuffer; - VkBool32 viewportWScalingEnable; -}; - -struct vkCmdSetViewportWScalingNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t firstViewport; - uint32_t viewportCount; - const VkViewportWScalingNV *pViewportWScalings; -}; - -struct vkCmdSetViewportWithCount_params -{ - VkCommandBuffer commandBuffer; - uint32_t viewportCount; - const VkViewport *pViewports; -}; - -struct vkCmdSetViewportWithCountEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t viewportCount; - const VkViewport *pViewports; -}; - -struct vkCmdSubpassShadingHUAWEI_params -{ - VkCommandBuffer commandBuffer; -}; - -struct vkCmdTraceRaysIndirect2KHR_params -{ - VkCommandBuffer commandBuffer; - VkDeviceAddress DECLSPEC_ALIGN(8) indirectDeviceAddress; -}; - -struct vkCmdTraceRaysIndirectKHR_params -{ - VkCommandBuffer commandBuffer; - const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable; - const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable; - const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable; - const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable; - VkDeviceAddress DECLSPEC_ALIGN(8) indirectDeviceAddress; -}; - -struct vkCmdTraceRaysKHR_params -{ - VkCommandBuffer commandBuffer; - const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable; - const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable; - const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable; - const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable; - uint32_t width; - uint32_t height; - uint32_t depth; -}; - -struct vkCmdTraceRaysNV_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) raygenShaderBindingTableBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) raygenShaderBindingOffset; - VkBuffer DECLSPEC_ALIGN(8) missShaderBindingTableBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) missShaderBindingOffset; - VkDeviceSize DECLSPEC_ALIGN(8) missShaderBindingStride; - VkBuffer DECLSPEC_ALIGN(8) hitShaderBindingTableBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) hitShaderBindingOffset; - VkDeviceSize DECLSPEC_ALIGN(8) hitShaderBindingStride; - VkBuffer DECLSPEC_ALIGN(8) callableShaderBindingTableBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) callableShaderBindingOffset; - VkDeviceSize DECLSPEC_ALIGN(8) callableShaderBindingStride; - uint32_t width; - uint32_t height; - uint32_t depth; -}; - -struct vkCmdUpdateBuffer_params -{ - VkCommandBuffer commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - VkDeviceSize DECLSPEC_ALIGN(8) dataSize; - const void *pData; -}; - -struct vkCmdUpdatePipelineIndirectBufferNV_params -{ - VkCommandBuffer commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline DECLSPEC_ALIGN(8) pipeline; -}; - -struct vkCmdWaitEvents_params -{ - VkCommandBuffer commandBuffer; - uint32_t eventCount; - const VkEvent *pEvents; - VkPipelineStageFlags srcStageMask; - VkPipelineStageFlags dstStageMask; - uint32_t memoryBarrierCount; - const VkMemoryBarrier *pMemoryBarriers; - uint32_t bufferMemoryBarrierCount; - const VkBufferMemoryBarrier *pBufferMemoryBarriers; - uint32_t imageMemoryBarrierCount; - const VkImageMemoryBarrier *pImageMemoryBarriers; -}; - -struct vkCmdWaitEvents2_params -{ - VkCommandBuffer commandBuffer; - uint32_t eventCount; - const VkEvent *pEvents; - const VkDependencyInfo *pDependencyInfos; -}; - -struct vkCmdWaitEvents2KHR_params -{ - VkCommandBuffer commandBuffer; - uint32_t eventCount; - const VkEvent *pEvents; - const VkDependencyInfo *pDependencyInfos; -}; - -struct vkCmdWriteAccelerationStructuresPropertiesKHR_params -{ - VkCommandBuffer commandBuffer; - uint32_t accelerationStructureCount; - const VkAccelerationStructureKHR *pAccelerationStructures; - VkQueryType queryType; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; -}; - -struct vkCmdWriteAccelerationStructuresPropertiesNV_params -{ - VkCommandBuffer commandBuffer; - uint32_t accelerationStructureCount; - const VkAccelerationStructureNV *pAccelerationStructures; - VkQueryType queryType; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; -}; - -struct vkCmdWriteBufferMarker2AMD_params -{ - VkCommandBuffer commandBuffer; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stage; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - uint32_t marker; -}; - -struct vkCmdWriteBufferMarkerAMD_params -{ - VkCommandBuffer commandBuffer; - VkPipelineStageFlagBits pipelineStage; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - uint32_t marker; -}; - -struct vkCmdWriteMicromapsPropertiesEXT_params -{ - VkCommandBuffer commandBuffer; - uint32_t micromapCount; - const VkMicromapEXT *pMicromaps; - VkQueryType queryType; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; -}; - -struct vkCmdWriteTimestamp_params -{ - VkCommandBuffer commandBuffer; - VkPipelineStageFlagBits pipelineStage; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; -}; - -struct vkCmdWriteTimestamp2_params -{ - VkCommandBuffer commandBuffer; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stage; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; -}; - -struct vkCmdWriteTimestamp2KHR_params -{ - VkCommandBuffer commandBuffer; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stage; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; -}; - -struct vkCompileDeferredNV_params -{ - VkDevice device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t shader; - VkResult result; -}; - -struct vkCopyAccelerationStructureKHR_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - const VkCopyAccelerationStructureInfoKHR *pInfo; - VkResult result; -}; - -struct vkCopyAccelerationStructureToMemoryKHR_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo; - VkResult result; -}; - -struct vkCopyImageToImage_params -{ - VkDevice device; - const VkCopyImageToImageInfo *pCopyImageToImageInfo; - VkResult result; -}; - -struct vkCopyImageToImageEXT_params -{ - VkDevice device; - const VkCopyImageToImageInfo *pCopyImageToImageInfo; - VkResult result; -}; - -struct vkCopyImageToMemory_params -{ - VkDevice device; - const VkCopyImageToMemoryInfo *pCopyImageToMemoryInfo; - VkResult result; -}; - -struct vkCopyImageToMemoryEXT_params -{ - VkDevice device; - const VkCopyImageToMemoryInfo *pCopyImageToMemoryInfo; - VkResult result; -}; - -struct vkCopyMemoryToAccelerationStructureKHR_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo; - VkResult result; -}; - -struct vkCopyMemoryToImage_params -{ - VkDevice device; - const VkCopyMemoryToImageInfo *pCopyMemoryToImageInfo; - VkResult result; -}; - -struct vkCopyMemoryToImageEXT_params -{ - VkDevice device; - const VkCopyMemoryToImageInfo *pCopyMemoryToImageInfo; - VkResult result; -}; - -struct vkCopyMemoryToMicromapEXT_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - const VkCopyMemoryToMicromapInfoEXT *pInfo; - VkResult result; -}; - -struct vkCopyMicromapEXT_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - const VkCopyMicromapInfoEXT *pInfo; - VkResult result; -}; - -struct vkCopyMicromapToMemoryEXT_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - const VkCopyMicromapToMemoryInfoEXT *pInfo; - VkResult result; -}; - -struct vkCreateAccelerationStructureKHR_params -{ - VkDevice device; - const VkAccelerationStructureCreateInfoKHR *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkAccelerationStructureKHR *pAccelerationStructure; - VkResult result; -}; - -struct vkCreateAccelerationStructureNV_params -{ - VkDevice device; - const VkAccelerationStructureCreateInfoNV *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkAccelerationStructureNV *pAccelerationStructure; - VkResult result; -}; - -struct vkCreateBuffer_params -{ - VkDevice device; - const VkBufferCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkBuffer *pBuffer; - VkResult result; -}; - -struct vkCreateBufferView_params -{ - VkDevice device; - const VkBufferViewCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkBufferView *pView; - VkResult result; -}; - -struct vkCreateCommandPool_params -{ - VkDevice device; - const VkCommandPoolCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkCommandPool *pCommandPool; - void *client_ptr; - VkResult result; -}; - -struct vkCreateComputePipelines_params -{ - VkDevice device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - uint32_t createInfoCount; - const VkComputePipelineCreateInfo *pCreateInfos; - const VkAllocationCallbacks *pAllocator; - VkPipeline *pPipelines; - VkResult result; -}; - -struct vkCreateCuFunctionNVX_params -{ - VkDevice device; - const VkCuFunctionCreateInfoNVX *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkCuFunctionNVX *pFunction; - VkResult result; -}; - -struct vkCreateCuModuleNVX_params -{ - VkDevice device; - const VkCuModuleCreateInfoNVX *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkCuModuleNVX *pModule; - VkResult result; -}; - -struct vkCreateCudaFunctionNV_params -{ - VkDevice device; - const VkCudaFunctionCreateInfoNV *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkCudaFunctionNV *pFunction; - VkResult result; -}; - -struct vkCreateCudaModuleNV_params -{ - VkDevice device; - const VkCudaModuleCreateInfoNV *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkCudaModuleNV *pModule; - VkResult result; -}; - -struct vkCreateDebugReportCallbackEXT_params -{ - VkInstance instance; - const VkDebugReportCallbackCreateInfoEXT *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkDebugReportCallbackEXT *pCallback; - VkResult result; -}; - -struct vkCreateDebugUtilsMessengerEXT_params -{ - VkInstance instance; - const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkDebugUtilsMessengerEXT *pMessenger; - VkResult result; -}; - -struct vkCreateDeferredOperationKHR_params -{ - VkDevice device; - const VkAllocationCallbacks *pAllocator; - VkDeferredOperationKHR *pDeferredOperation; - VkResult result; -}; - -struct vkCreateDescriptorPool_params -{ - VkDevice device; - const VkDescriptorPoolCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkDescriptorPool *pDescriptorPool; - VkResult result; -}; - -struct vkCreateDescriptorSetLayout_params -{ - VkDevice device; - const VkDescriptorSetLayoutCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkDescriptorSetLayout *pSetLayout; - VkResult result; -}; - -struct vkCreateDescriptorUpdateTemplate_params -{ - VkDevice device; - const VkDescriptorUpdateTemplateCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkDescriptorUpdateTemplate *pDescriptorUpdateTemplate; - VkResult result; -}; - -struct vkCreateDescriptorUpdateTemplateKHR_params -{ - VkDevice device; - const VkDescriptorUpdateTemplateCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkDescriptorUpdateTemplate *pDescriptorUpdateTemplate; - VkResult result; -}; - -struct vkCreateDevice_params -{ - VkPhysicalDevice physicalDevice; - const VkDeviceCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkDevice *pDevice; - void *client_ptr; - VkResult result; -}; - -struct vkCreateEvent_params -{ - VkDevice device; - const VkEventCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkEvent *pEvent; - VkResult result; -}; - -struct vkCreateFence_params -{ - VkDevice device; - const VkFenceCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkFence *pFence; - VkResult result; -}; - -struct vkCreateFramebuffer_params -{ - VkDevice device; - const VkFramebufferCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkFramebuffer *pFramebuffer; - VkResult result; -}; - -struct vkCreateGraphicsPipelines_params -{ - VkDevice device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - uint32_t createInfoCount; - const VkGraphicsPipelineCreateInfo *pCreateInfos; - const VkAllocationCallbacks *pAllocator; - VkPipeline *pPipelines; - VkResult result; -}; - -struct vkCreateImage_params -{ - VkDevice device; - const VkImageCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkImage *pImage; - VkResult result; -}; - -struct vkCreateImageView_params -{ - VkDevice device; - const VkImageViewCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkImageView *pView; - VkResult result; -}; - -struct vkCreateIndirectCommandsLayoutEXT_params -{ - VkDevice device; - const VkIndirectCommandsLayoutCreateInfoEXT *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkIndirectCommandsLayoutEXT *pIndirectCommandsLayout; - VkResult result; -}; - -struct vkCreateIndirectCommandsLayoutNV_params -{ - VkDevice device; - const VkIndirectCommandsLayoutCreateInfoNV *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkIndirectCommandsLayoutNV *pIndirectCommandsLayout; - VkResult result; -}; - -struct vkCreateIndirectExecutionSetEXT_params -{ - VkDevice device; - const VkIndirectExecutionSetCreateInfoEXT *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkIndirectExecutionSetEXT *pIndirectExecutionSet; - VkResult result; -}; - -struct vkCreateInstance_params -{ - const VkInstanceCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkInstance *pInstance; - void *client_ptr; - VkResult result; -}; - -struct vkCreateMicromapEXT_params -{ - VkDevice device; - const VkMicromapCreateInfoEXT *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkMicromapEXT *pMicromap; - VkResult result; -}; - -struct vkCreateOpticalFlowSessionNV_params -{ - VkDevice device; - const VkOpticalFlowSessionCreateInfoNV *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkOpticalFlowSessionNV *pSession; - VkResult result; -}; - -struct vkCreatePipelineBinariesKHR_params -{ - VkDevice device; - const VkPipelineBinaryCreateInfoKHR *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkPipelineBinaryHandlesInfoKHR *pBinaries; - VkResult result; -}; - -struct vkCreatePipelineCache_params -{ - VkDevice device; - const VkPipelineCacheCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkPipelineCache *pPipelineCache; - VkResult result; -}; - -struct vkCreatePipelineLayout_params -{ - VkDevice device; - const VkPipelineLayoutCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkPipelineLayout *pPipelineLayout; - VkResult result; -}; - -struct vkCreatePrivateDataSlot_params -{ - VkDevice device; - const VkPrivateDataSlotCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkPrivateDataSlot *pPrivateDataSlot; - VkResult result; -}; - -struct vkCreatePrivateDataSlotEXT_params -{ - VkDevice device; - const VkPrivateDataSlotCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkPrivateDataSlot *pPrivateDataSlot; - VkResult result; -}; - -struct vkCreateQueryPool_params -{ - VkDevice device; - const VkQueryPoolCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkQueryPool *pQueryPool; - VkResult result; -}; - -struct vkCreateRayTracingPipelinesKHR_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - uint32_t createInfoCount; - const VkRayTracingPipelineCreateInfoKHR *pCreateInfos; - const VkAllocationCallbacks *pAllocator; - VkPipeline *pPipelines; - VkResult result; -}; - -struct vkCreateRayTracingPipelinesNV_params -{ - VkDevice device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - uint32_t createInfoCount; - const VkRayTracingPipelineCreateInfoNV *pCreateInfos; - const VkAllocationCallbacks *pAllocator; - VkPipeline *pPipelines; - VkResult result; -}; - -struct vkCreateRenderPass_params -{ - VkDevice device; - const VkRenderPassCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkRenderPass *pRenderPass; - VkResult result; -}; - -struct vkCreateRenderPass2_params -{ - VkDevice device; - const VkRenderPassCreateInfo2 *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkRenderPass *pRenderPass; - VkResult result; -}; - -struct vkCreateRenderPass2KHR_params -{ - VkDevice device; - const VkRenderPassCreateInfo2 *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkRenderPass *pRenderPass; - VkResult result; -}; - -struct vkCreateSampler_params -{ - VkDevice device; - const VkSamplerCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkSampler *pSampler; - VkResult result; -}; - -struct vkCreateSamplerYcbcrConversion_params -{ - VkDevice device; - const VkSamplerYcbcrConversionCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkSamplerYcbcrConversion *pYcbcrConversion; - VkResult result; -}; - -struct vkCreateSamplerYcbcrConversionKHR_params -{ - VkDevice device; - const VkSamplerYcbcrConversionCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkSamplerYcbcrConversion *pYcbcrConversion; - VkResult result; -}; - -struct vkCreateSemaphore_params -{ - VkDevice device; - const VkSemaphoreCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkSemaphore *pSemaphore; - VkResult result; -}; - -struct vkCreateShaderModule_params -{ - VkDevice device; - const VkShaderModuleCreateInfo *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkShaderModule *pShaderModule; - VkResult result; -}; - -struct vkCreateShadersEXT_params -{ - VkDevice device; - uint32_t createInfoCount; - const VkShaderCreateInfoEXT *pCreateInfos; - const VkAllocationCallbacks *pAllocator; - VkShaderEXT *pShaders; - VkResult result; -}; - -struct vkCreateSwapchainKHR_params -{ - VkDevice device; - const VkSwapchainCreateInfoKHR *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkSwapchainKHR *pSwapchain; - VkResult result; -}; - -struct vkCreateValidationCacheEXT_params -{ - VkDevice device; - const VkValidationCacheCreateInfoEXT *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkValidationCacheEXT *pValidationCache; - VkResult result; -}; - -struct vkCreateVideoSessionKHR_params -{ - VkDevice device; - const VkVideoSessionCreateInfoKHR *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkVideoSessionKHR *pVideoSession; - VkResult result; -}; - -struct vkCreateVideoSessionParametersKHR_params -{ - VkDevice device; - const VkVideoSessionParametersCreateInfoKHR *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkVideoSessionParametersKHR *pVideoSessionParameters; - VkResult result; -}; - -struct vkCreateWin32SurfaceKHR_params -{ - VkInstance instance; - const VkWin32SurfaceCreateInfoKHR *pCreateInfo; - const VkAllocationCallbacks *pAllocator; - VkSurfaceKHR *pSurface; - VkResult result; -}; - -struct vkDebugMarkerSetObjectNameEXT_params -{ - VkDevice device; - const VkDebugMarkerObjectNameInfoEXT *pNameInfo; - VkResult result; -}; - -struct vkDebugMarkerSetObjectTagEXT_params -{ - VkDevice device; - const VkDebugMarkerObjectTagInfoEXT *pTagInfo; - VkResult result; -}; - -struct vkDebugReportMessageEXT_params -{ - VkInstance instance; - VkDebugReportFlagsEXT flags; - VkDebugReportObjectTypeEXT objectType; - uint64_t DECLSPEC_ALIGN(8) object; - size_t location; - int32_t messageCode; - const char *pLayerPrefix; - const char *pMessage; -}; - -struct vkDeferredOperationJoinKHR_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) operation; - VkResult result; -}; - -struct vkDestroyAccelerationStructureKHR_params -{ - VkDevice device; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) accelerationStructure; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyAccelerationStructureNV_params -{ - VkDevice device; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) accelerationStructure; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyBuffer_params -{ - VkDevice device; - VkBuffer DECLSPEC_ALIGN(8) buffer; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyBufferView_params -{ - VkDevice device; - VkBufferView DECLSPEC_ALIGN(8) bufferView; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyCommandPool_params -{ - VkDevice device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyCuFunctionNVX_params -{ - VkDevice device; - VkCuFunctionNVX DECLSPEC_ALIGN(8) function; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyCuModuleNVX_params -{ - VkDevice device; - VkCuModuleNVX DECLSPEC_ALIGN(8) module; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyCudaFunctionNV_params -{ - VkDevice device; - VkCudaFunctionNV DECLSPEC_ALIGN(8) function; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyCudaModuleNV_params -{ - VkDevice device; - VkCudaModuleNV DECLSPEC_ALIGN(8) module; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyDebugReportCallbackEXT_params -{ - VkInstance instance; - VkDebugReportCallbackEXT DECLSPEC_ALIGN(8) callback; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyDebugUtilsMessengerEXT_params -{ - VkInstance instance; - VkDebugUtilsMessengerEXT DECLSPEC_ALIGN(8) messenger; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyDeferredOperationKHR_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) operation; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyDescriptorPool_params -{ - VkDevice device; - VkDescriptorPool DECLSPEC_ALIGN(8) descriptorPool; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyDescriptorSetLayout_params -{ - VkDevice device; - VkDescriptorSetLayout DECLSPEC_ALIGN(8) descriptorSetLayout; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyDescriptorUpdateTemplate_params -{ - VkDevice device; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyDescriptorUpdateTemplateKHR_params -{ - VkDevice device; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyDevice_params -{ - VkDevice device; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyEvent_params -{ - VkDevice device; - VkEvent DECLSPEC_ALIGN(8) event; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyFence_params -{ - VkDevice device; - VkFence DECLSPEC_ALIGN(8) fence; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyFramebuffer_params -{ - VkDevice device; - VkFramebuffer DECLSPEC_ALIGN(8) framebuffer; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyImage_params -{ - VkDevice device; - VkImage DECLSPEC_ALIGN(8) image; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyImageView_params -{ - VkDevice device; - VkImageView DECLSPEC_ALIGN(8) imageView; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyIndirectCommandsLayoutEXT_params -{ - VkDevice device; - VkIndirectCommandsLayoutEXT DECLSPEC_ALIGN(8) indirectCommandsLayout; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyIndirectCommandsLayoutNV_params -{ - VkDevice device; - VkIndirectCommandsLayoutNV DECLSPEC_ALIGN(8) indirectCommandsLayout; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyIndirectExecutionSetEXT_params -{ - VkDevice device; - VkIndirectExecutionSetEXT DECLSPEC_ALIGN(8) indirectExecutionSet; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyInstance_params -{ - VkInstance instance; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyMicromapEXT_params -{ - VkDevice device; - VkMicromapEXT DECLSPEC_ALIGN(8) micromap; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyOpticalFlowSessionNV_params -{ - VkDevice device; - VkOpticalFlowSessionNV DECLSPEC_ALIGN(8) session; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyPipeline_params -{ - VkDevice device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyPipelineBinaryKHR_params -{ - VkDevice device; - VkPipelineBinaryKHR DECLSPEC_ALIGN(8) pipelineBinary; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyPipelineCache_params -{ - VkDevice device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyPipelineLayout_params -{ - VkDevice device; - VkPipelineLayout DECLSPEC_ALIGN(8) pipelineLayout; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyPrivateDataSlot_params -{ - VkDevice device; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyPrivateDataSlotEXT_params -{ - VkDevice device; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyQueryPool_params -{ - VkDevice device; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyRenderPass_params -{ - VkDevice device; - VkRenderPass DECLSPEC_ALIGN(8) renderPass; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroySampler_params -{ - VkDevice device; - VkSampler DECLSPEC_ALIGN(8) sampler; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroySamplerYcbcrConversion_params -{ - VkDevice device; - VkSamplerYcbcrConversion DECLSPEC_ALIGN(8) ycbcrConversion; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroySamplerYcbcrConversionKHR_params -{ - VkDevice device; - VkSamplerYcbcrConversion DECLSPEC_ALIGN(8) ycbcrConversion; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroySemaphore_params -{ - VkDevice device; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyShaderEXT_params -{ - VkDevice device; - VkShaderEXT DECLSPEC_ALIGN(8) shader; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyShaderModule_params -{ - VkDevice device; - VkShaderModule DECLSPEC_ALIGN(8) shaderModule; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroySurfaceKHR_params -{ - VkInstance instance; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroySwapchainKHR_params -{ - VkDevice device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyValidationCacheEXT_params -{ - VkDevice device; - VkValidationCacheEXT DECLSPEC_ALIGN(8) validationCache; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyVideoSessionKHR_params -{ - VkDevice device; - VkVideoSessionKHR DECLSPEC_ALIGN(8) videoSession; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDestroyVideoSessionParametersKHR_params -{ - VkDevice device; - VkVideoSessionParametersKHR DECLSPEC_ALIGN(8) videoSessionParameters; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkDeviceWaitIdle_params -{ - VkDevice device; - VkResult result; -}; - -struct vkEndCommandBuffer_params -{ - VkCommandBuffer commandBuffer; - VkResult result; -}; - -struct vkEnumerateDeviceExtensionProperties_params -{ - VkPhysicalDevice physicalDevice; - const char *pLayerName; - uint32_t *pPropertyCount; - VkExtensionProperties *pProperties; - VkResult result; -}; - -struct vkEnumerateDeviceLayerProperties_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pPropertyCount; - VkLayerProperties *pProperties; - VkResult result; -}; - -struct vkEnumerateInstanceExtensionProperties_params -{ - const char *pLayerName; - uint32_t *pPropertyCount; - VkExtensionProperties *pProperties; - VkResult result; -}; - -struct vkEnumerateInstanceVersion_params -{ - uint32_t *pApiVersion; - VkResult result; -}; - -struct vkEnumeratePhysicalDeviceGroups_params -{ - VkInstance instance; - uint32_t *pPhysicalDeviceGroupCount; - VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties; - VkResult result; -}; - -struct vkEnumeratePhysicalDeviceGroupsKHR_params -{ - VkInstance instance; - uint32_t *pPhysicalDeviceGroupCount; - VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties; - VkResult result; -}; - -struct vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR_params -{ - VkPhysicalDevice physicalDevice; - uint32_t queueFamilyIndex; - uint32_t *pCounterCount; - VkPerformanceCounterKHR *pCounters; - VkPerformanceCounterDescriptionKHR *pCounterDescriptions; - VkResult result; -}; - -struct vkEnumeratePhysicalDevices_params -{ - VkInstance instance; - uint32_t *pPhysicalDeviceCount; - VkPhysicalDevice *pPhysicalDevices; - VkResult result; -}; - -struct vkFlushMappedMemoryRanges_params -{ - VkDevice device; - uint32_t memoryRangeCount; - const VkMappedMemoryRange *pMemoryRanges; - VkResult result; -}; - -struct vkFreeCommandBuffers_params -{ - VkDevice device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - uint32_t commandBufferCount; - const VkCommandBuffer *pCommandBuffers; -}; - -struct vkFreeDescriptorSets_params -{ - VkDevice device; - VkDescriptorPool DECLSPEC_ALIGN(8) descriptorPool; - uint32_t descriptorSetCount; - const VkDescriptorSet *pDescriptorSets; - VkResult result; -}; - -struct vkFreeMemory_params -{ - VkDevice device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - const VkAllocationCallbacks *pAllocator; -}; - -struct vkGetAccelerationStructureBuildSizesKHR_params -{ - VkDevice device; - VkAccelerationStructureBuildTypeKHR buildType; - const VkAccelerationStructureBuildGeometryInfoKHR *pBuildInfo; - const uint32_t *pMaxPrimitiveCounts; - VkAccelerationStructureBuildSizesInfoKHR *pSizeInfo; -}; - -struct vkGetAccelerationStructureDeviceAddressKHR_params -{ - VkDevice device; - const VkAccelerationStructureDeviceAddressInfoKHR *pInfo; - VkDeviceAddress result; -}; - -struct vkGetAccelerationStructureHandleNV_params -{ - VkDevice device; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) accelerationStructure; - size_t dataSize; - void *pData; - VkResult result; -}; - -struct vkGetAccelerationStructureMemoryRequirementsNV_params -{ - VkDevice device; - const VkAccelerationStructureMemoryRequirementsInfoNV *pInfo; - VkMemoryRequirements2KHR *pMemoryRequirements; -}; - -struct vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT_params -{ - VkDevice device; - const VkAccelerationStructureCaptureDescriptorDataInfoEXT *pInfo; - void *pData; - VkResult result; -}; - -struct vkGetBufferDeviceAddress_params -{ - VkDevice device; - const VkBufferDeviceAddressInfo *pInfo; - VkDeviceAddress result; -}; - -struct vkGetBufferDeviceAddressEXT_params -{ - VkDevice device; - const VkBufferDeviceAddressInfo *pInfo; - VkDeviceAddress result; -}; - -struct vkGetBufferDeviceAddressKHR_params -{ - VkDevice device; - const VkBufferDeviceAddressInfo *pInfo; - VkDeviceAddress result; -}; - -struct vkGetBufferMemoryRequirements_params -{ - VkDevice device; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkMemoryRequirements *pMemoryRequirements; -}; - -struct vkGetBufferMemoryRequirements2_params -{ - VkDevice device; - const VkBufferMemoryRequirementsInfo2 *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetBufferMemoryRequirements2KHR_params -{ - VkDevice device; - const VkBufferMemoryRequirementsInfo2 *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetBufferOpaqueCaptureAddress_params -{ - VkDevice device; - const VkBufferDeviceAddressInfo *pInfo; - uint64_t result; -}; - -struct vkGetBufferOpaqueCaptureAddressKHR_params -{ - VkDevice device; - const VkBufferDeviceAddressInfo *pInfo; - uint64_t result; -}; - -struct vkGetBufferOpaqueCaptureDescriptorDataEXT_params -{ - VkDevice device; - const VkBufferCaptureDescriptorDataInfoEXT *pInfo; - void *pData; - VkResult result; -}; - -struct vkGetCalibratedTimestampsEXT_params -{ - VkDevice device; - uint32_t timestampCount; - const VkCalibratedTimestampInfoKHR *pTimestampInfos; - uint64_t *pTimestamps; - uint64_t *pMaxDeviation; - VkResult result; -}; - -struct vkGetCalibratedTimestampsKHR_params -{ - VkDevice device; - uint32_t timestampCount; - const VkCalibratedTimestampInfoKHR *pTimestampInfos; - uint64_t *pTimestamps; - uint64_t *pMaxDeviation; - VkResult result; -}; - -struct vkGetCudaModuleCacheNV_params -{ - VkDevice device; - VkCudaModuleNV DECLSPEC_ALIGN(8) module; - size_t *pCacheSize; - void *pCacheData; - VkResult result; -}; - -struct vkGetDeferredOperationMaxConcurrencyKHR_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) operation; - uint32_t result; -}; - -struct vkGetDeferredOperationResultKHR_params -{ - VkDevice device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) operation; - VkResult result; -}; - -struct vkGetDescriptorEXT_params -{ - VkDevice device; - const VkDescriptorGetInfoEXT *pDescriptorInfo; - size_t dataSize; - void *pDescriptor; -}; - -struct vkGetDescriptorSetHostMappingVALVE_params -{ - VkDevice device; - VkDescriptorSet DECLSPEC_ALIGN(8) descriptorSet; - void **ppData; -}; - -struct vkGetDescriptorSetLayoutBindingOffsetEXT_params -{ - VkDevice device; - VkDescriptorSetLayout DECLSPEC_ALIGN(8) layout; - uint32_t binding; - VkDeviceSize *pOffset; -}; - -struct vkGetDescriptorSetLayoutHostMappingInfoVALVE_params -{ - VkDevice device; - const VkDescriptorSetBindingReferenceVALVE *pBindingReference; - VkDescriptorSetLayoutHostMappingInfoVALVE *pHostMapping; -}; - -struct vkGetDescriptorSetLayoutSizeEXT_params -{ - VkDevice device; - VkDescriptorSetLayout DECLSPEC_ALIGN(8) layout; - VkDeviceSize *pLayoutSizeInBytes; -}; - -struct vkGetDescriptorSetLayoutSupport_params -{ - VkDevice device; - const VkDescriptorSetLayoutCreateInfo *pCreateInfo; - VkDescriptorSetLayoutSupport *pSupport; -}; - -struct vkGetDescriptorSetLayoutSupportKHR_params -{ - VkDevice device; - const VkDescriptorSetLayoutCreateInfo *pCreateInfo; - VkDescriptorSetLayoutSupport *pSupport; -}; - -struct vkGetDeviceAccelerationStructureCompatibilityKHR_params -{ - VkDevice device; - const VkAccelerationStructureVersionInfoKHR *pVersionInfo; - VkAccelerationStructureCompatibilityKHR *pCompatibility; -}; - -struct vkGetDeviceBufferMemoryRequirements_params -{ - VkDevice device; - const VkDeviceBufferMemoryRequirements *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetDeviceBufferMemoryRequirementsKHR_params -{ - VkDevice device; - const VkDeviceBufferMemoryRequirements *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetDeviceFaultInfoEXT_params -{ - VkDevice device; - VkDeviceFaultCountsEXT *pFaultCounts; - VkDeviceFaultInfoEXT *pFaultInfo; - VkResult result; -}; - -struct vkGetDeviceGroupPeerMemoryFeatures_params -{ - VkDevice device; - uint32_t heapIndex; - uint32_t localDeviceIndex; - uint32_t remoteDeviceIndex; - VkPeerMemoryFeatureFlags *pPeerMemoryFeatures; -}; - -struct vkGetDeviceGroupPeerMemoryFeaturesKHR_params -{ - VkDevice device; - uint32_t heapIndex; - uint32_t localDeviceIndex; - uint32_t remoteDeviceIndex; - VkPeerMemoryFeatureFlags *pPeerMemoryFeatures; -}; - -struct vkGetDeviceGroupPresentCapabilitiesKHR_params -{ - VkDevice device; - VkDeviceGroupPresentCapabilitiesKHR *pDeviceGroupPresentCapabilities; - VkResult result; -}; - -struct vkGetDeviceGroupSurfacePresentModesKHR_params -{ - VkDevice device; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - VkDeviceGroupPresentModeFlagsKHR *pModes; - VkResult result; -}; - -struct vkGetDeviceImageMemoryRequirements_params -{ - VkDevice device; - const VkDeviceImageMemoryRequirements *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetDeviceImageMemoryRequirementsKHR_params -{ - VkDevice device; - const VkDeviceImageMemoryRequirements *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetDeviceImageSparseMemoryRequirements_params -{ - VkDevice device; - const VkDeviceImageMemoryRequirements *pInfo; - uint32_t *pSparseMemoryRequirementCount; - VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements; -}; - -struct vkGetDeviceImageSparseMemoryRequirementsKHR_params -{ - VkDevice device; - const VkDeviceImageMemoryRequirements *pInfo; - uint32_t *pSparseMemoryRequirementCount; - VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements; -}; - -struct vkGetDeviceImageSubresourceLayout_params -{ - VkDevice device; - const VkDeviceImageSubresourceInfo *pInfo; - VkSubresourceLayout2 *pLayout; -}; - -struct vkGetDeviceImageSubresourceLayoutKHR_params -{ - VkDevice device; - const VkDeviceImageSubresourceInfo *pInfo; - VkSubresourceLayout2 *pLayout; -}; - -struct vkGetDeviceMemoryCommitment_params -{ - VkDevice device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize *pCommittedMemoryInBytes; -}; - -struct vkGetDeviceMemoryOpaqueCaptureAddress_params -{ - VkDevice device; - const VkDeviceMemoryOpaqueCaptureAddressInfo *pInfo; - uint64_t result; -}; - -struct vkGetDeviceMemoryOpaqueCaptureAddressKHR_params -{ - VkDevice device; - const VkDeviceMemoryOpaqueCaptureAddressInfo *pInfo; - uint64_t result; -}; - -struct vkGetDeviceMicromapCompatibilityEXT_params -{ - VkDevice device; - const VkMicromapVersionInfoEXT *pVersionInfo; - VkAccelerationStructureCompatibilityKHR *pCompatibility; -}; - -struct vkGetDeviceQueue_params -{ - VkDevice device; - uint32_t queueFamilyIndex; - uint32_t queueIndex; - VkQueue *pQueue; -}; - -struct vkGetDeviceQueue2_params -{ - VkDevice device; - const VkDeviceQueueInfo2 *pQueueInfo; - VkQueue *pQueue; -}; - -struct vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI_params -{ - VkDevice device; - VkRenderPass DECLSPEC_ALIGN(8) renderpass; - VkExtent2D *pMaxWorkgroupSize; - VkResult result; -}; - -struct vkGetDynamicRenderingTilePropertiesQCOM_params -{ - VkDevice device; - const VkRenderingInfo *pRenderingInfo; - VkTilePropertiesQCOM *pProperties; - VkResult result; -}; - -struct vkGetEncodedVideoSessionParametersKHR_params -{ - VkDevice device; - const VkVideoEncodeSessionParametersGetInfoKHR *pVideoSessionParametersInfo; - VkVideoEncodeSessionParametersFeedbackInfoKHR *pFeedbackInfo; - size_t *pDataSize; - void *pData; - VkResult result; -}; - -struct vkGetEventStatus_params -{ - VkDevice device; - VkEvent DECLSPEC_ALIGN(8) event; - VkResult result; -}; - -struct vkGetFenceStatus_params -{ - VkDevice device; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; -}; - -struct vkGetFramebufferTilePropertiesQCOM_params -{ - VkDevice device; - VkFramebuffer DECLSPEC_ALIGN(8) framebuffer; - uint32_t *pPropertiesCount; - VkTilePropertiesQCOM *pProperties; - VkResult result; -}; - -struct vkGetGeneratedCommandsMemoryRequirementsEXT_params -{ - VkDevice device; - const VkGeneratedCommandsMemoryRequirementsInfoEXT *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetGeneratedCommandsMemoryRequirementsNV_params -{ - VkDevice device; - const VkGeneratedCommandsMemoryRequirementsInfoNV *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetImageMemoryRequirements_params -{ - VkDevice device; - VkImage DECLSPEC_ALIGN(8) image; - VkMemoryRequirements *pMemoryRequirements; -}; - -struct vkGetImageMemoryRequirements2_params -{ - VkDevice device; - const VkImageMemoryRequirementsInfo2 *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetImageMemoryRequirements2KHR_params -{ - VkDevice device; - const VkImageMemoryRequirementsInfo2 *pInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetImageOpaqueCaptureDescriptorDataEXT_params -{ - VkDevice device; - const VkImageCaptureDescriptorDataInfoEXT *pInfo; - void *pData; - VkResult result; -}; - -struct vkGetImageSparseMemoryRequirements_params -{ - VkDevice device; - VkImage DECLSPEC_ALIGN(8) image; - uint32_t *pSparseMemoryRequirementCount; - VkSparseImageMemoryRequirements *pSparseMemoryRequirements; -}; - -struct vkGetImageSparseMemoryRequirements2_params -{ - VkDevice device; - const VkImageSparseMemoryRequirementsInfo2 *pInfo; - uint32_t *pSparseMemoryRequirementCount; - VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements; -}; - -struct vkGetImageSparseMemoryRequirements2KHR_params -{ - VkDevice device; - const VkImageSparseMemoryRequirementsInfo2 *pInfo; - uint32_t *pSparseMemoryRequirementCount; - VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements; -}; - -struct vkGetImageSubresourceLayout_params -{ - VkDevice device; - VkImage DECLSPEC_ALIGN(8) image; - const VkImageSubresource *pSubresource; - VkSubresourceLayout *pLayout; -}; - -struct vkGetImageSubresourceLayout2_params -{ - VkDevice device; - VkImage DECLSPEC_ALIGN(8) image; - const VkImageSubresource2 *pSubresource; - VkSubresourceLayout2 *pLayout; -}; - -struct vkGetImageSubresourceLayout2EXT_params -{ - VkDevice device; - VkImage DECLSPEC_ALIGN(8) image; - const VkImageSubresource2 *pSubresource; - VkSubresourceLayout2 *pLayout; -}; - -struct vkGetImageSubresourceLayout2KHR_params -{ - VkDevice device; - VkImage DECLSPEC_ALIGN(8) image; - const VkImageSubresource2 *pSubresource; - VkSubresourceLayout2 *pLayout; -}; - -struct vkGetImageViewAddressNVX_params -{ - VkDevice device; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkImageViewAddressPropertiesNVX *pProperties; - VkResult result; -}; - -struct vkGetImageViewHandle64NVX_params -{ - VkDevice device; - const VkImageViewHandleInfoNVX *pInfo; - uint64_t result; -}; - -struct vkGetImageViewHandleNVX_params -{ - VkDevice device; - const VkImageViewHandleInfoNVX *pInfo; - uint32_t result; -}; - -struct vkGetImageViewOpaqueCaptureDescriptorDataEXT_params -{ - VkDevice device; - const VkImageViewCaptureDescriptorDataInfoEXT *pInfo; - void *pData; - VkResult result; -}; - -struct vkGetLatencyTimingsNV_params -{ - VkDevice device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - VkGetLatencyMarkerInfoNV *pLatencyMarkerInfo; -}; - -struct vkGetMemoryHostPointerPropertiesEXT_params -{ - VkDevice device; - VkExternalMemoryHandleTypeFlagBits handleType; - const void *pHostPointer; - VkMemoryHostPointerPropertiesEXT *pMemoryHostPointerProperties; - VkResult result; -}; - -struct vkGetMicromapBuildSizesEXT_params -{ - VkDevice device; - VkAccelerationStructureBuildTypeKHR buildType; - const VkMicromapBuildInfoEXT *pBuildInfo; - VkMicromapBuildSizesInfoEXT *pSizeInfo; -}; - -struct vkGetPerformanceParameterINTEL_params -{ - VkDevice device; - VkPerformanceParameterTypeINTEL parameter; - VkPerformanceValueINTEL *pValue; - VkResult result; -}; - -struct vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pTimeDomainCount; - VkTimeDomainKHR *pTimeDomains; - VkResult result; -}; - -struct vkGetPhysicalDeviceCalibrateableTimeDomainsKHR_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pTimeDomainCount; - VkTimeDomainKHR *pTimeDomains; - VkResult result; -}; - -struct vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pPropertyCount; - VkCooperativeMatrixFlexibleDimensionsPropertiesNV *pProperties; - VkResult result; -}; - -struct vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pPropertyCount; - VkCooperativeMatrixPropertiesKHR *pProperties; - VkResult result; -}; - -struct vkGetPhysicalDeviceCooperativeMatrixPropertiesNV_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pPropertyCount; - VkCooperativeMatrixPropertiesNV *pProperties; - VkResult result; -}; - -struct vkGetPhysicalDeviceExternalBufferProperties_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo; - VkExternalBufferProperties *pExternalBufferProperties; -}; - -struct vkGetPhysicalDeviceExternalBufferPropertiesKHR_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo; - VkExternalBufferProperties *pExternalBufferProperties; -}; - -struct vkGetPhysicalDeviceExternalFenceProperties_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo; - VkExternalFenceProperties *pExternalFenceProperties; -}; - -struct vkGetPhysicalDeviceExternalFencePropertiesKHR_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo; - VkExternalFenceProperties *pExternalFenceProperties; -}; - -struct vkGetPhysicalDeviceExternalSemaphoreProperties_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo; - VkExternalSemaphoreProperties *pExternalSemaphoreProperties; -}; - -struct vkGetPhysicalDeviceExternalSemaphorePropertiesKHR_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo; - VkExternalSemaphoreProperties *pExternalSemaphoreProperties; -}; - -struct vkGetPhysicalDeviceFeatures_params -{ - VkPhysicalDevice physicalDevice; - VkPhysicalDeviceFeatures *pFeatures; -}; - -struct vkGetPhysicalDeviceFeatures2_params -{ - VkPhysicalDevice physicalDevice; - VkPhysicalDeviceFeatures2 *pFeatures; -}; - -struct vkGetPhysicalDeviceFeatures2KHR_params -{ - VkPhysicalDevice physicalDevice; - VkPhysicalDeviceFeatures2 *pFeatures; -}; - -struct vkGetPhysicalDeviceFormatProperties_params -{ - VkPhysicalDevice physicalDevice; - VkFormat format; - VkFormatProperties *pFormatProperties; -}; - -struct vkGetPhysicalDeviceFormatProperties2_params -{ - VkPhysicalDevice physicalDevice; - VkFormat format; - VkFormatProperties2 *pFormatProperties; -}; - -struct vkGetPhysicalDeviceFormatProperties2KHR_params -{ - VkPhysicalDevice physicalDevice; - VkFormat format; - VkFormatProperties2 *pFormatProperties; -}; - -struct vkGetPhysicalDeviceFragmentShadingRatesKHR_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pFragmentShadingRateCount; - VkPhysicalDeviceFragmentShadingRateKHR *pFragmentShadingRates; - VkResult result; -}; - -struct vkGetPhysicalDeviceImageFormatProperties_params -{ - VkPhysicalDevice physicalDevice; - VkFormat format; - VkImageType type; - VkImageTiling tiling; - VkImageUsageFlags usage; - VkImageCreateFlags flags; - VkImageFormatProperties *pImageFormatProperties; - VkResult result; -}; - -struct vkGetPhysicalDeviceImageFormatProperties2_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo; - VkImageFormatProperties2 *pImageFormatProperties; - VkResult result; -}; - -struct vkGetPhysicalDeviceImageFormatProperties2KHR_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo; - VkImageFormatProperties2 *pImageFormatProperties; - VkResult result; -}; - -struct vkGetPhysicalDeviceMemoryProperties_params -{ - VkPhysicalDevice physicalDevice; - VkPhysicalDeviceMemoryProperties *pMemoryProperties; -}; - -struct vkGetPhysicalDeviceMemoryProperties2_params -{ - VkPhysicalDevice physicalDevice; - VkPhysicalDeviceMemoryProperties2 *pMemoryProperties; -}; - -struct vkGetPhysicalDeviceMemoryProperties2KHR_params -{ - VkPhysicalDevice physicalDevice; - VkPhysicalDeviceMemoryProperties2 *pMemoryProperties; -}; - -struct vkGetPhysicalDeviceMultisamplePropertiesEXT_params -{ - VkPhysicalDevice physicalDevice; - VkSampleCountFlagBits samples; - VkMultisamplePropertiesEXT *pMultisampleProperties; -}; - -struct vkGetPhysicalDeviceOpticalFlowImageFormatsNV_params -{ - VkPhysicalDevice physicalDevice; - const VkOpticalFlowImageFormatInfoNV *pOpticalFlowImageFormatInfo; - uint32_t *pFormatCount; - VkOpticalFlowImageFormatPropertiesNV *pImageFormatProperties; - VkResult result; -}; - -struct vkGetPhysicalDevicePresentRectanglesKHR_params -{ - VkPhysicalDevice physicalDevice; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - uint32_t *pRectCount; - VkRect2D *pRects; - VkResult result; -}; - -struct vkGetPhysicalDeviceProperties_params -{ - VkPhysicalDevice physicalDevice; - VkPhysicalDeviceProperties *pProperties; -}; - -struct vkGetPhysicalDeviceProperties2_params -{ - VkPhysicalDevice physicalDevice; - VkPhysicalDeviceProperties2 *pProperties; -}; - -struct vkGetPhysicalDeviceProperties2KHR_params -{ - VkPhysicalDevice physicalDevice; - VkPhysicalDeviceProperties2 *pProperties; -}; - -struct vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR_params -{ - VkPhysicalDevice physicalDevice; - const VkQueryPoolPerformanceCreateInfoKHR *pPerformanceQueryCreateInfo; - uint32_t *pNumPasses; -}; - -struct vkGetPhysicalDeviceQueueFamilyProperties_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pQueueFamilyPropertyCount; - VkQueueFamilyProperties *pQueueFamilyProperties; -}; - -struct vkGetPhysicalDeviceQueueFamilyProperties2_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pQueueFamilyPropertyCount; - VkQueueFamilyProperties2 *pQueueFamilyProperties; -}; - -struct vkGetPhysicalDeviceQueueFamilyProperties2KHR_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pQueueFamilyPropertyCount; - VkQueueFamilyProperties2 *pQueueFamilyProperties; -}; - -struct vkGetPhysicalDeviceSparseImageFormatProperties_params -{ - VkPhysicalDevice physicalDevice; - VkFormat format; - VkImageType type; - VkSampleCountFlagBits samples; - VkImageUsageFlags usage; - VkImageTiling tiling; - uint32_t *pPropertyCount; - VkSparseImageFormatProperties *pProperties; -}; - -struct vkGetPhysicalDeviceSparseImageFormatProperties2_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceSparseImageFormatInfo2 *pFormatInfo; - uint32_t *pPropertyCount; - VkSparseImageFormatProperties2 *pProperties; -}; - -struct vkGetPhysicalDeviceSparseImageFormatProperties2KHR_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceSparseImageFormatInfo2 *pFormatInfo; - uint32_t *pPropertyCount; - VkSparseImageFormatProperties2 *pProperties; -}; - -struct vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pCombinationCount; - VkFramebufferMixedSamplesCombinationNV *pCombinations; - VkResult result; -}; - -struct vkGetPhysicalDeviceSurfaceCapabilities2KHR_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo; - VkSurfaceCapabilities2KHR *pSurfaceCapabilities; - VkResult result; -}; - -struct vkGetPhysicalDeviceSurfaceCapabilitiesKHR_params -{ - VkPhysicalDevice physicalDevice; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - VkSurfaceCapabilitiesKHR *pSurfaceCapabilities; - VkResult result; -}; - -struct vkGetPhysicalDeviceSurfaceFormats2KHR_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo; - uint32_t *pSurfaceFormatCount; - VkSurfaceFormat2KHR *pSurfaceFormats; - VkResult result; -}; - -struct vkGetPhysicalDeviceSurfaceFormatsKHR_params -{ - VkPhysicalDevice physicalDevice; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - uint32_t *pSurfaceFormatCount; - VkSurfaceFormatKHR *pSurfaceFormats; - VkResult result; -}; - -struct vkGetPhysicalDeviceSurfacePresentModesKHR_params -{ - VkPhysicalDevice physicalDevice; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - uint32_t *pPresentModeCount; - VkPresentModeKHR *pPresentModes; - VkResult result; -}; - -struct vkGetPhysicalDeviceSurfaceSupportKHR_params -{ - VkPhysicalDevice physicalDevice; - uint32_t queueFamilyIndex; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - VkBool32 *pSupported; - VkResult result; -}; - -struct vkGetPhysicalDeviceToolProperties_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pToolCount; - VkPhysicalDeviceToolProperties *pToolProperties; - VkResult result; -}; - -struct vkGetPhysicalDeviceToolPropertiesEXT_params -{ - VkPhysicalDevice physicalDevice; - uint32_t *pToolCount; - VkPhysicalDeviceToolProperties *pToolProperties; - VkResult result; -}; - -struct vkGetPhysicalDeviceVideoCapabilitiesKHR_params -{ - VkPhysicalDevice physicalDevice; - const VkVideoProfileInfoKHR *pVideoProfile; - VkVideoCapabilitiesKHR *pCapabilities; - VkResult result; -}; - -struct vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR *pQualityLevelInfo; - VkVideoEncodeQualityLevelPropertiesKHR *pQualityLevelProperties; - VkResult result; -}; - -struct vkGetPhysicalDeviceVideoFormatPropertiesKHR_params -{ - VkPhysicalDevice physicalDevice; - const VkPhysicalDeviceVideoFormatInfoKHR *pVideoFormatInfo; - uint32_t *pVideoFormatPropertyCount; - VkVideoFormatPropertiesKHR *pVideoFormatProperties; - VkResult result; -}; - -struct vkGetPhysicalDeviceWin32PresentationSupportKHR_params -{ - VkPhysicalDevice physicalDevice; - uint32_t queueFamilyIndex; - VkBool32 result; -}; - -struct vkGetPipelineBinaryDataKHR_params -{ - VkDevice device; - const VkPipelineBinaryDataInfoKHR *pInfo; - VkPipelineBinaryKeyKHR *pPipelineBinaryKey; - size_t *pPipelineBinaryDataSize; - void *pPipelineBinaryData; - VkResult result; -}; - -struct vkGetPipelineCacheData_params -{ - VkDevice device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - size_t *pDataSize; - void *pData; - VkResult result; -}; - -struct vkGetPipelineExecutableInternalRepresentationsKHR_params -{ - VkDevice device; - const VkPipelineExecutableInfoKHR *pExecutableInfo; - uint32_t *pInternalRepresentationCount; - VkPipelineExecutableInternalRepresentationKHR *pInternalRepresentations; - VkResult result; -}; - -struct vkGetPipelineExecutablePropertiesKHR_params -{ - VkDevice device; - const VkPipelineInfoKHR *pPipelineInfo; - uint32_t *pExecutableCount; - VkPipelineExecutablePropertiesKHR *pProperties; - VkResult result; -}; - -struct vkGetPipelineExecutableStatisticsKHR_params -{ - VkDevice device; - const VkPipelineExecutableInfoKHR *pExecutableInfo; - uint32_t *pStatisticCount; - VkPipelineExecutableStatisticKHR *pStatistics; - VkResult result; -}; - -struct vkGetPipelineIndirectDeviceAddressNV_params -{ - VkDevice device; - const VkPipelineIndirectDeviceAddressInfoNV *pInfo; - VkDeviceAddress result; -}; - -struct vkGetPipelineIndirectMemoryRequirementsNV_params -{ - VkDevice device; - const VkComputePipelineCreateInfo *pCreateInfo; - VkMemoryRequirements2 *pMemoryRequirements; -}; - -struct vkGetPipelineKeyKHR_params -{ - VkDevice device; - const VkPipelineCreateInfoKHR *pPipelineCreateInfo; - VkPipelineBinaryKeyKHR *pPipelineKey; - VkResult result; -}; - -struct vkGetPipelinePropertiesEXT_params -{ - VkDevice device; - const VkPipelineInfoEXT *pPipelineInfo; - VkBaseOutStructure *pPipelineProperties; - VkResult result; -}; - -struct vkGetPrivateData_params -{ - VkDevice device; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - uint64_t *pData; -}; - -struct vkGetPrivateDataEXT_params -{ - VkDevice device; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - uint64_t *pData; -}; - -struct vkGetQueryPoolResults_params -{ - VkDevice device; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; - size_t dataSize; - void *pData; - VkDeviceSize DECLSPEC_ALIGN(8) stride; - VkQueryResultFlags flags; - VkResult result; -}; - -struct vkGetQueueCheckpointData2NV_params -{ - VkQueue queue; - uint32_t *pCheckpointDataCount; - VkCheckpointData2NV *pCheckpointData; -}; - -struct vkGetQueueCheckpointDataNV_params -{ - VkQueue queue; - uint32_t *pCheckpointDataCount; - VkCheckpointDataNV *pCheckpointData; -}; - -struct vkGetRayTracingCaptureReplayShaderGroupHandlesKHR_params -{ - VkDevice device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t firstGroup; - uint32_t groupCount; - size_t dataSize; - void *pData; - VkResult result; -}; - -struct vkGetRayTracingShaderGroupHandlesKHR_params -{ - VkDevice device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t firstGroup; - uint32_t groupCount; - size_t dataSize; - void *pData; - VkResult result; -}; - -struct vkGetRayTracingShaderGroupHandlesNV_params -{ - VkDevice device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t firstGroup; - uint32_t groupCount; - size_t dataSize; - void *pData; - VkResult result; -}; - -struct vkGetRayTracingShaderGroupStackSizeKHR_params -{ - VkDevice device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t group; - VkShaderGroupShaderKHR groupShader; - VkDeviceSize result; -}; - -struct vkGetRenderAreaGranularity_params -{ - VkDevice device; - VkRenderPass DECLSPEC_ALIGN(8) renderPass; - VkExtent2D *pGranularity; -}; - -struct vkGetRenderingAreaGranularity_params -{ - VkDevice device; - const VkRenderingAreaInfo *pRenderingAreaInfo; - VkExtent2D *pGranularity; -}; - -struct vkGetRenderingAreaGranularityKHR_params -{ - VkDevice device; - const VkRenderingAreaInfo *pRenderingAreaInfo; - VkExtent2D *pGranularity; -}; - -struct vkGetSamplerOpaqueCaptureDescriptorDataEXT_params -{ - VkDevice device; - const VkSamplerCaptureDescriptorDataInfoEXT *pInfo; - void *pData; - VkResult result; -}; - -struct vkGetSemaphoreCounterValue_params -{ - VkDevice device; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - uint64_t *pValue; - VkResult result; -}; - -struct vkGetSemaphoreCounterValueKHR_params -{ - VkDevice device; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - uint64_t *pValue; - VkResult result; -}; - -struct vkGetShaderBinaryDataEXT_params -{ - VkDevice device; - VkShaderEXT DECLSPEC_ALIGN(8) shader; - size_t *pDataSize; - void *pData; - VkResult result; -}; - -struct vkGetShaderInfoAMD_params -{ - VkDevice device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - VkShaderStageFlagBits shaderStage; - VkShaderInfoTypeAMD infoType; - size_t *pInfoSize; - void *pInfo; - VkResult result; -}; - -struct vkGetShaderModuleCreateInfoIdentifierEXT_params -{ - VkDevice device; - const VkShaderModuleCreateInfo *pCreateInfo; - VkShaderModuleIdentifierEXT *pIdentifier; -}; - -struct vkGetShaderModuleIdentifierEXT_params -{ - VkDevice device; - VkShaderModule DECLSPEC_ALIGN(8) shaderModule; - VkShaderModuleIdentifierEXT *pIdentifier; -}; - -struct vkGetSwapchainImagesKHR_params -{ - VkDevice device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - uint32_t *pSwapchainImageCount; - VkImage *pSwapchainImages; - VkResult result; -}; - -struct vkGetValidationCacheDataEXT_params -{ - VkDevice device; - VkValidationCacheEXT DECLSPEC_ALIGN(8) validationCache; - size_t *pDataSize; - void *pData; - VkResult result; -}; - -struct vkGetVideoSessionMemoryRequirementsKHR_params -{ - VkDevice device; - VkVideoSessionKHR DECLSPEC_ALIGN(8) videoSession; - uint32_t *pMemoryRequirementsCount; - VkVideoSessionMemoryRequirementsKHR *pMemoryRequirements; - VkResult result; -}; - -struct vkInitializePerformanceApiINTEL_params -{ - VkDevice device; - const VkInitializePerformanceApiInfoINTEL *pInitializeInfo; - VkResult result; -}; - -struct vkInvalidateMappedMemoryRanges_params -{ - VkDevice device; - uint32_t memoryRangeCount; - const VkMappedMemoryRange *pMemoryRanges; - VkResult result; -}; - -struct vkLatencySleepNV_params -{ - VkDevice device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - const VkLatencySleepInfoNV *pSleepInfo; - VkResult result; -}; - -struct vkMapMemory_params -{ - VkDevice device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkMemoryMapFlags flags; - void **ppData; - VkResult result; -}; - -struct vkMapMemory2_params -{ - VkDevice device; - const VkMemoryMapInfo *pMemoryMapInfo; - void **ppData; - VkResult result; -}; - -struct vkMapMemory2KHR_params -{ - VkDevice device; - const VkMemoryMapInfo *pMemoryMapInfo; - void **ppData; - VkResult result; -}; - -struct vkMergePipelineCaches_params -{ - VkDevice device; - VkPipelineCache DECLSPEC_ALIGN(8) dstCache; - uint32_t srcCacheCount; - const VkPipelineCache *pSrcCaches; - VkResult result; -}; - -struct vkMergeValidationCachesEXT_params -{ - VkDevice device; - VkValidationCacheEXT DECLSPEC_ALIGN(8) dstCache; - uint32_t srcCacheCount; - const VkValidationCacheEXT *pSrcCaches; - VkResult result; -}; - -struct vkQueueBeginDebugUtilsLabelEXT_params -{ - VkQueue queue; - const VkDebugUtilsLabelEXT *pLabelInfo; -}; - -struct vkQueueBindSparse_params -{ - VkQueue queue; - uint32_t bindInfoCount; - const VkBindSparseInfo *pBindInfo; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; -}; - -struct vkQueueEndDebugUtilsLabelEXT_params -{ - VkQueue queue; -}; - -struct vkQueueInsertDebugUtilsLabelEXT_params -{ - VkQueue queue; - const VkDebugUtilsLabelEXT *pLabelInfo; -}; - -struct vkQueueNotifyOutOfBandNV_params -{ - VkQueue queue; - const VkOutOfBandQueueTypeInfoNV *pQueueTypeInfo; -}; - -struct vkQueuePresentKHR_params -{ - VkQueue queue; - const VkPresentInfoKHR *pPresentInfo; - VkResult result; -}; - -struct vkQueueSetPerformanceConfigurationINTEL_params -{ - VkQueue queue; - VkPerformanceConfigurationINTEL DECLSPEC_ALIGN(8) configuration; - VkResult result; -}; - -struct vkQueueSubmit_params -{ - VkQueue queue; - uint32_t submitCount; - const VkSubmitInfo *pSubmits; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; -}; - -struct vkQueueSubmit2_params -{ - VkQueue queue; - uint32_t submitCount; - const VkSubmitInfo2 *pSubmits; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; -}; - -struct vkQueueSubmit2KHR_params -{ - VkQueue queue; - uint32_t submitCount; - const VkSubmitInfo2 *pSubmits; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; -}; - -struct vkQueueWaitIdle_params -{ - VkQueue queue; - VkResult result; -}; - -struct vkReleaseCapturedPipelineDataKHR_params -{ - VkDevice device; - const VkReleaseCapturedPipelineDataInfoKHR *pInfo; - const VkAllocationCallbacks *pAllocator; - VkResult result; -}; - -struct vkReleasePerformanceConfigurationINTEL_params -{ - VkDevice device; - VkPerformanceConfigurationINTEL DECLSPEC_ALIGN(8) configuration; - VkResult result; -}; - -struct vkReleaseProfilingLockKHR_params -{ - VkDevice device; -}; - -struct vkReleaseSwapchainImagesEXT_params -{ - VkDevice device; - const VkReleaseSwapchainImagesInfoEXT *pReleaseInfo; - VkResult result; -}; - -struct vkResetCommandBuffer_params -{ - VkCommandBuffer commandBuffer; - VkCommandBufferResetFlags flags; - VkResult result; -}; - -struct vkResetCommandPool_params -{ - VkDevice device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - VkCommandPoolResetFlags flags; - VkResult result; -}; - -struct vkResetDescriptorPool_params -{ - VkDevice device; - VkDescriptorPool DECLSPEC_ALIGN(8) descriptorPool; - VkDescriptorPoolResetFlags flags; - VkResult result; -}; - -struct vkResetEvent_params -{ - VkDevice device; - VkEvent DECLSPEC_ALIGN(8) event; - VkResult result; -}; - -struct vkResetFences_params -{ - VkDevice device; - uint32_t fenceCount; - const VkFence *pFences; - VkResult result; -}; - -struct vkResetQueryPool_params -{ - VkDevice device; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; -}; - -struct vkResetQueryPoolEXT_params -{ - VkDevice device; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; -}; - -struct vkSetDebugUtilsObjectNameEXT_params -{ - VkDevice device; - const VkDebugUtilsObjectNameInfoEXT *pNameInfo; - VkResult result; -}; - -struct vkSetDebugUtilsObjectTagEXT_params -{ - VkDevice device; - const VkDebugUtilsObjectTagInfoEXT *pTagInfo; - VkResult result; -}; - -struct vkSetDeviceMemoryPriorityEXT_params -{ - VkDevice device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - float priority; -}; - -struct vkSetEvent_params -{ - VkDevice device; - VkEvent DECLSPEC_ALIGN(8) event; - VkResult result; -}; - -struct vkSetHdrMetadataEXT_params -{ - VkDevice device; - uint32_t swapchainCount; - const VkSwapchainKHR *pSwapchains; - const VkHdrMetadataEXT *pMetadata; -}; - -struct vkSetLatencyMarkerNV_params -{ - VkDevice device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - const VkSetLatencyMarkerInfoNV *pLatencyMarkerInfo; -}; - -struct vkSetLatencySleepModeNV_params -{ - VkDevice device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - const VkLatencySleepModeInfoNV *pSleepModeInfo; - VkResult result; -}; - -struct vkSetPrivateData_params -{ - VkDevice device; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - uint64_t DECLSPEC_ALIGN(8) data; - VkResult result; -}; - -struct vkSetPrivateDataEXT_params -{ - VkDevice device; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - uint64_t DECLSPEC_ALIGN(8) data; - VkResult result; -}; - -struct vkSignalSemaphore_params -{ - VkDevice device; - const VkSemaphoreSignalInfo *pSignalInfo; - VkResult result; -}; - -struct vkSignalSemaphoreKHR_params -{ - VkDevice device; - const VkSemaphoreSignalInfo *pSignalInfo; - VkResult result; -}; - -struct vkSubmitDebugUtilsMessageEXT_params -{ - VkInstance instance; - VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity; - VkDebugUtilsMessageTypeFlagsEXT messageTypes; - const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData; -}; - -struct vkTransitionImageLayout_params -{ - VkDevice device; - uint32_t transitionCount; - const VkHostImageLayoutTransitionInfo *pTransitions; - VkResult result; -}; - -struct vkTransitionImageLayoutEXT_params -{ - VkDevice device; - uint32_t transitionCount; - const VkHostImageLayoutTransitionInfo *pTransitions; - VkResult result; -}; - -struct vkTrimCommandPool_params -{ - VkDevice device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - VkCommandPoolTrimFlags flags; -}; - -struct vkTrimCommandPoolKHR_params -{ - VkDevice device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - VkCommandPoolTrimFlags flags; -}; - -struct vkUninitializePerformanceApiINTEL_params -{ - VkDevice device; -}; - -struct vkUnmapMemory_params -{ - VkDevice device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; -}; - -struct vkUnmapMemory2_params -{ - VkDevice device; - const VkMemoryUnmapInfo *pMemoryUnmapInfo; - VkResult result; -}; - -struct vkUnmapMemory2KHR_params -{ - VkDevice device; - const VkMemoryUnmapInfo *pMemoryUnmapInfo; - VkResult result; -}; - -struct vkUpdateDescriptorSetWithTemplate_params -{ - VkDevice device; - VkDescriptorSet DECLSPEC_ALIGN(8) descriptorSet; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - const void *pData; -}; - -struct vkUpdateDescriptorSetWithTemplateKHR_params -{ - VkDevice device; - VkDescriptorSet DECLSPEC_ALIGN(8) descriptorSet; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - const void *pData; -}; - -struct vkUpdateDescriptorSets_params -{ - VkDevice device; - uint32_t descriptorWriteCount; - const VkWriteDescriptorSet *pDescriptorWrites; - uint32_t descriptorCopyCount; - const VkCopyDescriptorSet *pDescriptorCopies; -}; - -struct vkUpdateIndirectExecutionSetPipelineEXT_params -{ - VkDevice device; - VkIndirectExecutionSetEXT DECLSPEC_ALIGN(8) indirectExecutionSet; - uint32_t executionSetWriteCount; - const VkWriteIndirectExecutionSetPipelineEXT *pExecutionSetWrites; -}; - -struct vkUpdateIndirectExecutionSetShaderEXT_params -{ - VkDevice device; - VkIndirectExecutionSetEXT DECLSPEC_ALIGN(8) indirectExecutionSet; - uint32_t executionSetWriteCount; - const VkWriteIndirectExecutionSetShaderEXT *pExecutionSetWrites; -}; - -struct vkUpdateVideoSessionParametersKHR_params -{ - VkDevice device; - VkVideoSessionParametersKHR DECLSPEC_ALIGN(8) videoSessionParameters; - const VkVideoSessionParametersUpdateInfoKHR *pUpdateInfo; - VkResult result; -}; - -struct vkWaitForFences_params -{ - VkDevice device; - uint32_t fenceCount; - const VkFence *pFences; - VkBool32 waitAll; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkResult result; -}; - -struct vkWaitForPresentKHR_params -{ - VkDevice device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - uint64_t DECLSPEC_ALIGN(8) presentId; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkResult result; -}; - -struct vkWaitSemaphores_params -{ - VkDevice device; - const VkSemaphoreWaitInfo *pWaitInfo; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkResult result; -}; - -struct vkWaitSemaphoresKHR_params -{ - VkDevice device; - const VkSemaphoreWaitInfo *pWaitInfo; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkResult result; -}; - -struct vkWriteAccelerationStructuresPropertiesKHR_params -{ - VkDevice device; - uint32_t accelerationStructureCount; - const VkAccelerationStructureKHR *pAccelerationStructures; - VkQueryType queryType; - size_t dataSize; - void *pData; - size_t stride; - VkResult result; -}; - -struct vkWriteMicromapsPropertiesEXT_params -{ - VkDevice device; - uint32_t micromapCount; - const VkMicromapEXT *pMicromaps; - VkQueryType queryType; - size_t dataSize; - void *pData; - size_t stride; - VkResult result; -}; - -#endif /* __WINE_VULKAN_LOADER_THUNKS_H */ diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c deleted file mode 100644 index 98b0abda7855..000000000000 --- a/dlls/winevulkan/vulkan_thunks.c +++ /dev/null @@ -1,56497 +0,0 @@ -/* Automatically generated from Vulkan vk.xml and video.xml; DO NOT EDIT! - * - * This file is generated from Vulkan vk.xml file covered - * by the following copyright and permission notice: - * - * Copyright 2015-2024 The Khronos Group Inc. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - * and from Vulkan video.xml file covered - * by the following copyright and permission notice: - * - * Copyright 2021-2024 The Khronos Group Inc. - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#if 0 -#pragma makedep unix -#endif - -#include "config.h" - -#include - -#include "vulkan_private.h" - -WINE_DEFAULT_DEBUG_CHANNEL(vulkan); - -typedef struct VkAcquireNextImageInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - VkFence DECLSPEC_ALIGN(8) fence; - uint32_t deviceMask; -} VkAcquireNextImageInfoKHR32; - -typedef struct VkPerformanceConfigurationAcquireInfoINTEL32 -{ - VkStructureType sType; - PTR32 pNext; - VkPerformanceConfigurationTypeINTEL type; -} VkPerformanceConfigurationAcquireInfoINTEL32; - -typedef struct VkAcquireProfilingLockInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkAcquireProfilingLockFlagsKHR flags; - uint64_t DECLSPEC_ALIGN(8) timeout; -} VkAcquireProfilingLockInfoKHR32; - -typedef struct VkCommandBufferAllocateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - VkCommandBufferLevel level; - uint32_t commandBufferCount; -} VkCommandBufferAllocateInfo32; - -typedef struct VkDescriptorSetVariableDescriptorCountAllocateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t descriptorSetCount; - PTR32 pDescriptorCounts; -} VkDescriptorSetVariableDescriptorCountAllocateInfo32; -typedef VkDescriptorSetVariableDescriptorCountAllocateInfo32 VkDescriptorSetVariableDescriptorCountAllocateInfoEXT32; - -typedef struct VkDescriptorSetAllocateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDescriptorPool DECLSPEC_ALIGN(8) descriptorPool; - uint32_t descriptorSetCount; - PTR32 pSetLayouts; -} VkDescriptorSetAllocateInfo32; - -typedef struct VkDedicatedAllocationMemoryAllocateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) image; - VkBuffer DECLSPEC_ALIGN(8) buffer; -} VkDedicatedAllocationMemoryAllocateInfoNV32; - -typedef struct VkExportMemoryAllocateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalMemoryHandleTypeFlags handleTypes; -} VkExportMemoryAllocateInfo32; -typedef VkExportMemoryAllocateInfo32 VkExportMemoryAllocateInfoKHR32; - -typedef struct VkImportMemoryWin32HandleInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalMemoryHandleTypeFlagBits handleType; - HANDLE handle; - LPCWSTR name; -} VkImportMemoryWin32HandleInfoKHR32; - -typedef struct VkExportMemoryWin32HandleInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pAttributes; - DWORD dwAccess; - LPCWSTR name; -} VkExportMemoryWin32HandleInfoKHR32; - -typedef struct VkMemoryAllocateFlagsInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkMemoryAllocateFlags flags; - uint32_t deviceMask; -} VkMemoryAllocateFlagsInfo32; -typedef VkMemoryAllocateFlagsInfo32 VkMemoryAllocateFlagsInfoKHR32; - -typedef struct VkMemoryDedicatedAllocateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) image; - VkBuffer DECLSPEC_ALIGN(8) buffer; -} VkMemoryDedicatedAllocateInfo32; -typedef VkMemoryDedicatedAllocateInfo32 VkMemoryDedicatedAllocateInfoKHR32; - -typedef struct VkImportMemoryHostPointerInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalMemoryHandleTypeFlagBits handleType; - PTR32 pHostPointer; -} VkImportMemoryHostPointerInfoEXT32; - -typedef struct VkMemoryPriorityAllocateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - float priority; -} VkMemoryPriorityAllocateInfoEXT32; - -typedef struct VkMemoryOpaqueCaptureAddressAllocateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) opaqueCaptureAddress; -} VkMemoryOpaqueCaptureAddressAllocateInfo32; -typedef VkMemoryOpaqueCaptureAddressAllocateInfo32 VkMemoryOpaqueCaptureAddressAllocateInfoKHR32; - -typedef struct VkMemoryAllocateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) allocationSize; - uint32_t memoryTypeIndex; -} VkMemoryAllocateInfo32; - -typedef struct VkAntiLagPresentationInfoAMD32 -{ - VkStructureType sType; - PTR32 pNext; - VkAntiLagStageAMD stage; - uint64_t DECLSPEC_ALIGN(8) frameIndex; -} VkAntiLagPresentationInfoAMD32; - -typedef struct VkAntiLagDataAMD32 -{ - VkStructureType sType; - PTR32 pNext; - VkAntiLagModeAMD mode; - uint32_t maxFPS; - PTR32 pPresentationInfo; -} VkAntiLagDataAMD32; - -typedef struct VkCommandBufferInheritanceConditionalRenderingInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 conditionalRenderingEnable; -} VkCommandBufferInheritanceConditionalRenderingInfoEXT32; - -typedef struct VkCommandBufferInheritanceRenderPassTransformInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkSurfaceTransformFlagBitsKHR transform; - VkRect2D renderArea; -} VkCommandBufferInheritanceRenderPassTransformInfoQCOM32; - -typedef struct VkCommandBufferInheritanceViewportScissorInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 viewportScissor2D; - uint32_t viewportDepthCount; - PTR32 pViewportDepths; -} VkCommandBufferInheritanceViewportScissorInfoNV32; - -typedef struct VkCommandBufferInheritanceRenderingInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkRenderingFlags flags; - uint32_t viewMask; - uint32_t colorAttachmentCount; - PTR32 pColorAttachmentFormats; - VkFormat depthAttachmentFormat; - VkFormat stencilAttachmentFormat; - VkSampleCountFlagBits rasterizationSamples; -} VkCommandBufferInheritanceRenderingInfo32; -typedef VkCommandBufferInheritanceRenderingInfo32 VkCommandBufferInheritanceRenderingInfoKHR32; - -typedef struct VkAttachmentSampleCountInfoAMD32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t colorAttachmentCount; - PTR32 pColorAttachmentSamples; - VkSampleCountFlagBits depthStencilAttachmentSamples; -} VkAttachmentSampleCountInfoAMD32; -typedef VkAttachmentSampleCountInfoAMD32 VkAttachmentSampleCountInfoNV32; - -typedef struct VkRenderingAttachmentLocationInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t colorAttachmentCount; - PTR32 pColorAttachmentLocations; -} VkRenderingAttachmentLocationInfo32; -typedef VkRenderingAttachmentLocationInfo32 VkRenderingAttachmentLocationInfoKHR32; - -typedef struct VkRenderingInputAttachmentIndexInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t colorAttachmentCount; - PTR32 pColorAttachmentInputIndices; - PTR32 pDepthInputAttachmentIndex; - PTR32 pStencilInputAttachmentIndex; -} VkRenderingInputAttachmentIndexInfo32; -typedef VkRenderingInputAttachmentIndexInfo32 VkRenderingInputAttachmentIndexInfoKHR32; - -typedef struct VkCommandBufferInheritanceInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkRenderPass DECLSPEC_ALIGN(8) renderPass; - uint32_t subpass; - VkFramebuffer DECLSPEC_ALIGN(8) framebuffer; - VkBool32 occlusionQueryEnable; - VkQueryControlFlags queryFlags; - VkQueryPipelineStatisticFlags pipelineStatistics; -} VkCommandBufferInheritanceInfo32; - -typedef struct VkDeviceGroupCommandBufferBeginInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t deviceMask; -} VkDeviceGroupCommandBufferBeginInfo32; -typedef VkDeviceGroupCommandBufferBeginInfo32 VkDeviceGroupCommandBufferBeginInfoKHR32; - -typedef struct VkCommandBufferBeginInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkCommandBufferUsageFlags flags; - PTR32 pInheritanceInfo; -} VkCommandBufferBeginInfo32; - -typedef struct VkBindAccelerationStructureMemoryInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) accelerationStructure; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; - uint32_t deviceIndexCount; - PTR32 pDeviceIndices; -} VkBindAccelerationStructureMemoryInfoNV32; - -typedef struct VkBindBufferMemoryDeviceGroupInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t deviceIndexCount; - PTR32 pDeviceIndices; -} VkBindBufferMemoryDeviceGroupInfo32; -typedef VkBindBufferMemoryDeviceGroupInfo32 VkBindBufferMemoryDeviceGroupInfoKHR32; - -typedef struct VkBindMemoryStatus32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pResult; -} VkBindMemoryStatus32; -typedef VkBindMemoryStatus32 VkBindMemoryStatusKHR32; - -typedef struct VkBindBufferMemoryInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; -} VkBindBufferMemoryInfo32; -typedef VkBindBufferMemoryInfo32 VkBindBufferMemoryInfoKHR32; - -typedef struct VkBindImageMemoryDeviceGroupInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t deviceIndexCount; - PTR32 pDeviceIndices; - uint32_t splitInstanceBindRegionCount; - PTR32 pSplitInstanceBindRegions; -} VkBindImageMemoryDeviceGroupInfo32; -typedef VkBindImageMemoryDeviceGroupInfo32 VkBindImageMemoryDeviceGroupInfoKHR32; - -typedef struct VkBindImageMemorySwapchainInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - uint32_t imageIndex; -} VkBindImageMemorySwapchainInfoKHR32; - -typedef struct VkBindImagePlaneMemoryInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageAspectFlagBits planeAspect; -} VkBindImagePlaneMemoryInfo32; -typedef VkBindImagePlaneMemoryInfo32 VkBindImagePlaneMemoryInfoKHR32; - -typedef struct VkBindImageMemoryInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) image; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; -} VkBindImageMemoryInfo32; -typedef VkBindImageMemoryInfo32 VkBindImageMemoryInfoKHR32; - -typedef struct VkBindVideoSessionMemoryInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t memoryBindIndex; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; - VkDeviceSize DECLSPEC_ALIGN(8) memorySize; -} VkBindVideoSessionMemoryInfoKHR32; - -typedef struct VkAccelerationStructureGeometryMotionTrianglesDataNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) vertexData; -} VkAccelerationStructureGeometryMotionTrianglesDataNV32; - -typedef struct VkAccelerationStructureTrianglesOpacityMicromapEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkIndexType indexType; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) indexBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) indexStride; - uint32_t baseTriangle; - uint32_t usageCountsCount; - PTR32 pUsageCounts; - PTR32 ppUsageCounts; - VkMicromapEXT DECLSPEC_ALIGN(8) micromap; -} VkAccelerationStructureTrianglesOpacityMicromapEXT32; - -typedef struct VkAccelerationStructureGeometryTrianglesDataKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkFormat vertexFormat; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) vertexData; - VkDeviceSize DECLSPEC_ALIGN(8) vertexStride; - uint32_t maxVertex; - VkIndexType indexType; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) indexData; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) transformData; -} VkAccelerationStructureGeometryTrianglesDataKHR32; - -typedef struct VkAccelerationStructureGeometryAabbsDataKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) data; - VkDeviceSize DECLSPEC_ALIGN(8) stride; -} VkAccelerationStructureGeometryAabbsDataKHR32; - -typedef struct VkAccelerationStructureGeometryInstancesDataKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 arrayOfPointers; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) data; -} VkAccelerationStructureGeometryInstancesDataKHR32; - -typedef union VkAccelerationStructureGeometryDataKHR32 -{ - VkAccelerationStructureGeometryTrianglesDataKHR32 DECLSPEC_ALIGN(8) triangles; - VkAccelerationStructureGeometryAabbsDataKHR32 DECLSPEC_ALIGN(8) aabbs; - VkAccelerationStructureGeometryInstancesDataKHR32 DECLSPEC_ALIGN(8) instances; -} VkAccelerationStructureGeometryDataKHR32; - -typedef struct VkAccelerationStructureGeometryKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkGeometryTypeKHR geometryType; - VkAccelerationStructureGeometryDataKHR32 DECLSPEC_ALIGN(8) geometry; - VkGeometryFlagsKHR flags; -} VkAccelerationStructureGeometryKHR32; - -typedef struct VkAccelerationStructureBuildGeometryInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccelerationStructureTypeKHR type; - VkBuildAccelerationStructureFlagsKHR flags; - VkBuildAccelerationStructureModeKHR mode; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) srcAccelerationStructure; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) dstAccelerationStructure; - uint32_t geometryCount; - PTR32 pGeometries; - PTR32 ppGeometries; - VkDeviceOrHostAddressKHR DECLSPEC_ALIGN(8) scratchData; -} VkAccelerationStructureBuildGeometryInfoKHR32; - -typedef struct VkMicromapBuildInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkMicromapTypeEXT type; - VkBuildMicromapFlagsEXT flags; - VkBuildMicromapModeEXT mode; - VkMicromapEXT DECLSPEC_ALIGN(8) dstMicromap; - uint32_t usageCountsCount; - PTR32 pUsageCounts; - PTR32 ppUsageCounts; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) data; - VkDeviceOrHostAddressKHR DECLSPEC_ALIGN(8) scratchData; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) triangleArray; - VkDeviceSize DECLSPEC_ALIGN(8) triangleArrayStride; -} VkMicromapBuildInfoEXT32; - -typedef struct VkConditionalRenderingBeginInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkConditionalRenderingFlagsEXT flags; -} VkConditionalRenderingBeginInfoEXT32; - -typedef struct VkDebugUtilsLabelEXT32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pLabelName; - float color[4]; -} VkDebugUtilsLabelEXT32; - -typedef struct VkSampleLocationsInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkSampleCountFlagBits sampleLocationsPerPixel; - VkExtent2D sampleLocationGridSize; - uint32_t sampleLocationsCount; - PTR32 pSampleLocations; -} VkSampleLocationsInfoEXT32; - -typedef struct VkAttachmentSampleLocationsEXT32 -{ - uint32_t attachmentIndex; - VkSampleLocationsInfoEXT32 sampleLocationsInfo; -} VkAttachmentSampleLocationsEXT32; - -typedef struct VkSubpassSampleLocationsEXT32 -{ - uint32_t subpassIndex; - VkSampleLocationsInfoEXT32 sampleLocationsInfo; -} VkSubpassSampleLocationsEXT32; - -typedef struct VkRenderPassStripeInfoARM32 -{ - VkStructureType sType; - PTR32 pNext; - VkRect2D stripeArea; -} VkRenderPassStripeInfoARM32; - -typedef struct VkDeviceGroupRenderPassBeginInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t deviceMask; - uint32_t deviceRenderAreaCount; - PTR32 pDeviceRenderAreas; -} VkDeviceGroupRenderPassBeginInfo32; -typedef VkDeviceGroupRenderPassBeginInfo32 VkDeviceGroupRenderPassBeginInfoKHR32; - -typedef struct VkRenderPassSampleLocationsBeginInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t attachmentInitialSampleLocationsCount; - PTR32 pAttachmentInitialSampleLocations; - uint32_t postSubpassSampleLocationsCount; - PTR32 pPostSubpassSampleLocations; -} VkRenderPassSampleLocationsBeginInfoEXT32; - -typedef struct VkRenderPassAttachmentBeginInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t attachmentCount; - PTR32 pAttachments; -} VkRenderPassAttachmentBeginInfo32; -typedef VkRenderPassAttachmentBeginInfo32 VkRenderPassAttachmentBeginInfoKHR32; - -typedef struct VkRenderPassTransformBeginInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkSurfaceTransformFlagBitsKHR transform; -} VkRenderPassTransformBeginInfoQCOM32; - -typedef struct VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t perViewRenderAreaCount; - PTR32 pPerViewRenderAreas; -} VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM32; - -typedef struct VkRenderPassStripeBeginInfoARM32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t stripeInfoCount; - PTR32 pStripeInfos; -} VkRenderPassStripeBeginInfoARM32; - -typedef struct VkRenderPassBeginInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkRenderPass DECLSPEC_ALIGN(8) renderPass; - VkFramebuffer DECLSPEC_ALIGN(8) framebuffer; - VkRect2D renderArea; - uint32_t clearValueCount; - PTR32 pClearValues; -} VkRenderPassBeginInfo32; - -typedef struct VkSubpassBeginInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkSubpassContents contents; -} VkSubpassBeginInfo32; -typedef VkSubpassBeginInfo32 VkSubpassBeginInfoKHR32; - -typedef struct VkRenderingAttachmentInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkImageLayout imageLayout; - VkResolveModeFlagBits resolveMode; - VkImageView DECLSPEC_ALIGN(8) resolveImageView; - VkImageLayout resolveImageLayout; - VkAttachmentLoadOp loadOp; - VkAttachmentStoreOp storeOp; - VkClearValue clearValue; -} VkRenderingAttachmentInfo32; -typedef VkRenderingAttachmentInfo32 VkRenderingAttachmentInfoKHR32; - -typedef struct VkMultisampledRenderToSingleSampledInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 multisampledRenderToSingleSampledEnable; - VkSampleCountFlagBits rasterizationSamples; -} VkMultisampledRenderToSingleSampledInfoEXT32; - -typedef struct VkRenderingFragmentShadingRateAttachmentInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkImageLayout imageLayout; - VkExtent2D shadingRateAttachmentTexelSize; -} VkRenderingFragmentShadingRateAttachmentInfoKHR32; - -typedef struct VkRenderingFragmentDensityMapAttachmentInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkImageLayout imageLayout; -} VkRenderingFragmentDensityMapAttachmentInfoEXT32; - -typedef struct VkRenderingInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkRenderingFlags flags; - VkRect2D renderArea; - uint32_t layerCount; - uint32_t viewMask; - uint32_t colorAttachmentCount; - PTR32 pColorAttachments; - PTR32 pDepthAttachment; - PTR32 pStencilAttachment; -} VkRenderingInfo32; -typedef VkRenderingInfo32 VkRenderingInfoKHR32; - -typedef struct VkVideoEncodeH264RateControlLayerInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 useMinQp; - VkVideoEncodeH264QpKHR minQp; - VkBool32 useMaxQp; - VkVideoEncodeH264QpKHR maxQp; - VkBool32 useMaxFrameSize; - VkVideoEncodeH264FrameSizeKHR maxFrameSize; -} VkVideoEncodeH264RateControlLayerInfoKHR32; - -typedef struct VkVideoEncodeH265RateControlLayerInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 useMinQp; - VkVideoEncodeH265QpKHR minQp; - VkBool32 useMaxQp; - VkVideoEncodeH265QpKHR maxQp; - VkBool32 useMaxFrameSize; - VkVideoEncodeH265FrameSizeKHR maxFrameSize; -} VkVideoEncodeH265RateControlLayerInfoKHR32; - -typedef struct VkVideoEncodeAV1RateControlLayerInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 useMinQIndex; - VkVideoEncodeAV1QIndexKHR minQIndex; - VkBool32 useMaxQIndex; - VkVideoEncodeAV1QIndexKHR maxQIndex; - VkBool32 useMaxFrameSize; - VkVideoEncodeAV1FrameSizeKHR maxFrameSize; -} VkVideoEncodeAV1RateControlLayerInfoKHR32; - -typedef struct VkVideoEncodeRateControlLayerInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) averageBitrate; - uint64_t DECLSPEC_ALIGN(8) maxBitrate; - uint32_t frameRateNumerator; - uint32_t frameRateDenominator; -} VkVideoEncodeRateControlLayerInfoKHR32; - -typedef struct StdVideoEncodeAV1ReferenceInfo32 -{ - StdVideoEncodeAV1ReferenceInfoFlags flags; - uint32_t RefFrameId; - StdVideoAV1FrameType frame_type; - uint8_t OrderHint; - uint8_t reserved1[3]; - PTR32 pExtensionHeader; -} StdVideoEncodeAV1ReferenceInfo32; - -typedef struct VkVideoPictureResourceInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkOffset2D codedOffset; - VkExtent2D codedExtent; - uint32_t baseArrayLayer; - VkImageView DECLSPEC_ALIGN(8) imageViewBinding; -} VkVideoPictureResourceInfoKHR32; - -typedef struct VkVideoDecodeH264DpbSlotInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pStdReferenceInfo; -} VkVideoDecodeH264DpbSlotInfoKHR32; - -typedef struct VkVideoDecodeH265DpbSlotInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pStdReferenceInfo; -} VkVideoDecodeH265DpbSlotInfoKHR32; - -typedef struct VkVideoDecodeAV1DpbSlotInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pStdReferenceInfo; -} VkVideoDecodeAV1DpbSlotInfoKHR32; - -typedef struct VkVideoEncodeH264DpbSlotInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pStdReferenceInfo; -} VkVideoEncodeH264DpbSlotInfoKHR32; - -typedef struct VkVideoEncodeH265DpbSlotInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pStdReferenceInfo; -} VkVideoEncodeH265DpbSlotInfoKHR32; - -typedef struct VkVideoEncodeAV1DpbSlotInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pStdReferenceInfo; -} VkVideoEncodeAV1DpbSlotInfoKHR32; - -typedef struct VkVideoReferenceSlotInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - int32_t slotIndex; - PTR32 pPictureResource; -} VkVideoReferenceSlotInfoKHR32; - -typedef struct VkVideoEncodeRateControlInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEncodeRateControlFlagsKHR flags; - VkVideoEncodeRateControlModeFlagBitsKHR rateControlMode; - uint32_t layerCount; - PTR32 pLayers; - uint32_t virtualBufferSizeInMs; - uint32_t initialVirtualBufferSizeInMs; -} VkVideoEncodeRateControlInfoKHR32; - -typedef struct VkVideoEncodeH264RateControlInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEncodeH264RateControlFlagsKHR flags; - uint32_t gopFrameCount; - uint32_t idrPeriod; - uint32_t consecutiveBFrameCount; - uint32_t temporalLayerCount; -} VkVideoEncodeH264RateControlInfoKHR32; - -typedef struct VkVideoEncodeH264GopRemainingFrameInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 useGopRemainingFrames; - uint32_t gopRemainingI; - uint32_t gopRemainingP; - uint32_t gopRemainingB; -} VkVideoEncodeH264GopRemainingFrameInfoKHR32; - -typedef struct VkVideoEncodeH265RateControlInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEncodeH265RateControlFlagsKHR flags; - uint32_t gopFrameCount; - uint32_t idrPeriod; - uint32_t consecutiveBFrameCount; - uint32_t subLayerCount; -} VkVideoEncodeH265RateControlInfoKHR32; - -typedef struct VkVideoEncodeH265GopRemainingFrameInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 useGopRemainingFrames; - uint32_t gopRemainingI; - uint32_t gopRemainingP; - uint32_t gopRemainingB; -} VkVideoEncodeH265GopRemainingFrameInfoKHR32; - -typedef struct VkVideoEncodeAV1RateControlInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEncodeAV1RateControlFlagsKHR flags; - uint32_t gopFrameCount; - uint32_t keyFramePeriod; - uint32_t consecutiveBipredictiveFrameCount; - uint32_t temporalLayerCount; -} VkVideoEncodeAV1RateControlInfoKHR32; - -typedef struct VkVideoEncodeAV1GopRemainingFrameInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 useGopRemainingFrames; - uint32_t gopRemainingIntra; - uint32_t gopRemainingPredictive; - uint32_t gopRemainingBipredictive; -} VkVideoEncodeAV1GopRemainingFrameInfoKHR32; - -typedef struct VkVideoBeginCodingInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoBeginCodingFlagsKHR flags; - VkVideoSessionKHR DECLSPEC_ALIGN(8) videoSession; - VkVideoSessionParametersKHR DECLSPEC_ALIGN(8) videoSessionParameters; - uint32_t referenceSlotCount; - PTR32 pReferenceSlots; -} VkVideoBeginCodingInfoKHR32; - -typedef struct VkPipelineLayoutCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineLayoutCreateFlags flags; - uint32_t setLayoutCount; - PTR32 pSetLayouts; - uint32_t pushConstantRangeCount; - PTR32 pPushConstantRanges; -} VkPipelineLayoutCreateInfo32; - -typedef struct VkBindDescriptorBufferEmbeddedSamplersInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderStageFlags stageFlags; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; -} VkBindDescriptorBufferEmbeddedSamplersInfoEXT32; - -typedef struct VkBufferUsageFlags2CreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkBufferUsageFlags2 DECLSPEC_ALIGN(8) usage; -} VkBufferUsageFlags2CreateInfo32; -typedef VkBufferUsageFlags2CreateInfo32 VkBufferUsageFlags2CreateInfoKHR32; - -typedef struct VkDescriptorBufferBindingPushDescriptorBufferHandleEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) buffer; -} VkDescriptorBufferBindingPushDescriptorBufferHandleEXT32; - -typedef struct VkDescriptorBufferBindingInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceAddress DECLSPEC_ALIGN(8) address; - VkBufferUsageFlags usage; -} VkDescriptorBufferBindingInfoEXT32; - -typedef struct VkBindDescriptorSetsInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderStageFlags stageFlags; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t firstSet; - uint32_t descriptorSetCount; - PTR32 pDescriptorSets; - uint32_t dynamicOffsetCount; - PTR32 pDynamicOffsets; -} VkBindDescriptorSetsInfo32; -typedef VkBindDescriptorSetsInfo32 VkBindDescriptorSetsInfoKHR32; - -typedef struct VkCopyCommandTransformInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkSurfaceTransformFlagBitsKHR transform; -} VkCopyCommandTransformInfoQCOM32; - -typedef struct VkImageBlit232 -{ - VkStructureType sType; - PTR32 pNext; - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffsets[2]; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffsets[2]; -} VkImageBlit232; -typedef VkImageBlit232 VkImageBlit2KHR32; - -typedef struct VkBlitImageCubicWeightsInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkCubicFilterWeightsQCOM cubicWeights; -} VkBlitImageCubicWeightsInfoQCOM32; - -typedef struct VkBlitImageInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; - VkFilter filter; -} VkBlitImageInfo232; -typedef VkBlitImageInfo232 VkBlitImageInfo2KHR32; - -typedef struct VkGeometryTrianglesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) vertexData; - VkDeviceSize DECLSPEC_ALIGN(8) vertexOffset; - uint32_t vertexCount; - VkDeviceSize DECLSPEC_ALIGN(8) vertexStride; - VkFormat vertexFormat; - VkBuffer DECLSPEC_ALIGN(8) indexData; - VkDeviceSize DECLSPEC_ALIGN(8) indexOffset; - uint32_t indexCount; - VkIndexType indexType; - VkBuffer DECLSPEC_ALIGN(8) transformData; - VkDeviceSize DECLSPEC_ALIGN(8) transformOffset; -} VkGeometryTrianglesNV32; - -typedef struct VkGeometryAABBNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) aabbData; - uint32_t numAABBs; - uint32_t stride; - VkDeviceSize DECLSPEC_ALIGN(8) offset; -} VkGeometryAABBNV32; - -typedef struct VkGeometryDataNV32 -{ - VkGeometryTrianglesNV32 DECLSPEC_ALIGN(8) triangles; - VkGeometryAABBNV32 DECLSPEC_ALIGN(8) aabbs; -} VkGeometryDataNV32; - -typedef struct VkGeometryNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkGeometryTypeKHR geometryType; - VkGeometryDataNV32 DECLSPEC_ALIGN(8) geometry; - VkGeometryFlagsKHR flags; -} VkGeometryNV32; - -typedef struct VkAccelerationStructureInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccelerationStructureTypeNV type; - VkBuildAccelerationStructureFlagsNV flags; - uint32_t instanceCount; - uint32_t geometryCount; - PTR32 pGeometries; -} VkAccelerationStructureInfoNV32; - -typedef struct VkVideoEncodeQualityLevelInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t qualityLevel; -} VkVideoEncodeQualityLevelInfoKHR32; - -typedef struct VkVideoCodingControlInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoCodingControlFlagsKHR flags; -} VkVideoCodingControlInfoKHR32; - -typedef struct VkCopyAccelerationStructureInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) src; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) dst; - VkCopyAccelerationStructureModeKHR mode; -} VkCopyAccelerationStructureInfoKHR32; - -typedef struct VkCopyAccelerationStructureToMemoryInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) src; - VkDeviceOrHostAddressKHR DECLSPEC_ALIGN(8) dst; - VkCopyAccelerationStructureModeKHR mode; -} VkCopyAccelerationStructureToMemoryInfoKHR32; - -typedef struct VkBufferCopy32 -{ - VkDeviceSize DECLSPEC_ALIGN(8) srcOffset; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - VkDeviceSize DECLSPEC_ALIGN(8) size; -} VkBufferCopy32; - -typedef struct VkBufferCopy232 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) srcOffset; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - VkDeviceSize DECLSPEC_ALIGN(8) size; -} VkBufferCopy232; -typedef VkBufferCopy232 VkBufferCopy2KHR32; - -typedef struct VkCopyBufferInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) srcBuffer; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - uint32_t regionCount; - PTR32 pRegions; -} VkCopyBufferInfo232; -typedef VkCopyBufferInfo232 VkCopyBufferInfo2KHR32; - -typedef struct VkBufferImageCopy32 -{ - VkDeviceSize DECLSPEC_ALIGN(8) bufferOffset; - uint32_t bufferRowLength; - uint32_t bufferImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkBufferImageCopy32; - -typedef struct VkBufferImageCopy232 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) bufferOffset; - uint32_t bufferRowLength; - uint32_t bufferImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkBufferImageCopy232; -typedef VkBufferImageCopy232 VkBufferImageCopy2KHR32; - -typedef struct VkCopyBufferToImageInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) srcBuffer; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; -} VkCopyBufferToImageInfo232; -typedef VkCopyBufferToImageInfo232 VkCopyBufferToImageInfo2KHR32; - -typedef struct VkImageCopy232 -{ - VkStructureType sType; - PTR32 pNext; - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffset; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffset; - VkExtent3D extent; -} VkImageCopy232; -typedef VkImageCopy232 VkImageCopy2KHR32; - -typedef struct VkCopyImageInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; -} VkCopyImageInfo232; -typedef VkCopyImageInfo232 VkCopyImageInfo2KHR32; - -typedef struct VkCopyImageToBufferInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - uint32_t regionCount; - PTR32 pRegions; -} VkCopyImageToBufferInfo232; -typedef VkCopyImageToBufferInfo232 VkCopyImageToBufferInfo2KHR32; - -typedef struct VkCopyMemoryToAccelerationStructureInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) src; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) dst; - VkCopyAccelerationStructureModeKHR mode; -} VkCopyMemoryToAccelerationStructureInfoKHR32; - -typedef struct VkCopyMemoryToMicromapInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceOrHostAddressConstKHR DECLSPEC_ALIGN(8) src; - VkMicromapEXT DECLSPEC_ALIGN(8) dst; - VkCopyMicromapModeEXT mode; -} VkCopyMemoryToMicromapInfoEXT32; - -typedef struct VkCopyMicromapInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkMicromapEXT DECLSPEC_ALIGN(8) src; - VkMicromapEXT DECLSPEC_ALIGN(8) dst; - VkCopyMicromapModeEXT mode; -} VkCopyMicromapInfoEXT32; - -typedef struct VkCopyMicromapToMemoryInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkMicromapEXT DECLSPEC_ALIGN(8) src; - VkDeviceOrHostAddressKHR DECLSPEC_ALIGN(8) dst; - VkCopyMicromapModeEXT mode; -} VkCopyMicromapToMemoryInfoEXT32; - -typedef struct VkCuLaunchInfoNVX32 -{ - VkStructureType sType; - PTR32 pNext; - VkCuFunctionNVX DECLSPEC_ALIGN(8) function; - uint32_t gridDimX; - uint32_t gridDimY; - uint32_t gridDimZ; - uint32_t blockDimX; - uint32_t blockDimY; - uint32_t blockDimZ; - uint32_t sharedMemBytes; - PTR32 paramCount; - PTR32 pParams; - PTR32 extraCount; - PTR32 pExtras; -} VkCuLaunchInfoNVX32; - -typedef struct VkCudaLaunchInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkCudaFunctionNV DECLSPEC_ALIGN(8) function; - uint32_t gridDimX; - uint32_t gridDimY; - uint32_t gridDimZ; - uint32_t blockDimX; - uint32_t blockDimY; - uint32_t blockDimZ; - uint32_t sharedMemBytes; - PTR32 paramCount; - PTR32 pParams; - PTR32 extraCount; - PTR32 pExtras; -} VkCudaLaunchInfoNV32; - -typedef struct VkDebugMarkerMarkerInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pMarkerName; - float color[4]; -} VkDebugMarkerMarkerInfoEXT32; - -typedef struct StdVideoAV1TileInfo32 -{ - StdVideoAV1TileInfoFlags flags; - uint8_t TileCols; - uint8_t TileRows; - uint16_t context_update_tile_id; - uint8_t tile_size_bytes_minus_1; - uint8_t reserved1[7]; - PTR32 pMiColStarts; - PTR32 pMiRowStarts; - PTR32 pWidthInSbsMinus1; - PTR32 pHeightInSbsMinus1; -} StdVideoAV1TileInfo32; - -typedef struct StdVideoDecodeAV1PictureInfo32 -{ - StdVideoDecodeAV1PictureInfoFlags flags; - StdVideoAV1FrameType frame_type; - uint32_t current_frame_id; - uint8_t OrderHint; - uint8_t primary_ref_frame; - uint8_t refresh_frame_flags; - uint8_t reserved1; - StdVideoAV1InterpolationFilter interpolation_filter; - StdVideoAV1TxMode TxMode; - uint8_t delta_q_res; - uint8_t delta_lf_res; - uint8_t SkipModeFrame[STD_VIDEO_AV1_SKIP_MODE_FRAMES]; - uint8_t coded_denom; - uint8_t reserved2[3]; - uint8_t OrderHints[STD_VIDEO_AV1_NUM_REF_FRAMES]; - uint32_t expectedFrameId[STD_VIDEO_AV1_NUM_REF_FRAMES]; - PTR32 pTileInfo; - PTR32 pQuantization; - PTR32 pSegmentation; - PTR32 pLoopFilter; - PTR32 pCDEF; - PTR32 pLoopRestoration; - PTR32 pGlobalMotion; - PTR32 pFilmGrain; -} StdVideoDecodeAV1PictureInfo32; - -typedef struct VkVideoInlineQueryInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; -} VkVideoInlineQueryInfoKHR32; - -typedef struct VkVideoDecodeH264PictureInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pStdPictureInfo; - uint32_t sliceCount; - PTR32 pSliceOffsets; -} VkVideoDecodeH264PictureInfoKHR32; - -typedef struct VkVideoDecodeH265PictureInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pStdPictureInfo; - uint32_t sliceSegmentCount; - PTR32 pSliceSegmentOffsets; -} VkVideoDecodeH265PictureInfoKHR32; - -typedef struct VkVideoDecodeAV1PictureInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pStdPictureInfo; - int32_t referenceNameSlotIndices[VK_MAX_VIDEO_AV1_REFERENCES_PER_FRAME_KHR]; - uint32_t frameHeaderOffset; - uint32_t tileCount; - PTR32 pTileOffsets; - PTR32 pTileSizes; -} VkVideoDecodeAV1PictureInfoKHR32; - -typedef struct VkVideoDecodeInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoDecodeFlagsKHR flags; - VkBuffer DECLSPEC_ALIGN(8) srcBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) srcBufferOffset; - VkDeviceSize DECLSPEC_ALIGN(8) srcBufferRange; - VkVideoPictureResourceInfoKHR32 DECLSPEC_ALIGN(8) dstPictureResource; - PTR32 pSetupReferenceSlot; - uint32_t referenceSlotCount; - PTR32 pReferenceSlots; -} VkVideoDecodeInfoKHR32; - -typedef struct VkDecompressMemoryRegionNV32 -{ - VkDeviceAddress DECLSPEC_ALIGN(8) srcAddress; - VkDeviceAddress DECLSPEC_ALIGN(8) dstAddress; - VkDeviceSize DECLSPEC_ALIGN(8) compressedSize; - VkDeviceSize DECLSPEC_ALIGN(8) decompressedSize; - VkMemoryDecompressionMethodFlagsNV DECLSPEC_ALIGN(8) decompressionMethod; -} VkDecompressMemoryRegionNV32; - -typedef struct StdVideoEncodeH264SliceHeader32 -{ - StdVideoEncodeH264SliceHeaderFlags flags; - uint32_t first_mb_in_slice; - StdVideoH264SliceType slice_type; - int8_t slice_alpha_c0_offset_div2; - int8_t slice_beta_offset_div2; - int8_t slice_qp_delta; - uint8_t reserved1; - StdVideoH264CabacInitIdc cabac_init_idc; - StdVideoH264DisableDeblockingFilterIdc disable_deblocking_filter_idc; - PTR32 pWeightTable; -} StdVideoEncodeH264SliceHeader32; - -typedef struct VkVideoEncodeH264NaluSliceInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - int32_t constantQp; - PTR32 pStdSliceHeader; -} VkVideoEncodeH264NaluSliceInfoKHR32; - -typedef struct StdVideoEncodeH264ReferenceListsInfo32 -{ - StdVideoEncodeH264ReferenceListsInfoFlags flags; - uint8_t num_ref_idx_l0_active_minus1; - uint8_t num_ref_idx_l1_active_minus1; - uint8_t RefPicList0[STD_VIDEO_H264_MAX_NUM_LIST_REF]; - uint8_t RefPicList1[STD_VIDEO_H264_MAX_NUM_LIST_REF]; - uint8_t refList0ModOpCount; - uint8_t refList1ModOpCount; - uint8_t refPicMarkingOpCount; - uint8_t reserved1[7]; - PTR32 pRefList0ModOperations; - PTR32 pRefList1ModOperations; - PTR32 pRefPicMarkingOperations; -} StdVideoEncodeH264ReferenceListsInfo32; - -typedef struct StdVideoEncodeH264PictureInfo32 -{ - StdVideoEncodeH264PictureInfoFlags flags; - uint8_t seq_parameter_set_id; - uint8_t pic_parameter_set_id; - uint16_t idr_pic_id; - StdVideoH264PictureType primary_pic_type; - uint32_t frame_num; - int32_t PicOrderCnt; - uint8_t temporal_id; - uint8_t reserved1[3]; - PTR32 pRefLists; -} StdVideoEncodeH264PictureInfo32; - -typedef struct StdVideoEncodeH265SliceSegmentHeader32 -{ - StdVideoEncodeH265SliceSegmentHeaderFlags flags; - StdVideoH265SliceType slice_type; - uint32_t slice_segment_address; - uint8_t collocated_ref_idx; - uint8_t MaxNumMergeCand; - int8_t slice_cb_qp_offset; - int8_t slice_cr_qp_offset; - int8_t slice_beta_offset_div2; - int8_t slice_tc_offset_div2; - int8_t slice_act_y_qp_offset; - int8_t slice_act_cb_qp_offset; - int8_t slice_act_cr_qp_offset; - int8_t slice_qp_delta; - uint16_t reserved1; - PTR32 pWeightTable; -} StdVideoEncodeH265SliceSegmentHeader32; - -typedef struct VkVideoEncodeH265NaluSliceSegmentInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - int32_t constantQp; - PTR32 pStdSliceSegmentHeader; -} VkVideoEncodeH265NaluSliceSegmentInfoKHR32; - -typedef struct StdVideoEncodeH265PictureInfo32 -{ - StdVideoEncodeH265PictureInfoFlags flags; - StdVideoH265PictureType pic_type; - uint8_t sps_video_parameter_set_id; - uint8_t pps_seq_parameter_set_id; - uint8_t pps_pic_parameter_set_id; - uint8_t short_term_ref_pic_set_idx; - int32_t PicOrderCntVal; - uint8_t TemporalId; - uint8_t reserved1[7]; - PTR32 pRefLists; - PTR32 pShortTermRefPicSet; - PTR32 pLongTermRefPics; -} StdVideoEncodeH265PictureInfo32; - -typedef struct StdVideoEncodeAV1PictureInfo32 -{ - StdVideoEncodeAV1PictureInfoFlags flags; - StdVideoAV1FrameType frame_type; - uint32_t frame_presentation_time; - uint32_t current_frame_id; - uint8_t order_hint; - uint8_t primary_ref_frame; - uint8_t refresh_frame_flags; - uint8_t coded_denom; - uint16_t render_width_minus_1; - uint16_t render_height_minus_1; - StdVideoAV1InterpolationFilter interpolation_filter; - StdVideoAV1TxMode TxMode; - uint8_t delta_q_res; - uint8_t delta_lf_res; - uint8_t ref_order_hint[STD_VIDEO_AV1_NUM_REF_FRAMES]; - int8_t ref_frame_idx[STD_VIDEO_AV1_REFS_PER_FRAME]; - uint8_t reserved1[3]; - uint32_t delta_frame_id_minus_1[STD_VIDEO_AV1_REFS_PER_FRAME]; - PTR32 pTileInfo; - PTR32 pQuantization; - PTR32 pSegmentation; - PTR32 pLoopFilter; - PTR32 pCDEF; - PTR32 pLoopRestoration; - PTR32 pGlobalMotion; - PTR32 pExtensionHeader; - PTR32 pBufferRemovalTimes; -} StdVideoEncodeAV1PictureInfo32; - -typedef struct VkVideoEncodeQuantizationMapInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageView DECLSPEC_ALIGN(8) quantizationMap; - VkExtent2D quantizationMapExtent; -} VkVideoEncodeQuantizationMapInfoKHR32; - -typedef struct VkVideoEncodeH264PictureInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t naluSliceEntryCount; - PTR32 pNaluSliceEntries; - PTR32 pStdPictureInfo; - VkBool32 generatePrefixNalu; -} VkVideoEncodeH264PictureInfoKHR32; - -typedef struct VkVideoEncodeH265PictureInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t naluSliceSegmentEntryCount; - PTR32 pNaluSliceSegmentEntries; - PTR32 pStdPictureInfo; -} VkVideoEncodeH265PictureInfoKHR32; - -typedef struct VkVideoEncodeAV1PictureInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEncodeAV1PredictionModeKHR predictionMode; - VkVideoEncodeAV1RateControlGroupKHR rateControlGroup; - uint32_t constantQIndex; - PTR32 pStdPictureInfo; - int32_t referenceNameSlotIndices[VK_MAX_VIDEO_AV1_REFERENCES_PER_FRAME_KHR]; - VkBool32 primaryReferenceCdfOnly; - VkBool32 generateObuExtensionHeader; -} VkVideoEncodeAV1PictureInfoKHR32; - -typedef struct VkVideoEncodeInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEncodeFlagsKHR flags; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstBufferOffset; - VkDeviceSize DECLSPEC_ALIGN(8) dstBufferRange; - VkVideoPictureResourceInfoKHR32 DECLSPEC_ALIGN(8) srcPictureResource; - PTR32 pSetupReferenceSlot; - uint32_t referenceSlotCount; - PTR32 pReferenceSlots; - uint32_t precedingExternallyEncodedBytes; -} VkVideoEncodeInfoKHR32; - -typedef struct VkSubpassFragmentDensityMapOffsetEndInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t fragmentDensityOffsetCount; - PTR32 pFragmentDensityOffsets; -} VkSubpassFragmentDensityMapOffsetEndInfoQCOM32; - -typedef struct VkSubpassEndInfo32 -{ - VkStructureType sType; - PTR32 pNext; -} VkSubpassEndInfo32; -typedef VkSubpassEndInfo32 VkSubpassEndInfoKHR32; - -typedef struct VkVideoEndCodingInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEndCodingFlagsKHR flags; -} VkVideoEndCodingInfoKHR32; - -typedef struct VkGeneratedCommandsPipelineInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipeline DECLSPEC_ALIGN(8) pipeline; -} VkGeneratedCommandsPipelineInfoEXT32; - -typedef struct VkGeneratedCommandsShaderInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t shaderCount; - PTR32 pShaders; -} VkGeneratedCommandsShaderInfoEXT32; - -typedef struct VkGeneratedCommandsInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderStageFlags shaderStages; - VkIndirectExecutionSetEXT DECLSPEC_ALIGN(8) indirectExecutionSet; - VkIndirectCommandsLayoutEXT DECLSPEC_ALIGN(8) indirectCommandsLayout; - VkDeviceAddress DECLSPEC_ALIGN(8) indirectAddress; - VkDeviceSize DECLSPEC_ALIGN(8) indirectAddressSize; - VkDeviceAddress DECLSPEC_ALIGN(8) preprocessAddress; - VkDeviceSize DECLSPEC_ALIGN(8) preprocessSize; - uint32_t maxSequenceCount; - VkDeviceAddress DECLSPEC_ALIGN(8) sequenceCountAddress; - uint32_t maxDrawCount; -} VkGeneratedCommandsInfoEXT32; - -typedef struct VkIndirectCommandsStreamNV32 -{ - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; -} VkIndirectCommandsStreamNV32; - -typedef struct VkGeneratedCommandsInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - VkIndirectCommandsLayoutNV DECLSPEC_ALIGN(8) indirectCommandsLayout; - uint32_t streamCount; - PTR32 pStreams; - uint32_t sequencesCount; - VkBuffer DECLSPEC_ALIGN(8) preprocessBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) preprocessOffset; - VkDeviceSize DECLSPEC_ALIGN(8) preprocessSize; - VkBuffer DECLSPEC_ALIGN(8) sequencesCountBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) sequencesCountOffset; - VkBuffer DECLSPEC_ALIGN(8) sequencesIndexBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) sequencesIndexOffset; -} VkGeneratedCommandsInfoNV32; - -typedef struct VkOpticalFlowExecuteInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkOpticalFlowExecuteFlagsNV flags; - uint32_t regionCount; - PTR32 pRegions; -} VkOpticalFlowExecuteInfoNV32; - -typedef struct VkMemoryBarrier32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; -} VkMemoryBarrier32; - -typedef struct VkExternalMemoryAcquireUnmodifiedEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 acquireUnmodifiedMemory; -} VkExternalMemoryAcquireUnmodifiedEXT32; - -typedef struct VkBufferMemoryBarrier32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; -} VkBufferMemoryBarrier32; - -typedef struct VkImageMemoryBarrier32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - VkImageLayout oldLayout; - VkImageLayout newLayout; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkImage DECLSPEC_ALIGN(8) image; - VkImageSubresourceRange subresourceRange; -} VkImageMemoryBarrier32; - -typedef struct VkMemoryBarrier232 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) srcStageMask; - VkAccessFlags2 DECLSPEC_ALIGN(8) srcAccessMask; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) dstStageMask; - VkAccessFlags2 DECLSPEC_ALIGN(8) dstAccessMask; -} VkMemoryBarrier232; -typedef VkMemoryBarrier232 VkMemoryBarrier2KHR32; - -typedef struct VkBufferMemoryBarrier232 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) srcStageMask; - VkAccessFlags2 DECLSPEC_ALIGN(8) srcAccessMask; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) dstStageMask; - VkAccessFlags2 DECLSPEC_ALIGN(8) dstAccessMask; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; -} VkBufferMemoryBarrier232; -typedef VkBufferMemoryBarrier232 VkBufferMemoryBarrier2KHR32; - -typedef struct VkImageMemoryBarrier232 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) srcStageMask; - VkAccessFlags2 DECLSPEC_ALIGN(8) srcAccessMask; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) dstStageMask; - VkAccessFlags2 DECLSPEC_ALIGN(8) dstAccessMask; - VkImageLayout oldLayout; - VkImageLayout newLayout; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkImage DECLSPEC_ALIGN(8) image; - VkImageSubresourceRange subresourceRange; -} VkImageMemoryBarrier232; -typedef VkImageMemoryBarrier232 VkImageMemoryBarrier2KHR32; - -typedef struct VkDependencyInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDependencyFlags dependencyFlags; - uint32_t memoryBarrierCount; - PTR32 pMemoryBarriers; - uint32_t bufferMemoryBarrierCount; - PTR32 pBufferMemoryBarriers; - uint32_t imageMemoryBarrierCount; - PTR32 pImageMemoryBarriers; -} VkDependencyInfo32; -typedef VkDependencyInfo32 VkDependencyInfoKHR32; - -typedef struct VkPushConstantsInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - VkShaderStageFlags stageFlags; - uint32_t offset; - uint32_t size; - PTR32 pValues; -} VkPushConstantsInfo32; -typedef VkPushConstantsInfo32 VkPushConstantsInfoKHR32; - -typedef struct VkDescriptorImageInfo32 -{ - VkSampler DECLSPEC_ALIGN(8) sampler; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkImageLayout imageLayout; -} VkDescriptorImageInfo32; - -typedef struct VkDescriptorBufferInfo32 -{ - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) range; -} VkDescriptorBufferInfo32; - -typedef struct VkWriteDescriptorSetInlineUniformBlock32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t dataSize; - PTR32 pData; -} VkWriteDescriptorSetInlineUniformBlock32; -typedef VkWriteDescriptorSetInlineUniformBlock32 VkWriteDescriptorSetInlineUniformBlockEXT32; - -typedef struct VkWriteDescriptorSetAccelerationStructureKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t accelerationStructureCount; - PTR32 pAccelerationStructures; -} VkWriteDescriptorSetAccelerationStructureKHR32; - -typedef struct VkWriteDescriptorSetAccelerationStructureNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t accelerationStructureCount; - PTR32 pAccelerationStructures; -} VkWriteDescriptorSetAccelerationStructureNV32; - -typedef struct VkWriteDescriptorSet32 -{ - VkStructureType sType; - PTR32 pNext; - VkDescriptorSet DECLSPEC_ALIGN(8) dstSet; - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; - VkDescriptorType descriptorType; - PTR32 pImageInfo; - PTR32 pBufferInfo; - PTR32 pTexelBufferView; -} VkWriteDescriptorSet32; - -typedef struct VkPushDescriptorSetInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderStageFlags stageFlags; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; - uint32_t descriptorWriteCount; - PTR32 pDescriptorWrites; -} VkPushDescriptorSetInfo32; -typedef VkPushDescriptorSetInfo32 VkPushDescriptorSetInfoKHR32; - -typedef struct VkPushDescriptorSetWithTemplateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; - PTR32 pData; -} VkPushDescriptorSetWithTemplateInfo32; -typedef VkPushDescriptorSetWithTemplateInfo32 VkPushDescriptorSetWithTemplateInfoKHR32; - -typedef struct VkImageResolve232 -{ - VkStructureType sType; - PTR32 pNext; - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffset; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffset; - VkExtent3D extent; -} VkImageResolve232; -typedef VkImageResolve232 VkImageResolve2KHR32; - -typedef struct VkResolveImageInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; -} VkResolveImageInfo232; -typedef VkResolveImageInfo232 VkResolveImageInfo2KHR32; - -typedef struct VkCoarseSampleOrderCustomNV32 -{ - VkShadingRatePaletteEntryNV shadingRate; - uint32_t sampleCount; - uint32_t sampleLocationCount; - PTR32 pSampleLocations; -} VkCoarseSampleOrderCustomNV32; - -typedef struct VkDepthBiasRepresentationInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDepthBiasRepresentationEXT depthBiasRepresentation; - VkBool32 depthBiasExact; -} VkDepthBiasRepresentationInfoEXT32; - -typedef struct VkDepthBiasInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - float depthBiasConstantFactor; - float depthBiasClamp; - float depthBiasSlopeFactor; -} VkDepthBiasInfoEXT32; - -typedef struct VkSetDescriptorBufferOffsetsInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderStageFlags stageFlags; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t firstSet; - uint32_t setCount; - PTR32 pBufferIndices; - PTR32 pOffsets; -} VkSetDescriptorBufferOffsetsInfoEXT32; - -typedef struct VkPerformanceMarkerInfoINTEL32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) marker; -} VkPerformanceMarkerInfoINTEL32; - -typedef struct VkPerformanceOverrideInfoINTEL32 -{ - VkStructureType sType; - PTR32 pNext; - VkPerformanceOverrideTypeINTEL type; - VkBool32 enable; - uint64_t DECLSPEC_ALIGN(8) parameter; -} VkPerformanceOverrideInfoINTEL32; - -typedef struct VkPerformanceStreamMarkerInfoINTEL32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t marker; -} VkPerformanceStreamMarkerInfoINTEL32; - -typedef struct VkVertexInputBindingDescription2EXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t binding; - uint32_t stride; - VkVertexInputRate inputRate; - uint32_t divisor; -} VkVertexInputBindingDescription2EXT32; - -typedef struct VkVertexInputAttributeDescription2EXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t location; - uint32_t binding; - VkFormat format; - uint32_t offset; -} VkVertexInputAttributeDescription2EXT32; - -typedef struct VkShadingRatePaletteNV32 -{ - uint32_t shadingRatePaletteEntryCount; - PTR32 pShadingRatePaletteEntries; -} VkShadingRatePaletteNV32; - -typedef struct VkStridedDeviceAddressRegionKHR32 -{ - VkDeviceAddress DECLSPEC_ALIGN(8) deviceAddress; - VkDeviceSize DECLSPEC_ALIGN(8) stride; - VkDeviceSize DECLSPEC_ALIGN(8) size; -} VkStridedDeviceAddressRegionKHR32; - -typedef struct VkCopyImageToImageInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkHostImageCopyFlags flags; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; -} VkCopyImageToImageInfo32; -typedef VkCopyImageToImageInfo32 VkCopyImageToImageInfoEXT32; - -typedef struct VkImageToMemoryCopy32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pHostPointer; - uint32_t memoryRowLength; - uint32_t memoryImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkImageToMemoryCopy32; -typedef VkImageToMemoryCopy32 VkImageToMemoryCopyEXT32; - -typedef struct VkCopyImageToMemoryInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkHostImageCopyFlags flags; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - uint32_t regionCount; - PTR32 pRegions; -} VkCopyImageToMemoryInfo32; -typedef VkCopyImageToMemoryInfo32 VkCopyImageToMemoryInfoEXT32; - -typedef struct VkMemoryToImageCopy32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pHostPointer; - uint32_t memoryRowLength; - uint32_t memoryImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkMemoryToImageCopy32; -typedef VkMemoryToImageCopy32 VkMemoryToImageCopyEXT32; - -typedef struct VkCopyMemoryToImageInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkHostImageCopyFlags flags; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; -} VkCopyMemoryToImageInfo32; -typedef VkCopyMemoryToImageInfo32 VkCopyMemoryToImageInfoEXT32; - -typedef struct VkOpaqueCaptureDescriptorDataCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 opaqueCaptureDescriptorData; -} VkOpaqueCaptureDescriptorDataCreateInfoEXT32; - -typedef struct VkAccelerationStructureMotionInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxInstances; - VkAccelerationStructureMotionInfoFlagsNV flags; -} VkAccelerationStructureMotionInfoNV32; - -typedef struct VkAccelerationStructureCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccelerationStructureCreateFlagsKHR createFlags; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkAccelerationStructureTypeKHR type; - VkDeviceAddress DECLSPEC_ALIGN(8) deviceAddress; -} VkAccelerationStructureCreateInfoKHR32; - -typedef struct VkAccelerationStructureCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) compactedSize; - VkAccelerationStructureInfoNV32 info; -} VkAccelerationStructureCreateInfoNV32; - -typedef struct VkVideoDecodeUsageInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoDecodeUsageFlagsKHR videoUsageHints; -} VkVideoDecodeUsageInfoKHR32; - -typedef struct VkVideoDecodeH264ProfileInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - StdVideoH264ProfileIdc stdProfileIdc; - VkVideoDecodeH264PictureLayoutFlagBitsKHR pictureLayout; -} VkVideoDecodeH264ProfileInfoKHR32; - -typedef struct VkVideoDecodeH265ProfileInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - StdVideoH265ProfileIdc stdProfileIdc; -} VkVideoDecodeH265ProfileInfoKHR32; - -typedef struct VkVideoDecodeAV1ProfileInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - StdVideoAV1Profile stdProfile; - VkBool32 filmGrainSupport; -} VkVideoDecodeAV1ProfileInfoKHR32; - -typedef struct VkVideoEncodeUsageInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEncodeUsageFlagsKHR videoUsageHints; - VkVideoEncodeContentFlagsKHR videoContentHints; - VkVideoEncodeTuningModeKHR tuningMode; -} VkVideoEncodeUsageInfoKHR32; - -typedef struct VkVideoEncodeH264ProfileInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - StdVideoH264ProfileIdc stdProfileIdc; -} VkVideoEncodeH264ProfileInfoKHR32; - -typedef struct VkVideoEncodeH265ProfileInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - StdVideoH265ProfileIdc stdProfileIdc; -} VkVideoEncodeH265ProfileInfoKHR32; - -typedef struct VkVideoEncodeAV1ProfileInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - StdVideoAV1Profile stdProfile; -} VkVideoEncodeAV1ProfileInfoKHR32; - -typedef struct VkVideoProfileInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoCodecOperationFlagBitsKHR videoCodecOperation; - VkVideoChromaSubsamplingFlagsKHR chromaSubsampling; - VkVideoComponentBitDepthFlagsKHR lumaBitDepth; - VkVideoComponentBitDepthFlagsKHR chromaBitDepth; -} VkVideoProfileInfoKHR32; - -typedef struct VkDedicatedAllocationBufferCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 dedicatedAllocation; -} VkDedicatedAllocationBufferCreateInfoNV32; - -typedef struct VkExternalMemoryBufferCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalMemoryHandleTypeFlags handleTypes; -} VkExternalMemoryBufferCreateInfo32; -typedef VkExternalMemoryBufferCreateInfo32 VkExternalMemoryBufferCreateInfoKHR32; - -typedef struct VkBufferOpaqueCaptureAddressCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) opaqueCaptureAddress; -} VkBufferOpaqueCaptureAddressCreateInfo32; -typedef VkBufferOpaqueCaptureAddressCreateInfo32 VkBufferOpaqueCaptureAddressCreateInfoKHR32; - -typedef struct VkBufferDeviceAddressCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceAddress DECLSPEC_ALIGN(8) deviceAddress; -} VkBufferDeviceAddressCreateInfoEXT32; - -typedef struct VkVideoProfileListInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t profileCount; - PTR32 pProfiles; -} VkVideoProfileListInfoKHR32; - -typedef struct VkBufferCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkBufferCreateFlags flags; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkBufferUsageFlags usage; - VkSharingMode sharingMode; - uint32_t queueFamilyIndexCount; - PTR32 pQueueFamilyIndices; -} VkBufferCreateInfo32; - -typedef struct VkBufferViewCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkBufferViewCreateFlags flags; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkFormat format; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) range; -} VkBufferViewCreateInfo32; - -typedef struct VkCommandPoolCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkCommandPoolCreateFlags flags; - uint32_t queueFamilyIndex; -} VkCommandPoolCreateInfo32; - -typedef struct VkPipelineCreationFeedback32 -{ - VkPipelineCreationFeedbackFlags flags; - uint64_t DECLSPEC_ALIGN(8) duration; -} VkPipelineCreationFeedback32; -typedef VkPipelineCreationFeedback32 VkPipelineCreationFeedbackEXT32; - -typedef struct VkSpecializationMapEntry32 -{ - uint32_t constantID; - uint32_t offset; - PTR32 size; -} VkSpecializationMapEntry32; - -typedef struct VkSpecializationInfo32 -{ - uint32_t mapEntryCount; - PTR32 pMapEntries; - PTR32 dataSize; - PTR32 pData; -} VkSpecializationInfo32; - -typedef struct VkShaderModuleCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderModuleCreateFlags flags; - PTR32 codeSize; - PTR32 pCode; -} VkShaderModuleCreateInfo32; - -typedef struct VkShaderModuleValidationCacheCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkValidationCacheEXT DECLSPEC_ALIGN(8) validationCache; -} VkShaderModuleValidationCacheCreateInfoEXT32; - -typedef struct VkDebugUtilsObjectNameInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - PTR32 pObjectName; -} VkDebugUtilsObjectNameInfoEXT32; - -typedef struct VkPipelineShaderStageRequiredSubgroupSizeCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t requiredSubgroupSize; -} VkPipelineShaderStageRequiredSubgroupSizeCreateInfo32; -typedef VkPipelineShaderStageRequiredSubgroupSizeCreateInfo32 VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT32; -typedef VkPipelineShaderStageRequiredSubgroupSizeCreateInfo32 VkShaderRequiredSubgroupSizeCreateInfoEXT32; - -typedef struct VkPipelineShaderStageModuleIdentifierCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t identifierSize; - PTR32 pIdentifier; -} VkPipelineShaderStageModuleIdentifierCreateInfoEXT32; - -typedef struct VkPipelineRobustnessCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineRobustnessBufferBehavior storageBuffers; - VkPipelineRobustnessBufferBehavior uniformBuffers; - VkPipelineRobustnessBufferBehavior vertexInputs; - VkPipelineRobustnessImageBehavior images; -} VkPipelineRobustnessCreateInfo32; -typedef VkPipelineRobustnessCreateInfo32 VkPipelineRobustnessCreateInfoEXT32; - -typedef struct VkPipelineShaderStageCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineShaderStageCreateFlags flags; - VkShaderStageFlagBits stage; - VkShaderModule DECLSPEC_ALIGN(8) module; - PTR32 pName; - PTR32 pSpecializationInfo; -} VkPipelineShaderStageCreateInfo32; - -typedef struct VkComputePipelineIndirectBufferInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceAddress DECLSPEC_ALIGN(8) deviceAddress; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkDeviceAddress DECLSPEC_ALIGN(8) pipelineDeviceAddressCaptureReplay; -} VkComputePipelineIndirectBufferInfoNV32; - -typedef struct VkPipelineCreateFlags2CreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCreateFlags2 DECLSPEC_ALIGN(8) flags; -} VkPipelineCreateFlags2CreateInfo32; -typedef VkPipelineCreateFlags2CreateInfo32 VkPipelineCreateFlags2CreateInfoKHR32; - -typedef struct VkPipelineBinaryInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t binaryCount; - PTR32 pPipelineBinaries; -} VkPipelineBinaryInfoKHR32; - -typedef struct VkPipelineCreationFeedbackCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pPipelineCreationFeedback; - uint32_t pipelineStageCreationFeedbackCount; - PTR32 pPipelineStageCreationFeedbacks; -} VkPipelineCreationFeedbackCreateInfo32; -typedef VkPipelineCreationFeedbackCreateInfo32 VkPipelineCreationFeedbackCreateInfoEXT32; - -typedef struct VkSubpassShadingPipelineCreateInfoHUAWEI32 -{ - VkStructureType sType; - PTR32 pNext; - VkRenderPass DECLSPEC_ALIGN(8) renderPass; - uint32_t subpass; -} VkSubpassShadingPipelineCreateInfoHUAWEI32; - -typedef struct VkPipelineCompilerControlCreateInfoAMD32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCompilerControlFlagsAMD compilerControlFlags; -} VkPipelineCompilerControlCreateInfoAMD32; - -typedef struct VkComputePipelineCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCreateFlags flags; - VkPipelineShaderStageCreateInfo32 DECLSPEC_ALIGN(8) stage; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - VkPipeline DECLSPEC_ALIGN(8) basePipelineHandle; - int32_t basePipelineIndex; -} VkComputePipelineCreateInfo32; - -typedef struct VkCuFunctionCreateInfoNVX32 -{ - VkStructureType sType; - PTR32 pNext; - VkCuModuleNVX DECLSPEC_ALIGN(8) module; - PTR32 pName; -} VkCuFunctionCreateInfoNVX32; - -typedef struct VkCuModuleTexturingModeCreateInfoNVX32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 use64bitTexturing; -} VkCuModuleTexturingModeCreateInfoNVX32; - -typedef struct VkCuModuleCreateInfoNVX32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 dataSize; - PTR32 pData; -} VkCuModuleCreateInfoNVX32; - -typedef struct VkCudaFunctionCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkCudaModuleNV DECLSPEC_ALIGN(8) module; - PTR32 pName; -} VkCudaFunctionCreateInfoNV32; - -typedef struct VkCudaModuleCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 dataSize; - PTR32 pData; -} VkCudaModuleCreateInfoNV32; - -typedef struct VkDebugReportCallbackCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDebugReportFlagsEXT flags; - PTR32 pfnCallback; - PTR32 pUserData; -} VkDebugReportCallbackCreateInfoEXT32; - -typedef struct VkDebugUtilsMessengerCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDebugUtilsMessengerCreateFlagsEXT flags; - VkDebugUtilsMessageSeverityFlagsEXT messageSeverity; - VkDebugUtilsMessageTypeFlagsEXT messageType; - PTR32 pfnUserCallback; - PTR32 pUserData; -} VkDebugUtilsMessengerCreateInfoEXT32; - -typedef struct VkMutableDescriptorTypeListEXT32 -{ - uint32_t descriptorTypeCount; - PTR32 pDescriptorTypes; -} VkMutableDescriptorTypeListEXT32; -typedef VkMutableDescriptorTypeListEXT32 VkMutableDescriptorTypeListVALVE32; - -typedef struct VkDescriptorPoolInlineUniformBlockCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxInlineUniformBlockBindings; -} VkDescriptorPoolInlineUniformBlockCreateInfo32; -typedef VkDescriptorPoolInlineUniformBlockCreateInfo32 VkDescriptorPoolInlineUniformBlockCreateInfoEXT32; - -typedef struct VkMutableDescriptorTypeCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t mutableDescriptorTypeListCount; - PTR32 pMutableDescriptorTypeLists; -} VkMutableDescriptorTypeCreateInfoEXT32; -typedef VkMutableDescriptorTypeCreateInfoEXT32 VkMutableDescriptorTypeCreateInfoVALVE32; - -typedef struct VkDescriptorPoolCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDescriptorPoolCreateFlags flags; - uint32_t maxSets; - uint32_t poolSizeCount; - PTR32 pPoolSizes; -} VkDescriptorPoolCreateInfo32; - -typedef struct VkDescriptorSetLayoutBinding32 -{ - uint32_t binding; - VkDescriptorType descriptorType; - uint32_t descriptorCount; - VkShaderStageFlags stageFlags; - PTR32 pImmutableSamplers; -} VkDescriptorSetLayoutBinding32; - -typedef struct VkDescriptorSetLayoutBindingFlagsCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t bindingCount; - PTR32 pBindingFlags; -} VkDescriptorSetLayoutBindingFlagsCreateInfo32; -typedef VkDescriptorSetLayoutBindingFlagsCreateInfo32 VkDescriptorSetLayoutBindingFlagsCreateInfoEXT32; - -typedef struct VkDescriptorSetLayoutCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDescriptorSetLayoutCreateFlags flags; - uint32_t bindingCount; - PTR32 pBindings; -} VkDescriptorSetLayoutCreateInfo32; - -typedef struct VkDescriptorUpdateTemplateEntry32 -{ - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; - VkDescriptorType descriptorType; - PTR32 offset; - PTR32 stride; -} VkDescriptorUpdateTemplateEntry32; -typedef VkDescriptorUpdateTemplateEntry32 VkDescriptorUpdateTemplateEntryKHR32; - -typedef struct VkDescriptorUpdateTemplateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDescriptorUpdateTemplateCreateFlags flags; - uint32_t descriptorUpdateEntryCount; - PTR32 pDescriptorUpdateEntries; - VkDescriptorUpdateTemplateType templateType; - VkDescriptorSetLayout DECLSPEC_ALIGN(8) descriptorSetLayout; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) pipelineLayout; - uint32_t set; -} VkDescriptorUpdateTemplateCreateInfo32; -typedef VkDescriptorUpdateTemplateCreateInfo32 VkDescriptorUpdateTemplateCreateInfoKHR32; - -typedef struct VkDeviceQueueGlobalPriorityCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkQueueGlobalPriority globalPriority; -} VkDeviceQueueGlobalPriorityCreateInfo32; -typedef VkDeviceQueueGlobalPriorityCreateInfo32 VkDeviceQueueGlobalPriorityCreateInfoKHR32; -typedef VkDeviceQueueGlobalPriorityCreateInfo32 VkDeviceQueueGlobalPriorityCreateInfoEXT32; - -typedef struct VkDeviceQueueShaderCoreControlCreateInfoARM32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t shaderCoreCount; -} VkDeviceQueueShaderCoreControlCreateInfoARM32; - -typedef struct VkDeviceQueueCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceQueueCreateFlags flags; - uint32_t queueFamilyIndex; - uint32_t queueCount; - PTR32 pQueuePriorities; -} VkDeviceQueueCreateInfo32; - -typedef struct VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 deviceGeneratedCommands; -} VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV32; - -typedef struct VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 deviceGeneratedCompute; - VkBool32 deviceGeneratedComputePipelines; - VkBool32 deviceGeneratedComputeCaptureReplay; -} VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV32; - -typedef struct VkDevicePrivateDataCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t privateDataSlotRequestCount; -} VkDevicePrivateDataCreateInfo32; -typedef VkDevicePrivateDataCreateInfo32 VkDevicePrivateDataCreateInfoEXT32; - -typedef struct VkPhysicalDevicePrivateDataFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 privateData; -} VkPhysicalDevicePrivateDataFeatures32; -typedef VkPhysicalDevicePrivateDataFeatures32 VkPhysicalDevicePrivateDataFeaturesEXT32; - -typedef struct VkPhysicalDeviceFeatures232 -{ - VkStructureType sType; - PTR32 pNext; - VkPhysicalDeviceFeatures features; -} VkPhysicalDeviceFeatures232; -typedef VkPhysicalDeviceFeatures232 VkPhysicalDeviceFeatures2KHR32; - -typedef struct VkPhysicalDeviceVariablePointersFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 variablePointersStorageBuffer; - VkBool32 variablePointers; -} VkPhysicalDeviceVariablePointersFeatures32; -typedef VkPhysicalDeviceVariablePointersFeatures32 VkPhysicalDeviceVariablePointersFeaturesKHR32; -typedef VkPhysicalDeviceVariablePointersFeatures32 VkPhysicalDeviceVariablePointerFeaturesKHR32; -typedef VkPhysicalDeviceVariablePointersFeatures32 VkPhysicalDeviceVariablePointerFeatures32; - -typedef struct VkPhysicalDeviceMultiviewFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 multiview; - VkBool32 multiviewGeometryShader; - VkBool32 multiviewTessellationShader; -} VkPhysicalDeviceMultiviewFeatures32; -typedef VkPhysicalDeviceMultiviewFeatures32 VkPhysicalDeviceMultiviewFeaturesKHR32; - -typedef struct VkDeviceGroupDeviceCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t physicalDeviceCount; - PTR32 pPhysicalDevices; -} VkDeviceGroupDeviceCreateInfo32; -typedef VkDeviceGroupDeviceCreateInfo32 VkDeviceGroupDeviceCreateInfoKHR32; - -typedef struct VkPhysicalDevicePresentIdFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 presentId; -} VkPhysicalDevicePresentIdFeaturesKHR32; - -typedef struct VkPhysicalDevicePresentWaitFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 presentWait; -} VkPhysicalDevicePresentWaitFeaturesKHR32; - -typedef struct VkPhysicalDevice16BitStorageFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 storageBuffer16BitAccess; - VkBool32 uniformAndStorageBuffer16BitAccess; - VkBool32 storagePushConstant16; - VkBool32 storageInputOutput16; -} VkPhysicalDevice16BitStorageFeatures32; -typedef VkPhysicalDevice16BitStorageFeatures32 VkPhysicalDevice16BitStorageFeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderSubgroupExtendedTypes; -} VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures32; -typedef VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures32 VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR32; - -typedef struct VkPhysicalDeviceSamplerYcbcrConversionFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 samplerYcbcrConversion; -} VkPhysicalDeviceSamplerYcbcrConversionFeatures32; -typedef VkPhysicalDeviceSamplerYcbcrConversionFeatures32 VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR32; - -typedef struct VkPhysicalDeviceProtectedMemoryFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 protectedMemory; -} VkPhysicalDeviceProtectedMemoryFeatures32; - -typedef struct VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 advancedBlendCoherentOperations; -} VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT32; - -typedef struct VkPhysicalDeviceMultiDrawFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 multiDraw; -} VkPhysicalDeviceMultiDrawFeaturesEXT32; - -typedef struct VkPhysicalDeviceInlineUniformBlockFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 inlineUniformBlock; - VkBool32 descriptorBindingInlineUniformBlockUpdateAfterBind; -} VkPhysicalDeviceInlineUniformBlockFeatures32; -typedef VkPhysicalDeviceInlineUniformBlockFeatures32 VkPhysicalDeviceInlineUniformBlockFeaturesEXT32; - -typedef struct VkPhysicalDeviceMaintenance4Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 maintenance4; -} VkPhysicalDeviceMaintenance4Features32; -typedef VkPhysicalDeviceMaintenance4Features32 VkPhysicalDeviceMaintenance4FeaturesKHR32; - -typedef struct VkPhysicalDeviceMaintenance5Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 maintenance5; -} VkPhysicalDeviceMaintenance5Features32; -typedef VkPhysicalDeviceMaintenance5Features32 VkPhysicalDeviceMaintenance5FeaturesKHR32; - -typedef struct VkPhysicalDeviceMaintenance6Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 maintenance6; -} VkPhysicalDeviceMaintenance6Features32; -typedef VkPhysicalDeviceMaintenance6Features32 VkPhysicalDeviceMaintenance6FeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderDrawParametersFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderDrawParameters; -} VkPhysicalDeviceShaderDrawParametersFeatures32; -typedef VkPhysicalDeviceShaderDrawParametersFeatures32 VkPhysicalDeviceShaderDrawParameterFeatures32; - -typedef struct VkPhysicalDeviceShaderFloat16Int8Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderFloat16; - VkBool32 shaderInt8; -} VkPhysicalDeviceShaderFloat16Int8Features32; -typedef VkPhysicalDeviceShaderFloat16Int8Features32 VkPhysicalDeviceShaderFloat16Int8FeaturesKHR32; -typedef VkPhysicalDeviceShaderFloat16Int8Features32 VkPhysicalDeviceFloat16Int8FeaturesKHR32; - -typedef struct VkPhysicalDeviceHostQueryResetFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 hostQueryReset; -} VkPhysicalDeviceHostQueryResetFeatures32; -typedef VkPhysicalDeviceHostQueryResetFeatures32 VkPhysicalDeviceHostQueryResetFeaturesEXT32; - -typedef struct VkPhysicalDeviceGlobalPriorityQueryFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 globalPriorityQuery; -} VkPhysicalDeviceGlobalPriorityQueryFeatures32; -typedef VkPhysicalDeviceGlobalPriorityQueryFeatures32 VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR32; -typedef VkPhysicalDeviceGlobalPriorityQueryFeatures32 VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT32; - -typedef struct VkPhysicalDeviceDescriptorIndexingFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderInputAttachmentArrayDynamicIndexing; - VkBool32 shaderUniformTexelBufferArrayDynamicIndexing; - VkBool32 shaderStorageTexelBufferArrayDynamicIndexing; - VkBool32 shaderUniformBufferArrayNonUniformIndexing; - VkBool32 shaderSampledImageArrayNonUniformIndexing; - VkBool32 shaderStorageBufferArrayNonUniformIndexing; - VkBool32 shaderStorageImageArrayNonUniformIndexing; - VkBool32 shaderInputAttachmentArrayNonUniformIndexing; - VkBool32 shaderUniformTexelBufferArrayNonUniformIndexing; - VkBool32 shaderStorageTexelBufferArrayNonUniformIndexing; - VkBool32 descriptorBindingUniformBufferUpdateAfterBind; - VkBool32 descriptorBindingSampledImageUpdateAfterBind; - VkBool32 descriptorBindingStorageImageUpdateAfterBind; - VkBool32 descriptorBindingStorageBufferUpdateAfterBind; - VkBool32 descriptorBindingUniformTexelBufferUpdateAfterBind; - VkBool32 descriptorBindingStorageTexelBufferUpdateAfterBind; - VkBool32 descriptorBindingUpdateUnusedWhilePending; - VkBool32 descriptorBindingPartiallyBound; - VkBool32 descriptorBindingVariableDescriptorCount; - VkBool32 runtimeDescriptorArray; -} VkPhysicalDeviceDescriptorIndexingFeatures32; -typedef VkPhysicalDeviceDescriptorIndexingFeatures32 VkPhysicalDeviceDescriptorIndexingFeaturesEXT32; - -typedef struct VkPhysicalDeviceTimelineSemaphoreFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 timelineSemaphore; -} VkPhysicalDeviceTimelineSemaphoreFeatures32; -typedef VkPhysicalDeviceTimelineSemaphoreFeatures32 VkPhysicalDeviceTimelineSemaphoreFeaturesKHR32; - -typedef struct VkPhysicalDevice8BitStorageFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 storageBuffer8BitAccess; - VkBool32 uniformAndStorageBuffer8BitAccess; - VkBool32 storagePushConstant8; -} VkPhysicalDevice8BitStorageFeatures32; -typedef VkPhysicalDevice8BitStorageFeatures32 VkPhysicalDevice8BitStorageFeaturesKHR32; - -typedef struct VkPhysicalDeviceConditionalRenderingFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 conditionalRendering; - VkBool32 inheritedConditionalRendering; -} VkPhysicalDeviceConditionalRenderingFeaturesEXT32; - -typedef struct VkPhysicalDeviceVulkanMemoryModelFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 vulkanMemoryModel; - VkBool32 vulkanMemoryModelDeviceScope; - VkBool32 vulkanMemoryModelAvailabilityVisibilityChains; -} VkPhysicalDeviceVulkanMemoryModelFeatures32; -typedef VkPhysicalDeviceVulkanMemoryModelFeatures32 VkPhysicalDeviceVulkanMemoryModelFeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderAtomicInt64Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderBufferInt64Atomics; - VkBool32 shaderSharedInt64Atomics; -} VkPhysicalDeviceShaderAtomicInt64Features32; -typedef VkPhysicalDeviceShaderAtomicInt64Features32 VkPhysicalDeviceShaderAtomicInt64FeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderAtomicFloatFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderBufferFloat32Atomics; - VkBool32 shaderBufferFloat32AtomicAdd; - VkBool32 shaderBufferFloat64Atomics; - VkBool32 shaderBufferFloat64AtomicAdd; - VkBool32 shaderSharedFloat32Atomics; - VkBool32 shaderSharedFloat32AtomicAdd; - VkBool32 shaderSharedFloat64Atomics; - VkBool32 shaderSharedFloat64AtomicAdd; - VkBool32 shaderImageFloat32Atomics; - VkBool32 shaderImageFloat32AtomicAdd; - VkBool32 sparseImageFloat32Atomics; - VkBool32 sparseImageFloat32AtomicAdd; -} VkPhysicalDeviceShaderAtomicFloatFeaturesEXT32; - -typedef struct VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderBufferFloat16Atomics; - VkBool32 shaderBufferFloat16AtomicAdd; - VkBool32 shaderBufferFloat16AtomicMinMax; - VkBool32 shaderBufferFloat32AtomicMinMax; - VkBool32 shaderBufferFloat64AtomicMinMax; - VkBool32 shaderSharedFloat16Atomics; - VkBool32 shaderSharedFloat16AtomicAdd; - VkBool32 shaderSharedFloat16AtomicMinMax; - VkBool32 shaderSharedFloat32AtomicMinMax; - VkBool32 shaderSharedFloat64AtomicMinMax; - VkBool32 shaderImageFloat32AtomicMinMax; - VkBool32 sparseImageFloat32AtomicMinMax; -} VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT32; - -typedef struct VkPhysicalDeviceVertexAttributeDivisorFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 vertexAttributeInstanceRateDivisor; - VkBool32 vertexAttributeInstanceRateZeroDivisor; -} VkPhysicalDeviceVertexAttributeDivisorFeatures32; -typedef VkPhysicalDeviceVertexAttributeDivisorFeatures32 VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR32; -typedef VkPhysicalDeviceVertexAttributeDivisorFeatures32 VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT32; - -typedef struct VkPhysicalDeviceASTCDecodeFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 decodeModeSharedExponent; -} VkPhysicalDeviceASTCDecodeFeaturesEXT32; - -typedef struct VkPhysicalDeviceTransformFeedbackFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 transformFeedback; - VkBool32 geometryStreams; -} VkPhysicalDeviceTransformFeedbackFeaturesEXT32; - -typedef struct VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 representativeFragmentTest; -} VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV32; - -typedef struct VkPhysicalDeviceExclusiveScissorFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 exclusiveScissor; -} VkPhysicalDeviceExclusiveScissorFeaturesNV32; - -typedef struct VkPhysicalDeviceCornerSampledImageFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 cornerSampledImage; -} VkPhysicalDeviceCornerSampledImageFeaturesNV32; - -typedef struct VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 computeDerivativeGroupQuads; - VkBool32 computeDerivativeGroupLinear; -} VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR32; -typedef VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR32 VkPhysicalDeviceComputeShaderDerivativesFeaturesNV32; - -typedef struct VkPhysicalDeviceShaderImageFootprintFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 imageFootprint; -} VkPhysicalDeviceShaderImageFootprintFeaturesNV32; - -typedef struct VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 dedicatedAllocationImageAliasing; -} VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV32; - -typedef struct VkPhysicalDeviceCopyMemoryIndirectFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 indirectCopy; -} VkPhysicalDeviceCopyMemoryIndirectFeaturesNV32; - -typedef struct VkPhysicalDeviceMemoryDecompressionFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 memoryDecompression; -} VkPhysicalDeviceMemoryDecompressionFeaturesNV32; - -typedef struct VkPhysicalDeviceShadingRateImageFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shadingRateImage; - VkBool32 shadingRateCoarseSampleOrder; -} VkPhysicalDeviceShadingRateImageFeaturesNV32; - -typedef struct VkPhysicalDeviceInvocationMaskFeaturesHUAWEI32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 invocationMask; -} VkPhysicalDeviceInvocationMaskFeaturesHUAWEI32; - -typedef struct VkPhysicalDeviceMeshShaderFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 taskShader; - VkBool32 meshShader; -} VkPhysicalDeviceMeshShaderFeaturesNV32; - -typedef struct VkPhysicalDeviceMeshShaderFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 taskShader; - VkBool32 meshShader; - VkBool32 multiviewMeshShader; - VkBool32 primitiveFragmentShadingRateMeshShader; - VkBool32 meshShaderQueries; -} VkPhysicalDeviceMeshShaderFeaturesEXT32; - -typedef struct VkPhysicalDeviceAccelerationStructureFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 accelerationStructure; - VkBool32 accelerationStructureCaptureReplay; - VkBool32 accelerationStructureIndirectBuild; - VkBool32 accelerationStructureHostCommands; - VkBool32 descriptorBindingAccelerationStructureUpdateAfterBind; -} VkPhysicalDeviceAccelerationStructureFeaturesKHR32; - -typedef struct VkPhysicalDeviceRayTracingPipelineFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 rayTracingPipeline; - VkBool32 rayTracingPipelineShaderGroupHandleCaptureReplay; - VkBool32 rayTracingPipelineShaderGroupHandleCaptureReplayMixed; - VkBool32 rayTracingPipelineTraceRaysIndirect; - VkBool32 rayTraversalPrimitiveCulling; -} VkPhysicalDeviceRayTracingPipelineFeaturesKHR32; - -typedef struct VkPhysicalDeviceRayQueryFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 rayQuery; -} VkPhysicalDeviceRayQueryFeaturesKHR32; - -typedef struct VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 rayTracingMaintenance1; - VkBool32 rayTracingPipelineTraceRaysIndirect2; -} VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR32; - -typedef struct VkDeviceMemoryOverallocationCreateInfoAMD32 -{ - VkStructureType sType; - PTR32 pNext; - VkMemoryOverallocationBehaviorAMD overallocationBehavior; -} VkDeviceMemoryOverallocationCreateInfoAMD32; - -typedef struct VkPhysicalDeviceFragmentDensityMapFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 fragmentDensityMap; - VkBool32 fragmentDensityMapDynamic; - VkBool32 fragmentDensityMapNonSubsampledImages; -} VkPhysicalDeviceFragmentDensityMapFeaturesEXT32; - -typedef struct VkPhysicalDeviceFragmentDensityMap2FeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 fragmentDensityMapDeferred; -} VkPhysicalDeviceFragmentDensityMap2FeaturesEXT32; - -typedef struct VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 fragmentDensityMapOffset; -} VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM32; - -typedef struct VkPhysicalDeviceScalarBlockLayoutFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 scalarBlockLayout; -} VkPhysicalDeviceScalarBlockLayoutFeatures32; -typedef VkPhysicalDeviceScalarBlockLayoutFeatures32 VkPhysicalDeviceScalarBlockLayoutFeaturesEXT32; - -typedef struct VkPhysicalDeviceUniformBufferStandardLayoutFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 uniformBufferStandardLayout; -} VkPhysicalDeviceUniformBufferStandardLayoutFeatures32; -typedef VkPhysicalDeviceUniformBufferStandardLayoutFeatures32 VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR32; - -typedef struct VkPhysicalDeviceDepthClipEnableFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 depthClipEnable; -} VkPhysicalDeviceDepthClipEnableFeaturesEXT32; - -typedef struct VkPhysicalDeviceMemoryPriorityFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 memoryPriority; -} VkPhysicalDeviceMemoryPriorityFeaturesEXT32; - -typedef struct VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 pageableDeviceLocalMemory; -} VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT32; - -typedef struct VkPhysicalDeviceBufferDeviceAddressFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 bufferDeviceAddress; - VkBool32 bufferDeviceAddressCaptureReplay; - VkBool32 bufferDeviceAddressMultiDevice; -} VkPhysicalDeviceBufferDeviceAddressFeatures32; -typedef VkPhysicalDeviceBufferDeviceAddressFeatures32 VkPhysicalDeviceBufferDeviceAddressFeaturesKHR32; - -typedef struct VkPhysicalDeviceBufferDeviceAddressFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 bufferDeviceAddress; - VkBool32 bufferDeviceAddressCaptureReplay; - VkBool32 bufferDeviceAddressMultiDevice; -} VkPhysicalDeviceBufferDeviceAddressFeaturesEXT32; -typedef VkPhysicalDeviceBufferDeviceAddressFeaturesEXT32 VkPhysicalDeviceBufferAddressFeaturesEXT32; - -typedef struct VkPhysicalDeviceImagelessFramebufferFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 imagelessFramebuffer; -} VkPhysicalDeviceImagelessFramebufferFeatures32; -typedef VkPhysicalDeviceImagelessFramebufferFeatures32 VkPhysicalDeviceImagelessFramebufferFeaturesKHR32; - -typedef struct VkPhysicalDeviceTextureCompressionASTCHDRFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 textureCompressionASTC_HDR; -} VkPhysicalDeviceTextureCompressionASTCHDRFeatures32; -typedef VkPhysicalDeviceTextureCompressionASTCHDRFeatures32 VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT32; - -typedef struct VkPhysicalDeviceCooperativeMatrixFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 cooperativeMatrix; - VkBool32 cooperativeMatrixRobustBufferAccess; -} VkPhysicalDeviceCooperativeMatrixFeaturesNV32; - -typedef struct VkPhysicalDeviceYcbcrImageArraysFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 ycbcrImageArrays; -} VkPhysicalDeviceYcbcrImageArraysFeaturesEXT32; - -typedef struct VkPhysicalDevicePresentBarrierFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 presentBarrier; -} VkPhysicalDevicePresentBarrierFeaturesNV32; - -typedef struct VkPhysicalDevicePerformanceQueryFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 performanceCounterQueryPools; - VkBool32 performanceCounterMultipleQueryPools; -} VkPhysicalDevicePerformanceQueryFeaturesKHR32; - -typedef struct VkPerformanceQueryReservationInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxPerformanceQueriesPerPool; -} VkPerformanceQueryReservationInfoKHR32; - -typedef struct VkPhysicalDeviceCoverageReductionModeFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 coverageReductionMode; -} VkPhysicalDeviceCoverageReductionModeFeaturesNV32; - -typedef struct VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderIntegerFunctions2; -} VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL32; - -typedef struct VkPhysicalDeviceShaderClockFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderSubgroupClock; - VkBool32 shaderDeviceClock; -} VkPhysicalDeviceShaderClockFeaturesKHR32; - -typedef struct VkPhysicalDeviceIndexTypeUint8Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 indexTypeUint8; -} VkPhysicalDeviceIndexTypeUint8Features32; -typedef VkPhysicalDeviceIndexTypeUint8Features32 VkPhysicalDeviceIndexTypeUint8FeaturesKHR32; -typedef VkPhysicalDeviceIndexTypeUint8Features32 VkPhysicalDeviceIndexTypeUint8FeaturesEXT32; - -typedef struct VkPhysicalDeviceShaderSMBuiltinsFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderSMBuiltins; -} VkPhysicalDeviceShaderSMBuiltinsFeaturesNV32; - -typedef struct VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 fragmentShaderSampleInterlock; - VkBool32 fragmentShaderPixelInterlock; - VkBool32 fragmentShaderShadingRateInterlock; -} VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT32; - -typedef struct VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 separateDepthStencilLayouts; -} VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures32; -typedef VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures32 VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR32; - -typedef struct VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 primitiveTopologyListRestart; - VkBool32 primitiveTopologyPatchListRestart; -} VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT32; - -typedef struct VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 pipelineExecutableInfo; -} VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderDemoteToHelperInvocation; -} VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures32; -typedef VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures32 VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT32; - -typedef struct VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 texelBufferAlignment; -} VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT32; - -typedef struct VkPhysicalDeviceSubgroupSizeControlFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 subgroupSizeControl; - VkBool32 computeFullSubgroups; -} VkPhysicalDeviceSubgroupSizeControlFeatures32; -typedef VkPhysicalDeviceSubgroupSizeControlFeatures32 VkPhysicalDeviceSubgroupSizeControlFeaturesEXT32; - -typedef struct VkPhysicalDeviceLineRasterizationFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 rectangularLines; - VkBool32 bresenhamLines; - VkBool32 smoothLines; - VkBool32 stippledRectangularLines; - VkBool32 stippledBresenhamLines; - VkBool32 stippledSmoothLines; -} VkPhysicalDeviceLineRasterizationFeatures32; -typedef VkPhysicalDeviceLineRasterizationFeatures32 VkPhysicalDeviceLineRasterizationFeaturesKHR32; -typedef VkPhysicalDeviceLineRasterizationFeatures32 VkPhysicalDeviceLineRasterizationFeaturesEXT32; - -typedef struct VkPhysicalDevicePipelineCreationCacheControlFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 pipelineCreationCacheControl; -} VkPhysicalDevicePipelineCreationCacheControlFeatures32; -typedef VkPhysicalDevicePipelineCreationCacheControlFeatures32 VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT32; - -typedef struct VkPhysicalDeviceVulkan11Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 storageBuffer16BitAccess; - VkBool32 uniformAndStorageBuffer16BitAccess; - VkBool32 storagePushConstant16; - VkBool32 storageInputOutput16; - VkBool32 multiview; - VkBool32 multiviewGeometryShader; - VkBool32 multiviewTessellationShader; - VkBool32 variablePointersStorageBuffer; - VkBool32 variablePointers; - VkBool32 protectedMemory; - VkBool32 samplerYcbcrConversion; - VkBool32 shaderDrawParameters; -} VkPhysicalDeviceVulkan11Features32; - -typedef struct VkPhysicalDeviceVulkan12Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 samplerMirrorClampToEdge; - VkBool32 drawIndirectCount; - VkBool32 storageBuffer8BitAccess; - VkBool32 uniformAndStorageBuffer8BitAccess; - VkBool32 storagePushConstant8; - VkBool32 shaderBufferInt64Atomics; - VkBool32 shaderSharedInt64Atomics; - VkBool32 shaderFloat16; - VkBool32 shaderInt8; - VkBool32 descriptorIndexing; - VkBool32 shaderInputAttachmentArrayDynamicIndexing; - VkBool32 shaderUniformTexelBufferArrayDynamicIndexing; - VkBool32 shaderStorageTexelBufferArrayDynamicIndexing; - VkBool32 shaderUniformBufferArrayNonUniformIndexing; - VkBool32 shaderSampledImageArrayNonUniformIndexing; - VkBool32 shaderStorageBufferArrayNonUniformIndexing; - VkBool32 shaderStorageImageArrayNonUniformIndexing; - VkBool32 shaderInputAttachmentArrayNonUniformIndexing; - VkBool32 shaderUniformTexelBufferArrayNonUniformIndexing; - VkBool32 shaderStorageTexelBufferArrayNonUniformIndexing; - VkBool32 descriptorBindingUniformBufferUpdateAfterBind; - VkBool32 descriptorBindingSampledImageUpdateAfterBind; - VkBool32 descriptorBindingStorageImageUpdateAfterBind; - VkBool32 descriptorBindingStorageBufferUpdateAfterBind; - VkBool32 descriptorBindingUniformTexelBufferUpdateAfterBind; - VkBool32 descriptorBindingStorageTexelBufferUpdateAfterBind; - VkBool32 descriptorBindingUpdateUnusedWhilePending; - VkBool32 descriptorBindingPartiallyBound; - VkBool32 descriptorBindingVariableDescriptorCount; - VkBool32 runtimeDescriptorArray; - VkBool32 samplerFilterMinmax; - VkBool32 scalarBlockLayout; - VkBool32 imagelessFramebuffer; - VkBool32 uniformBufferStandardLayout; - VkBool32 shaderSubgroupExtendedTypes; - VkBool32 separateDepthStencilLayouts; - VkBool32 hostQueryReset; - VkBool32 timelineSemaphore; - VkBool32 bufferDeviceAddress; - VkBool32 bufferDeviceAddressCaptureReplay; - VkBool32 bufferDeviceAddressMultiDevice; - VkBool32 vulkanMemoryModel; - VkBool32 vulkanMemoryModelDeviceScope; - VkBool32 vulkanMemoryModelAvailabilityVisibilityChains; - VkBool32 shaderOutputViewportIndex; - VkBool32 shaderOutputLayer; - VkBool32 subgroupBroadcastDynamicId; -} VkPhysicalDeviceVulkan12Features32; - -typedef struct VkPhysicalDeviceVulkan13Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 robustImageAccess; - VkBool32 inlineUniformBlock; - VkBool32 descriptorBindingInlineUniformBlockUpdateAfterBind; - VkBool32 pipelineCreationCacheControl; - VkBool32 privateData; - VkBool32 shaderDemoteToHelperInvocation; - VkBool32 shaderTerminateInvocation; - VkBool32 subgroupSizeControl; - VkBool32 computeFullSubgroups; - VkBool32 synchronization2; - VkBool32 textureCompressionASTC_HDR; - VkBool32 shaderZeroInitializeWorkgroupMemory; - VkBool32 dynamicRendering; - VkBool32 shaderIntegerDotProduct; - VkBool32 maintenance4; -} VkPhysicalDeviceVulkan13Features32; - -typedef struct VkPhysicalDeviceVulkan14Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 globalPriorityQuery; - VkBool32 shaderSubgroupRotate; - VkBool32 shaderSubgroupRotateClustered; - VkBool32 shaderFloatControls2; - VkBool32 shaderExpectAssume; - VkBool32 rectangularLines; - VkBool32 bresenhamLines; - VkBool32 smoothLines; - VkBool32 stippledRectangularLines; - VkBool32 stippledBresenhamLines; - VkBool32 stippledSmoothLines; - VkBool32 vertexAttributeInstanceRateDivisor; - VkBool32 vertexAttributeInstanceRateZeroDivisor; - VkBool32 indexTypeUint8; - VkBool32 dynamicRenderingLocalRead; - VkBool32 maintenance5; - VkBool32 maintenance6; - VkBool32 pipelineProtectedAccess; - VkBool32 pipelineRobustness; - VkBool32 hostImageCopy; - VkBool32 pushDescriptor; -} VkPhysicalDeviceVulkan14Features32; - -typedef struct VkPhysicalDeviceCoherentMemoryFeaturesAMD32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 deviceCoherentMemory; -} VkPhysicalDeviceCoherentMemoryFeaturesAMD32; - -typedef struct VkPhysicalDeviceCustomBorderColorFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 customBorderColors; - VkBool32 customBorderColorWithoutFormat; -} VkPhysicalDeviceCustomBorderColorFeaturesEXT32; - -typedef struct VkPhysicalDeviceBorderColorSwizzleFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 borderColorSwizzle; - VkBool32 borderColorSwizzleFromImage; -} VkPhysicalDeviceBorderColorSwizzleFeaturesEXT32; - -typedef struct VkPhysicalDeviceExtendedDynamicStateFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 extendedDynamicState; -} VkPhysicalDeviceExtendedDynamicStateFeaturesEXT32; - -typedef struct VkPhysicalDeviceExtendedDynamicState2FeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 extendedDynamicState2; - VkBool32 extendedDynamicState2LogicOp; - VkBool32 extendedDynamicState2PatchControlPoints; -} VkPhysicalDeviceExtendedDynamicState2FeaturesEXT32; - -typedef struct VkPhysicalDeviceExtendedDynamicState3FeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 extendedDynamicState3TessellationDomainOrigin; - VkBool32 extendedDynamicState3DepthClampEnable; - VkBool32 extendedDynamicState3PolygonMode; - VkBool32 extendedDynamicState3RasterizationSamples; - VkBool32 extendedDynamicState3SampleMask; - VkBool32 extendedDynamicState3AlphaToCoverageEnable; - VkBool32 extendedDynamicState3AlphaToOneEnable; - VkBool32 extendedDynamicState3LogicOpEnable; - VkBool32 extendedDynamicState3ColorBlendEnable; - VkBool32 extendedDynamicState3ColorBlendEquation; - VkBool32 extendedDynamicState3ColorWriteMask; - VkBool32 extendedDynamicState3RasterizationStream; - VkBool32 extendedDynamicState3ConservativeRasterizationMode; - VkBool32 extendedDynamicState3ExtraPrimitiveOverestimationSize; - VkBool32 extendedDynamicState3DepthClipEnable; - VkBool32 extendedDynamicState3SampleLocationsEnable; - VkBool32 extendedDynamicState3ColorBlendAdvanced; - VkBool32 extendedDynamicState3ProvokingVertexMode; - VkBool32 extendedDynamicState3LineRasterizationMode; - VkBool32 extendedDynamicState3LineStippleEnable; - VkBool32 extendedDynamicState3DepthClipNegativeOneToOne; - VkBool32 extendedDynamicState3ViewportWScalingEnable; - VkBool32 extendedDynamicState3ViewportSwizzle; - VkBool32 extendedDynamicState3CoverageToColorEnable; - VkBool32 extendedDynamicState3CoverageToColorLocation; - VkBool32 extendedDynamicState3CoverageModulationMode; - VkBool32 extendedDynamicState3CoverageModulationTableEnable; - VkBool32 extendedDynamicState3CoverageModulationTable; - VkBool32 extendedDynamicState3CoverageReductionMode; - VkBool32 extendedDynamicState3RepresentativeFragmentTestEnable; - VkBool32 extendedDynamicState3ShadingRateImageEnable; -} VkPhysicalDeviceExtendedDynamicState3FeaturesEXT32; - -typedef struct VkPhysicalDeviceDiagnosticsConfigFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 diagnosticsConfig; -} VkPhysicalDeviceDiagnosticsConfigFeaturesNV32; - -typedef struct VkDeviceDiagnosticsConfigCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceDiagnosticsConfigFlagsNV flags; -} VkDeviceDiagnosticsConfigCreateInfoNV32; - -typedef struct VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderZeroInitializeWorkgroupMemory; -} VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures32; -typedef VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures32 VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderSubgroupUniformControlFlow; -} VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR32; - -typedef struct VkPhysicalDeviceRobustness2FeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 robustBufferAccess2; - VkBool32 robustImageAccess2; - VkBool32 nullDescriptor; -} VkPhysicalDeviceRobustness2FeaturesEXT32; - -typedef struct VkPhysicalDeviceImageRobustnessFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 robustImageAccess; -} VkPhysicalDeviceImageRobustnessFeatures32; -typedef VkPhysicalDeviceImageRobustnessFeatures32 VkPhysicalDeviceImageRobustnessFeaturesEXT32; - -typedef struct VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 workgroupMemoryExplicitLayout; - VkBool32 workgroupMemoryExplicitLayoutScalarBlockLayout; - VkBool32 workgroupMemoryExplicitLayout8BitAccess; - VkBool32 workgroupMemoryExplicitLayout16BitAccess; -} VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR32; - -typedef struct VkPhysicalDevice4444FormatsFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 formatA4R4G4B4; - VkBool32 formatA4B4G4R4; -} VkPhysicalDevice4444FormatsFeaturesEXT32; - -typedef struct VkPhysicalDeviceSubpassShadingFeaturesHUAWEI32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 subpassShading; -} VkPhysicalDeviceSubpassShadingFeaturesHUAWEI32; - -typedef struct VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 clustercullingShader; - VkBool32 multiviewClusterCullingShader; -} VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI32; - -typedef struct VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderImageInt64Atomics; - VkBool32 sparseImageInt64Atomics; -} VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT32; - -typedef struct VkPhysicalDeviceFragmentShadingRateFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 pipelineFragmentShadingRate; - VkBool32 primitiveFragmentShadingRate; - VkBool32 attachmentFragmentShadingRate; -} VkPhysicalDeviceFragmentShadingRateFeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderTerminateInvocationFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderTerminateInvocation; -} VkPhysicalDeviceShaderTerminateInvocationFeatures32; -typedef VkPhysicalDeviceShaderTerminateInvocationFeatures32 VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR32; - -typedef struct VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 fragmentShadingRateEnums; - VkBool32 supersampleFragmentShadingRates; - VkBool32 noInvocationFragmentShadingRates; -} VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV32; - -typedef struct VkPhysicalDeviceImage2DViewOf3DFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 image2DViewOf3D; - VkBool32 sampler2DViewOf3D; -} VkPhysicalDeviceImage2DViewOf3DFeaturesEXT32; - -typedef struct VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 imageSlicedViewOf3D; -} VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT32; - -typedef struct VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 attachmentFeedbackLoopDynamicState; -} VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT32; - -typedef struct VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 legacyVertexAttributes; -} VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT32; - -typedef struct VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 mutableDescriptorType; -} VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT32; -typedef VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT32 VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE32; - -typedef struct VkPhysicalDeviceDepthClipControlFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 depthClipControl; -} VkPhysicalDeviceDepthClipControlFeaturesEXT32; - -typedef struct VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 deviceGeneratedCommands; - VkBool32 dynamicGeneratedPipelineLayout; -} VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT32; - -typedef struct VkPhysicalDeviceDepthClampControlFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 depthClampControl; -} VkPhysicalDeviceDepthClampControlFeaturesEXT32; - -typedef struct VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 vertexInputDynamicState; -} VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT32; - -typedef struct VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderRelaxedExtendedInstruction; -} VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR32; - -typedef struct VkPhysicalDeviceColorWriteEnableFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 colorWriteEnable; -} VkPhysicalDeviceColorWriteEnableFeaturesEXT32; - -typedef struct VkPhysicalDeviceSynchronization2Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 synchronization2; -} VkPhysicalDeviceSynchronization2Features32; -typedef VkPhysicalDeviceSynchronization2Features32 VkPhysicalDeviceSynchronization2FeaturesKHR32; - -typedef struct VkPhysicalDeviceHostImageCopyFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 hostImageCopy; -} VkPhysicalDeviceHostImageCopyFeatures32; -typedef VkPhysicalDeviceHostImageCopyFeatures32 VkPhysicalDeviceHostImageCopyFeaturesEXT32; - -typedef struct VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 primitivesGeneratedQuery; - VkBool32 primitivesGeneratedQueryWithRasterizerDiscard; - VkBool32 primitivesGeneratedQueryWithNonZeroStreams; -} VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT32; - -typedef struct VkPhysicalDeviceLegacyDitheringFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 legacyDithering; -} VkPhysicalDeviceLegacyDitheringFeaturesEXT32; - -typedef struct VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 multisampledRenderToSingleSampled; -} VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT32; - -typedef struct VkPhysicalDevicePipelineProtectedAccessFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 pipelineProtectedAccess; -} VkPhysicalDevicePipelineProtectedAccessFeatures32; -typedef VkPhysicalDevicePipelineProtectedAccessFeatures32 VkPhysicalDevicePipelineProtectedAccessFeaturesEXT32; - -typedef struct VkPhysicalDeviceVideoMaintenance1FeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 videoMaintenance1; -} VkPhysicalDeviceVideoMaintenance1FeaturesKHR32; - -typedef struct VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 videoEncodeQuantizationMap; -} VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR32; - -typedef struct VkPhysicalDeviceVideoEncodeAV1FeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 videoEncodeAV1; -} VkPhysicalDeviceVideoEncodeAV1FeaturesKHR32; - -typedef struct VkPhysicalDeviceInheritedViewportScissorFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 inheritedViewportScissor2D; -} VkPhysicalDeviceInheritedViewportScissorFeaturesNV32; - -typedef struct VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 ycbcr2plane444Formats; -} VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT32; - -typedef struct VkPhysicalDeviceProvokingVertexFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 provokingVertexLast; - VkBool32 transformFeedbackPreservesProvokingVertex; -} VkPhysicalDeviceProvokingVertexFeaturesEXT32; - -typedef struct VkPhysicalDeviceDescriptorBufferFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 descriptorBuffer; - VkBool32 descriptorBufferCaptureReplay; - VkBool32 descriptorBufferImageLayoutIgnored; - VkBool32 descriptorBufferPushDescriptors; -} VkPhysicalDeviceDescriptorBufferFeaturesEXT32; - -typedef struct VkPhysicalDeviceShaderIntegerDotProductFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderIntegerDotProduct; -} VkPhysicalDeviceShaderIntegerDotProductFeatures32; -typedef VkPhysicalDeviceShaderIntegerDotProductFeatures32 VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR32; - -typedef struct VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 fragmentShaderBarycentric; -} VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR32; -typedef VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR32 VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV32; - -typedef struct VkPhysicalDeviceRayTracingMotionBlurFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 rayTracingMotionBlur; - VkBool32 rayTracingMotionBlurPipelineTraceRaysIndirect; -} VkPhysicalDeviceRayTracingMotionBlurFeaturesNV32; - -typedef struct VkPhysicalDeviceRayTracingValidationFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 rayTracingValidation; -} VkPhysicalDeviceRayTracingValidationFeaturesNV32; - -typedef struct VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 formatRgba10x6WithoutYCbCrSampler; -} VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT32; - -typedef struct VkPhysicalDeviceDynamicRenderingFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 dynamicRendering; -} VkPhysicalDeviceDynamicRenderingFeatures32; -typedef VkPhysicalDeviceDynamicRenderingFeatures32 VkPhysicalDeviceDynamicRenderingFeaturesKHR32; - -typedef struct VkPhysicalDeviceImageViewMinLodFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 minLod; -} VkPhysicalDeviceImageViewMinLodFeaturesEXT32; - -typedef struct VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 rasterizationOrderColorAttachmentAccess; - VkBool32 rasterizationOrderDepthAttachmentAccess; - VkBool32 rasterizationOrderStencilAttachmentAccess; -} VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT32; -typedef VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT32 VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesARM32; - -typedef struct VkPhysicalDeviceLinearColorAttachmentFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 linearColorAttachment; -} VkPhysicalDeviceLinearColorAttachmentFeaturesNV32; - -typedef struct VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 graphicsPipelineLibrary; -} VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT32; - -typedef struct VkPhysicalDevicePipelineBinaryFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 pipelineBinaries; -} VkPhysicalDevicePipelineBinaryFeaturesKHR32; - -typedef struct VkDevicePipelineBinaryInternalCacheControlKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 disableInternalCache; -} VkDevicePipelineBinaryInternalCacheControlKHR32; - -typedef struct VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 descriptorSetHostMapping; -} VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE32; - -typedef struct VkPhysicalDeviceNestedCommandBufferFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 nestedCommandBuffer; - VkBool32 nestedCommandBufferRendering; - VkBool32 nestedCommandBufferSimultaneousUse; -} VkPhysicalDeviceNestedCommandBufferFeaturesEXT32; - -typedef struct VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderModuleIdentifier; -} VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT32; - -typedef struct VkPhysicalDeviceImageCompressionControlFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 imageCompressionControl; -} VkPhysicalDeviceImageCompressionControlFeaturesEXT32; - -typedef struct VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 imageCompressionControlSwapchain; -} VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT32; - -typedef struct VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 subpassMergeFeedback; -} VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT32; - -typedef struct VkPhysicalDeviceOpacityMicromapFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 micromap; - VkBool32 micromapCaptureReplay; - VkBool32 micromapHostCommands; -} VkPhysicalDeviceOpacityMicromapFeaturesEXT32; - -typedef struct VkPhysicalDevicePipelinePropertiesFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 pipelinePropertiesIdentifier; -} VkPhysicalDevicePipelinePropertiesFeaturesEXT32; - -typedef struct VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderEarlyAndLateFragmentTests; -} VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD32; - -typedef struct VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 nonSeamlessCubeMap; -} VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT32; - -typedef struct VkPhysicalDevicePipelineRobustnessFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 pipelineRobustness; -} VkPhysicalDevicePipelineRobustnessFeatures32; -typedef VkPhysicalDevicePipelineRobustnessFeatures32 VkPhysicalDevicePipelineRobustnessFeaturesEXT32; - -typedef struct VkPhysicalDeviceImageProcessingFeaturesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 textureSampleWeighted; - VkBool32 textureBoxFilter; - VkBool32 textureBlockMatch; -} VkPhysicalDeviceImageProcessingFeaturesQCOM32; - -typedef struct VkPhysicalDeviceTilePropertiesFeaturesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 tileProperties; -} VkPhysicalDeviceTilePropertiesFeaturesQCOM32; - -typedef struct VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 attachmentFeedbackLoopLayout; -} VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT32; - -typedef struct VkPhysicalDeviceDepthClampZeroOneFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 depthClampZeroOne; -} VkPhysicalDeviceDepthClampZeroOneFeaturesEXT32; - -typedef struct VkPhysicalDeviceAddressBindingReportFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 reportAddressBinding; -} VkPhysicalDeviceAddressBindingReportFeaturesEXT32; - -typedef struct VkPhysicalDeviceOpticalFlowFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 opticalFlow; -} VkPhysicalDeviceOpticalFlowFeaturesNV32; - -typedef struct VkPhysicalDeviceFaultFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 deviceFault; - VkBool32 deviceFaultVendorBinary; -} VkPhysicalDeviceFaultFeaturesEXT32; - -typedef struct VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 pipelineLibraryGroupHandles; -} VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT32; - -typedef struct VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderCoreBuiltins; -} VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM32; - -typedef struct VkPhysicalDeviceFrameBoundaryFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 frameBoundary; -} VkPhysicalDeviceFrameBoundaryFeaturesEXT32; - -typedef struct VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 dynamicRenderingUnusedAttachments; -} VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT32; - -typedef struct VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 swapchainMaintenance1; -} VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT32; - -typedef struct VkPhysicalDeviceDepthBiasControlFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 depthBiasControl; - VkBool32 leastRepresentableValueForceUnormRepresentation; - VkBool32 floatRepresentation; - VkBool32 depthBiasExact; -} VkPhysicalDeviceDepthBiasControlFeaturesEXT32; - -typedef struct VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 rayTracingInvocationReorder; -} VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV32; - -typedef struct VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 extendedSparseAddressSpace; -} VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV32; - -typedef struct VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 multiviewPerViewViewports; -} VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM32; - -typedef struct VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 rayTracingPositionFetch; -} VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR32; - -typedef struct VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 multiviewPerViewRenderAreas; -} VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM32; - -typedef struct VkPhysicalDeviceShaderObjectFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderObject; -} VkPhysicalDeviceShaderObjectFeaturesEXT32; - -typedef struct VkPhysicalDeviceShaderTileImageFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderTileImageColorReadAccess; - VkBool32 shaderTileImageDepthReadAccess; - VkBool32 shaderTileImageStencilReadAccess; -} VkPhysicalDeviceShaderTileImageFeaturesEXT32; - -typedef struct VkPhysicalDeviceCooperativeMatrixFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 cooperativeMatrix; - VkBool32 cooperativeMatrixRobustBufferAccess; -} VkPhysicalDeviceCooperativeMatrixFeaturesKHR32; - -typedef struct VkPhysicalDeviceAntiLagFeaturesAMD32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 antiLag; -} VkPhysicalDeviceAntiLagFeaturesAMD32; - -typedef struct VkPhysicalDeviceCubicClampFeaturesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 cubicRangeClamp; -} VkPhysicalDeviceCubicClampFeaturesQCOM32; - -typedef struct VkPhysicalDeviceYcbcrDegammaFeaturesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 ycbcrDegamma; -} VkPhysicalDeviceYcbcrDegammaFeaturesQCOM32; - -typedef struct VkPhysicalDeviceCubicWeightsFeaturesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 selectableCubicWeights; -} VkPhysicalDeviceCubicWeightsFeaturesQCOM32; - -typedef struct VkPhysicalDeviceImageProcessing2FeaturesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 textureBlockMatch2; -} VkPhysicalDeviceImageProcessing2FeaturesQCOM32; - -typedef struct VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 descriptorPoolOverallocation; -} VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV32; - -typedef struct VkPhysicalDevicePerStageDescriptorSetFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 perStageDescriptorSet; - VkBool32 dynamicPipelineLayout; -} VkPhysicalDevicePerStageDescriptorSetFeaturesNV32; - -typedef struct VkPhysicalDeviceCudaKernelLaunchFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 cudaKernelLaunchFeatures; -} VkPhysicalDeviceCudaKernelLaunchFeaturesNV32; - -typedef struct VkPhysicalDeviceSchedulingControlsFeaturesARM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 schedulingControls; -} VkPhysicalDeviceSchedulingControlsFeaturesARM32; - -typedef struct VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 relaxedLineRasterization; -} VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG32; - -typedef struct VkPhysicalDeviceRenderPassStripedFeaturesARM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 renderPassStriped; -} VkPhysicalDeviceRenderPassStripedFeaturesARM32; - -typedef struct VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderMaximalReconvergence; -} VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderSubgroupRotateFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderSubgroupRotate; - VkBool32 shaderSubgroupRotateClustered; -} VkPhysicalDeviceShaderSubgroupRotateFeatures32; -typedef VkPhysicalDeviceShaderSubgroupRotateFeatures32 VkPhysicalDeviceShaderSubgroupRotateFeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderExpectAssumeFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderExpectAssume; -} VkPhysicalDeviceShaderExpectAssumeFeatures32; -typedef VkPhysicalDeviceShaderExpectAssumeFeatures32 VkPhysicalDeviceShaderExpectAssumeFeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderFloatControls2Features32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderFloatControls2; -} VkPhysicalDeviceShaderFloatControls2Features32; -typedef VkPhysicalDeviceShaderFloatControls2Features32 VkPhysicalDeviceShaderFloatControls2FeaturesKHR32; - -typedef struct VkPhysicalDeviceDynamicRenderingLocalReadFeatures32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 dynamicRenderingLocalRead; -} VkPhysicalDeviceDynamicRenderingLocalReadFeatures32; -typedef VkPhysicalDeviceDynamicRenderingLocalReadFeatures32 VkPhysicalDeviceDynamicRenderingLocalReadFeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderQuadControlFeaturesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderQuadControl; -} VkPhysicalDeviceShaderQuadControlFeaturesKHR32; - -typedef struct VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderFloat16VectorAtomics; -} VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV32; - -typedef struct VkPhysicalDeviceMapMemoryPlacedFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 memoryMapPlaced; - VkBool32 memoryMapRangePlaced; - VkBool32 memoryUnmapReserve; -} VkPhysicalDeviceMapMemoryPlacedFeaturesEXT32; - -typedef struct VkPhysicalDeviceRawAccessChainsFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderRawAccessChains; -} VkPhysicalDeviceRawAccessChainsFeaturesNV32; - -typedef struct VkPhysicalDeviceCommandBufferInheritanceFeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 commandBufferInheritance; -} VkPhysicalDeviceCommandBufferInheritanceFeaturesNV32; - -typedef struct VkPhysicalDeviceImageAlignmentControlFeaturesMESA32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 imageAlignmentControl; -} VkPhysicalDeviceImageAlignmentControlFeaturesMESA32; - -typedef struct VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderReplicatedComposites; -} VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT32; - -typedef struct VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 presentModeFifoLatestReady; -} VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT32; - -typedef struct VkPhysicalDeviceCooperativeMatrix2FeaturesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 cooperativeMatrixWorkgroupScope; - VkBool32 cooperativeMatrixFlexibleDimensions; - VkBool32 cooperativeMatrixReductions; - VkBool32 cooperativeMatrixConversions; - VkBool32 cooperativeMatrixPerElementOperations; - VkBool32 cooperativeMatrixTensorAddressing; - VkBool32 cooperativeMatrixBlockLoads; -} VkPhysicalDeviceCooperativeMatrix2FeaturesNV32; - -typedef struct VkPhysicalDeviceHdrVividFeaturesHUAWEI32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 hdrVivid; -} VkPhysicalDeviceHdrVividFeaturesHUAWEI32; - -typedef struct VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 vertexAttributeRobustness; -} VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT32; - -typedef struct VkDeviceCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceCreateFlags flags; - uint32_t queueCreateInfoCount; - PTR32 pQueueCreateInfos; - uint32_t enabledLayerCount; - PTR32 ppEnabledLayerNames; - uint32_t enabledExtensionCount; - PTR32 ppEnabledExtensionNames; - PTR32 pEnabledFeatures; -} VkDeviceCreateInfo32; - -typedef struct VkEventCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkEventCreateFlags flags; -} VkEventCreateInfo32; - -typedef struct VkExportFenceCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalFenceHandleTypeFlags handleTypes; -} VkExportFenceCreateInfo32; -typedef VkExportFenceCreateInfo32 VkExportFenceCreateInfoKHR32; - -typedef struct VkFenceCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkFenceCreateFlags flags; -} VkFenceCreateInfo32; - -typedef struct VkFramebufferAttachmentImageInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageCreateFlags flags; - VkImageUsageFlags usage; - uint32_t width; - uint32_t height; - uint32_t layerCount; - uint32_t viewFormatCount; - PTR32 pViewFormats; -} VkFramebufferAttachmentImageInfo32; -typedef VkFramebufferAttachmentImageInfo32 VkFramebufferAttachmentImageInfoKHR32; - -typedef struct VkFramebufferAttachmentsCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t attachmentImageInfoCount; - PTR32 pAttachmentImageInfos; -} VkFramebufferAttachmentsCreateInfo32; -typedef VkFramebufferAttachmentsCreateInfo32 VkFramebufferAttachmentsCreateInfoKHR32; - -typedef struct VkFramebufferCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkFramebufferCreateFlags flags; - VkRenderPass DECLSPEC_ALIGN(8) renderPass; - uint32_t attachmentCount; - PTR32 pAttachments; - uint32_t width; - uint32_t height; - uint32_t layers; -} VkFramebufferCreateInfo32; - -typedef struct VkPipelineVertexInputDivisorStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t vertexBindingDivisorCount; - PTR32 pVertexBindingDivisors; -} VkPipelineVertexInputDivisorStateCreateInfo32; -typedef VkPipelineVertexInputDivisorStateCreateInfo32 VkPipelineVertexInputDivisorStateCreateInfoKHR32; -typedef VkPipelineVertexInputDivisorStateCreateInfo32 VkPipelineVertexInputDivisorStateCreateInfoEXT32; - -typedef struct VkPipelineVertexInputStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineVertexInputStateCreateFlags flags; - uint32_t vertexBindingDescriptionCount; - PTR32 pVertexBindingDescriptions; - uint32_t vertexAttributeDescriptionCount; - PTR32 pVertexAttributeDescriptions; -} VkPipelineVertexInputStateCreateInfo32; - -typedef struct VkPipelineTessellationDomainOriginStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkTessellationDomainOrigin domainOrigin; -} VkPipelineTessellationDomainOriginStateCreateInfo32; -typedef VkPipelineTessellationDomainOriginStateCreateInfo32 VkPipelineTessellationDomainOriginStateCreateInfoKHR32; - -typedef struct VkPipelineTessellationStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineTessellationStateCreateFlags flags; - uint32_t patchControlPoints; -} VkPipelineTessellationStateCreateInfo32; - -typedef struct VkGraphicsShaderGroupCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t stageCount; - PTR32 pStages; - PTR32 pVertexInputState; - PTR32 pTessellationState; -} VkGraphicsShaderGroupCreateInfoNV32; - -typedef struct VkPipelineInputAssemblyStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineInputAssemblyStateCreateFlags flags; - VkPrimitiveTopology topology; - VkBool32 primitiveRestartEnable; -} VkPipelineInputAssemblyStateCreateInfo32; - -typedef struct VkPipelineViewportWScalingStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 viewportWScalingEnable; - uint32_t viewportCount; - PTR32 pViewportWScalings; -} VkPipelineViewportWScalingStateCreateInfoNV32; - -typedef struct VkPipelineViewportSwizzleStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineViewportSwizzleStateCreateFlagsNV flags; - uint32_t viewportCount; - PTR32 pViewportSwizzles; -} VkPipelineViewportSwizzleStateCreateInfoNV32; - -typedef struct VkPipelineViewportExclusiveScissorStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t exclusiveScissorCount; - PTR32 pExclusiveScissors; -} VkPipelineViewportExclusiveScissorStateCreateInfoNV32; - -typedef struct VkPipelineViewportShadingRateImageStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shadingRateImageEnable; - uint32_t viewportCount; - PTR32 pShadingRatePalettes; -} VkPipelineViewportShadingRateImageStateCreateInfoNV32; - -typedef struct VkPipelineViewportCoarseSampleOrderStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkCoarseSampleOrderTypeNV sampleOrderType; - uint32_t customSampleOrderCount; - PTR32 pCustomSampleOrders; -} VkPipelineViewportCoarseSampleOrderStateCreateInfoNV32; - -typedef struct VkPipelineViewportDepthClipControlCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 negativeOneToOne; -} VkPipelineViewportDepthClipControlCreateInfoEXT32; - -typedef struct VkPipelineViewportDepthClampControlCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDepthClampModeEXT depthClampMode; - PTR32 pDepthClampRange; -} VkPipelineViewportDepthClampControlCreateInfoEXT32; - -typedef struct VkPipelineViewportStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineViewportStateCreateFlags flags; - uint32_t viewportCount; - PTR32 pViewports; - uint32_t scissorCount; - PTR32 pScissors; -} VkPipelineViewportStateCreateInfo32; - -typedef struct VkPipelineRasterizationStateRasterizationOrderAMD32 -{ - VkStructureType sType; - PTR32 pNext; - VkRasterizationOrderAMD rasterizationOrder; -} VkPipelineRasterizationStateRasterizationOrderAMD32; - -typedef struct VkPipelineRasterizationConservativeStateCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineRasterizationConservativeStateCreateFlagsEXT flags; - VkConservativeRasterizationModeEXT conservativeRasterizationMode; - float extraPrimitiveOverestimationSize; -} VkPipelineRasterizationConservativeStateCreateInfoEXT32; - -typedef struct VkPipelineRasterizationStateStreamCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineRasterizationStateStreamCreateFlagsEXT flags; - uint32_t rasterizationStream; -} VkPipelineRasterizationStateStreamCreateInfoEXT32; - -typedef struct VkPipelineRasterizationDepthClipStateCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineRasterizationDepthClipStateCreateFlagsEXT flags; - VkBool32 depthClipEnable; -} VkPipelineRasterizationDepthClipStateCreateInfoEXT32; - -typedef struct VkPipelineRasterizationLineStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkLineRasterizationMode lineRasterizationMode; - VkBool32 stippledLineEnable; - uint32_t lineStippleFactor; - uint16_t lineStipplePattern; -} VkPipelineRasterizationLineStateCreateInfo32; -typedef VkPipelineRasterizationLineStateCreateInfo32 VkPipelineRasterizationLineStateCreateInfoKHR32; -typedef VkPipelineRasterizationLineStateCreateInfo32 VkPipelineRasterizationLineStateCreateInfoEXT32; - -typedef struct VkPipelineRasterizationProvokingVertexStateCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkProvokingVertexModeEXT provokingVertexMode; -} VkPipelineRasterizationProvokingVertexStateCreateInfoEXT32; - -typedef struct VkPipelineRasterizationStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineRasterizationStateCreateFlags flags; - VkBool32 depthClampEnable; - VkBool32 rasterizerDiscardEnable; - VkPolygonMode polygonMode; - VkCullModeFlags cullMode; - VkFrontFace frontFace; - VkBool32 depthBiasEnable; - float depthBiasConstantFactor; - float depthBiasClamp; - float depthBiasSlopeFactor; - float lineWidth; -} VkPipelineRasterizationStateCreateInfo32; - -typedef struct VkPipelineCoverageToColorStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCoverageToColorStateCreateFlagsNV flags; - VkBool32 coverageToColorEnable; - uint32_t coverageToColorLocation; -} VkPipelineCoverageToColorStateCreateInfoNV32; - -typedef struct VkPipelineSampleLocationsStateCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 sampleLocationsEnable; - VkSampleLocationsInfoEXT32 sampleLocationsInfo; -} VkPipelineSampleLocationsStateCreateInfoEXT32; - -typedef struct VkPipelineCoverageModulationStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCoverageModulationStateCreateFlagsNV flags; - VkCoverageModulationModeNV coverageModulationMode; - VkBool32 coverageModulationTableEnable; - uint32_t coverageModulationTableCount; - PTR32 pCoverageModulationTable; -} VkPipelineCoverageModulationStateCreateInfoNV32; - -typedef struct VkPipelineCoverageReductionStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCoverageReductionStateCreateFlagsNV flags; - VkCoverageReductionModeNV coverageReductionMode; -} VkPipelineCoverageReductionStateCreateInfoNV32; - -typedef struct VkPipelineMultisampleStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineMultisampleStateCreateFlags flags; - VkSampleCountFlagBits rasterizationSamples; - VkBool32 sampleShadingEnable; - float minSampleShading; - PTR32 pSampleMask; - VkBool32 alphaToCoverageEnable; - VkBool32 alphaToOneEnable; -} VkPipelineMultisampleStateCreateInfo32; - -typedef struct VkPipelineDepthStencilStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineDepthStencilStateCreateFlags flags; - VkBool32 depthTestEnable; - VkBool32 depthWriteEnable; - VkCompareOp depthCompareOp; - VkBool32 depthBoundsTestEnable; - VkBool32 stencilTestEnable; - VkStencilOpState front; - VkStencilOpState back; - float minDepthBounds; - float maxDepthBounds; -} VkPipelineDepthStencilStateCreateInfo32; - -typedef struct VkPipelineColorBlendAdvancedStateCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 srcPremultiplied; - VkBool32 dstPremultiplied; - VkBlendOverlapEXT blendOverlap; -} VkPipelineColorBlendAdvancedStateCreateInfoEXT32; - -typedef struct VkPipelineColorWriteCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t attachmentCount; - PTR32 pColorWriteEnables; -} VkPipelineColorWriteCreateInfoEXT32; - -typedef struct VkPipelineColorBlendStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineColorBlendStateCreateFlags flags; - VkBool32 logicOpEnable; - VkLogicOp logicOp; - uint32_t attachmentCount; - PTR32 pAttachments; - float blendConstants[4]; -} VkPipelineColorBlendStateCreateInfo32; - -typedef struct VkPipelineDynamicStateCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineDynamicStateCreateFlags flags; - uint32_t dynamicStateCount; - PTR32 pDynamicStates; -} VkPipelineDynamicStateCreateInfo32; - -typedef struct VkGraphicsPipelineShaderGroupsCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t groupCount; - PTR32 pGroups; - uint32_t pipelineCount; - PTR32 pPipelines; -} VkGraphicsPipelineShaderGroupsCreateInfoNV32; - -typedef struct VkPipelineDiscardRectangleStateCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineDiscardRectangleStateCreateFlagsEXT flags; - VkDiscardRectangleModeEXT discardRectangleMode; - uint32_t discardRectangleCount; - PTR32 pDiscardRectangles; -} VkPipelineDiscardRectangleStateCreateInfoEXT32; - -typedef struct VkPipelineRepresentativeFragmentTestStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 representativeFragmentTestEnable; -} VkPipelineRepresentativeFragmentTestStateCreateInfoNV32; - -typedef struct VkPipelineLibraryCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t libraryCount; - PTR32 pLibraries; -} VkPipelineLibraryCreateInfoKHR32; - -typedef struct VkPipelineFragmentShadingRateStateCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D fragmentSize; - VkFragmentShadingRateCombinerOpKHR combinerOps[2]; -} VkPipelineFragmentShadingRateStateCreateInfoKHR32; - -typedef struct VkPipelineFragmentShadingRateEnumStateCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkFragmentShadingRateTypeNV shadingRateType; - VkFragmentShadingRateNV shadingRate; - VkFragmentShadingRateCombinerOpKHR combinerOps[2]; -} VkPipelineFragmentShadingRateEnumStateCreateInfoNV32; - -typedef struct VkPipelineRenderingCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t viewMask; - uint32_t colorAttachmentCount; - PTR32 pColorAttachmentFormats; - VkFormat depthAttachmentFormat; - VkFormat stencilAttachmentFormat; -} VkPipelineRenderingCreateInfo32; -typedef VkPipelineRenderingCreateInfo32 VkPipelineRenderingCreateInfoKHR32; - -typedef struct VkGraphicsPipelineLibraryCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkGraphicsPipelineLibraryFlagsEXT flags; -} VkGraphicsPipelineLibraryCreateInfoEXT32; - -typedef struct VkGraphicsPipelineCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCreateFlags flags; - uint32_t stageCount; - PTR32 pStages; - PTR32 pVertexInputState; - PTR32 pInputAssemblyState; - PTR32 pTessellationState; - PTR32 pViewportState; - PTR32 pRasterizationState; - PTR32 pMultisampleState; - PTR32 pDepthStencilState; - PTR32 pColorBlendState; - PTR32 pDynamicState; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - VkRenderPass DECLSPEC_ALIGN(8) renderPass; - uint32_t subpass; - VkPipeline DECLSPEC_ALIGN(8) basePipelineHandle; - int32_t basePipelineIndex; -} VkGraphicsPipelineCreateInfo32; - -typedef struct VkDedicatedAllocationImageCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 dedicatedAllocation; -} VkDedicatedAllocationImageCreateInfoNV32; - -typedef struct VkExternalMemoryImageCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalMemoryHandleTypeFlags handleTypes; -} VkExternalMemoryImageCreateInfo32; -typedef VkExternalMemoryImageCreateInfo32 VkExternalMemoryImageCreateInfoKHR32; - -typedef struct VkImageSwapchainCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; -} VkImageSwapchainCreateInfoKHR32; - -typedef struct VkImageFormatListCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t viewFormatCount; - PTR32 pViewFormats; -} VkImageFormatListCreateInfo32; -typedef VkImageFormatListCreateInfo32 VkImageFormatListCreateInfoKHR32; - -typedef struct VkImageStencilUsageCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageUsageFlags stencilUsage; -} VkImageStencilUsageCreateInfo32; -typedef VkImageStencilUsageCreateInfo32 VkImageStencilUsageCreateInfoEXT32; - -typedef struct VkImageCompressionControlEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageCompressionFlagsEXT flags; - uint32_t compressionControlPlaneCount; - PTR32 pFixedRateFlags; -} VkImageCompressionControlEXT32; - -typedef struct VkOpticalFlowImageFormatInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkOpticalFlowUsageFlagsNV usage; -} VkOpticalFlowImageFormatInfoNV32; - -typedef struct VkImageAlignmentControlCreateInfoMESA32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maximumRequestedAlignment; -} VkImageAlignmentControlCreateInfoMESA32; - -typedef struct VkImageCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageCreateFlags flags; - VkImageType imageType; - VkFormat format; - VkExtent3D extent; - uint32_t mipLevels; - uint32_t arrayLayers; - VkSampleCountFlagBits samples; - VkImageTiling tiling; - VkImageUsageFlags usage; - VkSharingMode sharingMode; - uint32_t queueFamilyIndexCount; - PTR32 pQueueFamilyIndices; - VkImageLayout initialLayout; -} VkImageCreateInfo32; - -typedef struct VkImageViewUsageCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageUsageFlags usage; -} VkImageViewUsageCreateInfo32; -typedef VkImageViewUsageCreateInfo32 VkImageViewUsageCreateInfoKHR32; - -typedef struct VkImageViewSlicedCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t sliceOffset; - uint32_t sliceCount; -} VkImageViewSlicedCreateInfoEXT32; - -typedef struct VkSamplerYcbcrConversionInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkSamplerYcbcrConversion DECLSPEC_ALIGN(8) conversion; -} VkSamplerYcbcrConversionInfo32; -typedef VkSamplerYcbcrConversionInfo32 VkSamplerYcbcrConversionInfoKHR32; - -typedef struct VkImageViewASTCDecodeModeEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkFormat decodeMode; -} VkImageViewASTCDecodeModeEXT32; - -typedef struct VkImageViewMinLodCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - float minLod; -} VkImageViewMinLodCreateInfoEXT32; - -typedef struct VkImageViewSampleWeightCreateInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkOffset2D filterCenter; - VkExtent2D filterSize; - uint32_t numPhases; -} VkImageViewSampleWeightCreateInfoQCOM32; - -typedef struct VkImageViewCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageViewCreateFlags flags; - VkImage DECLSPEC_ALIGN(8) image; - VkImageViewType viewType; - VkFormat format; - VkComponentMapping components; - VkImageSubresourceRange subresourceRange; -} VkImageViewCreateInfo32; - -typedef union VkIndirectCommandsTokenDataEXT32 -{ - PTR32 pPushConstant; - PTR32 pVertexBuffer; - PTR32 pIndexBuffer; - PTR32 pExecutionSet; -} VkIndirectCommandsTokenDataEXT32; - -typedef struct VkIndirectCommandsLayoutTokenEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkIndirectCommandsTokenTypeEXT type; - VkIndirectCommandsTokenDataEXT32 data; - uint32_t offset; -} VkIndirectCommandsLayoutTokenEXT32; - -typedef struct VkIndirectCommandsLayoutCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkIndirectCommandsLayoutUsageFlagsEXT flags; - VkShaderStageFlags shaderStages; - uint32_t indirectStride; - VkPipelineLayout DECLSPEC_ALIGN(8) pipelineLayout; - uint32_t tokenCount; - PTR32 pTokens; -} VkIndirectCommandsLayoutCreateInfoEXT32; - -typedef struct VkIndirectCommandsLayoutTokenNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkIndirectCommandsTokenTypeNV tokenType; - uint32_t stream; - uint32_t offset; - uint32_t vertexBindingUnit; - VkBool32 vertexDynamicStride; - VkPipelineLayout DECLSPEC_ALIGN(8) pushconstantPipelineLayout; - VkShaderStageFlags pushconstantShaderStageFlags; - uint32_t pushconstantOffset; - uint32_t pushconstantSize; - VkIndirectStateFlagsNV indirectStateFlags; - uint32_t indexTypeCount; - PTR32 pIndexTypes; - PTR32 pIndexTypeValues; -} VkIndirectCommandsLayoutTokenNV32; - -typedef struct VkIndirectCommandsLayoutCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkIndirectCommandsLayoutUsageFlagsNV flags; - VkPipelineBindPoint pipelineBindPoint; - uint32_t tokenCount; - PTR32 pTokens; - uint32_t streamCount; - PTR32 pStreamStrides; -} VkIndirectCommandsLayoutCreateInfoNV32; - -typedef struct VkIndirectExecutionSetPipelineInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipeline DECLSPEC_ALIGN(8) initialPipeline; - uint32_t maxPipelineCount; -} VkIndirectExecutionSetPipelineInfoEXT32; - -typedef struct VkIndirectExecutionSetShaderLayoutInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t setLayoutCount; - PTR32 pSetLayouts; -} VkIndirectExecutionSetShaderLayoutInfoEXT32; - -typedef struct VkIndirectExecutionSetShaderInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t shaderCount; - PTR32 pInitialShaders; - PTR32 pSetLayoutInfos; - uint32_t maxShaderCount; - uint32_t pushConstantRangeCount; - PTR32 pPushConstantRanges; -} VkIndirectExecutionSetShaderInfoEXT32; - -typedef union VkIndirectExecutionSetInfoEXT32 -{ - PTR32 pPipelineInfo; - PTR32 pShaderInfo; -} VkIndirectExecutionSetInfoEXT32; - -typedef struct VkIndirectExecutionSetCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkIndirectExecutionSetInfoTypeEXT type; - VkIndirectExecutionSetInfoEXT32 info; -} VkIndirectExecutionSetCreateInfoEXT32; - -typedef struct VkLayerSettingEXT32 -{ - PTR32 pLayerName; - PTR32 pSettingName; - VkLayerSettingTypeEXT type; - uint32_t valueCount; - PTR32 pValues; -} VkLayerSettingEXT32; - -typedef struct VkApplicationInfo32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pApplicationName; - uint32_t applicationVersion; - PTR32 pEngineName; - uint32_t engineVersion; - uint32_t apiVersion; -} VkApplicationInfo32; - -typedef struct VkValidationFlagsEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t disabledValidationCheckCount; - PTR32 pDisabledValidationChecks; -} VkValidationFlagsEXT32; - -typedef struct VkValidationFeaturesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t enabledValidationFeatureCount; - PTR32 pEnabledValidationFeatures; - uint32_t disabledValidationFeatureCount; - PTR32 pDisabledValidationFeatures; -} VkValidationFeaturesEXT32; - -typedef struct VkLayerSettingsCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t settingCount; - PTR32 pSettings; -} VkLayerSettingsCreateInfoEXT32; - -typedef struct VkInstanceCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkInstanceCreateFlags flags; - PTR32 pApplicationInfo; - uint32_t enabledLayerCount; - PTR32 ppEnabledLayerNames; - uint32_t enabledExtensionCount; - PTR32 ppEnabledExtensionNames; -} VkInstanceCreateInfo32; - -typedef struct VkMicromapCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkMicromapCreateFlagsEXT createFlags; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkMicromapTypeEXT type; - VkDeviceAddress DECLSPEC_ALIGN(8) deviceAddress; -} VkMicromapCreateInfoEXT32; - -typedef struct VkOpticalFlowSessionCreatePrivateDataInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t id; - uint32_t size; - PTR32 pPrivateData; -} VkOpticalFlowSessionCreatePrivateDataInfoNV32; - -typedef struct VkOpticalFlowSessionCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t width; - uint32_t height; - VkFormat imageFormat; - VkFormat flowVectorFormat; - VkFormat costFormat; - VkOpticalFlowGridSizeFlagsNV outputGridSize; - VkOpticalFlowGridSizeFlagsNV hintGridSize; - VkOpticalFlowPerformanceLevelNV performanceLevel; - VkOpticalFlowSessionCreateFlagsNV flags; -} VkOpticalFlowSessionCreateInfoNV32; - -typedef struct VkPipelineBinaryKeyKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t keySize; - uint8_t key[VK_MAX_PIPELINE_BINARY_KEY_SIZE_KHR]; -} VkPipelineBinaryKeyKHR32; - -typedef struct VkPipelineBinaryDataKHR32 -{ - PTR32 dataSize; - PTR32 pData; -} VkPipelineBinaryDataKHR32; - -typedef struct VkPipelineBinaryKeysAndDataKHR32 -{ - uint32_t binaryCount; - PTR32 pPipelineBinaryKeys; - PTR32 pPipelineBinaryData; -} VkPipelineBinaryKeysAndDataKHR32; - -typedef struct VkPipelineCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; -} VkPipelineCreateInfoKHR32; - -typedef struct VkPipelineBinaryCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pKeysAndDataInfo; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - PTR32 pPipelineCreateInfo; -} VkPipelineBinaryCreateInfoKHR32; - -typedef struct VkPipelineBinaryHandlesInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t pipelineBinaryCount; - PTR32 pPipelineBinaries; -} VkPipelineBinaryHandlesInfoKHR32; - -typedef struct VkPipelineCacheCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCacheCreateFlags flags; - PTR32 initialDataSize; - PTR32 pInitialData; -} VkPipelineCacheCreateInfo32; - -typedef struct VkPrivateDataSlotCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkPrivateDataSlotCreateFlags flags; -} VkPrivateDataSlotCreateInfo32; -typedef VkPrivateDataSlotCreateInfo32 VkPrivateDataSlotCreateInfoEXT32; - -typedef struct VkQueryPoolPerformanceCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t queueFamilyIndex; - uint32_t counterIndexCount; - PTR32 pCounterIndices; -} VkQueryPoolPerformanceCreateInfoKHR32; - -typedef struct VkQueryPoolPerformanceQueryCreateInfoINTEL32 -{ - VkStructureType sType; - PTR32 pNext; - VkQueryPoolSamplingModeINTEL performanceCountersSampling; -} VkQueryPoolPerformanceQueryCreateInfoINTEL32; -typedef VkQueryPoolPerformanceQueryCreateInfoINTEL32 VkQueryPoolCreateInfoINTEL32; - -typedef struct VkQueryPoolVideoEncodeFeedbackCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEncodeFeedbackFlagsKHR encodeFeedbackFlags; -} VkQueryPoolVideoEncodeFeedbackCreateInfoKHR32; - -typedef struct VkQueryPoolCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkQueryPoolCreateFlags flags; - VkQueryType queryType; - uint32_t queryCount; - VkQueryPipelineStatisticFlags pipelineStatistics; -} VkQueryPoolCreateInfo32; - -typedef struct VkRayTracingShaderGroupCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkRayTracingShaderGroupTypeKHR type; - uint32_t generalShader; - uint32_t closestHitShader; - uint32_t anyHitShader; - uint32_t intersectionShader; - PTR32 pShaderGroupCaptureReplayHandle; -} VkRayTracingShaderGroupCreateInfoKHR32; - -typedef struct VkRayTracingPipelineInterfaceCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxPipelineRayPayloadSize; - uint32_t maxPipelineRayHitAttributeSize; -} VkRayTracingPipelineInterfaceCreateInfoKHR32; - -typedef struct VkRayTracingPipelineCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCreateFlags flags; - uint32_t stageCount; - PTR32 pStages; - uint32_t groupCount; - PTR32 pGroups; - uint32_t maxPipelineRayRecursionDepth; - PTR32 pLibraryInfo; - PTR32 pLibraryInterface; - PTR32 pDynamicState; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - VkPipeline DECLSPEC_ALIGN(8) basePipelineHandle; - int32_t basePipelineIndex; -} VkRayTracingPipelineCreateInfoKHR32; - -typedef struct VkRayTracingShaderGroupCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkRayTracingShaderGroupTypeKHR type; - uint32_t generalShader; - uint32_t closestHitShader; - uint32_t anyHitShader; - uint32_t intersectionShader; -} VkRayTracingShaderGroupCreateInfoNV32; - -typedef struct VkRayTracingPipelineCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineCreateFlags flags; - uint32_t stageCount; - PTR32 pStages; - uint32_t groupCount; - PTR32 pGroups; - uint32_t maxRecursionDepth; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - VkPipeline DECLSPEC_ALIGN(8) basePipelineHandle; - int32_t basePipelineIndex; -} VkRayTracingPipelineCreateInfoNV32; - -typedef struct VkSubpassDescription32 -{ - VkSubpassDescriptionFlags flags; - VkPipelineBindPoint pipelineBindPoint; - uint32_t inputAttachmentCount; - PTR32 pInputAttachments; - uint32_t colorAttachmentCount; - PTR32 pColorAttachments; - PTR32 pResolveAttachments; - PTR32 pDepthStencilAttachment; - uint32_t preserveAttachmentCount; - PTR32 pPreserveAttachments; -} VkSubpassDescription32; - -typedef struct VkRenderPassMultiviewCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t subpassCount; - PTR32 pViewMasks; - uint32_t dependencyCount; - PTR32 pViewOffsets; - uint32_t correlationMaskCount; - PTR32 pCorrelationMasks; -} VkRenderPassMultiviewCreateInfo32; -typedef VkRenderPassMultiviewCreateInfo32 VkRenderPassMultiviewCreateInfoKHR32; - -typedef struct VkRenderPassInputAttachmentAspectCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t aspectReferenceCount; - PTR32 pAspectReferences; -} VkRenderPassInputAttachmentAspectCreateInfo32; -typedef VkRenderPassInputAttachmentAspectCreateInfo32 VkRenderPassInputAttachmentAspectCreateInfoKHR32; - -typedef struct VkRenderPassFragmentDensityMapCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkAttachmentReference fragmentDensityMapAttachment; -} VkRenderPassFragmentDensityMapCreateInfoEXT32; - -typedef struct VkRenderPassCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkRenderPassCreateFlags flags; - uint32_t attachmentCount; - PTR32 pAttachments; - uint32_t subpassCount; - PTR32 pSubpasses; - uint32_t dependencyCount; - PTR32 pDependencies; -} VkRenderPassCreateInfo32; - -typedef struct VkAttachmentDescriptionStencilLayout32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageLayout stencilInitialLayout; - VkImageLayout stencilFinalLayout; -} VkAttachmentDescriptionStencilLayout32; -typedef VkAttachmentDescriptionStencilLayout32 VkAttachmentDescriptionStencilLayoutKHR32; - -typedef struct VkAttachmentDescription232 -{ - VkStructureType sType; - PTR32 pNext; - VkAttachmentDescriptionFlags flags; - VkFormat format; - VkSampleCountFlagBits samples; - VkAttachmentLoadOp loadOp; - VkAttachmentStoreOp storeOp; - VkAttachmentLoadOp stencilLoadOp; - VkAttachmentStoreOp stencilStoreOp; - VkImageLayout initialLayout; - VkImageLayout finalLayout; -} VkAttachmentDescription232; -typedef VkAttachmentDescription232 VkAttachmentDescription2KHR32; - -typedef struct VkAttachmentReferenceStencilLayout32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageLayout stencilLayout; -} VkAttachmentReferenceStencilLayout32; -typedef VkAttachmentReferenceStencilLayout32 VkAttachmentReferenceStencilLayoutKHR32; - -typedef struct VkAttachmentReference232 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t attachment; - VkImageLayout layout; - VkImageAspectFlags aspectMask; -} VkAttachmentReference232; -typedef VkAttachmentReference232 VkAttachmentReference2KHR32; - -typedef struct VkSubpassDescriptionDepthStencilResolve32 -{ - VkStructureType sType; - PTR32 pNext; - VkResolveModeFlagBits depthResolveMode; - VkResolveModeFlagBits stencilResolveMode; - PTR32 pDepthStencilResolveAttachment; -} VkSubpassDescriptionDepthStencilResolve32; -typedef VkSubpassDescriptionDepthStencilResolve32 VkSubpassDescriptionDepthStencilResolveKHR32; - -typedef struct VkFragmentShadingRateAttachmentInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pFragmentShadingRateAttachment; - VkExtent2D shadingRateAttachmentTexelSize; -} VkFragmentShadingRateAttachmentInfoKHR32; - -typedef struct VkRenderPassCreationControlEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 disallowMerging; -} VkRenderPassCreationControlEXT32; - -typedef struct VkRenderPassSubpassFeedbackCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pSubpassFeedback; -} VkRenderPassSubpassFeedbackCreateInfoEXT32; - -typedef struct VkSubpassDescription232 -{ - VkStructureType sType; - PTR32 pNext; - VkSubpassDescriptionFlags flags; - VkPipelineBindPoint pipelineBindPoint; - uint32_t viewMask; - uint32_t inputAttachmentCount; - PTR32 pInputAttachments; - uint32_t colorAttachmentCount; - PTR32 pColorAttachments; - PTR32 pResolveAttachments; - PTR32 pDepthStencilAttachment; - uint32_t preserveAttachmentCount; - PTR32 pPreserveAttachments; -} VkSubpassDescription232; -typedef VkSubpassDescription232 VkSubpassDescription2KHR32; - -typedef struct VkSubpassDependency232 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t srcSubpass; - uint32_t dstSubpass; - VkPipelineStageFlags srcStageMask; - VkPipelineStageFlags dstStageMask; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - VkDependencyFlags dependencyFlags; - int32_t viewOffset; -} VkSubpassDependency232; -typedef VkSubpassDependency232 VkSubpassDependency2KHR32; - -typedef struct VkRenderPassCreationFeedbackCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pRenderPassFeedback; -} VkRenderPassCreationFeedbackCreateInfoEXT32; - -typedef struct VkRenderPassCreateInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkRenderPassCreateFlags flags; - uint32_t attachmentCount; - PTR32 pAttachments; - uint32_t subpassCount; - PTR32 pSubpasses; - uint32_t dependencyCount; - PTR32 pDependencies; - uint32_t correlatedViewMaskCount; - PTR32 pCorrelatedViewMasks; -} VkRenderPassCreateInfo232; -typedef VkRenderPassCreateInfo232 VkRenderPassCreateInfo2KHR32; - -typedef struct VkSamplerReductionModeCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkSamplerReductionMode reductionMode; -} VkSamplerReductionModeCreateInfo32; -typedef VkSamplerReductionModeCreateInfo32 VkSamplerReductionModeCreateInfoEXT32; - -typedef struct VkSamplerCustomBorderColorCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkClearColorValue customBorderColor; - VkFormat format; -} VkSamplerCustomBorderColorCreateInfoEXT32; - -typedef struct VkSamplerBorderColorComponentMappingCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkComponentMapping components; - VkBool32 srgb; -} VkSamplerBorderColorComponentMappingCreateInfoEXT32; - -typedef struct VkSamplerCubicWeightsCreateInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkCubicFilterWeightsQCOM cubicWeights; -} VkSamplerCubicWeightsCreateInfoQCOM32; - -typedef struct VkSamplerBlockMatchWindowCreateInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D windowExtent; - VkBlockMatchWindowCompareModeQCOM windowCompareMode; -} VkSamplerBlockMatchWindowCreateInfoQCOM32; - -typedef struct VkSamplerCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkSamplerCreateFlags flags; - VkFilter magFilter; - VkFilter minFilter; - VkSamplerMipmapMode mipmapMode; - VkSamplerAddressMode addressModeU; - VkSamplerAddressMode addressModeV; - VkSamplerAddressMode addressModeW; - float mipLodBias; - VkBool32 anisotropyEnable; - float maxAnisotropy; - VkBool32 compareEnable; - VkCompareOp compareOp; - float minLod; - float maxLod; - VkBorderColor borderColor; - VkBool32 unnormalizedCoordinates; -} VkSamplerCreateInfo32; - -typedef struct VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 enableYDegamma; - VkBool32 enableCbCrDegamma; -} VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM32; - -typedef struct VkSamplerYcbcrConversionCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkFormat format; - VkSamplerYcbcrModelConversion ycbcrModel; - VkSamplerYcbcrRange ycbcrRange; - VkComponentMapping components; - VkChromaLocation xChromaOffset; - VkChromaLocation yChromaOffset; - VkFilter chromaFilter; - VkBool32 forceExplicitReconstruction; -} VkSamplerYcbcrConversionCreateInfo32; -typedef VkSamplerYcbcrConversionCreateInfo32 VkSamplerYcbcrConversionCreateInfoKHR32; - -typedef struct VkExportSemaphoreCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalSemaphoreHandleTypeFlags handleTypes; -} VkExportSemaphoreCreateInfo32; -typedef VkExportSemaphoreCreateInfo32 VkExportSemaphoreCreateInfoKHR32; - -typedef struct VkSemaphoreTypeCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkSemaphoreType semaphoreType; - uint64_t DECLSPEC_ALIGN(8) initialValue; -} VkSemaphoreTypeCreateInfo32; -typedef VkSemaphoreTypeCreateInfo32 VkSemaphoreTypeCreateInfoKHR32; - -typedef struct VkQueryLowLatencySupportNV32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pQueriedLowLatencyData; -} VkQueryLowLatencySupportNV32; - -typedef struct VkSemaphoreCreateInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkSemaphoreCreateFlags flags; -} VkSemaphoreCreateInfo32; - -typedef struct VkShaderCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderCreateFlagsEXT flags; - VkShaderStageFlagBits stage; - VkShaderStageFlags nextStage; - VkShaderCodeTypeEXT codeType; - PTR32 codeSize; - PTR32 pCode; - PTR32 pName; - uint32_t setLayoutCount; - PTR32 pSetLayouts; - uint32_t pushConstantRangeCount; - PTR32 pPushConstantRanges; - PTR32 pSpecializationInfo; -} VkShaderCreateInfoEXT32; - -typedef struct VkDeviceGroupSwapchainCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceGroupPresentModeFlagsKHR modes; -} VkDeviceGroupSwapchainCreateInfoKHR32; - -typedef struct VkSwapchainPresentBarrierCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 presentBarrierEnable; -} VkSwapchainPresentBarrierCreateInfoNV32; - -typedef struct VkSwapchainPresentModesCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t presentModeCount; - PTR32 pPresentModes; -} VkSwapchainPresentModesCreateInfoEXT32; - -typedef struct VkSwapchainPresentScalingCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkPresentScalingFlagsEXT scalingBehavior; - VkPresentGravityFlagsEXT presentGravityX; - VkPresentGravityFlagsEXT presentGravityY; -} VkSwapchainPresentScalingCreateInfoEXT32; - -typedef struct VkSwapchainLatencyCreateInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 latencyModeEnable; -} VkSwapchainLatencyCreateInfoNV32; - -typedef struct VkSwapchainCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkSwapchainCreateFlagsKHR flags; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - uint32_t minImageCount; - VkFormat imageFormat; - VkColorSpaceKHR imageColorSpace; - VkExtent2D imageExtent; - uint32_t imageArrayLayers; - VkImageUsageFlags imageUsage; - VkSharingMode imageSharingMode; - uint32_t queueFamilyIndexCount; - PTR32 pQueueFamilyIndices; - VkSurfaceTransformFlagBitsKHR preTransform; - VkCompositeAlphaFlagBitsKHR compositeAlpha; - VkPresentModeKHR presentMode; - VkBool32 clipped; - VkSwapchainKHR DECLSPEC_ALIGN(8) oldSwapchain; -} VkSwapchainCreateInfoKHR32; - -typedef struct VkValidationCacheCreateInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkValidationCacheCreateFlagsEXT flags; - PTR32 initialDataSize; - PTR32 pInitialData; -} VkValidationCacheCreateInfoEXT32; - -typedef struct VkVideoEncodeH264SessionCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 useMaxLevelIdc; - StdVideoH264LevelIdc maxLevelIdc; -} VkVideoEncodeH264SessionCreateInfoKHR32; - -typedef struct VkVideoEncodeH265SessionCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 useMaxLevelIdc; - StdVideoH265LevelIdc maxLevelIdc; -} VkVideoEncodeH265SessionCreateInfoKHR32; - -typedef struct VkVideoEncodeAV1SessionCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 useMaxLevel; - StdVideoAV1Level maxLevel; -} VkVideoEncodeAV1SessionCreateInfoKHR32; - -typedef struct VkVideoSessionCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t queueFamilyIndex; - VkVideoSessionCreateFlagsKHR flags; - PTR32 pVideoProfile; - VkFormat pictureFormat; - VkExtent2D maxCodedExtent; - VkFormat referencePictureFormat; - uint32_t maxDpbSlots; - uint32_t maxActiveReferencePictures; - PTR32 pStdHeaderVersion; -} VkVideoSessionCreateInfoKHR32; - -typedef struct StdVideoH264SequenceParameterSetVui32 -{ - StdVideoH264SpsVuiFlags flags; - StdVideoH264AspectRatioIdc aspect_ratio_idc; - uint16_t sar_width; - uint16_t sar_height; - uint8_t video_format; - uint8_t colour_primaries; - uint8_t transfer_characteristics; - uint8_t matrix_coefficients; - uint32_t num_units_in_tick; - uint32_t time_scale; - uint8_t max_num_reorder_frames; - uint8_t max_dec_frame_buffering; - uint8_t chroma_sample_loc_type_top_field; - uint8_t chroma_sample_loc_type_bottom_field; - uint32_t reserved1; - PTR32 pHrdParameters; -} StdVideoH264SequenceParameterSetVui32; - -typedef struct StdVideoH264SequenceParameterSet32 -{ - StdVideoH264SpsFlags flags; - StdVideoH264ProfileIdc profile_idc; - StdVideoH264LevelIdc level_idc; - StdVideoH264ChromaFormatIdc chroma_format_idc; - uint8_t seq_parameter_set_id; - uint8_t bit_depth_luma_minus8; - uint8_t bit_depth_chroma_minus8; - uint8_t log2_max_frame_num_minus4; - StdVideoH264PocType pic_order_cnt_type; - int32_t offset_for_non_ref_pic; - int32_t offset_for_top_to_bottom_field; - uint8_t log2_max_pic_order_cnt_lsb_minus4; - uint8_t num_ref_frames_in_pic_order_cnt_cycle; - uint8_t max_num_ref_frames; - uint8_t reserved1; - uint32_t pic_width_in_mbs_minus1; - uint32_t pic_height_in_map_units_minus1; - uint32_t frame_crop_left_offset; - uint32_t frame_crop_right_offset; - uint32_t frame_crop_top_offset; - uint32_t frame_crop_bottom_offset; - uint32_t reserved2; - PTR32 pOffsetForRefFrame; - PTR32 pScalingLists; - PTR32 pSequenceParameterSetVui; -} StdVideoH264SequenceParameterSet32; - -typedef struct StdVideoH264PictureParameterSet32 -{ - StdVideoH264PpsFlags flags; - uint8_t seq_parameter_set_id; - uint8_t pic_parameter_set_id; - uint8_t num_ref_idx_l0_default_active_minus1; - uint8_t num_ref_idx_l1_default_active_minus1; - StdVideoH264WeightedBipredIdc weighted_bipred_idc; - int8_t pic_init_qp_minus26; - int8_t pic_init_qs_minus26; - int8_t chroma_qp_index_offset; - int8_t second_chroma_qp_index_offset; - PTR32 pScalingLists; -} StdVideoH264PictureParameterSet32; - -typedef struct VkVideoDecodeH264SessionParametersAddInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t stdSPSCount; - PTR32 pStdSPSs; - uint32_t stdPPSCount; - PTR32 pStdPPSs; -} VkVideoDecodeH264SessionParametersAddInfoKHR32; - -typedef struct StdVideoH265HrdParameters32 -{ - StdVideoH265HrdFlags flags; - uint8_t tick_divisor_minus2; - uint8_t du_cpb_removal_delay_increment_length_minus1; - uint8_t dpb_output_delay_du_length_minus1; - uint8_t bit_rate_scale; - uint8_t cpb_size_scale; - uint8_t cpb_size_du_scale; - uint8_t initial_cpb_removal_delay_length_minus1; - uint8_t au_cpb_removal_delay_length_minus1; - uint8_t dpb_output_delay_length_minus1; - uint8_t cpb_cnt_minus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]; - uint16_t elemental_duration_in_tc_minus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]; - uint16_t reserved[3]; - PTR32 pSubLayerHrdParametersNal; - PTR32 pSubLayerHrdParametersVcl; -} StdVideoH265HrdParameters32; - -typedef struct StdVideoH265VideoParameterSet32 -{ - StdVideoH265VpsFlags flags; - uint8_t vps_video_parameter_set_id; - uint8_t vps_max_sub_layers_minus1; - uint8_t reserved1; - uint8_t reserved2; - uint32_t vps_num_units_in_tick; - uint32_t vps_time_scale; - uint32_t vps_num_ticks_poc_diff_one_minus1; - uint32_t reserved3; - PTR32 pDecPicBufMgr; - PTR32 pHrdParameters; - PTR32 pProfileTierLevel; -} StdVideoH265VideoParameterSet32; - -typedef struct StdVideoH265SequenceParameterSetVui32 -{ - StdVideoH265SpsVuiFlags flags; - StdVideoH265AspectRatioIdc aspect_ratio_idc; - uint16_t sar_width; - uint16_t sar_height; - uint8_t video_format; - uint8_t colour_primaries; - uint8_t transfer_characteristics; - uint8_t matrix_coeffs; - uint8_t chroma_sample_loc_type_top_field; - uint8_t chroma_sample_loc_type_bottom_field; - uint8_t reserved1; - uint8_t reserved2; - uint16_t def_disp_win_left_offset; - uint16_t def_disp_win_right_offset; - uint16_t def_disp_win_top_offset; - uint16_t def_disp_win_bottom_offset; - uint32_t vui_num_units_in_tick; - uint32_t vui_time_scale; - uint32_t vui_num_ticks_poc_diff_one_minus1; - uint16_t min_spatial_segmentation_idc; - uint16_t reserved3; - uint8_t max_bytes_per_pic_denom; - uint8_t max_bits_per_min_cu_denom; - uint8_t log2_max_mv_length_horizontal; - uint8_t log2_max_mv_length_vertical; - PTR32 pHrdParameters; -} StdVideoH265SequenceParameterSetVui32; - -typedef struct StdVideoH265SequenceParameterSet32 -{ - StdVideoH265SpsFlags flags; - StdVideoH265ChromaFormatIdc chroma_format_idc; - uint32_t pic_width_in_luma_samples; - uint32_t pic_height_in_luma_samples; - uint8_t sps_video_parameter_set_id; - uint8_t sps_max_sub_layers_minus1; - uint8_t sps_seq_parameter_set_id; - uint8_t bit_depth_luma_minus8; - uint8_t bit_depth_chroma_minus8; - uint8_t log2_max_pic_order_cnt_lsb_minus4; - uint8_t log2_min_luma_coding_block_size_minus3; - uint8_t log2_diff_max_min_luma_coding_block_size; - uint8_t log2_min_luma_transform_block_size_minus2; - uint8_t log2_diff_max_min_luma_transform_block_size; - uint8_t max_transform_hierarchy_depth_inter; - uint8_t max_transform_hierarchy_depth_intra; - uint8_t num_short_term_ref_pic_sets; - uint8_t num_long_term_ref_pics_sps; - uint8_t pcm_sample_bit_depth_luma_minus1; - uint8_t pcm_sample_bit_depth_chroma_minus1; - uint8_t log2_min_pcm_luma_coding_block_size_minus3; - uint8_t log2_diff_max_min_pcm_luma_coding_block_size; - uint8_t reserved1; - uint8_t reserved2; - uint8_t palette_max_size; - uint8_t delta_palette_max_predictor_size; - uint8_t motion_vector_resolution_control_idc; - uint8_t sps_num_palette_predictor_initializers_minus1; - uint32_t conf_win_left_offset; - uint32_t conf_win_right_offset; - uint32_t conf_win_top_offset; - uint32_t conf_win_bottom_offset; - PTR32 pProfileTierLevel; - PTR32 pDecPicBufMgr; - PTR32 pScalingLists; - PTR32 pShortTermRefPicSet; - PTR32 pLongTermRefPicsSps; - PTR32 pSequenceParameterSetVui; - PTR32 pPredictorPaletteEntries; -} StdVideoH265SequenceParameterSet32; - -typedef struct StdVideoH265PictureParameterSet32 -{ - StdVideoH265PpsFlags flags; - uint8_t pps_pic_parameter_set_id; - uint8_t pps_seq_parameter_set_id; - uint8_t sps_video_parameter_set_id; - uint8_t num_extra_slice_header_bits; - uint8_t num_ref_idx_l0_default_active_minus1; - uint8_t num_ref_idx_l1_default_active_minus1; - int8_t init_qp_minus26; - uint8_t diff_cu_qp_delta_depth; - int8_t pps_cb_qp_offset; - int8_t pps_cr_qp_offset; - int8_t pps_beta_offset_div2; - int8_t pps_tc_offset_div2; - uint8_t log2_parallel_merge_level_minus2; - uint8_t log2_max_transform_skip_block_size_minus2; - uint8_t diff_cu_chroma_qp_offset_depth; - uint8_t chroma_qp_offset_list_len_minus1; - int8_t cb_qp_offset_list[STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE]; - int8_t cr_qp_offset_list[STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE]; - uint8_t log2_sao_offset_scale_luma; - uint8_t log2_sao_offset_scale_chroma; - int8_t pps_act_y_qp_offset_plus5; - int8_t pps_act_cb_qp_offset_plus5; - int8_t pps_act_cr_qp_offset_plus3; - uint8_t pps_num_palette_predictor_initializers; - uint8_t luma_bit_depth_entry_minus8; - uint8_t chroma_bit_depth_entry_minus8; - uint8_t num_tile_columns_minus1; - uint8_t num_tile_rows_minus1; - uint8_t reserved1; - uint8_t reserved2; - uint16_t column_width_minus1[STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_COLS_LIST_SIZE]; - uint16_t row_height_minus1[STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_ROWS_LIST_SIZE]; - uint32_t reserved3; - PTR32 pScalingLists; - PTR32 pPredictorPaletteEntries; -} StdVideoH265PictureParameterSet32; - -typedef struct VkVideoDecodeH265SessionParametersAddInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t stdVPSCount; - PTR32 pStdVPSs; - uint32_t stdSPSCount; - PTR32 pStdSPSs; - uint32_t stdPPSCount; - PTR32 pStdPPSs; -} VkVideoDecodeH265SessionParametersAddInfoKHR32; - -typedef struct StdVideoAV1SequenceHeader32 -{ - StdVideoAV1SequenceHeaderFlags flags; - StdVideoAV1Profile seq_profile; - uint8_t frame_width_bits_minus_1; - uint8_t frame_height_bits_minus_1; - uint16_t max_frame_width_minus_1; - uint16_t max_frame_height_minus_1; - uint8_t delta_frame_id_length_minus_2; - uint8_t additional_frame_id_length_minus_1; - uint8_t order_hint_bits_minus_1; - uint8_t seq_force_integer_mv; - uint8_t seq_force_screen_content_tools; - uint8_t reserved1[5]; - PTR32 pColorConfig; - PTR32 pTimingInfo; -} StdVideoAV1SequenceHeader32; - -typedef struct VkVideoEncodeH264SessionParametersAddInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t stdSPSCount; - PTR32 pStdSPSs; - uint32_t stdPPSCount; - PTR32 pStdPPSs; -} VkVideoEncodeH264SessionParametersAddInfoKHR32; - -typedef struct VkVideoEncodeH265SessionParametersAddInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t stdVPSCount; - PTR32 pStdVPSs; - uint32_t stdSPSCount; - PTR32 pStdSPSs; - uint32_t stdPPSCount; - PTR32 pStdPPSs; -} VkVideoEncodeH265SessionParametersAddInfoKHR32; - -typedef struct VkVideoDecodeH264SessionParametersCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxStdSPSCount; - uint32_t maxStdPPSCount; - PTR32 pParametersAddInfo; -} VkVideoDecodeH264SessionParametersCreateInfoKHR32; - -typedef struct VkVideoDecodeH265SessionParametersCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxStdVPSCount; - uint32_t maxStdSPSCount; - uint32_t maxStdPPSCount; - PTR32 pParametersAddInfo; -} VkVideoDecodeH265SessionParametersCreateInfoKHR32; - -typedef struct VkVideoDecodeAV1SessionParametersCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pStdSequenceHeader; -} VkVideoDecodeAV1SessionParametersCreateInfoKHR32; - -typedef struct VkVideoEncodeQuantizationMapSessionParametersCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D quantizationMapTexelSize; -} VkVideoEncodeQuantizationMapSessionParametersCreateInfoKHR32; - -typedef struct VkVideoEncodeH264SessionParametersCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxStdSPSCount; - uint32_t maxStdPPSCount; - PTR32 pParametersAddInfo; -} VkVideoEncodeH264SessionParametersCreateInfoKHR32; - -typedef struct VkVideoEncodeH265SessionParametersCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxStdVPSCount; - uint32_t maxStdSPSCount; - uint32_t maxStdPPSCount; - PTR32 pParametersAddInfo; -} VkVideoEncodeH265SessionParametersCreateInfoKHR32; - -typedef struct VkVideoEncodeAV1SessionParametersCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pStdSequenceHeader; - PTR32 pStdDecoderModelInfo; - uint32_t stdOperatingPointCount; - PTR32 pStdOperatingPoints; -} VkVideoEncodeAV1SessionParametersCreateInfoKHR32; - -typedef struct VkVideoSessionParametersCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoSessionParametersCreateFlagsKHR flags; - VkVideoSessionParametersKHR DECLSPEC_ALIGN(8) videoSessionParametersTemplate; - VkVideoSessionKHR DECLSPEC_ALIGN(8) videoSession; -} VkVideoSessionParametersCreateInfoKHR32; - -typedef struct VkWin32SurfaceCreateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkWin32SurfaceCreateFlagsKHR flags; - PTR32 hinstance; - PTR32 hwnd; -} VkWin32SurfaceCreateInfoKHR32; - -typedef struct VkDebugMarkerObjectNameInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDebugReportObjectTypeEXT objectType; - uint64_t DECLSPEC_ALIGN(8) object; - PTR32 pObjectName; -} VkDebugMarkerObjectNameInfoEXT32; - -typedef struct VkDebugMarkerObjectTagInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDebugReportObjectTypeEXT objectType; - uint64_t DECLSPEC_ALIGN(8) object; - uint64_t DECLSPEC_ALIGN(8) tagName; - PTR32 tagSize; - PTR32 pTag; -} VkDebugMarkerObjectTagInfoEXT32; - -typedef struct VkPhysicalDeviceGroupProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t physicalDeviceCount; - PTR32 physicalDevices[VK_MAX_DEVICE_GROUP_SIZE]; - VkBool32 subsetAllocation; -} VkPhysicalDeviceGroupProperties32; -typedef VkPhysicalDeviceGroupProperties32 VkPhysicalDeviceGroupPropertiesKHR32; - -typedef struct VkPerformanceCounterKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkPerformanceCounterUnitKHR unit; - VkPerformanceCounterScopeKHR scope; - VkPerformanceCounterStorageKHR storage; - uint8_t uuid[VK_UUID_SIZE]; -} VkPerformanceCounterKHR32; - -typedef struct VkPerformanceCounterDescriptionKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkPerformanceCounterDescriptionFlagsKHR flags; - char name[VK_MAX_DESCRIPTION_SIZE]; - char category[VK_MAX_DESCRIPTION_SIZE]; - char description[VK_MAX_DESCRIPTION_SIZE]; -} VkPerformanceCounterDescriptionKHR32; - -typedef struct VkMappedMemoryRange32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; -} VkMappedMemoryRange32; - -typedef struct VkAccelerationStructureBuildSizesInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) accelerationStructureSize; - VkDeviceSize DECLSPEC_ALIGN(8) updateScratchSize; - VkDeviceSize DECLSPEC_ALIGN(8) buildScratchSize; -} VkAccelerationStructureBuildSizesInfoKHR32; - -typedef struct VkAccelerationStructureDeviceAddressInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) accelerationStructure; -} VkAccelerationStructureDeviceAddressInfoKHR32; - -typedef struct VkAccelerationStructureMemoryRequirementsInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccelerationStructureMemoryRequirementsTypeNV type; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) accelerationStructure; -} VkAccelerationStructureMemoryRequirementsInfoNV32; - -typedef struct VkMemoryRequirements32 -{ - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkDeviceSize DECLSPEC_ALIGN(8) alignment; - uint32_t memoryTypeBits; -} VkMemoryRequirements32; - - -typedef struct VkAccelerationStructureCaptureDescriptorDataInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) accelerationStructure; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) accelerationStructureNV; -} VkAccelerationStructureCaptureDescriptorDataInfoEXT32; - -typedef struct VkBufferDeviceAddressInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) buffer; -} VkBufferDeviceAddressInfo32; -typedef VkBufferDeviceAddressInfo32 VkBufferDeviceAddressInfoKHR32; -typedef VkBufferDeviceAddressInfo32 VkBufferDeviceAddressInfoEXT32; - -typedef struct VkBufferMemoryRequirementsInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) buffer; -} VkBufferMemoryRequirementsInfo232; -typedef VkBufferMemoryRequirementsInfo232 VkBufferMemoryRequirementsInfo2KHR32; - -typedef struct VkMemoryDedicatedRequirements32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 prefersDedicatedAllocation; - VkBool32 requiresDedicatedAllocation; -} VkMemoryDedicatedRequirements32; -typedef VkMemoryDedicatedRequirements32 VkMemoryDedicatedRequirementsKHR32; - -typedef struct VkMemoryRequirements232 -{ - VkStructureType sType; - PTR32 pNext; - VkMemoryRequirements32 DECLSPEC_ALIGN(8) memoryRequirements; -} VkMemoryRequirements232; -typedef VkMemoryRequirements232 VkMemoryRequirements2KHR32; - -typedef struct VkBufferCaptureDescriptorDataInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBuffer DECLSPEC_ALIGN(8) buffer; -} VkBufferCaptureDescriptorDataInfoEXT32; - -typedef struct VkCalibratedTimestampInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkTimeDomainKHR timeDomain; -} VkCalibratedTimestampInfoKHR32; -typedef VkCalibratedTimestampInfoKHR32 VkCalibratedTimestampInfoEXT32; - -typedef struct VkDescriptorAddressInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceAddress DECLSPEC_ALIGN(8) address; - VkDeviceSize DECLSPEC_ALIGN(8) range; - VkFormat format; -} VkDescriptorAddressInfoEXT32; - -typedef union VkDescriptorDataEXT32 -{ - PTR32 pSampler; - PTR32 pCombinedImageSampler; - PTR32 pInputAttachmentImage; - PTR32 pSampledImage; - PTR32 pStorageImage; - PTR32 pUniformTexelBuffer; - PTR32 pStorageTexelBuffer; - PTR32 pUniformBuffer; - PTR32 pStorageBuffer; - VkDeviceAddress DECLSPEC_ALIGN(8) accelerationStructure; -} VkDescriptorDataEXT32; - -typedef struct VkDescriptorGetInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDescriptorType type; - VkDescriptorDataEXT32 DECLSPEC_ALIGN(8) data; -} VkDescriptorGetInfoEXT32; - -typedef struct VkDescriptorSetBindingReferenceVALVE32 -{ - VkStructureType sType; - PTR32 pNext; - VkDescriptorSetLayout DECLSPEC_ALIGN(8) descriptorSetLayout; - uint32_t binding; -} VkDescriptorSetBindingReferenceVALVE32; - -typedef struct VkDescriptorSetLayoutHostMappingInfoVALVE32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 descriptorOffset; - uint32_t descriptorSize; -} VkDescriptorSetLayoutHostMappingInfoVALVE32; - -typedef struct VkDescriptorSetVariableDescriptorCountLayoutSupport32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxVariableDescriptorCount; -} VkDescriptorSetVariableDescriptorCountLayoutSupport32; -typedef VkDescriptorSetVariableDescriptorCountLayoutSupport32 VkDescriptorSetVariableDescriptorCountLayoutSupportEXT32; - -typedef struct VkDescriptorSetLayoutSupport32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 supported; -} VkDescriptorSetLayoutSupport32; -typedef VkDescriptorSetLayoutSupport32 VkDescriptorSetLayoutSupportKHR32; - -typedef struct VkAccelerationStructureVersionInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pVersionData; -} VkAccelerationStructureVersionInfoKHR32; - -typedef struct VkDeviceBufferMemoryRequirements32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pCreateInfo; -} VkDeviceBufferMemoryRequirements32; -typedef VkDeviceBufferMemoryRequirements32 VkDeviceBufferMemoryRequirementsKHR32; - -typedef struct VkDeviceFaultCountsEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t addressInfoCount; - uint32_t vendorInfoCount; - VkDeviceSize DECLSPEC_ALIGN(8) vendorBinarySize; -} VkDeviceFaultCountsEXT32; - -typedef struct VkDeviceFaultAddressInfoEXT32 -{ - VkDeviceFaultAddressTypeEXT addressType; - VkDeviceAddress DECLSPEC_ALIGN(8) reportedAddress; - VkDeviceSize DECLSPEC_ALIGN(8) addressPrecision; -} VkDeviceFaultAddressInfoEXT32; - -typedef struct VkDeviceFaultVendorInfoEXT32 -{ - char description[VK_MAX_DESCRIPTION_SIZE]; - uint64_t DECLSPEC_ALIGN(8) vendorFaultCode; - uint64_t DECLSPEC_ALIGN(8) vendorFaultData; -} VkDeviceFaultVendorInfoEXT32; - -typedef struct VkDeviceFaultInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - char description[VK_MAX_DESCRIPTION_SIZE]; - PTR32 pAddressInfos; - PTR32 pVendorInfos; - PTR32 pVendorBinaryData; -} VkDeviceFaultInfoEXT32; - -typedef struct VkDeviceGroupPresentCapabilitiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE]; - VkDeviceGroupPresentModeFlagsKHR modes; -} VkDeviceGroupPresentCapabilitiesKHR32; - -typedef struct VkDeviceImageMemoryRequirements32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pCreateInfo; - VkImageAspectFlagBits planeAspect; -} VkDeviceImageMemoryRequirements32; -typedef VkDeviceImageMemoryRequirements32 VkDeviceImageMemoryRequirementsKHR32; - -typedef struct VkSparseImageMemoryRequirements32 -{ - VkSparseImageFormatProperties formatProperties; - uint32_t imageMipTailFirstLod; - VkDeviceSize DECLSPEC_ALIGN(8) imageMipTailSize; - VkDeviceSize DECLSPEC_ALIGN(8) imageMipTailOffset; - VkDeviceSize DECLSPEC_ALIGN(8) imageMipTailStride; -} VkSparseImageMemoryRequirements32; - -typedef struct VkSparseImageMemoryRequirements232 -{ - VkStructureType sType; - PTR32 pNext; - VkSparseImageMemoryRequirements32 DECLSPEC_ALIGN(8) memoryRequirements; -} VkSparseImageMemoryRequirements232; -typedef VkSparseImageMemoryRequirements232 VkSparseImageMemoryRequirements2KHR32; - -typedef struct VkImageSubresource232 -{ - VkStructureType sType; - PTR32 pNext; - VkImageSubresource imageSubresource; -} VkImageSubresource232; -typedef VkImageSubresource232 VkImageSubresource2KHR32; -typedef VkImageSubresource232 VkImageSubresource2EXT32; - -typedef struct VkDeviceImageSubresourceInfo32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pCreateInfo; - PTR32 pSubresource; -} VkDeviceImageSubresourceInfo32; -typedef VkDeviceImageSubresourceInfo32 VkDeviceImageSubresourceInfoKHR32; - -typedef struct VkSubresourceLayout32 -{ - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkDeviceSize DECLSPEC_ALIGN(8) rowPitch; - VkDeviceSize DECLSPEC_ALIGN(8) arrayPitch; - VkDeviceSize DECLSPEC_ALIGN(8) depthPitch; -} VkSubresourceLayout32; - -typedef struct VkSubresourceHostMemcpySize32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) size; -} VkSubresourceHostMemcpySize32; -typedef VkSubresourceHostMemcpySize32 VkSubresourceHostMemcpySizeEXT32; - -typedef struct VkImageCompressionPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageCompressionFlagsEXT imageCompressionFlags; - VkImageCompressionFixedRateFlagsEXT imageCompressionFixedRateFlags; -} VkImageCompressionPropertiesEXT32; - -typedef struct VkSubresourceLayout232 -{ - VkStructureType sType; - PTR32 pNext; - VkSubresourceLayout32 DECLSPEC_ALIGN(8) subresourceLayout; -} VkSubresourceLayout232; -typedef VkSubresourceLayout232 VkSubresourceLayout2KHR32; -typedef VkSubresourceLayout232 VkSubresourceLayout2EXT32; - -typedef struct VkDeviceMemoryOpaqueCaptureAddressInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; -} VkDeviceMemoryOpaqueCaptureAddressInfo32; -typedef VkDeviceMemoryOpaqueCaptureAddressInfo32 VkDeviceMemoryOpaqueCaptureAddressInfoKHR32; - -typedef struct VkMicromapVersionInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pVersionData; -} VkMicromapVersionInfoEXT32; - -typedef struct VkDeviceQueueInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceQueueCreateFlags flags; - uint32_t queueFamilyIndex; - uint32_t queueIndex; -} VkDeviceQueueInfo232; - -typedef struct VkTilePropertiesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent3D tileSize; - VkExtent2D apronSize; - VkOffset2D origin; -} VkTilePropertiesQCOM32; - -typedef struct VkVideoEncodeH264SessionParametersGetInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 writeStdSPS; - VkBool32 writeStdPPS; - uint32_t stdSPSId; - uint32_t stdPPSId; -} VkVideoEncodeH264SessionParametersGetInfoKHR32; - -typedef struct VkVideoEncodeH265SessionParametersGetInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 writeStdVPS; - VkBool32 writeStdSPS; - VkBool32 writeStdPPS; - uint32_t stdVPSId; - uint32_t stdSPSId; - uint32_t stdPPSId; -} VkVideoEncodeH265SessionParametersGetInfoKHR32; - -typedef struct VkVideoEncodeSessionParametersGetInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoSessionParametersKHR DECLSPEC_ALIGN(8) videoSessionParameters; -} VkVideoEncodeSessionParametersGetInfoKHR32; - -typedef struct VkVideoEncodeH264SessionParametersFeedbackInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 hasStdSPSOverrides; - VkBool32 hasStdPPSOverrides; -} VkVideoEncodeH264SessionParametersFeedbackInfoKHR32; - -typedef struct VkVideoEncodeH265SessionParametersFeedbackInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 hasStdVPSOverrides; - VkBool32 hasStdSPSOverrides; - VkBool32 hasStdPPSOverrides; -} VkVideoEncodeH265SessionParametersFeedbackInfoKHR32; - -typedef struct VkVideoEncodeSessionParametersFeedbackInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 hasOverrides; -} VkVideoEncodeSessionParametersFeedbackInfoKHR32; - -typedef struct VkGeneratedCommandsMemoryRequirementsInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkIndirectExecutionSetEXT DECLSPEC_ALIGN(8) indirectExecutionSet; - VkIndirectCommandsLayoutEXT DECLSPEC_ALIGN(8) indirectCommandsLayout; - uint32_t maxSequenceCount; - uint32_t maxDrawCount; -} VkGeneratedCommandsMemoryRequirementsInfoEXT32; - -typedef struct VkGeneratedCommandsMemoryRequirementsInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - VkIndirectCommandsLayoutNV DECLSPEC_ALIGN(8) indirectCommandsLayout; - uint32_t maxSequencesCount; -} VkGeneratedCommandsMemoryRequirementsInfoNV32; - -typedef struct VkImagePlaneMemoryRequirementsInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageAspectFlagBits planeAspect; -} VkImagePlaneMemoryRequirementsInfo32; -typedef VkImagePlaneMemoryRequirementsInfo32 VkImagePlaneMemoryRequirementsInfoKHR32; - -typedef struct VkImageMemoryRequirementsInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) image; -} VkImageMemoryRequirementsInfo232; -typedef VkImageMemoryRequirementsInfo232 VkImageMemoryRequirementsInfo2KHR32; - -typedef struct VkImageCaptureDescriptorDataInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) image; -} VkImageCaptureDescriptorDataInfoEXT32; - -typedef struct VkImageSparseMemoryRequirementsInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) image; -} VkImageSparseMemoryRequirementsInfo232; -typedef VkImageSparseMemoryRequirementsInfo232 VkImageSparseMemoryRequirementsInfo2KHR32; - -typedef struct VkImageViewAddressPropertiesNVX32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceAddress DECLSPEC_ALIGN(8) deviceAddress; - VkDeviceSize DECLSPEC_ALIGN(8) size; -} VkImageViewAddressPropertiesNVX32; - -typedef struct VkImageViewHandleInfoNVX32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkDescriptorType descriptorType; - VkSampler DECLSPEC_ALIGN(8) sampler; -} VkImageViewHandleInfoNVX32; - -typedef struct VkImageViewCaptureDescriptorDataInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageView DECLSPEC_ALIGN(8) imageView; -} VkImageViewCaptureDescriptorDataInfoEXT32; - -typedef struct VkLatencyTimingsFrameReportNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) presentID; - uint64_t DECLSPEC_ALIGN(8) inputSampleTimeUs; - uint64_t DECLSPEC_ALIGN(8) simStartTimeUs; - uint64_t DECLSPEC_ALIGN(8) simEndTimeUs; - uint64_t DECLSPEC_ALIGN(8) renderSubmitStartTimeUs; - uint64_t DECLSPEC_ALIGN(8) renderSubmitEndTimeUs; - uint64_t DECLSPEC_ALIGN(8) presentStartTimeUs; - uint64_t DECLSPEC_ALIGN(8) presentEndTimeUs; - uint64_t DECLSPEC_ALIGN(8) driverStartTimeUs; - uint64_t DECLSPEC_ALIGN(8) driverEndTimeUs; - uint64_t DECLSPEC_ALIGN(8) osRenderQueueStartTimeUs; - uint64_t DECLSPEC_ALIGN(8) osRenderQueueEndTimeUs; - uint64_t DECLSPEC_ALIGN(8) gpuRenderStartTimeUs; - uint64_t DECLSPEC_ALIGN(8) gpuRenderEndTimeUs; -} VkLatencyTimingsFrameReportNV32; - -typedef struct VkGetLatencyMarkerInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t timingCount; - PTR32 pTimings; -} VkGetLatencyMarkerInfoNV32; - -typedef struct VkMemoryHostPointerPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t memoryTypeBits; -} VkMemoryHostPointerPropertiesEXT32; - -typedef struct VkMicromapBuildSizesInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) micromapSize; - VkDeviceSize DECLSPEC_ALIGN(8) buildScratchSize; - VkBool32 discardable; -} VkMicromapBuildSizesInfoEXT32; - -typedef union VkPerformanceValueDataINTEL32 -{ - uint32_t value32; - uint64_t DECLSPEC_ALIGN(8) value64; - float valueFloat; - VkBool32 valueBool; - PTR32 valueString; -} VkPerformanceValueDataINTEL32; - -typedef struct VkPerformanceValueINTEL32 -{ - VkPerformanceValueTypeINTEL type; - VkPerformanceValueDataINTEL32 DECLSPEC_ALIGN(8) data; -} VkPerformanceValueINTEL32; - -typedef struct VkCooperativeMatrixFlexibleDimensionsPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t MGranularity; - uint32_t NGranularity; - uint32_t KGranularity; - VkComponentTypeKHR AType; - VkComponentTypeKHR BType; - VkComponentTypeKHR CType; - VkComponentTypeKHR ResultType; - VkBool32 saturatingAccumulation; - VkScopeKHR scope; - uint32_t workgroupInvocations; -} VkCooperativeMatrixFlexibleDimensionsPropertiesNV32; - -typedef struct VkCooperativeMatrixPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t MSize; - uint32_t NSize; - uint32_t KSize; - VkComponentTypeKHR AType; - VkComponentTypeKHR BType; - VkComponentTypeKHR CType; - VkComponentTypeKHR ResultType; - VkBool32 saturatingAccumulation; - VkScopeKHR scope; -} VkCooperativeMatrixPropertiesKHR32; - -typedef struct VkCooperativeMatrixPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t MSize; - uint32_t NSize; - uint32_t KSize; - VkComponentTypeNV AType; - VkComponentTypeNV BType; - VkComponentTypeNV CType; - VkComponentTypeNV DType; - VkScopeNV scope; -} VkCooperativeMatrixPropertiesNV32; - -typedef struct VkPhysicalDeviceExternalBufferInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkBufferCreateFlags flags; - VkBufferUsageFlags usage; - VkExternalMemoryHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalBufferInfo32; -typedef VkPhysicalDeviceExternalBufferInfo32 VkPhysicalDeviceExternalBufferInfoKHR32; - -typedef struct VkExternalBufferProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalMemoryProperties externalMemoryProperties; -} VkExternalBufferProperties32; -typedef VkExternalBufferProperties32 VkExternalBufferPropertiesKHR32; - -typedef struct VkPhysicalDeviceExternalFenceInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalFenceHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalFenceInfo32; -typedef VkPhysicalDeviceExternalFenceInfo32 VkPhysicalDeviceExternalFenceInfoKHR32; - -typedef struct VkExternalFenceProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalFenceHandleTypeFlags exportFromImportedHandleTypes; - VkExternalFenceHandleTypeFlags compatibleHandleTypes; - VkExternalFenceFeatureFlags externalFenceFeatures; -} VkExternalFenceProperties32; -typedef VkExternalFenceProperties32 VkExternalFencePropertiesKHR32; - -typedef struct VkPhysicalDeviceExternalSemaphoreInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalSemaphoreHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalSemaphoreInfo32; -typedef VkPhysicalDeviceExternalSemaphoreInfo32 VkPhysicalDeviceExternalSemaphoreInfoKHR32; - -typedef struct VkExternalSemaphoreProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalSemaphoreHandleTypeFlags exportFromImportedHandleTypes; - VkExternalSemaphoreHandleTypeFlags compatibleHandleTypes; - VkExternalSemaphoreFeatureFlags externalSemaphoreFeatures; -} VkExternalSemaphoreProperties32; -typedef VkExternalSemaphoreProperties32 VkExternalSemaphorePropertiesKHR32; - -typedef struct VkSubpassResolvePerformanceQueryEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 optimal; -} VkSubpassResolvePerformanceQueryEXT32; - -typedef struct VkFormatProperties332 -{ - VkStructureType sType; - PTR32 pNext; - VkFormatFeatureFlags2 DECLSPEC_ALIGN(8) linearTilingFeatures; - VkFormatFeatureFlags2 DECLSPEC_ALIGN(8) optimalTilingFeatures; - VkFormatFeatureFlags2 DECLSPEC_ALIGN(8) bufferFeatures; -} VkFormatProperties332; -typedef VkFormatProperties332 VkFormatProperties3KHR32; - -typedef struct VkFormatProperties232 -{ - VkStructureType sType; - PTR32 pNext; - VkFormatProperties formatProperties; -} VkFormatProperties232; -typedef VkFormatProperties232 VkFormatProperties2KHR32; - -typedef struct VkPhysicalDeviceFragmentShadingRateKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkSampleCountFlags sampleCounts; - VkExtent2D fragmentSize; -} VkPhysicalDeviceFragmentShadingRateKHR32; - -typedef struct VkImageFormatProperties32 -{ - VkExtent3D maxExtent; - uint32_t maxMipLevels; - uint32_t maxArrayLayers; - VkSampleCountFlags sampleCounts; - VkDeviceSize DECLSPEC_ALIGN(8) maxResourceSize; -} VkImageFormatProperties32; - -typedef struct VkPhysicalDeviceExternalImageFormatInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalMemoryHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalImageFormatInfo32; -typedef VkPhysicalDeviceExternalImageFormatInfo32 VkPhysicalDeviceExternalImageFormatInfoKHR32; - -typedef struct VkPhysicalDeviceImageViewImageFormatInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageViewType imageViewType; -} VkPhysicalDeviceImageViewImageFormatInfoEXT32; - -typedef struct VkPhysicalDeviceImageFormatInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkFormat format; - VkImageType type; - VkImageTiling tiling; - VkImageUsageFlags usage; - VkImageCreateFlags flags; -} VkPhysicalDeviceImageFormatInfo232; -typedef VkPhysicalDeviceImageFormatInfo232 VkPhysicalDeviceImageFormatInfo2KHR32; - -typedef struct VkExternalImageFormatProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkExternalMemoryProperties externalMemoryProperties; -} VkExternalImageFormatProperties32; -typedef VkExternalImageFormatProperties32 VkExternalImageFormatPropertiesKHR32; - -typedef struct VkSamplerYcbcrConversionImageFormatProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t combinedImageSamplerDescriptorCount; -} VkSamplerYcbcrConversionImageFormatProperties32; -typedef VkSamplerYcbcrConversionImageFormatProperties32 VkSamplerYcbcrConversionImageFormatPropertiesKHR32; - -typedef struct VkTextureLODGatherFormatPropertiesAMD32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 supportsTextureGatherLODBiasAMD; -} VkTextureLODGatherFormatPropertiesAMD32; - -typedef struct VkFilterCubicImageViewImageFormatPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 filterCubic; - VkBool32 filterCubicMinmax; -} VkFilterCubicImageViewImageFormatPropertiesEXT32; - -typedef struct VkHostImageCopyDevicePerformanceQuery32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 optimalDeviceAccess; - VkBool32 identicalMemoryLayout; -} VkHostImageCopyDevicePerformanceQuery32; -typedef VkHostImageCopyDevicePerformanceQuery32 VkHostImageCopyDevicePerformanceQueryEXT32; - -typedef struct VkImageFormatProperties232 -{ - VkStructureType sType; - PTR32 pNext; - VkImageFormatProperties32 DECLSPEC_ALIGN(8) imageFormatProperties; -} VkImageFormatProperties232; -typedef VkImageFormatProperties232 VkImageFormatProperties2KHR32; - -typedef struct VkMemoryHeap32 -{ - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkMemoryHeapFlags flags; -} VkMemoryHeap32; - -typedef struct VkPhysicalDeviceMemoryProperties32 -{ - uint32_t memoryTypeCount; - VkMemoryType memoryTypes[VK_MAX_MEMORY_TYPES]; - uint32_t memoryHeapCount; - VkMemoryHeap32 DECLSPEC_ALIGN(8) memoryHeaps[VK_MAX_MEMORY_HEAPS]; -} VkPhysicalDeviceMemoryProperties32; - -typedef struct VkPhysicalDeviceMemoryBudgetPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) heapBudget[VK_MAX_MEMORY_HEAPS]; - VkDeviceSize DECLSPEC_ALIGN(8) heapUsage[VK_MAX_MEMORY_HEAPS]; -} VkPhysicalDeviceMemoryBudgetPropertiesEXT32; - -typedef struct VkPhysicalDeviceMemoryProperties232 -{ - VkStructureType sType; - PTR32 pNext; - VkPhysicalDeviceMemoryProperties32 DECLSPEC_ALIGN(8) memoryProperties; -} VkPhysicalDeviceMemoryProperties232; -typedef VkPhysicalDeviceMemoryProperties232 VkPhysicalDeviceMemoryProperties2KHR32; - -typedef struct VkMultisamplePropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D maxSampleLocationGridSize; -} VkMultisamplePropertiesEXT32; - -typedef struct VkOpticalFlowImageFormatPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkFormat format; -} VkOpticalFlowImageFormatPropertiesNV32; - -typedef struct VkPhysicalDeviceLimits32 -{ - uint32_t maxImageDimension1D; - uint32_t maxImageDimension2D; - uint32_t maxImageDimension3D; - uint32_t maxImageDimensionCube; - uint32_t maxImageArrayLayers; - uint32_t maxTexelBufferElements; - uint32_t maxUniformBufferRange; - uint32_t maxStorageBufferRange; - uint32_t maxPushConstantsSize; - uint32_t maxMemoryAllocationCount; - uint32_t maxSamplerAllocationCount; - VkDeviceSize DECLSPEC_ALIGN(8) bufferImageGranularity; - VkDeviceSize DECLSPEC_ALIGN(8) sparseAddressSpaceSize; - uint32_t maxBoundDescriptorSets; - uint32_t maxPerStageDescriptorSamplers; - uint32_t maxPerStageDescriptorUniformBuffers; - uint32_t maxPerStageDescriptorStorageBuffers; - uint32_t maxPerStageDescriptorSampledImages; - uint32_t maxPerStageDescriptorStorageImages; - uint32_t maxPerStageDescriptorInputAttachments; - uint32_t maxPerStageResources; - uint32_t maxDescriptorSetSamplers; - uint32_t maxDescriptorSetUniformBuffers; - uint32_t maxDescriptorSetUniformBuffersDynamic; - uint32_t maxDescriptorSetStorageBuffers; - uint32_t maxDescriptorSetStorageBuffersDynamic; - uint32_t maxDescriptorSetSampledImages; - uint32_t maxDescriptorSetStorageImages; - uint32_t maxDescriptorSetInputAttachments; - uint32_t maxVertexInputAttributes; - uint32_t maxVertexInputBindings; - uint32_t maxVertexInputAttributeOffset; - uint32_t maxVertexInputBindingStride; - uint32_t maxVertexOutputComponents; - uint32_t maxTessellationGenerationLevel; - uint32_t maxTessellationPatchSize; - uint32_t maxTessellationControlPerVertexInputComponents; - uint32_t maxTessellationControlPerVertexOutputComponents; - uint32_t maxTessellationControlPerPatchOutputComponents; - uint32_t maxTessellationControlTotalOutputComponents; - uint32_t maxTessellationEvaluationInputComponents; - uint32_t maxTessellationEvaluationOutputComponents; - uint32_t maxGeometryShaderInvocations; - uint32_t maxGeometryInputComponents; - uint32_t maxGeometryOutputComponents; - uint32_t maxGeometryOutputVertices; - uint32_t maxGeometryTotalOutputComponents; - uint32_t maxFragmentInputComponents; - uint32_t maxFragmentOutputAttachments; - uint32_t maxFragmentDualSrcAttachments; - uint32_t maxFragmentCombinedOutputResources; - uint32_t maxComputeSharedMemorySize; - uint32_t maxComputeWorkGroupCount[3]; - uint32_t maxComputeWorkGroupInvocations; - uint32_t maxComputeWorkGroupSize[3]; - uint32_t subPixelPrecisionBits; - uint32_t subTexelPrecisionBits; - uint32_t mipmapPrecisionBits; - uint32_t maxDrawIndexedIndexValue; - uint32_t maxDrawIndirectCount; - float maxSamplerLodBias; - float maxSamplerAnisotropy; - uint32_t maxViewports; - uint32_t maxViewportDimensions[2]; - float viewportBoundsRange[2]; - uint32_t viewportSubPixelBits; - PTR32 minMemoryMapAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) minTexelBufferOffsetAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) minUniformBufferOffsetAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) minStorageBufferOffsetAlignment; - int32_t minTexelOffset; - uint32_t maxTexelOffset; - int32_t minTexelGatherOffset; - uint32_t maxTexelGatherOffset; - float minInterpolationOffset; - float maxInterpolationOffset; - uint32_t subPixelInterpolationOffsetBits; - uint32_t maxFramebufferWidth; - uint32_t maxFramebufferHeight; - uint32_t maxFramebufferLayers; - VkSampleCountFlags framebufferColorSampleCounts; - VkSampleCountFlags framebufferDepthSampleCounts; - VkSampleCountFlags framebufferStencilSampleCounts; - VkSampleCountFlags framebufferNoAttachmentsSampleCounts; - uint32_t maxColorAttachments; - VkSampleCountFlags sampledImageColorSampleCounts; - VkSampleCountFlags sampledImageIntegerSampleCounts; - VkSampleCountFlags sampledImageDepthSampleCounts; - VkSampleCountFlags sampledImageStencilSampleCounts; - VkSampleCountFlags storageImageSampleCounts; - uint32_t maxSampleMaskWords; - VkBool32 timestampComputeAndGraphics; - float timestampPeriod; - uint32_t maxClipDistances; - uint32_t maxCullDistances; - uint32_t maxCombinedClipAndCullDistances; - uint32_t discreteQueuePriorities; - float pointSizeRange[2]; - float lineWidthRange[2]; - float pointSizeGranularity; - float lineWidthGranularity; - VkBool32 strictLines; - VkBool32 standardSampleLocations; - VkDeviceSize DECLSPEC_ALIGN(8) optimalBufferCopyOffsetAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) optimalBufferCopyRowPitchAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) nonCoherentAtomSize; -} VkPhysicalDeviceLimits32; - -typedef struct VkPhysicalDeviceProperties32 -{ - uint32_t apiVersion; - uint32_t driverVersion; - uint32_t vendorID; - uint32_t deviceID; - VkPhysicalDeviceType deviceType; - char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; - uint8_t pipelineCacheUUID[VK_UUID_SIZE]; - VkPhysicalDeviceLimits32 DECLSPEC_ALIGN(8) limits; - VkPhysicalDeviceSparseProperties sparseProperties; -} VkPhysicalDeviceProperties32; - -typedef struct VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxGraphicsShaderGroupCount; - uint32_t maxIndirectSequenceCount; - uint32_t maxIndirectCommandsTokenCount; - uint32_t maxIndirectCommandsStreamCount; - uint32_t maxIndirectCommandsTokenOffset; - uint32_t maxIndirectCommandsStreamStride; - uint32_t minSequencesCountBufferOffsetAlignment; - uint32_t minSequencesIndexBufferOffsetAlignment; - uint32_t minIndirectCommandsBufferOffsetAlignment; -} VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV32; - -typedef struct VkPhysicalDeviceMultiDrawPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxMultiDrawCount; -} VkPhysicalDeviceMultiDrawPropertiesEXT32; - -typedef struct VkPhysicalDevicePushDescriptorProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxPushDescriptors; -} VkPhysicalDevicePushDescriptorProperties32; -typedef VkPhysicalDevicePushDescriptorProperties32 VkPhysicalDevicePushDescriptorPropertiesKHR32; - -typedef struct VkPhysicalDeviceDriverProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkDriverId driverID; - char driverName[VK_MAX_DRIVER_NAME_SIZE]; - char driverInfo[VK_MAX_DRIVER_INFO_SIZE]; - VkConformanceVersion conformanceVersion; -} VkPhysicalDeviceDriverProperties32; -typedef VkPhysicalDeviceDriverProperties32 VkPhysicalDeviceDriverPropertiesKHR32; - -typedef struct VkPhysicalDeviceIDProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint8_t deviceUUID[VK_UUID_SIZE]; - uint8_t driverUUID[VK_UUID_SIZE]; - uint8_t deviceLUID[VK_LUID_SIZE]; - uint32_t deviceNodeMask; - VkBool32 deviceLUIDValid; -} VkPhysicalDeviceIDProperties32; -typedef VkPhysicalDeviceIDProperties32 VkPhysicalDeviceIDPropertiesKHR32; - -typedef struct VkPhysicalDeviceMultiviewProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxMultiviewViewCount; - uint32_t maxMultiviewInstanceIndex; -} VkPhysicalDeviceMultiviewProperties32; -typedef VkPhysicalDeviceMultiviewProperties32 VkPhysicalDeviceMultiviewPropertiesKHR32; - -typedef struct VkPhysicalDeviceDiscardRectanglePropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxDiscardRectangles; -} VkPhysicalDeviceDiscardRectanglePropertiesEXT32; - -typedef struct VkPhysicalDeviceSubgroupProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t subgroupSize; - VkShaderStageFlags supportedStages; - VkSubgroupFeatureFlags supportedOperations; - VkBool32 quadOperationsInAllStages; -} VkPhysicalDeviceSubgroupProperties32; - -typedef struct VkPhysicalDevicePointClippingProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkPointClippingBehavior pointClippingBehavior; -} VkPhysicalDevicePointClippingProperties32; -typedef VkPhysicalDevicePointClippingProperties32 VkPhysicalDevicePointClippingPropertiesKHR32; - -typedef struct VkPhysicalDeviceProtectedMemoryProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 protectedNoFault; -} VkPhysicalDeviceProtectedMemoryProperties32; - -typedef struct VkPhysicalDeviceSamplerFilterMinmaxProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 filterMinmaxSingleComponentFormats; - VkBool32 filterMinmaxImageComponentMapping; -} VkPhysicalDeviceSamplerFilterMinmaxProperties32; -typedef VkPhysicalDeviceSamplerFilterMinmaxProperties32 VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT32; - -typedef struct VkPhysicalDeviceSampleLocationsPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkSampleCountFlags sampleLocationSampleCounts; - VkExtent2D maxSampleLocationGridSize; - float sampleLocationCoordinateRange[2]; - uint32_t sampleLocationSubPixelBits; - VkBool32 variableSampleLocations; -} VkPhysicalDeviceSampleLocationsPropertiesEXT32; - -typedef struct VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t advancedBlendMaxColorAttachments; - VkBool32 advancedBlendIndependentBlend; - VkBool32 advancedBlendNonPremultipliedSrcColor; - VkBool32 advancedBlendNonPremultipliedDstColor; - VkBool32 advancedBlendCorrelatedOverlap; - VkBool32 advancedBlendAllOperations; -} VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT32; - -typedef struct VkPhysicalDeviceInlineUniformBlockProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxInlineUniformBlockSize; - uint32_t maxPerStageDescriptorInlineUniformBlocks; - uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks; - uint32_t maxDescriptorSetInlineUniformBlocks; - uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks; -} VkPhysicalDeviceInlineUniformBlockProperties32; -typedef VkPhysicalDeviceInlineUniformBlockProperties32 VkPhysicalDeviceInlineUniformBlockPropertiesEXT32; - -typedef struct VkPhysicalDeviceMaintenance3Properties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxPerSetDescriptors; - VkDeviceSize DECLSPEC_ALIGN(8) maxMemoryAllocationSize; -} VkPhysicalDeviceMaintenance3Properties32; -typedef VkPhysicalDeviceMaintenance3Properties32 VkPhysicalDeviceMaintenance3PropertiesKHR32; - -typedef struct VkPhysicalDeviceMaintenance4Properties32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) maxBufferSize; -} VkPhysicalDeviceMaintenance4Properties32; -typedef VkPhysicalDeviceMaintenance4Properties32 VkPhysicalDeviceMaintenance4PropertiesKHR32; - -typedef struct VkPhysicalDeviceMaintenance5Properties32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 earlyFragmentMultisampleCoverageAfterSampleCounting; - VkBool32 earlyFragmentSampleMaskTestBeforeSampleCounting; - VkBool32 depthStencilSwizzleOneSupport; - VkBool32 polygonModePointSize; - VkBool32 nonStrictSinglePixelWideLinesUseParallelogram; - VkBool32 nonStrictWideLinesUseParallelogram; -} VkPhysicalDeviceMaintenance5Properties32; -typedef VkPhysicalDeviceMaintenance5Properties32 VkPhysicalDeviceMaintenance5PropertiesKHR32; - -typedef struct VkPhysicalDeviceMaintenance6Properties32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 blockTexelViewCompatibleMultipleLayers; - uint32_t maxCombinedImageSamplerDescriptorCount; - VkBool32 fragmentShadingRateClampCombinerInputs; -} VkPhysicalDeviceMaintenance6Properties32; -typedef VkPhysicalDeviceMaintenance6Properties32 VkPhysicalDeviceMaintenance6PropertiesKHR32; - -typedef struct VkPhysicalDeviceFloatControlsProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderFloatControlsIndependence denormBehaviorIndependence; - VkShaderFloatControlsIndependence roundingModeIndependence; - VkBool32 shaderSignedZeroInfNanPreserveFloat16; - VkBool32 shaderSignedZeroInfNanPreserveFloat32; - VkBool32 shaderSignedZeroInfNanPreserveFloat64; - VkBool32 shaderDenormPreserveFloat16; - VkBool32 shaderDenormPreserveFloat32; - VkBool32 shaderDenormPreserveFloat64; - VkBool32 shaderDenormFlushToZeroFloat16; - VkBool32 shaderDenormFlushToZeroFloat32; - VkBool32 shaderDenormFlushToZeroFloat64; - VkBool32 shaderRoundingModeRTEFloat16; - VkBool32 shaderRoundingModeRTEFloat32; - VkBool32 shaderRoundingModeRTEFloat64; - VkBool32 shaderRoundingModeRTZFloat16; - VkBool32 shaderRoundingModeRTZFloat32; - VkBool32 shaderRoundingModeRTZFloat64; -} VkPhysicalDeviceFloatControlsProperties32; -typedef VkPhysicalDeviceFloatControlsProperties32 VkPhysicalDeviceFloatControlsPropertiesKHR32; - -typedef struct VkPhysicalDeviceExternalMemoryHostPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) minImportedHostPointerAlignment; -} VkPhysicalDeviceExternalMemoryHostPropertiesEXT32; - -typedef struct VkPhysicalDeviceConservativeRasterizationPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - float primitiveOverestimationSize; - float maxExtraPrimitiveOverestimationSize; - float extraPrimitiveOverestimationSizeGranularity; - VkBool32 primitiveUnderestimation; - VkBool32 conservativePointAndLineRasterization; - VkBool32 degenerateTrianglesRasterized; - VkBool32 degenerateLinesRasterized; - VkBool32 fullyCoveredFragmentShaderInputVariable; - VkBool32 conservativeRasterizationPostDepthCoverage; -} VkPhysicalDeviceConservativeRasterizationPropertiesEXT32; - -typedef struct VkPhysicalDeviceShaderCorePropertiesAMD32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t shaderEngineCount; - uint32_t shaderArraysPerEngineCount; - uint32_t computeUnitsPerShaderArray; - uint32_t simdPerComputeUnit; - uint32_t wavefrontsPerSimd; - uint32_t wavefrontSize; - uint32_t sgprsPerSimd; - uint32_t minSgprAllocation; - uint32_t maxSgprAllocation; - uint32_t sgprAllocationGranularity; - uint32_t vgprsPerSimd; - uint32_t minVgprAllocation; - uint32_t maxVgprAllocation; - uint32_t vgprAllocationGranularity; -} VkPhysicalDeviceShaderCorePropertiesAMD32; - -typedef struct VkPhysicalDeviceShaderCoreProperties2AMD32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderCorePropertiesFlagsAMD shaderCoreFeatures; - uint32_t activeComputeUnitCount; -} VkPhysicalDeviceShaderCoreProperties2AMD32; - -typedef struct VkPhysicalDeviceDescriptorIndexingProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxUpdateAfterBindDescriptorsInAllPools; - VkBool32 shaderUniformBufferArrayNonUniformIndexingNative; - VkBool32 shaderSampledImageArrayNonUniformIndexingNative; - VkBool32 shaderStorageBufferArrayNonUniformIndexingNative; - VkBool32 shaderStorageImageArrayNonUniformIndexingNative; - VkBool32 shaderInputAttachmentArrayNonUniformIndexingNative; - VkBool32 robustBufferAccessUpdateAfterBind; - VkBool32 quadDivergentImplicitLod; - uint32_t maxPerStageDescriptorUpdateAfterBindSamplers; - uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers; - uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages; - uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments; - uint32_t maxPerStageUpdateAfterBindResources; - uint32_t maxDescriptorSetUpdateAfterBindSamplers; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic; - uint32_t maxDescriptorSetUpdateAfterBindSampledImages; - uint32_t maxDescriptorSetUpdateAfterBindStorageImages; - uint32_t maxDescriptorSetUpdateAfterBindInputAttachments; -} VkPhysicalDeviceDescriptorIndexingProperties32; -typedef VkPhysicalDeviceDescriptorIndexingProperties32 VkPhysicalDeviceDescriptorIndexingPropertiesEXT32; - -typedef struct VkPhysicalDeviceTimelineSemaphoreProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) maxTimelineSemaphoreValueDifference; -} VkPhysicalDeviceTimelineSemaphoreProperties32; -typedef VkPhysicalDeviceTimelineSemaphoreProperties32 VkPhysicalDeviceTimelineSemaphorePropertiesKHR32; - -typedef struct VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxVertexAttribDivisor; -} VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT32; - -typedef struct VkPhysicalDeviceVertexAttributeDivisorProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxVertexAttribDivisor; - VkBool32 supportsNonZeroFirstInstance; -} VkPhysicalDeviceVertexAttributeDivisorProperties32; -typedef VkPhysicalDeviceVertexAttributeDivisorProperties32 VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR32; - -typedef struct VkPhysicalDevicePCIBusInfoPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t pciDomain; - uint32_t pciBus; - uint32_t pciDevice; - uint32_t pciFunction; -} VkPhysicalDevicePCIBusInfoPropertiesEXT32; - -typedef struct VkPhysicalDeviceDepthStencilResolveProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkResolveModeFlags supportedDepthResolveModes; - VkResolveModeFlags supportedStencilResolveModes; - VkBool32 independentResolveNone; - VkBool32 independentResolve; -} VkPhysicalDeviceDepthStencilResolveProperties32; -typedef VkPhysicalDeviceDepthStencilResolveProperties32 VkPhysicalDeviceDepthStencilResolvePropertiesKHR32; - -typedef struct VkPhysicalDeviceTransformFeedbackPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxTransformFeedbackStreams; - uint32_t maxTransformFeedbackBuffers; - VkDeviceSize DECLSPEC_ALIGN(8) maxTransformFeedbackBufferSize; - uint32_t maxTransformFeedbackStreamDataSize; - uint32_t maxTransformFeedbackBufferDataSize; - uint32_t maxTransformFeedbackBufferDataStride; - VkBool32 transformFeedbackQueries; - VkBool32 transformFeedbackStreamsLinesTriangles; - VkBool32 transformFeedbackRasterizationStreamSelect; - VkBool32 transformFeedbackDraw; -} VkPhysicalDeviceTransformFeedbackPropertiesEXT32; - -typedef struct VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 meshAndTaskShaderDerivatives; -} VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR32; - -typedef struct VkPhysicalDeviceCopyMemoryIndirectPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkQueueFlags supportedQueues; -} VkPhysicalDeviceCopyMemoryIndirectPropertiesNV32; - -typedef struct VkPhysicalDeviceMemoryDecompressionPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkMemoryDecompressionMethodFlagsNV DECLSPEC_ALIGN(8) decompressionMethods; - uint64_t DECLSPEC_ALIGN(8) maxDecompressionIndirectCount; -} VkPhysicalDeviceMemoryDecompressionPropertiesNV32; - -typedef struct VkPhysicalDeviceShadingRateImagePropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D shadingRateTexelSize; - uint32_t shadingRatePaletteSize; - uint32_t shadingRateMaxCoarseSamples; -} VkPhysicalDeviceShadingRateImagePropertiesNV32; - -typedef struct VkPhysicalDeviceMeshShaderPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxDrawMeshTasksCount; - uint32_t maxTaskWorkGroupInvocations; - uint32_t maxTaskWorkGroupSize[3]; - uint32_t maxTaskTotalMemorySize; - uint32_t maxTaskOutputCount; - uint32_t maxMeshWorkGroupInvocations; - uint32_t maxMeshWorkGroupSize[3]; - uint32_t maxMeshTotalMemorySize; - uint32_t maxMeshOutputVertices; - uint32_t maxMeshOutputPrimitives; - uint32_t maxMeshMultiviewViewCount; - uint32_t meshOutputPerVertexGranularity; - uint32_t meshOutputPerPrimitiveGranularity; -} VkPhysicalDeviceMeshShaderPropertiesNV32; - -typedef struct VkPhysicalDeviceMeshShaderPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxTaskWorkGroupTotalCount; - uint32_t maxTaskWorkGroupCount[3]; - uint32_t maxTaskWorkGroupInvocations; - uint32_t maxTaskWorkGroupSize[3]; - uint32_t maxTaskPayloadSize; - uint32_t maxTaskSharedMemorySize; - uint32_t maxTaskPayloadAndSharedMemorySize; - uint32_t maxMeshWorkGroupTotalCount; - uint32_t maxMeshWorkGroupCount[3]; - uint32_t maxMeshWorkGroupInvocations; - uint32_t maxMeshWorkGroupSize[3]; - uint32_t maxMeshSharedMemorySize; - uint32_t maxMeshPayloadAndSharedMemorySize; - uint32_t maxMeshOutputMemorySize; - uint32_t maxMeshPayloadAndOutputMemorySize; - uint32_t maxMeshOutputComponents; - uint32_t maxMeshOutputVertices; - uint32_t maxMeshOutputPrimitives; - uint32_t maxMeshOutputLayers; - uint32_t maxMeshMultiviewViewCount; - uint32_t meshOutputPerVertexGranularity; - uint32_t meshOutputPerPrimitiveGranularity; - uint32_t maxPreferredTaskWorkGroupInvocations; - uint32_t maxPreferredMeshWorkGroupInvocations; - VkBool32 prefersLocalInvocationVertexOutput; - VkBool32 prefersLocalInvocationPrimitiveOutput; - VkBool32 prefersCompactVertexOutput; - VkBool32 prefersCompactPrimitiveOutput; -} VkPhysicalDeviceMeshShaderPropertiesEXT32; - -typedef struct VkPhysicalDeviceAccelerationStructurePropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) maxGeometryCount; - uint64_t DECLSPEC_ALIGN(8) maxInstanceCount; - uint64_t DECLSPEC_ALIGN(8) maxPrimitiveCount; - uint32_t maxPerStageDescriptorAccelerationStructures; - uint32_t maxPerStageDescriptorUpdateAfterBindAccelerationStructures; - uint32_t maxDescriptorSetAccelerationStructures; - uint32_t maxDescriptorSetUpdateAfterBindAccelerationStructures; - uint32_t minAccelerationStructureScratchOffsetAlignment; -} VkPhysicalDeviceAccelerationStructurePropertiesKHR32; - -typedef struct VkPhysicalDeviceRayTracingPipelinePropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t shaderGroupHandleSize; - uint32_t maxRayRecursionDepth; - uint32_t maxShaderGroupStride; - uint32_t shaderGroupBaseAlignment; - uint32_t shaderGroupHandleCaptureReplaySize; - uint32_t maxRayDispatchInvocationCount; - uint32_t shaderGroupHandleAlignment; - uint32_t maxRayHitAttributeSize; -} VkPhysicalDeviceRayTracingPipelinePropertiesKHR32; - -typedef struct VkPhysicalDeviceRayTracingPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t shaderGroupHandleSize; - uint32_t maxRecursionDepth; - uint32_t maxShaderGroupStride; - uint32_t shaderGroupBaseAlignment; - uint64_t DECLSPEC_ALIGN(8) maxGeometryCount; - uint64_t DECLSPEC_ALIGN(8) maxInstanceCount; - uint64_t DECLSPEC_ALIGN(8) maxTriangleCount; - uint32_t maxDescriptorSetAccelerationStructures; -} VkPhysicalDeviceRayTracingPropertiesNV32; - -typedef struct VkPhysicalDeviceFragmentDensityMapPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D minFragmentDensityTexelSize; - VkExtent2D maxFragmentDensityTexelSize; - VkBool32 fragmentDensityInvocations; -} VkPhysicalDeviceFragmentDensityMapPropertiesEXT32; - -typedef struct VkPhysicalDeviceFragmentDensityMap2PropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 subsampledLoads; - VkBool32 subsampledCoarseReconstructionEarlyAccess; - uint32_t maxSubsampledArrayLayers; - uint32_t maxDescriptorSetSubsampledSamplers; -} VkPhysicalDeviceFragmentDensityMap2PropertiesEXT32; - -typedef struct VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D fragmentDensityOffsetGranularity; -} VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM32; - -typedef struct VkPhysicalDeviceCooperativeMatrixPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderStageFlags cooperativeMatrixSupportedStages; -} VkPhysicalDeviceCooperativeMatrixPropertiesNV32; - -typedef struct VkPhysicalDevicePerformanceQueryPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 allowCommandBufferQueryCopies; -} VkPhysicalDevicePerformanceQueryPropertiesKHR32; - -typedef struct VkPhysicalDeviceShaderSMBuiltinsPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t shaderSMCount; - uint32_t shaderWarpsPerSM; -} VkPhysicalDeviceShaderSMBuiltinsPropertiesNV32; - -typedef struct VkPhysicalDeviceTexelBufferAlignmentProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) storageTexelBufferOffsetAlignmentBytes; - VkBool32 storageTexelBufferOffsetSingleTexelAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) uniformTexelBufferOffsetAlignmentBytes; - VkBool32 uniformTexelBufferOffsetSingleTexelAlignment; -} VkPhysicalDeviceTexelBufferAlignmentProperties32; -typedef VkPhysicalDeviceTexelBufferAlignmentProperties32 VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT32; - -typedef struct VkPhysicalDeviceSubgroupSizeControlProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t minSubgroupSize; - uint32_t maxSubgroupSize; - uint32_t maxComputeWorkgroupSubgroups; - VkShaderStageFlags requiredSubgroupSizeStages; -} VkPhysicalDeviceSubgroupSizeControlProperties32; -typedef VkPhysicalDeviceSubgroupSizeControlProperties32 VkPhysicalDeviceSubgroupSizeControlPropertiesEXT32; - -typedef struct VkPhysicalDeviceSubpassShadingPropertiesHUAWEI32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxSubpassShadingWorkgroupSizeAspectRatio; -} VkPhysicalDeviceSubpassShadingPropertiesHUAWEI32; - -typedef struct VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxWorkGroupCount[3]; - uint32_t maxWorkGroupSize[3]; - uint32_t maxOutputClusterCount; - VkDeviceSize DECLSPEC_ALIGN(8) indirectBufferOffsetAlignment; -} VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI32; - -typedef struct VkPhysicalDeviceLineRasterizationProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t lineSubPixelPrecisionBits; -} VkPhysicalDeviceLineRasterizationProperties32; -typedef VkPhysicalDeviceLineRasterizationProperties32 VkPhysicalDeviceLineRasterizationPropertiesKHR32; -typedef VkPhysicalDeviceLineRasterizationProperties32 VkPhysicalDeviceLineRasterizationPropertiesEXT32; - -typedef struct VkPhysicalDeviceVulkan11Properties32 -{ - VkStructureType sType; - PTR32 pNext; - uint8_t deviceUUID[VK_UUID_SIZE]; - uint8_t driverUUID[VK_UUID_SIZE]; - uint8_t deviceLUID[VK_LUID_SIZE]; - uint32_t deviceNodeMask; - VkBool32 deviceLUIDValid; - uint32_t subgroupSize; - VkShaderStageFlags subgroupSupportedStages; - VkSubgroupFeatureFlags subgroupSupportedOperations; - VkBool32 subgroupQuadOperationsInAllStages; - VkPointClippingBehavior pointClippingBehavior; - uint32_t maxMultiviewViewCount; - uint32_t maxMultiviewInstanceIndex; - VkBool32 protectedNoFault; - uint32_t maxPerSetDescriptors; - VkDeviceSize DECLSPEC_ALIGN(8) maxMemoryAllocationSize; -} VkPhysicalDeviceVulkan11Properties32; - -typedef struct VkPhysicalDeviceVulkan12Properties32 -{ - VkStructureType sType; - PTR32 pNext; - VkDriverId driverID; - char driverName[VK_MAX_DRIVER_NAME_SIZE]; - char driverInfo[VK_MAX_DRIVER_INFO_SIZE]; - VkConformanceVersion conformanceVersion; - VkShaderFloatControlsIndependence denormBehaviorIndependence; - VkShaderFloatControlsIndependence roundingModeIndependence; - VkBool32 shaderSignedZeroInfNanPreserveFloat16; - VkBool32 shaderSignedZeroInfNanPreserveFloat32; - VkBool32 shaderSignedZeroInfNanPreserveFloat64; - VkBool32 shaderDenormPreserveFloat16; - VkBool32 shaderDenormPreserveFloat32; - VkBool32 shaderDenormPreserveFloat64; - VkBool32 shaderDenormFlushToZeroFloat16; - VkBool32 shaderDenormFlushToZeroFloat32; - VkBool32 shaderDenormFlushToZeroFloat64; - VkBool32 shaderRoundingModeRTEFloat16; - VkBool32 shaderRoundingModeRTEFloat32; - VkBool32 shaderRoundingModeRTEFloat64; - VkBool32 shaderRoundingModeRTZFloat16; - VkBool32 shaderRoundingModeRTZFloat32; - VkBool32 shaderRoundingModeRTZFloat64; - uint32_t maxUpdateAfterBindDescriptorsInAllPools; - VkBool32 shaderUniformBufferArrayNonUniformIndexingNative; - VkBool32 shaderSampledImageArrayNonUniformIndexingNative; - VkBool32 shaderStorageBufferArrayNonUniformIndexingNative; - VkBool32 shaderStorageImageArrayNonUniformIndexingNative; - VkBool32 shaderInputAttachmentArrayNonUniformIndexingNative; - VkBool32 robustBufferAccessUpdateAfterBind; - VkBool32 quadDivergentImplicitLod; - uint32_t maxPerStageDescriptorUpdateAfterBindSamplers; - uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers; - uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages; - uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments; - uint32_t maxPerStageUpdateAfterBindResources; - uint32_t maxDescriptorSetUpdateAfterBindSamplers; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic; - uint32_t maxDescriptorSetUpdateAfterBindSampledImages; - uint32_t maxDescriptorSetUpdateAfterBindStorageImages; - uint32_t maxDescriptorSetUpdateAfterBindInputAttachments; - VkResolveModeFlags supportedDepthResolveModes; - VkResolveModeFlags supportedStencilResolveModes; - VkBool32 independentResolveNone; - VkBool32 independentResolve; - VkBool32 filterMinmaxSingleComponentFormats; - VkBool32 filterMinmaxImageComponentMapping; - uint64_t DECLSPEC_ALIGN(8) maxTimelineSemaphoreValueDifference; - VkSampleCountFlags framebufferIntegerColorSampleCounts; -} VkPhysicalDeviceVulkan12Properties32; - -typedef struct VkPhysicalDeviceVulkan13Properties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t minSubgroupSize; - uint32_t maxSubgroupSize; - uint32_t maxComputeWorkgroupSubgroups; - VkShaderStageFlags requiredSubgroupSizeStages; - uint32_t maxInlineUniformBlockSize; - uint32_t maxPerStageDescriptorInlineUniformBlocks; - uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks; - uint32_t maxDescriptorSetInlineUniformBlocks; - uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks; - uint32_t maxInlineUniformTotalSize; - VkBool32 integerDotProduct8BitUnsignedAccelerated; - VkBool32 integerDotProduct8BitSignedAccelerated; - VkBool32 integerDotProduct8BitMixedSignednessAccelerated; - VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated; - VkBool32 integerDotProduct4x8BitPackedSignedAccelerated; - VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated; - VkBool32 integerDotProduct16BitUnsignedAccelerated; - VkBool32 integerDotProduct16BitSignedAccelerated; - VkBool32 integerDotProduct16BitMixedSignednessAccelerated; - VkBool32 integerDotProduct32BitUnsignedAccelerated; - VkBool32 integerDotProduct32BitSignedAccelerated; - VkBool32 integerDotProduct32BitMixedSignednessAccelerated; - VkBool32 integerDotProduct64BitUnsignedAccelerated; - VkBool32 integerDotProduct64BitSignedAccelerated; - VkBool32 integerDotProduct64BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated; - VkDeviceSize DECLSPEC_ALIGN(8) storageTexelBufferOffsetAlignmentBytes; - VkBool32 storageTexelBufferOffsetSingleTexelAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) uniformTexelBufferOffsetAlignmentBytes; - VkBool32 uniformTexelBufferOffsetSingleTexelAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) maxBufferSize; -} VkPhysicalDeviceVulkan13Properties32; - -typedef struct VkPhysicalDeviceVulkan14Properties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t lineSubPixelPrecisionBits; - uint32_t maxVertexAttribDivisor; - VkBool32 supportsNonZeroFirstInstance; - uint32_t maxPushDescriptors; - VkBool32 dynamicRenderingLocalReadDepthStencilAttachments; - VkBool32 dynamicRenderingLocalReadMultisampledAttachments; - VkBool32 earlyFragmentMultisampleCoverageAfterSampleCounting; - VkBool32 earlyFragmentSampleMaskTestBeforeSampleCounting; - VkBool32 depthStencilSwizzleOneSupport; - VkBool32 polygonModePointSize; - VkBool32 nonStrictSinglePixelWideLinesUseParallelogram; - VkBool32 nonStrictWideLinesUseParallelogram; - VkBool32 blockTexelViewCompatibleMultipleLayers; - uint32_t maxCombinedImageSamplerDescriptorCount; - VkBool32 fragmentShadingRateClampCombinerInputs; - VkPipelineRobustnessBufferBehavior defaultRobustnessStorageBuffers; - VkPipelineRobustnessBufferBehavior defaultRobustnessUniformBuffers; - VkPipelineRobustnessBufferBehavior defaultRobustnessVertexInputs; - VkPipelineRobustnessImageBehavior defaultRobustnessImages; - uint32_t copySrcLayoutCount; - PTR32 pCopySrcLayouts; - uint32_t copyDstLayoutCount; - PTR32 pCopyDstLayouts; - uint8_t optimalTilingLayoutUUID[VK_UUID_SIZE]; - VkBool32 identicalMemoryTypeRequirements; -} VkPhysicalDeviceVulkan14Properties32; - -typedef struct VkPhysicalDeviceCustomBorderColorPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxCustomBorderColorSamplers; -} VkPhysicalDeviceCustomBorderColorPropertiesEXT32; - -typedef struct VkPhysicalDeviceExtendedDynamicState3PropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 dynamicPrimitiveTopologyUnrestricted; -} VkPhysicalDeviceExtendedDynamicState3PropertiesEXT32; - -typedef struct VkPhysicalDeviceRobustness2PropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) robustStorageBufferAccessSizeAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) robustUniformBufferAccessSizeAlignment; -} VkPhysicalDeviceRobustness2PropertiesEXT32; - -typedef struct VkPhysicalDeviceFragmentShadingRatePropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D minFragmentShadingRateAttachmentTexelSize; - VkExtent2D maxFragmentShadingRateAttachmentTexelSize; - uint32_t maxFragmentShadingRateAttachmentTexelSizeAspectRatio; - VkBool32 primitiveFragmentShadingRateWithMultipleViewports; - VkBool32 layeredShadingRateAttachments; - VkBool32 fragmentShadingRateNonTrivialCombinerOps; - VkExtent2D maxFragmentSize; - uint32_t maxFragmentSizeAspectRatio; - uint32_t maxFragmentShadingRateCoverageSamples; - VkSampleCountFlagBits maxFragmentShadingRateRasterizationSamples; - VkBool32 fragmentShadingRateWithShaderDepthStencilWrites; - VkBool32 fragmentShadingRateWithSampleMask; - VkBool32 fragmentShadingRateWithShaderSampleMask; - VkBool32 fragmentShadingRateWithConservativeRasterization; - VkBool32 fragmentShadingRateWithFragmentShaderInterlock; - VkBool32 fragmentShadingRateWithCustomSampleLocations; - VkBool32 fragmentShadingRateStrictMultiplyCombiner; -} VkPhysicalDeviceFragmentShadingRatePropertiesKHR32; - -typedef struct VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkSampleCountFlagBits maxFragmentShadingRateInvocationCount; -} VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV32; - -typedef struct VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 nativeUnalignedPerformance; -} VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT32; - -typedef struct VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxIndirectPipelineCount; - uint32_t maxIndirectShaderObjectCount; - uint32_t maxIndirectSequenceCount; - uint32_t maxIndirectCommandsTokenCount; - uint32_t maxIndirectCommandsTokenOffset; - uint32_t maxIndirectCommandsIndirectStride; - VkIndirectCommandsInputModeFlagsEXT supportedIndirectCommandsInputModes; - VkShaderStageFlags supportedIndirectCommandsShaderStages; - VkShaderStageFlags supportedIndirectCommandsShaderStagesPipelineBinding; - VkShaderStageFlags supportedIndirectCommandsShaderStagesShaderBinding; - VkBool32 deviceGeneratedCommandsTransformFeedback; - VkBool32 deviceGeneratedCommandsMultiDrawIndirectCount; -} VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT32; - -typedef struct VkPhysicalDeviceHostImageCopyProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t copySrcLayoutCount; - PTR32 pCopySrcLayouts; - uint32_t copyDstLayoutCount; - PTR32 pCopyDstLayouts; - uint8_t optimalTilingLayoutUUID[VK_UUID_SIZE]; - VkBool32 identicalMemoryTypeRequirements; -} VkPhysicalDeviceHostImageCopyProperties32; -typedef VkPhysicalDeviceHostImageCopyProperties32 VkPhysicalDeviceHostImageCopyPropertiesEXT32; - -typedef struct VkPhysicalDeviceProvokingVertexPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 provokingVertexModePerPipeline; - VkBool32 transformFeedbackPreservesTriangleFanProvokingVertex; -} VkPhysicalDeviceProvokingVertexPropertiesEXT32; - -typedef struct VkPhysicalDeviceDescriptorBufferPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 combinedImageSamplerDescriptorSingleArray; - VkBool32 bufferlessPushDescriptors; - VkBool32 allowSamplerImageViewPostSubmitCreation; - VkDeviceSize DECLSPEC_ALIGN(8) descriptorBufferOffsetAlignment; - uint32_t maxDescriptorBufferBindings; - uint32_t maxResourceDescriptorBufferBindings; - uint32_t maxSamplerDescriptorBufferBindings; - uint32_t maxEmbeddedImmutableSamplerBindings; - uint32_t maxEmbeddedImmutableSamplers; - PTR32 bufferCaptureReplayDescriptorDataSize; - PTR32 imageCaptureReplayDescriptorDataSize; - PTR32 imageViewCaptureReplayDescriptorDataSize; - PTR32 samplerCaptureReplayDescriptorDataSize; - PTR32 accelerationStructureCaptureReplayDescriptorDataSize; - PTR32 samplerDescriptorSize; - PTR32 combinedImageSamplerDescriptorSize; - PTR32 sampledImageDescriptorSize; - PTR32 storageImageDescriptorSize; - PTR32 uniformTexelBufferDescriptorSize; - PTR32 robustUniformTexelBufferDescriptorSize; - PTR32 storageTexelBufferDescriptorSize; - PTR32 robustStorageTexelBufferDescriptorSize; - PTR32 uniformBufferDescriptorSize; - PTR32 robustUniformBufferDescriptorSize; - PTR32 storageBufferDescriptorSize; - PTR32 robustStorageBufferDescriptorSize; - PTR32 inputAttachmentDescriptorSize; - PTR32 accelerationStructureDescriptorSize; - VkDeviceSize DECLSPEC_ALIGN(8) maxSamplerDescriptorBufferRange; - VkDeviceSize DECLSPEC_ALIGN(8) maxResourceDescriptorBufferRange; - VkDeviceSize DECLSPEC_ALIGN(8) samplerDescriptorBufferAddressSpaceSize; - VkDeviceSize DECLSPEC_ALIGN(8) resourceDescriptorBufferAddressSpaceSize; - VkDeviceSize DECLSPEC_ALIGN(8) descriptorBufferAddressSpaceSize; -} VkPhysicalDeviceDescriptorBufferPropertiesEXT32; - -typedef struct VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 combinedImageSamplerDensityMapDescriptorSize; -} VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT32; - -typedef struct VkPhysicalDeviceShaderIntegerDotProductProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 integerDotProduct8BitUnsignedAccelerated; - VkBool32 integerDotProduct8BitSignedAccelerated; - VkBool32 integerDotProduct8BitMixedSignednessAccelerated; - VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated; - VkBool32 integerDotProduct4x8BitPackedSignedAccelerated; - VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated; - VkBool32 integerDotProduct16BitUnsignedAccelerated; - VkBool32 integerDotProduct16BitSignedAccelerated; - VkBool32 integerDotProduct16BitMixedSignednessAccelerated; - VkBool32 integerDotProduct32BitUnsignedAccelerated; - VkBool32 integerDotProduct32BitSignedAccelerated; - VkBool32 integerDotProduct32BitMixedSignednessAccelerated; - VkBool32 integerDotProduct64BitUnsignedAccelerated; - VkBool32 integerDotProduct64BitSignedAccelerated; - VkBool32 integerDotProduct64BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated; -} VkPhysicalDeviceShaderIntegerDotProductProperties32; -typedef VkPhysicalDeviceShaderIntegerDotProductProperties32 VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR32; - -typedef struct VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 triStripVertexOrderIndependentOfProvokingVertex; -} VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR32; - -typedef struct VkPhysicalDevicePipelineBinaryPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 pipelineBinaryInternalCache; - VkBool32 pipelineBinaryInternalCacheControl; - VkBool32 pipelineBinaryPrefersInternalCache; - VkBool32 pipelineBinaryPrecompiledInternalCache; - VkBool32 pipelineBinaryCompressedData; -} VkPhysicalDevicePipelineBinaryPropertiesKHR32; - -typedef struct VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 graphicsPipelineLibraryFastLinking; - VkBool32 graphicsPipelineLibraryIndependentInterpolationDecoration; -} VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT32; - -typedef struct VkPhysicalDeviceNestedCommandBufferPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxCommandBufferNestingLevel; -} VkPhysicalDeviceNestedCommandBufferPropertiesEXT32; - -typedef struct VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint8_t shaderModuleIdentifierAlgorithmUUID[VK_UUID_SIZE]; -} VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT32; - -typedef struct VkPhysicalDeviceOpacityMicromapPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxOpacity2StateSubdivisionLevel; - uint32_t maxOpacity4StateSubdivisionLevel; -} VkPhysicalDeviceOpacityMicromapPropertiesEXT32; - -typedef struct VkPhysicalDevicePipelineRobustnessProperties32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineRobustnessBufferBehavior defaultRobustnessStorageBuffers; - VkPipelineRobustnessBufferBehavior defaultRobustnessUniformBuffers; - VkPipelineRobustnessBufferBehavior defaultRobustnessVertexInputs; - VkPipelineRobustnessImageBehavior defaultRobustnessImages; -} VkPhysicalDevicePipelineRobustnessProperties32; -typedef VkPhysicalDevicePipelineRobustnessProperties32 VkPhysicalDevicePipelineRobustnessPropertiesEXT32; - -typedef struct VkPhysicalDeviceImageProcessingPropertiesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t maxWeightFilterPhases; - VkExtent2D maxWeightFilterDimension; - VkExtent2D maxBlockMatchRegion; - VkExtent2D maxBoxFilterBlockSize; -} VkPhysicalDeviceImageProcessingPropertiesQCOM32; - -typedef struct VkPhysicalDeviceOpticalFlowPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkOpticalFlowGridSizeFlagsNV supportedOutputGridSizes; - VkOpticalFlowGridSizeFlagsNV supportedHintGridSizes; - VkBool32 hintSupported; - VkBool32 costSupported; - VkBool32 bidirectionalFlowSupported; - VkBool32 globalFlowSupported; - uint32_t minWidth; - uint32_t minHeight; - uint32_t maxWidth; - uint32_t maxHeight; - uint32_t maxNumRegionsOfInterest; -} VkPhysicalDeviceOpticalFlowPropertiesNV32; - -typedef struct VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) shaderCoreMask; - uint32_t shaderCoreCount; - uint32_t shaderWarpsPerCore; -} VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM32; - -typedef struct VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkRayTracingInvocationReorderModeNV rayTracingInvocationReorderReorderingHint; -} VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV32; - -typedef struct VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) extendedSparseAddressSpaceSize; - VkImageUsageFlags extendedSparseImageUsageFlags; - VkBufferUsageFlags extendedSparseBufferUsageFlags; -} VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV32; - -typedef struct VkPhysicalDeviceShaderCorePropertiesARM32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t pixelRate; - uint32_t texelRate; - uint32_t fmaRate; -} VkPhysicalDeviceShaderCorePropertiesARM32; - -typedef struct VkPhysicalDeviceShaderObjectPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint8_t shaderBinaryUUID[VK_UUID_SIZE]; - uint32_t shaderBinaryVersion; -} VkPhysicalDeviceShaderObjectPropertiesEXT32; - -typedef struct VkPhysicalDeviceShaderTileImagePropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 shaderTileImageCoherentReadAccelerated; - VkBool32 shaderTileImageReadSampleFromPixelRateInvocation; - VkBool32 shaderTileImageReadFromHelperInvocation; -} VkPhysicalDeviceShaderTileImagePropertiesEXT32; - -typedef struct VkPhysicalDeviceCooperativeMatrixPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderStageFlags cooperativeMatrixSupportedStages; -} VkPhysicalDeviceCooperativeMatrixPropertiesKHR32; - -typedef struct VkPhysicalDeviceImageProcessing2PropertiesQCOM32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D maxBlockMatchWindow; -} VkPhysicalDeviceImageProcessing2PropertiesQCOM32; - -typedef struct VkPhysicalDeviceLayeredDriverPropertiesMSFT32 -{ - VkStructureType sType; - PTR32 pNext; - VkLayeredDriverUnderlyingApiMSFT underlyingAPI; -} VkPhysicalDeviceLayeredDriverPropertiesMSFT32; - -typedef struct VkPhysicalDeviceCudaKernelLaunchPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t computeCapabilityMinor; - uint32_t computeCapabilityMajor; -} VkPhysicalDeviceCudaKernelLaunchPropertiesNV32; - -typedef struct VkPhysicalDeviceSchedulingControlsPropertiesARM32 -{ - VkStructureType sType; - PTR32 pNext; - VkPhysicalDeviceSchedulingControlsFlagsARM DECLSPEC_ALIGN(8) schedulingControlsFlags; -} VkPhysicalDeviceSchedulingControlsPropertiesARM32; - -typedef struct VkPhysicalDeviceRenderPassStripedPropertiesARM32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D renderPassStripeGranularity; - uint32_t maxRenderPassStripes; -} VkPhysicalDeviceRenderPassStripedPropertiesARM32; - -typedef struct VkPhysicalDeviceMapMemoryPlacedPropertiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceSize DECLSPEC_ALIGN(8) minPlacedMemoryMapAlignment; -} VkPhysicalDeviceMapMemoryPlacedPropertiesEXT32; - -typedef struct VkPhysicalDeviceImageAlignmentControlPropertiesMESA32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t supportedImageAlignmentMask; -} VkPhysicalDeviceImageAlignmentControlPropertiesMESA32; - -typedef struct VkPhysicalDeviceCooperativeMatrix2PropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t cooperativeMatrixWorkgroupScopeMaxWorkgroupSize; - uint32_t cooperativeMatrixFlexibleDimensionsMaxDimension; - uint32_t cooperativeMatrixWorkgroupScopeReservedSharedMemory; -} VkPhysicalDeviceCooperativeMatrix2PropertiesNV32; - -typedef struct VkPhysicalDeviceProperties232 -{ - VkStructureType sType; - PTR32 pNext; - VkPhysicalDeviceProperties32 DECLSPEC_ALIGN(8) properties; -} VkPhysicalDeviceProperties232; -typedef VkPhysicalDeviceProperties232 VkPhysicalDeviceProperties2KHR32; - -typedef struct VkQueueFamilyGlobalPriorityProperties32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t priorityCount; - VkQueueGlobalPriority priorities[VK_MAX_GLOBAL_PRIORITY_SIZE]; -} VkQueueFamilyGlobalPriorityProperties32; -typedef VkQueueFamilyGlobalPriorityProperties32 VkQueueFamilyGlobalPriorityPropertiesKHR32; -typedef VkQueueFamilyGlobalPriorityProperties32 VkQueueFamilyGlobalPriorityPropertiesEXT32; - -typedef struct VkQueueFamilyCheckpointPropertiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineStageFlags checkpointExecutionStageMask; -} VkQueueFamilyCheckpointPropertiesNV32; - -typedef struct VkQueueFamilyCheckpointProperties2NV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) checkpointExecutionStageMask; -} VkQueueFamilyCheckpointProperties2NV32; - -typedef struct VkQueueFamilyVideoPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoCodecOperationFlagsKHR videoCodecOperations; -} VkQueueFamilyVideoPropertiesKHR32; - -typedef struct VkQueueFamilyQueryResultStatusPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 queryResultStatusSupport; -} VkQueueFamilyQueryResultStatusPropertiesKHR32; - -typedef struct VkQueueFamilyProperties232 -{ - VkStructureType sType; - PTR32 pNext; - VkQueueFamilyProperties queueFamilyProperties; -} VkQueueFamilyProperties232; -typedef VkQueueFamilyProperties232 VkQueueFamilyProperties2KHR32; - -typedef struct VkPhysicalDeviceSparseImageFormatInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkFormat format; - VkImageType type; - VkSampleCountFlagBits samples; - VkImageUsageFlags usage; - VkImageTiling tiling; -} VkPhysicalDeviceSparseImageFormatInfo232; -typedef VkPhysicalDeviceSparseImageFormatInfo232 VkPhysicalDeviceSparseImageFormatInfo2KHR32; - -typedef struct VkSparseImageFormatProperties232 -{ - VkStructureType sType; - PTR32 pNext; - VkSparseImageFormatProperties properties; -} VkSparseImageFormatProperties232; -typedef VkSparseImageFormatProperties232 VkSparseImageFormatProperties2KHR32; - -typedef struct VkFramebufferMixedSamplesCombinationNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkCoverageReductionModeNV coverageReductionMode; - VkSampleCountFlagBits rasterizationSamples; - VkSampleCountFlags depthStencilSamples; - VkSampleCountFlags colorSamples; -} VkFramebufferMixedSamplesCombinationNV32; - -typedef struct VkSurfacePresentModeEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkPresentModeKHR presentMode; -} VkSurfacePresentModeEXT32; - -typedef struct VkPhysicalDeviceSurfaceInfo2KHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; -} VkPhysicalDeviceSurfaceInfo2KHR32; - -typedef struct VkSurfaceCapabilitiesPresentBarrierNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 presentBarrierSupported; -} VkSurfaceCapabilitiesPresentBarrierNV32; - -typedef struct VkSurfacePresentScalingCapabilitiesEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkPresentScalingFlagsEXT supportedPresentScaling; - VkPresentGravityFlagsEXT supportedPresentGravityX; - VkPresentGravityFlagsEXT supportedPresentGravityY; - VkExtent2D minScaledImageExtent; - VkExtent2D maxScaledImageExtent; -} VkSurfacePresentScalingCapabilitiesEXT32; - -typedef struct VkSurfacePresentModeCompatibilityEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t presentModeCount; - PTR32 pPresentModes; -} VkSurfacePresentModeCompatibilityEXT32; - -typedef struct VkLatencySurfaceCapabilitiesNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t presentModeCount; - PTR32 pPresentModes; -} VkLatencySurfaceCapabilitiesNV32; - -typedef struct VkSurfaceCapabilities2KHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkSurfaceCapabilitiesKHR surfaceCapabilities; -} VkSurfaceCapabilities2KHR32; - -typedef struct VkSurfaceFormat2KHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkSurfaceFormatKHR surfaceFormat; -} VkSurfaceFormat2KHR32; - -typedef struct VkPhysicalDeviceToolProperties32 -{ - VkStructureType sType; - PTR32 pNext; - char name[VK_MAX_EXTENSION_NAME_SIZE]; - char version[VK_MAX_EXTENSION_NAME_SIZE]; - VkToolPurposeFlags purposes; - char description[VK_MAX_DESCRIPTION_SIZE]; - char layer[VK_MAX_EXTENSION_NAME_SIZE]; -} VkPhysicalDeviceToolProperties32; -typedef VkPhysicalDeviceToolProperties32 VkPhysicalDeviceToolPropertiesEXT32; - -typedef struct VkVideoEncodeQuantizationMapCapabilitiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D maxQuantizationMapExtent; -} VkVideoEncodeQuantizationMapCapabilitiesKHR32; - -typedef struct VkVideoEncodeH264QuantizationMapCapabilitiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - int32_t minQpDelta; - int32_t maxQpDelta; -} VkVideoEncodeH264QuantizationMapCapabilitiesKHR32; - -typedef struct VkVideoEncodeH265QuantizationMapCapabilitiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - int32_t minQpDelta; - int32_t maxQpDelta; -} VkVideoEncodeH265QuantizationMapCapabilitiesKHR32; - -typedef struct VkVideoEncodeAV1QuantizationMapCapabilitiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - int32_t minQIndexDelta; - int32_t maxQIndexDelta; -} VkVideoEncodeAV1QuantizationMapCapabilitiesKHR32; - -typedef struct VkVideoDecodeCapabilitiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoDecodeCapabilityFlagsKHR flags; -} VkVideoDecodeCapabilitiesKHR32; - -typedef struct VkVideoDecodeH264CapabilitiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - StdVideoH264LevelIdc maxLevelIdc; - VkOffset2D fieldOffsetGranularity; -} VkVideoDecodeH264CapabilitiesKHR32; - -typedef struct VkVideoDecodeH265CapabilitiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - StdVideoH265LevelIdc maxLevelIdc; -} VkVideoDecodeH265CapabilitiesKHR32; - -typedef struct VkVideoDecodeAV1CapabilitiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - StdVideoAV1Level maxLevel; -} VkVideoDecodeAV1CapabilitiesKHR32; - -typedef struct VkVideoEncodeCapabilitiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEncodeCapabilityFlagsKHR flags; - VkVideoEncodeRateControlModeFlagsKHR rateControlModes; - uint32_t maxRateControlLayers; - uint64_t DECLSPEC_ALIGN(8) maxBitrate; - uint32_t maxQualityLevels; - VkExtent2D encodeInputPictureGranularity; - VkVideoEncodeFeedbackFlagsKHR supportedEncodeFeedbackFlags; -} VkVideoEncodeCapabilitiesKHR32; - -typedef struct VkVideoEncodeH264CapabilitiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEncodeH264CapabilityFlagsKHR flags; - StdVideoH264LevelIdc maxLevelIdc; - uint32_t maxSliceCount; - uint32_t maxPPictureL0ReferenceCount; - uint32_t maxBPictureL0ReferenceCount; - uint32_t maxL1ReferenceCount; - uint32_t maxTemporalLayerCount; - VkBool32 expectDyadicTemporalLayerPattern; - int32_t minQp; - int32_t maxQp; - VkBool32 prefersGopRemainingFrames; - VkBool32 requiresGopRemainingFrames; - VkVideoEncodeH264StdFlagsKHR stdSyntaxFlags; -} VkVideoEncodeH264CapabilitiesKHR32; - -typedef struct VkVideoEncodeH265CapabilitiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEncodeH265CapabilityFlagsKHR flags; - StdVideoH265LevelIdc maxLevelIdc; - uint32_t maxSliceSegmentCount; - VkExtent2D maxTiles; - VkVideoEncodeH265CtbSizeFlagsKHR ctbSizes; - VkVideoEncodeH265TransformBlockSizeFlagsKHR transformBlockSizes; - uint32_t maxPPictureL0ReferenceCount; - uint32_t maxBPictureL0ReferenceCount; - uint32_t maxL1ReferenceCount; - uint32_t maxSubLayerCount; - VkBool32 expectDyadicTemporalSubLayerPattern; - int32_t minQp; - int32_t maxQp; - VkBool32 prefersGopRemainingFrames; - VkBool32 requiresGopRemainingFrames; - VkVideoEncodeH265StdFlagsKHR stdSyntaxFlags; -} VkVideoEncodeH265CapabilitiesKHR32; - -typedef struct VkVideoEncodeAV1CapabilitiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEncodeAV1CapabilityFlagsKHR flags; - StdVideoAV1Level maxLevel; - VkExtent2D codedPictureAlignment; - VkExtent2D maxTiles; - VkExtent2D minTileSize; - VkExtent2D maxTileSize; - VkVideoEncodeAV1SuperblockSizeFlagsKHR superblockSizes; - uint32_t maxSingleReferenceCount; - uint32_t singleReferenceNameMask; - uint32_t maxUnidirectionalCompoundReferenceCount; - uint32_t maxUnidirectionalCompoundGroup1ReferenceCount; - uint32_t unidirectionalCompoundReferenceNameMask; - uint32_t maxBidirectionalCompoundReferenceCount; - uint32_t maxBidirectionalCompoundGroup1ReferenceCount; - uint32_t maxBidirectionalCompoundGroup2ReferenceCount; - uint32_t bidirectionalCompoundReferenceNameMask; - uint32_t maxTemporalLayerCount; - uint32_t maxSpatialLayerCount; - uint32_t maxOperatingPoints; - uint32_t minQIndex; - uint32_t maxQIndex; - VkBool32 prefersGopRemainingFrames; - VkBool32 requiresGopRemainingFrames; - VkVideoEncodeAV1StdFlagsKHR stdSyntaxFlags; -} VkVideoEncodeAV1CapabilitiesKHR32; - -typedef struct VkVideoCapabilitiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoCapabilityFlagsKHR flags; - VkDeviceSize DECLSPEC_ALIGN(8) minBitstreamBufferOffsetAlignment; - VkDeviceSize DECLSPEC_ALIGN(8) minBitstreamBufferSizeAlignment; - VkExtent2D pictureAccessGranularity; - VkExtent2D minCodedExtent; - VkExtent2D maxCodedExtent; - uint32_t maxDpbSlots; - uint32_t maxActiveReferencePictures; - VkExtensionProperties stdHeaderVersion; -} VkVideoCapabilitiesKHR32; - -typedef struct VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pVideoProfile; - uint32_t qualityLevel; -} VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR32; - -typedef struct VkVideoEncodeH264QualityLevelPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEncodeH264RateControlFlagsKHR preferredRateControlFlags; - uint32_t preferredGopFrameCount; - uint32_t preferredIdrPeriod; - uint32_t preferredConsecutiveBFrameCount; - uint32_t preferredTemporalLayerCount; - VkVideoEncodeH264QpKHR preferredConstantQp; - uint32_t preferredMaxL0ReferenceCount; - uint32_t preferredMaxL1ReferenceCount; - VkBool32 preferredStdEntropyCodingModeFlag; -} VkVideoEncodeH264QualityLevelPropertiesKHR32; - -typedef struct VkVideoEncodeH265QualityLevelPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEncodeH265RateControlFlagsKHR preferredRateControlFlags; - uint32_t preferredGopFrameCount; - uint32_t preferredIdrPeriod; - uint32_t preferredConsecutiveBFrameCount; - uint32_t preferredSubLayerCount; - VkVideoEncodeH265QpKHR preferredConstantQp; - uint32_t preferredMaxL0ReferenceCount; - uint32_t preferredMaxL1ReferenceCount; -} VkVideoEncodeH265QualityLevelPropertiesKHR32; - -typedef struct VkVideoEncodeAV1QualityLevelPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEncodeAV1RateControlFlagsKHR preferredRateControlFlags; - uint32_t preferredGopFrameCount; - uint32_t preferredKeyFramePeriod; - uint32_t preferredConsecutiveBipredictiveFrameCount; - uint32_t preferredTemporalLayerCount; - VkVideoEncodeAV1QIndexKHR preferredConstantQIndex; - uint32_t preferredMaxSingleReferenceCount; - uint32_t preferredSingleReferenceNameMask; - uint32_t preferredMaxUnidirectionalCompoundReferenceCount; - uint32_t preferredMaxUnidirectionalCompoundGroup1ReferenceCount; - uint32_t preferredUnidirectionalCompoundReferenceNameMask; - uint32_t preferredMaxBidirectionalCompoundReferenceCount; - uint32_t preferredMaxBidirectionalCompoundGroup1ReferenceCount; - uint32_t preferredMaxBidirectionalCompoundGroup2ReferenceCount; - uint32_t preferredBidirectionalCompoundReferenceNameMask; -} VkVideoEncodeAV1QualityLevelPropertiesKHR32; - -typedef struct VkVideoEncodeQualityLevelPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEncodeRateControlModeFlagBitsKHR preferredRateControlMode; - uint32_t preferredRateControlLayerCount; -} VkVideoEncodeQualityLevelPropertiesKHR32; - -typedef struct VkPhysicalDeviceVideoFormatInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkImageUsageFlags imageUsage; -} VkPhysicalDeviceVideoFormatInfoKHR32; - -typedef struct VkVideoFormatQuantizationMapPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkExtent2D quantizationMapTexelSize; -} VkVideoFormatQuantizationMapPropertiesKHR32; - -typedef struct VkVideoFormatH265QuantizationMapPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEncodeH265CtbSizeFlagsKHR compatibleCtbSizes; -} VkVideoFormatH265QuantizationMapPropertiesKHR32; - -typedef struct VkVideoFormatAV1QuantizationMapPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkVideoEncodeAV1SuperblockSizeFlagsKHR compatibleSuperblockSizes; -} VkVideoFormatAV1QuantizationMapPropertiesKHR32; - -typedef struct VkVideoFormatPropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkFormat format; - VkComponentMapping componentMapping; - VkImageCreateFlags imageCreateFlags; - VkImageType imageType; - VkImageTiling imageTiling; - VkImageUsageFlags imageUsageFlags; -} VkVideoFormatPropertiesKHR32; - -typedef struct VkPipelineBinaryDataInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineBinaryKHR DECLSPEC_ALIGN(8) pipelineBinary; -} VkPipelineBinaryDataInfoKHR32; - -typedef struct VkPipelineExecutableInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t executableIndex; -} VkPipelineExecutableInfoKHR32; - -typedef struct VkPipelineExecutableInternalRepresentationKHR32 -{ - VkStructureType sType; - PTR32 pNext; - char name[VK_MAX_DESCRIPTION_SIZE]; - char description[VK_MAX_DESCRIPTION_SIZE]; - VkBool32 isText; - PTR32 dataSize; - PTR32 pData; -} VkPipelineExecutableInternalRepresentationKHR32; - -typedef struct VkPipelineInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipeline DECLSPEC_ALIGN(8) pipeline; -} VkPipelineInfoKHR32; -typedef VkPipelineInfoKHR32 VkPipelineInfoEXT32; - -typedef struct VkPipelineExecutablePropertiesKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkShaderStageFlags stages; - char name[VK_MAX_DESCRIPTION_SIZE]; - char description[VK_MAX_DESCRIPTION_SIZE]; - uint32_t subgroupSize; -} VkPipelineExecutablePropertiesKHR32; - -typedef union VkPipelineExecutableStatisticValueKHR32 -{ - VkBool32 b32; - int64_t i64; - uint64_t DECLSPEC_ALIGN(8) u64; - double f64; -} VkPipelineExecutableStatisticValueKHR32; - -typedef struct VkPipelineExecutableStatisticKHR32 -{ - VkStructureType sType; - PTR32 pNext; - char name[VK_MAX_DESCRIPTION_SIZE]; - char description[VK_MAX_DESCRIPTION_SIZE]; - VkPipelineExecutableStatisticFormatKHR format; - VkPipelineExecutableStatisticValueKHR32 DECLSPEC_ALIGN(8) value; -} VkPipelineExecutableStatisticKHR32; - -typedef struct VkPipelineIndirectDeviceAddressInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline DECLSPEC_ALIGN(8) pipeline; -} VkPipelineIndirectDeviceAddressInfoNV32; - - -typedef struct VkCheckpointData2NV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stage; - PTR32 pCheckpointMarker; -} VkCheckpointData2NV32; - -typedef struct VkCheckpointDataNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipelineStageFlagBits stage; - PTR32 pCheckpointMarker; -} VkCheckpointDataNV32; - -typedef struct VkRenderingAreaInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t viewMask; - uint32_t colorAttachmentCount; - PTR32 pColorAttachmentFormats; - VkFormat depthAttachmentFormat; - VkFormat stencilAttachmentFormat; -} VkRenderingAreaInfo32; -typedef VkRenderingAreaInfo32 VkRenderingAreaInfoKHR32; - -typedef struct VkSamplerCaptureDescriptorDataInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkSampler DECLSPEC_ALIGN(8) sampler; -} VkSamplerCaptureDescriptorDataInfoEXT32; - -typedef struct VkShaderModuleIdentifierEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t identifierSize; - uint8_t identifier[VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT]; -} VkShaderModuleIdentifierEXT32; - -typedef struct VkVideoSessionMemoryRequirementsKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t memoryBindIndex; - VkMemoryRequirements32 DECLSPEC_ALIGN(8) memoryRequirements; -} VkVideoSessionMemoryRequirementsKHR32; - -typedef struct VkInitializePerformanceApiInfoINTEL32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pUserData; -} VkInitializePerformanceApiInfoINTEL32; - -typedef struct VkLatencySleepInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkSemaphore DECLSPEC_ALIGN(8) signalSemaphore; - uint64_t DECLSPEC_ALIGN(8) value; -} VkLatencySleepInfoNV32; - -typedef struct VkMemoryMapPlacedInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 pPlacedAddress; -} VkMemoryMapPlacedInfoEXT32; - -typedef struct VkMemoryMapInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkMemoryMapFlags flags; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; -} VkMemoryMapInfo32; -typedef VkMemoryMapInfo32 VkMemoryMapInfoKHR32; - -typedef struct VkSparseMemoryBind32 -{ - VkDeviceSize DECLSPEC_ALIGN(8) resourceOffset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; - VkSparseMemoryBindFlags flags; -} VkSparseMemoryBind32; - -typedef struct VkSparseBufferMemoryBindInfo32 -{ - VkBuffer DECLSPEC_ALIGN(8) buffer; - uint32_t bindCount; - PTR32 pBinds; -} VkSparseBufferMemoryBindInfo32; - -typedef struct VkSparseImageOpaqueMemoryBindInfo32 -{ - VkImage DECLSPEC_ALIGN(8) image; - uint32_t bindCount; - PTR32 pBinds; -} VkSparseImageOpaqueMemoryBindInfo32; - -typedef struct VkSparseImageMemoryBind32 -{ - VkImageSubresource subresource; - VkOffset3D offset; - VkExtent3D extent; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; - VkSparseMemoryBindFlags flags; -} VkSparseImageMemoryBind32; - -typedef struct VkSparseImageMemoryBindInfo32 -{ - VkImage DECLSPEC_ALIGN(8) image; - uint32_t bindCount; - PTR32 pBinds; -} VkSparseImageMemoryBindInfo32; - -typedef struct VkDeviceGroupBindSparseInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t resourceDeviceIndex; - uint32_t memoryDeviceIndex; -} VkDeviceGroupBindSparseInfo32; -typedef VkDeviceGroupBindSparseInfo32 VkDeviceGroupBindSparseInfoKHR32; - -typedef struct VkTimelineSemaphoreSubmitInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t waitSemaphoreValueCount; - PTR32 pWaitSemaphoreValues; - uint32_t signalSemaphoreValueCount; - PTR32 pSignalSemaphoreValues; -} VkTimelineSemaphoreSubmitInfo32; -typedef VkTimelineSemaphoreSubmitInfo32 VkTimelineSemaphoreSubmitInfoKHR32; - -typedef struct VkFrameBoundaryEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkFrameBoundaryFlagsEXT flags; - uint64_t DECLSPEC_ALIGN(8) frameID; - uint32_t imageCount; - PTR32 pImages; - uint32_t bufferCount; - PTR32 pBuffers; - uint64_t DECLSPEC_ALIGN(8) tagName; - PTR32 tagSize; - PTR32 pTag; -} VkFrameBoundaryEXT32; - -typedef struct VkBindSparseInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t waitSemaphoreCount; - PTR32 pWaitSemaphores; - uint32_t bufferBindCount; - PTR32 pBufferBinds; - uint32_t imageOpaqueBindCount; - PTR32 pImageOpaqueBinds; - uint32_t imageBindCount; - PTR32 pImageBinds; - uint32_t signalSemaphoreCount; - PTR32 pSignalSemaphores; -} VkBindSparseInfo32; - -typedef struct VkOutOfBandQueueTypeInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkOutOfBandQueueTypeNV queueType; -} VkOutOfBandQueueTypeInfoNV32; - -typedef struct VkPresentRegionKHR32 -{ - uint32_t rectangleCount; - PTR32 pRectangles; -} VkPresentRegionKHR32; - -typedef struct VkPresentRegionsKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t swapchainCount; - PTR32 pRegions; -} VkPresentRegionsKHR32; - -typedef struct VkDeviceGroupPresentInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t swapchainCount; - PTR32 pDeviceMasks; - VkDeviceGroupPresentModeFlagBitsKHR mode; -} VkDeviceGroupPresentInfoKHR32; - -typedef struct VkPresentIdKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t swapchainCount; - PTR32 pPresentIds; -} VkPresentIdKHR32; - -typedef struct VkSwapchainPresentFenceInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t swapchainCount; - PTR32 pFences; -} VkSwapchainPresentFenceInfoEXT32; - -typedef struct VkSwapchainPresentModeInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t swapchainCount; - PTR32 pPresentModes; -} VkSwapchainPresentModeInfoEXT32; - -typedef struct VkPresentInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t waitSemaphoreCount; - PTR32 pWaitSemaphores; - uint32_t swapchainCount; - PTR32 pSwapchains; - PTR32 pImageIndices; - PTR32 pResults; -} VkPresentInfoKHR32; - -typedef struct VkDeviceGroupSubmitInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t waitSemaphoreCount; - PTR32 pWaitSemaphoreDeviceIndices; - uint32_t commandBufferCount; - PTR32 pCommandBufferDeviceMasks; - uint32_t signalSemaphoreCount; - PTR32 pSignalSemaphoreDeviceIndices; -} VkDeviceGroupSubmitInfo32; -typedef VkDeviceGroupSubmitInfo32 VkDeviceGroupSubmitInfoKHR32; - -typedef struct VkProtectedSubmitInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 protectedSubmit; -} VkProtectedSubmitInfo32; - -typedef struct VkPerformanceQuerySubmitInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t counterPassIndex; -} VkPerformanceQuerySubmitInfoKHR32; - -typedef struct VkLatencySubmissionPresentIdNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) presentID; -} VkLatencySubmissionPresentIdNV32; - -typedef struct VkSubmitInfo32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t waitSemaphoreCount; - PTR32 pWaitSemaphores; - PTR32 pWaitDstStageMask; - uint32_t commandBufferCount; - PTR32 pCommandBuffers; - uint32_t signalSemaphoreCount; - PTR32 pSignalSemaphores; -} VkSubmitInfo32; - -typedef struct VkSemaphoreSubmitInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - uint64_t DECLSPEC_ALIGN(8) value; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stageMask; - uint32_t deviceIndex; -} VkSemaphoreSubmitInfo32; -typedef VkSemaphoreSubmitInfo32 VkSemaphoreSubmitInfoKHR32; - -typedef struct VkRenderPassStripeSubmitInfoARM32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t stripeSemaphoreInfoCount; - PTR32 pStripeSemaphoreInfos; -} VkRenderPassStripeSubmitInfoARM32; - -typedef struct VkCommandBufferSubmitInfo32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 commandBuffer; - uint32_t deviceMask; -} VkCommandBufferSubmitInfo32; -typedef VkCommandBufferSubmitInfo32 VkCommandBufferSubmitInfoKHR32; - -typedef struct VkSubmitInfo232 -{ - VkStructureType sType; - PTR32 pNext; - VkSubmitFlags flags; - uint32_t waitSemaphoreInfoCount; - PTR32 pWaitSemaphoreInfos; - uint32_t commandBufferInfoCount; - PTR32 pCommandBufferInfos; - uint32_t signalSemaphoreInfoCount; - PTR32 pSignalSemaphoreInfos; -} VkSubmitInfo232; -typedef VkSubmitInfo232 VkSubmitInfo2KHR32; - -typedef struct VkReleaseCapturedPipelineDataInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - VkPipeline DECLSPEC_ALIGN(8) pipeline; -} VkReleaseCapturedPipelineDataInfoKHR32; - -typedef struct VkReleaseSwapchainImagesInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - uint32_t imageIndexCount; - PTR32 pImageIndices; -} VkReleaseSwapchainImagesInfoEXT32; - -typedef struct VkDebugUtilsObjectTagInfoEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - uint64_t DECLSPEC_ALIGN(8) tagName; - PTR32 tagSize; - PTR32 pTag; -} VkDebugUtilsObjectTagInfoEXT32; - -typedef struct VkHdrVividDynamicMetadataHUAWEI32 -{ - VkStructureType sType; - PTR32 pNext; - PTR32 dynamicMetadataSize; - PTR32 pDynamicMetadata; -} VkHdrVividDynamicMetadataHUAWEI32; - -typedef struct VkHdrMetadataEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkXYColorEXT displayPrimaryRed; - VkXYColorEXT displayPrimaryGreen; - VkXYColorEXT displayPrimaryBlue; - VkXYColorEXT whitePoint; - float maxLuminance; - float minLuminance; - float maxContentLightLevel; - float maxFrameAverageLightLevel; -} VkHdrMetadataEXT32; - -typedef struct VkSetLatencyMarkerInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - uint64_t DECLSPEC_ALIGN(8) presentID; - VkLatencyMarkerNV marker; -} VkSetLatencyMarkerInfoNV32; - -typedef struct VkLatencySleepModeInfoNV32 -{ - VkStructureType sType; - PTR32 pNext; - VkBool32 lowLatencyMode; - VkBool32 lowLatencyBoost; - uint32_t minimumIntervalUs; -} VkLatencySleepModeInfoNV32; - -typedef struct VkSemaphoreSignalInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - uint64_t DECLSPEC_ALIGN(8) value; -} VkSemaphoreSignalInfo32; -typedef VkSemaphoreSignalInfo32 VkSemaphoreSignalInfoKHR32; - -typedef struct VkDeviceAddressBindingCallbackDataEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDeviceAddressBindingFlagsEXT flags; - VkDeviceAddress DECLSPEC_ALIGN(8) baseAddress; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkDeviceAddressBindingTypeEXT bindingType; -} VkDeviceAddressBindingCallbackDataEXT32; - -typedef struct VkDebugUtilsMessengerCallbackDataEXT32 -{ - VkStructureType sType; - PTR32 pNext; - VkDebugUtilsMessengerCallbackDataFlagsEXT flags; - PTR32 pMessageIdName; - int32_t messageIdNumber; - PTR32 pMessage; - uint32_t queueLabelCount; - PTR32 pQueueLabels; - uint32_t cmdBufLabelCount; - PTR32 pCmdBufLabels; - uint32_t objectCount; - PTR32 pObjects; -} VkDebugUtilsMessengerCallbackDataEXT32; - -typedef struct VkHostImageLayoutTransitionInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkImage DECLSPEC_ALIGN(8) image; - VkImageLayout oldLayout; - VkImageLayout newLayout; - VkImageSubresourceRange subresourceRange; -} VkHostImageLayoutTransitionInfo32; -typedef VkHostImageLayoutTransitionInfo32 VkHostImageLayoutTransitionInfoEXT32; - -typedef struct VkMemoryUnmapInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkMemoryUnmapFlags flags; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; -} VkMemoryUnmapInfo32; -typedef VkMemoryUnmapInfo32 VkMemoryUnmapInfoKHR32; - -typedef struct VkCopyDescriptorSet32 -{ - VkStructureType sType; - PTR32 pNext; - VkDescriptorSet DECLSPEC_ALIGN(8) srcSet; - uint32_t srcBinding; - uint32_t srcArrayElement; - VkDescriptorSet DECLSPEC_ALIGN(8) dstSet; - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; -} VkCopyDescriptorSet32; - -typedef struct VkWriteIndirectExecutionSetPipelineEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t index; - VkPipeline DECLSPEC_ALIGN(8) pipeline; -} VkWriteIndirectExecutionSetPipelineEXT32; - -typedef struct VkWriteIndirectExecutionSetShaderEXT32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t index; - VkShaderEXT DECLSPEC_ALIGN(8) shader; -} VkWriteIndirectExecutionSetShaderEXT32; - -typedef struct VkVideoSessionParametersUpdateInfoKHR32 -{ - VkStructureType sType; - PTR32 pNext; - uint32_t updateSequenceCount; -} VkVideoSessionParametersUpdateInfoKHR32; - -typedef struct VkSemaphoreWaitInfo32 -{ - VkStructureType sType; - PTR32 pNext; - VkSemaphoreWaitFlags flags; - uint32_t semaphoreCount; - PTR32 pSemaphores; - PTR32 pValues; -} VkSemaphoreWaitInfo32; -typedef VkSemaphoreWaitInfo32 VkSemaphoreWaitInfoKHR32; - -static uint64_t wine_vk_unwrap_handle(uint32_t type, uint64_t handle) -{ - switch(type) - { - case VK_OBJECT_TYPE_COMMAND_BUFFER: - return (uint64_t) (uintptr_t) wine_cmd_buffer_from_handle(((VkCommandBuffer) (uintptr_t) handle))->host.command_buffer; - case VK_OBJECT_TYPE_COMMAND_POOL: - return (uint64_t) wine_cmd_pool_from_handle(handle)->host.command_pool; - case VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT: - return (uint64_t) wine_debug_report_callback_from_handle(handle)->host.debug_callback; - case VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT: - return (uint64_t) wine_debug_utils_messenger_from_handle(handle)->host.debug_messenger; - case VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR: - return (uint64_t) wine_deferred_operation_from_handle(handle)->host.deferred_operation; - case VK_OBJECT_TYPE_DEVICE: - return (uint64_t) (uintptr_t) vulkan_device_from_handle(((VkDevice) (uintptr_t) handle))->host.device; - case VK_OBJECT_TYPE_DEVICE_MEMORY: - return (uint64_t) wine_device_memory_from_handle(handle)->host.device_memory; - case VK_OBJECT_TYPE_INSTANCE: - return (uint64_t) (uintptr_t) vulkan_instance_from_handle(((VkInstance) (uintptr_t) handle))->host.instance; - case VK_OBJECT_TYPE_PHYSICAL_DEVICE: - return (uint64_t) (uintptr_t) vulkan_physical_device_from_handle(((VkPhysicalDevice) (uintptr_t) handle))->host.physical_device; - case VK_OBJECT_TYPE_QUEUE: - return (uint64_t) (uintptr_t) vulkan_queue_from_handle(((VkQueue) (uintptr_t) handle))->host.queue; - case VK_OBJECT_TYPE_SURFACE_KHR: - return (uint64_t) vulkan_surface_from_handle(handle)->host.surface; - case VK_OBJECT_TYPE_SWAPCHAIN_KHR: - return (uint64_t) vulkan_swapchain_from_handle(handle)->host.swapchain; - default: - return handle; - } -} - -static inline void convert_VkAcquireNextImageInfoKHR_win32_to_unwrapped_host(const VkAcquireNextImageInfoKHR32 *in, VkAcquireNextImageInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->swapchain = in->swapchain; - out->timeout = in->timeout; - out->semaphore = in->semaphore; - out->fence = in->fence; - out->deviceMask = in->deviceMask; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPerformanceConfigurationAcquireInfoINTEL_win32_to_host(const VkPerformanceConfigurationAcquireInfoINTEL32 *in, VkPerformanceConfigurationAcquireInfoINTEL *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkAcquireProfilingLockInfoKHR_win32_to_host(const VkAcquireProfilingLockInfoKHR32 *in, VkAcquireProfilingLockInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->timeout = in->timeout; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCommandBufferAllocateInfo_win32_to_unwrapped_host(const VkCommandBufferAllocateInfo32 *in, VkCommandBufferAllocateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->commandPool = in->commandPool; - out->level = in->level; - out->commandBufferCount = in->commandBufferCount; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline VkCommandBuffer *convert_VkCommandBuffer_array_win32_to_unwrapped_host(struct conversion_context *ctx, const PTR32 *in, uint32_t count) -{ - VkCommandBuffer *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = UlongToPtr(in[i]); - } - - return out; -} - -static inline void convert_VkDescriptorSetAllocateInfo_win32_to_host(struct conversion_context *ctx, const VkDescriptorSetAllocateInfo32 *in, VkDescriptorSetAllocateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->descriptorPool = in->descriptorPool; - out->descriptorSetCount = in->descriptorSetCount; - out->pSetLayouts = UlongToPtr(in->pSetLayouts); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO: - { - VkDescriptorSetVariableDescriptorCountAllocateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDescriptorSetVariableDescriptorCountAllocateInfo32 *in_ext = (const VkDescriptorSetVariableDescriptorCountAllocateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO; - out_ext->pNext = NULL; - out_ext->descriptorSetCount = in_ext->descriptorSetCount; - out_ext->pDescriptorCounts = UlongToPtr(in_ext->pDescriptorCounts); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkMemoryAllocateInfo_win32_to_host(struct conversion_context *ctx, const VkMemoryAllocateInfo32 *in, VkMemoryAllocateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->allocationSize = in->allocationSize; - out->memoryTypeIndex = in->memoryTypeIndex; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV: - { - VkDedicatedAllocationMemoryAllocateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDedicatedAllocationMemoryAllocateInfoNV32 *in_ext = (const VkDedicatedAllocationMemoryAllocateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->image = in_ext->image; - out_ext->buffer = in_ext->buffer; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO: - { - VkExportMemoryAllocateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExportMemoryAllocateInfo32 *in_ext = (const VkExportMemoryAllocateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO; - out_ext->pNext = NULL; - out_ext->handleTypes = in_ext->handleTypes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR: - { - VkImportMemoryWin32HandleInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImportMemoryWin32HandleInfoKHR32 *in_ext = (const VkImportMemoryWin32HandleInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->handleType = in_ext->handleType; - out_ext->handle = in_ext->handle; - out_ext->name = in_ext->name; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR: - { - VkExportMemoryWin32HandleInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExportMemoryWin32HandleInfoKHR32 *in_ext = (const VkExportMemoryWin32HandleInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->pAttributes = UlongToPtr(in_ext->pAttributes); - out_ext->dwAccess = in_ext->dwAccess; - out_ext->name = in_ext->name; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO: - { - VkMemoryAllocateFlagsInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMemoryAllocateFlagsInfo32 *in_ext = (const VkMemoryAllocateFlagsInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->deviceMask = in_ext->deviceMask; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO: - { - VkMemoryDedicatedAllocateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMemoryDedicatedAllocateInfo32 *in_ext = (const VkMemoryDedicatedAllocateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO; - out_ext->pNext = NULL; - out_ext->image = in_ext->image; - out_ext->buffer = in_ext->buffer; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT: - { - VkImportMemoryHostPointerInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImportMemoryHostPointerInfoEXT32 *in_ext = (const VkImportMemoryHostPointerInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT; - out_ext->pNext = NULL; - out_ext->handleType = in_ext->handleType; - out_ext->pHostPointer = UlongToPtr(in_ext->pHostPointer); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT: - { - VkMemoryPriorityAllocateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMemoryPriorityAllocateInfoEXT32 *in_ext = (const VkMemoryPriorityAllocateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->priority = in_ext->priority; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO: - { - VkMemoryOpaqueCaptureAddressAllocateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMemoryOpaqueCaptureAddressAllocateInfo32 *in_ext = (const VkMemoryOpaqueCaptureAddressAllocateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO; - out_ext->pNext = NULL; - out_ext->opaqueCaptureAddress = in_ext->opaqueCaptureAddress; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkAntiLagPresentationInfoAMD_win32_to_host(const VkAntiLagPresentationInfoAMD32 *in, VkAntiLagPresentationInfoAMD *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->stage = in->stage; - out->frameIndex = in->frameIndex; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkAntiLagPresentationInfoAMD *convert_VkAntiLagPresentationInfoAMD_array_win32_to_host(struct conversion_context *ctx, const VkAntiLagPresentationInfoAMD32 *in, uint32_t count) -{ - VkAntiLagPresentationInfoAMD *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkAntiLagPresentationInfoAMD_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkAntiLagDataAMD_win32_to_host(struct conversion_context *ctx, const VkAntiLagDataAMD32 *in, VkAntiLagDataAMD *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->mode = in->mode; - out->maxFPS = in->maxFPS; - out->pPresentationInfo = convert_VkAntiLagPresentationInfoAMD_array_win32_to_host(ctx, (const VkAntiLagPresentationInfoAMD32 *)UlongToPtr(in->pPresentationInfo), 1); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCommandBufferInheritanceInfo_win32_to_host(struct conversion_context *ctx, const VkCommandBufferInheritanceInfo32 *in, VkCommandBufferInheritanceInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->renderPass = in->renderPass; - out->subpass = in->subpass; - out->framebuffer = in->framebuffer; - out->occlusionQueryEnable = in->occlusionQueryEnable; - out->queryFlags = in->queryFlags; - out->pipelineStatistics = in->pipelineStatistics; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT: - { - VkCommandBufferInheritanceConditionalRenderingInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkCommandBufferInheritanceConditionalRenderingInfoEXT32 *in_ext = (const VkCommandBufferInheritanceConditionalRenderingInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT; - out_ext->pNext = NULL; - out_ext->conditionalRenderingEnable = in_ext->conditionalRenderingEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM: - { - VkCommandBufferInheritanceRenderPassTransformInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkCommandBufferInheritanceRenderPassTransformInfoQCOM32 *in_ext = (const VkCommandBufferInheritanceRenderPassTransformInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->transform = in_ext->transform; - out_ext->renderArea = in_ext->renderArea; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV: - { - VkCommandBufferInheritanceViewportScissorInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkCommandBufferInheritanceViewportScissorInfoNV32 *in_ext = (const VkCommandBufferInheritanceViewportScissorInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV; - out_ext->pNext = NULL; - out_ext->viewportScissor2D = in_ext->viewportScissor2D; - out_ext->viewportDepthCount = in_ext->viewportDepthCount; - out_ext->pViewportDepths = UlongToPtr(in_ext->pViewportDepths); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO: - { - VkCommandBufferInheritanceRenderingInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkCommandBufferInheritanceRenderingInfo32 *in_ext = (const VkCommandBufferInheritanceRenderingInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->viewMask = in_ext->viewMask; - out_ext->colorAttachmentCount = in_ext->colorAttachmentCount; - out_ext->pColorAttachmentFormats = UlongToPtr(in_ext->pColorAttachmentFormats); - out_ext->depthAttachmentFormat = in_ext->depthAttachmentFormat; - out_ext->stencilAttachmentFormat = in_ext->stencilAttachmentFormat; - out_ext->rasterizationSamples = in_ext->rasterizationSamples; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD: - { - VkAttachmentSampleCountInfoAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkAttachmentSampleCountInfoAMD32 *in_ext = (const VkAttachmentSampleCountInfoAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD; - out_ext->pNext = NULL; - out_ext->colorAttachmentCount = in_ext->colorAttachmentCount; - out_ext->pColorAttachmentSamples = UlongToPtr(in_ext->pColorAttachmentSamples); - out_ext->depthStencilAttachmentSamples = in_ext->depthStencilAttachmentSamples; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO: - { - VkRenderingAttachmentLocationInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderingAttachmentLocationInfo32 *in_ext = (const VkRenderingAttachmentLocationInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO; - out_ext->pNext = NULL; - out_ext->colorAttachmentCount = in_ext->colorAttachmentCount; - out_ext->pColorAttachmentLocations = UlongToPtr(in_ext->pColorAttachmentLocations); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO: - { - VkRenderingInputAttachmentIndexInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderingInputAttachmentIndexInfo32 *in_ext = (const VkRenderingInputAttachmentIndexInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO; - out_ext->pNext = NULL; - out_ext->colorAttachmentCount = in_ext->colorAttachmentCount; - out_ext->pColorAttachmentInputIndices = UlongToPtr(in_ext->pColorAttachmentInputIndices); - out_ext->pDepthInputAttachmentIndex = UlongToPtr(in_ext->pDepthInputAttachmentIndex); - out_ext->pStencilInputAttachmentIndex = UlongToPtr(in_ext->pStencilInputAttachmentIndex); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkCommandBufferInheritanceInfo *convert_VkCommandBufferInheritanceInfo_array_win32_to_host(struct conversion_context *ctx, const VkCommandBufferInheritanceInfo32 *in, uint32_t count) -{ - VkCommandBufferInheritanceInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCommandBufferInheritanceInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCommandBufferBeginInfo_win32_to_host(struct conversion_context *ctx, const VkCommandBufferBeginInfo32 *in, VkCommandBufferBeginInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->pInheritanceInfo = convert_VkCommandBufferInheritanceInfo_array_win32_to_host(ctx, (const VkCommandBufferInheritanceInfo32 *)UlongToPtr(in->pInheritanceInfo), 1); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: - { - VkDeviceGroupCommandBufferBeginInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceGroupCommandBufferBeginInfo32 *in_ext = (const VkDeviceGroupCommandBufferBeginInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO; - out_ext->pNext = NULL; - out_ext->deviceMask = in_ext->deviceMask; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline void convert_VkBindAccelerationStructureMemoryInfoNV_win64_to_host(const VkBindAccelerationStructureMemoryInfoNV *in, VkBindAccelerationStructureMemoryInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->accelerationStructure = in->accelerationStructure; - out->memory = wine_device_memory_from_handle(in->memory)->host.device_memory; - out->memoryOffset = in->memoryOffset; - out->deviceIndexCount = in->deviceIndexCount; - out->pDeviceIndices = in->pDeviceIndices; -} -#endif /* _WIN64 */ - -static inline void convert_VkBindAccelerationStructureMemoryInfoNV_win32_to_host(const VkBindAccelerationStructureMemoryInfoNV32 *in, VkBindAccelerationStructureMemoryInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->accelerationStructure = in->accelerationStructure; - out->memory = wine_device_memory_from_handle(in->memory)->host.device_memory; - out->memoryOffset = in->memoryOffset; - out->deviceIndexCount = in->deviceIndexCount; - out->pDeviceIndices = UlongToPtr(in->pDeviceIndices); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline const VkBindAccelerationStructureMemoryInfoNV *convert_VkBindAccelerationStructureMemoryInfoNV_array_win64_to_host(struct conversion_context *ctx, const VkBindAccelerationStructureMemoryInfoNV *in, uint32_t count) -{ - VkBindAccelerationStructureMemoryInfoNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBindAccelerationStructureMemoryInfoNV_win64_to_host(&in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkBindAccelerationStructureMemoryInfoNV *convert_VkBindAccelerationStructureMemoryInfoNV_array_win32_to_host(struct conversion_context *ctx, const VkBindAccelerationStructureMemoryInfoNV32 *in, uint32_t count) -{ - VkBindAccelerationStructureMemoryInfoNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBindAccelerationStructureMemoryInfoNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkBindBufferMemoryInfo_win64_to_host(const VkBindBufferMemoryInfo *in, VkBindBufferMemoryInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->buffer = in->buffer; - out->memory = wine_device_memory_from_handle(in->memory)->host.device_memory; - out->memoryOffset = in->memoryOffset; -} -#endif /* _WIN64 */ - -static inline void convert_VkBindBufferMemoryInfo_win32_to_host(struct conversion_context *ctx, const VkBindBufferMemoryInfo32 *in, VkBindBufferMemoryInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->buffer = in->buffer; - out->memory = wine_device_memory_from_handle(in->memory)->host.device_memory; - out->memoryOffset = in->memoryOffset; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: - { - VkBindBufferMemoryDeviceGroupInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBindBufferMemoryDeviceGroupInfo32 *in_ext = (const VkBindBufferMemoryDeviceGroupInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO; - out_ext->pNext = NULL; - out_ext->deviceIndexCount = in_ext->deviceIndexCount; - out_ext->pDeviceIndices = UlongToPtr(in_ext->pDeviceIndices); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS: - { - VkBindMemoryStatus *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBindMemoryStatus32 *in_ext = (const VkBindMemoryStatus32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS; - out_ext->pNext = NULL; - out_ext->pResult = UlongToPtr(in_ext->pResult); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline const VkBindBufferMemoryInfo *convert_VkBindBufferMemoryInfo_array_win64_to_host(struct conversion_context *ctx, const VkBindBufferMemoryInfo *in, uint32_t count) -{ - VkBindBufferMemoryInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBindBufferMemoryInfo_win64_to_host(&in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkBindBufferMemoryInfo *convert_VkBindBufferMemoryInfo_array_win32_to_host(struct conversion_context *ctx, const VkBindBufferMemoryInfo32 *in, uint32_t count) -{ - VkBindBufferMemoryInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBindBufferMemoryInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkBindImageMemoryInfo_win64_to_host(struct conversion_context *ctx, const VkBindImageMemoryInfo *in, VkBindImageMemoryInfo *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->image = in->image; - out->memory = wine_device_memory_from_handle(in->memory)->host.device_memory; - out->memoryOffset = in->memoryOffset; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: - { - VkBindImageMemoryDeviceGroupInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBindImageMemoryDeviceGroupInfo *in_ext = (const VkBindImageMemoryDeviceGroupInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO; - out_ext->pNext = NULL; - out_ext->deviceIndexCount = in_ext->deviceIndexCount; - out_ext->pDeviceIndices = in_ext->pDeviceIndices; - out_ext->splitInstanceBindRegionCount = in_ext->splitInstanceBindRegionCount; - out_ext->pSplitInstanceBindRegions = in_ext->pSplitInstanceBindRegions; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR: - { - VkBindImageMemorySwapchainInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBindImageMemorySwapchainInfoKHR *in_ext = (const VkBindImageMemorySwapchainInfoKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR; - out_ext->pNext = NULL; - out_ext->swapchain = vulkan_swapchain_from_handle(in_ext->swapchain)->host.swapchain; - out_ext->imageIndex = in_ext->imageIndex; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: - { - VkBindImagePlaneMemoryInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBindImagePlaneMemoryInfo *in_ext = (const VkBindImagePlaneMemoryInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO; - out_ext->pNext = NULL; - out_ext->planeAspect = in_ext->planeAspect; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS: - { - VkBindMemoryStatus *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBindMemoryStatus *in_ext = (const VkBindMemoryStatus *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS; - out_ext->pNext = NULL; - out_ext->pResult = in_ext->pResult; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} -#endif /* _WIN64 */ - -static inline void convert_VkBindImageMemoryInfo_win32_to_host(struct conversion_context *ctx, const VkBindImageMemoryInfo32 *in, VkBindImageMemoryInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->image = in->image; - out->memory = wine_device_memory_from_handle(in->memory)->host.device_memory; - out->memoryOffset = in->memoryOffset; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: - { - VkBindImageMemoryDeviceGroupInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBindImageMemoryDeviceGroupInfo32 *in_ext = (const VkBindImageMemoryDeviceGroupInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO; - out_ext->pNext = NULL; - out_ext->deviceIndexCount = in_ext->deviceIndexCount; - out_ext->pDeviceIndices = UlongToPtr(in_ext->pDeviceIndices); - out_ext->splitInstanceBindRegionCount = in_ext->splitInstanceBindRegionCount; - out_ext->pSplitInstanceBindRegions = UlongToPtr(in_ext->pSplitInstanceBindRegions); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR: - { - VkBindImageMemorySwapchainInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBindImageMemorySwapchainInfoKHR32 *in_ext = (const VkBindImageMemorySwapchainInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR; - out_ext->pNext = NULL; - out_ext->swapchain = vulkan_swapchain_from_handle(in_ext->swapchain)->host.swapchain; - out_ext->imageIndex = in_ext->imageIndex; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: - { - VkBindImagePlaneMemoryInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBindImagePlaneMemoryInfo32 *in_ext = (const VkBindImagePlaneMemoryInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO; - out_ext->pNext = NULL; - out_ext->planeAspect = in_ext->planeAspect; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS: - { - VkBindMemoryStatus *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBindMemoryStatus32 *in_ext = (const VkBindMemoryStatus32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS; - out_ext->pNext = NULL; - out_ext->pResult = UlongToPtr(in_ext->pResult); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline const VkBindImageMemoryInfo *convert_VkBindImageMemoryInfo_array_win64_to_host(struct conversion_context *ctx, const VkBindImageMemoryInfo *in, uint32_t count) -{ - VkBindImageMemoryInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBindImageMemoryInfo_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkBindImageMemoryInfo *convert_VkBindImageMemoryInfo_array_win32_to_host(struct conversion_context *ctx, const VkBindImageMemoryInfo32 *in, uint32_t count) -{ - VkBindImageMemoryInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBindImageMemoryInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkBindVideoSessionMemoryInfoKHR_win64_to_host(const VkBindVideoSessionMemoryInfoKHR *in, VkBindVideoSessionMemoryInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->memoryBindIndex = in->memoryBindIndex; - out->memory = wine_device_memory_from_handle(in->memory)->host.device_memory; - out->memoryOffset = in->memoryOffset; - out->memorySize = in->memorySize; -} -#endif /* _WIN64 */ - -static inline void convert_VkBindVideoSessionMemoryInfoKHR_win32_to_host(const VkBindVideoSessionMemoryInfoKHR32 *in, VkBindVideoSessionMemoryInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->memoryBindIndex = in->memoryBindIndex; - out->memory = wine_device_memory_from_handle(in->memory)->host.device_memory; - out->memoryOffset = in->memoryOffset; - out->memorySize = in->memorySize; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline const VkBindVideoSessionMemoryInfoKHR *convert_VkBindVideoSessionMemoryInfoKHR_array_win64_to_host(struct conversion_context *ctx, const VkBindVideoSessionMemoryInfoKHR *in, uint32_t count) -{ - VkBindVideoSessionMemoryInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBindVideoSessionMemoryInfoKHR_win64_to_host(&in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkBindVideoSessionMemoryInfoKHR *convert_VkBindVideoSessionMemoryInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkBindVideoSessionMemoryInfoKHR32 *in, uint32_t count) -{ - VkBindVideoSessionMemoryInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBindVideoSessionMemoryInfoKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline const VkMicromapUsageEXT * const*convert_VkMicromapUsageEXT_pointer_array_win32_to_host(struct conversion_context *ctx, const PTR32 *in, uint32_t count) -{ - VkMicromapUsageEXT **out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = UlongToPtr(in[i]); - } - - return (void *)out; -} - -static inline void convert_VkAccelerationStructureGeometryTrianglesDataKHR_win32_to_host(struct conversion_context *ctx, const VkAccelerationStructureGeometryTrianglesDataKHR32 *in, VkAccelerationStructureGeometryTrianglesDataKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->vertexFormat = in->vertexFormat; - out->vertexData = in->vertexData; - out->vertexStride = in->vertexStride; - out->maxVertex = in->maxVertex; - out->indexType = in->indexType; - out->indexData = in->indexData; - out->transformData = in->transformData; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV: - { - VkAccelerationStructureGeometryMotionTrianglesDataNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkAccelerationStructureGeometryMotionTrianglesDataNV32 *in_ext = (const VkAccelerationStructureGeometryMotionTrianglesDataNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV; - out_ext->pNext = NULL; - out_ext->vertexData = in_ext->vertexData; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_OPACITY_MICROMAP_EXT: - { - VkAccelerationStructureTrianglesOpacityMicromapEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkAccelerationStructureTrianglesOpacityMicromapEXT32 *in_ext = (const VkAccelerationStructureTrianglesOpacityMicromapEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_OPACITY_MICROMAP_EXT; - out_ext->pNext = NULL; - out_ext->indexType = in_ext->indexType; - out_ext->indexBuffer = in_ext->indexBuffer; - out_ext->indexStride = in_ext->indexStride; - out_ext->baseTriangle = in_ext->baseTriangle; - out_ext->usageCountsCount = in_ext->usageCountsCount; - out_ext->pUsageCounts = UlongToPtr(in_ext->pUsageCounts); - out_ext->ppUsageCounts = convert_VkMicromapUsageEXT_pointer_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(in_ext->ppUsageCounts), in_ext->usageCountsCount); - out_ext->micromap = in_ext->micromap; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkAccelerationStructureGeometryAabbsDataKHR_win32_to_host(const VkAccelerationStructureGeometryAabbsDataKHR32 *in, VkAccelerationStructureGeometryAabbsDataKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->data = in->data; - out->stride = in->stride; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkAccelerationStructureGeometryInstancesDataKHR_win32_to_host(const VkAccelerationStructureGeometryInstancesDataKHR32 *in, VkAccelerationStructureGeometryInstancesDataKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->arrayOfPointers = in->arrayOfPointers; - out->data = in->data; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkAccelerationStructureGeometryDataKHR_win32_to_host(struct conversion_context *ctx, const VkAccelerationStructureGeometryDataKHR32 *in, VkAccelerationStructureGeometryDataKHR *out, VkFlags selector) -{ - if (!in) return; - - if (selector == VK_GEOMETRY_TYPE_TRIANGLES_KHR) - convert_VkAccelerationStructureGeometryTrianglesDataKHR_win32_to_host(ctx, &in->triangles, &out->triangles); - if (selector == VK_GEOMETRY_TYPE_AABBS_KHR) - convert_VkAccelerationStructureGeometryAabbsDataKHR_win32_to_host(&in->aabbs, &out->aabbs); - if (selector == VK_GEOMETRY_TYPE_INSTANCES_KHR) - convert_VkAccelerationStructureGeometryInstancesDataKHR_win32_to_host(&in->instances, &out->instances); -} - -static inline void convert_VkAccelerationStructureGeometryKHR_win32_to_host(struct conversion_context *ctx, const VkAccelerationStructureGeometryKHR32 *in, VkAccelerationStructureGeometryKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->geometryType = in->geometryType; - convert_VkAccelerationStructureGeometryDataKHR_win32_to_host(ctx, &in->geometry, &out->geometry, in->geometryType); - out->flags = in->flags; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkAccelerationStructureGeometryKHR *convert_VkAccelerationStructureGeometryKHR_array_win32_to_host(struct conversion_context *ctx, const VkAccelerationStructureGeometryKHR32 *in, uint32_t count) -{ - VkAccelerationStructureGeometryKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkAccelerationStructureGeometryKHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline const VkAccelerationStructureGeometryKHR * const*convert_VkAccelerationStructureGeometryKHR_pointer_array_win32_to_host(struct conversion_context *ctx, const PTR32 *in, uint32_t count) -{ - VkAccelerationStructureGeometryKHR **out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - if (in[i]) - { - out[i] = conversion_context_alloc(ctx, sizeof(*out[i])); - convert_VkAccelerationStructureGeometryKHR_win32_to_host(ctx, (VkAccelerationStructureGeometryKHR32 *)UlongToPtr(in[i]), out[i]); - } - else - out[i] = NULL; - } - - return (void *)out; -} - -static inline void convert_VkAccelerationStructureBuildGeometryInfoKHR_win32_to_host(struct conversion_context *ctx, const VkAccelerationStructureBuildGeometryInfoKHR32 *in, VkAccelerationStructureBuildGeometryInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - out->flags = in->flags; - out->mode = in->mode; - out->srcAccelerationStructure = in->srcAccelerationStructure; - out->dstAccelerationStructure = in->dstAccelerationStructure; - out->geometryCount = in->geometryCount; - out->pGeometries = convert_VkAccelerationStructureGeometryKHR_array_win32_to_host(ctx, (const VkAccelerationStructureGeometryKHR32 *)UlongToPtr(in->pGeometries), in->geometryCount); - out->ppGeometries = convert_VkAccelerationStructureGeometryKHR_pointer_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(in->ppGeometries), in->geometryCount); - out->scratchData = in->scratchData; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkAccelerationStructureBuildGeometryInfoKHR *convert_VkAccelerationStructureBuildGeometryInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkAccelerationStructureBuildGeometryInfoKHR32 *in, uint32_t count) -{ - VkAccelerationStructureBuildGeometryInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkAccelerationStructureBuildGeometryInfoKHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline const VkAccelerationStructureBuildRangeInfoKHR * const*convert_VkAccelerationStructureBuildRangeInfoKHR_array_win32_to_host(struct conversion_context *ctx, const PTR32 *in, uint32_t count) -{ - VkAccelerationStructureBuildRangeInfoKHR **out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = UlongToPtr(in[i]); - } - - return (void *)out; -} - -static inline void convert_VkMicromapBuildInfoEXT_win32_to_host(struct conversion_context *ctx, const VkMicromapBuildInfoEXT32 *in, VkMicromapBuildInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - out->flags = in->flags; - out->mode = in->mode; - out->dstMicromap = in->dstMicromap; - out->usageCountsCount = in->usageCountsCount; - out->pUsageCounts = UlongToPtr(in->pUsageCounts); - out->ppUsageCounts = convert_VkMicromapUsageEXT_pointer_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(in->ppUsageCounts), in->usageCountsCount); - out->data = in->data; - out->scratchData = in->scratchData; - out->triangleArray = in->triangleArray; - out->triangleArrayStride = in->triangleArrayStride; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkMicromapBuildInfoEXT *convert_VkMicromapBuildInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkMicromapBuildInfoEXT32 *in, uint32_t count) -{ - VkMicromapBuildInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkMicromapBuildInfoEXT_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkConditionalRenderingBeginInfoEXT_win32_to_host(const VkConditionalRenderingBeginInfoEXT32 *in, VkConditionalRenderingBeginInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->buffer = in->buffer; - out->offset = in->offset; - out->flags = in->flags; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDebugUtilsLabelEXT_win32_to_host(const VkDebugUtilsLabelEXT32 *in, VkDebugUtilsLabelEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pLabelName = UlongToPtr(in->pLabelName); - memcpy(out->color, in->color, 4 * sizeof(float)); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkSampleLocationsInfoEXT_win32_to_host(const VkSampleLocationsInfoEXT32 *in, VkSampleLocationsInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->sampleLocationsPerPixel = in->sampleLocationsPerPixel; - out->sampleLocationGridSize = in->sampleLocationGridSize; - out->sampleLocationsCount = in->sampleLocationsCount; - out->pSampleLocations = UlongToPtr(in->pSampleLocations); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkAttachmentSampleLocationsEXT_win32_to_host(const VkAttachmentSampleLocationsEXT32 *in, VkAttachmentSampleLocationsEXT *out) -{ - if (!in) return; - - out->attachmentIndex = in->attachmentIndex; - convert_VkSampleLocationsInfoEXT_win32_to_host(&in->sampleLocationsInfo, &out->sampleLocationsInfo); -} - -static inline const VkAttachmentSampleLocationsEXT *convert_VkAttachmentSampleLocationsEXT_array_win32_to_host(struct conversion_context *ctx, const VkAttachmentSampleLocationsEXT32 *in, uint32_t count) -{ - VkAttachmentSampleLocationsEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkAttachmentSampleLocationsEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSubpassSampleLocationsEXT_win32_to_host(const VkSubpassSampleLocationsEXT32 *in, VkSubpassSampleLocationsEXT *out) -{ - if (!in) return; - - out->subpassIndex = in->subpassIndex; - convert_VkSampleLocationsInfoEXT_win32_to_host(&in->sampleLocationsInfo, &out->sampleLocationsInfo); -} - -static inline const VkSubpassSampleLocationsEXT *convert_VkSubpassSampleLocationsEXT_array_win32_to_host(struct conversion_context *ctx, const VkSubpassSampleLocationsEXT32 *in, uint32_t count) -{ - VkSubpassSampleLocationsEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSubpassSampleLocationsEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkRenderPassStripeInfoARM_win32_to_host(const VkRenderPassStripeInfoARM32 *in, VkRenderPassStripeInfoARM *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->stripeArea = in->stripeArea; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkRenderPassStripeInfoARM *convert_VkRenderPassStripeInfoARM_array_win32_to_host(struct conversion_context *ctx, const VkRenderPassStripeInfoARM32 *in, uint32_t count) -{ - VkRenderPassStripeInfoARM *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkRenderPassStripeInfoARM_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkRenderPassBeginInfo_win32_to_host(struct conversion_context *ctx, const VkRenderPassBeginInfo32 *in, VkRenderPassBeginInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->renderPass = in->renderPass; - out->framebuffer = in->framebuffer; - out->renderArea = in->renderArea; - out->clearValueCount = in->clearValueCount; - out->pClearValues = UlongToPtr(in->pClearValues); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: - { - VkDeviceGroupRenderPassBeginInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceGroupRenderPassBeginInfo32 *in_ext = (const VkDeviceGroupRenderPassBeginInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO; - out_ext->pNext = NULL; - out_ext->deviceMask = in_ext->deviceMask; - out_ext->deviceRenderAreaCount = in_ext->deviceRenderAreaCount; - out_ext->pDeviceRenderAreas = UlongToPtr(in_ext->pDeviceRenderAreas); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT: - { - VkRenderPassSampleLocationsBeginInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassSampleLocationsBeginInfoEXT32 *in_ext = (const VkRenderPassSampleLocationsBeginInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT; - out_ext->pNext = NULL; - out_ext->attachmentInitialSampleLocationsCount = in_ext->attachmentInitialSampleLocationsCount; - out_ext->pAttachmentInitialSampleLocations = convert_VkAttachmentSampleLocationsEXT_array_win32_to_host(ctx, (const VkAttachmentSampleLocationsEXT32 *)UlongToPtr(in_ext->pAttachmentInitialSampleLocations), in_ext->attachmentInitialSampleLocationsCount); - out_ext->postSubpassSampleLocationsCount = in_ext->postSubpassSampleLocationsCount; - out_ext->pPostSubpassSampleLocations = convert_VkSubpassSampleLocationsEXT_array_win32_to_host(ctx, (const VkSubpassSampleLocationsEXT32 *)UlongToPtr(in_ext->pPostSubpassSampleLocations), in_ext->postSubpassSampleLocationsCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO: - { - VkRenderPassAttachmentBeginInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassAttachmentBeginInfo32 *in_ext = (const VkRenderPassAttachmentBeginInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO; - out_ext->pNext = NULL; - out_ext->attachmentCount = in_ext->attachmentCount; - out_ext->pAttachments = UlongToPtr(in_ext->pAttachments); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM: - { - VkRenderPassTransformBeginInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassTransformBeginInfoQCOM32 *in_ext = (const VkRenderPassTransformBeginInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->transform = in_ext->transform; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM: - { - VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM32 *in_ext = (const VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->perViewRenderAreaCount = in_ext->perViewRenderAreaCount; - out_ext->pPerViewRenderAreas = UlongToPtr(in_ext->pPerViewRenderAreas); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_BEGIN_INFO_ARM: - { - VkRenderPassStripeBeginInfoARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassStripeBeginInfoARM32 *in_ext = (const VkRenderPassStripeBeginInfoARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_BEGIN_INFO_ARM; - out_ext->pNext = NULL; - out_ext->stripeInfoCount = in_ext->stripeInfoCount; - out_ext->pStripeInfos = convert_VkRenderPassStripeInfoARM_array_win32_to_host(ctx, (const VkRenderPassStripeInfoARM32 *)UlongToPtr(in_ext->pStripeInfos), in_ext->stripeInfoCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSubpassBeginInfo_win32_to_host(const VkSubpassBeginInfo32 *in, VkSubpassBeginInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->contents = in->contents; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkRenderingAttachmentInfo_win32_to_host(const VkRenderingAttachmentInfo32 *in, VkRenderingAttachmentInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->imageView = in->imageView; - out->imageLayout = in->imageLayout; - out->resolveMode = in->resolveMode; - out->resolveImageView = in->resolveImageView; - out->resolveImageLayout = in->resolveImageLayout; - out->loadOp = in->loadOp; - out->storeOp = in->storeOp; - out->clearValue = in->clearValue; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkRenderingAttachmentInfo *convert_VkRenderingAttachmentInfo_array_win32_to_host(struct conversion_context *ctx, const VkRenderingAttachmentInfo32 *in, uint32_t count) -{ - VkRenderingAttachmentInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkRenderingAttachmentInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkRenderingInfo_win32_to_host(struct conversion_context *ctx, const VkRenderingInfo32 *in, VkRenderingInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->renderArea = in->renderArea; - out->layerCount = in->layerCount; - out->viewMask = in->viewMask; - out->colorAttachmentCount = in->colorAttachmentCount; - out->pColorAttachments = convert_VkRenderingAttachmentInfo_array_win32_to_host(ctx, (const VkRenderingAttachmentInfo32 *)UlongToPtr(in->pColorAttachments), in->colorAttachmentCount); - out->pDepthAttachment = convert_VkRenderingAttachmentInfo_array_win32_to_host(ctx, (const VkRenderingAttachmentInfo32 *)UlongToPtr(in->pDepthAttachment), 1); - out->pStencilAttachment = convert_VkRenderingAttachmentInfo_array_win32_to_host(ctx, (const VkRenderingAttachmentInfo32 *)UlongToPtr(in->pStencilAttachment), 1); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: - { - VkDeviceGroupRenderPassBeginInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceGroupRenderPassBeginInfo32 *in_ext = (const VkDeviceGroupRenderPassBeginInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO; - out_ext->pNext = NULL; - out_ext->deviceMask = in_ext->deviceMask; - out_ext->deviceRenderAreaCount = in_ext->deviceRenderAreaCount; - out_ext->pDeviceRenderAreas = UlongToPtr(in_ext->pDeviceRenderAreas); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT: - { - VkMultisampledRenderToSingleSampledInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMultisampledRenderToSingleSampledInfoEXT32 *in_ext = (const VkMultisampledRenderToSingleSampledInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT; - out_ext->pNext = NULL; - out_ext->multisampledRenderToSingleSampledEnable = in_ext->multisampledRenderToSingleSampledEnable; - out_ext->rasterizationSamples = in_ext->rasterizationSamples; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: - { - VkRenderingFragmentShadingRateAttachmentInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderingFragmentShadingRateAttachmentInfoKHR32 *in_ext = (const VkRenderingFragmentShadingRateAttachmentInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR; - out_ext->pNext = NULL; - out_ext->imageView = in_ext->imageView; - out_ext->imageLayout = in_ext->imageLayout; - out_ext->shadingRateAttachmentTexelSize = in_ext->shadingRateAttachmentTexelSize; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT: - { - VkRenderingFragmentDensityMapAttachmentInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderingFragmentDensityMapAttachmentInfoEXT32 *in_ext = (const VkRenderingFragmentDensityMapAttachmentInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT; - out_ext->pNext = NULL; - out_ext->imageView = in_ext->imageView; - out_ext->imageLayout = in_ext->imageLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM: - { - VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM32 *in_ext = (const VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->perViewRenderAreaCount = in_ext->perViewRenderAreaCount; - out_ext->pPerViewRenderAreas = UlongToPtr(in_ext->pPerViewRenderAreas); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_BEGIN_INFO_ARM: - { - VkRenderPassStripeBeginInfoARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassStripeBeginInfoARM32 *in_ext = (const VkRenderPassStripeBeginInfoARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_BEGIN_INFO_ARM; - out_ext->pNext = NULL; - out_ext->stripeInfoCount = in_ext->stripeInfoCount; - out_ext->pStripeInfos = convert_VkRenderPassStripeInfoARM_array_win32_to_host(ctx, (const VkRenderPassStripeInfoARM32 *)UlongToPtr(in_ext->pStripeInfos), in_ext->stripeInfoCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkVideoEncodeRateControlLayerInfoKHR_win32_to_host(struct conversion_context *ctx, const VkVideoEncodeRateControlLayerInfoKHR32 *in, VkVideoEncodeRateControlLayerInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->averageBitrate = in->averageBitrate; - out->maxBitrate = in->maxBitrate; - out->frameRateNumerator = in->frameRateNumerator; - out->frameRateDenominator = in->frameRateDenominator; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_KHR: - { - VkVideoEncodeH264RateControlLayerInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH264RateControlLayerInfoKHR32 *in_ext = (const VkVideoEncodeH264RateControlLayerInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_KHR; - out_ext->pNext = NULL; - out_ext->useMinQp = in_ext->useMinQp; - out_ext->minQp = in_ext->minQp; - out_ext->useMaxQp = in_ext->useMaxQp; - out_ext->maxQp = in_ext->maxQp; - out_ext->useMaxFrameSize = in_ext->useMaxFrameSize; - out_ext->maxFrameSize = in_ext->maxFrameSize; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_KHR: - { - VkVideoEncodeH265RateControlLayerInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH265RateControlLayerInfoKHR32 *in_ext = (const VkVideoEncodeH265RateControlLayerInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_KHR; - out_ext->pNext = NULL; - out_ext->useMinQp = in_ext->useMinQp; - out_ext->minQp = in_ext->minQp; - out_ext->useMaxQp = in_ext->useMaxQp; - out_ext->maxQp = in_ext->maxQp; - out_ext->useMaxFrameSize = in_ext->useMaxFrameSize; - out_ext->maxFrameSize = in_ext->maxFrameSize; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_RATE_CONTROL_LAYER_INFO_KHR: - { - VkVideoEncodeAV1RateControlLayerInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeAV1RateControlLayerInfoKHR32 *in_ext = (const VkVideoEncodeAV1RateControlLayerInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_RATE_CONTROL_LAYER_INFO_KHR; - out_ext->pNext = NULL; - out_ext->useMinQIndex = in_ext->useMinQIndex; - out_ext->minQIndex = in_ext->minQIndex; - out_ext->useMaxQIndex = in_ext->useMaxQIndex; - out_ext->maxQIndex = in_ext->maxQIndex; - out_ext->useMaxFrameSize = in_ext->useMaxFrameSize; - out_ext->maxFrameSize = in_ext->maxFrameSize; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkVideoEncodeRateControlLayerInfoKHR *convert_VkVideoEncodeRateControlLayerInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkVideoEncodeRateControlLayerInfoKHR32 *in, uint32_t count) -{ - VkVideoEncodeRateControlLayerInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkVideoEncodeRateControlLayerInfoKHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_StdVideoEncodeAV1ReferenceInfo_win32_to_host(const StdVideoEncodeAV1ReferenceInfo32 *in, StdVideoEncodeAV1ReferenceInfo *out) -{ - if (!in) return; - - out->flags = in->flags; - out->RefFrameId = in->RefFrameId; - out->frame_type = in->frame_type; - out->OrderHint = in->OrderHint; - memcpy(out->reserved1, in->reserved1, 3 * sizeof(uint8_t)); - out->pExtensionHeader = UlongToPtr(in->pExtensionHeader); -} - -static inline const StdVideoEncodeAV1ReferenceInfo *convert_StdVideoEncodeAV1ReferenceInfo_array_win32_to_host(struct conversion_context *ctx, const StdVideoEncodeAV1ReferenceInfo32 *in, uint32_t count) -{ - StdVideoEncodeAV1ReferenceInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_StdVideoEncodeAV1ReferenceInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkVideoPictureResourceInfoKHR_win32_to_host(const VkVideoPictureResourceInfoKHR32 *in, VkVideoPictureResourceInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->codedOffset = in->codedOffset; - out->codedExtent = in->codedExtent; - out->baseArrayLayer = in->baseArrayLayer; - out->imageViewBinding = in->imageViewBinding; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkVideoPictureResourceInfoKHR *convert_VkVideoPictureResourceInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkVideoPictureResourceInfoKHR32 *in, uint32_t count) -{ - VkVideoPictureResourceInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkVideoPictureResourceInfoKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkVideoReferenceSlotInfoKHR_win32_to_host(struct conversion_context *ctx, const VkVideoReferenceSlotInfoKHR32 *in, VkVideoReferenceSlotInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->slotIndex = in->slotIndex; - out->pPictureResource = convert_VkVideoPictureResourceInfoKHR_array_win32_to_host(ctx, (const VkVideoPictureResourceInfoKHR32 *)UlongToPtr(in->pPictureResource), 1); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_KHR: - { - VkVideoDecodeH264DpbSlotInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeH264DpbSlotInfoKHR32 *in_ext = (const VkVideoDecodeH264DpbSlotInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_KHR; - out_ext->pNext = NULL; - out_ext->pStdReferenceInfo = UlongToPtr(in_ext->pStdReferenceInfo); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_KHR: - { - VkVideoDecodeH265DpbSlotInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeH265DpbSlotInfoKHR32 *in_ext = (const VkVideoDecodeH265DpbSlotInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_KHR; - out_ext->pNext = NULL; - out_ext->pStdReferenceInfo = UlongToPtr(in_ext->pStdReferenceInfo); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_DPB_SLOT_INFO_KHR: - { - VkVideoDecodeAV1DpbSlotInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeAV1DpbSlotInfoKHR32 *in_ext = (const VkVideoDecodeAV1DpbSlotInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_DPB_SLOT_INFO_KHR; - out_ext->pNext = NULL; - out_ext->pStdReferenceInfo = UlongToPtr(in_ext->pStdReferenceInfo); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_KHR: - { - VkVideoEncodeH264DpbSlotInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH264DpbSlotInfoKHR32 *in_ext = (const VkVideoEncodeH264DpbSlotInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_KHR; - out_ext->pNext = NULL; - out_ext->pStdReferenceInfo = UlongToPtr(in_ext->pStdReferenceInfo); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_KHR: - { - VkVideoEncodeH265DpbSlotInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH265DpbSlotInfoKHR32 *in_ext = (const VkVideoEncodeH265DpbSlotInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_KHR; - out_ext->pNext = NULL; - out_ext->pStdReferenceInfo = UlongToPtr(in_ext->pStdReferenceInfo); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_DPB_SLOT_INFO_KHR: - { - VkVideoEncodeAV1DpbSlotInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeAV1DpbSlotInfoKHR32 *in_ext = (const VkVideoEncodeAV1DpbSlotInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_DPB_SLOT_INFO_KHR; - out_ext->pNext = NULL; - out_ext->pStdReferenceInfo = convert_StdVideoEncodeAV1ReferenceInfo_array_win32_to_host(ctx, (const StdVideoEncodeAV1ReferenceInfo32 *)UlongToPtr(in_ext->pStdReferenceInfo), 1); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkVideoReferenceSlotInfoKHR *convert_VkVideoReferenceSlotInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkVideoReferenceSlotInfoKHR32 *in, uint32_t count) -{ - VkVideoReferenceSlotInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkVideoReferenceSlotInfoKHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkVideoBeginCodingInfoKHR_win32_to_host(struct conversion_context *ctx, const VkVideoBeginCodingInfoKHR32 *in, VkVideoBeginCodingInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->videoSession = in->videoSession; - out->videoSessionParameters = in->videoSessionParameters; - out->referenceSlotCount = in->referenceSlotCount; - out->pReferenceSlots = convert_VkVideoReferenceSlotInfoKHR_array_win32_to_host(ctx, (const VkVideoReferenceSlotInfoKHR32 *)UlongToPtr(in->pReferenceSlots), in->referenceSlotCount); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR: - { - VkVideoEncodeRateControlInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeRateControlInfoKHR32 *in_ext = (const VkVideoEncodeRateControlInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->rateControlMode = in_ext->rateControlMode; - out_ext->layerCount = in_ext->layerCount; - out_ext->pLayers = convert_VkVideoEncodeRateControlLayerInfoKHR_array_win32_to_host(ctx, (const VkVideoEncodeRateControlLayerInfoKHR32 *)UlongToPtr(in_ext->pLayers), in_ext->layerCount); - out_ext->virtualBufferSizeInMs = in_ext->virtualBufferSizeInMs; - out_ext->initialVirtualBufferSizeInMs = in_ext->initialVirtualBufferSizeInMs; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_INFO_KHR: - { - VkVideoEncodeH264RateControlInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH264RateControlInfoKHR32 *in_ext = (const VkVideoEncodeH264RateControlInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_INFO_KHR; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->gopFrameCount = in_ext->gopFrameCount; - out_ext->idrPeriod = in_ext->idrPeriod; - out_ext->consecutiveBFrameCount = in_ext->consecutiveBFrameCount; - out_ext->temporalLayerCount = in_ext->temporalLayerCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_GOP_REMAINING_FRAME_INFO_KHR: - { - VkVideoEncodeH264GopRemainingFrameInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH264GopRemainingFrameInfoKHR32 *in_ext = (const VkVideoEncodeH264GopRemainingFrameInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_GOP_REMAINING_FRAME_INFO_KHR; - out_ext->pNext = NULL; - out_ext->useGopRemainingFrames = in_ext->useGopRemainingFrames; - out_ext->gopRemainingI = in_ext->gopRemainingI; - out_ext->gopRemainingP = in_ext->gopRemainingP; - out_ext->gopRemainingB = in_ext->gopRemainingB; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_INFO_KHR: - { - VkVideoEncodeH265RateControlInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH265RateControlInfoKHR32 *in_ext = (const VkVideoEncodeH265RateControlInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_INFO_KHR; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->gopFrameCount = in_ext->gopFrameCount; - out_ext->idrPeriod = in_ext->idrPeriod; - out_ext->consecutiveBFrameCount = in_ext->consecutiveBFrameCount; - out_ext->subLayerCount = in_ext->subLayerCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_GOP_REMAINING_FRAME_INFO_KHR: - { - VkVideoEncodeH265GopRemainingFrameInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH265GopRemainingFrameInfoKHR32 *in_ext = (const VkVideoEncodeH265GopRemainingFrameInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_GOP_REMAINING_FRAME_INFO_KHR; - out_ext->pNext = NULL; - out_ext->useGopRemainingFrames = in_ext->useGopRemainingFrames; - out_ext->gopRemainingI = in_ext->gopRemainingI; - out_ext->gopRemainingP = in_ext->gopRemainingP; - out_ext->gopRemainingB = in_ext->gopRemainingB; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_RATE_CONTROL_INFO_KHR: - { - VkVideoEncodeAV1RateControlInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeAV1RateControlInfoKHR32 *in_ext = (const VkVideoEncodeAV1RateControlInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_RATE_CONTROL_INFO_KHR; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->gopFrameCount = in_ext->gopFrameCount; - out_ext->keyFramePeriod = in_ext->keyFramePeriod; - out_ext->consecutiveBipredictiveFrameCount = in_ext->consecutiveBipredictiveFrameCount; - out_ext->temporalLayerCount = in_ext->temporalLayerCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_GOP_REMAINING_FRAME_INFO_KHR: - { - VkVideoEncodeAV1GopRemainingFrameInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeAV1GopRemainingFrameInfoKHR32 *in_ext = (const VkVideoEncodeAV1GopRemainingFrameInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_GOP_REMAINING_FRAME_INFO_KHR; - out_ext->pNext = NULL; - out_ext->useGopRemainingFrames = in_ext->useGopRemainingFrames; - out_ext->gopRemainingIntra = in_ext->gopRemainingIntra; - out_ext->gopRemainingPredictive = in_ext->gopRemainingPredictive; - out_ext->gopRemainingBipredictive = in_ext->gopRemainingBipredictive; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkBindDescriptorBufferEmbeddedSamplersInfoEXT_win32_to_host(struct conversion_context *ctx, const VkBindDescriptorBufferEmbeddedSamplersInfoEXT32 *in, VkBindDescriptorBufferEmbeddedSamplersInfoEXT *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->stageFlags = in->stageFlags; - out->layout = in->layout; - out->set = in->set; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO: - { - VkPipelineLayoutCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineLayoutCreateInfo32 *in_ext = (const VkPipelineLayoutCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->setLayoutCount = in_ext->setLayoutCount; - out_ext->pSetLayouts = UlongToPtr(in_ext->pSetLayouts); - out_ext->pushConstantRangeCount = in_ext->pushConstantRangeCount; - out_ext->pPushConstantRanges = UlongToPtr(in_ext->pPushConstantRanges); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkDescriptorBufferBindingInfoEXT_win32_to_host(struct conversion_context *ctx, const VkDescriptorBufferBindingInfoEXT32 *in, VkDescriptorBufferBindingInfoEXT *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->address = in->address; - out->usage = in->usage; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO: - { - VkBufferUsageFlags2CreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBufferUsageFlags2CreateInfo32 *in_ext = (const VkBufferUsageFlags2CreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->usage = in_ext->usage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_PUSH_DESCRIPTOR_BUFFER_HANDLE_EXT: - { - VkDescriptorBufferBindingPushDescriptorBufferHandleEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDescriptorBufferBindingPushDescriptorBufferHandleEXT32 *in_ext = (const VkDescriptorBufferBindingPushDescriptorBufferHandleEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_PUSH_DESCRIPTOR_BUFFER_HANDLE_EXT; - out_ext->pNext = NULL; - out_ext->buffer = in_ext->buffer; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkDescriptorBufferBindingInfoEXT *convert_VkDescriptorBufferBindingInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkDescriptorBufferBindingInfoEXT32 *in, uint32_t count) -{ - VkDescriptorBufferBindingInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDescriptorBufferBindingInfoEXT_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkBindDescriptorSetsInfo_win32_to_host(struct conversion_context *ctx, const VkBindDescriptorSetsInfo32 *in, VkBindDescriptorSetsInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->stageFlags = in->stageFlags; - out->layout = in->layout; - out->firstSet = in->firstSet; - out->descriptorSetCount = in->descriptorSetCount; - out->pDescriptorSets = UlongToPtr(in->pDescriptorSets); - out->dynamicOffsetCount = in->dynamicOffsetCount; - out->pDynamicOffsets = UlongToPtr(in->pDynamicOffsets); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO: - { - VkPipelineLayoutCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineLayoutCreateInfo32 *in_ext = (const VkPipelineLayoutCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->setLayoutCount = in_ext->setLayoutCount; - out_ext->pSetLayouts = UlongToPtr(in_ext->pSetLayouts); - out_ext->pushConstantRangeCount = in_ext->pushConstantRangeCount; - out_ext->pPushConstantRanges = UlongToPtr(in_ext->pPushConstantRanges); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkImageBlit2_win32_to_host(struct conversion_context *ctx, const VkImageBlit232 *in, VkImageBlit2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcSubresource = in->srcSubresource; - memcpy(out->srcOffsets, in->srcOffsets, 2 * sizeof(VkOffset3D)); - out->dstSubresource = in->dstSubresource; - memcpy(out->dstOffsets, in->dstOffsets, 2 * sizeof(VkOffset3D)); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM: - { - VkCopyCommandTransformInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkCopyCommandTransformInfoQCOM32 *in_ext = (const VkCopyCommandTransformInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->transform = in_ext->transform; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkImageBlit2 *convert_VkImageBlit2_array_win32_to_host(struct conversion_context *ctx, const VkImageBlit232 *in, uint32_t count) -{ - VkImageBlit2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkImageBlit2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkBlitImageInfo2_win32_to_host(struct conversion_context *ctx, const VkBlitImageInfo232 *in, VkBlitImageInfo2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcImage = in->srcImage; - out->srcImageLayout = in->srcImageLayout; - out->dstImage = in->dstImage; - out->dstImageLayout = in->dstImageLayout; - out->regionCount = in->regionCount; - out->pRegions = convert_VkImageBlit2_array_win32_to_host(ctx, (const VkImageBlit232 *)UlongToPtr(in->pRegions), in->regionCount); - out->filter = in->filter; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_BLIT_IMAGE_CUBIC_WEIGHTS_INFO_QCOM: - { - VkBlitImageCubicWeightsInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBlitImageCubicWeightsInfoQCOM32 *in_ext = (const VkBlitImageCubicWeightsInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BLIT_IMAGE_CUBIC_WEIGHTS_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->cubicWeights = in_ext->cubicWeights; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkGeometryTrianglesNV_win32_to_host(const VkGeometryTrianglesNV32 *in, VkGeometryTrianglesNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->vertexData = in->vertexData; - out->vertexOffset = in->vertexOffset; - out->vertexCount = in->vertexCount; - out->vertexStride = in->vertexStride; - out->vertexFormat = in->vertexFormat; - out->indexData = in->indexData; - out->indexOffset = in->indexOffset; - out->indexCount = in->indexCount; - out->indexType = in->indexType; - out->transformData = in->transformData; - out->transformOffset = in->transformOffset; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkGeometryAABBNV_win32_to_host(const VkGeometryAABBNV32 *in, VkGeometryAABBNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->aabbData = in->aabbData; - out->numAABBs = in->numAABBs; - out->stride = in->stride; - out->offset = in->offset; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkGeometryDataNV_win32_to_host(const VkGeometryDataNV32 *in, VkGeometryDataNV *out) -{ - if (!in) return; - - convert_VkGeometryTrianglesNV_win32_to_host(&in->triangles, &out->triangles); - convert_VkGeometryAABBNV_win32_to_host(&in->aabbs, &out->aabbs); -} - -static inline void convert_VkGeometryNV_win32_to_host(const VkGeometryNV32 *in, VkGeometryNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->geometryType = in->geometryType; - convert_VkGeometryDataNV_win32_to_host(&in->geometry, &out->geometry); - out->flags = in->flags; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkGeometryNV *convert_VkGeometryNV_array_win32_to_host(struct conversion_context *ctx, const VkGeometryNV32 *in, uint32_t count) -{ - VkGeometryNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkGeometryNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkAccelerationStructureInfoNV_win32_to_host(struct conversion_context *ctx, const VkAccelerationStructureInfoNV32 *in, VkAccelerationStructureInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - out->flags = in->flags; - out->instanceCount = in->instanceCount; - out->geometryCount = in->geometryCount; - out->pGeometries = convert_VkGeometryNV_array_win32_to_host(ctx, (const VkGeometryNV32 *)UlongToPtr(in->pGeometries), in->geometryCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const uint32_t * const*convert_uint32_t_array_win32_to_host(struct conversion_context *ctx, const PTR32 *in, uint32_t count) -{ - uint32_t **out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = UlongToPtr(in[i]); - } - - return (void *)out; -} - -static inline void convert_uint32_t_array_host_to_win32(const uint32_t * const*in, PTR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - out[i] = PtrToUlong(in[i]); - } -} - -static inline void convert_VkVideoCodingControlInfoKHR_win32_to_host(struct conversion_context *ctx, const VkVideoCodingControlInfoKHR32 *in, VkVideoCodingControlInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_INFO_KHR: - { - VkVideoEncodeQualityLevelInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeQualityLevelInfoKHR32 *in_ext = (const VkVideoEncodeQualityLevelInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_INFO_KHR; - out_ext->pNext = NULL; - out_ext->qualityLevel = in_ext->qualityLevel; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR: - { - VkVideoEncodeRateControlInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeRateControlInfoKHR32 *in_ext = (const VkVideoEncodeRateControlInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->rateControlMode = in_ext->rateControlMode; - out_ext->layerCount = in_ext->layerCount; - out_ext->pLayers = convert_VkVideoEncodeRateControlLayerInfoKHR_array_win32_to_host(ctx, (const VkVideoEncodeRateControlLayerInfoKHR32 *)UlongToPtr(in_ext->pLayers), in_ext->layerCount); - out_ext->virtualBufferSizeInMs = in_ext->virtualBufferSizeInMs; - out_ext->initialVirtualBufferSizeInMs = in_ext->initialVirtualBufferSizeInMs; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_INFO_KHR: - { - VkVideoEncodeH264RateControlInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH264RateControlInfoKHR32 *in_ext = (const VkVideoEncodeH264RateControlInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_INFO_KHR; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->gopFrameCount = in_ext->gopFrameCount; - out_ext->idrPeriod = in_ext->idrPeriod; - out_ext->consecutiveBFrameCount = in_ext->consecutiveBFrameCount; - out_ext->temporalLayerCount = in_ext->temporalLayerCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_INFO_KHR: - { - VkVideoEncodeH265RateControlInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH265RateControlInfoKHR32 *in_ext = (const VkVideoEncodeH265RateControlInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_INFO_KHR; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->gopFrameCount = in_ext->gopFrameCount; - out_ext->idrPeriod = in_ext->idrPeriod; - out_ext->consecutiveBFrameCount = in_ext->consecutiveBFrameCount; - out_ext->subLayerCount = in_ext->subLayerCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_RATE_CONTROL_INFO_KHR: - { - VkVideoEncodeAV1RateControlInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeAV1RateControlInfoKHR32 *in_ext = (const VkVideoEncodeAV1RateControlInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_RATE_CONTROL_INFO_KHR; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->gopFrameCount = in_ext->gopFrameCount; - out_ext->keyFramePeriod = in_ext->keyFramePeriod; - out_ext->consecutiveBipredictiveFrameCount = in_ext->consecutiveBipredictiveFrameCount; - out_ext->temporalLayerCount = in_ext->temporalLayerCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkCopyAccelerationStructureInfoKHR_win32_to_host(const VkCopyAccelerationStructureInfoKHR32 *in, VkCopyAccelerationStructureInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->src = in->src; - out->dst = in->dst; - out->mode = in->mode; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCopyAccelerationStructureToMemoryInfoKHR_win32_to_host(const VkCopyAccelerationStructureToMemoryInfoKHR32 *in, VkCopyAccelerationStructureToMemoryInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->src = in->src; - out->dst = in->dst; - out->mode = in->mode; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkBufferCopy_win32_to_host(const VkBufferCopy32 *in, VkBufferCopy *out) -{ - if (!in) return; - - out->srcOffset = in->srcOffset; - out->dstOffset = in->dstOffset; - out->size = in->size; -} - -static inline const VkBufferCopy *convert_VkBufferCopy_array_win32_to_host(struct conversion_context *ctx, const VkBufferCopy32 *in, uint32_t count) -{ - VkBufferCopy *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBufferCopy_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkBufferCopy2_win32_to_host(const VkBufferCopy232 *in, VkBufferCopy2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcOffset = in->srcOffset; - out->dstOffset = in->dstOffset; - out->size = in->size; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkBufferCopy2 *convert_VkBufferCopy2_array_win32_to_host(struct conversion_context *ctx, const VkBufferCopy232 *in, uint32_t count) -{ - VkBufferCopy2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBufferCopy2_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCopyBufferInfo2_win32_to_host(struct conversion_context *ctx, const VkCopyBufferInfo232 *in, VkCopyBufferInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcBuffer = in->srcBuffer; - out->dstBuffer = in->dstBuffer; - out->regionCount = in->regionCount; - out->pRegions = convert_VkBufferCopy2_array_win32_to_host(ctx, (const VkBufferCopy232 *)UlongToPtr(in->pRegions), in->regionCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkBufferImageCopy_win32_to_host(const VkBufferImageCopy32 *in, VkBufferImageCopy *out) -{ - if (!in) return; - - out->bufferOffset = in->bufferOffset; - out->bufferRowLength = in->bufferRowLength; - out->bufferImageHeight = in->bufferImageHeight; - out->imageSubresource = in->imageSubresource; - out->imageOffset = in->imageOffset; - out->imageExtent = in->imageExtent; -} - -static inline const VkBufferImageCopy *convert_VkBufferImageCopy_array_win32_to_host(struct conversion_context *ctx, const VkBufferImageCopy32 *in, uint32_t count) -{ - VkBufferImageCopy *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBufferImageCopy_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkBufferImageCopy2_win32_to_host(struct conversion_context *ctx, const VkBufferImageCopy232 *in, VkBufferImageCopy2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->bufferOffset = in->bufferOffset; - out->bufferRowLength = in->bufferRowLength; - out->bufferImageHeight = in->bufferImageHeight; - out->imageSubresource = in->imageSubresource; - out->imageOffset = in->imageOffset; - out->imageExtent = in->imageExtent; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM: - { - VkCopyCommandTransformInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkCopyCommandTransformInfoQCOM32 *in_ext = (const VkCopyCommandTransformInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->transform = in_ext->transform; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkBufferImageCopy2 *convert_VkBufferImageCopy2_array_win32_to_host(struct conversion_context *ctx, const VkBufferImageCopy232 *in, uint32_t count) -{ - VkBufferImageCopy2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBufferImageCopy2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCopyBufferToImageInfo2_win32_to_host(struct conversion_context *ctx, const VkCopyBufferToImageInfo232 *in, VkCopyBufferToImageInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcBuffer = in->srcBuffer; - out->dstImage = in->dstImage; - out->dstImageLayout = in->dstImageLayout; - out->regionCount = in->regionCount; - out->pRegions = convert_VkBufferImageCopy2_array_win32_to_host(ctx, (const VkBufferImageCopy232 *)UlongToPtr(in->pRegions), in->regionCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkImageCopy2_win32_to_host(const VkImageCopy232 *in, VkImageCopy2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcSubresource = in->srcSubresource; - out->srcOffset = in->srcOffset; - out->dstSubresource = in->dstSubresource; - out->dstOffset = in->dstOffset; - out->extent = in->extent; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkImageCopy2 *convert_VkImageCopy2_array_win32_to_host(struct conversion_context *ctx, const VkImageCopy232 *in, uint32_t count) -{ - VkImageCopy2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkImageCopy2_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCopyImageInfo2_win32_to_host(struct conversion_context *ctx, const VkCopyImageInfo232 *in, VkCopyImageInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcImage = in->srcImage; - out->srcImageLayout = in->srcImageLayout; - out->dstImage = in->dstImage; - out->dstImageLayout = in->dstImageLayout; - out->regionCount = in->regionCount; - out->pRegions = convert_VkImageCopy2_array_win32_to_host(ctx, (const VkImageCopy232 *)UlongToPtr(in->pRegions), in->regionCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCopyImageToBufferInfo2_win32_to_host(struct conversion_context *ctx, const VkCopyImageToBufferInfo232 *in, VkCopyImageToBufferInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcImage = in->srcImage; - out->srcImageLayout = in->srcImageLayout; - out->dstBuffer = in->dstBuffer; - out->regionCount = in->regionCount; - out->pRegions = convert_VkBufferImageCopy2_array_win32_to_host(ctx, (const VkBufferImageCopy232 *)UlongToPtr(in->pRegions), in->regionCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCopyMemoryToAccelerationStructureInfoKHR_win32_to_host(const VkCopyMemoryToAccelerationStructureInfoKHR32 *in, VkCopyMemoryToAccelerationStructureInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->src = in->src; - out->dst = in->dst; - out->mode = in->mode; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCopyMemoryToMicromapInfoEXT_win32_to_host(const VkCopyMemoryToMicromapInfoEXT32 *in, VkCopyMemoryToMicromapInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->src = in->src; - out->dst = in->dst; - out->mode = in->mode; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCopyMicromapInfoEXT_win32_to_host(const VkCopyMicromapInfoEXT32 *in, VkCopyMicromapInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->src = in->src; - out->dst = in->dst; - out->mode = in->mode; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCopyMicromapToMemoryInfoEXT_win32_to_host(const VkCopyMicromapToMemoryInfoEXT32 *in, VkCopyMicromapToMemoryInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->src = in->src; - out->dst = in->dst; - out->mode = in->mode; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCuLaunchInfoNVX_win32_to_host(const VkCuLaunchInfoNVX32 *in, VkCuLaunchInfoNVX *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->function = in->function; - out->gridDimX = in->gridDimX; - out->gridDimY = in->gridDimY; - out->gridDimZ = in->gridDimZ; - out->blockDimX = in->blockDimX; - out->blockDimY = in->blockDimY; - out->blockDimZ = in->blockDimZ; - out->sharedMemBytes = in->sharedMemBytes; - out->paramCount = in->paramCount; - out->pParams = UlongToPtr(in->pParams); - out->extraCount = in->extraCount; - out->pExtras = UlongToPtr(in->pExtras); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCudaLaunchInfoNV_win32_to_host(const VkCudaLaunchInfoNV32 *in, VkCudaLaunchInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->function = in->function; - out->gridDimX = in->gridDimX; - out->gridDimY = in->gridDimY; - out->gridDimZ = in->gridDimZ; - out->blockDimX = in->blockDimX; - out->blockDimY = in->blockDimY; - out->blockDimZ = in->blockDimZ; - out->sharedMemBytes = in->sharedMemBytes; - out->paramCount = in->paramCount; - out->pParams = UlongToPtr(in->pParams); - out->extraCount = in->extraCount; - out->pExtras = UlongToPtr(in->pExtras); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDebugMarkerMarkerInfoEXT_win32_to_host(const VkDebugMarkerMarkerInfoEXT32 *in, VkDebugMarkerMarkerInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pMarkerName = UlongToPtr(in->pMarkerName); - memcpy(out->color, in->color, 4 * sizeof(float)); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_StdVideoAV1TileInfo_win32_to_host(const StdVideoAV1TileInfo32 *in, StdVideoAV1TileInfo *out) -{ - if (!in) return; - - out->flags = in->flags; - out->TileCols = in->TileCols; - out->TileRows = in->TileRows; - out->context_update_tile_id = in->context_update_tile_id; - out->tile_size_bytes_minus_1 = in->tile_size_bytes_minus_1; - memcpy(out->reserved1, in->reserved1, 7 * sizeof(uint8_t)); - out->pMiColStarts = UlongToPtr(in->pMiColStarts); - out->pMiRowStarts = UlongToPtr(in->pMiRowStarts); - out->pWidthInSbsMinus1 = UlongToPtr(in->pWidthInSbsMinus1); - out->pHeightInSbsMinus1 = UlongToPtr(in->pHeightInSbsMinus1); -} - -static inline const StdVideoAV1TileInfo *convert_StdVideoAV1TileInfo_array_win32_to_host(struct conversion_context *ctx, const StdVideoAV1TileInfo32 *in, uint32_t count) -{ - StdVideoAV1TileInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_StdVideoAV1TileInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_StdVideoDecodeAV1PictureInfo_win32_to_host(struct conversion_context *ctx, const StdVideoDecodeAV1PictureInfo32 *in, StdVideoDecodeAV1PictureInfo *out) -{ - if (!in) return; - - out->flags = in->flags; - out->frame_type = in->frame_type; - out->current_frame_id = in->current_frame_id; - out->OrderHint = in->OrderHint; - out->primary_ref_frame = in->primary_ref_frame; - out->refresh_frame_flags = in->refresh_frame_flags; - out->reserved1 = in->reserved1; - out->interpolation_filter = in->interpolation_filter; - out->TxMode = in->TxMode; - out->delta_q_res = in->delta_q_res; - out->delta_lf_res = in->delta_lf_res; - memcpy(out->SkipModeFrame, in->SkipModeFrame, STD_VIDEO_AV1_SKIP_MODE_FRAMES * sizeof(uint8_t)); - out->coded_denom = in->coded_denom; - memcpy(out->reserved2, in->reserved2, 3 * sizeof(uint8_t)); - memcpy(out->OrderHints, in->OrderHints, STD_VIDEO_AV1_NUM_REF_FRAMES * sizeof(uint8_t)); - memcpy(out->expectedFrameId, in->expectedFrameId, STD_VIDEO_AV1_NUM_REF_FRAMES * sizeof(uint32_t)); - out->pTileInfo = convert_StdVideoAV1TileInfo_array_win32_to_host(ctx, (const StdVideoAV1TileInfo32 *)UlongToPtr(in->pTileInfo), 1); - out->pQuantization = UlongToPtr(in->pQuantization); - out->pSegmentation = UlongToPtr(in->pSegmentation); - out->pLoopFilter = UlongToPtr(in->pLoopFilter); - out->pCDEF = UlongToPtr(in->pCDEF); - out->pLoopRestoration = UlongToPtr(in->pLoopRestoration); - out->pGlobalMotion = UlongToPtr(in->pGlobalMotion); - out->pFilmGrain = UlongToPtr(in->pFilmGrain); -} - -static inline const StdVideoDecodeAV1PictureInfo *convert_StdVideoDecodeAV1PictureInfo_array_win32_to_host(struct conversion_context *ctx, const StdVideoDecodeAV1PictureInfo32 *in, uint32_t count) -{ - StdVideoDecodeAV1PictureInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_StdVideoDecodeAV1PictureInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkVideoDecodeInfoKHR_win32_to_host(struct conversion_context *ctx, const VkVideoDecodeInfoKHR32 *in, VkVideoDecodeInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->srcBuffer = in->srcBuffer; - out->srcBufferOffset = in->srcBufferOffset; - out->srcBufferRange = in->srcBufferRange; - convert_VkVideoPictureResourceInfoKHR_win32_to_host(&in->dstPictureResource, &out->dstPictureResource); - out->pSetupReferenceSlot = convert_VkVideoReferenceSlotInfoKHR_array_win32_to_host(ctx, (const VkVideoReferenceSlotInfoKHR32 *)UlongToPtr(in->pSetupReferenceSlot), 1); - out->referenceSlotCount = in->referenceSlotCount; - out->pReferenceSlots = convert_VkVideoReferenceSlotInfoKHR_array_win32_to_host(ctx, (const VkVideoReferenceSlotInfoKHR32 *)UlongToPtr(in->pReferenceSlots), in->referenceSlotCount); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_INLINE_QUERY_INFO_KHR: - { - VkVideoInlineQueryInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoInlineQueryInfoKHR32 *in_ext = (const VkVideoInlineQueryInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_INLINE_QUERY_INFO_KHR; - out_ext->pNext = NULL; - out_ext->queryPool = in_ext->queryPool; - out_ext->firstQuery = in_ext->firstQuery; - out_ext->queryCount = in_ext->queryCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_KHR: - { - VkVideoDecodeH264PictureInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeH264PictureInfoKHR32 *in_ext = (const VkVideoDecodeH264PictureInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->pStdPictureInfo = UlongToPtr(in_ext->pStdPictureInfo); - out_ext->sliceCount = in_ext->sliceCount; - out_ext->pSliceOffsets = UlongToPtr(in_ext->pSliceOffsets); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_KHR: - { - VkVideoDecodeH265PictureInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeH265PictureInfoKHR32 *in_ext = (const VkVideoDecodeH265PictureInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->pStdPictureInfo = UlongToPtr(in_ext->pStdPictureInfo); - out_ext->sliceSegmentCount = in_ext->sliceSegmentCount; - out_ext->pSliceSegmentOffsets = UlongToPtr(in_ext->pSliceSegmentOffsets); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PICTURE_INFO_KHR: - { - VkVideoDecodeAV1PictureInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeAV1PictureInfoKHR32 *in_ext = (const VkVideoDecodeAV1PictureInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PICTURE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->pStdPictureInfo = convert_StdVideoDecodeAV1PictureInfo_array_win32_to_host(ctx, (const StdVideoDecodeAV1PictureInfo32 *)UlongToPtr(in_ext->pStdPictureInfo), 1); - memcpy(out_ext->referenceNameSlotIndices, in_ext->referenceNameSlotIndices, VK_MAX_VIDEO_AV1_REFERENCES_PER_FRAME_KHR * sizeof(int32_t)); - out_ext->frameHeaderOffset = in_ext->frameHeaderOffset; - out_ext->tileCount = in_ext->tileCount; - out_ext->pTileOffsets = UlongToPtr(in_ext->pTileOffsets); - out_ext->pTileSizes = UlongToPtr(in_ext->pTileSizes); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkDecompressMemoryRegionNV_win32_to_host(const VkDecompressMemoryRegionNV32 *in, VkDecompressMemoryRegionNV *out) -{ - if (!in) return; - - out->srcAddress = in->srcAddress; - out->dstAddress = in->dstAddress; - out->compressedSize = in->compressedSize; - out->decompressedSize = in->decompressedSize; - out->decompressionMethod = in->decompressionMethod; -} - -static inline const VkDecompressMemoryRegionNV *convert_VkDecompressMemoryRegionNV_array_win32_to_host(struct conversion_context *ctx, const VkDecompressMemoryRegionNV32 *in, uint32_t count) -{ - VkDecompressMemoryRegionNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDecompressMemoryRegionNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_StdVideoEncodeH264SliceHeader_win32_to_host(const StdVideoEncodeH264SliceHeader32 *in, StdVideoEncodeH264SliceHeader *out) -{ - if (!in) return; - - out->flags = in->flags; - out->first_mb_in_slice = in->first_mb_in_slice; - out->slice_type = in->slice_type; - out->slice_alpha_c0_offset_div2 = in->slice_alpha_c0_offset_div2; - out->slice_beta_offset_div2 = in->slice_beta_offset_div2; - out->slice_qp_delta = in->slice_qp_delta; - out->reserved1 = in->reserved1; - out->cabac_init_idc = in->cabac_init_idc; - out->disable_deblocking_filter_idc = in->disable_deblocking_filter_idc; - out->pWeightTable = UlongToPtr(in->pWeightTable); -} - -static inline const StdVideoEncodeH264SliceHeader *convert_StdVideoEncodeH264SliceHeader_array_win32_to_host(struct conversion_context *ctx, const StdVideoEncodeH264SliceHeader32 *in, uint32_t count) -{ - StdVideoEncodeH264SliceHeader *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_StdVideoEncodeH264SliceHeader_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkVideoEncodeH264NaluSliceInfoKHR_win32_to_host(struct conversion_context *ctx, const VkVideoEncodeH264NaluSliceInfoKHR32 *in, VkVideoEncodeH264NaluSliceInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->constantQp = in->constantQp; - out->pStdSliceHeader = convert_StdVideoEncodeH264SliceHeader_array_win32_to_host(ctx, (const StdVideoEncodeH264SliceHeader32 *)UlongToPtr(in->pStdSliceHeader), 1); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkVideoEncodeH264NaluSliceInfoKHR *convert_VkVideoEncodeH264NaluSliceInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkVideoEncodeH264NaluSliceInfoKHR32 *in, uint32_t count) -{ - VkVideoEncodeH264NaluSliceInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkVideoEncodeH264NaluSliceInfoKHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_StdVideoEncodeH264ReferenceListsInfo_win32_to_host(const StdVideoEncodeH264ReferenceListsInfo32 *in, StdVideoEncodeH264ReferenceListsInfo *out) -{ - if (!in) return; - - out->flags = in->flags; - out->num_ref_idx_l0_active_minus1 = in->num_ref_idx_l0_active_minus1; - out->num_ref_idx_l1_active_minus1 = in->num_ref_idx_l1_active_minus1; - memcpy(out->RefPicList0, in->RefPicList0, STD_VIDEO_H264_MAX_NUM_LIST_REF * sizeof(uint8_t)); - memcpy(out->RefPicList1, in->RefPicList1, STD_VIDEO_H264_MAX_NUM_LIST_REF * sizeof(uint8_t)); - out->refList0ModOpCount = in->refList0ModOpCount; - out->refList1ModOpCount = in->refList1ModOpCount; - out->refPicMarkingOpCount = in->refPicMarkingOpCount; - memcpy(out->reserved1, in->reserved1, 7 * sizeof(uint8_t)); - out->pRefList0ModOperations = UlongToPtr(in->pRefList0ModOperations); - out->pRefList1ModOperations = UlongToPtr(in->pRefList1ModOperations); - out->pRefPicMarkingOperations = UlongToPtr(in->pRefPicMarkingOperations); -} - -static inline const StdVideoEncodeH264ReferenceListsInfo *convert_StdVideoEncodeH264ReferenceListsInfo_array_win32_to_host(struct conversion_context *ctx, const StdVideoEncodeH264ReferenceListsInfo32 *in, uint32_t count) -{ - StdVideoEncodeH264ReferenceListsInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_StdVideoEncodeH264ReferenceListsInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_StdVideoEncodeH264PictureInfo_win32_to_host(struct conversion_context *ctx, const StdVideoEncodeH264PictureInfo32 *in, StdVideoEncodeH264PictureInfo *out) -{ - if (!in) return; - - out->flags = in->flags; - out->seq_parameter_set_id = in->seq_parameter_set_id; - out->pic_parameter_set_id = in->pic_parameter_set_id; - out->idr_pic_id = in->idr_pic_id; - out->primary_pic_type = in->primary_pic_type; - out->frame_num = in->frame_num; - out->PicOrderCnt = in->PicOrderCnt; - out->temporal_id = in->temporal_id; - memcpy(out->reserved1, in->reserved1, 3 * sizeof(uint8_t)); - out->pRefLists = convert_StdVideoEncodeH264ReferenceListsInfo_array_win32_to_host(ctx, (const StdVideoEncodeH264ReferenceListsInfo32 *)UlongToPtr(in->pRefLists), 1); -} - -static inline const StdVideoEncodeH264PictureInfo *convert_StdVideoEncodeH264PictureInfo_array_win32_to_host(struct conversion_context *ctx, const StdVideoEncodeH264PictureInfo32 *in, uint32_t count) -{ - StdVideoEncodeH264PictureInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_StdVideoEncodeH264PictureInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_StdVideoEncodeH265SliceSegmentHeader_win32_to_host(const StdVideoEncodeH265SliceSegmentHeader32 *in, StdVideoEncodeH265SliceSegmentHeader *out) -{ - if (!in) return; - - out->flags = in->flags; - out->slice_type = in->slice_type; - out->slice_segment_address = in->slice_segment_address; - out->collocated_ref_idx = in->collocated_ref_idx; - out->MaxNumMergeCand = in->MaxNumMergeCand; - out->slice_cb_qp_offset = in->slice_cb_qp_offset; - out->slice_cr_qp_offset = in->slice_cr_qp_offset; - out->slice_beta_offset_div2 = in->slice_beta_offset_div2; - out->slice_tc_offset_div2 = in->slice_tc_offset_div2; - out->slice_act_y_qp_offset = in->slice_act_y_qp_offset; - out->slice_act_cb_qp_offset = in->slice_act_cb_qp_offset; - out->slice_act_cr_qp_offset = in->slice_act_cr_qp_offset; - out->slice_qp_delta = in->slice_qp_delta; - out->reserved1 = in->reserved1; - out->pWeightTable = UlongToPtr(in->pWeightTable); -} - -static inline const StdVideoEncodeH265SliceSegmentHeader *convert_StdVideoEncodeH265SliceSegmentHeader_array_win32_to_host(struct conversion_context *ctx, const StdVideoEncodeH265SliceSegmentHeader32 *in, uint32_t count) -{ - StdVideoEncodeH265SliceSegmentHeader *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_StdVideoEncodeH265SliceSegmentHeader_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkVideoEncodeH265NaluSliceSegmentInfoKHR_win32_to_host(struct conversion_context *ctx, const VkVideoEncodeH265NaluSliceSegmentInfoKHR32 *in, VkVideoEncodeH265NaluSliceSegmentInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->constantQp = in->constantQp; - out->pStdSliceSegmentHeader = convert_StdVideoEncodeH265SliceSegmentHeader_array_win32_to_host(ctx, (const StdVideoEncodeH265SliceSegmentHeader32 *)UlongToPtr(in->pStdSliceSegmentHeader), 1); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkVideoEncodeH265NaluSliceSegmentInfoKHR *convert_VkVideoEncodeH265NaluSliceSegmentInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkVideoEncodeH265NaluSliceSegmentInfoKHR32 *in, uint32_t count) -{ - VkVideoEncodeH265NaluSliceSegmentInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkVideoEncodeH265NaluSliceSegmentInfoKHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_StdVideoEncodeH265PictureInfo_win32_to_host(const StdVideoEncodeH265PictureInfo32 *in, StdVideoEncodeH265PictureInfo *out) -{ - if (!in) return; - - out->flags = in->flags; - out->pic_type = in->pic_type; - out->sps_video_parameter_set_id = in->sps_video_parameter_set_id; - out->pps_seq_parameter_set_id = in->pps_seq_parameter_set_id; - out->pps_pic_parameter_set_id = in->pps_pic_parameter_set_id; - out->short_term_ref_pic_set_idx = in->short_term_ref_pic_set_idx; - out->PicOrderCntVal = in->PicOrderCntVal; - out->TemporalId = in->TemporalId; - memcpy(out->reserved1, in->reserved1, 7 * sizeof(uint8_t)); - out->pRefLists = UlongToPtr(in->pRefLists); - out->pShortTermRefPicSet = UlongToPtr(in->pShortTermRefPicSet); - out->pLongTermRefPics = UlongToPtr(in->pLongTermRefPics); -} - -static inline const StdVideoEncodeH265PictureInfo *convert_StdVideoEncodeH265PictureInfo_array_win32_to_host(struct conversion_context *ctx, const StdVideoEncodeH265PictureInfo32 *in, uint32_t count) -{ - StdVideoEncodeH265PictureInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_StdVideoEncodeH265PictureInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_StdVideoEncodeAV1PictureInfo_win32_to_host(struct conversion_context *ctx, const StdVideoEncodeAV1PictureInfo32 *in, StdVideoEncodeAV1PictureInfo *out) -{ - if (!in) return; - - out->flags = in->flags; - out->frame_type = in->frame_type; - out->frame_presentation_time = in->frame_presentation_time; - out->current_frame_id = in->current_frame_id; - out->order_hint = in->order_hint; - out->primary_ref_frame = in->primary_ref_frame; - out->refresh_frame_flags = in->refresh_frame_flags; - out->coded_denom = in->coded_denom; - out->render_width_minus_1 = in->render_width_minus_1; - out->render_height_minus_1 = in->render_height_minus_1; - out->interpolation_filter = in->interpolation_filter; - out->TxMode = in->TxMode; - out->delta_q_res = in->delta_q_res; - out->delta_lf_res = in->delta_lf_res; - memcpy(out->ref_order_hint, in->ref_order_hint, STD_VIDEO_AV1_NUM_REF_FRAMES * sizeof(uint8_t)); - memcpy(out->ref_frame_idx, in->ref_frame_idx, STD_VIDEO_AV1_REFS_PER_FRAME * sizeof(int8_t)); - memcpy(out->reserved1, in->reserved1, 3 * sizeof(uint8_t)); - memcpy(out->delta_frame_id_minus_1, in->delta_frame_id_minus_1, STD_VIDEO_AV1_REFS_PER_FRAME * sizeof(uint32_t)); - out->pTileInfo = convert_StdVideoAV1TileInfo_array_win32_to_host(ctx, (const StdVideoAV1TileInfo32 *)UlongToPtr(in->pTileInfo), 1); - out->pQuantization = UlongToPtr(in->pQuantization); - out->pSegmentation = UlongToPtr(in->pSegmentation); - out->pLoopFilter = UlongToPtr(in->pLoopFilter); - out->pCDEF = UlongToPtr(in->pCDEF); - out->pLoopRestoration = UlongToPtr(in->pLoopRestoration); - out->pGlobalMotion = UlongToPtr(in->pGlobalMotion); - out->pExtensionHeader = UlongToPtr(in->pExtensionHeader); - out->pBufferRemovalTimes = UlongToPtr(in->pBufferRemovalTimes); -} - -static inline const StdVideoEncodeAV1PictureInfo *convert_StdVideoEncodeAV1PictureInfo_array_win32_to_host(struct conversion_context *ctx, const StdVideoEncodeAV1PictureInfo32 *in, uint32_t count) -{ - StdVideoEncodeAV1PictureInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_StdVideoEncodeAV1PictureInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkVideoEncodeInfoKHR_win32_to_host(struct conversion_context *ctx, const VkVideoEncodeInfoKHR32 *in, VkVideoEncodeInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->dstBuffer = in->dstBuffer; - out->dstBufferOffset = in->dstBufferOffset; - out->dstBufferRange = in->dstBufferRange; - convert_VkVideoPictureResourceInfoKHR_win32_to_host(&in->srcPictureResource, &out->srcPictureResource); - out->pSetupReferenceSlot = convert_VkVideoReferenceSlotInfoKHR_array_win32_to_host(ctx, (const VkVideoReferenceSlotInfoKHR32 *)UlongToPtr(in->pSetupReferenceSlot), 1); - out->referenceSlotCount = in->referenceSlotCount; - out->pReferenceSlots = convert_VkVideoReferenceSlotInfoKHR_array_win32_to_host(ctx, (const VkVideoReferenceSlotInfoKHR32 *)UlongToPtr(in->pReferenceSlots), in->referenceSlotCount); - out->precedingExternallyEncodedBytes = in->precedingExternallyEncodedBytes; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_INLINE_QUERY_INFO_KHR: - { - VkVideoInlineQueryInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoInlineQueryInfoKHR32 *in_ext = (const VkVideoInlineQueryInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_INLINE_QUERY_INFO_KHR; - out_ext->pNext = NULL; - out_ext->queryPool = in_ext->queryPool; - out_ext->firstQuery = in_ext->firstQuery; - out_ext->queryCount = in_ext->queryCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_INFO_KHR: - { - VkVideoEncodeQuantizationMapInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeQuantizationMapInfoKHR32 *in_ext = (const VkVideoEncodeQuantizationMapInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_INFO_KHR; - out_ext->pNext = NULL; - out_ext->quantizationMap = in_ext->quantizationMap; - out_ext->quantizationMapExtent = in_ext->quantizationMapExtent; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PICTURE_INFO_KHR: - { - VkVideoEncodeH264PictureInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH264PictureInfoKHR32 *in_ext = (const VkVideoEncodeH264PictureInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PICTURE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->naluSliceEntryCount = in_ext->naluSliceEntryCount; - out_ext->pNaluSliceEntries = convert_VkVideoEncodeH264NaluSliceInfoKHR_array_win32_to_host(ctx, (const VkVideoEncodeH264NaluSliceInfoKHR32 *)UlongToPtr(in_ext->pNaluSliceEntries), in_ext->naluSliceEntryCount); - out_ext->pStdPictureInfo = convert_StdVideoEncodeH264PictureInfo_array_win32_to_host(ctx, (const StdVideoEncodeH264PictureInfo32 *)UlongToPtr(in_ext->pStdPictureInfo), 1); - out_ext->generatePrefixNalu = in_ext->generatePrefixNalu; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PICTURE_INFO_KHR: - { - VkVideoEncodeH265PictureInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH265PictureInfoKHR32 *in_ext = (const VkVideoEncodeH265PictureInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PICTURE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->naluSliceSegmentEntryCount = in_ext->naluSliceSegmentEntryCount; - out_ext->pNaluSliceSegmentEntries = convert_VkVideoEncodeH265NaluSliceSegmentInfoKHR_array_win32_to_host(ctx, (const VkVideoEncodeH265NaluSliceSegmentInfoKHR32 *)UlongToPtr(in_ext->pNaluSliceSegmentEntries), in_ext->naluSliceSegmentEntryCount); - out_ext->pStdPictureInfo = convert_StdVideoEncodeH265PictureInfo_array_win32_to_host(ctx, (const StdVideoEncodeH265PictureInfo32 *)UlongToPtr(in_ext->pStdPictureInfo), 1); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PICTURE_INFO_KHR: - { - VkVideoEncodeAV1PictureInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeAV1PictureInfoKHR32 *in_ext = (const VkVideoEncodeAV1PictureInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PICTURE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->predictionMode = in_ext->predictionMode; - out_ext->rateControlGroup = in_ext->rateControlGroup; - out_ext->constantQIndex = in_ext->constantQIndex; - out_ext->pStdPictureInfo = convert_StdVideoEncodeAV1PictureInfo_array_win32_to_host(ctx, (const StdVideoEncodeAV1PictureInfo32 *)UlongToPtr(in_ext->pStdPictureInfo), 1); - memcpy(out_ext->referenceNameSlotIndices, in_ext->referenceNameSlotIndices, VK_MAX_VIDEO_AV1_REFERENCES_PER_FRAME_KHR * sizeof(int32_t)); - out_ext->primaryReferenceCdfOnly = in_ext->primaryReferenceCdfOnly; - out_ext->generateObuExtensionHeader = in_ext->generateObuExtensionHeader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSubpassEndInfo_win32_to_host(struct conversion_context *ctx, const VkSubpassEndInfo32 *in, VkSubpassEndInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM: - { - VkSubpassFragmentDensityMapOffsetEndInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSubpassFragmentDensityMapOffsetEndInfoQCOM32 *in_ext = (const VkSubpassFragmentDensityMapOffsetEndInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->fragmentDensityOffsetCount = in_ext->fragmentDensityOffsetCount; - out_ext->pFragmentDensityOffsets = UlongToPtr(in_ext->pFragmentDensityOffsets); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkVideoEndCodingInfoKHR_win32_to_host(const VkVideoEndCodingInfoKHR32 *in, VkVideoEndCodingInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline const VkCommandBuffer *convert_VkCommandBuffer_array_win64_to_host(struct conversion_context *ctx, const VkCommandBuffer *in, uint32_t count) -{ - VkCommandBuffer *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = wine_cmd_buffer_from_handle(in[i])->host.command_buffer; - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkCommandBuffer *convert_VkCommandBuffer_array_win32_to_host(struct conversion_context *ctx, const PTR32 *in, uint32_t count) -{ - VkCommandBuffer *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = wine_cmd_buffer_from_handle(UlongToPtr(in[i]))->host.command_buffer; - } - - return out; -} - -static inline void convert_VkGeneratedCommandsInfoEXT_win32_to_host(struct conversion_context *ctx, const VkGeneratedCommandsInfoEXT32 *in, VkGeneratedCommandsInfoEXT *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->shaderStages = in->shaderStages; - out->indirectExecutionSet = in->indirectExecutionSet; - out->indirectCommandsLayout = in->indirectCommandsLayout; - out->indirectAddress = in->indirectAddress; - out->indirectAddressSize = in->indirectAddressSize; - out->preprocessAddress = in->preprocessAddress; - out->preprocessSize = in->preprocessSize; - out->maxSequenceCount = in->maxSequenceCount; - out->sequenceCountAddress = in->sequenceCountAddress; - out->maxDrawCount = in->maxDrawCount; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_GENERATED_COMMANDS_PIPELINE_INFO_EXT: - { - VkGeneratedCommandsPipelineInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkGeneratedCommandsPipelineInfoEXT32 *in_ext = (const VkGeneratedCommandsPipelineInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_GENERATED_COMMANDS_PIPELINE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->pipeline = in_ext->pipeline; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_GENERATED_COMMANDS_SHADER_INFO_EXT: - { - VkGeneratedCommandsShaderInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkGeneratedCommandsShaderInfoEXT32 *in_ext = (const VkGeneratedCommandsShaderInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_GENERATED_COMMANDS_SHADER_INFO_EXT; - out_ext->pNext = NULL; - out_ext->shaderCount = in_ext->shaderCount; - out_ext->pShaders = UlongToPtr(in_ext->pShaders); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkIndirectCommandsStreamNV_win32_to_host(const VkIndirectCommandsStreamNV32 *in, VkIndirectCommandsStreamNV *out) -{ - if (!in) return; - - out->buffer = in->buffer; - out->offset = in->offset; -} - -static inline const VkIndirectCommandsStreamNV *convert_VkIndirectCommandsStreamNV_array_win32_to_host(struct conversion_context *ctx, const VkIndirectCommandsStreamNV32 *in, uint32_t count) -{ - VkIndirectCommandsStreamNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkIndirectCommandsStreamNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkGeneratedCommandsInfoNV_win32_to_host(struct conversion_context *ctx, const VkGeneratedCommandsInfoNV32 *in, VkGeneratedCommandsInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pipelineBindPoint = in->pipelineBindPoint; - out->pipeline = in->pipeline; - out->indirectCommandsLayout = in->indirectCommandsLayout; - out->streamCount = in->streamCount; - out->pStreams = convert_VkIndirectCommandsStreamNV_array_win32_to_host(ctx, (const VkIndirectCommandsStreamNV32 *)UlongToPtr(in->pStreams), in->streamCount); - out->sequencesCount = in->sequencesCount; - out->preprocessBuffer = in->preprocessBuffer; - out->preprocessOffset = in->preprocessOffset; - out->preprocessSize = in->preprocessSize; - out->sequencesCountBuffer = in->sequencesCountBuffer; - out->sequencesCountOffset = in->sequencesCountOffset; - out->sequencesIndexBuffer = in->sequencesIndexBuffer; - out->sequencesIndexOffset = in->sequencesIndexOffset; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkOpticalFlowExecuteInfoNV_win32_to_host(const VkOpticalFlowExecuteInfoNV32 *in, VkOpticalFlowExecuteInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->regionCount = in->regionCount; - out->pRegions = UlongToPtr(in->pRegions); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMemoryBarrier_win32_to_host(const VkMemoryBarrier32 *in, VkMemoryBarrier *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcAccessMask = in->srcAccessMask; - out->dstAccessMask = in->dstAccessMask; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkMemoryBarrier *convert_VkMemoryBarrier_array_win32_to_host(struct conversion_context *ctx, const VkMemoryBarrier32 *in, uint32_t count) -{ - VkMemoryBarrier *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkMemoryBarrier_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkBufferMemoryBarrier_win32_to_host(struct conversion_context *ctx, const VkBufferMemoryBarrier32 *in, VkBufferMemoryBarrier *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcAccessMask = in->srcAccessMask; - out->dstAccessMask = in->dstAccessMask; - out->srcQueueFamilyIndex = in->srcQueueFamilyIndex; - out->dstQueueFamilyIndex = in->dstQueueFamilyIndex; - out->buffer = in->buffer; - out->offset = in->offset; - out->size = in->size; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT: - { - VkExternalMemoryAcquireUnmodifiedEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExternalMemoryAcquireUnmodifiedEXT32 *in_ext = (const VkExternalMemoryAcquireUnmodifiedEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT; - out_ext->pNext = NULL; - out_ext->acquireUnmodifiedMemory = in_ext->acquireUnmodifiedMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkBufferMemoryBarrier *convert_VkBufferMemoryBarrier_array_win32_to_host(struct conversion_context *ctx, const VkBufferMemoryBarrier32 *in, uint32_t count) -{ - VkBufferMemoryBarrier *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBufferMemoryBarrier_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkImageMemoryBarrier_win32_to_host(struct conversion_context *ctx, const VkImageMemoryBarrier32 *in, VkImageMemoryBarrier *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcAccessMask = in->srcAccessMask; - out->dstAccessMask = in->dstAccessMask; - out->oldLayout = in->oldLayout; - out->newLayout = in->newLayout; - out->srcQueueFamilyIndex = in->srcQueueFamilyIndex; - out->dstQueueFamilyIndex = in->dstQueueFamilyIndex; - out->image = in->image; - out->subresourceRange = in->subresourceRange; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: - { - VkSampleLocationsInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSampleLocationsInfoEXT32 *in_ext = (const VkSampleLocationsInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT; - out_ext->pNext = NULL; - out_ext->sampleLocationsPerPixel = in_ext->sampleLocationsPerPixel; - out_ext->sampleLocationGridSize = in_ext->sampleLocationGridSize; - out_ext->sampleLocationsCount = in_ext->sampleLocationsCount; - out_ext->pSampleLocations = UlongToPtr(in_ext->pSampleLocations); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT: - { - VkExternalMemoryAcquireUnmodifiedEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExternalMemoryAcquireUnmodifiedEXT32 *in_ext = (const VkExternalMemoryAcquireUnmodifiedEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT; - out_ext->pNext = NULL; - out_ext->acquireUnmodifiedMemory = in_ext->acquireUnmodifiedMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkImageMemoryBarrier *convert_VkImageMemoryBarrier_array_win32_to_host(struct conversion_context *ctx, const VkImageMemoryBarrier32 *in, uint32_t count) -{ - VkImageMemoryBarrier *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkImageMemoryBarrier_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkMemoryBarrier2_win32_to_host(const VkMemoryBarrier232 *in, VkMemoryBarrier2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcStageMask = in->srcStageMask; - out->srcAccessMask = in->srcAccessMask; - out->dstStageMask = in->dstStageMask; - out->dstAccessMask = in->dstAccessMask; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkMemoryBarrier2 *convert_VkMemoryBarrier2_array_win32_to_host(struct conversion_context *ctx, const VkMemoryBarrier232 *in, uint32_t count) -{ - VkMemoryBarrier2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkMemoryBarrier2_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkBufferMemoryBarrier2_win32_to_host(struct conversion_context *ctx, const VkBufferMemoryBarrier232 *in, VkBufferMemoryBarrier2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcStageMask = in->srcStageMask; - out->srcAccessMask = in->srcAccessMask; - out->dstStageMask = in->dstStageMask; - out->dstAccessMask = in->dstAccessMask; - out->srcQueueFamilyIndex = in->srcQueueFamilyIndex; - out->dstQueueFamilyIndex = in->dstQueueFamilyIndex; - out->buffer = in->buffer; - out->offset = in->offset; - out->size = in->size; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT: - { - VkExternalMemoryAcquireUnmodifiedEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExternalMemoryAcquireUnmodifiedEXT32 *in_ext = (const VkExternalMemoryAcquireUnmodifiedEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT; - out_ext->pNext = NULL; - out_ext->acquireUnmodifiedMemory = in_ext->acquireUnmodifiedMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkBufferMemoryBarrier2 *convert_VkBufferMemoryBarrier2_array_win32_to_host(struct conversion_context *ctx, const VkBufferMemoryBarrier232 *in, uint32_t count) -{ - VkBufferMemoryBarrier2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBufferMemoryBarrier2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkImageMemoryBarrier2_win32_to_host(struct conversion_context *ctx, const VkImageMemoryBarrier232 *in, VkImageMemoryBarrier2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcStageMask = in->srcStageMask; - out->srcAccessMask = in->srcAccessMask; - out->dstStageMask = in->dstStageMask; - out->dstAccessMask = in->dstAccessMask; - out->oldLayout = in->oldLayout; - out->newLayout = in->newLayout; - out->srcQueueFamilyIndex = in->srcQueueFamilyIndex; - out->dstQueueFamilyIndex = in->dstQueueFamilyIndex; - out->image = in->image; - out->subresourceRange = in->subresourceRange; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: - { - VkSampleLocationsInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSampleLocationsInfoEXT32 *in_ext = (const VkSampleLocationsInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT; - out_ext->pNext = NULL; - out_ext->sampleLocationsPerPixel = in_ext->sampleLocationsPerPixel; - out_ext->sampleLocationGridSize = in_ext->sampleLocationGridSize; - out_ext->sampleLocationsCount = in_ext->sampleLocationsCount; - out_ext->pSampleLocations = UlongToPtr(in_ext->pSampleLocations); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT: - { - VkExternalMemoryAcquireUnmodifiedEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExternalMemoryAcquireUnmodifiedEXT32 *in_ext = (const VkExternalMemoryAcquireUnmodifiedEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT; - out_ext->pNext = NULL; - out_ext->acquireUnmodifiedMemory = in_ext->acquireUnmodifiedMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkImageMemoryBarrier2 *convert_VkImageMemoryBarrier2_array_win32_to_host(struct conversion_context *ctx, const VkImageMemoryBarrier232 *in, uint32_t count) -{ - VkImageMemoryBarrier2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkImageMemoryBarrier2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDependencyInfo_win32_to_host(struct conversion_context *ctx, const VkDependencyInfo32 *in, VkDependencyInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->dependencyFlags = in->dependencyFlags; - out->memoryBarrierCount = in->memoryBarrierCount; - out->pMemoryBarriers = convert_VkMemoryBarrier2_array_win32_to_host(ctx, (const VkMemoryBarrier232 *)UlongToPtr(in->pMemoryBarriers), in->memoryBarrierCount); - out->bufferMemoryBarrierCount = in->bufferMemoryBarrierCount; - out->pBufferMemoryBarriers = convert_VkBufferMemoryBarrier2_array_win32_to_host(ctx, (const VkBufferMemoryBarrier232 *)UlongToPtr(in->pBufferMemoryBarriers), in->bufferMemoryBarrierCount); - out->imageMemoryBarrierCount = in->imageMemoryBarrierCount; - out->pImageMemoryBarriers = convert_VkImageMemoryBarrier2_array_win32_to_host(ctx, (const VkImageMemoryBarrier232 *)UlongToPtr(in->pImageMemoryBarriers), in->imageMemoryBarrierCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPushConstantsInfo_win32_to_host(struct conversion_context *ctx, const VkPushConstantsInfo32 *in, VkPushConstantsInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->layout = in->layout; - out->stageFlags = in->stageFlags; - out->offset = in->offset; - out->size = in->size; - out->pValues = UlongToPtr(in->pValues); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO: - { - VkPipelineLayoutCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineLayoutCreateInfo32 *in_ext = (const VkPipelineLayoutCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->setLayoutCount = in_ext->setLayoutCount; - out_ext->pSetLayouts = UlongToPtr(in_ext->pSetLayouts); - out_ext->pushConstantRangeCount = in_ext->pushConstantRangeCount; - out_ext->pPushConstantRanges = UlongToPtr(in_ext->pPushConstantRanges); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkDescriptorImageInfo_win32_to_host(const VkDescriptorImageInfo32 *in, VkDescriptorImageInfo *out) -{ - if (!in) return; - - out->sampler = in->sampler; - out->imageView = in->imageView; - out->imageLayout = in->imageLayout; -} - -static inline const VkDescriptorImageInfo *convert_VkDescriptorImageInfo_array_win32_to_host(struct conversion_context *ctx, const VkDescriptorImageInfo32 *in, uint32_t count) -{ - VkDescriptorImageInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDescriptorImageInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDescriptorBufferInfo_win32_to_host(const VkDescriptorBufferInfo32 *in, VkDescriptorBufferInfo *out) -{ - if (!in) return; - - out->buffer = in->buffer; - out->offset = in->offset; - out->range = in->range; -} - -static inline const VkDescriptorBufferInfo *convert_VkDescriptorBufferInfo_array_win32_to_host(struct conversion_context *ctx, const VkDescriptorBufferInfo32 *in, uint32_t count) -{ - VkDescriptorBufferInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDescriptorBufferInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkWriteDescriptorSet_win32_to_host(struct conversion_context *ctx, const VkWriteDescriptorSet32 *in, VkWriteDescriptorSet *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->dstSet = in->dstSet; - out->dstBinding = in->dstBinding; - out->dstArrayElement = in->dstArrayElement; - out->descriptorCount = in->descriptorCount; - out->descriptorType = in->descriptorType; - out->pImageInfo = convert_VkDescriptorImageInfo_array_win32_to_host(ctx, (const VkDescriptorImageInfo32 *)UlongToPtr(in->pImageInfo), in->descriptorType == VK_DESCRIPTOR_TYPE_SAMPLER || in->descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER || in->descriptorType == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE || in->descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE || in->descriptorType == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT || in->descriptorType == VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM || in->descriptorType == VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM ? in->descriptorCount : 0); - out->pBufferInfo = convert_VkDescriptorBufferInfo_array_win32_to_host(ctx, (const VkDescriptorBufferInfo32 *)UlongToPtr(in->pBufferInfo), in->descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER || in->descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER || in->descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC || in->descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC ? in->descriptorCount : 0); - out->pTexelBufferView = UlongToPtr(in->pTexelBufferView); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK: - { - VkWriteDescriptorSetInlineUniformBlock *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkWriteDescriptorSetInlineUniformBlock32 *in_ext = (const VkWriteDescriptorSetInlineUniformBlock32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK; - out_ext->pNext = NULL; - out_ext->dataSize = in_ext->dataSize; - out_ext->pData = UlongToPtr(in_ext->pData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR: - { - VkWriteDescriptorSetAccelerationStructureKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkWriteDescriptorSetAccelerationStructureKHR32 *in_ext = (const VkWriteDescriptorSetAccelerationStructureKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR; - out_ext->pNext = NULL; - out_ext->accelerationStructureCount = in_ext->accelerationStructureCount; - out_ext->pAccelerationStructures = UlongToPtr(in_ext->pAccelerationStructures); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV: - { - VkWriteDescriptorSetAccelerationStructureNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkWriteDescriptorSetAccelerationStructureNV32 *in_ext = (const VkWriteDescriptorSetAccelerationStructureNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV; - out_ext->pNext = NULL; - out_ext->accelerationStructureCount = in_ext->accelerationStructureCount; - out_ext->pAccelerationStructures = UlongToPtr(in_ext->pAccelerationStructures); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkWriteDescriptorSet *convert_VkWriteDescriptorSet_array_win32_to_host(struct conversion_context *ctx, const VkWriteDescriptorSet32 *in, uint32_t count) -{ - VkWriteDescriptorSet *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkWriteDescriptorSet_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPushDescriptorSetInfo_win32_to_host(struct conversion_context *ctx, const VkPushDescriptorSetInfo32 *in, VkPushDescriptorSetInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->stageFlags = in->stageFlags; - out->layout = in->layout; - out->set = in->set; - out->descriptorWriteCount = in->descriptorWriteCount; - out->pDescriptorWrites = convert_VkWriteDescriptorSet_array_win32_to_host(ctx, (const VkWriteDescriptorSet32 *)UlongToPtr(in->pDescriptorWrites), in->descriptorWriteCount); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO: - { - VkPipelineLayoutCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineLayoutCreateInfo32 *in_ext = (const VkPipelineLayoutCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->setLayoutCount = in_ext->setLayoutCount; - out_ext->pSetLayouts = UlongToPtr(in_ext->pSetLayouts); - out_ext->pushConstantRangeCount = in_ext->pushConstantRangeCount; - out_ext->pPushConstantRanges = UlongToPtr(in_ext->pPushConstantRanges); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkPushDescriptorSetWithTemplateInfo_win32_to_host(struct conversion_context *ctx, const VkPushDescriptorSetWithTemplateInfo32 *in, VkPushDescriptorSetWithTemplateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->descriptorUpdateTemplate = in->descriptorUpdateTemplate; - out->layout = in->layout; - out->set = in->set; - out->pData = UlongToPtr(in->pData); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO: - { - VkPipelineLayoutCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineLayoutCreateInfo32 *in_ext = (const VkPipelineLayoutCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->setLayoutCount = in_ext->setLayoutCount; - out_ext->pSetLayouts = UlongToPtr(in_ext->pSetLayouts); - out_ext->pushConstantRangeCount = in_ext->pushConstantRangeCount; - out_ext->pPushConstantRanges = UlongToPtr(in_ext->pPushConstantRanges); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkImageResolve2_win32_to_host(const VkImageResolve232 *in, VkImageResolve2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcSubresource = in->srcSubresource; - out->srcOffset = in->srcOffset; - out->dstSubresource = in->dstSubresource; - out->dstOffset = in->dstOffset; - out->extent = in->extent; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkImageResolve2 *convert_VkImageResolve2_array_win32_to_host(struct conversion_context *ctx, const VkImageResolve232 *in, uint32_t count) -{ - VkImageResolve2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkImageResolve2_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkResolveImageInfo2_win32_to_host(struct conversion_context *ctx, const VkResolveImageInfo232 *in, VkResolveImageInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcImage = in->srcImage; - out->srcImageLayout = in->srcImageLayout; - out->dstImage = in->dstImage; - out->dstImageLayout = in->dstImageLayout; - out->regionCount = in->regionCount; - out->pRegions = convert_VkImageResolve2_array_win32_to_host(ctx, (const VkImageResolve232 *)UlongToPtr(in->pRegions), in->regionCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCoarseSampleOrderCustomNV_win32_to_host(const VkCoarseSampleOrderCustomNV32 *in, VkCoarseSampleOrderCustomNV *out) -{ - if (!in) return; - - out->shadingRate = in->shadingRate; - out->sampleCount = in->sampleCount; - out->sampleLocationCount = in->sampleLocationCount; - out->pSampleLocations = UlongToPtr(in->pSampleLocations); -} - -static inline const VkCoarseSampleOrderCustomNV *convert_VkCoarseSampleOrderCustomNV_array_win32_to_host(struct conversion_context *ctx, const VkCoarseSampleOrderCustomNV32 *in, uint32_t count) -{ - VkCoarseSampleOrderCustomNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCoarseSampleOrderCustomNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDepthBiasInfoEXT_win32_to_host(struct conversion_context *ctx, const VkDepthBiasInfoEXT32 *in, VkDepthBiasInfoEXT *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->depthBiasConstantFactor = in->depthBiasConstantFactor; - out->depthBiasClamp = in->depthBiasClamp; - out->depthBiasSlopeFactor = in->depthBiasSlopeFactor; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT: - { - VkDepthBiasRepresentationInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDepthBiasRepresentationInfoEXT32 *in_ext = (const VkDepthBiasRepresentationInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT; - out_ext->pNext = NULL; - out_ext->depthBiasRepresentation = in_ext->depthBiasRepresentation; - out_ext->depthBiasExact = in_ext->depthBiasExact; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSetDescriptorBufferOffsetsInfoEXT_win32_to_host(struct conversion_context *ctx, const VkSetDescriptorBufferOffsetsInfoEXT32 *in, VkSetDescriptorBufferOffsetsInfoEXT *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->stageFlags = in->stageFlags; - out->layout = in->layout; - out->firstSet = in->firstSet; - out->setCount = in->setCount; - out->pBufferIndices = UlongToPtr(in->pBufferIndices); - out->pOffsets = UlongToPtr(in->pOffsets); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO: - { - VkPipelineLayoutCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineLayoutCreateInfo32 *in_ext = (const VkPipelineLayoutCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->setLayoutCount = in_ext->setLayoutCount; - out_ext->pSetLayouts = UlongToPtr(in_ext->pSetLayouts); - out_ext->pushConstantRangeCount = in_ext->pushConstantRangeCount; - out_ext->pPushConstantRanges = UlongToPtr(in_ext->pPushConstantRanges); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkPerformanceMarkerInfoINTEL_win32_to_host(const VkPerformanceMarkerInfoINTEL32 *in, VkPerformanceMarkerInfoINTEL *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->marker = in->marker; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPerformanceOverrideInfoINTEL_win32_to_host(const VkPerformanceOverrideInfoINTEL32 *in, VkPerformanceOverrideInfoINTEL *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - out->enable = in->enable; - out->parameter = in->parameter; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPerformanceStreamMarkerInfoINTEL_win32_to_host(const VkPerformanceStreamMarkerInfoINTEL32 *in, VkPerformanceStreamMarkerInfoINTEL *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->marker = in->marker; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkRenderingAttachmentLocationInfo_win32_to_host(const VkRenderingAttachmentLocationInfo32 *in, VkRenderingAttachmentLocationInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->colorAttachmentCount = in->colorAttachmentCount; - out->pColorAttachmentLocations = UlongToPtr(in->pColorAttachmentLocations); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkRenderingInputAttachmentIndexInfo_win32_to_host(const VkRenderingInputAttachmentIndexInfo32 *in, VkRenderingInputAttachmentIndexInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->colorAttachmentCount = in->colorAttachmentCount; - out->pColorAttachmentInputIndices = UlongToPtr(in->pColorAttachmentInputIndices); - out->pDepthInputAttachmentIndex = UlongToPtr(in->pDepthInputAttachmentIndex); - out->pStencilInputAttachmentIndex = UlongToPtr(in->pStencilInputAttachmentIndex); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkVertexInputBindingDescription2EXT_win32_to_host(const VkVertexInputBindingDescription2EXT32 *in, VkVertexInputBindingDescription2EXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->binding = in->binding; - out->stride = in->stride; - out->inputRate = in->inputRate; - out->divisor = in->divisor; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkVertexInputBindingDescription2EXT *convert_VkVertexInputBindingDescription2EXT_array_win32_to_host(struct conversion_context *ctx, const VkVertexInputBindingDescription2EXT32 *in, uint32_t count) -{ - VkVertexInputBindingDescription2EXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkVertexInputBindingDescription2EXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkVertexInputAttributeDescription2EXT_win32_to_host(const VkVertexInputAttributeDescription2EXT32 *in, VkVertexInputAttributeDescription2EXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->location = in->location; - out->binding = in->binding; - out->format = in->format; - out->offset = in->offset; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkVertexInputAttributeDescription2EXT *convert_VkVertexInputAttributeDescription2EXT_array_win32_to_host(struct conversion_context *ctx, const VkVertexInputAttributeDescription2EXT32 *in, uint32_t count) -{ - VkVertexInputAttributeDescription2EXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkVertexInputAttributeDescription2EXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkShadingRatePaletteNV_win32_to_host(const VkShadingRatePaletteNV32 *in, VkShadingRatePaletteNV *out) -{ - if (!in) return; - - out->shadingRatePaletteEntryCount = in->shadingRatePaletteEntryCount; - out->pShadingRatePaletteEntries = UlongToPtr(in->pShadingRatePaletteEntries); -} - -static inline const VkShadingRatePaletteNV *convert_VkShadingRatePaletteNV_array_win32_to_host(struct conversion_context *ctx, const VkShadingRatePaletteNV32 *in, uint32_t count) -{ - VkShadingRatePaletteNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkShadingRatePaletteNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkStridedDeviceAddressRegionKHR_win32_to_host(const VkStridedDeviceAddressRegionKHR32 *in, VkStridedDeviceAddressRegionKHR *out) -{ - if (!in) return; - - out->deviceAddress = in->deviceAddress; - out->stride = in->stride; - out->size = in->size; -} - -static inline const VkDependencyInfo *convert_VkDependencyInfo_array_win32_to_host(struct conversion_context *ctx, const VkDependencyInfo32 *in, uint32_t count) -{ - VkDependencyInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDependencyInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCopyImageToImageInfo_win32_to_host(struct conversion_context *ctx, const VkCopyImageToImageInfo32 *in, VkCopyImageToImageInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->srcImage = in->srcImage; - out->srcImageLayout = in->srcImageLayout; - out->dstImage = in->dstImage; - out->dstImageLayout = in->dstImageLayout; - out->regionCount = in->regionCount; - out->pRegions = convert_VkImageCopy2_array_win32_to_host(ctx, (const VkImageCopy232 *)UlongToPtr(in->pRegions), in->regionCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkImageToMemoryCopy_win32_to_host(const VkImageToMemoryCopy32 *in, VkImageToMemoryCopy *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pHostPointer = UlongToPtr(in->pHostPointer); - out->memoryRowLength = in->memoryRowLength; - out->memoryImageHeight = in->memoryImageHeight; - out->imageSubresource = in->imageSubresource; - out->imageOffset = in->imageOffset; - out->imageExtent = in->imageExtent; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkImageToMemoryCopy *convert_VkImageToMemoryCopy_array_win32_to_host(struct conversion_context *ctx, const VkImageToMemoryCopy32 *in, uint32_t count) -{ - VkImageToMemoryCopy *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkImageToMemoryCopy_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCopyImageToMemoryInfo_win32_to_host(struct conversion_context *ctx, const VkCopyImageToMemoryInfo32 *in, VkCopyImageToMemoryInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->srcImage = in->srcImage; - out->srcImageLayout = in->srcImageLayout; - out->regionCount = in->regionCount; - out->pRegions = convert_VkImageToMemoryCopy_array_win32_to_host(ctx, (const VkImageToMemoryCopy32 *)UlongToPtr(in->pRegions), in->regionCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMemoryToImageCopy_win32_to_host(const VkMemoryToImageCopy32 *in, VkMemoryToImageCopy *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pHostPointer = UlongToPtr(in->pHostPointer); - out->memoryRowLength = in->memoryRowLength; - out->memoryImageHeight = in->memoryImageHeight; - out->imageSubresource = in->imageSubresource; - out->imageOffset = in->imageOffset; - out->imageExtent = in->imageExtent; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkMemoryToImageCopy *convert_VkMemoryToImageCopy_array_win32_to_host(struct conversion_context *ctx, const VkMemoryToImageCopy32 *in, uint32_t count) -{ - VkMemoryToImageCopy *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkMemoryToImageCopy_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCopyMemoryToImageInfo_win32_to_host(struct conversion_context *ctx, const VkCopyMemoryToImageInfo32 *in, VkCopyMemoryToImageInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->dstImage = in->dstImage; - out->dstImageLayout = in->dstImageLayout; - out->regionCount = in->regionCount; - out->pRegions = convert_VkMemoryToImageCopy_array_win32_to_host(ctx, (const VkMemoryToImageCopy32 *)UlongToPtr(in->pRegions), in->regionCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkAccelerationStructureCreateInfoKHR_win32_to_host(struct conversion_context *ctx, const VkAccelerationStructureCreateInfoKHR32 *in, VkAccelerationStructureCreateInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->createFlags = in->createFlags; - out->buffer = in->buffer; - out->offset = in->offset; - out->size = in->size; - out->type = in->type; - out->deviceAddress = in->deviceAddress; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT: - { - VkOpaqueCaptureDescriptorDataCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *in_ext = (const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->opaqueCaptureDescriptorData = UlongToPtr(in_ext->opaqueCaptureDescriptorData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV: - { - VkAccelerationStructureMotionInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkAccelerationStructureMotionInfoNV32 *in_ext = (const VkAccelerationStructureMotionInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV; - out_ext->pNext = NULL; - out_ext->maxInstances = in_ext->maxInstances; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkAccelerationStructureCreateInfoNV_win32_to_host(struct conversion_context *ctx, const VkAccelerationStructureCreateInfoNV32 *in, VkAccelerationStructureCreateInfoNV *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->compactedSize = in->compactedSize; - convert_VkAccelerationStructureInfoNV_win32_to_host(ctx, &in->info, &out->info); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT: - { - VkOpaqueCaptureDescriptorDataCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *in_ext = (const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->opaqueCaptureDescriptorData = UlongToPtr(in_ext->opaqueCaptureDescriptorData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkVideoProfileInfoKHR_win32_to_host(struct conversion_context *ctx, const VkVideoProfileInfoKHR32 *in, VkVideoProfileInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->videoCodecOperation = in->videoCodecOperation; - out->chromaSubsampling = in->chromaSubsampling; - out->lumaBitDepth = in->lumaBitDepth; - out->chromaBitDepth = in->chromaBitDepth; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_DECODE_USAGE_INFO_KHR: - { - VkVideoDecodeUsageInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeUsageInfoKHR32 *in_ext = (const VkVideoDecodeUsageInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_USAGE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->videoUsageHints = in_ext->videoUsageHints; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR: - { - VkVideoDecodeH264ProfileInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeH264ProfileInfoKHR32 *in_ext = (const VkVideoDecodeH264ProfileInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->stdProfileIdc = in_ext->stdProfileIdc; - out_ext->pictureLayout = in_ext->pictureLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR: - { - VkVideoDecodeH265ProfileInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeH265ProfileInfoKHR32 *in_ext = (const VkVideoDecodeH265ProfileInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->stdProfileIdc = in_ext->stdProfileIdc; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_KHR: - { - VkVideoDecodeAV1ProfileInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeAV1ProfileInfoKHR32 *in_ext = (const VkVideoDecodeAV1ProfileInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->stdProfile = in_ext->stdProfile; - out_ext->filmGrainSupport = in_ext->filmGrainSupport; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_USAGE_INFO_KHR: - { - VkVideoEncodeUsageInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeUsageInfoKHR32 *in_ext = (const VkVideoEncodeUsageInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_USAGE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->videoUsageHints = in_ext->videoUsageHints; - out_ext->videoContentHints = in_ext->videoContentHints; - out_ext->tuningMode = in_ext->tuningMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_KHR: - { - VkVideoEncodeH264ProfileInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH264ProfileInfoKHR32 *in_ext = (const VkVideoEncodeH264ProfileInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->stdProfileIdc = in_ext->stdProfileIdc; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_KHR: - { - VkVideoEncodeH265ProfileInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH265ProfileInfoKHR32 *in_ext = (const VkVideoEncodeH265ProfileInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->stdProfileIdc = in_ext->stdProfileIdc; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PROFILE_INFO_KHR: - { - VkVideoEncodeAV1ProfileInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeAV1ProfileInfoKHR32 *in_ext = (const VkVideoEncodeAV1ProfileInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PROFILE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->stdProfile = in_ext->stdProfile; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkVideoProfileInfoKHR *convert_VkVideoProfileInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkVideoProfileInfoKHR32 *in, uint32_t count) -{ - VkVideoProfileInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkVideoProfileInfoKHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkBufferCreateInfo_win32_to_host(struct conversion_context *ctx, const VkBufferCreateInfo32 *in, VkBufferCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->size = in->size; - out->usage = in->usage; - out->sharingMode = in->sharingMode; - out->queueFamilyIndexCount = in->queueFamilyIndexCount; - out->pQueueFamilyIndices = UlongToPtr(in->pQueueFamilyIndices); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO: - { - VkBufferUsageFlags2CreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBufferUsageFlags2CreateInfo32 *in_ext = (const VkBufferUsageFlags2CreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->usage = in_ext->usage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV: - { - VkDedicatedAllocationBufferCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDedicatedAllocationBufferCreateInfoNV32 *in_ext = (const VkDedicatedAllocationBufferCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->dedicatedAllocation = in_ext->dedicatedAllocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO: - { - VkExternalMemoryBufferCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExternalMemoryBufferCreateInfo32 *in_ext = (const VkExternalMemoryBufferCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->handleTypes = in_ext->handleTypes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO: - { - VkBufferOpaqueCaptureAddressCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBufferOpaqueCaptureAddressCreateInfo32 *in_ext = (const VkBufferOpaqueCaptureAddressCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->opaqueCaptureAddress = in_ext->opaqueCaptureAddress; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT: - { - VkBufferDeviceAddressCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBufferDeviceAddressCreateInfoEXT32 *in_ext = (const VkBufferDeviceAddressCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->deviceAddress = in_ext->deviceAddress; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR: - { - VkVideoProfileListInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoProfileListInfoKHR32 *in_ext = (const VkVideoProfileListInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR; - out_ext->pNext = NULL; - out_ext->profileCount = in_ext->profileCount; - out_ext->pProfiles = convert_VkVideoProfileInfoKHR_array_win32_to_host(ctx, (const VkVideoProfileInfoKHR32 *)UlongToPtr(in_ext->pProfiles), in_ext->profileCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT: - { - VkOpaqueCaptureDescriptorDataCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *in_ext = (const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->opaqueCaptureDescriptorData = UlongToPtr(in_ext->opaqueCaptureDescriptorData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkBufferViewCreateInfo_win32_to_host(struct conversion_context *ctx, const VkBufferViewCreateInfo32 *in, VkBufferViewCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->buffer = in->buffer; - out->format = in->format; - out->offset = in->offset; - out->range = in->range; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO: - { - VkBufferUsageFlags2CreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBufferUsageFlags2CreateInfo32 *in_ext = (const VkBufferUsageFlags2CreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->usage = in_ext->usage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkCommandPoolCreateInfo_win32_to_host(const VkCommandPoolCreateInfo32 *in, VkCommandPoolCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->queueFamilyIndex = in->queueFamilyIndex; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineCreationFeedback_host_to_win32(const VkPipelineCreationFeedback *in, VkPipelineCreationFeedback32 *out) -{ - if (!in) return; - - out->flags = in->flags; - out->duration = in->duration; -} - -static inline VkPipelineCreationFeedback *convert_VkPipelineCreationFeedback_array_win32_to_host(struct conversion_context *ctx, const VkPipelineCreationFeedback32 *in, uint32_t count) -{ - VkPipelineCreationFeedback *out; - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - - return out; -} - -static inline void convert_VkPipelineCreationFeedback_array_host_to_win32(const VkPipelineCreationFeedback *in, VkPipelineCreationFeedback32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkPipelineCreationFeedback_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkSpecializationMapEntry_win32_to_host(const VkSpecializationMapEntry32 *in, VkSpecializationMapEntry *out) -{ - if (!in) return; - - out->constantID = in->constantID; - out->offset = in->offset; - out->size = in->size; -} - -static inline const VkSpecializationMapEntry *convert_VkSpecializationMapEntry_array_win32_to_host(struct conversion_context *ctx, const VkSpecializationMapEntry32 *in, uint32_t count) -{ - VkSpecializationMapEntry *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSpecializationMapEntry_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSpecializationInfo_win32_to_host(struct conversion_context *ctx, const VkSpecializationInfo32 *in, VkSpecializationInfo *out) -{ - if (!in) return; - - out->mapEntryCount = in->mapEntryCount; - out->pMapEntries = convert_VkSpecializationMapEntry_array_win32_to_host(ctx, (const VkSpecializationMapEntry32 *)UlongToPtr(in->pMapEntries), in->mapEntryCount); - out->dataSize = in->dataSize; - out->pData = UlongToPtr(in->pData); -} - -static inline const VkSpecializationInfo *convert_VkSpecializationInfo_array_win32_to_host(struct conversion_context *ctx, const VkSpecializationInfo32 *in, uint32_t count) -{ - VkSpecializationInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSpecializationInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkPipelineShaderStageCreateInfo_win64_to_host(struct conversion_context *ctx, const VkPipelineShaderStageCreateInfo *in, VkPipelineShaderStageCreateInfo *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->stage = in->stage; - out->module = in->module; - out->pName = in->pName; - out->pSpecializationInfo = in->pSpecializationInfo; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO: - { - VkShaderModuleCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkShaderModuleCreateInfo *in_ext = (const VkShaderModuleCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->codeSize = in_ext->codeSize; - out_ext->pCode = in_ext->pCode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: - { - VkShaderModuleValidationCacheCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkShaderModuleValidationCacheCreateInfoEXT *in_ext = (const VkShaderModuleValidationCacheCreateInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->validationCache = in_ext->validationCache; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT: - { - VkDebugUtilsObjectNameInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDebugUtilsObjectNameInfoEXT *in_ext = (const VkDebugUtilsObjectNameInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT; - out_ext->pNext = NULL; - out_ext->objectType = in_ext->objectType; - out_ext->objectHandle = wine_vk_unwrap_handle(in_ext->objectType, in_ext->objectHandle); - out_ext->pObjectName = in_ext->pObjectName; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO: - { - VkPipelineShaderStageRequiredSubgroupSizeCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineShaderStageRequiredSubgroupSizeCreateInfo *in_ext = (const VkPipelineShaderStageRequiredSubgroupSizeCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->requiredSubgroupSize = in_ext->requiredSubgroupSize; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT: - { - VkPipelineShaderStageModuleIdentifierCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineShaderStageModuleIdentifierCreateInfoEXT *in_ext = (const VkPipelineShaderStageModuleIdentifierCreateInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->identifierSize = in_ext->identifierSize; - out_ext->pIdentifier = in_ext->pIdentifier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO: - { - VkPipelineRobustnessCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRobustnessCreateInfo *in_ext = (const VkPipelineRobustnessCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->storageBuffers = in_ext->storageBuffers; - out_ext->uniformBuffers = in_ext->uniformBuffers; - out_ext->vertexInputs = in_ext->vertexInputs; - out_ext->images = in_ext->images; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} -#endif /* _WIN64 */ - -static inline void convert_VkPipelineShaderStageCreateInfo_win32_to_host(struct conversion_context *ctx, const VkPipelineShaderStageCreateInfo32 *in, VkPipelineShaderStageCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->stage = in->stage; - out->module = in->module; - out->pName = UlongToPtr(in->pName); - out->pSpecializationInfo = convert_VkSpecializationInfo_array_win32_to_host(ctx, (const VkSpecializationInfo32 *)UlongToPtr(in->pSpecializationInfo), 1); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO: - { - VkShaderModuleCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkShaderModuleCreateInfo32 *in_ext = (const VkShaderModuleCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->codeSize = in_ext->codeSize; - out_ext->pCode = UlongToPtr(in_ext->pCode); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: - { - VkShaderModuleValidationCacheCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkShaderModuleValidationCacheCreateInfoEXT32 *in_ext = (const VkShaderModuleValidationCacheCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->validationCache = in_ext->validationCache; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT: - { - VkDebugUtilsObjectNameInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDebugUtilsObjectNameInfoEXT32 *in_ext = (const VkDebugUtilsObjectNameInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT; - out_ext->pNext = NULL; - out_ext->objectType = in_ext->objectType; - out_ext->objectHandle = wine_vk_unwrap_handle(in_ext->objectType, in_ext->objectHandle); - out_ext->pObjectName = UlongToPtr(in_ext->pObjectName); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO: - { - VkPipelineShaderStageRequiredSubgroupSizeCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineShaderStageRequiredSubgroupSizeCreateInfo32 *in_ext = (const VkPipelineShaderStageRequiredSubgroupSizeCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->requiredSubgroupSize = in_ext->requiredSubgroupSize; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT: - { - VkPipelineShaderStageModuleIdentifierCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineShaderStageModuleIdentifierCreateInfoEXT32 *in_ext = (const VkPipelineShaderStageModuleIdentifierCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->identifierSize = in_ext->identifierSize; - out_ext->pIdentifier = UlongToPtr(in_ext->pIdentifier); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO: - { - VkPipelineRobustnessCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRobustnessCreateInfo32 *in_ext = (const VkPipelineRobustnessCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->storageBuffers = in_ext->storageBuffers; - out_ext->uniformBuffers = in_ext->uniformBuffers; - out_ext->vertexInputs = in_ext->vertexInputs; - out_ext->images = in_ext->images; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline void convert_VkComputePipelineCreateInfo_win64_to_host(struct conversion_context *ctx, const VkComputePipelineCreateInfo *in, VkComputePipelineCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->flags = in->flags; - convert_VkPipelineShaderStageCreateInfo_win64_to_host(ctx, &in->stage, &out->stage); - out->layout = in->layout; - out->basePipelineHandle = in->basePipelineHandle; - out->basePipelineIndex = in->basePipelineIndex; -} -#endif /* _WIN64 */ - -static inline void convert_VkComputePipelineCreateInfo_win32_to_host(struct conversion_context *ctx, const VkComputePipelineCreateInfo32 *in, VkComputePipelineCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - convert_VkPipelineShaderStageCreateInfo_win32_to_host(ctx, &in->stage, &out->stage); - out->layout = in->layout; - out->basePipelineHandle = in->basePipelineHandle; - out->basePipelineIndex = in->basePipelineIndex; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_INDIRECT_BUFFER_INFO_NV: - { - VkComputePipelineIndirectBufferInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkComputePipelineIndirectBufferInfoNV32 *in_ext = (const VkComputePipelineIndirectBufferInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_INDIRECT_BUFFER_INFO_NV; - out_ext->pNext = NULL; - out_ext->deviceAddress = in_ext->deviceAddress; - out_ext->size = in_ext->size; - out_ext->pipelineDeviceAddressCaptureReplay = in_ext->pipelineDeviceAddressCaptureReplay; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO: - { - VkPipelineCreateFlags2CreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreateFlags2CreateInfo32 *in_ext = (const VkPipelineCreateFlags2CreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR: - { - VkPipelineBinaryInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineBinaryInfoKHR32 *in_ext = (const VkPipelineBinaryInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR; - out_ext->pNext = NULL; - out_ext->binaryCount = in_ext->binaryCount; - out_ext->pPipelineBinaries = UlongToPtr(in_ext->pPipelineBinaries); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: - { - VkPipelineCreationFeedbackCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreationFeedbackCreateInfo32 *in_ext = (const VkPipelineCreationFeedbackCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->pPipelineCreationFeedback = convert_VkPipelineCreationFeedback_array_win32_to_host(ctx, (VkPipelineCreationFeedback32 *)UlongToPtr(in_ext->pPipelineCreationFeedback), 1); - out_ext->pipelineStageCreationFeedbackCount = in_ext->pipelineStageCreationFeedbackCount; - out_ext->pPipelineStageCreationFeedbacks = convert_VkPipelineCreationFeedback_array_win32_to_host(ctx, (VkPipelineCreationFeedback32 *)UlongToPtr(in_ext->pPipelineStageCreationFeedbacks), in_ext->pipelineStageCreationFeedbackCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI: - { - VkSubpassShadingPipelineCreateInfoHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSubpassShadingPipelineCreateInfoHUAWEI32 *in_ext = (const VkSubpassShadingPipelineCreateInfoHUAWEI32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI; - out_ext->pNext = NULL; - out_ext->renderPass = in_ext->renderPass; - out_ext->subpass = in_ext->subpass; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: - { - VkPipelineCompilerControlCreateInfoAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCompilerControlCreateInfoAMD32 *in_ext = (const VkPipelineCompilerControlCreateInfoAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD; - out_ext->pNext = NULL; - out_ext->compilerControlFlags = in_ext->compilerControlFlags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO: - { - VkPipelineRobustnessCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRobustnessCreateInfo32 *in_ext = (const VkPipelineRobustnessCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->storageBuffers = in_ext->storageBuffers; - out_ext->uniformBuffers = in_ext->uniformBuffers; - out_ext->vertexInputs = in_ext->vertexInputs; - out_ext->images = in_ext->images; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkComputePipelineCreateInfo_host_to_win32(const VkComputePipelineCreateInfo *in, const VkComputePipelineCreateInfo32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: - { - VkPipelineCreationFeedbackCreateInfo32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO); - const VkPipelineCreationFeedbackCreateInfo *in_ext = (const VkPipelineCreationFeedbackCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO; - convert_VkPipelineCreationFeedback_array_host_to_win32(in_ext->pPipelineCreationFeedback, (VkPipelineCreationFeedback32 *)UlongToPtr(out_ext->pPipelineCreationFeedback), 1); - convert_VkPipelineCreationFeedback_array_host_to_win32(in_ext->pPipelineStageCreationFeedbacks, (VkPipelineCreationFeedback32 *)UlongToPtr(out_ext->pPipelineStageCreationFeedbacks), in_ext->pipelineStageCreationFeedbackCount); - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -#ifdef _WIN64 -static inline const VkComputePipelineCreateInfo *convert_VkComputePipelineCreateInfo_array_win64_to_host(struct conversion_context *ctx, const VkComputePipelineCreateInfo *in, uint32_t count) -{ - VkComputePipelineCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkComputePipelineCreateInfo_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkComputePipelineCreateInfo *convert_VkComputePipelineCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkComputePipelineCreateInfo32 *in, uint32_t count) -{ - VkComputePipelineCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkComputePipelineCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkComputePipelineCreateInfo_array_host_to_win32(const VkComputePipelineCreateInfo *in, const VkComputePipelineCreateInfo32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkComputePipelineCreateInfo_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkCuFunctionCreateInfoNVX_win32_to_host(const VkCuFunctionCreateInfoNVX32 *in, VkCuFunctionCreateInfoNVX *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->module = in->module; - out->pName = UlongToPtr(in->pName); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCuModuleCreateInfoNVX_win32_to_host(struct conversion_context *ctx, const VkCuModuleCreateInfoNVX32 *in, VkCuModuleCreateInfoNVX *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->dataSize = in->dataSize; - out->pData = UlongToPtr(in->pData); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_CU_MODULE_TEXTURING_MODE_CREATE_INFO_NVX: - { - VkCuModuleTexturingModeCreateInfoNVX *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkCuModuleTexturingModeCreateInfoNVX32 *in_ext = (const VkCuModuleTexturingModeCreateInfoNVX32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_CU_MODULE_TEXTURING_MODE_CREATE_INFO_NVX; - out_ext->pNext = NULL; - out_ext->use64bitTexturing = in_ext->use64bitTexturing; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkCudaFunctionCreateInfoNV_win32_to_host(const VkCudaFunctionCreateInfoNV32 *in, VkCudaFunctionCreateInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->module = in->module; - out->pName = UlongToPtr(in->pName); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCudaModuleCreateInfoNV_win32_to_host(const VkCudaModuleCreateInfoNV32 *in, VkCudaModuleCreateInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->dataSize = in->dataSize; - out->pData = UlongToPtr(in->pData); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDebugReportCallbackCreateInfoEXT_win32_to_host(const VkDebugReportCallbackCreateInfoEXT32 *in, VkDebugReportCallbackCreateInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->pfnCallback = (PFN_vkDebugReportCallbackEXT)UlongToPtr(in->pfnCallback); - out->pUserData = UlongToPtr(in->pUserData); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDebugUtilsMessengerCreateInfoEXT_win32_to_host(const VkDebugUtilsMessengerCreateInfoEXT32 *in, VkDebugUtilsMessengerCreateInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->messageSeverity = in->messageSeverity; - out->messageType = in->messageType; - out->pfnUserCallback = (PFN_vkDebugUtilsMessengerCallbackEXT)UlongToPtr(in->pfnUserCallback); - out->pUserData = UlongToPtr(in->pUserData); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMutableDescriptorTypeListEXT_win32_to_host(const VkMutableDescriptorTypeListEXT32 *in, VkMutableDescriptorTypeListEXT *out) -{ - if (!in) return; - - out->descriptorTypeCount = in->descriptorTypeCount; - out->pDescriptorTypes = UlongToPtr(in->pDescriptorTypes); -} - -static inline const VkMutableDescriptorTypeListEXT *convert_VkMutableDescriptorTypeListEXT_array_win32_to_host(struct conversion_context *ctx, const VkMutableDescriptorTypeListEXT32 *in, uint32_t count) -{ - VkMutableDescriptorTypeListEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkMutableDescriptorTypeListEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDescriptorPoolCreateInfo_win32_to_host(struct conversion_context *ctx, const VkDescriptorPoolCreateInfo32 *in, VkDescriptorPoolCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->maxSets = in->maxSets; - out->poolSizeCount = in->poolSizeCount; - out->pPoolSizes = UlongToPtr(in->pPoolSizes); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO: - { - VkDescriptorPoolInlineUniformBlockCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDescriptorPoolInlineUniformBlockCreateInfo32 *in_ext = (const VkDescriptorPoolInlineUniformBlockCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->maxInlineUniformBlockBindings = in_ext->maxInlineUniformBlockBindings; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT: - { - VkMutableDescriptorTypeCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMutableDescriptorTypeCreateInfoEXT32 *in_ext = (const VkMutableDescriptorTypeCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->mutableDescriptorTypeListCount = in_ext->mutableDescriptorTypeListCount; - out_ext->pMutableDescriptorTypeLists = convert_VkMutableDescriptorTypeListEXT_array_win32_to_host(ctx, (const VkMutableDescriptorTypeListEXT32 *)UlongToPtr(in_ext->pMutableDescriptorTypeLists), in_ext->mutableDescriptorTypeListCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkDescriptorSetLayoutBinding_win32_to_host(const VkDescriptorSetLayoutBinding32 *in, VkDescriptorSetLayoutBinding *out) -{ - if (!in) return; - - out->binding = in->binding; - out->descriptorType = in->descriptorType; - out->descriptorCount = in->descriptorCount; - out->stageFlags = in->stageFlags; - out->pImmutableSamplers = UlongToPtr(in->pImmutableSamplers); -} - -static inline const VkDescriptorSetLayoutBinding *convert_VkDescriptorSetLayoutBinding_array_win32_to_host(struct conversion_context *ctx, const VkDescriptorSetLayoutBinding32 *in, uint32_t count) -{ - VkDescriptorSetLayoutBinding *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDescriptorSetLayoutBinding_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDescriptorSetLayoutCreateInfo_win32_to_host(struct conversion_context *ctx, const VkDescriptorSetLayoutCreateInfo32 *in, VkDescriptorSetLayoutCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->bindingCount = in->bindingCount; - out->pBindings = convert_VkDescriptorSetLayoutBinding_array_win32_to_host(ctx, (const VkDescriptorSetLayoutBinding32 *)UlongToPtr(in->pBindings), in->bindingCount); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: - { - VkDescriptorSetLayoutBindingFlagsCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDescriptorSetLayoutBindingFlagsCreateInfo32 *in_ext = (const VkDescriptorSetLayoutBindingFlagsCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->bindingCount = in_ext->bindingCount; - out_ext->pBindingFlags = UlongToPtr(in_ext->pBindingFlags); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT: - { - VkMutableDescriptorTypeCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMutableDescriptorTypeCreateInfoEXT32 *in_ext = (const VkMutableDescriptorTypeCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->mutableDescriptorTypeListCount = in_ext->mutableDescriptorTypeListCount; - out_ext->pMutableDescriptorTypeLists = convert_VkMutableDescriptorTypeListEXT_array_win32_to_host(ctx, (const VkMutableDescriptorTypeListEXT32 *)UlongToPtr(in_ext->pMutableDescriptorTypeLists), in_ext->mutableDescriptorTypeListCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkDescriptorUpdateTemplateEntry_win32_to_host(const VkDescriptorUpdateTemplateEntry32 *in, VkDescriptorUpdateTemplateEntry *out) -{ - if (!in) return; - - out->dstBinding = in->dstBinding; - out->dstArrayElement = in->dstArrayElement; - out->descriptorCount = in->descriptorCount; - out->descriptorType = in->descriptorType; - out->offset = in->offset; - out->stride = in->stride; -} - -static inline const VkDescriptorUpdateTemplateEntry *convert_VkDescriptorUpdateTemplateEntry_array_win32_to_host(struct conversion_context *ctx, const VkDescriptorUpdateTemplateEntry32 *in, uint32_t count) -{ - VkDescriptorUpdateTemplateEntry *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDescriptorUpdateTemplateEntry_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDescriptorUpdateTemplateCreateInfo_win32_to_host(struct conversion_context *ctx, const VkDescriptorUpdateTemplateCreateInfo32 *in, VkDescriptorUpdateTemplateCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->descriptorUpdateEntryCount = in->descriptorUpdateEntryCount; - out->pDescriptorUpdateEntries = convert_VkDescriptorUpdateTemplateEntry_array_win32_to_host(ctx, (const VkDescriptorUpdateTemplateEntry32 *)UlongToPtr(in->pDescriptorUpdateEntries), in->descriptorUpdateEntryCount); - out->templateType = in->templateType; - out->descriptorSetLayout = in->descriptorSetLayout; - out->pipelineBindPoint = in->pipelineBindPoint; - out->pipelineLayout = in->pipelineLayout; - out->set = in->set; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline const VkPhysicalDevice *convert_VkPhysicalDevice_array_win64_to_host(struct conversion_context *ctx, const VkPhysicalDevice *in, uint32_t count) -{ - VkPhysicalDevice *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = vulkan_physical_device_from_handle(in[i])->host.physical_device; - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkPhysicalDevice *convert_VkPhysicalDevice_array_win32_to_host(struct conversion_context *ctx, const PTR32 *in, uint32_t count) -{ - VkPhysicalDevice *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = vulkan_physical_device_from_handle(UlongToPtr(in[i]))->host.physical_device; - } - - return out; -} - -static inline void convert_VkDeviceQueueCreateInfo_win32_to_host(struct conversion_context *ctx, const VkDeviceQueueCreateInfo32 *in, VkDeviceQueueCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->queueFamilyIndex = in->queueFamilyIndex; - out->queueCount = in->queueCount; - out->pQueuePriorities = UlongToPtr(in->pQueuePriorities); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO: - { - VkDeviceQueueGlobalPriorityCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceQueueGlobalPriorityCreateInfo32 *in_ext = (const VkDeviceQueueGlobalPriorityCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->globalPriority = in_ext->globalPriority; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM: - { - VkDeviceQueueShaderCoreControlCreateInfoARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceQueueShaderCoreControlCreateInfoARM32 *in_ext = (const VkDeviceQueueShaderCoreControlCreateInfoARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM; - out_ext->pNext = NULL; - out_ext->shaderCoreCount = in_ext->shaderCoreCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkDeviceQueueCreateInfo *convert_VkDeviceQueueCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkDeviceQueueCreateInfo32 *in, uint32_t count) -{ - VkDeviceQueueCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDeviceQueueCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline const char * const*convert_char_pointer_array_win32_to_host(struct conversion_context *ctx, const PTR32 *in, uint32_t count) -{ - char **out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = UlongToPtr(in[i]); - } - - return (void *)out; -} - -#ifdef _WIN64 -static inline void convert_VkDeviceCreateInfo_win64_to_host(struct conversion_context *ctx, const VkDeviceCreateInfo *in, VkDeviceCreateInfo *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->queueCreateInfoCount = in->queueCreateInfoCount; - out->pQueueCreateInfos = in->pQueueCreateInfos; - out->enabledLayerCount = in->enabledLayerCount; - out->ppEnabledLayerNames = in->ppEnabledLayerNames; - out->enabledExtensionCount = in->enabledExtensionCount; - out->ppEnabledExtensionNames = in->ppEnabledExtensionNames; - out->pEnabledFeatures = in->pEnabledFeatures; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO: - break; - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->deviceGeneratedCommands = in_ext->deviceGeneratedCommands; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->deviceGeneratedCompute = in_ext->deviceGeneratedCompute; - out_ext->deviceGeneratedComputePipelines = in_ext->deviceGeneratedComputePipelines; - out_ext->deviceGeneratedComputeCaptureReplay = in_ext->deviceGeneratedComputeCaptureReplay; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO: - { - VkDevicePrivateDataCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDevicePrivateDataCreateInfo *in_ext = (const VkDevicePrivateDataCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->privateDataSlotRequestCount = in_ext->privateDataSlotRequestCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES: - { - VkPhysicalDevicePrivateDataFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePrivateDataFeatures *in_ext = (const VkPhysicalDevicePrivateDataFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES; - out_ext->pNext = NULL; - out_ext->privateData = in_ext->privateData; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: - { - VkPhysicalDeviceFeatures2 *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFeatures2 *in_ext = (const VkPhysicalDeviceFeatures2 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; - out_ext->pNext = NULL; - out_ext->features = in_ext->features; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: - { - VkPhysicalDeviceVariablePointersFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVariablePointersFeatures *in_ext = (const VkPhysicalDeviceVariablePointersFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES; - out_ext->pNext = NULL; - out_ext->variablePointersStorageBuffer = in_ext->variablePointersStorageBuffer; - out_ext->variablePointers = in_ext->variablePointers; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: - { - VkPhysicalDeviceMultiviewFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiviewFeatures *in_ext = (const VkPhysicalDeviceMultiviewFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES; - out_ext->pNext = NULL; - out_ext->multiview = in_ext->multiview; - out_ext->multiviewGeometryShader = in_ext->multiviewGeometryShader; - out_ext->multiviewTessellationShader = in_ext->multiviewTessellationShader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: - { - VkDeviceGroupDeviceCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceGroupDeviceCreateInfo *in_ext = (const VkDeviceGroupDeviceCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->physicalDeviceCount = in_ext->physicalDeviceCount; - out_ext->pPhysicalDevices = convert_VkPhysicalDevice_array_win64_to_host(ctx, in_ext->pPhysicalDevices, in_ext->physicalDeviceCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: - { - VkPhysicalDevicePresentIdFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentIdFeaturesKHR *in_ext = (const VkPhysicalDevicePresentIdFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->presentId = in_ext->presentId; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: - { - VkPhysicalDevicePresentWaitFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentWaitFeaturesKHR *in_ext = (const VkPhysicalDevicePresentWaitFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->presentWait = in_ext->presentWait; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: - { - VkPhysicalDevice16BitStorageFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevice16BitStorageFeatures *in_ext = (const VkPhysicalDevice16BitStorageFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES; - out_ext->pNext = NULL; - out_ext->storageBuffer16BitAccess = in_ext->storageBuffer16BitAccess; - out_ext->uniformAndStorageBuffer16BitAccess = in_ext->uniformAndStorageBuffer16BitAccess; - out_ext->storagePushConstant16 = in_ext->storagePushConstant16; - out_ext->storageInputOutput16 = in_ext->storageInputOutput16; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: - { - VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *in_ext = (const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderSubgroupExtendedTypes = in_ext->shaderSubgroupExtendedTypes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: - { - VkPhysicalDeviceSamplerYcbcrConversionFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSamplerYcbcrConversionFeatures *in_ext = (const VkPhysicalDeviceSamplerYcbcrConversionFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES; - out_ext->pNext = NULL; - out_ext->samplerYcbcrConversion = in_ext->samplerYcbcrConversion; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: - { - VkPhysicalDeviceProtectedMemoryFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceProtectedMemoryFeatures *in_ext = (const VkPhysicalDeviceProtectedMemoryFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES; - out_ext->pNext = NULL; - out_ext->protectedMemory = in_ext->protectedMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: - { - VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *in_ext = (const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->advancedBlendCoherentOperations = in_ext->advancedBlendCoherentOperations; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: - { - VkPhysicalDeviceMultiDrawFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiDrawFeaturesEXT *in_ext = (const VkPhysicalDeviceMultiDrawFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->multiDraw = in_ext->multiDraw; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES: - { - VkPhysicalDeviceInlineUniformBlockFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceInlineUniformBlockFeatures *in_ext = (const VkPhysicalDeviceInlineUniformBlockFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES; - out_ext->pNext = NULL; - out_ext->inlineUniformBlock = in_ext->inlineUniformBlock; - out_ext->descriptorBindingInlineUniformBlockUpdateAfterBind = in_ext->descriptorBindingInlineUniformBlockUpdateAfterBind; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES: - { - VkPhysicalDeviceMaintenance4Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMaintenance4Features *in_ext = (const VkPhysicalDeviceMaintenance4Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES; - out_ext->pNext = NULL; - out_ext->maintenance4 = in_ext->maintenance4; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES: - { - VkPhysicalDeviceMaintenance5Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMaintenance5Features *in_ext = (const VkPhysicalDeviceMaintenance5Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES; - out_ext->pNext = NULL; - out_ext->maintenance5 = in_ext->maintenance5; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES: - { - VkPhysicalDeviceMaintenance6Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMaintenance6Features *in_ext = (const VkPhysicalDeviceMaintenance6Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES; - out_ext->pNext = NULL; - out_ext->maintenance6 = in_ext->maintenance6; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: - { - VkPhysicalDeviceShaderDrawParametersFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderDrawParametersFeatures *in_ext = (const VkPhysicalDeviceShaderDrawParametersFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderDrawParameters = in_ext->shaderDrawParameters; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: - { - VkPhysicalDeviceShaderFloat16Int8Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderFloat16Int8Features *in_ext = (const VkPhysicalDeviceShaderFloat16Int8Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderFloat16 = in_ext->shaderFloat16; - out_ext->shaderInt8 = in_ext->shaderInt8; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: - { - VkPhysicalDeviceHostQueryResetFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceHostQueryResetFeatures *in_ext = (const VkPhysicalDeviceHostQueryResetFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES; - out_ext->pNext = NULL; - out_ext->hostQueryReset = in_ext->hostQueryReset; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES: - { - VkPhysicalDeviceGlobalPriorityQueryFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceGlobalPriorityQueryFeatures *in_ext = (const VkPhysicalDeviceGlobalPriorityQueryFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES; - out_ext->pNext = NULL; - out_ext->globalPriorityQuery = in_ext->globalPriorityQuery; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: - { - VkPhysicalDeviceDescriptorIndexingFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorIndexingFeatures *in_ext = (const VkPhysicalDeviceDescriptorIndexingFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderInputAttachmentArrayDynamicIndexing = in_ext->shaderInputAttachmentArrayDynamicIndexing; - out_ext->shaderUniformTexelBufferArrayDynamicIndexing = in_ext->shaderUniformTexelBufferArrayDynamicIndexing; - out_ext->shaderStorageTexelBufferArrayDynamicIndexing = in_ext->shaderStorageTexelBufferArrayDynamicIndexing; - out_ext->shaderUniformBufferArrayNonUniformIndexing = in_ext->shaderUniformBufferArrayNonUniformIndexing; - out_ext->shaderSampledImageArrayNonUniformIndexing = in_ext->shaderSampledImageArrayNonUniformIndexing; - out_ext->shaderStorageBufferArrayNonUniformIndexing = in_ext->shaderStorageBufferArrayNonUniformIndexing; - out_ext->shaderStorageImageArrayNonUniformIndexing = in_ext->shaderStorageImageArrayNonUniformIndexing; - out_ext->shaderInputAttachmentArrayNonUniformIndexing = in_ext->shaderInputAttachmentArrayNonUniformIndexing; - out_ext->shaderUniformTexelBufferArrayNonUniformIndexing = in_ext->shaderUniformTexelBufferArrayNonUniformIndexing; - out_ext->shaderStorageTexelBufferArrayNonUniformIndexing = in_ext->shaderStorageTexelBufferArrayNonUniformIndexing; - out_ext->descriptorBindingUniformBufferUpdateAfterBind = in_ext->descriptorBindingUniformBufferUpdateAfterBind; - out_ext->descriptorBindingSampledImageUpdateAfterBind = in_ext->descriptorBindingSampledImageUpdateAfterBind; - out_ext->descriptorBindingStorageImageUpdateAfterBind = in_ext->descriptorBindingStorageImageUpdateAfterBind; - out_ext->descriptorBindingStorageBufferUpdateAfterBind = in_ext->descriptorBindingStorageBufferUpdateAfterBind; - out_ext->descriptorBindingUniformTexelBufferUpdateAfterBind = in_ext->descriptorBindingUniformTexelBufferUpdateAfterBind; - out_ext->descriptorBindingStorageTexelBufferUpdateAfterBind = in_ext->descriptorBindingStorageTexelBufferUpdateAfterBind; - out_ext->descriptorBindingUpdateUnusedWhilePending = in_ext->descriptorBindingUpdateUnusedWhilePending; - out_ext->descriptorBindingPartiallyBound = in_ext->descriptorBindingPartiallyBound; - out_ext->descriptorBindingVariableDescriptorCount = in_ext->descriptorBindingVariableDescriptorCount; - out_ext->runtimeDescriptorArray = in_ext->runtimeDescriptorArray; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: - { - VkPhysicalDeviceTimelineSemaphoreFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTimelineSemaphoreFeatures *in_ext = (const VkPhysicalDeviceTimelineSemaphoreFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES; - out_ext->pNext = NULL; - out_ext->timelineSemaphore = in_ext->timelineSemaphore; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: - { - VkPhysicalDevice8BitStorageFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevice8BitStorageFeatures *in_ext = (const VkPhysicalDevice8BitStorageFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES; - out_ext->pNext = NULL; - out_ext->storageBuffer8BitAccess = in_ext->storageBuffer8BitAccess; - out_ext->uniformAndStorageBuffer8BitAccess = in_ext->uniformAndStorageBuffer8BitAccess; - out_ext->storagePushConstant8 = in_ext->storagePushConstant8; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: - { - VkPhysicalDeviceConditionalRenderingFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceConditionalRenderingFeaturesEXT *in_ext = (const VkPhysicalDeviceConditionalRenderingFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->conditionalRendering = in_ext->conditionalRendering; - out_ext->inheritedConditionalRendering = in_ext->inheritedConditionalRendering; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: - { - VkPhysicalDeviceVulkanMemoryModelFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkanMemoryModelFeatures *in_ext = (const VkPhysicalDeviceVulkanMemoryModelFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES; - out_ext->pNext = NULL; - out_ext->vulkanMemoryModel = in_ext->vulkanMemoryModel; - out_ext->vulkanMemoryModelDeviceScope = in_ext->vulkanMemoryModelDeviceScope; - out_ext->vulkanMemoryModelAvailabilityVisibilityChains = in_ext->vulkanMemoryModelAvailabilityVisibilityChains; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: - { - VkPhysicalDeviceShaderAtomicInt64Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicInt64Features *in_ext = (const VkPhysicalDeviceShaderAtomicInt64Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderBufferInt64Atomics = in_ext->shaderBufferInt64Atomics; - out_ext->shaderSharedInt64Atomics = in_ext->shaderSharedInt64Atomics; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: - { - VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *in_ext = (const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderBufferFloat32Atomics = in_ext->shaderBufferFloat32Atomics; - out_ext->shaderBufferFloat32AtomicAdd = in_ext->shaderBufferFloat32AtomicAdd; - out_ext->shaderBufferFloat64Atomics = in_ext->shaderBufferFloat64Atomics; - out_ext->shaderBufferFloat64AtomicAdd = in_ext->shaderBufferFloat64AtomicAdd; - out_ext->shaderSharedFloat32Atomics = in_ext->shaderSharedFloat32Atomics; - out_ext->shaderSharedFloat32AtomicAdd = in_ext->shaderSharedFloat32AtomicAdd; - out_ext->shaderSharedFloat64Atomics = in_ext->shaderSharedFloat64Atomics; - out_ext->shaderSharedFloat64AtomicAdd = in_ext->shaderSharedFloat64AtomicAdd; - out_ext->shaderImageFloat32Atomics = in_ext->shaderImageFloat32Atomics; - out_ext->shaderImageFloat32AtomicAdd = in_ext->shaderImageFloat32AtomicAdd; - out_ext->sparseImageFloat32Atomics = in_ext->sparseImageFloat32Atomics; - out_ext->sparseImageFloat32AtomicAdd = in_ext->sparseImageFloat32AtomicAdd; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: - { - VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT *in_ext = (const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderBufferFloat16Atomics = in_ext->shaderBufferFloat16Atomics; - out_ext->shaderBufferFloat16AtomicAdd = in_ext->shaderBufferFloat16AtomicAdd; - out_ext->shaderBufferFloat16AtomicMinMax = in_ext->shaderBufferFloat16AtomicMinMax; - out_ext->shaderBufferFloat32AtomicMinMax = in_ext->shaderBufferFloat32AtomicMinMax; - out_ext->shaderBufferFloat64AtomicMinMax = in_ext->shaderBufferFloat64AtomicMinMax; - out_ext->shaderSharedFloat16Atomics = in_ext->shaderSharedFloat16Atomics; - out_ext->shaderSharedFloat16AtomicAdd = in_ext->shaderSharedFloat16AtomicAdd; - out_ext->shaderSharedFloat16AtomicMinMax = in_ext->shaderSharedFloat16AtomicMinMax; - out_ext->shaderSharedFloat32AtomicMinMax = in_ext->shaderSharedFloat32AtomicMinMax; - out_ext->shaderSharedFloat64AtomicMinMax = in_ext->shaderSharedFloat64AtomicMinMax; - out_ext->shaderImageFloat32AtomicMinMax = in_ext->shaderImageFloat32AtomicMinMax; - out_ext->sparseImageFloat32AtomicMinMax = in_ext->sparseImageFloat32AtomicMinMax; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES: - { - VkPhysicalDeviceVertexAttributeDivisorFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVertexAttributeDivisorFeatures *in_ext = (const VkPhysicalDeviceVertexAttributeDivisorFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES; - out_ext->pNext = NULL; - out_ext->vertexAttributeInstanceRateDivisor = in_ext->vertexAttributeInstanceRateDivisor; - out_ext->vertexAttributeInstanceRateZeroDivisor = in_ext->vertexAttributeInstanceRateZeroDivisor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: - { - VkPhysicalDeviceASTCDecodeFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceASTCDecodeFeaturesEXT *in_ext = (const VkPhysicalDeviceASTCDecodeFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->decodeModeSharedExponent = in_ext->decodeModeSharedExponent; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: - { - VkPhysicalDeviceTransformFeedbackFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTransformFeedbackFeaturesEXT *in_ext = (const VkPhysicalDeviceTransformFeedbackFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->transformFeedback = in_ext->transformFeedback; - out_ext->geometryStreams = in_ext->geometryStreams; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: - { - VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV *in_ext = (const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->representativeFragmentTest = in_ext->representativeFragmentTest; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: - { - VkPhysicalDeviceExclusiveScissorFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExclusiveScissorFeaturesNV *in_ext = (const VkPhysicalDeviceExclusiveScissorFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->exclusiveScissor = in_ext->exclusiveScissor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: - { - VkPhysicalDeviceCornerSampledImageFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCornerSampledImageFeaturesNV *in_ext = (const VkPhysicalDeviceCornerSampledImageFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cornerSampledImage = in_ext->cornerSampledImage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR: - { - VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR *in_ext = (const VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->computeDerivativeGroupQuads = in_ext->computeDerivativeGroupQuads; - out_ext->computeDerivativeGroupLinear = in_ext->computeDerivativeGroupLinear; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: - { - VkPhysicalDeviceShaderImageFootprintFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderImageFootprintFeaturesNV *in_ext = (const VkPhysicalDeviceShaderImageFootprintFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->imageFootprint = in_ext->imageFootprint; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: - { - VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV *in_ext = (const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->dedicatedAllocationImageAliasing = in_ext->dedicatedAllocationImageAliasing; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV: - { - VkPhysicalDeviceCopyMemoryIndirectFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCopyMemoryIndirectFeaturesNV *in_ext = (const VkPhysicalDeviceCopyMemoryIndirectFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->indirectCopy = in_ext->indirectCopy; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV: - { - VkPhysicalDeviceMemoryDecompressionFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMemoryDecompressionFeaturesNV *in_ext = (const VkPhysicalDeviceMemoryDecompressionFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->memoryDecompression = in_ext->memoryDecompression; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: - { - VkPhysicalDeviceShadingRateImageFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShadingRateImageFeaturesNV *in_ext = (const VkPhysicalDeviceShadingRateImageFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->shadingRateImage = in_ext->shadingRateImage; - out_ext->shadingRateCoarseSampleOrder = in_ext->shadingRateCoarseSampleOrder; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: - { - VkPhysicalDeviceInvocationMaskFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI *in_ext = (const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->invocationMask = in_ext->invocationMask; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: - { - VkPhysicalDeviceMeshShaderFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMeshShaderFeaturesNV *in_ext = (const VkPhysicalDeviceMeshShaderFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->taskShader = in_ext->taskShader; - out_ext->meshShader = in_ext->meshShader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT: - { - VkPhysicalDeviceMeshShaderFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMeshShaderFeaturesEXT *in_ext = (const VkPhysicalDeviceMeshShaderFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->taskShader = in_ext->taskShader; - out_ext->meshShader = in_ext->meshShader; - out_ext->multiviewMeshShader = in_ext->multiviewMeshShader; - out_ext->primitiveFragmentShadingRateMeshShader = in_ext->primitiveFragmentShadingRateMeshShader; - out_ext->meshShaderQueries = in_ext->meshShaderQueries; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: - { - VkPhysicalDeviceAccelerationStructureFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAccelerationStructureFeaturesKHR *in_ext = (const VkPhysicalDeviceAccelerationStructureFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->accelerationStructure = in_ext->accelerationStructure; - out_ext->accelerationStructureCaptureReplay = in_ext->accelerationStructureCaptureReplay; - out_ext->accelerationStructureIndirectBuild = in_ext->accelerationStructureIndirectBuild; - out_ext->accelerationStructureHostCommands = in_ext->accelerationStructureHostCommands; - out_ext->descriptorBindingAccelerationStructureUpdateAfterBind = in_ext->descriptorBindingAccelerationStructureUpdateAfterBind; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingPipelineFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingPipelineFeaturesKHR *in_ext = (const VkPhysicalDeviceRayTracingPipelineFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayTracingPipeline = in_ext->rayTracingPipeline; - out_ext->rayTracingPipelineShaderGroupHandleCaptureReplay = in_ext->rayTracingPipelineShaderGroupHandleCaptureReplay; - out_ext->rayTracingPipelineShaderGroupHandleCaptureReplayMixed = in_ext->rayTracingPipelineShaderGroupHandleCaptureReplayMixed; - out_ext->rayTracingPipelineTraceRaysIndirect = in_ext->rayTracingPipelineTraceRaysIndirect; - out_ext->rayTraversalPrimitiveCulling = in_ext->rayTraversalPrimitiveCulling; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: - { - VkPhysicalDeviceRayQueryFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayQueryFeaturesKHR *in_ext = (const VkPhysicalDeviceRayQueryFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayQuery = in_ext->rayQuery; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR *in_ext = (const VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayTracingMaintenance1 = in_ext->rayTracingMaintenance1; - out_ext->rayTracingPipelineTraceRaysIndirect2 = in_ext->rayTracingPipelineTraceRaysIndirect2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: - { - VkDeviceMemoryOverallocationCreateInfoAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceMemoryOverallocationCreateInfoAMD *in_ext = (const VkDeviceMemoryOverallocationCreateInfoAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD; - out_ext->pNext = NULL; - out_ext->overallocationBehavior = in_ext->overallocationBehavior; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: - { - VkPhysicalDeviceFragmentDensityMapFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentDensityMapFeaturesEXT *in_ext = (const VkPhysicalDeviceFragmentDensityMapFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->fragmentDensityMap = in_ext->fragmentDensityMap; - out_ext->fragmentDensityMapDynamic = in_ext->fragmentDensityMapDynamic; - out_ext->fragmentDensityMapNonSubsampledImages = in_ext->fragmentDensityMapNonSubsampledImages; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: - { - VkPhysicalDeviceFragmentDensityMap2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT *in_ext = (const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->fragmentDensityMapDeferred = in_ext->fragmentDensityMapDeferred; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM: - { - VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM *in_ext = (const VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->fragmentDensityMapOffset = in_ext->fragmentDensityMapOffset; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: - { - VkPhysicalDeviceScalarBlockLayoutFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceScalarBlockLayoutFeatures *in_ext = (const VkPhysicalDeviceScalarBlockLayoutFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES; - out_ext->pNext = NULL; - out_ext->scalarBlockLayout = in_ext->scalarBlockLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: - { - VkPhysicalDeviceUniformBufferStandardLayoutFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceUniformBufferStandardLayoutFeatures *in_ext = (const VkPhysicalDeviceUniformBufferStandardLayoutFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES; - out_ext->pNext = NULL; - out_ext->uniformBufferStandardLayout = in_ext->uniformBufferStandardLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: - { - VkPhysicalDeviceDepthClipEnableFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClipEnableFeaturesEXT *in_ext = (const VkPhysicalDeviceDepthClipEnableFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClipEnable = in_ext->depthClipEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: - { - VkPhysicalDeviceMemoryPriorityFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMemoryPriorityFeaturesEXT *in_ext = (const VkPhysicalDeviceMemoryPriorityFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->memoryPriority = in_ext->memoryPriority; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: - { - VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT *in_ext = (const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pageableDeviceLocalMemory = in_ext->pageableDeviceLocalMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: - { - VkPhysicalDeviceBufferDeviceAddressFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBufferDeviceAddressFeatures *in_ext = (const VkPhysicalDeviceBufferDeviceAddressFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES; - out_ext->pNext = NULL; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: - { - VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *in_ext = (const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: - { - VkPhysicalDeviceImagelessFramebufferFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImagelessFramebufferFeatures *in_ext = (const VkPhysicalDeviceImagelessFramebufferFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES; - out_ext->pNext = NULL; - out_ext->imagelessFramebuffer = in_ext->imagelessFramebuffer; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES: - { - VkPhysicalDeviceTextureCompressionASTCHDRFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTextureCompressionASTCHDRFeatures *in_ext = (const VkPhysicalDeviceTextureCompressionASTCHDRFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES; - out_ext->pNext = NULL; - out_ext->textureCompressionASTC_HDR = in_ext->textureCompressionASTC_HDR; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: - { - VkPhysicalDeviceCooperativeMatrixFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCooperativeMatrixFeaturesNV *in_ext = (const VkPhysicalDeviceCooperativeMatrixFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cooperativeMatrix = in_ext->cooperativeMatrix; - out_ext->cooperativeMatrixRobustBufferAccess = in_ext->cooperativeMatrixRobustBufferAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: - { - VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *in_ext = (const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->ycbcrImageArrays = in_ext->ycbcrImageArrays; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV: - { - VkPhysicalDevicePresentBarrierFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentBarrierFeaturesNV *in_ext = (const VkPhysicalDevicePresentBarrierFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->presentBarrier = in_ext->presentBarrier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: - { - VkPhysicalDevicePerformanceQueryFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePerformanceQueryFeaturesKHR *in_ext = (const VkPhysicalDevicePerformanceQueryFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->performanceCounterQueryPools = in_ext->performanceCounterQueryPools; - out_ext->performanceCounterMultipleQueryPools = in_ext->performanceCounterMultipleQueryPools; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_RESERVATION_INFO_KHR: - { - VkPerformanceQueryReservationInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPerformanceQueryReservationInfoKHR *in_ext = (const VkPerformanceQueryReservationInfoKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_RESERVATION_INFO_KHR; - out_ext->pNext = NULL; - out_ext->maxPerformanceQueriesPerPool = in_ext->maxPerformanceQueriesPerPool; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: - { - VkPhysicalDeviceCoverageReductionModeFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCoverageReductionModeFeaturesNV *in_ext = (const VkPhysicalDeviceCoverageReductionModeFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->coverageReductionMode = in_ext->coverageReductionMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: - { - VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL *in_ext = (const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL; - out_ext->pNext = NULL; - out_ext->shaderIntegerFunctions2 = in_ext->shaderIntegerFunctions2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: - { - VkPhysicalDeviceShaderClockFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderClockFeaturesKHR *in_ext = (const VkPhysicalDeviceShaderClockFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderSubgroupClock = in_ext->shaderSubgroupClock; - out_ext->shaderDeviceClock = in_ext->shaderDeviceClock; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES: - { - VkPhysicalDeviceIndexTypeUint8Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceIndexTypeUint8Features *in_ext = (const VkPhysicalDeviceIndexTypeUint8Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES; - out_ext->pNext = NULL; - out_ext->indexTypeUint8 = in_ext->indexTypeUint8; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: - { - VkPhysicalDeviceShaderSMBuiltinsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV *in_ext = (const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->shaderSMBuiltins = in_ext->shaderSMBuiltins; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: - { - VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *in_ext = (const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->fragmentShaderSampleInterlock = in_ext->fragmentShaderSampleInterlock; - out_ext->fragmentShaderPixelInterlock = in_ext->fragmentShaderPixelInterlock; - out_ext->fragmentShaderShadingRateInterlock = in_ext->fragmentShaderShadingRateInterlock; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: - { - VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures *in_ext = (const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES; - out_ext->pNext = NULL; - out_ext->separateDepthStencilLayouts = in_ext->separateDepthStencilLayouts; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: - { - VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT *in_ext = (const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->primitiveTopologyListRestart = in_ext->primitiveTopologyListRestart; - out_ext->primitiveTopologyPatchListRestart = in_ext->primitiveTopologyPatchListRestart; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: - { - VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR *in_ext = (const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->pipelineExecutableInfo = in_ext->pipelineExecutableInfo; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES: - { - VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures *in_ext = (const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderDemoteToHelperInvocation = in_ext->shaderDemoteToHelperInvocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: - { - VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *in_ext = (const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->texelBufferAlignment = in_ext->texelBufferAlignment; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES: - { - VkPhysicalDeviceSubgroupSizeControlFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSubgroupSizeControlFeatures *in_ext = (const VkPhysicalDeviceSubgroupSizeControlFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES; - out_ext->pNext = NULL; - out_ext->subgroupSizeControl = in_ext->subgroupSizeControl; - out_ext->computeFullSubgroups = in_ext->computeFullSubgroups; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES: - { - VkPhysicalDeviceLineRasterizationFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLineRasterizationFeatures *in_ext = (const VkPhysicalDeviceLineRasterizationFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES; - out_ext->pNext = NULL; - out_ext->rectangularLines = in_ext->rectangularLines; - out_ext->bresenhamLines = in_ext->bresenhamLines; - out_ext->smoothLines = in_ext->smoothLines; - out_ext->stippledRectangularLines = in_ext->stippledRectangularLines; - out_ext->stippledBresenhamLines = in_ext->stippledBresenhamLines; - out_ext->stippledSmoothLines = in_ext->stippledSmoothLines; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: - { - VkPhysicalDevicePipelineCreationCacheControlFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineCreationCacheControlFeatures *in_ext = (const VkPhysicalDevicePipelineCreationCacheControlFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES; - out_ext->pNext = NULL; - out_ext->pipelineCreationCacheControl = in_ext->pipelineCreationCacheControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: - { - VkPhysicalDeviceVulkan11Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan11Features *in_ext = (const VkPhysicalDeviceVulkan11Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES; - out_ext->pNext = NULL; - out_ext->storageBuffer16BitAccess = in_ext->storageBuffer16BitAccess; - out_ext->uniformAndStorageBuffer16BitAccess = in_ext->uniformAndStorageBuffer16BitAccess; - out_ext->storagePushConstant16 = in_ext->storagePushConstant16; - out_ext->storageInputOutput16 = in_ext->storageInputOutput16; - out_ext->multiview = in_ext->multiview; - out_ext->multiviewGeometryShader = in_ext->multiviewGeometryShader; - out_ext->multiviewTessellationShader = in_ext->multiviewTessellationShader; - out_ext->variablePointersStorageBuffer = in_ext->variablePointersStorageBuffer; - out_ext->variablePointers = in_ext->variablePointers; - out_ext->protectedMemory = in_ext->protectedMemory; - out_ext->samplerYcbcrConversion = in_ext->samplerYcbcrConversion; - out_ext->shaderDrawParameters = in_ext->shaderDrawParameters; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: - { - VkPhysicalDeviceVulkan12Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan12Features *in_ext = (const VkPhysicalDeviceVulkan12Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES; - out_ext->pNext = NULL; - out_ext->samplerMirrorClampToEdge = in_ext->samplerMirrorClampToEdge; - out_ext->drawIndirectCount = in_ext->drawIndirectCount; - out_ext->storageBuffer8BitAccess = in_ext->storageBuffer8BitAccess; - out_ext->uniformAndStorageBuffer8BitAccess = in_ext->uniformAndStorageBuffer8BitAccess; - out_ext->storagePushConstant8 = in_ext->storagePushConstant8; - out_ext->shaderBufferInt64Atomics = in_ext->shaderBufferInt64Atomics; - out_ext->shaderSharedInt64Atomics = in_ext->shaderSharedInt64Atomics; - out_ext->shaderFloat16 = in_ext->shaderFloat16; - out_ext->shaderInt8 = in_ext->shaderInt8; - out_ext->descriptorIndexing = in_ext->descriptorIndexing; - out_ext->shaderInputAttachmentArrayDynamicIndexing = in_ext->shaderInputAttachmentArrayDynamicIndexing; - out_ext->shaderUniformTexelBufferArrayDynamicIndexing = in_ext->shaderUniformTexelBufferArrayDynamicIndexing; - out_ext->shaderStorageTexelBufferArrayDynamicIndexing = in_ext->shaderStorageTexelBufferArrayDynamicIndexing; - out_ext->shaderUniformBufferArrayNonUniformIndexing = in_ext->shaderUniformBufferArrayNonUniformIndexing; - out_ext->shaderSampledImageArrayNonUniformIndexing = in_ext->shaderSampledImageArrayNonUniformIndexing; - out_ext->shaderStorageBufferArrayNonUniformIndexing = in_ext->shaderStorageBufferArrayNonUniformIndexing; - out_ext->shaderStorageImageArrayNonUniformIndexing = in_ext->shaderStorageImageArrayNonUniformIndexing; - out_ext->shaderInputAttachmentArrayNonUniformIndexing = in_ext->shaderInputAttachmentArrayNonUniformIndexing; - out_ext->shaderUniformTexelBufferArrayNonUniformIndexing = in_ext->shaderUniformTexelBufferArrayNonUniformIndexing; - out_ext->shaderStorageTexelBufferArrayNonUniformIndexing = in_ext->shaderStorageTexelBufferArrayNonUniformIndexing; - out_ext->descriptorBindingUniformBufferUpdateAfterBind = in_ext->descriptorBindingUniformBufferUpdateAfterBind; - out_ext->descriptorBindingSampledImageUpdateAfterBind = in_ext->descriptorBindingSampledImageUpdateAfterBind; - out_ext->descriptorBindingStorageImageUpdateAfterBind = in_ext->descriptorBindingStorageImageUpdateAfterBind; - out_ext->descriptorBindingStorageBufferUpdateAfterBind = in_ext->descriptorBindingStorageBufferUpdateAfterBind; - out_ext->descriptorBindingUniformTexelBufferUpdateAfterBind = in_ext->descriptorBindingUniformTexelBufferUpdateAfterBind; - out_ext->descriptorBindingStorageTexelBufferUpdateAfterBind = in_ext->descriptorBindingStorageTexelBufferUpdateAfterBind; - out_ext->descriptorBindingUpdateUnusedWhilePending = in_ext->descriptorBindingUpdateUnusedWhilePending; - out_ext->descriptorBindingPartiallyBound = in_ext->descriptorBindingPartiallyBound; - out_ext->descriptorBindingVariableDescriptorCount = in_ext->descriptorBindingVariableDescriptorCount; - out_ext->runtimeDescriptorArray = in_ext->runtimeDescriptorArray; - out_ext->samplerFilterMinmax = in_ext->samplerFilterMinmax; - out_ext->scalarBlockLayout = in_ext->scalarBlockLayout; - out_ext->imagelessFramebuffer = in_ext->imagelessFramebuffer; - out_ext->uniformBufferStandardLayout = in_ext->uniformBufferStandardLayout; - out_ext->shaderSubgroupExtendedTypes = in_ext->shaderSubgroupExtendedTypes; - out_ext->separateDepthStencilLayouts = in_ext->separateDepthStencilLayouts; - out_ext->hostQueryReset = in_ext->hostQueryReset; - out_ext->timelineSemaphore = in_ext->timelineSemaphore; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_ext->vulkanMemoryModel = in_ext->vulkanMemoryModel; - out_ext->vulkanMemoryModelDeviceScope = in_ext->vulkanMemoryModelDeviceScope; - out_ext->vulkanMemoryModelAvailabilityVisibilityChains = in_ext->vulkanMemoryModelAvailabilityVisibilityChains; - out_ext->shaderOutputViewportIndex = in_ext->shaderOutputViewportIndex; - out_ext->shaderOutputLayer = in_ext->shaderOutputLayer; - out_ext->subgroupBroadcastDynamicId = in_ext->subgroupBroadcastDynamicId; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES: - { - VkPhysicalDeviceVulkan13Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan13Features *in_ext = (const VkPhysicalDeviceVulkan13Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES; - out_ext->pNext = NULL; - out_ext->robustImageAccess = in_ext->robustImageAccess; - out_ext->inlineUniformBlock = in_ext->inlineUniformBlock; - out_ext->descriptorBindingInlineUniformBlockUpdateAfterBind = in_ext->descriptorBindingInlineUniformBlockUpdateAfterBind; - out_ext->pipelineCreationCacheControl = in_ext->pipelineCreationCacheControl; - out_ext->privateData = in_ext->privateData; - out_ext->shaderDemoteToHelperInvocation = in_ext->shaderDemoteToHelperInvocation; - out_ext->shaderTerminateInvocation = in_ext->shaderTerminateInvocation; - out_ext->subgroupSizeControl = in_ext->subgroupSizeControl; - out_ext->computeFullSubgroups = in_ext->computeFullSubgroups; - out_ext->synchronization2 = in_ext->synchronization2; - out_ext->textureCompressionASTC_HDR = in_ext->textureCompressionASTC_HDR; - out_ext->shaderZeroInitializeWorkgroupMemory = in_ext->shaderZeroInitializeWorkgroupMemory; - out_ext->dynamicRendering = in_ext->dynamicRendering; - out_ext->shaderIntegerDotProduct = in_ext->shaderIntegerDotProduct; - out_ext->maintenance4 = in_ext->maintenance4; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES: - { - VkPhysicalDeviceVulkan14Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan14Features *in_ext = (const VkPhysicalDeviceVulkan14Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES; - out_ext->pNext = NULL; - out_ext->globalPriorityQuery = in_ext->globalPriorityQuery; - out_ext->shaderSubgroupRotate = in_ext->shaderSubgroupRotate; - out_ext->shaderSubgroupRotateClustered = in_ext->shaderSubgroupRotateClustered; - out_ext->shaderFloatControls2 = in_ext->shaderFloatControls2; - out_ext->shaderExpectAssume = in_ext->shaderExpectAssume; - out_ext->rectangularLines = in_ext->rectangularLines; - out_ext->bresenhamLines = in_ext->bresenhamLines; - out_ext->smoothLines = in_ext->smoothLines; - out_ext->stippledRectangularLines = in_ext->stippledRectangularLines; - out_ext->stippledBresenhamLines = in_ext->stippledBresenhamLines; - out_ext->stippledSmoothLines = in_ext->stippledSmoothLines; - out_ext->vertexAttributeInstanceRateDivisor = in_ext->vertexAttributeInstanceRateDivisor; - out_ext->vertexAttributeInstanceRateZeroDivisor = in_ext->vertexAttributeInstanceRateZeroDivisor; - out_ext->indexTypeUint8 = in_ext->indexTypeUint8; - out_ext->dynamicRenderingLocalRead = in_ext->dynamicRenderingLocalRead; - out_ext->maintenance5 = in_ext->maintenance5; - out_ext->maintenance6 = in_ext->maintenance6; - out_ext->pipelineProtectedAccess = in_ext->pipelineProtectedAccess; - out_ext->pipelineRobustness = in_ext->pipelineRobustness; - out_ext->hostImageCopy = in_ext->hostImageCopy; - out_ext->pushDescriptor = in_ext->pushDescriptor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: - { - VkPhysicalDeviceCoherentMemoryFeaturesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCoherentMemoryFeaturesAMD *in_ext = (const VkPhysicalDeviceCoherentMemoryFeaturesAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD; - out_ext->pNext = NULL; - out_ext->deviceCoherentMemory = in_ext->deviceCoherentMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: - { - VkPhysicalDeviceCustomBorderColorFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCustomBorderColorFeaturesEXT *in_ext = (const VkPhysicalDeviceCustomBorderColorFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->customBorderColors = in_ext->customBorderColors; - out_ext->customBorderColorWithoutFormat = in_ext->customBorderColorWithoutFormat; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: - { - VkPhysicalDeviceBorderColorSwizzleFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT *in_ext = (const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->borderColorSwizzle = in_ext->borderColorSwizzle; - out_ext->borderColorSwizzleFromImage = in_ext->borderColorSwizzleFromImage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *in_ext = (const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->extendedDynamicState = in_ext->extendedDynamicState; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *in_ext = (const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->extendedDynamicState2 = in_ext->extendedDynamicState2; - out_ext->extendedDynamicState2LogicOp = in_ext->extendedDynamicState2LogicOp; - out_ext->extendedDynamicState2PatchControlPoints = in_ext->extendedDynamicState2PatchControlPoints; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicState3FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicState3FeaturesEXT *in_ext = (const VkPhysicalDeviceExtendedDynamicState3FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->extendedDynamicState3TessellationDomainOrigin = in_ext->extendedDynamicState3TessellationDomainOrigin; - out_ext->extendedDynamicState3DepthClampEnable = in_ext->extendedDynamicState3DepthClampEnable; - out_ext->extendedDynamicState3PolygonMode = in_ext->extendedDynamicState3PolygonMode; - out_ext->extendedDynamicState3RasterizationSamples = in_ext->extendedDynamicState3RasterizationSamples; - out_ext->extendedDynamicState3SampleMask = in_ext->extendedDynamicState3SampleMask; - out_ext->extendedDynamicState3AlphaToCoverageEnable = in_ext->extendedDynamicState3AlphaToCoverageEnable; - out_ext->extendedDynamicState3AlphaToOneEnable = in_ext->extendedDynamicState3AlphaToOneEnable; - out_ext->extendedDynamicState3LogicOpEnable = in_ext->extendedDynamicState3LogicOpEnable; - out_ext->extendedDynamicState3ColorBlendEnable = in_ext->extendedDynamicState3ColorBlendEnable; - out_ext->extendedDynamicState3ColorBlendEquation = in_ext->extendedDynamicState3ColorBlendEquation; - out_ext->extendedDynamicState3ColorWriteMask = in_ext->extendedDynamicState3ColorWriteMask; - out_ext->extendedDynamicState3RasterizationStream = in_ext->extendedDynamicState3RasterizationStream; - out_ext->extendedDynamicState3ConservativeRasterizationMode = in_ext->extendedDynamicState3ConservativeRasterizationMode; - out_ext->extendedDynamicState3ExtraPrimitiveOverestimationSize = in_ext->extendedDynamicState3ExtraPrimitiveOverestimationSize; - out_ext->extendedDynamicState3DepthClipEnable = in_ext->extendedDynamicState3DepthClipEnable; - out_ext->extendedDynamicState3SampleLocationsEnable = in_ext->extendedDynamicState3SampleLocationsEnable; - out_ext->extendedDynamicState3ColorBlendAdvanced = in_ext->extendedDynamicState3ColorBlendAdvanced; - out_ext->extendedDynamicState3ProvokingVertexMode = in_ext->extendedDynamicState3ProvokingVertexMode; - out_ext->extendedDynamicState3LineRasterizationMode = in_ext->extendedDynamicState3LineRasterizationMode; - out_ext->extendedDynamicState3LineStippleEnable = in_ext->extendedDynamicState3LineStippleEnable; - out_ext->extendedDynamicState3DepthClipNegativeOneToOne = in_ext->extendedDynamicState3DepthClipNegativeOneToOne; - out_ext->extendedDynamicState3ViewportWScalingEnable = in_ext->extendedDynamicState3ViewportWScalingEnable; - out_ext->extendedDynamicState3ViewportSwizzle = in_ext->extendedDynamicState3ViewportSwizzle; - out_ext->extendedDynamicState3CoverageToColorEnable = in_ext->extendedDynamicState3CoverageToColorEnable; - out_ext->extendedDynamicState3CoverageToColorLocation = in_ext->extendedDynamicState3CoverageToColorLocation; - out_ext->extendedDynamicState3CoverageModulationMode = in_ext->extendedDynamicState3CoverageModulationMode; - out_ext->extendedDynamicState3CoverageModulationTableEnable = in_ext->extendedDynamicState3CoverageModulationTableEnable; - out_ext->extendedDynamicState3CoverageModulationTable = in_ext->extendedDynamicState3CoverageModulationTable; - out_ext->extendedDynamicState3CoverageReductionMode = in_ext->extendedDynamicState3CoverageReductionMode; - out_ext->extendedDynamicState3RepresentativeFragmentTestEnable = in_ext->extendedDynamicState3RepresentativeFragmentTestEnable; - out_ext->extendedDynamicState3ShadingRateImageEnable = in_ext->extendedDynamicState3ShadingRateImageEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: - { - VkPhysicalDeviceDiagnosticsConfigFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDiagnosticsConfigFeaturesNV *in_ext = (const VkPhysicalDeviceDiagnosticsConfigFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->diagnosticsConfig = in_ext->diagnosticsConfig; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV: - { - VkDeviceDiagnosticsConfigCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceDiagnosticsConfigCreateInfoNV *in_ext = (const VkDeviceDiagnosticsConfigCreateInfoNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES: - { - VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures *in_ext = (const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderZeroInitializeWorkgroupMemory = in_ext->shaderZeroInitializeWorkgroupMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: - { - VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR *in_ext = (const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderSubgroupUniformControlFlow = in_ext->shaderSubgroupUniformControlFlow; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: - { - VkPhysicalDeviceRobustness2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRobustness2FeaturesEXT *in_ext = (const VkPhysicalDeviceRobustness2FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->robustBufferAccess2 = in_ext->robustBufferAccess2; - out_ext->robustImageAccess2 = in_ext->robustImageAccess2; - out_ext->nullDescriptor = in_ext->nullDescriptor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES: - { - VkPhysicalDeviceImageRobustnessFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageRobustnessFeatures *in_ext = (const VkPhysicalDeviceImageRobustnessFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES; - out_ext->pNext = NULL; - out_ext->robustImageAccess = in_ext->robustImageAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: - { - VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR *in_ext = (const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->workgroupMemoryExplicitLayout = in_ext->workgroupMemoryExplicitLayout; - out_ext->workgroupMemoryExplicitLayoutScalarBlockLayout = in_ext->workgroupMemoryExplicitLayoutScalarBlockLayout; - out_ext->workgroupMemoryExplicitLayout8BitAccess = in_ext->workgroupMemoryExplicitLayout8BitAccess; - out_ext->workgroupMemoryExplicitLayout16BitAccess = in_ext->workgroupMemoryExplicitLayout16BitAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: - { - VkPhysicalDevice4444FormatsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevice4444FormatsFeaturesEXT *in_ext = (const VkPhysicalDevice4444FormatsFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->formatA4R4G4B4 = in_ext->formatA4R4G4B4; - out_ext->formatA4B4G4R4 = in_ext->formatA4B4G4R4; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: - { - VkPhysicalDeviceSubpassShadingFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI *in_ext = (const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->subpassShading = in_ext->subpassShading; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI: - { - VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI *in_ext = (const VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->clustercullingShader = in_ext->clustercullingShader; - out_ext->multiviewClusterCullingShader = in_ext->multiviewClusterCullingShader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: - { - VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT *in_ext = (const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderImageInt64Atomics = in_ext->shaderImageInt64Atomics; - out_ext->sparseImageInt64Atomics = in_ext->sparseImageInt64Atomics; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: - { - VkPhysicalDeviceFragmentShadingRateFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShadingRateFeaturesKHR *in_ext = (const VkPhysicalDeviceFragmentShadingRateFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->pipelineFragmentShadingRate = in_ext->pipelineFragmentShadingRate; - out_ext->primitiveFragmentShadingRate = in_ext->primitiveFragmentShadingRate; - out_ext->attachmentFragmentShadingRate = in_ext->attachmentFragmentShadingRate; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES: - { - VkPhysicalDeviceShaderTerminateInvocationFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderTerminateInvocationFeatures *in_ext = (const VkPhysicalDeviceShaderTerminateInvocationFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderTerminateInvocation = in_ext->shaderTerminateInvocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: - { - VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV *in_ext = (const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->fragmentShadingRateEnums = in_ext->fragmentShadingRateEnums; - out_ext->supersampleFragmentShadingRates = in_ext->supersampleFragmentShadingRates; - out_ext->noInvocationFragmentShadingRates = in_ext->noInvocationFragmentShadingRates; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT: - { - VkPhysicalDeviceImage2DViewOf3DFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImage2DViewOf3DFeaturesEXT *in_ext = (const VkPhysicalDeviceImage2DViewOf3DFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->image2DViewOf3D = in_ext->image2DViewOf3D; - out_ext->sampler2DViewOf3D = in_ext->sampler2DViewOf3D; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT: - { - VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT *in_ext = (const VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->imageSlicedViewOf3D = in_ext->imageSlicedViewOf3D; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT *in_ext = (const VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->attachmentFeedbackLoopDynamicState = in_ext->attachmentFeedbackLoopDynamicState; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT: - { - VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT *in_ext = (const VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->legacyVertexAttributes = in_ext->legacyVertexAttributes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT: - { - VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT *in_ext = (const VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->mutableDescriptorType = in_ext->mutableDescriptorType; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthClipControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClipControlFeaturesEXT *in_ext = (const VkPhysicalDeviceDepthClipControlFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClipControl = in_ext->depthClipControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_EXT: - { - VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->deviceGeneratedCommands = in_ext->deviceGeneratedCommands; - out_ext->dynamicGeneratedPipelineLayout = in_ext->dynamicGeneratedPipelineLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthClampControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClampControlFeaturesEXT *in_ext = (const VkPhysicalDeviceDepthClampControlFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClampControl = in_ext->depthClampControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *in_ext = (const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->vertexInputDynamicState = in_ext->vertexInputDynamicState; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR: - { - VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR *in_ext = (const VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderRelaxedExtendedInstruction = in_ext->shaderRelaxedExtendedInstruction; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: - { - VkPhysicalDeviceColorWriteEnableFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceColorWriteEnableFeaturesEXT *in_ext = (const VkPhysicalDeviceColorWriteEnableFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->colorWriteEnable = in_ext->colorWriteEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES: - { - VkPhysicalDeviceSynchronization2Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSynchronization2Features *in_ext = (const VkPhysicalDeviceSynchronization2Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES; - out_ext->pNext = NULL; - out_ext->synchronization2 = in_ext->synchronization2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES: - { - VkPhysicalDeviceHostImageCopyFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceHostImageCopyFeatures *in_ext = (const VkPhysicalDeviceHostImageCopyFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES; - out_ext->pNext = NULL; - out_ext->hostImageCopy = in_ext->hostImageCopy; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT: - { - VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT *in_ext = (const VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->primitivesGeneratedQuery = in_ext->primitivesGeneratedQuery; - out_ext->primitivesGeneratedQueryWithRasterizerDiscard = in_ext->primitivesGeneratedQueryWithRasterizerDiscard; - out_ext->primitivesGeneratedQueryWithNonZeroStreams = in_ext->primitivesGeneratedQueryWithNonZeroStreams; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT: - { - VkPhysicalDeviceLegacyDitheringFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLegacyDitheringFeaturesEXT *in_ext = (const VkPhysicalDeviceLegacyDitheringFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->legacyDithering = in_ext->legacyDithering; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT: - { - VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT *in_ext = (const VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->multisampledRenderToSingleSampled = in_ext->multisampledRenderToSingleSampled; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES: - { - VkPhysicalDevicePipelineProtectedAccessFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineProtectedAccessFeatures *in_ext = (const VkPhysicalDevicePipelineProtectedAccessFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES; - out_ext->pNext = NULL; - out_ext->pipelineProtectedAccess = in_ext->pipelineProtectedAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR: - { - VkPhysicalDeviceVideoMaintenance1FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVideoMaintenance1FeaturesKHR *in_ext = (const VkPhysicalDeviceVideoMaintenance1FeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->videoMaintenance1 = in_ext->videoMaintenance1; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUANTIZATION_MAP_FEATURES_KHR: - { - VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR *in_ext = (const VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUANTIZATION_MAP_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->videoEncodeQuantizationMap = in_ext->videoEncodeQuantizationMap; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_AV1_FEATURES_KHR: - { - VkPhysicalDeviceVideoEncodeAV1FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVideoEncodeAV1FeaturesKHR *in_ext = (const VkPhysicalDeviceVideoEncodeAV1FeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_AV1_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->videoEncodeAV1 = in_ext->videoEncodeAV1; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: - { - VkPhysicalDeviceInheritedViewportScissorFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceInheritedViewportScissorFeaturesNV *in_ext = (const VkPhysicalDeviceInheritedViewportScissorFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->inheritedViewportScissor2D = in_ext->inheritedViewportScissor2D; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: - { - VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *in_ext = (const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->ycbcr2plane444Formats = in_ext->ycbcr2plane444Formats; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: - { - VkPhysicalDeviceProvokingVertexFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceProvokingVertexFeaturesEXT *in_ext = (const VkPhysicalDeviceProvokingVertexFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->provokingVertexLast = in_ext->provokingVertexLast; - out_ext->transformFeedbackPreservesProvokingVertex = in_ext->transformFeedbackPreservesProvokingVertex; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT: - { - VkPhysicalDeviceDescriptorBufferFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorBufferFeaturesEXT *in_ext = (const VkPhysicalDeviceDescriptorBufferFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->descriptorBuffer = in_ext->descriptorBuffer; - out_ext->descriptorBufferCaptureReplay = in_ext->descriptorBufferCaptureReplay; - out_ext->descriptorBufferImageLayoutIgnored = in_ext->descriptorBufferImageLayoutIgnored; - out_ext->descriptorBufferPushDescriptors = in_ext->descriptorBufferPushDescriptors; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: - { - VkPhysicalDeviceShaderIntegerDotProductFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderIntegerDotProductFeatures *in_ext = (const VkPhysicalDeviceShaderIntegerDotProductFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderIntegerDotProduct = in_ext->shaderIntegerDotProduct; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR: - { - VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR *in_ext = (const VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->fragmentShaderBarycentric = in_ext->fragmentShaderBarycentric; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: - { - VkPhysicalDeviceRayTracingMotionBlurFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV *in_ext = (const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->rayTracingMotionBlur = in_ext->rayTracingMotionBlur; - out_ext->rayTracingMotionBlurPipelineTraceRaysIndirect = in_ext->rayTracingMotionBlurPipelineTraceRaysIndirect; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_VALIDATION_FEATURES_NV: - { - VkPhysicalDeviceRayTracingValidationFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingValidationFeaturesNV *in_ext = (const VkPhysicalDeviceRayTracingValidationFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_VALIDATION_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->rayTracingValidation = in_ext->rayTracingValidation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: - { - VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT *in_ext = (const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->formatRgba10x6WithoutYCbCrSampler = in_ext->formatRgba10x6WithoutYCbCrSampler; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES: - { - VkPhysicalDeviceDynamicRenderingFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDynamicRenderingFeatures *in_ext = (const VkPhysicalDeviceDynamicRenderingFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES; - out_ext->pNext = NULL; - out_ext->dynamicRendering = in_ext->dynamicRendering; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT: - { - VkPhysicalDeviceImageViewMinLodFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageViewMinLodFeaturesEXT *in_ext = (const VkPhysicalDeviceImageViewMinLodFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->minLod = in_ext->minLod; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT: - { - VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT *in_ext = (const VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->rasterizationOrderColorAttachmentAccess = in_ext->rasterizationOrderColorAttachmentAccess; - out_ext->rasterizationOrderDepthAttachmentAccess = in_ext->rasterizationOrderDepthAttachmentAccess; - out_ext->rasterizationOrderStencilAttachmentAccess = in_ext->rasterizationOrderStencilAttachmentAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV: - { - VkPhysicalDeviceLinearColorAttachmentFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLinearColorAttachmentFeaturesNV *in_ext = (const VkPhysicalDeviceLinearColorAttachmentFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->linearColorAttachment = in_ext->linearColorAttachment; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT: - { - VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT *in_ext = (const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->graphicsPipelineLibrary = in_ext->graphicsPipelineLibrary; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR: - { - VkPhysicalDevicePipelineBinaryFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineBinaryFeaturesKHR *in_ext = (const VkPhysicalDevicePipelineBinaryFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->pipelineBinaries = in_ext->pipelineBinaries; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_PIPELINE_BINARY_INTERNAL_CACHE_CONTROL_KHR: - { - VkDevicePipelineBinaryInternalCacheControlKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDevicePipelineBinaryInternalCacheControlKHR *in_ext = (const VkDevicePipelineBinaryInternalCacheControlKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_PIPELINE_BINARY_INTERNAL_CACHE_CONTROL_KHR; - out_ext->pNext = NULL; - out_ext->disableInternalCache = in_ext->disableInternalCache; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE: - { - VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE *in_ext = (const VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE; - out_ext->pNext = NULL; - out_ext->descriptorSetHostMapping = in_ext->descriptorSetHostMapping; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT: - { - VkPhysicalDeviceNestedCommandBufferFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceNestedCommandBufferFeaturesEXT *in_ext = (const VkPhysicalDeviceNestedCommandBufferFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->nestedCommandBuffer = in_ext->nestedCommandBuffer; - out_ext->nestedCommandBufferRendering = in_ext->nestedCommandBufferRendering; - out_ext->nestedCommandBufferSimultaneousUse = in_ext->nestedCommandBufferSimultaneousUse; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT: - { - VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT *in_ext = (const VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderModuleIdentifier = in_ext->shaderModuleIdentifier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceImageCompressionControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageCompressionControlFeaturesEXT *in_ext = (const VkPhysicalDeviceImageCompressionControlFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->imageCompressionControl = in_ext->imageCompressionControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT: - { - VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT *in_ext = (const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->imageCompressionControlSwapchain = in_ext->imageCompressionControlSwapchain; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT: - { - VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT *in_ext = (const VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->subpassMergeFeedback = in_ext->subpassMergeFeedback; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT: - { - VkPhysicalDeviceOpacityMicromapFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceOpacityMicromapFeaturesEXT *in_ext = (const VkPhysicalDeviceOpacityMicromapFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->micromap = in_ext->micromap; - out_ext->micromapCaptureReplay = in_ext->micromapCaptureReplay; - out_ext->micromapHostCommands = in_ext->micromapHostCommands; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT: - { - VkPhysicalDevicePipelinePropertiesFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelinePropertiesFeaturesEXT *in_ext = (const VkPhysicalDevicePipelinePropertiesFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pipelinePropertiesIdentifier = in_ext->pipelinePropertiesIdentifier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD: - { - VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD *in_ext = (const VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD; - out_ext->pNext = NULL; - out_ext->shaderEarlyAndLateFragmentTests = in_ext->shaderEarlyAndLateFragmentTests; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT: - { - VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *in_ext = (const VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->nonSeamlessCubeMap = in_ext->nonSeamlessCubeMap; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES: - { - VkPhysicalDevicePipelineRobustnessFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineRobustnessFeatures *in_ext = (const VkPhysicalDevicePipelineRobustnessFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES; - out_ext->pNext = NULL; - out_ext->pipelineRobustness = in_ext->pipelineRobustness; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM: - { - VkPhysicalDeviceImageProcessingFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageProcessingFeaturesQCOM *in_ext = (const VkPhysicalDeviceImageProcessingFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->textureSampleWeighted = in_ext->textureSampleWeighted; - out_ext->textureBoxFilter = in_ext->textureBoxFilter; - out_ext->textureBlockMatch = in_ext->textureBlockMatch; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM: - { - VkPhysicalDeviceTilePropertiesFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTilePropertiesFeaturesQCOM *in_ext = (const VkPhysicalDeviceTilePropertiesFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->tileProperties = in_ext->tileProperties; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT: - { - VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT *in_ext = (const VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->attachmentFeedbackLoopLayout = in_ext->attachmentFeedbackLoopLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT: - { - VkPhysicalDeviceDepthClampZeroOneFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClampZeroOneFeaturesEXT *in_ext = (const VkPhysicalDeviceDepthClampZeroOneFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClampZeroOne = in_ext->depthClampZeroOne; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT: - { - VkPhysicalDeviceAddressBindingReportFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAddressBindingReportFeaturesEXT *in_ext = (const VkPhysicalDeviceAddressBindingReportFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->reportAddressBinding = in_ext->reportAddressBinding; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV: - { - VkPhysicalDeviceOpticalFlowFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceOpticalFlowFeaturesNV *in_ext = (const VkPhysicalDeviceOpticalFlowFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->opticalFlow = in_ext->opticalFlow; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT: - { - VkPhysicalDeviceFaultFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFaultFeaturesEXT *in_ext = (const VkPhysicalDeviceFaultFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->deviceFault = in_ext->deviceFault; - out_ext->deviceFaultVendorBinary = in_ext->deviceFaultVendorBinary; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT: - { - VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT *in_ext = (const VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pipelineLibraryGroupHandles = in_ext->pipelineLibraryGroupHandles; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM: - { - VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM *in_ext = (const VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM; - out_ext->pNext = NULL; - out_ext->shaderCoreBuiltins = in_ext->shaderCoreBuiltins; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT: - { - VkPhysicalDeviceFrameBoundaryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFrameBoundaryFeaturesEXT *in_ext = (const VkPhysicalDeviceFrameBoundaryFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->frameBoundary = in_ext->frameBoundary; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT: - { - VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT *in_ext = (const VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->dynamicRenderingUnusedAttachments = in_ext->dynamicRenderingUnusedAttachments; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT: - { - VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT *in_ext = (const VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->swapchainMaintenance1 = in_ext->swapchainMaintenance1; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthBiasControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthBiasControlFeaturesEXT *in_ext = (const VkPhysicalDeviceDepthBiasControlFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthBiasControl = in_ext->depthBiasControl; - out_ext->leastRepresentableValueForceUnormRepresentation = in_ext->leastRepresentableValueForceUnormRepresentation; - out_ext->floatRepresentation = in_ext->floatRepresentation; - out_ext->depthBiasExact = in_ext->depthBiasExact; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV: - { - VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV *in_ext = (const VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->rayTracingInvocationReorder = in_ext->rayTracingInvocationReorder; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV: - { - VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV *in_ext = (const VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->extendedSparseAddressSpace = in_ext->extendedSparseAddressSpace; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM: - { - VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM *in_ext = (const VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->multiviewPerViewViewports = in_ext->multiviewPerViewViewports; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR *in_ext = (const VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayTracingPositionFetch = in_ext->rayTracingPositionFetch; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM: - { - VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM *in_ext = (const VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->multiviewPerViewRenderAreas = in_ext->multiviewPerViewRenderAreas; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT: - { - VkPhysicalDeviceShaderObjectFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderObjectFeaturesEXT *in_ext = (const VkPhysicalDeviceShaderObjectFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderObject = in_ext->shaderObject; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT: - { - VkPhysicalDeviceShaderTileImageFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderTileImageFeaturesEXT *in_ext = (const VkPhysicalDeviceShaderTileImageFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderTileImageColorReadAccess = in_ext->shaderTileImageColorReadAccess; - out_ext->shaderTileImageDepthReadAccess = in_ext->shaderTileImageDepthReadAccess; - out_ext->shaderTileImageStencilReadAccess = in_ext->shaderTileImageStencilReadAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR: - { - VkPhysicalDeviceCooperativeMatrixFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCooperativeMatrixFeaturesKHR *in_ext = (const VkPhysicalDeviceCooperativeMatrixFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->cooperativeMatrix = in_ext->cooperativeMatrix; - out_ext->cooperativeMatrixRobustBufferAccess = in_ext->cooperativeMatrixRobustBufferAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ANTI_LAG_FEATURES_AMD: - { - VkPhysicalDeviceAntiLagFeaturesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAntiLagFeaturesAMD *in_ext = (const VkPhysicalDeviceAntiLagFeaturesAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ANTI_LAG_FEATURES_AMD; - out_ext->pNext = NULL; - out_ext->antiLag = in_ext->antiLag; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM: - { - VkPhysicalDeviceCubicClampFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCubicClampFeaturesQCOM *in_ext = (const VkPhysicalDeviceCubicClampFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->cubicRangeClamp = in_ext->cubicRangeClamp; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM: - { - VkPhysicalDeviceYcbcrDegammaFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceYcbcrDegammaFeaturesQCOM *in_ext = (const VkPhysicalDeviceYcbcrDegammaFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->ycbcrDegamma = in_ext->ycbcrDegamma; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM: - { - VkPhysicalDeviceCubicWeightsFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCubicWeightsFeaturesQCOM *in_ext = (const VkPhysicalDeviceCubicWeightsFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->selectableCubicWeights = in_ext->selectableCubicWeights; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM: - { - VkPhysicalDeviceImageProcessing2FeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageProcessing2FeaturesQCOM *in_ext = (const VkPhysicalDeviceImageProcessing2FeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->textureBlockMatch2 = in_ext->textureBlockMatch2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV: - { - VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV *in_ext = (const VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->descriptorPoolOverallocation = in_ext->descriptorPoolOverallocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PER_STAGE_DESCRIPTOR_SET_FEATURES_NV: - { - VkPhysicalDevicePerStageDescriptorSetFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePerStageDescriptorSetFeaturesNV *in_ext = (const VkPhysicalDevicePerStageDescriptorSetFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PER_STAGE_DESCRIPTOR_SET_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->perStageDescriptorSet = in_ext->perStageDescriptorSet; - out_ext->dynamicPipelineLayout = in_ext->dynamicPipelineLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV: - { - VkPhysicalDeviceCudaKernelLaunchFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCudaKernelLaunchFeaturesNV *in_ext = (const VkPhysicalDeviceCudaKernelLaunchFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cudaKernelLaunchFeatures = in_ext->cudaKernelLaunchFeatures; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM: - { - VkDeviceQueueShaderCoreControlCreateInfoARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceQueueShaderCoreControlCreateInfoARM *in_ext = (const VkDeviceQueueShaderCoreControlCreateInfoARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM; - out_ext->pNext = NULL; - out_ext->shaderCoreCount = in_ext->shaderCoreCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM: - { - VkPhysicalDeviceSchedulingControlsFeaturesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSchedulingControlsFeaturesARM *in_ext = (const VkPhysicalDeviceSchedulingControlsFeaturesARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM; - out_ext->pNext = NULL; - out_ext->schedulingControls = in_ext->schedulingControls; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG: - { - VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG *in_ext = (const VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG; - out_ext->pNext = NULL; - out_ext->relaxedLineRasterization = in_ext->relaxedLineRasterization; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_FEATURES_ARM: - { - VkPhysicalDeviceRenderPassStripedFeaturesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRenderPassStripedFeaturesARM *in_ext = (const VkPhysicalDeviceRenderPassStripedFeaturesARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_FEATURES_ARM; - out_ext->pNext = NULL; - out_ext->renderPassStriped = in_ext->renderPassStriped; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR: - { - VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR *in_ext = (const VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderMaximalReconvergence = in_ext->shaderMaximalReconvergence; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES: - { - VkPhysicalDeviceShaderSubgroupRotateFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSubgroupRotateFeatures *in_ext = (const VkPhysicalDeviceShaderSubgroupRotateFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderSubgroupRotate = in_ext->shaderSubgroupRotate; - out_ext->shaderSubgroupRotateClustered = in_ext->shaderSubgroupRotateClustered; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES: - { - VkPhysicalDeviceShaderExpectAssumeFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderExpectAssumeFeatures *in_ext = (const VkPhysicalDeviceShaderExpectAssumeFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderExpectAssume = in_ext->shaderExpectAssume; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES: - { - VkPhysicalDeviceShaderFloatControls2Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderFloatControls2Features *in_ext = (const VkPhysicalDeviceShaderFloatControls2Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderFloatControls2 = in_ext->shaderFloatControls2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES: - { - VkPhysicalDeviceDynamicRenderingLocalReadFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDynamicRenderingLocalReadFeatures *in_ext = (const VkPhysicalDeviceDynamicRenderingLocalReadFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES; - out_ext->pNext = NULL; - out_ext->dynamicRenderingLocalRead = in_ext->dynamicRenderingLocalRead; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_QUAD_CONTROL_FEATURES_KHR: - { - VkPhysicalDeviceShaderQuadControlFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderQuadControlFeaturesKHR *in_ext = (const VkPhysicalDeviceShaderQuadControlFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_QUAD_CONTROL_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderQuadControl = in_ext->shaderQuadControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT16_VECTOR_FEATURES_NV: - { - VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV *in_ext = (const VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT16_VECTOR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->shaderFloat16VectorAtomics = in_ext->shaderFloat16VectorAtomics; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_FEATURES_EXT: - { - VkPhysicalDeviceMapMemoryPlacedFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMapMemoryPlacedFeaturesEXT *in_ext = (const VkPhysicalDeviceMapMemoryPlacedFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->memoryMapPlaced = in_ext->memoryMapPlaced; - out_ext->memoryMapRangePlaced = in_ext->memoryMapRangePlaced; - out_ext->memoryUnmapReserve = in_ext->memoryUnmapReserve; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAW_ACCESS_CHAINS_FEATURES_NV: - { - VkPhysicalDeviceRawAccessChainsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRawAccessChainsFeaturesNV *in_ext = (const VkPhysicalDeviceRawAccessChainsFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAW_ACCESS_CHAINS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->shaderRawAccessChains = in_ext->shaderRawAccessChains; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMMAND_BUFFER_INHERITANCE_FEATURES_NV: - { - VkPhysicalDeviceCommandBufferInheritanceFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCommandBufferInheritanceFeaturesNV *in_ext = (const VkPhysicalDeviceCommandBufferInheritanceFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMMAND_BUFFER_INHERITANCE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->commandBufferInheritance = in_ext->commandBufferInheritance; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_FEATURES_MESA: - { - VkPhysicalDeviceImageAlignmentControlFeaturesMESA *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageAlignmentControlFeaturesMESA *in_ext = (const VkPhysicalDeviceImageAlignmentControlFeaturesMESA *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_FEATURES_MESA; - out_ext->pNext = NULL; - out_ext->imageAlignmentControl = in_ext->imageAlignmentControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_REPLICATED_COMPOSITES_FEATURES_EXT: - { - VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT *in_ext = (const VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_REPLICATED_COMPOSITES_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderReplicatedComposites = in_ext->shaderReplicatedComposites; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT: - { - VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT *in_ext = (const VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->presentModeFifoLatestReady = in_ext->presentModeFifoLatestReady; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_FEATURES_NV: - { - VkPhysicalDeviceCooperativeMatrix2FeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCooperativeMatrix2FeaturesNV *in_ext = (const VkPhysicalDeviceCooperativeMatrix2FeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cooperativeMatrixWorkgroupScope = in_ext->cooperativeMatrixWorkgroupScope; - out_ext->cooperativeMatrixFlexibleDimensions = in_ext->cooperativeMatrixFlexibleDimensions; - out_ext->cooperativeMatrixReductions = in_ext->cooperativeMatrixReductions; - out_ext->cooperativeMatrixConversions = in_ext->cooperativeMatrixConversions; - out_ext->cooperativeMatrixPerElementOperations = in_ext->cooperativeMatrixPerElementOperations; - out_ext->cooperativeMatrixTensorAddressing = in_ext->cooperativeMatrixTensorAddressing; - out_ext->cooperativeMatrixBlockLoads = in_ext->cooperativeMatrixBlockLoads; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HDR_VIVID_FEATURES_HUAWEI: - { - VkPhysicalDeviceHdrVividFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceHdrVividFeaturesHUAWEI *in_ext = (const VkPhysicalDeviceHdrVividFeaturesHUAWEI *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HDR_VIVID_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->hdrVivid = in_ext->hdrVivid; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_ROBUSTNESS_FEATURES_EXT: - { - VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT *in_ext = (const VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_ROBUSTNESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->vertexAttributeRobustness = in_ext->vertexAttributeRobustness; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} -#endif /* _WIN64 */ - -static inline void convert_VkDeviceCreateInfo_win32_to_host(struct conversion_context *ctx, const VkDeviceCreateInfo32 *in, VkDeviceCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->queueCreateInfoCount = in->queueCreateInfoCount; - out->pQueueCreateInfos = convert_VkDeviceQueueCreateInfo_array_win32_to_host(ctx, (const VkDeviceQueueCreateInfo32 *)UlongToPtr(in->pQueueCreateInfos), in->queueCreateInfoCount); - out->enabledLayerCount = in->enabledLayerCount; - out->ppEnabledLayerNames = convert_char_pointer_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(in->ppEnabledLayerNames), in->enabledLayerCount); - out->enabledExtensionCount = in->enabledExtensionCount; - out->ppEnabledExtensionNames = convert_char_pointer_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(in->ppEnabledExtensionNames), in->enabledExtensionCount); - out->pEnabledFeatures = UlongToPtr(in->pEnabledFeatures); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO: - break; - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV32 *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->deviceGeneratedCommands = in_ext->deviceGeneratedCommands; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV32 *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->deviceGeneratedCompute = in_ext->deviceGeneratedCompute; - out_ext->deviceGeneratedComputePipelines = in_ext->deviceGeneratedComputePipelines; - out_ext->deviceGeneratedComputeCaptureReplay = in_ext->deviceGeneratedComputeCaptureReplay; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO: - { - VkDevicePrivateDataCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDevicePrivateDataCreateInfo32 *in_ext = (const VkDevicePrivateDataCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->privateDataSlotRequestCount = in_ext->privateDataSlotRequestCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES: - { - VkPhysicalDevicePrivateDataFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePrivateDataFeatures32 *in_ext = (const VkPhysicalDevicePrivateDataFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES; - out_ext->pNext = NULL; - out_ext->privateData = in_ext->privateData; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: - { - VkPhysicalDeviceFeatures2 *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFeatures232 *in_ext = (const VkPhysicalDeviceFeatures232 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; - out_ext->pNext = NULL; - out_ext->features = in_ext->features; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: - { - VkPhysicalDeviceVariablePointersFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVariablePointersFeatures32 *in_ext = (const VkPhysicalDeviceVariablePointersFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES; - out_ext->pNext = NULL; - out_ext->variablePointersStorageBuffer = in_ext->variablePointersStorageBuffer; - out_ext->variablePointers = in_ext->variablePointers; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: - { - VkPhysicalDeviceMultiviewFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiviewFeatures32 *in_ext = (const VkPhysicalDeviceMultiviewFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES; - out_ext->pNext = NULL; - out_ext->multiview = in_ext->multiview; - out_ext->multiviewGeometryShader = in_ext->multiviewGeometryShader; - out_ext->multiviewTessellationShader = in_ext->multiviewTessellationShader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: - { - VkDeviceGroupDeviceCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceGroupDeviceCreateInfo32 *in_ext = (const VkDeviceGroupDeviceCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->physicalDeviceCount = in_ext->physicalDeviceCount; - out_ext->pPhysicalDevices = convert_VkPhysicalDevice_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(in_ext->pPhysicalDevices), in_ext->physicalDeviceCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: - { - VkPhysicalDevicePresentIdFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentIdFeaturesKHR32 *in_ext = (const VkPhysicalDevicePresentIdFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->presentId = in_ext->presentId; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: - { - VkPhysicalDevicePresentWaitFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentWaitFeaturesKHR32 *in_ext = (const VkPhysicalDevicePresentWaitFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->presentWait = in_ext->presentWait; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: - { - VkPhysicalDevice16BitStorageFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevice16BitStorageFeatures32 *in_ext = (const VkPhysicalDevice16BitStorageFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES; - out_ext->pNext = NULL; - out_ext->storageBuffer16BitAccess = in_ext->storageBuffer16BitAccess; - out_ext->uniformAndStorageBuffer16BitAccess = in_ext->uniformAndStorageBuffer16BitAccess; - out_ext->storagePushConstant16 = in_ext->storagePushConstant16; - out_ext->storageInputOutput16 = in_ext->storageInputOutput16; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: - { - VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures32 *in_ext = (const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderSubgroupExtendedTypes = in_ext->shaderSubgroupExtendedTypes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: - { - VkPhysicalDeviceSamplerYcbcrConversionFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSamplerYcbcrConversionFeatures32 *in_ext = (const VkPhysicalDeviceSamplerYcbcrConversionFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES; - out_ext->pNext = NULL; - out_ext->samplerYcbcrConversion = in_ext->samplerYcbcrConversion; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: - { - VkPhysicalDeviceProtectedMemoryFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceProtectedMemoryFeatures32 *in_ext = (const VkPhysicalDeviceProtectedMemoryFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES; - out_ext->pNext = NULL; - out_ext->protectedMemory = in_ext->protectedMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: - { - VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT32 *in_ext = (const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->advancedBlendCoherentOperations = in_ext->advancedBlendCoherentOperations; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: - { - VkPhysicalDeviceMultiDrawFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiDrawFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMultiDrawFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->multiDraw = in_ext->multiDraw; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES: - { - VkPhysicalDeviceInlineUniformBlockFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceInlineUniformBlockFeatures32 *in_ext = (const VkPhysicalDeviceInlineUniformBlockFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES; - out_ext->pNext = NULL; - out_ext->inlineUniformBlock = in_ext->inlineUniformBlock; - out_ext->descriptorBindingInlineUniformBlockUpdateAfterBind = in_ext->descriptorBindingInlineUniformBlockUpdateAfterBind; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES: - { - VkPhysicalDeviceMaintenance4Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMaintenance4Features32 *in_ext = (const VkPhysicalDeviceMaintenance4Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES; - out_ext->pNext = NULL; - out_ext->maintenance4 = in_ext->maintenance4; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES: - { - VkPhysicalDeviceMaintenance5Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMaintenance5Features32 *in_ext = (const VkPhysicalDeviceMaintenance5Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES; - out_ext->pNext = NULL; - out_ext->maintenance5 = in_ext->maintenance5; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES: - { - VkPhysicalDeviceMaintenance6Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMaintenance6Features32 *in_ext = (const VkPhysicalDeviceMaintenance6Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES; - out_ext->pNext = NULL; - out_ext->maintenance6 = in_ext->maintenance6; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: - { - VkPhysicalDeviceShaderDrawParametersFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderDrawParametersFeatures32 *in_ext = (const VkPhysicalDeviceShaderDrawParametersFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderDrawParameters = in_ext->shaderDrawParameters; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: - { - VkPhysicalDeviceShaderFloat16Int8Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderFloat16Int8Features32 *in_ext = (const VkPhysicalDeviceShaderFloat16Int8Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderFloat16 = in_ext->shaderFloat16; - out_ext->shaderInt8 = in_ext->shaderInt8; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: - { - VkPhysicalDeviceHostQueryResetFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceHostQueryResetFeatures32 *in_ext = (const VkPhysicalDeviceHostQueryResetFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES; - out_ext->pNext = NULL; - out_ext->hostQueryReset = in_ext->hostQueryReset; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES: - { - VkPhysicalDeviceGlobalPriorityQueryFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceGlobalPriorityQueryFeatures32 *in_ext = (const VkPhysicalDeviceGlobalPriorityQueryFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES; - out_ext->pNext = NULL; - out_ext->globalPriorityQuery = in_ext->globalPriorityQuery; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: - { - VkPhysicalDeviceDescriptorIndexingFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorIndexingFeatures32 *in_ext = (const VkPhysicalDeviceDescriptorIndexingFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderInputAttachmentArrayDynamicIndexing = in_ext->shaderInputAttachmentArrayDynamicIndexing; - out_ext->shaderUniformTexelBufferArrayDynamicIndexing = in_ext->shaderUniformTexelBufferArrayDynamicIndexing; - out_ext->shaderStorageTexelBufferArrayDynamicIndexing = in_ext->shaderStorageTexelBufferArrayDynamicIndexing; - out_ext->shaderUniformBufferArrayNonUniformIndexing = in_ext->shaderUniformBufferArrayNonUniformIndexing; - out_ext->shaderSampledImageArrayNonUniformIndexing = in_ext->shaderSampledImageArrayNonUniformIndexing; - out_ext->shaderStorageBufferArrayNonUniformIndexing = in_ext->shaderStorageBufferArrayNonUniformIndexing; - out_ext->shaderStorageImageArrayNonUniformIndexing = in_ext->shaderStorageImageArrayNonUniformIndexing; - out_ext->shaderInputAttachmentArrayNonUniformIndexing = in_ext->shaderInputAttachmentArrayNonUniformIndexing; - out_ext->shaderUniformTexelBufferArrayNonUniformIndexing = in_ext->shaderUniformTexelBufferArrayNonUniformIndexing; - out_ext->shaderStorageTexelBufferArrayNonUniformIndexing = in_ext->shaderStorageTexelBufferArrayNonUniformIndexing; - out_ext->descriptorBindingUniformBufferUpdateAfterBind = in_ext->descriptorBindingUniformBufferUpdateAfterBind; - out_ext->descriptorBindingSampledImageUpdateAfterBind = in_ext->descriptorBindingSampledImageUpdateAfterBind; - out_ext->descriptorBindingStorageImageUpdateAfterBind = in_ext->descriptorBindingStorageImageUpdateAfterBind; - out_ext->descriptorBindingStorageBufferUpdateAfterBind = in_ext->descriptorBindingStorageBufferUpdateAfterBind; - out_ext->descriptorBindingUniformTexelBufferUpdateAfterBind = in_ext->descriptorBindingUniformTexelBufferUpdateAfterBind; - out_ext->descriptorBindingStorageTexelBufferUpdateAfterBind = in_ext->descriptorBindingStorageTexelBufferUpdateAfterBind; - out_ext->descriptorBindingUpdateUnusedWhilePending = in_ext->descriptorBindingUpdateUnusedWhilePending; - out_ext->descriptorBindingPartiallyBound = in_ext->descriptorBindingPartiallyBound; - out_ext->descriptorBindingVariableDescriptorCount = in_ext->descriptorBindingVariableDescriptorCount; - out_ext->runtimeDescriptorArray = in_ext->runtimeDescriptorArray; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: - { - VkPhysicalDeviceTimelineSemaphoreFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTimelineSemaphoreFeatures32 *in_ext = (const VkPhysicalDeviceTimelineSemaphoreFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES; - out_ext->pNext = NULL; - out_ext->timelineSemaphore = in_ext->timelineSemaphore; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: - { - VkPhysicalDevice8BitStorageFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevice8BitStorageFeatures32 *in_ext = (const VkPhysicalDevice8BitStorageFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES; - out_ext->pNext = NULL; - out_ext->storageBuffer8BitAccess = in_ext->storageBuffer8BitAccess; - out_ext->uniformAndStorageBuffer8BitAccess = in_ext->uniformAndStorageBuffer8BitAccess; - out_ext->storagePushConstant8 = in_ext->storagePushConstant8; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: - { - VkPhysicalDeviceConditionalRenderingFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceConditionalRenderingFeaturesEXT32 *in_ext = (const VkPhysicalDeviceConditionalRenderingFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->conditionalRendering = in_ext->conditionalRendering; - out_ext->inheritedConditionalRendering = in_ext->inheritedConditionalRendering; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: - { - VkPhysicalDeviceVulkanMemoryModelFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkanMemoryModelFeatures32 *in_ext = (const VkPhysicalDeviceVulkanMemoryModelFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES; - out_ext->pNext = NULL; - out_ext->vulkanMemoryModel = in_ext->vulkanMemoryModel; - out_ext->vulkanMemoryModelDeviceScope = in_ext->vulkanMemoryModelDeviceScope; - out_ext->vulkanMemoryModelAvailabilityVisibilityChains = in_ext->vulkanMemoryModelAvailabilityVisibilityChains; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: - { - VkPhysicalDeviceShaderAtomicInt64Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicInt64Features32 *in_ext = (const VkPhysicalDeviceShaderAtomicInt64Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderBufferInt64Atomics = in_ext->shaderBufferInt64Atomics; - out_ext->shaderSharedInt64Atomics = in_ext->shaderSharedInt64Atomics; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: - { - VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderBufferFloat32Atomics = in_ext->shaderBufferFloat32Atomics; - out_ext->shaderBufferFloat32AtomicAdd = in_ext->shaderBufferFloat32AtomicAdd; - out_ext->shaderBufferFloat64Atomics = in_ext->shaderBufferFloat64Atomics; - out_ext->shaderBufferFloat64AtomicAdd = in_ext->shaderBufferFloat64AtomicAdd; - out_ext->shaderSharedFloat32Atomics = in_ext->shaderSharedFloat32Atomics; - out_ext->shaderSharedFloat32AtomicAdd = in_ext->shaderSharedFloat32AtomicAdd; - out_ext->shaderSharedFloat64Atomics = in_ext->shaderSharedFloat64Atomics; - out_ext->shaderSharedFloat64AtomicAdd = in_ext->shaderSharedFloat64AtomicAdd; - out_ext->shaderImageFloat32Atomics = in_ext->shaderImageFloat32Atomics; - out_ext->shaderImageFloat32AtomicAdd = in_ext->shaderImageFloat32AtomicAdd; - out_ext->sparseImageFloat32Atomics = in_ext->sparseImageFloat32Atomics; - out_ext->sparseImageFloat32AtomicAdd = in_ext->sparseImageFloat32AtomicAdd; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: - { - VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderBufferFloat16Atomics = in_ext->shaderBufferFloat16Atomics; - out_ext->shaderBufferFloat16AtomicAdd = in_ext->shaderBufferFloat16AtomicAdd; - out_ext->shaderBufferFloat16AtomicMinMax = in_ext->shaderBufferFloat16AtomicMinMax; - out_ext->shaderBufferFloat32AtomicMinMax = in_ext->shaderBufferFloat32AtomicMinMax; - out_ext->shaderBufferFloat64AtomicMinMax = in_ext->shaderBufferFloat64AtomicMinMax; - out_ext->shaderSharedFloat16Atomics = in_ext->shaderSharedFloat16Atomics; - out_ext->shaderSharedFloat16AtomicAdd = in_ext->shaderSharedFloat16AtomicAdd; - out_ext->shaderSharedFloat16AtomicMinMax = in_ext->shaderSharedFloat16AtomicMinMax; - out_ext->shaderSharedFloat32AtomicMinMax = in_ext->shaderSharedFloat32AtomicMinMax; - out_ext->shaderSharedFloat64AtomicMinMax = in_ext->shaderSharedFloat64AtomicMinMax; - out_ext->shaderImageFloat32AtomicMinMax = in_ext->shaderImageFloat32AtomicMinMax; - out_ext->sparseImageFloat32AtomicMinMax = in_ext->sparseImageFloat32AtomicMinMax; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES: - { - VkPhysicalDeviceVertexAttributeDivisorFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVertexAttributeDivisorFeatures32 *in_ext = (const VkPhysicalDeviceVertexAttributeDivisorFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES; - out_ext->pNext = NULL; - out_ext->vertexAttributeInstanceRateDivisor = in_ext->vertexAttributeInstanceRateDivisor; - out_ext->vertexAttributeInstanceRateZeroDivisor = in_ext->vertexAttributeInstanceRateZeroDivisor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: - { - VkPhysicalDeviceASTCDecodeFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceASTCDecodeFeaturesEXT32 *in_ext = (const VkPhysicalDeviceASTCDecodeFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->decodeModeSharedExponent = in_ext->decodeModeSharedExponent; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: - { - VkPhysicalDeviceTransformFeedbackFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTransformFeedbackFeaturesEXT32 *in_ext = (const VkPhysicalDeviceTransformFeedbackFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->transformFeedback = in_ext->transformFeedback; - out_ext->geometryStreams = in_ext->geometryStreams; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: - { - VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV32 *in_ext = (const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->representativeFragmentTest = in_ext->representativeFragmentTest; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: - { - VkPhysicalDeviceExclusiveScissorFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExclusiveScissorFeaturesNV32 *in_ext = (const VkPhysicalDeviceExclusiveScissorFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->exclusiveScissor = in_ext->exclusiveScissor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: - { - VkPhysicalDeviceCornerSampledImageFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCornerSampledImageFeaturesNV32 *in_ext = (const VkPhysicalDeviceCornerSampledImageFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cornerSampledImage = in_ext->cornerSampledImage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR: - { - VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR32 *in_ext = (const VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->computeDerivativeGroupQuads = in_ext->computeDerivativeGroupQuads; - out_ext->computeDerivativeGroupLinear = in_ext->computeDerivativeGroupLinear; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: - { - VkPhysicalDeviceShaderImageFootprintFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderImageFootprintFeaturesNV32 *in_ext = (const VkPhysicalDeviceShaderImageFootprintFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->imageFootprint = in_ext->imageFootprint; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: - { - VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV32 *in_ext = (const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->dedicatedAllocationImageAliasing = in_ext->dedicatedAllocationImageAliasing; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV: - { - VkPhysicalDeviceCopyMemoryIndirectFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCopyMemoryIndirectFeaturesNV32 *in_ext = (const VkPhysicalDeviceCopyMemoryIndirectFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->indirectCopy = in_ext->indirectCopy; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV: - { - VkPhysicalDeviceMemoryDecompressionFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMemoryDecompressionFeaturesNV32 *in_ext = (const VkPhysicalDeviceMemoryDecompressionFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->memoryDecompression = in_ext->memoryDecompression; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: - { - VkPhysicalDeviceShadingRateImageFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShadingRateImageFeaturesNV32 *in_ext = (const VkPhysicalDeviceShadingRateImageFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->shadingRateImage = in_ext->shadingRateImage; - out_ext->shadingRateCoarseSampleOrder = in_ext->shadingRateCoarseSampleOrder; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: - { - VkPhysicalDeviceInvocationMaskFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI32 *in_ext = (const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->invocationMask = in_ext->invocationMask; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: - { - VkPhysicalDeviceMeshShaderFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMeshShaderFeaturesNV32 *in_ext = (const VkPhysicalDeviceMeshShaderFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->taskShader = in_ext->taskShader; - out_ext->meshShader = in_ext->meshShader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT: - { - VkPhysicalDeviceMeshShaderFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMeshShaderFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMeshShaderFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->taskShader = in_ext->taskShader; - out_ext->meshShader = in_ext->meshShader; - out_ext->multiviewMeshShader = in_ext->multiviewMeshShader; - out_ext->primitiveFragmentShadingRateMeshShader = in_ext->primitiveFragmentShadingRateMeshShader; - out_ext->meshShaderQueries = in_ext->meshShaderQueries; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: - { - VkPhysicalDeviceAccelerationStructureFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAccelerationStructureFeaturesKHR32 *in_ext = (const VkPhysicalDeviceAccelerationStructureFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->accelerationStructure = in_ext->accelerationStructure; - out_ext->accelerationStructureCaptureReplay = in_ext->accelerationStructureCaptureReplay; - out_ext->accelerationStructureIndirectBuild = in_ext->accelerationStructureIndirectBuild; - out_ext->accelerationStructureHostCommands = in_ext->accelerationStructureHostCommands; - out_ext->descriptorBindingAccelerationStructureUpdateAfterBind = in_ext->descriptorBindingAccelerationStructureUpdateAfterBind; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingPipelineFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingPipelineFeaturesKHR32 *in_ext = (const VkPhysicalDeviceRayTracingPipelineFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayTracingPipeline = in_ext->rayTracingPipeline; - out_ext->rayTracingPipelineShaderGroupHandleCaptureReplay = in_ext->rayTracingPipelineShaderGroupHandleCaptureReplay; - out_ext->rayTracingPipelineShaderGroupHandleCaptureReplayMixed = in_ext->rayTracingPipelineShaderGroupHandleCaptureReplayMixed; - out_ext->rayTracingPipelineTraceRaysIndirect = in_ext->rayTracingPipelineTraceRaysIndirect; - out_ext->rayTraversalPrimitiveCulling = in_ext->rayTraversalPrimitiveCulling; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: - { - VkPhysicalDeviceRayQueryFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayQueryFeaturesKHR32 *in_ext = (const VkPhysicalDeviceRayQueryFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayQuery = in_ext->rayQuery; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR32 *in_ext = (const VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayTracingMaintenance1 = in_ext->rayTracingMaintenance1; - out_ext->rayTracingPipelineTraceRaysIndirect2 = in_ext->rayTracingPipelineTraceRaysIndirect2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: - { - VkDeviceMemoryOverallocationCreateInfoAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceMemoryOverallocationCreateInfoAMD32 *in_ext = (const VkDeviceMemoryOverallocationCreateInfoAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD; - out_ext->pNext = NULL; - out_ext->overallocationBehavior = in_ext->overallocationBehavior; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: - { - VkPhysicalDeviceFragmentDensityMapFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentDensityMapFeaturesEXT32 *in_ext = (const VkPhysicalDeviceFragmentDensityMapFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->fragmentDensityMap = in_ext->fragmentDensityMap; - out_ext->fragmentDensityMapDynamic = in_ext->fragmentDensityMapDynamic; - out_ext->fragmentDensityMapNonSubsampledImages = in_ext->fragmentDensityMapNonSubsampledImages; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: - { - VkPhysicalDeviceFragmentDensityMap2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT32 *in_ext = (const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->fragmentDensityMapDeferred = in_ext->fragmentDensityMapDeferred; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM: - { - VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->fragmentDensityMapOffset = in_ext->fragmentDensityMapOffset; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: - { - VkPhysicalDeviceScalarBlockLayoutFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceScalarBlockLayoutFeatures32 *in_ext = (const VkPhysicalDeviceScalarBlockLayoutFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES; - out_ext->pNext = NULL; - out_ext->scalarBlockLayout = in_ext->scalarBlockLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: - { - VkPhysicalDeviceUniformBufferStandardLayoutFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceUniformBufferStandardLayoutFeatures32 *in_ext = (const VkPhysicalDeviceUniformBufferStandardLayoutFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES; - out_ext->pNext = NULL; - out_ext->uniformBufferStandardLayout = in_ext->uniformBufferStandardLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: - { - VkPhysicalDeviceDepthClipEnableFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClipEnableFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDepthClipEnableFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClipEnable = in_ext->depthClipEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: - { - VkPhysicalDeviceMemoryPriorityFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMemoryPriorityFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMemoryPriorityFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->memoryPriority = in_ext->memoryPriority; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: - { - VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT32 *in_ext = (const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pageableDeviceLocalMemory = in_ext->pageableDeviceLocalMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: - { - VkPhysicalDeviceBufferDeviceAddressFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBufferDeviceAddressFeatures32 *in_ext = (const VkPhysicalDeviceBufferDeviceAddressFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES; - out_ext->pNext = NULL; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: - { - VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT32 *in_ext = (const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: - { - VkPhysicalDeviceImagelessFramebufferFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImagelessFramebufferFeatures32 *in_ext = (const VkPhysicalDeviceImagelessFramebufferFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES; - out_ext->pNext = NULL; - out_ext->imagelessFramebuffer = in_ext->imagelessFramebuffer; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES: - { - VkPhysicalDeviceTextureCompressionASTCHDRFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTextureCompressionASTCHDRFeatures32 *in_ext = (const VkPhysicalDeviceTextureCompressionASTCHDRFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES; - out_ext->pNext = NULL; - out_ext->textureCompressionASTC_HDR = in_ext->textureCompressionASTC_HDR; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: - { - VkPhysicalDeviceCooperativeMatrixFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCooperativeMatrixFeaturesNV32 *in_ext = (const VkPhysicalDeviceCooperativeMatrixFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cooperativeMatrix = in_ext->cooperativeMatrix; - out_ext->cooperativeMatrixRobustBufferAccess = in_ext->cooperativeMatrixRobustBufferAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: - { - VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT32 *in_ext = (const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->ycbcrImageArrays = in_ext->ycbcrImageArrays; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV: - { - VkPhysicalDevicePresentBarrierFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentBarrierFeaturesNV32 *in_ext = (const VkPhysicalDevicePresentBarrierFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->presentBarrier = in_ext->presentBarrier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: - { - VkPhysicalDevicePerformanceQueryFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePerformanceQueryFeaturesKHR32 *in_ext = (const VkPhysicalDevicePerformanceQueryFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->performanceCounterQueryPools = in_ext->performanceCounterQueryPools; - out_ext->performanceCounterMultipleQueryPools = in_ext->performanceCounterMultipleQueryPools; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_RESERVATION_INFO_KHR: - { - VkPerformanceQueryReservationInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPerformanceQueryReservationInfoKHR32 *in_ext = (const VkPerformanceQueryReservationInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_RESERVATION_INFO_KHR; - out_ext->pNext = NULL; - out_ext->maxPerformanceQueriesPerPool = in_ext->maxPerformanceQueriesPerPool; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: - { - VkPhysicalDeviceCoverageReductionModeFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCoverageReductionModeFeaturesNV32 *in_ext = (const VkPhysicalDeviceCoverageReductionModeFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->coverageReductionMode = in_ext->coverageReductionMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: - { - VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL32 *in_ext = (const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL; - out_ext->pNext = NULL; - out_ext->shaderIntegerFunctions2 = in_ext->shaderIntegerFunctions2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: - { - VkPhysicalDeviceShaderClockFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderClockFeaturesKHR32 *in_ext = (const VkPhysicalDeviceShaderClockFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderSubgroupClock = in_ext->shaderSubgroupClock; - out_ext->shaderDeviceClock = in_ext->shaderDeviceClock; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES: - { - VkPhysicalDeviceIndexTypeUint8Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceIndexTypeUint8Features32 *in_ext = (const VkPhysicalDeviceIndexTypeUint8Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES; - out_ext->pNext = NULL; - out_ext->indexTypeUint8 = in_ext->indexTypeUint8; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: - { - VkPhysicalDeviceShaderSMBuiltinsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV32 *in_ext = (const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->shaderSMBuiltins = in_ext->shaderSMBuiltins; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: - { - VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT32 *in_ext = (const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->fragmentShaderSampleInterlock = in_ext->fragmentShaderSampleInterlock; - out_ext->fragmentShaderPixelInterlock = in_ext->fragmentShaderPixelInterlock; - out_ext->fragmentShaderShadingRateInterlock = in_ext->fragmentShaderShadingRateInterlock; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: - { - VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures32 *in_ext = (const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES; - out_ext->pNext = NULL; - out_ext->separateDepthStencilLayouts = in_ext->separateDepthStencilLayouts; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: - { - VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT32 *in_ext = (const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->primitiveTopologyListRestart = in_ext->primitiveTopologyListRestart; - out_ext->primitiveTopologyPatchListRestart = in_ext->primitiveTopologyPatchListRestart; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: - { - VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR32 *in_ext = (const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->pipelineExecutableInfo = in_ext->pipelineExecutableInfo; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES: - { - VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures32 *in_ext = (const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderDemoteToHelperInvocation = in_ext->shaderDemoteToHelperInvocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: - { - VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT32 *in_ext = (const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->texelBufferAlignment = in_ext->texelBufferAlignment; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES: - { - VkPhysicalDeviceSubgroupSizeControlFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSubgroupSizeControlFeatures32 *in_ext = (const VkPhysicalDeviceSubgroupSizeControlFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES; - out_ext->pNext = NULL; - out_ext->subgroupSizeControl = in_ext->subgroupSizeControl; - out_ext->computeFullSubgroups = in_ext->computeFullSubgroups; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES: - { - VkPhysicalDeviceLineRasterizationFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLineRasterizationFeatures32 *in_ext = (const VkPhysicalDeviceLineRasterizationFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES; - out_ext->pNext = NULL; - out_ext->rectangularLines = in_ext->rectangularLines; - out_ext->bresenhamLines = in_ext->bresenhamLines; - out_ext->smoothLines = in_ext->smoothLines; - out_ext->stippledRectangularLines = in_ext->stippledRectangularLines; - out_ext->stippledBresenhamLines = in_ext->stippledBresenhamLines; - out_ext->stippledSmoothLines = in_ext->stippledSmoothLines; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: - { - VkPhysicalDevicePipelineCreationCacheControlFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineCreationCacheControlFeatures32 *in_ext = (const VkPhysicalDevicePipelineCreationCacheControlFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES; - out_ext->pNext = NULL; - out_ext->pipelineCreationCacheControl = in_ext->pipelineCreationCacheControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: - { - VkPhysicalDeviceVulkan11Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan11Features32 *in_ext = (const VkPhysicalDeviceVulkan11Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES; - out_ext->pNext = NULL; - out_ext->storageBuffer16BitAccess = in_ext->storageBuffer16BitAccess; - out_ext->uniformAndStorageBuffer16BitAccess = in_ext->uniformAndStorageBuffer16BitAccess; - out_ext->storagePushConstant16 = in_ext->storagePushConstant16; - out_ext->storageInputOutput16 = in_ext->storageInputOutput16; - out_ext->multiview = in_ext->multiview; - out_ext->multiviewGeometryShader = in_ext->multiviewGeometryShader; - out_ext->multiviewTessellationShader = in_ext->multiviewTessellationShader; - out_ext->variablePointersStorageBuffer = in_ext->variablePointersStorageBuffer; - out_ext->variablePointers = in_ext->variablePointers; - out_ext->protectedMemory = in_ext->protectedMemory; - out_ext->samplerYcbcrConversion = in_ext->samplerYcbcrConversion; - out_ext->shaderDrawParameters = in_ext->shaderDrawParameters; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: - { - VkPhysicalDeviceVulkan12Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan12Features32 *in_ext = (const VkPhysicalDeviceVulkan12Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES; - out_ext->pNext = NULL; - out_ext->samplerMirrorClampToEdge = in_ext->samplerMirrorClampToEdge; - out_ext->drawIndirectCount = in_ext->drawIndirectCount; - out_ext->storageBuffer8BitAccess = in_ext->storageBuffer8BitAccess; - out_ext->uniformAndStorageBuffer8BitAccess = in_ext->uniformAndStorageBuffer8BitAccess; - out_ext->storagePushConstant8 = in_ext->storagePushConstant8; - out_ext->shaderBufferInt64Atomics = in_ext->shaderBufferInt64Atomics; - out_ext->shaderSharedInt64Atomics = in_ext->shaderSharedInt64Atomics; - out_ext->shaderFloat16 = in_ext->shaderFloat16; - out_ext->shaderInt8 = in_ext->shaderInt8; - out_ext->descriptorIndexing = in_ext->descriptorIndexing; - out_ext->shaderInputAttachmentArrayDynamicIndexing = in_ext->shaderInputAttachmentArrayDynamicIndexing; - out_ext->shaderUniformTexelBufferArrayDynamicIndexing = in_ext->shaderUniformTexelBufferArrayDynamicIndexing; - out_ext->shaderStorageTexelBufferArrayDynamicIndexing = in_ext->shaderStorageTexelBufferArrayDynamicIndexing; - out_ext->shaderUniformBufferArrayNonUniformIndexing = in_ext->shaderUniformBufferArrayNonUniformIndexing; - out_ext->shaderSampledImageArrayNonUniformIndexing = in_ext->shaderSampledImageArrayNonUniformIndexing; - out_ext->shaderStorageBufferArrayNonUniformIndexing = in_ext->shaderStorageBufferArrayNonUniformIndexing; - out_ext->shaderStorageImageArrayNonUniformIndexing = in_ext->shaderStorageImageArrayNonUniformIndexing; - out_ext->shaderInputAttachmentArrayNonUniformIndexing = in_ext->shaderInputAttachmentArrayNonUniformIndexing; - out_ext->shaderUniformTexelBufferArrayNonUniformIndexing = in_ext->shaderUniformTexelBufferArrayNonUniformIndexing; - out_ext->shaderStorageTexelBufferArrayNonUniformIndexing = in_ext->shaderStorageTexelBufferArrayNonUniformIndexing; - out_ext->descriptorBindingUniformBufferUpdateAfterBind = in_ext->descriptorBindingUniformBufferUpdateAfterBind; - out_ext->descriptorBindingSampledImageUpdateAfterBind = in_ext->descriptorBindingSampledImageUpdateAfterBind; - out_ext->descriptorBindingStorageImageUpdateAfterBind = in_ext->descriptorBindingStorageImageUpdateAfterBind; - out_ext->descriptorBindingStorageBufferUpdateAfterBind = in_ext->descriptorBindingStorageBufferUpdateAfterBind; - out_ext->descriptorBindingUniformTexelBufferUpdateAfterBind = in_ext->descriptorBindingUniformTexelBufferUpdateAfterBind; - out_ext->descriptorBindingStorageTexelBufferUpdateAfterBind = in_ext->descriptorBindingStorageTexelBufferUpdateAfterBind; - out_ext->descriptorBindingUpdateUnusedWhilePending = in_ext->descriptorBindingUpdateUnusedWhilePending; - out_ext->descriptorBindingPartiallyBound = in_ext->descriptorBindingPartiallyBound; - out_ext->descriptorBindingVariableDescriptorCount = in_ext->descriptorBindingVariableDescriptorCount; - out_ext->runtimeDescriptorArray = in_ext->runtimeDescriptorArray; - out_ext->samplerFilterMinmax = in_ext->samplerFilterMinmax; - out_ext->scalarBlockLayout = in_ext->scalarBlockLayout; - out_ext->imagelessFramebuffer = in_ext->imagelessFramebuffer; - out_ext->uniformBufferStandardLayout = in_ext->uniformBufferStandardLayout; - out_ext->shaderSubgroupExtendedTypes = in_ext->shaderSubgroupExtendedTypes; - out_ext->separateDepthStencilLayouts = in_ext->separateDepthStencilLayouts; - out_ext->hostQueryReset = in_ext->hostQueryReset; - out_ext->timelineSemaphore = in_ext->timelineSemaphore; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_ext->vulkanMemoryModel = in_ext->vulkanMemoryModel; - out_ext->vulkanMemoryModelDeviceScope = in_ext->vulkanMemoryModelDeviceScope; - out_ext->vulkanMemoryModelAvailabilityVisibilityChains = in_ext->vulkanMemoryModelAvailabilityVisibilityChains; - out_ext->shaderOutputViewportIndex = in_ext->shaderOutputViewportIndex; - out_ext->shaderOutputLayer = in_ext->shaderOutputLayer; - out_ext->subgroupBroadcastDynamicId = in_ext->subgroupBroadcastDynamicId; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES: - { - VkPhysicalDeviceVulkan13Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan13Features32 *in_ext = (const VkPhysicalDeviceVulkan13Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES; - out_ext->pNext = NULL; - out_ext->robustImageAccess = in_ext->robustImageAccess; - out_ext->inlineUniformBlock = in_ext->inlineUniformBlock; - out_ext->descriptorBindingInlineUniformBlockUpdateAfterBind = in_ext->descriptorBindingInlineUniformBlockUpdateAfterBind; - out_ext->pipelineCreationCacheControl = in_ext->pipelineCreationCacheControl; - out_ext->privateData = in_ext->privateData; - out_ext->shaderDemoteToHelperInvocation = in_ext->shaderDemoteToHelperInvocation; - out_ext->shaderTerminateInvocation = in_ext->shaderTerminateInvocation; - out_ext->subgroupSizeControl = in_ext->subgroupSizeControl; - out_ext->computeFullSubgroups = in_ext->computeFullSubgroups; - out_ext->synchronization2 = in_ext->synchronization2; - out_ext->textureCompressionASTC_HDR = in_ext->textureCompressionASTC_HDR; - out_ext->shaderZeroInitializeWorkgroupMemory = in_ext->shaderZeroInitializeWorkgroupMemory; - out_ext->dynamicRendering = in_ext->dynamicRendering; - out_ext->shaderIntegerDotProduct = in_ext->shaderIntegerDotProduct; - out_ext->maintenance4 = in_ext->maintenance4; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES: - { - VkPhysicalDeviceVulkan14Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan14Features32 *in_ext = (const VkPhysicalDeviceVulkan14Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES; - out_ext->pNext = NULL; - out_ext->globalPriorityQuery = in_ext->globalPriorityQuery; - out_ext->shaderSubgroupRotate = in_ext->shaderSubgroupRotate; - out_ext->shaderSubgroupRotateClustered = in_ext->shaderSubgroupRotateClustered; - out_ext->shaderFloatControls2 = in_ext->shaderFloatControls2; - out_ext->shaderExpectAssume = in_ext->shaderExpectAssume; - out_ext->rectangularLines = in_ext->rectangularLines; - out_ext->bresenhamLines = in_ext->bresenhamLines; - out_ext->smoothLines = in_ext->smoothLines; - out_ext->stippledRectangularLines = in_ext->stippledRectangularLines; - out_ext->stippledBresenhamLines = in_ext->stippledBresenhamLines; - out_ext->stippledSmoothLines = in_ext->stippledSmoothLines; - out_ext->vertexAttributeInstanceRateDivisor = in_ext->vertexAttributeInstanceRateDivisor; - out_ext->vertexAttributeInstanceRateZeroDivisor = in_ext->vertexAttributeInstanceRateZeroDivisor; - out_ext->indexTypeUint8 = in_ext->indexTypeUint8; - out_ext->dynamicRenderingLocalRead = in_ext->dynamicRenderingLocalRead; - out_ext->maintenance5 = in_ext->maintenance5; - out_ext->maintenance6 = in_ext->maintenance6; - out_ext->pipelineProtectedAccess = in_ext->pipelineProtectedAccess; - out_ext->pipelineRobustness = in_ext->pipelineRobustness; - out_ext->hostImageCopy = in_ext->hostImageCopy; - out_ext->pushDescriptor = in_ext->pushDescriptor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: - { - VkPhysicalDeviceCoherentMemoryFeaturesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCoherentMemoryFeaturesAMD32 *in_ext = (const VkPhysicalDeviceCoherentMemoryFeaturesAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD; - out_ext->pNext = NULL; - out_ext->deviceCoherentMemory = in_ext->deviceCoherentMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: - { - VkPhysicalDeviceCustomBorderColorFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCustomBorderColorFeaturesEXT32 *in_ext = (const VkPhysicalDeviceCustomBorderColorFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->customBorderColors = in_ext->customBorderColors; - out_ext->customBorderColorWithoutFormat = in_ext->customBorderColorWithoutFormat; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: - { - VkPhysicalDeviceBorderColorSwizzleFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT32 *in_ext = (const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->borderColorSwizzle = in_ext->borderColorSwizzle; - out_ext->borderColorSwizzleFromImage = in_ext->borderColorSwizzleFromImage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT32 *in_ext = (const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->extendedDynamicState = in_ext->extendedDynamicState; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT32 *in_ext = (const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->extendedDynamicState2 = in_ext->extendedDynamicState2; - out_ext->extendedDynamicState2LogicOp = in_ext->extendedDynamicState2LogicOp; - out_ext->extendedDynamicState2PatchControlPoints = in_ext->extendedDynamicState2PatchControlPoints; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicState3FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicState3FeaturesEXT32 *in_ext = (const VkPhysicalDeviceExtendedDynamicState3FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->extendedDynamicState3TessellationDomainOrigin = in_ext->extendedDynamicState3TessellationDomainOrigin; - out_ext->extendedDynamicState3DepthClampEnable = in_ext->extendedDynamicState3DepthClampEnable; - out_ext->extendedDynamicState3PolygonMode = in_ext->extendedDynamicState3PolygonMode; - out_ext->extendedDynamicState3RasterizationSamples = in_ext->extendedDynamicState3RasterizationSamples; - out_ext->extendedDynamicState3SampleMask = in_ext->extendedDynamicState3SampleMask; - out_ext->extendedDynamicState3AlphaToCoverageEnable = in_ext->extendedDynamicState3AlphaToCoverageEnable; - out_ext->extendedDynamicState3AlphaToOneEnable = in_ext->extendedDynamicState3AlphaToOneEnable; - out_ext->extendedDynamicState3LogicOpEnable = in_ext->extendedDynamicState3LogicOpEnable; - out_ext->extendedDynamicState3ColorBlendEnable = in_ext->extendedDynamicState3ColorBlendEnable; - out_ext->extendedDynamicState3ColorBlendEquation = in_ext->extendedDynamicState3ColorBlendEquation; - out_ext->extendedDynamicState3ColorWriteMask = in_ext->extendedDynamicState3ColorWriteMask; - out_ext->extendedDynamicState3RasterizationStream = in_ext->extendedDynamicState3RasterizationStream; - out_ext->extendedDynamicState3ConservativeRasterizationMode = in_ext->extendedDynamicState3ConservativeRasterizationMode; - out_ext->extendedDynamicState3ExtraPrimitiveOverestimationSize = in_ext->extendedDynamicState3ExtraPrimitiveOverestimationSize; - out_ext->extendedDynamicState3DepthClipEnable = in_ext->extendedDynamicState3DepthClipEnable; - out_ext->extendedDynamicState3SampleLocationsEnable = in_ext->extendedDynamicState3SampleLocationsEnable; - out_ext->extendedDynamicState3ColorBlendAdvanced = in_ext->extendedDynamicState3ColorBlendAdvanced; - out_ext->extendedDynamicState3ProvokingVertexMode = in_ext->extendedDynamicState3ProvokingVertexMode; - out_ext->extendedDynamicState3LineRasterizationMode = in_ext->extendedDynamicState3LineRasterizationMode; - out_ext->extendedDynamicState3LineStippleEnable = in_ext->extendedDynamicState3LineStippleEnable; - out_ext->extendedDynamicState3DepthClipNegativeOneToOne = in_ext->extendedDynamicState3DepthClipNegativeOneToOne; - out_ext->extendedDynamicState3ViewportWScalingEnable = in_ext->extendedDynamicState3ViewportWScalingEnable; - out_ext->extendedDynamicState3ViewportSwizzle = in_ext->extendedDynamicState3ViewportSwizzle; - out_ext->extendedDynamicState3CoverageToColorEnable = in_ext->extendedDynamicState3CoverageToColorEnable; - out_ext->extendedDynamicState3CoverageToColorLocation = in_ext->extendedDynamicState3CoverageToColorLocation; - out_ext->extendedDynamicState3CoverageModulationMode = in_ext->extendedDynamicState3CoverageModulationMode; - out_ext->extendedDynamicState3CoverageModulationTableEnable = in_ext->extendedDynamicState3CoverageModulationTableEnable; - out_ext->extendedDynamicState3CoverageModulationTable = in_ext->extendedDynamicState3CoverageModulationTable; - out_ext->extendedDynamicState3CoverageReductionMode = in_ext->extendedDynamicState3CoverageReductionMode; - out_ext->extendedDynamicState3RepresentativeFragmentTestEnable = in_ext->extendedDynamicState3RepresentativeFragmentTestEnable; - out_ext->extendedDynamicState3ShadingRateImageEnable = in_ext->extendedDynamicState3ShadingRateImageEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: - { - VkPhysicalDeviceDiagnosticsConfigFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDiagnosticsConfigFeaturesNV32 *in_ext = (const VkPhysicalDeviceDiagnosticsConfigFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->diagnosticsConfig = in_ext->diagnosticsConfig; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV: - { - VkDeviceDiagnosticsConfigCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceDiagnosticsConfigCreateInfoNV32 *in_ext = (const VkDeviceDiagnosticsConfigCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES: - { - VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures32 *in_ext = (const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderZeroInitializeWorkgroupMemory = in_ext->shaderZeroInitializeWorkgroupMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: - { - VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR32 *in_ext = (const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderSubgroupUniformControlFlow = in_ext->shaderSubgroupUniformControlFlow; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: - { - VkPhysicalDeviceRobustness2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRobustness2FeaturesEXT32 *in_ext = (const VkPhysicalDeviceRobustness2FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->robustBufferAccess2 = in_ext->robustBufferAccess2; - out_ext->robustImageAccess2 = in_ext->robustImageAccess2; - out_ext->nullDescriptor = in_ext->nullDescriptor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES: - { - VkPhysicalDeviceImageRobustnessFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageRobustnessFeatures32 *in_ext = (const VkPhysicalDeviceImageRobustnessFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES; - out_ext->pNext = NULL; - out_ext->robustImageAccess = in_ext->robustImageAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: - { - VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR32 *in_ext = (const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->workgroupMemoryExplicitLayout = in_ext->workgroupMemoryExplicitLayout; - out_ext->workgroupMemoryExplicitLayoutScalarBlockLayout = in_ext->workgroupMemoryExplicitLayoutScalarBlockLayout; - out_ext->workgroupMemoryExplicitLayout8BitAccess = in_ext->workgroupMemoryExplicitLayout8BitAccess; - out_ext->workgroupMemoryExplicitLayout16BitAccess = in_ext->workgroupMemoryExplicitLayout16BitAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: - { - VkPhysicalDevice4444FormatsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevice4444FormatsFeaturesEXT32 *in_ext = (const VkPhysicalDevice4444FormatsFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->formatA4R4G4B4 = in_ext->formatA4R4G4B4; - out_ext->formatA4B4G4R4 = in_ext->formatA4B4G4R4; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: - { - VkPhysicalDeviceSubpassShadingFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI32 *in_ext = (const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->subpassShading = in_ext->subpassShading; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI: - { - VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI32 *in_ext = (const VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->clustercullingShader = in_ext->clustercullingShader; - out_ext->multiviewClusterCullingShader = in_ext->multiviewClusterCullingShader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: - { - VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderImageInt64Atomics = in_ext->shaderImageInt64Atomics; - out_ext->sparseImageInt64Atomics = in_ext->sparseImageInt64Atomics; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: - { - VkPhysicalDeviceFragmentShadingRateFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShadingRateFeaturesKHR32 *in_ext = (const VkPhysicalDeviceFragmentShadingRateFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->pipelineFragmentShadingRate = in_ext->pipelineFragmentShadingRate; - out_ext->primitiveFragmentShadingRate = in_ext->primitiveFragmentShadingRate; - out_ext->attachmentFragmentShadingRate = in_ext->attachmentFragmentShadingRate; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES: - { - VkPhysicalDeviceShaderTerminateInvocationFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderTerminateInvocationFeatures32 *in_ext = (const VkPhysicalDeviceShaderTerminateInvocationFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderTerminateInvocation = in_ext->shaderTerminateInvocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: - { - VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV32 *in_ext = (const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->fragmentShadingRateEnums = in_ext->fragmentShadingRateEnums; - out_ext->supersampleFragmentShadingRates = in_ext->supersampleFragmentShadingRates; - out_ext->noInvocationFragmentShadingRates = in_ext->noInvocationFragmentShadingRates; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT: - { - VkPhysicalDeviceImage2DViewOf3DFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImage2DViewOf3DFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImage2DViewOf3DFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->image2DViewOf3D = in_ext->image2DViewOf3D; - out_ext->sampler2DViewOf3D = in_ext->sampler2DViewOf3D; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT: - { - VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->imageSlicedViewOf3D = in_ext->imageSlicedViewOf3D; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT32 *in_ext = (const VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->attachmentFeedbackLoopDynamicState = in_ext->attachmentFeedbackLoopDynamicState; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT: - { - VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT32 *in_ext = (const VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->legacyVertexAttributes = in_ext->legacyVertexAttributes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT: - { - VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->mutableDescriptorType = in_ext->mutableDescriptorType; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthClipControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClipControlFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDepthClipControlFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClipControl = in_ext->depthClipControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_EXT: - { - VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->deviceGeneratedCommands = in_ext->deviceGeneratedCommands; - out_ext->dynamicGeneratedPipelineLayout = in_ext->dynamicGeneratedPipelineLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthClampControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClampControlFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDepthClampControlFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClampControl = in_ext->depthClampControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT32 *in_ext = (const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->vertexInputDynamicState = in_ext->vertexInputDynamicState; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR: - { - VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR32 *in_ext = (const VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderRelaxedExtendedInstruction = in_ext->shaderRelaxedExtendedInstruction; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: - { - VkPhysicalDeviceColorWriteEnableFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceColorWriteEnableFeaturesEXT32 *in_ext = (const VkPhysicalDeviceColorWriteEnableFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->colorWriteEnable = in_ext->colorWriteEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES: - { - VkPhysicalDeviceSynchronization2Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSynchronization2Features32 *in_ext = (const VkPhysicalDeviceSynchronization2Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES; - out_ext->pNext = NULL; - out_ext->synchronization2 = in_ext->synchronization2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES: - { - VkPhysicalDeviceHostImageCopyFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceHostImageCopyFeatures32 *in_ext = (const VkPhysicalDeviceHostImageCopyFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES; - out_ext->pNext = NULL; - out_ext->hostImageCopy = in_ext->hostImageCopy; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT: - { - VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT32 *in_ext = (const VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->primitivesGeneratedQuery = in_ext->primitivesGeneratedQuery; - out_ext->primitivesGeneratedQueryWithRasterizerDiscard = in_ext->primitivesGeneratedQueryWithRasterizerDiscard; - out_ext->primitivesGeneratedQueryWithNonZeroStreams = in_ext->primitivesGeneratedQueryWithNonZeroStreams; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT: - { - VkPhysicalDeviceLegacyDitheringFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLegacyDitheringFeaturesEXT32 *in_ext = (const VkPhysicalDeviceLegacyDitheringFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->legacyDithering = in_ext->legacyDithering; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT: - { - VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->multisampledRenderToSingleSampled = in_ext->multisampledRenderToSingleSampled; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES: - { - VkPhysicalDevicePipelineProtectedAccessFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineProtectedAccessFeatures32 *in_ext = (const VkPhysicalDevicePipelineProtectedAccessFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES; - out_ext->pNext = NULL; - out_ext->pipelineProtectedAccess = in_ext->pipelineProtectedAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR: - { - VkPhysicalDeviceVideoMaintenance1FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVideoMaintenance1FeaturesKHR32 *in_ext = (const VkPhysicalDeviceVideoMaintenance1FeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->videoMaintenance1 = in_ext->videoMaintenance1; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUANTIZATION_MAP_FEATURES_KHR: - { - VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR32 *in_ext = (const VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUANTIZATION_MAP_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->videoEncodeQuantizationMap = in_ext->videoEncodeQuantizationMap; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_AV1_FEATURES_KHR: - { - VkPhysicalDeviceVideoEncodeAV1FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVideoEncodeAV1FeaturesKHR32 *in_ext = (const VkPhysicalDeviceVideoEncodeAV1FeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_AV1_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->videoEncodeAV1 = in_ext->videoEncodeAV1; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: - { - VkPhysicalDeviceInheritedViewportScissorFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceInheritedViewportScissorFeaturesNV32 *in_ext = (const VkPhysicalDeviceInheritedViewportScissorFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->inheritedViewportScissor2D = in_ext->inheritedViewportScissor2D; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: - { - VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT32 *in_ext = (const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->ycbcr2plane444Formats = in_ext->ycbcr2plane444Formats; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: - { - VkPhysicalDeviceProvokingVertexFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceProvokingVertexFeaturesEXT32 *in_ext = (const VkPhysicalDeviceProvokingVertexFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->provokingVertexLast = in_ext->provokingVertexLast; - out_ext->transformFeedbackPreservesProvokingVertex = in_ext->transformFeedbackPreservesProvokingVertex; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT: - { - VkPhysicalDeviceDescriptorBufferFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorBufferFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDescriptorBufferFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->descriptorBuffer = in_ext->descriptorBuffer; - out_ext->descriptorBufferCaptureReplay = in_ext->descriptorBufferCaptureReplay; - out_ext->descriptorBufferImageLayoutIgnored = in_ext->descriptorBufferImageLayoutIgnored; - out_ext->descriptorBufferPushDescriptors = in_ext->descriptorBufferPushDescriptors; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: - { - VkPhysicalDeviceShaderIntegerDotProductFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderIntegerDotProductFeatures32 *in_ext = (const VkPhysicalDeviceShaderIntegerDotProductFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderIntegerDotProduct = in_ext->shaderIntegerDotProduct; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR: - { - VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR32 *in_ext = (const VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->fragmentShaderBarycentric = in_ext->fragmentShaderBarycentric; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: - { - VkPhysicalDeviceRayTracingMotionBlurFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV32 *in_ext = (const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->rayTracingMotionBlur = in_ext->rayTracingMotionBlur; - out_ext->rayTracingMotionBlurPipelineTraceRaysIndirect = in_ext->rayTracingMotionBlurPipelineTraceRaysIndirect; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_VALIDATION_FEATURES_NV: - { - VkPhysicalDeviceRayTracingValidationFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingValidationFeaturesNV32 *in_ext = (const VkPhysicalDeviceRayTracingValidationFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_VALIDATION_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->rayTracingValidation = in_ext->rayTracingValidation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: - { - VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT32 *in_ext = (const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->formatRgba10x6WithoutYCbCrSampler = in_ext->formatRgba10x6WithoutYCbCrSampler; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES: - { - VkPhysicalDeviceDynamicRenderingFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDynamicRenderingFeatures32 *in_ext = (const VkPhysicalDeviceDynamicRenderingFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES; - out_ext->pNext = NULL; - out_ext->dynamicRendering = in_ext->dynamicRendering; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT: - { - VkPhysicalDeviceImageViewMinLodFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageViewMinLodFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImageViewMinLodFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->minLod = in_ext->minLod; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT: - { - VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT32 *in_ext = (const VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->rasterizationOrderColorAttachmentAccess = in_ext->rasterizationOrderColorAttachmentAccess; - out_ext->rasterizationOrderDepthAttachmentAccess = in_ext->rasterizationOrderDepthAttachmentAccess; - out_ext->rasterizationOrderStencilAttachmentAccess = in_ext->rasterizationOrderStencilAttachmentAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV: - { - VkPhysicalDeviceLinearColorAttachmentFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLinearColorAttachmentFeaturesNV32 *in_ext = (const VkPhysicalDeviceLinearColorAttachmentFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->linearColorAttachment = in_ext->linearColorAttachment; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT: - { - VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT32 *in_ext = (const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->graphicsPipelineLibrary = in_ext->graphicsPipelineLibrary; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR: - { - VkPhysicalDevicePipelineBinaryFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineBinaryFeaturesKHR32 *in_ext = (const VkPhysicalDevicePipelineBinaryFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->pipelineBinaries = in_ext->pipelineBinaries; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_PIPELINE_BINARY_INTERNAL_CACHE_CONTROL_KHR: - { - VkDevicePipelineBinaryInternalCacheControlKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDevicePipelineBinaryInternalCacheControlKHR32 *in_ext = (const VkDevicePipelineBinaryInternalCacheControlKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_PIPELINE_BINARY_INTERNAL_CACHE_CONTROL_KHR; - out_ext->pNext = NULL; - out_ext->disableInternalCache = in_ext->disableInternalCache; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE: - { - VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE32 *in_ext = (const VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE; - out_ext->pNext = NULL; - out_ext->descriptorSetHostMapping = in_ext->descriptorSetHostMapping; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT: - { - VkPhysicalDeviceNestedCommandBufferFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceNestedCommandBufferFeaturesEXT32 *in_ext = (const VkPhysicalDeviceNestedCommandBufferFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->nestedCommandBuffer = in_ext->nestedCommandBuffer; - out_ext->nestedCommandBufferRendering = in_ext->nestedCommandBufferRendering; - out_ext->nestedCommandBufferSimultaneousUse = in_ext->nestedCommandBufferSimultaneousUse; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT: - { - VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderModuleIdentifier = in_ext->shaderModuleIdentifier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceImageCompressionControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageCompressionControlFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImageCompressionControlFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->imageCompressionControl = in_ext->imageCompressionControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT: - { - VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->imageCompressionControlSwapchain = in_ext->imageCompressionControlSwapchain; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT: - { - VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT32 *in_ext = (const VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->subpassMergeFeedback = in_ext->subpassMergeFeedback; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT: - { - VkPhysicalDeviceOpacityMicromapFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceOpacityMicromapFeaturesEXT32 *in_ext = (const VkPhysicalDeviceOpacityMicromapFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->micromap = in_ext->micromap; - out_ext->micromapCaptureReplay = in_ext->micromapCaptureReplay; - out_ext->micromapHostCommands = in_ext->micromapHostCommands; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT: - { - VkPhysicalDevicePipelinePropertiesFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelinePropertiesFeaturesEXT32 *in_ext = (const VkPhysicalDevicePipelinePropertiesFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pipelinePropertiesIdentifier = in_ext->pipelinePropertiesIdentifier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD: - { - VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD32 *in_ext = (const VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD; - out_ext->pNext = NULL; - out_ext->shaderEarlyAndLateFragmentTests = in_ext->shaderEarlyAndLateFragmentTests; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT: - { - VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT32 *in_ext = (const VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->nonSeamlessCubeMap = in_ext->nonSeamlessCubeMap; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES: - { - VkPhysicalDevicePipelineRobustnessFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineRobustnessFeatures32 *in_ext = (const VkPhysicalDevicePipelineRobustnessFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES; - out_ext->pNext = NULL; - out_ext->pipelineRobustness = in_ext->pipelineRobustness; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM: - { - VkPhysicalDeviceImageProcessingFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageProcessingFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceImageProcessingFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->textureSampleWeighted = in_ext->textureSampleWeighted; - out_ext->textureBoxFilter = in_ext->textureBoxFilter; - out_ext->textureBlockMatch = in_ext->textureBlockMatch; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM: - { - VkPhysicalDeviceTilePropertiesFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTilePropertiesFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceTilePropertiesFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->tileProperties = in_ext->tileProperties; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT: - { - VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT32 *in_ext = (const VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->attachmentFeedbackLoopLayout = in_ext->attachmentFeedbackLoopLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT: - { - VkPhysicalDeviceDepthClampZeroOneFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClampZeroOneFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDepthClampZeroOneFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClampZeroOne = in_ext->depthClampZeroOne; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT: - { - VkPhysicalDeviceAddressBindingReportFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAddressBindingReportFeaturesEXT32 *in_ext = (const VkPhysicalDeviceAddressBindingReportFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->reportAddressBinding = in_ext->reportAddressBinding; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV: - { - VkPhysicalDeviceOpticalFlowFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceOpticalFlowFeaturesNV32 *in_ext = (const VkPhysicalDeviceOpticalFlowFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->opticalFlow = in_ext->opticalFlow; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT: - { - VkPhysicalDeviceFaultFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFaultFeaturesEXT32 *in_ext = (const VkPhysicalDeviceFaultFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->deviceFault = in_ext->deviceFault; - out_ext->deviceFaultVendorBinary = in_ext->deviceFaultVendorBinary; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT: - { - VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT32 *in_ext = (const VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pipelineLibraryGroupHandles = in_ext->pipelineLibraryGroupHandles; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM: - { - VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM32 *in_ext = (const VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM; - out_ext->pNext = NULL; - out_ext->shaderCoreBuiltins = in_ext->shaderCoreBuiltins; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT: - { - VkPhysicalDeviceFrameBoundaryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFrameBoundaryFeaturesEXT32 *in_ext = (const VkPhysicalDeviceFrameBoundaryFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->frameBoundary = in_ext->frameBoundary; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT: - { - VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->dynamicRenderingUnusedAttachments = in_ext->dynamicRenderingUnusedAttachments; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT: - { - VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT32 *in_ext = (const VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->swapchainMaintenance1 = in_ext->swapchainMaintenance1; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthBiasControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthBiasControlFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDepthBiasControlFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthBiasControl = in_ext->depthBiasControl; - out_ext->leastRepresentableValueForceUnormRepresentation = in_ext->leastRepresentableValueForceUnormRepresentation; - out_ext->floatRepresentation = in_ext->floatRepresentation; - out_ext->depthBiasExact = in_ext->depthBiasExact; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV: - { - VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV32 *in_ext = (const VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->rayTracingInvocationReorder = in_ext->rayTracingInvocationReorder; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV: - { - VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV32 *in_ext = (const VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->extendedSparseAddressSpace = in_ext->extendedSparseAddressSpace; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM: - { - VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->multiviewPerViewViewports = in_ext->multiviewPerViewViewports; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR32 *in_ext = (const VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayTracingPositionFetch = in_ext->rayTracingPositionFetch; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM: - { - VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->multiviewPerViewRenderAreas = in_ext->multiviewPerViewRenderAreas; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT: - { - VkPhysicalDeviceShaderObjectFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderObjectFeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderObjectFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderObject = in_ext->shaderObject; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT: - { - VkPhysicalDeviceShaderTileImageFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderTileImageFeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderTileImageFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderTileImageColorReadAccess = in_ext->shaderTileImageColorReadAccess; - out_ext->shaderTileImageDepthReadAccess = in_ext->shaderTileImageDepthReadAccess; - out_ext->shaderTileImageStencilReadAccess = in_ext->shaderTileImageStencilReadAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR: - { - VkPhysicalDeviceCooperativeMatrixFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCooperativeMatrixFeaturesKHR32 *in_ext = (const VkPhysicalDeviceCooperativeMatrixFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->cooperativeMatrix = in_ext->cooperativeMatrix; - out_ext->cooperativeMatrixRobustBufferAccess = in_ext->cooperativeMatrixRobustBufferAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ANTI_LAG_FEATURES_AMD: - { - VkPhysicalDeviceAntiLagFeaturesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAntiLagFeaturesAMD32 *in_ext = (const VkPhysicalDeviceAntiLagFeaturesAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ANTI_LAG_FEATURES_AMD; - out_ext->pNext = NULL; - out_ext->antiLag = in_ext->antiLag; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM: - { - VkPhysicalDeviceCubicClampFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCubicClampFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceCubicClampFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->cubicRangeClamp = in_ext->cubicRangeClamp; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM: - { - VkPhysicalDeviceYcbcrDegammaFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceYcbcrDegammaFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceYcbcrDegammaFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->ycbcrDegamma = in_ext->ycbcrDegamma; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM: - { - VkPhysicalDeviceCubicWeightsFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCubicWeightsFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceCubicWeightsFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->selectableCubicWeights = in_ext->selectableCubicWeights; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM: - { - VkPhysicalDeviceImageProcessing2FeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageProcessing2FeaturesQCOM32 *in_ext = (const VkPhysicalDeviceImageProcessing2FeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->textureBlockMatch2 = in_ext->textureBlockMatch2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV: - { - VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV32 *in_ext = (const VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->descriptorPoolOverallocation = in_ext->descriptorPoolOverallocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PER_STAGE_DESCRIPTOR_SET_FEATURES_NV: - { - VkPhysicalDevicePerStageDescriptorSetFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePerStageDescriptorSetFeaturesNV32 *in_ext = (const VkPhysicalDevicePerStageDescriptorSetFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PER_STAGE_DESCRIPTOR_SET_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->perStageDescriptorSet = in_ext->perStageDescriptorSet; - out_ext->dynamicPipelineLayout = in_ext->dynamicPipelineLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV: - { - VkPhysicalDeviceCudaKernelLaunchFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCudaKernelLaunchFeaturesNV32 *in_ext = (const VkPhysicalDeviceCudaKernelLaunchFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cudaKernelLaunchFeatures = in_ext->cudaKernelLaunchFeatures; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM: - { - VkDeviceQueueShaderCoreControlCreateInfoARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceQueueShaderCoreControlCreateInfoARM32 *in_ext = (const VkDeviceQueueShaderCoreControlCreateInfoARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM; - out_ext->pNext = NULL; - out_ext->shaderCoreCount = in_ext->shaderCoreCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM: - { - VkPhysicalDeviceSchedulingControlsFeaturesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSchedulingControlsFeaturesARM32 *in_ext = (const VkPhysicalDeviceSchedulingControlsFeaturesARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM; - out_ext->pNext = NULL; - out_ext->schedulingControls = in_ext->schedulingControls; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG: - { - VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG32 *in_ext = (const VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG; - out_ext->pNext = NULL; - out_ext->relaxedLineRasterization = in_ext->relaxedLineRasterization; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_FEATURES_ARM: - { - VkPhysicalDeviceRenderPassStripedFeaturesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRenderPassStripedFeaturesARM32 *in_ext = (const VkPhysicalDeviceRenderPassStripedFeaturesARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_FEATURES_ARM; - out_ext->pNext = NULL; - out_ext->renderPassStriped = in_ext->renderPassStriped; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR: - { - VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR32 *in_ext = (const VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderMaximalReconvergence = in_ext->shaderMaximalReconvergence; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES: - { - VkPhysicalDeviceShaderSubgroupRotateFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSubgroupRotateFeatures32 *in_ext = (const VkPhysicalDeviceShaderSubgroupRotateFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderSubgroupRotate = in_ext->shaderSubgroupRotate; - out_ext->shaderSubgroupRotateClustered = in_ext->shaderSubgroupRotateClustered; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES: - { - VkPhysicalDeviceShaderExpectAssumeFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderExpectAssumeFeatures32 *in_ext = (const VkPhysicalDeviceShaderExpectAssumeFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderExpectAssume = in_ext->shaderExpectAssume; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES: - { - VkPhysicalDeviceShaderFloatControls2Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderFloatControls2Features32 *in_ext = (const VkPhysicalDeviceShaderFloatControls2Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderFloatControls2 = in_ext->shaderFloatControls2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES: - { - VkPhysicalDeviceDynamicRenderingLocalReadFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDynamicRenderingLocalReadFeatures32 *in_ext = (const VkPhysicalDeviceDynamicRenderingLocalReadFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES; - out_ext->pNext = NULL; - out_ext->dynamicRenderingLocalRead = in_ext->dynamicRenderingLocalRead; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_QUAD_CONTROL_FEATURES_KHR: - { - VkPhysicalDeviceShaderQuadControlFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderQuadControlFeaturesKHR32 *in_ext = (const VkPhysicalDeviceShaderQuadControlFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_QUAD_CONTROL_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderQuadControl = in_ext->shaderQuadControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT16_VECTOR_FEATURES_NV: - { - VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV32 *in_ext = (const VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT16_VECTOR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->shaderFloat16VectorAtomics = in_ext->shaderFloat16VectorAtomics; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_FEATURES_EXT: - { - VkPhysicalDeviceMapMemoryPlacedFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMapMemoryPlacedFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMapMemoryPlacedFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->memoryMapPlaced = in_ext->memoryMapPlaced; - out_ext->memoryMapRangePlaced = in_ext->memoryMapRangePlaced; - out_ext->memoryUnmapReserve = in_ext->memoryUnmapReserve; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAW_ACCESS_CHAINS_FEATURES_NV: - { - VkPhysicalDeviceRawAccessChainsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRawAccessChainsFeaturesNV32 *in_ext = (const VkPhysicalDeviceRawAccessChainsFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAW_ACCESS_CHAINS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->shaderRawAccessChains = in_ext->shaderRawAccessChains; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMMAND_BUFFER_INHERITANCE_FEATURES_NV: - { - VkPhysicalDeviceCommandBufferInheritanceFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCommandBufferInheritanceFeaturesNV32 *in_ext = (const VkPhysicalDeviceCommandBufferInheritanceFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMMAND_BUFFER_INHERITANCE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->commandBufferInheritance = in_ext->commandBufferInheritance; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_FEATURES_MESA: - { - VkPhysicalDeviceImageAlignmentControlFeaturesMESA *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageAlignmentControlFeaturesMESA32 *in_ext = (const VkPhysicalDeviceImageAlignmentControlFeaturesMESA32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_FEATURES_MESA; - out_ext->pNext = NULL; - out_ext->imageAlignmentControl = in_ext->imageAlignmentControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_REPLICATED_COMPOSITES_FEATURES_EXT: - { - VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_REPLICATED_COMPOSITES_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderReplicatedComposites = in_ext->shaderReplicatedComposites; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT: - { - VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT32 *in_ext = (const VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->presentModeFifoLatestReady = in_ext->presentModeFifoLatestReady; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_FEATURES_NV: - { - VkPhysicalDeviceCooperativeMatrix2FeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCooperativeMatrix2FeaturesNV32 *in_ext = (const VkPhysicalDeviceCooperativeMatrix2FeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cooperativeMatrixWorkgroupScope = in_ext->cooperativeMatrixWorkgroupScope; - out_ext->cooperativeMatrixFlexibleDimensions = in_ext->cooperativeMatrixFlexibleDimensions; - out_ext->cooperativeMatrixReductions = in_ext->cooperativeMatrixReductions; - out_ext->cooperativeMatrixConversions = in_ext->cooperativeMatrixConversions; - out_ext->cooperativeMatrixPerElementOperations = in_ext->cooperativeMatrixPerElementOperations; - out_ext->cooperativeMatrixTensorAddressing = in_ext->cooperativeMatrixTensorAddressing; - out_ext->cooperativeMatrixBlockLoads = in_ext->cooperativeMatrixBlockLoads; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HDR_VIVID_FEATURES_HUAWEI: - { - VkPhysicalDeviceHdrVividFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceHdrVividFeaturesHUAWEI32 *in_ext = (const VkPhysicalDeviceHdrVividFeaturesHUAWEI32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HDR_VIVID_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->hdrVivid = in_ext->hdrVivid; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_ROBUSTNESS_FEATURES_EXT: - { - VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT32 *in_ext = (const VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_ROBUSTNESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->vertexAttributeRobustness = in_ext->vertexAttributeRobustness; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkEventCreateInfo_win32_to_host(const VkEventCreateInfo32 *in, VkEventCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkFenceCreateInfo_win32_to_host(struct conversion_context *ctx, const VkFenceCreateInfo32 *in, VkFenceCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO: - { - VkExportFenceCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExportFenceCreateInfo32 *in_ext = (const VkExportFenceCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->handleTypes = in_ext->handleTypes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkFramebufferAttachmentImageInfo_win32_to_host(const VkFramebufferAttachmentImageInfo32 *in, VkFramebufferAttachmentImageInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->usage = in->usage; - out->width = in->width; - out->height = in->height; - out->layerCount = in->layerCount; - out->viewFormatCount = in->viewFormatCount; - out->pViewFormats = UlongToPtr(in->pViewFormats); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkFramebufferAttachmentImageInfo *convert_VkFramebufferAttachmentImageInfo_array_win32_to_host(struct conversion_context *ctx, const VkFramebufferAttachmentImageInfo32 *in, uint32_t count) -{ - VkFramebufferAttachmentImageInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkFramebufferAttachmentImageInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkFramebufferCreateInfo_win32_to_host(struct conversion_context *ctx, const VkFramebufferCreateInfo32 *in, VkFramebufferCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->renderPass = in->renderPass; - out->attachmentCount = in->attachmentCount; - out->pAttachments = UlongToPtr(in->pAttachments); - out->width = in->width; - out->height = in->height; - out->layers = in->layers; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO: - { - VkFramebufferAttachmentsCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkFramebufferAttachmentsCreateInfo32 *in_ext = (const VkFramebufferAttachmentsCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->attachmentImageInfoCount = in_ext->attachmentImageInfoCount; - out_ext->pAttachmentImageInfos = convert_VkFramebufferAttachmentImageInfo_array_win32_to_host(ctx, (const VkFramebufferAttachmentImageInfo32 *)UlongToPtr(in_ext->pAttachmentImageInfos), in_ext->attachmentImageInfoCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline const VkPipelineShaderStageCreateInfo *convert_VkPipelineShaderStageCreateInfo_array_win64_to_host(struct conversion_context *ctx, const VkPipelineShaderStageCreateInfo *in, uint32_t count) -{ - VkPipelineShaderStageCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineShaderStageCreateInfo_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkPipelineShaderStageCreateInfo *convert_VkPipelineShaderStageCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineShaderStageCreateInfo32 *in, uint32_t count) -{ - VkPipelineShaderStageCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineShaderStageCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineVertexInputStateCreateInfo_win32_to_host(struct conversion_context *ctx, const VkPipelineVertexInputStateCreateInfo32 *in, VkPipelineVertexInputStateCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->vertexBindingDescriptionCount = in->vertexBindingDescriptionCount; - out->pVertexBindingDescriptions = UlongToPtr(in->pVertexBindingDescriptions); - out->vertexAttributeDescriptionCount = in->vertexAttributeDescriptionCount; - out->pVertexAttributeDescriptions = UlongToPtr(in->pVertexAttributeDescriptions); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO: - { - VkPipelineVertexInputDivisorStateCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineVertexInputDivisorStateCreateInfo32 *in_ext = (const VkPipelineVertexInputDivisorStateCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->vertexBindingDivisorCount = in_ext->vertexBindingDivisorCount; - out_ext->pVertexBindingDivisors = UlongToPtr(in_ext->pVertexBindingDivisors); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkPipelineVertexInputStateCreateInfo *convert_VkPipelineVertexInputStateCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineVertexInputStateCreateInfo32 *in, uint32_t count) -{ - VkPipelineVertexInputStateCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineVertexInputStateCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineTessellationStateCreateInfo_win32_to_host(struct conversion_context *ctx, const VkPipelineTessellationStateCreateInfo32 *in, VkPipelineTessellationStateCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->patchControlPoints = in->patchControlPoints; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: - { - VkPipelineTessellationDomainOriginStateCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineTessellationDomainOriginStateCreateInfo32 *in_ext = (const VkPipelineTessellationDomainOriginStateCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->domainOrigin = in_ext->domainOrigin; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkPipelineTessellationStateCreateInfo *convert_VkPipelineTessellationStateCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineTessellationStateCreateInfo32 *in, uint32_t count) -{ - VkPipelineTessellationStateCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineTessellationStateCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkGraphicsShaderGroupCreateInfoNV_win64_to_host(struct conversion_context *ctx, const VkGraphicsShaderGroupCreateInfoNV *in, VkGraphicsShaderGroupCreateInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->stageCount = in->stageCount; - out->pStages = convert_VkPipelineShaderStageCreateInfo_array_win64_to_host(ctx, in->pStages, in->stageCount); - out->pVertexInputState = in->pVertexInputState; - out->pTessellationState = in->pTessellationState; -} -#endif /* _WIN64 */ - -static inline void convert_VkGraphicsShaderGroupCreateInfoNV_win32_to_host(struct conversion_context *ctx, const VkGraphicsShaderGroupCreateInfoNV32 *in, VkGraphicsShaderGroupCreateInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->stageCount = in->stageCount; - out->pStages = convert_VkPipelineShaderStageCreateInfo_array_win32_to_host(ctx, (const VkPipelineShaderStageCreateInfo32 *)UlongToPtr(in->pStages), in->stageCount); - out->pVertexInputState = convert_VkPipelineVertexInputStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineVertexInputStateCreateInfo32 *)UlongToPtr(in->pVertexInputState), 1); - out->pTessellationState = convert_VkPipelineTessellationStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineTessellationStateCreateInfo32 *)UlongToPtr(in->pTessellationState), 1); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline const VkGraphicsShaderGroupCreateInfoNV *convert_VkGraphicsShaderGroupCreateInfoNV_array_win64_to_host(struct conversion_context *ctx, const VkGraphicsShaderGroupCreateInfoNV *in, uint32_t count) -{ - VkGraphicsShaderGroupCreateInfoNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkGraphicsShaderGroupCreateInfoNV_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkGraphicsShaderGroupCreateInfoNV *convert_VkGraphicsShaderGroupCreateInfoNV_array_win32_to_host(struct conversion_context *ctx, const VkGraphicsShaderGroupCreateInfoNV32 *in, uint32_t count) -{ - VkGraphicsShaderGroupCreateInfoNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkGraphicsShaderGroupCreateInfoNV_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineInputAssemblyStateCreateInfo_win32_to_host(const VkPipelineInputAssemblyStateCreateInfo32 *in, VkPipelineInputAssemblyStateCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->topology = in->topology; - out->primitiveRestartEnable = in->primitiveRestartEnable; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkPipelineInputAssemblyStateCreateInfo *convert_VkPipelineInputAssemblyStateCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineInputAssemblyStateCreateInfo32 *in, uint32_t count) -{ - VkPipelineInputAssemblyStateCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineInputAssemblyStateCreateInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineViewportStateCreateInfo_win32_to_host(struct conversion_context *ctx, const VkPipelineViewportStateCreateInfo32 *in, VkPipelineViewportStateCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->viewportCount = in->viewportCount; - out->pViewports = UlongToPtr(in->pViewports); - out->scissorCount = in->scissorCount; - out->pScissors = UlongToPtr(in->pScissors); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV: - { - VkPipelineViewportWScalingStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineViewportWScalingStateCreateInfoNV32 *in_ext = (const VkPipelineViewportWScalingStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->viewportWScalingEnable = in_ext->viewportWScalingEnable; - out_ext->viewportCount = in_ext->viewportCount; - out_ext->pViewportWScalings = UlongToPtr(in_ext->pViewportWScalings); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV: - { - VkPipelineViewportSwizzleStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineViewportSwizzleStateCreateInfoNV32 *in_ext = (const VkPipelineViewportSwizzleStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->viewportCount = in_ext->viewportCount; - out_ext->pViewportSwizzles = UlongToPtr(in_ext->pViewportSwizzles); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV: - { - VkPipelineViewportExclusiveScissorStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineViewportExclusiveScissorStateCreateInfoNV32 *in_ext = (const VkPipelineViewportExclusiveScissorStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->exclusiveScissorCount = in_ext->exclusiveScissorCount; - out_ext->pExclusiveScissors = UlongToPtr(in_ext->pExclusiveScissors); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV: - { - VkPipelineViewportShadingRateImageStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineViewportShadingRateImageStateCreateInfoNV32 *in_ext = (const VkPipelineViewportShadingRateImageStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->shadingRateImageEnable = in_ext->shadingRateImageEnable; - out_ext->viewportCount = in_ext->viewportCount; - out_ext->pShadingRatePalettes = convert_VkShadingRatePaletteNV_array_win32_to_host(ctx, (const VkShadingRatePaletteNV32 *)UlongToPtr(in_ext->pShadingRatePalettes), in_ext->viewportCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV: - { - VkPipelineViewportCoarseSampleOrderStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineViewportCoarseSampleOrderStateCreateInfoNV32 *in_ext = (const VkPipelineViewportCoarseSampleOrderStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->sampleOrderType = in_ext->sampleOrderType; - out_ext->customSampleOrderCount = in_ext->customSampleOrderCount; - out_ext->pCustomSampleOrders = convert_VkCoarseSampleOrderCustomNV_array_win32_to_host(ctx, (const VkCoarseSampleOrderCustomNV32 *)UlongToPtr(in_ext->pCustomSampleOrders), in_ext->customSampleOrderCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT: - { - VkPipelineViewportDepthClipControlCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineViewportDepthClipControlCreateInfoEXT32 *in_ext = (const VkPipelineViewportDepthClipControlCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->negativeOneToOne = in_ext->negativeOneToOne; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLAMP_CONTROL_CREATE_INFO_EXT: - { - VkPipelineViewportDepthClampControlCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineViewportDepthClampControlCreateInfoEXT32 *in_ext = (const VkPipelineViewportDepthClampControlCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLAMP_CONTROL_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->depthClampMode = in_ext->depthClampMode; - out_ext->pDepthClampRange = UlongToPtr(in_ext->pDepthClampRange); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkPipelineViewportStateCreateInfo *convert_VkPipelineViewportStateCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineViewportStateCreateInfo32 *in, uint32_t count) -{ - VkPipelineViewportStateCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineViewportStateCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineRasterizationStateCreateInfo_win32_to_host(struct conversion_context *ctx, const VkPipelineRasterizationStateCreateInfo32 *in, VkPipelineRasterizationStateCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->depthClampEnable = in->depthClampEnable; - out->rasterizerDiscardEnable = in->rasterizerDiscardEnable; - out->polygonMode = in->polygonMode; - out->cullMode = in->cullMode; - out->frontFace = in->frontFace; - out->depthBiasEnable = in->depthBiasEnable; - out->depthBiasConstantFactor = in->depthBiasConstantFactor; - out->depthBiasClamp = in->depthBiasClamp; - out->depthBiasSlopeFactor = in->depthBiasSlopeFactor; - out->lineWidth = in->lineWidth; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD: - { - VkPipelineRasterizationStateRasterizationOrderAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRasterizationStateRasterizationOrderAMD32 *in_ext = (const VkPipelineRasterizationStateRasterizationOrderAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD; - out_ext->pNext = NULL; - out_ext->rasterizationOrder = in_ext->rasterizationOrder; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT: - { - VkPipelineRasterizationConservativeStateCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRasterizationConservativeStateCreateInfoEXT32 *in_ext = (const VkPipelineRasterizationConservativeStateCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->conservativeRasterizationMode = in_ext->conservativeRasterizationMode; - out_ext->extraPrimitiveOverestimationSize = in_ext->extraPrimitiveOverestimationSize; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT: - { - VkPipelineRasterizationStateStreamCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRasterizationStateStreamCreateInfoEXT32 *in_ext = (const VkPipelineRasterizationStateStreamCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->rasterizationStream = in_ext->rasterizationStream; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: - { - VkPipelineRasterizationDepthClipStateCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRasterizationDepthClipStateCreateInfoEXT32 *in_ext = (const VkPipelineRasterizationDepthClipStateCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->depthClipEnable = in_ext->depthClipEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO: - { - VkPipelineRasterizationLineStateCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRasterizationLineStateCreateInfo32 *in_ext = (const VkPipelineRasterizationLineStateCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->lineRasterizationMode = in_ext->lineRasterizationMode; - out_ext->stippledLineEnable = in_ext->stippledLineEnable; - out_ext->lineStippleFactor = in_ext->lineStippleFactor; - out_ext->lineStipplePattern = in_ext->lineStipplePattern; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT: - { - VkPipelineRasterizationProvokingVertexStateCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT32 *in_ext = (const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->provokingVertexMode = in_ext->provokingVertexMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT: - { - VkDepthBiasRepresentationInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDepthBiasRepresentationInfoEXT32 *in_ext = (const VkDepthBiasRepresentationInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT; - out_ext->pNext = NULL; - out_ext->depthBiasRepresentation = in_ext->depthBiasRepresentation; - out_ext->depthBiasExact = in_ext->depthBiasExact; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkPipelineRasterizationStateCreateInfo *convert_VkPipelineRasterizationStateCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineRasterizationStateCreateInfo32 *in, uint32_t count) -{ - VkPipelineRasterizationStateCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineRasterizationStateCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineMultisampleStateCreateInfo_win32_to_host(struct conversion_context *ctx, const VkPipelineMultisampleStateCreateInfo32 *in, VkPipelineMultisampleStateCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->rasterizationSamples = in->rasterizationSamples; - out->sampleShadingEnable = in->sampleShadingEnable; - out->minSampleShading = in->minSampleShading; - out->pSampleMask = UlongToPtr(in->pSampleMask); - out->alphaToCoverageEnable = in->alphaToCoverageEnable; - out->alphaToOneEnable = in->alphaToOneEnable; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV: - { - VkPipelineCoverageToColorStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCoverageToColorStateCreateInfoNV32 *in_ext = (const VkPipelineCoverageToColorStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->coverageToColorEnable = in_ext->coverageToColorEnable; - out_ext->coverageToColorLocation = in_ext->coverageToColorLocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT: - { - VkPipelineSampleLocationsStateCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineSampleLocationsStateCreateInfoEXT32 *in_ext = (const VkPipelineSampleLocationsStateCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->sampleLocationsEnable = in_ext->sampleLocationsEnable; - convert_VkSampleLocationsInfoEXT_win32_to_host(&in_ext->sampleLocationsInfo, &out_ext->sampleLocationsInfo); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV: - { - VkPipelineCoverageModulationStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCoverageModulationStateCreateInfoNV32 *in_ext = (const VkPipelineCoverageModulationStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->coverageModulationMode = in_ext->coverageModulationMode; - out_ext->coverageModulationTableEnable = in_ext->coverageModulationTableEnable; - out_ext->coverageModulationTableCount = in_ext->coverageModulationTableCount; - out_ext->pCoverageModulationTable = UlongToPtr(in_ext->pCoverageModulationTable); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV: - { - VkPipelineCoverageReductionStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCoverageReductionStateCreateInfoNV32 *in_ext = (const VkPipelineCoverageReductionStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->coverageReductionMode = in_ext->coverageReductionMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkPipelineMultisampleStateCreateInfo *convert_VkPipelineMultisampleStateCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineMultisampleStateCreateInfo32 *in, uint32_t count) -{ - VkPipelineMultisampleStateCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineMultisampleStateCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineDepthStencilStateCreateInfo_win32_to_host(const VkPipelineDepthStencilStateCreateInfo32 *in, VkPipelineDepthStencilStateCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->depthTestEnable = in->depthTestEnable; - out->depthWriteEnable = in->depthWriteEnable; - out->depthCompareOp = in->depthCompareOp; - out->depthBoundsTestEnable = in->depthBoundsTestEnable; - out->stencilTestEnable = in->stencilTestEnable; - out->front = in->front; - out->back = in->back; - out->minDepthBounds = in->minDepthBounds; - out->maxDepthBounds = in->maxDepthBounds; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkPipelineDepthStencilStateCreateInfo *convert_VkPipelineDepthStencilStateCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineDepthStencilStateCreateInfo32 *in, uint32_t count) -{ - VkPipelineDepthStencilStateCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineDepthStencilStateCreateInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineColorBlendStateCreateInfo_win32_to_host(struct conversion_context *ctx, const VkPipelineColorBlendStateCreateInfo32 *in, VkPipelineColorBlendStateCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->logicOpEnable = in->logicOpEnable; - out->logicOp = in->logicOp; - out->attachmentCount = in->attachmentCount; - out->pAttachments = UlongToPtr(in->pAttachments); - memcpy(out->blendConstants, in->blendConstants, 4 * sizeof(float)); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: - { - VkPipelineColorBlendAdvancedStateCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineColorBlendAdvancedStateCreateInfoEXT32 *in_ext = (const VkPipelineColorBlendAdvancedStateCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->srcPremultiplied = in_ext->srcPremultiplied; - out_ext->dstPremultiplied = in_ext->dstPremultiplied; - out_ext->blendOverlap = in_ext->blendOverlap; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT: - { - VkPipelineColorWriteCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineColorWriteCreateInfoEXT32 *in_ext = (const VkPipelineColorWriteCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->attachmentCount = in_ext->attachmentCount; - out_ext->pColorWriteEnables = UlongToPtr(in_ext->pColorWriteEnables); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkPipelineColorBlendStateCreateInfo *convert_VkPipelineColorBlendStateCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineColorBlendStateCreateInfo32 *in, uint32_t count) -{ - VkPipelineColorBlendStateCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineColorBlendStateCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineDynamicStateCreateInfo_win32_to_host(const VkPipelineDynamicStateCreateInfo32 *in, VkPipelineDynamicStateCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->dynamicStateCount = in->dynamicStateCount; - out->pDynamicStates = UlongToPtr(in->pDynamicStates); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkPipelineDynamicStateCreateInfo *convert_VkPipelineDynamicStateCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkPipelineDynamicStateCreateInfo32 *in, uint32_t count) -{ - VkPipelineDynamicStateCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineDynamicStateCreateInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkGraphicsPipelineCreateInfo_win64_to_host(struct conversion_context *ctx, const VkGraphicsPipelineCreateInfo *in, VkGraphicsPipelineCreateInfo *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->stageCount = in->stageCount; - out->pStages = convert_VkPipelineShaderStageCreateInfo_array_win64_to_host(ctx, in->pStages, in->stageCount); - out->pVertexInputState = in->pVertexInputState; - out->pInputAssemblyState = in->pInputAssemblyState; - out->pTessellationState = in->pTessellationState; - out->pViewportState = in->pViewportState; - out->pRasterizationState = in->pRasterizationState; - out->pMultisampleState = in->pMultisampleState; - out->pDepthStencilState = in->pDepthStencilState; - out->pColorBlendState = in->pColorBlendState; - out->pDynamicState = in->pDynamicState; - out->layout = in->layout; - out->renderPass = in->renderPass; - out->subpass = in->subpass; - out->basePipelineHandle = in->basePipelineHandle; - out->basePipelineIndex = in->basePipelineIndex; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO: - { - VkPipelineCreateFlags2CreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreateFlags2CreateInfo *in_ext = (const VkPipelineCreateFlags2CreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR: - { - VkPipelineBinaryInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineBinaryInfoKHR *in_ext = (const VkPipelineBinaryInfoKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR; - out_ext->pNext = NULL; - out_ext->binaryCount = in_ext->binaryCount; - out_ext->pPipelineBinaries = in_ext->pPipelineBinaries; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV: - { - VkGraphicsPipelineShaderGroupsCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkGraphicsPipelineShaderGroupsCreateInfoNV *in_ext = (const VkGraphicsPipelineShaderGroupsCreateInfoNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->groupCount = in_ext->groupCount; - out_ext->pGroups = convert_VkGraphicsShaderGroupCreateInfoNV_array_win64_to_host(ctx, in_ext->pGroups, in_ext->groupCount); - out_ext->pipelineCount = in_ext->pipelineCount; - out_ext->pPipelines = in_ext->pPipelines; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: - { - VkPipelineDiscardRectangleStateCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineDiscardRectangleStateCreateInfoEXT *in_ext = (const VkPipelineDiscardRectangleStateCreateInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->discardRectangleMode = in_ext->discardRectangleMode; - out_ext->discardRectangleCount = in_ext->discardRectangleCount; - out_ext->pDiscardRectangles = in_ext->pDiscardRectangles; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: - { - VkPipelineRepresentativeFragmentTestStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRepresentativeFragmentTestStateCreateInfoNV *in_ext = (const VkPipelineRepresentativeFragmentTestStateCreateInfoNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->representativeFragmentTestEnable = in_ext->representativeFragmentTestEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: - { - VkPipelineCreationFeedbackCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreationFeedbackCreateInfo *in_ext = (const VkPipelineCreationFeedbackCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->pPipelineCreationFeedback = in_ext->pPipelineCreationFeedback; - out_ext->pipelineStageCreationFeedbackCount = in_ext->pipelineStageCreationFeedbackCount; - out_ext->pPipelineStageCreationFeedbacks = in_ext->pPipelineStageCreationFeedbacks; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: - { - VkPipelineCompilerControlCreateInfoAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCompilerControlCreateInfoAMD *in_ext = (const VkPipelineCompilerControlCreateInfoAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD; - out_ext->pNext = NULL; - out_ext->compilerControlFlags = in_ext->compilerControlFlags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR: - { - VkPipelineLibraryCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineLibraryCreateInfoKHR *in_ext = (const VkPipelineLibraryCreateInfoKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->libraryCount = in_ext->libraryCount; - out_ext->pLibraries = in_ext->pLibraries; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR: - { - VkPipelineFragmentShadingRateStateCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineFragmentShadingRateStateCreateInfoKHR *in_ext = (const VkPipelineFragmentShadingRateStateCreateInfoKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->fragmentSize = in_ext->fragmentSize; - memcpy(out_ext->combinerOps, in_ext->combinerOps, 2 * sizeof(VkFragmentShadingRateCombinerOpKHR)); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV: - { - VkPipelineFragmentShadingRateEnumStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineFragmentShadingRateEnumStateCreateInfoNV *in_ext = (const VkPipelineFragmentShadingRateEnumStateCreateInfoNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->shadingRateType = in_ext->shadingRateType; - out_ext->shadingRate = in_ext->shadingRate; - memcpy(out_ext->combinerOps, in_ext->combinerOps, 2 * sizeof(VkFragmentShadingRateCombinerOpKHR)); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO: - { - VkPipelineRenderingCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRenderingCreateInfo *in_ext = (const VkPipelineRenderingCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->viewMask = in_ext->viewMask; - out_ext->colorAttachmentCount = in_ext->colorAttachmentCount; - out_ext->pColorAttachmentFormats = in_ext->pColorAttachmentFormats; - out_ext->depthAttachmentFormat = in_ext->depthAttachmentFormat; - out_ext->stencilAttachmentFormat = in_ext->stencilAttachmentFormat; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD: - { - VkAttachmentSampleCountInfoAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkAttachmentSampleCountInfoAMD *in_ext = (const VkAttachmentSampleCountInfoAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD; - out_ext->pNext = NULL; - out_ext->colorAttachmentCount = in_ext->colorAttachmentCount; - out_ext->pColorAttachmentSamples = in_ext->pColorAttachmentSamples; - out_ext->depthStencilAttachmentSamples = in_ext->depthStencilAttachmentSamples; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT: - { - VkGraphicsPipelineLibraryCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkGraphicsPipelineLibraryCreateInfoEXT *in_ext = (const VkGraphicsPipelineLibraryCreateInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO: - { - VkPipelineRobustnessCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRobustnessCreateInfo *in_ext = (const VkPipelineRobustnessCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->storageBuffers = in_ext->storageBuffers; - out_ext->uniformBuffers = in_ext->uniformBuffers; - out_ext->vertexInputs = in_ext->vertexInputs; - out_ext->images = in_ext->images; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO: - { - VkRenderingAttachmentLocationInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderingAttachmentLocationInfo *in_ext = (const VkRenderingAttachmentLocationInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO; - out_ext->pNext = NULL; - out_ext->colorAttachmentCount = in_ext->colorAttachmentCount; - out_ext->pColorAttachmentLocations = in_ext->pColorAttachmentLocations; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO: - { - VkRenderingInputAttachmentIndexInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderingInputAttachmentIndexInfo *in_ext = (const VkRenderingInputAttachmentIndexInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO; - out_ext->pNext = NULL; - out_ext->colorAttachmentCount = in_ext->colorAttachmentCount; - out_ext->pColorAttachmentInputIndices = in_ext->pColorAttachmentInputIndices; - out_ext->pDepthInputAttachmentIndex = in_ext->pDepthInputAttachmentIndex; - out_ext->pStencilInputAttachmentIndex = in_ext->pStencilInputAttachmentIndex; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} -#endif /* _WIN64 */ - -static inline void convert_VkGraphicsPipelineCreateInfo_win32_to_host(struct conversion_context *ctx, const VkGraphicsPipelineCreateInfo32 *in, VkGraphicsPipelineCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->stageCount = in->stageCount; - out->pStages = convert_VkPipelineShaderStageCreateInfo_array_win32_to_host(ctx, (const VkPipelineShaderStageCreateInfo32 *)UlongToPtr(in->pStages), in->stageCount); - out->pVertexInputState = convert_VkPipelineVertexInputStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineVertexInputStateCreateInfo32 *)UlongToPtr(in->pVertexInputState), 1); - out->pInputAssemblyState = convert_VkPipelineInputAssemblyStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineInputAssemblyStateCreateInfo32 *)UlongToPtr(in->pInputAssemblyState), 1); - out->pTessellationState = convert_VkPipelineTessellationStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineTessellationStateCreateInfo32 *)UlongToPtr(in->pTessellationState), 1); - out->pViewportState = convert_VkPipelineViewportStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineViewportStateCreateInfo32 *)UlongToPtr(in->pViewportState), 1); - out->pRasterizationState = convert_VkPipelineRasterizationStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineRasterizationStateCreateInfo32 *)UlongToPtr(in->pRasterizationState), 1); - out->pMultisampleState = convert_VkPipelineMultisampleStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineMultisampleStateCreateInfo32 *)UlongToPtr(in->pMultisampleState), 1); - out->pDepthStencilState = convert_VkPipelineDepthStencilStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineDepthStencilStateCreateInfo32 *)UlongToPtr(in->pDepthStencilState), 1); - out->pColorBlendState = convert_VkPipelineColorBlendStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineColorBlendStateCreateInfo32 *)UlongToPtr(in->pColorBlendState), 1); - out->pDynamicState = convert_VkPipelineDynamicStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineDynamicStateCreateInfo32 *)UlongToPtr(in->pDynamicState), 1); - out->layout = in->layout; - out->renderPass = in->renderPass; - out->subpass = in->subpass; - out->basePipelineHandle = in->basePipelineHandle; - out->basePipelineIndex = in->basePipelineIndex; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO: - { - VkPipelineCreateFlags2CreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreateFlags2CreateInfo32 *in_ext = (const VkPipelineCreateFlags2CreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR: - { - VkPipelineBinaryInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineBinaryInfoKHR32 *in_ext = (const VkPipelineBinaryInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR; - out_ext->pNext = NULL; - out_ext->binaryCount = in_ext->binaryCount; - out_ext->pPipelineBinaries = UlongToPtr(in_ext->pPipelineBinaries); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV: - { - VkGraphicsPipelineShaderGroupsCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkGraphicsPipelineShaderGroupsCreateInfoNV32 *in_ext = (const VkGraphicsPipelineShaderGroupsCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->groupCount = in_ext->groupCount; - out_ext->pGroups = convert_VkGraphicsShaderGroupCreateInfoNV_array_win32_to_host(ctx, (const VkGraphicsShaderGroupCreateInfoNV32 *)UlongToPtr(in_ext->pGroups), in_ext->groupCount); - out_ext->pipelineCount = in_ext->pipelineCount; - out_ext->pPipelines = UlongToPtr(in_ext->pPipelines); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: - { - VkPipelineDiscardRectangleStateCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineDiscardRectangleStateCreateInfoEXT32 *in_ext = (const VkPipelineDiscardRectangleStateCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->discardRectangleMode = in_ext->discardRectangleMode; - out_ext->discardRectangleCount = in_ext->discardRectangleCount; - out_ext->pDiscardRectangles = UlongToPtr(in_ext->pDiscardRectangles); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: - { - VkPipelineRepresentativeFragmentTestStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRepresentativeFragmentTestStateCreateInfoNV32 *in_ext = (const VkPipelineRepresentativeFragmentTestStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->representativeFragmentTestEnable = in_ext->representativeFragmentTestEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: - { - VkPipelineCreationFeedbackCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreationFeedbackCreateInfo32 *in_ext = (const VkPipelineCreationFeedbackCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->pPipelineCreationFeedback = convert_VkPipelineCreationFeedback_array_win32_to_host(ctx, (VkPipelineCreationFeedback32 *)UlongToPtr(in_ext->pPipelineCreationFeedback), 1); - out_ext->pipelineStageCreationFeedbackCount = in_ext->pipelineStageCreationFeedbackCount; - out_ext->pPipelineStageCreationFeedbacks = convert_VkPipelineCreationFeedback_array_win32_to_host(ctx, (VkPipelineCreationFeedback32 *)UlongToPtr(in_ext->pPipelineStageCreationFeedbacks), in_ext->pipelineStageCreationFeedbackCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: - { - VkPipelineCompilerControlCreateInfoAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCompilerControlCreateInfoAMD32 *in_ext = (const VkPipelineCompilerControlCreateInfoAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD; - out_ext->pNext = NULL; - out_ext->compilerControlFlags = in_ext->compilerControlFlags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR: - { - VkPipelineLibraryCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineLibraryCreateInfoKHR32 *in_ext = (const VkPipelineLibraryCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->libraryCount = in_ext->libraryCount; - out_ext->pLibraries = UlongToPtr(in_ext->pLibraries); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR: - { - VkPipelineFragmentShadingRateStateCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineFragmentShadingRateStateCreateInfoKHR32 *in_ext = (const VkPipelineFragmentShadingRateStateCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->fragmentSize = in_ext->fragmentSize; - memcpy(out_ext->combinerOps, in_ext->combinerOps, 2 * sizeof(VkFragmentShadingRateCombinerOpKHR)); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV: - { - VkPipelineFragmentShadingRateEnumStateCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineFragmentShadingRateEnumStateCreateInfoNV32 *in_ext = (const VkPipelineFragmentShadingRateEnumStateCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->shadingRateType = in_ext->shadingRateType; - out_ext->shadingRate = in_ext->shadingRate; - memcpy(out_ext->combinerOps, in_ext->combinerOps, 2 * sizeof(VkFragmentShadingRateCombinerOpKHR)); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO: - { - VkPipelineRenderingCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRenderingCreateInfo32 *in_ext = (const VkPipelineRenderingCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->viewMask = in_ext->viewMask; - out_ext->colorAttachmentCount = in_ext->colorAttachmentCount; - out_ext->pColorAttachmentFormats = UlongToPtr(in_ext->pColorAttachmentFormats); - out_ext->depthAttachmentFormat = in_ext->depthAttachmentFormat; - out_ext->stencilAttachmentFormat = in_ext->stencilAttachmentFormat; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD: - { - VkAttachmentSampleCountInfoAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkAttachmentSampleCountInfoAMD32 *in_ext = (const VkAttachmentSampleCountInfoAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD; - out_ext->pNext = NULL; - out_ext->colorAttachmentCount = in_ext->colorAttachmentCount; - out_ext->pColorAttachmentSamples = UlongToPtr(in_ext->pColorAttachmentSamples); - out_ext->depthStencilAttachmentSamples = in_ext->depthStencilAttachmentSamples; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT: - { - VkGraphicsPipelineLibraryCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkGraphicsPipelineLibraryCreateInfoEXT32 *in_ext = (const VkGraphicsPipelineLibraryCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO: - { - VkPipelineRobustnessCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRobustnessCreateInfo32 *in_ext = (const VkPipelineRobustnessCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->storageBuffers = in_ext->storageBuffers; - out_ext->uniformBuffers = in_ext->uniformBuffers; - out_ext->vertexInputs = in_ext->vertexInputs; - out_ext->images = in_ext->images; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO: - { - VkRenderingAttachmentLocationInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderingAttachmentLocationInfo32 *in_ext = (const VkRenderingAttachmentLocationInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO; - out_ext->pNext = NULL; - out_ext->colorAttachmentCount = in_ext->colorAttachmentCount; - out_ext->pColorAttachmentLocations = UlongToPtr(in_ext->pColorAttachmentLocations); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO: - { - VkRenderingInputAttachmentIndexInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderingInputAttachmentIndexInfo32 *in_ext = (const VkRenderingInputAttachmentIndexInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO; - out_ext->pNext = NULL; - out_ext->colorAttachmentCount = in_ext->colorAttachmentCount; - out_ext->pColorAttachmentInputIndices = UlongToPtr(in_ext->pColorAttachmentInputIndices); - out_ext->pDepthInputAttachmentIndex = UlongToPtr(in_ext->pDepthInputAttachmentIndex); - out_ext->pStencilInputAttachmentIndex = UlongToPtr(in_ext->pStencilInputAttachmentIndex); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkGraphicsPipelineCreateInfo_host_to_win32(const VkGraphicsPipelineCreateInfo *in, const VkGraphicsPipelineCreateInfo32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: - { - VkPipelineCreationFeedbackCreateInfo32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO); - const VkPipelineCreationFeedbackCreateInfo *in_ext = (const VkPipelineCreationFeedbackCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO; - convert_VkPipelineCreationFeedback_array_host_to_win32(in_ext->pPipelineCreationFeedback, (VkPipelineCreationFeedback32 *)UlongToPtr(out_ext->pPipelineCreationFeedback), 1); - convert_VkPipelineCreationFeedback_array_host_to_win32(in_ext->pPipelineStageCreationFeedbacks, (VkPipelineCreationFeedback32 *)UlongToPtr(out_ext->pPipelineStageCreationFeedbacks), in_ext->pipelineStageCreationFeedbackCount); - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -#ifdef _WIN64 -static inline const VkGraphicsPipelineCreateInfo *convert_VkGraphicsPipelineCreateInfo_array_win64_to_host(struct conversion_context *ctx, const VkGraphicsPipelineCreateInfo *in, uint32_t count) -{ - VkGraphicsPipelineCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkGraphicsPipelineCreateInfo_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkGraphicsPipelineCreateInfo *convert_VkGraphicsPipelineCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkGraphicsPipelineCreateInfo32 *in, uint32_t count) -{ - VkGraphicsPipelineCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkGraphicsPipelineCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkGraphicsPipelineCreateInfo_array_host_to_win32(const VkGraphicsPipelineCreateInfo *in, const VkGraphicsPipelineCreateInfo32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkGraphicsPipelineCreateInfo_host_to_win32(&in[i], &out[i]); - } -} - -#ifdef _WIN64 -static inline void convert_VkImageCreateInfo_win64_to_host(struct conversion_context *ctx, const VkImageCreateInfo *in, VkImageCreateInfo *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->imageType = in->imageType; - out->format = in->format; - out->extent = in->extent; - out->mipLevels = in->mipLevels; - out->arrayLayers = in->arrayLayers; - out->samples = in->samples; - out->tiling = in->tiling; - out->usage = in->usage; - out->sharingMode = in->sharingMode; - out->queueFamilyIndexCount = in->queueFamilyIndexCount; - out->pQueueFamilyIndices = in->pQueueFamilyIndices; - out->initialLayout = in->initialLayout; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV: - { - VkDedicatedAllocationImageCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDedicatedAllocationImageCreateInfoNV *in_ext = (const VkDedicatedAllocationImageCreateInfoNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->dedicatedAllocation = in_ext->dedicatedAllocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: - { - VkExternalMemoryImageCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExternalMemoryImageCreateInfo *in_ext = (const VkExternalMemoryImageCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->handleTypes = in_ext->handleTypes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR: - { - VkImageSwapchainCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageSwapchainCreateInfoKHR *in_ext = (const VkImageSwapchainCreateInfoKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->swapchain = in_ext->swapchain ? vulkan_swapchain_from_handle(in_ext->swapchain)->host.swapchain : 0; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: - { - VkImageFormatListCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageFormatListCreateInfo *in_ext = (const VkImageFormatListCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->viewFormatCount = in_ext->viewFormatCount; - out_ext->pViewFormats = in_ext->pViewFormats; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: - { - VkImageStencilUsageCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageStencilUsageCreateInfo *in_ext = (const VkImageStencilUsageCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->stencilUsage = in_ext->stencilUsage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR: - { - VkVideoProfileListInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoProfileListInfoKHR *in_ext = (const VkVideoProfileListInfoKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR; - out_ext->pNext = NULL; - out_ext->profileCount = in_ext->profileCount; - out_ext->pProfiles = in_ext->pProfiles; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT: - { - VkOpaqueCaptureDescriptorDataCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpaqueCaptureDescriptorDataCreateInfoEXT *in_ext = (const VkOpaqueCaptureDescriptorDataCreateInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->opaqueCaptureDescriptorData = in_ext->opaqueCaptureDescriptorData; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT: - { - VkImageCompressionControlEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageCompressionControlEXT *in_ext = (const VkImageCompressionControlEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->compressionControlPlaneCount = in_ext->compressionControlPlaneCount; - out_ext->pFixedRateFlags = in_ext->pFixedRateFlags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV: - { - VkOpticalFlowImageFormatInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpticalFlowImageFormatInfoNV *in_ext = (const VkOpticalFlowImageFormatInfoNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV; - out_ext->pNext = NULL; - out_ext->usage = in_ext->usage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_ALIGNMENT_CONTROL_CREATE_INFO_MESA: - { - VkImageAlignmentControlCreateInfoMESA *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageAlignmentControlCreateInfoMESA *in_ext = (const VkImageAlignmentControlCreateInfoMESA *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_ALIGNMENT_CONTROL_CREATE_INFO_MESA; - out_ext->pNext = NULL; - out_ext->maximumRequestedAlignment = in_ext->maximumRequestedAlignment; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} -#endif /* _WIN64 */ - -static inline void convert_VkImageCreateInfo_win32_to_host(struct conversion_context *ctx, const VkImageCreateInfo32 *in, VkImageCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->imageType = in->imageType; - out->format = in->format; - out->extent = in->extent; - out->mipLevels = in->mipLevels; - out->arrayLayers = in->arrayLayers; - out->samples = in->samples; - out->tiling = in->tiling; - out->usage = in->usage; - out->sharingMode = in->sharingMode; - out->queueFamilyIndexCount = in->queueFamilyIndexCount; - out->pQueueFamilyIndices = UlongToPtr(in->pQueueFamilyIndices); - out->initialLayout = in->initialLayout; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV: - { - VkDedicatedAllocationImageCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDedicatedAllocationImageCreateInfoNV32 *in_ext = (const VkDedicatedAllocationImageCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->dedicatedAllocation = in_ext->dedicatedAllocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: - { - VkExternalMemoryImageCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExternalMemoryImageCreateInfo32 *in_ext = (const VkExternalMemoryImageCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->handleTypes = in_ext->handleTypes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR: - { - VkImageSwapchainCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageSwapchainCreateInfoKHR32 *in_ext = (const VkImageSwapchainCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->swapchain = in_ext->swapchain ? vulkan_swapchain_from_handle(in_ext->swapchain)->host.swapchain : 0; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: - { - VkImageFormatListCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageFormatListCreateInfo32 *in_ext = (const VkImageFormatListCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->viewFormatCount = in_ext->viewFormatCount; - out_ext->pViewFormats = UlongToPtr(in_ext->pViewFormats); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: - { - VkImageStencilUsageCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageStencilUsageCreateInfo32 *in_ext = (const VkImageStencilUsageCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->stencilUsage = in_ext->stencilUsage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR: - { - VkVideoProfileListInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoProfileListInfoKHR32 *in_ext = (const VkVideoProfileListInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR; - out_ext->pNext = NULL; - out_ext->profileCount = in_ext->profileCount; - out_ext->pProfiles = convert_VkVideoProfileInfoKHR_array_win32_to_host(ctx, (const VkVideoProfileInfoKHR32 *)UlongToPtr(in_ext->pProfiles), in_ext->profileCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT: - { - VkOpaqueCaptureDescriptorDataCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *in_ext = (const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->opaqueCaptureDescriptorData = UlongToPtr(in_ext->opaqueCaptureDescriptorData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT: - { - VkImageCompressionControlEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageCompressionControlEXT32 *in_ext = (const VkImageCompressionControlEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->compressionControlPlaneCount = in_ext->compressionControlPlaneCount; - out_ext->pFixedRateFlags = UlongToPtr(in_ext->pFixedRateFlags); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV: - { - VkOpticalFlowImageFormatInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpticalFlowImageFormatInfoNV32 *in_ext = (const VkOpticalFlowImageFormatInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV; - out_ext->pNext = NULL; - out_ext->usage = in_ext->usage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_ALIGNMENT_CONTROL_CREATE_INFO_MESA: - { - VkImageAlignmentControlCreateInfoMESA *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageAlignmentControlCreateInfoMESA32 *in_ext = (const VkImageAlignmentControlCreateInfoMESA32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_ALIGNMENT_CONTROL_CREATE_INFO_MESA; - out_ext->pNext = NULL; - out_ext->maximumRequestedAlignment = in_ext->maximumRequestedAlignment; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkImageViewCreateInfo_win32_to_host(struct conversion_context *ctx, const VkImageViewCreateInfo32 *in, VkImageViewCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->image = in->image; - out->viewType = in->viewType; - out->format = in->format; - out->components = in->components; - out->subresourceRange = in->subresourceRange; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: - { - VkImageViewUsageCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageViewUsageCreateInfo32 *in_ext = (const VkImageViewUsageCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->usage = in_ext->usage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_VIEW_SLICED_CREATE_INFO_EXT: - { - VkImageViewSlicedCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageViewSlicedCreateInfoEXT32 *in_ext = (const VkImageViewSlicedCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_SLICED_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->sliceOffset = in_ext->sliceOffset; - out_ext->sliceCount = in_ext->sliceCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: - { - VkSamplerYcbcrConversionInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSamplerYcbcrConversionInfo32 *in_ext = (const VkSamplerYcbcrConversionInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO; - out_ext->pNext = NULL; - out_ext->conversion = in_ext->conversion; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT: - { - VkImageViewASTCDecodeModeEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageViewASTCDecodeModeEXT32 *in_ext = (const VkImageViewASTCDecodeModeEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT; - out_ext->pNext = NULL; - out_ext->decodeMode = in_ext->decodeMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT: - { - VkOpaqueCaptureDescriptorDataCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *in_ext = (const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->opaqueCaptureDescriptorData = UlongToPtr(in_ext->opaqueCaptureDescriptorData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT: - { - VkImageViewMinLodCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageViewMinLodCreateInfoEXT32 *in_ext = (const VkImageViewMinLodCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->minLod = in_ext->minLod; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_VIEW_SAMPLE_WEIGHT_CREATE_INFO_QCOM: - { - VkImageViewSampleWeightCreateInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageViewSampleWeightCreateInfoQCOM32 *in_ext = (const VkImageViewSampleWeightCreateInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_SAMPLE_WEIGHT_CREATE_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->filterCenter = in_ext->filterCenter; - out_ext->filterSize = in_ext->filterSize; - out_ext->numPhases = in_ext->numPhases; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkIndirectCommandsTokenDataEXT_win32_to_host(const VkIndirectCommandsTokenDataEXT32 *in, VkIndirectCommandsTokenDataEXT *out, VkFlags selector) -{ - if (!in) return; - - if (selector == VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_EXT || selector == VK_INDIRECT_COMMANDS_TOKEN_TYPE_SEQUENCE_INDEX_EXT) - out->pPushConstant = UlongToPtr(in->pPushConstant); - if (selector == VK_INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_EXT) - out->pVertexBuffer = UlongToPtr(in->pVertexBuffer); - if (selector == VK_INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_EXT) - out->pIndexBuffer = UlongToPtr(in->pIndexBuffer); - if (selector == VK_INDIRECT_COMMANDS_TOKEN_TYPE_EXECUTION_SET_EXT) - out->pExecutionSet = UlongToPtr(in->pExecutionSet); -} - -static inline void convert_VkIndirectCommandsLayoutTokenEXT_win32_to_host(const VkIndirectCommandsLayoutTokenEXT32 *in, VkIndirectCommandsLayoutTokenEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - convert_VkIndirectCommandsTokenDataEXT_win32_to_host(&in->data, &out->data, in->type); - out->offset = in->offset; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkIndirectCommandsLayoutTokenEXT *convert_VkIndirectCommandsLayoutTokenEXT_array_win32_to_host(struct conversion_context *ctx, const VkIndirectCommandsLayoutTokenEXT32 *in, uint32_t count) -{ - VkIndirectCommandsLayoutTokenEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkIndirectCommandsLayoutTokenEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkIndirectCommandsLayoutCreateInfoEXT_win32_to_host(struct conversion_context *ctx, const VkIndirectCommandsLayoutCreateInfoEXT32 *in, VkIndirectCommandsLayoutCreateInfoEXT *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->shaderStages = in->shaderStages; - out->indirectStride = in->indirectStride; - out->pipelineLayout = in->pipelineLayout; - out->tokenCount = in->tokenCount; - out->pTokens = convert_VkIndirectCommandsLayoutTokenEXT_array_win32_to_host(ctx, (const VkIndirectCommandsLayoutTokenEXT32 *)UlongToPtr(in->pTokens), in->tokenCount); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO: - { - VkPipelineLayoutCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineLayoutCreateInfo32 *in_ext = (const VkPipelineLayoutCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->setLayoutCount = in_ext->setLayoutCount; - out_ext->pSetLayouts = UlongToPtr(in_ext->pSetLayouts); - out_ext->pushConstantRangeCount = in_ext->pushConstantRangeCount; - out_ext->pPushConstantRanges = UlongToPtr(in_ext->pPushConstantRanges); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkIndirectCommandsLayoutTokenNV_win32_to_host(const VkIndirectCommandsLayoutTokenNV32 *in, VkIndirectCommandsLayoutTokenNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->tokenType = in->tokenType; - out->stream = in->stream; - out->offset = in->offset; - out->vertexBindingUnit = in->vertexBindingUnit; - out->vertexDynamicStride = in->vertexDynamicStride; - out->pushconstantPipelineLayout = in->pushconstantPipelineLayout; - out->pushconstantShaderStageFlags = in->pushconstantShaderStageFlags; - out->pushconstantOffset = in->pushconstantOffset; - out->pushconstantSize = in->pushconstantSize; - out->indirectStateFlags = in->indirectStateFlags; - out->indexTypeCount = in->indexTypeCount; - out->pIndexTypes = UlongToPtr(in->pIndexTypes); - out->pIndexTypeValues = UlongToPtr(in->pIndexTypeValues); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkIndirectCommandsLayoutTokenNV *convert_VkIndirectCommandsLayoutTokenNV_array_win32_to_host(struct conversion_context *ctx, const VkIndirectCommandsLayoutTokenNV32 *in, uint32_t count) -{ - VkIndirectCommandsLayoutTokenNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkIndirectCommandsLayoutTokenNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkIndirectCommandsLayoutCreateInfoNV_win32_to_host(struct conversion_context *ctx, const VkIndirectCommandsLayoutCreateInfoNV32 *in, VkIndirectCommandsLayoutCreateInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->pipelineBindPoint = in->pipelineBindPoint; - out->tokenCount = in->tokenCount; - out->pTokens = convert_VkIndirectCommandsLayoutTokenNV_array_win32_to_host(ctx, (const VkIndirectCommandsLayoutTokenNV32 *)UlongToPtr(in->pTokens), in->tokenCount); - out->streamCount = in->streamCount; - out->pStreamStrides = UlongToPtr(in->pStreamStrides); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkIndirectExecutionSetPipelineInfoEXT_win32_to_host(const VkIndirectExecutionSetPipelineInfoEXT32 *in, VkIndirectExecutionSetPipelineInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->initialPipeline = in->initialPipeline; - out->maxPipelineCount = in->maxPipelineCount; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkIndirectExecutionSetPipelineInfoEXT *convert_VkIndirectExecutionSetPipelineInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkIndirectExecutionSetPipelineInfoEXT32 *in, uint32_t count) -{ - VkIndirectExecutionSetPipelineInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkIndirectExecutionSetPipelineInfoEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkIndirectExecutionSetShaderLayoutInfoEXT_win32_to_host(const VkIndirectExecutionSetShaderLayoutInfoEXT32 *in, VkIndirectExecutionSetShaderLayoutInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->setLayoutCount = in->setLayoutCount; - out->pSetLayouts = UlongToPtr(in->pSetLayouts); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkIndirectExecutionSetShaderLayoutInfoEXT *convert_VkIndirectExecutionSetShaderLayoutInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkIndirectExecutionSetShaderLayoutInfoEXT32 *in, uint32_t count) -{ - VkIndirectExecutionSetShaderLayoutInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkIndirectExecutionSetShaderLayoutInfoEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkIndirectExecutionSetShaderInfoEXT_win32_to_host(struct conversion_context *ctx, const VkIndirectExecutionSetShaderInfoEXT32 *in, VkIndirectExecutionSetShaderInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->shaderCount = in->shaderCount; - out->pInitialShaders = UlongToPtr(in->pInitialShaders); - out->pSetLayoutInfos = convert_VkIndirectExecutionSetShaderLayoutInfoEXT_array_win32_to_host(ctx, (const VkIndirectExecutionSetShaderLayoutInfoEXT32 *)UlongToPtr(in->pSetLayoutInfos), in->shaderCount); - out->maxShaderCount = in->maxShaderCount; - out->pushConstantRangeCount = in->pushConstantRangeCount; - out->pPushConstantRanges = UlongToPtr(in->pPushConstantRanges); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkIndirectExecutionSetShaderInfoEXT *convert_VkIndirectExecutionSetShaderInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkIndirectExecutionSetShaderInfoEXT32 *in, uint32_t count) -{ - VkIndirectExecutionSetShaderInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkIndirectExecutionSetShaderInfoEXT_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkIndirectExecutionSetInfoEXT_win32_to_host(struct conversion_context *ctx, const VkIndirectExecutionSetInfoEXT32 *in, VkIndirectExecutionSetInfoEXT *out, VkFlags selector) -{ - if (!in) return; - - if (selector == VK_INDIRECT_EXECUTION_SET_INFO_TYPE_PIPELINES_EXT) - out->pPipelineInfo = convert_VkIndirectExecutionSetPipelineInfoEXT_array_win32_to_host(ctx, (const VkIndirectExecutionSetPipelineInfoEXT32 *)UlongToPtr(in->pPipelineInfo), 1); - if (selector == VK_INDIRECT_EXECUTION_SET_INFO_TYPE_SHADER_OBJECTS_EXT) - out->pShaderInfo = convert_VkIndirectExecutionSetShaderInfoEXT_array_win32_to_host(ctx, (const VkIndirectExecutionSetShaderInfoEXT32 *)UlongToPtr(in->pShaderInfo), 1); -} - -static inline void convert_VkIndirectExecutionSetCreateInfoEXT_win32_to_host(struct conversion_context *ctx, const VkIndirectExecutionSetCreateInfoEXT32 *in, VkIndirectExecutionSetCreateInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - convert_VkIndirectExecutionSetInfoEXT_win32_to_host(ctx, &in->info, &out->info, in->type); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkLayerSettingEXT_win32_to_host(const VkLayerSettingEXT32 *in, VkLayerSettingEXT *out) -{ - if (!in) return; - - out->pLayerName = UlongToPtr(in->pLayerName); - out->pSettingName = UlongToPtr(in->pSettingName); - out->type = in->type; - out->valueCount = in->valueCount; - out->pValues = UlongToPtr(in->pValues); -} - -static inline const VkLayerSettingEXT *convert_VkLayerSettingEXT_array_win32_to_host(struct conversion_context *ctx, const VkLayerSettingEXT32 *in, uint32_t count) -{ - VkLayerSettingEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkLayerSettingEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkApplicationInfo_win32_to_host(const VkApplicationInfo32 *in, VkApplicationInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pApplicationName = UlongToPtr(in->pApplicationName); - out->applicationVersion = in->applicationVersion; - out->pEngineName = UlongToPtr(in->pEngineName); - out->engineVersion = in->engineVersion; - out->apiVersion = in->apiVersion; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkApplicationInfo *convert_VkApplicationInfo_array_win32_to_host(struct conversion_context *ctx, const VkApplicationInfo32 *in, uint32_t count) -{ - VkApplicationInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkApplicationInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkInstanceCreateInfo_win64_to_host(struct conversion_context *ctx, const VkInstanceCreateInfo *in, VkInstanceCreateInfo *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->pApplicationInfo = in->pApplicationInfo; - out->enabledLayerCount = in->enabledLayerCount; - out->ppEnabledLayerNames = in->ppEnabledLayerNames; - out->enabledExtensionCount = in->enabledExtensionCount; - out->ppEnabledExtensionNames = in->ppEnabledExtensionNames; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO: - break; - case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: - { - VkDebugReportCallbackCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDebugReportCallbackCreateInfoEXT *in_ext = (const VkDebugReportCallbackCreateInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->pfnCallback = in_ext->pfnCallback; - out_ext->pUserData = in_ext->pUserData; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT: - { - VkValidationFlagsEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkValidationFlagsEXT *in_ext = (const VkValidationFlagsEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT; - out_ext->pNext = NULL; - out_ext->disabledValidationCheckCount = in_ext->disabledValidationCheckCount; - out_ext->pDisabledValidationChecks = in_ext->pDisabledValidationChecks; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: - { - VkValidationFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkValidationFeaturesEXT *in_ext = (const VkValidationFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->enabledValidationFeatureCount = in_ext->enabledValidationFeatureCount; - out_ext->pEnabledValidationFeatures = in_ext->pEnabledValidationFeatures; - out_ext->disabledValidationFeatureCount = in_ext->disabledValidationFeatureCount; - out_ext->pDisabledValidationFeatures = in_ext->pDisabledValidationFeatures; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT: - { - VkLayerSettingsCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkLayerSettingsCreateInfoEXT *in_ext = (const VkLayerSettingsCreateInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->settingCount = in_ext->settingCount; - out_ext->pSettings = in_ext->pSettings; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: - { - VkDebugUtilsMessengerCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDebugUtilsMessengerCreateInfoEXT *in_ext = (const VkDebugUtilsMessengerCreateInfoEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->messageSeverity = in_ext->messageSeverity; - out_ext->messageType = in_ext->messageType; - out_ext->pfnUserCallback = in_ext->pfnUserCallback; - out_ext->pUserData = in_ext->pUserData; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} -#endif /* _WIN64 */ - -static inline void convert_VkInstanceCreateInfo_win32_to_host(struct conversion_context *ctx, const VkInstanceCreateInfo32 *in, VkInstanceCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->pApplicationInfo = convert_VkApplicationInfo_array_win32_to_host(ctx, (const VkApplicationInfo32 *)UlongToPtr(in->pApplicationInfo), 1); - out->enabledLayerCount = in->enabledLayerCount; - out->ppEnabledLayerNames = convert_char_pointer_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(in->ppEnabledLayerNames), in->enabledLayerCount); - out->enabledExtensionCount = in->enabledExtensionCount; - out->ppEnabledExtensionNames = convert_char_pointer_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(in->ppEnabledExtensionNames), in->enabledExtensionCount); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO: - break; - case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: - { - VkDebugReportCallbackCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDebugReportCallbackCreateInfoEXT32 *in_ext = (const VkDebugReportCallbackCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->pfnCallback = (PFN_vkDebugReportCallbackEXT)UlongToPtr(in_ext->pfnCallback); - out_ext->pUserData = UlongToPtr(in_ext->pUserData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT: - { - VkValidationFlagsEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkValidationFlagsEXT32 *in_ext = (const VkValidationFlagsEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT; - out_ext->pNext = NULL; - out_ext->disabledValidationCheckCount = in_ext->disabledValidationCheckCount; - out_ext->pDisabledValidationChecks = UlongToPtr(in_ext->pDisabledValidationChecks); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: - { - VkValidationFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkValidationFeaturesEXT32 *in_ext = (const VkValidationFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->enabledValidationFeatureCount = in_ext->enabledValidationFeatureCount; - out_ext->pEnabledValidationFeatures = UlongToPtr(in_ext->pEnabledValidationFeatures); - out_ext->disabledValidationFeatureCount = in_ext->disabledValidationFeatureCount; - out_ext->pDisabledValidationFeatures = UlongToPtr(in_ext->pDisabledValidationFeatures); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT: - { - VkLayerSettingsCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkLayerSettingsCreateInfoEXT32 *in_ext = (const VkLayerSettingsCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->settingCount = in_ext->settingCount; - out_ext->pSettings = convert_VkLayerSettingEXT_array_win32_to_host(ctx, (const VkLayerSettingEXT32 *)UlongToPtr(in_ext->pSettings), in_ext->settingCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: - { - VkDebugUtilsMessengerCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDebugUtilsMessengerCreateInfoEXT32 *in_ext = (const VkDebugUtilsMessengerCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->messageSeverity = in_ext->messageSeverity; - out_ext->messageType = in_ext->messageType; - out_ext->pfnUserCallback = (PFN_vkDebugUtilsMessengerCallbackEXT)UlongToPtr(in_ext->pfnUserCallback); - out_ext->pUserData = UlongToPtr(in_ext->pUserData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkMicromapCreateInfoEXT_win32_to_host(const VkMicromapCreateInfoEXT32 *in, VkMicromapCreateInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->createFlags = in->createFlags; - out->buffer = in->buffer; - out->offset = in->offset; - out->size = in->size; - out->type = in->type; - out->deviceAddress = in->deviceAddress; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkOpticalFlowSessionCreateInfoNV_win32_to_host(struct conversion_context *ctx, const VkOpticalFlowSessionCreateInfoNV32 *in, VkOpticalFlowSessionCreateInfoNV *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->width = in->width; - out->height = in->height; - out->imageFormat = in->imageFormat; - out->flowVectorFormat = in->flowVectorFormat; - out->costFormat = in->costFormat; - out->outputGridSize = in->outputGridSize; - out->hintGridSize = in->hintGridSize; - out->performanceLevel = in->performanceLevel; - out->flags = in->flags; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_PRIVATE_DATA_INFO_NV: - { - VkOpticalFlowSessionCreatePrivateDataInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpticalFlowSessionCreatePrivateDataInfoNV32 *in_ext = (const VkOpticalFlowSessionCreatePrivateDataInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_PRIVATE_DATA_INFO_NV; - out_ext->pNext = NULL; - out_ext->id = in_ext->id; - out_ext->size = in_ext->size; - out_ext->pPrivateData = UlongToPtr(in_ext->pPrivateData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkPipelineBinaryKeyKHR_win32_to_host(const VkPipelineBinaryKeyKHR32 *in, VkPipelineBinaryKeyKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->keySize = in->keySize; - memcpy(out->key, in->key, VK_MAX_PIPELINE_BINARY_KEY_SIZE_KHR * sizeof(uint8_t)); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkPipelineBinaryKeyKHR *convert_VkPipelineBinaryKeyKHR_array_win32_to_host(struct conversion_context *ctx, const VkPipelineBinaryKeyKHR32 *in, uint32_t count) -{ - VkPipelineBinaryKeyKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineBinaryKeyKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineBinaryDataKHR_win32_to_host(const VkPipelineBinaryDataKHR32 *in, VkPipelineBinaryDataKHR *out) -{ - if (!in) return; - - out->dataSize = in->dataSize; - out->pData = UlongToPtr(in->pData); -} - -static inline const VkPipelineBinaryDataKHR *convert_VkPipelineBinaryDataKHR_array_win32_to_host(struct conversion_context *ctx, const VkPipelineBinaryDataKHR32 *in, uint32_t count) -{ - VkPipelineBinaryDataKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineBinaryDataKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineBinaryKeysAndDataKHR_win32_to_host(struct conversion_context *ctx, const VkPipelineBinaryKeysAndDataKHR32 *in, VkPipelineBinaryKeysAndDataKHR *out) -{ - if (!in) return; - - out->binaryCount = in->binaryCount; - out->pPipelineBinaryKeys = convert_VkPipelineBinaryKeyKHR_array_win32_to_host(ctx, (const VkPipelineBinaryKeyKHR32 *)UlongToPtr(in->pPipelineBinaryKeys), in->binaryCount); - out->pPipelineBinaryData = convert_VkPipelineBinaryDataKHR_array_win32_to_host(ctx, (const VkPipelineBinaryDataKHR32 *)UlongToPtr(in->pPipelineBinaryData), in->binaryCount); -} - -static inline const VkPipelineBinaryKeysAndDataKHR *convert_VkPipelineBinaryKeysAndDataKHR_array_win32_to_host(struct conversion_context *ctx, const VkPipelineBinaryKeysAndDataKHR32 *in, uint32_t count) -{ - VkPipelineBinaryKeysAndDataKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineBinaryKeysAndDataKHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineCreateInfoKHR_win32_to_host(const VkPipelineCreateInfoKHR32 *in, VkPipelineCreateInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkPipelineCreateInfoKHR *convert_VkPipelineCreateInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkPipelineCreateInfoKHR32 *in, uint32_t count) -{ - VkPipelineCreateInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineCreateInfoKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineBinaryCreateInfoKHR_win32_to_host(struct conversion_context *ctx, const VkPipelineBinaryCreateInfoKHR32 *in, VkPipelineBinaryCreateInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pKeysAndDataInfo = convert_VkPipelineBinaryKeysAndDataKHR_array_win32_to_host(ctx, (const VkPipelineBinaryKeysAndDataKHR32 *)UlongToPtr(in->pKeysAndDataInfo), 1); - out->pipeline = in->pipeline; - out->pPipelineCreateInfo = convert_VkPipelineCreateInfoKHR_array_win32_to_host(ctx, (const VkPipelineCreateInfoKHR32 *)UlongToPtr(in->pPipelineCreateInfo), 1); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineBinaryHandlesInfoKHR_win32_to_host(const VkPipelineBinaryHandlesInfoKHR32 *in, VkPipelineBinaryHandlesInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pipelineBinaryCount = in->pipelineBinaryCount; - out->pPipelineBinaries = UlongToPtr(in->pPipelineBinaries); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineBinaryHandlesInfoKHR_host_to_win32(const VkPipelineBinaryHandlesInfoKHR *in, VkPipelineBinaryHandlesInfoKHR32 *out) -{ - if (!in) return; - - out->pipelineBinaryCount = in->pipelineBinaryCount; - out->pPipelineBinaries = PtrToUlong(in->pPipelineBinaries); -} - -static inline void convert_VkPipelineCacheCreateInfo_win32_to_host(const VkPipelineCacheCreateInfo32 *in, VkPipelineCacheCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->initialDataSize = in->initialDataSize; - out->pInitialData = UlongToPtr(in->pInitialData); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineLayoutCreateInfo_win32_to_host(const VkPipelineLayoutCreateInfo32 *in, VkPipelineLayoutCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->setLayoutCount = in->setLayoutCount; - out->pSetLayouts = UlongToPtr(in->pSetLayouts); - out->pushConstantRangeCount = in->pushConstantRangeCount; - out->pPushConstantRanges = UlongToPtr(in->pPushConstantRanges); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPrivateDataSlotCreateInfo_win32_to_host(const VkPrivateDataSlotCreateInfo32 *in, VkPrivateDataSlotCreateInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkQueryPoolCreateInfo_win32_to_host(struct conversion_context *ctx, const VkQueryPoolCreateInfo32 *in, VkQueryPoolCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->queryType = in->queryType; - out->queryCount = in->queryCount; - out->pipelineStatistics = in->pipelineStatistics; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR: - { - VkQueryPoolPerformanceCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkQueryPoolPerformanceCreateInfoKHR32 *in_ext = (const VkQueryPoolPerformanceCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->queueFamilyIndex = in_ext->queueFamilyIndex; - out_ext->counterIndexCount = in_ext->counterIndexCount; - out_ext->pCounterIndices = UlongToPtr(in_ext->pCounterIndices); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL: - { - VkQueryPoolPerformanceQueryCreateInfoINTEL *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkQueryPoolPerformanceQueryCreateInfoINTEL32 *in_ext = (const VkQueryPoolPerformanceQueryCreateInfoINTEL32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL; - out_ext->pNext = NULL; - out_ext->performanceCountersSampling = in_ext->performanceCountersSampling; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR: - { - VkVideoProfileInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoProfileInfoKHR32 *in_ext = (const VkVideoProfileInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->videoCodecOperation = in_ext->videoCodecOperation; - out_ext->chromaSubsampling = in_ext->chromaSubsampling; - out_ext->lumaBitDepth = in_ext->lumaBitDepth; - out_ext->chromaBitDepth = in_ext->chromaBitDepth; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_USAGE_INFO_KHR: - { - VkVideoDecodeUsageInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeUsageInfoKHR32 *in_ext = (const VkVideoDecodeUsageInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_USAGE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->videoUsageHints = in_ext->videoUsageHints; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR: - { - VkVideoDecodeH264ProfileInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeH264ProfileInfoKHR32 *in_ext = (const VkVideoDecodeH264ProfileInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->stdProfileIdc = in_ext->stdProfileIdc; - out_ext->pictureLayout = in_ext->pictureLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR: - { - VkVideoDecodeH265ProfileInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeH265ProfileInfoKHR32 *in_ext = (const VkVideoDecodeH265ProfileInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->stdProfileIdc = in_ext->stdProfileIdc; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_KHR: - { - VkVideoDecodeAV1ProfileInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeAV1ProfileInfoKHR32 *in_ext = (const VkVideoDecodeAV1ProfileInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->stdProfile = in_ext->stdProfile; - out_ext->filmGrainSupport = in_ext->filmGrainSupport; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_USAGE_INFO_KHR: - { - VkVideoEncodeUsageInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeUsageInfoKHR32 *in_ext = (const VkVideoEncodeUsageInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_USAGE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->videoUsageHints = in_ext->videoUsageHints; - out_ext->videoContentHints = in_ext->videoContentHints; - out_ext->tuningMode = in_ext->tuningMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_QUERY_POOL_VIDEO_ENCODE_FEEDBACK_CREATE_INFO_KHR: - { - VkQueryPoolVideoEncodeFeedbackCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkQueryPoolVideoEncodeFeedbackCreateInfoKHR32 *in_ext = (const VkQueryPoolVideoEncodeFeedbackCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_QUERY_POOL_VIDEO_ENCODE_FEEDBACK_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->encodeFeedbackFlags = in_ext->encodeFeedbackFlags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_KHR: - { - VkVideoEncodeH264ProfileInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH264ProfileInfoKHR32 *in_ext = (const VkVideoEncodeH264ProfileInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->stdProfileIdc = in_ext->stdProfileIdc; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_KHR: - { - VkVideoEncodeH265ProfileInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH265ProfileInfoKHR32 *in_ext = (const VkVideoEncodeH265ProfileInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->stdProfileIdc = in_ext->stdProfileIdc; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PROFILE_INFO_KHR: - { - VkVideoEncodeAV1ProfileInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeAV1ProfileInfoKHR32 *in_ext = (const VkVideoEncodeAV1ProfileInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PROFILE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->stdProfile = in_ext->stdProfile; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkRayTracingShaderGroupCreateInfoKHR_win32_to_host(const VkRayTracingShaderGroupCreateInfoKHR32 *in, VkRayTracingShaderGroupCreateInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - out->generalShader = in->generalShader; - out->closestHitShader = in->closestHitShader; - out->anyHitShader = in->anyHitShader; - out->intersectionShader = in->intersectionShader; - out->pShaderGroupCaptureReplayHandle = UlongToPtr(in->pShaderGroupCaptureReplayHandle); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkRayTracingShaderGroupCreateInfoKHR *convert_VkRayTracingShaderGroupCreateInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkRayTracingShaderGroupCreateInfoKHR32 *in, uint32_t count) -{ - VkRayTracingShaderGroupCreateInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkRayTracingShaderGroupCreateInfoKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineLibraryCreateInfoKHR_win32_to_host(const VkPipelineLibraryCreateInfoKHR32 *in, VkPipelineLibraryCreateInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->libraryCount = in->libraryCount; - out->pLibraries = UlongToPtr(in->pLibraries); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkPipelineLibraryCreateInfoKHR *convert_VkPipelineLibraryCreateInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkPipelineLibraryCreateInfoKHR32 *in, uint32_t count) -{ - VkPipelineLibraryCreateInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineLibraryCreateInfoKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkRayTracingPipelineInterfaceCreateInfoKHR_win32_to_host(const VkRayTracingPipelineInterfaceCreateInfoKHR32 *in, VkRayTracingPipelineInterfaceCreateInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->maxPipelineRayPayloadSize = in->maxPipelineRayPayloadSize; - out->maxPipelineRayHitAttributeSize = in->maxPipelineRayHitAttributeSize; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkRayTracingPipelineInterfaceCreateInfoKHR *convert_VkRayTracingPipelineInterfaceCreateInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkRayTracingPipelineInterfaceCreateInfoKHR32 *in, uint32_t count) -{ - VkRayTracingPipelineInterfaceCreateInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkRayTracingPipelineInterfaceCreateInfoKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkRayTracingPipelineCreateInfoKHR_win64_to_host(struct conversion_context *ctx, const VkRayTracingPipelineCreateInfoKHR *in, VkRayTracingPipelineCreateInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->flags = in->flags; - out->stageCount = in->stageCount; - out->pStages = convert_VkPipelineShaderStageCreateInfo_array_win64_to_host(ctx, in->pStages, in->stageCount); - out->groupCount = in->groupCount; - out->pGroups = in->pGroups; - out->maxPipelineRayRecursionDepth = in->maxPipelineRayRecursionDepth; - out->pLibraryInfo = in->pLibraryInfo; - out->pLibraryInterface = in->pLibraryInterface; - out->pDynamicState = in->pDynamicState; - out->layout = in->layout; - out->basePipelineHandle = in->basePipelineHandle; - out->basePipelineIndex = in->basePipelineIndex; -} -#endif /* _WIN64 */ - -static inline void convert_VkRayTracingPipelineCreateInfoKHR_win32_to_host(struct conversion_context *ctx, const VkRayTracingPipelineCreateInfoKHR32 *in, VkRayTracingPipelineCreateInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->stageCount = in->stageCount; - out->pStages = convert_VkPipelineShaderStageCreateInfo_array_win32_to_host(ctx, (const VkPipelineShaderStageCreateInfo32 *)UlongToPtr(in->pStages), in->stageCount); - out->groupCount = in->groupCount; - out->pGroups = convert_VkRayTracingShaderGroupCreateInfoKHR_array_win32_to_host(ctx, (const VkRayTracingShaderGroupCreateInfoKHR32 *)UlongToPtr(in->pGroups), in->groupCount); - out->maxPipelineRayRecursionDepth = in->maxPipelineRayRecursionDepth; - out->pLibraryInfo = convert_VkPipelineLibraryCreateInfoKHR_array_win32_to_host(ctx, (const VkPipelineLibraryCreateInfoKHR32 *)UlongToPtr(in->pLibraryInfo), 1); - out->pLibraryInterface = convert_VkRayTracingPipelineInterfaceCreateInfoKHR_array_win32_to_host(ctx, (const VkRayTracingPipelineInterfaceCreateInfoKHR32 *)UlongToPtr(in->pLibraryInterface), 1); - out->pDynamicState = convert_VkPipelineDynamicStateCreateInfo_array_win32_to_host(ctx, (const VkPipelineDynamicStateCreateInfo32 *)UlongToPtr(in->pDynamicState), 1); - out->layout = in->layout; - out->basePipelineHandle = in->basePipelineHandle; - out->basePipelineIndex = in->basePipelineIndex; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO: - { - VkPipelineCreateFlags2CreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreateFlags2CreateInfo32 *in_ext = (const VkPipelineCreateFlags2CreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR: - { - VkPipelineBinaryInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineBinaryInfoKHR32 *in_ext = (const VkPipelineBinaryInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR; - out_ext->pNext = NULL; - out_ext->binaryCount = in_ext->binaryCount; - out_ext->pPipelineBinaries = UlongToPtr(in_ext->pPipelineBinaries); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: - { - VkPipelineCreationFeedbackCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreationFeedbackCreateInfo32 *in_ext = (const VkPipelineCreationFeedbackCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->pPipelineCreationFeedback = convert_VkPipelineCreationFeedback_array_win32_to_host(ctx, (VkPipelineCreationFeedback32 *)UlongToPtr(in_ext->pPipelineCreationFeedback), 1); - out_ext->pipelineStageCreationFeedbackCount = in_ext->pipelineStageCreationFeedbackCount; - out_ext->pPipelineStageCreationFeedbacks = convert_VkPipelineCreationFeedback_array_win32_to_host(ctx, (VkPipelineCreationFeedback32 *)UlongToPtr(in_ext->pPipelineStageCreationFeedbacks), in_ext->pipelineStageCreationFeedbackCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO: - { - VkPipelineRobustnessCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineRobustnessCreateInfo32 *in_ext = (const VkPipelineRobustnessCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->storageBuffers = in_ext->storageBuffers; - out_ext->uniformBuffers = in_ext->uniformBuffers; - out_ext->vertexInputs = in_ext->vertexInputs; - out_ext->images = in_ext->images; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkRayTracingPipelineCreateInfoKHR_host_to_win32(const VkRayTracingPipelineCreateInfoKHR *in, const VkRayTracingPipelineCreateInfoKHR32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: - { - VkPipelineCreationFeedbackCreateInfo32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO); - const VkPipelineCreationFeedbackCreateInfo *in_ext = (const VkPipelineCreationFeedbackCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO; - convert_VkPipelineCreationFeedback_array_host_to_win32(in_ext->pPipelineCreationFeedback, (VkPipelineCreationFeedback32 *)UlongToPtr(out_ext->pPipelineCreationFeedback), 1); - convert_VkPipelineCreationFeedback_array_host_to_win32(in_ext->pPipelineStageCreationFeedbacks, (VkPipelineCreationFeedback32 *)UlongToPtr(out_ext->pPipelineStageCreationFeedbacks), in_ext->pipelineStageCreationFeedbackCount); - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -#ifdef _WIN64 -static inline const VkRayTracingPipelineCreateInfoKHR *convert_VkRayTracingPipelineCreateInfoKHR_array_win64_to_host(struct conversion_context *ctx, const VkRayTracingPipelineCreateInfoKHR *in, uint32_t count) -{ - VkRayTracingPipelineCreateInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkRayTracingPipelineCreateInfoKHR_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkRayTracingPipelineCreateInfoKHR *convert_VkRayTracingPipelineCreateInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkRayTracingPipelineCreateInfoKHR32 *in, uint32_t count) -{ - VkRayTracingPipelineCreateInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkRayTracingPipelineCreateInfoKHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkRayTracingPipelineCreateInfoKHR_array_host_to_win32(const VkRayTracingPipelineCreateInfoKHR *in, const VkRayTracingPipelineCreateInfoKHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkRayTracingPipelineCreateInfoKHR_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkRayTracingShaderGroupCreateInfoNV_win32_to_host(const VkRayTracingShaderGroupCreateInfoNV32 *in, VkRayTracingShaderGroupCreateInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - out->generalShader = in->generalShader; - out->closestHitShader = in->closestHitShader; - out->anyHitShader = in->anyHitShader; - out->intersectionShader = in->intersectionShader; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkRayTracingShaderGroupCreateInfoNV *convert_VkRayTracingShaderGroupCreateInfoNV_array_win32_to_host(struct conversion_context *ctx, const VkRayTracingShaderGroupCreateInfoNV32 *in, uint32_t count) -{ - VkRayTracingShaderGroupCreateInfoNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkRayTracingShaderGroupCreateInfoNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkRayTracingPipelineCreateInfoNV_win64_to_host(struct conversion_context *ctx, const VkRayTracingPipelineCreateInfoNV *in, VkRayTracingPipelineCreateInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->flags = in->flags; - out->stageCount = in->stageCount; - out->pStages = convert_VkPipelineShaderStageCreateInfo_array_win64_to_host(ctx, in->pStages, in->stageCount); - out->groupCount = in->groupCount; - out->pGroups = in->pGroups; - out->maxRecursionDepth = in->maxRecursionDepth; - out->layout = in->layout; - out->basePipelineHandle = in->basePipelineHandle; - out->basePipelineIndex = in->basePipelineIndex; -} -#endif /* _WIN64 */ - -static inline void convert_VkRayTracingPipelineCreateInfoNV_win32_to_host(struct conversion_context *ctx, const VkRayTracingPipelineCreateInfoNV32 *in, VkRayTracingPipelineCreateInfoNV *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->stageCount = in->stageCount; - out->pStages = convert_VkPipelineShaderStageCreateInfo_array_win32_to_host(ctx, (const VkPipelineShaderStageCreateInfo32 *)UlongToPtr(in->pStages), in->stageCount); - out->groupCount = in->groupCount; - out->pGroups = convert_VkRayTracingShaderGroupCreateInfoNV_array_win32_to_host(ctx, (const VkRayTracingShaderGroupCreateInfoNV32 *)UlongToPtr(in->pGroups), in->groupCount); - out->maxRecursionDepth = in->maxRecursionDepth; - out->layout = in->layout; - out->basePipelineHandle = in->basePipelineHandle; - out->basePipelineIndex = in->basePipelineIndex; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO: - { - VkPipelineCreateFlags2CreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreateFlags2CreateInfo32 *in_ext = (const VkPipelineCreateFlags2CreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: - { - VkPipelineCreationFeedbackCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineCreationFeedbackCreateInfo32 *in_ext = (const VkPipelineCreationFeedbackCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->pPipelineCreationFeedback = convert_VkPipelineCreationFeedback_array_win32_to_host(ctx, (VkPipelineCreationFeedback32 *)UlongToPtr(in_ext->pPipelineCreationFeedback), 1); - out_ext->pipelineStageCreationFeedbackCount = in_ext->pipelineStageCreationFeedbackCount; - out_ext->pPipelineStageCreationFeedbacks = convert_VkPipelineCreationFeedback_array_win32_to_host(ctx, (VkPipelineCreationFeedback32 *)UlongToPtr(in_ext->pPipelineStageCreationFeedbacks), in_ext->pipelineStageCreationFeedbackCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkRayTracingPipelineCreateInfoNV_host_to_win32(const VkRayTracingPipelineCreateInfoNV *in, const VkRayTracingPipelineCreateInfoNV32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: - { - VkPipelineCreationFeedbackCreateInfo32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO); - const VkPipelineCreationFeedbackCreateInfo *in_ext = (const VkPipelineCreationFeedbackCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO; - convert_VkPipelineCreationFeedback_array_host_to_win32(in_ext->pPipelineCreationFeedback, (VkPipelineCreationFeedback32 *)UlongToPtr(out_ext->pPipelineCreationFeedback), 1); - convert_VkPipelineCreationFeedback_array_host_to_win32(in_ext->pPipelineStageCreationFeedbacks, (VkPipelineCreationFeedback32 *)UlongToPtr(out_ext->pPipelineStageCreationFeedbacks), in_ext->pipelineStageCreationFeedbackCount); - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -#ifdef _WIN64 -static inline const VkRayTracingPipelineCreateInfoNV *convert_VkRayTracingPipelineCreateInfoNV_array_win64_to_host(struct conversion_context *ctx, const VkRayTracingPipelineCreateInfoNV *in, uint32_t count) -{ - VkRayTracingPipelineCreateInfoNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkRayTracingPipelineCreateInfoNV_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkRayTracingPipelineCreateInfoNV *convert_VkRayTracingPipelineCreateInfoNV_array_win32_to_host(struct conversion_context *ctx, const VkRayTracingPipelineCreateInfoNV32 *in, uint32_t count) -{ - VkRayTracingPipelineCreateInfoNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkRayTracingPipelineCreateInfoNV_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkRayTracingPipelineCreateInfoNV_array_host_to_win32(const VkRayTracingPipelineCreateInfoNV *in, const VkRayTracingPipelineCreateInfoNV32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkRayTracingPipelineCreateInfoNV_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkSubpassDescription_win32_to_host(const VkSubpassDescription32 *in, VkSubpassDescription *out) -{ - if (!in) return; - - out->flags = in->flags; - out->pipelineBindPoint = in->pipelineBindPoint; - out->inputAttachmentCount = in->inputAttachmentCount; - out->pInputAttachments = UlongToPtr(in->pInputAttachments); - out->colorAttachmentCount = in->colorAttachmentCount; - out->pColorAttachments = UlongToPtr(in->pColorAttachments); - out->pResolveAttachments = UlongToPtr(in->pResolveAttachments); - out->pDepthStencilAttachment = UlongToPtr(in->pDepthStencilAttachment); - out->preserveAttachmentCount = in->preserveAttachmentCount; - out->pPreserveAttachments = UlongToPtr(in->pPreserveAttachments); -} - -static inline const VkSubpassDescription *convert_VkSubpassDescription_array_win32_to_host(struct conversion_context *ctx, const VkSubpassDescription32 *in, uint32_t count) -{ - VkSubpassDescription *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSubpassDescription_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkRenderPassCreateInfo_win32_to_host(struct conversion_context *ctx, const VkRenderPassCreateInfo32 *in, VkRenderPassCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->attachmentCount = in->attachmentCount; - out->pAttachments = UlongToPtr(in->pAttachments); - out->subpassCount = in->subpassCount; - out->pSubpasses = convert_VkSubpassDescription_array_win32_to_host(ctx, (const VkSubpassDescription32 *)UlongToPtr(in->pSubpasses), in->subpassCount); - out->dependencyCount = in->dependencyCount; - out->pDependencies = UlongToPtr(in->pDependencies); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO: - { - VkRenderPassMultiviewCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassMultiviewCreateInfo32 *in_ext = (const VkRenderPassMultiviewCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->subpassCount = in_ext->subpassCount; - out_ext->pViewMasks = UlongToPtr(in_ext->pViewMasks); - out_ext->dependencyCount = in_ext->dependencyCount; - out_ext->pViewOffsets = UlongToPtr(in_ext->pViewOffsets); - out_ext->correlationMaskCount = in_ext->correlationMaskCount; - out_ext->pCorrelationMasks = UlongToPtr(in_ext->pCorrelationMasks); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: - { - VkRenderPassInputAttachmentAspectCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassInputAttachmentAspectCreateInfo32 *in_ext = (const VkRenderPassInputAttachmentAspectCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->aspectReferenceCount = in_ext->aspectReferenceCount; - out_ext->pAspectReferences = UlongToPtr(in_ext->pAspectReferences); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: - { - VkRenderPassFragmentDensityMapCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassFragmentDensityMapCreateInfoEXT32 *in_ext = (const VkRenderPassFragmentDensityMapCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->fragmentDensityMapAttachment = in_ext->fragmentDensityMapAttachment; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkAttachmentDescription2_win32_to_host(struct conversion_context *ctx, const VkAttachmentDescription232 *in, VkAttachmentDescription2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->format = in->format; - out->samples = in->samples; - out->loadOp = in->loadOp; - out->storeOp = in->storeOp; - out->stencilLoadOp = in->stencilLoadOp; - out->stencilStoreOp = in->stencilStoreOp; - out->initialLayout = in->initialLayout; - out->finalLayout = in->finalLayout; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT: - { - VkAttachmentDescriptionStencilLayout *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkAttachmentDescriptionStencilLayout32 *in_ext = (const VkAttachmentDescriptionStencilLayout32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT; - out_ext->pNext = NULL; - out_ext->stencilInitialLayout = in_ext->stencilInitialLayout; - out_ext->stencilFinalLayout = in_ext->stencilFinalLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkAttachmentDescription2 *convert_VkAttachmentDescription2_array_win32_to_host(struct conversion_context *ctx, const VkAttachmentDescription232 *in, uint32_t count) -{ - VkAttachmentDescription2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkAttachmentDescription2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkAttachmentReference2_win32_to_host(struct conversion_context *ctx, const VkAttachmentReference232 *in, VkAttachmentReference2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->attachment = in->attachment; - out->layout = in->layout; - out->aspectMask = in->aspectMask; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT: - { - VkAttachmentReferenceStencilLayout *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkAttachmentReferenceStencilLayout32 *in_ext = (const VkAttachmentReferenceStencilLayout32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT; - out_ext->pNext = NULL; - out_ext->stencilLayout = in_ext->stencilLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkAttachmentReference2 *convert_VkAttachmentReference2_array_win32_to_host(struct conversion_context *ctx, const VkAttachmentReference232 *in, uint32_t count) -{ - VkAttachmentReference2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkAttachmentReference2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSubpassDescription2_win32_to_host(struct conversion_context *ctx, const VkSubpassDescription232 *in, VkSubpassDescription2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->pipelineBindPoint = in->pipelineBindPoint; - out->viewMask = in->viewMask; - out->inputAttachmentCount = in->inputAttachmentCount; - out->pInputAttachments = convert_VkAttachmentReference2_array_win32_to_host(ctx, (const VkAttachmentReference232 *)UlongToPtr(in->pInputAttachments), in->inputAttachmentCount); - out->colorAttachmentCount = in->colorAttachmentCount; - out->pColorAttachments = convert_VkAttachmentReference2_array_win32_to_host(ctx, (const VkAttachmentReference232 *)UlongToPtr(in->pColorAttachments), in->colorAttachmentCount); - out->pResolveAttachments = convert_VkAttachmentReference2_array_win32_to_host(ctx, (const VkAttachmentReference232 *)UlongToPtr(in->pResolveAttachments), in->colorAttachmentCount); - out->pDepthStencilAttachment = convert_VkAttachmentReference2_array_win32_to_host(ctx, (const VkAttachmentReference232 *)UlongToPtr(in->pDepthStencilAttachment), 1); - out->preserveAttachmentCount = in->preserveAttachmentCount; - out->pPreserveAttachments = UlongToPtr(in->pPreserveAttachments); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE: - { - VkSubpassDescriptionDepthStencilResolve *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSubpassDescriptionDepthStencilResolve32 *in_ext = (const VkSubpassDescriptionDepthStencilResolve32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE; - out_ext->pNext = NULL; - out_ext->depthResolveMode = in_ext->depthResolveMode; - out_ext->stencilResolveMode = in_ext->stencilResolveMode; - out_ext->pDepthStencilResolveAttachment = convert_VkAttachmentReference2_array_win32_to_host(ctx, (const VkAttachmentReference232 *)UlongToPtr(in_ext->pDepthStencilResolveAttachment), 1); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: - { - VkFragmentShadingRateAttachmentInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkFragmentShadingRateAttachmentInfoKHR32 *in_ext = (const VkFragmentShadingRateAttachmentInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR; - out_ext->pNext = NULL; - out_ext->pFragmentShadingRateAttachment = convert_VkAttachmentReference2_array_win32_to_host(ctx, (const VkAttachmentReference232 *)UlongToPtr(in_ext->pFragmentShadingRateAttachment), 1); - out_ext->shadingRateAttachmentTexelSize = in_ext->shadingRateAttachmentTexelSize; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT: - { - VkMultisampledRenderToSingleSampledInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMultisampledRenderToSingleSampledInfoEXT32 *in_ext = (const VkMultisampledRenderToSingleSampledInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT; - out_ext->pNext = NULL; - out_ext->multisampledRenderToSingleSampledEnable = in_ext->multisampledRenderToSingleSampledEnable; - out_ext->rasterizationSamples = in_ext->rasterizationSamples; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_CONTROL_EXT: - { - VkRenderPassCreationControlEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassCreationControlEXT32 *in_ext = (const VkRenderPassCreationControlEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_CONTROL_EXT; - out_ext->pNext = NULL; - out_ext->disallowMerging = in_ext->disallowMerging; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_SUBPASS_FEEDBACK_CREATE_INFO_EXT: - { - VkRenderPassSubpassFeedbackCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassSubpassFeedbackCreateInfoEXT32 *in_ext = (const VkRenderPassSubpassFeedbackCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_SUBPASS_FEEDBACK_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->pSubpassFeedback = UlongToPtr(in_ext->pSubpassFeedback); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkSubpassDescription2 *convert_VkSubpassDescription2_array_win32_to_host(struct conversion_context *ctx, const VkSubpassDescription232 *in, uint32_t count) -{ - VkSubpassDescription2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSubpassDescription2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSubpassDependency2_win32_to_host(struct conversion_context *ctx, const VkSubpassDependency232 *in, VkSubpassDependency2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcSubpass = in->srcSubpass; - out->dstSubpass = in->dstSubpass; - out->srcStageMask = in->srcStageMask; - out->dstStageMask = in->dstStageMask; - out->srcAccessMask = in->srcAccessMask; - out->dstAccessMask = in->dstAccessMask; - out->dependencyFlags = in->dependencyFlags; - out->viewOffset = in->viewOffset; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_MEMORY_BARRIER_2: - { - VkMemoryBarrier2 *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMemoryBarrier232 *in_ext = (const VkMemoryBarrier232 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2; - out_ext->pNext = NULL; - out_ext->srcStageMask = in_ext->srcStageMask; - out_ext->srcAccessMask = in_ext->srcAccessMask; - out_ext->dstStageMask = in_ext->dstStageMask; - out_ext->dstAccessMask = in_ext->dstAccessMask; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkSubpassDependency2 *convert_VkSubpassDependency2_array_win32_to_host(struct conversion_context *ctx, const VkSubpassDependency232 *in, uint32_t count) -{ - VkSubpassDependency2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSubpassDependency2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkRenderPassCreateInfo2_win32_to_host(struct conversion_context *ctx, const VkRenderPassCreateInfo232 *in, VkRenderPassCreateInfo2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->attachmentCount = in->attachmentCount; - out->pAttachments = convert_VkAttachmentDescription2_array_win32_to_host(ctx, (const VkAttachmentDescription232 *)UlongToPtr(in->pAttachments), in->attachmentCount); - out->subpassCount = in->subpassCount; - out->pSubpasses = convert_VkSubpassDescription2_array_win32_to_host(ctx, (const VkSubpassDescription232 *)UlongToPtr(in->pSubpasses), in->subpassCount); - out->dependencyCount = in->dependencyCount; - out->pDependencies = convert_VkSubpassDependency2_array_win32_to_host(ctx, (const VkSubpassDependency232 *)UlongToPtr(in->pDependencies), in->dependencyCount); - out->correlatedViewMaskCount = in->correlatedViewMaskCount; - out->pCorrelatedViewMasks = UlongToPtr(in->pCorrelatedViewMasks); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: - { - VkRenderPassFragmentDensityMapCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassFragmentDensityMapCreateInfoEXT32 *in_ext = (const VkRenderPassFragmentDensityMapCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->fragmentDensityMapAttachment = in_ext->fragmentDensityMapAttachment; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_CONTROL_EXT: - { - VkRenderPassCreationControlEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassCreationControlEXT32 *in_ext = (const VkRenderPassCreationControlEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_CONTROL_EXT; - out_ext->pNext = NULL; - out_ext->disallowMerging = in_ext->disallowMerging; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_FEEDBACK_CREATE_INFO_EXT: - { - VkRenderPassCreationFeedbackCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassCreationFeedbackCreateInfoEXT32 *in_ext = (const VkRenderPassCreationFeedbackCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_FEEDBACK_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->pRenderPassFeedback = UlongToPtr(in_ext->pRenderPassFeedback); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSamplerCreateInfo_win32_to_host(struct conversion_context *ctx, const VkSamplerCreateInfo32 *in, VkSamplerCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->magFilter = in->magFilter; - out->minFilter = in->minFilter; - out->mipmapMode = in->mipmapMode; - out->addressModeU = in->addressModeU; - out->addressModeV = in->addressModeV; - out->addressModeW = in->addressModeW; - out->mipLodBias = in->mipLodBias; - out->anisotropyEnable = in->anisotropyEnable; - out->maxAnisotropy = in->maxAnisotropy; - out->compareEnable = in->compareEnable; - out->compareOp = in->compareOp; - out->minLod = in->minLod; - out->maxLod = in->maxLod; - out->borderColor = in->borderColor; - out->unnormalizedCoordinates = in->unnormalizedCoordinates; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: - { - VkSamplerYcbcrConversionInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSamplerYcbcrConversionInfo32 *in_ext = (const VkSamplerYcbcrConversionInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO; - out_ext->pNext = NULL; - out_ext->conversion = in_ext->conversion; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO: - { - VkSamplerReductionModeCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSamplerReductionModeCreateInfo32 *in_ext = (const VkSamplerReductionModeCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->reductionMode = in_ext->reductionMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT: - { - VkSamplerCustomBorderColorCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSamplerCustomBorderColorCreateInfoEXT32 *in_ext = (const VkSamplerCustomBorderColorCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->customBorderColor = in_ext->customBorderColor; - out_ext->format = in_ext->format; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT: - { - VkSamplerBorderColorComponentMappingCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSamplerBorderColorComponentMappingCreateInfoEXT32 *in_ext = (const VkSamplerBorderColorComponentMappingCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->components = in_ext->components; - out_ext->srgb = in_ext->srgb; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT: - { - VkOpaqueCaptureDescriptorDataCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *in_ext = (const VkOpaqueCaptureDescriptorDataCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->opaqueCaptureDescriptorData = UlongToPtr(in_ext->opaqueCaptureDescriptorData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SAMPLER_CUBIC_WEIGHTS_CREATE_INFO_QCOM: - { - VkSamplerCubicWeightsCreateInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSamplerCubicWeightsCreateInfoQCOM32 *in_ext = (const VkSamplerCubicWeightsCreateInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_CUBIC_WEIGHTS_CREATE_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->cubicWeights = in_ext->cubicWeights; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SAMPLER_BLOCK_MATCH_WINDOW_CREATE_INFO_QCOM: - { - VkSamplerBlockMatchWindowCreateInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSamplerBlockMatchWindowCreateInfoQCOM32 *in_ext = (const VkSamplerBlockMatchWindowCreateInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_BLOCK_MATCH_WINDOW_CREATE_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->windowExtent = in_ext->windowExtent; - out_ext->windowCompareMode = in_ext->windowCompareMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSamplerYcbcrConversionCreateInfo_win32_to_host(struct conversion_context *ctx, const VkSamplerYcbcrConversionCreateInfo32 *in, VkSamplerYcbcrConversionCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->format = in->format; - out->ycbcrModel = in->ycbcrModel; - out->ycbcrRange = in->ycbcrRange; - out->components = in->components; - out->xChromaOffset = in->xChromaOffset; - out->yChromaOffset = in->yChromaOffset; - out->chromaFilter = in->chromaFilter; - out->forceExplicitReconstruction = in->forceExplicitReconstruction; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_YCBCR_DEGAMMA_CREATE_INFO_QCOM: - { - VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM32 *in_ext = (const VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_YCBCR_DEGAMMA_CREATE_INFO_QCOM; - out_ext->pNext = NULL; - out_ext->enableYDegamma = in_ext->enableYDegamma; - out_ext->enableCbCrDegamma = in_ext->enableCbCrDegamma; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSemaphoreCreateInfo_win32_to_host(struct conversion_context *ctx, const VkSemaphoreCreateInfo32 *in, VkSemaphoreCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: - { - VkExportSemaphoreCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkExportSemaphoreCreateInfo32 *in_ext = (const VkExportSemaphoreCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->handleTypes = in_ext->handleTypes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: - { - VkSemaphoreTypeCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSemaphoreTypeCreateInfo32 *in_ext = (const VkSemaphoreTypeCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->semaphoreType = in_ext->semaphoreType; - out_ext->initialValue = in_ext->initialValue; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_QUERY_LOW_LATENCY_SUPPORT_NV: - { - VkQueryLowLatencySupportNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkQueryLowLatencySupportNV32 *in_ext = (const VkQueryLowLatencySupportNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_QUERY_LOW_LATENCY_SUPPORT_NV; - out_ext->pNext = NULL; - out_ext->pQueriedLowLatencyData = UlongToPtr(in_ext->pQueriedLowLatencyData); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkShaderModuleCreateInfo_win32_to_host(struct conversion_context *ctx, const VkShaderModuleCreateInfo32 *in, VkShaderModuleCreateInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->codeSize = in->codeSize; - out->pCode = UlongToPtr(in->pCode); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: - { - VkValidationFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkValidationFeaturesEXT32 *in_ext = (const VkValidationFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->enabledValidationFeatureCount = in_ext->enabledValidationFeatureCount; - out_ext->pEnabledValidationFeatures = UlongToPtr(in_ext->pEnabledValidationFeatures); - out_ext->disabledValidationFeatureCount = in_ext->disabledValidationFeatureCount; - out_ext->pDisabledValidationFeatures = UlongToPtr(in_ext->pDisabledValidationFeatures); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: - { - VkShaderModuleValidationCacheCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkShaderModuleValidationCacheCreateInfoEXT32 *in_ext = (const VkShaderModuleValidationCacheCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->validationCache = in_ext->validationCache; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkShaderCreateInfoEXT_win32_to_host(struct conversion_context *ctx, const VkShaderCreateInfoEXT32 *in, VkShaderCreateInfoEXT *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->stage = in->stage; - out->nextStage = in->nextStage; - out->codeType = in->codeType; - out->codeSize = in->codeSize; - out->pCode = UlongToPtr(in->pCode); - out->pName = UlongToPtr(in->pName); - out->setLayoutCount = in->setLayoutCount; - out->pSetLayouts = UlongToPtr(in->pSetLayouts); - out->pushConstantRangeCount = in->pushConstantRangeCount; - out->pPushConstantRanges = UlongToPtr(in->pPushConstantRanges); - out->pSpecializationInfo = convert_VkSpecializationInfo_array_win32_to_host(ctx, (const VkSpecializationInfo32 *)UlongToPtr(in->pSpecializationInfo), 1); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: - { - VkValidationFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkValidationFeaturesEXT32 *in_ext = (const VkValidationFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->enabledValidationFeatureCount = in_ext->enabledValidationFeatureCount; - out_ext->pEnabledValidationFeatures = UlongToPtr(in_ext->pEnabledValidationFeatures); - out_ext->disabledValidationFeatureCount = in_ext->disabledValidationFeatureCount; - out_ext->pDisabledValidationFeatures = UlongToPtr(in_ext->pDisabledValidationFeatures); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO: - { - VkPipelineShaderStageRequiredSubgroupSizeCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPipelineShaderStageRequiredSubgroupSizeCreateInfo32 *in_ext = (const VkPipelineShaderStageRequiredSubgroupSizeCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->requiredSubgroupSize = in_ext->requiredSubgroupSize; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkShaderCreateInfoEXT *convert_VkShaderCreateInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkShaderCreateInfoEXT32 *in, uint32_t count) -{ - VkShaderCreateInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkShaderCreateInfoEXT_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSwapchainCreateInfoKHR_win32_to_unwrapped_host(struct conversion_context *ctx, const VkSwapchainCreateInfoKHR32 *in, VkSwapchainCreateInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->surface = in->surface; - out->minImageCount = in->minImageCount; - out->imageFormat = in->imageFormat; - out->imageColorSpace = in->imageColorSpace; - out->imageExtent = in->imageExtent; - out->imageArrayLayers = in->imageArrayLayers; - out->imageUsage = in->imageUsage; - out->imageSharingMode = in->imageSharingMode; - out->queueFamilyIndexCount = in->queueFamilyIndexCount; - out->pQueueFamilyIndices = UlongToPtr(in->pQueueFamilyIndices); - out->preTransform = in->preTransform; - out->compositeAlpha = in->compositeAlpha; - out->presentMode = in->presentMode; - out->clipped = in->clipped; - out->oldSwapchain = in->oldSwapchain; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR: - { - VkDeviceGroupSwapchainCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceGroupSwapchainCreateInfoKHR32 *in_ext = (const VkDeviceGroupSwapchainCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->modes = in_ext->modes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: - { - VkImageFormatListCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageFormatListCreateInfo32 *in_ext = (const VkImageFormatListCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->viewFormatCount = in_ext->viewFormatCount; - out_ext->pViewFormats = UlongToPtr(in_ext->pViewFormats); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_BARRIER_CREATE_INFO_NV: - { - VkSwapchainPresentBarrierCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSwapchainPresentBarrierCreateInfoNV32 *in_ext = (const VkSwapchainPresentBarrierCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_BARRIER_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->presentBarrierEnable = in_ext->presentBarrierEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT: - { - VkImageCompressionControlEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageCompressionControlEXT32 *in_ext = (const VkImageCompressionControlEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->compressionControlPlaneCount = in_ext->compressionControlPlaneCount; - out_ext->pFixedRateFlags = UlongToPtr(in_ext->pFixedRateFlags); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODES_CREATE_INFO_EXT: - { - VkSwapchainPresentModesCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSwapchainPresentModesCreateInfoEXT32 *in_ext = (const VkSwapchainPresentModesCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODES_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->presentModeCount = in_ext->presentModeCount; - out_ext->pPresentModes = UlongToPtr(in_ext->pPresentModes); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_SCALING_CREATE_INFO_EXT: - { - VkSwapchainPresentScalingCreateInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSwapchainPresentScalingCreateInfoEXT32 *in_ext = (const VkSwapchainPresentScalingCreateInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_SCALING_CREATE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->scalingBehavior = in_ext->scalingBehavior; - out_ext->presentGravityX = in_ext->presentGravityX; - out_ext->presentGravityY = in_ext->presentGravityY; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SWAPCHAIN_LATENCY_CREATE_INFO_NV: - { - VkSwapchainLatencyCreateInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSwapchainLatencyCreateInfoNV32 *in_ext = (const VkSwapchainLatencyCreateInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SWAPCHAIN_LATENCY_CREATE_INFO_NV; - out_ext->pNext = NULL; - out_ext->latencyModeEnable = in_ext->latencyModeEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkValidationCacheCreateInfoEXT_win32_to_host(const VkValidationCacheCreateInfoEXT32 *in, VkValidationCacheCreateInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->initialDataSize = in->initialDataSize; - out->pInitialData = UlongToPtr(in->pInitialData); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkVideoSessionCreateInfoKHR_win32_to_host(struct conversion_context *ctx, const VkVideoSessionCreateInfoKHR32 *in, VkVideoSessionCreateInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->queueFamilyIndex = in->queueFamilyIndex; - out->flags = in->flags; - out->pVideoProfile = convert_VkVideoProfileInfoKHR_array_win32_to_host(ctx, (const VkVideoProfileInfoKHR32 *)UlongToPtr(in->pVideoProfile), 1); - out->pictureFormat = in->pictureFormat; - out->maxCodedExtent = in->maxCodedExtent; - out->referencePictureFormat = in->referencePictureFormat; - out->maxDpbSlots = in->maxDpbSlots; - out->maxActiveReferencePictures = in->maxActiveReferencePictures; - out->pStdHeaderVersion = UlongToPtr(in->pStdHeaderVersion); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_KHR: - { - VkVideoEncodeH264SessionCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH264SessionCreateInfoKHR32 *in_ext = (const VkVideoEncodeH264SessionCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->useMaxLevelIdc = in_ext->useMaxLevelIdc; - out_ext->maxLevelIdc = in_ext->maxLevelIdc; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_KHR: - { - VkVideoEncodeH265SessionCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH265SessionCreateInfoKHR32 *in_ext = (const VkVideoEncodeH265SessionCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->useMaxLevelIdc = in_ext->useMaxLevelIdc; - out_ext->maxLevelIdc = in_ext->maxLevelIdc; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_SESSION_CREATE_INFO_KHR: - { - VkVideoEncodeAV1SessionCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeAV1SessionCreateInfoKHR32 *in_ext = (const VkVideoEncodeAV1SessionCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_SESSION_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->useMaxLevel = in_ext->useMaxLevel; - out_ext->maxLevel = in_ext->maxLevel; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_StdVideoH264SequenceParameterSetVui_win32_to_host(const StdVideoH264SequenceParameterSetVui32 *in, StdVideoH264SequenceParameterSetVui *out) -{ - if (!in) return; - - out->flags = in->flags; - out->aspect_ratio_idc = in->aspect_ratio_idc; - out->sar_width = in->sar_width; - out->sar_height = in->sar_height; - out->video_format = in->video_format; - out->colour_primaries = in->colour_primaries; - out->transfer_characteristics = in->transfer_characteristics; - out->matrix_coefficients = in->matrix_coefficients; - out->num_units_in_tick = in->num_units_in_tick; - out->time_scale = in->time_scale; - out->max_num_reorder_frames = in->max_num_reorder_frames; - out->max_dec_frame_buffering = in->max_dec_frame_buffering; - out->chroma_sample_loc_type_top_field = in->chroma_sample_loc_type_top_field; - out->chroma_sample_loc_type_bottom_field = in->chroma_sample_loc_type_bottom_field; - out->reserved1 = in->reserved1; - out->pHrdParameters = UlongToPtr(in->pHrdParameters); -} - -static inline const StdVideoH264SequenceParameterSetVui *convert_StdVideoH264SequenceParameterSetVui_array_win32_to_host(struct conversion_context *ctx, const StdVideoH264SequenceParameterSetVui32 *in, uint32_t count) -{ - StdVideoH264SequenceParameterSetVui *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_StdVideoH264SequenceParameterSetVui_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_StdVideoH264SequenceParameterSet_win32_to_host(struct conversion_context *ctx, const StdVideoH264SequenceParameterSet32 *in, StdVideoH264SequenceParameterSet *out) -{ - if (!in) return; - - out->flags = in->flags; - out->profile_idc = in->profile_idc; - out->level_idc = in->level_idc; - out->chroma_format_idc = in->chroma_format_idc; - out->seq_parameter_set_id = in->seq_parameter_set_id; - out->bit_depth_luma_minus8 = in->bit_depth_luma_minus8; - out->bit_depth_chroma_minus8 = in->bit_depth_chroma_minus8; - out->log2_max_frame_num_minus4 = in->log2_max_frame_num_minus4; - out->pic_order_cnt_type = in->pic_order_cnt_type; - out->offset_for_non_ref_pic = in->offset_for_non_ref_pic; - out->offset_for_top_to_bottom_field = in->offset_for_top_to_bottom_field; - out->log2_max_pic_order_cnt_lsb_minus4 = in->log2_max_pic_order_cnt_lsb_minus4; - out->num_ref_frames_in_pic_order_cnt_cycle = in->num_ref_frames_in_pic_order_cnt_cycle; - out->max_num_ref_frames = in->max_num_ref_frames; - out->reserved1 = in->reserved1; - out->pic_width_in_mbs_minus1 = in->pic_width_in_mbs_minus1; - out->pic_height_in_map_units_minus1 = in->pic_height_in_map_units_minus1; - out->frame_crop_left_offset = in->frame_crop_left_offset; - out->frame_crop_right_offset = in->frame_crop_right_offset; - out->frame_crop_top_offset = in->frame_crop_top_offset; - out->frame_crop_bottom_offset = in->frame_crop_bottom_offset; - out->reserved2 = in->reserved2; - out->pOffsetForRefFrame = UlongToPtr(in->pOffsetForRefFrame); - out->pScalingLists = UlongToPtr(in->pScalingLists); - out->pSequenceParameterSetVui = convert_StdVideoH264SequenceParameterSetVui_array_win32_to_host(ctx, (const StdVideoH264SequenceParameterSetVui32 *)UlongToPtr(in->pSequenceParameterSetVui), 1); -} - -static inline const StdVideoH264SequenceParameterSet *convert_StdVideoH264SequenceParameterSet_array_win32_to_host(struct conversion_context *ctx, const StdVideoH264SequenceParameterSet32 *in, uint32_t count) -{ - StdVideoH264SequenceParameterSet *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_StdVideoH264SequenceParameterSet_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_StdVideoH264PictureParameterSet_win32_to_host(const StdVideoH264PictureParameterSet32 *in, StdVideoH264PictureParameterSet *out) -{ - if (!in) return; - - out->flags = in->flags; - out->seq_parameter_set_id = in->seq_parameter_set_id; - out->pic_parameter_set_id = in->pic_parameter_set_id; - out->num_ref_idx_l0_default_active_minus1 = in->num_ref_idx_l0_default_active_minus1; - out->num_ref_idx_l1_default_active_minus1 = in->num_ref_idx_l1_default_active_minus1; - out->weighted_bipred_idc = in->weighted_bipred_idc; - out->pic_init_qp_minus26 = in->pic_init_qp_minus26; - out->pic_init_qs_minus26 = in->pic_init_qs_minus26; - out->chroma_qp_index_offset = in->chroma_qp_index_offset; - out->second_chroma_qp_index_offset = in->second_chroma_qp_index_offset; - out->pScalingLists = UlongToPtr(in->pScalingLists); -} - -static inline const StdVideoH264PictureParameterSet *convert_StdVideoH264PictureParameterSet_array_win32_to_host(struct conversion_context *ctx, const StdVideoH264PictureParameterSet32 *in, uint32_t count) -{ - StdVideoH264PictureParameterSet *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_StdVideoH264PictureParameterSet_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkVideoDecodeH264SessionParametersAddInfoKHR_win32_to_host(struct conversion_context *ctx, const VkVideoDecodeH264SessionParametersAddInfoKHR32 *in, VkVideoDecodeH264SessionParametersAddInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->stdSPSCount = in->stdSPSCount; - out->pStdSPSs = convert_StdVideoH264SequenceParameterSet_array_win32_to_host(ctx, (const StdVideoH264SequenceParameterSet32 *)UlongToPtr(in->pStdSPSs), in->stdSPSCount); - out->stdPPSCount = in->stdPPSCount; - out->pStdPPSs = convert_StdVideoH264PictureParameterSet_array_win32_to_host(ctx, (const StdVideoH264PictureParameterSet32 *)UlongToPtr(in->pStdPPSs), in->stdPPSCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkVideoDecodeH264SessionParametersAddInfoKHR *convert_VkVideoDecodeH264SessionParametersAddInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkVideoDecodeH264SessionParametersAddInfoKHR32 *in, uint32_t count) -{ - VkVideoDecodeH264SessionParametersAddInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkVideoDecodeH264SessionParametersAddInfoKHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_StdVideoH265HrdParameters_win32_to_host(const StdVideoH265HrdParameters32 *in, StdVideoH265HrdParameters *out) -{ - if (!in) return; - - out->flags = in->flags; - out->tick_divisor_minus2 = in->tick_divisor_minus2; - out->du_cpb_removal_delay_increment_length_minus1 = in->du_cpb_removal_delay_increment_length_minus1; - out->dpb_output_delay_du_length_minus1 = in->dpb_output_delay_du_length_minus1; - out->bit_rate_scale = in->bit_rate_scale; - out->cpb_size_scale = in->cpb_size_scale; - out->cpb_size_du_scale = in->cpb_size_du_scale; - out->initial_cpb_removal_delay_length_minus1 = in->initial_cpb_removal_delay_length_minus1; - out->au_cpb_removal_delay_length_minus1 = in->au_cpb_removal_delay_length_minus1; - out->dpb_output_delay_length_minus1 = in->dpb_output_delay_length_minus1; - memcpy(out->cpb_cnt_minus1, in->cpb_cnt_minus1, STD_VIDEO_H265_SUBLAYERS_LIST_SIZE * sizeof(uint8_t)); - memcpy(out->elemental_duration_in_tc_minus1, in->elemental_duration_in_tc_minus1, STD_VIDEO_H265_SUBLAYERS_LIST_SIZE * sizeof(uint16_t)); - memcpy(out->reserved, in->reserved, 3 * sizeof(uint16_t)); - out->pSubLayerHrdParametersNal = UlongToPtr(in->pSubLayerHrdParametersNal); - out->pSubLayerHrdParametersVcl = UlongToPtr(in->pSubLayerHrdParametersVcl); -} - -static inline const StdVideoH265HrdParameters *convert_StdVideoH265HrdParameters_array_win32_to_host(struct conversion_context *ctx, const StdVideoH265HrdParameters32 *in, uint32_t count) -{ - StdVideoH265HrdParameters *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_StdVideoH265HrdParameters_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_StdVideoH265VideoParameterSet_win32_to_host(struct conversion_context *ctx, const StdVideoH265VideoParameterSet32 *in, StdVideoH265VideoParameterSet *out) -{ - if (!in) return; - - out->flags = in->flags; - out->vps_video_parameter_set_id = in->vps_video_parameter_set_id; - out->vps_max_sub_layers_minus1 = in->vps_max_sub_layers_minus1; - out->reserved1 = in->reserved1; - out->reserved2 = in->reserved2; - out->vps_num_units_in_tick = in->vps_num_units_in_tick; - out->vps_time_scale = in->vps_time_scale; - out->vps_num_ticks_poc_diff_one_minus1 = in->vps_num_ticks_poc_diff_one_minus1; - out->reserved3 = in->reserved3; - out->pDecPicBufMgr = UlongToPtr(in->pDecPicBufMgr); - out->pHrdParameters = convert_StdVideoH265HrdParameters_array_win32_to_host(ctx, (const StdVideoH265HrdParameters32 *)UlongToPtr(in->pHrdParameters), 1); - out->pProfileTierLevel = UlongToPtr(in->pProfileTierLevel); -} - -static inline const StdVideoH265VideoParameterSet *convert_StdVideoH265VideoParameterSet_array_win32_to_host(struct conversion_context *ctx, const StdVideoH265VideoParameterSet32 *in, uint32_t count) -{ - StdVideoH265VideoParameterSet *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_StdVideoH265VideoParameterSet_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_StdVideoH265SequenceParameterSetVui_win32_to_host(struct conversion_context *ctx, const StdVideoH265SequenceParameterSetVui32 *in, StdVideoH265SequenceParameterSetVui *out) -{ - if (!in) return; - - out->flags = in->flags; - out->aspect_ratio_idc = in->aspect_ratio_idc; - out->sar_width = in->sar_width; - out->sar_height = in->sar_height; - out->video_format = in->video_format; - out->colour_primaries = in->colour_primaries; - out->transfer_characteristics = in->transfer_characteristics; - out->matrix_coeffs = in->matrix_coeffs; - out->chroma_sample_loc_type_top_field = in->chroma_sample_loc_type_top_field; - out->chroma_sample_loc_type_bottom_field = in->chroma_sample_loc_type_bottom_field; - out->reserved1 = in->reserved1; - out->reserved2 = in->reserved2; - out->def_disp_win_left_offset = in->def_disp_win_left_offset; - out->def_disp_win_right_offset = in->def_disp_win_right_offset; - out->def_disp_win_top_offset = in->def_disp_win_top_offset; - out->def_disp_win_bottom_offset = in->def_disp_win_bottom_offset; - out->vui_num_units_in_tick = in->vui_num_units_in_tick; - out->vui_time_scale = in->vui_time_scale; - out->vui_num_ticks_poc_diff_one_minus1 = in->vui_num_ticks_poc_diff_one_minus1; - out->min_spatial_segmentation_idc = in->min_spatial_segmentation_idc; - out->reserved3 = in->reserved3; - out->max_bytes_per_pic_denom = in->max_bytes_per_pic_denom; - out->max_bits_per_min_cu_denom = in->max_bits_per_min_cu_denom; - out->log2_max_mv_length_horizontal = in->log2_max_mv_length_horizontal; - out->log2_max_mv_length_vertical = in->log2_max_mv_length_vertical; - out->pHrdParameters = convert_StdVideoH265HrdParameters_array_win32_to_host(ctx, (const StdVideoH265HrdParameters32 *)UlongToPtr(in->pHrdParameters), 1); -} - -static inline const StdVideoH265SequenceParameterSetVui *convert_StdVideoH265SequenceParameterSetVui_array_win32_to_host(struct conversion_context *ctx, const StdVideoH265SequenceParameterSetVui32 *in, uint32_t count) -{ - StdVideoH265SequenceParameterSetVui *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_StdVideoH265SequenceParameterSetVui_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_StdVideoH265SequenceParameterSet_win32_to_host(struct conversion_context *ctx, const StdVideoH265SequenceParameterSet32 *in, StdVideoH265SequenceParameterSet *out) -{ - if (!in) return; - - out->flags = in->flags; - out->chroma_format_idc = in->chroma_format_idc; - out->pic_width_in_luma_samples = in->pic_width_in_luma_samples; - out->pic_height_in_luma_samples = in->pic_height_in_luma_samples; - out->sps_video_parameter_set_id = in->sps_video_parameter_set_id; - out->sps_max_sub_layers_minus1 = in->sps_max_sub_layers_minus1; - out->sps_seq_parameter_set_id = in->sps_seq_parameter_set_id; - out->bit_depth_luma_minus8 = in->bit_depth_luma_minus8; - out->bit_depth_chroma_minus8 = in->bit_depth_chroma_minus8; - out->log2_max_pic_order_cnt_lsb_minus4 = in->log2_max_pic_order_cnt_lsb_minus4; - out->log2_min_luma_coding_block_size_minus3 = in->log2_min_luma_coding_block_size_minus3; - out->log2_diff_max_min_luma_coding_block_size = in->log2_diff_max_min_luma_coding_block_size; - out->log2_min_luma_transform_block_size_minus2 = in->log2_min_luma_transform_block_size_minus2; - out->log2_diff_max_min_luma_transform_block_size = in->log2_diff_max_min_luma_transform_block_size; - out->max_transform_hierarchy_depth_inter = in->max_transform_hierarchy_depth_inter; - out->max_transform_hierarchy_depth_intra = in->max_transform_hierarchy_depth_intra; - out->num_short_term_ref_pic_sets = in->num_short_term_ref_pic_sets; - out->num_long_term_ref_pics_sps = in->num_long_term_ref_pics_sps; - out->pcm_sample_bit_depth_luma_minus1 = in->pcm_sample_bit_depth_luma_minus1; - out->pcm_sample_bit_depth_chroma_minus1 = in->pcm_sample_bit_depth_chroma_minus1; - out->log2_min_pcm_luma_coding_block_size_minus3 = in->log2_min_pcm_luma_coding_block_size_minus3; - out->log2_diff_max_min_pcm_luma_coding_block_size = in->log2_diff_max_min_pcm_luma_coding_block_size; - out->reserved1 = in->reserved1; - out->reserved2 = in->reserved2; - out->palette_max_size = in->palette_max_size; - out->delta_palette_max_predictor_size = in->delta_palette_max_predictor_size; - out->motion_vector_resolution_control_idc = in->motion_vector_resolution_control_idc; - out->sps_num_palette_predictor_initializers_minus1 = in->sps_num_palette_predictor_initializers_minus1; - out->conf_win_left_offset = in->conf_win_left_offset; - out->conf_win_right_offset = in->conf_win_right_offset; - out->conf_win_top_offset = in->conf_win_top_offset; - out->conf_win_bottom_offset = in->conf_win_bottom_offset; - out->pProfileTierLevel = UlongToPtr(in->pProfileTierLevel); - out->pDecPicBufMgr = UlongToPtr(in->pDecPicBufMgr); - out->pScalingLists = UlongToPtr(in->pScalingLists); - out->pShortTermRefPicSet = UlongToPtr(in->pShortTermRefPicSet); - out->pLongTermRefPicsSps = UlongToPtr(in->pLongTermRefPicsSps); - out->pSequenceParameterSetVui = convert_StdVideoH265SequenceParameterSetVui_array_win32_to_host(ctx, (const StdVideoH265SequenceParameterSetVui32 *)UlongToPtr(in->pSequenceParameterSetVui), 1); - out->pPredictorPaletteEntries = UlongToPtr(in->pPredictorPaletteEntries); -} - -static inline const StdVideoH265SequenceParameterSet *convert_StdVideoH265SequenceParameterSet_array_win32_to_host(struct conversion_context *ctx, const StdVideoH265SequenceParameterSet32 *in, uint32_t count) -{ - StdVideoH265SequenceParameterSet *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_StdVideoH265SequenceParameterSet_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_StdVideoH265PictureParameterSet_win32_to_host(const StdVideoH265PictureParameterSet32 *in, StdVideoH265PictureParameterSet *out) -{ - if (!in) return; - - out->flags = in->flags; - out->pps_pic_parameter_set_id = in->pps_pic_parameter_set_id; - out->pps_seq_parameter_set_id = in->pps_seq_parameter_set_id; - out->sps_video_parameter_set_id = in->sps_video_parameter_set_id; - out->num_extra_slice_header_bits = in->num_extra_slice_header_bits; - out->num_ref_idx_l0_default_active_minus1 = in->num_ref_idx_l0_default_active_minus1; - out->num_ref_idx_l1_default_active_minus1 = in->num_ref_idx_l1_default_active_minus1; - out->init_qp_minus26 = in->init_qp_minus26; - out->diff_cu_qp_delta_depth = in->diff_cu_qp_delta_depth; - out->pps_cb_qp_offset = in->pps_cb_qp_offset; - out->pps_cr_qp_offset = in->pps_cr_qp_offset; - out->pps_beta_offset_div2 = in->pps_beta_offset_div2; - out->pps_tc_offset_div2 = in->pps_tc_offset_div2; - out->log2_parallel_merge_level_minus2 = in->log2_parallel_merge_level_minus2; - out->log2_max_transform_skip_block_size_minus2 = in->log2_max_transform_skip_block_size_minus2; - out->diff_cu_chroma_qp_offset_depth = in->diff_cu_chroma_qp_offset_depth; - out->chroma_qp_offset_list_len_minus1 = in->chroma_qp_offset_list_len_minus1; - memcpy(out->cb_qp_offset_list, in->cb_qp_offset_list, STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE * sizeof(int8_t)); - memcpy(out->cr_qp_offset_list, in->cr_qp_offset_list, STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE * sizeof(int8_t)); - out->log2_sao_offset_scale_luma = in->log2_sao_offset_scale_luma; - out->log2_sao_offset_scale_chroma = in->log2_sao_offset_scale_chroma; - out->pps_act_y_qp_offset_plus5 = in->pps_act_y_qp_offset_plus5; - out->pps_act_cb_qp_offset_plus5 = in->pps_act_cb_qp_offset_plus5; - out->pps_act_cr_qp_offset_plus3 = in->pps_act_cr_qp_offset_plus3; - out->pps_num_palette_predictor_initializers = in->pps_num_palette_predictor_initializers; - out->luma_bit_depth_entry_minus8 = in->luma_bit_depth_entry_minus8; - out->chroma_bit_depth_entry_minus8 = in->chroma_bit_depth_entry_minus8; - out->num_tile_columns_minus1 = in->num_tile_columns_minus1; - out->num_tile_rows_minus1 = in->num_tile_rows_minus1; - out->reserved1 = in->reserved1; - out->reserved2 = in->reserved2; - memcpy(out->column_width_minus1, in->column_width_minus1, STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_COLS_LIST_SIZE * sizeof(uint16_t)); - memcpy(out->row_height_minus1, in->row_height_minus1, STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_ROWS_LIST_SIZE * sizeof(uint16_t)); - out->reserved3 = in->reserved3; - out->pScalingLists = UlongToPtr(in->pScalingLists); - out->pPredictorPaletteEntries = UlongToPtr(in->pPredictorPaletteEntries); -} - -static inline const StdVideoH265PictureParameterSet *convert_StdVideoH265PictureParameterSet_array_win32_to_host(struct conversion_context *ctx, const StdVideoH265PictureParameterSet32 *in, uint32_t count) -{ - StdVideoH265PictureParameterSet *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_StdVideoH265PictureParameterSet_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkVideoDecodeH265SessionParametersAddInfoKHR_win32_to_host(struct conversion_context *ctx, const VkVideoDecodeH265SessionParametersAddInfoKHR32 *in, VkVideoDecodeH265SessionParametersAddInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->stdVPSCount = in->stdVPSCount; - out->pStdVPSs = convert_StdVideoH265VideoParameterSet_array_win32_to_host(ctx, (const StdVideoH265VideoParameterSet32 *)UlongToPtr(in->pStdVPSs), in->stdVPSCount); - out->stdSPSCount = in->stdSPSCount; - out->pStdSPSs = convert_StdVideoH265SequenceParameterSet_array_win32_to_host(ctx, (const StdVideoH265SequenceParameterSet32 *)UlongToPtr(in->pStdSPSs), in->stdSPSCount); - out->stdPPSCount = in->stdPPSCount; - out->pStdPPSs = convert_StdVideoH265PictureParameterSet_array_win32_to_host(ctx, (const StdVideoH265PictureParameterSet32 *)UlongToPtr(in->pStdPPSs), in->stdPPSCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkVideoDecodeH265SessionParametersAddInfoKHR *convert_VkVideoDecodeH265SessionParametersAddInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkVideoDecodeH265SessionParametersAddInfoKHR32 *in, uint32_t count) -{ - VkVideoDecodeH265SessionParametersAddInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkVideoDecodeH265SessionParametersAddInfoKHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_StdVideoAV1SequenceHeader_win32_to_host(const StdVideoAV1SequenceHeader32 *in, StdVideoAV1SequenceHeader *out) -{ - if (!in) return; - - out->flags = in->flags; - out->seq_profile = in->seq_profile; - out->frame_width_bits_minus_1 = in->frame_width_bits_minus_1; - out->frame_height_bits_minus_1 = in->frame_height_bits_minus_1; - out->max_frame_width_minus_1 = in->max_frame_width_minus_1; - out->max_frame_height_minus_1 = in->max_frame_height_minus_1; - out->delta_frame_id_length_minus_2 = in->delta_frame_id_length_minus_2; - out->additional_frame_id_length_minus_1 = in->additional_frame_id_length_minus_1; - out->order_hint_bits_minus_1 = in->order_hint_bits_minus_1; - out->seq_force_integer_mv = in->seq_force_integer_mv; - out->seq_force_screen_content_tools = in->seq_force_screen_content_tools; - memcpy(out->reserved1, in->reserved1, 5 * sizeof(uint8_t)); - out->pColorConfig = UlongToPtr(in->pColorConfig); - out->pTimingInfo = UlongToPtr(in->pTimingInfo); -} - -static inline const StdVideoAV1SequenceHeader *convert_StdVideoAV1SequenceHeader_array_win32_to_host(struct conversion_context *ctx, const StdVideoAV1SequenceHeader32 *in, uint32_t count) -{ - StdVideoAV1SequenceHeader *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_StdVideoAV1SequenceHeader_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkVideoEncodeH264SessionParametersAddInfoKHR_win32_to_host(struct conversion_context *ctx, const VkVideoEncodeH264SessionParametersAddInfoKHR32 *in, VkVideoEncodeH264SessionParametersAddInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->stdSPSCount = in->stdSPSCount; - out->pStdSPSs = convert_StdVideoH264SequenceParameterSet_array_win32_to_host(ctx, (const StdVideoH264SequenceParameterSet32 *)UlongToPtr(in->pStdSPSs), in->stdSPSCount); - out->stdPPSCount = in->stdPPSCount; - out->pStdPPSs = convert_StdVideoH264PictureParameterSet_array_win32_to_host(ctx, (const StdVideoH264PictureParameterSet32 *)UlongToPtr(in->pStdPPSs), in->stdPPSCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkVideoEncodeH264SessionParametersAddInfoKHR *convert_VkVideoEncodeH264SessionParametersAddInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkVideoEncodeH264SessionParametersAddInfoKHR32 *in, uint32_t count) -{ - VkVideoEncodeH264SessionParametersAddInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkVideoEncodeH264SessionParametersAddInfoKHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkVideoEncodeH265SessionParametersAddInfoKHR_win32_to_host(struct conversion_context *ctx, const VkVideoEncodeH265SessionParametersAddInfoKHR32 *in, VkVideoEncodeH265SessionParametersAddInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->stdVPSCount = in->stdVPSCount; - out->pStdVPSs = convert_StdVideoH265VideoParameterSet_array_win32_to_host(ctx, (const StdVideoH265VideoParameterSet32 *)UlongToPtr(in->pStdVPSs), in->stdVPSCount); - out->stdSPSCount = in->stdSPSCount; - out->pStdSPSs = convert_StdVideoH265SequenceParameterSet_array_win32_to_host(ctx, (const StdVideoH265SequenceParameterSet32 *)UlongToPtr(in->pStdSPSs), in->stdSPSCount); - out->stdPPSCount = in->stdPPSCount; - out->pStdPPSs = convert_StdVideoH265PictureParameterSet_array_win32_to_host(ctx, (const StdVideoH265PictureParameterSet32 *)UlongToPtr(in->pStdPPSs), in->stdPPSCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkVideoEncodeH265SessionParametersAddInfoKHR *convert_VkVideoEncodeH265SessionParametersAddInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkVideoEncodeH265SessionParametersAddInfoKHR32 *in, uint32_t count) -{ - VkVideoEncodeH265SessionParametersAddInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkVideoEncodeH265SessionParametersAddInfoKHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkVideoSessionParametersCreateInfoKHR_win32_to_host(struct conversion_context *ctx, const VkVideoSessionParametersCreateInfoKHR32 *in, VkVideoSessionParametersCreateInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->videoSessionParametersTemplate = in->videoSessionParametersTemplate; - out->videoSession = in->videoSession; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR: - { - VkVideoDecodeH264SessionParametersCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeH264SessionParametersCreateInfoKHR32 *in_ext = (const VkVideoDecodeH264SessionParametersCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->maxStdSPSCount = in_ext->maxStdSPSCount; - out_ext->maxStdPPSCount = in_ext->maxStdPPSCount; - out_ext->pParametersAddInfo = convert_VkVideoDecodeH264SessionParametersAddInfoKHR_array_win32_to_host(ctx, (const VkVideoDecodeH264SessionParametersAddInfoKHR32 *)UlongToPtr(in_ext->pParametersAddInfo), 1); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR: - { - VkVideoDecodeH265SessionParametersCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeH265SessionParametersCreateInfoKHR32 *in_ext = (const VkVideoDecodeH265SessionParametersCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->maxStdVPSCount = in_ext->maxStdVPSCount; - out_ext->maxStdSPSCount = in_ext->maxStdSPSCount; - out_ext->maxStdPPSCount = in_ext->maxStdPPSCount; - out_ext->pParametersAddInfo = convert_VkVideoDecodeH265SessionParametersAddInfoKHR_array_win32_to_host(ctx, (const VkVideoDecodeH265SessionParametersAddInfoKHR32 *)UlongToPtr(in_ext->pParametersAddInfo), 1); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_SESSION_PARAMETERS_CREATE_INFO_KHR: - { - VkVideoDecodeAV1SessionParametersCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeAV1SessionParametersCreateInfoKHR32 *in_ext = (const VkVideoDecodeAV1SessionParametersCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_SESSION_PARAMETERS_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->pStdSequenceHeader = convert_StdVideoAV1SequenceHeader_array_win32_to_host(ctx, (const StdVideoAV1SequenceHeader32 *)UlongToPtr(in_ext->pStdSequenceHeader), 1); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_SESSION_PARAMETERS_CREATE_INFO_KHR: - { - VkVideoEncodeQuantizationMapSessionParametersCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeQuantizationMapSessionParametersCreateInfoKHR32 *in_ext = (const VkVideoEncodeQuantizationMapSessionParametersCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_SESSION_PARAMETERS_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->quantizationMapTexelSize = in_ext->quantizationMapTexelSize; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_INFO_KHR: - { - VkVideoEncodeQualityLevelInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeQualityLevelInfoKHR32 *in_ext = (const VkVideoEncodeQualityLevelInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_INFO_KHR; - out_ext->pNext = NULL; - out_ext->qualityLevel = in_ext->qualityLevel; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR: - { - VkVideoEncodeH264SessionParametersCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH264SessionParametersCreateInfoKHR32 *in_ext = (const VkVideoEncodeH264SessionParametersCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->maxStdSPSCount = in_ext->maxStdSPSCount; - out_ext->maxStdPPSCount = in_ext->maxStdPPSCount; - out_ext->pParametersAddInfo = convert_VkVideoEncodeH264SessionParametersAddInfoKHR_array_win32_to_host(ctx, (const VkVideoEncodeH264SessionParametersAddInfoKHR32 *)UlongToPtr(in_ext->pParametersAddInfo), 1); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR: - { - VkVideoEncodeH265SessionParametersCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH265SessionParametersCreateInfoKHR32 *in_ext = (const VkVideoEncodeH265SessionParametersCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->maxStdVPSCount = in_ext->maxStdVPSCount; - out_ext->maxStdSPSCount = in_ext->maxStdSPSCount; - out_ext->maxStdPPSCount = in_ext->maxStdPPSCount; - out_ext->pParametersAddInfo = convert_VkVideoEncodeH265SessionParametersAddInfoKHR_array_win32_to_host(ctx, (const VkVideoEncodeH265SessionParametersAddInfoKHR32 *)UlongToPtr(in_ext->pParametersAddInfo), 1); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_SESSION_PARAMETERS_CREATE_INFO_KHR: - { - VkVideoEncodeAV1SessionParametersCreateInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeAV1SessionParametersCreateInfoKHR32 *in_ext = (const VkVideoEncodeAV1SessionParametersCreateInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_SESSION_PARAMETERS_CREATE_INFO_KHR; - out_ext->pNext = NULL; - out_ext->pStdSequenceHeader = convert_StdVideoAV1SequenceHeader_array_win32_to_host(ctx, (const StdVideoAV1SequenceHeader32 *)UlongToPtr(in_ext->pStdSequenceHeader), 1); - out_ext->pStdDecoderModelInfo = UlongToPtr(in_ext->pStdDecoderModelInfo); - out_ext->stdOperatingPointCount = in_ext->stdOperatingPointCount; - out_ext->pStdOperatingPoints = UlongToPtr(in_ext->pStdOperatingPoints); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkWin32SurfaceCreateInfoKHR_win32_to_host(const VkWin32SurfaceCreateInfoKHR32 *in, VkWin32SurfaceCreateInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->hinstance = (HINSTANCE)UlongToPtr(in->hinstance); - out->hwnd = (HWND)UlongToPtr(in->hwnd); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline void convert_VkDebugMarkerObjectNameInfoEXT_win64_to_host(const VkDebugMarkerObjectNameInfoEXT *in, VkDebugMarkerObjectNameInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->objectType = in->objectType; - out->object = wine_vk_unwrap_handle(in->objectType, in->object); - out->pObjectName = in->pObjectName; -} -#endif /* _WIN64 */ - -static inline void convert_VkDebugMarkerObjectNameInfoEXT_win32_to_host(const VkDebugMarkerObjectNameInfoEXT32 *in, VkDebugMarkerObjectNameInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->objectType = in->objectType; - out->object = wine_vk_unwrap_handle(in->objectType, in->object); - out->pObjectName = UlongToPtr(in->pObjectName); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline void convert_VkDebugMarkerObjectTagInfoEXT_win64_to_host(const VkDebugMarkerObjectTagInfoEXT *in, VkDebugMarkerObjectTagInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->objectType = in->objectType; - out->object = wine_vk_unwrap_handle(in->objectType, in->object); - out->tagName = in->tagName; - out->tagSize = in->tagSize; - out->pTag = in->pTag; -} -#endif /* _WIN64 */ - -static inline void convert_VkDebugMarkerObjectTagInfoEXT_win32_to_host(const VkDebugMarkerObjectTagInfoEXT32 *in, VkDebugMarkerObjectTagInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->objectType = in->objectType; - out->object = wine_vk_unwrap_handle(in->objectType, in->object); - out->tagName = in->tagName; - out->tagSize = in->tagSize; - out->pTag = UlongToPtr(in->pTag); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPhysicalDevice_array_unwrapped_host_to_win32(const VkPhysicalDevice *in, PTR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - out[i] = PtrToUlong(in[i]); - } -} - -static inline void convert_VkPhysicalDeviceGroupProperties_win32_to_unwrapped_host(const VkPhysicalDeviceGroupProperties32 *in, VkPhysicalDeviceGroupProperties *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPhysicalDeviceGroupProperties_unwrapped_host_to_win32(const VkPhysicalDeviceGroupProperties *in, VkPhysicalDeviceGroupProperties32 *out) -{ - if (!in) return; - - out->physicalDeviceCount = in->physicalDeviceCount; - convert_VkPhysicalDevice_array_unwrapped_host_to_win32(in->physicalDevices, out->physicalDevices, VK_MAX_DEVICE_GROUP_SIZE); - out->subsetAllocation = in->subsetAllocation; -} - -static inline VkPhysicalDeviceGroupProperties *convert_VkPhysicalDeviceGroupProperties_array_win32_to_unwrapped_host(struct conversion_context *ctx, const VkPhysicalDeviceGroupProperties32 *in, uint32_t count) -{ - VkPhysicalDeviceGroupProperties *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPhysicalDeviceGroupProperties_win32_to_unwrapped_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPhysicalDeviceGroupProperties_array_unwrapped_host_to_win32(const VkPhysicalDeviceGroupProperties *in, VkPhysicalDeviceGroupProperties32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkPhysicalDeviceGroupProperties_unwrapped_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPerformanceCounterKHR_win32_to_host(const VkPerformanceCounterKHR32 *in, VkPerformanceCounterKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPerformanceCounterKHR_host_to_win32(const VkPerformanceCounterKHR *in, VkPerformanceCounterKHR32 *out) -{ - if (!in) return; - - out->unit = in->unit; - out->scope = in->scope; - out->storage = in->storage; - memcpy(out->uuid, in->uuid, VK_UUID_SIZE * sizeof(uint8_t)); -} - -static inline VkPerformanceCounterKHR *convert_VkPerformanceCounterKHR_array_win32_to_host(struct conversion_context *ctx, const VkPerformanceCounterKHR32 *in, uint32_t count) -{ - VkPerformanceCounterKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPerformanceCounterKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPerformanceCounterKHR_array_host_to_win32(const VkPerformanceCounterKHR *in, VkPerformanceCounterKHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkPerformanceCounterKHR_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPerformanceCounterDescriptionKHR_win32_to_host(const VkPerformanceCounterDescriptionKHR32 *in, VkPerformanceCounterDescriptionKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPerformanceCounterDescriptionKHR_host_to_win32(const VkPerformanceCounterDescriptionKHR *in, VkPerformanceCounterDescriptionKHR32 *out) -{ - if (!in) return; - - out->flags = in->flags; - memcpy(out->name, in->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - memcpy(out->category, in->category, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - memcpy(out->description, in->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); -} - -static inline VkPerformanceCounterDescriptionKHR *convert_VkPerformanceCounterDescriptionKHR_array_win32_to_host(struct conversion_context *ctx, const VkPerformanceCounterDescriptionKHR32 *in, uint32_t count) -{ - VkPerformanceCounterDescriptionKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPerformanceCounterDescriptionKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPerformanceCounterDescriptionKHR_array_host_to_win32(const VkPerformanceCounterDescriptionKHR *in, VkPerformanceCounterDescriptionKHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkPerformanceCounterDescriptionKHR_host_to_win32(&in[i], &out[i]); - } -} - -#ifdef _WIN64 -static inline void convert_VkMappedMemoryRange_win64_to_host(const VkMappedMemoryRange *in, VkMappedMemoryRange *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->memory = wine_device_memory_from_handle(in->memory)->host.device_memory; - out->offset = in->offset; - out->size = in->size; -} -#endif /* _WIN64 */ - -static inline void convert_VkMappedMemoryRange_win32_to_host(const VkMappedMemoryRange32 *in, VkMappedMemoryRange *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->memory = wine_device_memory_from_handle(in->memory)->host.device_memory; - out->offset = in->offset; - out->size = in->size; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline const VkMappedMemoryRange *convert_VkMappedMemoryRange_array_win64_to_host(struct conversion_context *ctx, const VkMappedMemoryRange *in, uint32_t count) -{ - VkMappedMemoryRange *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkMappedMemoryRange_win64_to_host(&in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkMappedMemoryRange *convert_VkMappedMemoryRange_array_win32_to_host(struct conversion_context *ctx, const VkMappedMemoryRange32 *in, uint32_t count) -{ - VkMappedMemoryRange *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkMappedMemoryRange_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkAccelerationStructureBuildSizesInfoKHR_win32_to_host(const VkAccelerationStructureBuildSizesInfoKHR32 *in, VkAccelerationStructureBuildSizesInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkAccelerationStructureBuildSizesInfoKHR_host_to_win32(const VkAccelerationStructureBuildSizesInfoKHR *in, VkAccelerationStructureBuildSizesInfoKHR32 *out) -{ - if (!in) return; - - out->accelerationStructureSize = in->accelerationStructureSize; - out->updateScratchSize = in->updateScratchSize; - out->buildScratchSize = in->buildScratchSize; -} - -static inline void convert_VkAccelerationStructureDeviceAddressInfoKHR_win32_to_host(const VkAccelerationStructureDeviceAddressInfoKHR32 *in, VkAccelerationStructureDeviceAddressInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->accelerationStructure = in->accelerationStructure; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkAccelerationStructureMemoryRequirementsInfoNV_win32_to_host(const VkAccelerationStructureMemoryRequirementsInfoNV32 *in, VkAccelerationStructureMemoryRequirementsInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - out->accelerationStructure = in->accelerationStructure; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMemoryRequirements_host_to_win32(const VkMemoryRequirements *in, VkMemoryRequirements32 *out) -{ - if (!in) return; - - out->size = in->size; - out->alignment = in->alignment; - out->memoryTypeBits = in->memoryTypeBits; -} - -static inline void convert_VkMemoryRequirements2KHR_win32_to_host(const VkMemoryRequirements2KHR32 *in, VkMemoryRequirements2KHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMemoryRequirements2KHR_host_to_win32(const VkMemoryRequirements2KHR *in, VkMemoryRequirements2KHR32 *out) -{ - if (!in) return; - - convert_VkMemoryRequirements_host_to_win32(&in->memoryRequirements, &out->memoryRequirements); -} - -static inline void convert_VkAccelerationStructureCaptureDescriptorDataInfoEXT_win32_to_host(const VkAccelerationStructureCaptureDescriptorDataInfoEXT32 *in, VkAccelerationStructureCaptureDescriptorDataInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->accelerationStructure = in->accelerationStructure; - out->accelerationStructureNV = in->accelerationStructureNV; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkBufferDeviceAddressInfo_win32_to_host(const VkBufferDeviceAddressInfo32 *in, VkBufferDeviceAddressInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->buffer = in->buffer; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkBufferMemoryRequirementsInfo2_win32_to_host(const VkBufferMemoryRequirementsInfo232 *in, VkBufferMemoryRequirementsInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->buffer = in->buffer; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMemoryRequirements2_win32_to_host(struct conversion_context *ctx, const VkMemoryRequirements232 *in, VkMemoryRequirements2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: - { - VkMemoryDedicatedRequirements *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkMemoryRequirements2_host_to_win32(const VkMemoryRequirements2 *in, VkMemoryRequirements232 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - convert_VkMemoryRequirements_host_to_win32(&in->memoryRequirements, &out->memoryRequirements); - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: - { - VkMemoryDedicatedRequirements32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS); - const VkMemoryDedicatedRequirements *in_ext = (const VkMemoryDedicatedRequirements *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS; - out_ext->prefersDedicatedAllocation = in_ext->prefersDedicatedAllocation; - out_ext->requiresDedicatedAllocation = in_ext->requiresDedicatedAllocation; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline void convert_VkBufferCaptureDescriptorDataInfoEXT_win32_to_host(const VkBufferCaptureDescriptorDataInfoEXT32 *in, VkBufferCaptureDescriptorDataInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->buffer = in->buffer; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCalibratedTimestampInfoKHR_win32_to_host(const VkCalibratedTimestampInfoKHR32 *in, VkCalibratedTimestampInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->timeDomain = in->timeDomain; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkCalibratedTimestampInfoKHR *convert_VkCalibratedTimestampInfoKHR_array_win32_to_host(struct conversion_context *ctx, const VkCalibratedTimestampInfoKHR32 *in, uint32_t count) -{ - VkCalibratedTimestampInfoKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCalibratedTimestampInfoKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDescriptorAddressInfoEXT_win32_to_host(const VkDescriptorAddressInfoEXT32 *in, VkDescriptorAddressInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->address = in->address; - out->range = in->range; - out->format = in->format; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkDescriptorAddressInfoEXT *convert_VkDescriptorAddressInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkDescriptorAddressInfoEXT32 *in, uint32_t count) -{ - VkDescriptorAddressInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDescriptorAddressInfoEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDescriptorDataEXT_win32_to_host(struct conversion_context *ctx, const VkDescriptorDataEXT32 *in, VkDescriptorDataEXT *out, VkFlags selector) -{ - if (!in) return; - - if (selector == VK_DESCRIPTOR_TYPE_SAMPLER) - out->pSampler = UlongToPtr(in->pSampler); - if (selector == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) - out->pCombinedImageSampler = convert_VkDescriptorImageInfo_array_win32_to_host(ctx, (const VkDescriptorImageInfo32 *)UlongToPtr(in->pCombinedImageSampler), 1); - if (selector == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT) - out->pInputAttachmentImage = convert_VkDescriptorImageInfo_array_win32_to_host(ctx, (const VkDescriptorImageInfo32 *)UlongToPtr(in->pInputAttachmentImage), 1); - if (selector == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE) - out->pSampledImage = convert_VkDescriptorImageInfo_array_win32_to_host(ctx, (const VkDescriptorImageInfo32 *)UlongToPtr(in->pSampledImage), 1); - if (selector == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) - out->pStorageImage = convert_VkDescriptorImageInfo_array_win32_to_host(ctx, (const VkDescriptorImageInfo32 *)UlongToPtr(in->pStorageImage), 1); - if (selector == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER) - out->pUniformTexelBuffer = convert_VkDescriptorAddressInfoEXT_array_win32_to_host(ctx, (const VkDescriptorAddressInfoEXT32 *)UlongToPtr(in->pUniformTexelBuffer), 1); - if (selector == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER) - out->pStorageTexelBuffer = convert_VkDescriptorAddressInfoEXT_array_win32_to_host(ctx, (const VkDescriptorAddressInfoEXT32 *)UlongToPtr(in->pStorageTexelBuffer), 1); - if (selector == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) - out->pUniformBuffer = convert_VkDescriptorAddressInfoEXT_array_win32_to_host(ctx, (const VkDescriptorAddressInfoEXT32 *)UlongToPtr(in->pUniformBuffer), 1); - if (selector == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) - out->pStorageBuffer = convert_VkDescriptorAddressInfoEXT_array_win32_to_host(ctx, (const VkDescriptorAddressInfoEXT32 *)UlongToPtr(in->pStorageBuffer), 1); - if (selector == VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR || selector == VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV) - out->accelerationStructure = in->accelerationStructure; -} - -static inline void convert_VkDescriptorGetInfoEXT_win32_to_host(struct conversion_context *ctx, const VkDescriptorGetInfoEXT32 *in, VkDescriptorGetInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->type = in->type; - convert_VkDescriptorDataEXT_win32_to_host(ctx, &in->data, &out->data, in->type); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDescriptorSetBindingReferenceVALVE_win32_to_host(const VkDescriptorSetBindingReferenceVALVE32 *in, VkDescriptorSetBindingReferenceVALVE *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->descriptorSetLayout = in->descriptorSetLayout; - out->binding = in->binding; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDescriptorSetLayoutHostMappingInfoVALVE_win32_to_host(const VkDescriptorSetLayoutHostMappingInfoVALVE32 *in, VkDescriptorSetLayoutHostMappingInfoVALVE *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->descriptorOffset = in->descriptorOffset; - out->descriptorSize = in->descriptorSize; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDescriptorSetLayoutHostMappingInfoVALVE_host_to_win32(const VkDescriptorSetLayoutHostMappingInfoVALVE *in, VkDescriptorSetLayoutHostMappingInfoVALVE32 *out) -{ - if (!in) return; - - out->descriptorOffset = in->descriptorOffset; - out->descriptorSize = in->descriptorSize; -} - -static inline void convert_VkDescriptorSetLayoutSupport_win32_to_host(struct conversion_context *ctx, const VkDescriptorSetLayoutSupport32 *in, VkDescriptorSetLayoutSupport *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: - { - VkDescriptorSetVariableDescriptorCountLayoutSupport *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkDescriptorSetLayoutSupport_host_to_win32(const VkDescriptorSetLayoutSupport *in, VkDescriptorSetLayoutSupport32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - out->supported = in->supported; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: - { - VkDescriptorSetVariableDescriptorCountLayoutSupport32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT); - const VkDescriptorSetVariableDescriptorCountLayoutSupport *in_ext = (const VkDescriptorSetVariableDescriptorCountLayoutSupport *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT; - out_ext->maxVariableDescriptorCount = in_ext->maxVariableDescriptorCount; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline void convert_VkAccelerationStructureVersionInfoKHR_win32_to_host(const VkAccelerationStructureVersionInfoKHR32 *in, VkAccelerationStructureVersionInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pVersionData = UlongToPtr(in->pVersionData); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkBufferCreateInfo *convert_VkBufferCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkBufferCreateInfo32 *in, uint32_t count) -{ - VkBufferCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBufferCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDeviceBufferMemoryRequirements_win32_to_host(struct conversion_context *ctx, const VkDeviceBufferMemoryRequirements32 *in, VkDeviceBufferMemoryRequirements *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pCreateInfo = convert_VkBufferCreateInfo_array_win32_to_host(ctx, (const VkBufferCreateInfo32 *)UlongToPtr(in->pCreateInfo), 1); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDeviceFaultCountsEXT_win32_to_host(const VkDeviceFaultCountsEXT32 *in, VkDeviceFaultCountsEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->addressInfoCount = in->addressInfoCount; - out->vendorInfoCount = in->vendorInfoCount; - out->vendorBinarySize = in->vendorBinarySize; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDeviceFaultCountsEXT_host_to_win32(const VkDeviceFaultCountsEXT *in, VkDeviceFaultCountsEXT32 *out) -{ - if (!in) return; - - out->addressInfoCount = in->addressInfoCount; - out->vendorInfoCount = in->vendorInfoCount; - out->vendorBinarySize = in->vendorBinarySize; -} - -static inline void convert_VkDeviceFaultAddressInfoEXT_win32_to_host(const VkDeviceFaultAddressInfoEXT32 *in, VkDeviceFaultAddressInfoEXT *out) -{ - if (!in) return; - - out->addressType = in->addressType; - out->reportedAddress = in->reportedAddress; - out->addressPrecision = in->addressPrecision; -} - -static inline void convert_VkDeviceFaultAddressInfoEXT_host_to_win32(const VkDeviceFaultAddressInfoEXT *in, VkDeviceFaultAddressInfoEXT32 *out) -{ - if (!in) return; - - out->addressType = in->addressType; - out->reportedAddress = in->reportedAddress; - out->addressPrecision = in->addressPrecision; -} - -static inline VkDeviceFaultAddressInfoEXT *convert_VkDeviceFaultAddressInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkDeviceFaultAddressInfoEXT32 *in, uint32_t count) -{ - VkDeviceFaultAddressInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDeviceFaultAddressInfoEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDeviceFaultAddressInfoEXT_array_host_to_win32(const VkDeviceFaultAddressInfoEXT *in, VkDeviceFaultAddressInfoEXT32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkDeviceFaultAddressInfoEXT_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkDeviceFaultVendorInfoEXT_win32_to_host(const VkDeviceFaultVendorInfoEXT32 *in, VkDeviceFaultVendorInfoEXT *out) -{ - if (!in) return; - - memcpy(out->description, in->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - out->vendorFaultCode = in->vendorFaultCode; - out->vendorFaultData = in->vendorFaultData; -} - -static inline void convert_VkDeviceFaultVendorInfoEXT_host_to_win32(const VkDeviceFaultVendorInfoEXT *in, VkDeviceFaultVendorInfoEXT32 *out) -{ - if (!in) return; - - memcpy(out->description, in->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - out->vendorFaultCode = in->vendorFaultCode; - out->vendorFaultData = in->vendorFaultData; -} - -static inline VkDeviceFaultVendorInfoEXT *convert_VkDeviceFaultVendorInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkDeviceFaultVendorInfoEXT32 *in, uint32_t count) -{ - VkDeviceFaultVendorInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDeviceFaultVendorInfoEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkDeviceFaultVendorInfoEXT_array_host_to_win32(const VkDeviceFaultVendorInfoEXT *in, VkDeviceFaultVendorInfoEXT32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkDeviceFaultVendorInfoEXT_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkDeviceFaultInfoEXT_win32_to_host(struct conversion_context *ctx, const VkDeviceFaultInfoEXT32 *in, VkDeviceFaultInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pAddressInfos = convert_VkDeviceFaultAddressInfoEXT_array_win32_to_host(ctx, (VkDeviceFaultAddressInfoEXT32 *)UlongToPtr(in->pAddressInfos), 1); - out->pVendorInfos = convert_VkDeviceFaultVendorInfoEXT_array_win32_to_host(ctx, (VkDeviceFaultVendorInfoEXT32 *)UlongToPtr(in->pVendorInfos), 1); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDeviceFaultInfoEXT_host_to_win32(const VkDeviceFaultInfoEXT *in, VkDeviceFaultInfoEXT32 *out) -{ - if (!in) return; - - memcpy(out->description, in->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - convert_VkDeviceFaultAddressInfoEXT_array_host_to_win32(in->pAddressInfos, (VkDeviceFaultAddressInfoEXT32 *)UlongToPtr(out->pAddressInfos), 1); - convert_VkDeviceFaultVendorInfoEXT_array_host_to_win32(in->pVendorInfos, (VkDeviceFaultVendorInfoEXT32 *)UlongToPtr(out->pVendorInfos), 1); - out->pVendorBinaryData = PtrToUlong(in->pVendorBinaryData); -} - -static inline void convert_VkDeviceGroupPresentCapabilitiesKHR_win32_to_host(const VkDeviceGroupPresentCapabilitiesKHR32 *in, VkDeviceGroupPresentCapabilitiesKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDeviceGroupPresentCapabilitiesKHR_host_to_win32(const VkDeviceGroupPresentCapabilitiesKHR *in, VkDeviceGroupPresentCapabilitiesKHR32 *out) -{ - if (!in) return; - - memcpy(out->presentMask, in->presentMask, VK_MAX_DEVICE_GROUP_SIZE * sizeof(uint32_t)); - out->modes = in->modes; -} - -#ifdef _WIN64 -static inline const VkImageCreateInfo *convert_VkImageCreateInfo_array_win64_to_host(struct conversion_context *ctx, const VkImageCreateInfo *in, uint32_t count) -{ - VkImageCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkImageCreateInfo_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkImageCreateInfo *convert_VkImageCreateInfo_array_win32_to_host(struct conversion_context *ctx, const VkImageCreateInfo32 *in, uint32_t count) -{ - VkImageCreateInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkImageCreateInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkDeviceImageMemoryRequirements_win64_to_host(struct conversion_context *ctx, const VkDeviceImageMemoryRequirements *in, VkDeviceImageMemoryRequirements *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->pCreateInfo = convert_VkImageCreateInfo_array_win64_to_host(ctx, in->pCreateInfo, 1); - out->planeAspect = in->planeAspect; -} -#endif /* _WIN64 */ - -static inline void convert_VkDeviceImageMemoryRequirements_win32_to_host(struct conversion_context *ctx, const VkDeviceImageMemoryRequirements32 *in, VkDeviceImageMemoryRequirements *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pCreateInfo = convert_VkImageCreateInfo_array_win32_to_host(ctx, (const VkImageCreateInfo32 *)UlongToPtr(in->pCreateInfo), 1); - out->planeAspect = in->planeAspect; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkSparseImageMemoryRequirements_host_to_win32(const VkSparseImageMemoryRequirements *in, VkSparseImageMemoryRequirements32 *out) -{ - if (!in) return; - - out->formatProperties = in->formatProperties; - out->imageMipTailFirstLod = in->imageMipTailFirstLod; - out->imageMipTailSize = in->imageMipTailSize; - out->imageMipTailOffset = in->imageMipTailOffset; - out->imageMipTailStride = in->imageMipTailStride; -} - -static inline void convert_VkSparseImageMemoryRequirements2_win32_to_host(const VkSparseImageMemoryRequirements232 *in, VkSparseImageMemoryRequirements2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkSparseImageMemoryRequirements2_host_to_win32(const VkSparseImageMemoryRequirements2 *in, VkSparseImageMemoryRequirements232 *out) -{ - if (!in) return; - - convert_VkSparseImageMemoryRequirements_host_to_win32(&in->memoryRequirements, &out->memoryRequirements); -} - -static inline VkSparseImageMemoryRequirements2 *convert_VkSparseImageMemoryRequirements2_array_win32_to_host(struct conversion_context *ctx, const VkSparseImageMemoryRequirements232 *in, uint32_t count) -{ - VkSparseImageMemoryRequirements2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseImageMemoryRequirements2_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSparseImageMemoryRequirements2_array_host_to_win32(const VkSparseImageMemoryRequirements2 *in, VkSparseImageMemoryRequirements232 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkSparseImageMemoryRequirements2_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkImageSubresource2_win32_to_host(const VkImageSubresource232 *in, VkImageSubresource2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->imageSubresource = in->imageSubresource; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkImageSubresource2 *convert_VkImageSubresource2_array_win32_to_host(struct conversion_context *ctx, const VkImageSubresource232 *in, uint32_t count) -{ - VkImageSubresource2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkImageSubresource2_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkDeviceImageSubresourceInfo_win64_to_host(struct conversion_context *ctx, const VkDeviceImageSubresourceInfo *in, VkDeviceImageSubresourceInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->pCreateInfo = convert_VkImageCreateInfo_array_win64_to_host(ctx, in->pCreateInfo, 1); - out->pSubresource = in->pSubresource; -} -#endif /* _WIN64 */ - -static inline void convert_VkDeviceImageSubresourceInfo_win32_to_host(struct conversion_context *ctx, const VkDeviceImageSubresourceInfo32 *in, VkDeviceImageSubresourceInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pCreateInfo = convert_VkImageCreateInfo_array_win32_to_host(ctx, (const VkImageCreateInfo32 *)UlongToPtr(in->pCreateInfo), 1); - out->pSubresource = convert_VkImageSubresource2_array_win32_to_host(ctx, (const VkImageSubresource232 *)UlongToPtr(in->pSubresource), 1); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkSubresourceLayout_win32_to_host(const VkSubresourceLayout32 *in, VkSubresourceLayout *out) -{ - if (!in) return; - - out->offset = in->offset; - out->size = in->size; - out->rowPitch = in->rowPitch; - out->arrayPitch = in->arrayPitch; - out->depthPitch = in->depthPitch; -} - -static inline void convert_VkSubresourceLayout_host_to_win32(const VkSubresourceLayout *in, VkSubresourceLayout32 *out) -{ - if (!in) return; - - out->offset = in->offset; - out->size = in->size; - out->rowPitch = in->rowPitch; - out->arrayPitch = in->arrayPitch; - out->depthPitch = in->depthPitch; -} - -static inline void convert_VkSubresourceLayout2_win32_to_host(struct conversion_context *ctx, const VkSubresourceLayout232 *in, VkSubresourceLayout2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE: - { - VkSubresourceHostMemcpySize *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT: - { - VkImageCompressionPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSubresourceLayout2_host_to_win32(const VkSubresourceLayout2 *in, VkSubresourceLayout232 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - convert_VkSubresourceLayout_host_to_win32(&in->subresourceLayout, &out->subresourceLayout); - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE: - { - VkSubresourceHostMemcpySize32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE); - const VkSubresourceHostMemcpySize *in_ext = (const VkSubresourceHostMemcpySize *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE; - out_ext->size = in_ext->size; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT: - { - VkImageCompressionPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT); - const VkImageCompressionPropertiesEXT *in_ext = (const VkImageCompressionPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT; - out_ext->imageCompressionFlags = in_ext->imageCompressionFlags; - out_ext->imageCompressionFixedRateFlags = in_ext->imageCompressionFixedRateFlags; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -#ifdef _WIN64 -static inline void convert_VkDeviceMemoryOpaqueCaptureAddressInfo_win64_to_host(const VkDeviceMemoryOpaqueCaptureAddressInfo *in, VkDeviceMemoryOpaqueCaptureAddressInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->memory = wine_device_memory_from_handle(in->memory)->host.device_memory; -} -#endif /* _WIN64 */ - -static inline void convert_VkDeviceMemoryOpaqueCaptureAddressInfo_win32_to_host(const VkDeviceMemoryOpaqueCaptureAddressInfo32 *in, VkDeviceMemoryOpaqueCaptureAddressInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->memory = wine_device_memory_from_handle(in->memory)->host.device_memory; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMicromapVersionInfoEXT_win32_to_host(const VkMicromapVersionInfoEXT32 *in, VkMicromapVersionInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pVersionData = UlongToPtr(in->pVersionData); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkDeviceQueueInfo2_win32_to_host(const VkDeviceQueueInfo232 *in, VkDeviceQueueInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->queueFamilyIndex = in->queueFamilyIndex; - out->queueIndex = in->queueIndex; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkTilePropertiesQCOM_win32_to_host(const VkTilePropertiesQCOM32 *in, VkTilePropertiesQCOM *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->tileSize = in->tileSize; - out->apronSize = in->apronSize; - out->origin = in->origin; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkTilePropertiesQCOM_host_to_win32(const VkTilePropertiesQCOM *in, VkTilePropertiesQCOM32 *out) -{ - if (!in) return; - - out->tileSize = in->tileSize; - out->apronSize = in->apronSize; - out->origin = in->origin; -} - -static inline void convert_VkVideoEncodeSessionParametersGetInfoKHR_win32_to_host(struct conversion_context *ctx, const VkVideoEncodeSessionParametersGetInfoKHR32 *in, VkVideoEncodeSessionParametersGetInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->videoSessionParameters = in->videoSessionParameters; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_GET_INFO_KHR: - { - VkVideoEncodeH264SessionParametersGetInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH264SessionParametersGetInfoKHR32 *in_ext = (const VkVideoEncodeH264SessionParametersGetInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_GET_INFO_KHR; - out_ext->pNext = NULL; - out_ext->writeStdSPS = in_ext->writeStdSPS; - out_ext->writeStdPPS = in_ext->writeStdPPS; - out_ext->stdSPSId = in_ext->stdSPSId; - out_ext->stdPPSId = in_ext->stdPPSId; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_GET_INFO_KHR: - { - VkVideoEncodeH265SessionParametersGetInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH265SessionParametersGetInfoKHR32 *in_ext = (const VkVideoEncodeH265SessionParametersGetInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_GET_INFO_KHR; - out_ext->pNext = NULL; - out_ext->writeStdVPS = in_ext->writeStdVPS; - out_ext->writeStdSPS = in_ext->writeStdSPS; - out_ext->writeStdPPS = in_ext->writeStdPPS; - out_ext->stdVPSId = in_ext->stdVPSId; - out_ext->stdSPSId = in_ext->stdSPSId; - out_ext->stdPPSId = in_ext->stdPPSId; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkVideoEncodeSessionParametersFeedbackInfoKHR_win32_to_host(struct conversion_context *ctx, const VkVideoEncodeSessionParametersFeedbackInfoKHR32 *in, VkVideoEncodeSessionParametersFeedbackInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_FEEDBACK_INFO_KHR: - { - VkVideoEncodeH264SessionParametersFeedbackInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_FEEDBACK_INFO_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_FEEDBACK_INFO_KHR: - { - VkVideoEncodeH265SessionParametersFeedbackInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_FEEDBACK_INFO_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkVideoEncodeSessionParametersFeedbackInfoKHR_host_to_win32(const VkVideoEncodeSessionParametersFeedbackInfoKHR *in, VkVideoEncodeSessionParametersFeedbackInfoKHR32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - out->hasOverrides = in->hasOverrides; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_FEEDBACK_INFO_KHR: - { - VkVideoEncodeH264SessionParametersFeedbackInfoKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_FEEDBACK_INFO_KHR); - const VkVideoEncodeH264SessionParametersFeedbackInfoKHR *in_ext = (const VkVideoEncodeH264SessionParametersFeedbackInfoKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_FEEDBACK_INFO_KHR; - out_ext->hasStdSPSOverrides = in_ext->hasStdSPSOverrides; - out_ext->hasStdPPSOverrides = in_ext->hasStdPPSOverrides; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_FEEDBACK_INFO_KHR: - { - VkVideoEncodeH265SessionParametersFeedbackInfoKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_FEEDBACK_INFO_KHR); - const VkVideoEncodeH265SessionParametersFeedbackInfoKHR *in_ext = (const VkVideoEncodeH265SessionParametersFeedbackInfoKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_FEEDBACK_INFO_KHR; - out_ext->hasStdVPSOverrides = in_ext->hasStdVPSOverrides; - out_ext->hasStdSPSOverrides = in_ext->hasStdSPSOverrides; - out_ext->hasStdPPSOverrides = in_ext->hasStdPPSOverrides; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline VkTilePropertiesQCOM *convert_VkTilePropertiesQCOM_array_win32_to_host(struct conversion_context *ctx, const VkTilePropertiesQCOM32 *in, uint32_t count) -{ - VkTilePropertiesQCOM *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkTilePropertiesQCOM_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkTilePropertiesQCOM_array_host_to_win32(const VkTilePropertiesQCOM *in, VkTilePropertiesQCOM32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkTilePropertiesQCOM_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkGeneratedCommandsMemoryRequirementsInfoEXT_win32_to_host(struct conversion_context *ctx, const VkGeneratedCommandsMemoryRequirementsInfoEXT32 *in, VkGeneratedCommandsMemoryRequirementsInfoEXT *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->indirectExecutionSet = in->indirectExecutionSet; - out->indirectCommandsLayout = in->indirectCommandsLayout; - out->maxSequenceCount = in->maxSequenceCount; - out->maxDrawCount = in->maxDrawCount; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_GENERATED_COMMANDS_PIPELINE_INFO_EXT: - { - VkGeneratedCommandsPipelineInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkGeneratedCommandsPipelineInfoEXT32 *in_ext = (const VkGeneratedCommandsPipelineInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_GENERATED_COMMANDS_PIPELINE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->pipeline = in_ext->pipeline; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_GENERATED_COMMANDS_SHADER_INFO_EXT: - { - VkGeneratedCommandsShaderInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkGeneratedCommandsShaderInfoEXT32 *in_ext = (const VkGeneratedCommandsShaderInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_GENERATED_COMMANDS_SHADER_INFO_EXT; - out_ext->pNext = NULL; - out_ext->shaderCount = in_ext->shaderCount; - out_ext->pShaders = UlongToPtr(in_ext->pShaders); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkGeneratedCommandsMemoryRequirementsInfoNV_win32_to_host(const VkGeneratedCommandsMemoryRequirementsInfoNV32 *in, VkGeneratedCommandsMemoryRequirementsInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pipelineBindPoint = in->pipelineBindPoint; - out->pipeline = in->pipeline; - out->indirectCommandsLayout = in->indirectCommandsLayout; - out->maxSequencesCount = in->maxSequencesCount; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkImageMemoryRequirementsInfo2_win32_to_host(struct conversion_context *ctx, const VkImageMemoryRequirementsInfo232 *in, VkImageMemoryRequirementsInfo2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->image = in->image; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: - { - VkImagePlaneMemoryRequirementsInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImagePlaneMemoryRequirementsInfo32 *in_ext = (const VkImagePlaneMemoryRequirementsInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO; - out_ext->pNext = NULL; - out_ext->planeAspect = in_ext->planeAspect; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkImageCaptureDescriptorDataInfoEXT_win32_to_host(const VkImageCaptureDescriptorDataInfoEXT32 *in, VkImageCaptureDescriptorDataInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->image = in->image; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkSparseImageMemoryRequirements_array_host_to_win32(const VkSparseImageMemoryRequirements *in, VkSparseImageMemoryRequirements32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkSparseImageMemoryRequirements_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkImageSparseMemoryRequirementsInfo2_win32_to_host(const VkImageSparseMemoryRequirementsInfo232 *in, VkImageSparseMemoryRequirementsInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->image = in->image; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkImageViewAddressPropertiesNVX_win32_to_host(const VkImageViewAddressPropertiesNVX32 *in, VkImageViewAddressPropertiesNVX *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkImageViewAddressPropertiesNVX_host_to_win32(const VkImageViewAddressPropertiesNVX *in, VkImageViewAddressPropertiesNVX32 *out) -{ - if (!in) return; - - out->deviceAddress = in->deviceAddress; - out->size = in->size; -} - -static inline void convert_VkImageViewHandleInfoNVX_win32_to_host(const VkImageViewHandleInfoNVX32 *in, VkImageViewHandleInfoNVX *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->imageView = in->imageView; - out->descriptorType = in->descriptorType; - out->sampler = in->sampler; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkImageViewCaptureDescriptorDataInfoEXT_win32_to_host(const VkImageViewCaptureDescriptorDataInfoEXT32 *in, VkImageViewCaptureDescriptorDataInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->imageView = in->imageView; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkLatencyTimingsFrameReportNV_win32_to_host(const VkLatencyTimingsFrameReportNV32 *in, VkLatencyTimingsFrameReportNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkLatencyTimingsFrameReportNV_host_to_win32(const VkLatencyTimingsFrameReportNV *in, VkLatencyTimingsFrameReportNV32 *out) -{ - if (!in) return; - - out->presentID = in->presentID; - out->inputSampleTimeUs = in->inputSampleTimeUs; - out->simStartTimeUs = in->simStartTimeUs; - out->simEndTimeUs = in->simEndTimeUs; - out->renderSubmitStartTimeUs = in->renderSubmitStartTimeUs; - out->renderSubmitEndTimeUs = in->renderSubmitEndTimeUs; - out->presentStartTimeUs = in->presentStartTimeUs; - out->presentEndTimeUs = in->presentEndTimeUs; - out->driverStartTimeUs = in->driverStartTimeUs; - out->driverEndTimeUs = in->driverEndTimeUs; - out->osRenderQueueStartTimeUs = in->osRenderQueueStartTimeUs; - out->osRenderQueueEndTimeUs = in->osRenderQueueEndTimeUs; - out->gpuRenderStartTimeUs = in->gpuRenderStartTimeUs; - out->gpuRenderEndTimeUs = in->gpuRenderEndTimeUs; -} - -static inline VkLatencyTimingsFrameReportNV *convert_VkLatencyTimingsFrameReportNV_array_win32_to_host(struct conversion_context *ctx, const VkLatencyTimingsFrameReportNV32 *in, uint32_t count) -{ - VkLatencyTimingsFrameReportNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkLatencyTimingsFrameReportNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkLatencyTimingsFrameReportNV_array_host_to_win32(const VkLatencyTimingsFrameReportNV *in, VkLatencyTimingsFrameReportNV32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkLatencyTimingsFrameReportNV_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkGetLatencyMarkerInfoNV_win32_to_host(struct conversion_context *ctx, const VkGetLatencyMarkerInfoNV32 *in, VkGetLatencyMarkerInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->timingCount = in->timingCount; - out->pTimings = convert_VkLatencyTimingsFrameReportNV_array_win32_to_host(ctx, (VkLatencyTimingsFrameReportNV32 *)UlongToPtr(in->pTimings), in->timingCount); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkGetLatencyMarkerInfoNV_host_to_win32(const VkGetLatencyMarkerInfoNV *in, VkGetLatencyMarkerInfoNV32 *out) -{ - if (!in) return; - - out->timingCount = in->timingCount; - convert_VkLatencyTimingsFrameReportNV_array_host_to_win32(in->pTimings, (VkLatencyTimingsFrameReportNV32 *)UlongToPtr(out->pTimings), in->timingCount); -} - -static inline void convert_VkMemoryHostPointerPropertiesEXT_win32_to_host(const VkMemoryHostPointerPropertiesEXT32 *in, VkMemoryHostPointerPropertiesEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMemoryHostPointerPropertiesEXT_host_to_win32(const VkMemoryHostPointerPropertiesEXT *in, VkMemoryHostPointerPropertiesEXT32 *out) -{ - if (!in) return; - - out->memoryTypeBits = in->memoryTypeBits; -} - -static inline void convert_VkMicromapBuildSizesInfoEXT_win32_to_host(const VkMicromapBuildSizesInfoEXT32 *in, VkMicromapBuildSizesInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->micromapSize = in->micromapSize; - out->buildScratchSize = in->buildScratchSize; - out->discardable = in->discardable; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMicromapBuildSizesInfoEXT_host_to_win32(const VkMicromapBuildSizesInfoEXT *in, VkMicromapBuildSizesInfoEXT32 *out) -{ - if (!in) return; - - out->micromapSize = in->micromapSize; - out->buildScratchSize = in->buildScratchSize; - out->discardable = in->discardable; -} - -static inline void convert_VkPerformanceValueDataINTEL_win32_to_host(const VkPerformanceValueDataINTEL32 *in, VkPerformanceValueDataINTEL *out, VkFlags selector) -{ - if (!in) return; - - if (selector == VK_PERFORMANCE_VALUE_TYPE_UINT32_INTEL) - out->value32 = in->value32; - if (selector == VK_PERFORMANCE_VALUE_TYPE_UINT64_INTEL) - out->value64 = in->value64; - if (selector == VK_PERFORMANCE_VALUE_TYPE_FLOAT_INTEL) - out->valueFloat = in->valueFloat; - if (selector == VK_PERFORMANCE_VALUE_TYPE_BOOL_INTEL) - out->valueBool = in->valueBool; - if (selector == VK_PERFORMANCE_VALUE_TYPE_STRING_INTEL) - out->valueString = UlongToPtr(in->valueString); -} - -static inline void convert_VkPerformanceValueDataINTEL_host_to_win32(const VkPerformanceValueDataINTEL *in, VkPerformanceValueDataINTEL32 *out, VkFlags selector) -{ - if (!in) return; - - if (selector == VK_PERFORMANCE_VALUE_TYPE_UINT32_INTEL) - out->value32 = in->value32; - if (selector == VK_PERFORMANCE_VALUE_TYPE_UINT64_INTEL) - out->value64 = in->value64; - if (selector == VK_PERFORMANCE_VALUE_TYPE_FLOAT_INTEL) - out->valueFloat = in->valueFloat; - if (selector == VK_PERFORMANCE_VALUE_TYPE_BOOL_INTEL) - out->valueBool = in->valueBool; -} - -static inline void convert_VkPerformanceValueINTEL_host_to_win32(const VkPerformanceValueINTEL *in, VkPerformanceValueINTEL32 *out) -{ - if (!in) return; - - out->type = in->type; - convert_VkPerformanceValueDataINTEL_host_to_win32(&in->data, &out->data, in->type); -} - -static inline void convert_VkCooperativeMatrixFlexibleDimensionsPropertiesNV_win32_to_host(const VkCooperativeMatrixFlexibleDimensionsPropertiesNV32 *in, VkCooperativeMatrixFlexibleDimensionsPropertiesNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCooperativeMatrixFlexibleDimensionsPropertiesNV_host_to_win32(const VkCooperativeMatrixFlexibleDimensionsPropertiesNV *in, VkCooperativeMatrixFlexibleDimensionsPropertiesNV32 *out) -{ - if (!in) return; - - out->MGranularity = in->MGranularity; - out->NGranularity = in->NGranularity; - out->KGranularity = in->KGranularity; - out->AType = in->AType; - out->BType = in->BType; - out->CType = in->CType; - out->ResultType = in->ResultType; - out->saturatingAccumulation = in->saturatingAccumulation; - out->scope = in->scope; - out->workgroupInvocations = in->workgroupInvocations; -} - -static inline VkCooperativeMatrixFlexibleDimensionsPropertiesNV *convert_VkCooperativeMatrixFlexibleDimensionsPropertiesNV_array_win32_to_host(struct conversion_context *ctx, const VkCooperativeMatrixFlexibleDimensionsPropertiesNV32 *in, uint32_t count) -{ - VkCooperativeMatrixFlexibleDimensionsPropertiesNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCooperativeMatrixFlexibleDimensionsPropertiesNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCooperativeMatrixFlexibleDimensionsPropertiesNV_array_host_to_win32(const VkCooperativeMatrixFlexibleDimensionsPropertiesNV *in, VkCooperativeMatrixFlexibleDimensionsPropertiesNV32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkCooperativeMatrixFlexibleDimensionsPropertiesNV_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkCooperativeMatrixPropertiesKHR_win32_to_host(const VkCooperativeMatrixPropertiesKHR32 *in, VkCooperativeMatrixPropertiesKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCooperativeMatrixPropertiesKHR_host_to_win32(const VkCooperativeMatrixPropertiesKHR *in, VkCooperativeMatrixPropertiesKHR32 *out) -{ - if (!in) return; - - out->MSize = in->MSize; - out->NSize = in->NSize; - out->KSize = in->KSize; - out->AType = in->AType; - out->BType = in->BType; - out->CType = in->CType; - out->ResultType = in->ResultType; - out->saturatingAccumulation = in->saturatingAccumulation; - out->scope = in->scope; -} - -static inline VkCooperativeMatrixPropertiesKHR *convert_VkCooperativeMatrixPropertiesKHR_array_win32_to_host(struct conversion_context *ctx, const VkCooperativeMatrixPropertiesKHR32 *in, uint32_t count) -{ - VkCooperativeMatrixPropertiesKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCooperativeMatrixPropertiesKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCooperativeMatrixPropertiesKHR_array_host_to_win32(const VkCooperativeMatrixPropertiesKHR *in, VkCooperativeMatrixPropertiesKHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkCooperativeMatrixPropertiesKHR_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkCooperativeMatrixPropertiesNV_win32_to_host(const VkCooperativeMatrixPropertiesNV32 *in, VkCooperativeMatrixPropertiesNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCooperativeMatrixPropertiesNV_host_to_win32(const VkCooperativeMatrixPropertiesNV *in, VkCooperativeMatrixPropertiesNV32 *out) -{ - if (!in) return; - - out->MSize = in->MSize; - out->NSize = in->NSize; - out->KSize = in->KSize; - out->AType = in->AType; - out->BType = in->BType; - out->CType = in->CType; - out->DType = in->DType; - out->scope = in->scope; -} - -static inline VkCooperativeMatrixPropertiesNV *convert_VkCooperativeMatrixPropertiesNV_array_win32_to_host(struct conversion_context *ctx, const VkCooperativeMatrixPropertiesNV32 *in, uint32_t count) -{ - VkCooperativeMatrixPropertiesNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCooperativeMatrixPropertiesNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCooperativeMatrixPropertiesNV_array_host_to_win32(const VkCooperativeMatrixPropertiesNV *in, VkCooperativeMatrixPropertiesNV32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkCooperativeMatrixPropertiesNV_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPhysicalDeviceExternalBufferInfo_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceExternalBufferInfo32 *in, VkPhysicalDeviceExternalBufferInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->usage = in->usage; - out->handleType = in->handleType; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO: - { - VkBufferUsageFlags2CreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBufferUsageFlags2CreateInfo32 *in_ext = (const VkBufferUsageFlags2CreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->usage = in_ext->usage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkExternalBufferProperties_win32_to_host(const VkExternalBufferProperties32 *in, VkExternalBufferProperties *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkExternalBufferProperties_host_to_win32(const VkExternalBufferProperties *in, VkExternalBufferProperties32 *out) -{ - if (!in) return; - - out->externalMemoryProperties = in->externalMemoryProperties; -} - -static inline void convert_VkPhysicalDeviceExternalFenceInfo_win32_to_host(const VkPhysicalDeviceExternalFenceInfo32 *in, VkPhysicalDeviceExternalFenceInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->handleType = in->handleType; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkExternalFenceProperties_win32_to_host(const VkExternalFenceProperties32 *in, VkExternalFenceProperties *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkExternalFenceProperties_host_to_win32(const VkExternalFenceProperties *in, VkExternalFenceProperties32 *out) -{ - if (!in) return; - - out->exportFromImportedHandleTypes = in->exportFromImportedHandleTypes; - out->compatibleHandleTypes = in->compatibleHandleTypes; - out->externalFenceFeatures = in->externalFenceFeatures; -} - -static inline void convert_VkPhysicalDeviceExternalSemaphoreInfo_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceExternalSemaphoreInfo32 *in, VkPhysicalDeviceExternalSemaphoreInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->handleType = in->handleType; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: - { - VkSemaphoreTypeCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSemaphoreTypeCreateInfo32 *in_ext = (const VkSemaphoreTypeCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->semaphoreType = in_ext->semaphoreType; - out_ext->initialValue = in_ext->initialValue; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkExternalSemaphoreProperties_win32_to_host(const VkExternalSemaphoreProperties32 *in, VkExternalSemaphoreProperties *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkExternalSemaphoreProperties_host_to_win32(const VkExternalSemaphoreProperties *in, VkExternalSemaphoreProperties32 *out) -{ - if (!in) return; - - out->exportFromImportedHandleTypes = in->exportFromImportedHandleTypes; - out->compatibleHandleTypes = in->compatibleHandleTypes; - out->externalSemaphoreFeatures = in->externalSemaphoreFeatures; -} - -static inline void convert_VkPhysicalDeviceFeatures2_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceFeatures232 *in, VkPhysicalDeviceFeatures2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->features = in->features; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV32 *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->deviceGeneratedCommands = in_ext->deviceGeneratedCommands; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV32 *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->deviceGeneratedCompute = in_ext->deviceGeneratedCompute; - out_ext->deviceGeneratedComputePipelines = in_ext->deviceGeneratedComputePipelines; - out_ext->deviceGeneratedComputeCaptureReplay = in_ext->deviceGeneratedComputeCaptureReplay; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES: - { - VkPhysicalDevicePrivateDataFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePrivateDataFeatures32 *in_ext = (const VkPhysicalDevicePrivateDataFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES; - out_ext->pNext = NULL; - out_ext->privateData = in_ext->privateData; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: - { - VkPhysicalDeviceVariablePointersFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVariablePointersFeatures32 *in_ext = (const VkPhysicalDeviceVariablePointersFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES; - out_ext->pNext = NULL; - out_ext->variablePointersStorageBuffer = in_ext->variablePointersStorageBuffer; - out_ext->variablePointers = in_ext->variablePointers; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: - { - VkPhysicalDeviceMultiviewFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiviewFeatures32 *in_ext = (const VkPhysicalDeviceMultiviewFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES; - out_ext->pNext = NULL; - out_ext->multiview = in_ext->multiview; - out_ext->multiviewGeometryShader = in_ext->multiviewGeometryShader; - out_ext->multiviewTessellationShader = in_ext->multiviewTessellationShader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: - { - VkPhysicalDevicePresentIdFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentIdFeaturesKHR32 *in_ext = (const VkPhysicalDevicePresentIdFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->presentId = in_ext->presentId; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: - { - VkPhysicalDevicePresentWaitFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentWaitFeaturesKHR32 *in_ext = (const VkPhysicalDevicePresentWaitFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->presentWait = in_ext->presentWait; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: - { - VkPhysicalDevice16BitStorageFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevice16BitStorageFeatures32 *in_ext = (const VkPhysicalDevice16BitStorageFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES; - out_ext->pNext = NULL; - out_ext->storageBuffer16BitAccess = in_ext->storageBuffer16BitAccess; - out_ext->uniformAndStorageBuffer16BitAccess = in_ext->uniformAndStorageBuffer16BitAccess; - out_ext->storagePushConstant16 = in_ext->storagePushConstant16; - out_ext->storageInputOutput16 = in_ext->storageInputOutput16; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: - { - VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures32 *in_ext = (const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderSubgroupExtendedTypes = in_ext->shaderSubgroupExtendedTypes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: - { - VkPhysicalDeviceSamplerYcbcrConversionFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSamplerYcbcrConversionFeatures32 *in_ext = (const VkPhysicalDeviceSamplerYcbcrConversionFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES; - out_ext->pNext = NULL; - out_ext->samplerYcbcrConversion = in_ext->samplerYcbcrConversion; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: - { - VkPhysicalDeviceProtectedMemoryFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceProtectedMemoryFeatures32 *in_ext = (const VkPhysicalDeviceProtectedMemoryFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES; - out_ext->pNext = NULL; - out_ext->protectedMemory = in_ext->protectedMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: - { - VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT32 *in_ext = (const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->advancedBlendCoherentOperations = in_ext->advancedBlendCoherentOperations; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: - { - VkPhysicalDeviceMultiDrawFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiDrawFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMultiDrawFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->multiDraw = in_ext->multiDraw; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES: - { - VkPhysicalDeviceInlineUniformBlockFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceInlineUniformBlockFeatures32 *in_ext = (const VkPhysicalDeviceInlineUniformBlockFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES; - out_ext->pNext = NULL; - out_ext->inlineUniformBlock = in_ext->inlineUniformBlock; - out_ext->descriptorBindingInlineUniformBlockUpdateAfterBind = in_ext->descriptorBindingInlineUniformBlockUpdateAfterBind; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES: - { - VkPhysicalDeviceMaintenance4Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMaintenance4Features32 *in_ext = (const VkPhysicalDeviceMaintenance4Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES; - out_ext->pNext = NULL; - out_ext->maintenance4 = in_ext->maintenance4; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES: - { - VkPhysicalDeviceMaintenance5Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMaintenance5Features32 *in_ext = (const VkPhysicalDeviceMaintenance5Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES; - out_ext->pNext = NULL; - out_ext->maintenance5 = in_ext->maintenance5; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES: - { - VkPhysicalDeviceMaintenance6Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMaintenance6Features32 *in_ext = (const VkPhysicalDeviceMaintenance6Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES; - out_ext->pNext = NULL; - out_ext->maintenance6 = in_ext->maintenance6; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: - { - VkPhysicalDeviceShaderDrawParametersFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderDrawParametersFeatures32 *in_ext = (const VkPhysicalDeviceShaderDrawParametersFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderDrawParameters = in_ext->shaderDrawParameters; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: - { - VkPhysicalDeviceShaderFloat16Int8Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderFloat16Int8Features32 *in_ext = (const VkPhysicalDeviceShaderFloat16Int8Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderFloat16 = in_ext->shaderFloat16; - out_ext->shaderInt8 = in_ext->shaderInt8; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: - { - VkPhysicalDeviceHostQueryResetFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceHostQueryResetFeatures32 *in_ext = (const VkPhysicalDeviceHostQueryResetFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES; - out_ext->pNext = NULL; - out_ext->hostQueryReset = in_ext->hostQueryReset; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES: - { - VkPhysicalDeviceGlobalPriorityQueryFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceGlobalPriorityQueryFeatures32 *in_ext = (const VkPhysicalDeviceGlobalPriorityQueryFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES; - out_ext->pNext = NULL; - out_ext->globalPriorityQuery = in_ext->globalPriorityQuery; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: - { - VkPhysicalDeviceDescriptorIndexingFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorIndexingFeatures32 *in_ext = (const VkPhysicalDeviceDescriptorIndexingFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderInputAttachmentArrayDynamicIndexing = in_ext->shaderInputAttachmentArrayDynamicIndexing; - out_ext->shaderUniformTexelBufferArrayDynamicIndexing = in_ext->shaderUniformTexelBufferArrayDynamicIndexing; - out_ext->shaderStorageTexelBufferArrayDynamicIndexing = in_ext->shaderStorageTexelBufferArrayDynamicIndexing; - out_ext->shaderUniformBufferArrayNonUniformIndexing = in_ext->shaderUniformBufferArrayNonUniformIndexing; - out_ext->shaderSampledImageArrayNonUniformIndexing = in_ext->shaderSampledImageArrayNonUniformIndexing; - out_ext->shaderStorageBufferArrayNonUniformIndexing = in_ext->shaderStorageBufferArrayNonUniformIndexing; - out_ext->shaderStorageImageArrayNonUniformIndexing = in_ext->shaderStorageImageArrayNonUniformIndexing; - out_ext->shaderInputAttachmentArrayNonUniformIndexing = in_ext->shaderInputAttachmentArrayNonUniformIndexing; - out_ext->shaderUniformTexelBufferArrayNonUniformIndexing = in_ext->shaderUniformTexelBufferArrayNonUniformIndexing; - out_ext->shaderStorageTexelBufferArrayNonUniformIndexing = in_ext->shaderStorageTexelBufferArrayNonUniformIndexing; - out_ext->descriptorBindingUniformBufferUpdateAfterBind = in_ext->descriptorBindingUniformBufferUpdateAfterBind; - out_ext->descriptorBindingSampledImageUpdateAfterBind = in_ext->descriptorBindingSampledImageUpdateAfterBind; - out_ext->descriptorBindingStorageImageUpdateAfterBind = in_ext->descriptorBindingStorageImageUpdateAfterBind; - out_ext->descriptorBindingStorageBufferUpdateAfterBind = in_ext->descriptorBindingStorageBufferUpdateAfterBind; - out_ext->descriptorBindingUniformTexelBufferUpdateAfterBind = in_ext->descriptorBindingUniformTexelBufferUpdateAfterBind; - out_ext->descriptorBindingStorageTexelBufferUpdateAfterBind = in_ext->descriptorBindingStorageTexelBufferUpdateAfterBind; - out_ext->descriptorBindingUpdateUnusedWhilePending = in_ext->descriptorBindingUpdateUnusedWhilePending; - out_ext->descriptorBindingPartiallyBound = in_ext->descriptorBindingPartiallyBound; - out_ext->descriptorBindingVariableDescriptorCount = in_ext->descriptorBindingVariableDescriptorCount; - out_ext->runtimeDescriptorArray = in_ext->runtimeDescriptorArray; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: - { - VkPhysicalDeviceTimelineSemaphoreFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTimelineSemaphoreFeatures32 *in_ext = (const VkPhysicalDeviceTimelineSemaphoreFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES; - out_ext->pNext = NULL; - out_ext->timelineSemaphore = in_ext->timelineSemaphore; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: - { - VkPhysicalDevice8BitStorageFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevice8BitStorageFeatures32 *in_ext = (const VkPhysicalDevice8BitStorageFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES; - out_ext->pNext = NULL; - out_ext->storageBuffer8BitAccess = in_ext->storageBuffer8BitAccess; - out_ext->uniformAndStorageBuffer8BitAccess = in_ext->uniformAndStorageBuffer8BitAccess; - out_ext->storagePushConstant8 = in_ext->storagePushConstant8; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: - { - VkPhysicalDeviceConditionalRenderingFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceConditionalRenderingFeaturesEXT32 *in_ext = (const VkPhysicalDeviceConditionalRenderingFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->conditionalRendering = in_ext->conditionalRendering; - out_ext->inheritedConditionalRendering = in_ext->inheritedConditionalRendering; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: - { - VkPhysicalDeviceVulkanMemoryModelFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkanMemoryModelFeatures32 *in_ext = (const VkPhysicalDeviceVulkanMemoryModelFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES; - out_ext->pNext = NULL; - out_ext->vulkanMemoryModel = in_ext->vulkanMemoryModel; - out_ext->vulkanMemoryModelDeviceScope = in_ext->vulkanMemoryModelDeviceScope; - out_ext->vulkanMemoryModelAvailabilityVisibilityChains = in_ext->vulkanMemoryModelAvailabilityVisibilityChains; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: - { - VkPhysicalDeviceShaderAtomicInt64Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicInt64Features32 *in_ext = (const VkPhysicalDeviceShaderAtomicInt64Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderBufferInt64Atomics = in_ext->shaderBufferInt64Atomics; - out_ext->shaderSharedInt64Atomics = in_ext->shaderSharedInt64Atomics; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: - { - VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderBufferFloat32Atomics = in_ext->shaderBufferFloat32Atomics; - out_ext->shaderBufferFloat32AtomicAdd = in_ext->shaderBufferFloat32AtomicAdd; - out_ext->shaderBufferFloat64Atomics = in_ext->shaderBufferFloat64Atomics; - out_ext->shaderBufferFloat64AtomicAdd = in_ext->shaderBufferFloat64AtomicAdd; - out_ext->shaderSharedFloat32Atomics = in_ext->shaderSharedFloat32Atomics; - out_ext->shaderSharedFloat32AtomicAdd = in_ext->shaderSharedFloat32AtomicAdd; - out_ext->shaderSharedFloat64Atomics = in_ext->shaderSharedFloat64Atomics; - out_ext->shaderSharedFloat64AtomicAdd = in_ext->shaderSharedFloat64AtomicAdd; - out_ext->shaderImageFloat32Atomics = in_ext->shaderImageFloat32Atomics; - out_ext->shaderImageFloat32AtomicAdd = in_ext->shaderImageFloat32AtomicAdd; - out_ext->sparseImageFloat32Atomics = in_ext->sparseImageFloat32Atomics; - out_ext->sparseImageFloat32AtomicAdd = in_ext->sparseImageFloat32AtomicAdd; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: - { - VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderBufferFloat16Atomics = in_ext->shaderBufferFloat16Atomics; - out_ext->shaderBufferFloat16AtomicAdd = in_ext->shaderBufferFloat16AtomicAdd; - out_ext->shaderBufferFloat16AtomicMinMax = in_ext->shaderBufferFloat16AtomicMinMax; - out_ext->shaderBufferFloat32AtomicMinMax = in_ext->shaderBufferFloat32AtomicMinMax; - out_ext->shaderBufferFloat64AtomicMinMax = in_ext->shaderBufferFloat64AtomicMinMax; - out_ext->shaderSharedFloat16Atomics = in_ext->shaderSharedFloat16Atomics; - out_ext->shaderSharedFloat16AtomicAdd = in_ext->shaderSharedFloat16AtomicAdd; - out_ext->shaderSharedFloat16AtomicMinMax = in_ext->shaderSharedFloat16AtomicMinMax; - out_ext->shaderSharedFloat32AtomicMinMax = in_ext->shaderSharedFloat32AtomicMinMax; - out_ext->shaderSharedFloat64AtomicMinMax = in_ext->shaderSharedFloat64AtomicMinMax; - out_ext->shaderImageFloat32AtomicMinMax = in_ext->shaderImageFloat32AtomicMinMax; - out_ext->sparseImageFloat32AtomicMinMax = in_ext->sparseImageFloat32AtomicMinMax; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES: - { - VkPhysicalDeviceVertexAttributeDivisorFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVertexAttributeDivisorFeatures32 *in_ext = (const VkPhysicalDeviceVertexAttributeDivisorFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES; - out_ext->pNext = NULL; - out_ext->vertexAttributeInstanceRateDivisor = in_ext->vertexAttributeInstanceRateDivisor; - out_ext->vertexAttributeInstanceRateZeroDivisor = in_ext->vertexAttributeInstanceRateZeroDivisor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: - { - VkPhysicalDeviceASTCDecodeFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceASTCDecodeFeaturesEXT32 *in_ext = (const VkPhysicalDeviceASTCDecodeFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->decodeModeSharedExponent = in_ext->decodeModeSharedExponent; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: - { - VkPhysicalDeviceTransformFeedbackFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTransformFeedbackFeaturesEXT32 *in_ext = (const VkPhysicalDeviceTransformFeedbackFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->transformFeedback = in_ext->transformFeedback; - out_ext->geometryStreams = in_ext->geometryStreams; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: - { - VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV32 *in_ext = (const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->representativeFragmentTest = in_ext->representativeFragmentTest; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: - { - VkPhysicalDeviceExclusiveScissorFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExclusiveScissorFeaturesNV32 *in_ext = (const VkPhysicalDeviceExclusiveScissorFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->exclusiveScissor = in_ext->exclusiveScissor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: - { - VkPhysicalDeviceCornerSampledImageFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCornerSampledImageFeaturesNV32 *in_ext = (const VkPhysicalDeviceCornerSampledImageFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cornerSampledImage = in_ext->cornerSampledImage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR: - { - VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR32 *in_ext = (const VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->computeDerivativeGroupQuads = in_ext->computeDerivativeGroupQuads; - out_ext->computeDerivativeGroupLinear = in_ext->computeDerivativeGroupLinear; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: - { - VkPhysicalDeviceShaderImageFootprintFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderImageFootprintFeaturesNV32 *in_ext = (const VkPhysicalDeviceShaderImageFootprintFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->imageFootprint = in_ext->imageFootprint; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: - { - VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV32 *in_ext = (const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->dedicatedAllocationImageAliasing = in_ext->dedicatedAllocationImageAliasing; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV: - { - VkPhysicalDeviceCopyMemoryIndirectFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCopyMemoryIndirectFeaturesNV32 *in_ext = (const VkPhysicalDeviceCopyMemoryIndirectFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->indirectCopy = in_ext->indirectCopy; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV: - { - VkPhysicalDeviceMemoryDecompressionFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMemoryDecompressionFeaturesNV32 *in_ext = (const VkPhysicalDeviceMemoryDecompressionFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->memoryDecompression = in_ext->memoryDecompression; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: - { - VkPhysicalDeviceShadingRateImageFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShadingRateImageFeaturesNV32 *in_ext = (const VkPhysicalDeviceShadingRateImageFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->shadingRateImage = in_ext->shadingRateImage; - out_ext->shadingRateCoarseSampleOrder = in_ext->shadingRateCoarseSampleOrder; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: - { - VkPhysicalDeviceInvocationMaskFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI32 *in_ext = (const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->invocationMask = in_ext->invocationMask; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: - { - VkPhysicalDeviceMeshShaderFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMeshShaderFeaturesNV32 *in_ext = (const VkPhysicalDeviceMeshShaderFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->taskShader = in_ext->taskShader; - out_ext->meshShader = in_ext->meshShader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT: - { - VkPhysicalDeviceMeshShaderFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMeshShaderFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMeshShaderFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->taskShader = in_ext->taskShader; - out_ext->meshShader = in_ext->meshShader; - out_ext->multiviewMeshShader = in_ext->multiviewMeshShader; - out_ext->primitiveFragmentShadingRateMeshShader = in_ext->primitiveFragmentShadingRateMeshShader; - out_ext->meshShaderQueries = in_ext->meshShaderQueries; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: - { - VkPhysicalDeviceAccelerationStructureFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAccelerationStructureFeaturesKHR32 *in_ext = (const VkPhysicalDeviceAccelerationStructureFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->accelerationStructure = in_ext->accelerationStructure; - out_ext->accelerationStructureCaptureReplay = in_ext->accelerationStructureCaptureReplay; - out_ext->accelerationStructureIndirectBuild = in_ext->accelerationStructureIndirectBuild; - out_ext->accelerationStructureHostCommands = in_ext->accelerationStructureHostCommands; - out_ext->descriptorBindingAccelerationStructureUpdateAfterBind = in_ext->descriptorBindingAccelerationStructureUpdateAfterBind; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingPipelineFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingPipelineFeaturesKHR32 *in_ext = (const VkPhysicalDeviceRayTracingPipelineFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayTracingPipeline = in_ext->rayTracingPipeline; - out_ext->rayTracingPipelineShaderGroupHandleCaptureReplay = in_ext->rayTracingPipelineShaderGroupHandleCaptureReplay; - out_ext->rayTracingPipelineShaderGroupHandleCaptureReplayMixed = in_ext->rayTracingPipelineShaderGroupHandleCaptureReplayMixed; - out_ext->rayTracingPipelineTraceRaysIndirect = in_ext->rayTracingPipelineTraceRaysIndirect; - out_ext->rayTraversalPrimitiveCulling = in_ext->rayTraversalPrimitiveCulling; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: - { - VkPhysicalDeviceRayQueryFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayQueryFeaturesKHR32 *in_ext = (const VkPhysicalDeviceRayQueryFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayQuery = in_ext->rayQuery; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR32 *in_ext = (const VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayTracingMaintenance1 = in_ext->rayTracingMaintenance1; - out_ext->rayTracingPipelineTraceRaysIndirect2 = in_ext->rayTracingPipelineTraceRaysIndirect2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: - { - VkPhysicalDeviceFragmentDensityMapFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentDensityMapFeaturesEXT32 *in_ext = (const VkPhysicalDeviceFragmentDensityMapFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->fragmentDensityMap = in_ext->fragmentDensityMap; - out_ext->fragmentDensityMapDynamic = in_ext->fragmentDensityMapDynamic; - out_ext->fragmentDensityMapNonSubsampledImages = in_ext->fragmentDensityMapNonSubsampledImages; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: - { - VkPhysicalDeviceFragmentDensityMap2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT32 *in_ext = (const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->fragmentDensityMapDeferred = in_ext->fragmentDensityMapDeferred; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM: - { - VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->fragmentDensityMapOffset = in_ext->fragmentDensityMapOffset; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: - { - VkPhysicalDeviceScalarBlockLayoutFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceScalarBlockLayoutFeatures32 *in_ext = (const VkPhysicalDeviceScalarBlockLayoutFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES; - out_ext->pNext = NULL; - out_ext->scalarBlockLayout = in_ext->scalarBlockLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: - { - VkPhysicalDeviceUniformBufferStandardLayoutFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceUniformBufferStandardLayoutFeatures32 *in_ext = (const VkPhysicalDeviceUniformBufferStandardLayoutFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES; - out_ext->pNext = NULL; - out_ext->uniformBufferStandardLayout = in_ext->uniformBufferStandardLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: - { - VkPhysicalDeviceDepthClipEnableFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClipEnableFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDepthClipEnableFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClipEnable = in_ext->depthClipEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: - { - VkPhysicalDeviceMemoryPriorityFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMemoryPriorityFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMemoryPriorityFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->memoryPriority = in_ext->memoryPriority; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: - { - VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT32 *in_ext = (const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pageableDeviceLocalMemory = in_ext->pageableDeviceLocalMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: - { - VkPhysicalDeviceBufferDeviceAddressFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBufferDeviceAddressFeatures32 *in_ext = (const VkPhysicalDeviceBufferDeviceAddressFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES; - out_ext->pNext = NULL; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: - { - VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT32 *in_ext = (const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: - { - VkPhysicalDeviceImagelessFramebufferFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImagelessFramebufferFeatures32 *in_ext = (const VkPhysicalDeviceImagelessFramebufferFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES; - out_ext->pNext = NULL; - out_ext->imagelessFramebuffer = in_ext->imagelessFramebuffer; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES: - { - VkPhysicalDeviceTextureCompressionASTCHDRFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTextureCompressionASTCHDRFeatures32 *in_ext = (const VkPhysicalDeviceTextureCompressionASTCHDRFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES; - out_ext->pNext = NULL; - out_ext->textureCompressionASTC_HDR = in_ext->textureCompressionASTC_HDR; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: - { - VkPhysicalDeviceCooperativeMatrixFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCooperativeMatrixFeaturesNV32 *in_ext = (const VkPhysicalDeviceCooperativeMatrixFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cooperativeMatrix = in_ext->cooperativeMatrix; - out_ext->cooperativeMatrixRobustBufferAccess = in_ext->cooperativeMatrixRobustBufferAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: - { - VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT32 *in_ext = (const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->ycbcrImageArrays = in_ext->ycbcrImageArrays; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV: - { - VkPhysicalDevicePresentBarrierFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentBarrierFeaturesNV32 *in_ext = (const VkPhysicalDevicePresentBarrierFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->presentBarrier = in_ext->presentBarrier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: - { - VkPhysicalDevicePerformanceQueryFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePerformanceQueryFeaturesKHR32 *in_ext = (const VkPhysicalDevicePerformanceQueryFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->performanceCounterQueryPools = in_ext->performanceCounterQueryPools; - out_ext->performanceCounterMultipleQueryPools = in_ext->performanceCounterMultipleQueryPools; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: - { - VkPhysicalDeviceCoverageReductionModeFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCoverageReductionModeFeaturesNV32 *in_ext = (const VkPhysicalDeviceCoverageReductionModeFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->coverageReductionMode = in_ext->coverageReductionMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: - { - VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL32 *in_ext = (const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL; - out_ext->pNext = NULL; - out_ext->shaderIntegerFunctions2 = in_ext->shaderIntegerFunctions2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: - { - VkPhysicalDeviceShaderClockFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderClockFeaturesKHR32 *in_ext = (const VkPhysicalDeviceShaderClockFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderSubgroupClock = in_ext->shaderSubgroupClock; - out_ext->shaderDeviceClock = in_ext->shaderDeviceClock; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES: - { - VkPhysicalDeviceIndexTypeUint8Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceIndexTypeUint8Features32 *in_ext = (const VkPhysicalDeviceIndexTypeUint8Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES; - out_ext->pNext = NULL; - out_ext->indexTypeUint8 = in_ext->indexTypeUint8; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: - { - VkPhysicalDeviceShaderSMBuiltinsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV32 *in_ext = (const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->shaderSMBuiltins = in_ext->shaderSMBuiltins; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: - { - VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT32 *in_ext = (const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->fragmentShaderSampleInterlock = in_ext->fragmentShaderSampleInterlock; - out_ext->fragmentShaderPixelInterlock = in_ext->fragmentShaderPixelInterlock; - out_ext->fragmentShaderShadingRateInterlock = in_ext->fragmentShaderShadingRateInterlock; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: - { - VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures32 *in_ext = (const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES; - out_ext->pNext = NULL; - out_ext->separateDepthStencilLayouts = in_ext->separateDepthStencilLayouts; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: - { - VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT32 *in_ext = (const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->primitiveTopologyListRestart = in_ext->primitiveTopologyListRestart; - out_ext->primitiveTopologyPatchListRestart = in_ext->primitiveTopologyPatchListRestart; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: - { - VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR32 *in_ext = (const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->pipelineExecutableInfo = in_ext->pipelineExecutableInfo; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES: - { - VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures32 *in_ext = (const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderDemoteToHelperInvocation = in_ext->shaderDemoteToHelperInvocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: - { - VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT32 *in_ext = (const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->texelBufferAlignment = in_ext->texelBufferAlignment; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES: - { - VkPhysicalDeviceSubgroupSizeControlFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSubgroupSizeControlFeatures32 *in_ext = (const VkPhysicalDeviceSubgroupSizeControlFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES; - out_ext->pNext = NULL; - out_ext->subgroupSizeControl = in_ext->subgroupSizeControl; - out_ext->computeFullSubgroups = in_ext->computeFullSubgroups; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES: - { - VkPhysicalDeviceLineRasterizationFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLineRasterizationFeatures32 *in_ext = (const VkPhysicalDeviceLineRasterizationFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES; - out_ext->pNext = NULL; - out_ext->rectangularLines = in_ext->rectangularLines; - out_ext->bresenhamLines = in_ext->bresenhamLines; - out_ext->smoothLines = in_ext->smoothLines; - out_ext->stippledRectangularLines = in_ext->stippledRectangularLines; - out_ext->stippledBresenhamLines = in_ext->stippledBresenhamLines; - out_ext->stippledSmoothLines = in_ext->stippledSmoothLines; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: - { - VkPhysicalDevicePipelineCreationCacheControlFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineCreationCacheControlFeatures32 *in_ext = (const VkPhysicalDevicePipelineCreationCacheControlFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES; - out_ext->pNext = NULL; - out_ext->pipelineCreationCacheControl = in_ext->pipelineCreationCacheControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: - { - VkPhysicalDeviceVulkan11Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan11Features32 *in_ext = (const VkPhysicalDeviceVulkan11Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES; - out_ext->pNext = NULL; - out_ext->storageBuffer16BitAccess = in_ext->storageBuffer16BitAccess; - out_ext->uniformAndStorageBuffer16BitAccess = in_ext->uniformAndStorageBuffer16BitAccess; - out_ext->storagePushConstant16 = in_ext->storagePushConstant16; - out_ext->storageInputOutput16 = in_ext->storageInputOutput16; - out_ext->multiview = in_ext->multiview; - out_ext->multiviewGeometryShader = in_ext->multiviewGeometryShader; - out_ext->multiviewTessellationShader = in_ext->multiviewTessellationShader; - out_ext->variablePointersStorageBuffer = in_ext->variablePointersStorageBuffer; - out_ext->variablePointers = in_ext->variablePointers; - out_ext->protectedMemory = in_ext->protectedMemory; - out_ext->samplerYcbcrConversion = in_ext->samplerYcbcrConversion; - out_ext->shaderDrawParameters = in_ext->shaderDrawParameters; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: - { - VkPhysicalDeviceVulkan12Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan12Features32 *in_ext = (const VkPhysicalDeviceVulkan12Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES; - out_ext->pNext = NULL; - out_ext->samplerMirrorClampToEdge = in_ext->samplerMirrorClampToEdge; - out_ext->drawIndirectCount = in_ext->drawIndirectCount; - out_ext->storageBuffer8BitAccess = in_ext->storageBuffer8BitAccess; - out_ext->uniformAndStorageBuffer8BitAccess = in_ext->uniformAndStorageBuffer8BitAccess; - out_ext->storagePushConstant8 = in_ext->storagePushConstant8; - out_ext->shaderBufferInt64Atomics = in_ext->shaderBufferInt64Atomics; - out_ext->shaderSharedInt64Atomics = in_ext->shaderSharedInt64Atomics; - out_ext->shaderFloat16 = in_ext->shaderFloat16; - out_ext->shaderInt8 = in_ext->shaderInt8; - out_ext->descriptorIndexing = in_ext->descriptorIndexing; - out_ext->shaderInputAttachmentArrayDynamicIndexing = in_ext->shaderInputAttachmentArrayDynamicIndexing; - out_ext->shaderUniformTexelBufferArrayDynamicIndexing = in_ext->shaderUniformTexelBufferArrayDynamicIndexing; - out_ext->shaderStorageTexelBufferArrayDynamicIndexing = in_ext->shaderStorageTexelBufferArrayDynamicIndexing; - out_ext->shaderUniformBufferArrayNonUniformIndexing = in_ext->shaderUniformBufferArrayNonUniformIndexing; - out_ext->shaderSampledImageArrayNonUniformIndexing = in_ext->shaderSampledImageArrayNonUniformIndexing; - out_ext->shaderStorageBufferArrayNonUniformIndexing = in_ext->shaderStorageBufferArrayNonUniformIndexing; - out_ext->shaderStorageImageArrayNonUniformIndexing = in_ext->shaderStorageImageArrayNonUniformIndexing; - out_ext->shaderInputAttachmentArrayNonUniformIndexing = in_ext->shaderInputAttachmentArrayNonUniformIndexing; - out_ext->shaderUniformTexelBufferArrayNonUniformIndexing = in_ext->shaderUniformTexelBufferArrayNonUniformIndexing; - out_ext->shaderStorageTexelBufferArrayNonUniformIndexing = in_ext->shaderStorageTexelBufferArrayNonUniformIndexing; - out_ext->descriptorBindingUniformBufferUpdateAfterBind = in_ext->descriptorBindingUniformBufferUpdateAfterBind; - out_ext->descriptorBindingSampledImageUpdateAfterBind = in_ext->descriptorBindingSampledImageUpdateAfterBind; - out_ext->descriptorBindingStorageImageUpdateAfterBind = in_ext->descriptorBindingStorageImageUpdateAfterBind; - out_ext->descriptorBindingStorageBufferUpdateAfterBind = in_ext->descriptorBindingStorageBufferUpdateAfterBind; - out_ext->descriptorBindingUniformTexelBufferUpdateAfterBind = in_ext->descriptorBindingUniformTexelBufferUpdateAfterBind; - out_ext->descriptorBindingStorageTexelBufferUpdateAfterBind = in_ext->descriptorBindingStorageTexelBufferUpdateAfterBind; - out_ext->descriptorBindingUpdateUnusedWhilePending = in_ext->descriptorBindingUpdateUnusedWhilePending; - out_ext->descriptorBindingPartiallyBound = in_ext->descriptorBindingPartiallyBound; - out_ext->descriptorBindingVariableDescriptorCount = in_ext->descriptorBindingVariableDescriptorCount; - out_ext->runtimeDescriptorArray = in_ext->runtimeDescriptorArray; - out_ext->samplerFilterMinmax = in_ext->samplerFilterMinmax; - out_ext->scalarBlockLayout = in_ext->scalarBlockLayout; - out_ext->imagelessFramebuffer = in_ext->imagelessFramebuffer; - out_ext->uniformBufferStandardLayout = in_ext->uniformBufferStandardLayout; - out_ext->shaderSubgroupExtendedTypes = in_ext->shaderSubgroupExtendedTypes; - out_ext->separateDepthStencilLayouts = in_ext->separateDepthStencilLayouts; - out_ext->hostQueryReset = in_ext->hostQueryReset; - out_ext->timelineSemaphore = in_ext->timelineSemaphore; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_ext->vulkanMemoryModel = in_ext->vulkanMemoryModel; - out_ext->vulkanMemoryModelDeviceScope = in_ext->vulkanMemoryModelDeviceScope; - out_ext->vulkanMemoryModelAvailabilityVisibilityChains = in_ext->vulkanMemoryModelAvailabilityVisibilityChains; - out_ext->shaderOutputViewportIndex = in_ext->shaderOutputViewportIndex; - out_ext->shaderOutputLayer = in_ext->shaderOutputLayer; - out_ext->subgroupBroadcastDynamicId = in_ext->subgroupBroadcastDynamicId; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES: - { - VkPhysicalDeviceVulkan13Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan13Features32 *in_ext = (const VkPhysicalDeviceVulkan13Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES; - out_ext->pNext = NULL; - out_ext->robustImageAccess = in_ext->robustImageAccess; - out_ext->inlineUniformBlock = in_ext->inlineUniformBlock; - out_ext->descriptorBindingInlineUniformBlockUpdateAfterBind = in_ext->descriptorBindingInlineUniformBlockUpdateAfterBind; - out_ext->pipelineCreationCacheControl = in_ext->pipelineCreationCacheControl; - out_ext->privateData = in_ext->privateData; - out_ext->shaderDemoteToHelperInvocation = in_ext->shaderDemoteToHelperInvocation; - out_ext->shaderTerminateInvocation = in_ext->shaderTerminateInvocation; - out_ext->subgroupSizeControl = in_ext->subgroupSizeControl; - out_ext->computeFullSubgroups = in_ext->computeFullSubgroups; - out_ext->synchronization2 = in_ext->synchronization2; - out_ext->textureCompressionASTC_HDR = in_ext->textureCompressionASTC_HDR; - out_ext->shaderZeroInitializeWorkgroupMemory = in_ext->shaderZeroInitializeWorkgroupMemory; - out_ext->dynamicRendering = in_ext->dynamicRendering; - out_ext->shaderIntegerDotProduct = in_ext->shaderIntegerDotProduct; - out_ext->maintenance4 = in_ext->maintenance4; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES: - { - VkPhysicalDeviceVulkan14Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVulkan14Features32 *in_ext = (const VkPhysicalDeviceVulkan14Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES; - out_ext->pNext = NULL; - out_ext->globalPriorityQuery = in_ext->globalPriorityQuery; - out_ext->shaderSubgroupRotate = in_ext->shaderSubgroupRotate; - out_ext->shaderSubgroupRotateClustered = in_ext->shaderSubgroupRotateClustered; - out_ext->shaderFloatControls2 = in_ext->shaderFloatControls2; - out_ext->shaderExpectAssume = in_ext->shaderExpectAssume; - out_ext->rectangularLines = in_ext->rectangularLines; - out_ext->bresenhamLines = in_ext->bresenhamLines; - out_ext->smoothLines = in_ext->smoothLines; - out_ext->stippledRectangularLines = in_ext->stippledRectangularLines; - out_ext->stippledBresenhamLines = in_ext->stippledBresenhamLines; - out_ext->stippledSmoothLines = in_ext->stippledSmoothLines; - out_ext->vertexAttributeInstanceRateDivisor = in_ext->vertexAttributeInstanceRateDivisor; - out_ext->vertexAttributeInstanceRateZeroDivisor = in_ext->vertexAttributeInstanceRateZeroDivisor; - out_ext->indexTypeUint8 = in_ext->indexTypeUint8; - out_ext->dynamicRenderingLocalRead = in_ext->dynamicRenderingLocalRead; - out_ext->maintenance5 = in_ext->maintenance5; - out_ext->maintenance6 = in_ext->maintenance6; - out_ext->pipelineProtectedAccess = in_ext->pipelineProtectedAccess; - out_ext->pipelineRobustness = in_ext->pipelineRobustness; - out_ext->hostImageCopy = in_ext->hostImageCopy; - out_ext->pushDescriptor = in_ext->pushDescriptor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: - { - VkPhysicalDeviceCoherentMemoryFeaturesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCoherentMemoryFeaturesAMD32 *in_ext = (const VkPhysicalDeviceCoherentMemoryFeaturesAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD; - out_ext->pNext = NULL; - out_ext->deviceCoherentMemory = in_ext->deviceCoherentMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: - { - VkPhysicalDeviceCustomBorderColorFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCustomBorderColorFeaturesEXT32 *in_ext = (const VkPhysicalDeviceCustomBorderColorFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->customBorderColors = in_ext->customBorderColors; - out_ext->customBorderColorWithoutFormat = in_ext->customBorderColorWithoutFormat; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: - { - VkPhysicalDeviceBorderColorSwizzleFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT32 *in_ext = (const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->borderColorSwizzle = in_ext->borderColorSwizzle; - out_ext->borderColorSwizzleFromImage = in_ext->borderColorSwizzleFromImage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT32 *in_ext = (const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->extendedDynamicState = in_ext->extendedDynamicState; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT32 *in_ext = (const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->extendedDynamicState2 = in_ext->extendedDynamicState2; - out_ext->extendedDynamicState2LogicOp = in_ext->extendedDynamicState2LogicOp; - out_ext->extendedDynamicState2PatchControlPoints = in_ext->extendedDynamicState2PatchControlPoints; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicState3FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicState3FeaturesEXT32 *in_ext = (const VkPhysicalDeviceExtendedDynamicState3FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->extendedDynamicState3TessellationDomainOrigin = in_ext->extendedDynamicState3TessellationDomainOrigin; - out_ext->extendedDynamicState3DepthClampEnable = in_ext->extendedDynamicState3DepthClampEnable; - out_ext->extendedDynamicState3PolygonMode = in_ext->extendedDynamicState3PolygonMode; - out_ext->extendedDynamicState3RasterizationSamples = in_ext->extendedDynamicState3RasterizationSamples; - out_ext->extendedDynamicState3SampleMask = in_ext->extendedDynamicState3SampleMask; - out_ext->extendedDynamicState3AlphaToCoverageEnable = in_ext->extendedDynamicState3AlphaToCoverageEnable; - out_ext->extendedDynamicState3AlphaToOneEnable = in_ext->extendedDynamicState3AlphaToOneEnable; - out_ext->extendedDynamicState3LogicOpEnable = in_ext->extendedDynamicState3LogicOpEnable; - out_ext->extendedDynamicState3ColorBlendEnable = in_ext->extendedDynamicState3ColorBlendEnable; - out_ext->extendedDynamicState3ColorBlendEquation = in_ext->extendedDynamicState3ColorBlendEquation; - out_ext->extendedDynamicState3ColorWriteMask = in_ext->extendedDynamicState3ColorWriteMask; - out_ext->extendedDynamicState3RasterizationStream = in_ext->extendedDynamicState3RasterizationStream; - out_ext->extendedDynamicState3ConservativeRasterizationMode = in_ext->extendedDynamicState3ConservativeRasterizationMode; - out_ext->extendedDynamicState3ExtraPrimitiveOverestimationSize = in_ext->extendedDynamicState3ExtraPrimitiveOverestimationSize; - out_ext->extendedDynamicState3DepthClipEnable = in_ext->extendedDynamicState3DepthClipEnable; - out_ext->extendedDynamicState3SampleLocationsEnable = in_ext->extendedDynamicState3SampleLocationsEnable; - out_ext->extendedDynamicState3ColorBlendAdvanced = in_ext->extendedDynamicState3ColorBlendAdvanced; - out_ext->extendedDynamicState3ProvokingVertexMode = in_ext->extendedDynamicState3ProvokingVertexMode; - out_ext->extendedDynamicState3LineRasterizationMode = in_ext->extendedDynamicState3LineRasterizationMode; - out_ext->extendedDynamicState3LineStippleEnable = in_ext->extendedDynamicState3LineStippleEnable; - out_ext->extendedDynamicState3DepthClipNegativeOneToOne = in_ext->extendedDynamicState3DepthClipNegativeOneToOne; - out_ext->extendedDynamicState3ViewportWScalingEnable = in_ext->extendedDynamicState3ViewportWScalingEnable; - out_ext->extendedDynamicState3ViewportSwizzle = in_ext->extendedDynamicState3ViewportSwizzle; - out_ext->extendedDynamicState3CoverageToColorEnable = in_ext->extendedDynamicState3CoverageToColorEnable; - out_ext->extendedDynamicState3CoverageToColorLocation = in_ext->extendedDynamicState3CoverageToColorLocation; - out_ext->extendedDynamicState3CoverageModulationMode = in_ext->extendedDynamicState3CoverageModulationMode; - out_ext->extendedDynamicState3CoverageModulationTableEnable = in_ext->extendedDynamicState3CoverageModulationTableEnable; - out_ext->extendedDynamicState3CoverageModulationTable = in_ext->extendedDynamicState3CoverageModulationTable; - out_ext->extendedDynamicState3CoverageReductionMode = in_ext->extendedDynamicState3CoverageReductionMode; - out_ext->extendedDynamicState3RepresentativeFragmentTestEnable = in_ext->extendedDynamicState3RepresentativeFragmentTestEnable; - out_ext->extendedDynamicState3ShadingRateImageEnable = in_ext->extendedDynamicState3ShadingRateImageEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: - { - VkPhysicalDeviceDiagnosticsConfigFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDiagnosticsConfigFeaturesNV32 *in_ext = (const VkPhysicalDeviceDiagnosticsConfigFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->diagnosticsConfig = in_ext->diagnosticsConfig; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES: - { - VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures32 *in_ext = (const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderZeroInitializeWorkgroupMemory = in_ext->shaderZeroInitializeWorkgroupMemory; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: - { - VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR32 *in_ext = (const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderSubgroupUniformControlFlow = in_ext->shaderSubgroupUniformControlFlow; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: - { - VkPhysicalDeviceRobustness2FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRobustness2FeaturesEXT32 *in_ext = (const VkPhysicalDeviceRobustness2FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->robustBufferAccess2 = in_ext->robustBufferAccess2; - out_ext->robustImageAccess2 = in_ext->robustImageAccess2; - out_ext->nullDescriptor = in_ext->nullDescriptor; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES: - { - VkPhysicalDeviceImageRobustnessFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageRobustnessFeatures32 *in_ext = (const VkPhysicalDeviceImageRobustnessFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES; - out_ext->pNext = NULL; - out_ext->robustImageAccess = in_ext->robustImageAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: - { - VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR32 *in_ext = (const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->workgroupMemoryExplicitLayout = in_ext->workgroupMemoryExplicitLayout; - out_ext->workgroupMemoryExplicitLayoutScalarBlockLayout = in_ext->workgroupMemoryExplicitLayoutScalarBlockLayout; - out_ext->workgroupMemoryExplicitLayout8BitAccess = in_ext->workgroupMemoryExplicitLayout8BitAccess; - out_ext->workgroupMemoryExplicitLayout16BitAccess = in_ext->workgroupMemoryExplicitLayout16BitAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: - { - VkPhysicalDevice4444FormatsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevice4444FormatsFeaturesEXT32 *in_ext = (const VkPhysicalDevice4444FormatsFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->formatA4R4G4B4 = in_ext->formatA4R4G4B4; - out_ext->formatA4B4G4R4 = in_ext->formatA4B4G4R4; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: - { - VkPhysicalDeviceSubpassShadingFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI32 *in_ext = (const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->subpassShading = in_ext->subpassShading; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI: - { - VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI32 *in_ext = (const VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->clustercullingShader = in_ext->clustercullingShader; - out_ext->multiviewClusterCullingShader = in_ext->multiviewClusterCullingShader; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: - { - VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderImageInt64Atomics = in_ext->shaderImageInt64Atomics; - out_ext->sparseImageInt64Atomics = in_ext->sparseImageInt64Atomics; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: - { - VkPhysicalDeviceFragmentShadingRateFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShadingRateFeaturesKHR32 *in_ext = (const VkPhysicalDeviceFragmentShadingRateFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->pipelineFragmentShadingRate = in_ext->pipelineFragmentShadingRate; - out_ext->primitiveFragmentShadingRate = in_ext->primitiveFragmentShadingRate; - out_ext->attachmentFragmentShadingRate = in_ext->attachmentFragmentShadingRate; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES: - { - VkPhysicalDeviceShaderTerminateInvocationFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderTerminateInvocationFeatures32 *in_ext = (const VkPhysicalDeviceShaderTerminateInvocationFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderTerminateInvocation = in_ext->shaderTerminateInvocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: - { - VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV32 *in_ext = (const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->fragmentShadingRateEnums = in_ext->fragmentShadingRateEnums; - out_ext->supersampleFragmentShadingRates = in_ext->supersampleFragmentShadingRates; - out_ext->noInvocationFragmentShadingRates = in_ext->noInvocationFragmentShadingRates; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT: - { - VkPhysicalDeviceImage2DViewOf3DFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImage2DViewOf3DFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImage2DViewOf3DFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->image2DViewOf3D = in_ext->image2DViewOf3D; - out_ext->sampler2DViewOf3D = in_ext->sampler2DViewOf3D; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT: - { - VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->imageSlicedViewOf3D = in_ext->imageSlicedViewOf3D; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT32 *in_ext = (const VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->attachmentFeedbackLoopDynamicState = in_ext->attachmentFeedbackLoopDynamicState; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT: - { - VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT32 *in_ext = (const VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->legacyVertexAttributes = in_ext->legacyVertexAttributes; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT: - { - VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->mutableDescriptorType = in_ext->mutableDescriptorType; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthClipControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClipControlFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDepthClipControlFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClipControl = in_ext->depthClipControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_EXT: - { - VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->deviceGeneratedCommands = in_ext->deviceGeneratedCommands; - out_ext->dynamicGeneratedPipelineLayout = in_ext->dynamicGeneratedPipelineLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthClampControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClampControlFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDepthClampControlFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClampControl = in_ext->depthClampControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT32 *in_ext = (const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->vertexInputDynamicState = in_ext->vertexInputDynamicState; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR: - { - VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR32 *in_ext = (const VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderRelaxedExtendedInstruction = in_ext->shaderRelaxedExtendedInstruction; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: - { - VkPhysicalDeviceColorWriteEnableFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceColorWriteEnableFeaturesEXT32 *in_ext = (const VkPhysicalDeviceColorWriteEnableFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->colorWriteEnable = in_ext->colorWriteEnable; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES: - { - VkPhysicalDeviceSynchronization2Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSynchronization2Features32 *in_ext = (const VkPhysicalDeviceSynchronization2Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES; - out_ext->pNext = NULL; - out_ext->synchronization2 = in_ext->synchronization2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES: - { - VkPhysicalDeviceHostImageCopyFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceHostImageCopyFeatures32 *in_ext = (const VkPhysicalDeviceHostImageCopyFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES; - out_ext->pNext = NULL; - out_ext->hostImageCopy = in_ext->hostImageCopy; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT: - { - VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT32 *in_ext = (const VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->primitivesGeneratedQuery = in_ext->primitivesGeneratedQuery; - out_ext->primitivesGeneratedQueryWithRasterizerDiscard = in_ext->primitivesGeneratedQueryWithRasterizerDiscard; - out_ext->primitivesGeneratedQueryWithNonZeroStreams = in_ext->primitivesGeneratedQueryWithNonZeroStreams; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT: - { - VkPhysicalDeviceLegacyDitheringFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLegacyDitheringFeaturesEXT32 *in_ext = (const VkPhysicalDeviceLegacyDitheringFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->legacyDithering = in_ext->legacyDithering; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT: - { - VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->multisampledRenderToSingleSampled = in_ext->multisampledRenderToSingleSampled; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES: - { - VkPhysicalDevicePipelineProtectedAccessFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineProtectedAccessFeatures32 *in_ext = (const VkPhysicalDevicePipelineProtectedAccessFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES; - out_ext->pNext = NULL; - out_ext->pipelineProtectedAccess = in_ext->pipelineProtectedAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR: - { - VkPhysicalDeviceVideoMaintenance1FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVideoMaintenance1FeaturesKHR32 *in_ext = (const VkPhysicalDeviceVideoMaintenance1FeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->videoMaintenance1 = in_ext->videoMaintenance1; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUANTIZATION_MAP_FEATURES_KHR: - { - VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR32 *in_ext = (const VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUANTIZATION_MAP_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->videoEncodeQuantizationMap = in_ext->videoEncodeQuantizationMap; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_AV1_FEATURES_KHR: - { - VkPhysicalDeviceVideoEncodeAV1FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVideoEncodeAV1FeaturesKHR32 *in_ext = (const VkPhysicalDeviceVideoEncodeAV1FeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_AV1_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->videoEncodeAV1 = in_ext->videoEncodeAV1; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: - { - VkPhysicalDeviceInheritedViewportScissorFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceInheritedViewportScissorFeaturesNV32 *in_ext = (const VkPhysicalDeviceInheritedViewportScissorFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->inheritedViewportScissor2D = in_ext->inheritedViewportScissor2D; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: - { - VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT32 *in_ext = (const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->ycbcr2plane444Formats = in_ext->ycbcr2plane444Formats; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: - { - VkPhysicalDeviceProvokingVertexFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceProvokingVertexFeaturesEXT32 *in_ext = (const VkPhysicalDeviceProvokingVertexFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->provokingVertexLast = in_ext->provokingVertexLast; - out_ext->transformFeedbackPreservesProvokingVertex = in_ext->transformFeedbackPreservesProvokingVertex; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT: - { - VkPhysicalDeviceDescriptorBufferFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorBufferFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDescriptorBufferFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->descriptorBuffer = in_ext->descriptorBuffer; - out_ext->descriptorBufferCaptureReplay = in_ext->descriptorBufferCaptureReplay; - out_ext->descriptorBufferImageLayoutIgnored = in_ext->descriptorBufferImageLayoutIgnored; - out_ext->descriptorBufferPushDescriptors = in_ext->descriptorBufferPushDescriptors; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: - { - VkPhysicalDeviceShaderIntegerDotProductFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderIntegerDotProductFeatures32 *in_ext = (const VkPhysicalDeviceShaderIntegerDotProductFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderIntegerDotProduct = in_ext->shaderIntegerDotProduct; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR: - { - VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR32 *in_ext = (const VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->fragmentShaderBarycentric = in_ext->fragmentShaderBarycentric; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: - { - VkPhysicalDeviceRayTracingMotionBlurFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV32 *in_ext = (const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->rayTracingMotionBlur = in_ext->rayTracingMotionBlur; - out_ext->rayTracingMotionBlurPipelineTraceRaysIndirect = in_ext->rayTracingMotionBlurPipelineTraceRaysIndirect; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_VALIDATION_FEATURES_NV: - { - VkPhysicalDeviceRayTracingValidationFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingValidationFeaturesNV32 *in_ext = (const VkPhysicalDeviceRayTracingValidationFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_VALIDATION_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->rayTracingValidation = in_ext->rayTracingValidation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: - { - VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT32 *in_ext = (const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->formatRgba10x6WithoutYCbCrSampler = in_ext->formatRgba10x6WithoutYCbCrSampler; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES: - { - VkPhysicalDeviceDynamicRenderingFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDynamicRenderingFeatures32 *in_ext = (const VkPhysicalDeviceDynamicRenderingFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES; - out_ext->pNext = NULL; - out_ext->dynamicRendering = in_ext->dynamicRendering; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT: - { - VkPhysicalDeviceImageViewMinLodFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageViewMinLodFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImageViewMinLodFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->minLod = in_ext->minLod; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT: - { - VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT32 *in_ext = (const VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->rasterizationOrderColorAttachmentAccess = in_ext->rasterizationOrderColorAttachmentAccess; - out_ext->rasterizationOrderDepthAttachmentAccess = in_ext->rasterizationOrderDepthAttachmentAccess; - out_ext->rasterizationOrderStencilAttachmentAccess = in_ext->rasterizationOrderStencilAttachmentAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV: - { - VkPhysicalDeviceLinearColorAttachmentFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLinearColorAttachmentFeaturesNV32 *in_ext = (const VkPhysicalDeviceLinearColorAttachmentFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->linearColorAttachment = in_ext->linearColorAttachment; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT: - { - VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT32 *in_ext = (const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->graphicsPipelineLibrary = in_ext->graphicsPipelineLibrary; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR: - { - VkPhysicalDevicePipelineBinaryFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineBinaryFeaturesKHR32 *in_ext = (const VkPhysicalDevicePipelineBinaryFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->pipelineBinaries = in_ext->pipelineBinaries; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE: - { - VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE32 *in_ext = (const VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE; - out_ext->pNext = NULL; - out_ext->descriptorSetHostMapping = in_ext->descriptorSetHostMapping; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT: - { - VkPhysicalDeviceNestedCommandBufferFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceNestedCommandBufferFeaturesEXT32 *in_ext = (const VkPhysicalDeviceNestedCommandBufferFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->nestedCommandBuffer = in_ext->nestedCommandBuffer; - out_ext->nestedCommandBufferRendering = in_ext->nestedCommandBufferRendering; - out_ext->nestedCommandBufferSimultaneousUse = in_ext->nestedCommandBufferSimultaneousUse; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT: - { - VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderModuleIdentifier = in_ext->shaderModuleIdentifier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceImageCompressionControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageCompressionControlFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImageCompressionControlFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->imageCompressionControl = in_ext->imageCompressionControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT: - { - VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT32 *in_ext = (const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->imageCompressionControlSwapchain = in_ext->imageCompressionControlSwapchain; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT: - { - VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT32 *in_ext = (const VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->subpassMergeFeedback = in_ext->subpassMergeFeedback; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT: - { - VkPhysicalDeviceOpacityMicromapFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceOpacityMicromapFeaturesEXT32 *in_ext = (const VkPhysicalDeviceOpacityMicromapFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->micromap = in_ext->micromap; - out_ext->micromapCaptureReplay = in_ext->micromapCaptureReplay; - out_ext->micromapHostCommands = in_ext->micromapHostCommands; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT: - { - VkPhysicalDevicePipelinePropertiesFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelinePropertiesFeaturesEXT32 *in_ext = (const VkPhysicalDevicePipelinePropertiesFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pipelinePropertiesIdentifier = in_ext->pipelinePropertiesIdentifier; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD: - { - VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD32 *in_ext = (const VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD; - out_ext->pNext = NULL; - out_ext->shaderEarlyAndLateFragmentTests = in_ext->shaderEarlyAndLateFragmentTests; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT: - { - VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT32 *in_ext = (const VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->nonSeamlessCubeMap = in_ext->nonSeamlessCubeMap; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES: - { - VkPhysicalDevicePipelineRobustnessFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineRobustnessFeatures32 *in_ext = (const VkPhysicalDevicePipelineRobustnessFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES; - out_ext->pNext = NULL; - out_ext->pipelineRobustness = in_ext->pipelineRobustness; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM: - { - VkPhysicalDeviceImageProcessingFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageProcessingFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceImageProcessingFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->textureSampleWeighted = in_ext->textureSampleWeighted; - out_ext->textureBoxFilter = in_ext->textureBoxFilter; - out_ext->textureBlockMatch = in_ext->textureBlockMatch; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM: - { - VkPhysicalDeviceTilePropertiesFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceTilePropertiesFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceTilePropertiesFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->tileProperties = in_ext->tileProperties; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT: - { - VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT32 *in_ext = (const VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->attachmentFeedbackLoopLayout = in_ext->attachmentFeedbackLoopLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT: - { - VkPhysicalDeviceDepthClampZeroOneFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthClampZeroOneFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDepthClampZeroOneFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthClampZeroOne = in_ext->depthClampZeroOne; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT: - { - VkPhysicalDeviceAddressBindingReportFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAddressBindingReportFeaturesEXT32 *in_ext = (const VkPhysicalDeviceAddressBindingReportFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->reportAddressBinding = in_ext->reportAddressBinding; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV: - { - VkPhysicalDeviceOpticalFlowFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceOpticalFlowFeaturesNV32 *in_ext = (const VkPhysicalDeviceOpticalFlowFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->opticalFlow = in_ext->opticalFlow; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT: - { - VkPhysicalDeviceFaultFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFaultFeaturesEXT32 *in_ext = (const VkPhysicalDeviceFaultFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->deviceFault = in_ext->deviceFault; - out_ext->deviceFaultVendorBinary = in_ext->deviceFaultVendorBinary; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT: - { - VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT32 *in_ext = (const VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->pipelineLibraryGroupHandles = in_ext->pipelineLibraryGroupHandles; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM: - { - VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM32 *in_ext = (const VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM; - out_ext->pNext = NULL; - out_ext->shaderCoreBuiltins = in_ext->shaderCoreBuiltins; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT: - { - VkPhysicalDeviceFrameBoundaryFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFrameBoundaryFeaturesEXT32 *in_ext = (const VkPhysicalDeviceFrameBoundaryFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->frameBoundary = in_ext->frameBoundary; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT: - { - VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->dynamicRenderingUnusedAttachments = in_ext->dynamicRenderingUnusedAttachments; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT: - { - VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT32 *in_ext = (const VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->swapchainMaintenance1 = in_ext->swapchainMaintenance1; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthBiasControlFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDepthBiasControlFeaturesEXT32 *in_ext = (const VkPhysicalDeviceDepthBiasControlFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->depthBiasControl = in_ext->depthBiasControl; - out_ext->leastRepresentableValueForceUnormRepresentation = in_ext->leastRepresentableValueForceUnormRepresentation; - out_ext->floatRepresentation = in_ext->floatRepresentation; - out_ext->depthBiasExact = in_ext->depthBiasExact; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV: - { - VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV32 *in_ext = (const VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->rayTracingInvocationReorder = in_ext->rayTracingInvocationReorder; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV: - { - VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV32 *in_ext = (const VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->extendedSparseAddressSpace = in_ext->extendedSparseAddressSpace; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM: - { - VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->multiviewPerViewViewports = in_ext->multiviewPerViewViewports; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR32 *in_ext = (const VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->rayTracingPositionFetch = in_ext->rayTracingPositionFetch; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM: - { - VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->multiviewPerViewRenderAreas = in_ext->multiviewPerViewRenderAreas; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT: - { - VkPhysicalDeviceShaderObjectFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderObjectFeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderObjectFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderObject = in_ext->shaderObject; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT: - { - VkPhysicalDeviceShaderTileImageFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderTileImageFeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderTileImageFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderTileImageColorReadAccess = in_ext->shaderTileImageColorReadAccess; - out_ext->shaderTileImageDepthReadAccess = in_ext->shaderTileImageDepthReadAccess; - out_ext->shaderTileImageStencilReadAccess = in_ext->shaderTileImageStencilReadAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR: - { - VkPhysicalDeviceCooperativeMatrixFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCooperativeMatrixFeaturesKHR32 *in_ext = (const VkPhysicalDeviceCooperativeMatrixFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->cooperativeMatrix = in_ext->cooperativeMatrix; - out_ext->cooperativeMatrixRobustBufferAccess = in_ext->cooperativeMatrixRobustBufferAccess; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ANTI_LAG_FEATURES_AMD: - { - VkPhysicalDeviceAntiLagFeaturesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceAntiLagFeaturesAMD32 *in_ext = (const VkPhysicalDeviceAntiLagFeaturesAMD32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ANTI_LAG_FEATURES_AMD; - out_ext->pNext = NULL; - out_ext->antiLag = in_ext->antiLag; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM: - { - VkPhysicalDeviceCubicClampFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCubicClampFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceCubicClampFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->cubicRangeClamp = in_ext->cubicRangeClamp; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM: - { - VkPhysicalDeviceYcbcrDegammaFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceYcbcrDegammaFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceYcbcrDegammaFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->ycbcrDegamma = in_ext->ycbcrDegamma; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM: - { - VkPhysicalDeviceCubicWeightsFeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCubicWeightsFeaturesQCOM32 *in_ext = (const VkPhysicalDeviceCubicWeightsFeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->selectableCubicWeights = in_ext->selectableCubicWeights; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM: - { - VkPhysicalDeviceImageProcessing2FeaturesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageProcessing2FeaturesQCOM32 *in_ext = (const VkPhysicalDeviceImageProcessing2FeaturesQCOM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM; - out_ext->pNext = NULL; - out_ext->textureBlockMatch2 = in_ext->textureBlockMatch2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV: - { - VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV32 *in_ext = (const VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->descriptorPoolOverallocation = in_ext->descriptorPoolOverallocation; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PER_STAGE_DESCRIPTOR_SET_FEATURES_NV: - { - VkPhysicalDevicePerStageDescriptorSetFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePerStageDescriptorSetFeaturesNV32 *in_ext = (const VkPhysicalDevicePerStageDescriptorSetFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PER_STAGE_DESCRIPTOR_SET_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->perStageDescriptorSet = in_ext->perStageDescriptorSet; - out_ext->dynamicPipelineLayout = in_ext->dynamicPipelineLayout; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV: - { - VkPhysicalDeviceCudaKernelLaunchFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCudaKernelLaunchFeaturesNV32 *in_ext = (const VkPhysicalDeviceCudaKernelLaunchFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cudaKernelLaunchFeatures = in_ext->cudaKernelLaunchFeatures; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM: - { - VkPhysicalDeviceSchedulingControlsFeaturesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSchedulingControlsFeaturesARM32 *in_ext = (const VkPhysicalDeviceSchedulingControlsFeaturesARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM; - out_ext->pNext = NULL; - out_ext->schedulingControls = in_ext->schedulingControls; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG: - { - VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG32 *in_ext = (const VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG; - out_ext->pNext = NULL; - out_ext->relaxedLineRasterization = in_ext->relaxedLineRasterization; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_FEATURES_ARM: - { - VkPhysicalDeviceRenderPassStripedFeaturesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRenderPassStripedFeaturesARM32 *in_ext = (const VkPhysicalDeviceRenderPassStripedFeaturesARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_FEATURES_ARM; - out_ext->pNext = NULL; - out_ext->renderPassStriped = in_ext->renderPassStriped; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR: - { - VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR32 *in_ext = (const VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderMaximalReconvergence = in_ext->shaderMaximalReconvergence; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES: - { - VkPhysicalDeviceShaderSubgroupRotateFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderSubgroupRotateFeatures32 *in_ext = (const VkPhysicalDeviceShaderSubgroupRotateFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderSubgroupRotate = in_ext->shaderSubgroupRotate; - out_ext->shaderSubgroupRotateClustered = in_ext->shaderSubgroupRotateClustered; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES: - { - VkPhysicalDeviceShaderExpectAssumeFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderExpectAssumeFeatures32 *in_ext = (const VkPhysicalDeviceShaderExpectAssumeFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderExpectAssume = in_ext->shaderExpectAssume; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES: - { - VkPhysicalDeviceShaderFloatControls2Features *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderFloatControls2Features32 *in_ext = (const VkPhysicalDeviceShaderFloatControls2Features32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES; - out_ext->pNext = NULL; - out_ext->shaderFloatControls2 = in_ext->shaderFloatControls2; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES: - { - VkPhysicalDeviceDynamicRenderingLocalReadFeatures *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceDynamicRenderingLocalReadFeatures32 *in_ext = (const VkPhysicalDeviceDynamicRenderingLocalReadFeatures32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES; - out_ext->pNext = NULL; - out_ext->dynamicRenderingLocalRead = in_ext->dynamicRenderingLocalRead; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_QUAD_CONTROL_FEATURES_KHR: - { - VkPhysicalDeviceShaderQuadControlFeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderQuadControlFeaturesKHR32 *in_ext = (const VkPhysicalDeviceShaderQuadControlFeaturesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_QUAD_CONTROL_FEATURES_KHR; - out_ext->pNext = NULL; - out_ext->shaderQuadControl = in_ext->shaderQuadControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT16_VECTOR_FEATURES_NV: - { - VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV32 *in_ext = (const VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT16_VECTOR_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->shaderFloat16VectorAtomics = in_ext->shaderFloat16VectorAtomics; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_FEATURES_EXT: - { - VkPhysicalDeviceMapMemoryPlacedFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceMapMemoryPlacedFeaturesEXT32 *in_ext = (const VkPhysicalDeviceMapMemoryPlacedFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->memoryMapPlaced = in_ext->memoryMapPlaced; - out_ext->memoryMapRangePlaced = in_ext->memoryMapRangePlaced; - out_ext->memoryUnmapReserve = in_ext->memoryUnmapReserve; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAW_ACCESS_CHAINS_FEATURES_NV: - { - VkPhysicalDeviceRawAccessChainsFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceRawAccessChainsFeaturesNV32 *in_ext = (const VkPhysicalDeviceRawAccessChainsFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAW_ACCESS_CHAINS_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->shaderRawAccessChains = in_ext->shaderRawAccessChains; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMMAND_BUFFER_INHERITANCE_FEATURES_NV: - { - VkPhysicalDeviceCommandBufferInheritanceFeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCommandBufferInheritanceFeaturesNV32 *in_ext = (const VkPhysicalDeviceCommandBufferInheritanceFeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMMAND_BUFFER_INHERITANCE_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->commandBufferInheritance = in_ext->commandBufferInheritance; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_FEATURES_MESA: - { - VkPhysicalDeviceImageAlignmentControlFeaturesMESA *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageAlignmentControlFeaturesMESA32 *in_ext = (const VkPhysicalDeviceImageAlignmentControlFeaturesMESA32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_FEATURES_MESA; - out_ext->pNext = NULL; - out_ext->imageAlignmentControl = in_ext->imageAlignmentControl; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_REPLICATED_COMPOSITES_FEATURES_EXT: - { - VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT32 *in_ext = (const VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_REPLICATED_COMPOSITES_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->shaderReplicatedComposites = in_ext->shaderReplicatedComposites; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT: - { - VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT32 *in_ext = (const VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->presentModeFifoLatestReady = in_ext->presentModeFifoLatestReady; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_FEATURES_NV: - { - VkPhysicalDeviceCooperativeMatrix2FeaturesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceCooperativeMatrix2FeaturesNV32 *in_ext = (const VkPhysicalDeviceCooperativeMatrix2FeaturesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_FEATURES_NV; - out_ext->pNext = NULL; - out_ext->cooperativeMatrixWorkgroupScope = in_ext->cooperativeMatrixWorkgroupScope; - out_ext->cooperativeMatrixFlexibleDimensions = in_ext->cooperativeMatrixFlexibleDimensions; - out_ext->cooperativeMatrixReductions = in_ext->cooperativeMatrixReductions; - out_ext->cooperativeMatrixConversions = in_ext->cooperativeMatrixConversions; - out_ext->cooperativeMatrixPerElementOperations = in_ext->cooperativeMatrixPerElementOperations; - out_ext->cooperativeMatrixTensorAddressing = in_ext->cooperativeMatrixTensorAddressing; - out_ext->cooperativeMatrixBlockLoads = in_ext->cooperativeMatrixBlockLoads; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HDR_VIVID_FEATURES_HUAWEI: - { - VkPhysicalDeviceHdrVividFeaturesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceHdrVividFeaturesHUAWEI32 *in_ext = (const VkPhysicalDeviceHdrVividFeaturesHUAWEI32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HDR_VIVID_FEATURES_HUAWEI; - out_ext->pNext = NULL; - out_ext->hdrVivid = in_ext->hdrVivid; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_ROBUSTNESS_FEATURES_EXT: - { - VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT32 *in_ext = (const VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_ROBUSTNESS_FEATURES_EXT; - out_ext->pNext = NULL; - out_ext->vertexAttributeRobustness = in_ext->vertexAttributeRobustness; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkPhysicalDeviceFeatures2_host_to_win32(const VkPhysicalDeviceFeatures2 *in, VkPhysicalDeviceFeatures232 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - out->features = in->features; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV); - const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV; - out_ext->deviceGeneratedCommands = in_ext->deviceGeneratedCommands; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV); - const VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV; - out_ext->deviceGeneratedCompute = in_ext->deviceGeneratedCompute; - out_ext->deviceGeneratedComputePipelines = in_ext->deviceGeneratedComputePipelines; - out_ext->deviceGeneratedComputeCaptureReplay = in_ext->deviceGeneratedComputeCaptureReplay; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES: - { - VkPhysicalDevicePrivateDataFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES); - const VkPhysicalDevicePrivateDataFeatures *in_ext = (const VkPhysicalDevicePrivateDataFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES; - out_ext->privateData = in_ext->privateData; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: - { - VkPhysicalDeviceVariablePointersFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES); - const VkPhysicalDeviceVariablePointersFeatures *in_ext = (const VkPhysicalDeviceVariablePointersFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES; - out_ext->variablePointersStorageBuffer = in_ext->variablePointersStorageBuffer; - out_ext->variablePointers = in_ext->variablePointers; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: - { - VkPhysicalDeviceMultiviewFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES); - const VkPhysicalDeviceMultiviewFeatures *in_ext = (const VkPhysicalDeviceMultiviewFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES; - out_ext->multiview = in_ext->multiview; - out_ext->multiviewGeometryShader = in_ext->multiviewGeometryShader; - out_ext->multiviewTessellationShader = in_ext->multiviewTessellationShader; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: - { - VkPhysicalDevicePresentIdFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR); - const VkPhysicalDevicePresentIdFeaturesKHR *in_ext = (const VkPhysicalDevicePresentIdFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR; - out_ext->presentId = in_ext->presentId; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: - { - VkPhysicalDevicePresentWaitFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR); - const VkPhysicalDevicePresentWaitFeaturesKHR *in_ext = (const VkPhysicalDevicePresentWaitFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR; - out_ext->presentWait = in_ext->presentWait; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: - { - VkPhysicalDevice16BitStorageFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES); - const VkPhysicalDevice16BitStorageFeatures *in_ext = (const VkPhysicalDevice16BitStorageFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES; - out_ext->storageBuffer16BitAccess = in_ext->storageBuffer16BitAccess; - out_ext->uniformAndStorageBuffer16BitAccess = in_ext->uniformAndStorageBuffer16BitAccess; - out_ext->storagePushConstant16 = in_ext->storagePushConstant16; - out_ext->storageInputOutput16 = in_ext->storageInputOutput16; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: - { - VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES); - const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *in_ext = (const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES; - out_ext->shaderSubgroupExtendedTypes = in_ext->shaderSubgroupExtendedTypes; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: - { - VkPhysicalDeviceSamplerYcbcrConversionFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES); - const VkPhysicalDeviceSamplerYcbcrConversionFeatures *in_ext = (const VkPhysicalDeviceSamplerYcbcrConversionFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES; - out_ext->samplerYcbcrConversion = in_ext->samplerYcbcrConversion; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: - { - VkPhysicalDeviceProtectedMemoryFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES); - const VkPhysicalDeviceProtectedMemoryFeatures *in_ext = (const VkPhysicalDeviceProtectedMemoryFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES; - out_ext->protectedMemory = in_ext->protectedMemory; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: - { - VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT); - const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *in_ext = (const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT; - out_ext->advancedBlendCoherentOperations = in_ext->advancedBlendCoherentOperations; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: - { - VkPhysicalDeviceMultiDrawFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT); - const VkPhysicalDeviceMultiDrawFeaturesEXT *in_ext = (const VkPhysicalDeviceMultiDrawFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT; - out_ext->multiDraw = in_ext->multiDraw; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES: - { - VkPhysicalDeviceInlineUniformBlockFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES); - const VkPhysicalDeviceInlineUniformBlockFeatures *in_ext = (const VkPhysicalDeviceInlineUniformBlockFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES; - out_ext->inlineUniformBlock = in_ext->inlineUniformBlock; - out_ext->descriptorBindingInlineUniformBlockUpdateAfterBind = in_ext->descriptorBindingInlineUniformBlockUpdateAfterBind; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES: - { - VkPhysicalDeviceMaintenance4Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES); - const VkPhysicalDeviceMaintenance4Features *in_ext = (const VkPhysicalDeviceMaintenance4Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES; - out_ext->maintenance4 = in_ext->maintenance4; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES: - { - VkPhysicalDeviceMaintenance5Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES); - const VkPhysicalDeviceMaintenance5Features *in_ext = (const VkPhysicalDeviceMaintenance5Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES; - out_ext->maintenance5 = in_ext->maintenance5; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES: - { - VkPhysicalDeviceMaintenance6Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES); - const VkPhysicalDeviceMaintenance6Features *in_ext = (const VkPhysicalDeviceMaintenance6Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES; - out_ext->maintenance6 = in_ext->maintenance6; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: - { - VkPhysicalDeviceShaderDrawParametersFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES); - const VkPhysicalDeviceShaderDrawParametersFeatures *in_ext = (const VkPhysicalDeviceShaderDrawParametersFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES; - out_ext->shaderDrawParameters = in_ext->shaderDrawParameters; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: - { - VkPhysicalDeviceShaderFloat16Int8Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES); - const VkPhysicalDeviceShaderFloat16Int8Features *in_ext = (const VkPhysicalDeviceShaderFloat16Int8Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES; - out_ext->shaderFloat16 = in_ext->shaderFloat16; - out_ext->shaderInt8 = in_ext->shaderInt8; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: - { - VkPhysicalDeviceHostQueryResetFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES); - const VkPhysicalDeviceHostQueryResetFeatures *in_ext = (const VkPhysicalDeviceHostQueryResetFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES; - out_ext->hostQueryReset = in_ext->hostQueryReset; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES: - { - VkPhysicalDeviceGlobalPriorityQueryFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES); - const VkPhysicalDeviceGlobalPriorityQueryFeatures *in_ext = (const VkPhysicalDeviceGlobalPriorityQueryFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES; - out_ext->globalPriorityQuery = in_ext->globalPriorityQuery; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: - { - VkPhysicalDeviceDescriptorIndexingFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES); - const VkPhysicalDeviceDescriptorIndexingFeatures *in_ext = (const VkPhysicalDeviceDescriptorIndexingFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES; - out_ext->shaderInputAttachmentArrayDynamicIndexing = in_ext->shaderInputAttachmentArrayDynamicIndexing; - out_ext->shaderUniformTexelBufferArrayDynamicIndexing = in_ext->shaderUniformTexelBufferArrayDynamicIndexing; - out_ext->shaderStorageTexelBufferArrayDynamicIndexing = in_ext->shaderStorageTexelBufferArrayDynamicIndexing; - out_ext->shaderUniformBufferArrayNonUniformIndexing = in_ext->shaderUniformBufferArrayNonUniformIndexing; - out_ext->shaderSampledImageArrayNonUniformIndexing = in_ext->shaderSampledImageArrayNonUniformIndexing; - out_ext->shaderStorageBufferArrayNonUniformIndexing = in_ext->shaderStorageBufferArrayNonUniformIndexing; - out_ext->shaderStorageImageArrayNonUniformIndexing = in_ext->shaderStorageImageArrayNonUniformIndexing; - out_ext->shaderInputAttachmentArrayNonUniformIndexing = in_ext->shaderInputAttachmentArrayNonUniformIndexing; - out_ext->shaderUniformTexelBufferArrayNonUniformIndexing = in_ext->shaderUniformTexelBufferArrayNonUniformIndexing; - out_ext->shaderStorageTexelBufferArrayNonUniformIndexing = in_ext->shaderStorageTexelBufferArrayNonUniformIndexing; - out_ext->descriptorBindingUniformBufferUpdateAfterBind = in_ext->descriptorBindingUniformBufferUpdateAfterBind; - out_ext->descriptorBindingSampledImageUpdateAfterBind = in_ext->descriptorBindingSampledImageUpdateAfterBind; - out_ext->descriptorBindingStorageImageUpdateAfterBind = in_ext->descriptorBindingStorageImageUpdateAfterBind; - out_ext->descriptorBindingStorageBufferUpdateAfterBind = in_ext->descriptorBindingStorageBufferUpdateAfterBind; - out_ext->descriptorBindingUniformTexelBufferUpdateAfterBind = in_ext->descriptorBindingUniformTexelBufferUpdateAfterBind; - out_ext->descriptorBindingStorageTexelBufferUpdateAfterBind = in_ext->descriptorBindingStorageTexelBufferUpdateAfterBind; - out_ext->descriptorBindingUpdateUnusedWhilePending = in_ext->descriptorBindingUpdateUnusedWhilePending; - out_ext->descriptorBindingPartiallyBound = in_ext->descriptorBindingPartiallyBound; - out_ext->descriptorBindingVariableDescriptorCount = in_ext->descriptorBindingVariableDescriptorCount; - out_ext->runtimeDescriptorArray = in_ext->runtimeDescriptorArray; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: - { - VkPhysicalDeviceTimelineSemaphoreFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES); - const VkPhysicalDeviceTimelineSemaphoreFeatures *in_ext = (const VkPhysicalDeviceTimelineSemaphoreFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES; - out_ext->timelineSemaphore = in_ext->timelineSemaphore; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: - { - VkPhysicalDevice8BitStorageFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES); - const VkPhysicalDevice8BitStorageFeatures *in_ext = (const VkPhysicalDevice8BitStorageFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES; - out_ext->storageBuffer8BitAccess = in_ext->storageBuffer8BitAccess; - out_ext->uniformAndStorageBuffer8BitAccess = in_ext->uniformAndStorageBuffer8BitAccess; - out_ext->storagePushConstant8 = in_ext->storagePushConstant8; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: - { - VkPhysicalDeviceConditionalRenderingFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT); - const VkPhysicalDeviceConditionalRenderingFeaturesEXT *in_ext = (const VkPhysicalDeviceConditionalRenderingFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT; - out_ext->conditionalRendering = in_ext->conditionalRendering; - out_ext->inheritedConditionalRendering = in_ext->inheritedConditionalRendering; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: - { - VkPhysicalDeviceVulkanMemoryModelFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES); - const VkPhysicalDeviceVulkanMemoryModelFeatures *in_ext = (const VkPhysicalDeviceVulkanMemoryModelFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES; - out_ext->vulkanMemoryModel = in_ext->vulkanMemoryModel; - out_ext->vulkanMemoryModelDeviceScope = in_ext->vulkanMemoryModelDeviceScope; - out_ext->vulkanMemoryModelAvailabilityVisibilityChains = in_ext->vulkanMemoryModelAvailabilityVisibilityChains; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: - { - VkPhysicalDeviceShaderAtomicInt64Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES); - const VkPhysicalDeviceShaderAtomicInt64Features *in_ext = (const VkPhysicalDeviceShaderAtomicInt64Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES; - out_ext->shaderBufferInt64Atomics = in_ext->shaderBufferInt64Atomics; - out_ext->shaderSharedInt64Atomics = in_ext->shaderSharedInt64Atomics; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: - { - VkPhysicalDeviceShaderAtomicFloatFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT); - const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *in_ext = (const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT; - out_ext->shaderBufferFloat32Atomics = in_ext->shaderBufferFloat32Atomics; - out_ext->shaderBufferFloat32AtomicAdd = in_ext->shaderBufferFloat32AtomicAdd; - out_ext->shaderBufferFloat64Atomics = in_ext->shaderBufferFloat64Atomics; - out_ext->shaderBufferFloat64AtomicAdd = in_ext->shaderBufferFloat64AtomicAdd; - out_ext->shaderSharedFloat32Atomics = in_ext->shaderSharedFloat32Atomics; - out_ext->shaderSharedFloat32AtomicAdd = in_ext->shaderSharedFloat32AtomicAdd; - out_ext->shaderSharedFloat64Atomics = in_ext->shaderSharedFloat64Atomics; - out_ext->shaderSharedFloat64AtomicAdd = in_ext->shaderSharedFloat64AtomicAdd; - out_ext->shaderImageFloat32Atomics = in_ext->shaderImageFloat32Atomics; - out_ext->shaderImageFloat32AtomicAdd = in_ext->shaderImageFloat32AtomicAdd; - out_ext->sparseImageFloat32Atomics = in_ext->sparseImageFloat32Atomics; - out_ext->sparseImageFloat32AtomicAdd = in_ext->sparseImageFloat32AtomicAdd; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: - { - VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT); - const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT *in_ext = (const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT; - out_ext->shaderBufferFloat16Atomics = in_ext->shaderBufferFloat16Atomics; - out_ext->shaderBufferFloat16AtomicAdd = in_ext->shaderBufferFloat16AtomicAdd; - out_ext->shaderBufferFloat16AtomicMinMax = in_ext->shaderBufferFloat16AtomicMinMax; - out_ext->shaderBufferFloat32AtomicMinMax = in_ext->shaderBufferFloat32AtomicMinMax; - out_ext->shaderBufferFloat64AtomicMinMax = in_ext->shaderBufferFloat64AtomicMinMax; - out_ext->shaderSharedFloat16Atomics = in_ext->shaderSharedFloat16Atomics; - out_ext->shaderSharedFloat16AtomicAdd = in_ext->shaderSharedFloat16AtomicAdd; - out_ext->shaderSharedFloat16AtomicMinMax = in_ext->shaderSharedFloat16AtomicMinMax; - out_ext->shaderSharedFloat32AtomicMinMax = in_ext->shaderSharedFloat32AtomicMinMax; - out_ext->shaderSharedFloat64AtomicMinMax = in_ext->shaderSharedFloat64AtomicMinMax; - out_ext->shaderImageFloat32AtomicMinMax = in_ext->shaderImageFloat32AtomicMinMax; - out_ext->sparseImageFloat32AtomicMinMax = in_ext->sparseImageFloat32AtomicMinMax; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES: - { - VkPhysicalDeviceVertexAttributeDivisorFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES); - const VkPhysicalDeviceVertexAttributeDivisorFeatures *in_ext = (const VkPhysicalDeviceVertexAttributeDivisorFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES; - out_ext->vertexAttributeInstanceRateDivisor = in_ext->vertexAttributeInstanceRateDivisor; - out_ext->vertexAttributeInstanceRateZeroDivisor = in_ext->vertexAttributeInstanceRateZeroDivisor; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: - { - VkPhysicalDeviceASTCDecodeFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT); - const VkPhysicalDeviceASTCDecodeFeaturesEXT *in_ext = (const VkPhysicalDeviceASTCDecodeFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT; - out_ext->decodeModeSharedExponent = in_ext->decodeModeSharedExponent; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: - { - VkPhysicalDeviceTransformFeedbackFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT); - const VkPhysicalDeviceTransformFeedbackFeaturesEXT *in_ext = (const VkPhysicalDeviceTransformFeedbackFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; - out_ext->transformFeedback = in_ext->transformFeedback; - out_ext->geometryStreams = in_ext->geometryStreams; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: - { - VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV); - const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV *in_ext = (const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV; - out_ext->representativeFragmentTest = in_ext->representativeFragmentTest; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: - { - VkPhysicalDeviceExclusiveScissorFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV); - const VkPhysicalDeviceExclusiveScissorFeaturesNV *in_ext = (const VkPhysicalDeviceExclusiveScissorFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV; - out_ext->exclusiveScissor = in_ext->exclusiveScissor; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: - { - VkPhysicalDeviceCornerSampledImageFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV); - const VkPhysicalDeviceCornerSampledImageFeaturesNV *in_ext = (const VkPhysicalDeviceCornerSampledImageFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV; - out_ext->cornerSampledImage = in_ext->cornerSampledImage; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR: - { - VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR); - const VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR *in_ext = (const VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR; - out_ext->computeDerivativeGroupQuads = in_ext->computeDerivativeGroupQuads; - out_ext->computeDerivativeGroupLinear = in_ext->computeDerivativeGroupLinear; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: - { - VkPhysicalDeviceShaderImageFootprintFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV); - const VkPhysicalDeviceShaderImageFootprintFeaturesNV *in_ext = (const VkPhysicalDeviceShaderImageFootprintFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV; - out_ext->imageFootprint = in_ext->imageFootprint; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: - { - VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV); - const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV *in_ext = (const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV; - out_ext->dedicatedAllocationImageAliasing = in_ext->dedicatedAllocationImageAliasing; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV: - { - VkPhysicalDeviceCopyMemoryIndirectFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV); - const VkPhysicalDeviceCopyMemoryIndirectFeaturesNV *in_ext = (const VkPhysicalDeviceCopyMemoryIndirectFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV; - out_ext->indirectCopy = in_ext->indirectCopy; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV: - { - VkPhysicalDeviceMemoryDecompressionFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV); - const VkPhysicalDeviceMemoryDecompressionFeaturesNV *in_ext = (const VkPhysicalDeviceMemoryDecompressionFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV; - out_ext->memoryDecompression = in_ext->memoryDecompression; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: - { - VkPhysicalDeviceShadingRateImageFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV); - const VkPhysicalDeviceShadingRateImageFeaturesNV *in_ext = (const VkPhysicalDeviceShadingRateImageFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV; - out_ext->shadingRateImage = in_ext->shadingRateImage; - out_ext->shadingRateCoarseSampleOrder = in_ext->shadingRateCoarseSampleOrder; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: - { - VkPhysicalDeviceInvocationMaskFeaturesHUAWEI32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI); - const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI *in_ext = (const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI; - out_ext->invocationMask = in_ext->invocationMask; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: - { - VkPhysicalDeviceMeshShaderFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV); - const VkPhysicalDeviceMeshShaderFeaturesNV *in_ext = (const VkPhysicalDeviceMeshShaderFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV; - out_ext->taskShader = in_ext->taskShader; - out_ext->meshShader = in_ext->meshShader; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT: - { - VkPhysicalDeviceMeshShaderFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT); - const VkPhysicalDeviceMeshShaderFeaturesEXT *in_ext = (const VkPhysicalDeviceMeshShaderFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT; - out_ext->taskShader = in_ext->taskShader; - out_ext->meshShader = in_ext->meshShader; - out_ext->multiviewMeshShader = in_ext->multiviewMeshShader; - out_ext->primitiveFragmentShadingRateMeshShader = in_ext->primitiveFragmentShadingRateMeshShader; - out_ext->meshShaderQueries = in_ext->meshShaderQueries; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: - { - VkPhysicalDeviceAccelerationStructureFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR); - const VkPhysicalDeviceAccelerationStructureFeaturesKHR *in_ext = (const VkPhysicalDeviceAccelerationStructureFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR; - out_ext->accelerationStructure = in_ext->accelerationStructure; - out_ext->accelerationStructureCaptureReplay = in_ext->accelerationStructureCaptureReplay; - out_ext->accelerationStructureIndirectBuild = in_ext->accelerationStructureIndirectBuild; - out_ext->accelerationStructureHostCommands = in_ext->accelerationStructureHostCommands; - out_ext->descriptorBindingAccelerationStructureUpdateAfterBind = in_ext->descriptorBindingAccelerationStructureUpdateAfterBind; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingPipelineFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR); - const VkPhysicalDeviceRayTracingPipelineFeaturesKHR *in_ext = (const VkPhysicalDeviceRayTracingPipelineFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR; - out_ext->rayTracingPipeline = in_ext->rayTracingPipeline; - out_ext->rayTracingPipelineShaderGroupHandleCaptureReplay = in_ext->rayTracingPipelineShaderGroupHandleCaptureReplay; - out_ext->rayTracingPipelineShaderGroupHandleCaptureReplayMixed = in_ext->rayTracingPipelineShaderGroupHandleCaptureReplayMixed; - out_ext->rayTracingPipelineTraceRaysIndirect = in_ext->rayTracingPipelineTraceRaysIndirect; - out_ext->rayTraversalPrimitiveCulling = in_ext->rayTraversalPrimitiveCulling; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: - { - VkPhysicalDeviceRayQueryFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR); - const VkPhysicalDeviceRayQueryFeaturesKHR *in_ext = (const VkPhysicalDeviceRayQueryFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR; - out_ext->rayQuery = in_ext->rayQuery; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR); - const VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR *in_ext = (const VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR; - out_ext->rayTracingMaintenance1 = in_ext->rayTracingMaintenance1; - out_ext->rayTracingPipelineTraceRaysIndirect2 = in_ext->rayTracingPipelineTraceRaysIndirect2; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: - { - VkPhysicalDeviceFragmentDensityMapFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT); - const VkPhysicalDeviceFragmentDensityMapFeaturesEXT *in_ext = (const VkPhysicalDeviceFragmentDensityMapFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT; - out_ext->fragmentDensityMap = in_ext->fragmentDensityMap; - out_ext->fragmentDensityMapDynamic = in_ext->fragmentDensityMapDynamic; - out_ext->fragmentDensityMapNonSubsampledImages = in_ext->fragmentDensityMapNonSubsampledImages; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: - { - VkPhysicalDeviceFragmentDensityMap2FeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT); - const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT *in_ext = (const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT; - out_ext->fragmentDensityMapDeferred = in_ext->fragmentDensityMapDeferred; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM: - { - VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM); - const VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM *in_ext = (const VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM; - out_ext->fragmentDensityMapOffset = in_ext->fragmentDensityMapOffset; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: - { - VkPhysicalDeviceScalarBlockLayoutFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES); - const VkPhysicalDeviceScalarBlockLayoutFeatures *in_ext = (const VkPhysicalDeviceScalarBlockLayoutFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES; - out_ext->scalarBlockLayout = in_ext->scalarBlockLayout; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: - { - VkPhysicalDeviceUniformBufferStandardLayoutFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES); - const VkPhysicalDeviceUniformBufferStandardLayoutFeatures *in_ext = (const VkPhysicalDeviceUniformBufferStandardLayoutFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES; - out_ext->uniformBufferStandardLayout = in_ext->uniformBufferStandardLayout; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: - { - VkPhysicalDeviceDepthClipEnableFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT); - const VkPhysicalDeviceDepthClipEnableFeaturesEXT *in_ext = (const VkPhysicalDeviceDepthClipEnableFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT; - out_ext->depthClipEnable = in_ext->depthClipEnable; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: - { - VkPhysicalDeviceMemoryPriorityFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT); - const VkPhysicalDeviceMemoryPriorityFeaturesEXT *in_ext = (const VkPhysicalDeviceMemoryPriorityFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT; - out_ext->memoryPriority = in_ext->memoryPriority; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: - { - VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT); - const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT *in_ext = (const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT; - out_ext->pageableDeviceLocalMemory = in_ext->pageableDeviceLocalMemory; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: - { - VkPhysicalDeviceBufferDeviceAddressFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES); - const VkPhysicalDeviceBufferDeviceAddressFeatures *in_ext = (const VkPhysicalDeviceBufferDeviceAddressFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: - { - VkPhysicalDeviceBufferDeviceAddressFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT); - const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *in_ext = (const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: - { - VkPhysicalDeviceImagelessFramebufferFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES); - const VkPhysicalDeviceImagelessFramebufferFeatures *in_ext = (const VkPhysicalDeviceImagelessFramebufferFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES; - out_ext->imagelessFramebuffer = in_ext->imagelessFramebuffer; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES: - { - VkPhysicalDeviceTextureCompressionASTCHDRFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES); - const VkPhysicalDeviceTextureCompressionASTCHDRFeatures *in_ext = (const VkPhysicalDeviceTextureCompressionASTCHDRFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES; - out_ext->textureCompressionASTC_HDR = in_ext->textureCompressionASTC_HDR; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: - { - VkPhysicalDeviceCooperativeMatrixFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV); - const VkPhysicalDeviceCooperativeMatrixFeaturesNV *in_ext = (const VkPhysicalDeviceCooperativeMatrixFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV; - out_ext->cooperativeMatrix = in_ext->cooperativeMatrix; - out_ext->cooperativeMatrixRobustBufferAccess = in_ext->cooperativeMatrixRobustBufferAccess; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: - { - VkPhysicalDeviceYcbcrImageArraysFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT); - const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *in_ext = (const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT; - out_ext->ycbcrImageArrays = in_ext->ycbcrImageArrays; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV: - { - VkPhysicalDevicePresentBarrierFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV); - const VkPhysicalDevicePresentBarrierFeaturesNV *in_ext = (const VkPhysicalDevicePresentBarrierFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV; - out_ext->presentBarrier = in_ext->presentBarrier; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: - { - VkPhysicalDevicePerformanceQueryFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR); - const VkPhysicalDevicePerformanceQueryFeaturesKHR *in_ext = (const VkPhysicalDevicePerformanceQueryFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR; - out_ext->performanceCounterQueryPools = in_ext->performanceCounterQueryPools; - out_ext->performanceCounterMultipleQueryPools = in_ext->performanceCounterMultipleQueryPools; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: - { - VkPhysicalDeviceCoverageReductionModeFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV); - const VkPhysicalDeviceCoverageReductionModeFeaturesNV *in_ext = (const VkPhysicalDeviceCoverageReductionModeFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV; - out_ext->coverageReductionMode = in_ext->coverageReductionMode; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: - { - VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL); - const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL *in_ext = (const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL; - out_ext->shaderIntegerFunctions2 = in_ext->shaderIntegerFunctions2; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: - { - VkPhysicalDeviceShaderClockFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR); - const VkPhysicalDeviceShaderClockFeaturesKHR *in_ext = (const VkPhysicalDeviceShaderClockFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR; - out_ext->shaderSubgroupClock = in_ext->shaderSubgroupClock; - out_ext->shaderDeviceClock = in_ext->shaderDeviceClock; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES: - { - VkPhysicalDeviceIndexTypeUint8Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES); - const VkPhysicalDeviceIndexTypeUint8Features *in_ext = (const VkPhysicalDeviceIndexTypeUint8Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES; - out_ext->indexTypeUint8 = in_ext->indexTypeUint8; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: - { - VkPhysicalDeviceShaderSMBuiltinsFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV); - const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV *in_ext = (const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV; - out_ext->shaderSMBuiltins = in_ext->shaderSMBuiltins; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: - { - VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT); - const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *in_ext = (const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT; - out_ext->fragmentShaderSampleInterlock = in_ext->fragmentShaderSampleInterlock; - out_ext->fragmentShaderPixelInterlock = in_ext->fragmentShaderPixelInterlock; - out_ext->fragmentShaderShadingRateInterlock = in_ext->fragmentShaderShadingRateInterlock; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: - { - VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES); - const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures *in_ext = (const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES; - out_ext->separateDepthStencilLayouts = in_ext->separateDepthStencilLayouts; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: - { - VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT); - const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT *in_ext = (const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT; - out_ext->primitiveTopologyListRestart = in_ext->primitiveTopologyListRestart; - out_ext->primitiveTopologyPatchListRestart = in_ext->primitiveTopologyPatchListRestart; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: - { - VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR); - const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR *in_ext = (const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR; - out_ext->pipelineExecutableInfo = in_ext->pipelineExecutableInfo; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES: - { - VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES); - const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures *in_ext = (const VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES; - out_ext->shaderDemoteToHelperInvocation = in_ext->shaderDemoteToHelperInvocation; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: - { - VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT); - const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *in_ext = (const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT; - out_ext->texelBufferAlignment = in_ext->texelBufferAlignment; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES: - { - VkPhysicalDeviceSubgroupSizeControlFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES); - const VkPhysicalDeviceSubgroupSizeControlFeatures *in_ext = (const VkPhysicalDeviceSubgroupSizeControlFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES; - out_ext->subgroupSizeControl = in_ext->subgroupSizeControl; - out_ext->computeFullSubgroups = in_ext->computeFullSubgroups; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES: - { - VkPhysicalDeviceLineRasterizationFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES); - const VkPhysicalDeviceLineRasterizationFeatures *in_ext = (const VkPhysicalDeviceLineRasterizationFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES; - out_ext->rectangularLines = in_ext->rectangularLines; - out_ext->bresenhamLines = in_ext->bresenhamLines; - out_ext->smoothLines = in_ext->smoothLines; - out_ext->stippledRectangularLines = in_ext->stippledRectangularLines; - out_ext->stippledBresenhamLines = in_ext->stippledBresenhamLines; - out_ext->stippledSmoothLines = in_ext->stippledSmoothLines; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: - { - VkPhysicalDevicePipelineCreationCacheControlFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES); - const VkPhysicalDevicePipelineCreationCacheControlFeatures *in_ext = (const VkPhysicalDevicePipelineCreationCacheControlFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES; - out_ext->pipelineCreationCacheControl = in_ext->pipelineCreationCacheControl; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: - { - VkPhysicalDeviceVulkan11Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES); - const VkPhysicalDeviceVulkan11Features *in_ext = (const VkPhysicalDeviceVulkan11Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES; - out_ext->storageBuffer16BitAccess = in_ext->storageBuffer16BitAccess; - out_ext->uniformAndStorageBuffer16BitAccess = in_ext->uniformAndStorageBuffer16BitAccess; - out_ext->storagePushConstant16 = in_ext->storagePushConstant16; - out_ext->storageInputOutput16 = in_ext->storageInputOutput16; - out_ext->multiview = in_ext->multiview; - out_ext->multiviewGeometryShader = in_ext->multiviewGeometryShader; - out_ext->multiviewTessellationShader = in_ext->multiviewTessellationShader; - out_ext->variablePointersStorageBuffer = in_ext->variablePointersStorageBuffer; - out_ext->variablePointers = in_ext->variablePointers; - out_ext->protectedMemory = in_ext->protectedMemory; - out_ext->samplerYcbcrConversion = in_ext->samplerYcbcrConversion; - out_ext->shaderDrawParameters = in_ext->shaderDrawParameters; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: - { - VkPhysicalDeviceVulkan12Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES); - const VkPhysicalDeviceVulkan12Features *in_ext = (const VkPhysicalDeviceVulkan12Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES; - out_ext->samplerMirrorClampToEdge = in_ext->samplerMirrorClampToEdge; - out_ext->drawIndirectCount = in_ext->drawIndirectCount; - out_ext->storageBuffer8BitAccess = in_ext->storageBuffer8BitAccess; - out_ext->uniformAndStorageBuffer8BitAccess = in_ext->uniformAndStorageBuffer8BitAccess; - out_ext->storagePushConstant8 = in_ext->storagePushConstant8; - out_ext->shaderBufferInt64Atomics = in_ext->shaderBufferInt64Atomics; - out_ext->shaderSharedInt64Atomics = in_ext->shaderSharedInt64Atomics; - out_ext->shaderFloat16 = in_ext->shaderFloat16; - out_ext->shaderInt8 = in_ext->shaderInt8; - out_ext->descriptorIndexing = in_ext->descriptorIndexing; - out_ext->shaderInputAttachmentArrayDynamicIndexing = in_ext->shaderInputAttachmentArrayDynamicIndexing; - out_ext->shaderUniformTexelBufferArrayDynamicIndexing = in_ext->shaderUniformTexelBufferArrayDynamicIndexing; - out_ext->shaderStorageTexelBufferArrayDynamicIndexing = in_ext->shaderStorageTexelBufferArrayDynamicIndexing; - out_ext->shaderUniformBufferArrayNonUniformIndexing = in_ext->shaderUniformBufferArrayNonUniformIndexing; - out_ext->shaderSampledImageArrayNonUniformIndexing = in_ext->shaderSampledImageArrayNonUniformIndexing; - out_ext->shaderStorageBufferArrayNonUniformIndexing = in_ext->shaderStorageBufferArrayNonUniformIndexing; - out_ext->shaderStorageImageArrayNonUniformIndexing = in_ext->shaderStorageImageArrayNonUniformIndexing; - out_ext->shaderInputAttachmentArrayNonUniformIndexing = in_ext->shaderInputAttachmentArrayNonUniformIndexing; - out_ext->shaderUniformTexelBufferArrayNonUniformIndexing = in_ext->shaderUniformTexelBufferArrayNonUniformIndexing; - out_ext->shaderStorageTexelBufferArrayNonUniformIndexing = in_ext->shaderStorageTexelBufferArrayNonUniformIndexing; - out_ext->descriptorBindingUniformBufferUpdateAfterBind = in_ext->descriptorBindingUniformBufferUpdateAfterBind; - out_ext->descriptorBindingSampledImageUpdateAfterBind = in_ext->descriptorBindingSampledImageUpdateAfterBind; - out_ext->descriptorBindingStorageImageUpdateAfterBind = in_ext->descriptorBindingStorageImageUpdateAfterBind; - out_ext->descriptorBindingStorageBufferUpdateAfterBind = in_ext->descriptorBindingStorageBufferUpdateAfterBind; - out_ext->descriptorBindingUniformTexelBufferUpdateAfterBind = in_ext->descriptorBindingUniformTexelBufferUpdateAfterBind; - out_ext->descriptorBindingStorageTexelBufferUpdateAfterBind = in_ext->descriptorBindingStorageTexelBufferUpdateAfterBind; - out_ext->descriptorBindingUpdateUnusedWhilePending = in_ext->descriptorBindingUpdateUnusedWhilePending; - out_ext->descriptorBindingPartiallyBound = in_ext->descriptorBindingPartiallyBound; - out_ext->descriptorBindingVariableDescriptorCount = in_ext->descriptorBindingVariableDescriptorCount; - out_ext->runtimeDescriptorArray = in_ext->runtimeDescriptorArray; - out_ext->samplerFilterMinmax = in_ext->samplerFilterMinmax; - out_ext->scalarBlockLayout = in_ext->scalarBlockLayout; - out_ext->imagelessFramebuffer = in_ext->imagelessFramebuffer; - out_ext->uniformBufferStandardLayout = in_ext->uniformBufferStandardLayout; - out_ext->shaderSubgroupExtendedTypes = in_ext->shaderSubgroupExtendedTypes; - out_ext->separateDepthStencilLayouts = in_ext->separateDepthStencilLayouts; - out_ext->hostQueryReset = in_ext->hostQueryReset; - out_ext->timelineSemaphore = in_ext->timelineSemaphore; - out_ext->bufferDeviceAddress = in_ext->bufferDeviceAddress; - out_ext->bufferDeviceAddressCaptureReplay = in_ext->bufferDeviceAddressCaptureReplay; - out_ext->bufferDeviceAddressMultiDevice = in_ext->bufferDeviceAddressMultiDevice; - out_ext->vulkanMemoryModel = in_ext->vulkanMemoryModel; - out_ext->vulkanMemoryModelDeviceScope = in_ext->vulkanMemoryModelDeviceScope; - out_ext->vulkanMemoryModelAvailabilityVisibilityChains = in_ext->vulkanMemoryModelAvailabilityVisibilityChains; - out_ext->shaderOutputViewportIndex = in_ext->shaderOutputViewportIndex; - out_ext->shaderOutputLayer = in_ext->shaderOutputLayer; - out_ext->subgroupBroadcastDynamicId = in_ext->subgroupBroadcastDynamicId; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES: - { - VkPhysicalDeviceVulkan13Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES); - const VkPhysicalDeviceVulkan13Features *in_ext = (const VkPhysicalDeviceVulkan13Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES; - out_ext->robustImageAccess = in_ext->robustImageAccess; - out_ext->inlineUniformBlock = in_ext->inlineUniformBlock; - out_ext->descriptorBindingInlineUniformBlockUpdateAfterBind = in_ext->descriptorBindingInlineUniformBlockUpdateAfterBind; - out_ext->pipelineCreationCacheControl = in_ext->pipelineCreationCacheControl; - out_ext->privateData = in_ext->privateData; - out_ext->shaderDemoteToHelperInvocation = in_ext->shaderDemoteToHelperInvocation; - out_ext->shaderTerminateInvocation = in_ext->shaderTerminateInvocation; - out_ext->subgroupSizeControl = in_ext->subgroupSizeControl; - out_ext->computeFullSubgroups = in_ext->computeFullSubgroups; - out_ext->synchronization2 = in_ext->synchronization2; - out_ext->textureCompressionASTC_HDR = in_ext->textureCompressionASTC_HDR; - out_ext->shaderZeroInitializeWorkgroupMemory = in_ext->shaderZeroInitializeWorkgroupMemory; - out_ext->dynamicRendering = in_ext->dynamicRendering; - out_ext->shaderIntegerDotProduct = in_ext->shaderIntegerDotProduct; - out_ext->maintenance4 = in_ext->maintenance4; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES: - { - VkPhysicalDeviceVulkan14Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES); - const VkPhysicalDeviceVulkan14Features *in_ext = (const VkPhysicalDeviceVulkan14Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES; - out_ext->globalPriorityQuery = in_ext->globalPriorityQuery; - out_ext->shaderSubgroupRotate = in_ext->shaderSubgroupRotate; - out_ext->shaderSubgroupRotateClustered = in_ext->shaderSubgroupRotateClustered; - out_ext->shaderFloatControls2 = in_ext->shaderFloatControls2; - out_ext->shaderExpectAssume = in_ext->shaderExpectAssume; - out_ext->rectangularLines = in_ext->rectangularLines; - out_ext->bresenhamLines = in_ext->bresenhamLines; - out_ext->smoothLines = in_ext->smoothLines; - out_ext->stippledRectangularLines = in_ext->stippledRectangularLines; - out_ext->stippledBresenhamLines = in_ext->stippledBresenhamLines; - out_ext->stippledSmoothLines = in_ext->stippledSmoothLines; - out_ext->vertexAttributeInstanceRateDivisor = in_ext->vertexAttributeInstanceRateDivisor; - out_ext->vertexAttributeInstanceRateZeroDivisor = in_ext->vertexAttributeInstanceRateZeroDivisor; - out_ext->indexTypeUint8 = in_ext->indexTypeUint8; - out_ext->dynamicRenderingLocalRead = in_ext->dynamicRenderingLocalRead; - out_ext->maintenance5 = in_ext->maintenance5; - out_ext->maintenance6 = in_ext->maintenance6; - out_ext->pipelineProtectedAccess = in_ext->pipelineProtectedAccess; - out_ext->pipelineRobustness = in_ext->pipelineRobustness; - out_ext->hostImageCopy = in_ext->hostImageCopy; - out_ext->pushDescriptor = in_ext->pushDescriptor; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: - { - VkPhysicalDeviceCoherentMemoryFeaturesAMD32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD); - const VkPhysicalDeviceCoherentMemoryFeaturesAMD *in_ext = (const VkPhysicalDeviceCoherentMemoryFeaturesAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD; - out_ext->deviceCoherentMemory = in_ext->deviceCoherentMemory; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: - { - VkPhysicalDeviceCustomBorderColorFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT); - const VkPhysicalDeviceCustomBorderColorFeaturesEXT *in_ext = (const VkPhysicalDeviceCustomBorderColorFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT; - out_ext->customBorderColors = in_ext->customBorderColors; - out_ext->customBorderColorWithoutFormat = in_ext->customBorderColorWithoutFormat; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: - { - VkPhysicalDeviceBorderColorSwizzleFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT); - const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT *in_ext = (const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT; - out_ext->borderColorSwizzle = in_ext->borderColorSwizzle; - out_ext->borderColorSwizzleFromImage = in_ext->borderColorSwizzleFromImage; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicStateFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT); - const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *in_ext = (const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT; - out_ext->extendedDynamicState = in_ext->extendedDynamicState; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicState2FeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT); - const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *in_ext = (const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT; - out_ext->extendedDynamicState2 = in_ext->extendedDynamicState2; - out_ext->extendedDynamicState2LogicOp = in_ext->extendedDynamicState2LogicOp; - out_ext->extendedDynamicState2PatchControlPoints = in_ext->extendedDynamicState2PatchControlPoints; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT: - { - VkPhysicalDeviceExtendedDynamicState3FeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT); - const VkPhysicalDeviceExtendedDynamicState3FeaturesEXT *in_ext = (const VkPhysicalDeviceExtendedDynamicState3FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT; - out_ext->extendedDynamicState3TessellationDomainOrigin = in_ext->extendedDynamicState3TessellationDomainOrigin; - out_ext->extendedDynamicState3DepthClampEnable = in_ext->extendedDynamicState3DepthClampEnable; - out_ext->extendedDynamicState3PolygonMode = in_ext->extendedDynamicState3PolygonMode; - out_ext->extendedDynamicState3RasterizationSamples = in_ext->extendedDynamicState3RasterizationSamples; - out_ext->extendedDynamicState3SampleMask = in_ext->extendedDynamicState3SampleMask; - out_ext->extendedDynamicState3AlphaToCoverageEnable = in_ext->extendedDynamicState3AlphaToCoverageEnable; - out_ext->extendedDynamicState3AlphaToOneEnable = in_ext->extendedDynamicState3AlphaToOneEnable; - out_ext->extendedDynamicState3LogicOpEnable = in_ext->extendedDynamicState3LogicOpEnable; - out_ext->extendedDynamicState3ColorBlendEnable = in_ext->extendedDynamicState3ColorBlendEnable; - out_ext->extendedDynamicState3ColorBlendEquation = in_ext->extendedDynamicState3ColorBlendEquation; - out_ext->extendedDynamicState3ColorWriteMask = in_ext->extendedDynamicState3ColorWriteMask; - out_ext->extendedDynamicState3RasterizationStream = in_ext->extendedDynamicState3RasterizationStream; - out_ext->extendedDynamicState3ConservativeRasterizationMode = in_ext->extendedDynamicState3ConservativeRasterizationMode; - out_ext->extendedDynamicState3ExtraPrimitiveOverestimationSize = in_ext->extendedDynamicState3ExtraPrimitiveOverestimationSize; - out_ext->extendedDynamicState3DepthClipEnable = in_ext->extendedDynamicState3DepthClipEnable; - out_ext->extendedDynamicState3SampleLocationsEnable = in_ext->extendedDynamicState3SampleLocationsEnable; - out_ext->extendedDynamicState3ColorBlendAdvanced = in_ext->extendedDynamicState3ColorBlendAdvanced; - out_ext->extendedDynamicState3ProvokingVertexMode = in_ext->extendedDynamicState3ProvokingVertexMode; - out_ext->extendedDynamicState3LineRasterizationMode = in_ext->extendedDynamicState3LineRasterizationMode; - out_ext->extendedDynamicState3LineStippleEnable = in_ext->extendedDynamicState3LineStippleEnable; - out_ext->extendedDynamicState3DepthClipNegativeOneToOne = in_ext->extendedDynamicState3DepthClipNegativeOneToOne; - out_ext->extendedDynamicState3ViewportWScalingEnable = in_ext->extendedDynamicState3ViewportWScalingEnable; - out_ext->extendedDynamicState3ViewportSwizzle = in_ext->extendedDynamicState3ViewportSwizzle; - out_ext->extendedDynamicState3CoverageToColorEnable = in_ext->extendedDynamicState3CoverageToColorEnable; - out_ext->extendedDynamicState3CoverageToColorLocation = in_ext->extendedDynamicState3CoverageToColorLocation; - out_ext->extendedDynamicState3CoverageModulationMode = in_ext->extendedDynamicState3CoverageModulationMode; - out_ext->extendedDynamicState3CoverageModulationTableEnable = in_ext->extendedDynamicState3CoverageModulationTableEnable; - out_ext->extendedDynamicState3CoverageModulationTable = in_ext->extendedDynamicState3CoverageModulationTable; - out_ext->extendedDynamicState3CoverageReductionMode = in_ext->extendedDynamicState3CoverageReductionMode; - out_ext->extendedDynamicState3RepresentativeFragmentTestEnable = in_ext->extendedDynamicState3RepresentativeFragmentTestEnable; - out_ext->extendedDynamicState3ShadingRateImageEnable = in_ext->extendedDynamicState3ShadingRateImageEnable; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: - { - VkPhysicalDeviceDiagnosticsConfigFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV); - const VkPhysicalDeviceDiagnosticsConfigFeaturesNV *in_ext = (const VkPhysicalDeviceDiagnosticsConfigFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV; - out_ext->diagnosticsConfig = in_ext->diagnosticsConfig; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES: - { - VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES); - const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures *in_ext = (const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES; - out_ext->shaderZeroInitializeWorkgroupMemory = in_ext->shaderZeroInitializeWorkgroupMemory; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: - { - VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR); - const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR *in_ext = (const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR; - out_ext->shaderSubgroupUniformControlFlow = in_ext->shaderSubgroupUniformControlFlow; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: - { - VkPhysicalDeviceRobustness2FeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT); - const VkPhysicalDeviceRobustness2FeaturesEXT *in_ext = (const VkPhysicalDeviceRobustness2FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT; - out_ext->robustBufferAccess2 = in_ext->robustBufferAccess2; - out_ext->robustImageAccess2 = in_ext->robustImageAccess2; - out_ext->nullDescriptor = in_ext->nullDescriptor; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES: - { - VkPhysicalDeviceImageRobustnessFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES); - const VkPhysicalDeviceImageRobustnessFeatures *in_ext = (const VkPhysicalDeviceImageRobustnessFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES; - out_ext->robustImageAccess = in_ext->robustImageAccess; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: - { - VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR); - const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR *in_ext = (const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR; - out_ext->workgroupMemoryExplicitLayout = in_ext->workgroupMemoryExplicitLayout; - out_ext->workgroupMemoryExplicitLayoutScalarBlockLayout = in_ext->workgroupMemoryExplicitLayoutScalarBlockLayout; - out_ext->workgroupMemoryExplicitLayout8BitAccess = in_ext->workgroupMemoryExplicitLayout8BitAccess; - out_ext->workgroupMemoryExplicitLayout16BitAccess = in_ext->workgroupMemoryExplicitLayout16BitAccess; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: - { - VkPhysicalDevice4444FormatsFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT); - const VkPhysicalDevice4444FormatsFeaturesEXT *in_ext = (const VkPhysicalDevice4444FormatsFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT; - out_ext->formatA4R4G4B4 = in_ext->formatA4R4G4B4; - out_ext->formatA4B4G4R4 = in_ext->formatA4B4G4R4; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: - { - VkPhysicalDeviceSubpassShadingFeaturesHUAWEI32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI); - const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI *in_ext = (const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI; - out_ext->subpassShading = in_ext->subpassShading; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI: - { - VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI); - const VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI *in_ext = (const VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI; - out_ext->clustercullingShader = in_ext->clustercullingShader; - out_ext->multiviewClusterCullingShader = in_ext->multiviewClusterCullingShader; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: - { - VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT); - const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT *in_ext = (const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT; - out_ext->shaderImageInt64Atomics = in_ext->shaderImageInt64Atomics; - out_ext->sparseImageInt64Atomics = in_ext->sparseImageInt64Atomics; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: - { - VkPhysicalDeviceFragmentShadingRateFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR); - const VkPhysicalDeviceFragmentShadingRateFeaturesKHR *in_ext = (const VkPhysicalDeviceFragmentShadingRateFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR; - out_ext->pipelineFragmentShadingRate = in_ext->pipelineFragmentShadingRate; - out_ext->primitiveFragmentShadingRate = in_ext->primitiveFragmentShadingRate; - out_ext->attachmentFragmentShadingRate = in_ext->attachmentFragmentShadingRate; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES: - { - VkPhysicalDeviceShaderTerminateInvocationFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES); - const VkPhysicalDeviceShaderTerminateInvocationFeatures *in_ext = (const VkPhysicalDeviceShaderTerminateInvocationFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES; - out_ext->shaderTerminateInvocation = in_ext->shaderTerminateInvocation; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: - { - VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV); - const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV *in_ext = (const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV; - out_ext->fragmentShadingRateEnums = in_ext->fragmentShadingRateEnums; - out_ext->supersampleFragmentShadingRates = in_ext->supersampleFragmentShadingRates; - out_ext->noInvocationFragmentShadingRates = in_ext->noInvocationFragmentShadingRates; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT: - { - VkPhysicalDeviceImage2DViewOf3DFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT); - const VkPhysicalDeviceImage2DViewOf3DFeaturesEXT *in_ext = (const VkPhysicalDeviceImage2DViewOf3DFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT; - out_ext->image2DViewOf3D = in_ext->image2DViewOf3D; - out_ext->sampler2DViewOf3D = in_ext->sampler2DViewOf3D; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT: - { - VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT); - const VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT *in_ext = (const VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT; - out_ext->imageSlicedViewOf3D = in_ext->imageSlicedViewOf3D; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT); - const VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT *in_ext = (const VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT; - out_ext->attachmentFeedbackLoopDynamicState = in_ext->attachmentFeedbackLoopDynamicState; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT: - { - VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT); - const VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT *in_ext = (const VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT; - out_ext->legacyVertexAttributes = in_ext->legacyVertexAttributes; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT: - { - VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT); - const VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT *in_ext = (const VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT; - out_ext->mutableDescriptorType = in_ext->mutableDescriptorType; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthClipControlFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT); - const VkPhysicalDeviceDepthClipControlFeaturesEXT *in_ext = (const VkPhysicalDeviceDepthClipControlFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT; - out_ext->depthClipControl = in_ext->depthClipControl; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_EXT: - { - VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_EXT); - const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_EXT; - out_ext->deviceGeneratedCommands = in_ext->deviceGeneratedCommands; - out_ext->dynamicGeneratedPipelineLayout = in_ext->dynamicGeneratedPipelineLayout; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthClampControlFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_CONTROL_FEATURES_EXT); - const VkPhysicalDeviceDepthClampControlFeaturesEXT *in_ext = (const VkPhysicalDeviceDepthClampControlFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_CONTROL_FEATURES_EXT; - out_ext->depthClampControl = in_ext->depthClampControl; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: - { - VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT); - const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *in_ext = (const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT; - out_ext->vertexInputDynamicState = in_ext->vertexInputDynamicState; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR: - { - VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR); - const VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR *in_ext = (const VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR; - out_ext->shaderRelaxedExtendedInstruction = in_ext->shaderRelaxedExtendedInstruction; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: - { - VkPhysicalDeviceColorWriteEnableFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT); - const VkPhysicalDeviceColorWriteEnableFeaturesEXT *in_ext = (const VkPhysicalDeviceColorWriteEnableFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT; - out_ext->colorWriteEnable = in_ext->colorWriteEnable; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES: - { - VkPhysicalDeviceSynchronization2Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES); - const VkPhysicalDeviceSynchronization2Features *in_ext = (const VkPhysicalDeviceSynchronization2Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES; - out_ext->synchronization2 = in_ext->synchronization2; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES: - { - VkPhysicalDeviceHostImageCopyFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES); - const VkPhysicalDeviceHostImageCopyFeatures *in_ext = (const VkPhysicalDeviceHostImageCopyFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES; - out_ext->hostImageCopy = in_ext->hostImageCopy; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT: - { - VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT); - const VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT *in_ext = (const VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT; - out_ext->primitivesGeneratedQuery = in_ext->primitivesGeneratedQuery; - out_ext->primitivesGeneratedQueryWithRasterizerDiscard = in_ext->primitivesGeneratedQueryWithRasterizerDiscard; - out_ext->primitivesGeneratedQueryWithNonZeroStreams = in_ext->primitivesGeneratedQueryWithNonZeroStreams; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT: - { - VkPhysicalDeviceLegacyDitheringFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT); - const VkPhysicalDeviceLegacyDitheringFeaturesEXT *in_ext = (const VkPhysicalDeviceLegacyDitheringFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT; - out_ext->legacyDithering = in_ext->legacyDithering; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT: - { - VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT); - const VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT *in_ext = (const VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT; - out_ext->multisampledRenderToSingleSampled = in_ext->multisampledRenderToSingleSampled; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES: - { - VkPhysicalDevicePipelineProtectedAccessFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES); - const VkPhysicalDevicePipelineProtectedAccessFeatures *in_ext = (const VkPhysicalDevicePipelineProtectedAccessFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES; - out_ext->pipelineProtectedAccess = in_ext->pipelineProtectedAccess; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR: - { - VkPhysicalDeviceVideoMaintenance1FeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR); - const VkPhysicalDeviceVideoMaintenance1FeaturesKHR *in_ext = (const VkPhysicalDeviceVideoMaintenance1FeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR; - out_ext->videoMaintenance1 = in_ext->videoMaintenance1; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUANTIZATION_MAP_FEATURES_KHR: - { - VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUANTIZATION_MAP_FEATURES_KHR); - const VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR *in_ext = (const VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUANTIZATION_MAP_FEATURES_KHR; - out_ext->videoEncodeQuantizationMap = in_ext->videoEncodeQuantizationMap; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_AV1_FEATURES_KHR: - { - VkPhysicalDeviceVideoEncodeAV1FeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_AV1_FEATURES_KHR); - const VkPhysicalDeviceVideoEncodeAV1FeaturesKHR *in_ext = (const VkPhysicalDeviceVideoEncodeAV1FeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_AV1_FEATURES_KHR; - out_ext->videoEncodeAV1 = in_ext->videoEncodeAV1; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: - { - VkPhysicalDeviceInheritedViewportScissorFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV); - const VkPhysicalDeviceInheritedViewportScissorFeaturesNV *in_ext = (const VkPhysicalDeviceInheritedViewportScissorFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV; - out_ext->inheritedViewportScissor2D = in_ext->inheritedViewportScissor2D; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: - { - VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT); - const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *in_ext = (const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT; - out_ext->ycbcr2plane444Formats = in_ext->ycbcr2plane444Formats; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: - { - VkPhysicalDeviceProvokingVertexFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT); - const VkPhysicalDeviceProvokingVertexFeaturesEXT *in_ext = (const VkPhysicalDeviceProvokingVertexFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT; - out_ext->provokingVertexLast = in_ext->provokingVertexLast; - out_ext->transformFeedbackPreservesProvokingVertex = in_ext->transformFeedbackPreservesProvokingVertex; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT: - { - VkPhysicalDeviceDescriptorBufferFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT); - const VkPhysicalDeviceDescriptorBufferFeaturesEXT *in_ext = (const VkPhysicalDeviceDescriptorBufferFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT; - out_ext->descriptorBuffer = in_ext->descriptorBuffer; - out_ext->descriptorBufferCaptureReplay = in_ext->descriptorBufferCaptureReplay; - out_ext->descriptorBufferImageLayoutIgnored = in_ext->descriptorBufferImageLayoutIgnored; - out_ext->descriptorBufferPushDescriptors = in_ext->descriptorBufferPushDescriptors; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: - { - VkPhysicalDeviceShaderIntegerDotProductFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES); - const VkPhysicalDeviceShaderIntegerDotProductFeatures *in_ext = (const VkPhysicalDeviceShaderIntegerDotProductFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES; - out_ext->shaderIntegerDotProduct = in_ext->shaderIntegerDotProduct; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR: - { - VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR); - const VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR *in_ext = (const VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR; - out_ext->fragmentShaderBarycentric = in_ext->fragmentShaderBarycentric; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: - { - VkPhysicalDeviceRayTracingMotionBlurFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV); - const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV *in_ext = (const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV; - out_ext->rayTracingMotionBlur = in_ext->rayTracingMotionBlur; - out_ext->rayTracingMotionBlurPipelineTraceRaysIndirect = in_ext->rayTracingMotionBlurPipelineTraceRaysIndirect; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_VALIDATION_FEATURES_NV: - { - VkPhysicalDeviceRayTracingValidationFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_VALIDATION_FEATURES_NV); - const VkPhysicalDeviceRayTracingValidationFeaturesNV *in_ext = (const VkPhysicalDeviceRayTracingValidationFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_VALIDATION_FEATURES_NV; - out_ext->rayTracingValidation = in_ext->rayTracingValidation; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: - { - VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT); - const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT *in_ext = (const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT; - out_ext->formatRgba10x6WithoutYCbCrSampler = in_ext->formatRgba10x6WithoutYCbCrSampler; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES: - { - VkPhysicalDeviceDynamicRenderingFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES); - const VkPhysicalDeviceDynamicRenderingFeatures *in_ext = (const VkPhysicalDeviceDynamicRenderingFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES; - out_ext->dynamicRendering = in_ext->dynamicRendering; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT: - { - VkPhysicalDeviceImageViewMinLodFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT); - const VkPhysicalDeviceImageViewMinLodFeaturesEXT *in_ext = (const VkPhysicalDeviceImageViewMinLodFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT; - out_ext->minLod = in_ext->minLod; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT: - { - VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT); - const VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT *in_ext = (const VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT; - out_ext->rasterizationOrderColorAttachmentAccess = in_ext->rasterizationOrderColorAttachmentAccess; - out_ext->rasterizationOrderDepthAttachmentAccess = in_ext->rasterizationOrderDepthAttachmentAccess; - out_ext->rasterizationOrderStencilAttachmentAccess = in_ext->rasterizationOrderStencilAttachmentAccess; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV: - { - VkPhysicalDeviceLinearColorAttachmentFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV); - const VkPhysicalDeviceLinearColorAttachmentFeaturesNV *in_ext = (const VkPhysicalDeviceLinearColorAttachmentFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV; - out_ext->linearColorAttachment = in_ext->linearColorAttachment; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT: - { - VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT); - const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT *in_ext = (const VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT; - out_ext->graphicsPipelineLibrary = in_ext->graphicsPipelineLibrary; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR: - { - VkPhysicalDevicePipelineBinaryFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR); - const VkPhysicalDevicePipelineBinaryFeaturesKHR *in_ext = (const VkPhysicalDevicePipelineBinaryFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR; - out_ext->pipelineBinaries = in_ext->pipelineBinaries; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE: - { - VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE); - const VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE *in_ext = (const VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE; - out_ext->descriptorSetHostMapping = in_ext->descriptorSetHostMapping; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT: - { - VkPhysicalDeviceNestedCommandBufferFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT); - const VkPhysicalDeviceNestedCommandBufferFeaturesEXT *in_ext = (const VkPhysicalDeviceNestedCommandBufferFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT; - out_ext->nestedCommandBuffer = in_ext->nestedCommandBuffer; - out_ext->nestedCommandBufferRendering = in_ext->nestedCommandBufferRendering; - out_ext->nestedCommandBufferSimultaneousUse = in_ext->nestedCommandBufferSimultaneousUse; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT: - { - VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT); - const VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT *in_ext = (const VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT; - out_ext->shaderModuleIdentifier = in_ext->shaderModuleIdentifier; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceImageCompressionControlFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT); - const VkPhysicalDeviceImageCompressionControlFeaturesEXT *in_ext = (const VkPhysicalDeviceImageCompressionControlFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT; - out_ext->imageCompressionControl = in_ext->imageCompressionControl; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT: - { - VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT); - const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT *in_ext = (const VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT; - out_ext->imageCompressionControlSwapchain = in_ext->imageCompressionControlSwapchain; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT: - { - VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT); - const VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT *in_ext = (const VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT; - out_ext->subpassMergeFeedback = in_ext->subpassMergeFeedback; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT: - { - VkPhysicalDeviceOpacityMicromapFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT); - const VkPhysicalDeviceOpacityMicromapFeaturesEXT *in_ext = (const VkPhysicalDeviceOpacityMicromapFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT; - out_ext->micromap = in_ext->micromap; - out_ext->micromapCaptureReplay = in_ext->micromapCaptureReplay; - out_ext->micromapHostCommands = in_ext->micromapHostCommands; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT: - { - VkPhysicalDevicePipelinePropertiesFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT); - const VkPhysicalDevicePipelinePropertiesFeaturesEXT *in_ext = (const VkPhysicalDevicePipelinePropertiesFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT; - out_ext->pipelinePropertiesIdentifier = in_ext->pipelinePropertiesIdentifier; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD: - { - VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD); - const VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD *in_ext = (const VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD; - out_ext->shaderEarlyAndLateFragmentTests = in_ext->shaderEarlyAndLateFragmentTests; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT: - { - VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT); - const VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *in_ext = (const VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT; - out_ext->nonSeamlessCubeMap = in_ext->nonSeamlessCubeMap; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES: - { - VkPhysicalDevicePipelineRobustnessFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES); - const VkPhysicalDevicePipelineRobustnessFeatures *in_ext = (const VkPhysicalDevicePipelineRobustnessFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES; - out_ext->pipelineRobustness = in_ext->pipelineRobustness; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM: - { - VkPhysicalDeviceImageProcessingFeaturesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM); - const VkPhysicalDeviceImageProcessingFeaturesQCOM *in_ext = (const VkPhysicalDeviceImageProcessingFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM; - out_ext->textureSampleWeighted = in_ext->textureSampleWeighted; - out_ext->textureBoxFilter = in_ext->textureBoxFilter; - out_ext->textureBlockMatch = in_ext->textureBlockMatch; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM: - { - VkPhysicalDeviceTilePropertiesFeaturesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM); - const VkPhysicalDeviceTilePropertiesFeaturesQCOM *in_ext = (const VkPhysicalDeviceTilePropertiesFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM; - out_ext->tileProperties = in_ext->tileProperties; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT: - { - VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT); - const VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT *in_ext = (const VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT; - out_ext->attachmentFeedbackLoopLayout = in_ext->attachmentFeedbackLoopLayout; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT: - { - VkPhysicalDeviceDepthClampZeroOneFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT); - const VkPhysicalDeviceDepthClampZeroOneFeaturesEXT *in_ext = (const VkPhysicalDeviceDepthClampZeroOneFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT; - out_ext->depthClampZeroOne = in_ext->depthClampZeroOne; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT: - { - VkPhysicalDeviceAddressBindingReportFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT); - const VkPhysicalDeviceAddressBindingReportFeaturesEXT *in_ext = (const VkPhysicalDeviceAddressBindingReportFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT; - out_ext->reportAddressBinding = in_ext->reportAddressBinding; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV: - { - VkPhysicalDeviceOpticalFlowFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV); - const VkPhysicalDeviceOpticalFlowFeaturesNV *in_ext = (const VkPhysicalDeviceOpticalFlowFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV; - out_ext->opticalFlow = in_ext->opticalFlow; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT: - { - VkPhysicalDeviceFaultFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT); - const VkPhysicalDeviceFaultFeaturesEXT *in_ext = (const VkPhysicalDeviceFaultFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT; - out_ext->deviceFault = in_ext->deviceFault; - out_ext->deviceFaultVendorBinary = in_ext->deviceFaultVendorBinary; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT: - { - VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT); - const VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT *in_ext = (const VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT; - out_ext->pipelineLibraryGroupHandles = in_ext->pipelineLibraryGroupHandles; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM: - { - VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM); - const VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM *in_ext = (const VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM; - out_ext->shaderCoreBuiltins = in_ext->shaderCoreBuiltins; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT: - { - VkPhysicalDeviceFrameBoundaryFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT); - const VkPhysicalDeviceFrameBoundaryFeaturesEXT *in_ext = (const VkPhysicalDeviceFrameBoundaryFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT; - out_ext->frameBoundary = in_ext->frameBoundary; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT: - { - VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT); - const VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT *in_ext = (const VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT; - out_ext->dynamicRenderingUnusedAttachments = in_ext->dynamicRenderingUnusedAttachments; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT: - { - VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT); - const VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT *in_ext = (const VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT; - out_ext->swapchainMaintenance1 = in_ext->swapchainMaintenance1; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT: - { - VkPhysicalDeviceDepthBiasControlFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT); - const VkPhysicalDeviceDepthBiasControlFeaturesEXT *in_ext = (const VkPhysicalDeviceDepthBiasControlFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT; - out_ext->depthBiasControl = in_ext->depthBiasControl; - out_ext->leastRepresentableValueForceUnormRepresentation = in_ext->leastRepresentableValueForceUnormRepresentation; - out_ext->floatRepresentation = in_ext->floatRepresentation; - out_ext->depthBiasExact = in_ext->depthBiasExact; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV: - { - VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV); - const VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV *in_ext = (const VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV; - out_ext->rayTracingInvocationReorder = in_ext->rayTracingInvocationReorder; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV: - { - VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV); - const VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV *in_ext = (const VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV; - out_ext->extendedSparseAddressSpace = in_ext->extendedSparseAddressSpace; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM: - { - VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM); - const VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM *in_ext = (const VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM; - out_ext->multiviewPerViewViewports = in_ext->multiviewPerViewViewports; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR: - { - VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR); - const VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR *in_ext = (const VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR; - out_ext->rayTracingPositionFetch = in_ext->rayTracingPositionFetch; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM: - { - VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM); - const VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM *in_ext = (const VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM; - out_ext->multiviewPerViewRenderAreas = in_ext->multiviewPerViewRenderAreas; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT: - { - VkPhysicalDeviceShaderObjectFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT); - const VkPhysicalDeviceShaderObjectFeaturesEXT *in_ext = (const VkPhysicalDeviceShaderObjectFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT; - out_ext->shaderObject = in_ext->shaderObject; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT: - { - VkPhysicalDeviceShaderTileImageFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT); - const VkPhysicalDeviceShaderTileImageFeaturesEXT *in_ext = (const VkPhysicalDeviceShaderTileImageFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT; - out_ext->shaderTileImageColorReadAccess = in_ext->shaderTileImageColorReadAccess; - out_ext->shaderTileImageDepthReadAccess = in_ext->shaderTileImageDepthReadAccess; - out_ext->shaderTileImageStencilReadAccess = in_ext->shaderTileImageStencilReadAccess; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR: - { - VkPhysicalDeviceCooperativeMatrixFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR); - const VkPhysicalDeviceCooperativeMatrixFeaturesKHR *in_ext = (const VkPhysicalDeviceCooperativeMatrixFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR; - out_ext->cooperativeMatrix = in_ext->cooperativeMatrix; - out_ext->cooperativeMatrixRobustBufferAccess = in_ext->cooperativeMatrixRobustBufferAccess; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ANTI_LAG_FEATURES_AMD: - { - VkPhysicalDeviceAntiLagFeaturesAMD32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ANTI_LAG_FEATURES_AMD); - const VkPhysicalDeviceAntiLagFeaturesAMD *in_ext = (const VkPhysicalDeviceAntiLagFeaturesAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ANTI_LAG_FEATURES_AMD; - out_ext->antiLag = in_ext->antiLag; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM: - { - VkPhysicalDeviceCubicClampFeaturesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM); - const VkPhysicalDeviceCubicClampFeaturesQCOM *in_ext = (const VkPhysicalDeviceCubicClampFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM; - out_ext->cubicRangeClamp = in_ext->cubicRangeClamp; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM: - { - VkPhysicalDeviceYcbcrDegammaFeaturesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM); - const VkPhysicalDeviceYcbcrDegammaFeaturesQCOM *in_ext = (const VkPhysicalDeviceYcbcrDegammaFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM; - out_ext->ycbcrDegamma = in_ext->ycbcrDegamma; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM: - { - VkPhysicalDeviceCubicWeightsFeaturesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM); - const VkPhysicalDeviceCubicWeightsFeaturesQCOM *in_ext = (const VkPhysicalDeviceCubicWeightsFeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM; - out_ext->selectableCubicWeights = in_ext->selectableCubicWeights; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM: - { - VkPhysicalDeviceImageProcessing2FeaturesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM); - const VkPhysicalDeviceImageProcessing2FeaturesQCOM *in_ext = (const VkPhysicalDeviceImageProcessing2FeaturesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM; - out_ext->textureBlockMatch2 = in_ext->textureBlockMatch2; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV: - { - VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV); - const VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV *in_ext = (const VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV; - out_ext->descriptorPoolOverallocation = in_ext->descriptorPoolOverallocation; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PER_STAGE_DESCRIPTOR_SET_FEATURES_NV: - { - VkPhysicalDevicePerStageDescriptorSetFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PER_STAGE_DESCRIPTOR_SET_FEATURES_NV); - const VkPhysicalDevicePerStageDescriptorSetFeaturesNV *in_ext = (const VkPhysicalDevicePerStageDescriptorSetFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PER_STAGE_DESCRIPTOR_SET_FEATURES_NV; - out_ext->perStageDescriptorSet = in_ext->perStageDescriptorSet; - out_ext->dynamicPipelineLayout = in_ext->dynamicPipelineLayout; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV: - { - VkPhysicalDeviceCudaKernelLaunchFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV); - const VkPhysicalDeviceCudaKernelLaunchFeaturesNV *in_ext = (const VkPhysicalDeviceCudaKernelLaunchFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV; - out_ext->cudaKernelLaunchFeatures = in_ext->cudaKernelLaunchFeatures; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM: - { - VkPhysicalDeviceSchedulingControlsFeaturesARM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM); - const VkPhysicalDeviceSchedulingControlsFeaturesARM *in_ext = (const VkPhysicalDeviceSchedulingControlsFeaturesARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM; - out_ext->schedulingControls = in_ext->schedulingControls; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG: - { - VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG); - const VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG *in_ext = (const VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG; - out_ext->relaxedLineRasterization = in_ext->relaxedLineRasterization; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_FEATURES_ARM: - { - VkPhysicalDeviceRenderPassStripedFeaturesARM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_FEATURES_ARM); - const VkPhysicalDeviceRenderPassStripedFeaturesARM *in_ext = (const VkPhysicalDeviceRenderPassStripedFeaturesARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_FEATURES_ARM; - out_ext->renderPassStriped = in_ext->renderPassStriped; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR: - { - VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR); - const VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR *in_ext = (const VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR; - out_ext->shaderMaximalReconvergence = in_ext->shaderMaximalReconvergence; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES: - { - VkPhysicalDeviceShaderSubgroupRotateFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES); - const VkPhysicalDeviceShaderSubgroupRotateFeatures *in_ext = (const VkPhysicalDeviceShaderSubgroupRotateFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES; - out_ext->shaderSubgroupRotate = in_ext->shaderSubgroupRotate; - out_ext->shaderSubgroupRotateClustered = in_ext->shaderSubgroupRotateClustered; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES: - { - VkPhysicalDeviceShaderExpectAssumeFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES); - const VkPhysicalDeviceShaderExpectAssumeFeatures *in_ext = (const VkPhysicalDeviceShaderExpectAssumeFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES; - out_ext->shaderExpectAssume = in_ext->shaderExpectAssume; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES: - { - VkPhysicalDeviceShaderFloatControls2Features32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES); - const VkPhysicalDeviceShaderFloatControls2Features *in_ext = (const VkPhysicalDeviceShaderFloatControls2Features *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES; - out_ext->shaderFloatControls2 = in_ext->shaderFloatControls2; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES: - { - VkPhysicalDeviceDynamicRenderingLocalReadFeatures32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES); - const VkPhysicalDeviceDynamicRenderingLocalReadFeatures *in_ext = (const VkPhysicalDeviceDynamicRenderingLocalReadFeatures *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES; - out_ext->dynamicRenderingLocalRead = in_ext->dynamicRenderingLocalRead; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_QUAD_CONTROL_FEATURES_KHR: - { - VkPhysicalDeviceShaderQuadControlFeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_QUAD_CONTROL_FEATURES_KHR); - const VkPhysicalDeviceShaderQuadControlFeaturesKHR *in_ext = (const VkPhysicalDeviceShaderQuadControlFeaturesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_QUAD_CONTROL_FEATURES_KHR; - out_ext->shaderQuadControl = in_ext->shaderQuadControl; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT16_VECTOR_FEATURES_NV: - { - VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT16_VECTOR_FEATURES_NV); - const VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV *in_ext = (const VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT16_VECTOR_FEATURES_NV; - out_ext->shaderFloat16VectorAtomics = in_ext->shaderFloat16VectorAtomics; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_FEATURES_EXT: - { - VkPhysicalDeviceMapMemoryPlacedFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_FEATURES_EXT); - const VkPhysicalDeviceMapMemoryPlacedFeaturesEXT *in_ext = (const VkPhysicalDeviceMapMemoryPlacedFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_FEATURES_EXT; - out_ext->memoryMapPlaced = in_ext->memoryMapPlaced; - out_ext->memoryMapRangePlaced = in_ext->memoryMapRangePlaced; - out_ext->memoryUnmapReserve = in_ext->memoryUnmapReserve; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAW_ACCESS_CHAINS_FEATURES_NV: - { - VkPhysicalDeviceRawAccessChainsFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAW_ACCESS_CHAINS_FEATURES_NV); - const VkPhysicalDeviceRawAccessChainsFeaturesNV *in_ext = (const VkPhysicalDeviceRawAccessChainsFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAW_ACCESS_CHAINS_FEATURES_NV; - out_ext->shaderRawAccessChains = in_ext->shaderRawAccessChains; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMMAND_BUFFER_INHERITANCE_FEATURES_NV: - { - VkPhysicalDeviceCommandBufferInheritanceFeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMMAND_BUFFER_INHERITANCE_FEATURES_NV); - const VkPhysicalDeviceCommandBufferInheritanceFeaturesNV *in_ext = (const VkPhysicalDeviceCommandBufferInheritanceFeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMMAND_BUFFER_INHERITANCE_FEATURES_NV; - out_ext->commandBufferInheritance = in_ext->commandBufferInheritance; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_FEATURES_MESA: - { - VkPhysicalDeviceImageAlignmentControlFeaturesMESA32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_FEATURES_MESA); - const VkPhysicalDeviceImageAlignmentControlFeaturesMESA *in_ext = (const VkPhysicalDeviceImageAlignmentControlFeaturesMESA *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_FEATURES_MESA; - out_ext->imageAlignmentControl = in_ext->imageAlignmentControl; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_REPLICATED_COMPOSITES_FEATURES_EXT: - { - VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_REPLICATED_COMPOSITES_FEATURES_EXT); - const VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT *in_ext = (const VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_REPLICATED_COMPOSITES_FEATURES_EXT; - out_ext->shaderReplicatedComposites = in_ext->shaderReplicatedComposites; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT: - { - VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT); - const VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT *in_ext = (const VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT; - out_ext->presentModeFifoLatestReady = in_ext->presentModeFifoLatestReady; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_FEATURES_NV: - { - VkPhysicalDeviceCooperativeMatrix2FeaturesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_FEATURES_NV); - const VkPhysicalDeviceCooperativeMatrix2FeaturesNV *in_ext = (const VkPhysicalDeviceCooperativeMatrix2FeaturesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_FEATURES_NV; - out_ext->cooperativeMatrixWorkgroupScope = in_ext->cooperativeMatrixWorkgroupScope; - out_ext->cooperativeMatrixFlexibleDimensions = in_ext->cooperativeMatrixFlexibleDimensions; - out_ext->cooperativeMatrixReductions = in_ext->cooperativeMatrixReductions; - out_ext->cooperativeMatrixConversions = in_ext->cooperativeMatrixConversions; - out_ext->cooperativeMatrixPerElementOperations = in_ext->cooperativeMatrixPerElementOperations; - out_ext->cooperativeMatrixTensorAddressing = in_ext->cooperativeMatrixTensorAddressing; - out_ext->cooperativeMatrixBlockLoads = in_ext->cooperativeMatrixBlockLoads; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HDR_VIVID_FEATURES_HUAWEI: - { - VkPhysicalDeviceHdrVividFeaturesHUAWEI32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HDR_VIVID_FEATURES_HUAWEI); - const VkPhysicalDeviceHdrVividFeaturesHUAWEI *in_ext = (const VkPhysicalDeviceHdrVividFeaturesHUAWEI *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HDR_VIVID_FEATURES_HUAWEI; - out_ext->hdrVivid = in_ext->hdrVivid; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_ROBUSTNESS_FEATURES_EXT: - { - VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_ROBUSTNESS_FEATURES_EXT); - const VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT *in_ext = (const VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_ROBUSTNESS_FEATURES_EXT; - out_ext->vertexAttributeRobustness = in_ext->vertexAttributeRobustness; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline void convert_VkFormatProperties2_win32_to_host(struct conversion_context *ctx, const VkFormatProperties232 *in, VkFormatProperties2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT: - { - VkSubpassResolvePerformanceQueryEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3: - { - VkFormatProperties3 *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkFormatProperties2_host_to_win32(const VkFormatProperties2 *in, VkFormatProperties232 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - out->formatProperties = in->formatProperties; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT: - { - VkSubpassResolvePerformanceQueryEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT); - const VkSubpassResolvePerformanceQueryEXT *in_ext = (const VkSubpassResolvePerformanceQueryEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT; - out_ext->optimal = in_ext->optimal; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3: - { - VkFormatProperties332 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3); - const VkFormatProperties3 *in_ext = (const VkFormatProperties3 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3; - out_ext->linearTilingFeatures = in_ext->linearTilingFeatures; - out_ext->optimalTilingFeatures = in_ext->optimalTilingFeatures; - out_ext->bufferFeatures = in_ext->bufferFeatures; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline void convert_VkPhysicalDeviceFragmentShadingRateKHR_win32_to_host(const VkPhysicalDeviceFragmentShadingRateKHR32 *in, VkPhysicalDeviceFragmentShadingRateKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPhysicalDeviceFragmentShadingRateKHR_host_to_win32(const VkPhysicalDeviceFragmentShadingRateKHR *in, VkPhysicalDeviceFragmentShadingRateKHR32 *out) -{ - if (!in) return; - - out->sampleCounts = in->sampleCounts; - out->fragmentSize = in->fragmentSize; -} - -static inline VkPhysicalDeviceFragmentShadingRateKHR *convert_VkPhysicalDeviceFragmentShadingRateKHR_array_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceFragmentShadingRateKHR32 *in, uint32_t count) -{ - VkPhysicalDeviceFragmentShadingRateKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPhysicalDeviceFragmentShadingRateKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPhysicalDeviceFragmentShadingRateKHR_array_host_to_win32(const VkPhysicalDeviceFragmentShadingRateKHR *in, VkPhysicalDeviceFragmentShadingRateKHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkPhysicalDeviceFragmentShadingRateKHR_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkImageFormatProperties_host_to_win32(const VkImageFormatProperties *in, VkImageFormatProperties32 *out) -{ - if (!in) return; - - out->maxExtent = in->maxExtent; - out->maxMipLevels = in->maxMipLevels; - out->maxArrayLayers = in->maxArrayLayers; - out->sampleCounts = in->sampleCounts; - out->maxResourceSize = in->maxResourceSize; -} - -static inline void convert_VkPhysicalDeviceImageFormatInfo2_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceImageFormatInfo232 *in, VkPhysicalDeviceImageFormatInfo2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->format = in->format; - out->type = in->type; - out->tiling = in->tiling; - out->usage = in->usage; - out->flags = in->flags; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: - { - VkPhysicalDeviceExternalImageFormatInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExternalImageFormatInfo32 *in_ext = (const VkPhysicalDeviceExternalImageFormatInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO; - out_ext->pNext = NULL; - out_ext->handleType = in_ext->handleType; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: - { - VkImageFormatListCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageFormatListCreateInfo32 *in_ext = (const VkImageFormatListCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->viewFormatCount = in_ext->viewFormatCount; - out_ext->pViewFormats = UlongToPtr(in_ext->pViewFormats); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: - { - VkImageStencilUsageCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageStencilUsageCreateInfo32 *in_ext = (const VkImageStencilUsageCreateInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->stencilUsage = in_ext->stencilUsage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT: - { - VkPhysicalDeviceImageViewImageFormatInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageViewImageFormatInfoEXT32 *in_ext = (const VkPhysicalDeviceImageViewImageFormatInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT; - out_ext->pNext = NULL; - out_ext->imageViewType = in_ext->imageViewType; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR: - { - VkVideoProfileListInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoProfileListInfoKHR32 *in_ext = (const VkVideoProfileListInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR; - out_ext->pNext = NULL; - out_ext->profileCount = in_ext->profileCount; - out_ext->pProfiles = convert_VkVideoProfileInfoKHR_array_win32_to_host(ctx, (const VkVideoProfileInfoKHR32 *)UlongToPtr(in_ext->pProfiles), in_ext->profileCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT: - { - VkImageCompressionControlEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkImageCompressionControlEXT32 *in_ext = (const VkImageCompressionControlEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->compressionControlPlaneCount = in_ext->compressionControlPlaneCount; - out_ext->pFixedRateFlags = UlongToPtr(in_ext->pFixedRateFlags); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV: - { - VkOpticalFlowImageFormatInfoNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkOpticalFlowImageFormatInfoNV32 *in_ext = (const VkOpticalFlowImageFormatInfoNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV; - out_ext->pNext = NULL; - out_ext->usage = in_ext->usage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkImageFormatProperties2_win32_to_host(struct conversion_context *ctx, const VkImageFormatProperties232 *in, VkImageFormatProperties2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: - { - VkExternalImageFormatProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: - { - VkSamplerYcbcrConversionImageFormatProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: - { - VkTextureLODGatherFormatPropertiesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: - { - VkFilterCubicImageViewImageFormatPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY: - { - VkHostImageCopyDevicePerformanceQuery *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT: - { - VkImageCompressionPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkImageFormatProperties2_host_to_win32(const VkImageFormatProperties2 *in, VkImageFormatProperties232 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - convert_VkImageFormatProperties_host_to_win32(&in->imageFormatProperties, &out->imageFormatProperties); - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: - { - VkExternalImageFormatProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES); - const VkExternalImageFormatProperties *in_ext = (const VkExternalImageFormatProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES; - out_ext->externalMemoryProperties = in_ext->externalMemoryProperties; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: - { - VkSamplerYcbcrConversionImageFormatProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES); - const VkSamplerYcbcrConversionImageFormatProperties *in_ext = (const VkSamplerYcbcrConversionImageFormatProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES; - out_ext->combinedImageSamplerDescriptorCount = in_ext->combinedImageSamplerDescriptorCount; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: - { - VkTextureLODGatherFormatPropertiesAMD32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD); - const VkTextureLODGatherFormatPropertiesAMD *in_ext = (const VkTextureLODGatherFormatPropertiesAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD; - out_ext->supportsTextureGatherLODBiasAMD = in_ext->supportsTextureGatherLODBiasAMD; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: - { - VkFilterCubicImageViewImageFormatPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT); - const VkFilterCubicImageViewImageFormatPropertiesEXT *in_ext = (const VkFilterCubicImageViewImageFormatPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT; - out_ext->filterCubic = in_ext->filterCubic; - out_ext->filterCubicMinmax = in_ext->filterCubicMinmax; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY: - { - VkHostImageCopyDevicePerformanceQuery32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY); - const VkHostImageCopyDevicePerformanceQuery *in_ext = (const VkHostImageCopyDevicePerformanceQuery *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY; - out_ext->optimalDeviceAccess = in_ext->optimalDeviceAccess; - out_ext->identicalMemoryLayout = in_ext->identicalMemoryLayout; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT: - { - VkImageCompressionPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT); - const VkImageCompressionPropertiesEXT *in_ext = (const VkImageCompressionPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT; - out_ext->imageCompressionFlags = in_ext->imageCompressionFlags; - out_ext->imageCompressionFixedRateFlags = in_ext->imageCompressionFixedRateFlags; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline void convert_VkMemoryHeap_host_to_win32(const VkMemoryHeap *in, VkMemoryHeap32 *out) -{ - if (!in) return; - - out->size = in->size; - out->flags = in->flags; -} - -static inline void convert_VkMemoryHeap_array_host_to_win32(const VkMemoryHeap *in, VkMemoryHeap32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkMemoryHeap_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPhysicalDeviceMemoryProperties_host_to_win32(const VkPhysicalDeviceMemoryProperties *in, VkPhysicalDeviceMemoryProperties32 *out) -{ - if (!in) return; - - out->memoryTypeCount = in->memoryTypeCount; - memcpy(out->memoryTypes, in->memoryTypes, VK_MAX_MEMORY_TYPES * sizeof(VkMemoryType)); - out->memoryHeapCount = in->memoryHeapCount; - convert_VkMemoryHeap_array_host_to_win32(in->memoryHeaps, out->memoryHeaps, VK_MAX_MEMORY_HEAPS); -} - -static inline void convert_VkPhysicalDeviceMemoryProperties2_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceMemoryProperties232 *in, VkPhysicalDeviceMemoryProperties2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: - { - VkPhysicalDeviceMemoryBudgetPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkPhysicalDeviceMemoryProperties2_host_to_win32(const VkPhysicalDeviceMemoryProperties2 *in, VkPhysicalDeviceMemoryProperties232 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - convert_VkPhysicalDeviceMemoryProperties_host_to_win32(&in->memoryProperties, &out->memoryProperties); - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: - { - VkPhysicalDeviceMemoryBudgetPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT); - const VkPhysicalDeviceMemoryBudgetPropertiesEXT *in_ext = (const VkPhysicalDeviceMemoryBudgetPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT; - memcpy(out_ext->heapBudget, in_ext->heapBudget, VK_MAX_MEMORY_HEAPS * sizeof(VkDeviceSize)); - memcpy(out_ext->heapUsage, in_ext->heapUsage, VK_MAX_MEMORY_HEAPS * sizeof(VkDeviceSize)); - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline void convert_VkMultisamplePropertiesEXT_win32_to_host(const VkMultisamplePropertiesEXT32 *in, VkMultisamplePropertiesEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMultisamplePropertiesEXT_host_to_win32(const VkMultisamplePropertiesEXT *in, VkMultisamplePropertiesEXT32 *out) -{ - if (!in) return; - - out->maxSampleLocationGridSize = in->maxSampleLocationGridSize; -} - -static inline void convert_VkOpticalFlowImageFormatInfoNV_win32_to_host(const VkOpticalFlowImageFormatInfoNV32 *in, VkOpticalFlowImageFormatInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->usage = in->usage; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkOpticalFlowImageFormatPropertiesNV_win32_to_host(const VkOpticalFlowImageFormatPropertiesNV32 *in, VkOpticalFlowImageFormatPropertiesNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkOpticalFlowImageFormatPropertiesNV_host_to_win32(const VkOpticalFlowImageFormatPropertiesNV *in, VkOpticalFlowImageFormatPropertiesNV32 *out) -{ - if (!in) return; - - out->format = in->format; -} - -static inline VkOpticalFlowImageFormatPropertiesNV *convert_VkOpticalFlowImageFormatPropertiesNV_array_win32_to_host(struct conversion_context *ctx, const VkOpticalFlowImageFormatPropertiesNV32 *in, uint32_t count) -{ - VkOpticalFlowImageFormatPropertiesNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkOpticalFlowImageFormatPropertiesNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkOpticalFlowImageFormatPropertiesNV_array_host_to_win32(const VkOpticalFlowImageFormatPropertiesNV *in, VkOpticalFlowImageFormatPropertiesNV32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkOpticalFlowImageFormatPropertiesNV_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPhysicalDeviceLimits_host_to_win32(const VkPhysicalDeviceLimits *in, VkPhysicalDeviceLimits32 *out) -{ - if (!in) return; - - out->maxImageDimension1D = in->maxImageDimension1D; - out->maxImageDimension2D = in->maxImageDimension2D; - out->maxImageDimension3D = in->maxImageDimension3D; - out->maxImageDimensionCube = in->maxImageDimensionCube; - out->maxImageArrayLayers = in->maxImageArrayLayers; - out->maxTexelBufferElements = in->maxTexelBufferElements; - out->maxUniformBufferRange = in->maxUniformBufferRange; - out->maxStorageBufferRange = in->maxStorageBufferRange; - out->maxPushConstantsSize = in->maxPushConstantsSize; - out->maxMemoryAllocationCount = in->maxMemoryAllocationCount; - out->maxSamplerAllocationCount = in->maxSamplerAllocationCount; - out->bufferImageGranularity = in->bufferImageGranularity; - out->sparseAddressSpaceSize = in->sparseAddressSpaceSize; - out->maxBoundDescriptorSets = in->maxBoundDescriptorSets; - out->maxPerStageDescriptorSamplers = in->maxPerStageDescriptorSamplers; - out->maxPerStageDescriptorUniformBuffers = in->maxPerStageDescriptorUniformBuffers; - out->maxPerStageDescriptorStorageBuffers = in->maxPerStageDescriptorStorageBuffers; - out->maxPerStageDescriptorSampledImages = in->maxPerStageDescriptorSampledImages; - out->maxPerStageDescriptorStorageImages = in->maxPerStageDescriptorStorageImages; - out->maxPerStageDescriptorInputAttachments = in->maxPerStageDescriptorInputAttachments; - out->maxPerStageResources = in->maxPerStageResources; - out->maxDescriptorSetSamplers = in->maxDescriptorSetSamplers; - out->maxDescriptorSetUniformBuffers = in->maxDescriptorSetUniformBuffers; - out->maxDescriptorSetUniformBuffersDynamic = in->maxDescriptorSetUniformBuffersDynamic; - out->maxDescriptorSetStorageBuffers = in->maxDescriptorSetStorageBuffers; - out->maxDescriptorSetStorageBuffersDynamic = in->maxDescriptorSetStorageBuffersDynamic; - out->maxDescriptorSetSampledImages = in->maxDescriptorSetSampledImages; - out->maxDescriptorSetStorageImages = in->maxDescriptorSetStorageImages; - out->maxDescriptorSetInputAttachments = in->maxDescriptorSetInputAttachments; - out->maxVertexInputAttributes = in->maxVertexInputAttributes; - out->maxVertexInputBindings = in->maxVertexInputBindings; - out->maxVertexInputAttributeOffset = in->maxVertexInputAttributeOffset; - out->maxVertexInputBindingStride = in->maxVertexInputBindingStride; - out->maxVertexOutputComponents = in->maxVertexOutputComponents; - out->maxTessellationGenerationLevel = in->maxTessellationGenerationLevel; - out->maxTessellationPatchSize = in->maxTessellationPatchSize; - out->maxTessellationControlPerVertexInputComponents = in->maxTessellationControlPerVertexInputComponents; - out->maxTessellationControlPerVertexOutputComponents = in->maxTessellationControlPerVertexOutputComponents; - out->maxTessellationControlPerPatchOutputComponents = in->maxTessellationControlPerPatchOutputComponents; - out->maxTessellationControlTotalOutputComponents = in->maxTessellationControlTotalOutputComponents; - out->maxTessellationEvaluationInputComponents = in->maxTessellationEvaluationInputComponents; - out->maxTessellationEvaluationOutputComponents = in->maxTessellationEvaluationOutputComponents; - out->maxGeometryShaderInvocations = in->maxGeometryShaderInvocations; - out->maxGeometryInputComponents = in->maxGeometryInputComponents; - out->maxGeometryOutputComponents = in->maxGeometryOutputComponents; - out->maxGeometryOutputVertices = in->maxGeometryOutputVertices; - out->maxGeometryTotalOutputComponents = in->maxGeometryTotalOutputComponents; - out->maxFragmentInputComponents = in->maxFragmentInputComponents; - out->maxFragmentOutputAttachments = in->maxFragmentOutputAttachments; - out->maxFragmentDualSrcAttachments = in->maxFragmentDualSrcAttachments; - out->maxFragmentCombinedOutputResources = in->maxFragmentCombinedOutputResources; - out->maxComputeSharedMemorySize = in->maxComputeSharedMemorySize; - memcpy(out->maxComputeWorkGroupCount, in->maxComputeWorkGroupCount, 3 * sizeof(uint32_t)); - out->maxComputeWorkGroupInvocations = in->maxComputeWorkGroupInvocations; - memcpy(out->maxComputeWorkGroupSize, in->maxComputeWorkGroupSize, 3 * sizeof(uint32_t)); - out->subPixelPrecisionBits = in->subPixelPrecisionBits; - out->subTexelPrecisionBits = in->subTexelPrecisionBits; - out->mipmapPrecisionBits = in->mipmapPrecisionBits; - out->maxDrawIndexedIndexValue = in->maxDrawIndexedIndexValue; - out->maxDrawIndirectCount = in->maxDrawIndirectCount; - out->maxSamplerLodBias = in->maxSamplerLodBias; - out->maxSamplerAnisotropy = in->maxSamplerAnisotropy; - out->maxViewports = in->maxViewports; - memcpy(out->maxViewportDimensions, in->maxViewportDimensions, 2 * sizeof(uint32_t)); - memcpy(out->viewportBoundsRange, in->viewportBoundsRange, 2 * sizeof(float)); - out->viewportSubPixelBits = in->viewportSubPixelBits; - out->minMemoryMapAlignment = in->minMemoryMapAlignment; - out->minTexelBufferOffsetAlignment = in->minTexelBufferOffsetAlignment; - out->minUniformBufferOffsetAlignment = in->minUniformBufferOffsetAlignment; - out->minStorageBufferOffsetAlignment = in->minStorageBufferOffsetAlignment; - out->minTexelOffset = in->minTexelOffset; - out->maxTexelOffset = in->maxTexelOffset; - out->minTexelGatherOffset = in->minTexelGatherOffset; - out->maxTexelGatherOffset = in->maxTexelGatherOffset; - out->minInterpolationOffset = in->minInterpolationOffset; - out->maxInterpolationOffset = in->maxInterpolationOffset; - out->subPixelInterpolationOffsetBits = in->subPixelInterpolationOffsetBits; - out->maxFramebufferWidth = in->maxFramebufferWidth; - out->maxFramebufferHeight = in->maxFramebufferHeight; - out->maxFramebufferLayers = in->maxFramebufferLayers; - out->framebufferColorSampleCounts = in->framebufferColorSampleCounts; - out->framebufferDepthSampleCounts = in->framebufferDepthSampleCounts; - out->framebufferStencilSampleCounts = in->framebufferStencilSampleCounts; - out->framebufferNoAttachmentsSampleCounts = in->framebufferNoAttachmentsSampleCounts; - out->maxColorAttachments = in->maxColorAttachments; - out->sampledImageColorSampleCounts = in->sampledImageColorSampleCounts; - out->sampledImageIntegerSampleCounts = in->sampledImageIntegerSampleCounts; - out->sampledImageDepthSampleCounts = in->sampledImageDepthSampleCounts; - out->sampledImageStencilSampleCounts = in->sampledImageStencilSampleCounts; - out->storageImageSampleCounts = in->storageImageSampleCounts; - out->maxSampleMaskWords = in->maxSampleMaskWords; - out->timestampComputeAndGraphics = in->timestampComputeAndGraphics; - out->timestampPeriod = in->timestampPeriod; - out->maxClipDistances = in->maxClipDistances; - out->maxCullDistances = in->maxCullDistances; - out->maxCombinedClipAndCullDistances = in->maxCombinedClipAndCullDistances; - out->discreteQueuePriorities = in->discreteQueuePriorities; - memcpy(out->pointSizeRange, in->pointSizeRange, 2 * sizeof(float)); - memcpy(out->lineWidthRange, in->lineWidthRange, 2 * sizeof(float)); - out->pointSizeGranularity = in->pointSizeGranularity; - out->lineWidthGranularity = in->lineWidthGranularity; - out->strictLines = in->strictLines; - out->standardSampleLocations = in->standardSampleLocations; - out->optimalBufferCopyOffsetAlignment = in->optimalBufferCopyOffsetAlignment; - out->optimalBufferCopyRowPitchAlignment = in->optimalBufferCopyRowPitchAlignment; - out->nonCoherentAtomSize = in->nonCoherentAtomSize; -} - -static inline void convert_VkPhysicalDeviceProperties_host_to_win32(const VkPhysicalDeviceProperties *in, VkPhysicalDeviceProperties32 *out) -{ - if (!in) return; - - out->apiVersion = in->apiVersion; - out->driverVersion = in->driverVersion; - out->vendorID = in->vendorID; - out->deviceID = in->deviceID; - out->deviceType = in->deviceType; - memcpy(out->deviceName, in->deviceName, VK_MAX_PHYSICAL_DEVICE_NAME_SIZE * sizeof(char)); - memcpy(out->pipelineCacheUUID, in->pipelineCacheUUID, VK_UUID_SIZE * sizeof(uint8_t)); - convert_VkPhysicalDeviceLimits_host_to_win32(&in->limits, &out->limits); - out->sparseProperties = in->sparseProperties; -} - -static inline void convert_VkPhysicalDeviceProperties2_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceProperties232 *in, VkPhysicalDeviceProperties2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT: - { - VkPhysicalDeviceMultiDrawPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES: - { - VkPhysicalDevicePushDescriptorProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES: - { - VkPhysicalDeviceDriverProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: - { - VkPhysicalDeviceIDProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: - { - VkPhysicalDeviceMultiviewProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: - { - VkPhysicalDeviceDiscardRectanglePropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: - { - VkPhysicalDeviceSubgroupProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: - { - VkPhysicalDevicePointClippingProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: - { - VkPhysicalDeviceProtectedMemoryProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: - { - VkPhysicalDeviceSamplerFilterMinmaxProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: - { - VkPhysicalDeviceSampleLocationsPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: - { - VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES: - { - VkPhysicalDeviceInlineUniformBlockProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: - { - VkPhysicalDeviceMaintenance3Properties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES: - { - VkPhysicalDeviceMaintenance4Properties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES: - { - VkPhysicalDeviceMaintenance5Properties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES: - { - VkPhysicalDeviceMaintenance6Properties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: - { - VkPhysicalDeviceFloatControlsProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: - { - VkPhysicalDeviceExternalMemoryHostPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT: - { - VkPhysicalDeviceConservativeRasterizationPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: - { - VkPhysicalDeviceShaderCorePropertiesAMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD: - { - VkPhysicalDeviceShaderCoreProperties2AMD *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: - { - VkPhysicalDeviceDescriptorIndexingProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: - { - VkPhysicalDeviceTimelineSemaphoreProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: - { - VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES: - { - VkPhysicalDeviceVertexAttributeDivisorProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: - { - VkPhysicalDevicePCIBusInfoPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: - { - VkPhysicalDeviceDepthStencilResolveProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: - { - VkPhysicalDeviceTransformFeedbackPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_PROPERTIES_KHR: - { - VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_NV: - { - VkPhysicalDeviceCopyMemoryIndirectPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV: - { - VkPhysicalDeviceMemoryDecompressionPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: - { - VkPhysicalDeviceShadingRateImagePropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: - { - VkPhysicalDeviceMeshShaderPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT: - { - VkPhysicalDeviceMeshShaderPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR: - { - VkPhysicalDeviceAccelerationStructurePropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR: - { - VkPhysicalDeviceRayTracingPipelinePropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: - { - VkPhysicalDeviceRayTracingPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: - { - VkPhysicalDeviceFragmentDensityMapPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT: - { - VkPhysicalDeviceFragmentDensityMap2PropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM: - { - VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: - { - VkPhysicalDeviceCooperativeMatrixPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR: - { - VkPhysicalDevicePerformanceQueryPropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: - { - VkPhysicalDeviceShaderSMBuiltinsPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES: - { - VkPhysicalDeviceTexelBufferAlignmentProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES: - { - VkPhysicalDeviceSubgroupSizeControlProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI: - { - VkPhysicalDeviceSubpassShadingPropertiesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI: - { - VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES: - { - VkPhysicalDeviceLineRasterizationProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: - { - VkPhysicalDeviceVulkan11Properties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: - { - VkPhysicalDeviceVulkan12Properties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES: - { - VkPhysicalDeviceVulkan13Properties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_PROPERTIES: - { - VkPhysicalDeviceVulkan14Properties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: - { - VkPhysicalDeviceCustomBorderColorPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT: - { - VkPhysicalDeviceExtendedDynamicState3PropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceExtendedDynamicState3PropertiesEXT32 *in_ext = (const VkPhysicalDeviceExtendedDynamicState3PropertiesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_ext->dynamicPrimitiveTopologyUnrestricted = in_ext->dynamicPrimitiveTopologyUnrestricted; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: - { - VkPhysicalDeviceRobustness2PropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR: - { - VkPhysicalDeviceFragmentShadingRatePropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV: - { - VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV32 *in_ext = (const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV; - out_ext->pNext = NULL; - out_ext->maxFragmentShadingRateInvocationCount = in_ext->maxFragmentShadingRateInvocationCount; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_PROPERTIES_EXT: - { - VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT32 *in_ext = (const VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_ext->nativeUnalignedPerformance = in_ext->nativeUnalignedPerformance; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_EXT: - { - VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES: - { - VkPhysicalDeviceHostImageCopyProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceHostImageCopyProperties32 *in_ext = (const VkPhysicalDeviceHostImageCopyProperties32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES; - out_ext->pNext = NULL; - out_ext->copySrcLayoutCount = in_ext->copySrcLayoutCount; - out_ext->pCopySrcLayouts = UlongToPtr(in_ext->pCopySrcLayouts); - out_ext->copyDstLayoutCount = in_ext->copyDstLayoutCount; - out_ext->pCopyDstLayouts = UlongToPtr(in_ext->pCopyDstLayouts); - memcpy(out_ext->optimalTilingLayoutUUID, in_ext->optimalTilingLayoutUUID, VK_UUID_SIZE * sizeof(uint8_t)); - out_ext->identicalMemoryTypeRequirements = in_ext->identicalMemoryTypeRequirements; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: - { - VkPhysicalDeviceProvokingVertexPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT: - { - VkPhysicalDeviceDescriptorBufferPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT: - { - VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES: - { - VkPhysicalDeviceShaderIntegerDotProductProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR: - { - VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_PROPERTIES_KHR: - { - VkPhysicalDevicePipelineBinaryPropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDevicePipelineBinaryPropertiesKHR32 *in_ext = (const VkPhysicalDevicePipelineBinaryPropertiesKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_ext->pipelineBinaryInternalCache = in_ext->pipelineBinaryInternalCache; - out_ext->pipelineBinaryInternalCacheControl = in_ext->pipelineBinaryInternalCacheControl; - out_ext->pipelineBinaryPrefersInternalCache = in_ext->pipelineBinaryPrefersInternalCache; - out_ext->pipelineBinaryPrecompiledInternalCache = in_ext->pipelineBinaryPrecompiledInternalCache; - out_ext->pipelineBinaryCompressedData = in_ext->pipelineBinaryCompressedData; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT: - { - VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT32 *in_ext = (const VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_ext->graphicsPipelineLibraryFastLinking = in_ext->graphicsPipelineLibraryFastLinking; - out_ext->graphicsPipelineLibraryIndependentInterpolationDecoration = in_ext->graphicsPipelineLibraryIndependentInterpolationDecoration; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT: - { - VkPhysicalDeviceNestedCommandBufferPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceNestedCommandBufferPropertiesEXT32 *in_ext = (const VkPhysicalDeviceNestedCommandBufferPropertiesEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_ext->maxCommandBufferNestingLevel = in_ext->maxCommandBufferNestingLevel; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT: - { - VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT: - { - VkPhysicalDeviceOpacityMicromapPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES: - { - VkPhysicalDevicePipelineRobustnessProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM: - { - VkPhysicalDeviceImageProcessingPropertiesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV: - { - VkPhysicalDeviceOpticalFlowPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM: - { - VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV: - { - VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV: - { - VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM: - { - VkPhysicalDeviceShaderCorePropertiesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT: - { - VkPhysicalDeviceShaderObjectPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_PROPERTIES_EXT: - { - VkPhysicalDeviceShaderTileImagePropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR: - { - VkPhysicalDeviceCooperativeMatrixPropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM: - { - VkPhysicalDeviceImageProcessing2PropertiesQCOM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT: - { - VkPhysicalDeviceLayeredDriverPropertiesMSFT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_PROPERTIES_NV: - { - VkPhysicalDeviceCudaKernelLaunchPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_PROPERTIES_ARM: - { - VkPhysicalDeviceSchedulingControlsPropertiesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceSchedulingControlsPropertiesARM32 *in_ext = (const VkPhysicalDeviceSchedulingControlsPropertiesARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_PROPERTIES_ARM; - out_ext->pNext = NULL; - out_ext->schedulingControlsFlags = in_ext->schedulingControlsFlags; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_PROPERTIES_ARM: - { - VkPhysicalDeviceRenderPassStripedPropertiesARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_PROPERTIES_ARM; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_PROPERTIES_EXT: - { - VkPhysicalDeviceMapMemoryPlacedPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_PROPERTIES_MESA: - { - VkPhysicalDeviceImageAlignmentControlPropertiesMESA *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPhysicalDeviceImageAlignmentControlPropertiesMESA32 *in_ext = (const VkPhysicalDeviceImageAlignmentControlPropertiesMESA32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_PROPERTIES_MESA; - out_ext->pNext = NULL; - out_ext->supportedImageAlignmentMask = in_ext->supportedImageAlignmentMask; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_PROPERTIES_NV: - { - VkPhysicalDeviceCooperativeMatrix2PropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkPhysicalDeviceProperties2_host_to_win32(const VkPhysicalDeviceProperties2 *in, VkPhysicalDeviceProperties232 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - convert_VkPhysicalDeviceProperties_host_to_win32(&in->properties, &out->properties); - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV: - { - VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV); - const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV; - out_ext->maxGraphicsShaderGroupCount = in_ext->maxGraphicsShaderGroupCount; - out_ext->maxIndirectSequenceCount = in_ext->maxIndirectSequenceCount; - out_ext->maxIndirectCommandsTokenCount = in_ext->maxIndirectCommandsTokenCount; - out_ext->maxIndirectCommandsStreamCount = in_ext->maxIndirectCommandsStreamCount; - out_ext->maxIndirectCommandsTokenOffset = in_ext->maxIndirectCommandsTokenOffset; - out_ext->maxIndirectCommandsStreamStride = in_ext->maxIndirectCommandsStreamStride; - out_ext->minSequencesCountBufferOffsetAlignment = in_ext->minSequencesCountBufferOffsetAlignment; - out_ext->minSequencesIndexBufferOffsetAlignment = in_ext->minSequencesIndexBufferOffsetAlignment; - out_ext->minIndirectCommandsBufferOffsetAlignment = in_ext->minIndirectCommandsBufferOffsetAlignment; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT: - { - VkPhysicalDeviceMultiDrawPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT); - const VkPhysicalDeviceMultiDrawPropertiesEXT *in_ext = (const VkPhysicalDeviceMultiDrawPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT; - out_ext->maxMultiDrawCount = in_ext->maxMultiDrawCount; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES: - { - VkPhysicalDevicePushDescriptorProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES); - const VkPhysicalDevicePushDescriptorProperties *in_ext = (const VkPhysicalDevicePushDescriptorProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES; - out_ext->maxPushDescriptors = in_ext->maxPushDescriptors; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES: - { - VkPhysicalDeviceDriverProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES); - const VkPhysicalDeviceDriverProperties *in_ext = (const VkPhysicalDeviceDriverProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES; - out_ext->driverID = in_ext->driverID; - memcpy(out_ext->driverName, in_ext->driverName, VK_MAX_DRIVER_NAME_SIZE * sizeof(char)); - memcpy(out_ext->driverInfo, in_ext->driverInfo, VK_MAX_DRIVER_INFO_SIZE * sizeof(char)); - out_ext->conformanceVersion = in_ext->conformanceVersion; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: - { - VkPhysicalDeviceIDProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES); - const VkPhysicalDeviceIDProperties *in_ext = (const VkPhysicalDeviceIDProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES; - memcpy(out_ext->deviceUUID, in_ext->deviceUUID, VK_UUID_SIZE * sizeof(uint8_t)); - memcpy(out_ext->driverUUID, in_ext->driverUUID, VK_UUID_SIZE * sizeof(uint8_t)); - memcpy(out_ext->deviceLUID, in_ext->deviceLUID, VK_LUID_SIZE * sizeof(uint8_t)); - out_ext->deviceNodeMask = in_ext->deviceNodeMask; - out_ext->deviceLUIDValid = in_ext->deviceLUIDValid; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: - { - VkPhysicalDeviceMultiviewProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES); - const VkPhysicalDeviceMultiviewProperties *in_ext = (const VkPhysicalDeviceMultiviewProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES; - out_ext->maxMultiviewViewCount = in_ext->maxMultiviewViewCount; - out_ext->maxMultiviewInstanceIndex = in_ext->maxMultiviewInstanceIndex; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: - { - VkPhysicalDeviceDiscardRectanglePropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT); - const VkPhysicalDeviceDiscardRectanglePropertiesEXT *in_ext = (const VkPhysicalDeviceDiscardRectanglePropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT; - out_ext->maxDiscardRectangles = in_ext->maxDiscardRectangles; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: - { - VkPhysicalDeviceSubgroupProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES); - const VkPhysicalDeviceSubgroupProperties *in_ext = (const VkPhysicalDeviceSubgroupProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES; - out_ext->subgroupSize = in_ext->subgroupSize; - out_ext->supportedStages = in_ext->supportedStages; - out_ext->supportedOperations = in_ext->supportedOperations; - out_ext->quadOperationsInAllStages = in_ext->quadOperationsInAllStages; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: - { - VkPhysicalDevicePointClippingProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES); - const VkPhysicalDevicePointClippingProperties *in_ext = (const VkPhysicalDevicePointClippingProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES; - out_ext->pointClippingBehavior = in_ext->pointClippingBehavior; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: - { - VkPhysicalDeviceProtectedMemoryProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES); - const VkPhysicalDeviceProtectedMemoryProperties *in_ext = (const VkPhysicalDeviceProtectedMemoryProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES; - out_ext->protectedNoFault = in_ext->protectedNoFault; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: - { - VkPhysicalDeviceSamplerFilterMinmaxProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES); - const VkPhysicalDeviceSamplerFilterMinmaxProperties *in_ext = (const VkPhysicalDeviceSamplerFilterMinmaxProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES; - out_ext->filterMinmaxSingleComponentFormats = in_ext->filterMinmaxSingleComponentFormats; - out_ext->filterMinmaxImageComponentMapping = in_ext->filterMinmaxImageComponentMapping; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: - { - VkPhysicalDeviceSampleLocationsPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT); - const VkPhysicalDeviceSampleLocationsPropertiesEXT *in_ext = (const VkPhysicalDeviceSampleLocationsPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT; - out_ext->sampleLocationSampleCounts = in_ext->sampleLocationSampleCounts; - out_ext->maxSampleLocationGridSize = in_ext->maxSampleLocationGridSize; - memcpy(out_ext->sampleLocationCoordinateRange, in_ext->sampleLocationCoordinateRange, 2 * sizeof(float)); - out_ext->sampleLocationSubPixelBits = in_ext->sampleLocationSubPixelBits; - out_ext->variableSampleLocations = in_ext->variableSampleLocations; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: - { - VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT); - const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *in_ext = (const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT; - out_ext->advancedBlendMaxColorAttachments = in_ext->advancedBlendMaxColorAttachments; - out_ext->advancedBlendIndependentBlend = in_ext->advancedBlendIndependentBlend; - out_ext->advancedBlendNonPremultipliedSrcColor = in_ext->advancedBlendNonPremultipliedSrcColor; - out_ext->advancedBlendNonPremultipliedDstColor = in_ext->advancedBlendNonPremultipliedDstColor; - out_ext->advancedBlendCorrelatedOverlap = in_ext->advancedBlendCorrelatedOverlap; - out_ext->advancedBlendAllOperations = in_ext->advancedBlendAllOperations; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES: - { - VkPhysicalDeviceInlineUniformBlockProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES); - const VkPhysicalDeviceInlineUniformBlockProperties *in_ext = (const VkPhysicalDeviceInlineUniformBlockProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES; - out_ext->maxInlineUniformBlockSize = in_ext->maxInlineUniformBlockSize; - out_ext->maxPerStageDescriptorInlineUniformBlocks = in_ext->maxPerStageDescriptorInlineUniformBlocks; - out_ext->maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks = in_ext->maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks; - out_ext->maxDescriptorSetInlineUniformBlocks = in_ext->maxDescriptorSetInlineUniformBlocks; - out_ext->maxDescriptorSetUpdateAfterBindInlineUniformBlocks = in_ext->maxDescriptorSetUpdateAfterBindInlineUniformBlocks; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: - { - VkPhysicalDeviceMaintenance3Properties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES); - const VkPhysicalDeviceMaintenance3Properties *in_ext = (const VkPhysicalDeviceMaintenance3Properties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES; - out_ext->maxPerSetDescriptors = in_ext->maxPerSetDescriptors; - out_ext->maxMemoryAllocationSize = in_ext->maxMemoryAllocationSize; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES: - { - VkPhysicalDeviceMaintenance4Properties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES); - const VkPhysicalDeviceMaintenance4Properties *in_ext = (const VkPhysicalDeviceMaintenance4Properties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES; - out_ext->maxBufferSize = in_ext->maxBufferSize; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES: - { - VkPhysicalDeviceMaintenance5Properties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES); - const VkPhysicalDeviceMaintenance5Properties *in_ext = (const VkPhysicalDeviceMaintenance5Properties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES; - out_ext->earlyFragmentMultisampleCoverageAfterSampleCounting = in_ext->earlyFragmentMultisampleCoverageAfterSampleCounting; - out_ext->earlyFragmentSampleMaskTestBeforeSampleCounting = in_ext->earlyFragmentSampleMaskTestBeforeSampleCounting; - out_ext->depthStencilSwizzleOneSupport = in_ext->depthStencilSwizzleOneSupport; - out_ext->polygonModePointSize = in_ext->polygonModePointSize; - out_ext->nonStrictSinglePixelWideLinesUseParallelogram = in_ext->nonStrictSinglePixelWideLinesUseParallelogram; - out_ext->nonStrictWideLinesUseParallelogram = in_ext->nonStrictWideLinesUseParallelogram; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES: - { - VkPhysicalDeviceMaintenance6Properties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES); - const VkPhysicalDeviceMaintenance6Properties *in_ext = (const VkPhysicalDeviceMaintenance6Properties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES; - out_ext->blockTexelViewCompatibleMultipleLayers = in_ext->blockTexelViewCompatibleMultipleLayers; - out_ext->maxCombinedImageSamplerDescriptorCount = in_ext->maxCombinedImageSamplerDescriptorCount; - out_ext->fragmentShadingRateClampCombinerInputs = in_ext->fragmentShadingRateClampCombinerInputs; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: - { - VkPhysicalDeviceFloatControlsProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES); - const VkPhysicalDeviceFloatControlsProperties *in_ext = (const VkPhysicalDeviceFloatControlsProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES; - out_ext->denormBehaviorIndependence = in_ext->denormBehaviorIndependence; - out_ext->roundingModeIndependence = in_ext->roundingModeIndependence; - out_ext->shaderSignedZeroInfNanPreserveFloat16 = in_ext->shaderSignedZeroInfNanPreserveFloat16; - out_ext->shaderSignedZeroInfNanPreserveFloat32 = in_ext->shaderSignedZeroInfNanPreserveFloat32; - out_ext->shaderSignedZeroInfNanPreserveFloat64 = in_ext->shaderSignedZeroInfNanPreserveFloat64; - out_ext->shaderDenormPreserveFloat16 = in_ext->shaderDenormPreserveFloat16; - out_ext->shaderDenormPreserveFloat32 = in_ext->shaderDenormPreserveFloat32; - out_ext->shaderDenormPreserveFloat64 = in_ext->shaderDenormPreserveFloat64; - out_ext->shaderDenormFlushToZeroFloat16 = in_ext->shaderDenormFlushToZeroFloat16; - out_ext->shaderDenormFlushToZeroFloat32 = in_ext->shaderDenormFlushToZeroFloat32; - out_ext->shaderDenormFlushToZeroFloat64 = in_ext->shaderDenormFlushToZeroFloat64; - out_ext->shaderRoundingModeRTEFloat16 = in_ext->shaderRoundingModeRTEFloat16; - out_ext->shaderRoundingModeRTEFloat32 = in_ext->shaderRoundingModeRTEFloat32; - out_ext->shaderRoundingModeRTEFloat64 = in_ext->shaderRoundingModeRTEFloat64; - out_ext->shaderRoundingModeRTZFloat16 = in_ext->shaderRoundingModeRTZFloat16; - out_ext->shaderRoundingModeRTZFloat32 = in_ext->shaderRoundingModeRTZFloat32; - out_ext->shaderRoundingModeRTZFloat64 = in_ext->shaderRoundingModeRTZFloat64; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: - { - VkPhysicalDeviceExternalMemoryHostPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT); - const VkPhysicalDeviceExternalMemoryHostPropertiesEXT *in_ext = (const VkPhysicalDeviceExternalMemoryHostPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT; - out_ext->minImportedHostPointerAlignment = in_ext->minImportedHostPointerAlignment; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT: - { - VkPhysicalDeviceConservativeRasterizationPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT); - const VkPhysicalDeviceConservativeRasterizationPropertiesEXT *in_ext = (const VkPhysicalDeviceConservativeRasterizationPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT; - out_ext->primitiveOverestimationSize = in_ext->primitiveOverestimationSize; - out_ext->maxExtraPrimitiveOverestimationSize = in_ext->maxExtraPrimitiveOverestimationSize; - out_ext->extraPrimitiveOverestimationSizeGranularity = in_ext->extraPrimitiveOverestimationSizeGranularity; - out_ext->primitiveUnderestimation = in_ext->primitiveUnderestimation; - out_ext->conservativePointAndLineRasterization = in_ext->conservativePointAndLineRasterization; - out_ext->degenerateTrianglesRasterized = in_ext->degenerateTrianglesRasterized; - out_ext->degenerateLinesRasterized = in_ext->degenerateLinesRasterized; - out_ext->fullyCoveredFragmentShaderInputVariable = in_ext->fullyCoveredFragmentShaderInputVariable; - out_ext->conservativeRasterizationPostDepthCoverage = in_ext->conservativeRasterizationPostDepthCoverage; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: - { - VkPhysicalDeviceShaderCorePropertiesAMD32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD); - const VkPhysicalDeviceShaderCorePropertiesAMD *in_ext = (const VkPhysicalDeviceShaderCorePropertiesAMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD; - out_ext->shaderEngineCount = in_ext->shaderEngineCount; - out_ext->shaderArraysPerEngineCount = in_ext->shaderArraysPerEngineCount; - out_ext->computeUnitsPerShaderArray = in_ext->computeUnitsPerShaderArray; - out_ext->simdPerComputeUnit = in_ext->simdPerComputeUnit; - out_ext->wavefrontsPerSimd = in_ext->wavefrontsPerSimd; - out_ext->wavefrontSize = in_ext->wavefrontSize; - out_ext->sgprsPerSimd = in_ext->sgprsPerSimd; - out_ext->minSgprAllocation = in_ext->minSgprAllocation; - out_ext->maxSgprAllocation = in_ext->maxSgprAllocation; - out_ext->sgprAllocationGranularity = in_ext->sgprAllocationGranularity; - out_ext->vgprsPerSimd = in_ext->vgprsPerSimd; - out_ext->minVgprAllocation = in_ext->minVgprAllocation; - out_ext->maxVgprAllocation = in_ext->maxVgprAllocation; - out_ext->vgprAllocationGranularity = in_ext->vgprAllocationGranularity; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD: - { - VkPhysicalDeviceShaderCoreProperties2AMD32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD); - const VkPhysicalDeviceShaderCoreProperties2AMD *in_ext = (const VkPhysicalDeviceShaderCoreProperties2AMD *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD; - out_ext->shaderCoreFeatures = in_ext->shaderCoreFeatures; - out_ext->activeComputeUnitCount = in_ext->activeComputeUnitCount; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: - { - VkPhysicalDeviceDescriptorIndexingProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES); - const VkPhysicalDeviceDescriptorIndexingProperties *in_ext = (const VkPhysicalDeviceDescriptorIndexingProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES; - out_ext->maxUpdateAfterBindDescriptorsInAllPools = in_ext->maxUpdateAfterBindDescriptorsInAllPools; - out_ext->shaderUniformBufferArrayNonUniformIndexingNative = in_ext->shaderUniformBufferArrayNonUniformIndexingNative; - out_ext->shaderSampledImageArrayNonUniformIndexingNative = in_ext->shaderSampledImageArrayNonUniformIndexingNative; - out_ext->shaderStorageBufferArrayNonUniformIndexingNative = in_ext->shaderStorageBufferArrayNonUniformIndexingNative; - out_ext->shaderStorageImageArrayNonUniformIndexingNative = in_ext->shaderStorageImageArrayNonUniformIndexingNative; - out_ext->shaderInputAttachmentArrayNonUniformIndexingNative = in_ext->shaderInputAttachmentArrayNonUniformIndexingNative; - out_ext->robustBufferAccessUpdateAfterBind = in_ext->robustBufferAccessUpdateAfterBind; - out_ext->quadDivergentImplicitLod = in_ext->quadDivergentImplicitLod; - out_ext->maxPerStageDescriptorUpdateAfterBindSamplers = in_ext->maxPerStageDescriptorUpdateAfterBindSamplers; - out_ext->maxPerStageDescriptorUpdateAfterBindUniformBuffers = in_ext->maxPerStageDescriptorUpdateAfterBindUniformBuffers; - out_ext->maxPerStageDescriptorUpdateAfterBindStorageBuffers = in_ext->maxPerStageDescriptorUpdateAfterBindStorageBuffers; - out_ext->maxPerStageDescriptorUpdateAfterBindSampledImages = in_ext->maxPerStageDescriptorUpdateAfterBindSampledImages; - out_ext->maxPerStageDescriptorUpdateAfterBindStorageImages = in_ext->maxPerStageDescriptorUpdateAfterBindStorageImages; - out_ext->maxPerStageDescriptorUpdateAfterBindInputAttachments = in_ext->maxPerStageDescriptorUpdateAfterBindInputAttachments; - out_ext->maxPerStageUpdateAfterBindResources = in_ext->maxPerStageUpdateAfterBindResources; - out_ext->maxDescriptorSetUpdateAfterBindSamplers = in_ext->maxDescriptorSetUpdateAfterBindSamplers; - out_ext->maxDescriptorSetUpdateAfterBindUniformBuffers = in_ext->maxDescriptorSetUpdateAfterBindUniformBuffers; - out_ext->maxDescriptorSetUpdateAfterBindUniformBuffersDynamic = in_ext->maxDescriptorSetUpdateAfterBindUniformBuffersDynamic; - out_ext->maxDescriptorSetUpdateAfterBindStorageBuffers = in_ext->maxDescriptorSetUpdateAfterBindStorageBuffers; - out_ext->maxDescriptorSetUpdateAfterBindStorageBuffersDynamic = in_ext->maxDescriptorSetUpdateAfterBindStorageBuffersDynamic; - out_ext->maxDescriptorSetUpdateAfterBindSampledImages = in_ext->maxDescriptorSetUpdateAfterBindSampledImages; - out_ext->maxDescriptorSetUpdateAfterBindStorageImages = in_ext->maxDescriptorSetUpdateAfterBindStorageImages; - out_ext->maxDescriptorSetUpdateAfterBindInputAttachments = in_ext->maxDescriptorSetUpdateAfterBindInputAttachments; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: - { - VkPhysicalDeviceTimelineSemaphoreProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES); - const VkPhysicalDeviceTimelineSemaphoreProperties *in_ext = (const VkPhysicalDeviceTimelineSemaphoreProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES; - out_ext->maxTimelineSemaphoreValueDifference = in_ext->maxTimelineSemaphoreValueDifference; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: - { - VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT); - const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT *in_ext = (const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT; - out_ext->maxVertexAttribDivisor = in_ext->maxVertexAttribDivisor; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES: - { - VkPhysicalDeviceVertexAttributeDivisorProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES); - const VkPhysicalDeviceVertexAttributeDivisorProperties *in_ext = (const VkPhysicalDeviceVertexAttributeDivisorProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES; - out_ext->maxVertexAttribDivisor = in_ext->maxVertexAttribDivisor; - out_ext->supportsNonZeroFirstInstance = in_ext->supportsNonZeroFirstInstance; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: - { - VkPhysicalDevicePCIBusInfoPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT); - const VkPhysicalDevicePCIBusInfoPropertiesEXT *in_ext = (const VkPhysicalDevicePCIBusInfoPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT; - out_ext->pciDomain = in_ext->pciDomain; - out_ext->pciBus = in_ext->pciBus; - out_ext->pciDevice = in_ext->pciDevice; - out_ext->pciFunction = in_ext->pciFunction; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: - { - VkPhysicalDeviceDepthStencilResolveProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES); - const VkPhysicalDeviceDepthStencilResolveProperties *in_ext = (const VkPhysicalDeviceDepthStencilResolveProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES; - out_ext->supportedDepthResolveModes = in_ext->supportedDepthResolveModes; - out_ext->supportedStencilResolveModes = in_ext->supportedStencilResolveModes; - out_ext->independentResolveNone = in_ext->independentResolveNone; - out_ext->independentResolve = in_ext->independentResolve; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: - { - VkPhysicalDeviceTransformFeedbackPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT); - const VkPhysicalDeviceTransformFeedbackPropertiesEXT *in_ext = (const VkPhysicalDeviceTransformFeedbackPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT; - out_ext->maxTransformFeedbackStreams = in_ext->maxTransformFeedbackStreams; - out_ext->maxTransformFeedbackBuffers = in_ext->maxTransformFeedbackBuffers; - out_ext->maxTransformFeedbackBufferSize = in_ext->maxTransformFeedbackBufferSize; - out_ext->maxTransformFeedbackStreamDataSize = in_ext->maxTransformFeedbackStreamDataSize; - out_ext->maxTransformFeedbackBufferDataSize = in_ext->maxTransformFeedbackBufferDataSize; - out_ext->maxTransformFeedbackBufferDataStride = in_ext->maxTransformFeedbackBufferDataStride; - out_ext->transformFeedbackQueries = in_ext->transformFeedbackQueries; - out_ext->transformFeedbackStreamsLinesTriangles = in_ext->transformFeedbackStreamsLinesTriangles; - out_ext->transformFeedbackRasterizationStreamSelect = in_ext->transformFeedbackRasterizationStreamSelect; - out_ext->transformFeedbackDraw = in_ext->transformFeedbackDraw; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_PROPERTIES_KHR: - { - VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_PROPERTIES_KHR); - const VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR *in_ext = (const VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_PROPERTIES_KHR; - out_ext->meshAndTaskShaderDerivatives = in_ext->meshAndTaskShaderDerivatives; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_NV: - { - VkPhysicalDeviceCopyMemoryIndirectPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_NV); - const VkPhysicalDeviceCopyMemoryIndirectPropertiesNV *in_ext = (const VkPhysicalDeviceCopyMemoryIndirectPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_NV; - out_ext->supportedQueues = in_ext->supportedQueues; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV: - { - VkPhysicalDeviceMemoryDecompressionPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV); - const VkPhysicalDeviceMemoryDecompressionPropertiesNV *in_ext = (const VkPhysicalDeviceMemoryDecompressionPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV; - out_ext->decompressionMethods = in_ext->decompressionMethods; - out_ext->maxDecompressionIndirectCount = in_ext->maxDecompressionIndirectCount; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: - { - VkPhysicalDeviceShadingRateImagePropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV); - const VkPhysicalDeviceShadingRateImagePropertiesNV *in_ext = (const VkPhysicalDeviceShadingRateImagePropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV; - out_ext->shadingRateTexelSize = in_ext->shadingRateTexelSize; - out_ext->shadingRatePaletteSize = in_ext->shadingRatePaletteSize; - out_ext->shadingRateMaxCoarseSamples = in_ext->shadingRateMaxCoarseSamples; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: - { - VkPhysicalDeviceMeshShaderPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV); - const VkPhysicalDeviceMeshShaderPropertiesNV *in_ext = (const VkPhysicalDeviceMeshShaderPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV; - out_ext->maxDrawMeshTasksCount = in_ext->maxDrawMeshTasksCount; - out_ext->maxTaskWorkGroupInvocations = in_ext->maxTaskWorkGroupInvocations; - memcpy(out_ext->maxTaskWorkGroupSize, in_ext->maxTaskWorkGroupSize, 3 * sizeof(uint32_t)); - out_ext->maxTaskTotalMemorySize = in_ext->maxTaskTotalMemorySize; - out_ext->maxTaskOutputCount = in_ext->maxTaskOutputCount; - out_ext->maxMeshWorkGroupInvocations = in_ext->maxMeshWorkGroupInvocations; - memcpy(out_ext->maxMeshWorkGroupSize, in_ext->maxMeshWorkGroupSize, 3 * sizeof(uint32_t)); - out_ext->maxMeshTotalMemorySize = in_ext->maxMeshTotalMemorySize; - out_ext->maxMeshOutputVertices = in_ext->maxMeshOutputVertices; - out_ext->maxMeshOutputPrimitives = in_ext->maxMeshOutputPrimitives; - out_ext->maxMeshMultiviewViewCount = in_ext->maxMeshMultiviewViewCount; - out_ext->meshOutputPerVertexGranularity = in_ext->meshOutputPerVertexGranularity; - out_ext->meshOutputPerPrimitiveGranularity = in_ext->meshOutputPerPrimitiveGranularity; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT: - { - VkPhysicalDeviceMeshShaderPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT); - const VkPhysicalDeviceMeshShaderPropertiesEXT *in_ext = (const VkPhysicalDeviceMeshShaderPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT; - out_ext->maxTaskWorkGroupTotalCount = in_ext->maxTaskWorkGroupTotalCount; - memcpy(out_ext->maxTaskWorkGroupCount, in_ext->maxTaskWorkGroupCount, 3 * sizeof(uint32_t)); - out_ext->maxTaskWorkGroupInvocations = in_ext->maxTaskWorkGroupInvocations; - memcpy(out_ext->maxTaskWorkGroupSize, in_ext->maxTaskWorkGroupSize, 3 * sizeof(uint32_t)); - out_ext->maxTaskPayloadSize = in_ext->maxTaskPayloadSize; - out_ext->maxTaskSharedMemorySize = in_ext->maxTaskSharedMemorySize; - out_ext->maxTaskPayloadAndSharedMemorySize = in_ext->maxTaskPayloadAndSharedMemorySize; - out_ext->maxMeshWorkGroupTotalCount = in_ext->maxMeshWorkGroupTotalCount; - memcpy(out_ext->maxMeshWorkGroupCount, in_ext->maxMeshWorkGroupCount, 3 * sizeof(uint32_t)); - out_ext->maxMeshWorkGroupInvocations = in_ext->maxMeshWorkGroupInvocations; - memcpy(out_ext->maxMeshWorkGroupSize, in_ext->maxMeshWorkGroupSize, 3 * sizeof(uint32_t)); - out_ext->maxMeshSharedMemorySize = in_ext->maxMeshSharedMemorySize; - out_ext->maxMeshPayloadAndSharedMemorySize = in_ext->maxMeshPayloadAndSharedMemorySize; - out_ext->maxMeshOutputMemorySize = in_ext->maxMeshOutputMemorySize; - out_ext->maxMeshPayloadAndOutputMemorySize = in_ext->maxMeshPayloadAndOutputMemorySize; - out_ext->maxMeshOutputComponents = in_ext->maxMeshOutputComponents; - out_ext->maxMeshOutputVertices = in_ext->maxMeshOutputVertices; - out_ext->maxMeshOutputPrimitives = in_ext->maxMeshOutputPrimitives; - out_ext->maxMeshOutputLayers = in_ext->maxMeshOutputLayers; - out_ext->maxMeshMultiviewViewCount = in_ext->maxMeshMultiviewViewCount; - out_ext->meshOutputPerVertexGranularity = in_ext->meshOutputPerVertexGranularity; - out_ext->meshOutputPerPrimitiveGranularity = in_ext->meshOutputPerPrimitiveGranularity; - out_ext->maxPreferredTaskWorkGroupInvocations = in_ext->maxPreferredTaskWorkGroupInvocations; - out_ext->maxPreferredMeshWorkGroupInvocations = in_ext->maxPreferredMeshWorkGroupInvocations; - out_ext->prefersLocalInvocationVertexOutput = in_ext->prefersLocalInvocationVertexOutput; - out_ext->prefersLocalInvocationPrimitiveOutput = in_ext->prefersLocalInvocationPrimitiveOutput; - out_ext->prefersCompactVertexOutput = in_ext->prefersCompactVertexOutput; - out_ext->prefersCompactPrimitiveOutput = in_ext->prefersCompactPrimitiveOutput; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR: - { - VkPhysicalDeviceAccelerationStructurePropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR); - const VkPhysicalDeviceAccelerationStructurePropertiesKHR *in_ext = (const VkPhysicalDeviceAccelerationStructurePropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR; - out_ext->maxGeometryCount = in_ext->maxGeometryCount; - out_ext->maxInstanceCount = in_ext->maxInstanceCount; - out_ext->maxPrimitiveCount = in_ext->maxPrimitiveCount; - out_ext->maxPerStageDescriptorAccelerationStructures = in_ext->maxPerStageDescriptorAccelerationStructures; - out_ext->maxPerStageDescriptorUpdateAfterBindAccelerationStructures = in_ext->maxPerStageDescriptorUpdateAfterBindAccelerationStructures; - out_ext->maxDescriptorSetAccelerationStructures = in_ext->maxDescriptorSetAccelerationStructures; - out_ext->maxDescriptorSetUpdateAfterBindAccelerationStructures = in_ext->maxDescriptorSetUpdateAfterBindAccelerationStructures; - out_ext->minAccelerationStructureScratchOffsetAlignment = in_ext->minAccelerationStructureScratchOffsetAlignment; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR: - { - VkPhysicalDeviceRayTracingPipelinePropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR); - const VkPhysicalDeviceRayTracingPipelinePropertiesKHR *in_ext = (const VkPhysicalDeviceRayTracingPipelinePropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR; - out_ext->shaderGroupHandleSize = in_ext->shaderGroupHandleSize; - out_ext->maxRayRecursionDepth = in_ext->maxRayRecursionDepth; - out_ext->maxShaderGroupStride = in_ext->maxShaderGroupStride; - out_ext->shaderGroupBaseAlignment = in_ext->shaderGroupBaseAlignment; - out_ext->shaderGroupHandleCaptureReplaySize = in_ext->shaderGroupHandleCaptureReplaySize; - out_ext->maxRayDispatchInvocationCount = in_ext->maxRayDispatchInvocationCount; - out_ext->shaderGroupHandleAlignment = in_ext->shaderGroupHandleAlignment; - out_ext->maxRayHitAttributeSize = in_ext->maxRayHitAttributeSize; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: - { - VkPhysicalDeviceRayTracingPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV); - const VkPhysicalDeviceRayTracingPropertiesNV *in_ext = (const VkPhysicalDeviceRayTracingPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV; - out_ext->shaderGroupHandleSize = in_ext->shaderGroupHandleSize; - out_ext->maxRecursionDepth = in_ext->maxRecursionDepth; - out_ext->maxShaderGroupStride = in_ext->maxShaderGroupStride; - out_ext->shaderGroupBaseAlignment = in_ext->shaderGroupBaseAlignment; - out_ext->maxGeometryCount = in_ext->maxGeometryCount; - out_ext->maxInstanceCount = in_ext->maxInstanceCount; - out_ext->maxTriangleCount = in_ext->maxTriangleCount; - out_ext->maxDescriptorSetAccelerationStructures = in_ext->maxDescriptorSetAccelerationStructures; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: - { - VkPhysicalDeviceFragmentDensityMapPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT); - const VkPhysicalDeviceFragmentDensityMapPropertiesEXT *in_ext = (const VkPhysicalDeviceFragmentDensityMapPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT; - out_ext->minFragmentDensityTexelSize = in_ext->minFragmentDensityTexelSize; - out_ext->maxFragmentDensityTexelSize = in_ext->maxFragmentDensityTexelSize; - out_ext->fragmentDensityInvocations = in_ext->fragmentDensityInvocations; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT: - { - VkPhysicalDeviceFragmentDensityMap2PropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT); - const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT *in_ext = (const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT; - out_ext->subsampledLoads = in_ext->subsampledLoads; - out_ext->subsampledCoarseReconstructionEarlyAccess = in_ext->subsampledCoarseReconstructionEarlyAccess; - out_ext->maxSubsampledArrayLayers = in_ext->maxSubsampledArrayLayers; - out_ext->maxDescriptorSetSubsampledSamplers = in_ext->maxDescriptorSetSubsampledSamplers; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM: - { - VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM); - const VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM *in_ext = (const VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM; - out_ext->fragmentDensityOffsetGranularity = in_ext->fragmentDensityOffsetGranularity; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: - { - VkPhysicalDeviceCooperativeMatrixPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV); - const VkPhysicalDeviceCooperativeMatrixPropertiesNV *in_ext = (const VkPhysicalDeviceCooperativeMatrixPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV; - out_ext->cooperativeMatrixSupportedStages = in_ext->cooperativeMatrixSupportedStages; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR: - { - VkPhysicalDevicePerformanceQueryPropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR); - const VkPhysicalDevicePerformanceQueryPropertiesKHR *in_ext = (const VkPhysicalDevicePerformanceQueryPropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR; - out_ext->allowCommandBufferQueryCopies = in_ext->allowCommandBufferQueryCopies; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: - { - VkPhysicalDeviceShaderSMBuiltinsPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV); - const VkPhysicalDeviceShaderSMBuiltinsPropertiesNV *in_ext = (const VkPhysicalDeviceShaderSMBuiltinsPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV; - out_ext->shaderSMCount = in_ext->shaderSMCount; - out_ext->shaderWarpsPerSM = in_ext->shaderWarpsPerSM; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES: - { - VkPhysicalDeviceTexelBufferAlignmentProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES); - const VkPhysicalDeviceTexelBufferAlignmentProperties *in_ext = (const VkPhysicalDeviceTexelBufferAlignmentProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES; - out_ext->storageTexelBufferOffsetAlignmentBytes = in_ext->storageTexelBufferOffsetAlignmentBytes; - out_ext->storageTexelBufferOffsetSingleTexelAlignment = in_ext->storageTexelBufferOffsetSingleTexelAlignment; - out_ext->uniformTexelBufferOffsetAlignmentBytes = in_ext->uniformTexelBufferOffsetAlignmentBytes; - out_ext->uniformTexelBufferOffsetSingleTexelAlignment = in_ext->uniformTexelBufferOffsetSingleTexelAlignment; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES: - { - VkPhysicalDeviceSubgroupSizeControlProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES); - const VkPhysicalDeviceSubgroupSizeControlProperties *in_ext = (const VkPhysicalDeviceSubgroupSizeControlProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES; - out_ext->minSubgroupSize = in_ext->minSubgroupSize; - out_ext->maxSubgroupSize = in_ext->maxSubgroupSize; - out_ext->maxComputeWorkgroupSubgroups = in_ext->maxComputeWorkgroupSubgroups; - out_ext->requiredSubgroupSizeStages = in_ext->requiredSubgroupSizeStages; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI: - { - VkPhysicalDeviceSubpassShadingPropertiesHUAWEI32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI); - const VkPhysicalDeviceSubpassShadingPropertiesHUAWEI *in_ext = (const VkPhysicalDeviceSubpassShadingPropertiesHUAWEI *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI; - out_ext->maxSubpassShadingWorkgroupSizeAspectRatio = in_ext->maxSubpassShadingWorkgroupSizeAspectRatio; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI: - { - VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI); - const VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI *in_ext = (const VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI; - memcpy(out_ext->maxWorkGroupCount, in_ext->maxWorkGroupCount, 3 * sizeof(uint32_t)); - memcpy(out_ext->maxWorkGroupSize, in_ext->maxWorkGroupSize, 3 * sizeof(uint32_t)); - out_ext->maxOutputClusterCount = in_ext->maxOutputClusterCount; - out_ext->indirectBufferOffsetAlignment = in_ext->indirectBufferOffsetAlignment; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES: - { - VkPhysicalDeviceLineRasterizationProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES); - const VkPhysicalDeviceLineRasterizationProperties *in_ext = (const VkPhysicalDeviceLineRasterizationProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES; - out_ext->lineSubPixelPrecisionBits = in_ext->lineSubPixelPrecisionBits; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: - { - VkPhysicalDeviceVulkan11Properties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES); - const VkPhysicalDeviceVulkan11Properties *in_ext = (const VkPhysicalDeviceVulkan11Properties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES; - memcpy(out_ext->deviceUUID, in_ext->deviceUUID, VK_UUID_SIZE * sizeof(uint8_t)); - memcpy(out_ext->driverUUID, in_ext->driverUUID, VK_UUID_SIZE * sizeof(uint8_t)); - memcpy(out_ext->deviceLUID, in_ext->deviceLUID, VK_LUID_SIZE * sizeof(uint8_t)); - out_ext->deviceNodeMask = in_ext->deviceNodeMask; - out_ext->deviceLUIDValid = in_ext->deviceLUIDValid; - out_ext->subgroupSize = in_ext->subgroupSize; - out_ext->subgroupSupportedStages = in_ext->subgroupSupportedStages; - out_ext->subgroupSupportedOperations = in_ext->subgroupSupportedOperations; - out_ext->subgroupQuadOperationsInAllStages = in_ext->subgroupQuadOperationsInAllStages; - out_ext->pointClippingBehavior = in_ext->pointClippingBehavior; - out_ext->maxMultiviewViewCount = in_ext->maxMultiviewViewCount; - out_ext->maxMultiviewInstanceIndex = in_ext->maxMultiviewInstanceIndex; - out_ext->protectedNoFault = in_ext->protectedNoFault; - out_ext->maxPerSetDescriptors = in_ext->maxPerSetDescriptors; - out_ext->maxMemoryAllocationSize = in_ext->maxMemoryAllocationSize; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: - { - VkPhysicalDeviceVulkan12Properties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES); - const VkPhysicalDeviceVulkan12Properties *in_ext = (const VkPhysicalDeviceVulkan12Properties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES; - out_ext->driverID = in_ext->driverID; - memcpy(out_ext->driverName, in_ext->driverName, VK_MAX_DRIVER_NAME_SIZE * sizeof(char)); - memcpy(out_ext->driverInfo, in_ext->driverInfo, VK_MAX_DRIVER_INFO_SIZE * sizeof(char)); - out_ext->conformanceVersion = in_ext->conformanceVersion; - out_ext->denormBehaviorIndependence = in_ext->denormBehaviorIndependence; - out_ext->roundingModeIndependence = in_ext->roundingModeIndependence; - out_ext->shaderSignedZeroInfNanPreserveFloat16 = in_ext->shaderSignedZeroInfNanPreserveFloat16; - out_ext->shaderSignedZeroInfNanPreserveFloat32 = in_ext->shaderSignedZeroInfNanPreserveFloat32; - out_ext->shaderSignedZeroInfNanPreserveFloat64 = in_ext->shaderSignedZeroInfNanPreserveFloat64; - out_ext->shaderDenormPreserveFloat16 = in_ext->shaderDenormPreserveFloat16; - out_ext->shaderDenormPreserveFloat32 = in_ext->shaderDenormPreserveFloat32; - out_ext->shaderDenormPreserveFloat64 = in_ext->shaderDenormPreserveFloat64; - out_ext->shaderDenormFlushToZeroFloat16 = in_ext->shaderDenormFlushToZeroFloat16; - out_ext->shaderDenormFlushToZeroFloat32 = in_ext->shaderDenormFlushToZeroFloat32; - out_ext->shaderDenormFlushToZeroFloat64 = in_ext->shaderDenormFlushToZeroFloat64; - out_ext->shaderRoundingModeRTEFloat16 = in_ext->shaderRoundingModeRTEFloat16; - out_ext->shaderRoundingModeRTEFloat32 = in_ext->shaderRoundingModeRTEFloat32; - out_ext->shaderRoundingModeRTEFloat64 = in_ext->shaderRoundingModeRTEFloat64; - out_ext->shaderRoundingModeRTZFloat16 = in_ext->shaderRoundingModeRTZFloat16; - out_ext->shaderRoundingModeRTZFloat32 = in_ext->shaderRoundingModeRTZFloat32; - out_ext->shaderRoundingModeRTZFloat64 = in_ext->shaderRoundingModeRTZFloat64; - out_ext->maxUpdateAfterBindDescriptorsInAllPools = in_ext->maxUpdateAfterBindDescriptorsInAllPools; - out_ext->shaderUniformBufferArrayNonUniformIndexingNative = in_ext->shaderUniformBufferArrayNonUniformIndexingNative; - out_ext->shaderSampledImageArrayNonUniformIndexingNative = in_ext->shaderSampledImageArrayNonUniformIndexingNative; - out_ext->shaderStorageBufferArrayNonUniformIndexingNative = in_ext->shaderStorageBufferArrayNonUniformIndexingNative; - out_ext->shaderStorageImageArrayNonUniformIndexingNative = in_ext->shaderStorageImageArrayNonUniformIndexingNative; - out_ext->shaderInputAttachmentArrayNonUniformIndexingNative = in_ext->shaderInputAttachmentArrayNonUniformIndexingNative; - out_ext->robustBufferAccessUpdateAfterBind = in_ext->robustBufferAccessUpdateAfterBind; - out_ext->quadDivergentImplicitLod = in_ext->quadDivergentImplicitLod; - out_ext->maxPerStageDescriptorUpdateAfterBindSamplers = in_ext->maxPerStageDescriptorUpdateAfterBindSamplers; - out_ext->maxPerStageDescriptorUpdateAfterBindUniformBuffers = in_ext->maxPerStageDescriptorUpdateAfterBindUniformBuffers; - out_ext->maxPerStageDescriptorUpdateAfterBindStorageBuffers = in_ext->maxPerStageDescriptorUpdateAfterBindStorageBuffers; - out_ext->maxPerStageDescriptorUpdateAfterBindSampledImages = in_ext->maxPerStageDescriptorUpdateAfterBindSampledImages; - out_ext->maxPerStageDescriptorUpdateAfterBindStorageImages = in_ext->maxPerStageDescriptorUpdateAfterBindStorageImages; - out_ext->maxPerStageDescriptorUpdateAfterBindInputAttachments = in_ext->maxPerStageDescriptorUpdateAfterBindInputAttachments; - out_ext->maxPerStageUpdateAfterBindResources = in_ext->maxPerStageUpdateAfterBindResources; - out_ext->maxDescriptorSetUpdateAfterBindSamplers = in_ext->maxDescriptorSetUpdateAfterBindSamplers; - out_ext->maxDescriptorSetUpdateAfterBindUniformBuffers = in_ext->maxDescriptorSetUpdateAfterBindUniformBuffers; - out_ext->maxDescriptorSetUpdateAfterBindUniformBuffersDynamic = in_ext->maxDescriptorSetUpdateAfterBindUniformBuffersDynamic; - out_ext->maxDescriptorSetUpdateAfterBindStorageBuffers = in_ext->maxDescriptorSetUpdateAfterBindStorageBuffers; - out_ext->maxDescriptorSetUpdateAfterBindStorageBuffersDynamic = in_ext->maxDescriptorSetUpdateAfterBindStorageBuffersDynamic; - out_ext->maxDescriptorSetUpdateAfterBindSampledImages = in_ext->maxDescriptorSetUpdateAfterBindSampledImages; - out_ext->maxDescriptorSetUpdateAfterBindStorageImages = in_ext->maxDescriptorSetUpdateAfterBindStorageImages; - out_ext->maxDescriptorSetUpdateAfterBindInputAttachments = in_ext->maxDescriptorSetUpdateAfterBindInputAttachments; - out_ext->supportedDepthResolveModes = in_ext->supportedDepthResolveModes; - out_ext->supportedStencilResolveModes = in_ext->supportedStencilResolveModes; - out_ext->independentResolveNone = in_ext->independentResolveNone; - out_ext->independentResolve = in_ext->independentResolve; - out_ext->filterMinmaxSingleComponentFormats = in_ext->filterMinmaxSingleComponentFormats; - out_ext->filterMinmaxImageComponentMapping = in_ext->filterMinmaxImageComponentMapping; - out_ext->maxTimelineSemaphoreValueDifference = in_ext->maxTimelineSemaphoreValueDifference; - out_ext->framebufferIntegerColorSampleCounts = in_ext->framebufferIntegerColorSampleCounts; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES: - { - VkPhysicalDeviceVulkan13Properties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES); - const VkPhysicalDeviceVulkan13Properties *in_ext = (const VkPhysicalDeviceVulkan13Properties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES; - out_ext->minSubgroupSize = in_ext->minSubgroupSize; - out_ext->maxSubgroupSize = in_ext->maxSubgroupSize; - out_ext->maxComputeWorkgroupSubgroups = in_ext->maxComputeWorkgroupSubgroups; - out_ext->requiredSubgroupSizeStages = in_ext->requiredSubgroupSizeStages; - out_ext->maxInlineUniformBlockSize = in_ext->maxInlineUniformBlockSize; - out_ext->maxPerStageDescriptorInlineUniformBlocks = in_ext->maxPerStageDescriptorInlineUniformBlocks; - out_ext->maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks = in_ext->maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks; - out_ext->maxDescriptorSetInlineUniformBlocks = in_ext->maxDescriptorSetInlineUniformBlocks; - out_ext->maxDescriptorSetUpdateAfterBindInlineUniformBlocks = in_ext->maxDescriptorSetUpdateAfterBindInlineUniformBlocks; - out_ext->maxInlineUniformTotalSize = in_ext->maxInlineUniformTotalSize; - out_ext->integerDotProduct8BitUnsignedAccelerated = in_ext->integerDotProduct8BitUnsignedAccelerated; - out_ext->integerDotProduct8BitSignedAccelerated = in_ext->integerDotProduct8BitSignedAccelerated; - out_ext->integerDotProduct8BitMixedSignednessAccelerated = in_ext->integerDotProduct8BitMixedSignednessAccelerated; - out_ext->integerDotProduct4x8BitPackedUnsignedAccelerated = in_ext->integerDotProduct4x8BitPackedUnsignedAccelerated; - out_ext->integerDotProduct4x8BitPackedSignedAccelerated = in_ext->integerDotProduct4x8BitPackedSignedAccelerated; - out_ext->integerDotProduct4x8BitPackedMixedSignednessAccelerated = in_ext->integerDotProduct4x8BitPackedMixedSignednessAccelerated; - out_ext->integerDotProduct16BitUnsignedAccelerated = in_ext->integerDotProduct16BitUnsignedAccelerated; - out_ext->integerDotProduct16BitSignedAccelerated = in_ext->integerDotProduct16BitSignedAccelerated; - out_ext->integerDotProduct16BitMixedSignednessAccelerated = in_ext->integerDotProduct16BitMixedSignednessAccelerated; - out_ext->integerDotProduct32BitUnsignedAccelerated = in_ext->integerDotProduct32BitUnsignedAccelerated; - out_ext->integerDotProduct32BitSignedAccelerated = in_ext->integerDotProduct32BitSignedAccelerated; - out_ext->integerDotProduct32BitMixedSignednessAccelerated = in_ext->integerDotProduct32BitMixedSignednessAccelerated; - out_ext->integerDotProduct64BitUnsignedAccelerated = in_ext->integerDotProduct64BitUnsignedAccelerated; - out_ext->integerDotProduct64BitSignedAccelerated = in_ext->integerDotProduct64BitSignedAccelerated; - out_ext->integerDotProduct64BitMixedSignednessAccelerated = in_ext->integerDotProduct64BitMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating8BitUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating8BitUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating8BitSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating8BitSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating16BitUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating16BitUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating16BitSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating16BitSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating32BitUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating32BitUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating32BitSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating32BitSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating64BitUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating64BitUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating64BitSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating64BitSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated; - out_ext->storageTexelBufferOffsetAlignmentBytes = in_ext->storageTexelBufferOffsetAlignmentBytes; - out_ext->storageTexelBufferOffsetSingleTexelAlignment = in_ext->storageTexelBufferOffsetSingleTexelAlignment; - out_ext->uniformTexelBufferOffsetAlignmentBytes = in_ext->uniformTexelBufferOffsetAlignmentBytes; - out_ext->uniformTexelBufferOffsetSingleTexelAlignment = in_ext->uniformTexelBufferOffsetSingleTexelAlignment; - out_ext->maxBufferSize = in_ext->maxBufferSize; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_PROPERTIES: - { - VkPhysicalDeviceVulkan14Properties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_PROPERTIES); - const VkPhysicalDeviceVulkan14Properties *in_ext = (const VkPhysicalDeviceVulkan14Properties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_PROPERTIES; - out_ext->lineSubPixelPrecisionBits = in_ext->lineSubPixelPrecisionBits; - out_ext->maxVertexAttribDivisor = in_ext->maxVertexAttribDivisor; - out_ext->supportsNonZeroFirstInstance = in_ext->supportsNonZeroFirstInstance; - out_ext->maxPushDescriptors = in_ext->maxPushDescriptors; - out_ext->dynamicRenderingLocalReadDepthStencilAttachments = in_ext->dynamicRenderingLocalReadDepthStencilAttachments; - out_ext->dynamicRenderingLocalReadMultisampledAttachments = in_ext->dynamicRenderingLocalReadMultisampledAttachments; - out_ext->earlyFragmentMultisampleCoverageAfterSampleCounting = in_ext->earlyFragmentMultisampleCoverageAfterSampleCounting; - out_ext->earlyFragmentSampleMaskTestBeforeSampleCounting = in_ext->earlyFragmentSampleMaskTestBeforeSampleCounting; - out_ext->depthStencilSwizzleOneSupport = in_ext->depthStencilSwizzleOneSupport; - out_ext->polygonModePointSize = in_ext->polygonModePointSize; - out_ext->nonStrictSinglePixelWideLinesUseParallelogram = in_ext->nonStrictSinglePixelWideLinesUseParallelogram; - out_ext->nonStrictWideLinesUseParallelogram = in_ext->nonStrictWideLinesUseParallelogram; - out_ext->blockTexelViewCompatibleMultipleLayers = in_ext->blockTexelViewCompatibleMultipleLayers; - out_ext->maxCombinedImageSamplerDescriptorCount = in_ext->maxCombinedImageSamplerDescriptorCount; - out_ext->fragmentShadingRateClampCombinerInputs = in_ext->fragmentShadingRateClampCombinerInputs; - out_ext->defaultRobustnessStorageBuffers = in_ext->defaultRobustnessStorageBuffers; - out_ext->defaultRobustnessUniformBuffers = in_ext->defaultRobustnessUniformBuffers; - out_ext->defaultRobustnessVertexInputs = in_ext->defaultRobustnessVertexInputs; - out_ext->defaultRobustnessImages = in_ext->defaultRobustnessImages; - out_ext->copySrcLayoutCount = in_ext->copySrcLayoutCount; - out_ext->pCopySrcLayouts = PtrToUlong(in_ext->pCopySrcLayouts); - out_ext->copyDstLayoutCount = in_ext->copyDstLayoutCount; - out_ext->pCopyDstLayouts = PtrToUlong(in_ext->pCopyDstLayouts); - memcpy(out_ext->optimalTilingLayoutUUID, in_ext->optimalTilingLayoutUUID, VK_UUID_SIZE * sizeof(uint8_t)); - out_ext->identicalMemoryTypeRequirements = in_ext->identicalMemoryTypeRequirements; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: - { - VkPhysicalDeviceCustomBorderColorPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT); - const VkPhysicalDeviceCustomBorderColorPropertiesEXT *in_ext = (const VkPhysicalDeviceCustomBorderColorPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT; - out_ext->maxCustomBorderColorSamplers = in_ext->maxCustomBorderColorSamplers; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT: - { - VkPhysicalDeviceExtendedDynamicState3PropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT); - const VkPhysicalDeviceExtendedDynamicState3PropertiesEXT *in_ext = (const VkPhysicalDeviceExtendedDynamicState3PropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT; - out_ext->dynamicPrimitiveTopologyUnrestricted = in_ext->dynamicPrimitiveTopologyUnrestricted; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: - { - VkPhysicalDeviceRobustness2PropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT); - const VkPhysicalDeviceRobustness2PropertiesEXT *in_ext = (const VkPhysicalDeviceRobustness2PropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT; - out_ext->robustStorageBufferAccessSizeAlignment = in_ext->robustStorageBufferAccessSizeAlignment; - out_ext->robustUniformBufferAccessSizeAlignment = in_ext->robustUniformBufferAccessSizeAlignment; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR: - { - VkPhysicalDeviceFragmentShadingRatePropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR); - const VkPhysicalDeviceFragmentShadingRatePropertiesKHR *in_ext = (const VkPhysicalDeviceFragmentShadingRatePropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR; - out_ext->minFragmentShadingRateAttachmentTexelSize = in_ext->minFragmentShadingRateAttachmentTexelSize; - out_ext->maxFragmentShadingRateAttachmentTexelSize = in_ext->maxFragmentShadingRateAttachmentTexelSize; - out_ext->maxFragmentShadingRateAttachmentTexelSizeAspectRatio = in_ext->maxFragmentShadingRateAttachmentTexelSizeAspectRatio; - out_ext->primitiveFragmentShadingRateWithMultipleViewports = in_ext->primitiveFragmentShadingRateWithMultipleViewports; - out_ext->layeredShadingRateAttachments = in_ext->layeredShadingRateAttachments; - out_ext->fragmentShadingRateNonTrivialCombinerOps = in_ext->fragmentShadingRateNonTrivialCombinerOps; - out_ext->maxFragmentSize = in_ext->maxFragmentSize; - out_ext->maxFragmentSizeAspectRatio = in_ext->maxFragmentSizeAspectRatio; - out_ext->maxFragmentShadingRateCoverageSamples = in_ext->maxFragmentShadingRateCoverageSamples; - out_ext->maxFragmentShadingRateRasterizationSamples = in_ext->maxFragmentShadingRateRasterizationSamples; - out_ext->fragmentShadingRateWithShaderDepthStencilWrites = in_ext->fragmentShadingRateWithShaderDepthStencilWrites; - out_ext->fragmentShadingRateWithSampleMask = in_ext->fragmentShadingRateWithSampleMask; - out_ext->fragmentShadingRateWithShaderSampleMask = in_ext->fragmentShadingRateWithShaderSampleMask; - out_ext->fragmentShadingRateWithConservativeRasterization = in_ext->fragmentShadingRateWithConservativeRasterization; - out_ext->fragmentShadingRateWithFragmentShaderInterlock = in_ext->fragmentShadingRateWithFragmentShaderInterlock; - out_ext->fragmentShadingRateWithCustomSampleLocations = in_ext->fragmentShadingRateWithCustomSampleLocations; - out_ext->fragmentShadingRateStrictMultiplyCombiner = in_ext->fragmentShadingRateStrictMultiplyCombiner; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV: - { - VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV); - const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV *in_ext = (const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV; - out_ext->maxFragmentShadingRateInvocationCount = in_ext->maxFragmentShadingRateInvocationCount; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_PROPERTIES_EXT: - { - VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_PROPERTIES_EXT); - const VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT *in_ext = (const VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_PROPERTIES_EXT; - out_ext->nativeUnalignedPerformance = in_ext->nativeUnalignedPerformance; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_EXT: - { - VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_EXT); - const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT *in_ext = (const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_EXT; - out_ext->maxIndirectPipelineCount = in_ext->maxIndirectPipelineCount; - out_ext->maxIndirectShaderObjectCount = in_ext->maxIndirectShaderObjectCount; - out_ext->maxIndirectSequenceCount = in_ext->maxIndirectSequenceCount; - out_ext->maxIndirectCommandsTokenCount = in_ext->maxIndirectCommandsTokenCount; - out_ext->maxIndirectCommandsTokenOffset = in_ext->maxIndirectCommandsTokenOffset; - out_ext->maxIndirectCommandsIndirectStride = in_ext->maxIndirectCommandsIndirectStride; - out_ext->supportedIndirectCommandsInputModes = in_ext->supportedIndirectCommandsInputModes; - out_ext->supportedIndirectCommandsShaderStages = in_ext->supportedIndirectCommandsShaderStages; - out_ext->supportedIndirectCommandsShaderStagesPipelineBinding = in_ext->supportedIndirectCommandsShaderStagesPipelineBinding; - out_ext->supportedIndirectCommandsShaderStagesShaderBinding = in_ext->supportedIndirectCommandsShaderStagesShaderBinding; - out_ext->deviceGeneratedCommandsTransformFeedback = in_ext->deviceGeneratedCommandsTransformFeedback; - out_ext->deviceGeneratedCommandsMultiDrawIndirectCount = in_ext->deviceGeneratedCommandsMultiDrawIndirectCount; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES: - { - VkPhysicalDeviceHostImageCopyProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES); - const VkPhysicalDeviceHostImageCopyProperties *in_ext = (const VkPhysicalDeviceHostImageCopyProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES; - out_ext->copySrcLayoutCount = in_ext->copySrcLayoutCount; - out_ext->pCopySrcLayouts = PtrToUlong(in_ext->pCopySrcLayouts); - out_ext->copyDstLayoutCount = in_ext->copyDstLayoutCount; - out_ext->pCopyDstLayouts = PtrToUlong(in_ext->pCopyDstLayouts); - memcpy(out_ext->optimalTilingLayoutUUID, in_ext->optimalTilingLayoutUUID, VK_UUID_SIZE * sizeof(uint8_t)); - out_ext->identicalMemoryTypeRequirements = in_ext->identicalMemoryTypeRequirements; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: - { - VkPhysicalDeviceProvokingVertexPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT); - const VkPhysicalDeviceProvokingVertexPropertiesEXT *in_ext = (const VkPhysicalDeviceProvokingVertexPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT; - out_ext->provokingVertexModePerPipeline = in_ext->provokingVertexModePerPipeline; - out_ext->transformFeedbackPreservesTriangleFanProvokingVertex = in_ext->transformFeedbackPreservesTriangleFanProvokingVertex; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT: - { - VkPhysicalDeviceDescriptorBufferPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT); - const VkPhysicalDeviceDescriptorBufferPropertiesEXT *in_ext = (const VkPhysicalDeviceDescriptorBufferPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT; - out_ext->combinedImageSamplerDescriptorSingleArray = in_ext->combinedImageSamplerDescriptorSingleArray; - out_ext->bufferlessPushDescriptors = in_ext->bufferlessPushDescriptors; - out_ext->allowSamplerImageViewPostSubmitCreation = in_ext->allowSamplerImageViewPostSubmitCreation; - out_ext->descriptorBufferOffsetAlignment = in_ext->descriptorBufferOffsetAlignment; - out_ext->maxDescriptorBufferBindings = in_ext->maxDescriptorBufferBindings; - out_ext->maxResourceDescriptorBufferBindings = in_ext->maxResourceDescriptorBufferBindings; - out_ext->maxSamplerDescriptorBufferBindings = in_ext->maxSamplerDescriptorBufferBindings; - out_ext->maxEmbeddedImmutableSamplerBindings = in_ext->maxEmbeddedImmutableSamplerBindings; - out_ext->maxEmbeddedImmutableSamplers = in_ext->maxEmbeddedImmutableSamplers; - out_ext->bufferCaptureReplayDescriptorDataSize = in_ext->bufferCaptureReplayDescriptorDataSize; - out_ext->imageCaptureReplayDescriptorDataSize = in_ext->imageCaptureReplayDescriptorDataSize; - out_ext->imageViewCaptureReplayDescriptorDataSize = in_ext->imageViewCaptureReplayDescriptorDataSize; - out_ext->samplerCaptureReplayDescriptorDataSize = in_ext->samplerCaptureReplayDescriptorDataSize; - out_ext->accelerationStructureCaptureReplayDescriptorDataSize = in_ext->accelerationStructureCaptureReplayDescriptorDataSize; - out_ext->samplerDescriptorSize = in_ext->samplerDescriptorSize; - out_ext->combinedImageSamplerDescriptorSize = in_ext->combinedImageSamplerDescriptorSize; - out_ext->sampledImageDescriptorSize = in_ext->sampledImageDescriptorSize; - out_ext->storageImageDescriptorSize = in_ext->storageImageDescriptorSize; - out_ext->uniformTexelBufferDescriptorSize = in_ext->uniformTexelBufferDescriptorSize; - out_ext->robustUniformTexelBufferDescriptorSize = in_ext->robustUniformTexelBufferDescriptorSize; - out_ext->storageTexelBufferDescriptorSize = in_ext->storageTexelBufferDescriptorSize; - out_ext->robustStorageTexelBufferDescriptorSize = in_ext->robustStorageTexelBufferDescriptorSize; - out_ext->uniformBufferDescriptorSize = in_ext->uniformBufferDescriptorSize; - out_ext->robustUniformBufferDescriptorSize = in_ext->robustUniformBufferDescriptorSize; - out_ext->storageBufferDescriptorSize = in_ext->storageBufferDescriptorSize; - out_ext->robustStorageBufferDescriptorSize = in_ext->robustStorageBufferDescriptorSize; - out_ext->inputAttachmentDescriptorSize = in_ext->inputAttachmentDescriptorSize; - out_ext->accelerationStructureDescriptorSize = in_ext->accelerationStructureDescriptorSize; - out_ext->maxSamplerDescriptorBufferRange = in_ext->maxSamplerDescriptorBufferRange; - out_ext->maxResourceDescriptorBufferRange = in_ext->maxResourceDescriptorBufferRange; - out_ext->samplerDescriptorBufferAddressSpaceSize = in_ext->samplerDescriptorBufferAddressSpaceSize; - out_ext->resourceDescriptorBufferAddressSpaceSize = in_ext->resourceDescriptorBufferAddressSpaceSize; - out_ext->descriptorBufferAddressSpaceSize = in_ext->descriptorBufferAddressSpaceSize; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT: - { - VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT); - const VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT *in_ext = (const VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT; - out_ext->combinedImageSamplerDensityMapDescriptorSize = in_ext->combinedImageSamplerDensityMapDescriptorSize; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES: - { - VkPhysicalDeviceShaderIntegerDotProductProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES); - const VkPhysicalDeviceShaderIntegerDotProductProperties *in_ext = (const VkPhysicalDeviceShaderIntegerDotProductProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES; - out_ext->integerDotProduct8BitUnsignedAccelerated = in_ext->integerDotProduct8BitUnsignedAccelerated; - out_ext->integerDotProduct8BitSignedAccelerated = in_ext->integerDotProduct8BitSignedAccelerated; - out_ext->integerDotProduct8BitMixedSignednessAccelerated = in_ext->integerDotProduct8BitMixedSignednessAccelerated; - out_ext->integerDotProduct4x8BitPackedUnsignedAccelerated = in_ext->integerDotProduct4x8BitPackedUnsignedAccelerated; - out_ext->integerDotProduct4x8BitPackedSignedAccelerated = in_ext->integerDotProduct4x8BitPackedSignedAccelerated; - out_ext->integerDotProduct4x8BitPackedMixedSignednessAccelerated = in_ext->integerDotProduct4x8BitPackedMixedSignednessAccelerated; - out_ext->integerDotProduct16BitUnsignedAccelerated = in_ext->integerDotProduct16BitUnsignedAccelerated; - out_ext->integerDotProduct16BitSignedAccelerated = in_ext->integerDotProduct16BitSignedAccelerated; - out_ext->integerDotProduct16BitMixedSignednessAccelerated = in_ext->integerDotProduct16BitMixedSignednessAccelerated; - out_ext->integerDotProduct32BitUnsignedAccelerated = in_ext->integerDotProduct32BitUnsignedAccelerated; - out_ext->integerDotProduct32BitSignedAccelerated = in_ext->integerDotProduct32BitSignedAccelerated; - out_ext->integerDotProduct32BitMixedSignednessAccelerated = in_ext->integerDotProduct32BitMixedSignednessAccelerated; - out_ext->integerDotProduct64BitUnsignedAccelerated = in_ext->integerDotProduct64BitUnsignedAccelerated; - out_ext->integerDotProduct64BitSignedAccelerated = in_ext->integerDotProduct64BitSignedAccelerated; - out_ext->integerDotProduct64BitMixedSignednessAccelerated = in_ext->integerDotProduct64BitMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating8BitUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating8BitUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating8BitSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating8BitSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating16BitUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating16BitUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating16BitSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating16BitSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating32BitUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating32BitUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating32BitSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating32BitSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated; - out_ext->integerDotProductAccumulatingSaturating64BitUnsignedAccelerated = in_ext->integerDotProductAccumulatingSaturating64BitUnsignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating64BitSignedAccelerated = in_ext->integerDotProductAccumulatingSaturating64BitSignedAccelerated; - out_ext->integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated = in_ext->integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR: - { - VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR); - const VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR *in_ext = (const VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR; - out_ext->triStripVertexOrderIndependentOfProvokingVertex = in_ext->triStripVertexOrderIndependentOfProvokingVertex; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_PROPERTIES_KHR: - { - VkPhysicalDevicePipelineBinaryPropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_PROPERTIES_KHR); - const VkPhysicalDevicePipelineBinaryPropertiesKHR *in_ext = (const VkPhysicalDevicePipelineBinaryPropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_PROPERTIES_KHR; - out_ext->pipelineBinaryInternalCache = in_ext->pipelineBinaryInternalCache; - out_ext->pipelineBinaryInternalCacheControl = in_ext->pipelineBinaryInternalCacheControl; - out_ext->pipelineBinaryPrefersInternalCache = in_ext->pipelineBinaryPrefersInternalCache; - out_ext->pipelineBinaryPrecompiledInternalCache = in_ext->pipelineBinaryPrecompiledInternalCache; - out_ext->pipelineBinaryCompressedData = in_ext->pipelineBinaryCompressedData; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT: - { - VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT); - const VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT *in_ext = (const VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT; - out_ext->graphicsPipelineLibraryFastLinking = in_ext->graphicsPipelineLibraryFastLinking; - out_ext->graphicsPipelineLibraryIndependentInterpolationDecoration = in_ext->graphicsPipelineLibraryIndependentInterpolationDecoration; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT: - { - VkPhysicalDeviceNestedCommandBufferPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT); - const VkPhysicalDeviceNestedCommandBufferPropertiesEXT *in_ext = (const VkPhysicalDeviceNestedCommandBufferPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT; - out_ext->maxCommandBufferNestingLevel = in_ext->maxCommandBufferNestingLevel; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT: - { - VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT); - const VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT *in_ext = (const VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT; - memcpy(out_ext->shaderModuleIdentifierAlgorithmUUID, in_ext->shaderModuleIdentifierAlgorithmUUID, VK_UUID_SIZE * sizeof(uint8_t)); - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT: - { - VkPhysicalDeviceOpacityMicromapPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT); - const VkPhysicalDeviceOpacityMicromapPropertiesEXT *in_ext = (const VkPhysicalDeviceOpacityMicromapPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT; - out_ext->maxOpacity2StateSubdivisionLevel = in_ext->maxOpacity2StateSubdivisionLevel; - out_ext->maxOpacity4StateSubdivisionLevel = in_ext->maxOpacity4StateSubdivisionLevel; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES: - { - VkPhysicalDevicePipelineRobustnessProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES); - const VkPhysicalDevicePipelineRobustnessProperties *in_ext = (const VkPhysicalDevicePipelineRobustnessProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES; - out_ext->defaultRobustnessStorageBuffers = in_ext->defaultRobustnessStorageBuffers; - out_ext->defaultRobustnessUniformBuffers = in_ext->defaultRobustnessUniformBuffers; - out_ext->defaultRobustnessVertexInputs = in_ext->defaultRobustnessVertexInputs; - out_ext->defaultRobustnessImages = in_ext->defaultRobustnessImages; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM: - { - VkPhysicalDeviceImageProcessingPropertiesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM); - const VkPhysicalDeviceImageProcessingPropertiesQCOM *in_ext = (const VkPhysicalDeviceImageProcessingPropertiesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM; - out_ext->maxWeightFilterPhases = in_ext->maxWeightFilterPhases; - out_ext->maxWeightFilterDimension = in_ext->maxWeightFilterDimension; - out_ext->maxBlockMatchRegion = in_ext->maxBlockMatchRegion; - out_ext->maxBoxFilterBlockSize = in_ext->maxBoxFilterBlockSize; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV: - { - VkPhysicalDeviceOpticalFlowPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV); - const VkPhysicalDeviceOpticalFlowPropertiesNV *in_ext = (const VkPhysicalDeviceOpticalFlowPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV; - out_ext->supportedOutputGridSizes = in_ext->supportedOutputGridSizes; - out_ext->supportedHintGridSizes = in_ext->supportedHintGridSizes; - out_ext->hintSupported = in_ext->hintSupported; - out_ext->costSupported = in_ext->costSupported; - out_ext->bidirectionalFlowSupported = in_ext->bidirectionalFlowSupported; - out_ext->globalFlowSupported = in_ext->globalFlowSupported; - out_ext->minWidth = in_ext->minWidth; - out_ext->minHeight = in_ext->minHeight; - out_ext->maxWidth = in_ext->maxWidth; - out_ext->maxHeight = in_ext->maxHeight; - out_ext->maxNumRegionsOfInterest = in_ext->maxNumRegionsOfInterest; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM: - { - VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM); - const VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM *in_ext = (const VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM; - out_ext->shaderCoreMask = in_ext->shaderCoreMask; - out_ext->shaderCoreCount = in_ext->shaderCoreCount; - out_ext->shaderWarpsPerCore = in_ext->shaderWarpsPerCore; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV: - { - VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV); - const VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV *in_ext = (const VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV; - out_ext->rayTracingInvocationReorderReorderingHint = in_ext->rayTracingInvocationReorderReorderingHint; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV: - { - VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV); - const VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV *in_ext = (const VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV; - out_ext->extendedSparseAddressSpaceSize = in_ext->extendedSparseAddressSpaceSize; - out_ext->extendedSparseImageUsageFlags = in_ext->extendedSparseImageUsageFlags; - out_ext->extendedSparseBufferUsageFlags = in_ext->extendedSparseBufferUsageFlags; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM: - { - VkPhysicalDeviceShaderCorePropertiesARM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM); - const VkPhysicalDeviceShaderCorePropertiesARM *in_ext = (const VkPhysicalDeviceShaderCorePropertiesARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM; - out_ext->pixelRate = in_ext->pixelRate; - out_ext->texelRate = in_ext->texelRate; - out_ext->fmaRate = in_ext->fmaRate; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT: - { - VkPhysicalDeviceShaderObjectPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT); - const VkPhysicalDeviceShaderObjectPropertiesEXT *in_ext = (const VkPhysicalDeviceShaderObjectPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT; - memcpy(out_ext->shaderBinaryUUID, in_ext->shaderBinaryUUID, VK_UUID_SIZE * sizeof(uint8_t)); - out_ext->shaderBinaryVersion = in_ext->shaderBinaryVersion; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_PROPERTIES_EXT: - { - VkPhysicalDeviceShaderTileImagePropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_PROPERTIES_EXT); - const VkPhysicalDeviceShaderTileImagePropertiesEXT *in_ext = (const VkPhysicalDeviceShaderTileImagePropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_PROPERTIES_EXT; - out_ext->shaderTileImageCoherentReadAccelerated = in_ext->shaderTileImageCoherentReadAccelerated; - out_ext->shaderTileImageReadSampleFromPixelRateInvocation = in_ext->shaderTileImageReadSampleFromPixelRateInvocation; - out_ext->shaderTileImageReadFromHelperInvocation = in_ext->shaderTileImageReadFromHelperInvocation; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR: - { - VkPhysicalDeviceCooperativeMatrixPropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR); - const VkPhysicalDeviceCooperativeMatrixPropertiesKHR *in_ext = (const VkPhysicalDeviceCooperativeMatrixPropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR; - out_ext->cooperativeMatrixSupportedStages = in_ext->cooperativeMatrixSupportedStages; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM: - { - VkPhysicalDeviceImageProcessing2PropertiesQCOM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM); - const VkPhysicalDeviceImageProcessing2PropertiesQCOM *in_ext = (const VkPhysicalDeviceImageProcessing2PropertiesQCOM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM; - out_ext->maxBlockMatchWindow = in_ext->maxBlockMatchWindow; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT: - { - VkPhysicalDeviceLayeredDriverPropertiesMSFT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT); - const VkPhysicalDeviceLayeredDriverPropertiesMSFT *in_ext = (const VkPhysicalDeviceLayeredDriverPropertiesMSFT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT; - out_ext->underlyingAPI = in_ext->underlyingAPI; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_PROPERTIES_NV: - { - VkPhysicalDeviceCudaKernelLaunchPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_PROPERTIES_NV); - const VkPhysicalDeviceCudaKernelLaunchPropertiesNV *in_ext = (const VkPhysicalDeviceCudaKernelLaunchPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_PROPERTIES_NV; - out_ext->computeCapabilityMinor = in_ext->computeCapabilityMinor; - out_ext->computeCapabilityMajor = in_ext->computeCapabilityMajor; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_PROPERTIES_ARM: - { - VkPhysicalDeviceSchedulingControlsPropertiesARM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_PROPERTIES_ARM); - const VkPhysicalDeviceSchedulingControlsPropertiesARM *in_ext = (const VkPhysicalDeviceSchedulingControlsPropertiesARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_PROPERTIES_ARM; - out_ext->schedulingControlsFlags = in_ext->schedulingControlsFlags; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_PROPERTIES_ARM: - { - VkPhysicalDeviceRenderPassStripedPropertiesARM32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_PROPERTIES_ARM); - const VkPhysicalDeviceRenderPassStripedPropertiesARM *in_ext = (const VkPhysicalDeviceRenderPassStripedPropertiesARM *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_PROPERTIES_ARM; - out_ext->renderPassStripeGranularity = in_ext->renderPassStripeGranularity; - out_ext->maxRenderPassStripes = in_ext->maxRenderPassStripes; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_PROPERTIES_EXT: - { - VkPhysicalDeviceMapMemoryPlacedPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_PROPERTIES_EXT); - const VkPhysicalDeviceMapMemoryPlacedPropertiesEXT *in_ext = (const VkPhysicalDeviceMapMemoryPlacedPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_PROPERTIES_EXT; - out_ext->minPlacedMemoryMapAlignment = in_ext->minPlacedMemoryMapAlignment; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_PROPERTIES_MESA: - { - VkPhysicalDeviceImageAlignmentControlPropertiesMESA32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_PROPERTIES_MESA); - const VkPhysicalDeviceImageAlignmentControlPropertiesMESA *in_ext = (const VkPhysicalDeviceImageAlignmentControlPropertiesMESA *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_PROPERTIES_MESA; - out_ext->supportedImageAlignmentMask = in_ext->supportedImageAlignmentMask; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_PROPERTIES_NV: - { - VkPhysicalDeviceCooperativeMatrix2PropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_PROPERTIES_NV); - const VkPhysicalDeviceCooperativeMatrix2PropertiesNV *in_ext = (const VkPhysicalDeviceCooperativeMatrix2PropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_PROPERTIES_NV; - out_ext->cooperativeMatrixWorkgroupScopeMaxWorkgroupSize = in_ext->cooperativeMatrixWorkgroupScopeMaxWorkgroupSize; - out_ext->cooperativeMatrixFlexibleDimensionsMaxDimension = in_ext->cooperativeMatrixFlexibleDimensionsMaxDimension; - out_ext->cooperativeMatrixWorkgroupScopeReservedSharedMemory = in_ext->cooperativeMatrixWorkgroupScopeReservedSharedMemory; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline void convert_VkQueryPoolPerformanceCreateInfoKHR_win32_to_host(const VkQueryPoolPerformanceCreateInfoKHR32 *in, VkQueryPoolPerformanceCreateInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->queueFamilyIndex = in->queueFamilyIndex; - out->counterIndexCount = in->counterIndexCount; - out->pCounterIndices = UlongToPtr(in->pCounterIndices); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkQueueFamilyProperties2_win32_to_host(struct conversion_context *ctx, const VkQueueFamilyProperties232 *in, VkQueueFamilyProperties2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES: - { - VkQueueFamilyGlobalPriorityProperties *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: - { - VkQueueFamilyCheckpointPropertiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV: - { - VkQueueFamilyCheckpointProperties2NV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR: - { - VkQueueFamilyVideoPropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_KHR: - { - VkQueueFamilyQueryResultStatusPropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkQueueFamilyProperties2_host_to_win32(const VkQueueFamilyProperties2 *in, VkQueueFamilyProperties232 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - out->queueFamilyProperties = in->queueFamilyProperties; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES: - { - VkQueueFamilyGlobalPriorityProperties32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES); - const VkQueueFamilyGlobalPriorityProperties *in_ext = (const VkQueueFamilyGlobalPriorityProperties *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES; - out_ext->priorityCount = in_ext->priorityCount; - memcpy(out_ext->priorities, in_ext->priorities, VK_MAX_GLOBAL_PRIORITY_SIZE * sizeof(VkQueueGlobalPriority)); - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: - { - VkQueueFamilyCheckpointPropertiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV); - const VkQueueFamilyCheckpointPropertiesNV *in_ext = (const VkQueueFamilyCheckpointPropertiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV; - out_ext->checkpointExecutionStageMask = in_ext->checkpointExecutionStageMask; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV: - { - VkQueueFamilyCheckpointProperties2NV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV); - const VkQueueFamilyCheckpointProperties2NV *in_ext = (const VkQueueFamilyCheckpointProperties2NV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV; - out_ext->checkpointExecutionStageMask = in_ext->checkpointExecutionStageMask; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR: - { - VkQueueFamilyVideoPropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR); - const VkQueueFamilyVideoPropertiesKHR *in_ext = (const VkQueueFamilyVideoPropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR; - out_ext->videoCodecOperations = in_ext->videoCodecOperations; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_KHR: - { - VkQueueFamilyQueryResultStatusPropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_KHR); - const VkQueueFamilyQueryResultStatusPropertiesKHR *in_ext = (const VkQueueFamilyQueryResultStatusPropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_KHR; - out_ext->queryResultStatusSupport = in_ext->queryResultStatusSupport; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline VkQueueFamilyProperties2 *convert_VkQueueFamilyProperties2_array_win32_to_host(struct conversion_context *ctx, const VkQueueFamilyProperties232 *in, uint32_t count) -{ - VkQueueFamilyProperties2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkQueueFamilyProperties2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkQueueFamilyProperties2_array_host_to_win32(const VkQueueFamilyProperties2 *in, VkQueueFamilyProperties232 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkQueueFamilyProperties2_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPhysicalDeviceSparseImageFormatInfo2_win32_to_host(const VkPhysicalDeviceSparseImageFormatInfo232 *in, VkPhysicalDeviceSparseImageFormatInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->format = in->format; - out->type = in->type; - out->samples = in->samples; - out->usage = in->usage; - out->tiling = in->tiling; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkSparseImageFormatProperties2_win32_to_host(const VkSparseImageFormatProperties232 *in, VkSparseImageFormatProperties2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkSparseImageFormatProperties2_host_to_win32(const VkSparseImageFormatProperties2 *in, VkSparseImageFormatProperties232 *out) -{ - if (!in) return; - - out->properties = in->properties; -} - -static inline VkSparseImageFormatProperties2 *convert_VkSparseImageFormatProperties2_array_win32_to_host(struct conversion_context *ctx, const VkSparseImageFormatProperties232 *in, uint32_t count) -{ - VkSparseImageFormatProperties2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseImageFormatProperties2_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSparseImageFormatProperties2_array_host_to_win32(const VkSparseImageFormatProperties2 *in, VkSparseImageFormatProperties232 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkSparseImageFormatProperties2_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkFramebufferMixedSamplesCombinationNV_win32_to_host(const VkFramebufferMixedSamplesCombinationNV32 *in, VkFramebufferMixedSamplesCombinationNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkFramebufferMixedSamplesCombinationNV_host_to_win32(const VkFramebufferMixedSamplesCombinationNV *in, VkFramebufferMixedSamplesCombinationNV32 *out) -{ - if (!in) return; - - out->coverageReductionMode = in->coverageReductionMode; - out->rasterizationSamples = in->rasterizationSamples; - out->depthStencilSamples = in->depthStencilSamples; - out->colorSamples = in->colorSamples; -} - -static inline VkFramebufferMixedSamplesCombinationNV *convert_VkFramebufferMixedSamplesCombinationNV_array_win32_to_host(struct conversion_context *ctx, const VkFramebufferMixedSamplesCombinationNV32 *in, uint32_t count) -{ - VkFramebufferMixedSamplesCombinationNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkFramebufferMixedSamplesCombinationNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkFramebufferMixedSamplesCombinationNV_array_host_to_win32(const VkFramebufferMixedSamplesCombinationNV *in, VkFramebufferMixedSamplesCombinationNV32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkFramebufferMixedSamplesCombinationNV_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPhysicalDeviceSurfaceInfo2KHR_win32_to_unwrapped_host(struct conversion_context *ctx, const VkPhysicalDeviceSurfaceInfo2KHR32 *in, VkPhysicalDeviceSurfaceInfo2KHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->surface = in->surface; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT: - { - VkSurfacePresentModeEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSurfacePresentModeEXT32 *in_ext = (const VkSurfacePresentModeEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT; - out_ext->pNext = NULL; - out_ext->presentMode = in_ext->presentMode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSurfaceCapabilities2KHR_win32_to_host(struct conversion_context *ctx, const VkSurfaceCapabilities2KHR32 *in, VkSurfaceCapabilities2KHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV: - { - VkSurfaceCapabilitiesPresentBarrierNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT: - { - VkSurfacePresentScalingCapabilitiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT: - { - VkSurfacePresentModeCompatibilityEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSurfacePresentModeCompatibilityEXT32 *in_ext = (const VkSurfacePresentModeCompatibilityEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT; - out_ext->pNext = NULL; - out_ext->presentModeCount = in_ext->presentModeCount; - out_ext->pPresentModes = UlongToPtr(in_ext->pPresentModes); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV: - { - VkLatencySurfaceCapabilitiesNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkLatencySurfaceCapabilitiesNV32 *in_ext = (const VkLatencySurfaceCapabilitiesNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV; - out_ext->pNext = NULL; - out_ext->presentModeCount = in_ext->presentModeCount; - out_ext->pPresentModes = UlongToPtr(in_ext->pPresentModes); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSurfaceCapabilities2KHR_host_to_win32(const VkSurfaceCapabilities2KHR *in, VkSurfaceCapabilities2KHR32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - out->surfaceCapabilities = in->surfaceCapabilities; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV: - { - VkSurfaceCapabilitiesPresentBarrierNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV); - const VkSurfaceCapabilitiesPresentBarrierNV *in_ext = (const VkSurfaceCapabilitiesPresentBarrierNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV; - out_ext->presentBarrierSupported = in_ext->presentBarrierSupported; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT: - { - VkSurfacePresentScalingCapabilitiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT); - const VkSurfacePresentScalingCapabilitiesEXT *in_ext = (const VkSurfacePresentScalingCapabilitiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT; - out_ext->supportedPresentScaling = in_ext->supportedPresentScaling; - out_ext->supportedPresentGravityX = in_ext->supportedPresentGravityX; - out_ext->supportedPresentGravityY = in_ext->supportedPresentGravityY; - out_ext->minScaledImageExtent = in_ext->minScaledImageExtent; - out_ext->maxScaledImageExtent = in_ext->maxScaledImageExtent; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT: - { - VkSurfacePresentModeCompatibilityEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT); - const VkSurfacePresentModeCompatibilityEXT *in_ext = (const VkSurfacePresentModeCompatibilityEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT; - out_ext->presentModeCount = in_ext->presentModeCount; - out_ext->pPresentModes = PtrToUlong(in_ext->pPresentModes); - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV: - { - VkLatencySurfaceCapabilitiesNV32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV); - const VkLatencySurfaceCapabilitiesNV *in_ext = (const VkLatencySurfaceCapabilitiesNV *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV; - out_ext->presentModeCount = in_ext->presentModeCount; - out_ext->pPresentModes = PtrToUlong(in_ext->pPresentModes); - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline void convert_VkSurfaceFormat2KHR_win32_to_host(struct conversion_context *ctx, const VkSurfaceFormat2KHR32 *in, VkSurfaceFormat2KHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT: - { - VkImageCompressionPropertiesEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSurfaceFormat2KHR_host_to_win32(const VkSurfaceFormat2KHR *in, VkSurfaceFormat2KHR32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - out->surfaceFormat = in->surfaceFormat; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT: - { - VkImageCompressionPropertiesEXT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT); - const VkImageCompressionPropertiesEXT *in_ext = (const VkImageCompressionPropertiesEXT *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT; - out_ext->imageCompressionFlags = in_ext->imageCompressionFlags; - out_ext->imageCompressionFixedRateFlags = in_ext->imageCompressionFixedRateFlags; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline VkSurfaceFormat2KHR *convert_VkSurfaceFormat2KHR_array_win32_to_host(struct conversion_context *ctx, const VkSurfaceFormat2KHR32 *in, uint32_t count) -{ - VkSurfaceFormat2KHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSurfaceFormat2KHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSurfaceFormat2KHR_array_host_to_win32(const VkSurfaceFormat2KHR *in, VkSurfaceFormat2KHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkSurfaceFormat2KHR_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPhysicalDeviceToolProperties_win32_to_host(const VkPhysicalDeviceToolProperties32 *in, VkPhysicalDeviceToolProperties *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPhysicalDeviceToolProperties_host_to_win32(const VkPhysicalDeviceToolProperties *in, VkPhysicalDeviceToolProperties32 *out) -{ - if (!in) return; - - memcpy(out->name, in->name, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char)); - memcpy(out->version, in->version, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char)); - out->purposes = in->purposes; - memcpy(out->description, in->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - memcpy(out->layer, in->layer, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char)); -} - -static inline VkPhysicalDeviceToolProperties *convert_VkPhysicalDeviceToolProperties_array_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceToolProperties32 *in, uint32_t count) -{ - VkPhysicalDeviceToolProperties *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPhysicalDeviceToolProperties_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPhysicalDeviceToolProperties_array_host_to_win32(const VkPhysicalDeviceToolProperties *in, VkPhysicalDeviceToolProperties32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkPhysicalDeviceToolProperties_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkVideoCapabilitiesKHR_win32_to_host(struct conversion_context *ctx, const VkVideoCapabilitiesKHR32 *in, VkVideoCapabilitiesKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_CAPABILITIES_KHR: - { - VkVideoEncodeQuantizationMapCapabilitiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_CAPABILITIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUANTIZATION_MAP_CAPABILITIES_KHR: - { - VkVideoEncodeH264QuantizationMapCapabilitiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUANTIZATION_MAP_CAPABILITIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUANTIZATION_MAP_CAPABILITIES_KHR: - { - VkVideoEncodeH265QuantizationMapCapabilitiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUANTIZATION_MAP_CAPABILITIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUANTIZATION_MAP_CAPABILITIES_KHR: - { - VkVideoEncodeAV1QuantizationMapCapabilitiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUANTIZATION_MAP_CAPABILITIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR: - { - VkVideoDecodeCapabilitiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_KHR: - { - VkVideoDecodeH264CapabilitiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR: - { - VkVideoDecodeH265CapabilitiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_CAPABILITIES_KHR: - { - VkVideoDecodeAV1CapabilitiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_CAPABILITIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR: - { - VkVideoEncodeCapabilitiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_KHR: - { - VkVideoEncodeH264CapabilitiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_KHR: - { - VkVideoEncodeH265CapabilitiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_CAPABILITIES_KHR: - { - VkVideoEncodeAV1CapabilitiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_CAPABILITIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkVideoCapabilitiesKHR_host_to_win32(const VkVideoCapabilitiesKHR *in, VkVideoCapabilitiesKHR32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - out->flags = in->flags; - out->minBitstreamBufferOffsetAlignment = in->minBitstreamBufferOffsetAlignment; - out->minBitstreamBufferSizeAlignment = in->minBitstreamBufferSizeAlignment; - out->pictureAccessGranularity = in->pictureAccessGranularity; - out->minCodedExtent = in->minCodedExtent; - out->maxCodedExtent = in->maxCodedExtent; - out->maxDpbSlots = in->maxDpbSlots; - out->maxActiveReferencePictures = in->maxActiveReferencePictures; - out->stdHeaderVersion = in->stdHeaderVersion; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_CAPABILITIES_KHR: - { - VkVideoEncodeQuantizationMapCapabilitiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_CAPABILITIES_KHR); - const VkVideoEncodeQuantizationMapCapabilitiesKHR *in_ext = (const VkVideoEncodeQuantizationMapCapabilitiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_CAPABILITIES_KHR; - out_ext->maxQuantizationMapExtent = in_ext->maxQuantizationMapExtent; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUANTIZATION_MAP_CAPABILITIES_KHR: - { - VkVideoEncodeH264QuantizationMapCapabilitiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUANTIZATION_MAP_CAPABILITIES_KHR); - const VkVideoEncodeH264QuantizationMapCapabilitiesKHR *in_ext = (const VkVideoEncodeH264QuantizationMapCapabilitiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUANTIZATION_MAP_CAPABILITIES_KHR; - out_ext->minQpDelta = in_ext->minQpDelta; - out_ext->maxQpDelta = in_ext->maxQpDelta; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUANTIZATION_MAP_CAPABILITIES_KHR: - { - VkVideoEncodeH265QuantizationMapCapabilitiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUANTIZATION_MAP_CAPABILITIES_KHR); - const VkVideoEncodeH265QuantizationMapCapabilitiesKHR *in_ext = (const VkVideoEncodeH265QuantizationMapCapabilitiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUANTIZATION_MAP_CAPABILITIES_KHR; - out_ext->minQpDelta = in_ext->minQpDelta; - out_ext->maxQpDelta = in_ext->maxQpDelta; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUANTIZATION_MAP_CAPABILITIES_KHR: - { - VkVideoEncodeAV1QuantizationMapCapabilitiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUANTIZATION_MAP_CAPABILITIES_KHR); - const VkVideoEncodeAV1QuantizationMapCapabilitiesKHR *in_ext = (const VkVideoEncodeAV1QuantizationMapCapabilitiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUANTIZATION_MAP_CAPABILITIES_KHR; - out_ext->minQIndexDelta = in_ext->minQIndexDelta; - out_ext->maxQIndexDelta = in_ext->maxQIndexDelta; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR: - { - VkVideoDecodeCapabilitiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR); - const VkVideoDecodeCapabilitiesKHR *in_ext = (const VkVideoDecodeCapabilitiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR; - out_ext->flags = in_ext->flags; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_KHR: - { - VkVideoDecodeH264CapabilitiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_KHR); - const VkVideoDecodeH264CapabilitiesKHR *in_ext = (const VkVideoDecodeH264CapabilitiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_KHR; - out_ext->maxLevelIdc = in_ext->maxLevelIdc; - out_ext->fieldOffsetGranularity = in_ext->fieldOffsetGranularity; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR: - { - VkVideoDecodeH265CapabilitiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR); - const VkVideoDecodeH265CapabilitiesKHR *in_ext = (const VkVideoDecodeH265CapabilitiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR; - out_ext->maxLevelIdc = in_ext->maxLevelIdc; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_CAPABILITIES_KHR: - { - VkVideoDecodeAV1CapabilitiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_CAPABILITIES_KHR); - const VkVideoDecodeAV1CapabilitiesKHR *in_ext = (const VkVideoDecodeAV1CapabilitiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_CAPABILITIES_KHR; - out_ext->maxLevel = in_ext->maxLevel; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR: - { - VkVideoEncodeCapabilitiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR); - const VkVideoEncodeCapabilitiesKHR *in_ext = (const VkVideoEncodeCapabilitiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR; - out_ext->flags = in_ext->flags; - out_ext->rateControlModes = in_ext->rateControlModes; - out_ext->maxRateControlLayers = in_ext->maxRateControlLayers; - out_ext->maxBitrate = in_ext->maxBitrate; - out_ext->maxQualityLevels = in_ext->maxQualityLevels; - out_ext->encodeInputPictureGranularity = in_ext->encodeInputPictureGranularity; - out_ext->supportedEncodeFeedbackFlags = in_ext->supportedEncodeFeedbackFlags; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_KHR: - { - VkVideoEncodeH264CapabilitiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_KHR); - const VkVideoEncodeH264CapabilitiesKHR *in_ext = (const VkVideoEncodeH264CapabilitiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_KHR; - out_ext->flags = in_ext->flags; - out_ext->maxLevelIdc = in_ext->maxLevelIdc; - out_ext->maxSliceCount = in_ext->maxSliceCount; - out_ext->maxPPictureL0ReferenceCount = in_ext->maxPPictureL0ReferenceCount; - out_ext->maxBPictureL0ReferenceCount = in_ext->maxBPictureL0ReferenceCount; - out_ext->maxL1ReferenceCount = in_ext->maxL1ReferenceCount; - out_ext->maxTemporalLayerCount = in_ext->maxTemporalLayerCount; - out_ext->expectDyadicTemporalLayerPattern = in_ext->expectDyadicTemporalLayerPattern; - out_ext->minQp = in_ext->minQp; - out_ext->maxQp = in_ext->maxQp; - out_ext->prefersGopRemainingFrames = in_ext->prefersGopRemainingFrames; - out_ext->requiresGopRemainingFrames = in_ext->requiresGopRemainingFrames; - out_ext->stdSyntaxFlags = in_ext->stdSyntaxFlags; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_KHR: - { - VkVideoEncodeH265CapabilitiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_KHR); - const VkVideoEncodeH265CapabilitiesKHR *in_ext = (const VkVideoEncodeH265CapabilitiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_KHR; - out_ext->flags = in_ext->flags; - out_ext->maxLevelIdc = in_ext->maxLevelIdc; - out_ext->maxSliceSegmentCount = in_ext->maxSliceSegmentCount; - out_ext->maxTiles = in_ext->maxTiles; - out_ext->ctbSizes = in_ext->ctbSizes; - out_ext->transformBlockSizes = in_ext->transformBlockSizes; - out_ext->maxPPictureL0ReferenceCount = in_ext->maxPPictureL0ReferenceCount; - out_ext->maxBPictureL0ReferenceCount = in_ext->maxBPictureL0ReferenceCount; - out_ext->maxL1ReferenceCount = in_ext->maxL1ReferenceCount; - out_ext->maxSubLayerCount = in_ext->maxSubLayerCount; - out_ext->expectDyadicTemporalSubLayerPattern = in_ext->expectDyadicTemporalSubLayerPattern; - out_ext->minQp = in_ext->minQp; - out_ext->maxQp = in_ext->maxQp; - out_ext->prefersGopRemainingFrames = in_ext->prefersGopRemainingFrames; - out_ext->requiresGopRemainingFrames = in_ext->requiresGopRemainingFrames; - out_ext->stdSyntaxFlags = in_ext->stdSyntaxFlags; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_CAPABILITIES_KHR: - { - VkVideoEncodeAV1CapabilitiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_CAPABILITIES_KHR); - const VkVideoEncodeAV1CapabilitiesKHR *in_ext = (const VkVideoEncodeAV1CapabilitiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_CAPABILITIES_KHR; - out_ext->flags = in_ext->flags; - out_ext->maxLevel = in_ext->maxLevel; - out_ext->codedPictureAlignment = in_ext->codedPictureAlignment; - out_ext->maxTiles = in_ext->maxTiles; - out_ext->minTileSize = in_ext->minTileSize; - out_ext->maxTileSize = in_ext->maxTileSize; - out_ext->superblockSizes = in_ext->superblockSizes; - out_ext->maxSingleReferenceCount = in_ext->maxSingleReferenceCount; - out_ext->singleReferenceNameMask = in_ext->singleReferenceNameMask; - out_ext->maxUnidirectionalCompoundReferenceCount = in_ext->maxUnidirectionalCompoundReferenceCount; - out_ext->maxUnidirectionalCompoundGroup1ReferenceCount = in_ext->maxUnidirectionalCompoundGroup1ReferenceCount; - out_ext->unidirectionalCompoundReferenceNameMask = in_ext->unidirectionalCompoundReferenceNameMask; - out_ext->maxBidirectionalCompoundReferenceCount = in_ext->maxBidirectionalCompoundReferenceCount; - out_ext->maxBidirectionalCompoundGroup1ReferenceCount = in_ext->maxBidirectionalCompoundGroup1ReferenceCount; - out_ext->maxBidirectionalCompoundGroup2ReferenceCount = in_ext->maxBidirectionalCompoundGroup2ReferenceCount; - out_ext->bidirectionalCompoundReferenceNameMask = in_ext->bidirectionalCompoundReferenceNameMask; - out_ext->maxTemporalLayerCount = in_ext->maxTemporalLayerCount; - out_ext->maxSpatialLayerCount = in_ext->maxSpatialLayerCount; - out_ext->maxOperatingPoints = in_ext->maxOperatingPoints; - out_ext->minQIndex = in_ext->minQIndex; - out_ext->maxQIndex = in_ext->maxQIndex; - out_ext->prefersGopRemainingFrames = in_ext->prefersGopRemainingFrames; - out_ext->requiresGopRemainingFrames = in_ext->requiresGopRemainingFrames; - out_ext->stdSyntaxFlags = in_ext->stdSyntaxFlags; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline void convert_VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR32 *in, VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pVideoProfile = convert_VkVideoProfileInfoKHR_array_win32_to_host(ctx, (const VkVideoProfileInfoKHR32 *)UlongToPtr(in->pVideoProfile), 1); - out->qualityLevel = in->qualityLevel; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkVideoEncodeQualityLevelPropertiesKHR_win32_to_host(struct conversion_context *ctx, const VkVideoEncodeQualityLevelPropertiesKHR32 *in, VkVideoEncodeQualityLevelPropertiesKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUALITY_LEVEL_PROPERTIES_KHR: - { - VkVideoEncodeH264QualityLevelPropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUALITY_LEVEL_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUALITY_LEVEL_PROPERTIES_KHR: - { - VkVideoEncodeH265QualityLevelPropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUALITY_LEVEL_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUALITY_LEVEL_PROPERTIES_KHR: - { - VkVideoEncodeAV1QualityLevelPropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUALITY_LEVEL_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkVideoEncodeQualityLevelPropertiesKHR_host_to_win32(const VkVideoEncodeQualityLevelPropertiesKHR *in, VkVideoEncodeQualityLevelPropertiesKHR32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - out->preferredRateControlMode = in->preferredRateControlMode; - out->preferredRateControlLayerCount = in->preferredRateControlLayerCount; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUALITY_LEVEL_PROPERTIES_KHR: - { - VkVideoEncodeH264QualityLevelPropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUALITY_LEVEL_PROPERTIES_KHR); - const VkVideoEncodeH264QualityLevelPropertiesKHR *in_ext = (const VkVideoEncodeH264QualityLevelPropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUALITY_LEVEL_PROPERTIES_KHR; - out_ext->preferredRateControlFlags = in_ext->preferredRateControlFlags; - out_ext->preferredGopFrameCount = in_ext->preferredGopFrameCount; - out_ext->preferredIdrPeriod = in_ext->preferredIdrPeriod; - out_ext->preferredConsecutiveBFrameCount = in_ext->preferredConsecutiveBFrameCount; - out_ext->preferredTemporalLayerCount = in_ext->preferredTemporalLayerCount; - out_ext->preferredConstantQp = in_ext->preferredConstantQp; - out_ext->preferredMaxL0ReferenceCount = in_ext->preferredMaxL0ReferenceCount; - out_ext->preferredMaxL1ReferenceCount = in_ext->preferredMaxL1ReferenceCount; - out_ext->preferredStdEntropyCodingModeFlag = in_ext->preferredStdEntropyCodingModeFlag; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUALITY_LEVEL_PROPERTIES_KHR: - { - VkVideoEncodeH265QualityLevelPropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUALITY_LEVEL_PROPERTIES_KHR); - const VkVideoEncodeH265QualityLevelPropertiesKHR *in_ext = (const VkVideoEncodeH265QualityLevelPropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUALITY_LEVEL_PROPERTIES_KHR; - out_ext->preferredRateControlFlags = in_ext->preferredRateControlFlags; - out_ext->preferredGopFrameCount = in_ext->preferredGopFrameCount; - out_ext->preferredIdrPeriod = in_ext->preferredIdrPeriod; - out_ext->preferredConsecutiveBFrameCount = in_ext->preferredConsecutiveBFrameCount; - out_ext->preferredSubLayerCount = in_ext->preferredSubLayerCount; - out_ext->preferredConstantQp = in_ext->preferredConstantQp; - out_ext->preferredMaxL0ReferenceCount = in_ext->preferredMaxL0ReferenceCount; - out_ext->preferredMaxL1ReferenceCount = in_ext->preferredMaxL1ReferenceCount; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUALITY_LEVEL_PROPERTIES_KHR: - { - VkVideoEncodeAV1QualityLevelPropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUALITY_LEVEL_PROPERTIES_KHR); - const VkVideoEncodeAV1QualityLevelPropertiesKHR *in_ext = (const VkVideoEncodeAV1QualityLevelPropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUALITY_LEVEL_PROPERTIES_KHR; - out_ext->preferredRateControlFlags = in_ext->preferredRateControlFlags; - out_ext->preferredGopFrameCount = in_ext->preferredGopFrameCount; - out_ext->preferredKeyFramePeriod = in_ext->preferredKeyFramePeriod; - out_ext->preferredConsecutiveBipredictiveFrameCount = in_ext->preferredConsecutiveBipredictiveFrameCount; - out_ext->preferredTemporalLayerCount = in_ext->preferredTemporalLayerCount; - out_ext->preferredConstantQIndex = in_ext->preferredConstantQIndex; - out_ext->preferredMaxSingleReferenceCount = in_ext->preferredMaxSingleReferenceCount; - out_ext->preferredSingleReferenceNameMask = in_ext->preferredSingleReferenceNameMask; - out_ext->preferredMaxUnidirectionalCompoundReferenceCount = in_ext->preferredMaxUnidirectionalCompoundReferenceCount; - out_ext->preferredMaxUnidirectionalCompoundGroup1ReferenceCount = in_ext->preferredMaxUnidirectionalCompoundGroup1ReferenceCount; - out_ext->preferredUnidirectionalCompoundReferenceNameMask = in_ext->preferredUnidirectionalCompoundReferenceNameMask; - out_ext->preferredMaxBidirectionalCompoundReferenceCount = in_ext->preferredMaxBidirectionalCompoundReferenceCount; - out_ext->preferredMaxBidirectionalCompoundGroup1ReferenceCount = in_ext->preferredMaxBidirectionalCompoundGroup1ReferenceCount; - out_ext->preferredMaxBidirectionalCompoundGroup2ReferenceCount = in_ext->preferredMaxBidirectionalCompoundGroup2ReferenceCount; - out_ext->preferredBidirectionalCompoundReferenceNameMask = in_ext->preferredBidirectionalCompoundReferenceNameMask; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline void convert_VkPhysicalDeviceVideoFormatInfoKHR_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceVideoFormatInfoKHR32 *in, VkPhysicalDeviceVideoFormatInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->imageUsage = in->imageUsage; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR: - { - VkVideoProfileListInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoProfileListInfoKHR32 *in_ext = (const VkVideoProfileListInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR; - out_ext->pNext = NULL; - out_ext->profileCount = in_ext->profileCount; - out_ext->pProfiles = convert_VkVideoProfileInfoKHR_array_win32_to_host(ctx, (const VkVideoProfileInfoKHR32 *)UlongToPtr(in_ext->pProfiles), in_ext->profileCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkVideoFormatPropertiesKHR_win32_to_host(struct conversion_context *ctx, const VkVideoFormatPropertiesKHR32 *in, VkVideoFormatPropertiesKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR: - { - VkVideoFormatQuantizationMapPropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_FORMAT_H265_QUANTIZATION_MAP_PROPERTIES_KHR: - { - VkVideoFormatH265QuantizationMapPropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_H265_QUANTIZATION_MAP_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_FORMAT_AV1_QUANTIZATION_MAP_PROPERTIES_KHR: - { - VkVideoFormatAV1QuantizationMapPropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_AV1_QUANTIZATION_MAP_PROPERTIES_KHR; - out_ext->pNext = NULL; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkVideoFormatPropertiesKHR_host_to_win32(const VkVideoFormatPropertiesKHR *in, VkVideoFormatPropertiesKHR32 *out) -{ - const VkBaseInStructure *in_header; - VkBaseOutStructure32 *out_header = (void *)out; - - if (!in) return; - - out->format = in->format; - out->componentMapping = in->componentMapping; - out->imageCreateFlags = in->imageCreateFlags; - out->imageType = in->imageType; - out->imageTiling = in->imageTiling; - out->imageUsageFlags = in->imageUsageFlags; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR: - { - VkVideoFormatQuantizationMapPropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR); - const VkVideoFormatQuantizationMapPropertiesKHR *in_ext = (const VkVideoFormatQuantizationMapPropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR; - out_ext->quantizationMapTexelSize = in_ext->quantizationMapTexelSize; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_FORMAT_H265_QUANTIZATION_MAP_PROPERTIES_KHR: - { - VkVideoFormatH265QuantizationMapPropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_FORMAT_H265_QUANTIZATION_MAP_PROPERTIES_KHR); - const VkVideoFormatH265QuantizationMapPropertiesKHR *in_ext = (const VkVideoFormatH265QuantizationMapPropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_H265_QUANTIZATION_MAP_PROPERTIES_KHR; - out_ext->compatibleCtbSizes = in_ext->compatibleCtbSizes; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_FORMAT_AV1_QUANTIZATION_MAP_PROPERTIES_KHR: - { - VkVideoFormatAV1QuantizationMapPropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_VIDEO_FORMAT_AV1_QUANTIZATION_MAP_PROPERTIES_KHR); - const VkVideoFormatAV1QuantizationMapPropertiesKHR *in_ext = (const VkVideoFormatAV1QuantizationMapPropertiesKHR *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_AV1_QUANTIZATION_MAP_PROPERTIES_KHR; - out_ext->compatibleSuperblockSizes = in_ext->compatibleSuperblockSizes; - out_header = (void *)out_ext; - break; - } - default: - break; - } - } -} - -static inline VkVideoFormatPropertiesKHR *convert_VkVideoFormatPropertiesKHR_array_win32_to_host(struct conversion_context *ctx, const VkVideoFormatPropertiesKHR32 *in, uint32_t count) -{ - VkVideoFormatPropertiesKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkVideoFormatPropertiesKHR_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkVideoFormatPropertiesKHR_array_host_to_win32(const VkVideoFormatPropertiesKHR *in, VkVideoFormatPropertiesKHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkVideoFormatPropertiesKHR_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPipelineBinaryDataInfoKHR_win32_to_host(const VkPipelineBinaryDataInfoKHR32 *in, VkPipelineBinaryDataInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pipelineBinary = in->pipelineBinary; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineBinaryKeyKHR_host_to_win32(const VkPipelineBinaryKeyKHR *in, VkPipelineBinaryKeyKHR32 *out) -{ - if (!in) return; - - out->keySize = in->keySize; - memcpy(out->key, in->key, VK_MAX_PIPELINE_BINARY_KEY_SIZE_KHR * sizeof(uint8_t)); -} - -static inline void convert_VkPipelineExecutableInfoKHR_win32_to_host(const VkPipelineExecutableInfoKHR32 *in, VkPipelineExecutableInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pipeline = in->pipeline; - out->executableIndex = in->executableIndex; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineExecutableInternalRepresentationKHR_win32_to_host(const VkPipelineExecutableInternalRepresentationKHR32 *in, VkPipelineExecutableInternalRepresentationKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineExecutableInternalRepresentationKHR_host_to_win32(const VkPipelineExecutableInternalRepresentationKHR *in, VkPipelineExecutableInternalRepresentationKHR32 *out) -{ - if (!in) return; - - memcpy(out->name, in->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - memcpy(out->description, in->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - out->isText = in->isText; - out->dataSize = in->dataSize; - out->pData = PtrToUlong(in->pData); -} - -static inline VkPipelineExecutableInternalRepresentationKHR *convert_VkPipelineExecutableInternalRepresentationKHR_array_win32_to_host(struct conversion_context *ctx, const VkPipelineExecutableInternalRepresentationKHR32 *in, uint32_t count) -{ - VkPipelineExecutableInternalRepresentationKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineExecutableInternalRepresentationKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineExecutableInternalRepresentationKHR_array_host_to_win32(const VkPipelineExecutableInternalRepresentationKHR *in, VkPipelineExecutableInternalRepresentationKHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkPipelineExecutableInternalRepresentationKHR_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPipelineInfoKHR_win32_to_host(const VkPipelineInfoKHR32 *in, VkPipelineInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pipeline = in->pipeline; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineExecutablePropertiesKHR_win32_to_host(const VkPipelineExecutablePropertiesKHR32 *in, VkPipelineExecutablePropertiesKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineExecutablePropertiesKHR_host_to_win32(const VkPipelineExecutablePropertiesKHR *in, VkPipelineExecutablePropertiesKHR32 *out) -{ - if (!in) return; - - out->stages = in->stages; - memcpy(out->name, in->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - memcpy(out->description, in->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - out->subgroupSize = in->subgroupSize; -} - -static inline VkPipelineExecutablePropertiesKHR *convert_VkPipelineExecutablePropertiesKHR_array_win32_to_host(struct conversion_context *ctx, const VkPipelineExecutablePropertiesKHR32 *in, uint32_t count) -{ - VkPipelineExecutablePropertiesKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineExecutablePropertiesKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineExecutablePropertiesKHR_array_host_to_win32(const VkPipelineExecutablePropertiesKHR *in, VkPipelineExecutablePropertiesKHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkPipelineExecutablePropertiesKHR_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPipelineExecutableStatisticValueKHR_host_to_win32(const VkPipelineExecutableStatisticValueKHR *in, VkPipelineExecutableStatisticValueKHR32 *out, VkFlags selector) -{ - if (!in) return; - - if (selector == VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_BOOL32_KHR) - out->b32 = in->b32; - if (selector == VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_INT64_KHR) - out->i64 = in->i64; - if (selector == VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_UINT64_KHR) - out->u64 = in->u64; - if (selector == VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_FLOAT64_KHR) - out->f64 = in->f64; -} - -static inline void convert_VkPipelineExecutableStatisticKHR_win32_to_host(const VkPipelineExecutableStatisticKHR32 *in, VkPipelineExecutableStatisticKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineExecutableStatisticKHR_host_to_win32(const VkPipelineExecutableStatisticKHR *in, VkPipelineExecutableStatisticKHR32 *out) -{ - if (!in) return; - - memcpy(out->name, in->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - memcpy(out->description, in->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char)); - out->format = in->format; - convert_VkPipelineExecutableStatisticValueKHR_host_to_win32(&in->value, &out->value, in->format); -} - -static inline VkPipelineExecutableStatisticKHR *convert_VkPipelineExecutableStatisticKHR_array_win32_to_host(struct conversion_context *ctx, const VkPipelineExecutableStatisticKHR32 *in, uint32_t count) -{ - VkPipelineExecutableStatisticKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPipelineExecutableStatisticKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPipelineExecutableStatisticKHR_array_host_to_win32(const VkPipelineExecutableStatisticKHR *in, VkPipelineExecutableStatisticKHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkPipelineExecutableStatisticKHR_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkPipelineIndirectDeviceAddressInfoNV_win32_to_host(const VkPipelineIndirectDeviceAddressInfoNV32 *in, VkPipelineIndirectDeviceAddressInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pipelineBindPoint = in->pipelineBindPoint; - out->pipeline = in->pipeline; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPipelineInfoEXT_win32_to_host(const VkPipelineInfoEXT32 *in, VkPipelineInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pipeline = in->pipeline; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCheckpointData2NV_win32_to_host(const VkCheckpointData2NV32 *in, VkCheckpointData2NV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCheckpointData2NV_host_to_win32(const VkCheckpointData2NV *in, VkCheckpointData2NV32 *out) -{ - if (!in) return; - - out->stage = in->stage; - out->pCheckpointMarker = PtrToUlong(in->pCheckpointMarker); -} - -static inline VkCheckpointData2NV *convert_VkCheckpointData2NV_array_win32_to_host(struct conversion_context *ctx, const VkCheckpointData2NV32 *in, uint32_t count) -{ - VkCheckpointData2NV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCheckpointData2NV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCheckpointData2NV_array_host_to_win32(const VkCheckpointData2NV *in, VkCheckpointData2NV32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkCheckpointData2NV_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkCheckpointDataNV_win32_to_host(const VkCheckpointDataNV32 *in, VkCheckpointDataNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCheckpointDataNV_host_to_win32(const VkCheckpointDataNV *in, VkCheckpointDataNV32 *out) -{ - if (!in) return; - - out->stage = in->stage; - out->pCheckpointMarker = PtrToUlong(in->pCheckpointMarker); -} - -static inline VkCheckpointDataNV *convert_VkCheckpointDataNV_array_win32_to_host(struct conversion_context *ctx, const VkCheckpointDataNV32 *in, uint32_t count) -{ - VkCheckpointDataNV *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCheckpointDataNV_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkCheckpointDataNV_array_host_to_win32(const VkCheckpointDataNV *in, VkCheckpointDataNV32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkCheckpointDataNV_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkRenderingAreaInfo_win32_to_host(const VkRenderingAreaInfo32 *in, VkRenderingAreaInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->viewMask = in->viewMask; - out->colorAttachmentCount = in->colorAttachmentCount; - out->pColorAttachmentFormats = UlongToPtr(in->pColorAttachmentFormats); - out->depthAttachmentFormat = in->depthAttachmentFormat; - out->stencilAttachmentFormat = in->stencilAttachmentFormat; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkSamplerCaptureDescriptorDataInfoEXT_win32_to_host(const VkSamplerCaptureDescriptorDataInfoEXT32 *in, VkSamplerCaptureDescriptorDataInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->sampler = in->sampler; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkShaderModuleIdentifierEXT_win32_to_host(const VkShaderModuleIdentifierEXT32 *in, VkShaderModuleIdentifierEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkShaderModuleIdentifierEXT_host_to_win32(const VkShaderModuleIdentifierEXT *in, VkShaderModuleIdentifierEXT32 *out) -{ - if (!in) return; - - out->identifierSize = in->identifierSize; - memcpy(out->identifier, in->identifier, VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT * sizeof(uint8_t)); -} - -static inline void convert_VkVideoSessionMemoryRequirementsKHR_win32_to_host(const VkVideoSessionMemoryRequirementsKHR32 *in, VkVideoSessionMemoryRequirementsKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkVideoSessionMemoryRequirementsKHR_host_to_win32(const VkVideoSessionMemoryRequirementsKHR *in, VkVideoSessionMemoryRequirementsKHR32 *out) -{ - if (!in) return; - - out->memoryBindIndex = in->memoryBindIndex; - convert_VkMemoryRequirements_host_to_win32(&in->memoryRequirements, &out->memoryRequirements); -} - -static inline VkVideoSessionMemoryRequirementsKHR *convert_VkVideoSessionMemoryRequirementsKHR_array_win32_to_host(struct conversion_context *ctx, const VkVideoSessionMemoryRequirementsKHR32 *in, uint32_t count) -{ - VkVideoSessionMemoryRequirementsKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkVideoSessionMemoryRequirementsKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkVideoSessionMemoryRequirementsKHR_array_host_to_win32(const VkVideoSessionMemoryRequirementsKHR *in, VkVideoSessionMemoryRequirementsKHR32 *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - convert_VkVideoSessionMemoryRequirementsKHR_host_to_win32(&in[i], &out[i]); - } -} - -static inline void convert_VkInitializePerformanceApiInfoINTEL_win32_to_host(const VkInitializePerformanceApiInfoINTEL32 *in, VkInitializePerformanceApiInfoINTEL *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pUserData = UlongToPtr(in->pUserData); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkLatencySleepInfoNV_win32_to_host(const VkLatencySleepInfoNV32 *in, VkLatencySleepInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->signalSemaphore = in->signalSemaphore; - out->value = in->value; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline void convert_VkMemoryMapInfo_win64_to_host(const VkMemoryMapInfo *in, VkMemoryMapInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->flags = in->flags; - out->memory = wine_device_memory_from_handle(in->memory)->host.device_memory; - out->offset = in->offset; - out->size = in->size; -} -#endif /* _WIN64 */ - -static inline void convert_VkMemoryMapInfo_win32_to_host(struct conversion_context *ctx, const VkMemoryMapInfo32 *in, VkMemoryMapInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->memory = wine_device_memory_from_handle(in->memory)->host.device_memory; - out->offset = in->offset; - out->size = in->size; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_MEMORY_MAP_PLACED_INFO_EXT: - { - VkMemoryMapPlacedInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMemoryMapPlacedInfoEXT32 *in_ext = (const VkMemoryMapPlacedInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MEMORY_MAP_PLACED_INFO_EXT; - out_ext->pNext = NULL; - out_ext->pPlacedAddress = UlongToPtr(in_ext->pPlacedAddress); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkMemoryMapInfo_win32_to_unwrapped_host(struct conversion_context *ctx, const VkMemoryMapInfo32 *in, VkMemoryMapInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->memory = in->memory; - out->offset = in->offset; - out->size = in->size; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_MEMORY_MAP_PLACED_INFO_EXT: - { - VkMemoryMapPlacedInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkMemoryMapPlacedInfoEXT32 *in_ext = (const VkMemoryMapPlacedInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_MEMORY_MAP_PLACED_INFO_EXT; - out_ext->pNext = NULL; - out_ext->pPlacedAddress = UlongToPtr(in_ext->pPlacedAddress); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline void convert_VkSparseMemoryBind_win64_to_host(const VkSparseMemoryBind *in, VkSparseMemoryBind *out) -{ - if (!in) return; - - out->resourceOffset = in->resourceOffset; - out->size = in->size; - out->memory = in->memory ? wine_device_memory_from_handle(in->memory)->host.device_memory : 0; - out->memoryOffset = in->memoryOffset; - out->flags = in->flags; -} -#endif /* _WIN64 */ - -static inline void convert_VkSparseMemoryBind_win32_to_host(const VkSparseMemoryBind32 *in, VkSparseMemoryBind *out) -{ - if (!in) return; - - out->resourceOffset = in->resourceOffset; - out->size = in->size; - out->memory = in->memory ? wine_device_memory_from_handle(in->memory)->host.device_memory : 0; - out->memoryOffset = in->memoryOffset; - out->flags = in->flags; -} - -#ifdef _WIN64 -static inline const VkSparseMemoryBind *convert_VkSparseMemoryBind_array_win64_to_host(struct conversion_context *ctx, const VkSparseMemoryBind *in, uint32_t count) -{ - VkSparseMemoryBind *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseMemoryBind_win64_to_host(&in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkSparseMemoryBind *convert_VkSparseMemoryBind_array_win32_to_host(struct conversion_context *ctx, const VkSparseMemoryBind32 *in, uint32_t count) -{ - VkSparseMemoryBind *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseMemoryBind_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkSparseBufferMemoryBindInfo_win64_to_host(struct conversion_context *ctx, const VkSparseBufferMemoryBindInfo *in, VkSparseBufferMemoryBindInfo *out) -{ - if (!in) return; - - out->buffer = in->buffer; - out->bindCount = in->bindCount; - out->pBinds = convert_VkSparseMemoryBind_array_win64_to_host(ctx, in->pBinds, in->bindCount); -} -#endif /* _WIN64 */ - -static inline void convert_VkSparseBufferMemoryBindInfo_win32_to_host(struct conversion_context *ctx, const VkSparseBufferMemoryBindInfo32 *in, VkSparseBufferMemoryBindInfo *out) -{ - if (!in) return; - - out->buffer = in->buffer; - out->bindCount = in->bindCount; - out->pBinds = convert_VkSparseMemoryBind_array_win32_to_host(ctx, (const VkSparseMemoryBind32 *)UlongToPtr(in->pBinds), in->bindCount); -} - -#ifdef _WIN64 -static inline const VkSparseBufferMemoryBindInfo *convert_VkSparseBufferMemoryBindInfo_array_win64_to_host(struct conversion_context *ctx, const VkSparseBufferMemoryBindInfo *in, uint32_t count) -{ - VkSparseBufferMemoryBindInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseBufferMemoryBindInfo_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkSparseBufferMemoryBindInfo *convert_VkSparseBufferMemoryBindInfo_array_win32_to_host(struct conversion_context *ctx, const VkSparseBufferMemoryBindInfo32 *in, uint32_t count) -{ - VkSparseBufferMemoryBindInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseBufferMemoryBindInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkSparseImageOpaqueMemoryBindInfo_win64_to_host(struct conversion_context *ctx, const VkSparseImageOpaqueMemoryBindInfo *in, VkSparseImageOpaqueMemoryBindInfo *out) -{ - if (!in) return; - - out->image = in->image; - out->bindCount = in->bindCount; - out->pBinds = convert_VkSparseMemoryBind_array_win64_to_host(ctx, in->pBinds, in->bindCount); -} -#endif /* _WIN64 */ - -static inline void convert_VkSparseImageOpaqueMemoryBindInfo_win32_to_host(struct conversion_context *ctx, const VkSparseImageOpaqueMemoryBindInfo32 *in, VkSparseImageOpaqueMemoryBindInfo *out) -{ - if (!in) return; - - out->image = in->image; - out->bindCount = in->bindCount; - out->pBinds = convert_VkSparseMemoryBind_array_win32_to_host(ctx, (const VkSparseMemoryBind32 *)UlongToPtr(in->pBinds), in->bindCount); -} - -#ifdef _WIN64 -static inline const VkSparseImageOpaqueMemoryBindInfo *convert_VkSparseImageOpaqueMemoryBindInfo_array_win64_to_host(struct conversion_context *ctx, const VkSparseImageOpaqueMemoryBindInfo *in, uint32_t count) -{ - VkSparseImageOpaqueMemoryBindInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseImageOpaqueMemoryBindInfo_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkSparseImageOpaqueMemoryBindInfo *convert_VkSparseImageOpaqueMemoryBindInfo_array_win32_to_host(struct conversion_context *ctx, const VkSparseImageOpaqueMemoryBindInfo32 *in, uint32_t count) -{ - VkSparseImageOpaqueMemoryBindInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseImageOpaqueMemoryBindInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkSparseImageMemoryBind_win64_to_host(const VkSparseImageMemoryBind *in, VkSparseImageMemoryBind *out) -{ - if (!in) return; - - out->subresource = in->subresource; - out->offset = in->offset; - out->extent = in->extent; - out->memory = in->memory ? wine_device_memory_from_handle(in->memory)->host.device_memory : 0; - out->memoryOffset = in->memoryOffset; - out->flags = in->flags; -} -#endif /* _WIN64 */ - -static inline void convert_VkSparseImageMemoryBind_win32_to_host(const VkSparseImageMemoryBind32 *in, VkSparseImageMemoryBind *out) -{ - if (!in) return; - - out->subresource = in->subresource; - out->offset = in->offset; - out->extent = in->extent; - out->memory = in->memory ? wine_device_memory_from_handle(in->memory)->host.device_memory : 0; - out->memoryOffset = in->memoryOffset; - out->flags = in->flags; -} - -#ifdef _WIN64 -static inline const VkSparseImageMemoryBind *convert_VkSparseImageMemoryBind_array_win64_to_host(struct conversion_context *ctx, const VkSparseImageMemoryBind *in, uint32_t count) -{ - VkSparseImageMemoryBind *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseImageMemoryBind_win64_to_host(&in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkSparseImageMemoryBind *convert_VkSparseImageMemoryBind_array_win32_to_host(struct conversion_context *ctx, const VkSparseImageMemoryBind32 *in, uint32_t count) -{ - VkSparseImageMemoryBind *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseImageMemoryBind_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkSparseImageMemoryBindInfo_win64_to_host(struct conversion_context *ctx, const VkSparseImageMemoryBindInfo *in, VkSparseImageMemoryBindInfo *out) -{ - if (!in) return; - - out->image = in->image; - out->bindCount = in->bindCount; - out->pBinds = convert_VkSparseImageMemoryBind_array_win64_to_host(ctx, in->pBinds, in->bindCount); -} -#endif /* _WIN64 */ - -static inline void convert_VkSparseImageMemoryBindInfo_win32_to_host(struct conversion_context *ctx, const VkSparseImageMemoryBindInfo32 *in, VkSparseImageMemoryBindInfo *out) -{ - if (!in) return; - - out->image = in->image; - out->bindCount = in->bindCount; - out->pBinds = convert_VkSparseImageMemoryBind_array_win32_to_host(ctx, (const VkSparseImageMemoryBind32 *)UlongToPtr(in->pBinds), in->bindCount); -} - -#ifdef _WIN64 -static inline const VkSparseImageMemoryBindInfo *convert_VkSparseImageMemoryBindInfo_array_win64_to_host(struct conversion_context *ctx, const VkSparseImageMemoryBindInfo *in, uint32_t count) -{ - VkSparseImageMemoryBindInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseImageMemoryBindInfo_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkSparseImageMemoryBindInfo *convert_VkSparseImageMemoryBindInfo_array_win32_to_host(struct conversion_context *ctx, const VkSparseImageMemoryBindInfo32 *in, uint32_t count) -{ - VkSparseImageMemoryBindInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSparseImageMemoryBindInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkBindSparseInfo_win64_to_host(struct conversion_context *ctx, const VkBindSparseInfo *in, VkBindSparseInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->waitSemaphoreCount = in->waitSemaphoreCount; - out->pWaitSemaphores = in->pWaitSemaphores; - out->bufferBindCount = in->bufferBindCount; - out->pBufferBinds = convert_VkSparseBufferMemoryBindInfo_array_win64_to_host(ctx, in->pBufferBinds, in->bufferBindCount); - out->imageOpaqueBindCount = in->imageOpaqueBindCount; - out->pImageOpaqueBinds = convert_VkSparseImageOpaqueMemoryBindInfo_array_win64_to_host(ctx, in->pImageOpaqueBinds, in->imageOpaqueBindCount); - out->imageBindCount = in->imageBindCount; - out->pImageBinds = convert_VkSparseImageMemoryBindInfo_array_win64_to_host(ctx, in->pImageBinds, in->imageBindCount); - out->signalSemaphoreCount = in->signalSemaphoreCount; - out->pSignalSemaphores = in->pSignalSemaphores; -} -#endif /* _WIN64 */ - -static inline void convert_VkBindSparseInfo_win32_to_host(struct conversion_context *ctx, const VkBindSparseInfo32 *in, VkBindSparseInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->waitSemaphoreCount = in->waitSemaphoreCount; - out->pWaitSemaphores = UlongToPtr(in->pWaitSemaphores); - out->bufferBindCount = in->bufferBindCount; - out->pBufferBinds = convert_VkSparseBufferMemoryBindInfo_array_win32_to_host(ctx, (const VkSparseBufferMemoryBindInfo32 *)UlongToPtr(in->pBufferBinds), in->bufferBindCount); - out->imageOpaqueBindCount = in->imageOpaqueBindCount; - out->pImageOpaqueBinds = convert_VkSparseImageOpaqueMemoryBindInfo_array_win32_to_host(ctx, (const VkSparseImageOpaqueMemoryBindInfo32 *)UlongToPtr(in->pImageOpaqueBinds), in->imageOpaqueBindCount); - out->imageBindCount = in->imageBindCount; - out->pImageBinds = convert_VkSparseImageMemoryBindInfo_array_win32_to_host(ctx, (const VkSparseImageMemoryBindInfo32 *)UlongToPtr(in->pImageBinds), in->imageBindCount); - out->signalSemaphoreCount = in->signalSemaphoreCount; - out->pSignalSemaphores = UlongToPtr(in->pSignalSemaphores); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO: - { - VkDeviceGroupBindSparseInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceGroupBindSparseInfo32 *in_ext = (const VkDeviceGroupBindSparseInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO; - out_ext->pNext = NULL; - out_ext->resourceDeviceIndex = in_ext->resourceDeviceIndex; - out_ext->memoryDeviceIndex = in_ext->memoryDeviceIndex; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO: - { - VkTimelineSemaphoreSubmitInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkTimelineSemaphoreSubmitInfo32 *in_ext = (const VkTimelineSemaphoreSubmitInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO; - out_ext->pNext = NULL; - out_ext->waitSemaphoreValueCount = in_ext->waitSemaphoreValueCount; - out_ext->pWaitSemaphoreValues = UlongToPtr(in_ext->pWaitSemaphoreValues); - out_ext->signalSemaphoreValueCount = in_ext->signalSemaphoreValueCount; - out_ext->pSignalSemaphoreValues = UlongToPtr(in_ext->pSignalSemaphoreValues); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT: - { - VkFrameBoundaryEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkFrameBoundaryEXT32 *in_ext = (const VkFrameBoundaryEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->frameID = in_ext->frameID; - out_ext->imageCount = in_ext->imageCount; - out_ext->pImages = UlongToPtr(in_ext->pImages); - out_ext->bufferCount = in_ext->bufferCount; - out_ext->pBuffers = UlongToPtr(in_ext->pBuffers); - out_ext->tagName = in_ext->tagName; - out_ext->tagSize = in_ext->tagSize; - out_ext->pTag = UlongToPtr(in_ext->pTag); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline const VkBindSparseInfo *convert_VkBindSparseInfo_array_win64_to_host(struct conversion_context *ctx, const VkBindSparseInfo *in, uint32_t count) -{ - VkBindSparseInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBindSparseInfo_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkBindSparseInfo *convert_VkBindSparseInfo_array_win32_to_host(struct conversion_context *ctx, const VkBindSparseInfo32 *in, uint32_t count) -{ - VkBindSparseInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkBindSparseInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkOutOfBandQueueTypeInfoNV_win32_to_host(const VkOutOfBandQueueTypeInfoNV32 *in, VkOutOfBandQueueTypeInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->queueType = in->queueType; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkPresentRegionKHR_win32_to_host(const VkPresentRegionKHR32 *in, VkPresentRegionKHR *out) -{ - if (!in) return; - - out->rectangleCount = in->rectangleCount; - out->pRectangles = UlongToPtr(in->pRectangles); -} - -static inline const VkPresentRegionKHR *convert_VkPresentRegionKHR_array_win32_to_host(struct conversion_context *ctx, const VkPresentRegionKHR32 *in, uint32_t count) -{ - VkPresentRegionKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkPresentRegionKHR_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkPresentInfoKHR_win32_to_unwrapped_host(struct conversion_context *ctx, const VkPresentInfoKHR32 *in, VkPresentInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->waitSemaphoreCount = in->waitSemaphoreCount; - out->pWaitSemaphores = UlongToPtr(in->pWaitSemaphores); - out->swapchainCount = in->swapchainCount; - out->pSwapchains = UlongToPtr(in->pSwapchains); - out->pImageIndices = UlongToPtr(in->pImageIndices); - out->pResults = UlongToPtr(in->pResults); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR: - { - VkPresentRegionsKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPresentRegionsKHR32 *in_ext = (const VkPresentRegionsKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR; - out_ext->pNext = NULL; - out_ext->swapchainCount = in_ext->swapchainCount; - out_ext->pRegions = convert_VkPresentRegionKHR_array_win32_to_host(ctx, (const VkPresentRegionKHR32 *)UlongToPtr(in_ext->pRegions), in_ext->swapchainCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR: - { - VkDeviceGroupPresentInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceGroupPresentInfoKHR32 *in_ext = (const VkDeviceGroupPresentInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR; - out_ext->pNext = NULL; - out_ext->swapchainCount = in_ext->swapchainCount; - out_ext->pDeviceMasks = UlongToPtr(in_ext->pDeviceMasks); - out_ext->mode = in_ext->mode; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PRESENT_ID_KHR: - { - VkPresentIdKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPresentIdKHR32 *in_ext = (const VkPresentIdKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PRESENT_ID_KHR; - out_ext->pNext = NULL; - out_ext->swapchainCount = in_ext->swapchainCount; - out_ext->pPresentIds = UlongToPtr(in_ext->pPresentIds); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT: - { - VkFrameBoundaryEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkFrameBoundaryEXT32 *in_ext = (const VkFrameBoundaryEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->frameID = in_ext->frameID; - out_ext->imageCount = in_ext->imageCount; - out_ext->pImages = UlongToPtr(in_ext->pImages); - out_ext->bufferCount = in_ext->bufferCount; - out_ext->pBuffers = UlongToPtr(in_ext->pBuffers); - out_ext->tagName = in_ext->tagName; - out_ext->tagSize = in_ext->tagSize; - out_ext->pTag = UlongToPtr(in_ext->pTag); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_FENCE_INFO_EXT: - { - VkSwapchainPresentFenceInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSwapchainPresentFenceInfoEXT32 *in_ext = (const VkSwapchainPresentFenceInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_FENCE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->swapchainCount = in_ext->swapchainCount; - out_ext->pFences = UlongToPtr(in_ext->pFences); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODE_INFO_EXT: - { - VkSwapchainPresentModeInfoEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSwapchainPresentModeInfoEXT32 *in_ext = (const VkSwapchainPresentModeInfoEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODE_INFO_EXT; - out_ext->pNext = NULL; - out_ext->swapchainCount = in_ext->swapchainCount; - out_ext->pPresentModes = UlongToPtr(in_ext->pPresentModes); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline void convert_VkSubmitInfo_win64_to_host(struct conversion_context *ctx, const VkSubmitInfo *in, VkSubmitInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->waitSemaphoreCount = in->waitSemaphoreCount; - out->pWaitSemaphores = in->pWaitSemaphores; - out->pWaitDstStageMask = in->pWaitDstStageMask; - out->commandBufferCount = in->commandBufferCount; - out->pCommandBuffers = convert_VkCommandBuffer_array_win64_to_host(ctx, in->pCommandBuffers, in->commandBufferCount); - out->signalSemaphoreCount = in->signalSemaphoreCount; - out->pSignalSemaphores = in->pSignalSemaphores; -} -#endif /* _WIN64 */ - -static inline void convert_VkSubmitInfo_win32_to_host(struct conversion_context *ctx, const VkSubmitInfo32 *in, VkSubmitInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->waitSemaphoreCount = in->waitSemaphoreCount; - out->pWaitSemaphores = UlongToPtr(in->pWaitSemaphores); - out->pWaitDstStageMask = UlongToPtr(in->pWaitDstStageMask); - out->commandBufferCount = in->commandBufferCount; - out->pCommandBuffers = convert_VkCommandBuffer_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(in->pCommandBuffers), in->commandBufferCount); - out->signalSemaphoreCount = in->signalSemaphoreCount; - out->pSignalSemaphores = UlongToPtr(in->pSignalSemaphores); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: - { - VkDeviceGroupSubmitInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceGroupSubmitInfo32 *in_ext = (const VkDeviceGroupSubmitInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO; - out_ext->pNext = NULL; - out_ext->waitSemaphoreCount = in_ext->waitSemaphoreCount; - out_ext->pWaitSemaphoreDeviceIndices = UlongToPtr(in_ext->pWaitSemaphoreDeviceIndices); - out_ext->commandBufferCount = in_ext->commandBufferCount; - out_ext->pCommandBufferDeviceMasks = UlongToPtr(in_ext->pCommandBufferDeviceMasks); - out_ext->signalSemaphoreCount = in_ext->signalSemaphoreCount; - out_ext->pSignalSemaphoreDeviceIndices = UlongToPtr(in_ext->pSignalSemaphoreDeviceIndices); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO: - { - VkProtectedSubmitInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkProtectedSubmitInfo32 *in_ext = (const VkProtectedSubmitInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO; - out_ext->pNext = NULL; - out_ext->protectedSubmit = in_ext->protectedSubmit; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO: - { - VkTimelineSemaphoreSubmitInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkTimelineSemaphoreSubmitInfo32 *in_ext = (const VkTimelineSemaphoreSubmitInfo32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO; - out_ext->pNext = NULL; - out_ext->waitSemaphoreValueCount = in_ext->waitSemaphoreValueCount; - out_ext->pWaitSemaphoreValues = UlongToPtr(in_ext->pWaitSemaphoreValues); - out_ext->signalSemaphoreValueCount = in_ext->signalSemaphoreValueCount; - out_ext->pSignalSemaphoreValues = UlongToPtr(in_ext->pSignalSemaphoreValues); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: - { - VkPerformanceQuerySubmitInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPerformanceQuerySubmitInfoKHR32 *in_ext = (const VkPerformanceQuerySubmitInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR; - out_ext->pNext = NULL; - out_ext->counterPassIndex = in_ext->counterPassIndex; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT: - { - VkFrameBoundaryEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkFrameBoundaryEXT32 *in_ext = (const VkFrameBoundaryEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->frameID = in_ext->frameID; - out_ext->imageCount = in_ext->imageCount; - out_ext->pImages = UlongToPtr(in_ext->pImages); - out_ext->bufferCount = in_ext->bufferCount; - out_ext->pBuffers = UlongToPtr(in_ext->pBuffers); - out_ext->tagName = in_ext->tagName; - out_ext->tagSize = in_ext->tagSize; - out_ext->pTag = UlongToPtr(in_ext->pTag); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV: - { - VkLatencySubmissionPresentIdNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkLatencySubmissionPresentIdNV32 *in_ext = (const VkLatencySubmissionPresentIdNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV; - out_ext->pNext = NULL; - out_ext->presentID = in_ext->presentID; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline const VkSubmitInfo *convert_VkSubmitInfo_array_win64_to_host(struct conversion_context *ctx, const VkSubmitInfo *in, uint32_t count) -{ - VkSubmitInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSubmitInfo_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkSubmitInfo *convert_VkSubmitInfo_array_win32_to_host(struct conversion_context *ctx, const VkSubmitInfo32 *in, uint32_t count) -{ - VkSubmitInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSubmitInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSemaphoreSubmitInfo_win32_to_host(const VkSemaphoreSubmitInfo32 *in, VkSemaphoreSubmitInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->semaphore = in->semaphore; - out->value = in->value; - out->stageMask = in->stageMask; - out->deviceIndex = in->deviceIndex; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkSemaphoreSubmitInfo *convert_VkSemaphoreSubmitInfo_array_win32_to_host(struct conversion_context *ctx, const VkSemaphoreSubmitInfo32 *in, uint32_t count) -{ - VkSemaphoreSubmitInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSemaphoreSubmitInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkCommandBufferSubmitInfo_win64_to_host(const VkCommandBufferSubmitInfo *in, VkCommandBufferSubmitInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->commandBuffer = wine_cmd_buffer_from_handle(in->commandBuffer)->host.command_buffer; - out->deviceMask = in->deviceMask; -} -#endif /* _WIN64 */ - -static inline void convert_VkCommandBufferSubmitInfo_win32_to_host(struct conversion_context *ctx, const VkCommandBufferSubmitInfo32 *in, VkCommandBufferSubmitInfo *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->commandBuffer = wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(in->commandBuffer))->host.command_buffer; - out->deviceMask = in->deviceMask; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_SUBMIT_INFO_ARM: - { - VkRenderPassStripeSubmitInfoARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkRenderPassStripeSubmitInfoARM32 *in_ext = (const VkRenderPassStripeSubmitInfoARM32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_SUBMIT_INFO_ARM; - out_ext->pNext = NULL; - out_ext->stripeSemaphoreInfoCount = in_ext->stripeSemaphoreInfoCount; - out_ext->pStripeSemaphoreInfos = convert_VkSemaphoreSubmitInfo_array_win32_to_host(ctx, (const VkSemaphoreSubmitInfo32 *)UlongToPtr(in_ext->pStripeSemaphoreInfos), in_ext->stripeSemaphoreInfoCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline const VkCommandBufferSubmitInfo *convert_VkCommandBufferSubmitInfo_array_win64_to_host(struct conversion_context *ctx, const VkCommandBufferSubmitInfo *in, uint32_t count) -{ - VkCommandBufferSubmitInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCommandBufferSubmitInfo_win64_to_host(&in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkCommandBufferSubmitInfo *convert_VkCommandBufferSubmitInfo_array_win32_to_host(struct conversion_context *ctx, const VkCommandBufferSubmitInfo32 *in, uint32_t count) -{ - VkCommandBufferSubmitInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCommandBufferSubmitInfo_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkSubmitInfo2_win64_to_host(struct conversion_context *ctx, const VkSubmitInfo2 *in, VkSubmitInfo2 *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->flags = in->flags; - out->waitSemaphoreInfoCount = in->waitSemaphoreInfoCount; - out->pWaitSemaphoreInfos = in->pWaitSemaphoreInfos; - out->commandBufferInfoCount = in->commandBufferInfoCount; - out->pCommandBufferInfos = convert_VkCommandBufferSubmitInfo_array_win64_to_host(ctx, in->pCommandBufferInfos, in->commandBufferInfoCount); - out->signalSemaphoreInfoCount = in->signalSemaphoreInfoCount; - out->pSignalSemaphoreInfos = in->pSignalSemaphoreInfos; -} -#endif /* _WIN64 */ - -static inline void convert_VkSubmitInfo2_win32_to_host(struct conversion_context *ctx, const VkSubmitInfo232 *in, VkSubmitInfo2 *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->waitSemaphoreInfoCount = in->waitSemaphoreInfoCount; - out->pWaitSemaphoreInfos = convert_VkSemaphoreSubmitInfo_array_win32_to_host(ctx, (const VkSemaphoreSubmitInfo32 *)UlongToPtr(in->pWaitSemaphoreInfos), in->waitSemaphoreInfoCount); - out->commandBufferInfoCount = in->commandBufferInfoCount; - out->pCommandBufferInfos = convert_VkCommandBufferSubmitInfo_array_win32_to_host(ctx, (const VkCommandBufferSubmitInfo32 *)UlongToPtr(in->pCommandBufferInfos), in->commandBufferInfoCount); - out->signalSemaphoreInfoCount = in->signalSemaphoreInfoCount; - out->pSignalSemaphoreInfos = convert_VkSemaphoreSubmitInfo_array_win32_to_host(ctx, (const VkSemaphoreSubmitInfo32 *)UlongToPtr(in->pSignalSemaphoreInfos), in->signalSemaphoreInfoCount); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: - { - VkPerformanceQuerySubmitInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkPerformanceQuerySubmitInfoKHR32 *in_ext = (const VkPerformanceQuerySubmitInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR; - out_ext->pNext = NULL; - out_ext->counterPassIndex = in_ext->counterPassIndex; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT: - { - VkFrameBoundaryEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkFrameBoundaryEXT32 *in_ext = (const VkFrameBoundaryEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->frameID = in_ext->frameID; - out_ext->imageCount = in_ext->imageCount; - out_ext->pImages = UlongToPtr(in_ext->pImages); - out_ext->bufferCount = in_ext->bufferCount; - out_ext->pBuffers = UlongToPtr(in_ext->pBuffers); - out_ext->tagName = in_ext->tagName; - out_ext->tagSize = in_ext->tagSize; - out_ext->pTag = UlongToPtr(in_ext->pTag); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV: - { - VkLatencySubmissionPresentIdNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkLatencySubmissionPresentIdNV32 *in_ext = (const VkLatencySubmissionPresentIdNV32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV; - out_ext->pNext = NULL; - out_ext->presentID = in_ext->presentID; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -#ifdef _WIN64 -static inline const VkSubmitInfo2 *convert_VkSubmitInfo2_array_win64_to_host(struct conversion_context *ctx, const VkSubmitInfo2 *in, uint32_t count) -{ - VkSubmitInfo2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSubmitInfo2_win64_to_host(ctx, &in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkSubmitInfo2 *convert_VkSubmitInfo2_array_win32_to_host(struct conversion_context *ctx, const VkSubmitInfo232 *in, uint32_t count) -{ - VkSubmitInfo2 *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkSubmitInfo2_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkReleaseCapturedPipelineDataInfoKHR_win32_to_host(const VkReleaseCapturedPipelineDataInfoKHR32 *in, VkReleaseCapturedPipelineDataInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->pipeline = in->pipeline; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline void convert_VkReleaseSwapchainImagesInfoEXT_win64_to_host(const VkReleaseSwapchainImagesInfoEXT *in, VkReleaseSwapchainImagesInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->swapchain = vulkan_swapchain_from_handle(in->swapchain)->host.swapchain; - out->imageIndexCount = in->imageIndexCount; - out->pImageIndices = in->pImageIndices; -} -#endif /* _WIN64 */ - -static inline void convert_VkReleaseSwapchainImagesInfoEXT_win32_to_host(const VkReleaseSwapchainImagesInfoEXT32 *in, VkReleaseSwapchainImagesInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->swapchain = vulkan_swapchain_from_handle(in->swapchain)->host.swapchain; - out->imageIndexCount = in->imageIndexCount; - out->pImageIndices = UlongToPtr(in->pImageIndices); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline void convert_VkDebugUtilsObjectNameInfoEXT_win64_to_host(const VkDebugUtilsObjectNameInfoEXT *in, VkDebugUtilsObjectNameInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->objectType = in->objectType; - out->objectHandle = wine_vk_unwrap_handle(in->objectType, in->objectHandle); - out->pObjectName = in->pObjectName; -} -#endif /* _WIN64 */ - -static inline void convert_VkDebugUtilsObjectNameInfoEXT_win32_to_host(const VkDebugUtilsObjectNameInfoEXT32 *in, VkDebugUtilsObjectNameInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->objectType = in->objectType; - out->objectHandle = wine_vk_unwrap_handle(in->objectType, in->objectHandle); - out->pObjectName = UlongToPtr(in->pObjectName); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline void convert_VkDebugUtilsObjectTagInfoEXT_win64_to_host(const VkDebugUtilsObjectTagInfoEXT *in, VkDebugUtilsObjectTagInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->objectType = in->objectType; - out->objectHandle = wine_vk_unwrap_handle(in->objectType, in->objectHandle); - out->tagName = in->tagName; - out->tagSize = in->tagSize; - out->pTag = in->pTag; -} -#endif /* _WIN64 */ - -static inline void convert_VkDebugUtilsObjectTagInfoEXT_win32_to_host(const VkDebugUtilsObjectTagInfoEXT32 *in, VkDebugUtilsObjectTagInfoEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->objectType = in->objectType; - out->objectHandle = wine_vk_unwrap_handle(in->objectType, in->objectHandle); - out->tagName = in->tagName; - out->tagSize = in->tagSize; - out->pTag = UlongToPtr(in->pTag); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static inline const VkSwapchainKHR *convert_VkSwapchainKHR_array_win64_to_host(struct conversion_context *ctx, const VkSwapchainKHR *in, uint32_t count) -{ - VkSwapchainKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = vulkan_swapchain_from_handle(in[i])->host.swapchain; - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkSwapchainKHR *convert_VkSwapchainKHR_array_win32_to_host(struct conversion_context *ctx, const VkSwapchainKHR *in, uint32_t count) -{ - VkSwapchainKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = vulkan_swapchain_from_handle(in[i])->host.swapchain; - } - - return out; -} - -static inline void convert_VkHdrMetadataEXT_win32_to_host(struct conversion_context *ctx, const VkHdrMetadataEXT32 *in, VkHdrMetadataEXT *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->displayPrimaryRed = in->displayPrimaryRed; - out->displayPrimaryGreen = in->displayPrimaryGreen; - out->displayPrimaryBlue = in->displayPrimaryBlue; - out->whitePoint = in->whitePoint; - out->maxLuminance = in->maxLuminance; - out->minLuminance = in->minLuminance; - out->maxContentLightLevel = in->maxContentLightLevel; - out->maxFrameAverageLightLevel = in->maxFrameAverageLightLevel; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_HDR_VIVID_DYNAMIC_METADATA_HUAWEI: - { - VkHdrVividDynamicMetadataHUAWEI *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkHdrVividDynamicMetadataHUAWEI32 *in_ext = (const VkHdrVividDynamicMetadataHUAWEI32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_HDR_VIVID_DYNAMIC_METADATA_HUAWEI; - out_ext->pNext = NULL; - out_ext->dynamicMetadataSize = in_ext->dynamicMetadataSize; - out_ext->pDynamicMetadata = UlongToPtr(in_ext->pDynamicMetadata); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline const VkHdrMetadataEXT *convert_VkHdrMetadataEXT_array_win32_to_host(struct conversion_context *ctx, const VkHdrMetadataEXT32 *in, uint32_t count) -{ - VkHdrMetadataEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkHdrMetadataEXT_win32_to_host(ctx, &in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkSetLatencyMarkerInfoNV_win32_to_host(const VkSetLatencyMarkerInfoNV32 *in, VkSetLatencyMarkerInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->presentID = in->presentID; - out->marker = in->marker; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkLatencySleepModeInfoNV_win32_to_host(const VkLatencySleepModeInfoNV32 *in, VkLatencySleepModeInfoNV *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->lowLatencyMode = in->lowLatencyMode; - out->lowLatencyBoost = in->lowLatencyBoost; - out->minimumIntervalUs = in->minimumIntervalUs; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkSemaphoreSignalInfo_win32_to_host(const VkSemaphoreSignalInfo32 *in, VkSemaphoreSignalInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->semaphore = in->semaphore; - out->value = in->value; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkDebugUtilsLabelEXT *convert_VkDebugUtilsLabelEXT_array_win32_to_host(struct conversion_context *ctx, const VkDebugUtilsLabelEXT32 *in, uint32_t count) -{ - VkDebugUtilsLabelEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDebugUtilsLabelEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline const VkDebugUtilsObjectNameInfoEXT *convert_VkDebugUtilsObjectNameInfoEXT_array_win64_to_host(struct conversion_context *ctx, const VkDebugUtilsObjectNameInfoEXT *in, uint32_t count) -{ - VkDebugUtilsObjectNameInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDebugUtilsObjectNameInfoEXT_win64_to_host(&in[i], &out[i]); - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkDebugUtilsObjectNameInfoEXT *convert_VkDebugUtilsObjectNameInfoEXT_array_win32_to_host(struct conversion_context *ctx, const VkDebugUtilsObjectNameInfoEXT32 *in, uint32_t count) -{ - VkDebugUtilsObjectNameInfoEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkDebugUtilsObjectNameInfoEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkDebugUtilsMessengerCallbackDataEXT_win64_to_host(struct conversion_context *ctx, const VkDebugUtilsMessengerCallbackDataEXT *in, VkDebugUtilsMessengerCallbackDataEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->flags = in->flags; - out->pMessageIdName = in->pMessageIdName; - out->messageIdNumber = in->messageIdNumber; - out->pMessage = in->pMessage; - out->queueLabelCount = in->queueLabelCount; - out->pQueueLabels = in->pQueueLabels; - out->cmdBufLabelCount = in->cmdBufLabelCount; - out->pCmdBufLabels = in->pCmdBufLabels; - out->objectCount = in->objectCount; - out->pObjects = convert_VkDebugUtilsObjectNameInfoEXT_array_win64_to_host(ctx, in->pObjects, in->objectCount); -} -#endif /* _WIN64 */ - -static inline void convert_VkDebugUtilsMessengerCallbackDataEXT_win32_to_host(struct conversion_context *ctx, const VkDebugUtilsMessengerCallbackDataEXT32 *in, VkDebugUtilsMessengerCallbackDataEXT *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->pMessageIdName = UlongToPtr(in->pMessageIdName); - out->messageIdNumber = in->messageIdNumber; - out->pMessage = UlongToPtr(in->pMessage); - out->queueLabelCount = in->queueLabelCount; - out->pQueueLabels = convert_VkDebugUtilsLabelEXT_array_win32_to_host(ctx, (const VkDebugUtilsLabelEXT32 *)UlongToPtr(in->pQueueLabels), in->queueLabelCount); - out->cmdBufLabelCount = in->cmdBufLabelCount; - out->pCmdBufLabels = convert_VkDebugUtilsLabelEXT_array_win32_to_host(ctx, (const VkDebugUtilsLabelEXT32 *)UlongToPtr(in->pCmdBufLabels), in->cmdBufLabelCount); - out->objectCount = in->objectCount; - out->pObjects = convert_VkDebugUtilsObjectNameInfoEXT_array_win32_to_host(ctx, (const VkDebugUtilsObjectNameInfoEXT32 *)UlongToPtr(in->pObjects), in->objectCount); - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_DEVICE_ADDRESS_BINDING_CALLBACK_DATA_EXT: - { - VkDeviceAddressBindingCallbackDataEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkDeviceAddressBindingCallbackDataEXT32 *in_ext = (const VkDeviceAddressBindingCallbackDataEXT32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_ADDRESS_BINDING_CALLBACK_DATA_EXT; - out_ext->pNext = NULL; - out_ext->flags = in_ext->flags; - out_ext->baseAddress = in_ext->baseAddress; - out_ext->size = in_ext->size; - out_ext->bindingType = in_ext->bindingType; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkHostImageLayoutTransitionInfo_win32_to_host(const VkHostImageLayoutTransitionInfo32 *in, VkHostImageLayoutTransitionInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->image = in->image; - out->oldLayout = in->oldLayout; - out->newLayout = in->newLayout; - out->subresourceRange = in->subresourceRange; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkHostImageLayoutTransitionInfo *convert_VkHostImageLayoutTransitionInfo_array_win32_to_host(struct conversion_context *ctx, const VkHostImageLayoutTransitionInfo32 *in, uint32_t count) -{ - VkHostImageLayoutTransitionInfo *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkHostImageLayoutTransitionInfo_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkMemoryUnmapInfo_win64_to_host(const VkMemoryUnmapInfo *in, VkMemoryUnmapInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->flags = in->flags; - out->memory = wine_device_memory_from_handle(in->memory)->host.device_memory; -} -#endif /* _WIN64 */ - -static inline void convert_VkMemoryUnmapInfo_win32_to_host(const VkMemoryUnmapInfo32 *in, VkMemoryUnmapInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->memory = wine_device_memory_from_handle(in->memory)->host.device_memory; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkMemoryUnmapInfo_win32_to_unwrapped_host(const VkMemoryUnmapInfo32 *in, VkMemoryUnmapInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->memory = in->memory; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline void convert_VkCopyDescriptorSet_win32_to_host(const VkCopyDescriptorSet32 *in, VkCopyDescriptorSet *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->srcSet = in->srcSet; - out->srcBinding = in->srcBinding; - out->srcArrayElement = in->srcArrayElement; - out->dstSet = in->dstSet; - out->dstBinding = in->dstBinding; - out->dstArrayElement = in->dstArrayElement; - out->descriptorCount = in->descriptorCount; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkCopyDescriptorSet *convert_VkCopyDescriptorSet_array_win32_to_host(struct conversion_context *ctx, const VkCopyDescriptorSet32 *in, uint32_t count) -{ - VkCopyDescriptorSet *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkCopyDescriptorSet_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkWriteIndirectExecutionSetPipelineEXT_win32_to_host(const VkWriteIndirectExecutionSetPipelineEXT32 *in, VkWriteIndirectExecutionSetPipelineEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->index = in->index; - out->pipeline = in->pipeline; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkWriteIndirectExecutionSetPipelineEXT *convert_VkWriteIndirectExecutionSetPipelineEXT_array_win32_to_host(struct conversion_context *ctx, const VkWriteIndirectExecutionSetPipelineEXT32 *in, uint32_t count) -{ - VkWriteIndirectExecutionSetPipelineEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkWriteIndirectExecutionSetPipelineEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkWriteIndirectExecutionSetShaderEXT_win32_to_host(const VkWriteIndirectExecutionSetShaderEXT32 *in, VkWriteIndirectExecutionSetShaderEXT *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->index = in->index; - out->shader = in->shader; - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -static inline const VkWriteIndirectExecutionSetShaderEXT *convert_VkWriteIndirectExecutionSetShaderEXT_array_win32_to_host(struct conversion_context *ctx, const VkWriteIndirectExecutionSetShaderEXT32 *in, uint32_t count) -{ - VkWriteIndirectExecutionSetShaderEXT *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - convert_VkWriteIndirectExecutionSetShaderEXT_win32_to_host(&in[i], &out[i]); - } - - return out; -} - -static inline void convert_VkVideoSessionParametersUpdateInfoKHR_win32_to_host(struct conversion_context *ctx, const VkVideoSessionParametersUpdateInfoKHR32 *in, VkVideoSessionParametersUpdateInfoKHR *out) -{ - const VkBaseInStructure32 *in_header; - VkBaseOutStructure *out_header = (void *)out; - - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->updateSequenceCount = in->updateSequenceCount; - - for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_KHR: - { - VkVideoDecodeH264SessionParametersAddInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeH264SessionParametersAddInfoKHR32 *in_ext = (const VkVideoDecodeH264SessionParametersAddInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_KHR; - out_ext->pNext = NULL; - out_ext->stdSPSCount = in_ext->stdSPSCount; - out_ext->pStdSPSs = convert_StdVideoH264SequenceParameterSet_array_win32_to_host(ctx, (const StdVideoH264SequenceParameterSet32 *)UlongToPtr(in_ext->pStdSPSs), in_ext->stdSPSCount); - out_ext->stdPPSCount = in_ext->stdPPSCount; - out_ext->pStdPPSs = convert_StdVideoH264PictureParameterSet_array_win32_to_host(ctx, (const StdVideoH264PictureParameterSet32 *)UlongToPtr(in_ext->pStdPPSs), in_ext->stdPPSCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR: - { - VkVideoDecodeH265SessionParametersAddInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoDecodeH265SessionParametersAddInfoKHR32 *in_ext = (const VkVideoDecodeH265SessionParametersAddInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR; - out_ext->pNext = NULL; - out_ext->stdVPSCount = in_ext->stdVPSCount; - out_ext->pStdVPSs = convert_StdVideoH265VideoParameterSet_array_win32_to_host(ctx, (const StdVideoH265VideoParameterSet32 *)UlongToPtr(in_ext->pStdVPSs), in_ext->stdVPSCount); - out_ext->stdSPSCount = in_ext->stdSPSCount; - out_ext->pStdSPSs = convert_StdVideoH265SequenceParameterSet_array_win32_to_host(ctx, (const StdVideoH265SequenceParameterSet32 *)UlongToPtr(in_ext->pStdSPSs), in_ext->stdSPSCount); - out_ext->stdPPSCount = in_ext->stdPPSCount; - out_ext->pStdPPSs = convert_StdVideoH265PictureParameterSet_array_win32_to_host(ctx, (const StdVideoH265PictureParameterSet32 *)UlongToPtr(in_ext->pStdPPSs), in_ext->stdPPSCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_KHR: - { - VkVideoEncodeH264SessionParametersAddInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH264SessionParametersAddInfoKHR32 *in_ext = (const VkVideoEncodeH264SessionParametersAddInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_KHR; - out_ext->pNext = NULL; - out_ext->stdSPSCount = in_ext->stdSPSCount; - out_ext->pStdSPSs = convert_StdVideoH264SequenceParameterSet_array_win32_to_host(ctx, (const StdVideoH264SequenceParameterSet32 *)UlongToPtr(in_ext->pStdSPSs), in_ext->stdSPSCount); - out_ext->stdPPSCount = in_ext->stdPPSCount; - out_ext->pStdPPSs = convert_StdVideoH264PictureParameterSet_array_win32_to_host(ctx, (const StdVideoH264PictureParameterSet32 *)UlongToPtr(in_ext->pStdPPSs), in_ext->stdPPSCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR: - { - VkVideoEncodeH265SessionParametersAddInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkVideoEncodeH265SessionParametersAddInfoKHR32 *in_ext = (const VkVideoEncodeH265SessionParametersAddInfoKHR32 *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR; - out_ext->pNext = NULL; - out_ext->stdVPSCount = in_ext->stdVPSCount; - out_ext->pStdVPSs = convert_StdVideoH265VideoParameterSet_array_win32_to_host(ctx, (const StdVideoH265VideoParameterSet32 *)UlongToPtr(in_ext->pStdVPSs), in_ext->stdVPSCount); - out_ext->stdSPSCount = in_ext->stdSPSCount; - out_ext->pStdSPSs = convert_StdVideoH265SequenceParameterSet_array_win32_to_host(ctx, (const StdVideoH265SequenceParameterSet32 *)UlongToPtr(in_ext->pStdSPSs), in_ext->stdSPSCount); - out_ext->stdPPSCount = in_ext->stdPPSCount; - out_ext->pStdPPSs = convert_StdVideoH265PictureParameterSet_array_win32_to_host(ctx, (const StdVideoH265PictureParameterSet32 *)UlongToPtr(in_ext->pStdPPSs), in_ext->stdPPSCount); - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } -} - -static inline void convert_VkSemaphoreWaitInfo_win32_to_host(const VkSemaphoreWaitInfo32 *in, VkSemaphoreWaitInfo *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = NULL; - out->flags = in->flags; - out->semaphoreCount = in->semaphoreCount; - out->pSemaphores = UlongToPtr(in->pSemaphores); - out->pValues = UlongToPtr(in->pValues); - if (in->pNext) - FIXME("Unexpected pNext\n"); -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkAcquireNextImage2KHR(void *args) -{ - struct vkAcquireNextImage2KHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pAcquireInfo, params->pImageIndex); - - params->result = vk_funcs->p_vkAcquireNextImage2KHR(params->device, params->pAcquireInfo, params->pImageIndex); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkAcquireNextImage2KHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pAcquireInfo; - PTR32 pImageIndex; - VkResult result; - } *params = args; - VkAcquireNextImageInfoKHR pAcquireInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pAcquireInfo, params->pImageIndex); - - convert_VkAcquireNextImageInfoKHR_win32_to_unwrapped_host((const VkAcquireNextImageInfoKHR32 *)UlongToPtr(params->pAcquireInfo), &pAcquireInfo_host); - params->result = vk_funcs->p_vkAcquireNextImage2KHR((VkDevice)UlongToPtr(params->device), &pAcquireInfo_host, (uint32_t *)UlongToPtr(params->pImageIndex)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkAcquireNextImageKHR(void *args) -{ - struct vkAcquireNextImageKHR_params *params = args; - - TRACE("%p, 0x%s, 0x%s, 0x%s, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), wine_dbgstr_longlong(params->timeout), wine_dbgstr_longlong(params->semaphore), wine_dbgstr_longlong(params->fence), params->pImageIndex); - - params->result = vk_funcs->p_vkAcquireNextImageKHR(params->device, params->swapchain, params->timeout, params->semaphore, params->fence, params->pImageIndex); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkAcquireNextImageKHR(void *args) -{ - struct - { - PTR32 device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - VkFence DECLSPEC_ALIGN(8) fence; - PTR32 pImageIndex; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, 0x%s, 0x%s, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), wine_dbgstr_longlong(params->timeout), wine_dbgstr_longlong(params->semaphore), wine_dbgstr_longlong(params->fence), params->pImageIndex); - - params->result = vk_funcs->p_vkAcquireNextImageKHR((VkDevice)UlongToPtr(params->device), params->swapchain, params->timeout, params->semaphore, params->fence, (uint32_t *)UlongToPtr(params->pImageIndex)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkAcquirePerformanceConfigurationINTEL(void *args) -{ - struct vkAcquirePerformanceConfigurationINTEL_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pAcquireInfo, params->pConfiguration); - - params->result = vulkan_device_from_handle(params->device)->p_vkAcquirePerformanceConfigurationINTEL(vulkan_device_from_handle(params->device)->host.device, params->pAcquireInfo, params->pConfiguration); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkAcquirePerformanceConfigurationINTEL(void *args) -{ - struct - { - PTR32 device; - PTR32 pAcquireInfo; - PTR32 pConfiguration; - VkResult result; - } *params = args; - VkPerformanceConfigurationAcquireInfoINTEL pAcquireInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pAcquireInfo, params->pConfiguration); - - convert_VkPerformanceConfigurationAcquireInfoINTEL_win32_to_host((const VkPerformanceConfigurationAcquireInfoINTEL32 *)UlongToPtr(params->pAcquireInfo), &pAcquireInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkAcquirePerformanceConfigurationINTEL(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pAcquireInfo_host, (VkPerformanceConfigurationINTEL *)UlongToPtr(params->pConfiguration)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkAcquireProfilingLockKHR(void *args) -{ - struct vkAcquireProfilingLockKHR_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkAcquireProfilingLockKHR(vulkan_device_from_handle(params->device)->host.device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkAcquireProfilingLockKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - VkResult result; - } *params = args; - VkAcquireProfilingLockInfoKHR pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkAcquireProfilingLockInfoKHR_win32_to_host((const VkAcquireProfilingLockInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkAcquireProfilingLockKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkAllocateCommandBuffers(void *args) -{ - struct vkAllocateCommandBuffers_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pAllocateInfo, params->pCommandBuffers); - - params->result = wine_vkAllocateCommandBuffers(params->device, params->pAllocateInfo, params->pCommandBuffers); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkAllocateCommandBuffers(void *args) -{ - struct - { - PTR32 device; - PTR32 pAllocateInfo; - PTR32 pCommandBuffers; - VkResult result; - } *params = args; - VkCommandBufferAllocateInfo pAllocateInfo_host; - VkCommandBuffer *pCommandBuffers_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pAllocateInfo, params->pCommandBuffers); - - init_conversion_context(ctx); - convert_VkCommandBufferAllocateInfo_win32_to_unwrapped_host((const VkCommandBufferAllocateInfo32 *)UlongToPtr(params->pAllocateInfo), &pAllocateInfo_host); - pCommandBuffers_host = convert_VkCommandBuffer_array_win32_to_unwrapped_host(ctx, (PTR32 *)UlongToPtr(params->pCommandBuffers), ((const VkCommandBufferAllocateInfo32 *)UlongToPtr(params->pAllocateInfo))->commandBufferCount); - params->result = wine_vkAllocateCommandBuffers((VkDevice)UlongToPtr(params->device), &pAllocateInfo_host, pCommandBuffers_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkAllocateDescriptorSets(void *args) -{ - struct vkAllocateDescriptorSets_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pAllocateInfo, params->pDescriptorSets); - - params->result = vulkan_device_from_handle(params->device)->p_vkAllocateDescriptorSets(vulkan_device_from_handle(params->device)->host.device, params->pAllocateInfo, params->pDescriptorSets); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkAllocateDescriptorSets(void *args) -{ - struct - { - PTR32 device; - PTR32 pAllocateInfo; - PTR32 pDescriptorSets; - VkResult result; - } *params = args; - VkDescriptorSetAllocateInfo pAllocateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pAllocateInfo, params->pDescriptorSets); - - init_conversion_context(ctx); - convert_VkDescriptorSetAllocateInfo_win32_to_host(ctx, (const VkDescriptorSetAllocateInfo32 *)UlongToPtr(params->pAllocateInfo), &pAllocateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkAllocateDescriptorSets(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pAllocateInfo_host, (VkDescriptorSet *)UlongToPtr(params->pDescriptorSets)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkAllocateMemory(void *args) -{ - struct vkAllocateMemory_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pAllocateInfo, params->pAllocator, params->pMemory); - - params->result = wine_vkAllocateMemory(params->device, params->pAllocateInfo, params->pAllocator, params->pMemory); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkAllocateMemory(void *args) -{ - struct - { - PTR32 device; - PTR32 pAllocateInfo; - PTR32 pAllocator; - PTR32 pMemory; - VkResult result; - } *params = args; - VkMemoryAllocateInfo pAllocateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pAllocateInfo, params->pAllocator, params->pMemory); - - init_conversion_context(ctx); - convert_VkMemoryAllocateInfo_win32_to_host(ctx, (const VkMemoryAllocateInfo32 *)UlongToPtr(params->pAllocateInfo), &pAllocateInfo_host); - params->result = wine_vkAllocateMemory((VkDevice)UlongToPtr(params->device), &pAllocateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkDeviceMemory *)UlongToPtr(params->pMemory)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkAntiLagUpdateAMD(void *args) -{ - struct vkAntiLagUpdateAMD_params *params = args; - - TRACE("%p, %p\n", params->device, params->pData); - - vulkan_device_from_handle(params->device)->p_vkAntiLagUpdateAMD(vulkan_device_from_handle(params->device)->host.device, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkAntiLagUpdateAMD(void *args) -{ - struct - { - PTR32 device; - PTR32 pData; - } *params = args; - VkAntiLagDataAMD pData_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->device, params->pData); - - init_conversion_context(ctx); - convert_VkAntiLagDataAMD_win32_to_host(ctx, (const VkAntiLagDataAMD32 *)UlongToPtr(params->pData), &pData_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkAntiLagUpdateAMD(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pData_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBeginCommandBuffer(void *args) -{ - struct vkBeginCommandBuffer_params *params = args; - - TRACE("%p, %p\n", params->commandBuffer, params->pBeginInfo); - - params->result = wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkBeginCommandBuffer(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pBeginInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBeginCommandBuffer(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pBeginInfo; - VkResult result; - } *params = args; - VkCommandBufferBeginInfo pBeginInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->commandBuffer, params->pBeginInfo); - - init_conversion_context(ctx); - convert_VkCommandBufferBeginInfo_win32_to_host(ctx, (const VkCommandBufferBeginInfo32 *)UlongToPtr(params->pBeginInfo), &pBeginInfo_host); - params->result = wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkBeginCommandBuffer(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pBeginInfo_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBindAccelerationStructureMemoryNV(void *args) -{ - struct vkBindAccelerationStructureMemoryNV_params *params = args; - const VkBindAccelerationStructureMemoryInfoNV *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindAccelerationStructureMemoryInfoNV_array_win64_to_host(ctx, params->pBindInfos, params->bindInfoCount); - params->result = vulkan_device_from_handle(params->device)->p_vkBindAccelerationStructureMemoryNV(vulkan_device_from_handle(params->device)->host.device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBindAccelerationStructureMemoryNV(void *args) -{ - struct - { - PTR32 device; - uint32_t bindInfoCount; - PTR32 pBindInfos; - VkResult result; - } *params = args; - const VkBindAccelerationStructureMemoryInfoNV *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindAccelerationStructureMemoryInfoNV_array_win32_to_host(ctx, (const VkBindAccelerationStructureMemoryInfoNV32 *)UlongToPtr(params->pBindInfos), params->bindInfoCount); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkBindAccelerationStructureMemoryNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBindBufferMemory(void *args) -{ - struct vkBindBufferMemory_params *params = args; - - TRACE("%p, 0x%s, 0x%s, 0x%s\n", params->device, wine_dbgstr_longlong(params->buffer), wine_dbgstr_longlong(params->memory), wine_dbgstr_longlong(params->memoryOffset)); - - params->result = vulkan_device_from_handle(params->device)->p_vkBindBufferMemory(vulkan_device_from_handle(params->device)->host.device, params->buffer, wine_device_memory_from_handle(params->memory)->host.device_memory, params->memoryOffset); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBindBufferMemory(void *args) -{ - struct - { - PTR32 device; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, 0x%s, 0x%s\n", params->device, wine_dbgstr_longlong(params->buffer), wine_dbgstr_longlong(params->memory), wine_dbgstr_longlong(params->memoryOffset)); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkBindBufferMemory(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->buffer, wine_device_memory_from_handle(params->memory)->host.device_memory, params->memoryOffset); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBindBufferMemory2(void *args) -{ - struct vkBindBufferMemory2_params *params = args; - const VkBindBufferMemoryInfo *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindBufferMemoryInfo_array_win64_to_host(ctx, params->pBindInfos, params->bindInfoCount); - params->result = vulkan_device_from_handle(params->device)->p_vkBindBufferMemory2(vulkan_device_from_handle(params->device)->host.device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBindBufferMemory2(void *args) -{ - struct - { - PTR32 device; - uint32_t bindInfoCount; - PTR32 pBindInfos; - VkResult result; - } *params = args; - const VkBindBufferMemoryInfo *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindBufferMemoryInfo_array_win32_to_host(ctx, (const VkBindBufferMemoryInfo32 *)UlongToPtr(params->pBindInfos), params->bindInfoCount); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkBindBufferMemory2(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBindBufferMemory2KHR(void *args) -{ - struct vkBindBufferMemory2KHR_params *params = args; - const VkBindBufferMemoryInfo *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindBufferMemoryInfo_array_win64_to_host(ctx, params->pBindInfos, params->bindInfoCount); - params->result = vulkan_device_from_handle(params->device)->p_vkBindBufferMemory2KHR(vulkan_device_from_handle(params->device)->host.device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBindBufferMemory2KHR(void *args) -{ - struct - { - PTR32 device; - uint32_t bindInfoCount; - PTR32 pBindInfos; - VkResult result; - } *params = args; - const VkBindBufferMemoryInfo *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindBufferMemoryInfo_array_win32_to_host(ctx, (const VkBindBufferMemoryInfo32 *)UlongToPtr(params->pBindInfos), params->bindInfoCount); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkBindBufferMemory2KHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBindImageMemory(void *args) -{ - struct vkBindImageMemory_params *params = args; - - TRACE("%p, 0x%s, 0x%s, 0x%s\n", params->device, wine_dbgstr_longlong(params->image), wine_dbgstr_longlong(params->memory), wine_dbgstr_longlong(params->memoryOffset)); - - params->result = vulkan_device_from_handle(params->device)->p_vkBindImageMemory(vulkan_device_from_handle(params->device)->host.device, params->image, wine_device_memory_from_handle(params->memory)->host.device_memory, params->memoryOffset); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBindImageMemory(void *args) -{ - struct - { - PTR32 device; - VkImage DECLSPEC_ALIGN(8) image; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) memoryOffset; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, 0x%s, 0x%s\n", params->device, wine_dbgstr_longlong(params->image), wine_dbgstr_longlong(params->memory), wine_dbgstr_longlong(params->memoryOffset)); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkBindImageMemory(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->image, wine_device_memory_from_handle(params->memory)->host.device_memory, params->memoryOffset); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBindImageMemory2(void *args) -{ - struct vkBindImageMemory2_params *params = args; - const VkBindImageMemoryInfo *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindImageMemoryInfo_array_win64_to_host(ctx, params->pBindInfos, params->bindInfoCount); - params->result = vulkan_device_from_handle(params->device)->p_vkBindImageMemory2(vulkan_device_from_handle(params->device)->host.device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBindImageMemory2(void *args) -{ - struct - { - PTR32 device; - uint32_t bindInfoCount; - PTR32 pBindInfos; - VkResult result; - } *params = args; - const VkBindImageMemoryInfo *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindImageMemoryInfo_array_win32_to_host(ctx, (const VkBindImageMemoryInfo32 *)UlongToPtr(params->pBindInfos), params->bindInfoCount); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkBindImageMemory2(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBindImageMemory2KHR(void *args) -{ - struct vkBindImageMemory2KHR_params *params = args; - const VkBindImageMemoryInfo *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindImageMemoryInfo_array_win64_to_host(ctx, params->pBindInfos, params->bindInfoCount); - params->result = vulkan_device_from_handle(params->device)->p_vkBindImageMemory2KHR(vulkan_device_from_handle(params->device)->host.device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBindImageMemory2KHR(void *args) -{ - struct - { - PTR32 device; - uint32_t bindInfoCount; - PTR32 pBindInfos; - VkResult result; - } *params = args; - const VkBindImageMemoryInfo *pBindInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x\n", params->device, params->bindInfoCount, params->pBindInfos); - - init_conversion_context(ctx); - pBindInfos_host = convert_VkBindImageMemoryInfo_array_win32_to_host(ctx, (const VkBindImageMemoryInfo32 *)UlongToPtr(params->pBindInfos), params->bindInfoCount); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkBindImageMemory2KHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->bindInfoCount, pBindInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBindOpticalFlowSessionImageNV(void *args) -{ - struct vkBindOpticalFlowSessionImageNV_params *params = args; - - TRACE("%p, 0x%s, %#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->session), params->bindingPoint, wine_dbgstr_longlong(params->view), params->layout); - - params->result = vulkan_device_from_handle(params->device)->p_vkBindOpticalFlowSessionImageNV(vulkan_device_from_handle(params->device)->host.device, params->session, params->bindingPoint, params->view, params->layout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBindOpticalFlowSessionImageNV(void *args) -{ - struct - { - PTR32 device; - VkOpticalFlowSessionNV DECLSPEC_ALIGN(8) session; - VkOpticalFlowSessionBindingPointNV bindingPoint; - VkImageView DECLSPEC_ALIGN(8) view; - VkImageLayout layout; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->session), params->bindingPoint, wine_dbgstr_longlong(params->view), params->layout); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkBindOpticalFlowSessionImageNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->session, params->bindingPoint, params->view, params->layout); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBindVideoSessionMemoryKHR(void *args) -{ - struct vkBindVideoSessionMemoryKHR_params *params = args; - const VkBindVideoSessionMemoryInfoKHR *pBindSessionMemoryInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, 0x%s, %u, %p\n", params->device, wine_dbgstr_longlong(params->videoSession), params->bindSessionMemoryInfoCount, params->pBindSessionMemoryInfos); - - init_conversion_context(ctx); - pBindSessionMemoryInfos_host = convert_VkBindVideoSessionMemoryInfoKHR_array_win64_to_host(ctx, params->pBindSessionMemoryInfos, params->bindSessionMemoryInfoCount); - params->result = vulkan_device_from_handle(params->device)->p_vkBindVideoSessionMemoryKHR(vulkan_device_from_handle(params->device)->host.device, params->videoSession, params->bindSessionMemoryInfoCount, pBindSessionMemoryInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBindVideoSessionMemoryKHR(void *args) -{ - struct - { - PTR32 device; - VkVideoSessionKHR DECLSPEC_ALIGN(8) videoSession; - uint32_t bindSessionMemoryInfoCount; - PTR32 pBindSessionMemoryInfos; - VkResult result; - } *params = args; - const VkBindVideoSessionMemoryInfoKHR *pBindSessionMemoryInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->videoSession), params->bindSessionMemoryInfoCount, params->pBindSessionMemoryInfos); - - init_conversion_context(ctx); - pBindSessionMemoryInfos_host = convert_VkBindVideoSessionMemoryInfoKHR_array_win32_to_host(ctx, (const VkBindVideoSessionMemoryInfoKHR32 *)UlongToPtr(params->pBindSessionMemoryInfos), params->bindSessionMemoryInfoCount); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkBindVideoSessionMemoryKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->videoSession, params->bindSessionMemoryInfoCount, pBindSessionMemoryInfos_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBuildAccelerationStructuresKHR(void *args) -{ - struct vkBuildAccelerationStructuresKHR_params *params = args; - - TRACE("%p, 0x%s, %u, %p, %p\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->infoCount, params->pInfos, params->ppBuildRangeInfos); - - params->result = vulkan_device_from_handle(params->device)->p_vkBuildAccelerationStructuresKHR(vulkan_device_from_handle(params->device)->host.device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host.deferred_operation : 0, params->infoCount, params->pInfos, params->ppBuildRangeInfos); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBuildAccelerationStructuresKHR(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - uint32_t infoCount; - PTR32 pInfos; - PTR32 ppBuildRangeInfos; - VkResult result; - } *params = args; - const VkAccelerationStructureBuildGeometryInfoKHR *pInfos_host; - const VkAccelerationStructureBuildRangeInfoKHR* const *ppBuildRangeInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %u, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->infoCount, params->pInfos, params->ppBuildRangeInfos); - - if (params->deferredOperation == VK_NULL_HANDLE) - init_conversion_context(ctx); - else - ctx = &wine_deferred_operation_from_handle(params->deferredOperation)->ctx; - pInfos_host = convert_VkAccelerationStructureBuildGeometryInfoKHR_array_win32_to_host(ctx, (const VkAccelerationStructureBuildGeometryInfoKHR32 *)UlongToPtr(params->pInfos), params->infoCount); - ppBuildRangeInfos_host = convert_VkAccelerationStructureBuildRangeInfoKHR_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(params->ppBuildRangeInfos), params->infoCount); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkBuildAccelerationStructuresKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host.deferred_operation : 0, params->infoCount, pInfos_host, ppBuildRangeInfos_host); - if (params->deferredOperation == VK_NULL_HANDLE) - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkBuildMicromapsEXT(void *args) -{ - struct vkBuildMicromapsEXT_params *params = args; - - TRACE("%p, 0x%s, %u, %p\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->infoCount, params->pInfos); - - params->result = vulkan_device_from_handle(params->device)->p_vkBuildMicromapsEXT(vulkan_device_from_handle(params->device)->host.device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host.deferred_operation : 0, params->infoCount, params->pInfos); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkBuildMicromapsEXT(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - uint32_t infoCount; - PTR32 pInfos; - VkResult result; - } *params = args; - const VkMicromapBuildInfoEXT *pInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->infoCount, params->pInfos); - - if (params->deferredOperation == VK_NULL_HANDLE) - init_conversion_context(ctx); - else - ctx = &wine_deferred_operation_from_handle(params->deferredOperation)->ctx; - pInfos_host = convert_VkMicromapBuildInfoEXT_array_win32_to_host(ctx, (const VkMicromapBuildInfoEXT32 *)UlongToPtr(params->pInfos), params->infoCount); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkBuildMicromapsEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host.deferred_operation : 0, params->infoCount, pInfos_host); - if (params->deferredOperation == VK_NULL_HANDLE) - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginConditionalRenderingEXT(void *args) -{ - struct vkCmdBeginConditionalRenderingEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBeginConditionalRenderingEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pConditionalRenderingBegin); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginConditionalRenderingEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pConditionalRenderingBegin; - } *params = args; - VkConditionalRenderingBeginInfoEXT pConditionalRenderingBegin_host; - - convert_VkConditionalRenderingBeginInfoEXT_win32_to_host((const VkConditionalRenderingBeginInfoEXT32 *)UlongToPtr(params->pConditionalRenderingBegin), &pConditionalRenderingBegin_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBeginConditionalRenderingEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pConditionalRenderingBegin_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginDebugUtilsLabelEXT(void *args) -{ - struct vkCmdBeginDebugUtilsLabelEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBeginDebugUtilsLabelEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pLabelInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginDebugUtilsLabelEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pLabelInfo; - } *params = args; - VkDebugUtilsLabelEXT pLabelInfo_host; - - convert_VkDebugUtilsLabelEXT_win32_to_host((const VkDebugUtilsLabelEXT32 *)UlongToPtr(params->pLabelInfo), &pLabelInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBeginDebugUtilsLabelEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pLabelInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginQuery(void *args) -{ - struct vkCmdBeginQuery_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBeginQuery(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->queryPool, params->query, params->flags); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginQuery(void *args) -{ - struct - { - PTR32 commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - VkQueryControlFlags flags; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBeginQuery(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->queryPool, params->query, params->flags); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginQueryIndexedEXT(void *args) -{ - struct vkCmdBeginQueryIndexedEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBeginQueryIndexedEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->queryPool, params->query, params->flags, params->index); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginQueryIndexedEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - VkQueryControlFlags flags; - uint32_t index; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBeginQueryIndexedEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->queryPool, params->query, params->flags, params->index); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginRenderPass(void *args) -{ - struct vkCmdBeginRenderPass_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBeginRenderPass(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pRenderPassBegin, params->contents); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginRenderPass(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pRenderPassBegin; - VkSubpassContents contents; - } *params = args; - VkRenderPassBeginInfo pRenderPassBegin_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkRenderPassBeginInfo_win32_to_host(ctx, (const VkRenderPassBeginInfo32 *)UlongToPtr(params->pRenderPassBegin), &pRenderPassBegin_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBeginRenderPass(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pRenderPassBegin_host, params->contents); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginRenderPass2(void *args) -{ - struct vkCmdBeginRenderPass2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBeginRenderPass2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pRenderPassBegin, params->pSubpassBeginInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginRenderPass2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pRenderPassBegin; - PTR32 pSubpassBeginInfo; - } *params = args; - VkRenderPassBeginInfo pRenderPassBegin_host; - VkSubpassBeginInfo pSubpassBeginInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkRenderPassBeginInfo_win32_to_host(ctx, (const VkRenderPassBeginInfo32 *)UlongToPtr(params->pRenderPassBegin), &pRenderPassBegin_host); - convert_VkSubpassBeginInfo_win32_to_host((const VkSubpassBeginInfo32 *)UlongToPtr(params->pSubpassBeginInfo), &pSubpassBeginInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBeginRenderPass2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pRenderPassBegin_host, &pSubpassBeginInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginRenderPass2KHR(void *args) -{ - struct vkCmdBeginRenderPass2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBeginRenderPass2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pRenderPassBegin, params->pSubpassBeginInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginRenderPass2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pRenderPassBegin; - PTR32 pSubpassBeginInfo; - } *params = args; - VkRenderPassBeginInfo pRenderPassBegin_host; - VkSubpassBeginInfo pSubpassBeginInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkRenderPassBeginInfo_win32_to_host(ctx, (const VkRenderPassBeginInfo32 *)UlongToPtr(params->pRenderPassBegin), &pRenderPassBegin_host); - convert_VkSubpassBeginInfo_win32_to_host((const VkSubpassBeginInfo32 *)UlongToPtr(params->pSubpassBeginInfo), &pSubpassBeginInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBeginRenderPass2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pRenderPassBegin_host, &pSubpassBeginInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginRendering(void *args) -{ - struct vkCmdBeginRendering_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBeginRendering(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pRenderingInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginRendering(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pRenderingInfo; - } *params = args; - VkRenderingInfo pRenderingInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkRenderingInfo_win32_to_host(ctx, (const VkRenderingInfo32 *)UlongToPtr(params->pRenderingInfo), &pRenderingInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBeginRendering(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pRenderingInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginRenderingKHR(void *args) -{ - struct vkCmdBeginRenderingKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBeginRenderingKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pRenderingInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginRenderingKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pRenderingInfo; - } *params = args; - VkRenderingInfo pRenderingInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkRenderingInfo_win32_to_host(ctx, (const VkRenderingInfo32 *)UlongToPtr(params->pRenderingInfo), &pRenderingInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBeginRenderingKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pRenderingInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginTransformFeedbackEXT(void *args) -{ - struct vkCmdBeginTransformFeedbackEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBeginTransformFeedbackEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->firstCounterBuffer, params->counterBufferCount, params->pCounterBuffers, params->pCounterBufferOffsets); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginTransformFeedbackEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstCounterBuffer; - uint32_t counterBufferCount; - PTR32 pCounterBuffers; - PTR32 pCounterBufferOffsets; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBeginTransformFeedbackEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->firstCounterBuffer, params->counterBufferCount, (const VkBuffer *)UlongToPtr(params->pCounterBuffers), (const VkDeviceSize *)UlongToPtr(params->pCounterBufferOffsets)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBeginVideoCodingKHR(void *args) -{ - struct vkCmdBeginVideoCodingKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBeginVideoCodingKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pBeginInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBeginVideoCodingKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pBeginInfo; - } *params = args; - VkVideoBeginCodingInfoKHR pBeginInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkVideoBeginCodingInfoKHR_win32_to_host(ctx, (const VkVideoBeginCodingInfoKHR32 *)UlongToPtr(params->pBeginInfo), &pBeginInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBeginVideoCodingKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pBeginInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindDescriptorBufferEmbeddedSamplers2EXT(void *args) -{ - struct vkCmdBindDescriptorBufferEmbeddedSamplers2EXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBindDescriptorBufferEmbeddedSamplers2EXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pBindDescriptorBufferEmbeddedSamplersInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindDescriptorBufferEmbeddedSamplers2EXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pBindDescriptorBufferEmbeddedSamplersInfo; - } *params = args; - VkBindDescriptorBufferEmbeddedSamplersInfoEXT pBindDescriptorBufferEmbeddedSamplersInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkBindDescriptorBufferEmbeddedSamplersInfoEXT_win32_to_host(ctx, (const VkBindDescriptorBufferEmbeddedSamplersInfoEXT32 *)UlongToPtr(params->pBindDescriptorBufferEmbeddedSamplersInfo), &pBindDescriptorBufferEmbeddedSamplersInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBindDescriptorBufferEmbeddedSamplers2EXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pBindDescriptorBufferEmbeddedSamplersInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindDescriptorBufferEmbeddedSamplersEXT(void *args) -{ - struct vkCmdBindDescriptorBufferEmbeddedSamplersEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBindDescriptorBufferEmbeddedSamplersEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pipelineBindPoint, params->layout, params->set); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindDescriptorBufferEmbeddedSamplersEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBindDescriptorBufferEmbeddedSamplersEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->pipelineBindPoint, params->layout, params->set); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindDescriptorBuffersEXT(void *args) -{ - struct vkCmdBindDescriptorBuffersEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBindDescriptorBuffersEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->bufferCount, params->pBindingInfos); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindDescriptorBuffersEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t bufferCount; - PTR32 pBindingInfos; - } *params = args; - const VkDescriptorBufferBindingInfoEXT *pBindingInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pBindingInfos_host = convert_VkDescriptorBufferBindingInfoEXT_array_win32_to_host(ctx, (const VkDescriptorBufferBindingInfoEXT32 *)UlongToPtr(params->pBindingInfos), params->bufferCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBindDescriptorBuffersEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->bufferCount, pBindingInfos_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindDescriptorSets(void *args) -{ - struct vkCmdBindDescriptorSets_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBindDescriptorSets(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pipelineBindPoint, params->layout, params->firstSet, params->descriptorSetCount, params->pDescriptorSets, params->dynamicOffsetCount, params->pDynamicOffsets); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindDescriptorSets(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t firstSet; - uint32_t descriptorSetCount; - PTR32 pDescriptorSets; - uint32_t dynamicOffsetCount; - PTR32 pDynamicOffsets; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBindDescriptorSets(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->pipelineBindPoint, params->layout, params->firstSet, params->descriptorSetCount, (const VkDescriptorSet *)UlongToPtr(params->pDescriptorSets), params->dynamicOffsetCount, (const uint32_t *)UlongToPtr(params->pDynamicOffsets)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindDescriptorSets2(void *args) -{ - struct vkCmdBindDescriptorSets2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBindDescriptorSets2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pBindDescriptorSetsInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindDescriptorSets2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pBindDescriptorSetsInfo; - } *params = args; - VkBindDescriptorSetsInfo pBindDescriptorSetsInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkBindDescriptorSetsInfo_win32_to_host(ctx, (const VkBindDescriptorSetsInfo32 *)UlongToPtr(params->pBindDescriptorSetsInfo), &pBindDescriptorSetsInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBindDescriptorSets2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pBindDescriptorSetsInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindDescriptorSets2KHR(void *args) -{ - struct vkCmdBindDescriptorSets2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBindDescriptorSets2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pBindDescriptorSetsInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindDescriptorSets2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pBindDescriptorSetsInfo; - } *params = args; - VkBindDescriptorSetsInfo pBindDescriptorSetsInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkBindDescriptorSetsInfo_win32_to_host(ctx, (const VkBindDescriptorSetsInfo32 *)UlongToPtr(params->pBindDescriptorSetsInfo), &pBindDescriptorSetsInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBindDescriptorSets2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pBindDescriptorSetsInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindIndexBuffer(void *args) -{ - struct vkCmdBindIndexBuffer_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBindIndexBuffer(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->buffer, params->offset, params->indexType); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindIndexBuffer(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkIndexType indexType; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBindIndexBuffer(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->buffer, params->offset, params->indexType); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindIndexBuffer2(void *args) -{ - struct vkCmdBindIndexBuffer2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBindIndexBuffer2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->buffer, params->offset, params->size, params->indexType); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindIndexBuffer2(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkIndexType indexType; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBindIndexBuffer2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->buffer, params->offset, params->size, params->indexType); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindIndexBuffer2KHR(void *args) -{ - struct vkCmdBindIndexBuffer2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBindIndexBuffer2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->buffer, params->offset, params->size, params->indexType); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindIndexBuffer2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkIndexType indexType; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBindIndexBuffer2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->buffer, params->offset, params->size, params->indexType); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindInvocationMaskHUAWEI(void *args) -{ - struct vkCmdBindInvocationMaskHUAWEI_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBindInvocationMaskHUAWEI(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->imageView, params->imageLayout); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindInvocationMaskHUAWEI(void *args) -{ - struct - { - PTR32 commandBuffer; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkImageLayout imageLayout; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBindInvocationMaskHUAWEI(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->imageView, params->imageLayout); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindPipeline(void *args) -{ - struct vkCmdBindPipeline_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBindPipeline(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pipelineBindPoint, params->pipeline); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindPipeline(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBindPipeline(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->pipelineBindPoint, params->pipeline); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindPipelineShaderGroupNV(void *args) -{ - struct vkCmdBindPipelineShaderGroupNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBindPipelineShaderGroupNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pipelineBindPoint, params->pipeline, params->groupIndex); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindPipelineShaderGroupNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t groupIndex; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBindPipelineShaderGroupNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->pipelineBindPoint, params->pipeline, params->groupIndex); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindShadersEXT(void *args) -{ - struct vkCmdBindShadersEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBindShadersEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->stageCount, params->pStages, params->pShaders); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindShadersEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t stageCount; - PTR32 pStages; - PTR32 pShaders; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBindShadersEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->stageCount, (const VkShaderStageFlagBits *)UlongToPtr(params->pStages), (const VkShaderEXT *)UlongToPtr(params->pShaders)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindShadingRateImageNV(void *args) -{ - struct vkCmdBindShadingRateImageNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBindShadingRateImageNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->imageView, params->imageLayout); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindShadingRateImageNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkImageView DECLSPEC_ALIGN(8) imageView; - VkImageLayout imageLayout; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBindShadingRateImageNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->imageView, params->imageLayout); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindTransformFeedbackBuffersEXT(void *args) -{ - struct vkCmdBindTransformFeedbackBuffersEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBindTransformFeedbackBuffersEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->firstBinding, params->bindingCount, params->pBuffers, params->pOffsets, params->pSizes); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindTransformFeedbackBuffersEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstBinding; - uint32_t bindingCount; - PTR32 pBuffers; - PTR32 pOffsets; - PTR32 pSizes; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBindTransformFeedbackBuffersEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->firstBinding, params->bindingCount, (const VkBuffer *)UlongToPtr(params->pBuffers), (const VkDeviceSize *)UlongToPtr(params->pOffsets), (const VkDeviceSize *)UlongToPtr(params->pSizes)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindVertexBuffers(void *args) -{ - struct vkCmdBindVertexBuffers_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBindVertexBuffers(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->firstBinding, params->bindingCount, params->pBuffers, params->pOffsets); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindVertexBuffers(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstBinding; - uint32_t bindingCount; - PTR32 pBuffers; - PTR32 pOffsets; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBindVertexBuffers(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->firstBinding, params->bindingCount, (const VkBuffer *)UlongToPtr(params->pBuffers), (const VkDeviceSize *)UlongToPtr(params->pOffsets)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindVertexBuffers2(void *args) -{ - struct vkCmdBindVertexBuffers2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBindVertexBuffers2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->firstBinding, params->bindingCount, params->pBuffers, params->pOffsets, params->pSizes, params->pStrides); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindVertexBuffers2(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstBinding; - uint32_t bindingCount; - PTR32 pBuffers; - PTR32 pOffsets; - PTR32 pSizes; - PTR32 pStrides; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBindVertexBuffers2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->firstBinding, params->bindingCount, (const VkBuffer *)UlongToPtr(params->pBuffers), (const VkDeviceSize *)UlongToPtr(params->pOffsets), (const VkDeviceSize *)UlongToPtr(params->pSizes), (const VkDeviceSize *)UlongToPtr(params->pStrides)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBindVertexBuffers2EXT(void *args) -{ - struct vkCmdBindVertexBuffers2EXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBindVertexBuffers2EXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->firstBinding, params->bindingCount, params->pBuffers, params->pOffsets, params->pSizes, params->pStrides); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBindVertexBuffers2EXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstBinding; - uint32_t bindingCount; - PTR32 pBuffers; - PTR32 pOffsets; - PTR32 pSizes; - PTR32 pStrides; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBindVertexBuffers2EXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->firstBinding, params->bindingCount, (const VkBuffer *)UlongToPtr(params->pBuffers), (const VkDeviceSize *)UlongToPtr(params->pOffsets), (const VkDeviceSize *)UlongToPtr(params->pSizes), (const VkDeviceSize *)UlongToPtr(params->pStrides)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBlitImage(void *args) -{ - struct vkCmdBlitImage_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBlitImage(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->srcImage, params->srcImageLayout, params->dstImage, params->dstImageLayout, params->regionCount, params->pRegions, params->filter); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBlitImage(void *args) -{ - struct - { - PTR32 commandBuffer; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; - VkFilter filter; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBlitImage(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->srcImage, params->srcImageLayout, params->dstImage, params->dstImageLayout, params->regionCount, (const VkImageBlit *)UlongToPtr(params->pRegions), params->filter); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBlitImage2(void *args) -{ - struct vkCmdBlitImage2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBlitImage2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pBlitImageInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBlitImage2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pBlitImageInfo; - } *params = args; - VkBlitImageInfo2 pBlitImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkBlitImageInfo2_win32_to_host(ctx, (const VkBlitImageInfo232 *)UlongToPtr(params->pBlitImageInfo), &pBlitImageInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBlitImage2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pBlitImageInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBlitImage2KHR(void *args) -{ - struct vkCmdBlitImage2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBlitImage2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pBlitImageInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBlitImage2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pBlitImageInfo; - } *params = args; - VkBlitImageInfo2 pBlitImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkBlitImageInfo2_win32_to_host(ctx, (const VkBlitImageInfo232 *)UlongToPtr(params->pBlitImageInfo), &pBlitImageInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBlitImage2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pBlitImageInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBuildAccelerationStructureNV(void *args) -{ - struct vkCmdBuildAccelerationStructureNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBuildAccelerationStructureNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pInfo, params->instanceData, params->instanceOffset, params->update, params->dst, params->src, params->scratch, params->scratchOffset); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBuildAccelerationStructureNV(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pInfo; - VkBuffer DECLSPEC_ALIGN(8) instanceData; - VkDeviceSize DECLSPEC_ALIGN(8) instanceOffset; - VkBool32 update; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) dst; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) src; - VkBuffer DECLSPEC_ALIGN(8) scratch; - VkDeviceSize DECLSPEC_ALIGN(8) scratchOffset; - } *params = args; - VkAccelerationStructureInfoNV pInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkAccelerationStructureInfoNV_win32_to_host(ctx, (const VkAccelerationStructureInfoNV32 *)UlongToPtr(params->pInfo), &pInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBuildAccelerationStructureNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pInfo_host, params->instanceData, params->instanceOffset, params->update, params->dst, params->src, params->scratch, params->scratchOffset); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBuildAccelerationStructuresIndirectKHR(void *args) -{ - struct vkCmdBuildAccelerationStructuresIndirectKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBuildAccelerationStructuresIndirectKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->infoCount, params->pInfos, params->pIndirectDeviceAddresses, params->pIndirectStrides, params->ppMaxPrimitiveCounts); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBuildAccelerationStructuresIndirectKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t infoCount; - PTR32 pInfos; - PTR32 pIndirectDeviceAddresses; - PTR32 pIndirectStrides; - PTR32 ppMaxPrimitiveCounts; - } *params = args; - const VkAccelerationStructureBuildGeometryInfoKHR *pInfos_host; - const uint32_t* const *ppMaxPrimitiveCounts_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pInfos_host = convert_VkAccelerationStructureBuildGeometryInfoKHR_array_win32_to_host(ctx, (const VkAccelerationStructureBuildGeometryInfoKHR32 *)UlongToPtr(params->pInfos), params->infoCount); - ppMaxPrimitiveCounts_host = convert_uint32_t_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(params->ppMaxPrimitiveCounts), params->infoCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBuildAccelerationStructuresIndirectKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->infoCount, pInfos_host, (const VkDeviceAddress *)UlongToPtr(params->pIndirectDeviceAddresses), (const uint32_t *)UlongToPtr(params->pIndirectStrides), ppMaxPrimitiveCounts_host); - convert_uint32_t_array_host_to_win32(ppMaxPrimitiveCounts_host, (PTR32 *)UlongToPtr(params->ppMaxPrimitiveCounts), params->infoCount); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBuildAccelerationStructuresKHR(void *args) -{ - struct vkCmdBuildAccelerationStructuresKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBuildAccelerationStructuresKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->infoCount, params->pInfos, params->ppBuildRangeInfos); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBuildAccelerationStructuresKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t infoCount; - PTR32 pInfos; - PTR32 ppBuildRangeInfos; - } *params = args; - const VkAccelerationStructureBuildGeometryInfoKHR *pInfos_host; - const VkAccelerationStructureBuildRangeInfoKHR* const *ppBuildRangeInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pInfos_host = convert_VkAccelerationStructureBuildGeometryInfoKHR_array_win32_to_host(ctx, (const VkAccelerationStructureBuildGeometryInfoKHR32 *)UlongToPtr(params->pInfos), params->infoCount); - ppBuildRangeInfos_host = convert_VkAccelerationStructureBuildRangeInfoKHR_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(params->ppBuildRangeInfos), params->infoCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBuildAccelerationStructuresKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->infoCount, pInfos_host, ppBuildRangeInfos_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdBuildMicromapsEXT(void *args) -{ - struct vkCmdBuildMicromapsEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdBuildMicromapsEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->infoCount, params->pInfos); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdBuildMicromapsEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t infoCount; - PTR32 pInfos; - } *params = args; - const VkMicromapBuildInfoEXT *pInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pInfos_host = convert_VkMicromapBuildInfoEXT_array_win32_to_host(ctx, (const VkMicromapBuildInfoEXT32 *)UlongToPtr(params->pInfos), params->infoCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdBuildMicromapsEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->infoCount, pInfos_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdClearAttachments(void *args) -{ - struct vkCmdClearAttachments_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdClearAttachments(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->attachmentCount, params->pAttachments, params->rectCount, params->pRects); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdClearAttachments(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t attachmentCount; - PTR32 pAttachments; - uint32_t rectCount; - PTR32 pRects; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdClearAttachments(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->attachmentCount, (const VkClearAttachment *)UlongToPtr(params->pAttachments), params->rectCount, (const VkClearRect *)UlongToPtr(params->pRects)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdClearColorImage(void *args) -{ - struct vkCmdClearColorImage_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdClearColorImage(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->image, params->imageLayout, params->pColor, params->rangeCount, params->pRanges); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdClearColorImage(void *args) -{ - struct - { - PTR32 commandBuffer; - VkImage DECLSPEC_ALIGN(8) image; - VkImageLayout imageLayout; - PTR32 pColor; - uint32_t rangeCount; - PTR32 pRanges; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdClearColorImage(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->image, params->imageLayout, (const VkClearColorValue *)UlongToPtr(params->pColor), params->rangeCount, (const VkImageSubresourceRange *)UlongToPtr(params->pRanges)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdClearDepthStencilImage(void *args) -{ - struct vkCmdClearDepthStencilImage_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdClearDepthStencilImage(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->image, params->imageLayout, params->pDepthStencil, params->rangeCount, params->pRanges); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdClearDepthStencilImage(void *args) -{ - struct - { - PTR32 commandBuffer; - VkImage DECLSPEC_ALIGN(8) image; - VkImageLayout imageLayout; - PTR32 pDepthStencil; - uint32_t rangeCount; - PTR32 pRanges; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdClearDepthStencilImage(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->image, params->imageLayout, (const VkClearDepthStencilValue *)UlongToPtr(params->pDepthStencil), params->rangeCount, (const VkImageSubresourceRange *)UlongToPtr(params->pRanges)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdControlVideoCodingKHR(void *args) -{ - struct vkCmdControlVideoCodingKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdControlVideoCodingKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pCodingControlInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdControlVideoCodingKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCodingControlInfo; - } *params = args; - VkVideoCodingControlInfoKHR pCodingControlInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkVideoCodingControlInfoKHR_win32_to_host(ctx, (const VkVideoCodingControlInfoKHR32 *)UlongToPtr(params->pCodingControlInfo), &pCodingControlInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdControlVideoCodingKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pCodingControlInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyAccelerationStructureKHR(void *args) -{ - struct vkCmdCopyAccelerationStructureKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyAccelerationStructureKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyAccelerationStructureKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pInfo; - } *params = args; - VkCopyAccelerationStructureInfoKHR pInfo_host; - - convert_VkCopyAccelerationStructureInfoKHR_win32_to_host((const VkCopyAccelerationStructureInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyAccelerationStructureKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyAccelerationStructureNV(void *args) -{ - struct vkCmdCopyAccelerationStructureNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyAccelerationStructureNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->dst, params->src, params->mode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyAccelerationStructureNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) dst; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) src; - VkCopyAccelerationStructureModeKHR mode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyAccelerationStructureNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->dst, params->src, params->mode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyAccelerationStructureToMemoryKHR(void *args) -{ - struct vkCmdCopyAccelerationStructureToMemoryKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyAccelerationStructureToMemoryKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyAccelerationStructureToMemoryKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pInfo; - } *params = args; - VkCopyAccelerationStructureToMemoryInfoKHR pInfo_host; - - convert_VkCopyAccelerationStructureToMemoryInfoKHR_win32_to_host((const VkCopyAccelerationStructureToMemoryInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyAccelerationStructureToMemoryKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyBuffer(void *args) -{ - struct vkCmdCopyBuffer_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyBuffer(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->srcBuffer, params->dstBuffer, params->regionCount, params->pRegions); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyBuffer(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) srcBuffer; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - uint32_t regionCount; - PTR32 pRegions; - } *params = args; - const VkBufferCopy *pRegions_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pRegions_host = convert_VkBufferCopy_array_win32_to_host(ctx, (const VkBufferCopy32 *)UlongToPtr(params->pRegions), params->regionCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyBuffer(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->srcBuffer, params->dstBuffer, params->regionCount, pRegions_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyBuffer2(void *args) -{ - struct vkCmdCopyBuffer2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyBuffer2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pCopyBufferInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyBuffer2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCopyBufferInfo; - } *params = args; - VkCopyBufferInfo2 pCopyBufferInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkCopyBufferInfo2_win32_to_host(ctx, (const VkCopyBufferInfo232 *)UlongToPtr(params->pCopyBufferInfo), &pCopyBufferInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyBuffer2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pCopyBufferInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyBuffer2KHR(void *args) -{ - struct vkCmdCopyBuffer2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyBuffer2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pCopyBufferInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyBuffer2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCopyBufferInfo; - } *params = args; - VkCopyBufferInfo2 pCopyBufferInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkCopyBufferInfo2_win32_to_host(ctx, (const VkCopyBufferInfo232 *)UlongToPtr(params->pCopyBufferInfo), &pCopyBufferInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyBuffer2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pCopyBufferInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyBufferToImage(void *args) -{ - struct vkCmdCopyBufferToImage_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyBufferToImage(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->srcBuffer, params->dstImage, params->dstImageLayout, params->regionCount, params->pRegions); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyBufferToImage(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) srcBuffer; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; - } *params = args; - const VkBufferImageCopy *pRegions_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pRegions_host = convert_VkBufferImageCopy_array_win32_to_host(ctx, (const VkBufferImageCopy32 *)UlongToPtr(params->pRegions), params->regionCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyBufferToImage(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->srcBuffer, params->dstImage, params->dstImageLayout, params->regionCount, pRegions_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyBufferToImage2(void *args) -{ - struct vkCmdCopyBufferToImage2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyBufferToImage2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pCopyBufferToImageInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyBufferToImage2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCopyBufferToImageInfo; - } *params = args; - VkCopyBufferToImageInfo2 pCopyBufferToImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkCopyBufferToImageInfo2_win32_to_host(ctx, (const VkCopyBufferToImageInfo232 *)UlongToPtr(params->pCopyBufferToImageInfo), &pCopyBufferToImageInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyBufferToImage2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pCopyBufferToImageInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyBufferToImage2KHR(void *args) -{ - struct vkCmdCopyBufferToImage2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyBufferToImage2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pCopyBufferToImageInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyBufferToImage2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCopyBufferToImageInfo; - } *params = args; - VkCopyBufferToImageInfo2 pCopyBufferToImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkCopyBufferToImageInfo2_win32_to_host(ctx, (const VkCopyBufferToImageInfo232 *)UlongToPtr(params->pCopyBufferToImageInfo), &pCopyBufferToImageInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyBufferToImage2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pCopyBufferToImageInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyImage(void *args) -{ - struct vkCmdCopyImage_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyImage(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->srcImage, params->srcImageLayout, params->dstImage, params->dstImageLayout, params->regionCount, params->pRegions); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyImage(void *args) -{ - struct - { - PTR32 commandBuffer; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyImage(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->srcImage, params->srcImageLayout, params->dstImage, params->dstImageLayout, params->regionCount, (const VkImageCopy *)UlongToPtr(params->pRegions)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyImage2(void *args) -{ - struct vkCmdCopyImage2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyImage2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pCopyImageInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyImage2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCopyImageInfo; - } *params = args; - VkCopyImageInfo2 pCopyImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkCopyImageInfo2_win32_to_host(ctx, (const VkCopyImageInfo232 *)UlongToPtr(params->pCopyImageInfo), &pCopyImageInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyImage2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pCopyImageInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyImage2KHR(void *args) -{ - struct vkCmdCopyImage2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyImage2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pCopyImageInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyImage2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCopyImageInfo; - } *params = args; - VkCopyImageInfo2 pCopyImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkCopyImageInfo2_win32_to_host(ctx, (const VkCopyImageInfo232 *)UlongToPtr(params->pCopyImageInfo), &pCopyImageInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyImage2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pCopyImageInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyImageToBuffer(void *args) -{ - struct vkCmdCopyImageToBuffer_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyImageToBuffer(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->srcImage, params->srcImageLayout, params->dstBuffer, params->regionCount, params->pRegions); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyImageToBuffer(void *args) -{ - struct - { - PTR32 commandBuffer; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - uint32_t regionCount; - PTR32 pRegions; - } *params = args; - const VkBufferImageCopy *pRegions_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pRegions_host = convert_VkBufferImageCopy_array_win32_to_host(ctx, (const VkBufferImageCopy32 *)UlongToPtr(params->pRegions), params->regionCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyImageToBuffer(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->srcImage, params->srcImageLayout, params->dstBuffer, params->regionCount, pRegions_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyImageToBuffer2(void *args) -{ - struct vkCmdCopyImageToBuffer2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyImageToBuffer2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pCopyImageToBufferInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyImageToBuffer2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCopyImageToBufferInfo; - } *params = args; - VkCopyImageToBufferInfo2 pCopyImageToBufferInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkCopyImageToBufferInfo2_win32_to_host(ctx, (const VkCopyImageToBufferInfo232 *)UlongToPtr(params->pCopyImageToBufferInfo), &pCopyImageToBufferInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyImageToBuffer2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pCopyImageToBufferInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyImageToBuffer2KHR(void *args) -{ - struct vkCmdCopyImageToBuffer2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyImageToBuffer2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pCopyImageToBufferInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyImageToBuffer2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCopyImageToBufferInfo; - } *params = args; - VkCopyImageToBufferInfo2 pCopyImageToBufferInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkCopyImageToBufferInfo2_win32_to_host(ctx, (const VkCopyImageToBufferInfo232 *)UlongToPtr(params->pCopyImageToBufferInfo), &pCopyImageToBufferInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyImageToBuffer2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pCopyImageToBufferInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyMemoryIndirectNV(void *args) -{ - struct vkCmdCopyMemoryIndirectNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyMemoryIndirectNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->copyBufferAddress, params->copyCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyMemoryIndirectNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkDeviceAddress DECLSPEC_ALIGN(8) copyBufferAddress; - uint32_t copyCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyMemoryIndirectNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->copyBufferAddress, params->copyCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyMemoryToAccelerationStructureKHR(void *args) -{ - struct vkCmdCopyMemoryToAccelerationStructureKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyMemoryToAccelerationStructureKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyMemoryToAccelerationStructureKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pInfo; - } *params = args; - VkCopyMemoryToAccelerationStructureInfoKHR pInfo_host; - - convert_VkCopyMemoryToAccelerationStructureInfoKHR_win32_to_host((const VkCopyMemoryToAccelerationStructureInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyMemoryToAccelerationStructureKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyMemoryToImageIndirectNV(void *args) -{ - struct vkCmdCopyMemoryToImageIndirectNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyMemoryToImageIndirectNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->copyBufferAddress, params->copyCount, params->stride, params->dstImage, params->dstImageLayout, params->pImageSubresources); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyMemoryToImageIndirectNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkDeviceAddress DECLSPEC_ALIGN(8) copyBufferAddress; - uint32_t copyCount; - uint32_t stride; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - PTR32 pImageSubresources; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyMemoryToImageIndirectNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->copyBufferAddress, params->copyCount, params->stride, params->dstImage, params->dstImageLayout, (const VkImageSubresourceLayers *)UlongToPtr(params->pImageSubresources)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyMemoryToMicromapEXT(void *args) -{ - struct vkCmdCopyMemoryToMicromapEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyMemoryToMicromapEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyMemoryToMicromapEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pInfo; - } *params = args; - VkCopyMemoryToMicromapInfoEXT pInfo_host; - - convert_VkCopyMemoryToMicromapInfoEXT_win32_to_host((const VkCopyMemoryToMicromapInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyMemoryToMicromapEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyMicromapEXT(void *args) -{ - struct vkCmdCopyMicromapEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyMicromapEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyMicromapEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pInfo; - } *params = args; - VkCopyMicromapInfoEXT pInfo_host; - - convert_VkCopyMicromapInfoEXT_win32_to_host((const VkCopyMicromapInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyMicromapEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyMicromapToMemoryEXT(void *args) -{ - struct vkCmdCopyMicromapToMemoryEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyMicromapToMemoryEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyMicromapToMemoryEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pInfo; - } *params = args; - VkCopyMicromapToMemoryInfoEXT pInfo_host; - - convert_VkCopyMicromapToMemoryInfoEXT_win32_to_host((const VkCopyMicromapToMemoryInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyMicromapToMemoryEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCopyQueryPoolResults(void *args) -{ - struct vkCmdCopyQueryPoolResults_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCopyQueryPoolResults(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->queryPool, params->firstQuery, params->queryCount, params->dstBuffer, params->dstOffset, params->stride, params->flags); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCopyQueryPoolResults(void *args) -{ - struct - { - PTR32 commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - VkDeviceSize DECLSPEC_ALIGN(8) stride; - VkQueryResultFlags flags; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCopyQueryPoolResults(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->queryPool, params->firstQuery, params->queryCount, params->dstBuffer, params->dstOffset, params->stride, params->flags); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCuLaunchKernelNVX(void *args) -{ - struct vkCmdCuLaunchKernelNVX_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCuLaunchKernelNVX(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pLaunchInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCuLaunchKernelNVX(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pLaunchInfo; - } *params = args; - VkCuLaunchInfoNVX pLaunchInfo_host; - - convert_VkCuLaunchInfoNVX_win32_to_host((const VkCuLaunchInfoNVX32 *)UlongToPtr(params->pLaunchInfo), &pLaunchInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCuLaunchKernelNVX(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pLaunchInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdCudaLaunchKernelNV(void *args) -{ - struct vkCmdCudaLaunchKernelNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdCudaLaunchKernelNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pLaunchInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdCudaLaunchKernelNV(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pLaunchInfo; - } *params = args; - VkCudaLaunchInfoNV pLaunchInfo_host; - - convert_VkCudaLaunchInfoNV_win32_to_host((const VkCudaLaunchInfoNV32 *)UlongToPtr(params->pLaunchInfo), &pLaunchInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdCudaLaunchKernelNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pLaunchInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDebugMarkerBeginEXT(void *args) -{ - struct vkCmdDebugMarkerBeginEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDebugMarkerBeginEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pMarkerInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDebugMarkerBeginEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pMarkerInfo; - } *params = args; - VkDebugMarkerMarkerInfoEXT pMarkerInfo_host; - - convert_VkDebugMarkerMarkerInfoEXT_win32_to_host((const VkDebugMarkerMarkerInfoEXT32 *)UlongToPtr(params->pMarkerInfo), &pMarkerInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDebugMarkerBeginEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pMarkerInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDebugMarkerEndEXT(void *args) -{ - struct vkCmdDebugMarkerEndEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDebugMarkerEndEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDebugMarkerEndEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDebugMarkerEndEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDebugMarkerInsertEXT(void *args) -{ - struct vkCmdDebugMarkerInsertEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDebugMarkerInsertEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pMarkerInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDebugMarkerInsertEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pMarkerInfo; - } *params = args; - VkDebugMarkerMarkerInfoEXT pMarkerInfo_host; - - convert_VkDebugMarkerMarkerInfoEXT_win32_to_host((const VkDebugMarkerMarkerInfoEXT32 *)UlongToPtr(params->pMarkerInfo), &pMarkerInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDebugMarkerInsertEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pMarkerInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDecodeVideoKHR(void *args) -{ - struct vkCmdDecodeVideoKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDecodeVideoKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pDecodeInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDecodeVideoKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pDecodeInfo; - } *params = args; - VkVideoDecodeInfoKHR pDecodeInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkVideoDecodeInfoKHR_win32_to_host(ctx, (const VkVideoDecodeInfoKHR32 *)UlongToPtr(params->pDecodeInfo), &pDecodeInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDecodeVideoKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pDecodeInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDecompressMemoryIndirectCountNV(void *args) -{ - struct vkCmdDecompressMemoryIndirectCountNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDecompressMemoryIndirectCountNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->indirectCommandsAddress, params->indirectCommandsCountAddress, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDecompressMemoryIndirectCountNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkDeviceAddress DECLSPEC_ALIGN(8) indirectCommandsAddress; - VkDeviceAddress DECLSPEC_ALIGN(8) indirectCommandsCountAddress; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDecompressMemoryIndirectCountNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->indirectCommandsAddress, params->indirectCommandsCountAddress, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDecompressMemoryNV(void *args) -{ - struct vkCmdDecompressMemoryNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDecompressMemoryNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->decompressRegionCount, params->pDecompressMemoryRegions); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDecompressMemoryNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t decompressRegionCount; - PTR32 pDecompressMemoryRegions; - } *params = args; - const VkDecompressMemoryRegionNV *pDecompressMemoryRegions_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pDecompressMemoryRegions_host = convert_VkDecompressMemoryRegionNV_array_win32_to_host(ctx, (const VkDecompressMemoryRegionNV32 *)UlongToPtr(params->pDecompressMemoryRegions), params->decompressRegionCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDecompressMemoryNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->decompressRegionCount, pDecompressMemoryRegions_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDispatch(void *args) -{ - struct vkCmdDispatch_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDispatch(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->groupCountX, params->groupCountY, params->groupCountZ); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDispatch(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDispatch(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->groupCountX, params->groupCountY, params->groupCountZ); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDispatchBase(void *args) -{ - struct vkCmdDispatchBase_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDispatchBase(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->baseGroupX, params->baseGroupY, params->baseGroupZ, params->groupCountX, params->groupCountY, params->groupCountZ); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDispatchBase(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t baseGroupX; - uint32_t baseGroupY; - uint32_t baseGroupZ; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDispatchBase(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->baseGroupX, params->baseGroupY, params->baseGroupZ, params->groupCountX, params->groupCountY, params->groupCountZ); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDispatchBaseKHR(void *args) -{ - struct vkCmdDispatchBaseKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDispatchBaseKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->baseGroupX, params->baseGroupY, params->baseGroupZ, params->groupCountX, params->groupCountY, params->groupCountZ); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDispatchBaseKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t baseGroupX; - uint32_t baseGroupY; - uint32_t baseGroupZ; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDispatchBaseKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->baseGroupX, params->baseGroupY, params->baseGroupZ, params->groupCountX, params->groupCountY, params->groupCountZ); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDispatchIndirect(void *args) -{ - struct vkCmdDispatchIndirect_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDispatchIndirect(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->buffer, params->offset); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDispatchIndirect(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDispatchIndirect(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->buffer, params->offset); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDraw(void *args) -{ - struct vkCmdDraw_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDraw(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->vertexCount, params->instanceCount, params->firstVertex, params->firstInstance); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDraw(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t vertexCount; - uint32_t instanceCount; - uint32_t firstVertex; - uint32_t firstInstance; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDraw(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->vertexCount, params->instanceCount, params->firstVertex, params->firstInstance); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawClusterHUAWEI(void *args) -{ - struct vkCmdDrawClusterHUAWEI_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawClusterHUAWEI(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->groupCountX, params->groupCountY, params->groupCountZ); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawClusterHUAWEI(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawClusterHUAWEI(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->groupCountX, params->groupCountY, params->groupCountZ); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawClusterIndirectHUAWEI(void *args) -{ - struct vkCmdDrawClusterIndirectHUAWEI_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawClusterIndirectHUAWEI(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->buffer, params->offset); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawClusterIndirectHUAWEI(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawClusterIndirectHUAWEI(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->buffer, params->offset); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndexed(void *args) -{ - struct vkCmdDrawIndexed_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawIndexed(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->indexCount, params->instanceCount, params->firstIndex, params->vertexOffset, params->firstInstance); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndexed(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t indexCount; - uint32_t instanceCount; - uint32_t firstIndex; - int32_t vertexOffset; - uint32_t firstInstance; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawIndexed(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->indexCount, params->instanceCount, params->firstIndex, params->vertexOffset, params->firstInstance); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndexedIndirect(void *args) -{ - struct vkCmdDrawIndexedIndirect_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawIndexedIndirect(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->buffer, params->offset, params->drawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndexedIndirect(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - uint32_t drawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawIndexedIndirect(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->buffer, params->offset, params->drawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndexedIndirectCount(void *args) -{ - struct vkCmdDrawIndexedIndirectCount_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawIndexedIndirectCount(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndexedIndirectCount(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawIndexedIndirectCount(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndexedIndirectCountAMD(void *args) -{ - struct vkCmdDrawIndexedIndirectCountAMD_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawIndexedIndirectCountAMD(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndexedIndirectCountAMD(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawIndexedIndirectCountAMD(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndexedIndirectCountKHR(void *args) -{ - struct vkCmdDrawIndexedIndirectCountKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawIndexedIndirectCountKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndexedIndirectCountKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawIndexedIndirectCountKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndirect(void *args) -{ - struct vkCmdDrawIndirect_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawIndirect(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->buffer, params->offset, params->drawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndirect(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - uint32_t drawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawIndirect(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->buffer, params->offset, params->drawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndirectByteCountEXT(void *args) -{ - struct vkCmdDrawIndirectByteCountEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawIndirectByteCountEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->instanceCount, params->firstInstance, params->counterBuffer, params->counterBufferOffset, params->counterOffset, params->vertexStride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndirectByteCountEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t instanceCount; - uint32_t firstInstance; - VkBuffer DECLSPEC_ALIGN(8) counterBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) counterBufferOffset; - uint32_t counterOffset; - uint32_t vertexStride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawIndirectByteCountEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->instanceCount, params->firstInstance, params->counterBuffer, params->counterBufferOffset, params->counterOffset, params->vertexStride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndirectCount(void *args) -{ - struct vkCmdDrawIndirectCount_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawIndirectCount(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndirectCount(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawIndirectCount(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndirectCountAMD(void *args) -{ - struct vkCmdDrawIndirectCountAMD_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawIndirectCountAMD(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndirectCountAMD(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawIndirectCountAMD(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawIndirectCountKHR(void *args) -{ - struct vkCmdDrawIndirectCountKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawIndirectCountKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawIndirectCountKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawIndirectCountKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawMeshTasksEXT(void *args) -{ - struct vkCmdDrawMeshTasksEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawMeshTasksEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->groupCountX, params->groupCountY, params->groupCountZ); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawMeshTasksEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawMeshTasksEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->groupCountX, params->groupCountY, params->groupCountZ); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawMeshTasksIndirectCountEXT(void *args) -{ - struct vkCmdDrawMeshTasksIndirectCountEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawMeshTasksIndirectCountEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawMeshTasksIndirectCountEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawMeshTasksIndirectCountEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawMeshTasksIndirectCountNV(void *args) -{ - struct vkCmdDrawMeshTasksIndirectCountNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawMeshTasksIndirectCountNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawMeshTasksIndirectCountNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkBuffer DECLSPEC_ALIGN(8) countBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) countBufferOffset; - uint32_t maxDrawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawMeshTasksIndirectCountNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->buffer, params->offset, params->countBuffer, params->countBufferOffset, params->maxDrawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawMeshTasksIndirectEXT(void *args) -{ - struct vkCmdDrawMeshTasksIndirectEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawMeshTasksIndirectEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->buffer, params->offset, params->drawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawMeshTasksIndirectEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - uint32_t drawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawMeshTasksIndirectEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->buffer, params->offset, params->drawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawMeshTasksIndirectNV(void *args) -{ - struct vkCmdDrawMeshTasksIndirectNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawMeshTasksIndirectNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->buffer, params->offset, params->drawCount, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawMeshTasksIndirectNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) buffer; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - uint32_t drawCount; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawMeshTasksIndirectNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->buffer, params->offset, params->drawCount, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawMeshTasksNV(void *args) -{ - struct vkCmdDrawMeshTasksNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawMeshTasksNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->taskCount, params->firstTask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawMeshTasksNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t taskCount; - uint32_t firstTask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawMeshTasksNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->taskCount, params->firstTask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawMultiEXT(void *args) -{ - struct vkCmdDrawMultiEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawMultiEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->drawCount, params->pVertexInfo, params->instanceCount, params->firstInstance, params->stride); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawMultiEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t drawCount; - PTR32 pVertexInfo; - uint32_t instanceCount; - uint32_t firstInstance; - uint32_t stride; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawMultiEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->drawCount, (const VkMultiDrawInfoEXT *)UlongToPtr(params->pVertexInfo), params->instanceCount, params->firstInstance, params->stride); -} - -#ifdef _WIN64 -static void thunk64_vkCmdDrawMultiIndexedEXT(void *args) -{ - struct vkCmdDrawMultiIndexedEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdDrawMultiIndexedEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->drawCount, params->pIndexInfo, params->instanceCount, params->firstInstance, params->stride, params->pVertexOffset); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdDrawMultiIndexedEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t drawCount; - PTR32 pIndexInfo; - uint32_t instanceCount; - uint32_t firstInstance; - uint32_t stride; - PTR32 pVertexOffset; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdDrawMultiIndexedEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->drawCount, (const VkMultiDrawIndexedInfoEXT *)UlongToPtr(params->pIndexInfo), params->instanceCount, params->firstInstance, params->stride, (const int32_t *)UlongToPtr(params->pVertexOffset)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEncodeVideoKHR(void *args) -{ - struct vkCmdEncodeVideoKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdEncodeVideoKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pEncodeInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEncodeVideoKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pEncodeInfo; - } *params = args; - VkVideoEncodeInfoKHR pEncodeInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkVideoEncodeInfoKHR_win32_to_host(ctx, (const VkVideoEncodeInfoKHR32 *)UlongToPtr(params->pEncodeInfo), &pEncodeInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdEncodeVideoKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pEncodeInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndConditionalRenderingEXT(void *args) -{ - struct vkCmdEndConditionalRenderingEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdEndConditionalRenderingEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndConditionalRenderingEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdEndConditionalRenderingEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndDebugUtilsLabelEXT(void *args) -{ - struct vkCmdEndDebugUtilsLabelEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdEndDebugUtilsLabelEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndDebugUtilsLabelEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdEndDebugUtilsLabelEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndQuery(void *args) -{ - struct vkCmdEndQuery_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdEndQuery(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->queryPool, params->query); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndQuery(void *args) -{ - struct - { - PTR32 commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdEndQuery(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->queryPool, params->query); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndQueryIndexedEXT(void *args) -{ - struct vkCmdEndQueryIndexedEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdEndQueryIndexedEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->queryPool, params->query, params->index); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndQueryIndexedEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - uint32_t index; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdEndQueryIndexedEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->queryPool, params->query, params->index); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndRenderPass(void *args) -{ - struct vkCmdEndRenderPass_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdEndRenderPass(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndRenderPass(void *args) -{ - struct - { - PTR32 commandBuffer; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdEndRenderPass(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndRenderPass2(void *args) -{ - struct vkCmdEndRenderPass2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdEndRenderPass2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pSubpassEndInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndRenderPass2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pSubpassEndInfo; - } *params = args; - VkSubpassEndInfo pSubpassEndInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkSubpassEndInfo_win32_to_host(ctx, (const VkSubpassEndInfo32 *)UlongToPtr(params->pSubpassEndInfo), &pSubpassEndInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdEndRenderPass2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pSubpassEndInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndRenderPass2KHR(void *args) -{ - struct vkCmdEndRenderPass2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdEndRenderPass2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pSubpassEndInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndRenderPass2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pSubpassEndInfo; - } *params = args; - VkSubpassEndInfo pSubpassEndInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkSubpassEndInfo_win32_to_host(ctx, (const VkSubpassEndInfo32 *)UlongToPtr(params->pSubpassEndInfo), &pSubpassEndInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdEndRenderPass2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pSubpassEndInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndRendering(void *args) -{ - struct vkCmdEndRendering_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdEndRendering(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndRendering(void *args) -{ - struct - { - PTR32 commandBuffer; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdEndRendering(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndRenderingKHR(void *args) -{ - struct vkCmdEndRenderingKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdEndRenderingKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndRenderingKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdEndRenderingKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndTransformFeedbackEXT(void *args) -{ - struct vkCmdEndTransformFeedbackEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdEndTransformFeedbackEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->firstCounterBuffer, params->counterBufferCount, params->pCounterBuffers, params->pCounterBufferOffsets); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndTransformFeedbackEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstCounterBuffer; - uint32_t counterBufferCount; - PTR32 pCounterBuffers; - PTR32 pCounterBufferOffsets; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdEndTransformFeedbackEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->firstCounterBuffer, params->counterBufferCount, (const VkBuffer *)UlongToPtr(params->pCounterBuffers), (const VkDeviceSize *)UlongToPtr(params->pCounterBufferOffsets)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdEndVideoCodingKHR(void *args) -{ - struct vkCmdEndVideoCodingKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdEndVideoCodingKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pEndCodingInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdEndVideoCodingKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pEndCodingInfo; - } *params = args; - VkVideoEndCodingInfoKHR pEndCodingInfo_host; - - convert_VkVideoEndCodingInfoKHR_win32_to_host((const VkVideoEndCodingInfoKHR32 *)UlongToPtr(params->pEndCodingInfo), &pEndCodingInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdEndVideoCodingKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pEndCodingInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdExecuteCommands(void *args) -{ - struct vkCmdExecuteCommands_params *params = args; - const VkCommandBuffer *pCommandBuffers_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pCommandBuffers_host = convert_VkCommandBuffer_array_win64_to_host(ctx, params->pCommandBuffers, params->commandBufferCount); - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdExecuteCommands(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->commandBufferCount, pCommandBuffers_host); - free_conversion_context(ctx); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdExecuteCommands(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t commandBufferCount; - PTR32 pCommandBuffers; - } *params = args; - const VkCommandBuffer *pCommandBuffers_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pCommandBuffers_host = convert_VkCommandBuffer_array_win32_to_host(ctx, (const PTR32 *)UlongToPtr(params->pCommandBuffers), params->commandBufferCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdExecuteCommands(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->commandBufferCount, pCommandBuffers_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdExecuteGeneratedCommandsEXT(void *args) -{ - struct vkCmdExecuteGeneratedCommandsEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdExecuteGeneratedCommandsEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->isPreprocessed, params->pGeneratedCommandsInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdExecuteGeneratedCommandsEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 isPreprocessed; - PTR32 pGeneratedCommandsInfo; - } *params = args; - VkGeneratedCommandsInfoEXT pGeneratedCommandsInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkGeneratedCommandsInfoEXT_win32_to_host(ctx, (const VkGeneratedCommandsInfoEXT32 *)UlongToPtr(params->pGeneratedCommandsInfo), &pGeneratedCommandsInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdExecuteGeneratedCommandsEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->isPreprocessed, &pGeneratedCommandsInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdExecuteGeneratedCommandsNV(void *args) -{ - struct vkCmdExecuteGeneratedCommandsNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdExecuteGeneratedCommandsNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->isPreprocessed, params->pGeneratedCommandsInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdExecuteGeneratedCommandsNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 isPreprocessed; - PTR32 pGeneratedCommandsInfo; - } *params = args; - VkGeneratedCommandsInfoNV pGeneratedCommandsInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkGeneratedCommandsInfoNV_win32_to_host(ctx, (const VkGeneratedCommandsInfoNV32 *)UlongToPtr(params->pGeneratedCommandsInfo), &pGeneratedCommandsInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdExecuteGeneratedCommandsNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->isPreprocessed, &pGeneratedCommandsInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdFillBuffer(void *args) -{ - struct vkCmdFillBuffer_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdFillBuffer(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->dstBuffer, params->dstOffset, params->size, params->data); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdFillBuffer(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - uint32_t data; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdFillBuffer(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->dstBuffer, params->dstOffset, params->size, params->data); -} - -#ifdef _WIN64 -static void thunk64_vkCmdInsertDebugUtilsLabelEXT(void *args) -{ - struct vkCmdInsertDebugUtilsLabelEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdInsertDebugUtilsLabelEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pLabelInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdInsertDebugUtilsLabelEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pLabelInfo; - } *params = args; - VkDebugUtilsLabelEXT pLabelInfo_host; - - convert_VkDebugUtilsLabelEXT_win32_to_host((const VkDebugUtilsLabelEXT32 *)UlongToPtr(params->pLabelInfo), &pLabelInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdInsertDebugUtilsLabelEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pLabelInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdNextSubpass(void *args) -{ - struct vkCmdNextSubpass_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdNextSubpass(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->contents); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdNextSubpass(void *args) -{ - struct - { - PTR32 commandBuffer; - VkSubpassContents contents; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdNextSubpass(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->contents); -} - -#ifdef _WIN64 -static void thunk64_vkCmdNextSubpass2(void *args) -{ - struct vkCmdNextSubpass2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdNextSubpass2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pSubpassBeginInfo, params->pSubpassEndInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdNextSubpass2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pSubpassBeginInfo; - PTR32 pSubpassEndInfo; - } *params = args; - VkSubpassBeginInfo pSubpassBeginInfo_host; - VkSubpassEndInfo pSubpassEndInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkSubpassBeginInfo_win32_to_host((const VkSubpassBeginInfo32 *)UlongToPtr(params->pSubpassBeginInfo), &pSubpassBeginInfo_host); - convert_VkSubpassEndInfo_win32_to_host(ctx, (const VkSubpassEndInfo32 *)UlongToPtr(params->pSubpassEndInfo), &pSubpassEndInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdNextSubpass2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pSubpassBeginInfo_host, &pSubpassEndInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdNextSubpass2KHR(void *args) -{ - struct vkCmdNextSubpass2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdNextSubpass2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pSubpassBeginInfo, params->pSubpassEndInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdNextSubpass2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pSubpassBeginInfo; - PTR32 pSubpassEndInfo; - } *params = args; - VkSubpassBeginInfo pSubpassBeginInfo_host; - VkSubpassEndInfo pSubpassEndInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkSubpassBeginInfo_win32_to_host((const VkSubpassBeginInfo32 *)UlongToPtr(params->pSubpassBeginInfo), &pSubpassBeginInfo_host); - convert_VkSubpassEndInfo_win32_to_host(ctx, (const VkSubpassEndInfo32 *)UlongToPtr(params->pSubpassEndInfo), &pSubpassEndInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdNextSubpass2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pSubpassBeginInfo_host, &pSubpassEndInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdOpticalFlowExecuteNV(void *args) -{ - struct vkCmdOpticalFlowExecuteNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdOpticalFlowExecuteNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->session, params->pExecuteInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdOpticalFlowExecuteNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkOpticalFlowSessionNV DECLSPEC_ALIGN(8) session; - PTR32 pExecuteInfo; - } *params = args; - VkOpticalFlowExecuteInfoNV pExecuteInfo_host; - - convert_VkOpticalFlowExecuteInfoNV_win32_to_host((const VkOpticalFlowExecuteInfoNV32 *)UlongToPtr(params->pExecuteInfo), &pExecuteInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdOpticalFlowExecuteNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->session, &pExecuteInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPipelineBarrier(void *args) -{ - struct vkCmdPipelineBarrier_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdPipelineBarrier(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->srcStageMask, params->dstStageMask, params->dependencyFlags, params->memoryBarrierCount, params->pMemoryBarriers, params->bufferMemoryBarrierCount, params->pBufferMemoryBarriers, params->imageMemoryBarrierCount, params->pImageMemoryBarriers); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPipelineBarrier(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineStageFlags srcStageMask; - VkPipelineStageFlags dstStageMask; - VkDependencyFlags dependencyFlags; - uint32_t memoryBarrierCount; - PTR32 pMemoryBarriers; - uint32_t bufferMemoryBarrierCount; - PTR32 pBufferMemoryBarriers; - uint32_t imageMemoryBarrierCount; - PTR32 pImageMemoryBarriers; - } *params = args; - const VkMemoryBarrier *pMemoryBarriers_host; - const VkBufferMemoryBarrier *pBufferMemoryBarriers_host; - const VkImageMemoryBarrier *pImageMemoryBarriers_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pMemoryBarriers_host = convert_VkMemoryBarrier_array_win32_to_host(ctx, (const VkMemoryBarrier32 *)UlongToPtr(params->pMemoryBarriers), params->memoryBarrierCount); - pBufferMemoryBarriers_host = convert_VkBufferMemoryBarrier_array_win32_to_host(ctx, (const VkBufferMemoryBarrier32 *)UlongToPtr(params->pBufferMemoryBarriers), params->bufferMemoryBarrierCount); - pImageMemoryBarriers_host = convert_VkImageMemoryBarrier_array_win32_to_host(ctx, (const VkImageMemoryBarrier32 *)UlongToPtr(params->pImageMemoryBarriers), params->imageMemoryBarrierCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdPipelineBarrier(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->srcStageMask, params->dstStageMask, params->dependencyFlags, params->memoryBarrierCount, pMemoryBarriers_host, params->bufferMemoryBarrierCount, pBufferMemoryBarriers_host, params->imageMemoryBarrierCount, pImageMemoryBarriers_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPipelineBarrier2(void *args) -{ - struct vkCmdPipelineBarrier2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdPipelineBarrier2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pDependencyInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPipelineBarrier2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pDependencyInfo; - } *params = args; - VkDependencyInfo pDependencyInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkDependencyInfo_win32_to_host(ctx, (const VkDependencyInfo32 *)UlongToPtr(params->pDependencyInfo), &pDependencyInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdPipelineBarrier2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pDependencyInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPipelineBarrier2KHR(void *args) -{ - struct vkCmdPipelineBarrier2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdPipelineBarrier2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pDependencyInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPipelineBarrier2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pDependencyInfo; - } *params = args; - VkDependencyInfo pDependencyInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkDependencyInfo_win32_to_host(ctx, (const VkDependencyInfo32 *)UlongToPtr(params->pDependencyInfo), &pDependencyInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdPipelineBarrier2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pDependencyInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPreprocessGeneratedCommandsEXT(void *args) -{ - struct vkCmdPreprocessGeneratedCommandsEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdPreprocessGeneratedCommandsEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pGeneratedCommandsInfo, wine_cmd_buffer_from_handle(params->stateCommandBuffer)->host.command_buffer); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPreprocessGeneratedCommandsEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pGeneratedCommandsInfo; - PTR32 stateCommandBuffer; - } *params = args; - VkGeneratedCommandsInfoEXT pGeneratedCommandsInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkGeneratedCommandsInfoEXT_win32_to_host(ctx, (const VkGeneratedCommandsInfoEXT32 *)UlongToPtr(params->pGeneratedCommandsInfo), &pGeneratedCommandsInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdPreprocessGeneratedCommandsEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pGeneratedCommandsInfo_host, wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->stateCommandBuffer))->host.command_buffer); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPreprocessGeneratedCommandsNV(void *args) -{ - struct vkCmdPreprocessGeneratedCommandsNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdPreprocessGeneratedCommandsNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pGeneratedCommandsInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPreprocessGeneratedCommandsNV(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pGeneratedCommandsInfo; - } *params = args; - VkGeneratedCommandsInfoNV pGeneratedCommandsInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkGeneratedCommandsInfoNV_win32_to_host(ctx, (const VkGeneratedCommandsInfoNV32 *)UlongToPtr(params->pGeneratedCommandsInfo), &pGeneratedCommandsInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdPreprocessGeneratedCommandsNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pGeneratedCommandsInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPushConstants(void *args) -{ - struct vkCmdPushConstants_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdPushConstants(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->layout, params->stageFlags, params->offset, params->size, params->pValues); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPushConstants(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - VkShaderStageFlags stageFlags; - uint32_t offset; - uint32_t size; - PTR32 pValues; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdPushConstants(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->layout, params->stageFlags, params->offset, params->size, (const void *)UlongToPtr(params->pValues)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPushConstants2(void *args) -{ - struct vkCmdPushConstants2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdPushConstants2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pPushConstantsInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPushConstants2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pPushConstantsInfo; - } *params = args; - VkPushConstantsInfo pPushConstantsInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkPushConstantsInfo_win32_to_host(ctx, (const VkPushConstantsInfo32 *)UlongToPtr(params->pPushConstantsInfo), &pPushConstantsInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdPushConstants2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pPushConstantsInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPushConstants2KHR(void *args) -{ - struct vkCmdPushConstants2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdPushConstants2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pPushConstantsInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPushConstants2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pPushConstantsInfo; - } *params = args; - VkPushConstantsInfo pPushConstantsInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkPushConstantsInfo_win32_to_host(ctx, (const VkPushConstantsInfo32 *)UlongToPtr(params->pPushConstantsInfo), &pPushConstantsInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdPushConstants2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pPushConstantsInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPushDescriptorSet(void *args) -{ - struct vkCmdPushDescriptorSet_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdPushDescriptorSet(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pipelineBindPoint, params->layout, params->set, params->descriptorWriteCount, params->pDescriptorWrites); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPushDescriptorSet(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; - uint32_t descriptorWriteCount; - PTR32 pDescriptorWrites; - } *params = args; - const VkWriteDescriptorSet *pDescriptorWrites_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pDescriptorWrites_host = convert_VkWriteDescriptorSet_array_win32_to_host(ctx, (const VkWriteDescriptorSet32 *)UlongToPtr(params->pDescriptorWrites), params->descriptorWriteCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdPushDescriptorSet(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->pipelineBindPoint, params->layout, params->set, params->descriptorWriteCount, pDescriptorWrites_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPushDescriptorSet2(void *args) -{ - struct vkCmdPushDescriptorSet2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdPushDescriptorSet2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pPushDescriptorSetInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPushDescriptorSet2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pPushDescriptorSetInfo; - } *params = args; - VkPushDescriptorSetInfo pPushDescriptorSetInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkPushDescriptorSetInfo_win32_to_host(ctx, (const VkPushDescriptorSetInfo32 *)UlongToPtr(params->pPushDescriptorSetInfo), &pPushDescriptorSetInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdPushDescriptorSet2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pPushDescriptorSetInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPushDescriptorSet2KHR(void *args) -{ - struct vkCmdPushDescriptorSet2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdPushDescriptorSet2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pPushDescriptorSetInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPushDescriptorSet2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pPushDescriptorSetInfo; - } *params = args; - VkPushDescriptorSetInfo pPushDescriptorSetInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkPushDescriptorSetInfo_win32_to_host(ctx, (const VkPushDescriptorSetInfo32 *)UlongToPtr(params->pPushDescriptorSetInfo), &pPushDescriptorSetInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdPushDescriptorSet2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pPushDescriptorSetInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPushDescriptorSetKHR(void *args) -{ - struct vkCmdPushDescriptorSetKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdPushDescriptorSetKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pipelineBindPoint, params->layout, params->set, params->descriptorWriteCount, params->pDescriptorWrites); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPushDescriptorSetKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; - uint32_t descriptorWriteCount; - PTR32 pDescriptorWrites; - } *params = args; - const VkWriteDescriptorSet *pDescriptorWrites_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pDescriptorWrites_host = convert_VkWriteDescriptorSet_array_win32_to_host(ctx, (const VkWriteDescriptorSet32 *)UlongToPtr(params->pDescriptorWrites), params->descriptorWriteCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdPushDescriptorSetKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->pipelineBindPoint, params->layout, params->set, params->descriptorWriteCount, pDescriptorWrites_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPushDescriptorSetWithTemplate(void *args) -{ - struct vkCmdPushDescriptorSetWithTemplate_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdPushDescriptorSetWithTemplate(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->descriptorUpdateTemplate, params->layout, params->set, params->pData); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPushDescriptorSetWithTemplate(void *args) -{ - struct - { - PTR32 commandBuffer; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; - PTR32 pData; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdPushDescriptorSetWithTemplate(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->descriptorUpdateTemplate, params->layout, params->set, (const void *)UlongToPtr(params->pData)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPushDescriptorSetWithTemplate2(void *args) -{ - struct vkCmdPushDescriptorSetWithTemplate2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdPushDescriptorSetWithTemplate2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pPushDescriptorSetWithTemplateInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPushDescriptorSetWithTemplate2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pPushDescriptorSetWithTemplateInfo; - } *params = args; - VkPushDescriptorSetWithTemplateInfo pPushDescriptorSetWithTemplateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkPushDescriptorSetWithTemplateInfo_win32_to_host(ctx, (const VkPushDescriptorSetWithTemplateInfo32 *)UlongToPtr(params->pPushDescriptorSetWithTemplateInfo), &pPushDescriptorSetWithTemplateInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdPushDescriptorSetWithTemplate2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pPushDescriptorSetWithTemplateInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPushDescriptorSetWithTemplate2KHR(void *args) -{ - struct vkCmdPushDescriptorSetWithTemplate2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdPushDescriptorSetWithTemplate2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pPushDescriptorSetWithTemplateInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPushDescriptorSetWithTemplate2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pPushDescriptorSetWithTemplateInfo; - } *params = args; - VkPushDescriptorSetWithTemplateInfo pPushDescriptorSetWithTemplateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkPushDescriptorSetWithTemplateInfo_win32_to_host(ctx, (const VkPushDescriptorSetWithTemplateInfo32 *)UlongToPtr(params->pPushDescriptorSetWithTemplateInfo), &pPushDescriptorSetWithTemplateInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdPushDescriptorSetWithTemplate2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pPushDescriptorSetWithTemplateInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdPushDescriptorSetWithTemplateKHR(void *args) -{ - struct vkCmdPushDescriptorSetWithTemplateKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdPushDescriptorSetWithTemplateKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->descriptorUpdateTemplate, params->layout, params->set, params->pData); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdPushDescriptorSetWithTemplateKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t set; - PTR32 pData; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdPushDescriptorSetWithTemplateKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->descriptorUpdateTemplate, params->layout, params->set, (const void *)UlongToPtr(params->pData)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdResetEvent(void *args) -{ - struct vkCmdResetEvent_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdResetEvent(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->event, params->stageMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdResetEvent(void *args) -{ - struct - { - PTR32 commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - VkPipelineStageFlags stageMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdResetEvent(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->event, params->stageMask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdResetEvent2(void *args) -{ - struct vkCmdResetEvent2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdResetEvent2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->event, params->stageMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdResetEvent2(void *args) -{ - struct - { - PTR32 commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stageMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdResetEvent2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->event, params->stageMask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdResetEvent2KHR(void *args) -{ - struct vkCmdResetEvent2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdResetEvent2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->event, params->stageMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdResetEvent2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stageMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdResetEvent2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->event, params->stageMask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdResetQueryPool(void *args) -{ - struct vkCmdResetQueryPool_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdResetQueryPool(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->queryPool, params->firstQuery, params->queryCount); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdResetQueryPool(void *args) -{ - struct - { - PTR32 commandBuffer; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdResetQueryPool(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->queryPool, params->firstQuery, params->queryCount); -} - -#ifdef _WIN64 -static void thunk64_vkCmdResolveImage(void *args) -{ - struct vkCmdResolveImage_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdResolveImage(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->srcImage, params->srcImageLayout, params->dstImage, params->dstImageLayout, params->regionCount, params->pRegions); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdResolveImage(void *args) -{ - struct - { - PTR32 commandBuffer; - VkImage DECLSPEC_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage DECLSPEC_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - PTR32 pRegions; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdResolveImage(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->srcImage, params->srcImageLayout, params->dstImage, params->dstImageLayout, params->regionCount, (const VkImageResolve *)UlongToPtr(params->pRegions)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdResolveImage2(void *args) -{ - struct vkCmdResolveImage2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdResolveImage2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pResolveImageInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdResolveImage2(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pResolveImageInfo; - } *params = args; - VkResolveImageInfo2 pResolveImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkResolveImageInfo2_win32_to_host(ctx, (const VkResolveImageInfo232 *)UlongToPtr(params->pResolveImageInfo), &pResolveImageInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdResolveImage2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pResolveImageInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdResolveImage2KHR(void *args) -{ - struct vkCmdResolveImage2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdResolveImage2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pResolveImageInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdResolveImage2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pResolveImageInfo; - } *params = args; - VkResolveImageInfo2 pResolveImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkResolveImageInfo2_win32_to_host(ctx, (const VkResolveImageInfo232 *)UlongToPtr(params->pResolveImageInfo), &pResolveImageInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdResolveImage2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pResolveImageInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetAlphaToCoverageEnableEXT(void *args) -{ - struct vkCmdSetAlphaToCoverageEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetAlphaToCoverageEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->alphaToCoverageEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetAlphaToCoverageEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 alphaToCoverageEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetAlphaToCoverageEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->alphaToCoverageEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetAlphaToOneEnableEXT(void *args) -{ - struct vkCmdSetAlphaToOneEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetAlphaToOneEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->alphaToOneEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetAlphaToOneEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 alphaToOneEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetAlphaToOneEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->alphaToOneEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetAttachmentFeedbackLoopEnableEXT(void *args) -{ - struct vkCmdSetAttachmentFeedbackLoopEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetAttachmentFeedbackLoopEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->aspectMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetAttachmentFeedbackLoopEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkImageAspectFlags aspectMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetAttachmentFeedbackLoopEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->aspectMask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetBlendConstants(void *args) -{ - struct vkCmdSetBlendConstants_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetBlendConstants(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->blendConstants); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetBlendConstants(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 blendConstants; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetBlendConstants(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, (const float *)UlongToPtr(params->blendConstants)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCheckpointNV(void *args) -{ - struct vkCmdSetCheckpointNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetCheckpointNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pCheckpointMarker); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCheckpointNV(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pCheckpointMarker; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetCheckpointNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, (const void *)UlongToPtr(params->pCheckpointMarker)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCoarseSampleOrderNV(void *args) -{ - struct vkCmdSetCoarseSampleOrderNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetCoarseSampleOrderNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->sampleOrderType, params->customSampleOrderCount, params->pCustomSampleOrders); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCoarseSampleOrderNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkCoarseSampleOrderTypeNV sampleOrderType; - uint32_t customSampleOrderCount; - PTR32 pCustomSampleOrders; - } *params = args; - const VkCoarseSampleOrderCustomNV *pCustomSampleOrders_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pCustomSampleOrders_host = convert_VkCoarseSampleOrderCustomNV_array_win32_to_host(ctx, (const VkCoarseSampleOrderCustomNV32 *)UlongToPtr(params->pCustomSampleOrders), params->customSampleOrderCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetCoarseSampleOrderNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->sampleOrderType, params->customSampleOrderCount, pCustomSampleOrders_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetColorBlendAdvancedEXT(void *args) -{ - struct vkCmdSetColorBlendAdvancedEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetColorBlendAdvancedEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->firstAttachment, params->attachmentCount, params->pColorBlendAdvanced); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetColorBlendAdvancedEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstAttachment; - uint32_t attachmentCount; - PTR32 pColorBlendAdvanced; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetColorBlendAdvancedEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->firstAttachment, params->attachmentCount, (const VkColorBlendAdvancedEXT *)UlongToPtr(params->pColorBlendAdvanced)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetColorBlendEnableEXT(void *args) -{ - struct vkCmdSetColorBlendEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetColorBlendEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->firstAttachment, params->attachmentCount, params->pColorBlendEnables); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetColorBlendEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstAttachment; - uint32_t attachmentCount; - PTR32 pColorBlendEnables; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetColorBlendEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->firstAttachment, params->attachmentCount, (const VkBool32 *)UlongToPtr(params->pColorBlendEnables)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetColorBlendEquationEXT(void *args) -{ - struct vkCmdSetColorBlendEquationEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetColorBlendEquationEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->firstAttachment, params->attachmentCount, params->pColorBlendEquations); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetColorBlendEquationEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstAttachment; - uint32_t attachmentCount; - PTR32 pColorBlendEquations; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetColorBlendEquationEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->firstAttachment, params->attachmentCount, (const VkColorBlendEquationEXT *)UlongToPtr(params->pColorBlendEquations)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetColorWriteEnableEXT(void *args) -{ - struct vkCmdSetColorWriteEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetColorWriteEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->attachmentCount, params->pColorWriteEnables); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetColorWriteEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t attachmentCount; - PTR32 pColorWriteEnables; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetColorWriteEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->attachmentCount, (const VkBool32 *)UlongToPtr(params->pColorWriteEnables)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetColorWriteMaskEXT(void *args) -{ - struct vkCmdSetColorWriteMaskEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetColorWriteMaskEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->firstAttachment, params->attachmentCount, params->pColorWriteMasks); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetColorWriteMaskEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstAttachment; - uint32_t attachmentCount; - PTR32 pColorWriteMasks; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetColorWriteMaskEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->firstAttachment, params->attachmentCount, (const VkColorComponentFlags *)UlongToPtr(params->pColorWriteMasks)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetConservativeRasterizationModeEXT(void *args) -{ - struct vkCmdSetConservativeRasterizationModeEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetConservativeRasterizationModeEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->conservativeRasterizationMode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetConservativeRasterizationModeEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkConservativeRasterizationModeEXT conservativeRasterizationMode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetConservativeRasterizationModeEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->conservativeRasterizationMode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCoverageModulationModeNV(void *args) -{ - struct vkCmdSetCoverageModulationModeNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetCoverageModulationModeNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->coverageModulationMode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCoverageModulationModeNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkCoverageModulationModeNV coverageModulationMode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetCoverageModulationModeNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->coverageModulationMode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCoverageModulationTableEnableNV(void *args) -{ - struct vkCmdSetCoverageModulationTableEnableNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetCoverageModulationTableEnableNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->coverageModulationTableEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCoverageModulationTableEnableNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 coverageModulationTableEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetCoverageModulationTableEnableNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->coverageModulationTableEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCoverageModulationTableNV(void *args) -{ - struct vkCmdSetCoverageModulationTableNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetCoverageModulationTableNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->coverageModulationTableCount, params->pCoverageModulationTable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCoverageModulationTableNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t coverageModulationTableCount; - PTR32 pCoverageModulationTable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetCoverageModulationTableNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->coverageModulationTableCount, (const float *)UlongToPtr(params->pCoverageModulationTable)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCoverageReductionModeNV(void *args) -{ - struct vkCmdSetCoverageReductionModeNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetCoverageReductionModeNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->coverageReductionMode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCoverageReductionModeNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkCoverageReductionModeNV coverageReductionMode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetCoverageReductionModeNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->coverageReductionMode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCoverageToColorEnableNV(void *args) -{ - struct vkCmdSetCoverageToColorEnableNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetCoverageToColorEnableNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->coverageToColorEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCoverageToColorEnableNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 coverageToColorEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetCoverageToColorEnableNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->coverageToColorEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCoverageToColorLocationNV(void *args) -{ - struct vkCmdSetCoverageToColorLocationNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetCoverageToColorLocationNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->coverageToColorLocation); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCoverageToColorLocationNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t coverageToColorLocation; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetCoverageToColorLocationNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->coverageToColorLocation); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCullMode(void *args) -{ - struct vkCmdSetCullMode_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetCullMode(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->cullMode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCullMode(void *args) -{ - struct - { - PTR32 commandBuffer; - VkCullModeFlags cullMode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetCullMode(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->cullMode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetCullModeEXT(void *args) -{ - struct vkCmdSetCullModeEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetCullModeEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->cullMode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetCullModeEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkCullModeFlags cullMode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetCullModeEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->cullMode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthBias(void *args) -{ - struct vkCmdSetDepthBias_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDepthBias(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->depthBiasConstantFactor, params->depthBiasClamp, params->depthBiasSlopeFactor); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthBias(void *args) -{ - struct - { - PTR32 commandBuffer; - float depthBiasConstantFactor; - float depthBiasClamp; - float depthBiasSlopeFactor; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDepthBias(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->depthBiasConstantFactor, params->depthBiasClamp, params->depthBiasSlopeFactor); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthBias2EXT(void *args) -{ - struct vkCmdSetDepthBias2EXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDepthBias2EXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pDepthBiasInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthBias2EXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pDepthBiasInfo; - } *params = args; - VkDepthBiasInfoEXT pDepthBiasInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkDepthBiasInfoEXT_win32_to_host(ctx, (const VkDepthBiasInfoEXT32 *)UlongToPtr(params->pDepthBiasInfo), &pDepthBiasInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDepthBias2EXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pDepthBiasInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthBiasEnable(void *args) -{ - struct vkCmdSetDepthBiasEnable_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDepthBiasEnable(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->depthBiasEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthBiasEnable(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthBiasEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDepthBiasEnable(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->depthBiasEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthBiasEnableEXT(void *args) -{ - struct vkCmdSetDepthBiasEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDepthBiasEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->depthBiasEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthBiasEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthBiasEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDepthBiasEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->depthBiasEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthBounds(void *args) -{ - struct vkCmdSetDepthBounds_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDepthBounds(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->minDepthBounds, params->maxDepthBounds); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthBounds(void *args) -{ - struct - { - PTR32 commandBuffer; - float minDepthBounds; - float maxDepthBounds; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDepthBounds(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->minDepthBounds, params->maxDepthBounds); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthBoundsTestEnable(void *args) -{ - struct vkCmdSetDepthBoundsTestEnable_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDepthBoundsTestEnable(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->depthBoundsTestEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthBoundsTestEnable(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthBoundsTestEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDepthBoundsTestEnable(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->depthBoundsTestEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthBoundsTestEnableEXT(void *args) -{ - struct vkCmdSetDepthBoundsTestEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDepthBoundsTestEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->depthBoundsTestEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthBoundsTestEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthBoundsTestEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDepthBoundsTestEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->depthBoundsTestEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthClampEnableEXT(void *args) -{ - struct vkCmdSetDepthClampEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDepthClampEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->depthClampEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthClampEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthClampEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDepthClampEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->depthClampEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthClampRangeEXT(void *args) -{ - struct vkCmdSetDepthClampRangeEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDepthClampRangeEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->depthClampMode, params->pDepthClampRange); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthClampRangeEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkDepthClampModeEXT depthClampMode; - PTR32 pDepthClampRange; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDepthClampRangeEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->depthClampMode, (const VkDepthClampRangeEXT *)UlongToPtr(params->pDepthClampRange)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthClipEnableEXT(void *args) -{ - struct vkCmdSetDepthClipEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDepthClipEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->depthClipEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthClipEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthClipEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDepthClipEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->depthClipEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthClipNegativeOneToOneEXT(void *args) -{ - struct vkCmdSetDepthClipNegativeOneToOneEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDepthClipNegativeOneToOneEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->negativeOneToOne); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthClipNegativeOneToOneEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 negativeOneToOne; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDepthClipNegativeOneToOneEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->negativeOneToOne); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthCompareOp(void *args) -{ - struct vkCmdSetDepthCompareOp_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDepthCompareOp(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->depthCompareOp); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthCompareOp(void *args) -{ - struct - { - PTR32 commandBuffer; - VkCompareOp depthCompareOp; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDepthCompareOp(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->depthCompareOp); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthCompareOpEXT(void *args) -{ - struct vkCmdSetDepthCompareOpEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDepthCompareOpEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->depthCompareOp); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthCompareOpEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkCompareOp depthCompareOp; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDepthCompareOpEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->depthCompareOp); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthTestEnable(void *args) -{ - struct vkCmdSetDepthTestEnable_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDepthTestEnable(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->depthTestEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthTestEnable(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthTestEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDepthTestEnable(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->depthTestEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthTestEnableEXT(void *args) -{ - struct vkCmdSetDepthTestEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDepthTestEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->depthTestEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthTestEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthTestEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDepthTestEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->depthTestEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthWriteEnable(void *args) -{ - struct vkCmdSetDepthWriteEnable_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDepthWriteEnable(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->depthWriteEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthWriteEnable(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthWriteEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDepthWriteEnable(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->depthWriteEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDepthWriteEnableEXT(void *args) -{ - struct vkCmdSetDepthWriteEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDepthWriteEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->depthWriteEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDepthWriteEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 depthWriteEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDepthWriteEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->depthWriteEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDescriptorBufferOffsets2EXT(void *args) -{ - struct vkCmdSetDescriptorBufferOffsets2EXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDescriptorBufferOffsets2EXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pSetDescriptorBufferOffsetsInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDescriptorBufferOffsets2EXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pSetDescriptorBufferOffsetsInfo; - } *params = args; - VkSetDescriptorBufferOffsetsInfoEXT pSetDescriptorBufferOffsetsInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkSetDescriptorBufferOffsetsInfoEXT_win32_to_host(ctx, (const VkSetDescriptorBufferOffsetsInfoEXT32 *)UlongToPtr(params->pSetDescriptorBufferOffsetsInfo), &pSetDescriptorBufferOffsetsInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDescriptorBufferOffsets2EXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pSetDescriptorBufferOffsetsInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDescriptorBufferOffsetsEXT(void *args) -{ - struct vkCmdSetDescriptorBufferOffsetsEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDescriptorBufferOffsetsEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pipelineBindPoint, params->layout, params->firstSet, params->setCount, params->pBufferIndices, params->pOffsets); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDescriptorBufferOffsetsEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout DECLSPEC_ALIGN(8) layout; - uint32_t firstSet; - uint32_t setCount; - PTR32 pBufferIndices; - PTR32 pOffsets; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDescriptorBufferOffsetsEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->pipelineBindPoint, params->layout, params->firstSet, params->setCount, (const uint32_t *)UlongToPtr(params->pBufferIndices), (const VkDeviceSize *)UlongToPtr(params->pOffsets)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDeviceMask(void *args) -{ - struct vkCmdSetDeviceMask_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDeviceMask(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->deviceMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDeviceMask(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t deviceMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDeviceMask(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->deviceMask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDeviceMaskKHR(void *args) -{ - struct vkCmdSetDeviceMaskKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDeviceMaskKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->deviceMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDeviceMaskKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t deviceMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDeviceMaskKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->deviceMask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDiscardRectangleEXT(void *args) -{ - struct vkCmdSetDiscardRectangleEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDiscardRectangleEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->firstDiscardRectangle, params->discardRectangleCount, params->pDiscardRectangles); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDiscardRectangleEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstDiscardRectangle; - uint32_t discardRectangleCount; - PTR32 pDiscardRectangles; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDiscardRectangleEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->firstDiscardRectangle, params->discardRectangleCount, (const VkRect2D *)UlongToPtr(params->pDiscardRectangles)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDiscardRectangleEnableEXT(void *args) -{ - struct vkCmdSetDiscardRectangleEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDiscardRectangleEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->discardRectangleEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDiscardRectangleEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 discardRectangleEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDiscardRectangleEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->discardRectangleEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetDiscardRectangleModeEXT(void *args) -{ - struct vkCmdSetDiscardRectangleModeEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetDiscardRectangleModeEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->discardRectangleMode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetDiscardRectangleModeEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkDiscardRectangleModeEXT discardRectangleMode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetDiscardRectangleModeEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->discardRectangleMode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetEvent(void *args) -{ - struct vkCmdSetEvent_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetEvent(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->event, params->stageMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetEvent(void *args) -{ - struct - { - PTR32 commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - VkPipelineStageFlags stageMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetEvent(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->event, params->stageMask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetEvent2(void *args) -{ - struct vkCmdSetEvent2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetEvent2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->event, params->pDependencyInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetEvent2(void *args) -{ - struct - { - PTR32 commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - PTR32 pDependencyInfo; - } *params = args; - VkDependencyInfo pDependencyInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkDependencyInfo_win32_to_host(ctx, (const VkDependencyInfo32 *)UlongToPtr(params->pDependencyInfo), &pDependencyInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetEvent2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->event, &pDependencyInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetEvent2KHR(void *args) -{ - struct vkCmdSetEvent2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetEvent2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->event, params->pDependencyInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetEvent2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - VkEvent DECLSPEC_ALIGN(8) event; - PTR32 pDependencyInfo; - } *params = args; - VkDependencyInfo pDependencyInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkDependencyInfo_win32_to_host(ctx, (const VkDependencyInfo32 *)UlongToPtr(params->pDependencyInfo), &pDependencyInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetEvent2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->event, &pDependencyInfo_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetExclusiveScissorEnableNV(void *args) -{ - struct vkCmdSetExclusiveScissorEnableNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetExclusiveScissorEnableNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->firstExclusiveScissor, params->exclusiveScissorCount, params->pExclusiveScissorEnables); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetExclusiveScissorEnableNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstExclusiveScissor; - uint32_t exclusiveScissorCount; - PTR32 pExclusiveScissorEnables; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetExclusiveScissorEnableNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->firstExclusiveScissor, params->exclusiveScissorCount, (const VkBool32 *)UlongToPtr(params->pExclusiveScissorEnables)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetExclusiveScissorNV(void *args) -{ - struct vkCmdSetExclusiveScissorNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetExclusiveScissorNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->firstExclusiveScissor, params->exclusiveScissorCount, params->pExclusiveScissors); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetExclusiveScissorNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstExclusiveScissor; - uint32_t exclusiveScissorCount; - PTR32 pExclusiveScissors; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetExclusiveScissorNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->firstExclusiveScissor, params->exclusiveScissorCount, (const VkRect2D *)UlongToPtr(params->pExclusiveScissors)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetExtraPrimitiveOverestimationSizeEXT(void *args) -{ - struct vkCmdSetExtraPrimitiveOverestimationSizeEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetExtraPrimitiveOverestimationSizeEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->extraPrimitiveOverestimationSize); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetExtraPrimitiveOverestimationSizeEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - float extraPrimitiveOverestimationSize; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetExtraPrimitiveOverestimationSizeEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->extraPrimitiveOverestimationSize); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetFragmentShadingRateEnumNV(void *args) -{ - struct vkCmdSetFragmentShadingRateEnumNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetFragmentShadingRateEnumNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->shadingRate, params->combinerOps); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetFragmentShadingRateEnumNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkFragmentShadingRateNV shadingRate; - PTR32 combinerOps; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetFragmentShadingRateEnumNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->shadingRate, (const VkFragmentShadingRateCombinerOpKHR *)UlongToPtr(params->combinerOps)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetFragmentShadingRateKHR(void *args) -{ - struct vkCmdSetFragmentShadingRateKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetFragmentShadingRateKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pFragmentSize, params->combinerOps); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetFragmentShadingRateKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pFragmentSize; - PTR32 combinerOps; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetFragmentShadingRateKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, (const VkExtent2D *)UlongToPtr(params->pFragmentSize), (const VkFragmentShadingRateCombinerOpKHR *)UlongToPtr(params->combinerOps)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetFrontFace(void *args) -{ - struct vkCmdSetFrontFace_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetFrontFace(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->frontFace); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetFrontFace(void *args) -{ - struct - { - PTR32 commandBuffer; - VkFrontFace frontFace; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetFrontFace(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->frontFace); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetFrontFaceEXT(void *args) -{ - struct vkCmdSetFrontFaceEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetFrontFaceEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->frontFace); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetFrontFaceEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkFrontFace frontFace; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetFrontFaceEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->frontFace); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetLineRasterizationModeEXT(void *args) -{ - struct vkCmdSetLineRasterizationModeEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetLineRasterizationModeEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->lineRasterizationMode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetLineRasterizationModeEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkLineRasterizationModeEXT lineRasterizationMode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetLineRasterizationModeEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->lineRasterizationMode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetLineStipple(void *args) -{ - struct vkCmdSetLineStipple_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetLineStipple(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->lineStippleFactor, params->lineStipplePattern); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetLineStipple(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t lineStippleFactor; - uint16_t lineStipplePattern; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetLineStipple(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->lineStippleFactor, params->lineStipplePattern); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetLineStippleEXT(void *args) -{ - struct vkCmdSetLineStippleEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetLineStippleEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->lineStippleFactor, params->lineStipplePattern); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetLineStippleEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t lineStippleFactor; - uint16_t lineStipplePattern; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetLineStippleEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->lineStippleFactor, params->lineStipplePattern); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetLineStippleEnableEXT(void *args) -{ - struct vkCmdSetLineStippleEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetLineStippleEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->stippledLineEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetLineStippleEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 stippledLineEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetLineStippleEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->stippledLineEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetLineStippleKHR(void *args) -{ - struct vkCmdSetLineStippleKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetLineStippleKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->lineStippleFactor, params->lineStipplePattern); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetLineStippleKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t lineStippleFactor; - uint16_t lineStipplePattern; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetLineStippleKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->lineStippleFactor, params->lineStipplePattern); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetLineWidth(void *args) -{ - struct vkCmdSetLineWidth_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetLineWidth(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->lineWidth); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetLineWidth(void *args) -{ - struct - { - PTR32 commandBuffer; - float lineWidth; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetLineWidth(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->lineWidth); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetLogicOpEXT(void *args) -{ - struct vkCmdSetLogicOpEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetLogicOpEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->logicOp); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetLogicOpEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkLogicOp logicOp; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetLogicOpEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->logicOp); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetLogicOpEnableEXT(void *args) -{ - struct vkCmdSetLogicOpEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetLogicOpEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->logicOpEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetLogicOpEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 logicOpEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetLogicOpEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->logicOpEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetPatchControlPointsEXT(void *args) -{ - struct vkCmdSetPatchControlPointsEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetPatchControlPointsEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->patchControlPoints); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetPatchControlPointsEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t patchControlPoints; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetPatchControlPointsEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->patchControlPoints); -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCmdSetPerformanceMarkerINTEL(void *args) -{ - struct vkCmdSetPerformanceMarkerINTEL_params *params = args; - - TRACE("%p, %p\n", params->commandBuffer, params->pMarkerInfo); - - params->result = wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetPerformanceMarkerINTEL(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pMarkerInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCmdSetPerformanceMarkerINTEL(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pMarkerInfo; - VkResult result; - } *params = args; - VkPerformanceMarkerInfoINTEL pMarkerInfo_host; - - TRACE("%#x, %#x\n", params->commandBuffer, params->pMarkerInfo); - - convert_VkPerformanceMarkerInfoINTEL_win32_to_host((const VkPerformanceMarkerInfoINTEL32 *)UlongToPtr(params->pMarkerInfo), &pMarkerInfo_host); - params->result = wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetPerformanceMarkerINTEL(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pMarkerInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCmdSetPerformanceOverrideINTEL(void *args) -{ - struct vkCmdSetPerformanceOverrideINTEL_params *params = args; - - TRACE("%p, %p\n", params->commandBuffer, params->pOverrideInfo); - - params->result = wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetPerformanceOverrideINTEL(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pOverrideInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCmdSetPerformanceOverrideINTEL(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pOverrideInfo; - VkResult result; - } *params = args; - VkPerformanceOverrideInfoINTEL pOverrideInfo_host; - - TRACE("%#x, %#x\n", params->commandBuffer, params->pOverrideInfo); - - convert_VkPerformanceOverrideInfoINTEL_win32_to_host((const VkPerformanceOverrideInfoINTEL32 *)UlongToPtr(params->pOverrideInfo), &pOverrideInfo_host); - params->result = wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetPerformanceOverrideINTEL(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pOverrideInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCmdSetPerformanceStreamMarkerINTEL(void *args) -{ - struct vkCmdSetPerformanceStreamMarkerINTEL_params *params = args; - - TRACE("%p, %p\n", params->commandBuffer, params->pMarkerInfo); - - params->result = wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetPerformanceStreamMarkerINTEL(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pMarkerInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCmdSetPerformanceStreamMarkerINTEL(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pMarkerInfo; - VkResult result; - } *params = args; - VkPerformanceStreamMarkerInfoINTEL pMarkerInfo_host; - - TRACE("%#x, %#x\n", params->commandBuffer, params->pMarkerInfo); - - convert_VkPerformanceStreamMarkerInfoINTEL_win32_to_host((const VkPerformanceStreamMarkerInfoINTEL32 *)UlongToPtr(params->pMarkerInfo), &pMarkerInfo_host); - params->result = wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetPerformanceStreamMarkerINTEL(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pMarkerInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetPolygonModeEXT(void *args) -{ - struct vkCmdSetPolygonModeEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetPolygonModeEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->polygonMode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetPolygonModeEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPolygonMode polygonMode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetPolygonModeEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->polygonMode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetPrimitiveRestartEnable(void *args) -{ - struct vkCmdSetPrimitiveRestartEnable_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetPrimitiveRestartEnable(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->primitiveRestartEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetPrimitiveRestartEnable(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 primitiveRestartEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetPrimitiveRestartEnable(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->primitiveRestartEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetPrimitiveRestartEnableEXT(void *args) -{ - struct vkCmdSetPrimitiveRestartEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetPrimitiveRestartEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->primitiveRestartEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetPrimitiveRestartEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 primitiveRestartEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetPrimitiveRestartEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->primitiveRestartEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetPrimitiveTopology(void *args) -{ - struct vkCmdSetPrimitiveTopology_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetPrimitiveTopology(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->primitiveTopology); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetPrimitiveTopology(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPrimitiveTopology primitiveTopology; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetPrimitiveTopology(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->primitiveTopology); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetPrimitiveTopologyEXT(void *args) -{ - struct vkCmdSetPrimitiveTopologyEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetPrimitiveTopologyEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->primitiveTopology); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetPrimitiveTopologyEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPrimitiveTopology primitiveTopology; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetPrimitiveTopologyEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->primitiveTopology); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetProvokingVertexModeEXT(void *args) -{ - struct vkCmdSetProvokingVertexModeEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetProvokingVertexModeEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->provokingVertexMode); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetProvokingVertexModeEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkProvokingVertexModeEXT provokingVertexMode; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetProvokingVertexModeEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->provokingVertexMode); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetRasterizationSamplesEXT(void *args) -{ - struct vkCmdSetRasterizationSamplesEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetRasterizationSamplesEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->rasterizationSamples); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetRasterizationSamplesEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkSampleCountFlagBits rasterizationSamples; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetRasterizationSamplesEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->rasterizationSamples); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetRasterizationStreamEXT(void *args) -{ - struct vkCmdSetRasterizationStreamEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetRasterizationStreamEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->rasterizationStream); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetRasterizationStreamEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t rasterizationStream; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetRasterizationStreamEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->rasterizationStream); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetRasterizerDiscardEnable(void *args) -{ - struct vkCmdSetRasterizerDiscardEnable_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetRasterizerDiscardEnable(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->rasterizerDiscardEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetRasterizerDiscardEnable(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 rasterizerDiscardEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetRasterizerDiscardEnable(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->rasterizerDiscardEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetRasterizerDiscardEnableEXT(void *args) -{ - struct vkCmdSetRasterizerDiscardEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetRasterizerDiscardEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->rasterizerDiscardEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetRasterizerDiscardEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 rasterizerDiscardEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetRasterizerDiscardEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->rasterizerDiscardEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetRayTracingPipelineStackSizeKHR(void *args) -{ - struct vkCmdSetRayTracingPipelineStackSizeKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetRayTracingPipelineStackSizeKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pipelineStackSize); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetRayTracingPipelineStackSizeKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t pipelineStackSize; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetRayTracingPipelineStackSizeKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->pipelineStackSize); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetRenderingAttachmentLocations(void *args) -{ - struct vkCmdSetRenderingAttachmentLocations_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetRenderingAttachmentLocations(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pLocationInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetRenderingAttachmentLocations(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pLocationInfo; - } *params = args; - VkRenderingAttachmentLocationInfo pLocationInfo_host; - - convert_VkRenderingAttachmentLocationInfo_win32_to_host((const VkRenderingAttachmentLocationInfo32 *)UlongToPtr(params->pLocationInfo), &pLocationInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetRenderingAttachmentLocations(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pLocationInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetRenderingAttachmentLocationsKHR(void *args) -{ - struct vkCmdSetRenderingAttachmentLocationsKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetRenderingAttachmentLocationsKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pLocationInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetRenderingAttachmentLocationsKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pLocationInfo; - } *params = args; - VkRenderingAttachmentLocationInfo pLocationInfo_host; - - convert_VkRenderingAttachmentLocationInfo_win32_to_host((const VkRenderingAttachmentLocationInfo32 *)UlongToPtr(params->pLocationInfo), &pLocationInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetRenderingAttachmentLocationsKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pLocationInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetRenderingInputAttachmentIndices(void *args) -{ - struct vkCmdSetRenderingInputAttachmentIndices_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetRenderingInputAttachmentIndices(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pInputAttachmentIndexInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetRenderingInputAttachmentIndices(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pInputAttachmentIndexInfo; - } *params = args; - VkRenderingInputAttachmentIndexInfo pInputAttachmentIndexInfo_host; - - convert_VkRenderingInputAttachmentIndexInfo_win32_to_host((const VkRenderingInputAttachmentIndexInfo32 *)UlongToPtr(params->pInputAttachmentIndexInfo), &pInputAttachmentIndexInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetRenderingInputAttachmentIndices(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pInputAttachmentIndexInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetRenderingInputAttachmentIndicesKHR(void *args) -{ - struct vkCmdSetRenderingInputAttachmentIndicesKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetRenderingInputAttachmentIndicesKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pInputAttachmentIndexInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetRenderingInputAttachmentIndicesKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pInputAttachmentIndexInfo; - } *params = args; - VkRenderingInputAttachmentIndexInfo pInputAttachmentIndexInfo_host; - - convert_VkRenderingInputAttachmentIndexInfo_win32_to_host((const VkRenderingInputAttachmentIndexInfo32 *)UlongToPtr(params->pInputAttachmentIndexInfo), &pInputAttachmentIndexInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetRenderingInputAttachmentIndicesKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pInputAttachmentIndexInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetRepresentativeFragmentTestEnableNV(void *args) -{ - struct vkCmdSetRepresentativeFragmentTestEnableNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetRepresentativeFragmentTestEnableNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->representativeFragmentTestEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetRepresentativeFragmentTestEnableNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 representativeFragmentTestEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetRepresentativeFragmentTestEnableNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->representativeFragmentTestEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetSampleLocationsEXT(void *args) -{ - struct vkCmdSetSampleLocationsEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetSampleLocationsEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pSampleLocationsInfo); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetSampleLocationsEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pSampleLocationsInfo; - } *params = args; - VkSampleLocationsInfoEXT pSampleLocationsInfo_host; - - convert_VkSampleLocationsInfoEXT_win32_to_host((const VkSampleLocationsInfoEXT32 *)UlongToPtr(params->pSampleLocationsInfo), &pSampleLocationsInfo_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetSampleLocationsEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pSampleLocationsInfo_host); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetSampleLocationsEnableEXT(void *args) -{ - struct vkCmdSetSampleLocationsEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetSampleLocationsEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->sampleLocationsEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetSampleLocationsEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 sampleLocationsEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetSampleLocationsEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->sampleLocationsEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetSampleMaskEXT(void *args) -{ - struct vkCmdSetSampleMaskEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetSampleMaskEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->samples, params->pSampleMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetSampleMaskEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkSampleCountFlagBits samples; - PTR32 pSampleMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetSampleMaskEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->samples, (const VkSampleMask *)UlongToPtr(params->pSampleMask)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetScissor(void *args) -{ - struct vkCmdSetScissor_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetScissor(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->firstScissor, params->scissorCount, params->pScissors); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetScissor(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstScissor; - uint32_t scissorCount; - PTR32 pScissors; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetScissor(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->firstScissor, params->scissorCount, (const VkRect2D *)UlongToPtr(params->pScissors)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetScissorWithCount(void *args) -{ - struct vkCmdSetScissorWithCount_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetScissorWithCount(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->scissorCount, params->pScissors); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetScissorWithCount(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t scissorCount; - PTR32 pScissors; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetScissorWithCount(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->scissorCount, (const VkRect2D *)UlongToPtr(params->pScissors)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetScissorWithCountEXT(void *args) -{ - struct vkCmdSetScissorWithCountEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetScissorWithCountEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->scissorCount, params->pScissors); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetScissorWithCountEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t scissorCount; - PTR32 pScissors; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetScissorWithCountEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->scissorCount, (const VkRect2D *)UlongToPtr(params->pScissors)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetShadingRateImageEnableNV(void *args) -{ - struct vkCmdSetShadingRateImageEnableNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetShadingRateImageEnableNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->shadingRateImageEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetShadingRateImageEnableNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 shadingRateImageEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetShadingRateImageEnableNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->shadingRateImageEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetStencilCompareMask(void *args) -{ - struct vkCmdSetStencilCompareMask_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetStencilCompareMask(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->faceMask, params->compareMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetStencilCompareMask(void *args) -{ - struct - { - PTR32 commandBuffer; - VkStencilFaceFlags faceMask; - uint32_t compareMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetStencilCompareMask(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->faceMask, params->compareMask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetStencilOp(void *args) -{ - struct vkCmdSetStencilOp_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetStencilOp(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->faceMask, params->failOp, params->passOp, params->depthFailOp, params->compareOp); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetStencilOp(void *args) -{ - struct - { - PTR32 commandBuffer; - VkStencilFaceFlags faceMask; - VkStencilOp failOp; - VkStencilOp passOp; - VkStencilOp depthFailOp; - VkCompareOp compareOp; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetStencilOp(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->faceMask, params->failOp, params->passOp, params->depthFailOp, params->compareOp); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetStencilOpEXT(void *args) -{ - struct vkCmdSetStencilOpEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetStencilOpEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->faceMask, params->failOp, params->passOp, params->depthFailOp, params->compareOp); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetStencilOpEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkStencilFaceFlags faceMask; - VkStencilOp failOp; - VkStencilOp passOp; - VkStencilOp depthFailOp; - VkCompareOp compareOp; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetStencilOpEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->faceMask, params->failOp, params->passOp, params->depthFailOp, params->compareOp); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetStencilReference(void *args) -{ - struct vkCmdSetStencilReference_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetStencilReference(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->faceMask, params->reference); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetStencilReference(void *args) -{ - struct - { - PTR32 commandBuffer; - VkStencilFaceFlags faceMask; - uint32_t reference; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetStencilReference(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->faceMask, params->reference); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetStencilTestEnable(void *args) -{ - struct vkCmdSetStencilTestEnable_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetStencilTestEnable(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->stencilTestEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetStencilTestEnable(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 stencilTestEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetStencilTestEnable(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->stencilTestEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetStencilTestEnableEXT(void *args) -{ - struct vkCmdSetStencilTestEnableEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetStencilTestEnableEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->stencilTestEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetStencilTestEnableEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 stencilTestEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetStencilTestEnableEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->stencilTestEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetStencilWriteMask(void *args) -{ - struct vkCmdSetStencilWriteMask_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetStencilWriteMask(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->faceMask, params->writeMask); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetStencilWriteMask(void *args) -{ - struct - { - PTR32 commandBuffer; - VkStencilFaceFlags faceMask; - uint32_t writeMask; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetStencilWriteMask(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->faceMask, params->writeMask); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetTessellationDomainOriginEXT(void *args) -{ - struct vkCmdSetTessellationDomainOriginEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetTessellationDomainOriginEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->domainOrigin); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetTessellationDomainOriginEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - VkTessellationDomainOrigin domainOrigin; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetTessellationDomainOriginEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->domainOrigin); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetVertexInputEXT(void *args) -{ - struct vkCmdSetVertexInputEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetVertexInputEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->vertexBindingDescriptionCount, params->pVertexBindingDescriptions, params->vertexAttributeDescriptionCount, params->pVertexAttributeDescriptions); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetVertexInputEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t vertexBindingDescriptionCount; - PTR32 pVertexBindingDescriptions; - uint32_t vertexAttributeDescriptionCount; - PTR32 pVertexAttributeDescriptions; - } *params = args; - const VkVertexInputBindingDescription2EXT *pVertexBindingDescriptions_host; - const VkVertexInputAttributeDescription2EXT *pVertexAttributeDescriptions_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pVertexBindingDescriptions_host = convert_VkVertexInputBindingDescription2EXT_array_win32_to_host(ctx, (const VkVertexInputBindingDescription2EXT32 *)UlongToPtr(params->pVertexBindingDescriptions), params->vertexBindingDescriptionCount); - pVertexAttributeDescriptions_host = convert_VkVertexInputAttributeDescription2EXT_array_win32_to_host(ctx, (const VkVertexInputAttributeDescription2EXT32 *)UlongToPtr(params->pVertexAttributeDescriptions), params->vertexAttributeDescriptionCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetVertexInputEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->vertexBindingDescriptionCount, pVertexBindingDescriptions_host, params->vertexAttributeDescriptionCount, pVertexAttributeDescriptions_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetViewport(void *args) -{ - struct vkCmdSetViewport_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetViewport(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->firstViewport, params->viewportCount, params->pViewports); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetViewport(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstViewport; - uint32_t viewportCount; - PTR32 pViewports; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetViewport(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->firstViewport, params->viewportCount, (const VkViewport *)UlongToPtr(params->pViewports)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetViewportShadingRatePaletteNV(void *args) -{ - struct vkCmdSetViewportShadingRatePaletteNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetViewportShadingRatePaletteNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->firstViewport, params->viewportCount, params->pShadingRatePalettes); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetViewportShadingRatePaletteNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstViewport; - uint32_t viewportCount; - PTR32 pShadingRatePalettes; - } *params = args; - const VkShadingRatePaletteNV *pShadingRatePalettes_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pShadingRatePalettes_host = convert_VkShadingRatePaletteNV_array_win32_to_host(ctx, (const VkShadingRatePaletteNV32 *)UlongToPtr(params->pShadingRatePalettes), params->viewportCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetViewportShadingRatePaletteNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->firstViewport, params->viewportCount, pShadingRatePalettes_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetViewportSwizzleNV(void *args) -{ - struct vkCmdSetViewportSwizzleNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetViewportSwizzleNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->firstViewport, params->viewportCount, params->pViewportSwizzles); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetViewportSwizzleNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstViewport; - uint32_t viewportCount; - PTR32 pViewportSwizzles; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetViewportSwizzleNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->firstViewport, params->viewportCount, (const VkViewportSwizzleNV *)UlongToPtr(params->pViewportSwizzles)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetViewportWScalingEnableNV(void *args) -{ - struct vkCmdSetViewportWScalingEnableNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetViewportWScalingEnableNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->viewportWScalingEnable); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetViewportWScalingEnableNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBool32 viewportWScalingEnable; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetViewportWScalingEnableNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->viewportWScalingEnable); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetViewportWScalingNV(void *args) -{ - struct vkCmdSetViewportWScalingNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetViewportWScalingNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->firstViewport, params->viewportCount, params->pViewportWScalings); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetViewportWScalingNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t firstViewport; - uint32_t viewportCount; - PTR32 pViewportWScalings; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetViewportWScalingNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->firstViewport, params->viewportCount, (const VkViewportWScalingNV *)UlongToPtr(params->pViewportWScalings)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetViewportWithCount(void *args) -{ - struct vkCmdSetViewportWithCount_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetViewportWithCount(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->viewportCount, params->pViewports); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetViewportWithCount(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t viewportCount; - PTR32 pViewports; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetViewportWithCount(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->viewportCount, (const VkViewport *)UlongToPtr(params->pViewports)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSetViewportWithCountEXT(void *args) -{ - struct vkCmdSetViewportWithCountEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSetViewportWithCountEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->viewportCount, params->pViewports); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSetViewportWithCountEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t viewportCount; - PTR32 pViewports; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSetViewportWithCountEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->viewportCount, (const VkViewport *)UlongToPtr(params->pViewports)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdSubpassShadingHUAWEI(void *args) -{ - struct vkCmdSubpassShadingHUAWEI_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdSubpassShadingHUAWEI(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdSubpassShadingHUAWEI(void *args) -{ - struct - { - PTR32 commandBuffer; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdSubpassShadingHUAWEI(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer); -} - -#ifdef _WIN64 -static void thunk64_vkCmdTraceRaysIndirect2KHR(void *args) -{ - struct vkCmdTraceRaysIndirect2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdTraceRaysIndirect2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->indirectDeviceAddress); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdTraceRaysIndirect2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - VkDeviceAddress DECLSPEC_ALIGN(8) indirectDeviceAddress; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdTraceRaysIndirect2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->indirectDeviceAddress); -} - -#ifdef _WIN64 -static void thunk64_vkCmdTraceRaysIndirectKHR(void *args) -{ - struct vkCmdTraceRaysIndirectKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdTraceRaysIndirectKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pRaygenShaderBindingTable, params->pMissShaderBindingTable, params->pHitShaderBindingTable, params->pCallableShaderBindingTable, params->indirectDeviceAddress); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdTraceRaysIndirectKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pRaygenShaderBindingTable; - PTR32 pMissShaderBindingTable; - PTR32 pHitShaderBindingTable; - PTR32 pCallableShaderBindingTable; - VkDeviceAddress DECLSPEC_ALIGN(8) indirectDeviceAddress; - } *params = args; - VkStridedDeviceAddressRegionKHR pRaygenShaderBindingTable_host; - VkStridedDeviceAddressRegionKHR pMissShaderBindingTable_host; - VkStridedDeviceAddressRegionKHR pHitShaderBindingTable_host; - VkStridedDeviceAddressRegionKHR pCallableShaderBindingTable_host; - - convert_VkStridedDeviceAddressRegionKHR_win32_to_host((const VkStridedDeviceAddressRegionKHR32 *)UlongToPtr(params->pRaygenShaderBindingTable), &pRaygenShaderBindingTable_host); - convert_VkStridedDeviceAddressRegionKHR_win32_to_host((const VkStridedDeviceAddressRegionKHR32 *)UlongToPtr(params->pMissShaderBindingTable), &pMissShaderBindingTable_host); - convert_VkStridedDeviceAddressRegionKHR_win32_to_host((const VkStridedDeviceAddressRegionKHR32 *)UlongToPtr(params->pHitShaderBindingTable), &pHitShaderBindingTable_host); - convert_VkStridedDeviceAddressRegionKHR_win32_to_host((const VkStridedDeviceAddressRegionKHR32 *)UlongToPtr(params->pCallableShaderBindingTable), &pCallableShaderBindingTable_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdTraceRaysIndirectKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pRaygenShaderBindingTable_host, &pMissShaderBindingTable_host, &pHitShaderBindingTable_host, &pCallableShaderBindingTable_host, params->indirectDeviceAddress); -} - -#ifdef _WIN64 -static void thunk64_vkCmdTraceRaysKHR(void *args) -{ - struct vkCmdTraceRaysKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdTraceRaysKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pRaygenShaderBindingTable, params->pMissShaderBindingTable, params->pHitShaderBindingTable, params->pCallableShaderBindingTable, params->width, params->height, params->depth); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdTraceRaysKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - PTR32 pRaygenShaderBindingTable; - PTR32 pMissShaderBindingTable; - PTR32 pHitShaderBindingTable; - PTR32 pCallableShaderBindingTable; - uint32_t width; - uint32_t height; - uint32_t depth; - } *params = args; - VkStridedDeviceAddressRegionKHR pRaygenShaderBindingTable_host; - VkStridedDeviceAddressRegionKHR pMissShaderBindingTable_host; - VkStridedDeviceAddressRegionKHR pHitShaderBindingTable_host; - VkStridedDeviceAddressRegionKHR pCallableShaderBindingTable_host; - - convert_VkStridedDeviceAddressRegionKHR_win32_to_host((const VkStridedDeviceAddressRegionKHR32 *)UlongToPtr(params->pRaygenShaderBindingTable), &pRaygenShaderBindingTable_host); - convert_VkStridedDeviceAddressRegionKHR_win32_to_host((const VkStridedDeviceAddressRegionKHR32 *)UlongToPtr(params->pMissShaderBindingTable), &pMissShaderBindingTable_host); - convert_VkStridedDeviceAddressRegionKHR_win32_to_host((const VkStridedDeviceAddressRegionKHR32 *)UlongToPtr(params->pHitShaderBindingTable), &pHitShaderBindingTable_host); - convert_VkStridedDeviceAddressRegionKHR_win32_to_host((const VkStridedDeviceAddressRegionKHR32 *)UlongToPtr(params->pCallableShaderBindingTable), &pCallableShaderBindingTable_host); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdTraceRaysKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, &pRaygenShaderBindingTable_host, &pMissShaderBindingTable_host, &pHitShaderBindingTable_host, &pCallableShaderBindingTable_host, params->width, params->height, params->depth); -} - -#ifdef _WIN64 -static void thunk64_vkCmdTraceRaysNV(void *args) -{ - struct vkCmdTraceRaysNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdTraceRaysNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->raygenShaderBindingTableBuffer, params->raygenShaderBindingOffset, params->missShaderBindingTableBuffer, params->missShaderBindingOffset, params->missShaderBindingStride, params->hitShaderBindingTableBuffer, params->hitShaderBindingOffset, params->hitShaderBindingStride, params->callableShaderBindingTableBuffer, params->callableShaderBindingOffset, params->callableShaderBindingStride, params->width, params->height, params->depth); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdTraceRaysNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) raygenShaderBindingTableBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) raygenShaderBindingOffset; - VkBuffer DECLSPEC_ALIGN(8) missShaderBindingTableBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) missShaderBindingOffset; - VkDeviceSize DECLSPEC_ALIGN(8) missShaderBindingStride; - VkBuffer DECLSPEC_ALIGN(8) hitShaderBindingTableBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) hitShaderBindingOffset; - VkDeviceSize DECLSPEC_ALIGN(8) hitShaderBindingStride; - VkBuffer DECLSPEC_ALIGN(8) callableShaderBindingTableBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) callableShaderBindingOffset; - VkDeviceSize DECLSPEC_ALIGN(8) callableShaderBindingStride; - uint32_t width; - uint32_t height; - uint32_t depth; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdTraceRaysNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->raygenShaderBindingTableBuffer, params->raygenShaderBindingOffset, params->missShaderBindingTableBuffer, params->missShaderBindingOffset, params->missShaderBindingStride, params->hitShaderBindingTableBuffer, params->hitShaderBindingOffset, params->hitShaderBindingStride, params->callableShaderBindingTableBuffer, params->callableShaderBindingOffset, params->callableShaderBindingStride, params->width, params->height, params->depth); -} - -#ifdef _WIN64 -static void thunk64_vkCmdUpdateBuffer(void *args) -{ - struct vkCmdUpdateBuffer_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdUpdateBuffer(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->dstBuffer, params->dstOffset, params->dataSize, params->pData); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdUpdateBuffer(void *args) -{ - struct - { - PTR32 commandBuffer; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - VkDeviceSize DECLSPEC_ALIGN(8) dataSize; - PTR32 pData; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdUpdateBuffer(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->dstBuffer, params->dstOffset, params->dataSize, (const void *)UlongToPtr(params->pData)); -} - -#ifdef _WIN64 -static void thunk64_vkCmdUpdatePipelineIndirectBufferNV(void *args) -{ - struct vkCmdUpdatePipelineIndirectBufferNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdUpdatePipelineIndirectBufferNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pipelineBindPoint, params->pipeline); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdUpdatePipelineIndirectBufferNV(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdUpdatePipelineIndirectBufferNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->pipelineBindPoint, params->pipeline); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWaitEvents(void *args) -{ - struct vkCmdWaitEvents_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdWaitEvents(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->eventCount, params->pEvents, params->srcStageMask, params->dstStageMask, params->memoryBarrierCount, params->pMemoryBarriers, params->bufferMemoryBarrierCount, params->pBufferMemoryBarriers, params->imageMemoryBarrierCount, params->pImageMemoryBarriers); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWaitEvents(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t eventCount; - PTR32 pEvents; - VkPipelineStageFlags srcStageMask; - VkPipelineStageFlags dstStageMask; - uint32_t memoryBarrierCount; - PTR32 pMemoryBarriers; - uint32_t bufferMemoryBarrierCount; - PTR32 pBufferMemoryBarriers; - uint32_t imageMemoryBarrierCount; - PTR32 pImageMemoryBarriers; - } *params = args; - const VkMemoryBarrier *pMemoryBarriers_host; - const VkBufferMemoryBarrier *pBufferMemoryBarriers_host; - const VkImageMemoryBarrier *pImageMemoryBarriers_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pMemoryBarriers_host = convert_VkMemoryBarrier_array_win32_to_host(ctx, (const VkMemoryBarrier32 *)UlongToPtr(params->pMemoryBarriers), params->memoryBarrierCount); - pBufferMemoryBarriers_host = convert_VkBufferMemoryBarrier_array_win32_to_host(ctx, (const VkBufferMemoryBarrier32 *)UlongToPtr(params->pBufferMemoryBarriers), params->bufferMemoryBarrierCount); - pImageMemoryBarriers_host = convert_VkImageMemoryBarrier_array_win32_to_host(ctx, (const VkImageMemoryBarrier32 *)UlongToPtr(params->pImageMemoryBarriers), params->imageMemoryBarrierCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdWaitEvents(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->eventCount, (const VkEvent *)UlongToPtr(params->pEvents), params->srcStageMask, params->dstStageMask, params->memoryBarrierCount, pMemoryBarriers_host, params->bufferMemoryBarrierCount, pBufferMemoryBarriers_host, params->imageMemoryBarrierCount, pImageMemoryBarriers_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWaitEvents2(void *args) -{ - struct vkCmdWaitEvents2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdWaitEvents2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->eventCount, params->pEvents, params->pDependencyInfos); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWaitEvents2(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t eventCount; - PTR32 pEvents; - PTR32 pDependencyInfos; - } *params = args; - const VkDependencyInfo *pDependencyInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pDependencyInfos_host = convert_VkDependencyInfo_array_win32_to_host(ctx, (const VkDependencyInfo32 *)UlongToPtr(params->pDependencyInfos), params->eventCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdWaitEvents2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->eventCount, (const VkEvent *)UlongToPtr(params->pEvents), pDependencyInfos_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWaitEvents2KHR(void *args) -{ - struct vkCmdWaitEvents2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdWaitEvents2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->eventCount, params->pEvents, params->pDependencyInfos); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWaitEvents2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t eventCount; - PTR32 pEvents; - PTR32 pDependencyInfos; - } *params = args; - const VkDependencyInfo *pDependencyInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pDependencyInfos_host = convert_VkDependencyInfo_array_win32_to_host(ctx, (const VkDependencyInfo32 *)UlongToPtr(params->pDependencyInfos), params->eventCount); - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdWaitEvents2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->eventCount, (const VkEvent *)UlongToPtr(params->pEvents), pDependencyInfos_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWriteAccelerationStructuresPropertiesKHR(void *args) -{ - struct vkCmdWriteAccelerationStructuresPropertiesKHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdWriteAccelerationStructuresPropertiesKHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->accelerationStructureCount, params->pAccelerationStructures, params->queryType, params->queryPool, params->firstQuery); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWriteAccelerationStructuresPropertiesKHR(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t accelerationStructureCount; - PTR32 pAccelerationStructures; - VkQueryType queryType; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdWriteAccelerationStructuresPropertiesKHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->accelerationStructureCount, (const VkAccelerationStructureKHR *)UlongToPtr(params->pAccelerationStructures), params->queryType, params->queryPool, params->firstQuery); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWriteAccelerationStructuresPropertiesNV(void *args) -{ - struct vkCmdWriteAccelerationStructuresPropertiesNV_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdWriteAccelerationStructuresPropertiesNV(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->accelerationStructureCount, params->pAccelerationStructures, params->queryType, params->queryPool, params->firstQuery); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWriteAccelerationStructuresPropertiesNV(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t accelerationStructureCount; - PTR32 pAccelerationStructures; - VkQueryType queryType; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdWriteAccelerationStructuresPropertiesNV(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->accelerationStructureCount, (const VkAccelerationStructureNV *)UlongToPtr(params->pAccelerationStructures), params->queryType, params->queryPool, params->firstQuery); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWriteBufferMarker2AMD(void *args) -{ - struct vkCmdWriteBufferMarker2AMD_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdWriteBufferMarker2AMD(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->stage, params->dstBuffer, params->dstOffset, params->marker); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWriteBufferMarker2AMD(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stage; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - uint32_t marker; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdWriteBufferMarker2AMD(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->stage, params->dstBuffer, params->dstOffset, params->marker); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWriteBufferMarkerAMD(void *args) -{ - struct vkCmdWriteBufferMarkerAMD_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdWriteBufferMarkerAMD(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pipelineStage, params->dstBuffer, params->dstOffset, params->marker); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWriteBufferMarkerAMD(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineStageFlagBits pipelineStage; - VkBuffer DECLSPEC_ALIGN(8) dstBuffer; - VkDeviceSize DECLSPEC_ALIGN(8) dstOffset; - uint32_t marker; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdWriteBufferMarkerAMD(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->pipelineStage, params->dstBuffer, params->dstOffset, params->marker); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWriteMicromapsPropertiesEXT(void *args) -{ - struct vkCmdWriteMicromapsPropertiesEXT_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdWriteMicromapsPropertiesEXT(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->micromapCount, params->pMicromaps, params->queryType, params->queryPool, params->firstQuery); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWriteMicromapsPropertiesEXT(void *args) -{ - struct - { - PTR32 commandBuffer; - uint32_t micromapCount; - PTR32 pMicromaps; - VkQueryType queryType; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdWriteMicromapsPropertiesEXT(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->micromapCount, (const VkMicromapEXT *)UlongToPtr(params->pMicromaps), params->queryType, params->queryPool, params->firstQuery); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWriteTimestamp(void *args) -{ - struct vkCmdWriteTimestamp_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdWriteTimestamp(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->pipelineStage, params->queryPool, params->query); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWriteTimestamp(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineStageFlagBits pipelineStage; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdWriteTimestamp(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->pipelineStage, params->queryPool, params->query); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWriteTimestamp2(void *args) -{ - struct vkCmdWriteTimestamp2_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdWriteTimestamp2(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->stage, params->queryPool, params->query); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWriteTimestamp2(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stage; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdWriteTimestamp2(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->stage, params->queryPool, params->query); -} - -#ifdef _WIN64 -static void thunk64_vkCmdWriteTimestamp2KHR(void *args) -{ - struct vkCmdWriteTimestamp2KHR_params *params = args; - - wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkCmdWriteTimestamp2KHR(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->stage, params->queryPool, params->query); -} -#endif /* _WIN64 */ - -static void thunk32_vkCmdWriteTimestamp2KHR(void *args) -{ - struct - { - PTR32 commandBuffer; - VkPipelineStageFlags2 DECLSPEC_ALIGN(8) stage; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t query; - } *params = args; - - wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkCmdWriteTimestamp2KHR(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->stage, params->queryPool, params->query); -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCompileDeferredNV(void *args) -{ - struct vkCompileDeferredNV_params *params = args; - - TRACE("%p, 0x%s, %u\n", params->device, wine_dbgstr_longlong(params->pipeline), params->shader); - - params->result = vulkan_device_from_handle(params->device)->p_vkCompileDeferredNV(vulkan_device_from_handle(params->device)->host.device, params->pipeline, params->shader); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCompileDeferredNV(void *args) -{ - struct - { - PTR32 device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t shader; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %u\n", params->device, wine_dbgstr_longlong(params->pipeline), params->shader); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCompileDeferredNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->pipeline, params->shader); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyAccelerationStructureKHR(void *args) -{ - struct vkCopyAccelerationStructureKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkCopyAccelerationStructureKHR(vulkan_device_from_handle(params->device)->host.device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host.deferred_operation : 0, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyAccelerationStructureKHR(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - PTR32 pInfo; - VkResult result; - } *params = args; - VkCopyAccelerationStructureInfoKHR pInfo_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - convert_VkCopyAccelerationStructureInfoKHR_win32_to_host((const VkCopyAccelerationStructureInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCopyAccelerationStructureKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host.deferred_operation : 0, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyAccelerationStructureToMemoryKHR(void *args) -{ - struct vkCopyAccelerationStructureToMemoryKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkCopyAccelerationStructureToMemoryKHR(vulkan_device_from_handle(params->device)->host.device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host.deferred_operation : 0, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyAccelerationStructureToMemoryKHR(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - PTR32 pInfo; - VkResult result; - } *params = args; - VkCopyAccelerationStructureToMemoryInfoKHR pInfo_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - convert_VkCopyAccelerationStructureToMemoryInfoKHR_win32_to_host((const VkCopyAccelerationStructureToMemoryInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCopyAccelerationStructureToMemoryKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host.deferred_operation : 0, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyImageToImage(void *args) -{ - struct vkCopyImageToImage_params *params = args; - - TRACE("%p, %p\n", params->device, params->pCopyImageToImageInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkCopyImageToImage(vulkan_device_from_handle(params->device)->host.device, params->pCopyImageToImageInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyImageToImage(void *args) -{ - struct - { - PTR32 device; - PTR32 pCopyImageToImageInfo; - VkResult result; - } *params = args; - VkCopyImageToImageInfo pCopyImageToImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->device, params->pCopyImageToImageInfo); - - init_conversion_context(ctx); - convert_VkCopyImageToImageInfo_win32_to_host(ctx, (const VkCopyImageToImageInfo32 *)UlongToPtr(params->pCopyImageToImageInfo), &pCopyImageToImageInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCopyImageToImage(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCopyImageToImageInfo_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyImageToImageEXT(void *args) -{ - struct vkCopyImageToImageEXT_params *params = args; - - TRACE("%p, %p\n", params->device, params->pCopyImageToImageInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkCopyImageToImageEXT(vulkan_device_from_handle(params->device)->host.device, params->pCopyImageToImageInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyImageToImageEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pCopyImageToImageInfo; - VkResult result; - } *params = args; - VkCopyImageToImageInfo pCopyImageToImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->device, params->pCopyImageToImageInfo); - - init_conversion_context(ctx); - convert_VkCopyImageToImageInfo_win32_to_host(ctx, (const VkCopyImageToImageInfo32 *)UlongToPtr(params->pCopyImageToImageInfo), &pCopyImageToImageInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCopyImageToImageEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCopyImageToImageInfo_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyImageToMemory(void *args) -{ - struct vkCopyImageToMemory_params *params = args; - - TRACE("%p, %p\n", params->device, params->pCopyImageToMemoryInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkCopyImageToMemory(vulkan_device_from_handle(params->device)->host.device, params->pCopyImageToMemoryInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyImageToMemory(void *args) -{ - struct - { - PTR32 device; - PTR32 pCopyImageToMemoryInfo; - VkResult result; - } *params = args; - VkCopyImageToMemoryInfo pCopyImageToMemoryInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->device, params->pCopyImageToMemoryInfo); - - init_conversion_context(ctx); - convert_VkCopyImageToMemoryInfo_win32_to_host(ctx, (const VkCopyImageToMemoryInfo32 *)UlongToPtr(params->pCopyImageToMemoryInfo), &pCopyImageToMemoryInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCopyImageToMemory(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCopyImageToMemoryInfo_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyImageToMemoryEXT(void *args) -{ - struct vkCopyImageToMemoryEXT_params *params = args; - - TRACE("%p, %p\n", params->device, params->pCopyImageToMemoryInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkCopyImageToMemoryEXT(vulkan_device_from_handle(params->device)->host.device, params->pCopyImageToMemoryInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyImageToMemoryEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pCopyImageToMemoryInfo; - VkResult result; - } *params = args; - VkCopyImageToMemoryInfo pCopyImageToMemoryInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->device, params->pCopyImageToMemoryInfo); - - init_conversion_context(ctx); - convert_VkCopyImageToMemoryInfo_win32_to_host(ctx, (const VkCopyImageToMemoryInfo32 *)UlongToPtr(params->pCopyImageToMemoryInfo), &pCopyImageToMemoryInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCopyImageToMemoryEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCopyImageToMemoryInfo_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyMemoryToAccelerationStructureKHR(void *args) -{ - struct vkCopyMemoryToAccelerationStructureKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkCopyMemoryToAccelerationStructureKHR(vulkan_device_from_handle(params->device)->host.device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host.deferred_operation : 0, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyMemoryToAccelerationStructureKHR(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - PTR32 pInfo; - VkResult result; - } *params = args; - VkCopyMemoryToAccelerationStructureInfoKHR pInfo_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - convert_VkCopyMemoryToAccelerationStructureInfoKHR_win32_to_host((const VkCopyMemoryToAccelerationStructureInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCopyMemoryToAccelerationStructureKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host.deferred_operation : 0, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyMemoryToImage(void *args) -{ - struct vkCopyMemoryToImage_params *params = args; - - TRACE("%p, %p\n", params->device, params->pCopyMemoryToImageInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkCopyMemoryToImage(vulkan_device_from_handle(params->device)->host.device, params->pCopyMemoryToImageInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyMemoryToImage(void *args) -{ - struct - { - PTR32 device; - PTR32 pCopyMemoryToImageInfo; - VkResult result; - } *params = args; - VkCopyMemoryToImageInfo pCopyMemoryToImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->device, params->pCopyMemoryToImageInfo); - - init_conversion_context(ctx); - convert_VkCopyMemoryToImageInfo_win32_to_host(ctx, (const VkCopyMemoryToImageInfo32 *)UlongToPtr(params->pCopyMemoryToImageInfo), &pCopyMemoryToImageInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCopyMemoryToImage(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCopyMemoryToImageInfo_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyMemoryToImageEXT(void *args) -{ - struct vkCopyMemoryToImageEXT_params *params = args; - - TRACE("%p, %p\n", params->device, params->pCopyMemoryToImageInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkCopyMemoryToImageEXT(vulkan_device_from_handle(params->device)->host.device, params->pCopyMemoryToImageInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyMemoryToImageEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pCopyMemoryToImageInfo; - VkResult result; - } *params = args; - VkCopyMemoryToImageInfo pCopyMemoryToImageInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->device, params->pCopyMemoryToImageInfo); - - init_conversion_context(ctx); - convert_VkCopyMemoryToImageInfo_win32_to_host(ctx, (const VkCopyMemoryToImageInfo32 *)UlongToPtr(params->pCopyMemoryToImageInfo), &pCopyMemoryToImageInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCopyMemoryToImageEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCopyMemoryToImageInfo_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyMemoryToMicromapEXT(void *args) -{ - struct vkCopyMemoryToMicromapEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkCopyMemoryToMicromapEXT(vulkan_device_from_handle(params->device)->host.device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host.deferred_operation : 0, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyMemoryToMicromapEXT(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - PTR32 pInfo; - VkResult result; - } *params = args; - VkCopyMemoryToMicromapInfoEXT pInfo_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - convert_VkCopyMemoryToMicromapInfoEXT_win32_to_host((const VkCopyMemoryToMicromapInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCopyMemoryToMicromapEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host.deferred_operation : 0, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyMicromapEXT(void *args) -{ - struct vkCopyMicromapEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkCopyMicromapEXT(vulkan_device_from_handle(params->device)->host.device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host.deferred_operation : 0, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyMicromapEXT(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - PTR32 pInfo; - VkResult result; - } *params = args; - VkCopyMicromapInfoEXT pInfo_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - convert_VkCopyMicromapInfoEXT_win32_to_host((const VkCopyMicromapInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCopyMicromapEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host.deferred_operation : 0, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCopyMicromapToMemoryEXT(void *args) -{ - struct vkCopyMicromapToMemoryEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkCopyMicromapToMemoryEXT(vulkan_device_from_handle(params->device)->host.device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host.deferred_operation : 0, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCopyMicromapToMemoryEXT(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - PTR32 pInfo; - VkResult result; - } *params = args; - VkCopyMicromapToMemoryInfoEXT pInfo_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->deferredOperation), params->pInfo); - - convert_VkCopyMicromapToMemoryInfoEXT_win32_to_host((const VkCopyMicromapToMemoryInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCopyMicromapToMemoryEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host.deferred_operation : 0, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateAccelerationStructureKHR(void *args) -{ - struct vkCreateAccelerationStructureKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pAccelerationStructure); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateAccelerationStructureKHR(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pAccelerationStructure); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateAccelerationStructureKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pAccelerationStructure; - VkResult result; - } *params = args; - VkAccelerationStructureCreateInfoKHR pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pAccelerationStructure); - - init_conversion_context(ctx); - convert_VkAccelerationStructureCreateInfoKHR_win32_to_host(ctx, (const VkAccelerationStructureCreateInfoKHR32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateAccelerationStructureKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkAccelerationStructureKHR *)UlongToPtr(params->pAccelerationStructure)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateAccelerationStructureNV(void *args) -{ - struct vkCreateAccelerationStructureNV_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pAccelerationStructure); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateAccelerationStructureNV(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pAccelerationStructure); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateAccelerationStructureNV(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pAccelerationStructure; - VkResult result; - } *params = args; - VkAccelerationStructureCreateInfoNV pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pAccelerationStructure); - - init_conversion_context(ctx); - convert_VkAccelerationStructureCreateInfoNV_win32_to_host(ctx, (const VkAccelerationStructureCreateInfoNV32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateAccelerationStructureNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkAccelerationStructureNV *)UlongToPtr(params->pAccelerationStructure)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateBuffer(void *args) -{ - struct vkCreateBuffer_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pBuffer); - - params->result = wine_vkCreateBuffer(params->device, params->pCreateInfo, params->pAllocator, params->pBuffer); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateBuffer(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pBuffer; - VkResult result; - } *params = args; - VkBufferCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pBuffer); - - init_conversion_context(ctx); - convert_VkBufferCreateInfo_win32_to_host(ctx, (const VkBufferCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_vkCreateBuffer((VkDevice)UlongToPtr(params->device), &pCreateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkBuffer *)UlongToPtr(params->pBuffer)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateBufferView(void *args) -{ - struct vkCreateBufferView_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pView); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateBufferView(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pView); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateBufferView(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pView; - VkResult result; - } *params = args; - VkBufferViewCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pView); - - init_conversion_context(ctx); - convert_VkBufferViewCreateInfo_win32_to_host(ctx, (const VkBufferViewCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateBufferView(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkBufferView *)UlongToPtr(params->pView)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateCommandPool(void *args) -{ - struct vkCreateCommandPool_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pCommandPool); - - params->result = wine_vkCreateCommandPool(params->device, params->pCreateInfo, params->pAllocator, params->pCommandPool, params->client_ptr); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateCommandPool(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pCommandPool; - PTR32 client_ptr; - VkResult result; - } *params = args; - VkCommandPoolCreateInfo pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pCommandPool); - - convert_VkCommandPoolCreateInfo_win32_to_host((const VkCommandPoolCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_vkCreateCommandPool((VkDevice)UlongToPtr(params->device), &pCreateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkCommandPool *)UlongToPtr(params->pCommandPool), UlongToPtr(params->client_ptr)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateComputePipelines(void *args) -{ - struct vkCreateComputePipelines_params *params = args; - const VkComputePipelineCreateInfo *pCreateInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, 0x%s, %u, %p, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); - - init_conversion_context(ctx); - pCreateInfos_host = convert_VkComputePipelineCreateInfo_array_win64_to_host(ctx, params->pCreateInfos, params->createInfoCount); - params->result = vulkan_device_from_handle(params->device)->p_vkCreateComputePipelines(vulkan_device_from_handle(params->device)->host.device, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, params->pPipelines); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateComputePipelines(void *args) -{ - struct - { - PTR32 device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - uint32_t createInfoCount; - PTR32 pCreateInfos; - PTR32 pAllocator; - PTR32 pPipelines; - VkResult result; - } *params = args; - const VkComputePipelineCreateInfo *pCreateInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %u, %#x, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); - - init_conversion_context(ctx); - pCreateInfos_host = convert_VkComputePipelineCreateInfo_array_win32_to_host(ctx, (const VkComputePipelineCreateInfo32 *)UlongToPtr(params->pCreateInfos), params->createInfoCount); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateComputePipelines(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, (VkPipeline *)UlongToPtr(params->pPipelines)); - convert_VkComputePipelineCreateInfo_array_host_to_win32(pCreateInfos_host, (VkComputePipelineCreateInfo32 *)UlongToPtr(params->pCreateInfos), params->createInfoCount); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateCuFunctionNVX(void *args) -{ - struct vkCreateCuFunctionNVX_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pFunction); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateCuFunctionNVX(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pFunction); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateCuFunctionNVX(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pFunction; - VkResult result; - } *params = args; - VkCuFunctionCreateInfoNVX pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pFunction); - - convert_VkCuFunctionCreateInfoNVX_win32_to_host((const VkCuFunctionCreateInfoNVX32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateCuFunctionNVX(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkCuFunctionNVX *)UlongToPtr(params->pFunction)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateCuModuleNVX(void *args) -{ - struct vkCreateCuModuleNVX_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pModule); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateCuModuleNVX(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pModule); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateCuModuleNVX(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pModule; - VkResult result; - } *params = args; - VkCuModuleCreateInfoNVX pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pModule); - - init_conversion_context(ctx); - convert_VkCuModuleCreateInfoNVX_win32_to_host(ctx, (const VkCuModuleCreateInfoNVX32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateCuModuleNVX(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkCuModuleNVX *)UlongToPtr(params->pModule)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateCudaFunctionNV(void *args) -{ - struct vkCreateCudaFunctionNV_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pFunction); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateCudaFunctionNV(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pFunction); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateCudaFunctionNV(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pFunction; - VkResult result; - } *params = args; - VkCudaFunctionCreateInfoNV pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pFunction); - - convert_VkCudaFunctionCreateInfoNV_win32_to_host((const VkCudaFunctionCreateInfoNV32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateCudaFunctionNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkCudaFunctionNV *)UlongToPtr(params->pFunction)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateCudaModuleNV(void *args) -{ - struct vkCreateCudaModuleNV_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pModule); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateCudaModuleNV(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pModule); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateCudaModuleNV(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pModule; - VkResult result; - } *params = args; - VkCudaModuleCreateInfoNV pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pModule); - - convert_VkCudaModuleCreateInfoNV_win32_to_host((const VkCudaModuleCreateInfoNV32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateCudaModuleNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkCudaModuleNV *)UlongToPtr(params->pModule)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateDebugReportCallbackEXT(void *args) -{ - struct vkCreateDebugReportCallbackEXT_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->instance, params->pCreateInfo, params->pAllocator, params->pCallback); - - params->result = wine_vkCreateDebugReportCallbackEXT(params->instance, params->pCreateInfo, params->pAllocator, params->pCallback); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateDebugReportCallbackEXT(void *args) -{ - struct - { - PTR32 instance; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pCallback; - VkResult result; - } *params = args; - VkDebugReportCallbackCreateInfoEXT pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->instance, params->pCreateInfo, params->pAllocator, params->pCallback); - - convert_VkDebugReportCallbackCreateInfoEXT_win32_to_host((const VkDebugReportCallbackCreateInfoEXT32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_vkCreateDebugReportCallbackEXT((VkInstance)UlongToPtr(params->instance), &pCreateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkDebugReportCallbackEXT *)UlongToPtr(params->pCallback)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateDebugUtilsMessengerEXT(void *args) -{ - struct vkCreateDebugUtilsMessengerEXT_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->instance, params->pCreateInfo, params->pAllocator, params->pMessenger); - - params->result = wine_vkCreateDebugUtilsMessengerEXT(params->instance, params->pCreateInfo, params->pAllocator, params->pMessenger); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateDebugUtilsMessengerEXT(void *args) -{ - struct - { - PTR32 instance; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pMessenger; - VkResult result; - } *params = args; - VkDebugUtilsMessengerCreateInfoEXT pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->instance, params->pCreateInfo, params->pAllocator, params->pMessenger); - - convert_VkDebugUtilsMessengerCreateInfoEXT_win32_to_host((const VkDebugUtilsMessengerCreateInfoEXT32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_vkCreateDebugUtilsMessengerEXT((VkInstance)UlongToPtr(params->instance), &pCreateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkDebugUtilsMessengerEXT *)UlongToPtr(params->pMessenger)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateDeferredOperationKHR(void *args) -{ - struct vkCreateDeferredOperationKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pAllocator, params->pDeferredOperation); - - params->result = wine_vkCreateDeferredOperationKHR(params->device, params->pAllocator, params->pDeferredOperation); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateDeferredOperationKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pAllocator; - PTR32 pDeferredOperation; - VkResult result; - } *params = args; - - TRACE("%#x, %#x, %#x\n", params->device, params->pAllocator, params->pDeferredOperation); - - params->result = wine_vkCreateDeferredOperationKHR((VkDevice)UlongToPtr(params->device), (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkDeferredOperationKHR *)UlongToPtr(params->pDeferredOperation)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateDescriptorPool(void *args) -{ - struct vkCreateDescriptorPool_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pDescriptorPool); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateDescriptorPool(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pDescriptorPool); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateDescriptorPool(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pDescriptorPool; - VkResult result; - } *params = args; - VkDescriptorPoolCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pDescriptorPool); - - init_conversion_context(ctx); - convert_VkDescriptorPoolCreateInfo_win32_to_host(ctx, (const VkDescriptorPoolCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateDescriptorPool(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkDescriptorPool *)UlongToPtr(params->pDescriptorPool)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateDescriptorSetLayout(void *args) -{ - struct vkCreateDescriptorSetLayout_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pSetLayout); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateDescriptorSetLayout(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pSetLayout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateDescriptorSetLayout(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pSetLayout; - VkResult result; - } *params = args; - VkDescriptorSetLayoutCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pSetLayout); - - init_conversion_context(ctx); - convert_VkDescriptorSetLayoutCreateInfo_win32_to_host(ctx, (const VkDescriptorSetLayoutCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateDescriptorSetLayout(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkDescriptorSetLayout *)UlongToPtr(params->pSetLayout)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateDescriptorUpdateTemplate(void *args) -{ - struct vkCreateDescriptorUpdateTemplate_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pDescriptorUpdateTemplate); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateDescriptorUpdateTemplate(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pDescriptorUpdateTemplate); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateDescriptorUpdateTemplate(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pDescriptorUpdateTemplate; - VkResult result; - } *params = args; - VkDescriptorUpdateTemplateCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pDescriptorUpdateTemplate); - - init_conversion_context(ctx); - convert_VkDescriptorUpdateTemplateCreateInfo_win32_to_host(ctx, (const VkDescriptorUpdateTemplateCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateDescriptorUpdateTemplate(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkDescriptorUpdateTemplate *)UlongToPtr(params->pDescriptorUpdateTemplate)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateDescriptorUpdateTemplateKHR(void *args) -{ - struct vkCreateDescriptorUpdateTemplateKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pDescriptorUpdateTemplate); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateDescriptorUpdateTemplateKHR(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pDescriptorUpdateTemplate); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateDescriptorUpdateTemplateKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pDescriptorUpdateTemplate; - VkResult result; - } *params = args; - VkDescriptorUpdateTemplateCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pDescriptorUpdateTemplate); - - init_conversion_context(ctx); - convert_VkDescriptorUpdateTemplateCreateInfo_win32_to_host(ctx, (const VkDescriptorUpdateTemplateCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateDescriptorUpdateTemplateKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkDescriptorUpdateTemplate *)UlongToPtr(params->pDescriptorUpdateTemplate)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateDevice(void *args) -{ - struct vkCreateDevice_params *params = args; - VkDeviceCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %p, %p, %p\n", params->physicalDevice, params->pCreateInfo, params->pAllocator, params->pDevice); - - init_conversion_context(ctx); - convert_VkDeviceCreateInfo_win64_to_host(ctx, params->pCreateInfo, &pCreateInfo_host); - params->result = wine_vkCreateDevice(params->physicalDevice, &pCreateInfo_host, params->pAllocator, params->pDevice, params->client_ptr); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateDevice(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pDevice; - PTR32 client_ptr; - VkResult result; - } *params = args; - VkDeviceCreateInfo pCreateInfo_host; - VkDevice pDevice_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->physicalDevice, params->pCreateInfo, params->pAllocator, params->pDevice); - - init_conversion_context(ctx); - convert_VkDeviceCreateInfo_win32_to_host(ctx, (const VkDeviceCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - pDevice_host = UlongToPtr(*(PTR32 *)UlongToPtr(params->pDevice)); - params->result = wine_vkCreateDevice((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pCreateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), &pDevice_host, UlongToPtr(params->client_ptr)); - *(PTR32 *)UlongToPtr(params->pDevice) = PtrToUlong(pDevice_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateEvent(void *args) -{ - struct vkCreateEvent_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pEvent); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateEvent(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pEvent); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateEvent(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pEvent; - VkResult result; - } *params = args; - VkEventCreateInfo pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pEvent); - - convert_VkEventCreateInfo_win32_to_host((const VkEventCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateEvent(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkEvent *)UlongToPtr(params->pEvent)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateFence(void *args) -{ - struct vkCreateFence_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pFence); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateFence(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pFence); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateFence(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pFence; - VkResult result; - } *params = args; - VkFenceCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pFence); - - init_conversion_context(ctx); - convert_VkFenceCreateInfo_win32_to_host(ctx, (const VkFenceCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateFence(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkFence *)UlongToPtr(params->pFence)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateFramebuffer(void *args) -{ - struct vkCreateFramebuffer_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pFramebuffer); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateFramebuffer(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pFramebuffer); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateFramebuffer(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pFramebuffer; - VkResult result; - } *params = args; - VkFramebufferCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pFramebuffer); - - init_conversion_context(ctx); - convert_VkFramebufferCreateInfo_win32_to_host(ctx, (const VkFramebufferCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateFramebuffer(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkFramebuffer *)UlongToPtr(params->pFramebuffer)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateGraphicsPipelines(void *args) -{ - struct vkCreateGraphicsPipelines_params *params = args; - const VkGraphicsPipelineCreateInfo *pCreateInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, 0x%s, %u, %p, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); - - init_conversion_context(ctx); - pCreateInfos_host = convert_VkGraphicsPipelineCreateInfo_array_win64_to_host(ctx, params->pCreateInfos, params->createInfoCount); - params->result = vulkan_device_from_handle(params->device)->p_vkCreateGraphicsPipelines(vulkan_device_from_handle(params->device)->host.device, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, params->pPipelines); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateGraphicsPipelines(void *args) -{ - struct - { - PTR32 device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - uint32_t createInfoCount; - PTR32 pCreateInfos; - PTR32 pAllocator; - PTR32 pPipelines; - VkResult result; - } *params = args; - const VkGraphicsPipelineCreateInfo *pCreateInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %u, %#x, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); - - init_conversion_context(ctx); - pCreateInfos_host = convert_VkGraphicsPipelineCreateInfo_array_win32_to_host(ctx, (const VkGraphicsPipelineCreateInfo32 *)UlongToPtr(params->pCreateInfos), params->createInfoCount); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateGraphicsPipelines(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, (VkPipeline *)UlongToPtr(params->pPipelines)); - convert_VkGraphicsPipelineCreateInfo_array_host_to_win32(pCreateInfos_host, (VkGraphicsPipelineCreateInfo32 *)UlongToPtr(params->pCreateInfos), params->createInfoCount); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateImage(void *args) -{ - struct vkCreateImage_params *params = args; - VkImageCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pImage); - - init_conversion_context(ctx); - convert_VkImageCreateInfo_win64_to_host(ctx, params->pCreateInfo, &pCreateInfo_host); - params->result = wine_vkCreateImage(params->device, &pCreateInfo_host, params->pAllocator, params->pImage); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateImage(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pImage; - VkResult result; - } *params = args; - VkImageCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pImage); - - init_conversion_context(ctx); - convert_VkImageCreateInfo_win32_to_host(ctx, (const VkImageCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = wine_vkCreateImage((VkDevice)UlongToPtr(params->device), &pCreateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkImage *)UlongToPtr(params->pImage)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateImageView(void *args) -{ - struct vkCreateImageView_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pView); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateImageView(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pView); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateImageView(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pView; - VkResult result; - } *params = args; - VkImageViewCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pView); - - init_conversion_context(ctx); - convert_VkImageViewCreateInfo_win32_to_host(ctx, (const VkImageViewCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateImageView(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkImageView *)UlongToPtr(params->pView)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateIndirectCommandsLayoutEXT(void *args) -{ - struct vkCreateIndirectCommandsLayoutEXT_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pIndirectCommandsLayout); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateIndirectCommandsLayoutEXT(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pIndirectCommandsLayout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateIndirectCommandsLayoutEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pIndirectCommandsLayout; - VkResult result; - } *params = args; - VkIndirectCommandsLayoutCreateInfoEXT pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pIndirectCommandsLayout); - - init_conversion_context(ctx); - convert_VkIndirectCommandsLayoutCreateInfoEXT_win32_to_host(ctx, (const VkIndirectCommandsLayoutCreateInfoEXT32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateIndirectCommandsLayoutEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkIndirectCommandsLayoutEXT *)UlongToPtr(params->pIndirectCommandsLayout)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateIndirectCommandsLayoutNV(void *args) -{ - struct vkCreateIndirectCommandsLayoutNV_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pIndirectCommandsLayout); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateIndirectCommandsLayoutNV(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pIndirectCommandsLayout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateIndirectCommandsLayoutNV(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pIndirectCommandsLayout; - VkResult result; - } *params = args; - VkIndirectCommandsLayoutCreateInfoNV pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pIndirectCommandsLayout); - - init_conversion_context(ctx); - convert_VkIndirectCommandsLayoutCreateInfoNV_win32_to_host(ctx, (const VkIndirectCommandsLayoutCreateInfoNV32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateIndirectCommandsLayoutNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkIndirectCommandsLayoutNV *)UlongToPtr(params->pIndirectCommandsLayout)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateIndirectExecutionSetEXT(void *args) -{ - struct vkCreateIndirectExecutionSetEXT_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pIndirectExecutionSet); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateIndirectExecutionSetEXT(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pIndirectExecutionSet); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateIndirectExecutionSetEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pIndirectExecutionSet; - VkResult result; - } *params = args; - VkIndirectExecutionSetCreateInfoEXT pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pIndirectExecutionSet); - - init_conversion_context(ctx); - convert_VkIndirectExecutionSetCreateInfoEXT_win32_to_host(ctx, (const VkIndirectExecutionSetCreateInfoEXT32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateIndirectExecutionSetEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkIndirectExecutionSetEXT *)UlongToPtr(params->pIndirectExecutionSet)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateInstance(void *args) -{ - struct vkCreateInstance_params *params = args; - VkInstanceCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %p, %p\n", params->pCreateInfo, params->pAllocator, params->pInstance); - - init_conversion_context(ctx); - convert_VkInstanceCreateInfo_win64_to_host(ctx, params->pCreateInfo, &pCreateInfo_host); - params->result = wine_vkCreateInstance(&pCreateInfo_host, params->pAllocator, params->pInstance, params->client_ptr); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateInstance(void *args) -{ - struct - { - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pInstance; - PTR32 client_ptr; - VkResult result; - } *params = args; - VkInstanceCreateInfo pCreateInfo_host; - VkInstance pInstance_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->pCreateInfo, params->pAllocator, params->pInstance); - - init_conversion_context(ctx); - convert_VkInstanceCreateInfo_win32_to_host(ctx, (const VkInstanceCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - pInstance_host = UlongToPtr(*(PTR32 *)UlongToPtr(params->pInstance)); - params->result = wine_vkCreateInstance(&pCreateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), &pInstance_host, UlongToPtr(params->client_ptr)); - *(PTR32 *)UlongToPtr(params->pInstance) = PtrToUlong(pInstance_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateMicromapEXT(void *args) -{ - struct vkCreateMicromapEXT_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pMicromap); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateMicromapEXT(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pMicromap); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateMicromapEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pMicromap; - VkResult result; - } *params = args; - VkMicromapCreateInfoEXT pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pMicromap); - - convert_VkMicromapCreateInfoEXT_win32_to_host((const VkMicromapCreateInfoEXT32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateMicromapEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkMicromapEXT *)UlongToPtr(params->pMicromap)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateOpticalFlowSessionNV(void *args) -{ - struct vkCreateOpticalFlowSessionNV_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pSession); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateOpticalFlowSessionNV(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pSession); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateOpticalFlowSessionNV(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pSession; - VkResult result; - } *params = args; - VkOpticalFlowSessionCreateInfoNV pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pSession); - - init_conversion_context(ctx); - convert_VkOpticalFlowSessionCreateInfoNV_win32_to_host(ctx, (const VkOpticalFlowSessionCreateInfoNV32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateOpticalFlowSessionNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkOpticalFlowSessionNV *)UlongToPtr(params->pSession)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreatePipelineBinariesKHR(void *args) -{ - struct vkCreatePipelineBinariesKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pBinaries); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreatePipelineBinariesKHR(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pBinaries); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreatePipelineBinariesKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pBinaries; - VkResult result; - } *params = args; - VkPipelineBinaryCreateInfoKHR pCreateInfo_host; - VkPipelineBinaryHandlesInfoKHR pBinaries_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pBinaries); - - init_conversion_context(ctx); - convert_VkPipelineBinaryCreateInfoKHR_win32_to_host(ctx, (const VkPipelineBinaryCreateInfoKHR32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - convert_VkPipelineBinaryHandlesInfoKHR_win32_to_host((VkPipelineBinaryHandlesInfoKHR32 *)UlongToPtr(params->pBinaries), &pBinaries_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreatePipelineBinariesKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, &pBinaries_host); - convert_VkPipelineBinaryHandlesInfoKHR_host_to_win32(&pBinaries_host, (VkPipelineBinaryHandlesInfoKHR32 *)UlongToPtr(params->pBinaries)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreatePipelineCache(void *args) -{ - struct vkCreatePipelineCache_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pPipelineCache); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreatePipelineCache(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pPipelineCache); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreatePipelineCache(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pPipelineCache; - VkResult result; - } *params = args; - VkPipelineCacheCreateInfo pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pPipelineCache); - - convert_VkPipelineCacheCreateInfo_win32_to_host((const VkPipelineCacheCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreatePipelineCache(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkPipelineCache *)UlongToPtr(params->pPipelineCache)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreatePipelineLayout(void *args) -{ - struct vkCreatePipelineLayout_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pPipelineLayout); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreatePipelineLayout(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pPipelineLayout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreatePipelineLayout(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pPipelineLayout; - VkResult result; - } *params = args; - VkPipelineLayoutCreateInfo pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pPipelineLayout); - - convert_VkPipelineLayoutCreateInfo_win32_to_host((const VkPipelineLayoutCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreatePipelineLayout(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkPipelineLayout *)UlongToPtr(params->pPipelineLayout)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreatePrivateDataSlot(void *args) -{ - struct vkCreatePrivateDataSlot_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pPrivateDataSlot); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreatePrivateDataSlot(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pPrivateDataSlot); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreatePrivateDataSlot(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pPrivateDataSlot; - VkResult result; - } *params = args; - VkPrivateDataSlotCreateInfo pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pPrivateDataSlot); - - convert_VkPrivateDataSlotCreateInfo_win32_to_host((const VkPrivateDataSlotCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreatePrivateDataSlot(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkPrivateDataSlot *)UlongToPtr(params->pPrivateDataSlot)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreatePrivateDataSlotEXT(void *args) -{ - struct vkCreatePrivateDataSlotEXT_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pPrivateDataSlot); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreatePrivateDataSlotEXT(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pPrivateDataSlot); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreatePrivateDataSlotEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pPrivateDataSlot; - VkResult result; - } *params = args; - VkPrivateDataSlotCreateInfo pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pPrivateDataSlot); - - convert_VkPrivateDataSlotCreateInfo_win32_to_host((const VkPrivateDataSlotCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreatePrivateDataSlotEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkPrivateDataSlot *)UlongToPtr(params->pPrivateDataSlot)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateQueryPool(void *args) -{ - struct vkCreateQueryPool_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pQueryPool); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateQueryPool(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pQueryPool); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateQueryPool(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pQueryPool; - VkResult result; - } *params = args; - VkQueryPoolCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pQueryPool); - - init_conversion_context(ctx); - convert_VkQueryPoolCreateInfo_win32_to_host(ctx, (const VkQueryPoolCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateQueryPool(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkQueryPool *)UlongToPtr(params->pQueryPool)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateRayTracingPipelinesKHR(void *args) -{ - struct vkCreateRayTracingPipelinesKHR_params *params = args; - const VkRayTracingPipelineCreateInfoKHR *pCreateInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, 0x%s, 0x%s, %u, %p, %p, %p\n", params->device, wine_dbgstr_longlong(params->deferredOperation), wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); - - if (params->deferredOperation == VK_NULL_HANDLE) - init_conversion_context(ctx); - else - ctx = &wine_deferred_operation_from_handle(params->deferredOperation)->ctx; - pCreateInfos_host = convert_VkRayTracingPipelineCreateInfoKHR_array_win64_to_host(ctx, params->pCreateInfos, params->createInfoCount); - params->result = vulkan_device_from_handle(params->device)->p_vkCreateRayTracingPipelinesKHR(vulkan_device_from_handle(params->device)->host.device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host.deferred_operation : 0, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, params->pPipelines); - if (params->deferredOperation == VK_NULL_HANDLE) - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateRayTracingPipelinesKHR(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) deferredOperation; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - uint32_t createInfoCount; - PTR32 pCreateInfos; - PTR32 pAllocator; - PTR32 pPipelines; - VkResult result; - } *params = args; - const VkRayTracingPipelineCreateInfoKHR *pCreateInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, 0x%s, %u, %#x, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->deferredOperation), wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); - - if (params->deferredOperation == VK_NULL_HANDLE) - init_conversion_context(ctx); - else - ctx = &wine_deferred_operation_from_handle(params->deferredOperation)->ctx; - pCreateInfos_host = convert_VkRayTracingPipelineCreateInfoKHR_array_win32_to_host(ctx, (const VkRayTracingPipelineCreateInfoKHR32 *)UlongToPtr(params->pCreateInfos), params->createInfoCount); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateRayTracingPipelinesKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->deferredOperation ? wine_deferred_operation_from_handle(params->deferredOperation)->host.deferred_operation : 0, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, (VkPipeline *)UlongToPtr(params->pPipelines)); - convert_VkRayTracingPipelineCreateInfoKHR_array_host_to_win32(pCreateInfos_host, (VkRayTracingPipelineCreateInfoKHR32 *)UlongToPtr(params->pCreateInfos), params->createInfoCount); - if (params->deferredOperation == VK_NULL_HANDLE) - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateRayTracingPipelinesNV(void *args) -{ - struct vkCreateRayTracingPipelinesNV_params *params = args; - const VkRayTracingPipelineCreateInfoNV *pCreateInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, 0x%s, %u, %p, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); - - init_conversion_context(ctx); - pCreateInfos_host = convert_VkRayTracingPipelineCreateInfoNV_array_win64_to_host(ctx, params->pCreateInfos, params->createInfoCount); - params->result = vulkan_device_from_handle(params->device)->p_vkCreateRayTracingPipelinesNV(vulkan_device_from_handle(params->device)->host.device, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, params->pPipelines); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateRayTracingPipelinesNV(void *args) -{ - struct - { - PTR32 device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - uint32_t createInfoCount; - PTR32 pCreateInfos; - PTR32 pAllocator; - PTR32 pPipelines; - VkResult result; - } *params = args; - const VkRayTracingPipelineCreateInfoNV *pCreateInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %u, %#x, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); - - init_conversion_context(ctx); - pCreateInfos_host = convert_VkRayTracingPipelineCreateInfoNV_array_win32_to_host(ctx, (const VkRayTracingPipelineCreateInfoNV32 *)UlongToPtr(params->pCreateInfos), params->createInfoCount); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateRayTracingPipelinesNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, (VkPipeline *)UlongToPtr(params->pPipelines)); - convert_VkRayTracingPipelineCreateInfoNV_array_host_to_win32(pCreateInfos_host, (VkRayTracingPipelineCreateInfoNV32 *)UlongToPtr(params->pCreateInfos), params->createInfoCount); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateRenderPass(void *args) -{ - struct vkCreateRenderPass_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pRenderPass); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateRenderPass(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pRenderPass); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateRenderPass(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pRenderPass; - VkResult result; - } *params = args; - VkRenderPassCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pRenderPass); - - init_conversion_context(ctx); - convert_VkRenderPassCreateInfo_win32_to_host(ctx, (const VkRenderPassCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateRenderPass(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkRenderPass *)UlongToPtr(params->pRenderPass)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateRenderPass2(void *args) -{ - struct vkCreateRenderPass2_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pRenderPass); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateRenderPass2(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pRenderPass); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateRenderPass2(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pRenderPass; - VkResult result; - } *params = args; - VkRenderPassCreateInfo2 pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pRenderPass); - - init_conversion_context(ctx); - convert_VkRenderPassCreateInfo2_win32_to_host(ctx, (const VkRenderPassCreateInfo232 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateRenderPass2(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkRenderPass *)UlongToPtr(params->pRenderPass)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateRenderPass2KHR(void *args) -{ - struct vkCreateRenderPass2KHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pRenderPass); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateRenderPass2KHR(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pRenderPass); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateRenderPass2KHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pRenderPass; - VkResult result; - } *params = args; - VkRenderPassCreateInfo2 pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pRenderPass); - - init_conversion_context(ctx); - convert_VkRenderPassCreateInfo2_win32_to_host(ctx, (const VkRenderPassCreateInfo232 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateRenderPass2KHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkRenderPass *)UlongToPtr(params->pRenderPass)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateSampler(void *args) -{ - struct vkCreateSampler_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pSampler); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateSampler(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pSampler); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateSampler(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pSampler; - VkResult result; - } *params = args; - VkSamplerCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pSampler); - - init_conversion_context(ctx); - convert_VkSamplerCreateInfo_win32_to_host(ctx, (const VkSamplerCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateSampler(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkSampler *)UlongToPtr(params->pSampler)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateSamplerYcbcrConversion(void *args) -{ - struct vkCreateSamplerYcbcrConversion_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pYcbcrConversion); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateSamplerYcbcrConversion(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pYcbcrConversion); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateSamplerYcbcrConversion(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pYcbcrConversion; - VkResult result; - } *params = args; - VkSamplerYcbcrConversionCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pYcbcrConversion); - - init_conversion_context(ctx); - convert_VkSamplerYcbcrConversionCreateInfo_win32_to_host(ctx, (const VkSamplerYcbcrConversionCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateSamplerYcbcrConversion(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkSamplerYcbcrConversion *)UlongToPtr(params->pYcbcrConversion)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateSamplerYcbcrConversionKHR(void *args) -{ - struct vkCreateSamplerYcbcrConversionKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pYcbcrConversion); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateSamplerYcbcrConversionKHR(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pYcbcrConversion); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateSamplerYcbcrConversionKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pYcbcrConversion; - VkResult result; - } *params = args; - VkSamplerYcbcrConversionCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pYcbcrConversion); - - init_conversion_context(ctx); - convert_VkSamplerYcbcrConversionCreateInfo_win32_to_host(ctx, (const VkSamplerYcbcrConversionCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateSamplerYcbcrConversionKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkSamplerYcbcrConversion *)UlongToPtr(params->pYcbcrConversion)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateSemaphore(void *args) -{ - struct vkCreateSemaphore_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pSemaphore); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateSemaphore(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pSemaphore); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateSemaphore(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pSemaphore; - VkResult result; - } *params = args; - VkSemaphoreCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pSemaphore); - - init_conversion_context(ctx); - convert_VkSemaphoreCreateInfo_win32_to_host(ctx, (const VkSemaphoreCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateSemaphore(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkSemaphore *)UlongToPtr(params->pSemaphore)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateShaderModule(void *args) -{ - struct vkCreateShaderModule_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pShaderModule); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateShaderModule(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pShaderModule); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateShaderModule(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pShaderModule; - VkResult result; - } *params = args; - VkShaderModuleCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pShaderModule); - - init_conversion_context(ctx); - convert_VkShaderModuleCreateInfo_win32_to_host(ctx, (const VkShaderModuleCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateShaderModule(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkShaderModule *)UlongToPtr(params->pShaderModule)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateShadersEXT(void *args) -{ - struct vkCreateShadersEXT_params *params = args; - - TRACE("%p, %u, %p, %p, %p\n", params->device, params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pShaders); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateShadersEXT(vulkan_device_from_handle(params->device)->host.device, params->createInfoCount, params->pCreateInfos, NULL, params->pShaders); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateShadersEXT(void *args) -{ - struct - { - PTR32 device; - uint32_t createInfoCount; - PTR32 pCreateInfos; - PTR32 pAllocator; - PTR32 pShaders; - VkResult result; - } *params = args; - const VkShaderCreateInfoEXT *pCreateInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x, %#x, %#x\n", params->device, params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pShaders); - - init_conversion_context(ctx); - pCreateInfos_host = convert_VkShaderCreateInfoEXT_array_win32_to_host(ctx, (const VkShaderCreateInfoEXT32 *)UlongToPtr(params->pCreateInfos), params->createInfoCount); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateShadersEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->createInfoCount, pCreateInfos_host, NULL, (VkShaderEXT *)UlongToPtr(params->pShaders)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateSwapchainKHR(void *args) -{ - struct vkCreateSwapchainKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pSwapchain); - - params->result = vk_funcs->p_vkCreateSwapchainKHR(params->device, params->pCreateInfo, params->pAllocator, params->pSwapchain); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateSwapchainKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pSwapchain; - VkResult result; - } *params = args; - VkSwapchainCreateInfoKHR pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pSwapchain); - - init_conversion_context(ctx); - convert_VkSwapchainCreateInfoKHR_win32_to_unwrapped_host(ctx, (const VkSwapchainCreateInfoKHR32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vk_funcs->p_vkCreateSwapchainKHR((VkDevice)UlongToPtr(params->device), &pCreateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkSwapchainKHR *)UlongToPtr(params->pSwapchain)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateValidationCacheEXT(void *args) -{ - struct vkCreateValidationCacheEXT_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pValidationCache); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateValidationCacheEXT(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pValidationCache); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateValidationCacheEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pValidationCache; - VkResult result; - } *params = args; - VkValidationCacheCreateInfoEXT pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pValidationCache); - - convert_VkValidationCacheCreateInfoEXT_win32_to_host((const VkValidationCacheCreateInfoEXT32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateValidationCacheEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkValidationCacheEXT *)UlongToPtr(params->pValidationCache)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateVideoSessionKHR(void *args) -{ - struct vkCreateVideoSessionKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pVideoSession); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateVideoSessionKHR(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pVideoSession); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateVideoSessionKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pVideoSession; - VkResult result; - } *params = args; - VkVideoSessionCreateInfoKHR pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pVideoSession); - - init_conversion_context(ctx); - convert_VkVideoSessionCreateInfoKHR_win32_to_host(ctx, (const VkVideoSessionCreateInfoKHR32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateVideoSessionKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkVideoSessionKHR *)UlongToPtr(params->pVideoSession)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateVideoSessionParametersKHR(void *args) -{ - struct vkCreateVideoSessionParametersKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pVideoSessionParameters); - - params->result = vulkan_device_from_handle(params->device)->p_vkCreateVideoSessionParametersKHR(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pVideoSessionParameters); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateVideoSessionParametersKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pVideoSessionParameters; - VkResult result; - } *params = args; - VkVideoSessionParametersCreateInfoKHR pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pAllocator, params->pVideoSessionParameters); - - init_conversion_context(ctx); - convert_VkVideoSessionParametersCreateInfoKHR_win32_to_host(ctx, (const VkVideoSessionParametersCreateInfoKHR32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateVideoSessionParametersKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkVideoSessionParametersKHR *)UlongToPtr(params->pVideoSessionParameters)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkCreateWin32SurfaceKHR(void *args) -{ - struct vkCreateWin32SurfaceKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->instance, params->pCreateInfo, params->pAllocator, params->pSurface); - - params->result = vk_funcs->p_vkCreateWin32SurfaceKHR(params->instance, params->pCreateInfo, params->pAllocator, params->pSurface); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkCreateWin32SurfaceKHR(void *args) -{ - struct - { - PTR32 instance; - PTR32 pCreateInfo; - PTR32 pAllocator; - PTR32 pSurface; - VkResult result; - } *params = args; - VkWin32SurfaceCreateInfoKHR pCreateInfo_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->instance, params->pCreateInfo, params->pAllocator, params->pSurface); - - convert_VkWin32SurfaceCreateInfoKHR_win32_to_host((const VkWin32SurfaceCreateInfoKHR32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vk_funcs->p_vkCreateWin32SurfaceKHR((VkInstance)UlongToPtr(params->instance), &pCreateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkSurfaceKHR *)UlongToPtr(params->pSurface)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDebugMarkerSetObjectNameEXT(void *args) -{ - struct vkDebugMarkerSetObjectNameEXT_params *params = args; - VkDebugMarkerObjectNameInfoEXT pNameInfo_host; - - TRACE("%p, %p\n", params->device, params->pNameInfo); - - convert_VkDebugMarkerObjectNameInfoEXT_win64_to_host(params->pNameInfo, &pNameInfo_host); - params->result = vulkan_device_from_handle(params->device)->p_vkDebugMarkerSetObjectNameEXT(vulkan_device_from_handle(params->device)->host.device, &pNameInfo_host); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDebugMarkerSetObjectNameEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pNameInfo; - VkResult result; - } *params = args; - VkDebugMarkerObjectNameInfoEXT pNameInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pNameInfo); - - convert_VkDebugMarkerObjectNameInfoEXT_win32_to_host((const VkDebugMarkerObjectNameInfoEXT32 *)UlongToPtr(params->pNameInfo), &pNameInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDebugMarkerSetObjectNameEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pNameInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDebugMarkerSetObjectTagEXT(void *args) -{ - struct vkDebugMarkerSetObjectTagEXT_params *params = args; - VkDebugMarkerObjectTagInfoEXT pTagInfo_host; - - TRACE("%p, %p\n", params->device, params->pTagInfo); - - convert_VkDebugMarkerObjectTagInfoEXT_win64_to_host(params->pTagInfo, &pTagInfo_host); - params->result = vulkan_device_from_handle(params->device)->p_vkDebugMarkerSetObjectTagEXT(vulkan_device_from_handle(params->device)->host.device, &pTagInfo_host); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDebugMarkerSetObjectTagEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pTagInfo; - VkResult result; - } *params = args; - VkDebugMarkerObjectTagInfoEXT pTagInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pTagInfo); - - convert_VkDebugMarkerObjectTagInfoEXT_win32_to_host((const VkDebugMarkerObjectTagInfoEXT32 *)UlongToPtr(params->pTagInfo), &pTagInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDebugMarkerSetObjectTagEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pTagInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDebugReportMessageEXT(void *args) -{ - struct vkDebugReportMessageEXT_params *params = args; - - TRACE("%p, %#x, %#x, 0x%s, 0x%s, %d, %p, %p\n", params->instance, params->flags, params->objectType, wine_dbgstr_longlong(params->object), wine_dbgstr_longlong(params->location), params->messageCode, params->pLayerPrefix, params->pMessage); - - vulkan_instance_from_handle(params->instance)->p_vkDebugReportMessageEXT(vulkan_instance_from_handle(params->instance)->host.instance, params->flags, params->objectType, wine_vk_unwrap_handle(params->objectType, params->object), params->location, params->messageCode, params->pLayerPrefix, params->pMessage); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDebugReportMessageEXT(void *args) -{ - struct - { - PTR32 instance; - VkDebugReportFlagsEXT flags; - VkDebugReportObjectTypeEXT objectType; - uint64_t DECLSPEC_ALIGN(8) object; - PTR32 location; - int32_t messageCode; - PTR32 pLayerPrefix; - PTR32 pMessage; - } *params = args; - - TRACE("%#x, %#x, %#x, 0x%s, 0x%s, %d, %#x, %#x\n", params->instance, params->flags, params->objectType, wine_dbgstr_longlong(params->object), wine_dbgstr_longlong(params->location), params->messageCode, params->pLayerPrefix, params->pMessage); - - vulkan_instance_from_handle((VkInstance)UlongToPtr(params->instance))->p_vkDebugReportMessageEXT(vulkan_instance_from_handle((VkInstance)UlongToPtr(params->instance))->host.instance, params->flags, params->objectType, wine_vk_unwrap_handle(params->objectType, params->object), params->location, params->messageCode, (const char *)UlongToPtr(params->pLayerPrefix), (const char *)UlongToPtr(params->pMessage)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDeferredOperationJoinKHR(void *args) -{ - struct vkDeferredOperationJoinKHR_params *params = args; - - TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->operation)); - - params->result = vulkan_device_from_handle(params->device)->p_vkDeferredOperationJoinKHR(vulkan_device_from_handle(params->device)->host.device, wine_deferred_operation_from_handle(params->operation)->host.deferred_operation); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDeferredOperationJoinKHR(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) operation; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->operation)); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDeferredOperationJoinKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, wine_deferred_operation_from_handle(params->operation)->host.deferred_operation); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyAccelerationStructureKHR(void *args) -{ - struct vkDestroyAccelerationStructureKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->accelerationStructure), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyAccelerationStructureKHR(vulkan_device_from_handle(params->device)->host.device, params->accelerationStructure, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyAccelerationStructureKHR(void *args) -{ - struct - { - PTR32 device; - VkAccelerationStructureKHR DECLSPEC_ALIGN(8) accelerationStructure; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->accelerationStructure), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyAccelerationStructureKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->accelerationStructure, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyAccelerationStructureNV(void *args) -{ - struct vkDestroyAccelerationStructureNV_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->accelerationStructure), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyAccelerationStructureNV(vulkan_device_from_handle(params->device)->host.device, params->accelerationStructure, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyAccelerationStructureNV(void *args) -{ - struct - { - PTR32 device; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) accelerationStructure; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->accelerationStructure), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyAccelerationStructureNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->accelerationStructure, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyBuffer(void *args) -{ - struct vkDestroyBuffer_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->buffer), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyBuffer(vulkan_device_from_handle(params->device)->host.device, params->buffer, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyBuffer(void *args) -{ - struct - { - PTR32 device; - VkBuffer DECLSPEC_ALIGN(8) buffer; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->buffer), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyBuffer(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->buffer, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyBufferView(void *args) -{ - struct vkDestroyBufferView_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->bufferView), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyBufferView(vulkan_device_from_handle(params->device)->host.device, params->bufferView, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyBufferView(void *args) -{ - struct - { - PTR32 device; - VkBufferView DECLSPEC_ALIGN(8) bufferView; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->bufferView), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyBufferView(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->bufferView, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyCommandPool(void *args) -{ - struct vkDestroyCommandPool_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->commandPool), params->pAllocator); - - wine_vkDestroyCommandPool(params->device, params->commandPool, params->pAllocator); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyCommandPool(void *args) -{ - struct - { - PTR32 device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->commandPool), params->pAllocator); - - wine_vkDestroyCommandPool((VkDevice)UlongToPtr(params->device), params->commandPool, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyCuFunctionNVX(void *args) -{ - struct vkDestroyCuFunctionNVX_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->function), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyCuFunctionNVX(vulkan_device_from_handle(params->device)->host.device, params->function, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyCuFunctionNVX(void *args) -{ - struct - { - PTR32 device; - VkCuFunctionNVX DECLSPEC_ALIGN(8) function; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->function), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyCuFunctionNVX(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->function, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyCuModuleNVX(void *args) -{ - struct vkDestroyCuModuleNVX_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->module), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyCuModuleNVX(vulkan_device_from_handle(params->device)->host.device, params->module, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyCuModuleNVX(void *args) -{ - struct - { - PTR32 device; - VkCuModuleNVX DECLSPEC_ALIGN(8) module; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->module), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyCuModuleNVX(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->module, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyCudaFunctionNV(void *args) -{ - struct vkDestroyCudaFunctionNV_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->function), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyCudaFunctionNV(vulkan_device_from_handle(params->device)->host.device, params->function, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyCudaFunctionNV(void *args) -{ - struct - { - PTR32 device; - VkCudaFunctionNV DECLSPEC_ALIGN(8) function; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->function), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyCudaFunctionNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->function, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyCudaModuleNV(void *args) -{ - struct vkDestroyCudaModuleNV_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->module), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyCudaModuleNV(vulkan_device_from_handle(params->device)->host.device, params->module, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyCudaModuleNV(void *args) -{ - struct - { - PTR32 device; - VkCudaModuleNV DECLSPEC_ALIGN(8) module; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->module), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyCudaModuleNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->module, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyDebugReportCallbackEXT(void *args) -{ - struct vkDestroyDebugReportCallbackEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->instance, wine_dbgstr_longlong(params->callback), params->pAllocator); - - wine_vkDestroyDebugReportCallbackEXT(params->instance, params->callback, params->pAllocator); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyDebugReportCallbackEXT(void *args) -{ - struct - { - PTR32 instance; - VkDebugReportCallbackEXT DECLSPEC_ALIGN(8) callback; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->instance, wine_dbgstr_longlong(params->callback), params->pAllocator); - - wine_vkDestroyDebugReportCallbackEXT((VkInstance)UlongToPtr(params->instance), params->callback, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyDebugUtilsMessengerEXT(void *args) -{ - struct vkDestroyDebugUtilsMessengerEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->instance, wine_dbgstr_longlong(params->messenger), params->pAllocator); - - wine_vkDestroyDebugUtilsMessengerEXT(params->instance, params->messenger, params->pAllocator); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyDebugUtilsMessengerEXT(void *args) -{ - struct - { - PTR32 instance; - VkDebugUtilsMessengerEXT DECLSPEC_ALIGN(8) messenger; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->instance, wine_dbgstr_longlong(params->messenger), params->pAllocator); - - wine_vkDestroyDebugUtilsMessengerEXT((VkInstance)UlongToPtr(params->instance), params->messenger, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyDeferredOperationKHR(void *args) -{ - struct vkDestroyDeferredOperationKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->operation), params->pAllocator); - - wine_vkDestroyDeferredOperationKHR(params->device, params->operation, params->pAllocator); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyDeferredOperationKHR(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) operation; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->operation), params->pAllocator); - - wine_vkDestroyDeferredOperationKHR((VkDevice)UlongToPtr(params->device), params->operation, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyDescriptorPool(void *args) -{ - struct vkDestroyDescriptorPool_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->descriptorPool), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyDescriptorPool(vulkan_device_from_handle(params->device)->host.device, params->descriptorPool, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyDescriptorPool(void *args) -{ - struct - { - PTR32 device; - VkDescriptorPool DECLSPEC_ALIGN(8) descriptorPool; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->descriptorPool), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyDescriptorPool(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->descriptorPool, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyDescriptorSetLayout(void *args) -{ - struct vkDestroyDescriptorSetLayout_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->descriptorSetLayout), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyDescriptorSetLayout(vulkan_device_from_handle(params->device)->host.device, params->descriptorSetLayout, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyDescriptorSetLayout(void *args) -{ - struct - { - PTR32 device; - VkDescriptorSetLayout DECLSPEC_ALIGN(8) descriptorSetLayout; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->descriptorSetLayout), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyDescriptorSetLayout(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->descriptorSetLayout, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyDescriptorUpdateTemplate(void *args) -{ - struct vkDestroyDescriptorUpdateTemplate_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->descriptorUpdateTemplate), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyDescriptorUpdateTemplate(vulkan_device_from_handle(params->device)->host.device, params->descriptorUpdateTemplate, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyDescriptorUpdateTemplate(void *args) -{ - struct - { - PTR32 device; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->descriptorUpdateTemplate), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyDescriptorUpdateTemplate(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->descriptorUpdateTemplate, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyDescriptorUpdateTemplateKHR(void *args) -{ - struct vkDestroyDescriptorUpdateTemplateKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->descriptorUpdateTemplate), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyDescriptorUpdateTemplateKHR(vulkan_device_from_handle(params->device)->host.device, params->descriptorUpdateTemplate, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyDescriptorUpdateTemplateKHR(void *args) -{ - struct - { - PTR32 device; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->descriptorUpdateTemplate), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyDescriptorUpdateTemplateKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->descriptorUpdateTemplate, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyDevice(void *args) -{ - struct vkDestroyDevice_params *params = args; - - TRACE("%p, %p\n", params->device, params->pAllocator); - - if (!params->device) - return STATUS_SUCCESS; - - wine_vkDestroyDevice(params->device, params->pAllocator); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyDevice(void *args) -{ - struct - { - PTR32 device; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, %#x\n", params->device, params->pAllocator); - - if (!params->device) - return STATUS_SUCCESS; - - wine_vkDestroyDevice((VkDevice)UlongToPtr(params->device), (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyEvent(void *args) -{ - struct vkDestroyEvent_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->event), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyEvent(vulkan_device_from_handle(params->device)->host.device, params->event, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyEvent(void *args) -{ - struct - { - PTR32 device; - VkEvent DECLSPEC_ALIGN(8) event; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->event), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyEvent(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->event, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyFence(void *args) -{ - struct vkDestroyFence_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->fence), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyFence(vulkan_device_from_handle(params->device)->host.device, params->fence, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyFence(void *args) -{ - struct - { - PTR32 device; - VkFence DECLSPEC_ALIGN(8) fence; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->fence), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyFence(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->fence, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyFramebuffer(void *args) -{ - struct vkDestroyFramebuffer_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->framebuffer), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyFramebuffer(vulkan_device_from_handle(params->device)->host.device, params->framebuffer, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyFramebuffer(void *args) -{ - struct - { - PTR32 device; - VkFramebuffer DECLSPEC_ALIGN(8) framebuffer; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->framebuffer), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyFramebuffer(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->framebuffer, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyImage(void *args) -{ - struct vkDestroyImage_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->image), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyImage(vulkan_device_from_handle(params->device)->host.device, params->image, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyImage(void *args) -{ - struct - { - PTR32 device; - VkImage DECLSPEC_ALIGN(8) image; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->image), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyImage(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->image, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyImageView(void *args) -{ - struct vkDestroyImageView_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->imageView), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyImageView(vulkan_device_from_handle(params->device)->host.device, params->imageView, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyImageView(void *args) -{ - struct - { - PTR32 device; - VkImageView DECLSPEC_ALIGN(8) imageView; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->imageView), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyImageView(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->imageView, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyIndirectCommandsLayoutEXT(void *args) -{ - struct vkDestroyIndirectCommandsLayoutEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->indirectCommandsLayout), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyIndirectCommandsLayoutEXT(vulkan_device_from_handle(params->device)->host.device, params->indirectCommandsLayout, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyIndirectCommandsLayoutEXT(void *args) -{ - struct - { - PTR32 device; - VkIndirectCommandsLayoutEXT DECLSPEC_ALIGN(8) indirectCommandsLayout; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->indirectCommandsLayout), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyIndirectCommandsLayoutEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->indirectCommandsLayout, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyIndirectCommandsLayoutNV(void *args) -{ - struct vkDestroyIndirectCommandsLayoutNV_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->indirectCommandsLayout), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyIndirectCommandsLayoutNV(vulkan_device_from_handle(params->device)->host.device, params->indirectCommandsLayout, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyIndirectCommandsLayoutNV(void *args) -{ - struct - { - PTR32 device; - VkIndirectCommandsLayoutNV DECLSPEC_ALIGN(8) indirectCommandsLayout; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->indirectCommandsLayout), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyIndirectCommandsLayoutNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->indirectCommandsLayout, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyIndirectExecutionSetEXT(void *args) -{ - struct vkDestroyIndirectExecutionSetEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->indirectExecutionSet), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyIndirectExecutionSetEXT(vulkan_device_from_handle(params->device)->host.device, params->indirectExecutionSet, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyIndirectExecutionSetEXT(void *args) -{ - struct - { - PTR32 device; - VkIndirectExecutionSetEXT DECLSPEC_ALIGN(8) indirectExecutionSet; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->indirectExecutionSet), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyIndirectExecutionSetEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->indirectExecutionSet, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyInstance(void *args) -{ - struct vkDestroyInstance_params *params = args; - - TRACE("%p, %p\n", params->instance, params->pAllocator); - - if (!params->instance) - return STATUS_SUCCESS; - - wine_vkDestroyInstance(params->instance, params->pAllocator); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyInstance(void *args) -{ - struct - { - PTR32 instance; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, %#x\n", params->instance, params->pAllocator); - - if (!params->instance) - return STATUS_SUCCESS; - - wine_vkDestroyInstance((VkInstance)UlongToPtr(params->instance), (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyMicromapEXT(void *args) -{ - struct vkDestroyMicromapEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->micromap), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyMicromapEXT(vulkan_device_from_handle(params->device)->host.device, params->micromap, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyMicromapEXT(void *args) -{ - struct - { - PTR32 device; - VkMicromapEXT DECLSPEC_ALIGN(8) micromap; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->micromap), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyMicromapEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->micromap, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyOpticalFlowSessionNV(void *args) -{ - struct vkDestroyOpticalFlowSessionNV_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->session), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyOpticalFlowSessionNV(vulkan_device_from_handle(params->device)->host.device, params->session, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyOpticalFlowSessionNV(void *args) -{ - struct - { - PTR32 device; - VkOpticalFlowSessionNV DECLSPEC_ALIGN(8) session; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->session), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyOpticalFlowSessionNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->session, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyPipeline(void *args) -{ - struct vkDestroyPipeline_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->pipeline), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyPipeline(vulkan_device_from_handle(params->device)->host.device, params->pipeline, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyPipeline(void *args) -{ - struct - { - PTR32 device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->pipeline), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyPipeline(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->pipeline, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyPipelineBinaryKHR(void *args) -{ - struct vkDestroyPipelineBinaryKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->pipelineBinary), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyPipelineBinaryKHR(vulkan_device_from_handle(params->device)->host.device, params->pipelineBinary, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyPipelineBinaryKHR(void *args) -{ - struct - { - PTR32 device; - VkPipelineBinaryKHR DECLSPEC_ALIGN(8) pipelineBinary; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->pipelineBinary), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyPipelineBinaryKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->pipelineBinary, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyPipelineCache(void *args) -{ - struct vkDestroyPipelineCache_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyPipelineCache(vulkan_device_from_handle(params->device)->host.device, params->pipelineCache, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyPipelineCache(void *args) -{ - struct - { - PTR32 device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyPipelineCache(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->pipelineCache, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyPipelineLayout(void *args) -{ - struct vkDestroyPipelineLayout_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->pipelineLayout), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyPipelineLayout(vulkan_device_from_handle(params->device)->host.device, params->pipelineLayout, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyPipelineLayout(void *args) -{ - struct - { - PTR32 device; - VkPipelineLayout DECLSPEC_ALIGN(8) pipelineLayout; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->pipelineLayout), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyPipelineLayout(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->pipelineLayout, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyPrivateDataSlot(void *args) -{ - struct vkDestroyPrivateDataSlot_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->privateDataSlot), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyPrivateDataSlot(vulkan_device_from_handle(params->device)->host.device, params->privateDataSlot, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyPrivateDataSlot(void *args) -{ - struct - { - PTR32 device; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->privateDataSlot), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyPrivateDataSlot(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->privateDataSlot, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyPrivateDataSlotEXT(void *args) -{ - struct vkDestroyPrivateDataSlotEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->privateDataSlot), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyPrivateDataSlotEXT(vulkan_device_from_handle(params->device)->host.device, params->privateDataSlot, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyPrivateDataSlotEXT(void *args) -{ - struct - { - PTR32 device; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->privateDataSlot), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyPrivateDataSlotEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->privateDataSlot, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyQueryPool(void *args) -{ - struct vkDestroyQueryPool_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->queryPool), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyQueryPool(vulkan_device_from_handle(params->device)->host.device, params->queryPool, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyQueryPool(void *args) -{ - struct - { - PTR32 device; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->queryPool), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyQueryPool(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->queryPool, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyRenderPass(void *args) -{ - struct vkDestroyRenderPass_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->renderPass), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyRenderPass(vulkan_device_from_handle(params->device)->host.device, params->renderPass, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyRenderPass(void *args) -{ - struct - { - PTR32 device; - VkRenderPass DECLSPEC_ALIGN(8) renderPass; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->renderPass), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyRenderPass(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->renderPass, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroySampler(void *args) -{ - struct vkDestroySampler_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->sampler), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroySampler(vulkan_device_from_handle(params->device)->host.device, params->sampler, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroySampler(void *args) -{ - struct - { - PTR32 device; - VkSampler DECLSPEC_ALIGN(8) sampler; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->sampler), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroySampler(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->sampler, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroySamplerYcbcrConversion(void *args) -{ - struct vkDestroySamplerYcbcrConversion_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->ycbcrConversion), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroySamplerYcbcrConversion(vulkan_device_from_handle(params->device)->host.device, params->ycbcrConversion, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroySamplerYcbcrConversion(void *args) -{ - struct - { - PTR32 device; - VkSamplerYcbcrConversion DECLSPEC_ALIGN(8) ycbcrConversion; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->ycbcrConversion), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroySamplerYcbcrConversion(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->ycbcrConversion, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroySamplerYcbcrConversionKHR(void *args) -{ - struct vkDestroySamplerYcbcrConversionKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->ycbcrConversion), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroySamplerYcbcrConversionKHR(vulkan_device_from_handle(params->device)->host.device, params->ycbcrConversion, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroySamplerYcbcrConversionKHR(void *args) -{ - struct - { - PTR32 device; - VkSamplerYcbcrConversion DECLSPEC_ALIGN(8) ycbcrConversion; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->ycbcrConversion), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroySamplerYcbcrConversionKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->ycbcrConversion, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroySemaphore(void *args) -{ - struct vkDestroySemaphore_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->semaphore), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroySemaphore(vulkan_device_from_handle(params->device)->host.device, params->semaphore, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroySemaphore(void *args) -{ - struct - { - PTR32 device; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->semaphore), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroySemaphore(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->semaphore, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyShaderEXT(void *args) -{ - struct vkDestroyShaderEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->shader), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyShaderEXT(vulkan_device_from_handle(params->device)->host.device, params->shader, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyShaderEXT(void *args) -{ - struct - { - PTR32 device; - VkShaderEXT DECLSPEC_ALIGN(8) shader; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->shader), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyShaderEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->shader, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyShaderModule(void *args) -{ - struct vkDestroyShaderModule_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->shaderModule), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyShaderModule(vulkan_device_from_handle(params->device)->host.device, params->shaderModule, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyShaderModule(void *args) -{ - struct - { - PTR32 device; - VkShaderModule DECLSPEC_ALIGN(8) shaderModule; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->shaderModule), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyShaderModule(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->shaderModule, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroySurfaceKHR(void *args) -{ - struct vkDestroySurfaceKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->instance, wine_dbgstr_longlong(params->surface), params->pAllocator); - - vk_funcs->p_vkDestroySurfaceKHR(params->instance, params->surface, params->pAllocator); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroySurfaceKHR(void *args) -{ - struct - { - PTR32 instance; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->instance, wine_dbgstr_longlong(params->surface), params->pAllocator); - - vk_funcs->p_vkDestroySurfaceKHR((VkInstance)UlongToPtr(params->instance), params->surface, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroySwapchainKHR(void *args) -{ - struct vkDestroySwapchainKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pAllocator); - - vk_funcs->p_vkDestroySwapchainKHR(params->device, params->swapchain, params->pAllocator); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroySwapchainKHR(void *args) -{ - struct - { - PTR32 device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pAllocator); - - vk_funcs->p_vkDestroySwapchainKHR((VkDevice)UlongToPtr(params->device), params->swapchain, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyValidationCacheEXT(void *args) -{ - struct vkDestroyValidationCacheEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->validationCache), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyValidationCacheEXT(vulkan_device_from_handle(params->device)->host.device, params->validationCache, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyValidationCacheEXT(void *args) -{ - struct - { - PTR32 device; - VkValidationCacheEXT DECLSPEC_ALIGN(8) validationCache; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->validationCache), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyValidationCacheEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->validationCache, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyVideoSessionKHR(void *args) -{ - struct vkDestroyVideoSessionKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->videoSession), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyVideoSessionKHR(vulkan_device_from_handle(params->device)->host.device, params->videoSession, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyVideoSessionKHR(void *args) -{ - struct - { - PTR32 device; - VkVideoSessionKHR DECLSPEC_ALIGN(8) videoSession; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->videoSession), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyVideoSessionKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->videoSession, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDestroyVideoSessionParametersKHR(void *args) -{ - struct vkDestroyVideoSessionParametersKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->videoSessionParameters), params->pAllocator); - - vulkan_device_from_handle(params->device)->p_vkDestroyVideoSessionParametersKHR(vulkan_device_from_handle(params->device)->host.device, params->videoSessionParameters, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDestroyVideoSessionParametersKHR(void *args) -{ - struct - { - PTR32 device; - VkVideoSessionParametersKHR DECLSPEC_ALIGN(8) videoSessionParameters; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->videoSessionParameters), params->pAllocator); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroyVideoSessionParametersKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->videoSessionParameters, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkDeviceWaitIdle(void *args) -{ - struct vkDeviceWaitIdle_params *params = args; - - TRACE("%p\n", params->device); - - params->result = vulkan_device_from_handle(params->device)->p_vkDeviceWaitIdle(vulkan_device_from_handle(params->device)->host.device); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkDeviceWaitIdle(void *args) -{ - struct - { - PTR32 device; - VkResult result; - } *params = args; - - TRACE("%#x\n", params->device); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDeviceWaitIdle(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkEndCommandBuffer(void *args) -{ - struct vkEndCommandBuffer_params *params = args; - - TRACE("%p\n", params->commandBuffer); - - params->result = wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkEndCommandBuffer(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkEndCommandBuffer(void *args) -{ - struct - { - PTR32 commandBuffer; - VkResult result; - } *params = args; - - TRACE("%#x\n", params->commandBuffer); - - params->result = wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkEndCommandBuffer(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkEnumerateDeviceExtensionProperties(void *args) -{ - struct vkEnumerateDeviceExtensionProperties_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->physicalDevice, params->pLayerName, params->pPropertyCount, params->pProperties); - - params->result = wine_vkEnumerateDeviceExtensionProperties(params->physicalDevice, params->pLayerName, params->pPropertyCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkEnumerateDeviceExtensionProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pLayerName; - PTR32 pPropertyCount; - PTR32 pProperties; - VkResult result; - } *params = args; - - TRACE("%#x, %#x, %#x, %#x\n", params->physicalDevice, params->pLayerName, params->pPropertyCount, params->pProperties); - - params->result = wine_vkEnumerateDeviceExtensionProperties((VkPhysicalDevice)UlongToPtr(params->physicalDevice), (const char *)UlongToPtr(params->pLayerName), (uint32_t *)UlongToPtr(params->pPropertyCount), (VkExtensionProperties *)UlongToPtr(params->pProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkEnumerateDeviceLayerProperties(void *args) -{ - struct vkEnumerateDeviceLayerProperties_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pPropertyCount, params->pProperties); - - params->result = wine_vkEnumerateDeviceLayerProperties(params->physicalDevice, params->pPropertyCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkEnumerateDeviceLayerProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pPropertyCount; - PTR32 pProperties; - VkResult result; - } *params = args; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pPropertyCount, params->pProperties); - - params->result = wine_vkEnumerateDeviceLayerProperties((VkPhysicalDevice)UlongToPtr(params->physicalDevice), (uint32_t *)UlongToPtr(params->pPropertyCount), (VkLayerProperties *)UlongToPtr(params->pProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkEnumerateInstanceExtensionProperties(void *args) -{ - struct vkEnumerateInstanceExtensionProperties_params *params = args; - - TRACE("%p, %p, %p\n", params->pLayerName, params->pPropertyCount, params->pProperties); - - params->result = wine_vkEnumerateInstanceExtensionProperties(params->pLayerName, params->pPropertyCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkEnumerateInstanceExtensionProperties(void *args) -{ - struct - { - PTR32 pLayerName; - PTR32 pPropertyCount; - PTR32 pProperties; - VkResult result; - } *params = args; - - TRACE("%#x, %#x, %#x\n", params->pLayerName, params->pPropertyCount, params->pProperties); - - params->result = wine_vkEnumerateInstanceExtensionProperties((const char *)UlongToPtr(params->pLayerName), (uint32_t *)UlongToPtr(params->pPropertyCount), (VkExtensionProperties *)UlongToPtr(params->pProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkEnumerateInstanceVersion(void *args) -{ - struct vkEnumerateInstanceVersion_params *params = args; - - TRACE("%p\n", params->pApiVersion); - - params->result = wine_vkEnumerateInstanceVersion(params->pApiVersion); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkEnumerateInstanceVersion(void *args) -{ - struct - { - PTR32 pApiVersion; - VkResult result; - } *params = args; - - TRACE("%#x\n", params->pApiVersion); - - params->result = wine_vkEnumerateInstanceVersion((uint32_t *)UlongToPtr(params->pApiVersion)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkEnumeratePhysicalDeviceGroups(void *args) -{ - struct vkEnumeratePhysicalDeviceGroups_params *params = args; - - TRACE("%p, %p, %p\n", params->instance, params->pPhysicalDeviceGroupCount, params->pPhysicalDeviceGroupProperties); - - params->result = wine_vkEnumeratePhysicalDeviceGroups(params->instance, params->pPhysicalDeviceGroupCount, params->pPhysicalDeviceGroupProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkEnumeratePhysicalDeviceGroups(void *args) -{ - struct - { - PTR32 instance; - PTR32 pPhysicalDeviceGroupCount; - PTR32 pPhysicalDeviceGroupProperties; - VkResult result; - } *params = args; - VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->instance, params->pPhysicalDeviceGroupCount, params->pPhysicalDeviceGroupProperties); - - init_conversion_context(ctx); - pPhysicalDeviceGroupProperties_host = convert_VkPhysicalDeviceGroupProperties_array_win32_to_unwrapped_host(ctx, (VkPhysicalDeviceGroupProperties32 *)UlongToPtr(params->pPhysicalDeviceGroupProperties), *(uint32_t *)UlongToPtr(params->pPhysicalDeviceGroupCount)); - params->result = wine_vkEnumeratePhysicalDeviceGroups((VkInstance)UlongToPtr(params->instance), (uint32_t *)UlongToPtr(params->pPhysicalDeviceGroupCount), pPhysicalDeviceGroupProperties_host); - convert_VkPhysicalDeviceGroupProperties_array_unwrapped_host_to_win32(pPhysicalDeviceGroupProperties_host, (VkPhysicalDeviceGroupProperties32 *)UlongToPtr(params->pPhysicalDeviceGroupProperties), *(uint32_t *)UlongToPtr(params->pPhysicalDeviceGroupCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkEnumeratePhysicalDeviceGroupsKHR(void *args) -{ - struct vkEnumeratePhysicalDeviceGroupsKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->instance, params->pPhysicalDeviceGroupCount, params->pPhysicalDeviceGroupProperties); - - params->result = wine_vkEnumeratePhysicalDeviceGroupsKHR(params->instance, params->pPhysicalDeviceGroupCount, params->pPhysicalDeviceGroupProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkEnumeratePhysicalDeviceGroupsKHR(void *args) -{ - struct - { - PTR32 instance; - PTR32 pPhysicalDeviceGroupCount; - PTR32 pPhysicalDeviceGroupProperties; - VkResult result; - } *params = args; - VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->instance, params->pPhysicalDeviceGroupCount, params->pPhysicalDeviceGroupProperties); - - init_conversion_context(ctx); - pPhysicalDeviceGroupProperties_host = convert_VkPhysicalDeviceGroupProperties_array_win32_to_unwrapped_host(ctx, (VkPhysicalDeviceGroupProperties32 *)UlongToPtr(params->pPhysicalDeviceGroupProperties), *(uint32_t *)UlongToPtr(params->pPhysicalDeviceGroupCount)); - params->result = wine_vkEnumeratePhysicalDeviceGroupsKHR((VkInstance)UlongToPtr(params->instance), (uint32_t *)UlongToPtr(params->pPhysicalDeviceGroupCount), pPhysicalDeviceGroupProperties_host); - convert_VkPhysicalDeviceGroupProperties_array_unwrapped_host_to_win32(pPhysicalDeviceGroupProperties_host, (VkPhysicalDeviceGroupProperties32 *)UlongToPtr(params->pPhysicalDeviceGroupProperties), *(uint32_t *)UlongToPtr(params->pPhysicalDeviceGroupCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(void *args) -{ - struct vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR_params *params = args; - - TRACE("%p, %u, %p, %p, %p\n", params->physicalDevice, params->queueFamilyIndex, params->pCounterCount, params->pCounters, params->pCounterDescriptions); - - params->result = vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->queueFamilyIndex, params->pCounterCount, params->pCounters, params->pCounterDescriptions); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - uint32_t queueFamilyIndex; - PTR32 pCounterCount; - PTR32 pCounters; - PTR32 pCounterDescriptions; - VkResult result; - } *params = args; - VkPerformanceCounterKHR *pCounters_host; - VkPerformanceCounterDescriptionKHR *pCounterDescriptions_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x, %#x, %#x\n", params->physicalDevice, params->queueFamilyIndex, params->pCounterCount, params->pCounters, params->pCounterDescriptions); - - init_conversion_context(ctx); - pCounters_host = convert_VkPerformanceCounterKHR_array_win32_to_host(ctx, (VkPerformanceCounterKHR32 *)UlongToPtr(params->pCounters), *(uint32_t *)UlongToPtr(params->pCounterCount)); - pCounterDescriptions_host = convert_VkPerformanceCounterDescriptionKHR_array_win32_to_host(ctx, (VkPerformanceCounterDescriptionKHR32 *)UlongToPtr(params->pCounterDescriptions), *(uint32_t *)UlongToPtr(params->pCounterCount)); - params->result = vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, params->queueFamilyIndex, (uint32_t *)UlongToPtr(params->pCounterCount), pCounters_host, pCounterDescriptions_host); - convert_VkPerformanceCounterKHR_array_host_to_win32(pCounters_host, (VkPerformanceCounterKHR32 *)UlongToPtr(params->pCounters), *(uint32_t *)UlongToPtr(params->pCounterCount)); - convert_VkPerformanceCounterDescriptionKHR_array_host_to_win32(pCounterDescriptions_host, (VkPerformanceCounterDescriptionKHR32 *)UlongToPtr(params->pCounterDescriptions), *(uint32_t *)UlongToPtr(params->pCounterCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkEnumeratePhysicalDevices(void *args) -{ - struct vkEnumeratePhysicalDevices_params *params = args; - - TRACE("%p, %p, %p\n", params->instance, params->pPhysicalDeviceCount, params->pPhysicalDevices); - - params->result = wine_vkEnumeratePhysicalDevices(params->instance, params->pPhysicalDeviceCount, params->pPhysicalDevices); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkEnumeratePhysicalDevices(void *args) -{ - struct - { - PTR32 instance; - PTR32 pPhysicalDeviceCount; - PTR32 pPhysicalDevices; - VkResult result; - } *params = args; - VkPhysicalDevice *pPhysicalDevices_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->instance, params->pPhysicalDeviceCount, params->pPhysicalDevices); - - init_conversion_context(ctx); - pPhysicalDevices_host = (params->pPhysicalDevices && *(uint32_t *)UlongToPtr(params->pPhysicalDeviceCount)) ? conversion_context_alloc(ctx, sizeof(*pPhysicalDevices_host) * *(uint32_t *)UlongToPtr(params->pPhysicalDeviceCount)) : NULL; - params->result = wine_vkEnumeratePhysicalDevices((VkInstance)UlongToPtr(params->instance), (uint32_t *)UlongToPtr(params->pPhysicalDeviceCount), pPhysicalDevices_host); - convert_VkPhysicalDevice_array_unwrapped_host_to_win32(pPhysicalDevices_host, (PTR32 *)UlongToPtr(params->pPhysicalDevices), *(uint32_t *)UlongToPtr(params->pPhysicalDeviceCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkFlushMappedMemoryRanges(void *args) -{ - struct vkFlushMappedMemoryRanges_params *params = args; - const VkMappedMemoryRange *pMemoryRanges_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p\n", params->device, params->memoryRangeCount, params->pMemoryRanges); - - init_conversion_context(ctx); - pMemoryRanges_host = convert_VkMappedMemoryRange_array_win64_to_host(ctx, params->pMemoryRanges, params->memoryRangeCount); - params->result = vulkan_device_from_handle(params->device)->p_vkFlushMappedMemoryRanges(vulkan_device_from_handle(params->device)->host.device, params->memoryRangeCount, pMemoryRanges_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkFlushMappedMemoryRanges(void *args) -{ - struct - { - PTR32 device; - uint32_t memoryRangeCount; - PTR32 pMemoryRanges; - VkResult result; - } *params = args; - const VkMappedMemoryRange *pMemoryRanges_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x\n", params->device, params->memoryRangeCount, params->pMemoryRanges); - - init_conversion_context(ctx); - pMemoryRanges_host = convert_VkMappedMemoryRange_array_win32_to_host(ctx, (const VkMappedMemoryRange32 *)UlongToPtr(params->pMemoryRanges), params->memoryRangeCount); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkFlushMappedMemoryRanges(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->memoryRangeCount, pMemoryRanges_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkFreeCommandBuffers(void *args) -{ - struct vkFreeCommandBuffers_params *params = args; - - TRACE("%p, 0x%s, %u, %p\n", params->device, wine_dbgstr_longlong(params->commandPool), params->commandBufferCount, params->pCommandBuffers); - - wine_vkFreeCommandBuffers(params->device, params->commandPool, params->commandBufferCount, params->pCommandBuffers); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkFreeCommandBuffers(void *args) -{ - struct - { - PTR32 device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - uint32_t commandBufferCount; - PTR32 pCommandBuffers; - } *params = args; - const VkCommandBuffer *pCommandBuffers_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->commandPool), params->commandBufferCount, params->pCommandBuffers); - - init_conversion_context(ctx); - pCommandBuffers_host = convert_VkCommandBuffer_array_win32_to_unwrapped_host(ctx, (const PTR32 *)UlongToPtr(params->pCommandBuffers), params->commandBufferCount); - wine_vkFreeCommandBuffers((VkDevice)UlongToPtr(params->device), params->commandPool, params->commandBufferCount, pCommandBuffers_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkFreeDescriptorSets(void *args) -{ - struct vkFreeDescriptorSets_params *params = args; - - TRACE("%p, 0x%s, %u, %p\n", params->device, wine_dbgstr_longlong(params->descriptorPool), params->descriptorSetCount, params->pDescriptorSets); - - params->result = vulkan_device_from_handle(params->device)->p_vkFreeDescriptorSets(vulkan_device_from_handle(params->device)->host.device, params->descriptorPool, params->descriptorSetCount, params->pDescriptorSets); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkFreeDescriptorSets(void *args) -{ - struct - { - PTR32 device; - VkDescriptorPool DECLSPEC_ALIGN(8) descriptorPool; - uint32_t descriptorSetCount; - PTR32 pDescriptorSets; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->descriptorPool), params->descriptorSetCount, params->pDescriptorSets); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkFreeDescriptorSets(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->descriptorPool, params->descriptorSetCount, (const VkDescriptorSet *)UlongToPtr(params->pDescriptorSets)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkFreeMemory(void *args) -{ - struct vkFreeMemory_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->memory), params->pAllocator); - - wine_vkFreeMemory(params->device, params->memory, params->pAllocator); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkFreeMemory(void *args) -{ - struct - { - PTR32 device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - PTR32 pAllocator; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->memory), params->pAllocator); - - wine_vkFreeMemory((VkDevice)UlongToPtr(params->device), params->memory, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetAccelerationStructureBuildSizesKHR(void *args) -{ - struct vkGetAccelerationStructureBuildSizesKHR_params *params = args; - - TRACE("%p, %#x, %p, %p, %p\n", params->device, params->buildType, params->pBuildInfo, params->pMaxPrimitiveCounts, params->pSizeInfo); - - vulkan_device_from_handle(params->device)->p_vkGetAccelerationStructureBuildSizesKHR(vulkan_device_from_handle(params->device)->host.device, params->buildType, params->pBuildInfo, params->pMaxPrimitiveCounts, params->pSizeInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetAccelerationStructureBuildSizesKHR(void *args) -{ - struct - { - PTR32 device; - VkAccelerationStructureBuildTypeKHR buildType; - PTR32 pBuildInfo; - PTR32 pMaxPrimitiveCounts; - PTR32 pSizeInfo; - } *params = args; - VkAccelerationStructureBuildGeometryInfoKHR pBuildInfo_host; - VkAccelerationStructureBuildSizesInfoKHR pSizeInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x, %#x\n", params->device, params->buildType, params->pBuildInfo, params->pMaxPrimitiveCounts, params->pSizeInfo); - - init_conversion_context(ctx); - convert_VkAccelerationStructureBuildGeometryInfoKHR_win32_to_host(ctx, (const VkAccelerationStructureBuildGeometryInfoKHR32 *)UlongToPtr(params->pBuildInfo), &pBuildInfo_host); - convert_VkAccelerationStructureBuildSizesInfoKHR_win32_to_host((VkAccelerationStructureBuildSizesInfoKHR32 *)UlongToPtr(params->pSizeInfo), &pSizeInfo_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetAccelerationStructureBuildSizesKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->buildType, &pBuildInfo_host, (const uint32_t *)UlongToPtr(params->pMaxPrimitiveCounts), &pSizeInfo_host); - convert_VkAccelerationStructureBuildSizesInfoKHR_host_to_win32(&pSizeInfo_host, (VkAccelerationStructureBuildSizesInfoKHR32 *)UlongToPtr(params->pSizeInfo)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetAccelerationStructureDeviceAddressKHR(void *args) -{ - struct vkGetAccelerationStructureDeviceAddressKHR_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetAccelerationStructureDeviceAddressKHR(vulkan_device_from_handle(params->device)->host.device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetAccelerationStructureDeviceAddressKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - VkDeviceAddress result; - } *params = args; - VkAccelerationStructureDeviceAddressInfoKHR pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkAccelerationStructureDeviceAddressInfoKHR_win32_to_host((const VkAccelerationStructureDeviceAddressInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetAccelerationStructureDeviceAddressKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetAccelerationStructureHandleNV(void *args) -{ - struct vkGetAccelerationStructureHandleNV_params *params = args; - - TRACE("%p, 0x%s, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->accelerationStructure), wine_dbgstr_longlong(params->dataSize), params->pData); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetAccelerationStructureHandleNV(vulkan_device_from_handle(params->device)->host.device, params->accelerationStructure, params->dataSize, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetAccelerationStructureHandleNV(void *args) -{ - struct - { - PTR32 device; - VkAccelerationStructureNV DECLSPEC_ALIGN(8) accelerationStructure; - PTR32 dataSize; - PTR32 pData; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->accelerationStructure), wine_dbgstr_longlong(params->dataSize), params->pData); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetAccelerationStructureHandleNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->accelerationStructure, params->dataSize, (void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetAccelerationStructureMemoryRequirementsNV(void *args) -{ - struct vkGetAccelerationStructureMemoryRequirementsNV_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - vulkan_device_from_handle(params->device)->p_vkGetAccelerationStructureMemoryRequirementsNV(vulkan_device_from_handle(params->device)->host.device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetAccelerationStructureMemoryRequirementsNV(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkAccelerationStructureMemoryRequirementsInfoNV pInfo_host; - VkMemoryRequirements2KHR pMemoryRequirements_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - convert_VkAccelerationStructureMemoryRequirementsInfoNV_win32_to_host((const VkAccelerationStructureMemoryRequirementsInfoNV32 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2KHR_win32_to_host((VkMemoryRequirements2KHR32 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetAccelerationStructureMemoryRequirementsNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2KHR_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements2KHR32 *)UlongToPtr(params->pMemoryRequirements)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pData); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT(vulkan_device_from_handle(params->device)->host.device, params->pInfo, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pData; - VkResult result; - } *params = args; - VkAccelerationStructureCaptureDescriptorDataInfoEXT pInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pData); - - convert_VkAccelerationStructureCaptureDescriptorDataInfoEXT_win32_to_host((const VkAccelerationStructureCaptureDescriptorDataInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, (void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetBufferDeviceAddress(void *args) -{ - struct vkGetBufferDeviceAddress_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetBufferDeviceAddress(vulkan_device_from_handle(params->device)->host.device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetBufferDeviceAddress(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - VkDeviceAddress result; - } *params = args; - VkBufferDeviceAddressInfo pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkBufferDeviceAddressInfo_win32_to_host((const VkBufferDeviceAddressInfo32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetBufferDeviceAddress(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetBufferDeviceAddressEXT(void *args) -{ - struct vkGetBufferDeviceAddressEXT_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetBufferDeviceAddressEXT(vulkan_device_from_handle(params->device)->host.device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetBufferDeviceAddressEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - VkDeviceAddress result; - } *params = args; - VkBufferDeviceAddressInfo pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkBufferDeviceAddressInfo_win32_to_host((const VkBufferDeviceAddressInfo32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetBufferDeviceAddressEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetBufferDeviceAddressKHR(void *args) -{ - struct vkGetBufferDeviceAddressKHR_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetBufferDeviceAddressKHR(vulkan_device_from_handle(params->device)->host.device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetBufferDeviceAddressKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - VkDeviceAddress result; - } *params = args; - VkBufferDeviceAddressInfo pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkBufferDeviceAddressInfo_win32_to_host((const VkBufferDeviceAddressInfo32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetBufferDeviceAddressKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetBufferMemoryRequirements(void *args) -{ - struct vkGetBufferMemoryRequirements_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->buffer), params->pMemoryRequirements); - - vulkan_device_from_handle(params->device)->p_vkGetBufferMemoryRequirements(vulkan_device_from_handle(params->device)->host.device, params->buffer, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetBufferMemoryRequirements(void *args) -{ - struct - { - PTR32 device; - VkBuffer DECLSPEC_ALIGN(8) buffer; - PTR32 pMemoryRequirements; - } *params = args; - VkMemoryRequirements pMemoryRequirements_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->buffer), params->pMemoryRequirements); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetBufferMemoryRequirements(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->buffer, &pMemoryRequirements_host); - convert_VkMemoryRequirements_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements32 *)UlongToPtr(params->pMemoryRequirements)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetBufferMemoryRequirements2(void *args) -{ - struct vkGetBufferMemoryRequirements2_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - vulkan_device_from_handle(params->device)->p_vkGetBufferMemoryRequirements2(vulkan_device_from_handle(params->device)->host.device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetBufferMemoryRequirements2(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkBufferMemoryRequirementsInfo2 pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkBufferMemoryRequirementsInfo2_win32_to_host((const VkBufferMemoryRequirementsInfo232 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetBufferMemoryRequirements2(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetBufferMemoryRequirements2KHR(void *args) -{ - struct vkGetBufferMemoryRequirements2KHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - vulkan_device_from_handle(params->device)->p_vkGetBufferMemoryRequirements2KHR(vulkan_device_from_handle(params->device)->host.device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetBufferMemoryRequirements2KHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkBufferMemoryRequirementsInfo2 pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkBufferMemoryRequirementsInfo2_win32_to_host((const VkBufferMemoryRequirementsInfo232 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetBufferMemoryRequirements2KHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetBufferOpaqueCaptureAddress(void *args) -{ - struct vkGetBufferOpaqueCaptureAddress_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetBufferOpaqueCaptureAddress(vulkan_device_from_handle(params->device)->host.device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetBufferOpaqueCaptureAddress(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - uint64_t result; - } *params = args; - VkBufferDeviceAddressInfo pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkBufferDeviceAddressInfo_win32_to_host((const VkBufferDeviceAddressInfo32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetBufferOpaqueCaptureAddress(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetBufferOpaqueCaptureAddressKHR(void *args) -{ - struct vkGetBufferOpaqueCaptureAddressKHR_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetBufferOpaqueCaptureAddressKHR(vulkan_device_from_handle(params->device)->host.device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetBufferOpaqueCaptureAddressKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - uint64_t result; - } *params = args; - VkBufferDeviceAddressInfo pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkBufferDeviceAddressInfo_win32_to_host((const VkBufferDeviceAddressInfo32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetBufferOpaqueCaptureAddressKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetBufferOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct vkGetBufferOpaqueCaptureDescriptorDataEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pData); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetBufferOpaqueCaptureDescriptorDataEXT(vulkan_device_from_handle(params->device)->host.device, params->pInfo, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetBufferOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pData; - VkResult result; - } *params = args; - VkBufferCaptureDescriptorDataInfoEXT pInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pData); - - convert_VkBufferCaptureDescriptorDataInfoEXT_win32_to_host((const VkBufferCaptureDescriptorDataInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetBufferOpaqueCaptureDescriptorDataEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, (void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetCalibratedTimestampsEXT(void *args) -{ - struct vkGetCalibratedTimestampsEXT_params *params = args; - - TRACE("%p, %u, %p, %p, %p\n", params->device, params->timestampCount, params->pTimestampInfos, params->pTimestamps, params->pMaxDeviation); - - params->result = wine_vkGetCalibratedTimestampsEXT(params->device, params->timestampCount, params->pTimestampInfos, params->pTimestamps, params->pMaxDeviation); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetCalibratedTimestampsEXT(void *args) -{ - struct - { - PTR32 device; - uint32_t timestampCount; - PTR32 pTimestampInfos; - PTR32 pTimestamps; - PTR32 pMaxDeviation; - VkResult result; - } *params = args; - const VkCalibratedTimestampInfoKHR *pTimestampInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x, %#x, %#x\n", params->device, params->timestampCount, params->pTimestampInfos, params->pTimestamps, params->pMaxDeviation); - - init_conversion_context(ctx); - pTimestampInfos_host = convert_VkCalibratedTimestampInfoKHR_array_win32_to_host(ctx, (const VkCalibratedTimestampInfoKHR32 *)UlongToPtr(params->pTimestampInfos), params->timestampCount); - params->result = wine_vkGetCalibratedTimestampsEXT((VkDevice)UlongToPtr(params->device), params->timestampCount, pTimestampInfos_host, (uint64_t *)UlongToPtr(params->pTimestamps), (uint64_t *)UlongToPtr(params->pMaxDeviation)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetCalibratedTimestampsKHR(void *args) -{ - struct vkGetCalibratedTimestampsKHR_params *params = args; - - TRACE("%p, %u, %p, %p, %p\n", params->device, params->timestampCount, params->pTimestampInfos, params->pTimestamps, params->pMaxDeviation); - - params->result = wine_vkGetCalibratedTimestampsKHR(params->device, params->timestampCount, params->pTimestampInfos, params->pTimestamps, params->pMaxDeviation); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetCalibratedTimestampsKHR(void *args) -{ - struct - { - PTR32 device; - uint32_t timestampCount; - PTR32 pTimestampInfos; - PTR32 pTimestamps; - PTR32 pMaxDeviation; - VkResult result; - } *params = args; - const VkCalibratedTimestampInfoKHR *pTimestampInfos_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x, %#x, %#x\n", params->device, params->timestampCount, params->pTimestampInfos, params->pTimestamps, params->pMaxDeviation); - - init_conversion_context(ctx); - pTimestampInfos_host = convert_VkCalibratedTimestampInfoKHR_array_win32_to_host(ctx, (const VkCalibratedTimestampInfoKHR32 *)UlongToPtr(params->pTimestampInfos), params->timestampCount); - params->result = wine_vkGetCalibratedTimestampsKHR((VkDevice)UlongToPtr(params->device), params->timestampCount, pTimestampInfos_host, (uint64_t *)UlongToPtr(params->pTimestamps), (uint64_t *)UlongToPtr(params->pMaxDeviation)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetCudaModuleCacheNV(void *args) -{ - struct vkGetCudaModuleCacheNV_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->module), params->pCacheSize, params->pCacheData); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetCudaModuleCacheNV(vulkan_device_from_handle(params->device)->host.device, params->module, params->pCacheSize, params->pCacheData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetCudaModuleCacheNV(void *args) -{ - struct - { - PTR32 device; - VkCudaModuleNV DECLSPEC_ALIGN(8) module; - PTR32 pCacheSize; - PTR32 pCacheData; - VkResult result; - } *params = args; - size_t pCacheSize_host; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->module), params->pCacheSize, params->pCacheData); - - pCacheSize_host = *(PTR32 *)UlongToPtr(params->pCacheSize); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetCudaModuleCacheNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->module, &pCacheSize_host, (void *)UlongToPtr(params->pCacheData)); - *(PTR32 *)UlongToPtr(params->pCacheSize) = pCacheSize_host; - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeferredOperationMaxConcurrencyKHR(void *args) -{ - struct vkGetDeferredOperationMaxConcurrencyKHR_params *params = args; - - TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->operation)); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetDeferredOperationMaxConcurrencyKHR(vulkan_device_from_handle(params->device)->host.device, wine_deferred_operation_from_handle(params->operation)->host.deferred_operation); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeferredOperationMaxConcurrencyKHR(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) operation; - uint32_t result; - } *params = args; - - TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->operation)); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeferredOperationMaxConcurrencyKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, wine_deferred_operation_from_handle(params->operation)->host.deferred_operation); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeferredOperationResultKHR(void *args) -{ - struct vkGetDeferredOperationResultKHR_params *params = args; - - TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->operation)); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetDeferredOperationResultKHR(vulkan_device_from_handle(params->device)->host.device, wine_deferred_operation_from_handle(params->operation)->host.deferred_operation); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeferredOperationResultKHR(void *args) -{ - struct - { - PTR32 device; - VkDeferredOperationKHR DECLSPEC_ALIGN(8) operation; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->operation)); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeferredOperationResultKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, wine_deferred_operation_from_handle(params->operation)->host.deferred_operation); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static void thunk64_vkGetDescriptorEXT(void *args) -{ - struct vkGetDescriptorEXT_params *params = args; - - vulkan_device_from_handle(params->device)->p_vkGetDescriptorEXT(vulkan_device_from_handle(params->device)->host.device, params->pDescriptorInfo, params->dataSize, params->pDescriptor); -} -#endif /* _WIN64 */ - -static void thunk32_vkGetDescriptorEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pDescriptorInfo; - PTR32 dataSize; - PTR32 pDescriptor; - } *params = args; - VkDescriptorGetInfoEXT pDescriptorInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - convert_VkDescriptorGetInfoEXT_win32_to_host(ctx, (const VkDescriptorGetInfoEXT32 *)UlongToPtr(params->pDescriptorInfo), &pDescriptorInfo_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDescriptorEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pDescriptorInfo_host, params->dataSize, (void *)UlongToPtr(params->pDescriptor)); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDescriptorSetHostMappingVALVE(void *args) -{ - struct vkGetDescriptorSetHostMappingVALVE_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->descriptorSet), params->ppData); - - vulkan_device_from_handle(params->device)->p_vkGetDescriptorSetHostMappingVALVE(vulkan_device_from_handle(params->device)->host.device, params->descriptorSet, params->ppData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDescriptorSetHostMappingVALVE(void *args) -{ - struct - { - PTR32 device; - VkDescriptorSet DECLSPEC_ALIGN(8) descriptorSet; - PTR32 ppData; - } *params = args; - void *ppData_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->descriptorSet), params->ppData); - - ppData_host = UlongToPtr(*(PTR32 *)UlongToPtr(params->ppData)); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDescriptorSetHostMappingVALVE(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->descriptorSet, &ppData_host); - *(PTR32 *)UlongToPtr(params->ppData) = PtrToUlong(ppData_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDescriptorSetLayoutBindingOffsetEXT(void *args) -{ - struct vkGetDescriptorSetLayoutBindingOffsetEXT_params *params = args; - - TRACE("%p, 0x%s, %u, %p\n", params->device, wine_dbgstr_longlong(params->layout), params->binding, params->pOffset); - - vulkan_device_from_handle(params->device)->p_vkGetDescriptorSetLayoutBindingOffsetEXT(vulkan_device_from_handle(params->device)->host.device, params->layout, params->binding, params->pOffset); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDescriptorSetLayoutBindingOffsetEXT(void *args) -{ - struct - { - PTR32 device; - VkDescriptorSetLayout DECLSPEC_ALIGN(8) layout; - uint32_t binding; - PTR32 pOffset; - } *params = args; - - TRACE("%#x, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->layout), params->binding, params->pOffset); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDescriptorSetLayoutBindingOffsetEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->layout, params->binding, (VkDeviceSize *)UlongToPtr(params->pOffset)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDescriptorSetLayoutHostMappingInfoVALVE(void *args) -{ - struct vkGetDescriptorSetLayoutHostMappingInfoVALVE_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pBindingReference, params->pHostMapping); - - vulkan_device_from_handle(params->device)->p_vkGetDescriptorSetLayoutHostMappingInfoVALVE(vulkan_device_from_handle(params->device)->host.device, params->pBindingReference, params->pHostMapping); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDescriptorSetLayoutHostMappingInfoVALVE(void *args) -{ - struct - { - PTR32 device; - PTR32 pBindingReference; - PTR32 pHostMapping; - } *params = args; - VkDescriptorSetBindingReferenceVALVE pBindingReference_host; - VkDescriptorSetLayoutHostMappingInfoVALVE pHostMapping_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pBindingReference, params->pHostMapping); - - convert_VkDescriptorSetBindingReferenceVALVE_win32_to_host((const VkDescriptorSetBindingReferenceVALVE32 *)UlongToPtr(params->pBindingReference), &pBindingReference_host); - convert_VkDescriptorSetLayoutHostMappingInfoVALVE_win32_to_host((VkDescriptorSetLayoutHostMappingInfoVALVE32 *)UlongToPtr(params->pHostMapping), &pHostMapping_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDescriptorSetLayoutHostMappingInfoVALVE(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pBindingReference_host, &pHostMapping_host); - convert_VkDescriptorSetLayoutHostMappingInfoVALVE_host_to_win32(&pHostMapping_host, (VkDescriptorSetLayoutHostMappingInfoVALVE32 *)UlongToPtr(params->pHostMapping)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDescriptorSetLayoutSizeEXT(void *args) -{ - struct vkGetDescriptorSetLayoutSizeEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->layout), params->pLayoutSizeInBytes); - - vulkan_device_from_handle(params->device)->p_vkGetDescriptorSetLayoutSizeEXT(vulkan_device_from_handle(params->device)->host.device, params->layout, params->pLayoutSizeInBytes); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDescriptorSetLayoutSizeEXT(void *args) -{ - struct - { - PTR32 device; - VkDescriptorSetLayout DECLSPEC_ALIGN(8) layout; - PTR32 pLayoutSizeInBytes; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->layout), params->pLayoutSizeInBytes); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDescriptorSetLayoutSizeEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->layout, (VkDeviceSize *)UlongToPtr(params->pLayoutSizeInBytes)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDescriptorSetLayoutSupport(void *args) -{ - struct vkGetDescriptorSetLayoutSupport_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pCreateInfo, params->pSupport); - - vulkan_device_from_handle(params->device)->p_vkGetDescriptorSetLayoutSupport(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, params->pSupport); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDescriptorSetLayoutSupport(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pSupport; - } *params = args; - VkDescriptorSetLayoutCreateInfo pCreateInfo_host; - VkDescriptorSetLayoutSupport pSupport_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pSupport); - - init_conversion_context(ctx); - convert_VkDescriptorSetLayoutCreateInfo_win32_to_host(ctx, (const VkDescriptorSetLayoutCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - convert_VkDescriptorSetLayoutSupport_win32_to_host(ctx, (VkDescriptorSetLayoutSupport32 *)UlongToPtr(params->pSupport), &pSupport_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDescriptorSetLayoutSupport(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, &pSupport_host); - convert_VkDescriptorSetLayoutSupport_host_to_win32(&pSupport_host, (VkDescriptorSetLayoutSupport32 *)UlongToPtr(params->pSupport)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDescriptorSetLayoutSupportKHR(void *args) -{ - struct vkGetDescriptorSetLayoutSupportKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pCreateInfo, params->pSupport); - - vulkan_device_from_handle(params->device)->p_vkGetDescriptorSetLayoutSupportKHR(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, params->pSupport); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDescriptorSetLayoutSupportKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pSupport; - } *params = args; - VkDescriptorSetLayoutCreateInfo pCreateInfo_host; - VkDescriptorSetLayoutSupport pSupport_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pSupport); - - init_conversion_context(ctx); - convert_VkDescriptorSetLayoutCreateInfo_win32_to_host(ctx, (const VkDescriptorSetLayoutCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - convert_VkDescriptorSetLayoutSupport_win32_to_host(ctx, (VkDescriptorSetLayoutSupport32 *)UlongToPtr(params->pSupport), &pSupport_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDescriptorSetLayoutSupportKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, &pSupport_host); - convert_VkDescriptorSetLayoutSupport_host_to_win32(&pSupport_host, (VkDescriptorSetLayoutSupport32 *)UlongToPtr(params->pSupport)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceAccelerationStructureCompatibilityKHR(void *args) -{ - struct vkGetDeviceAccelerationStructureCompatibilityKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pVersionInfo, params->pCompatibility); - - vulkan_device_from_handle(params->device)->p_vkGetDeviceAccelerationStructureCompatibilityKHR(vulkan_device_from_handle(params->device)->host.device, params->pVersionInfo, params->pCompatibility); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceAccelerationStructureCompatibilityKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pVersionInfo; - PTR32 pCompatibility; - } *params = args; - VkAccelerationStructureVersionInfoKHR pVersionInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pVersionInfo, params->pCompatibility); - - convert_VkAccelerationStructureVersionInfoKHR_win32_to_host((const VkAccelerationStructureVersionInfoKHR32 *)UlongToPtr(params->pVersionInfo), &pVersionInfo_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceAccelerationStructureCompatibilityKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pVersionInfo_host, (VkAccelerationStructureCompatibilityKHR *)UlongToPtr(params->pCompatibility)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceBufferMemoryRequirements(void *args) -{ - struct vkGetDeviceBufferMemoryRequirements_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - vulkan_device_from_handle(params->device)->p_vkGetDeviceBufferMemoryRequirements(vulkan_device_from_handle(params->device)->host.device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceBufferMemoryRequirements(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkDeviceBufferMemoryRequirements pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkDeviceBufferMemoryRequirements_win32_to_host(ctx, (const VkDeviceBufferMemoryRequirements32 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceBufferMemoryRequirements(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceBufferMemoryRequirementsKHR(void *args) -{ - struct vkGetDeviceBufferMemoryRequirementsKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - vulkan_device_from_handle(params->device)->p_vkGetDeviceBufferMemoryRequirementsKHR(vulkan_device_from_handle(params->device)->host.device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceBufferMemoryRequirementsKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkDeviceBufferMemoryRequirements pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkDeviceBufferMemoryRequirements_win32_to_host(ctx, (const VkDeviceBufferMemoryRequirements32 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceBufferMemoryRequirementsKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceFaultInfoEXT(void *args) -{ - struct vkGetDeviceFaultInfoEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pFaultCounts, params->pFaultInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetDeviceFaultInfoEXT(vulkan_device_from_handle(params->device)->host.device, params->pFaultCounts, params->pFaultInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceFaultInfoEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pFaultCounts; - PTR32 pFaultInfo; - VkResult result; - } *params = args; - VkDeviceFaultCountsEXT pFaultCounts_host; - VkDeviceFaultInfoEXT *pFaultInfo_host = NULL; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pFaultCounts, params->pFaultInfo); - - init_conversion_context(ctx); - convert_VkDeviceFaultCountsEXT_win32_to_host((VkDeviceFaultCountsEXT32 *)UlongToPtr(params->pFaultCounts), &pFaultCounts_host); - if (params->pFaultInfo) - { - pFaultInfo_host = conversion_context_alloc(ctx, sizeof(*pFaultInfo_host)); - convert_VkDeviceFaultInfoEXT_win32_to_host(ctx, (VkDeviceFaultInfoEXT32 *)UlongToPtr(params->pFaultInfo), pFaultInfo_host); - } - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceFaultInfoEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pFaultCounts_host, pFaultInfo_host); - convert_VkDeviceFaultCountsEXT_host_to_win32(&pFaultCounts_host, (VkDeviceFaultCountsEXT32 *)UlongToPtr(params->pFaultCounts)); - convert_VkDeviceFaultInfoEXT_host_to_win32(pFaultInfo_host, (VkDeviceFaultInfoEXT32 *)UlongToPtr(params->pFaultInfo)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceGroupPeerMemoryFeatures(void *args) -{ - struct vkGetDeviceGroupPeerMemoryFeatures_params *params = args; - - TRACE("%p, %u, %u, %u, %p\n", params->device, params->heapIndex, params->localDeviceIndex, params->remoteDeviceIndex, params->pPeerMemoryFeatures); - - vulkan_device_from_handle(params->device)->p_vkGetDeviceGroupPeerMemoryFeatures(vulkan_device_from_handle(params->device)->host.device, params->heapIndex, params->localDeviceIndex, params->remoteDeviceIndex, params->pPeerMemoryFeatures); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceGroupPeerMemoryFeatures(void *args) -{ - struct - { - PTR32 device; - uint32_t heapIndex; - uint32_t localDeviceIndex; - uint32_t remoteDeviceIndex; - PTR32 pPeerMemoryFeatures; - } *params = args; - - TRACE("%#x, %u, %u, %u, %#x\n", params->device, params->heapIndex, params->localDeviceIndex, params->remoteDeviceIndex, params->pPeerMemoryFeatures); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceGroupPeerMemoryFeatures(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->heapIndex, params->localDeviceIndex, params->remoteDeviceIndex, (VkPeerMemoryFeatureFlags *)UlongToPtr(params->pPeerMemoryFeatures)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceGroupPeerMemoryFeaturesKHR(void *args) -{ - struct vkGetDeviceGroupPeerMemoryFeaturesKHR_params *params = args; - - TRACE("%p, %u, %u, %u, %p\n", params->device, params->heapIndex, params->localDeviceIndex, params->remoteDeviceIndex, params->pPeerMemoryFeatures); - - vulkan_device_from_handle(params->device)->p_vkGetDeviceGroupPeerMemoryFeaturesKHR(vulkan_device_from_handle(params->device)->host.device, params->heapIndex, params->localDeviceIndex, params->remoteDeviceIndex, params->pPeerMemoryFeatures); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceGroupPeerMemoryFeaturesKHR(void *args) -{ - struct - { - PTR32 device; - uint32_t heapIndex; - uint32_t localDeviceIndex; - uint32_t remoteDeviceIndex; - PTR32 pPeerMemoryFeatures; - } *params = args; - - TRACE("%#x, %u, %u, %u, %#x\n", params->device, params->heapIndex, params->localDeviceIndex, params->remoteDeviceIndex, params->pPeerMemoryFeatures); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceGroupPeerMemoryFeaturesKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->heapIndex, params->localDeviceIndex, params->remoteDeviceIndex, (VkPeerMemoryFeatureFlags *)UlongToPtr(params->pPeerMemoryFeatures)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceGroupPresentCapabilitiesKHR(void *args) -{ - struct vkGetDeviceGroupPresentCapabilitiesKHR_params *params = args; - - TRACE("%p, %p\n", params->device, params->pDeviceGroupPresentCapabilities); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetDeviceGroupPresentCapabilitiesKHR(vulkan_device_from_handle(params->device)->host.device, params->pDeviceGroupPresentCapabilities); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceGroupPresentCapabilitiesKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pDeviceGroupPresentCapabilities; - VkResult result; - } *params = args; - VkDeviceGroupPresentCapabilitiesKHR pDeviceGroupPresentCapabilities_host; - - TRACE("%#x, %#x\n", params->device, params->pDeviceGroupPresentCapabilities); - - convert_VkDeviceGroupPresentCapabilitiesKHR_win32_to_host((VkDeviceGroupPresentCapabilitiesKHR32 *)UlongToPtr(params->pDeviceGroupPresentCapabilities), &pDeviceGroupPresentCapabilities_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceGroupPresentCapabilitiesKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pDeviceGroupPresentCapabilities_host); - convert_VkDeviceGroupPresentCapabilitiesKHR_host_to_win32(&pDeviceGroupPresentCapabilities_host, (VkDeviceGroupPresentCapabilitiesKHR32 *)UlongToPtr(params->pDeviceGroupPresentCapabilities)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceGroupSurfacePresentModesKHR(void *args) -{ - struct vkGetDeviceGroupSurfacePresentModesKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->surface), params->pModes); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetDeviceGroupSurfacePresentModesKHR(vulkan_device_from_handle(params->device)->host.device, vulkan_surface_from_handle(params->surface)->host.surface, params->pModes); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceGroupSurfacePresentModesKHR(void *args) -{ - struct - { - PTR32 device; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - PTR32 pModes; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->surface), params->pModes); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceGroupSurfacePresentModesKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, vulkan_surface_from_handle(params->surface)->host.surface, (VkDeviceGroupPresentModeFlagsKHR *)UlongToPtr(params->pModes)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceImageMemoryRequirements(void *args) -{ - struct vkGetDeviceImageMemoryRequirements_params *params = args; - VkDeviceImageMemoryRequirements pInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkDeviceImageMemoryRequirements_win64_to_host(ctx, params->pInfo, &pInfo_host); - vulkan_device_from_handle(params->device)->p_vkGetDeviceImageMemoryRequirements(vulkan_device_from_handle(params->device)->host.device, &pInfo_host, params->pMemoryRequirements); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceImageMemoryRequirements(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkDeviceImageMemoryRequirements pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkDeviceImageMemoryRequirements_win32_to_host(ctx, (const VkDeviceImageMemoryRequirements32 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceImageMemoryRequirements(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceImageMemoryRequirementsKHR(void *args) -{ - struct vkGetDeviceImageMemoryRequirementsKHR_params *params = args; - VkDeviceImageMemoryRequirements pInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkDeviceImageMemoryRequirements_win64_to_host(ctx, params->pInfo, &pInfo_host); - vulkan_device_from_handle(params->device)->p_vkGetDeviceImageMemoryRequirementsKHR(vulkan_device_from_handle(params->device)->host.device, &pInfo_host, params->pMemoryRequirements); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceImageMemoryRequirementsKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkDeviceImageMemoryRequirements pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkDeviceImageMemoryRequirements_win32_to_host(ctx, (const VkDeviceImageMemoryRequirements32 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceImageMemoryRequirementsKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceImageSparseMemoryRequirements(void *args) -{ - struct vkGetDeviceImageSparseMemoryRequirements_params *params = args; - VkDeviceImageMemoryRequirements pInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %p, %p, %p\n", params->device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - init_conversion_context(ctx); - convert_VkDeviceImageMemoryRequirements_win64_to_host(ctx, params->pInfo, &pInfo_host); - vulkan_device_from_handle(params->device)->p_vkGetDeviceImageSparseMemoryRequirements(vulkan_device_from_handle(params->device)->host.device, &pInfo_host, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceImageSparseMemoryRequirements(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pSparseMemoryRequirementCount; - PTR32 pSparseMemoryRequirements; - } *params = args; - VkDeviceImageMemoryRequirements pInfo_host; - VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - init_conversion_context(ctx); - convert_VkDeviceImageMemoryRequirements_win32_to_host(ctx, (const VkDeviceImageMemoryRequirements32 *)UlongToPtr(params->pInfo), &pInfo_host); - pSparseMemoryRequirements_host = convert_VkSparseImageMemoryRequirements2_array_win32_to_host(ctx, (VkSparseImageMemoryRequirements232 *)UlongToPtr(params->pSparseMemoryRequirements), *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceImageSparseMemoryRequirements(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, (uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount), pSparseMemoryRequirements_host); - convert_VkSparseImageMemoryRequirements2_array_host_to_win32(pSparseMemoryRequirements_host, (VkSparseImageMemoryRequirements232 *)UlongToPtr(params->pSparseMemoryRequirements), *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceImageSparseMemoryRequirementsKHR(void *args) -{ - struct vkGetDeviceImageSparseMemoryRequirementsKHR_params *params = args; - VkDeviceImageMemoryRequirements pInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %p, %p, %p\n", params->device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - init_conversion_context(ctx); - convert_VkDeviceImageMemoryRequirements_win64_to_host(ctx, params->pInfo, &pInfo_host); - vulkan_device_from_handle(params->device)->p_vkGetDeviceImageSparseMemoryRequirementsKHR(vulkan_device_from_handle(params->device)->host.device, &pInfo_host, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceImageSparseMemoryRequirementsKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pSparseMemoryRequirementCount; - PTR32 pSparseMemoryRequirements; - } *params = args; - VkDeviceImageMemoryRequirements pInfo_host; - VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - init_conversion_context(ctx); - convert_VkDeviceImageMemoryRequirements_win32_to_host(ctx, (const VkDeviceImageMemoryRequirements32 *)UlongToPtr(params->pInfo), &pInfo_host); - pSparseMemoryRequirements_host = convert_VkSparseImageMemoryRequirements2_array_win32_to_host(ctx, (VkSparseImageMemoryRequirements232 *)UlongToPtr(params->pSparseMemoryRequirements), *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceImageSparseMemoryRequirementsKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, (uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount), pSparseMemoryRequirements_host); - convert_VkSparseImageMemoryRequirements2_array_host_to_win32(pSparseMemoryRequirements_host, (VkSparseImageMemoryRequirements232 *)UlongToPtr(params->pSparseMemoryRequirements), *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceImageSubresourceLayout(void *args) -{ - struct vkGetDeviceImageSubresourceLayout_params *params = args; - VkDeviceImageSubresourceInfo pInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pLayout); - - init_conversion_context(ctx); - convert_VkDeviceImageSubresourceInfo_win64_to_host(ctx, params->pInfo, &pInfo_host); - vulkan_device_from_handle(params->device)->p_vkGetDeviceImageSubresourceLayout(vulkan_device_from_handle(params->device)->host.device, &pInfo_host, params->pLayout); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceImageSubresourceLayout(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pLayout; - } *params = args; - VkDeviceImageSubresourceInfo pInfo_host; - VkSubresourceLayout2 pLayout_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pLayout); - - init_conversion_context(ctx); - convert_VkDeviceImageSubresourceInfo_win32_to_host(ctx, (const VkDeviceImageSubresourceInfo32 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkSubresourceLayout2_win32_to_host(ctx, (VkSubresourceLayout232 *)UlongToPtr(params->pLayout), &pLayout_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceImageSubresourceLayout(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, &pLayout_host); - convert_VkSubresourceLayout2_host_to_win32(&pLayout_host, (VkSubresourceLayout232 *)UlongToPtr(params->pLayout)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceImageSubresourceLayoutKHR(void *args) -{ - struct vkGetDeviceImageSubresourceLayoutKHR_params *params = args; - VkDeviceImageSubresourceInfo pInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pLayout); - - init_conversion_context(ctx); - convert_VkDeviceImageSubresourceInfo_win64_to_host(ctx, params->pInfo, &pInfo_host); - vulkan_device_from_handle(params->device)->p_vkGetDeviceImageSubresourceLayoutKHR(vulkan_device_from_handle(params->device)->host.device, &pInfo_host, params->pLayout); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceImageSubresourceLayoutKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pLayout; - } *params = args; - VkDeviceImageSubresourceInfo pInfo_host; - VkSubresourceLayout2 pLayout_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pLayout); - - init_conversion_context(ctx); - convert_VkDeviceImageSubresourceInfo_win32_to_host(ctx, (const VkDeviceImageSubresourceInfo32 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkSubresourceLayout2_win32_to_host(ctx, (VkSubresourceLayout232 *)UlongToPtr(params->pLayout), &pLayout_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceImageSubresourceLayoutKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, &pLayout_host); - convert_VkSubresourceLayout2_host_to_win32(&pLayout_host, (VkSubresourceLayout232 *)UlongToPtr(params->pLayout)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceMemoryCommitment(void *args) -{ - struct vkGetDeviceMemoryCommitment_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->memory), params->pCommittedMemoryInBytes); - - vulkan_device_from_handle(params->device)->p_vkGetDeviceMemoryCommitment(vulkan_device_from_handle(params->device)->host.device, wine_device_memory_from_handle(params->memory)->host.device_memory, params->pCommittedMemoryInBytes); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceMemoryCommitment(void *args) -{ - struct - { - PTR32 device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - PTR32 pCommittedMemoryInBytes; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->memory), params->pCommittedMemoryInBytes); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceMemoryCommitment(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, wine_device_memory_from_handle(params->memory)->host.device_memory, (VkDeviceSize *)UlongToPtr(params->pCommittedMemoryInBytes)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceMemoryOpaqueCaptureAddress(void *args) -{ - struct vkGetDeviceMemoryOpaqueCaptureAddress_params *params = args; - VkDeviceMemoryOpaqueCaptureAddressInfo pInfo_host; - - TRACE("%p, %p\n", params->device, params->pInfo); - - convert_VkDeviceMemoryOpaqueCaptureAddressInfo_win64_to_host(params->pInfo, &pInfo_host); - params->result = vulkan_device_from_handle(params->device)->p_vkGetDeviceMemoryOpaqueCaptureAddress(vulkan_device_from_handle(params->device)->host.device, &pInfo_host); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceMemoryOpaqueCaptureAddress(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - uint64_t result; - } *params = args; - VkDeviceMemoryOpaqueCaptureAddressInfo pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkDeviceMemoryOpaqueCaptureAddressInfo_win32_to_host((const VkDeviceMemoryOpaqueCaptureAddressInfo32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceMemoryOpaqueCaptureAddress(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceMemoryOpaqueCaptureAddressKHR(void *args) -{ - struct vkGetDeviceMemoryOpaqueCaptureAddressKHR_params *params = args; - VkDeviceMemoryOpaqueCaptureAddressInfo pInfo_host; - - TRACE("%p, %p\n", params->device, params->pInfo); - - convert_VkDeviceMemoryOpaqueCaptureAddressInfo_win64_to_host(params->pInfo, &pInfo_host); - params->result = vulkan_device_from_handle(params->device)->p_vkGetDeviceMemoryOpaqueCaptureAddressKHR(vulkan_device_from_handle(params->device)->host.device, &pInfo_host); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceMemoryOpaqueCaptureAddressKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - uint64_t result; - } *params = args; - VkDeviceMemoryOpaqueCaptureAddressInfo pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkDeviceMemoryOpaqueCaptureAddressInfo_win32_to_host((const VkDeviceMemoryOpaqueCaptureAddressInfo32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceMemoryOpaqueCaptureAddressKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceMicromapCompatibilityEXT(void *args) -{ - struct vkGetDeviceMicromapCompatibilityEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pVersionInfo, params->pCompatibility); - - vulkan_device_from_handle(params->device)->p_vkGetDeviceMicromapCompatibilityEXT(vulkan_device_from_handle(params->device)->host.device, params->pVersionInfo, params->pCompatibility); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceMicromapCompatibilityEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pVersionInfo; - PTR32 pCompatibility; - } *params = args; - VkMicromapVersionInfoEXT pVersionInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pVersionInfo, params->pCompatibility); - - convert_VkMicromapVersionInfoEXT_win32_to_host((const VkMicromapVersionInfoEXT32 *)UlongToPtr(params->pVersionInfo), &pVersionInfo_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceMicromapCompatibilityEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pVersionInfo_host, (VkAccelerationStructureCompatibilityKHR *)UlongToPtr(params->pCompatibility)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceQueue(void *args) -{ - struct vkGetDeviceQueue_params *params = args; - - TRACE("%p, %u, %u, %p\n", params->device, params->queueFamilyIndex, params->queueIndex, params->pQueue); - - wine_vkGetDeviceQueue(params->device, params->queueFamilyIndex, params->queueIndex, params->pQueue); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceQueue(void *args) -{ - struct - { - PTR32 device; - uint32_t queueFamilyIndex; - uint32_t queueIndex; - PTR32 pQueue; - } *params = args; - VkQueue pQueue_host; - - TRACE("%#x, %u, %u, %#x\n", params->device, params->queueFamilyIndex, params->queueIndex, params->pQueue); - - pQueue_host = UlongToPtr(*(PTR32 *)UlongToPtr(params->pQueue)); - wine_vkGetDeviceQueue((VkDevice)UlongToPtr(params->device), params->queueFamilyIndex, params->queueIndex, &pQueue_host); - *(PTR32 *)UlongToPtr(params->pQueue) = PtrToUlong(pQueue_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceQueue2(void *args) -{ - struct vkGetDeviceQueue2_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pQueueInfo, params->pQueue); - - wine_vkGetDeviceQueue2(params->device, params->pQueueInfo, params->pQueue); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceQueue2(void *args) -{ - struct - { - PTR32 device; - PTR32 pQueueInfo; - PTR32 pQueue; - } *params = args; - VkDeviceQueueInfo2 pQueueInfo_host; - VkQueue pQueue_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pQueueInfo, params->pQueue); - - convert_VkDeviceQueueInfo2_win32_to_host((const VkDeviceQueueInfo232 *)UlongToPtr(params->pQueueInfo), &pQueueInfo_host); - pQueue_host = UlongToPtr(*(PTR32 *)UlongToPtr(params->pQueue)); - wine_vkGetDeviceQueue2((VkDevice)UlongToPtr(params->device), &pQueueInfo_host, &pQueue_host); - *(PTR32 *)UlongToPtr(params->pQueue) = PtrToUlong(pQueue_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(void *args) -{ - struct vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->renderpass), params->pMaxWorkgroupSize); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(vulkan_device_from_handle(params->device)->host.device, params->renderpass, params->pMaxWorkgroupSize); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(void *args) -{ - struct - { - PTR32 device; - VkRenderPass DECLSPEC_ALIGN(8) renderpass; - PTR32 pMaxWorkgroupSize; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->renderpass), params->pMaxWorkgroupSize); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->renderpass, (VkExtent2D *)UlongToPtr(params->pMaxWorkgroupSize)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetDynamicRenderingTilePropertiesQCOM(void *args) -{ - struct vkGetDynamicRenderingTilePropertiesQCOM_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pRenderingInfo, params->pProperties); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetDynamicRenderingTilePropertiesQCOM(vulkan_device_from_handle(params->device)->host.device, params->pRenderingInfo, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetDynamicRenderingTilePropertiesQCOM(void *args) -{ - struct - { - PTR32 device; - PTR32 pRenderingInfo; - PTR32 pProperties; - VkResult result; - } *params = args; - VkRenderingInfo pRenderingInfo_host; - VkTilePropertiesQCOM pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pRenderingInfo, params->pProperties); - - init_conversion_context(ctx); - convert_VkRenderingInfo_win32_to_host(ctx, (const VkRenderingInfo32 *)UlongToPtr(params->pRenderingInfo), &pRenderingInfo_host); - convert_VkTilePropertiesQCOM_win32_to_host((VkTilePropertiesQCOM32 *)UlongToPtr(params->pProperties), &pProperties_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetDynamicRenderingTilePropertiesQCOM(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pRenderingInfo_host, &pProperties_host); - convert_VkTilePropertiesQCOM_host_to_win32(&pProperties_host, (VkTilePropertiesQCOM32 *)UlongToPtr(params->pProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetEncodedVideoSessionParametersKHR(void *args) -{ - struct vkGetEncodedVideoSessionParametersKHR_params *params = args; - - TRACE("%p, %p, %p, %p, %p\n", params->device, params->pVideoSessionParametersInfo, params->pFeedbackInfo, params->pDataSize, params->pData); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetEncodedVideoSessionParametersKHR(vulkan_device_from_handle(params->device)->host.device, params->pVideoSessionParametersInfo, params->pFeedbackInfo, params->pDataSize, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetEncodedVideoSessionParametersKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pVideoSessionParametersInfo; - PTR32 pFeedbackInfo; - PTR32 pDataSize; - PTR32 pData; - VkResult result; - } *params = args; - VkVideoEncodeSessionParametersGetInfoKHR pVideoSessionParametersInfo_host; - VkVideoEncodeSessionParametersFeedbackInfoKHR *pFeedbackInfo_host = NULL; - size_t pDataSize_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x, %#x\n", params->device, params->pVideoSessionParametersInfo, params->pFeedbackInfo, params->pDataSize, params->pData); - - init_conversion_context(ctx); - convert_VkVideoEncodeSessionParametersGetInfoKHR_win32_to_host(ctx, (const VkVideoEncodeSessionParametersGetInfoKHR32 *)UlongToPtr(params->pVideoSessionParametersInfo), &pVideoSessionParametersInfo_host); - if (params->pFeedbackInfo) - { - pFeedbackInfo_host = conversion_context_alloc(ctx, sizeof(*pFeedbackInfo_host)); - convert_VkVideoEncodeSessionParametersFeedbackInfoKHR_win32_to_host(ctx, (VkVideoEncodeSessionParametersFeedbackInfoKHR32 *)UlongToPtr(params->pFeedbackInfo), pFeedbackInfo_host); - } - pDataSize_host = *(PTR32 *)UlongToPtr(params->pDataSize); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetEncodedVideoSessionParametersKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pVideoSessionParametersInfo_host, pFeedbackInfo_host, &pDataSize_host, (void *)UlongToPtr(params->pData)); - convert_VkVideoEncodeSessionParametersFeedbackInfoKHR_host_to_win32(pFeedbackInfo_host, (VkVideoEncodeSessionParametersFeedbackInfoKHR32 *)UlongToPtr(params->pFeedbackInfo)); - *(PTR32 *)UlongToPtr(params->pDataSize) = pDataSize_host; - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetEventStatus(void *args) -{ - struct vkGetEventStatus_params *params = args; - - TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->event)); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetEventStatus(vulkan_device_from_handle(params->device)->host.device, params->event); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetEventStatus(void *args) -{ - struct - { - PTR32 device; - VkEvent DECLSPEC_ALIGN(8) event; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->event)); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetEventStatus(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->event); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetFenceStatus(void *args) -{ - struct vkGetFenceStatus_params *params = args; - - TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->fence)); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetFenceStatus(vulkan_device_from_handle(params->device)->host.device, params->fence); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetFenceStatus(void *args) -{ - struct - { - PTR32 device; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->fence)); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetFenceStatus(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->fence); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetFramebufferTilePropertiesQCOM(void *args) -{ - struct vkGetFramebufferTilePropertiesQCOM_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->framebuffer), params->pPropertiesCount, params->pProperties); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetFramebufferTilePropertiesQCOM(vulkan_device_from_handle(params->device)->host.device, params->framebuffer, params->pPropertiesCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetFramebufferTilePropertiesQCOM(void *args) -{ - struct - { - PTR32 device; - VkFramebuffer DECLSPEC_ALIGN(8) framebuffer; - PTR32 pPropertiesCount; - PTR32 pProperties; - VkResult result; - } *params = args; - VkTilePropertiesQCOM *pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->framebuffer), params->pPropertiesCount, params->pProperties); - - init_conversion_context(ctx); - pProperties_host = convert_VkTilePropertiesQCOM_array_win32_to_host(ctx, (VkTilePropertiesQCOM32 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertiesCount)); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetFramebufferTilePropertiesQCOM(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->framebuffer, (uint32_t *)UlongToPtr(params->pPropertiesCount), pProperties_host); - convert_VkTilePropertiesQCOM_array_host_to_win32(pProperties_host, (VkTilePropertiesQCOM32 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertiesCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetGeneratedCommandsMemoryRequirementsEXT(void *args) -{ - struct vkGetGeneratedCommandsMemoryRequirementsEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - vulkan_device_from_handle(params->device)->p_vkGetGeneratedCommandsMemoryRequirementsEXT(vulkan_device_from_handle(params->device)->host.device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetGeneratedCommandsMemoryRequirementsEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkGeneratedCommandsMemoryRequirementsInfoEXT pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkGeneratedCommandsMemoryRequirementsInfoEXT_win32_to_host(ctx, (const VkGeneratedCommandsMemoryRequirementsInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetGeneratedCommandsMemoryRequirementsEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetGeneratedCommandsMemoryRequirementsNV(void *args) -{ - struct vkGetGeneratedCommandsMemoryRequirementsNV_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - vulkan_device_from_handle(params->device)->p_vkGetGeneratedCommandsMemoryRequirementsNV(vulkan_device_from_handle(params->device)->host.device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetGeneratedCommandsMemoryRequirementsNV(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkGeneratedCommandsMemoryRequirementsInfoNV pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkGeneratedCommandsMemoryRequirementsInfoNV_win32_to_host((const VkGeneratedCommandsMemoryRequirementsInfoNV32 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetGeneratedCommandsMemoryRequirementsNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageMemoryRequirements(void *args) -{ - struct vkGetImageMemoryRequirements_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->image), params->pMemoryRequirements); - - vulkan_device_from_handle(params->device)->p_vkGetImageMemoryRequirements(vulkan_device_from_handle(params->device)->host.device, params->image, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageMemoryRequirements(void *args) -{ - struct - { - PTR32 device; - VkImage DECLSPEC_ALIGN(8) image; - PTR32 pMemoryRequirements; - } *params = args; - VkMemoryRequirements pMemoryRequirements_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->image), params->pMemoryRequirements); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetImageMemoryRequirements(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->image, &pMemoryRequirements_host); - convert_VkMemoryRequirements_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements32 *)UlongToPtr(params->pMemoryRequirements)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageMemoryRequirements2(void *args) -{ - struct vkGetImageMemoryRequirements2_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - vulkan_device_from_handle(params->device)->p_vkGetImageMemoryRequirements2(vulkan_device_from_handle(params->device)->host.device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageMemoryRequirements2(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkImageMemoryRequirementsInfo2 pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkImageMemoryRequirementsInfo2_win32_to_host(ctx, (const VkImageMemoryRequirementsInfo232 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetImageMemoryRequirements2(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageMemoryRequirements2KHR(void *args) -{ - struct vkGetImageMemoryRequirements2KHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pMemoryRequirements); - - vulkan_device_from_handle(params->device)->p_vkGetImageMemoryRequirements2KHR(vulkan_device_from_handle(params->device)->host.device, params->pInfo, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageMemoryRequirements2KHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkImageMemoryRequirementsInfo2 pInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkImageMemoryRequirementsInfo2_win32_to_host(ctx, (const VkImageMemoryRequirementsInfo232 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetImageMemoryRequirements2KHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, &pMemoryRequirements_host); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct vkGetImageOpaqueCaptureDescriptorDataEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pData); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetImageOpaqueCaptureDescriptorDataEXT(vulkan_device_from_handle(params->device)->host.device, params->pInfo, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pData; - VkResult result; - } *params = args; - VkImageCaptureDescriptorDataInfoEXT pInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pData); - - convert_VkImageCaptureDescriptorDataInfoEXT_win32_to_host((const VkImageCaptureDescriptorDataInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetImageOpaqueCaptureDescriptorDataEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, (void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageSparseMemoryRequirements(void *args) -{ - struct vkGetImageSparseMemoryRequirements_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->image), params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - vulkan_device_from_handle(params->device)->p_vkGetImageSparseMemoryRequirements(vulkan_device_from_handle(params->device)->host.device, params->image, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageSparseMemoryRequirements(void *args) -{ - struct - { - PTR32 device; - VkImage DECLSPEC_ALIGN(8) image; - PTR32 pSparseMemoryRequirementCount; - PTR32 pSparseMemoryRequirements; - } *params = args; - VkSparseImageMemoryRequirements *pSparseMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->image), params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - init_conversion_context(ctx); - pSparseMemoryRequirements_host = (params->pSparseMemoryRequirements && *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)) ? conversion_context_alloc(ctx, sizeof(*pSparseMemoryRequirements_host) * *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)) : NULL; - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetImageSparseMemoryRequirements(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->image, (uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount), pSparseMemoryRequirements_host); - convert_VkSparseImageMemoryRequirements_array_host_to_win32(pSparseMemoryRequirements_host, (VkSparseImageMemoryRequirements32 *)UlongToPtr(params->pSparseMemoryRequirements), *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageSparseMemoryRequirements2(void *args) -{ - struct vkGetImageSparseMemoryRequirements2_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - vulkan_device_from_handle(params->device)->p_vkGetImageSparseMemoryRequirements2(vulkan_device_from_handle(params->device)->host.device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageSparseMemoryRequirements2(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pSparseMemoryRequirementCount; - PTR32 pSparseMemoryRequirements; - } *params = args; - VkImageSparseMemoryRequirementsInfo2 pInfo_host; - VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - init_conversion_context(ctx); - convert_VkImageSparseMemoryRequirementsInfo2_win32_to_host((const VkImageSparseMemoryRequirementsInfo232 *)UlongToPtr(params->pInfo), &pInfo_host); - pSparseMemoryRequirements_host = convert_VkSparseImageMemoryRequirements2_array_win32_to_host(ctx, (VkSparseImageMemoryRequirements232 *)UlongToPtr(params->pSparseMemoryRequirements), *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetImageSparseMemoryRequirements2(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, (uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount), pSparseMemoryRequirements_host); - convert_VkSparseImageMemoryRequirements2_array_host_to_win32(pSparseMemoryRequirements_host, (VkSparseImageMemoryRequirements232 *)UlongToPtr(params->pSparseMemoryRequirements), *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageSparseMemoryRequirements2KHR(void *args) -{ - struct vkGetImageSparseMemoryRequirements2KHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - vulkan_device_from_handle(params->device)->p_vkGetImageSparseMemoryRequirements2KHR(vulkan_device_from_handle(params->device)->host.device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageSparseMemoryRequirements2KHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pSparseMemoryRequirementCount; - PTR32 pSparseMemoryRequirements; - } *params = args; - VkImageSparseMemoryRequirementsInfo2 pInfo_host; - VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pInfo, params->pSparseMemoryRequirementCount, params->pSparseMemoryRequirements); - - init_conversion_context(ctx); - convert_VkImageSparseMemoryRequirementsInfo2_win32_to_host((const VkImageSparseMemoryRequirementsInfo232 *)UlongToPtr(params->pInfo), &pInfo_host); - pSparseMemoryRequirements_host = convert_VkSparseImageMemoryRequirements2_array_win32_to_host(ctx, (VkSparseImageMemoryRequirements232 *)UlongToPtr(params->pSparseMemoryRequirements), *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetImageSparseMemoryRequirements2KHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, (uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount), pSparseMemoryRequirements_host); - convert_VkSparseImageMemoryRequirements2_array_host_to_win32(pSparseMemoryRequirements_host, (VkSparseImageMemoryRequirements232 *)UlongToPtr(params->pSparseMemoryRequirements), *(uint32_t *)UlongToPtr(params->pSparseMemoryRequirementCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageSubresourceLayout(void *args) -{ - struct vkGetImageSubresourceLayout_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->image), params->pSubresource, params->pLayout); - - vulkan_device_from_handle(params->device)->p_vkGetImageSubresourceLayout(vulkan_device_from_handle(params->device)->host.device, params->image, params->pSubresource, params->pLayout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageSubresourceLayout(void *args) -{ - struct - { - PTR32 device; - VkImage DECLSPEC_ALIGN(8) image; - PTR32 pSubresource; - PTR32 pLayout; - } *params = args; - VkSubresourceLayout pLayout_host; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->image), params->pSubresource, params->pLayout); - - convert_VkSubresourceLayout_win32_to_host((VkSubresourceLayout32 *)UlongToPtr(params->pLayout), &pLayout_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetImageSubresourceLayout(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->image, (const VkImageSubresource *)UlongToPtr(params->pSubresource), &pLayout_host); - convert_VkSubresourceLayout_host_to_win32(&pLayout_host, (VkSubresourceLayout32 *)UlongToPtr(params->pLayout)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageSubresourceLayout2(void *args) -{ - struct vkGetImageSubresourceLayout2_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->image), params->pSubresource, params->pLayout); - - vulkan_device_from_handle(params->device)->p_vkGetImageSubresourceLayout2(vulkan_device_from_handle(params->device)->host.device, params->image, params->pSubresource, params->pLayout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageSubresourceLayout2(void *args) -{ - struct - { - PTR32 device; - VkImage DECLSPEC_ALIGN(8) image; - PTR32 pSubresource; - PTR32 pLayout; - } *params = args; - VkImageSubresource2 pSubresource_host; - VkSubresourceLayout2 pLayout_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->image), params->pSubresource, params->pLayout); - - init_conversion_context(ctx); - convert_VkImageSubresource2_win32_to_host((const VkImageSubresource232 *)UlongToPtr(params->pSubresource), &pSubresource_host); - convert_VkSubresourceLayout2_win32_to_host(ctx, (VkSubresourceLayout232 *)UlongToPtr(params->pLayout), &pLayout_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetImageSubresourceLayout2(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->image, &pSubresource_host, &pLayout_host); - convert_VkSubresourceLayout2_host_to_win32(&pLayout_host, (VkSubresourceLayout232 *)UlongToPtr(params->pLayout)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageSubresourceLayout2EXT(void *args) -{ - struct vkGetImageSubresourceLayout2EXT_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->image), params->pSubresource, params->pLayout); - - vulkan_device_from_handle(params->device)->p_vkGetImageSubresourceLayout2EXT(vulkan_device_from_handle(params->device)->host.device, params->image, params->pSubresource, params->pLayout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageSubresourceLayout2EXT(void *args) -{ - struct - { - PTR32 device; - VkImage DECLSPEC_ALIGN(8) image; - PTR32 pSubresource; - PTR32 pLayout; - } *params = args; - VkImageSubresource2 pSubresource_host; - VkSubresourceLayout2 pLayout_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->image), params->pSubresource, params->pLayout); - - init_conversion_context(ctx); - convert_VkImageSubresource2_win32_to_host((const VkImageSubresource232 *)UlongToPtr(params->pSubresource), &pSubresource_host); - convert_VkSubresourceLayout2_win32_to_host(ctx, (VkSubresourceLayout232 *)UlongToPtr(params->pLayout), &pLayout_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetImageSubresourceLayout2EXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->image, &pSubresource_host, &pLayout_host); - convert_VkSubresourceLayout2_host_to_win32(&pLayout_host, (VkSubresourceLayout232 *)UlongToPtr(params->pLayout)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageSubresourceLayout2KHR(void *args) -{ - struct vkGetImageSubresourceLayout2KHR_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->image), params->pSubresource, params->pLayout); - - vulkan_device_from_handle(params->device)->p_vkGetImageSubresourceLayout2KHR(vulkan_device_from_handle(params->device)->host.device, params->image, params->pSubresource, params->pLayout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageSubresourceLayout2KHR(void *args) -{ - struct - { - PTR32 device; - VkImage DECLSPEC_ALIGN(8) image; - PTR32 pSubresource; - PTR32 pLayout; - } *params = args; - VkImageSubresource2 pSubresource_host; - VkSubresourceLayout2 pLayout_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->image), params->pSubresource, params->pLayout); - - init_conversion_context(ctx); - convert_VkImageSubresource2_win32_to_host((const VkImageSubresource232 *)UlongToPtr(params->pSubresource), &pSubresource_host); - convert_VkSubresourceLayout2_win32_to_host(ctx, (VkSubresourceLayout232 *)UlongToPtr(params->pLayout), &pLayout_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetImageSubresourceLayout2KHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->image, &pSubresource_host, &pLayout_host); - convert_VkSubresourceLayout2_host_to_win32(&pLayout_host, (VkSubresourceLayout232 *)UlongToPtr(params->pLayout)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageViewAddressNVX(void *args) -{ - struct vkGetImageViewAddressNVX_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->imageView), params->pProperties); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetImageViewAddressNVX(vulkan_device_from_handle(params->device)->host.device, params->imageView, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageViewAddressNVX(void *args) -{ - struct - { - PTR32 device; - VkImageView DECLSPEC_ALIGN(8) imageView; - PTR32 pProperties; - VkResult result; - } *params = args; - VkImageViewAddressPropertiesNVX pProperties_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->imageView), params->pProperties); - - convert_VkImageViewAddressPropertiesNVX_win32_to_host((VkImageViewAddressPropertiesNVX32 *)UlongToPtr(params->pProperties), &pProperties_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetImageViewAddressNVX(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->imageView, &pProperties_host); - convert_VkImageViewAddressPropertiesNVX_host_to_win32(&pProperties_host, (VkImageViewAddressPropertiesNVX32 *)UlongToPtr(params->pProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageViewHandle64NVX(void *args) -{ - struct vkGetImageViewHandle64NVX_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetImageViewHandle64NVX(vulkan_device_from_handle(params->device)->host.device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageViewHandle64NVX(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - uint64_t result; - } *params = args; - VkImageViewHandleInfoNVX pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkImageViewHandleInfoNVX_win32_to_host((const VkImageViewHandleInfoNVX32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetImageViewHandle64NVX(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageViewHandleNVX(void *args) -{ - struct vkGetImageViewHandleNVX_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetImageViewHandleNVX(vulkan_device_from_handle(params->device)->host.device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageViewHandleNVX(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - uint32_t result; - } *params = args; - VkImageViewHandleInfoNVX pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkImageViewHandleInfoNVX_win32_to_host((const VkImageViewHandleInfoNVX32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetImageViewHandleNVX(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetImageViewOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct vkGetImageViewOpaqueCaptureDescriptorDataEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pData); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetImageViewOpaqueCaptureDescriptorDataEXT(vulkan_device_from_handle(params->device)->host.device, params->pInfo, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetImageViewOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pData; - VkResult result; - } *params = args; - VkImageViewCaptureDescriptorDataInfoEXT pInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pData); - - convert_VkImageViewCaptureDescriptorDataInfoEXT_win32_to_host((const VkImageViewCaptureDescriptorDataInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetImageViewOpaqueCaptureDescriptorDataEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, (void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetLatencyTimingsNV(void *args) -{ - struct vkGetLatencyTimingsNV_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pLatencyMarkerInfo); - - vulkan_device_from_handle(params->device)->p_vkGetLatencyTimingsNV(vulkan_device_from_handle(params->device)->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, params->pLatencyMarkerInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetLatencyTimingsNV(void *args) -{ - struct - { - PTR32 device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - PTR32 pLatencyMarkerInfo; - } *params = args; - VkGetLatencyMarkerInfoNV pLatencyMarkerInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pLatencyMarkerInfo); - - init_conversion_context(ctx); - convert_VkGetLatencyMarkerInfoNV_win32_to_host(ctx, (VkGetLatencyMarkerInfoNV32 *)UlongToPtr(params->pLatencyMarkerInfo), &pLatencyMarkerInfo_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetLatencyTimingsNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, &pLatencyMarkerInfo_host); - convert_VkGetLatencyMarkerInfoNV_host_to_win32(&pLatencyMarkerInfo_host, (VkGetLatencyMarkerInfoNV32 *)UlongToPtr(params->pLatencyMarkerInfo)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetMemoryHostPointerPropertiesEXT(void *args) -{ - struct vkGetMemoryHostPointerPropertiesEXT_params *params = args; - - TRACE("%p, %#x, %p, %p\n", params->device, params->handleType, params->pHostPointer, params->pMemoryHostPointerProperties); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetMemoryHostPointerPropertiesEXT(vulkan_device_from_handle(params->device)->host.device, params->handleType, params->pHostPointer, params->pMemoryHostPointerProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetMemoryHostPointerPropertiesEXT(void *args) -{ - struct - { - PTR32 device; - VkExternalMemoryHandleTypeFlagBits handleType; - PTR32 pHostPointer; - PTR32 pMemoryHostPointerProperties; - VkResult result; - } *params = args; - VkMemoryHostPointerPropertiesEXT pMemoryHostPointerProperties_host; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->handleType, params->pHostPointer, params->pMemoryHostPointerProperties); - - convert_VkMemoryHostPointerPropertiesEXT_win32_to_host((VkMemoryHostPointerPropertiesEXT32 *)UlongToPtr(params->pMemoryHostPointerProperties), &pMemoryHostPointerProperties_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetMemoryHostPointerPropertiesEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->handleType, (const void *)UlongToPtr(params->pHostPointer), &pMemoryHostPointerProperties_host); - convert_VkMemoryHostPointerPropertiesEXT_host_to_win32(&pMemoryHostPointerProperties_host, (VkMemoryHostPointerPropertiesEXT32 *)UlongToPtr(params->pMemoryHostPointerProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetMicromapBuildSizesEXT(void *args) -{ - struct vkGetMicromapBuildSizesEXT_params *params = args; - - TRACE("%p, %#x, %p, %p\n", params->device, params->buildType, params->pBuildInfo, params->pSizeInfo); - - vulkan_device_from_handle(params->device)->p_vkGetMicromapBuildSizesEXT(vulkan_device_from_handle(params->device)->host.device, params->buildType, params->pBuildInfo, params->pSizeInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetMicromapBuildSizesEXT(void *args) -{ - struct - { - PTR32 device; - VkAccelerationStructureBuildTypeKHR buildType; - PTR32 pBuildInfo; - PTR32 pSizeInfo; - } *params = args; - VkMicromapBuildInfoEXT pBuildInfo_host; - VkMicromapBuildSizesInfoEXT pSizeInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->buildType, params->pBuildInfo, params->pSizeInfo); - - init_conversion_context(ctx); - convert_VkMicromapBuildInfoEXT_win32_to_host(ctx, (const VkMicromapBuildInfoEXT32 *)UlongToPtr(params->pBuildInfo), &pBuildInfo_host); - convert_VkMicromapBuildSizesInfoEXT_win32_to_host((VkMicromapBuildSizesInfoEXT32 *)UlongToPtr(params->pSizeInfo), &pSizeInfo_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetMicromapBuildSizesEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->buildType, &pBuildInfo_host, &pSizeInfo_host); - convert_VkMicromapBuildSizesInfoEXT_host_to_win32(&pSizeInfo_host, (VkMicromapBuildSizesInfoEXT32 *)UlongToPtr(params->pSizeInfo)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPerformanceParameterINTEL(void *args) -{ - struct vkGetPerformanceParameterINTEL_params *params = args; - - TRACE("%p, %#x, %p\n", params->device, params->parameter, params->pValue); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetPerformanceParameterINTEL(vulkan_device_from_handle(params->device)->host.device, params->parameter, params->pValue); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPerformanceParameterINTEL(void *args) -{ - struct - { - PTR32 device; - VkPerformanceParameterTypeINTEL parameter; - PTR32 pValue; - VkResult result; - } *params = args; - VkPerformanceValueINTEL pValue_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->parameter, params->pValue); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetPerformanceParameterINTEL(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->parameter, &pValue_host); - convert_VkPerformanceValueINTEL_host_to_win32(&pValue_host, (VkPerformanceValueINTEL32 *)UlongToPtr(params->pValue)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(void *args) -{ - struct vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pTimeDomainCount, params->pTimeDomains); - - params->result = wine_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(params->physicalDevice, params->pTimeDomainCount, params->pTimeDomains); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pTimeDomainCount; - PTR32 pTimeDomains; - VkResult result; - } *params = args; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pTimeDomainCount, params->pTimeDomains); - - params->result = wine_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT((VkPhysicalDevice)UlongToPtr(params->physicalDevice), (uint32_t *)UlongToPtr(params->pTimeDomainCount), (VkTimeDomainKHR *)UlongToPtr(params->pTimeDomains)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR(void *args) -{ - struct vkGetPhysicalDeviceCalibrateableTimeDomainsKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pTimeDomainCount, params->pTimeDomains); - - params->result = wine_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR(params->physicalDevice, params->pTimeDomainCount, params->pTimeDomains); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pTimeDomainCount; - PTR32 pTimeDomains; - VkResult result; - } *params = args; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pTimeDomainCount, params->pTimeDomains); - - params->result = wine_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), (uint32_t *)UlongToPtr(params->pTimeDomainCount), (VkTimeDomainKHR *)UlongToPtr(params->pTimeDomains)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV(void *args) -{ - struct vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pPropertyCount, params->pProperties); - - params->result = vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pPropertyCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pPropertyCount; - PTR32 pProperties; - VkResult result; - } *params = args; - VkCooperativeMatrixFlexibleDimensionsPropertiesNV *pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pPropertyCount, params->pProperties); - - init_conversion_context(ctx); - pProperties_host = convert_VkCooperativeMatrixFlexibleDimensionsPropertiesNV_array_win32_to_host(ctx, (VkCooperativeMatrixFlexibleDimensionsPropertiesNV32 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertyCount)); - params->result = vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, (uint32_t *)UlongToPtr(params->pPropertyCount), pProperties_host); - convert_VkCooperativeMatrixFlexibleDimensionsPropertiesNV_array_host_to_win32(pProperties_host, (VkCooperativeMatrixFlexibleDimensionsPropertiesNV32 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertyCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR(void *args) -{ - struct vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pPropertyCount, params->pProperties); - - params->result = vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pPropertyCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pPropertyCount; - PTR32 pProperties; - VkResult result; - } *params = args; - VkCooperativeMatrixPropertiesKHR *pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pPropertyCount, params->pProperties); - - init_conversion_context(ctx); - pProperties_host = convert_VkCooperativeMatrixPropertiesKHR_array_win32_to_host(ctx, (VkCooperativeMatrixPropertiesKHR32 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertyCount)); - params->result = vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, (uint32_t *)UlongToPtr(params->pPropertyCount), pProperties_host); - convert_VkCooperativeMatrixPropertiesKHR_array_host_to_win32(pProperties_host, (VkCooperativeMatrixPropertiesKHR32 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertyCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV(void *args) -{ - struct vkGetPhysicalDeviceCooperativeMatrixPropertiesNV_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pPropertyCount, params->pProperties); - - params->result = vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pPropertyCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pPropertyCount; - PTR32 pProperties; - VkResult result; - } *params = args; - VkCooperativeMatrixPropertiesNV *pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pPropertyCount, params->pProperties); - - init_conversion_context(ctx); - pProperties_host = convert_VkCooperativeMatrixPropertiesNV_array_win32_to_host(ctx, (VkCooperativeMatrixPropertiesNV32 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertyCount)); - params->result = vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, (uint32_t *)UlongToPtr(params->pPropertyCount), pProperties_host); - convert_VkCooperativeMatrixPropertiesNV_array_host_to_win32(pProperties_host, (VkCooperativeMatrixPropertiesNV32 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertyCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceExternalBufferProperties(void *args) -{ - struct vkGetPhysicalDeviceExternalBufferProperties_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalBufferInfo, params->pExternalBufferProperties); - - wine_vkGetPhysicalDeviceExternalBufferProperties(params->physicalDevice, params->pExternalBufferInfo, params->pExternalBufferProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceExternalBufferProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pExternalBufferInfo; - PTR32 pExternalBufferProperties; - } *params = args; - VkPhysicalDeviceExternalBufferInfo pExternalBufferInfo_host; - VkExternalBufferProperties pExternalBufferProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pExternalBufferInfo, params->pExternalBufferProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceExternalBufferInfo_win32_to_host(ctx, (const VkPhysicalDeviceExternalBufferInfo32 *)UlongToPtr(params->pExternalBufferInfo), &pExternalBufferInfo_host); - convert_VkExternalBufferProperties_win32_to_host((VkExternalBufferProperties32 *)UlongToPtr(params->pExternalBufferProperties), &pExternalBufferProperties_host); - wine_vkGetPhysicalDeviceExternalBufferProperties((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pExternalBufferInfo_host, &pExternalBufferProperties_host); - convert_VkExternalBufferProperties_host_to_win32(&pExternalBufferProperties_host, (VkExternalBufferProperties32 *)UlongToPtr(params->pExternalBufferProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceExternalBufferPropertiesKHR(void *args) -{ - struct vkGetPhysicalDeviceExternalBufferPropertiesKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalBufferInfo, params->pExternalBufferProperties); - - wine_vkGetPhysicalDeviceExternalBufferPropertiesKHR(params->physicalDevice, params->pExternalBufferInfo, params->pExternalBufferProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceExternalBufferPropertiesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pExternalBufferInfo; - PTR32 pExternalBufferProperties; - } *params = args; - VkPhysicalDeviceExternalBufferInfo pExternalBufferInfo_host; - VkExternalBufferProperties pExternalBufferProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pExternalBufferInfo, params->pExternalBufferProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceExternalBufferInfo_win32_to_host(ctx, (const VkPhysicalDeviceExternalBufferInfo32 *)UlongToPtr(params->pExternalBufferInfo), &pExternalBufferInfo_host); - convert_VkExternalBufferProperties_win32_to_host((VkExternalBufferProperties32 *)UlongToPtr(params->pExternalBufferProperties), &pExternalBufferProperties_host); - wine_vkGetPhysicalDeviceExternalBufferPropertiesKHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pExternalBufferInfo_host, &pExternalBufferProperties_host); - convert_VkExternalBufferProperties_host_to_win32(&pExternalBufferProperties_host, (VkExternalBufferProperties32 *)UlongToPtr(params->pExternalBufferProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceExternalFenceProperties(void *args) -{ - struct vkGetPhysicalDeviceExternalFenceProperties_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalFenceInfo, params->pExternalFenceProperties); - - wine_vkGetPhysicalDeviceExternalFenceProperties(params->physicalDevice, params->pExternalFenceInfo, params->pExternalFenceProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceExternalFenceProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pExternalFenceInfo; - PTR32 pExternalFenceProperties; - } *params = args; - VkPhysicalDeviceExternalFenceInfo pExternalFenceInfo_host; - VkExternalFenceProperties pExternalFenceProperties_host; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pExternalFenceInfo, params->pExternalFenceProperties); - - convert_VkPhysicalDeviceExternalFenceInfo_win32_to_host((const VkPhysicalDeviceExternalFenceInfo32 *)UlongToPtr(params->pExternalFenceInfo), &pExternalFenceInfo_host); - convert_VkExternalFenceProperties_win32_to_host((VkExternalFenceProperties32 *)UlongToPtr(params->pExternalFenceProperties), &pExternalFenceProperties_host); - wine_vkGetPhysicalDeviceExternalFenceProperties((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pExternalFenceInfo_host, &pExternalFenceProperties_host); - convert_VkExternalFenceProperties_host_to_win32(&pExternalFenceProperties_host, (VkExternalFenceProperties32 *)UlongToPtr(params->pExternalFenceProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceExternalFencePropertiesKHR(void *args) -{ - struct vkGetPhysicalDeviceExternalFencePropertiesKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalFenceInfo, params->pExternalFenceProperties); - - wine_vkGetPhysicalDeviceExternalFencePropertiesKHR(params->physicalDevice, params->pExternalFenceInfo, params->pExternalFenceProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceExternalFencePropertiesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pExternalFenceInfo; - PTR32 pExternalFenceProperties; - } *params = args; - VkPhysicalDeviceExternalFenceInfo pExternalFenceInfo_host; - VkExternalFenceProperties pExternalFenceProperties_host; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pExternalFenceInfo, params->pExternalFenceProperties); - - convert_VkPhysicalDeviceExternalFenceInfo_win32_to_host((const VkPhysicalDeviceExternalFenceInfo32 *)UlongToPtr(params->pExternalFenceInfo), &pExternalFenceInfo_host); - convert_VkExternalFenceProperties_win32_to_host((VkExternalFenceProperties32 *)UlongToPtr(params->pExternalFenceProperties), &pExternalFenceProperties_host); - wine_vkGetPhysicalDeviceExternalFencePropertiesKHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pExternalFenceInfo_host, &pExternalFenceProperties_host); - convert_VkExternalFenceProperties_host_to_win32(&pExternalFenceProperties_host, (VkExternalFenceProperties32 *)UlongToPtr(params->pExternalFenceProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceExternalSemaphoreProperties(void *args) -{ - struct vkGetPhysicalDeviceExternalSemaphoreProperties_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties); - - wine_vkGetPhysicalDeviceExternalSemaphoreProperties(params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceExternalSemaphoreProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pExternalSemaphoreInfo; - PTR32 pExternalSemaphoreProperties; - } *params = args; - VkPhysicalDeviceExternalSemaphoreInfo pExternalSemaphoreInfo_host; - VkExternalSemaphoreProperties pExternalSemaphoreProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceExternalSemaphoreInfo_win32_to_host(ctx, (const VkPhysicalDeviceExternalSemaphoreInfo32 *)UlongToPtr(params->pExternalSemaphoreInfo), &pExternalSemaphoreInfo_host); - convert_VkExternalSemaphoreProperties_win32_to_host((VkExternalSemaphoreProperties32 *)UlongToPtr(params->pExternalSemaphoreProperties), &pExternalSemaphoreProperties_host); - wine_vkGetPhysicalDeviceExternalSemaphoreProperties((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pExternalSemaphoreInfo_host, &pExternalSemaphoreProperties_host); - convert_VkExternalSemaphoreProperties_host_to_win32(&pExternalSemaphoreProperties_host, (VkExternalSemaphoreProperties32 *)UlongToPtr(params->pExternalSemaphoreProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(void *args) -{ - struct vkGetPhysicalDeviceExternalSemaphorePropertiesKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties); - - wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pExternalSemaphoreInfo; - PTR32 pExternalSemaphoreProperties; - } *params = args; - VkPhysicalDeviceExternalSemaphoreInfo pExternalSemaphoreInfo_host; - VkExternalSemaphoreProperties pExternalSemaphoreProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceExternalSemaphoreInfo_win32_to_host(ctx, (const VkPhysicalDeviceExternalSemaphoreInfo32 *)UlongToPtr(params->pExternalSemaphoreInfo), &pExternalSemaphoreInfo_host); - convert_VkExternalSemaphoreProperties_win32_to_host((VkExternalSemaphoreProperties32 *)UlongToPtr(params->pExternalSemaphoreProperties), &pExternalSemaphoreProperties_host); - wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pExternalSemaphoreInfo_host, &pExternalSemaphoreProperties_host); - convert_VkExternalSemaphoreProperties_host_to_win32(&pExternalSemaphoreProperties_host, (VkExternalSemaphoreProperties32 *)UlongToPtr(params->pExternalSemaphoreProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceFeatures(void *args) -{ - struct vkGetPhysicalDeviceFeatures_params *params = args; - - TRACE("%p, %p\n", params->physicalDevice, params->pFeatures); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceFeatures(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pFeatures); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceFeatures(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pFeatures; - } *params = args; - - TRACE("%#x, %#x\n", params->physicalDevice, params->pFeatures); - - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceFeatures(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, (VkPhysicalDeviceFeatures *)UlongToPtr(params->pFeatures)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceFeatures2(void *args) -{ - struct vkGetPhysicalDeviceFeatures2_params *params = args; - - TRACE("%p, %p\n", params->physicalDevice, params->pFeatures); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceFeatures2(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pFeatures); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceFeatures2(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pFeatures; - } *params = args; - VkPhysicalDeviceFeatures2 pFeatures_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->physicalDevice, params->pFeatures); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceFeatures2_win32_to_host(ctx, (VkPhysicalDeviceFeatures232 *)UlongToPtr(params->pFeatures), &pFeatures_host); - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceFeatures2(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, &pFeatures_host); - convert_VkPhysicalDeviceFeatures2_host_to_win32(&pFeatures_host, (VkPhysicalDeviceFeatures232 *)UlongToPtr(params->pFeatures)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceFeatures2KHR(void *args) -{ - struct vkGetPhysicalDeviceFeatures2KHR_params *params = args; - - TRACE("%p, %p\n", params->physicalDevice, params->pFeatures); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceFeatures2KHR(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pFeatures); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceFeatures2KHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pFeatures; - } *params = args; - VkPhysicalDeviceFeatures2 pFeatures_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->physicalDevice, params->pFeatures); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceFeatures2_win32_to_host(ctx, (VkPhysicalDeviceFeatures232 *)UlongToPtr(params->pFeatures), &pFeatures_host); - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceFeatures2KHR(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, &pFeatures_host); - convert_VkPhysicalDeviceFeatures2_host_to_win32(&pFeatures_host, (VkPhysicalDeviceFeatures232 *)UlongToPtr(params->pFeatures)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceFormatProperties(void *args) -{ - struct vkGetPhysicalDeviceFormatProperties_params *params = args; - - TRACE("%p, %#x, %p\n", params->physicalDevice, params->format, params->pFormatProperties); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceFormatProperties(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->format, params->pFormatProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceFormatProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - VkFormat format; - PTR32 pFormatProperties; - } *params = args; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->format, params->pFormatProperties); - - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceFormatProperties(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, params->format, (VkFormatProperties *)UlongToPtr(params->pFormatProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceFormatProperties2(void *args) -{ - struct vkGetPhysicalDeviceFormatProperties2_params *params = args; - - TRACE("%p, %#x, %p\n", params->physicalDevice, params->format, params->pFormatProperties); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceFormatProperties2(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->format, params->pFormatProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceFormatProperties2(void *args) -{ - struct - { - PTR32 physicalDevice; - VkFormat format; - PTR32 pFormatProperties; - } *params = args; - VkFormatProperties2 pFormatProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->format, params->pFormatProperties); - - init_conversion_context(ctx); - convert_VkFormatProperties2_win32_to_host(ctx, (VkFormatProperties232 *)UlongToPtr(params->pFormatProperties), &pFormatProperties_host); - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceFormatProperties2(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, params->format, &pFormatProperties_host); - convert_VkFormatProperties2_host_to_win32(&pFormatProperties_host, (VkFormatProperties232 *)UlongToPtr(params->pFormatProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceFormatProperties2KHR(void *args) -{ - struct vkGetPhysicalDeviceFormatProperties2KHR_params *params = args; - - TRACE("%p, %#x, %p\n", params->physicalDevice, params->format, params->pFormatProperties); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceFormatProperties2KHR(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->format, params->pFormatProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceFormatProperties2KHR(void *args) -{ - struct - { - PTR32 physicalDevice; - VkFormat format; - PTR32 pFormatProperties; - } *params = args; - VkFormatProperties2 pFormatProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->format, params->pFormatProperties); - - init_conversion_context(ctx); - convert_VkFormatProperties2_win32_to_host(ctx, (VkFormatProperties232 *)UlongToPtr(params->pFormatProperties), &pFormatProperties_host); - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceFormatProperties2KHR(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, params->format, &pFormatProperties_host); - convert_VkFormatProperties2_host_to_win32(&pFormatProperties_host, (VkFormatProperties232 *)UlongToPtr(params->pFormatProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceFragmentShadingRatesKHR(void *args) -{ - struct vkGetPhysicalDeviceFragmentShadingRatesKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pFragmentShadingRateCount, params->pFragmentShadingRates); - - params->result = vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceFragmentShadingRatesKHR(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pFragmentShadingRateCount, params->pFragmentShadingRates); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceFragmentShadingRatesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pFragmentShadingRateCount; - PTR32 pFragmentShadingRates; - VkResult result; - } *params = args; - VkPhysicalDeviceFragmentShadingRateKHR *pFragmentShadingRates_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pFragmentShadingRateCount, params->pFragmentShadingRates); - - init_conversion_context(ctx); - pFragmentShadingRates_host = convert_VkPhysicalDeviceFragmentShadingRateKHR_array_win32_to_host(ctx, (VkPhysicalDeviceFragmentShadingRateKHR32 *)UlongToPtr(params->pFragmentShadingRates), *(uint32_t *)UlongToPtr(params->pFragmentShadingRateCount)); - params->result = vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceFragmentShadingRatesKHR(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, (uint32_t *)UlongToPtr(params->pFragmentShadingRateCount), pFragmentShadingRates_host); - convert_VkPhysicalDeviceFragmentShadingRateKHR_array_host_to_win32(pFragmentShadingRates_host, (VkPhysicalDeviceFragmentShadingRateKHR32 *)UlongToPtr(params->pFragmentShadingRates), *(uint32_t *)UlongToPtr(params->pFragmentShadingRateCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceImageFormatProperties(void *args) -{ - struct vkGetPhysicalDeviceImageFormatProperties_params *params = args; - - TRACE("%p, %#x, %#x, %#x, %#x, %#x, %p\n", params->physicalDevice, params->format, params->type, params->tiling, params->usage, params->flags, params->pImageFormatProperties); - - params->result = vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceImageFormatProperties(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->format, params->type, params->tiling, params->usage, params->flags, params->pImageFormatProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceImageFormatProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - VkFormat format; - VkImageType type; - VkImageTiling tiling; - VkImageUsageFlags usage; - VkImageCreateFlags flags; - PTR32 pImageFormatProperties; - VkResult result; - } *params = args; - VkImageFormatProperties pImageFormatProperties_host; - - TRACE("%#x, %#x, %#x, %#x, %#x, %#x, %#x\n", params->physicalDevice, params->format, params->type, params->tiling, params->usage, params->flags, params->pImageFormatProperties); - - params->result = vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceImageFormatProperties(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, params->format, params->type, params->tiling, params->usage, params->flags, &pImageFormatProperties_host); - convert_VkImageFormatProperties_host_to_win32(&pImageFormatProperties_host, (VkImageFormatProperties32 *)UlongToPtr(params->pImageFormatProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceImageFormatProperties2(void *args) -{ - struct vkGetPhysicalDeviceImageFormatProperties2_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pImageFormatInfo, params->pImageFormatProperties); - - params->result = wine_vkGetPhysicalDeviceImageFormatProperties2(params->physicalDevice, params->pImageFormatInfo, params->pImageFormatProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceImageFormatProperties2(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pImageFormatInfo; - PTR32 pImageFormatProperties; - VkResult result; - } *params = args; - VkPhysicalDeviceImageFormatInfo2 pImageFormatInfo_host; - VkImageFormatProperties2 pImageFormatProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pImageFormatInfo, params->pImageFormatProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceImageFormatInfo2_win32_to_host(ctx, (const VkPhysicalDeviceImageFormatInfo232 *)UlongToPtr(params->pImageFormatInfo), &pImageFormatInfo_host); - convert_VkImageFormatProperties2_win32_to_host(ctx, (VkImageFormatProperties232 *)UlongToPtr(params->pImageFormatProperties), &pImageFormatProperties_host); - params->result = wine_vkGetPhysicalDeviceImageFormatProperties2((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pImageFormatInfo_host, &pImageFormatProperties_host); - convert_VkImageFormatProperties2_host_to_win32(&pImageFormatProperties_host, (VkImageFormatProperties232 *)UlongToPtr(params->pImageFormatProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceImageFormatProperties2KHR(void *args) -{ - struct vkGetPhysicalDeviceImageFormatProperties2KHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pImageFormatInfo, params->pImageFormatProperties); - - params->result = wine_vkGetPhysicalDeviceImageFormatProperties2KHR(params->physicalDevice, params->pImageFormatInfo, params->pImageFormatProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceImageFormatProperties2KHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pImageFormatInfo; - PTR32 pImageFormatProperties; - VkResult result; - } *params = args; - VkPhysicalDeviceImageFormatInfo2 pImageFormatInfo_host; - VkImageFormatProperties2 pImageFormatProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pImageFormatInfo, params->pImageFormatProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceImageFormatInfo2_win32_to_host(ctx, (const VkPhysicalDeviceImageFormatInfo232 *)UlongToPtr(params->pImageFormatInfo), &pImageFormatInfo_host); - convert_VkImageFormatProperties2_win32_to_host(ctx, (VkImageFormatProperties232 *)UlongToPtr(params->pImageFormatProperties), &pImageFormatProperties_host); - params->result = wine_vkGetPhysicalDeviceImageFormatProperties2KHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pImageFormatInfo_host, &pImageFormatProperties_host); - convert_VkImageFormatProperties2_host_to_win32(&pImageFormatProperties_host, (VkImageFormatProperties232 *)UlongToPtr(params->pImageFormatProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceMemoryProperties(void *args) -{ - struct vkGetPhysicalDeviceMemoryProperties_params *params = args; - - TRACE("%p, %p\n", params->physicalDevice, params->pMemoryProperties); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceMemoryProperties(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pMemoryProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceMemoryProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pMemoryProperties; - } *params = args; - VkPhysicalDeviceMemoryProperties pMemoryProperties_host; - - TRACE("%#x, %#x\n", params->physicalDevice, params->pMemoryProperties); - - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceMemoryProperties(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, &pMemoryProperties_host); - convert_VkPhysicalDeviceMemoryProperties_host_to_win32(&pMemoryProperties_host, (VkPhysicalDeviceMemoryProperties32 *)UlongToPtr(params->pMemoryProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceMemoryProperties2(void *args) -{ - struct vkGetPhysicalDeviceMemoryProperties2_params *params = args; - - TRACE("%p, %p\n", params->physicalDevice, params->pMemoryProperties); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceMemoryProperties2(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pMemoryProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceMemoryProperties2(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pMemoryProperties; - } *params = args; - VkPhysicalDeviceMemoryProperties2 pMemoryProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->physicalDevice, params->pMemoryProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceMemoryProperties2_win32_to_host(ctx, (VkPhysicalDeviceMemoryProperties232 *)UlongToPtr(params->pMemoryProperties), &pMemoryProperties_host); - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceMemoryProperties2(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, &pMemoryProperties_host); - convert_VkPhysicalDeviceMemoryProperties2_host_to_win32(&pMemoryProperties_host, (VkPhysicalDeviceMemoryProperties232 *)UlongToPtr(params->pMemoryProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceMemoryProperties2KHR(void *args) -{ - struct vkGetPhysicalDeviceMemoryProperties2KHR_params *params = args; - - TRACE("%p, %p\n", params->physicalDevice, params->pMemoryProperties); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceMemoryProperties2KHR(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pMemoryProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceMemoryProperties2KHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pMemoryProperties; - } *params = args; - VkPhysicalDeviceMemoryProperties2 pMemoryProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->physicalDevice, params->pMemoryProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceMemoryProperties2_win32_to_host(ctx, (VkPhysicalDeviceMemoryProperties232 *)UlongToPtr(params->pMemoryProperties), &pMemoryProperties_host); - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceMemoryProperties2KHR(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, &pMemoryProperties_host); - convert_VkPhysicalDeviceMemoryProperties2_host_to_win32(&pMemoryProperties_host, (VkPhysicalDeviceMemoryProperties232 *)UlongToPtr(params->pMemoryProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceMultisamplePropertiesEXT(void *args) -{ - struct vkGetPhysicalDeviceMultisamplePropertiesEXT_params *params = args; - - TRACE("%p, %#x, %p\n", params->physicalDevice, params->samples, params->pMultisampleProperties); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceMultisamplePropertiesEXT(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->samples, params->pMultisampleProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceMultisamplePropertiesEXT(void *args) -{ - struct - { - PTR32 physicalDevice; - VkSampleCountFlagBits samples; - PTR32 pMultisampleProperties; - } *params = args; - VkMultisamplePropertiesEXT pMultisampleProperties_host; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->samples, params->pMultisampleProperties); - - convert_VkMultisamplePropertiesEXT_win32_to_host((VkMultisamplePropertiesEXT32 *)UlongToPtr(params->pMultisampleProperties), &pMultisampleProperties_host); - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceMultisamplePropertiesEXT(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, params->samples, &pMultisampleProperties_host); - convert_VkMultisamplePropertiesEXT_host_to_win32(&pMultisampleProperties_host, (VkMultisamplePropertiesEXT32 *)UlongToPtr(params->pMultisampleProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceOpticalFlowImageFormatsNV(void *args) -{ - struct vkGetPhysicalDeviceOpticalFlowImageFormatsNV_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->physicalDevice, params->pOpticalFlowImageFormatInfo, params->pFormatCount, params->pImageFormatProperties); - - params->result = vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceOpticalFlowImageFormatsNV(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pOpticalFlowImageFormatInfo, params->pFormatCount, params->pImageFormatProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceOpticalFlowImageFormatsNV(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pOpticalFlowImageFormatInfo; - PTR32 pFormatCount; - PTR32 pImageFormatProperties; - VkResult result; - } *params = args; - VkOpticalFlowImageFormatInfoNV pOpticalFlowImageFormatInfo_host; - VkOpticalFlowImageFormatPropertiesNV *pImageFormatProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->physicalDevice, params->pOpticalFlowImageFormatInfo, params->pFormatCount, params->pImageFormatProperties); - - init_conversion_context(ctx); - convert_VkOpticalFlowImageFormatInfoNV_win32_to_host((const VkOpticalFlowImageFormatInfoNV32 *)UlongToPtr(params->pOpticalFlowImageFormatInfo), &pOpticalFlowImageFormatInfo_host); - pImageFormatProperties_host = convert_VkOpticalFlowImageFormatPropertiesNV_array_win32_to_host(ctx, (VkOpticalFlowImageFormatPropertiesNV32 *)UlongToPtr(params->pImageFormatProperties), *(uint32_t *)UlongToPtr(params->pFormatCount)); - params->result = vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceOpticalFlowImageFormatsNV(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, &pOpticalFlowImageFormatInfo_host, (uint32_t *)UlongToPtr(params->pFormatCount), pImageFormatProperties_host); - convert_VkOpticalFlowImageFormatPropertiesNV_array_host_to_win32(pImageFormatProperties_host, (VkOpticalFlowImageFormatPropertiesNV32 *)UlongToPtr(params->pImageFormatProperties), *(uint32_t *)UlongToPtr(params->pFormatCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDevicePresentRectanglesKHR(void *args) -{ - struct vkGetPhysicalDevicePresentRectanglesKHR_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->physicalDevice, wine_dbgstr_longlong(params->surface), params->pRectCount, params->pRects); - - params->result = vk_funcs->p_vkGetPhysicalDevicePresentRectanglesKHR(params->physicalDevice, params->surface, params->pRectCount, params->pRects); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDevicePresentRectanglesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - PTR32 pRectCount; - PTR32 pRects; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->physicalDevice, wine_dbgstr_longlong(params->surface), params->pRectCount, params->pRects); - - params->result = vk_funcs->p_vkGetPhysicalDevicePresentRectanglesKHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), params->surface, (uint32_t *)UlongToPtr(params->pRectCount), (VkRect2D *)UlongToPtr(params->pRects)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceProperties(void *args) -{ - struct vkGetPhysicalDeviceProperties_params *params = args; - - TRACE("%p, %p\n", params->physicalDevice, params->pProperties); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceProperties(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pProperties; - } *params = args; - VkPhysicalDeviceProperties pProperties_host; - - TRACE("%#x, %#x\n", params->physicalDevice, params->pProperties); - - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceProperties(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, &pProperties_host); - convert_VkPhysicalDeviceProperties_host_to_win32(&pProperties_host, (VkPhysicalDeviceProperties32 *)UlongToPtr(params->pProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceProperties2(void *args) -{ - struct vkGetPhysicalDeviceProperties2_params *params = args; - - TRACE("%p, %p\n", params->physicalDevice, params->pProperties); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceProperties2(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceProperties2(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pProperties; - } *params = args; - VkPhysicalDeviceProperties2 pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->physicalDevice, params->pProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceProperties2_win32_to_host(ctx, (VkPhysicalDeviceProperties232 *)UlongToPtr(params->pProperties), &pProperties_host); - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceProperties2(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, &pProperties_host); - convert_VkPhysicalDeviceProperties2_host_to_win32(&pProperties_host, (VkPhysicalDeviceProperties232 *)UlongToPtr(params->pProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceProperties2KHR(void *args) -{ - struct vkGetPhysicalDeviceProperties2KHR_params *params = args; - - TRACE("%p, %p\n", params->physicalDevice, params->pProperties); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceProperties2KHR(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceProperties2KHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pProperties; - } *params = args; - VkPhysicalDeviceProperties2 pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->physicalDevice, params->pProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceProperties2_win32_to_host(ctx, (VkPhysicalDeviceProperties232 *)UlongToPtr(params->pProperties), &pProperties_host); - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceProperties2KHR(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, &pProperties_host); - convert_VkPhysicalDeviceProperties2_host_to_win32(&pProperties_host, (VkPhysicalDeviceProperties232 *)UlongToPtr(params->pProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(void *args) -{ - struct vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pPerformanceQueryCreateInfo, params->pNumPasses); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pPerformanceQueryCreateInfo, params->pNumPasses); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pPerformanceQueryCreateInfo; - PTR32 pNumPasses; - } *params = args; - VkQueryPoolPerformanceCreateInfoKHR pPerformanceQueryCreateInfo_host; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pPerformanceQueryCreateInfo, params->pNumPasses); - - convert_VkQueryPoolPerformanceCreateInfoKHR_win32_to_host((const VkQueryPoolPerformanceCreateInfoKHR32 *)UlongToPtr(params->pPerformanceQueryCreateInfo), &pPerformanceQueryCreateInfo_host); - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, &pPerformanceQueryCreateInfo_host, (uint32_t *)UlongToPtr(params->pNumPasses)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceQueueFamilyProperties(void *args) -{ - struct vkGetPhysicalDeviceQueueFamilyProperties_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pQueueFamilyPropertyCount, params->pQueueFamilyProperties); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceQueueFamilyProperties(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pQueueFamilyPropertyCount, params->pQueueFamilyProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceQueueFamilyProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pQueueFamilyPropertyCount; - PTR32 pQueueFamilyProperties; - } *params = args; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pQueueFamilyPropertyCount, params->pQueueFamilyProperties); - - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceQueueFamilyProperties(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, (uint32_t *)UlongToPtr(params->pQueueFamilyPropertyCount), (VkQueueFamilyProperties *)UlongToPtr(params->pQueueFamilyProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceQueueFamilyProperties2(void *args) -{ - struct vkGetPhysicalDeviceQueueFamilyProperties2_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pQueueFamilyPropertyCount, params->pQueueFamilyProperties); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceQueueFamilyProperties2(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pQueueFamilyPropertyCount, params->pQueueFamilyProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceQueueFamilyProperties2(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pQueueFamilyPropertyCount; - PTR32 pQueueFamilyProperties; - } *params = args; - VkQueueFamilyProperties2 *pQueueFamilyProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pQueueFamilyPropertyCount, params->pQueueFamilyProperties); - - init_conversion_context(ctx); - pQueueFamilyProperties_host = convert_VkQueueFamilyProperties2_array_win32_to_host(ctx, (VkQueueFamilyProperties232 *)UlongToPtr(params->pQueueFamilyProperties), *(uint32_t *)UlongToPtr(params->pQueueFamilyPropertyCount)); - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceQueueFamilyProperties2(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, (uint32_t *)UlongToPtr(params->pQueueFamilyPropertyCount), pQueueFamilyProperties_host); - convert_VkQueueFamilyProperties2_array_host_to_win32(pQueueFamilyProperties_host, (VkQueueFamilyProperties232 *)UlongToPtr(params->pQueueFamilyProperties), *(uint32_t *)UlongToPtr(params->pQueueFamilyPropertyCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceQueueFamilyProperties2KHR(void *args) -{ - struct vkGetPhysicalDeviceQueueFamilyProperties2KHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pQueueFamilyPropertyCount, params->pQueueFamilyProperties); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceQueueFamilyProperties2KHR(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pQueueFamilyPropertyCount, params->pQueueFamilyProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceQueueFamilyProperties2KHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pQueueFamilyPropertyCount; - PTR32 pQueueFamilyProperties; - } *params = args; - VkQueueFamilyProperties2 *pQueueFamilyProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pQueueFamilyPropertyCount, params->pQueueFamilyProperties); - - init_conversion_context(ctx); - pQueueFamilyProperties_host = convert_VkQueueFamilyProperties2_array_win32_to_host(ctx, (VkQueueFamilyProperties232 *)UlongToPtr(params->pQueueFamilyProperties), *(uint32_t *)UlongToPtr(params->pQueueFamilyPropertyCount)); - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceQueueFamilyProperties2KHR(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, (uint32_t *)UlongToPtr(params->pQueueFamilyPropertyCount), pQueueFamilyProperties_host); - convert_VkQueueFamilyProperties2_array_host_to_win32(pQueueFamilyProperties_host, (VkQueueFamilyProperties232 *)UlongToPtr(params->pQueueFamilyProperties), *(uint32_t *)UlongToPtr(params->pQueueFamilyPropertyCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSparseImageFormatProperties(void *args) -{ - struct vkGetPhysicalDeviceSparseImageFormatProperties_params *params = args; - - TRACE("%p, %#x, %#x, %#x, %#x, %#x, %p, %p\n", params->physicalDevice, params->format, params->type, params->samples, params->usage, params->tiling, params->pPropertyCount, params->pProperties); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceSparseImageFormatProperties(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->format, params->type, params->samples, params->usage, params->tiling, params->pPropertyCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSparseImageFormatProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - VkFormat format; - VkImageType type; - VkSampleCountFlagBits samples; - VkImageUsageFlags usage; - VkImageTiling tiling; - PTR32 pPropertyCount; - PTR32 pProperties; - } *params = args; - - TRACE("%#x, %#x, %#x, %#x, %#x, %#x, %#x, %#x\n", params->physicalDevice, params->format, params->type, params->samples, params->usage, params->tiling, params->pPropertyCount, params->pProperties); - - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceSparseImageFormatProperties(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, params->format, params->type, params->samples, params->usage, params->tiling, (uint32_t *)UlongToPtr(params->pPropertyCount), (VkSparseImageFormatProperties *)UlongToPtr(params->pProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSparseImageFormatProperties2(void *args) -{ - struct vkGetPhysicalDeviceSparseImageFormatProperties2_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->physicalDevice, params->pFormatInfo, params->pPropertyCount, params->pProperties); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceSparseImageFormatProperties2(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pFormatInfo, params->pPropertyCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSparseImageFormatProperties2(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pFormatInfo; - PTR32 pPropertyCount; - PTR32 pProperties; - } *params = args; - VkPhysicalDeviceSparseImageFormatInfo2 pFormatInfo_host; - VkSparseImageFormatProperties2 *pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->physicalDevice, params->pFormatInfo, params->pPropertyCount, params->pProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceSparseImageFormatInfo2_win32_to_host((const VkPhysicalDeviceSparseImageFormatInfo232 *)UlongToPtr(params->pFormatInfo), &pFormatInfo_host); - pProperties_host = convert_VkSparseImageFormatProperties2_array_win32_to_host(ctx, (VkSparseImageFormatProperties232 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertyCount)); - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceSparseImageFormatProperties2(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, &pFormatInfo_host, (uint32_t *)UlongToPtr(params->pPropertyCount), pProperties_host); - convert_VkSparseImageFormatProperties2_array_host_to_win32(pProperties_host, (VkSparseImageFormatProperties232 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertyCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSparseImageFormatProperties2KHR(void *args) -{ - struct vkGetPhysicalDeviceSparseImageFormatProperties2KHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->physicalDevice, params->pFormatInfo, params->pPropertyCount, params->pProperties); - - vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceSparseImageFormatProperties2KHR(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pFormatInfo, params->pPropertyCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSparseImageFormatProperties2KHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pFormatInfo; - PTR32 pPropertyCount; - PTR32 pProperties; - } *params = args; - VkPhysicalDeviceSparseImageFormatInfo2 pFormatInfo_host; - VkSparseImageFormatProperties2 *pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->physicalDevice, params->pFormatInfo, params->pPropertyCount, params->pProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceSparseImageFormatInfo2_win32_to_host((const VkPhysicalDeviceSparseImageFormatInfo232 *)UlongToPtr(params->pFormatInfo), &pFormatInfo_host); - pProperties_host = convert_VkSparseImageFormatProperties2_array_win32_to_host(ctx, (VkSparseImageFormatProperties232 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertyCount)); - vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceSparseImageFormatProperties2KHR(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, &pFormatInfo_host, (uint32_t *)UlongToPtr(params->pPropertyCount), pProperties_host); - convert_VkSparseImageFormatProperties2_array_host_to_win32(pProperties_host, (VkSparseImageFormatProperties232 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pPropertyCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(void *args) -{ - struct vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pCombinationCount, params->pCombinations); - - params->result = vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pCombinationCount, params->pCombinations); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pCombinationCount; - PTR32 pCombinations; - VkResult result; - } *params = args; - VkFramebufferMixedSamplesCombinationNV *pCombinations_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pCombinationCount, params->pCombinations); - - init_conversion_context(ctx); - pCombinations_host = convert_VkFramebufferMixedSamplesCombinationNV_array_win32_to_host(ctx, (VkFramebufferMixedSamplesCombinationNV32 *)UlongToPtr(params->pCombinations), *(uint32_t *)UlongToPtr(params->pCombinationCount)); - params->result = vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, (uint32_t *)UlongToPtr(params->pCombinationCount), pCombinations_host); - convert_VkFramebufferMixedSamplesCombinationNV_array_host_to_win32(pCombinations_host, (VkFramebufferMixedSamplesCombinationNV32 *)UlongToPtr(params->pCombinations), *(uint32_t *)UlongToPtr(params->pCombinationCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSurfaceCapabilities2KHR(void *args) -{ - struct vkGetPhysicalDeviceSurfaceCapabilities2KHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pSurfaceInfo, params->pSurfaceCapabilities); - - params->result = vk_funcs->p_vkGetPhysicalDeviceSurfaceCapabilities2KHR(params->physicalDevice, params->pSurfaceInfo, params->pSurfaceCapabilities); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSurfaceCapabilities2KHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pSurfaceInfo; - PTR32 pSurfaceCapabilities; - VkResult result; - } *params = args; - VkPhysicalDeviceSurfaceInfo2KHR pSurfaceInfo_host; - VkSurfaceCapabilities2KHR pSurfaceCapabilities_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pSurfaceInfo, params->pSurfaceCapabilities); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceSurfaceInfo2KHR_win32_to_unwrapped_host(ctx, (const VkPhysicalDeviceSurfaceInfo2KHR32 *)UlongToPtr(params->pSurfaceInfo), &pSurfaceInfo_host); - convert_VkSurfaceCapabilities2KHR_win32_to_host(ctx, (VkSurfaceCapabilities2KHR32 *)UlongToPtr(params->pSurfaceCapabilities), &pSurfaceCapabilities_host); - params->result = vk_funcs->p_vkGetPhysicalDeviceSurfaceCapabilities2KHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pSurfaceInfo_host, &pSurfaceCapabilities_host); - convert_VkSurfaceCapabilities2KHR_host_to_win32(&pSurfaceCapabilities_host, (VkSurfaceCapabilities2KHR32 *)UlongToPtr(params->pSurfaceCapabilities)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(void *args) -{ - struct vkGetPhysicalDeviceSurfaceCapabilitiesKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->physicalDevice, wine_dbgstr_longlong(params->surface), params->pSurfaceCapabilities); - - params->result = vk_funcs->p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(params->physicalDevice, params->surface, params->pSurfaceCapabilities); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - PTR32 pSurfaceCapabilities; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->physicalDevice, wine_dbgstr_longlong(params->surface), params->pSurfaceCapabilities); - - params->result = vk_funcs->p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), params->surface, (VkSurfaceCapabilitiesKHR *)UlongToPtr(params->pSurfaceCapabilities)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSurfaceFormats2KHR(void *args) -{ - struct vkGetPhysicalDeviceSurfaceFormats2KHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->physicalDevice, params->pSurfaceInfo, params->pSurfaceFormatCount, params->pSurfaceFormats); - - params->result = vk_funcs->p_vkGetPhysicalDeviceSurfaceFormats2KHR(params->physicalDevice, params->pSurfaceInfo, params->pSurfaceFormatCount, params->pSurfaceFormats); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSurfaceFormats2KHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pSurfaceInfo; - PTR32 pSurfaceFormatCount; - PTR32 pSurfaceFormats; - VkResult result; - } *params = args; - VkPhysicalDeviceSurfaceInfo2KHR pSurfaceInfo_host; - VkSurfaceFormat2KHR *pSurfaceFormats_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->physicalDevice, params->pSurfaceInfo, params->pSurfaceFormatCount, params->pSurfaceFormats); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceSurfaceInfo2KHR_win32_to_unwrapped_host(ctx, (const VkPhysicalDeviceSurfaceInfo2KHR32 *)UlongToPtr(params->pSurfaceInfo), &pSurfaceInfo_host); - pSurfaceFormats_host = convert_VkSurfaceFormat2KHR_array_win32_to_host(ctx, (VkSurfaceFormat2KHR32 *)UlongToPtr(params->pSurfaceFormats), *(uint32_t *)UlongToPtr(params->pSurfaceFormatCount)); - params->result = vk_funcs->p_vkGetPhysicalDeviceSurfaceFormats2KHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pSurfaceInfo_host, (uint32_t *)UlongToPtr(params->pSurfaceFormatCount), pSurfaceFormats_host); - convert_VkSurfaceFormat2KHR_array_host_to_win32(pSurfaceFormats_host, (VkSurfaceFormat2KHR32 *)UlongToPtr(params->pSurfaceFormats), *(uint32_t *)UlongToPtr(params->pSurfaceFormatCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSurfaceFormatsKHR(void *args) -{ - struct vkGetPhysicalDeviceSurfaceFormatsKHR_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->physicalDevice, wine_dbgstr_longlong(params->surface), params->pSurfaceFormatCount, params->pSurfaceFormats); - - params->result = vk_funcs->p_vkGetPhysicalDeviceSurfaceFormatsKHR(params->physicalDevice, params->surface, params->pSurfaceFormatCount, params->pSurfaceFormats); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSurfaceFormatsKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - PTR32 pSurfaceFormatCount; - PTR32 pSurfaceFormats; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->physicalDevice, wine_dbgstr_longlong(params->surface), params->pSurfaceFormatCount, params->pSurfaceFormats); - - params->result = vk_funcs->p_vkGetPhysicalDeviceSurfaceFormatsKHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), params->surface, (uint32_t *)UlongToPtr(params->pSurfaceFormatCount), (VkSurfaceFormatKHR *)UlongToPtr(params->pSurfaceFormats)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSurfacePresentModesKHR(void *args) -{ - struct vkGetPhysicalDeviceSurfacePresentModesKHR_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->physicalDevice, wine_dbgstr_longlong(params->surface), params->pPresentModeCount, params->pPresentModes); - - params->result = vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceSurfacePresentModesKHR(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->surface ? vulkan_surface_from_handle(params->surface)->host.surface : 0, params->pPresentModeCount, params->pPresentModes); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSurfacePresentModesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - PTR32 pPresentModeCount; - PTR32 pPresentModes; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->physicalDevice, wine_dbgstr_longlong(params->surface), params->pPresentModeCount, params->pPresentModes); - - params->result = vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceSurfacePresentModesKHR(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, params->surface ? vulkan_surface_from_handle(params->surface)->host.surface : 0, (uint32_t *)UlongToPtr(params->pPresentModeCount), (VkPresentModeKHR *)UlongToPtr(params->pPresentModes)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceSurfaceSupportKHR(void *args) -{ - struct vkGetPhysicalDeviceSurfaceSupportKHR_params *params = args; - - TRACE("%p, %u, 0x%s, %p\n", params->physicalDevice, params->queueFamilyIndex, wine_dbgstr_longlong(params->surface), params->pSupported); - - params->result = vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceSurfaceSupportKHR(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->queueFamilyIndex, vulkan_surface_from_handle(params->surface)->host.surface, params->pSupported); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceSurfaceSupportKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - uint32_t queueFamilyIndex; - VkSurfaceKHR DECLSPEC_ALIGN(8) surface; - PTR32 pSupported; - VkResult result; - } *params = args; - - TRACE("%#x, %u, 0x%s, %#x\n", params->physicalDevice, params->queueFamilyIndex, wine_dbgstr_longlong(params->surface), params->pSupported); - - params->result = vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceSurfaceSupportKHR(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, params->queueFamilyIndex, vulkan_surface_from_handle(params->surface)->host.surface, (VkBool32 *)UlongToPtr(params->pSupported)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceToolProperties(void *args) -{ - struct vkGetPhysicalDeviceToolProperties_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pToolCount, params->pToolProperties); - - params->result = vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceToolProperties(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pToolCount, params->pToolProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceToolProperties(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pToolCount; - PTR32 pToolProperties; - VkResult result; - } *params = args; - VkPhysicalDeviceToolProperties *pToolProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pToolCount, params->pToolProperties); - - init_conversion_context(ctx); - pToolProperties_host = convert_VkPhysicalDeviceToolProperties_array_win32_to_host(ctx, (VkPhysicalDeviceToolProperties32 *)UlongToPtr(params->pToolProperties), *(uint32_t *)UlongToPtr(params->pToolCount)); - params->result = vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceToolProperties(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, (uint32_t *)UlongToPtr(params->pToolCount), pToolProperties_host); - convert_VkPhysicalDeviceToolProperties_array_host_to_win32(pToolProperties_host, (VkPhysicalDeviceToolProperties32 *)UlongToPtr(params->pToolProperties), *(uint32_t *)UlongToPtr(params->pToolCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceToolPropertiesEXT(void *args) -{ - struct vkGetPhysicalDeviceToolPropertiesEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pToolCount, params->pToolProperties); - - params->result = vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceToolPropertiesEXT(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pToolCount, params->pToolProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceToolPropertiesEXT(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pToolCount; - PTR32 pToolProperties; - VkResult result; - } *params = args; - VkPhysicalDeviceToolProperties *pToolProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pToolCount, params->pToolProperties); - - init_conversion_context(ctx); - pToolProperties_host = convert_VkPhysicalDeviceToolProperties_array_win32_to_host(ctx, (VkPhysicalDeviceToolProperties32 *)UlongToPtr(params->pToolProperties), *(uint32_t *)UlongToPtr(params->pToolCount)); - params->result = vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceToolPropertiesEXT(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, (uint32_t *)UlongToPtr(params->pToolCount), pToolProperties_host); - convert_VkPhysicalDeviceToolProperties_array_host_to_win32(pToolProperties_host, (VkPhysicalDeviceToolProperties32 *)UlongToPtr(params->pToolProperties), *(uint32_t *)UlongToPtr(params->pToolCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceVideoCapabilitiesKHR(void *args) -{ - struct vkGetPhysicalDeviceVideoCapabilitiesKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pVideoProfile, params->pCapabilities); - - params->result = vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceVideoCapabilitiesKHR(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pVideoProfile, params->pCapabilities); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceVideoCapabilitiesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pVideoProfile; - PTR32 pCapabilities; - VkResult result; - } *params = args; - VkVideoProfileInfoKHR pVideoProfile_host; - VkVideoCapabilitiesKHR pCapabilities_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pVideoProfile, params->pCapabilities); - - init_conversion_context(ctx); - convert_VkVideoProfileInfoKHR_win32_to_host(ctx, (const VkVideoProfileInfoKHR32 *)UlongToPtr(params->pVideoProfile), &pVideoProfile_host); - convert_VkVideoCapabilitiesKHR_win32_to_host(ctx, (VkVideoCapabilitiesKHR32 *)UlongToPtr(params->pCapabilities), &pCapabilities_host); - params->result = vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceVideoCapabilitiesKHR(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, &pVideoProfile_host, &pCapabilities_host); - convert_VkVideoCapabilitiesKHR_host_to_win32(&pCapabilities_host, (VkVideoCapabilitiesKHR32 *)UlongToPtr(params->pCapabilities)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR(void *args) -{ - struct vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->physicalDevice, params->pQualityLevelInfo, params->pQualityLevelProperties); - - params->result = vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pQualityLevelInfo, params->pQualityLevelProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pQualityLevelInfo; - PTR32 pQualityLevelProperties; - VkResult result; - } *params = args; - VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR pQualityLevelInfo_host; - VkVideoEncodeQualityLevelPropertiesKHR pQualityLevelProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pQualityLevelInfo, params->pQualityLevelProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR_win32_to_host(ctx, (const VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR32 *)UlongToPtr(params->pQualityLevelInfo), &pQualityLevelInfo_host); - convert_VkVideoEncodeQualityLevelPropertiesKHR_win32_to_host(ctx, (VkVideoEncodeQualityLevelPropertiesKHR32 *)UlongToPtr(params->pQualityLevelProperties), &pQualityLevelProperties_host); - params->result = vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, &pQualityLevelInfo_host, &pQualityLevelProperties_host); - convert_VkVideoEncodeQualityLevelPropertiesKHR_host_to_win32(&pQualityLevelProperties_host, (VkVideoEncodeQualityLevelPropertiesKHR32 *)UlongToPtr(params->pQualityLevelProperties)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceVideoFormatPropertiesKHR(void *args) -{ - struct vkGetPhysicalDeviceVideoFormatPropertiesKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->physicalDevice, params->pVideoFormatInfo, params->pVideoFormatPropertyCount, params->pVideoFormatProperties); - - params->result = vulkan_physical_device_from_handle(params->physicalDevice)->instance->p_vkGetPhysicalDeviceVideoFormatPropertiesKHR(vulkan_physical_device_from_handle(params->physicalDevice)->host.physical_device, params->pVideoFormatInfo, params->pVideoFormatPropertyCount, params->pVideoFormatProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceVideoFormatPropertiesKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - PTR32 pVideoFormatInfo; - PTR32 pVideoFormatPropertyCount; - PTR32 pVideoFormatProperties; - VkResult result; - } *params = args; - VkPhysicalDeviceVideoFormatInfoKHR pVideoFormatInfo_host; - VkVideoFormatPropertiesKHR *pVideoFormatProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->physicalDevice, params->pVideoFormatInfo, params->pVideoFormatPropertyCount, params->pVideoFormatProperties); - - init_conversion_context(ctx); - convert_VkPhysicalDeviceVideoFormatInfoKHR_win32_to_host(ctx, (const VkPhysicalDeviceVideoFormatInfoKHR32 *)UlongToPtr(params->pVideoFormatInfo), &pVideoFormatInfo_host); - pVideoFormatProperties_host = convert_VkVideoFormatPropertiesKHR_array_win32_to_host(ctx, (VkVideoFormatPropertiesKHR32 *)UlongToPtr(params->pVideoFormatProperties), *(uint32_t *)UlongToPtr(params->pVideoFormatPropertyCount)); - params->result = vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->instance->p_vkGetPhysicalDeviceVideoFormatPropertiesKHR(vulkan_physical_device_from_handle((VkPhysicalDevice)UlongToPtr(params->physicalDevice))->host.physical_device, &pVideoFormatInfo_host, (uint32_t *)UlongToPtr(params->pVideoFormatPropertyCount), pVideoFormatProperties_host); - convert_VkVideoFormatPropertiesKHR_array_host_to_win32(pVideoFormatProperties_host, (VkVideoFormatPropertiesKHR32 *)UlongToPtr(params->pVideoFormatProperties), *(uint32_t *)UlongToPtr(params->pVideoFormatPropertyCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPhysicalDeviceWin32PresentationSupportKHR(void *args) -{ - struct vkGetPhysicalDeviceWin32PresentationSupportKHR_params *params = args; - - TRACE("%p, %u\n", params->physicalDevice, params->queueFamilyIndex); - - params->result = vk_funcs->p_vkGetPhysicalDeviceWin32PresentationSupportKHR(params->physicalDevice, params->queueFamilyIndex); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPhysicalDeviceWin32PresentationSupportKHR(void *args) -{ - struct - { - PTR32 physicalDevice; - uint32_t queueFamilyIndex; - VkBool32 result; - } *params = args; - - TRACE("%#x, %u\n", params->physicalDevice, params->queueFamilyIndex); - - params->result = vk_funcs->p_vkGetPhysicalDeviceWin32PresentationSupportKHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), params->queueFamilyIndex); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPipelineBinaryDataKHR(void *args) -{ - struct vkGetPipelineBinaryDataKHR_params *params = args; - - TRACE("%p, %p, %p, %p, %p\n", params->device, params->pInfo, params->pPipelineBinaryKey, params->pPipelineBinaryDataSize, params->pPipelineBinaryData); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetPipelineBinaryDataKHR(vulkan_device_from_handle(params->device)->host.device, params->pInfo, params->pPipelineBinaryKey, params->pPipelineBinaryDataSize, params->pPipelineBinaryData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPipelineBinaryDataKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pPipelineBinaryKey; - PTR32 pPipelineBinaryDataSize; - PTR32 pPipelineBinaryData; - VkResult result; - } *params = args; - VkPipelineBinaryDataInfoKHR pInfo_host; - VkPipelineBinaryKeyKHR pPipelineBinaryKey_host; - size_t pPipelineBinaryDataSize_host; - - TRACE("%#x, %#x, %#x, %#x, %#x\n", params->device, params->pInfo, params->pPipelineBinaryKey, params->pPipelineBinaryDataSize, params->pPipelineBinaryData); - - convert_VkPipelineBinaryDataInfoKHR_win32_to_host((const VkPipelineBinaryDataInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - convert_VkPipelineBinaryKeyKHR_win32_to_host((VkPipelineBinaryKeyKHR32 *)UlongToPtr(params->pPipelineBinaryKey), &pPipelineBinaryKey_host); - pPipelineBinaryDataSize_host = *(PTR32 *)UlongToPtr(params->pPipelineBinaryDataSize); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetPipelineBinaryDataKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, &pPipelineBinaryKey_host, &pPipelineBinaryDataSize_host, (void *)UlongToPtr(params->pPipelineBinaryData)); - convert_VkPipelineBinaryKeyKHR_host_to_win32(&pPipelineBinaryKey_host, (VkPipelineBinaryKeyKHR32 *)UlongToPtr(params->pPipelineBinaryKey)); - *(PTR32 *)UlongToPtr(params->pPipelineBinaryDataSize) = pPipelineBinaryDataSize_host; - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPipelineCacheData(void *args) -{ - struct vkGetPipelineCacheData_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->pDataSize, params->pData); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetPipelineCacheData(vulkan_device_from_handle(params->device)->host.device, params->pipelineCache, params->pDataSize, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPipelineCacheData(void *args) -{ - struct - { - PTR32 device; - VkPipelineCache DECLSPEC_ALIGN(8) pipelineCache; - PTR32 pDataSize; - PTR32 pData; - VkResult result; - } *params = args; - size_t pDataSize_host; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->pDataSize, params->pData); - - pDataSize_host = *(PTR32 *)UlongToPtr(params->pDataSize); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetPipelineCacheData(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->pipelineCache, &pDataSize_host, (void *)UlongToPtr(params->pData)); - *(PTR32 *)UlongToPtr(params->pDataSize) = pDataSize_host; - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPipelineExecutableInternalRepresentationsKHR(void *args) -{ - struct vkGetPipelineExecutableInternalRepresentationsKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pExecutableInfo, params->pInternalRepresentationCount, params->pInternalRepresentations); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetPipelineExecutableInternalRepresentationsKHR(vulkan_device_from_handle(params->device)->host.device, params->pExecutableInfo, params->pInternalRepresentationCount, params->pInternalRepresentations); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPipelineExecutableInternalRepresentationsKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pExecutableInfo; - PTR32 pInternalRepresentationCount; - PTR32 pInternalRepresentations; - VkResult result; - } *params = args; - VkPipelineExecutableInfoKHR pExecutableInfo_host; - VkPipelineExecutableInternalRepresentationKHR *pInternalRepresentations_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pExecutableInfo, params->pInternalRepresentationCount, params->pInternalRepresentations); - - init_conversion_context(ctx); - convert_VkPipelineExecutableInfoKHR_win32_to_host((const VkPipelineExecutableInfoKHR32 *)UlongToPtr(params->pExecutableInfo), &pExecutableInfo_host); - pInternalRepresentations_host = convert_VkPipelineExecutableInternalRepresentationKHR_array_win32_to_host(ctx, (VkPipelineExecutableInternalRepresentationKHR32 *)UlongToPtr(params->pInternalRepresentations), *(uint32_t *)UlongToPtr(params->pInternalRepresentationCount)); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetPipelineExecutableInternalRepresentationsKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pExecutableInfo_host, (uint32_t *)UlongToPtr(params->pInternalRepresentationCount), pInternalRepresentations_host); - convert_VkPipelineExecutableInternalRepresentationKHR_array_host_to_win32(pInternalRepresentations_host, (VkPipelineExecutableInternalRepresentationKHR32 *)UlongToPtr(params->pInternalRepresentations), *(uint32_t *)UlongToPtr(params->pInternalRepresentationCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPipelineExecutablePropertiesKHR(void *args) -{ - struct vkGetPipelineExecutablePropertiesKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pPipelineInfo, params->pExecutableCount, params->pProperties); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetPipelineExecutablePropertiesKHR(vulkan_device_from_handle(params->device)->host.device, params->pPipelineInfo, params->pExecutableCount, params->pProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPipelineExecutablePropertiesKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pPipelineInfo; - PTR32 pExecutableCount; - PTR32 pProperties; - VkResult result; - } *params = args; - VkPipelineInfoKHR pPipelineInfo_host; - VkPipelineExecutablePropertiesKHR *pProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pPipelineInfo, params->pExecutableCount, params->pProperties); - - init_conversion_context(ctx); - convert_VkPipelineInfoKHR_win32_to_host((const VkPipelineInfoKHR32 *)UlongToPtr(params->pPipelineInfo), &pPipelineInfo_host); - pProperties_host = convert_VkPipelineExecutablePropertiesKHR_array_win32_to_host(ctx, (VkPipelineExecutablePropertiesKHR32 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pExecutableCount)); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetPipelineExecutablePropertiesKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pPipelineInfo_host, (uint32_t *)UlongToPtr(params->pExecutableCount), pProperties_host); - convert_VkPipelineExecutablePropertiesKHR_array_host_to_win32(pProperties_host, (VkPipelineExecutablePropertiesKHR32 *)UlongToPtr(params->pProperties), *(uint32_t *)UlongToPtr(params->pExecutableCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPipelineExecutableStatisticsKHR(void *args) -{ - struct vkGetPipelineExecutableStatisticsKHR_params *params = args; - - TRACE("%p, %p, %p, %p\n", params->device, params->pExecutableInfo, params->pStatisticCount, params->pStatistics); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetPipelineExecutableStatisticsKHR(vulkan_device_from_handle(params->device)->host.device, params->pExecutableInfo, params->pStatisticCount, params->pStatistics); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPipelineExecutableStatisticsKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pExecutableInfo; - PTR32 pStatisticCount; - PTR32 pStatistics; - VkResult result; - } *params = args; - VkPipelineExecutableInfoKHR pExecutableInfo_host; - VkPipelineExecutableStatisticKHR *pStatistics_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->device, params->pExecutableInfo, params->pStatisticCount, params->pStatistics); - - init_conversion_context(ctx); - convert_VkPipelineExecutableInfoKHR_win32_to_host((const VkPipelineExecutableInfoKHR32 *)UlongToPtr(params->pExecutableInfo), &pExecutableInfo_host); - pStatistics_host = convert_VkPipelineExecutableStatisticKHR_array_win32_to_host(ctx, (VkPipelineExecutableStatisticKHR32 *)UlongToPtr(params->pStatistics), *(uint32_t *)UlongToPtr(params->pStatisticCount)); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetPipelineExecutableStatisticsKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pExecutableInfo_host, (uint32_t *)UlongToPtr(params->pStatisticCount), pStatistics_host); - convert_VkPipelineExecutableStatisticKHR_array_host_to_win32(pStatistics_host, (VkPipelineExecutableStatisticKHR32 *)UlongToPtr(params->pStatistics), *(uint32_t *)UlongToPtr(params->pStatisticCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPipelineIndirectDeviceAddressNV(void *args) -{ - struct vkGetPipelineIndirectDeviceAddressNV_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetPipelineIndirectDeviceAddressNV(vulkan_device_from_handle(params->device)->host.device, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPipelineIndirectDeviceAddressNV(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - VkDeviceAddress result; - } *params = args; - VkPipelineIndirectDeviceAddressInfoNV pInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInfo); - - convert_VkPipelineIndirectDeviceAddressInfoNV_win32_to_host((const VkPipelineIndirectDeviceAddressInfoNV32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetPipelineIndirectDeviceAddressNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPipelineIndirectMemoryRequirementsNV(void *args) -{ - struct vkGetPipelineIndirectMemoryRequirementsNV_params *params = args; - VkComputePipelineCreateInfo pCreateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %p, %p\n", params->device, params->pCreateInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkComputePipelineCreateInfo_win64_to_host(ctx, params->pCreateInfo, &pCreateInfo_host); - vulkan_device_from_handle(params->device)->p_vkGetPipelineIndirectMemoryRequirementsNV(vulkan_device_from_handle(params->device)->host.device, &pCreateInfo_host, params->pMemoryRequirements); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPipelineIndirectMemoryRequirementsNV(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pMemoryRequirements; - } *params = args; - VkComputePipelineCreateInfo pCreateInfo_host; - VkMemoryRequirements2 pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pMemoryRequirements); - - init_conversion_context(ctx); - convert_VkComputePipelineCreateInfo_win32_to_host(ctx, (const VkComputePipelineCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - convert_VkMemoryRequirements2_win32_to_host(ctx, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements), &pMemoryRequirements_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetPipelineIndirectMemoryRequirementsNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, &pMemoryRequirements_host); - convert_VkComputePipelineCreateInfo_host_to_win32(&pCreateInfo_host, (const VkComputePipelineCreateInfo32 *)UlongToPtr(params->pCreateInfo)); - convert_VkMemoryRequirements2_host_to_win32(&pMemoryRequirements_host, (VkMemoryRequirements232 *)UlongToPtr(params->pMemoryRequirements)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPipelineKeyKHR(void *args) -{ - struct vkGetPipelineKeyKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pPipelineCreateInfo, params->pPipelineKey); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetPipelineKeyKHR(vulkan_device_from_handle(params->device)->host.device, params->pPipelineCreateInfo, params->pPipelineKey); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPipelineKeyKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pPipelineCreateInfo; - PTR32 pPipelineKey; - VkResult result; - } *params = args; - VkPipelineCreateInfoKHR *pPipelineCreateInfo_host = NULL; - VkPipelineBinaryKeyKHR pPipelineKey_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pPipelineCreateInfo, params->pPipelineKey); - - init_conversion_context(ctx); - if (params->pPipelineCreateInfo) - { - pPipelineCreateInfo_host = conversion_context_alloc(ctx, sizeof(*pPipelineCreateInfo_host)); - convert_VkPipelineCreateInfoKHR_win32_to_host((const VkPipelineCreateInfoKHR32 *)UlongToPtr(params->pPipelineCreateInfo), pPipelineCreateInfo_host); - } - convert_VkPipelineBinaryKeyKHR_win32_to_host((VkPipelineBinaryKeyKHR32 *)UlongToPtr(params->pPipelineKey), &pPipelineKey_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetPipelineKeyKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, pPipelineCreateInfo_host, &pPipelineKey_host); - convert_VkPipelineBinaryKeyKHR_host_to_win32(&pPipelineKey_host, (VkPipelineBinaryKeyKHR32 *)UlongToPtr(params->pPipelineKey)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPipelinePropertiesEXT(void *args) -{ - struct vkGetPipelinePropertiesEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pPipelineInfo, params->pPipelineProperties); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetPipelinePropertiesEXT(vulkan_device_from_handle(params->device)->host.device, params->pPipelineInfo, params->pPipelineProperties); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPipelinePropertiesEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pPipelineInfo; - PTR32 pPipelineProperties; - VkResult result; - } *params = args; - VkPipelineInfoEXT pPipelineInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pPipelineInfo, params->pPipelineProperties); - - convert_VkPipelineInfoEXT_win32_to_host((const VkPipelineInfoEXT32 *)UlongToPtr(params->pPipelineInfo), &pPipelineInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetPipelinePropertiesEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pPipelineInfo_host, (VkBaseOutStructure *)UlongToPtr(params->pPipelineProperties)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPrivateData(void *args) -{ - struct vkGetPrivateData_params *params = args; - - TRACE("%p, %#x, 0x%s, 0x%s, %p\n", params->device, params->objectType, wine_dbgstr_longlong(params->objectHandle), wine_dbgstr_longlong(params->privateDataSlot), params->pData); - - vulkan_device_from_handle(params->device)->p_vkGetPrivateData(vulkan_device_from_handle(params->device)->host.device, params->objectType, wine_vk_unwrap_handle(params->objectType, params->objectHandle), params->privateDataSlot, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPrivateData(void *args) -{ - struct - { - PTR32 device; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - PTR32 pData; - } *params = args; - - TRACE("%#x, %#x, 0x%s, 0x%s, %#x\n", params->device, params->objectType, wine_dbgstr_longlong(params->objectHandle), wine_dbgstr_longlong(params->privateDataSlot), params->pData); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetPrivateData(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->objectType, wine_vk_unwrap_handle(params->objectType, params->objectHandle), params->privateDataSlot, (uint64_t *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetPrivateDataEXT(void *args) -{ - struct vkGetPrivateDataEXT_params *params = args; - - TRACE("%p, %#x, 0x%s, 0x%s, %p\n", params->device, params->objectType, wine_dbgstr_longlong(params->objectHandle), wine_dbgstr_longlong(params->privateDataSlot), params->pData); - - vulkan_device_from_handle(params->device)->p_vkGetPrivateDataEXT(vulkan_device_from_handle(params->device)->host.device, params->objectType, wine_vk_unwrap_handle(params->objectType, params->objectHandle), params->privateDataSlot, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetPrivateDataEXT(void *args) -{ - struct - { - PTR32 device; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - PTR32 pData; - } *params = args; - - TRACE("%#x, %#x, 0x%s, 0x%s, %#x\n", params->device, params->objectType, wine_dbgstr_longlong(params->objectHandle), wine_dbgstr_longlong(params->privateDataSlot), params->pData); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetPrivateDataEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->objectType, wine_vk_unwrap_handle(params->objectType, params->objectHandle), params->privateDataSlot, (uint64_t *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetQueryPoolResults(void *args) -{ - struct vkGetQueryPoolResults_params *params = args; - - TRACE("%p, 0x%s, %u, %u, 0x%s, %p, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->queryPool), params->firstQuery, params->queryCount, wine_dbgstr_longlong(params->dataSize), params->pData, wine_dbgstr_longlong(params->stride), params->flags); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetQueryPoolResults(vulkan_device_from_handle(params->device)->host.device, params->queryPool, params->firstQuery, params->queryCount, params->dataSize, params->pData, params->stride, params->flags); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetQueryPoolResults(void *args) -{ - struct - { - PTR32 device; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; - PTR32 dataSize; - PTR32 pData; - VkDeviceSize DECLSPEC_ALIGN(8) stride; - VkQueryResultFlags flags; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %u, %u, 0x%s, %#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->queryPool), params->firstQuery, params->queryCount, wine_dbgstr_longlong(params->dataSize), params->pData, wine_dbgstr_longlong(params->stride), params->flags); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetQueryPoolResults(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->queryPool, params->firstQuery, params->queryCount, params->dataSize, (void *)UlongToPtr(params->pData), params->stride, params->flags); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetQueueCheckpointData2NV(void *args) -{ - struct vkGetQueueCheckpointData2NV_params *params = args; - - TRACE("%p, %p, %p\n", params->queue, params->pCheckpointDataCount, params->pCheckpointData); - - vulkan_queue_from_handle(params->queue)->device->p_vkGetQueueCheckpointData2NV(vulkan_queue_from_handle(params->queue)->host.queue, params->pCheckpointDataCount, params->pCheckpointData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetQueueCheckpointData2NV(void *args) -{ - struct - { - PTR32 queue; - PTR32 pCheckpointDataCount; - PTR32 pCheckpointData; - } *params = args; - VkCheckpointData2NV *pCheckpointData_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->queue, params->pCheckpointDataCount, params->pCheckpointData); - - init_conversion_context(ctx); - pCheckpointData_host = convert_VkCheckpointData2NV_array_win32_to_host(ctx, (VkCheckpointData2NV32 *)UlongToPtr(params->pCheckpointData), *(uint32_t *)UlongToPtr(params->pCheckpointDataCount)); - vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->p_vkGetQueueCheckpointData2NV(vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host.queue, (uint32_t *)UlongToPtr(params->pCheckpointDataCount), pCheckpointData_host); - convert_VkCheckpointData2NV_array_host_to_win32(pCheckpointData_host, (VkCheckpointData2NV32 *)UlongToPtr(params->pCheckpointData), *(uint32_t *)UlongToPtr(params->pCheckpointDataCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetQueueCheckpointDataNV(void *args) -{ - struct vkGetQueueCheckpointDataNV_params *params = args; - - TRACE("%p, %p, %p\n", params->queue, params->pCheckpointDataCount, params->pCheckpointData); - - vulkan_queue_from_handle(params->queue)->device->p_vkGetQueueCheckpointDataNV(vulkan_queue_from_handle(params->queue)->host.queue, params->pCheckpointDataCount, params->pCheckpointData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetQueueCheckpointDataNV(void *args) -{ - struct - { - PTR32 queue; - PTR32 pCheckpointDataCount; - PTR32 pCheckpointData; - } *params = args; - VkCheckpointDataNV *pCheckpointData_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->queue, params->pCheckpointDataCount, params->pCheckpointData); - - init_conversion_context(ctx); - pCheckpointData_host = convert_VkCheckpointDataNV_array_win32_to_host(ctx, (VkCheckpointDataNV32 *)UlongToPtr(params->pCheckpointData), *(uint32_t *)UlongToPtr(params->pCheckpointDataCount)); - vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->p_vkGetQueueCheckpointDataNV(vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host.queue, (uint32_t *)UlongToPtr(params->pCheckpointDataCount), pCheckpointData_host); - convert_VkCheckpointDataNV_array_host_to_win32(pCheckpointData_host, (VkCheckpointDataNV32 *)UlongToPtr(params->pCheckpointData), *(uint32_t *)UlongToPtr(params->pCheckpointDataCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(void *args) -{ - struct vkGetRayTracingCaptureReplayShaderGroupHandlesKHR_params *params = args; - - TRACE("%p, 0x%s, %u, %u, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->pipeline), params->firstGroup, params->groupCount, wine_dbgstr_longlong(params->dataSize), params->pData); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(vulkan_device_from_handle(params->device)->host.device, params->pipeline, params->firstGroup, params->groupCount, params->dataSize, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(void *args) -{ - struct - { - PTR32 device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t firstGroup; - uint32_t groupCount; - PTR32 dataSize; - PTR32 pData; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %u, %u, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->pipeline), params->firstGroup, params->groupCount, wine_dbgstr_longlong(params->dataSize), params->pData); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->pipeline, params->firstGroup, params->groupCount, params->dataSize, (void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetRayTracingShaderGroupHandlesKHR(void *args) -{ - struct vkGetRayTracingShaderGroupHandlesKHR_params *params = args; - - TRACE("%p, 0x%s, %u, %u, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->pipeline), params->firstGroup, params->groupCount, wine_dbgstr_longlong(params->dataSize), params->pData); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetRayTracingShaderGroupHandlesKHR(vulkan_device_from_handle(params->device)->host.device, params->pipeline, params->firstGroup, params->groupCount, params->dataSize, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetRayTracingShaderGroupHandlesKHR(void *args) -{ - struct - { - PTR32 device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t firstGroup; - uint32_t groupCount; - PTR32 dataSize; - PTR32 pData; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %u, %u, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->pipeline), params->firstGroup, params->groupCount, wine_dbgstr_longlong(params->dataSize), params->pData); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetRayTracingShaderGroupHandlesKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->pipeline, params->firstGroup, params->groupCount, params->dataSize, (void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetRayTracingShaderGroupHandlesNV(void *args) -{ - struct vkGetRayTracingShaderGroupHandlesNV_params *params = args; - - TRACE("%p, 0x%s, %u, %u, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->pipeline), params->firstGroup, params->groupCount, wine_dbgstr_longlong(params->dataSize), params->pData); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetRayTracingShaderGroupHandlesNV(vulkan_device_from_handle(params->device)->host.device, params->pipeline, params->firstGroup, params->groupCount, params->dataSize, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetRayTracingShaderGroupHandlesNV(void *args) -{ - struct - { - PTR32 device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t firstGroup; - uint32_t groupCount; - PTR32 dataSize; - PTR32 pData; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %u, %u, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->pipeline), params->firstGroup, params->groupCount, wine_dbgstr_longlong(params->dataSize), params->pData); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetRayTracingShaderGroupHandlesNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->pipeline, params->firstGroup, params->groupCount, params->dataSize, (void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetRayTracingShaderGroupStackSizeKHR(void *args) -{ - struct vkGetRayTracingShaderGroupStackSizeKHR_params *params = args; - - TRACE("%p, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->pipeline), params->group, params->groupShader); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetRayTracingShaderGroupStackSizeKHR(vulkan_device_from_handle(params->device)->host.device, params->pipeline, params->group, params->groupShader); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetRayTracingShaderGroupStackSizeKHR(void *args) -{ - struct - { - PTR32 device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - uint32_t group; - VkShaderGroupShaderKHR groupShader; - VkDeviceSize result; - } *params = args; - - TRACE("%#x, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->pipeline), params->group, params->groupShader); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetRayTracingShaderGroupStackSizeKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->pipeline, params->group, params->groupShader); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetRenderAreaGranularity(void *args) -{ - struct vkGetRenderAreaGranularity_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->renderPass), params->pGranularity); - - vulkan_device_from_handle(params->device)->p_vkGetRenderAreaGranularity(vulkan_device_from_handle(params->device)->host.device, params->renderPass, params->pGranularity); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetRenderAreaGranularity(void *args) -{ - struct - { - PTR32 device; - VkRenderPass DECLSPEC_ALIGN(8) renderPass; - PTR32 pGranularity; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->renderPass), params->pGranularity); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetRenderAreaGranularity(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->renderPass, (VkExtent2D *)UlongToPtr(params->pGranularity)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetRenderingAreaGranularity(void *args) -{ - struct vkGetRenderingAreaGranularity_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pRenderingAreaInfo, params->pGranularity); - - vulkan_device_from_handle(params->device)->p_vkGetRenderingAreaGranularity(vulkan_device_from_handle(params->device)->host.device, params->pRenderingAreaInfo, params->pGranularity); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetRenderingAreaGranularity(void *args) -{ - struct - { - PTR32 device; - PTR32 pRenderingAreaInfo; - PTR32 pGranularity; - } *params = args; - VkRenderingAreaInfo pRenderingAreaInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pRenderingAreaInfo, params->pGranularity); - - convert_VkRenderingAreaInfo_win32_to_host((const VkRenderingAreaInfo32 *)UlongToPtr(params->pRenderingAreaInfo), &pRenderingAreaInfo_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetRenderingAreaGranularity(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pRenderingAreaInfo_host, (VkExtent2D *)UlongToPtr(params->pGranularity)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetRenderingAreaGranularityKHR(void *args) -{ - struct vkGetRenderingAreaGranularityKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pRenderingAreaInfo, params->pGranularity); - - vulkan_device_from_handle(params->device)->p_vkGetRenderingAreaGranularityKHR(vulkan_device_from_handle(params->device)->host.device, params->pRenderingAreaInfo, params->pGranularity); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetRenderingAreaGranularityKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pRenderingAreaInfo; - PTR32 pGranularity; - } *params = args; - VkRenderingAreaInfo pRenderingAreaInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pRenderingAreaInfo, params->pGranularity); - - convert_VkRenderingAreaInfo_win32_to_host((const VkRenderingAreaInfo32 *)UlongToPtr(params->pRenderingAreaInfo), &pRenderingAreaInfo_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetRenderingAreaGranularityKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pRenderingAreaInfo_host, (VkExtent2D *)UlongToPtr(params->pGranularity)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetSamplerOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct vkGetSamplerOpaqueCaptureDescriptorDataEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pData); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetSamplerOpaqueCaptureDescriptorDataEXT(vulkan_device_from_handle(params->device)->host.device, params->pInfo, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetSamplerOpaqueCaptureDescriptorDataEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pData; - VkResult result; - } *params = args; - VkSamplerCaptureDescriptorDataInfoEXT pInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pData); - - convert_VkSamplerCaptureDescriptorDataInfoEXT_win32_to_host((const VkSamplerCaptureDescriptorDataInfoEXT32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetSamplerOpaqueCaptureDescriptorDataEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, (void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetSemaphoreCounterValue(void *args) -{ - struct vkGetSemaphoreCounterValue_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->semaphore), params->pValue); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetSemaphoreCounterValue(vulkan_device_from_handle(params->device)->host.device, params->semaphore, params->pValue); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetSemaphoreCounterValue(void *args) -{ - struct - { - PTR32 device; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - PTR32 pValue; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->semaphore), params->pValue); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetSemaphoreCounterValue(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->semaphore, (uint64_t *)UlongToPtr(params->pValue)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetSemaphoreCounterValueKHR(void *args) -{ - struct vkGetSemaphoreCounterValueKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->semaphore), params->pValue); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetSemaphoreCounterValueKHR(vulkan_device_from_handle(params->device)->host.device, params->semaphore, params->pValue); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetSemaphoreCounterValueKHR(void *args) -{ - struct - { - PTR32 device; - VkSemaphore DECLSPEC_ALIGN(8) semaphore; - PTR32 pValue; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->semaphore), params->pValue); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetSemaphoreCounterValueKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->semaphore, (uint64_t *)UlongToPtr(params->pValue)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetShaderBinaryDataEXT(void *args) -{ - struct vkGetShaderBinaryDataEXT_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->shader), params->pDataSize, params->pData); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetShaderBinaryDataEXT(vulkan_device_from_handle(params->device)->host.device, params->shader, params->pDataSize, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetShaderBinaryDataEXT(void *args) -{ - struct - { - PTR32 device; - VkShaderEXT DECLSPEC_ALIGN(8) shader; - PTR32 pDataSize; - PTR32 pData; - VkResult result; - } *params = args; - size_t pDataSize_host; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->shader), params->pDataSize, params->pData); - - pDataSize_host = *(PTR32 *)UlongToPtr(params->pDataSize); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetShaderBinaryDataEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->shader, &pDataSize_host, (void *)UlongToPtr(params->pData)); - *(PTR32 *)UlongToPtr(params->pDataSize) = pDataSize_host; - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetShaderInfoAMD(void *args) -{ - struct vkGetShaderInfoAMD_params *params = args; - - TRACE("%p, 0x%s, %#x, %#x, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipeline), params->shaderStage, params->infoType, params->pInfoSize, params->pInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetShaderInfoAMD(vulkan_device_from_handle(params->device)->host.device, params->pipeline, params->shaderStage, params->infoType, params->pInfoSize, params->pInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetShaderInfoAMD(void *args) -{ - struct - { - PTR32 device; - VkPipeline DECLSPEC_ALIGN(8) pipeline; - VkShaderStageFlagBits shaderStage; - VkShaderInfoTypeAMD infoType; - PTR32 pInfoSize; - PTR32 pInfo; - VkResult result; - } *params = args; - size_t pInfoSize_host; - - TRACE("%#x, 0x%s, %#x, %#x, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->pipeline), params->shaderStage, params->infoType, params->pInfoSize, params->pInfo); - - pInfoSize_host = *(PTR32 *)UlongToPtr(params->pInfoSize); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetShaderInfoAMD(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->pipeline, params->shaderStage, params->infoType, &pInfoSize_host, (void *)UlongToPtr(params->pInfo)); - *(PTR32 *)UlongToPtr(params->pInfoSize) = pInfoSize_host; - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetShaderModuleCreateInfoIdentifierEXT(void *args) -{ - struct vkGetShaderModuleCreateInfoIdentifierEXT_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pCreateInfo, params->pIdentifier); - - vulkan_device_from_handle(params->device)->p_vkGetShaderModuleCreateInfoIdentifierEXT(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, params->pIdentifier); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetShaderModuleCreateInfoIdentifierEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pCreateInfo; - PTR32 pIdentifier; - } *params = args; - VkShaderModuleCreateInfo pCreateInfo_host; - VkShaderModuleIdentifierEXT pIdentifier_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pCreateInfo, params->pIdentifier); - - init_conversion_context(ctx); - convert_VkShaderModuleCreateInfo_win32_to_host(ctx, (const VkShaderModuleCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - convert_VkShaderModuleIdentifierEXT_win32_to_host((VkShaderModuleIdentifierEXT32 *)UlongToPtr(params->pIdentifier), &pIdentifier_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetShaderModuleCreateInfoIdentifierEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, &pIdentifier_host); - convert_VkShaderModuleIdentifierEXT_host_to_win32(&pIdentifier_host, (VkShaderModuleIdentifierEXT32 *)UlongToPtr(params->pIdentifier)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetShaderModuleIdentifierEXT(void *args) -{ - struct vkGetShaderModuleIdentifierEXT_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->shaderModule), params->pIdentifier); - - vulkan_device_from_handle(params->device)->p_vkGetShaderModuleIdentifierEXT(vulkan_device_from_handle(params->device)->host.device, params->shaderModule, params->pIdentifier); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetShaderModuleIdentifierEXT(void *args) -{ - struct - { - PTR32 device; - VkShaderModule DECLSPEC_ALIGN(8) shaderModule; - PTR32 pIdentifier; - } *params = args; - VkShaderModuleIdentifierEXT pIdentifier_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->shaderModule), params->pIdentifier); - - convert_VkShaderModuleIdentifierEXT_win32_to_host((VkShaderModuleIdentifierEXT32 *)UlongToPtr(params->pIdentifier), &pIdentifier_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetShaderModuleIdentifierEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->shaderModule, &pIdentifier_host); - convert_VkShaderModuleIdentifierEXT_host_to_win32(&pIdentifier_host, (VkShaderModuleIdentifierEXT32 *)UlongToPtr(params->pIdentifier)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetSwapchainImagesKHR(void *args) -{ - struct vkGetSwapchainImagesKHR_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pSwapchainImageCount, params->pSwapchainImages); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetSwapchainImagesKHR(vulkan_device_from_handle(params->device)->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, params->pSwapchainImageCount, params->pSwapchainImages); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetSwapchainImagesKHR(void *args) -{ - struct - { - PTR32 device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - PTR32 pSwapchainImageCount; - PTR32 pSwapchainImages; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pSwapchainImageCount, params->pSwapchainImages); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetSwapchainImagesKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, (uint32_t *)UlongToPtr(params->pSwapchainImageCount), (VkImage *)UlongToPtr(params->pSwapchainImages)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetValidationCacheDataEXT(void *args) -{ - struct vkGetValidationCacheDataEXT_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->validationCache), params->pDataSize, params->pData); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetValidationCacheDataEXT(vulkan_device_from_handle(params->device)->host.device, params->validationCache, params->pDataSize, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetValidationCacheDataEXT(void *args) -{ - struct - { - PTR32 device; - VkValidationCacheEXT DECLSPEC_ALIGN(8) validationCache; - PTR32 pDataSize; - PTR32 pData; - VkResult result; - } *params = args; - size_t pDataSize_host; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->validationCache), params->pDataSize, params->pData); - - pDataSize_host = *(PTR32 *)UlongToPtr(params->pDataSize); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetValidationCacheDataEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->validationCache, &pDataSize_host, (void *)UlongToPtr(params->pData)); - *(PTR32 *)UlongToPtr(params->pDataSize) = pDataSize_host; - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkGetVideoSessionMemoryRequirementsKHR(void *args) -{ - struct vkGetVideoSessionMemoryRequirementsKHR_params *params = args; - - TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->videoSession), params->pMemoryRequirementsCount, params->pMemoryRequirements); - - params->result = vulkan_device_from_handle(params->device)->p_vkGetVideoSessionMemoryRequirementsKHR(vulkan_device_from_handle(params->device)->host.device, params->videoSession, params->pMemoryRequirementsCount, params->pMemoryRequirements); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkGetVideoSessionMemoryRequirementsKHR(void *args) -{ - struct - { - PTR32 device; - VkVideoSessionKHR DECLSPEC_ALIGN(8) videoSession; - PTR32 pMemoryRequirementsCount; - PTR32 pMemoryRequirements; - VkResult result; - } *params = args; - VkVideoSessionMemoryRequirementsKHR *pMemoryRequirements_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->videoSession), params->pMemoryRequirementsCount, params->pMemoryRequirements); - - init_conversion_context(ctx); - pMemoryRequirements_host = convert_VkVideoSessionMemoryRequirementsKHR_array_win32_to_host(ctx, (VkVideoSessionMemoryRequirementsKHR32 *)UlongToPtr(params->pMemoryRequirements), *(uint32_t *)UlongToPtr(params->pMemoryRequirementsCount)); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetVideoSessionMemoryRequirementsKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->videoSession, (uint32_t *)UlongToPtr(params->pMemoryRequirementsCount), pMemoryRequirements_host); - convert_VkVideoSessionMemoryRequirementsKHR_array_host_to_win32(pMemoryRequirements_host, (VkVideoSessionMemoryRequirementsKHR32 *)UlongToPtr(params->pMemoryRequirements), *(uint32_t *)UlongToPtr(params->pMemoryRequirementsCount)); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkInitializePerformanceApiINTEL(void *args) -{ - struct vkInitializePerformanceApiINTEL_params *params = args; - - TRACE("%p, %p\n", params->device, params->pInitializeInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkInitializePerformanceApiINTEL(vulkan_device_from_handle(params->device)->host.device, params->pInitializeInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkInitializePerformanceApiINTEL(void *args) -{ - struct - { - PTR32 device; - PTR32 pInitializeInfo; - VkResult result; - } *params = args; - VkInitializePerformanceApiInfoINTEL pInitializeInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pInitializeInfo); - - convert_VkInitializePerformanceApiInfoINTEL_win32_to_host((const VkInitializePerformanceApiInfoINTEL32 *)UlongToPtr(params->pInitializeInfo), &pInitializeInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkInitializePerformanceApiINTEL(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInitializeInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkInvalidateMappedMemoryRanges(void *args) -{ - struct vkInvalidateMappedMemoryRanges_params *params = args; - const VkMappedMemoryRange *pMemoryRanges_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p\n", params->device, params->memoryRangeCount, params->pMemoryRanges); - - init_conversion_context(ctx); - pMemoryRanges_host = convert_VkMappedMemoryRange_array_win64_to_host(ctx, params->pMemoryRanges, params->memoryRangeCount); - params->result = vulkan_device_from_handle(params->device)->p_vkInvalidateMappedMemoryRanges(vulkan_device_from_handle(params->device)->host.device, params->memoryRangeCount, pMemoryRanges_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkInvalidateMappedMemoryRanges(void *args) -{ - struct - { - PTR32 device; - uint32_t memoryRangeCount; - PTR32 pMemoryRanges; - VkResult result; - } *params = args; - const VkMappedMemoryRange *pMemoryRanges_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x\n", params->device, params->memoryRangeCount, params->pMemoryRanges); - - init_conversion_context(ctx); - pMemoryRanges_host = convert_VkMappedMemoryRange_array_win32_to_host(ctx, (const VkMappedMemoryRange32 *)UlongToPtr(params->pMemoryRanges), params->memoryRangeCount); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkInvalidateMappedMemoryRanges(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->memoryRangeCount, pMemoryRanges_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkLatencySleepNV(void *args) -{ - struct vkLatencySleepNV_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pSleepInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkLatencySleepNV(vulkan_device_from_handle(params->device)->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, params->pSleepInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkLatencySleepNV(void *args) -{ - struct - { - PTR32 device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - PTR32 pSleepInfo; - VkResult result; - } *params = args; - VkLatencySleepInfoNV pSleepInfo_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pSleepInfo); - - convert_VkLatencySleepInfoNV_win32_to_host((const VkLatencySleepInfoNV32 *)UlongToPtr(params->pSleepInfo), &pSleepInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkLatencySleepNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, &pSleepInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkMapMemory(void *args) -{ - struct vkMapMemory_params *params = args; - - TRACE("%p, 0x%s, 0x%s, 0x%s, %#x, %p\n", params->device, wine_dbgstr_longlong(params->memory), wine_dbgstr_longlong(params->offset), wine_dbgstr_longlong(params->size), params->flags, params->ppData); - - params->result = wine_vkMapMemory(params->device, params->memory, params->offset, params->size, params->flags, params->ppData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkMapMemory(void *args) -{ - struct - { - PTR32 device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - VkDeviceSize DECLSPEC_ALIGN(8) offset; - VkDeviceSize DECLSPEC_ALIGN(8) size; - VkMemoryMapFlags flags; - PTR32 ppData; - VkResult result; - } *params = args; - void *ppData_host; - - TRACE("%#x, 0x%s, 0x%s, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->memory), wine_dbgstr_longlong(params->offset), wine_dbgstr_longlong(params->size), params->flags, params->ppData); - - ppData_host = UlongToPtr(*(PTR32 *)UlongToPtr(params->ppData)); - params->result = wine_vkMapMemory((VkDevice)UlongToPtr(params->device), params->memory, params->offset, params->size, params->flags, &ppData_host); - *(PTR32 *)UlongToPtr(params->ppData) = PtrToUlong(ppData_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkMapMemory2(void *args) -{ - struct vkMapMemory2_params *params = args; - VkMemoryMapInfo pMemoryMapInfo_host; - - TRACE("%p, %p, %p\n", params->device, params->pMemoryMapInfo, params->ppData); - - convert_VkMemoryMapInfo_win64_to_host(params->pMemoryMapInfo, &pMemoryMapInfo_host); - params->result = vulkan_device_from_handle(params->device)->p_vkMapMemory2(vulkan_device_from_handle(params->device)->host.device, &pMemoryMapInfo_host, params->ppData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkMapMemory2(void *args) -{ - struct - { - PTR32 device; - PTR32 pMemoryMapInfo; - PTR32 ppData; - VkResult result; - } *params = args; - VkMemoryMapInfo pMemoryMapInfo_host; - void *ppData_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pMemoryMapInfo, params->ppData); - - init_conversion_context(ctx); - convert_VkMemoryMapInfo_win32_to_host(ctx, (const VkMemoryMapInfo32 *)UlongToPtr(params->pMemoryMapInfo), &pMemoryMapInfo_host); - ppData_host = UlongToPtr(*(PTR32 *)UlongToPtr(params->ppData)); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkMapMemory2(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pMemoryMapInfo_host, &ppData_host); - *(PTR32 *)UlongToPtr(params->ppData) = PtrToUlong(ppData_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkMapMemory2KHR(void *args) -{ - struct vkMapMemory2KHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pMemoryMapInfo, params->ppData); - - params->result = wine_vkMapMemory2KHR(params->device, params->pMemoryMapInfo, params->ppData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkMapMemory2KHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pMemoryMapInfo; - PTR32 ppData; - VkResult result; - } *params = args; - VkMemoryMapInfo pMemoryMapInfo_host; - void *ppData_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x\n", params->device, params->pMemoryMapInfo, params->ppData); - - init_conversion_context(ctx); - convert_VkMemoryMapInfo_win32_to_unwrapped_host(ctx, (const VkMemoryMapInfo32 *)UlongToPtr(params->pMemoryMapInfo), &pMemoryMapInfo_host); - ppData_host = UlongToPtr(*(PTR32 *)UlongToPtr(params->ppData)); - params->result = wine_vkMapMemory2KHR((VkDevice)UlongToPtr(params->device), &pMemoryMapInfo_host, &ppData_host); - *(PTR32 *)UlongToPtr(params->ppData) = PtrToUlong(ppData_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkMergePipelineCaches(void *args) -{ - struct vkMergePipelineCaches_params *params = args; - - TRACE("%p, 0x%s, %u, %p\n", params->device, wine_dbgstr_longlong(params->dstCache), params->srcCacheCount, params->pSrcCaches); - - params->result = vulkan_device_from_handle(params->device)->p_vkMergePipelineCaches(vulkan_device_from_handle(params->device)->host.device, params->dstCache, params->srcCacheCount, params->pSrcCaches); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkMergePipelineCaches(void *args) -{ - struct - { - PTR32 device; - VkPipelineCache DECLSPEC_ALIGN(8) dstCache; - uint32_t srcCacheCount; - PTR32 pSrcCaches; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->dstCache), params->srcCacheCount, params->pSrcCaches); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkMergePipelineCaches(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->dstCache, params->srcCacheCount, (const VkPipelineCache *)UlongToPtr(params->pSrcCaches)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkMergeValidationCachesEXT(void *args) -{ - struct vkMergeValidationCachesEXT_params *params = args; - - TRACE("%p, 0x%s, %u, %p\n", params->device, wine_dbgstr_longlong(params->dstCache), params->srcCacheCount, params->pSrcCaches); - - params->result = vulkan_device_from_handle(params->device)->p_vkMergeValidationCachesEXT(vulkan_device_from_handle(params->device)->host.device, params->dstCache, params->srcCacheCount, params->pSrcCaches); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkMergeValidationCachesEXT(void *args) -{ - struct - { - PTR32 device; - VkValidationCacheEXT DECLSPEC_ALIGN(8) dstCache; - uint32_t srcCacheCount; - PTR32 pSrcCaches; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->dstCache), params->srcCacheCount, params->pSrcCaches); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkMergeValidationCachesEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->dstCache, params->srcCacheCount, (const VkValidationCacheEXT *)UlongToPtr(params->pSrcCaches)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueBeginDebugUtilsLabelEXT(void *args) -{ - struct vkQueueBeginDebugUtilsLabelEXT_params *params = args; - - TRACE("%p, %p\n", params->queue, params->pLabelInfo); - - vulkan_queue_from_handle(params->queue)->device->p_vkQueueBeginDebugUtilsLabelEXT(vulkan_queue_from_handle(params->queue)->host.queue, params->pLabelInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueBeginDebugUtilsLabelEXT(void *args) -{ - struct - { - PTR32 queue; - PTR32 pLabelInfo; - } *params = args; - VkDebugUtilsLabelEXT pLabelInfo_host; - - TRACE("%#x, %#x\n", params->queue, params->pLabelInfo); - - convert_VkDebugUtilsLabelEXT_win32_to_host((const VkDebugUtilsLabelEXT32 *)UlongToPtr(params->pLabelInfo), &pLabelInfo_host); - vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->p_vkQueueBeginDebugUtilsLabelEXT(vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host.queue, &pLabelInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueBindSparse(void *args) -{ - struct vkQueueBindSparse_params *params = args; - const VkBindSparseInfo *pBindInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p, 0x%s\n", params->queue, params->bindInfoCount, params->pBindInfo, wine_dbgstr_longlong(params->fence)); - - init_conversion_context(ctx); - pBindInfo_host = convert_VkBindSparseInfo_array_win64_to_host(ctx, params->pBindInfo, params->bindInfoCount); - params->result = vulkan_queue_from_handle(params->queue)->device->p_vkQueueBindSparse(vulkan_queue_from_handle(params->queue)->host.queue, params->bindInfoCount, pBindInfo_host, params->fence); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueBindSparse(void *args) -{ - struct - { - PTR32 queue; - uint32_t bindInfoCount; - PTR32 pBindInfo; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; - } *params = args; - const VkBindSparseInfo *pBindInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x, 0x%s\n", params->queue, params->bindInfoCount, params->pBindInfo, wine_dbgstr_longlong(params->fence)); - - init_conversion_context(ctx); - pBindInfo_host = convert_VkBindSparseInfo_array_win32_to_host(ctx, (const VkBindSparseInfo32 *)UlongToPtr(params->pBindInfo), params->bindInfoCount); - params->result = vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->p_vkQueueBindSparse(vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host.queue, params->bindInfoCount, pBindInfo_host, params->fence); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueEndDebugUtilsLabelEXT(void *args) -{ - struct vkQueueEndDebugUtilsLabelEXT_params *params = args; - - TRACE("%p\n", params->queue); - - vulkan_queue_from_handle(params->queue)->device->p_vkQueueEndDebugUtilsLabelEXT(vulkan_queue_from_handle(params->queue)->host.queue); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueEndDebugUtilsLabelEXT(void *args) -{ - struct - { - PTR32 queue; - } *params = args; - - TRACE("%#x\n", params->queue); - - vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->p_vkQueueEndDebugUtilsLabelEXT(vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host.queue); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueInsertDebugUtilsLabelEXT(void *args) -{ - struct vkQueueInsertDebugUtilsLabelEXT_params *params = args; - - TRACE("%p, %p\n", params->queue, params->pLabelInfo); - - vulkan_queue_from_handle(params->queue)->device->p_vkQueueInsertDebugUtilsLabelEXT(vulkan_queue_from_handle(params->queue)->host.queue, params->pLabelInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueInsertDebugUtilsLabelEXT(void *args) -{ - struct - { - PTR32 queue; - PTR32 pLabelInfo; - } *params = args; - VkDebugUtilsLabelEXT pLabelInfo_host; - - TRACE("%#x, %#x\n", params->queue, params->pLabelInfo); - - convert_VkDebugUtilsLabelEXT_win32_to_host((const VkDebugUtilsLabelEXT32 *)UlongToPtr(params->pLabelInfo), &pLabelInfo_host); - vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->p_vkQueueInsertDebugUtilsLabelEXT(vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host.queue, &pLabelInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueNotifyOutOfBandNV(void *args) -{ - struct vkQueueNotifyOutOfBandNV_params *params = args; - - TRACE("%p, %p\n", params->queue, params->pQueueTypeInfo); - - vulkan_queue_from_handle(params->queue)->device->p_vkQueueNotifyOutOfBandNV(vulkan_queue_from_handle(params->queue)->host.queue, params->pQueueTypeInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueNotifyOutOfBandNV(void *args) -{ - struct - { - PTR32 queue; - PTR32 pQueueTypeInfo; - } *params = args; - VkOutOfBandQueueTypeInfoNV pQueueTypeInfo_host; - - TRACE("%#x, %#x\n", params->queue, params->pQueueTypeInfo); - - convert_VkOutOfBandQueueTypeInfoNV_win32_to_host((const VkOutOfBandQueueTypeInfoNV32 *)UlongToPtr(params->pQueueTypeInfo), &pQueueTypeInfo_host); - vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->p_vkQueueNotifyOutOfBandNV(vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host.queue, &pQueueTypeInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueuePresentKHR(void *args) -{ - struct vkQueuePresentKHR_params *params = args; - - TRACE("%p, %p\n", params->queue, params->pPresentInfo); - - params->result = vk_funcs->p_vkQueuePresentKHR(params->queue, params->pPresentInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueuePresentKHR(void *args) -{ - struct - { - PTR32 queue; - PTR32 pPresentInfo; - VkResult result; - } *params = args; - VkPresentInfoKHR pPresentInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x\n", params->queue, params->pPresentInfo); - - init_conversion_context(ctx); - convert_VkPresentInfoKHR_win32_to_unwrapped_host(ctx, (const VkPresentInfoKHR32 *)UlongToPtr(params->pPresentInfo), &pPresentInfo_host); - params->result = vk_funcs->p_vkQueuePresentKHR((VkQueue)UlongToPtr(params->queue), &pPresentInfo_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueSetPerformanceConfigurationINTEL(void *args) -{ - struct vkQueueSetPerformanceConfigurationINTEL_params *params = args; - - TRACE("%p, 0x%s\n", params->queue, wine_dbgstr_longlong(params->configuration)); - - params->result = vulkan_queue_from_handle(params->queue)->device->p_vkQueueSetPerformanceConfigurationINTEL(vulkan_queue_from_handle(params->queue)->host.queue, params->configuration); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueSetPerformanceConfigurationINTEL(void *args) -{ - struct - { - PTR32 queue; - VkPerformanceConfigurationINTEL DECLSPEC_ALIGN(8) configuration; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s\n", params->queue, wine_dbgstr_longlong(params->configuration)); - - params->result = vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->p_vkQueueSetPerformanceConfigurationINTEL(vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host.queue, params->configuration); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueSubmit(void *args) -{ - struct vkQueueSubmit_params *params = args; - const VkSubmitInfo *pSubmits_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p, 0x%s\n", params->queue, params->submitCount, params->pSubmits, wine_dbgstr_longlong(params->fence)); - - init_conversion_context(ctx); - pSubmits_host = convert_VkSubmitInfo_array_win64_to_host(ctx, params->pSubmits, params->submitCount); - params->result = vulkan_queue_from_handle(params->queue)->device->p_vkQueueSubmit(vulkan_queue_from_handle(params->queue)->host.queue, params->submitCount, pSubmits_host, params->fence); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueSubmit(void *args) -{ - struct - { - PTR32 queue; - uint32_t submitCount; - PTR32 pSubmits; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; - } *params = args; - const VkSubmitInfo *pSubmits_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x, 0x%s\n", params->queue, params->submitCount, params->pSubmits, wine_dbgstr_longlong(params->fence)); - - init_conversion_context(ctx); - pSubmits_host = convert_VkSubmitInfo_array_win32_to_host(ctx, (const VkSubmitInfo32 *)UlongToPtr(params->pSubmits), params->submitCount); - params->result = vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->p_vkQueueSubmit(vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host.queue, params->submitCount, pSubmits_host, params->fence); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueSubmit2(void *args) -{ - struct vkQueueSubmit2_params *params = args; - const VkSubmitInfo2 *pSubmits_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p, 0x%s\n", params->queue, params->submitCount, params->pSubmits, wine_dbgstr_longlong(params->fence)); - - init_conversion_context(ctx); - pSubmits_host = convert_VkSubmitInfo2_array_win64_to_host(ctx, params->pSubmits, params->submitCount); - params->result = vulkan_queue_from_handle(params->queue)->device->p_vkQueueSubmit2(vulkan_queue_from_handle(params->queue)->host.queue, params->submitCount, pSubmits_host, params->fence); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueSubmit2(void *args) -{ - struct - { - PTR32 queue; - uint32_t submitCount; - PTR32 pSubmits; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; - } *params = args; - const VkSubmitInfo2 *pSubmits_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x, 0x%s\n", params->queue, params->submitCount, params->pSubmits, wine_dbgstr_longlong(params->fence)); - - init_conversion_context(ctx); - pSubmits_host = convert_VkSubmitInfo2_array_win32_to_host(ctx, (const VkSubmitInfo232 *)UlongToPtr(params->pSubmits), params->submitCount); - params->result = vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->p_vkQueueSubmit2(vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host.queue, params->submitCount, pSubmits_host, params->fence); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueSubmit2KHR(void *args) -{ - struct vkQueueSubmit2KHR_params *params = args; - const VkSubmitInfo2 *pSubmits_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p, 0x%s\n", params->queue, params->submitCount, params->pSubmits, wine_dbgstr_longlong(params->fence)); - - init_conversion_context(ctx); - pSubmits_host = convert_VkSubmitInfo2_array_win64_to_host(ctx, params->pSubmits, params->submitCount); - params->result = vulkan_queue_from_handle(params->queue)->device->p_vkQueueSubmit2KHR(vulkan_queue_from_handle(params->queue)->host.queue, params->submitCount, pSubmits_host, params->fence); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueSubmit2KHR(void *args) -{ - struct - { - PTR32 queue; - uint32_t submitCount; - PTR32 pSubmits; - VkFence DECLSPEC_ALIGN(8) fence; - VkResult result; - } *params = args; - const VkSubmitInfo2 *pSubmits_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x, 0x%s\n", params->queue, params->submitCount, params->pSubmits, wine_dbgstr_longlong(params->fence)); - - init_conversion_context(ctx); - pSubmits_host = convert_VkSubmitInfo2_array_win32_to_host(ctx, (const VkSubmitInfo232 *)UlongToPtr(params->pSubmits), params->submitCount); - params->result = vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->p_vkQueueSubmit2KHR(vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host.queue, params->submitCount, pSubmits_host, params->fence); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkQueueWaitIdle(void *args) -{ - struct vkQueueWaitIdle_params *params = args; - - TRACE("%p\n", params->queue); - - params->result = vulkan_queue_from_handle(params->queue)->device->p_vkQueueWaitIdle(vulkan_queue_from_handle(params->queue)->host.queue); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkQueueWaitIdle(void *args) -{ - struct - { - PTR32 queue; - VkResult result; - } *params = args; - - TRACE("%#x\n", params->queue); - - params->result = vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->p_vkQueueWaitIdle(vulkan_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host.queue); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkReleaseCapturedPipelineDataKHR(void *args) -{ - struct vkReleaseCapturedPipelineDataKHR_params *params = args; - - TRACE("%p, %p, %p\n", params->device, params->pInfo, params->pAllocator); - - params->result = vulkan_device_from_handle(params->device)->p_vkReleaseCapturedPipelineDataKHR(vulkan_device_from_handle(params->device)->host.device, params->pInfo, NULL); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkReleaseCapturedPipelineDataKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pInfo; - PTR32 pAllocator; - VkResult result; - } *params = args; - VkReleaseCapturedPipelineDataInfoKHR pInfo_host; - - TRACE("%#x, %#x, %#x\n", params->device, params->pInfo, params->pAllocator); - - convert_VkReleaseCapturedPipelineDataInfoKHR_win32_to_host((const VkReleaseCapturedPipelineDataInfoKHR32 *)UlongToPtr(params->pInfo), &pInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkReleaseCapturedPipelineDataKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pInfo_host, NULL); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkReleasePerformanceConfigurationINTEL(void *args) -{ - struct vkReleasePerformanceConfigurationINTEL_params *params = args; - - TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->configuration)); - - params->result = vulkan_device_from_handle(params->device)->p_vkReleasePerformanceConfigurationINTEL(vulkan_device_from_handle(params->device)->host.device, params->configuration); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkReleasePerformanceConfigurationINTEL(void *args) -{ - struct - { - PTR32 device; - VkPerformanceConfigurationINTEL DECLSPEC_ALIGN(8) configuration; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->configuration)); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkReleasePerformanceConfigurationINTEL(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->configuration); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkReleaseProfilingLockKHR(void *args) -{ - struct vkReleaseProfilingLockKHR_params *params = args; - - TRACE("%p\n", params->device); - - vulkan_device_from_handle(params->device)->p_vkReleaseProfilingLockKHR(vulkan_device_from_handle(params->device)->host.device); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkReleaseProfilingLockKHR(void *args) -{ - struct - { - PTR32 device; - } *params = args; - - TRACE("%#x\n", params->device); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkReleaseProfilingLockKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkReleaseSwapchainImagesEXT(void *args) -{ - struct vkReleaseSwapchainImagesEXT_params *params = args; - VkReleaseSwapchainImagesInfoEXT pReleaseInfo_host; - - TRACE("%p, %p\n", params->device, params->pReleaseInfo); - - convert_VkReleaseSwapchainImagesInfoEXT_win64_to_host(params->pReleaseInfo, &pReleaseInfo_host); - params->result = vulkan_device_from_handle(params->device)->p_vkReleaseSwapchainImagesEXT(vulkan_device_from_handle(params->device)->host.device, &pReleaseInfo_host); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkReleaseSwapchainImagesEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pReleaseInfo; - VkResult result; - } *params = args; - VkReleaseSwapchainImagesInfoEXT pReleaseInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pReleaseInfo); - - convert_VkReleaseSwapchainImagesInfoEXT_win32_to_host((const VkReleaseSwapchainImagesInfoEXT32 *)UlongToPtr(params->pReleaseInfo), &pReleaseInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkReleaseSwapchainImagesEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pReleaseInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkResetCommandBuffer(void *args) -{ - struct vkResetCommandBuffer_params *params = args; - - TRACE("%p, %#x\n", params->commandBuffer, params->flags); - - params->result = wine_cmd_buffer_from_handle(params->commandBuffer)->device->p_vkResetCommandBuffer(wine_cmd_buffer_from_handle(params->commandBuffer)->host.command_buffer, params->flags); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkResetCommandBuffer(void *args) -{ - struct - { - PTR32 commandBuffer; - VkCommandBufferResetFlags flags; - VkResult result; - } *params = args; - - TRACE("%#x, %#x\n", params->commandBuffer, params->flags); - - params->result = wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->device->p_vkResetCommandBuffer(wine_cmd_buffer_from_handle((VkCommandBuffer)UlongToPtr(params->commandBuffer))->host.command_buffer, params->flags); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkResetCommandPool(void *args) -{ - struct vkResetCommandPool_params *params = args; - - TRACE("%p, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->commandPool), params->flags); - - params->result = vulkan_device_from_handle(params->device)->p_vkResetCommandPool(vulkan_device_from_handle(params->device)->host.device, wine_cmd_pool_from_handle(params->commandPool)->host.command_pool, params->flags); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkResetCommandPool(void *args) -{ - struct - { - PTR32 device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - VkCommandPoolResetFlags flags; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->commandPool), params->flags); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkResetCommandPool(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, wine_cmd_pool_from_handle(params->commandPool)->host.command_pool, params->flags); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkResetDescriptorPool(void *args) -{ - struct vkResetDescriptorPool_params *params = args; - - TRACE("%p, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->descriptorPool), params->flags); - - params->result = vulkan_device_from_handle(params->device)->p_vkResetDescriptorPool(vulkan_device_from_handle(params->device)->host.device, params->descriptorPool, params->flags); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkResetDescriptorPool(void *args) -{ - struct - { - PTR32 device; - VkDescriptorPool DECLSPEC_ALIGN(8) descriptorPool; - VkDescriptorPoolResetFlags flags; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->descriptorPool), params->flags); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkResetDescriptorPool(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->descriptorPool, params->flags); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkResetEvent(void *args) -{ - struct vkResetEvent_params *params = args; - - TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->event)); - - params->result = vulkan_device_from_handle(params->device)->p_vkResetEvent(vulkan_device_from_handle(params->device)->host.device, params->event); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkResetEvent(void *args) -{ - struct - { - PTR32 device; - VkEvent DECLSPEC_ALIGN(8) event; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->event)); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkResetEvent(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->event); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkResetFences(void *args) -{ - struct vkResetFences_params *params = args; - - TRACE("%p, %u, %p\n", params->device, params->fenceCount, params->pFences); - - params->result = vulkan_device_from_handle(params->device)->p_vkResetFences(vulkan_device_from_handle(params->device)->host.device, params->fenceCount, params->pFences); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkResetFences(void *args) -{ - struct - { - PTR32 device; - uint32_t fenceCount; - PTR32 pFences; - VkResult result; - } *params = args; - - TRACE("%#x, %u, %#x\n", params->device, params->fenceCount, params->pFences); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkResetFences(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->fenceCount, (const VkFence *)UlongToPtr(params->pFences)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkResetQueryPool(void *args) -{ - struct vkResetQueryPool_params *params = args; - - TRACE("%p, 0x%s, %u, %u\n", params->device, wine_dbgstr_longlong(params->queryPool), params->firstQuery, params->queryCount); - - vulkan_device_from_handle(params->device)->p_vkResetQueryPool(vulkan_device_from_handle(params->device)->host.device, params->queryPool, params->firstQuery, params->queryCount); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkResetQueryPool(void *args) -{ - struct - { - PTR32 device; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; - } *params = args; - - TRACE("%#x, 0x%s, %u, %u\n", params->device, wine_dbgstr_longlong(params->queryPool), params->firstQuery, params->queryCount); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkResetQueryPool(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->queryPool, params->firstQuery, params->queryCount); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkResetQueryPoolEXT(void *args) -{ - struct vkResetQueryPoolEXT_params *params = args; - - TRACE("%p, 0x%s, %u, %u\n", params->device, wine_dbgstr_longlong(params->queryPool), params->firstQuery, params->queryCount); - - vulkan_device_from_handle(params->device)->p_vkResetQueryPoolEXT(vulkan_device_from_handle(params->device)->host.device, params->queryPool, params->firstQuery, params->queryCount); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkResetQueryPoolEXT(void *args) -{ - struct - { - PTR32 device; - VkQueryPool DECLSPEC_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; - } *params = args; - - TRACE("%#x, 0x%s, %u, %u\n", params->device, wine_dbgstr_longlong(params->queryPool), params->firstQuery, params->queryCount); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkResetQueryPoolEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->queryPool, params->firstQuery, params->queryCount); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSetDebugUtilsObjectNameEXT(void *args) -{ - struct vkSetDebugUtilsObjectNameEXT_params *params = args; - VkDebugUtilsObjectNameInfoEXT pNameInfo_host; - - TRACE("%p, %p\n", params->device, params->pNameInfo); - - convert_VkDebugUtilsObjectNameInfoEXT_win64_to_host(params->pNameInfo, &pNameInfo_host); - params->result = vulkan_device_from_handle(params->device)->p_vkSetDebugUtilsObjectNameEXT(vulkan_device_from_handle(params->device)->host.device, &pNameInfo_host); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSetDebugUtilsObjectNameEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pNameInfo; - VkResult result; - } *params = args; - VkDebugUtilsObjectNameInfoEXT pNameInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pNameInfo); - - convert_VkDebugUtilsObjectNameInfoEXT_win32_to_host((const VkDebugUtilsObjectNameInfoEXT32 *)UlongToPtr(params->pNameInfo), &pNameInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkSetDebugUtilsObjectNameEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pNameInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSetDebugUtilsObjectTagEXT(void *args) -{ - struct vkSetDebugUtilsObjectTagEXT_params *params = args; - VkDebugUtilsObjectTagInfoEXT pTagInfo_host; - - TRACE("%p, %p\n", params->device, params->pTagInfo); - - convert_VkDebugUtilsObjectTagInfoEXT_win64_to_host(params->pTagInfo, &pTagInfo_host); - params->result = vulkan_device_from_handle(params->device)->p_vkSetDebugUtilsObjectTagEXT(vulkan_device_from_handle(params->device)->host.device, &pTagInfo_host); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSetDebugUtilsObjectTagEXT(void *args) -{ - struct - { - PTR32 device; - PTR32 pTagInfo; - VkResult result; - } *params = args; - VkDebugUtilsObjectTagInfoEXT pTagInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pTagInfo); - - convert_VkDebugUtilsObjectTagInfoEXT_win32_to_host((const VkDebugUtilsObjectTagInfoEXT32 *)UlongToPtr(params->pTagInfo), &pTagInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkSetDebugUtilsObjectTagEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pTagInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSetDeviceMemoryPriorityEXT(void *args) -{ - struct vkSetDeviceMemoryPriorityEXT_params *params = args; - - TRACE("%p, 0x%s, %f\n", params->device, wine_dbgstr_longlong(params->memory), params->priority); - - vulkan_device_from_handle(params->device)->p_vkSetDeviceMemoryPriorityEXT(vulkan_device_from_handle(params->device)->host.device, wine_device_memory_from_handle(params->memory)->host.device_memory, params->priority); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSetDeviceMemoryPriorityEXT(void *args) -{ - struct - { - PTR32 device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - float priority; - } *params = args; - - TRACE("%#x, 0x%s, %f\n", params->device, wine_dbgstr_longlong(params->memory), params->priority); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkSetDeviceMemoryPriorityEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, wine_device_memory_from_handle(params->memory)->host.device_memory, params->priority); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSetEvent(void *args) -{ - struct vkSetEvent_params *params = args; - - TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->event)); - - params->result = vulkan_device_from_handle(params->device)->p_vkSetEvent(vulkan_device_from_handle(params->device)->host.device, params->event); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSetEvent(void *args) -{ - struct - { - PTR32 device; - VkEvent DECLSPEC_ALIGN(8) event; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->event)); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkSetEvent(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->event); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSetHdrMetadataEXT(void *args) -{ - struct vkSetHdrMetadataEXT_params *params = args; - const VkSwapchainKHR *pSwapchains_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %u, %p, %p\n", params->device, params->swapchainCount, params->pSwapchains, params->pMetadata); - - init_conversion_context(ctx); - pSwapchains_host = convert_VkSwapchainKHR_array_win64_to_host(ctx, params->pSwapchains, params->swapchainCount); - vulkan_device_from_handle(params->device)->p_vkSetHdrMetadataEXT(vulkan_device_from_handle(params->device)->host.device, params->swapchainCount, pSwapchains_host, params->pMetadata); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSetHdrMetadataEXT(void *args) -{ - struct - { - PTR32 device; - uint32_t swapchainCount; - PTR32 pSwapchains; - PTR32 pMetadata; - } *params = args; - const VkSwapchainKHR *pSwapchains_host; - const VkHdrMetadataEXT *pMetadata_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x, %#x\n", params->device, params->swapchainCount, params->pSwapchains, params->pMetadata); - - init_conversion_context(ctx); - pSwapchains_host = convert_VkSwapchainKHR_array_win32_to_host(ctx, (const VkSwapchainKHR *)UlongToPtr(params->pSwapchains), params->swapchainCount); - pMetadata_host = convert_VkHdrMetadataEXT_array_win32_to_host(ctx, (const VkHdrMetadataEXT32 *)UlongToPtr(params->pMetadata), params->swapchainCount); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkSetHdrMetadataEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->swapchainCount, pSwapchains_host, pMetadata_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSetLatencyMarkerNV(void *args) -{ - struct vkSetLatencyMarkerNV_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pLatencyMarkerInfo); - - vulkan_device_from_handle(params->device)->p_vkSetLatencyMarkerNV(vulkan_device_from_handle(params->device)->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, params->pLatencyMarkerInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSetLatencyMarkerNV(void *args) -{ - struct - { - PTR32 device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - PTR32 pLatencyMarkerInfo; - } *params = args; - VkSetLatencyMarkerInfoNV pLatencyMarkerInfo_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pLatencyMarkerInfo); - - convert_VkSetLatencyMarkerInfoNV_win32_to_host((const VkSetLatencyMarkerInfoNV32 *)UlongToPtr(params->pLatencyMarkerInfo), &pLatencyMarkerInfo_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkSetLatencyMarkerNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, &pLatencyMarkerInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSetLatencySleepModeNV(void *args) -{ - struct vkSetLatencySleepModeNV_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pSleepModeInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkSetLatencySleepModeNV(vulkan_device_from_handle(params->device)->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, params->pSleepModeInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSetLatencySleepModeNV(void *args) -{ - struct - { - PTR32 device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - PTR32 pSleepModeInfo; - VkResult result; - } *params = args; - VkLatencySleepModeInfoNV pSleepModeInfo_host; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pSleepModeInfo); - - convert_VkLatencySleepModeInfoNV_win32_to_host((const VkLatencySleepModeInfoNV32 *)UlongToPtr(params->pSleepModeInfo), &pSleepModeInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkSetLatencySleepModeNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, &pSleepModeInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSetPrivateData(void *args) -{ - struct vkSetPrivateData_params *params = args; - - TRACE("%p, %#x, 0x%s, 0x%s, 0x%s\n", params->device, params->objectType, wine_dbgstr_longlong(params->objectHandle), wine_dbgstr_longlong(params->privateDataSlot), wine_dbgstr_longlong(params->data)); - - params->result = vulkan_device_from_handle(params->device)->p_vkSetPrivateData(vulkan_device_from_handle(params->device)->host.device, params->objectType, wine_vk_unwrap_handle(params->objectType, params->objectHandle), params->privateDataSlot, params->data); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSetPrivateData(void *args) -{ - struct - { - PTR32 device; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - uint64_t DECLSPEC_ALIGN(8) data; - VkResult result; - } *params = args; - - TRACE("%#x, %#x, 0x%s, 0x%s, 0x%s\n", params->device, params->objectType, wine_dbgstr_longlong(params->objectHandle), wine_dbgstr_longlong(params->privateDataSlot), wine_dbgstr_longlong(params->data)); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkSetPrivateData(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->objectType, wine_vk_unwrap_handle(params->objectType, params->objectHandle), params->privateDataSlot, params->data); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSetPrivateDataEXT(void *args) -{ - struct vkSetPrivateDataEXT_params *params = args; - - TRACE("%p, %#x, 0x%s, 0x%s, 0x%s\n", params->device, params->objectType, wine_dbgstr_longlong(params->objectHandle), wine_dbgstr_longlong(params->privateDataSlot), wine_dbgstr_longlong(params->data)); - - params->result = vulkan_device_from_handle(params->device)->p_vkSetPrivateDataEXT(vulkan_device_from_handle(params->device)->host.device, params->objectType, wine_vk_unwrap_handle(params->objectType, params->objectHandle), params->privateDataSlot, params->data); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSetPrivateDataEXT(void *args) -{ - struct - { - PTR32 device; - VkObjectType objectType; - uint64_t DECLSPEC_ALIGN(8) objectHandle; - VkPrivateDataSlot DECLSPEC_ALIGN(8) privateDataSlot; - uint64_t DECLSPEC_ALIGN(8) data; - VkResult result; - } *params = args; - - TRACE("%#x, %#x, 0x%s, 0x%s, 0x%s\n", params->device, params->objectType, wine_dbgstr_longlong(params->objectHandle), wine_dbgstr_longlong(params->privateDataSlot), wine_dbgstr_longlong(params->data)); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkSetPrivateDataEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->objectType, wine_vk_unwrap_handle(params->objectType, params->objectHandle), params->privateDataSlot, params->data); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSignalSemaphore(void *args) -{ - struct vkSignalSemaphore_params *params = args; - - TRACE("%p, %p\n", params->device, params->pSignalInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkSignalSemaphore(vulkan_device_from_handle(params->device)->host.device, params->pSignalInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSignalSemaphore(void *args) -{ - struct - { - PTR32 device; - PTR32 pSignalInfo; - VkResult result; - } *params = args; - VkSemaphoreSignalInfo pSignalInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pSignalInfo); - - convert_VkSemaphoreSignalInfo_win32_to_host((const VkSemaphoreSignalInfo32 *)UlongToPtr(params->pSignalInfo), &pSignalInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkSignalSemaphore(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pSignalInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSignalSemaphoreKHR(void *args) -{ - struct vkSignalSemaphoreKHR_params *params = args; - - TRACE("%p, %p\n", params->device, params->pSignalInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkSignalSemaphoreKHR(vulkan_device_from_handle(params->device)->host.device, params->pSignalInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSignalSemaphoreKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pSignalInfo; - VkResult result; - } *params = args; - VkSemaphoreSignalInfo pSignalInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pSignalInfo); - - convert_VkSemaphoreSignalInfo_win32_to_host((const VkSemaphoreSignalInfo32 *)UlongToPtr(params->pSignalInfo), &pSignalInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkSignalSemaphoreKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pSignalInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkSubmitDebugUtilsMessageEXT(void *args) -{ - struct vkSubmitDebugUtilsMessageEXT_params *params = args; - VkDebugUtilsMessengerCallbackDataEXT pCallbackData_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%p, %#x, %#x, %p\n", params->instance, params->messageSeverity, params->messageTypes, params->pCallbackData); - - init_conversion_context(ctx); - convert_VkDebugUtilsMessengerCallbackDataEXT_win64_to_host(ctx, params->pCallbackData, &pCallbackData_host); - vulkan_instance_from_handle(params->instance)->p_vkSubmitDebugUtilsMessageEXT(vulkan_instance_from_handle(params->instance)->host.instance, params->messageSeverity, params->messageTypes, &pCallbackData_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkSubmitDebugUtilsMessageEXT(void *args) -{ - struct - { - PTR32 instance; - VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity; - VkDebugUtilsMessageTypeFlagsEXT messageTypes; - PTR32 pCallbackData; - } *params = args; - VkDebugUtilsMessengerCallbackDataEXT pCallbackData_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %#x, %#x, %#x\n", params->instance, params->messageSeverity, params->messageTypes, params->pCallbackData); - - init_conversion_context(ctx); - convert_VkDebugUtilsMessengerCallbackDataEXT_win32_to_host(ctx, (const VkDebugUtilsMessengerCallbackDataEXT32 *)UlongToPtr(params->pCallbackData), &pCallbackData_host); - vulkan_instance_from_handle((VkInstance)UlongToPtr(params->instance))->p_vkSubmitDebugUtilsMessageEXT(vulkan_instance_from_handle((VkInstance)UlongToPtr(params->instance))->host.instance, params->messageSeverity, params->messageTypes, &pCallbackData_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkTransitionImageLayout(void *args) -{ - struct vkTransitionImageLayout_params *params = args; - - TRACE("%p, %u, %p\n", params->device, params->transitionCount, params->pTransitions); - - params->result = vulkan_device_from_handle(params->device)->p_vkTransitionImageLayout(vulkan_device_from_handle(params->device)->host.device, params->transitionCount, params->pTransitions); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkTransitionImageLayout(void *args) -{ - struct - { - PTR32 device; - uint32_t transitionCount; - PTR32 pTransitions; - VkResult result; - } *params = args; - const VkHostImageLayoutTransitionInfo *pTransitions_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x\n", params->device, params->transitionCount, params->pTransitions); - - init_conversion_context(ctx); - pTransitions_host = convert_VkHostImageLayoutTransitionInfo_array_win32_to_host(ctx, (const VkHostImageLayoutTransitionInfo32 *)UlongToPtr(params->pTransitions), params->transitionCount); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkTransitionImageLayout(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->transitionCount, pTransitions_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkTransitionImageLayoutEXT(void *args) -{ - struct vkTransitionImageLayoutEXT_params *params = args; - - TRACE("%p, %u, %p\n", params->device, params->transitionCount, params->pTransitions); - - params->result = vulkan_device_from_handle(params->device)->p_vkTransitionImageLayoutEXT(vulkan_device_from_handle(params->device)->host.device, params->transitionCount, params->pTransitions); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkTransitionImageLayoutEXT(void *args) -{ - struct - { - PTR32 device; - uint32_t transitionCount; - PTR32 pTransitions; - VkResult result; - } *params = args; - const VkHostImageLayoutTransitionInfo *pTransitions_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, %u, %#x\n", params->device, params->transitionCount, params->pTransitions); - - init_conversion_context(ctx); - pTransitions_host = convert_VkHostImageLayoutTransitionInfo_array_win32_to_host(ctx, (const VkHostImageLayoutTransitionInfo32 *)UlongToPtr(params->pTransitions), params->transitionCount); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkTransitionImageLayoutEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->transitionCount, pTransitions_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkTrimCommandPool(void *args) -{ - struct vkTrimCommandPool_params *params = args; - - TRACE("%p, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->commandPool), params->flags); - - vulkan_device_from_handle(params->device)->p_vkTrimCommandPool(vulkan_device_from_handle(params->device)->host.device, wine_cmd_pool_from_handle(params->commandPool)->host.command_pool, params->flags); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkTrimCommandPool(void *args) -{ - struct - { - PTR32 device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - VkCommandPoolTrimFlags flags; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->commandPool), params->flags); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkTrimCommandPool(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, wine_cmd_pool_from_handle(params->commandPool)->host.command_pool, params->flags); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkTrimCommandPoolKHR(void *args) -{ - struct vkTrimCommandPoolKHR_params *params = args; - - TRACE("%p, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->commandPool), params->flags); - - vulkan_device_from_handle(params->device)->p_vkTrimCommandPoolKHR(vulkan_device_from_handle(params->device)->host.device, wine_cmd_pool_from_handle(params->commandPool)->host.command_pool, params->flags); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkTrimCommandPoolKHR(void *args) -{ - struct - { - PTR32 device; - VkCommandPool DECLSPEC_ALIGN(8) commandPool; - VkCommandPoolTrimFlags flags; - } *params = args; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->commandPool), params->flags); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkTrimCommandPoolKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, wine_cmd_pool_from_handle(params->commandPool)->host.command_pool, params->flags); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkUninitializePerformanceApiINTEL(void *args) -{ - struct vkUninitializePerformanceApiINTEL_params *params = args; - - TRACE("%p\n", params->device); - - vulkan_device_from_handle(params->device)->p_vkUninitializePerformanceApiINTEL(vulkan_device_from_handle(params->device)->host.device); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkUninitializePerformanceApiINTEL(void *args) -{ - struct - { - PTR32 device; - } *params = args; - - TRACE("%#x\n", params->device); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkUninitializePerformanceApiINTEL(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkUnmapMemory(void *args) -{ - struct vkUnmapMemory_params *params = args; - - TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->memory)); - - wine_vkUnmapMemory(params->device, params->memory); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkUnmapMemory(void *args) -{ - struct - { - PTR32 device; - VkDeviceMemory DECLSPEC_ALIGN(8) memory; - } *params = args; - - TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->memory)); - - wine_vkUnmapMemory((VkDevice)UlongToPtr(params->device), params->memory); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkUnmapMemory2(void *args) -{ - struct vkUnmapMemory2_params *params = args; - VkMemoryUnmapInfo pMemoryUnmapInfo_host; - - TRACE("%p, %p\n", params->device, params->pMemoryUnmapInfo); - - convert_VkMemoryUnmapInfo_win64_to_host(params->pMemoryUnmapInfo, &pMemoryUnmapInfo_host); - params->result = vulkan_device_from_handle(params->device)->p_vkUnmapMemory2(vulkan_device_from_handle(params->device)->host.device, &pMemoryUnmapInfo_host); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkUnmapMemory2(void *args) -{ - struct - { - PTR32 device; - PTR32 pMemoryUnmapInfo; - VkResult result; - } *params = args; - VkMemoryUnmapInfo pMemoryUnmapInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pMemoryUnmapInfo); - - convert_VkMemoryUnmapInfo_win32_to_host((const VkMemoryUnmapInfo32 *)UlongToPtr(params->pMemoryUnmapInfo), &pMemoryUnmapInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkUnmapMemory2(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pMemoryUnmapInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkUnmapMemory2KHR(void *args) -{ - struct vkUnmapMemory2KHR_params *params = args; - - TRACE("%p, %p\n", params->device, params->pMemoryUnmapInfo); - - params->result = wine_vkUnmapMemory2KHR(params->device, params->pMemoryUnmapInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkUnmapMemory2KHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pMemoryUnmapInfo; - VkResult result; - } *params = args; - VkMemoryUnmapInfo pMemoryUnmapInfo_host; - - TRACE("%#x, %#x\n", params->device, params->pMemoryUnmapInfo); - - convert_VkMemoryUnmapInfo_win32_to_unwrapped_host((const VkMemoryUnmapInfo32 *)UlongToPtr(params->pMemoryUnmapInfo), &pMemoryUnmapInfo_host); - params->result = wine_vkUnmapMemory2KHR((VkDevice)UlongToPtr(params->device), &pMemoryUnmapInfo_host); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static void thunk64_vkUpdateDescriptorSetWithTemplate(void *args) -{ - struct vkUpdateDescriptorSetWithTemplate_params *params = args; - - vulkan_device_from_handle(params->device)->p_vkUpdateDescriptorSetWithTemplate(vulkan_device_from_handle(params->device)->host.device, params->descriptorSet, params->descriptorUpdateTemplate, params->pData); -} -#endif /* _WIN64 */ - -static void thunk32_vkUpdateDescriptorSetWithTemplate(void *args) -{ - struct - { - PTR32 device; - VkDescriptorSet DECLSPEC_ALIGN(8) descriptorSet; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - PTR32 pData; - } *params = args; - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkUpdateDescriptorSetWithTemplate(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->descriptorSet, params->descriptorUpdateTemplate, (const void *)UlongToPtr(params->pData)); -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkUpdateDescriptorSetWithTemplateKHR(void *args) -{ - struct vkUpdateDescriptorSetWithTemplateKHR_params *params = args; - - TRACE("%p, 0x%s, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->descriptorSet), wine_dbgstr_longlong(params->descriptorUpdateTemplate), params->pData); - - vulkan_device_from_handle(params->device)->p_vkUpdateDescriptorSetWithTemplateKHR(vulkan_device_from_handle(params->device)->host.device, params->descriptorSet, params->descriptorUpdateTemplate, params->pData); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkUpdateDescriptorSetWithTemplateKHR(void *args) -{ - struct - { - PTR32 device; - VkDescriptorSet DECLSPEC_ALIGN(8) descriptorSet; - VkDescriptorUpdateTemplate DECLSPEC_ALIGN(8) descriptorUpdateTemplate; - PTR32 pData; - } *params = args; - - TRACE("%#x, 0x%s, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->descriptorSet), wine_dbgstr_longlong(params->descriptorUpdateTemplate), params->pData); - - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkUpdateDescriptorSetWithTemplateKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->descriptorSet, params->descriptorUpdateTemplate, (const void *)UlongToPtr(params->pData)); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static void thunk64_vkUpdateDescriptorSets(void *args) -{ - struct vkUpdateDescriptorSets_params *params = args; - - vulkan_device_from_handle(params->device)->p_vkUpdateDescriptorSets(vulkan_device_from_handle(params->device)->host.device, params->descriptorWriteCount, params->pDescriptorWrites, params->descriptorCopyCount, params->pDescriptorCopies); -} -#endif /* _WIN64 */ - -static void thunk32_vkUpdateDescriptorSets(void *args) -{ - struct - { - PTR32 device; - uint32_t descriptorWriteCount; - PTR32 pDescriptorWrites; - uint32_t descriptorCopyCount; - PTR32 pDescriptorCopies; - } *params = args; - const VkWriteDescriptorSet *pDescriptorWrites_host; - const VkCopyDescriptorSet *pDescriptorCopies_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - init_conversion_context(ctx); - pDescriptorWrites_host = convert_VkWriteDescriptorSet_array_win32_to_host(ctx, (const VkWriteDescriptorSet32 *)UlongToPtr(params->pDescriptorWrites), params->descriptorWriteCount); - pDescriptorCopies_host = convert_VkCopyDescriptorSet_array_win32_to_host(ctx, (const VkCopyDescriptorSet32 *)UlongToPtr(params->pDescriptorCopies), params->descriptorCopyCount); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkUpdateDescriptorSets(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->descriptorWriteCount, pDescriptorWrites_host, params->descriptorCopyCount, pDescriptorCopies_host); - free_conversion_context(ctx); -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkUpdateIndirectExecutionSetPipelineEXT(void *args) -{ - struct vkUpdateIndirectExecutionSetPipelineEXT_params *params = args; - - TRACE("%p, 0x%s, %u, %p\n", params->device, wine_dbgstr_longlong(params->indirectExecutionSet), params->executionSetWriteCount, params->pExecutionSetWrites); - - vulkan_device_from_handle(params->device)->p_vkUpdateIndirectExecutionSetPipelineEXT(vulkan_device_from_handle(params->device)->host.device, params->indirectExecutionSet, params->executionSetWriteCount, params->pExecutionSetWrites); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkUpdateIndirectExecutionSetPipelineEXT(void *args) -{ - struct - { - PTR32 device; - VkIndirectExecutionSetEXT DECLSPEC_ALIGN(8) indirectExecutionSet; - uint32_t executionSetWriteCount; - PTR32 pExecutionSetWrites; - } *params = args; - const VkWriteIndirectExecutionSetPipelineEXT *pExecutionSetWrites_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->indirectExecutionSet), params->executionSetWriteCount, params->pExecutionSetWrites); - - init_conversion_context(ctx); - pExecutionSetWrites_host = convert_VkWriteIndirectExecutionSetPipelineEXT_array_win32_to_host(ctx, (const VkWriteIndirectExecutionSetPipelineEXT32 *)UlongToPtr(params->pExecutionSetWrites), params->executionSetWriteCount); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkUpdateIndirectExecutionSetPipelineEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->indirectExecutionSet, params->executionSetWriteCount, pExecutionSetWrites_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkUpdateIndirectExecutionSetShaderEXT(void *args) -{ - struct vkUpdateIndirectExecutionSetShaderEXT_params *params = args; - - TRACE("%p, 0x%s, %u, %p\n", params->device, wine_dbgstr_longlong(params->indirectExecutionSet), params->executionSetWriteCount, params->pExecutionSetWrites); - - vulkan_device_from_handle(params->device)->p_vkUpdateIndirectExecutionSetShaderEXT(vulkan_device_from_handle(params->device)->host.device, params->indirectExecutionSet, params->executionSetWriteCount, params->pExecutionSetWrites); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkUpdateIndirectExecutionSetShaderEXT(void *args) -{ - struct - { - PTR32 device; - VkIndirectExecutionSetEXT DECLSPEC_ALIGN(8) indirectExecutionSet; - uint32_t executionSetWriteCount; - PTR32 pExecutionSetWrites; - } *params = args; - const VkWriteIndirectExecutionSetShaderEXT *pExecutionSetWrites_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %u, %#x\n", params->device, wine_dbgstr_longlong(params->indirectExecutionSet), params->executionSetWriteCount, params->pExecutionSetWrites); - - init_conversion_context(ctx); - pExecutionSetWrites_host = convert_VkWriteIndirectExecutionSetShaderEXT_array_win32_to_host(ctx, (const VkWriteIndirectExecutionSetShaderEXT32 *)UlongToPtr(params->pExecutionSetWrites), params->executionSetWriteCount); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkUpdateIndirectExecutionSetShaderEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->indirectExecutionSet, params->executionSetWriteCount, pExecutionSetWrites_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkUpdateVideoSessionParametersKHR(void *args) -{ - struct vkUpdateVideoSessionParametersKHR_params *params = args; - - TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->videoSessionParameters), params->pUpdateInfo); - - params->result = vulkan_device_from_handle(params->device)->p_vkUpdateVideoSessionParametersKHR(vulkan_device_from_handle(params->device)->host.device, params->videoSessionParameters, params->pUpdateInfo); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkUpdateVideoSessionParametersKHR(void *args) -{ - struct - { - PTR32 device; - VkVideoSessionParametersKHR DECLSPEC_ALIGN(8) videoSessionParameters; - PTR32 pUpdateInfo; - VkResult result; - } *params = args; - VkVideoSessionParametersUpdateInfoKHR pUpdateInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; - - TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->videoSessionParameters), params->pUpdateInfo); - - init_conversion_context(ctx); - convert_VkVideoSessionParametersUpdateInfoKHR_win32_to_host(ctx, (const VkVideoSessionParametersUpdateInfoKHR32 *)UlongToPtr(params->pUpdateInfo), &pUpdateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkUpdateVideoSessionParametersKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->videoSessionParameters, &pUpdateInfo_host); - free_conversion_context(ctx); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkWaitForFences(void *args) -{ - struct vkWaitForFences_params *params = args; - - TRACE("%p, %u, %p, %u, 0x%s\n", params->device, params->fenceCount, params->pFences, params->waitAll, wine_dbgstr_longlong(params->timeout)); - - params->result = vulkan_device_from_handle(params->device)->p_vkWaitForFences(vulkan_device_from_handle(params->device)->host.device, params->fenceCount, params->pFences, params->waitAll, params->timeout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkWaitForFences(void *args) -{ - struct - { - PTR32 device; - uint32_t fenceCount; - PTR32 pFences; - VkBool32 waitAll; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkResult result; - } *params = args; - - TRACE("%#x, %u, %#x, %u, 0x%s\n", params->device, params->fenceCount, params->pFences, params->waitAll, wine_dbgstr_longlong(params->timeout)); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkWaitForFences(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->fenceCount, (const VkFence *)UlongToPtr(params->pFences), params->waitAll, params->timeout); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkWaitForPresentKHR(void *args) -{ - struct vkWaitForPresentKHR_params *params = args; - - TRACE("%p, 0x%s, 0x%s, 0x%s\n", params->device, wine_dbgstr_longlong(params->swapchain), wine_dbgstr_longlong(params->presentId), wine_dbgstr_longlong(params->timeout)); - - params->result = vulkan_device_from_handle(params->device)->p_vkWaitForPresentKHR(vulkan_device_from_handle(params->device)->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, params->presentId, params->timeout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkWaitForPresentKHR(void *args) -{ - struct - { - PTR32 device; - VkSwapchainKHR DECLSPEC_ALIGN(8) swapchain; - uint64_t DECLSPEC_ALIGN(8) presentId; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkResult result; - } *params = args; - - TRACE("%#x, 0x%s, 0x%s, 0x%s\n", params->device, wine_dbgstr_longlong(params->swapchain), wine_dbgstr_longlong(params->presentId), wine_dbgstr_longlong(params->timeout)); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkWaitForPresentKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, params->presentId, params->timeout); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkWaitSemaphores(void *args) -{ - struct vkWaitSemaphores_params *params = args; - - TRACE("%p, %p, 0x%s\n", params->device, params->pWaitInfo, wine_dbgstr_longlong(params->timeout)); - - params->result = vulkan_device_from_handle(params->device)->p_vkWaitSemaphores(vulkan_device_from_handle(params->device)->host.device, params->pWaitInfo, params->timeout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkWaitSemaphores(void *args) -{ - struct - { - PTR32 device; - PTR32 pWaitInfo; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkResult result; - } *params = args; - VkSemaphoreWaitInfo pWaitInfo_host; - - TRACE("%#x, %#x, 0x%s\n", params->device, params->pWaitInfo, wine_dbgstr_longlong(params->timeout)); - - convert_VkSemaphoreWaitInfo_win32_to_host((const VkSemaphoreWaitInfo32 *)UlongToPtr(params->pWaitInfo), &pWaitInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkWaitSemaphores(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pWaitInfo_host, params->timeout); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkWaitSemaphoresKHR(void *args) -{ - struct vkWaitSemaphoresKHR_params *params = args; - - TRACE("%p, %p, 0x%s\n", params->device, params->pWaitInfo, wine_dbgstr_longlong(params->timeout)); - - params->result = vulkan_device_from_handle(params->device)->p_vkWaitSemaphoresKHR(vulkan_device_from_handle(params->device)->host.device, params->pWaitInfo, params->timeout); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkWaitSemaphoresKHR(void *args) -{ - struct - { - PTR32 device; - PTR32 pWaitInfo; - uint64_t DECLSPEC_ALIGN(8) timeout; - VkResult result; - } *params = args; - VkSemaphoreWaitInfo pWaitInfo_host; - - TRACE("%#x, %#x, 0x%s\n", params->device, params->pWaitInfo, wine_dbgstr_longlong(params->timeout)); - - convert_VkSemaphoreWaitInfo_win32_to_host((const VkSemaphoreWaitInfo32 *)UlongToPtr(params->pWaitInfo), &pWaitInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkWaitSemaphoresKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pWaitInfo_host, params->timeout); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkWriteAccelerationStructuresPropertiesKHR(void *args) -{ - struct vkWriteAccelerationStructuresPropertiesKHR_params *params = args; - - TRACE("%p, %u, %p, %#x, 0x%s, %p, 0x%s\n", params->device, params->accelerationStructureCount, params->pAccelerationStructures, params->queryType, wine_dbgstr_longlong(params->dataSize), params->pData, wine_dbgstr_longlong(params->stride)); - - params->result = vulkan_device_from_handle(params->device)->p_vkWriteAccelerationStructuresPropertiesKHR(vulkan_device_from_handle(params->device)->host.device, params->accelerationStructureCount, params->pAccelerationStructures, params->queryType, params->dataSize, params->pData, params->stride); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkWriteAccelerationStructuresPropertiesKHR(void *args) -{ - struct - { - PTR32 device; - uint32_t accelerationStructureCount; - PTR32 pAccelerationStructures; - VkQueryType queryType; - PTR32 dataSize; - PTR32 pData; - PTR32 stride; - VkResult result; - } *params = args; - - TRACE("%#x, %u, %#x, %#x, 0x%s, %#x, 0x%s\n", params->device, params->accelerationStructureCount, params->pAccelerationStructures, params->queryType, wine_dbgstr_longlong(params->dataSize), params->pData, wine_dbgstr_longlong(params->stride)); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkWriteAccelerationStructuresPropertiesKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->accelerationStructureCount, (const VkAccelerationStructureKHR *)UlongToPtr(params->pAccelerationStructures), params->queryType, params->dataSize, (void *)UlongToPtr(params->pData), params->stride); - return STATUS_SUCCESS; -} - -#ifdef _WIN64 -static NTSTATUS thunk64_vkWriteMicromapsPropertiesEXT(void *args) -{ - struct vkWriteMicromapsPropertiesEXT_params *params = args; - - TRACE("%p, %u, %p, %#x, 0x%s, %p, 0x%s\n", params->device, params->micromapCount, params->pMicromaps, params->queryType, wine_dbgstr_longlong(params->dataSize), params->pData, wine_dbgstr_longlong(params->stride)); - - params->result = vulkan_device_from_handle(params->device)->p_vkWriteMicromapsPropertiesEXT(vulkan_device_from_handle(params->device)->host.device, params->micromapCount, params->pMicromaps, params->queryType, params->dataSize, params->pData, params->stride); - return STATUS_SUCCESS; -} -#endif /* _WIN64 */ - -static NTSTATUS thunk32_vkWriteMicromapsPropertiesEXT(void *args) -{ - struct - { - PTR32 device; - uint32_t micromapCount; - PTR32 pMicromaps; - VkQueryType queryType; - PTR32 dataSize; - PTR32 pData; - PTR32 stride; - VkResult result; - } *params = args; - - TRACE("%#x, %u, %#x, %#x, 0x%s, %#x, 0x%s\n", params->device, params->micromapCount, params->pMicromaps, params->queryType, wine_dbgstr_longlong(params->dataSize), params->pData, wine_dbgstr_longlong(params->stride)); - - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkWriteMicromapsPropertiesEXT(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->micromapCount, (const VkMicromapEXT *)UlongToPtr(params->pMicromaps), params->queryType, params->dataSize, (void *)UlongToPtr(params->pData), params->stride); - return STATUS_SUCCESS; -} - -static const char * const vk_device_extensions[] = -{ - "VK_AMD_anti_lag", - "VK_AMD_buffer_marker", - "VK_AMD_device_coherent_memory", - "VK_AMD_draw_indirect_count", - "VK_AMD_gcn_shader", - "VK_AMD_gpu_shader_half_float", - "VK_AMD_gpu_shader_int16", - "VK_AMD_memory_overallocation_behavior", - "VK_AMD_mixed_attachment_samples", - "VK_AMD_negative_viewport_height", - "VK_AMD_pipeline_compiler_control", - "VK_AMD_rasterization_order", - "VK_AMD_shader_ballot", - "VK_AMD_shader_core_properties", - "VK_AMD_shader_core_properties2", - "VK_AMD_shader_early_and_late_fragment_tests", - "VK_AMD_shader_explicit_vertex_parameter", - "VK_AMD_shader_fragment_mask", - "VK_AMD_shader_image_load_store_lod", - "VK_AMD_shader_info", - "VK_AMD_shader_trinary_minmax", - "VK_AMD_texture_gather_bias_lod", - "VK_ARM_rasterization_order_attachment_access", - "VK_ARM_render_pass_striped", - "VK_ARM_scheduling_controls", - "VK_ARM_shader_core_builtins", - "VK_ARM_shader_core_properties", - "VK_EXT_4444_formats", - "VK_EXT_astc_decode_mode", - "VK_EXT_attachment_feedback_loop_dynamic_state", - "VK_EXT_attachment_feedback_loop_layout", - "VK_EXT_blend_operation_advanced", - "VK_EXT_border_color_swizzle", - "VK_EXT_buffer_device_address", - "VK_EXT_calibrated_timestamps", - "VK_EXT_color_write_enable", - "VK_EXT_conditional_rendering", - "VK_EXT_conservative_rasterization", - "VK_EXT_custom_border_color", - "VK_EXT_debug_marker", - "VK_EXT_depth_bias_control", - "VK_EXT_depth_clamp_control", - "VK_EXT_depth_clamp_zero_one", - "VK_EXT_depth_clip_control", - "VK_EXT_depth_clip_enable", - "VK_EXT_depth_range_unrestricted", - "VK_EXT_descriptor_buffer", - "VK_EXT_descriptor_indexing", - "VK_EXT_device_address_binding_report", - "VK_EXT_device_fault", - "VK_EXT_device_generated_commands", - "VK_EXT_discard_rectangles", - "VK_EXT_dynamic_rendering_unused_attachments", - "VK_EXT_extended_dynamic_state", - "VK_EXT_extended_dynamic_state2", - "VK_EXT_extended_dynamic_state3", - "VK_EXT_external_memory_acquire_unmodified", - "VK_EXT_external_memory_host", - "VK_EXT_filter_cubic", - "VK_EXT_fragment_density_map", - "VK_EXT_fragment_density_map2", - "VK_EXT_fragment_shader_interlock", - "VK_EXT_frame_boundary", - "VK_EXT_global_priority", - "VK_EXT_global_priority_query", - "VK_EXT_graphics_pipeline_library", - "VK_EXT_hdr_metadata", - "VK_EXT_host_image_copy", - "VK_EXT_host_query_reset", - "VK_EXT_image_2d_view_of_3d", - "VK_EXT_image_compression_control", - "VK_EXT_image_compression_control_swapchain", - "VK_EXT_image_robustness", - "VK_EXT_image_sliced_view_of_3d", - "VK_EXT_image_view_min_lod", - "VK_EXT_index_type_uint8", - "VK_EXT_inline_uniform_block", - "VK_EXT_legacy_dithering", - "VK_EXT_legacy_vertex_attributes", - "VK_EXT_line_rasterization", - "VK_EXT_load_store_op_none", - "VK_EXT_memory_budget", - "VK_EXT_memory_priority", - "VK_EXT_mesh_shader", - "VK_EXT_multi_draw", - "VK_EXT_multisampled_render_to_single_sampled", - "VK_EXT_mutable_descriptor_type", - "VK_EXT_nested_command_buffer", - "VK_EXT_non_seamless_cube_map", - "VK_EXT_opacity_micromap", - "VK_EXT_pageable_device_local_memory", - "VK_EXT_pci_bus_info", - "VK_EXT_pipeline_creation_cache_control", - "VK_EXT_pipeline_creation_feedback", - "VK_EXT_pipeline_library_group_handles", - "VK_EXT_pipeline_properties", - "VK_EXT_pipeline_protected_access", - "VK_EXT_pipeline_robustness", - "VK_EXT_post_depth_coverage", - "VK_EXT_present_mode_fifo_latest_ready", - "VK_EXT_primitive_topology_list_restart", - "VK_EXT_primitives_generated_query", - "VK_EXT_private_data", - "VK_EXT_provoking_vertex", - "VK_EXT_queue_family_foreign", - "VK_EXT_rasterization_order_attachment_access", - "VK_EXT_rgba10x6_formats", - "VK_EXT_robustness2", - "VK_EXT_sample_locations", - "VK_EXT_sampler_filter_minmax", - "VK_EXT_scalar_block_layout", - "VK_EXT_separate_stencil_usage", - "VK_EXT_shader_atomic_float", - "VK_EXT_shader_atomic_float2", - "VK_EXT_shader_demote_to_helper_invocation", - "VK_EXT_shader_image_atomic_int64", - "VK_EXT_shader_module_identifier", - "VK_EXT_shader_object", - "VK_EXT_shader_replicated_composites", - "VK_EXT_shader_stencil_export", - "VK_EXT_shader_subgroup_ballot", - "VK_EXT_shader_subgroup_vote", - "VK_EXT_shader_tile_image", - "VK_EXT_shader_viewport_index_layer", - "VK_EXT_subgroup_size_control", - "VK_EXT_subpass_merge_feedback", - "VK_EXT_swapchain_maintenance1", - "VK_EXT_texel_buffer_alignment", - "VK_EXT_texture_compression_astc_hdr", - "VK_EXT_tooling_info", - "VK_EXT_transform_feedback", - "VK_EXT_validation_cache", - "VK_EXT_vertex_attribute_divisor", - "VK_EXT_vertex_attribute_robustness", - "VK_EXT_vertex_input_dynamic_state", - "VK_EXT_ycbcr_2plane_444_formats", - "VK_EXT_ycbcr_image_arrays", - "VK_GOOGLE_decorate_string", - "VK_GOOGLE_hlsl_functionality1", - "VK_GOOGLE_user_type", - "VK_HUAWEI_cluster_culling_shader", - "VK_HUAWEI_hdr_vivid", - "VK_HUAWEI_invocation_mask", - "VK_HUAWEI_subpass_shading", - "VK_IMG_filter_cubic", - "VK_IMG_format_pvrtc", - "VK_IMG_relaxed_line_rasterization", - "VK_INTEL_performance_query", - "VK_INTEL_shader_integer_functions2", - "VK_KHR_16bit_storage", - "VK_KHR_8bit_storage", - "VK_KHR_acceleration_structure", - "VK_KHR_bind_memory2", - "VK_KHR_buffer_device_address", - "VK_KHR_calibrated_timestamps", - "VK_KHR_compute_shader_derivatives", - "VK_KHR_cooperative_matrix", - "VK_KHR_copy_commands2", - "VK_KHR_create_renderpass2", - "VK_KHR_dedicated_allocation", - "VK_KHR_deferred_host_operations", - "VK_KHR_depth_stencil_resolve", - "VK_KHR_descriptor_update_template", - "VK_KHR_device_group", - "VK_KHR_draw_indirect_count", - "VK_KHR_driver_properties", - "VK_KHR_dynamic_rendering", - "VK_KHR_dynamic_rendering_local_read", - "VK_KHR_external_fence", - "VK_KHR_external_memory", - "VK_KHR_external_semaphore", - "VK_KHR_format_feature_flags2", - "VK_KHR_fragment_shader_barycentric", - "VK_KHR_fragment_shading_rate", - "VK_KHR_get_memory_requirements2", - "VK_KHR_global_priority", - "VK_KHR_image_format_list", - "VK_KHR_imageless_framebuffer", - "VK_KHR_incremental_present", - "VK_KHR_index_type_uint8", - "VK_KHR_line_rasterization", - "VK_KHR_load_store_op_none", - "VK_KHR_maintenance1", - "VK_KHR_maintenance2", - "VK_KHR_maintenance3", - "VK_KHR_maintenance4", - "VK_KHR_maintenance5", - "VK_KHR_maintenance6", - "VK_KHR_map_memory2", - "VK_KHR_multiview", - "VK_KHR_performance_query", - "VK_KHR_pipeline_binary", - "VK_KHR_pipeline_executable_properties", - "VK_KHR_pipeline_library", - "VK_KHR_present_id", - "VK_KHR_present_wait", - "VK_KHR_push_descriptor", - "VK_KHR_ray_query", - "VK_KHR_ray_tracing_maintenance1", - "VK_KHR_ray_tracing_pipeline", - "VK_KHR_ray_tracing_position_fetch", - "VK_KHR_relaxed_block_layout", - "VK_KHR_sampler_mirror_clamp_to_edge", - "VK_KHR_sampler_ycbcr_conversion", - "VK_KHR_separate_depth_stencil_layouts", - "VK_KHR_shader_atomic_int64", - "VK_KHR_shader_clock", - "VK_KHR_shader_draw_parameters", - "VK_KHR_shader_expect_assume", - "VK_KHR_shader_float16_int8", - "VK_KHR_shader_float_controls", - "VK_KHR_shader_float_controls2", - "VK_KHR_shader_integer_dot_product", - "VK_KHR_shader_maximal_reconvergence", - "VK_KHR_shader_non_semantic_info", - "VK_KHR_shader_quad_control", - "VK_KHR_shader_relaxed_extended_instruction", - "VK_KHR_shader_subgroup_extended_types", - "VK_KHR_shader_subgroup_rotate", - "VK_KHR_shader_subgroup_uniform_control_flow", - "VK_KHR_shader_terminate_invocation", - "VK_KHR_spirv_1_4", - "VK_KHR_storage_buffer_storage_class", - "VK_KHR_swapchain", - "VK_KHR_swapchain_mutable_format", - "VK_KHR_synchronization2", - "VK_KHR_timeline_semaphore", - "VK_KHR_uniform_buffer_standard_layout", - "VK_KHR_variable_pointers", - "VK_KHR_vertex_attribute_divisor", - "VK_KHR_video_decode_av1", - "VK_KHR_video_decode_h264", - "VK_KHR_video_decode_h265", - "VK_KHR_video_decode_queue", - "VK_KHR_video_encode_av1", - "VK_KHR_video_encode_h264", - "VK_KHR_video_encode_h265", - "VK_KHR_video_encode_quantization_map", - "VK_KHR_video_encode_queue", - "VK_KHR_video_maintenance1", - "VK_KHR_video_queue", - "VK_KHR_vulkan_memory_model", - "VK_KHR_workgroup_memory_explicit_layout", - "VK_KHR_zero_initialize_workgroup_memory", - "VK_MESA_image_alignment_control", - "VK_MSFT_layered_driver", - "VK_NVX_binary_import", - "VK_NVX_image_view_handle", - "VK_NV_clip_space_w_scaling", - "VK_NV_command_buffer_inheritance", - "VK_NV_compute_shader_derivatives", - "VK_NV_cooperative_matrix", - "VK_NV_cooperative_matrix2", - "VK_NV_copy_memory_indirect", - "VK_NV_corner_sampled_image", - "VK_NV_coverage_reduction_mode", - "VK_NV_cuda_kernel_launch", - "VK_NV_dedicated_allocation", - "VK_NV_dedicated_allocation_image_aliasing", - "VK_NV_descriptor_pool_overallocation", - "VK_NV_device_diagnostic_checkpoints", - "VK_NV_device_diagnostics_config", - "VK_NV_device_generated_commands", - "VK_NV_device_generated_commands_compute", - "VK_NV_extended_sparse_address_space", - "VK_NV_fill_rectangle", - "VK_NV_fragment_coverage_to_color", - "VK_NV_fragment_shader_barycentric", - "VK_NV_fragment_shading_rate_enums", - "VK_NV_framebuffer_mixed_samples", - "VK_NV_geometry_shader_passthrough", - "VK_NV_glsl_shader", - "VK_NV_inherited_viewport_scissor", - "VK_NV_linear_color_attachment", - "VK_NV_low_latency", - "VK_NV_low_latency2", - "VK_NV_memory_decompression", - "VK_NV_mesh_shader", - "VK_NV_optical_flow", - "VK_NV_per_stage_descriptor_set", - "VK_NV_present_barrier", - "VK_NV_raw_access_chains", - "VK_NV_ray_tracing", - "VK_NV_ray_tracing_invocation_reorder", - "VK_NV_ray_tracing_motion_blur", - "VK_NV_ray_tracing_validation", - "VK_NV_representative_fragment_test", - "VK_NV_sample_mask_override_coverage", - "VK_NV_scissor_exclusive", - "VK_NV_shader_atomic_float16_vector", - "VK_NV_shader_image_footprint", - "VK_NV_shader_sm_builtins", - "VK_NV_shader_subgroup_partitioned", - "VK_NV_shading_rate_image", - "VK_NV_viewport_array2", - "VK_NV_viewport_swizzle", - "VK_QCOM_filter_cubic_clamp", - "VK_QCOM_filter_cubic_weights", - "VK_QCOM_fragment_density_map_offset", - "VK_QCOM_image_processing", - "VK_QCOM_image_processing2", - "VK_QCOM_multiview_per_view_render_areas", - "VK_QCOM_multiview_per_view_viewports", - "VK_QCOM_render_pass_shader_resolve", - "VK_QCOM_render_pass_store_ops", - "VK_QCOM_render_pass_transform", - "VK_QCOM_rotated_copy_commands", - "VK_QCOM_tile_properties", - "VK_QCOM_ycbcr_degamma", - "VK_VALVE_descriptor_set_host_mapping", - "VK_VALVE_mutable_descriptor_type", -}; - -static const char * const vk_instance_extensions[] = -{ - "VK_EXT_debug_report", - "VK_EXT_debug_utils", - "VK_EXT_layer_settings", - "VK_EXT_surface_maintenance1", - "VK_EXT_swapchain_colorspace", - "VK_EXT_validation_features", - "VK_EXT_validation_flags", - "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_portability_enumeration", - "VK_KHR_surface", - "VK_KHR_win32_surface", -}; - -static const char * const vk_host_surface_extensions[] = -{ - "VK_KHR_xlib_surface", - "VK_KHR_xcb_surface", - "VK_KHR_wayland_surface", - "VK_KHR_mir_surface", - "VK_KHR_android_surface", - "VK_GGP_stream_descriptor_surface", - "VK_NN_vi_surface", - "VK_MVK_ios_surface", - "VK_MVK_macos_surface", - "VK_FUCHSIA_imagepipe_surface", - "VK_EXT_metal_surface", - "VK_EXT_directfb_surface", - "VK_QNX_screen_surface", -}; - -BOOL wine_vk_device_extension_supported(const char *name) -{ - unsigned int i; - for (i = 0; i < ARRAY_SIZE(vk_device_extensions); i++) - { - if (strcmp(vk_device_extensions[i], name) == 0) - return TRUE; - } - return FALSE; -} - -BOOL wine_vk_instance_extension_supported(const char *name) -{ - unsigned int i; - for (i = 0; i < ARRAY_SIZE(vk_instance_extensions); i++) - { - if (strcmp(vk_instance_extensions[i], name) == 0) - return TRUE; - } - return FALSE; -} - -BOOL wine_vk_is_host_surface_extension(const char *name) -{ - unsigned int i; - for (i = 0; i < ARRAY_SIZE(vk_host_surface_extensions); i++) - { - if (strcmp(vk_host_surface_extensions[i], name) == 0) - return TRUE; - } - return FALSE; -} - -BOOL wine_vk_is_type_wrapped(VkObjectType type) -{ - return FALSE || - type == VK_OBJECT_TYPE_COMMAND_BUFFER || - type == VK_OBJECT_TYPE_COMMAND_POOL || - type == VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT || - type == VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT || - type == VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR || - type == VK_OBJECT_TYPE_DEVICE || - type == VK_OBJECT_TYPE_DEVICE_MEMORY || - type == VK_OBJECT_TYPE_INSTANCE || - type == VK_OBJECT_TYPE_PHYSICAL_DEVICE || - type == VK_OBJECT_TYPE_QUEUE || - type == VK_OBJECT_TYPE_SURFACE_KHR || - type == VK_OBJECT_TYPE_SWAPCHAIN_KHR; -} - -#ifdef _WIN64 - -const unixlib_entry_t __wine_unix_call_funcs[] = -{ - init_vulkan, - vk_is_available_instance_function, - vk_is_available_device_function, - thunk64_vkAcquireNextImage2KHR, - thunk64_vkAcquireNextImageKHR, - thunk64_vkAcquirePerformanceConfigurationINTEL, - thunk64_vkAcquireProfilingLockKHR, - thunk64_vkAllocateCommandBuffers, - thunk64_vkAllocateDescriptorSets, - thunk64_vkAllocateMemory, - thunk64_vkAntiLagUpdateAMD, - thunk64_vkBeginCommandBuffer, - thunk64_vkBindAccelerationStructureMemoryNV, - thunk64_vkBindBufferMemory, - thunk64_vkBindBufferMemory2, - thunk64_vkBindBufferMemory2KHR, - thunk64_vkBindImageMemory, - thunk64_vkBindImageMemory2, - thunk64_vkBindImageMemory2KHR, - thunk64_vkBindOpticalFlowSessionImageNV, - thunk64_vkBindVideoSessionMemoryKHR, - thunk64_vkBuildAccelerationStructuresKHR, - thunk64_vkBuildMicromapsEXT, - (void *)thunk64_vkCmdBeginConditionalRenderingEXT, - (void *)thunk64_vkCmdBeginDebugUtilsLabelEXT, - (void *)thunk64_vkCmdBeginQuery, - (void *)thunk64_vkCmdBeginQueryIndexedEXT, - (void *)thunk64_vkCmdBeginRenderPass, - (void *)thunk64_vkCmdBeginRenderPass2, - (void *)thunk64_vkCmdBeginRenderPass2KHR, - (void *)thunk64_vkCmdBeginRendering, - (void *)thunk64_vkCmdBeginRenderingKHR, - (void *)thunk64_vkCmdBeginTransformFeedbackEXT, - (void *)thunk64_vkCmdBeginVideoCodingKHR, - (void *)thunk64_vkCmdBindDescriptorBufferEmbeddedSamplers2EXT, - (void *)thunk64_vkCmdBindDescriptorBufferEmbeddedSamplersEXT, - (void *)thunk64_vkCmdBindDescriptorBuffersEXT, - (void *)thunk64_vkCmdBindDescriptorSets, - (void *)thunk64_vkCmdBindDescriptorSets2, - (void *)thunk64_vkCmdBindDescriptorSets2KHR, - (void *)thunk64_vkCmdBindIndexBuffer, - (void *)thunk64_vkCmdBindIndexBuffer2, - (void *)thunk64_vkCmdBindIndexBuffer2KHR, - (void *)thunk64_vkCmdBindInvocationMaskHUAWEI, - (void *)thunk64_vkCmdBindPipeline, - (void *)thunk64_vkCmdBindPipelineShaderGroupNV, - (void *)thunk64_vkCmdBindShadersEXT, - (void *)thunk64_vkCmdBindShadingRateImageNV, - (void *)thunk64_vkCmdBindTransformFeedbackBuffersEXT, - (void *)thunk64_vkCmdBindVertexBuffers, - (void *)thunk64_vkCmdBindVertexBuffers2, - (void *)thunk64_vkCmdBindVertexBuffers2EXT, - (void *)thunk64_vkCmdBlitImage, - (void *)thunk64_vkCmdBlitImage2, - (void *)thunk64_vkCmdBlitImage2KHR, - (void *)thunk64_vkCmdBuildAccelerationStructureNV, - (void *)thunk64_vkCmdBuildAccelerationStructuresIndirectKHR, - (void *)thunk64_vkCmdBuildAccelerationStructuresKHR, - (void *)thunk64_vkCmdBuildMicromapsEXT, - (void *)thunk64_vkCmdClearAttachments, - (void *)thunk64_vkCmdClearColorImage, - (void *)thunk64_vkCmdClearDepthStencilImage, - (void *)thunk64_vkCmdControlVideoCodingKHR, - (void *)thunk64_vkCmdCopyAccelerationStructureKHR, - (void *)thunk64_vkCmdCopyAccelerationStructureNV, - (void *)thunk64_vkCmdCopyAccelerationStructureToMemoryKHR, - (void *)thunk64_vkCmdCopyBuffer, - (void *)thunk64_vkCmdCopyBuffer2, - (void *)thunk64_vkCmdCopyBuffer2KHR, - (void *)thunk64_vkCmdCopyBufferToImage, - (void *)thunk64_vkCmdCopyBufferToImage2, - (void *)thunk64_vkCmdCopyBufferToImage2KHR, - (void *)thunk64_vkCmdCopyImage, - (void *)thunk64_vkCmdCopyImage2, - (void *)thunk64_vkCmdCopyImage2KHR, - (void *)thunk64_vkCmdCopyImageToBuffer, - (void *)thunk64_vkCmdCopyImageToBuffer2, - (void *)thunk64_vkCmdCopyImageToBuffer2KHR, - (void *)thunk64_vkCmdCopyMemoryIndirectNV, - (void *)thunk64_vkCmdCopyMemoryToAccelerationStructureKHR, - (void *)thunk64_vkCmdCopyMemoryToImageIndirectNV, - (void *)thunk64_vkCmdCopyMemoryToMicromapEXT, - (void *)thunk64_vkCmdCopyMicromapEXT, - (void *)thunk64_vkCmdCopyMicromapToMemoryEXT, - (void *)thunk64_vkCmdCopyQueryPoolResults, - (void *)thunk64_vkCmdCuLaunchKernelNVX, - (void *)thunk64_vkCmdCudaLaunchKernelNV, - (void *)thunk64_vkCmdDebugMarkerBeginEXT, - (void *)thunk64_vkCmdDebugMarkerEndEXT, - (void *)thunk64_vkCmdDebugMarkerInsertEXT, - (void *)thunk64_vkCmdDecodeVideoKHR, - (void *)thunk64_vkCmdDecompressMemoryIndirectCountNV, - (void *)thunk64_vkCmdDecompressMemoryNV, - (void *)thunk64_vkCmdDispatch, - (void *)thunk64_vkCmdDispatchBase, - (void *)thunk64_vkCmdDispatchBaseKHR, - (void *)thunk64_vkCmdDispatchIndirect, - (void *)thunk64_vkCmdDraw, - (void *)thunk64_vkCmdDrawClusterHUAWEI, - (void *)thunk64_vkCmdDrawClusterIndirectHUAWEI, - (void *)thunk64_vkCmdDrawIndexed, - (void *)thunk64_vkCmdDrawIndexedIndirect, - (void *)thunk64_vkCmdDrawIndexedIndirectCount, - (void *)thunk64_vkCmdDrawIndexedIndirectCountAMD, - (void *)thunk64_vkCmdDrawIndexedIndirectCountKHR, - (void *)thunk64_vkCmdDrawIndirect, - (void *)thunk64_vkCmdDrawIndirectByteCountEXT, - (void *)thunk64_vkCmdDrawIndirectCount, - (void *)thunk64_vkCmdDrawIndirectCountAMD, - (void *)thunk64_vkCmdDrawIndirectCountKHR, - (void *)thunk64_vkCmdDrawMeshTasksEXT, - (void *)thunk64_vkCmdDrawMeshTasksIndirectCountEXT, - (void *)thunk64_vkCmdDrawMeshTasksIndirectCountNV, - (void *)thunk64_vkCmdDrawMeshTasksIndirectEXT, - (void *)thunk64_vkCmdDrawMeshTasksIndirectNV, - (void *)thunk64_vkCmdDrawMeshTasksNV, - (void *)thunk64_vkCmdDrawMultiEXT, - (void *)thunk64_vkCmdDrawMultiIndexedEXT, - (void *)thunk64_vkCmdEncodeVideoKHR, - (void *)thunk64_vkCmdEndConditionalRenderingEXT, - (void *)thunk64_vkCmdEndDebugUtilsLabelEXT, - (void *)thunk64_vkCmdEndQuery, - (void *)thunk64_vkCmdEndQueryIndexedEXT, - (void *)thunk64_vkCmdEndRenderPass, - (void *)thunk64_vkCmdEndRenderPass2, - (void *)thunk64_vkCmdEndRenderPass2KHR, - (void *)thunk64_vkCmdEndRendering, - (void *)thunk64_vkCmdEndRenderingKHR, - (void *)thunk64_vkCmdEndTransformFeedbackEXT, - (void *)thunk64_vkCmdEndVideoCodingKHR, - (void *)thunk64_vkCmdExecuteCommands, - (void *)thunk64_vkCmdExecuteGeneratedCommandsEXT, - (void *)thunk64_vkCmdExecuteGeneratedCommandsNV, - (void *)thunk64_vkCmdFillBuffer, - (void *)thunk64_vkCmdInsertDebugUtilsLabelEXT, - (void *)thunk64_vkCmdNextSubpass, - (void *)thunk64_vkCmdNextSubpass2, - (void *)thunk64_vkCmdNextSubpass2KHR, - (void *)thunk64_vkCmdOpticalFlowExecuteNV, - (void *)thunk64_vkCmdPipelineBarrier, - (void *)thunk64_vkCmdPipelineBarrier2, - (void *)thunk64_vkCmdPipelineBarrier2KHR, - (void *)thunk64_vkCmdPreprocessGeneratedCommandsEXT, - (void *)thunk64_vkCmdPreprocessGeneratedCommandsNV, - (void *)thunk64_vkCmdPushConstants, - (void *)thunk64_vkCmdPushConstants2, - (void *)thunk64_vkCmdPushConstants2KHR, - (void *)thunk64_vkCmdPushDescriptorSet, - (void *)thunk64_vkCmdPushDescriptorSet2, - (void *)thunk64_vkCmdPushDescriptorSet2KHR, - (void *)thunk64_vkCmdPushDescriptorSetKHR, - (void *)thunk64_vkCmdPushDescriptorSetWithTemplate, - (void *)thunk64_vkCmdPushDescriptorSetWithTemplate2, - (void *)thunk64_vkCmdPushDescriptorSetWithTemplate2KHR, - (void *)thunk64_vkCmdPushDescriptorSetWithTemplateKHR, - (void *)thunk64_vkCmdResetEvent, - (void *)thunk64_vkCmdResetEvent2, - (void *)thunk64_vkCmdResetEvent2KHR, - (void *)thunk64_vkCmdResetQueryPool, - (void *)thunk64_vkCmdResolveImage, - (void *)thunk64_vkCmdResolveImage2, - (void *)thunk64_vkCmdResolveImage2KHR, - (void *)thunk64_vkCmdSetAlphaToCoverageEnableEXT, - (void *)thunk64_vkCmdSetAlphaToOneEnableEXT, - (void *)thunk64_vkCmdSetAttachmentFeedbackLoopEnableEXT, - (void *)thunk64_vkCmdSetBlendConstants, - (void *)thunk64_vkCmdSetCheckpointNV, - (void *)thunk64_vkCmdSetCoarseSampleOrderNV, - (void *)thunk64_vkCmdSetColorBlendAdvancedEXT, - (void *)thunk64_vkCmdSetColorBlendEnableEXT, - (void *)thunk64_vkCmdSetColorBlendEquationEXT, - (void *)thunk64_vkCmdSetColorWriteEnableEXT, - (void *)thunk64_vkCmdSetColorWriteMaskEXT, - (void *)thunk64_vkCmdSetConservativeRasterizationModeEXT, - (void *)thunk64_vkCmdSetCoverageModulationModeNV, - (void *)thunk64_vkCmdSetCoverageModulationTableEnableNV, - (void *)thunk64_vkCmdSetCoverageModulationTableNV, - (void *)thunk64_vkCmdSetCoverageReductionModeNV, - (void *)thunk64_vkCmdSetCoverageToColorEnableNV, - (void *)thunk64_vkCmdSetCoverageToColorLocationNV, - (void *)thunk64_vkCmdSetCullMode, - (void *)thunk64_vkCmdSetCullModeEXT, - (void *)thunk64_vkCmdSetDepthBias, - (void *)thunk64_vkCmdSetDepthBias2EXT, - (void *)thunk64_vkCmdSetDepthBiasEnable, - (void *)thunk64_vkCmdSetDepthBiasEnableEXT, - (void *)thunk64_vkCmdSetDepthBounds, - (void *)thunk64_vkCmdSetDepthBoundsTestEnable, - (void *)thunk64_vkCmdSetDepthBoundsTestEnableEXT, - (void *)thunk64_vkCmdSetDepthClampEnableEXT, - (void *)thunk64_vkCmdSetDepthClampRangeEXT, - (void *)thunk64_vkCmdSetDepthClipEnableEXT, - (void *)thunk64_vkCmdSetDepthClipNegativeOneToOneEXT, - (void *)thunk64_vkCmdSetDepthCompareOp, - (void *)thunk64_vkCmdSetDepthCompareOpEXT, - (void *)thunk64_vkCmdSetDepthTestEnable, - (void *)thunk64_vkCmdSetDepthTestEnableEXT, - (void *)thunk64_vkCmdSetDepthWriteEnable, - (void *)thunk64_vkCmdSetDepthWriteEnableEXT, - (void *)thunk64_vkCmdSetDescriptorBufferOffsets2EXT, - (void *)thunk64_vkCmdSetDescriptorBufferOffsetsEXT, - (void *)thunk64_vkCmdSetDeviceMask, - (void *)thunk64_vkCmdSetDeviceMaskKHR, - (void *)thunk64_vkCmdSetDiscardRectangleEXT, - (void *)thunk64_vkCmdSetDiscardRectangleEnableEXT, - (void *)thunk64_vkCmdSetDiscardRectangleModeEXT, - (void *)thunk64_vkCmdSetEvent, - (void *)thunk64_vkCmdSetEvent2, - (void *)thunk64_vkCmdSetEvent2KHR, - (void *)thunk64_vkCmdSetExclusiveScissorEnableNV, - (void *)thunk64_vkCmdSetExclusiveScissorNV, - (void *)thunk64_vkCmdSetExtraPrimitiveOverestimationSizeEXT, - (void *)thunk64_vkCmdSetFragmentShadingRateEnumNV, - (void *)thunk64_vkCmdSetFragmentShadingRateKHR, - (void *)thunk64_vkCmdSetFrontFace, - (void *)thunk64_vkCmdSetFrontFaceEXT, - (void *)thunk64_vkCmdSetLineRasterizationModeEXT, - (void *)thunk64_vkCmdSetLineStipple, - (void *)thunk64_vkCmdSetLineStippleEXT, - (void *)thunk64_vkCmdSetLineStippleEnableEXT, - (void *)thunk64_vkCmdSetLineStippleKHR, - (void *)thunk64_vkCmdSetLineWidth, - (void *)thunk64_vkCmdSetLogicOpEXT, - (void *)thunk64_vkCmdSetLogicOpEnableEXT, - (void *)thunk64_vkCmdSetPatchControlPointsEXT, - thunk64_vkCmdSetPerformanceMarkerINTEL, - thunk64_vkCmdSetPerformanceOverrideINTEL, - thunk64_vkCmdSetPerformanceStreamMarkerINTEL, - (void *)thunk64_vkCmdSetPolygonModeEXT, - (void *)thunk64_vkCmdSetPrimitiveRestartEnable, - (void *)thunk64_vkCmdSetPrimitiveRestartEnableEXT, - (void *)thunk64_vkCmdSetPrimitiveTopology, - (void *)thunk64_vkCmdSetPrimitiveTopologyEXT, - (void *)thunk64_vkCmdSetProvokingVertexModeEXT, - (void *)thunk64_vkCmdSetRasterizationSamplesEXT, - (void *)thunk64_vkCmdSetRasterizationStreamEXT, - (void *)thunk64_vkCmdSetRasterizerDiscardEnable, - (void *)thunk64_vkCmdSetRasterizerDiscardEnableEXT, - (void *)thunk64_vkCmdSetRayTracingPipelineStackSizeKHR, - (void *)thunk64_vkCmdSetRenderingAttachmentLocations, - (void *)thunk64_vkCmdSetRenderingAttachmentLocationsKHR, - (void *)thunk64_vkCmdSetRenderingInputAttachmentIndices, - (void *)thunk64_vkCmdSetRenderingInputAttachmentIndicesKHR, - (void *)thunk64_vkCmdSetRepresentativeFragmentTestEnableNV, - (void *)thunk64_vkCmdSetSampleLocationsEXT, - (void *)thunk64_vkCmdSetSampleLocationsEnableEXT, - (void *)thunk64_vkCmdSetSampleMaskEXT, - (void *)thunk64_vkCmdSetScissor, - (void *)thunk64_vkCmdSetScissorWithCount, - (void *)thunk64_vkCmdSetScissorWithCountEXT, - (void *)thunk64_vkCmdSetShadingRateImageEnableNV, - (void *)thunk64_vkCmdSetStencilCompareMask, - (void *)thunk64_vkCmdSetStencilOp, - (void *)thunk64_vkCmdSetStencilOpEXT, - (void *)thunk64_vkCmdSetStencilReference, - (void *)thunk64_vkCmdSetStencilTestEnable, - (void *)thunk64_vkCmdSetStencilTestEnableEXT, - (void *)thunk64_vkCmdSetStencilWriteMask, - (void *)thunk64_vkCmdSetTessellationDomainOriginEXT, - (void *)thunk64_vkCmdSetVertexInputEXT, - (void *)thunk64_vkCmdSetViewport, - (void *)thunk64_vkCmdSetViewportShadingRatePaletteNV, - (void *)thunk64_vkCmdSetViewportSwizzleNV, - (void *)thunk64_vkCmdSetViewportWScalingEnableNV, - (void *)thunk64_vkCmdSetViewportWScalingNV, - (void *)thunk64_vkCmdSetViewportWithCount, - (void *)thunk64_vkCmdSetViewportWithCountEXT, - (void *)thunk64_vkCmdSubpassShadingHUAWEI, - (void *)thunk64_vkCmdTraceRaysIndirect2KHR, - (void *)thunk64_vkCmdTraceRaysIndirectKHR, - (void *)thunk64_vkCmdTraceRaysKHR, - (void *)thunk64_vkCmdTraceRaysNV, - (void *)thunk64_vkCmdUpdateBuffer, - (void *)thunk64_vkCmdUpdatePipelineIndirectBufferNV, - (void *)thunk64_vkCmdWaitEvents, - (void *)thunk64_vkCmdWaitEvents2, - (void *)thunk64_vkCmdWaitEvents2KHR, - (void *)thunk64_vkCmdWriteAccelerationStructuresPropertiesKHR, - (void *)thunk64_vkCmdWriteAccelerationStructuresPropertiesNV, - (void *)thunk64_vkCmdWriteBufferMarker2AMD, - (void *)thunk64_vkCmdWriteBufferMarkerAMD, - (void *)thunk64_vkCmdWriteMicromapsPropertiesEXT, - (void *)thunk64_vkCmdWriteTimestamp, - (void *)thunk64_vkCmdWriteTimestamp2, - (void *)thunk64_vkCmdWriteTimestamp2KHR, - thunk64_vkCompileDeferredNV, - thunk64_vkCopyAccelerationStructureKHR, - thunk64_vkCopyAccelerationStructureToMemoryKHR, - thunk64_vkCopyImageToImage, - thunk64_vkCopyImageToImageEXT, - thunk64_vkCopyImageToMemory, - thunk64_vkCopyImageToMemoryEXT, - thunk64_vkCopyMemoryToAccelerationStructureKHR, - thunk64_vkCopyMemoryToImage, - thunk64_vkCopyMemoryToImageEXT, - thunk64_vkCopyMemoryToMicromapEXT, - thunk64_vkCopyMicromapEXT, - thunk64_vkCopyMicromapToMemoryEXT, - thunk64_vkCreateAccelerationStructureKHR, - thunk64_vkCreateAccelerationStructureNV, - thunk64_vkCreateBuffer, - thunk64_vkCreateBufferView, - thunk64_vkCreateCommandPool, - thunk64_vkCreateComputePipelines, - thunk64_vkCreateCuFunctionNVX, - thunk64_vkCreateCuModuleNVX, - thunk64_vkCreateCudaFunctionNV, - thunk64_vkCreateCudaModuleNV, - thunk64_vkCreateDebugReportCallbackEXT, - thunk64_vkCreateDebugUtilsMessengerEXT, - thunk64_vkCreateDeferredOperationKHR, - thunk64_vkCreateDescriptorPool, - thunk64_vkCreateDescriptorSetLayout, - thunk64_vkCreateDescriptorUpdateTemplate, - thunk64_vkCreateDescriptorUpdateTemplateKHR, - thunk64_vkCreateDevice, - thunk64_vkCreateEvent, - thunk64_vkCreateFence, - thunk64_vkCreateFramebuffer, - thunk64_vkCreateGraphicsPipelines, - thunk64_vkCreateImage, - thunk64_vkCreateImageView, - thunk64_vkCreateIndirectCommandsLayoutEXT, - thunk64_vkCreateIndirectCommandsLayoutNV, - thunk64_vkCreateIndirectExecutionSetEXT, - thunk64_vkCreateInstance, - thunk64_vkCreateMicromapEXT, - thunk64_vkCreateOpticalFlowSessionNV, - thunk64_vkCreatePipelineBinariesKHR, - thunk64_vkCreatePipelineCache, - thunk64_vkCreatePipelineLayout, - thunk64_vkCreatePrivateDataSlot, - thunk64_vkCreatePrivateDataSlotEXT, - thunk64_vkCreateQueryPool, - thunk64_vkCreateRayTracingPipelinesKHR, - thunk64_vkCreateRayTracingPipelinesNV, - thunk64_vkCreateRenderPass, - thunk64_vkCreateRenderPass2, - thunk64_vkCreateRenderPass2KHR, - thunk64_vkCreateSampler, - thunk64_vkCreateSamplerYcbcrConversion, - thunk64_vkCreateSamplerYcbcrConversionKHR, - thunk64_vkCreateSemaphore, - thunk64_vkCreateShaderModule, - thunk64_vkCreateShadersEXT, - thunk64_vkCreateSwapchainKHR, - thunk64_vkCreateValidationCacheEXT, - thunk64_vkCreateVideoSessionKHR, - thunk64_vkCreateVideoSessionParametersKHR, - thunk64_vkCreateWin32SurfaceKHR, - thunk64_vkDebugMarkerSetObjectNameEXT, - thunk64_vkDebugMarkerSetObjectTagEXT, - thunk64_vkDebugReportMessageEXT, - thunk64_vkDeferredOperationJoinKHR, - thunk64_vkDestroyAccelerationStructureKHR, - thunk64_vkDestroyAccelerationStructureNV, - thunk64_vkDestroyBuffer, - thunk64_vkDestroyBufferView, - thunk64_vkDestroyCommandPool, - thunk64_vkDestroyCuFunctionNVX, - thunk64_vkDestroyCuModuleNVX, - thunk64_vkDestroyCudaFunctionNV, - thunk64_vkDestroyCudaModuleNV, - thunk64_vkDestroyDebugReportCallbackEXT, - thunk64_vkDestroyDebugUtilsMessengerEXT, - thunk64_vkDestroyDeferredOperationKHR, - thunk64_vkDestroyDescriptorPool, - thunk64_vkDestroyDescriptorSetLayout, - thunk64_vkDestroyDescriptorUpdateTemplate, - thunk64_vkDestroyDescriptorUpdateTemplateKHR, - thunk64_vkDestroyDevice, - thunk64_vkDestroyEvent, - thunk64_vkDestroyFence, - thunk64_vkDestroyFramebuffer, - thunk64_vkDestroyImage, - thunk64_vkDestroyImageView, - thunk64_vkDestroyIndirectCommandsLayoutEXT, - thunk64_vkDestroyIndirectCommandsLayoutNV, - thunk64_vkDestroyIndirectExecutionSetEXT, - thunk64_vkDestroyInstance, - thunk64_vkDestroyMicromapEXT, - thunk64_vkDestroyOpticalFlowSessionNV, - thunk64_vkDestroyPipeline, - thunk64_vkDestroyPipelineBinaryKHR, - thunk64_vkDestroyPipelineCache, - thunk64_vkDestroyPipelineLayout, - thunk64_vkDestroyPrivateDataSlot, - thunk64_vkDestroyPrivateDataSlotEXT, - thunk64_vkDestroyQueryPool, - thunk64_vkDestroyRenderPass, - thunk64_vkDestroySampler, - thunk64_vkDestroySamplerYcbcrConversion, - thunk64_vkDestroySamplerYcbcrConversionKHR, - thunk64_vkDestroySemaphore, - thunk64_vkDestroyShaderEXT, - thunk64_vkDestroyShaderModule, - thunk64_vkDestroySurfaceKHR, - thunk64_vkDestroySwapchainKHR, - thunk64_vkDestroyValidationCacheEXT, - thunk64_vkDestroyVideoSessionKHR, - thunk64_vkDestroyVideoSessionParametersKHR, - thunk64_vkDeviceWaitIdle, - thunk64_vkEndCommandBuffer, - thunk64_vkEnumerateDeviceExtensionProperties, - thunk64_vkEnumerateDeviceLayerProperties, - thunk64_vkEnumerateInstanceExtensionProperties, - thunk64_vkEnumerateInstanceVersion, - thunk64_vkEnumeratePhysicalDeviceGroups, - thunk64_vkEnumeratePhysicalDeviceGroupsKHR, - thunk64_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR, - thunk64_vkEnumeratePhysicalDevices, - thunk64_vkFlushMappedMemoryRanges, - thunk64_vkFreeCommandBuffers, - thunk64_vkFreeDescriptorSets, - thunk64_vkFreeMemory, - thunk64_vkGetAccelerationStructureBuildSizesKHR, - thunk64_vkGetAccelerationStructureDeviceAddressKHR, - thunk64_vkGetAccelerationStructureHandleNV, - thunk64_vkGetAccelerationStructureMemoryRequirementsNV, - thunk64_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT, - thunk64_vkGetBufferDeviceAddress, - thunk64_vkGetBufferDeviceAddressEXT, - thunk64_vkGetBufferDeviceAddressKHR, - thunk64_vkGetBufferMemoryRequirements, - thunk64_vkGetBufferMemoryRequirements2, - thunk64_vkGetBufferMemoryRequirements2KHR, - thunk64_vkGetBufferOpaqueCaptureAddress, - thunk64_vkGetBufferOpaqueCaptureAddressKHR, - thunk64_vkGetBufferOpaqueCaptureDescriptorDataEXT, - thunk64_vkGetCalibratedTimestampsEXT, - thunk64_vkGetCalibratedTimestampsKHR, - thunk64_vkGetCudaModuleCacheNV, - thunk64_vkGetDeferredOperationMaxConcurrencyKHR, - thunk64_vkGetDeferredOperationResultKHR, - (void *)thunk64_vkGetDescriptorEXT, - thunk64_vkGetDescriptorSetHostMappingVALVE, - thunk64_vkGetDescriptorSetLayoutBindingOffsetEXT, - thunk64_vkGetDescriptorSetLayoutHostMappingInfoVALVE, - thunk64_vkGetDescriptorSetLayoutSizeEXT, - thunk64_vkGetDescriptorSetLayoutSupport, - thunk64_vkGetDescriptorSetLayoutSupportKHR, - thunk64_vkGetDeviceAccelerationStructureCompatibilityKHR, - thunk64_vkGetDeviceBufferMemoryRequirements, - thunk64_vkGetDeviceBufferMemoryRequirementsKHR, - thunk64_vkGetDeviceFaultInfoEXT, - thunk64_vkGetDeviceGroupPeerMemoryFeatures, - thunk64_vkGetDeviceGroupPeerMemoryFeaturesKHR, - thunk64_vkGetDeviceGroupPresentCapabilitiesKHR, - thunk64_vkGetDeviceGroupSurfacePresentModesKHR, - thunk64_vkGetDeviceImageMemoryRequirements, - thunk64_vkGetDeviceImageMemoryRequirementsKHR, - thunk64_vkGetDeviceImageSparseMemoryRequirements, - thunk64_vkGetDeviceImageSparseMemoryRequirementsKHR, - thunk64_vkGetDeviceImageSubresourceLayout, - thunk64_vkGetDeviceImageSubresourceLayoutKHR, - thunk64_vkGetDeviceMemoryCommitment, - thunk64_vkGetDeviceMemoryOpaqueCaptureAddress, - thunk64_vkGetDeviceMemoryOpaqueCaptureAddressKHR, - thunk64_vkGetDeviceMicromapCompatibilityEXT, - thunk64_vkGetDeviceQueue, - thunk64_vkGetDeviceQueue2, - thunk64_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI, - thunk64_vkGetDynamicRenderingTilePropertiesQCOM, - thunk64_vkGetEncodedVideoSessionParametersKHR, - thunk64_vkGetEventStatus, - thunk64_vkGetFenceStatus, - thunk64_vkGetFramebufferTilePropertiesQCOM, - thunk64_vkGetGeneratedCommandsMemoryRequirementsEXT, - thunk64_vkGetGeneratedCommandsMemoryRequirementsNV, - thunk64_vkGetImageMemoryRequirements, - thunk64_vkGetImageMemoryRequirements2, - thunk64_vkGetImageMemoryRequirements2KHR, - thunk64_vkGetImageOpaqueCaptureDescriptorDataEXT, - thunk64_vkGetImageSparseMemoryRequirements, - thunk64_vkGetImageSparseMemoryRequirements2, - thunk64_vkGetImageSparseMemoryRequirements2KHR, - thunk64_vkGetImageSubresourceLayout, - thunk64_vkGetImageSubresourceLayout2, - thunk64_vkGetImageSubresourceLayout2EXT, - thunk64_vkGetImageSubresourceLayout2KHR, - thunk64_vkGetImageViewAddressNVX, - thunk64_vkGetImageViewHandle64NVX, - thunk64_vkGetImageViewHandleNVX, - thunk64_vkGetImageViewOpaqueCaptureDescriptorDataEXT, - thunk64_vkGetLatencyTimingsNV, - thunk64_vkGetMemoryHostPointerPropertiesEXT, - thunk64_vkGetMicromapBuildSizesEXT, - thunk64_vkGetPerformanceParameterINTEL, - thunk64_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT, - thunk64_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR, - thunk64_vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV, - thunk64_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR, - thunk64_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV, - thunk64_vkGetPhysicalDeviceExternalBufferProperties, - thunk64_vkGetPhysicalDeviceExternalBufferPropertiesKHR, - thunk64_vkGetPhysicalDeviceExternalFenceProperties, - thunk64_vkGetPhysicalDeviceExternalFencePropertiesKHR, - thunk64_vkGetPhysicalDeviceExternalSemaphoreProperties, - thunk64_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, - thunk64_vkGetPhysicalDeviceFeatures, - thunk64_vkGetPhysicalDeviceFeatures2, - thunk64_vkGetPhysicalDeviceFeatures2KHR, - thunk64_vkGetPhysicalDeviceFormatProperties, - thunk64_vkGetPhysicalDeviceFormatProperties2, - thunk64_vkGetPhysicalDeviceFormatProperties2KHR, - thunk64_vkGetPhysicalDeviceFragmentShadingRatesKHR, - thunk64_vkGetPhysicalDeviceImageFormatProperties, - thunk64_vkGetPhysicalDeviceImageFormatProperties2, - thunk64_vkGetPhysicalDeviceImageFormatProperties2KHR, - thunk64_vkGetPhysicalDeviceMemoryProperties, - thunk64_vkGetPhysicalDeviceMemoryProperties2, - thunk64_vkGetPhysicalDeviceMemoryProperties2KHR, - thunk64_vkGetPhysicalDeviceMultisamplePropertiesEXT, - thunk64_vkGetPhysicalDeviceOpticalFlowImageFormatsNV, - thunk64_vkGetPhysicalDevicePresentRectanglesKHR, - thunk64_vkGetPhysicalDeviceProperties, - thunk64_vkGetPhysicalDeviceProperties2, - thunk64_vkGetPhysicalDeviceProperties2KHR, - thunk64_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR, - thunk64_vkGetPhysicalDeviceQueueFamilyProperties, - thunk64_vkGetPhysicalDeviceQueueFamilyProperties2, - thunk64_vkGetPhysicalDeviceQueueFamilyProperties2KHR, - thunk64_vkGetPhysicalDeviceSparseImageFormatProperties, - thunk64_vkGetPhysicalDeviceSparseImageFormatProperties2, - thunk64_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, - thunk64_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV, - thunk64_vkGetPhysicalDeviceSurfaceCapabilities2KHR, - thunk64_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, - thunk64_vkGetPhysicalDeviceSurfaceFormats2KHR, - thunk64_vkGetPhysicalDeviceSurfaceFormatsKHR, - thunk64_vkGetPhysicalDeviceSurfacePresentModesKHR, - thunk64_vkGetPhysicalDeviceSurfaceSupportKHR, - thunk64_vkGetPhysicalDeviceToolProperties, - thunk64_vkGetPhysicalDeviceToolPropertiesEXT, - thunk64_vkGetPhysicalDeviceVideoCapabilitiesKHR, - thunk64_vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR, - thunk64_vkGetPhysicalDeviceVideoFormatPropertiesKHR, - thunk64_vkGetPhysicalDeviceWin32PresentationSupportKHR, - thunk64_vkGetPipelineBinaryDataKHR, - thunk64_vkGetPipelineCacheData, - thunk64_vkGetPipelineExecutableInternalRepresentationsKHR, - thunk64_vkGetPipelineExecutablePropertiesKHR, - thunk64_vkGetPipelineExecutableStatisticsKHR, - thunk64_vkGetPipelineIndirectDeviceAddressNV, - thunk64_vkGetPipelineIndirectMemoryRequirementsNV, - thunk64_vkGetPipelineKeyKHR, - thunk64_vkGetPipelinePropertiesEXT, - thunk64_vkGetPrivateData, - thunk64_vkGetPrivateDataEXT, - thunk64_vkGetQueryPoolResults, - thunk64_vkGetQueueCheckpointData2NV, - thunk64_vkGetQueueCheckpointDataNV, - thunk64_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR, - thunk64_vkGetRayTracingShaderGroupHandlesKHR, - thunk64_vkGetRayTracingShaderGroupHandlesNV, - thunk64_vkGetRayTracingShaderGroupStackSizeKHR, - thunk64_vkGetRenderAreaGranularity, - thunk64_vkGetRenderingAreaGranularity, - thunk64_vkGetRenderingAreaGranularityKHR, - thunk64_vkGetSamplerOpaqueCaptureDescriptorDataEXT, - thunk64_vkGetSemaphoreCounterValue, - thunk64_vkGetSemaphoreCounterValueKHR, - thunk64_vkGetShaderBinaryDataEXT, - thunk64_vkGetShaderInfoAMD, - thunk64_vkGetShaderModuleCreateInfoIdentifierEXT, - thunk64_vkGetShaderModuleIdentifierEXT, - thunk64_vkGetSwapchainImagesKHR, - thunk64_vkGetValidationCacheDataEXT, - thunk64_vkGetVideoSessionMemoryRequirementsKHR, - thunk64_vkInitializePerformanceApiINTEL, - thunk64_vkInvalidateMappedMemoryRanges, - thunk64_vkLatencySleepNV, - thunk64_vkMapMemory, - thunk64_vkMapMemory2, - thunk64_vkMapMemory2KHR, - thunk64_vkMergePipelineCaches, - thunk64_vkMergeValidationCachesEXT, - thunk64_vkQueueBeginDebugUtilsLabelEXT, - thunk64_vkQueueBindSparse, - thunk64_vkQueueEndDebugUtilsLabelEXT, - thunk64_vkQueueInsertDebugUtilsLabelEXT, - thunk64_vkQueueNotifyOutOfBandNV, - thunk64_vkQueuePresentKHR, - thunk64_vkQueueSetPerformanceConfigurationINTEL, - thunk64_vkQueueSubmit, - thunk64_vkQueueSubmit2, - thunk64_vkQueueSubmit2KHR, - thunk64_vkQueueWaitIdle, - thunk64_vkReleaseCapturedPipelineDataKHR, - thunk64_vkReleasePerformanceConfigurationINTEL, - thunk64_vkReleaseProfilingLockKHR, - thunk64_vkReleaseSwapchainImagesEXT, - thunk64_vkResetCommandBuffer, - thunk64_vkResetCommandPool, - thunk64_vkResetDescriptorPool, - thunk64_vkResetEvent, - thunk64_vkResetFences, - thunk64_vkResetQueryPool, - thunk64_vkResetQueryPoolEXT, - thunk64_vkSetDebugUtilsObjectNameEXT, - thunk64_vkSetDebugUtilsObjectTagEXT, - thunk64_vkSetDeviceMemoryPriorityEXT, - thunk64_vkSetEvent, - thunk64_vkSetHdrMetadataEXT, - thunk64_vkSetLatencyMarkerNV, - thunk64_vkSetLatencySleepModeNV, - thunk64_vkSetPrivateData, - thunk64_vkSetPrivateDataEXT, - thunk64_vkSignalSemaphore, - thunk64_vkSignalSemaphoreKHR, - thunk64_vkSubmitDebugUtilsMessageEXT, - thunk64_vkTransitionImageLayout, - thunk64_vkTransitionImageLayoutEXT, - thunk64_vkTrimCommandPool, - thunk64_vkTrimCommandPoolKHR, - thunk64_vkUninitializePerformanceApiINTEL, - thunk64_vkUnmapMemory, - thunk64_vkUnmapMemory2, - thunk64_vkUnmapMemory2KHR, - (void *)thunk64_vkUpdateDescriptorSetWithTemplate, - thunk64_vkUpdateDescriptorSetWithTemplateKHR, - (void *)thunk64_vkUpdateDescriptorSets, - thunk64_vkUpdateIndirectExecutionSetPipelineEXT, - thunk64_vkUpdateIndirectExecutionSetShaderEXT, - thunk64_vkUpdateVideoSessionParametersKHR, - thunk64_vkWaitForFences, - thunk64_vkWaitForPresentKHR, - thunk64_vkWaitSemaphores, - thunk64_vkWaitSemaphoresKHR, - thunk64_vkWriteAccelerationStructuresPropertiesKHR, - thunk64_vkWriteMicromapsPropertiesEXT, -}; -C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs) == unix_count); - -#endif /* _WIN64 */ - -#ifdef _WIN64 -const unixlib_entry_t __wine_unix_call_wow64_funcs[] = -#else -const unixlib_entry_t __wine_unix_call_funcs[] = -#endif -{ - init_vulkan, - vk_is_available_instance_function32, - vk_is_available_device_function32, - thunk32_vkAcquireNextImage2KHR, - thunk32_vkAcquireNextImageKHR, - thunk32_vkAcquirePerformanceConfigurationINTEL, - thunk32_vkAcquireProfilingLockKHR, - thunk32_vkAllocateCommandBuffers, - thunk32_vkAllocateDescriptorSets, - thunk32_vkAllocateMemory, - thunk32_vkAntiLagUpdateAMD, - thunk32_vkBeginCommandBuffer, - thunk32_vkBindAccelerationStructureMemoryNV, - thunk32_vkBindBufferMemory, - thunk32_vkBindBufferMemory2, - thunk32_vkBindBufferMemory2KHR, - thunk32_vkBindImageMemory, - thunk32_vkBindImageMemory2, - thunk32_vkBindImageMemory2KHR, - thunk32_vkBindOpticalFlowSessionImageNV, - thunk32_vkBindVideoSessionMemoryKHR, - thunk32_vkBuildAccelerationStructuresKHR, - thunk32_vkBuildMicromapsEXT, - (void *)thunk32_vkCmdBeginConditionalRenderingEXT, - (void *)thunk32_vkCmdBeginDebugUtilsLabelEXT, - (void *)thunk32_vkCmdBeginQuery, - (void *)thunk32_vkCmdBeginQueryIndexedEXT, - (void *)thunk32_vkCmdBeginRenderPass, - (void *)thunk32_vkCmdBeginRenderPass2, - (void *)thunk32_vkCmdBeginRenderPass2KHR, - (void *)thunk32_vkCmdBeginRendering, - (void *)thunk32_vkCmdBeginRenderingKHR, - (void *)thunk32_vkCmdBeginTransformFeedbackEXT, - (void *)thunk32_vkCmdBeginVideoCodingKHR, - (void *)thunk32_vkCmdBindDescriptorBufferEmbeddedSamplers2EXT, - (void *)thunk32_vkCmdBindDescriptorBufferEmbeddedSamplersEXT, - (void *)thunk32_vkCmdBindDescriptorBuffersEXT, - (void *)thunk32_vkCmdBindDescriptorSets, - (void *)thunk32_vkCmdBindDescriptorSets2, - (void *)thunk32_vkCmdBindDescriptorSets2KHR, - (void *)thunk32_vkCmdBindIndexBuffer, - (void *)thunk32_vkCmdBindIndexBuffer2, - (void *)thunk32_vkCmdBindIndexBuffer2KHR, - (void *)thunk32_vkCmdBindInvocationMaskHUAWEI, - (void *)thunk32_vkCmdBindPipeline, - (void *)thunk32_vkCmdBindPipelineShaderGroupNV, - (void *)thunk32_vkCmdBindShadersEXT, - (void *)thunk32_vkCmdBindShadingRateImageNV, - (void *)thunk32_vkCmdBindTransformFeedbackBuffersEXT, - (void *)thunk32_vkCmdBindVertexBuffers, - (void *)thunk32_vkCmdBindVertexBuffers2, - (void *)thunk32_vkCmdBindVertexBuffers2EXT, - (void *)thunk32_vkCmdBlitImage, - (void *)thunk32_vkCmdBlitImage2, - (void *)thunk32_vkCmdBlitImage2KHR, - (void *)thunk32_vkCmdBuildAccelerationStructureNV, - (void *)thunk32_vkCmdBuildAccelerationStructuresIndirectKHR, - (void *)thunk32_vkCmdBuildAccelerationStructuresKHR, - (void *)thunk32_vkCmdBuildMicromapsEXT, - (void *)thunk32_vkCmdClearAttachments, - (void *)thunk32_vkCmdClearColorImage, - (void *)thunk32_vkCmdClearDepthStencilImage, - (void *)thunk32_vkCmdControlVideoCodingKHR, - (void *)thunk32_vkCmdCopyAccelerationStructureKHR, - (void *)thunk32_vkCmdCopyAccelerationStructureNV, - (void *)thunk32_vkCmdCopyAccelerationStructureToMemoryKHR, - (void *)thunk32_vkCmdCopyBuffer, - (void *)thunk32_vkCmdCopyBuffer2, - (void *)thunk32_vkCmdCopyBuffer2KHR, - (void *)thunk32_vkCmdCopyBufferToImage, - (void *)thunk32_vkCmdCopyBufferToImage2, - (void *)thunk32_vkCmdCopyBufferToImage2KHR, - (void *)thunk32_vkCmdCopyImage, - (void *)thunk32_vkCmdCopyImage2, - (void *)thunk32_vkCmdCopyImage2KHR, - (void *)thunk32_vkCmdCopyImageToBuffer, - (void *)thunk32_vkCmdCopyImageToBuffer2, - (void *)thunk32_vkCmdCopyImageToBuffer2KHR, - (void *)thunk32_vkCmdCopyMemoryIndirectNV, - (void *)thunk32_vkCmdCopyMemoryToAccelerationStructureKHR, - (void *)thunk32_vkCmdCopyMemoryToImageIndirectNV, - (void *)thunk32_vkCmdCopyMemoryToMicromapEXT, - (void *)thunk32_vkCmdCopyMicromapEXT, - (void *)thunk32_vkCmdCopyMicromapToMemoryEXT, - (void *)thunk32_vkCmdCopyQueryPoolResults, - (void *)thunk32_vkCmdCuLaunchKernelNVX, - (void *)thunk32_vkCmdCudaLaunchKernelNV, - (void *)thunk32_vkCmdDebugMarkerBeginEXT, - (void *)thunk32_vkCmdDebugMarkerEndEXT, - (void *)thunk32_vkCmdDebugMarkerInsertEXT, - (void *)thunk32_vkCmdDecodeVideoKHR, - (void *)thunk32_vkCmdDecompressMemoryIndirectCountNV, - (void *)thunk32_vkCmdDecompressMemoryNV, - (void *)thunk32_vkCmdDispatch, - (void *)thunk32_vkCmdDispatchBase, - (void *)thunk32_vkCmdDispatchBaseKHR, - (void *)thunk32_vkCmdDispatchIndirect, - (void *)thunk32_vkCmdDraw, - (void *)thunk32_vkCmdDrawClusterHUAWEI, - (void *)thunk32_vkCmdDrawClusterIndirectHUAWEI, - (void *)thunk32_vkCmdDrawIndexed, - (void *)thunk32_vkCmdDrawIndexedIndirect, - (void *)thunk32_vkCmdDrawIndexedIndirectCount, - (void *)thunk32_vkCmdDrawIndexedIndirectCountAMD, - (void *)thunk32_vkCmdDrawIndexedIndirectCountKHR, - (void *)thunk32_vkCmdDrawIndirect, - (void *)thunk32_vkCmdDrawIndirectByteCountEXT, - (void *)thunk32_vkCmdDrawIndirectCount, - (void *)thunk32_vkCmdDrawIndirectCountAMD, - (void *)thunk32_vkCmdDrawIndirectCountKHR, - (void *)thunk32_vkCmdDrawMeshTasksEXT, - (void *)thunk32_vkCmdDrawMeshTasksIndirectCountEXT, - (void *)thunk32_vkCmdDrawMeshTasksIndirectCountNV, - (void *)thunk32_vkCmdDrawMeshTasksIndirectEXT, - (void *)thunk32_vkCmdDrawMeshTasksIndirectNV, - (void *)thunk32_vkCmdDrawMeshTasksNV, - (void *)thunk32_vkCmdDrawMultiEXT, - (void *)thunk32_vkCmdDrawMultiIndexedEXT, - (void *)thunk32_vkCmdEncodeVideoKHR, - (void *)thunk32_vkCmdEndConditionalRenderingEXT, - (void *)thunk32_vkCmdEndDebugUtilsLabelEXT, - (void *)thunk32_vkCmdEndQuery, - (void *)thunk32_vkCmdEndQueryIndexedEXT, - (void *)thunk32_vkCmdEndRenderPass, - (void *)thunk32_vkCmdEndRenderPass2, - (void *)thunk32_vkCmdEndRenderPass2KHR, - (void *)thunk32_vkCmdEndRendering, - (void *)thunk32_vkCmdEndRenderingKHR, - (void *)thunk32_vkCmdEndTransformFeedbackEXT, - (void *)thunk32_vkCmdEndVideoCodingKHR, - (void *)thunk32_vkCmdExecuteCommands, - (void *)thunk32_vkCmdExecuteGeneratedCommandsEXT, - (void *)thunk32_vkCmdExecuteGeneratedCommandsNV, - (void *)thunk32_vkCmdFillBuffer, - (void *)thunk32_vkCmdInsertDebugUtilsLabelEXT, - (void *)thunk32_vkCmdNextSubpass, - (void *)thunk32_vkCmdNextSubpass2, - (void *)thunk32_vkCmdNextSubpass2KHR, - (void *)thunk32_vkCmdOpticalFlowExecuteNV, - (void *)thunk32_vkCmdPipelineBarrier, - (void *)thunk32_vkCmdPipelineBarrier2, - (void *)thunk32_vkCmdPipelineBarrier2KHR, - (void *)thunk32_vkCmdPreprocessGeneratedCommandsEXT, - (void *)thunk32_vkCmdPreprocessGeneratedCommandsNV, - (void *)thunk32_vkCmdPushConstants, - (void *)thunk32_vkCmdPushConstants2, - (void *)thunk32_vkCmdPushConstants2KHR, - (void *)thunk32_vkCmdPushDescriptorSet, - (void *)thunk32_vkCmdPushDescriptorSet2, - (void *)thunk32_vkCmdPushDescriptorSet2KHR, - (void *)thunk32_vkCmdPushDescriptorSetKHR, - (void *)thunk32_vkCmdPushDescriptorSetWithTemplate, - (void *)thunk32_vkCmdPushDescriptorSetWithTemplate2, - (void *)thunk32_vkCmdPushDescriptorSetWithTemplate2KHR, - (void *)thunk32_vkCmdPushDescriptorSetWithTemplateKHR, - (void *)thunk32_vkCmdResetEvent, - (void *)thunk32_vkCmdResetEvent2, - (void *)thunk32_vkCmdResetEvent2KHR, - (void *)thunk32_vkCmdResetQueryPool, - (void *)thunk32_vkCmdResolveImage, - (void *)thunk32_vkCmdResolveImage2, - (void *)thunk32_vkCmdResolveImage2KHR, - (void *)thunk32_vkCmdSetAlphaToCoverageEnableEXT, - (void *)thunk32_vkCmdSetAlphaToOneEnableEXT, - (void *)thunk32_vkCmdSetAttachmentFeedbackLoopEnableEXT, - (void *)thunk32_vkCmdSetBlendConstants, - (void *)thunk32_vkCmdSetCheckpointNV, - (void *)thunk32_vkCmdSetCoarseSampleOrderNV, - (void *)thunk32_vkCmdSetColorBlendAdvancedEXT, - (void *)thunk32_vkCmdSetColorBlendEnableEXT, - (void *)thunk32_vkCmdSetColorBlendEquationEXT, - (void *)thunk32_vkCmdSetColorWriteEnableEXT, - (void *)thunk32_vkCmdSetColorWriteMaskEXT, - (void *)thunk32_vkCmdSetConservativeRasterizationModeEXT, - (void *)thunk32_vkCmdSetCoverageModulationModeNV, - (void *)thunk32_vkCmdSetCoverageModulationTableEnableNV, - (void *)thunk32_vkCmdSetCoverageModulationTableNV, - (void *)thunk32_vkCmdSetCoverageReductionModeNV, - (void *)thunk32_vkCmdSetCoverageToColorEnableNV, - (void *)thunk32_vkCmdSetCoverageToColorLocationNV, - (void *)thunk32_vkCmdSetCullMode, - (void *)thunk32_vkCmdSetCullModeEXT, - (void *)thunk32_vkCmdSetDepthBias, - (void *)thunk32_vkCmdSetDepthBias2EXT, - (void *)thunk32_vkCmdSetDepthBiasEnable, - (void *)thunk32_vkCmdSetDepthBiasEnableEXT, - (void *)thunk32_vkCmdSetDepthBounds, - (void *)thunk32_vkCmdSetDepthBoundsTestEnable, - (void *)thunk32_vkCmdSetDepthBoundsTestEnableEXT, - (void *)thunk32_vkCmdSetDepthClampEnableEXT, - (void *)thunk32_vkCmdSetDepthClampRangeEXT, - (void *)thunk32_vkCmdSetDepthClipEnableEXT, - (void *)thunk32_vkCmdSetDepthClipNegativeOneToOneEXT, - (void *)thunk32_vkCmdSetDepthCompareOp, - (void *)thunk32_vkCmdSetDepthCompareOpEXT, - (void *)thunk32_vkCmdSetDepthTestEnable, - (void *)thunk32_vkCmdSetDepthTestEnableEXT, - (void *)thunk32_vkCmdSetDepthWriteEnable, - (void *)thunk32_vkCmdSetDepthWriteEnableEXT, - (void *)thunk32_vkCmdSetDescriptorBufferOffsets2EXT, - (void *)thunk32_vkCmdSetDescriptorBufferOffsetsEXT, - (void *)thunk32_vkCmdSetDeviceMask, - (void *)thunk32_vkCmdSetDeviceMaskKHR, - (void *)thunk32_vkCmdSetDiscardRectangleEXT, - (void *)thunk32_vkCmdSetDiscardRectangleEnableEXT, - (void *)thunk32_vkCmdSetDiscardRectangleModeEXT, - (void *)thunk32_vkCmdSetEvent, - (void *)thunk32_vkCmdSetEvent2, - (void *)thunk32_vkCmdSetEvent2KHR, - (void *)thunk32_vkCmdSetExclusiveScissorEnableNV, - (void *)thunk32_vkCmdSetExclusiveScissorNV, - (void *)thunk32_vkCmdSetExtraPrimitiveOverestimationSizeEXT, - (void *)thunk32_vkCmdSetFragmentShadingRateEnumNV, - (void *)thunk32_vkCmdSetFragmentShadingRateKHR, - (void *)thunk32_vkCmdSetFrontFace, - (void *)thunk32_vkCmdSetFrontFaceEXT, - (void *)thunk32_vkCmdSetLineRasterizationModeEXT, - (void *)thunk32_vkCmdSetLineStipple, - (void *)thunk32_vkCmdSetLineStippleEXT, - (void *)thunk32_vkCmdSetLineStippleEnableEXT, - (void *)thunk32_vkCmdSetLineStippleKHR, - (void *)thunk32_vkCmdSetLineWidth, - (void *)thunk32_vkCmdSetLogicOpEXT, - (void *)thunk32_vkCmdSetLogicOpEnableEXT, - (void *)thunk32_vkCmdSetPatchControlPointsEXT, - thunk32_vkCmdSetPerformanceMarkerINTEL, - thunk32_vkCmdSetPerformanceOverrideINTEL, - thunk32_vkCmdSetPerformanceStreamMarkerINTEL, - (void *)thunk32_vkCmdSetPolygonModeEXT, - (void *)thunk32_vkCmdSetPrimitiveRestartEnable, - (void *)thunk32_vkCmdSetPrimitiveRestartEnableEXT, - (void *)thunk32_vkCmdSetPrimitiveTopology, - (void *)thunk32_vkCmdSetPrimitiveTopologyEXT, - (void *)thunk32_vkCmdSetProvokingVertexModeEXT, - (void *)thunk32_vkCmdSetRasterizationSamplesEXT, - (void *)thunk32_vkCmdSetRasterizationStreamEXT, - (void *)thunk32_vkCmdSetRasterizerDiscardEnable, - (void *)thunk32_vkCmdSetRasterizerDiscardEnableEXT, - (void *)thunk32_vkCmdSetRayTracingPipelineStackSizeKHR, - (void *)thunk32_vkCmdSetRenderingAttachmentLocations, - (void *)thunk32_vkCmdSetRenderingAttachmentLocationsKHR, - (void *)thunk32_vkCmdSetRenderingInputAttachmentIndices, - (void *)thunk32_vkCmdSetRenderingInputAttachmentIndicesKHR, - (void *)thunk32_vkCmdSetRepresentativeFragmentTestEnableNV, - (void *)thunk32_vkCmdSetSampleLocationsEXT, - (void *)thunk32_vkCmdSetSampleLocationsEnableEXT, - (void *)thunk32_vkCmdSetSampleMaskEXT, - (void *)thunk32_vkCmdSetScissor, - (void *)thunk32_vkCmdSetScissorWithCount, - (void *)thunk32_vkCmdSetScissorWithCountEXT, - (void *)thunk32_vkCmdSetShadingRateImageEnableNV, - (void *)thunk32_vkCmdSetStencilCompareMask, - (void *)thunk32_vkCmdSetStencilOp, - (void *)thunk32_vkCmdSetStencilOpEXT, - (void *)thunk32_vkCmdSetStencilReference, - (void *)thunk32_vkCmdSetStencilTestEnable, - (void *)thunk32_vkCmdSetStencilTestEnableEXT, - (void *)thunk32_vkCmdSetStencilWriteMask, - (void *)thunk32_vkCmdSetTessellationDomainOriginEXT, - (void *)thunk32_vkCmdSetVertexInputEXT, - (void *)thunk32_vkCmdSetViewport, - (void *)thunk32_vkCmdSetViewportShadingRatePaletteNV, - (void *)thunk32_vkCmdSetViewportSwizzleNV, - (void *)thunk32_vkCmdSetViewportWScalingEnableNV, - (void *)thunk32_vkCmdSetViewportWScalingNV, - (void *)thunk32_vkCmdSetViewportWithCount, - (void *)thunk32_vkCmdSetViewportWithCountEXT, - (void *)thunk32_vkCmdSubpassShadingHUAWEI, - (void *)thunk32_vkCmdTraceRaysIndirect2KHR, - (void *)thunk32_vkCmdTraceRaysIndirectKHR, - (void *)thunk32_vkCmdTraceRaysKHR, - (void *)thunk32_vkCmdTraceRaysNV, - (void *)thunk32_vkCmdUpdateBuffer, - (void *)thunk32_vkCmdUpdatePipelineIndirectBufferNV, - (void *)thunk32_vkCmdWaitEvents, - (void *)thunk32_vkCmdWaitEvents2, - (void *)thunk32_vkCmdWaitEvents2KHR, - (void *)thunk32_vkCmdWriteAccelerationStructuresPropertiesKHR, - (void *)thunk32_vkCmdWriteAccelerationStructuresPropertiesNV, - (void *)thunk32_vkCmdWriteBufferMarker2AMD, - (void *)thunk32_vkCmdWriteBufferMarkerAMD, - (void *)thunk32_vkCmdWriteMicromapsPropertiesEXT, - (void *)thunk32_vkCmdWriteTimestamp, - (void *)thunk32_vkCmdWriteTimestamp2, - (void *)thunk32_vkCmdWriteTimestamp2KHR, - thunk32_vkCompileDeferredNV, - thunk32_vkCopyAccelerationStructureKHR, - thunk32_vkCopyAccelerationStructureToMemoryKHR, - thunk32_vkCopyImageToImage, - thunk32_vkCopyImageToImageEXT, - thunk32_vkCopyImageToMemory, - thunk32_vkCopyImageToMemoryEXT, - thunk32_vkCopyMemoryToAccelerationStructureKHR, - thunk32_vkCopyMemoryToImage, - thunk32_vkCopyMemoryToImageEXT, - thunk32_vkCopyMemoryToMicromapEXT, - thunk32_vkCopyMicromapEXT, - thunk32_vkCopyMicromapToMemoryEXT, - thunk32_vkCreateAccelerationStructureKHR, - thunk32_vkCreateAccelerationStructureNV, - thunk32_vkCreateBuffer, - thunk32_vkCreateBufferView, - thunk32_vkCreateCommandPool, - thunk32_vkCreateComputePipelines, - thunk32_vkCreateCuFunctionNVX, - thunk32_vkCreateCuModuleNVX, - thunk32_vkCreateCudaFunctionNV, - thunk32_vkCreateCudaModuleNV, - thunk32_vkCreateDebugReportCallbackEXT, - thunk32_vkCreateDebugUtilsMessengerEXT, - thunk32_vkCreateDeferredOperationKHR, - thunk32_vkCreateDescriptorPool, - thunk32_vkCreateDescriptorSetLayout, - thunk32_vkCreateDescriptorUpdateTemplate, - thunk32_vkCreateDescriptorUpdateTemplateKHR, - thunk32_vkCreateDevice, - thunk32_vkCreateEvent, - thunk32_vkCreateFence, - thunk32_vkCreateFramebuffer, - thunk32_vkCreateGraphicsPipelines, - thunk32_vkCreateImage, - thunk32_vkCreateImageView, - thunk32_vkCreateIndirectCommandsLayoutEXT, - thunk32_vkCreateIndirectCommandsLayoutNV, - thunk32_vkCreateIndirectExecutionSetEXT, - thunk32_vkCreateInstance, - thunk32_vkCreateMicromapEXT, - thunk32_vkCreateOpticalFlowSessionNV, - thunk32_vkCreatePipelineBinariesKHR, - thunk32_vkCreatePipelineCache, - thunk32_vkCreatePipelineLayout, - thunk32_vkCreatePrivateDataSlot, - thunk32_vkCreatePrivateDataSlotEXT, - thunk32_vkCreateQueryPool, - thunk32_vkCreateRayTracingPipelinesKHR, - thunk32_vkCreateRayTracingPipelinesNV, - thunk32_vkCreateRenderPass, - thunk32_vkCreateRenderPass2, - thunk32_vkCreateRenderPass2KHR, - thunk32_vkCreateSampler, - thunk32_vkCreateSamplerYcbcrConversion, - thunk32_vkCreateSamplerYcbcrConversionKHR, - thunk32_vkCreateSemaphore, - thunk32_vkCreateShaderModule, - thunk32_vkCreateShadersEXT, - thunk32_vkCreateSwapchainKHR, - thunk32_vkCreateValidationCacheEXT, - thunk32_vkCreateVideoSessionKHR, - thunk32_vkCreateVideoSessionParametersKHR, - thunk32_vkCreateWin32SurfaceKHR, - thunk32_vkDebugMarkerSetObjectNameEXT, - thunk32_vkDebugMarkerSetObjectTagEXT, - thunk32_vkDebugReportMessageEXT, - thunk32_vkDeferredOperationJoinKHR, - thunk32_vkDestroyAccelerationStructureKHR, - thunk32_vkDestroyAccelerationStructureNV, - thunk32_vkDestroyBuffer, - thunk32_vkDestroyBufferView, - thunk32_vkDestroyCommandPool, - thunk32_vkDestroyCuFunctionNVX, - thunk32_vkDestroyCuModuleNVX, - thunk32_vkDestroyCudaFunctionNV, - thunk32_vkDestroyCudaModuleNV, - thunk32_vkDestroyDebugReportCallbackEXT, - thunk32_vkDestroyDebugUtilsMessengerEXT, - thunk32_vkDestroyDeferredOperationKHR, - thunk32_vkDestroyDescriptorPool, - thunk32_vkDestroyDescriptorSetLayout, - thunk32_vkDestroyDescriptorUpdateTemplate, - thunk32_vkDestroyDescriptorUpdateTemplateKHR, - thunk32_vkDestroyDevice, - thunk32_vkDestroyEvent, - thunk32_vkDestroyFence, - thunk32_vkDestroyFramebuffer, - thunk32_vkDestroyImage, - thunk32_vkDestroyImageView, - thunk32_vkDestroyIndirectCommandsLayoutEXT, - thunk32_vkDestroyIndirectCommandsLayoutNV, - thunk32_vkDestroyIndirectExecutionSetEXT, - thunk32_vkDestroyInstance, - thunk32_vkDestroyMicromapEXT, - thunk32_vkDestroyOpticalFlowSessionNV, - thunk32_vkDestroyPipeline, - thunk32_vkDestroyPipelineBinaryKHR, - thunk32_vkDestroyPipelineCache, - thunk32_vkDestroyPipelineLayout, - thunk32_vkDestroyPrivateDataSlot, - thunk32_vkDestroyPrivateDataSlotEXT, - thunk32_vkDestroyQueryPool, - thunk32_vkDestroyRenderPass, - thunk32_vkDestroySampler, - thunk32_vkDestroySamplerYcbcrConversion, - thunk32_vkDestroySamplerYcbcrConversionKHR, - thunk32_vkDestroySemaphore, - thunk32_vkDestroyShaderEXT, - thunk32_vkDestroyShaderModule, - thunk32_vkDestroySurfaceKHR, - thunk32_vkDestroySwapchainKHR, - thunk32_vkDestroyValidationCacheEXT, - thunk32_vkDestroyVideoSessionKHR, - thunk32_vkDestroyVideoSessionParametersKHR, - thunk32_vkDeviceWaitIdle, - thunk32_vkEndCommandBuffer, - thunk32_vkEnumerateDeviceExtensionProperties, - thunk32_vkEnumerateDeviceLayerProperties, - thunk32_vkEnumerateInstanceExtensionProperties, - thunk32_vkEnumerateInstanceVersion, - thunk32_vkEnumeratePhysicalDeviceGroups, - thunk32_vkEnumeratePhysicalDeviceGroupsKHR, - thunk32_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR, - thunk32_vkEnumeratePhysicalDevices, - thunk32_vkFlushMappedMemoryRanges, - thunk32_vkFreeCommandBuffers, - thunk32_vkFreeDescriptorSets, - thunk32_vkFreeMemory, - thunk32_vkGetAccelerationStructureBuildSizesKHR, - thunk32_vkGetAccelerationStructureDeviceAddressKHR, - thunk32_vkGetAccelerationStructureHandleNV, - thunk32_vkGetAccelerationStructureMemoryRequirementsNV, - thunk32_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT, - thunk32_vkGetBufferDeviceAddress, - thunk32_vkGetBufferDeviceAddressEXT, - thunk32_vkGetBufferDeviceAddressKHR, - thunk32_vkGetBufferMemoryRequirements, - thunk32_vkGetBufferMemoryRequirements2, - thunk32_vkGetBufferMemoryRequirements2KHR, - thunk32_vkGetBufferOpaqueCaptureAddress, - thunk32_vkGetBufferOpaqueCaptureAddressKHR, - thunk32_vkGetBufferOpaqueCaptureDescriptorDataEXT, - thunk32_vkGetCalibratedTimestampsEXT, - thunk32_vkGetCalibratedTimestampsKHR, - thunk32_vkGetCudaModuleCacheNV, - thunk32_vkGetDeferredOperationMaxConcurrencyKHR, - thunk32_vkGetDeferredOperationResultKHR, - (void *)thunk32_vkGetDescriptorEXT, - thunk32_vkGetDescriptorSetHostMappingVALVE, - thunk32_vkGetDescriptorSetLayoutBindingOffsetEXT, - thunk32_vkGetDescriptorSetLayoutHostMappingInfoVALVE, - thunk32_vkGetDescriptorSetLayoutSizeEXT, - thunk32_vkGetDescriptorSetLayoutSupport, - thunk32_vkGetDescriptorSetLayoutSupportKHR, - thunk32_vkGetDeviceAccelerationStructureCompatibilityKHR, - thunk32_vkGetDeviceBufferMemoryRequirements, - thunk32_vkGetDeviceBufferMemoryRequirementsKHR, - thunk32_vkGetDeviceFaultInfoEXT, - thunk32_vkGetDeviceGroupPeerMemoryFeatures, - thunk32_vkGetDeviceGroupPeerMemoryFeaturesKHR, - thunk32_vkGetDeviceGroupPresentCapabilitiesKHR, - thunk32_vkGetDeviceGroupSurfacePresentModesKHR, - thunk32_vkGetDeviceImageMemoryRequirements, - thunk32_vkGetDeviceImageMemoryRequirementsKHR, - thunk32_vkGetDeviceImageSparseMemoryRequirements, - thunk32_vkGetDeviceImageSparseMemoryRequirementsKHR, - thunk32_vkGetDeviceImageSubresourceLayout, - thunk32_vkGetDeviceImageSubresourceLayoutKHR, - thunk32_vkGetDeviceMemoryCommitment, - thunk32_vkGetDeviceMemoryOpaqueCaptureAddress, - thunk32_vkGetDeviceMemoryOpaqueCaptureAddressKHR, - thunk32_vkGetDeviceMicromapCompatibilityEXT, - thunk32_vkGetDeviceQueue, - thunk32_vkGetDeviceQueue2, - thunk32_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI, - thunk32_vkGetDynamicRenderingTilePropertiesQCOM, - thunk32_vkGetEncodedVideoSessionParametersKHR, - thunk32_vkGetEventStatus, - thunk32_vkGetFenceStatus, - thunk32_vkGetFramebufferTilePropertiesQCOM, - thunk32_vkGetGeneratedCommandsMemoryRequirementsEXT, - thunk32_vkGetGeneratedCommandsMemoryRequirementsNV, - thunk32_vkGetImageMemoryRequirements, - thunk32_vkGetImageMemoryRequirements2, - thunk32_vkGetImageMemoryRequirements2KHR, - thunk32_vkGetImageOpaqueCaptureDescriptorDataEXT, - thunk32_vkGetImageSparseMemoryRequirements, - thunk32_vkGetImageSparseMemoryRequirements2, - thunk32_vkGetImageSparseMemoryRequirements2KHR, - thunk32_vkGetImageSubresourceLayout, - thunk32_vkGetImageSubresourceLayout2, - thunk32_vkGetImageSubresourceLayout2EXT, - thunk32_vkGetImageSubresourceLayout2KHR, - thunk32_vkGetImageViewAddressNVX, - thunk32_vkGetImageViewHandle64NVX, - thunk32_vkGetImageViewHandleNVX, - thunk32_vkGetImageViewOpaqueCaptureDescriptorDataEXT, - thunk32_vkGetLatencyTimingsNV, - thunk32_vkGetMemoryHostPointerPropertiesEXT, - thunk32_vkGetMicromapBuildSizesEXT, - thunk32_vkGetPerformanceParameterINTEL, - thunk32_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT, - thunk32_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR, - thunk32_vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV, - thunk32_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR, - thunk32_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV, - thunk32_vkGetPhysicalDeviceExternalBufferProperties, - thunk32_vkGetPhysicalDeviceExternalBufferPropertiesKHR, - thunk32_vkGetPhysicalDeviceExternalFenceProperties, - thunk32_vkGetPhysicalDeviceExternalFencePropertiesKHR, - thunk32_vkGetPhysicalDeviceExternalSemaphoreProperties, - thunk32_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, - thunk32_vkGetPhysicalDeviceFeatures, - thunk32_vkGetPhysicalDeviceFeatures2, - thunk32_vkGetPhysicalDeviceFeatures2KHR, - thunk32_vkGetPhysicalDeviceFormatProperties, - thunk32_vkGetPhysicalDeviceFormatProperties2, - thunk32_vkGetPhysicalDeviceFormatProperties2KHR, - thunk32_vkGetPhysicalDeviceFragmentShadingRatesKHR, - thunk32_vkGetPhysicalDeviceImageFormatProperties, - thunk32_vkGetPhysicalDeviceImageFormatProperties2, - thunk32_vkGetPhysicalDeviceImageFormatProperties2KHR, - thunk32_vkGetPhysicalDeviceMemoryProperties, - thunk32_vkGetPhysicalDeviceMemoryProperties2, - thunk32_vkGetPhysicalDeviceMemoryProperties2KHR, - thunk32_vkGetPhysicalDeviceMultisamplePropertiesEXT, - thunk32_vkGetPhysicalDeviceOpticalFlowImageFormatsNV, - thunk32_vkGetPhysicalDevicePresentRectanglesKHR, - thunk32_vkGetPhysicalDeviceProperties, - thunk32_vkGetPhysicalDeviceProperties2, - thunk32_vkGetPhysicalDeviceProperties2KHR, - thunk32_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR, - thunk32_vkGetPhysicalDeviceQueueFamilyProperties, - thunk32_vkGetPhysicalDeviceQueueFamilyProperties2, - thunk32_vkGetPhysicalDeviceQueueFamilyProperties2KHR, - thunk32_vkGetPhysicalDeviceSparseImageFormatProperties, - thunk32_vkGetPhysicalDeviceSparseImageFormatProperties2, - thunk32_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, - thunk32_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV, - thunk32_vkGetPhysicalDeviceSurfaceCapabilities2KHR, - thunk32_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, - thunk32_vkGetPhysicalDeviceSurfaceFormats2KHR, - thunk32_vkGetPhysicalDeviceSurfaceFormatsKHR, - thunk32_vkGetPhysicalDeviceSurfacePresentModesKHR, - thunk32_vkGetPhysicalDeviceSurfaceSupportKHR, - thunk32_vkGetPhysicalDeviceToolProperties, - thunk32_vkGetPhysicalDeviceToolPropertiesEXT, - thunk32_vkGetPhysicalDeviceVideoCapabilitiesKHR, - thunk32_vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR, - thunk32_vkGetPhysicalDeviceVideoFormatPropertiesKHR, - thunk32_vkGetPhysicalDeviceWin32PresentationSupportKHR, - thunk32_vkGetPipelineBinaryDataKHR, - thunk32_vkGetPipelineCacheData, - thunk32_vkGetPipelineExecutableInternalRepresentationsKHR, - thunk32_vkGetPipelineExecutablePropertiesKHR, - thunk32_vkGetPipelineExecutableStatisticsKHR, - thunk32_vkGetPipelineIndirectDeviceAddressNV, - thunk32_vkGetPipelineIndirectMemoryRequirementsNV, - thunk32_vkGetPipelineKeyKHR, - thunk32_vkGetPipelinePropertiesEXT, - thunk32_vkGetPrivateData, - thunk32_vkGetPrivateDataEXT, - thunk32_vkGetQueryPoolResults, - thunk32_vkGetQueueCheckpointData2NV, - thunk32_vkGetQueueCheckpointDataNV, - thunk32_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR, - thunk32_vkGetRayTracingShaderGroupHandlesKHR, - thunk32_vkGetRayTracingShaderGroupHandlesNV, - thunk32_vkGetRayTracingShaderGroupStackSizeKHR, - thunk32_vkGetRenderAreaGranularity, - thunk32_vkGetRenderingAreaGranularity, - thunk32_vkGetRenderingAreaGranularityKHR, - thunk32_vkGetSamplerOpaqueCaptureDescriptorDataEXT, - thunk32_vkGetSemaphoreCounterValue, - thunk32_vkGetSemaphoreCounterValueKHR, - thunk32_vkGetShaderBinaryDataEXT, - thunk32_vkGetShaderInfoAMD, - thunk32_vkGetShaderModuleCreateInfoIdentifierEXT, - thunk32_vkGetShaderModuleIdentifierEXT, - thunk32_vkGetSwapchainImagesKHR, - thunk32_vkGetValidationCacheDataEXT, - thunk32_vkGetVideoSessionMemoryRequirementsKHR, - thunk32_vkInitializePerformanceApiINTEL, - thunk32_vkInvalidateMappedMemoryRanges, - thunk32_vkLatencySleepNV, - thunk32_vkMapMemory, - thunk32_vkMapMemory2, - thunk32_vkMapMemory2KHR, - thunk32_vkMergePipelineCaches, - thunk32_vkMergeValidationCachesEXT, - thunk32_vkQueueBeginDebugUtilsLabelEXT, - thunk32_vkQueueBindSparse, - thunk32_vkQueueEndDebugUtilsLabelEXT, - thunk32_vkQueueInsertDebugUtilsLabelEXT, - thunk32_vkQueueNotifyOutOfBandNV, - thunk32_vkQueuePresentKHR, - thunk32_vkQueueSetPerformanceConfigurationINTEL, - thunk32_vkQueueSubmit, - thunk32_vkQueueSubmit2, - thunk32_vkQueueSubmit2KHR, - thunk32_vkQueueWaitIdle, - thunk32_vkReleaseCapturedPipelineDataKHR, - thunk32_vkReleasePerformanceConfigurationINTEL, - thunk32_vkReleaseProfilingLockKHR, - thunk32_vkReleaseSwapchainImagesEXT, - thunk32_vkResetCommandBuffer, - thunk32_vkResetCommandPool, - thunk32_vkResetDescriptorPool, - thunk32_vkResetEvent, - thunk32_vkResetFences, - thunk32_vkResetQueryPool, - thunk32_vkResetQueryPoolEXT, - thunk32_vkSetDebugUtilsObjectNameEXT, - thunk32_vkSetDebugUtilsObjectTagEXT, - thunk32_vkSetDeviceMemoryPriorityEXT, - thunk32_vkSetEvent, - thunk32_vkSetHdrMetadataEXT, - thunk32_vkSetLatencyMarkerNV, - thunk32_vkSetLatencySleepModeNV, - thunk32_vkSetPrivateData, - thunk32_vkSetPrivateDataEXT, - thunk32_vkSignalSemaphore, - thunk32_vkSignalSemaphoreKHR, - thunk32_vkSubmitDebugUtilsMessageEXT, - thunk32_vkTransitionImageLayout, - thunk32_vkTransitionImageLayoutEXT, - thunk32_vkTrimCommandPool, - thunk32_vkTrimCommandPoolKHR, - thunk32_vkUninitializePerformanceApiINTEL, - thunk32_vkUnmapMemory, - thunk32_vkUnmapMemory2, - thunk32_vkUnmapMemory2KHR, - (void *)thunk32_vkUpdateDescriptorSetWithTemplate, - thunk32_vkUpdateDescriptorSetWithTemplateKHR, - (void *)thunk32_vkUpdateDescriptorSets, - thunk32_vkUpdateIndirectExecutionSetPipelineEXT, - thunk32_vkUpdateIndirectExecutionSetShaderEXT, - thunk32_vkUpdateVideoSessionParametersKHR, - thunk32_vkWaitForFences, - thunk32_vkWaitForPresentKHR, - thunk32_vkWaitSemaphores, - thunk32_vkWaitSemaphoresKHR, - thunk32_vkWriteAccelerationStructuresPropertiesKHR, - thunk32_vkWriteMicromapsPropertiesEXT, -}; -C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs) == unix_count); diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h deleted file mode 100644 index 1941b715912b..000000000000 --- a/dlls/winevulkan/vulkan_thunks.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Automatically generated from Vulkan vk.xml and video.xml; DO NOT EDIT! - * - * This file is generated from Vulkan vk.xml file covered - * by the following copyright and permission notice: - * - * Copyright 2015-2024 The Khronos Group Inc. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - * and from Vulkan video.xml file covered - * by the following copyright and permission notice: - * - * Copyright 2021-2024 The Khronos Group Inc. - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#ifndef __WINE_VULKAN_THUNKS_H -#define __WINE_VULKAN_THUNKS_H - -#define WINE_VK_VERSION VK_API_VERSION_1_4 - -/* Functions for which we have custom implementations outside of the thunks. */ -VkResult wine_vkAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo *pAllocateInfo, VkCommandBuffer *pCommandBuffers); -VkResult wine_vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory); -VkResult wine_vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer); -VkResult wine_vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCommandPool *pCommandPool, void *client_ptr); -VkResult wine_vkCreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT *pCallback); -VkResult wine_vkCreateDebugUtilsMessengerEXT(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerEXT *pMessenger); -VkResult wine_vkCreateDeferredOperationKHR(VkDevice device, const VkAllocationCallbacks *pAllocator, VkDeferredOperationKHR *pDeferredOperation); -VkResult wine_vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDevice *pDevice, void *client_ptr); -VkResult wine_vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImage *pImage); -VkResult wine_vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkInstance *pInstance, void *client_ptr); -void wine_vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks *pAllocator); -void wine_vkDestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks *pAllocator); -void wine_vkDestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, const VkAllocationCallbacks *pAllocator); -void wine_vkDestroyDeferredOperationKHR(VkDevice device, VkDeferredOperationKHR operation, const VkAllocationCallbacks *pAllocator); -void wine_vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator); -void wine_vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator); -VkResult wine_vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties); -VkResult wine_vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkLayerProperties *pProperties); -VkResult wine_vkEnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties); -VkResult wine_vkEnumerateInstanceVersion(uint32_t *pApiVersion); -VkResult wine_vkEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties); -VkResult wine_vkEnumeratePhysicalDeviceGroupsKHR(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties); -VkResult wine_vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, VkPhysicalDevice *pPhysicalDevices); -void wine_vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers); -void wine_vkFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks *pAllocator); -VkResult wine_vkGetCalibratedTimestampsEXT(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoKHR *pTimestampInfos, uint64_t *pTimestamps, uint64_t *pMaxDeviation); -VkResult wine_vkGetCalibratedTimestampsKHR(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoKHR *pTimestampInfos, uint64_t *pTimestamps, uint64_t *pMaxDeviation); -void wine_vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue *pQueue); -void wine_vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2 *pQueueInfo, VkQueue *pQueue); -VkResult wine_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice physicalDevice, uint32_t *pTimeDomainCount, VkTimeDomainKHR *pTimeDomains); -VkResult wine_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR(VkPhysicalDevice physicalDevice, uint32_t *pTimeDomainCount, VkTimeDomainKHR *pTimeDomains); -void wine_vkGetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, VkExternalBufferProperties *pExternalBufferProperties); -void wine_vkGetPhysicalDeviceExternalBufferPropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, VkExternalBufferProperties *pExternalBufferProperties); -void wine_vkGetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties); -void wine_vkGetPhysicalDeviceExternalFencePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties); -void wine_vkGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties); -void wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties); -VkResult wine_vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties); -VkResult wine_vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties); -VkResult wine_vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void **ppData); -VkResult wine_vkMapMemory2KHR(VkDevice device, const VkMemoryMapInfo *pMemoryMapInfo, void **ppData); -void wine_vkUnmapMemory(VkDevice device, VkDeviceMemory memory); -VkResult wine_vkUnmapMemory2KHR(VkDevice device, const VkMemoryUnmapInfo *pMemoryUnmapInfo); - -#endif /* __WINE_VULKAN_THUNKS_H */ diff --git a/dlls/winevulkan/winevulkan.json b/dlls/winevulkan/winevulkan.json deleted file mode 100644 index e1d7e8f9ccfd..000000000000 --- a/dlls/winevulkan/winevulkan.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "file_format_version": "1.0.0", - "ICD": { - "library_path": ".\\winevulkan.dll", - "api_version": "1.4.303" - } -} diff --git a/dlls/winevulkan/winevulkan.spec b/dlls/winevulkan/winevulkan.spec deleted file mode 100644 index 4c73f80eaee1..000000000000 --- a/dlls/winevulkan/winevulkan.spec +++ /dev/null @@ -1,283 +0,0 @@ -# Automatically generated from Vulkan vk.xml and video.xml; DO NOT EDIT! -# -# This file is generated from Vulkan vk.xml file covered -# by the following copyright and permission notice: -# -# Copyright 2015-2024 The Khronos Group Inc. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# and from Vulkan video.xml file covered -# by the following copyright and permission notice: -# -# Copyright 2021-2024 The Khronos Group Inc. -# SPDX-License-Identifier: Apache-2.0 OR MIT -# - -@ stdcall -private vk_icdGetInstanceProcAddr(ptr str) -@ stdcall -private vk_icdGetPhysicalDeviceProcAddr(ptr str) -@ stdcall -private vk_icdNegotiateLoaderICDInterfaceVersion(ptr) -@ stdcall vkAcquireNextImage2KHR(ptr ptr ptr) -@ stdcall vkAcquireNextImageKHR(ptr int64 int64 int64 int64 ptr) -@ stdcall vkAllocateCommandBuffers(ptr ptr ptr) -@ stdcall vkAllocateDescriptorSets(ptr ptr ptr) -@ stdcall vkAllocateMemory(ptr ptr ptr ptr) -@ stdcall vkBeginCommandBuffer(ptr ptr) -@ stdcall vkBindBufferMemory(ptr int64 int64 int64) -@ stdcall vkBindBufferMemory2(ptr long ptr) -@ stdcall vkBindImageMemory(ptr int64 int64 int64) -@ stdcall vkBindImageMemory2(ptr long ptr) -@ stdcall vkCmdBeginQuery(ptr int64 long long) -@ stdcall vkCmdBeginRenderPass(ptr ptr long) -@ stdcall vkCmdBeginRenderPass2(ptr ptr ptr) -@ stdcall vkCmdBeginRendering(ptr ptr) -@ stdcall vkCmdBindDescriptorSets(ptr long int64 long long ptr long ptr) -@ stdcall vkCmdBindDescriptorSets2(ptr ptr) -@ stdcall vkCmdBindIndexBuffer(ptr int64 int64 long) -@ stdcall vkCmdBindIndexBuffer2(ptr int64 int64 int64 long) -@ stdcall vkCmdBindPipeline(ptr long int64) -@ stdcall vkCmdBindVertexBuffers(ptr long long ptr ptr) -@ stdcall vkCmdBindVertexBuffers2(ptr long long ptr ptr ptr ptr) -@ stdcall vkCmdBlitImage(ptr int64 long int64 long long ptr long) -@ stdcall vkCmdBlitImage2(ptr ptr) -@ stdcall vkCmdClearAttachments(ptr long ptr long ptr) -@ stdcall vkCmdClearColorImage(ptr int64 long ptr long ptr) -@ stdcall vkCmdClearDepthStencilImage(ptr int64 long ptr long ptr) -@ stdcall vkCmdCopyBuffer(ptr int64 int64 long ptr) -@ stdcall vkCmdCopyBuffer2(ptr ptr) -@ stdcall vkCmdCopyBufferToImage(ptr int64 int64 long long ptr) -@ stdcall vkCmdCopyBufferToImage2(ptr ptr) -@ stdcall vkCmdCopyImage(ptr int64 long int64 long long ptr) -@ stdcall vkCmdCopyImage2(ptr ptr) -@ stdcall vkCmdCopyImageToBuffer(ptr int64 long int64 long ptr) -@ stdcall vkCmdCopyImageToBuffer2(ptr ptr) -@ stdcall vkCmdCopyQueryPoolResults(ptr int64 long long int64 int64 int64 long) -@ stdcall vkCmdDispatch(ptr long long long) -@ stdcall vkCmdDispatchBase(ptr long long long long long long) -@ stdcall vkCmdDispatchIndirect(ptr int64 int64) -@ stdcall vkCmdDraw(ptr long long long long) -@ stdcall vkCmdDrawIndexed(ptr long long long long long) -@ stdcall vkCmdDrawIndexedIndirect(ptr int64 int64 long long) -@ stdcall vkCmdDrawIndexedIndirectCount(ptr int64 int64 int64 int64 long long) -@ stdcall vkCmdDrawIndirect(ptr int64 int64 long long) -@ stdcall vkCmdDrawIndirectCount(ptr int64 int64 int64 int64 long long) -@ stdcall vkCmdEndQuery(ptr int64 long) -@ stdcall vkCmdEndRenderPass(ptr) -@ stdcall vkCmdEndRenderPass2(ptr ptr) -@ stdcall vkCmdEndRendering(ptr) -@ stdcall vkCmdExecuteCommands(ptr long ptr) -@ stdcall vkCmdFillBuffer(ptr int64 int64 int64 long) -@ stdcall vkCmdNextSubpass(ptr long) -@ stdcall vkCmdNextSubpass2(ptr ptr ptr) -@ stdcall vkCmdPipelineBarrier(ptr long long long long ptr long ptr long ptr) -@ stdcall vkCmdPipelineBarrier2(ptr ptr) -@ stdcall vkCmdPushConstants(ptr int64 long long long ptr) -@ stdcall vkCmdPushConstants2(ptr ptr) -@ stdcall vkCmdPushDescriptorSet(ptr long int64 long long ptr) -@ stdcall vkCmdPushDescriptorSet2(ptr ptr) -@ stdcall vkCmdPushDescriptorSetWithTemplate(ptr int64 int64 long ptr) -@ stdcall vkCmdPushDescriptorSetWithTemplate2(ptr ptr) -@ stdcall vkCmdResetEvent(ptr int64 long) -@ stdcall vkCmdResetEvent2(ptr int64 int64) -@ stdcall vkCmdResetQueryPool(ptr int64 long long) -@ stdcall vkCmdResolveImage(ptr int64 long int64 long long ptr) -@ stdcall vkCmdResolveImage2(ptr ptr) -@ stdcall vkCmdSetBlendConstants(ptr ptr) -@ stdcall vkCmdSetCullMode(ptr long) -@ stdcall vkCmdSetDepthBias(ptr float float float) -@ stdcall vkCmdSetDepthBiasEnable(ptr long) -@ stdcall vkCmdSetDepthBounds(ptr float float) -@ stdcall vkCmdSetDepthBoundsTestEnable(ptr long) -@ stdcall vkCmdSetDepthCompareOp(ptr long) -@ stdcall vkCmdSetDepthTestEnable(ptr long) -@ stdcall vkCmdSetDepthWriteEnable(ptr long) -@ stdcall vkCmdSetDeviceMask(ptr long) -@ stdcall vkCmdSetEvent(ptr int64 long) -@ stdcall vkCmdSetEvent2(ptr int64 ptr) -@ stdcall vkCmdSetFrontFace(ptr long) -@ stdcall vkCmdSetLineStipple(ptr long long) -@ stdcall vkCmdSetLineWidth(ptr float) -@ stdcall vkCmdSetPrimitiveRestartEnable(ptr long) -@ stdcall vkCmdSetPrimitiveTopology(ptr long) -@ stdcall vkCmdSetRasterizerDiscardEnable(ptr long) -@ stdcall vkCmdSetRenderingAttachmentLocations(ptr ptr) -@ stdcall vkCmdSetRenderingInputAttachmentIndices(ptr ptr) -@ stdcall vkCmdSetScissor(ptr long long ptr) -@ stdcall vkCmdSetScissorWithCount(ptr long ptr) -@ stdcall vkCmdSetStencilCompareMask(ptr long long) -@ stdcall vkCmdSetStencilOp(ptr long long long long long) -@ stdcall vkCmdSetStencilReference(ptr long long) -@ stdcall vkCmdSetStencilTestEnable(ptr long) -@ stdcall vkCmdSetStencilWriteMask(ptr long long) -@ stdcall vkCmdSetViewport(ptr long long ptr) -@ stdcall vkCmdSetViewportWithCount(ptr long ptr) -@ stdcall vkCmdUpdateBuffer(ptr int64 int64 int64 ptr) -@ stdcall vkCmdWaitEvents(ptr long ptr long long long ptr long ptr long ptr) -@ stdcall vkCmdWaitEvents2(ptr long ptr ptr) -@ stdcall vkCmdWriteTimestamp(ptr long int64 long) -@ stdcall vkCmdWriteTimestamp2(ptr int64 int64 long) -@ stdcall vkCopyImageToImage(ptr ptr) -@ stdcall vkCopyImageToMemory(ptr ptr) -@ stdcall vkCopyMemoryToImage(ptr ptr) -@ stdcall vkCreateBuffer(ptr ptr ptr ptr) -@ stdcall vkCreateBufferView(ptr ptr ptr ptr) -@ stdcall vkCreateCommandPool(ptr ptr ptr ptr) -@ stdcall vkCreateComputePipelines(ptr int64 long ptr ptr ptr) -@ stdcall vkCreateDescriptorPool(ptr ptr ptr ptr) -@ stdcall vkCreateDescriptorSetLayout(ptr ptr ptr ptr) -@ stdcall vkCreateDescriptorUpdateTemplate(ptr ptr ptr ptr) -@ stdcall vkCreateDevice(ptr ptr ptr ptr) -@ stub vkCreateDisplayModeKHR -@ stub vkCreateDisplayPlaneSurfaceKHR -@ stdcall vkCreateEvent(ptr ptr ptr ptr) -@ stdcall vkCreateFence(ptr ptr ptr ptr) -@ stdcall vkCreateFramebuffer(ptr ptr ptr ptr) -@ stdcall vkCreateGraphicsPipelines(ptr int64 long ptr ptr ptr) -@ stdcall vkCreateImage(ptr ptr ptr ptr) -@ stdcall vkCreateImageView(ptr ptr ptr ptr) -@ stdcall vkCreateInstance(ptr ptr ptr) -@ stdcall vkCreatePipelineCache(ptr ptr ptr ptr) -@ stdcall vkCreatePipelineLayout(ptr ptr ptr ptr) -@ stdcall vkCreatePrivateDataSlot(ptr ptr ptr ptr) -@ stdcall vkCreateQueryPool(ptr ptr ptr ptr) -@ stdcall vkCreateRenderPass(ptr ptr ptr ptr) -@ stdcall vkCreateRenderPass2(ptr ptr ptr ptr) -@ stdcall vkCreateSampler(ptr ptr ptr ptr) -@ stdcall vkCreateSamplerYcbcrConversion(ptr ptr ptr ptr) -@ stdcall vkCreateSemaphore(ptr ptr ptr ptr) -@ stdcall vkCreateShaderModule(ptr ptr ptr ptr) -@ stub vkCreateSharedSwapchainsKHR -@ stdcall vkCreateSwapchainKHR(ptr ptr ptr ptr) -@ stdcall vkCreateWin32SurfaceKHR(ptr ptr ptr ptr) -@ stdcall vkDestroyBuffer(ptr int64 ptr) -@ stdcall vkDestroyBufferView(ptr int64 ptr) -@ stdcall vkDestroyCommandPool(ptr int64 ptr) -@ stdcall vkDestroyDescriptorPool(ptr int64 ptr) -@ stdcall vkDestroyDescriptorSetLayout(ptr int64 ptr) -@ stdcall vkDestroyDescriptorUpdateTemplate(ptr int64 ptr) -@ stdcall vkDestroyDevice(ptr ptr) -@ stdcall vkDestroyEvent(ptr int64 ptr) -@ stdcall vkDestroyFence(ptr int64 ptr) -@ stdcall vkDestroyFramebuffer(ptr int64 ptr) -@ stdcall vkDestroyImage(ptr int64 ptr) -@ stdcall vkDestroyImageView(ptr int64 ptr) -@ stdcall vkDestroyInstance(ptr ptr) -@ stdcall vkDestroyPipeline(ptr int64 ptr) -@ stdcall vkDestroyPipelineCache(ptr int64 ptr) -@ stdcall vkDestroyPipelineLayout(ptr int64 ptr) -@ stdcall vkDestroyPrivateDataSlot(ptr int64 ptr) -@ stdcall vkDestroyQueryPool(ptr int64 ptr) -@ stdcall vkDestroyRenderPass(ptr int64 ptr) -@ stdcall vkDestroySampler(ptr int64 ptr) -@ stdcall vkDestroySamplerYcbcrConversion(ptr int64 ptr) -@ stdcall vkDestroySemaphore(ptr int64 ptr) -@ stdcall vkDestroyShaderModule(ptr int64 ptr) -@ stdcall vkDestroySurfaceKHR(ptr int64 ptr) -@ stdcall vkDestroySwapchainKHR(ptr int64 ptr) -@ stdcall vkDeviceWaitIdle(ptr) -@ stdcall vkEndCommandBuffer(ptr) -@ stdcall vkEnumerateDeviceExtensionProperties(ptr str ptr ptr) -@ stdcall vkEnumerateDeviceLayerProperties(ptr ptr ptr) -@ stdcall vkEnumerateInstanceExtensionProperties(str ptr ptr) -@ stdcall vkEnumerateInstanceLayerProperties(ptr ptr) -@ stdcall vkEnumerateInstanceVersion(ptr) -@ stdcall vkEnumeratePhysicalDeviceGroups(ptr ptr ptr) -@ stdcall vkEnumeratePhysicalDevices(ptr ptr ptr) -@ stdcall vkFlushMappedMemoryRanges(ptr long ptr) -@ stdcall vkFreeCommandBuffers(ptr int64 long ptr) -@ stdcall vkFreeDescriptorSets(ptr int64 long ptr) -@ stdcall vkFreeMemory(ptr int64 ptr) -@ stdcall vkGetBufferDeviceAddress(ptr ptr) -@ stdcall vkGetBufferMemoryRequirements(ptr int64 ptr) -@ stdcall vkGetBufferMemoryRequirements2(ptr ptr ptr) -@ stdcall vkGetBufferOpaqueCaptureAddress(ptr ptr) -@ stub vkGetCommandPoolMemoryConsumption -@ stdcall vkGetDescriptorSetLayoutSupport(ptr ptr ptr) -@ stdcall vkGetDeviceBufferMemoryRequirements(ptr ptr ptr) -@ stdcall vkGetDeviceGroupPeerMemoryFeatures(ptr long long long ptr) -@ stdcall vkGetDeviceGroupPresentCapabilitiesKHR(ptr ptr) -@ stdcall vkGetDeviceGroupSurfacePresentModesKHR(ptr int64 ptr) -@ stdcall vkGetDeviceImageMemoryRequirements(ptr ptr ptr) -@ stdcall vkGetDeviceImageSparseMemoryRequirements(ptr ptr ptr ptr) -@ stdcall vkGetDeviceImageSubresourceLayout(ptr ptr ptr) -@ stdcall vkGetDeviceMemoryCommitment(ptr int64 ptr) -@ stdcall vkGetDeviceMemoryOpaqueCaptureAddress(ptr ptr) -@ stdcall vkGetDeviceProcAddr(ptr str) -@ stdcall vkGetDeviceQueue(ptr long long ptr) -@ stdcall vkGetDeviceQueue2(ptr ptr ptr) -@ stub vkGetDisplayModePropertiesKHR -@ stub vkGetDisplayPlaneCapabilitiesKHR -@ stub vkGetDisplayPlaneSupportedDisplaysKHR -@ stdcall vkGetEventStatus(ptr int64) -@ stub vkGetFaultData -@ stdcall vkGetFenceStatus(ptr int64) -@ stdcall vkGetImageMemoryRequirements(ptr int64 ptr) -@ stdcall vkGetImageMemoryRequirements2(ptr ptr ptr) -@ stdcall vkGetImageSparseMemoryRequirements(ptr int64 ptr ptr) -@ stdcall vkGetImageSparseMemoryRequirements2(ptr ptr ptr ptr) -@ stdcall vkGetImageSubresourceLayout(ptr int64 ptr ptr) -@ stdcall vkGetImageSubresourceLayout2(ptr int64 ptr ptr) -@ stdcall vkGetInstanceProcAddr(ptr str) -@ stub vkGetPhysicalDeviceDisplayPlanePropertiesKHR -@ stub vkGetPhysicalDeviceDisplayPropertiesKHR -@ stdcall vkGetPhysicalDeviceExternalBufferProperties(ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceExternalFenceProperties(ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceExternalSemaphoreProperties(ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceFeatures(ptr ptr) -@ stdcall vkGetPhysicalDeviceFeatures2(ptr ptr) -@ stdcall vkGetPhysicalDeviceFormatProperties(ptr long ptr) -@ stdcall vkGetPhysicalDeviceFormatProperties2(ptr long ptr) -@ stdcall vkGetPhysicalDeviceImageFormatProperties(ptr long long long long long ptr) -@ stdcall vkGetPhysicalDeviceImageFormatProperties2(ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceMemoryProperties(ptr ptr) -@ stdcall vkGetPhysicalDeviceMemoryProperties2(ptr ptr) -@ stdcall vkGetPhysicalDevicePresentRectanglesKHR(ptr int64 ptr ptr) -@ stdcall vkGetPhysicalDeviceProperties(ptr ptr) -@ stdcall vkGetPhysicalDeviceProperties2(ptr ptr) -@ stdcall vkGetPhysicalDeviceQueueFamilyProperties(ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceQueueFamilyProperties2(ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceSparseImageFormatProperties(ptr long long long long long ptr ptr) -@ stdcall vkGetPhysicalDeviceSparseImageFormatProperties2(ptr ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceSurfaceCapabilities2KHR(ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceSurfaceCapabilitiesKHR(ptr int64 ptr) -@ stdcall vkGetPhysicalDeviceSurfaceFormats2KHR(ptr ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceSurfaceFormatsKHR(ptr int64 ptr ptr) -@ stdcall vkGetPhysicalDeviceSurfacePresentModesKHR(ptr int64 ptr ptr) -@ stdcall vkGetPhysicalDeviceSurfaceSupportKHR(ptr long int64 ptr) -@ stdcall vkGetPhysicalDeviceToolProperties(ptr ptr ptr) -@ stdcall vkGetPhysicalDeviceWin32PresentationSupportKHR(ptr long) -@ stdcall vkGetPipelineCacheData(ptr int64 ptr ptr) -@ stdcall vkGetPrivateData(ptr long int64 int64 ptr) -@ stdcall vkGetQueryPoolResults(ptr int64 long long long ptr int64 long) -@ stdcall vkGetRenderAreaGranularity(ptr int64 ptr) -@ stdcall vkGetRenderingAreaGranularity(ptr ptr ptr) -@ stdcall vkGetSemaphoreCounterValue(ptr int64 ptr) -@ stdcall vkGetSwapchainImagesKHR(ptr int64 ptr ptr) -@ stdcall vkInvalidateMappedMemoryRanges(ptr long ptr) -@ stdcall vkMapMemory(ptr int64 int64 int64 long ptr) -@ stdcall vkMapMemory2(ptr ptr ptr) -@ stdcall vkMergePipelineCaches(ptr int64 long ptr) -@ stdcall vkQueueBindSparse(ptr long ptr int64) -@ stdcall vkQueuePresentKHR(ptr ptr) -@ stdcall vkQueueSubmit(ptr long ptr int64) -@ stdcall vkQueueSubmit2(ptr long ptr int64) -@ stdcall vkQueueWaitIdle(ptr) -@ stdcall vkResetCommandBuffer(ptr long) -@ stdcall vkResetCommandPool(ptr int64 long) -@ stdcall vkResetDescriptorPool(ptr int64 long) -@ stdcall vkResetEvent(ptr int64) -@ stdcall vkResetFences(ptr long ptr) -@ stdcall vkResetQueryPool(ptr int64 long long) -@ stdcall vkSetEvent(ptr int64) -@ stdcall vkSetPrivateData(ptr long int64 int64 int64) -@ stdcall vkSignalSemaphore(ptr ptr) -@ stdcall vkTransitionImageLayout(ptr long ptr) -@ stdcall vkTrimCommandPool(ptr int64 long) -@ stdcall vkUnmapMemory(ptr int64) -@ stdcall vkUnmapMemory2(ptr ptr) -@ stdcall vkUpdateDescriptorSetWithTemplate(ptr int64 int64 ptr) -@ stdcall vkUpdateDescriptorSets(ptr long ptr long ptr) -@ stdcall vkWaitForFences(ptr long ptr long int64) -@ stdcall vkWaitSemaphores(ptr ptr int64) -@ stdcall -private DllRegisterServer() -@ stdcall -private DllUnregisterServer() diff --git a/include/wine/vulkan.h b/include/wine/vulkan.h deleted file mode 100644 index bd9550c64c16..000000000000 --- a/include/wine/vulkan.h +++ /dev/null @@ -1,18981 +0,0 @@ -/* Automatically generated from Vulkan vk.xml and video.xml; DO NOT EDIT! - * - * This file is generated from Vulkan vk.xml file covered - * by the following copyright and permission notice: - * - * Copyright 2015-2024 The Khronos Group Inc. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - * and from Vulkan video.xml file covered - * by the following copyright and permission notice: - * - * Copyright 2021-2024 The Khronos Group Inc. - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#ifndef __WINE_VULKAN_H -#define __WINE_VULKAN_H - -#include -#include - -#ifdef WINE_UNIX_LIB -#define VK_NO_PROTOTYPES -#define VKAPI_CALL -#define WINE_VK_ALIGN(x) -#endif - -#ifndef VKAPI_CALL -#define VKAPI_CALL __stdcall -#endif - -#ifndef VKAPI_PTR -#define VKAPI_PTR VKAPI_CALL -#endif - -#ifndef WINE_VK_ALIGN -#define WINE_VK_ALIGN DECLSPEC_ALIGN -#endif - -#define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256 -#define VK_UUID_SIZE 16 -#define VK_LUID_SIZE 8 -#define VK_MAX_EXTENSION_NAME_SIZE 256 -#define VK_MAX_DESCRIPTION_SIZE 256 -#define VK_MAX_MEMORY_TYPES 32 -#define VK_MAX_MEMORY_HEAPS 16 -#define VK_LOD_CLAMP_NONE 1000.0F -#define VK_REMAINING_MIP_LEVELS (~0U) -#define VK_REMAINING_ARRAY_LAYERS (~0U) -#define VK_REMAINING_3D_SLICES_EXT (~0U) -#define VK_WHOLE_SIZE (~0ULL) -#define VK_ATTACHMENT_UNUSED (~0U) -#define VK_TRUE 1 -#define VK_FALSE 0 -#define VK_QUEUE_FAMILY_IGNORED (~0U) -#define VK_QUEUE_FAMILY_EXTERNAL (~1U) -#define VK_QUEUE_FAMILY_FOREIGN_EXT (~2U) -#define VK_SUBPASS_EXTERNAL (~0U) -#define VK_MAX_DEVICE_GROUP_SIZE 32 -#define VK_MAX_DRIVER_NAME_SIZE 256 -#define VK_MAX_DRIVER_INFO_SIZE 256 -#define VK_SHADER_UNUSED_KHR (~0U) -#define VK_MAX_GLOBAL_PRIORITY_SIZE 16 -#define VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT 32 -#define VK_MAX_PIPELINE_BINARY_KEY_SIZE_KHR 32 -#define VK_MAX_VIDEO_AV1_REFERENCES_PER_FRAME_KHR 7 -#define VK_SHADER_INDEX_UNUSED_AMDX (~0U) -#define VK_KHR_SURFACE_SPEC_VERSION 25 -#define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface" -#define VK_KHR_SWAPCHAIN_SPEC_VERSION 70 -#define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain" -#define VK_KHR_WIN32_SURFACE_SPEC_VERSION 6 -#define VK_KHR_WIN32_SURFACE_EXTENSION_NAME "VK_KHR_win32_surface" -#define VK_EXT_DEBUG_REPORT_SPEC_VERSION 10 -#define VK_EXT_DEBUG_REPORT_EXTENSION_NAME "VK_EXT_debug_report" -#define VK_NV_GLSL_SHADER_SPEC_VERSION 1 -#define VK_NV_GLSL_SHADER_EXTENSION_NAME "VK_NV_glsl_shader" -#define VK_EXT_DEPTH_RANGE_UNRESTRICTED_SPEC_VERSION 1 -#define VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME "VK_EXT_depth_range_unrestricted" -#define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 3 -#define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME "VK_KHR_sampler_mirror_clamp_to_edge" -#define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1 -#define VK_IMG_FILTER_CUBIC_EXTENSION_NAME "VK_IMG_filter_cubic" -#define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1 -#define VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME "VK_AMD_rasterization_order" -#define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1 -#define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax" -#define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1 -#define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter" -#define VK_EXT_DEBUG_MARKER_SPEC_VERSION 4 -#define VK_EXT_DEBUG_MARKER_EXTENSION_NAME "VK_EXT_debug_marker" -#define VK_KHR_VIDEO_QUEUE_SPEC_VERSION 8 -#define VK_KHR_VIDEO_QUEUE_EXTENSION_NAME "VK_KHR_video_queue" -#define VK_KHR_VIDEO_DECODE_QUEUE_SPEC_VERSION 8 -#define VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME "VK_KHR_video_decode_queue" -#define VK_AMD_GCN_SHADER_SPEC_VERSION 1 -#define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader" -#define VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION 1 -#define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation" -#define VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION 1 -#define VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME "VK_EXT_transform_feedback" -#define VK_NVX_BINARY_IMPORT_SPEC_VERSION 2 -#define VK_NVX_BINARY_IMPORT_EXTENSION_NAME "VK_NVX_binary_import" -#define VK_NVX_IMAGE_VIEW_HANDLE_SPEC_VERSION 3 -#define VK_NVX_IMAGE_VIEW_HANDLE_EXTENSION_NAME "VK_NVX_image_view_handle" -#define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 2 -#define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count" -#define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION 1 -#define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME "VK_AMD_negative_viewport_height" -#define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 2 -#define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float" -#define VK_AMD_SHADER_BALLOT_SPEC_VERSION 1 -#define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot" -#define VK_KHR_VIDEO_ENCODE_H264_SPEC_VERSION 14 -#define VK_KHR_VIDEO_ENCODE_H264_EXTENSION_NAME "VK_KHR_video_encode_h264" -#define VK_KHR_VIDEO_ENCODE_H265_SPEC_VERSION 14 -#define VK_KHR_VIDEO_ENCODE_H265_EXTENSION_NAME "VK_KHR_video_encode_h265" -#define VK_KHR_VIDEO_DECODE_H264_SPEC_VERSION 9 -#define VK_KHR_VIDEO_DECODE_H264_EXTENSION_NAME "VK_KHR_video_decode_h264" -#define VK_AMD_TEXTURE_GATHER_BIAS_LOD_SPEC_VERSION 1 -#define VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME "VK_AMD_texture_gather_bias_lod" -#define VK_AMD_SHADER_INFO_SPEC_VERSION 1 -#define VK_AMD_SHADER_INFO_EXTENSION_NAME "VK_AMD_shader_info" -#define VK_KHR_DYNAMIC_RENDERING_SPEC_VERSION 1 -#define VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME "VK_KHR_dynamic_rendering" -#define VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_SPEC_VERSION 1 -#define VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_EXTENSION_NAME "VK_AMD_shader_image_load_store_lod" -#define VK_NV_CORNER_SAMPLED_IMAGE_SPEC_VERSION 2 -#define VK_NV_CORNER_SAMPLED_IMAGE_EXTENSION_NAME "VK_NV_corner_sampled_image" -#define VK_KHR_MULTIVIEW_SPEC_VERSION 1 -#define VK_KHR_MULTIVIEW_EXTENSION_NAME "VK_KHR_multiview" -#define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1 -#define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc" -#define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 2 -#define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2" -#define VK_KHR_DEVICE_GROUP_SPEC_VERSION 4 -#define VK_KHR_DEVICE_GROUP_EXTENSION_NAME "VK_KHR_device_group" -#define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 3 -#define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags" -#define VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION 1 -#define VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME "VK_KHR_shader_draw_parameters" -#define VK_EXT_SHADER_SUBGROUP_BALLOT_SPEC_VERSION 1 -#define VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME "VK_EXT_shader_subgroup_ballot" -#define VK_EXT_SHADER_SUBGROUP_VOTE_SPEC_VERSION 1 -#define VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME "VK_EXT_shader_subgroup_vote" -#define VK_EXT_TEXTURE_COMPRESSION_ASTC_HDR_SPEC_VERSION 1 -#define VK_EXT_TEXTURE_COMPRESSION_ASTC_HDR_EXTENSION_NAME "VK_EXT_texture_compression_astc_hdr" -#define VK_EXT_ASTC_DECODE_MODE_SPEC_VERSION 1 -#define VK_EXT_ASTC_DECODE_MODE_EXTENSION_NAME "VK_EXT_astc_decode_mode" -#define VK_EXT_PIPELINE_ROBUSTNESS_SPEC_VERSION 1 -#define VK_EXT_PIPELINE_ROBUSTNESS_EXTENSION_NAME "VK_EXT_pipeline_robustness" -#define VK_KHR_MAINTENANCE1_SPEC_VERSION VK_KHR_MAINTENANCE_1_SPEC_VERSION -#define VK_KHR_MAINTENANCE1_EXTENSION_NAME VK_KHR_MAINTENANCE_1_EXTENSION_NAME -#define VK_KHR_MAINTENANCE_1_SPEC_VERSION 2 -#define VK_KHR_MAINTENANCE_1_EXTENSION_NAME "VK_KHR_maintenance1" -#define VK_MAX_DEVICE_GROUP_SIZE_KHR VK_MAX_DEVICE_GROUP_SIZE -#define VK_KHR_DEVICE_GROUP_CREATION_SPEC_VERSION 1 -#define VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME "VK_KHR_device_group_creation" -#define VK_LUID_SIZE_KHR VK_LUID_SIZE -#define VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_memory_capabilities" -#define VK_QUEUE_FAMILY_EXTERNAL_KHR VK_QUEUE_FAMILY_EXTERNAL -#define VK_KHR_EXTERNAL_MEMORY_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME "VK_KHR_external_memory" -#define VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_KHR_external_memory_win32" -#define VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_semaphore_capabilities" -#define VK_KHR_EXTERNAL_SEMAPHORE_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME "VK_KHR_external_semaphore" -#define VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION 2 -#define VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME "VK_KHR_push_descriptor" -#define VK_EXT_CONDITIONAL_RENDERING_SPEC_VERSION 2 -#define VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME "VK_EXT_conditional_rendering" -#define VK_KHR_SHADER_FLOAT16_INT8_SPEC_VERSION 1 -#define VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME "VK_KHR_shader_float16_int8" -#define VK_KHR_16BIT_STORAGE_SPEC_VERSION 1 -#define VK_KHR_16BIT_STORAGE_EXTENSION_NAME "VK_KHR_16bit_storage" -#define VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION 2 -#define VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME "VK_KHR_incremental_present" -#define VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION 1 -#define VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME "VK_KHR_descriptor_update_template" -#define VK_NV_CLIP_SPACE_W_SCALING_SPEC_VERSION 1 -#define VK_NV_CLIP_SPACE_W_SCALING_EXTENSION_NAME "VK_NV_clip_space_w_scaling" -#define VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_SPEC_VERSION 1 -#define VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_EXTENSION_NAME "VK_NV_sample_mask_override_coverage" -#define VK_NV_GEOMETRY_SHADER_PASSTHROUGH_SPEC_VERSION 1 -#define VK_NV_GEOMETRY_SHADER_PASSTHROUGH_EXTENSION_NAME "VK_NV_geometry_shader_passthrough" -#define VK_NV_VIEWPORT_ARRAY2_SPEC_VERSION VK_NV_VIEWPORT_ARRAY_2_SPEC_VERSION -#define VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME VK_NV_VIEWPORT_ARRAY_2_EXTENSION_NAME -#define VK_NV_VIEWPORT_ARRAY_2_SPEC_VERSION 1 -#define VK_NV_VIEWPORT_ARRAY_2_EXTENSION_NAME "VK_NV_viewport_array2" -#define VK_NV_VIEWPORT_SWIZZLE_SPEC_VERSION 1 -#define VK_NV_VIEWPORT_SWIZZLE_EXTENSION_NAME "VK_NV_viewport_swizzle" -#define VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION 2 -#define VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME "VK_EXT_discard_rectangles" -#define VK_EXT_CONSERVATIVE_RASTERIZATION_SPEC_VERSION 1 -#define VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME "VK_EXT_conservative_rasterization" -#define VK_EXT_DEPTH_CLIP_ENABLE_SPEC_VERSION 1 -#define VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME "VK_EXT_depth_clip_enable" -#define VK_EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION 5 -#define VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME "VK_EXT_swapchain_colorspace" -#define VK_EXT_HDR_METADATA_SPEC_VERSION 3 -#define VK_EXT_HDR_METADATA_EXTENSION_NAME "VK_EXT_hdr_metadata" -#define VK_KHR_IMAGELESS_FRAMEBUFFER_SPEC_VERSION 1 -#define VK_KHR_IMAGELESS_FRAMEBUFFER_EXTENSION_NAME "VK_KHR_imageless_framebuffer" -#define VK_KHR_CREATE_RENDERPASS_2_SPEC_VERSION 1 -#define VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME "VK_KHR_create_renderpass2" -#define VK_IMG_RELAXED_LINE_RASTERIZATION_SPEC_VERSION 1 -#define VK_IMG_RELAXED_LINE_RASTERIZATION_EXTENSION_NAME "VK_IMG_relaxed_line_rasterization" -#define VK_KHR_EXTERNAL_FENCE_CAPABILITIES_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_fence_capabilities" -#define VK_KHR_EXTERNAL_FENCE_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME "VK_KHR_external_fence" -#define VK_KHR_PERFORMANCE_QUERY_SPEC_VERSION 1 -#define VK_KHR_PERFORMANCE_QUERY_EXTENSION_NAME "VK_KHR_performance_query" -#define VK_KHR_MAINTENANCE2_SPEC_VERSION VK_KHR_MAINTENANCE_2_SPEC_VERSION -#define VK_KHR_MAINTENANCE2_EXTENSION_NAME VK_KHR_MAINTENANCE_2_EXTENSION_NAME -#define VK_KHR_MAINTENANCE_2_SPEC_VERSION 1 -#define VK_KHR_MAINTENANCE_2_EXTENSION_NAME "VK_KHR_maintenance2" -#define VK_KHR_GET_SURFACE_CAPABILITIES_2_SPEC_VERSION 1 -#define VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME "VK_KHR_get_surface_capabilities2" -#define VK_KHR_VARIABLE_POINTERS_SPEC_VERSION 1 -#define VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME "VK_KHR_variable_pointers" -#define VK_EXT_QUEUE_FAMILY_FOREIGN_SPEC_VERSION 1 -#define VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME "VK_EXT_queue_family_foreign" -#define VK_KHR_DEDICATED_ALLOCATION_SPEC_VERSION 3 -#define VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_KHR_dedicated_allocation" -#define VK_EXT_DEBUG_UTILS_SPEC_VERSION 2 -#define VK_EXT_DEBUG_UTILS_EXTENSION_NAME "VK_EXT_debug_utils" -#define VK_EXT_SAMPLER_FILTER_MINMAX_SPEC_VERSION 2 -#define VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME "VK_EXT_sampler_filter_minmax" -#define VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_SPEC_VERSION 1 -#define VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME "VK_KHR_storage_buffer_storage_class" -#define VK_AMD_GPU_SHADER_INT16_SPEC_VERSION 2 -#define VK_AMD_GPU_SHADER_INT16_EXTENSION_NAME "VK_AMD_gpu_shader_int16" -#define VK_AMD_MIXED_ATTACHMENT_SAMPLES_SPEC_VERSION 1 -#define VK_AMD_MIXED_ATTACHMENT_SAMPLES_EXTENSION_NAME "VK_AMD_mixed_attachment_samples" -#define VK_AMD_SHADER_FRAGMENT_MASK_SPEC_VERSION 1 -#define VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME "VK_AMD_shader_fragment_mask" -#define VK_EXT_INLINE_UNIFORM_BLOCK_SPEC_VERSION 1 -#define VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME "VK_EXT_inline_uniform_block" -#define VK_EXT_SHADER_STENCIL_EXPORT_SPEC_VERSION 1 -#define VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME "VK_EXT_shader_stencil_export" -#define VK_EXT_SAMPLE_LOCATIONS_SPEC_VERSION 1 -#define VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME "VK_EXT_sample_locations" -#define VK_KHR_RELAXED_BLOCK_LAYOUT_SPEC_VERSION 1 -#define VK_KHR_RELAXED_BLOCK_LAYOUT_EXTENSION_NAME "VK_KHR_relaxed_block_layout" -#define VK_KHR_GET_MEMORY_REQUIREMENTS_2_SPEC_VERSION 1 -#define VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME "VK_KHR_get_memory_requirements2" -#define VK_KHR_IMAGE_FORMAT_LIST_SPEC_VERSION 1 -#define VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME "VK_KHR_image_format_list" -#define VK_EXT_BLEND_OPERATION_ADVANCED_SPEC_VERSION 2 -#define VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME "VK_EXT_blend_operation_advanced" -#define VK_NV_FRAGMENT_COVERAGE_TO_COLOR_SPEC_VERSION 1 -#define VK_NV_FRAGMENT_COVERAGE_TO_COLOR_EXTENSION_NAME "VK_NV_fragment_coverage_to_color" -#define VK_NV_FRAMEBUFFER_MIXED_SAMPLES_SPEC_VERSION 1 -#define VK_NV_FRAMEBUFFER_MIXED_SAMPLES_EXTENSION_NAME "VK_NV_framebuffer_mixed_samples" -#define VK_NV_FILL_RECTANGLE_SPEC_VERSION 1 -#define VK_NV_FILL_RECTANGLE_EXTENSION_NAME "VK_NV_fill_rectangle" -#define VK_NV_SHADER_SM_BUILTINS_SPEC_VERSION 1 -#define VK_NV_SHADER_SM_BUILTINS_EXTENSION_NAME "VK_NV_shader_sm_builtins" -#define VK_EXT_POST_DEPTH_COVERAGE_SPEC_VERSION 1 -#define VK_EXT_POST_DEPTH_COVERAGE_EXTENSION_NAME "VK_EXT_post_depth_coverage" -#define VK_KHR_SAMPLER_YCBCR_CONVERSION_SPEC_VERSION 14 -#define VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME "VK_KHR_sampler_ycbcr_conversion" -#define VK_KHR_BIND_MEMORY_2_SPEC_VERSION 1 -#define VK_KHR_BIND_MEMORY_2_EXTENSION_NAME "VK_KHR_bind_memory2" -#define VK_EXT_VALIDATION_CACHE_SPEC_VERSION 1 -#define VK_EXT_VALIDATION_CACHE_EXTENSION_NAME "VK_EXT_validation_cache" -#define VK_EXT_DESCRIPTOR_INDEXING_SPEC_VERSION 2 -#define VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME "VK_EXT_descriptor_indexing" -#define VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_SPEC_VERSION 1 -#define VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME "VK_EXT_shader_viewport_index_layer" -#define VK_NV_SHADING_RATE_IMAGE_SPEC_VERSION 3 -#define VK_NV_SHADING_RATE_IMAGE_EXTENSION_NAME "VK_NV_shading_rate_image" -#define VK_SHADER_UNUSED_NV VK_SHADER_UNUSED_KHR -#define VK_NV_RAY_TRACING_SPEC_VERSION 3 -#define VK_NV_RAY_TRACING_EXTENSION_NAME "VK_NV_ray_tracing" -#define VK_NV_REPRESENTATIVE_FRAGMENT_TEST_SPEC_VERSION 2 -#define VK_NV_REPRESENTATIVE_FRAGMENT_TEST_EXTENSION_NAME "VK_NV_representative_fragment_test" -#define VK_KHR_MAINTENANCE3_SPEC_VERSION VK_KHR_MAINTENANCE_3_SPEC_VERSION -#define VK_KHR_MAINTENANCE3_EXTENSION_NAME VK_KHR_MAINTENANCE_3_EXTENSION_NAME -#define VK_KHR_MAINTENANCE_3_SPEC_VERSION 1 -#define VK_KHR_MAINTENANCE_3_EXTENSION_NAME "VK_KHR_maintenance3" -#define VK_KHR_DRAW_INDIRECT_COUNT_SPEC_VERSION 1 -#define VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_KHR_draw_indirect_count" -#define VK_EXT_FILTER_CUBIC_SPEC_VERSION 3 -#define VK_EXT_FILTER_CUBIC_EXTENSION_NAME "VK_EXT_filter_cubic" -#define VK_QCOM_RENDER_PASS_SHADER_RESOLVE_SPEC_VERSION 4 -#define VK_QCOM_RENDER_PASS_SHADER_RESOLVE_EXTENSION_NAME "VK_QCOM_render_pass_shader_resolve" -#define VK_EXT_GLOBAL_PRIORITY_SPEC_VERSION 2 -#define VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME "VK_EXT_global_priority" -#define VK_KHR_SHADER_SUBGROUP_EXTENDED_TYPES_SPEC_VERSION 1 -#define VK_KHR_SHADER_SUBGROUP_EXTENDED_TYPES_EXTENSION_NAME "VK_KHR_shader_subgroup_extended_types" -#define VK_KHR_8BIT_STORAGE_SPEC_VERSION 1 -#define VK_KHR_8BIT_STORAGE_EXTENSION_NAME "VK_KHR_8bit_storage" -#define VK_EXT_EXTERNAL_MEMORY_HOST_SPEC_VERSION 1 -#define VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME "VK_EXT_external_memory_host" -#define VK_AMD_BUFFER_MARKER_SPEC_VERSION 1 -#define VK_AMD_BUFFER_MARKER_EXTENSION_NAME "VK_AMD_buffer_marker" -#define VK_KHR_SHADER_ATOMIC_INT64_SPEC_VERSION 1 -#define VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME "VK_KHR_shader_atomic_int64" -#define VK_KHR_SHADER_CLOCK_SPEC_VERSION 1 -#define VK_KHR_SHADER_CLOCK_EXTENSION_NAME "VK_KHR_shader_clock" -#define VK_AMD_PIPELINE_COMPILER_CONTROL_SPEC_VERSION 1 -#define VK_AMD_PIPELINE_COMPILER_CONTROL_EXTENSION_NAME "VK_AMD_pipeline_compiler_control" -#define VK_EXT_CALIBRATED_TIMESTAMPS_SPEC_VERSION 2 -#define VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME "VK_EXT_calibrated_timestamps" -#define VK_AMD_SHADER_CORE_PROPERTIES_SPEC_VERSION 2 -#define VK_AMD_SHADER_CORE_PROPERTIES_EXTENSION_NAME "VK_AMD_shader_core_properties" -#define VK_KHR_VIDEO_DECODE_H265_SPEC_VERSION 8 -#define VK_KHR_VIDEO_DECODE_H265_EXTENSION_NAME "VK_KHR_video_decode_h265" -#define VK_MAX_GLOBAL_PRIORITY_SIZE_KHR VK_MAX_GLOBAL_PRIORITY_SIZE -#define VK_KHR_GLOBAL_PRIORITY_SPEC_VERSION 1 -#define VK_KHR_GLOBAL_PRIORITY_EXTENSION_NAME "VK_KHR_global_priority" -#define VK_AMD_MEMORY_OVERALLOCATION_BEHAVIOR_SPEC_VERSION 1 -#define VK_AMD_MEMORY_OVERALLOCATION_BEHAVIOR_EXTENSION_NAME "VK_AMD_memory_overallocation_behavior" -#define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION 3 -#define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME "VK_EXT_vertex_attribute_divisor" -#define VK_EXT_PIPELINE_CREATION_FEEDBACK_SPEC_VERSION 1 -#define VK_EXT_PIPELINE_CREATION_FEEDBACK_EXTENSION_NAME "VK_EXT_pipeline_creation_feedback" -#define VK_MAX_DRIVER_NAME_SIZE_KHR VK_MAX_DRIVER_NAME_SIZE -#define VK_MAX_DRIVER_INFO_SIZE_KHR VK_MAX_DRIVER_INFO_SIZE -#define VK_KHR_DRIVER_PROPERTIES_SPEC_VERSION 1 -#define VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME "VK_KHR_driver_properties" -#define VK_KHR_SHADER_FLOAT_CONTROLS_SPEC_VERSION 4 -#define VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME "VK_KHR_shader_float_controls" -#define VK_NV_SHADER_SUBGROUP_PARTITIONED_SPEC_VERSION 1 -#define VK_NV_SHADER_SUBGROUP_PARTITIONED_EXTENSION_NAME "VK_NV_shader_subgroup_partitioned" -#define VK_KHR_DEPTH_STENCIL_RESOLVE_SPEC_VERSION 1 -#define VK_KHR_DEPTH_STENCIL_RESOLVE_EXTENSION_NAME "VK_KHR_depth_stencil_resolve" -#define VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_SPEC_VERSION 1 -#define VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_EXTENSION_NAME "VK_KHR_swapchain_mutable_format" -#define VK_NV_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION 1 -#define VK_NV_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME "VK_NV_compute_shader_derivatives" -#define VK_NV_MESH_SHADER_SPEC_VERSION 1 -#define VK_NV_MESH_SHADER_EXTENSION_NAME "VK_NV_mesh_shader" -#define VK_NV_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION 1 -#define VK_NV_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME "VK_NV_fragment_shader_barycentric" -#define VK_NV_SHADER_IMAGE_FOOTPRINT_SPEC_VERSION 2 -#define VK_NV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME "VK_NV_shader_image_footprint" -#define VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION 2 -#define VK_NV_SCISSOR_EXCLUSIVE_EXTENSION_NAME "VK_NV_scissor_exclusive" -#define VK_NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_SPEC_VERSION 2 -#define VK_NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_EXTENSION_NAME "VK_NV_device_diagnostic_checkpoints" -#define VK_KHR_TIMELINE_SEMAPHORE_SPEC_VERSION 2 -#define VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME "VK_KHR_timeline_semaphore" -#define VK_INTEL_SHADER_INTEGER_FUNCTIONS_2_SPEC_VERSION 1 -#define VK_INTEL_SHADER_INTEGER_FUNCTIONS_2_EXTENSION_NAME "VK_INTEL_shader_integer_functions2" -#define VK_INTEL_PERFORMANCE_QUERY_SPEC_VERSION 2 -#define VK_INTEL_PERFORMANCE_QUERY_EXTENSION_NAME "VK_INTEL_performance_query" -#define VK_KHR_VULKAN_MEMORY_MODEL_SPEC_VERSION 3 -#define VK_KHR_VULKAN_MEMORY_MODEL_EXTENSION_NAME "VK_KHR_vulkan_memory_model" -#define VK_EXT_PCI_BUS_INFO_SPEC_VERSION 2 -#define VK_EXT_PCI_BUS_INFO_EXTENSION_NAME "VK_EXT_pci_bus_info" -#define VK_KHR_SHADER_TERMINATE_INVOCATION_SPEC_VERSION 1 -#define VK_KHR_SHADER_TERMINATE_INVOCATION_EXTENSION_NAME "VK_KHR_shader_terminate_invocation" -#define VK_EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION 2 -#define VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME "VK_EXT_fragment_density_map" -#define VK_EXT_SCALAR_BLOCK_LAYOUT_SPEC_VERSION 1 -#define VK_EXT_SCALAR_BLOCK_LAYOUT_EXTENSION_NAME "VK_EXT_scalar_block_layout" -#define VK_GOOGLE_HLSL_FUNCTIONALITY1_SPEC_VERSION VK_GOOGLE_HLSL_FUNCTIONALITY_1_SPEC_VERSION -#define VK_GOOGLE_HLSL_FUNCTIONALITY1_EXTENSION_NAME VK_GOOGLE_HLSL_FUNCTIONALITY_1_EXTENSION_NAME -#define VK_GOOGLE_HLSL_FUNCTIONALITY_1_SPEC_VERSION 1 -#define VK_GOOGLE_HLSL_FUNCTIONALITY_1_EXTENSION_NAME "VK_GOOGLE_hlsl_functionality1" -#define VK_GOOGLE_DECORATE_STRING_SPEC_VERSION 1 -#define VK_GOOGLE_DECORATE_STRING_EXTENSION_NAME "VK_GOOGLE_decorate_string" -#define VK_EXT_SUBGROUP_SIZE_CONTROL_SPEC_VERSION 2 -#define VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME "VK_EXT_subgroup_size_control" -#define VK_KHR_FRAGMENT_SHADING_RATE_SPEC_VERSION 2 -#define VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME "VK_KHR_fragment_shading_rate" -#define VK_AMD_SHADER_CORE_PROPERTIES_2_SPEC_VERSION 1 -#define VK_AMD_SHADER_CORE_PROPERTIES_2_EXTENSION_NAME "VK_AMD_shader_core_properties2" -#define VK_AMD_DEVICE_COHERENT_MEMORY_SPEC_VERSION 1 -#define VK_AMD_DEVICE_COHERENT_MEMORY_EXTENSION_NAME "VK_AMD_device_coherent_memory" -#define VK_KHR_DYNAMIC_RENDERING_LOCAL_READ_SPEC_VERSION 1 -#define VK_KHR_DYNAMIC_RENDERING_LOCAL_READ_EXTENSION_NAME "VK_KHR_dynamic_rendering_local_read" -#define VK_EXT_SHADER_IMAGE_ATOMIC_INT64_SPEC_VERSION 1 -#define VK_EXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME "VK_EXT_shader_image_atomic_int64" -#define VK_KHR_SHADER_QUAD_CONTROL_SPEC_VERSION 1 -#define VK_KHR_SHADER_QUAD_CONTROL_EXTENSION_NAME "VK_KHR_shader_quad_control" -#define VK_KHR_SPIRV_1_4_SPEC_VERSION 1 -#define VK_KHR_SPIRV_1_4_EXTENSION_NAME "VK_KHR_spirv_1_4" -#define VK_EXT_MEMORY_BUDGET_SPEC_VERSION 1 -#define VK_EXT_MEMORY_BUDGET_EXTENSION_NAME "VK_EXT_memory_budget" -#define VK_EXT_MEMORY_PRIORITY_SPEC_VERSION 1 -#define VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME "VK_EXT_memory_priority" -#define VK_NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_SPEC_VERSION 1 -#define VK_NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_EXTENSION_NAME "VK_NV_dedicated_allocation_image_aliasing" -#define VK_KHR_SEPARATE_DEPTH_STENCIL_LAYOUTS_SPEC_VERSION 1 -#define VK_KHR_SEPARATE_DEPTH_STENCIL_LAYOUTS_EXTENSION_NAME "VK_KHR_separate_depth_stencil_layouts" -#define VK_EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION 2 -#define VK_EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME "VK_EXT_buffer_device_address" -#define VK_EXT_TOOLING_INFO_SPEC_VERSION 1 -#define VK_EXT_TOOLING_INFO_EXTENSION_NAME "VK_EXT_tooling_info" -#define VK_EXT_SEPARATE_STENCIL_USAGE_SPEC_VERSION 1 -#define VK_EXT_SEPARATE_STENCIL_USAGE_EXTENSION_NAME "VK_EXT_separate_stencil_usage" -#define VK_EXT_VALIDATION_FEATURES_SPEC_VERSION 6 -#define VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME "VK_EXT_validation_features" -#define VK_KHR_PRESENT_WAIT_SPEC_VERSION 1 -#define VK_KHR_PRESENT_WAIT_EXTENSION_NAME "VK_KHR_present_wait" -#define VK_NV_COOPERATIVE_MATRIX_SPEC_VERSION 1 -#define VK_NV_COOPERATIVE_MATRIX_EXTENSION_NAME "VK_NV_cooperative_matrix" -#define VK_NV_COVERAGE_REDUCTION_MODE_SPEC_VERSION 1 -#define VK_NV_COVERAGE_REDUCTION_MODE_EXTENSION_NAME "VK_NV_coverage_reduction_mode" -#define VK_EXT_FRAGMENT_SHADER_INTERLOCK_SPEC_VERSION 1 -#define VK_EXT_FRAGMENT_SHADER_INTERLOCK_EXTENSION_NAME "VK_EXT_fragment_shader_interlock" -#define VK_EXT_YCBCR_IMAGE_ARRAYS_SPEC_VERSION 1 -#define VK_EXT_YCBCR_IMAGE_ARRAYS_EXTENSION_NAME "VK_EXT_ycbcr_image_arrays" -#define VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_SPEC_VERSION 1 -#define VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_EXTENSION_NAME "VK_KHR_uniform_buffer_standard_layout" -#define VK_EXT_PROVOKING_VERTEX_SPEC_VERSION 1 -#define VK_EXT_PROVOKING_VERTEX_EXTENSION_NAME "VK_EXT_provoking_vertex" -#define VK_KHR_BUFFER_DEVICE_ADDRESS_SPEC_VERSION 1 -#define VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME "VK_KHR_buffer_device_address" -#define VK_EXT_LINE_RASTERIZATION_SPEC_VERSION 1 -#define VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME "VK_EXT_line_rasterization" -#define VK_EXT_SHADER_ATOMIC_FLOAT_SPEC_VERSION 1 -#define VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME "VK_EXT_shader_atomic_float" -#define VK_EXT_HOST_QUERY_RESET_SPEC_VERSION 1 -#define VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME "VK_EXT_host_query_reset" -#define VK_EXT_INDEX_TYPE_UINT8_SPEC_VERSION 1 -#define VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME "VK_EXT_index_type_uint8" -#define VK_EXT_EXTENDED_DYNAMIC_STATE_SPEC_VERSION 1 -#define VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME "VK_EXT_extended_dynamic_state" -#define VK_KHR_DEFERRED_HOST_OPERATIONS_SPEC_VERSION 4 -#define VK_KHR_DEFERRED_HOST_OPERATIONS_EXTENSION_NAME "VK_KHR_deferred_host_operations" -#define VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_SPEC_VERSION 1 -#define VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME "VK_KHR_pipeline_executable_properties" -#define VK_EXT_HOST_IMAGE_COPY_SPEC_VERSION 1 -#define VK_EXT_HOST_IMAGE_COPY_EXTENSION_NAME "VK_EXT_host_image_copy" -#define VK_KHR_MAP_MEMORY_2_SPEC_VERSION 1 -#define VK_KHR_MAP_MEMORY_2_EXTENSION_NAME "VK_KHR_map_memory2" -#define VK_EXT_MAP_MEMORY_PLACED_SPEC_VERSION 1 -#define VK_EXT_MAP_MEMORY_PLACED_EXTENSION_NAME "VK_EXT_map_memory_placed" -#define VK_EXT_SHADER_ATOMIC_FLOAT_2_SPEC_VERSION 1 -#define VK_EXT_SHADER_ATOMIC_FLOAT_2_EXTENSION_NAME "VK_EXT_shader_atomic_float2" -#define VK_EXT_SURFACE_MAINTENANCE_1_SPEC_VERSION 1 -#define VK_EXT_SURFACE_MAINTENANCE_1_EXTENSION_NAME "VK_EXT_surface_maintenance1" -#define VK_EXT_SWAPCHAIN_MAINTENANCE_1_SPEC_VERSION 1 -#define VK_EXT_SWAPCHAIN_MAINTENANCE_1_EXTENSION_NAME "VK_EXT_swapchain_maintenance1" -#define VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_SPEC_VERSION 1 -#define VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME "VK_EXT_shader_demote_to_helper_invocation" -#define VK_NV_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 3 -#define VK_NV_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NV_device_generated_commands" -#define VK_NV_INHERITED_VIEWPORT_SCISSOR_SPEC_VERSION 1 -#define VK_NV_INHERITED_VIEWPORT_SCISSOR_EXTENSION_NAME "VK_NV_inherited_viewport_scissor" -#define VK_KHR_SHADER_INTEGER_DOT_PRODUCT_SPEC_VERSION 1 -#define VK_KHR_SHADER_INTEGER_DOT_PRODUCT_EXTENSION_NAME "VK_KHR_shader_integer_dot_product" -#define VK_EXT_TEXEL_BUFFER_ALIGNMENT_SPEC_VERSION 1 -#define VK_EXT_TEXEL_BUFFER_ALIGNMENT_EXTENSION_NAME "VK_EXT_texel_buffer_alignment" -#define VK_QCOM_RENDER_PASS_TRANSFORM_SPEC_VERSION 4 -#define VK_QCOM_RENDER_PASS_TRANSFORM_EXTENSION_NAME "VK_QCOM_render_pass_transform" -#define VK_EXT_DEPTH_BIAS_CONTROL_SPEC_VERSION 1 -#define VK_EXT_DEPTH_BIAS_CONTROL_EXTENSION_NAME "VK_EXT_depth_bias_control" -#define VK_EXT_ROBUSTNESS_2_SPEC_VERSION 1 -#define VK_EXT_ROBUSTNESS_2_EXTENSION_NAME "VK_EXT_robustness2" -#define VK_EXT_CUSTOM_BORDER_COLOR_SPEC_VERSION 12 -#define VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME "VK_EXT_custom_border_color" -#define VK_GOOGLE_USER_TYPE_SPEC_VERSION 1 -#define VK_GOOGLE_USER_TYPE_EXTENSION_NAME "VK_GOOGLE_user_type" -#define VK_KHR_PIPELINE_LIBRARY_SPEC_VERSION 1 -#define VK_KHR_PIPELINE_LIBRARY_EXTENSION_NAME "VK_KHR_pipeline_library" -#define VK_NV_PRESENT_BARRIER_SPEC_VERSION 1 -#define VK_NV_PRESENT_BARRIER_EXTENSION_NAME "VK_NV_present_barrier" -#define VK_KHR_SHADER_NON_SEMANTIC_INFO_SPEC_VERSION 1 -#define VK_KHR_SHADER_NON_SEMANTIC_INFO_EXTENSION_NAME "VK_KHR_shader_non_semantic_info" -#define VK_KHR_PRESENT_ID_SPEC_VERSION 1 -#define VK_KHR_PRESENT_ID_EXTENSION_NAME "VK_KHR_present_id" -#define VK_EXT_PRIVATE_DATA_SPEC_VERSION 1 -#define VK_EXT_PRIVATE_DATA_EXTENSION_NAME "VK_EXT_private_data" -#define VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_SPEC_VERSION 3 -#define VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_EXTENSION_NAME "VK_EXT_pipeline_creation_cache_control" -#define VK_KHR_VIDEO_ENCODE_QUEUE_SPEC_VERSION 12 -#define VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME "VK_KHR_video_encode_queue" -#define VK_NV_DEVICE_DIAGNOSTICS_CONFIG_SPEC_VERSION 2 -#define VK_NV_DEVICE_DIAGNOSTICS_CONFIG_EXTENSION_NAME "VK_NV_device_diagnostics_config" -#define VK_QCOM_RENDER_PASS_STORE_OPS_SPEC_VERSION 2 -#define VK_QCOM_RENDER_PASS_STORE_OPS_EXTENSION_NAME "VK_QCOM_render_pass_store_ops" -#define VK_NV_CUDA_KERNEL_LAUNCH_SPEC_VERSION 2 -#define VK_NV_CUDA_KERNEL_LAUNCH_EXTENSION_NAME "VK_NV_cuda_kernel_launch" -#define VK_NV_LOW_LATENCY_SPEC_VERSION 1 -#define VK_NV_LOW_LATENCY_EXTENSION_NAME "VK_NV_low_latency" -#define VK_KHR_SYNCHRONIZATION_2_SPEC_VERSION 1 -#define VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME "VK_KHR_synchronization2" -#define VK_EXT_DESCRIPTOR_BUFFER_SPEC_VERSION 1 -#define VK_EXT_DESCRIPTOR_BUFFER_EXTENSION_NAME "VK_EXT_descriptor_buffer" -#define VK_EXT_GRAPHICS_PIPELINE_LIBRARY_SPEC_VERSION 1 -#define VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME "VK_EXT_graphics_pipeline_library" -#define VK_AMD_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_SPEC_VERSION 1 -#define VK_AMD_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_EXTENSION_NAME "VK_AMD_shader_early_and_late_fragment_tests" -#define VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION 1 -#define VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME "VK_KHR_fragment_shader_barycentric" -#define VK_KHR_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_SPEC_VERSION 1 -#define VK_KHR_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_EXTENSION_NAME "VK_KHR_shader_subgroup_uniform_control_flow" -#define VK_KHR_ZERO_INITIALIZE_WORKGROUP_MEMORY_SPEC_VERSION 1 -#define VK_KHR_ZERO_INITIALIZE_WORKGROUP_MEMORY_EXTENSION_NAME "VK_KHR_zero_initialize_workgroup_memory" -#define VK_NV_FRAGMENT_SHADING_RATE_ENUMS_SPEC_VERSION 1 -#define VK_NV_FRAGMENT_SHADING_RATE_ENUMS_EXTENSION_NAME "VK_NV_fragment_shading_rate_enums" -#define VK_NV_RAY_TRACING_MOTION_BLUR_SPEC_VERSION 1 -#define VK_NV_RAY_TRACING_MOTION_BLUR_EXTENSION_NAME "VK_NV_ray_tracing_motion_blur" -#define VK_EXT_YCBCR_2PLANE_444_FORMATS_SPEC_VERSION 1 -#define VK_EXT_YCBCR_2PLANE_444_FORMATS_EXTENSION_NAME "VK_EXT_ycbcr_2plane_444_formats" -#define VK_EXT_FRAGMENT_DENSITY_MAP_2_SPEC_VERSION 1 -#define VK_EXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME "VK_EXT_fragment_density_map2" -#define VK_QCOM_ROTATED_COPY_COMMANDS_SPEC_VERSION 2 -#define VK_QCOM_ROTATED_COPY_COMMANDS_EXTENSION_NAME "VK_QCOM_rotated_copy_commands" -#define VK_EXT_IMAGE_ROBUSTNESS_SPEC_VERSION 1 -#define VK_EXT_IMAGE_ROBUSTNESS_EXTENSION_NAME "VK_EXT_image_robustness" -#define VK_KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_SPEC_VERSION 1 -#define VK_KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_EXTENSION_NAME "VK_KHR_workgroup_memory_explicit_layout" -#define VK_KHR_COPY_COMMANDS_2_SPEC_VERSION 1 -#define VK_KHR_COPY_COMMANDS_2_EXTENSION_NAME "VK_KHR_copy_commands2" -#define VK_EXT_IMAGE_COMPRESSION_CONTROL_SPEC_VERSION 1 -#define VK_EXT_IMAGE_COMPRESSION_CONTROL_EXTENSION_NAME "VK_EXT_image_compression_control" -#define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_SPEC_VERSION 2 -#define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME "VK_EXT_attachment_feedback_loop_layout" -#define VK_EXT_4444_FORMATS_SPEC_VERSION 1 -#define VK_EXT_4444_FORMATS_EXTENSION_NAME "VK_EXT_4444_formats" -#define VK_EXT_DEVICE_FAULT_SPEC_VERSION 2 -#define VK_EXT_DEVICE_FAULT_EXTENSION_NAME "VK_EXT_device_fault" -#define VK_ARM_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_SPEC_VERSION 1 -#define VK_ARM_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_EXTENSION_NAME "VK_ARM_rasterization_order_attachment_access" -#define VK_EXT_RGBA10X6_FORMATS_SPEC_VERSION 1 -#define VK_EXT_RGBA10X6_FORMATS_EXTENSION_NAME "VK_EXT_rgba10x6_formats" -#define VK_VALVE_MUTABLE_DESCRIPTOR_TYPE_SPEC_VERSION 1 -#define VK_VALVE_MUTABLE_DESCRIPTOR_TYPE_EXTENSION_NAME "VK_VALVE_mutable_descriptor_type" -#define VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_SPEC_VERSION 2 -#define VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME "VK_EXT_vertex_input_dynamic_state" -#define VK_EXT_DEVICE_ADDRESS_BINDING_REPORT_SPEC_VERSION 1 -#define VK_EXT_DEVICE_ADDRESS_BINDING_REPORT_EXTENSION_NAME "VK_EXT_device_address_binding_report" -#define VK_EXT_DEPTH_CLIP_CONTROL_SPEC_VERSION 1 -#define VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME "VK_EXT_depth_clip_control" -#define VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_SPEC_VERSION 1 -#define VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_EXTENSION_NAME "VK_EXT_primitive_topology_list_restart" -#define VK_KHR_FORMAT_FEATURE_FLAGS_2_SPEC_VERSION 2 -#define VK_KHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME "VK_KHR_format_feature_flags2" -#define VK_EXT_PRESENT_MODE_FIFO_LATEST_READY_SPEC_VERSION 1 -#define VK_EXT_PRESENT_MODE_FIFO_LATEST_READY_EXTENSION_NAME "VK_EXT_present_mode_fifo_latest_ready" -#define VK_HUAWEI_SUBPASS_SHADING_SPEC_VERSION 3 -#define VK_HUAWEI_SUBPASS_SHADING_EXTENSION_NAME "VK_HUAWEI_subpass_shading" -#define VK_HUAWEI_INVOCATION_MASK_SPEC_VERSION 1 -#define VK_HUAWEI_INVOCATION_MASK_EXTENSION_NAME "VK_HUAWEI_invocation_mask" -#define VK_EXT_PIPELINE_PROPERTIES_SPEC_VERSION 1 -#define VK_EXT_PIPELINE_PROPERTIES_EXTENSION_NAME "VK_EXT_pipeline_properties" -#define VK_EXT_FRAME_BOUNDARY_SPEC_VERSION 1 -#define VK_EXT_FRAME_BOUNDARY_EXTENSION_NAME "VK_EXT_frame_boundary" -#define VK_EXT_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_SPEC_VERSION 1 -#define VK_EXT_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_EXTENSION_NAME "VK_EXT_multisampled_render_to_single_sampled" -#define VK_EXT_EXTENDED_DYNAMIC_STATE_2_SPEC_VERSION 1 -#define VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME "VK_EXT_extended_dynamic_state2" -#define VK_EXT_COLOR_WRITE_ENABLE_SPEC_VERSION 1 -#define VK_EXT_COLOR_WRITE_ENABLE_EXTENSION_NAME "VK_EXT_color_write_enable" -#define VK_EXT_PRIMITIVES_GENERATED_QUERY_SPEC_VERSION 1 -#define VK_EXT_PRIMITIVES_GENERATED_QUERY_EXTENSION_NAME "VK_EXT_primitives_generated_query" -#define VK_KHR_RAY_TRACING_MAINTENANCE_1_SPEC_VERSION 1 -#define VK_KHR_RAY_TRACING_MAINTENANCE_1_EXTENSION_NAME "VK_KHR_ray_tracing_maintenance1" -#define VK_MAX_GLOBAL_PRIORITY_SIZE_EXT VK_MAX_GLOBAL_PRIORITY_SIZE -#define VK_EXT_GLOBAL_PRIORITY_QUERY_SPEC_VERSION 1 -#define VK_EXT_GLOBAL_PRIORITY_QUERY_EXTENSION_NAME "VK_EXT_global_priority_query" -#define VK_EXT_IMAGE_VIEW_MIN_LOD_SPEC_VERSION 1 -#define VK_EXT_IMAGE_VIEW_MIN_LOD_EXTENSION_NAME "VK_EXT_image_view_min_lod" -#define VK_EXT_MULTI_DRAW_SPEC_VERSION 1 -#define VK_EXT_MULTI_DRAW_EXTENSION_NAME "VK_EXT_multi_draw" -#define VK_EXT_IMAGE_2D_VIEW_OF_3D_SPEC_VERSION 1 -#define VK_EXT_IMAGE_2D_VIEW_OF_3D_EXTENSION_NAME "VK_EXT_image_2d_view_of_3d" -#define VK_KHR_PORTABILITY_ENUMERATION_SPEC_VERSION 1 -#define VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME "VK_KHR_portability_enumeration" -#define VK_EXT_SHADER_TILE_IMAGE_SPEC_VERSION 1 -#define VK_EXT_SHADER_TILE_IMAGE_EXTENSION_NAME "VK_EXT_shader_tile_image" -#define VK_EXT_OPACITY_MICROMAP_SPEC_VERSION 2 -#define VK_EXT_OPACITY_MICROMAP_EXTENSION_NAME "VK_EXT_opacity_micromap" -#define VK_EXT_LOAD_STORE_OP_NONE_SPEC_VERSION 1 -#define VK_EXT_LOAD_STORE_OP_NONE_EXTENSION_NAME "VK_EXT_load_store_op_none" -#define VK_HUAWEI_CLUSTER_CULLING_SHADER_SPEC_VERSION 3 -#define VK_HUAWEI_CLUSTER_CULLING_SHADER_EXTENSION_NAME "VK_HUAWEI_cluster_culling_shader" -#define VK_EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION 1 -#define VK_EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME "VK_EXT_border_color_swizzle" -#define VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_SPEC_VERSION 1 -#define VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_EXTENSION_NAME "VK_EXT_pageable_device_local_memory" -#define VK_KHR_MAINTENANCE_4_SPEC_VERSION 2 -#define VK_KHR_MAINTENANCE_4_EXTENSION_NAME "VK_KHR_maintenance4" -#define VK_ARM_SHADER_CORE_PROPERTIES_SPEC_VERSION 1 -#define VK_ARM_SHADER_CORE_PROPERTIES_EXTENSION_NAME "VK_ARM_shader_core_properties" -#define VK_KHR_SHADER_SUBGROUP_ROTATE_SPEC_VERSION 2 -#define VK_KHR_SHADER_SUBGROUP_ROTATE_EXTENSION_NAME "VK_KHR_shader_subgroup_rotate" -#define VK_ARM_SCHEDULING_CONTROLS_SPEC_VERSION 1 -#define VK_ARM_SCHEDULING_CONTROLS_EXTENSION_NAME "VK_ARM_scheduling_controls" -#define VK_EXT_IMAGE_SLICED_VIEW_OF_3D_SPEC_VERSION 1 -#define VK_EXT_IMAGE_SLICED_VIEW_OF_3D_EXTENSION_NAME "VK_EXT_image_sliced_view_of_3d" -#define VK_VALVE_DESCRIPTOR_SET_HOST_MAPPING_SPEC_VERSION 1 -#define VK_VALVE_DESCRIPTOR_SET_HOST_MAPPING_EXTENSION_NAME "VK_VALVE_descriptor_set_host_mapping" -#define VK_EXT_DEPTH_CLAMP_ZERO_ONE_SPEC_VERSION 1 -#define VK_EXT_DEPTH_CLAMP_ZERO_ONE_EXTENSION_NAME "VK_EXT_depth_clamp_zero_one" -#define VK_EXT_NON_SEAMLESS_CUBE_MAP_SPEC_VERSION 1 -#define VK_EXT_NON_SEAMLESS_CUBE_MAP_EXTENSION_NAME "VK_EXT_non_seamless_cube_map" -#define VK_ARM_RENDER_PASS_STRIPED_SPEC_VERSION 1 -#define VK_ARM_RENDER_PASS_STRIPED_EXTENSION_NAME "VK_ARM_render_pass_striped" -#define VK_QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION 2 -#define VK_QCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME "VK_QCOM_fragment_density_map_offset" -#define VK_NV_COPY_MEMORY_INDIRECT_SPEC_VERSION 1 -#define VK_NV_COPY_MEMORY_INDIRECT_EXTENSION_NAME "VK_NV_copy_memory_indirect" -#define VK_NV_MEMORY_DECOMPRESSION_SPEC_VERSION 1 -#define VK_NV_MEMORY_DECOMPRESSION_EXTENSION_NAME "VK_NV_memory_decompression" -#define VK_NV_DEVICE_GENERATED_COMMANDS_COMPUTE_SPEC_VERSION 2 -#define VK_NV_DEVICE_GENERATED_COMMANDS_COMPUTE_EXTENSION_NAME "VK_NV_device_generated_commands_compute" -#define VK_NV_LINEAR_COLOR_ATTACHMENT_SPEC_VERSION 1 -#define VK_NV_LINEAR_COLOR_ATTACHMENT_EXTENSION_NAME "VK_NV_linear_color_attachment" -#define VK_KHR_SHADER_MAXIMAL_RECONVERGENCE_SPEC_VERSION 1 -#define VK_KHR_SHADER_MAXIMAL_RECONVERGENCE_EXTENSION_NAME "VK_KHR_shader_maximal_reconvergence" -#define VK_EXT_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_SPEC_VERSION 1 -#define VK_EXT_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_EXTENSION_NAME "VK_EXT_image_compression_control_swapchain" -#define VK_QCOM_IMAGE_PROCESSING_SPEC_VERSION 1 -#define VK_QCOM_IMAGE_PROCESSING_EXTENSION_NAME "VK_QCOM_image_processing" -#define VK_EXT_NESTED_COMMAND_BUFFER_SPEC_VERSION 1 -#define VK_EXT_NESTED_COMMAND_BUFFER_EXTENSION_NAME "VK_EXT_nested_command_buffer" -#define VK_EXT_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_SPEC_VERSION 1 -#define VK_EXT_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXTENSION_NAME "VK_EXT_external_memory_acquire_unmodified" -#define VK_EXT_EXTENDED_DYNAMIC_STATE_3_SPEC_VERSION 2 -#define VK_EXT_EXTENDED_DYNAMIC_STATE_3_EXTENSION_NAME "VK_EXT_extended_dynamic_state3" -#define VK_EXT_SUBPASS_MERGE_FEEDBACK_SPEC_VERSION 2 -#define VK_EXT_SUBPASS_MERGE_FEEDBACK_EXTENSION_NAME "VK_EXT_subpass_merge_feedback" -#define VK_EXT_SHADER_MODULE_IDENTIFIER_SPEC_VERSION 1 -#define VK_EXT_SHADER_MODULE_IDENTIFIER_EXTENSION_NAME "VK_EXT_shader_module_identifier" -#define VK_EXT_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_SPEC_VERSION 1 -#define VK_EXT_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_EXTENSION_NAME "VK_EXT_rasterization_order_attachment_access" -#define VK_NV_OPTICAL_FLOW_SPEC_VERSION 1 -#define VK_NV_OPTICAL_FLOW_EXTENSION_NAME "VK_NV_optical_flow" -#define VK_EXT_LEGACY_DITHERING_SPEC_VERSION 2 -#define VK_EXT_LEGACY_DITHERING_EXTENSION_NAME "VK_EXT_legacy_dithering" -#define VK_EXT_PIPELINE_PROTECTED_ACCESS_SPEC_VERSION 1 -#define VK_EXT_PIPELINE_PROTECTED_ACCESS_EXTENSION_NAME "VK_EXT_pipeline_protected_access" -#define VK_KHR_MAINTENANCE_5_SPEC_VERSION 1 -#define VK_KHR_MAINTENANCE_5_EXTENSION_NAME "VK_KHR_maintenance5" -#define VK_AMD_ANTI_LAG_SPEC_VERSION 1 -#define VK_AMD_ANTI_LAG_EXTENSION_NAME "VK_AMD_anti_lag" -#define VK_KHR_RAY_TRACING_POSITION_FETCH_SPEC_VERSION 1 -#define VK_KHR_RAY_TRACING_POSITION_FETCH_EXTENSION_NAME "VK_KHR_ray_tracing_position_fetch" -#define VK_EXT_SHADER_OBJECT_SPEC_VERSION 1 -#define VK_EXT_SHADER_OBJECT_EXTENSION_NAME "VK_EXT_shader_object" -#define VK_KHR_PIPELINE_BINARY_SPEC_VERSION 1 -#define VK_KHR_PIPELINE_BINARY_EXTENSION_NAME "VK_KHR_pipeline_binary" -#define VK_QCOM_TILE_PROPERTIES_SPEC_VERSION 1 -#define VK_QCOM_TILE_PROPERTIES_EXTENSION_NAME "VK_QCOM_tile_properties" -#define VK_QCOM_MULTIVIEW_PER_VIEW_VIEWPORTS_SPEC_VERSION 1 -#define VK_QCOM_MULTIVIEW_PER_VIEW_VIEWPORTS_EXTENSION_NAME "VK_QCOM_multiview_per_view_viewports" -#define VK_NV_RAY_TRACING_INVOCATION_REORDER_SPEC_VERSION 1 -#define VK_NV_RAY_TRACING_INVOCATION_REORDER_EXTENSION_NAME "VK_NV_ray_tracing_invocation_reorder" -#define VK_NV_EXTENDED_SPARSE_ADDRESS_SPACE_SPEC_VERSION 1 -#define VK_NV_EXTENDED_SPARSE_ADDRESS_SPACE_EXTENSION_NAME "VK_NV_extended_sparse_address_space" -#define VK_EXT_MUTABLE_DESCRIPTOR_TYPE_SPEC_VERSION 1 -#define VK_EXT_MUTABLE_DESCRIPTOR_TYPE_EXTENSION_NAME "VK_EXT_mutable_descriptor_type" -#define VK_EXT_LEGACY_VERTEX_ATTRIBUTES_SPEC_VERSION 1 -#define VK_EXT_LEGACY_VERTEX_ATTRIBUTES_EXTENSION_NAME "VK_EXT_legacy_vertex_attributes" -#define VK_EXT_LAYER_SETTINGS_SPEC_VERSION 2 -#define VK_EXT_LAYER_SETTINGS_EXTENSION_NAME "VK_EXT_layer_settings" -#define VK_ARM_SHADER_CORE_BUILTINS_SPEC_VERSION 2 -#define VK_ARM_SHADER_CORE_BUILTINS_EXTENSION_NAME "VK_ARM_shader_core_builtins" -#define VK_EXT_PIPELINE_LIBRARY_GROUP_HANDLES_SPEC_VERSION 1 -#define VK_EXT_PIPELINE_LIBRARY_GROUP_HANDLES_EXTENSION_NAME "VK_EXT_pipeline_library_group_handles" -#define VK_EXT_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_SPEC_VERSION 1 -#define VK_EXT_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_EXTENSION_NAME "VK_EXT_dynamic_rendering_unused_attachments" -#define VK_NV_LOW_LATENCY_2_SPEC_VERSION 2 -#define VK_NV_LOW_LATENCY_2_EXTENSION_NAME "VK_NV_low_latency2" -#define VK_KHR_COOPERATIVE_MATRIX_SPEC_VERSION 2 -#define VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME "VK_KHR_cooperative_matrix" -#define VK_QCOM_MULTIVIEW_PER_VIEW_RENDER_AREAS_SPEC_VERSION 1 -#define VK_QCOM_MULTIVIEW_PER_VIEW_RENDER_AREAS_EXTENSION_NAME "VK_QCOM_multiview_per_view_render_areas" -#define VK_KHR_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION 1 -#define VK_KHR_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME "VK_KHR_compute_shader_derivatives" -#define VK_KHR_VIDEO_DECODE_AV1_SPEC_VERSION 1 -#define VK_KHR_VIDEO_DECODE_AV1_EXTENSION_NAME "VK_KHR_video_decode_av1" -#define VK_KHR_VIDEO_ENCODE_AV1_SPEC_VERSION 1 -#define VK_KHR_VIDEO_ENCODE_AV1_EXTENSION_NAME "VK_KHR_video_encode_av1" -#define VK_KHR_VIDEO_MAINTENANCE_1_SPEC_VERSION 1 -#define VK_KHR_VIDEO_MAINTENANCE_1_EXTENSION_NAME "VK_KHR_video_maintenance1" -#define VK_NV_PER_STAGE_DESCRIPTOR_SET_SPEC_VERSION 1 -#define VK_NV_PER_STAGE_DESCRIPTOR_SET_EXTENSION_NAME "VK_NV_per_stage_descriptor_set" -#define VK_QCOM_IMAGE_PROCESSING_2_SPEC_VERSION 1 -#define VK_QCOM_IMAGE_PROCESSING_2_EXTENSION_NAME "VK_QCOM_image_processing2" -#define VK_QCOM_FILTER_CUBIC_WEIGHTS_SPEC_VERSION 1 -#define VK_QCOM_FILTER_CUBIC_WEIGHTS_EXTENSION_NAME "VK_QCOM_filter_cubic_weights" -#define VK_QCOM_YCBCR_DEGAMMA_SPEC_VERSION 1 -#define VK_QCOM_YCBCR_DEGAMMA_EXTENSION_NAME "VK_QCOM_ycbcr_degamma" -#define VK_QCOM_FILTER_CUBIC_CLAMP_SPEC_VERSION 1 -#define VK_QCOM_FILTER_CUBIC_CLAMP_EXTENSION_NAME "VK_QCOM_filter_cubic_clamp" -#define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_SPEC_VERSION 1 -#define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_EXTENSION_NAME "VK_EXT_attachment_feedback_loop_dynamic_state" -#define VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION 1 -#define VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME "VK_KHR_vertex_attribute_divisor" -#define VK_KHR_LOAD_STORE_OP_NONE_SPEC_VERSION 1 -#define VK_KHR_LOAD_STORE_OP_NONE_EXTENSION_NAME "VK_KHR_load_store_op_none" -#define VK_KHR_SHADER_FLOAT_CONTROLS_2_SPEC_VERSION 1 -#define VK_KHR_SHADER_FLOAT_CONTROLS_2_EXTENSION_NAME "VK_KHR_shader_float_controls2" -#define VK_MSFT_LAYERED_DRIVER_SPEC_VERSION 1 -#define VK_MSFT_LAYERED_DRIVER_EXTENSION_NAME "VK_MSFT_layered_driver" -#define VK_KHR_INDEX_TYPE_UINT8_SPEC_VERSION 1 -#define VK_KHR_INDEX_TYPE_UINT8_EXTENSION_NAME "VK_KHR_index_type_uint8" -#define VK_KHR_LINE_RASTERIZATION_SPEC_VERSION 1 -#define VK_KHR_LINE_RASTERIZATION_EXTENSION_NAME "VK_KHR_line_rasterization" -#define VK_KHR_CALIBRATED_TIMESTAMPS_SPEC_VERSION 1 -#define VK_KHR_CALIBRATED_TIMESTAMPS_EXTENSION_NAME "VK_KHR_calibrated_timestamps" -#define VK_KHR_SHADER_EXPECT_ASSUME_SPEC_VERSION 1 -#define VK_KHR_SHADER_EXPECT_ASSUME_EXTENSION_NAME "VK_KHR_shader_expect_assume" -#define VK_KHR_MAINTENANCE_6_SPEC_VERSION 1 -#define VK_KHR_MAINTENANCE_6_EXTENSION_NAME "VK_KHR_maintenance6" -#define VK_NV_DESCRIPTOR_POOL_OVERALLOCATION_SPEC_VERSION 1 -#define VK_NV_DESCRIPTOR_POOL_OVERALLOCATION_EXTENSION_NAME "VK_NV_descriptor_pool_overallocation" -#define VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_SPEC_VERSION 2 -#define VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME "VK_KHR_video_encode_quantization_map" -#define VK_NV_RAW_ACCESS_CHAINS_SPEC_VERSION 1 -#define VK_NV_RAW_ACCESS_CHAINS_EXTENSION_NAME "VK_NV_raw_access_chains" -#define VK_KHR_SHADER_RELAXED_EXTENDED_INSTRUCTION_SPEC_VERSION 1 -#define VK_KHR_SHADER_RELAXED_EXTENDED_INSTRUCTION_EXTENSION_NAME "VK_KHR_shader_relaxed_extended_instruction" -#define VK_NV_COMMAND_BUFFER_INHERITANCE_SPEC_VERSION 1 -#define VK_NV_COMMAND_BUFFER_INHERITANCE_EXTENSION_NAME "VK_NV_command_buffer_inheritance" -#define VK_NV_SHADER_ATOMIC_FLOAT16_VECTOR_SPEC_VERSION 1 -#define VK_NV_SHADER_ATOMIC_FLOAT16_VECTOR_EXTENSION_NAME "VK_NV_shader_atomic_float16_vector" -#define VK_EXT_SHADER_REPLICATED_COMPOSITES_SPEC_VERSION 1 -#define VK_EXT_SHADER_REPLICATED_COMPOSITES_EXTENSION_NAME "VK_EXT_shader_replicated_composites" -#define VK_NV_RAY_TRACING_VALIDATION_SPEC_VERSION 1 -#define VK_NV_RAY_TRACING_VALIDATION_EXTENSION_NAME "VK_NV_ray_tracing_validation" -#define VK_EXT_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 1 -#define VK_EXT_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_EXT_device_generated_commands" -#define VK_MESA_IMAGE_ALIGNMENT_CONTROL_SPEC_VERSION 1 -#define VK_MESA_IMAGE_ALIGNMENT_CONTROL_EXTENSION_NAME "VK_MESA_image_alignment_control" -#define VK_EXT_DEPTH_CLAMP_CONTROL_SPEC_VERSION 1 -#define VK_EXT_DEPTH_CLAMP_CONTROL_EXTENSION_NAME "VK_EXT_depth_clamp_control" -#define VK_HUAWEI_HDR_VIVID_SPEC_VERSION 1 -#define VK_HUAWEI_HDR_VIVID_EXTENSION_NAME "VK_HUAWEI_hdr_vivid" -#define VK_NV_COOPERATIVE_MATRIX_2_SPEC_VERSION 1 -#define VK_NV_COOPERATIVE_MATRIX_2_EXTENSION_NAME "VK_NV_cooperative_matrix2" -#define VK_EXT_VERTEX_ATTRIBUTE_ROBUSTNESS_SPEC_VERSION 1 -#define VK_EXT_VERTEX_ATTRIBUTE_ROBUSTNESS_EXTENSION_NAME "VK_EXT_vertex_attribute_robustness" -#define STD_VIDEO_H264_CPB_CNT_LIST_SIZE 32 -#define STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS 6 -#define STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS 16 -#define STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS 6 -#define STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS 64 -#define STD_VIDEO_H264_MAX_NUM_LIST_REF 32 -#define STD_VIDEO_H264_MAX_CHROMA_PLANES 2 -#define STD_VIDEO_H264_NO_REFERENCE_PICTURE 0xFF -#define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_API_VERSION_1_0_0 -#define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h264_decode" -#define STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE 2 -#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_1_0_0 -#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h264_encode" -#define STD_VIDEO_H265_CPB_CNT_LIST_SIZE 32 -#define STD_VIDEO_H265_SUBLAYERS_LIST_SIZE 7 -#define STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS 6 -#define STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS 16 -#define STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS 6 -#define STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS 64 -#define STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS 6 -#define STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS 64 -#define STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS 2 -#define STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS 64 -#define STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE 6 -#define STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_COLS_LIST_SIZE 19 -#define STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_ROWS_LIST_SIZE 21 -#define STD_VIDEO_H265_PREDICTOR_PALETTE_COMPONENTS_LIST_SIZE 3 -#define STD_VIDEO_H265_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE 128 -#define STD_VIDEO_H265_MAX_NUM_LIST_REF 15 -#define STD_VIDEO_H265_MAX_CHROMA_PLANES 2 -#define STD_VIDEO_H265_MAX_SHORT_TERM_REF_PIC_SETS 64 -#define STD_VIDEO_H265_MAX_DPB_SIZE 16 -#define STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS 32 -#define STD_VIDEO_H265_MAX_LONG_TERM_PICS 16 -#define STD_VIDEO_H265_MAX_DELTA_POC 48 -#define STD_VIDEO_H265_NO_REFERENCE_PICTURE 0xFF -#define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_API_VERSION_1_0_0 -#define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h265_decode" -#define STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE 8 -#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_1_0_0 -#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h265_encode" -#define STD_VIDEO_AV1_NUM_REF_FRAMES 8 -#define STD_VIDEO_AV1_REFS_PER_FRAME 7 -#define STD_VIDEO_AV1_TOTAL_REFS_PER_FRAME 8 -#define STD_VIDEO_AV1_MAX_TILE_COLS 64 -#define STD_VIDEO_AV1_MAX_TILE_ROWS 64 -#define STD_VIDEO_AV1_MAX_SEGMENTS 8 -#define STD_VIDEO_AV1_SEG_LVL_MAX 8 -#define STD_VIDEO_AV1_PRIMARY_REF_NONE 7 -#define STD_VIDEO_AV1_SELECT_INTEGER_MV 2 -#define STD_VIDEO_AV1_SELECT_SCREEN_CONTENT_TOOLS 2 -#define STD_VIDEO_AV1_SKIP_MODE_FRAMES 2 -#define STD_VIDEO_AV1_MAX_LOOP_FILTER_STRENGTHS 4 -#define STD_VIDEO_AV1_LOOP_FILTER_ADJUSTMENTS 2 -#define STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS 8 -#define STD_VIDEO_AV1_MAX_NUM_PLANES 3 -#define STD_VIDEO_AV1_GLOBAL_MOTION_PARAMS 6 -#define STD_VIDEO_AV1_MAX_NUM_Y_POINTS 14 -#define STD_VIDEO_AV1_MAX_NUM_CB_POINTS 10 -#define STD_VIDEO_AV1_MAX_NUM_CR_POINTS 10 -#define STD_VIDEO_AV1_MAX_NUM_POS_LUMA 24 -#define STD_VIDEO_AV1_MAX_NUM_POS_CHROMA 25 -#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_API_VERSION_1_0_0 -#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_av1_decode" -#define VK_STD_VULKAN_VIDEO_CODEC_AV1_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_AV1_ENCODE_API_VERSION_1_0_0 -#define VK_STD_VULKAN_VIDEO_CODEC_AV1_ENCODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_av1_encode" -#define VK_KHR_ACCELERATION_STRUCTURE_SPEC_VERSION 13 -#define VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME "VK_KHR_acceleration_structure" -#define VK_KHR_RAY_TRACING_PIPELINE_SPEC_VERSION 1 -#define VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME "VK_KHR_ray_tracing_pipeline" -#define VK_KHR_RAY_QUERY_SPEC_VERSION 1 -#define VK_KHR_RAY_QUERY_EXTENSION_NAME "VK_KHR_ray_query" -#define VK_EXT_MESH_SHADER_SPEC_VERSION 1 -#define VK_EXT_MESH_SHADER_EXTENSION_NAME "VK_EXT_mesh_shader" - -#define VK_MAKE_VERSION(major, minor, patch) \ - ((((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch))) -#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22U) -#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU) -#define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU) -#define VK_MAKE_API_VERSION(variant, major, minor, patch) \ - ((((uint32_t)(variant)) << 29U) | (((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch))) -#define VK_API_VERSION_VARIANT(version) ((uint32_t)(version) >> 29U) -#define VK_API_VERSION_MAJOR(version) (((uint32_t)(version) >> 22U) & 0x7FU) -#define VK_API_VERSION_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU) -#define VK_API_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU) -#define VKSC_API_VARIANT 1 -#define VK_API_VERSION_1_0 VK_MAKE_API_VERSION(0, 1, 0, 0) -#define VK_API_VERSION_1_1 VK_MAKE_API_VERSION(0, 1, 1, 0) -#define VK_API_VERSION_1_2 VK_MAKE_API_VERSION(0, 1, 2, 0) -#define VK_API_VERSION_1_3 VK_MAKE_API_VERSION(0, 1, 3, 0) -#define VK_API_VERSION_1_4 VK_MAKE_API_VERSION(0, 1, 4, 0) -#define VKSC_API_VERSION_1_0 VK_MAKE_API_VERSION(VKSC_API_VARIANT, 1, 0, 0) -#define VK_HEADER_VERSION 303 -#define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 4, VK_HEADER_VERSION) -#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; -#define VK_USE_64_BIT_PTR_DEFINES 0 - -#ifndef VK_DEFINE_NON_DISPATCHABLE_HANDLE - #if (VK_USE_64_BIT_PTR_DEFINES==1) - #if (defined(__cplusplus) && (__cplusplus >= 201103L)) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201103L)) - #define VK_NULL_HANDLE nullptr - #else - #define VK_NULL_HANDLE ((void*)0) - #endif - #else - #define VK_NULL_HANDLE 0ULL - #endif -#endif -#ifndef VK_NULL_HANDLE - #define VK_NULL_HANDLE 0 -#endif - -#ifndef VK_DEFINE_NON_DISPATCHABLE_HANDLE - #if (VK_USE_64_BIT_PTR_DEFINES==1) - #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object; - #else - #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; - #endif -#endif -#define VK_MAKE_VIDEO_STD_VERSION(major, minor, patch) \ - ((((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch))) -#define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) -#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) -#define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) -#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) -#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) -#define VK_STD_VULKAN_VIDEO_CODEC_AV1_ENCODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureKHR) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureNV) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBuffer) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferView) -VK_DEFINE_HANDLE(VkCommandBuffer) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCuFunctionNVX) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCuModuleNVX) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCudaFunctionNV) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCudaModuleNV) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugUtilsMessengerEXT) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeferredOperationKHR) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplate) -typedef VkDescriptorUpdateTemplate VkDescriptorUpdateTemplateKHR; -VK_DEFINE_HANDLE(VkDevice) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeviceMemory) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkEvent) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFence) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFramebuffer) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImageView) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectCommandsLayoutEXT) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectCommandsLayoutNV) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectExecutionSetEXT) -VK_DEFINE_HANDLE(VkInstance) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkMicromapEXT) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkOpticalFlowSessionNV) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPerformanceConfigurationINTEL) -VK_DEFINE_HANDLE(VkPhysicalDevice) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipeline) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineBinaryKHR) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineCache) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineLayout) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPrivateDataSlot) -typedef VkPrivateDataSlot VkPrivateDataSlotEXT; -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkQueryPool) -VK_DEFINE_HANDLE(VkQueue) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkRenderPass) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSampler) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSamplerYcbcrConversion) -typedef VkSamplerYcbcrConversion VkSamplerYcbcrConversionKHR; -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphore) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderEXT) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderModule) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkValidationCacheEXT) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkVideoSessionKHR) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkVideoSessionParametersKHR) - -struct AHardwareBuffer; -struct ANativeWindow; -struct CAMetalLayer; -struct IOSurfaceRef; -struct MTLBuffer_id; -struct MTLCommandQueue_id; -struct MTLDevice_id; -struct MTLSharedEvent_id; -struct MTLTexture_id; -typedef uint32_t VkBool32; -typedef uint64_t VkDeviceAddress; -typedef uint64_t VkDeviceSize; -typedef uint32_t VkFlags; -typedef uint64_t VkFlags64; -typedef void* VkRemoteAddressNV; -typedef uint32_t VkSampleMask; - -typedef VkFlags VkAccelerationStructureCreateFlagsKHR; -typedef VkFlags VkAccelerationStructureMotionInfoFlagsNV; -typedef VkFlags VkAccelerationStructureMotionInstanceFlagsNV; -typedef VkFlags VkAccessFlags; -typedef VkFlags64 VkAccessFlags2; -typedef VkAccessFlags2 VkAccessFlags2KHR; -typedef VkFlags VkAcquireProfilingLockFlagsKHR; -typedef VkFlags VkAndroidSurfaceCreateFlagsKHR; -typedef VkFlags VkAttachmentDescriptionFlags; -typedef VkFlags VkBufferCreateFlags; -typedef VkFlags VkBufferUsageFlags; -typedef VkFlags64 VkBufferUsageFlags2; -typedef VkBufferUsageFlags2 VkBufferUsageFlags2KHR; -typedef VkFlags VkBufferViewCreateFlags; -typedef VkFlags VkBuildAccelerationStructureFlagsKHR; -typedef VkBuildAccelerationStructureFlagsKHR VkBuildAccelerationStructureFlagsNV; -typedef VkFlags VkBuildMicromapFlagsEXT; -typedef VkFlags VkColorComponentFlags; -typedef VkFlags VkCommandBufferResetFlags; -typedef VkFlags VkCommandBufferUsageFlags; -typedef VkFlags VkCommandPoolCreateFlags; -typedef VkFlags VkCommandPoolResetFlags; -typedef VkFlags VkCommandPoolTrimFlags; -typedef VkCommandPoolTrimFlags VkCommandPoolTrimFlagsKHR; -typedef VkFlags VkCompositeAlphaFlagsKHR; -typedef VkFlags VkConditionalRenderingFlagsEXT; -typedef VkFlags VkCullModeFlags; -typedef VkFlags VkDebugReportFlagsEXT; -typedef VkFlags VkDebugUtilsMessageSeverityFlagsEXT; -typedef VkFlags VkDebugUtilsMessageTypeFlagsEXT; -typedef VkFlags VkDebugUtilsMessengerCallbackDataFlagsEXT; -typedef VkFlags VkDebugUtilsMessengerCreateFlagsEXT; -typedef VkFlags VkDependencyFlags; -typedef VkFlags VkDescriptorBindingFlags; -typedef VkDescriptorBindingFlags VkDescriptorBindingFlagsEXT; -typedef VkFlags VkDescriptorPoolCreateFlags; -typedef VkFlags VkDescriptorPoolResetFlags; -typedef VkFlags VkDescriptorSetLayoutCreateFlags; -typedef VkFlags VkDescriptorUpdateTemplateCreateFlags; -typedef VkDescriptorUpdateTemplateCreateFlags VkDescriptorUpdateTemplateCreateFlagsKHR; -typedef VkFlags VkDeviceAddressBindingFlagsEXT; -typedef VkFlags VkDeviceCreateFlags; -typedef VkFlags VkDeviceDiagnosticsConfigFlagsNV; -typedef VkFlags VkDeviceGroupPresentModeFlagsKHR; -typedef VkFlags VkDeviceMemoryReportFlagsEXT; -typedef VkFlags VkDeviceQueueCreateFlags; -typedef VkFlags VkDirectDriverLoadingFlagsLUNARG; -typedef VkFlags VkDirectFBSurfaceCreateFlagsEXT; -typedef VkFlags VkDisplayModeCreateFlagsKHR; -typedef VkFlags VkDisplayPlaneAlphaFlagsKHR; -typedef VkFlags VkDisplaySurfaceCreateFlagsKHR; -typedef VkFlags VkEventCreateFlags; -typedef VkFlags VkExportMetalObjectTypeFlagsEXT; -typedef VkFlags VkExternalFenceFeatureFlags; -typedef VkExternalFenceFeatureFlags VkExternalFenceFeatureFlagsKHR; -typedef VkFlags VkExternalFenceHandleTypeFlags; -typedef VkExternalFenceHandleTypeFlags VkExternalFenceHandleTypeFlagsKHR; -typedef VkFlags VkExternalMemoryFeatureFlags; -typedef VkExternalMemoryFeatureFlags VkExternalMemoryFeatureFlagsKHR; -typedef VkFlags VkExternalMemoryFeatureFlagsNV; -typedef VkFlags VkExternalMemoryHandleTypeFlags; -typedef VkExternalMemoryHandleTypeFlags VkExternalMemoryHandleTypeFlagsKHR; -typedef VkFlags VkExternalMemoryHandleTypeFlagsNV; -typedef VkFlags VkExternalSemaphoreFeatureFlags; -typedef VkExternalSemaphoreFeatureFlags VkExternalSemaphoreFeatureFlagsKHR; -typedef VkFlags VkExternalSemaphoreHandleTypeFlags; -typedef VkExternalSemaphoreHandleTypeFlags VkExternalSemaphoreHandleTypeFlagsKHR; -typedef VkFlags VkFenceCreateFlags; -typedef VkFlags VkFenceImportFlags; -typedef VkFenceImportFlags VkFenceImportFlagsKHR; -typedef VkFlags VkFormatFeatureFlags; -typedef VkFlags64 VkFormatFeatureFlags2; -typedef VkFormatFeatureFlags2 VkFormatFeatureFlags2KHR; -typedef VkFlags VkFrameBoundaryFlagsEXT; -typedef VkFlags VkFramebufferCreateFlags; -typedef VkFlags VkGeometryFlagsKHR; -typedef VkGeometryFlagsKHR VkGeometryFlagsNV; -typedef VkFlags VkGeometryInstanceFlagsKHR; -typedef VkGeometryInstanceFlagsKHR VkGeometryInstanceFlagsNV; -typedef VkFlags VkGraphicsPipelineLibraryFlagsEXT; -typedef VkFlags VkHeadlessSurfaceCreateFlagsEXT; -typedef VkFlags VkHostImageCopyFlags; -typedef VkHostImageCopyFlags VkHostImageCopyFlagsEXT; -typedef VkFlags VkIOSSurfaceCreateFlagsMVK; -typedef VkFlags VkImageAspectFlags; -typedef VkFlags VkImageCompressionFixedRateFlagsEXT; -typedef VkFlags VkImageCompressionFlagsEXT; -typedef VkFlags VkImageConstraintsInfoFlagsFUCHSIA; -typedef VkFlags VkImageCreateFlags; -typedef VkFlags VkImageFormatConstraintsFlagsFUCHSIA; -typedef VkFlags VkImagePipeSurfaceCreateFlagsFUCHSIA; -typedef VkFlags VkImageUsageFlags; -typedef VkFlags VkImageViewCreateFlags; -typedef VkFlags VkIndirectCommandsInputModeFlagsEXT; -typedef VkFlags VkIndirectCommandsLayoutUsageFlagsEXT; -typedef VkFlags VkIndirectCommandsLayoutUsageFlagsNV; -typedef VkFlags VkIndirectStateFlagsNV; -typedef VkFlags VkInstanceCreateFlags; -typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; -typedef VkFlags VkMemoryAllocateFlags; -typedef VkMemoryAllocateFlags VkMemoryAllocateFlagsKHR; -typedef VkFlags64 VkMemoryDecompressionMethodFlagsNV; -typedef VkFlags VkMemoryHeapFlags; -typedef VkFlags VkMemoryMapFlags; -typedef VkFlags VkMemoryPropertyFlags; -typedef VkFlags VkMemoryUnmapFlags; -typedef VkMemoryUnmapFlags VkMemoryUnmapFlagsKHR; -typedef VkFlags VkMetalSurfaceCreateFlagsEXT; -typedef VkFlags VkMicromapCreateFlagsEXT; -typedef VkFlags VkOpticalFlowExecuteFlagsNV; -typedef VkFlags VkOpticalFlowGridSizeFlagsNV; -typedef VkFlags VkOpticalFlowSessionCreateFlagsNV; -typedef VkFlags VkOpticalFlowUsageFlagsNV; -typedef VkFlags VkPeerMemoryFeatureFlags; -typedef VkPeerMemoryFeatureFlags VkPeerMemoryFeatureFlagsKHR; -typedef VkFlags VkPerformanceCounterDescriptionFlagsKHR; -typedef VkFlags64 VkPhysicalDeviceSchedulingControlsFlagsARM; -typedef VkFlags VkPipelineCacheCreateFlags; -typedef VkFlags VkPipelineColorBlendStateCreateFlags; -typedef VkFlags VkPipelineColorBlendStateCreateFlags; -typedef VkFlags VkPipelineCompilerControlFlagsAMD; -typedef VkFlags VkPipelineCoverageModulationStateCreateFlagsNV; -typedef VkFlags VkPipelineCoverageReductionStateCreateFlagsNV; -typedef VkFlags VkPipelineCoverageToColorStateCreateFlagsNV; -typedef VkFlags VkPipelineCreateFlags; -typedef VkFlags64 VkPipelineCreateFlags2; -typedef VkPipelineCreateFlags2 VkPipelineCreateFlags2KHR; -typedef VkFlags VkPipelineCreationFeedbackFlags; -typedef VkPipelineCreationFeedbackFlags VkPipelineCreationFeedbackFlagsEXT; -typedef VkFlags VkPipelineDepthStencilStateCreateFlags; -typedef VkFlags VkPipelineDepthStencilStateCreateFlags; -typedef VkFlags VkPipelineDiscardRectangleStateCreateFlagsEXT; -typedef VkFlags VkPipelineDynamicStateCreateFlags; -typedef VkFlags VkPipelineInputAssemblyStateCreateFlags; -typedef VkFlags VkPipelineLayoutCreateFlags; -typedef VkFlags VkPipelineMultisampleStateCreateFlags; -typedef VkFlags VkPipelineRasterizationConservativeStateCreateFlagsEXT; -typedef VkFlags VkPipelineRasterizationDepthClipStateCreateFlagsEXT; -typedef VkFlags VkPipelineRasterizationStateCreateFlags; -typedef VkFlags VkPipelineRasterizationStateStreamCreateFlagsEXT; -typedef VkFlags VkPipelineShaderStageCreateFlags; -typedef VkFlags VkPipelineStageFlags; -typedef VkFlags64 VkPipelineStageFlags2; -typedef VkPipelineStageFlags2 VkPipelineStageFlags2KHR; -typedef VkFlags VkPipelineTessellationStateCreateFlags; -typedef VkFlags VkPipelineVertexInputStateCreateFlags; -typedef VkFlags VkPipelineViewportStateCreateFlags; -typedef VkFlags VkPipelineViewportSwizzleStateCreateFlagsNV; -typedef VkFlags VkPresentGravityFlagsEXT; -typedef VkFlags VkPresentScalingFlagsEXT; -typedef VkFlags VkPrivateDataSlotCreateFlags; -typedef VkPrivateDataSlotCreateFlags VkPrivateDataSlotCreateFlagsEXT; -typedef VkFlags VkQueryControlFlags; -typedef VkFlags VkQueryPipelineStatisticFlags; -typedef VkFlags VkQueryPoolCreateFlags; -typedef VkFlags VkQueryResultFlags; -typedef VkFlags VkQueueFlags; -typedef VkFlags VkRefreshObjectFlagsKHR; -typedef VkFlags VkRenderPassCreateFlags; -typedef VkFlags VkRenderingFlags; -typedef VkRenderingFlags VkRenderingFlagsKHR; -typedef VkFlags VkResolveModeFlags; -typedef VkResolveModeFlags VkResolveModeFlagsKHR; -typedef VkFlags VkSampleCountFlags; -typedef VkFlags VkSamplerCreateFlags; -typedef VkFlags VkScreenSurfaceCreateFlagsQNX; -typedef VkFlags VkSemaphoreCreateFlags; -typedef VkFlags VkSemaphoreImportFlags; -typedef VkSemaphoreImportFlags VkSemaphoreImportFlagsKHR; -typedef VkFlags VkSemaphoreWaitFlags; -typedef VkSemaphoreWaitFlags VkSemaphoreWaitFlagsKHR; -typedef VkFlags VkShaderCorePropertiesFlagsAMD; -typedef VkFlags VkShaderCreateFlagsEXT; -typedef VkFlags VkShaderModuleCreateFlags; -typedef VkFlags VkShaderStageFlags; -typedef VkFlags VkSparseImageFormatFlags; -typedef VkFlags VkSparseMemoryBindFlags; -typedef VkFlags VkStencilFaceFlags; -typedef VkFlags VkStreamDescriptorSurfaceCreateFlagsGGP; -typedef VkFlags VkSubgroupFeatureFlags; -typedef VkFlags VkSubmitFlags; -typedef VkSubmitFlags VkSubmitFlagsKHR; -typedef VkFlags VkSubpassDescriptionFlags; -typedef VkFlags VkSurfaceCounterFlagsEXT; -typedef VkFlags VkSurfaceTransformFlagsKHR; -typedef VkFlags VkSwapchainCreateFlagsKHR; -typedef VkFlags VkSwapchainImageUsageFlagsANDROID; -typedef VkFlags VkToolPurposeFlags; -typedef VkToolPurposeFlags VkToolPurposeFlagsEXT; -typedef VkFlags VkValidationCacheCreateFlagsEXT; -typedef VkFlags VkViSurfaceCreateFlagsNN; -typedef VkFlags VkVideoBeginCodingFlagsKHR; -typedef VkFlags VkVideoCapabilityFlagsKHR; -typedef VkFlags VkVideoChromaSubsamplingFlagsKHR; -typedef VkFlags VkVideoCodecOperationFlagsKHR; -typedef VkFlags VkVideoCodingControlFlagsKHR; -typedef VkFlags VkVideoComponentBitDepthFlagsKHR; -typedef VkFlags VkVideoDecodeCapabilityFlagsKHR; -typedef VkFlags VkVideoDecodeFlagsKHR; -typedef VkFlags VkVideoDecodeH264PictureLayoutFlagsKHR; -typedef VkFlags VkVideoDecodeUsageFlagsKHR; -typedef VkFlags VkVideoEncodeAV1CapabilityFlagsKHR; -typedef VkFlags VkVideoEncodeAV1RateControlFlagsKHR; -typedef VkFlags VkVideoEncodeAV1StdFlagsKHR; -typedef VkFlags VkVideoEncodeAV1SuperblockSizeFlagsKHR; -typedef VkFlags VkVideoEncodeCapabilityFlagsKHR; -typedef VkFlags VkVideoEncodeContentFlagsKHR; -typedef VkFlags VkVideoEncodeFeedbackFlagsKHR; -typedef VkFlags VkVideoEncodeFlagsKHR; -typedef VkFlags VkVideoEncodeH264CapabilityFlagsKHR; -typedef VkFlags VkVideoEncodeH264RateControlFlagsKHR; -typedef VkFlags VkVideoEncodeH264StdFlagsKHR; -typedef VkFlags VkVideoEncodeH265CapabilityFlagsKHR; -typedef VkFlags VkVideoEncodeH265CtbSizeFlagsKHR; -typedef VkFlags VkVideoEncodeH265RateControlFlagsKHR; -typedef VkFlags VkVideoEncodeH265StdFlagsKHR; -typedef VkFlags VkVideoEncodeH265TransformBlockSizeFlagsKHR; -typedef VkFlags VkVideoEncodeRateControlFlagsKHR; -typedef VkFlags VkVideoEncodeRateControlModeFlagsKHR; -typedef VkFlags VkVideoEncodeUsageFlagsKHR; -typedef VkFlags VkVideoEndCodingFlagsKHR; -typedef VkFlags VkVideoSessionCreateFlagsKHR; -typedef VkFlags VkVideoSessionParametersCreateFlagsKHR; -typedef VkFlags VkWaylandSurfaceCreateFlagsKHR; -typedef VkFlags VkWin32SurfaceCreateFlagsKHR; -typedef VkFlags VkXcbSurfaceCreateFlagsKHR; -typedef VkFlags VkXlibSurfaceCreateFlagsKHR; - -typedef enum StdVideoAV1ChromaSamplePosition -{ - STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_UNKNOWN = 0, - STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_VERTICAL = 1, - STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_COLOCATED = 2, - STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_RESERVED = 3, - STD_VIDEO_AV1_CHROMA_SAMPLE_POSITION_INVALID = 0x7fffffff, -} StdVideoAV1ChromaSamplePosition; - -typedef enum StdVideoAV1ColorPrimaries -{ - STD_VIDEO_AV1_COLOR_PRIMARIES_BT_709 = 1, - STD_VIDEO_AV1_COLOR_PRIMARIES_UNSPECIFIED = 2, - STD_VIDEO_AV1_COLOR_PRIMARIES_BT_470_M = 4, - STD_VIDEO_AV1_COLOR_PRIMARIES_BT_470_B_G = 5, - STD_VIDEO_AV1_COLOR_PRIMARIES_BT_601 = 6, - STD_VIDEO_AV1_COLOR_PRIMARIES_SMPTE_240 = 7, - STD_VIDEO_AV1_COLOR_PRIMARIES_GENERIC_FILM = 8, - STD_VIDEO_AV1_COLOR_PRIMARIES_BT_2020 = 9, - STD_VIDEO_AV1_COLOR_PRIMARIES_XYZ = 10, - STD_VIDEO_AV1_COLOR_PRIMARIES_SMPTE_431 = 11, - STD_VIDEO_AV1_COLOR_PRIMARIES_SMPTE_432 = 12, - STD_VIDEO_AV1_COLOR_PRIMARIES_EBU_3213 = 22, - STD_VIDEO_AV1_COLOR_PRIMARIES_BT_UNSPECIFIED = STD_VIDEO_AV1_COLOR_PRIMARIES_UNSPECIFIED, - STD_VIDEO_AV1_COLOR_PRIMARIES_INVALID = 0x7fffffff, -} StdVideoAV1ColorPrimaries; - -typedef enum StdVideoAV1FrameRestorationType -{ - STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_NONE = 0, - STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_WIENER = 1, - STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_SGRPROJ = 2, - STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_SWITCHABLE = 3, - STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_INVALID = 0x7fffffff, -} StdVideoAV1FrameRestorationType; - -typedef enum StdVideoAV1FrameType -{ - STD_VIDEO_AV1_FRAME_TYPE_KEY = 0, - STD_VIDEO_AV1_FRAME_TYPE_INTER = 1, - STD_VIDEO_AV1_FRAME_TYPE_INTRA_ONLY = 2, - STD_VIDEO_AV1_FRAME_TYPE_SWITCH = 3, - STD_VIDEO_AV1_FRAME_TYPE_INVALID = 0x7fffffff, -} StdVideoAV1FrameType; - -typedef enum StdVideoAV1InterpolationFilter -{ - STD_VIDEO_AV1_INTERPOLATION_FILTER_EIGHTTAP = 0, - STD_VIDEO_AV1_INTERPOLATION_FILTER_EIGHTTAP_SMOOTH = 1, - STD_VIDEO_AV1_INTERPOLATION_FILTER_EIGHTTAP_SHARP = 2, - STD_VIDEO_AV1_INTERPOLATION_FILTER_BILINEAR = 3, - STD_VIDEO_AV1_INTERPOLATION_FILTER_SWITCHABLE = 4, - STD_VIDEO_AV1_INTERPOLATION_FILTER_INVALID = 0x7fffffff, -} StdVideoAV1InterpolationFilter; - -typedef enum StdVideoAV1Level -{ - STD_VIDEO_AV1_LEVEL_2_0 = 0, - STD_VIDEO_AV1_LEVEL_2_1 = 1, - STD_VIDEO_AV1_LEVEL_2_2 = 2, - STD_VIDEO_AV1_LEVEL_2_3 = 3, - STD_VIDEO_AV1_LEVEL_3_0 = 4, - STD_VIDEO_AV1_LEVEL_3_1 = 5, - STD_VIDEO_AV1_LEVEL_3_2 = 6, - STD_VIDEO_AV1_LEVEL_3_3 = 7, - STD_VIDEO_AV1_LEVEL_4_0 = 8, - STD_VIDEO_AV1_LEVEL_4_1 = 9, - STD_VIDEO_AV1_LEVEL_4_2 = 10, - STD_VIDEO_AV1_LEVEL_4_3 = 11, - STD_VIDEO_AV1_LEVEL_5_0 = 12, - STD_VIDEO_AV1_LEVEL_5_1 = 13, - STD_VIDEO_AV1_LEVEL_5_2 = 14, - STD_VIDEO_AV1_LEVEL_5_3 = 15, - STD_VIDEO_AV1_LEVEL_6_0 = 16, - STD_VIDEO_AV1_LEVEL_6_1 = 17, - STD_VIDEO_AV1_LEVEL_6_2 = 18, - STD_VIDEO_AV1_LEVEL_6_3 = 19, - STD_VIDEO_AV1_LEVEL_7_0 = 20, - STD_VIDEO_AV1_LEVEL_7_1 = 21, - STD_VIDEO_AV1_LEVEL_7_2 = 22, - STD_VIDEO_AV1_LEVEL_7_3 = 23, - STD_VIDEO_AV1_LEVEL_INVALID = 0x7fffffff, -} StdVideoAV1Level; - -typedef enum StdVideoAV1MatrixCoefficients -{ - STD_VIDEO_AV1_MATRIX_COEFFICIENTS_IDENTITY = 0, - STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_709 = 1, - STD_VIDEO_AV1_MATRIX_COEFFICIENTS_UNSPECIFIED = 2, - STD_VIDEO_AV1_MATRIX_COEFFICIENTS_RESERVED_3 = 3, - STD_VIDEO_AV1_MATRIX_COEFFICIENTS_FCC = 4, - STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_470_B_G = 5, - STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_601 = 6, - STD_VIDEO_AV1_MATRIX_COEFFICIENTS_SMPTE_240 = 7, - STD_VIDEO_AV1_MATRIX_COEFFICIENTS_SMPTE_YCGCO = 8, - STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_2020_NCL = 9, - STD_VIDEO_AV1_MATRIX_COEFFICIENTS_BT_2020_CL = 10, - STD_VIDEO_AV1_MATRIX_COEFFICIENTS_SMPTE_2085 = 11, - STD_VIDEO_AV1_MATRIX_COEFFICIENTS_CHROMAT_NCL = 12, - STD_VIDEO_AV1_MATRIX_COEFFICIENTS_CHROMAT_CL = 13, - STD_VIDEO_AV1_MATRIX_COEFFICIENTS_ICTCP = 14, - STD_VIDEO_AV1_MATRIX_COEFFICIENTS_INVALID = 0x7fffffff, -} StdVideoAV1MatrixCoefficients; - -typedef enum StdVideoAV1Profile -{ - STD_VIDEO_AV1_PROFILE_MAIN = 0, - STD_VIDEO_AV1_PROFILE_HIGH = 1, - STD_VIDEO_AV1_PROFILE_PROFESSIONAL = 2, - STD_VIDEO_AV1_PROFILE_INVALID = 0x7fffffff, -} StdVideoAV1Profile; - -typedef enum StdVideoAV1ReferenceName -{ - STD_VIDEO_AV1_REFERENCE_NAME_INTRA_FRAME = 0, - STD_VIDEO_AV1_REFERENCE_NAME_LAST_FRAME = 1, - STD_VIDEO_AV1_REFERENCE_NAME_LAST2_FRAME = 2, - STD_VIDEO_AV1_REFERENCE_NAME_LAST3_FRAME = 3, - STD_VIDEO_AV1_REFERENCE_NAME_GOLDEN_FRAME = 4, - STD_VIDEO_AV1_REFERENCE_NAME_BWDREF_FRAME = 5, - STD_VIDEO_AV1_REFERENCE_NAME_ALTREF2_FRAME = 6, - STD_VIDEO_AV1_REFERENCE_NAME_ALTREF_FRAME = 7, - STD_VIDEO_AV1_REFERENCE_NAME_INVALID = 0x7fffffff, -} StdVideoAV1ReferenceName; - -typedef enum StdVideoAV1TransferCharacteristics -{ - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_RESERVED_0 = 0, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_709 = 1, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_UNSPECIFIED = 2, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_RESERVED_3 = 3, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_470_M = 4, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_470_B_G = 5, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_601 = 6, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SMPTE_240 = 7, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_LINEAR = 8, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_LOG_100 = 9, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_LOG_100_SQRT10 = 10, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_IEC_61966 = 11, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_1361 = 12, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SRGB = 13, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_2020_10_BIT = 14, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_BT_2020_12_BIT = 15, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SMPTE_2084 = 16, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_SMPTE_428 = 17, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_HLG = 18, - STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_INVALID = 0x7fffffff, -} StdVideoAV1TransferCharacteristics; - -typedef enum StdVideoAV1TxMode -{ - STD_VIDEO_AV1_TX_MODE_ONLY_4X4 = 0, - STD_VIDEO_AV1_TX_MODE_LARGEST = 1, - STD_VIDEO_AV1_TX_MODE_SELECT = 2, - STD_VIDEO_AV1_TX_MODE_INVALID = 0x7fffffff, -} StdVideoAV1TxMode; - -typedef enum StdVideoDecodeH264FieldOrderCount -{ - STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_TOP = 0, - STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_BOTTOM = 1, - STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_INVALID = 0x7fffffff, -} StdVideoDecodeH264FieldOrderCount; - -typedef enum StdVideoH264AspectRatioIdc -{ - STD_VIDEO_H264_ASPECT_RATIO_IDC_UNSPECIFIED = 0, - STD_VIDEO_H264_ASPECT_RATIO_IDC_SQUARE = 1, - STD_VIDEO_H264_ASPECT_RATIO_IDC_12_11 = 2, - STD_VIDEO_H264_ASPECT_RATIO_IDC_10_11 = 3, - STD_VIDEO_H264_ASPECT_RATIO_IDC_16_11 = 4, - STD_VIDEO_H264_ASPECT_RATIO_IDC_40_33 = 5, - STD_VIDEO_H264_ASPECT_RATIO_IDC_24_11 = 6, - STD_VIDEO_H264_ASPECT_RATIO_IDC_20_11 = 7, - STD_VIDEO_H264_ASPECT_RATIO_IDC_32_11 = 8, - STD_VIDEO_H264_ASPECT_RATIO_IDC_80_33 = 9, - STD_VIDEO_H264_ASPECT_RATIO_IDC_18_11 = 10, - STD_VIDEO_H264_ASPECT_RATIO_IDC_15_11 = 11, - STD_VIDEO_H264_ASPECT_RATIO_IDC_64_33 = 12, - STD_VIDEO_H264_ASPECT_RATIO_IDC_160_99 = 13, - STD_VIDEO_H264_ASPECT_RATIO_IDC_4_3 = 14, - STD_VIDEO_H264_ASPECT_RATIO_IDC_3_2 = 15, - STD_VIDEO_H264_ASPECT_RATIO_IDC_2_1 = 16, - STD_VIDEO_H264_ASPECT_RATIO_IDC_EXTENDED_SAR = 255, - STD_VIDEO_H264_ASPECT_RATIO_IDC_INVALID = 0x7fffffff, -} StdVideoH264AspectRatioIdc; - -typedef enum StdVideoH264CabacInitIdc -{ - STD_VIDEO_H264_CABAC_INIT_IDC_0 = 0, - STD_VIDEO_H264_CABAC_INIT_IDC_1 = 1, - STD_VIDEO_H264_CABAC_INIT_IDC_2 = 2, - STD_VIDEO_H264_CABAC_INIT_IDC_INVALID = 0x7fffffff, -} StdVideoH264CabacInitIdc; - -typedef enum StdVideoH264ChromaFormatIdc -{ - STD_VIDEO_H264_CHROMA_FORMAT_IDC_MONOCHROME = 0, - STD_VIDEO_H264_CHROMA_FORMAT_IDC_420 = 1, - STD_VIDEO_H264_CHROMA_FORMAT_IDC_422 = 2, - STD_VIDEO_H264_CHROMA_FORMAT_IDC_444 = 3, - STD_VIDEO_H264_CHROMA_FORMAT_IDC_INVALID = 0x7fffffff, -} StdVideoH264ChromaFormatIdc; - -typedef enum StdVideoH264DisableDeblockingFilterIdc -{ - STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_DISABLED = 0, - STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_ENABLED = 1, - STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_PARTIAL = 2, - STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_INVALID = 0x7fffffff, -} StdVideoH264DisableDeblockingFilterIdc; - -typedef enum StdVideoH264LevelIdc -{ - STD_VIDEO_H264_LEVEL_IDC_1_0 = 0, - STD_VIDEO_H264_LEVEL_IDC_1_1 = 1, - STD_VIDEO_H264_LEVEL_IDC_1_2 = 2, - STD_VIDEO_H264_LEVEL_IDC_1_3 = 3, - STD_VIDEO_H264_LEVEL_IDC_2_0 = 4, - STD_VIDEO_H264_LEVEL_IDC_2_1 = 5, - STD_VIDEO_H264_LEVEL_IDC_2_2 = 6, - STD_VIDEO_H264_LEVEL_IDC_3_0 = 7, - STD_VIDEO_H264_LEVEL_IDC_3_1 = 8, - STD_VIDEO_H264_LEVEL_IDC_3_2 = 9, - STD_VIDEO_H264_LEVEL_IDC_4_0 = 10, - STD_VIDEO_H264_LEVEL_IDC_4_1 = 11, - STD_VIDEO_H264_LEVEL_IDC_4_2 = 12, - STD_VIDEO_H264_LEVEL_IDC_5_0 = 13, - STD_VIDEO_H264_LEVEL_IDC_5_1 = 14, - STD_VIDEO_H264_LEVEL_IDC_5_2 = 15, - STD_VIDEO_H264_LEVEL_IDC_6_0 = 16, - STD_VIDEO_H264_LEVEL_IDC_6_1 = 17, - STD_VIDEO_H264_LEVEL_IDC_6_2 = 18, - STD_VIDEO_H264_LEVEL_IDC_INVALID = 0x7fffffff, -} StdVideoH264LevelIdc; - -typedef enum StdVideoH264MemMgmtControlOp -{ - STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_END = 0, - STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_SHORT_TERM = 1, - STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_LONG_TERM = 2, - STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MARK_LONG_TERM = 3, - STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_SET_MAX_LONG_TERM_INDEX = 4, - STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_ALL = 5, - STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MARK_CURRENT_AS_LONG_TERM = 6, - STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_INVALID = 0x7fffffff, -} StdVideoH264MemMgmtControlOp; - -typedef enum StdVideoH264ModificationOfPicNumsIdc -{ - STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_SHORT_TERM_SUBTRACT = 0, - STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_SHORT_TERM_ADD = 1, - STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_LONG_TERM = 2, - STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_END = 3, - STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_INVALID = 0x7fffffff, -} StdVideoH264ModificationOfPicNumsIdc; - -typedef enum StdVideoH264NonVclNaluType -{ - STD_VIDEO_H264_NON_VCL_NALU_TYPE_SPS = 0, - STD_VIDEO_H264_NON_VCL_NALU_TYPE_PPS = 1, - STD_VIDEO_H264_NON_VCL_NALU_TYPE_AUD = 2, - STD_VIDEO_H264_NON_VCL_NALU_TYPE_PREFIX = 3, - STD_VIDEO_H264_NON_VCL_NALU_TYPE_END_OF_SEQUENCE = 4, - STD_VIDEO_H264_NON_VCL_NALU_TYPE_END_OF_STREAM = 5, - STD_VIDEO_H264_NON_VCL_NALU_TYPE_PRECODED = 6, - STD_VIDEO_H264_NON_VCL_NALU_TYPE_INVALID = 0x7fffffff, -} StdVideoH264NonVclNaluType; - -typedef enum StdVideoH264PictureType -{ - STD_VIDEO_H264_PICTURE_TYPE_P = 0, - STD_VIDEO_H264_PICTURE_TYPE_B = 1, - STD_VIDEO_H264_PICTURE_TYPE_I = 2, - STD_VIDEO_H264_PICTURE_TYPE_IDR = 5, - STD_VIDEO_H264_PICTURE_TYPE_INVALID = 0x7fffffff, -} StdVideoH264PictureType; - -typedef enum StdVideoH264PocType -{ - STD_VIDEO_H264_POC_TYPE_0 = 0, - STD_VIDEO_H264_POC_TYPE_1 = 1, - STD_VIDEO_H264_POC_TYPE_2 = 2, - STD_VIDEO_H264_POC_TYPE_INVALID = 0x7fffffff, -} StdVideoH264PocType; - -typedef enum StdVideoH264ProfileIdc -{ - STD_VIDEO_H264_PROFILE_IDC_BASELINE = 66, - STD_VIDEO_H264_PROFILE_IDC_MAIN = 77, - STD_VIDEO_H264_PROFILE_IDC_HIGH = 100, - STD_VIDEO_H264_PROFILE_IDC_HIGH_444_PREDICTIVE = 244, - STD_VIDEO_H264_PROFILE_IDC_INVALID = 0x7fffffff, -} StdVideoH264ProfileIdc; - -typedef enum StdVideoH264SliceType -{ - STD_VIDEO_H264_SLICE_TYPE_P = 0, - STD_VIDEO_H264_SLICE_TYPE_B = 1, - STD_VIDEO_H264_SLICE_TYPE_I = 2, - STD_VIDEO_H264_SLICE_TYPE_INVALID = 0x7fffffff, -} StdVideoH264SliceType; - -typedef enum StdVideoH264WeightedBipredIdc -{ - STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_DEFAULT = 0, - STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_EXPLICIT = 1, - STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_IMPLICIT = 2, - STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_INVALID = 0x7fffffff, -} StdVideoH264WeightedBipredIdc; - -typedef enum StdVideoH265AspectRatioIdc -{ - STD_VIDEO_H265_ASPECT_RATIO_IDC_UNSPECIFIED = 0, - STD_VIDEO_H265_ASPECT_RATIO_IDC_SQUARE = 1, - STD_VIDEO_H265_ASPECT_RATIO_IDC_12_11 = 2, - STD_VIDEO_H265_ASPECT_RATIO_IDC_10_11 = 3, - STD_VIDEO_H265_ASPECT_RATIO_IDC_16_11 = 4, - STD_VIDEO_H265_ASPECT_RATIO_IDC_40_33 = 5, - STD_VIDEO_H265_ASPECT_RATIO_IDC_24_11 = 6, - STD_VIDEO_H265_ASPECT_RATIO_IDC_20_11 = 7, - STD_VIDEO_H265_ASPECT_RATIO_IDC_32_11 = 8, - STD_VIDEO_H265_ASPECT_RATIO_IDC_80_33 = 9, - STD_VIDEO_H265_ASPECT_RATIO_IDC_18_11 = 10, - STD_VIDEO_H265_ASPECT_RATIO_IDC_15_11 = 11, - STD_VIDEO_H265_ASPECT_RATIO_IDC_64_33 = 12, - STD_VIDEO_H265_ASPECT_RATIO_IDC_160_99 = 13, - STD_VIDEO_H265_ASPECT_RATIO_IDC_4_3 = 14, - STD_VIDEO_H265_ASPECT_RATIO_IDC_3_2 = 15, - STD_VIDEO_H265_ASPECT_RATIO_IDC_2_1 = 16, - STD_VIDEO_H265_ASPECT_RATIO_IDC_EXTENDED_SAR = 255, - STD_VIDEO_H265_ASPECT_RATIO_IDC_INVALID = 0x7fffffff, -} StdVideoH265AspectRatioIdc; - -typedef enum StdVideoH265ChromaFormatIdc -{ - STD_VIDEO_H265_CHROMA_FORMAT_IDC_MONOCHROME = 0, - STD_VIDEO_H265_CHROMA_FORMAT_IDC_420 = 1, - STD_VIDEO_H265_CHROMA_FORMAT_IDC_422 = 2, - STD_VIDEO_H265_CHROMA_FORMAT_IDC_444 = 3, - STD_VIDEO_H265_CHROMA_FORMAT_IDC_INVALID = 0x7fffffff, -} StdVideoH265ChromaFormatIdc; - -typedef enum StdVideoH265LevelIdc -{ - STD_VIDEO_H265_LEVEL_IDC_1_0 = 0, - STD_VIDEO_H265_LEVEL_IDC_2_0 = 1, - STD_VIDEO_H265_LEVEL_IDC_2_1 = 2, - STD_VIDEO_H265_LEVEL_IDC_3_0 = 3, - STD_VIDEO_H265_LEVEL_IDC_3_1 = 4, - STD_VIDEO_H265_LEVEL_IDC_4_0 = 5, - STD_VIDEO_H265_LEVEL_IDC_4_1 = 6, - STD_VIDEO_H265_LEVEL_IDC_5_0 = 7, - STD_VIDEO_H265_LEVEL_IDC_5_1 = 8, - STD_VIDEO_H265_LEVEL_IDC_5_2 = 9, - STD_VIDEO_H265_LEVEL_IDC_6_0 = 10, - STD_VIDEO_H265_LEVEL_IDC_6_1 = 11, - STD_VIDEO_H265_LEVEL_IDC_6_2 = 12, - STD_VIDEO_H265_LEVEL_IDC_INVALID = 0x7fffffff, -} StdVideoH265LevelIdc; - -typedef enum StdVideoH265PictureType -{ - STD_VIDEO_H265_PICTURE_TYPE_P = 0, - STD_VIDEO_H265_PICTURE_TYPE_B = 1, - STD_VIDEO_H265_PICTURE_TYPE_I = 2, - STD_VIDEO_H265_PICTURE_TYPE_IDR = 3, - STD_VIDEO_H265_PICTURE_TYPE_INVALID = 0x7fffffff, -} StdVideoH265PictureType; - -typedef enum StdVideoH265ProfileIdc -{ - STD_VIDEO_H265_PROFILE_IDC_MAIN = 1, - STD_VIDEO_H265_PROFILE_IDC_MAIN_10 = 2, - STD_VIDEO_H265_PROFILE_IDC_MAIN_STILL_PICTURE = 3, - STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS = 4, - STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS = 9, - STD_VIDEO_H265_PROFILE_IDC_INVALID = 0x7fffffff, -} StdVideoH265ProfileIdc; - -typedef enum StdVideoH265SliceType -{ - STD_VIDEO_H265_SLICE_TYPE_B = 0, - STD_VIDEO_H265_SLICE_TYPE_P = 1, - STD_VIDEO_H265_SLICE_TYPE_I = 2, - STD_VIDEO_H265_SLICE_TYPE_INVALID = 0x7fffffff, -} StdVideoH265SliceType; - -typedef enum VkAccelerationStructureBuildTypeKHR -{ - VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR = 0, - VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR = 1, - VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR = 2, - VK_ACCELERATION_STRUCTURE_BUILD_TYPE_KHR_MAX_ENUM = 0x7fffffff, -} VkAccelerationStructureBuildTypeKHR; - -typedef enum VkAccelerationStructureCompatibilityKHR -{ - VK_ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR = 0, - VK_ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR = 1, - VK_ACCELERATION_STRUCTURE_COMPATIBILITY_KHR_MAX_ENUM = 0x7fffffff, -} VkAccelerationStructureCompatibilityKHR; - -typedef enum VkAccelerationStructureCreateFlagBitsKHR -{ - VK_ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR = 0x00000001, - VK_ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV = 0x00000004, - VK_ACCELERATION_STRUCTURE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00000008, - VK_ACCELERATION_STRUCTURE_CREATE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkAccelerationStructureCreateFlagBitsKHR; - -typedef enum VkAccelerationStructureMemoryRequirementsTypeNV -{ - VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV = 0, - VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV = 1, - VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV = 2, - VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_NV_MAX_ENUM = 0x7fffffff, -} VkAccelerationStructureMemoryRequirementsTypeNV; - -typedef enum VkAccelerationStructureMotionInstanceTypeNV -{ - VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_STATIC_NV = 0, - VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_MATRIX_MOTION_NV = 1, - VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_SRT_MOTION_NV = 2, - VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_NV_MAX_ENUM = 0x7fffffff, -} VkAccelerationStructureMotionInstanceTypeNV; - -typedef enum VkAccelerationStructureTypeKHR -{ - VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR = 0, - VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR = 1, - VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR = 2, - VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NV = VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR, - VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NV = VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR, - VK_ACCELERATION_STRUCTURE_TYPE_KHR_MAX_ENUM = 0x7fffffff, -} VkAccelerationStructureTypeKHR; -typedef VkAccelerationStructureTypeKHR VkAccelerationStructureTypeNV; - -typedef enum VkAccessFlagBits -{ - VK_ACCESS_NONE = 0, - VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001, - VK_ACCESS_INDEX_READ_BIT = 0x00000002, - VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004, - VK_ACCESS_UNIFORM_READ_BIT = 0x00000008, - VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010, - VK_ACCESS_SHADER_READ_BIT = 0x00000020, - VK_ACCESS_SHADER_WRITE_BIT = 0x00000040, - VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080, - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100, - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200, - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400, - VK_ACCESS_TRANSFER_READ_BIT = 0x00000800, - VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000, - VK_ACCESS_HOST_READ_BIT = 0x00002000, - VK_ACCESS_HOST_WRITE_BIT = 0x00004000, - VK_ACCESS_MEMORY_READ_BIT = 0x00008000, - VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000, - VK_ACCESS_COMMAND_PREPROCESS_READ_BIT_NV = 0x00020000, - VK_ACCESS_COMMAND_PREPROCESS_WRITE_BIT_NV = 0x00040000, - VK_ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT = 0x00080000, - VK_ACCESS_CONDITIONAL_RENDERING_READ_BIT_EXT = 0x00100000, - VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR = 0x00200000, - VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR = 0x00400000, - VK_ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR = 0x00800000, - VK_ACCESS_FRAGMENT_DENSITY_MAP_READ_BIT_EXT = 0x01000000, - VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT = 0x02000000, - VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT = 0x04000000, - VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT = 0x08000000, - VK_ACCESS_SHADING_RATE_IMAGE_READ_BIT_NV = VK_ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR, - VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_NV = VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR, - VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NV = VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR, - VK_ACCESS_NONE_KHR = VK_ACCESS_NONE, - VK_ACCESS_COMMAND_PREPROCESS_READ_BIT_EXT = VK_ACCESS_COMMAND_PREPROCESS_READ_BIT_NV, - VK_ACCESS_COMMAND_PREPROCESS_WRITE_BIT_EXT = VK_ACCESS_COMMAND_PREPROCESS_WRITE_BIT_NV, - VK_ACCESS_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkAccessFlagBits; - -typedef VkFlags64 VkAccessFlagBits2; - -static const VkAccessFlagBits2 VK_ACCESS_2_NONE = 0ull; -static const VkAccessFlagBits2 VK_ACCESS_2_NONE_KHR = 0ull; -static const VkAccessFlagBits2 VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT = 0x00000001ull; -static const VkAccessFlagBits2 VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT_KHR = 0x00000001ull; -static const VkAccessFlagBits2 VK_ACCESS_2_INDEX_READ_BIT = 0x00000002ull; -static const VkAccessFlagBits2 VK_ACCESS_2_INDEX_READ_BIT_KHR = 0x00000002ull; -static const VkAccessFlagBits2 VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004ull; -static const VkAccessFlagBits2 VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT_KHR = 0x00000004ull; -static const VkAccessFlagBits2 VK_ACCESS_2_UNIFORM_READ_BIT = 0x00000008ull; -static const VkAccessFlagBits2 VK_ACCESS_2_UNIFORM_READ_BIT_KHR = 0x00000008ull; -static const VkAccessFlagBits2 VK_ACCESS_2_INPUT_ATTACHMENT_READ_BIT = 0x00000010ull; -static const VkAccessFlagBits2 VK_ACCESS_2_INPUT_ATTACHMENT_READ_BIT_KHR = 0x00000010ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_READ_BIT = 0x00000020ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_READ_BIT_KHR = 0x00000020ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_WRITE_BIT = 0x00000040ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_WRITE_BIT_KHR = 0x00000040ull; -static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT = 0x00000080ull; -static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT_KHR = 0x00000080ull; -static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100ull; -static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT_KHR = 0x00000100ull; -static const VkAccessFlagBits2 VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200ull; -static const VkAccessFlagBits2 VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT_KHR = 0x00000200ull; -static const VkAccessFlagBits2 VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400ull; -static const VkAccessFlagBits2 VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT_KHR = 0x00000400ull; -static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFER_READ_BIT = 0x00000800ull; -static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFER_READ_BIT_KHR = 0x00000800ull; -static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFER_WRITE_BIT = 0x00001000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFER_WRITE_BIT_KHR = 0x00001000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_HOST_READ_BIT = 0x00002000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_HOST_READ_BIT_KHR = 0x00002000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_HOST_WRITE_BIT = 0x00004000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_HOST_WRITE_BIT_KHR = 0x00004000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_MEMORY_READ_BIT = 0x00008000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_MEMORY_READ_BIT_KHR = 0x00008000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_MEMORY_WRITE_BIT = 0x00010000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_MEMORY_WRITE_BIT_KHR = 0x00010000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_COMMAND_PREPROCESS_READ_BIT_NV = 0x00020000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_COMMAND_PREPROCESS_READ_BIT_EXT = 0x00020000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_COMMAND_PREPROCESS_WRITE_BIT_NV = 0x00040000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_COMMAND_PREPROCESS_WRITE_BIT_EXT = 0x00040000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT = 0x00080000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT = 0x00100000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_KHR = 0x00200000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_NV = 0x00200000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_KHR = 0x00400000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_NV = 0x00400000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR = 0x00800000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADING_RATE_IMAGE_READ_BIT_NV = 0x00800000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_FRAGMENT_DENSITY_MAP_READ_BIT_EXT = 0x01000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT = 0x02000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT = 0x04000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT = 0x08000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_SAMPLED_READ_BIT = 0x100000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_SAMPLED_READ_BIT_KHR = 0x100000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_READ_BIT = 0x200000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_READ_BIT_KHR = 0x200000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT = 0x400000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT_KHR = 0x400000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_VIDEO_DECODE_READ_BIT_KHR = 0x800000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR = 0x1000000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_VIDEO_ENCODE_READ_BIT_KHR = 0x2000000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_VIDEO_ENCODE_WRITE_BIT_KHR = 0x4000000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_INVOCATION_MASK_READ_BIT_HUAWEI = 0x8000000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_BINDING_TABLE_READ_BIT_KHR = 0x10000000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_DESCRIPTOR_BUFFER_READ_BIT_EXT = 0x20000000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_OPTICAL_FLOW_READ_BIT_NV = 0x40000000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_OPTICAL_FLOW_WRITE_BIT_NV = 0x80000000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_MICROMAP_READ_BIT_EXT = 0x100000000000ull; -static const VkAccessFlagBits2 VK_ACCESS_2_MICROMAP_WRITE_BIT_EXT = 0x200000000000ull; -typedef VkAccessFlagBits2 VkAccessFlagBits2KHR; - -typedef enum VkAcquireProfilingLockFlagBitsKHR -{ - VK_ACQUIRE_PROFILING_LOCK_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkAcquireProfilingLockFlagBitsKHR; - -typedef enum VkAntiLagModeAMD -{ - VK_ANTI_LAG_MODE_DRIVER_CONTROL_AMD = 0, - VK_ANTI_LAG_MODE_ON_AMD = 1, - VK_ANTI_LAG_MODE_OFF_AMD = 2, - VK_ANTI_LAG_MODE_AMD_MAX_ENUM = 0x7fffffff, -} VkAntiLagModeAMD; - -typedef enum VkAntiLagStageAMD -{ - VK_ANTI_LAG_STAGE_INPUT_AMD = 0, - VK_ANTI_LAG_STAGE_PRESENT_AMD = 1, - VK_ANTI_LAG_STAGE_AMD_MAX_ENUM = 0x7fffffff, -} VkAntiLagStageAMD; - -typedef enum VkAttachmentDescriptionFlagBits -{ - VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT = 0x00000001, - VK_ATTACHMENT_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkAttachmentDescriptionFlagBits; - -typedef enum VkAttachmentLoadOp -{ - VK_ATTACHMENT_LOAD_OP_LOAD = 0, - VK_ATTACHMENT_LOAD_OP_CLEAR = 1, - VK_ATTACHMENT_LOAD_OP_DONT_CARE = 2, - VK_ATTACHMENT_LOAD_OP_NONE = 1000400000, - VK_ATTACHMENT_LOAD_OP_NONE_EXT = VK_ATTACHMENT_LOAD_OP_NONE, - VK_ATTACHMENT_LOAD_OP_NONE_KHR = VK_ATTACHMENT_LOAD_OP_NONE, - VK_ATTACHMENT_LOAD_OP_MAX_ENUM = 0x7fffffff, -} VkAttachmentLoadOp; - -typedef enum VkAttachmentStoreOp -{ - VK_ATTACHMENT_STORE_OP_STORE = 0, - VK_ATTACHMENT_STORE_OP_DONT_CARE = 1, - VK_ATTACHMENT_STORE_OP_NONE = 1000301000, - VK_ATTACHMENT_STORE_OP_NONE_KHR = VK_ATTACHMENT_STORE_OP_NONE, - VK_ATTACHMENT_STORE_OP_NONE_QCOM = VK_ATTACHMENT_STORE_OP_NONE, - VK_ATTACHMENT_STORE_OP_NONE_EXT = VK_ATTACHMENT_STORE_OP_NONE, - VK_ATTACHMENT_STORE_OP_MAX_ENUM = 0x7fffffff, -} VkAttachmentStoreOp; - -typedef enum VkBlendFactor -{ - VK_BLEND_FACTOR_ZERO = 0, - VK_BLEND_FACTOR_ONE = 1, - VK_BLEND_FACTOR_SRC_COLOR = 2, - VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 3, - VK_BLEND_FACTOR_DST_COLOR = 4, - VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 5, - VK_BLEND_FACTOR_SRC_ALPHA = 6, - VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 7, - VK_BLEND_FACTOR_DST_ALPHA = 8, - VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 9, - VK_BLEND_FACTOR_CONSTANT_COLOR = 10, - VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 11, - VK_BLEND_FACTOR_CONSTANT_ALPHA = 12, - VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 13, - VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 14, - VK_BLEND_FACTOR_SRC1_COLOR = 15, - VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 16, - VK_BLEND_FACTOR_SRC1_ALPHA = 17, - VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 18, - VK_BLEND_FACTOR_MAX_ENUM = 0x7fffffff, -} VkBlendFactor; - -typedef enum VkBlendOp -{ - VK_BLEND_OP_ADD = 0, - VK_BLEND_OP_SUBTRACT = 1, - VK_BLEND_OP_REVERSE_SUBTRACT = 2, - VK_BLEND_OP_MIN = 3, - VK_BLEND_OP_MAX = 4, - VK_BLEND_OP_ZERO_EXT = 1000148000, - VK_BLEND_OP_SRC_EXT = 1000148001, - VK_BLEND_OP_DST_EXT = 1000148002, - VK_BLEND_OP_SRC_OVER_EXT = 1000148003, - VK_BLEND_OP_DST_OVER_EXT = 1000148004, - VK_BLEND_OP_SRC_IN_EXT = 1000148005, - VK_BLEND_OP_DST_IN_EXT = 1000148006, - VK_BLEND_OP_SRC_OUT_EXT = 1000148007, - VK_BLEND_OP_DST_OUT_EXT = 1000148008, - VK_BLEND_OP_SRC_ATOP_EXT = 1000148009, - VK_BLEND_OP_DST_ATOP_EXT = 1000148010, - VK_BLEND_OP_XOR_EXT = 1000148011, - VK_BLEND_OP_MULTIPLY_EXT = 1000148012, - VK_BLEND_OP_SCREEN_EXT = 1000148013, - VK_BLEND_OP_OVERLAY_EXT = 1000148014, - VK_BLEND_OP_DARKEN_EXT = 1000148015, - VK_BLEND_OP_LIGHTEN_EXT = 1000148016, - VK_BLEND_OP_COLORDODGE_EXT = 1000148017, - VK_BLEND_OP_COLORBURN_EXT = 1000148018, - VK_BLEND_OP_HARDLIGHT_EXT = 1000148019, - VK_BLEND_OP_SOFTLIGHT_EXT = 1000148020, - VK_BLEND_OP_DIFFERENCE_EXT = 1000148021, - VK_BLEND_OP_EXCLUSION_EXT = 1000148022, - VK_BLEND_OP_INVERT_EXT = 1000148023, - VK_BLEND_OP_INVERT_RGB_EXT = 1000148024, - VK_BLEND_OP_LINEARDODGE_EXT = 1000148025, - VK_BLEND_OP_LINEARBURN_EXT = 1000148026, - VK_BLEND_OP_VIVIDLIGHT_EXT = 1000148027, - VK_BLEND_OP_LINEARLIGHT_EXT = 1000148028, - VK_BLEND_OP_PINLIGHT_EXT = 1000148029, - VK_BLEND_OP_HARDMIX_EXT = 1000148030, - VK_BLEND_OP_HSL_HUE_EXT = 1000148031, - VK_BLEND_OP_HSL_SATURATION_EXT = 1000148032, - VK_BLEND_OP_HSL_COLOR_EXT = 1000148033, - VK_BLEND_OP_HSL_LUMINOSITY_EXT = 1000148034, - VK_BLEND_OP_PLUS_EXT = 1000148035, - VK_BLEND_OP_PLUS_CLAMPED_EXT = 1000148036, - VK_BLEND_OP_PLUS_CLAMPED_ALPHA_EXT = 1000148037, - VK_BLEND_OP_PLUS_DARKER_EXT = 1000148038, - VK_BLEND_OP_MINUS_EXT = 1000148039, - VK_BLEND_OP_MINUS_CLAMPED_EXT = 1000148040, - VK_BLEND_OP_CONTRAST_EXT = 1000148041, - VK_BLEND_OP_INVERT_OVG_EXT = 1000148042, - VK_BLEND_OP_RED_EXT = 1000148043, - VK_BLEND_OP_GREEN_EXT = 1000148044, - VK_BLEND_OP_BLUE_EXT = 1000148045, - VK_BLEND_OP_MAX_ENUM = 0x7fffffff, -} VkBlendOp; - -typedef enum VkBlendOverlapEXT -{ - VK_BLEND_OVERLAP_UNCORRELATED_EXT = 0, - VK_BLEND_OVERLAP_DISJOINT_EXT = 1, - VK_BLEND_OVERLAP_CONJOINT_EXT = 2, - VK_BLEND_OVERLAP_EXT_MAX_ENUM = 0x7fffffff, -} VkBlendOverlapEXT; - -typedef enum VkBlockMatchWindowCompareModeQCOM -{ - VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MIN_QCOM = 0, - VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MAX_QCOM = 1, - VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_QCOM_MAX_ENUM = 0x7fffffff, -} VkBlockMatchWindowCompareModeQCOM; - -typedef enum VkBorderColor -{ - VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0, - VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 1, - VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 2, - VK_BORDER_COLOR_INT_OPAQUE_BLACK = 3, - VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 4, - VK_BORDER_COLOR_INT_OPAQUE_WHITE = 5, - VK_BORDER_COLOR_FLOAT_CUSTOM_EXT = 1000287003, - VK_BORDER_COLOR_INT_CUSTOM_EXT = 1000287004, - VK_BORDER_COLOR_MAX_ENUM = 0x7fffffff, -} VkBorderColor; - -typedef enum VkBufferCreateFlagBits -{ - VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, - VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, - VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, - VK_BUFFER_CREATE_PROTECTED_BIT = 0x00000008, - VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT = 0x00000010, - VK_BUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00000020, - VK_BUFFER_CREATE_VIDEO_PROFILE_INDEPENDENT_BIT_KHR = 0x00000040, - VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT = VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT, - VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR = VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT, - VK_BUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkBufferCreateFlagBits; - -typedef enum VkBufferUsageFlagBits -{ - VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, - VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, - VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, - VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, - VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, - VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, - VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, - VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, - VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT = 0x00000200, - VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR = 0x00000400, - VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT = 0x00000800, - VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT = 0x00001000, - VK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR = 0x00002000, - VK_BUFFER_USAGE_VIDEO_DECODE_DST_BIT_KHR = 0x00004000, - VK_BUFFER_USAGE_VIDEO_ENCODE_DST_BIT_KHR = 0x00008000, - VK_BUFFER_USAGE_VIDEO_ENCODE_SRC_BIT_KHR = 0x00010000, - VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT = 0x00020000, - VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR = 0x00080000, - VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR = 0x00100000, - VK_BUFFER_USAGE_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT = 0x00200000, - VK_BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT = 0x00400000, - VK_BUFFER_USAGE_MICROMAP_BUILD_INPUT_READ_ONLY_BIT_EXT = 0x00800000, - VK_BUFFER_USAGE_MICROMAP_STORAGE_BIT_EXT = 0x01000000, - VK_BUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT = 0x04000000, - VK_BUFFER_USAGE_RAY_TRACING_BIT_NV = VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR, - VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT = VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT, - VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_KHR = VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT, - VK_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkBufferUsageFlagBits; - -typedef VkFlags64 VkBufferUsageFlagBits2; - -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_TRANSFER_SRC_BIT = 0x00000001ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_TRANSFER_SRC_BIT_KHR = 0x00000001ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_TRANSFER_DST_BIT = 0x00000002ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_TRANSFER_DST_BIT_KHR = 0x00000002ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR = 0x00000004ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_STORAGE_TEXEL_BUFFER_BIT = 0x00000008ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_STORAGE_TEXEL_BUFFER_BIT_KHR = 0x00000008ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_UNIFORM_BUFFER_BIT = 0x00000010ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_UNIFORM_BUFFER_BIT_KHR = 0x00000010ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_STORAGE_BUFFER_BIT = 0x00000020ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_STORAGE_BUFFER_BIT_KHR = 0x00000020ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_INDEX_BUFFER_BIT = 0x00000040ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_INDEX_BUFFER_BIT_KHR = 0x00000040ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_VERTEX_BUFFER_BIT = 0x00000080ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_VERTEX_BUFFER_BIT_KHR = 0x00000080ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_INDIRECT_BUFFER_BIT = 0x00000100ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_INDIRECT_BUFFER_BIT_KHR = 0x00000100ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_CONDITIONAL_RENDERING_BIT_EXT = 0x00000200ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_SHADER_BINDING_TABLE_BIT_KHR = 0x00000400ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_RAY_TRACING_BIT_NV = 0x00000400ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT = 0x00000800ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT = 0x00001000ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_VIDEO_DECODE_SRC_BIT_KHR = 0x00002000ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_VIDEO_DECODE_DST_BIT_KHR = 0x00004000ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_VIDEO_ENCODE_DST_BIT_KHR = 0x00008000ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_VIDEO_ENCODE_SRC_BIT_KHR = 0x00010000ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_SHADER_DEVICE_ADDRESS_BIT = 0x00020000ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_SHADER_DEVICE_ADDRESS_BIT_KHR = 0x00020000ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR = 0x00080000ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR = 0x00100000ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT = 0x00200000ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT = 0x00400000ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_MICROMAP_BUILD_INPUT_READ_ONLY_BIT_EXT = 0x00800000ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_MICROMAP_STORAGE_BIT_EXT = 0x01000000ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT = 0x04000000ull; -static const VkBufferUsageFlagBits2 VK_BUFFER_USAGE_2_PREPROCESS_BUFFER_BIT_EXT = 0x80000000ull; -typedef VkBufferUsageFlagBits2 VkBufferUsageFlagBits2KHR; - -typedef enum VkBuildAccelerationStructureFlagBitsKHR -{ - VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR = 0x00000001, - VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR = 0x00000002, - VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR = 0x00000004, - VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR = 0x00000008, - VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR = 0x00000010, - VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV = 0x00000020, - VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_OPACITY_MICROMAP_UPDATE_EXT = 0x00000040, - VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_DISABLE_OPACITY_MICROMAPS_EXT = 0x00000080, - VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_OPACITY_MICROMAP_DATA_UPDATE_EXT = 0x00000100, - VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_DATA_ACCESS_KHR = 0x00000800, - VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR, - VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR, - VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR, - VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR, - VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR, - VK_BUILD_ACCELERATION_STRUCTURE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkBuildAccelerationStructureFlagBitsKHR; -typedef VkBuildAccelerationStructureFlagBitsKHR VkBuildAccelerationStructureFlagBitsNV; - -typedef enum VkBuildAccelerationStructureModeKHR -{ - VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR = 0, - VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR = 1, - VK_BUILD_ACCELERATION_STRUCTURE_MODE_KHR_MAX_ENUM = 0x7fffffff, -} VkBuildAccelerationStructureModeKHR; - -typedef enum VkBuildMicromapFlagBitsEXT -{ - VK_BUILD_MICROMAP_PREFER_FAST_TRACE_BIT_EXT = 0x00000001, - VK_BUILD_MICROMAP_PREFER_FAST_BUILD_BIT_EXT = 0x00000002, - VK_BUILD_MICROMAP_ALLOW_COMPACTION_BIT_EXT = 0x00000004, - VK_BUILD_MICROMAP_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkBuildMicromapFlagBitsEXT; - -typedef enum VkBuildMicromapModeEXT -{ - VK_BUILD_MICROMAP_MODE_BUILD_EXT = 0, - VK_BUILD_MICROMAP_MODE_EXT_MAX_ENUM = 0x7fffffff, -} VkBuildMicromapModeEXT; - -typedef enum VkChromaLocation -{ - VK_CHROMA_LOCATION_COSITED_EVEN = 0, - VK_CHROMA_LOCATION_MIDPOINT = 1, - VK_CHROMA_LOCATION_COSITED_EVEN_KHR = VK_CHROMA_LOCATION_COSITED_EVEN, - VK_CHROMA_LOCATION_MIDPOINT_KHR = VK_CHROMA_LOCATION_MIDPOINT, - VK_CHROMA_LOCATION_MAX_ENUM = 0x7fffffff, -} VkChromaLocation; -typedef VkChromaLocation VkChromaLocationKHR; - -typedef enum VkCoarseSampleOrderTypeNV -{ - VK_COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV = 0, - VK_COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV = 1, - VK_COARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV = 2, - VK_COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV = 3, - VK_COARSE_SAMPLE_ORDER_TYPE_NV_MAX_ENUM = 0x7fffffff, -} VkCoarseSampleOrderTypeNV; - -typedef enum VkColorComponentFlagBits -{ - VK_COLOR_COMPONENT_R_BIT = 0x00000001, - VK_COLOR_COMPONENT_G_BIT = 0x00000002, - VK_COLOR_COMPONENT_B_BIT = 0x00000004, - VK_COLOR_COMPONENT_A_BIT = 0x00000008, - VK_COLOR_COMPONENT_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkColorComponentFlagBits; - -typedef enum VkColorSpaceKHR -{ - VK_COLOR_SPACE_SRGB_NONLINEAR_KHR = 0, - VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104001, - VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT = 1000104002, - VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT = 1000104003, - VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104004, - VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104005, - VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104006, - VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104007, - VK_COLOR_SPACE_HDR10_ST2084_EXT = 1000104008, - VK_COLOR_SPACE_DOLBYVISION_EXT = 1000104009, - VK_COLOR_SPACE_HDR10_HLG_EXT = 1000104010, - VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011, - VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012, - VK_COLOR_SPACE_PASS_THROUGH_EXT = 1000104013, - VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT = 1000104014, - VK_COLORSPACE_SRGB_NONLINEAR_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, - VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT, - VK_COLOR_SPACE_KHR_MAX_ENUM = 0x7fffffff, -} VkColorSpaceKHR; - -typedef enum VkCommandBufferLevel -{ - VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0, - VK_COMMAND_BUFFER_LEVEL_SECONDARY = 1, - VK_COMMAND_BUFFER_LEVEL_MAX_ENUM = 0x7fffffff, -} VkCommandBufferLevel; - -typedef enum VkCommandBufferResetFlagBits -{ - VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, - VK_COMMAND_BUFFER_RESET_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkCommandBufferResetFlagBits; - -typedef enum VkCommandBufferUsageFlagBits -{ - VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001, - VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002, - VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004, - VK_COMMAND_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkCommandBufferUsageFlagBits; - -typedef enum VkCommandPoolCreateFlagBits -{ - VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, - VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, - VK_COMMAND_POOL_CREATE_PROTECTED_BIT = 0x00000004, - VK_COMMAND_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkCommandPoolCreateFlagBits; - -typedef enum VkCommandPoolResetFlagBits -{ - VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, - VK_COMMAND_POOL_RESET_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkCommandPoolResetFlagBits; - -typedef enum VkCompareOp -{ - VK_COMPARE_OP_NEVER = 0, - VK_COMPARE_OP_LESS = 1, - VK_COMPARE_OP_EQUAL = 2, - VK_COMPARE_OP_LESS_OR_EQUAL = 3, - VK_COMPARE_OP_GREATER = 4, - VK_COMPARE_OP_NOT_EQUAL = 5, - VK_COMPARE_OP_GREATER_OR_EQUAL = 6, - VK_COMPARE_OP_ALWAYS = 7, - VK_COMPARE_OP_MAX_ENUM = 0x7fffffff, -} VkCompareOp; - -typedef enum VkComponentSwizzle -{ - VK_COMPONENT_SWIZZLE_IDENTITY = 0, - VK_COMPONENT_SWIZZLE_ZERO = 1, - VK_COMPONENT_SWIZZLE_ONE = 2, - VK_COMPONENT_SWIZZLE_R = 3, - VK_COMPONENT_SWIZZLE_G = 4, - VK_COMPONENT_SWIZZLE_B = 5, - VK_COMPONENT_SWIZZLE_A = 6, - VK_COMPONENT_SWIZZLE_MAX_ENUM = 0x7fffffff, -} VkComponentSwizzle; - -typedef enum VkComponentTypeKHR -{ - VK_COMPONENT_TYPE_FLOAT16_KHR = 0, - VK_COMPONENT_TYPE_FLOAT32_KHR = 1, - VK_COMPONENT_TYPE_FLOAT64_KHR = 2, - VK_COMPONENT_TYPE_SINT8_KHR = 3, - VK_COMPONENT_TYPE_SINT16_KHR = 4, - VK_COMPONENT_TYPE_SINT32_KHR = 5, - VK_COMPONENT_TYPE_SINT64_KHR = 6, - VK_COMPONENT_TYPE_UINT8_KHR = 7, - VK_COMPONENT_TYPE_UINT16_KHR = 8, - VK_COMPONENT_TYPE_UINT32_KHR = 9, - VK_COMPONENT_TYPE_UINT64_KHR = 10, - VK_COMPONENT_TYPE_FLOAT16_NV = VK_COMPONENT_TYPE_FLOAT16_KHR, - VK_COMPONENT_TYPE_FLOAT32_NV = VK_COMPONENT_TYPE_FLOAT32_KHR, - VK_COMPONENT_TYPE_FLOAT64_NV = VK_COMPONENT_TYPE_FLOAT64_KHR, - VK_COMPONENT_TYPE_SINT8_NV = VK_COMPONENT_TYPE_SINT8_KHR, - VK_COMPONENT_TYPE_SINT16_NV = VK_COMPONENT_TYPE_SINT16_KHR, - VK_COMPONENT_TYPE_SINT32_NV = VK_COMPONENT_TYPE_SINT32_KHR, - VK_COMPONENT_TYPE_SINT64_NV = VK_COMPONENT_TYPE_SINT64_KHR, - VK_COMPONENT_TYPE_UINT8_NV = VK_COMPONENT_TYPE_UINT8_KHR, - VK_COMPONENT_TYPE_UINT16_NV = VK_COMPONENT_TYPE_UINT16_KHR, - VK_COMPONENT_TYPE_UINT32_NV = VK_COMPONENT_TYPE_UINT32_KHR, - VK_COMPONENT_TYPE_UINT64_NV = VK_COMPONENT_TYPE_UINT64_KHR, - VK_COMPONENT_TYPE_KHR_MAX_ENUM = 0x7fffffff, -} VkComponentTypeKHR; -typedef VkComponentTypeKHR VkComponentTypeNV; - -typedef enum VkCompositeAlphaFlagBitsKHR -{ - VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, - VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002, - VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004, - VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008, - VK_COMPOSITE_ALPHA_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkCompositeAlphaFlagBitsKHR; - -typedef enum VkConditionalRenderingFlagBitsEXT -{ - VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT = 0x00000001, - VK_CONDITIONAL_RENDERING_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkConditionalRenderingFlagBitsEXT; - -typedef enum VkConservativeRasterizationModeEXT -{ - VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT = 0, - VK_CONSERVATIVE_RASTERIZATION_MODE_OVERESTIMATE_EXT = 1, - VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT = 2, - VK_CONSERVATIVE_RASTERIZATION_MODE_EXT_MAX_ENUM = 0x7fffffff, -} VkConservativeRasterizationModeEXT; - -typedef enum VkCopyAccelerationStructureModeKHR -{ - VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR = 0, - VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR = 1, - VK_COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR = 2, - VK_COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR = 3, - VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_NV = VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR, - VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_NV = VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR, - VK_COPY_ACCELERATION_STRUCTURE_MODE_KHR_MAX_ENUM = 0x7fffffff, -} VkCopyAccelerationStructureModeKHR; -typedef VkCopyAccelerationStructureModeKHR VkCopyAccelerationStructureModeNV; - -typedef enum VkCopyMicromapModeEXT -{ - VK_COPY_MICROMAP_MODE_CLONE_EXT = 0, - VK_COPY_MICROMAP_MODE_SERIALIZE_EXT = 1, - VK_COPY_MICROMAP_MODE_DESERIALIZE_EXT = 2, - VK_COPY_MICROMAP_MODE_COMPACT_EXT = 3, - VK_COPY_MICROMAP_MODE_EXT_MAX_ENUM = 0x7fffffff, -} VkCopyMicromapModeEXT; - -typedef enum VkCoverageModulationModeNV -{ - VK_COVERAGE_MODULATION_MODE_NONE_NV = 0, - VK_COVERAGE_MODULATION_MODE_RGB_NV = 1, - VK_COVERAGE_MODULATION_MODE_ALPHA_NV = 2, - VK_COVERAGE_MODULATION_MODE_RGBA_NV = 3, - VK_COVERAGE_MODULATION_MODE_NV_MAX_ENUM = 0x7fffffff, -} VkCoverageModulationModeNV; - -typedef enum VkCoverageReductionModeNV -{ - VK_COVERAGE_REDUCTION_MODE_MERGE_NV = 0, - VK_COVERAGE_REDUCTION_MODE_TRUNCATE_NV = 1, - VK_COVERAGE_REDUCTION_MODE_NV_MAX_ENUM = 0x7fffffff, -} VkCoverageReductionModeNV; - -typedef enum VkCubicFilterWeightsQCOM -{ - VK_CUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM = 0, - VK_CUBIC_FILTER_WEIGHTS_ZERO_TANGENT_CARDINAL_QCOM = 1, - VK_CUBIC_FILTER_WEIGHTS_B_SPLINE_QCOM = 2, - VK_CUBIC_FILTER_WEIGHTS_MITCHELL_NETRAVALI_QCOM = 3, - VK_CUBIC_FILTER_WEIGHTS_QCOM_MAX_ENUM = 0x7fffffff, -} VkCubicFilterWeightsQCOM; - -typedef enum VkCullModeFlagBits -{ - VK_CULL_MODE_NONE = 0, - VK_CULL_MODE_FRONT_BIT = 0x00000001, - VK_CULL_MODE_BACK_BIT = 0x00000002, - VK_CULL_MODE_FRONT_AND_BACK = 0x00000003, - VK_CULL_MODE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkCullModeFlagBits; - -typedef enum VkDebugReportFlagBitsEXT -{ - VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001, - VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002, - VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004, - VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008, - VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010, - VK_DEBUG_REPORT_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkDebugReportFlagBitsEXT; - -typedef enum VkDebugReportObjectTypeEXT -{ - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0, - VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2, - VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3, - VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4, - VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6, - VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7, - VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8, - VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10, - VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11, - VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12, - VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14, - VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17, - VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20, - VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23, - VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25, - VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26, - VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27, - VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT = 28, - VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29, - VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30, - VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT = 33, - VK_DEBUG_REPORT_OBJECT_TYPE_CU_MODULE_NVX_EXT = 1000029000, - VK_DEBUG_REPORT_OBJECT_TYPE_CU_FUNCTION_NVX_EXT = 1000029001, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT = 1000085000, - VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR_EXT = 1000150000, - VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT = 1000156000, - VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT = 1000165000, - VK_DEBUG_REPORT_OBJECT_TYPE_CUDA_MODULE_NV_EXT = 1000307000, - VK_DEBUG_REPORT_OBJECT_TYPE_CUDA_FUNCTION_NV_EXT = 1000307001, - VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_EXT_MAX_ENUM = 0x7fffffff, -} VkDebugReportObjectTypeEXT; - -typedef enum VkDebugUtilsMessageSeverityFlagBitsEXT -{ - VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT = 0x00000001, - VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT = 0x00000010, - VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT = 0x00000100, - VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT = 0x00001000, - VK_DEBUG_UTILS_MESSAGE_SEVERITY_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkDebugUtilsMessageSeverityFlagBitsEXT; - -typedef enum VkDebugUtilsMessageTypeFlagBitsEXT -{ - VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT = 0x00000001, - VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT = 0x00000002, - VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT = 0x00000004, - VK_DEBUG_UTILS_MESSAGE_TYPE_DEVICE_ADDRESS_BINDING_BIT_EXT = 0x00000008, - VK_DEBUG_UTILS_MESSAGE_TYPE_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkDebugUtilsMessageTypeFlagBitsEXT; - -typedef enum VkDependencyFlagBits -{ - VK_DEPENDENCY_BY_REGION_BIT = 0x00000001, - VK_DEPENDENCY_VIEW_LOCAL_BIT = 0x00000002, - VK_DEPENDENCY_DEVICE_GROUP_BIT = 0x00000004, - VK_DEPENDENCY_FEEDBACK_LOOP_BIT_EXT = 0x00000008, - VK_DEPENDENCY_VIEW_LOCAL_BIT_KHR = VK_DEPENDENCY_VIEW_LOCAL_BIT, - VK_DEPENDENCY_DEVICE_GROUP_BIT_KHR = VK_DEPENDENCY_DEVICE_GROUP_BIT, - VK_DEPENDENCY_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkDependencyFlagBits; - -typedef enum VkDepthBiasRepresentationEXT -{ - VK_DEPTH_BIAS_REPRESENTATION_LEAST_REPRESENTABLE_VALUE_FORMAT_EXT = 0, - VK_DEPTH_BIAS_REPRESENTATION_LEAST_REPRESENTABLE_VALUE_FORCE_UNORM_EXT = 1, - VK_DEPTH_BIAS_REPRESENTATION_FLOAT_EXT = 2, - VK_DEPTH_BIAS_REPRESENTATION_EXT_MAX_ENUM = 0x7fffffff, -} VkDepthBiasRepresentationEXT; - -typedef enum VkDepthClampModeEXT -{ - VK_DEPTH_CLAMP_MODE_VIEWPORT_RANGE_EXT = 0, - VK_DEPTH_CLAMP_MODE_USER_DEFINED_RANGE_EXT = 1, - VK_DEPTH_CLAMP_MODE_EXT_MAX_ENUM = 0x7fffffff, -} VkDepthClampModeEXT; - -typedef enum VkDescriptorBindingFlagBits -{ - VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT = 0x00000001, - VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT = 0x00000002, - VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT = 0x00000004, - VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT = 0x00000008, - VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT = VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT, - VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT = VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT, - VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT = VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT, - VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT = VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT, - VK_DESCRIPTOR_BINDING_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkDescriptorBindingFlagBits; -typedef VkDescriptorBindingFlagBits VkDescriptorBindingFlagBitsEXT; - -typedef enum VkDescriptorPoolCreateFlagBits -{ - VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001, - VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT = 0x00000002, - VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT = 0x00000004, - VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_SETS_BIT_NV = 0x00000008, - VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_POOLS_BIT_NV = 0x00000010, - VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT = VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT, - VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE = VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT, - VK_DESCRIPTOR_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkDescriptorPoolCreateFlagBits; - -typedef enum VkDescriptorSetLayoutCreateFlagBits -{ - VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT = 0x00000001, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT = 0x00000002, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT = 0x00000004, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT = 0x00000010, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT = 0x00000020, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_PER_STAGE_BIT_NV = 0x00000040, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_INDIRECT_BINDABLE_BIT_NV = 0x00000080, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR = VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT = VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE = VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkDescriptorSetLayoutCreateFlagBits; - -typedef enum VkDescriptorType -{ - VK_DESCRIPTOR_TYPE_SAMPLER = 0, - VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 1, - VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 2, - VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 3, - VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 4, - VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 5, - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 6, - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 7, - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 8, - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 9, - VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 10, - VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK = 1000138000, - VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR = 1000150000, - VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV = 1000165000, - VK_DESCRIPTOR_TYPE_MUTABLE_EXT = 1000351000, - VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM = 1000440000, - VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM = 1000440001, - VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT = VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK, - VK_DESCRIPTOR_TYPE_MUTABLE_VALVE = VK_DESCRIPTOR_TYPE_MUTABLE_EXT, - VK_DESCRIPTOR_TYPE_MAX_ENUM = 0x7fffffff, -} VkDescriptorType; - -typedef enum VkDescriptorUpdateTemplateType -{ - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET = 0, - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS = 1, - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS, - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_MAX_ENUM = 0x7fffffff, -} VkDescriptorUpdateTemplateType; -typedef VkDescriptorUpdateTemplateType VkDescriptorUpdateTemplateTypeKHR; - -typedef enum VkDeviceAddressBindingFlagBitsEXT -{ - VK_DEVICE_ADDRESS_BINDING_INTERNAL_OBJECT_BIT_EXT = 0x00000001, - VK_DEVICE_ADDRESS_BINDING_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkDeviceAddressBindingFlagBitsEXT; - -typedef enum VkDeviceAddressBindingTypeEXT -{ - VK_DEVICE_ADDRESS_BINDING_TYPE_BIND_EXT = 0, - VK_DEVICE_ADDRESS_BINDING_TYPE_UNBIND_EXT = 1, - VK_DEVICE_ADDRESS_BINDING_TYPE_EXT_MAX_ENUM = 0x7fffffff, -} VkDeviceAddressBindingTypeEXT; - -typedef enum VkDeviceDiagnosticsConfigFlagBitsNV -{ - VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_SHADER_DEBUG_INFO_BIT_NV = 0x00000001, - VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_RESOURCE_TRACKING_BIT_NV = 0x00000002, - VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_AUTOMATIC_CHECKPOINTS_BIT_NV = 0x00000004, - VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_SHADER_ERROR_REPORTING_BIT_NV = 0x00000008, - VK_DEVICE_DIAGNOSTICS_CONFIG_FLAG_BITS_NV_MAX_ENUM = 0x7fffffff, -} VkDeviceDiagnosticsConfigFlagBitsNV; - -typedef enum VkDeviceFaultAddressTypeEXT -{ - VK_DEVICE_FAULT_ADDRESS_TYPE_NONE_EXT = 0, - VK_DEVICE_FAULT_ADDRESS_TYPE_READ_INVALID_EXT = 1, - VK_DEVICE_FAULT_ADDRESS_TYPE_WRITE_INVALID_EXT = 2, - VK_DEVICE_FAULT_ADDRESS_TYPE_EXECUTE_INVALID_EXT = 3, - VK_DEVICE_FAULT_ADDRESS_TYPE_INSTRUCTION_POINTER_UNKNOWN_EXT = 4, - VK_DEVICE_FAULT_ADDRESS_TYPE_INSTRUCTION_POINTER_INVALID_EXT = 5, - VK_DEVICE_FAULT_ADDRESS_TYPE_INSTRUCTION_POINTER_FAULT_EXT = 6, - VK_DEVICE_FAULT_ADDRESS_TYPE_EXT_MAX_ENUM = 0x7fffffff, -} VkDeviceFaultAddressTypeEXT; - -typedef enum VkDeviceFaultVendorBinaryHeaderVersionEXT -{ - VK_DEVICE_FAULT_VENDOR_BINARY_HEADER_VERSION_ONE_EXT = 1, - VK_DEVICE_FAULT_VENDOR_BINARY_HEADER_VERSION_EXT_MAX_ENUM = 0x7fffffff, -} VkDeviceFaultVendorBinaryHeaderVersionEXT; - -typedef enum VkDeviceGroupPresentModeFlagBitsKHR -{ - VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR = 0x00000001, - VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR = 0x00000002, - VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR = 0x00000004, - VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR = 0x00000008, - VK_DEVICE_GROUP_PRESENT_MODE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkDeviceGroupPresentModeFlagBitsKHR; - -typedef enum VkDeviceQueueCreateFlagBits -{ - VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT = 0x00000001, - VK_DEVICE_QUEUE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkDeviceQueueCreateFlagBits; - -typedef enum VkDiscardRectangleModeEXT -{ - VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT = 0, - VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT = 1, - VK_DISCARD_RECTANGLE_MODE_EXT_MAX_ENUM = 0x7fffffff, -} VkDiscardRectangleModeEXT; - -typedef enum VkDriverId -{ - VK_DRIVER_ID_AMD_PROPRIETARY = 1, - VK_DRIVER_ID_AMD_OPEN_SOURCE = 2, - VK_DRIVER_ID_MESA_RADV = 3, - VK_DRIVER_ID_NVIDIA_PROPRIETARY = 4, - VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS = 5, - VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA = 6, - VK_DRIVER_ID_IMAGINATION_PROPRIETARY = 7, - VK_DRIVER_ID_QUALCOMM_PROPRIETARY = 8, - VK_DRIVER_ID_ARM_PROPRIETARY = 9, - VK_DRIVER_ID_GOOGLE_SWIFTSHADER = 10, - VK_DRIVER_ID_GGP_PROPRIETARY = 11, - VK_DRIVER_ID_BROADCOM_PROPRIETARY = 12, - VK_DRIVER_ID_MESA_LLVMPIPE = 13, - VK_DRIVER_ID_MOLTENVK = 14, - VK_DRIVER_ID_COREAVI_PROPRIETARY = 15, - VK_DRIVER_ID_JUICE_PROPRIETARY = 16, - VK_DRIVER_ID_VERISILICON_PROPRIETARY = 17, - VK_DRIVER_ID_MESA_TURNIP = 18, - VK_DRIVER_ID_MESA_V3DV = 19, - VK_DRIVER_ID_MESA_PANVK = 20, - VK_DRIVER_ID_SAMSUNG_PROPRIETARY = 21, - VK_DRIVER_ID_MESA_VENUS = 22, - VK_DRIVER_ID_MESA_DOZEN = 23, - VK_DRIVER_ID_MESA_NVK = 24, - VK_DRIVER_ID_IMAGINATION_OPEN_SOURCE_MESA = 25, - VK_DRIVER_ID_MESA_HONEYKRISP = 26, - VK_DRIVER_ID_RESERVED_27 = 27, - VK_DRIVER_ID_AMD_PROPRIETARY_KHR = VK_DRIVER_ID_AMD_PROPRIETARY, - VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR = VK_DRIVER_ID_AMD_OPEN_SOURCE, - VK_DRIVER_ID_MESA_RADV_KHR = VK_DRIVER_ID_MESA_RADV, - VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR = VK_DRIVER_ID_NVIDIA_PROPRIETARY, - VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS_KHR = VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS, - VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR = VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA, - VK_DRIVER_ID_IMAGINATION_PROPRIETARY_KHR = VK_DRIVER_ID_IMAGINATION_PROPRIETARY, - VK_DRIVER_ID_QUALCOMM_PROPRIETARY_KHR = VK_DRIVER_ID_QUALCOMM_PROPRIETARY, - VK_DRIVER_ID_ARM_PROPRIETARY_KHR = VK_DRIVER_ID_ARM_PROPRIETARY, - VK_DRIVER_ID_GOOGLE_SWIFTSHADER_KHR = VK_DRIVER_ID_GOOGLE_SWIFTSHADER, - VK_DRIVER_ID_GGP_PROPRIETARY_KHR = VK_DRIVER_ID_GGP_PROPRIETARY, - VK_DRIVER_ID_BROADCOM_PROPRIETARY_KHR = VK_DRIVER_ID_BROADCOM_PROPRIETARY, - VK_DRIVER_ID_MAX_ENUM = 0x7fffffff, -} VkDriverId; -typedef VkDriverId VkDriverIdKHR; - -typedef enum VkDynamicState -{ - VK_DYNAMIC_STATE_VIEWPORT = 0, - VK_DYNAMIC_STATE_SCISSOR = 1, - VK_DYNAMIC_STATE_LINE_WIDTH = 2, - VK_DYNAMIC_STATE_DEPTH_BIAS = 3, - VK_DYNAMIC_STATE_BLEND_CONSTANTS = 4, - VK_DYNAMIC_STATE_DEPTH_BOUNDS = 5, - VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 6, - VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 7, - VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8, - VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV = 1000087000, - VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT = 1000099000, - VK_DYNAMIC_STATE_DISCARD_RECTANGLE_ENABLE_EXT = 1000099001, - VK_DYNAMIC_STATE_DISCARD_RECTANGLE_MODE_EXT = 1000099002, - VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT = 1000143000, - VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV = 1000164004, - VK_DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV = 1000164006, - VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_ENABLE_NV = 1000205000, - VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV = 1000205001, - VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR = 1000226000, - VK_DYNAMIC_STATE_LINE_STIPPLE = 1000259000, - VK_DYNAMIC_STATE_CULL_MODE = 1000267000, - VK_DYNAMIC_STATE_FRONT_FACE = 1000267001, - VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY = 1000267002, - VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT = 1000267003, - VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT = 1000267004, - VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE = 1000267005, - VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE = 1000267006, - VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE = 1000267007, - VK_DYNAMIC_STATE_DEPTH_COMPARE_OP = 1000267008, - VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE = 1000267009, - VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE = 1000267010, - VK_DYNAMIC_STATE_STENCIL_OP = 1000267011, - VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR = 1000347000, - VK_DYNAMIC_STATE_VERTEX_INPUT_EXT = 1000352000, - VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT = 1000377000, - VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE = 1000377001, - VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE = 1000377002, - VK_DYNAMIC_STATE_LOGIC_OP_EXT = 1000377003, - VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE = 1000377004, - VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT = 1000381000, - VK_DYNAMIC_STATE_TESSELLATION_DOMAIN_ORIGIN_EXT = 1000455002, - VK_DYNAMIC_STATE_DEPTH_CLAMP_ENABLE_EXT = 1000455003, - VK_DYNAMIC_STATE_POLYGON_MODE_EXT = 1000455004, - VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT = 1000455005, - VK_DYNAMIC_STATE_SAMPLE_MASK_EXT = 1000455006, - VK_DYNAMIC_STATE_ALPHA_TO_COVERAGE_ENABLE_EXT = 1000455007, - VK_DYNAMIC_STATE_ALPHA_TO_ONE_ENABLE_EXT = 1000455008, - VK_DYNAMIC_STATE_LOGIC_OP_ENABLE_EXT = 1000455009, - VK_DYNAMIC_STATE_COLOR_BLEND_ENABLE_EXT = 1000455010, - VK_DYNAMIC_STATE_COLOR_BLEND_EQUATION_EXT = 1000455011, - VK_DYNAMIC_STATE_COLOR_WRITE_MASK_EXT = 1000455012, - VK_DYNAMIC_STATE_RASTERIZATION_STREAM_EXT = 1000455013, - VK_DYNAMIC_STATE_CONSERVATIVE_RASTERIZATION_MODE_EXT = 1000455014, - VK_DYNAMIC_STATE_EXTRA_PRIMITIVE_OVERESTIMATION_SIZE_EXT = 1000455015, - VK_DYNAMIC_STATE_DEPTH_CLIP_ENABLE_EXT = 1000455016, - VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_ENABLE_EXT = 1000455017, - VK_DYNAMIC_STATE_COLOR_BLEND_ADVANCED_EXT = 1000455018, - VK_DYNAMIC_STATE_PROVOKING_VERTEX_MODE_EXT = 1000455019, - VK_DYNAMIC_STATE_LINE_RASTERIZATION_MODE_EXT = 1000455020, - VK_DYNAMIC_STATE_LINE_STIPPLE_ENABLE_EXT = 1000455021, - VK_DYNAMIC_STATE_DEPTH_CLIP_NEGATIVE_ONE_TO_ONE_EXT = 1000455022, - VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_ENABLE_NV = 1000455023, - VK_DYNAMIC_STATE_VIEWPORT_SWIZZLE_NV = 1000455024, - VK_DYNAMIC_STATE_COVERAGE_TO_COLOR_ENABLE_NV = 1000455025, - VK_DYNAMIC_STATE_COVERAGE_TO_COLOR_LOCATION_NV = 1000455026, - VK_DYNAMIC_STATE_COVERAGE_MODULATION_MODE_NV = 1000455027, - VK_DYNAMIC_STATE_COVERAGE_MODULATION_TABLE_ENABLE_NV = 1000455028, - VK_DYNAMIC_STATE_COVERAGE_MODULATION_TABLE_NV = 1000455029, - VK_DYNAMIC_STATE_SHADING_RATE_IMAGE_ENABLE_NV = 1000455030, - VK_DYNAMIC_STATE_REPRESENTATIVE_FRAGMENT_TEST_ENABLE_NV = 1000455031, - VK_DYNAMIC_STATE_COVERAGE_REDUCTION_MODE_NV = 1000455032, - VK_DYNAMIC_STATE_ATTACHMENT_FEEDBACK_LOOP_ENABLE_EXT = 1000524000, - VK_DYNAMIC_STATE_DEPTH_CLAMP_RANGE_EXT = 1000582000, - VK_DYNAMIC_STATE_LINE_STIPPLE_EXT = VK_DYNAMIC_STATE_LINE_STIPPLE, - VK_DYNAMIC_STATE_CULL_MODE_EXT = VK_DYNAMIC_STATE_CULL_MODE, - VK_DYNAMIC_STATE_FRONT_FACE_EXT = VK_DYNAMIC_STATE_FRONT_FACE, - VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXT = VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY, - VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT = VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT, - VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT = VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT, - VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT = VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE, - VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE_EXT = VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE, - VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE_EXT = VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE, - VK_DYNAMIC_STATE_DEPTH_COMPARE_OP_EXT = VK_DYNAMIC_STATE_DEPTH_COMPARE_OP, - VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE_EXT = VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE, - VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE_EXT = VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE, - VK_DYNAMIC_STATE_STENCIL_OP_EXT = VK_DYNAMIC_STATE_STENCIL_OP, - VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT = VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE, - VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE_EXT = VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE, - VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT = VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE, - VK_DYNAMIC_STATE_LINE_STIPPLE_KHR = VK_DYNAMIC_STATE_LINE_STIPPLE, - VK_DYNAMIC_STATE_MAX_ENUM = 0x7fffffff, -} VkDynamicState; - -typedef enum VkEventCreateFlagBits -{ - VK_EVENT_CREATE_DEVICE_ONLY_BIT = 0x00000001, - VK_EVENT_CREATE_DEVICE_ONLY_BIT_KHR = VK_EVENT_CREATE_DEVICE_ONLY_BIT, - VK_EVENT_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkEventCreateFlagBits; - -typedef enum VkExternalFenceFeatureFlagBits -{ - VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT = 0x00000001, - VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT = 0x00000002, - VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT_KHR = VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT, - VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT_KHR = VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT, - VK_EXTERNAL_FENCE_FEATURE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkExternalFenceFeatureFlagBits; -typedef VkExternalFenceFeatureFlagBits VkExternalFenceFeatureFlagBitsKHR; - -typedef enum VkExternalFenceHandleTypeFlagBits -{ - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT = 0x00000001, - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT = 0x00000002, - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 0x00000004, - VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT = 0x00000008, - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT, - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT, - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, - VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT, - VK_EXTERNAL_FENCE_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkExternalFenceHandleTypeFlagBits; -typedef VkExternalFenceHandleTypeFlagBits VkExternalFenceHandleTypeFlagBitsKHR; - -typedef enum VkExternalMemoryFeatureFlagBits -{ - VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT = 0x00000001, - VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT = 0x00000002, - VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT = 0x00000004, - VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT, - VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT, - VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT, - VK_EXTERNAL_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkExternalMemoryFeatureFlagBits; -typedef VkExternalMemoryFeatureFlagBits VkExternalMemoryFeatureFlagBitsKHR; - -typedef enum VkExternalMemoryHandleTypeFlagBits -{ - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT = 0x00000001, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT = 0x00000002, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 0x00000004, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT = 0x00000008, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT = 0x00000010, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT = 0x00000020, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT = 0x00000040, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT = 0x00000080, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT = 0x00000100, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkExternalMemoryHandleTypeFlagBits; -typedef VkExternalMemoryHandleTypeFlagBits VkExternalMemoryHandleTypeFlagBitsKHR; - -typedef enum VkExternalSemaphoreFeatureFlagBits -{ - VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT = 0x00000001, - VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT = 0x00000002, - VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHR = VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT, - VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHR = VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT, - VK_EXTERNAL_SEMAPHORE_FEATURE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkExternalSemaphoreFeatureFlagBits; -typedef VkExternalSemaphoreFeatureFlagBits VkExternalSemaphoreFeatureFlagBitsKHR; - -typedef enum VkExternalSemaphoreHandleTypeFlagBits -{ - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT = 0x00000001, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT = 0x00000002, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 0x00000004, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT = 0x00000008, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT = 0x00000010, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE_BIT = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkExternalSemaphoreHandleTypeFlagBits; -typedef VkExternalSemaphoreHandleTypeFlagBits VkExternalSemaphoreHandleTypeFlagBitsKHR; - -typedef enum VkFenceCreateFlagBits -{ - VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001, - VK_FENCE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkFenceCreateFlagBits; - -typedef enum VkFenceImportFlagBits -{ - VK_FENCE_IMPORT_TEMPORARY_BIT = 0x00000001, - VK_FENCE_IMPORT_TEMPORARY_BIT_KHR = VK_FENCE_IMPORT_TEMPORARY_BIT, - VK_FENCE_IMPORT_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkFenceImportFlagBits; -typedef VkFenceImportFlagBits VkFenceImportFlagBitsKHR; - -typedef enum VkFilter -{ - VK_FILTER_NEAREST = 0, - VK_FILTER_LINEAR = 1, - VK_FILTER_CUBIC_EXT = 1000015000, - VK_FILTER_CUBIC_IMG = VK_FILTER_CUBIC_EXT, - VK_FILTER_MAX_ENUM = 0x7fffffff, -} VkFilter; - -typedef enum VkFormat -{ - VK_FORMAT_UNDEFINED = 0, - VK_FORMAT_R4G4_UNORM_PACK8 = 1, - VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2, - VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3, - VK_FORMAT_R5G6B5_UNORM_PACK16 = 4, - VK_FORMAT_B5G6R5_UNORM_PACK16 = 5, - VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6, - VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7, - VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8, - VK_FORMAT_R8_UNORM = 9, - VK_FORMAT_R8_SNORM = 10, - VK_FORMAT_R8_USCALED = 11, - VK_FORMAT_R8_SSCALED = 12, - VK_FORMAT_R8_UINT = 13, - VK_FORMAT_R8_SINT = 14, - VK_FORMAT_R8_SRGB = 15, - VK_FORMAT_R8G8_UNORM = 16, - VK_FORMAT_R8G8_SNORM = 17, - VK_FORMAT_R8G8_USCALED = 18, - VK_FORMAT_R8G8_SSCALED = 19, - VK_FORMAT_R8G8_UINT = 20, - VK_FORMAT_R8G8_SINT = 21, - VK_FORMAT_R8G8_SRGB = 22, - VK_FORMAT_R8G8B8_UNORM = 23, - VK_FORMAT_R8G8B8_SNORM = 24, - VK_FORMAT_R8G8B8_USCALED = 25, - VK_FORMAT_R8G8B8_SSCALED = 26, - VK_FORMAT_R8G8B8_UINT = 27, - VK_FORMAT_R8G8B8_SINT = 28, - VK_FORMAT_R8G8B8_SRGB = 29, - VK_FORMAT_B8G8R8_UNORM = 30, - VK_FORMAT_B8G8R8_SNORM = 31, - VK_FORMAT_B8G8R8_USCALED = 32, - VK_FORMAT_B8G8R8_SSCALED = 33, - VK_FORMAT_B8G8R8_UINT = 34, - VK_FORMAT_B8G8R8_SINT = 35, - VK_FORMAT_B8G8R8_SRGB = 36, - VK_FORMAT_R8G8B8A8_UNORM = 37, - VK_FORMAT_R8G8B8A8_SNORM = 38, - VK_FORMAT_R8G8B8A8_USCALED = 39, - VK_FORMAT_R8G8B8A8_SSCALED = 40, - VK_FORMAT_R8G8B8A8_UINT = 41, - VK_FORMAT_R8G8B8A8_SINT = 42, - VK_FORMAT_R8G8B8A8_SRGB = 43, - VK_FORMAT_B8G8R8A8_UNORM = 44, - VK_FORMAT_B8G8R8A8_SNORM = 45, - VK_FORMAT_B8G8R8A8_USCALED = 46, - VK_FORMAT_B8G8R8A8_SSCALED = 47, - VK_FORMAT_B8G8R8A8_UINT = 48, - VK_FORMAT_B8G8R8A8_SINT = 49, - VK_FORMAT_B8G8R8A8_SRGB = 50, - VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51, - VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52, - VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53, - VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54, - VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55, - VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56, - VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57, - VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58, - VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59, - VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60, - VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61, - VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62, - VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63, - VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64, - VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65, - VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66, - VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67, - VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68, - VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69, - VK_FORMAT_R16_UNORM = 70, - VK_FORMAT_R16_SNORM = 71, - VK_FORMAT_R16_USCALED = 72, - VK_FORMAT_R16_SSCALED = 73, - VK_FORMAT_R16_UINT = 74, - VK_FORMAT_R16_SINT = 75, - VK_FORMAT_R16_SFLOAT = 76, - VK_FORMAT_R16G16_UNORM = 77, - VK_FORMAT_R16G16_SNORM = 78, - VK_FORMAT_R16G16_USCALED = 79, - VK_FORMAT_R16G16_SSCALED = 80, - VK_FORMAT_R16G16_UINT = 81, - VK_FORMAT_R16G16_SINT = 82, - VK_FORMAT_R16G16_SFLOAT = 83, - VK_FORMAT_R16G16B16_UNORM = 84, - VK_FORMAT_R16G16B16_SNORM = 85, - VK_FORMAT_R16G16B16_USCALED = 86, - VK_FORMAT_R16G16B16_SSCALED = 87, - VK_FORMAT_R16G16B16_UINT = 88, - VK_FORMAT_R16G16B16_SINT = 89, - VK_FORMAT_R16G16B16_SFLOAT = 90, - VK_FORMAT_R16G16B16A16_UNORM = 91, - VK_FORMAT_R16G16B16A16_SNORM = 92, - VK_FORMAT_R16G16B16A16_USCALED = 93, - VK_FORMAT_R16G16B16A16_SSCALED = 94, - VK_FORMAT_R16G16B16A16_UINT = 95, - VK_FORMAT_R16G16B16A16_SINT = 96, - VK_FORMAT_R16G16B16A16_SFLOAT = 97, - VK_FORMAT_R32_UINT = 98, - VK_FORMAT_R32_SINT = 99, - VK_FORMAT_R32_SFLOAT = 100, - VK_FORMAT_R32G32_UINT = 101, - VK_FORMAT_R32G32_SINT = 102, - VK_FORMAT_R32G32_SFLOAT = 103, - VK_FORMAT_R32G32B32_UINT = 104, - VK_FORMAT_R32G32B32_SINT = 105, - VK_FORMAT_R32G32B32_SFLOAT = 106, - VK_FORMAT_R32G32B32A32_UINT = 107, - VK_FORMAT_R32G32B32A32_SINT = 108, - VK_FORMAT_R32G32B32A32_SFLOAT = 109, - VK_FORMAT_R64_UINT = 110, - VK_FORMAT_R64_SINT = 111, - VK_FORMAT_R64_SFLOAT = 112, - VK_FORMAT_R64G64_UINT = 113, - VK_FORMAT_R64G64_SINT = 114, - VK_FORMAT_R64G64_SFLOAT = 115, - VK_FORMAT_R64G64B64_UINT = 116, - VK_FORMAT_R64G64B64_SINT = 117, - VK_FORMAT_R64G64B64_SFLOAT = 118, - VK_FORMAT_R64G64B64A64_UINT = 119, - VK_FORMAT_R64G64B64A64_SINT = 120, - VK_FORMAT_R64G64B64A64_SFLOAT = 121, - VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122, - VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123, - VK_FORMAT_D16_UNORM = 124, - VK_FORMAT_X8_D24_UNORM_PACK32 = 125, - VK_FORMAT_D32_SFLOAT = 126, - VK_FORMAT_S8_UINT = 127, - VK_FORMAT_D16_UNORM_S8_UINT = 128, - VK_FORMAT_D24_UNORM_S8_UINT = 129, - VK_FORMAT_D32_SFLOAT_S8_UINT = 130, - VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131, - VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132, - VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133, - VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134, - VK_FORMAT_BC2_UNORM_BLOCK = 135, - VK_FORMAT_BC2_SRGB_BLOCK = 136, - VK_FORMAT_BC3_UNORM_BLOCK = 137, - VK_FORMAT_BC3_SRGB_BLOCK = 138, - VK_FORMAT_BC4_UNORM_BLOCK = 139, - VK_FORMAT_BC4_SNORM_BLOCK = 140, - VK_FORMAT_BC5_UNORM_BLOCK = 141, - VK_FORMAT_BC5_SNORM_BLOCK = 142, - VK_FORMAT_BC6H_UFLOAT_BLOCK = 143, - VK_FORMAT_BC6H_SFLOAT_BLOCK = 144, - VK_FORMAT_BC7_UNORM_BLOCK = 145, - VK_FORMAT_BC7_SRGB_BLOCK = 146, - VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147, - VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148, - VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149, - VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150, - VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151, - VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152, - VK_FORMAT_EAC_R11_UNORM_BLOCK = 153, - VK_FORMAT_EAC_R11_SNORM_BLOCK = 154, - VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155, - VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156, - VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157, - VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158, - VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159, - VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160, - VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161, - VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162, - VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163, - VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164, - VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165, - VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166, - VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167, - VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168, - VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169, - VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170, - VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171, - VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172, - VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173, - VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174, - VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175, - VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176, - VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177, - VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178, - VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179, - VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180, - VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181, - VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182, - VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183, - VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184, - VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000, - VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001, - VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002, - VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003, - VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004, - VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005, - VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006, - VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007, - VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK = 1000066000, - VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK = 1000066001, - VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK = 1000066002, - VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK = 1000066003, - VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK = 1000066004, - VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK = 1000066005, - VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK = 1000066006, - VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK = 1000066007, - VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK = 1000066008, - VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK = 1000066009, - VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK = 1000066010, - VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK = 1000066011, - VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK = 1000066012, - VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK = 1000066013, - VK_FORMAT_G8B8G8R8_422_UNORM = 1000156000, - VK_FORMAT_B8G8R8G8_422_UNORM = 1000156001, - VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM = 1000156002, - VK_FORMAT_G8_B8R8_2PLANE_420_UNORM = 1000156003, - VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM = 1000156004, - VK_FORMAT_G8_B8R8_2PLANE_422_UNORM = 1000156005, - VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM = 1000156006, - VK_FORMAT_R10X6_UNORM_PACK16 = 1000156007, - VK_FORMAT_R10X6G10X6_UNORM_2PACK16 = 1000156008, - VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16 = 1000156009, - VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 = 1000156010, - VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16 = 1000156011, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16 = 1000156012, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 = 1000156013, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16 = 1000156014, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 = 1000156015, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16 = 1000156016, - VK_FORMAT_R12X4_UNORM_PACK16 = 1000156017, - VK_FORMAT_R12X4G12X4_UNORM_2PACK16 = 1000156018, - VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16 = 1000156019, - VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16 = 1000156020, - VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16 = 1000156021, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16 = 1000156022, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16 = 1000156023, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16 = 1000156024, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16 = 1000156025, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16 = 1000156026, - VK_FORMAT_G16B16G16R16_422_UNORM = 1000156027, - VK_FORMAT_B16G16R16G16_422_UNORM = 1000156028, - VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM = 1000156029, - VK_FORMAT_G16_B16R16_2PLANE_420_UNORM = 1000156030, - VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM = 1000156031, - VK_FORMAT_G16_B16R16_2PLANE_422_UNORM = 1000156032, - VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM = 1000156033, - VK_FORMAT_G8_B8R8_2PLANE_444_UNORM = 1000330000, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16 = 1000330001, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16 = 1000330002, - VK_FORMAT_G16_B16R16_2PLANE_444_UNORM = 1000330003, - VK_FORMAT_A4R4G4B4_UNORM_PACK16 = 1000340000, - VK_FORMAT_A4B4G4R4_UNORM_PACK16 = 1000340001, - VK_FORMAT_R16G16_SFIXED5_NV = 1000464000, - VK_FORMAT_A1B5G5R5_UNORM_PACK16 = 1000470000, - VK_FORMAT_A8_UNORM = 1000470001, - VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK, - VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK, - VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK, - VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK, - VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK, - VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK, - VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK, - VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK, - VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK, - VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK, - VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK, - VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK, - VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK, - VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK, - VK_FORMAT_G8B8G8R8_422_UNORM_KHR = VK_FORMAT_G8B8G8R8_422_UNORM, - VK_FORMAT_B8G8R8G8_422_UNORM_KHR = VK_FORMAT_B8G8R8G8_422_UNORM, - VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM, - VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM, - VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR = VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM, - VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM, - VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR = VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM, - VK_FORMAT_R10X6_UNORM_PACK16_KHR = VK_FORMAT_R10X6_UNORM_PACK16, - VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR = VK_FORMAT_R10X6G10X6_UNORM_2PACK16, - VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR = VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16, - VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR = VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16, - VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16, - VK_FORMAT_R12X4_UNORM_PACK16_KHR = VK_FORMAT_R12X4_UNORM_PACK16, - VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR = VK_FORMAT_R12X4G12X4_UNORM_2PACK16, - VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR = VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16, - VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR = VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16, - VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR = VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16, - VK_FORMAT_G16B16G16R16_422_UNORM_KHR = VK_FORMAT_G16B16G16R16_422_UNORM, - VK_FORMAT_B16G16R16G16_422_UNORM_KHR = VK_FORMAT_B16G16R16G16_422_UNORM, - VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR = VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, - VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR = VK_FORMAT_G16_B16R16_2PLANE_420_UNORM, - VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR = VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM, - VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR = VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, - VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR = VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM, - VK_FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT = VK_FORMAT_G8_B8R8_2PLANE_444_UNORM, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16, - VK_FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT = VK_FORMAT_G16_B16R16_2PLANE_444_UNORM, - VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT = VK_FORMAT_A4R4G4B4_UNORM_PACK16, - VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT = VK_FORMAT_A4B4G4R4_UNORM_PACK16, - VK_FORMAT_R16G16_S10_5_NV = VK_FORMAT_R16G16_SFIXED5_NV, - VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR = VK_FORMAT_A1B5G5R5_UNORM_PACK16, - VK_FORMAT_A8_UNORM_KHR = VK_FORMAT_A8_UNORM, - VK_FORMAT_MAX_ENUM = 0x7fffffff, -} VkFormat; - -typedef enum VkFormatFeatureFlagBits -{ - VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, - VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, - VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, - VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, - VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, - VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, - VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, - VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, - VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, - VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, - VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, - VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT = 0x00002000, - VK_FORMAT_FEATURE_TRANSFER_SRC_BIT = 0x00004000, - VK_FORMAT_FEATURE_TRANSFER_DST_BIT = 0x00008000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT = 0x00010000, - VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT = 0x00020000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT = 0x00040000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT = 0x00080000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT = 0x00100000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT = 0x00200000, - VK_FORMAT_FEATURE_DISJOINT_BIT = 0x00400000, - VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT = 0x00800000, - VK_FORMAT_FEATURE_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x01000000, - VK_FORMAT_FEATURE_VIDEO_DECODE_OUTPUT_BIT_KHR = 0x02000000, - VK_FORMAT_FEATURE_VIDEO_DECODE_DPB_BIT_KHR = 0x04000000, - VK_FORMAT_FEATURE_VIDEO_ENCODE_INPUT_BIT_KHR = 0x08000000, - VK_FORMAT_FEATURE_VIDEO_ENCODE_DPB_BIT_KHR = 0x10000000, - VK_FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR = 0x20000000, - VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x40000000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT, - VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, - VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_DST_BIT, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT, - VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT_KHR = VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT, - VK_FORMAT_FEATURE_DISJOINT_BIT_KHR = VK_FORMAT_FEATURE_DISJOINT_BIT, - VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR = VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, - VK_FORMAT_FEATURE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkFormatFeatureFlagBits; - -typedef VkFlags64 VkFormatFeatureFlagBits2; - -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT = 0x00000001ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR = 0x00000001ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT = 0x00000002ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT_KHR = 0x00000002ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT_KHR = 0x00000004ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR = 0x00000008ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT = 0x00000010ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT_KHR = 0x00000010ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT_KHR = 0x00000020ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT = 0x00000040ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT_KHR = 0x00000040ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT = 0x00000080ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT_KHR = 0x00000080ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT_KHR = 0x00000100ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT_KHR = 0x00000200ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_SRC_BIT = 0x00000400ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_SRC_BIT_KHR = 0x00000400ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_DST_BIT = 0x00000800ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_DST_BIT_KHR = 0x00000800ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT_KHR = 0x00001000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT = 0x00002000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT = 0x00002000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT = 0x00004000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT_KHR = 0x00004000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT = 0x00008000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT_KHR = 0x00008000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT = 0x00010000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT_KHR = 0x00010000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT = 0x00020000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT_KHR = 0x00020000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT = 0x00040000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR = 0x00040000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT = 0x00080000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR = 0x00080000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT = 0x00100000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR = 0x00100000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT = 0x00200000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR = 0x00200000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DISJOINT_BIT = 0x00400000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DISJOINT_BIT_KHR = 0x00400000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT = 0x00800000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT_KHR = 0x00800000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x01000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VIDEO_DECODE_OUTPUT_BIT_KHR = 0x02000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VIDEO_DECODE_DPB_BIT_KHR = 0x04000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VIDEO_ENCODE_INPUT_BIT_KHR = 0x08000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VIDEO_ENCODE_DPB_BIT_KHR = 0x10000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR = 0x20000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x40000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT = 0x80000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR = 0x80000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT = 0x100000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR = 0x100000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT = 0x200000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR = 0x200000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_WEIGHT_IMAGE_BIT_QCOM = 0x400000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM = 0x800000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM = 0x1000000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BOX_FILTER_SAMPLED_BIT_QCOM = 0x2000000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV = 0x4000000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_OPTICAL_FLOW_IMAGE_BIT_NV = 0x10000000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_OPTICAL_FLOW_VECTOR_BIT_NV = 0x20000000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_OPTICAL_FLOW_COST_BIT_NV = 0x40000000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT = 0x400000000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT_EXT = 0x400000000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR = 0x2000000000000ull; -static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR = 0x4000000000000ull; -typedef VkFormatFeatureFlagBits2 VkFormatFeatureFlagBits2KHR; - -typedef enum VkFragmentShadingRateCombinerOpKHR -{ - VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR = 0, - VK_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR = 1, - VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR = 2, - VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_KHR = 3, - VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR = 4, - VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KHR_MAX_ENUM = 0x7fffffff, -} VkFragmentShadingRateCombinerOpKHR; - -typedef enum VkFragmentShadingRateNV -{ - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV = 0, - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV = 1, - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV = 4, - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV = 5, - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV = 6, - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV = 9, - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV = 10, - VK_FRAGMENT_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV = 11, - VK_FRAGMENT_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV = 12, - VK_FRAGMENT_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV = 13, - VK_FRAGMENT_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV = 14, - VK_FRAGMENT_SHADING_RATE_NO_INVOCATIONS_NV = 15, - VK_FRAGMENT_SHADING_RATE_NV_MAX_ENUM = 0x7fffffff, -} VkFragmentShadingRateNV; - -typedef enum VkFragmentShadingRateTypeNV -{ - VK_FRAGMENT_SHADING_RATE_TYPE_FRAGMENT_SIZE_NV = 0, - VK_FRAGMENT_SHADING_RATE_TYPE_ENUMS_NV = 1, - VK_FRAGMENT_SHADING_RATE_TYPE_NV_MAX_ENUM = 0x7fffffff, -} VkFragmentShadingRateTypeNV; - -typedef enum VkFrameBoundaryFlagBitsEXT -{ - VK_FRAME_BOUNDARY_FRAME_END_BIT_EXT = 0x00000001, - VK_FRAME_BOUNDARY_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkFrameBoundaryFlagBitsEXT; - -typedef enum VkFramebufferCreateFlagBits -{ - VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT = 0x00000001, - VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT_KHR = VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, - VK_FRAMEBUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkFramebufferCreateFlagBits; - -typedef enum VkFrontFace -{ - VK_FRONT_FACE_COUNTER_CLOCKWISE = 0, - VK_FRONT_FACE_CLOCKWISE = 1, - VK_FRONT_FACE_MAX_ENUM = 0x7fffffff, -} VkFrontFace; - -typedef enum VkGeometryFlagBitsKHR -{ - VK_GEOMETRY_OPAQUE_BIT_KHR = 0x00000001, - VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR = 0x00000002, - VK_GEOMETRY_OPAQUE_BIT_NV = VK_GEOMETRY_OPAQUE_BIT_KHR, - VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_NV = VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR, - VK_GEOMETRY_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkGeometryFlagBitsKHR; -typedef VkGeometryFlagBitsKHR VkGeometryFlagBitsNV; - -typedef enum VkGeometryInstanceFlagBitsKHR -{ - VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR = 0x00000001, - VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR = 0x00000002, - VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR = 0x00000004, - VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR = 0x00000008, - VK_GEOMETRY_INSTANCE_FORCE_OPACITY_MICROMAP_2_STATE_EXT = 0x00000010, - VK_GEOMETRY_INSTANCE_DISABLE_OPACITY_MICROMAPS_EXT = 0x00000020, - VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR = VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR, - VK_GEOMETRY_INSTANCE_TRIANGLE_CULL_DISABLE_BIT_NV = VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR, - VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_NV = VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR, - VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_NV = VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR, - VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_NV = VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR, - VK_GEOMETRY_INSTANCE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkGeometryInstanceFlagBitsKHR; -typedef VkGeometryInstanceFlagBitsKHR VkGeometryInstanceFlagBitsNV; - -typedef enum VkGeometryTypeKHR -{ - VK_GEOMETRY_TYPE_TRIANGLES_KHR = 0, - VK_GEOMETRY_TYPE_AABBS_KHR = 1, - VK_GEOMETRY_TYPE_INSTANCES_KHR = 2, - VK_GEOMETRY_TYPE_TRIANGLES_NV = VK_GEOMETRY_TYPE_TRIANGLES_KHR, - VK_GEOMETRY_TYPE_AABBS_NV = VK_GEOMETRY_TYPE_AABBS_KHR, - VK_GEOMETRY_TYPE_KHR_MAX_ENUM = 0x7fffffff, -} VkGeometryTypeKHR; -typedef VkGeometryTypeKHR VkGeometryTypeNV; - -typedef enum VkGraphicsPipelineLibraryFlagBitsEXT -{ - VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT = 0x00000001, - VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT = 0x00000002, - VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT = 0x00000004, - VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT = 0x00000008, - VK_GRAPHICS_PIPELINE_LIBRARY_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkGraphicsPipelineLibraryFlagBitsEXT; - -typedef enum VkHostImageCopyFlagBits -{ - VK_HOST_IMAGE_COPY_MEMCPY = 0x00000001, - VK_HOST_IMAGE_COPY_MEMCPY_EXT = VK_HOST_IMAGE_COPY_MEMCPY, - VK_HOST_IMAGE_COPY_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkHostImageCopyFlagBits; -typedef VkHostImageCopyFlagBits VkHostImageCopyFlagBitsEXT; - -typedef enum VkImageAspectFlagBits -{ - VK_IMAGE_ASPECT_NONE = 0, - VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001, - VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002, - VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004, - VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008, - VK_IMAGE_ASPECT_PLANE_0_BIT = 0x00000010, - VK_IMAGE_ASPECT_PLANE_1_BIT = 0x00000020, - VK_IMAGE_ASPECT_PLANE_2_BIT = 0x00000040, - VK_IMAGE_ASPECT_PLANE_0_BIT_KHR = VK_IMAGE_ASPECT_PLANE_0_BIT, - VK_IMAGE_ASPECT_PLANE_1_BIT_KHR = VK_IMAGE_ASPECT_PLANE_1_BIT, - VK_IMAGE_ASPECT_PLANE_2_BIT_KHR = VK_IMAGE_ASPECT_PLANE_2_BIT, - VK_IMAGE_ASPECT_NONE_KHR = VK_IMAGE_ASPECT_NONE, - VK_IMAGE_ASPECT_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkImageAspectFlagBits; - -typedef enum VkImageCompressionFixedRateFlagBitsEXT -{ - VK_IMAGE_COMPRESSION_FIXED_RATE_NONE_EXT = 0, - VK_IMAGE_COMPRESSION_FIXED_RATE_1BPC_BIT_EXT = 0x00000001, - VK_IMAGE_COMPRESSION_FIXED_RATE_2BPC_BIT_EXT = 0x00000002, - VK_IMAGE_COMPRESSION_FIXED_RATE_3BPC_BIT_EXT = 0x00000004, - VK_IMAGE_COMPRESSION_FIXED_RATE_4BPC_BIT_EXT = 0x00000008, - VK_IMAGE_COMPRESSION_FIXED_RATE_5BPC_BIT_EXT = 0x00000010, - VK_IMAGE_COMPRESSION_FIXED_RATE_6BPC_BIT_EXT = 0x00000020, - VK_IMAGE_COMPRESSION_FIXED_RATE_7BPC_BIT_EXT = 0x00000040, - VK_IMAGE_COMPRESSION_FIXED_RATE_8BPC_BIT_EXT = 0x00000080, - VK_IMAGE_COMPRESSION_FIXED_RATE_9BPC_BIT_EXT = 0x00000100, - VK_IMAGE_COMPRESSION_FIXED_RATE_10BPC_BIT_EXT = 0x00000200, - VK_IMAGE_COMPRESSION_FIXED_RATE_11BPC_BIT_EXT = 0x00000400, - VK_IMAGE_COMPRESSION_FIXED_RATE_12BPC_BIT_EXT = 0x00000800, - VK_IMAGE_COMPRESSION_FIXED_RATE_13BPC_BIT_EXT = 0x00001000, - VK_IMAGE_COMPRESSION_FIXED_RATE_14BPC_BIT_EXT = 0x00002000, - VK_IMAGE_COMPRESSION_FIXED_RATE_15BPC_BIT_EXT = 0x00004000, - VK_IMAGE_COMPRESSION_FIXED_RATE_16BPC_BIT_EXT = 0x00008000, - VK_IMAGE_COMPRESSION_FIXED_RATE_17BPC_BIT_EXT = 0x00010000, - VK_IMAGE_COMPRESSION_FIXED_RATE_18BPC_BIT_EXT = 0x00020000, - VK_IMAGE_COMPRESSION_FIXED_RATE_19BPC_BIT_EXT = 0x00040000, - VK_IMAGE_COMPRESSION_FIXED_RATE_20BPC_BIT_EXT = 0x00080000, - VK_IMAGE_COMPRESSION_FIXED_RATE_21BPC_BIT_EXT = 0x00100000, - VK_IMAGE_COMPRESSION_FIXED_RATE_22BPC_BIT_EXT = 0x00200000, - VK_IMAGE_COMPRESSION_FIXED_RATE_23BPC_BIT_EXT = 0x00400000, - VK_IMAGE_COMPRESSION_FIXED_RATE_24BPC_BIT_EXT = 0x00800000, - VK_IMAGE_COMPRESSION_FIXED_RATE_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkImageCompressionFixedRateFlagBitsEXT; - -typedef enum VkImageCompressionFlagBitsEXT -{ - VK_IMAGE_COMPRESSION_DEFAULT_EXT = 0, - VK_IMAGE_COMPRESSION_FIXED_RATE_DEFAULT_EXT = 0x00000001, - VK_IMAGE_COMPRESSION_FIXED_RATE_EXPLICIT_EXT = 0x00000002, - VK_IMAGE_COMPRESSION_DISABLED_EXT = 0x00000004, - VK_IMAGE_COMPRESSION_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkImageCompressionFlagBitsEXT; - -typedef enum VkImageCreateFlagBits -{ - VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, - VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, - VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004, - VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, - VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, - VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT = 0x00000020, - VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT = 0x00000040, - VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT = 0x00000080, - VK_IMAGE_CREATE_EXTENDED_USAGE_BIT = 0x00000100, - VK_IMAGE_CREATE_DISJOINT_BIT = 0x00000200, - VK_IMAGE_CREATE_ALIAS_BIT = 0x00000400, - VK_IMAGE_CREATE_PROTECTED_BIT = 0x00000800, - VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT = 0x00001000, - VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV = 0x00002000, - VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT = 0x00004000, - VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM = 0x00008000, - VK_IMAGE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00010000, - VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT = 0x00020000, - VK_IMAGE_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT = 0x00040000, - VK_IMAGE_CREATE_VIDEO_PROFILE_INDEPENDENT_BIT_KHR = 0x00100000, - VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT, - VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, - VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR = VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, - VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR = VK_IMAGE_CREATE_EXTENDED_USAGE_BIT, - VK_IMAGE_CREATE_DISJOINT_BIT_KHR = VK_IMAGE_CREATE_DISJOINT_BIT, - VK_IMAGE_CREATE_ALIAS_BIT_KHR = VK_IMAGE_CREATE_ALIAS_BIT, - VK_IMAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkImageCreateFlagBits; - -typedef enum VkImageLayout -{ - VK_IMAGE_LAYOUT_UNDEFINED = 0, - VK_IMAGE_LAYOUT_GENERAL = 1, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 2, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 3, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 4, - VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 5, - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 6, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 7, - VK_IMAGE_LAYOUT_PREINITIALIZED = 8, - VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002, - VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR = 1000024000, - VK_IMAGE_LAYOUT_VIDEO_DECODE_SRC_KHR = 1000024001, - VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR = 1000024002, - VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL = 1000117000, - VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL = 1000117001, - VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR = 1000164003, - VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT = 1000218000, - VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ = 1000232000, - VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL = 1000241000, - VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL = 1000241001, - VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL = 1000241002, - VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL = 1000241003, - VK_IMAGE_LAYOUT_VIDEO_ENCODE_DST_KHR = 1000299000, - VK_IMAGE_LAYOUT_VIDEO_ENCODE_SRC_KHR = 1000299001, - VK_IMAGE_LAYOUT_VIDEO_ENCODE_DPB_KHR = 1000299002, - VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL = 1000314000, - VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL = 1000314001, - VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT = 1000339000, - VK_IMAGE_LAYOUT_VIDEO_ENCODE_QUANTIZATION_MAP_KHR = 1000553000, - VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, - VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV = VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR, - VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ_KHR = VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ, - VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, - VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL_KHR = VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL_KHR = VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL, - VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR = VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL, - VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR = VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_MAX_ENUM = 0x7fffffff, -} VkImageLayout; - -typedef enum VkImageTiling -{ - VK_IMAGE_TILING_OPTIMAL = 0, - VK_IMAGE_TILING_LINEAR = 1, - VK_IMAGE_TILING_MAX_ENUM = 0x7fffffff, -} VkImageTiling; - -typedef enum VkImageType -{ - VK_IMAGE_TYPE_1D = 0, - VK_IMAGE_TYPE_2D = 1, - VK_IMAGE_TYPE_3D = 2, - VK_IMAGE_TYPE_MAX_ENUM = 0x7fffffff, -} VkImageType; - -typedef enum VkImageUsageFlagBits -{ - VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, - VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, - VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, - VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, - VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, - VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, - VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00000100, - VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x00000200, - VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR = 0x00000400, - VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR = 0x00000800, - VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR = 0x00001000, - VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR = 0x00002000, - VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR = 0x00004000, - VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR = 0x00008000, - VK_IMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEI = 0x00040000, - VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x00080000, - VK_IMAGE_USAGE_SAMPLE_WEIGHT_BIT_QCOM = 0x00100000, - VK_IMAGE_USAGE_SAMPLE_BLOCK_MATCH_BIT_QCOM = 0x00200000, - VK_IMAGE_USAGE_HOST_TRANSFER_BIT = 0x00400000, - VK_IMAGE_USAGE_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR = 0x02000000, - VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR = 0x04000000, - VK_IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV = VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR, - VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT = VK_IMAGE_USAGE_HOST_TRANSFER_BIT, - VK_IMAGE_USAGE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkImageUsageFlagBits; - -typedef enum VkImageViewCreateFlagBits -{ - VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT = 0x00000001, - VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT = 0x00000002, - VK_IMAGE_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00000004, - VK_IMAGE_VIEW_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkImageViewCreateFlagBits; - -typedef enum VkImageViewType -{ - VK_IMAGE_VIEW_TYPE_1D = 0, - VK_IMAGE_VIEW_TYPE_2D = 1, - VK_IMAGE_VIEW_TYPE_3D = 2, - VK_IMAGE_VIEW_TYPE_CUBE = 3, - VK_IMAGE_VIEW_TYPE_1D_ARRAY = 4, - VK_IMAGE_VIEW_TYPE_2D_ARRAY = 5, - VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 6, - VK_IMAGE_VIEW_TYPE_MAX_ENUM = 0x7fffffff, -} VkImageViewType; - -typedef enum VkIndexType -{ - VK_INDEX_TYPE_UINT16 = 0, - VK_INDEX_TYPE_UINT32 = 1, - VK_INDEX_TYPE_NONE_KHR = 1000165000, - VK_INDEX_TYPE_UINT8 = 1000265000, - VK_INDEX_TYPE_NONE_NV = VK_INDEX_TYPE_NONE_KHR, - VK_INDEX_TYPE_UINT8_EXT = VK_INDEX_TYPE_UINT8, - VK_INDEX_TYPE_UINT8_KHR = VK_INDEX_TYPE_UINT8, - VK_INDEX_TYPE_MAX_ENUM = 0x7fffffff, -} VkIndexType; - -typedef enum VkIndirectCommandsInputModeFlagBitsEXT -{ - VK_INDIRECT_COMMANDS_INPUT_MODE_VULKAN_INDEX_BUFFER_EXT = 0x00000001, - VK_INDIRECT_COMMANDS_INPUT_MODE_DXGI_INDEX_BUFFER_EXT = 0x00000002, - VK_INDIRECT_COMMANDS_INPUT_MODE_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkIndirectCommandsInputModeFlagBitsEXT; - -typedef enum VkIndirectCommandsLayoutUsageFlagBitsEXT -{ - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EXPLICIT_PREPROCESS_BIT_EXT = 0x00000001, - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_EXT = 0x00000002, - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkIndirectCommandsLayoutUsageFlagBitsEXT; - -typedef enum VkIndirectCommandsLayoutUsageFlagBitsNV -{ - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EXPLICIT_PREPROCESS_BIT_NV = 0x00000001, - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NV = 0x00000002, - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NV = 0x00000004, - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_FLAG_BITS_NV_MAX_ENUM = 0x7fffffff, -} VkIndirectCommandsLayoutUsageFlagBitsNV; - -typedef enum VkIndirectCommandsTokenTypeEXT -{ - VK_INDIRECT_COMMANDS_TOKEN_TYPE_EXECUTION_SET_EXT = 0, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_EXT = 1, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_SEQUENCE_INDEX_EXT = 2, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_EXT = 3, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_EXT = 4, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_EXT = 5, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_EXT = 6, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_COUNT_EXT = 7, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_COUNT_EXT = 8, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_EXT = 9, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_NV_EXT = 1000202002, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_COUNT_NV_EXT = 1000202003, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_EXT = 1000328000, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_COUNT_EXT = 1000328001, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_TRACE_RAYS2_EXT = 1000386004, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_EXT_MAX_ENUM = 0x7fffffff, -} VkIndirectCommandsTokenTypeEXT; - -typedef enum VkIndirectCommandsTokenTypeNV -{ - VK_INDIRECT_COMMANDS_TOKEN_TYPE_SHADER_GROUP_NV = 0, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_STATE_FLAGS_NV = 1, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_NV = 2, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_NV = 3, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NV = 4, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_NV = 5, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_NV = 6, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_TASKS_NV = 7, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_NV = 1000328000, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NV = 1000428003, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NV = 1000428004, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_NV_MAX_ENUM = 0x7fffffff, -} VkIndirectCommandsTokenTypeNV; - -typedef enum VkIndirectExecutionSetInfoTypeEXT -{ - VK_INDIRECT_EXECUTION_SET_INFO_TYPE_PIPELINES_EXT = 0, - VK_INDIRECT_EXECUTION_SET_INFO_TYPE_SHADER_OBJECTS_EXT = 1, - VK_INDIRECT_EXECUTION_SET_INFO_TYPE_EXT_MAX_ENUM = 0x7fffffff, -} VkIndirectExecutionSetInfoTypeEXT; - -typedef enum VkIndirectStateFlagBitsNV -{ - VK_INDIRECT_STATE_FLAG_FRONTFACE_BIT_NV = 0x00000001, - VK_INDIRECT_STATE_FLAG_BITS_NV_MAX_ENUM = 0x7fffffff, -} VkIndirectStateFlagBitsNV; - -typedef enum VkInstanceCreateFlagBits -{ - VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR = 0x00000001, - VK_INSTANCE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkInstanceCreateFlagBits; - -typedef enum VkInternalAllocationType -{ - VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0, - VK_INTERNAL_ALLOCATION_TYPE_MAX_ENUM = 0x7fffffff, -} VkInternalAllocationType; - -typedef enum VkLatencyMarkerNV -{ - VK_LATENCY_MARKER_SIMULATION_START_NV = 0, - VK_LATENCY_MARKER_SIMULATION_END_NV = 1, - VK_LATENCY_MARKER_RENDERSUBMIT_START_NV = 2, - VK_LATENCY_MARKER_RENDERSUBMIT_END_NV = 3, - VK_LATENCY_MARKER_PRESENT_START_NV = 4, - VK_LATENCY_MARKER_PRESENT_END_NV = 5, - VK_LATENCY_MARKER_INPUT_SAMPLE_NV = 6, - VK_LATENCY_MARKER_TRIGGER_FLASH_NV = 7, - VK_LATENCY_MARKER_OUT_OF_BAND_RENDERSUBMIT_START_NV = 8, - VK_LATENCY_MARKER_OUT_OF_BAND_RENDERSUBMIT_END_NV = 9, - VK_LATENCY_MARKER_OUT_OF_BAND_PRESENT_START_NV = 10, - VK_LATENCY_MARKER_OUT_OF_BAND_PRESENT_END_NV = 11, - VK_LATENCY_MARKER_NV_MAX_ENUM = 0x7fffffff, -} VkLatencyMarkerNV; - -typedef enum VkLayerSettingTypeEXT -{ - VK_LAYER_SETTING_TYPE_BOOL32_EXT = 0, - VK_LAYER_SETTING_TYPE_INT32_EXT = 1, - VK_LAYER_SETTING_TYPE_INT64_EXT = 2, - VK_LAYER_SETTING_TYPE_UINT32_EXT = 3, - VK_LAYER_SETTING_TYPE_UINT64_EXT = 4, - VK_LAYER_SETTING_TYPE_FLOAT32_EXT = 5, - VK_LAYER_SETTING_TYPE_FLOAT64_EXT = 6, - VK_LAYER_SETTING_TYPE_STRING_EXT = 7, - VK_LAYER_SETTING_TYPE_EXT_MAX_ENUM = 0x7fffffff, -} VkLayerSettingTypeEXT; - -typedef enum VkLayeredDriverUnderlyingApiMSFT -{ - VK_LAYERED_DRIVER_UNDERLYING_API_NONE_MSFT = 0, - VK_LAYERED_DRIVER_UNDERLYING_API_D3D12_MSFT = 1, - VK_LAYERED_DRIVER_UNDERLYING_API_MSFT_MAX_ENUM = 0x7fffffff, -} VkLayeredDriverUnderlyingApiMSFT; - -typedef enum VkLineRasterizationMode -{ - VK_LINE_RASTERIZATION_MODE_DEFAULT = 0, - VK_LINE_RASTERIZATION_MODE_RECTANGULAR = 1, - VK_LINE_RASTERIZATION_MODE_BRESENHAM = 2, - VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH = 3, - VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT = VK_LINE_RASTERIZATION_MODE_DEFAULT, - VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT = VK_LINE_RASTERIZATION_MODE_RECTANGULAR, - VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT = VK_LINE_RASTERIZATION_MODE_BRESENHAM, - VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT = VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH, - VK_LINE_RASTERIZATION_MODE_DEFAULT_KHR = VK_LINE_RASTERIZATION_MODE_DEFAULT, - VK_LINE_RASTERIZATION_MODE_RECTANGULAR_KHR = VK_LINE_RASTERIZATION_MODE_RECTANGULAR, - VK_LINE_RASTERIZATION_MODE_BRESENHAM_KHR = VK_LINE_RASTERIZATION_MODE_BRESENHAM, - VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_KHR = VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH, - VK_LINE_RASTERIZATION_MODE_MAX_ENUM = 0x7fffffff, -} VkLineRasterizationMode; -typedef VkLineRasterizationMode VkLineRasterizationModeKHR; -typedef VkLineRasterizationMode VkLineRasterizationModeEXT; - -typedef enum VkLogicOp -{ - VK_LOGIC_OP_CLEAR = 0, - VK_LOGIC_OP_AND = 1, - VK_LOGIC_OP_AND_REVERSE = 2, - VK_LOGIC_OP_COPY = 3, - VK_LOGIC_OP_AND_INVERTED = 4, - VK_LOGIC_OP_NO_OP = 5, - VK_LOGIC_OP_XOR = 6, - VK_LOGIC_OP_OR = 7, - VK_LOGIC_OP_NOR = 8, - VK_LOGIC_OP_EQUIVALENT = 9, - VK_LOGIC_OP_INVERT = 10, - VK_LOGIC_OP_OR_REVERSE = 11, - VK_LOGIC_OP_COPY_INVERTED = 12, - VK_LOGIC_OP_OR_INVERTED = 13, - VK_LOGIC_OP_NAND = 14, - VK_LOGIC_OP_SET = 15, - VK_LOGIC_OP_MAX_ENUM = 0x7fffffff, -} VkLogicOp; - -typedef enum VkMemoryAllocateFlagBits -{ - VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT = 0x00000001, - VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT = 0x00000002, - VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT = 0x00000004, - VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT_KHR = VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT, - VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR = VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT, - VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR = VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT, - VK_MEMORY_ALLOCATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkMemoryAllocateFlagBits; -typedef VkMemoryAllocateFlagBits VkMemoryAllocateFlagBitsKHR; - -typedef VkFlags64 VkMemoryDecompressionMethodFlagBitsNV; - -static const VkMemoryDecompressionMethodFlagBitsNV VK_MEMORY_DECOMPRESSION_METHOD_GDEFLATE_1_0_BIT_NV = 0x00000001ull; - -typedef enum VkMemoryHeapFlagBits -{ - VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001, - VK_MEMORY_HEAP_MULTI_INSTANCE_BIT = 0x00000002, - VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR = VK_MEMORY_HEAP_MULTI_INSTANCE_BIT, - VK_MEMORY_HEAP_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkMemoryHeapFlagBits; - -typedef enum VkMemoryMapFlagBits -{ - VK_MEMORY_MAP_PLACED_BIT_EXT = 0x00000001, - VK_MEMORY_MAP_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkMemoryMapFlagBits; - -typedef enum VkMemoryOverallocationBehaviorAMD -{ - VK_MEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD = 0, - VK_MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD = 1, - VK_MEMORY_OVERALLOCATION_BEHAVIOR_DISALLOWED_AMD = 2, - VK_MEMORY_OVERALLOCATION_BEHAVIOR_AMD_MAX_ENUM = 0x7fffffff, -} VkMemoryOverallocationBehaviorAMD; - -typedef enum VkMemoryPropertyFlagBits -{ - VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001, - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002, - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004, - VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008, - VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010, - VK_MEMORY_PROPERTY_PROTECTED_BIT = 0x00000020, - VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD = 0x00000040, - VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD = 0x00000080, - VK_MEMORY_PROPERTY_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkMemoryPropertyFlagBits; - -typedef enum VkMemoryUnmapFlagBits -{ - VK_MEMORY_UNMAP_RESERVE_BIT_EXT = 0x00000001, - VK_MEMORY_UNMAP_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkMemoryUnmapFlagBits; -typedef VkMemoryUnmapFlagBits VkMemoryUnmapFlagBitsKHR; - -typedef enum VkMicromapCreateFlagBitsEXT -{ - VK_MICROMAP_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT = 0x00000001, - VK_MICROMAP_CREATE_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkMicromapCreateFlagBitsEXT; - -typedef enum VkMicromapTypeEXT -{ - VK_MICROMAP_TYPE_OPACITY_MICROMAP_EXT = 0, - VK_MICROMAP_TYPE_EXT_MAX_ENUM = 0x7fffffff, -} VkMicromapTypeEXT; - -typedef enum VkObjectType -{ - VK_OBJECT_TYPE_UNKNOWN = 0, - VK_OBJECT_TYPE_INSTANCE = 1, - VK_OBJECT_TYPE_PHYSICAL_DEVICE = 2, - VK_OBJECT_TYPE_DEVICE = 3, - VK_OBJECT_TYPE_QUEUE = 4, - VK_OBJECT_TYPE_SEMAPHORE = 5, - VK_OBJECT_TYPE_COMMAND_BUFFER = 6, - VK_OBJECT_TYPE_FENCE = 7, - VK_OBJECT_TYPE_DEVICE_MEMORY = 8, - VK_OBJECT_TYPE_BUFFER = 9, - VK_OBJECT_TYPE_IMAGE = 10, - VK_OBJECT_TYPE_EVENT = 11, - VK_OBJECT_TYPE_QUERY_POOL = 12, - VK_OBJECT_TYPE_BUFFER_VIEW = 13, - VK_OBJECT_TYPE_IMAGE_VIEW = 14, - VK_OBJECT_TYPE_SHADER_MODULE = 15, - VK_OBJECT_TYPE_PIPELINE_CACHE = 16, - VK_OBJECT_TYPE_PIPELINE_LAYOUT = 17, - VK_OBJECT_TYPE_RENDER_PASS = 18, - VK_OBJECT_TYPE_PIPELINE = 19, - VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT = 20, - VK_OBJECT_TYPE_SAMPLER = 21, - VK_OBJECT_TYPE_DESCRIPTOR_POOL = 22, - VK_OBJECT_TYPE_DESCRIPTOR_SET = 23, - VK_OBJECT_TYPE_FRAMEBUFFER = 24, - VK_OBJECT_TYPE_COMMAND_POOL = 25, - VK_OBJECT_TYPE_SURFACE_KHR = 1000000000, - VK_OBJECT_TYPE_SWAPCHAIN_KHR = 1000001000, - VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT = 1000011000, - VK_OBJECT_TYPE_VIDEO_SESSION_KHR = 1000023000, - VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR = 1000023001, - VK_OBJECT_TYPE_CU_MODULE_NVX = 1000029000, - VK_OBJECT_TYPE_CU_FUNCTION_NVX = 1000029001, - VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE = 1000085000, - VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT = 1000128000, - VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR = 1000150000, - VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION = 1000156000, - VK_OBJECT_TYPE_VALIDATION_CACHE_EXT = 1000160000, - VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV = 1000165000, - VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL = 1000210000, - VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR = 1000268000, - VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV = 1000277000, - VK_OBJECT_TYPE_PRIVATE_DATA_SLOT = 1000295000, - VK_OBJECT_TYPE_CUDA_MODULE_NV = 1000307000, - VK_OBJECT_TYPE_CUDA_FUNCTION_NV = 1000307001, - VK_OBJECT_TYPE_MICROMAP_EXT = 1000396000, - VK_OBJECT_TYPE_OPTICAL_FLOW_SESSION_NV = 1000464000, - VK_OBJECT_TYPE_SHADER_EXT = 1000482000, - VK_OBJECT_TYPE_PIPELINE_BINARY_KHR = 1000483000, - VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_EXT = 1000572000, - VK_OBJECT_TYPE_INDIRECT_EXECUTION_SET_EXT = 1000572001, - VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR = VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, - VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR = VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION, - VK_OBJECT_TYPE_PRIVATE_DATA_SLOT_EXT = VK_OBJECT_TYPE_PRIVATE_DATA_SLOT, - VK_OBJECT_TYPE_MAX_ENUM = 0x7fffffff, -} VkObjectType; - -typedef enum VkOpacityMicromapFormatEXT -{ - VK_OPACITY_MICROMAP_FORMAT_2_STATE_EXT = 1, - VK_OPACITY_MICROMAP_FORMAT_4_STATE_EXT = 2, - VK_OPACITY_MICROMAP_FORMAT_EXT_MAX_ENUM = 0x7fffffff, -} VkOpacityMicromapFormatEXT; - -typedef enum VkOpacityMicromapSpecialIndexEXT -{ - VK_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_UNKNOWN_OPAQUE_EXT = -4, - VK_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_UNKNOWN_TRANSPARENT_EXT = -3, - VK_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_OPAQUE_EXT = -2, - VK_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_TRANSPARENT_EXT = -1, - VK_OPACITY_MICROMAP_SPECIAL_INDEX_EXT_MAX_ENUM = 0x7fffffff, -} VkOpacityMicromapSpecialIndexEXT; - -typedef enum VkOpticalFlowExecuteFlagBitsNV -{ - VK_OPTICAL_FLOW_EXECUTE_DISABLE_TEMPORAL_HINTS_BIT_NV = 0x00000001, - VK_OPTICAL_FLOW_EXECUTE_FLAG_BITS_NV_MAX_ENUM = 0x7fffffff, -} VkOpticalFlowExecuteFlagBitsNV; - -typedef enum VkOpticalFlowGridSizeFlagBitsNV -{ - VK_OPTICAL_FLOW_GRID_SIZE_UNKNOWN_NV = 0, - VK_OPTICAL_FLOW_GRID_SIZE_1X1_BIT_NV = 0x00000001, - VK_OPTICAL_FLOW_GRID_SIZE_2X2_BIT_NV = 0x00000002, - VK_OPTICAL_FLOW_GRID_SIZE_4X4_BIT_NV = 0x00000004, - VK_OPTICAL_FLOW_GRID_SIZE_8X8_BIT_NV = 0x00000008, - VK_OPTICAL_FLOW_GRID_SIZE_FLAG_BITS_NV_MAX_ENUM = 0x7fffffff, -} VkOpticalFlowGridSizeFlagBitsNV; - -typedef enum VkOpticalFlowPerformanceLevelNV -{ - VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_UNKNOWN_NV = 0, - VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_SLOW_NV = 1, - VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_MEDIUM_NV = 2, - VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_FAST_NV = 3, - VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_NV_MAX_ENUM = 0x7fffffff, -} VkOpticalFlowPerformanceLevelNV; - -typedef enum VkOpticalFlowSessionBindingPointNV -{ - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_UNKNOWN_NV = 0, - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_INPUT_NV = 1, - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_REFERENCE_NV = 2, - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_HINT_NV = 3, - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_FLOW_VECTOR_NV = 4, - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_BACKWARD_FLOW_VECTOR_NV = 5, - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_COST_NV = 6, - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_BACKWARD_COST_NV = 7, - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_GLOBAL_FLOW_NV = 8, - VK_OPTICAL_FLOW_SESSION_BINDING_POINT_NV_MAX_ENUM = 0x7fffffff, -} VkOpticalFlowSessionBindingPointNV; - -typedef enum VkOpticalFlowSessionCreateFlagBitsNV -{ - VK_OPTICAL_FLOW_SESSION_CREATE_ENABLE_HINT_BIT_NV = 0x00000001, - VK_OPTICAL_FLOW_SESSION_CREATE_ENABLE_COST_BIT_NV = 0x00000002, - VK_OPTICAL_FLOW_SESSION_CREATE_ENABLE_GLOBAL_FLOW_BIT_NV = 0x00000004, - VK_OPTICAL_FLOW_SESSION_CREATE_ALLOW_REGIONS_BIT_NV = 0x00000008, - VK_OPTICAL_FLOW_SESSION_CREATE_BOTH_DIRECTIONS_BIT_NV = 0x00000010, - VK_OPTICAL_FLOW_SESSION_CREATE_FLAG_BITS_NV_MAX_ENUM = 0x7fffffff, -} VkOpticalFlowSessionCreateFlagBitsNV; - -typedef enum VkOpticalFlowUsageFlagBitsNV -{ - VK_OPTICAL_FLOW_USAGE_UNKNOWN_NV = 0, - VK_OPTICAL_FLOW_USAGE_INPUT_BIT_NV = 0x00000001, - VK_OPTICAL_FLOW_USAGE_OUTPUT_BIT_NV = 0x00000002, - VK_OPTICAL_FLOW_USAGE_HINT_BIT_NV = 0x00000004, - VK_OPTICAL_FLOW_USAGE_COST_BIT_NV = 0x00000008, - VK_OPTICAL_FLOW_USAGE_GLOBAL_FLOW_BIT_NV = 0x00000010, - VK_OPTICAL_FLOW_USAGE_FLAG_BITS_NV_MAX_ENUM = 0x7fffffff, -} VkOpticalFlowUsageFlagBitsNV; - -typedef enum VkOutOfBandQueueTypeNV -{ - VK_OUT_OF_BAND_QUEUE_TYPE_RENDER_NV = 0, - VK_OUT_OF_BAND_QUEUE_TYPE_PRESENT_NV = 1, - VK_OUT_OF_BAND_QUEUE_TYPE_NV_MAX_ENUM = 0x7fffffff, -} VkOutOfBandQueueTypeNV; - -typedef enum VkPeerMemoryFeatureFlagBits -{ - VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT = 0x00000001, - VK_PEER_MEMORY_FEATURE_COPY_DST_BIT = 0x00000002, - VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT = 0x00000004, - VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT = 0x00000008, - VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT_KHR = VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT, - VK_PEER_MEMORY_FEATURE_COPY_DST_BIT_KHR = VK_PEER_MEMORY_FEATURE_COPY_DST_BIT, - VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT_KHR = VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT, - VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT_KHR = VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT, - VK_PEER_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkPeerMemoryFeatureFlagBits; -typedef VkPeerMemoryFeatureFlagBits VkPeerMemoryFeatureFlagBitsKHR; - -typedef enum VkPerformanceConfigurationTypeINTEL -{ - VK_PERFORMANCE_CONFIGURATION_TYPE_COMMAND_QUEUE_METRICS_DISCOVERY_ACTIVATED_INTEL = 0, - VK_PERFORMANCE_CONFIGURATION_TYPE_INTEL_MAX_ENUM = 0x7fffffff, -} VkPerformanceConfigurationTypeINTEL; - -typedef enum VkPerformanceCounterDescriptionFlagBitsKHR -{ - VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_BIT_KHR = 0x00000001, - VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_BIT_KHR = 0x00000002, - VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_KHR = VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_BIT_KHR, - VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_KHR = VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_BIT_KHR, - VK_PERFORMANCE_COUNTER_DESCRIPTION_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkPerformanceCounterDescriptionFlagBitsKHR; - -typedef enum VkPerformanceCounterScopeKHR -{ - VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_BUFFER_KHR = 0, - VK_PERFORMANCE_COUNTER_SCOPE_RENDER_PASS_KHR = 1, - VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_KHR = 2, - VK_QUERY_SCOPE_COMMAND_BUFFER_KHR = VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_BUFFER_KHR, - VK_QUERY_SCOPE_RENDER_PASS_KHR = VK_PERFORMANCE_COUNTER_SCOPE_RENDER_PASS_KHR, - VK_QUERY_SCOPE_COMMAND_KHR = VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_KHR, - VK_PERFORMANCE_COUNTER_SCOPE_KHR_MAX_ENUM = 0x7fffffff, -} VkPerformanceCounterScopeKHR; - -typedef enum VkPerformanceCounterStorageKHR -{ - VK_PERFORMANCE_COUNTER_STORAGE_INT32_KHR = 0, - VK_PERFORMANCE_COUNTER_STORAGE_INT64_KHR = 1, - VK_PERFORMANCE_COUNTER_STORAGE_UINT32_KHR = 2, - VK_PERFORMANCE_COUNTER_STORAGE_UINT64_KHR = 3, - VK_PERFORMANCE_COUNTER_STORAGE_FLOAT32_KHR = 4, - VK_PERFORMANCE_COUNTER_STORAGE_FLOAT64_KHR = 5, - VK_PERFORMANCE_COUNTER_STORAGE_KHR_MAX_ENUM = 0x7fffffff, -} VkPerformanceCounterStorageKHR; - -typedef enum VkPerformanceCounterUnitKHR -{ - VK_PERFORMANCE_COUNTER_UNIT_GENERIC_KHR = 0, - VK_PERFORMANCE_COUNTER_UNIT_PERCENTAGE_KHR = 1, - VK_PERFORMANCE_COUNTER_UNIT_NANOSECONDS_KHR = 2, - VK_PERFORMANCE_COUNTER_UNIT_BYTES_KHR = 3, - VK_PERFORMANCE_COUNTER_UNIT_BYTES_PER_SECOND_KHR = 4, - VK_PERFORMANCE_COUNTER_UNIT_KELVIN_KHR = 5, - VK_PERFORMANCE_COUNTER_UNIT_WATTS_KHR = 6, - VK_PERFORMANCE_COUNTER_UNIT_VOLTS_KHR = 7, - VK_PERFORMANCE_COUNTER_UNIT_AMPS_KHR = 8, - VK_PERFORMANCE_COUNTER_UNIT_HERTZ_KHR = 9, - VK_PERFORMANCE_COUNTER_UNIT_CYCLES_KHR = 10, - VK_PERFORMANCE_COUNTER_UNIT_KHR_MAX_ENUM = 0x7fffffff, -} VkPerformanceCounterUnitKHR; - -typedef enum VkPerformanceOverrideTypeINTEL -{ - VK_PERFORMANCE_OVERRIDE_TYPE_NULL_HARDWARE_INTEL = 0, - VK_PERFORMANCE_OVERRIDE_TYPE_FLUSH_GPU_CACHES_INTEL = 1, - VK_PERFORMANCE_OVERRIDE_TYPE_INTEL_MAX_ENUM = 0x7fffffff, -} VkPerformanceOverrideTypeINTEL; - -typedef enum VkPerformanceParameterTypeINTEL -{ - VK_PERFORMANCE_PARAMETER_TYPE_HW_COUNTERS_SUPPORTED_INTEL = 0, - VK_PERFORMANCE_PARAMETER_TYPE_STREAM_MARKER_VALID_BITS_INTEL = 1, - VK_PERFORMANCE_PARAMETER_TYPE_INTEL_MAX_ENUM = 0x7fffffff, -} VkPerformanceParameterTypeINTEL; - -typedef enum VkPerformanceValueTypeINTEL -{ - VK_PERFORMANCE_VALUE_TYPE_UINT32_INTEL = 0, - VK_PERFORMANCE_VALUE_TYPE_UINT64_INTEL = 1, - VK_PERFORMANCE_VALUE_TYPE_FLOAT_INTEL = 2, - VK_PERFORMANCE_VALUE_TYPE_BOOL_INTEL = 3, - VK_PERFORMANCE_VALUE_TYPE_STRING_INTEL = 4, - VK_PERFORMANCE_VALUE_TYPE_INTEL_MAX_ENUM = 0x7fffffff, -} VkPerformanceValueTypeINTEL; - -typedef VkFlags64 VkPhysicalDeviceSchedulingControlsFlagBitsARM; - -static const VkPhysicalDeviceSchedulingControlsFlagBitsARM VK_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_SHADER_CORE_COUNT_ARM = 0x00000001ull; - -typedef enum VkPhysicalDeviceType -{ - VK_PHYSICAL_DEVICE_TYPE_OTHER = 0, - VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 1, - VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 2, - VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 3, - VK_PHYSICAL_DEVICE_TYPE_CPU = 4, - VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM = 0x7fffffff, -} VkPhysicalDeviceType; - -typedef enum VkPipelineBindPoint -{ - VK_PIPELINE_BIND_POINT_GRAPHICS = 0, - VK_PIPELINE_BIND_POINT_COMPUTE = 1, - VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR = 1000165000, - VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI = 1000369003, - VK_PIPELINE_BIND_POINT_RAY_TRACING_NV = VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR, - VK_PIPELINE_BIND_POINT_MAX_ENUM = 0x7fffffff, -} VkPipelineBindPoint; - -typedef enum VkPipelineCacheCreateFlagBits -{ - VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT = 0x00000001, - VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT = VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT, - VK_PIPELINE_CACHE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkPipelineCacheCreateFlagBits; - -typedef enum VkPipelineCacheHeaderVersion -{ - VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1, - VK_PIPELINE_CACHE_HEADER_VERSION_MAX_ENUM = 0x7fffffff, -} VkPipelineCacheHeaderVersion; - -typedef enum VkPipelineColorBlendStateCreateFlagBits -{ - VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT = 0x00000001, - VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_ARM = VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT, - VK_PIPELINE_COLOR_BLEND_STATE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkPipelineColorBlendStateCreateFlagBits; - -typedef enum VkPipelineCompilerControlFlagBitsAMD -{ - VK_PIPELINE_COMPILER_CONTROL_FLAG_BITS_AMD_MAX_ENUM = 0x7fffffff, -} VkPipelineCompilerControlFlagBitsAMD; - -typedef enum VkPipelineCreateFlagBits -{ - VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001, - VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002, - VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004, - VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT = 0x00000008, - VK_PIPELINE_CREATE_DISPATCH_BASE_BIT = 0x00000010, - VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NV = 0x00000020, - VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR = 0x00000040, - VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR = 0x00000080, - VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT = 0x00000100, - VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT = 0x00000200, - VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT = 0x00000400, - VK_PIPELINE_CREATE_LIBRARY_BIT_KHR = 0x00000800, - VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR = 0x00001000, - VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR = 0x00002000, - VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR = 0x00004000, - VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR = 0x00008000, - VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR = 0x00010000, - VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR = 0x00020000, - VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV = 0x00040000, - VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR = 0x00080000, - VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV = 0x00100000, - VK_PIPELINE_CREATE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00200000, - VK_PIPELINE_CREATE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = 0x00400000, - VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT = 0x00800000, - VK_PIPELINE_CREATE_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT = 0x01000000, - VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x02000000, - VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x04000000, - VK_PIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT = 0x08000000, - VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT = 0x20000000, - VK_PIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT = 0x40000000, - VK_PIPELINE_CREATE_DISPATCH_BASE = VK_PIPELINE_CREATE_DISPATCH_BASE_BIT, - VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR = VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT, - VK_PIPELINE_CREATE_DISPATCH_BASE_KHR = VK_PIPELINE_CREATE_DISPATCH_BASE, - VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = VK_PIPELINE_CREATE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT, - VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = VK_PIPELINE_CREATE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR, - VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT = VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT, - VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT = VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT, - VK_PIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT_EXT = VK_PIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT, - VK_PIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT = VK_PIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT, - VK_PIPELINE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkPipelineCreateFlagBits; - -typedef VkFlags64 VkPipelineCreateFlagBits2; - -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_DISABLE_OPTIMIZATION_BIT = 0x00000001ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_DISABLE_OPTIMIZATION_BIT_KHR = 0x00000001ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_ALLOW_DERIVATIVES_BIT = 0x00000002ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_ALLOW_DERIVATIVES_BIT_KHR = 0x00000002ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_DERIVATIVE_BIT = 0x00000004ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_DERIVATIVE_BIT_KHR = 0x00000004ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_VIEW_INDEX_FROM_DEVICE_INDEX_BIT = 0x00000008ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR = 0x00000008ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_DISPATCH_BASE_BIT = 0x00000010ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_DISPATCH_BASE_BIT_KHR = 0x00000010ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_DEFER_COMPILE_BIT_NV = 0x00000020ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_CAPTURE_STATISTICS_BIT_KHR = 0x00000040ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR = 0x00000080ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT = 0x00000100ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_KHR = 0x00000100ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_EARLY_RETURN_ON_FAILURE_BIT = 0x00000200ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_EARLY_RETURN_ON_FAILURE_BIT_KHR = 0x00000200ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_LINK_TIME_OPTIMIZATION_BIT_EXT = 0x00000400ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_LIBRARY_BIT_KHR = 0x00000800ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR = 0x00001000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_RAY_TRACING_SKIP_AABBS_BIT_KHR = 0x00002000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR = 0x00004000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR = 0x00008000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR = 0x00010000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR = 0x00020000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_INDIRECT_BINDABLE_BIT_NV = 0x00040000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR = 0x00080000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_RAY_TRACING_ALLOW_MOTION_BIT_NV = 0x00100000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00200000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = 0x00400000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT = 0x00800000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT = 0x01000000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x02000000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x04000000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_NO_PROTECTED_ACCESS_BIT = 0x08000000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_NO_PROTECTED_ACCESS_BIT_EXT = 0x08000000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV = 0x10000000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_DESCRIPTOR_BUFFER_BIT_EXT = 0x20000000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_PROTECTED_ACCESS_ONLY_BIT = 0x40000000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_PROTECTED_ACCESS_ONLY_BIT_EXT = 0x40000000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_CAPTURE_DATA_BIT_KHR = 0x80000000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_ENABLE_LEGACY_DITHERING_BIT_EXT = 0x400000000ull; -static const VkPipelineCreateFlagBits2 VK_PIPELINE_CREATE_2_INDIRECT_BINDABLE_BIT_EXT = 0x4000000000ull; -typedef VkPipelineCreateFlagBits2 VkPipelineCreateFlagBits2KHR; - -typedef enum VkPipelineCreationFeedbackFlagBits -{ - VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT = 0x00000001, - VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT = 0x00000002, - VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT = 0x00000004, - VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT_EXT = VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT, - VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT_EXT = VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT, - VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT_EXT = VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT, - VK_PIPELINE_CREATION_FEEDBACK_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkPipelineCreationFeedbackFlagBits; -typedef VkPipelineCreationFeedbackFlagBits VkPipelineCreationFeedbackFlagBitsEXT; - -typedef enum VkPipelineDepthStencilStateCreateFlagBits -{ - VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT = 0x00000001, - VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT = 0x00000002, - VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_ARM = VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT, - VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_ARM = VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT, - VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkPipelineDepthStencilStateCreateFlagBits; - -typedef enum VkPipelineExecutableStatisticFormatKHR -{ - VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_BOOL32_KHR = 0, - VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_INT64_KHR = 1, - VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_UINT64_KHR = 2, - VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_FLOAT64_KHR = 3, - VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_KHR_MAX_ENUM = 0x7fffffff, -} VkPipelineExecutableStatisticFormatKHR; - -typedef enum VkPipelineLayoutCreateFlagBits -{ - VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT = 0x00000002, - VK_PIPELINE_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkPipelineLayoutCreateFlagBits; - -typedef enum VkPipelineRobustnessBufferBehavior -{ - VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT = 0, - VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED = 1, - VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS = 2, - VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2 = 3, - VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT_EXT = VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT, - VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED_EXT = VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED, - VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT = VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS, - VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT = VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2, - VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_MAX_ENUM = 0x7fffffff, -} VkPipelineRobustnessBufferBehavior; -typedef VkPipelineRobustnessBufferBehavior VkPipelineRobustnessBufferBehaviorEXT; - -typedef enum VkPipelineRobustnessImageBehavior -{ - VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DEVICE_DEFAULT = 0, - VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DISABLED = 1, - VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS = 2, - VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_2 = 3, - VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DEVICE_DEFAULT_EXT = VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DEVICE_DEFAULT, - VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DISABLED_EXT = VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DISABLED, - VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_EXT = VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS, - VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_2_EXT = VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_2, - VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_MAX_ENUM = 0x7fffffff, -} VkPipelineRobustnessImageBehavior; -typedef VkPipelineRobustnessImageBehavior VkPipelineRobustnessImageBehaviorEXT; - -typedef enum VkPipelineShaderStageCreateFlagBits -{ - VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT = 0x00000001, - VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT = 0x00000002, - VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT = VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT, - VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT = VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT, - VK_PIPELINE_SHADER_STAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkPipelineShaderStageCreateFlagBits; - -typedef enum VkPipelineStageFlagBits -{ - VK_PIPELINE_STAGE_NONE = 0, - VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, - VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, - VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, - VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, - VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, - VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, - VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, - VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, - VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, - VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, - VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000, - VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, - VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, - VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, - VK_PIPELINE_STAGE_COMMAND_PREPROCESS_BIT_NV = 0x00020000, - VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT = 0x00040000, - VK_PIPELINE_STAGE_TASK_SHADER_BIT_EXT = 0x00080000, - VK_PIPELINE_STAGE_MESH_SHADER_BIT_EXT = 0x00100000, - VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR = 0x00200000, - VK_PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00400000, - VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT = 0x00800000, - VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT = 0x01000000, - VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR = 0x02000000, - VK_PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV = VK_PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR, - VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_NV = VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR, - VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_NV = VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR, - VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV = VK_PIPELINE_STAGE_TASK_SHADER_BIT_EXT, - VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV = VK_PIPELINE_STAGE_MESH_SHADER_BIT_EXT, - VK_PIPELINE_STAGE_NONE_KHR = VK_PIPELINE_STAGE_NONE, - VK_PIPELINE_STAGE_COMMAND_PREPROCESS_BIT_EXT = VK_PIPELINE_STAGE_COMMAND_PREPROCESS_BIT_NV, - VK_PIPELINE_STAGE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkPipelineStageFlagBits; - -typedef VkFlags64 VkPipelineStageFlagBits2; - -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_NONE = 0ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_NONE_KHR = 0ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT = 0x00000001ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT_KHR = 0x00000001ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT = 0x00000002ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT_KHR = 0x00000002ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT = 0x00000004ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT_KHR = 0x00000004ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT = 0x00000008ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT_KHR = 0x00000008ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT_KHR = 0x00000010ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT_KHR = 0x00000020ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT = 0x00000040ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT_KHR = 0x00000040ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT = 0x00000080ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT_KHR = 0x00000080ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT = 0x00000100ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT_KHR = 0x00000100ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT = 0x00000200ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT_KHR = 0x00000200ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT_KHR = 0x00000400ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT = 0x00000800ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT_KHR = 0x00000800ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT = 0x00001000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TRANSFER_BIT = 0x00001000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT_KHR = 0x00001000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TRANSFER_BIT_KHR = 0x00001000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT = 0x00002000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT_KHR = 0x00002000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_HOST_BIT = 0x00004000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_HOST_BIT_KHR = 0x00004000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT = 0x00008000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT_KHR = 0x00008000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT = 0x00010000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT_KHR = 0x00010000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_NV = 0x00020000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_EXT = 0x00020000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT = 0x00040000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_NV = 0x00080000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_EXT = 0x00080000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_NV = 0x00100000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_EXT = 0x00100000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR = 0x00200000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_NV = 0x00200000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00400000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_SHADING_RATE_IMAGE_BIT_NV = 0x00400000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_FRAGMENT_DENSITY_PROCESS_BIT_EXT = 0x00800000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT = 0x01000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_KHR = 0x02000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_NV = 0x02000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR = 0x04000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VIDEO_ENCODE_BIT_KHR = 0x08000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHR = 0x10000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_OPTICAL_FLOW_BIT_NV = 0x20000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_MICROMAP_BUILD_BIT_EXT = 0x40000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COPY_BIT = 0x100000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COPY_BIT_KHR = 0x100000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_RESOLVE_BIT = 0x200000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_RESOLVE_BIT_KHR = 0x200000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_BLIT_BIT = 0x400000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_BLIT_BIT_KHR = 0x400000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_CLEAR_BIT = 0x800000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_CLEAR_BIT_KHR = 0x800000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT = 0x1000000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT_KHR = 0x1000000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT = 0x2000000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT_KHR = 0x2000000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT = 0x4000000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT_KHR = 0x4000000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_SUBPASS_SHADER_BIT_HUAWEI = 0x8000000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_SUBPASS_SHADING_BIT_HUAWEI = 0x8000000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI = 0x10000000000ull; -static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_CLUSTER_CULLING_SHADER_BIT_HUAWEI = 0x20000000000ull; -typedef VkPipelineStageFlagBits2 VkPipelineStageFlagBits2KHR; - -typedef enum VkPointClippingBehavior -{ - VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES = 0, - VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY = 1, - VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES_KHR = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES, - VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY_KHR = VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY, - VK_POINT_CLIPPING_BEHAVIOR_MAX_ENUM = 0x7fffffff, -} VkPointClippingBehavior; -typedef VkPointClippingBehavior VkPointClippingBehaviorKHR; - -typedef enum VkPolygonMode -{ - VK_POLYGON_MODE_FILL = 0, - VK_POLYGON_MODE_LINE = 1, - VK_POLYGON_MODE_POINT = 2, - VK_POLYGON_MODE_FILL_RECTANGLE_NV = 1000153000, - VK_POLYGON_MODE_MAX_ENUM = 0x7fffffff, -} VkPolygonMode; - -typedef enum VkPresentGravityFlagBitsEXT -{ - VK_PRESENT_GRAVITY_MIN_BIT_EXT = 0x00000001, - VK_PRESENT_GRAVITY_MAX_BIT_EXT = 0x00000002, - VK_PRESENT_GRAVITY_CENTERED_BIT_EXT = 0x00000004, - VK_PRESENT_GRAVITY_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkPresentGravityFlagBitsEXT; - -typedef enum VkPresentModeKHR -{ - VK_PRESENT_MODE_IMMEDIATE_KHR = 0, - VK_PRESENT_MODE_MAILBOX_KHR = 1, - VK_PRESENT_MODE_FIFO_KHR = 2, - VK_PRESENT_MODE_FIFO_RELAXED_KHR = 3, - VK_PRESENT_MODE_FIFO_LATEST_READY_EXT = 1000361000, - VK_PRESENT_MODE_KHR_MAX_ENUM = 0x7fffffff, -} VkPresentModeKHR; - -typedef enum VkPresentScalingFlagBitsEXT -{ - VK_PRESENT_SCALING_ONE_TO_ONE_BIT_EXT = 0x00000001, - VK_PRESENT_SCALING_ASPECT_RATIO_STRETCH_BIT_EXT = 0x00000002, - VK_PRESENT_SCALING_STRETCH_BIT_EXT = 0x00000004, - VK_PRESENT_SCALING_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkPresentScalingFlagBitsEXT; - -typedef enum VkPrimitiveTopology -{ - VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0, - VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 1, - VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 2, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 3, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 4, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 5, - VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 6, - VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 7, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 8, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 9, - VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 10, - VK_PRIMITIVE_TOPOLOGY_MAX_ENUM = 0x7fffffff, -} VkPrimitiveTopology; - -typedef enum VkProvokingVertexModeEXT -{ - VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT = 0, - VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT = 1, - VK_PROVOKING_VERTEX_MODE_EXT_MAX_ENUM = 0x7fffffff, -} VkProvokingVertexModeEXT; - -typedef enum VkQueryControlFlagBits -{ - VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001, - VK_QUERY_CONTROL_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkQueryControlFlagBits; - -typedef enum VkQueryPipelineStatisticFlagBits -{ - VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, - VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, - VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, - VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, - VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, - VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, - VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, - VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, - VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, - VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, - VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, - VK_QUERY_PIPELINE_STATISTIC_TASK_SHADER_INVOCATIONS_BIT_EXT = 0x00000800, - VK_QUERY_PIPELINE_STATISTIC_MESH_SHADER_INVOCATIONS_BIT_EXT = 0x00001000, - VK_QUERY_PIPELINE_STATISTIC_CLUSTER_CULLING_SHADER_INVOCATIONS_BIT_HUAWEI = 0x00002000, - VK_QUERY_PIPELINE_STATISTIC_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkQueryPipelineStatisticFlagBits; - -typedef enum VkQueryPoolSamplingModeINTEL -{ - VK_QUERY_POOL_SAMPLING_MODE_MANUAL_INTEL = 0, - VK_QUERY_POOL_SAMPLING_MODE_INTEL_MAX_ENUM = 0x7fffffff, -} VkQueryPoolSamplingModeINTEL; - -typedef enum VkQueryResultFlagBits -{ - VK_QUERY_RESULT_64_BIT = 0x00000001, - VK_QUERY_RESULT_WAIT_BIT = 0x00000002, - VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, - VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, - VK_QUERY_RESULT_WITH_STATUS_BIT_KHR = 0x00000010, - VK_QUERY_RESULT_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkQueryResultFlagBits; - -typedef enum VkQueryResultStatusKHR -{ - VK_QUERY_RESULT_STATUS_INSUFFICIENT_BITSTREAM_BUFFER_RANGE_KHR = -1000299000, - VK_QUERY_RESULT_STATUS_ERROR_KHR = -1, - VK_QUERY_RESULT_STATUS_NOT_READY_KHR = 0, - VK_QUERY_RESULT_STATUS_COMPLETE_KHR = 1, - VK_QUERY_RESULT_STATUS_KHR_MAX_ENUM = 0x7fffffff, -} VkQueryResultStatusKHR; - -typedef enum VkQueryType -{ - VK_QUERY_TYPE_OCCLUSION = 0, - VK_QUERY_TYPE_PIPELINE_STATISTICS = 1, - VK_QUERY_TYPE_TIMESTAMP = 2, - VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR = 1000023000, - VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT = 1000028004, - VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR = 1000116000, - VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR = 1000150000, - VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR = 1000150001, - VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV = 1000165000, - VK_QUERY_TYPE_PERFORMANCE_QUERY_INTEL = 1000210000, - VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR = 1000299000, - VK_QUERY_TYPE_MESH_PRIMITIVES_GENERATED_EXT = 1000328000, - VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT = 1000382000, - VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_BOTTOM_LEVEL_POINTERS_KHR = 1000386000, - VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SIZE_KHR = 1000386001, - VK_QUERY_TYPE_MICROMAP_SERIALIZATION_SIZE_EXT = 1000396000, - VK_QUERY_TYPE_MICROMAP_COMPACTED_SIZE_EXT = 1000396001, - VK_QUERY_TYPE_MAX_ENUM = 0x7fffffff, -} VkQueryType; - -typedef enum VkQueueFlagBits -{ - VK_QUEUE_GRAPHICS_BIT = 0x00000001, - VK_QUEUE_COMPUTE_BIT = 0x00000002, - VK_QUEUE_TRANSFER_BIT = 0x00000004, - VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, - VK_QUEUE_PROTECTED_BIT = 0x00000010, - VK_QUEUE_VIDEO_DECODE_BIT_KHR = 0x00000020, - VK_QUEUE_VIDEO_ENCODE_BIT_KHR = 0x00000040, - VK_QUEUE_OPTICAL_FLOW_BIT_NV = 0x00000100, - VK_QUEUE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkQueueFlagBits; - -typedef enum VkQueueGlobalPriority -{ - VK_QUEUE_GLOBAL_PRIORITY_LOW = 128, - VK_QUEUE_GLOBAL_PRIORITY_MEDIUM = 256, - VK_QUEUE_GLOBAL_PRIORITY_HIGH = 512, - VK_QUEUE_GLOBAL_PRIORITY_REALTIME = 1024, - VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT = VK_QUEUE_GLOBAL_PRIORITY_LOW, - VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT = VK_QUEUE_GLOBAL_PRIORITY_MEDIUM, - VK_QUEUE_GLOBAL_PRIORITY_HIGH_EXT = VK_QUEUE_GLOBAL_PRIORITY_HIGH, - VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT = VK_QUEUE_GLOBAL_PRIORITY_REALTIME, - VK_QUEUE_GLOBAL_PRIORITY_LOW_KHR = VK_QUEUE_GLOBAL_PRIORITY_LOW, - VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR = VK_QUEUE_GLOBAL_PRIORITY_MEDIUM, - VK_QUEUE_GLOBAL_PRIORITY_HIGH_KHR = VK_QUEUE_GLOBAL_PRIORITY_HIGH, - VK_QUEUE_GLOBAL_PRIORITY_REALTIME_KHR = VK_QUEUE_GLOBAL_PRIORITY_REALTIME, - VK_QUEUE_GLOBAL_PRIORITY_MAX_ENUM = 0x7fffffff, -} VkQueueGlobalPriority; -typedef VkQueueGlobalPriority VkQueueGlobalPriorityKHR; -typedef VkQueueGlobalPriority VkQueueGlobalPriorityEXT; - -typedef enum VkRasterizationOrderAMD -{ - VK_RASTERIZATION_ORDER_STRICT_AMD = 0, - VK_RASTERIZATION_ORDER_RELAXED_AMD = 1, - VK_RASTERIZATION_ORDER_AMD_MAX_ENUM = 0x7fffffff, -} VkRasterizationOrderAMD; - -typedef enum VkRayTracingInvocationReorderModeNV -{ - VK_RAY_TRACING_INVOCATION_REORDER_MODE_NONE_NV = 0, - VK_RAY_TRACING_INVOCATION_REORDER_MODE_REORDER_NV = 1, - VK_RAY_TRACING_INVOCATION_REORDER_MODE_NV_MAX_ENUM = 0x7fffffff, -} VkRayTracingInvocationReorderModeNV; - -typedef enum VkRayTracingShaderGroupTypeKHR -{ - VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR = 0, - VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR = 1, - VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR = 2, - VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV = VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR, - VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV = VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR, - VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV = VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR, - VK_RAY_TRACING_SHADER_GROUP_TYPE_KHR_MAX_ENUM = 0x7fffffff, -} VkRayTracingShaderGroupTypeKHR; -typedef VkRayTracingShaderGroupTypeKHR VkRayTracingShaderGroupTypeNV; - -typedef enum VkRenderPassCreateFlagBits -{ - VK_RENDER_PASS_CREATE_TRANSFORM_BIT_QCOM = 0x00000002, - VK_RENDER_PASS_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkRenderPassCreateFlagBits; - -typedef enum VkRenderingFlagBits -{ - VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT = 0x00000001, - VK_RENDERING_SUSPENDING_BIT = 0x00000002, - VK_RENDERING_RESUMING_BIT = 0x00000004, - VK_RENDERING_ENABLE_LEGACY_DITHERING_BIT_EXT = 0x00000008, - VK_RENDERING_CONTENTS_INLINE_BIT_KHR = 0x00000010, - VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT_KHR = VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT, - VK_RENDERING_SUSPENDING_BIT_KHR = VK_RENDERING_SUSPENDING_BIT, - VK_RENDERING_RESUMING_BIT_KHR = VK_RENDERING_RESUMING_BIT, - VK_RENDERING_CONTENTS_INLINE_BIT_EXT = VK_RENDERING_CONTENTS_INLINE_BIT_KHR, - VK_RENDERING_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkRenderingFlagBits; -typedef VkRenderingFlagBits VkRenderingFlagBitsKHR; - -typedef enum VkResolveModeFlagBits -{ - VK_RESOLVE_MODE_NONE = 0, - VK_RESOLVE_MODE_SAMPLE_ZERO_BIT = 0x00000001, - VK_RESOLVE_MODE_AVERAGE_BIT = 0x00000002, - VK_RESOLVE_MODE_MIN_BIT = 0x00000004, - VK_RESOLVE_MODE_MAX_BIT = 0x00000008, - VK_RESOLVE_MODE_NONE_KHR = VK_RESOLVE_MODE_NONE, - VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR = VK_RESOLVE_MODE_SAMPLE_ZERO_BIT, - VK_RESOLVE_MODE_AVERAGE_BIT_KHR = VK_RESOLVE_MODE_AVERAGE_BIT, - VK_RESOLVE_MODE_MIN_BIT_KHR = VK_RESOLVE_MODE_MIN_BIT, - VK_RESOLVE_MODE_MAX_BIT_KHR = VK_RESOLVE_MODE_MAX_BIT, - VK_RESOLVE_MODE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkResolveModeFlagBits; -typedef VkResolveModeFlagBits VkResolveModeFlagBitsKHR; - -typedef enum VkResult -{ - VK_ERROR_NOT_ENOUGH_SPACE_KHR = -1000483000, - VK_ERROR_COMPRESSION_EXHAUSTED_EXT = -1000338000, - VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR = -1000299000, - VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS = -1000257000, - VK_ERROR_NOT_PERMITTED = -1000174001, - VK_ERROR_FRAGMENTATION = -1000161000, - VK_ERROR_INVALID_EXTERNAL_HANDLE = -1000072003, - VK_ERROR_OUT_OF_POOL_MEMORY = -1000069000, - VK_ERROR_VIDEO_STD_VERSION_NOT_SUPPORTED_KHR = -1000023005, - VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR = -1000023004, - VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR = -1000023003, - VK_ERROR_VIDEO_PROFILE_OPERATION_NOT_SUPPORTED_KHR = -1000023002, - VK_ERROR_VIDEO_PICTURE_LAYOUT_NOT_SUPPORTED_KHR = -1000023001, - VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR = -1000023000, - VK_ERROR_INVALID_SHADER_NV = -1000012000, - VK_ERROR_VALIDATION_FAILED_EXT = -1000011001, - VK_ERROR_OUT_OF_DATE_KHR = -1000001004, - VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001, - VK_ERROR_SURFACE_LOST_KHR = -1000000000, - VK_ERROR_UNKNOWN = -13, - VK_ERROR_FRAGMENTED_POOL = -12, - VK_ERROR_FORMAT_NOT_SUPPORTED = -11, - VK_ERROR_TOO_MANY_OBJECTS = -10, - VK_ERROR_INCOMPATIBLE_DRIVER = -9, - VK_ERROR_FEATURE_NOT_PRESENT = -8, - VK_ERROR_EXTENSION_NOT_PRESENT = -7, - VK_ERROR_LAYER_NOT_PRESENT = -6, - VK_ERROR_MEMORY_MAP_FAILED = -5, - VK_ERROR_DEVICE_LOST = -4, - VK_ERROR_INITIALIZATION_FAILED = -3, - VK_ERROR_OUT_OF_DEVICE_MEMORY = -2, - VK_ERROR_OUT_OF_HOST_MEMORY = -1, - VK_SUCCESS = 0, - VK_NOT_READY = 1, - VK_TIMEOUT = 2, - VK_EVENT_SET = 3, - VK_EVENT_RESET = 4, - VK_INCOMPLETE = 5, - VK_SUBOPTIMAL_KHR = 1000001003, - VK_THREAD_IDLE_KHR = 1000268000, - VK_THREAD_DONE_KHR = 1000268001, - VK_OPERATION_DEFERRED_KHR = 1000268002, - VK_OPERATION_NOT_DEFERRED_KHR = 1000268003, - VK_PIPELINE_COMPILE_REQUIRED = 1000297000, - VK_INCOMPATIBLE_SHADER_BINARY_EXT = 1000482000, - VK_PIPELINE_BINARY_MISSING_KHR = 1000483000, - VK_ERROR_OUT_OF_POOL_MEMORY_KHR = VK_ERROR_OUT_OF_POOL_MEMORY, - VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR = VK_ERROR_INVALID_EXTERNAL_HANDLE, - VK_ERROR_FRAGMENTATION_EXT = VK_ERROR_FRAGMENTATION, - VK_ERROR_NOT_PERMITTED_EXT = VK_ERROR_NOT_PERMITTED, - VK_ERROR_NOT_PERMITTED_KHR = VK_ERROR_NOT_PERMITTED, - VK_ERROR_INVALID_DEVICE_ADDRESS_EXT = VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS, - VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR = VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS, - VK_PIPELINE_COMPILE_REQUIRED_EXT = VK_PIPELINE_COMPILE_REQUIRED, - VK_ERROR_PIPELINE_COMPILE_REQUIRED_EXT = VK_PIPELINE_COMPILE_REQUIRED, - VK_ERROR_INCOMPATIBLE_SHADER_BINARY_EXT = VK_INCOMPATIBLE_SHADER_BINARY_EXT, - VK_RESULT_MAX_ENUM = 0x7fffffff, -} VkResult; - -typedef enum VkSampleCountFlagBits -{ - VK_SAMPLE_COUNT_1_BIT = 0x00000001, - VK_SAMPLE_COUNT_2_BIT = 0x00000002, - VK_SAMPLE_COUNT_4_BIT = 0x00000004, - VK_SAMPLE_COUNT_8_BIT = 0x00000008, - VK_SAMPLE_COUNT_16_BIT = 0x00000010, - VK_SAMPLE_COUNT_32_BIT = 0x00000020, - VK_SAMPLE_COUNT_64_BIT = 0x00000040, - VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkSampleCountFlagBits; - -typedef enum VkSamplerAddressMode -{ - VK_SAMPLER_ADDRESS_MODE_REPEAT = 0, - VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 1, - VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 2, - VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 3, - VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 4, - VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE_KHR = VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE, - VK_SAMPLER_ADDRESS_MODE_MAX_ENUM = 0x7fffffff, -} VkSamplerAddressMode; - -typedef enum VkSamplerCreateFlagBits -{ - VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT = 0x00000001, - VK_SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT = 0x00000002, - VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT = 0x00000004, - VK_SAMPLER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00000008, - VK_SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM = 0x00000010, - VK_SAMPLER_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkSamplerCreateFlagBits; - -typedef enum VkSamplerMipmapMode -{ - VK_SAMPLER_MIPMAP_MODE_NEAREST = 0, - VK_SAMPLER_MIPMAP_MODE_LINEAR = 1, - VK_SAMPLER_MIPMAP_MODE_MAX_ENUM = 0x7fffffff, -} VkSamplerMipmapMode; - -typedef enum VkSamplerReductionMode -{ - VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE = 0, - VK_SAMPLER_REDUCTION_MODE_MIN = 1, - VK_SAMPLER_REDUCTION_MODE_MAX = 2, - VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM = 1000521000, - VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT = VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE, - VK_SAMPLER_REDUCTION_MODE_MIN_EXT = VK_SAMPLER_REDUCTION_MODE_MIN, - VK_SAMPLER_REDUCTION_MODE_MAX_EXT = VK_SAMPLER_REDUCTION_MODE_MAX, - VK_SAMPLER_REDUCTION_MODE_MAX_ENUM = 0x7fffffff, -} VkSamplerReductionMode; -typedef VkSamplerReductionMode VkSamplerReductionModeEXT; - -typedef enum VkSamplerYcbcrModelConversion -{ - VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY = 0, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY = 1, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709 = 2, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601 = 3, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020 = 4, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_MAX_ENUM = 0x7fffffff, -} VkSamplerYcbcrModelConversion; -typedef VkSamplerYcbcrModelConversion VkSamplerYcbcrModelConversionKHR; - -typedef enum VkSamplerYcbcrRange -{ - VK_SAMPLER_YCBCR_RANGE_ITU_FULL = 0, - VK_SAMPLER_YCBCR_RANGE_ITU_NARROW = 1, - VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR = VK_SAMPLER_YCBCR_RANGE_ITU_FULL, - VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR = VK_SAMPLER_YCBCR_RANGE_ITU_NARROW, - VK_SAMPLER_YCBCR_RANGE_MAX_ENUM = 0x7fffffff, -} VkSamplerYcbcrRange; -typedef VkSamplerYcbcrRange VkSamplerYcbcrRangeKHR; - -typedef enum VkScopeKHR -{ - VK_SCOPE_DEVICE_KHR = 1, - VK_SCOPE_WORKGROUP_KHR = 2, - VK_SCOPE_SUBGROUP_KHR = 3, - VK_SCOPE_QUEUE_FAMILY_KHR = 5, - VK_SCOPE_DEVICE_NV = VK_SCOPE_DEVICE_KHR, - VK_SCOPE_WORKGROUP_NV = VK_SCOPE_WORKGROUP_KHR, - VK_SCOPE_SUBGROUP_NV = VK_SCOPE_SUBGROUP_KHR, - VK_SCOPE_QUEUE_FAMILY_NV = VK_SCOPE_QUEUE_FAMILY_KHR, - VK_SCOPE_KHR_MAX_ENUM = 0x7fffffff, -} VkScopeKHR; -typedef VkScopeKHR VkScopeNV; - -typedef enum VkSemaphoreImportFlagBits -{ - VK_SEMAPHORE_IMPORT_TEMPORARY_BIT = 0x00000001, - VK_SEMAPHORE_IMPORT_TEMPORARY_BIT_KHR = VK_SEMAPHORE_IMPORT_TEMPORARY_BIT, - VK_SEMAPHORE_IMPORT_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkSemaphoreImportFlagBits; -typedef VkSemaphoreImportFlagBits VkSemaphoreImportFlagBitsKHR; - -typedef enum VkSemaphoreType -{ - VK_SEMAPHORE_TYPE_BINARY = 0, - VK_SEMAPHORE_TYPE_TIMELINE = 1, - VK_SEMAPHORE_TYPE_BINARY_KHR = VK_SEMAPHORE_TYPE_BINARY, - VK_SEMAPHORE_TYPE_TIMELINE_KHR = VK_SEMAPHORE_TYPE_TIMELINE, - VK_SEMAPHORE_TYPE_MAX_ENUM = 0x7fffffff, -} VkSemaphoreType; -typedef VkSemaphoreType VkSemaphoreTypeKHR; - -typedef enum VkSemaphoreWaitFlagBits -{ - VK_SEMAPHORE_WAIT_ANY_BIT = 0x00000001, - VK_SEMAPHORE_WAIT_ANY_BIT_KHR = VK_SEMAPHORE_WAIT_ANY_BIT, - VK_SEMAPHORE_WAIT_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkSemaphoreWaitFlagBits; -typedef VkSemaphoreWaitFlagBits VkSemaphoreWaitFlagBitsKHR; - -typedef enum VkShaderCodeTypeEXT -{ - VK_SHADER_CODE_TYPE_BINARY_EXT = 0, - VK_SHADER_CODE_TYPE_SPIRV_EXT = 1, - VK_SHADER_CODE_TYPE_EXT_MAX_ENUM = 0x7fffffff, -} VkShaderCodeTypeEXT; - -typedef enum VkShaderCorePropertiesFlagBitsAMD -{ - VK_SHADER_CORE_PROPERTIES_FLAG_BITS_AMD_MAX_ENUM = 0x7fffffff, -} VkShaderCorePropertiesFlagBitsAMD; - -typedef enum VkShaderCreateFlagBitsEXT -{ - VK_SHADER_CREATE_LINK_STAGE_BIT_EXT = 0x00000001, - VK_SHADER_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT = 0x00000002, - VK_SHADER_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT = 0x00000004, - VK_SHADER_CREATE_NO_TASK_SHADER_BIT_EXT = 0x00000008, - VK_SHADER_CREATE_DISPATCH_BASE_BIT_EXT = 0x00000010, - VK_SHADER_CREATE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_EXT = 0x00000020, - VK_SHADER_CREATE_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = 0x00000040, - VK_SHADER_CREATE_INDIRECT_BINDABLE_BIT_EXT = 0x00000080, - VK_SHADER_CREATE_FLAG_BITS_EXT_MAX_ENUM = 0x7fffffff, -} VkShaderCreateFlagBitsEXT; - -typedef enum VkShaderFloatControlsIndependence -{ - VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY = 0, - VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL = 1, - VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE = 2, - VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY_KHR = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY, - VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL_KHR = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL, - VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE_KHR = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE, - VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_MAX_ENUM = 0x7fffffff, -} VkShaderFloatControlsIndependence; -typedef VkShaderFloatControlsIndependence VkShaderFloatControlsIndependenceKHR; - -typedef enum VkShaderGroupShaderKHR -{ - VK_SHADER_GROUP_SHADER_GENERAL_KHR = 0, - VK_SHADER_GROUP_SHADER_CLOSEST_HIT_KHR = 1, - VK_SHADER_GROUP_SHADER_ANY_HIT_KHR = 2, - VK_SHADER_GROUP_SHADER_INTERSECTION_KHR = 3, - VK_SHADER_GROUP_SHADER_KHR_MAX_ENUM = 0x7fffffff, -} VkShaderGroupShaderKHR; - -typedef enum VkShaderInfoTypeAMD -{ - VK_SHADER_INFO_TYPE_STATISTICS_AMD = 0, - VK_SHADER_INFO_TYPE_BINARY_AMD = 1, - VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD = 2, - VK_SHADER_INFO_TYPE_AMD_MAX_ENUM = 0x7fffffff, -} VkShaderInfoTypeAMD; - -typedef enum VkShaderStageFlagBits -{ - VK_SHADER_STAGE_VERTEX_BIT = 0x00000001, - VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002, - VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004, - VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008, - VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010, - VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001f, - VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020, - VK_SHADER_STAGE_TASK_BIT_EXT = 0x00000040, - VK_SHADER_STAGE_MESH_BIT_EXT = 0x00000080, - VK_SHADER_STAGE_RAYGEN_BIT_KHR = 0x00000100, - VK_SHADER_STAGE_ANY_HIT_BIT_KHR = 0x00000200, - VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR = 0x00000400, - VK_SHADER_STAGE_MISS_BIT_KHR = 0x00000800, - VK_SHADER_STAGE_INTERSECTION_BIT_KHR = 0x00001000, - VK_SHADER_STAGE_CALLABLE_BIT_KHR = 0x00002000, - VK_SHADER_STAGE_SUBPASS_SHADING_BIT_HUAWEI = 0x00004000, - VK_SHADER_STAGE_CLUSTER_CULLING_BIT_HUAWEI = 0x00080000, - VK_SHADER_STAGE_RAYGEN_BIT_NV = VK_SHADER_STAGE_RAYGEN_BIT_KHR, - VK_SHADER_STAGE_ANY_HIT_BIT_NV = VK_SHADER_STAGE_ANY_HIT_BIT_KHR, - VK_SHADER_STAGE_CLOSEST_HIT_BIT_NV = VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR, - VK_SHADER_STAGE_MISS_BIT_NV = VK_SHADER_STAGE_MISS_BIT_KHR, - VK_SHADER_STAGE_INTERSECTION_BIT_NV = VK_SHADER_STAGE_INTERSECTION_BIT_KHR, - VK_SHADER_STAGE_CALLABLE_BIT_NV = VK_SHADER_STAGE_CALLABLE_BIT_KHR, - VK_SHADER_STAGE_TASK_BIT_NV = VK_SHADER_STAGE_TASK_BIT_EXT, - VK_SHADER_STAGE_MESH_BIT_NV = VK_SHADER_STAGE_MESH_BIT_EXT, - VK_SHADER_STAGE_ALL = 0x7fffffff, -} VkShaderStageFlagBits; - -typedef enum VkShadingRatePaletteEntryNV -{ - VK_SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV = 0, - VK_SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV = 1, - VK_SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV = 2, - VK_SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV = 3, - VK_SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV = 4, - VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV = 5, - VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV = 6, - VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV = 7, - VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV = 8, - VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV = 9, - VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV = 10, - VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV = 11, - VK_SHADING_RATE_PALETTE_ENTRY_NV_MAX_ENUM = 0x7fffffff, -} VkShadingRatePaletteEntryNV; - -typedef enum VkSharingMode -{ - VK_SHARING_MODE_EXCLUSIVE = 0, - VK_SHARING_MODE_CONCURRENT = 1, - VK_SHARING_MODE_MAX_ENUM = 0x7fffffff, -} VkSharingMode; - -typedef enum VkSparseImageFormatFlagBits -{ - VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, - VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT = 0x00000002, - VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, - VK_SPARSE_IMAGE_FORMAT_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkSparseImageFormatFlagBits; - -typedef enum VkSparseMemoryBindFlagBits -{ - VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001, - VK_SPARSE_MEMORY_BIND_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkSparseMemoryBindFlagBits; - -typedef enum VkStencilFaceFlagBits -{ - VK_STENCIL_FACE_FRONT_BIT = 0x00000001, - VK_STENCIL_FACE_BACK_BIT = 0x00000002, - VK_STENCIL_FACE_FRONT_AND_BACK = 0x00000003, - VK_STENCIL_FRONT_AND_BACK = VK_STENCIL_FACE_FRONT_AND_BACK, - VK_STENCIL_FACE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkStencilFaceFlagBits; - -typedef enum VkStencilOp -{ - VK_STENCIL_OP_KEEP = 0, - VK_STENCIL_OP_ZERO = 1, - VK_STENCIL_OP_REPLACE = 2, - VK_STENCIL_OP_INCREMENT_AND_CLAMP = 3, - VK_STENCIL_OP_DECREMENT_AND_CLAMP = 4, - VK_STENCIL_OP_INVERT = 5, - VK_STENCIL_OP_INCREMENT_AND_WRAP = 6, - VK_STENCIL_OP_DECREMENT_AND_WRAP = 7, - VK_STENCIL_OP_MAX_ENUM = 0x7fffffff, -} VkStencilOp; - -typedef enum VkStructureType -{ - VK_STRUCTURE_TYPE_APPLICATION_INFO = 0, - VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1, - VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2, - VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3, - VK_STRUCTURE_TYPE_SUBMIT_INFO = 4, - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5, - VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6, - VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7, - VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8, - VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9, - VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10, - VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11, - VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12, - VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13, - VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14, - VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15, - VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16, - VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17, - VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18, - VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19, - VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20, - VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23, - VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24, - VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25, - VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26, - VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27, - VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28, - VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29, - VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30, - VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32, - VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34, - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35, - VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36, - VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37, - VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38, - VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42, - VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43, - VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44, - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45, - VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46, - VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47, - VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES = 49, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES = 50, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES = 51, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES = 52, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES = 53, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES = 54, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES = 55, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_PROPERTIES = 56, - VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000, - VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001, - VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, - VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000, - VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000, - VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001, - VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002, - VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR = 1000023000, - VK_STRUCTURE_TYPE_VIDEO_CAPABILITIES_KHR = 1000023001, - VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR = 1000023002, - VK_STRUCTURE_TYPE_VIDEO_SESSION_MEMORY_REQUIREMENTS_KHR = 1000023003, - VK_STRUCTURE_TYPE_BIND_VIDEO_SESSION_MEMORY_INFO_KHR = 1000023004, - VK_STRUCTURE_TYPE_VIDEO_SESSION_CREATE_INFO_KHR = 1000023005, - VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000023006, - VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_UPDATE_INFO_KHR = 1000023007, - VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR = 1000023008, - VK_STRUCTURE_TYPE_VIDEO_END_CODING_INFO_KHR = 1000023009, - VK_STRUCTURE_TYPE_VIDEO_CODING_CONTROL_INFO_KHR = 1000023010, - VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR = 1000023011, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR = 1000023012, - VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR = 1000023013, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_FORMAT_INFO_KHR = 1000023014, - VK_STRUCTURE_TYPE_VIDEO_FORMAT_PROPERTIES_KHR = 1000023015, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_KHR = 1000023016, - VK_STRUCTURE_TYPE_VIDEO_DECODE_INFO_KHR = 1000024000, - VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR = 1000024001, - VK_STRUCTURE_TYPE_VIDEO_DECODE_USAGE_INFO_KHR = 1000024002, - VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000, - VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001, - VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT = 1000028000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT = 1000028001, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT = 1000028002, - VK_STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX = 1000029000, - VK_STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX = 1000029001, - VK_STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX = 1000029002, - VK_STRUCTURE_TYPE_CU_MODULE_TEXTURING_MODE_CREATE_INFO_NVX = 1000029004, - VK_STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX = 1000030000, - VK_STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX = 1000030001, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_KHR = 1000038000, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000038001, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_KHR = 1000038002, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PICTURE_INFO_KHR = 1000038003, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_KHR = 1000038004, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_NALU_SLICE_INFO_KHR = 1000038005, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_GOP_REMAINING_FRAME_INFO_KHR = 1000038006, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_KHR = 1000038007, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_INFO_KHR = 1000038008, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_KHR = 1000038009, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_KHR = 1000038010, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUALITY_LEVEL_PROPERTIES_KHR = 1000038011, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_GET_INFO_KHR = 1000038012, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_FEEDBACK_INFO_KHR = 1000038013, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_KHR = 1000039000, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000039001, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR = 1000039002, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PICTURE_INFO_KHR = 1000039003, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_KHR = 1000039004, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_NALU_SLICE_SEGMENT_INFO_KHR = 1000039005, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_GOP_REMAINING_FRAME_INFO_KHR = 1000039006, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_KHR = 1000039007, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_INFO_KHR = 1000039009, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_KHR = 1000039010, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_KHR = 1000039011, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUALITY_LEVEL_PROPERTIES_KHR = 1000039012, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_GET_INFO_KHR = 1000039013, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_FEEDBACK_INFO_KHR = 1000039014, - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_KHR = 1000040000, - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_KHR = 1000040001, - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR = 1000040003, - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000040004, - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_KHR = 1000040005, - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_KHR = 1000040006, - VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD = 1000041000, - VK_STRUCTURE_TYPE_RENDERING_INFO = 1000044000, - VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO = 1000044001, - VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO = 1000044002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES = 1000044003, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO = 1000044004, - VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR = 1000044006, - VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT = 1000044007, - VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD = 1000044008, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV = 1000050000, - VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO = 1000053000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES = 1000053001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES = 1000053002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 = 1000059000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2 = 1000059001, - VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2 = 1000059002, - VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2 = 1000059003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2 = 1000059004, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2 = 1000059005, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2 = 1000059006, - VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2 = 1000059007, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2 = 1000059008, - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO = 1000060000, - VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO = 1000060003, - VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO = 1000060004, - VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO = 1000060005, - VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO = 1000060006, - VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR = 1000060007, - VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR = 1000060008, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR = 1000060009, - VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR = 1000060010, - VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR = 1000060011, - VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR = 1000060012, - VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO = 1000060013, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO = 1000060014, - VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES = 1000063000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES = 1000066000, - VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT = 1000067000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT = 1000067001, - VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO = 1000068000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES = 1000068001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES = 1000068002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES = 1000070000, - VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO = 1000070001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO = 1000071000, - VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES = 1000071001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO = 1000071002, - VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES = 1000071003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES = 1000071004, - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO = 1000072000, - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO = 1000072001, - VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO = 1000072002, - VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR = 1000073000, - VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR = 1000073001, - VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR = 1000073002, - VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR = 1000073003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO = 1000076000, - VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES = 1000076001, - VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO = 1000077000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES = 1000080000, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT = 1000081000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT = 1000081001, - VK_STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT = 1000081002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES = 1000082000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES = 1000083000, - VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000, - VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO = 1000085000, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV = 1000087000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES = 1000094000, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV = 1000098000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT = 1000099000, - VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT = 1000099001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT = 1000101000, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT = 1000101001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT = 1000102000, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT = 1000102001, - VK_STRUCTURE_TYPE_HDR_METADATA_EXT = 1000105000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES = 1000108000, - VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO = 1000108001, - VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO = 1000108002, - VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO = 1000108003, - VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2 = 1000109000, - VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2 = 1000109001, - VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2 = 1000109002, - VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2 = 1000109003, - VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2 = 1000109004, - VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO = 1000109005, - VK_STRUCTURE_TYPE_SUBPASS_END_INFO = 1000109006, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG = 1000110000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO = 1000112000, - VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES = 1000112001, - VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO = 1000113000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR = 1000116000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR = 1000116001, - VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR = 1000116002, - VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR = 1000116003, - VK_STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR = 1000116004, - VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR = 1000116005, - VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR = 1000116006, - VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_RESERVATION_INFO_KHR = 1000116007, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES = 1000117000, - VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO = 1000117001, - VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO = 1000117002, - VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO = 1000117003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR = 1000119000, - VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR = 1000119001, - VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR = 1000119002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES = 1000120000, - VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS = 1000127000, - VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO = 1000127001, - VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT = 1000128000, - VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT = 1000128001, - VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT = 1000128002, - VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT = 1000128003, - VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT = 1000128004, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES = 1000130000, - VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO = 1000130001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES = 1000138000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES = 1000138001, - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK = 1000138002, - VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO = 1000138003, - VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT = 1000143000, - VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT = 1000143001, - VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT = 1000143002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT = 1000143003, - VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT = 1000143004, - VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO = 1000145000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES = 1000145001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES = 1000145002, - VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2 = 1000145003, - VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2 = 1000146000, - VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2 = 1000146001, - VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2 = 1000146002, - VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2 = 1000146003, - VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2 = 1000146004, - VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO = 1000147000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT = 1000148000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT = 1000148001, - VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT = 1000148002, - VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV = 1000149000, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR = 1000150000, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR = 1000150002, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR = 1000150003, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR = 1000150004, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR = 1000150005, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR = 1000150006, - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR = 1000150007, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR = 1000150009, - VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR = 1000150010, - VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR = 1000150011, - VK_STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR = 1000150012, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR = 1000150013, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR = 1000150014, - VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR = 1000150015, - VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR = 1000150016, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR = 1000150017, - VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR = 1000150018, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR = 1000150020, - VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV = 1000152000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV = 1000154000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV = 1000154001, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO = 1000156000, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO = 1000156001, - VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO = 1000156002, - VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO = 1000156003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES = 1000156004, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES = 1000156005, - VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO = 1000157000, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO = 1000157001, - VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160000, - VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160001, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO = 1000161000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES = 1000161001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES = 1000161002, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO = 1000161003, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT = 1000161004, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV = 1000164000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV = 1000164001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV = 1000164002, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV = 1000164005, - VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV = 1000165000, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV = 1000165001, - VK_STRUCTURE_TYPE_GEOMETRY_NV = 1000165003, - VK_STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV = 1000165004, - VK_STRUCTURE_TYPE_GEOMETRY_AABB_NV = 1000165005, - VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV = 1000165006, - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV = 1000165007, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV = 1000165008, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV = 1000165009, - VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV = 1000165011, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV = 1000165012, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV = 1000166000, - VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV = 1000166001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES = 1000168000, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT = 1000168001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT = 1000170000, - VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT = 1000170001, - VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO = 1000174000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES = 1000175000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES = 1000177000, - VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT = 1000178000, - VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT = 1000178001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT = 1000178002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES = 1000180000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR = 1000181000, - VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD = 1000183000, - VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_KHR = 1000184000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD = 1000185000, - VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR = 1000187000, - VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000187001, - VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR = 1000187002, - VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR = 1000187003, - VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_KHR = 1000187004, - VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_KHR = 1000187005, - VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD = 1000189000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT = 1000190000, - VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO = 1000190001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES = 1000190002, - VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO = 1000192000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES = 1000196000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES = 1000197000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES = 1000199000, - VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE = 1000199001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR = 1000201000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV = 1000202000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV = 1000202001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR = 1000203000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV = 1000204000, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV = 1000205000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV = 1000205002, - VK_STRUCTURE_TYPE_CHECKPOINT_DATA_NV = 1000206000, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV = 1000206001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES = 1000207000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES = 1000207001, - VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO = 1000207002, - VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO = 1000207003, - VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO = 1000207004, - VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO = 1000207005, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL = 1000209000, - VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL = 1000210000, - VK_STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL = 1000210001, - VK_STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL = 1000210002, - VK_STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL = 1000210003, - VK_STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL = 1000210004, - VK_STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL = 1000210005, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES = 1000211000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT = 1000212000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES = 1000215000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT = 1000218000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT = 1000218001, - VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT = 1000218002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES = 1000221000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES = 1000225000, - VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO = 1000225001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES = 1000225002, - VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR = 1000226000, - VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR = 1000226001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR = 1000226002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR = 1000226003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR = 1000226004, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD = 1000227000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD = 1000229000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES = 1000232000, - VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO = 1000232001, - VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO = 1000232002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT = 1000234000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_QUAD_CONTROL_FEATURES_KHR = 1000235000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT = 1000237000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT = 1000238000, - VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT = 1000238001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV = 1000240000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES = 1000241000, - VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT = 1000241001, - VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT = 1000241002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT = 1000244000, - VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO = 1000244001, - VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT = 1000244002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES = 1000245000, - VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO = 1000246000, - VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT = 1000247000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR = 1000248000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV = 1000249000, - VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV = 1000249001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV = 1000249002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV = 1000250000, - VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV = 1000250001, - VK_STRUCTURE_TYPE_FRAMEBUFFER_MIXED_SAMPLES_COMBINATION_NV = 1000250002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT = 1000251000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT = 1000252000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES = 1000253000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT = 1000254000, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT = 1000254001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT = 1000254002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES = 1000257000, - VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO = 1000257002, - VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO = 1000257003, - VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO = 1000257004, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES = 1000259000, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO = 1000259001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES = 1000259002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT = 1000260000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES = 1000261000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES = 1000265000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT = 1000267000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR = 1000269000, - VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR = 1000269001, - VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_PROPERTIES_KHR = 1000269002, - VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR = 1000269003, - VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR = 1000269004, - VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR = 1000269005, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES = 1000270000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES = 1000270001, - VK_STRUCTURE_TYPE_MEMORY_TO_IMAGE_COPY = 1000270002, - VK_STRUCTURE_TYPE_IMAGE_TO_MEMORY_COPY = 1000270003, - VK_STRUCTURE_TYPE_COPY_IMAGE_TO_MEMORY_INFO = 1000270004, - VK_STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INFO = 1000270005, - VK_STRUCTURE_TYPE_HOST_IMAGE_LAYOUT_TRANSITION_INFO = 1000270006, - VK_STRUCTURE_TYPE_COPY_IMAGE_TO_IMAGE_INFO = 1000270007, - VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE = 1000270008, - VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY = 1000270009, - VK_STRUCTURE_TYPE_MEMORY_MAP_INFO = 1000271000, - VK_STRUCTURE_TYPE_MEMORY_UNMAP_INFO = 1000271001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_FEATURES_EXT = 1000272000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_PROPERTIES_EXT = 1000272001, - VK_STRUCTURE_TYPE_MEMORY_MAP_PLACED_INFO_EXT = 1000272002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT = 1000273000, - VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT = 1000274000, - VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT = 1000274001, - VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT = 1000274002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT = 1000275000, - VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_FENCE_INFO_EXT = 1000275001, - VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODES_CREATE_INFO_EXT = 1000275002, - VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODE_INFO_EXT = 1000275003, - VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_SCALING_CREATE_INFO_EXT = 1000275004, - VK_STRUCTURE_TYPE_RELEASE_SWAPCHAIN_IMAGES_INFO_EXT = 1000275005, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES = 1000276000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV = 1000277000, - VK_STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV = 1000277001, - VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV = 1000277002, - VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV = 1000277003, - VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV = 1000277004, - VK_STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV = 1000277005, - VK_STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_NV = 1000277006, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV = 1000277007, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV = 1000278000, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV = 1000278001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES = 1000280000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES = 1000280001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT = 1000281000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES = 1000281001, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM = 1000282000, - VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM = 1000282001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT = 1000283000, - VK_STRUCTURE_TYPE_DEPTH_BIAS_INFO_EXT = 1000283001, - VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT = 1000283002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT = 1000286000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT = 1000286001, - VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT = 1000287000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT = 1000287001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT = 1000287002, - VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR = 1000290000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV = 1000292000, - VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV = 1000292001, - VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_BARRIER_CREATE_INFO_NV = 1000292002, - VK_STRUCTURE_TYPE_PRESENT_ID_KHR = 1000294000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR = 1000294001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES = 1000295000, - VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO = 1000295001, - VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO = 1000295002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES = 1000297000, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_INFO_KHR = 1000299000, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR = 1000299001, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_LAYER_INFO_KHR = 1000299002, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR = 1000299003, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_USAGE_INFO_KHR = 1000299004, - VK_STRUCTURE_TYPE_QUERY_POOL_VIDEO_ENCODE_FEEDBACK_CREATE_INFO_KHR = 1000299005, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUALITY_LEVEL_INFO_KHR = 1000299006, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_PROPERTIES_KHR = 1000299007, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_INFO_KHR = 1000299008, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_SESSION_PARAMETERS_GET_INFO_KHR = 1000299009, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_SESSION_PARAMETERS_FEEDBACK_INFO_KHR = 1000299010, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV = 1000300000, - VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV = 1000300001, - VK_STRUCTURE_TYPE_CUDA_MODULE_CREATE_INFO_NV = 1000307000, - VK_STRUCTURE_TYPE_CUDA_FUNCTION_CREATE_INFO_NV = 1000307001, - VK_STRUCTURE_TYPE_CUDA_LAUNCH_INFO_NV = 1000307002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV = 1000307003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_PROPERTIES_NV = 1000307004, - VK_STRUCTURE_TYPE_QUERY_LOW_LATENCY_SUPPORT_NV = 1000310000, - VK_STRUCTURE_TYPE_MEMORY_BARRIER_2 = 1000314000, - VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2 = 1000314001, - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2 = 1000314002, - VK_STRUCTURE_TYPE_DEPENDENCY_INFO = 1000314003, - VK_STRUCTURE_TYPE_SUBMIT_INFO_2 = 1000314004, - VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO = 1000314005, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO = 1000314006, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES = 1000314007, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV = 1000314008, - VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV = 1000314009, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT = 1000316000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT = 1000316001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT = 1000316002, - VK_STRUCTURE_TYPE_DESCRIPTOR_ADDRESS_INFO_EXT = 1000316003, - VK_STRUCTURE_TYPE_DESCRIPTOR_GET_INFO_EXT = 1000316004, - VK_STRUCTURE_TYPE_BUFFER_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316005, - VK_STRUCTURE_TYPE_IMAGE_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316006, - VK_STRUCTURE_TYPE_IMAGE_VIEW_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316007, - VK_STRUCTURE_TYPE_SAMPLER_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316008, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316009, - VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT = 1000316010, - VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_INFO_EXT = 1000316011, - VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_PUSH_DESCRIPTOR_BUFFER_HANDLE_EXT = 1000316012, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT = 1000320000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT = 1000320001, - VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT = 1000320002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD = 1000321000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR = 1000322000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR = 1000323000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES = 1000325000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV = 1000326000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV = 1000326001, - VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV = 1000326002, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV = 1000327000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV = 1000327001, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV = 1000327002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT = 1000328000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT = 1000328001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT = 1000330000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT = 1000332000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT = 1000332001, - VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM = 1000333000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES = 1000335000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR = 1000336000, - VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2 = 1000337000, - VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2 = 1000337001, - VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2 = 1000337002, - VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2 = 1000337003, - VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2 = 1000337004, - VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2 = 1000337005, - VK_STRUCTURE_TYPE_BUFFER_COPY_2 = 1000337006, - VK_STRUCTURE_TYPE_IMAGE_COPY_2 = 1000337007, - VK_STRUCTURE_TYPE_IMAGE_BLIT_2 = 1000337008, - VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2 = 1000337009, - VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2 = 1000337010, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT = 1000338000, - VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT = 1000338001, - VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2 = 1000338002, - VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2 = 1000338003, - VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT = 1000338004, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT = 1000339000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT = 1000340000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT = 1000341000, - VK_STRUCTURE_TYPE_DEVICE_FAULT_COUNTS_EXT = 1000341001, - VK_STRUCTURE_TYPE_DEVICE_FAULT_INFO_EXT = 1000341002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT = 1000342000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT = 1000344000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR = 1000347000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR = 1000347001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR = 1000348013, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT = 1000351000, - VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT = 1000351002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT = 1000352000, - VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT = 1000352001, - VK_STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT = 1000352002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT = 1000354000, - VK_STRUCTURE_TYPE_DEVICE_ADDRESS_BINDING_CALLBACK_DATA_EXT = 1000354001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT = 1000355000, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT = 1000355001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT = 1000356000, - VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3 = 1000360000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT = 1000361000, - VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI = 1000369000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI = 1000369001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI = 1000369002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI = 1000370000, - VK_STRUCTURE_TYPE_PIPELINE_PROPERTIES_IDENTIFIER_EXT = 1000372000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT = 1000372001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT = 1000375000, - VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT = 1000375001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT = 1000376000, - VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT = 1000376001, - VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT = 1000376002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT = 1000377000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT = 1000381000, - VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT = 1000381001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT = 1000382000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR = 1000386000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES = 1000388000, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES = 1000388001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT = 1000391000, - VK_STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT = 1000391001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT = 1000392000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT = 1000392001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT = 1000393000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT = 1000395000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_PROPERTIES_EXT = 1000395001, - VK_STRUCTURE_TYPE_MICROMAP_BUILD_INFO_EXT = 1000396000, - VK_STRUCTURE_TYPE_MICROMAP_VERSION_INFO_EXT = 1000396001, - VK_STRUCTURE_TYPE_COPY_MICROMAP_INFO_EXT = 1000396002, - VK_STRUCTURE_TYPE_COPY_MICROMAP_TO_MEMORY_INFO_EXT = 1000396003, - VK_STRUCTURE_TYPE_COPY_MEMORY_TO_MICROMAP_INFO_EXT = 1000396004, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT = 1000396005, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT = 1000396006, - VK_STRUCTURE_TYPE_MICROMAP_CREATE_INFO_EXT = 1000396007, - VK_STRUCTURE_TYPE_MICROMAP_BUILD_SIZES_INFO_EXT = 1000396008, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_OPACITY_MICROMAP_EXT = 1000396009, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI = 1000404000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI = 1000404001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_VRS_FEATURES_HUAWEI = 1000404002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT = 1000411000, - VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT = 1000411001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT = 1000412000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES = 1000413000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES = 1000413001, - VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS = 1000413002, - VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS = 1000413003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM = 1000415000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES = 1000416000, - VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM = 1000417000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM = 1000417001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_PROPERTIES_ARM = 1000417002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT = 1000418000, - VK_STRUCTURE_TYPE_IMAGE_VIEW_SLICED_CREATE_INFO_EXT = 1000418001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE = 1000420000, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_BINDING_REFERENCE_VALVE = 1000420001, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_HOST_MAPPING_INFO_VALVE = 1000420002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT = 1000421000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT = 1000422000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_FEATURES_ARM = 1000424000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_PROPERTIES_ARM = 1000424001, - VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_BEGIN_INFO_ARM = 1000424002, - VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_INFO_ARM = 1000424003, - VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_SUBMIT_INFO_ARM = 1000424004, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM = 1000425000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM = 1000425001, - VK_STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM = 1000425002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV = 1000426000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_NV = 1000426001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV = 1000427000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV = 1000427001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV = 1000428000, - VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_INDIRECT_BUFFER_INFO_NV = 1000428001, - VK_STRUCTURE_TYPE_PIPELINE_INDIRECT_DEVICE_ADDRESS_INFO_NV = 1000428002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV = 1000430000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR = 1000434000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT = 1000437000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM = 1000440000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM = 1000440001, - VK_STRUCTURE_TYPE_IMAGE_VIEW_SAMPLE_WEIGHT_CREATE_INFO_QCOM = 1000440002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT = 1000451000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT = 1000451001, - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT = 1000453000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT = 1000455000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT = 1000455001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT = 1000458000, - VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_CONTROL_EXT = 1000458001, - VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_FEEDBACK_CREATE_INFO_EXT = 1000458002, - VK_STRUCTURE_TYPE_RENDER_PASS_SUBPASS_FEEDBACK_CREATE_INFO_EXT = 1000458003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT = 1000462000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT = 1000462001, - VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT = 1000462002, - VK_STRUCTURE_TYPE_SHADER_MODULE_IDENTIFIER_EXT = 1000462003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV = 1000464000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV = 1000464001, - VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV = 1000464002, - VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_PROPERTIES_NV = 1000464003, - VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_INFO_NV = 1000464004, - VK_STRUCTURE_TYPE_OPTICAL_FLOW_EXECUTE_INFO_NV = 1000464005, - VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_PRIVATE_DATA_INFO_NV = 1000464010, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT = 1000465000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES = 1000466000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES = 1000470000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES = 1000470001, - VK_STRUCTURE_TYPE_RENDERING_AREA_INFO = 1000470003, - VK_STRUCTURE_TYPE_DEVICE_IMAGE_SUBRESOURCE_INFO = 1000470004, - VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO = 1000470005, - VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO = 1000470006, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ANTI_LAG_FEATURES_AMD = 1000476000, - VK_STRUCTURE_TYPE_ANTI_LAG_DATA_AMD = 1000476001, - VK_STRUCTURE_TYPE_ANTI_LAG_PRESENTATION_INFO_AMD = 1000476002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR = 1000481000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT = 1000482000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT = 1000482001, - VK_STRUCTURE_TYPE_SHADER_CREATE_INFO_EXT = 1000482002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR = 1000483000, - VK_STRUCTURE_TYPE_PIPELINE_BINARY_CREATE_INFO_KHR = 1000483001, - VK_STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR = 1000483002, - VK_STRUCTURE_TYPE_PIPELINE_BINARY_KEY_KHR = 1000483003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_PROPERTIES_KHR = 1000483004, - VK_STRUCTURE_TYPE_RELEASE_CAPTURED_PIPELINE_DATA_INFO_KHR = 1000483005, - VK_STRUCTURE_TYPE_PIPELINE_BINARY_DATA_INFO_KHR = 1000483006, - VK_STRUCTURE_TYPE_PIPELINE_CREATE_INFO_KHR = 1000483007, - VK_STRUCTURE_TYPE_DEVICE_PIPELINE_BINARY_INTERNAL_CACHE_CONTROL_KHR = 1000483008, - VK_STRUCTURE_TYPE_PIPELINE_BINARY_HANDLES_INFO_KHR = 1000483009, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM = 1000484000, - VK_STRUCTURE_TYPE_TILE_PROPERTIES_QCOM = 1000484001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM = 1000488000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV = 1000490000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV = 1000490001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV = 1000492000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV = 1000492001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT = 1000495000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_PROPERTIES_EXT = 1000495001, - VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT = 1000496000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM = 1000497000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM = 1000497001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT = 1000498000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT = 1000499000, - VK_STRUCTURE_TYPE_LATENCY_SLEEP_MODE_INFO_NV = 1000505000, - VK_STRUCTURE_TYPE_LATENCY_SLEEP_INFO_NV = 1000505001, - VK_STRUCTURE_TYPE_SET_LATENCY_MARKER_INFO_NV = 1000505002, - VK_STRUCTURE_TYPE_GET_LATENCY_MARKER_INFO_NV = 1000505003, - VK_STRUCTURE_TYPE_LATENCY_TIMINGS_FRAME_REPORT_NV = 1000505004, - VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV = 1000505005, - VK_STRUCTURE_TYPE_OUT_OF_BAND_QUEUE_TYPE_INFO_NV = 1000505006, - VK_STRUCTURE_TYPE_SWAPCHAIN_LATENCY_CREATE_INFO_NV = 1000505007, - VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV = 1000505008, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR = 1000506000, - VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_KHR = 1000506001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR = 1000506002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM = 1000510000, - VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM = 1000510001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_PROPERTIES_KHR = 1000511000, - VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_CAPABILITIES_KHR = 1000512000, - VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PICTURE_INFO_KHR = 1000512001, - VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_KHR = 1000512003, - VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000512004, - VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_DPB_SLOT_INFO_KHR = 1000512005, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_CAPABILITIES_KHR = 1000513000, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000513001, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PICTURE_INFO_KHR = 1000513002, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_DPB_SLOT_INFO_KHR = 1000513003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_AV1_FEATURES_KHR = 1000513004, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PROFILE_INFO_KHR = 1000513005, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_RATE_CONTROL_INFO_KHR = 1000513006, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_RATE_CONTROL_LAYER_INFO_KHR = 1000513007, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUALITY_LEVEL_PROPERTIES_KHR = 1000513008, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_SESSION_CREATE_INFO_KHR = 1000513009, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_GOP_REMAINING_FRAME_INFO_KHR = 1000513010, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR = 1000515000, - VK_STRUCTURE_TYPE_VIDEO_INLINE_QUERY_INFO_KHR = 1000515001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PER_STAGE_DESCRIPTOR_SET_FEATURES_NV = 1000516000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM = 1000518000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM = 1000518001, - VK_STRUCTURE_TYPE_SAMPLER_BLOCK_MATCH_WINDOW_CREATE_INFO_QCOM = 1000518002, - VK_STRUCTURE_TYPE_SAMPLER_CUBIC_WEIGHTS_CREATE_INFO_QCOM = 1000519000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM = 1000519001, - VK_STRUCTURE_TYPE_BLIT_IMAGE_CUBIC_WEIGHTS_INFO_QCOM = 1000519002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM = 1000520000, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_YCBCR_DEGAMMA_CREATE_INFO_QCOM = 1000520001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM = 1000521000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT = 1000524000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES = 1000525000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES = 1000528000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT = 1000530000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES = 1000544000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES = 1000545000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES = 1000545001, - VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS = 1000545002, - VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO = 1000545003, - VK_STRUCTURE_TYPE_PUSH_CONSTANTS_INFO = 1000545004, - VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO = 1000545005, - VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO = 1000545006, - VK_STRUCTURE_TYPE_SET_DESCRIPTOR_BUFFER_OFFSETS_INFO_EXT = 1000545007, - VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_BUFFER_EMBEDDED_SAMPLERS_INFO_EXT = 1000545008, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV = 1000546000, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_CAPABILITIES_KHR = 1000553000, - VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR = 1000553001, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_INFO_KHR = 1000553002, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUANTIZATION_MAP_CAPABILITIES_KHR = 1000553003, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUANTIZATION_MAP_CAPABILITIES_KHR = 1000553004, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000553005, - VK_STRUCTURE_TYPE_VIDEO_FORMAT_H265_QUANTIZATION_MAP_PROPERTIES_KHR = 1000553006, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUANTIZATION_MAP_CAPABILITIES_KHR = 1000553007, - VK_STRUCTURE_TYPE_VIDEO_FORMAT_AV1_QUANTIZATION_MAP_PROPERTIES_KHR = 1000553008, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUANTIZATION_MAP_FEATURES_KHR = 1000553009, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAW_ACCESS_CHAINS_FEATURES_NV = 1000555000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR = 1000558000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMMAND_BUFFER_INHERITANCE_FEATURES_NV = 1000559000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT16_VECTOR_FEATURES_NV = 1000563000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_REPLICATED_COMPOSITES_FEATURES_EXT = 1000564000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_VALIDATION_FEATURES_NV = 1000568000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_EXT = 1000572000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_EXT = 1000572001, - VK_STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_EXT = 1000572002, - VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_CREATE_INFO_EXT = 1000572003, - VK_STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_EXT = 1000572004, - VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_EXT = 1000572006, - VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_EXT = 1000572007, - VK_STRUCTURE_TYPE_WRITE_INDIRECT_EXECUTION_SET_PIPELINE_EXT = 1000572008, - VK_STRUCTURE_TYPE_WRITE_INDIRECT_EXECUTION_SET_SHADER_EXT = 1000572009, - VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_PIPELINE_INFO_EXT = 1000572010, - VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_SHADER_INFO_EXT = 1000572011, - VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_SHADER_LAYOUT_INFO_EXT = 1000572012, - VK_STRUCTURE_TYPE_GENERATED_COMMANDS_PIPELINE_INFO_EXT = 1000572013, - VK_STRUCTURE_TYPE_GENERATED_COMMANDS_SHADER_INFO_EXT = 1000572014, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_FEATURES_MESA = 1000575000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_PROPERTIES_MESA = 1000575001, - VK_STRUCTURE_TYPE_IMAGE_ALIGNMENT_CONTROL_CREATE_INFO_MESA = 1000575002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_CONTROL_FEATURES_EXT = 1000582000, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLAMP_CONTROL_CREATE_INFO_EXT = 1000582001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HDR_VIVID_FEATURES_HUAWEI = 1000590000, - VK_STRUCTURE_TYPE_HDR_VIVID_DYNAMIC_METADATA_HUAWEI = 1000590001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_FEATURES_NV = 1000593000, - VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_FLEXIBLE_DIMENSIONS_PROPERTIES_NV = 1000593001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_PROPERTIES_NV = 1000593002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_ROBUSTNESS_FEATURES_EXT = 1000608000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES, - VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, - VK_STRUCTURE_TYPE_RENDERING_INFO_KHR = VK_STRUCTURE_TYPE_RENDERING_INFO, - VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO, - VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO, - VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, - VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2, - VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2, - VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2, - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHR = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO, - VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO, - VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO, - VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO, - VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO, - VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO_KHR = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES, - VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES, - VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO, - VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHR = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO, - VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHR = VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES, - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO, - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO, - VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO, - VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHR = VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES, - VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES, - VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES, - VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO, - VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO_KHR = VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO, - VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO, - VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2_KHR = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, - VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2_KHR = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, - VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2_KHR = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, - VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2_KHR = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, - VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, - VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO_KHR = VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO, - VK_STRUCTURE_TYPE_SUBPASS_END_INFO_KHR = VK_STRUCTURE_TYPE_SUBPASS_END_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO, - VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES_KHR = VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES, - VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES, - VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO, - VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO, - VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES_KHR, - VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS, - VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES, - VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES, - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK, - VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO, - VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2, - VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2, - VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2_KHR = VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2, - VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, - VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2_KHR = VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2, - VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO, - VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_NV = VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO, - VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO_KHR = VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO, - VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO_KHR = VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES_KHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES, - VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT_KHR = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT, - VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES, - VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT = VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_KHR, - VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR = VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES, - VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES, - VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES, - VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES, - VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO, - VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO_KHR = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO, - VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO_KHR = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, - VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO_KHR = VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO, - VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO_INTEL = VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES, - VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES, - VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO_KHR = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO, - VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO_KHR = VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES, - VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT_KHR = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT, - VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT_KHR = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT, - VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT = VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES, - VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES, - VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_KHR = VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO, - VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO, - VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO_KHR = VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO, - VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES, - VK_STRUCTURE_TYPE_MEMORY_TO_IMAGE_COPY_EXT = VK_STRUCTURE_TYPE_MEMORY_TO_IMAGE_COPY, - VK_STRUCTURE_TYPE_IMAGE_TO_MEMORY_COPY_EXT = VK_STRUCTURE_TYPE_IMAGE_TO_MEMORY_COPY, - VK_STRUCTURE_TYPE_COPY_IMAGE_TO_MEMORY_INFO_EXT = VK_STRUCTURE_TYPE_COPY_IMAGE_TO_MEMORY_INFO, - VK_STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INFO_EXT = VK_STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INFO, - VK_STRUCTURE_TYPE_HOST_IMAGE_LAYOUT_TRANSITION_INFO_EXT = VK_STRUCTURE_TYPE_HOST_IMAGE_LAYOUT_TRANSITION_INFO, - VK_STRUCTURE_TYPE_COPY_IMAGE_TO_IMAGE_INFO_EXT = VK_STRUCTURE_TYPE_COPY_IMAGE_TO_IMAGE_INFO, - VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE_EXT = VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE, - VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY_EXT = VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY, - VK_STRUCTURE_TYPE_MEMORY_MAP_INFO_KHR = VK_STRUCTURE_TYPE_MEMORY_MAP_INFO, - VK_STRUCTURE_TYPE_MEMORY_UNMAP_INFO_KHR = VK_STRUCTURE_TYPE_MEMORY_UNMAP_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES, - VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO, - VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES, - VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2_KHR = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2, - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2_KHR = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, - VK_STRUCTURE_TYPE_DEPENDENCY_INFO_KHR = VK_STRUCTURE_TYPE_DEPENDENCY_INFO, - VK_STRUCTURE_TYPE_SUBMIT_INFO_2_KHR = VK_STRUCTURE_TYPE_SUBMIT_INFO_2, - VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO_KHR = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO_KHR = VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES, - VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2_KHR = VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2, - VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2_KHR = VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2, - VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2_KHR = VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2, - VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR = VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2, - VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2_KHR = VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2, - VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2_KHR = VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2, - VK_STRUCTURE_TYPE_BUFFER_COPY_2_KHR = VK_STRUCTURE_TYPE_BUFFER_COPY_2, - VK_STRUCTURE_TYPE_IMAGE_COPY_2_KHR = VK_STRUCTURE_TYPE_IMAGE_COPY_2, - VK_STRUCTURE_TYPE_IMAGE_BLIT_2_KHR = VK_STRUCTURE_TYPE_IMAGE_BLIT_2, - VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2_KHR = VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2, - VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2_KHR = VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2, - VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2_EXT = VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2, - VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2_EXT = VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_ARM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT, - VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE = VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT, - VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3, - VK_STRUCTURE_TYPE_PIPELINE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT = VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES, - VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHR = VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS, - VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHR = VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES, - VK_STRUCTURE_TYPE_RENDERING_AREA_INFO_KHR = VK_STRUCTURE_TYPE_RENDERING_AREA_INFO, - VK_STRUCTURE_TYPE_DEVICE_IMAGE_SUBRESOURCE_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_IMAGE_SUBRESOURCE_INFO, - VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2_KHR = VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2, - VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2_KHR = VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2, - VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO, - VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO, - VK_STRUCTURE_TYPE_SHADER_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES, - VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES, - VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS_KHR = VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS, - VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO_KHR = VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO, - VK_STRUCTURE_TYPE_PUSH_CONSTANTS_INFO_KHR = VK_STRUCTURE_TYPE_PUSH_CONSTANTS_INFO, - VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO_KHR = VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO, - VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO_KHR = VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO, - VK_STRUCTURE_TYPE_MAX_ENUM = 0x7fffffff, -} VkStructureType; - -typedef enum VkSubgroupFeatureFlagBits -{ - VK_SUBGROUP_FEATURE_BASIC_BIT = 0x00000001, - VK_SUBGROUP_FEATURE_VOTE_BIT = 0x00000002, - VK_SUBGROUP_FEATURE_ARITHMETIC_BIT = 0x00000004, - VK_SUBGROUP_FEATURE_BALLOT_BIT = 0x00000008, - VK_SUBGROUP_FEATURE_SHUFFLE_BIT = 0x00000010, - VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT = 0x00000020, - VK_SUBGROUP_FEATURE_CLUSTERED_BIT = 0x00000040, - VK_SUBGROUP_FEATURE_QUAD_BIT = 0x00000080, - VK_SUBGROUP_FEATURE_PARTITIONED_BIT_NV = 0x00000100, - VK_SUBGROUP_FEATURE_ROTATE_BIT = 0x00000200, - VK_SUBGROUP_FEATURE_ROTATE_CLUSTERED_BIT = 0x00000400, - VK_SUBGROUP_FEATURE_ROTATE_BIT_KHR = VK_SUBGROUP_FEATURE_ROTATE_BIT, - VK_SUBGROUP_FEATURE_ROTATE_CLUSTERED_BIT_KHR = VK_SUBGROUP_FEATURE_ROTATE_CLUSTERED_BIT, - VK_SUBGROUP_FEATURE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkSubgroupFeatureFlagBits; - -typedef enum VkSubmitFlagBits -{ - VK_SUBMIT_PROTECTED_BIT = 0x00000001, - VK_SUBMIT_PROTECTED_BIT_KHR = VK_SUBMIT_PROTECTED_BIT, - VK_SUBMIT_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkSubmitFlagBits; -typedef VkSubmitFlagBits VkSubmitFlagBitsKHR; - -typedef enum VkSubpassContents -{ - VK_SUBPASS_CONTENTS_INLINE = 0, - VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1, - VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_KHR = 1000451000, - VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_EXT = VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_KHR, - VK_SUBPASS_CONTENTS_MAX_ENUM = 0x7fffffff, -} VkSubpassContents; - -typedef enum VkSubpassDescriptionFlagBits -{ - VK_SUBPASS_DESCRIPTION_FRAGMENT_REGION_BIT_QCOM = 0x00000004, - VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM = 0x00000008, - VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_COLOR_ACCESS_BIT_EXT = 0x00000010, - VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT = 0x00000020, - VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT = 0x00000040, - VK_SUBPASS_DESCRIPTION_ENABLE_LEGACY_DITHERING_BIT_EXT = 0x00000080, - VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_COLOR_ACCESS_BIT_ARM = VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_COLOR_ACCESS_BIT_EXT, - VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_ARM = VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT, - VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_ARM = VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT, - VK_SUBPASS_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkSubpassDescriptionFlagBits; - -typedef enum VkSubpassMergeStatusEXT -{ - VK_SUBPASS_MERGE_STATUS_MERGED_EXT = 0, - VK_SUBPASS_MERGE_STATUS_DISALLOWED_EXT = 1, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_SIDE_EFFECTS_EXT = 2, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_SAMPLES_MISMATCH_EXT = 3, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_VIEWS_MISMATCH_EXT = 4, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_ALIASING_EXT = 5, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_DEPENDENCIES_EXT = 6, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_INCOMPATIBLE_INPUT_ATTACHMENT_EXT = 7, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_TOO_MANY_ATTACHMENTS_EXT = 8, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_INSUFFICIENT_STORAGE_EXT = 9, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_DEPTH_STENCIL_COUNT_EXT = 10, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_RESOLVE_ATTACHMENT_REUSE_EXT = 11, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_SINGLE_SUBPASS_EXT = 12, - VK_SUBPASS_MERGE_STATUS_NOT_MERGED_UNSPECIFIED_EXT = 13, - VK_SUBPASS_MERGE_STATUS_EXT_MAX_ENUM = 0x7fffffff, -} VkSubpassMergeStatusEXT; - -typedef enum VkSurfaceTransformFlagBitsKHR -{ - VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001, - VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002, - VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004, - VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080, - VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100, - VK_SURFACE_TRANSFORM_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkSurfaceTransformFlagBitsKHR; - -typedef enum VkSwapchainCreateFlagBitsKHR -{ - VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = 0x00000001, - VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR = 0x00000002, - VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR = 0x00000004, - VK_SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT = 0x00000008, - VK_SWAPCHAIN_CREATE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkSwapchainCreateFlagBitsKHR; - -typedef enum VkSystemAllocationScope -{ - VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0, - VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 1, - VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 2, - VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 3, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 4, - VK_SYSTEM_ALLOCATION_SCOPE_MAX_ENUM = 0x7fffffff, -} VkSystemAllocationScope; - -typedef enum VkTessellationDomainOrigin -{ - VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT = 0, - VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT = 1, - VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT_KHR = VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT, - VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT_KHR = VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT, - VK_TESSELLATION_DOMAIN_ORIGIN_MAX_ENUM = 0x7fffffff, -} VkTessellationDomainOrigin; -typedef VkTessellationDomainOrigin VkTessellationDomainOriginKHR; - -typedef enum VkTimeDomainKHR -{ - VK_TIME_DOMAIN_DEVICE_KHR = 0, - VK_TIME_DOMAIN_CLOCK_MONOTONIC_KHR = 1, - VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR = 2, - VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR = 3, - VK_TIME_DOMAIN_DEVICE_EXT = VK_TIME_DOMAIN_DEVICE_KHR, - VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT = VK_TIME_DOMAIN_CLOCK_MONOTONIC_KHR, - VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT = VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR, - VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT = VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR, - VK_TIME_DOMAIN_KHR_MAX_ENUM = 0x7fffffff, -} VkTimeDomainKHR; -typedef VkTimeDomainKHR VkTimeDomainEXT; - -typedef enum VkToolPurposeFlagBits -{ - VK_TOOL_PURPOSE_VALIDATION_BIT = 0x00000001, - VK_TOOL_PURPOSE_PROFILING_BIT = 0x00000002, - VK_TOOL_PURPOSE_TRACING_BIT = 0x00000004, - VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT = 0x00000008, - VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT = 0x00000010, - VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT = 0x00000020, - VK_TOOL_PURPOSE_DEBUG_MARKERS_BIT_EXT = 0x00000040, - VK_TOOL_PURPOSE_VALIDATION_BIT_EXT = VK_TOOL_PURPOSE_VALIDATION_BIT, - VK_TOOL_PURPOSE_PROFILING_BIT_EXT = VK_TOOL_PURPOSE_PROFILING_BIT, - VK_TOOL_PURPOSE_TRACING_BIT_EXT = VK_TOOL_PURPOSE_TRACING_BIT, - VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT_EXT = VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT, - VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT_EXT = VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT, - VK_TOOL_PURPOSE_FLAG_BITS_MAX_ENUM = 0x7fffffff, -} VkToolPurposeFlagBits; -typedef VkToolPurposeFlagBits VkToolPurposeFlagBitsEXT; - -typedef enum VkValidationCacheHeaderVersionEXT -{ - VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT = 1, - VK_VALIDATION_CACHE_HEADER_VERSION_EXT_MAX_ENUM = 0x7fffffff, -} VkValidationCacheHeaderVersionEXT; - -typedef enum VkValidationCheckEXT -{ - VK_VALIDATION_CHECK_ALL_EXT = 0, - VK_VALIDATION_CHECK_SHADERS_EXT = 1, - VK_VALIDATION_CHECK_EXT_MAX_ENUM = 0x7fffffff, -} VkValidationCheckEXT; - -typedef enum VkValidationFeatureDisableEXT -{ - VK_VALIDATION_FEATURE_DISABLE_ALL_EXT = 0, - VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT = 1, - VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT = 2, - VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT = 3, - VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT = 4, - VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT = 5, - VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT = 6, - VK_VALIDATION_FEATURE_DISABLE_SHADER_VALIDATION_CACHE_EXT = 7, - VK_VALIDATION_FEATURE_DISABLE_EXT_MAX_ENUM = 0x7fffffff, -} VkValidationFeatureDisableEXT; - -typedef enum VkValidationFeatureEnableEXT -{ - VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT = 0, - VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT = 1, - VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT = 2, - VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT = 3, - VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT = 4, - VK_VALIDATION_FEATURE_ENABLE_EXT_MAX_ENUM = 0x7fffffff, -} VkValidationFeatureEnableEXT; - -typedef enum VkVendorId -{ - VK_VENDOR_ID_KHRONOS = 0x00010000, - VK_VENDOR_ID_VIV = 0x00010001, - VK_VENDOR_ID_VSI = 0x00010002, - VK_VENDOR_ID_KAZAN = 0x00010003, - VK_VENDOR_ID_CODEPLAY = 0x00010004, - VK_VENDOR_ID_MESA = 0x00010005, - VK_VENDOR_ID_POCL = 0x00010006, - VK_VENDOR_ID_MOBILEYE = 0x00010007, - VK_VENDOR_ID_MAX_ENUM = 0x7fffffff, -} VkVendorId; - -typedef enum VkVertexInputRate -{ - VK_VERTEX_INPUT_RATE_VERTEX = 0, - VK_VERTEX_INPUT_RATE_INSTANCE = 1, - VK_VERTEX_INPUT_RATE_MAX_ENUM = 0x7fffffff, -} VkVertexInputRate; - -typedef enum VkVideoCapabilityFlagBitsKHR -{ - VK_VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR = 0x00000001, - VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR = 0x00000002, - VK_VIDEO_CAPABILITY_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoCapabilityFlagBitsKHR; - -typedef enum VkVideoChromaSubsamplingFlagBitsKHR -{ - VK_VIDEO_CHROMA_SUBSAMPLING_INVALID_KHR = 0, - VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR = 0x00000001, - VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR = 0x00000002, - VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR = 0x00000004, - VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR = 0x00000008, - VK_VIDEO_CHROMA_SUBSAMPLING_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoChromaSubsamplingFlagBitsKHR; - -typedef enum VkVideoCodecOperationFlagBitsKHR -{ - VK_VIDEO_CODEC_OPERATION_NONE_KHR = 0, - VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR = 0x00000001, - VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR = 0x00000002, - VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR = 0x00000004, - VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR = 0x00010000, - VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR = 0x00020000, - VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR = 0x00040000, - VK_VIDEO_CODEC_OPERATION_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoCodecOperationFlagBitsKHR; - -typedef enum VkVideoCodingControlFlagBitsKHR -{ - VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR = 0x00000001, - VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_BIT_KHR = 0x00000002, - VK_VIDEO_CODING_CONTROL_ENCODE_QUALITY_LEVEL_BIT_KHR = 0x00000004, - VK_VIDEO_CODING_CONTROL_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoCodingControlFlagBitsKHR; - -typedef enum VkVideoComponentBitDepthFlagBitsKHR -{ - VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR = 0, - VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR = 0x00000001, - VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR = 0x00000004, - VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR = 0x00000010, - VK_VIDEO_COMPONENT_BIT_DEPTH_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoComponentBitDepthFlagBitsKHR; - -typedef enum VkVideoDecodeCapabilityFlagBitsKHR -{ - VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR = 0x00000001, - VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR = 0x00000002, - VK_VIDEO_DECODE_CAPABILITY_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoDecodeCapabilityFlagBitsKHR; - -typedef enum VkVideoDecodeH264PictureLayoutFlagBitsKHR -{ - VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR = 0, - VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR = 0x00000001, - VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR = 0x00000002, - VK_VIDEO_DECODE_H2_64_PICTURE_LAYOUT_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoDecodeH264PictureLayoutFlagBitsKHR; - -typedef enum VkVideoDecodeUsageFlagBitsKHR -{ - VK_VIDEO_DECODE_USAGE_DEFAULT_KHR = 0, - VK_VIDEO_DECODE_USAGE_TRANSCODING_BIT_KHR = 0x00000001, - VK_VIDEO_DECODE_USAGE_OFFLINE_BIT_KHR = 0x00000002, - VK_VIDEO_DECODE_USAGE_STREAMING_BIT_KHR = 0x00000004, - VK_VIDEO_DECODE_USAGE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoDecodeUsageFlagBitsKHR; - -typedef enum VkVideoEncodeAV1CapabilityFlagBitsKHR -{ - VK_VIDEO_ENCODE_AV1_CAPABILITY_PER_RATE_CONTROL_GROUP_MIN_MAX_Q_INDEX_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_AV1_CAPABILITY_GENERATE_OBU_EXTENSION_HEADER_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_AV1_CAPABILITY_PRIMARY_REFERENCE_CDF_ONLY_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_AV1_CAPABILITY_FRAME_SIZE_OVERRIDE_BIT_KHR = 0x00000008, - VK_VIDEO_ENCODE_AV1_CAPABILITY_MOTION_VECTOR_SCALING_BIT_KHR = 0x00000010, - VK_VIDEO_ENCODE_AV1_CAPABILITY_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeAV1CapabilityFlagBitsKHR; - -typedef enum VkVideoEncodeAV1PredictionModeKHR -{ - VK_VIDEO_ENCODE_AV1_PREDICTION_MODE_INTRA_ONLY_KHR = 0, - VK_VIDEO_ENCODE_AV1_PREDICTION_MODE_SINGLE_REFERENCE_KHR = 1, - VK_VIDEO_ENCODE_AV1_PREDICTION_MODE_UNIDIRECTIONAL_COMPOUND_KHR = 2, - VK_VIDEO_ENCODE_AV1_PREDICTION_MODE_BIDIRECTIONAL_COMPOUND_KHR = 3, - VK_VIDEO_ENCODE_AV1_PREDICTION_MODE_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeAV1PredictionModeKHR; - -typedef enum VkVideoEncodeAV1RateControlFlagBitsKHR -{ - VK_VIDEO_ENCODE_AV1_RATE_CONTROL_REGULAR_GOP_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_AV1_RATE_CONTROL_TEMPORAL_LAYER_PATTERN_DYADIC_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_AV1_RATE_CONTROL_REFERENCE_PATTERN_FLAT_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_AV1_RATE_CONTROL_REFERENCE_PATTERN_DYADIC_BIT_KHR = 0x00000008, - VK_VIDEO_ENCODE_AV1_RATE_CONTROL_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeAV1RateControlFlagBitsKHR; - -typedef enum VkVideoEncodeAV1RateControlGroupKHR -{ - VK_VIDEO_ENCODE_AV1_RATE_CONTROL_GROUP_INTRA_KHR = 0, - VK_VIDEO_ENCODE_AV1_RATE_CONTROL_GROUP_PREDICTIVE_KHR = 1, - VK_VIDEO_ENCODE_AV1_RATE_CONTROL_GROUP_BIPREDICTIVE_KHR = 2, - VK_VIDEO_ENCODE_AV1_RATE_CONTROL_GROUP_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeAV1RateControlGroupKHR; - -typedef enum VkVideoEncodeAV1StdFlagBitsKHR -{ - VK_VIDEO_ENCODE_AV1_STD_UNIFORM_TILE_SPACING_FLAG_SET_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_AV1_STD_SKIP_MODE_PRESENT_UNSET_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_AV1_STD_PRIMARY_REF_FRAME_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_AV1_STD_DELTA_Q_BIT_KHR = 0x00000008, - VK_VIDEO_ENCODE_AV1_STD_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeAV1StdFlagBitsKHR; - -typedef enum VkVideoEncodeAV1SuperblockSizeFlagBitsKHR -{ - VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_64_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_128_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeAV1SuperblockSizeFlagBitsKHR; - -typedef enum VkVideoEncodeCapabilityFlagBitsKHR -{ - VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_CAPABILITY_INSUFFICIENT_BITSTREAM_BUFFER_RANGE_DETECTION_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_CAPABILITY_QUANTIZATION_DELTA_MAP_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_CAPABILITY_EMPHASIS_MAP_BIT_KHR = 0x00000008, - VK_VIDEO_ENCODE_CAPABILITY_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeCapabilityFlagBitsKHR; - -typedef enum VkVideoEncodeContentFlagBitsKHR -{ - VK_VIDEO_ENCODE_CONTENT_DEFAULT_KHR = 0, - VK_VIDEO_ENCODE_CONTENT_CAMERA_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_CONTENT_DESKTOP_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_CONTENT_RENDERED_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_CONTENT_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeContentFlagBitsKHR; - -typedef enum VkVideoEncodeFeedbackFlagBitsKHR -{ - VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_HAS_OVERRIDES_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_FEEDBACK_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeFeedbackFlagBitsKHR; - -typedef enum VkVideoEncodeFlagBitsKHR -{ - VK_VIDEO_ENCODE_WITH_QUANTIZATION_DELTA_MAP_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_WITH_EMPHASIS_MAP_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeFlagBitsKHR; - -typedef enum VkVideoEncodeH264CapabilityFlagBitsKHR -{ - VK_VIDEO_ENCODE_H264_CAPABILITY_HRD_COMPLIANCE_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_H264_CAPABILITY_PREDICTION_WEIGHT_TABLE_GENERATED_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_H264_CAPABILITY_ROW_UNALIGNED_SLICE_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_H264_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_KHR = 0x00000008, - VK_VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L0_LIST_BIT_KHR = 0x00000010, - VK_VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_KHR = 0x00000020, - VK_VIDEO_ENCODE_H264_CAPABILITY_PER_PICTURE_TYPE_MIN_MAX_QP_BIT_KHR = 0x00000040, - VK_VIDEO_ENCODE_H264_CAPABILITY_PER_SLICE_CONSTANT_QP_BIT_KHR = 0x00000080, - VK_VIDEO_ENCODE_H264_CAPABILITY_GENERATE_PREFIX_NALU_BIT_KHR = 0x00000100, - VK_VIDEO_ENCODE_H264_CAPABILITY_MB_QP_DIFF_WRAPAROUND_BIT_KHR = 0x00000200, - VK_VIDEO_ENCODE_H2_64_CAPABILITY_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeH264CapabilityFlagBitsKHR; - -typedef enum VkVideoEncodeH264RateControlFlagBitsKHR -{ - VK_VIDEO_ENCODE_H264_RATE_CONTROL_ATTEMPT_HRD_COMPLIANCE_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_H264_RATE_CONTROL_REGULAR_GOP_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_H264_RATE_CONTROL_REFERENCE_PATTERN_FLAT_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_H264_RATE_CONTROL_REFERENCE_PATTERN_DYADIC_BIT_KHR = 0x00000008, - VK_VIDEO_ENCODE_H264_RATE_CONTROL_TEMPORAL_LAYER_PATTERN_DYADIC_BIT_KHR = 0x00000010, - VK_VIDEO_ENCODE_H2_64_RATE_CONTROL_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeH264RateControlFlagBitsKHR; - -typedef enum VkVideoEncodeH264StdFlagBitsKHR -{ - VK_VIDEO_ENCODE_H264_STD_SEPARATE_COLOR_PLANE_FLAG_SET_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_H264_STD_QPPRIME_Y_ZERO_TRANSFORM_BYPASS_FLAG_SET_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_H264_STD_SCALING_MATRIX_PRESENT_FLAG_SET_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_H264_STD_CHROMA_QP_INDEX_OFFSET_BIT_KHR = 0x00000008, - VK_VIDEO_ENCODE_H264_STD_SECOND_CHROMA_QP_INDEX_OFFSET_BIT_KHR = 0x00000010, - VK_VIDEO_ENCODE_H264_STD_PIC_INIT_QP_MINUS26_BIT_KHR = 0x00000020, - VK_VIDEO_ENCODE_H264_STD_WEIGHTED_PRED_FLAG_SET_BIT_KHR = 0x00000040, - VK_VIDEO_ENCODE_H264_STD_WEIGHTED_BIPRED_IDC_EXPLICIT_BIT_KHR = 0x00000080, - VK_VIDEO_ENCODE_H264_STD_WEIGHTED_BIPRED_IDC_IMPLICIT_BIT_KHR = 0x00000100, - VK_VIDEO_ENCODE_H264_STD_TRANSFORM_8X8_MODE_FLAG_SET_BIT_KHR = 0x00000200, - VK_VIDEO_ENCODE_H264_STD_DIRECT_SPATIAL_MV_PRED_FLAG_UNSET_BIT_KHR = 0x00000400, - VK_VIDEO_ENCODE_H264_STD_ENTROPY_CODING_MODE_FLAG_UNSET_BIT_KHR = 0x00000800, - VK_VIDEO_ENCODE_H264_STD_ENTROPY_CODING_MODE_FLAG_SET_BIT_KHR = 0x00001000, - VK_VIDEO_ENCODE_H264_STD_DIRECT_8X8_INFERENCE_FLAG_UNSET_BIT_KHR = 0x00002000, - VK_VIDEO_ENCODE_H264_STD_CONSTRAINED_INTRA_PRED_FLAG_SET_BIT_KHR = 0x00004000, - VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_DISABLED_BIT_KHR = 0x00008000, - VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_ENABLED_BIT_KHR = 0x00010000, - VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_PARTIAL_BIT_KHR = 0x00020000, - VK_VIDEO_ENCODE_H264_STD_SLICE_QP_DELTA_BIT_KHR = 0x00080000, - VK_VIDEO_ENCODE_H264_STD_DIFFERENT_SLICE_QP_DELTA_BIT_KHR = 0x00100000, - VK_VIDEO_ENCODE_H2_64_STD_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeH264StdFlagBitsKHR; - -typedef enum VkVideoEncodeH265CapabilityFlagBitsKHR -{ - VK_VIDEO_ENCODE_H265_CAPABILITY_HRD_COMPLIANCE_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_H265_CAPABILITY_PREDICTION_WEIGHT_TABLE_GENERATED_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_H265_CAPABILITY_ROW_UNALIGNED_SLICE_SEGMENT_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_SLICE_SEGMENT_TYPE_BIT_KHR = 0x00000008, - VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L0_LIST_BIT_KHR = 0x00000010, - VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_KHR = 0x00000020, - VK_VIDEO_ENCODE_H265_CAPABILITY_PER_PICTURE_TYPE_MIN_MAX_QP_BIT_KHR = 0x00000040, - VK_VIDEO_ENCODE_H265_CAPABILITY_PER_SLICE_SEGMENT_CONSTANT_QP_BIT_KHR = 0x00000080, - VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILES_PER_SLICE_SEGMENT_BIT_KHR = 0x00000100, - VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_SLICE_SEGMENTS_PER_TILE_BIT_KHR = 0x00000200, - VK_VIDEO_ENCODE_H265_CAPABILITY_CU_QP_DIFF_WRAPAROUND_BIT_KHR = 0x00000400, - VK_VIDEO_ENCODE_H2_65_CAPABILITY_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeH265CapabilityFlagBitsKHR; - -typedef enum VkVideoEncodeH265CtbSizeFlagBitsKHR -{ - VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_H2_65_CTB_SIZE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeH265CtbSizeFlagBitsKHR; - -typedef enum VkVideoEncodeH265RateControlFlagBitsKHR -{ - VK_VIDEO_ENCODE_H265_RATE_CONTROL_ATTEMPT_HRD_COMPLIANCE_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_H265_RATE_CONTROL_REGULAR_GOP_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_H265_RATE_CONTROL_REFERENCE_PATTERN_FLAT_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_H265_RATE_CONTROL_REFERENCE_PATTERN_DYADIC_BIT_KHR = 0x00000008, - VK_VIDEO_ENCODE_H265_RATE_CONTROL_TEMPORAL_SUB_LAYER_PATTERN_DYADIC_BIT_KHR = 0x00000010, - VK_VIDEO_ENCODE_H2_65_RATE_CONTROL_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeH265RateControlFlagBitsKHR; - -typedef enum VkVideoEncodeH265StdFlagBitsKHR -{ - VK_VIDEO_ENCODE_H265_STD_SEPARATE_COLOR_PLANE_FLAG_SET_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_H265_STD_SAMPLE_ADAPTIVE_OFFSET_ENABLED_FLAG_SET_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_H265_STD_SCALING_LIST_DATA_PRESENT_FLAG_SET_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_H265_STD_PCM_ENABLED_FLAG_SET_BIT_KHR = 0x00000008, - VK_VIDEO_ENCODE_H265_STD_SPS_TEMPORAL_MVP_ENABLED_FLAG_SET_BIT_KHR = 0x00000010, - VK_VIDEO_ENCODE_H265_STD_INIT_QP_MINUS26_BIT_KHR = 0x00000020, - VK_VIDEO_ENCODE_H265_STD_WEIGHTED_PRED_FLAG_SET_BIT_KHR = 0x00000040, - VK_VIDEO_ENCODE_H265_STD_WEIGHTED_BIPRED_FLAG_SET_BIT_KHR = 0x00000080, - VK_VIDEO_ENCODE_H265_STD_LOG2_PARALLEL_MERGE_LEVEL_MINUS2_BIT_KHR = 0x00000100, - VK_VIDEO_ENCODE_H265_STD_SIGN_DATA_HIDING_ENABLED_FLAG_SET_BIT_KHR = 0x00000200, - VK_VIDEO_ENCODE_H265_STD_TRANSFORM_SKIP_ENABLED_FLAG_SET_BIT_KHR = 0x00000400, - VK_VIDEO_ENCODE_H265_STD_TRANSFORM_SKIP_ENABLED_FLAG_UNSET_BIT_KHR = 0x00000800, - VK_VIDEO_ENCODE_H265_STD_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT_FLAG_SET_BIT_KHR = 0x00001000, - VK_VIDEO_ENCODE_H265_STD_TRANSQUANT_BYPASS_ENABLED_FLAG_SET_BIT_KHR = 0x00002000, - VK_VIDEO_ENCODE_H265_STD_CONSTRAINED_INTRA_PRED_FLAG_SET_BIT_KHR = 0x00004000, - VK_VIDEO_ENCODE_H265_STD_ENTROPY_CODING_SYNC_ENABLED_FLAG_SET_BIT_KHR = 0x00008000, - VK_VIDEO_ENCODE_H265_STD_DEBLOCKING_FILTER_OVERRIDE_ENABLED_FLAG_SET_BIT_KHR = 0x00010000, - VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENTS_ENABLED_FLAG_SET_BIT_KHR = 0x00020000, - VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENT_FLAG_SET_BIT_KHR = 0x00040000, - VK_VIDEO_ENCODE_H265_STD_SLICE_QP_DELTA_BIT_KHR = 0x00080000, - VK_VIDEO_ENCODE_H265_STD_DIFFERENT_SLICE_QP_DELTA_BIT_KHR = 0x00100000, - VK_VIDEO_ENCODE_H2_65_STD_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeH265StdFlagBitsKHR; - -typedef enum VkVideoEncodeH265TransformBlockSizeFlagBitsKHR -{ - VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_4_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_8_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_16_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_32_BIT_KHR = 0x00000008, - VK_VIDEO_ENCODE_H2_65_TRANSFORM_BLOCK_SIZE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeH265TransformBlockSizeFlagBitsKHR; - -typedef enum VkVideoEncodeRateControlModeFlagBitsKHR -{ - VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DEFAULT_KHR = 0, - VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_RATE_CONTROL_MODE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeRateControlModeFlagBitsKHR; - -typedef enum VkVideoEncodeTuningModeKHR -{ - VK_VIDEO_ENCODE_TUNING_MODE_DEFAULT_KHR = 0, - VK_VIDEO_ENCODE_TUNING_MODE_HIGH_QUALITY_KHR = 1, - VK_VIDEO_ENCODE_TUNING_MODE_LOW_LATENCY_KHR = 2, - VK_VIDEO_ENCODE_TUNING_MODE_ULTRA_LOW_LATENCY_KHR = 3, - VK_VIDEO_ENCODE_TUNING_MODE_LOSSLESS_KHR = 4, - VK_VIDEO_ENCODE_TUNING_MODE_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeTuningModeKHR; - -typedef enum VkVideoEncodeUsageFlagBitsKHR -{ - VK_VIDEO_ENCODE_USAGE_DEFAULT_KHR = 0, - VK_VIDEO_ENCODE_USAGE_TRANSCODING_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_USAGE_STREAMING_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_USAGE_RECORDING_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_USAGE_CONFERENCING_BIT_KHR = 0x00000008, - VK_VIDEO_ENCODE_USAGE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoEncodeUsageFlagBitsKHR; - -typedef enum VkVideoSessionCreateFlagBitsKHR -{ - VK_VIDEO_SESSION_CREATE_PROTECTED_CONTENT_BIT_KHR = 0x00000001, - VK_VIDEO_SESSION_CREATE_ALLOW_ENCODE_PARAMETER_OPTIMIZATIONS_BIT_KHR = 0x00000002, - VK_VIDEO_SESSION_CREATE_INLINE_QUERIES_BIT_KHR = 0x00000004, - VK_VIDEO_SESSION_CREATE_ALLOW_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR = 0x00000008, - VK_VIDEO_SESSION_CREATE_ALLOW_ENCODE_EMPHASIS_MAP_BIT_KHR = 0x00000010, - VK_VIDEO_SESSION_CREATE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoSessionCreateFlagBitsKHR; - -typedef enum VkVideoSessionParametersCreateFlagBitsKHR -{ - VK_VIDEO_SESSION_PARAMETERS_CREATE_QUANTIZATION_MAP_COMPATIBLE_BIT_KHR = 0x00000001, - VK_VIDEO_SESSION_PARAMETERS_CREATE_FLAG_BITS_KHR_MAX_ENUM = 0x7fffffff, -} VkVideoSessionParametersCreateFlagBitsKHR; - -typedef enum VkViewportCoordinateSwizzleNV -{ - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV = 0, - VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_X_NV = 1, - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Y_NV = 2, - VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Y_NV = 3, - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Z_NV = 4, - VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Z_NV = 5, - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_W_NV = 6, - VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV = 7, - VK_VIEWPORT_COORDINATE_SWIZZLE_NV_MAX_ENUM = 0x7fffffff, -} VkViewportCoordinateSwizzleNV; - -typedef void* (VKAPI_PTR * PFN_vkAllocationFunction)( - void *pUserData, - size_t size, - size_t alignment, - VkSystemAllocationScope allocationScope); -typedef VkBool32 (VKAPI_PTR * PFN_vkDebugReportCallbackEXT)( - VkDebugReportFlagsEXT flags, - VkDebugReportObjectTypeEXT objectType, - uint64_t object, - size_t location, - int32_t messageCode, - const char *pLayerPrefix, - const char *pMessage, - void *pUserData); -typedef struct VkDebugUtilsMessengerCallbackDataEXT VkDebugUtilsMessengerCallbackDataEXT; -typedef VkBool32 (VKAPI_PTR * PFN_vkDebugUtilsMessengerCallbackEXT)( - VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, - VkDebugUtilsMessageTypeFlagsEXT messageTypes, - const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData, - void *pUserData); -typedef void (VKAPI_PTR * PFN_vkFreeFunction)( - void *pUserData, - void *pMemory); -typedef void (VKAPI_PTR * PFN_vkInternalAllocationNotification)( - void *pUserData, - size_t size, - VkInternalAllocationType allocationType, - VkSystemAllocationScope allocationScope); -typedef void (VKAPI_PTR * PFN_vkInternalFreeNotification)( - void *pUserData, - size_t size, - VkInternalAllocationType allocationType, - VkSystemAllocationScope allocationScope); -typedef void* (VKAPI_PTR * PFN_vkReallocationFunction)( - void *pUserData, - void *pOriginal, - size_t size, - size_t alignment, - VkSystemAllocationScope allocationScope); -typedef void (VKAPI_PTR * PFN_vkVoidFunction)( -void); - -typedef struct StdVideoAV1CDEF -{ - uint8_t cdef_damping_minus_3; - uint8_t cdef_bits; - uint8_t cdef_y_pri_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS]; - uint8_t cdef_y_sec_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS]; - uint8_t cdef_uv_pri_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS]; - uint8_t cdef_uv_sec_strength[STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS]; -} StdVideoAV1CDEF; - -typedef struct StdVideoAV1ColorConfigFlags -{ - uint32_t mono_chrome:1; - uint32_t color_range:1; - uint32_t separate_uv_delta_q:1; - uint32_t color_description_present_flag:1; - uint32_t reserved:28; -} StdVideoAV1ColorConfigFlags; - -typedef struct StdVideoAV1FilmGrainFlags -{ - uint32_t chroma_scaling_from_luma:1; - uint32_t overlap_flag:1; - uint32_t clip_to_restricted_range:1; - uint32_t update_grain:1; - uint32_t reserved:28; -} StdVideoAV1FilmGrainFlags; - -typedef struct StdVideoAV1GlobalMotion -{ - uint8_t GmType[STD_VIDEO_AV1_NUM_REF_FRAMES]; - int32_t gm_params[STD_VIDEO_AV1_NUM_REF_FRAMES][STD_VIDEO_AV1_GLOBAL_MOTION_PARAMS]; -} StdVideoAV1GlobalMotion; - -typedef struct StdVideoAV1LoopFilterFlags -{ - uint32_t loop_filter_delta_enabled:1; - uint32_t loop_filter_delta_update:1; - uint32_t reserved:30; -} StdVideoAV1LoopFilterFlags; - -typedef struct StdVideoAV1LoopRestoration -{ - StdVideoAV1FrameRestorationType FrameRestorationType[STD_VIDEO_AV1_MAX_NUM_PLANES]; - uint16_t LoopRestorationSize[STD_VIDEO_AV1_MAX_NUM_PLANES]; -} StdVideoAV1LoopRestoration; - -typedef struct StdVideoAV1QuantizationFlags -{ - uint32_t using_qmatrix:1; - uint32_t diff_uv_delta:1; - uint32_t reserved:30; -} StdVideoAV1QuantizationFlags; - -typedef struct StdVideoAV1Segmentation -{ - uint8_t FeatureEnabled[STD_VIDEO_AV1_MAX_SEGMENTS]; - int16_t FeatureData[STD_VIDEO_AV1_MAX_SEGMENTS][STD_VIDEO_AV1_SEG_LVL_MAX]; -} StdVideoAV1Segmentation; - -typedef struct StdVideoAV1SequenceHeaderFlags -{ - uint32_t still_picture:1; - uint32_t reduced_still_picture_header:1; - uint32_t use_128x128_superblock:1; - uint32_t enable_filter_intra:1; - uint32_t enable_intra_edge_filter:1; - uint32_t enable_interintra_compound:1; - uint32_t enable_masked_compound:1; - uint32_t enable_warped_motion:1; - uint32_t enable_dual_filter:1; - uint32_t enable_order_hint:1; - uint32_t enable_jnt_comp:1; - uint32_t enable_ref_frame_mvs:1; - uint32_t frame_id_numbers_present_flag:1; - uint32_t enable_superres:1; - uint32_t enable_cdef:1; - uint32_t enable_restoration:1; - uint32_t film_grain_params_present:1; - uint32_t timing_info_present_flag:1; - uint32_t initial_display_delay_present_flag:1; - uint32_t reserved:13; -} StdVideoAV1SequenceHeaderFlags; - -typedef struct StdVideoAV1TileInfoFlags -{ - uint32_t uniform_tile_spacing_flag:1; - uint32_t reserved:31; -} StdVideoAV1TileInfoFlags; - -typedef struct StdVideoAV1TimingInfoFlags -{ - uint32_t equal_picture_interval:1; - uint32_t reserved:31; -} StdVideoAV1TimingInfoFlags; - -typedef struct StdVideoDecodeAV1PictureInfoFlags -{ - uint32_t error_resilient_mode:1; - uint32_t disable_cdf_update:1; - uint32_t use_superres:1; - uint32_t render_and_frame_size_different:1; - uint32_t allow_screen_content_tools:1; - uint32_t is_filter_switchable:1; - uint32_t force_integer_mv:1; - uint32_t frame_size_override_flag:1; - uint32_t buffer_removal_time_present_flag:1; - uint32_t allow_intrabc:1; - uint32_t frame_refs_short_signaling:1; - uint32_t allow_high_precision_mv:1; - uint32_t is_motion_mode_switchable:1; - uint32_t use_ref_frame_mvs:1; - uint32_t disable_frame_end_update_cdf:1; - uint32_t allow_warped_motion:1; - uint32_t reduced_tx_set:1; - uint32_t reference_select:1; - uint32_t skip_mode_present:1; - uint32_t delta_q_present:1; - uint32_t delta_lf_present:1; - uint32_t delta_lf_multi:1; - uint32_t segmentation_enabled:1; - uint32_t segmentation_update_map:1; - uint32_t segmentation_temporal_update:1; - uint32_t segmentation_update_data:1; - uint32_t UsesLr:1; - uint32_t usesChromaLr:1; - uint32_t apply_grain:1; - uint32_t reserved:3; -} StdVideoDecodeAV1PictureInfoFlags; - -typedef struct StdVideoDecodeAV1ReferenceInfoFlags -{ - uint32_t disable_frame_end_update_cdf:1; - uint32_t segmentation_enabled:1; - uint32_t reserved:30; -} StdVideoDecodeAV1ReferenceInfoFlags; - -typedef struct StdVideoDecodeH264PictureInfoFlags -{ - uint32_t field_pic_flag:1; - uint32_t is_intra:1; - uint32_t IdrPicFlag:1; - uint32_t bottom_field_flag:1; - uint32_t is_reference:1; - uint32_t complementary_field_pair:1; -} StdVideoDecodeH264PictureInfoFlags; - -typedef struct StdVideoDecodeH264ReferenceInfoFlags -{ - uint32_t top_field_flag:1; - uint32_t bottom_field_flag:1; - uint32_t used_for_long_term_reference:1; - uint32_t is_non_existing:1; -} StdVideoDecodeH264ReferenceInfoFlags; - -typedef struct StdVideoDecodeH265PictureInfoFlags -{ - uint32_t IrapPicFlag:1; - uint32_t IdrPicFlag:1; - uint32_t IsReference:1; - uint32_t short_term_ref_pic_set_sps_flag:1; -} StdVideoDecodeH265PictureInfoFlags; - -typedef struct StdVideoDecodeH265ReferenceInfoFlags -{ - uint32_t used_for_long_term_reference:1; - uint32_t unused_for_reference:1; -} StdVideoDecodeH265ReferenceInfoFlags; - -typedef struct StdVideoEncodeAV1DecoderModelInfo -{ - uint8_t buffer_delay_length_minus_1; - uint8_t buffer_removal_time_length_minus_1; - uint8_t frame_presentation_time_length_minus_1; - uint8_t reserved1; - uint32_t num_units_in_decoding_tick; -} StdVideoEncodeAV1DecoderModelInfo; - -typedef struct StdVideoEncodeAV1ExtensionHeader -{ - uint8_t temporal_id; - uint8_t spatial_id; -} StdVideoEncodeAV1ExtensionHeader; - -typedef struct StdVideoEncodeAV1OperatingPointInfoFlags -{ - uint32_t decoder_model_present_for_this_op:1; - uint32_t low_delay_mode_flag:1; - uint32_t initial_display_delay_present_for_this_op:1; - uint32_t reserved:29; -} StdVideoEncodeAV1OperatingPointInfoFlags; - -typedef struct StdVideoEncodeAV1PictureInfoFlags -{ - uint32_t error_resilient_mode:1; - uint32_t disable_cdf_update:1; - uint32_t use_superres:1; - uint32_t render_and_frame_size_different:1; - uint32_t allow_screen_content_tools:1; - uint32_t is_filter_switchable:1; - uint32_t force_integer_mv:1; - uint32_t frame_size_override_flag:1; - uint32_t buffer_removal_time_present_flag:1; - uint32_t allow_intrabc:1; - uint32_t frame_refs_short_signaling:1; - uint32_t allow_high_precision_mv:1; - uint32_t is_motion_mode_switchable:1; - uint32_t use_ref_frame_mvs:1; - uint32_t disable_frame_end_update_cdf:1; - uint32_t allow_warped_motion:1; - uint32_t reduced_tx_set:1; - uint32_t skip_mode_present:1; - uint32_t delta_q_present:1; - uint32_t delta_lf_present:1; - uint32_t delta_lf_multi:1; - uint32_t segmentation_enabled:1; - uint32_t segmentation_update_map:1; - uint32_t segmentation_temporal_update:1; - uint32_t segmentation_update_data:1; - uint32_t UsesLr:1; - uint32_t usesChromaLr:1; - uint32_t show_frame:1; - uint32_t showable_frame:1; - uint32_t reserved:3; -} StdVideoEncodeAV1PictureInfoFlags; - -typedef struct StdVideoEncodeAV1ReferenceInfoFlags -{ - uint32_t disable_frame_end_update_cdf:1; - uint32_t segmentation_enabled:1; - uint32_t reserved:30; -} StdVideoEncodeAV1ReferenceInfoFlags; - -typedef struct StdVideoEncodeH264PictureInfoFlags -{ - uint32_t IdrPicFlag:1; - uint32_t is_reference:1; - uint32_t no_output_of_prior_pics_flag:1; - uint32_t long_term_reference_flag:1; - uint32_t adaptive_ref_pic_marking_mode_flag:1; - uint32_t reserved:27; -} StdVideoEncodeH264PictureInfoFlags; - -typedef struct StdVideoEncodeH264RefListModEntry -{ - StdVideoH264ModificationOfPicNumsIdc modification_of_pic_nums_idc; - uint16_t abs_diff_pic_num_minus1; - uint16_t long_term_pic_num; -} StdVideoEncodeH264RefListModEntry; - -typedef struct StdVideoEncodeH264RefPicMarkingEntry -{ - StdVideoH264MemMgmtControlOp memory_management_control_operation; - uint16_t difference_of_pic_nums_minus1; - uint16_t long_term_pic_num; - uint16_t long_term_frame_idx; - uint16_t max_long_term_frame_idx_plus1; -} StdVideoEncodeH264RefPicMarkingEntry; - -typedef struct StdVideoEncodeH264ReferenceInfoFlags -{ - uint32_t used_for_long_term_reference:1; - uint32_t reserved:31; -} StdVideoEncodeH264ReferenceInfoFlags; - -typedef struct StdVideoEncodeH264ReferenceListsInfoFlags -{ - uint32_t ref_pic_list_modification_flag_l0:1; - uint32_t ref_pic_list_modification_flag_l1:1; - uint32_t reserved:30; -} StdVideoEncodeH264ReferenceListsInfoFlags; - -typedef struct StdVideoEncodeH264SliceHeaderFlags -{ - uint32_t direct_spatial_mv_pred_flag:1; - uint32_t num_ref_idx_active_override_flag:1; - uint32_t reserved:30; -} StdVideoEncodeH264SliceHeaderFlags; - -typedef struct StdVideoEncodeH264WeightTableFlags -{ - uint32_t luma_weight_l0_flag; - uint32_t chroma_weight_l0_flag; - uint32_t luma_weight_l1_flag; - uint32_t chroma_weight_l1_flag; -} StdVideoEncodeH264WeightTableFlags; - -typedef struct StdVideoEncodeH265LongTermRefPics -{ - uint8_t num_long_term_sps; - uint8_t num_long_term_pics; - uint8_t lt_idx_sps[STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS]; - uint8_t poc_lsb_lt[STD_VIDEO_H265_MAX_LONG_TERM_PICS]; - uint16_t used_by_curr_pic_lt_flag; - uint8_t delta_poc_msb_present_flag[STD_VIDEO_H265_MAX_DELTA_POC]; - uint8_t delta_poc_msb_cycle_lt[STD_VIDEO_H265_MAX_DELTA_POC]; -} StdVideoEncodeH265LongTermRefPics; - -typedef struct StdVideoEncodeH265PictureInfoFlags -{ - uint32_t is_reference:1; - uint32_t IrapPicFlag:1; - uint32_t used_for_long_term_reference:1; - uint32_t discardable_flag:1; - uint32_t cross_layer_bla_flag:1; - uint32_t pic_output_flag:1; - uint32_t no_output_of_prior_pics_flag:1; - uint32_t short_term_ref_pic_set_sps_flag:1; - uint32_t slice_temporal_mvp_enabled_flag:1; - uint32_t reserved:23; -} StdVideoEncodeH265PictureInfoFlags; - -typedef struct StdVideoEncodeH265ReferenceInfoFlags -{ - uint32_t used_for_long_term_reference:1; - uint32_t unused_for_reference:1; - uint32_t reserved:30; -} StdVideoEncodeH265ReferenceInfoFlags; - -typedef struct StdVideoEncodeH265ReferenceListsInfoFlags -{ - uint32_t ref_pic_list_modification_flag_l0:1; - uint32_t ref_pic_list_modification_flag_l1:1; - uint32_t reserved:30; -} StdVideoEncodeH265ReferenceListsInfoFlags; - -typedef struct StdVideoEncodeH265SliceSegmentHeaderFlags -{ - uint32_t first_slice_segment_in_pic_flag:1; - uint32_t dependent_slice_segment_flag:1; - uint32_t slice_sao_luma_flag:1; - uint32_t slice_sao_chroma_flag:1; - uint32_t num_ref_idx_active_override_flag:1; - uint32_t mvd_l1_zero_flag:1; - uint32_t cabac_init_flag:1; - uint32_t cu_chroma_qp_offset_enabled_flag:1; - uint32_t deblocking_filter_override_flag:1; - uint32_t slice_deblocking_filter_disabled_flag:1; - uint32_t collocated_from_l0_flag:1; - uint32_t slice_loop_filter_across_slices_enabled_flag:1; - uint32_t reserved:20; -} StdVideoEncodeH265SliceSegmentHeaderFlags; - -typedef struct StdVideoEncodeH265WeightTableFlags -{ - uint16_t luma_weight_l0_flag; - uint16_t chroma_weight_l0_flag; - uint16_t luma_weight_l1_flag; - uint16_t chroma_weight_l1_flag; -} StdVideoEncodeH265WeightTableFlags; - -typedef struct StdVideoH264HrdParameters -{ - uint8_t cpb_cnt_minus1; - uint8_t bit_rate_scale; - uint8_t cpb_size_scale; - uint8_t reserved1; - uint32_t bit_rate_value_minus1[STD_VIDEO_H264_CPB_CNT_LIST_SIZE]; - uint32_t cpb_size_value_minus1[STD_VIDEO_H264_CPB_CNT_LIST_SIZE]; - uint8_t cbr_flag[STD_VIDEO_H264_CPB_CNT_LIST_SIZE]; - uint32_t initial_cpb_removal_delay_length_minus1; - uint32_t cpb_removal_delay_length_minus1; - uint32_t dpb_output_delay_length_minus1; - uint32_t time_offset_length; -} StdVideoH264HrdParameters; - -typedef struct StdVideoH264PpsFlags -{ - uint32_t transform_8x8_mode_flag:1; - uint32_t redundant_pic_cnt_present_flag:1; - uint32_t constrained_intra_pred_flag:1; - uint32_t deblocking_filter_control_present_flag:1; - uint32_t weighted_pred_flag:1; - uint32_t bottom_field_pic_order_in_frame_present_flag:1; - uint32_t entropy_coding_mode_flag:1; - uint32_t pic_scaling_matrix_present_flag:1; -} StdVideoH264PpsFlags; - -typedef struct StdVideoH264ScalingLists -{ - uint16_t scaling_list_present_mask; - uint16_t use_default_scaling_matrix_mask; - uint8_t ScalingList4x4[STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS][STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS]; - uint8_t ScalingList8x8[STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS][STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS]; -} StdVideoH264ScalingLists; - -typedef struct StdVideoH264SpsFlags -{ - uint32_t constraint_set0_flag:1; - uint32_t constraint_set1_flag:1; - uint32_t constraint_set2_flag:1; - uint32_t constraint_set3_flag:1; - uint32_t constraint_set4_flag:1; - uint32_t constraint_set5_flag:1; - uint32_t direct_8x8_inference_flag:1; - uint32_t mb_adaptive_frame_field_flag:1; - uint32_t frame_mbs_only_flag:1; - uint32_t delta_pic_order_always_zero_flag:1; - uint32_t separate_colour_plane_flag:1; - uint32_t gaps_in_frame_num_value_allowed_flag:1; - uint32_t qpprime_y_zero_transform_bypass_flag:1; - uint32_t frame_cropping_flag:1; - uint32_t seq_scaling_matrix_present_flag:1; - uint32_t vui_parameters_present_flag:1; -} StdVideoH264SpsFlags; - -typedef struct StdVideoH264SpsVuiFlags -{ - uint32_t aspect_ratio_info_present_flag:1; - uint32_t overscan_info_present_flag:1; - uint32_t overscan_appropriate_flag:1; - uint32_t video_signal_type_present_flag:1; - uint32_t video_full_range_flag:1; - uint32_t color_description_present_flag:1; - uint32_t chroma_loc_info_present_flag:1; - uint32_t timing_info_present_flag:1; - uint32_t fixed_frame_rate_flag:1; - uint32_t bitstream_restriction_flag:1; - uint32_t nal_hrd_parameters_present_flag:1; - uint32_t vcl_hrd_parameters_present_flag:1; -} StdVideoH264SpsVuiFlags; - -typedef struct StdVideoH265DecPicBufMgr -{ - uint32_t max_latency_increase_plus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]; - uint8_t max_dec_pic_buffering_minus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]; - uint8_t max_num_reorder_pics[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]; -} StdVideoH265DecPicBufMgr; - -typedef struct StdVideoH265HrdFlags -{ - uint32_t nal_hrd_parameters_present_flag:1; - uint32_t vcl_hrd_parameters_present_flag:1; - uint32_t sub_pic_hrd_params_present_flag:1; - uint32_t sub_pic_cpb_params_in_pic_timing_sei_flag:1; - uint32_t fixed_pic_rate_general_flag:8; - uint32_t fixed_pic_rate_within_cvs_flag:8; - uint32_t low_delay_hrd_flag:8; -} StdVideoH265HrdFlags; - -typedef struct StdVideoH265LongTermRefPicsSps -{ - uint32_t used_by_curr_pic_lt_sps_flag; - uint32_t lt_ref_pic_poc_lsb_sps[STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS]; -} StdVideoH265LongTermRefPicsSps; - -typedef struct StdVideoH265PpsFlags -{ - uint32_t dependent_slice_segments_enabled_flag:1; - uint32_t output_flag_present_flag:1; - uint32_t sign_data_hiding_enabled_flag:1; - uint32_t cabac_init_present_flag:1; - uint32_t constrained_intra_pred_flag:1; - uint32_t transform_skip_enabled_flag:1; - uint32_t cu_qp_delta_enabled_flag:1; - uint32_t pps_slice_chroma_qp_offsets_present_flag:1; - uint32_t weighted_pred_flag:1; - uint32_t weighted_bipred_flag:1; - uint32_t transquant_bypass_enabled_flag:1; - uint32_t tiles_enabled_flag:1; - uint32_t entropy_coding_sync_enabled_flag:1; - uint32_t uniform_spacing_flag:1; - uint32_t loop_filter_across_tiles_enabled_flag:1; - uint32_t pps_loop_filter_across_slices_enabled_flag:1; - uint32_t deblocking_filter_control_present_flag:1; - uint32_t deblocking_filter_override_enabled_flag:1; - uint32_t pps_deblocking_filter_disabled_flag:1; - uint32_t pps_scaling_list_data_present_flag:1; - uint32_t lists_modification_present_flag:1; - uint32_t slice_segment_header_extension_present_flag:1; - uint32_t pps_extension_present_flag:1; - uint32_t cross_component_prediction_enabled_flag:1; - uint32_t chroma_qp_offset_list_enabled_flag:1; - uint32_t pps_curr_pic_ref_enabled_flag:1; - uint32_t residual_adaptive_colour_transform_enabled_flag:1; - uint32_t pps_slice_act_qp_offsets_present_flag:1; - uint32_t pps_palette_predictor_initializers_present_flag:1; - uint32_t monochrome_palette_flag:1; - uint32_t pps_range_extension_flag:1; -} StdVideoH265PpsFlags; - -typedef struct StdVideoH265PredictorPaletteEntries -{ - uint16_t PredictorPaletteEntries[STD_VIDEO_H265_PREDICTOR_PALETTE_COMPONENTS_LIST_SIZE][STD_VIDEO_H265_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE]; -} StdVideoH265PredictorPaletteEntries; - -typedef struct StdVideoH265ProfileTierLevelFlags -{ - uint32_t general_tier_flag:1; - uint32_t general_progressive_source_flag:1; - uint32_t general_interlaced_source_flag:1; - uint32_t general_non_packed_constraint_flag:1; - uint32_t general_frame_only_constraint_flag:1; -} StdVideoH265ProfileTierLevelFlags; - -typedef struct StdVideoH265ScalingLists -{ - uint8_t ScalingList4x4[STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS]; - uint8_t ScalingList8x8[STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS]; - uint8_t ScalingList16x16[STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS]; - uint8_t ScalingList32x32[STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS]; - uint8_t ScalingListDCCoef16x16[STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS]; - uint8_t ScalingListDCCoef32x32[STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS]; -} StdVideoH265ScalingLists; - -typedef struct StdVideoH265ShortTermRefPicSetFlags -{ - uint32_t inter_ref_pic_set_prediction_flag:1; - uint32_t delta_rps_sign:1; -} StdVideoH265ShortTermRefPicSetFlags; - -typedef struct StdVideoH265SpsFlags -{ - uint32_t sps_temporal_id_nesting_flag:1; - uint32_t separate_colour_plane_flag:1; - uint32_t conformance_window_flag:1; - uint32_t sps_sub_layer_ordering_info_present_flag:1; - uint32_t scaling_list_enabled_flag:1; - uint32_t sps_scaling_list_data_present_flag:1; - uint32_t amp_enabled_flag:1; - uint32_t sample_adaptive_offset_enabled_flag:1; - uint32_t pcm_enabled_flag:1; - uint32_t pcm_loop_filter_disabled_flag:1; - uint32_t long_term_ref_pics_present_flag:1; - uint32_t sps_temporal_mvp_enabled_flag:1; - uint32_t strong_intra_smoothing_enabled_flag:1; - uint32_t vui_parameters_present_flag:1; - uint32_t sps_extension_present_flag:1; - uint32_t sps_range_extension_flag:1; - uint32_t transform_skip_rotation_enabled_flag:1; - uint32_t transform_skip_context_enabled_flag:1; - uint32_t implicit_rdpcm_enabled_flag:1; - uint32_t explicit_rdpcm_enabled_flag:1; - uint32_t extended_precision_processing_flag:1; - uint32_t intra_smoothing_disabled_flag:1; - uint32_t high_precision_offsets_enabled_flag:1; - uint32_t persistent_rice_adaptation_enabled_flag:1; - uint32_t cabac_bypass_alignment_enabled_flag:1; - uint32_t sps_scc_extension_flag:1; - uint32_t sps_curr_pic_ref_enabled_flag:1; - uint32_t palette_mode_enabled_flag:1; - uint32_t sps_palette_predictor_initializers_present_flag:1; - uint32_t intra_boundary_filtering_disabled_flag:1; -} StdVideoH265SpsFlags; - -typedef struct StdVideoH265SpsVuiFlags -{ - uint32_t aspect_ratio_info_present_flag:1; - uint32_t overscan_info_present_flag:1; - uint32_t overscan_appropriate_flag:1; - uint32_t video_signal_type_present_flag:1; - uint32_t video_full_range_flag:1; - uint32_t colour_description_present_flag:1; - uint32_t chroma_loc_info_present_flag:1; - uint32_t neutral_chroma_indication_flag:1; - uint32_t field_seq_flag:1; - uint32_t frame_field_info_present_flag:1; - uint32_t default_display_window_flag:1; - uint32_t vui_timing_info_present_flag:1; - uint32_t vui_poc_proportional_to_timing_flag:1; - uint32_t vui_hrd_parameters_present_flag:1; - uint32_t bitstream_restriction_flag:1; - uint32_t tiles_fixed_structure_flag:1; - uint32_t motion_vectors_over_pic_boundaries_flag:1; - uint32_t restricted_ref_pic_lists_flag:1; -} StdVideoH265SpsVuiFlags; - -typedef struct StdVideoH265SubLayerHrdParameters -{ - uint32_t bit_rate_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE]; - uint32_t cpb_size_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE]; - uint32_t cpb_size_du_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE]; - uint32_t bit_rate_du_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE]; - uint32_t cbr_flag; -} StdVideoH265SubLayerHrdParameters; - -typedef struct StdVideoH265VpsFlags -{ - uint32_t vps_temporal_id_nesting_flag:1; - uint32_t vps_sub_layer_ordering_info_present_flag:1; - uint32_t vps_timing_info_present_flag:1; - uint32_t vps_poc_proportional_to_timing_flag:1; -} StdVideoH265VpsFlags; - -typedef struct VkAabbPositionsKHR -{ - float minX; - float minY; - float minZ; - float maxX; - float maxY; - float maxZ; -} VkAabbPositionsKHR; -typedef VkAabbPositionsKHR VkAabbPositionsNV; - -typedef struct VkAccelerationStructureBuildRangeInfoKHR -{ - uint32_t primitiveCount; - uint32_t primitiveOffset; - uint32_t firstVertex; - uint32_t transformOffset; -} VkAccelerationStructureBuildRangeInfoKHR; - -typedef struct VkAccelerationStructureBuildSizesInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) accelerationStructureSize; - VkDeviceSize WINE_VK_ALIGN(8) updateScratchSize; - VkDeviceSize WINE_VK_ALIGN(8) buildScratchSize; -} VkAccelerationStructureBuildSizesInfoKHR; - -typedef struct VkAccelerationStructureCaptureDescriptorDataInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkAccelerationStructureKHR WINE_VK_ALIGN(8) accelerationStructure; - VkAccelerationStructureNV WINE_VK_ALIGN(8) accelerationStructureNV; -} VkAccelerationStructureCaptureDescriptorDataInfoEXT; - -typedef struct VkAccelerationStructureCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkAccelerationStructureCreateFlagsKHR createFlags; - VkBuffer WINE_VK_ALIGN(8) buffer; - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkDeviceSize WINE_VK_ALIGN(8) size; - VkAccelerationStructureTypeKHR type; - VkDeviceAddress WINE_VK_ALIGN(8) deviceAddress; -} VkAccelerationStructureCreateInfoKHR; - -typedef struct VkAccelerationStructureDeviceAddressInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkAccelerationStructureKHR WINE_VK_ALIGN(8) accelerationStructure; -} VkAccelerationStructureDeviceAddressInfoKHR; - -typedef struct VkAccelerationStructureMemoryRequirementsInfoNV -{ - VkStructureType sType; - const void *pNext; - VkAccelerationStructureMemoryRequirementsTypeNV type; - VkAccelerationStructureNV WINE_VK_ALIGN(8) accelerationStructure; -} VkAccelerationStructureMemoryRequirementsInfoNV; - -typedef struct VkAccelerationStructureMotionInfoNV -{ - VkStructureType sType; - const void *pNext; - uint32_t maxInstances; - VkAccelerationStructureMotionInfoFlagsNV flags; -} VkAccelerationStructureMotionInfoNV; - -typedef struct VkAccelerationStructureVersionInfoKHR -{ - VkStructureType sType; - const void *pNext; - const uint8_t *pVersionData; -} VkAccelerationStructureVersionInfoKHR; - -typedef struct VkAcquireNextImageInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkSwapchainKHR WINE_VK_ALIGN(8) swapchain; - uint64_t WINE_VK_ALIGN(8) timeout; - VkSemaphore WINE_VK_ALIGN(8) semaphore; - VkFence WINE_VK_ALIGN(8) fence; - uint32_t deviceMask; -} VkAcquireNextImageInfoKHR; - -typedef struct VkAcquireProfilingLockInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkAcquireProfilingLockFlagsKHR flags; - uint64_t WINE_VK_ALIGN(8) timeout; -} VkAcquireProfilingLockInfoKHR; - -typedef struct VkAllocationCallbacks -{ - void *pUserData; - PFN_vkAllocationFunction pfnAllocation; - PFN_vkReallocationFunction pfnReallocation; - PFN_vkFreeFunction pfnFree; - PFN_vkInternalAllocationNotification pfnInternalAllocation; - PFN_vkInternalFreeNotification pfnInternalFree; -} VkAllocationCallbacks; - -typedef struct VkAntiLagPresentationInfoAMD -{ - VkStructureType sType; - void *pNext; - VkAntiLagStageAMD stage; - uint64_t WINE_VK_ALIGN(8) frameIndex; -} VkAntiLagPresentationInfoAMD; - -typedef struct VkApplicationInfo -{ - VkStructureType sType; - const void *pNext; - const char *pApplicationName; - uint32_t applicationVersion; - const char *pEngineName; - uint32_t engineVersion; - uint32_t apiVersion; -} VkApplicationInfo; - -typedef struct VkAttachmentDescription -{ - VkAttachmentDescriptionFlags flags; - VkFormat format; - VkSampleCountFlagBits samples; - VkAttachmentLoadOp loadOp; - VkAttachmentStoreOp storeOp; - VkAttachmentLoadOp stencilLoadOp; - VkAttachmentStoreOp stencilStoreOp; - VkImageLayout initialLayout; - VkImageLayout finalLayout; -} VkAttachmentDescription; - -typedef struct VkAttachmentDescription2 -{ - VkStructureType sType; - const void *pNext; - VkAttachmentDescriptionFlags flags; - VkFormat format; - VkSampleCountFlagBits samples; - VkAttachmentLoadOp loadOp; - VkAttachmentStoreOp storeOp; - VkAttachmentLoadOp stencilLoadOp; - VkAttachmentStoreOp stencilStoreOp; - VkImageLayout initialLayout; - VkImageLayout finalLayout; -} VkAttachmentDescription2; -typedef VkAttachmentDescription2 VkAttachmentDescription2KHR; - -typedef struct VkAttachmentDescriptionStencilLayout -{ - VkStructureType sType; - void *pNext; - VkImageLayout stencilInitialLayout; - VkImageLayout stencilFinalLayout; -} VkAttachmentDescriptionStencilLayout; -typedef VkAttachmentDescriptionStencilLayout VkAttachmentDescriptionStencilLayoutKHR; - -typedef struct VkAttachmentReference -{ - uint32_t attachment; - VkImageLayout layout; -} VkAttachmentReference; - -typedef struct VkAttachmentReference2 -{ - VkStructureType sType; - const void *pNext; - uint32_t attachment; - VkImageLayout layout; - VkImageAspectFlags aspectMask; -} VkAttachmentReference2; -typedef VkAttachmentReference2 VkAttachmentReference2KHR; - -typedef struct VkAttachmentReferenceStencilLayout -{ - VkStructureType sType; - void *pNext; - VkImageLayout stencilLayout; -} VkAttachmentReferenceStencilLayout; -typedef VkAttachmentReferenceStencilLayout VkAttachmentReferenceStencilLayoutKHR; - -typedef struct VkAttachmentSampleCountInfoAMD -{ - VkStructureType sType; - const void *pNext; - uint32_t colorAttachmentCount; - const VkSampleCountFlagBits *pColorAttachmentSamples; - VkSampleCountFlagBits depthStencilAttachmentSamples; -} VkAttachmentSampleCountInfoAMD; -typedef VkAttachmentSampleCountInfoAMD VkAttachmentSampleCountInfoNV; - -typedef struct VkBaseInStructure -{ - VkStructureType sType; - const struct VkBaseInStructure *pNext; -} VkBaseInStructure; - -typedef struct VkBaseOutStructure -{ - VkStructureType sType; - struct VkBaseOutStructure *pNext; -} VkBaseOutStructure; - -typedef struct VkBindAccelerationStructureMemoryInfoNV -{ - VkStructureType sType; - const void *pNext; - VkAccelerationStructureNV WINE_VK_ALIGN(8) accelerationStructure; - VkDeviceMemory WINE_VK_ALIGN(8) memory; - VkDeviceSize WINE_VK_ALIGN(8) memoryOffset; - uint32_t deviceIndexCount; - const uint32_t *pDeviceIndices; -} VkBindAccelerationStructureMemoryInfoNV; - -typedef struct VkBindBufferMemoryDeviceGroupInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t deviceIndexCount; - const uint32_t *pDeviceIndices; -} VkBindBufferMemoryDeviceGroupInfo; -typedef VkBindBufferMemoryDeviceGroupInfo VkBindBufferMemoryDeviceGroupInfoKHR; - -typedef struct VkBindBufferMemoryInfo -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) buffer; - VkDeviceMemory WINE_VK_ALIGN(8) memory; - VkDeviceSize WINE_VK_ALIGN(8) memoryOffset; -} VkBindBufferMemoryInfo; -typedef VkBindBufferMemoryInfo VkBindBufferMemoryInfoKHR; - -typedef struct VkBindDescriptorBufferEmbeddedSamplersInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkShaderStageFlags stageFlags; - VkPipelineLayout WINE_VK_ALIGN(8) layout; - uint32_t set; -} VkBindDescriptorBufferEmbeddedSamplersInfoEXT; - -typedef struct VkBindDescriptorSetsInfo -{ - VkStructureType sType; - const void *pNext; - VkShaderStageFlags stageFlags; - VkPipelineLayout WINE_VK_ALIGN(8) layout; - uint32_t firstSet; - uint32_t descriptorSetCount; - const VkDescriptorSet *pDescriptorSets; - uint32_t dynamicOffsetCount; - const uint32_t *pDynamicOffsets; -} VkBindDescriptorSetsInfo; -typedef VkBindDescriptorSetsInfo VkBindDescriptorSetsInfoKHR; - -typedef struct VkBindImageMemoryInfo -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) image; - VkDeviceMemory WINE_VK_ALIGN(8) memory; - VkDeviceSize WINE_VK_ALIGN(8) memoryOffset; -} VkBindImageMemoryInfo; -typedef VkBindImageMemoryInfo VkBindImageMemoryInfoKHR; - -typedef struct VkBindImageMemorySwapchainInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkSwapchainKHR WINE_VK_ALIGN(8) swapchain; - uint32_t imageIndex; -} VkBindImageMemorySwapchainInfoKHR; - -typedef struct VkBindImagePlaneMemoryInfo -{ - VkStructureType sType; - const void *pNext; - VkImageAspectFlagBits planeAspect; -} VkBindImagePlaneMemoryInfo; -typedef VkBindImagePlaneMemoryInfo VkBindImagePlaneMemoryInfoKHR; - -typedef struct VkBindIndexBufferIndirectCommandEXT -{ - VkDeviceAddress WINE_VK_ALIGN(8) bufferAddress; - uint32_t size; - VkIndexType indexType; -} VkBindIndexBufferIndirectCommandEXT; - -typedef struct VkBindIndexBufferIndirectCommandNV -{ - VkDeviceAddress WINE_VK_ALIGN(8) bufferAddress; - uint32_t size; - VkIndexType indexType; -} VkBindIndexBufferIndirectCommandNV; - -typedef struct VkBindMemoryStatus -{ - VkStructureType sType; - const void *pNext; - VkResult *pResult; -} VkBindMemoryStatus; -typedef VkBindMemoryStatus VkBindMemoryStatusKHR; - -typedef struct VkBindPipelineIndirectCommandNV -{ - VkDeviceAddress WINE_VK_ALIGN(8) pipelineAddress; -} VkBindPipelineIndirectCommandNV; - -typedef struct VkBindShaderGroupIndirectCommandNV -{ - uint32_t groupIndex; -} VkBindShaderGroupIndirectCommandNV; - -typedef struct VkBindVertexBufferIndirectCommandEXT -{ - VkDeviceAddress WINE_VK_ALIGN(8) bufferAddress; - uint32_t size; - uint32_t stride; -} VkBindVertexBufferIndirectCommandEXT; - -typedef struct VkBindVertexBufferIndirectCommandNV -{ - VkDeviceAddress WINE_VK_ALIGN(8) bufferAddress; - uint32_t size; - uint32_t stride; -} VkBindVertexBufferIndirectCommandNV; - -typedef struct VkBindVideoSessionMemoryInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t memoryBindIndex; - VkDeviceMemory WINE_VK_ALIGN(8) memory; - VkDeviceSize WINE_VK_ALIGN(8) memoryOffset; - VkDeviceSize WINE_VK_ALIGN(8) memorySize; -} VkBindVideoSessionMemoryInfoKHR; - -typedef struct VkBlitImageCubicWeightsInfoQCOM -{ - VkStructureType sType; - const void *pNext; - VkCubicFilterWeightsQCOM cubicWeights; -} VkBlitImageCubicWeightsInfoQCOM; - -typedef struct VkBufferCaptureDescriptorDataInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) buffer; -} VkBufferCaptureDescriptorDataInfoEXT; - -typedef struct VkBufferCopy -{ - VkDeviceSize WINE_VK_ALIGN(8) srcOffset; - VkDeviceSize WINE_VK_ALIGN(8) dstOffset; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkBufferCopy; - -typedef struct VkBufferCopy2 -{ - VkStructureType sType; - const void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) srcOffset; - VkDeviceSize WINE_VK_ALIGN(8) dstOffset; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkBufferCopy2; -typedef VkBufferCopy2 VkBufferCopy2KHR; - -typedef struct VkBufferCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkBufferCreateFlags flags; - VkDeviceSize WINE_VK_ALIGN(8) size; - VkBufferUsageFlags usage; - VkSharingMode sharingMode; - uint32_t queueFamilyIndexCount; - const uint32_t *pQueueFamilyIndices; -} VkBufferCreateInfo; - -typedef struct VkBufferDeviceAddressCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDeviceAddress WINE_VK_ALIGN(8) deviceAddress; -} VkBufferDeviceAddressCreateInfoEXT; - -typedef struct VkBufferDeviceAddressInfo -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) buffer; -} VkBufferDeviceAddressInfo; -typedef VkBufferDeviceAddressInfo VkBufferDeviceAddressInfoKHR; -typedef VkBufferDeviceAddressInfo VkBufferDeviceAddressInfoEXT; - -typedef struct VkBufferMemoryBarrier -{ - VkStructureType sType; - const void *pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkBuffer WINE_VK_ALIGN(8) buffer; - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkBufferMemoryBarrier; - -typedef struct VkBufferMemoryBarrier2 -{ - VkStructureType sType; - const void *pNext; - VkPipelineStageFlags2 WINE_VK_ALIGN(8) srcStageMask; - VkAccessFlags2 WINE_VK_ALIGN(8) srcAccessMask; - VkPipelineStageFlags2 WINE_VK_ALIGN(8) dstStageMask; - VkAccessFlags2 WINE_VK_ALIGN(8) dstAccessMask; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkBuffer WINE_VK_ALIGN(8) buffer; - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkBufferMemoryBarrier2; -typedef VkBufferMemoryBarrier2 VkBufferMemoryBarrier2KHR; - -typedef struct VkBufferMemoryRequirementsInfo2 -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) buffer; -} VkBufferMemoryRequirementsInfo2; -typedef VkBufferMemoryRequirementsInfo2 VkBufferMemoryRequirementsInfo2KHR; - -typedef struct VkBufferOpaqueCaptureAddressCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint64_t WINE_VK_ALIGN(8) opaqueCaptureAddress; -} VkBufferOpaqueCaptureAddressCreateInfo; -typedef VkBufferOpaqueCaptureAddressCreateInfo VkBufferOpaqueCaptureAddressCreateInfoKHR; - -typedef struct VkBufferUsageFlags2CreateInfo -{ - VkStructureType sType; - const void *pNext; - VkBufferUsageFlags2 WINE_VK_ALIGN(8) usage; -} VkBufferUsageFlags2CreateInfo; -typedef VkBufferUsageFlags2CreateInfo VkBufferUsageFlags2CreateInfoKHR; - -typedef struct VkBufferViewCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkBufferViewCreateFlags flags; - VkBuffer WINE_VK_ALIGN(8) buffer; - VkFormat format; - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkDeviceSize WINE_VK_ALIGN(8) range; -} VkBufferViewCreateInfo; - -typedef struct VkCalibratedTimestampInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkTimeDomainKHR timeDomain; -} VkCalibratedTimestampInfoKHR; -typedef VkCalibratedTimestampInfoKHR VkCalibratedTimestampInfoEXT; - -typedef struct VkCheckpointData2NV -{ - VkStructureType sType; - void *pNext; - VkPipelineStageFlags2 WINE_VK_ALIGN(8) stage; - void *pCheckpointMarker; -} VkCheckpointData2NV; - -typedef struct VkCheckpointDataNV -{ - VkStructureType sType; - void *pNext; - VkPipelineStageFlagBits stage; - void *pCheckpointMarker; -} VkCheckpointDataNV; - -typedef union VkClearColorValue -{ - float float32[4]; - int32_t int32[4]; - uint32_t uint32[4]; -} VkClearColorValue; - -typedef struct VkClearDepthStencilValue -{ - float depth; - uint32_t stencil; -} VkClearDepthStencilValue; - -typedef union VkClearValue -{ - VkClearColorValue color; - VkClearDepthStencilValue depthStencil; -} VkClearValue; - -typedef struct VkCoarseSampleLocationNV -{ - uint32_t pixelX; - uint32_t pixelY; - uint32_t sample; -} VkCoarseSampleLocationNV; - -typedef struct VkCoarseSampleOrderCustomNV -{ - VkShadingRatePaletteEntryNV shadingRate; - uint32_t sampleCount; - uint32_t sampleLocationCount; - const VkCoarseSampleLocationNV *pSampleLocations; -} VkCoarseSampleOrderCustomNV; - -typedef struct VkColorBlendAdvancedEXT -{ - VkBlendOp advancedBlendOp; - VkBool32 srcPremultiplied; - VkBool32 dstPremultiplied; - VkBlendOverlapEXT blendOverlap; - VkBool32 clampResults; -} VkColorBlendAdvancedEXT; - -typedef struct VkColorBlendEquationEXT -{ - VkBlendFactor srcColorBlendFactor; - VkBlendFactor dstColorBlendFactor; - VkBlendOp colorBlendOp; - VkBlendFactor srcAlphaBlendFactor; - VkBlendFactor dstAlphaBlendFactor; - VkBlendOp alphaBlendOp; -} VkColorBlendEquationEXT; - -typedef struct VkCommandBufferAllocateInfo -{ - VkStructureType sType; - const void *pNext; - VkCommandPool WINE_VK_ALIGN(8) commandPool; - VkCommandBufferLevel level; - uint32_t commandBufferCount; -} VkCommandBufferAllocateInfo; - -typedef struct VkCommandBufferInheritanceConditionalRenderingInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkBool32 conditionalRenderingEnable; -} VkCommandBufferInheritanceConditionalRenderingInfoEXT; - -typedef struct VkCommandBufferInheritanceInfo -{ - VkStructureType sType; - const void *pNext; - VkRenderPass WINE_VK_ALIGN(8) renderPass; - uint32_t subpass; - VkFramebuffer WINE_VK_ALIGN(8) framebuffer; - VkBool32 occlusionQueryEnable; - VkQueryControlFlags queryFlags; - VkQueryPipelineStatisticFlags pipelineStatistics; -} VkCommandBufferInheritanceInfo; - -typedef struct VkCommandBufferInheritanceRenderingInfo -{ - VkStructureType sType; - const void *pNext; - VkRenderingFlags flags; - uint32_t viewMask; - uint32_t colorAttachmentCount; - const VkFormat *pColorAttachmentFormats; - VkFormat depthAttachmentFormat; - VkFormat stencilAttachmentFormat; - VkSampleCountFlagBits rasterizationSamples; -} VkCommandBufferInheritanceRenderingInfo; -typedef VkCommandBufferInheritanceRenderingInfo VkCommandBufferInheritanceRenderingInfoKHR; - -typedef struct VkCommandBufferSubmitInfo -{ - VkStructureType sType; - const void *pNext; - VkCommandBuffer commandBuffer; - uint32_t deviceMask; -} VkCommandBufferSubmitInfo; -typedef VkCommandBufferSubmitInfo VkCommandBufferSubmitInfoKHR; - -typedef struct VkCommandPoolCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkCommandPoolCreateFlags flags; - uint32_t queueFamilyIndex; -} VkCommandPoolCreateInfo; - -typedef struct VkComponentMapping -{ - VkComponentSwizzle r; - VkComponentSwizzle g; - VkComponentSwizzle b; - VkComponentSwizzle a; -} VkComponentMapping; - -typedef struct VkComputePipelineIndirectBufferInfoNV -{ - VkStructureType sType; - const void *pNext; - VkDeviceAddress WINE_VK_ALIGN(8) deviceAddress; - VkDeviceSize WINE_VK_ALIGN(8) size; - VkDeviceAddress WINE_VK_ALIGN(8) pipelineDeviceAddressCaptureReplay; -} VkComputePipelineIndirectBufferInfoNV; - -typedef struct VkConditionalRenderingBeginInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) buffer; - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkConditionalRenderingFlagsEXT flags; -} VkConditionalRenderingBeginInfoEXT; - -typedef struct VkConformanceVersion -{ - uint8_t major; - uint8_t minor; - uint8_t subminor; - uint8_t patch; -} VkConformanceVersion; -typedef VkConformanceVersion VkConformanceVersionKHR; - -typedef struct VkCooperativeMatrixFlexibleDimensionsPropertiesNV -{ - VkStructureType sType; - void *pNext; - uint32_t MGranularity; - uint32_t NGranularity; - uint32_t KGranularity; - VkComponentTypeKHR AType; - VkComponentTypeKHR BType; - VkComponentTypeKHR CType; - VkComponentTypeKHR ResultType; - VkBool32 saturatingAccumulation; - VkScopeKHR scope; - uint32_t workgroupInvocations; -} VkCooperativeMatrixFlexibleDimensionsPropertiesNV; - -typedef struct VkCooperativeMatrixPropertiesKHR -{ - VkStructureType sType; - void *pNext; - uint32_t MSize; - uint32_t NSize; - uint32_t KSize; - VkComponentTypeKHR AType; - VkComponentTypeKHR BType; - VkComponentTypeKHR CType; - VkComponentTypeKHR ResultType; - VkBool32 saturatingAccumulation; - VkScopeKHR scope; -} VkCooperativeMatrixPropertiesKHR; - -typedef struct VkCooperativeMatrixPropertiesNV -{ - VkStructureType sType; - void *pNext; - uint32_t MSize; - uint32_t NSize; - uint32_t KSize; - VkComponentTypeNV AType; - VkComponentTypeNV BType; - VkComponentTypeNV CType; - VkComponentTypeNV DType; - VkScopeNV scope; -} VkCooperativeMatrixPropertiesNV; - -typedef struct VkCopyAccelerationStructureInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkAccelerationStructureKHR WINE_VK_ALIGN(8) src; - VkAccelerationStructureKHR WINE_VK_ALIGN(8) dst; - VkCopyAccelerationStructureModeKHR mode; -} VkCopyAccelerationStructureInfoKHR; - -typedef struct VkCopyBufferInfo2 -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) srcBuffer; - VkBuffer WINE_VK_ALIGN(8) dstBuffer; - uint32_t regionCount; - const VkBufferCopy2 *pRegions; -} VkCopyBufferInfo2; -typedef VkCopyBufferInfo2 VkCopyBufferInfo2KHR; - -typedef struct VkCopyCommandTransformInfoQCOM -{ - VkStructureType sType; - const void *pNext; - VkSurfaceTransformFlagBitsKHR transform; -} VkCopyCommandTransformInfoQCOM; - -typedef struct VkCopyDescriptorSet -{ - VkStructureType sType; - const void *pNext; - VkDescriptorSet WINE_VK_ALIGN(8) srcSet; - uint32_t srcBinding; - uint32_t srcArrayElement; - VkDescriptorSet WINE_VK_ALIGN(8) dstSet; - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; -} VkCopyDescriptorSet; - -typedef struct VkCopyMemoryIndirectCommandNV -{ - VkDeviceAddress WINE_VK_ALIGN(8) srcAddress; - VkDeviceAddress WINE_VK_ALIGN(8) dstAddress; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkCopyMemoryIndirectCommandNV; - -typedef struct VkCopyMicromapInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkMicromapEXT WINE_VK_ALIGN(8) src; - VkMicromapEXT WINE_VK_ALIGN(8) dst; - VkCopyMicromapModeEXT mode; -} VkCopyMicromapInfoEXT; - -typedef struct VkCuFunctionCreateInfoNVX -{ - VkStructureType sType; - const void *pNext; - VkCuModuleNVX WINE_VK_ALIGN(8) module; - const char *pName; -} VkCuFunctionCreateInfoNVX; - -typedef struct VkCuLaunchInfoNVX -{ - VkStructureType sType; - const void *pNext; - VkCuFunctionNVX WINE_VK_ALIGN(8) function; - uint32_t gridDimX; - uint32_t gridDimY; - uint32_t gridDimZ; - uint32_t blockDimX; - uint32_t blockDimY; - uint32_t blockDimZ; - uint32_t sharedMemBytes; - size_t paramCount; - const void * const *pParams; - size_t extraCount; - const void * const *pExtras; -} VkCuLaunchInfoNVX; - -typedef struct VkCuModuleCreateInfoNVX -{ - VkStructureType sType; - const void *pNext; - size_t dataSize; - const void *pData; -} VkCuModuleCreateInfoNVX; - -typedef struct VkCuModuleTexturingModeCreateInfoNVX -{ - VkStructureType sType; - const void *pNext; - VkBool32 use64bitTexturing; -} VkCuModuleTexturingModeCreateInfoNVX; - -typedef struct VkCudaFunctionCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkCudaModuleNV WINE_VK_ALIGN(8) module; - const char *pName; -} VkCudaFunctionCreateInfoNV; - -typedef struct VkCudaLaunchInfoNV -{ - VkStructureType sType; - const void *pNext; - VkCudaFunctionNV WINE_VK_ALIGN(8) function; - uint32_t gridDimX; - uint32_t gridDimY; - uint32_t gridDimZ; - uint32_t blockDimX; - uint32_t blockDimY; - uint32_t blockDimZ; - uint32_t sharedMemBytes; - size_t paramCount; - const void * const *pParams; - size_t extraCount; - const void * const *pExtras; -} VkCudaLaunchInfoNV; - -typedef struct VkCudaModuleCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - size_t dataSize; - const void *pData; -} VkCudaModuleCreateInfoNV; - -typedef struct VkDebugMarkerMarkerInfoEXT -{ - VkStructureType sType; - const void *pNext; - const char *pMarkerName; - float color[4]; -} VkDebugMarkerMarkerInfoEXT; - -typedef struct VkDebugMarkerObjectNameInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDebugReportObjectTypeEXT objectType; - uint64_t WINE_VK_ALIGN(8) object; - const char *pObjectName; -} VkDebugMarkerObjectNameInfoEXT; - -typedef struct VkDebugMarkerObjectTagInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDebugReportObjectTypeEXT objectType; - uint64_t WINE_VK_ALIGN(8) object; - uint64_t WINE_VK_ALIGN(8) tagName; - size_t tagSize; - const void *pTag; -} VkDebugMarkerObjectTagInfoEXT; - -typedef struct VkDebugReportCallbackCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDebugReportFlagsEXT flags; - PFN_vkDebugReportCallbackEXT pfnCallback; - void *pUserData; -} VkDebugReportCallbackCreateInfoEXT; - -typedef struct VkDebugUtilsLabelEXT -{ - VkStructureType sType; - const void *pNext; - const char *pLabelName; - float color[4]; -} VkDebugUtilsLabelEXT; - -typedef struct VkDebugUtilsMessengerCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDebugUtilsMessengerCreateFlagsEXT flags; - VkDebugUtilsMessageSeverityFlagsEXT messageSeverity; - VkDebugUtilsMessageTypeFlagsEXT messageType; - PFN_vkDebugUtilsMessengerCallbackEXT pfnUserCallback; - void *pUserData; -} VkDebugUtilsMessengerCreateInfoEXT; - -typedef struct VkDebugUtilsObjectNameInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkObjectType objectType; - uint64_t WINE_VK_ALIGN(8) objectHandle; - const char *pObjectName; -} VkDebugUtilsObjectNameInfoEXT; - -typedef struct VkDebugUtilsObjectTagInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkObjectType objectType; - uint64_t WINE_VK_ALIGN(8) objectHandle; - uint64_t WINE_VK_ALIGN(8) tagName; - size_t tagSize; - const void *pTag; -} VkDebugUtilsObjectTagInfoEXT; - -typedef struct VkDecompressMemoryRegionNV -{ - VkDeviceAddress WINE_VK_ALIGN(8) srcAddress; - VkDeviceAddress WINE_VK_ALIGN(8) dstAddress; - VkDeviceSize WINE_VK_ALIGN(8) compressedSize; - VkDeviceSize WINE_VK_ALIGN(8) decompressedSize; - VkMemoryDecompressionMethodFlagsNV WINE_VK_ALIGN(8) decompressionMethod; -} VkDecompressMemoryRegionNV; - -typedef struct VkDedicatedAllocationBufferCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkBool32 dedicatedAllocation; -} VkDedicatedAllocationBufferCreateInfoNV; - -typedef struct VkDedicatedAllocationImageCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkBool32 dedicatedAllocation; -} VkDedicatedAllocationImageCreateInfoNV; - -typedef struct VkDedicatedAllocationMemoryAllocateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) image; - VkBuffer WINE_VK_ALIGN(8) buffer; -} VkDedicatedAllocationMemoryAllocateInfoNV; - -typedef struct VkDepthBiasInfoEXT -{ - VkStructureType sType; - const void *pNext; - float depthBiasConstantFactor; - float depthBiasClamp; - float depthBiasSlopeFactor; -} VkDepthBiasInfoEXT; - -typedef struct VkDepthBiasRepresentationInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDepthBiasRepresentationEXT depthBiasRepresentation; - VkBool32 depthBiasExact; -} VkDepthBiasRepresentationInfoEXT; - -typedef struct VkDepthClampRangeEXT -{ - float minDepthClamp; - float maxDepthClamp; -} VkDepthClampRangeEXT; - -typedef struct VkDescriptorAddressInfoEXT -{ - VkStructureType sType; - void *pNext; - VkDeviceAddress WINE_VK_ALIGN(8) address; - VkDeviceSize WINE_VK_ALIGN(8) range; - VkFormat format; -} VkDescriptorAddressInfoEXT; - -typedef struct VkDescriptorBufferBindingInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDeviceAddress WINE_VK_ALIGN(8) address; - VkBufferUsageFlags usage; -} VkDescriptorBufferBindingInfoEXT; - -typedef struct VkDescriptorBufferBindingPushDescriptorBufferHandleEXT -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) buffer; -} VkDescriptorBufferBindingPushDescriptorBufferHandleEXT; - -typedef struct VkDescriptorBufferInfo -{ - VkBuffer WINE_VK_ALIGN(8) buffer; - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkDeviceSize WINE_VK_ALIGN(8) range; -} VkDescriptorBufferInfo; - -typedef struct VkDescriptorImageInfo -{ - VkSampler WINE_VK_ALIGN(8) sampler; - VkImageView WINE_VK_ALIGN(8) imageView; - VkImageLayout imageLayout; -} VkDescriptorImageInfo; - -typedef struct VkDescriptorPoolInlineUniformBlockCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t maxInlineUniformBlockBindings; -} VkDescriptorPoolInlineUniformBlockCreateInfo; -typedef VkDescriptorPoolInlineUniformBlockCreateInfo VkDescriptorPoolInlineUniformBlockCreateInfoEXT; - -typedef struct VkDescriptorPoolSize -{ - VkDescriptorType type; - uint32_t descriptorCount; -} VkDescriptorPoolSize; - -typedef struct VkDescriptorSetAllocateInfo -{ - VkStructureType sType; - const void *pNext; - VkDescriptorPool WINE_VK_ALIGN(8) descriptorPool; - uint32_t descriptorSetCount; - const VkDescriptorSetLayout *pSetLayouts; -} VkDescriptorSetAllocateInfo; - -typedef struct VkDescriptorSetBindingReferenceVALVE -{ - VkStructureType sType; - const void *pNext; - VkDescriptorSetLayout WINE_VK_ALIGN(8) descriptorSetLayout; - uint32_t binding; -} VkDescriptorSetBindingReferenceVALVE; - -typedef struct VkDescriptorSetLayoutBinding -{ - uint32_t binding; - VkDescriptorType descriptorType; - uint32_t descriptorCount; - VkShaderStageFlags stageFlags; - const VkSampler *pImmutableSamplers; -} VkDescriptorSetLayoutBinding; - -typedef struct VkDescriptorSetLayoutBindingFlagsCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t bindingCount; - const VkDescriptorBindingFlags *pBindingFlags; -} VkDescriptorSetLayoutBindingFlagsCreateInfo; -typedef VkDescriptorSetLayoutBindingFlagsCreateInfo VkDescriptorSetLayoutBindingFlagsCreateInfoEXT; - -typedef struct VkDescriptorSetLayoutCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkDescriptorSetLayoutCreateFlags flags; - uint32_t bindingCount; - const VkDescriptorSetLayoutBinding *pBindings; -} VkDescriptorSetLayoutCreateInfo; - -typedef struct VkDescriptorSetLayoutHostMappingInfoVALVE -{ - VkStructureType sType; - void *pNext; - size_t descriptorOffset; - uint32_t descriptorSize; -} VkDescriptorSetLayoutHostMappingInfoVALVE; - -typedef struct VkDescriptorSetLayoutSupport -{ - VkStructureType sType; - void *pNext; - VkBool32 supported; -} VkDescriptorSetLayoutSupport; -typedef VkDescriptorSetLayoutSupport VkDescriptorSetLayoutSupportKHR; - -typedef struct VkDescriptorSetVariableDescriptorCountAllocateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t descriptorSetCount; - const uint32_t *pDescriptorCounts; -} VkDescriptorSetVariableDescriptorCountAllocateInfo; -typedef VkDescriptorSetVariableDescriptorCountAllocateInfo VkDescriptorSetVariableDescriptorCountAllocateInfoEXT; - -typedef struct VkDescriptorSetVariableDescriptorCountLayoutSupport -{ - VkStructureType sType; - void *pNext; - uint32_t maxVariableDescriptorCount; -} VkDescriptorSetVariableDescriptorCountLayoutSupport; -typedef VkDescriptorSetVariableDescriptorCountLayoutSupport VkDescriptorSetVariableDescriptorCountLayoutSupportEXT; - -typedef struct VkDescriptorUpdateTemplateEntry -{ - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; - VkDescriptorType descriptorType; - size_t offset; - size_t stride; -} VkDescriptorUpdateTemplateEntry; -typedef VkDescriptorUpdateTemplateEntry VkDescriptorUpdateTemplateEntryKHR; - -typedef struct VkDeviceAddressBindingCallbackDataEXT -{ - VkStructureType sType; - void *pNext; - VkDeviceAddressBindingFlagsEXT flags; - VkDeviceAddress WINE_VK_ALIGN(8) baseAddress; - VkDeviceSize WINE_VK_ALIGN(8) size; - VkDeviceAddressBindingTypeEXT bindingType; -} VkDeviceAddressBindingCallbackDataEXT; - -typedef struct VkDeviceBufferMemoryRequirements -{ - VkStructureType sType; - const void *pNext; - const VkBufferCreateInfo *pCreateInfo; -} VkDeviceBufferMemoryRequirements; -typedef VkDeviceBufferMemoryRequirements VkDeviceBufferMemoryRequirementsKHR; - -typedef struct VkDeviceDiagnosticsConfigCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkDeviceDiagnosticsConfigFlagsNV flags; -} VkDeviceDiagnosticsConfigCreateInfoNV; - -typedef struct VkDeviceFaultAddressInfoEXT -{ - VkDeviceFaultAddressTypeEXT addressType; - VkDeviceAddress WINE_VK_ALIGN(8) reportedAddress; - VkDeviceSize WINE_VK_ALIGN(8) addressPrecision; -} VkDeviceFaultAddressInfoEXT; - -typedef struct VkDeviceFaultCountsEXT -{ - VkStructureType sType; - void *pNext; - uint32_t addressInfoCount; - uint32_t vendorInfoCount; - VkDeviceSize WINE_VK_ALIGN(8) vendorBinarySize; -} VkDeviceFaultCountsEXT; - -typedef struct VkDeviceFaultVendorBinaryHeaderVersionOneEXT -{ - uint32_t headerSize; - VkDeviceFaultVendorBinaryHeaderVersionEXT headerVersion; - uint32_t vendorID; - uint32_t deviceID; - uint32_t driverVersion; - uint8_t pipelineCacheUUID[VK_UUID_SIZE]; - uint32_t applicationNameOffset; - uint32_t applicationVersion; - uint32_t engineNameOffset; - uint32_t engineVersion; - uint32_t apiVersion; -} VkDeviceFaultVendorBinaryHeaderVersionOneEXT; - -typedef struct VkDeviceFaultVendorInfoEXT -{ - char description[VK_MAX_DESCRIPTION_SIZE]; - uint64_t WINE_VK_ALIGN(8) vendorFaultCode; - uint64_t WINE_VK_ALIGN(8) vendorFaultData; -} VkDeviceFaultVendorInfoEXT; - -typedef struct VkDeviceGroupBindSparseInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t resourceDeviceIndex; - uint32_t memoryDeviceIndex; -} VkDeviceGroupBindSparseInfo; -typedef VkDeviceGroupBindSparseInfo VkDeviceGroupBindSparseInfoKHR; - -typedef struct VkDeviceGroupCommandBufferBeginInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t deviceMask; -} VkDeviceGroupCommandBufferBeginInfo; -typedef VkDeviceGroupCommandBufferBeginInfo VkDeviceGroupCommandBufferBeginInfoKHR; - -typedef struct VkDeviceGroupDeviceCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t physicalDeviceCount; - const VkPhysicalDevice *pPhysicalDevices; -} VkDeviceGroupDeviceCreateInfo; -typedef VkDeviceGroupDeviceCreateInfo VkDeviceGroupDeviceCreateInfoKHR; - -typedef struct VkDeviceGroupPresentCapabilitiesKHR -{ - VkStructureType sType; - void *pNext; - uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE]; - VkDeviceGroupPresentModeFlagsKHR modes; -} VkDeviceGroupPresentCapabilitiesKHR; - -typedef struct VkDeviceGroupPresentInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t swapchainCount; - const uint32_t *pDeviceMasks; - VkDeviceGroupPresentModeFlagBitsKHR mode; -} VkDeviceGroupPresentInfoKHR; - -typedef struct VkDeviceGroupSubmitInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t waitSemaphoreCount; - const uint32_t *pWaitSemaphoreDeviceIndices; - uint32_t commandBufferCount; - const uint32_t *pCommandBufferDeviceMasks; - uint32_t signalSemaphoreCount; - const uint32_t *pSignalSemaphoreDeviceIndices; -} VkDeviceGroupSubmitInfo; -typedef VkDeviceGroupSubmitInfo VkDeviceGroupSubmitInfoKHR; - -typedef struct VkDeviceGroupSwapchainCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkDeviceGroupPresentModeFlagsKHR modes; -} VkDeviceGroupSwapchainCreateInfoKHR; - -typedef struct VkDeviceMemoryOpaqueCaptureAddressInfo -{ - VkStructureType sType; - const void *pNext; - VkDeviceMemory WINE_VK_ALIGN(8) memory; -} VkDeviceMemoryOpaqueCaptureAddressInfo; -typedef VkDeviceMemoryOpaqueCaptureAddressInfo VkDeviceMemoryOpaqueCaptureAddressInfoKHR; - -typedef struct VkDeviceMemoryOverallocationCreateInfoAMD -{ - VkStructureType sType; - const void *pNext; - VkMemoryOverallocationBehaviorAMD overallocationBehavior; -} VkDeviceMemoryOverallocationCreateInfoAMD; - -typedef union VkDeviceOrHostAddressConstKHR -{ - VkDeviceAddress WINE_VK_ALIGN(8) deviceAddress; - const void *hostAddress; -} VkDeviceOrHostAddressConstKHR; - -typedef union VkDeviceOrHostAddressKHR -{ - VkDeviceAddress WINE_VK_ALIGN(8) deviceAddress; - void *hostAddress; -} VkDeviceOrHostAddressKHR; - -typedef struct VkDevicePipelineBinaryInternalCacheControlKHR -{ - VkStructureType sType; - const void *pNext; - VkBool32 disableInternalCache; -} VkDevicePipelineBinaryInternalCacheControlKHR; - -typedef struct VkDevicePrivateDataCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t privateDataSlotRequestCount; -} VkDevicePrivateDataCreateInfo; -typedef VkDevicePrivateDataCreateInfo VkDevicePrivateDataCreateInfoEXT; - -typedef struct VkDeviceQueueCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkDeviceQueueCreateFlags flags; - uint32_t queueFamilyIndex; - uint32_t queueCount; - const float *pQueuePriorities; -} VkDeviceQueueCreateInfo; - -typedef struct VkDeviceQueueGlobalPriorityCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkQueueGlobalPriority globalPriority; -} VkDeviceQueueGlobalPriorityCreateInfo; -typedef VkDeviceQueueGlobalPriorityCreateInfo VkDeviceQueueGlobalPriorityCreateInfoKHR; -typedef VkDeviceQueueGlobalPriorityCreateInfo VkDeviceQueueGlobalPriorityCreateInfoEXT; - -typedef struct VkDeviceQueueInfo2 -{ - VkStructureType sType; - const void *pNext; - VkDeviceQueueCreateFlags flags; - uint32_t queueFamilyIndex; - uint32_t queueIndex; -} VkDeviceQueueInfo2; - -typedef struct VkDeviceQueueShaderCoreControlCreateInfoARM -{ - VkStructureType sType; - void *pNext; - uint32_t shaderCoreCount; -} VkDeviceQueueShaderCoreControlCreateInfoARM; - -typedef struct VkDispatchIndirectCommand -{ - uint32_t x; - uint32_t y; - uint32_t z; -} VkDispatchIndirectCommand; - -typedef struct VkDrawIndexedIndirectCommand -{ - uint32_t indexCount; - uint32_t instanceCount; - uint32_t firstIndex; - int32_t vertexOffset; - uint32_t firstInstance; -} VkDrawIndexedIndirectCommand; - -typedef struct VkDrawIndirectCommand -{ - uint32_t vertexCount; - uint32_t instanceCount; - uint32_t firstVertex; - uint32_t firstInstance; -} VkDrawIndirectCommand; - -typedef struct VkDrawIndirectCountIndirectCommandEXT -{ - VkDeviceAddress WINE_VK_ALIGN(8) bufferAddress; - uint32_t stride; - uint32_t commandCount; -} VkDrawIndirectCountIndirectCommandEXT; - -typedef struct VkDrawMeshTasksIndirectCommandEXT -{ - uint32_t groupCountX; - uint32_t groupCountY; - uint32_t groupCountZ; -} VkDrawMeshTasksIndirectCommandEXT; - -typedef struct VkDrawMeshTasksIndirectCommandNV -{ - uint32_t taskCount; - uint32_t firstTask; -} VkDrawMeshTasksIndirectCommandNV; - -typedef struct VkEventCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkEventCreateFlags flags; -} VkEventCreateInfo; - -typedef struct VkExportFenceCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkExternalFenceHandleTypeFlags handleTypes; -} VkExportFenceCreateInfo; -typedef VkExportFenceCreateInfo VkExportFenceCreateInfoKHR; - -typedef struct VkExportMemoryAllocateInfo -{ - VkStructureType sType; - const void *pNext; - VkExternalMemoryHandleTypeFlags handleTypes; -} VkExportMemoryAllocateInfo; -typedef VkExportMemoryAllocateInfo VkExportMemoryAllocateInfoKHR; - -typedef struct VkExportMemoryWin32HandleInfoKHR -{ - VkStructureType sType; - const void *pNext; - const SECURITY_ATTRIBUTES *pAttributes; - DWORD dwAccess; - LPCWSTR name; -} VkExportMemoryWin32HandleInfoKHR; - -typedef struct VkExportSemaphoreCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkExternalSemaphoreHandleTypeFlags handleTypes; -} VkExportSemaphoreCreateInfo; -typedef VkExportSemaphoreCreateInfo VkExportSemaphoreCreateInfoKHR; - -typedef struct VkExtensionProperties -{ - char extensionName[VK_MAX_EXTENSION_NAME_SIZE]; - uint32_t specVersion; -} VkExtensionProperties; - -typedef struct VkExtent2D -{ - uint32_t width; - uint32_t height; -} VkExtent2D; - -typedef struct VkExtent3D -{ - uint32_t width; - uint32_t height; - uint32_t depth; -} VkExtent3D; - -typedef struct VkExternalFenceProperties -{ - VkStructureType sType; - void *pNext; - VkExternalFenceHandleTypeFlags exportFromImportedHandleTypes; - VkExternalFenceHandleTypeFlags compatibleHandleTypes; - VkExternalFenceFeatureFlags externalFenceFeatures; -} VkExternalFenceProperties; -typedef VkExternalFenceProperties VkExternalFencePropertiesKHR; - -typedef struct VkExternalMemoryAcquireUnmodifiedEXT -{ - VkStructureType sType; - const void *pNext; - VkBool32 acquireUnmodifiedMemory; -} VkExternalMemoryAcquireUnmodifiedEXT; - -typedef struct VkExternalMemoryBufferCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkExternalMemoryHandleTypeFlags handleTypes; -} VkExternalMemoryBufferCreateInfo; -typedef VkExternalMemoryBufferCreateInfo VkExternalMemoryBufferCreateInfoKHR; - -typedef struct VkExternalMemoryImageCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkExternalMemoryHandleTypeFlags handleTypes; -} VkExternalMemoryImageCreateInfo; -typedef VkExternalMemoryImageCreateInfo VkExternalMemoryImageCreateInfoKHR; - -typedef struct VkExternalMemoryProperties -{ - VkExternalMemoryFeatureFlags externalMemoryFeatures; - VkExternalMemoryHandleTypeFlags exportFromImportedHandleTypes; - VkExternalMemoryHandleTypeFlags compatibleHandleTypes; -} VkExternalMemoryProperties; -typedef VkExternalMemoryProperties VkExternalMemoryPropertiesKHR; - -typedef struct VkExternalSemaphoreProperties -{ - VkStructureType sType; - void *pNext; - VkExternalSemaphoreHandleTypeFlags exportFromImportedHandleTypes; - VkExternalSemaphoreHandleTypeFlags compatibleHandleTypes; - VkExternalSemaphoreFeatureFlags externalSemaphoreFeatures; -} VkExternalSemaphoreProperties; -typedef VkExternalSemaphoreProperties VkExternalSemaphorePropertiesKHR; - -typedef struct VkFenceCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkFenceCreateFlags flags; -} VkFenceCreateInfo; - -typedef struct VkFilterCubicImageViewImageFormatPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 filterCubic; - VkBool32 filterCubicMinmax; -} VkFilterCubicImageViewImageFormatPropertiesEXT; - -typedef struct VkFormatProperties -{ - VkFormatFeatureFlags linearTilingFeatures; - VkFormatFeatureFlags optimalTilingFeatures; - VkFormatFeatureFlags bufferFeatures; -} VkFormatProperties; - -typedef struct VkFormatProperties2 -{ - VkStructureType sType; - void *pNext; - VkFormatProperties formatProperties; -} VkFormatProperties2; -typedef VkFormatProperties2 VkFormatProperties2KHR; - -typedef struct VkFormatProperties3 -{ - VkStructureType sType; - void *pNext; - VkFormatFeatureFlags2 WINE_VK_ALIGN(8) linearTilingFeatures; - VkFormatFeatureFlags2 WINE_VK_ALIGN(8) optimalTilingFeatures; - VkFormatFeatureFlags2 WINE_VK_ALIGN(8) bufferFeatures; -} VkFormatProperties3; -typedef VkFormatProperties3 VkFormatProperties3KHR; - -typedef struct VkFragmentShadingRateAttachmentInfoKHR -{ - VkStructureType sType; - const void *pNext; - const VkAttachmentReference2 *pFragmentShadingRateAttachment; - VkExtent2D shadingRateAttachmentTexelSize; -} VkFragmentShadingRateAttachmentInfoKHR; - -typedef struct VkFrameBoundaryEXT -{ - VkStructureType sType; - const void *pNext; - VkFrameBoundaryFlagsEXT flags; - uint64_t WINE_VK_ALIGN(8) frameID; - uint32_t imageCount; - const VkImage *pImages; - uint32_t bufferCount; - const VkBuffer *pBuffers; - uint64_t WINE_VK_ALIGN(8) tagName; - size_t tagSize; - const void *pTag; -} VkFrameBoundaryEXT; - -typedef struct VkFramebufferAttachmentImageInfo -{ - VkStructureType sType; - const void *pNext; - VkImageCreateFlags flags; - VkImageUsageFlags usage; - uint32_t width; - uint32_t height; - uint32_t layerCount; - uint32_t viewFormatCount; - const VkFormat *pViewFormats; -} VkFramebufferAttachmentImageInfo; -typedef VkFramebufferAttachmentImageInfo VkFramebufferAttachmentImageInfoKHR; - -typedef struct VkFramebufferAttachmentsCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t attachmentImageInfoCount; - const VkFramebufferAttachmentImageInfo *pAttachmentImageInfos; -} VkFramebufferAttachmentsCreateInfo; -typedef VkFramebufferAttachmentsCreateInfo VkFramebufferAttachmentsCreateInfoKHR; - -typedef struct VkFramebufferCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkFramebufferCreateFlags flags; - VkRenderPass WINE_VK_ALIGN(8) renderPass; - uint32_t attachmentCount; - const VkImageView *pAttachments; - uint32_t width; - uint32_t height; - uint32_t layers; -} VkFramebufferCreateInfo; - -typedef struct VkFramebufferMixedSamplesCombinationNV -{ - VkStructureType sType; - void *pNext; - VkCoverageReductionModeNV coverageReductionMode; - VkSampleCountFlagBits rasterizationSamples; - VkSampleCountFlags depthStencilSamples; - VkSampleCountFlags colorSamples; -} VkFramebufferMixedSamplesCombinationNV; - -typedef struct VkGeneratedCommandsInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkShaderStageFlags shaderStages; - VkIndirectExecutionSetEXT WINE_VK_ALIGN(8) indirectExecutionSet; - VkIndirectCommandsLayoutEXT WINE_VK_ALIGN(8) indirectCommandsLayout; - VkDeviceAddress WINE_VK_ALIGN(8) indirectAddress; - VkDeviceSize WINE_VK_ALIGN(8) indirectAddressSize; - VkDeviceAddress WINE_VK_ALIGN(8) preprocessAddress; - VkDeviceSize WINE_VK_ALIGN(8) preprocessSize; - uint32_t maxSequenceCount; - VkDeviceAddress WINE_VK_ALIGN(8) sequenceCountAddress; - uint32_t maxDrawCount; -} VkGeneratedCommandsInfoEXT; - -typedef struct VkGeneratedCommandsMemoryRequirementsInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkIndirectExecutionSetEXT WINE_VK_ALIGN(8) indirectExecutionSet; - VkIndirectCommandsLayoutEXT WINE_VK_ALIGN(8) indirectCommandsLayout; - uint32_t maxSequenceCount; - uint32_t maxDrawCount; -} VkGeneratedCommandsMemoryRequirementsInfoEXT; - -typedef struct VkGeneratedCommandsMemoryRequirementsInfoNV -{ - VkStructureType sType; - const void *pNext; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline WINE_VK_ALIGN(8) pipeline; - VkIndirectCommandsLayoutNV WINE_VK_ALIGN(8) indirectCommandsLayout; - uint32_t maxSequencesCount; -} VkGeneratedCommandsMemoryRequirementsInfoNV; - -typedef struct VkGeneratedCommandsPipelineInfoEXT -{ - VkStructureType sType; - void *pNext; - VkPipeline WINE_VK_ALIGN(8) pipeline; -} VkGeneratedCommandsPipelineInfoEXT; - -typedef struct VkGeneratedCommandsShaderInfoEXT -{ - VkStructureType sType; - void *pNext; - uint32_t shaderCount; - const VkShaderEXT *pShaders; -} VkGeneratedCommandsShaderInfoEXT; - -typedef struct VkGeometryAABBNV -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) aabbData; - uint32_t numAABBs; - uint32_t stride; - VkDeviceSize WINE_VK_ALIGN(8) offset; -} VkGeometryAABBNV; - -typedef struct VkGeometryTrianglesNV -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) vertexData; - VkDeviceSize WINE_VK_ALIGN(8) vertexOffset; - uint32_t vertexCount; - VkDeviceSize WINE_VK_ALIGN(8) vertexStride; - VkFormat vertexFormat; - VkBuffer WINE_VK_ALIGN(8) indexData; - VkDeviceSize WINE_VK_ALIGN(8) indexOffset; - uint32_t indexCount; - VkIndexType indexType; - VkBuffer WINE_VK_ALIGN(8) transformData; - VkDeviceSize WINE_VK_ALIGN(8) transformOffset; -} VkGeometryTrianglesNV; - -typedef struct VkGraphicsPipelineLibraryCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkGraphicsPipelineLibraryFlagsEXT flags; -} VkGraphicsPipelineLibraryCreateInfoEXT; - -typedef struct VkHdrVividDynamicMetadataHUAWEI -{ - VkStructureType sType; - const void *pNext; - size_t dynamicMetadataSize; - const void *pDynamicMetadata; -} VkHdrVividDynamicMetadataHUAWEI; - -typedef struct VkHostImageCopyDevicePerformanceQuery -{ - VkStructureType sType; - void *pNext; - VkBool32 optimalDeviceAccess; - VkBool32 identicalMemoryLayout; -} VkHostImageCopyDevicePerformanceQuery; -typedef VkHostImageCopyDevicePerformanceQuery VkHostImageCopyDevicePerformanceQueryEXT; - -typedef struct VkImageAlignmentControlCreateInfoMESA -{ - VkStructureType sType; - const void *pNext; - uint32_t maximumRequestedAlignment; -} VkImageAlignmentControlCreateInfoMESA; - -typedef struct VkImageCaptureDescriptorDataInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) image; -} VkImageCaptureDescriptorDataInfoEXT; - -typedef struct VkImageCompressionControlEXT -{ - VkStructureType sType; - const void *pNext; - VkImageCompressionFlagsEXT flags; - uint32_t compressionControlPlaneCount; - VkImageCompressionFixedRateFlagsEXT *pFixedRateFlags; -} VkImageCompressionControlEXT; - -typedef struct VkImageCompressionPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkImageCompressionFlagsEXT imageCompressionFlags; - VkImageCompressionFixedRateFlagsEXT imageCompressionFixedRateFlags; -} VkImageCompressionPropertiesEXT; - -typedef struct VkImageCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkImageCreateFlags flags; - VkImageType imageType; - VkFormat format; - VkExtent3D extent; - uint32_t mipLevels; - uint32_t arrayLayers; - VkSampleCountFlagBits samples; - VkImageTiling tiling; - VkImageUsageFlags usage; - VkSharingMode sharingMode; - uint32_t queueFamilyIndexCount; - const uint32_t *pQueueFamilyIndices; - VkImageLayout initialLayout; -} VkImageCreateInfo; - -typedef struct VkImageFormatListCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t viewFormatCount; - const VkFormat *pViewFormats; -} VkImageFormatListCreateInfo; -typedef VkImageFormatListCreateInfo VkImageFormatListCreateInfoKHR; - -typedef struct VkImageFormatProperties -{ - VkExtent3D maxExtent; - uint32_t maxMipLevels; - uint32_t maxArrayLayers; - VkSampleCountFlags sampleCounts; - VkDeviceSize WINE_VK_ALIGN(8) maxResourceSize; -} VkImageFormatProperties; - -typedef struct VkImageFormatProperties2 -{ - VkStructureType sType; - void *pNext; - VkImageFormatProperties WINE_VK_ALIGN(8) imageFormatProperties; -} VkImageFormatProperties2; -typedef VkImageFormatProperties2 VkImageFormatProperties2KHR; - -typedef struct VkImageMemoryRequirementsInfo2 -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) image; -} VkImageMemoryRequirementsInfo2; -typedef VkImageMemoryRequirementsInfo2 VkImageMemoryRequirementsInfo2KHR; - -typedef struct VkImagePlaneMemoryRequirementsInfo -{ - VkStructureType sType; - const void *pNext; - VkImageAspectFlagBits planeAspect; -} VkImagePlaneMemoryRequirementsInfo; -typedef VkImagePlaneMemoryRequirementsInfo VkImagePlaneMemoryRequirementsInfoKHR; - -typedef struct VkImageSparseMemoryRequirementsInfo2 -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) image; -} VkImageSparseMemoryRequirementsInfo2; -typedef VkImageSparseMemoryRequirementsInfo2 VkImageSparseMemoryRequirementsInfo2KHR; - -typedef struct VkImageStencilUsageCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkImageUsageFlags stencilUsage; -} VkImageStencilUsageCreateInfo; -typedef VkImageStencilUsageCreateInfo VkImageStencilUsageCreateInfoEXT; - -typedef struct VkImageSubresource -{ - VkImageAspectFlags aspectMask; - uint32_t mipLevel; - uint32_t arrayLayer; -} VkImageSubresource; - -typedef struct VkImageSubresource2 -{ - VkStructureType sType; - void *pNext; - VkImageSubresource imageSubresource; -} VkImageSubresource2; -typedef VkImageSubresource2 VkImageSubresource2KHR; -typedef VkImageSubresource2 VkImageSubresource2EXT; - -typedef struct VkImageSubresourceLayers -{ - VkImageAspectFlags aspectMask; - uint32_t mipLevel; - uint32_t baseArrayLayer; - uint32_t layerCount; -} VkImageSubresourceLayers; - -typedef struct VkImageSubresourceRange -{ - VkImageAspectFlags aspectMask; - uint32_t baseMipLevel; - uint32_t levelCount; - uint32_t baseArrayLayer; - uint32_t layerCount; -} VkImageSubresourceRange; - -typedef struct VkImageSwapchainCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkSwapchainKHR WINE_VK_ALIGN(8) swapchain; -} VkImageSwapchainCreateInfoKHR; - -typedef struct VkImageViewASTCDecodeModeEXT -{ - VkStructureType sType; - const void *pNext; - VkFormat decodeMode; -} VkImageViewASTCDecodeModeEXT; - -typedef struct VkImageViewAddressPropertiesNVX -{ - VkStructureType sType; - void *pNext; - VkDeviceAddress WINE_VK_ALIGN(8) deviceAddress; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkImageViewAddressPropertiesNVX; - -typedef struct VkImageViewCaptureDescriptorDataInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkImageView WINE_VK_ALIGN(8) imageView; -} VkImageViewCaptureDescriptorDataInfoEXT; - -typedef struct VkImageViewCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkImageViewCreateFlags flags; - VkImage WINE_VK_ALIGN(8) image; - VkImageViewType viewType; - VkFormat format; - VkComponentMapping components; - VkImageSubresourceRange subresourceRange; -} VkImageViewCreateInfo; - -typedef struct VkImageViewHandleInfoNVX -{ - VkStructureType sType; - const void *pNext; - VkImageView WINE_VK_ALIGN(8) imageView; - VkDescriptorType descriptorType; - VkSampler WINE_VK_ALIGN(8) sampler; -} VkImageViewHandleInfoNVX; - -typedef struct VkImageViewMinLodCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - float minLod; -} VkImageViewMinLodCreateInfoEXT; - -typedef struct VkImageViewSlicedCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t sliceOffset; - uint32_t sliceCount; -} VkImageViewSlicedCreateInfoEXT; - -typedef struct VkImageViewUsageCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkImageUsageFlags usage; -} VkImageViewUsageCreateInfo; -typedef VkImageViewUsageCreateInfo VkImageViewUsageCreateInfoKHR; - -typedef struct VkImportMemoryHostPointerInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkExternalMemoryHandleTypeFlagBits handleType; - void *pHostPointer; -} VkImportMemoryHostPointerInfoEXT; - -typedef struct VkImportMemoryWin32HandleInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkExternalMemoryHandleTypeFlagBits handleType; - HANDLE handle; - LPCWSTR name; -} VkImportMemoryWin32HandleInfoKHR; - -typedef struct VkIndirectCommandsExecutionSetTokenEXT -{ - VkIndirectExecutionSetInfoTypeEXT type; - VkShaderStageFlags shaderStages; -} VkIndirectCommandsExecutionSetTokenEXT; - -typedef struct VkIndirectCommandsIndexBufferTokenEXT -{ - VkIndirectCommandsInputModeFlagBitsEXT mode; -} VkIndirectCommandsIndexBufferTokenEXT; - -typedef struct VkIndirectCommandsLayoutTokenNV -{ - VkStructureType sType; - const void *pNext; - VkIndirectCommandsTokenTypeNV tokenType; - uint32_t stream; - uint32_t offset; - uint32_t vertexBindingUnit; - VkBool32 vertexDynamicStride; - VkPipelineLayout WINE_VK_ALIGN(8) pushconstantPipelineLayout; - VkShaderStageFlags pushconstantShaderStageFlags; - uint32_t pushconstantOffset; - uint32_t pushconstantSize; - VkIndirectStateFlagsNV indirectStateFlags; - uint32_t indexTypeCount; - const VkIndexType *pIndexTypes; - const uint32_t *pIndexTypeValues; -} VkIndirectCommandsLayoutTokenNV; - -typedef struct VkIndirectCommandsStreamNV -{ - VkBuffer WINE_VK_ALIGN(8) buffer; - VkDeviceSize WINE_VK_ALIGN(8) offset; -} VkIndirectCommandsStreamNV; - -typedef struct VkIndirectCommandsVertexBufferTokenEXT -{ - uint32_t vertexBindingUnit; -} VkIndirectCommandsVertexBufferTokenEXT; - -typedef struct VkIndirectExecutionSetPipelineInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkPipeline WINE_VK_ALIGN(8) initialPipeline; - uint32_t maxPipelineCount; -} VkIndirectExecutionSetPipelineInfoEXT; - -typedef struct VkIndirectExecutionSetShaderLayoutInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t setLayoutCount; - const VkDescriptorSetLayout *pSetLayouts; -} VkIndirectExecutionSetShaderLayoutInfoEXT; - -typedef struct VkInitializePerformanceApiInfoINTEL -{ - VkStructureType sType; - const void *pNext; - void *pUserData; -} VkInitializePerformanceApiInfoINTEL; - -typedef struct VkInputAttachmentAspectReference -{ - uint32_t subpass; - uint32_t inputAttachmentIndex; - VkImageAspectFlags aspectMask; -} VkInputAttachmentAspectReference; -typedef VkInputAttachmentAspectReference VkInputAttachmentAspectReferenceKHR; - -typedef struct VkInstanceCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkInstanceCreateFlags flags; - const VkApplicationInfo *pApplicationInfo; - uint32_t enabledLayerCount; - const char * const*ppEnabledLayerNames; - uint32_t enabledExtensionCount; - const char * const*ppEnabledExtensionNames; -} VkInstanceCreateInfo; - -typedef struct VkLatencySleepInfoNV -{ - VkStructureType sType; - const void *pNext; - VkSemaphore WINE_VK_ALIGN(8) signalSemaphore; - uint64_t WINE_VK_ALIGN(8) value; -} VkLatencySleepInfoNV; - -typedef struct VkLatencySleepModeInfoNV -{ - VkStructureType sType; - const void *pNext; - VkBool32 lowLatencyMode; - VkBool32 lowLatencyBoost; - uint32_t minimumIntervalUs; -} VkLatencySleepModeInfoNV; - -typedef struct VkLatencySubmissionPresentIdNV -{ - VkStructureType sType; - const void *pNext; - uint64_t WINE_VK_ALIGN(8) presentID; -} VkLatencySubmissionPresentIdNV; - -typedef struct VkLatencySurfaceCapabilitiesNV -{ - VkStructureType sType; - const void *pNext; - uint32_t presentModeCount; - VkPresentModeKHR *pPresentModes; -} VkLatencySurfaceCapabilitiesNV; - -typedef struct VkLatencyTimingsFrameReportNV -{ - VkStructureType sType; - const void *pNext; - uint64_t WINE_VK_ALIGN(8) presentID; - uint64_t WINE_VK_ALIGN(8) inputSampleTimeUs; - uint64_t WINE_VK_ALIGN(8) simStartTimeUs; - uint64_t WINE_VK_ALIGN(8) simEndTimeUs; - uint64_t WINE_VK_ALIGN(8) renderSubmitStartTimeUs; - uint64_t WINE_VK_ALIGN(8) renderSubmitEndTimeUs; - uint64_t WINE_VK_ALIGN(8) presentStartTimeUs; - uint64_t WINE_VK_ALIGN(8) presentEndTimeUs; - uint64_t WINE_VK_ALIGN(8) driverStartTimeUs; - uint64_t WINE_VK_ALIGN(8) driverEndTimeUs; - uint64_t WINE_VK_ALIGN(8) osRenderQueueStartTimeUs; - uint64_t WINE_VK_ALIGN(8) osRenderQueueEndTimeUs; - uint64_t WINE_VK_ALIGN(8) gpuRenderStartTimeUs; - uint64_t WINE_VK_ALIGN(8) gpuRenderEndTimeUs; -} VkLatencyTimingsFrameReportNV; - -typedef struct VkLayerProperties -{ - char layerName[VK_MAX_EXTENSION_NAME_SIZE]; - uint32_t specVersion; - uint32_t implementationVersion; - char description[VK_MAX_DESCRIPTION_SIZE]; -} VkLayerProperties; - -typedef struct VkLayerSettingEXT -{ - const char *pLayerName; - const char *pSettingName; - VkLayerSettingTypeEXT type; - uint32_t valueCount; - const void *pValues; -} VkLayerSettingEXT; - -typedef struct VkLayerSettingsCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t settingCount; - const VkLayerSettingEXT *pSettings; -} VkLayerSettingsCreateInfoEXT; - -typedef struct VkMappedMemoryRange -{ - VkStructureType sType; - const void *pNext; - VkDeviceMemory WINE_VK_ALIGN(8) memory; - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkMappedMemoryRange; - -typedef struct VkMemoryAllocateFlagsInfo -{ - VkStructureType sType; - const void *pNext; - VkMemoryAllocateFlags flags; - uint32_t deviceMask; -} VkMemoryAllocateFlagsInfo; -typedef VkMemoryAllocateFlagsInfo VkMemoryAllocateFlagsInfoKHR; - -typedef struct VkMemoryAllocateInfo -{ - VkStructureType sType; - const void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) allocationSize; - uint32_t memoryTypeIndex; -} VkMemoryAllocateInfo; - -typedef struct VkMemoryBarrier -{ - VkStructureType sType; - const void *pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; -} VkMemoryBarrier; - -typedef struct VkMemoryBarrier2 -{ - VkStructureType sType; - const void *pNext; - VkPipelineStageFlags2 WINE_VK_ALIGN(8) srcStageMask; - VkAccessFlags2 WINE_VK_ALIGN(8) srcAccessMask; - VkPipelineStageFlags2 WINE_VK_ALIGN(8) dstStageMask; - VkAccessFlags2 WINE_VK_ALIGN(8) dstAccessMask; -} VkMemoryBarrier2; -typedef VkMemoryBarrier2 VkMemoryBarrier2KHR; - -typedef struct VkMemoryDedicatedAllocateInfo -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) image; - VkBuffer WINE_VK_ALIGN(8) buffer; -} VkMemoryDedicatedAllocateInfo; -typedef VkMemoryDedicatedAllocateInfo VkMemoryDedicatedAllocateInfoKHR; - -typedef struct VkMemoryDedicatedRequirements -{ - VkStructureType sType; - void *pNext; - VkBool32 prefersDedicatedAllocation; - VkBool32 requiresDedicatedAllocation; -} VkMemoryDedicatedRequirements; -typedef VkMemoryDedicatedRequirements VkMemoryDedicatedRequirementsKHR; - -typedef struct VkMemoryGetWin32HandleInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkDeviceMemory WINE_VK_ALIGN(8) memory; - VkExternalMemoryHandleTypeFlagBits handleType; -} VkMemoryGetWin32HandleInfoKHR; - -typedef struct VkMemoryHeap -{ - VkDeviceSize WINE_VK_ALIGN(8) size; - VkMemoryHeapFlags flags; -} VkMemoryHeap; - -typedef struct VkMemoryHostPointerPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t memoryTypeBits; -} VkMemoryHostPointerPropertiesEXT; - -typedef struct VkMemoryMapInfo -{ - VkStructureType sType; - const void *pNext; - VkMemoryMapFlags flags; - VkDeviceMemory WINE_VK_ALIGN(8) memory; - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkMemoryMapInfo; -typedef VkMemoryMapInfo VkMemoryMapInfoKHR; - -typedef struct VkMemoryMapPlacedInfoEXT -{ - VkStructureType sType; - const void *pNext; - void *pPlacedAddress; -} VkMemoryMapPlacedInfoEXT; - -typedef struct VkMemoryOpaqueCaptureAddressAllocateInfo -{ - VkStructureType sType; - const void *pNext; - uint64_t WINE_VK_ALIGN(8) opaqueCaptureAddress; -} VkMemoryOpaqueCaptureAddressAllocateInfo; -typedef VkMemoryOpaqueCaptureAddressAllocateInfo VkMemoryOpaqueCaptureAddressAllocateInfoKHR; - -typedef struct VkMemoryPriorityAllocateInfoEXT -{ - VkStructureType sType; - const void *pNext; - float priority; -} VkMemoryPriorityAllocateInfoEXT; - -typedef struct VkMemoryRequirements -{ - VkDeviceSize WINE_VK_ALIGN(8) size; - VkDeviceSize WINE_VK_ALIGN(8) alignment; - uint32_t memoryTypeBits; -} VkMemoryRequirements; - -typedef struct VkMemoryRequirements2 -{ - VkStructureType sType; - void *pNext; - VkMemoryRequirements WINE_VK_ALIGN(8) memoryRequirements; -} VkMemoryRequirements2; -typedef VkMemoryRequirements2 VkMemoryRequirements2KHR; - - -typedef struct VkMemoryType -{ - VkMemoryPropertyFlags propertyFlags; - uint32_t heapIndex; -} VkMemoryType; - -typedef struct VkMemoryUnmapInfo -{ - VkStructureType sType; - const void *pNext; - VkMemoryUnmapFlags flags; - VkDeviceMemory WINE_VK_ALIGN(8) memory; -} VkMemoryUnmapInfo; -typedef VkMemoryUnmapInfo VkMemoryUnmapInfoKHR; - -typedef struct VkMemoryWin32HandlePropertiesKHR -{ - VkStructureType sType; - void *pNext; - uint32_t memoryTypeBits; -} VkMemoryWin32HandlePropertiesKHR; - -typedef struct VkMicromapBuildSizesInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) micromapSize; - VkDeviceSize WINE_VK_ALIGN(8) buildScratchSize; - VkBool32 discardable; -} VkMicromapBuildSizesInfoEXT; - -typedef struct VkMicromapCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkMicromapCreateFlagsEXT createFlags; - VkBuffer WINE_VK_ALIGN(8) buffer; - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkDeviceSize WINE_VK_ALIGN(8) size; - VkMicromapTypeEXT type; - VkDeviceAddress WINE_VK_ALIGN(8) deviceAddress; -} VkMicromapCreateInfoEXT; - -typedef struct VkMicromapTriangleEXT -{ - uint32_t dataOffset; - uint16_t subdivisionLevel; - uint16_t format; -} VkMicromapTriangleEXT; - -typedef struct VkMicromapUsageEXT -{ - uint32_t count; - uint32_t subdivisionLevel; - uint32_t format; -} VkMicromapUsageEXT; - -typedef struct VkMicromapVersionInfoEXT -{ - VkStructureType sType; - const void *pNext; - const uint8_t *pVersionData; -} VkMicromapVersionInfoEXT; - -typedef struct VkMultiDrawIndexedInfoEXT -{ - uint32_t firstIndex; - uint32_t indexCount; - int32_t vertexOffset; -} VkMultiDrawIndexedInfoEXT; - -typedef struct VkMultiDrawInfoEXT -{ - uint32_t firstVertex; - uint32_t vertexCount; -} VkMultiDrawInfoEXT; - -typedef struct VkMultisamplePropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkExtent2D maxSampleLocationGridSize; -} VkMultisamplePropertiesEXT; - -typedef struct VkMultisampledRenderToSingleSampledInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkBool32 multisampledRenderToSingleSampledEnable; - VkSampleCountFlagBits rasterizationSamples; -} VkMultisampledRenderToSingleSampledInfoEXT; - -typedef struct VkMutableDescriptorTypeListEXT -{ - uint32_t descriptorTypeCount; - const VkDescriptorType *pDescriptorTypes; -} VkMutableDescriptorTypeListEXT; -typedef VkMutableDescriptorTypeListEXT VkMutableDescriptorTypeListVALVE; - -typedef struct VkOffset2D -{ - int32_t x; - int32_t y; -} VkOffset2D; - -typedef struct VkOffset3D -{ - int32_t x; - int32_t y; - int32_t z; -} VkOffset3D; - -typedef struct VkOpaqueCaptureDescriptorDataCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - const void *opaqueCaptureDescriptorData; -} VkOpaqueCaptureDescriptorDataCreateInfoEXT; - -typedef struct VkOpticalFlowImageFormatInfoNV -{ - VkStructureType sType; - const void *pNext; - VkOpticalFlowUsageFlagsNV usage; -} VkOpticalFlowImageFormatInfoNV; - -typedef struct VkOpticalFlowImageFormatPropertiesNV -{ - VkStructureType sType; - const void *pNext; - VkFormat format; -} VkOpticalFlowImageFormatPropertiesNV; - -typedef struct VkOpticalFlowSessionCreateInfoNV -{ - VkStructureType sType; - void *pNext; - uint32_t width; - uint32_t height; - VkFormat imageFormat; - VkFormat flowVectorFormat; - VkFormat costFormat; - VkOpticalFlowGridSizeFlagsNV outputGridSize; - VkOpticalFlowGridSizeFlagsNV hintGridSize; - VkOpticalFlowPerformanceLevelNV performanceLevel; - VkOpticalFlowSessionCreateFlagsNV flags; -} VkOpticalFlowSessionCreateInfoNV; - -typedef struct VkOpticalFlowSessionCreatePrivateDataInfoNV -{ - VkStructureType sType; - void *pNext; - uint32_t id; - uint32_t size; - const void *pPrivateData; -} VkOpticalFlowSessionCreatePrivateDataInfoNV; - -typedef struct VkOutOfBandQueueTypeInfoNV -{ - VkStructureType sType; - const void *pNext; - VkOutOfBandQueueTypeNV queueType; -} VkOutOfBandQueueTypeInfoNV; - -typedef struct VkPerformanceConfigurationAcquireInfoINTEL -{ - VkStructureType sType; - const void *pNext; - VkPerformanceConfigurationTypeINTEL type; -} VkPerformanceConfigurationAcquireInfoINTEL; - -typedef struct VkPerformanceCounterDescriptionKHR -{ - VkStructureType sType; - void *pNext; - VkPerformanceCounterDescriptionFlagsKHR flags; - char name[VK_MAX_DESCRIPTION_SIZE]; - char category[VK_MAX_DESCRIPTION_SIZE]; - char description[VK_MAX_DESCRIPTION_SIZE]; -} VkPerformanceCounterDescriptionKHR; - -typedef struct VkPerformanceCounterKHR -{ - VkStructureType sType; - void *pNext; - VkPerformanceCounterUnitKHR unit; - VkPerformanceCounterScopeKHR scope; - VkPerformanceCounterStorageKHR storage; - uint8_t uuid[VK_UUID_SIZE]; -} VkPerformanceCounterKHR; - -typedef union VkPerformanceCounterResultKHR -{ - int32_t int32; - int64_t int64; - uint32_t uint32; - uint64_t WINE_VK_ALIGN(8) uint64; - float float32; - double float64; -} VkPerformanceCounterResultKHR; - -typedef struct VkPerformanceMarkerInfoINTEL -{ - VkStructureType sType; - const void *pNext; - uint64_t WINE_VK_ALIGN(8) marker; -} VkPerformanceMarkerInfoINTEL; - -typedef struct VkPerformanceOverrideInfoINTEL -{ - VkStructureType sType; - const void *pNext; - VkPerformanceOverrideTypeINTEL type; - VkBool32 enable; - uint64_t WINE_VK_ALIGN(8) parameter; -} VkPerformanceOverrideInfoINTEL; - -typedef struct VkPerformanceQueryReservationInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t maxPerformanceQueriesPerPool; -} VkPerformanceQueryReservationInfoKHR; - -typedef struct VkPerformanceQuerySubmitInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t counterPassIndex; -} VkPerformanceQuerySubmitInfoKHR; - -typedef struct VkPerformanceStreamMarkerInfoINTEL -{ - VkStructureType sType; - const void *pNext; - uint32_t marker; -} VkPerformanceStreamMarkerInfoINTEL; - -typedef union VkPerformanceValueDataINTEL -{ - uint32_t value32; - uint64_t WINE_VK_ALIGN(8) value64; - float valueFloat; - VkBool32 valueBool; - const char *valueString; -} VkPerformanceValueDataINTEL; - -typedef struct VkPerformanceValueINTEL -{ - VkPerformanceValueTypeINTEL type; - VkPerformanceValueDataINTEL WINE_VK_ALIGN(8) data; -} VkPerformanceValueINTEL; - -typedef struct VkPhysicalDevice16BitStorageFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 storageBuffer16BitAccess; - VkBool32 uniformAndStorageBuffer16BitAccess; - VkBool32 storagePushConstant16; - VkBool32 storageInputOutput16; -} VkPhysicalDevice16BitStorageFeatures; -typedef VkPhysicalDevice16BitStorageFeatures VkPhysicalDevice16BitStorageFeaturesKHR; - -typedef struct VkPhysicalDevice4444FormatsFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 formatA4R4G4B4; - VkBool32 formatA4B4G4R4; -} VkPhysicalDevice4444FormatsFeaturesEXT; - -typedef struct VkPhysicalDevice8BitStorageFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 storageBuffer8BitAccess; - VkBool32 uniformAndStorageBuffer8BitAccess; - VkBool32 storagePushConstant8; -} VkPhysicalDevice8BitStorageFeatures; -typedef VkPhysicalDevice8BitStorageFeatures VkPhysicalDevice8BitStorageFeaturesKHR; - -typedef struct VkPhysicalDeviceASTCDecodeFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 decodeModeSharedExponent; -} VkPhysicalDeviceASTCDecodeFeaturesEXT; - -typedef struct VkPhysicalDeviceAccelerationStructureFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 accelerationStructure; - VkBool32 accelerationStructureCaptureReplay; - VkBool32 accelerationStructureIndirectBuild; - VkBool32 accelerationStructureHostCommands; - VkBool32 descriptorBindingAccelerationStructureUpdateAfterBind; -} VkPhysicalDeviceAccelerationStructureFeaturesKHR; - -typedef struct VkPhysicalDeviceAccelerationStructurePropertiesKHR -{ - VkStructureType sType; - void *pNext; - uint64_t WINE_VK_ALIGN(8) maxGeometryCount; - uint64_t WINE_VK_ALIGN(8) maxInstanceCount; - uint64_t WINE_VK_ALIGN(8) maxPrimitiveCount; - uint32_t maxPerStageDescriptorAccelerationStructures; - uint32_t maxPerStageDescriptorUpdateAfterBindAccelerationStructures; - uint32_t maxDescriptorSetAccelerationStructures; - uint32_t maxDescriptorSetUpdateAfterBindAccelerationStructures; - uint32_t minAccelerationStructureScratchOffsetAlignment; -} VkPhysicalDeviceAccelerationStructurePropertiesKHR; - -typedef struct VkPhysicalDeviceAddressBindingReportFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 reportAddressBinding; -} VkPhysicalDeviceAddressBindingReportFeaturesEXT; - -typedef struct VkPhysicalDeviceAntiLagFeaturesAMD -{ - VkStructureType sType; - void *pNext; - VkBool32 antiLag; -} VkPhysicalDeviceAntiLagFeaturesAMD; - -typedef struct VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 attachmentFeedbackLoopDynamicState; -} VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT; - -typedef struct VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 attachmentFeedbackLoopLayout; -} VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT; - -typedef struct VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 advancedBlendCoherentOperations; -} VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT; - -typedef struct VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t advancedBlendMaxColorAttachments; - VkBool32 advancedBlendIndependentBlend; - VkBool32 advancedBlendNonPremultipliedSrcColor; - VkBool32 advancedBlendNonPremultipliedDstColor; - VkBool32 advancedBlendCorrelatedOverlap; - VkBool32 advancedBlendAllOperations; -} VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT; - -typedef struct VkPhysicalDeviceBorderColorSwizzleFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 borderColorSwizzle; - VkBool32 borderColorSwizzleFromImage; -} VkPhysicalDeviceBorderColorSwizzleFeaturesEXT; - -typedef struct VkPhysicalDeviceBufferDeviceAddressFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 bufferDeviceAddress; - VkBool32 bufferDeviceAddressCaptureReplay; - VkBool32 bufferDeviceAddressMultiDevice; -} VkPhysicalDeviceBufferDeviceAddressFeatures; -typedef VkPhysicalDeviceBufferDeviceAddressFeatures VkPhysicalDeviceBufferDeviceAddressFeaturesKHR; - -typedef struct VkPhysicalDeviceBufferDeviceAddressFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 bufferDeviceAddress; - VkBool32 bufferDeviceAddressCaptureReplay; - VkBool32 bufferDeviceAddressMultiDevice; -} VkPhysicalDeviceBufferDeviceAddressFeaturesEXT; -typedef VkPhysicalDeviceBufferDeviceAddressFeaturesEXT VkPhysicalDeviceBufferAddressFeaturesEXT; - -typedef struct VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI -{ - VkStructureType sType; - void *pNext; - VkBool32 clustercullingShader; - VkBool32 multiviewClusterCullingShader; -} VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI; - -typedef struct VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI -{ - VkStructureType sType; - void *pNext; - uint32_t maxWorkGroupCount[3]; - uint32_t maxWorkGroupSize[3]; - uint32_t maxOutputClusterCount; - VkDeviceSize WINE_VK_ALIGN(8) indirectBufferOffsetAlignment; -} VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI; - -typedef struct VkPhysicalDeviceClusterCullingShaderVrsFeaturesHUAWEI -{ - VkStructureType sType; - void *pNext; - VkBool32 clusterShadingRate; -} VkPhysicalDeviceClusterCullingShaderVrsFeaturesHUAWEI; - -typedef struct VkPhysicalDeviceCoherentMemoryFeaturesAMD -{ - VkStructureType sType; - void *pNext; - VkBool32 deviceCoherentMemory; -} VkPhysicalDeviceCoherentMemoryFeaturesAMD; - -typedef struct VkPhysicalDeviceColorWriteEnableFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 colorWriteEnable; -} VkPhysicalDeviceColorWriteEnableFeaturesEXT; - -typedef struct VkPhysicalDeviceCommandBufferInheritanceFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 commandBufferInheritance; -} VkPhysicalDeviceCommandBufferInheritanceFeaturesNV; - -typedef struct VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 computeDerivativeGroupQuads; - VkBool32 computeDerivativeGroupLinear; -} VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR; -typedef VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR VkPhysicalDeviceComputeShaderDerivativesFeaturesNV; - -typedef struct VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 meshAndTaskShaderDerivatives; -} VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR; - -typedef struct VkPhysicalDeviceConditionalRenderingFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 conditionalRendering; - VkBool32 inheritedConditionalRendering; -} VkPhysicalDeviceConditionalRenderingFeaturesEXT; - -typedef struct VkPhysicalDeviceConservativeRasterizationPropertiesEXT -{ - VkStructureType sType; - void *pNext; - float primitiveOverestimationSize; - float maxExtraPrimitiveOverestimationSize; - float extraPrimitiveOverestimationSizeGranularity; - VkBool32 primitiveUnderestimation; - VkBool32 conservativePointAndLineRasterization; - VkBool32 degenerateTrianglesRasterized; - VkBool32 degenerateLinesRasterized; - VkBool32 fullyCoveredFragmentShaderInputVariable; - VkBool32 conservativeRasterizationPostDepthCoverage; -} VkPhysicalDeviceConservativeRasterizationPropertiesEXT; - -typedef struct VkPhysicalDeviceCooperativeMatrix2FeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 cooperativeMatrixWorkgroupScope; - VkBool32 cooperativeMatrixFlexibleDimensions; - VkBool32 cooperativeMatrixReductions; - VkBool32 cooperativeMatrixConversions; - VkBool32 cooperativeMatrixPerElementOperations; - VkBool32 cooperativeMatrixTensorAddressing; - VkBool32 cooperativeMatrixBlockLoads; -} VkPhysicalDeviceCooperativeMatrix2FeaturesNV; - -typedef struct VkPhysicalDeviceCooperativeMatrix2PropertiesNV -{ - VkStructureType sType; - void *pNext; - uint32_t cooperativeMatrixWorkgroupScopeMaxWorkgroupSize; - uint32_t cooperativeMatrixFlexibleDimensionsMaxDimension; - uint32_t cooperativeMatrixWorkgroupScopeReservedSharedMemory; -} VkPhysicalDeviceCooperativeMatrix2PropertiesNV; - -typedef struct VkPhysicalDeviceCooperativeMatrixFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 cooperativeMatrix; - VkBool32 cooperativeMatrixRobustBufferAccess; -} VkPhysicalDeviceCooperativeMatrixFeaturesKHR; - -typedef struct VkPhysicalDeviceCooperativeMatrixFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 cooperativeMatrix; - VkBool32 cooperativeMatrixRobustBufferAccess; -} VkPhysicalDeviceCooperativeMatrixFeaturesNV; - -typedef struct VkPhysicalDeviceCooperativeMatrixPropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkShaderStageFlags cooperativeMatrixSupportedStages; -} VkPhysicalDeviceCooperativeMatrixPropertiesKHR; - -typedef struct VkPhysicalDeviceCooperativeMatrixPropertiesNV -{ - VkStructureType sType; - void *pNext; - VkShaderStageFlags cooperativeMatrixSupportedStages; -} VkPhysicalDeviceCooperativeMatrixPropertiesNV; - -typedef struct VkPhysicalDeviceCopyMemoryIndirectFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 indirectCopy; -} VkPhysicalDeviceCopyMemoryIndirectFeaturesNV; - -typedef struct VkPhysicalDeviceCopyMemoryIndirectPropertiesNV -{ - VkStructureType sType; - void *pNext; - VkQueueFlags supportedQueues; -} VkPhysicalDeviceCopyMemoryIndirectPropertiesNV; - -typedef struct VkPhysicalDeviceCornerSampledImageFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 cornerSampledImage; -} VkPhysicalDeviceCornerSampledImageFeaturesNV; - -typedef struct VkPhysicalDeviceCoverageReductionModeFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 coverageReductionMode; -} VkPhysicalDeviceCoverageReductionModeFeaturesNV; - -typedef struct VkPhysicalDeviceCubicClampFeaturesQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 cubicRangeClamp; -} VkPhysicalDeviceCubicClampFeaturesQCOM; - -typedef struct VkPhysicalDeviceCubicWeightsFeaturesQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 selectableCubicWeights; -} VkPhysicalDeviceCubicWeightsFeaturesQCOM; - -typedef struct VkPhysicalDeviceCudaKernelLaunchFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 cudaKernelLaunchFeatures; -} VkPhysicalDeviceCudaKernelLaunchFeaturesNV; - -typedef struct VkPhysicalDeviceCudaKernelLaunchPropertiesNV -{ - VkStructureType sType; - void *pNext; - uint32_t computeCapabilityMinor; - uint32_t computeCapabilityMajor; -} VkPhysicalDeviceCudaKernelLaunchPropertiesNV; - -typedef struct VkPhysicalDeviceCustomBorderColorFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 customBorderColors; - VkBool32 customBorderColorWithoutFormat; -} VkPhysicalDeviceCustomBorderColorFeaturesEXT; - -typedef struct VkPhysicalDeviceCustomBorderColorPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t maxCustomBorderColorSamplers; -} VkPhysicalDeviceCustomBorderColorPropertiesEXT; - -typedef struct VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 dedicatedAllocationImageAliasing; -} VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV; - -typedef struct VkPhysicalDeviceDepthBiasControlFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 depthBiasControl; - VkBool32 leastRepresentableValueForceUnormRepresentation; - VkBool32 floatRepresentation; - VkBool32 depthBiasExact; -} VkPhysicalDeviceDepthBiasControlFeaturesEXT; - -typedef struct VkPhysicalDeviceDepthClampControlFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 depthClampControl; -} VkPhysicalDeviceDepthClampControlFeaturesEXT; - -typedef struct VkPhysicalDeviceDepthClampZeroOneFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 depthClampZeroOne; -} VkPhysicalDeviceDepthClampZeroOneFeaturesEXT; - -typedef struct VkPhysicalDeviceDepthClipControlFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 depthClipControl; -} VkPhysicalDeviceDepthClipControlFeaturesEXT; - -typedef struct VkPhysicalDeviceDepthClipEnableFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 depthClipEnable; -} VkPhysicalDeviceDepthClipEnableFeaturesEXT; - -typedef struct VkPhysicalDeviceDepthStencilResolveProperties -{ - VkStructureType sType; - void *pNext; - VkResolveModeFlags supportedDepthResolveModes; - VkResolveModeFlags supportedStencilResolveModes; - VkBool32 independentResolveNone; - VkBool32 independentResolve; -} VkPhysicalDeviceDepthStencilResolveProperties; -typedef VkPhysicalDeviceDepthStencilResolveProperties VkPhysicalDeviceDepthStencilResolvePropertiesKHR; - -typedef struct VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT -{ - VkStructureType sType; - void *pNext; - size_t combinedImageSamplerDensityMapDescriptorSize; -} VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT; - -typedef struct VkPhysicalDeviceDescriptorBufferFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 descriptorBuffer; - VkBool32 descriptorBufferCaptureReplay; - VkBool32 descriptorBufferImageLayoutIgnored; - VkBool32 descriptorBufferPushDescriptors; -} VkPhysicalDeviceDescriptorBufferFeaturesEXT; - -typedef struct VkPhysicalDeviceDescriptorBufferPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 combinedImageSamplerDescriptorSingleArray; - VkBool32 bufferlessPushDescriptors; - VkBool32 allowSamplerImageViewPostSubmitCreation; - VkDeviceSize WINE_VK_ALIGN(8) descriptorBufferOffsetAlignment; - uint32_t maxDescriptorBufferBindings; - uint32_t maxResourceDescriptorBufferBindings; - uint32_t maxSamplerDescriptorBufferBindings; - uint32_t maxEmbeddedImmutableSamplerBindings; - uint32_t maxEmbeddedImmutableSamplers; - size_t bufferCaptureReplayDescriptorDataSize; - size_t imageCaptureReplayDescriptorDataSize; - size_t imageViewCaptureReplayDescriptorDataSize; - size_t samplerCaptureReplayDescriptorDataSize; - size_t accelerationStructureCaptureReplayDescriptorDataSize; - size_t samplerDescriptorSize; - size_t combinedImageSamplerDescriptorSize; - size_t sampledImageDescriptorSize; - size_t storageImageDescriptorSize; - size_t uniformTexelBufferDescriptorSize; - size_t robustUniformTexelBufferDescriptorSize; - size_t storageTexelBufferDescriptorSize; - size_t robustStorageTexelBufferDescriptorSize; - size_t uniformBufferDescriptorSize; - size_t robustUniformBufferDescriptorSize; - size_t storageBufferDescriptorSize; - size_t robustStorageBufferDescriptorSize; - size_t inputAttachmentDescriptorSize; - size_t accelerationStructureDescriptorSize; - VkDeviceSize WINE_VK_ALIGN(8) maxSamplerDescriptorBufferRange; - VkDeviceSize WINE_VK_ALIGN(8) maxResourceDescriptorBufferRange; - VkDeviceSize WINE_VK_ALIGN(8) samplerDescriptorBufferAddressSpaceSize; - VkDeviceSize WINE_VK_ALIGN(8) resourceDescriptorBufferAddressSpaceSize; - VkDeviceSize WINE_VK_ALIGN(8) descriptorBufferAddressSpaceSize; -} VkPhysicalDeviceDescriptorBufferPropertiesEXT; - -typedef struct VkPhysicalDeviceDescriptorIndexingFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderInputAttachmentArrayDynamicIndexing; - VkBool32 shaderUniformTexelBufferArrayDynamicIndexing; - VkBool32 shaderStorageTexelBufferArrayDynamicIndexing; - VkBool32 shaderUniformBufferArrayNonUniformIndexing; - VkBool32 shaderSampledImageArrayNonUniformIndexing; - VkBool32 shaderStorageBufferArrayNonUniformIndexing; - VkBool32 shaderStorageImageArrayNonUniformIndexing; - VkBool32 shaderInputAttachmentArrayNonUniformIndexing; - VkBool32 shaderUniformTexelBufferArrayNonUniformIndexing; - VkBool32 shaderStorageTexelBufferArrayNonUniformIndexing; - VkBool32 descriptorBindingUniformBufferUpdateAfterBind; - VkBool32 descriptorBindingSampledImageUpdateAfterBind; - VkBool32 descriptorBindingStorageImageUpdateAfterBind; - VkBool32 descriptorBindingStorageBufferUpdateAfterBind; - VkBool32 descriptorBindingUniformTexelBufferUpdateAfterBind; - VkBool32 descriptorBindingStorageTexelBufferUpdateAfterBind; - VkBool32 descriptorBindingUpdateUnusedWhilePending; - VkBool32 descriptorBindingPartiallyBound; - VkBool32 descriptorBindingVariableDescriptorCount; - VkBool32 runtimeDescriptorArray; -} VkPhysicalDeviceDescriptorIndexingFeatures; -typedef VkPhysicalDeviceDescriptorIndexingFeatures VkPhysicalDeviceDescriptorIndexingFeaturesEXT; - -typedef struct VkPhysicalDeviceDescriptorIndexingProperties -{ - VkStructureType sType; - void *pNext; - uint32_t maxUpdateAfterBindDescriptorsInAllPools; - VkBool32 shaderUniformBufferArrayNonUniformIndexingNative; - VkBool32 shaderSampledImageArrayNonUniformIndexingNative; - VkBool32 shaderStorageBufferArrayNonUniformIndexingNative; - VkBool32 shaderStorageImageArrayNonUniformIndexingNative; - VkBool32 shaderInputAttachmentArrayNonUniformIndexingNative; - VkBool32 robustBufferAccessUpdateAfterBind; - VkBool32 quadDivergentImplicitLod; - uint32_t maxPerStageDescriptorUpdateAfterBindSamplers; - uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers; - uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages; - uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments; - uint32_t maxPerStageUpdateAfterBindResources; - uint32_t maxDescriptorSetUpdateAfterBindSamplers; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic; - uint32_t maxDescriptorSetUpdateAfterBindSampledImages; - uint32_t maxDescriptorSetUpdateAfterBindStorageImages; - uint32_t maxDescriptorSetUpdateAfterBindInputAttachments; -} VkPhysicalDeviceDescriptorIndexingProperties; -typedef VkPhysicalDeviceDescriptorIndexingProperties VkPhysicalDeviceDescriptorIndexingPropertiesEXT; - -typedef struct VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 descriptorPoolOverallocation; -} VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV; - -typedef struct VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE -{ - VkStructureType sType; - void *pNext; - VkBool32 descriptorSetHostMapping; -} VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE; - -typedef struct VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 deviceGeneratedCompute; - VkBool32 deviceGeneratedComputePipelines; - VkBool32 deviceGeneratedComputeCaptureReplay; -} VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV; - -typedef struct VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 deviceGeneratedCommands; - VkBool32 dynamicGeneratedPipelineLayout; -} VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT; - -typedef struct VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 deviceGeneratedCommands; -} VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV; - -typedef struct VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t maxIndirectPipelineCount; - uint32_t maxIndirectShaderObjectCount; - uint32_t maxIndirectSequenceCount; - uint32_t maxIndirectCommandsTokenCount; - uint32_t maxIndirectCommandsTokenOffset; - uint32_t maxIndirectCommandsIndirectStride; - VkIndirectCommandsInputModeFlagsEXT supportedIndirectCommandsInputModes; - VkShaderStageFlags supportedIndirectCommandsShaderStages; - VkShaderStageFlags supportedIndirectCommandsShaderStagesPipelineBinding; - VkShaderStageFlags supportedIndirectCommandsShaderStagesShaderBinding; - VkBool32 deviceGeneratedCommandsTransformFeedback; - VkBool32 deviceGeneratedCommandsMultiDrawIndirectCount; -} VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT; - -typedef struct VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV -{ - VkStructureType sType; - void *pNext; - uint32_t maxGraphicsShaderGroupCount; - uint32_t maxIndirectSequenceCount; - uint32_t maxIndirectCommandsTokenCount; - uint32_t maxIndirectCommandsStreamCount; - uint32_t maxIndirectCommandsTokenOffset; - uint32_t maxIndirectCommandsStreamStride; - uint32_t minSequencesCountBufferOffsetAlignment; - uint32_t minSequencesIndexBufferOffsetAlignment; - uint32_t minIndirectCommandsBufferOffsetAlignment; -} VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV; - -typedef struct VkPhysicalDeviceDiagnosticsConfigFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 diagnosticsConfig; -} VkPhysicalDeviceDiagnosticsConfigFeaturesNV; - -typedef struct VkPhysicalDeviceDiscardRectanglePropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t maxDiscardRectangles; -} VkPhysicalDeviceDiscardRectanglePropertiesEXT; - -typedef struct VkPhysicalDeviceDriverProperties -{ - VkStructureType sType; - void *pNext; - VkDriverId driverID; - char driverName[VK_MAX_DRIVER_NAME_SIZE]; - char driverInfo[VK_MAX_DRIVER_INFO_SIZE]; - VkConformanceVersion conformanceVersion; -} VkPhysicalDeviceDriverProperties; -typedef VkPhysicalDeviceDriverProperties VkPhysicalDeviceDriverPropertiesKHR; - -typedef struct VkPhysicalDeviceDynamicRenderingFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 dynamicRendering; -} VkPhysicalDeviceDynamicRenderingFeatures; -typedef VkPhysicalDeviceDynamicRenderingFeatures VkPhysicalDeviceDynamicRenderingFeaturesKHR; - -typedef struct VkPhysicalDeviceDynamicRenderingLocalReadFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 dynamicRenderingLocalRead; -} VkPhysicalDeviceDynamicRenderingLocalReadFeatures; -typedef VkPhysicalDeviceDynamicRenderingLocalReadFeatures VkPhysicalDeviceDynamicRenderingLocalReadFeaturesKHR; - -typedef struct VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 dynamicRenderingUnusedAttachments; -} VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT; - -typedef struct VkPhysicalDeviceExclusiveScissorFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 exclusiveScissor; -} VkPhysicalDeviceExclusiveScissorFeaturesNV; - -typedef struct VkPhysicalDeviceExtendedDynamicState2FeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 extendedDynamicState2; - VkBool32 extendedDynamicState2LogicOp; - VkBool32 extendedDynamicState2PatchControlPoints; -} VkPhysicalDeviceExtendedDynamicState2FeaturesEXT; - -typedef struct VkPhysicalDeviceExtendedDynamicState3FeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 extendedDynamicState3TessellationDomainOrigin; - VkBool32 extendedDynamicState3DepthClampEnable; - VkBool32 extendedDynamicState3PolygonMode; - VkBool32 extendedDynamicState3RasterizationSamples; - VkBool32 extendedDynamicState3SampleMask; - VkBool32 extendedDynamicState3AlphaToCoverageEnable; - VkBool32 extendedDynamicState3AlphaToOneEnable; - VkBool32 extendedDynamicState3LogicOpEnable; - VkBool32 extendedDynamicState3ColorBlendEnable; - VkBool32 extendedDynamicState3ColorBlendEquation; - VkBool32 extendedDynamicState3ColorWriteMask; - VkBool32 extendedDynamicState3RasterizationStream; - VkBool32 extendedDynamicState3ConservativeRasterizationMode; - VkBool32 extendedDynamicState3ExtraPrimitiveOverestimationSize; - VkBool32 extendedDynamicState3DepthClipEnable; - VkBool32 extendedDynamicState3SampleLocationsEnable; - VkBool32 extendedDynamicState3ColorBlendAdvanced; - VkBool32 extendedDynamicState3ProvokingVertexMode; - VkBool32 extendedDynamicState3LineRasterizationMode; - VkBool32 extendedDynamicState3LineStippleEnable; - VkBool32 extendedDynamicState3DepthClipNegativeOneToOne; - VkBool32 extendedDynamicState3ViewportWScalingEnable; - VkBool32 extendedDynamicState3ViewportSwizzle; - VkBool32 extendedDynamicState3CoverageToColorEnable; - VkBool32 extendedDynamicState3CoverageToColorLocation; - VkBool32 extendedDynamicState3CoverageModulationMode; - VkBool32 extendedDynamicState3CoverageModulationTableEnable; - VkBool32 extendedDynamicState3CoverageModulationTable; - VkBool32 extendedDynamicState3CoverageReductionMode; - VkBool32 extendedDynamicState3RepresentativeFragmentTestEnable; - VkBool32 extendedDynamicState3ShadingRateImageEnable; -} VkPhysicalDeviceExtendedDynamicState3FeaturesEXT; - -typedef struct VkPhysicalDeviceExtendedDynamicState3PropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 dynamicPrimitiveTopologyUnrestricted; -} VkPhysicalDeviceExtendedDynamicState3PropertiesEXT; - -typedef struct VkPhysicalDeviceExtendedDynamicStateFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 extendedDynamicState; -} VkPhysicalDeviceExtendedDynamicStateFeaturesEXT; - -typedef struct VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 extendedSparseAddressSpace; -} VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV; - -typedef struct VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV -{ - VkStructureType sType; - void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) extendedSparseAddressSpaceSize; - VkImageUsageFlags extendedSparseImageUsageFlags; - VkBufferUsageFlags extendedSparseBufferUsageFlags; -} VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV; - -typedef struct VkPhysicalDeviceExternalBufferInfo -{ - VkStructureType sType; - const void *pNext; - VkBufferCreateFlags flags; - VkBufferUsageFlags usage; - VkExternalMemoryHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalBufferInfo; -typedef VkPhysicalDeviceExternalBufferInfo VkPhysicalDeviceExternalBufferInfoKHR; - -typedef struct VkPhysicalDeviceExternalFenceInfo -{ - VkStructureType sType; - const void *pNext; - VkExternalFenceHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalFenceInfo; -typedef VkPhysicalDeviceExternalFenceInfo VkPhysicalDeviceExternalFenceInfoKHR; - -typedef struct VkPhysicalDeviceExternalImageFormatInfo -{ - VkStructureType sType; - const void *pNext; - VkExternalMemoryHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalImageFormatInfo; -typedef VkPhysicalDeviceExternalImageFormatInfo VkPhysicalDeviceExternalImageFormatInfoKHR; - -typedef struct VkPhysicalDeviceExternalMemoryHostPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) minImportedHostPointerAlignment; -} VkPhysicalDeviceExternalMemoryHostPropertiesEXT; - -typedef struct VkPhysicalDeviceExternalSemaphoreInfo -{ - VkStructureType sType; - const void *pNext; - VkExternalSemaphoreHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalSemaphoreInfo; -typedef VkPhysicalDeviceExternalSemaphoreInfo VkPhysicalDeviceExternalSemaphoreInfoKHR; - -typedef struct VkPhysicalDeviceFaultFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 deviceFault; - VkBool32 deviceFaultVendorBinary; -} VkPhysicalDeviceFaultFeaturesEXT; - -typedef struct VkPhysicalDeviceFeatures -{ - VkBool32 robustBufferAccess; - VkBool32 fullDrawIndexUint32; - VkBool32 imageCubeArray; - VkBool32 independentBlend; - VkBool32 geometryShader; - VkBool32 tessellationShader; - VkBool32 sampleRateShading; - VkBool32 dualSrcBlend; - VkBool32 logicOp; - VkBool32 multiDrawIndirect; - VkBool32 drawIndirectFirstInstance; - VkBool32 depthClamp; - VkBool32 depthBiasClamp; - VkBool32 fillModeNonSolid; - VkBool32 depthBounds; - VkBool32 wideLines; - VkBool32 largePoints; - VkBool32 alphaToOne; - VkBool32 multiViewport; - VkBool32 samplerAnisotropy; - VkBool32 textureCompressionETC2; - VkBool32 textureCompressionASTC_LDR; - VkBool32 textureCompressionBC; - VkBool32 occlusionQueryPrecise; - VkBool32 pipelineStatisticsQuery; - VkBool32 vertexPipelineStoresAndAtomics; - VkBool32 fragmentStoresAndAtomics; - VkBool32 shaderTessellationAndGeometryPointSize; - VkBool32 shaderImageGatherExtended; - VkBool32 shaderStorageImageExtendedFormats; - VkBool32 shaderStorageImageMultisample; - VkBool32 shaderStorageImageReadWithoutFormat; - VkBool32 shaderStorageImageWriteWithoutFormat; - VkBool32 shaderUniformBufferArrayDynamicIndexing; - VkBool32 shaderSampledImageArrayDynamicIndexing; - VkBool32 shaderStorageBufferArrayDynamicIndexing; - VkBool32 shaderStorageImageArrayDynamicIndexing; - VkBool32 shaderClipDistance; - VkBool32 shaderCullDistance; - VkBool32 shaderFloat64; - VkBool32 shaderInt64; - VkBool32 shaderInt16; - VkBool32 shaderResourceResidency; - VkBool32 shaderResourceMinLod; - VkBool32 sparseBinding; - VkBool32 sparseResidencyBuffer; - VkBool32 sparseResidencyImage2D; - VkBool32 sparseResidencyImage3D; - VkBool32 sparseResidency2Samples; - VkBool32 sparseResidency4Samples; - VkBool32 sparseResidency8Samples; - VkBool32 sparseResidency16Samples; - VkBool32 sparseResidencyAliased; - VkBool32 variableMultisampleRate; - VkBool32 inheritedQueries; -} VkPhysicalDeviceFeatures; - -typedef struct VkPhysicalDeviceFeatures2 -{ - VkStructureType sType; - void *pNext; - VkPhysicalDeviceFeatures features; -} VkPhysicalDeviceFeatures2; -typedef VkPhysicalDeviceFeatures2 VkPhysicalDeviceFeatures2KHR; - -typedef struct VkPhysicalDeviceFloatControlsProperties -{ - VkStructureType sType; - void *pNext; - VkShaderFloatControlsIndependence denormBehaviorIndependence; - VkShaderFloatControlsIndependence roundingModeIndependence; - VkBool32 shaderSignedZeroInfNanPreserveFloat16; - VkBool32 shaderSignedZeroInfNanPreserveFloat32; - VkBool32 shaderSignedZeroInfNanPreserveFloat64; - VkBool32 shaderDenormPreserveFloat16; - VkBool32 shaderDenormPreserveFloat32; - VkBool32 shaderDenormPreserveFloat64; - VkBool32 shaderDenormFlushToZeroFloat16; - VkBool32 shaderDenormFlushToZeroFloat32; - VkBool32 shaderDenormFlushToZeroFloat64; - VkBool32 shaderRoundingModeRTEFloat16; - VkBool32 shaderRoundingModeRTEFloat32; - VkBool32 shaderRoundingModeRTEFloat64; - VkBool32 shaderRoundingModeRTZFloat16; - VkBool32 shaderRoundingModeRTZFloat32; - VkBool32 shaderRoundingModeRTZFloat64; -} VkPhysicalDeviceFloatControlsProperties; -typedef VkPhysicalDeviceFloatControlsProperties VkPhysicalDeviceFloatControlsPropertiesKHR; - -typedef struct VkPhysicalDeviceFragmentDensityMap2FeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 fragmentDensityMapDeferred; -} VkPhysicalDeviceFragmentDensityMap2FeaturesEXT; - -typedef struct VkPhysicalDeviceFragmentDensityMap2PropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 subsampledLoads; - VkBool32 subsampledCoarseReconstructionEarlyAccess; - uint32_t maxSubsampledArrayLayers; - uint32_t maxDescriptorSetSubsampledSamplers; -} VkPhysicalDeviceFragmentDensityMap2PropertiesEXT; - -typedef struct VkPhysicalDeviceFragmentDensityMapFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 fragmentDensityMap; - VkBool32 fragmentDensityMapDynamic; - VkBool32 fragmentDensityMapNonSubsampledImages; -} VkPhysicalDeviceFragmentDensityMapFeaturesEXT; - -typedef struct VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 fragmentDensityMapOffset; -} VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM; - -typedef struct VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM -{ - VkStructureType sType; - void *pNext; - VkExtent2D fragmentDensityOffsetGranularity; -} VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM; - -typedef struct VkPhysicalDeviceFragmentDensityMapPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkExtent2D minFragmentDensityTexelSize; - VkExtent2D maxFragmentDensityTexelSize; - VkBool32 fragmentDensityInvocations; -} VkPhysicalDeviceFragmentDensityMapPropertiesEXT; - -typedef struct VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 fragmentShaderBarycentric; -} VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR; -typedef VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV; - -typedef struct VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 triStripVertexOrderIndependentOfProvokingVertex; -} VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR; - -typedef struct VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 fragmentShaderSampleInterlock; - VkBool32 fragmentShaderPixelInterlock; - VkBool32 fragmentShaderShadingRateInterlock; -} VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT; - -typedef struct VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 fragmentShadingRateEnums; - VkBool32 supersampleFragmentShadingRates; - VkBool32 noInvocationFragmentShadingRates; -} VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV; - -typedef struct VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV -{ - VkStructureType sType; - void *pNext; - VkSampleCountFlagBits maxFragmentShadingRateInvocationCount; -} VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV; - -typedef struct VkPhysicalDeviceFragmentShadingRateFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 pipelineFragmentShadingRate; - VkBool32 primitiveFragmentShadingRate; - VkBool32 attachmentFragmentShadingRate; -} VkPhysicalDeviceFragmentShadingRateFeaturesKHR; - -typedef struct VkPhysicalDeviceFragmentShadingRateKHR -{ - VkStructureType sType; - void *pNext; - VkSampleCountFlags sampleCounts; - VkExtent2D fragmentSize; -} VkPhysicalDeviceFragmentShadingRateKHR; - -typedef struct VkPhysicalDeviceFragmentShadingRatePropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkExtent2D minFragmentShadingRateAttachmentTexelSize; - VkExtent2D maxFragmentShadingRateAttachmentTexelSize; - uint32_t maxFragmentShadingRateAttachmentTexelSizeAspectRatio; - VkBool32 primitiveFragmentShadingRateWithMultipleViewports; - VkBool32 layeredShadingRateAttachments; - VkBool32 fragmentShadingRateNonTrivialCombinerOps; - VkExtent2D maxFragmentSize; - uint32_t maxFragmentSizeAspectRatio; - uint32_t maxFragmentShadingRateCoverageSamples; - VkSampleCountFlagBits maxFragmentShadingRateRasterizationSamples; - VkBool32 fragmentShadingRateWithShaderDepthStencilWrites; - VkBool32 fragmentShadingRateWithSampleMask; - VkBool32 fragmentShadingRateWithShaderSampleMask; - VkBool32 fragmentShadingRateWithConservativeRasterization; - VkBool32 fragmentShadingRateWithFragmentShaderInterlock; - VkBool32 fragmentShadingRateWithCustomSampleLocations; - VkBool32 fragmentShadingRateStrictMultiplyCombiner; -} VkPhysicalDeviceFragmentShadingRatePropertiesKHR; - -typedef struct VkPhysicalDeviceFrameBoundaryFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 frameBoundary; -} VkPhysicalDeviceFrameBoundaryFeaturesEXT; - -typedef struct VkPhysicalDeviceGlobalPriorityQueryFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 globalPriorityQuery; -} VkPhysicalDeviceGlobalPriorityQueryFeatures; -typedef VkPhysicalDeviceGlobalPriorityQueryFeatures VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR; -typedef VkPhysicalDeviceGlobalPriorityQueryFeatures VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT; - -typedef struct VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 graphicsPipelineLibrary; -} VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT; - -typedef struct VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 graphicsPipelineLibraryFastLinking; - VkBool32 graphicsPipelineLibraryIndependentInterpolationDecoration; -} VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT; - -typedef struct VkPhysicalDeviceGroupProperties -{ - VkStructureType sType; - void *pNext; - uint32_t physicalDeviceCount; - VkPhysicalDevice physicalDevices[VK_MAX_DEVICE_GROUP_SIZE]; - VkBool32 subsetAllocation; -} VkPhysicalDeviceGroupProperties; -typedef VkPhysicalDeviceGroupProperties VkPhysicalDeviceGroupPropertiesKHR; - -typedef struct VkPhysicalDeviceHdrVividFeaturesHUAWEI -{ - VkStructureType sType; - void *pNext; - VkBool32 hdrVivid; -} VkPhysicalDeviceHdrVividFeaturesHUAWEI; - -typedef struct VkPhysicalDeviceHostImageCopyFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 hostImageCopy; -} VkPhysicalDeviceHostImageCopyFeatures; -typedef VkPhysicalDeviceHostImageCopyFeatures VkPhysicalDeviceHostImageCopyFeaturesEXT; - -typedef struct VkPhysicalDeviceHostImageCopyProperties -{ - VkStructureType sType; - void *pNext; - uint32_t copySrcLayoutCount; - VkImageLayout *pCopySrcLayouts; - uint32_t copyDstLayoutCount; - VkImageLayout *pCopyDstLayouts; - uint8_t optimalTilingLayoutUUID[VK_UUID_SIZE]; - VkBool32 identicalMemoryTypeRequirements; -} VkPhysicalDeviceHostImageCopyProperties; -typedef VkPhysicalDeviceHostImageCopyProperties VkPhysicalDeviceHostImageCopyPropertiesEXT; - -typedef struct VkPhysicalDeviceHostQueryResetFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 hostQueryReset; -} VkPhysicalDeviceHostQueryResetFeatures; -typedef VkPhysicalDeviceHostQueryResetFeatures VkPhysicalDeviceHostQueryResetFeaturesEXT; - -typedef struct VkPhysicalDeviceIDProperties -{ - VkStructureType sType; - void *pNext; - uint8_t deviceUUID[VK_UUID_SIZE]; - uint8_t driverUUID[VK_UUID_SIZE]; - uint8_t deviceLUID[VK_LUID_SIZE]; - uint32_t deviceNodeMask; - VkBool32 deviceLUIDValid; -} VkPhysicalDeviceIDProperties; -typedef VkPhysicalDeviceIDProperties VkPhysicalDeviceIDPropertiesKHR; - -typedef struct VkPhysicalDeviceImage2DViewOf3DFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 image2DViewOf3D; - VkBool32 sampler2DViewOf3D; -} VkPhysicalDeviceImage2DViewOf3DFeaturesEXT; - -typedef struct VkPhysicalDeviceImageAlignmentControlFeaturesMESA -{ - VkStructureType sType; - void *pNext; - VkBool32 imageAlignmentControl; -} VkPhysicalDeviceImageAlignmentControlFeaturesMESA; - -typedef struct VkPhysicalDeviceImageAlignmentControlPropertiesMESA -{ - VkStructureType sType; - void *pNext; - uint32_t supportedImageAlignmentMask; -} VkPhysicalDeviceImageAlignmentControlPropertiesMESA; - -typedef struct VkPhysicalDeviceImageCompressionControlFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 imageCompressionControl; -} VkPhysicalDeviceImageCompressionControlFeaturesEXT; - -typedef struct VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 imageCompressionControlSwapchain; -} VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT; - -typedef struct VkPhysicalDeviceImageFormatInfo2 -{ - VkStructureType sType; - const void *pNext; - VkFormat format; - VkImageType type; - VkImageTiling tiling; - VkImageUsageFlags usage; - VkImageCreateFlags flags; -} VkPhysicalDeviceImageFormatInfo2; -typedef VkPhysicalDeviceImageFormatInfo2 VkPhysicalDeviceImageFormatInfo2KHR; - -typedef struct VkPhysicalDeviceImageProcessing2FeaturesQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 textureBlockMatch2; -} VkPhysicalDeviceImageProcessing2FeaturesQCOM; - -typedef struct VkPhysicalDeviceImageProcessing2PropertiesQCOM -{ - VkStructureType sType; - void *pNext; - VkExtent2D maxBlockMatchWindow; -} VkPhysicalDeviceImageProcessing2PropertiesQCOM; - -typedef struct VkPhysicalDeviceImageProcessingFeaturesQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 textureSampleWeighted; - VkBool32 textureBoxFilter; - VkBool32 textureBlockMatch; -} VkPhysicalDeviceImageProcessingFeaturesQCOM; - -typedef struct VkPhysicalDeviceImageProcessingPropertiesQCOM -{ - VkStructureType sType; - void *pNext; - uint32_t maxWeightFilterPhases; - VkExtent2D maxWeightFilterDimension; - VkExtent2D maxBlockMatchRegion; - VkExtent2D maxBoxFilterBlockSize; -} VkPhysicalDeviceImageProcessingPropertiesQCOM; - -typedef struct VkPhysicalDeviceImageRobustnessFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 robustImageAccess; -} VkPhysicalDeviceImageRobustnessFeatures; -typedef VkPhysicalDeviceImageRobustnessFeatures VkPhysicalDeviceImageRobustnessFeaturesEXT; - -typedef struct VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 imageSlicedViewOf3D; -} VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT; - -typedef struct VkPhysicalDeviceImageViewImageFormatInfoEXT -{ - VkStructureType sType; - void *pNext; - VkImageViewType imageViewType; -} VkPhysicalDeviceImageViewImageFormatInfoEXT; - -typedef struct VkPhysicalDeviceImageViewMinLodFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 minLod; -} VkPhysicalDeviceImageViewMinLodFeaturesEXT; - -typedef struct VkPhysicalDeviceImagelessFramebufferFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 imagelessFramebuffer; -} VkPhysicalDeviceImagelessFramebufferFeatures; -typedef VkPhysicalDeviceImagelessFramebufferFeatures VkPhysicalDeviceImagelessFramebufferFeaturesKHR; - -typedef struct VkPhysicalDeviceIndexTypeUint8Features -{ - VkStructureType sType; - void *pNext; - VkBool32 indexTypeUint8; -} VkPhysicalDeviceIndexTypeUint8Features; -typedef VkPhysicalDeviceIndexTypeUint8Features VkPhysicalDeviceIndexTypeUint8FeaturesKHR; -typedef VkPhysicalDeviceIndexTypeUint8Features VkPhysicalDeviceIndexTypeUint8FeaturesEXT; - -typedef struct VkPhysicalDeviceInheritedViewportScissorFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 inheritedViewportScissor2D; -} VkPhysicalDeviceInheritedViewportScissorFeaturesNV; - -typedef struct VkPhysicalDeviceInlineUniformBlockFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 inlineUniformBlock; - VkBool32 descriptorBindingInlineUniformBlockUpdateAfterBind; -} VkPhysicalDeviceInlineUniformBlockFeatures; -typedef VkPhysicalDeviceInlineUniformBlockFeatures VkPhysicalDeviceInlineUniformBlockFeaturesEXT; - -typedef struct VkPhysicalDeviceInlineUniformBlockProperties -{ - VkStructureType sType; - void *pNext; - uint32_t maxInlineUniformBlockSize; - uint32_t maxPerStageDescriptorInlineUniformBlocks; - uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks; - uint32_t maxDescriptorSetInlineUniformBlocks; - uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks; -} VkPhysicalDeviceInlineUniformBlockProperties; -typedef VkPhysicalDeviceInlineUniformBlockProperties VkPhysicalDeviceInlineUniformBlockPropertiesEXT; - -typedef struct VkPhysicalDeviceInvocationMaskFeaturesHUAWEI -{ - VkStructureType sType; - void *pNext; - VkBool32 invocationMask; -} VkPhysicalDeviceInvocationMaskFeaturesHUAWEI; - -typedef struct VkPhysicalDeviceLayeredDriverPropertiesMSFT -{ - VkStructureType sType; - void *pNext; - VkLayeredDriverUnderlyingApiMSFT underlyingAPI; -} VkPhysicalDeviceLayeredDriverPropertiesMSFT; - -typedef struct VkPhysicalDeviceLegacyDitheringFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 legacyDithering; -} VkPhysicalDeviceLegacyDitheringFeaturesEXT; - -typedef struct VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 legacyVertexAttributes; -} VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT; - -typedef struct VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 nativeUnalignedPerformance; -} VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT; - -typedef struct VkPhysicalDeviceLimits -{ - uint32_t maxImageDimension1D; - uint32_t maxImageDimension2D; - uint32_t maxImageDimension3D; - uint32_t maxImageDimensionCube; - uint32_t maxImageArrayLayers; - uint32_t maxTexelBufferElements; - uint32_t maxUniformBufferRange; - uint32_t maxStorageBufferRange; - uint32_t maxPushConstantsSize; - uint32_t maxMemoryAllocationCount; - uint32_t maxSamplerAllocationCount; - VkDeviceSize WINE_VK_ALIGN(8) bufferImageGranularity; - VkDeviceSize WINE_VK_ALIGN(8) sparseAddressSpaceSize; - uint32_t maxBoundDescriptorSets; - uint32_t maxPerStageDescriptorSamplers; - uint32_t maxPerStageDescriptorUniformBuffers; - uint32_t maxPerStageDescriptorStorageBuffers; - uint32_t maxPerStageDescriptorSampledImages; - uint32_t maxPerStageDescriptorStorageImages; - uint32_t maxPerStageDescriptorInputAttachments; - uint32_t maxPerStageResources; - uint32_t maxDescriptorSetSamplers; - uint32_t maxDescriptorSetUniformBuffers; - uint32_t maxDescriptorSetUniformBuffersDynamic; - uint32_t maxDescriptorSetStorageBuffers; - uint32_t maxDescriptorSetStorageBuffersDynamic; - uint32_t maxDescriptorSetSampledImages; - uint32_t maxDescriptorSetStorageImages; - uint32_t maxDescriptorSetInputAttachments; - uint32_t maxVertexInputAttributes; - uint32_t maxVertexInputBindings; - uint32_t maxVertexInputAttributeOffset; - uint32_t maxVertexInputBindingStride; - uint32_t maxVertexOutputComponents; - uint32_t maxTessellationGenerationLevel; - uint32_t maxTessellationPatchSize; - uint32_t maxTessellationControlPerVertexInputComponents; - uint32_t maxTessellationControlPerVertexOutputComponents; - uint32_t maxTessellationControlPerPatchOutputComponents; - uint32_t maxTessellationControlTotalOutputComponents; - uint32_t maxTessellationEvaluationInputComponents; - uint32_t maxTessellationEvaluationOutputComponents; - uint32_t maxGeometryShaderInvocations; - uint32_t maxGeometryInputComponents; - uint32_t maxGeometryOutputComponents; - uint32_t maxGeometryOutputVertices; - uint32_t maxGeometryTotalOutputComponents; - uint32_t maxFragmentInputComponents; - uint32_t maxFragmentOutputAttachments; - uint32_t maxFragmentDualSrcAttachments; - uint32_t maxFragmentCombinedOutputResources; - uint32_t maxComputeSharedMemorySize; - uint32_t maxComputeWorkGroupCount[3]; - uint32_t maxComputeWorkGroupInvocations; - uint32_t maxComputeWorkGroupSize[3]; - uint32_t subPixelPrecisionBits; - uint32_t subTexelPrecisionBits; - uint32_t mipmapPrecisionBits; - uint32_t maxDrawIndexedIndexValue; - uint32_t maxDrawIndirectCount; - float maxSamplerLodBias; - float maxSamplerAnisotropy; - uint32_t maxViewports; - uint32_t maxViewportDimensions[2]; - float viewportBoundsRange[2]; - uint32_t viewportSubPixelBits; - size_t minMemoryMapAlignment; - VkDeviceSize WINE_VK_ALIGN(8) minTexelBufferOffsetAlignment; - VkDeviceSize WINE_VK_ALIGN(8) minUniformBufferOffsetAlignment; - VkDeviceSize WINE_VK_ALIGN(8) minStorageBufferOffsetAlignment; - int32_t minTexelOffset; - uint32_t maxTexelOffset; - int32_t minTexelGatherOffset; - uint32_t maxTexelGatherOffset; - float minInterpolationOffset; - float maxInterpolationOffset; - uint32_t subPixelInterpolationOffsetBits; - uint32_t maxFramebufferWidth; - uint32_t maxFramebufferHeight; - uint32_t maxFramebufferLayers; - VkSampleCountFlags framebufferColorSampleCounts; - VkSampleCountFlags framebufferDepthSampleCounts; - VkSampleCountFlags framebufferStencilSampleCounts; - VkSampleCountFlags framebufferNoAttachmentsSampleCounts; - uint32_t maxColorAttachments; - VkSampleCountFlags sampledImageColorSampleCounts; - VkSampleCountFlags sampledImageIntegerSampleCounts; - VkSampleCountFlags sampledImageDepthSampleCounts; - VkSampleCountFlags sampledImageStencilSampleCounts; - VkSampleCountFlags storageImageSampleCounts; - uint32_t maxSampleMaskWords; - VkBool32 timestampComputeAndGraphics; - float timestampPeriod; - uint32_t maxClipDistances; - uint32_t maxCullDistances; - uint32_t maxCombinedClipAndCullDistances; - uint32_t discreteQueuePriorities; - float pointSizeRange[2]; - float lineWidthRange[2]; - float pointSizeGranularity; - float lineWidthGranularity; - VkBool32 strictLines; - VkBool32 standardSampleLocations; - VkDeviceSize WINE_VK_ALIGN(8) optimalBufferCopyOffsetAlignment; - VkDeviceSize WINE_VK_ALIGN(8) optimalBufferCopyRowPitchAlignment; - VkDeviceSize WINE_VK_ALIGN(8) nonCoherentAtomSize; -} VkPhysicalDeviceLimits; - -typedef struct VkPhysicalDeviceLineRasterizationFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 rectangularLines; - VkBool32 bresenhamLines; - VkBool32 smoothLines; - VkBool32 stippledRectangularLines; - VkBool32 stippledBresenhamLines; - VkBool32 stippledSmoothLines; -} VkPhysicalDeviceLineRasterizationFeatures; -typedef VkPhysicalDeviceLineRasterizationFeatures VkPhysicalDeviceLineRasterizationFeaturesKHR; -typedef VkPhysicalDeviceLineRasterizationFeatures VkPhysicalDeviceLineRasterizationFeaturesEXT; - -typedef struct VkPhysicalDeviceLineRasterizationProperties -{ - VkStructureType sType; - void *pNext; - uint32_t lineSubPixelPrecisionBits; -} VkPhysicalDeviceLineRasterizationProperties; -typedef VkPhysicalDeviceLineRasterizationProperties VkPhysicalDeviceLineRasterizationPropertiesKHR; -typedef VkPhysicalDeviceLineRasterizationProperties VkPhysicalDeviceLineRasterizationPropertiesEXT; - -typedef struct VkPhysicalDeviceLinearColorAttachmentFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 linearColorAttachment; -} VkPhysicalDeviceLinearColorAttachmentFeaturesNV; - -typedef struct VkPhysicalDeviceMaintenance3Properties -{ - VkStructureType sType; - void *pNext; - uint32_t maxPerSetDescriptors; - VkDeviceSize WINE_VK_ALIGN(8) maxMemoryAllocationSize; -} VkPhysicalDeviceMaintenance3Properties; -typedef VkPhysicalDeviceMaintenance3Properties VkPhysicalDeviceMaintenance3PropertiesKHR; - -typedef struct VkPhysicalDeviceMaintenance4Features -{ - VkStructureType sType; - void *pNext; - VkBool32 maintenance4; -} VkPhysicalDeviceMaintenance4Features; -typedef VkPhysicalDeviceMaintenance4Features VkPhysicalDeviceMaintenance4FeaturesKHR; - -typedef struct VkPhysicalDeviceMaintenance4Properties -{ - VkStructureType sType; - void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) maxBufferSize; -} VkPhysicalDeviceMaintenance4Properties; -typedef VkPhysicalDeviceMaintenance4Properties VkPhysicalDeviceMaintenance4PropertiesKHR; - -typedef struct VkPhysicalDeviceMaintenance5Features -{ - VkStructureType sType; - void *pNext; - VkBool32 maintenance5; -} VkPhysicalDeviceMaintenance5Features; -typedef VkPhysicalDeviceMaintenance5Features VkPhysicalDeviceMaintenance5FeaturesKHR; - -typedef struct VkPhysicalDeviceMaintenance5Properties -{ - VkStructureType sType; - void *pNext; - VkBool32 earlyFragmentMultisampleCoverageAfterSampleCounting; - VkBool32 earlyFragmentSampleMaskTestBeforeSampleCounting; - VkBool32 depthStencilSwizzleOneSupport; - VkBool32 polygonModePointSize; - VkBool32 nonStrictSinglePixelWideLinesUseParallelogram; - VkBool32 nonStrictWideLinesUseParallelogram; -} VkPhysicalDeviceMaintenance5Properties; -typedef VkPhysicalDeviceMaintenance5Properties VkPhysicalDeviceMaintenance5PropertiesKHR; - -typedef struct VkPhysicalDeviceMaintenance6Features -{ - VkStructureType sType; - void *pNext; - VkBool32 maintenance6; -} VkPhysicalDeviceMaintenance6Features; -typedef VkPhysicalDeviceMaintenance6Features VkPhysicalDeviceMaintenance6FeaturesKHR; - -typedef struct VkPhysicalDeviceMaintenance6Properties -{ - VkStructureType sType; - void *pNext; - VkBool32 blockTexelViewCompatibleMultipleLayers; - uint32_t maxCombinedImageSamplerDescriptorCount; - VkBool32 fragmentShadingRateClampCombinerInputs; -} VkPhysicalDeviceMaintenance6Properties; -typedef VkPhysicalDeviceMaintenance6Properties VkPhysicalDeviceMaintenance6PropertiesKHR; - -typedef struct VkPhysicalDeviceMapMemoryPlacedFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 memoryMapPlaced; - VkBool32 memoryMapRangePlaced; - VkBool32 memoryUnmapReserve; -} VkPhysicalDeviceMapMemoryPlacedFeaturesEXT; - -typedef struct VkPhysicalDeviceMapMemoryPlacedPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) minPlacedMemoryMapAlignment; -} VkPhysicalDeviceMapMemoryPlacedPropertiesEXT; - -typedef struct VkPhysicalDeviceMemoryBudgetPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) heapBudget[VK_MAX_MEMORY_HEAPS]; - VkDeviceSize WINE_VK_ALIGN(8) heapUsage[VK_MAX_MEMORY_HEAPS]; -} VkPhysicalDeviceMemoryBudgetPropertiesEXT; - -typedef struct VkPhysicalDeviceMemoryDecompressionFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 memoryDecompression; -} VkPhysicalDeviceMemoryDecompressionFeaturesNV; - -typedef struct VkPhysicalDeviceMemoryDecompressionPropertiesNV -{ - VkStructureType sType; - void *pNext; - VkMemoryDecompressionMethodFlagsNV WINE_VK_ALIGN(8) decompressionMethods; - uint64_t WINE_VK_ALIGN(8) maxDecompressionIndirectCount; -} VkPhysicalDeviceMemoryDecompressionPropertiesNV; - -typedef struct VkPhysicalDeviceMemoryPriorityFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 memoryPriority; -} VkPhysicalDeviceMemoryPriorityFeaturesEXT; - -typedef struct VkPhysicalDeviceMemoryProperties -{ - uint32_t memoryTypeCount; - VkMemoryType memoryTypes[VK_MAX_MEMORY_TYPES]; - uint32_t memoryHeapCount; - VkMemoryHeap WINE_VK_ALIGN(8) memoryHeaps[VK_MAX_MEMORY_HEAPS]; -} VkPhysicalDeviceMemoryProperties; - -typedef struct VkPhysicalDeviceMemoryProperties2 -{ - VkStructureType sType; - void *pNext; - VkPhysicalDeviceMemoryProperties WINE_VK_ALIGN(8) memoryProperties; -} VkPhysicalDeviceMemoryProperties2; -typedef VkPhysicalDeviceMemoryProperties2 VkPhysicalDeviceMemoryProperties2KHR; - -typedef struct VkPhysicalDeviceMeshShaderFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 taskShader; - VkBool32 meshShader; - VkBool32 multiviewMeshShader; - VkBool32 primitiveFragmentShadingRateMeshShader; - VkBool32 meshShaderQueries; -} VkPhysicalDeviceMeshShaderFeaturesEXT; - -typedef struct VkPhysicalDeviceMeshShaderFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 taskShader; - VkBool32 meshShader; -} VkPhysicalDeviceMeshShaderFeaturesNV; - -typedef struct VkPhysicalDeviceMeshShaderPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t maxTaskWorkGroupTotalCount; - uint32_t maxTaskWorkGroupCount[3]; - uint32_t maxTaskWorkGroupInvocations; - uint32_t maxTaskWorkGroupSize[3]; - uint32_t maxTaskPayloadSize; - uint32_t maxTaskSharedMemorySize; - uint32_t maxTaskPayloadAndSharedMemorySize; - uint32_t maxMeshWorkGroupTotalCount; - uint32_t maxMeshWorkGroupCount[3]; - uint32_t maxMeshWorkGroupInvocations; - uint32_t maxMeshWorkGroupSize[3]; - uint32_t maxMeshSharedMemorySize; - uint32_t maxMeshPayloadAndSharedMemorySize; - uint32_t maxMeshOutputMemorySize; - uint32_t maxMeshPayloadAndOutputMemorySize; - uint32_t maxMeshOutputComponents; - uint32_t maxMeshOutputVertices; - uint32_t maxMeshOutputPrimitives; - uint32_t maxMeshOutputLayers; - uint32_t maxMeshMultiviewViewCount; - uint32_t meshOutputPerVertexGranularity; - uint32_t meshOutputPerPrimitiveGranularity; - uint32_t maxPreferredTaskWorkGroupInvocations; - uint32_t maxPreferredMeshWorkGroupInvocations; - VkBool32 prefersLocalInvocationVertexOutput; - VkBool32 prefersLocalInvocationPrimitiveOutput; - VkBool32 prefersCompactVertexOutput; - VkBool32 prefersCompactPrimitiveOutput; -} VkPhysicalDeviceMeshShaderPropertiesEXT; - -typedef struct VkPhysicalDeviceMeshShaderPropertiesNV -{ - VkStructureType sType; - void *pNext; - uint32_t maxDrawMeshTasksCount; - uint32_t maxTaskWorkGroupInvocations; - uint32_t maxTaskWorkGroupSize[3]; - uint32_t maxTaskTotalMemorySize; - uint32_t maxTaskOutputCount; - uint32_t maxMeshWorkGroupInvocations; - uint32_t maxMeshWorkGroupSize[3]; - uint32_t maxMeshTotalMemorySize; - uint32_t maxMeshOutputVertices; - uint32_t maxMeshOutputPrimitives; - uint32_t maxMeshMultiviewViewCount; - uint32_t meshOutputPerVertexGranularity; - uint32_t meshOutputPerPrimitiveGranularity; -} VkPhysicalDeviceMeshShaderPropertiesNV; - -typedef struct VkPhysicalDeviceMultiDrawFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 multiDraw; -} VkPhysicalDeviceMultiDrawFeaturesEXT; - -typedef struct VkPhysicalDeviceMultiDrawPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t maxMultiDrawCount; -} VkPhysicalDeviceMultiDrawPropertiesEXT; - -typedef struct VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 multisampledRenderToSingleSampled; -} VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT; - -typedef struct VkPhysicalDeviceMultiviewFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 multiview; - VkBool32 multiviewGeometryShader; - VkBool32 multiviewTessellationShader; -} VkPhysicalDeviceMultiviewFeatures; -typedef VkPhysicalDeviceMultiviewFeatures VkPhysicalDeviceMultiviewFeaturesKHR; - -typedef struct VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 multiviewPerViewRenderAreas; -} VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM; - -typedef struct VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 multiviewPerViewViewports; -} VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM; - -typedef struct VkPhysicalDeviceMultiviewProperties -{ - VkStructureType sType; - void *pNext; - uint32_t maxMultiviewViewCount; - uint32_t maxMultiviewInstanceIndex; -} VkPhysicalDeviceMultiviewProperties; -typedef VkPhysicalDeviceMultiviewProperties VkPhysicalDeviceMultiviewPropertiesKHR; - -typedef struct VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 mutableDescriptorType; -} VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT; -typedef VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE; - -typedef struct VkPhysicalDeviceNestedCommandBufferFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 nestedCommandBuffer; - VkBool32 nestedCommandBufferRendering; - VkBool32 nestedCommandBufferSimultaneousUse; -} VkPhysicalDeviceNestedCommandBufferFeaturesEXT; - -typedef struct VkPhysicalDeviceNestedCommandBufferPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t maxCommandBufferNestingLevel; -} VkPhysicalDeviceNestedCommandBufferPropertiesEXT; - -typedef struct VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 nonSeamlessCubeMap; -} VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT; - -typedef struct VkPhysicalDeviceOpacityMicromapFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 micromap; - VkBool32 micromapCaptureReplay; - VkBool32 micromapHostCommands; -} VkPhysicalDeviceOpacityMicromapFeaturesEXT; - -typedef struct VkPhysicalDeviceOpacityMicromapPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t maxOpacity2StateSubdivisionLevel; - uint32_t maxOpacity4StateSubdivisionLevel; -} VkPhysicalDeviceOpacityMicromapPropertiesEXT; - -typedef struct VkPhysicalDeviceOpticalFlowFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 opticalFlow; -} VkPhysicalDeviceOpticalFlowFeaturesNV; - -typedef struct VkPhysicalDeviceOpticalFlowPropertiesNV -{ - VkStructureType sType; - void *pNext; - VkOpticalFlowGridSizeFlagsNV supportedOutputGridSizes; - VkOpticalFlowGridSizeFlagsNV supportedHintGridSizes; - VkBool32 hintSupported; - VkBool32 costSupported; - VkBool32 bidirectionalFlowSupported; - VkBool32 globalFlowSupported; - uint32_t minWidth; - uint32_t minHeight; - uint32_t maxWidth; - uint32_t maxHeight; - uint32_t maxNumRegionsOfInterest; -} VkPhysicalDeviceOpticalFlowPropertiesNV; - -typedef struct VkPhysicalDevicePCIBusInfoPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t pciDomain; - uint32_t pciBus; - uint32_t pciDevice; - uint32_t pciFunction; -} VkPhysicalDevicePCIBusInfoPropertiesEXT; - -typedef struct VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 pageableDeviceLocalMemory; -} VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT; - -typedef struct VkPhysicalDevicePerStageDescriptorSetFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 perStageDescriptorSet; - VkBool32 dynamicPipelineLayout; -} VkPhysicalDevicePerStageDescriptorSetFeaturesNV; - -typedef struct VkPhysicalDevicePerformanceQueryFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 performanceCounterQueryPools; - VkBool32 performanceCounterMultipleQueryPools; -} VkPhysicalDevicePerformanceQueryFeaturesKHR; - -typedef struct VkPhysicalDevicePerformanceQueryPropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 allowCommandBufferQueryCopies; -} VkPhysicalDevicePerformanceQueryPropertiesKHR; - -typedef struct VkPhysicalDevicePipelineBinaryFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 pipelineBinaries; -} VkPhysicalDevicePipelineBinaryFeaturesKHR; - -typedef struct VkPhysicalDevicePipelineBinaryPropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 pipelineBinaryInternalCache; - VkBool32 pipelineBinaryInternalCacheControl; - VkBool32 pipelineBinaryPrefersInternalCache; - VkBool32 pipelineBinaryPrecompiledInternalCache; - VkBool32 pipelineBinaryCompressedData; -} VkPhysicalDevicePipelineBinaryPropertiesKHR; - -typedef struct VkPhysicalDevicePipelineCreationCacheControlFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 pipelineCreationCacheControl; -} VkPhysicalDevicePipelineCreationCacheControlFeatures; -typedef VkPhysicalDevicePipelineCreationCacheControlFeatures VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT; - -typedef struct VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 pipelineExecutableInfo; -} VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR; - -typedef struct VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 pipelineLibraryGroupHandles; -} VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT; - -typedef struct VkPhysicalDevicePipelinePropertiesFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 pipelinePropertiesIdentifier; -} VkPhysicalDevicePipelinePropertiesFeaturesEXT; - -typedef struct VkPhysicalDevicePipelineProtectedAccessFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 pipelineProtectedAccess; -} VkPhysicalDevicePipelineProtectedAccessFeatures; -typedef VkPhysicalDevicePipelineProtectedAccessFeatures VkPhysicalDevicePipelineProtectedAccessFeaturesEXT; - -typedef struct VkPhysicalDevicePipelineRobustnessFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 pipelineRobustness; -} VkPhysicalDevicePipelineRobustnessFeatures; -typedef VkPhysicalDevicePipelineRobustnessFeatures VkPhysicalDevicePipelineRobustnessFeaturesEXT; - -typedef struct VkPhysicalDevicePipelineRobustnessProperties -{ - VkStructureType sType; - void *pNext; - VkPipelineRobustnessBufferBehavior defaultRobustnessStorageBuffers; - VkPipelineRobustnessBufferBehavior defaultRobustnessUniformBuffers; - VkPipelineRobustnessBufferBehavior defaultRobustnessVertexInputs; - VkPipelineRobustnessImageBehavior defaultRobustnessImages; -} VkPhysicalDevicePipelineRobustnessProperties; -typedef VkPhysicalDevicePipelineRobustnessProperties VkPhysicalDevicePipelineRobustnessPropertiesEXT; - -typedef struct VkPhysicalDevicePointClippingProperties -{ - VkStructureType sType; - void *pNext; - VkPointClippingBehavior pointClippingBehavior; -} VkPhysicalDevicePointClippingProperties; -typedef VkPhysicalDevicePointClippingProperties VkPhysicalDevicePointClippingPropertiesKHR; - -typedef struct VkPhysicalDevicePresentBarrierFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 presentBarrier; -} VkPhysicalDevicePresentBarrierFeaturesNV; - -typedef struct VkPhysicalDevicePresentIdFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 presentId; -} VkPhysicalDevicePresentIdFeaturesKHR; - -typedef struct VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 presentModeFifoLatestReady; -} VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT; - -typedef struct VkPhysicalDevicePresentWaitFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 presentWait; -} VkPhysicalDevicePresentWaitFeaturesKHR; - -typedef struct VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 primitiveTopologyListRestart; - VkBool32 primitiveTopologyPatchListRestart; -} VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT; - -typedef struct VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 primitivesGeneratedQuery; - VkBool32 primitivesGeneratedQueryWithRasterizerDiscard; - VkBool32 primitivesGeneratedQueryWithNonZeroStreams; -} VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT; - -typedef struct VkPhysicalDevicePrivateDataFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 privateData; -} VkPhysicalDevicePrivateDataFeatures; -typedef VkPhysicalDevicePrivateDataFeatures VkPhysicalDevicePrivateDataFeaturesEXT; - -typedef struct VkPhysicalDeviceProtectedMemoryFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 protectedMemory; -} VkPhysicalDeviceProtectedMemoryFeatures; - -typedef struct VkPhysicalDeviceProtectedMemoryProperties -{ - VkStructureType sType; - void *pNext; - VkBool32 protectedNoFault; -} VkPhysicalDeviceProtectedMemoryProperties; - -typedef struct VkPhysicalDeviceProvokingVertexFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 provokingVertexLast; - VkBool32 transformFeedbackPreservesProvokingVertex; -} VkPhysicalDeviceProvokingVertexFeaturesEXT; - -typedef struct VkPhysicalDeviceProvokingVertexPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 provokingVertexModePerPipeline; - VkBool32 transformFeedbackPreservesTriangleFanProvokingVertex; -} VkPhysicalDeviceProvokingVertexPropertiesEXT; - -typedef struct VkPhysicalDevicePushDescriptorProperties -{ - VkStructureType sType; - void *pNext; - uint32_t maxPushDescriptors; -} VkPhysicalDevicePushDescriptorProperties; -typedef VkPhysicalDevicePushDescriptorProperties VkPhysicalDevicePushDescriptorPropertiesKHR; - -typedef struct VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 formatRgba10x6WithoutYCbCrSampler; -} VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT; - -typedef struct VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 rasterizationOrderColorAttachmentAccess; - VkBool32 rasterizationOrderDepthAttachmentAccess; - VkBool32 rasterizationOrderStencilAttachmentAccess; -} VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT; -typedef VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesARM; - -typedef struct VkPhysicalDeviceRawAccessChainsFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderRawAccessChains; -} VkPhysicalDeviceRawAccessChainsFeaturesNV; - -typedef struct VkPhysicalDeviceRayQueryFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 rayQuery; -} VkPhysicalDeviceRayQueryFeaturesKHR; - -typedef struct VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 rayTracingInvocationReorder; -} VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV; - -typedef struct VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV -{ - VkStructureType sType; - void *pNext; - VkRayTracingInvocationReorderModeNV rayTracingInvocationReorderReorderingHint; -} VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV; - -typedef struct VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 rayTracingMaintenance1; - VkBool32 rayTracingPipelineTraceRaysIndirect2; -} VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR; - -typedef struct VkPhysicalDeviceRayTracingMotionBlurFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 rayTracingMotionBlur; - VkBool32 rayTracingMotionBlurPipelineTraceRaysIndirect; -} VkPhysicalDeviceRayTracingMotionBlurFeaturesNV; - -typedef struct VkPhysicalDeviceRayTracingPipelineFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 rayTracingPipeline; - VkBool32 rayTracingPipelineShaderGroupHandleCaptureReplay; - VkBool32 rayTracingPipelineShaderGroupHandleCaptureReplayMixed; - VkBool32 rayTracingPipelineTraceRaysIndirect; - VkBool32 rayTraversalPrimitiveCulling; -} VkPhysicalDeviceRayTracingPipelineFeaturesKHR; - -typedef struct VkPhysicalDeviceRayTracingPipelinePropertiesKHR -{ - VkStructureType sType; - void *pNext; - uint32_t shaderGroupHandleSize; - uint32_t maxRayRecursionDepth; - uint32_t maxShaderGroupStride; - uint32_t shaderGroupBaseAlignment; - uint32_t shaderGroupHandleCaptureReplaySize; - uint32_t maxRayDispatchInvocationCount; - uint32_t shaderGroupHandleAlignment; - uint32_t maxRayHitAttributeSize; -} VkPhysicalDeviceRayTracingPipelinePropertiesKHR; - -typedef struct VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 rayTracingPositionFetch; -} VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR; - -typedef struct VkPhysicalDeviceRayTracingPropertiesNV -{ - VkStructureType sType; - void *pNext; - uint32_t shaderGroupHandleSize; - uint32_t maxRecursionDepth; - uint32_t maxShaderGroupStride; - uint32_t shaderGroupBaseAlignment; - uint64_t WINE_VK_ALIGN(8) maxGeometryCount; - uint64_t WINE_VK_ALIGN(8) maxInstanceCount; - uint64_t WINE_VK_ALIGN(8) maxTriangleCount; - uint32_t maxDescriptorSetAccelerationStructures; -} VkPhysicalDeviceRayTracingPropertiesNV; - -typedef struct VkPhysicalDeviceRayTracingValidationFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 rayTracingValidation; -} VkPhysicalDeviceRayTracingValidationFeaturesNV; - -typedef struct VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG -{ - VkStructureType sType; - void *pNext; - VkBool32 relaxedLineRasterization; -} VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG; - -typedef struct VkPhysicalDeviceRenderPassStripedFeaturesARM -{ - VkStructureType sType; - void *pNext; - VkBool32 renderPassStriped; -} VkPhysicalDeviceRenderPassStripedFeaturesARM; - -typedef struct VkPhysicalDeviceRenderPassStripedPropertiesARM -{ - VkStructureType sType; - void *pNext; - VkExtent2D renderPassStripeGranularity; - uint32_t maxRenderPassStripes; -} VkPhysicalDeviceRenderPassStripedPropertiesARM; - -typedef struct VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 representativeFragmentTest; -} VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV; - -typedef struct VkPhysicalDeviceRobustness2FeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 robustBufferAccess2; - VkBool32 robustImageAccess2; - VkBool32 nullDescriptor; -} VkPhysicalDeviceRobustness2FeaturesEXT; - -typedef struct VkPhysicalDeviceRobustness2PropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) robustStorageBufferAccessSizeAlignment; - VkDeviceSize WINE_VK_ALIGN(8) robustUniformBufferAccessSizeAlignment; -} VkPhysicalDeviceRobustness2PropertiesEXT; - -typedef struct VkPhysicalDeviceSampleLocationsPropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkSampleCountFlags sampleLocationSampleCounts; - VkExtent2D maxSampleLocationGridSize; - float sampleLocationCoordinateRange[2]; - uint32_t sampleLocationSubPixelBits; - VkBool32 variableSampleLocations; -} VkPhysicalDeviceSampleLocationsPropertiesEXT; - -typedef struct VkPhysicalDeviceSamplerFilterMinmaxProperties -{ - VkStructureType sType; - void *pNext; - VkBool32 filterMinmaxSingleComponentFormats; - VkBool32 filterMinmaxImageComponentMapping; -} VkPhysicalDeviceSamplerFilterMinmaxProperties; -typedef VkPhysicalDeviceSamplerFilterMinmaxProperties VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT; - -typedef struct VkPhysicalDeviceSamplerYcbcrConversionFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 samplerYcbcrConversion; -} VkPhysicalDeviceSamplerYcbcrConversionFeatures; -typedef VkPhysicalDeviceSamplerYcbcrConversionFeatures VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR; - -typedef struct VkPhysicalDeviceScalarBlockLayoutFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 scalarBlockLayout; -} VkPhysicalDeviceScalarBlockLayoutFeatures; -typedef VkPhysicalDeviceScalarBlockLayoutFeatures VkPhysicalDeviceScalarBlockLayoutFeaturesEXT; - -typedef struct VkPhysicalDeviceSchedulingControlsFeaturesARM -{ - VkStructureType sType; - void *pNext; - VkBool32 schedulingControls; -} VkPhysicalDeviceSchedulingControlsFeaturesARM; - -typedef struct VkPhysicalDeviceSchedulingControlsPropertiesARM -{ - VkStructureType sType; - void *pNext; - VkPhysicalDeviceSchedulingControlsFlagsARM WINE_VK_ALIGN(8) schedulingControlsFlags; -} VkPhysicalDeviceSchedulingControlsPropertiesARM; - -typedef struct VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 separateDepthStencilLayouts; -} VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures; -typedef VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR; - -typedef struct VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderFloat16VectorAtomics; -} VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV; - -typedef struct VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderBufferFloat16Atomics; - VkBool32 shaderBufferFloat16AtomicAdd; - VkBool32 shaderBufferFloat16AtomicMinMax; - VkBool32 shaderBufferFloat32AtomicMinMax; - VkBool32 shaderBufferFloat64AtomicMinMax; - VkBool32 shaderSharedFloat16Atomics; - VkBool32 shaderSharedFloat16AtomicAdd; - VkBool32 shaderSharedFloat16AtomicMinMax; - VkBool32 shaderSharedFloat32AtomicMinMax; - VkBool32 shaderSharedFloat64AtomicMinMax; - VkBool32 shaderImageFloat32AtomicMinMax; - VkBool32 sparseImageFloat32AtomicMinMax; -} VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT; - -typedef struct VkPhysicalDeviceShaderAtomicFloatFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderBufferFloat32Atomics; - VkBool32 shaderBufferFloat32AtomicAdd; - VkBool32 shaderBufferFloat64Atomics; - VkBool32 shaderBufferFloat64AtomicAdd; - VkBool32 shaderSharedFloat32Atomics; - VkBool32 shaderSharedFloat32AtomicAdd; - VkBool32 shaderSharedFloat64Atomics; - VkBool32 shaderSharedFloat64AtomicAdd; - VkBool32 shaderImageFloat32Atomics; - VkBool32 shaderImageFloat32AtomicAdd; - VkBool32 sparseImageFloat32Atomics; - VkBool32 sparseImageFloat32AtomicAdd; -} VkPhysicalDeviceShaderAtomicFloatFeaturesEXT; - -typedef struct VkPhysicalDeviceShaderAtomicInt64Features -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderBufferInt64Atomics; - VkBool32 shaderSharedInt64Atomics; -} VkPhysicalDeviceShaderAtomicInt64Features; -typedef VkPhysicalDeviceShaderAtomicInt64Features VkPhysicalDeviceShaderAtomicInt64FeaturesKHR; - -typedef struct VkPhysicalDeviceShaderClockFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderSubgroupClock; - VkBool32 shaderDeviceClock; -} VkPhysicalDeviceShaderClockFeaturesKHR; - -typedef struct VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderCoreBuiltins; -} VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM; - -typedef struct VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM -{ - VkStructureType sType; - void *pNext; - uint64_t WINE_VK_ALIGN(8) shaderCoreMask; - uint32_t shaderCoreCount; - uint32_t shaderWarpsPerCore; -} VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM; - -typedef struct VkPhysicalDeviceShaderCoreProperties2AMD -{ - VkStructureType sType; - void *pNext; - VkShaderCorePropertiesFlagsAMD shaderCoreFeatures; - uint32_t activeComputeUnitCount; -} VkPhysicalDeviceShaderCoreProperties2AMD; - -typedef struct VkPhysicalDeviceShaderCorePropertiesAMD -{ - VkStructureType sType; - void *pNext; - uint32_t shaderEngineCount; - uint32_t shaderArraysPerEngineCount; - uint32_t computeUnitsPerShaderArray; - uint32_t simdPerComputeUnit; - uint32_t wavefrontsPerSimd; - uint32_t wavefrontSize; - uint32_t sgprsPerSimd; - uint32_t minSgprAllocation; - uint32_t maxSgprAllocation; - uint32_t sgprAllocationGranularity; - uint32_t vgprsPerSimd; - uint32_t minVgprAllocation; - uint32_t maxVgprAllocation; - uint32_t vgprAllocationGranularity; -} VkPhysicalDeviceShaderCorePropertiesAMD; - -typedef struct VkPhysicalDeviceShaderCorePropertiesARM -{ - VkStructureType sType; - void *pNext; - uint32_t pixelRate; - uint32_t texelRate; - uint32_t fmaRate; -} VkPhysicalDeviceShaderCorePropertiesARM; - -typedef struct VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderDemoteToHelperInvocation; -} VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures; -typedef VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT; - - -typedef struct VkPhysicalDeviceShaderDrawParametersFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderDrawParameters; -} VkPhysicalDeviceShaderDrawParametersFeatures; -typedef VkPhysicalDeviceShaderDrawParametersFeatures VkPhysicalDeviceShaderDrawParameterFeatures; - -typedef struct VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderEarlyAndLateFragmentTests; -} VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD; - -typedef struct VkPhysicalDeviceShaderExpectAssumeFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderExpectAssume; -} VkPhysicalDeviceShaderExpectAssumeFeatures; -typedef VkPhysicalDeviceShaderExpectAssumeFeatures VkPhysicalDeviceShaderExpectAssumeFeaturesKHR; - -typedef struct VkPhysicalDeviceShaderFloat16Int8Features -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderFloat16; - VkBool32 shaderInt8; -} VkPhysicalDeviceShaderFloat16Int8Features; -typedef VkPhysicalDeviceShaderFloat16Int8Features VkPhysicalDeviceShaderFloat16Int8FeaturesKHR; -typedef VkPhysicalDeviceShaderFloat16Int8Features VkPhysicalDeviceFloat16Int8FeaturesKHR; - -typedef struct VkPhysicalDeviceShaderFloatControls2Features -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderFloatControls2; -} VkPhysicalDeviceShaderFloatControls2Features; -typedef VkPhysicalDeviceShaderFloatControls2Features VkPhysicalDeviceShaderFloatControls2FeaturesKHR; - -typedef struct VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderImageInt64Atomics; - VkBool32 sparseImageInt64Atomics; -} VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT; - -typedef struct VkPhysicalDeviceShaderImageFootprintFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 imageFootprint; -} VkPhysicalDeviceShaderImageFootprintFeaturesNV; - -typedef struct VkPhysicalDeviceShaderIntegerDotProductFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderIntegerDotProduct; -} VkPhysicalDeviceShaderIntegerDotProductFeatures; -typedef VkPhysicalDeviceShaderIntegerDotProductFeatures VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR; - -typedef struct VkPhysicalDeviceShaderIntegerDotProductProperties -{ - VkStructureType sType; - void *pNext; - VkBool32 integerDotProduct8BitUnsignedAccelerated; - VkBool32 integerDotProduct8BitSignedAccelerated; - VkBool32 integerDotProduct8BitMixedSignednessAccelerated; - VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated; - VkBool32 integerDotProduct4x8BitPackedSignedAccelerated; - VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated; - VkBool32 integerDotProduct16BitUnsignedAccelerated; - VkBool32 integerDotProduct16BitSignedAccelerated; - VkBool32 integerDotProduct16BitMixedSignednessAccelerated; - VkBool32 integerDotProduct32BitUnsignedAccelerated; - VkBool32 integerDotProduct32BitSignedAccelerated; - VkBool32 integerDotProduct32BitMixedSignednessAccelerated; - VkBool32 integerDotProduct64BitUnsignedAccelerated; - VkBool32 integerDotProduct64BitSignedAccelerated; - VkBool32 integerDotProduct64BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated; -} VkPhysicalDeviceShaderIntegerDotProductProperties; -typedef VkPhysicalDeviceShaderIntegerDotProductProperties VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR; - -typedef struct VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderIntegerFunctions2; -} VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL; - -typedef struct VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderMaximalReconvergence; -} VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR; - -typedef struct VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderModuleIdentifier; -} VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT; - -typedef struct VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint8_t shaderModuleIdentifierAlgorithmUUID[VK_UUID_SIZE]; -} VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT; - -typedef struct VkPhysicalDeviceShaderObjectFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderObject; -} VkPhysicalDeviceShaderObjectFeaturesEXT; - -typedef struct VkPhysicalDeviceShaderObjectPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint8_t shaderBinaryUUID[VK_UUID_SIZE]; - uint32_t shaderBinaryVersion; -} VkPhysicalDeviceShaderObjectPropertiesEXT; - -typedef struct VkPhysicalDeviceShaderQuadControlFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderQuadControl; -} VkPhysicalDeviceShaderQuadControlFeaturesKHR; - -typedef struct VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderRelaxedExtendedInstruction; -} VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR; - -typedef struct VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderReplicatedComposites; -} VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT; - -typedef struct VkPhysicalDeviceShaderSMBuiltinsFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderSMBuiltins; -} VkPhysicalDeviceShaderSMBuiltinsFeaturesNV; - -typedef struct VkPhysicalDeviceShaderSMBuiltinsPropertiesNV -{ - VkStructureType sType; - void *pNext; - uint32_t shaderSMCount; - uint32_t shaderWarpsPerSM; -} VkPhysicalDeviceShaderSMBuiltinsPropertiesNV; - -typedef struct VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderSubgroupExtendedTypes; -} VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures; -typedef VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR; - -typedef struct VkPhysicalDeviceShaderSubgroupRotateFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderSubgroupRotate; - VkBool32 shaderSubgroupRotateClustered; -} VkPhysicalDeviceShaderSubgroupRotateFeatures; -typedef VkPhysicalDeviceShaderSubgroupRotateFeatures VkPhysicalDeviceShaderSubgroupRotateFeaturesKHR; - -typedef struct VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderSubgroupUniformControlFlow; -} VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR; - -typedef struct VkPhysicalDeviceShaderTerminateInvocationFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderTerminateInvocation; -} VkPhysicalDeviceShaderTerminateInvocationFeatures; -typedef VkPhysicalDeviceShaderTerminateInvocationFeatures VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR; - -typedef struct VkPhysicalDeviceShaderTileImageFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderTileImageColorReadAccess; - VkBool32 shaderTileImageDepthReadAccess; - VkBool32 shaderTileImageStencilReadAccess; -} VkPhysicalDeviceShaderTileImageFeaturesEXT; - -typedef struct VkPhysicalDeviceShaderTileImagePropertiesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderTileImageCoherentReadAccelerated; - VkBool32 shaderTileImageReadSampleFromPixelRateInvocation; - VkBool32 shaderTileImageReadFromHelperInvocation; -} VkPhysicalDeviceShaderTileImagePropertiesEXT; - -typedef struct VkPhysicalDeviceShadingRateImageFeaturesNV -{ - VkStructureType sType; - void *pNext; - VkBool32 shadingRateImage; - VkBool32 shadingRateCoarseSampleOrder; -} VkPhysicalDeviceShadingRateImageFeaturesNV; - -typedef struct VkPhysicalDeviceShadingRateImagePropertiesNV -{ - VkStructureType sType; - void *pNext; - VkExtent2D shadingRateTexelSize; - uint32_t shadingRatePaletteSize; - uint32_t shadingRateMaxCoarseSamples; -} VkPhysicalDeviceShadingRateImagePropertiesNV; - -typedef struct VkPhysicalDeviceSparseImageFormatInfo2 -{ - VkStructureType sType; - const void *pNext; - VkFormat format; - VkImageType type; - VkSampleCountFlagBits samples; - VkImageUsageFlags usage; - VkImageTiling tiling; -} VkPhysicalDeviceSparseImageFormatInfo2; -typedef VkPhysicalDeviceSparseImageFormatInfo2 VkPhysicalDeviceSparseImageFormatInfo2KHR; - -typedef struct VkPhysicalDeviceSparseProperties -{ - VkBool32 residencyStandard2DBlockShape; - VkBool32 residencyStandard2DMultisampleBlockShape; - VkBool32 residencyStandard3DBlockShape; - VkBool32 residencyAlignedMipSize; - VkBool32 residencyNonResidentStrict; -} VkPhysicalDeviceSparseProperties; - -typedef struct VkPhysicalDeviceSubgroupProperties -{ - VkStructureType sType; - void *pNext; - uint32_t subgroupSize; - VkShaderStageFlags supportedStages; - VkSubgroupFeatureFlags supportedOperations; - VkBool32 quadOperationsInAllStages; -} VkPhysicalDeviceSubgroupProperties; - -typedef struct VkPhysicalDeviceSubgroupSizeControlFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 subgroupSizeControl; - VkBool32 computeFullSubgroups; -} VkPhysicalDeviceSubgroupSizeControlFeatures; -typedef VkPhysicalDeviceSubgroupSizeControlFeatures VkPhysicalDeviceSubgroupSizeControlFeaturesEXT; - -typedef struct VkPhysicalDeviceSubgroupSizeControlProperties -{ - VkStructureType sType; - void *pNext; - uint32_t minSubgroupSize; - uint32_t maxSubgroupSize; - uint32_t maxComputeWorkgroupSubgroups; - VkShaderStageFlags requiredSubgroupSizeStages; -} VkPhysicalDeviceSubgroupSizeControlProperties; -typedef VkPhysicalDeviceSubgroupSizeControlProperties VkPhysicalDeviceSubgroupSizeControlPropertiesEXT; - -typedef struct VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 subpassMergeFeedback; -} VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT; - -typedef struct VkPhysicalDeviceSubpassShadingFeaturesHUAWEI -{ - VkStructureType sType; - void *pNext; - VkBool32 subpassShading; -} VkPhysicalDeviceSubpassShadingFeaturesHUAWEI; - -typedef struct VkPhysicalDeviceSubpassShadingPropertiesHUAWEI -{ - VkStructureType sType; - void *pNext; - uint32_t maxSubpassShadingWorkgroupSizeAspectRatio; -} VkPhysicalDeviceSubpassShadingPropertiesHUAWEI; - -typedef struct VkPhysicalDeviceSurfaceInfo2KHR -{ - VkStructureType sType; - const void *pNext; - VkSurfaceKHR WINE_VK_ALIGN(8) surface; -} VkPhysicalDeviceSurfaceInfo2KHR; - -typedef struct VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 swapchainMaintenance1; -} VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT; - -typedef struct VkPhysicalDeviceSynchronization2Features -{ - VkStructureType sType; - void *pNext; - VkBool32 synchronization2; -} VkPhysicalDeviceSynchronization2Features; -typedef VkPhysicalDeviceSynchronization2Features VkPhysicalDeviceSynchronization2FeaturesKHR; - -typedef struct VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 texelBufferAlignment; -} VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT; - -typedef struct VkPhysicalDeviceTexelBufferAlignmentProperties -{ - VkStructureType sType; - void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) storageTexelBufferOffsetAlignmentBytes; - VkBool32 storageTexelBufferOffsetSingleTexelAlignment; - VkDeviceSize WINE_VK_ALIGN(8) uniformTexelBufferOffsetAlignmentBytes; - VkBool32 uniformTexelBufferOffsetSingleTexelAlignment; -} VkPhysicalDeviceTexelBufferAlignmentProperties; -typedef VkPhysicalDeviceTexelBufferAlignmentProperties VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT; - -typedef struct VkPhysicalDeviceTextureCompressionASTCHDRFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 textureCompressionASTC_HDR; -} VkPhysicalDeviceTextureCompressionASTCHDRFeatures; -typedef VkPhysicalDeviceTextureCompressionASTCHDRFeatures VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT; - -typedef struct VkPhysicalDeviceTilePropertiesFeaturesQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 tileProperties; -} VkPhysicalDeviceTilePropertiesFeaturesQCOM; - -typedef struct VkPhysicalDeviceTimelineSemaphoreFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 timelineSemaphore; -} VkPhysicalDeviceTimelineSemaphoreFeatures; -typedef VkPhysicalDeviceTimelineSemaphoreFeatures VkPhysicalDeviceTimelineSemaphoreFeaturesKHR; - -typedef struct VkPhysicalDeviceTimelineSemaphoreProperties -{ - VkStructureType sType; - void *pNext; - uint64_t WINE_VK_ALIGN(8) maxTimelineSemaphoreValueDifference; -} VkPhysicalDeviceTimelineSemaphoreProperties; -typedef VkPhysicalDeviceTimelineSemaphoreProperties VkPhysicalDeviceTimelineSemaphorePropertiesKHR; - -typedef struct VkPhysicalDeviceToolProperties -{ - VkStructureType sType; - void *pNext; - char name[VK_MAX_EXTENSION_NAME_SIZE]; - char version[VK_MAX_EXTENSION_NAME_SIZE]; - VkToolPurposeFlags purposes; - char description[VK_MAX_DESCRIPTION_SIZE]; - char layer[VK_MAX_EXTENSION_NAME_SIZE]; -} VkPhysicalDeviceToolProperties; -typedef VkPhysicalDeviceToolProperties VkPhysicalDeviceToolPropertiesEXT; - -typedef struct VkPhysicalDeviceTransformFeedbackFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 transformFeedback; - VkBool32 geometryStreams; -} VkPhysicalDeviceTransformFeedbackFeaturesEXT; - -typedef struct VkPhysicalDeviceTransformFeedbackPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t maxTransformFeedbackStreams; - uint32_t maxTransformFeedbackBuffers; - VkDeviceSize WINE_VK_ALIGN(8) maxTransformFeedbackBufferSize; - uint32_t maxTransformFeedbackStreamDataSize; - uint32_t maxTransformFeedbackBufferDataSize; - uint32_t maxTransformFeedbackBufferDataStride; - VkBool32 transformFeedbackQueries; - VkBool32 transformFeedbackStreamsLinesTriangles; - VkBool32 transformFeedbackRasterizationStreamSelect; - VkBool32 transformFeedbackDraw; -} VkPhysicalDeviceTransformFeedbackPropertiesEXT; - -typedef struct VkPhysicalDeviceUniformBufferStandardLayoutFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 uniformBufferStandardLayout; -} VkPhysicalDeviceUniformBufferStandardLayoutFeatures; -typedef VkPhysicalDeviceUniformBufferStandardLayoutFeatures VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR; - - -typedef struct VkPhysicalDeviceVariablePointersFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 variablePointersStorageBuffer; - VkBool32 variablePointers; -} VkPhysicalDeviceVariablePointersFeatures; -typedef VkPhysicalDeviceVariablePointersFeatures VkPhysicalDeviceVariablePointersFeaturesKHR; -typedef VkPhysicalDeviceVariablePointersFeatures VkPhysicalDeviceVariablePointerFeaturesKHR; -typedef VkPhysicalDeviceVariablePointersFeatures VkPhysicalDeviceVariablePointerFeatures; - -typedef struct VkPhysicalDeviceVertexAttributeDivisorFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 vertexAttributeInstanceRateDivisor; - VkBool32 vertexAttributeInstanceRateZeroDivisor; -} VkPhysicalDeviceVertexAttributeDivisorFeatures; -typedef VkPhysicalDeviceVertexAttributeDivisorFeatures VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR; -typedef VkPhysicalDeviceVertexAttributeDivisorFeatures VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT; - -typedef struct VkPhysicalDeviceVertexAttributeDivisorProperties -{ - VkStructureType sType; - void *pNext; - uint32_t maxVertexAttribDivisor; - VkBool32 supportsNonZeroFirstInstance; -} VkPhysicalDeviceVertexAttributeDivisorProperties; -typedef VkPhysicalDeviceVertexAttributeDivisorProperties VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR; - -typedef struct VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT -{ - VkStructureType sType; - void *pNext; - uint32_t maxVertexAttribDivisor; -} VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT; - -typedef struct VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 vertexAttributeRobustness; -} VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT; - -typedef struct VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 vertexInputDynamicState; -} VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT; - -typedef struct VkPhysicalDeviceVideoEncodeAV1FeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 videoEncodeAV1; -} VkPhysicalDeviceVideoEncodeAV1FeaturesKHR; - -typedef struct VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 videoEncodeQuantizationMap; -} VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR; - -typedef struct VkPhysicalDeviceVideoFormatInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkImageUsageFlags imageUsage; -} VkPhysicalDeviceVideoFormatInfoKHR; - -typedef struct VkPhysicalDeviceVideoMaintenance1FeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 videoMaintenance1; -} VkPhysicalDeviceVideoMaintenance1FeaturesKHR; - -typedef struct VkPhysicalDeviceVulkan11Features -{ - VkStructureType sType; - void *pNext; - VkBool32 storageBuffer16BitAccess; - VkBool32 uniformAndStorageBuffer16BitAccess; - VkBool32 storagePushConstant16; - VkBool32 storageInputOutput16; - VkBool32 multiview; - VkBool32 multiviewGeometryShader; - VkBool32 multiviewTessellationShader; - VkBool32 variablePointersStorageBuffer; - VkBool32 variablePointers; - VkBool32 protectedMemory; - VkBool32 samplerYcbcrConversion; - VkBool32 shaderDrawParameters; -} VkPhysicalDeviceVulkan11Features; - -typedef struct VkPhysicalDeviceVulkan11Properties -{ - VkStructureType sType; - void *pNext; - uint8_t deviceUUID[VK_UUID_SIZE]; - uint8_t driverUUID[VK_UUID_SIZE]; - uint8_t deviceLUID[VK_LUID_SIZE]; - uint32_t deviceNodeMask; - VkBool32 deviceLUIDValid; - uint32_t subgroupSize; - VkShaderStageFlags subgroupSupportedStages; - VkSubgroupFeatureFlags subgroupSupportedOperations; - VkBool32 subgroupQuadOperationsInAllStages; - VkPointClippingBehavior pointClippingBehavior; - uint32_t maxMultiviewViewCount; - uint32_t maxMultiviewInstanceIndex; - VkBool32 protectedNoFault; - uint32_t maxPerSetDescriptors; - VkDeviceSize WINE_VK_ALIGN(8) maxMemoryAllocationSize; -} VkPhysicalDeviceVulkan11Properties; - -typedef struct VkPhysicalDeviceVulkan12Features -{ - VkStructureType sType; - void *pNext; - VkBool32 samplerMirrorClampToEdge; - VkBool32 drawIndirectCount; - VkBool32 storageBuffer8BitAccess; - VkBool32 uniformAndStorageBuffer8BitAccess; - VkBool32 storagePushConstant8; - VkBool32 shaderBufferInt64Atomics; - VkBool32 shaderSharedInt64Atomics; - VkBool32 shaderFloat16; - VkBool32 shaderInt8; - VkBool32 descriptorIndexing; - VkBool32 shaderInputAttachmentArrayDynamicIndexing; - VkBool32 shaderUniformTexelBufferArrayDynamicIndexing; - VkBool32 shaderStorageTexelBufferArrayDynamicIndexing; - VkBool32 shaderUniformBufferArrayNonUniformIndexing; - VkBool32 shaderSampledImageArrayNonUniformIndexing; - VkBool32 shaderStorageBufferArrayNonUniformIndexing; - VkBool32 shaderStorageImageArrayNonUniformIndexing; - VkBool32 shaderInputAttachmentArrayNonUniformIndexing; - VkBool32 shaderUniformTexelBufferArrayNonUniformIndexing; - VkBool32 shaderStorageTexelBufferArrayNonUniformIndexing; - VkBool32 descriptorBindingUniformBufferUpdateAfterBind; - VkBool32 descriptorBindingSampledImageUpdateAfterBind; - VkBool32 descriptorBindingStorageImageUpdateAfterBind; - VkBool32 descriptorBindingStorageBufferUpdateAfterBind; - VkBool32 descriptorBindingUniformTexelBufferUpdateAfterBind; - VkBool32 descriptorBindingStorageTexelBufferUpdateAfterBind; - VkBool32 descriptorBindingUpdateUnusedWhilePending; - VkBool32 descriptorBindingPartiallyBound; - VkBool32 descriptorBindingVariableDescriptorCount; - VkBool32 runtimeDescriptorArray; - VkBool32 samplerFilterMinmax; - VkBool32 scalarBlockLayout; - VkBool32 imagelessFramebuffer; - VkBool32 uniformBufferStandardLayout; - VkBool32 shaderSubgroupExtendedTypes; - VkBool32 separateDepthStencilLayouts; - VkBool32 hostQueryReset; - VkBool32 timelineSemaphore; - VkBool32 bufferDeviceAddress; - VkBool32 bufferDeviceAddressCaptureReplay; - VkBool32 bufferDeviceAddressMultiDevice; - VkBool32 vulkanMemoryModel; - VkBool32 vulkanMemoryModelDeviceScope; - VkBool32 vulkanMemoryModelAvailabilityVisibilityChains; - VkBool32 shaderOutputViewportIndex; - VkBool32 shaderOutputLayer; - VkBool32 subgroupBroadcastDynamicId; -} VkPhysicalDeviceVulkan12Features; - -typedef struct VkPhysicalDeviceVulkan12Properties -{ - VkStructureType sType; - void *pNext; - VkDriverId driverID; - char driverName[VK_MAX_DRIVER_NAME_SIZE]; - char driverInfo[VK_MAX_DRIVER_INFO_SIZE]; - VkConformanceVersion conformanceVersion; - VkShaderFloatControlsIndependence denormBehaviorIndependence; - VkShaderFloatControlsIndependence roundingModeIndependence; - VkBool32 shaderSignedZeroInfNanPreserveFloat16; - VkBool32 shaderSignedZeroInfNanPreserveFloat32; - VkBool32 shaderSignedZeroInfNanPreserveFloat64; - VkBool32 shaderDenormPreserveFloat16; - VkBool32 shaderDenormPreserveFloat32; - VkBool32 shaderDenormPreserveFloat64; - VkBool32 shaderDenormFlushToZeroFloat16; - VkBool32 shaderDenormFlushToZeroFloat32; - VkBool32 shaderDenormFlushToZeroFloat64; - VkBool32 shaderRoundingModeRTEFloat16; - VkBool32 shaderRoundingModeRTEFloat32; - VkBool32 shaderRoundingModeRTEFloat64; - VkBool32 shaderRoundingModeRTZFloat16; - VkBool32 shaderRoundingModeRTZFloat32; - VkBool32 shaderRoundingModeRTZFloat64; - uint32_t maxUpdateAfterBindDescriptorsInAllPools; - VkBool32 shaderUniformBufferArrayNonUniformIndexingNative; - VkBool32 shaderSampledImageArrayNonUniformIndexingNative; - VkBool32 shaderStorageBufferArrayNonUniformIndexingNative; - VkBool32 shaderStorageImageArrayNonUniformIndexingNative; - VkBool32 shaderInputAttachmentArrayNonUniformIndexingNative; - VkBool32 robustBufferAccessUpdateAfterBind; - VkBool32 quadDivergentImplicitLod; - uint32_t maxPerStageDescriptorUpdateAfterBindSamplers; - uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers; - uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages; - uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments; - uint32_t maxPerStageUpdateAfterBindResources; - uint32_t maxDescriptorSetUpdateAfterBindSamplers; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic; - uint32_t maxDescriptorSetUpdateAfterBindSampledImages; - uint32_t maxDescriptorSetUpdateAfterBindStorageImages; - uint32_t maxDescriptorSetUpdateAfterBindInputAttachments; - VkResolveModeFlags supportedDepthResolveModes; - VkResolveModeFlags supportedStencilResolveModes; - VkBool32 independentResolveNone; - VkBool32 independentResolve; - VkBool32 filterMinmaxSingleComponentFormats; - VkBool32 filterMinmaxImageComponentMapping; - uint64_t WINE_VK_ALIGN(8) maxTimelineSemaphoreValueDifference; - VkSampleCountFlags framebufferIntegerColorSampleCounts; -} VkPhysicalDeviceVulkan12Properties; - -typedef struct VkPhysicalDeviceVulkan13Features -{ - VkStructureType sType; - void *pNext; - VkBool32 robustImageAccess; - VkBool32 inlineUniformBlock; - VkBool32 descriptorBindingInlineUniformBlockUpdateAfterBind; - VkBool32 pipelineCreationCacheControl; - VkBool32 privateData; - VkBool32 shaderDemoteToHelperInvocation; - VkBool32 shaderTerminateInvocation; - VkBool32 subgroupSizeControl; - VkBool32 computeFullSubgroups; - VkBool32 synchronization2; - VkBool32 textureCompressionASTC_HDR; - VkBool32 shaderZeroInitializeWorkgroupMemory; - VkBool32 dynamicRendering; - VkBool32 shaderIntegerDotProduct; - VkBool32 maintenance4; -} VkPhysicalDeviceVulkan13Features; - -typedef struct VkPhysicalDeviceVulkan13Properties -{ - VkStructureType sType; - void *pNext; - uint32_t minSubgroupSize; - uint32_t maxSubgroupSize; - uint32_t maxComputeWorkgroupSubgroups; - VkShaderStageFlags requiredSubgroupSizeStages; - uint32_t maxInlineUniformBlockSize; - uint32_t maxPerStageDescriptorInlineUniformBlocks; - uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks; - uint32_t maxDescriptorSetInlineUniformBlocks; - uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks; - uint32_t maxInlineUniformTotalSize; - VkBool32 integerDotProduct8BitUnsignedAccelerated; - VkBool32 integerDotProduct8BitSignedAccelerated; - VkBool32 integerDotProduct8BitMixedSignednessAccelerated; - VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated; - VkBool32 integerDotProduct4x8BitPackedSignedAccelerated; - VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated; - VkBool32 integerDotProduct16BitUnsignedAccelerated; - VkBool32 integerDotProduct16BitSignedAccelerated; - VkBool32 integerDotProduct16BitMixedSignednessAccelerated; - VkBool32 integerDotProduct32BitUnsignedAccelerated; - VkBool32 integerDotProduct32BitSignedAccelerated; - VkBool32 integerDotProduct32BitMixedSignednessAccelerated; - VkBool32 integerDotProduct64BitUnsignedAccelerated; - VkBool32 integerDotProduct64BitSignedAccelerated; - VkBool32 integerDotProduct64BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated; - VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated; - VkDeviceSize WINE_VK_ALIGN(8) storageTexelBufferOffsetAlignmentBytes; - VkBool32 storageTexelBufferOffsetSingleTexelAlignment; - VkDeviceSize WINE_VK_ALIGN(8) uniformTexelBufferOffsetAlignmentBytes; - VkBool32 uniformTexelBufferOffsetSingleTexelAlignment; - VkDeviceSize WINE_VK_ALIGN(8) maxBufferSize; -} VkPhysicalDeviceVulkan13Properties; - -typedef struct VkPhysicalDeviceVulkan14Features -{ - VkStructureType sType; - void *pNext; - VkBool32 globalPriorityQuery; - VkBool32 shaderSubgroupRotate; - VkBool32 shaderSubgroupRotateClustered; - VkBool32 shaderFloatControls2; - VkBool32 shaderExpectAssume; - VkBool32 rectangularLines; - VkBool32 bresenhamLines; - VkBool32 smoothLines; - VkBool32 stippledRectangularLines; - VkBool32 stippledBresenhamLines; - VkBool32 stippledSmoothLines; - VkBool32 vertexAttributeInstanceRateDivisor; - VkBool32 vertexAttributeInstanceRateZeroDivisor; - VkBool32 indexTypeUint8; - VkBool32 dynamicRenderingLocalRead; - VkBool32 maintenance5; - VkBool32 maintenance6; - VkBool32 pipelineProtectedAccess; - VkBool32 pipelineRobustness; - VkBool32 hostImageCopy; - VkBool32 pushDescriptor; -} VkPhysicalDeviceVulkan14Features; - -typedef struct VkPhysicalDeviceVulkan14Properties -{ - VkStructureType sType; - void *pNext; - uint32_t lineSubPixelPrecisionBits; - uint32_t maxVertexAttribDivisor; - VkBool32 supportsNonZeroFirstInstance; - uint32_t maxPushDescriptors; - VkBool32 dynamicRenderingLocalReadDepthStencilAttachments; - VkBool32 dynamicRenderingLocalReadMultisampledAttachments; - VkBool32 earlyFragmentMultisampleCoverageAfterSampleCounting; - VkBool32 earlyFragmentSampleMaskTestBeforeSampleCounting; - VkBool32 depthStencilSwizzleOneSupport; - VkBool32 polygonModePointSize; - VkBool32 nonStrictSinglePixelWideLinesUseParallelogram; - VkBool32 nonStrictWideLinesUseParallelogram; - VkBool32 blockTexelViewCompatibleMultipleLayers; - uint32_t maxCombinedImageSamplerDescriptorCount; - VkBool32 fragmentShadingRateClampCombinerInputs; - VkPipelineRobustnessBufferBehavior defaultRobustnessStorageBuffers; - VkPipelineRobustnessBufferBehavior defaultRobustnessUniformBuffers; - VkPipelineRobustnessBufferBehavior defaultRobustnessVertexInputs; - VkPipelineRobustnessImageBehavior defaultRobustnessImages; - uint32_t copySrcLayoutCount; - VkImageLayout *pCopySrcLayouts; - uint32_t copyDstLayoutCount; - VkImageLayout *pCopyDstLayouts; - uint8_t optimalTilingLayoutUUID[VK_UUID_SIZE]; - VkBool32 identicalMemoryTypeRequirements; -} VkPhysicalDeviceVulkan14Properties; - -typedef struct VkPhysicalDeviceVulkanMemoryModelFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 vulkanMemoryModel; - VkBool32 vulkanMemoryModelDeviceScope; - VkBool32 vulkanMemoryModelAvailabilityVisibilityChains; -} VkPhysicalDeviceVulkanMemoryModelFeatures; -typedef VkPhysicalDeviceVulkanMemoryModelFeatures VkPhysicalDeviceVulkanMemoryModelFeaturesKHR; - -typedef struct VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 workgroupMemoryExplicitLayout; - VkBool32 workgroupMemoryExplicitLayoutScalarBlockLayout; - VkBool32 workgroupMemoryExplicitLayout8BitAccess; - VkBool32 workgroupMemoryExplicitLayout16BitAccess; -} VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR; - -typedef struct VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 ycbcr2plane444Formats; -} VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT; - -typedef struct VkPhysicalDeviceYcbcrDegammaFeaturesQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 ycbcrDegamma; -} VkPhysicalDeviceYcbcrDegammaFeaturesQCOM; - -typedef struct VkPhysicalDeviceYcbcrImageArraysFeaturesEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 ycbcrImageArrays; -} VkPhysicalDeviceYcbcrImageArraysFeaturesEXT; - -typedef struct VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures -{ - VkStructureType sType; - void *pNext; - VkBool32 shaderZeroInitializeWorkgroupMemory; -} VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures; -typedef VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR; - -typedef struct VkPipelineBinaryDataInfoKHR -{ - VkStructureType sType; - void *pNext; - VkPipelineBinaryKHR WINE_VK_ALIGN(8) pipelineBinary; -} VkPipelineBinaryDataInfoKHR; - -typedef struct VkPipelineBinaryDataKHR -{ - size_t dataSize; - void *pData; -} VkPipelineBinaryDataKHR; - -typedef struct VkPipelineBinaryHandlesInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t pipelineBinaryCount; - VkPipelineBinaryKHR *pPipelineBinaries; -} VkPipelineBinaryHandlesInfoKHR; - -typedef struct VkPipelineBinaryInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t binaryCount; - const VkPipelineBinaryKHR *pPipelineBinaries; -} VkPipelineBinaryInfoKHR; - -typedef struct VkPipelineBinaryKeyKHR -{ - VkStructureType sType; - void *pNext; - uint32_t keySize; - uint8_t key[VK_MAX_PIPELINE_BINARY_KEY_SIZE_KHR]; -} VkPipelineBinaryKeyKHR; - -typedef struct VkPipelineBinaryKeysAndDataKHR -{ - uint32_t binaryCount; - const VkPipelineBinaryKeyKHR *pPipelineBinaryKeys; - const VkPipelineBinaryDataKHR *pPipelineBinaryData; -} VkPipelineBinaryKeysAndDataKHR; - -typedef struct VkPipelineCacheCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineCacheCreateFlags flags; - size_t initialDataSize; - const void *pInitialData; -} VkPipelineCacheCreateInfo; - -typedef struct VkPipelineCacheHeaderVersionOne -{ - uint32_t headerSize; - VkPipelineCacheHeaderVersion headerVersion; - uint32_t vendorID; - uint32_t deviceID; - uint8_t pipelineCacheUUID[VK_UUID_SIZE]; -} VkPipelineCacheHeaderVersionOne; - -typedef struct VkPipelineColorBlendAdvancedStateCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkBool32 srcPremultiplied; - VkBool32 dstPremultiplied; - VkBlendOverlapEXT blendOverlap; -} VkPipelineColorBlendAdvancedStateCreateInfoEXT; - -typedef struct VkPipelineColorBlendAttachmentState -{ - VkBool32 blendEnable; - VkBlendFactor srcColorBlendFactor; - VkBlendFactor dstColorBlendFactor; - VkBlendOp colorBlendOp; - VkBlendFactor srcAlphaBlendFactor; - VkBlendFactor dstAlphaBlendFactor; - VkBlendOp alphaBlendOp; - VkColorComponentFlags colorWriteMask; -} VkPipelineColorBlendAttachmentState; - -typedef struct VkPipelineColorBlendStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineColorBlendStateCreateFlags flags; - VkBool32 logicOpEnable; - VkLogicOp logicOp; - uint32_t attachmentCount; - const VkPipelineColorBlendAttachmentState *pAttachments; - float blendConstants[4]; -} VkPipelineColorBlendStateCreateInfo; - -typedef struct VkPipelineColorWriteCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t attachmentCount; - const VkBool32 *pColorWriteEnables; -} VkPipelineColorWriteCreateInfoEXT; - -typedef struct VkPipelineCompilerControlCreateInfoAMD -{ - VkStructureType sType; - const void *pNext; - VkPipelineCompilerControlFlagsAMD compilerControlFlags; -} VkPipelineCompilerControlCreateInfoAMD; - -typedef struct VkPipelineCoverageModulationStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkPipelineCoverageModulationStateCreateFlagsNV flags; - VkCoverageModulationModeNV coverageModulationMode; - VkBool32 coverageModulationTableEnable; - uint32_t coverageModulationTableCount; - const float *pCoverageModulationTable; -} VkPipelineCoverageModulationStateCreateInfoNV; - -typedef struct VkPipelineCoverageReductionStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkPipelineCoverageReductionStateCreateFlagsNV flags; - VkCoverageReductionModeNV coverageReductionMode; -} VkPipelineCoverageReductionStateCreateInfoNV; - -typedef struct VkPipelineCoverageToColorStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkPipelineCoverageToColorStateCreateFlagsNV flags; - VkBool32 coverageToColorEnable; - uint32_t coverageToColorLocation; -} VkPipelineCoverageToColorStateCreateInfoNV; - -typedef struct VkPipelineCreateFlags2CreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineCreateFlags2 WINE_VK_ALIGN(8) flags; -} VkPipelineCreateFlags2CreateInfo; -typedef VkPipelineCreateFlags2CreateInfo VkPipelineCreateFlags2CreateInfoKHR; - -typedef struct VkPipelineCreateInfoKHR -{ - VkStructureType sType; - void *pNext; -} VkPipelineCreateInfoKHR; - -typedef struct VkPipelineCreationFeedback -{ - VkPipelineCreationFeedbackFlags flags; - uint64_t WINE_VK_ALIGN(8) duration; -} VkPipelineCreationFeedback; -typedef VkPipelineCreationFeedback VkPipelineCreationFeedbackEXT; - -typedef struct VkPipelineCreationFeedbackCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineCreationFeedback *pPipelineCreationFeedback; - uint32_t pipelineStageCreationFeedbackCount; - VkPipelineCreationFeedback *pPipelineStageCreationFeedbacks; -} VkPipelineCreationFeedbackCreateInfo; -typedef VkPipelineCreationFeedbackCreateInfo VkPipelineCreationFeedbackCreateInfoEXT; - -typedef struct VkPipelineDynamicStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineDynamicStateCreateFlags flags; - uint32_t dynamicStateCount; - const VkDynamicState *pDynamicStates; -} VkPipelineDynamicStateCreateInfo; - -typedef struct VkPipelineExecutableInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkPipeline WINE_VK_ALIGN(8) pipeline; - uint32_t executableIndex; -} VkPipelineExecutableInfoKHR; - -typedef struct VkPipelineExecutableInternalRepresentationKHR -{ - VkStructureType sType; - void *pNext; - char name[VK_MAX_DESCRIPTION_SIZE]; - char description[VK_MAX_DESCRIPTION_SIZE]; - VkBool32 isText; - size_t dataSize; - void *pData; -} VkPipelineExecutableInternalRepresentationKHR; - -typedef struct VkPipelineExecutablePropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkShaderStageFlags stages; - char name[VK_MAX_DESCRIPTION_SIZE]; - char description[VK_MAX_DESCRIPTION_SIZE]; - uint32_t subgroupSize; -} VkPipelineExecutablePropertiesKHR; - -typedef union VkPipelineExecutableStatisticValueKHR -{ - VkBool32 b32; - int64_t i64; - uint64_t WINE_VK_ALIGN(8) u64; - double f64; -} VkPipelineExecutableStatisticValueKHR; - -typedef struct VkPipelineFragmentShadingRateEnumStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkFragmentShadingRateTypeNV shadingRateType; - VkFragmentShadingRateNV shadingRate; - VkFragmentShadingRateCombinerOpKHR combinerOps[2]; -} VkPipelineFragmentShadingRateEnumStateCreateInfoNV; - -typedef struct VkPipelineFragmentShadingRateStateCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkExtent2D fragmentSize; - VkFragmentShadingRateCombinerOpKHR combinerOps[2]; -} VkPipelineFragmentShadingRateStateCreateInfoKHR; - -typedef struct VkPipelineIndirectDeviceAddressInfoNV -{ - VkStructureType sType; - const void *pNext; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline WINE_VK_ALIGN(8) pipeline; -} VkPipelineIndirectDeviceAddressInfoNV; - - -typedef struct VkPipelineInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkPipeline WINE_VK_ALIGN(8) pipeline; -} VkPipelineInfoKHR; -typedef VkPipelineInfoKHR VkPipelineInfoEXT; - -typedef struct VkPipelineInputAssemblyStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineInputAssemblyStateCreateFlags flags; - VkPrimitiveTopology topology; - VkBool32 primitiveRestartEnable; -} VkPipelineInputAssemblyStateCreateInfo; - -typedef struct VkPipelineLibraryCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t libraryCount; - const VkPipeline *pLibraries; -} VkPipelineLibraryCreateInfoKHR; - -typedef struct VkPipelineMultisampleStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineMultisampleStateCreateFlags flags; - VkSampleCountFlagBits rasterizationSamples; - VkBool32 sampleShadingEnable; - float minSampleShading; - const VkSampleMask *pSampleMask; - VkBool32 alphaToCoverageEnable; - VkBool32 alphaToOneEnable; -} VkPipelineMultisampleStateCreateInfo; - -typedef struct VkPipelinePropertiesIdentifierEXT -{ - VkStructureType sType; - void *pNext; - uint8_t pipelineIdentifier[VK_UUID_SIZE]; -} VkPipelinePropertiesIdentifierEXT; - -typedef struct VkPipelineRasterizationConservativeStateCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkPipelineRasterizationConservativeStateCreateFlagsEXT flags; - VkConservativeRasterizationModeEXT conservativeRasterizationMode; - float extraPrimitiveOverestimationSize; -} VkPipelineRasterizationConservativeStateCreateInfoEXT; - -typedef struct VkPipelineRasterizationDepthClipStateCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkPipelineRasterizationDepthClipStateCreateFlagsEXT flags; - VkBool32 depthClipEnable; -} VkPipelineRasterizationDepthClipStateCreateInfoEXT; - -typedef struct VkPipelineRasterizationLineStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkLineRasterizationMode lineRasterizationMode; - VkBool32 stippledLineEnable; - uint32_t lineStippleFactor; - uint16_t lineStipplePattern; -} VkPipelineRasterizationLineStateCreateInfo; -typedef VkPipelineRasterizationLineStateCreateInfo VkPipelineRasterizationLineStateCreateInfoKHR; -typedef VkPipelineRasterizationLineStateCreateInfo VkPipelineRasterizationLineStateCreateInfoEXT; - -typedef struct VkPipelineRasterizationProvokingVertexStateCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkProvokingVertexModeEXT provokingVertexMode; -} VkPipelineRasterizationProvokingVertexStateCreateInfoEXT; - -typedef struct VkPipelineRasterizationStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineRasterizationStateCreateFlags flags; - VkBool32 depthClampEnable; - VkBool32 rasterizerDiscardEnable; - VkPolygonMode polygonMode; - VkCullModeFlags cullMode; - VkFrontFace frontFace; - VkBool32 depthBiasEnable; - float depthBiasConstantFactor; - float depthBiasClamp; - float depthBiasSlopeFactor; - float lineWidth; -} VkPipelineRasterizationStateCreateInfo; - -typedef struct VkPipelineRasterizationStateRasterizationOrderAMD -{ - VkStructureType sType; - const void *pNext; - VkRasterizationOrderAMD rasterizationOrder; -} VkPipelineRasterizationStateRasterizationOrderAMD; - -typedef struct VkPipelineRasterizationStateStreamCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkPipelineRasterizationStateStreamCreateFlagsEXT flags; - uint32_t rasterizationStream; -} VkPipelineRasterizationStateStreamCreateInfoEXT; - -typedef struct VkPipelineRenderingCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t viewMask; - uint32_t colorAttachmentCount; - const VkFormat *pColorAttachmentFormats; - VkFormat depthAttachmentFormat; - VkFormat stencilAttachmentFormat; -} VkPipelineRenderingCreateInfo; -typedef VkPipelineRenderingCreateInfo VkPipelineRenderingCreateInfoKHR; - -typedef struct VkPipelineRepresentativeFragmentTestStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkBool32 representativeFragmentTestEnable; -} VkPipelineRepresentativeFragmentTestStateCreateInfoNV; - -typedef struct VkPipelineRobustnessCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineRobustnessBufferBehavior storageBuffers; - VkPipelineRobustnessBufferBehavior uniformBuffers; - VkPipelineRobustnessBufferBehavior vertexInputs; - VkPipelineRobustnessImageBehavior images; -} VkPipelineRobustnessCreateInfo; -typedef VkPipelineRobustnessCreateInfo VkPipelineRobustnessCreateInfoEXT; - -typedef struct VkPipelineShaderStageModuleIdentifierCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t identifierSize; - const uint8_t *pIdentifier; -} VkPipelineShaderStageModuleIdentifierCreateInfoEXT; - -typedef struct VkPipelineShaderStageRequiredSubgroupSizeCreateInfo -{ - VkStructureType sType; - void *pNext; - uint32_t requiredSubgroupSize; -} VkPipelineShaderStageRequiredSubgroupSizeCreateInfo; -typedef VkPipelineShaderStageRequiredSubgroupSizeCreateInfo VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT; -typedef VkPipelineShaderStageRequiredSubgroupSizeCreateInfo VkShaderRequiredSubgroupSizeCreateInfoEXT; - -typedef struct VkPipelineTessellationDomainOriginStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkTessellationDomainOrigin domainOrigin; -} VkPipelineTessellationDomainOriginStateCreateInfo; -typedef VkPipelineTessellationDomainOriginStateCreateInfo VkPipelineTessellationDomainOriginStateCreateInfoKHR; - -typedef struct VkPipelineTessellationStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineTessellationStateCreateFlags flags; - uint32_t patchControlPoints; -} VkPipelineTessellationStateCreateInfo; - -typedef struct VkPipelineViewportCoarseSampleOrderStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkCoarseSampleOrderTypeNV sampleOrderType; - uint32_t customSampleOrderCount; - const VkCoarseSampleOrderCustomNV *pCustomSampleOrders; -} VkPipelineViewportCoarseSampleOrderStateCreateInfoNV; - -typedef struct VkPipelineViewportDepthClampControlCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDepthClampModeEXT depthClampMode; - const VkDepthClampRangeEXT *pDepthClampRange; -} VkPipelineViewportDepthClampControlCreateInfoEXT; - -typedef struct VkPipelineViewportDepthClipControlCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkBool32 negativeOneToOne; -} VkPipelineViewportDepthClipControlCreateInfoEXT; - -typedef struct VkPresentIdKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t swapchainCount; - const uint64_t *pPresentIds; -} VkPresentIdKHR; - -typedef struct VkPresentInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t waitSemaphoreCount; - const VkSemaphore *pWaitSemaphores; - uint32_t swapchainCount; - const VkSwapchainKHR *pSwapchains; - const uint32_t *pImageIndices; - VkResult *pResults; -} VkPresentInfoKHR; - -typedef struct VkPrivateDataSlotCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPrivateDataSlotCreateFlags flags; -} VkPrivateDataSlotCreateInfo; -typedef VkPrivateDataSlotCreateInfo VkPrivateDataSlotCreateInfoEXT; - -typedef struct VkProtectedSubmitInfo -{ - VkStructureType sType; - const void *pNext; - VkBool32 protectedSubmit; -} VkProtectedSubmitInfo; - -typedef struct VkPushConstantRange -{ - VkShaderStageFlags stageFlags; - uint32_t offset; - uint32_t size; -} VkPushConstantRange; - -typedef struct VkPushConstantsInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineLayout WINE_VK_ALIGN(8) layout; - VkShaderStageFlags stageFlags; - uint32_t offset; - uint32_t size; - const void *pValues; -} VkPushConstantsInfo; -typedef VkPushConstantsInfo VkPushConstantsInfoKHR; - -typedef struct VkPushDescriptorSetWithTemplateInfo -{ - VkStructureType sType; - const void *pNext; - VkDescriptorUpdateTemplate WINE_VK_ALIGN(8) descriptorUpdateTemplate; - VkPipelineLayout WINE_VK_ALIGN(8) layout; - uint32_t set; - const void *pData; -} VkPushDescriptorSetWithTemplateInfo; -typedef VkPushDescriptorSetWithTemplateInfo VkPushDescriptorSetWithTemplateInfoKHR; - -typedef struct VkQueryLowLatencySupportNV -{ - VkStructureType sType; - const void *pNext; - void *pQueriedLowLatencyData; -} VkQueryLowLatencySupportNV; - -typedef struct VkQueryPoolCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkQueryPoolCreateFlags flags; - VkQueryType queryType; - uint32_t queryCount; - VkQueryPipelineStatisticFlags pipelineStatistics; -} VkQueryPoolCreateInfo; - -typedef struct VkQueryPoolPerformanceCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t queueFamilyIndex; - uint32_t counterIndexCount; - const uint32_t *pCounterIndices; -} VkQueryPoolPerformanceCreateInfoKHR; - -typedef struct VkQueryPoolPerformanceQueryCreateInfoINTEL -{ - VkStructureType sType; - const void *pNext; - VkQueryPoolSamplingModeINTEL performanceCountersSampling; -} VkQueryPoolPerformanceQueryCreateInfoINTEL; -typedef VkQueryPoolPerformanceQueryCreateInfoINTEL VkQueryPoolCreateInfoINTEL; - -typedef struct VkQueryPoolVideoEncodeFeedbackCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkVideoEncodeFeedbackFlagsKHR encodeFeedbackFlags; -} VkQueryPoolVideoEncodeFeedbackCreateInfoKHR; - -typedef struct VkQueueFamilyCheckpointProperties2NV -{ - VkStructureType sType; - void *pNext; - VkPipelineStageFlags2 WINE_VK_ALIGN(8) checkpointExecutionStageMask; -} VkQueueFamilyCheckpointProperties2NV; - -typedef struct VkQueueFamilyCheckpointPropertiesNV -{ - VkStructureType sType; - void *pNext; - VkPipelineStageFlags checkpointExecutionStageMask; -} VkQueueFamilyCheckpointPropertiesNV; - -typedef struct VkQueueFamilyGlobalPriorityProperties -{ - VkStructureType sType; - void *pNext; - uint32_t priorityCount; - VkQueueGlobalPriority priorities[VK_MAX_GLOBAL_PRIORITY_SIZE]; -} VkQueueFamilyGlobalPriorityProperties; -typedef VkQueueFamilyGlobalPriorityProperties VkQueueFamilyGlobalPriorityPropertiesKHR; -typedef VkQueueFamilyGlobalPriorityProperties VkQueueFamilyGlobalPriorityPropertiesEXT; - -typedef struct VkQueueFamilyProperties -{ - VkQueueFlags queueFlags; - uint32_t queueCount; - uint32_t timestampValidBits; - VkExtent3D minImageTransferGranularity; -} VkQueueFamilyProperties; - -typedef struct VkQueueFamilyProperties2 -{ - VkStructureType sType; - void *pNext; - VkQueueFamilyProperties queueFamilyProperties; -} VkQueueFamilyProperties2; -typedef VkQueueFamilyProperties2 VkQueueFamilyProperties2KHR; - -typedef struct VkQueueFamilyQueryResultStatusPropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 queryResultStatusSupport; -} VkQueueFamilyQueryResultStatusPropertiesKHR; - -typedef struct VkQueueFamilyVideoPropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkVideoCodecOperationFlagsKHR videoCodecOperations; -} VkQueueFamilyVideoPropertiesKHR; - -typedef struct VkRayTracingPipelineInterfaceCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t maxPipelineRayPayloadSize; - uint32_t maxPipelineRayHitAttributeSize; -} VkRayTracingPipelineInterfaceCreateInfoKHR; - -typedef struct VkRayTracingShaderGroupCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkRayTracingShaderGroupTypeKHR type; - uint32_t generalShader; - uint32_t closestHitShader; - uint32_t anyHitShader; - uint32_t intersectionShader; - const void *pShaderGroupCaptureReplayHandle; -} VkRayTracingShaderGroupCreateInfoKHR; - -typedef struct VkRayTracingShaderGroupCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkRayTracingShaderGroupTypeKHR type; - uint32_t generalShader; - uint32_t closestHitShader; - uint32_t anyHitShader; - uint32_t intersectionShader; -} VkRayTracingShaderGroupCreateInfoNV; - -typedef struct VkRect2D -{ - VkOffset2D offset; - VkExtent2D extent; -} VkRect2D; - -typedef struct VkRectLayerKHR -{ - VkOffset2D offset; - VkExtent2D extent; - uint32_t layer; -} VkRectLayerKHR; - -typedef struct VkReleaseCapturedPipelineDataInfoKHR -{ - VkStructureType sType; - void *pNext; - VkPipeline WINE_VK_ALIGN(8) pipeline; -} VkReleaseCapturedPipelineDataInfoKHR; - -typedef struct VkReleaseSwapchainImagesInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkSwapchainKHR WINE_VK_ALIGN(8) swapchain; - uint32_t imageIndexCount; - const uint32_t *pImageIndices; -} VkReleaseSwapchainImagesInfoEXT; - -typedef struct VkRenderPassAttachmentBeginInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t attachmentCount; - const VkImageView *pAttachments; -} VkRenderPassAttachmentBeginInfo; -typedef VkRenderPassAttachmentBeginInfo VkRenderPassAttachmentBeginInfoKHR; - -typedef struct VkRenderPassBeginInfo -{ - VkStructureType sType; - const void *pNext; - VkRenderPass WINE_VK_ALIGN(8) renderPass; - VkFramebuffer WINE_VK_ALIGN(8) framebuffer; - VkRect2D renderArea; - uint32_t clearValueCount; - const VkClearValue *pClearValues; -} VkRenderPassBeginInfo; - -typedef struct VkRenderPassCreationControlEXT -{ - VkStructureType sType; - const void *pNext; - VkBool32 disallowMerging; -} VkRenderPassCreationControlEXT; - -typedef struct VkRenderPassCreationFeedbackInfoEXT -{ - uint32_t postMergeSubpassCount; -} VkRenderPassCreationFeedbackInfoEXT; - -typedef struct VkRenderPassFragmentDensityMapCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkAttachmentReference fragmentDensityMapAttachment; -} VkRenderPassFragmentDensityMapCreateInfoEXT; - -typedef struct VkRenderPassInputAttachmentAspectCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t aspectReferenceCount; - const VkInputAttachmentAspectReference *pAspectReferences; -} VkRenderPassInputAttachmentAspectCreateInfo; -typedef VkRenderPassInputAttachmentAspectCreateInfo VkRenderPassInputAttachmentAspectCreateInfoKHR; - -typedef struct VkRenderPassMultiviewCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t subpassCount; - const uint32_t *pViewMasks; - uint32_t dependencyCount; - const int32_t *pViewOffsets; - uint32_t correlationMaskCount; - const uint32_t *pCorrelationMasks; -} VkRenderPassMultiviewCreateInfo; -typedef VkRenderPassMultiviewCreateInfo VkRenderPassMultiviewCreateInfoKHR; - -typedef struct VkRenderPassStripeInfoARM -{ - VkStructureType sType; - const void *pNext; - VkRect2D stripeArea; -} VkRenderPassStripeInfoARM; - -typedef struct VkRenderPassSubpassFeedbackInfoEXT -{ - VkSubpassMergeStatusEXT subpassMergeStatus; - char description[VK_MAX_DESCRIPTION_SIZE]; - uint32_t postMergeIndex; -} VkRenderPassSubpassFeedbackInfoEXT; - -typedef struct VkRenderPassTransformBeginInfoQCOM -{ - VkStructureType sType; - void *pNext; - VkSurfaceTransformFlagBitsKHR transform; -} VkRenderPassTransformBeginInfoQCOM; - -typedef struct VkRenderingAreaInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t viewMask; - uint32_t colorAttachmentCount; - const VkFormat *pColorAttachmentFormats; - VkFormat depthAttachmentFormat; - VkFormat stencilAttachmentFormat; -} VkRenderingAreaInfo; -typedef VkRenderingAreaInfo VkRenderingAreaInfoKHR; - -typedef struct VkRenderingAttachmentInfo -{ - VkStructureType sType; - const void *pNext; - VkImageView WINE_VK_ALIGN(8) imageView; - VkImageLayout imageLayout; - VkResolveModeFlagBits resolveMode; - VkImageView WINE_VK_ALIGN(8) resolveImageView; - VkImageLayout resolveImageLayout; - VkAttachmentLoadOp loadOp; - VkAttachmentStoreOp storeOp; - VkClearValue clearValue; -} VkRenderingAttachmentInfo; -typedef VkRenderingAttachmentInfo VkRenderingAttachmentInfoKHR; - -typedef struct VkRenderingAttachmentLocationInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t colorAttachmentCount; - const uint32_t *pColorAttachmentLocations; -} VkRenderingAttachmentLocationInfo; -typedef VkRenderingAttachmentLocationInfo VkRenderingAttachmentLocationInfoKHR; - -typedef struct VkRenderingFragmentDensityMapAttachmentInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkImageView WINE_VK_ALIGN(8) imageView; - VkImageLayout imageLayout; -} VkRenderingFragmentDensityMapAttachmentInfoEXT; - -typedef struct VkRenderingFragmentShadingRateAttachmentInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkImageView WINE_VK_ALIGN(8) imageView; - VkImageLayout imageLayout; - VkExtent2D shadingRateAttachmentTexelSize; -} VkRenderingFragmentShadingRateAttachmentInfoKHR; - -typedef struct VkRenderingInfo -{ - VkStructureType sType; - const void *pNext; - VkRenderingFlags flags; - VkRect2D renderArea; - uint32_t layerCount; - uint32_t viewMask; - uint32_t colorAttachmentCount; - const VkRenderingAttachmentInfo *pColorAttachments; - const VkRenderingAttachmentInfo *pDepthAttachment; - const VkRenderingAttachmentInfo *pStencilAttachment; -} VkRenderingInfo; -typedef VkRenderingInfo VkRenderingInfoKHR; - -typedef struct VkRenderingInputAttachmentIndexInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t colorAttachmentCount; - const uint32_t *pColorAttachmentInputIndices; - const uint32_t *pDepthInputAttachmentIndex; - const uint32_t *pStencilInputAttachmentIndex; -} VkRenderingInputAttachmentIndexInfo; -typedef VkRenderingInputAttachmentIndexInfo VkRenderingInputAttachmentIndexInfoKHR; - -typedef struct VkSRTDataNV -{ - float sx; - float a; - float b; - float pvx; - float sy; - float c; - float pvy; - float sz; - float pvz; - float qx; - float qy; - float qz; - float qw; - float tx; - float ty; - float tz; -} VkSRTDataNV; - -typedef struct VkSampleLocationEXT -{ - float x; - float y; -} VkSampleLocationEXT; - -typedef struct VkSampleLocationsInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkSampleCountFlagBits sampleLocationsPerPixel; - VkExtent2D sampleLocationGridSize; - uint32_t sampleLocationsCount; - const VkSampleLocationEXT *pSampleLocations; -} VkSampleLocationsInfoEXT; - -typedef struct VkSamplerBlockMatchWindowCreateInfoQCOM -{ - VkStructureType sType; - const void *pNext; - VkExtent2D windowExtent; - VkBlockMatchWindowCompareModeQCOM windowCompareMode; -} VkSamplerBlockMatchWindowCreateInfoQCOM; - -typedef struct VkSamplerBorderColorComponentMappingCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkComponentMapping components; - VkBool32 srgb; -} VkSamplerBorderColorComponentMappingCreateInfoEXT; - -typedef struct VkSamplerCaptureDescriptorDataInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkSampler WINE_VK_ALIGN(8) sampler; -} VkSamplerCaptureDescriptorDataInfoEXT; - -typedef struct VkSamplerCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkSamplerCreateFlags flags; - VkFilter magFilter; - VkFilter minFilter; - VkSamplerMipmapMode mipmapMode; - VkSamplerAddressMode addressModeU; - VkSamplerAddressMode addressModeV; - VkSamplerAddressMode addressModeW; - float mipLodBias; - VkBool32 anisotropyEnable; - float maxAnisotropy; - VkBool32 compareEnable; - VkCompareOp compareOp; - float minLod; - float maxLod; - VkBorderColor borderColor; - VkBool32 unnormalizedCoordinates; -} VkSamplerCreateInfo; - -typedef struct VkSamplerCubicWeightsCreateInfoQCOM -{ - VkStructureType sType; - const void *pNext; - VkCubicFilterWeightsQCOM cubicWeights; -} VkSamplerCubicWeightsCreateInfoQCOM; - -typedef struct VkSamplerCustomBorderColorCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkClearColorValue customBorderColor; - VkFormat format; -} VkSamplerCustomBorderColorCreateInfoEXT; - -typedef struct VkSamplerReductionModeCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkSamplerReductionMode reductionMode; -} VkSamplerReductionModeCreateInfo; -typedef VkSamplerReductionModeCreateInfo VkSamplerReductionModeCreateInfoEXT; - -typedef struct VkSamplerYcbcrConversionCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkFormat format; - VkSamplerYcbcrModelConversion ycbcrModel; - VkSamplerYcbcrRange ycbcrRange; - VkComponentMapping components; - VkChromaLocation xChromaOffset; - VkChromaLocation yChromaOffset; - VkFilter chromaFilter; - VkBool32 forceExplicitReconstruction; -} VkSamplerYcbcrConversionCreateInfo; -typedef VkSamplerYcbcrConversionCreateInfo VkSamplerYcbcrConversionCreateInfoKHR; - -typedef struct VkSamplerYcbcrConversionImageFormatProperties -{ - VkStructureType sType; - void *pNext; - uint32_t combinedImageSamplerDescriptorCount; -} VkSamplerYcbcrConversionImageFormatProperties; -typedef VkSamplerYcbcrConversionImageFormatProperties VkSamplerYcbcrConversionImageFormatPropertiesKHR; - -typedef struct VkSamplerYcbcrConversionInfo -{ - VkStructureType sType; - const void *pNext; - VkSamplerYcbcrConversion WINE_VK_ALIGN(8) conversion; -} VkSamplerYcbcrConversionInfo; -typedef VkSamplerYcbcrConversionInfo VkSamplerYcbcrConversionInfoKHR; - -typedef struct VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM -{ - VkStructureType sType; - void *pNext; - VkBool32 enableYDegamma; - VkBool32 enableCbCrDegamma; -} VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM; - -typedef struct VkSemaphoreCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkSemaphoreCreateFlags flags; -} VkSemaphoreCreateInfo; - -typedef struct VkSemaphoreSignalInfo -{ - VkStructureType sType; - const void *pNext; - VkSemaphore WINE_VK_ALIGN(8) semaphore; - uint64_t WINE_VK_ALIGN(8) value; -} VkSemaphoreSignalInfo; -typedef VkSemaphoreSignalInfo VkSemaphoreSignalInfoKHR; - -typedef struct VkSemaphoreSubmitInfo -{ - VkStructureType sType; - const void *pNext; - VkSemaphore WINE_VK_ALIGN(8) semaphore; - uint64_t WINE_VK_ALIGN(8) value; - VkPipelineStageFlags2 WINE_VK_ALIGN(8) stageMask; - uint32_t deviceIndex; -} VkSemaphoreSubmitInfo; -typedef VkSemaphoreSubmitInfo VkSemaphoreSubmitInfoKHR; - -typedef struct VkSemaphoreTypeCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkSemaphoreType semaphoreType; - uint64_t WINE_VK_ALIGN(8) initialValue; -} VkSemaphoreTypeCreateInfo; -typedef VkSemaphoreTypeCreateInfo VkSemaphoreTypeCreateInfoKHR; - -typedef struct VkSemaphoreWaitInfo -{ - VkStructureType sType; - const void *pNext; - VkSemaphoreWaitFlags flags; - uint32_t semaphoreCount; - const VkSemaphore *pSemaphores; - const uint64_t *pValues; -} VkSemaphoreWaitInfo; -typedef VkSemaphoreWaitInfo VkSemaphoreWaitInfoKHR; - -typedef struct VkSetDescriptorBufferOffsetsInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkShaderStageFlags stageFlags; - VkPipelineLayout WINE_VK_ALIGN(8) layout; - uint32_t firstSet; - uint32_t setCount; - const uint32_t *pBufferIndices; - const VkDeviceSize *pOffsets; -} VkSetDescriptorBufferOffsetsInfoEXT; - -typedef struct VkSetLatencyMarkerInfoNV -{ - VkStructureType sType; - const void *pNext; - uint64_t WINE_VK_ALIGN(8) presentID; - VkLatencyMarkerNV marker; -} VkSetLatencyMarkerInfoNV; - -typedef struct VkSetStateFlagsIndirectCommandNV -{ - uint32_t data; -} VkSetStateFlagsIndirectCommandNV; - -typedef struct VkShaderModuleCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkShaderModuleCreateFlags flags; - size_t codeSize; - const uint32_t *pCode; -} VkShaderModuleCreateInfo; - -typedef struct VkShaderModuleIdentifierEXT -{ - VkStructureType sType; - void *pNext; - uint32_t identifierSize; - uint8_t identifier[VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT]; -} VkShaderModuleIdentifierEXT; - -typedef struct VkShaderModuleValidationCacheCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkValidationCacheEXT WINE_VK_ALIGN(8) validationCache; -} VkShaderModuleValidationCacheCreateInfoEXT; - -typedef struct VkShaderResourceUsageAMD -{ - uint32_t numUsedVgprs; - uint32_t numUsedSgprs; - uint32_t ldsSizePerLocalWorkGroup; - size_t ldsUsageSizeInBytes; - size_t scratchMemUsageInBytes; -} VkShaderResourceUsageAMD; - -typedef struct VkShaderStatisticsInfoAMD -{ - VkShaderStageFlags shaderStageMask; - VkShaderResourceUsageAMD resourceUsage; - uint32_t numPhysicalVgprs; - uint32_t numPhysicalSgprs; - uint32_t numAvailableVgprs; - uint32_t numAvailableSgprs; - uint32_t computeWorkGroupSize[3]; -} VkShaderStatisticsInfoAMD; - -typedef struct VkShadingRatePaletteNV -{ - uint32_t shadingRatePaletteEntryCount; - const VkShadingRatePaletteEntryNV *pShadingRatePaletteEntries; -} VkShadingRatePaletteNV; - -typedef struct VkSparseImageFormatProperties -{ - VkImageAspectFlags aspectMask; - VkExtent3D imageGranularity; - VkSparseImageFormatFlags flags; -} VkSparseImageFormatProperties; - -typedef struct VkSparseImageFormatProperties2 -{ - VkStructureType sType; - void *pNext; - VkSparseImageFormatProperties properties; -} VkSparseImageFormatProperties2; -typedef VkSparseImageFormatProperties2 VkSparseImageFormatProperties2KHR; - -typedef struct VkSparseImageMemoryBind -{ - VkImageSubresource subresource; - VkOffset3D offset; - VkExtent3D extent; - VkDeviceMemory WINE_VK_ALIGN(8) memory; - VkDeviceSize WINE_VK_ALIGN(8) memoryOffset; - VkSparseMemoryBindFlags flags; -} VkSparseImageMemoryBind; - -typedef struct VkSparseImageMemoryBindInfo -{ - VkImage WINE_VK_ALIGN(8) image; - uint32_t bindCount; - const VkSparseImageMemoryBind *pBinds; -} VkSparseImageMemoryBindInfo; - -typedef struct VkSparseImageMemoryRequirements -{ - VkSparseImageFormatProperties formatProperties; - uint32_t imageMipTailFirstLod; - VkDeviceSize WINE_VK_ALIGN(8) imageMipTailSize; - VkDeviceSize WINE_VK_ALIGN(8) imageMipTailOffset; - VkDeviceSize WINE_VK_ALIGN(8) imageMipTailStride; -} VkSparseImageMemoryRequirements; - -typedef struct VkSparseImageMemoryRequirements2 -{ - VkStructureType sType; - void *pNext; - VkSparseImageMemoryRequirements WINE_VK_ALIGN(8) memoryRequirements; -} VkSparseImageMemoryRequirements2; -typedef VkSparseImageMemoryRequirements2 VkSparseImageMemoryRequirements2KHR; - -typedef struct VkSparseMemoryBind -{ - VkDeviceSize WINE_VK_ALIGN(8) resourceOffset; - VkDeviceSize WINE_VK_ALIGN(8) size; - VkDeviceMemory WINE_VK_ALIGN(8) memory; - VkDeviceSize WINE_VK_ALIGN(8) memoryOffset; - VkSparseMemoryBindFlags flags; -} VkSparseMemoryBind; - -typedef struct VkSpecializationMapEntry -{ - uint32_t constantID; - uint32_t offset; - size_t size; -} VkSpecializationMapEntry; - -typedef struct VkStencilOpState -{ - VkStencilOp failOp; - VkStencilOp passOp; - VkStencilOp depthFailOp; - VkCompareOp compareOp; - uint32_t compareMask; - uint32_t writeMask; - uint32_t reference; -} VkStencilOpState; - -typedef struct VkStridedDeviceAddressRegionKHR -{ - VkDeviceAddress WINE_VK_ALIGN(8) deviceAddress; - VkDeviceSize WINE_VK_ALIGN(8) stride; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkStridedDeviceAddressRegionKHR; - -typedef struct VkSubmitInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t waitSemaphoreCount; - const VkSemaphore *pWaitSemaphores; - const VkPipelineStageFlags *pWaitDstStageMask; - uint32_t commandBufferCount; - const VkCommandBuffer *pCommandBuffers; - uint32_t signalSemaphoreCount; - const VkSemaphore *pSignalSemaphores; -} VkSubmitInfo; - -typedef struct VkSubmitInfo2 -{ - VkStructureType sType; - const void *pNext; - VkSubmitFlags flags; - uint32_t waitSemaphoreInfoCount; - const VkSemaphoreSubmitInfo *pWaitSemaphoreInfos; - uint32_t commandBufferInfoCount; - const VkCommandBufferSubmitInfo *pCommandBufferInfos; - uint32_t signalSemaphoreInfoCount; - const VkSemaphoreSubmitInfo *pSignalSemaphoreInfos; -} VkSubmitInfo2; -typedef VkSubmitInfo2 VkSubmitInfo2KHR; - -typedef struct VkSubpassBeginInfo -{ - VkStructureType sType; - const void *pNext; - VkSubpassContents contents; -} VkSubpassBeginInfo; -typedef VkSubpassBeginInfo VkSubpassBeginInfoKHR; - -typedef struct VkSubpassDependency -{ - uint32_t srcSubpass; - uint32_t dstSubpass; - VkPipelineStageFlags srcStageMask; - VkPipelineStageFlags dstStageMask; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - VkDependencyFlags dependencyFlags; -} VkSubpassDependency; - -typedef struct VkSubpassDependency2 -{ - VkStructureType sType; - const void *pNext; - uint32_t srcSubpass; - uint32_t dstSubpass; - VkPipelineStageFlags srcStageMask; - VkPipelineStageFlags dstStageMask; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - VkDependencyFlags dependencyFlags; - int32_t viewOffset; -} VkSubpassDependency2; -typedef VkSubpassDependency2 VkSubpassDependency2KHR; - -typedef struct VkSubpassDescription -{ - VkSubpassDescriptionFlags flags; - VkPipelineBindPoint pipelineBindPoint; - uint32_t inputAttachmentCount; - const VkAttachmentReference *pInputAttachments; - uint32_t colorAttachmentCount; - const VkAttachmentReference *pColorAttachments; - const VkAttachmentReference *pResolveAttachments; - const VkAttachmentReference *pDepthStencilAttachment; - uint32_t preserveAttachmentCount; - const uint32_t *pPreserveAttachments; -} VkSubpassDescription; - -typedef struct VkSubpassDescription2 -{ - VkStructureType sType; - const void *pNext; - VkSubpassDescriptionFlags flags; - VkPipelineBindPoint pipelineBindPoint; - uint32_t viewMask; - uint32_t inputAttachmentCount; - const VkAttachmentReference2 *pInputAttachments; - uint32_t colorAttachmentCount; - const VkAttachmentReference2 *pColorAttachments; - const VkAttachmentReference2 *pResolveAttachments; - const VkAttachmentReference2 *pDepthStencilAttachment; - uint32_t preserveAttachmentCount; - const uint32_t *pPreserveAttachments; -} VkSubpassDescription2; -typedef VkSubpassDescription2 VkSubpassDescription2KHR; - -typedef struct VkSubpassDescriptionDepthStencilResolve -{ - VkStructureType sType; - const void *pNext; - VkResolveModeFlagBits depthResolveMode; - VkResolveModeFlagBits stencilResolveMode; - const VkAttachmentReference2 *pDepthStencilResolveAttachment; -} VkSubpassDescriptionDepthStencilResolve; -typedef VkSubpassDescriptionDepthStencilResolve VkSubpassDescriptionDepthStencilResolveKHR; - -typedef struct VkSubpassEndInfo -{ - VkStructureType sType; - const void *pNext; -} VkSubpassEndInfo; -typedef VkSubpassEndInfo VkSubpassEndInfoKHR; - -typedef struct VkSubpassFragmentDensityMapOffsetEndInfoQCOM -{ - VkStructureType sType; - const void *pNext; - uint32_t fragmentDensityOffsetCount; - const VkOffset2D *pFragmentDensityOffsets; -} VkSubpassFragmentDensityMapOffsetEndInfoQCOM; - -typedef struct VkSubpassResolvePerformanceQueryEXT -{ - VkStructureType sType; - void *pNext; - VkBool32 optimal; -} VkSubpassResolvePerformanceQueryEXT; - -typedef struct VkSubpassSampleLocationsEXT -{ - uint32_t subpassIndex; - VkSampleLocationsInfoEXT sampleLocationsInfo; -} VkSubpassSampleLocationsEXT; - -typedef struct VkSubpassShadingPipelineCreateInfoHUAWEI -{ - VkStructureType sType; - void *pNext; - VkRenderPass WINE_VK_ALIGN(8) renderPass; - uint32_t subpass; -} VkSubpassShadingPipelineCreateInfoHUAWEI; - -typedef struct VkSubresourceHostMemcpySize -{ - VkStructureType sType; - void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) size; -} VkSubresourceHostMemcpySize; -typedef VkSubresourceHostMemcpySize VkSubresourceHostMemcpySizeEXT; - -typedef struct VkSubresourceLayout -{ - VkDeviceSize WINE_VK_ALIGN(8) offset; - VkDeviceSize WINE_VK_ALIGN(8) size; - VkDeviceSize WINE_VK_ALIGN(8) rowPitch; - VkDeviceSize WINE_VK_ALIGN(8) arrayPitch; - VkDeviceSize WINE_VK_ALIGN(8) depthPitch; -} VkSubresourceLayout; - -typedef struct VkSubresourceLayout2 -{ - VkStructureType sType; - void *pNext; - VkSubresourceLayout WINE_VK_ALIGN(8) subresourceLayout; -} VkSubresourceLayout2; -typedef VkSubresourceLayout2 VkSubresourceLayout2KHR; -typedef VkSubresourceLayout2 VkSubresourceLayout2EXT; - -typedef struct VkSurfaceCapabilitiesKHR -{ - uint32_t minImageCount; - uint32_t maxImageCount; - VkExtent2D currentExtent; - VkExtent2D minImageExtent; - VkExtent2D maxImageExtent; - uint32_t maxImageArrayLayers; - VkSurfaceTransformFlagsKHR supportedTransforms; - VkSurfaceTransformFlagBitsKHR currentTransform; - VkCompositeAlphaFlagsKHR supportedCompositeAlpha; - VkImageUsageFlags supportedUsageFlags; -} VkSurfaceCapabilitiesKHR; - -typedef struct VkSurfaceCapabilitiesPresentBarrierNV -{ - VkStructureType sType; - void *pNext; - VkBool32 presentBarrierSupported; -} VkSurfaceCapabilitiesPresentBarrierNV; - -typedef struct VkSurfaceFormatKHR -{ - VkFormat format; - VkColorSpaceKHR colorSpace; -} VkSurfaceFormatKHR; - -typedef struct VkSurfacePresentModeCompatibilityEXT -{ - VkStructureType sType; - void *pNext; - uint32_t presentModeCount; - VkPresentModeKHR *pPresentModes; -} VkSurfacePresentModeCompatibilityEXT; - -typedef struct VkSurfacePresentModeEXT -{ - VkStructureType sType; - void *pNext; - VkPresentModeKHR presentMode; -} VkSurfacePresentModeEXT; - -typedef struct VkSurfacePresentScalingCapabilitiesEXT -{ - VkStructureType sType; - void *pNext; - VkPresentScalingFlagsEXT supportedPresentScaling; - VkPresentGravityFlagsEXT supportedPresentGravityX; - VkPresentGravityFlagsEXT supportedPresentGravityY; - VkExtent2D minScaledImageExtent; - VkExtent2D maxScaledImageExtent; -} VkSurfacePresentScalingCapabilitiesEXT; - -typedef struct VkSwapchainCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkSwapchainCreateFlagsKHR flags; - VkSurfaceKHR WINE_VK_ALIGN(8) surface; - uint32_t minImageCount; - VkFormat imageFormat; - VkColorSpaceKHR imageColorSpace; - VkExtent2D imageExtent; - uint32_t imageArrayLayers; - VkImageUsageFlags imageUsage; - VkSharingMode imageSharingMode; - uint32_t queueFamilyIndexCount; - const uint32_t *pQueueFamilyIndices; - VkSurfaceTransformFlagBitsKHR preTransform; - VkCompositeAlphaFlagBitsKHR compositeAlpha; - VkPresentModeKHR presentMode; - VkBool32 clipped; - VkSwapchainKHR WINE_VK_ALIGN(8) oldSwapchain; -} VkSwapchainCreateInfoKHR; - -typedef struct VkSwapchainLatencyCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkBool32 latencyModeEnable; -} VkSwapchainLatencyCreateInfoNV; - -typedef struct VkSwapchainPresentBarrierCreateInfoNV -{ - VkStructureType sType; - void *pNext; - VkBool32 presentBarrierEnable; -} VkSwapchainPresentBarrierCreateInfoNV; - -typedef struct VkSwapchainPresentFenceInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t swapchainCount; - const VkFence *pFences; -} VkSwapchainPresentFenceInfoEXT; - -typedef struct VkSwapchainPresentModeInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t swapchainCount; - const VkPresentModeKHR *pPresentModes; -} VkSwapchainPresentModeInfoEXT; - -typedef struct VkSwapchainPresentModesCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t presentModeCount; - const VkPresentModeKHR *pPresentModes; -} VkSwapchainPresentModesCreateInfoEXT; - -typedef struct VkSwapchainPresentScalingCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkPresentScalingFlagsEXT scalingBehavior; - VkPresentGravityFlagsEXT presentGravityX; - VkPresentGravityFlagsEXT presentGravityY; -} VkSwapchainPresentScalingCreateInfoEXT; - -typedef struct VkTextureLODGatherFormatPropertiesAMD -{ - VkStructureType sType; - void *pNext; - VkBool32 supportsTextureGatherLODBiasAMD; -} VkTextureLODGatherFormatPropertiesAMD; - -typedef struct VkTilePropertiesQCOM -{ - VkStructureType sType; - void *pNext; - VkExtent3D tileSize; - VkExtent2D apronSize; - VkOffset2D origin; -} VkTilePropertiesQCOM; - -typedef struct VkTimelineSemaphoreSubmitInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t waitSemaphoreValueCount; - const uint64_t *pWaitSemaphoreValues; - uint32_t signalSemaphoreValueCount; - const uint64_t *pSignalSemaphoreValues; -} VkTimelineSemaphoreSubmitInfo; -typedef VkTimelineSemaphoreSubmitInfo VkTimelineSemaphoreSubmitInfoKHR; - -typedef struct VkTraceRaysIndirectCommand2KHR -{ - VkDeviceAddress WINE_VK_ALIGN(8) raygenShaderRecordAddress; - VkDeviceSize WINE_VK_ALIGN(8) raygenShaderRecordSize; - VkDeviceAddress WINE_VK_ALIGN(8) missShaderBindingTableAddress; - VkDeviceSize WINE_VK_ALIGN(8) missShaderBindingTableSize; - VkDeviceSize WINE_VK_ALIGN(8) missShaderBindingTableStride; - VkDeviceAddress WINE_VK_ALIGN(8) hitShaderBindingTableAddress; - VkDeviceSize WINE_VK_ALIGN(8) hitShaderBindingTableSize; - VkDeviceSize WINE_VK_ALIGN(8) hitShaderBindingTableStride; - VkDeviceAddress WINE_VK_ALIGN(8) callableShaderBindingTableAddress; - VkDeviceSize WINE_VK_ALIGN(8) callableShaderBindingTableSize; - VkDeviceSize WINE_VK_ALIGN(8) callableShaderBindingTableStride; - uint32_t width; - uint32_t height; - uint32_t depth; -} VkTraceRaysIndirectCommand2KHR; - -typedef struct VkTraceRaysIndirectCommandKHR -{ - uint32_t width; - uint32_t height; - uint32_t depth; -} VkTraceRaysIndirectCommandKHR; - -typedef struct VkTransformMatrixKHR -{ - float matrix[3][4]; -} VkTransformMatrixKHR; -typedef VkTransformMatrixKHR VkTransformMatrixNV; - -typedef struct VkValidationCacheCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkValidationCacheCreateFlagsEXT flags; - size_t initialDataSize; - const void *pInitialData; -} VkValidationCacheCreateInfoEXT; - -typedef struct VkValidationFeaturesEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t enabledValidationFeatureCount; - const VkValidationFeatureEnableEXT *pEnabledValidationFeatures; - uint32_t disabledValidationFeatureCount; - const VkValidationFeatureDisableEXT *pDisabledValidationFeatures; -} VkValidationFeaturesEXT; - -typedef struct VkValidationFlagsEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t disabledValidationCheckCount; - const VkValidationCheckEXT *pDisabledValidationChecks; -} VkValidationFlagsEXT; - -typedef struct VkVertexInputAttributeDescription -{ - uint32_t location; - uint32_t binding; - VkFormat format; - uint32_t offset; -} VkVertexInputAttributeDescription; - -typedef struct VkVertexInputAttributeDescription2EXT -{ - VkStructureType sType; - void *pNext; - uint32_t location; - uint32_t binding; - VkFormat format; - uint32_t offset; -} VkVertexInputAttributeDescription2EXT; - -typedef struct VkVertexInputBindingDescription -{ - uint32_t binding; - uint32_t stride; - VkVertexInputRate inputRate; -} VkVertexInputBindingDescription; - -typedef struct VkVertexInputBindingDescription2EXT -{ - VkStructureType sType; - void *pNext; - uint32_t binding; - uint32_t stride; - VkVertexInputRate inputRate; - uint32_t divisor; -} VkVertexInputBindingDescription2EXT; - -typedef struct VkVertexInputBindingDivisorDescription -{ - uint32_t binding; - uint32_t divisor; -} VkVertexInputBindingDivisorDescription; -typedef VkVertexInputBindingDivisorDescription VkVertexInputBindingDivisorDescriptionKHR; -typedef VkVertexInputBindingDivisorDescription VkVertexInputBindingDivisorDescriptionEXT; - -typedef struct VkVideoCapabilitiesKHR -{ - VkStructureType sType; - void *pNext; - VkVideoCapabilityFlagsKHR flags; - VkDeviceSize WINE_VK_ALIGN(8) minBitstreamBufferOffsetAlignment; - VkDeviceSize WINE_VK_ALIGN(8) minBitstreamBufferSizeAlignment; - VkExtent2D pictureAccessGranularity; - VkExtent2D minCodedExtent; - VkExtent2D maxCodedExtent; - uint32_t maxDpbSlots; - uint32_t maxActiveReferencePictures; - VkExtensionProperties stdHeaderVersion; -} VkVideoCapabilitiesKHR; - -typedef struct VkVideoCodingControlInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkVideoCodingControlFlagsKHR flags; -} VkVideoCodingControlInfoKHR; - -typedef struct VkVideoDecodeAV1CapabilitiesKHR -{ - VkStructureType sType; - void *pNext; - StdVideoAV1Level maxLevel; -} VkVideoDecodeAV1CapabilitiesKHR; - -typedef struct VkVideoDecodeAV1ProfileInfoKHR -{ - VkStructureType sType; - const void *pNext; - StdVideoAV1Profile stdProfile; - VkBool32 filmGrainSupport; -} VkVideoDecodeAV1ProfileInfoKHR; - -typedef struct VkVideoDecodeCapabilitiesKHR -{ - VkStructureType sType; - void *pNext; - VkVideoDecodeCapabilityFlagsKHR flags; -} VkVideoDecodeCapabilitiesKHR; - -typedef struct VkVideoDecodeH264CapabilitiesKHR -{ - VkStructureType sType; - void *pNext; - StdVideoH264LevelIdc maxLevelIdc; - VkOffset2D fieldOffsetGranularity; -} VkVideoDecodeH264CapabilitiesKHR; - -typedef struct VkVideoDecodeH264ProfileInfoKHR -{ - VkStructureType sType; - const void *pNext; - StdVideoH264ProfileIdc stdProfileIdc; - VkVideoDecodeH264PictureLayoutFlagBitsKHR pictureLayout; -} VkVideoDecodeH264ProfileInfoKHR; - -typedef struct VkVideoDecodeH265CapabilitiesKHR -{ - VkStructureType sType; - void *pNext; - StdVideoH265LevelIdc maxLevelIdc; -} VkVideoDecodeH265CapabilitiesKHR; - -typedef struct VkVideoDecodeH265ProfileInfoKHR -{ - VkStructureType sType; - const void *pNext; - StdVideoH265ProfileIdc stdProfileIdc; -} VkVideoDecodeH265ProfileInfoKHR; - -typedef struct VkVideoDecodeUsageInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkVideoDecodeUsageFlagsKHR videoUsageHints; -} VkVideoDecodeUsageInfoKHR; - -typedef struct VkVideoEncodeAV1CapabilitiesKHR -{ - VkStructureType sType; - void *pNext; - VkVideoEncodeAV1CapabilityFlagsKHR flags; - StdVideoAV1Level maxLevel; - VkExtent2D codedPictureAlignment; - VkExtent2D maxTiles; - VkExtent2D minTileSize; - VkExtent2D maxTileSize; - VkVideoEncodeAV1SuperblockSizeFlagsKHR superblockSizes; - uint32_t maxSingleReferenceCount; - uint32_t singleReferenceNameMask; - uint32_t maxUnidirectionalCompoundReferenceCount; - uint32_t maxUnidirectionalCompoundGroup1ReferenceCount; - uint32_t unidirectionalCompoundReferenceNameMask; - uint32_t maxBidirectionalCompoundReferenceCount; - uint32_t maxBidirectionalCompoundGroup1ReferenceCount; - uint32_t maxBidirectionalCompoundGroup2ReferenceCount; - uint32_t bidirectionalCompoundReferenceNameMask; - uint32_t maxTemporalLayerCount; - uint32_t maxSpatialLayerCount; - uint32_t maxOperatingPoints; - uint32_t minQIndex; - uint32_t maxQIndex; - VkBool32 prefersGopRemainingFrames; - VkBool32 requiresGopRemainingFrames; - VkVideoEncodeAV1StdFlagsKHR stdSyntaxFlags; -} VkVideoEncodeAV1CapabilitiesKHR; - -typedef struct VkVideoEncodeAV1FrameSizeKHR -{ - uint32_t intraFrameSize; - uint32_t predictiveFrameSize; - uint32_t bipredictiveFrameSize; -} VkVideoEncodeAV1FrameSizeKHR; - -typedef struct VkVideoEncodeAV1GopRemainingFrameInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkBool32 useGopRemainingFrames; - uint32_t gopRemainingIntra; - uint32_t gopRemainingPredictive; - uint32_t gopRemainingBipredictive; -} VkVideoEncodeAV1GopRemainingFrameInfoKHR; - -typedef struct VkVideoEncodeAV1ProfileInfoKHR -{ - VkStructureType sType; - const void *pNext; - StdVideoAV1Profile stdProfile; -} VkVideoEncodeAV1ProfileInfoKHR; - -typedef struct VkVideoEncodeAV1QIndexKHR -{ - uint32_t intraQIndex; - uint32_t predictiveQIndex; - uint32_t bipredictiveQIndex; -} VkVideoEncodeAV1QIndexKHR; - -typedef struct VkVideoEncodeAV1QualityLevelPropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkVideoEncodeAV1RateControlFlagsKHR preferredRateControlFlags; - uint32_t preferredGopFrameCount; - uint32_t preferredKeyFramePeriod; - uint32_t preferredConsecutiveBipredictiveFrameCount; - uint32_t preferredTemporalLayerCount; - VkVideoEncodeAV1QIndexKHR preferredConstantQIndex; - uint32_t preferredMaxSingleReferenceCount; - uint32_t preferredSingleReferenceNameMask; - uint32_t preferredMaxUnidirectionalCompoundReferenceCount; - uint32_t preferredMaxUnidirectionalCompoundGroup1ReferenceCount; - uint32_t preferredUnidirectionalCompoundReferenceNameMask; - uint32_t preferredMaxBidirectionalCompoundReferenceCount; - uint32_t preferredMaxBidirectionalCompoundGroup1ReferenceCount; - uint32_t preferredMaxBidirectionalCompoundGroup2ReferenceCount; - uint32_t preferredBidirectionalCompoundReferenceNameMask; -} VkVideoEncodeAV1QualityLevelPropertiesKHR; - -typedef struct VkVideoEncodeAV1QuantizationMapCapabilitiesKHR -{ - VkStructureType sType; - void *pNext; - int32_t minQIndexDelta; - int32_t maxQIndexDelta; -} VkVideoEncodeAV1QuantizationMapCapabilitiesKHR; - -typedef struct VkVideoEncodeAV1RateControlInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkVideoEncodeAV1RateControlFlagsKHR flags; - uint32_t gopFrameCount; - uint32_t keyFramePeriod; - uint32_t consecutiveBipredictiveFrameCount; - uint32_t temporalLayerCount; -} VkVideoEncodeAV1RateControlInfoKHR; - -typedef struct VkVideoEncodeAV1RateControlLayerInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkBool32 useMinQIndex; - VkVideoEncodeAV1QIndexKHR minQIndex; - VkBool32 useMaxQIndex; - VkVideoEncodeAV1QIndexKHR maxQIndex; - VkBool32 useMaxFrameSize; - VkVideoEncodeAV1FrameSizeKHR maxFrameSize; -} VkVideoEncodeAV1RateControlLayerInfoKHR; - -typedef struct VkVideoEncodeAV1SessionCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkBool32 useMaxLevel; - StdVideoAV1Level maxLevel; -} VkVideoEncodeAV1SessionCreateInfoKHR; - -typedef struct VkVideoEncodeCapabilitiesKHR -{ - VkStructureType sType; - void *pNext; - VkVideoEncodeCapabilityFlagsKHR flags; - VkVideoEncodeRateControlModeFlagsKHR rateControlModes; - uint32_t maxRateControlLayers; - uint64_t WINE_VK_ALIGN(8) maxBitrate; - uint32_t maxQualityLevels; - VkExtent2D encodeInputPictureGranularity; - VkVideoEncodeFeedbackFlagsKHR supportedEncodeFeedbackFlags; -} VkVideoEncodeCapabilitiesKHR; - -typedef struct VkVideoEncodeH264CapabilitiesKHR -{ - VkStructureType sType; - void *pNext; - VkVideoEncodeH264CapabilityFlagsKHR flags; - StdVideoH264LevelIdc maxLevelIdc; - uint32_t maxSliceCount; - uint32_t maxPPictureL0ReferenceCount; - uint32_t maxBPictureL0ReferenceCount; - uint32_t maxL1ReferenceCount; - uint32_t maxTemporalLayerCount; - VkBool32 expectDyadicTemporalLayerPattern; - int32_t minQp; - int32_t maxQp; - VkBool32 prefersGopRemainingFrames; - VkBool32 requiresGopRemainingFrames; - VkVideoEncodeH264StdFlagsKHR stdSyntaxFlags; -} VkVideoEncodeH264CapabilitiesKHR; - -typedef struct VkVideoEncodeH264FrameSizeKHR -{ - uint32_t frameISize; - uint32_t framePSize; - uint32_t frameBSize; -} VkVideoEncodeH264FrameSizeKHR; - -typedef struct VkVideoEncodeH264GopRemainingFrameInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkBool32 useGopRemainingFrames; - uint32_t gopRemainingI; - uint32_t gopRemainingP; - uint32_t gopRemainingB; -} VkVideoEncodeH264GopRemainingFrameInfoKHR; - -typedef struct VkVideoEncodeH264ProfileInfoKHR -{ - VkStructureType sType; - const void *pNext; - StdVideoH264ProfileIdc stdProfileIdc; -} VkVideoEncodeH264ProfileInfoKHR; - -typedef struct VkVideoEncodeH264QpKHR -{ - int32_t qpI; - int32_t qpP; - int32_t qpB; -} VkVideoEncodeH264QpKHR; - -typedef struct VkVideoEncodeH264QualityLevelPropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkVideoEncodeH264RateControlFlagsKHR preferredRateControlFlags; - uint32_t preferredGopFrameCount; - uint32_t preferredIdrPeriod; - uint32_t preferredConsecutiveBFrameCount; - uint32_t preferredTemporalLayerCount; - VkVideoEncodeH264QpKHR preferredConstantQp; - uint32_t preferredMaxL0ReferenceCount; - uint32_t preferredMaxL1ReferenceCount; - VkBool32 preferredStdEntropyCodingModeFlag; -} VkVideoEncodeH264QualityLevelPropertiesKHR; - -typedef struct VkVideoEncodeH264QuantizationMapCapabilitiesKHR -{ - VkStructureType sType; - void *pNext; - int32_t minQpDelta; - int32_t maxQpDelta; -} VkVideoEncodeH264QuantizationMapCapabilitiesKHR; - -typedef struct VkVideoEncodeH264RateControlInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkVideoEncodeH264RateControlFlagsKHR flags; - uint32_t gopFrameCount; - uint32_t idrPeriod; - uint32_t consecutiveBFrameCount; - uint32_t temporalLayerCount; -} VkVideoEncodeH264RateControlInfoKHR; - -typedef struct VkVideoEncodeH264RateControlLayerInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkBool32 useMinQp; - VkVideoEncodeH264QpKHR minQp; - VkBool32 useMaxQp; - VkVideoEncodeH264QpKHR maxQp; - VkBool32 useMaxFrameSize; - VkVideoEncodeH264FrameSizeKHR maxFrameSize; -} VkVideoEncodeH264RateControlLayerInfoKHR; - -typedef struct VkVideoEncodeH264SessionCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkBool32 useMaxLevelIdc; - StdVideoH264LevelIdc maxLevelIdc; -} VkVideoEncodeH264SessionCreateInfoKHR; - -typedef struct VkVideoEncodeH264SessionParametersFeedbackInfoKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 hasStdSPSOverrides; - VkBool32 hasStdPPSOverrides; -} VkVideoEncodeH264SessionParametersFeedbackInfoKHR; - -typedef struct VkVideoEncodeH264SessionParametersGetInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkBool32 writeStdSPS; - VkBool32 writeStdPPS; - uint32_t stdSPSId; - uint32_t stdPPSId; -} VkVideoEncodeH264SessionParametersGetInfoKHR; - -typedef struct VkVideoEncodeH265CapabilitiesKHR -{ - VkStructureType sType; - void *pNext; - VkVideoEncodeH265CapabilityFlagsKHR flags; - StdVideoH265LevelIdc maxLevelIdc; - uint32_t maxSliceSegmentCount; - VkExtent2D maxTiles; - VkVideoEncodeH265CtbSizeFlagsKHR ctbSizes; - VkVideoEncodeH265TransformBlockSizeFlagsKHR transformBlockSizes; - uint32_t maxPPictureL0ReferenceCount; - uint32_t maxBPictureL0ReferenceCount; - uint32_t maxL1ReferenceCount; - uint32_t maxSubLayerCount; - VkBool32 expectDyadicTemporalSubLayerPattern; - int32_t minQp; - int32_t maxQp; - VkBool32 prefersGopRemainingFrames; - VkBool32 requiresGopRemainingFrames; - VkVideoEncodeH265StdFlagsKHR stdSyntaxFlags; -} VkVideoEncodeH265CapabilitiesKHR; - -typedef struct VkVideoEncodeH265FrameSizeKHR -{ - uint32_t frameISize; - uint32_t framePSize; - uint32_t frameBSize; -} VkVideoEncodeH265FrameSizeKHR; - -typedef struct VkVideoEncodeH265GopRemainingFrameInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkBool32 useGopRemainingFrames; - uint32_t gopRemainingI; - uint32_t gopRemainingP; - uint32_t gopRemainingB; -} VkVideoEncodeH265GopRemainingFrameInfoKHR; - -typedef struct VkVideoEncodeH265ProfileInfoKHR -{ - VkStructureType sType; - const void *pNext; - StdVideoH265ProfileIdc stdProfileIdc; -} VkVideoEncodeH265ProfileInfoKHR; - -typedef struct VkVideoEncodeH265QpKHR -{ - int32_t qpI; - int32_t qpP; - int32_t qpB; -} VkVideoEncodeH265QpKHR; - -typedef struct VkVideoEncodeH265QualityLevelPropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkVideoEncodeH265RateControlFlagsKHR preferredRateControlFlags; - uint32_t preferredGopFrameCount; - uint32_t preferredIdrPeriod; - uint32_t preferredConsecutiveBFrameCount; - uint32_t preferredSubLayerCount; - VkVideoEncodeH265QpKHR preferredConstantQp; - uint32_t preferredMaxL0ReferenceCount; - uint32_t preferredMaxL1ReferenceCount; -} VkVideoEncodeH265QualityLevelPropertiesKHR; - -typedef struct VkVideoEncodeH265QuantizationMapCapabilitiesKHR -{ - VkStructureType sType; - void *pNext; - int32_t minQpDelta; - int32_t maxQpDelta; -} VkVideoEncodeH265QuantizationMapCapabilitiesKHR; - -typedef struct VkVideoEncodeH265RateControlInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkVideoEncodeH265RateControlFlagsKHR flags; - uint32_t gopFrameCount; - uint32_t idrPeriod; - uint32_t consecutiveBFrameCount; - uint32_t subLayerCount; -} VkVideoEncodeH265RateControlInfoKHR; - -typedef struct VkVideoEncodeH265RateControlLayerInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkBool32 useMinQp; - VkVideoEncodeH265QpKHR minQp; - VkBool32 useMaxQp; - VkVideoEncodeH265QpKHR maxQp; - VkBool32 useMaxFrameSize; - VkVideoEncodeH265FrameSizeKHR maxFrameSize; -} VkVideoEncodeH265RateControlLayerInfoKHR; - -typedef struct VkVideoEncodeH265SessionCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkBool32 useMaxLevelIdc; - StdVideoH265LevelIdc maxLevelIdc; -} VkVideoEncodeH265SessionCreateInfoKHR; - -typedef struct VkVideoEncodeH265SessionParametersFeedbackInfoKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 hasStdVPSOverrides; - VkBool32 hasStdSPSOverrides; - VkBool32 hasStdPPSOverrides; -} VkVideoEncodeH265SessionParametersFeedbackInfoKHR; - -typedef struct VkVideoEncodeH265SessionParametersGetInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkBool32 writeStdVPS; - VkBool32 writeStdSPS; - VkBool32 writeStdPPS; - uint32_t stdVPSId; - uint32_t stdSPSId; - uint32_t stdPPSId; -} VkVideoEncodeH265SessionParametersGetInfoKHR; - -typedef struct VkVideoEncodeQualityLevelInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t qualityLevel; -} VkVideoEncodeQualityLevelInfoKHR; - -typedef struct VkVideoEncodeQualityLevelPropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkVideoEncodeRateControlModeFlagBitsKHR preferredRateControlMode; - uint32_t preferredRateControlLayerCount; -} VkVideoEncodeQualityLevelPropertiesKHR; - -typedef struct VkVideoEncodeQuantizationMapCapabilitiesKHR -{ - VkStructureType sType; - void *pNext; - VkExtent2D maxQuantizationMapExtent; -} VkVideoEncodeQuantizationMapCapabilitiesKHR; - -typedef struct VkVideoEncodeQuantizationMapInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkImageView WINE_VK_ALIGN(8) quantizationMap; - VkExtent2D quantizationMapExtent; -} VkVideoEncodeQuantizationMapInfoKHR; - -typedef struct VkVideoEncodeQuantizationMapSessionParametersCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkExtent2D quantizationMapTexelSize; -} VkVideoEncodeQuantizationMapSessionParametersCreateInfoKHR; - -typedef struct VkVideoEncodeRateControlLayerInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint64_t WINE_VK_ALIGN(8) averageBitrate; - uint64_t WINE_VK_ALIGN(8) maxBitrate; - uint32_t frameRateNumerator; - uint32_t frameRateDenominator; -} VkVideoEncodeRateControlLayerInfoKHR; - -typedef struct VkVideoEncodeSessionParametersFeedbackInfoKHR -{ - VkStructureType sType; - void *pNext; - VkBool32 hasOverrides; -} VkVideoEncodeSessionParametersFeedbackInfoKHR; - -typedef struct VkVideoEncodeSessionParametersGetInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkVideoSessionParametersKHR WINE_VK_ALIGN(8) videoSessionParameters; -} VkVideoEncodeSessionParametersGetInfoKHR; - -typedef struct VkVideoEncodeUsageInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkVideoEncodeUsageFlagsKHR videoUsageHints; - VkVideoEncodeContentFlagsKHR videoContentHints; - VkVideoEncodeTuningModeKHR tuningMode; -} VkVideoEncodeUsageInfoKHR; - -typedef struct VkVideoEndCodingInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkVideoEndCodingFlagsKHR flags; -} VkVideoEndCodingInfoKHR; - -typedef struct VkVideoFormatAV1QuantizationMapPropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkVideoEncodeAV1SuperblockSizeFlagsKHR compatibleSuperblockSizes; -} VkVideoFormatAV1QuantizationMapPropertiesKHR; - -typedef struct VkVideoFormatH265QuantizationMapPropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkVideoEncodeH265CtbSizeFlagsKHR compatibleCtbSizes; -} VkVideoFormatH265QuantizationMapPropertiesKHR; - -typedef struct VkVideoFormatPropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkFormat format; - VkComponentMapping componentMapping; - VkImageCreateFlags imageCreateFlags; - VkImageType imageType; - VkImageTiling imageTiling; - VkImageUsageFlags imageUsageFlags; -} VkVideoFormatPropertiesKHR; - -typedef struct VkVideoFormatQuantizationMapPropertiesKHR -{ - VkStructureType sType; - void *pNext; - VkExtent2D quantizationMapTexelSize; -} VkVideoFormatQuantizationMapPropertiesKHR; - -typedef struct VkVideoInlineQueryInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkQueryPool WINE_VK_ALIGN(8) queryPool; - uint32_t firstQuery; - uint32_t queryCount; -} VkVideoInlineQueryInfoKHR; - -typedef struct VkVideoPictureResourceInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkOffset2D codedOffset; - VkExtent2D codedExtent; - uint32_t baseArrayLayer; - VkImageView WINE_VK_ALIGN(8) imageViewBinding; -} VkVideoPictureResourceInfoKHR; - -typedef struct VkVideoProfileInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkVideoCodecOperationFlagBitsKHR videoCodecOperation; - VkVideoChromaSubsamplingFlagsKHR chromaSubsampling; - VkVideoComponentBitDepthFlagsKHR lumaBitDepth; - VkVideoComponentBitDepthFlagsKHR chromaBitDepth; -} VkVideoProfileInfoKHR; - -typedef struct VkVideoProfileListInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t profileCount; - const VkVideoProfileInfoKHR *pProfiles; -} VkVideoProfileListInfoKHR; - -typedef struct VkVideoReferenceSlotInfoKHR -{ - VkStructureType sType; - const void *pNext; - int32_t slotIndex; - const VkVideoPictureResourceInfoKHR *pPictureResource; -} VkVideoReferenceSlotInfoKHR; - -typedef struct VkVideoSessionCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t queueFamilyIndex; - VkVideoSessionCreateFlagsKHR flags; - const VkVideoProfileInfoKHR *pVideoProfile; - VkFormat pictureFormat; - VkExtent2D maxCodedExtent; - VkFormat referencePictureFormat; - uint32_t maxDpbSlots; - uint32_t maxActiveReferencePictures; - const VkExtensionProperties *pStdHeaderVersion; -} VkVideoSessionCreateInfoKHR; - -typedef struct VkVideoSessionMemoryRequirementsKHR -{ - VkStructureType sType; - void *pNext; - uint32_t memoryBindIndex; - VkMemoryRequirements WINE_VK_ALIGN(8) memoryRequirements; -} VkVideoSessionMemoryRequirementsKHR; - -typedef struct VkVideoSessionParametersCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkVideoSessionParametersCreateFlagsKHR flags; - VkVideoSessionParametersKHR WINE_VK_ALIGN(8) videoSessionParametersTemplate; - VkVideoSessionKHR WINE_VK_ALIGN(8) videoSession; -} VkVideoSessionParametersCreateInfoKHR; - -typedef struct VkVideoSessionParametersUpdateInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t updateSequenceCount; -} VkVideoSessionParametersUpdateInfoKHR; - -typedef struct VkViewport -{ - float x; - float y; - float width; - float height; - float minDepth; - float maxDepth; -} VkViewport; - -typedef struct VkViewportSwizzleNV -{ - VkViewportCoordinateSwizzleNV x; - VkViewportCoordinateSwizzleNV y; - VkViewportCoordinateSwizzleNV z; - VkViewportCoordinateSwizzleNV w; -} VkViewportSwizzleNV; - -typedef struct VkViewportWScalingNV -{ - float xcoeff; - float ycoeff; -} VkViewportWScalingNV; - -typedef struct VkWin32SurfaceCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkWin32SurfaceCreateFlagsKHR flags; - HINSTANCE hinstance; - HWND hwnd; -} VkWin32SurfaceCreateInfoKHR; - -typedef struct VkWriteDescriptorSet -{ - VkStructureType sType; - const void *pNext; - VkDescriptorSet WINE_VK_ALIGN(8) dstSet; - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; - VkDescriptorType descriptorType; - const VkDescriptorImageInfo *pImageInfo; - const VkDescriptorBufferInfo *pBufferInfo; - const VkBufferView *pTexelBufferView; -} VkWriteDescriptorSet; - -typedef struct VkWriteDescriptorSetAccelerationStructureKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t accelerationStructureCount; - const VkAccelerationStructureKHR *pAccelerationStructures; -} VkWriteDescriptorSetAccelerationStructureKHR; - -typedef struct VkWriteDescriptorSetAccelerationStructureNV -{ - VkStructureType sType; - const void *pNext; - uint32_t accelerationStructureCount; - const VkAccelerationStructureNV *pAccelerationStructures; -} VkWriteDescriptorSetAccelerationStructureNV; - -typedef struct VkWriteDescriptorSetInlineUniformBlock -{ - VkStructureType sType; - const void *pNext; - uint32_t dataSize; - const void *pData; -} VkWriteDescriptorSetInlineUniformBlock; -typedef VkWriteDescriptorSetInlineUniformBlock VkWriteDescriptorSetInlineUniformBlockEXT; - -typedef struct VkWriteIndirectExecutionSetPipelineEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t index; - VkPipeline WINE_VK_ALIGN(8) pipeline; -} VkWriteIndirectExecutionSetPipelineEXT; - -typedef struct VkWriteIndirectExecutionSetShaderEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t index; - VkShaderEXT WINE_VK_ALIGN(8) shader; -} VkWriteIndirectExecutionSetShaderEXT; - -typedef struct VkXYColorEXT -{ - float x; - float y; -} VkXYColorEXT; - -typedef struct StdVideoAV1ColorConfig -{ - StdVideoAV1ColorConfigFlags flags; - uint8_t BitDepth; - uint8_t subsampling_x; - uint8_t subsampling_y; - uint8_t reserved1; - StdVideoAV1ColorPrimaries color_primaries; - StdVideoAV1TransferCharacteristics transfer_characteristics; - StdVideoAV1MatrixCoefficients matrix_coefficients; - StdVideoAV1ChromaSamplePosition chroma_sample_position; -} StdVideoAV1ColorConfig; - -typedef struct StdVideoAV1FilmGrain -{ - StdVideoAV1FilmGrainFlags flags; - uint8_t grain_scaling_minus_8; - uint8_t ar_coeff_lag; - uint8_t ar_coeff_shift_minus_6; - uint8_t grain_scale_shift; - uint16_t grain_seed; - uint8_t film_grain_params_ref_idx; - uint8_t num_y_points; - uint8_t point_y_value[STD_VIDEO_AV1_MAX_NUM_Y_POINTS]; - uint8_t point_y_scaling[STD_VIDEO_AV1_MAX_NUM_Y_POINTS]; - uint8_t num_cb_points; - uint8_t point_cb_value[STD_VIDEO_AV1_MAX_NUM_CB_POINTS]; - uint8_t point_cb_scaling[STD_VIDEO_AV1_MAX_NUM_CB_POINTS]; - uint8_t num_cr_points; - uint8_t point_cr_value[STD_VIDEO_AV1_MAX_NUM_CR_POINTS]; - uint8_t point_cr_scaling[STD_VIDEO_AV1_MAX_NUM_CR_POINTS]; - int8_t ar_coeffs_y_plus_128[STD_VIDEO_AV1_MAX_NUM_POS_LUMA]; - int8_t ar_coeffs_cb_plus_128[STD_VIDEO_AV1_MAX_NUM_POS_CHROMA]; - int8_t ar_coeffs_cr_plus_128[STD_VIDEO_AV1_MAX_NUM_POS_CHROMA]; - uint8_t cb_mult; - uint8_t cb_luma_mult; - uint16_t cb_offset; - uint8_t cr_mult; - uint8_t cr_luma_mult; - uint16_t cr_offset; -} StdVideoAV1FilmGrain; - -typedef struct StdVideoAV1LoopFilter -{ - StdVideoAV1LoopFilterFlags flags; - uint8_t loop_filter_level[STD_VIDEO_AV1_MAX_LOOP_FILTER_STRENGTHS]; - uint8_t loop_filter_sharpness; - uint8_t update_ref_delta; - int8_t loop_filter_ref_deltas[STD_VIDEO_AV1_TOTAL_REFS_PER_FRAME]; - uint8_t update_mode_delta; - int8_t loop_filter_mode_deltas[STD_VIDEO_AV1_LOOP_FILTER_ADJUSTMENTS]; -} StdVideoAV1LoopFilter; - -typedef struct StdVideoAV1Quantization -{ - StdVideoAV1QuantizationFlags flags; - uint8_t base_q_idx; - int8_t DeltaQYDc; - int8_t DeltaQUDc; - int8_t DeltaQUAc; - int8_t DeltaQVDc; - int8_t DeltaQVAc; - uint8_t qm_y; - uint8_t qm_u; - uint8_t qm_v; -} StdVideoAV1Quantization; - -typedef struct StdVideoAV1TileInfo -{ - StdVideoAV1TileInfoFlags flags; - uint8_t TileCols; - uint8_t TileRows; - uint16_t context_update_tile_id; - uint8_t tile_size_bytes_minus_1; - uint8_t reserved1[7]; - const uint16_t *pMiColStarts; - const uint16_t *pMiRowStarts; - const uint16_t *pWidthInSbsMinus1; - const uint16_t *pHeightInSbsMinus1; -} StdVideoAV1TileInfo; - -typedef struct StdVideoAV1TimingInfo -{ - StdVideoAV1TimingInfoFlags flags; - uint32_t num_units_in_display_tick; - uint32_t time_scale; - uint32_t num_ticks_per_picture_minus_1; -} StdVideoAV1TimingInfo; - -typedef struct StdVideoDecodeAV1PictureInfo -{ - StdVideoDecodeAV1PictureInfoFlags flags; - StdVideoAV1FrameType frame_type; - uint32_t current_frame_id; - uint8_t OrderHint; - uint8_t primary_ref_frame; - uint8_t refresh_frame_flags; - uint8_t reserved1; - StdVideoAV1InterpolationFilter interpolation_filter; - StdVideoAV1TxMode TxMode; - uint8_t delta_q_res; - uint8_t delta_lf_res; - uint8_t SkipModeFrame[STD_VIDEO_AV1_SKIP_MODE_FRAMES]; - uint8_t coded_denom; - uint8_t reserved2[3]; - uint8_t OrderHints[STD_VIDEO_AV1_NUM_REF_FRAMES]; - uint32_t expectedFrameId[STD_VIDEO_AV1_NUM_REF_FRAMES]; - const StdVideoAV1TileInfo *pTileInfo; - const StdVideoAV1Quantization *pQuantization; - const StdVideoAV1Segmentation *pSegmentation; - const StdVideoAV1LoopFilter *pLoopFilter; - const StdVideoAV1CDEF *pCDEF; - const StdVideoAV1LoopRestoration *pLoopRestoration; - const StdVideoAV1GlobalMotion *pGlobalMotion; - const StdVideoAV1FilmGrain *pFilmGrain; -} StdVideoDecodeAV1PictureInfo; - -typedef struct StdVideoDecodeAV1ReferenceInfo -{ - StdVideoDecodeAV1ReferenceInfoFlags flags; - uint8_t frame_type; - uint8_t RefFrameSignBias; - uint8_t OrderHint; - uint8_t SavedOrderHints[STD_VIDEO_AV1_NUM_REF_FRAMES]; -} StdVideoDecodeAV1ReferenceInfo; - -typedef struct StdVideoDecodeH264PictureInfo -{ - StdVideoDecodeH264PictureInfoFlags flags; - uint8_t seq_parameter_set_id; - uint8_t pic_parameter_set_id; - uint8_t reserved1; - uint8_t reserved2; - uint16_t frame_num; - uint16_t idr_pic_id; - int32_t PicOrderCnt[STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE]; -} StdVideoDecodeH264PictureInfo; - -typedef struct StdVideoDecodeH264ReferenceInfo -{ - StdVideoDecodeH264ReferenceInfoFlags flags; - uint16_t FrameNum; - uint16_t reserved; - int32_t PicOrderCnt[STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE]; -} StdVideoDecodeH264ReferenceInfo; - -typedef struct StdVideoDecodeH265PictureInfo -{ - StdVideoDecodeH265PictureInfoFlags flags; - uint8_t sps_video_parameter_set_id; - uint8_t pps_seq_parameter_set_id; - uint8_t pps_pic_parameter_set_id; - uint8_t NumDeltaPocsOfRefRpsIdx; - int32_t PicOrderCntVal; - uint16_t NumBitsForSTRefPicSetInSlice; - uint16_t reserved; - uint8_t RefPicSetStCurrBefore[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE]; - uint8_t RefPicSetStCurrAfter[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE]; - uint8_t RefPicSetLtCurr[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE]; -} StdVideoDecodeH265PictureInfo; - -typedef struct StdVideoDecodeH265ReferenceInfo -{ - StdVideoDecodeH265ReferenceInfoFlags flags; - int32_t PicOrderCntVal; -} StdVideoDecodeH265ReferenceInfo; - -typedef struct StdVideoEncodeAV1OperatingPointInfo -{ - StdVideoEncodeAV1OperatingPointInfoFlags flags; - uint16_t operating_point_idc; - uint8_t seq_level_idx; - uint8_t seq_tier; - uint32_t decoder_buffer_delay; - uint32_t encoder_buffer_delay; - uint8_t initial_display_delay_minus_1; -} StdVideoEncodeAV1OperatingPointInfo; - -typedef struct StdVideoEncodeAV1PictureInfo -{ - StdVideoEncodeAV1PictureInfoFlags flags; - StdVideoAV1FrameType frame_type; - uint32_t frame_presentation_time; - uint32_t current_frame_id; - uint8_t order_hint; - uint8_t primary_ref_frame; - uint8_t refresh_frame_flags; - uint8_t coded_denom; - uint16_t render_width_minus_1; - uint16_t render_height_minus_1; - StdVideoAV1InterpolationFilter interpolation_filter; - StdVideoAV1TxMode TxMode; - uint8_t delta_q_res; - uint8_t delta_lf_res; - uint8_t ref_order_hint[STD_VIDEO_AV1_NUM_REF_FRAMES]; - int8_t ref_frame_idx[STD_VIDEO_AV1_REFS_PER_FRAME]; - uint8_t reserved1[3]; - uint32_t delta_frame_id_minus_1[STD_VIDEO_AV1_REFS_PER_FRAME]; - const StdVideoAV1TileInfo *pTileInfo; - const StdVideoAV1Quantization *pQuantization; - const StdVideoAV1Segmentation *pSegmentation; - const StdVideoAV1LoopFilter *pLoopFilter; - const StdVideoAV1CDEF *pCDEF; - const StdVideoAV1LoopRestoration *pLoopRestoration; - const StdVideoAV1GlobalMotion *pGlobalMotion; - const StdVideoEncodeAV1ExtensionHeader *pExtensionHeader; - const uint32_t *pBufferRemovalTimes; -} StdVideoEncodeAV1PictureInfo; - -typedef struct StdVideoEncodeAV1ReferenceInfo -{ - StdVideoEncodeAV1ReferenceInfoFlags flags; - uint32_t RefFrameId; - StdVideoAV1FrameType frame_type; - uint8_t OrderHint; - uint8_t reserved1[3]; - const StdVideoEncodeAV1ExtensionHeader *pExtensionHeader; -} StdVideoEncodeAV1ReferenceInfo; - -typedef struct StdVideoEncodeH264ReferenceInfo -{ - StdVideoEncodeH264ReferenceInfoFlags flags; - StdVideoH264PictureType primary_pic_type; - uint32_t FrameNum; - int32_t PicOrderCnt; - uint16_t long_term_pic_num; - uint16_t long_term_frame_idx; - uint8_t temporal_id; -} StdVideoEncodeH264ReferenceInfo; - -typedef struct StdVideoEncodeH264ReferenceListsInfo -{ - StdVideoEncodeH264ReferenceListsInfoFlags flags; - uint8_t num_ref_idx_l0_active_minus1; - uint8_t num_ref_idx_l1_active_minus1; - uint8_t RefPicList0[STD_VIDEO_H264_MAX_NUM_LIST_REF]; - uint8_t RefPicList1[STD_VIDEO_H264_MAX_NUM_LIST_REF]; - uint8_t refList0ModOpCount; - uint8_t refList1ModOpCount; - uint8_t refPicMarkingOpCount; - uint8_t reserved1[7]; - const StdVideoEncodeH264RefListModEntry *pRefList0ModOperations; - const StdVideoEncodeH264RefListModEntry *pRefList1ModOperations; - const StdVideoEncodeH264RefPicMarkingEntry *pRefPicMarkingOperations; -} StdVideoEncodeH264ReferenceListsInfo; - -typedef struct StdVideoEncodeH264WeightTable -{ - StdVideoEncodeH264WeightTableFlags flags; - uint8_t luma_log2_weight_denom; - uint8_t chroma_log2_weight_denom; - int8_t luma_weight_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF]; - int8_t luma_offset_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF]; - int8_t chroma_weight_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES]; - int8_t chroma_offset_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES]; - int8_t luma_weight_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF]; - int8_t luma_offset_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF]; - int8_t chroma_weight_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES]; - int8_t chroma_offset_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES]; -} StdVideoEncodeH264WeightTable; - -typedef struct StdVideoEncodeH265ReferenceInfo -{ - StdVideoEncodeH265ReferenceInfoFlags flags; - StdVideoH265PictureType pic_type; - int32_t PicOrderCntVal; - uint8_t TemporalId; -} StdVideoEncodeH265ReferenceInfo; - -typedef struct StdVideoEncodeH265ReferenceListsInfo -{ - StdVideoEncodeH265ReferenceListsInfoFlags flags; - uint8_t num_ref_idx_l0_active_minus1; - uint8_t num_ref_idx_l1_active_minus1; - uint8_t RefPicList0[STD_VIDEO_H265_MAX_NUM_LIST_REF]; - uint8_t RefPicList1[STD_VIDEO_H265_MAX_NUM_LIST_REF]; - uint8_t list_entry_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF]; - uint8_t list_entry_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF]; -} StdVideoEncodeH265ReferenceListsInfo; - -typedef struct StdVideoEncodeH265WeightTable -{ - StdVideoEncodeH265WeightTableFlags flags; - uint8_t luma_log2_weight_denom; - int8_t delta_chroma_log2_weight_denom; - int8_t delta_luma_weight_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF]; - int8_t luma_offset_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF]; - int8_t delta_chroma_weight_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES]; - int8_t delta_chroma_offset_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES]; - int8_t delta_luma_weight_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF]; - int8_t luma_offset_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF]; - int8_t delta_chroma_weight_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES]; - int8_t delta_chroma_offset_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES]; -} StdVideoEncodeH265WeightTable; - -typedef struct StdVideoH264PictureParameterSet -{ - StdVideoH264PpsFlags flags; - uint8_t seq_parameter_set_id; - uint8_t pic_parameter_set_id; - uint8_t num_ref_idx_l0_default_active_minus1; - uint8_t num_ref_idx_l1_default_active_minus1; - StdVideoH264WeightedBipredIdc weighted_bipred_idc; - int8_t pic_init_qp_minus26; - int8_t pic_init_qs_minus26; - int8_t chroma_qp_index_offset; - int8_t second_chroma_qp_index_offset; - const StdVideoH264ScalingLists *pScalingLists; -} StdVideoH264PictureParameterSet; - -typedef struct StdVideoH264SequenceParameterSetVui -{ - StdVideoH264SpsVuiFlags flags; - StdVideoH264AspectRatioIdc aspect_ratio_idc; - uint16_t sar_width; - uint16_t sar_height; - uint8_t video_format; - uint8_t colour_primaries; - uint8_t transfer_characteristics; - uint8_t matrix_coefficients; - uint32_t num_units_in_tick; - uint32_t time_scale; - uint8_t max_num_reorder_frames; - uint8_t max_dec_frame_buffering; - uint8_t chroma_sample_loc_type_top_field; - uint8_t chroma_sample_loc_type_bottom_field; - uint32_t reserved1; - const StdVideoH264HrdParameters *pHrdParameters; -} StdVideoH264SequenceParameterSetVui; - -typedef struct StdVideoH265HrdParameters -{ - StdVideoH265HrdFlags flags; - uint8_t tick_divisor_minus2; - uint8_t du_cpb_removal_delay_increment_length_minus1; - uint8_t dpb_output_delay_du_length_minus1; - uint8_t bit_rate_scale; - uint8_t cpb_size_scale; - uint8_t cpb_size_du_scale; - uint8_t initial_cpb_removal_delay_length_minus1; - uint8_t au_cpb_removal_delay_length_minus1; - uint8_t dpb_output_delay_length_minus1; - uint8_t cpb_cnt_minus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]; - uint16_t elemental_duration_in_tc_minus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]; - uint16_t reserved[3]; - const StdVideoH265SubLayerHrdParameters *pSubLayerHrdParametersNal; - const StdVideoH265SubLayerHrdParameters *pSubLayerHrdParametersVcl; -} StdVideoH265HrdParameters; - -typedef struct StdVideoH265PictureParameterSet -{ - StdVideoH265PpsFlags flags; - uint8_t pps_pic_parameter_set_id; - uint8_t pps_seq_parameter_set_id; - uint8_t sps_video_parameter_set_id; - uint8_t num_extra_slice_header_bits; - uint8_t num_ref_idx_l0_default_active_minus1; - uint8_t num_ref_idx_l1_default_active_minus1; - int8_t init_qp_minus26; - uint8_t diff_cu_qp_delta_depth; - int8_t pps_cb_qp_offset; - int8_t pps_cr_qp_offset; - int8_t pps_beta_offset_div2; - int8_t pps_tc_offset_div2; - uint8_t log2_parallel_merge_level_minus2; - uint8_t log2_max_transform_skip_block_size_minus2; - uint8_t diff_cu_chroma_qp_offset_depth; - uint8_t chroma_qp_offset_list_len_minus1; - int8_t cb_qp_offset_list[STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE]; - int8_t cr_qp_offset_list[STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE]; - uint8_t log2_sao_offset_scale_luma; - uint8_t log2_sao_offset_scale_chroma; - int8_t pps_act_y_qp_offset_plus5; - int8_t pps_act_cb_qp_offset_plus5; - int8_t pps_act_cr_qp_offset_plus3; - uint8_t pps_num_palette_predictor_initializers; - uint8_t luma_bit_depth_entry_minus8; - uint8_t chroma_bit_depth_entry_minus8; - uint8_t num_tile_columns_minus1; - uint8_t num_tile_rows_minus1; - uint8_t reserved1; - uint8_t reserved2; - uint16_t column_width_minus1[STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_COLS_LIST_SIZE]; - uint16_t row_height_minus1[STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_ROWS_LIST_SIZE]; - uint32_t reserved3; - const StdVideoH265ScalingLists *pScalingLists; - const StdVideoH265PredictorPaletteEntries *pPredictorPaletteEntries; -} StdVideoH265PictureParameterSet; - -typedef struct StdVideoH265ProfileTierLevel -{ - StdVideoH265ProfileTierLevelFlags flags; - StdVideoH265ProfileIdc general_profile_idc; - StdVideoH265LevelIdc general_level_idc; -} StdVideoH265ProfileTierLevel; - -typedef struct StdVideoH265SequenceParameterSetVui -{ - StdVideoH265SpsVuiFlags flags; - StdVideoH265AspectRatioIdc aspect_ratio_idc; - uint16_t sar_width; - uint16_t sar_height; - uint8_t video_format; - uint8_t colour_primaries; - uint8_t transfer_characteristics; - uint8_t matrix_coeffs; - uint8_t chroma_sample_loc_type_top_field; - uint8_t chroma_sample_loc_type_bottom_field; - uint8_t reserved1; - uint8_t reserved2; - uint16_t def_disp_win_left_offset; - uint16_t def_disp_win_right_offset; - uint16_t def_disp_win_top_offset; - uint16_t def_disp_win_bottom_offset; - uint32_t vui_num_units_in_tick; - uint32_t vui_time_scale; - uint32_t vui_num_ticks_poc_diff_one_minus1; - uint16_t min_spatial_segmentation_idc; - uint16_t reserved3; - uint8_t max_bytes_per_pic_denom; - uint8_t max_bits_per_min_cu_denom; - uint8_t log2_max_mv_length_horizontal; - uint8_t log2_max_mv_length_vertical; - const StdVideoH265HrdParameters *pHrdParameters; -} StdVideoH265SequenceParameterSetVui; - -typedef struct StdVideoH265ShortTermRefPicSet -{ - StdVideoH265ShortTermRefPicSetFlags flags; - uint32_t delta_idx_minus1; - uint16_t use_delta_flag; - uint16_t abs_delta_rps_minus1; - uint16_t used_by_curr_pic_flag; - uint16_t used_by_curr_pic_s0_flag; - uint16_t used_by_curr_pic_s1_flag; - uint16_t reserved1; - uint8_t reserved2; - uint8_t reserved3; - uint8_t num_negative_pics; - uint8_t num_positive_pics; - uint16_t delta_poc_s0_minus1[STD_VIDEO_H265_MAX_DPB_SIZE]; - uint16_t delta_poc_s1_minus1[STD_VIDEO_H265_MAX_DPB_SIZE]; -} StdVideoH265ShortTermRefPicSet; - -typedef struct StdVideoH265VideoParameterSet -{ - StdVideoH265VpsFlags flags; - uint8_t vps_video_parameter_set_id; - uint8_t vps_max_sub_layers_minus1; - uint8_t reserved1; - uint8_t reserved2; - uint32_t vps_num_units_in_tick; - uint32_t vps_time_scale; - uint32_t vps_num_ticks_poc_diff_one_minus1; - uint32_t reserved3; - const StdVideoH265DecPicBufMgr *pDecPicBufMgr; - const StdVideoH265HrdParameters *pHrdParameters; - const StdVideoH265ProfileTierLevel *pProfileTierLevel; -} StdVideoH265VideoParameterSet; - -typedef struct VkAccelerationStructureGeometryAabbsDataKHR -{ - VkStructureType sType; - const void *pNext; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) data; - VkDeviceSize WINE_VK_ALIGN(8) stride; -} VkAccelerationStructureGeometryAabbsDataKHR; - -typedef struct VkAccelerationStructureGeometryInstancesDataKHR -{ - VkStructureType sType; - const void *pNext; - VkBool32 arrayOfPointers; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) data; -} VkAccelerationStructureGeometryInstancesDataKHR; - -typedef struct VkAccelerationStructureGeometryMotionTrianglesDataNV -{ - VkStructureType sType; - const void *pNext; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) vertexData; -} VkAccelerationStructureGeometryMotionTrianglesDataNV; - -typedef struct VkAccelerationStructureGeometryTrianglesDataKHR -{ - VkStructureType sType; - const void *pNext; - VkFormat vertexFormat; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) vertexData; - VkDeviceSize WINE_VK_ALIGN(8) vertexStride; - uint32_t maxVertex; - VkIndexType indexType; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) indexData; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) transformData; -} VkAccelerationStructureGeometryTrianglesDataKHR; - -typedef struct VkAccelerationStructureInstanceKHR -{ - VkTransformMatrixKHR transform; - uint32_t instanceCustomIndex:24; - uint32_t mask:8; - uint32_t instanceShaderBindingTableRecordOffset:24; - VkGeometryInstanceFlagsKHR flags:8; - uint64_t WINE_VK_ALIGN(8) accelerationStructureReference; -} VkAccelerationStructureInstanceKHR; -typedef VkAccelerationStructureInstanceKHR VkAccelerationStructureInstanceNV; - -typedef struct VkAccelerationStructureMatrixMotionInstanceNV -{ - VkTransformMatrixKHR transformT0; - VkTransformMatrixKHR transformT1; - uint32_t instanceCustomIndex:24; - uint32_t mask:8; - uint32_t instanceShaderBindingTableRecordOffset:24; - VkGeometryInstanceFlagsKHR flags:8; - uint64_t WINE_VK_ALIGN(8) accelerationStructureReference; -} VkAccelerationStructureMatrixMotionInstanceNV; - -typedef struct VkAccelerationStructureSRTMotionInstanceNV -{ - VkSRTDataNV transformT0; - VkSRTDataNV transformT1; - uint32_t instanceCustomIndex:24; - uint32_t mask:8; - uint32_t instanceShaderBindingTableRecordOffset:24; - VkGeometryInstanceFlagsKHR flags:8; - uint64_t WINE_VK_ALIGN(8) accelerationStructureReference; -} VkAccelerationStructureSRTMotionInstanceNV; - -typedef struct VkAccelerationStructureTrianglesOpacityMicromapEXT -{ - VkStructureType sType; - void *pNext; - VkIndexType indexType; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) indexBuffer; - VkDeviceSize WINE_VK_ALIGN(8) indexStride; - uint32_t baseTriangle; - uint32_t usageCountsCount; - const VkMicromapUsageEXT *pUsageCounts; - const VkMicromapUsageEXT * const*ppUsageCounts; - VkMicromapEXT WINE_VK_ALIGN(8) micromap; -} VkAccelerationStructureTrianglesOpacityMicromapEXT; - -typedef struct VkAntiLagDataAMD -{ - VkStructureType sType; - const void *pNext; - VkAntiLagModeAMD mode; - uint32_t maxFPS; - const VkAntiLagPresentationInfoAMD *pPresentationInfo; -} VkAntiLagDataAMD; - -typedef struct VkAttachmentSampleLocationsEXT -{ - uint32_t attachmentIndex; - VkSampleLocationsInfoEXT sampleLocationsInfo; -} VkAttachmentSampleLocationsEXT; - -typedef struct VkBindImageMemoryDeviceGroupInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t deviceIndexCount; - const uint32_t *pDeviceIndices; - uint32_t splitInstanceBindRegionCount; - const VkRect2D *pSplitInstanceBindRegions; -} VkBindImageMemoryDeviceGroupInfo; -typedef VkBindImageMemoryDeviceGroupInfo VkBindImageMemoryDeviceGroupInfoKHR; - -typedef struct VkBufferImageCopy -{ - VkDeviceSize WINE_VK_ALIGN(8) bufferOffset; - uint32_t bufferRowLength; - uint32_t bufferImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkBufferImageCopy; - -typedef struct VkBufferImageCopy2 -{ - VkStructureType sType; - const void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) bufferOffset; - uint32_t bufferRowLength; - uint32_t bufferImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkBufferImageCopy2; -typedef VkBufferImageCopy2 VkBufferImageCopy2KHR; - -typedef struct VkClearAttachment -{ - VkImageAspectFlags aspectMask; - uint32_t colorAttachment; - VkClearValue clearValue; -} VkClearAttachment; - -typedef struct VkClearRect -{ - VkRect2D rect; - uint32_t baseArrayLayer; - uint32_t layerCount; -} VkClearRect; - -typedef struct VkCommandBufferBeginInfo -{ - VkStructureType sType; - const void *pNext; - VkCommandBufferUsageFlags flags; - const VkCommandBufferInheritanceInfo *pInheritanceInfo; -} VkCommandBufferBeginInfo; - -typedef struct VkCommandBufferInheritanceRenderPassTransformInfoQCOM -{ - VkStructureType sType; - void *pNext; - VkSurfaceTransformFlagBitsKHR transform; - VkRect2D renderArea; -} VkCommandBufferInheritanceRenderPassTransformInfoQCOM; - -typedef struct VkCommandBufferInheritanceViewportScissorInfoNV -{ - VkStructureType sType; - const void *pNext; - VkBool32 viewportScissor2D; - uint32_t viewportDepthCount; - const VkViewport *pViewportDepths; -} VkCommandBufferInheritanceViewportScissorInfoNV; - -typedef struct VkCopyAccelerationStructureToMemoryInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkAccelerationStructureKHR WINE_VK_ALIGN(8) src; - VkDeviceOrHostAddressKHR WINE_VK_ALIGN(8) dst; - VkCopyAccelerationStructureModeKHR mode; -} VkCopyAccelerationStructureToMemoryInfoKHR; - -typedef struct VkCopyBufferToImageInfo2 -{ - VkStructureType sType; - const void *pNext; - VkBuffer WINE_VK_ALIGN(8) srcBuffer; - VkImage WINE_VK_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkBufferImageCopy2 *pRegions; -} VkCopyBufferToImageInfo2; -typedef VkCopyBufferToImageInfo2 VkCopyBufferToImageInfo2KHR; - -typedef struct VkCopyImageToBufferInfo2 -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkBuffer WINE_VK_ALIGN(8) dstBuffer; - uint32_t regionCount; - const VkBufferImageCopy2 *pRegions; -} VkCopyImageToBufferInfo2; -typedef VkCopyImageToBufferInfo2 VkCopyImageToBufferInfo2KHR; - -typedef struct VkCopyMemoryToAccelerationStructureInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) src; - VkAccelerationStructureKHR WINE_VK_ALIGN(8) dst; - VkCopyAccelerationStructureModeKHR mode; -} VkCopyMemoryToAccelerationStructureInfoKHR; - -typedef struct VkCopyMemoryToImageIndirectCommandNV -{ - VkDeviceAddress WINE_VK_ALIGN(8) srcAddress; - uint32_t bufferRowLength; - uint32_t bufferImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkCopyMemoryToImageIndirectCommandNV; - -typedef struct VkCopyMemoryToMicromapInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) src; - VkMicromapEXT WINE_VK_ALIGN(8) dst; - VkCopyMicromapModeEXT mode; -} VkCopyMemoryToMicromapInfoEXT; - -typedef struct VkCopyMicromapToMemoryInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkMicromapEXT WINE_VK_ALIGN(8) src; - VkDeviceOrHostAddressKHR WINE_VK_ALIGN(8) dst; - VkCopyMicromapModeEXT mode; -} VkCopyMicromapToMemoryInfoEXT; - -typedef struct VkDebugUtilsMessengerCallbackDataEXT -{ - VkStructureType sType; - const void *pNext; - VkDebugUtilsMessengerCallbackDataFlagsEXT flags; - const char *pMessageIdName; - int32_t messageIdNumber; - const char *pMessage; - uint32_t queueLabelCount; - const VkDebugUtilsLabelEXT *pQueueLabels; - uint32_t cmdBufLabelCount; - const VkDebugUtilsLabelEXT *pCmdBufLabels; - uint32_t objectCount; - const VkDebugUtilsObjectNameInfoEXT *pObjects; -} VkDebugUtilsMessengerCallbackDataEXT; - -typedef union VkDescriptorDataEXT -{ - const VkSampler *pSampler; - const VkDescriptorImageInfo *pCombinedImageSampler; - const VkDescriptorImageInfo *pInputAttachmentImage; - const VkDescriptorImageInfo *pSampledImage; - const VkDescriptorImageInfo *pStorageImage; - const VkDescriptorAddressInfoEXT *pUniformTexelBuffer; - const VkDescriptorAddressInfoEXT *pStorageTexelBuffer; - const VkDescriptorAddressInfoEXT *pUniformBuffer; - const VkDescriptorAddressInfoEXT *pStorageBuffer; - VkDeviceAddress WINE_VK_ALIGN(8) accelerationStructure; -} VkDescriptorDataEXT; - -typedef struct VkDescriptorGetInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkDescriptorType type; - VkDescriptorDataEXT WINE_VK_ALIGN(8) data; -} VkDescriptorGetInfoEXT; - -typedef struct VkDescriptorPoolCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkDescriptorPoolCreateFlags flags; - uint32_t maxSets; - uint32_t poolSizeCount; - const VkDescriptorPoolSize *pPoolSizes; -} VkDescriptorPoolCreateInfo; - -typedef struct VkDescriptorUpdateTemplateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkDescriptorUpdateTemplateCreateFlags flags; - uint32_t descriptorUpdateEntryCount; - const VkDescriptorUpdateTemplateEntry *pDescriptorUpdateEntries; - VkDescriptorUpdateTemplateType templateType; - VkDescriptorSetLayout WINE_VK_ALIGN(8) descriptorSetLayout; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout WINE_VK_ALIGN(8) pipelineLayout; - uint32_t set; -} VkDescriptorUpdateTemplateCreateInfo; -typedef VkDescriptorUpdateTemplateCreateInfo VkDescriptorUpdateTemplateCreateInfoKHR; - -typedef struct VkDeviceCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkDeviceCreateFlags flags; - uint32_t queueCreateInfoCount; - const VkDeviceQueueCreateInfo *pQueueCreateInfos; - uint32_t enabledLayerCount; - const char * const*ppEnabledLayerNames; - uint32_t enabledExtensionCount; - const char * const*ppEnabledExtensionNames; - const VkPhysicalDeviceFeatures *pEnabledFeatures; -} VkDeviceCreateInfo; - -typedef struct VkDeviceFaultInfoEXT -{ - VkStructureType sType; - void *pNext; - char description[VK_MAX_DESCRIPTION_SIZE]; - VkDeviceFaultAddressInfoEXT *pAddressInfos; - VkDeviceFaultVendorInfoEXT *pVendorInfos; - void *pVendorBinaryData; -} VkDeviceFaultInfoEXT; - -typedef struct VkDeviceGroupRenderPassBeginInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t deviceMask; - uint32_t deviceRenderAreaCount; - const VkRect2D *pDeviceRenderAreas; -} VkDeviceGroupRenderPassBeginInfo; -typedef VkDeviceGroupRenderPassBeginInfo VkDeviceGroupRenderPassBeginInfoKHR; - -typedef struct VkDeviceImageMemoryRequirements -{ - VkStructureType sType; - const void *pNext; - const VkImageCreateInfo *pCreateInfo; - VkImageAspectFlagBits planeAspect; -} VkDeviceImageMemoryRequirements; -typedef VkDeviceImageMemoryRequirements VkDeviceImageMemoryRequirementsKHR; - -typedef struct VkDeviceImageSubresourceInfo -{ - VkStructureType sType; - const void *pNext; - const VkImageCreateInfo *pCreateInfo; - const VkImageSubresource2 *pSubresource; -} VkDeviceImageSubresourceInfo; -typedef VkDeviceImageSubresourceInfo VkDeviceImageSubresourceInfoKHR; - -typedef struct VkExternalBufferProperties -{ - VkStructureType sType; - void *pNext; - VkExternalMemoryProperties externalMemoryProperties; -} VkExternalBufferProperties; -typedef VkExternalBufferProperties VkExternalBufferPropertiesKHR; - -typedef struct VkExternalImageFormatProperties -{ - VkStructureType sType; - void *pNext; - VkExternalMemoryProperties externalMemoryProperties; -} VkExternalImageFormatProperties; -typedef VkExternalImageFormatProperties VkExternalImageFormatPropertiesKHR; - -typedef struct VkGeneratedCommandsInfoNV -{ - VkStructureType sType; - const void *pNext; - VkPipelineBindPoint pipelineBindPoint; - VkPipeline WINE_VK_ALIGN(8) pipeline; - VkIndirectCommandsLayoutNV WINE_VK_ALIGN(8) indirectCommandsLayout; - uint32_t streamCount; - const VkIndirectCommandsStreamNV *pStreams; - uint32_t sequencesCount; - VkBuffer WINE_VK_ALIGN(8) preprocessBuffer; - VkDeviceSize WINE_VK_ALIGN(8) preprocessOffset; - VkDeviceSize WINE_VK_ALIGN(8) preprocessSize; - VkBuffer WINE_VK_ALIGN(8) sequencesCountBuffer; - VkDeviceSize WINE_VK_ALIGN(8) sequencesCountOffset; - VkBuffer WINE_VK_ALIGN(8) sequencesIndexBuffer; - VkDeviceSize WINE_VK_ALIGN(8) sequencesIndexOffset; -} VkGeneratedCommandsInfoNV; - -typedef struct VkGeometryDataNV -{ - VkGeometryTrianglesNV WINE_VK_ALIGN(8) triangles; - VkGeometryAABBNV WINE_VK_ALIGN(8) aabbs; -} VkGeometryDataNV; - -typedef struct VkGeometryNV -{ - VkStructureType sType; - const void *pNext; - VkGeometryTypeKHR geometryType; - VkGeometryDataNV WINE_VK_ALIGN(8) geometry; - VkGeometryFlagsKHR flags; -} VkGeometryNV; - -typedef struct VkGetLatencyMarkerInfoNV -{ - VkStructureType sType; - const void *pNext; - uint32_t timingCount; - VkLatencyTimingsFrameReportNV *pTimings; -} VkGetLatencyMarkerInfoNV; - -typedef struct VkHdrMetadataEXT -{ - VkStructureType sType; - const void *pNext; - VkXYColorEXT displayPrimaryRed; - VkXYColorEXT displayPrimaryGreen; - VkXYColorEXT displayPrimaryBlue; - VkXYColorEXT whitePoint; - float maxLuminance; - float minLuminance; - float maxContentLightLevel; - float maxFrameAverageLightLevel; -} VkHdrMetadataEXT; - -typedef struct VkHostImageLayoutTransitionInfo -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) image; - VkImageLayout oldLayout; - VkImageLayout newLayout; - VkImageSubresourceRange subresourceRange; -} VkHostImageLayoutTransitionInfo; -typedef VkHostImageLayoutTransitionInfo VkHostImageLayoutTransitionInfoEXT; - -typedef struct VkImageBlit -{ - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffsets[2]; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffsets[2]; -} VkImageBlit; - -typedef struct VkImageBlit2 -{ - VkStructureType sType; - const void *pNext; - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffsets[2]; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffsets[2]; -} VkImageBlit2; -typedef VkImageBlit2 VkImageBlit2KHR; - -typedef struct VkImageCopy -{ - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffset; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffset; - VkExtent3D extent; -} VkImageCopy; - -typedef struct VkImageCopy2 -{ - VkStructureType sType; - const void *pNext; - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffset; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffset; - VkExtent3D extent; -} VkImageCopy2; -typedef VkImageCopy2 VkImageCopy2KHR; - -typedef struct VkImageMemoryBarrier -{ - VkStructureType sType; - const void *pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - VkImageLayout oldLayout; - VkImageLayout newLayout; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkImage WINE_VK_ALIGN(8) image; - VkImageSubresourceRange subresourceRange; -} VkImageMemoryBarrier; - -typedef struct VkImageMemoryBarrier2 -{ - VkStructureType sType; - const void *pNext; - VkPipelineStageFlags2 WINE_VK_ALIGN(8) srcStageMask; - VkAccessFlags2 WINE_VK_ALIGN(8) srcAccessMask; - VkPipelineStageFlags2 WINE_VK_ALIGN(8) dstStageMask; - VkAccessFlags2 WINE_VK_ALIGN(8) dstAccessMask; - VkImageLayout oldLayout; - VkImageLayout newLayout; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkImage WINE_VK_ALIGN(8) image; - VkImageSubresourceRange subresourceRange; -} VkImageMemoryBarrier2; -typedef VkImageMemoryBarrier2 VkImageMemoryBarrier2KHR; - -typedef struct VkImageResolve -{ - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffset; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffset; - VkExtent3D extent; -} VkImageResolve; - -typedef struct VkImageResolve2 -{ - VkStructureType sType; - const void *pNext; - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffset; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffset; - VkExtent3D extent; -} VkImageResolve2; -typedef VkImageResolve2 VkImageResolve2KHR; - -typedef struct VkImageToMemoryCopy -{ - VkStructureType sType; - const void *pNext; - void *pHostPointer; - uint32_t memoryRowLength; - uint32_t memoryImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkImageToMemoryCopy; -typedef VkImageToMemoryCopy VkImageToMemoryCopyEXT; - -typedef struct VkImageViewSampleWeightCreateInfoQCOM -{ - VkStructureType sType; - const void *pNext; - VkOffset2D filterCenter; - VkExtent2D filterSize; - uint32_t numPhases; -} VkImageViewSampleWeightCreateInfoQCOM; - -typedef struct VkIndirectCommandsLayoutCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkIndirectCommandsLayoutUsageFlagsNV flags; - VkPipelineBindPoint pipelineBindPoint; - uint32_t tokenCount; - const VkIndirectCommandsLayoutTokenNV *pTokens; - uint32_t streamCount; - const uint32_t *pStreamStrides; -} VkIndirectCommandsLayoutCreateInfoNV; - -typedef struct VkIndirectCommandsPushConstantTokenEXT -{ - VkPushConstantRange updateRange; -} VkIndirectCommandsPushConstantTokenEXT; - -typedef union VkIndirectCommandsTokenDataEXT -{ - const VkIndirectCommandsPushConstantTokenEXT *pPushConstant; - const VkIndirectCommandsVertexBufferTokenEXT *pVertexBuffer; - const VkIndirectCommandsIndexBufferTokenEXT *pIndexBuffer; - const VkIndirectCommandsExecutionSetTokenEXT *pExecutionSet; -} VkIndirectCommandsTokenDataEXT; - -typedef struct VkIndirectExecutionSetShaderInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t shaderCount; - const VkShaderEXT *pInitialShaders; - const VkIndirectExecutionSetShaderLayoutInfoEXT *pSetLayoutInfos; - uint32_t maxShaderCount; - uint32_t pushConstantRangeCount; - const VkPushConstantRange *pPushConstantRanges; -} VkIndirectExecutionSetShaderInfoEXT; - -typedef struct VkMemoryToImageCopy -{ - VkStructureType sType; - const void *pNext; - const void *pHostPointer; - uint32_t memoryRowLength; - uint32_t memoryImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkMemoryToImageCopy; -typedef VkMemoryToImageCopy VkMemoryToImageCopyEXT; - -typedef struct VkMicromapBuildInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkMicromapTypeEXT type; - VkBuildMicromapFlagsEXT flags; - VkBuildMicromapModeEXT mode; - VkMicromapEXT WINE_VK_ALIGN(8) dstMicromap; - uint32_t usageCountsCount; - const VkMicromapUsageEXT *pUsageCounts; - const VkMicromapUsageEXT * const*ppUsageCounts; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) data; - VkDeviceOrHostAddressKHR WINE_VK_ALIGN(8) scratchData; - VkDeviceOrHostAddressConstKHR WINE_VK_ALIGN(8) triangleArray; - VkDeviceSize WINE_VK_ALIGN(8) triangleArrayStride; -} VkMicromapBuildInfoEXT; - -typedef struct VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM -{ - VkStructureType sType; - const void *pNext; - uint32_t perViewRenderAreaCount; - const VkRect2D *pPerViewRenderAreas; -} VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM; - -typedef struct VkMutableDescriptorTypeCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t mutableDescriptorTypeListCount; - const VkMutableDescriptorTypeListEXT *pMutableDescriptorTypeLists; -} VkMutableDescriptorTypeCreateInfoEXT; -typedef VkMutableDescriptorTypeCreateInfoEXT VkMutableDescriptorTypeCreateInfoVALVE; - -typedef struct VkOpticalFlowExecuteInfoNV -{ - VkStructureType sType; - void *pNext; - VkOpticalFlowExecuteFlagsNV flags; - uint32_t regionCount; - const VkRect2D *pRegions; -} VkOpticalFlowExecuteInfoNV; - -typedef struct VkPhysicalDeviceProperties -{ - uint32_t apiVersion; - uint32_t driverVersion; - uint32_t vendorID; - uint32_t deviceID; - VkPhysicalDeviceType deviceType; - char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; - uint8_t pipelineCacheUUID[VK_UUID_SIZE]; - VkPhysicalDeviceLimits WINE_VK_ALIGN(8) limits; - VkPhysicalDeviceSparseProperties sparseProperties; -} VkPhysicalDeviceProperties; - -typedef struct VkPhysicalDeviceProperties2 -{ - VkStructureType sType; - void *pNext; - VkPhysicalDeviceProperties WINE_VK_ALIGN(8) properties; -} VkPhysicalDeviceProperties2; -typedef VkPhysicalDeviceProperties2 VkPhysicalDeviceProperties2KHR; - -typedef struct VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR -{ - VkStructureType sType; - const void *pNext; - const VkVideoProfileInfoKHR *pVideoProfile; - uint32_t qualityLevel; -} VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR; - -typedef struct VkPipelineBinaryCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - const VkPipelineBinaryKeysAndDataKHR *pKeysAndDataInfo; - VkPipeline WINE_VK_ALIGN(8) pipeline; - const VkPipelineCreateInfoKHR *pPipelineCreateInfo; -} VkPipelineBinaryCreateInfoKHR; - -typedef struct VkPipelineDepthStencilStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineDepthStencilStateCreateFlags flags; - VkBool32 depthTestEnable; - VkBool32 depthWriteEnable; - VkCompareOp depthCompareOp; - VkBool32 depthBoundsTestEnable; - VkBool32 stencilTestEnable; - VkStencilOpState front; - VkStencilOpState back; - float minDepthBounds; - float maxDepthBounds; -} VkPipelineDepthStencilStateCreateInfo; - -typedef struct VkPipelineDiscardRectangleStateCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkPipelineDiscardRectangleStateCreateFlagsEXT flags; - VkDiscardRectangleModeEXT discardRectangleMode; - uint32_t discardRectangleCount; - const VkRect2D *pDiscardRectangles; -} VkPipelineDiscardRectangleStateCreateInfoEXT; - -typedef struct VkPipelineExecutableStatisticKHR -{ - VkStructureType sType; - void *pNext; - char name[VK_MAX_DESCRIPTION_SIZE]; - char description[VK_MAX_DESCRIPTION_SIZE]; - VkPipelineExecutableStatisticFormatKHR format; - VkPipelineExecutableStatisticValueKHR WINE_VK_ALIGN(8) value; -} VkPipelineExecutableStatisticKHR; - -typedef struct VkPipelineLayoutCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineLayoutCreateFlags flags; - uint32_t setLayoutCount; - const VkDescriptorSetLayout *pSetLayouts; - uint32_t pushConstantRangeCount; - const VkPushConstantRange *pPushConstantRanges; -} VkPipelineLayoutCreateInfo; - -typedef struct VkPipelineSampleLocationsStateCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkBool32 sampleLocationsEnable; - VkSampleLocationsInfoEXT sampleLocationsInfo; -} VkPipelineSampleLocationsStateCreateInfoEXT; - -typedef struct VkPipelineVertexInputDivisorStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t vertexBindingDivisorCount; - const VkVertexInputBindingDivisorDescription *pVertexBindingDivisors; -} VkPipelineVertexInputDivisorStateCreateInfo; -typedef VkPipelineVertexInputDivisorStateCreateInfo VkPipelineVertexInputDivisorStateCreateInfoKHR; -typedef VkPipelineVertexInputDivisorStateCreateInfo VkPipelineVertexInputDivisorStateCreateInfoEXT; - -typedef struct VkPipelineVertexInputStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineVertexInputStateCreateFlags flags; - uint32_t vertexBindingDescriptionCount; - const VkVertexInputBindingDescription *pVertexBindingDescriptions; - uint32_t vertexAttributeDescriptionCount; - const VkVertexInputAttributeDescription *pVertexAttributeDescriptions; -} VkPipelineVertexInputStateCreateInfo; - -typedef struct VkPipelineViewportExclusiveScissorStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - uint32_t exclusiveScissorCount; - const VkRect2D *pExclusiveScissors; -} VkPipelineViewportExclusiveScissorStateCreateInfoNV; - -typedef struct VkPipelineViewportShadingRateImageStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkBool32 shadingRateImageEnable; - uint32_t viewportCount; - const VkShadingRatePaletteNV *pShadingRatePalettes; -} VkPipelineViewportShadingRateImageStateCreateInfoNV; - -typedef struct VkPipelineViewportStateCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineViewportStateCreateFlags flags; - uint32_t viewportCount; - const VkViewport *pViewports; - uint32_t scissorCount; - const VkRect2D *pScissors; -} VkPipelineViewportStateCreateInfo; - -typedef struct VkPipelineViewportSwizzleStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkPipelineViewportSwizzleStateCreateFlagsNV flags; - uint32_t viewportCount; - const VkViewportSwizzleNV *pViewportSwizzles; -} VkPipelineViewportSwizzleStateCreateInfoNV; - -typedef struct VkPipelineViewportWScalingStateCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkBool32 viewportWScalingEnable; - uint32_t viewportCount; - const VkViewportWScalingNV *pViewportWScalings; -} VkPipelineViewportWScalingStateCreateInfoNV; - -typedef struct VkPresentRegionKHR -{ - uint32_t rectangleCount; - const VkRectLayerKHR *pRectangles; -} VkPresentRegionKHR; - -typedef struct VkPresentRegionsKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t swapchainCount; - const VkPresentRegionKHR *pRegions; -} VkPresentRegionsKHR; - -typedef struct VkPushDescriptorSetInfo -{ - VkStructureType sType; - const void *pNext; - VkShaderStageFlags stageFlags; - VkPipelineLayout WINE_VK_ALIGN(8) layout; - uint32_t set; - uint32_t descriptorWriteCount; - const VkWriteDescriptorSet *pDescriptorWrites; -} VkPushDescriptorSetInfo; -typedef VkPushDescriptorSetInfo VkPushDescriptorSetInfoKHR; - -typedef struct VkRenderPassCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkRenderPassCreateFlags flags; - uint32_t attachmentCount; - const VkAttachmentDescription *pAttachments; - uint32_t subpassCount; - const VkSubpassDescription *pSubpasses; - uint32_t dependencyCount; - const VkSubpassDependency *pDependencies; -} VkRenderPassCreateInfo; - -typedef struct VkRenderPassCreateInfo2 -{ - VkStructureType sType; - const void *pNext; - VkRenderPassCreateFlags flags; - uint32_t attachmentCount; - const VkAttachmentDescription2 *pAttachments; - uint32_t subpassCount; - const VkSubpassDescription2 *pSubpasses; - uint32_t dependencyCount; - const VkSubpassDependency2 *pDependencies; - uint32_t correlatedViewMaskCount; - const uint32_t *pCorrelatedViewMasks; -} VkRenderPassCreateInfo2; -typedef VkRenderPassCreateInfo2 VkRenderPassCreateInfo2KHR; - -typedef struct VkRenderPassCreationFeedbackCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkRenderPassCreationFeedbackInfoEXT *pRenderPassFeedback; -} VkRenderPassCreationFeedbackCreateInfoEXT; - -typedef struct VkRenderPassSampleLocationsBeginInfoEXT -{ - VkStructureType sType; - const void *pNext; - uint32_t attachmentInitialSampleLocationsCount; - const VkAttachmentSampleLocationsEXT *pAttachmentInitialSampleLocations; - uint32_t postSubpassSampleLocationsCount; - const VkSubpassSampleLocationsEXT *pPostSubpassSampleLocations; -} VkRenderPassSampleLocationsBeginInfoEXT; - -typedef struct VkRenderPassStripeBeginInfoARM -{ - VkStructureType sType; - const void *pNext; - uint32_t stripeInfoCount; - const VkRenderPassStripeInfoARM *pStripeInfos; -} VkRenderPassStripeBeginInfoARM; - -typedef struct VkRenderPassStripeSubmitInfoARM -{ - VkStructureType sType; - const void *pNext; - uint32_t stripeSemaphoreInfoCount; - const VkSemaphoreSubmitInfo *pStripeSemaphoreInfos; -} VkRenderPassStripeSubmitInfoARM; - -typedef struct VkRenderPassSubpassFeedbackCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkRenderPassSubpassFeedbackInfoEXT *pSubpassFeedback; -} VkRenderPassSubpassFeedbackCreateInfoEXT; - -typedef struct VkResolveImageInfo2 -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage WINE_VK_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkImageResolve2 *pRegions; -} VkResolveImageInfo2; -typedef VkResolveImageInfo2 VkResolveImageInfo2KHR; - -typedef struct VkSparseBufferMemoryBindInfo -{ - VkBuffer WINE_VK_ALIGN(8) buffer; - uint32_t bindCount; - const VkSparseMemoryBind *pBinds; -} VkSparseBufferMemoryBindInfo; - -typedef struct VkSparseImageOpaqueMemoryBindInfo -{ - VkImage WINE_VK_ALIGN(8) image; - uint32_t bindCount; - const VkSparseMemoryBind *pBinds; -} VkSparseImageOpaqueMemoryBindInfo; - -typedef struct VkSpecializationInfo -{ - uint32_t mapEntryCount; - const VkSpecializationMapEntry *pMapEntries; - size_t dataSize; - const void *pData; -} VkSpecializationInfo; - -typedef struct VkSurfaceCapabilities2KHR -{ - VkStructureType sType; - void *pNext; - VkSurfaceCapabilitiesKHR surfaceCapabilities; -} VkSurfaceCapabilities2KHR; - -typedef struct VkSurfaceFormat2KHR -{ - VkStructureType sType; - void *pNext; - VkSurfaceFormatKHR surfaceFormat; -} VkSurfaceFormat2KHR; - -typedef struct VkVideoBeginCodingInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkVideoBeginCodingFlagsKHR flags; - VkVideoSessionKHR WINE_VK_ALIGN(8) videoSession; - VkVideoSessionParametersKHR WINE_VK_ALIGN(8) videoSessionParameters; - uint32_t referenceSlotCount; - const VkVideoReferenceSlotInfoKHR *pReferenceSlots; -} VkVideoBeginCodingInfoKHR; - -typedef struct VkVideoDecodeAV1DpbSlotInfoKHR -{ - VkStructureType sType; - const void *pNext; - const StdVideoDecodeAV1ReferenceInfo *pStdReferenceInfo; -} VkVideoDecodeAV1DpbSlotInfoKHR; - -typedef struct VkVideoDecodeAV1PictureInfoKHR -{ - VkStructureType sType; - const void *pNext; - const StdVideoDecodeAV1PictureInfo *pStdPictureInfo; - int32_t referenceNameSlotIndices[VK_MAX_VIDEO_AV1_REFERENCES_PER_FRAME_KHR]; - uint32_t frameHeaderOffset; - uint32_t tileCount; - const uint32_t *pTileOffsets; - const uint32_t *pTileSizes; -} VkVideoDecodeAV1PictureInfoKHR; - -typedef struct VkVideoDecodeH264DpbSlotInfoKHR -{ - VkStructureType sType; - const void *pNext; - const StdVideoDecodeH264ReferenceInfo *pStdReferenceInfo; -} VkVideoDecodeH264DpbSlotInfoKHR; - -typedef struct VkVideoDecodeH264PictureInfoKHR -{ - VkStructureType sType; - const void *pNext; - const StdVideoDecodeH264PictureInfo *pStdPictureInfo; - uint32_t sliceCount; - const uint32_t *pSliceOffsets; -} VkVideoDecodeH264PictureInfoKHR; - -typedef struct VkVideoDecodeH265DpbSlotInfoKHR -{ - VkStructureType sType; - const void *pNext; - const StdVideoDecodeH265ReferenceInfo *pStdReferenceInfo; -} VkVideoDecodeH265DpbSlotInfoKHR; - -typedef struct VkVideoDecodeH265PictureInfoKHR -{ - VkStructureType sType; - const void *pNext; - const StdVideoDecodeH265PictureInfo *pStdPictureInfo; - uint32_t sliceSegmentCount; - const uint32_t *pSliceSegmentOffsets; -} VkVideoDecodeH265PictureInfoKHR; - -typedef struct VkVideoDecodeInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkVideoDecodeFlagsKHR flags; - VkBuffer WINE_VK_ALIGN(8) srcBuffer; - VkDeviceSize WINE_VK_ALIGN(8) srcBufferOffset; - VkDeviceSize WINE_VK_ALIGN(8) srcBufferRange; - VkVideoPictureResourceInfoKHR WINE_VK_ALIGN(8) dstPictureResource; - const VkVideoReferenceSlotInfoKHR *pSetupReferenceSlot; - uint32_t referenceSlotCount; - const VkVideoReferenceSlotInfoKHR *pReferenceSlots; -} VkVideoDecodeInfoKHR; - -typedef struct VkVideoEncodeAV1DpbSlotInfoKHR -{ - VkStructureType sType; - const void *pNext; - const StdVideoEncodeAV1ReferenceInfo *pStdReferenceInfo; -} VkVideoEncodeAV1DpbSlotInfoKHR; - -typedef struct VkVideoEncodeAV1PictureInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkVideoEncodeAV1PredictionModeKHR predictionMode; - VkVideoEncodeAV1RateControlGroupKHR rateControlGroup; - uint32_t constantQIndex; - const StdVideoEncodeAV1PictureInfo *pStdPictureInfo; - int32_t referenceNameSlotIndices[VK_MAX_VIDEO_AV1_REFERENCES_PER_FRAME_KHR]; - VkBool32 primaryReferenceCdfOnly; - VkBool32 generateObuExtensionHeader; -} VkVideoEncodeAV1PictureInfoKHR; - -typedef struct VkVideoEncodeH264DpbSlotInfoKHR -{ - VkStructureType sType; - const void *pNext; - const StdVideoEncodeH264ReferenceInfo *pStdReferenceInfo; -} VkVideoEncodeH264DpbSlotInfoKHR; - -typedef struct VkVideoEncodeH265DpbSlotInfoKHR -{ - VkStructureType sType; - const void *pNext; - const StdVideoEncodeH265ReferenceInfo *pStdReferenceInfo; -} VkVideoEncodeH265DpbSlotInfoKHR; - -typedef struct VkVideoEncodeInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkVideoEncodeFlagsKHR flags; - VkBuffer WINE_VK_ALIGN(8) dstBuffer; - VkDeviceSize WINE_VK_ALIGN(8) dstBufferOffset; - VkDeviceSize WINE_VK_ALIGN(8) dstBufferRange; - VkVideoPictureResourceInfoKHR WINE_VK_ALIGN(8) srcPictureResource; - const VkVideoReferenceSlotInfoKHR *pSetupReferenceSlot; - uint32_t referenceSlotCount; - const VkVideoReferenceSlotInfoKHR *pReferenceSlots; - uint32_t precedingExternallyEncodedBytes; -} VkVideoEncodeInfoKHR; - -typedef struct VkVideoEncodeRateControlInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkVideoEncodeRateControlFlagsKHR flags; - VkVideoEncodeRateControlModeFlagBitsKHR rateControlMode; - uint32_t layerCount; - const VkVideoEncodeRateControlLayerInfoKHR *pLayers; - uint32_t virtualBufferSizeInMs; - uint32_t initialVirtualBufferSizeInMs; -} VkVideoEncodeRateControlInfoKHR; - -typedef struct StdVideoAV1SequenceHeader -{ - StdVideoAV1SequenceHeaderFlags flags; - StdVideoAV1Profile seq_profile; - uint8_t frame_width_bits_minus_1; - uint8_t frame_height_bits_minus_1; - uint16_t max_frame_width_minus_1; - uint16_t max_frame_height_minus_1; - uint8_t delta_frame_id_length_minus_2; - uint8_t additional_frame_id_length_minus_1; - uint8_t order_hint_bits_minus_1; - uint8_t seq_force_integer_mv; - uint8_t seq_force_screen_content_tools; - uint8_t reserved1[5]; - const StdVideoAV1ColorConfig *pColorConfig; - const StdVideoAV1TimingInfo *pTimingInfo; -} StdVideoAV1SequenceHeader; - -typedef struct StdVideoEncodeH264PictureInfo -{ - StdVideoEncodeH264PictureInfoFlags flags; - uint8_t seq_parameter_set_id; - uint8_t pic_parameter_set_id; - uint16_t idr_pic_id; - StdVideoH264PictureType primary_pic_type; - uint32_t frame_num; - int32_t PicOrderCnt; - uint8_t temporal_id; - uint8_t reserved1[3]; - const StdVideoEncodeH264ReferenceListsInfo *pRefLists; -} StdVideoEncodeH264PictureInfo; - -typedef struct StdVideoEncodeH264SliceHeader -{ - StdVideoEncodeH264SliceHeaderFlags flags; - uint32_t first_mb_in_slice; - StdVideoH264SliceType slice_type; - int8_t slice_alpha_c0_offset_div2; - int8_t slice_beta_offset_div2; - int8_t slice_qp_delta; - uint8_t reserved1; - StdVideoH264CabacInitIdc cabac_init_idc; - StdVideoH264DisableDeblockingFilterIdc disable_deblocking_filter_idc; - const StdVideoEncodeH264WeightTable *pWeightTable; -} StdVideoEncodeH264SliceHeader; - -typedef struct StdVideoEncodeH265PictureInfo -{ - StdVideoEncodeH265PictureInfoFlags flags; - StdVideoH265PictureType pic_type; - uint8_t sps_video_parameter_set_id; - uint8_t pps_seq_parameter_set_id; - uint8_t pps_pic_parameter_set_id; - uint8_t short_term_ref_pic_set_idx; - int32_t PicOrderCntVal; - uint8_t TemporalId; - uint8_t reserved1[7]; - const StdVideoEncodeH265ReferenceListsInfo *pRefLists; - const StdVideoH265ShortTermRefPicSet *pShortTermRefPicSet; - const StdVideoEncodeH265LongTermRefPics *pLongTermRefPics; -} StdVideoEncodeH265PictureInfo; - -typedef struct StdVideoEncodeH265SliceSegmentHeader -{ - StdVideoEncodeH265SliceSegmentHeaderFlags flags; - StdVideoH265SliceType slice_type; - uint32_t slice_segment_address; - uint8_t collocated_ref_idx; - uint8_t MaxNumMergeCand; - int8_t slice_cb_qp_offset; - int8_t slice_cr_qp_offset; - int8_t slice_beta_offset_div2; - int8_t slice_tc_offset_div2; - int8_t slice_act_y_qp_offset; - int8_t slice_act_cb_qp_offset; - int8_t slice_act_cr_qp_offset; - int8_t slice_qp_delta; - uint16_t reserved1; - const StdVideoEncodeH265WeightTable *pWeightTable; -} StdVideoEncodeH265SliceSegmentHeader; - -typedef struct StdVideoH264SequenceParameterSet -{ - StdVideoH264SpsFlags flags; - StdVideoH264ProfileIdc profile_idc; - StdVideoH264LevelIdc level_idc; - StdVideoH264ChromaFormatIdc chroma_format_idc; - uint8_t seq_parameter_set_id; - uint8_t bit_depth_luma_minus8; - uint8_t bit_depth_chroma_minus8; - uint8_t log2_max_frame_num_minus4; - StdVideoH264PocType pic_order_cnt_type; - int32_t offset_for_non_ref_pic; - int32_t offset_for_top_to_bottom_field; - uint8_t log2_max_pic_order_cnt_lsb_minus4; - uint8_t num_ref_frames_in_pic_order_cnt_cycle; - uint8_t max_num_ref_frames; - uint8_t reserved1; - uint32_t pic_width_in_mbs_minus1; - uint32_t pic_height_in_map_units_minus1; - uint32_t frame_crop_left_offset; - uint32_t frame_crop_right_offset; - uint32_t frame_crop_top_offset; - uint32_t frame_crop_bottom_offset; - uint32_t reserved2; - const int32_t *pOffsetForRefFrame; - const StdVideoH264ScalingLists *pScalingLists; - const StdVideoH264SequenceParameterSetVui *pSequenceParameterSetVui; -} StdVideoH264SequenceParameterSet; - -typedef struct StdVideoH265SequenceParameterSet -{ - StdVideoH265SpsFlags flags; - StdVideoH265ChromaFormatIdc chroma_format_idc; - uint32_t pic_width_in_luma_samples; - uint32_t pic_height_in_luma_samples; - uint8_t sps_video_parameter_set_id; - uint8_t sps_max_sub_layers_minus1; - uint8_t sps_seq_parameter_set_id; - uint8_t bit_depth_luma_minus8; - uint8_t bit_depth_chroma_minus8; - uint8_t log2_max_pic_order_cnt_lsb_minus4; - uint8_t log2_min_luma_coding_block_size_minus3; - uint8_t log2_diff_max_min_luma_coding_block_size; - uint8_t log2_min_luma_transform_block_size_minus2; - uint8_t log2_diff_max_min_luma_transform_block_size; - uint8_t max_transform_hierarchy_depth_inter; - uint8_t max_transform_hierarchy_depth_intra; - uint8_t num_short_term_ref_pic_sets; - uint8_t num_long_term_ref_pics_sps; - uint8_t pcm_sample_bit_depth_luma_minus1; - uint8_t pcm_sample_bit_depth_chroma_minus1; - uint8_t log2_min_pcm_luma_coding_block_size_minus3; - uint8_t log2_diff_max_min_pcm_luma_coding_block_size; - uint8_t reserved1; - uint8_t reserved2; - uint8_t palette_max_size; - uint8_t delta_palette_max_predictor_size; - uint8_t motion_vector_resolution_control_idc; - uint8_t sps_num_palette_predictor_initializers_minus1; - uint32_t conf_win_left_offset; - uint32_t conf_win_right_offset; - uint32_t conf_win_top_offset; - uint32_t conf_win_bottom_offset; - const StdVideoH265ProfileTierLevel *pProfileTierLevel; - const StdVideoH265DecPicBufMgr *pDecPicBufMgr; - const StdVideoH265ScalingLists *pScalingLists; - const StdVideoH265ShortTermRefPicSet *pShortTermRefPicSet; - const StdVideoH265LongTermRefPicsSps *pLongTermRefPicsSps; - const StdVideoH265SequenceParameterSetVui *pSequenceParameterSetVui; - const StdVideoH265PredictorPaletteEntries *pPredictorPaletteEntries; -} StdVideoH265SequenceParameterSet; - -typedef union VkAccelerationStructureGeometryDataKHR -{ - VkAccelerationStructureGeometryTrianglesDataKHR WINE_VK_ALIGN(8) triangles; - VkAccelerationStructureGeometryAabbsDataKHR WINE_VK_ALIGN(8) aabbs; - VkAccelerationStructureGeometryInstancesDataKHR WINE_VK_ALIGN(8) instances; -} VkAccelerationStructureGeometryDataKHR; - -typedef struct VkAccelerationStructureGeometryKHR -{ - VkStructureType sType; - const void *pNext; - VkGeometryTypeKHR geometryType; - VkAccelerationStructureGeometryDataKHR WINE_VK_ALIGN(8) geometry; - VkGeometryFlagsKHR flags; -} VkAccelerationStructureGeometryKHR; - -typedef struct VkAccelerationStructureInfoNV -{ - VkStructureType sType; - const void *pNext; - VkAccelerationStructureTypeNV type; - VkBuildAccelerationStructureFlagsNV flags; - uint32_t instanceCount; - uint32_t geometryCount; - const VkGeometryNV *pGeometries; -} VkAccelerationStructureInfoNV; - -typedef union VkAccelerationStructureMotionInstanceDataNV -{ - VkAccelerationStructureInstanceKHR WINE_VK_ALIGN(8) staticInstance; - VkAccelerationStructureMatrixMotionInstanceNV WINE_VK_ALIGN(8) matrixMotionInstance; - VkAccelerationStructureSRTMotionInstanceNV WINE_VK_ALIGN(8) srtMotionInstance; -} VkAccelerationStructureMotionInstanceDataNV; - -typedef struct VkAccelerationStructureMotionInstanceNV -{ - VkAccelerationStructureMotionInstanceTypeNV type; - VkAccelerationStructureMotionInstanceFlagsNV flags; - VkAccelerationStructureMotionInstanceDataNV WINE_VK_ALIGN(8) data; -} VkAccelerationStructureMotionInstanceNV; - -typedef struct VkBindSparseInfo -{ - VkStructureType sType; - const void *pNext; - uint32_t waitSemaphoreCount; - const VkSemaphore *pWaitSemaphores; - uint32_t bufferBindCount; - const VkSparseBufferMemoryBindInfo *pBufferBinds; - uint32_t imageOpaqueBindCount; - const VkSparseImageOpaqueMemoryBindInfo *pImageOpaqueBinds; - uint32_t imageBindCount; - const VkSparseImageMemoryBindInfo *pImageBinds; - uint32_t signalSemaphoreCount; - const VkSemaphore *pSignalSemaphores; -} VkBindSparseInfo; - -typedef struct VkBlitImageInfo2 -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage WINE_VK_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkImageBlit2 *pRegions; - VkFilter filter; -} VkBlitImageInfo2; -typedef VkBlitImageInfo2 VkBlitImageInfo2KHR; - -typedef struct VkCopyImageInfo2 -{ - VkStructureType sType; - const void *pNext; - VkImage WINE_VK_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage WINE_VK_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkImageCopy2 *pRegions; -} VkCopyImageInfo2; -typedef VkCopyImageInfo2 VkCopyImageInfo2KHR; - -typedef struct VkCopyImageToImageInfo -{ - VkStructureType sType; - const void *pNext; - VkHostImageCopyFlags flags; - VkImage WINE_VK_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - VkImage WINE_VK_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkImageCopy2 *pRegions; -} VkCopyImageToImageInfo; -typedef VkCopyImageToImageInfo VkCopyImageToImageInfoEXT; - -typedef struct VkCopyImageToMemoryInfo -{ - VkStructureType sType; - const void *pNext; - VkHostImageCopyFlags flags; - VkImage WINE_VK_ALIGN(8) srcImage; - VkImageLayout srcImageLayout; - uint32_t regionCount; - const VkImageToMemoryCopy *pRegions; -} VkCopyImageToMemoryInfo; -typedef VkCopyImageToMemoryInfo VkCopyImageToMemoryInfoEXT; - -typedef struct VkCopyMemoryToImageInfo -{ - VkStructureType sType; - const void *pNext; - VkHostImageCopyFlags flags; - VkImage WINE_VK_ALIGN(8) dstImage; - VkImageLayout dstImageLayout; - uint32_t regionCount; - const VkMemoryToImageCopy *pRegions; -} VkCopyMemoryToImageInfo; -typedef VkCopyMemoryToImageInfo VkCopyMemoryToImageInfoEXT; - -typedef struct VkDependencyInfo -{ - VkStructureType sType; - const void *pNext; - VkDependencyFlags dependencyFlags; - uint32_t memoryBarrierCount; - const VkMemoryBarrier2 *pMemoryBarriers; - uint32_t bufferMemoryBarrierCount; - const VkBufferMemoryBarrier2 *pBufferMemoryBarriers; - uint32_t imageMemoryBarrierCount; - const VkImageMemoryBarrier2 *pImageMemoryBarriers; -} VkDependencyInfo; -typedef VkDependencyInfo VkDependencyInfoKHR; - -typedef struct VkIndirectCommandsLayoutTokenEXT -{ - VkStructureType sType; - const void *pNext; - VkIndirectCommandsTokenTypeEXT type; - VkIndirectCommandsTokenDataEXT data; - uint32_t offset; -} VkIndirectCommandsLayoutTokenEXT; - -typedef union VkIndirectExecutionSetInfoEXT -{ - const VkIndirectExecutionSetPipelineInfoEXT *pPipelineInfo; - const VkIndirectExecutionSetShaderInfoEXT *pShaderInfo; -} VkIndirectExecutionSetInfoEXT; - -typedef struct VkPipelineShaderStageCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineShaderStageCreateFlags flags; - VkShaderStageFlagBits stage; - VkShaderModule WINE_VK_ALIGN(8) module; - const char *pName; - const VkSpecializationInfo *pSpecializationInfo; -} VkPipelineShaderStageCreateInfo; - -typedef struct VkRayTracingPipelineCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkPipelineCreateFlags flags; - uint32_t stageCount; - const VkPipelineShaderStageCreateInfo *pStages; - uint32_t groupCount; - const VkRayTracingShaderGroupCreateInfoKHR *pGroups; - uint32_t maxPipelineRayRecursionDepth; - const VkPipelineLibraryCreateInfoKHR *pLibraryInfo; - const VkRayTracingPipelineInterfaceCreateInfoKHR *pLibraryInterface; - const VkPipelineDynamicStateCreateInfo *pDynamicState; - VkPipelineLayout WINE_VK_ALIGN(8) layout; - VkPipeline WINE_VK_ALIGN(8) basePipelineHandle; - int32_t basePipelineIndex; -} VkRayTracingPipelineCreateInfoKHR; - -typedef struct VkRayTracingPipelineCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkPipelineCreateFlags flags; - uint32_t stageCount; - const VkPipelineShaderStageCreateInfo *pStages; - uint32_t groupCount; - const VkRayTracingShaderGroupCreateInfoNV *pGroups; - uint32_t maxRecursionDepth; - VkPipelineLayout WINE_VK_ALIGN(8) layout; - VkPipeline WINE_VK_ALIGN(8) basePipelineHandle; - int32_t basePipelineIndex; -} VkRayTracingPipelineCreateInfoNV; - -typedef struct VkShaderCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkShaderCreateFlagsEXT flags; - VkShaderStageFlagBits stage; - VkShaderStageFlags nextStage; - VkShaderCodeTypeEXT codeType; - size_t codeSize; - const void *pCode; - const char *pName; - uint32_t setLayoutCount; - const VkDescriptorSetLayout *pSetLayouts; - uint32_t pushConstantRangeCount; - const VkPushConstantRange *pPushConstantRanges; - const VkSpecializationInfo *pSpecializationInfo; -} VkShaderCreateInfoEXT; - -typedef struct VkVideoDecodeAV1SessionParametersCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - const StdVideoAV1SequenceHeader *pStdSequenceHeader; -} VkVideoDecodeAV1SessionParametersCreateInfoKHR; - -typedef struct VkVideoDecodeH264SessionParametersAddInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t stdSPSCount; - const StdVideoH264SequenceParameterSet *pStdSPSs; - uint32_t stdPPSCount; - const StdVideoH264PictureParameterSet *pStdPPSs; -} VkVideoDecodeH264SessionParametersAddInfoKHR; - -typedef struct VkVideoDecodeH264SessionParametersCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t maxStdSPSCount; - uint32_t maxStdPPSCount; - const VkVideoDecodeH264SessionParametersAddInfoKHR *pParametersAddInfo; -} VkVideoDecodeH264SessionParametersCreateInfoKHR; - -typedef struct VkVideoDecodeH265SessionParametersAddInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t stdVPSCount; - const StdVideoH265VideoParameterSet *pStdVPSs; - uint32_t stdSPSCount; - const StdVideoH265SequenceParameterSet *pStdSPSs; - uint32_t stdPPSCount; - const StdVideoH265PictureParameterSet *pStdPPSs; -} VkVideoDecodeH265SessionParametersAddInfoKHR; - -typedef struct VkVideoDecodeH265SessionParametersCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t maxStdVPSCount; - uint32_t maxStdSPSCount; - uint32_t maxStdPPSCount; - const VkVideoDecodeH265SessionParametersAddInfoKHR *pParametersAddInfo; -} VkVideoDecodeH265SessionParametersCreateInfoKHR; - -typedef struct VkVideoEncodeAV1SessionParametersCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - const StdVideoAV1SequenceHeader *pStdSequenceHeader; - const StdVideoEncodeAV1DecoderModelInfo *pStdDecoderModelInfo; - uint32_t stdOperatingPointCount; - const StdVideoEncodeAV1OperatingPointInfo *pStdOperatingPoints; -} VkVideoEncodeAV1SessionParametersCreateInfoKHR; - -typedef struct VkVideoEncodeH264NaluSliceInfoKHR -{ - VkStructureType sType; - const void *pNext; - int32_t constantQp; - const StdVideoEncodeH264SliceHeader *pStdSliceHeader; -} VkVideoEncodeH264NaluSliceInfoKHR; - -typedef struct VkVideoEncodeH264PictureInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t naluSliceEntryCount; - const VkVideoEncodeH264NaluSliceInfoKHR *pNaluSliceEntries; - const StdVideoEncodeH264PictureInfo *pStdPictureInfo; - VkBool32 generatePrefixNalu; -} VkVideoEncodeH264PictureInfoKHR; - -typedef struct VkVideoEncodeH264SessionParametersAddInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t stdSPSCount; - const StdVideoH264SequenceParameterSet *pStdSPSs; - uint32_t stdPPSCount; - const StdVideoH264PictureParameterSet *pStdPPSs; -} VkVideoEncodeH264SessionParametersAddInfoKHR; - -typedef struct VkVideoEncodeH264SessionParametersCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t maxStdSPSCount; - uint32_t maxStdPPSCount; - const VkVideoEncodeH264SessionParametersAddInfoKHR *pParametersAddInfo; -} VkVideoEncodeH264SessionParametersCreateInfoKHR; - -typedef struct VkVideoEncodeH265NaluSliceSegmentInfoKHR -{ - VkStructureType sType; - const void *pNext; - int32_t constantQp; - const StdVideoEncodeH265SliceSegmentHeader *pStdSliceSegmentHeader; -} VkVideoEncodeH265NaluSliceSegmentInfoKHR; - -typedef struct VkVideoEncodeH265PictureInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t naluSliceSegmentEntryCount; - const VkVideoEncodeH265NaluSliceSegmentInfoKHR *pNaluSliceSegmentEntries; - const StdVideoEncodeH265PictureInfo *pStdPictureInfo; -} VkVideoEncodeH265PictureInfoKHR; - -typedef struct VkVideoEncodeH265SessionParametersAddInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t stdVPSCount; - const StdVideoH265VideoParameterSet *pStdVPSs; - uint32_t stdSPSCount; - const StdVideoH265SequenceParameterSet *pStdSPSs; - uint32_t stdPPSCount; - const StdVideoH265PictureParameterSet *pStdPPSs; -} VkVideoEncodeH265SessionParametersAddInfoKHR; - -typedef struct VkVideoEncodeH265SessionParametersCreateInfoKHR -{ - VkStructureType sType; - const void *pNext; - uint32_t maxStdVPSCount; - uint32_t maxStdSPSCount; - uint32_t maxStdPPSCount; - const VkVideoEncodeH265SessionParametersAddInfoKHR *pParametersAddInfo; -} VkVideoEncodeH265SessionParametersCreateInfoKHR; - -typedef struct VkAccelerationStructureBuildGeometryInfoKHR -{ - VkStructureType sType; - const void *pNext; - VkAccelerationStructureTypeKHR type; - VkBuildAccelerationStructureFlagsKHR flags; - VkBuildAccelerationStructureModeKHR mode; - VkAccelerationStructureKHR WINE_VK_ALIGN(8) srcAccelerationStructure; - VkAccelerationStructureKHR WINE_VK_ALIGN(8) dstAccelerationStructure; - uint32_t geometryCount; - const VkAccelerationStructureGeometryKHR *pGeometries; - const VkAccelerationStructureGeometryKHR * const*ppGeometries; - VkDeviceOrHostAddressKHR WINE_VK_ALIGN(8) scratchData; -} VkAccelerationStructureBuildGeometryInfoKHR; - -typedef struct VkAccelerationStructureCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - VkDeviceSize WINE_VK_ALIGN(8) compactedSize; - VkAccelerationStructureInfoNV info; -} VkAccelerationStructureCreateInfoNV; - -typedef struct VkComputePipelineCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineCreateFlags flags; - VkPipelineShaderStageCreateInfo WINE_VK_ALIGN(8) stage; - VkPipelineLayout WINE_VK_ALIGN(8) layout; - VkPipeline WINE_VK_ALIGN(8) basePipelineHandle; - int32_t basePipelineIndex; -} VkComputePipelineCreateInfo; - -typedef struct VkGraphicsPipelineCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineCreateFlags flags; - uint32_t stageCount; - const VkPipelineShaderStageCreateInfo *pStages; - const VkPipelineVertexInputStateCreateInfo *pVertexInputState; - const VkPipelineInputAssemblyStateCreateInfo *pInputAssemblyState; - const VkPipelineTessellationStateCreateInfo *pTessellationState; - const VkPipelineViewportStateCreateInfo *pViewportState; - const VkPipelineRasterizationStateCreateInfo *pRasterizationState; - const VkPipelineMultisampleStateCreateInfo *pMultisampleState; - const VkPipelineDepthStencilStateCreateInfo *pDepthStencilState; - const VkPipelineColorBlendStateCreateInfo *pColorBlendState; - const VkPipelineDynamicStateCreateInfo *pDynamicState; - VkPipelineLayout WINE_VK_ALIGN(8) layout; - VkRenderPass WINE_VK_ALIGN(8) renderPass; - uint32_t subpass; - VkPipeline WINE_VK_ALIGN(8) basePipelineHandle; - int32_t basePipelineIndex; -} VkGraphicsPipelineCreateInfo; - -typedef struct VkGraphicsShaderGroupCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - uint32_t stageCount; - const VkPipelineShaderStageCreateInfo *pStages; - const VkPipelineVertexInputStateCreateInfo *pVertexInputState; - const VkPipelineTessellationStateCreateInfo *pTessellationState; -} VkGraphicsShaderGroupCreateInfoNV; - -typedef struct VkIndirectCommandsLayoutCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkIndirectCommandsLayoutUsageFlagsEXT flags; - VkShaderStageFlags shaderStages; - uint32_t indirectStride; - VkPipelineLayout WINE_VK_ALIGN(8) pipelineLayout; - uint32_t tokenCount; - const VkIndirectCommandsLayoutTokenEXT *pTokens; -} VkIndirectCommandsLayoutCreateInfoEXT; - -typedef struct VkIndirectExecutionSetCreateInfoEXT -{ - VkStructureType sType; - const void *pNext; - VkIndirectExecutionSetInfoTypeEXT type; - VkIndirectExecutionSetInfoEXT info; -} VkIndirectExecutionSetCreateInfoEXT; - -typedef struct VkGraphicsPipelineShaderGroupsCreateInfoNV -{ - VkStructureType sType; - const void *pNext; - uint32_t groupCount; - const VkGraphicsShaderGroupCreateInfoNV *pGroups; - uint32_t pipelineCount; - const VkPipeline *pPipelines; -} VkGraphicsPipelineShaderGroupsCreateInfoNV; - -typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImage2KHR)(VkDevice, const VkAcquireNextImageInfoKHR *, uint32_t *); -typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImageKHR)(VkDevice, VkSwapchainKHR, uint64_t, VkSemaphore, VkFence, uint32_t *); -typedef VkResult (VKAPI_PTR *PFN_vkAcquirePerformanceConfigurationINTEL)(VkDevice, const VkPerformanceConfigurationAcquireInfoINTEL *, VkPerformanceConfigurationINTEL *); -typedef VkResult (VKAPI_PTR *PFN_vkAcquireProfilingLockKHR)(VkDevice, const VkAcquireProfilingLockInfoKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkAllocateCommandBuffers)(VkDevice, const VkCommandBufferAllocateInfo *, VkCommandBuffer *); -typedef VkResult (VKAPI_PTR *PFN_vkAllocateDescriptorSets)(VkDevice, const VkDescriptorSetAllocateInfo *, VkDescriptorSet *); -typedef VkResult (VKAPI_PTR *PFN_vkAllocateMemory)(VkDevice, const VkMemoryAllocateInfo *, const VkAllocationCallbacks *, VkDeviceMemory *); -typedef void (VKAPI_PTR *PFN_vkAntiLagUpdateAMD)(VkDevice, const VkAntiLagDataAMD *); -typedef VkResult (VKAPI_PTR *PFN_vkBeginCommandBuffer)(VkCommandBuffer, const VkCommandBufferBeginInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkBindAccelerationStructureMemoryNV)(VkDevice, uint32_t, const VkBindAccelerationStructureMemoryInfoNV *); -typedef VkResult (VKAPI_PTR *PFN_vkBindBufferMemory)(VkDevice, VkBuffer, VkDeviceMemory, VkDeviceSize); -typedef VkResult (VKAPI_PTR *PFN_vkBindBufferMemory2)(VkDevice, uint32_t, const VkBindBufferMemoryInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkBindBufferMemory2KHR)(VkDevice, uint32_t, const VkBindBufferMemoryInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkBindImageMemory)(VkDevice, VkImage, VkDeviceMemory, VkDeviceSize); -typedef VkResult (VKAPI_PTR *PFN_vkBindImageMemory2)(VkDevice, uint32_t, const VkBindImageMemoryInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkBindImageMemory2KHR)(VkDevice, uint32_t, const VkBindImageMemoryInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkBindOpticalFlowSessionImageNV)(VkDevice, VkOpticalFlowSessionNV, VkOpticalFlowSessionBindingPointNV, VkImageView, VkImageLayout); -typedef VkResult (VKAPI_PTR *PFN_vkBindVideoSessionMemoryKHR)(VkDevice, VkVideoSessionKHR, uint32_t, const VkBindVideoSessionMemoryInfoKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkBuildAccelerationStructuresKHR)(VkDevice, VkDeferredOperationKHR, uint32_t, const VkAccelerationStructureBuildGeometryInfoKHR *, const VkAccelerationStructureBuildRangeInfoKHR * const*); -typedef VkResult (VKAPI_PTR *PFN_vkBuildMicromapsEXT)(VkDevice, VkDeferredOperationKHR, uint32_t, const VkMicromapBuildInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdBeginConditionalRenderingEXT)(VkCommandBuffer, const VkConditionalRenderingBeginInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdBeginDebugUtilsLabelEXT)(VkCommandBuffer, const VkDebugUtilsLabelEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdBeginQuery)(VkCommandBuffer, VkQueryPool, uint32_t, VkQueryControlFlags); -typedef void (VKAPI_PTR *PFN_vkCmdBeginQueryIndexedEXT)(VkCommandBuffer, VkQueryPool, uint32_t, VkQueryControlFlags, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdBeginRenderPass)(VkCommandBuffer, const VkRenderPassBeginInfo *, VkSubpassContents); -typedef void (VKAPI_PTR *PFN_vkCmdBeginRenderPass2)(VkCommandBuffer, const VkRenderPassBeginInfo *, const VkSubpassBeginInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdBeginRenderPass2KHR)(VkCommandBuffer, const VkRenderPassBeginInfo *, const VkSubpassBeginInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdBeginRendering)(VkCommandBuffer, const VkRenderingInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdBeginRenderingKHR)(VkCommandBuffer, const VkRenderingInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdBeginTransformFeedbackEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer *, const VkDeviceSize *); -typedef void (VKAPI_PTR *PFN_vkCmdBeginVideoCodingKHR)(VkCommandBuffer, const VkVideoBeginCodingInfoKHR *); -typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorBufferEmbeddedSamplers2EXT)(VkCommandBuffer, const VkBindDescriptorBufferEmbeddedSamplersInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorBufferEmbeddedSamplersEXT)(VkCommandBuffer, VkPipelineBindPoint, VkPipelineLayout, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorBuffersEXT)(VkCommandBuffer, uint32_t, const VkDescriptorBufferBindingInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorSets)(VkCommandBuffer, VkPipelineBindPoint, VkPipelineLayout, uint32_t, uint32_t, const VkDescriptorSet *, uint32_t, const uint32_t *); -typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorSets2)(VkCommandBuffer, const VkBindDescriptorSetsInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorSets2KHR)(VkCommandBuffer, const VkBindDescriptorSetsInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdBindIndexBuffer)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkIndexType); -typedef void (VKAPI_PTR *PFN_vkCmdBindIndexBuffer2)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkDeviceSize, VkIndexType); -typedef void (VKAPI_PTR *PFN_vkCmdBindIndexBuffer2KHR)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkDeviceSize, VkIndexType); -typedef void (VKAPI_PTR *PFN_vkCmdBindInvocationMaskHUAWEI)(VkCommandBuffer, VkImageView, VkImageLayout); -typedef void (VKAPI_PTR *PFN_vkCmdBindPipeline)(VkCommandBuffer, VkPipelineBindPoint, VkPipeline); -typedef void (VKAPI_PTR *PFN_vkCmdBindPipelineShaderGroupNV)(VkCommandBuffer, VkPipelineBindPoint, VkPipeline, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdBindShadersEXT)(VkCommandBuffer, uint32_t, const VkShaderStageFlagBits *, const VkShaderEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdBindShadingRateImageNV)(VkCommandBuffer, VkImageView, VkImageLayout); -typedef void (VKAPI_PTR *PFN_vkCmdBindTransformFeedbackBuffersEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer *, const VkDeviceSize *, const VkDeviceSize *); -typedef void (VKAPI_PTR *PFN_vkCmdBindVertexBuffers)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer *, const VkDeviceSize *); -typedef void (VKAPI_PTR *PFN_vkCmdBindVertexBuffers2)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer *, const VkDeviceSize *, const VkDeviceSize *, const VkDeviceSize *); -typedef void (VKAPI_PTR *PFN_vkCmdBindVertexBuffers2EXT)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer *, const VkDeviceSize *, const VkDeviceSize *, const VkDeviceSize *); -typedef void (VKAPI_PTR *PFN_vkCmdBlitImage)(VkCommandBuffer, VkImage, VkImageLayout, VkImage, VkImageLayout, uint32_t, const VkImageBlit *, VkFilter); -typedef void (VKAPI_PTR *PFN_vkCmdBlitImage2)(VkCommandBuffer, const VkBlitImageInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdBlitImage2KHR)(VkCommandBuffer, const VkBlitImageInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdBuildAccelerationStructureNV)(VkCommandBuffer, const VkAccelerationStructureInfoNV *, VkBuffer, VkDeviceSize, VkBool32, VkAccelerationStructureNV, VkAccelerationStructureNV, VkBuffer, VkDeviceSize); -typedef void (VKAPI_PTR *PFN_vkCmdBuildAccelerationStructuresIndirectKHR)(VkCommandBuffer, uint32_t, const VkAccelerationStructureBuildGeometryInfoKHR *, const VkDeviceAddress *, const uint32_t *, const uint32_t * const*); -typedef void (VKAPI_PTR *PFN_vkCmdBuildAccelerationStructuresKHR)(VkCommandBuffer, uint32_t, const VkAccelerationStructureBuildGeometryInfoKHR *, const VkAccelerationStructureBuildRangeInfoKHR * const*); -typedef void (VKAPI_PTR *PFN_vkCmdBuildMicromapsEXT)(VkCommandBuffer, uint32_t, const VkMicromapBuildInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdClearAttachments)(VkCommandBuffer, uint32_t, const VkClearAttachment *, uint32_t, const VkClearRect *); -typedef void (VKAPI_PTR *PFN_vkCmdClearColorImage)(VkCommandBuffer, VkImage, VkImageLayout, const VkClearColorValue *, uint32_t, const VkImageSubresourceRange *); -typedef void (VKAPI_PTR *PFN_vkCmdClearDepthStencilImage)(VkCommandBuffer, VkImage, VkImageLayout, const VkClearDepthStencilValue *, uint32_t, const VkImageSubresourceRange *); -typedef void (VKAPI_PTR *PFN_vkCmdControlVideoCodingKHR)(VkCommandBuffer, const VkVideoCodingControlInfoKHR *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyAccelerationStructureKHR)(VkCommandBuffer, const VkCopyAccelerationStructureInfoKHR *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyAccelerationStructureNV)(VkCommandBuffer, VkAccelerationStructureNV, VkAccelerationStructureNV, VkCopyAccelerationStructureModeKHR); -typedef void (VKAPI_PTR *PFN_vkCmdCopyAccelerationStructureToMemoryKHR)(VkCommandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyBuffer)(VkCommandBuffer, VkBuffer, VkBuffer, uint32_t, const VkBufferCopy *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyBuffer2)(VkCommandBuffer, const VkCopyBufferInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyBuffer2KHR)(VkCommandBuffer, const VkCopyBufferInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyBufferToImage)(VkCommandBuffer, VkBuffer, VkImage, VkImageLayout, uint32_t, const VkBufferImageCopy *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyBufferToImage2)(VkCommandBuffer, const VkCopyBufferToImageInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyBufferToImage2KHR)(VkCommandBuffer, const VkCopyBufferToImageInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyImage)(VkCommandBuffer, VkImage, VkImageLayout, VkImage, VkImageLayout, uint32_t, const VkImageCopy *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyImage2)(VkCommandBuffer, const VkCopyImageInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyImage2KHR)(VkCommandBuffer, const VkCopyImageInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyImageToBuffer)(VkCommandBuffer, VkImage, VkImageLayout, VkBuffer, uint32_t, const VkBufferImageCopy *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyImageToBuffer2)(VkCommandBuffer, const VkCopyImageToBufferInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyImageToBuffer2KHR)(VkCommandBuffer, const VkCopyImageToBufferInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyMemoryIndirectNV)(VkCommandBuffer, VkDeviceAddress, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdCopyMemoryToAccelerationStructureKHR)(VkCommandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyMemoryToImageIndirectNV)(VkCommandBuffer, VkDeviceAddress, uint32_t, uint32_t, VkImage, VkImageLayout, const VkImageSubresourceLayers *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyMemoryToMicromapEXT)(VkCommandBuffer, const VkCopyMemoryToMicromapInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyMicromapEXT)(VkCommandBuffer, const VkCopyMicromapInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyMicromapToMemoryEXT)(VkCommandBuffer, const VkCopyMicromapToMemoryInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdCopyQueryPoolResults)(VkCommandBuffer, VkQueryPool, uint32_t, uint32_t, VkBuffer, VkDeviceSize, VkDeviceSize, VkQueryResultFlags); -typedef void (VKAPI_PTR *PFN_vkCmdCuLaunchKernelNVX)(VkCommandBuffer, const VkCuLaunchInfoNVX *); -typedef void (VKAPI_PTR *PFN_vkCmdCudaLaunchKernelNV)(VkCommandBuffer, const VkCudaLaunchInfoNV *); -typedef void (VKAPI_PTR *PFN_vkCmdDebugMarkerBeginEXT)(VkCommandBuffer, const VkDebugMarkerMarkerInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdDebugMarkerEndEXT)(VkCommandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdDebugMarkerInsertEXT)(VkCommandBuffer, const VkDebugMarkerMarkerInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdDecodeVideoKHR)(VkCommandBuffer, const VkVideoDecodeInfoKHR *); -typedef void (VKAPI_PTR *PFN_vkCmdDecompressMemoryIndirectCountNV)(VkCommandBuffer, VkDeviceAddress, VkDeviceAddress, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDecompressMemoryNV)(VkCommandBuffer, uint32_t, const VkDecompressMemoryRegionNV *); -typedef void (VKAPI_PTR *PFN_vkCmdDispatch)(VkCommandBuffer, uint32_t, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDispatchBase)(VkCommandBuffer, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDispatchBaseKHR)(VkCommandBuffer, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDispatchIndirect)(VkCommandBuffer, VkBuffer, VkDeviceSize); -typedef void (VKAPI_PTR *PFN_vkCmdDraw)(VkCommandBuffer, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawClusterHUAWEI)(VkCommandBuffer, uint32_t, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawClusterIndirectHUAWEI)(VkCommandBuffer, VkBuffer, VkDeviceSize); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexed)(VkCommandBuffer, uint32_t, uint32_t, uint32_t, int32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirect)(VkCommandBuffer, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirectCount)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirectCountAMD)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirectCountKHR)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirect)(VkCommandBuffer, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirectByteCountEXT)(VkCommandBuffer, uint32_t, uint32_t, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirectCount)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirectCountAMD)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirectCountKHR)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksEXT)(VkCommandBuffer, uint32_t, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksIndirectCountEXT)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksIndirectCountNV)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksIndirectEXT)(VkCommandBuffer, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksIndirectNV)(VkCommandBuffer, VkBuffer, VkDeviceSize, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksNV)(VkCommandBuffer, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawMultiEXT)(VkCommandBuffer, uint32_t, const VkMultiDrawInfoEXT *, uint32_t, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdDrawMultiIndexedEXT)(VkCommandBuffer, uint32_t, const VkMultiDrawIndexedInfoEXT *, uint32_t, uint32_t, uint32_t, const int32_t *); -typedef void (VKAPI_PTR *PFN_vkCmdEncodeVideoKHR)(VkCommandBuffer, const VkVideoEncodeInfoKHR *); -typedef void (VKAPI_PTR *PFN_vkCmdEndConditionalRenderingEXT)(VkCommandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdEndDebugUtilsLabelEXT)(VkCommandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdEndQuery)(VkCommandBuffer, VkQueryPool, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdEndQueryIndexedEXT)(VkCommandBuffer, VkQueryPool, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdEndRenderPass)(VkCommandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdEndRenderPass2)(VkCommandBuffer, const VkSubpassEndInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdEndRenderPass2KHR)(VkCommandBuffer, const VkSubpassEndInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdEndRendering)(VkCommandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdEndRenderingKHR)(VkCommandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdEndTransformFeedbackEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer *, const VkDeviceSize *); -typedef void (VKAPI_PTR *PFN_vkCmdEndVideoCodingKHR)(VkCommandBuffer, const VkVideoEndCodingInfoKHR *); -typedef void (VKAPI_PTR *PFN_vkCmdExecuteCommands)(VkCommandBuffer, uint32_t, const VkCommandBuffer *); -typedef void (VKAPI_PTR *PFN_vkCmdExecuteGeneratedCommandsEXT)(VkCommandBuffer, VkBool32, const VkGeneratedCommandsInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdExecuteGeneratedCommandsNV)(VkCommandBuffer, VkBool32, const VkGeneratedCommandsInfoNV *); -typedef void (VKAPI_PTR *PFN_vkCmdFillBuffer)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkDeviceSize, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdInsertDebugUtilsLabelEXT)(VkCommandBuffer, const VkDebugUtilsLabelEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdNextSubpass)(VkCommandBuffer, VkSubpassContents); -typedef void (VKAPI_PTR *PFN_vkCmdNextSubpass2)(VkCommandBuffer, const VkSubpassBeginInfo *, const VkSubpassEndInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdNextSubpass2KHR)(VkCommandBuffer, const VkSubpassBeginInfo *, const VkSubpassEndInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdOpticalFlowExecuteNV)(VkCommandBuffer, VkOpticalFlowSessionNV, const VkOpticalFlowExecuteInfoNV *); -typedef void (VKAPI_PTR *PFN_vkCmdPipelineBarrier)(VkCommandBuffer, VkPipelineStageFlags, VkPipelineStageFlags, VkDependencyFlags, uint32_t, const VkMemoryBarrier *, uint32_t, const VkBufferMemoryBarrier *, uint32_t, const VkImageMemoryBarrier *); -typedef void (VKAPI_PTR *PFN_vkCmdPipelineBarrier2)(VkCommandBuffer, const VkDependencyInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdPipelineBarrier2KHR)(VkCommandBuffer, const VkDependencyInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdPreprocessGeneratedCommandsEXT)(VkCommandBuffer, const VkGeneratedCommandsInfoEXT *, VkCommandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdPreprocessGeneratedCommandsNV)(VkCommandBuffer, const VkGeneratedCommandsInfoNV *); -typedef void (VKAPI_PTR *PFN_vkCmdPushConstants)(VkCommandBuffer, VkPipelineLayout, VkShaderStageFlags, uint32_t, uint32_t, const void *); -typedef void (VKAPI_PTR *PFN_vkCmdPushConstants2)(VkCommandBuffer, const VkPushConstantsInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdPushConstants2KHR)(VkCommandBuffer, const VkPushConstantsInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSet)(VkCommandBuffer, VkPipelineBindPoint, VkPipelineLayout, uint32_t, uint32_t, const VkWriteDescriptorSet *); -typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSet2)(VkCommandBuffer, const VkPushDescriptorSetInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSet2KHR)(VkCommandBuffer, const VkPushDescriptorSetInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetKHR)(VkCommandBuffer, VkPipelineBindPoint, VkPipelineLayout, uint32_t, uint32_t, const VkWriteDescriptorSet *); -typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetWithTemplate)(VkCommandBuffer, VkDescriptorUpdateTemplate, VkPipelineLayout, uint32_t, const void *); -typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetWithTemplate2)(VkCommandBuffer, const VkPushDescriptorSetWithTemplateInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetWithTemplate2KHR)(VkCommandBuffer, const VkPushDescriptorSetWithTemplateInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetWithTemplateKHR)(VkCommandBuffer, VkDescriptorUpdateTemplate, VkPipelineLayout, uint32_t, const void *); -typedef void (VKAPI_PTR *PFN_vkCmdResetEvent)(VkCommandBuffer, VkEvent, VkPipelineStageFlags); -typedef void (VKAPI_PTR *PFN_vkCmdResetEvent2)(VkCommandBuffer, VkEvent, VkPipelineStageFlags2); -typedef void (VKAPI_PTR *PFN_vkCmdResetEvent2KHR)(VkCommandBuffer, VkEvent, VkPipelineStageFlags2); -typedef void (VKAPI_PTR *PFN_vkCmdResetQueryPool)(VkCommandBuffer, VkQueryPool, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdResolveImage)(VkCommandBuffer, VkImage, VkImageLayout, VkImage, VkImageLayout, uint32_t, const VkImageResolve *); -typedef void (VKAPI_PTR *PFN_vkCmdResolveImage2)(VkCommandBuffer, const VkResolveImageInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdResolveImage2KHR)(VkCommandBuffer, const VkResolveImageInfo2 *); -typedef void (VKAPI_PTR *PFN_vkCmdSetAlphaToCoverageEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetAlphaToOneEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetAttachmentFeedbackLoopEnableEXT)(VkCommandBuffer, VkImageAspectFlags); -typedef void (VKAPI_PTR *PFN_vkCmdSetBlendConstants)(VkCommandBuffer, const float[4]); -typedef void (VKAPI_PTR *PFN_vkCmdSetCheckpointNV)(VkCommandBuffer, const void *); -typedef void (VKAPI_PTR *PFN_vkCmdSetCoarseSampleOrderNV)(VkCommandBuffer, VkCoarseSampleOrderTypeNV, uint32_t, const VkCoarseSampleOrderCustomNV *); -typedef void (VKAPI_PTR *PFN_vkCmdSetColorBlendAdvancedEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkColorBlendAdvancedEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdSetColorBlendEnableEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkBool32 *); -typedef void (VKAPI_PTR *PFN_vkCmdSetColorBlendEquationEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkColorBlendEquationEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdSetColorWriteEnableEXT)(VkCommandBuffer, uint32_t, const VkBool32 *); -typedef void (VKAPI_PTR *PFN_vkCmdSetColorWriteMaskEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkColorComponentFlags *); -typedef void (VKAPI_PTR *PFN_vkCmdSetConservativeRasterizationModeEXT)(VkCommandBuffer, VkConservativeRasterizationModeEXT); -typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageModulationModeNV)(VkCommandBuffer, VkCoverageModulationModeNV); -typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageModulationTableEnableNV)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageModulationTableNV)(VkCommandBuffer, uint32_t, const float *); -typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageReductionModeNV)(VkCommandBuffer, VkCoverageReductionModeNV); -typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageToColorEnableNV)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageToColorLocationNV)(VkCommandBuffer, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetCullMode)(VkCommandBuffer, VkCullModeFlags); -typedef void (VKAPI_PTR *PFN_vkCmdSetCullModeEXT)(VkCommandBuffer, VkCullModeFlags); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBias)(VkCommandBuffer, float, float, float); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBias2EXT)(VkCommandBuffer, const VkDepthBiasInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBiasEnable)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBiasEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBounds)(VkCommandBuffer, float, float); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBoundsTestEnable)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBoundsTestEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthClampEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthClampRangeEXT)(VkCommandBuffer, VkDepthClampModeEXT, const VkDepthClampRangeEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthClipEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthClipNegativeOneToOneEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthCompareOp)(VkCommandBuffer, VkCompareOp); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthCompareOpEXT)(VkCommandBuffer, VkCompareOp); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthTestEnable)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthTestEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthWriteEnable)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthWriteEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDescriptorBufferOffsets2EXT)(VkCommandBuffer, const VkSetDescriptorBufferOffsetsInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdSetDescriptorBufferOffsetsEXT)(VkCommandBuffer, VkPipelineBindPoint, VkPipelineLayout, uint32_t, uint32_t, const uint32_t *, const VkDeviceSize *); -typedef void (VKAPI_PTR *PFN_vkCmdSetDeviceMask)(VkCommandBuffer, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetDeviceMaskKHR)(VkCommandBuffer, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkRect2D *); -typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleModeEXT)(VkCommandBuffer, VkDiscardRectangleModeEXT); -typedef void (VKAPI_PTR *PFN_vkCmdSetEvent)(VkCommandBuffer, VkEvent, VkPipelineStageFlags); -typedef void (VKAPI_PTR *PFN_vkCmdSetEvent2)(VkCommandBuffer, VkEvent, const VkDependencyInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdSetEvent2KHR)(VkCommandBuffer, VkEvent, const VkDependencyInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdSetExclusiveScissorEnableNV)(VkCommandBuffer, uint32_t, uint32_t, const VkBool32 *); -typedef void (VKAPI_PTR *PFN_vkCmdSetExclusiveScissorNV)(VkCommandBuffer, uint32_t, uint32_t, const VkRect2D *); -typedef void (VKAPI_PTR *PFN_vkCmdSetExtraPrimitiveOverestimationSizeEXT)(VkCommandBuffer, float); -typedef void (VKAPI_PTR *PFN_vkCmdSetFragmentShadingRateEnumNV)(VkCommandBuffer, VkFragmentShadingRateNV, const VkFragmentShadingRateCombinerOpKHR[2]); -typedef void (VKAPI_PTR *PFN_vkCmdSetFragmentShadingRateKHR)(VkCommandBuffer, const VkExtent2D *, const VkFragmentShadingRateCombinerOpKHR[2]); -typedef void (VKAPI_PTR *PFN_vkCmdSetFrontFace)(VkCommandBuffer, VkFrontFace); -typedef void (VKAPI_PTR *PFN_vkCmdSetFrontFaceEXT)(VkCommandBuffer, VkFrontFace); -typedef void (VKAPI_PTR *PFN_vkCmdSetLineRasterizationModeEXT)(VkCommandBuffer, VkLineRasterizationModeEXT); -typedef void (VKAPI_PTR *PFN_vkCmdSetLineStipple)(VkCommandBuffer, uint32_t, uint16_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetLineStippleEXT)(VkCommandBuffer, uint32_t, uint16_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetLineStippleEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetLineStippleKHR)(VkCommandBuffer, uint32_t, uint16_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetLineWidth)(VkCommandBuffer, float); -typedef void (VKAPI_PTR *PFN_vkCmdSetLogicOpEXT)(VkCommandBuffer, VkLogicOp); -typedef void (VKAPI_PTR *PFN_vkCmdSetLogicOpEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetPatchControlPointsEXT)(VkCommandBuffer, uint32_t); -typedef VkResult (VKAPI_PTR *PFN_vkCmdSetPerformanceMarkerINTEL)(VkCommandBuffer, const VkPerformanceMarkerInfoINTEL *); -typedef VkResult (VKAPI_PTR *PFN_vkCmdSetPerformanceOverrideINTEL)(VkCommandBuffer, const VkPerformanceOverrideInfoINTEL *); -typedef VkResult (VKAPI_PTR *PFN_vkCmdSetPerformanceStreamMarkerINTEL)(VkCommandBuffer, const VkPerformanceStreamMarkerInfoINTEL *); -typedef void (VKAPI_PTR *PFN_vkCmdSetPolygonModeEXT)(VkCommandBuffer, VkPolygonMode); -typedef void (VKAPI_PTR *PFN_vkCmdSetPrimitiveRestartEnable)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetPrimitiveRestartEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetPrimitiveTopology)(VkCommandBuffer, VkPrimitiveTopology); -typedef void (VKAPI_PTR *PFN_vkCmdSetPrimitiveTopologyEXT)(VkCommandBuffer, VkPrimitiveTopology); -typedef void (VKAPI_PTR *PFN_vkCmdSetProvokingVertexModeEXT)(VkCommandBuffer, VkProvokingVertexModeEXT); -typedef void (VKAPI_PTR *PFN_vkCmdSetRasterizationSamplesEXT)(VkCommandBuffer, VkSampleCountFlagBits); -typedef void (VKAPI_PTR *PFN_vkCmdSetRasterizationStreamEXT)(VkCommandBuffer, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetRasterizerDiscardEnable)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetRasterizerDiscardEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetRayTracingPipelineStackSizeKHR)(VkCommandBuffer, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetRenderingAttachmentLocations)(VkCommandBuffer, const VkRenderingAttachmentLocationInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdSetRenderingAttachmentLocationsKHR)(VkCommandBuffer, const VkRenderingAttachmentLocationInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdSetRenderingInputAttachmentIndices)(VkCommandBuffer, const VkRenderingInputAttachmentIndexInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdSetRenderingInputAttachmentIndicesKHR)(VkCommandBuffer, const VkRenderingInputAttachmentIndexInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdSetRepresentativeFragmentTestEnableNV)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetSampleLocationsEXT)(VkCommandBuffer, const VkSampleLocationsInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkCmdSetSampleLocationsEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetSampleMaskEXT)(VkCommandBuffer, VkSampleCountFlagBits, const VkSampleMask *); -typedef void (VKAPI_PTR *PFN_vkCmdSetScissor)(VkCommandBuffer, uint32_t, uint32_t, const VkRect2D *); -typedef void (VKAPI_PTR *PFN_vkCmdSetScissorWithCount)(VkCommandBuffer, uint32_t, const VkRect2D *); -typedef void (VKAPI_PTR *PFN_vkCmdSetScissorWithCountEXT)(VkCommandBuffer, uint32_t, const VkRect2D *); -typedef void (VKAPI_PTR *PFN_vkCmdSetShadingRateImageEnableNV)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilCompareMask)(VkCommandBuffer, VkStencilFaceFlags, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilOp)(VkCommandBuffer, VkStencilFaceFlags, VkStencilOp, VkStencilOp, VkStencilOp, VkCompareOp); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilOpEXT)(VkCommandBuffer, VkStencilFaceFlags, VkStencilOp, VkStencilOp, VkStencilOp, VkCompareOp); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilReference)(VkCommandBuffer, VkStencilFaceFlags, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilTestEnable)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilTestEnableEXT)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilWriteMask)(VkCommandBuffer, VkStencilFaceFlags, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdSetTessellationDomainOriginEXT)(VkCommandBuffer, VkTessellationDomainOrigin); -typedef void (VKAPI_PTR *PFN_vkCmdSetVertexInputEXT)(VkCommandBuffer, uint32_t, const VkVertexInputBindingDescription2EXT *, uint32_t, const VkVertexInputAttributeDescription2EXT *); -typedef void (VKAPI_PTR *PFN_vkCmdSetViewport)(VkCommandBuffer, uint32_t, uint32_t, const VkViewport *); -typedef void (VKAPI_PTR *PFN_vkCmdSetViewportShadingRatePaletteNV)(VkCommandBuffer, uint32_t, uint32_t, const VkShadingRatePaletteNV *); -typedef void (VKAPI_PTR *PFN_vkCmdSetViewportSwizzleNV)(VkCommandBuffer, uint32_t, uint32_t, const VkViewportSwizzleNV *); -typedef void (VKAPI_PTR *PFN_vkCmdSetViewportWScalingEnableNV)(VkCommandBuffer, VkBool32); -typedef void (VKAPI_PTR *PFN_vkCmdSetViewportWScalingNV)(VkCommandBuffer, uint32_t, uint32_t, const VkViewportWScalingNV *); -typedef void (VKAPI_PTR *PFN_vkCmdSetViewportWithCount)(VkCommandBuffer, uint32_t, const VkViewport *); -typedef void (VKAPI_PTR *PFN_vkCmdSetViewportWithCountEXT)(VkCommandBuffer, uint32_t, const VkViewport *); -typedef void (VKAPI_PTR *PFN_vkCmdSubpassShadingHUAWEI)(VkCommandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdTraceRaysIndirect2KHR)(VkCommandBuffer, VkDeviceAddress); -typedef void (VKAPI_PTR *PFN_vkCmdTraceRaysIndirectKHR)(VkCommandBuffer, const VkStridedDeviceAddressRegionKHR *, const VkStridedDeviceAddressRegionKHR *, const VkStridedDeviceAddressRegionKHR *, const VkStridedDeviceAddressRegionKHR *, VkDeviceAddress); -typedef void (VKAPI_PTR *PFN_vkCmdTraceRaysKHR)(VkCommandBuffer, const VkStridedDeviceAddressRegionKHR *, const VkStridedDeviceAddressRegionKHR *, const VkStridedDeviceAddressRegionKHR *, const VkStridedDeviceAddressRegionKHR *, uint32_t, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdTraceRaysNV)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, VkDeviceSize, VkBuffer, VkDeviceSize, VkDeviceSize, VkBuffer, VkDeviceSize, VkDeviceSize, uint32_t, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdUpdateBuffer)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkDeviceSize, const void *); -typedef void (VKAPI_PTR *PFN_vkCmdUpdatePipelineIndirectBufferNV)(VkCommandBuffer, VkPipelineBindPoint, VkPipeline); -typedef void (VKAPI_PTR *PFN_vkCmdWaitEvents)(VkCommandBuffer, uint32_t, const VkEvent *, VkPipelineStageFlags, VkPipelineStageFlags, uint32_t, const VkMemoryBarrier *, uint32_t, const VkBufferMemoryBarrier *, uint32_t, const VkImageMemoryBarrier *); -typedef void (VKAPI_PTR *PFN_vkCmdWaitEvents2)(VkCommandBuffer, uint32_t, const VkEvent *, const VkDependencyInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdWaitEvents2KHR)(VkCommandBuffer, uint32_t, const VkEvent *, const VkDependencyInfo *); -typedef void (VKAPI_PTR *PFN_vkCmdWriteAccelerationStructuresPropertiesKHR)(VkCommandBuffer, uint32_t, const VkAccelerationStructureKHR *, VkQueryType, VkQueryPool, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdWriteAccelerationStructuresPropertiesNV)(VkCommandBuffer, uint32_t, const VkAccelerationStructureNV *, VkQueryType, VkQueryPool, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdWriteBufferMarker2AMD)(VkCommandBuffer, VkPipelineStageFlags2, VkBuffer, VkDeviceSize, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdWriteBufferMarkerAMD)(VkCommandBuffer, VkPipelineStageFlagBits, VkBuffer, VkDeviceSize, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdWriteMicromapsPropertiesEXT)(VkCommandBuffer, uint32_t, const VkMicromapEXT *, VkQueryType, VkQueryPool, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdWriteTimestamp)(VkCommandBuffer, VkPipelineStageFlagBits, VkQueryPool, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdWriteTimestamp2)(VkCommandBuffer, VkPipelineStageFlags2, VkQueryPool, uint32_t); -typedef void (VKAPI_PTR *PFN_vkCmdWriteTimestamp2KHR)(VkCommandBuffer, VkPipelineStageFlags2, VkQueryPool, uint32_t); -typedef VkResult (VKAPI_PTR *PFN_vkCompileDeferredNV)(VkDevice, VkPipeline, uint32_t); -typedef VkResult (VKAPI_PTR *PFN_vkCopyAccelerationStructureKHR)(VkDevice, VkDeferredOperationKHR, const VkCopyAccelerationStructureInfoKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyAccelerationStructureToMemoryKHR)(VkDevice, VkDeferredOperationKHR, const VkCopyAccelerationStructureToMemoryInfoKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyImageToImage)(VkDevice, const VkCopyImageToImageInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyImageToImageEXT)(VkDevice, const VkCopyImageToImageInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyImageToMemory)(VkDevice, const VkCopyImageToMemoryInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyImageToMemoryEXT)(VkDevice, const VkCopyImageToMemoryInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyMemoryToAccelerationStructureKHR)(VkDevice, VkDeferredOperationKHR, const VkCopyMemoryToAccelerationStructureInfoKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyMemoryToImage)(VkDevice, const VkCopyMemoryToImageInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyMemoryToImageEXT)(VkDevice, const VkCopyMemoryToImageInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyMemoryToMicromapEXT)(VkDevice, VkDeferredOperationKHR, const VkCopyMemoryToMicromapInfoEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyMicromapEXT)(VkDevice, VkDeferredOperationKHR, const VkCopyMicromapInfoEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCopyMicromapToMemoryEXT)(VkDevice, VkDeferredOperationKHR, const VkCopyMicromapToMemoryInfoEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateAccelerationStructureKHR)(VkDevice, const VkAccelerationStructureCreateInfoKHR *, const VkAllocationCallbacks *, VkAccelerationStructureKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateAccelerationStructureNV)(VkDevice, const VkAccelerationStructureCreateInfoNV *, const VkAllocationCallbacks *, VkAccelerationStructureNV *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateBuffer)(VkDevice, const VkBufferCreateInfo *, const VkAllocationCallbacks *, VkBuffer *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateBufferView)(VkDevice, const VkBufferViewCreateInfo *, const VkAllocationCallbacks *, VkBufferView *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateCommandPool)(VkDevice, const VkCommandPoolCreateInfo *, const VkAllocationCallbacks *, VkCommandPool *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateComputePipelines)(VkDevice, VkPipelineCache, uint32_t, const VkComputePipelineCreateInfo *, const VkAllocationCallbacks *, VkPipeline *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateCuFunctionNVX)(VkDevice, const VkCuFunctionCreateInfoNVX *, const VkAllocationCallbacks *, VkCuFunctionNVX *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateCuModuleNVX)(VkDevice, const VkCuModuleCreateInfoNVX *, const VkAllocationCallbacks *, VkCuModuleNVX *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateCudaFunctionNV)(VkDevice, const VkCudaFunctionCreateInfoNV *, const VkAllocationCallbacks *, VkCudaFunctionNV *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateCudaModuleNV)(VkDevice, const VkCudaModuleCreateInfoNV *, const VkAllocationCallbacks *, VkCudaModuleNV *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDebugReportCallbackEXT)(VkInstance, const VkDebugReportCallbackCreateInfoEXT *, const VkAllocationCallbacks *, VkDebugReportCallbackEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDebugUtilsMessengerEXT)(VkInstance, const VkDebugUtilsMessengerCreateInfoEXT *, const VkAllocationCallbacks *, VkDebugUtilsMessengerEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDeferredOperationKHR)(VkDevice, const VkAllocationCallbacks *, VkDeferredOperationKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorPool)(VkDevice, const VkDescriptorPoolCreateInfo *, const VkAllocationCallbacks *, VkDescriptorPool *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorSetLayout)(VkDevice, const VkDescriptorSetLayoutCreateInfo *, const VkAllocationCallbacks *, VkDescriptorSetLayout *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorUpdateTemplate)(VkDevice, const VkDescriptorUpdateTemplateCreateInfo *, const VkAllocationCallbacks *, VkDescriptorUpdateTemplate *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorUpdateTemplateKHR)(VkDevice, const VkDescriptorUpdateTemplateCreateInfo *, const VkAllocationCallbacks *, VkDescriptorUpdateTemplate *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDevice)(VkPhysicalDevice, const VkDeviceCreateInfo *, const VkAllocationCallbacks *, VkDevice *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateEvent)(VkDevice, const VkEventCreateInfo *, const VkAllocationCallbacks *, VkEvent *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateFence)(VkDevice, const VkFenceCreateInfo *, const VkAllocationCallbacks *, VkFence *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateFramebuffer)(VkDevice, const VkFramebufferCreateInfo *, const VkAllocationCallbacks *, VkFramebuffer *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateGraphicsPipelines)(VkDevice, VkPipelineCache, uint32_t, const VkGraphicsPipelineCreateInfo *, const VkAllocationCallbacks *, VkPipeline *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateImage)(VkDevice, const VkImageCreateInfo *, const VkAllocationCallbacks *, VkImage *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateImageView)(VkDevice, const VkImageViewCreateInfo *, const VkAllocationCallbacks *, VkImageView *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateIndirectCommandsLayoutEXT)(VkDevice, const VkIndirectCommandsLayoutCreateInfoEXT *, const VkAllocationCallbacks *, VkIndirectCommandsLayoutEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateIndirectCommandsLayoutNV)(VkDevice, const VkIndirectCommandsLayoutCreateInfoNV *, const VkAllocationCallbacks *, VkIndirectCommandsLayoutNV *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateIndirectExecutionSetEXT)(VkDevice, const VkIndirectExecutionSetCreateInfoEXT *, const VkAllocationCallbacks *, VkIndirectExecutionSetEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateInstance)(const VkInstanceCreateInfo *, const VkAllocationCallbacks *, VkInstance *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateMicromapEXT)(VkDevice, const VkMicromapCreateInfoEXT *, const VkAllocationCallbacks *, VkMicromapEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateOpticalFlowSessionNV)(VkDevice, const VkOpticalFlowSessionCreateInfoNV *, const VkAllocationCallbacks *, VkOpticalFlowSessionNV *); -typedef VkResult (VKAPI_PTR *PFN_vkCreatePipelineBinariesKHR)(VkDevice, const VkPipelineBinaryCreateInfoKHR *, const VkAllocationCallbacks *, VkPipelineBinaryHandlesInfoKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkCreatePipelineCache)(VkDevice, const VkPipelineCacheCreateInfo *, const VkAllocationCallbacks *, VkPipelineCache *); -typedef VkResult (VKAPI_PTR *PFN_vkCreatePipelineLayout)(VkDevice, const VkPipelineLayoutCreateInfo *, const VkAllocationCallbacks *, VkPipelineLayout *); -typedef VkResult (VKAPI_PTR *PFN_vkCreatePrivateDataSlot)(VkDevice, const VkPrivateDataSlotCreateInfo *, const VkAllocationCallbacks *, VkPrivateDataSlot *); -typedef VkResult (VKAPI_PTR *PFN_vkCreatePrivateDataSlotEXT)(VkDevice, const VkPrivateDataSlotCreateInfo *, const VkAllocationCallbacks *, VkPrivateDataSlot *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateQueryPool)(VkDevice, const VkQueryPoolCreateInfo *, const VkAllocationCallbacks *, VkQueryPool *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateRayTracingPipelinesKHR)(VkDevice, VkDeferredOperationKHR, VkPipelineCache, uint32_t, const VkRayTracingPipelineCreateInfoKHR *, const VkAllocationCallbacks *, VkPipeline *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateRayTracingPipelinesNV)(VkDevice, VkPipelineCache, uint32_t, const VkRayTracingPipelineCreateInfoNV *, const VkAllocationCallbacks *, VkPipeline *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateRenderPass)(VkDevice, const VkRenderPassCreateInfo *, const VkAllocationCallbacks *, VkRenderPass *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateRenderPass2)(VkDevice, const VkRenderPassCreateInfo2 *, const VkAllocationCallbacks *, VkRenderPass *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateRenderPass2KHR)(VkDevice, const VkRenderPassCreateInfo2 *, const VkAllocationCallbacks *, VkRenderPass *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateSampler)(VkDevice, const VkSamplerCreateInfo *, const VkAllocationCallbacks *, VkSampler *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateSamplerYcbcrConversion)(VkDevice, const VkSamplerYcbcrConversionCreateInfo *, const VkAllocationCallbacks *, VkSamplerYcbcrConversion *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateSamplerYcbcrConversionKHR)(VkDevice, const VkSamplerYcbcrConversionCreateInfo *, const VkAllocationCallbacks *, VkSamplerYcbcrConversion *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateSemaphore)(VkDevice, const VkSemaphoreCreateInfo *, const VkAllocationCallbacks *, VkSemaphore *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateShaderModule)(VkDevice, const VkShaderModuleCreateInfo *, const VkAllocationCallbacks *, VkShaderModule *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateShadersEXT)(VkDevice, uint32_t, const VkShaderCreateInfoEXT *, const VkAllocationCallbacks *, VkShaderEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateSwapchainKHR)(VkDevice, const VkSwapchainCreateInfoKHR *, const VkAllocationCallbacks *, VkSwapchainKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateValidationCacheEXT)(VkDevice, const VkValidationCacheCreateInfoEXT *, const VkAllocationCallbacks *, VkValidationCacheEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateVideoSessionKHR)(VkDevice, const VkVideoSessionCreateInfoKHR *, const VkAllocationCallbacks *, VkVideoSessionKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateVideoSessionParametersKHR)(VkDevice, const VkVideoSessionParametersCreateInfoKHR *, const VkAllocationCallbacks *, VkVideoSessionParametersKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkCreateWin32SurfaceKHR)(VkInstance, const VkWin32SurfaceCreateInfoKHR *, const VkAllocationCallbacks *, VkSurfaceKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkDebugMarkerSetObjectNameEXT)(VkDevice, const VkDebugMarkerObjectNameInfoEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkDebugMarkerSetObjectTagEXT)(VkDevice, const VkDebugMarkerObjectTagInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkDebugReportMessageEXT)(VkInstance, VkDebugReportFlagsEXT, VkDebugReportObjectTypeEXT, uint64_t, size_t, int32_t, const char *, const char *); -typedef VkResult (VKAPI_PTR *PFN_vkDeferredOperationJoinKHR)(VkDevice, VkDeferredOperationKHR); -typedef void (VKAPI_PTR *PFN_vkDestroyAccelerationStructureKHR)(VkDevice, VkAccelerationStructureKHR, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyAccelerationStructureNV)(VkDevice, VkAccelerationStructureNV, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyBuffer)(VkDevice, VkBuffer, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyBufferView)(VkDevice, VkBufferView, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyCommandPool)(VkDevice, VkCommandPool, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyCuFunctionNVX)(VkDevice, VkCuFunctionNVX, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyCuModuleNVX)(VkDevice, VkCuModuleNVX, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyCudaFunctionNV)(VkDevice, VkCudaFunctionNV, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyCudaModuleNV)(VkDevice, VkCudaModuleNV, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyDebugReportCallbackEXT)(VkInstance, VkDebugReportCallbackEXT, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyDebugUtilsMessengerEXT)(VkInstance, VkDebugUtilsMessengerEXT, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyDeferredOperationKHR)(VkDevice, VkDeferredOperationKHR, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorPool)(VkDevice, VkDescriptorPool, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorSetLayout)(VkDevice, VkDescriptorSetLayout, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorUpdateTemplate)(VkDevice, VkDescriptorUpdateTemplate, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorUpdateTemplateKHR)(VkDevice, VkDescriptorUpdateTemplate, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyDevice)(VkDevice, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyEvent)(VkDevice, VkEvent, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyFence)(VkDevice, VkFence, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyFramebuffer)(VkDevice, VkFramebuffer, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyImage)(VkDevice, VkImage, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyImageView)(VkDevice, VkImageView, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyIndirectCommandsLayoutEXT)(VkDevice, VkIndirectCommandsLayoutEXT, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyIndirectCommandsLayoutNV)(VkDevice, VkIndirectCommandsLayoutNV, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyIndirectExecutionSetEXT)(VkDevice, VkIndirectExecutionSetEXT, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyInstance)(VkInstance, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyMicromapEXT)(VkDevice, VkMicromapEXT, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyOpticalFlowSessionNV)(VkDevice, VkOpticalFlowSessionNV, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyPipeline)(VkDevice, VkPipeline, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyPipelineBinaryKHR)(VkDevice, VkPipelineBinaryKHR, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyPipelineCache)(VkDevice, VkPipelineCache, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyPipelineLayout)(VkDevice, VkPipelineLayout, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyPrivateDataSlot)(VkDevice, VkPrivateDataSlot, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyPrivateDataSlotEXT)(VkDevice, VkPrivateDataSlot, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyQueryPool)(VkDevice, VkQueryPool, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyRenderPass)(VkDevice, VkRenderPass, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroySampler)(VkDevice, VkSampler, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroySamplerYcbcrConversion)(VkDevice, VkSamplerYcbcrConversion, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroySamplerYcbcrConversionKHR)(VkDevice, VkSamplerYcbcrConversion, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroySemaphore)(VkDevice, VkSemaphore, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyShaderEXT)(VkDevice, VkShaderEXT, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyShaderModule)(VkDevice, VkShaderModule, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroySurfaceKHR)(VkInstance, VkSurfaceKHR, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroySwapchainKHR)(VkDevice, VkSwapchainKHR, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyValidationCacheEXT)(VkDevice, VkValidationCacheEXT, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyVideoSessionKHR)(VkDevice, VkVideoSessionKHR, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkDestroyVideoSessionParametersKHR)(VkDevice, VkVideoSessionParametersKHR, const VkAllocationCallbacks *); -typedef VkResult (VKAPI_PTR *PFN_vkDeviceWaitIdle)(VkDevice); -typedef VkResult (VKAPI_PTR *PFN_vkEndCommandBuffer)(VkCommandBuffer); -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateDeviceExtensionProperties)(VkPhysicalDevice, const char *, uint32_t *, VkExtensionProperties *); -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateDeviceLayerProperties)(VkPhysicalDevice, uint32_t *, VkLayerProperties *); -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateInstanceExtensionProperties)(const char *, uint32_t *, VkExtensionProperties *); -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateInstanceLayerProperties)(uint32_t *, VkLayerProperties *); -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateInstanceVersion)(uint32_t *); -typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceGroups)(VkInstance, uint32_t *, VkPhysicalDeviceGroupProperties *); -typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceGroupsKHR)(VkInstance, uint32_t *, VkPhysicalDeviceGroupProperties *); -typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR)(VkPhysicalDevice, uint32_t, uint32_t *, VkPerformanceCounterKHR *, VkPerformanceCounterDescriptionKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDevices)(VkInstance, uint32_t *, VkPhysicalDevice *); -typedef VkResult (VKAPI_PTR *PFN_vkFlushMappedMemoryRanges)(VkDevice, uint32_t, const VkMappedMemoryRange *); -typedef void (VKAPI_PTR *PFN_vkFreeCommandBuffers)(VkDevice, VkCommandPool, uint32_t, const VkCommandBuffer *); -typedef VkResult (VKAPI_PTR *PFN_vkFreeDescriptorSets)(VkDevice, VkDescriptorPool, uint32_t, const VkDescriptorSet *); -typedef void (VKAPI_PTR *PFN_vkFreeMemory)(VkDevice, VkDeviceMemory, const VkAllocationCallbacks *); -typedef void (VKAPI_PTR *PFN_vkGetAccelerationStructureBuildSizesKHR)(VkDevice, VkAccelerationStructureBuildTypeKHR, const VkAccelerationStructureBuildGeometryInfoKHR *, const uint32_t *, VkAccelerationStructureBuildSizesInfoKHR *); -typedef VkDeviceAddress (VKAPI_PTR *PFN_vkGetAccelerationStructureDeviceAddressKHR)(VkDevice, const VkAccelerationStructureDeviceAddressInfoKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetAccelerationStructureHandleNV)(VkDevice, VkAccelerationStructureNV, size_t, void *); -typedef void (VKAPI_PTR *PFN_vkGetAccelerationStructureMemoryRequirementsNV)(VkDevice, const VkAccelerationStructureMemoryRequirementsInfoNV *, VkMemoryRequirements2KHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT)(VkDevice, const VkAccelerationStructureCaptureDescriptorDataInfoEXT *, void *); -typedef VkDeviceAddress (VKAPI_PTR *PFN_vkGetBufferDeviceAddress)(VkDevice, const VkBufferDeviceAddressInfo *); -typedef VkDeviceAddress (VKAPI_PTR *PFN_vkGetBufferDeviceAddressEXT)(VkDevice, const VkBufferDeviceAddressInfo *); -typedef VkDeviceAddress (VKAPI_PTR *PFN_vkGetBufferDeviceAddressKHR)(VkDevice, const VkBufferDeviceAddressInfo *); -typedef void (VKAPI_PTR *PFN_vkGetBufferMemoryRequirements)(VkDevice, VkBuffer, VkMemoryRequirements *); -typedef void (VKAPI_PTR *PFN_vkGetBufferMemoryRequirements2)(VkDevice, const VkBufferMemoryRequirementsInfo2 *, VkMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetBufferMemoryRequirements2KHR)(VkDevice, const VkBufferMemoryRequirementsInfo2 *, VkMemoryRequirements2 *); -typedef uint64_t (VKAPI_PTR *PFN_vkGetBufferOpaqueCaptureAddress)(VkDevice, const VkBufferDeviceAddressInfo *); -typedef uint64_t (VKAPI_PTR *PFN_vkGetBufferOpaqueCaptureAddressKHR)(VkDevice, const VkBufferDeviceAddressInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkGetBufferOpaqueCaptureDescriptorDataEXT)(VkDevice, const VkBufferCaptureDescriptorDataInfoEXT *, void *); -typedef VkResult (VKAPI_PTR *PFN_vkGetCalibratedTimestampsEXT)(VkDevice, uint32_t, const VkCalibratedTimestampInfoKHR *, uint64_t *, uint64_t *); -typedef VkResult (VKAPI_PTR *PFN_vkGetCalibratedTimestampsKHR)(VkDevice, uint32_t, const VkCalibratedTimestampInfoKHR *, uint64_t *, uint64_t *); -typedef VkResult (VKAPI_PTR *PFN_vkGetCudaModuleCacheNV)(VkDevice, VkCudaModuleNV, size_t *, void *); -typedef uint32_t (VKAPI_PTR *PFN_vkGetDeferredOperationMaxConcurrencyKHR)(VkDevice, VkDeferredOperationKHR); -typedef VkResult (VKAPI_PTR *PFN_vkGetDeferredOperationResultKHR)(VkDevice, VkDeferredOperationKHR); -typedef void (VKAPI_PTR *PFN_vkGetDescriptorEXT)(VkDevice, const VkDescriptorGetInfoEXT *, size_t, void *); -typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetHostMappingVALVE)(VkDevice, VkDescriptorSet, void **); -typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutBindingOffsetEXT)(VkDevice, VkDescriptorSetLayout, uint32_t, VkDeviceSize *); -typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutHostMappingInfoVALVE)(VkDevice, const VkDescriptorSetBindingReferenceVALVE *, VkDescriptorSetLayoutHostMappingInfoVALVE *); -typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutSizeEXT)(VkDevice, VkDescriptorSetLayout, VkDeviceSize *); -typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutSupport)(VkDevice, const VkDescriptorSetLayoutCreateInfo *, VkDescriptorSetLayoutSupport *); -typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutSupportKHR)(VkDevice, const VkDescriptorSetLayoutCreateInfo *, VkDescriptorSetLayoutSupport *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceAccelerationStructureCompatibilityKHR)(VkDevice, const VkAccelerationStructureVersionInfoKHR *, VkAccelerationStructureCompatibilityKHR *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceBufferMemoryRequirements)(VkDevice, const VkDeviceBufferMemoryRequirements *, VkMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceBufferMemoryRequirementsKHR)(VkDevice, const VkDeviceBufferMemoryRequirements *, VkMemoryRequirements2 *); -typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceFaultInfoEXT)(VkDevice, VkDeviceFaultCountsEXT *, VkDeviceFaultInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceGroupPeerMemoryFeatures)(VkDevice, uint32_t, uint32_t, uint32_t, VkPeerMemoryFeatureFlags *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR)(VkDevice, uint32_t, uint32_t, uint32_t, VkPeerMemoryFeatureFlags *); -typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupPresentCapabilitiesKHR)(VkDevice, VkDeviceGroupPresentCapabilitiesKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModesKHR)(VkDevice, VkSurfaceKHR, VkDeviceGroupPresentModeFlagsKHR *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceImageMemoryRequirements)(VkDevice, const VkDeviceImageMemoryRequirements *, VkMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceImageMemoryRequirementsKHR)(VkDevice, const VkDeviceImageMemoryRequirements *, VkMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceImageSparseMemoryRequirements)(VkDevice, const VkDeviceImageMemoryRequirements *, uint32_t *, VkSparseImageMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceImageSparseMemoryRequirementsKHR)(VkDevice, const VkDeviceImageMemoryRequirements *, uint32_t *, VkSparseImageMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceImageSubresourceLayout)(VkDevice, const VkDeviceImageSubresourceInfo *, VkSubresourceLayout2 *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceImageSubresourceLayoutKHR)(VkDevice, const VkDeviceImageSubresourceInfo *, VkSubresourceLayout2 *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceMemoryCommitment)(VkDevice, VkDeviceMemory, VkDeviceSize *); -typedef uint64_t (VKAPI_PTR *PFN_vkGetDeviceMemoryOpaqueCaptureAddress)(VkDevice, const VkDeviceMemoryOpaqueCaptureAddressInfo *); -typedef uint64_t (VKAPI_PTR *PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR)(VkDevice, const VkDeviceMemoryOpaqueCaptureAddressInfo *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceMicromapCompatibilityEXT)(VkDevice, const VkMicromapVersionInfoEXT *, VkAccelerationStructureCompatibilityKHR *); -typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetDeviceProcAddr)(VkDevice, const char *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceQueue)(VkDevice, uint32_t, uint32_t, VkQueue *); -typedef void (VKAPI_PTR *PFN_vkGetDeviceQueue2)(VkDevice, const VkDeviceQueueInfo2 *, VkQueue *); -typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI)(VkDevice, VkRenderPass, VkExtent2D *); -typedef VkResult (VKAPI_PTR *PFN_vkGetDynamicRenderingTilePropertiesQCOM)(VkDevice, const VkRenderingInfo *, VkTilePropertiesQCOM *); -typedef VkResult (VKAPI_PTR *PFN_vkGetEncodedVideoSessionParametersKHR)(VkDevice, const VkVideoEncodeSessionParametersGetInfoKHR *, VkVideoEncodeSessionParametersFeedbackInfoKHR *, size_t *, void *); -typedef VkResult (VKAPI_PTR *PFN_vkGetEventStatus)(VkDevice, VkEvent); -typedef VkResult (VKAPI_PTR *PFN_vkGetFenceStatus)(VkDevice, VkFence); -typedef VkResult (VKAPI_PTR *PFN_vkGetFramebufferTilePropertiesQCOM)(VkDevice, VkFramebuffer, uint32_t *, VkTilePropertiesQCOM *); -typedef void (VKAPI_PTR *PFN_vkGetGeneratedCommandsMemoryRequirementsEXT)(VkDevice, const VkGeneratedCommandsMemoryRequirementsInfoEXT *, VkMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetGeneratedCommandsMemoryRequirementsNV)(VkDevice, const VkGeneratedCommandsMemoryRequirementsInfoNV *, VkMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements)(VkDevice, VkImage, VkMemoryRequirements *); -typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements2)(VkDevice, const VkImageMemoryRequirementsInfo2 *, VkMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements2KHR)(VkDevice, const VkImageMemoryRequirementsInfo2 *, VkMemoryRequirements2 *); -typedef VkResult (VKAPI_PTR *PFN_vkGetImageOpaqueCaptureDescriptorDataEXT)(VkDevice, const VkImageCaptureDescriptorDataInfoEXT *, void *); -typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements)(VkDevice, VkImage, uint32_t *, VkSparseImageMemoryRequirements *); -typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements2)(VkDevice, const VkImageSparseMemoryRequirementsInfo2 *, uint32_t *, VkSparseImageMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements2KHR)(VkDevice, const VkImageSparseMemoryRequirementsInfo2 *, uint32_t *, VkSparseImageMemoryRequirements2 *); -typedef void (VKAPI_PTR *PFN_vkGetImageSubresourceLayout)(VkDevice, VkImage, const VkImageSubresource *, VkSubresourceLayout *); -typedef void (VKAPI_PTR *PFN_vkGetImageSubresourceLayout2)(VkDevice, VkImage, const VkImageSubresource2 *, VkSubresourceLayout2 *); -typedef void (VKAPI_PTR *PFN_vkGetImageSubresourceLayout2EXT)(VkDevice, VkImage, const VkImageSubresource2 *, VkSubresourceLayout2 *); -typedef void (VKAPI_PTR *PFN_vkGetImageSubresourceLayout2KHR)(VkDevice, VkImage, const VkImageSubresource2 *, VkSubresourceLayout2 *); -typedef VkResult (VKAPI_PTR *PFN_vkGetImageViewAddressNVX)(VkDevice, VkImageView, VkImageViewAddressPropertiesNVX *); -typedef uint64_t (VKAPI_PTR *PFN_vkGetImageViewHandle64NVX)(VkDevice, const VkImageViewHandleInfoNVX *); -typedef uint32_t (VKAPI_PTR *PFN_vkGetImageViewHandleNVX)(VkDevice, const VkImageViewHandleInfoNVX *); -typedef VkResult (VKAPI_PTR *PFN_vkGetImageViewOpaqueCaptureDescriptorDataEXT)(VkDevice, const VkImageViewCaptureDescriptorDataInfoEXT *, void *); -typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetInstanceProcAddr)(VkInstance, const char *); -typedef void (VKAPI_PTR *PFN_vkGetLatencyTimingsNV)(VkDevice, VkSwapchainKHR, VkGetLatencyMarkerInfoNV *); -typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryHostPointerPropertiesEXT)(VkDevice, VkExternalMemoryHandleTypeFlagBits, const void *, VkMemoryHostPointerPropertiesEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleKHR)(VkDevice, const VkMemoryGetWin32HandleInfoKHR *, HANDLE *); -typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandlePropertiesKHR)(VkDevice, VkExternalMemoryHandleTypeFlagBits, HANDLE, VkMemoryWin32HandlePropertiesKHR *); -typedef void (VKAPI_PTR *PFN_vkGetMicromapBuildSizesEXT)(VkDevice, VkAccelerationStructureBuildTypeKHR, const VkMicromapBuildInfoEXT *, VkMicromapBuildSizesInfoEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPerformanceParameterINTEL)(VkDevice, VkPerformanceParameterTypeINTEL, VkPerformanceValueINTEL *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT)(VkPhysicalDevice, uint32_t *, VkTimeDomainKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR)(VkPhysicalDevice, uint32_t *, VkTimeDomainKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV)(VkPhysicalDevice, uint32_t *, VkCooperativeMatrixFlexibleDimensionsPropertiesNV *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR)(VkPhysicalDevice, uint32_t *, VkCooperativeMatrixPropertiesKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV)(VkPhysicalDevice, uint32_t *, VkCooperativeMatrixPropertiesNV *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalBufferProperties)(VkPhysicalDevice, const VkPhysicalDeviceExternalBufferInfo *, VkExternalBufferProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR)(VkPhysicalDevice, const VkPhysicalDeviceExternalBufferInfo *, VkExternalBufferProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalFenceProperties)(VkPhysicalDevice, const VkPhysicalDeviceExternalFenceInfo *, VkExternalFenceProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR)(VkPhysicalDevice, const VkPhysicalDeviceExternalFenceInfo *, VkExternalFenceProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalSemaphoreProperties)(VkPhysicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *, VkExternalSemaphoreProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR)(VkPhysicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *, VkExternalSemaphoreProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures)(VkPhysicalDevice, VkPhysicalDeviceFeatures *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures2)(VkPhysicalDevice, VkPhysicalDeviceFeatures2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures2KHR)(VkPhysicalDevice, VkPhysicalDeviceFeatures2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFormatProperties)(VkPhysicalDevice, VkFormat, VkFormatProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFormatProperties2)(VkPhysicalDevice, VkFormat, VkFormatProperties2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFormatProperties2KHR)(VkPhysicalDevice, VkFormat, VkFormatProperties2 *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceFragmentShadingRatesKHR)(VkPhysicalDevice, uint32_t *, VkPhysicalDeviceFragmentShadingRateKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties)(VkPhysicalDevice, VkFormat, VkImageType, VkImageTiling, VkImageUsageFlags, VkImageCreateFlags, VkImageFormatProperties *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties2)(VkPhysicalDevice, const VkPhysicalDeviceImageFormatInfo2 *, VkImageFormatProperties2 *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties2KHR)(VkPhysicalDevice, const VkPhysicalDeviceImageFormatInfo2 *, VkImageFormatProperties2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMemoryProperties)(VkPhysicalDevice, VkPhysicalDeviceMemoryProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMemoryProperties2)(VkPhysicalDevice, VkPhysicalDeviceMemoryProperties2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMemoryProperties2KHR)(VkPhysicalDevice, VkPhysicalDeviceMemoryProperties2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT)(VkPhysicalDevice, VkSampleCountFlagBits, VkMultisamplePropertiesEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceOpticalFlowImageFormatsNV)(VkPhysicalDevice, const VkOpticalFlowImageFormatInfoNV *, uint32_t *, VkOpticalFlowImageFormatPropertiesNV *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDevicePresentRectanglesKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkRect2D *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceProperties)(VkPhysicalDevice, VkPhysicalDeviceProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceProperties2)(VkPhysicalDevice, VkPhysicalDeviceProperties2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceProperties2KHR)(VkPhysicalDevice, VkPhysicalDeviceProperties2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR)(VkPhysicalDevice, const VkQueryPoolPerformanceCreateInfoKHR *, uint32_t *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties)(VkPhysicalDevice, uint32_t *, VkQueueFamilyProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties2)(VkPhysicalDevice, uint32_t *, VkQueueFamilyProperties2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR)(VkPhysicalDevice, uint32_t *, VkQueueFamilyProperties2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties)(VkPhysicalDevice, VkFormat, VkImageType, VkSampleCountFlagBits, VkImageUsageFlags, VkImageTiling, uint32_t *, VkSparseImageFormatProperties *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties2)(VkPhysicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *, uint32_t *, VkSparseImageFormatProperties2 *); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *, uint32_t *, VkSparseImageFormatProperties2 *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV)(VkPhysicalDevice, uint32_t *, VkFramebufferMixedSamplesCombinationNV *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, VkSurfaceCapabilities2KHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice, VkSurfaceKHR, VkSurfaceCapabilitiesKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, uint32_t *, VkSurfaceFormat2KHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkSurfaceFormatKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkPresentModeKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice, uint32_t, VkSurfaceKHR, VkBool32 *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceToolProperties)(VkPhysicalDevice, uint32_t *, VkPhysicalDeviceToolProperties *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceToolPropertiesEXT)(VkPhysicalDevice, uint32_t *, VkPhysicalDeviceToolProperties *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR)(VkPhysicalDevice, const VkVideoProfileInfoKHR *, VkVideoCapabilitiesKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR)(VkPhysicalDevice, const VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR *, VkVideoEncodeQualityLevelPropertiesKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceVideoFormatPropertiesKHR)(VkPhysicalDevice, const VkPhysicalDeviceVideoFormatInfoKHR *, uint32_t *, VkVideoFormatPropertiesKHR *); -typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice, uint32_t); -typedef VkResult (VKAPI_PTR *PFN_vkGetPipelineBinaryDataKHR)(VkDevice, const VkPipelineBinaryDataInfoKHR *, VkPipelineBinaryKeyKHR *, size_t *, void *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPipelineCacheData)(VkDevice, VkPipelineCache, size_t *, void *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPipelineExecutableInternalRepresentationsKHR)(VkDevice, const VkPipelineExecutableInfoKHR *, uint32_t *, VkPipelineExecutableInternalRepresentationKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPipelineExecutablePropertiesKHR)(VkDevice, const VkPipelineInfoKHR *, uint32_t *, VkPipelineExecutablePropertiesKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPipelineExecutableStatisticsKHR)(VkDevice, const VkPipelineExecutableInfoKHR *, uint32_t *, VkPipelineExecutableStatisticKHR *); -typedef VkDeviceAddress (VKAPI_PTR *PFN_vkGetPipelineIndirectDeviceAddressNV)(VkDevice, const VkPipelineIndirectDeviceAddressInfoNV *); -typedef void (VKAPI_PTR *PFN_vkGetPipelineIndirectMemoryRequirementsNV)(VkDevice, const VkComputePipelineCreateInfo *, VkMemoryRequirements2 *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPipelineKeyKHR)(VkDevice, const VkPipelineCreateInfoKHR *, VkPipelineBinaryKeyKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkGetPipelinePropertiesEXT)(VkDevice, const VkPipelineInfoEXT *, VkBaseOutStructure *); -typedef void (VKAPI_PTR *PFN_vkGetPrivateData)(VkDevice, VkObjectType, uint64_t, VkPrivateDataSlot, uint64_t *); -typedef void (VKAPI_PTR *PFN_vkGetPrivateDataEXT)(VkDevice, VkObjectType, uint64_t, VkPrivateDataSlot, uint64_t *); -typedef VkResult (VKAPI_PTR *PFN_vkGetQueryPoolResults)(VkDevice, VkQueryPool, uint32_t, uint32_t, size_t, void *, VkDeviceSize, VkQueryResultFlags); -typedef void (VKAPI_PTR *PFN_vkGetQueueCheckpointData2NV)(VkQueue, uint32_t *, VkCheckpointData2NV *); -typedef void (VKAPI_PTR *PFN_vkGetQueueCheckpointDataNV)(VkQueue, uint32_t *, VkCheckpointDataNV *); -typedef VkResult (VKAPI_PTR *PFN_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR)(VkDevice, VkPipeline, uint32_t, uint32_t, size_t, void *); -typedef VkResult (VKAPI_PTR *PFN_vkGetRayTracingShaderGroupHandlesKHR)(VkDevice, VkPipeline, uint32_t, uint32_t, size_t, void *); -typedef VkResult (VKAPI_PTR *PFN_vkGetRayTracingShaderGroupHandlesNV)(VkDevice, VkPipeline, uint32_t, uint32_t, size_t, void *); -typedef VkDeviceSize (VKAPI_PTR *PFN_vkGetRayTracingShaderGroupStackSizeKHR)(VkDevice, VkPipeline, uint32_t, VkShaderGroupShaderKHR); -typedef void (VKAPI_PTR *PFN_vkGetRenderAreaGranularity)(VkDevice, VkRenderPass, VkExtent2D *); -typedef void (VKAPI_PTR *PFN_vkGetRenderingAreaGranularity)(VkDevice, const VkRenderingAreaInfo *, VkExtent2D *); -typedef void (VKAPI_PTR *PFN_vkGetRenderingAreaGranularityKHR)(VkDevice, const VkRenderingAreaInfo *, VkExtent2D *); -typedef VkResult (VKAPI_PTR *PFN_vkGetSamplerOpaqueCaptureDescriptorDataEXT)(VkDevice, const VkSamplerCaptureDescriptorDataInfoEXT *, void *); -typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreCounterValue)(VkDevice, VkSemaphore, uint64_t *); -typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreCounterValueKHR)(VkDevice, VkSemaphore, uint64_t *); -typedef VkResult (VKAPI_PTR *PFN_vkGetShaderBinaryDataEXT)(VkDevice, VkShaderEXT, size_t *, void *); -typedef VkResult (VKAPI_PTR *PFN_vkGetShaderInfoAMD)(VkDevice, VkPipeline, VkShaderStageFlagBits, VkShaderInfoTypeAMD, size_t *, void *); -typedef void (VKAPI_PTR *PFN_vkGetShaderModuleCreateInfoIdentifierEXT)(VkDevice, const VkShaderModuleCreateInfo *, VkShaderModuleIdentifierEXT *); -typedef void (VKAPI_PTR *PFN_vkGetShaderModuleIdentifierEXT)(VkDevice, VkShaderModule, VkShaderModuleIdentifierEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainImagesKHR)(VkDevice, VkSwapchainKHR, uint32_t *, VkImage *); -typedef VkResult (VKAPI_PTR *PFN_vkGetValidationCacheDataEXT)(VkDevice, VkValidationCacheEXT, size_t *, void *); -typedef VkResult (VKAPI_PTR *PFN_vkGetVideoSessionMemoryRequirementsKHR)(VkDevice, VkVideoSessionKHR, uint32_t *, VkVideoSessionMemoryRequirementsKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkInitializePerformanceApiINTEL)(VkDevice, const VkInitializePerformanceApiInfoINTEL *); -typedef VkResult (VKAPI_PTR *PFN_vkInvalidateMappedMemoryRanges)(VkDevice, uint32_t, const VkMappedMemoryRange *); -typedef VkResult (VKAPI_PTR *PFN_vkLatencySleepNV)(VkDevice, VkSwapchainKHR, const VkLatencySleepInfoNV *); -typedef VkResult (VKAPI_PTR *PFN_vkMapMemory)(VkDevice, VkDeviceMemory, VkDeviceSize, VkDeviceSize, VkMemoryMapFlags, void **); -typedef VkResult (VKAPI_PTR *PFN_vkMapMemory2)(VkDevice, const VkMemoryMapInfo *, void **); -typedef VkResult (VKAPI_PTR *PFN_vkMapMemory2KHR)(VkDevice, const VkMemoryMapInfo *, void **); -typedef VkResult (VKAPI_PTR *PFN_vkMergePipelineCaches)(VkDevice, VkPipelineCache, uint32_t, const VkPipelineCache *); -typedef VkResult (VKAPI_PTR *PFN_vkMergeValidationCachesEXT)(VkDevice, VkValidationCacheEXT, uint32_t, const VkValidationCacheEXT *); -typedef void (VKAPI_PTR *PFN_vkQueueBeginDebugUtilsLabelEXT)(VkQueue, const VkDebugUtilsLabelEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkQueueBindSparse)(VkQueue, uint32_t, const VkBindSparseInfo *, VkFence); -typedef void (VKAPI_PTR *PFN_vkQueueEndDebugUtilsLabelEXT)(VkQueue); -typedef void (VKAPI_PTR *PFN_vkQueueInsertDebugUtilsLabelEXT)(VkQueue, const VkDebugUtilsLabelEXT *); -typedef void (VKAPI_PTR *PFN_vkQueueNotifyOutOfBandNV)(VkQueue, const VkOutOfBandQueueTypeInfoNV *); -typedef VkResult (VKAPI_PTR *PFN_vkQueuePresentKHR)(VkQueue, const VkPresentInfoKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkQueueSetPerformanceConfigurationINTEL)(VkQueue, VkPerformanceConfigurationINTEL); -typedef VkResult (VKAPI_PTR *PFN_vkQueueSubmit)(VkQueue, uint32_t, const VkSubmitInfo *, VkFence); -typedef VkResult (VKAPI_PTR *PFN_vkQueueSubmit2)(VkQueue, uint32_t, const VkSubmitInfo2 *, VkFence); -typedef VkResult (VKAPI_PTR *PFN_vkQueueSubmit2KHR)(VkQueue, uint32_t, const VkSubmitInfo2 *, VkFence); -typedef VkResult (VKAPI_PTR *PFN_vkQueueWaitIdle)(VkQueue); -typedef VkResult (VKAPI_PTR *PFN_vkReleaseCapturedPipelineDataKHR)(VkDevice, const VkReleaseCapturedPipelineDataInfoKHR *, const VkAllocationCallbacks *); -typedef VkResult (VKAPI_PTR *PFN_vkReleasePerformanceConfigurationINTEL)(VkDevice, VkPerformanceConfigurationINTEL); -typedef void (VKAPI_PTR *PFN_vkReleaseProfilingLockKHR)(VkDevice); -typedef VkResult (VKAPI_PTR *PFN_vkReleaseSwapchainImagesEXT)(VkDevice, const VkReleaseSwapchainImagesInfoEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkResetCommandBuffer)(VkCommandBuffer, VkCommandBufferResetFlags); -typedef VkResult (VKAPI_PTR *PFN_vkResetCommandPool)(VkDevice, VkCommandPool, VkCommandPoolResetFlags); -typedef VkResult (VKAPI_PTR *PFN_vkResetDescriptorPool)(VkDevice, VkDescriptorPool, VkDescriptorPoolResetFlags); -typedef VkResult (VKAPI_PTR *PFN_vkResetEvent)(VkDevice, VkEvent); -typedef VkResult (VKAPI_PTR *PFN_vkResetFences)(VkDevice, uint32_t, const VkFence *); -typedef void (VKAPI_PTR *PFN_vkResetQueryPool)(VkDevice, VkQueryPool, uint32_t, uint32_t); -typedef void (VKAPI_PTR *PFN_vkResetQueryPoolEXT)(VkDevice, VkQueryPool, uint32_t, uint32_t); -typedef VkResult (VKAPI_PTR *PFN_vkSetDebugUtilsObjectNameEXT)(VkDevice, const VkDebugUtilsObjectNameInfoEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkSetDebugUtilsObjectTagEXT)(VkDevice, const VkDebugUtilsObjectTagInfoEXT *); -typedef void (VKAPI_PTR *PFN_vkSetDeviceMemoryPriorityEXT)(VkDevice, VkDeviceMemory, float); -typedef VkResult (VKAPI_PTR *PFN_vkSetEvent)(VkDevice, VkEvent); -typedef void (VKAPI_PTR *PFN_vkSetHdrMetadataEXT)(VkDevice, uint32_t, const VkSwapchainKHR *, const VkHdrMetadataEXT *); -typedef void (VKAPI_PTR *PFN_vkSetLatencyMarkerNV)(VkDevice, VkSwapchainKHR, const VkSetLatencyMarkerInfoNV *); -typedef VkResult (VKAPI_PTR *PFN_vkSetLatencySleepModeNV)(VkDevice, VkSwapchainKHR, const VkLatencySleepModeInfoNV *); -typedef VkResult (VKAPI_PTR *PFN_vkSetPrivateData)(VkDevice, VkObjectType, uint64_t, VkPrivateDataSlot, uint64_t); -typedef VkResult (VKAPI_PTR *PFN_vkSetPrivateDataEXT)(VkDevice, VkObjectType, uint64_t, VkPrivateDataSlot, uint64_t); -typedef VkResult (VKAPI_PTR *PFN_vkSignalSemaphore)(VkDevice, const VkSemaphoreSignalInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkSignalSemaphoreKHR)(VkDevice, const VkSemaphoreSignalInfo *); -typedef void (VKAPI_PTR *PFN_vkSubmitDebugUtilsMessageEXT)(VkInstance, VkDebugUtilsMessageSeverityFlagBitsEXT, VkDebugUtilsMessageTypeFlagsEXT, const VkDebugUtilsMessengerCallbackDataEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkTransitionImageLayout)(VkDevice, uint32_t, const VkHostImageLayoutTransitionInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkTransitionImageLayoutEXT)(VkDevice, uint32_t, const VkHostImageLayoutTransitionInfo *); -typedef void (VKAPI_PTR *PFN_vkTrimCommandPool)(VkDevice, VkCommandPool, VkCommandPoolTrimFlags); -typedef void (VKAPI_PTR *PFN_vkTrimCommandPoolKHR)(VkDevice, VkCommandPool, VkCommandPoolTrimFlags); -typedef void (VKAPI_PTR *PFN_vkUninitializePerformanceApiINTEL)(VkDevice); -typedef void (VKAPI_PTR *PFN_vkUnmapMemory)(VkDevice, VkDeviceMemory); -typedef VkResult (VKAPI_PTR *PFN_vkUnmapMemory2)(VkDevice, const VkMemoryUnmapInfo *); -typedef VkResult (VKAPI_PTR *PFN_vkUnmapMemory2KHR)(VkDevice, const VkMemoryUnmapInfo *); -typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSetWithTemplate)(VkDevice, VkDescriptorSet, VkDescriptorUpdateTemplate, const void *); -typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSetWithTemplateKHR)(VkDevice, VkDescriptorSet, VkDescriptorUpdateTemplate, const void *); -typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSets)(VkDevice, uint32_t, const VkWriteDescriptorSet *, uint32_t, const VkCopyDescriptorSet *); -typedef void (VKAPI_PTR *PFN_vkUpdateIndirectExecutionSetPipelineEXT)(VkDevice, VkIndirectExecutionSetEXT, uint32_t, const VkWriteIndirectExecutionSetPipelineEXT *); -typedef void (VKAPI_PTR *PFN_vkUpdateIndirectExecutionSetShaderEXT)(VkDevice, VkIndirectExecutionSetEXT, uint32_t, const VkWriteIndirectExecutionSetShaderEXT *); -typedef VkResult (VKAPI_PTR *PFN_vkUpdateVideoSessionParametersKHR)(VkDevice, VkVideoSessionParametersKHR, const VkVideoSessionParametersUpdateInfoKHR *); -typedef VkResult (VKAPI_PTR *PFN_vkWaitForFences)(VkDevice, uint32_t, const VkFence *, VkBool32, uint64_t); -typedef VkResult (VKAPI_PTR *PFN_vkWaitForPresentKHR)(VkDevice, VkSwapchainKHR, uint64_t, uint64_t); -typedef VkResult (VKAPI_PTR *PFN_vkWaitSemaphores)(VkDevice, const VkSemaphoreWaitInfo *, uint64_t); -typedef VkResult (VKAPI_PTR *PFN_vkWaitSemaphoresKHR)(VkDevice, const VkSemaphoreWaitInfo *, uint64_t); -typedef VkResult (VKAPI_PTR *PFN_vkWriteAccelerationStructuresPropertiesKHR)(VkDevice, uint32_t, const VkAccelerationStructureKHR *, VkQueryType, size_t, void *, size_t); -typedef VkResult (VKAPI_PTR *PFN_vkWriteMicromapsPropertiesEXT)(VkDevice, uint32_t, const VkMicromapEXT *, VkQueryType, size_t, void *, size_t); - -#ifndef VK_NO_PROTOTYPES -VkResult VKAPI_CALL vkAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR *pAcquireInfo, uint32_t *pImageIndex); -VkResult VKAPI_CALL vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex); -VkResult VKAPI_CALL vkAcquirePerformanceConfigurationINTEL(VkDevice device, const VkPerformanceConfigurationAcquireInfoINTEL *pAcquireInfo, VkPerformanceConfigurationINTEL *pConfiguration); -VkResult VKAPI_CALL vkAcquireProfilingLockKHR(VkDevice device, const VkAcquireProfilingLockInfoKHR *pInfo); -VkResult VKAPI_CALL vkAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo *pAllocateInfo, VkCommandBuffer *pCommandBuffers); -VkResult VKAPI_CALL vkAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo *pAllocateInfo, VkDescriptorSet *pDescriptorSets); -VkResult VKAPI_CALL vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory); -void VKAPI_CALL vkAntiLagUpdateAMD(VkDevice device, const VkAntiLagDataAMD *pData); -VkResult VKAPI_CALL vkBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo); -VkResult VKAPI_CALL vkBindAccelerationStructureMemoryNV(VkDevice device, uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoNV *pBindInfos); -VkResult VKAPI_CALL vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset); -VkResult VKAPI_CALL vkBindBufferMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo *pBindInfos); -VkResult VKAPI_CALL vkBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo *pBindInfos); -VkResult VKAPI_CALL vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset); -VkResult VKAPI_CALL vkBindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo *pBindInfos); -VkResult VKAPI_CALL vkBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo *pBindInfos); -VkResult VKAPI_CALL vkBindOpticalFlowSessionImageNV(VkDevice device, VkOpticalFlowSessionNV session, VkOpticalFlowSessionBindingPointNV bindingPoint, VkImageView view, VkImageLayout layout); -VkResult VKAPI_CALL vkBindVideoSessionMemoryKHR(VkDevice device, VkVideoSessionKHR videoSession, uint32_t bindSessionMemoryInfoCount, const VkBindVideoSessionMemoryInfoKHR *pBindSessionMemoryInfos); -VkResult VKAPI_CALL vkBuildAccelerationStructuresKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, const VkAccelerationStructureBuildRangeInfoKHR * const*ppBuildRangeInfos); -VkResult VKAPI_CALL vkBuildMicromapsEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, const VkMicromapBuildInfoEXT *pInfos); -void VKAPI_CALL vkCmdBeginConditionalRenderingEXT(VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT *pConditionalRenderingBegin); -void VKAPI_CALL vkCmdBeginDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT *pLabelInfo); -void VKAPI_CALL vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags); -void VKAPI_CALL vkCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags, uint32_t index); -void VKAPI_CALL vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, VkSubpassContents contents); -void VKAPI_CALL vkCmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, const VkSubpassBeginInfo *pSubpassBeginInfo); -void VKAPI_CALL vkCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, const VkSubpassBeginInfo *pSubpassBeginInfo); -void VKAPI_CALL vkCmdBeginRendering(VkCommandBuffer commandBuffer, const VkRenderingInfo *pRenderingInfo); -void VKAPI_CALL vkCmdBeginRenderingKHR(VkCommandBuffer commandBuffer, const VkRenderingInfo *pRenderingInfo); -void VKAPI_CALL vkCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer *pCounterBuffers, const VkDeviceSize *pCounterBufferOffsets); -void VKAPI_CALL vkCmdBeginVideoCodingKHR(VkCommandBuffer commandBuffer, const VkVideoBeginCodingInfoKHR *pBeginInfo); -void VKAPI_CALL vkCmdBindDescriptorBufferEmbeddedSamplers2EXT(VkCommandBuffer commandBuffer, const VkBindDescriptorBufferEmbeddedSamplersInfoEXT *pBindDescriptorBufferEmbeddedSamplersInfo); -void VKAPI_CALL vkCmdBindDescriptorBufferEmbeddedSamplersEXT(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set); -void VKAPI_CALL vkCmdBindDescriptorBuffersEXT(VkCommandBuffer commandBuffer, uint32_t bufferCount, const VkDescriptorBufferBindingInfoEXT *pBindingInfos); -void VKAPI_CALL vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet *pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t *pDynamicOffsets); -void VKAPI_CALL vkCmdBindDescriptorSets2(VkCommandBuffer commandBuffer, const VkBindDescriptorSetsInfo *pBindDescriptorSetsInfo); -void VKAPI_CALL vkCmdBindDescriptorSets2KHR(VkCommandBuffer commandBuffer, const VkBindDescriptorSetsInfo *pBindDescriptorSetsInfo); -void VKAPI_CALL vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType); -void VKAPI_CALL vkCmdBindIndexBuffer2(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize size, VkIndexType indexType); -void VKAPI_CALL vkCmdBindIndexBuffer2KHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize size, VkIndexType indexType); -void VKAPI_CALL vkCmdBindInvocationMaskHUAWEI(VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout); -void VKAPI_CALL vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); -void VKAPI_CALL vkCmdBindPipelineShaderGroupNV(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline, uint32_t groupIndex); -void VKAPI_CALL vkCmdBindShadersEXT(VkCommandBuffer commandBuffer, uint32_t stageCount, const VkShaderStageFlagBits *pStages, const VkShaderEXT *pShaders); -void VKAPI_CALL vkCmdBindShadingRateImageNV(VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout); -void VKAPI_CALL vkCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes); -void VKAPI_CALL vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets); -void VKAPI_CALL vkCmdBindVertexBuffers2(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes, const VkDeviceSize *pStrides); -void VKAPI_CALL vkCmdBindVertexBuffers2EXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes, const VkDeviceSize *pStrides); -void VKAPI_CALL vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit *pRegions, VkFilter filter); -void VKAPI_CALL vkCmdBlitImage2(VkCommandBuffer commandBuffer, const VkBlitImageInfo2 *pBlitImageInfo); -void VKAPI_CALL vkCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2 *pBlitImageInfo); -void VKAPI_CALL vkCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV *pInfo, VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkBuffer scratch, VkDeviceSize scratchOffset); -void VKAPI_CALL vkCmdBuildAccelerationStructuresIndirectKHR(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, const VkDeviceAddress *pIndirectDeviceAddresses, const uint32_t *pIndirectStrides, const uint32_t * const*ppMaxPrimitiveCounts); -void VKAPI_CALL vkCmdBuildAccelerationStructuresKHR(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, const VkAccelerationStructureBuildRangeInfoKHR * const*ppBuildRangeInfos); -void VKAPI_CALL vkCmdBuildMicromapsEXT(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkMicromapBuildInfoEXT *pInfos); -void VKAPI_CALL vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment *pAttachments, uint32_t rectCount, const VkClearRect *pRects); -void VKAPI_CALL vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue *pColor, uint32_t rangeCount, const VkImageSubresourceRange *pRanges); -void VKAPI_CALL vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue *pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange *pRanges); -void VKAPI_CALL vkCmdControlVideoCodingKHR(VkCommandBuffer commandBuffer, const VkVideoCodingControlInfoKHR *pCodingControlInfo); -void VKAPI_CALL vkCmdCopyAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureInfoKHR *pInfo); -void VKAPI_CALL vkCmdCopyAccelerationStructureNV(VkCommandBuffer commandBuffer, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkCopyAccelerationStructureModeKHR mode); -void VKAPI_CALL vkCmdCopyAccelerationStructureToMemoryKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo); -void VKAPI_CALL vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy *pRegions); -void VKAPI_CALL vkCmdCopyBuffer2(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2 *pCopyBufferInfo); -void VKAPI_CALL vkCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2 *pCopyBufferInfo); -void VKAPI_CALL vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy *pRegions); -void VKAPI_CALL vkCmdCopyBufferToImage2(VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2 *pCopyBufferToImageInfo); -void VKAPI_CALL vkCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2 *pCopyBufferToImageInfo); -void VKAPI_CALL vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy *pRegions); -void VKAPI_CALL vkCmdCopyImage2(VkCommandBuffer commandBuffer, const VkCopyImageInfo2 *pCopyImageInfo); -void VKAPI_CALL vkCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2 *pCopyImageInfo); -void VKAPI_CALL vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy *pRegions); -void VKAPI_CALL vkCmdCopyImageToBuffer2(VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2 *pCopyImageToBufferInfo); -void VKAPI_CALL vkCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2 *pCopyImageToBufferInfo); -void VKAPI_CALL vkCmdCopyMemoryIndirectNV(VkCommandBuffer commandBuffer, VkDeviceAddress copyBufferAddress, uint32_t copyCount, uint32_t stride); -void VKAPI_CALL vkCmdCopyMemoryToAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo); -void VKAPI_CALL vkCmdCopyMemoryToImageIndirectNV(VkCommandBuffer commandBuffer, VkDeviceAddress copyBufferAddress, uint32_t copyCount, uint32_t stride, VkImage dstImage, VkImageLayout dstImageLayout, const VkImageSubresourceLayers *pImageSubresources); -void VKAPI_CALL vkCmdCopyMemoryToMicromapEXT(VkCommandBuffer commandBuffer, const VkCopyMemoryToMicromapInfoEXT *pInfo); -void VKAPI_CALL vkCmdCopyMicromapEXT(VkCommandBuffer commandBuffer, const VkCopyMicromapInfoEXT *pInfo); -void VKAPI_CALL vkCmdCopyMicromapToMemoryEXT(VkCommandBuffer commandBuffer, const VkCopyMicromapToMemoryInfoEXT *pInfo); -void VKAPI_CALL vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags); -void VKAPI_CALL vkCmdCuLaunchKernelNVX(VkCommandBuffer commandBuffer, const VkCuLaunchInfoNVX *pLaunchInfo); -void VKAPI_CALL vkCmdCudaLaunchKernelNV(VkCommandBuffer commandBuffer, const VkCudaLaunchInfoNV *pLaunchInfo); -void VKAPI_CALL vkCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT *pMarkerInfo); -void VKAPI_CALL vkCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer); -void VKAPI_CALL vkCmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT *pMarkerInfo); -void VKAPI_CALL vkCmdDecodeVideoKHR(VkCommandBuffer commandBuffer, const VkVideoDecodeInfoKHR *pDecodeInfo); -void VKAPI_CALL vkCmdDecompressMemoryIndirectCountNV(VkCommandBuffer commandBuffer, VkDeviceAddress indirectCommandsAddress, VkDeviceAddress indirectCommandsCountAddress, uint32_t stride); -void VKAPI_CALL vkCmdDecompressMemoryNV(VkCommandBuffer commandBuffer, uint32_t decompressRegionCount, const VkDecompressMemoryRegionNV *pDecompressMemoryRegions); -void VKAPI_CALL vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); -void VKAPI_CALL vkCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); -void VKAPI_CALL vkCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); -void VKAPI_CALL vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); -void VKAPI_CALL vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); -void VKAPI_CALL vkCmdDrawClusterHUAWEI(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); -void VKAPI_CALL vkCmdDrawClusterIndirectHUAWEI(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); -void VKAPI_CALL vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance); -void VKAPI_CALL vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance, VkBuffer counterBuffer, VkDeviceSize counterBufferOffset, uint32_t counterOffset, uint32_t vertexStride); -void VKAPI_CALL vkCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawMeshTasksEXT(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); -void VKAPI_CALL vkCmdDrawMeshTasksIndirectCountEXT(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawMeshTasksIndirectEXT(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); -void VKAPI_CALL vkCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask); -void VKAPI_CALL vkCmdDrawMultiEXT(VkCommandBuffer commandBuffer, uint32_t drawCount, const VkMultiDrawInfoEXT *pVertexInfo, uint32_t instanceCount, uint32_t firstInstance, uint32_t stride); -void VKAPI_CALL vkCmdDrawMultiIndexedEXT(VkCommandBuffer commandBuffer, uint32_t drawCount, const VkMultiDrawIndexedInfoEXT *pIndexInfo, uint32_t instanceCount, uint32_t firstInstance, uint32_t stride, const int32_t *pVertexOffset); -void VKAPI_CALL vkCmdEncodeVideoKHR(VkCommandBuffer commandBuffer, const VkVideoEncodeInfoKHR *pEncodeInfo); -void VKAPI_CALL vkCmdEndConditionalRenderingEXT(VkCommandBuffer commandBuffer); -void VKAPI_CALL vkCmdEndDebugUtilsLabelEXT(VkCommandBuffer commandBuffer); -void VKAPI_CALL vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query); -void VKAPI_CALL vkCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index); -void VKAPI_CALL vkCmdEndRenderPass(VkCommandBuffer commandBuffer); -void VKAPI_CALL vkCmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfo *pSubpassEndInfo); -void VKAPI_CALL vkCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfo *pSubpassEndInfo); -void VKAPI_CALL vkCmdEndRendering(VkCommandBuffer commandBuffer); -void VKAPI_CALL vkCmdEndRenderingKHR(VkCommandBuffer commandBuffer); -void VKAPI_CALL vkCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer *pCounterBuffers, const VkDeviceSize *pCounterBufferOffsets); -void VKAPI_CALL vkCmdEndVideoCodingKHR(VkCommandBuffer commandBuffer, const VkVideoEndCodingInfoKHR *pEndCodingInfo); -void VKAPI_CALL vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers); -void VKAPI_CALL vkCmdExecuteGeneratedCommandsEXT(VkCommandBuffer commandBuffer, VkBool32 isPreprocessed, const VkGeneratedCommandsInfoEXT *pGeneratedCommandsInfo); -void VKAPI_CALL vkCmdExecuteGeneratedCommandsNV(VkCommandBuffer commandBuffer, VkBool32 isPreprocessed, const VkGeneratedCommandsInfoNV *pGeneratedCommandsInfo); -void VKAPI_CALL vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data); -void VKAPI_CALL vkCmdInsertDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT *pLabelInfo); -void VKAPI_CALL vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents); -void VKAPI_CALL vkCmdNextSubpass2(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo *pSubpassBeginInfo, const VkSubpassEndInfo *pSubpassEndInfo); -void VKAPI_CALL vkCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo *pSubpassBeginInfo, const VkSubpassEndInfo *pSubpassEndInfo); -void VKAPI_CALL vkCmdOpticalFlowExecuteNV(VkCommandBuffer commandBuffer, VkOpticalFlowSessionNV session, const VkOpticalFlowExecuteInfoNV *pExecuteInfo); -void VKAPI_CALL vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers); -void VKAPI_CALL vkCmdPipelineBarrier2(VkCommandBuffer commandBuffer, const VkDependencyInfo *pDependencyInfo); -void VKAPI_CALL vkCmdPipelineBarrier2KHR(VkCommandBuffer commandBuffer, const VkDependencyInfo *pDependencyInfo); -void VKAPI_CALL vkCmdPreprocessGeneratedCommandsEXT(VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoEXT *pGeneratedCommandsInfo, VkCommandBuffer stateCommandBuffer); -void VKAPI_CALL vkCmdPreprocessGeneratedCommandsNV(VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoNV *pGeneratedCommandsInfo); -void VKAPI_CALL vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void *pValues); -void VKAPI_CALL vkCmdPushConstants2(VkCommandBuffer commandBuffer, const VkPushConstantsInfo *pPushConstantsInfo); -void VKAPI_CALL vkCmdPushConstants2KHR(VkCommandBuffer commandBuffer, const VkPushConstantsInfo *pPushConstantsInfo); -void VKAPI_CALL vkCmdPushDescriptorSet(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites); -void VKAPI_CALL vkCmdPushDescriptorSet2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetInfo *pPushDescriptorSetInfo); -void VKAPI_CALL vkCmdPushDescriptorSet2KHR(VkCommandBuffer commandBuffer, const VkPushDescriptorSetInfo *pPushDescriptorSetInfo); -void VKAPI_CALL vkCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites); -void VKAPI_CALL vkCmdPushDescriptorSetWithTemplate(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void *pData); -void VKAPI_CALL vkCmdPushDescriptorSetWithTemplate2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo *pPushDescriptorSetWithTemplateInfo); -void VKAPI_CALL vkCmdPushDescriptorSetWithTemplate2KHR(VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo *pPushDescriptorSetWithTemplateInfo); -void VKAPI_CALL vkCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void *pData); -void VKAPI_CALL vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); -void VKAPI_CALL vkCmdResetEvent2(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask); -void VKAPI_CALL vkCmdResetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask); -void VKAPI_CALL vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); -void VKAPI_CALL vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve *pRegions); -void VKAPI_CALL vkCmdResolveImage2(VkCommandBuffer commandBuffer, const VkResolveImageInfo2 *pResolveImageInfo); -void VKAPI_CALL vkCmdResolveImage2KHR(VkCommandBuffer commandBuffer, const VkResolveImageInfo2 *pResolveImageInfo); -void VKAPI_CALL vkCmdSetAlphaToCoverageEnableEXT(VkCommandBuffer commandBuffer, VkBool32 alphaToCoverageEnable); -void VKAPI_CALL vkCmdSetAlphaToOneEnableEXT(VkCommandBuffer commandBuffer, VkBool32 alphaToOneEnable); -void VKAPI_CALL vkCmdSetAttachmentFeedbackLoopEnableEXT(VkCommandBuffer commandBuffer, VkImageAspectFlags aspectMask); -void VKAPI_CALL vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]); -void VKAPI_CALL vkCmdSetCheckpointNV(VkCommandBuffer commandBuffer, const void *pCheckpointMarker); -void VKAPI_CALL vkCmdSetCoarseSampleOrderNV(VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType, uint32_t customSampleOrderCount, const VkCoarseSampleOrderCustomNV *pCustomSampleOrders); -void VKAPI_CALL vkCmdSetColorBlendAdvancedEXT(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorBlendAdvancedEXT *pColorBlendAdvanced); -void VKAPI_CALL vkCmdSetColorBlendEnableEXT(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkBool32 *pColorBlendEnables); -void VKAPI_CALL vkCmdSetColorBlendEquationEXT(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorBlendEquationEXT *pColorBlendEquations); -void VKAPI_CALL vkCmdSetColorWriteEnableEXT(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkBool32 *pColorWriteEnables); -void VKAPI_CALL vkCmdSetColorWriteMaskEXT(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorComponentFlags *pColorWriteMasks); -void VKAPI_CALL vkCmdSetConservativeRasterizationModeEXT(VkCommandBuffer commandBuffer, VkConservativeRasterizationModeEXT conservativeRasterizationMode); -void VKAPI_CALL vkCmdSetCoverageModulationModeNV(VkCommandBuffer commandBuffer, VkCoverageModulationModeNV coverageModulationMode); -void VKAPI_CALL vkCmdSetCoverageModulationTableEnableNV(VkCommandBuffer commandBuffer, VkBool32 coverageModulationTableEnable); -void VKAPI_CALL vkCmdSetCoverageModulationTableNV(VkCommandBuffer commandBuffer, uint32_t coverageModulationTableCount, const float *pCoverageModulationTable); -void VKAPI_CALL vkCmdSetCoverageReductionModeNV(VkCommandBuffer commandBuffer, VkCoverageReductionModeNV coverageReductionMode); -void VKAPI_CALL vkCmdSetCoverageToColorEnableNV(VkCommandBuffer commandBuffer, VkBool32 coverageToColorEnable); -void VKAPI_CALL vkCmdSetCoverageToColorLocationNV(VkCommandBuffer commandBuffer, uint32_t coverageToColorLocation); -void VKAPI_CALL vkCmdSetCullMode(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode); -void VKAPI_CALL vkCmdSetCullModeEXT(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode); -void VKAPI_CALL vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor); -void VKAPI_CALL vkCmdSetDepthBias2EXT(VkCommandBuffer commandBuffer, const VkDepthBiasInfoEXT *pDepthBiasInfo); -void VKAPI_CALL vkCmdSetDepthBiasEnable(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable); -void VKAPI_CALL vkCmdSetDepthBiasEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable); -void VKAPI_CALL vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds); -void VKAPI_CALL vkCmdSetDepthBoundsTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable); -void VKAPI_CALL vkCmdSetDepthBoundsTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable); -void VKAPI_CALL vkCmdSetDepthClampEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthClampEnable); -void VKAPI_CALL vkCmdSetDepthClampRangeEXT(VkCommandBuffer commandBuffer, VkDepthClampModeEXT depthClampMode, const VkDepthClampRangeEXT *pDepthClampRange); -void VKAPI_CALL vkCmdSetDepthClipEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthClipEnable); -void VKAPI_CALL vkCmdSetDepthClipNegativeOneToOneEXT(VkCommandBuffer commandBuffer, VkBool32 negativeOneToOne); -void VKAPI_CALL vkCmdSetDepthCompareOp(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp); -void VKAPI_CALL vkCmdSetDepthCompareOpEXT(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp); -void VKAPI_CALL vkCmdSetDepthTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable); -void VKAPI_CALL vkCmdSetDepthTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable); -void VKAPI_CALL vkCmdSetDepthWriteEnable(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable); -void VKAPI_CALL vkCmdSetDepthWriteEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable); -void VKAPI_CALL vkCmdSetDescriptorBufferOffsets2EXT(VkCommandBuffer commandBuffer, const VkSetDescriptorBufferOffsetsInfoEXT *pSetDescriptorBufferOffsetsInfo); -void VKAPI_CALL vkCmdSetDescriptorBufferOffsetsEXT(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const uint32_t *pBufferIndices, const VkDeviceSize *pOffsets); -void VKAPI_CALL vkCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask); -void VKAPI_CALL vkCmdSetDeviceMaskKHR(VkCommandBuffer commandBuffer, uint32_t deviceMask); -void VKAPI_CALL vkCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D *pDiscardRectangles); -void VKAPI_CALL vkCmdSetDiscardRectangleEnableEXT(VkCommandBuffer commandBuffer, VkBool32 discardRectangleEnable); -void VKAPI_CALL vkCmdSetDiscardRectangleModeEXT(VkCommandBuffer commandBuffer, VkDiscardRectangleModeEXT discardRectangleMode); -void VKAPI_CALL vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); -void VKAPI_CALL vkCmdSetEvent2(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfo *pDependencyInfo); -void VKAPI_CALL vkCmdSetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfo *pDependencyInfo); -void VKAPI_CALL vkCmdSetExclusiveScissorEnableNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkBool32 *pExclusiveScissorEnables); -void VKAPI_CALL vkCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkRect2D *pExclusiveScissors); -void VKAPI_CALL vkCmdSetExtraPrimitiveOverestimationSizeEXT(VkCommandBuffer commandBuffer, float extraPrimitiveOverestimationSize); -void VKAPI_CALL vkCmdSetFragmentShadingRateEnumNV(VkCommandBuffer commandBuffer, VkFragmentShadingRateNV shadingRate, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]); -void VKAPI_CALL vkCmdSetFragmentShadingRateKHR(VkCommandBuffer commandBuffer, const VkExtent2D *pFragmentSize, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]); -void VKAPI_CALL vkCmdSetFrontFace(VkCommandBuffer commandBuffer, VkFrontFace frontFace); -void VKAPI_CALL vkCmdSetFrontFaceEXT(VkCommandBuffer commandBuffer, VkFrontFace frontFace); -void VKAPI_CALL vkCmdSetLineRasterizationModeEXT(VkCommandBuffer commandBuffer, VkLineRasterizationModeEXT lineRasterizationMode); -void VKAPI_CALL vkCmdSetLineStipple(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern); -void VKAPI_CALL vkCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern); -void VKAPI_CALL vkCmdSetLineStippleEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stippledLineEnable); -void VKAPI_CALL vkCmdSetLineStippleKHR(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern); -void VKAPI_CALL vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth); -void VKAPI_CALL vkCmdSetLogicOpEXT(VkCommandBuffer commandBuffer, VkLogicOp logicOp); -void VKAPI_CALL vkCmdSetLogicOpEnableEXT(VkCommandBuffer commandBuffer, VkBool32 logicOpEnable); -void VKAPI_CALL vkCmdSetPatchControlPointsEXT(VkCommandBuffer commandBuffer, uint32_t patchControlPoints); -VkResult VKAPI_CALL vkCmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer, const VkPerformanceMarkerInfoINTEL *pMarkerInfo); -VkResult VKAPI_CALL vkCmdSetPerformanceOverrideINTEL(VkCommandBuffer commandBuffer, const VkPerformanceOverrideInfoINTEL *pOverrideInfo); -VkResult VKAPI_CALL vkCmdSetPerformanceStreamMarkerINTEL(VkCommandBuffer commandBuffer, const VkPerformanceStreamMarkerInfoINTEL *pMarkerInfo); -void VKAPI_CALL vkCmdSetPolygonModeEXT(VkCommandBuffer commandBuffer, VkPolygonMode polygonMode); -void VKAPI_CALL vkCmdSetPrimitiveRestartEnable(VkCommandBuffer commandBuffer, VkBool32 primitiveRestartEnable); -void VKAPI_CALL vkCmdSetPrimitiveRestartEnableEXT(VkCommandBuffer commandBuffer, VkBool32 primitiveRestartEnable); -void VKAPI_CALL vkCmdSetPrimitiveTopology(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology); -void VKAPI_CALL vkCmdSetPrimitiveTopologyEXT(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology); -void VKAPI_CALL vkCmdSetProvokingVertexModeEXT(VkCommandBuffer commandBuffer, VkProvokingVertexModeEXT provokingVertexMode); -void VKAPI_CALL vkCmdSetRasterizationSamplesEXT(VkCommandBuffer commandBuffer, VkSampleCountFlagBits rasterizationSamples); -void VKAPI_CALL vkCmdSetRasterizationStreamEXT(VkCommandBuffer commandBuffer, uint32_t rasterizationStream); -void VKAPI_CALL vkCmdSetRasterizerDiscardEnable(VkCommandBuffer commandBuffer, VkBool32 rasterizerDiscardEnable); -void VKAPI_CALL vkCmdSetRasterizerDiscardEnableEXT(VkCommandBuffer commandBuffer, VkBool32 rasterizerDiscardEnable); -void VKAPI_CALL vkCmdSetRayTracingPipelineStackSizeKHR(VkCommandBuffer commandBuffer, uint32_t pipelineStackSize); -void VKAPI_CALL vkCmdSetRenderingAttachmentLocations(VkCommandBuffer commandBuffer, const VkRenderingAttachmentLocationInfo *pLocationInfo); -void VKAPI_CALL vkCmdSetRenderingAttachmentLocationsKHR(VkCommandBuffer commandBuffer, const VkRenderingAttachmentLocationInfo *pLocationInfo); -void VKAPI_CALL vkCmdSetRenderingInputAttachmentIndices(VkCommandBuffer commandBuffer, const VkRenderingInputAttachmentIndexInfo *pInputAttachmentIndexInfo); -void VKAPI_CALL vkCmdSetRenderingInputAttachmentIndicesKHR(VkCommandBuffer commandBuffer, const VkRenderingInputAttachmentIndexInfo *pInputAttachmentIndexInfo); -void VKAPI_CALL vkCmdSetRepresentativeFragmentTestEnableNV(VkCommandBuffer commandBuffer, VkBool32 representativeFragmentTestEnable); -void VKAPI_CALL vkCmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT *pSampleLocationsInfo); -void VKAPI_CALL vkCmdSetSampleLocationsEnableEXT(VkCommandBuffer commandBuffer, VkBool32 sampleLocationsEnable); -void VKAPI_CALL vkCmdSetSampleMaskEXT(VkCommandBuffer commandBuffer, VkSampleCountFlagBits samples, const VkSampleMask *pSampleMask); -void VKAPI_CALL vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D *pScissors); -void VKAPI_CALL vkCmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D *pScissors); -void VKAPI_CALL vkCmdSetScissorWithCountEXT(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D *pScissors); -void VKAPI_CALL vkCmdSetShadingRateImageEnableNV(VkCommandBuffer commandBuffer, VkBool32 shadingRateImageEnable); -void VKAPI_CALL vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask); -void VKAPI_CALL vkCmdSetStencilOp(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp); -void VKAPI_CALL vkCmdSetStencilOpEXT(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp); -void VKAPI_CALL vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference); -void VKAPI_CALL vkCmdSetStencilTestEnable(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable); -void VKAPI_CALL vkCmdSetStencilTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable); -void VKAPI_CALL vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask); -void VKAPI_CALL vkCmdSetTessellationDomainOriginEXT(VkCommandBuffer commandBuffer, VkTessellationDomainOrigin domainOrigin); -void VKAPI_CALL vkCmdSetVertexInputEXT(VkCommandBuffer commandBuffer, uint32_t vertexBindingDescriptionCount, const VkVertexInputBindingDescription2EXT *pVertexBindingDescriptions, uint32_t vertexAttributeDescriptionCount, const VkVertexInputAttributeDescription2EXT *pVertexAttributeDescriptions); -void VKAPI_CALL vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport *pViewports); -void VKAPI_CALL vkCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkShadingRatePaletteNV *pShadingRatePalettes); -void VKAPI_CALL vkCmdSetViewportSwizzleNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportSwizzleNV *pViewportSwizzles); -void VKAPI_CALL vkCmdSetViewportWScalingEnableNV(VkCommandBuffer commandBuffer, VkBool32 viewportWScalingEnable); -void VKAPI_CALL vkCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV *pViewportWScalings); -void VKAPI_CALL vkCmdSetViewportWithCount(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport *pViewports); -void VKAPI_CALL vkCmdSetViewportWithCountEXT(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport *pViewports); -void VKAPI_CALL vkCmdSubpassShadingHUAWEI(VkCommandBuffer commandBuffer); -void VKAPI_CALL vkCmdTraceRaysIndirect2KHR(VkCommandBuffer commandBuffer, VkDeviceAddress indirectDeviceAddress); -void VKAPI_CALL vkCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable, VkDeviceAddress indirectDeviceAddress); -void VKAPI_CALL vkCmdTraceRaysKHR(VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable, uint32_t width, uint32_t height, uint32_t depth); -void VKAPI_CALL vkCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, uint32_t width, uint32_t height, uint32_t depth); -void VKAPI_CALL vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void *pData); -void VKAPI_CALL vkCmdUpdatePipelineIndirectBufferNV(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); -void VKAPI_CALL vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers); -void VKAPI_CALL vkCmdWaitEvents2(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, const VkDependencyInfo *pDependencyInfos); -void VKAPI_CALL vkCmdWaitEvents2KHR(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, const VkDependencyInfo *pDependencyInfos); -void VKAPI_CALL vkCmdWriteAccelerationStructuresPropertiesKHR(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR *pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery); -void VKAPI_CALL vkCmdWriteAccelerationStructuresPropertiesNV(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureNV *pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery); -void VKAPI_CALL vkCmdWriteBufferMarker2AMD(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker); -void VKAPI_CALL vkCmdWriteBufferMarkerAMD(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker); -void VKAPI_CALL vkCmdWriteMicromapsPropertiesEXT(VkCommandBuffer commandBuffer, uint32_t micromapCount, const VkMicromapEXT *pMicromaps, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery); -void VKAPI_CALL vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query); -void VKAPI_CALL vkCmdWriteTimestamp2(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkQueryPool queryPool, uint32_t query); -void VKAPI_CALL vkCmdWriteTimestamp2KHR(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkQueryPool queryPool, uint32_t query); -VkResult VKAPI_CALL vkCompileDeferredNV(VkDevice device, VkPipeline pipeline, uint32_t shader); -VkResult VKAPI_CALL vkCopyAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureInfoKHR *pInfo); -VkResult VKAPI_CALL vkCopyAccelerationStructureToMemoryKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo); -VkResult VKAPI_CALL vkCopyImageToImage(VkDevice device, const VkCopyImageToImageInfo *pCopyImageToImageInfo); -VkResult VKAPI_CALL vkCopyImageToImageEXT(VkDevice device, const VkCopyImageToImageInfo *pCopyImageToImageInfo); -VkResult VKAPI_CALL vkCopyImageToMemory(VkDevice device, const VkCopyImageToMemoryInfo *pCopyImageToMemoryInfo); -VkResult VKAPI_CALL vkCopyImageToMemoryEXT(VkDevice device, const VkCopyImageToMemoryInfo *pCopyImageToMemoryInfo); -VkResult VKAPI_CALL vkCopyMemoryToAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo); -VkResult VKAPI_CALL vkCopyMemoryToImage(VkDevice device, const VkCopyMemoryToImageInfo *pCopyMemoryToImageInfo); -VkResult VKAPI_CALL vkCopyMemoryToImageEXT(VkDevice device, const VkCopyMemoryToImageInfo *pCopyMemoryToImageInfo); -VkResult VKAPI_CALL vkCopyMemoryToMicromapEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToMicromapInfoEXT *pInfo); -VkResult VKAPI_CALL vkCopyMicromapEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMicromapInfoEXT *pInfo); -VkResult VKAPI_CALL vkCopyMicromapToMemoryEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMicromapToMemoryInfoEXT *pInfo); -VkResult VKAPI_CALL vkCreateAccelerationStructureKHR(VkDevice device, const VkAccelerationStructureCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkAccelerationStructureKHR *pAccelerationStructure); -VkResult VKAPI_CALL vkCreateAccelerationStructureNV(VkDevice device, const VkAccelerationStructureCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkAccelerationStructureNV *pAccelerationStructure); -VkResult VKAPI_CALL vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer); -VkResult VKAPI_CALL vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBufferView *pView); -VkResult VKAPI_CALL vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCommandPool *pCommandPool); -VkResult VKAPI_CALL vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines); -VkResult VKAPI_CALL vkCreateCuFunctionNVX(VkDevice device, const VkCuFunctionCreateInfoNVX *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCuFunctionNVX *pFunction); -VkResult VKAPI_CALL vkCreateCuModuleNVX(VkDevice device, const VkCuModuleCreateInfoNVX *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCuModuleNVX *pModule); -VkResult VKAPI_CALL vkCreateCudaFunctionNV(VkDevice device, const VkCudaFunctionCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCudaFunctionNV *pFunction); -VkResult VKAPI_CALL vkCreateCudaModuleNV(VkDevice device, const VkCudaModuleCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCudaModuleNV *pModule); -VkResult VKAPI_CALL vkCreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT *pCallback); -VkResult VKAPI_CALL vkCreateDebugUtilsMessengerEXT(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerEXT *pMessenger); -VkResult VKAPI_CALL vkCreateDeferredOperationKHR(VkDevice device, const VkAllocationCallbacks *pAllocator, VkDeferredOperationKHR *pDeferredOperation); -VkResult VKAPI_CALL vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorPool *pDescriptorPool); -VkResult VKAPI_CALL vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorSetLayout *pSetLayout); -VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorUpdateTemplate *pDescriptorUpdateTemplate); -VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplateKHR(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorUpdateTemplate *pDescriptorUpdateTemplate); -VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDevice *pDevice); -VkResult VKAPI_CALL vkCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkEvent *pEvent); -VkResult VKAPI_CALL vkCreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFence *pFence); -VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFramebuffer *pFramebuffer); -VkResult VKAPI_CALL vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines); -VkResult VKAPI_CALL vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImage *pImage); -VkResult VKAPI_CALL vkCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImageView *pView); -VkResult VKAPI_CALL vkCreateIndirectCommandsLayoutEXT(VkDevice device, const VkIndirectCommandsLayoutCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkIndirectCommandsLayoutEXT *pIndirectCommandsLayout); -VkResult VKAPI_CALL vkCreateIndirectCommandsLayoutNV(VkDevice device, const VkIndirectCommandsLayoutCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkIndirectCommandsLayoutNV *pIndirectCommandsLayout); -VkResult VKAPI_CALL vkCreateIndirectExecutionSetEXT(VkDevice device, const VkIndirectExecutionSetCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkIndirectExecutionSetEXT *pIndirectExecutionSet); -VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkInstance *pInstance); -VkResult VKAPI_CALL vkCreateMicromapEXT(VkDevice device, const VkMicromapCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkMicromapEXT *pMicromap); -VkResult VKAPI_CALL vkCreateOpticalFlowSessionNV(VkDevice device, const VkOpticalFlowSessionCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkOpticalFlowSessionNV *pSession); -VkResult VKAPI_CALL vkCreatePipelineBinariesKHR(VkDevice device, const VkPipelineBinaryCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineBinaryHandlesInfoKHR *pBinaries); -VkResult VKAPI_CALL vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineCache *pPipelineCache); -VkResult VKAPI_CALL vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineLayout *pPipelineLayout); -VkResult VKAPI_CALL vkCreatePrivateDataSlot(VkDevice device, const VkPrivateDataSlotCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPrivateDataSlot *pPrivateDataSlot); -VkResult VKAPI_CALL vkCreatePrivateDataSlotEXT(VkDevice device, const VkPrivateDataSlotCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPrivateDataSlot *pPrivateDataSlot); -VkResult VKAPI_CALL vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkQueryPool *pQueryPool); -VkResult VKAPI_CALL vkCreateRayTracingPipelinesKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines); -VkResult VKAPI_CALL vkCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines); -VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass); -VkResult VKAPI_CALL vkCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2 *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass); -VkResult VKAPI_CALL vkCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2 *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass); -VkResult VKAPI_CALL vkCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSampler *pSampler); -VkResult VKAPI_CALL vkCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSamplerYcbcrConversion *pYcbcrConversion); -VkResult VKAPI_CALL vkCreateSamplerYcbcrConversionKHR(VkDevice device, const VkSamplerYcbcrConversionCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSamplerYcbcrConversion *pYcbcrConversion); -VkResult VKAPI_CALL vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSemaphore *pSemaphore); -VkResult VKAPI_CALL vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkShaderModule *pShaderModule); -VkResult VKAPI_CALL vkCreateShadersEXT(VkDevice device, uint32_t createInfoCount, const VkShaderCreateInfoEXT *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkShaderEXT *pShaders); -VkResult VKAPI_CALL vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain); -VkResult VKAPI_CALL vkCreateValidationCacheEXT(VkDevice device, const VkValidationCacheCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkValidationCacheEXT *pValidationCache); -VkResult VKAPI_CALL vkCreateVideoSessionKHR(VkDevice device, const VkVideoSessionCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkVideoSessionKHR *pVideoSession); -VkResult VKAPI_CALL vkCreateVideoSessionParametersKHR(VkDevice device, const VkVideoSessionParametersCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkVideoSessionParametersKHR *pVideoSessionParameters); -VkResult VKAPI_CALL vkCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); -VkResult VKAPI_CALL vkDebugMarkerSetObjectNameEXT(VkDevice device, const VkDebugMarkerObjectNameInfoEXT *pNameInfo); -VkResult VKAPI_CALL vkDebugMarkerSetObjectTagEXT(VkDevice device, const VkDebugMarkerObjectTagInfoEXT *pTagInfo); -void VKAPI_CALL vkDebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char *pLayerPrefix, const char *pMessage); -VkResult VKAPI_CALL vkDeferredOperationJoinKHR(VkDevice device, VkDeferredOperationKHR operation); -void VKAPI_CALL vkDestroyAccelerationStructureKHR(VkDevice device, VkAccelerationStructureKHR accelerationStructure, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyAccelerationStructureNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyCuFunctionNVX(VkDevice device, VkCuFunctionNVX function, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyCuModuleNVX(VkDevice device, VkCuModuleNVX module, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyCudaFunctionNV(VkDevice device, VkCudaFunctionNV function, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyCudaModuleNV(VkDevice device, VkCudaModuleNV module, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyDeferredOperationKHR(VkDevice device, VkDeferredOperationKHR operation, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyDescriptorUpdateTemplate(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyIndirectCommandsLayoutEXT(VkDevice device, VkIndirectCommandsLayoutEXT indirectCommandsLayout, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyIndirectCommandsLayoutNV(VkDevice device, VkIndirectCommandsLayoutNV indirectCommandsLayout, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyIndirectExecutionSetEXT(VkDevice device, VkIndirectExecutionSetEXT indirectExecutionSet, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyMicromapEXT(VkDevice device, VkMicromapEXT micromap, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyOpticalFlowSessionNV(VkDevice device, VkOpticalFlowSessionNV session, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyPipelineBinaryKHR(VkDevice device, VkPipelineBinaryKHR pipelineBinary, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyPrivateDataSlot(VkDevice device, VkPrivateDataSlot privateDataSlot, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyPrivateDataSlotEXT(VkDevice device, VkPrivateDataSlot privateDataSlot, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroySamplerYcbcrConversion(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroySamplerYcbcrConversionKHR(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyShaderEXT(VkDevice device, VkShaderEXT shader, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyValidationCacheEXT(VkDevice device, VkValidationCacheEXT validationCache, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyVideoSessionKHR(VkDevice device, VkVideoSessionKHR videoSession, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkDestroyVideoSessionParametersKHR(VkDevice device, VkVideoSessionParametersKHR videoSessionParameters, const VkAllocationCallbacks *pAllocator); -VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device); -VkResult VKAPI_CALL vkEndCommandBuffer(VkCommandBuffer commandBuffer); -VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties); -VkResult VKAPI_CALL vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkLayerProperties *pProperties); -VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties); -VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties(uint32_t *pPropertyCount, VkLayerProperties *pProperties); -VkResult VKAPI_CALL vkEnumerateInstanceVersion(uint32_t *pApiVersion); -VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties); -VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroupsKHR(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties); -VkResult VKAPI_CALL vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, uint32_t *pCounterCount, VkPerformanceCounterKHR *pCounters, VkPerformanceCounterDescriptionKHR *pCounterDescriptions); -VkResult VKAPI_CALL vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, VkPhysicalDevice *pPhysicalDevices); -VkResult VKAPI_CALL vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange *pMemoryRanges); -void VKAPI_CALL vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers); -VkResult VKAPI_CALL vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet *pDescriptorSets); -void VKAPI_CALL vkFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks *pAllocator); -void VKAPI_CALL vkGetAccelerationStructureBuildSizesKHR(VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, const VkAccelerationStructureBuildGeometryInfoKHR *pBuildInfo, const uint32_t *pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR *pSizeInfo); -VkDeviceAddress VKAPI_CALL vkGetAccelerationStructureDeviceAddressKHR(VkDevice device, const VkAccelerationStructureDeviceAddressInfoKHR *pInfo); -VkResult VKAPI_CALL vkGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, size_t dataSize, void *pData); -void VKAPI_CALL vkGetAccelerationStructureMemoryRequirementsNV(VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNV *pInfo, VkMemoryRequirements2KHR *pMemoryRequirements); -VkResult VKAPI_CALL vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkAccelerationStructureCaptureDescriptorDataInfoEXT *pInfo, void *pData); -VkDeviceAddress VKAPI_CALL vkGetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo *pInfo); -VkDeviceAddress VKAPI_CALL vkGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfo *pInfo); -VkDeviceAddress VKAPI_CALL vkGetBufferDeviceAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo *pInfo); -void VKAPI_CALL vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements *pMemoryRequirements); -void VKAPI_CALL vkGetBufferMemoryRequirements2(VkDevice device, const VkBufferMemoryRequirementsInfo2 *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -void VKAPI_CALL vkGetBufferMemoryRequirements2KHR(VkDevice device, const VkBufferMemoryRequirementsInfo2 *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -uint64_t VKAPI_CALL vkGetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfo *pInfo); -uint64_t VKAPI_CALL vkGetBufferOpaqueCaptureAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo *pInfo); -VkResult VKAPI_CALL vkGetBufferOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkBufferCaptureDescriptorDataInfoEXT *pInfo, void *pData); -VkResult VKAPI_CALL vkGetCalibratedTimestampsEXT(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoKHR *pTimestampInfos, uint64_t *pTimestamps, uint64_t *pMaxDeviation); -VkResult VKAPI_CALL vkGetCalibratedTimestampsKHR(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoKHR *pTimestampInfos, uint64_t *pTimestamps, uint64_t *pMaxDeviation); -VkResult VKAPI_CALL vkGetCudaModuleCacheNV(VkDevice device, VkCudaModuleNV module, size_t *pCacheSize, void *pCacheData); -uint32_t VKAPI_CALL vkGetDeferredOperationMaxConcurrencyKHR(VkDevice device, VkDeferredOperationKHR operation); -VkResult VKAPI_CALL vkGetDeferredOperationResultKHR(VkDevice device, VkDeferredOperationKHR operation); -void VKAPI_CALL vkGetDescriptorEXT(VkDevice device, const VkDescriptorGetInfoEXT *pDescriptorInfo, size_t dataSize, void *pDescriptor); -void VKAPI_CALL vkGetDescriptorSetHostMappingVALVE(VkDevice device, VkDescriptorSet descriptorSet, void **ppData); -void VKAPI_CALL vkGetDescriptorSetLayoutBindingOffsetEXT(VkDevice device, VkDescriptorSetLayout layout, uint32_t binding, VkDeviceSize *pOffset); -void VKAPI_CALL vkGetDescriptorSetLayoutHostMappingInfoVALVE(VkDevice device, const VkDescriptorSetBindingReferenceVALVE *pBindingReference, VkDescriptorSetLayoutHostMappingInfoVALVE *pHostMapping); -void VKAPI_CALL vkGetDescriptorSetLayoutSizeEXT(VkDevice device, VkDescriptorSetLayout layout, VkDeviceSize *pLayoutSizeInBytes); -void VKAPI_CALL vkGetDescriptorSetLayoutSupport(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, VkDescriptorSetLayoutSupport *pSupport); -void VKAPI_CALL vkGetDescriptorSetLayoutSupportKHR(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, VkDescriptorSetLayoutSupport *pSupport); -void VKAPI_CALL vkGetDeviceAccelerationStructureCompatibilityKHR(VkDevice device, const VkAccelerationStructureVersionInfoKHR *pVersionInfo, VkAccelerationStructureCompatibilityKHR *pCompatibility); -void VKAPI_CALL vkGetDeviceBufferMemoryRequirements(VkDevice device, const VkDeviceBufferMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -void VKAPI_CALL vkGetDeviceBufferMemoryRequirementsKHR(VkDevice device, const VkDeviceBufferMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -VkResult VKAPI_CALL vkGetDeviceFaultInfoEXT(VkDevice device, VkDeviceFaultCountsEXT *pFaultCounts, VkDeviceFaultInfoEXT *pFaultInfo); -void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeatures(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags *pPeerMemoryFeatures); -void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeaturesKHR(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags *pPeerMemoryFeatures); -VkResult VKAPI_CALL vkGetDeviceGroupPresentCapabilitiesKHR(VkDevice device, VkDeviceGroupPresentCapabilitiesKHR *pDeviceGroupPresentCapabilities); -VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModesKHR(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR *pModes); -void VKAPI_CALL vkGetDeviceImageMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -void VKAPI_CALL vkGetDeviceImageMemoryRequirementsKHR(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -void VKAPI_CALL vkGetDeviceImageSparseMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements); -void VKAPI_CALL vkGetDeviceImageSparseMemoryRequirementsKHR(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements); -void VKAPI_CALL vkGetDeviceImageSubresourceLayout(VkDevice device, const VkDeviceImageSubresourceInfo *pInfo, VkSubresourceLayout2 *pLayout); -void VKAPI_CALL vkGetDeviceImageSubresourceLayoutKHR(VkDevice device, const VkDeviceImageSubresourceInfo *pInfo, VkSubresourceLayout2 *pLayout); -void VKAPI_CALL vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize *pCommittedMemoryInBytes); -uint64_t VKAPI_CALL vkGetDeviceMemoryOpaqueCaptureAddress(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo *pInfo); -uint64_t VKAPI_CALL vkGetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo *pInfo); -void VKAPI_CALL vkGetDeviceMicromapCompatibilityEXT(VkDevice device, const VkMicromapVersionInfoEXT *pVersionInfo, VkAccelerationStructureCompatibilityKHR *pCompatibility); -PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char *pName); -void VKAPI_CALL vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue *pQueue); -void VKAPI_CALL vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2 *pQueueInfo, VkQueue *pQueue); -VkResult VKAPI_CALL vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(VkDevice device, VkRenderPass renderpass, VkExtent2D *pMaxWorkgroupSize); -VkResult VKAPI_CALL vkGetDynamicRenderingTilePropertiesQCOM(VkDevice device, const VkRenderingInfo *pRenderingInfo, VkTilePropertiesQCOM *pProperties); -VkResult VKAPI_CALL vkGetEncodedVideoSessionParametersKHR(VkDevice device, const VkVideoEncodeSessionParametersGetInfoKHR *pVideoSessionParametersInfo, VkVideoEncodeSessionParametersFeedbackInfoKHR *pFeedbackInfo, size_t *pDataSize, void *pData); -VkResult VKAPI_CALL vkGetEventStatus(VkDevice device, VkEvent event); -VkResult VKAPI_CALL vkGetFenceStatus(VkDevice device, VkFence fence); -VkResult VKAPI_CALL vkGetFramebufferTilePropertiesQCOM(VkDevice device, VkFramebuffer framebuffer, uint32_t *pPropertiesCount, VkTilePropertiesQCOM *pProperties); -void VKAPI_CALL vkGetGeneratedCommandsMemoryRequirementsEXT(VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoEXT *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -void VKAPI_CALL vkGetGeneratedCommandsMemoryRequirementsNV(VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoNV *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -void VKAPI_CALL vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements *pMemoryRequirements); -void VKAPI_CALL vkGetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -void VKAPI_CALL vkGetImageMemoryRequirements2KHR(VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo, VkMemoryRequirements2 *pMemoryRequirements); -VkResult VKAPI_CALL vkGetImageOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkImageCaptureDescriptorDataInfoEXT *pInfo, void *pData); -void VKAPI_CALL vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements *pSparseMemoryRequirements); -void VKAPI_CALL vkGetImageSparseMemoryRequirements2(VkDevice device, const VkImageSparseMemoryRequirementsInfo2 *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements); -void VKAPI_CALL vkGetImageSparseMemoryRequirements2KHR(VkDevice device, const VkImageSparseMemoryRequirementsInfo2 *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements); -void VKAPI_CALL vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource *pSubresource, VkSubresourceLayout *pLayout); -void VKAPI_CALL vkGetImageSubresourceLayout2(VkDevice device, VkImage image, const VkImageSubresource2 *pSubresource, VkSubresourceLayout2 *pLayout); -void VKAPI_CALL vkGetImageSubresourceLayout2EXT(VkDevice device, VkImage image, const VkImageSubresource2 *pSubresource, VkSubresourceLayout2 *pLayout); -void VKAPI_CALL vkGetImageSubresourceLayout2KHR(VkDevice device, VkImage image, const VkImageSubresource2 *pSubresource, VkSubresourceLayout2 *pLayout); -VkResult VKAPI_CALL vkGetImageViewAddressNVX(VkDevice device, VkImageView imageView, VkImageViewAddressPropertiesNVX *pProperties); -uint64_t VKAPI_CALL vkGetImageViewHandle64NVX(VkDevice device, const VkImageViewHandleInfoNVX *pInfo); -uint32_t VKAPI_CALL vkGetImageViewHandleNVX(VkDevice device, const VkImageViewHandleInfoNVX *pInfo); -VkResult VKAPI_CALL vkGetImageViewOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkImageViewCaptureDescriptorDataInfoEXT *pInfo, void *pData); -PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char *pName); -void VKAPI_CALL vkGetLatencyTimingsNV(VkDevice device, VkSwapchainKHR swapchain, VkGetLatencyMarkerInfoNV *pLatencyMarkerInfo); -VkResult VKAPI_CALL vkGetMemoryHostPointerPropertiesEXT(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void *pHostPointer, VkMemoryHostPointerPropertiesEXT *pMemoryHostPointerProperties); -VkResult VKAPI_CALL vkGetMemoryWin32HandleKHR(VkDevice device, const VkMemoryGetWin32HandleInfoKHR *pGetWin32HandleInfo, HANDLE *pHandle); -VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR *pMemoryWin32HandleProperties); -void VKAPI_CALL vkGetMicromapBuildSizesEXT(VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, const VkMicromapBuildInfoEXT *pBuildInfo, VkMicromapBuildSizesInfoEXT *pSizeInfo); -VkResult VKAPI_CALL vkGetPerformanceParameterINTEL(VkDevice device, VkPerformanceParameterTypeINTEL parameter, VkPerformanceValueINTEL *pValue); -VkResult VKAPI_CALL vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice physicalDevice, uint32_t *pTimeDomainCount, VkTimeDomainKHR *pTimeDomains); -VkResult VKAPI_CALL vkGetPhysicalDeviceCalibrateableTimeDomainsKHR(VkPhysicalDevice physicalDevice, uint32_t *pTimeDomainCount, VkTimeDomainKHR *pTimeDomains); -VkResult VKAPI_CALL vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkCooperativeMatrixFlexibleDimensionsPropertiesNV *pProperties); -VkResult VKAPI_CALL vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkCooperativeMatrixPropertiesKHR *pProperties); -VkResult VKAPI_CALL vkGetPhysicalDeviceCooperativeMatrixPropertiesNV(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkCooperativeMatrixPropertiesNV *pProperties); -void VKAPI_CALL vkGetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, VkExternalBufferProperties *pExternalBufferProperties); -void VKAPI_CALL vkGetPhysicalDeviceExternalBufferPropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, VkExternalBufferProperties *pExternalBufferProperties); -void VKAPI_CALL vkGetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties); -void VKAPI_CALL vkGetPhysicalDeviceExternalFencePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties); -void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties); -void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties); -void VKAPI_CALL vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures *pFeatures); -void VKAPI_CALL vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2 *pFeatures); -void VKAPI_CALL vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2 *pFeatures); -void VKAPI_CALL vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties *pFormatProperties); -void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2 *pFormatProperties); -void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2 *pFormatProperties); -VkResult VKAPI_CALL vkGetPhysicalDeviceFragmentShadingRatesKHR(VkPhysicalDevice physicalDevice, uint32_t *pFragmentShadingRateCount, VkPhysicalDeviceFragmentShadingRateKHR *pFragmentShadingRates); -VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties *pImageFormatProperties); -VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties); -VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties); -void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties *pMemoryProperties); -void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2 *pMemoryProperties); -void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2 *pMemoryProperties); -void VKAPI_CALL vkGetPhysicalDeviceMultisamplePropertiesEXT(VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT *pMultisampleProperties); -VkResult VKAPI_CALL vkGetPhysicalDeviceOpticalFlowImageFormatsNV(VkPhysicalDevice physicalDevice, const VkOpticalFlowImageFormatInfoNV *pOpticalFlowImageFormatInfo, uint32_t *pFormatCount, VkOpticalFlowImageFormatPropertiesNV *pImageFormatProperties); -VkResult VKAPI_CALL vkGetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pRectCount, VkRect2D *pRects); -void VKAPI_CALL vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties); -void VKAPI_CALL vkGetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 *pProperties); -void VKAPI_CALL vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 *pProperties); -void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(VkPhysicalDevice physicalDevice, const VkQueryPoolPerformanceCreateInfoKHR *pPerformanceQueryCreateInfo, uint32_t *pNumPasses); -void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties *pQueueFamilyProperties); -void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties2 *pQueueFamilyProperties); -void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties2 *pQueueFamilyProperties); -void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t *pPropertyCount, VkSparseImageFormatProperties *pProperties); -void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *pFormatInfo, uint32_t *pPropertyCount, VkSparseImageFormatProperties2 *pProperties); -void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *pFormatInfo, uint32_t *pPropertyCount, VkSparseImageFormatProperties2 *pProperties); -VkResult VKAPI_CALL vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(VkPhysicalDevice physicalDevice, uint32_t *pCombinationCount, VkFramebufferMixedSamplesCombinationNV *pCombinations); -VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, VkSurfaceCapabilities2KHR *pSurfaceCapabilities); -VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *pSurfaceCapabilities); -VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, uint32_t *pSurfaceFormatCount, VkSurfaceFormat2KHR *pSurfaceFormats); -VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats); -VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes); -VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32 *pSupported); -VkResult VKAPI_CALL vkGetPhysicalDeviceToolProperties(VkPhysicalDevice physicalDevice, uint32_t *pToolCount, VkPhysicalDeviceToolProperties *pToolProperties); -VkResult VKAPI_CALL vkGetPhysicalDeviceToolPropertiesEXT(VkPhysicalDevice physicalDevice, uint32_t *pToolCount, VkPhysicalDeviceToolProperties *pToolProperties); -VkResult VKAPI_CALL vkGetPhysicalDeviceVideoCapabilitiesKHR(VkPhysicalDevice physicalDevice, const VkVideoProfileInfoKHR *pVideoProfile, VkVideoCapabilitiesKHR *pCapabilities); -VkResult VKAPI_CALL vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR *pQualityLevelInfo, VkVideoEncodeQualityLevelPropertiesKHR *pQualityLevelProperties); -VkResult VKAPI_CALL vkGetPhysicalDeviceVideoFormatPropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceVideoFormatInfoKHR *pVideoFormatInfo, uint32_t *pVideoFormatPropertyCount, VkVideoFormatPropertiesKHR *pVideoFormatProperties); -VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex); -VkResult VKAPI_CALL vkGetPipelineBinaryDataKHR(VkDevice device, const VkPipelineBinaryDataInfoKHR *pInfo, VkPipelineBinaryKeyKHR *pPipelineBinaryKey, size_t *pPipelineBinaryDataSize, void *pPipelineBinaryData); -VkResult VKAPI_CALL vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t *pDataSize, void *pData); -VkResult VKAPI_CALL vkGetPipelineExecutableInternalRepresentationsKHR(VkDevice device, const VkPipelineExecutableInfoKHR *pExecutableInfo, uint32_t *pInternalRepresentationCount, VkPipelineExecutableInternalRepresentationKHR *pInternalRepresentations); -VkResult VKAPI_CALL vkGetPipelineExecutablePropertiesKHR(VkDevice device, const VkPipelineInfoKHR *pPipelineInfo, uint32_t *pExecutableCount, VkPipelineExecutablePropertiesKHR *pProperties); -VkResult VKAPI_CALL vkGetPipelineExecutableStatisticsKHR(VkDevice device, const VkPipelineExecutableInfoKHR *pExecutableInfo, uint32_t *pStatisticCount, VkPipelineExecutableStatisticKHR *pStatistics); -VkDeviceAddress VKAPI_CALL vkGetPipelineIndirectDeviceAddressNV(VkDevice device, const VkPipelineIndirectDeviceAddressInfoNV *pInfo); -void VKAPI_CALL vkGetPipelineIndirectMemoryRequirementsNV(VkDevice device, const VkComputePipelineCreateInfo *pCreateInfo, VkMemoryRequirements2 *pMemoryRequirements); -VkResult VKAPI_CALL vkGetPipelineKeyKHR(VkDevice device, const VkPipelineCreateInfoKHR *pPipelineCreateInfo, VkPipelineBinaryKeyKHR *pPipelineKey); -VkResult VKAPI_CALL vkGetPipelinePropertiesEXT(VkDevice device, const VkPipelineInfoEXT *pPipelineInfo, VkBaseOutStructure *pPipelineProperties); -void VKAPI_CALL vkGetPrivateData(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t *pData); -void VKAPI_CALL vkGetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t *pData); -VkResult VKAPI_CALL vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void *pData, VkDeviceSize stride, VkQueryResultFlags flags); -void VKAPI_CALL vkGetQueueCheckpointData2NV(VkQueue queue, uint32_t *pCheckpointDataCount, VkCheckpointData2NV *pCheckpointData); -void VKAPI_CALL vkGetQueueCheckpointDataNV(VkQueue queue, uint32_t *pCheckpointDataCount, VkCheckpointDataNV *pCheckpointData); -VkResult VKAPI_CALL vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void *pData); -VkResult VKAPI_CALL vkGetRayTracingShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void *pData); -VkResult VKAPI_CALL vkGetRayTracingShaderGroupHandlesNV(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void *pData); -VkDeviceSize VKAPI_CALL vkGetRayTracingShaderGroupStackSizeKHR(VkDevice device, VkPipeline pipeline, uint32_t group, VkShaderGroupShaderKHR groupShader); -void VKAPI_CALL vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D *pGranularity); -void VKAPI_CALL vkGetRenderingAreaGranularity(VkDevice device, const VkRenderingAreaInfo *pRenderingAreaInfo, VkExtent2D *pGranularity); -void VKAPI_CALL vkGetRenderingAreaGranularityKHR(VkDevice device, const VkRenderingAreaInfo *pRenderingAreaInfo, VkExtent2D *pGranularity); -VkResult VKAPI_CALL vkGetSamplerOpaqueCaptureDescriptorDataEXT(VkDevice device, const VkSamplerCaptureDescriptorDataInfoEXT *pInfo, void *pData); -VkResult VKAPI_CALL vkGetSemaphoreCounterValue(VkDevice device, VkSemaphore semaphore, uint64_t *pValue); -VkResult VKAPI_CALL vkGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore semaphore, uint64_t *pValue); -VkResult VKAPI_CALL vkGetShaderBinaryDataEXT(VkDevice device, VkShaderEXT shader, size_t *pDataSize, void *pData); -VkResult VKAPI_CALL vkGetShaderInfoAMD(VkDevice device, VkPipeline pipeline, VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType, size_t *pInfoSize, void *pInfo); -void VKAPI_CALL vkGetShaderModuleCreateInfoIdentifierEXT(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo, VkShaderModuleIdentifierEXT *pIdentifier); -void VKAPI_CALL vkGetShaderModuleIdentifierEXT(VkDevice device, VkShaderModule shaderModule, VkShaderModuleIdentifierEXT *pIdentifier); -VkResult VKAPI_CALL vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pSwapchainImageCount, VkImage *pSwapchainImages); -VkResult VKAPI_CALL vkGetValidationCacheDataEXT(VkDevice device, VkValidationCacheEXT validationCache, size_t *pDataSize, void *pData); -VkResult VKAPI_CALL vkGetVideoSessionMemoryRequirementsKHR(VkDevice device, VkVideoSessionKHR videoSession, uint32_t *pMemoryRequirementsCount, VkVideoSessionMemoryRequirementsKHR *pMemoryRequirements); -VkResult VKAPI_CALL vkInitializePerformanceApiINTEL(VkDevice device, const VkInitializePerformanceApiInfoINTEL *pInitializeInfo); -VkResult VKAPI_CALL vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange *pMemoryRanges); -VkResult VKAPI_CALL vkLatencySleepNV(VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepInfoNV *pSleepInfo); -VkResult VKAPI_CALL vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void **ppData); -VkResult VKAPI_CALL vkMapMemory2(VkDevice device, const VkMemoryMapInfo *pMemoryMapInfo, void **ppData); -VkResult VKAPI_CALL vkMapMemory2KHR(VkDevice device, const VkMemoryMapInfo *pMemoryMapInfo, void **ppData); -VkResult VKAPI_CALL vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache *pSrcCaches); -VkResult VKAPI_CALL vkMergeValidationCachesEXT(VkDevice device, VkValidationCacheEXT dstCache, uint32_t srcCacheCount, const VkValidationCacheEXT *pSrcCaches); -void VKAPI_CALL vkQueueBeginDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT *pLabelInfo); -VkResult VKAPI_CALL vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo *pBindInfo, VkFence fence); -void VKAPI_CALL vkQueueEndDebugUtilsLabelEXT(VkQueue queue); -void VKAPI_CALL vkQueueInsertDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT *pLabelInfo); -void VKAPI_CALL vkQueueNotifyOutOfBandNV(VkQueue queue, const VkOutOfBandQueueTypeInfoNV *pQueueTypeInfo); -VkResult VKAPI_CALL vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo); -VkResult VKAPI_CALL vkQueueSetPerformanceConfigurationINTEL(VkQueue queue, VkPerformanceConfigurationINTEL configuration); -VkResult VKAPI_CALL vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence); -VkResult VKAPI_CALL vkQueueSubmit2(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2 *pSubmits, VkFence fence); -VkResult VKAPI_CALL vkQueueSubmit2KHR(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2 *pSubmits, VkFence fence); -VkResult VKAPI_CALL vkQueueWaitIdle(VkQueue queue); -VkResult VKAPI_CALL vkReleaseCapturedPipelineDataKHR(VkDevice device, const VkReleaseCapturedPipelineDataInfoKHR *pInfo, const VkAllocationCallbacks *pAllocator); -VkResult VKAPI_CALL vkReleasePerformanceConfigurationINTEL(VkDevice device, VkPerformanceConfigurationINTEL configuration); -void VKAPI_CALL vkReleaseProfilingLockKHR(VkDevice device); -VkResult VKAPI_CALL vkReleaseSwapchainImagesEXT(VkDevice device, const VkReleaseSwapchainImagesInfoEXT *pReleaseInfo); -VkResult VKAPI_CALL vkResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags); -VkResult VKAPI_CALL vkResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags); -VkResult VKAPI_CALL vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags); -VkResult VKAPI_CALL vkResetEvent(VkDevice device, VkEvent event); -VkResult VKAPI_CALL vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences); -void VKAPI_CALL vkResetQueryPool(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); -void VKAPI_CALL vkResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); -VkResult VKAPI_CALL vkSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT *pNameInfo); -VkResult VKAPI_CALL vkSetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT *pTagInfo); -void VKAPI_CALL vkSetDeviceMemoryPriorityEXT(VkDevice device, VkDeviceMemory memory, float priority); -VkResult VKAPI_CALL vkSetEvent(VkDevice device, VkEvent event); -void VKAPI_CALL vkSetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR *pSwapchains, const VkHdrMetadataEXT *pMetadata); -void VKAPI_CALL vkSetLatencyMarkerNV(VkDevice device, VkSwapchainKHR swapchain, const VkSetLatencyMarkerInfoNV *pLatencyMarkerInfo); -VkResult VKAPI_CALL vkSetLatencySleepModeNV(VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepModeInfoNV *pSleepModeInfo); -VkResult VKAPI_CALL vkSetPrivateData(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t data); -VkResult VKAPI_CALL vkSetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t data); -VkResult VKAPI_CALL vkSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo *pSignalInfo); -VkResult VKAPI_CALL vkSignalSemaphoreKHR(VkDevice device, const VkSemaphoreSignalInfo *pSignalInfo); -void VKAPI_CALL vkSubmitDebugUtilsMessageEXT(VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData); -VkResult VKAPI_CALL vkTransitionImageLayout(VkDevice device, uint32_t transitionCount, const VkHostImageLayoutTransitionInfo *pTransitions); -VkResult VKAPI_CALL vkTransitionImageLayoutEXT(VkDevice device, uint32_t transitionCount, const VkHostImageLayoutTransitionInfo *pTransitions); -void VKAPI_CALL vkTrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags); -void VKAPI_CALL vkTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags); -void VKAPI_CALL vkUninitializePerformanceApiINTEL(VkDevice device); -void VKAPI_CALL vkUnmapMemory(VkDevice device, VkDeviceMemory memory); -VkResult VKAPI_CALL vkUnmapMemory2(VkDevice device, const VkMemoryUnmapInfo *pMemoryUnmapInfo); -VkResult VKAPI_CALL vkUnmapMemory2KHR(VkDevice device, const VkMemoryUnmapInfo *pMemoryUnmapInfo); -void VKAPI_CALL vkUpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void *pData); -void VKAPI_CALL vkUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void *pData); -void VKAPI_CALL vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet *pDescriptorCopies); -void VKAPI_CALL vkUpdateIndirectExecutionSetPipelineEXT(VkDevice device, VkIndirectExecutionSetEXT indirectExecutionSet, uint32_t executionSetWriteCount, const VkWriteIndirectExecutionSetPipelineEXT *pExecutionSetWrites); -void VKAPI_CALL vkUpdateIndirectExecutionSetShaderEXT(VkDevice device, VkIndirectExecutionSetEXT indirectExecutionSet, uint32_t executionSetWriteCount, const VkWriteIndirectExecutionSetShaderEXT *pExecutionSetWrites); -VkResult VKAPI_CALL vkUpdateVideoSessionParametersKHR(VkDevice device, VkVideoSessionParametersKHR videoSessionParameters, const VkVideoSessionParametersUpdateInfoKHR *pUpdateInfo); -VkResult VKAPI_CALL vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences, VkBool32 waitAll, uint64_t timeout); -VkResult VKAPI_CALL vkWaitForPresentKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t presentId, uint64_t timeout); -VkResult VKAPI_CALL vkWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo *pWaitInfo, uint64_t timeout); -VkResult VKAPI_CALL vkWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfo *pWaitInfo, uint64_t timeout); -VkResult VKAPI_CALL vkWriteAccelerationStructuresPropertiesKHR(VkDevice device, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR *pAccelerationStructures, VkQueryType queryType, size_t dataSize, void *pData, size_t stride); -VkResult VKAPI_CALL vkWriteMicromapsPropertiesEXT(VkDevice device, uint32_t micromapCount, const VkMicromapEXT *pMicromaps, VkQueryType queryType, size_t dataSize, void *pData, size_t stride); -#endif /* VK_NO_PROTOTYPES */ - -#define ALL_VK_DEVICE_FUNCS \ - USE_VK_FUNC(vkAcquireNextImage2KHR) \ - USE_VK_FUNC(vkAcquireNextImageKHR) \ - USE_VK_FUNC(vkAcquirePerformanceConfigurationINTEL) \ - USE_VK_FUNC(vkAcquireProfilingLockKHR) \ - USE_VK_FUNC(vkAllocateCommandBuffers) \ - USE_VK_FUNC(vkAllocateDescriptorSets) \ - USE_VK_FUNC(vkAllocateMemory) \ - USE_VK_FUNC(vkAntiLagUpdateAMD) \ - USE_VK_FUNC(vkBeginCommandBuffer) \ - USE_VK_FUNC(vkBindAccelerationStructureMemoryNV) \ - USE_VK_FUNC(vkBindBufferMemory) \ - USE_VK_FUNC(vkBindBufferMemory2) \ - USE_VK_FUNC(vkBindBufferMemory2KHR) \ - USE_VK_FUNC(vkBindImageMemory) \ - USE_VK_FUNC(vkBindImageMemory2) \ - USE_VK_FUNC(vkBindImageMemory2KHR) \ - USE_VK_FUNC(vkBindOpticalFlowSessionImageNV) \ - USE_VK_FUNC(vkBindVideoSessionMemoryKHR) \ - USE_VK_FUNC(vkBuildAccelerationStructuresKHR) \ - USE_VK_FUNC(vkBuildMicromapsEXT) \ - USE_VK_FUNC(vkCmdBeginConditionalRenderingEXT) \ - USE_VK_FUNC(vkCmdBeginDebugUtilsLabelEXT) \ - USE_VK_FUNC(vkCmdBeginQuery) \ - USE_VK_FUNC(vkCmdBeginQueryIndexedEXT) \ - USE_VK_FUNC(vkCmdBeginRenderPass) \ - USE_VK_FUNC(vkCmdBeginRenderPass2) \ - USE_VK_FUNC(vkCmdBeginRenderPass2KHR) \ - USE_VK_FUNC(vkCmdBeginRendering) \ - USE_VK_FUNC(vkCmdBeginRenderingKHR) \ - USE_VK_FUNC(vkCmdBeginTransformFeedbackEXT) \ - USE_VK_FUNC(vkCmdBeginVideoCodingKHR) \ - USE_VK_FUNC(vkCmdBindDescriptorBufferEmbeddedSamplers2EXT) \ - USE_VK_FUNC(vkCmdBindDescriptorBufferEmbeddedSamplersEXT) \ - USE_VK_FUNC(vkCmdBindDescriptorBuffersEXT) \ - USE_VK_FUNC(vkCmdBindDescriptorSets) \ - USE_VK_FUNC(vkCmdBindDescriptorSets2) \ - USE_VK_FUNC(vkCmdBindDescriptorSets2KHR) \ - USE_VK_FUNC(vkCmdBindIndexBuffer) \ - USE_VK_FUNC(vkCmdBindIndexBuffer2) \ - USE_VK_FUNC(vkCmdBindIndexBuffer2KHR) \ - USE_VK_FUNC(vkCmdBindInvocationMaskHUAWEI) \ - USE_VK_FUNC(vkCmdBindPipeline) \ - USE_VK_FUNC(vkCmdBindPipelineShaderGroupNV) \ - USE_VK_FUNC(vkCmdBindShadersEXT) \ - USE_VK_FUNC(vkCmdBindShadingRateImageNV) \ - USE_VK_FUNC(vkCmdBindTransformFeedbackBuffersEXT) \ - USE_VK_FUNC(vkCmdBindVertexBuffers) \ - USE_VK_FUNC(vkCmdBindVertexBuffers2) \ - USE_VK_FUNC(vkCmdBindVertexBuffers2EXT) \ - USE_VK_FUNC(vkCmdBlitImage) \ - USE_VK_FUNC(vkCmdBlitImage2) \ - USE_VK_FUNC(vkCmdBlitImage2KHR) \ - USE_VK_FUNC(vkCmdBuildAccelerationStructureNV) \ - USE_VK_FUNC(vkCmdBuildAccelerationStructuresIndirectKHR) \ - USE_VK_FUNC(vkCmdBuildAccelerationStructuresKHR) \ - USE_VK_FUNC(vkCmdBuildMicromapsEXT) \ - USE_VK_FUNC(vkCmdClearAttachments) \ - USE_VK_FUNC(vkCmdClearColorImage) \ - USE_VK_FUNC(vkCmdClearDepthStencilImage) \ - USE_VK_FUNC(vkCmdControlVideoCodingKHR) \ - USE_VK_FUNC(vkCmdCopyAccelerationStructureKHR) \ - USE_VK_FUNC(vkCmdCopyAccelerationStructureNV) \ - USE_VK_FUNC(vkCmdCopyAccelerationStructureToMemoryKHR) \ - USE_VK_FUNC(vkCmdCopyBuffer) \ - USE_VK_FUNC(vkCmdCopyBuffer2) \ - USE_VK_FUNC(vkCmdCopyBuffer2KHR) \ - USE_VK_FUNC(vkCmdCopyBufferToImage) \ - USE_VK_FUNC(vkCmdCopyBufferToImage2) \ - USE_VK_FUNC(vkCmdCopyBufferToImage2KHR) \ - USE_VK_FUNC(vkCmdCopyImage) \ - USE_VK_FUNC(vkCmdCopyImage2) \ - USE_VK_FUNC(vkCmdCopyImage2KHR) \ - USE_VK_FUNC(vkCmdCopyImageToBuffer) \ - USE_VK_FUNC(vkCmdCopyImageToBuffer2) \ - USE_VK_FUNC(vkCmdCopyImageToBuffer2KHR) \ - USE_VK_FUNC(vkCmdCopyMemoryIndirectNV) \ - USE_VK_FUNC(vkCmdCopyMemoryToAccelerationStructureKHR) \ - USE_VK_FUNC(vkCmdCopyMemoryToImageIndirectNV) \ - USE_VK_FUNC(vkCmdCopyMemoryToMicromapEXT) \ - USE_VK_FUNC(vkCmdCopyMicromapEXT) \ - USE_VK_FUNC(vkCmdCopyMicromapToMemoryEXT) \ - USE_VK_FUNC(vkCmdCopyQueryPoolResults) \ - USE_VK_FUNC(vkCmdCuLaunchKernelNVX) \ - USE_VK_FUNC(vkCmdCudaLaunchKernelNV) \ - USE_VK_FUNC(vkCmdDebugMarkerBeginEXT) \ - USE_VK_FUNC(vkCmdDebugMarkerEndEXT) \ - USE_VK_FUNC(vkCmdDebugMarkerInsertEXT) \ - USE_VK_FUNC(vkCmdDecodeVideoKHR) \ - USE_VK_FUNC(vkCmdDecompressMemoryIndirectCountNV) \ - USE_VK_FUNC(vkCmdDecompressMemoryNV) \ - USE_VK_FUNC(vkCmdDispatch) \ - USE_VK_FUNC(vkCmdDispatchBase) \ - USE_VK_FUNC(vkCmdDispatchBaseKHR) \ - USE_VK_FUNC(vkCmdDispatchIndirect) \ - USE_VK_FUNC(vkCmdDraw) \ - USE_VK_FUNC(vkCmdDrawClusterHUAWEI) \ - USE_VK_FUNC(vkCmdDrawClusterIndirectHUAWEI) \ - USE_VK_FUNC(vkCmdDrawIndexed) \ - USE_VK_FUNC(vkCmdDrawIndexedIndirect) \ - USE_VK_FUNC(vkCmdDrawIndexedIndirectCount) \ - USE_VK_FUNC(vkCmdDrawIndexedIndirectCountAMD) \ - USE_VK_FUNC(vkCmdDrawIndexedIndirectCountKHR) \ - USE_VK_FUNC(vkCmdDrawIndirect) \ - USE_VK_FUNC(vkCmdDrawIndirectByteCountEXT) \ - USE_VK_FUNC(vkCmdDrawIndirectCount) \ - USE_VK_FUNC(vkCmdDrawIndirectCountAMD) \ - USE_VK_FUNC(vkCmdDrawIndirectCountKHR) \ - USE_VK_FUNC(vkCmdDrawMeshTasksEXT) \ - USE_VK_FUNC(vkCmdDrawMeshTasksIndirectCountEXT) \ - USE_VK_FUNC(vkCmdDrawMeshTasksIndirectCountNV) \ - USE_VK_FUNC(vkCmdDrawMeshTasksIndirectEXT) \ - USE_VK_FUNC(vkCmdDrawMeshTasksIndirectNV) \ - USE_VK_FUNC(vkCmdDrawMeshTasksNV) \ - USE_VK_FUNC(vkCmdDrawMultiEXT) \ - USE_VK_FUNC(vkCmdDrawMultiIndexedEXT) \ - USE_VK_FUNC(vkCmdEncodeVideoKHR) \ - USE_VK_FUNC(vkCmdEndConditionalRenderingEXT) \ - USE_VK_FUNC(vkCmdEndDebugUtilsLabelEXT) \ - USE_VK_FUNC(vkCmdEndQuery) \ - USE_VK_FUNC(vkCmdEndQueryIndexedEXT) \ - USE_VK_FUNC(vkCmdEndRenderPass) \ - USE_VK_FUNC(vkCmdEndRenderPass2) \ - USE_VK_FUNC(vkCmdEndRenderPass2KHR) \ - USE_VK_FUNC(vkCmdEndRendering) \ - USE_VK_FUNC(vkCmdEndRenderingKHR) \ - USE_VK_FUNC(vkCmdEndTransformFeedbackEXT) \ - USE_VK_FUNC(vkCmdEndVideoCodingKHR) \ - USE_VK_FUNC(vkCmdExecuteCommands) \ - USE_VK_FUNC(vkCmdExecuteGeneratedCommandsEXT) \ - USE_VK_FUNC(vkCmdExecuteGeneratedCommandsNV) \ - USE_VK_FUNC(vkCmdFillBuffer) \ - USE_VK_FUNC(vkCmdInsertDebugUtilsLabelEXT) \ - USE_VK_FUNC(vkCmdNextSubpass) \ - USE_VK_FUNC(vkCmdNextSubpass2) \ - USE_VK_FUNC(vkCmdNextSubpass2KHR) \ - USE_VK_FUNC(vkCmdOpticalFlowExecuteNV) \ - USE_VK_FUNC(vkCmdPipelineBarrier) \ - USE_VK_FUNC(vkCmdPipelineBarrier2) \ - USE_VK_FUNC(vkCmdPipelineBarrier2KHR) \ - USE_VK_FUNC(vkCmdPreprocessGeneratedCommandsEXT) \ - USE_VK_FUNC(vkCmdPreprocessGeneratedCommandsNV) \ - USE_VK_FUNC(vkCmdPushConstants) \ - USE_VK_FUNC(vkCmdPushConstants2) \ - USE_VK_FUNC(vkCmdPushConstants2KHR) \ - USE_VK_FUNC(vkCmdPushDescriptorSet) \ - USE_VK_FUNC(vkCmdPushDescriptorSet2) \ - USE_VK_FUNC(vkCmdPushDescriptorSet2KHR) \ - USE_VK_FUNC(vkCmdPushDescriptorSetKHR) \ - USE_VK_FUNC(vkCmdPushDescriptorSetWithTemplate) \ - USE_VK_FUNC(vkCmdPushDescriptorSetWithTemplate2) \ - USE_VK_FUNC(vkCmdPushDescriptorSetWithTemplate2KHR) \ - USE_VK_FUNC(vkCmdPushDescriptorSetWithTemplateKHR) \ - USE_VK_FUNC(vkCmdResetEvent) \ - USE_VK_FUNC(vkCmdResetEvent2) \ - USE_VK_FUNC(vkCmdResetEvent2KHR) \ - USE_VK_FUNC(vkCmdResetQueryPool) \ - USE_VK_FUNC(vkCmdResolveImage) \ - USE_VK_FUNC(vkCmdResolveImage2) \ - USE_VK_FUNC(vkCmdResolveImage2KHR) \ - USE_VK_FUNC(vkCmdSetAlphaToCoverageEnableEXT) \ - USE_VK_FUNC(vkCmdSetAlphaToOneEnableEXT) \ - USE_VK_FUNC(vkCmdSetAttachmentFeedbackLoopEnableEXT) \ - USE_VK_FUNC(vkCmdSetBlendConstants) \ - USE_VK_FUNC(vkCmdSetCheckpointNV) \ - USE_VK_FUNC(vkCmdSetCoarseSampleOrderNV) \ - USE_VK_FUNC(vkCmdSetColorBlendAdvancedEXT) \ - USE_VK_FUNC(vkCmdSetColorBlendEnableEXT) \ - USE_VK_FUNC(vkCmdSetColorBlendEquationEXT) \ - USE_VK_FUNC(vkCmdSetColorWriteEnableEXT) \ - USE_VK_FUNC(vkCmdSetColorWriteMaskEXT) \ - USE_VK_FUNC(vkCmdSetConservativeRasterizationModeEXT) \ - USE_VK_FUNC(vkCmdSetCoverageModulationModeNV) \ - USE_VK_FUNC(vkCmdSetCoverageModulationTableEnableNV) \ - USE_VK_FUNC(vkCmdSetCoverageModulationTableNV) \ - USE_VK_FUNC(vkCmdSetCoverageReductionModeNV) \ - USE_VK_FUNC(vkCmdSetCoverageToColorEnableNV) \ - USE_VK_FUNC(vkCmdSetCoverageToColorLocationNV) \ - USE_VK_FUNC(vkCmdSetCullMode) \ - USE_VK_FUNC(vkCmdSetCullModeEXT) \ - USE_VK_FUNC(vkCmdSetDepthBias) \ - USE_VK_FUNC(vkCmdSetDepthBias2EXT) \ - USE_VK_FUNC(vkCmdSetDepthBiasEnable) \ - USE_VK_FUNC(vkCmdSetDepthBiasEnableEXT) \ - USE_VK_FUNC(vkCmdSetDepthBounds) \ - USE_VK_FUNC(vkCmdSetDepthBoundsTestEnable) \ - USE_VK_FUNC(vkCmdSetDepthBoundsTestEnableEXT) \ - USE_VK_FUNC(vkCmdSetDepthClampEnableEXT) \ - USE_VK_FUNC(vkCmdSetDepthClampRangeEXT) \ - USE_VK_FUNC(vkCmdSetDepthClipEnableEXT) \ - USE_VK_FUNC(vkCmdSetDepthClipNegativeOneToOneEXT) \ - USE_VK_FUNC(vkCmdSetDepthCompareOp) \ - USE_VK_FUNC(vkCmdSetDepthCompareOpEXT) \ - USE_VK_FUNC(vkCmdSetDepthTestEnable) \ - USE_VK_FUNC(vkCmdSetDepthTestEnableEXT) \ - USE_VK_FUNC(vkCmdSetDepthWriteEnable) \ - USE_VK_FUNC(vkCmdSetDepthWriteEnableEXT) \ - USE_VK_FUNC(vkCmdSetDescriptorBufferOffsets2EXT) \ - USE_VK_FUNC(vkCmdSetDescriptorBufferOffsetsEXT) \ - USE_VK_FUNC(vkCmdSetDeviceMask) \ - USE_VK_FUNC(vkCmdSetDeviceMaskKHR) \ - USE_VK_FUNC(vkCmdSetDiscardRectangleEXT) \ - USE_VK_FUNC(vkCmdSetDiscardRectangleEnableEXT) \ - USE_VK_FUNC(vkCmdSetDiscardRectangleModeEXT) \ - USE_VK_FUNC(vkCmdSetEvent) \ - USE_VK_FUNC(vkCmdSetEvent2) \ - USE_VK_FUNC(vkCmdSetEvent2KHR) \ - USE_VK_FUNC(vkCmdSetExclusiveScissorEnableNV) \ - USE_VK_FUNC(vkCmdSetExclusiveScissorNV) \ - USE_VK_FUNC(vkCmdSetExtraPrimitiveOverestimationSizeEXT) \ - USE_VK_FUNC(vkCmdSetFragmentShadingRateEnumNV) \ - USE_VK_FUNC(vkCmdSetFragmentShadingRateKHR) \ - USE_VK_FUNC(vkCmdSetFrontFace) \ - USE_VK_FUNC(vkCmdSetFrontFaceEXT) \ - USE_VK_FUNC(vkCmdSetLineRasterizationModeEXT) \ - USE_VK_FUNC(vkCmdSetLineStipple) \ - USE_VK_FUNC(vkCmdSetLineStippleEXT) \ - USE_VK_FUNC(vkCmdSetLineStippleEnableEXT) \ - USE_VK_FUNC(vkCmdSetLineStippleKHR) \ - USE_VK_FUNC(vkCmdSetLineWidth) \ - USE_VK_FUNC(vkCmdSetLogicOpEXT) \ - USE_VK_FUNC(vkCmdSetLogicOpEnableEXT) \ - USE_VK_FUNC(vkCmdSetPatchControlPointsEXT) \ - USE_VK_FUNC(vkCmdSetPerformanceMarkerINTEL) \ - USE_VK_FUNC(vkCmdSetPerformanceOverrideINTEL) \ - USE_VK_FUNC(vkCmdSetPerformanceStreamMarkerINTEL) \ - USE_VK_FUNC(vkCmdSetPolygonModeEXT) \ - USE_VK_FUNC(vkCmdSetPrimitiveRestartEnable) \ - USE_VK_FUNC(vkCmdSetPrimitiveRestartEnableEXT) \ - USE_VK_FUNC(vkCmdSetPrimitiveTopology) \ - USE_VK_FUNC(vkCmdSetPrimitiveTopologyEXT) \ - USE_VK_FUNC(vkCmdSetProvokingVertexModeEXT) \ - USE_VK_FUNC(vkCmdSetRasterizationSamplesEXT) \ - USE_VK_FUNC(vkCmdSetRasterizationStreamEXT) \ - USE_VK_FUNC(vkCmdSetRasterizerDiscardEnable) \ - USE_VK_FUNC(vkCmdSetRasterizerDiscardEnableEXT) \ - USE_VK_FUNC(vkCmdSetRayTracingPipelineStackSizeKHR) \ - USE_VK_FUNC(vkCmdSetRenderingAttachmentLocations) \ - USE_VK_FUNC(vkCmdSetRenderingAttachmentLocationsKHR) \ - USE_VK_FUNC(vkCmdSetRenderingInputAttachmentIndices) \ - USE_VK_FUNC(vkCmdSetRenderingInputAttachmentIndicesKHR) \ - USE_VK_FUNC(vkCmdSetRepresentativeFragmentTestEnableNV) \ - USE_VK_FUNC(vkCmdSetSampleLocationsEXT) \ - USE_VK_FUNC(vkCmdSetSampleLocationsEnableEXT) \ - USE_VK_FUNC(vkCmdSetSampleMaskEXT) \ - USE_VK_FUNC(vkCmdSetScissor) \ - USE_VK_FUNC(vkCmdSetScissorWithCount) \ - USE_VK_FUNC(vkCmdSetScissorWithCountEXT) \ - USE_VK_FUNC(vkCmdSetShadingRateImageEnableNV) \ - USE_VK_FUNC(vkCmdSetStencilCompareMask) \ - USE_VK_FUNC(vkCmdSetStencilOp) \ - USE_VK_FUNC(vkCmdSetStencilOpEXT) \ - USE_VK_FUNC(vkCmdSetStencilReference) \ - USE_VK_FUNC(vkCmdSetStencilTestEnable) \ - USE_VK_FUNC(vkCmdSetStencilTestEnableEXT) \ - USE_VK_FUNC(vkCmdSetStencilWriteMask) \ - USE_VK_FUNC(vkCmdSetTessellationDomainOriginEXT) \ - USE_VK_FUNC(vkCmdSetVertexInputEXT) \ - USE_VK_FUNC(vkCmdSetViewport) \ - USE_VK_FUNC(vkCmdSetViewportShadingRatePaletteNV) \ - USE_VK_FUNC(vkCmdSetViewportSwizzleNV) \ - USE_VK_FUNC(vkCmdSetViewportWScalingEnableNV) \ - USE_VK_FUNC(vkCmdSetViewportWScalingNV) \ - USE_VK_FUNC(vkCmdSetViewportWithCount) \ - USE_VK_FUNC(vkCmdSetViewportWithCountEXT) \ - USE_VK_FUNC(vkCmdSubpassShadingHUAWEI) \ - USE_VK_FUNC(vkCmdTraceRaysIndirect2KHR) \ - USE_VK_FUNC(vkCmdTraceRaysIndirectKHR) \ - USE_VK_FUNC(vkCmdTraceRaysKHR) \ - USE_VK_FUNC(vkCmdTraceRaysNV) \ - USE_VK_FUNC(vkCmdUpdateBuffer) \ - USE_VK_FUNC(vkCmdUpdatePipelineIndirectBufferNV) \ - USE_VK_FUNC(vkCmdWaitEvents) \ - USE_VK_FUNC(vkCmdWaitEvents2) \ - USE_VK_FUNC(vkCmdWaitEvents2KHR) \ - USE_VK_FUNC(vkCmdWriteAccelerationStructuresPropertiesKHR) \ - USE_VK_FUNC(vkCmdWriteAccelerationStructuresPropertiesNV) \ - USE_VK_FUNC(vkCmdWriteBufferMarker2AMD) \ - USE_VK_FUNC(vkCmdWriteBufferMarkerAMD) \ - USE_VK_FUNC(vkCmdWriteMicromapsPropertiesEXT) \ - USE_VK_FUNC(vkCmdWriteTimestamp) \ - USE_VK_FUNC(vkCmdWriteTimestamp2) \ - USE_VK_FUNC(vkCmdWriteTimestamp2KHR) \ - USE_VK_FUNC(vkCompileDeferredNV) \ - USE_VK_FUNC(vkCopyAccelerationStructureKHR) \ - USE_VK_FUNC(vkCopyAccelerationStructureToMemoryKHR) \ - USE_VK_FUNC(vkCopyImageToImage) \ - USE_VK_FUNC(vkCopyImageToImageEXT) \ - USE_VK_FUNC(vkCopyImageToMemory) \ - USE_VK_FUNC(vkCopyImageToMemoryEXT) \ - USE_VK_FUNC(vkCopyMemoryToAccelerationStructureKHR) \ - USE_VK_FUNC(vkCopyMemoryToImage) \ - USE_VK_FUNC(vkCopyMemoryToImageEXT) \ - USE_VK_FUNC(vkCopyMemoryToMicromapEXT) \ - USE_VK_FUNC(vkCopyMicromapEXT) \ - USE_VK_FUNC(vkCopyMicromapToMemoryEXT) \ - USE_VK_FUNC(vkCreateAccelerationStructureKHR) \ - USE_VK_FUNC(vkCreateAccelerationStructureNV) \ - USE_VK_FUNC(vkCreateBuffer) \ - USE_VK_FUNC(vkCreateBufferView) \ - USE_VK_FUNC(vkCreateCommandPool) \ - USE_VK_FUNC(vkCreateComputePipelines) \ - USE_VK_FUNC(vkCreateCuFunctionNVX) \ - USE_VK_FUNC(vkCreateCuModuleNVX) \ - USE_VK_FUNC(vkCreateCudaFunctionNV) \ - USE_VK_FUNC(vkCreateCudaModuleNV) \ - USE_VK_FUNC(vkCreateDeferredOperationKHR) \ - USE_VK_FUNC(vkCreateDescriptorPool) \ - USE_VK_FUNC(vkCreateDescriptorSetLayout) \ - USE_VK_FUNC(vkCreateDescriptorUpdateTemplate) \ - USE_VK_FUNC(vkCreateDescriptorUpdateTemplateKHR) \ - USE_VK_FUNC(vkCreateEvent) \ - USE_VK_FUNC(vkCreateFence) \ - USE_VK_FUNC(vkCreateFramebuffer) \ - USE_VK_FUNC(vkCreateGraphicsPipelines) \ - USE_VK_FUNC(vkCreateImage) \ - USE_VK_FUNC(vkCreateImageView) \ - USE_VK_FUNC(vkCreateIndirectCommandsLayoutEXT) \ - USE_VK_FUNC(vkCreateIndirectCommandsLayoutNV) \ - USE_VK_FUNC(vkCreateIndirectExecutionSetEXT) \ - USE_VK_FUNC(vkCreateMicromapEXT) \ - USE_VK_FUNC(vkCreateOpticalFlowSessionNV) \ - USE_VK_FUNC(vkCreatePipelineBinariesKHR) \ - USE_VK_FUNC(vkCreatePipelineCache) \ - USE_VK_FUNC(vkCreatePipelineLayout) \ - USE_VK_FUNC(vkCreatePrivateDataSlot) \ - USE_VK_FUNC(vkCreatePrivateDataSlotEXT) \ - USE_VK_FUNC(vkCreateQueryPool) \ - USE_VK_FUNC(vkCreateRayTracingPipelinesKHR) \ - USE_VK_FUNC(vkCreateRayTracingPipelinesNV) \ - USE_VK_FUNC(vkCreateRenderPass) \ - USE_VK_FUNC(vkCreateRenderPass2) \ - USE_VK_FUNC(vkCreateRenderPass2KHR) \ - USE_VK_FUNC(vkCreateSampler) \ - USE_VK_FUNC(vkCreateSamplerYcbcrConversion) \ - USE_VK_FUNC(vkCreateSamplerYcbcrConversionKHR) \ - USE_VK_FUNC(vkCreateSemaphore) \ - USE_VK_FUNC(vkCreateShaderModule) \ - USE_VK_FUNC(vkCreateShadersEXT) \ - USE_VK_FUNC(vkCreateSwapchainKHR) \ - USE_VK_FUNC(vkCreateValidationCacheEXT) \ - USE_VK_FUNC(vkCreateVideoSessionKHR) \ - USE_VK_FUNC(vkCreateVideoSessionParametersKHR) \ - USE_VK_FUNC(vkDebugMarkerSetObjectNameEXT) \ - USE_VK_FUNC(vkDebugMarkerSetObjectTagEXT) \ - USE_VK_FUNC(vkDeferredOperationJoinKHR) \ - USE_VK_FUNC(vkDestroyAccelerationStructureKHR) \ - USE_VK_FUNC(vkDestroyAccelerationStructureNV) \ - USE_VK_FUNC(vkDestroyBuffer) \ - USE_VK_FUNC(vkDestroyBufferView) \ - USE_VK_FUNC(vkDestroyCommandPool) \ - USE_VK_FUNC(vkDestroyCuFunctionNVX) \ - USE_VK_FUNC(vkDestroyCuModuleNVX) \ - USE_VK_FUNC(vkDestroyCudaFunctionNV) \ - USE_VK_FUNC(vkDestroyCudaModuleNV) \ - USE_VK_FUNC(vkDestroyDeferredOperationKHR) \ - USE_VK_FUNC(vkDestroyDescriptorPool) \ - USE_VK_FUNC(vkDestroyDescriptorSetLayout) \ - USE_VK_FUNC(vkDestroyDescriptorUpdateTemplate) \ - USE_VK_FUNC(vkDestroyDescriptorUpdateTemplateKHR) \ - USE_VK_FUNC(vkDestroyDevice) \ - USE_VK_FUNC(vkDestroyEvent) \ - USE_VK_FUNC(vkDestroyFence) \ - USE_VK_FUNC(vkDestroyFramebuffer) \ - USE_VK_FUNC(vkDestroyImage) \ - USE_VK_FUNC(vkDestroyImageView) \ - USE_VK_FUNC(vkDestroyIndirectCommandsLayoutEXT) \ - USE_VK_FUNC(vkDestroyIndirectCommandsLayoutNV) \ - USE_VK_FUNC(vkDestroyIndirectExecutionSetEXT) \ - USE_VK_FUNC(vkDestroyMicromapEXT) \ - USE_VK_FUNC(vkDestroyOpticalFlowSessionNV) \ - USE_VK_FUNC(vkDestroyPipeline) \ - USE_VK_FUNC(vkDestroyPipelineBinaryKHR) \ - USE_VK_FUNC(vkDestroyPipelineCache) \ - USE_VK_FUNC(vkDestroyPipelineLayout) \ - USE_VK_FUNC(vkDestroyPrivateDataSlot) \ - USE_VK_FUNC(vkDestroyPrivateDataSlotEXT) \ - USE_VK_FUNC(vkDestroyQueryPool) \ - USE_VK_FUNC(vkDestroyRenderPass) \ - USE_VK_FUNC(vkDestroySampler) \ - USE_VK_FUNC(vkDestroySamplerYcbcrConversion) \ - USE_VK_FUNC(vkDestroySamplerYcbcrConversionKHR) \ - USE_VK_FUNC(vkDestroySemaphore) \ - USE_VK_FUNC(vkDestroyShaderEXT) \ - USE_VK_FUNC(vkDestroyShaderModule) \ - USE_VK_FUNC(vkDestroySwapchainKHR) \ - USE_VK_FUNC(vkDestroyValidationCacheEXT) \ - USE_VK_FUNC(vkDestroyVideoSessionKHR) \ - USE_VK_FUNC(vkDestroyVideoSessionParametersKHR) \ - USE_VK_FUNC(vkDeviceWaitIdle) \ - USE_VK_FUNC(vkEndCommandBuffer) \ - USE_VK_FUNC(vkFlushMappedMemoryRanges) \ - USE_VK_FUNC(vkFreeCommandBuffers) \ - USE_VK_FUNC(vkFreeDescriptorSets) \ - USE_VK_FUNC(vkFreeMemory) \ - USE_VK_FUNC(vkGetAccelerationStructureBuildSizesKHR) \ - USE_VK_FUNC(vkGetAccelerationStructureDeviceAddressKHR) \ - USE_VK_FUNC(vkGetAccelerationStructureHandleNV) \ - USE_VK_FUNC(vkGetAccelerationStructureMemoryRequirementsNV) \ - USE_VK_FUNC(vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT) \ - USE_VK_FUNC(vkGetBufferDeviceAddress) \ - USE_VK_FUNC(vkGetBufferDeviceAddressEXT) \ - USE_VK_FUNC(vkGetBufferDeviceAddressKHR) \ - USE_VK_FUNC(vkGetBufferMemoryRequirements) \ - USE_VK_FUNC(vkGetBufferMemoryRequirements2) \ - USE_VK_FUNC(vkGetBufferMemoryRequirements2KHR) \ - USE_VK_FUNC(vkGetBufferOpaqueCaptureAddress) \ - USE_VK_FUNC(vkGetBufferOpaqueCaptureAddressKHR) \ - USE_VK_FUNC(vkGetBufferOpaqueCaptureDescriptorDataEXT) \ - USE_VK_FUNC(vkGetCalibratedTimestampsEXT) \ - USE_VK_FUNC(vkGetCalibratedTimestampsKHR) \ - USE_VK_FUNC(vkGetCudaModuleCacheNV) \ - USE_VK_FUNC(vkGetDeferredOperationMaxConcurrencyKHR) \ - USE_VK_FUNC(vkGetDeferredOperationResultKHR) \ - USE_VK_FUNC(vkGetDescriptorEXT) \ - USE_VK_FUNC(vkGetDescriptorSetHostMappingVALVE) \ - USE_VK_FUNC(vkGetDescriptorSetLayoutBindingOffsetEXT) \ - USE_VK_FUNC(vkGetDescriptorSetLayoutHostMappingInfoVALVE) \ - USE_VK_FUNC(vkGetDescriptorSetLayoutSizeEXT) \ - USE_VK_FUNC(vkGetDescriptorSetLayoutSupport) \ - USE_VK_FUNC(vkGetDescriptorSetLayoutSupportKHR) \ - USE_VK_FUNC(vkGetDeviceAccelerationStructureCompatibilityKHR) \ - USE_VK_FUNC(vkGetDeviceBufferMemoryRequirements) \ - USE_VK_FUNC(vkGetDeviceBufferMemoryRequirementsKHR) \ - USE_VK_FUNC(vkGetDeviceFaultInfoEXT) \ - USE_VK_FUNC(vkGetDeviceGroupPeerMemoryFeatures) \ - USE_VK_FUNC(vkGetDeviceGroupPeerMemoryFeaturesKHR) \ - USE_VK_FUNC(vkGetDeviceGroupPresentCapabilitiesKHR) \ - USE_VK_FUNC(vkGetDeviceGroupSurfacePresentModesKHR) \ - USE_VK_FUNC(vkGetDeviceImageMemoryRequirements) \ - USE_VK_FUNC(vkGetDeviceImageMemoryRequirementsKHR) \ - USE_VK_FUNC(vkGetDeviceImageSparseMemoryRequirements) \ - USE_VK_FUNC(vkGetDeviceImageSparseMemoryRequirementsKHR) \ - USE_VK_FUNC(vkGetDeviceImageSubresourceLayout) \ - USE_VK_FUNC(vkGetDeviceImageSubresourceLayoutKHR) \ - USE_VK_FUNC(vkGetDeviceMemoryCommitment) \ - USE_VK_FUNC(vkGetDeviceMemoryOpaqueCaptureAddress) \ - USE_VK_FUNC(vkGetDeviceMemoryOpaqueCaptureAddressKHR) \ - USE_VK_FUNC(vkGetDeviceMicromapCompatibilityEXT) \ - USE_VK_FUNC(vkGetDeviceQueue) \ - USE_VK_FUNC(vkGetDeviceQueue2) \ - USE_VK_FUNC(vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI) \ - USE_VK_FUNC(vkGetDynamicRenderingTilePropertiesQCOM) \ - USE_VK_FUNC(vkGetEncodedVideoSessionParametersKHR) \ - USE_VK_FUNC(vkGetEventStatus) \ - USE_VK_FUNC(vkGetFenceStatus) \ - USE_VK_FUNC(vkGetFramebufferTilePropertiesQCOM) \ - USE_VK_FUNC(vkGetGeneratedCommandsMemoryRequirementsEXT) \ - USE_VK_FUNC(vkGetGeneratedCommandsMemoryRequirementsNV) \ - USE_VK_FUNC(vkGetImageMemoryRequirements) \ - USE_VK_FUNC(vkGetImageMemoryRequirements2) \ - USE_VK_FUNC(vkGetImageMemoryRequirements2KHR) \ - USE_VK_FUNC(vkGetImageOpaqueCaptureDescriptorDataEXT) \ - USE_VK_FUNC(vkGetImageSparseMemoryRequirements) \ - USE_VK_FUNC(vkGetImageSparseMemoryRequirements2) \ - USE_VK_FUNC(vkGetImageSparseMemoryRequirements2KHR) \ - USE_VK_FUNC(vkGetImageSubresourceLayout) \ - USE_VK_FUNC(vkGetImageSubresourceLayout2) \ - USE_VK_FUNC(vkGetImageSubresourceLayout2EXT) \ - USE_VK_FUNC(vkGetImageSubresourceLayout2KHR) \ - USE_VK_FUNC(vkGetImageViewAddressNVX) \ - USE_VK_FUNC(vkGetImageViewHandle64NVX) \ - USE_VK_FUNC(vkGetImageViewHandleNVX) \ - USE_VK_FUNC(vkGetImageViewOpaqueCaptureDescriptorDataEXT) \ - USE_VK_FUNC(vkGetLatencyTimingsNV) \ - USE_VK_FUNC(vkGetMemoryHostPointerPropertiesEXT) \ - USE_VK_FUNC(vkGetMicromapBuildSizesEXT) \ - USE_VK_FUNC(vkGetPerformanceParameterINTEL) \ - USE_VK_FUNC(vkGetPipelineBinaryDataKHR) \ - USE_VK_FUNC(vkGetPipelineCacheData) \ - USE_VK_FUNC(vkGetPipelineExecutableInternalRepresentationsKHR) \ - USE_VK_FUNC(vkGetPipelineExecutablePropertiesKHR) \ - USE_VK_FUNC(vkGetPipelineExecutableStatisticsKHR) \ - USE_VK_FUNC(vkGetPipelineIndirectDeviceAddressNV) \ - USE_VK_FUNC(vkGetPipelineIndirectMemoryRequirementsNV) \ - USE_VK_FUNC(vkGetPipelineKeyKHR) \ - USE_VK_FUNC(vkGetPipelinePropertiesEXT) \ - USE_VK_FUNC(vkGetPrivateData) \ - USE_VK_FUNC(vkGetPrivateDataEXT) \ - USE_VK_FUNC(vkGetQueryPoolResults) \ - USE_VK_FUNC(vkGetQueueCheckpointData2NV) \ - USE_VK_FUNC(vkGetQueueCheckpointDataNV) \ - USE_VK_FUNC(vkGetRayTracingCaptureReplayShaderGroupHandlesKHR) \ - USE_VK_FUNC(vkGetRayTracingShaderGroupHandlesKHR) \ - USE_VK_FUNC(vkGetRayTracingShaderGroupHandlesNV) \ - USE_VK_FUNC(vkGetRayTracingShaderGroupStackSizeKHR) \ - USE_VK_FUNC(vkGetRenderAreaGranularity) \ - USE_VK_FUNC(vkGetRenderingAreaGranularity) \ - USE_VK_FUNC(vkGetRenderingAreaGranularityKHR) \ - USE_VK_FUNC(vkGetSamplerOpaqueCaptureDescriptorDataEXT) \ - USE_VK_FUNC(vkGetSemaphoreCounterValue) \ - USE_VK_FUNC(vkGetSemaphoreCounterValueKHR) \ - USE_VK_FUNC(vkGetShaderBinaryDataEXT) \ - USE_VK_FUNC(vkGetShaderInfoAMD) \ - USE_VK_FUNC(vkGetShaderModuleCreateInfoIdentifierEXT) \ - USE_VK_FUNC(vkGetShaderModuleIdentifierEXT) \ - USE_VK_FUNC(vkGetSwapchainImagesKHR) \ - USE_VK_FUNC(vkGetValidationCacheDataEXT) \ - USE_VK_FUNC(vkGetVideoSessionMemoryRequirementsKHR) \ - USE_VK_FUNC(vkInitializePerformanceApiINTEL) \ - USE_VK_FUNC(vkInvalidateMappedMemoryRanges) \ - USE_VK_FUNC(vkLatencySleepNV) \ - USE_VK_FUNC(vkMapMemory) \ - USE_VK_FUNC(vkMapMemory2) \ - USE_VK_FUNC(vkMapMemory2KHR) \ - USE_VK_FUNC(vkMergePipelineCaches) \ - USE_VK_FUNC(vkMergeValidationCachesEXT) \ - USE_VK_FUNC(vkQueueBeginDebugUtilsLabelEXT) \ - USE_VK_FUNC(vkQueueBindSparse) \ - USE_VK_FUNC(vkQueueEndDebugUtilsLabelEXT) \ - USE_VK_FUNC(vkQueueInsertDebugUtilsLabelEXT) \ - USE_VK_FUNC(vkQueueNotifyOutOfBandNV) \ - USE_VK_FUNC(vkQueuePresentKHR) \ - USE_VK_FUNC(vkQueueSetPerformanceConfigurationINTEL) \ - USE_VK_FUNC(vkQueueSubmit) \ - USE_VK_FUNC(vkQueueSubmit2) \ - USE_VK_FUNC(vkQueueSubmit2KHR) \ - USE_VK_FUNC(vkQueueWaitIdle) \ - USE_VK_FUNC(vkReleaseCapturedPipelineDataKHR) \ - USE_VK_FUNC(vkReleasePerformanceConfigurationINTEL) \ - USE_VK_FUNC(vkReleaseProfilingLockKHR) \ - USE_VK_FUNC(vkReleaseSwapchainImagesEXT) \ - USE_VK_FUNC(vkResetCommandBuffer) \ - USE_VK_FUNC(vkResetCommandPool) \ - USE_VK_FUNC(vkResetDescriptorPool) \ - USE_VK_FUNC(vkResetEvent) \ - USE_VK_FUNC(vkResetFences) \ - USE_VK_FUNC(vkResetQueryPool) \ - USE_VK_FUNC(vkResetQueryPoolEXT) \ - USE_VK_FUNC(vkSetDebugUtilsObjectNameEXT) \ - USE_VK_FUNC(vkSetDebugUtilsObjectTagEXT) \ - USE_VK_FUNC(vkSetDeviceMemoryPriorityEXT) \ - USE_VK_FUNC(vkSetEvent) \ - USE_VK_FUNC(vkSetHdrMetadataEXT) \ - USE_VK_FUNC(vkSetLatencyMarkerNV) \ - USE_VK_FUNC(vkSetLatencySleepModeNV) \ - USE_VK_FUNC(vkSetPrivateData) \ - USE_VK_FUNC(vkSetPrivateDataEXT) \ - USE_VK_FUNC(vkSignalSemaphore) \ - USE_VK_FUNC(vkSignalSemaphoreKHR) \ - USE_VK_FUNC(vkTransitionImageLayout) \ - USE_VK_FUNC(vkTransitionImageLayoutEXT) \ - USE_VK_FUNC(vkTrimCommandPool) \ - USE_VK_FUNC(vkTrimCommandPoolKHR) \ - USE_VK_FUNC(vkUninitializePerformanceApiINTEL) \ - USE_VK_FUNC(vkUnmapMemory) \ - USE_VK_FUNC(vkUnmapMemory2) \ - USE_VK_FUNC(vkUnmapMemory2KHR) \ - USE_VK_FUNC(vkUpdateDescriptorSetWithTemplate) \ - USE_VK_FUNC(vkUpdateDescriptorSetWithTemplateKHR) \ - USE_VK_FUNC(vkUpdateDescriptorSets) \ - USE_VK_FUNC(vkUpdateIndirectExecutionSetPipelineEXT) \ - USE_VK_FUNC(vkUpdateIndirectExecutionSetShaderEXT) \ - USE_VK_FUNC(vkUpdateVideoSessionParametersKHR) \ - USE_VK_FUNC(vkWaitForFences) \ - USE_VK_FUNC(vkWaitForPresentKHR) \ - USE_VK_FUNC(vkWaitSemaphores) \ - USE_VK_FUNC(vkWaitSemaphoresKHR) \ - USE_VK_FUNC(vkWriteAccelerationStructuresPropertiesKHR) \ - USE_VK_FUNC(vkWriteMicromapsPropertiesEXT) - -#define ALL_VK_INSTANCE_FUNCS \ - USE_VK_FUNC(vkCreateDebugReportCallbackEXT) \ - USE_VK_FUNC(vkCreateDebugUtilsMessengerEXT) \ - USE_VK_FUNC(vkCreateWin32SurfaceKHR) \ - USE_VK_FUNC(vkDebugReportMessageEXT) \ - USE_VK_FUNC(vkDestroyDebugReportCallbackEXT) \ - USE_VK_FUNC(vkDestroyDebugUtilsMessengerEXT) \ - USE_VK_FUNC(vkDestroyInstance) \ - USE_VK_FUNC(vkDestroySurfaceKHR) \ - USE_VK_FUNC(vkEnumeratePhysicalDeviceGroups) \ - USE_VK_FUNC(vkEnumeratePhysicalDeviceGroupsKHR) \ - USE_VK_FUNC(vkEnumeratePhysicalDevices) \ - USE_VK_FUNC(vkSubmitDebugUtilsMessageEXT) \ - USE_VK_FUNC(vkCreateDevice) \ - USE_VK_FUNC(vkEnumerateDeviceExtensionProperties) \ - USE_VK_FUNC(vkEnumerateDeviceLayerProperties) \ - USE_VK_FUNC(vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceCalibrateableTimeDomainsEXT) \ - USE_VK_FUNC(vkGetPhysicalDeviceCalibrateableTimeDomainsKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV) \ - USE_VK_FUNC(vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceCooperativeMatrixPropertiesNV) \ - USE_VK_FUNC(vkGetPhysicalDeviceFeatures) \ - USE_VK_FUNC(vkGetPhysicalDeviceFeatures2) \ - USE_VK_FUNC(vkGetPhysicalDeviceFeatures2KHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceFormatProperties) \ - USE_VK_FUNC(vkGetPhysicalDeviceFormatProperties2) \ - USE_VK_FUNC(vkGetPhysicalDeviceFormatProperties2KHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceFragmentShadingRatesKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceImageFormatProperties) \ - USE_VK_FUNC(vkGetPhysicalDeviceImageFormatProperties2) \ - USE_VK_FUNC(vkGetPhysicalDeviceImageFormatProperties2KHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceMemoryProperties) \ - USE_VK_FUNC(vkGetPhysicalDeviceMemoryProperties2) \ - USE_VK_FUNC(vkGetPhysicalDeviceMemoryProperties2KHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceMultisamplePropertiesEXT) \ - USE_VK_FUNC(vkGetPhysicalDeviceOpticalFlowImageFormatsNV) \ - USE_VK_FUNC(vkGetPhysicalDevicePresentRectanglesKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceProperties) \ - USE_VK_FUNC(vkGetPhysicalDeviceProperties2) \ - USE_VK_FUNC(vkGetPhysicalDeviceProperties2KHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceQueueFamilyProperties) \ - USE_VK_FUNC(vkGetPhysicalDeviceQueueFamilyProperties2) \ - USE_VK_FUNC(vkGetPhysicalDeviceQueueFamilyProperties2KHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceSparseImageFormatProperties) \ - USE_VK_FUNC(vkGetPhysicalDeviceSparseImageFormatProperties2) \ - USE_VK_FUNC(vkGetPhysicalDeviceSparseImageFormatProperties2KHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV) \ - USE_VK_FUNC(vkGetPhysicalDeviceSurfaceCapabilities2KHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceSurfaceCapabilitiesKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceSurfaceFormats2KHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceSurfaceFormatsKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceSurfacePresentModesKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceSurfaceSupportKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceToolProperties) \ - USE_VK_FUNC(vkGetPhysicalDeviceToolPropertiesEXT) \ - USE_VK_FUNC(vkGetPhysicalDeviceVideoCapabilitiesKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceVideoFormatPropertiesKHR) \ - USE_VK_FUNC(vkGetPhysicalDeviceWin32PresentationSupportKHR) - -#endif /* __WINE_VULKAN_H */ From fd582e8b15ce81532facee0f41f970176b1316d8 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Mon, 12 Dec 2022 05:40:31 +0200 Subject: [PATCH 0003/2542] configure: Remove configure and config.h.in. Those are autogenerated by Proton's build system and get outdated very quickly. --- configure | 24766 ------------------------------------------ include/config.h.in | 836 -- 2 files changed, 25602 deletions(-) delete mode 100755 configure delete mode 100644 include/config.h.in diff --git a/configure b/configure deleted file mode 100755 index fe7464a61d01..000000000000 --- a/configure +++ /dev/null @@ -1,24766 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.72 for Wine 10.0. -# -# Report bugs to . -# -# -# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, -# Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else case e in #( - e) case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac ;; -esac -fi - - - -# Reset variables that may have inherited troublesome values from -# the environment. - -# IFS needs to be set, to space, tab, and newline, in precisely that order. -# (If _AS_PATH_WALK were called with IFS unset, it would have the -# side effect of setting IFS to empty, thus disabling word splitting.) -# Quoting is to prevent editors from complaining about space-tab. -as_nl=' -' -export as_nl -IFS=" "" $as_nl" - -PS1='$ ' -PS2='> ' -PS4='+ ' - -# Ensure predictable behavior from utilities with locale-dependent output. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# We cannot yet rely on "unset" to work, but we need these variables -# to be unset--not just set to an empty or harmless value--now, to -# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct -# also avoids known problems related to "unset" and subshell syntax -# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). -for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH -do eval test \${$as_var+y} \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done - -# Ensure that fds 0, 1, and 2 are open. -if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi -if (exec 3>&2) ; then :; else exec 2>/dev/null; fi - -# The user is always right. -if ${PATH_SEPARATOR+false} :; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - test -r "$as_dir$0" && as_myself=$as_dir$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as 'sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed 'exec'. -printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else case e in #( - e) case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ) -then : - -else case e in #( - e) exitcode=1; echo positional parameters were not saved. ;; -esac -fi -test x\$exitcode = x0 || exit 1 -blah=\$(echo \$(echo blah)) -test x\"\$blah\" = xblah || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" - if (eval "$as_required") 2>/dev/null -then : - as_have_required=yes -else case e in #( - e) as_have_required=no ;; -esac -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null -then : - -else case e in #( - e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null -then : - CONFIG_SHELL=$as_shell as_have_required=yes - if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null -then : - break 2 -fi -fi - done;; - esac - as_found=false -done -IFS=$as_save_IFS -if $as_found -then : - -else case e in #( - e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null -then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi ;; -esac -fi - - - if test "x$CONFIG_SHELL" != x -then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed 'exec'. -printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno -then : - printf "%s\n" "$0: This script requires a shell more modern than all" - printf "%s\n" "$0: the shells that I found on your system." - if test ${ZSH_VERSION+y} ; then - printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" - printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." - else - printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and -$0: wine-devel@winehq.org about your system, including any -$0: error possibly output before this message. Then install -$0: a modern shell, or manually run the script under such a -$0: shell if you do have one." - fi - exit 1 -fi ;; -esac -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null -then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else case e in #( - e) as_fn_append () - { - eval $1=\$$1\$2 - } ;; -esac -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null -then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else case e in #( - e) as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } ;; -esac -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - printf "%s\n" "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - t clear - :clear - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. - # In both cases, we have to default to 'cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" -as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated - -# Sed expression to map a string onto a valid variable name. -as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" -as_tr_sh="eval sed '$as_sed_sh'" # deprecated - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='Wine' -PACKAGE_TARNAME='wine' -PACKAGE_VERSION='10.0' -PACKAGE_STRING='Wine 10.0' -PACKAGE_BUGREPORT='wine-devel@winehq.org' -PACKAGE_URL='https://www.winehq.org' - -ac_unique_file="server/atom.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_STDIO_H -# include -#endif -#ifdef HAVE_STDLIB_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_header_c_list= -enable_year2038=yes -ac_subst_vars='LTLIBOBJS -LIBOBJS -TAGSFLAGS -RT_LIBS -WINELOADER_PROGRAMS -DELAYLOADFLAG -MSVCRTFLAGS -NETAPI_LIBS -NETAPI_CFLAGS -PROCSTAT_LIBS -GSSAPI_LIBS -GSSAPI_CFLAGS -KRB5_LIBS -KRB5_CFLAGS -FONTCONFIG_LIBS -FONTCONFIG_CFLAGS -CUPS_LIBS -CUPS_CFLAGS -CAPI20_LIBS -CAPI20_CFLAGS -SDL2_LIBS -SDL2_CFLAGS -UNWIND_LIBS -UNWIND_CFLAGS -UDEV_LIBS -UDEV_CFLAGS -OSS4_LIBS -OSS4_CFLAGS -ALSA_LIBS -GSTREAMER_LIBS -GSTREAMER_CFLAGS -FFMPEG_LIBS -FFMPEG_CFLAGS -PULSE_LIBS -PULSE_CFLAGS -GETTEXTPO_LIBS -FREETYPE_LIBS -FREETYPE_CFLAGS -RESOLV_LIBS -GPHOTO2_PORT_LIBS -GPHOTO2_PORT_CFLAGS -GPHOTO2_LIBS -GPHOTO2_CFLAGS -USB_LIBS -USB_CFLAGS -SANE_LIBS -SANE_CFLAGS -GNUTLS_LIBS -GNUTLS_CFLAGS -DBUS_LIBS -DBUS_CFLAGS -INOTIFY_LIBS -INOTIFY_CFLAGS -PCSCLITE_LIBS -PCAP_LIBS -WAYLAND_EGL_LIBS -WAYLAND_EGL_CFLAGS -EGL_LIBS -EGL_CFLAGS -XKBREGISTRY_LIBS -XKBREGISTRY_CFLAGS -XKBCOMMON_LIBS -XKBCOMMON_CFLAGS -WAYLAND_SCANNER -WAYLAND_CLIENT_LIBS -WAYLAND_CLIENT_CFLAGS -X_LIBS -X_CFLAGS -CPP -XMKMF -PTHREAD_LIBS -ZLIB_PE_LIBS -ZLIB_PE_CFLAGS -XSLT_PE_LIBS -XSLT_PE_CFLAGS -XML2_PE_LIBS -XML2_PE_CFLAGS -VKD3D_PE_LIBS -VKD3D_PE_CFLAGS -TIFF_PE_LIBS -TIFF_PE_CFLAGS -PNG_PE_LIBS -PNG_PE_CFLAGS -MUSL_PE_LIBS -MUSL_PE_CFLAGS -MPG123_PE_LIBS -MPG123_PE_CFLAGS -LDAP_PE_LIBS -LDAP_PE_CFLAGS -LCMS2_PE_LIBS -LCMS2_PE_CFLAGS -JXR_PE_LIBS -JXR_PE_CFLAGS -JPEG_PE_LIBS -JPEG_PE_CFLAGS -GSM_PE_LIBS -GSM_PE_CFLAGS -FLUIDSYNTH_PE_LIBS -FLUIDSYNTH_PE_CFLAGS -FAUDIO_PE_LIBS -FAUDIO_PE_CFLAGS -CAPSTONE_PE_LIBS -CAPSTONE_PE_CFLAGS -MINGW_PKG_CONFIG -PE_ARCHS -WINELOADER_DEPENDS -ac_ct_OBJC -OBJCFLAGS -OBJC -OPENCL_LIBS -COREAUDIO_LIBS -SYSTEMCONFIGURATION_LIBS -SECURITY_LIBS -APPKIT_LIBS -CORESERVICES_LIBS -APPLICATIONSERVICES_LIBS -METAL_LIBS -IOKIT_LIBS -DISKARBITRATION_LIBS -COREFOUNDATION_LIBS -CARBON_LIBS -CONFIGURE_TARGETS -DISABLED_SUBDIRS -SUBDIRS -READELF -OTOOL -LDD -DLLEXT -WINEPRELOADER_LDFLAGS -WINELOADER_LDFLAGS -TOP_INSTALL_DEV -TOP_INSTALL_LIB -UNIXLDFLAGS -UNIXDLLFLAGS -EXTRACFLAGS -LDEXECFLAGS -LDDLLFLAGS -DLLFLAGS -OPENGL_LIBS -I386_LIBS -MSGFMT -ICOTOOL -CONVERT -RSVG -FONTFORGE -PKG_CONFIG -LN_S -STRIP -BISON -FLEX -SED_CMD -RUNTESTFLAGS -toolsdir -x86_64_DISABLED_SUBDIRS -x86_64_DELAYLOADFLAG -x86_64_STRIP -x86_64_TARGET -x86_64_DEBUG -x86_64_LDFLAGS -x86_64_EXTRACFLAGS -x86_64_CFLAGS -x86_64_CC -i386_DISABLED_SUBDIRS -i386_DELAYLOADFLAG -i386_STRIP -i386_TARGET -i386_DEBUG -i386_LDFLAGS -i386_EXTRACFLAGS -i386_CFLAGS -i386_CC -arm64ec_DISABLED_SUBDIRS -arm64ec_DELAYLOADFLAG -arm64ec_STRIP -arm64ec_TARGET -arm64ec_DEBUG -arm64ec_LDFLAGS -arm64ec_EXTRACFLAGS -arm64ec_CFLAGS -arm64ec_CC -arm_DISABLED_SUBDIRS -arm_DELAYLOADFLAG -arm_STRIP -arm_TARGET -arm_DEBUG -arm_LDFLAGS -arm_EXTRACFLAGS -arm_CFLAGS -arm_CC -aarch64_DISABLED_SUBDIRS -aarch64_DELAYLOADFLAG -aarch64_STRIP -aarch64_TARGET -aarch64_DEBUG -aarch64_LDFLAGS -aarch64_EXTRACFLAGS -aarch64_CFLAGS -aarch64_CC -HOST_ARCH -toolsext -TARGETFLAGS -LD -CPPBIN -ac_ct_CXX -CXXFLAGS -CXX -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -SARIF_CONVERTER -srcdir -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -system_dllpath -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -runstatedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_archs -enable_win16 -enable_win64 -enable_tests -enable_build_id -enable_maintainer_mode -enable_sast -enable_silent_rules -enable_werror -with_alsa -with_capi -with_coreaudio -with_cups -with_dbus -with_ffmpeg -with_fontconfig -with_freetype -with_gettext -with_gettextpo -with_gphoto -with_gnutls -with_gssapi -with_gstreamer -with_inotify -with_krb5 -with_mingw -with_netapi -with_opencl -with_opengl -with_osmesa -with_oss -with_pcap -with_pcsclite -with_pthread -with_pulse -with_sane -with_sdl -with_udev -with_unwind -with_usb -with_v4l2 -with_vulkan -with_wayland -with_xcomposite -with_xcursor -with_xfixes -with_xinerama -with_xinput -with_xinput2 -with_xrandr -with_xrender -with_xshape -with_xshm -with_xxf86vm -with_system_dllpath -with_wine_tools -with_wine64 -enable_largefile -with_x -enable_acledit -enable_aclui -enable_activeds_tlb -enable_activeds -enable_actxprxy -enable_adsldp -enable_adsldpc -enable_advapi32 -enable_advpack -enable_amsi -enable_amstream -enable_apisetschema -enable_apphelp -enable_appwiz_cpl -enable_appxdeploymentclient -enable_atl -enable_atl100 -enable_atl110 -enable_atl80 -enable_atl90 -enable_atlthunk -enable_atmlib -enable_authz -enable_avicap32 -enable_avifil32 -enable_avrt -enable_bcp47langs -enable_bcrypt -enable_bcryptprimitives -enable_bluetoothapis -enable_browseui -enable_bthprops_cpl -enable_cabinet -enable_capi2032 -enable_cards -enable_cdosys -enable_cfgmgr32 -enable_clusapi -enable_cng_sys -enable_colorcnv -enable_combase -enable_comcat -enable_comctl32 -enable_comdlg32 -enable_coml2 -enable_compstui -enable_comsvcs -enable_concrt140 -enable_connect -enable_coremessaging -enable_credui -enable_crtdll -enable_crypt32 -enable_cryptdlg -enable_cryptdll -enable_cryptext -enable_cryptnet -enable_cryptowinrt -enable_cryptsp -enable_cryptui -enable_ctapi32 -enable_ctl3d32 -enable_d2d1 -enable_d3d10 -enable_d3d10_1 -enable_d3d10core -enable_d3d11 -enable_d3d12 -enable_d3d12core -enable_d3d8 -enable_d3d8thk -enable_d3d9 -enable_d3dcompiler_33 -enable_d3dcompiler_34 -enable_d3dcompiler_35 -enable_d3dcompiler_36 -enable_d3dcompiler_37 -enable_d3dcompiler_38 -enable_d3dcompiler_39 -enable_d3dcompiler_40 -enable_d3dcompiler_41 -enable_d3dcompiler_42 -enable_d3dcompiler_43 -enable_d3dcompiler_46 -enable_d3dcompiler_47 -enable_d3dim -enable_d3dim700 -enable_d3drm -enable_d3dx10_33 -enable_d3dx10_34 -enable_d3dx10_35 -enable_d3dx10_36 -enable_d3dx10_37 -enable_d3dx10_38 -enable_d3dx10_39 -enable_d3dx10_40 -enable_d3dx10_41 -enable_d3dx10_42 -enable_d3dx10_43 -enable_d3dx11_42 -enable_d3dx11_43 -enable_d3dx9_24 -enable_d3dx9_25 -enable_d3dx9_26 -enable_d3dx9_27 -enable_d3dx9_28 -enable_d3dx9_29 -enable_d3dx9_30 -enable_d3dx9_31 -enable_d3dx9_32 -enable_d3dx9_33 -enable_d3dx9_34 -enable_d3dx9_35 -enable_d3dx9_36 -enable_d3dx9_37 -enable_d3dx9_38 -enable_d3dx9_39 -enable_d3dx9_40 -enable_d3dx9_41 -enable_d3dx9_42 -enable_d3dx9_43 -enable_d3dxof -enable_dataexchange -enable_davclnt -enable_dbgeng -enable_dbghelp -enable_dciman32 -enable_dcomp -enable_ddraw -enable_ddrawex -enable_desk_cpl -enable_devenum -enable_dhcpcsvc -enable_dhcpcsvc6 -enable_dhtmled_ocx -enable_diasymreader -enable_difxapi -enable_dinput -enable_dinput8 -enable_directmanipulation -enable_dispex -enable_dmband -enable_dmcompos -enable_dmime -enable_dmloader -enable_dmscript -enable_dmstyle -enable_dmsynth -enable_dmusic -enable_dmusic32 -enable_dnsapi -enable_dplay -enable_dplayx -enable_dpnaddr -enable_dpnet -enable_dpnhpast -enable_dpnhupnp -enable_dpnlobby -enable_dpvoice -enable_dpwsockx -enable_drmclien -enable_dsdmo -enable_dsound -enable_dsquery -enable_dssenh -enable_dsuiext -enable_dswave -enable_dwmapi -enable_dwrite -enable_dx8vb -enable_dxcore -enable_dxdiagn -enable_dxgi -enable_dxtrans -enable_dxva2 -enable_esent -enable_evr -enable_explorerframe -enable_faultrep -enable_feclient -enable_fltlib -enable_fltmgr_sys -enable_fntcache -enable_fontsub -enable_fusion -enable_fwpuclnt -enable_gameux -enable_gamingtcui -enable_gdi32 -enable_gdiplus -enable_geolocation -enable_glu32 -enable_gphoto2_ds -enable_gpkcsp -enable_graphicscapture -enable_hal -enable_hhctrl_ocx -enable_hid -enable_hidclass_sys -enable_hidparse_sys -enable_hlink -enable_hnetcfg -enable_hrtfapo -enable_http_sys -enable_httpapi -enable_hvsimanagementapi -enable_ia2comproxy -enable_iccvid -enable_icmp -enable_icmui -enable_ieframe -enable_ieproxy -enable_iertutil -enable_imaadp32_acm -enable_imagehlp -enable_imm32 -enable_inetcomm -enable_inetcpl_cpl -enable_inetmib1 -enable_infosoft -enable_initpki -enable_inkobj -enable_inseng -enable_iphlpapi -enable_iprop -enable_ir50_32 -enable_irprops_cpl -enable_itircl -enable_itss -enable_joy_cpl -enable_jscript -enable_jsproxy -enable_kerberos -enable_kernel32 -enable_kernelbase -enable_ksecdd_sys -enable_ksproxy_ax -enable_ksuser -enable_ktmw32 -enable_l3codeca_acm -enable_l3codecx_ax -enable_light_msstyles -enable_loadperf -enable_localspl -enable_localui -enable_lz32 -enable_magnification -enable_mapi32 -enable_mapistub -enable_mciavi32 -enable_mcicda -enable_mciqtz32 -enable_mciseq -enable_mciwave -enable_mf -enable_mf3216 -enable_mfasfsrcsnk -enable_mferror -enable_mfh264enc -enable_mfmediaengine -enable_mfmp4srcsnk -enable_mfplat -enable_mfplay -enable_mfreadwrite -enable_mfsrcsnk -enable_mgmtapi -enable_midimap -enable_mlang -enable_mmcndmgr -enable_mmdevapi -enable_mouhid_sys -enable_mountmgr_sys -enable_mp3dmod -enable_mpr -enable_mprapi -enable_msacm32_drv -enable_msacm32 -enable_msado15 -enable_msadp32_acm -enable_msasn1 -enable_msauddecmft -enable_mscat32 -enable_mscms -enable_mscoree -enable_mscorwks -enable_msctf -enable_msctfmonitor -enable_msctfp -enable_msdaps -enable_msdasql -enable_msdelta -enable_msdmo -enable_msdrm -enable_msftedit -enable_msg711_acm -enable_msgsm32_acm -enable_mshtml_tlb -enable_mshtml -enable_msi -enable_msident -enable_msimg32 -enable_msimsg -enable_msimtf -enable_msisip -enable_msisys_ocx -enable_msls31 -enable_msmpeg2vdec -enable_msnet32 -enable_mspatcha -enable_msports -enable_msrle32 -enable_msscript_ocx -enable_mssign32 -enable_mssip32 -enable_mstask -enable_msttsengine -enable_msv1_0 -enable_msvcirt -enable_msvcm80 -enable_msvcm90 -enable_msvcp100 -enable_msvcp110 -enable_msvcp120 -enable_msvcp120_app -enable_msvcp140 -enable_msvcp140_1 -enable_msvcp140_2 -enable_msvcp140_atomic_wait -enable_msvcp140_codecvt_ids -enable_msvcp60 -enable_msvcp70 -enable_msvcp71 -enable_msvcp80 -enable_msvcp90 -enable_msvcp_win -enable_msvcr100 -enable_msvcr110 -enable_msvcr120 -enable_msvcr120_app -enable_msvcr70 -enable_msvcr71 -enable_msvcr80 -enable_msvcr90 -enable_msvcrt -enable_msvcrt20 -enable_msvcrt40 -enable_msvcrtd -enable_msvfw32 -enable_msvidc32 -enable_msvproc -enable_mswsock -enable_msxml -enable_msxml2 -enable_msxml3 -enable_msxml4 -enable_msxml6 -enable_mtxdm -enable_ncrypt -enable_nddeapi -enable_ndis_sys -enable_netapi32 -enable_netcfgx -enable_netio_sys -enable_netprofm -enable_netutils -enable_newdev -enable_ninput -enable_normaliz -enable_npmshtml -enable_npptools -enable_nsi -enable_nsiproxy_sys -enable_ntdll -enable_ntdsapi -enable_ntoskrnl_exe -enable_ntprint -enable_objsel -enable_odbc32 -enable_odbcbcp -enable_odbccp32 -enable_odbccu32 -enable_ole32 -enable_oleacc -enable_oleaut32 -enable_olecli32 -enable_oledb32 -enable_oledlg -enable_olepro32 -enable_olesvr32 -enable_olethk32 -enable_opcservices -enable_opencl -enable_opengl32 -enable_packager -enable_pdh -enable_photometadatahandler -enable_pidgen -enable_powrprof -enable_printui -enable_prntvpt -enable_profapi -enable_propsys -enable_psapi -enable_pstorec -enable_pwrshplugin -enable_qasf -enable_qcap -enable_qdvd -enable_qedit -enable_qmgr -enable_qmgrprxy -enable_quartz -enable_query -enable_qwave -enable_rasapi32 -enable_rasdlg -enable_regapi -enable_resampledmo -enable_resutils -enable_riched20 -enable_riched32 -enable_rometadata -enable_rpcrt4 -enable_rsabase -enable_rsaenh -enable_rstrtmgr -enable_rtutils -enable_rtworkq -enable_samlib -enable_sane_ds -enable_sapi -enable_sas -enable_scarddlg -enable_scardsvr -enable_sccbase -enable_schannel -enable_schedsvc -enable_scrobj -enable_scrrun -enable_scsiport_sys -enable_sechost -enable_secur32 -enable_security -enable_sensapi -enable_serialui -enable_setupapi -enable_sfc -enable_sfc_os -enable_shcore -enable_shdoclc -enable_shdocvw -enable_shell32 -enable_shfolder -enable_shlwapi -enable_slbcsp -enable_slc -enable_snmpapi -enable_softpub -enable_spoolss -enable_sppc -enable_srclient -enable_srvcli -enable_srvsvc -enable_sspicli -enable_stdole2_tlb -enable_stdole32_tlb -enable_sti -enable_strmdll -enable_svrapi -enable_sxs -enable_t2embed -enable_tapi32 -enable_taskschd -enable_tbs -enable_tdh -enable_tdi_sys -enable_threadpoolwinrt -enable_traffic -enable_twain_32 -enable_twinapi_appcore -enable_tzres -enable_ucrtbase -enable_uianimation -enable_uiautomationcore -enable_uiribbon -enable_unicows -enable_updspapi -enable_url -enable_urlmon -enable_usbd_sys -enable_user32 -enable_userenv -enable_usp10 -enable_utildll -enable_uxtheme -enable_vbscript -enable_vcomp -enable_vcomp100 -enable_vcomp110 -enable_vcomp120 -enable_vcomp140 -enable_vcomp90 -enable_vcruntime140 -enable_vcruntime140_1 -enable_vdmdbg -enable_version -enable_vga -enable_virtdisk -enable_vssapi -enable_vulkan_1 -enable_wbemdisp -enable_wbemprox -enable_wdscore -enable_webservices -enable_websocket -enable_wer -enable_wevtapi -enable_wevtsvc -enable_wiaservc -enable_wimgapi -enable_win32u -enable_windows_applicationmodel -enable_windows_devices_bluetooth -enable_windows_devices_enumeration -enable_windows_devices_usb -enable_windows_gaming_input -enable_windows_gaming_ui_gamebar -enable_windows_globalization -enable_windows_media_devices -enable_windows_media_mediacontrol -enable_windows_media_speech -enable_windows_media -enable_windows_networking_connectivity -enable_windows_networking_hostname -enable_windows_networking -enable_windows_perception_stub -enable_windows_security_authentication_onlineid -enable_windows_security_credentials_ui_userconsentverifier -enable_windows_storage_applicationdata -enable_windows_system_profile_systemmanufacturers -enable_windows_ui -enable_windows_web -enable_windowscodecs -enable_windowscodecsext -enable_winealsa_drv -enable_wineandroid_drv -enable_winebth_sys -enable_winebus_sys -enable_winecoreaudio_drv -enable_winecrt0 -enable_wined3d -enable_winedmo -enable_winegstreamer -enable_winehid_sys -enable_winemac_drv -enable_winemapi -enable_wineoss_drv -enable_wineps_drv -enable_winepulse_drv -enable_wineusb_sys -enable_winevulkan -enable_winewayland_drv -enable_winex11_drv -enable_winexinput_sys -enable_wing32 -enable_winhttp -enable_wininet -enable_winmm -enable_winnls32 -enable_winprint -enable_winscard -enable_winspool_drv -enable_winsta -enable_wintab32 -enable_wintrust -enable_wintypes -enable_winusb -enable_wlanapi -enable_wlanui -enable_wldap32 -enable_wldp -enable_wmadmod -enable_wmasf -enable_wmi -enable_wmilib_sys -enable_wmiutils -enable_wmp -enable_wmphoto -enable_wmvcore -enable_wmvdecod -enable_wnaspi32 -enable_wofutil -enable_wow64 -enable_wow64cpu -enable_wow64win -enable_wpc -enable_wpcap -enable_ws2_32 -enable_wsdapi -enable_wshom_ocx -enable_wsnmp32 -enable_wsock32 -enable_wtsapi32 -enable_wuapi -enable_wuaueng -enable_x3daudio1_0 -enable_x3daudio1_1 -enable_x3daudio1_2 -enable_x3daudio1_3 -enable_x3daudio1_4 -enable_x3daudio1_5 -enable_x3daudio1_6 -enable_x3daudio1_7 -enable_xactengine2_0 -enable_xactengine2_4 -enable_xactengine2_7 -enable_xactengine2_9 -enable_xactengine3_0 -enable_xactengine3_1 -enable_xactengine3_2 -enable_xactengine3_3 -enable_xactengine3_4 -enable_xactengine3_5 -enable_xactengine3_6 -enable_xactengine3_7 -enable_xapofx1_1 -enable_xapofx1_2 -enable_xapofx1_3 -enable_xapofx1_4 -enable_xapofx1_5 -enable_xaudio2_0 -enable_xaudio2_1 -enable_xaudio2_2 -enable_xaudio2_3 -enable_xaudio2_4 -enable_xaudio2_5 -enable_xaudio2_6 -enable_xaudio2_7 -enable_xaudio2_8 -enable_xaudio2_9 -enable_xinput1_1 -enable_xinput1_2 -enable_xinput1_3 -enable_xinput1_4 -enable_xinput9_1_0 -enable_xinputuap -enable_xmllite -enable_xolehlp -enable_xpsprint -enable_xpssvcs -enable_xtajit64 -enable_fonts -enable_include -enable_adsiid -enable_capstone -enable_dmoguids -enable_dxerr8 -enable_dxerr9 -enable_dxguid -enable_faudio -enable_fluidsynth -enable_gsm -enable_jpeg -enable_jxr -enable_lcms2 -enable_ldap -enable_mfuuid -enable_mpg123 -enable_musl -enable_png -enable_strmbase -enable_strmiids -enable_tiff -enable_uuid -enable_vkd3d -enable_wbemuuid -enable_wmcodecdspuuid -enable_xml2 -enable_xslt -enable_zlib -enable_loader -enable_nls -enable_po -enable_arp -enable_aspnet_regiis -enable_attrib -enable_cabarc -enable_cacls -enable_certutil -enable_chcp_com -enable_clock -enable_cmd -enable_conhost -enable_control -enable_cscript -enable_dism -enable_dllhost -enable_dplaysvr -enable_dpnsvr -enable_dpvsetup -enable_dxdiag -enable_eject -enable_expand -enable_explorer -enable_extrac32 -enable_fc -enable_find -enable_findstr -enable_fsutil -enable_hh -enable_hostname -enable_icacls -enable_icinfo -enable_iexplore -enable_ipconfig -enable_klist -enable_lodctr -enable_mofcomp -enable_mshta -enable_msidb -enable_msiexec -enable_msinfo32 -enable_net -enable_netsh -enable_netstat -enable_ngen -enable_notepad -enable_oleview -enable_ping -enable_plugplay -enable_pnputil -enable_powershell -enable_presentationfontcache -enable_progman -enable_reg -enable_regasm -enable_regedit -enable_regini -enable_regsvcs -enable_regsvr32 -enable_robocopy -enable_rpcss -enable_rundll32 -enable_sc -enable_schtasks -enable_sdbinst -enable_secedit -enable_servicemodelreg -enable_services -enable_setx -enable_shutdown -enable_sort -enable_spoolsv -enable_start -enable_subst -enable_svchost -enable_systeminfo -enable_taskkill -enable_tasklist -enable_taskmgr -enable_termsv -enable_uninstaller -enable_unlodctr -enable_view -enable_wevtutil -enable_where -enable_whoami -enable_wineboot -enable_winebrowser -enable_winecfg -enable_wineconsole -enable_winedbg -enable_winedevice -enable_winefile -enable_winemenubuilder -enable_winemine -enable_winemsibuilder -enable_winepath -enable_winetest -enable_winhlp32 -enable_winmgmt -enable_winver -enable_wmic -enable_wmplayer -enable_wordpad -enable_write -enable_wscript -enable_wuauserv -enable_wusa -enable_xcopy -enable_server -enable_tools -enable_sfnt2fon -enable_widl -enable_winebuild -enable_winedump -enable_winegcc -enable_winemaker -enable_wmc -enable_wrc -enable_year2038 -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CXX -CXXFLAGS -CCC -OBJC -OBJCFLAGS -CAPSTONE_PE_CFLAGS -CAPSTONE_PE_LIBS -FAUDIO_PE_CFLAGS -FAUDIO_PE_LIBS -FLUIDSYNTH_PE_CFLAGS -FLUIDSYNTH_PE_LIBS -GSM_PE_CFLAGS -GSM_PE_LIBS -JPEG_PE_CFLAGS -JPEG_PE_LIBS -JXR_PE_CFLAGS -JXR_PE_LIBS -LCMS2_PE_CFLAGS -LCMS2_PE_LIBS -LDAP_PE_CFLAGS -LDAP_PE_LIBS -MPG123_PE_CFLAGS -MPG123_PE_LIBS -MUSL_PE_CFLAGS -MUSL_PE_LIBS -PNG_PE_CFLAGS -PNG_PE_LIBS -TIFF_PE_CFLAGS -TIFF_PE_LIBS -VKD3D_PE_CFLAGS -VKD3D_PE_LIBS -XML2_PE_CFLAGS -XML2_PE_LIBS -XSLT_PE_CFLAGS -XSLT_PE_LIBS -ZLIB_PE_CFLAGS -ZLIB_PE_LIBS -XMKMF -CPP -WAYLAND_CLIENT_CFLAGS -WAYLAND_CLIENT_LIBS -XKBCOMMON_CFLAGS -XKBCOMMON_LIBS -XKBREGISTRY_CFLAGS -XKBREGISTRY_LIBS -EGL_CFLAGS -EGL_LIBS -WAYLAND_EGL_CFLAGS -WAYLAND_EGL_LIBS -INOTIFY_CFLAGS -INOTIFY_LIBS -DBUS_CFLAGS -DBUS_LIBS -GNUTLS_CFLAGS -GNUTLS_LIBS -SANE_CFLAGS -SANE_LIBS -USB_CFLAGS -USB_LIBS -GPHOTO2_CFLAGS -GPHOTO2_LIBS -GPHOTO2_PORT_CFLAGS -GPHOTO2_PORT_LIBS -FREETYPE_CFLAGS -FREETYPE_LIBS -PULSE_CFLAGS -PULSE_LIBS -FFMPEG_CFLAGS -FFMPEG_LIBS -GSTREAMER_CFLAGS -GSTREAMER_LIBS -UDEV_CFLAGS -UDEV_LIBS -UNWIND_CFLAGS -UNWIND_LIBS -SDL2_CFLAGS -SDL2_LIBS -CAPI20_CFLAGS -CAPI20_LIBS -CUPS_CFLAGS -CUPS_LIBS -FONTCONFIG_CFLAGS -FONTCONFIG_LIBS -KRB5_CFLAGS -KRB5_LIBS -GSSAPI_CFLAGS -GSSAPI_LIBS -NETAPI_CFLAGS -NETAPI_LIBS' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: '$ac_useropt'" - ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: '$ac_useropt'" - ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: '$ac_useropt'" - ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: '$ac_useropt'" - ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: '$ac_option' -Try '$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: '$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: '$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -'configure' configures Wine 10.0 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print 'checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for '--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or '..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, 'make install' will install all the files in -'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify -an installation prefix other than '$ac_default_prefix' using '--prefix', -for instance '--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/wine] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -X features: - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of Wine 10.0:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-archs={i386,x86_64,arm,aarch64} - enable multiple architectures for PE compilation - --disable-win16 do not include Win16 support - --enable-win64 build a Win64 emulator on AMD64 (won't run Win32 - binaries) - --disable-tests do not build the regression tests - --enable-build-id include .buildid section in output objects - --enable-maintainer-mode - enable maintainer-specific build rules - --enable-sast enable static application security testing using - Clang - --enable-silent-rules use silent build rules (override: "make V=1") - --enable-werror treat compilation warnings as errors - --disable-largefile omit support for large files - --disable-year2038 don't support timestamps after 2038 - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --without-alsa do not use the Alsa sound support - --without-capi do not use CAPI (ISDN support) - --without-coreaudio do not use the CoreAudio sound support - --without-cups do not use CUPS - --without-dbus do not use DBus (dynamic device support) - --without-ffmpeg do not use the FFmpeg library - --without-fontconfig do not use fontconfig - --without-freetype do not use the FreeType library - --without-gettext do not use gettext - --with-gettextpo use the GetTextPO library to rebuild po files - --without-gphoto do not use gphoto (Digital Camera support) - --without-gnutls do not use GnuTLS (schannel support) - --without-gssapi do not use GSSAPI (Kerberos SSP support) - --without-gstreamer do not use GStreamer (codecs support) - --without-inotify do not use inotify (filesystem change notifications) - --without-krb5 do not use krb5 (Kerberos) - --without-mingw do not use the MinGW cross-compiler - --without-netapi do not use the Samba NetAPI library - --without-opencl do not use OpenCL - --without-opengl do not use OpenGL - --without-osmesa do not use the OSMesa library - --without-oss do not use the OSS sound support - --without-pcap do not use the Packet Capture library - --without-pcsclite do not use PCSC lite - --without-pthread do not use the pthread library - --without-pulse do not use PulseAudio sound support - --without-sane do not use SANE (scanner support) - --without-sdl do not use SDL - --without-udev do not use udev (plug and play support) - --without-unwind do not use the libunwind library (exception - handling) - --without-usb do not use the libusb library - --without-v4l2 do not use v4l2 (video capture) - --without-vulkan do not use Vulkan - --without-wayland do not build the Wayland driver - --without-xcomposite do not use the Xcomposite extension - --without-xcursor do not use the Xcursor extension - --without-xfixes do not use Xfixes for clipboard change notifications - --without-xinerama do not use Xinerama (legacy multi-monitor support) - --without-xinput do not use the Xinput extension - --without-xinput2 do not use the Xinput 2 extension - --without-xrandr do not use Xrandr (multi-monitor support) - --without-xrender do not use the Xrender extension - --without-xshape do not use the Xshape extension - --without-xshm do not use XShm (shared memory extension) - --without-xxf86vm do not use XFree video mode extension - --with-system-dllpath=PATH - load external PE dependencies from colon-separated - path PATH - --with-wine-tools=DIR use Wine tools from directory DIR - --with-wine64=DIR use the 64-bit Wine in DIR for a Wow64 build - --with-x use the X Window System - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CXX C++ compiler command - CXXFLAGS C++ compiler flags - OBJC Objective C compiler command - OBJCFLAGS Objective C compiler flags - CAPSTONE_PE_CFLAGS - C compiler flags for the PE capstone, overriding the bundled - version - CAPSTONE_PE_LIBS - Linker flags for the PE capstone, overriding the bundled version - FAUDIO_PE_CFLAGS - C compiler flags for the PE faudio, overriding the bundled - version - FAUDIO_PE_LIBS - Linker flags for the PE faudio, overriding the bundled version - FLUIDSYNTH_PE_CFLAGS - C compiler flags for the PE fluidsynth, overriding the bundled - version - FLUIDSYNTH_PE_LIBS - Linker flags for the PE fluidsynth, overriding the bundled - version - GSM_PE_CFLAGS - C compiler flags for the PE gsm, overriding the bundled version - GSM_PE_LIBS Linker flags for the PE gsm, overriding the bundled version - JPEG_PE_CFLAGS - C compiler flags for the PE jpeg, overriding the bundled version - JPEG_PE_LIBS - Linker flags for the PE jpeg, overriding the bundled version - JXR_PE_CFLAGS - C compiler flags for the PE jxr, overriding the bundled version - JXR_PE_LIBS Linker flags for the PE jxr, overriding the bundled version - LCMS2_PE_CFLAGS - C compiler flags for the PE lcms2, overriding the bundled - version - LCMS2_PE_LIBS - Linker flags for the PE lcms2, overriding the bundled version - LDAP_PE_CFLAGS - C compiler flags for the PE ldap, overriding the bundled version - LDAP_PE_LIBS - Linker flags for the PE ldap, overriding the bundled version - MPG123_PE_CFLAGS - C compiler flags for the PE mpg123, overriding the bundled - version - MPG123_PE_LIBS - Linker flags for the PE mpg123, overriding the bundled version - MUSL_PE_CFLAGS - C compiler flags for the PE musl, overriding the bundled version - MUSL_PE_LIBS - Linker flags for the PE musl, overriding the bundled version - PNG_PE_CFLAGS - C compiler flags for the PE png, overriding the bundled version - PNG_PE_LIBS Linker flags for the PE png, overriding the bundled version - TIFF_PE_CFLAGS - C compiler flags for the PE tiff, overriding the bundled version - TIFF_PE_LIBS - Linker flags for the PE tiff, overriding the bundled version - VKD3D_PE_CFLAGS - C compiler flags for the PE vkd3d, overriding the bundled - version - VKD3D_PE_LIBS - Linker flags for the PE vkd3d, overriding the bundled version - XML2_PE_CFLAGS - C compiler flags for the PE xml2, overriding the bundled version - XML2_PE_LIBS - Linker flags for the PE xml2, overriding the bundled version - XSLT_PE_CFLAGS - C compiler flags for the PE xslt, overriding the bundled version - XSLT_PE_LIBS - Linker flags for the PE xslt, overriding the bundled version - ZLIB_PE_CFLAGS - C compiler flags for the PE zlib, overriding the bundled version - ZLIB_PE_LIBS - Linker flags for the PE zlib, overriding the bundled version - XMKMF Path to xmkmf, Makefile generator for X Window System - CPP C preprocessor - WAYLAND_CLIENT_CFLAGS - C compiler flags for wayland-client, overriding pkg-config - WAYLAND_CLIENT_LIBS - Linker flags for wayland-client, overriding pkg-config - XKBCOMMON_CFLAGS - C compiler flags for xkbcommon, overriding pkg-config - XKBCOMMON_LIBS - Linker flags for xkbcommon, overriding pkg-config - XKBREGISTRY_CFLAGS - C compiler flags for xkbregistry, overriding pkg-config - XKBREGISTRY_LIBS - Linker flags for xkbregistry, overriding pkg-config - EGL_CFLAGS C compiler flags for egl, overriding pkg-config - EGL_LIBS Linker flags for egl, overriding pkg-config - WAYLAND_EGL_CFLAGS - C compiler flags for wayland-egl, overriding pkg-config - WAYLAND_EGL_LIBS - Linker flags for wayland-egl, overriding pkg-config - INOTIFY_CFLAGS - C compiler flags for libinotify, overriding pkg-config - INOTIFY_LIBS - Linker flags for libinotify, overriding pkg-config - DBUS_CFLAGS C compiler flags for dbus-1, overriding pkg-config - DBUS_LIBS Linker flags for dbus-1, overriding pkg-config - GNUTLS_CFLAGS - C compiler flags for gnutls, overriding pkg-config - GNUTLS_LIBS Linker flags for gnutls, overriding pkg-config - SANE_CFLAGS C compiler flags for sane-backends, overriding pkg-config - SANE_LIBS Linker flags for sane-backends, overriding pkg-config - USB_CFLAGS C compiler flags for libusb-1.0, overriding pkg-config - USB_LIBS Linker flags for libusb-1.0, overriding pkg-config - GPHOTO2_CFLAGS - C compiler flags for libgphoto2, overriding pkg-config - GPHOTO2_LIBS - Linker flags for libgphoto2, overriding pkg-config - GPHOTO2_PORT_CFLAGS - C compiler flags for libgphoto2_port, overriding pkg-config - GPHOTO2_PORT_LIBS - Linker flags for libgphoto2_port, overriding pkg-config - FREETYPE_CFLAGS - C compiler flags for freetype2, overriding pkg-config - FREETYPE_LIBS - Linker flags for freetype2, overriding pkg-config - PULSE_CFLAGS - C compiler flags for libpulse, overriding pkg-config - PULSE_LIBS Linker flags for libpulse, overriding pkg-config - FFMPEG_CFLAGS - C compiler flags for libavutil libavformat libavcodec, - overriding pkg-config - FFMPEG_LIBS Linker flags for libavutil libavformat libavcodec, overriding - pkg-config - GSTREAMER_CFLAGS - C compiler flags for gstreamer-1.0 gstreamer-video-1.0 - gstreamer-audio-1.0 gstreamer-tag-1.0, overriding pkg-config - GSTREAMER_LIBS - Linker flags for gstreamer-1.0 gstreamer-video-1.0 - gstreamer-audio-1.0 gstreamer-tag-1.0, overriding pkg-config - UDEV_CFLAGS C compiler flags for libudev, overriding pkg-config - UDEV_LIBS Linker flags for libudev, overriding pkg-config - UNWIND_CFLAGS - C compiler flags for libunwind, overriding pkg-config - UNWIND_LIBS Linker flags for libunwind, overriding pkg-config - SDL2_CFLAGS C compiler flags for sdl2, overriding pkg-config - SDL2_LIBS Linker flags for sdl2, overriding pkg-config - CAPI20_CFLAGS - C compiler flags for capi20, overriding pkg-config - CAPI20_LIBS Linker flags for capi20, overriding pkg-config - CUPS_CFLAGS C compiler flags for cups, overriding pkg-config - CUPS_LIBS Linker flags for cups, overriding pkg-config - FONTCONFIG_CFLAGS - C compiler flags for fontconfig, overriding pkg-config - FONTCONFIG_LIBS - Linker flags for fontconfig, overriding pkg-config - KRB5_CFLAGS C compiler flags for krb5, overriding pkg-config - KRB5_LIBS Linker flags for krb5, overriding pkg-config - GSSAPI_CFLAGS - C compiler flags for krb5-gssapi, overriding pkg-config - GSSAPI_LIBS Linker flags for krb5-gssapi, overriding pkg-config - NETAPI_CFLAGS - C compiler flags for netapi, overriding pkg-config - NETAPI_LIBS Linker flags for netapi, overriding pkg-config - -Use these variables to override the choices made by 'configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to . -Wine home page: . -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for configure.gnu first; this name is used for a wrapper for - # Metaconfig's "Configure" on case-insensitive file systems. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -Wine configure 10.0 -generated by GNU Autoconf 2.72 - -Copyright (C) 2023 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext -then : - ac_retval=0 -else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 ;; -esac -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_cxx_try_compile LINENO -# ---------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext -then : - ac_retval=0 -else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 ;; -esac -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - } -then : - ac_retval=0 -else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 ;; -esac -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$3=yes" -else case e in #( - e) eval "$3=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# ac_fn_objc_try_compile LINENO -# ----------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_objc_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_objc_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext -then : - ac_retval=0 -else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 ;; -esac -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_objc_try_compile - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (void); below. */ - -#include -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (void); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main (void) -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$3=yes" -else case e in #( - e) eval "$3=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_func - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - } -then : - ac_retval=0 -else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 ;; -esac -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES -# ---------------------------------------------------- -# Tries to find if the field MEMBER exists in type AGGR, after including -# INCLUDES, setting cache variable VAR accordingly. -ac_fn_c_check_member () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -printf %s "checking for $2.$3... " >&6; } -if eval test \${$4+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -int -main (void) -{ -static $2 ac_aggr; -if (ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$4=yes" -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -int -main (void) -{ -static $2 ac_aggr; -if (sizeof ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$4=yes" -else case e in #( - e) eval "$4=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -eval ac_res=\$$4 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_member - -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main (void) -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main (void) -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else case e in #( - e) eval "$3=yes" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_type -ac_configure_args_raw= -for ac_arg -do - case $ac_arg in - *\'*) - ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append ac_configure_args_raw " '$ac_arg'" -done - -case $ac_configure_args_raw in - *$as_nl*) - ac_safe_unquote= ;; - *) - ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. - ac_unsafe_a="$ac_unsafe_z#~" - ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" - ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; -esac - -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by Wine $as_me 10.0, which was -generated by GNU Autoconf 2.72. Invocation command line was - - $ $0$ac_configure_args_raw - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - printf "%s\n" "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Sanitize IFS. - IFS=" "" $as_nl" - # Save into config.log some information that might help in debugging. - { - echo - - printf "%s\n" "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - printf "%s\n" "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - printf "%s\n" "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - printf "%s\n" "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - printf "%s\n" "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - printf "%s\n" "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - printf "%s\n" "$as_me: caught signal $ac_signal" - printf "%s\n" "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -printf "%s\n" "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - ac_site_files="$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - ac_site_files="$prefix/share/config.site $prefix/etc/config.site" -else - ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" -fi - -for ac_site_file in $ac_site_files -do - case $ac_site_file in #( - */*) : - ;; #( - *) : - ac_site_file=./$ac_site_file ;; -esac - if test -f "$ac_site_file" && test -r "$ac_site_file"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See 'config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -printf "%s\n" "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -printf "%s\n" "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Test code for whether the C compiler supports C89 (global declarations) -ac_c_conftest_c89_globals=' -/* Does the compiler advertise C89 conformance? - Do not test the value of __STDC__, because some compilers set it to 0 - while being otherwise adequately conformant. */ -#if !defined __STDC__ -# error "Compiler does not advertise C89 conformance" -#endif - -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ -struct buf { int x; }; -struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (char **p, int i) -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* C89 style stringification. */ -#define noexpand_stringify(a) #a -const char *stringified = noexpand_stringify(arbitrary+token=sequence); - -/* C89 style token pasting. Exercises some of the corner cases that - e.g. old MSVC gets wrong, but not very hard. */ -#define noexpand_concat(a,b) a##b -#define expand_concat(a,b) noexpand_concat(a,b) -extern int vA; -extern int vbee; -#define aye A -#define bee B -int *pvA = &expand_concat(v,aye); -int *pvbee = &noexpand_concat(v,bee); - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not \xHH hex character constants. - These do not provoke an error unfortunately, instead are silently treated - as an "x". The following induces an error, until -std is added to get - proper ANSI mode. Curiously \x00 != x always comes out true, for an - array size at least. It is necessary to write \x00 == 0 to get something - that is true only with -std. */ -int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) '\''x'\'' -int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), - int, int);' - -# Test code for whether the C compiler supports C89 (body of main). -ac_c_conftest_c89_main=' -ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); -' - -# Test code for whether the C compiler supports C99 (global declarations) -ac_c_conftest_c99_globals=' -/* Does the compiler advertise C99 conformance? */ -#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L -# error "Compiler does not advertise C99 conformance" -#endif - -// See if C++-style comments work. - -#include -extern int puts (const char *); -extern int printf (const char *, ...); -extern int dprintf (int, const char *, ...); -extern void *malloc (size_t); -extern void free (void *); - -// Check varargs macros. These examples are taken from C99 6.10.3.5. -// dprintf is used instead of fprintf to avoid needing to declare -// FILE and stderr. -#define debug(...) dprintf (2, __VA_ARGS__) -#define showlist(...) puts (#__VA_ARGS__) -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) -static void -test_varargs_macros (void) -{ - int x = 1234; - int y = 5678; - debug ("Flag"); - debug ("X = %d\n", x); - showlist (The first, second, and third items.); - report (x>y, "x is %d but y is %d", x, y); -} - -// Check long long types. -#define BIG64 18446744073709551615ull -#define BIG32 4294967295ul -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) -#if !BIG_OK - #error "your preprocessor is broken" -#endif -#if BIG_OK -#else - #error "your preprocessor is broken" -#endif -static long long int bignum = -9223372036854775807LL; -static unsigned long long int ubignum = BIG64; - -struct incomplete_array -{ - int datasize; - double data[]; -}; - -struct named_init { - int number; - const wchar_t *name; - double average; -}; - -typedef const char *ccp; - -static inline int -test_restrict (ccp restrict text) -{ - // Iterate through items via the restricted pointer. - // Also check for declarations in for loops. - for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) - continue; - return 0; -} - -// Check varargs and va_copy. -static bool -test_varargs (const char *format, ...) -{ - va_list args; - va_start (args, format); - va_list args_copy; - va_copy (args_copy, args); - - const char *str = ""; - int number = 0; - float fnumber = 0; - - while (*format) - { - switch (*format++) - { - case '\''s'\'': // string - str = va_arg (args_copy, const char *); - break; - case '\''d'\'': // int - number = va_arg (args_copy, int); - break; - case '\''f'\'': // float - fnumber = va_arg (args_copy, double); - break; - default: - break; - } - } - va_end (args_copy); - va_end (args); - - return *str && number && fnumber; -} -' - -# Test code for whether the C compiler supports C99 (body of main). -ac_c_conftest_c99_main=' - // Check bool. - _Bool success = false; - success |= (argc != 0); - - // Check restrict. - if (test_restrict ("String literal") == 0) - success = true; - char *restrict newvar = "Another string"; - - // Check varargs. - success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); - test_varargs_macros (); - - // Check flexible array members. - struct incomplete_array *ia = - malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); - ia->datasize = 10; - for (int i = 0; i < ia->datasize; ++i) - ia->data[i] = i * 1.234; - // Work around memory leak warnings. - free (ia); - - // Check named initializers. - struct named_init ni = { - .number = 34, - .name = L"Test wide string", - .average = 543.34343, - }; - - ni.number = 58; - - int dynamic_array[ni.number]; - dynamic_array[0] = argv[0][0]; - dynamic_array[ni.number - 1] = 543; - - // work around unused variable warnings - ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' - || dynamic_array[ni.number - 1] != 543); -' - -# Test code for whether the C compiler supports C11 (global declarations) -ac_c_conftest_c11_globals=' -/* Does the compiler advertise C11 conformance? */ -#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L -# error "Compiler does not advertise C11 conformance" -#endif - -// Check _Alignas. -char _Alignas (double) aligned_as_double; -char _Alignas (0) no_special_alignment; -extern char aligned_as_int; -char _Alignas (0) _Alignas (int) aligned_as_int; - -// Check _Alignof. -enum -{ - int_alignment = _Alignof (int), - int_array_alignment = _Alignof (int[100]), - char_alignment = _Alignof (char) -}; -_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); - -// Check _Noreturn. -int _Noreturn does_not_return (void) { for (;;) continue; } - -// Check _Static_assert. -struct test_static_assert -{ - int x; - _Static_assert (sizeof (int) <= sizeof (long int), - "_Static_assert does not work in struct"); - long int y; -}; - -// Check UTF-8 literals. -#define u8 syntax error! -char const utf8_literal[] = u8"happens to be ASCII" "another string"; - -// Check duplicate typedefs. -typedef long *long_ptr; -typedef long int *long_ptr; -typedef long_ptr long_ptr; - -// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. -struct anonymous -{ - union { - struct { int i; int j; }; - struct { int k; long int l; } w; - }; - int m; -} v1; -' - -# Test code for whether the C compiler supports C11 (body of main). -ac_c_conftest_c11_main=' - _Static_assert ((offsetof (struct anonymous, i) - == offsetof (struct anonymous, w.k)), - "Anonymous union alignment botch"); - v1.i = 2; - v1.w.k = 5; - ok |= v1.i != 5; -' - -# Test code for whether the C compiler supports C11 (complete). -ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} -${ac_c_conftest_c99_globals} -${ac_c_conftest_c11_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - ${ac_c_conftest_c99_main} - ${ac_c_conftest_c11_main} - return ok; -} -" - -# Test code for whether the C compiler supports C99 (complete). -ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} -${ac_c_conftest_c99_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - ${ac_c_conftest_c99_main} - return ok; -} -" - -# Test code for whether the C compiler supports C89 (complete). -ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - return ok; -} -" - -# Test code for whether the C++ compiler supports C++98 (global declarations) -ac_cxx_conftest_cxx98_globals=' -// Does the compiler advertise C++98 conformance? -#if !defined __cplusplus || __cplusplus < 199711L -# error "Compiler does not advertise C++98 conformance" -#endif - -// These inclusions are to reject old compilers that -// lack the unsuffixed header files. -#include -#include - -// and are *not* freestanding headers in C++98. -extern void assert (int); -namespace std { - extern int strcmp (const char *, const char *); -} - -// Namespaces, exceptions, and templates were all added after "C++ 2.0". -using std::exception; -using std::strcmp; - -namespace { - -void test_exception_syntax() -{ - try { - throw "test"; - } catch (const char *s) { - // Extra parentheses suppress a warning when building autoconf itself, - // due to lint rules shared with more typical C programs. - assert (!(strcmp) (s, "test")); - } -} - -template struct test_template -{ - T const val; - explicit test_template(T t) : val(t) {} - template T add(U u) { return static_cast(u) + val; } -}; - -} // anonymous namespace -' - -# Test code for whether the C++ compiler supports C++98 (body of main) -ac_cxx_conftest_cxx98_main=' - assert (argc); - assert (! argv[0]); -{ - test_exception_syntax (); - test_template tt (2.0); - assert (tt.add (4) == 6.0); - assert (true && !false); -} -' - -# Test code for whether the C++ compiler supports C++11 (global declarations) -ac_cxx_conftest_cxx11_globals=' -// Does the compiler advertise C++ 2011 conformance? -#if !defined __cplusplus || __cplusplus < 201103L -# error "Compiler does not advertise C++11 conformance" -#endif - -namespace cxx11test -{ - constexpr int get_val() { return 20; } - - struct testinit - { - int i; - double d; - }; - - class delegate - { - public: - delegate(int n) : n(n) {} - delegate(): delegate(2354) {} - - virtual int getval() { return this->n; }; - protected: - int n; - }; - - class overridden : public delegate - { - public: - overridden(int n): delegate(n) {} - virtual int getval() override final { return this->n * 2; } - }; - - class nocopy - { - public: - nocopy(int i): i(i) {} - nocopy() = default; - nocopy(const nocopy&) = delete; - nocopy & operator=(const nocopy&) = delete; - private: - int i; - }; - - // for testing lambda expressions - template Ret eval(Fn f, Ret v) - { - return f(v); - } - - // for testing variadic templates and trailing return types - template auto sum(V first) -> V - { - return first; - } - template auto sum(V first, Args... rest) -> V - { - return first + sum(rest...); - } -} -' - -# Test code for whether the C++ compiler supports C++11 (body of main) -ac_cxx_conftest_cxx11_main=' -{ - // Test auto and decltype - auto a1 = 6538; - auto a2 = 48573953.4; - auto a3 = "String literal"; - - int total = 0; - for (auto i = a3; *i; ++i) { total += *i; } - - decltype(a2) a4 = 34895.034; -} -{ - // Test constexpr - short sa[cxx11test::get_val()] = { 0 }; -} -{ - // Test initializer lists - cxx11test::testinit il = { 4323, 435234.23544 }; -} -{ - // Test range-based for - int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, - 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; - for (auto &x : array) { x += 23; } -} -{ - // Test lambda expressions - using cxx11test::eval; - assert (eval ([](int x) { return x*2; }, 21) == 42); - double d = 2.0; - assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); - assert (d == 5.0); - assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); - assert (d == 5.0); -} -{ - // Test use of variadic templates - using cxx11test::sum; - auto a = sum(1); - auto b = sum(1, 2); - auto c = sum(1.0, 2.0, 3.0); -} -{ - // Test constructor delegation - cxx11test::delegate d1; - cxx11test::delegate d2(); - cxx11test::delegate d3(45); -} -{ - // Test override and final - cxx11test::overridden o1(55464); -} -{ - // Test nullptr - char *c = nullptr; -} -{ - // Test template brackets - test_template<::test_template> v(test_template(12)); -} -{ - // Unicode literals - char const *utf8 = u8"UTF-8 string \u2500"; - char16_t const *utf16 = u"UTF-8 string \u2500"; - char32_t const *utf32 = U"UTF-32 string \u2500"; -} -' - -# Test code for whether the C compiler supports C++11 (complete). -ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} -${ac_cxx_conftest_cxx11_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_cxx_conftest_cxx98_main} - ${ac_cxx_conftest_cxx11_main} - return ok; -} -" - -# Test code for whether the C compiler supports C++98 (complete). -ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_cxx_conftest_cxx98_main} - return ok; -} -" - -as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" -as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" -as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" -as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" -as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" -as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" -as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" -as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" -as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" - -# Auxiliary files required by this configure script. -ac_aux_files="config.guess config.sub" - -# Locations in which to look for auxiliary files. -ac_aux_dir_candidates="${srcdir}/tools" - -# Search for a directory containing all of the required auxiliary files, -# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. -# If we don't find one directory that contains all the files we need, -# we report the set of missing files from the *first* directory in -# $ac_aux_dir_candidates and give up. -ac_missing_aux_files="" -ac_first_candidate=: -printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in $ac_aux_dir_candidates -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - as_found=: - - printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 - ac_aux_dir_found=yes - ac_install_sh= - for ac_aux in $ac_aux_files - do - # As a special case, if "install-sh" is required, that requirement - # can be satisfied by any of "install-sh", "install.sh", or "shtool", - # and $ac_install_sh is set appropriately for whichever one is found. - if test x"$ac_aux" = x"install-sh" - then - if test -f "${as_dir}install-sh"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 - ac_install_sh="${as_dir}install-sh -c" - elif test -f "${as_dir}install.sh"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 - ac_install_sh="${as_dir}install.sh -c" - elif test -f "${as_dir}shtool"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 - ac_install_sh="${as_dir}shtool install -c" - else - ac_aux_dir_found=no - if $ac_first_candidate; then - ac_missing_aux_files="${ac_missing_aux_files} install-sh" - else - break - fi - fi - else - if test -f "${as_dir}${ac_aux}"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 - else - ac_aux_dir_found=no - if $ac_first_candidate; then - ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" - else - break - fi - fi - fi - done - if test "$ac_aux_dir_found" = yes; then - ac_aux_dir="$as_dir" - break - fi - ac_first_candidate=false - - as_found=false -done -IFS=$as_save_IFS -if $as_found -then : - -else case e in #( - e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; -esac -fi - - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -if test -f "${ac_aux_dir}config.guess"; then - ac_config_guess="$SHELL ${ac_aux_dir}config.guess" -fi -if test -f "${ac_aux_dir}config.sub"; then - ac_config_sub="$SHELL ${ac_aux_dir}config.sub" -fi -if test -f "$ac_aux_dir/configure"; then - ac_configure="$SHELL ${ac_aux_dir}configure" -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' - and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -ac_config_headers="$ac_config_headers include/config.h" - - - -libwine_version="1.0" - - -# Check whether --enable-archs was given. -if test ${enable_archs+y} -then : - enableval=$enable_archs; -fi - -# Check whether --enable-win16 was given. -if test ${enable_win16+y} -then : - enableval=$enable_win16; -fi - -# Check whether --enable-win64 was given. -if test ${enable_win64+y} -then : - enableval=$enable_win64; -fi - -# Check whether --enable-tests was given. -if test ${enable_tests+y} -then : - enableval=$enable_tests; -fi - -# Check whether --enable-build-id was given. -if test ${enable_build_id+y} -then : - enableval=$enable_build_id; -fi - -# Check whether --enable-maintainer-mode was given. -if test ${enable_maintainer_mode+y} -then : - enableval=$enable_maintainer_mode; -fi - -# Check whether --enable-sast was given. -if test ${enable_sast+y} -then : - enableval=$enable_sast; -fi - -# Check whether --enable-silent-rules was given. -if test ${enable_silent_rules+y} -then : - enableval=$enable_silent_rules; -fi - -# Check whether --enable-werror was given. -if test ${enable_werror+y} -then : - enableval=$enable_werror; -fi - - - -# Check whether --with-alsa was given. -if test ${with_alsa+y} -then : - withval=$with_alsa; -fi - - -# Check whether --with-capi was given. -if test ${with_capi+y} -then : - withval=$with_capi; -fi - - -# Check whether --with-coreaudio was given. -if test ${with_coreaudio+y} -then : - withval=$with_coreaudio; -fi - - -# Check whether --with-cups was given. -if test ${with_cups+y} -then : - withval=$with_cups; -fi - - -# Check whether --with-dbus was given. -if test ${with_dbus+y} -then : - withval=$with_dbus; -fi - - -# Check whether --with-ffmpeg was given. -if test ${with_ffmpeg+y} -then : - withval=$with_ffmpeg; -fi - - -# Check whether --with-fontconfig was given. -if test ${with_fontconfig+y} -then : - withval=$with_fontconfig; -fi - - -# Check whether --with-freetype was given. -if test ${with_freetype+y} -then : - withval=$with_freetype; -fi - - -# Check whether --with-gettext was given. -if test ${with_gettext+y} -then : - withval=$with_gettext; -fi - - -# Check whether --with-gettextpo was given. -if test ${with_gettextpo+y} -then : - withval=$with_gettextpo; if test "x$withval" = "xno"; then ac_cv_header_gettext_po_h=no; fi -fi - - -# Check whether --with-gphoto was given. -if test ${with_gphoto+y} -then : - withval=$with_gphoto; -fi - - -# Check whether --with-gnutls was given. -if test ${with_gnutls+y} -then : - withval=$with_gnutls; -fi - - -# Check whether --with-gssapi was given. -if test ${with_gssapi+y} -then : - withval=$with_gssapi; -fi - - -# Check whether --with-gstreamer was given. -if test ${with_gstreamer+y} -then : - withval=$with_gstreamer; -fi - - -# Check whether --with-inotify was given. -if test ${with_inotify+y} -then : - withval=$with_inotify; -fi - - -# Check whether --with-krb5 was given. -if test ${with_krb5+y} -then : - withval=$with_krb5; -fi - - -# Check whether --with-mingw was given. -if test ${with_mingw+y} -then : - withval=$with_mingw; -fi - - -# Check whether --with-netapi was given. -if test ${with_netapi+y} -then : - withval=$with_netapi; -fi - - -# Check whether --with-opencl was given. -if test ${with_opencl+y} -then : - withval=$with_opencl; if test "x$withval" = "xno"; then ac_cv_header_CL_cl_h=no; ac_cv_header_OpenCL_opencl_h=no; fi -fi - - -# Check whether --with-opengl was given. -if test ${with_opengl+y} -then : - withval=$with_opengl; -fi - - -# Check whether --with-osmesa was given. -if test ${with_osmesa+y} -then : - withval=$with_osmesa; -fi - - -# Check whether --with-oss was given. -if test ${with_oss+y} -then : - withval=$with_oss; -fi - - -# Check whether --with-pcap was given. -if test ${with_pcap+y} -then : - withval=$with_pcap; if test "x$withval" = "xno"; then ac_cv_header_pcap_pcap_h=no; fi -fi - - -# Check whether --with-pcsclite was given. -if test ${with_pcsclite+y} -then : - withval=$with_pcsclite; -fi - - -# Check whether --with-pthread was given. -if test ${with_pthread+y} -then : - withval=$with_pthread; -fi - - -# Check whether --with-pulse was given. -if test ${with_pulse+y} -then : - withval=$with_pulse; -fi - - -# Check whether --with-sane was given. -if test ${with_sane+y} -then : - withval=$with_sane; -fi - - -# Check whether --with-sdl was given. -if test ${with_sdl+y} -then : - withval=$with_sdl; -fi - - -# Check whether --with-udev was given. -if test ${with_udev+y} -then : - withval=$with_udev; -fi - - -# Check whether --with-unwind was given. -if test ${with_unwind+y} -then : - withval=$with_unwind; -fi - - -# Check whether --with-usb was given. -if test ${with_usb+y} -then : - withval=$with_usb; -fi - - -# Check whether --with-v4l2 was given. -if test ${with_v4l2+y} -then : - withval=$with_v4l2; -fi - - -# Check whether --with-vulkan was given. -if test ${with_vulkan+y} -then : - withval=$with_vulkan; -fi - - -# Check whether --with-wayland was given. -if test ${with_wayland+y} -then : - withval=$with_wayland; -fi - - -# Check whether --with-xcomposite was given. -if test ${with_xcomposite+y} -then : - withval=$with_xcomposite; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_Xcomposite_h=no; fi -fi - - -# Check whether --with-xcursor was given. -if test ${with_xcursor+y} -then : - withval=$with_xcursor; if test "x$withval" = "xno"; then ac_cv_header_X11_Xcursor_Xcursor_h=no; fi -fi - - -# Check whether --with-xfixes was given. -if test ${with_xfixes+y} -then : - withval=$with_xfixes; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_Xfixes_h=no; fi -fi - - -# Check whether --with-xinerama was given. -if test ${with_xinerama+y} -then : - withval=$with_xinerama; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_Xinerama_h=no; fi -fi - - -# Check whether --with-xinput was given. -if test ${with_xinput+y} -then : - withval=$with_xinput; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_XInput_h=no; fi -fi - - -# Check whether --with-xinput2 was given. -if test ${with_xinput2+y} -then : - withval=$with_xinput2; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_XInput2_h=no; fi -fi - - -# Check whether --with-xrandr was given. -if test ${with_xrandr+y} -then : - withval=$with_xrandr; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_Xrandr_h=no; fi -fi - - -# Check whether --with-xrender was given. -if test ${with_xrender+y} -then : - withval=$with_xrender; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_Xrender_h=no; fi -fi - - -# Check whether --with-xshape was given. -if test ${with_xshape+y} -then : - withval=$with_xshape; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_shape_h=no; fi -fi - - -# Check whether --with-xshm was given. -if test ${with_xshm+y} -then : - withval=$with_xshm; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_XShm_h=no; fi -fi - - -# Check whether --with-xxf86vm was given. -if test ${with_xxf86vm+y} -then : - withval=$with_xxf86vm; if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_xf86vmode_h=no; ac_cv_header_X11_extensions_xf86vmproto_h=no; fi -fi - - - -# Check whether --with-system-dllpath was given. -if test ${with_system_dllpath+y} -then : - withval=$with_system_dllpath; system_dllpath=$withval - -fi - - -# Check whether --with-wine-tools was given. -if test ${with_wine_tools+y} -then : - withval=$with_wine_tools; -fi - - -# Check whether --with-wine64 was given. -if test ${with_wine64+y} -then : - withval=$with_wine64; -fi - - - - - - # Make sure we can run config.sub. -$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -printf %s "checking build system type... " >&6; } -if test ${ac_cv_build+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 - ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -printf "%s\n" "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -printf %s "checking host system type... " >&6; } -if test ${ac_cv_host+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || - as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 -fi - ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -printf "%s\n" "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - - - -if test "x$enable_sast" = xyes -then : - CC=${CC:-clang} -with_mingw=${with_mingw:-clang} -for ac_prog in sarif-converter -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_SARIF_CONVERTER+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$SARIF_CONVERTER"; then - ac_cv_prog_SARIF_CONVERTER="$SARIF_CONVERTER" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_SARIF_CONVERTER="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -SARIF_CONVERTER=$ac_cv_prog_SARIF_CONVERTER -if test -n "$SARIF_CONVERTER"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SARIF_CONVERTER" >&5 -printf "%s\n" "$SARIF_CONVERTER" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$SARIF_CONVERTER" && break -done -test -n "$SARIF_CONVERTER" || SARIF_CONVERTER="false" - -fi - - - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" - fi -fi -fi ;; -esac -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. -set dummy ${ac_tool_prefix}clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "clang", so it can be a program name with args. -set dummy clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -fi - - -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See 'config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion -version; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -printf %s "checking whether the C compiler works... " >&6; } -ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : - # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. -# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an '-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else case e in #( - e) ac_file='' ;; -esac -fi -if test -z "$ac_file" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See 'config.log' for more details" "$LINENO" 5; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -printf %s "checking for C compiler default output file name... " >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -printf "%s\n" "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -printf %s "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : - # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) -# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will -# work properly (i.e., refer to 'conftest.exe'), while it won't with -# 'rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else case e in #( - e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See 'config.log' for more details" "$LINENO" 5; } ;; -esac -fi -rm -f conftest conftest$ac_cv_exeext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -printf "%s\n" "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -FILE *f = fopen ("conftest.out", "w"); - if (!f) - return 1; - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -printf %s "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} -as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use '--host'. -See 'config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -printf "%s\n" "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext \ - conftest.o conftest.obj conftest.out -ac_clean_files=$ac_clean_files_save -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -printf %s "checking for suffix of object files... " >&6; } -if test ${ac_cv_objext+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See 'config.log' for more details" "$LINENO" 5; } ;; -esac -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -printf "%s\n" "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 -printf %s "checking whether the compiler supports GNU C... " >&6; } -if test ${ac_cv_c_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_compiler_gnu=yes -else case e in #( - e) ac_compiler_gnu=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+y} -ac_save_CFLAGS=$CFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -printf %s "checking whether $CC accepts -g... " >&6; } -if test ${ac_cv_prog_cc_g+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_g=yes -else case e in #( - e) CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else case e in #( - e) ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -printf "%s\n" "$ac_cv_prog_cc_g" >&6; } -if test $ac_test_CFLAGS; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -ac_prog_cc_stdc=no -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 -printf %s "checking for $CC option to enable C11 features... " >&6; } -if test ${ac_cv_prog_cc_c11+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_cv_prog_cc_c11=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c11_program -_ACEOF -for ac_arg in '' -std=gnu11 -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c11=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c11" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC ;; -esac -fi - -if test "x$ac_cv_prog_cc_c11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else case e in #( - e) if test "x$ac_cv_prog_cc_c11" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 -printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" ;; -esac -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 ;; -esac -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 -printf %s "checking for $CC option to enable C99 features... " >&6; } -if test ${ac_cv_prog_cc_c99+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c99_program -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c99=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC ;; -esac -fi - -if test "x$ac_cv_prog_cc_c99" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else case e in #( - e) if test "x$ac_cv_prog_cc_c99" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" ;; -esac -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 ;; -esac -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 -printf %s "checking for $CC option to enable C89 features... " >&6; } -if test ${ac_cv_prog_cc_c89+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c89_program -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC ;; -esac -fi - -if test "x$ac_cv_prog_cc_c89" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else case e in #( - e) if test "x$ac_cv_prog_cc_c89" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" ;; -esac -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 ;; -esac -fi -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CXX+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -printf "%s\n" "$CXX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CXX+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -printf "%s\n" "$ac_ct_CXX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 -printf %s "checking whether the compiler supports GNU C++... " >&6; } -if test ${ac_cv_cxx_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_compiler_gnu=yes -else case e in #( - e) ac_compiler_gnu=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+y} -ac_save_CXXFLAGS=$CXXFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -printf %s "checking whether $CXX accepts -g... " >&6; } -if test ${ac_cv_prog_cxx_g+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_g=yes -else case e in #( - e) CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - -else case e in #( - e) ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } -if test $ac_test_CXXFLAGS; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -ac_prog_cxx_stdcxx=no -if test x$ac_prog_cxx_stdcxx = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 -printf %s "checking for $CXX option to enable C++11 features... " >&6; } -if test ${ac_cv_prog_cxx_cxx11+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_cv_prog_cxx_cxx11=no -ac_save_CXX=$CXX -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_cxx_conftest_cxx11_program -_ACEOF -for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA -do - CXX="$ac_save_CXX $ac_arg" - if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_cxx11=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cxx_cxx11" != "xno" && break -done -rm -f conftest.$ac_ext -CXX=$ac_save_CXX ;; -esac -fi - -if test "x$ac_cv_prog_cxx_cxx11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else case e in #( - e) if test "x$ac_cv_prog_cxx_cxx11" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 -printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx11" ;; -esac -fi - ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 - ac_prog_cxx_stdcxx=cxx11 ;; -esac -fi -fi -if test x$ac_prog_cxx_stdcxx = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 -printf %s "checking for $CXX option to enable C++98 features... " >&6; } -if test ${ac_cv_prog_cxx_cxx98+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_cv_prog_cxx_cxx98=no -ac_save_CXX=$CXX -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_cxx_conftest_cxx98_program -_ACEOF -for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA -do - CXX="$ac_save_CXX $ac_arg" - if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_cxx98=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cxx_cxx98" != "xno" && break -done -rm -f conftest.$ac_ext -CXX=$ac_save_CXX ;; -esac -fi - -if test "x$ac_cv_prog_cxx_cxx98" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else case e in #( - e) if test "x$ac_cv_prog_cxx_cxx98" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 -printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx98" ;; -esac -fi - ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 - ac_prog_cxx_stdcxx=cxx98 ;; -esac -fi -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cpp", so it can be a program name with args. -set dummy ${ac_tool_prefix}cpp; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CPPBIN+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$CPPBIN"; then - ac_cv_prog_CPPBIN="$CPPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CPPBIN="${ac_tool_prefix}cpp" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -CPPBIN=$ac_cv_prog_CPPBIN -if test -n "$CPPBIN"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPPBIN" >&5 -printf "%s\n" "$CPPBIN" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CPPBIN"; then - ac_ct_CPPBIN=$CPPBIN - # Extract the first word of "cpp", so it can be a program name with args. -set dummy cpp; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CPPBIN+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$ac_ct_CPPBIN"; then - ac_cv_prog_ac_ct_CPPBIN="$ac_ct_CPPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CPPBIN="cpp" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -ac_ct_CPPBIN=$ac_cv_prog_ac_ct_CPPBIN -if test -n "$ac_ct_CPPBIN"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CPPBIN" >&5 -printf "%s\n" "$ac_ct_CPPBIN" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CPPBIN" = x; then - CPPBIN="cpp" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CPPBIN=$ac_ct_CPPBIN - fi -else - CPPBIN="$ac_cv_prog_CPPBIN" -fi - - -printf "%s\n" "#define EXEEXT \"$ac_exeext\"" >>confdefs.h - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. -set dummy ${ac_tool_prefix}ld; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_LD+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$LD"; then - ac_cv_prog_LD="$LD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_LD="${ac_tool_prefix}ld" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -LD=$ac_cv_prog_LD -if test -n "$LD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -printf "%s\n" "$LD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_LD"; then - ac_ct_LD=$LD - # Extract the first word of "ld", so it can be a program name with args. -set dummy ld; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_LD+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$ac_ct_LD"; then - ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_LD="ld" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -ac_ct_LD=$ac_cv_prog_ac_ct_LD -if test -n "$ac_ct_LD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LD" >&5 -printf "%s\n" "$ac_ct_LD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_LD" = x; then - LD="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - LD=$ac_ct_LD - fi -else - LD="$ac_cv_prog_LD" -fi - - -case $host in - *-darwin*) - with_fontconfig=${with_fontconfig:-no} - ;; - *-mingw32*|*-cygwin*) - enable_win16=${enable_win16:-no} - with_mingw=${with_mingw:-no} - ;; -esac - - -case $host in - x86_64*|amd64*) - if test "x$enable_win64" != "xyes" -a "$cross_compiling" != "yes" -a x"$enable_archs" = x - then - CC="$CC -m32" - CXX="$CXX -m32" - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC works" >&5 -printf %s "checking whether $CC works... " >&6; } -if test ${wine_cv_cc_m32+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - wine_cv_cc_m32=yes -else case e in #( - e) wine_cv_cc_m32=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_cc_m32" >&5 -printf "%s\n" "$wine_cv_cc_m32" >&6; } - test $wine_cv_cc_m32 != no || as_fn_error $? "Cannot build a 32-bit program, you need to install 32-bit development libraries." "$LINENO" 5 - host_cpu="i386" - notice_platform="32-bit " - TARGETFLAGS="$TARGETFLAGS -m32" - PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib32/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig} - export PKG_CONFIG_LIBDIR - else - CC="$CC -m64" - CXX="$CXX -m64" - host_cpu="x86_64" - notice_platform="64-bit " - TARGETFLAGS="$TARGETFLAGS -m64" - fi - ;; - arm*) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports Thumb-2" >&5 -printf %s "checking whether $CC supports Thumb-2... " >&6; } -if test ${wine_cv_thumb2+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -asm(".syntax unified\n\t.thumb\n\tldm r0,{r0-r8}"); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - wine_cv_thumb2=yes -else case e in #( - e) wine_cv_thumb2=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_thumb2" >&5 -printf "%s\n" "$wine_cv_thumb2" >&6; } - if test x"$wine_cv_thumb2" = xyes - then - CFLAGS="$CFLAGS -mthumb" - else - CFLAGS="$CFLAGS -marm" - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports floating point instructions" >&5 -printf %s "checking whether $CC supports floating point instructions... " >&6; } -if test ${wine_cv_float_abi+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -asm("vmrs r2,fpscr"); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - wine_cv_float_abi=yes -else case e in #( - e) wine_cv_float_abi=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_float_abi" >&5 -printf "%s\n" "$wine_cv_float_abi" >&6; } - test $wine_cv_float_abi != no || as_fn_error $? "The ARM target needs to support floating point instructions." "$LINENO" 5 - ;; -esac - -if test "x$enable_win64" = "xyes" -then - test -z "$with_wine64" || as_fn_error $? "--enable-win64 and --with-wine64 are mutually exclusive. ---enable-win64 should be used in the 64-bit build tree, --with-wine64 in the 32-bit Wow64 build tree." "$LINENO" 5 -fi - -case $build_os in - cygwin*|mingw32*) toolsext=".exe" - ;; - *) toolsext="" - ;; -esac - -HOST_ARCH=unknown -case "$host_cpu" in - aarch64*) HOST_ARCH=aarch64 ;; - arm*) HOST_ARCH=arm ;; - i[3456789]86*) HOST_ARCH=i386 ;; - x86_64) HOST_ARCH=x86_64 ;; -esac - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the directory containing the Wine tools" >&5 -printf %s "checking for the directory containing the Wine tools... " >&6; } -if test ${wine_cv_toolsdir+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) wine_cv_toolsdir="$with_wine_tools" - if test -z "$with_wine_tools"; then - if test "$cross_compiling" = "yes"; then - as_fn_error $? "you must use the --with-wine-tools option when cross-compiling." "$LINENO" 5 - elif test -n "$with_wine64"; then - wine_cv_toolsdir="$with_wine64" - fi - fi ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_toolsdir" >&5 -printf "%s\n" "$wine_cv_toolsdir" >&6; } -if test -z "$wine_cv_toolsdir"; then - wine_makedep=tools/makedep$toolsext -elif test -d "$wine_cv_toolsdir/tools/winebuild"; then - wine_makedep=$wine_cv_toolsdir/tools/makedep$toolsext - enable_tools=${enable_tools:-no} - test -f "$wine_makedep" || as_fn_error $? "the Wine tools have not yet been built in $wine_cv_toolsdir" "$LINENO" 5 -else - as_fn_error $? "could not find Wine tools in $wine_cv_toolsdir" "$LINENO" 5 -fi -toolsdir=$wine_cv_toolsdir - -RUNTESTFLAGS="-q -P wine" - -SED_CMD="LC_ALL=C sed -e 's,@bindir@,\${bindir},g' -e 's,@PACKAGE_STRING@,$PACKAGE_STRING,g' -e 's,@PACKAGE_VERSION@,$PACKAGE_VERSION,g'" - - -if test -n "$host_alias" -a "$host_alias" != "$build_alias" -then - TARGETFLAGS="-b $host_alias $TARGETFLAGS" -fi - -for ac_prog in flex -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_FLEX+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$FLEX"; then - ac_cv_prog_FLEX="$FLEX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_FLEX="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -FLEX=$ac_cv_prog_FLEX -if test -n "$FLEX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FLEX" >&5 -printf "%s\n" "$FLEX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$FLEX" && break -done -test -n "$FLEX" || FLEX="none" - -if test "$FLEX" = "none" -then - as_fn_error $? "no suitable flex found. Please install the 'flex' package." "$LINENO" 5 -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether flex is recent enough" >&5 -printf %s "checking whether flex is recent enough... " >&6; } -if test ${wine_cv_recent_flex+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat >conftest.l </dev/null 2>&5 - then - wine_cv_recent_flex=yes - else - wine_cv_recent_flex=no - fi ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_recent_flex" >&5 -printf "%s\n" "$wine_cv_recent_flex" >&6; } -test $wine_cv_recent_flex != no || as_fn_error $? "Your flex version is too old. Please install flex version 2.5.33 or newer." "$LINENO" 5 - -for ac_prog in bison -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_BISON+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$BISON"; then - ac_cv_prog_BISON="$BISON" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_BISON="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -BISON=$ac_cv_prog_BISON -if test -n "$BISON"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5 -printf "%s\n" "$BISON" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$BISON" && break -done -test -n "$BISON" || BISON="none" - -if test "$BISON" = "none" -then - as_fn_error $? "no suitable bison found. Please install the 'bison' package." "$LINENO" 5 -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether bison is recent enough" >&5 -printf %s "checking whether bison is recent enough... " >&6; } -if test ${wine_cv_recent_bison+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat >conftest.y </dev/null 2>&5 - then - wine_cv_recent_bison=yes - else - wine_cv_recent_bison=no - fi ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_recent_bison" >&5 -printf "%s\n" "$wine_cv_recent_bison" >&6; } -test $wine_cv_recent_bison != no || as_fn_error $? "Your bison version is too old. Please install bison version 3.0 or newer." "$LINENO" 5 - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_STRIP+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -printf "%s\n" "$STRIP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_STRIP+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -printf "%s\n" "$ac_ct_STRIP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP="strip" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -printf %s "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -printf "%s\n" "no, using $LN_S" >&6; } -fi - -if test ${ac_tool_prefix+y} -then : - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_PKG_CONFIG+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$PKG_CONFIG"; then - ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_PKG_CONFIG="${ac_tool_prefix}pkg-config" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -PKG_CONFIG=$ac_cv_prog_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -printf "%s\n" "$PKG_CONFIG" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if ${ac_cv_prog_PKG_CONFIG:+false} : -then : - if test "x$cross_compiling" = xyes -then : - -else case e in #( - e) { ac_cv_prog_PKG_CONFIG=; unset ac_cv_prog_PKG_CONFIG;} - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_PKG_CONFIG+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$PKG_CONFIG"; then - ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_PKG_CONFIG="pkg-config" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -PKG_CONFIG=$ac_cv_prog_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -printf "%s\n" "$PKG_CONFIG" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - ;; -esac -fi -else case e in #( - e) PKG_CONFIG=$ac_cv_prog_PKG_CONFIG ;; -esac -fi - -if test "x$enable_maintainer_mode" != "xyes" -then - FONTFORGE="" - RSVG="" - CONVERT="" - ICOTOOL="" -else - test "$srcdir" = . || as_fn_error $? "Maintainer mode cannot work out of tree." "$LINENO" 5 - for ac_prog in fontforge -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_FONTFORGE+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$FONTFORGE"; then - ac_cv_prog_FONTFORGE="$FONTFORGE" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_FONTFORGE="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -FONTFORGE=$ac_cv_prog_FONTFORGE -if test -n "$FONTFORGE"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FONTFORGE" >&5 -printf "%s\n" "$FONTFORGE" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$FONTFORGE" && break -done -test -n "$FONTFORGE" || FONTFORGE="false" - - for ac_prog in rsvg-convert rsvg -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_RSVG+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$RSVG"; then - ac_cv_prog_RSVG="$RSVG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_RSVG="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -RSVG=$ac_cv_prog_RSVG -if test -n "$RSVG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RSVG" >&5 -printf "%s\n" "$RSVG" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$RSVG" && break -done -test -n "$RSVG" || RSVG="false" - - for ac_prog in convert -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CONVERT+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$CONVERT"; then - ac_cv_prog_CONVERT="$CONVERT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CONVERT="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -CONVERT=$ac_cv_prog_CONVERT -if test -n "$CONVERT"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CONVERT" >&5 -printf "%s\n" "$CONVERT" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$CONVERT" && break -done -test -n "$CONVERT" || CONVERT="false" - - for ac_prog in icotool -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ICOTOOL+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$ICOTOOL"; then - ac_cv_prog_ICOTOOL="$ICOTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ICOTOOL="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -ICOTOOL=$ac_cv_prog_ICOTOOL -if test -n "$ICOTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ICOTOOL" >&5 -printf "%s\n" "$ICOTOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ICOTOOL" && break -done -test -n "$ICOTOOL" || ICOTOOL="false" - - test "$FONTFORGE" != "false" || as_fn_error $? "You need fontforge to rebuild fonts in maintainer mode." "$LINENO" 5 - test "$RSVG" != "false" || as_fn_error $? "You need rsvg to rebuild icons in maintainer mode." "$LINENO" 5 - - if test "$CONVERT" = false - then - as_fn_error $? "You need imagemagick to rebuild icons in maintainer mode." "$LINENO" 5 - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for recent enough imagemagick" >&5 -printf %s "checking for recent enough imagemagick... " >&6; } - convert_version=`convert --version | head -n1` - if test "x$convert_version" != "x" - then - convert_version_major=`expr "$convert_version" : '.* \([0-9]*\)\.[0-9]*'` - convert_version_minor=`expr "$convert_version" : '.* [0-9]*\.\([0-9]*\)'` - if test "$convert_version_major" -eq 6 -a "$convert_version_minor" -lt 6 - then - CONVERT=false - fi - fi - if test "$CONVERT" = false - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no ($convert_version_major.$convert_version_minor)" >&5 -printf "%s\n" "no ($convert_version_major.$convert_version_minor)" >&6; } - as_fn_error $? "You need imagemagick version 6.6 or newer to rebuild icons in maintainer mode." "$LINENO" 5 - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes ($convert_version_major.$convert_version_minor)" >&5 -printf "%s\n" "yes ($convert_version_major.$convert_version_minor)" >&6; } - fi - fi - - if test "$ICOTOOL" = false - then - as_fn_error $? "You need icotool to rebuild icons in maintainer mode." "$LINENO" 5 - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for recent enough icotool" >&5 -printf %s "checking for recent enough icotool... " >&6; } - icotool_version=`icotool --version | head -n1` - if test "x$icotool_version" != "x" - then - icotool_version_major=`expr "$icotool_version" : '.* \([0-9]*\)\.[0-9]*'` - icotool_version_minor=`expr "$icotool_version" : '.* [0-9]*\.\([0-9]*\)'` - if test "$icotool_version_major" -eq 0 -a "$icotool_version_minor" -lt 29 - then - ICOTOOL=false - as_fn_append wine_warnings "|icotool version 0.29.0 or newer is needed to rebuild icons." - fi - fi - if test "$ICOTOOL" = false - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no ($icotool_version_major.$icotool_version_minor)" >&5 -printf "%s\n" "no ($icotool_version_major.$icotool_version_minor)" >&6; } - as_fn_error $? "You need icotool version 0.29.0 or newer to rebuild icons in maintainer mode." "$LINENO" 5 - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes ($icotool_version_major.$icotool_version_minor)" >&5 -printf "%s\n" "yes ($icotool_version_major.$icotool_version_minor)" >&6; } - fi - fi - - with_gettext=yes - with_gettextpo=yes - - enable_werror=yes -fi - -if test "x$with_gettext" != xno -then - for ac_prog in msgfmt -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_MSGFMT+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$MSGFMT"; then - ac_cv_prog_MSGFMT="$MSGFMT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_MSGFMT="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -MSGFMT=$ac_cv_prog_MSGFMT -if test -n "$MSGFMT"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 -printf "%s\n" "$MSGFMT" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$MSGFMT" && break -done -test -n "$MSGFMT" || MSGFMT="false" - - if test "$MSGFMT" != "false" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether msgfmt supports contexts" >&5 -printf %s "checking whether msgfmt supports contexts... " >&6; } -if test ${wine_cv_msgfmt_contexts+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat >conftest.po <&5 - then - wine_cv_msgfmt_contexts=yes - else - wine_cv_msgfmt_contexts=no - fi ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_msgfmt_contexts" >&5 -printf "%s\n" "$wine_cv_msgfmt_contexts" >&6; } - test $wine_cv_msgfmt_contexts != no || MSGFMT=false - fi -else - MSGFMT=false -fi -if test "$MSGFMT" = false -then : - case "x$with_gettext" in - x) as_fn_append wine_warnings "|gettext tools not found (or too old), translations won't be built." ;; - xno) ;; - *) as_fn_error $? "gettext tools not found (or too old), translations won't be built. -This is an error since --with-gettext was requested." "$LINENO" 5 ;; -esac -enable_po=${enable_po:-no} -fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for i386_set_ldt in -li386" >&5 -printf %s "checking for i386_set_ldt in -li386... " >&6; } -if test ${ac_cv_lib_i386_i386_set_ldt+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-li386 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char i386_set_ldt (void); -int -main (void) -{ -return i386_set_ldt (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_i386_i386_set_ldt=yes -else case e in #( - e) ac_cv_lib_i386_i386_set_ldt=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_i386_i386_set_ldt" >&5 -printf "%s\n" "$ac_cv_lib_i386_i386_set_ldt" >&6; } -if test "x$ac_cv_lib_i386_i386_set_ldt" = xyes -then : - I386_LIBS="-li386" - -fi - - -OPENGL_LIBS="" - - - -# Check whether --enable-largefile was given. -if test ${enable_largefile+y} -then : - enableval=$enable_largefile; -fi -if test "$enable_largefile,$enable_year2038" != no,no -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable large file support" >&5 -printf %s "checking for $CC option to enable large file support... " >&6; } -if test ${ac_cv_sys_largefile_opts+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_save_CC="$CC" - ac_opt_found=no - for ac_opt in "none needed" "-D_FILE_OFFSET_BITS=64" "-D_LARGE_FILES=1" "-n32"; do - if test x"$ac_opt" != x"none needed" -then : - CC="$ac_save_CC $ac_opt" -fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#ifndef FTYPE -# define FTYPE off_t -#endif - /* Check that FTYPE can represent 2**63 - 1 correctly. - We can't simply define LARGE_FTYPE to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31)) - int FTYPE_is_large[(LARGE_FTYPE % 2147483629 == 721 - && LARGE_FTYPE % 2147483647 == 1) - ? 1 : -1]; -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - if test x"$ac_opt" = x"none needed" -then : - # GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t. - CC="$CC -DFTYPE=ino_t" - if ac_fn_c_try_compile "$LINENO" -then : - -else case e in #( - e) CC="$CC -D_FILE_OFFSET_BITS=64" - if ac_fn_c_try_compile "$LINENO" -then : - ac_opt='-D_FILE_OFFSET_BITS=64' -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam -fi - ac_cv_sys_largefile_opts=$ac_opt - ac_opt_found=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - test $ac_opt_found = no || break - done - CC="$ac_save_CC" - - test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected" ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_opts" >&5 -printf "%s\n" "$ac_cv_sys_largefile_opts" >&6; } - -ac_have_largefile=yes -case $ac_cv_sys_largefile_opts in #( - "none needed") : - ;; #( - "supported through gnulib") : - ;; #( - "support not detected") : - ac_have_largefile=no ;; #( - "-D_FILE_OFFSET_BITS=64") : - -printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h - ;; #( - "-D_LARGE_FILES=1") : - -printf "%s\n" "#define _LARGE_FILES 1" >>confdefs.h - ;; #( - "-n32") : - CC="$CC -n32" ;; #( - *) : - as_fn_error $? "internal error: bad value for \$ac_cv_sys_largefile_opts" "$LINENO" 5 ;; -esac - -if test "$enable_year2038" != no -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option for timestamps after 2038" >&5 -printf %s "checking for $CC option for timestamps after 2038... " >&6; } -if test ${ac_cv_sys_year2038_opts+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_save_CPPFLAGS="$CPPFLAGS" - ac_opt_found=no - for ac_opt in "none needed" "-D_TIME_BITS=64" "-D__MINGW_USE_VC2005_COMPAT" "-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT"; do - if test x"$ac_opt" != x"none needed" -then : - CPPFLAGS="$ac_save_CPPFLAGS $ac_opt" -fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - /* Check that time_t can represent 2**32 - 1 correctly. */ - #define LARGE_TIME_T \\ - ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30))) - int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535 - && LARGE_TIME_T % 65537 == 0) - ? 1 : -1]; - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_sys_year2038_opts="$ac_opt" - ac_opt_found=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - test $ac_opt_found = no || break - done - CPPFLAGS="$ac_save_CPPFLAGS" - test $ac_opt_found = yes || ac_cv_sys_year2038_opts="support not detected" ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_year2038_opts" >&5 -printf "%s\n" "$ac_cv_sys_year2038_opts" >&6; } - -ac_have_year2038=yes -case $ac_cv_sys_year2038_opts in #( - "none needed") : - ;; #( - "support not detected") : - ac_have_year2038=no ;; #( - "-D_TIME_BITS=64") : - -printf "%s\n" "#define _TIME_BITS 64" >>confdefs.h - ;; #( - "-D__MINGW_USE_VC2005_COMPAT") : - -printf "%s\n" "#define __MINGW_USE_VC2005_COMPAT 1" >>confdefs.h - ;; #( - "-U_USE_32_BIT_TIME_T"*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} -as_fn_error $? "the 'time_t' type is currently forced to be 32-bit. It -will stop working after mid-January 2038. Remove -_USE_32BIT_TIME_T from the compiler flags. -See 'config.log' for more details" "$LINENO" 5; } ;; #( - *) : - as_fn_error $? "internal error: bad value for \$ac_cv_sys_year2038_opts" "$LINENO" 5 ;; -esac - -fi - -fi -if false -then : - if test "$enable_year2038,$ac_have_year2038,$cross_compiling" = yes,no,no -then : - # If we're not cross compiling and 'touch' works with a large - # timestamp, then we can presume the system supports wider time_t - # *somehow* and we just weren't able to detect it. One common - # case that we deliberately *don't* probe for is a system that - # supports both 32- and 64-bit ABIs but only the 64-bit ABI offers - # wide time_t. (It would be inappropriate for us to override an - # intentional use of -m32.) Error out, demanding use of - # --disable-year2038 if this is intentional. - if TZ=UTC0 touch -t 210602070628.15 conftest.time 2>/dev/null -then : - case `TZ=UTC0 LC_ALL=C ls -l conftest.time 2>/dev/null` in #( - *'Feb 7 2106'* | *'Feb 7 17:10'*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} -as_fn_error $? "this system appears to support timestamps after -mid-January 2038, but no mechanism for enabling wide -'time_t' was detected. Did you mean to build a 64-bit -binary? (E.g., 'CC=\"${CC} -m64\"'.) To proceed with -32-bit time_t, configure with '--disable-year2038'. -See 'config.log' for more details" "$LINENO" 5; } ;; #( - *) : - ;; -esac -fi -fi -fi - -ac_header= ac_cache= -for ac_item in $ac_header_c_list -do - if test $ac_cache; then - ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" - if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then - printf "%s\n" "#define $ac_item 1" >> confdefs.h - fi - ac_header= ac_cache= - elif test $ac_header; then - ac_cache=$ac_item - else - ac_header=$ac_item - fi -done - - - - - - - - -if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes -then : - -printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "CL/cl.h" "ac_cv_header_CL_cl_h" "$ac_includes_default" -if test "x$ac_cv_header_CL_cl_h" = xyes -then : - printf "%s\n" "#define HAVE_CL_CL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "EGL/egl.h" "ac_cv_header_EGL_egl_h" "$ac_includes_default" -if test "x$ac_cv_header_EGL_egl_h" = xyes -then : - printf "%s\n" "#define HAVE_EGL_EGL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "OpenCL/opencl.h" "ac_cv_header_OpenCL_opencl_h" "$ac_includes_default" -if test "x$ac_cv_header_OpenCL_opencl_h" = xyes -then : - printf "%s\n" "#define HAVE_OPENCL_OPENCL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" -if test "x$ac_cv_header_arpa_inet_h" = xyes -then : - printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "arpa/nameser.h" "ac_cv_header_arpa_nameser_h" "$ac_includes_default" -if test "x$ac_cv_header_arpa_nameser_h" = xyes -then : - printf "%s\n" "#define HAVE_ARPA_NAMESER_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "asm/termbits.h" "ac_cv_header_asm_termbits_h" "$ac_includes_default" -if test "x$ac_cv_header_asm_termbits_h" = xyes -then : - printf "%s\n" "#define HAVE_ASM_TERMBITS_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "asm/types.h" "ac_cv_header_asm_types_h" "$ac_includes_default" -if test "x$ac_cv_header_asm_types_h" = xyes -then : - printf "%s\n" "#define HAVE_ASM_TYPES_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "asm/user.h" "ac_cv_header_asm_user_h" "$ac_includes_default" -if test "x$ac_cv_header_asm_user_h" = xyes -then : - printf "%s\n" "#define HAVE_ASM_USER_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "elf.h" "ac_cv_header_elf_h" "$ac_includes_default" -if test "x$ac_cv_header_elf_h" = xyes -then : - printf "%s\n" "#define HAVE_ELF_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "gettext-po.h" "ac_cv_header_gettext_po_h" "$ac_includes_default" -if test "x$ac_cv_header_gettext_po_h" = xyes -then : - printf "%s\n" "#define HAVE_GETTEXT_PO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "link.h" "ac_cv_header_link_h" "$ac_includes_default" -if test "x$ac_cv_header_link_h" = xyes -then : - printf "%s\n" "#define HAVE_LINK_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/cdrom.h" "ac_cv_header_linux_cdrom_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_cdrom_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_CDROM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/filter.h" "ac_cv_header_linux_filter_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_filter_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_FILTER_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/hdreg.h" "ac_cv_header_linux_hdreg_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_hdreg_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_HDREG_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/hidraw.h" "ac_cv_header_linux_hidraw_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_hidraw_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_HIDRAW_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/input.h" "ac_cv_header_linux_input_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_input_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_INPUT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/ioctl.h" "ac_cv_header_linux_ioctl_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_ioctl_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_IOCTL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/major.h" "ac_cv_header_linux_major_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_major_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_MAJOR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/param.h" "ac_cv_header_linux_param_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_param_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_PARAM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/serial.h" "ac_cv_header_linux_serial_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_serial_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_SERIAL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/types.h" "ac_cv_header_linux_types_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_types_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_TYPES_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/ucdrom.h" "ac_cv_header_linux_ucdrom_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_ucdrom_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_UCDROM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/wireless.h" "ac_cv_header_linux_wireless_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_wireless_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_WIRELESS_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "lwp.h" "ac_cv_header_lwp_h" "$ac_includes_default" -if test "x$ac_cv_header_lwp_h" = xyes -then : - printf "%s\n" "#define HAVE_LWP_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "mach-o/loader.h" "ac_cv_header_mach_o_loader_h" "$ac_includes_default" -if test "x$ac_cv_header_mach_o_loader_h" = xyes -then : - printf "%s\n" "#define HAVE_MACH_O_LOADER_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "mach/mach.h" "ac_cv_header_mach_mach_h" "$ac_includes_default" -if test "x$ac_cv_header_mach_mach_h" = xyes -then : - printf "%s\n" "#define HAVE_MACH_MACH_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "machine/cpu.h" "ac_cv_header_machine_cpu_h" "$ac_includes_default" -if test "x$ac_cv_header_machine_cpu_h" = xyes -then : - printf "%s\n" "#define HAVE_MACHINE_CPU_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "machine/sysarch.h" "ac_cv_header_machine_sysarch_h" "$ac_includes_default" -if test "x$ac_cv_header_machine_sysarch_h" = xyes -then : - printf "%s\n" "#define HAVE_MACHINE_SYSARCH_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "mntent.h" "ac_cv_header_mntent_h" "$ac_includes_default" -if test "x$ac_cv_header_mntent_h" = xyes -then : - printf "%s\n" "#define HAVE_MNTENT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" -if test "x$ac_cv_header_netdb_h" = xyes -then : - printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" -if test "x$ac_cv_header_netinet_in_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/in_systm.h" "ac_cv_header_netinet_in_systm_h" "$ac_includes_default" -if test "x$ac_cv_header_netinet_in_systm_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IN_SYSTM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" "$ac_includes_default" -if test "x$ac_cv_header_netinet_tcp_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_TCP_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/tcp_fsm.h" "ac_cv_header_netinet_tcp_fsm_h" "$ac_includes_default" -if test "x$ac_cv_header_netinet_tcp_fsm_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_TCP_FSM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "pcap/pcap.h" "ac_cv_header_pcap_pcap_h" "$ac_includes_default" -if test "x$ac_cv_header_pcap_pcap_h" = xyes -then : - printf "%s\n" "#define HAVE_PCAP_PCAP_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "port.h" "ac_cv_header_port_h" "$ac_includes_default" -if test "x$ac_cv_header_port_h" = xyes -then : - printf "%s\n" "#define HAVE_PORT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "pwd.h" "ac_cv_header_pwd_h" "$ac_includes_default" -if test "x$ac_cv_header_pwd_h" = xyes -then : - printf "%s\n" "#define HAVE_PWD_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default" -if test "x$ac_cv_header_sched_h" = xyes -then : - printf "%s\n" "#define HAVE_SCHED_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "scsi/scsi.h" "ac_cv_header_scsi_scsi_h" "$ac_includes_default" -if test "x$ac_cv_header_scsi_scsi_h" = xyes -then : - printf "%s\n" "#define HAVE_SCSI_SCSI_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "scsi/scsi_ioctl.h" "ac_cv_header_scsi_scsi_ioctl_h" "$ac_includes_default" -if test "x$ac_cv_header_scsi_scsi_ioctl_h" = xyes -then : - printf "%s\n" "#define HAVE_SCSI_SCSI_IOCTL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "scsi/sg.h" "ac_cv_header_scsi_sg_h" "$ac_includes_default" -if test "x$ac_cv_header_scsi_sg_h" = xyes -then : - printf "%s\n" "#define HAVE_SCSI_SG_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/attr.h" "ac_cv_header_sys_attr_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_attr_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_ATTR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/auxv.h" "ac_cv_header_sys_auxv_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_auxv_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_AUXV_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/cdio.h" "ac_cv_header_sys_cdio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_cdio_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_CDIO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_epoll_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_EPOLL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_event_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_EVENT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/extattr.h" "ac_cv_header_sys_extattr_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_extattr_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_EXTATTR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/filio.h" "ac_cv_header_sys_filio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_filio_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_FILIO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/ipc.h" "ac_cv_header_sys_ipc_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_ipc_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_IPC_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/link.h" "ac_cv_header_sys_link_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_link_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_LINK_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/modem.h" "ac_cv_header_sys_modem_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_modem_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_MODEM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/mtio.h" "ac_cv_header_sys_mtio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mtio_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_MTIO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_param_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/prctl.h" "ac_cv_header_sys_prctl_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_prctl_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_PRCTL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/ptrace.h" "ac_cv_header_sys_ptrace_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_ptrace_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_PTRACE_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/queue.h" "ac_cv_header_sys_queue_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_queue_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_QUEUE_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/random.h" "ac_cv_header_sys_random_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_random_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_RANDOM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_resource_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_RESOURCE_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/scsiio.h" "ac_cv_header_sys_scsiio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_scsiio_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SCSIIO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_shm_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SHM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/signal.h" "ac_cv_header_sys_signal_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_signal_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SIGNAL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/socketvar.h" "ac_cv_header_sys_socketvar_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_socketvar_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SOCKETVAR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/sockio.h" "ac_cv_header_sys_sockio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sockio_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SOCKIO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/statvfs.h" "ac_cv_header_sys_statvfs_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_statvfs_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_STATVFS_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/strtio.h" "ac_cv_header_sys_strtio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_strtio_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_STRTIO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/syscall.h" "ac_cv_header_sys_syscall_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_syscall_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SYSCALL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/sysinfo.h" "ac_cv_header_sys_sysinfo_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sysinfo_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SYSINFO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/times.h" "ac_cv_header_sys_times_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_times_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_TIMES_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/uio.h" "ac_cv_header_sys_uio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_uio_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_UIO_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/user.h" "ac_cv_header_sys_user_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_user_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_USER_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/utsname.h" "ac_cv_header_sys_utsname_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_utsname_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_UTSNAME_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/vnode.h" "ac_cv_header_sys_vnode_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_vnode_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_VNODE_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/xattr.h" "ac_cv_header_sys_xattr_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_xattr_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_XATTR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "syscall.h" "ac_cv_header_syscall_h" "$ac_includes_default" -if test "x$ac_cv_header_syscall_h" = xyes -then : - printf "%s\n" "#define HAVE_SYSCALL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "utime.h" "ac_cv_header_utime_h" "$ac_includes_default" -if test "x$ac_cv_header_utime_h" = xyes -then : - printf "%s\n" "#define HAVE_UTIME_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "valgrind/memcheck.h" "ac_cv_header_valgrind_memcheck_h" "$ac_includes_default" -if test "x$ac_cv_header_valgrind_memcheck_h" = xyes -then : - printf "%s\n" "#define HAVE_VALGRIND_MEMCHECK_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "valgrind/valgrind.h" "ac_cv_header_valgrind_valgrind_h" "$ac_includes_default" -if test "x$ac_cv_header_valgrind_valgrind_h" = xyes -then : - printf "%s\n" "#define HAVE_VALGRIND_VALGRIND_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mkdev_h" = xyes -then : - -printf "%s\n" "#define MAJOR_IN_MKDEV 1" >>confdefs.h - -fi - -if test $ac_cv_header_sys_mkdev_h = no; then - ac_fn_c_check_header_compile "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sysmacros_h" = xyes -then : - -printf "%s\n" "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h - -fi - -fi - - - -ac_fn_c_check_header_compile "$LINENO" "sys/conf.h" "ac_cv_header_sys_conf_h" "#include - #ifdef HAVE_SYS_PARAM_H - # include - #endif -" -if test "x$ac_cv_header_sys_conf_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_CONF_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/mount.h" "ac_cv_header_sys_mount_h" "#include - #ifdef HAVE_SYS_PARAM_H - # include - #endif -" -if test "x$ac_cv_header_sys_mount_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_MOUNT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/statfs.h" "ac_cv_header_sys_statfs_h" "#include - #ifdef HAVE_SYS_PARAM_H - # include - #endif -" -if test "x$ac_cv_header_sys_statfs_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_STATFS_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/user.h" "ac_cv_header_sys_user_h" "#include - #ifdef HAVE_SYS_PARAM_H - # include - #endif -" -if test "x$ac_cv_header_sys_user_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_USER_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/vfs.h" "ac_cv_header_sys_vfs_h" "#include - #ifdef HAVE_SYS_PARAM_H - # include - #endif -" -if test "x$ac_cv_header_sys_vfs_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_VFS_H 1" >>confdefs.h - -fi - - -saved_sysctl_h_CFLAGS=$CFLAGS -test "x${GCC}" != xyes || CFLAGS="$CFLAGS -Werror" -ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "#include - #ifdef HAVE_SYS_PARAM_H - # include - #endif -" -if test "x$ac_cv_header_sys_sysctl_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_SYSCTL_H 1" >>confdefs.h - -fi - -CFLAGS=$saved_sysctl_h_CFLAGS - -ac_fn_c_check_header_compile "$LINENO" "netinet/ip.h" "ac_cv_header_netinet_ip_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_ip_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IP_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_net_if_h" = xyes -then : - printf "%s\n" "#define HAVE_NET_IF_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "net/if_arp.h" "ac_cv_header_net_if_arp_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_net_if_arp_h" = xyes -then : - printf "%s\n" "#define HAVE_NET_IF_ARP_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "net/if_dl.h" "ac_cv_header_net_if_dl_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_net_if_dl_h" = xyes -then : - printf "%s\n" "#define HAVE_NET_IF_DL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "net/if_types.h" "ac_cv_header_net_if_types_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_net_if_types_h" = xyes -then : - printf "%s\n" "#define HAVE_NET_IF_TYPES_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "net/route.h" "ac_cv_header_net_route_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_net_route_h" = xyes -then : - printf "%s\n" "#define HAVE_NET_ROUTE_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/if_ether.h" "ac_cv_header_netinet_if_ether_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_if_ether_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IF_ETHER_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/in_pcb.h" "ac_cv_header_netinet_in_pcb_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_in_pcb_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IN_PCB_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/ip_icmp.h" "ac_cv_header_netinet_ip_icmp_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_ip_icmp_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IP_ICMP_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/ip_var.h" "ac_cv_header_netinet_ip_var_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_ip_var_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IP_VAR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/udp.h" "ac_cv_header_netinet_udp_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_udp_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_UDP_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet6/ip6_var.h" "ac_cv_header_netinet6_ip6_var_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_netinet6_ip6_var_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET6_IP6_VAR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netipx/ipx.h" "ac_cv_header_netipx_ipx_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_netipx_ipx_h" = xyes -then : - printf "%s\n" "#define HAVE_NETIPX_IPX_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "sys/un.h" "ac_cv_header_sys_un_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NET_ROUTE_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NET_IF_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif -" -if test "x$ac_cv_header_sys_un_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_UN_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "netinet/udp_var.h" "ac_cv_header_netinet_udp_var_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif - #ifdef HAVE_NETINET_IP_VAR_H - # include - #endif - #ifdef HAVE_NETINET_IP_ICMP_H - # include - #endif - #ifdef HAVE_NETINET_UDP_H - # include - #endif - #ifdef HAVE_NETINET_TCP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_udp_var_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_UDP_VAR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/icmp_var.h" "ac_cv_header_netinet_icmp_var_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif - #ifdef HAVE_NETINET_IP_VAR_H - # include - #endif - #ifdef HAVE_NETINET_IP_ICMP_H - # include - #endif - #ifdef HAVE_NETINET_UDP_H - # include - #endif - #ifdef HAVE_NETINET_TCP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_icmp_var_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_ICMP_VAR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/icmp6.h" "ac_cv_header_netinet_icmp6_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif - #ifdef HAVE_NETINET_IP_VAR_H - # include - #endif - #ifdef HAVE_NETINET_IP_ICMP_H - # include - #endif - #ifdef HAVE_NETINET_UDP_H - # include - #endif - #ifdef HAVE_NETINET_TCP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_icmp6_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_ICMP6_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/tcp_var.h" "ac_cv_header_netinet_tcp_var_h" "#include - #include - #ifdef HAVE_SYS_SOCKETVAR_H - # include - #endif - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_NETINET_IN_SYSTM_H - # include - #endif - #ifdef HAVE_NETINET_IP_H - # include - #endif - #ifdef HAVE_NETINET_IP_VAR_H - # include - #endif - #ifdef HAVE_NETINET_IP_ICMP_H - # include - #endif - #ifdef HAVE_NETINET_UDP_H - # include - #endif - #ifdef HAVE_NETINET_TCP_H - # include - #endif -" -if test "x$ac_cv_header_netinet_tcp_var_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_TCP_VAR_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "linux/ipx.h" "ac_cv_header_linux_ipx_h" "#include - #include - #ifdef HAVE_ASM_TYPES_H - # include - #endif - #ifdef HAVE_LINUX_TYPES_H - # include - #endif -" -if test "x$ac_cv_header_linux_ipx_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_IPX_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/irda.h" "ac_cv_header_linux_irda_h" "#include - #include - #ifdef HAVE_ASM_TYPES_H - # include - #endif - #ifdef HAVE_LINUX_TYPES_H - # include - #endif -" -if test "x$ac_cv_header_linux_irda_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_IRDA_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/rtnetlink.h" "ac_cv_header_linux_rtnetlink_h" "#include - #include - #ifdef HAVE_ASM_TYPES_H - # include - #endif - #ifdef HAVE_LINUX_TYPES_H - # include - #endif -" -if test "x$ac_cv_header_linux_rtnetlink_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_RTNETLINK_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "resolv.h" "ac_cv_header_resolv_h" "#include - #include - #ifdef HAVE_NETINET_IN_H - # include - #endif - #ifdef HAVE_ARPA_NAMESER_H - # include - #endif -" -if test "x$ac_cv_header_resolv_h" = xyes -then : - printf "%s\n" "#define HAVE_RESOLV_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "ifaddrs.h" "ac_cv_header_ifaddrs_h" "#include -" -if test "x$ac_cv_header_ifaddrs_h" = xyes -then : - printf "%s\n" "#define HAVE_IFADDRS_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "sys/ucontext.h" "ac_cv_header_sys_ucontext_h" "#include -" -if test "x$ac_cv_header_sys_ucontext_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_UCONTEXT_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "sys/thr.h" "ac_cv_header_sys_thr_h" "#include -#ifdef HAVE_SYS_UCONTEXT_H -#include -#endif -" -if test "x$ac_cv_header_sys_thr_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_THR_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "pthread_np.h" "ac_cv_header_pthread_np_h" "#include -" -if test "x$ac_cv_header_pthread_np_h" = xyes -then : - printf "%s\n" "#define HAVE_PTHREAD_NP_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "linux/videodev2.h" "ac_cv_header_linux_videodev2_h" "#include -#include -#ifdef HAVE_ASM_TYPES_H -#include -#endif -" -if test "x$ac_cv_header_linux_videodev2_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_VIDEODEV2_H 1" >>confdefs.h - -fi - - -ac_fn_c_check_header_compile "$LINENO" "libprocstat.h" "ac_cv_header_libprocstat_h" "#ifdef HAVE_SYS_PARAM_H -#include -#endif -#include -#ifdef HAVE_SYS_QUEUE_H -#include -#endif -" -if test "x$ac_cv_header_libprocstat_h" = xyes -then : - printf "%s\n" "#define HAVE_LIBPROCSTAT_H 1" >>confdefs.h - -fi - - -if test "x$ac_cv_header_sys_xattr_h" = xyes -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getxattr takes additional arguments" >&5 -printf %s "checking whether getxattr takes additional arguments... " >&6; } -if test ${wine_cv_xattr_extra_args+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -getxattr("", "", "", 0, 0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - wine_cv_xattr_extra_args=yes -else case e in #( - e) wine_cv_xattr_extra_args=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_xattr_extra_args" >&5 -printf "%s\n" "$wine_cv_xattr_extra_args" >&6; } - test $wine_cv_xattr_extra_args != yes || -printf "%s\n" "#define XATTR_ADDITIONAL_OPTIONS 1" >>confdefs.h - -fi - - -DLLFLAGS="" - -LDDLLFLAGS="" - -LDEXECFLAGS="" - -EXTRACFLAGS="" - -UNIXDLLFLAGS="-fPIC" - -UNIXLDFLAGS="-shared -Wl,-Bsymbolic -Wl,-soname,\$(UNIXLIB)" - -TOP_INSTALL_LIB="" - -TOP_INSTALL_DEV="" - -WINELOADER_LDFLAGS="" - -WINEPRELOADER_LDFLAGS="" - -DLLEXT=".so" - -LIBEXT="so" -# Extract the first word of "ldd", so it can be a program name with args. -set dummy ldd; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_LDD+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) case $LDD in - [\\/]* | ?:[\\/]*) - ac_cv_path_LDD="$LDD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="/sbin:/usr/sbin:$PATH" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_LDD="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_LDD" && ac_cv_path_LDD="true" - ;; -esac ;; -esac -fi -LDD=$ac_cv_path_LDD -if test -n "$LDD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LDD" >&5 -printf "%s\n" "$LDD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_OTOOL+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$OTOOL"; then - ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -OTOOL=$ac_cv_prog_OTOOL -if test -n "$OTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -printf "%s\n" "$OTOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL"; then - ac_ct_OTOOL=$OTOOL - # Extract the first word of "otool", so it can be a program name with args. -set dummy otool; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_OTOOL+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$ac_ct_OTOOL"; then - ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OTOOL="otool" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL -if test -n "$ac_ct_OTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -printf "%s\n" "$ac_ct_OTOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_OTOOL" = x; then - OTOOL="otool" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL=$ac_ct_OTOOL - fi -else - OTOOL="$ac_cv_prog_OTOOL" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args. -set dummy ${ac_tool_prefix}readelf; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_READELF+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$READELF"; then - ac_cv_prog_READELF="$READELF" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_READELF="${ac_tool_prefix}readelf" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -READELF=$ac_cv_prog_READELF -if test -n "$READELF"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5 -printf "%s\n" "$READELF" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_READELF"; then - ac_ct_READELF=$READELF - # Extract the first word of "readelf", so it can be a program name with args. -set dummy readelf; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_READELF+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$ac_ct_READELF"; then - ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_READELF="readelf" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -ac_ct_READELF=$ac_cv_prog_ac_ct_READELF -if test -n "$ac_ct_READELF"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5 -printf "%s\n" "$ac_ct_READELF" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_READELF" = x; then - READELF="true" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - READELF=$ac_ct_READELF - fi -else - READELF="$ac_cv_prog_READELF" -fi - -wine_rules="all:" -SUBDIRS="" - -DISABLED_SUBDIRS="" - -CONFIGURE_TARGETS="" - - -wine_fn_config_makefile () -{ - as_fn_append SUBDIRS " \\$as_nl $1" - eval enable=\$$2 - case "$enable" in - no) as_fn_append DISABLED_SUBDIRS " $1" ;; - yes) ;; - *aarch64*|*arm*|*i386*|*x86_64*) - if test -n "$PE_ARCHS" - then - for i in $PE_ARCHS - do - test $(expr ",$enable," : ".*,$i,") -gt 0 || as_fn_append ${i}_DISABLED_SUBDIRS " $1" - done - else - test $(expr ",$enable," : ".*,$HOST_ARCH,") -gt 0 || as_fn_append DISABLED_SUBDIRS " $1" - fi ;; - "") - case "$1, $PE_ARCHS " in - programs/*,*\ arm64ec\ *) as_fn_append arm64ec_DISABLED_SUBDIRS " $1" ;; - esac ;; - esac -} - -wine_fn_config_symlink () -{ - ac_links=$@ - as_fn_append wine_rules " -$ac_links: - @./config.status \$@" - for f in $ac_links; do as_fn_append CONFIGURE_TARGETS " $f"; done -} - -case $host_os in - cygwin*|mingw32*) - LIBEXT="dll" - DLLEXT="" - EXTRACFLAGS="-D__WINE_PE_BUILD" - enable_loader=${enable_loader:-no} - enable_server=${enable_server:-no} - with_x=${with_x:-no} - with_pthread=${with_pthread:-no} - ;; - - darwin*|macosx*) - LIBEXT="dylib" - DLLFLAGS="$DLLFLAGS -fPIC" - LDDLLFLAGS="-fPIC" - enable_winemac_drv=${enable_winemac_drv:-yes} - CARBON_LIBS="-framework Carbon" - - COREFOUNDATION_LIBS="-framework CoreFoundation" - - DISKARBITRATION_LIBS="-framework DiskArbitration -framework CoreFoundation" - - IOKIT_LIBS="-framework IOKit -framework CoreFoundation" - - METAL_LIBS="-framework Metal" - - APPLICATIONSERVICES_LIBS="-framework ApplicationServices" - - CORESERVICES_LIBS="-framework CoreServices" - - APPKIT_LIBS="-framework AppKit" - - SECURITY_LIBS="-framework Security -framework CoreFoundation" - - SYSTEMCONFIGURATION_LIBS="-framework SystemConfiguration" - - - WINELOADER_LDFLAGS="-Wl,-segalign,0x1000,-pagezero_size,0x1000,-sectcreate,__TEXT,__info_plist,loader/wine_info.plist" - - case $HOST_ARCH in - i386) wine_use_preloader=yes ;; - x86_64) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-no_huge" >&5 -printf %s "checking whether the compiler supports -Wl,-no_huge... " >&6; } -if test ${ac_cv_cflags__Wl__no_huge+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wl,-no_huge" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wl__no_huge=yes -else case e in #( - e) ac_cv_cflags__Wl__no_huge=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__no_huge" >&5 -printf "%s\n" "$ac_cv_cflags__Wl__no_huge" >&6; } -if test "x$ac_cv_cflags__Wl__no_huge" = xyes -then : - wine_use_preloader=no - WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -Wl,-no_pie,-image_base,0x200000000,-no_huge,-no_fixup_chains,-segalign,0x1000,-segaddr,WINE_RESERVE,0x1000,-segaddr,WINE_TOP_DOWN,0x7ff000000000" -else case e in #( - e) wine_use_preloader=yes ;; -esac -fi - ;; - *) wine_use_preloader=no ;; - esac - - if test "$wine_use_preloader" = "yes" - then - WINEPRELOADER_LDFLAGS="-nostartfiles -nodefaultlibs -e _start -ldylib1.o -mmacosx-version-min=10.7 -Wl,-no_new_main,-segalign,0x1000,-pagezero_size,0x1000,-sectcreate,__TEXT,__info_plist,loader/wine_info.plist" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-no_pie" >&5 -printf %s "checking whether the compiler supports -Wl,-no_pie... " >&6; } -if test ${ac_cv_cflags__Wl__no_pie+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wl,-no_pie" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wl__no_pie=yes -else case e in #( - e) ac_cv_cflags__Wl__no_pie=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__no_pie" >&5 -printf "%s\n" "$ac_cv_cflags__Wl__no_pie" >&6; } -if test "x$ac_cv_cflags__Wl__no_pie" = xyes -then : - WINEPRELOADER_LDFLAGS="-Wl,-no_pie $WINEPRELOADER_LDFLAGS" -fi - case $HOST_ARCH in - i386) - WINEPRELOADER_LDFLAGS="-Wl,-image_base,0x7d400000 $WINEPRELOADER_LDFLAGS" - ;; - x86_64) - WINEPRELOADER_LDFLAGS="-Wl,-image_base,0x200000000,-segalign,0x1000,-segaddr,WINE_RESERVE,0x1000 $WINEPRELOADER_LDFLAGS" - ;; - esac - WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -mmacosx-version-min=10.7" - fi - - if test "x$with_coreaudio" != "xno"; - then - COREAUDIO_LIBS="-framework CoreFoundation -framework CoreAudio -framework AudioUnit -framework AudioToolbox -framework CoreMIDI" - - enable_winecoreaudio_drv=${enable_winecoreaudio_drv:-yes} - fi - if test "$ac_cv_header_OpenCL_opencl_h" = "yes" - then - OPENCL_LIBS="-framework OpenCL" - - ac_cv_lib_OpenCL_clGetPlatformInfo=yes - fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether MTLDevice protocol supports registryID property" >&5 -printf %s "checking whether MTLDevice protocol supports registryID property... " >&6; } - ac_ext=m -ac_cpp='$OBJCPP $CPPFLAGS' -ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_objc_compiler_gnu - - ac_ext=m -ac_cpp='$OBJCPP $CPPFLAGS' -ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_objc_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in gcc objcc objc cc CC clang - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_OBJC+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$OBJC"; then - ac_cv_prog_OBJC="$OBJC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJC="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -OBJC=$ac_cv_prog_OBJC -if test -n "$OBJC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJC" >&5 -printf "%s\n" "$OBJC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$OBJC" && break - done -fi -if test -z "$OBJC"; then - ac_ct_OBJC=$OBJC - for ac_prog in gcc objcc objc cc CC clang -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_OBJC+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$ac_ct_OBJC"; then - ac_cv_prog_ac_ct_OBJC="$ac_ct_OBJC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -ac_ct_OBJC=$ac_cv_prog_ac_ct_OBJC -if test -n "$ac_ct_OBJC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJC" >&5 -printf "%s\n" "$ac_ct_OBJC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ac_ct_OBJC" && break -done - - if test "x$ac_ct_OBJC" = x; then - OBJC="gcc" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJC=$ac_ct_OBJC - fi -fi - -# Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Objective C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU Objective C" >&5 -printf %s "checking whether the compiler supports GNU Objective C... " >&6; } -if test ${ac_cv_objc_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_objc_try_compile "$LINENO" -then : - ac_compiler_gnu=yes -else case e in #( - e) ac_compiler_gnu=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -ac_cv_objc_compiler_gnu=$ac_compiler_gnu - ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objc_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_objc_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_objc_compiler_gnu - -if test $ac_compiler_gnu = yes; then - GOBJC=yes -else - GOBJC= -fi -ac_test_OBJCFLAGS=${OBJCFLAGS+y} -ac_save_OBJCFLAGS=$OBJCFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $OBJC accepts -g" >&5 -printf %s "checking whether $OBJC accepts -g... " >&6; } -if test ${ac_cv_prog_objc_g+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_save_objc_werror_flag=$ac_objc_werror_flag - ac_objc_werror_flag=yes - ac_cv_prog_objc_g=no - OBJCFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_objc_try_compile "$LINENO" -then : - ac_cv_prog_objc_g=yes -else case e in #( - e) OBJCFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_objc_try_compile "$LINENO" -then : - -else case e in #( - e) ac_objc_werror_flag=$ac_save_objc_werror_flag - OBJCFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_objc_try_compile "$LINENO" -then : - ac_cv_prog_objc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_objc_werror_flag=$ac_save_objc_werror_flag ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_objc_g" >&5 -printf "%s\n" "$ac_cv_prog_objc_g" >&6; } -if test $ac_test_OBJCFLAGS; then - OBJCFLAGS=$ac_save_OBJCFLAGS -elif test $ac_cv_prog_objc_g = yes; then - if test "$GOBJC" = yes; then - OBJCFLAGS="-g -O2" - else - OBJCFLAGS="-g" - fi -else - if test "$GOBJC" = yes; then - OBJCFLAGS="-O2" - else - OBJCFLAGS= - fi -fi -ac_ext=m -ac_cpp='$OBJCPP $CPPFLAGS' -ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_objc_compiler_gnu - - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -id device; device.registryID; - ; - return 0; -} -_ACEOF -if ac_fn_objc_try_compile "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - -printf "%s\n" "#define HAVE_MTLDEVICE_REGISTRYID 1" >>confdefs.h - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - UNIXLDFLAGS="-dynamiclib -install_name @rpath/\$(UNIXLIB) -Wl,-rpath,@loader_path\/" - WINELOADER_DEPENDS="wine_info.plist" - - ;; - - linux-android*) - -printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h - - DLLFLAGS="$DLLFLAGS -fPIC" - LDDLLFLAGS="-fPIC" - LDEXECFLAGS="-Wl,-pie" - enable_wineandroid_drv=${enable_wineandroid_drv:-yes} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-z,defs" >&5 -printf %s "checking whether the compiler supports -Wl,-z,defs... " >&6; } -if test ${ac_cv_cflags__Wl__z_defs+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wl,-z,defs" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wl__z_defs=yes -else case e in #( - e) ac_cv_cflags__Wl__z_defs=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__z_defs" >&5 -printf "%s\n" "$ac_cv_cflags__Wl__z_defs" >&6; } -if test "x$ac_cv_cflags__Wl__z_defs" = xyes -then : - UNIXLDFLAGS="$UNIXLDFLAGS -Wl,-z,defs" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fPIC -Wl,--export-dynamic" >&5 -printf %s "checking whether the compiler supports -fPIC -Wl,--export-dynamic... " >&6; } -if test ${ac_cv_cflags__fPIC__Wl___export_dynamic+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fPIC -Wl,--export-dynamic" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fPIC__Wl___export_dynamic=yes -else case e in #( - e) ac_cv_cflags__fPIC__Wl___export_dynamic=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fPIC__Wl___export_dynamic" >&5 -printf "%s\n" "$ac_cv_cflags__fPIC__Wl___export_dynamic" >&6; } -if test "x$ac_cv_cflags__fPIC__Wl___export_dynamic" = xyes -then : - WINELOADER_LDFLAGS="-Wl,--export-dynamic" -fi - WINEPRELOADER_LDFLAGS="-static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7d400000" - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lEGL" >&5 -printf %s "checking for -lEGL... " >&6; } -if test ${ac_cv_lib_soname_EGL+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lEGL $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char eglGetProcAddress (void); -int -main (void) -{ -return eglGetProcAddress (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_EGL=`$ac_cv_path_LDD conftest.exe | grep "EGL" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_EGL=`$OTOOL -L conftest$ac_exeext | grep "libEGL\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libEGL\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_EGL=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libEGL\\.$LIBEXT" | sed -e "s/^.*\\[\\(libEGL\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_EGL:+false} : -then : - ac_cv_lib_soname_EGL=`$LDD conftest$ac_exeext | grep "libEGL\\.$LIBEXT" | sed -e "s/^.*\(libEGL\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_EGL= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_EGL:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_EGL" >&5 -printf "%s\n" "$ac_cv_lib_soname_EGL" >&6; } - -printf "%s\n" "#define SONAME_LIBEGL \"$ac_cv_lib_soname_EGL\"" >>confdefs.h - - ;; -esac -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lGLESv2" >&5 -printf %s "checking for -lGLESv2... " >&6; } -if test ${ac_cv_lib_soname_GLESv2+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lGLESv2 $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char glFlush (void); -int -main (void) -{ -return glFlush (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_GLESv2=`$ac_cv_path_LDD conftest.exe | grep "GLESv2" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_GLESv2=`$OTOOL -L conftest$ac_exeext | grep "libGLESv2\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libGLESv2\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_GLESv2=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libGLESv2\\.$LIBEXT" | sed -e "s/^.*\\[\\(libGLESv2\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_GLESv2:+false} : -then : - ac_cv_lib_soname_GLESv2=`$LDD conftest$ac_exeext | grep "libGLESv2\\.$LIBEXT" | sed -e "s/^.*\(libGLESv2\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_GLESv2= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_GLESv2:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_GLESv2" >&5 -printf "%s\n" "$ac_cv_lib_soname_GLESv2" >&6; } - -printf "%s\n" "#define SONAME_LIBGLESV2 \"$ac_cv_lib_soname_GLESv2\"" >>confdefs.h - - ;; -esac -fi - - if test "x$exec_prefix" = xNONE - then - case $HOST_ARCH in - i386) exec_prefix='${prefix}/x86' ;; - x86_64) exec_prefix='${prefix}/x86_64' ;; - arm) exec_prefix='${prefix}/armeabi-v7a' ;; - aarch64) exec_prefix='${prefix}/arm64-v8a' ;; - esac - fi - ;; - - *) - -printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h - - if test $HOST_ARCH = i386 - then - DLLFLAGS="$DLLFLAGS -fno-PIC" - LDDLLFLAGS="-fno-PIC" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-PIC -Wl,-z,notext" >&5 -printf %s "checking whether the compiler supports -fno-PIC -Wl,-z,notext... " >&6; } -if test ${ac_cv_cflags__fno_PIC__Wl__z_notext+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fno-PIC -Wl,-z,notext" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fno_PIC__Wl__z_notext=yes -else case e in #( - e) ac_cv_cflags__fno_PIC__Wl__z_notext=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fno_PIC__Wl__z_notext" >&5 -printf "%s\n" "$ac_cv_cflags__fno_PIC__Wl__z_notext" >&6; } -if test "x$ac_cv_cflags__fno_PIC__Wl__z_notext" = xyes -then : - LDDLLFLAGS="$LDDLLFLAGS -Wl,-z,notext" -fi - else - DLLFLAGS="$DLLFLAGS -fPIC" - LDDLLFLAGS="-fPIC" - fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wl,-z,defs works correctly" >&5 -printf %s "checking whether -Wl,-z,defs works correctly... " >&6; } -if test ${ac_cv_wl_z_defs+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $UNIXDLLFLAGS $UNIXLDFLAGS -Wl,-z,defs" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -extern char **environ; char **envp; void myfunc(void) { envp = environ; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_wl_z_defs=yes -else case e in #( - e) ac_cv_wl_z_defs=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ac_save_CFLAGS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_wl_z_defs" >&5 -printf "%s\n" "$ac_cv_wl_z_defs" >&6; } - test $ac_cv_wl_z_defs != yes || as_fn_append UNIXLDFLAGS " -Wl,-z,defs" - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,--export-dynamic" >&5 -printf %s "checking whether the compiler supports -Wl,--export-dynamic... " >&6; } -if test ${ac_cv_cflags__Wl___export_dynamic+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wl,--export-dynamic" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wl___export_dynamic=yes -else case e in #( - e) ac_cv_cflags__Wl___export_dynamic=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl___export_dynamic" >&5 -printf "%s\n" "$ac_cv_cflags__Wl___export_dynamic" >&6; } -if test "x$ac_cv_cflags__Wl___export_dynamic" = xyes -then : - WINELOADER_LDFLAGS="-Wl,--export-dynamic" -fi - WINEPRELOADER_LDFLAGS="-nostartfiles -nodefaultlibs" - - case $host_os in - linux*) - as_fn_append WINELOADER_LDFLAGS " -pie" - case $HOST_ARCH in - i386|arm) - as_fn_append WINEPRELOADER_LDFLAGS " -static -Wl,-Ttext=0x7d400000" ;; - *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -static-pie" >&5 -printf %s "checking whether the compiler supports -static-pie... " >&6; } -if test ${ac_cv_cflags__static_pie+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -static-pie" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__static_pie=yes -else case e in #( - e) ac_cv_cflags__static_pie=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__static_pie" >&5 -printf "%s\n" "$ac_cv_cflags__static_pie" >&6; } -if test "x$ac_cv_cflags__static_pie" = xyes -then : - as_fn_append WINEPRELOADER_LDFLAGS " -static-pie" -else case e in #( - e) as_fn_append WINEPRELOADER_LDFLAGS " -static -Wl,-Ttext=0x7d7d00000000" ;; -esac -fi - ;; - esac - ;; - *) - case $HOST_ARCH in - i386|arm) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-Ttext-segment=0x60000000" >&5 -printf %s "checking whether the compiler supports -Wl,-Ttext-segment=0x60000000... " >&6; } -if test ${ac_cv_cflags__Wl__Ttext_segment_0x60000000+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wl,-Ttext-segment=0x60000000" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wl__Ttext_segment_0x60000000=yes -else case e in #( - e) ac_cv_cflags__Wl__Ttext_segment_0x60000000=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__Ttext_segment_0x60000000" >&5 -printf "%s\n" "$ac_cv_cflags__Wl__Ttext_segment_0x60000000" >&6; } -if test "x$ac_cv_cflags__Wl__Ttext_segment_0x60000000" = xyes -then : - as_fn_append WINELOADER_LDFLAGS " -Wl,-Ttext-segment=0x60000000" -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,--section-start,.interp=0x60000400" >&5 -printf %s "checking whether the compiler supports -Wl,--section-start,.interp=0x60000400... " >&6; } -if test ${ac_cv_cflags__Wl___section_start__interp_0x60000400+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wl,--section-start,.interp=0x60000400" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wl___section_start__interp_0x60000400=yes -else case e in #( - e) ac_cv_cflags__Wl___section_start__interp_0x60000400=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl___section_start__interp_0x60000400" >&5 -printf "%s\n" "$ac_cv_cflags__Wl___section_start__interp_0x60000400" >&6; } -if test "x$ac_cv_cflags__Wl___section_start__interp_0x60000400" = xyes -then : - as_fn_append WINELOADER_LDFLAGS " -Wl,--section-start,.interp=0x60000400" -fi ;; -esac -fi - ;; - *) - as_fn_append WINELOADER_LDFLAGS " -pie" - ;; - esac - ;; - esac - ;; -esac - -enable_winecoreaudio_drv=${enable_winecoreaudio_drv:-no} -enable_wineandroid_drv=${enable_wineandroid_drv:-no} -enable_winemac_drv=${enable_winemac_drv:-no} - -PE_ARCHS="" - -cross_archs= -if test ${enable_archs+y} -then : - test "x$with_system_dllpath" = "x" || as_fn_error $? "\"The --with-system-dllpath option is not compatible with --enable-archs\"" "$LINENO" 5 - ac_save_IFS=$IFS - IFS=' ,' - set x $enable_archs - IFS=$ac_save_IFS - shift - for arch - do - case $arch in - i386|x86_64|arm|aarch64|arm64ec) cross_archs="$cross_archs $arch" ;; - *) as_fn_error $? "Unknown cross-compilation architecture '$arch'" "$LINENO" 5 ;; - esac - done -else case e in #( - e) if test "x$with_mingw" != xno - then - test $HOST_ARCH = unknown || cross_archs=$HOST_ARCH - fi ;; -esac -fi - -saved_CC=$CC -saved_CFLAGS=$CFLAGS -saved_CPPFLAGS=$CPPFLAGS -saved_LDFLAGS=$LDFLAGS - -{ extra_arch=; unset extra_arch;} -for arch in $cross_archs -do - case $arch in - arm64ec) test ${extra_arch+y} || extra_arch=x86_64 ;; - x86_64) extra_arch="" ;; - esac -done - -for wine_arch in $cross_archs $extra_arch -do - case "x$with_mingw" in - xclang|x*/clang) eval "${wine_arch}_CC=\$with_mingw" ;; - esac - if eval \${${wine_arch}_CC:+false} : -then : - case $wine_arch in - aarch64) - for ac_prog in aarch64-w64-mingw32-clang aarch64-w64-mingw32-gcc clang -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_aarch64_CC+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$aarch64_CC"; then - ac_cv_prog_aarch64_CC="$aarch64_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_aarch64_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -aarch64_CC=$ac_cv_prog_aarch64_CC -if test -n "$aarch64_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $aarch64_CC" >&5 -printf "%s\n" "$aarch64_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$aarch64_CC" && break -done -test -n "$aarch64_CC" || aarch64_CC="false" - - ;; - arm64ec) - for ac_prog in arm64ec-w64-mingw32-clang arm64ec-w64-mingw32-gcc clang -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_arm64ec_CC+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$arm64ec_CC"; then - ac_cv_prog_arm64ec_CC="$arm64ec_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_arm64ec_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -arm64ec_CC=$ac_cv_prog_arm64ec_CC -if test -n "$arm64ec_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $arm64ec_CC" >&5 -printf "%s\n" "$arm64ec_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$arm64ec_CC" && break -done -test -n "$arm64ec_CC" || arm64ec_CC="false" - - ;; - arm) - for ac_prog in armv7-w64-mingw32-clang armv7-w64-mingw32-gcc clang -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_arm_CC+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$arm_CC"; then - ac_cv_prog_arm_CC="$arm_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_arm_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -arm_CC=$ac_cv_prog_arm_CC -if test -n "$arm_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $arm_CC" >&5 -printf "%s\n" "$arm_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$arm_CC" && break -done -test -n "$arm_CC" || arm_CC="false" - - ;; - i386) - ac_prefix_list="i686-w64-mingw32-gcc i586-w64-mingw32-gcc i486-w64-mingw32-gcc i386-w64-mingw32-gcc i686-w64-mingw32-clang i586-w64-mingw32-clang i486-w64-mingw32-clang i386-w64-mingw32-clang " - for ac_prog in $ac_prefix_list clang -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_i386_CC+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$i386_CC"; then - ac_cv_prog_i386_CC="$i386_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_i386_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -i386_CC=$ac_cv_prog_i386_CC -if test -n "$i386_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $i386_CC" >&5 -printf "%s\n" "$i386_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$i386_CC" && break -done -test -n "$i386_CC" || i386_CC="false" - - ;; - x86_64) - ac_prefix_list="x86_64-w64-mingw32-gcc amd64-w64-mingw32-gcc x86_64-w64-mingw32-clang amd64-w64-mingw32-clang " - for ac_prog in $ac_prefix_list clang -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_x86_64_CC+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$x86_64_CC"; then - ac_cv_prog_x86_64_CC="$x86_64_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_x86_64_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -x86_64_CC=$ac_cv_prog_x86_64_CC -if test -n "$x86_64_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $x86_64_CC" >&5 -printf "%s\n" "$x86_64_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$x86_64_CC" && break -done -test -n "$x86_64_CC" || x86_64_CC="false" - - ;; - esac -fi - - CPPFLAGS="" - if eval test \${${wine_arch}_CFLAGS+y} -then : - -else case e in #( - e) eval "${wine_arch}_CFLAGS=\${CROSSCFLAGS:-\"-g -O2\"}" ;; -esac -fi - if eval test \${${wine_arch}_LDFLAGS+y} -then : - -else case e in #( - e) eval "${wine_arch}_LDFLAGS=\$CROSSLDFLAGS" ;; -esac -fi - eval CC=\$${wine_arch}_CC - eval CFLAGS=\$${wine_arch}_CFLAGS - eval LDFLAGS=\$${wine_arch}_LDFLAGS - eval "${wine_arch}_EXTRACFLAGS=\"-D__WINE_PE_BUILD -Wall\"" - - target="" - set x $CC - shift - while test $# -ge 1 - do - case "$1" in - */*-gcc) target=`expr "$1" : '.*/\(.*\)-gcc'` ;; - */*-clang) target=`expr "$1" : '.*/\(.*\)-clang'` ;; - *-gcc) target=`expr "$1" : '\(.*\)-gcc'` ;; - *-clang) target=`expr "$1" : '\(.*\)-clang'` ;; - esac - shift - done - - llvm_target=$target - target_strip=${target:-llvm}-strip - if test -z "$llvm_target" - then - case $wine_arch in - i386) llvm_target=i686-windows ;; - arm) llvm_target=armv7-windows ;; - *) llvm_target=$wine_arch-windows ;; - esac - fi - llvm_extra_cflags="-target $llvm_target -fuse-ld=lld" - llvm_extra_ldflags="" - llvm_cflags="" - case $llvm_target in - *windows) llvm_cflags="-Wl,-subsystem:console -Wl,-WX" ;; - esac - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_$llvm_extra_cflags $llvm_cflags --no-default-config" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $llvm_extra_cflags $llvm_cflags --no-default-config" >&5 -printf %s "checking whether $CC supports $llvm_extra_cflags $llvm_cflags --no-default-config... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs $llvm_extra_cflags $llvm_cflags --no-default-config" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - llvm_extra_cflags="$llvm_extra_cflags --no-default-config" - llvm_extra_ldflags="--no-default-config" -else case e in #( - e) { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_$llvm_extra_cflags $llvm_cflags" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $llvm_extra_cflags $llvm_cflags" >&5 -printf %s "checking whether $CC supports $llvm_extra_cflags $llvm_cflags... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs $llvm_extra_cflags $llvm_cflags" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - : -else case e in #( - e) llvm_extra_cflags="" ;; -esac -fi } ;; -esac -fi } - if test -n "$llvm_extra_cflags" - then - target=$llvm_target - eval "${wine_arch}_DELAYLOADFLAG=\"-Wl,-delayload,\"" - as_fn_append ${wine_arch}_EXTRACFLAGS " $llvm_extra_cflags" - as_fn_append ${wine_arch}_LDFLAGS " $llvm_extra_ldflags" - CFLAGS="$CFLAGS $llvm_extra_cflags $llvm_cflags" - else - as_wine_cv_crosscc=`printf "%s\n" "wine_cv_${wine_arch}_crosscc" | sed "$as_sed_sh"` - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC works" >&5 -printf %s "checking whether $CC works... " >&6; } -if eval test \${$as_wine_cv_crosscc+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$as_wine_cv_crosscc=yes" -else case e in #( - e) eval "$as_wine_cv_crosscc=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -eval ac_res=\$$as_wine_cv_crosscc - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - if eval test \"x\$"$as_wine_cv_crosscc"\" = x"no" -then : - target= -fi - - fi - - if test -z "$target" - then - if test ${enable_archs+y} -then : - as_fn_error $? "$wine_arch PE cross-compiler not found. -This is an error since --enable-archs=$wine_arch was requested." "$LINENO" 5 -fi - continue - fi - - eval "${wine_arch}_TARGET=\$target" - eval "${wine_arch}_STRIP=\$target_strip" - as_wine_cv_crosscc_c99=`printf "%s\n" "ac_cv_${wine_arch}_crosscc_c99" | sed "$as_sed_sh"` - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 -printf %s "checking for $CC option to enable C99 features... " >&6; } - if eval test \${$as_wine_cv_crosscc_c99+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) eval "$as_wine_cv_crosscc_c99=no" - for arg in '' '-std=gnu99' '-D__STDC__' - do - test -z "$arg" || CC="$CC $arg" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c99_program -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$as_wine_cv_crosscc_c99=\$arg" -else case e in #( - e) eval "$as_wine_cv_crosscc_c99=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - eval CC=\$${wine_arch}_CC - if eval test \"x\$"$as_wine_cv_crosscc_c99"\" = x"no" -then : - -else case e in #( - e) break ;; -esac -fi - done ;; -esac -fi - - eval res=\$$as_wine_cv_crosscc_c99 - - case "x$res" in - x) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } ;; - xno) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } - if test ${enable_archs+y} -then : - as_fn_error $? "$wine_arch PE cross-compiler supporting C99 not found. -This is an error since --enable-archs=$wine_arch was requested." "$LINENO" 5 -fi - continue - ;; - x*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $res" >&5 -printf "%s\n" "$res" >&6; } - as_fn_append ${wine_arch}_CC " $res" ;; - esac - - if test "x$wine_arch" = xi386 -then : - -else case e in #( - e) as_wine_cv_seh_support=`printf "%s\n" "ac_cv_${wine_arch}_seh_support" | sed "$as_sed_sh"` - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports SEH directives" >&5 -printf %s "checking whether $CC supports SEH directives... " >&6; } -if eval test \${$as_wine_cv_seh_support+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -asm(".text\nac_test:\t.seh_proc ac_test\n\tnop\n\t.seh_stackalloc 16\n\t.seh_endprologue\n\t.seh_endproc"); -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$as_wine_cv_seh_support=yes" -else case e in #( - e) eval "$as_wine_cv_seh_support=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -eval ac_res=\$$as_wine_cv_seh_support - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval res=\$$as_wine_cv_seh_support - - if test "x$res" = xyes -then : - -else case e in #( - e) if test ${enable_archs+y} -then : - as_fn_error $? "The $wine_arch PE cross-compiler doesn't support SEH directives. -This is an error since --enable-archs=$wine_arch was requested." "$LINENO" 5 -fi - continue ;; -esac -fi ;; -esac -fi - - if test "x$wine_arch" = x$extra_arch -then : - -else case e in #( - e) as_fn_append PE_ARCHS " $wine_arch" ;; -esac -fi - - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-fno-strict-aliasing" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-strict-aliasing" >&5 -printf %s "checking whether $CC supports -fno-strict-aliasing... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -fno-strict-aliasing" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -fno-strict-aliasing" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Werror=unknown-warning-option" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Werror=unknown-warning-option" >&5 -printf %s "checking whether $CC supports -Werror=unknown-warning-option... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Werror=unknown-warning-option" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - CFLAGS="$CFLAGS -Werror=unknown-warning-option" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Werror=ignored-optimization-argument" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Werror=ignored-optimization-argument" >&5 -printf %s "checking whether $CC supports -Werror=ignored-optimization-argument... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Werror=ignored-optimization-argument" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - CFLAGS="$CFLAGS -Werror=ignored-optimization-argument" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wdeclaration-after-statement" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wdeclaration-after-statement" >&5 -printf %s "checking whether $CC supports -Wdeclaration-after-statement... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wdeclaration-after-statement" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wdeclaration-after-statement" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wempty-body" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wempty-body" >&5 -printf %s "checking whether $CC supports -Wempty-body... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wempty-body" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wempty-body" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wignored-qualifiers" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wignored-qualifiers" >&5 -printf %s "checking whether $CC supports -Wignored-qualifiers... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wignored-qualifiers" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wignored-qualifiers" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Winit-self" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Winit-self" >&5 -printf %s "checking whether $CC supports -Winit-self... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Winit-self" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Winit-self" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wpacked-not-aligned" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wpacked-not-aligned" >&5 -printf %s "checking whether $CC supports -Wpacked-not-aligned... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wpacked-not-aligned" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wno-packed-not-aligned" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wpragma-pack" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wpragma-pack" >&5 -printf %s "checking whether $CC supports -Wpragma-pack... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wpragma-pack" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wno-pragma-pack" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wmicrosoft-enum-forward-reference" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wmicrosoft-enum-forward-reference" >&5 -printf %s "checking whether $CC supports -Wmicrosoft-enum-forward-reference... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wmicrosoft-enum-forward-reference" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wno-microsoft-enum-forward-reference" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wshift-overflow=2" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wshift-overflow=2" >&5 -printf %s "checking whether $CC supports -Wshift-overflow=2... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wshift-overflow=2" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wshift-overflow=2" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wstrict-prototypes" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wstrict-prototypes" >&5 -printf %s "checking whether $CC supports -Wstrict-prototypes... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wstrict-prototypes" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wstrict-prototypes" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wtype-limits" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wtype-limits" >&5 -printf %s "checking whether $CC supports -Wtype-limits... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wtype-limits" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wtype-limits" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wunused-but-set-parameter" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wunused-but-set-parameter" >&5 -printf %s "checking whether $CC supports -Wunused-but-set-parameter... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wunused-but-set-parameter" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wunused-but-set-parameter" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wvla" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wvla" >&5 -printf %s "checking whether $CC supports -Wvla... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wvla" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wvla" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wwrite-strings" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wwrite-strings" >&5 -printf %s "checking whether $CC supports -Wwrite-strings... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wwrite-strings" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wwrite-strings" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wpointer-arith" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wpointer-arith" >&5 -printf %s "checking whether $CC supports -Wpointer-arith... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wpointer-arith" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wpointer-arith" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wlogical-op" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wlogical-op" >&5 -printf %s "checking whether $CC supports -Wlogical-op... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wlogical-op" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wlogical-op" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wabsolute-value" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wabsolute-value" >&5 -printf %s "checking whether $CC supports -Wabsolute-value... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wabsolute-value" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wabsolute-value" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wenum-enum-conversion" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wenum-enum-conversion" >&5 -printf %s "checking whether $CC supports -Wenum-enum-conversion... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wenum-enum-conversion" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - : -else case e in #( - e) { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wenum-conversion" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wenum-conversion" >&5 -printf %s "checking whether $CC supports -Wenum-conversion... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wenum-conversion" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used0x50 = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wenum-conversion" -fi } ;; -esac -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-ffunction-sections" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -ffunction-sections" >&5 -printf %s "checking whether $CC supports -ffunction-sections... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -ffunction-sections" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -ffunction-sections" -fi } - - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-fms-hotpatch -DMIN_CLANG_VERSION=18" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fms-hotpatch -DMIN_CLANG_VERSION=18" >&5 -printf %s "checking whether $CC supports -fms-hotpatch -DMIN_CLANG_VERSION=18... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -fms-hotpatch -DMIN_CLANG_VERSION=18" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -fms-hotpatch" - as_fn_append ${wine_arch}_LDFLAGS " -fms-hotpatch" -fi } - - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-flarge-source-files -Wmisleading-indentation" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -flarge-source-files -Wmisleading-indentation" >&5 -printf %s "checking whether $CC supports -flarge-source-files -Wmisleading-indentation... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -flarge-source-files -Wmisleading-indentation" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wno-misleading-indentation" -fi } - - case $wine_arch in - i386) { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-fno-omit-frame-pointer" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-omit-frame-pointer" >&5 -printf %s "checking whether $CC supports -fno-omit-frame-pointer... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -fno-omit-frame-pointer" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -fno-omit-frame-pointer" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-mpreferred-stack-boundary=2" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -mpreferred-stack-boundary=2" >&5 -printf %s "checking whether $CC supports -mpreferred-stack-boundary=2... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -mpreferred-stack-boundary=2" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -mpreferred-stack-boundary=2" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wl,--disable-stdcall-fixup" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,--disable-stdcall-fixup" >&5 -printf %s "checking whether $CC supports -Wl,--disable-stdcall-fixup... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wl,--disable-stdcall-fixup" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_LDFLAGS " -Wl,--disable-stdcall-fixup" -fi } ;; - x86_64) { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wformat-overflow" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wformat-overflow" >&5 -printf %s "checking whether $CC supports -Wformat-overflow... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wformat-overflow" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wformat-overflow" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wnonnull" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wnonnull" >&5 -printf %s "checking whether $CC supports -Wnonnull... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wnonnull" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wnonnull" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-mcx16" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -mcx16" >&5 -printf %s "checking whether $CC supports -mcx16... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -mcx16" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -mcx16" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-mcmodel=small" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -mcmodel=small" >&5 -printf %s "checking whether $CC supports -mcmodel=small... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -mcmodel=small" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -mcmodel=small" -fi } ;; - esac - - wine_crossdebug=$CROSSDEBUG - if test -z "$wine_crossdebug" - then - for ac_flag in $CFLAGS; do - case $ac_flag in - -gdwarf*) wine_crossdebug=dwarf ;; - -gcodeview) wine_crossdebug=pdb ;; - -g) wine_crossdebug=${wine_crossdebug:-dwarf} ;; - esac - done - fi - - ac_debug_format_seen="" - for ac_flag in $CFLAGS; do - case $ac_flag in - -gdwarf*|-gcodeview) ac_debug_format_seen=$ac_flag ;; - esac - done - if test "x$ac_debug_format_seen" = x - then - case $wine_crossdebug in - *dwarf) { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wl,-debug:dwarf" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,-debug:dwarf" >&5 -printf %s "checking whether $CC supports -Wl,-debug:dwarf... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wl,-debug:dwarf" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_LDFLAGS " -Wl,-debug:dwarf" - CFLAGS="$CFLAGS -Wl,-debug:dwarf" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-gdwarf-4" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -gdwarf-4" >&5 -printf %s "checking whether $CC supports -gdwarf-4... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -gdwarf-4" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -gdwarf-4" -fi } ;; - pdb) { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-gcodeview" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -gcodeview" >&5 -printf %s "checking whether $CC supports -gcodeview... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -gcodeview" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -gcodeview" -fi } ;; - esac - fi - eval "${wine_arch}_DEBUG=\$wine_crossdebug" - - test "x$enable_werror" != xyes || { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Werror" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Werror" >&5 -printf %s "checking whether $CC supports -Werror... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Werror" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Werror" -fi } - test "x$enable_build_id" != xyes || as_fn_append ${wine_arch}_LDFLAGS " -Wl,--build-id" - -done - -CC=$saved_CC -CFLAGS=$saved_CFLAGS -CPPFLAGS=$saved_CPPFLAGS -LDFLAGS=$saved_LDFLAGS - -case $HOST_ARCH in - arm|aarch64) - test "x$PE_ARCHS" != x || as_fn_error $? "PE cross-compilation is required for $HOST_ARCH, please install clang/llvm-dlltool/lld, or llvm-mingw." "$LINENO" 5 - DLLEXT="" ;; - *) - if test "x$PE_ARCHS" = "x" -then : - case "x$with_mingw" in - x) as_fn_append wine_notices "|Suitable PE cross-compiler not found, PE files won't be built." ;; - xno) ;; - *) as_fn_error $? "Suitable PE cross-compiler not found, PE files won't be built. -This is an error since --with-mingw was requested." "$LINENO" 5 ;; -esac - -fi ;; -esac - - -if test "x$with_system_dllpath" != "x" -a -n "$PE_ARCHS" -then - if test "x$HOST_ARCH" = xi386 -then : - ac_prefix_list="i686-w64-mingw32-pkg-config i586-w64-mingw32-pkg-config i486-w64-mingw32-pkg-config i386-w64-mingw32-pkg-config " -else case e in #( - e) ac_prefix_list="$host_cpu-w64-mingw32-pkg-config" ;; -esac -fi -for ac_prog in $ac_prefix_list -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_MINGW_PKG_CONFIG+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) if test -n "$MINGW_PKG_CONFIG"; then - ac_cv_prog_MINGW_PKG_CONFIG="$MINGW_PKG_CONFIG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_MINGW_PKG_CONFIG="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi ;; -esac -fi -MINGW_PKG_CONFIG=$ac_cv_prog_MINGW_PKG_CONFIG -if test -n "$MINGW_PKG_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MINGW_PKG_CONFIG" >&5 -printf "%s\n" "$MINGW_PKG_CONFIG" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$MINGW_PKG_CONFIG" && break -done -test -n "$MINGW_PKG_CONFIG" || MINGW_PKG_CONFIG="false" - -if ${FAUDIO_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - FAUDIO_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags FAudio 2>/dev/null` -fi -fi -if ${FAUDIO_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - FAUDIO_PE_LIBS=`$MINGW_PKG_CONFIG --libs FAudio 2>/dev/null` -fi -fi -FAUDIO_PE_LIBS=${FAUDIO_PE_LIBS:-"-lFAudio"} -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $FAUDIO_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW FAudio.h" >&5 -printf %s "checking for MinGW FAudio.h... " >&6; } -if test ${ac_cv_mingw_header_FAudio_h+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_FAudio_h=yes -else case e in #( - e) ac_cv_mingw_header_FAudio_h=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_FAudio_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_FAudio_h" >&6; } -if test "x$ac_cv_mingw_header_FAudio_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for FAudio_CommitOperationSet in MinGW -lFAudio" >&5 -printf %s "checking for FAudio_CommitOperationSet in MinGW -lFAudio... " >&6; } -if test ${ac_cv_mingw_lib_FAudio+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-lFAudio $FAUDIO_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char FAudio_CommitOperationSet (void); -int -main (void) -{ -return FAudio_CommitOperationSet (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_FAudio=yes -else case e in #( - e) ac_cv_mingw_lib_FAudio=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_FAudio" >&5 -printf "%s\n" "$ac_cv_mingw_lib_FAudio" >&6; } -if test "x$ac_cv_mingw_lib_FAudio" = xyes -then : - : -else case e in #( - e) FAUDIO_PE_CFLAGS=""; FAUDIO_PE_LIBS="" ;; -esac -fi -else case e in #( - e) FAUDIO_PE_CFLAGS=""; FAUDIO_PE_LIBS="" ;; -esac -fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$FAUDIO_PE_LIBS" = "x" - then - as_fn_append wine_notices "|FAudio ${notice_platform}MinGW development files not found (or too old); using bundled version." - fi - - if ${FLUIDSYNTH_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - FLUIDSYNTH_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags fluidsynth 2>/dev/null` -fi -fi -if ${FLUIDSYNTH_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - FLUIDSYNTH_PE_LIBS=`$MINGW_PKG_CONFIG --libs fluidsynth 2>/dev/null` -fi -fi -FLUIDSYNTH_PE_LIBS=${FLUIDSYNTH_PE_LIBS:-"-lfluidsynth"} -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $FLUIDSYNTH_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW fluidsynth.h" >&5 -printf %s "checking for MinGW fluidsynth.h... " >&6; } -if test ${ac_cv_mingw_header_fluidsynth_h+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_fluidsynth_h=yes -else case e in #( - e) ac_cv_mingw_header_fluidsynth_h=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_fluidsynth_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_fluidsynth_h" >&6; } -if test "x$ac_cv_mingw_header_fluidsynth_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for new_fluid_synth in MinGW -lfluidsynth" >&5 -printf %s "checking for new_fluid_synth in MinGW -lfluidsynth... " >&6; } -if test ${ac_cv_mingw_lib_fluidsynth+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-lfluidsynth $FLUIDSYNTH_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char new_fluid_synth (void); -int -main (void) -{ -return new_fluid_synth (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_fluidsynth=yes -else case e in #( - e) ac_cv_mingw_lib_fluidsynth=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_fluidsynth" >&5 -printf "%s\n" "$ac_cv_mingw_lib_fluidsynth" >&6; } -if test "x$ac_cv_mingw_lib_fluidsynth" = xyes -then : - : -else case e in #( - e) FLUIDSYNTH_PE_CFLAGS=""; FLUIDSYNTH_PE_LIBS="" ;; -esac -fi -else case e in #( - e) FLUIDSYNTH_PE_CFLAGS=""; FLUIDSYNTH_PE_LIBS="" ;; -esac -fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$FLUIDSYNTH_PE_LIBS" = "x" - then - as_fn_append wine_notices "|Fluidsynth ${notice_platform}MinGW development files not found (or too old); using bundled version." - fi - - if ${JPEG_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - JPEG_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags libjpeg 2>/dev/null` -fi -fi -if ${JPEG_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - JPEG_PE_LIBS=`$MINGW_PKG_CONFIG --libs libjpeg 2>/dev/null` -fi -fi - -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $JPEG_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW jpeglib.h" >&5 -printf %s "checking for MinGW jpeglib.h... " >&6; } -if test ${ac_cv_mingw_header_jpeglib_h+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_jpeglib_h=yes -else case e in #( - e) ac_cv_mingw_header_jpeglib_h=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_jpeglib_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_jpeglib_h" >&6; } -if test "x$ac_cv_mingw_header_jpeglib_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for jpeg_start_decompress in MinGW -ljpeg" >&5 -printf %s "checking for jpeg_start_decompress in MinGW -ljpeg... " >&6; } -if test ${ac_cv_mingw_lib_jpeg+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-ljpeg $JPEG_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char jpeg_start_decompress (void); -int -main (void) -{ -return jpeg_start_decompress (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_jpeg=yes -else case e in #( - e) ac_cv_mingw_lib_jpeg=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_jpeg" >&5 -printf "%s\n" "$ac_cv_mingw_lib_jpeg" >&6; } -if test "x$ac_cv_mingw_lib_jpeg" = xyes -then : - : -else case e in #( - e) JPEG_PE_CFLAGS=""; JPEG_PE_LIBS="" ;; -esac -fi -else case e in #( - e) JPEG_PE_CFLAGS=""; JPEG_PE_LIBS="" ;; -esac -fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$JPEG_PE_LIBS" = "x" - then - as_fn_append wine_notices "|libjpeg ${notice_platform}MinGW development files not found; using bundled version." - fi - - if ${LCMS2_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - LCMS2_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags lcms2 2>/dev/null` -fi -fi -if ${LCMS2_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - LCMS2_PE_LIBS=`$MINGW_PKG_CONFIG --libs lcms2 2>/dev/null` -fi -fi -LCMS2_PE_LIBS=${LCMS2_PE_LIBS:-"-llcms2"} -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $LCMS2_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW lcms2.h" >&5 -printf %s "checking for MinGW lcms2.h... " >&6; } -if test ${ac_cv_mingw_header_lcms2_h+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_lcms2_h=yes -else case e in #( - e) ac_cv_mingw_header_lcms2_h=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_lcms2_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_lcms2_h" >&6; } -if test "x$ac_cv_mingw_header_lcms2_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cmsOpenProfileFromFile in MinGW -llcms2" >&5 -printf %s "checking for cmsOpenProfileFromFile in MinGW -llcms2... " >&6; } -if test ${ac_cv_mingw_lib_lcms2+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-llcms2 $LCMS2_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char cmsOpenProfileFromFile (void); -int -main (void) -{ -return cmsOpenProfileFromFile (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_lcms2=yes -else case e in #( - e) ac_cv_mingw_lib_lcms2=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_lcms2" >&5 -printf "%s\n" "$ac_cv_mingw_lib_lcms2" >&6; } -if test "x$ac_cv_mingw_lib_lcms2" = xyes -then : - : -else case e in #( - e) LCMS2_PE_CFLAGS=""; LCMS2_PE_LIBS="" ;; -esac -fi -else case e in #( - e) LCMS2_PE_CFLAGS=""; LCMS2_PE_LIBS="" ;; -esac -fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$LCMS2_PE_LIBS" = "x" - then - as_fn_append wine_notices "|liblcms2 ${notice_platform}MinGW development files not found; using bundled version." - fi - - if ${MPG123_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - MPG123_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags libmpg123 2>/dev/null` -fi -fi -if ${MPG123_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - MPG123_PE_LIBS=`$MINGW_PKG_CONFIG --libs libmpg123 2>/dev/null` -fi -fi -MPG123_PE_LIBS=${MPG123_PE_LIBS:-"-lmpg123"} -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $MPG123_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW mpg123.h" >&5 -printf %s "checking for MinGW mpg123.h... " >&6; } -if test ${ac_cv_mingw_header_mpg123_h+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_mpg123_h=yes -else case e in #( - e) ac_cv_mingw_header_mpg123_h=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_mpg123_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_mpg123_h" >&6; } -if test "x$ac_cv_mingw_header_mpg123_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mpg123_feed in MinGW -lmpg123" >&5 -printf %s "checking for mpg123_feed in MinGW -lmpg123... " >&6; } -if test ${ac_cv_mingw_lib_mpg123+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-lmpg123 $MPG123_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char mpg123_feed (void); -int -main (void) -{ -return mpg123_feed (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_mpg123=yes -else case e in #( - e) ac_cv_mingw_lib_mpg123=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_mpg123" >&5 -printf "%s\n" "$ac_cv_mingw_lib_mpg123" >&6; } -if test "x$ac_cv_mingw_lib_mpg123" = xyes -then : - : -else case e in #( - e) MPG123_PE_CFLAGS=""; MPG123_PE_LIBS="" ;; -esac -fi -else case e in #( - e) MPG123_PE_CFLAGS=""; MPG123_PE_LIBS="" ;; -esac -fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$MPG123_PE_LIBS" = "x" - then - as_fn_append wine_notices "|libmpg123 ${notice_platform}MinGW development files not found (or too old); using bundled version." - fi - - if ${PNG_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - PNG_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags libpng 2>/dev/null` -fi -fi -if ${PNG_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - PNG_PE_LIBS=`$MINGW_PKG_CONFIG --libs libpng 2>/dev/null` -fi -fi - -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $PNG_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW png.h" >&5 -printf %s "checking for MinGW png.h... " >&6; } -if test ${ac_cv_mingw_header_png_h+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_png_h=yes -else case e in #( - e) ac_cv_mingw_header_png_h=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_png_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_png_h" >&6; } -if test "x$ac_cv_mingw_header_png_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for png_create_read_struct in MinGW -lpng" >&5 -printf %s "checking for png_create_read_struct in MinGW -lpng... " >&6; } -if test ${ac_cv_mingw_lib_png+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-lpng $PNG_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char png_create_read_struct (void); -int -main (void) -{ -return png_create_read_struct (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_png=yes -else case e in #( - e) ac_cv_mingw_lib_png=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_png" >&5 -printf "%s\n" "$ac_cv_mingw_lib_png" >&6; } -if test "x$ac_cv_mingw_lib_png" = xyes -then : - : -else case e in #( - e) PNG_PE_CFLAGS=""; PNG_PE_LIBS="" ;; -esac -fi -else case e in #( - e) PNG_PE_CFLAGS=""; PNG_PE_LIBS="" ;; -esac -fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$PNG_PE_LIBS" = "x" - then - as_fn_append wine_notices "|libpng ${notice_platform}MinGW development files not found; using bundled version." - fi - - if ${TIFF_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - TIFF_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags libtiff-4 2>/dev/null` -fi -fi -if ${TIFF_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - TIFF_PE_LIBS=`$MINGW_PKG_CONFIG --libs libtiff-4 2>/dev/null` -fi -fi - -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $TIFF_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW tiffio.h" >&5 -printf %s "checking for MinGW tiffio.h... " >&6; } -if test ${ac_cv_mingw_header_tiffio_h+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_tiffio_h=yes -else case e in #( - e) ac_cv_mingw_header_tiffio_h=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_tiffio_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_tiffio_h" >&6; } -if test "x$ac_cv_mingw_header_tiffio_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TIFFClientOpen in MinGW -ltiff" >&5 -printf %s "checking for TIFFClientOpen in MinGW -ltiff... " >&6; } -if test ${ac_cv_mingw_lib_tiff+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-ltiff $TIFF_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char TIFFClientOpen (void); -int -main (void) -{ -return TIFFClientOpen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_tiff=yes -else case e in #( - e) ac_cv_mingw_lib_tiff=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_tiff" >&5 -printf "%s\n" "$ac_cv_mingw_lib_tiff" >&6; } -if test "x$ac_cv_mingw_lib_tiff" = xyes -then : - : -else case e in #( - e) TIFF_PE_CFLAGS=""; TIFF_PE_LIBS="" ;; -esac -fi -else case e in #( - e) TIFF_PE_CFLAGS=""; TIFF_PE_LIBS="" ;; -esac -fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$TIFF_PE_LIBS" = "x" - then - as_fn_append wine_notices "|libtiff ${notice_platform}MinGW development files not found; using bundled version." - fi - - if ${XML2_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - XML2_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags libxml-2.0 2>/dev/null` -fi -fi -if ${XML2_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - XML2_PE_LIBS=`$MINGW_PKG_CONFIG --libs libxml-2.0 2>/dev/null` -fi -fi -XML2_PE_LIBS=${XML2_PE_LIBS:-"-lxml2"} -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $XML2_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW libxml/parser.h" >&5 -printf %s "checking for MinGW libxml/parser.h... " >&6; } -if test ${ac_cv_mingw_header_libxml_parser_h+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_libxml_parser_h=yes -else case e in #( - e) ac_cv_mingw_header_libxml_parser_h=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_libxml_parser_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_libxml_parser_h" >&6; } -if test "x$ac_cv_mingw_header_libxml_parser_h" = xyes -then : - -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW libxml/xmlsave.h" >&5 -printf %s "checking for MinGW libxml/xmlsave.h... " >&6; } -if test ${ac_cv_mingw_header_libxml_xmlsave_h+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_libxml_xmlsave_h=yes -else case e in #( - e) ac_cv_mingw_header_libxml_xmlsave_h=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_libxml_xmlsave_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_libxml_xmlsave_h" >&6; } -if test "x$ac_cv_mingw_header_libxml_xmlsave_h" = xyes -then : - -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW libxml/SAX2.h" >&5 -printf %s "checking for MinGW libxml/SAX2.h... " >&6; } -if test ${ac_cv_mingw_header_libxml_SAX2_h+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_libxml_SAX2_h=yes -else case e in #( - e) ac_cv_mingw_header_libxml_SAX2_h=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_libxml_SAX2_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_libxml_SAX2_h" >&6; } -if test "x$ac_cv_mingw_header_libxml_SAX2_h" = xyes -then : - -fi - if test "$ac_cv_mingw_header_libxml_parser_h" = "yes" -a "$ac_cv_mingw_header_libxml_xmlsave_h" = "yes" -a "$ac_cv_mingw_header_libxml_SAX2_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for xmlFirstElementChild in MinGW -lxml2" >&5 -printf %s "checking for xmlFirstElementChild in MinGW -lxml2... " >&6; } -if test ${ac_cv_mingw_lib_xml2+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-lxml2 $XML2_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char xmlFirstElementChild (void); -int -main (void) -{ -return xmlFirstElementChild (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_xml2=yes -else case e in #( - e) ac_cv_mingw_lib_xml2=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_xml2" >&5 -printf "%s\n" "$ac_cv_mingw_lib_xml2" >&6; } -if test "x$ac_cv_mingw_lib_xml2" = xyes -then : - : -else case e in #( - e) XML2_PE_CFLAGS=""; XML2_PE_LIBS="" ;; -esac -fi - else - XML2_PE_CFLAGS="" - XML2_PE_LIBS="" - fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$XML2_PE_LIBS" = "x" - then - as_fn_append wine_notices "|libxml2 ${notice_platform}MinGW development files not found (or too old); using bundled version." - fi - - if ${XSLT_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - XSLT_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags libxslt 2>/dev/null` -fi -fi -if ${XSLT_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - XSLT_PE_LIBS=`$MINGW_PKG_CONFIG --libs libxslt 2>/dev/null` -fi -fi -XSLT_PE_LIBS=${XSLT_PE_LIBS:-"-lxslt"} -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $XSLT_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW libxslt/pattern.h" >&5 -printf %s "checking for MinGW libxslt/pattern.h... " >&6; } -if test ${ac_cv_mingw_header_libxslt_pattern_h+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_libxslt_pattern_h=yes -else case e in #( - e) ac_cv_mingw_header_libxslt_pattern_h=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_libxslt_pattern_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_libxslt_pattern_h" >&6; } -if test "x$ac_cv_mingw_header_libxslt_pattern_h" = xyes -then : - -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW libxslt/transform.h" >&5 -printf %s "checking for MinGW libxslt/transform.h... " >&6; } -if test ${ac_cv_mingw_header_libxslt_transform_h+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_libxslt_transform_h=yes -else case e in #( - e) ac_cv_mingw_header_libxslt_transform_h=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_libxslt_transform_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_libxslt_transform_h" >&6; } -if test "x$ac_cv_mingw_header_libxslt_transform_h" = xyes -then : - -fi - if test "$ac_cv_mingw_header_libxslt_pattern_h" = "yes" -a "$ac_cv_mingw_header_libxslt_transform_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for xsltCompilePattern in MinGW -lxslt" >&5 -printf %s "checking for xsltCompilePattern in MinGW -lxslt... " >&6; } -if test ${ac_cv_mingw_lib_xslt+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-lxslt $XSLT_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char xsltCompilePattern (void); -int -main (void) -{ -return xsltCompilePattern (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_xslt=yes -else case e in #( - e) ac_cv_mingw_lib_xslt=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_xslt" >&5 -printf "%s\n" "$ac_cv_mingw_lib_xslt" >&6; } -if test "x$ac_cv_mingw_lib_xslt" = xyes -then : - : -else case e in #( - e) XSLT_PE_CFLAGS=""; XSLT_PE_LIBS="" ;; -esac -fi - else - XSLT_PE_CFLAGS="" - XSLT_PE_LIBS="" - fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$XSLT_PE_LIBS" = "x" - then - as_fn_append wine_notices "|libxslt ${notice_platform}MinGW development files not found; using bundled version." - fi - - if ${VKD3D_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - VKD3D_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags libvkd3d libvkd3d-shader 2>/dev/null` -fi -fi -if ${VKD3D_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - VKD3D_PE_LIBS=`$MINGW_PKG_CONFIG --libs libvkd3d libvkd3d-shader 2>/dev/null` -fi -fi -VKD3D_PE_LIBS=${VKD3D_PE_LIBS:-"-lvkd3d -lvkd3d-shader"} -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $VKD3D_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW vkd3d.h" >&5 -printf %s "checking for MinGW vkd3d.h... " >&6; } -if test ${ac_cv_mingw_header_vkd3d_h+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_vkd3d_h=yes -else case e in #( - e) ac_cv_mingw_header_vkd3d_h=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_vkd3d_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_vkd3d_h" >&6; } -if test "x$ac_cv_mingw_header_vkd3d_h" = xyes -then : - -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW vkd3d_shader.h" >&5 -printf %s "checking for MinGW vkd3d_shader.h... " >&6; } -if test ${ac_cv_mingw_header_vkd3d_shader_h+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_vkd3d_shader_h=yes -else case e in #( - e) ac_cv_mingw_header_vkd3d_shader_h=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_vkd3d_shader_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_vkd3d_shader_h" >&6; } -if test "x$ac_cv_mingw_header_vkd3d_shader_h" = xyes -then : - -fi - if test "$ac_cv_mingw_header_vkd3d_h" = "yes" -a "$ac_cv_mingw_header_vkd3d_shader_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for vkd3d_set_log_callback in MinGW -lvkd3d" >&5 -printf %s "checking for vkd3d_set_log_callback in MinGW -lvkd3d... " >&6; } -if test ${ac_cv_mingw_lib_vkd3d+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-lvkd3d $VKD3D_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char vkd3d_set_log_callback (void); -int -main (void) -{ -return vkd3d_set_log_callback (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_vkd3d=yes -else case e in #( - e) ac_cv_mingw_lib_vkd3d=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_vkd3d" >&5 -printf "%s\n" "$ac_cv_mingw_lib_vkd3d" >&6; } -if test "x$ac_cv_mingw_lib_vkd3d" = xyes -then : - : -else case e in #( - e) : ;; -esac -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for vkd3d_shader_build_varying_map in MinGW -lvkd3d-shader" >&5 -printf %s "checking for vkd3d_shader_build_varying_map in MinGW -lvkd3d-shader... " >&6; } -if test ${ac_cv_mingw_lib_vkd3d_shader+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-lvkd3d-shader $VKD3D_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char vkd3d_shader_build_varying_map (void); -int -main (void) -{ -return vkd3d_shader_build_varying_map (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_vkd3d_shader=yes -else case e in #( - e) ac_cv_mingw_lib_vkd3d_shader=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_vkd3d_shader" >&5 -printf "%s\n" "$ac_cv_mingw_lib_vkd3d_shader" >&6; } -if test "x$ac_cv_mingw_lib_vkd3d_shader" = xyes -then : - : -else case e in #( - e) : ;; -esac -fi - if test "$ac_cv_mingw_lib_vkd3d" = "no" -o "$ac_cv_mingw_lib_vkd3d_shader" = "no" - then - VKD3D_PE_CFLAGS="" - VKD3D_PE_LIBS="" - fi - else - VKD3D_PE_CFLAGS="" - VKD3D_PE_LIBS="" - fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$VKD3D_PE_LIBS" = "x" - then - as_fn_append wine_notices "|libvkd3d ${notice_platform}MinGW development files not found (or too old); using bundled version." - fi - - if ${ZLIB_PE_CFLAGS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - ZLIB_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags zlib 2>/dev/null` -fi -fi -if ${ZLIB_PE_LIBS:+false} : -then : - if test ${MINGW_PKG_CONFIG+y} -then : - ZLIB_PE_LIBS=`$MINGW_PKG_CONFIG --libs zlib 2>/dev/null` -fi -fi -ZLIB_PE_LIBS=${ZLIB_PE_LIBS:-"-lz"} -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $ZLIB_PE_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW zlib.h" >&5 -printf %s "checking for MinGW zlib.h... " >&6; } -if test ${ac_cv_mingw_header_zlib_h+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mingw_header_zlib_h=yes -else case e in #( - e) ac_cv_mingw_header_zlib_h=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_zlib_h" >&5 -printf "%s\n" "$ac_cv_mingw_header_zlib_h" >&6; } -if test "x$ac_cv_mingw_header_zlib_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inflate in MinGW -lz" >&5 -printf %s "checking for inflate in MinGW -lz... " >&6; } -if test ${ac_cv_mingw_lib_z+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_check_headers_saved_cc=$CC -ac_wine_check_headers_saved_exeext=$ac_exeext -ac_wine_check_headers_saved_libs=$LIBS -eval CC=\$${wine_arch}_CC -ac_exeext=".exe" -LIBS="-lz $ZLIB_PE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char inflate (void); -int -main (void) -{ -return inflate (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_mingw_lib_z=yes -else case e in #( - e) ac_cv_mingw_lib_z=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CC=$ac_wine_check_headers_saved_cc -ac_exeext=$ac_wine_check_headers_saved_exeext -LIBS=$ac_wine_check_headers_saved_libs ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_z" >&5 -printf "%s\n" "$ac_cv_mingw_lib_z" >&6; } -if test "x$ac_cv_mingw_lib_z" = xyes -then : - : -else case e in #( - e) ZLIB_PE_CFLAGS=""; ZLIB_PE_LIBS="" ;; -esac -fi -else case e in #( - e) ZLIB_PE_CFLAGS=""; ZLIB_PE_LIBS="" ;; -esac -fi -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$ZLIB_PE_LIBS" = "x" - then - as_fn_append wine_notices "|zlib ${notice_platform}MinGW development files not found; using bundled version." - fi -fi - -if ${CAPSTONE_PE_LIBS:+false} : -then : - CAPSTONE_PE_LIBS=capstone - if ${CAPSTONE_PE_CFLAGS:+false} : -then : - CAPSTONE_PE_CFLAGS="-I\$(top_srcdir)/libs/capstone/include" -else case e in #( - e) enable_capstone=no ;; -esac -fi -else case e in #( - e) enable_capstone=no ;; -esac -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: capstone cflags: $CAPSTONE_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: capstone libs: $CAPSTONE_PE_LIBS" >&5 - -if ${FAUDIO_PE_LIBS:+false} : -then : - FAUDIO_PE_LIBS="faudio mfplat mfreadwrite mfuuid propsys" - if ${FAUDIO_PE_CFLAGS:+false} : -then : - FAUDIO_PE_CFLAGS="-I\$(top_srcdir)/libs/faudio/include" -else case e in #( - e) enable_faudio=no ;; -esac -fi -else case e in #( - e) enable_faudio=no ;; -esac -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: faudio cflags: $FAUDIO_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: faudio libs: $FAUDIO_PE_LIBS" >&5 - -if ${FLUIDSYNTH_PE_LIBS:+false} : -then : - FLUIDSYNTH_PE_LIBS="fluidsynth" - if ${FLUIDSYNTH_PE_CFLAGS:+false} : -then : - FLUIDSYNTH_PE_CFLAGS="-I\$(top_srcdir)/libs/fluidsynth/include" -else case e in #( - e) enable_fluidsynth=no ;; -esac -fi -else case e in #( - e) enable_fluidsynth=no ;; -esac -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: fluidsynth cflags: $FLUIDSYNTH_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: fluidsynth libs: $FLUIDSYNTH_PE_LIBS" >&5 - -if ${GSM_PE_LIBS:+false} : -then : - GSM_PE_LIBS=gsm - if ${GSM_PE_CFLAGS:+false} : -then : - GSM_PE_CFLAGS="-I\$(top_srcdir)/libs/gsm/inc" -else case e in #( - e) enable_gsm=no ;; -esac -fi -else case e in #( - e) enable_gsm=no ;; -esac -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: gsm cflags: $GSM_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: gsm libs: $GSM_PE_LIBS" >&5 - -if ${JPEG_PE_LIBS:+false} : -then : - JPEG_PE_LIBS=jpeg - if ${JPEG_PE_CFLAGS:+false} : -then : - JPEG_PE_CFLAGS="-I\$(top_srcdir)/libs/jpeg" -else case e in #( - e) enable_jpeg=no ;; -esac -fi -else case e in #( - e) enable_jpeg=no ;; -esac -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: jpeg cflags: $JPEG_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: jpeg libs: $JPEG_PE_LIBS" >&5 - -if ${JXR_PE_LIBS:+false} : -then : - JXR_PE_LIBS=jxr - if ${JXR_PE_CFLAGS:+false} : -then : - JXR_PE_CFLAGS="-I\$(top_srcdir)/libs/jxr/jxrgluelib -I\$(top_srcdir)/libs/jxr/image/sys" -else case e in #( - e) enable_jxr=no ;; -esac -fi -else case e in #( - e) enable_jxr=no ;; -esac -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: jxr cflags: $JXR_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: jxr libs: $JXR_PE_LIBS" >&5 - -if ${LCMS2_PE_LIBS:+false} : -then : - LCMS2_PE_LIBS=lcms2 - if ${LCMS2_PE_CFLAGS:+false} : -then : - LCMS2_PE_CFLAGS="-I\$(top_srcdir)/libs/lcms2/include" -else case e in #( - e) enable_lcms2=no ;; -esac -fi -else case e in #( - e) enable_lcms2=no ;; -esac -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: lcms2 cflags: $LCMS2_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: lcms2 libs: $LCMS2_PE_LIBS" >&5 - -if ${LDAP_PE_LIBS:+false} : -then : - LDAP_PE_LIBS=ldap - if ${LDAP_PE_CFLAGS:+false} : -then : - LDAP_PE_CFLAGS="-I\$(top_srcdir)/libs/ldap/include" -else case e in #( - e) enable_ldap=no ;; -esac -fi -else case e in #( - e) enable_ldap=no ;; -esac -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: ldap cflags: $LDAP_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: ldap libs: $LDAP_PE_LIBS" >&5 - -if ${MPG123_PE_LIBS:+false} : -then : - MPG123_PE_LIBS=mpg123 - if ${MPG123_PE_CFLAGS:+false} : -then : - MPG123_PE_CFLAGS="-I\$(top_srcdir)/libs/mpg123/src/include" -else case e in #( - e) enable_mpg123=no ;; -esac -fi -else case e in #( - e) enable_mpg123=no ;; -esac -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: mpg123 cflags: $MPG123_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: mpg123 libs: $MPG123_PE_LIBS" >&5 - -if ${MUSL_PE_LIBS:+false} : -then : - MUSL_PE_LIBS=musl - if ${MUSL_PE_CFLAGS:+false} : -then : - MUSL_PE_CFLAGS= -else case e in #( - e) enable_musl=no ;; -esac -fi -else case e in #( - e) enable_musl=no ;; -esac -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: musl cflags: $MUSL_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: musl libs: $MUSL_PE_LIBS" >&5 - -if ${PNG_PE_LIBS:+false} : -then : - PNG_PE_LIBS="png \$(ZLIB_PE_LIBS)" - if ${PNG_PE_CFLAGS:+false} : -then : - PNG_PE_CFLAGS="-I\$(top_srcdir)/libs/png" -else case e in #( - e) enable_png=no ;; -esac -fi -else case e in #( - e) enable_png=no ;; -esac -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: png cflags: $PNG_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: png libs: $PNG_PE_LIBS" >&5 - -if ${TIFF_PE_LIBS:+false} : -then : - TIFF_PE_LIBS="tiff \$(ZLIB_PE_LIBS)" - if ${TIFF_PE_CFLAGS:+false} : -then : - TIFF_PE_CFLAGS="-I\$(top_srcdir)/libs/tiff/libtiff" -else case e in #( - e) enable_tiff=no ;; -esac -fi -else case e in #( - e) enable_tiff=no ;; -esac -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: tiff cflags: $TIFF_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: tiff libs: $TIFF_PE_LIBS" >&5 - -if ${VKD3D_PE_LIBS:+false} : -then : - VKD3D_PE_LIBS=vkd3d - if ${VKD3D_PE_CFLAGS:+false} : -then : - VKD3D_PE_CFLAGS="-I\$(top_srcdir)/libs/vkd3d/include" -else case e in #( - e) enable_vkd3d=no ;; -esac -fi -else case e in #( - e) enable_vkd3d=no ;; -esac -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: vkd3d cflags: $VKD3D_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: vkd3d libs: $VKD3D_PE_LIBS" >&5 - -if ${XML2_PE_LIBS:+false} : -then : - XML2_PE_LIBS=xml2 - if ${XML2_PE_CFLAGS:+false} : -then : - XML2_PE_CFLAGS="-I\$(top_srcdir)/libs/xml2/include -DLIBXML_STATIC" -else case e in #( - e) enable_xml2=no ;; -esac -fi -else case e in #( - e) enable_xml2=no ;; -esac -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: xml2 cflags: $XML2_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: xml2 libs: $XML2_PE_LIBS" >&5 - -if ${XSLT_PE_LIBS:+false} : -then : - XSLT_PE_LIBS=xslt - if ${XSLT_PE_CFLAGS:+false} : -then : - XSLT_PE_CFLAGS="-I\$(top_srcdir)/libs/xslt/libxslt -I\$(top_srcdir)/libs/xslt -DLIBXSLT_STATIC" -else case e in #( - e) enable_xslt=no ;; -esac -fi -else case e in #( - e) enable_xslt=no ;; -esac -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: xslt cflags: $XSLT_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: xslt libs: $XSLT_PE_LIBS" >&5 - -if ${ZLIB_PE_LIBS:+false} : -then : - ZLIB_PE_LIBS=z - if ${ZLIB_PE_CFLAGS:+false} : -then : - ZLIB_PE_CFLAGS="-I\$(top_srcdir)/libs/zlib -DFAR= -DZ_SOLO" -else case e in #( - e) enable_zlib=no ;; -esac -fi -else case e in #( - e) enable_zlib=no ;; -esac -fi -printf "%s\n" "$as_me:${as_lineno-$LINENO}: zlib cflags: $ZLIB_PE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: zlib libs: $ZLIB_PE_LIBS" >&5 - - - -if test "x$with_pthread" = xno -then : - -else case e in #( - e) ac_fn_c_check_func "$LINENO" "pthread_create" "ac_cv_func_pthread_create" -if test "x$ac_cv_func_pthread_create" = xyes -then : - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 -printf %s "checking for pthread_create in -lpthread... " >&6; } -if test ${ac_cv_lib_pthread_pthread_create+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char pthread_create (void); -int -main (void) -{ -return pthread_create (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_pthread_pthread_create=yes -else case e in #( - e) ac_cv_lib_pthread_pthread_create=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 -printf "%s\n" "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = xyes -then : - PTHREAD_LIBS="-lpthread" - -fi - ;; -esac -fi - ;; -esac -fi -if test "x$ac_cv_func_pthread_create" != xyes -a "x$PTHREAD_LIBS" = x -then : - case "x$with_pthread" in - xno) ;; - *) as_fn_error $? "pthread ${notice_platform}development files not found. -Wine cannot support threads without libpthread. -Use the --without-pthread option if you really want this." "$LINENO" 5 ;; -esac - -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -printf %s "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test ${ac_cv_prog_CPP+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) # Double quotes because $CC needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - -else case e in #( - e) # Broken: fails on valid input. -continue ;; -esac -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else case e in #( - e) # Passes both tests. -ac_preproc_ok=: -break ;; -esac -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - break -fi - - done - ac_cv_prog_CPP=$CPP - ;; -esac -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -printf "%s\n" "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - -else case e in #( - e) # Broken: fails on valid input. -continue ;; -esac -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else case e in #( - e) # Passes both tests. -ac_preproc_ok=: -break ;; -esac -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - -else case e in #( - e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See 'config.log' for more details" "$LINENO" 5; } ;; -esac -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for X" >&5 -printf %s "checking for X... " >&6; } - - -# Check whether --with-x was given. -if test ${with_x+y} -then : - withval=$with_x; -fi - -# $have_x is 'yes', 'no', 'disabled', or empty when we do not yet know. -if test "x$with_x" = xno; then - # The user explicitly disabled X. - have_x=disabled -else - case $x_includes,$x_libraries in #( - *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( - *,NONE | NONE,*) if test ${ac_cv_have_x+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) # One or both of the vars are not set, and there is no cached value. -ac_x_includes=no -ac_x_libraries=no -# Do we need to do anything special at all? -ac_save_LIBS=$LIBS -LIBS="-lX11 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -XrmInitialize () - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - # We can compile and link X programs with no special options. - ac_x_includes= - ac_x_libraries= -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS="$ac_save_LIBS" -# If that didn't work, only try xmkmf and file system searches -# for native compilation. -if test x"$ac_x_includes" = xno && test "$cross_compiling" = no -then : - rm -f -r conftest.dir -if mkdir conftest.dir; then - cd conftest.dir - cat >Imakefile <<'_ACEOF' -incroot: - @echo incroot='${INCROOT}' -usrlibdir: - @echo usrlibdir='${USRLIBDIR}' -libdir: - @echo libdir='${LIBDIR}' -_ACEOF - if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. - for ac_var in incroot usrlibdir libdir; do - eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" - done - # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. - for ac_extension in a so sl dylib la dll; do - if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && - test -f "$ac_im_libdir/libX11.$ac_extension"; then - ac_im_usrlibdir=$ac_im_libdir; break - fi - done - # Screen out bogus values from the imake configuration. They are - # bogus both because they are the default anyway, and because - # using them would break gcc on systems where it needs fixed includes. - case $ac_im_incroot in - /usr/include) ac_x_includes= ;; - *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; - esac - case $ac_im_usrlibdir in - /usr/lib | /usr/lib64 | /lib | /lib64) ;; - *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; - esac - fi - cd .. - rm -f -r conftest.dir -fi - - # Standard set of common directories for X headers. -# Check X11 before X11Rn because it is often a symlink to the current release. -ac_x_header_dirs=' -/usr/X11/include -/usr/X11R7/include -/usr/X11R6/include -/usr/X11R5/include -/usr/X11R4/include - -/usr/include/X11 -/usr/include/X11R7 -/usr/include/X11R6 -/usr/include/X11R5 -/usr/include/X11R4 - -/usr/local/X11/include -/usr/local/X11R7/include -/usr/local/X11R6/include -/usr/local/X11R5/include -/usr/local/X11R4/include - -/usr/local/include/X11 -/usr/local/include/X11R7 -/usr/local/include/X11R6 -/usr/local/include/X11R5 -/usr/local/include/X11R4 - -/opt/X11/include - -/usr/X386/include -/usr/x386/include -/usr/XFree86/include/X11 - -/usr/include -/usr/local/include -/usr/unsupported/include -/usr/athena/include -/usr/local/x11r5/include -/usr/lpp/Xamples/include - -/usr/openwin/include -/usr/openwin/share/include' - -if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Xlib.h. - # First, try using that file with no special directory specified. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - # We can compile using X headers with no special include directory. -ac_x_includes= -else case e in #( - e) for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Xlib.h"; then - ac_x_includes=$ac_dir - break - fi -done ;; -esac -fi -rm -f conftest.err conftest.i conftest.$ac_ext -fi # $ac_x_includes = no - -if test "$ac_x_libraries" = no; then - # Check for the libraries. - # See if we find them without any special options. - # Don't add to $LIBS permanently. - ac_save_LIBS=$LIBS - LIBS="-lX11 $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -XrmInitialize () - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - LIBS=$ac_save_LIBS -# We can link X programs with no special library path. -ac_x_libraries= -else case e in #( - e) LIBS=$ac_save_LIBS -for ac_dir in `printf "%s\n" "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` -do - # Don't even attempt the hair of trying to link an X program! - for ac_extension in a so sl dylib la dll; do - if test -r "$ac_dir/libX11.$ac_extension"; then - ac_x_libraries=$ac_dir - break 2 - fi - done -done ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi # $ac_x_libraries = no - -fi -# Record the results. -case $ac_x_includes,$ac_x_libraries in #( - no,* | *,no | *\'*) : - # Didn't find X, or a directory has "'" in its name. - ac_cv_have_x="have_x=no" ;; #( - *) : - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$ac_x_includes'\ - ac_x_libraries='$ac_x_libraries'" ;; -esac ;; -esac -fi -;; #( - *) have_x=yes;; - esac - eval "$ac_cv_have_x" -fi # $with_x != no - -if test "$have_x" != yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 -printf "%s\n" "$have_x" >&6; } - no_x=yes -else - # If each of the values was on the command line, it overrides each guess. - test "x$x_includes" = xNONE && x_includes=$ac_x_includes - test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries - # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$x_includes'\ - ac_x_libraries='$x_libraries'" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 -printf "%s\n" "libraries $x_libraries, headers $x_includes" >&6; } -fi - -if test "$have_x" = "yes" -then - test -z "$x_includes" || X_CFLAGS="$X_CFLAGS -I$x_includes" - - test -z "$x_libraries" || X_LIBS="$X_LIBS -L$x_libraries" - - - ac_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lX11" >&5 -printf %s "checking for -lX11... " >&6; } -if test ${ac_cv_lib_soname_X11+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lX11 $X_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XCreateWindow (void); -int -main (void) -{ -return XCreateWindow (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_X11=`$ac_cv_path_LDD conftest.exe | grep "X11" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_X11=`$OTOOL -L conftest$ac_exeext | grep "libX11\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libX11\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_X11=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libX11\\.$LIBEXT" | sed -e "s/^.*\\[\\(libX11\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_X11:+false} : -then : - ac_cv_lib_soname_X11=`$LDD conftest$ac_exeext | grep "libX11\\.$LIBEXT" | sed -e "s/^.*\(libX11\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_X11= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_X11:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_X11" >&5 -printf "%s\n" "$ac_cv_lib_soname_X11" >&6; } - -printf "%s\n" "#define SONAME_LIBX11 \"$ac_cv_lib_soname_X11\"" >>confdefs.h - - ;; -esac -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lXext" >&5 -printf %s "checking for -lXext... " >&6; } -if test ${ac_cv_lib_soname_Xext+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lXext $X_LIBS -lX11 $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XextCreateExtension (void); -int -main (void) -{ -return XextCreateExtension (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_Xext=`$ac_cv_path_LDD conftest.exe | grep "Xext" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xext=`$OTOOL -L conftest$ac_exeext | grep "libXext\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXext\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xext=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXext\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXext\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_Xext:+false} : -then : - ac_cv_lib_soname_Xext=`$LDD conftest$ac_exeext | grep "libXext\\.$LIBEXT" | sed -e "s/^.*\(libXext\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_Xext= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_Xext:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_Xext" >&5 -printf "%s\n" "$ac_cv_lib_soname_Xext" >&6; } - -printf "%s\n" "#define SONAME_LIBXEXT \"$ac_cv_lib_soname_Xext\"" >>confdefs.h - - X_LIBS="$X_LIBS -lXext" ;; -esac -fi - X_LIBS="$X_LIBS -lX11" - - xlib_includes="#include -#include " - - ac_fn_c_check_header_compile "$LINENO" "X11/extensions/shape.h" "ac_cv_header_X11_extensions_shape_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_shape_h" = xyes -then : - printf "%s\n" "#define HAVE_X11_EXTENSIONS_SHAPE_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "X11/extensions/XInput2.h" "ac_cv_header_X11_extensions_XInput2_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_XInput2_h" = xyes -then : - printf "%s\n" "#define HAVE_X11_EXTENSIONS_XINPUT2_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "X11/extensions/XShm.h" "ac_cv_header_X11_extensions_XShm_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_XShm_h" = xyes -then : - printf "%s\n" "#define HAVE_X11_EXTENSIONS_XSHM_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xfixes.h" "ac_cv_header_X11_extensions_Xfixes_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_Xfixes_h" = xyes -then : - printf "%s\n" "#define HAVE_X11_EXTENSIONS_XFIXES_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xinerama.h" "ac_cv_header_X11_extensions_Xinerama_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_Xinerama_h" = xyes -then : - printf "%s\n" "#define HAVE_X11_EXTENSIONS_XINERAMA_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xrandr.h" "ac_cv_header_X11_extensions_Xrandr_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_Xrandr_h" = xyes -then : - printf "%s\n" "#define HAVE_X11_EXTENSIONS_XRANDR_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xrender.h" "ac_cv_header_X11_extensions_Xrender_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_Xrender_h" = xyes -then : - printf "%s\n" "#define HAVE_X11_EXTENSIONS_XRENDER_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "X11/extensions/xf86vmode.h" "ac_cv_header_X11_extensions_xf86vmode_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_xf86vmode_h" = xyes -then : - printf "%s\n" "#define HAVE_X11_EXTENSIONS_XF86VMODE_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "X11/extensions/xf86vmproto.h" "ac_cv_header_X11_extensions_xf86vmproto_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_xf86vmproto_h" = xyes -then : - printf "%s\n" "#define HAVE_X11_EXTENSIONS_XF86VMPROTO_H 1" >>confdefs.h - -fi - - - ac_fn_c_check_header_compile "$LINENO" "X11/Xcursor/Xcursor.h" "ac_cv_header_X11_Xcursor_Xcursor_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_Xcursor_Xcursor_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lXcursor" >&5 -printf %s "checking for -lXcursor... " >&6; } -if test ${ac_cv_lib_soname_Xcursor+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lXcursor $X_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XcursorImageLoadCursor (void); -int -main (void) -{ -return XcursorImageLoadCursor (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_Xcursor=`$ac_cv_path_LDD conftest.exe | grep "Xcursor" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xcursor=`$OTOOL -L conftest$ac_exeext | grep "libXcursor\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXcursor\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xcursor=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXcursor\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXcursor\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_Xcursor:+false} : -then : - ac_cv_lib_soname_Xcursor=`$LDD conftest$ac_exeext | grep "libXcursor\\.$LIBEXT" | sed -e "s/^.*\(libXcursor\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_Xcursor= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_Xcursor:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_Xcursor" >&5 -printf "%s\n" "$ac_cv_lib_soname_Xcursor" >&6; } - -printf "%s\n" "#define SONAME_LIBXCURSOR \"$ac_cv_lib_soname_Xcursor\"" >>confdefs.h - - ;; -esac -fi -fi - - if test "x$ac_cv_lib_soname_Xcursor" = "x" -then : - case "x$with_xcursor" in - x) as_fn_append wine_notices "|libxcursor ${notice_platform}development files not found, the Xcursor extension won't be supported." ;; - xno) ;; - *) as_fn_error $? "libxcursor ${notice_platform}development files not found, the Xcursor extension won't be supported. -This is an error since --with-xcursor was requested." "$LINENO" 5 ;; -esac - -fi - - ac_fn_c_check_header_compile "$LINENO" "X11/extensions/XInput.h" "ac_cv_header_X11_extensions_XInput_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_XInput_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lXi" >&5 -printf %s "checking for -lXi... " >&6; } -if test ${ac_cv_lib_soname_Xi+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lXi $X_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XOpenDevice (void); -int -main (void) -{ -return XOpenDevice (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_Xi=`$ac_cv_path_LDD conftest.exe | grep "Xi" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xi=`$OTOOL -L conftest$ac_exeext | grep "libXi\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXi\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xi=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXi\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXi\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_Xi:+false} : -then : - ac_cv_lib_soname_Xi=`$LDD conftest$ac_exeext | grep "libXi\\.$LIBEXT" | sed -e "s/^.*\(libXi\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_Xi= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_Xi:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_Xi" >&5 -printf "%s\n" "$ac_cv_lib_soname_Xi" >&6; } - -printf "%s\n" "#define SONAME_LIBXI \"$ac_cv_lib_soname_Xi\"" >>confdefs.h - - ;; -esac -fi -fi - - if test "x$ac_cv_lib_soname_Xi" = "x" -then : - case "x$with_xinput" in - x) as_fn_append wine_notices "|libxi ${notice_platform}development files not found, the Xinput extension won't be supported." ;; - xno) ;; - *) as_fn_error $? "libxi ${notice_platform}development files not found, the Xinput extension won't be supported. -This is an error since --with-xinput was requested." "$LINENO" 5 ;; -esac - -fi - - if test "x$ac_cv_lib_soname_Xi" != x - then - if test "$ac_cv_header_X11_extensions_XInput2_h" != "yes" -then : - case "x$with_xinput2" in - x) as_fn_append wine_notices "|XInput2 headers not found, the XInput 2 extension won't be supported." ;; - xno) ;; - *) as_fn_error $? "XInput2 headers not found, the XInput 2 extension won't be supported. -This is an error since --with-xinput2 was requested." "$LINENO" 5 ;; -esac - -fi - fi - - if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for XShmQueryExtension in -lXext" >&5 -printf %s "checking for XShmQueryExtension in -lXext... " >&6; } -if test ${ac_cv_lib_Xext_XShmQueryExtension+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lXext $X_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XShmQueryExtension (void); -int -main (void) -{ -return XShmQueryExtension (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_Xext_XShmQueryExtension=yes -else case e in #( - e) ac_cv_lib_Xext_XShmQueryExtension=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XShmQueryExtension" >&5 -printf "%s\n" "$ac_cv_lib_Xext_XShmQueryExtension" >&6; } -if test "x$ac_cv_lib_Xext_XShmQueryExtension" = xyes -then : - -printf "%s\n" "#define HAVE_LIBXXSHM 1" >>confdefs.h - -fi - - fi - if test "$ac_cv_lib_Xext_XShmQueryExtension" != "yes" -then : - case "x$with_xshm" in - x) as_fn_append wine_notices "|XShm ${notice_platform}development files not found, X Shared Memory won't be supported." ;; - xno) ;; - *) as_fn_error $? "XShm ${notice_platform}development files not found, X Shared Memory won't be supported. -This is an error since --with-xshm was requested." "$LINENO" 5 ;; -esac - -fi - - if test "$ac_cv_header_X11_extensions_shape_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for XShapeQueryExtension in -lXext" >&5 -printf %s "checking for XShapeQueryExtension in -lXext... " >&6; } -if test ${ac_cv_lib_Xext_XShapeQueryExtension+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lXext $X_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XShapeQueryExtension (void); -int -main (void) -{ -return XShapeQueryExtension (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_Xext_XShapeQueryExtension=yes -else case e in #( - e) ac_cv_lib_Xext_XShapeQueryExtension=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XShapeQueryExtension" >&5 -printf "%s\n" "$ac_cv_lib_Xext_XShapeQueryExtension" >&6; } -if test "x$ac_cv_lib_Xext_XShapeQueryExtension" = xyes -then : - -printf "%s\n" "#define HAVE_LIBXSHAPE 1" >>confdefs.h - -fi - - fi - if test "$ac_cv_lib_Xext_XShapeQueryExtension" != "yes" -then : - case "x$with_xshape" in - x) as_fn_append wine_notices "|XShape ${notice_platform}development files not found, XShape won't be supported." ;; - xno) ;; - *) as_fn_error $? "XShape ${notice_platform}development files not found, XShape won't be supported. -This is an error since --with-xshape was requested." "$LINENO" 5 ;; -esac - -fi - - if test "$ac_cv_header_X11_extensions_xf86vmode_h" = "yes" -o "$ac_cv_header_X11_extensions_xf86vmproto_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lXxf86vm" >&5 -printf %s "checking for -lXxf86vm... " >&6; } -if test ${ac_cv_lib_soname_Xxf86vm+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lXxf86vm $X_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XF86VidModeQueryExtension (void); -int -main (void) -{ -return XF86VidModeQueryExtension (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_Xxf86vm=`$ac_cv_path_LDD conftest.exe | grep "Xxf86vm" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xxf86vm=`$OTOOL -L conftest$ac_exeext | grep "libXxf86vm\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXxf86vm\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xxf86vm=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXxf86vm\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXxf86vm\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_Xxf86vm:+false} : -then : - ac_cv_lib_soname_Xxf86vm=`$LDD conftest$ac_exeext | grep "libXxf86vm\\.$LIBEXT" | sed -e "s/^.*\(libXxf86vm\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_Xxf86vm= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_Xxf86vm:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_Xxf86vm" >&5 -printf "%s\n" "$ac_cv_lib_soname_Xxf86vm" >&6; } - -printf "%s\n" "#define SONAME_LIBXXF86VM \"$ac_cv_lib_soname_Xxf86vm\"" >>confdefs.h - - ;; -esac -fi - fi - if test "x$ac_cv_lib_soname_Xxf86vm" = "x" -then : - case "x$with_xxf86vm" in - x) as_fn_append wine_notices "|libXxf86vm ${notice_platform}development files not found, XFree86 Vidmode won't be supported." ;; - xno) ;; - *) as_fn_error $? "libXxf86vm ${notice_platform}development files not found, XFree86 Vidmode won't be supported. -This is an error since --with-xxf86vm was requested." "$LINENO" 5 ;; -esac - -fi - - if test "$ac_cv_header_X11_extensions_Xrender_h" = "yes" -a "x$ac_cv_lib_soname_X11" != "x" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lXrender" >&5 -printf %s "checking for -lXrender... " >&6; } -if test ${ac_cv_lib_soname_Xrender+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lXrender $X_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XRenderQueryExtension (void); -int -main (void) -{ -return XRenderQueryExtension (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_Xrender=`$ac_cv_path_LDD conftest.exe | grep "Xrender" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xrender=`$OTOOL -L conftest$ac_exeext | grep "libXrender\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXrender\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xrender=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXrender\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXrender\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_Xrender:+false} : -then : - ac_cv_lib_soname_Xrender=`$LDD conftest$ac_exeext | grep "libXrender\\.$LIBEXT" | sed -e "s/^.*\(libXrender\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_Xrender= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_Xrender:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_Xrender" >&5 -printf "%s\n" "$ac_cv_lib_soname_Xrender" >&6; } - -printf "%s\n" "#define SONAME_LIBXRENDER \"$ac_cv_lib_soname_Xrender\"" >>confdefs.h - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for XRenderSetPictureTransform in -lXrender" >&5 -printf %s "checking for XRenderSetPictureTransform in -lXrender... " >&6; } -if test ${ac_cv_lib_Xrender_XRenderSetPictureTransform+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lXrender $X_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XRenderSetPictureTransform (void); -int -main (void) -{ -return XRenderSetPictureTransform (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_Xrender_XRenderSetPictureTransform=yes -else case e in #( - e) ac_cv_lib_Xrender_XRenderSetPictureTransform=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrender_XRenderSetPictureTransform" >&5 -printf "%s\n" "$ac_cv_lib_Xrender_XRenderSetPictureTransform" >&6; } -if test "x$ac_cv_lib_Xrender_XRenderSetPictureTransform" = xyes -then : - -printf "%s\n" "#define HAVE_XRENDERSETPICTURETRANSFORM 1" >>confdefs.h - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for XRenderCreateLinearGradient in -lXrender" >&5 -printf %s "checking for XRenderCreateLinearGradient in -lXrender... " >&6; } -if test ${ac_cv_lib_Xrender_XRenderCreateLinearGradient+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lXrender $X_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XRenderCreateLinearGradient (void); -int -main (void) -{ -return XRenderCreateLinearGradient (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_Xrender_XRenderCreateLinearGradient=yes -else case e in #( - e) ac_cv_lib_Xrender_XRenderCreateLinearGradient=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrender_XRenderCreateLinearGradient" >&5 -printf "%s\n" "$ac_cv_lib_Xrender_XRenderCreateLinearGradient" >&6; } -if test "x$ac_cv_lib_Xrender_XRenderCreateLinearGradient" = xyes -then : - -printf "%s\n" "#define HAVE_XRENDERCREATELINEARGRADIENT 1" >>confdefs.h - -fi - ;; -esac -fi - - fi - if test "x$ac_cv_lib_soname_Xrender" = "x" -then : - case "x$with_xrender" in - x) as_fn_append wine_warnings "|libxrender ${notice_platform}development files not found, XRender won't be supported." ;; - xno) ;; - *) as_fn_error $? "libxrender ${notice_platform}development files not found, XRender won't be supported. -This is an error since --with-xrender was requested." "$LINENO" 5 ;; -esac - -fi - - if test "$ac_cv_header_X11_extensions_Xrandr_h" = "yes" -a "x$ac_cv_lib_soname_Xrender" != "x" - then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main (void) -{ -static typeof(XRRSetScreenConfigAndRate) * func; if (func) return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lXrandr" >&5 -printf %s "checking for -lXrandr... " >&6; } -if test ${ac_cv_lib_soname_Xrandr+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lXrandr $X_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XRRQueryExtension (void); -int -main (void) -{ -return XRRQueryExtension (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_Xrandr=`$ac_cv_path_LDD conftest.exe | grep "Xrandr" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xrandr=`$OTOOL -L conftest$ac_exeext | grep "libXrandr\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXrandr\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xrandr=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXrandr\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXrandr\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_Xrandr:+false} : -then : - ac_cv_lib_soname_Xrandr=`$LDD conftest$ac_exeext | grep "libXrandr\\.$LIBEXT" | sed -e "s/^.*\(libXrandr\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_Xrandr= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_Xrandr:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_Xrandr" >&5 -printf "%s\n" "$ac_cv_lib_soname_Xrandr" >&6; } - -printf "%s\n" "#define SONAME_LIBXRANDR \"$ac_cv_lib_soname_Xrandr\"" >>confdefs.h - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main (void) -{ -static typeof(XRRGetProviderResources) *f; if (f) return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -printf "%s\n" "#define HAVE_XRRGETPROVIDERRESOURCES 1" >>confdefs.h - -else case e in #( - e) as_fn_append wine_notices "|libxrandr ${notice_platform}development files too old, XRandR display device handler won't be supported." ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - fi - if test "x$ac_cv_lib_soname_Xrandr" = "x" -then : - case "x$with_xrandr" in - x) as_fn_append wine_notices "|libxrandr ${notice_platform}development files not found, XRandr won't be supported." ;; - xno) ;; - *) as_fn_error $? "libxrandr ${notice_platform}development files not found, XRandr won't be supported. -This is an error since --with-xrandr was requested." "$LINENO" 5 ;; -esac - -fi - - if test "$ac_cv_header_X11_extensions_Xfixes_h" = "yes" - then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main (void) -{ -static typeof(XFixesQueryVersion) * func; if (func) return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lXfixes" >&5 -printf %s "checking for -lXfixes... " >&6; } -if test ${ac_cv_lib_soname_Xfixes+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lXfixes $X_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XFixesQueryVersion (void); -int -main (void) -{ -return XFixesQueryVersion (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_Xfixes=`$ac_cv_path_LDD conftest.exe | grep "Xfixes" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xfixes=`$OTOOL -L conftest$ac_exeext | grep "libXfixes\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXfixes\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xfixes=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXfixes\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXfixes\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_Xfixes:+false} : -then : - ac_cv_lib_soname_Xfixes=`$LDD conftest$ac_exeext | grep "libXfixes\\.$LIBEXT" | sed -e "s/^.*\(libXfixes\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_Xfixes= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_Xfixes:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_Xfixes" >&5 -printf "%s\n" "$ac_cv_lib_soname_Xfixes" >&6; } - -printf "%s\n" "#define SONAME_LIBXFIXES \"$ac_cv_lib_soname_Xfixes\"" >>confdefs.h - - ;; -esac -fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - fi - if test "x$ac_cv_lib_soname_Xfixes" = "x" -then : - case "x$with_xfixes" in - x) as_fn_append wine_notices "|libxfixes ${notice_platform}development files not found, Xfixes won't be supported." ;; - xno) ;; - *) as_fn_error $? "libxfixes ${notice_platform}development files not found, Xfixes won't be supported. -This is an error since --with-xfixes was requested." "$LINENO" 5 ;; -esac - -fi - - if test "$ac_cv_header_X11_extensions_Xinerama_h" = "yes" - then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main (void) -{ -static typeof(XineramaQueryScreens) * func; if (func) return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lXinerama" >&5 -printf %s "checking for -lXinerama... " >&6; } -if test ${ac_cv_lib_soname_Xinerama+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lXinerama $X_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XineramaQueryScreens (void); -int -main (void) -{ -return XineramaQueryScreens (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_Xinerama=`$ac_cv_path_LDD conftest.exe | grep "Xinerama" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xinerama=`$OTOOL -L conftest$ac_exeext | grep "libXinerama\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXinerama\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xinerama=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXinerama\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXinerama\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_Xinerama:+false} : -then : - ac_cv_lib_soname_Xinerama=`$LDD conftest$ac_exeext | grep "libXinerama\\.$LIBEXT" | sed -e "s/^.*\(libXinerama\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_Xinerama= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_Xinerama:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_Xinerama" >&5 -printf "%s\n" "$ac_cv_lib_soname_Xinerama" >&6; } - -printf "%s\n" "#define SONAME_LIBXINERAMA \"$ac_cv_lib_soname_Xinerama\"" >>confdefs.h - - ;; -esac -fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - fi - if test "x$ac_cv_lib_soname_Xinerama" = "x" -then : - case "x$with_xinerama" in - x) as_fn_append wine_notices "|libxinerama ${notice_platform}development files not found, multi-monitor setups won't be supported." ;; - xno) ;; - *) as_fn_error $? "libxinerama ${notice_platform}development files not found, multi-monitor setups won't be supported. -This is an error since --with-xinerama was requested." "$LINENO" 5 ;; -esac - -fi - - ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xcomposite.h" "ac_cv_header_X11_extensions_Xcomposite_h" "$xlib_includes -" -if test "x$ac_cv_header_X11_extensions_Xcomposite_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lXcomposite" >&5 -printf %s "checking for -lXcomposite... " >&6; } -if test ${ac_cv_lib_soname_Xcomposite+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lXcomposite $X_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char XCompositeRedirectWindow (void); -int -main (void) -{ -return XCompositeRedirectWindow (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_Xcomposite=`$ac_cv_path_LDD conftest.exe | grep "Xcomposite" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xcomposite=`$OTOOL -L conftest$ac_exeext | grep "libXcomposite\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXcomposite\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xcomposite=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXcomposite\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXcomposite\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_Xcomposite:+false} : -then : - ac_cv_lib_soname_Xcomposite=`$LDD conftest$ac_exeext | grep "libXcomposite\\.$LIBEXT" | sed -e "s/^.*\(libXcomposite\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_Xcomposite= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_Xcomposite:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_Xcomposite" >&5 -printf "%s\n" "$ac_cv_lib_soname_Xcomposite" >&6; } - -printf "%s\n" "#define SONAME_LIBXCOMPOSITE \"$ac_cv_lib_soname_Xcomposite\"" >>confdefs.h - - ;; -esac -fi -fi - - if test "x$ac_cv_lib_soname_Xcomposite" = "x" -then : - case "x$with_xcomposite" in - x) as_fn_append wine_notices "|libxcomposite ${notice_platform}development files not found, Xcomposite won't be supported." ;; - xno) ;; - *) as_fn_error $? "libxcomposite ${notice_platform}development files not found, Xcomposite won't be supported. -This is an error since --with-xcomposite was requested." "$LINENO" 5 ;; -esac - -fi - - ac_fn_c_check_member "$LINENO" "XICCallback" "callback" "ac_cv_member_XICCallback_callback" "$xlib_includes -" -if test "x$ac_cv_member_XICCallback_callback" = xyes -then : - -printf "%s\n" "#define HAVE_XICCALLBACK_CALLBACK 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "XEvent" "xcookie" "ac_cv_member_XEvent_xcookie" "$xlib_includes -" -if test "x$ac_cv_member_XEvent_xcookie" = xyes -then : - -printf "%s\n" "#define HAVE_XEVENT_XCOOKIE 1" >>confdefs.h - - -fi - - - - opengl_msg="" - if test "x$with_opengl" != "xno" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lGL" >&5 -printf %s "checking for -lGL... " >&6; } -if test ${ac_cv_lib_soname_GL+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lGL $X_LIBS -lm $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char glXCreateContext (void); -int -main (void) -{ -return glXCreateContext (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_GL=`$ac_cv_path_LDD conftest.exe | grep "GL" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_GL=`$OTOOL -L conftest$ac_exeext | grep "libGL\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libGL\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_GL=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libGL\\.$LIBEXT" | sed -e "s/^.*\\[\\(libGL\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_GL:+false} : -then : - ac_cv_lib_soname_GL=`$LDD conftest$ac_exeext | grep "libGL\\.$LIBEXT" | sed -e "s/^.*\(libGL\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_GL= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_GL:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lGL" >&5 -printf %s "checking for -lGL... " >&6; } -if test ${ac_cv_lib_soname_GL+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lGL $X_LIBS -lm -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char glXCreateContext (void); -int -main (void) -{ -return glXCreateContext (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_GL=`$ac_cv_path_LDD conftest.exe | grep "GL" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_GL=`$OTOOL -L conftest$ac_exeext | grep "libGL\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libGL\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_GL=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libGL\\.$LIBEXT" | sed -e "s/^.*\\[\\(libGL\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_GL:+false} : -then : - ac_cv_lib_soname_GL=`$LDD conftest$ac_exeext | grep "libGL\\.$LIBEXT" | sed -e "s/^.*\(libGL\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_GL= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_GL:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - if test -f /usr/X11R6/lib/libGL.a - then - opengl_msg="/usr/X11R6/lib/libGL.a is present on your system. -This probably prevents linking to OpenGL. Try deleting the file and restarting configure." - else - opengl_msg="No OpenGL library found on this system." - fi -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_GL" >&5 -printf "%s\n" "$ac_cv_lib_soname_GL" >&6; } - -printf "%s\n" "#define SONAME_LIBGL \"$ac_cv_lib_soname_GL\"" >>confdefs.h - - OPENGL_LIBS="-Xlinker -dylib_file -Xlinker /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -lGL" ;; -esac -fi -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_GL" >&5 -printf "%s\n" "$ac_cv_lib_soname_GL" >&6; } - -printf "%s\n" "#define SONAME_LIBGL \"$ac_cv_lib_soname_GL\"" >>confdefs.h - - OPENGL_LIBS="-lGL" ;; -esac -fi - if test "x$with_osmesa" != "xno" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lOSMesa" >&5 -printf %s "checking for -lOSMesa... " >&6; } -if test ${ac_cv_lib_soname_OSMesa+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lOSMesa $X_LIBS -lm $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char OSMesaGetProcAddress (void); -int -main (void) -{ -return OSMesaGetProcAddress (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_OSMesa=`$ac_cv_path_LDD conftest.exe | grep "OSMesa" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_OSMesa=`$OTOOL -L conftest$ac_exeext | grep "libOSMesa\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libOSMesa\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_OSMesa=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libOSMesa\\.$LIBEXT" | sed -e "s/^.*\\[\\(libOSMesa\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_OSMesa:+false} : -then : - ac_cv_lib_soname_OSMesa=`$LDD conftest$ac_exeext | grep "libOSMesa\\.$LIBEXT" | sed -e "s/^.*\(libOSMesa\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_OSMesa= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_OSMesa:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_OSMesa" >&5 -printf "%s\n" "$ac_cv_lib_soname_OSMesa" >&6; } - -printf "%s\n" "#define SONAME_LIBOSMESA \"$ac_cv_lib_soname_OSMesa\"" >>confdefs.h - - ;; -esac -fi - if test "x$ac_cv_lib_soname_OSMesa" = "x" -then : - case "x$with_osmesa" in - x) as_fn_append wine_notices "|libOSMesa ${notice_platform}development files not found (or too old), OpenGL rendering in bitmaps won't be supported." ;; - xno) ;; - *) as_fn_error $? "libOSMesa ${notice_platform}development files not found (or too old), OpenGL rendering in bitmaps won't be supported. -This is an error since --with-osmesa was requested." "$LINENO" 5 ;; -esac - -fi - fi - fi - if test -n "$opengl_msg" -then : - case "x$with_opengl" in - x) as_fn_append wine_warnings "|$opengl_msg -OpenGL and Direct3D won't be supported." ;; - xno) ;; - *) as_fn_error $? "$opengl_msg -OpenGL and Direct3D won't be supported. -This is an error since --with-opengl was requested." "$LINENO" 5 ;; -esac - -fi - - CPPFLAGS="$ac_save_CPPFLAGS" -else - X_CFLAGS="" - X_LIBS="" -fi - -if test "x$with_wayland" != "xno" -then - rm -f conftest.err -if ${WAYLAND_CLIENT_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - WAYLAND_CLIENT_CFLAGS=`$PKG_CONFIG --cflags wayland-client 2>conftest.err` -fi -fi - -if ${WAYLAND_CLIENT_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - WAYLAND_CLIENT_LIBS=`$PKG_CONFIG --libs wayland-client 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: wayland-client cflags: $WAYLAND_CLIENT_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: wayland-client libs: $WAYLAND_CLIENT_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: wayland-client errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $WAYLAND_CLIENT_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "wayland-client.h" "ac_cv_header_wayland_client_h" "$ac_includes_default" -if test "x$ac_cv_header_wayland_client_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wl_display_connect in -lwayland-client" >&5 -printf %s "checking for wl_display_connect in -lwayland-client... " >&6; } -if test ${ac_cv_lib_wayland_client_wl_display_connect+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lwayland-client $WAYLAND_CLIENT_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char wl_display_connect (void); -int -main (void) -{ -return wl_display_connect (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_wayland_client_wl_display_connect=yes -else case e in #( - e) ac_cv_lib_wayland_client_wl_display_connect=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wayland_client_wl_display_connect" >&5 -printf "%s\n" "$ac_cv_lib_wayland_client_wl_display_connect" >&6; } -if test "x$ac_cv_lib_wayland_client_wl_display_connect" = xyes -then : - # Extract the first word of "wayland-scanner", so it can be a program name with args. -set dummy wayland-scanner; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_WAYLAND_SCANNER+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) case $WAYLAND_SCANNER in - [\\/]* | ?:[\\/]*) - ac_cv_path_WAYLAND_SCANNER="$WAYLAND_SCANNER" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_WAYLAND_SCANNER="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_WAYLAND_SCANNER" && ac_cv_path_WAYLAND_SCANNER="`test -n "$PKG_CONFIG" && $PKG_CONFIG --variable=wayland_scanner wayland-scanner 2>/dev/null`" - ;; -esac ;; -esac -fi -WAYLAND_SCANNER=$ac_cv_path_WAYLAND_SCANNER -if test -n "$WAYLAND_SCANNER"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $WAYLAND_SCANNER" >&5 -printf "%s\n" "$WAYLAND_SCANNER" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -else case e in #( - e) WAYLAND_CLIENT_LIBS="" ;; -esac -fi - -fi - -CPPFLAGS=$ac_save_CPPFLAGS - - rm -f conftest.err -if ${XKBCOMMON_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - XKBCOMMON_CFLAGS=`$PKG_CONFIG --cflags xkbcommon 2>conftest.err` -fi -fi - -if ${XKBCOMMON_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - XKBCOMMON_LIBS=`$PKG_CONFIG --libs xkbcommon 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: xkbcommon cflags: $XKBCOMMON_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: xkbcommon libs: $XKBCOMMON_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: xkbcommon errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $XKBCOMMON_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "xkbcommon/xkbcommon.h" "ac_cv_header_xkbcommon_xkbcommon_h" "$ac_includes_default" -if test "x$ac_cv_header_xkbcommon_xkbcommon_h" = xyes -then : - printf "%s\n" "#define HAVE_XKBCOMMON_XKBCOMMON_H 1" >>confdefs.h - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for xkb_context_new in -lxkbcommon" >&5 -printf %s "checking for xkb_context_new in -lxkbcommon... " >&6; } -if test ${ac_cv_lib_xkbcommon_xkb_context_new+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lxkbcommon $XKBCOMMON_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char xkb_context_new (void); -int -main (void) -{ -return xkb_context_new (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_xkbcommon_xkb_context_new=yes -else case e in #( - e) ac_cv_lib_xkbcommon_xkb_context_new=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xkbcommon_xkb_context_new" >&5 -printf "%s\n" "$ac_cv_lib_xkbcommon_xkb_context_new" >&6; } -if test "x$ac_cv_lib_xkbcommon_xkb_context_new" = xyes -then : - : -else case e in #( - e) XKBCOMMON_LIBS="" ;; -esac -fi - -CPPFLAGS=$ac_save_CPPFLAGS - - rm -f conftest.err -if ${XKBREGISTRY_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - XKBREGISTRY_CFLAGS=`$PKG_CONFIG --cflags xkbregistry 2>conftest.err` -fi -fi - -if ${XKBREGISTRY_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - XKBREGISTRY_LIBS=`$PKG_CONFIG --libs xkbregistry 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: xkbregistry cflags: $XKBREGISTRY_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: xkbregistry libs: $XKBREGISTRY_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: xkbregistry errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $XKBREGISTRY_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "xkbcommon/xkbregistry.h" "ac_cv_header_xkbcommon_xkbregistry_h" "$ac_includes_default" -if test "x$ac_cv_header_xkbcommon_xkbregistry_h" = xyes -then : - printf "%s\n" "#define HAVE_XKBCOMMON_XKBREGISTRY_H 1" >>confdefs.h - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for rxkb_context_new in -lxkbregistry" >&5 -printf %s "checking for rxkb_context_new in -lxkbregistry... " >&6; } -if test ${ac_cv_lib_xkbregistry_rxkb_context_new+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lxkbregistry $XKBREGISTRY_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char rxkb_context_new (void); -int -main (void) -{ -return rxkb_context_new (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_xkbregistry_rxkb_context_new=yes -else case e in #( - e) ac_cv_lib_xkbregistry_rxkb_context_new=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xkbregistry_rxkb_context_new" >&5 -printf "%s\n" "$ac_cv_lib_xkbregistry_rxkb_context_new" >&6; } -if test "x$ac_cv_lib_xkbregistry_rxkb_context_new" = xyes -then : - : -else case e in #( - e) XKBREGISTRY_LIBS="" ;; -esac -fi - -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$with_opengl" != "xno" - then - rm -f conftest.err -if ${EGL_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - EGL_CFLAGS=`$PKG_CONFIG --cflags egl 2>conftest.err` -fi -fi - -if ${EGL_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - EGL_LIBS=`$PKG_CONFIG --libs egl 2>/dev/null` -fi -fi - -EGL_LIBS=${EGL_LIBS:-"-lEGL"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: egl cflags: $EGL_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: egl libs: $EGL_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: egl errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $EGL_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "EGL/egl.h" "ac_cv_header_EGL_egl_h" "$ac_includes_default" -if test "x$ac_cv_header_EGL_egl_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lEGL" >&5 -printf %s "checking for -lEGL... " >&6; } -if test ${ac_cv_lib_soname_EGL+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lEGL $EGL_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char eglGetProcAddress (void); -int -main (void) -{ -return eglGetProcAddress (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_EGL=`$ac_cv_path_LDD conftest.exe | grep "EGL" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_EGL=`$OTOOL -L conftest$ac_exeext | grep "libEGL\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libEGL\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_EGL=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libEGL\\.$LIBEXT" | sed -e "s/^.*\\[\\(libEGL\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_EGL:+false} : -then : - ac_cv_lib_soname_EGL=`$LDD conftest$ac_exeext | grep "libEGL\\.$LIBEXT" | sed -e "s/^.*\(libEGL\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_EGL= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_EGL:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_EGL" >&5 -printf "%s\n" "$ac_cv_lib_soname_EGL" >&6; } - -printf "%s\n" "#define SONAME_LIBEGL \"$ac_cv_lib_soname_EGL\"" >>confdefs.h - - ;; -esac -fi -fi - -CPPFLAGS=$ac_save_CPPFLAGS - - rm -f conftest.err -if ${WAYLAND_EGL_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - WAYLAND_EGL_CFLAGS=`$PKG_CONFIG --cflags wayland-egl 2>conftest.err` -fi -fi - -if ${WAYLAND_EGL_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - WAYLAND_EGL_LIBS=`$PKG_CONFIG --libs wayland-egl 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: wayland-egl cflags: $WAYLAND_EGL_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: wayland-egl libs: $WAYLAND_EGL_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: wayland-egl errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $WAYLAND_EGL_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "wayland-egl.h" "ac_cv_header_wayland_egl_h" "$ac_includes_default" -if test "x$ac_cv_header_wayland_egl_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wl_egl_window_create in -lwayland-egl" >&5 -printf %s "checking for wl_egl_window_create in -lwayland-egl... " >&6; } -if test ${ac_cv_lib_wayland_egl_wl_egl_window_create+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lwayland-egl $WAYLAND_EGL_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char wl_egl_window_create (void); -int -main (void) -{ -return wl_egl_window_create (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_wayland_egl_wl_egl_window_create=yes -else case e in #( - e) ac_cv_lib_wayland_egl_wl_egl_window_create=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wayland_egl_wl_egl_window_create" >&5 -printf "%s\n" "$ac_cv_lib_wayland_egl_wl_egl_window_create" >&6; } -if test "x$ac_cv_lib_wayland_egl_wl_egl_window_create" = xyes -then : - -printf "%s\n" "#define HAVE_LIBWAYLAND_EGL 1" >>confdefs.h - -else case e in #( - e) WAYLAND_EGL_LIBS="" ;; -esac -fi - -fi - -CPPFLAGS=$ac_save_CPPFLAGS - - if test "x$with_wayland" != "x" - then - if test -z "$ac_cv_lib_soname_EGL" -o "$ac_cv_lib_wayland_egl_wl_egl_window_create" != yes -then : - case "x$with_opengl" in - x) as_fn_append wine_notices "|EGL ${notice_platform}development files not found, the Wayland driver won't support OpenGL" ;; - xno) ;; - *) as_fn_error $? "EGL ${notice_platform}development files not found, the Wayland driver won't support OpenGL -This is an error since --with-opengl was requested." "$LINENO" 5 ;; -esac - -fi - fi - fi -fi -if test -z "$WAYLAND_CLIENT_LIBS" -o -z "$WAYLAND_SCANNER" -o -z "$XKBCOMMON_LIBS" -o -z "$XKBREGISTRY_LIBS" -o "$ac_cv_header_linux_input_h" = "no" -then : - case "x$with_wayland" in - x) as_fn_append wine_notices "|Wayland ${notice_platform}development files not found, the Wayland driver won't be supported." ;; - xno) ;; - *) as_fn_error $? "Wayland ${notice_platform}development files not found, the Wayland driver won't be supported. -This is an error since --with-wayland was requested." "$LINENO" 5 ;; -esac -enable_winewayland_drv=${enable_winewayland_drv:-no} -fi - -if test "$enable_wineandroid_drv$enable_winemac_drv$enable_winewayland_drv" = "nonono" -then - if test "x$X_LIBS" = "x" -then : - case "x$with_x" in - xno) ;; - *) as_fn_error $? "X ${notice_platform}development files not found. Wine will be built -without X support, which probably isn't what you want. You will need -to install ${notice_platform}development packages of Xlib at the very least. -Use the --without-x option if you really want this." "$LINENO" 5 ;; -esac -enable_winex11_drv=${enable_winex11_drv:-no} -fi -else - if test "x$X_LIBS" = "x" -then : - case "x$with_x" in - x) as_fn_append wine_notices "|X ${notice_platform}development files not found, the X11 driver won't be supported." ;; - xno) ;; - *) as_fn_error $? "X ${notice_platform}development files not found, the X11 driver won't be supported. -This is an error since --with-x was requested." "$LINENO" 5 ;; -esac -enable_winex11_drv=${enable_winex11_drv:-no} -fi -fi - -if test "$ac_cv_header_CL_cl_h" = "yes" -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clGetPlatformInfo in -lOpenCL" >&5 -printf %s "checking for clGetPlatformInfo in -lOpenCL... " >&6; } -if test ${ac_cv_lib_OpenCL_clGetPlatformInfo+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lOpenCL $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char clGetPlatformInfo (void); -int -main (void) -{ -return clGetPlatformInfo (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_OpenCL_clGetPlatformInfo=yes -else case e in #( - e) ac_cv_lib_OpenCL_clGetPlatformInfo=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_OpenCL_clGetPlatformInfo" >&5 -printf "%s\n" "$ac_cv_lib_OpenCL_clGetPlatformInfo" >&6; } -if test "x$ac_cv_lib_OpenCL_clGetPlatformInfo" = xyes -then : - OPENCL_LIBS="-lOpenCL" - -fi - -fi -if test "x$ac_cv_lib_OpenCL_clGetPlatformInfo" != xyes -then : - case "x$with_opencl" in - x) as_fn_append wine_notices "|OpenCL ${notice_platform}development files not found, OpenCL won't be supported." ;; - xno) ;; - *) as_fn_error $? "OpenCL ${notice_platform}development files not found, OpenCL won't be supported. -This is an error since --with-opencl was requested." "$LINENO" 5 ;; -esac -enable_opencl=${enable_opencl:-no} -fi - -if test "$ac_cv_header_pcap_pcap_h" = "yes" -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pcap_init in -lpcap" >&5 -printf %s "checking for pcap_init in -lpcap... " >&6; } -if test ${ac_cv_lib_pcap_pcap_init+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcap $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char pcap_init (void); -int -main (void) -{ -return pcap_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_pcap_pcap_init=yes -else case e in #( - e) ac_cv_lib_pcap_pcap_init=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcap_pcap_init" >&5 -printf "%s\n" "$ac_cv_lib_pcap_pcap_init" >&6; } -if test "x$ac_cv_lib_pcap_pcap_init" = xyes -then : - PCAP_LIBS="-lpcap" - -fi - -fi -if test "x$ac_cv_lib_pcap_pcap_init" != xyes -then : - case "x$with_pcap" in - x) as_fn_append wine_notices "|pcap ${notice_platform}development files not found, wpcap won't be supported." ;; - xno) ;; - *) as_fn_error $? "pcap ${notice_platform}development files not found, wpcap won't be supported. -This is an error since --with-pcap was requested." "$LINENO" 5 ;; -esac -enable_wpcap=${enable_wpcap:-no} -fi - -if test "x$with_pcsclite" != "xno" -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SCardEstablishContext in -lpcsclite" >&5 -printf %s "checking for SCardEstablishContext in -lpcsclite... " >&6; } -if test ${ac_cv_lib_pcsclite_SCardEstablishContext+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcsclite $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char SCardEstablishContext (void); -int -main (void) -{ -return SCardEstablishContext (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_pcsclite_SCardEstablishContext=yes -else case e in #( - e) ac_cv_lib_pcsclite_SCardEstablishContext=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcsclite_SCardEstablishContext" >&5 -printf "%s\n" "$ac_cv_lib_pcsclite_SCardEstablishContext" >&6; } -if test "x$ac_cv_lib_pcsclite_SCardEstablishContext" = xyes -then : - PCSCLITE_LIBS="-lpcsclite" - -else case e in #( - e) case $host_os in - darwin*|macosx*) PCSCLITE_LIBS="-framework PCSC" - ;; - esac ;; -esac -fi - -fi -if test "x$PCSCLITE_LIBS" = x -then : - case "x$with_pcsclite" in - x) as_fn_append wine_notices "|libpcsclite not found, smart cards won't be supported." ;; - xno) ;; - *) as_fn_error $? "libpcsclite not found, smart cards won't be supported. -This is an error since --with-pcsclite was requested." "$LINENO" 5 ;; -esac -enable_winscard=${enable_winscard:-no} -fi - -if test "x$with_inotify" != "xno" -then - rm -f conftest.err -if ${INOTIFY_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - INOTIFY_CFLAGS=`$PKG_CONFIG --cflags libinotify 2>conftest.err` -fi -fi - -if ${INOTIFY_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - INOTIFY_LIBS=`$PKG_CONFIG --libs libinotify 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libinotify cflags: $INOTIFY_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libinotify libs: $INOTIFY_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: libinotify errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $INOTIFY_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_inotify_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_INOTIFY_H 1" >>confdefs.h - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inotify_add_watch in -linotify" >&5 -printf %s "checking for inotify_add_watch in -linotify... " >&6; } -if test ${ac_cv_lib_inotify_inotify_add_watch+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-linotify $INOTIFY_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char inotify_add_watch (void); -int -main (void) -{ -return inotify_add_watch (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_inotify_inotify_add_watch=yes -else case e in #( - e) ac_cv_lib_inotify_inotify_add_watch=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inotify_inotify_add_watch" >&5 -printf "%s\n" "$ac_cv_lib_inotify_inotify_add_watch" >&6; } -if test "x$ac_cv_lib_inotify_inotify_add_watch" = xyes -then : - : -else case e in #( - e) INOTIFY_LIBS="" ;; -esac -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "$ac_cv_header_sys_inotify_h" != "yes" -then : - case "x$with_inotify" in - x) as_fn_append wine_notices "|libinotify ${notice_platform}development files not found (or too old), filesystem change notifications won't be supported." ;; - xno) ;; - *) as_fn_error $? "libinotify ${notice_platform}development files not found (or too old), filesystem change notifications won't be supported. -This is an error since --with-inotify was requested." "$LINENO" 5 ;; -esac - -fi - -if test "x$with_dbus" != "xno" -then - rm -f conftest.err -if ${DBUS_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - DBUS_CFLAGS=`$PKG_CONFIG --cflags dbus-1 2>conftest.err` -fi -fi - -if ${DBUS_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - DBUS_LIBS=`$PKG_CONFIG --libs dbus-1 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: dbus-1 cflags: $DBUS_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: dbus-1 libs: $DBUS_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: dbus-1 errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $DBUS_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "dbus/dbus.h" "ac_cv_header_dbus_dbus_h" "$ac_includes_default" -if test "x$ac_cv_header_dbus_dbus_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -ldbus-1" >&5 -printf %s "checking for -ldbus-1... " >&6; } -if test ${ac_cv_lib_soname_dbus_1+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-ldbus-1 $DBUS_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char dbus_connection_close (void); -int -main (void) -{ -return dbus_connection_close (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_dbus_1=`$ac_cv_path_LDD conftest.exe | grep "dbus-1" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_dbus_1=`$OTOOL -L conftest$ac_exeext | grep "libdbus-1\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libdbus-1\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_dbus_1=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libdbus-1\\.$LIBEXT" | sed -e "s/^.*\\[\\(libdbus-1\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_dbus_1:+false} : -then : - ac_cv_lib_soname_dbus_1=`$LDD conftest$ac_exeext | grep "libdbus-1\\.$LIBEXT" | sed -e "s/^.*\(libdbus-1\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_dbus_1= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_dbus_1:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - DBUS_CFLAGS="" -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_dbus_1" >&5 -printf "%s\n" "$ac_cv_lib_soname_dbus_1" >&6; } - -printf "%s\n" "#define SONAME_LIBDBUS_1 \"$ac_cv_lib_soname_dbus_1\"" >>confdefs.h - - ;; -esac -fi -else case e in #( - e) DBUS_CFLAGS="" ;; -esac -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -case $host_os in - darwin*|macosx*) ;; - *) if test "x$ac_cv_lib_soname_dbus_1" = "x" -then : - case "x$with_dbus" in - x) as_fn_append wine_notices "|libdbus ${notice_platform}development files not found, no dynamic device support." ;; - xno) ;; - *) as_fn_error $? "libdbus ${notice_platform}development files not found, no dynamic device support. -This is an error since --with-dbus was requested." "$LINENO" 5 ;; -esac - -fi ;; -esac - -if test "x$with_gnutls" != "xno" -then - rm -f conftest.err -if ${GNUTLS_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GNUTLS_CFLAGS=`$PKG_CONFIG --cflags gnutls 2>conftest.err` -fi -fi - -if ${GNUTLS_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GNUTLS_LIBS=`$PKG_CONFIG --libs gnutls 2>/dev/null` -fi -fi - -GNUTLS_LIBS=${GNUTLS_LIBS:-"-lgnutls"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: gnutls cflags: $GNUTLS_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: gnutls libs: $GNUTLS_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: gnutls errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $GNUTLS_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "gnutls/gnutls.h" "ac_cv_header_gnutls_gnutls_h" "$ac_includes_default" -if test "x$ac_cv_header_gnutls_gnutls_h" = xyes -then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main (void) -{ -static typeof(gnutls_mac_get_key_size) *func; if (func) return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lgnutls" >&5 -printf %s "checking for -lgnutls... " >&6; } -if test ${ac_cv_lib_soname_gnutls+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lgnutls $GNUTLS_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char gnutls_global_init (void); -int -main (void) -{ -return gnutls_global_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_gnutls=`$ac_cv_path_LDD conftest.exe | grep "gnutls" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_gnutls=`$OTOOL -L conftest$ac_exeext | grep "libgnutls\\(-deb0\\)\\{0,1\\}\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libgnutls\\(-deb0\\)\\{0,1\\}\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_gnutls=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libgnutls\\(-deb0\\)\\{0,1\\}\\.$LIBEXT" | sed -e "s/^.*\\[\\(libgnutls\\(-deb0\\)\\{0,1\\}\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_gnutls:+false} : -then : - ac_cv_lib_soname_gnutls=`$LDD conftest$ac_exeext | grep "libgnutls\\(-deb0\\)\\{0,1\\}\\.$LIBEXT" | sed -e "s/^.*\(libgnutls\\(-deb0\\)\\{0,1\\}\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_gnutls= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_gnutls:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - GNUTLS_CFLAGS="" -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_gnutls" >&5 -printf "%s\n" "$ac_cv_lib_soname_gnutls" >&6; } - -printf "%s\n" "#define SONAME_LIBGNUTLS \"$ac_cv_lib_soname_gnutls\"" >>confdefs.h - - ;; -esac -fi - ac_wine_check_funcs_save_LIBS="$LIBS" -LIBS="$LIBS $GNUTLS_LIBS" - - for ac_func in gnutls_cipher_init -do : - ac_fn_c_check_func "$LINENO" "gnutls_cipher_init" "ac_cv_func_gnutls_cipher_init" -if test "x$ac_cv_func_gnutls_cipher_init" = xyes -then : - printf "%s\n" "#define HAVE_GNUTLS_CIPHER_INIT 1" >>confdefs.h - -else case e in #( - e) as_fn_append wine_notices "|libgnutls ${notice_platform}development files too old, bcrypt encryption won't be supported." ;; -esac -fi - -done -LIBS="$ac_wine_check_funcs_save_LIBS" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -else case e in #( - e) GNUTLS_CFLAGS="" ;; -esac -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_cv_lib_soname_gnutls" = "x" -then : - case "x$with_gnutls" in - x) as_fn_append wine_warnings "|libgnutls ${notice_platform}development files not found, no schannel support." ;; - xno) ;; - *) as_fn_error $? "libgnutls ${notice_platform}development files not found, no schannel support. -This is an error since --with-gnutls was requested." "$LINENO" 5 ;; -esac - -fi - -if test "x$with_sane" != "xno" -then - rm -f conftest.err -if ${SANE_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - SANE_CFLAGS=`$PKG_CONFIG --cflags sane-backends 2>conftest.err` -fi -fi -test "$cross_compiling" = yes || SANE_CFLAGS=${SANE_CFLAGS:-`${SANE_CONFIG:-sane-config} --cflags 2>/dev/null`} -if ${SANE_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - SANE_LIBS=`$PKG_CONFIG --libs sane-backends 2>/dev/null` -fi -fi -test "$cross_compiling" = yes || SANE_LIBS=${SANE_LIBS:-`${SANE_CONFIG:-sane-config} --ldflags 2>/dev/null`} - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: sane-backends cflags: $SANE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: sane-backends libs: $SANE_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: sane-backends errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $SANE_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "sane/sane.h" "ac_cv_header_sane_sane_h" "$ac_includes_default" -if test "x$ac_cv_header_sane_sane_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sane_init in -lsane" >&5 -printf %s "checking for sane_init in -lsane... " >&6; } -if test ${ac_cv_lib_sane_sane_init+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lsane $SANE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char sane_init (void); -int -main (void) -{ -return sane_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_sane_sane_init=yes -else case e in #( - e) ac_cv_lib_sane_sane_init=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sane_sane_init" >&5 -printf "%s\n" "$ac_cv_lib_sane_sane_init" >&6; } -if test "x$ac_cv_lib_sane_sane_init" = xyes -then : - : -fi - -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "$ac_cv_lib_sane_sane_init" != "yes" -then : - case "x$with_sane" in - x) as_fn_append wine_notices "|libsane ${notice_platform}development files not found, scanners won't be supported." ;; - xno) ;; - *) as_fn_error $? "libsane ${notice_platform}development files not found, scanners won't be supported. -This is an error since --with-sane was requested." "$LINENO" 5 ;; -esac -enable_sane_ds=${enable_sane_ds:-no} -fi - -if test "x$with_usb" != "xno" -then - rm -f conftest.err -if ${USB_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - USB_CFLAGS=`$PKG_CONFIG --cflags libusb-1.0 2>conftest.err` -fi -fi - -if ${USB_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - USB_LIBS=`$PKG_CONFIG --libs libusb-1.0 2>/dev/null` -fi -fi - -USB_LIBS=${USB_LIBS:-"-lusb-1.0"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libusb-1.0 cflags: $USB_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libusb-1.0 libs: $USB_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: libusb-1.0 errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $USB_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "libusb.h" "ac_cv_header_libusb_h" "$ac_includes_default" -if test "x$ac_cv_header_libusb_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libusb_interrupt_event_handler in -lusb-1.0" >&5 -printf %s "checking for libusb_interrupt_event_handler in -lusb-1.0... " >&6; } -if test ${ac_cv_lib_usb_1_0_libusb_interrupt_event_handler+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lusb-1.0 $USB_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char libusb_interrupt_event_handler (void); -int -main (void) -{ -return libusb_interrupt_event_handler (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_usb_1_0_libusb_interrupt_event_handler=yes -else case e in #( - e) ac_cv_lib_usb_1_0_libusb_interrupt_event_handler=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usb_1_0_libusb_interrupt_event_handler" >&5 -printf "%s\n" "$ac_cv_lib_usb_1_0_libusb_interrupt_event_handler" >&6; } -if test "x$ac_cv_lib_usb_1_0_libusb_interrupt_event_handler" = xyes -then : - : -else case e in #( - e) USB_LIBS="" ;; -esac -fi - -else case e in #( - e) USB_LIBS="" ;; -esac -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "$ac_cv_lib_usb_1_0_libusb_interrupt_event_handler" != "yes" -then : - case "x$with_usb" in - x) as_fn_append wine_notices "|libusb-1.0 ${notice_platform}development files not found (or too old), USB devices won't be supported." ;; - xno) ;; - *) as_fn_error $? "libusb-1.0 ${notice_platform}development files not found (or too old), USB devices won't be supported. -This is an error since --with-usb was requested." "$LINENO" 5 ;; -esac -enable_wineusb_sys=${enable_wineusb_sys:-no} -fi - -if test "x$with_v4l2" != "xno" -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lv4l2" >&5 -printf %s "checking for -lv4l2... " >&6; } -if test ${ac_cv_lib_soname_v4l2+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lv4l2 $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char v4l2_open (void); -int -main (void) -{ -return v4l2_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_v4l2=`$ac_cv_path_LDD conftest.exe | grep "v4l2" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_v4l2=`$OTOOL -L conftest$ac_exeext | grep "libv4l2\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libv4l2\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_v4l2=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libv4l2\\.$LIBEXT" | sed -e "s/^.*\\[\\(libv4l2\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_v4l2:+false} : -then : - ac_cv_lib_soname_v4l2=`$LDD conftest$ac_exeext | grep "libv4l2\\.$LIBEXT" | sed -e "s/^.*\(libv4l2\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_v4l2= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_v4l2:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_v4l2" >&5 -printf "%s\n" "$ac_cv_lib_soname_v4l2" >&6; } - -printf "%s\n" "#define SONAME_LIBV4L2 \"$ac_cv_lib_soname_v4l2\"" >>confdefs.h - - ;; -esac -fi -fi -if test "x$ac_cv_lib_soname_v4l2" = "x" -then : - case "x$with_v4l2" in - x) as_fn_append wine_notices "|libv4l2 ${notice_platform}development files not found." ;; - xno) ;; - *) as_fn_error $? "libv4l2 ${notice_platform}development files not found. -This is an error since --with-v4l2 was requested." "$LINENO" 5 ;; -esac - -fi - -if test "x$with_gphoto" != "xno" -then - rm -f conftest.err -if ${GPHOTO2_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GPHOTO2_CFLAGS=`$PKG_CONFIG --cflags libgphoto2 2>conftest.err` -fi -fi -test "$cross_compiling" = yes || GPHOTO2_CFLAGS=${GPHOTO2_CFLAGS:-`${GPHOTO2_CONFIG:-gphoto2-config} --cflags 2>/dev/null`} -if ${GPHOTO2_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GPHOTO2_LIBS=`$PKG_CONFIG --libs libgphoto2 2>/dev/null` -fi -fi -test "$cross_compiling" = yes || GPHOTO2_LIBS=${GPHOTO2_LIBS:-`${GPHOTO2_CONFIG:-gphoto2-config} --libs 2>/dev/null`} -GPHOTO2_LIBS=${GPHOTO2_LIBS:-"-lgphoto2"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libgphoto2 cflags: $GPHOTO2_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libgphoto2 libs: $GPHOTO2_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: libgphoto2 errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $GPHOTO2_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "gphoto2-camera.h" "ac_cv_header_gphoto2_camera_h" "$ac_includes_default" -if test "x$ac_cv_header_gphoto2_camera_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gp_camera_new in -lgphoto2" >&5 -printf %s "checking for gp_camera_new in -lgphoto2... " >&6; } -if test ${ac_cv_lib_gphoto2_gp_camera_new+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lgphoto2 $GPHOTO2_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char gp_camera_new (void); -int -main (void) -{ -return gp_camera_new (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_gphoto2_gp_camera_new=yes -else case e in #( - e) ac_cv_lib_gphoto2_gp_camera_new=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gphoto2_gp_camera_new" >&5 -printf "%s\n" "$ac_cv_lib_gphoto2_gp_camera_new" >&6; } -if test "x$ac_cv_lib_gphoto2_gp_camera_new" = xyes -then : - : -fi - -fi - -CPPFLAGS=$ac_save_CPPFLAGS - - rm -f conftest.err -if ${GPHOTO2_PORT_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GPHOTO2_PORT_CFLAGS=`$PKG_CONFIG --cflags libgphoto2_port 2>conftest.err` -fi -fi -test "$cross_compiling" = yes || GPHOTO2_PORT_CFLAGS=${GPHOTO2_PORT_CFLAGS:-`${GPHOTO2_PORT_CONFIG:-gphoto2-port-config} --cflags 2>/dev/null`} -if ${GPHOTO2_PORT_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GPHOTO2_PORT_LIBS=`$PKG_CONFIG --libs libgphoto2_port 2>/dev/null` -fi -fi -test "$cross_compiling" = yes || GPHOTO2_PORT_LIBS=${GPHOTO2_PORT_LIBS:-`${GPHOTO2_PORT_CONFIG:-gphoto2-port-config} --libs 2>/dev/null`} -GPHOTO2_PORT_LIBS=${GPHOTO2_PORT_LIBS:-"-lgphoto2_port"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libgphoto2_port cflags: $GPHOTO2_PORT_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libgphoto2_port libs: $GPHOTO2_PORT_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: libgphoto2_port errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $GPHOTO2_PORT_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "gphoto2-port.h" "ac_cv_header_gphoto2_port_h" "$ac_includes_default" -if test "x$ac_cv_header_gphoto2_port_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gp_port_info_list_new in -lgphoto2_port" >&5 -printf %s "checking for gp_port_info_list_new in -lgphoto2_port... " >&6; } -if test ${ac_cv_lib_gphoto2_port_gp_port_info_list_new+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lgphoto2_port $GPHOTO2_PORT_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char gp_port_info_list_new (void); -int -main (void) -{ -return gp_port_info_list_new (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_gphoto2_port_gp_port_info_list_new=yes -else case e in #( - e) ac_cv_lib_gphoto2_port_gp_port_info_list_new=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gphoto2_port_gp_port_info_list_new" >&5 -printf "%s\n" "$ac_cv_lib_gphoto2_port_gp_port_info_list_new" >&6; } -if test "x$ac_cv_lib_gphoto2_port_gp_port_info_list_new" = xyes -then : - -printf "%s\n" "#define HAVE_GPHOTO2_PORT 1" >>confdefs.h - -else case e in #( - e) GPHOTO2_PORT_LIBS=""; GPHOTO2_PORT_CFLAGS="" ;; -esac -fi - -else case e in #( - e) GPHOTO2_PORT_LIBS=""; GPHOTO2_PORT_CFLAGS="" ;; -esac -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "$ac_cv_lib_gphoto2_gp_camera_new" != "yes" -then : - case "x$with_gphoto" in - x) as_fn_append wine_notices "|libgphoto2 ${notice_platform}development files not found, digital cameras won't be supported." ;; - xno) ;; - *) as_fn_error $? "libgphoto2 ${notice_platform}development files not found, digital cameras won't be supported. -This is an error since --with-gphoto was requested." "$LINENO" 5 ;; -esac -enable_gphoto2_ds=${enable_gphoto2_ds:-no} -fi -if test "$ac_cv_lib_gphoto2_port_gp_port_info_list_new" != "yes" -then : - case "x$with_gphoto" in - x) as_fn_append wine_notices "|libgphoto2_port ${notice_platform}development files not found, digital cameras won't be auto-detected." ;; - xno) ;; - *) as_fn_error $? "libgphoto2_port ${notice_platform}development files not found, digital cameras won't be auto-detected. -This is an error since --with-gphoto was requested." "$LINENO" 5 ;; -esac - -fi - - -if test "$ac_cv_header_resolv_h" = "yes" -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for resolver library" >&5 -printf %s "checking for resolver library... " >&6; } -if test ${ac_cv_have_resolv+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_save_LIBS="$LIBS" - for lib in '' -lresolv - do - LIBS="$lib $ac_save_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef HAVE_NETINET_IN_H -#include -#endif -#include -int -main (void) -{ -if (!(_res.options & RES_INIT)) res_init(); res_query("foo",ns_c_in,0,0,0); ns_initparse(0,0,0) - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_have_resolv=${lib:-"none required"} -else case e in #( - e) ac_cv_have_resolv="not found" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - test "x$ac_cv_have_resolv" = "xnot found" || break - done - LIBS="$ac_save_LIBS" ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_resolv" >&5 -printf "%s\n" "$ac_cv_have_resolv" >&6; } - - case "$ac_cv_have_resolv" in - "not found") ;; - "none required") - -printf "%s\n" "#define HAVE_RESOLV 1" >>confdefs.h - ;; - *) - printf "%s\n" "#define HAVE_RESOLV 1" >>confdefs.h - - RESOLV_LIBS=$ac_cv_have_resolv - ;; - esac - - if test "x$ac_cv_have_resolv" != "xnot found" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for res_getservers" >&5 -printf %s "checking for res_getservers... " >&6; } -if test ${ac_cv_have_res_getservers+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_save_LIBS="$LIBS" - LIBS="$RESOLV_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -res_getservers(NULL, NULL, 0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_have_res_getservers=yes -else case e in #( - e) ac_cv_have_res_getservers=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$ac_save_LIBS" ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_res_getservers" >&5 -printf "%s\n" "$ac_cv_have_res_getservers" >&6; } - if test "$ac_cv_have_res_getservers" = "yes" - then - -printf "%s\n" "#define HAVE_RES_GETSERVERS 1" >>confdefs.h - - fi - fi -fi - -if test "x$with_freetype" != "xno" -then - rm -f conftest.err -if ${FREETYPE_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - FREETYPE_CFLAGS=`$PKG_CONFIG --cflags freetype2 2>conftest.err` -fi -fi -test "$cross_compiling" = yes || FREETYPE_CFLAGS=${FREETYPE_CFLAGS:-`(${FREETYPE_CONFIG:-freetype-config} --cflags || ${FREETYPE2_CONFIG:-freetype2-config} --cflags) 2>/dev/null`} -if ${FREETYPE_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - FREETYPE_LIBS=`$PKG_CONFIG --libs freetype2 2>/dev/null` -fi -fi -test "$cross_compiling" = yes || FREETYPE_LIBS=${FREETYPE_LIBS:-`(${FREETYPE_CONFIG:-freetype-config} --libs || ${FREETYPE2_CONFIG:-freetype2-config} --libs) 2>/dev/null`} -FREETYPE_LIBS=${FREETYPE_LIBS:-"-lfreetype"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: freetype2 cflags: $FREETYPE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: freetype2 libs: $FREETYPE_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: freetype2 errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "ft2build.h" "ac_cv_header_ft2build_h" "$ac_includes_default" -if test "x$ac_cv_header_ft2build_h" = xyes -then : - printf "%s\n" "#define HAVE_FT2BUILD_H 1" >>confdefs.h - -fi - - if test "$ac_cv_header_ft2build_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lfreetype" >&5 -printf %s "checking for -lfreetype... " >&6; } -if test ${ac_cv_lib_soname_freetype+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lfreetype $FREETYPE_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char FT_Init_FreeType (void); -int -main (void) -{ -return FT_Init_FreeType (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_freetype=`$ac_cv_path_LDD conftest.exe | grep "freetype" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_freetype=`$OTOOL -L conftest$ac_exeext | grep "libfreetype\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libfreetype\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_freetype=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libfreetype\\.$LIBEXT" | sed -e "s/^.*\\[\\(libfreetype\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_freetype:+false} : -then : - ac_cv_lib_soname_freetype=`$LDD conftest$ac_exeext | grep "libfreetype\\.$LIBEXT" | sed -e "s/^.*\(libfreetype\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_freetype= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_freetype:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - FREETYPE_LIBS="" -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_freetype" >&5 -printf "%s\n" "$ac_cv_lib_soname_freetype" >&6; } - -printf "%s\n" "#define SONAME_LIBFREETYPE \"$ac_cv_lib_soname_freetype\"" >>confdefs.h - - -printf "%s\n" "#define HAVE_FREETYPE 1" >>confdefs.h - - ac_fn_c_check_type "$LINENO" "FT_TrueTypeEngineType" "ac_cv_type_FT_TrueTypeEngineType" "#include -#include FT_MODULE_H -" -if test "x$ac_cv_type_FT_TrueTypeEngineType" = xyes -then : - -printf "%s\n" "#define HAVE_FT_TRUETYPEENGINETYPE 1" >>confdefs.h - - -fi - ;; -esac -fi - else - FREETYPE_CFLAGS="" - FREETYPE_LIBS="" - fi -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_cv_lib_soname_freetype" = x -then : - case "x$with_freetype" in - xno) ;; - *) as_fn_error $? "FreeType ${notice_platform}development files not found. Fonts will not be built. -Use the --without-freetype option if you really want this." "$LINENO" 5 ;; -esac -enable_fonts=${enable_fonts:-no} -fi - -ac_wine_check_funcs_save_LIBS="$LIBS" -LIBS="$LIBS $PTHREAD_LIBS" -ac_fn_c_check_func "$LINENO" "pthread_getthreadid_np" "ac_cv_func_pthread_getthreadid_np" -if test "x$ac_cv_func_pthread_getthreadid_np" = xyes -then : - printf "%s\n" "#define HAVE_PTHREAD_GETTHREADID_NP 1" >>confdefs.h - -fi - -LIBS="$ac_wine_check_funcs_save_LIBS" - -if test "x$enable_tools" != xno -a "x$with_gettextpo" = xyes -then - if test "$ac_cv_header_gettext_po_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for po_message_msgctxt in -lgettextpo" >&5 -printf %s "checking for po_message_msgctxt in -lgettextpo... " >&6; } -if test ${ac_cv_lib_gettextpo_po_message_msgctxt+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lgettextpo $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char po_message_msgctxt (void); -int -main (void) -{ -return po_message_msgctxt (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_gettextpo_po_message_msgctxt=yes -else case e in #( - e) ac_cv_lib_gettextpo_po_message_msgctxt=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gettextpo_po_message_msgctxt" >&5 -printf "%s\n" "$ac_cv_lib_gettextpo_po_message_msgctxt" >&6; } -if test "x$ac_cv_lib_gettextpo_po_message_msgctxt" = xyes -then : - -printf "%s\n" "#define HAVE_LIBGETTEXTPO 1" >>confdefs.h - - GETTEXTPO_LIBS="-lgettextpo" - -fi - - fi - if test "x$GETTEXTPO_LIBS" = "x" -then : - case "x$with_gettextpo" in - x) as_fn_append wine_notices "|GetText ${notice_platform}development files not found (or too old), po files can't be rebuilt." ;; - xno) ;; - *) as_fn_error $? "GetText ${notice_platform}development files not found (or too old), po files can't be rebuilt. -This is an error since --with-gettextpo was requested." "$LINENO" 5 ;; -esac - -fi - if test "$srcdir" != . -then : - case "x$with_gettextpo" in - x) as_fn_append wine_notices "|Rebuilding po files is not supported for out of tree builds." ;; - xno) ;; - *) as_fn_error $? "Rebuilding po files is not supported for out of tree builds. -This is an error since --with-gettextpo was requested." "$LINENO" 5 ;; -esac - -fi -fi - -if test "x$with_pulse" != "xno"; -then - rm -f conftest.err -if ${PULSE_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - PULSE_CFLAGS=`$PKG_CONFIG --cflags libpulse 2>conftest.err` -fi -fi - -if ${PULSE_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - PULSE_LIBS=`$PKG_CONFIG --libs libpulse 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libpulse cflags: $PULSE_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libpulse libs: $PULSE_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: libpulse errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $PULSE_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "pulse/pulseaudio.h" "ac_cv_header_pulse_pulseaudio_h" "$ac_includes_default" -if test "x$ac_cv_header_pulse_pulseaudio_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pa_stream_is_corked in -lpulse" >&5 -printf %s "checking for pa_stream_is_corked in -lpulse... " >&6; } -if test ${ac_cv_lib_pulse_pa_stream_is_corked+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lpulse $PULSE_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char pa_stream_is_corked (void); -int -main (void) -{ -return pa_stream_is_corked (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_pulse_pa_stream_is_corked=yes -else case e in #( - e) ac_cv_lib_pulse_pa_stream_is_corked=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pulse_pa_stream_is_corked" >&5 -printf "%s\n" "$ac_cv_lib_pulse_pa_stream_is_corked" >&6; } -if test "x$ac_cv_lib_pulse_pa_stream_is_corked" = xyes -then : - : -else case e in #( - e) PULSE_LIBS="" ;; -esac -fi - -else case e in #( - e) PULSE_LIBS="" ;; -esac -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test -z "$PULSE_LIBS" -then : - case "x$with_pulse" in - x) as_fn_append wine_notices "|libpulse ${notice_platform}development files not found or too old, Pulse won't be supported." ;; - xno) ;; - *) as_fn_error $? "libpulse ${notice_platform}development files not found or too old, Pulse won't be supported. -This is an error since --with-pulse was requested." "$LINENO" 5 ;; -esac -enable_winepulse_drv=${enable_winepulse_drv:-no} -fi - -if test "x$with_ffmpeg" != "xno"; -then - rm -f conftest.err -if ${FFMPEG_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - FFMPEG_CFLAGS=`$PKG_CONFIG --cflags libavutil libavformat libavcodec 2>conftest.err` -fi -fi - -if ${FFMPEG_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - FFMPEG_LIBS=`$PKG_CONFIG --libs libavutil libavformat libavcodec 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libavutil libavformat libavcodec cflags: $FFMPEG_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libavutil libavformat libavcodec libs: $FFMPEG_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: libavutil libavformat libavcodec errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $FFMPEG_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "libavutil/avutil.h" "ac_cv_header_libavutil_avutil_h" "$ac_includes_default" -if test "x$ac_cv_header_libavutil_avutil_h" = xyes -then : - printf "%s\n" "#define HAVE_LIBAVUTIL_AVUTIL_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "libavformat/avformat.h" "ac_cv_header_libavformat_avformat_h" "$ac_includes_default" -if test "x$ac_cv_header_libavformat_avformat_h" = xyes -then : - printf "%s\n" "#define HAVE_LIBAVFORMAT_AVFORMAT_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "libavcodec/avcodec.h" "ac_cv_header_libavcodec_avcodec_h" "$ac_includes_default" -if test "x$ac_cv_header_libavcodec_avcodec_h" = xyes -then : - printf "%s\n" "#define HAVE_LIBAVCODEC_AVCODEC_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "libavcodec/bsf.h" "ac_cv_header_libavcodec_bsf_h" "$ac_includes_default" -if test "x$ac_cv_header_libavcodec_bsf_h" = xyes -then : - printf "%s\n" "#define HAVE_LIBAVCODEC_BSF_H 1" >>confdefs.h - -fi - - if test "$ac_cv_header_libavutil_avutil_h" = "yes" -a "$ac_cv_header_libavformat_avformat_h" = "yes" -a "$ac_cv_header_libavcodec_avcodec_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for av_log_set_callback in -lavutil" >&5 -printf %s "checking for av_log_set_callback in -lavutil... " >&6; } -if test ${ac_cv_lib_avutil_av_log_set_callback+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lavutil $FFMPEG_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char av_log_set_callback (void); -int -main (void) -{ -return av_log_set_callback (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_avutil_av_log_set_callback=yes -else case e in #( - e) ac_cv_lib_avutil_av_log_set_callback=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avutil_av_log_set_callback" >&5 -printf "%s\n" "$ac_cv_lib_avutil_av_log_set_callback" >&6; } -if test "x$ac_cv_lib_avutil_av_log_set_callback" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for av_find_input_format in -lavformat" >&5 -printf %s "checking for av_find_input_format in -lavformat... " >&6; } -if test ${ac_cv_lib_avformat_av_find_input_format+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lavformat $FFMPEG_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char av_find_input_format (void); -int -main (void) -{ -return av_find_input_format (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_avformat_av_find_input_format=yes -else case e in #( - e) ac_cv_lib_avformat_av_find_input_format=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avformat_av_find_input_format" >&5 -printf "%s\n" "$ac_cv_lib_avformat_av_find_input_format" >&6; } -if test "x$ac_cv_lib_avformat_av_find_input_format" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for avcodec_get_name in -lavcodec" >&5 -printf %s "checking for avcodec_get_name in -lavcodec... " >&6; } -if test ${ac_cv_lib_avcodec_avcodec_get_name+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lavcodec $FFMPEG_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char avcodec_get_name (void); -int -main (void) -{ -return avcodec_get_name (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_avcodec_avcodec_get_name=yes -else case e in #( - e) ac_cv_lib_avcodec_avcodec_get_name=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_avcodec_get_name" >&5 -printf "%s\n" "$ac_cv_lib_avcodec_avcodec_get_name" >&6; } -if test "x$ac_cv_lib_avcodec_avcodec_get_name" = xyes -then : - -printf "%s\n" "#define HAVE_FFMPEG 1" >>confdefs.h - -else case e in #( - e) FFMPEG_LIBS="" ;; -esac -fi - -else case e in #( - e) FFMPEG_LIBS="" ;; -esac -fi - -else case e in #( - e) FFMPEG_LIBS="" ;; -esac -fi - - else - FFMPEG_LIBS="" - fi -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$FFMPEG_LIBS" = x -then : - case "x$with_ffmpeg" in - x) as_fn_append wine_notices "|FFmpeg ${notice_platform}development files not found." ;; - xno) ;; - *) as_fn_error $? "FFmpeg ${notice_platform}development files not found. -This is an error since --with-ffmpeg was requested." "$LINENO" 5 ;; -esac - -fi - -if test "x$with_gstreamer" != "xno" -then - rm -f conftest.err -if ${GSTREAMER_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GSTREAMER_CFLAGS=`$PKG_CONFIG --cflags gstreamer-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-tag-1.0 2>conftest.err` -fi -fi - -if ${GSTREAMER_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GSTREAMER_LIBS=`$PKG_CONFIG --libs gstreamer-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-tag-1.0 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: gstreamer-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-tag-1.0 cflags: $GSTREAMER_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: gstreamer-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-tag-1.0 libs: $GSTREAMER_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: gstreamer-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-tag-1.0 errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $GSTREAMER_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "gst/gst.h" "ac_cv_header_gst_gst_h" "$ac_includes_default" -if test "x$ac_cv_header_gst_gst_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether gint64 defined by gst/gst.h is indeed 64-bit" >&5 -printf %s "checking whether gint64 defined by gst/gst.h is indeed 64-bit... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -static int a[sizeof(gint64) > 4 ? 1 : -1]; if (a[0]) return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gst_pad_new in -lgstreamer-1.0" >&5 -printf %s "checking for gst_pad_new in -lgstreamer-1.0... " >&6; } -if test ${ac_cv_lib_gstreamer_1_0_gst_pad_new+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lgstreamer-1.0 $GSTREAMER_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char gst_pad_new (void); -int -main (void) -{ -return gst_pad_new (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_gstreamer_1_0_gst_pad_new=yes -else case e in #( - e) ac_cv_lib_gstreamer_1_0_gst_pad_new=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gstreamer_1_0_gst_pad_new" >&5 -printf "%s\n" "$ac_cv_lib_gstreamer_1_0_gst_pad_new" >&6; } -if test "x$ac_cv_lib_gstreamer_1_0_gst_pad_new" = xyes -then : - : -fi - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ac_glib2_broken=yes - enable_winegstreamer=${enable_winegstreamer:-no} - as_fn_append wine_notices "|glib-2.0 pkgconfig configuration is for the wrong architecture, winegstreamer won't be built." ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_glib2_broken" != xyes -a "x$ac_cv_lib_gstreamer_1_0_gst_pad_new" != xyes -then : - case "x$with_gstreamer" in - x) as_fn_append wine_notices "|gstreamer-1.0 base plugins ${notice_platform}development files not found, GStreamer won't be supported." ;; - xno) ;; - *) as_fn_error $? "gstreamer-1.0 base plugins ${notice_platform}development files not found, GStreamer won't be supported. -This is an error since --with-gstreamer was requested." "$LINENO" 5 ;; -esac -enable_winegstreamer=${enable_winegstreamer:-no} -fi - -ALSA_LIBS="" - -if test "x$with_alsa" != "xno" -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for snd_pcm_hw_params_get_access_mask in -lasound" >&5 -printf %s "checking for snd_pcm_hw_params_get_access_mask in -lasound... " >&6; } -if test ${ac_cv_lib_asound_snd_pcm_hw_params_get_access_mask+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lasound $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char snd_pcm_hw_params_get_access_mask (void); -int -main (void) -{ -return snd_pcm_hw_params_get_access_mask (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_asound_snd_pcm_hw_params_get_access_mask=yes -else case e in #( - e) ac_cv_lib_asound_snd_pcm_hw_params_get_access_mask=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_pcm_hw_params_get_access_mask" >&5 -printf "%s\n" "$ac_cv_lib_asound_snd_pcm_hw_params_get_access_mask" >&6; } -if test "x$ac_cv_lib_asound_snd_pcm_hw_params_get_access_mask" = xyes -then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -snd_pcm_hw_params_get_access_mask(NULL, NULL) - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ALSA_LIBS="-lasound" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -test -n "$ALSA_LIBS" || enable_winealsa_drv=${enable_winealsa_drv:-no} - -if test "x$with_oss" != xno -then - ac_save_CPPFLAGS="$CPPFLAGS" - if test -f /etc/oss.conf - then - . /etc/oss.conf - fi - ac_oss_incl="-I${OSSLIBDIR:-/usr/lib/oss}/include" - CPPFLAGS="$CPPFLAGS $ac_oss_incl" - ac_fn_c_check_header_compile "$LINENO" "sys/soundcard.h" "ac_cv_header_sys_soundcard_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_soundcard_h" = xyes -then : - ac_fn_c_check_member "$LINENO" "oss_sysinfo" "numaudioengines" "ac_cv_member_oss_sysinfo_numaudioengines" "#include -" -if test "x$ac_cv_member_oss_sysinfo_numaudioengines" = xyes -then : - -printf "%s\n" "#define HAVE_OSS_SYSINFO_NUMAUDIOENGINES 1" >>confdefs.h - -OSS4_CFLAGS="$ac_oss_incl" - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _oss_ioctl in -lossaudio" >&5 -printf %s "checking for _oss_ioctl in -lossaudio... " >&6; } -if test ${ac_cv_lib_ossaudio__oss_ioctl+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lossaudio $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char _oss_ioctl (void); -int -main (void) -{ -return _oss_ioctl (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_ossaudio__oss_ioctl=yes -else case e in #( - e) ac_cv_lib_ossaudio__oss_ioctl=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ossaudio__oss_ioctl" >&5 -printf "%s\n" "$ac_cv_lib_ossaudio__oss_ioctl" >&6; } -if test "x$ac_cv_lib_ossaudio__oss_ioctl" = xyes -then : - OSS4_LIBS="-lossaudio" - -fi - -fi - -fi - - CPPFLAGS="$ac_save_CPPFLAGS" -fi -if test "x$ac_cv_member_oss_sysinfo_numaudioengines" != xyes -then : - case "x$with_oss" in - x) as_fn_append wine_notices "|OSS sound system found but too old (OSSv4 needed), OSS won't be supported." ;; - xno) ;; - *) as_fn_error $? "OSS sound system found but too old (OSSv4 needed), OSS won't be supported. -This is an error since --with-oss was requested." "$LINENO" 5 ;; -esac -enable_wineoss_drv=${enable_wineoss_drv:-no} -fi - -if test "x$with_udev" != "xno" -then - rm -f conftest.err -if ${UDEV_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - UDEV_CFLAGS=`$PKG_CONFIG --cflags libudev 2>conftest.err` -fi -fi - -if ${UDEV_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - UDEV_LIBS=`$PKG_CONFIG --libs libudev 2>/dev/null` -fi -fi - -UDEV_LIBS=${UDEV_LIBS:-"-ludev"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libudev cflags: $UDEV_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libudev libs: $UDEV_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: libudev errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $UDEV_CFLAGS" - for ac_header in libudev.h -do : - ac_fn_c_check_header_compile "$LINENO" "libudev.h" "ac_cv_header_libudev_h" "$ac_includes_default" -if test "x$ac_cv_header_libudev_h" = xyes -then : - printf "%s\n" "#define HAVE_LIBUDEV_H 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for udev_new in -ludev" >&5 -printf %s "checking for udev_new in -ludev... " >&6; } -if test ${ac_cv_lib_udev_udev_new+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-ludev $UDEV_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char udev_new (void); -int -main (void) -{ -return udev_new (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_udev_udev_new=yes -else case e in #( - e) ac_cv_lib_udev_udev_new=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_udev_udev_new" >&5 -printf "%s\n" "$ac_cv_lib_udev_udev_new" >&6; } -if test "x$ac_cv_lib_udev_udev_new" = xyes -then : - -printf "%s\n" "#define HAVE_UDEV 1" >>confdefs.h - -else case e in #( - e) UDEV_LIBS="" ;; -esac -fi - -else case e in #( - e) UDEV_LIBS="" ;; -esac -fi - -done -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$UDEV_LIBS" = "x" -then : - case "x$with_udev" in - x) as_fn_append wine_notices "|libudev ${notice_platform}development files not found, plug and play won't be supported." ;; - xno) ;; - *) as_fn_error $? "libudev ${notice_platform}development files not found, plug and play won't be supported. -This is an error since --with-udev was requested." "$LINENO" 5 ;; -esac - -fi - -if test $HOST_ARCH = x86_64 -then - if test "x$with_unwind" != xno - then - rm -f conftest.err -if ${UNWIND_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - UNWIND_CFLAGS=`$PKG_CONFIG --cflags libunwind 2>conftest.err` -fi -fi - -if ${UNWIND_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - UNWIND_LIBS=`$PKG_CONFIG --libs libunwind 2>/dev/null` -fi -fi - -UNWIND_LIBS=${UNWIND_LIBS:-"-lunwind"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libunwind cflags: $UNWIND_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: libunwind libs: $UNWIND_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: libunwind errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $UNWIND_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unw_step" >&5 -printf %s "checking for unw_step... " >&6; } -if test ${wine_cv_have_unw_step+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define UNW_LOCAL_ONLY -#include -int -main (void) -{ -unw_cursor_t cursor; unw_step( &cursor ); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - wine_cv_have_unw_step="yes" -else case e in #( - e) wine_cv_have_unw_step="no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_have_unw_step" >&5 -printf "%s\n" "$wine_cv_have_unw_step" >&6; } - if test "$wine_cv_have_unw_step" = no -a -n "$UNWIND_LIBS" - then - save_libs=$LIBS - UNWIND_LIBS="-static-libgcc $UNWIND_LIBS" - LIBS="$UNWIND_LIBS $LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unw_step in libunwind" >&5 -printf %s "checking for unw_step in libunwind... " >&6; } -if test ${wine_cv_have_libunwind_unw_step+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define UNW_LOCAL_ONLY -#include -int -main (void) -{ -unw_cursor_t cursor; unw_step( &cursor ); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - wine_cv_have_libunwind_unw_step="yes" -else case e in #( - e) wine_cv_have_libunwind_unw_step="no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_have_libunwind_unw_step" >&5 -printf "%s\n" "$wine_cv_have_libunwind_unw_step" >&6; } - LIBS=$save_libs - fi - test "$wine_cv_have_libunwind_unw_step" = yes || UNWIND_LIBS="" - if test "x$wine_cv_have_unw_step$wine_cv_have_libunwind_unw_step" != xnono - then - -printf "%s\n" "#define HAVE_LIBUNWIND 1" >>confdefs.h - - fi -CPPFLAGS=$ac_save_CPPFLAGS - - fi - case $host in - *-darwin*) - if test "x$wine_cv_have_unw_step$wine_cv_have_libunwind_unw_step" = xnono -then : - case "x$with_unwind" in - x) as_fn_append wine_notices "|libunwind ${notice_platform}development files not found, stack unwinding won't work." ;; - xno) ;; - *) as_fn_error $? "libunwind ${notice_platform}development files not found, stack unwinding won't work. -This is an error since --with-unwind was requested." "$LINENO" 5 ;; -esac - -fi ;; - esac -fi - -if test "x$with_sdl" != "xno" -then - rm -f conftest.err -if ${SDL2_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - SDL2_CFLAGS=`$PKG_CONFIG --cflags sdl2 2>conftest.err` -fi -fi - -if ${SDL2_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - SDL2_LIBS=`$PKG_CONFIG --libs sdl2 2>/dev/null` -fi -fi - -SDL2_LIBS=${SDL2_LIBS:-"-lSDL2"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: sdl2 cflags: $SDL2_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: sdl2 libs: $SDL2_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: sdl2 errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $SDL2_CFLAGS" - for ac_header in SDL.h -do : - ac_fn_c_check_header_compile "$LINENO" "SDL.h" "ac_cv_header_SDL_h" "$ac_includes_default" -if test "x$ac_cv_header_SDL_h" = xyes -then : - printf "%s\n" "#define HAVE_SDL_H 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lSDL2" >&5 -printf %s "checking for -lSDL2... " >&6; } -if test ${ac_cv_lib_soname_SDL2+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lSDL2 $SDL2_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char SDL_Init (void); -int -main (void) -{ -return SDL_Init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_SDL2=`$ac_cv_path_LDD conftest.exe | grep "SDL2" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_SDL2=`$OTOOL -L conftest$ac_exeext | grep "libSDL2-2.0*\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libSDL2-2.0*\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_SDL2=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libSDL2-2.0*\\.$LIBEXT" | sed -e "s/^.*\\[\\(libSDL2-2.0*\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_SDL2:+false} : -then : - ac_cv_lib_soname_SDL2=`$LDD conftest$ac_exeext | grep "libSDL2-2.0*\\.$LIBEXT" | sed -e "s/^.*\(libSDL2-2.0*\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_SDL2= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_SDL2:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_SDL2" >&5 -printf "%s\n" "$ac_cv_lib_soname_SDL2" >&6; } - -printf "%s\n" "#define SONAME_LIBSDL2 \"$ac_cv_lib_soname_SDL2\"" >>confdefs.h - - ;; -esac -fi -fi - -done -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_cv_lib_soname_SDL2" = "x" -then : - case "x$with_sdl" in - x) as_fn_append wine_notices "|libSDL2 ${notice_platform}development files not found, SDL2 won't be supported." ;; - xno) ;; - *) as_fn_error $? "libSDL2 ${notice_platform}development files not found, SDL2 won't be supported. -This is an error since --with-sdl was requested." "$LINENO" 5 ;; -esac - -fi - -if test "x$with_capi" != "xno" -then - rm -f conftest.err -if ${CAPI20_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - CAPI20_CFLAGS=`$PKG_CONFIG --cflags capi20 2>conftest.err` -fi -fi - -if ${CAPI20_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - CAPI20_LIBS=`$PKG_CONFIG --libs capi20 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: capi20 cflags: $CAPI20_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: capi20 libs: $CAPI20_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: capi20 errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $CAPI20_CFLAGS" - ac_fn_c_check_header_compile "$LINENO" "capi20.h" "ac_cv_header_capi20_h" "#define __user -" -if test "x$ac_cv_header_capi20_h" = xyes -then : - printf "%s\n" "#define HAVE_CAPI20_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "linux/capi.h" "ac_cv_header_linux_capi_h" "#define __user -" -if test "x$ac_cv_header_linux_capi_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_CAPI_H 1" >>confdefs.h - -fi - - if test "$ac_cv_header_capi20_h" = "yes" -a "$ac_cv_header_linux_capi_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for capi20_register in -lcapi20" >&5 -printf %s "checking for capi20_register in -lcapi20... " >&6; } -if test ${ac_cv_lib_capi20_capi20_register+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lcapi20 $CAPI20_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char capi20_register (void); -int -main (void) -{ -return capi20_register (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_capi20_capi20_register=yes -else case e in #( - e) ac_cv_lib_capi20_capi20_register=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_capi20_capi20_register" >&5 -printf "%s\n" "$ac_cv_lib_capi20_capi20_register" >&6; } -if test "x$ac_cv_lib_capi20_capi20_register" = xyes -then : - : -else case e in #( - e) CAPI20_LIBS="" ;; -esac -fi - - fi -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_cv_lib_capi20_capi20_register" != xyes -then : - case "x$with_capi" in - x) as_fn_append wine_notices "|libcapi20 ${notice_platform}development files not found, ISDN won't be supported." ;; - xno) ;; - *) as_fn_error $? "libcapi20 ${notice_platform}development files not found, ISDN won't be supported. -This is an error since --with-capi was requested." "$LINENO" 5 ;; -esac -enable_capi2032=${enable_capi2032:-no} -fi - -if test "x$with_cups" != "xno" -then - rm -f conftest.err -if ${CUPS_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - CUPS_CFLAGS=`$PKG_CONFIG --cflags cups 2>conftest.err` -fi -fi -test "$cross_compiling" = yes || CUPS_CFLAGS=${CUPS_CFLAGS:-`${CUPS_CONFIG:-cups-config} --cflags 2>/dev/null`} -if ${CUPS_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - CUPS_LIBS=`$PKG_CONFIG --libs cups 2>/dev/null` -fi -fi -test "$cross_compiling" = yes || CUPS_LIBS=${CUPS_LIBS:-`${CUPS_CONFIG:-cups-config} --libs 2>/dev/null`} -CUPS_LIBS=${CUPS_LIBS:-"-lcups"} -printf "%s\n" "$as_me:${as_lineno-$LINENO}: cups cflags: $CUPS_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: cups libs: $CUPS_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: cups errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $CUPS_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "cups/cups.h" "ac_cv_header_cups_cups_h" "$ac_includes_default" -if test "x$ac_cv_header_cups_cups_h" = xyes -then : - printf "%s\n" "#define HAVE_CUPS_CUPS_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "cups/ppd.h" "ac_cv_header_cups_ppd_h" "$ac_includes_default" -if test "x$ac_cv_header_cups_ppd_h" = xyes -then : - printf "%s\n" "#define HAVE_CUPS_PPD_H 1" >>confdefs.h - -fi - - if test "$ac_cv_header_cups_cups_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lcups" >&5 -printf %s "checking for -lcups... " >&6; } -if test ${ac_cv_lib_soname_cups+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lcups $CUPS_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char cupsGetDefault (void); -int -main (void) -{ -return cupsGetDefault (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_cups=`$ac_cv_path_LDD conftest.exe | grep "cups" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_cups=`$OTOOL -L conftest$ac_exeext | grep "libcups\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libcups\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_cups=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libcups\\.$LIBEXT" | sed -e "s/^.*\\[\\(libcups\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_cups:+false} : -then : - ac_cv_lib_soname_cups=`$LDD conftest$ac_exeext | grep "libcups\\.$LIBEXT" | sed -e "s/^.*\(libcups\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_cups= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_cups:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - CUPS_LIBS="" -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_cups" >&5 -printf "%s\n" "$ac_cv_lib_soname_cups" >&6; } - -printf "%s\n" "#define SONAME_LIBCUPS \"$ac_cv_lib_soname_cups\"" >>confdefs.h - - ;; -esac -fi - else - CUPS_CFLAGS="" - CUPS_LIBS="" - fi -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_cv_lib_soname_cups" = "x" -then : - case "x$with_cups" in - x) as_fn_append wine_notices "|libcups ${notice_platform}development files not found, CUPS won't be supported." ;; - xno) ;; - *) as_fn_error $? "libcups ${notice_platform}development files not found, CUPS won't be supported. -This is an error since --with-cups was requested." "$LINENO" 5 ;; -esac - -fi - -if test "x$with_fontconfig" != "xno" -then - rm -f conftest.err -if ${FONTCONFIG_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - FONTCONFIG_CFLAGS=`$PKG_CONFIG --cflags fontconfig 2>conftest.err` -fi -fi -test "$cross_compiling" = yes || FONTCONFIG_CFLAGS=${FONTCONFIG_CFLAGS:-$X_CFLAGS} -if ${FONTCONFIG_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - FONTCONFIG_LIBS=`$PKG_CONFIG --libs fontconfig 2>/dev/null` -fi -fi -test "$cross_compiling" = yes || FONTCONFIG_LIBS=${FONTCONFIG_LIBS:-$X_LIBS} - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: fontconfig cflags: $FONTCONFIG_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: fontconfig libs: $FONTCONFIG_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: fontconfig errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $FONTCONFIG_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "fontconfig/fontconfig.h" "ac_cv_header_fontconfig_fontconfig_h" "$ac_includes_default" -if test "x$ac_cv_header_fontconfig_fontconfig_h" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lfontconfig" >&5 -printf %s "checking for -lfontconfig... " >&6; } -if test ${ac_cv_lib_soname_fontconfig+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lfontconfig $FONTCONFIG_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char FcInit (void); -int -main (void) -{ -return FcInit (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_fontconfig=`$ac_cv_path_LDD conftest.exe | grep "fontconfig" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_fontconfig=`$OTOOL -L conftest$ac_exeext | grep "libfontconfig\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libfontconfig\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_fontconfig=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libfontconfig\\.$LIBEXT" | sed -e "s/^.*\\[\\(libfontconfig\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_fontconfig:+false} : -then : - ac_cv_lib_soname_fontconfig=`$LDD conftest$ac_exeext | grep "libfontconfig\\.$LIBEXT" | sed -e "s/^.*\(libfontconfig\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_fontconfig= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_fontconfig:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - FONTCONFIG_CFLAGS="" -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_fontconfig" >&5 -printf "%s\n" "$ac_cv_lib_soname_fontconfig" >&6; } - -printf "%s\n" "#define SONAME_LIBFONTCONFIG \"$ac_cv_lib_soname_fontconfig\"" >>confdefs.h - - ;; -esac -fi -else case e in #( - e) FONTCONFIG_CFLAGS="" ;; -esac -fi - -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_cv_lib_soname_fontconfig" = "x" -then : - case "x$with_fontconfig" in - x) as_fn_append wine_notices "|fontconfig ${notice_platform}development files not found, fontconfig won't be supported." ;; - xno) ;; - *) as_fn_error $? "fontconfig ${notice_platform}development files not found, fontconfig won't be supported. -This is an error since --with-fontconfig was requested." "$LINENO" 5 ;; -esac - -fi - -if test "x$with_krb5" != "xno" -then - rm -f conftest.err -if ${KRB5_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - KRB5_CFLAGS=`$PKG_CONFIG --cflags krb5 2>conftest.err` -fi -fi -test "$cross_compiling" = yes || KRB5_CFLAGS=${KRB5_CFLAGS:-`${KRB5_CONFIG:-krb5-config} --cflags 2>/dev/null`} -if ${KRB5_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - KRB5_LIBS=`$PKG_CONFIG --libs krb5 2>/dev/null` -fi -fi -test "$cross_compiling" = yes || KRB5_LIBS=${KRB5_LIBS:-`${KRB5_CONFIG:-krb5-config} --libs 2>/dev/null`} - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: krb5 cflags: $KRB5_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: krb5 libs: $KRB5_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: krb5 errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $KRB5_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "krb5/krb5.h" "ac_cv_header_krb5_krb5_h" "$ac_includes_default" -if test "x$ac_cv_header_krb5_krb5_h" = xyes -then : - printf "%s\n" "#define HAVE_KRB5_KRB5_H 1" >>confdefs.h - -fi - - if test "$ac_cv_header_krb5_krb5_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lkrb5" >&5 -printf %s "checking for -lkrb5... " >&6; } -if test ${ac_cv_lib_soname_krb5+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lkrb5 $KRB5_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char krb5_is_config_principal (void); -int -main (void) -{ -return krb5_is_config_principal (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_krb5=`$ac_cv_path_LDD conftest.exe | grep "krb5" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_krb5=`$OTOOL -L conftest$ac_exeext | grep "libkrb5\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libkrb5\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_krb5=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libkrb5\\.$LIBEXT" | sed -e "s/^.*\\[\\(libkrb5\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_krb5:+false} : -then : - ac_cv_lib_soname_krb5=`$LDD conftest$ac_exeext | grep "libkrb5\\.$LIBEXT" | sed -e "s/^.*\(libkrb5\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_krb5= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_krb5:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - KRB5_CFLAGS="" -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_krb5" >&5 -printf "%s\n" "$ac_cv_lib_soname_krb5" >&6; } - -printf "%s\n" "#define SONAME_LIBKRB5 \"$ac_cv_lib_soname_krb5\"" >>confdefs.h - - ;; -esac -fi - else - KRB5_CFLAGS="" - fi -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_cv_lib_soname_krb5" = "x" -then : - case "x$with_krb5" in - x) as_fn_append wine_notices "|libkrb5 ${notice_platform}development files not found (or too old), Kerberos won't be supported." ;; - xno) ;; - *) as_fn_error $? "libkrb5 ${notice_platform}development files not found (or too old), Kerberos won't be supported. -This is an error since --with-krb5 was requested." "$LINENO" 5 ;; -esac - -fi -test "x$ac_cv_lib_soname_krb5" != "x" || with_gssapi=${with_gssapi:-no} - -if test "x$with_gssapi" != "xno" -then - rm -f conftest.err -if ${GSSAPI_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GSSAPI_CFLAGS=`$PKG_CONFIG --cflags krb5-gssapi 2>conftest.err` -fi -fi -test "$cross_compiling" = yes || GSSAPI_CFLAGS=${GSSAPI_CFLAGS:-`${KRB5_CONFIG:-krb5-config} --cflags gssapi 2>/dev/null`} -if ${GSSAPI_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - GSSAPI_LIBS=`$PKG_CONFIG --libs krb5-gssapi 2>/dev/null` -fi -fi -test "$cross_compiling" = yes || GSSAPI_LIBS=${GSSAPI_LIBS:-`${KRB5_CONFIG:-krb5-config} --libs gssapi 2>/dev/null`} - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: krb5-gssapi cflags: $GSSAPI_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: krb5-gssapi libs: $GSSAPI_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: krb5-gssapi errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $GSSAPI_CFLAGS" -ac_fn_c_check_header_compile "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default" -if test "x$ac_cv_header_gssapi_gssapi_h" = xyes -then : - printf "%s\n" "#define HAVE_GSSAPI_GSSAPI_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_compile "$LINENO" "gssapi/gssapi_ext.h" "ac_cv_header_gssapi_gssapi_ext_h" "$ac_includes_default" -if test "x$ac_cv_header_gssapi_gssapi_ext_h" = xyes -then : - printf "%s\n" "#define HAVE_GSSAPI_GSSAPI_EXT_H 1" >>confdefs.h - -fi - - if test "$ac_cv_header_gssapi_gssapi_h" = "yes" -a "$ac_cv_header_gssapi_gssapi_ext_h" = "yes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lgssapi_krb5" >&5 -printf %s "checking for -lgssapi_krb5... " >&6; } -if test ${ac_cv_lib_soname_gssapi_krb5+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lgssapi_krb5 $GSSAPI_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char gss_init_sec_context (void); -int -main (void) -{ -return gss_init_sec_context (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_gssapi_krb5=`$ac_cv_path_LDD conftest.exe | grep "gssapi_krb5" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_gssapi_krb5=`$OTOOL -L conftest$ac_exeext | grep "libgssapi_krb5\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libgssapi_krb5\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_gssapi_krb5=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libgssapi_krb5\\.$LIBEXT" | sed -e "s/^.*\\[\\(libgssapi_krb5\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_gssapi_krb5:+false} : -then : - ac_cv_lib_soname_gssapi_krb5=`$LDD conftest$ac_exeext | grep "libgssapi_krb5\\.$LIBEXT" | sed -e "s/^.*\(libgssapi_krb5\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_gssapi_krb5= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_gssapi_krb5:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - GSSAPI_CFLAGS="" -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_gssapi_krb5" >&5 -printf "%s\n" "$ac_cv_lib_soname_gssapi_krb5" >&6; } - -printf "%s\n" "#define SONAME_LIBGSSAPI_KRB5 \"$ac_cv_lib_soname_gssapi_krb5\"" >>confdefs.h - - ;; -esac -fi - else - GSSAPI_CFLAGS="" - fi -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_cv_lib_soname_gssapi_krb5" = "x" -then : - case "x$with_gssapi" in - x) as_fn_append wine_notices "|libgssapi_krb5 ${notice_platform}development files not found (or too old), no Kerberos SSP support." ;; - xno) ;; - *) as_fn_error $? "libgssapi_krb5 ${notice_platform}development files not found (or too old), no Kerberos SSP support. -This is an error since --with-gssapi was requested." "$LINENO" 5 ;; -esac - -fi - -if test "$ac_cv_header_libprocstat_h" = "yes" -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for procstat_open_sysctl in -lprocstat" >&5 -printf %s "checking for procstat_open_sysctl in -lprocstat... " >&6; } -if test ${ac_cv_lib_procstat_procstat_open_sysctl+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_lib_save_LIBS=$LIBS -LIBS="-lprocstat $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char procstat_open_sysctl (void); -int -main (void) -{ -return procstat_open_sysctl (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_procstat_procstat_open_sysctl=yes -else case e in #( - e) ac_cv_lib_procstat_procstat_open_sysctl=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_procstat_procstat_open_sysctl" >&5 -printf "%s\n" "$ac_cv_lib_procstat_procstat_open_sysctl" >&6; } -if test "x$ac_cv_lib_procstat_procstat_open_sysctl" = xyes -then : - -printf "%s\n" "#define HAVE_LIBPROCSTAT 1" >>confdefs.h - - PROCSTAT_LIBS="-lprocstat" - -fi - -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lodbc" >&5 -printf %s "checking for -lodbc... " >&6; } -if test ${ac_cv_lib_soname_odbc+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lodbc $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char SQLConnect (void); -int -main (void) -{ -return SQLConnect (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_odbc=`$ac_cv_path_LDD conftest.exe | grep "odbc" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_odbc=`$OTOOL -L conftest$ac_exeext | grep "libodbc\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libodbc\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_odbc=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libodbc\\.$LIBEXT" | sed -e "s/^.*\\[\\(libodbc\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_odbc:+false} : -then : - ac_cv_lib_soname_odbc=`$LDD conftest$ac_exeext | grep "libodbc\\.$LIBEXT" | sed -e "s/^.*\(libodbc\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_odbc= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_odbc:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - printf "%s\n" "#define SONAME_LIBODBC \"libodbc.$LIBEXT\"" >>confdefs.h - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_odbc" >&5 -printf "%s\n" "$ac_cv_lib_soname_odbc" >&6; } - -printf "%s\n" "#define SONAME_LIBODBC \"$ac_cv_lib_soname_odbc\"" >>confdefs.h - - ;; -esac -fi - -if test "x$with_netapi" != "xno" -then - rm -f conftest.err -if ${NETAPI_CFLAGS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - NETAPI_CFLAGS=`$PKG_CONFIG --cflags netapi 2>conftest.err` -fi -fi - -if ${NETAPI_LIBS:+false} : -then : - if test ${PKG_CONFIG+y} -then : - NETAPI_LIBS=`$PKG_CONFIG --libs netapi 2>/dev/null` -fi -fi - - -printf "%s\n" "$as_me:${as_lineno-$LINENO}: netapi cflags: $NETAPI_CFLAGS" >&5 -printf "%s\n" "$as_me:${as_lineno-$LINENO}: netapi libs: $NETAPI_LIBS" >&5 -if test -s conftest.err; then - printf %s "$as_me:${as_lineno-$LINENO}: netapi errors: " >&5 - cat conftest.err >&5 -fi -rm -f conftest.err -ac_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $NETAPI_CFLAGS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lnetapi" >&5 -printf %s "checking for -lnetapi... " >&6; } -if test ${ac_cv_lib_soname_netapi+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lnetapi $NETAPI_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char libnetapi_init (void); -int -main (void) -{ -return libnetapi_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_netapi=`$ac_cv_path_LDD conftest.exe | grep "netapi" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_netapi=`$OTOOL -L conftest$ac_exeext | grep "libnetapi\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libnetapi\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_netapi=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libnetapi\\.$LIBEXT" | sed -e "s/^.*\\[\\(libnetapi\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_netapi:+false} : -then : - ac_cv_lib_soname_netapi=`$LDD conftest$ac_exeext | grep "libnetapi\\.$LIBEXT" | sed -e "s/^.*\(libnetapi\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_netapi= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_netapi:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - printf "%s\n" "#define SONAME_LIBNETAPI \"libnetapi.$LIBEXT\"" >>confdefs.h - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_netapi" >&5 -printf "%s\n" "$ac_cv_lib_soname_netapi" >&6; } - -printf "%s\n" "#define SONAME_LIBNETAPI \"$ac_cv_lib_soname_netapi\"" >>confdefs.h - - ;; -esac -fi -CPPFLAGS=$ac_save_CPPFLAGS - -fi -if test "x$ac_cv_lib_soname_netapi" = "x" -then : - case "x$with_netapi" in - x) as_fn_append wine_notices "|libnetapi not found, Samba NetAPI won't be supported." ;; - xno) ;; - *) as_fn_error $? "libnetapi not found, Samba NetAPI won't be supported. -This is an error since --with-netapi was requested." "$LINENO" 5 ;; -esac -enable_netapi=${enable_netapi:-no} -fi - - -if test "x$enable_winealsa_drv$enable_winecoreaudio_drv$enable_winepulse_drv$enable_wineoss_drv$enable_wineandroid_drv" = xnonononono -a \ - "x$with_alsa$with_coreaudio$with_oss$with_pulse" != xnononono -then - as_fn_append wine_warnings "|No sound system was found. Windows applications will be silent." -fi - -if test "x$with_vulkan" != "xno" -then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lvulkan" >&5 -printf %s "checking for -lvulkan... " >&6; } -if test ${ac_cv_lib_soname_vulkan+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lvulkan $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char vkGetInstanceProcAddr (void); -int -main (void) -{ -return vkGetInstanceProcAddr (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_vulkan=`$ac_cv_path_LDD conftest.exe | grep "vulkan" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_vulkan=`$OTOOL -L conftest$ac_exeext | grep "libvulkan\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libvulkan\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_vulkan=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libvulkan\\.$LIBEXT" | sed -e "s/^.*\\[\\(libvulkan\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_vulkan:+false} : -then : - ac_cv_lib_soname_vulkan=`$LDD conftest$ac_exeext | grep "libvulkan\\.$LIBEXT" | sed -e "s/^.*\(libvulkan\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_vulkan= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_vulkan:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_vulkan" >&5 -printf "%s\n" "$ac_cv_lib_soname_vulkan" >&6; } - -printf "%s\n" "#define SONAME_LIBVULKAN \"$ac_cv_lib_soname_vulkan\"" >>confdefs.h - - ;; -esac -fi - if test "x$ac_cv_lib_soname_vulkan" = "x" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lMoltenVK" >&5 -printf %s "checking for -lMoltenVK... " >&6; } -if test ${ac_cv_lib_soname_MoltenVK+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_check_soname_save_LIBS=$LIBS -LIBS="-lMoltenVK $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char vkGetInstanceProcAddr (void); -int -main (void) -{ -return vkGetInstanceProcAddr (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - case "$LIBEXT" in - dll) ac_cv_lib_soname_MoltenVK=`$ac_cv_path_LDD conftest.exe | grep "MoltenVK" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_MoltenVK=`$OTOOL -L conftest$ac_exeext | grep "libMoltenVK\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libMoltenVK\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_MoltenVK=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libMoltenVK\\.$LIBEXT" | sed -e "s/^.*\\[\\(libMoltenVK\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` - if ${ac_cv_lib_soname_MoltenVK:+false} : -then : - ac_cv_lib_soname_MoltenVK=`$LDD conftest$ac_exeext | grep "libMoltenVK\\.$LIBEXT" | sed -e "s/^.*\(libMoltenVK\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` -fi ;; - esac -else case e in #( - e) ac_cv_lib_soname_MoltenVK= ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS ;; -esac -fi -if ${ac_cv_lib_soname_MoltenVK:+false} : -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -printf "%s\n" "not found" >&6; } - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_MoltenVK" >&5 -printf "%s\n" "$ac_cv_lib_soname_MoltenVK" >&6; } - -printf "%s\n" "#define SONAME_LIBMOLTENVK \"$ac_cv_lib_soname_MoltenVK\"" >>confdefs.h - - printf "%s\n" "#define SONAME_LIBVULKAN \"$ac_cv_lib_soname_MoltenVK\"" >>confdefs.h - ;; -esac -fi - fi -fi -if test "x$ac_cv_lib_soname_vulkan" = "x" -a "x$ac_cv_lib_soname_MoltenVK" = "x" -then : - case "x$with_vulkan" in - x) as_fn_append wine_notices "|libvulkan and libMoltenVK ${notice_platform}development files not found, Vulkan won't be supported." ;; - xno) ;; - *) as_fn_error $? "libvulkan and libMoltenVK ${notice_platform}development files not found, Vulkan won't be supported. -This is an error since --with-vulkan was requested." "$LINENO" 5 ;; -esac - -fi - - -if test "x${GCC}" = "xyes" -then - EXTRACFLAGS="$EXTRACFLAGS -Wall -pipe" - - saved_CFLAGS=$CFLAGS - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Werror=unknown-warning-option" >&5 -printf %s "checking whether the compiler supports -Werror=unknown-warning-option... " >&6; } -if test ${ac_cv_cflags__Werror_unknown_warning_option+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Werror=unknown-warning-option" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Werror_unknown_warning_option=yes -else case e in #( - e) ac_cv_cflags__Werror_unknown_warning_option=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Werror_unknown_warning_option" >&5 -printf "%s\n" "$ac_cv_cflags__Werror_unknown_warning_option" >&6; } -if test "x$ac_cv_cflags__Werror_unknown_warning_option" = xyes -then : - CFLAGS="$CFLAGS -Werror=unknown-warning-option" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Werror=unused-command-line-argument" >&5 -printf %s "checking whether the compiler supports -Werror=unused-command-line-argument... " >&6; } -if test ${ac_cv_cflags__Werror_unused_command_line_argument+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Werror=unused-command-line-argument" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Werror_unused_command_line_argument=yes -else case e in #( - e) ac_cv_cflags__Werror_unused_command_line_argument=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Werror_unused_command_line_argument" >&5 -printf "%s\n" "$ac_cv_cflags__Werror_unused_command_line_argument" >&6; } -if test "x$ac_cv_cflags__Werror_unused_command_line_argument" = xyes -then : - CFLAGS="$CFLAGS -Werror=unused-command-line-argument" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Werror=ignored-optimization-argument" >&5 -printf %s "checking whether the compiler supports -Werror=ignored-optimization-argument... " >&6; } -if test ${ac_cv_cflags__Werror_ignored_optimization_argument+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Werror=ignored-optimization-argument" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Werror_ignored_optimization_argument=yes -else case e in #( - e) ac_cv_cflags__Werror_ignored_optimization_argument=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Werror_ignored_optimization_argument" >&5 -printf "%s\n" "$ac_cv_cflags__Werror_ignored_optimization_argument" >&6; } -if test "x$ac_cv_cflags__Werror_ignored_optimization_argument" = xyes -then : - CFLAGS="$CFLAGS -Werror=ignored-optimization-argument" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fcf-protection=none" >&5 -printf %s "checking whether the compiler supports -fcf-protection=none... " >&6; } -if test ${ac_cv_cflags__fcf_protection_none+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fcf-protection=none" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fcf_protection_none=yes -else case e in #( - e) ac_cv_cflags__fcf_protection_none=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fcf_protection_none" >&5 -printf "%s\n" "$ac_cv_cflags__fcf_protection_none" >&6; } -if test "x$ac_cv_cflags__fcf_protection_none" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -fcf-protection=none" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fvisibility=hidden" >&5 -printf %s "checking whether the compiler supports -fvisibility=hidden... " >&6; } -if test ${ac_cv_cflags__fvisibility_hidden+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fvisibility=hidden" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fvisibility_hidden=yes -else case e in #( - e) ac_cv_cflags__fvisibility_hidden=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fvisibility_hidden" >&5 -printf "%s\n" "$ac_cv_cflags__fvisibility_hidden" >&6; } -if test "x$ac_cv_cflags__fvisibility_hidden" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -fvisibility=hidden" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-stack-protector" >&5 -printf %s "checking whether the compiler supports -fno-stack-protector... " >&6; } -if test ${ac_cv_cflags__fno_stack_protector+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fno-stack-protector" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fno_stack_protector=yes -else case e in #( - e) ac_cv_cflags__fno_stack_protector=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fno_stack_protector" >&5 -printf "%s\n" "$ac_cv_cflags__fno_stack_protector" >&6; } -if test "x$ac_cv_cflags__fno_stack_protector" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -fno-stack-protector" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-strict-aliasing" >&5 -printf %s "checking whether the compiler supports -fno-strict-aliasing... " >&6; } -if test ${ac_cv_cflags__fno_strict_aliasing+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fno-strict-aliasing" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fno_strict_aliasing=yes -else case e in #( - e) ac_cv_cflags__fno_strict_aliasing=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fno_strict_aliasing" >&5 -printf "%s\n" "$ac_cv_cflags__fno_strict_aliasing" >&6; } -if test "x$ac_cv_cflags__fno_strict_aliasing" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -fno-strict-aliasing" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wdeclaration-after-statement" >&5 -printf %s "checking whether the compiler supports -Wdeclaration-after-statement... " >&6; } -if test ${ac_cv_cflags__Wdeclaration_after_statement+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wdeclaration-after-statement" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wdeclaration_after_statement=yes -else case e in #( - e) ac_cv_cflags__Wdeclaration_after_statement=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wdeclaration_after_statement" >&5 -printf "%s\n" "$ac_cv_cflags__Wdeclaration_after_statement" >&6; } -if test "x$ac_cv_cflags__Wdeclaration_after_statement" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wdeclaration-after-statement" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wempty-body" >&5 -printf %s "checking whether the compiler supports -Wempty-body... " >&6; } -if test ${ac_cv_cflags__Wempty_body+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wempty-body" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wempty_body=yes -else case e in #( - e) ac_cv_cflags__Wempty_body=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wempty_body" >&5 -printf "%s\n" "$ac_cv_cflags__Wempty_body" >&6; } -if test "x$ac_cv_cflags__Wempty_body" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wempty-body" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wignored-qualifiers" >&5 -printf %s "checking whether the compiler supports -Wignored-qualifiers... " >&6; } -if test ${ac_cv_cflags__Wignored_qualifiers+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wignored-qualifiers" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wignored_qualifiers=yes -else case e in #( - e) ac_cv_cflags__Wignored_qualifiers=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wignored_qualifiers" >&5 -printf "%s\n" "$ac_cv_cflags__Wignored_qualifiers" >&6; } -if test "x$ac_cv_cflags__Wignored_qualifiers" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wignored-qualifiers" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Winit-self" >&5 -printf %s "checking whether the compiler supports -Winit-self... " >&6; } -if test ${ac_cv_cflags__Winit_self+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Winit-self" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Winit_self=yes -else case e in #( - e) ac_cv_cflags__Winit_self=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Winit_self" >&5 -printf "%s\n" "$ac_cv_cflags__Winit_self" >&6; } -if test "x$ac_cv_cflags__Winit_self" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Winit-self" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wlogical-op" >&5 -printf %s "checking whether the compiler supports -Wlogical-op... " >&6; } -if test ${ac_cv_cflags__Wlogical_op+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wlogical-op" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wlogical_op=yes -else case e in #( - e) ac_cv_cflags__Wlogical_op=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wlogical_op" >&5 -printf "%s\n" "$ac_cv_cflags__Wlogical_op" >&6; } -if test "x$ac_cv_cflags__Wlogical_op" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wlogical-op" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wpacked-not-aligned" >&5 -printf %s "checking whether the compiler supports -Wpacked-not-aligned... " >&6; } -if test ${ac_cv_cflags__Wpacked_not_aligned+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wpacked-not-aligned" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wpacked_not_aligned=yes -else case e in #( - e) ac_cv_cflags__Wpacked_not_aligned=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wpacked_not_aligned" >&5 -printf "%s\n" "$ac_cv_cflags__Wpacked_not_aligned" >&6; } -if test "x$ac_cv_cflags__Wpacked_not_aligned" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wno-packed-not-aligned" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wpointer-arith" >&5 -printf %s "checking whether the compiler supports -Wpointer-arith... " >&6; } -if test ${ac_cv_cflags__Wpointer_arith+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wpointer-arith" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wpointer_arith=yes -else case e in #( - e) ac_cv_cflags__Wpointer_arith=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wpointer_arith" >&5 -printf "%s\n" "$ac_cv_cflags__Wpointer_arith" >&6; } -if test "x$ac_cv_cflags__Wpointer_arith" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wpointer-arith" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wpragma-pack" >&5 -printf %s "checking whether the compiler supports -Wpragma-pack... " >&6; } -if test ${ac_cv_cflags__Wpragma_pack+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wpragma-pack" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wpragma_pack=yes -else case e in #( - e) ac_cv_cflags__Wpragma_pack=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wpragma_pack" >&5 -printf "%s\n" "$ac_cv_cflags__Wpragma_pack" >&6; } -if test "x$ac_cv_cflags__Wpragma_pack" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wno-pragma-pack" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wshift-overflow=2" >&5 -printf %s "checking whether the compiler supports -Wshift-overflow=2... " >&6; } -if test ${ac_cv_cflags__Wshift_overflow_2+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wshift-overflow=2" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wshift_overflow_2=yes -else case e in #( - e) ac_cv_cflags__Wshift_overflow_2=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wshift_overflow_2" >&5 -printf "%s\n" "$ac_cv_cflags__Wshift_overflow_2" >&6; } -if test "x$ac_cv_cflags__Wshift_overflow_2" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wshift-overflow=2" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wstrict-prototypes" >&5 -printf %s "checking whether the compiler supports -Wstrict-prototypes... " >&6; } -if test ${ac_cv_cflags__Wstrict_prototypes+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wstrict-prototypes" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wstrict_prototypes=yes -else case e in #( - e) ac_cv_cflags__Wstrict_prototypes=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wstrict_prototypes" >&5 -printf "%s\n" "$ac_cv_cflags__Wstrict_prototypes" >&6; } -if test "x$ac_cv_cflags__Wstrict_prototypes" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wstrict-prototypes" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wtype-limits" >&5 -printf %s "checking whether the compiler supports -Wtype-limits... " >&6; } -if test ${ac_cv_cflags__Wtype_limits+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wtype-limits" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wtype_limits=yes -else case e in #( - e) ac_cv_cflags__Wtype_limits=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wtype_limits" >&5 -printf "%s\n" "$ac_cv_cflags__Wtype_limits" >&6; } -if test "x$ac_cv_cflags__Wtype_limits" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wtype-limits" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wunused-but-set-parameter" >&5 -printf %s "checking whether the compiler supports -Wunused-but-set-parameter... " >&6; } -if test ${ac_cv_cflags__Wunused_but_set_parameter+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wunused-but-set-parameter" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wunused_but_set_parameter=yes -else case e in #( - e) ac_cv_cflags__Wunused_but_set_parameter=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wunused_but_set_parameter" >&5 -printf "%s\n" "$ac_cv_cflags__Wunused_but_set_parameter" >&6; } -if test "x$ac_cv_cflags__Wunused_but_set_parameter" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wunused-but-set-parameter" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wvla" >&5 -printf %s "checking whether the compiler supports -Wvla... " >&6; } -if test ${ac_cv_cflags__Wvla+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wvla" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wvla=yes -else case e in #( - e) ac_cv_cflags__Wvla=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wvla" >&5 -printf "%s\n" "$ac_cv_cflags__Wvla" >&6; } -if test "x$ac_cv_cflags__Wvla" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wvla" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wwrite-strings" >&5 -printf %s "checking whether the compiler supports -Wwrite-strings... " >&6; } -if test ${ac_cv_cflags__Wwrite_strings+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wwrite-strings" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wwrite_strings=yes -else case e in #( - e) ac_cv_cflags__Wwrite_strings=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wwrite_strings" >&5 -printf "%s\n" "$ac_cv_cflags__Wwrite_strings" >&6; } -if test "x$ac_cv_cflags__Wwrite_strings" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wwrite-strings" -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -flarge-source-files -Wmisleading-indentation" >&5 -printf %s "checking whether the compiler supports -flarge-source-files -Wmisleading-indentation... " >&6; } -if test ${ac_cv_cflags__flarge_source_files__Wmisleading_indentation+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -flarge-source-files -Wmisleading-indentation" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__flarge_source_files__Wmisleading_indentation=yes -else case e in #( - e) ac_cv_cflags__flarge_source_files__Wmisleading_indentation=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__flarge_source_files__Wmisleading_indentation" >&5 -printf "%s\n" "$ac_cv_cflags__flarge_source_files__Wmisleading_indentation" >&6; } -if test "x$ac_cv_cflags__flarge_source_files__Wmisleading_indentation" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wno-misleading-indentation" -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for flags needed for 64-bit compare-and-swap support" >&5 -printf %s "checking for flags needed for 64-bit compare-and-swap support... " >&6; } -if test ${wine_cv_64bit_compare_swap+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 -#error no -#endif -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - wine_cv_64bit_compare_swap="none needed" -else case e in #( - e) case $HOST_ARCH in - i386) wine_cv_64bit_compare_swap="-march=i586" ;; - arm) wine_cv_64bit_compare_swap="-march=armv7-a" ;; - *) wine_cv_64bit_compare_swap="unknown" ;; - esac - if test "x$wine_cv_64bit_compare_swap" != xunknown - then - CFLAGS="$CFLAGS $wine_cv_64bit_compare_swap" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 -#error no -#endif -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else case e in #( - e) wine_cv_64bit_compare_swap="unknown" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$saved_CFLAGS - fi ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_64bit_compare_swap" >&5 -printf "%s\n" "$wine_cv_64bit_compare_swap" >&6; } - case "$wine_cv_64bit_compare_swap" in - unknown) as_fn_error $? "gcc doesn't support 64-bit compare-and-swap on this platform" "$LINENO" 5 ;; - "none needed") ;; - *) EXTRACFLAGS="$EXTRACFLAGS $wine_cv_64bit_compare_swap" ;; - esac - - ac_debug_format_seen="" - for ac_flag in $CFLAGS; do - case $ac_flag in - -gdwarf*) ac_debug_format_seen=yes ;; - -g) ac_debug_format_seen=${ac_debug_format_seen:-default} ;; - esac - done - if test "x$ac_debug_format_seen" = xdefault - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -gdwarf-4" >&5 -printf %s "checking whether the compiler supports -gdwarf-4... " >&6; } -if test ${ac_cv_cflags__gdwarf_4+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -gdwarf-4" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__gdwarf_4=yes -else case e in #( - e) ac_cv_cflags__gdwarf_4=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__gdwarf_4" >&5 -printf "%s\n" "$ac_cv_cflags__gdwarf_4" >&6; } -if test "x$ac_cv_cflags__gdwarf_4" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -gdwarf-4" -fi - fi - - MSVCRTFLAGS="" - - case $host_os in - mingw32*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-delayload,autoconftest.dll" >&5 -printf %s "checking whether the compiler supports -Wl,-delayload,autoconftest.dll... " >&6; } -if test ${ac_cv_cflags__Wl__delayload_autoconftest_dll+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wl,-delayload,autoconftest.dll" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wl__delayload_autoconftest_dll=yes -else case e in #( - e) ac_cv_cflags__Wl__delayload_autoconftest_dll=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__delayload_autoconftest_dll" >&5 -printf "%s\n" "$ac_cv_cflags__Wl__delayload_autoconftest_dll" >&6; } -if test "x$ac_cv_cflags__Wl__delayload_autoconftest_dll" = xyes -then : - DELAYLOADFLAG="-Wl,-delayload," - -fi ;; - *) MSVCRTFLAGS="-D_WIN32" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-builtin" >&5 -printf %s "checking whether the compiler supports -fno-builtin... " >&6; } -if test ${ac_cv_cflags__fno_builtin+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fno-builtin" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fno_builtin=yes -else case e in #( - e) ac_cv_cflags__fno_builtin=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fno_builtin" >&5 -printf "%s\n" "$ac_cv_cflags__fno_builtin" >&6; } -if test "x$ac_cv_cflags__fno_builtin" = xyes -then : - MSVCRTFLAGS="$MSVCRTFLAGS -fno-builtin" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fshort-wchar" >&5 -printf %s "checking whether the compiler supports -fshort-wchar... " >&6; } -if test ${ac_cv_cflags__fshort_wchar+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fshort-wchar" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fshort_wchar=yes -else case e in #( - e) ac_cv_cflags__fshort_wchar=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fshort_wchar" >&5 -printf "%s\n" "$ac_cv_cflags__fshort_wchar" >&6; } -if test "x$ac_cv_cflags__fshort_wchar" = xyes -then : - MSVCRTFLAGS="$MSVCRTFLAGS -fshort-wchar" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wno-format" >&5 -printf %s "checking whether the compiler supports -Wno-format... " >&6; } -if test ${ac_cv_cflags__Wno_format+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wno-format" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wno_format=yes -else case e in #( - e) ac_cv_cflags__Wno_format=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wno_format" >&5 -printf "%s\n" "$ac_cv_cflags__Wno_format" >&6; } -if test "x$ac_cv_cflags__Wno_format" = xyes -then : - MSVCRTFLAGS="$MSVCRTFLAGS -Wno-format" -fi ;; - esac - - case $HOST_ARCH in - i386) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-omit-frame-pointer" >&5 -printf %s "checking whether the compiler supports -fno-omit-frame-pointer... " >&6; } -if test ${ac_cv_cflags__fno_omit_frame_pointer+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fno-omit-frame-pointer" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__fno_omit_frame_pointer=yes -else case e in #( - e) ac_cv_cflags__fno_omit_frame_pointer=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fno_omit_frame_pointer" >&5 -printf "%s\n" "$ac_cv_cflags__fno_omit_frame_pointer" >&6; } -if test "x$ac_cv_cflags__fno_omit_frame_pointer" = xyes -then : - MSVCRTFLAGS="$MSVCRTFLAGS -fno-omit-frame-pointer" -fi ;; - x86_64) - case $host_os in - cygwin*|mingw32*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wno-format" >&5 -printf %s "checking whether the compiler supports -Wno-format... " >&6; } -if test ${ac_cv_cflags__Wno_format+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wno-format" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wno_format=yes -else case e in #( - e) ac_cv_cflags__Wno_format=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wno_format" >&5 -printf "%s\n" "$ac_cv_cflags__Wno_format" >&6; } -if test "x$ac_cv_cflags__Wno_format" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wno-format" -fi ;; - *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working -mabi=ms" >&5 -printf %s "checking for working -mabi=ms... " >&6; } -if test ${ac_cv_mabi_ms+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) CFLAGS="$CFLAGS -mabi=ms" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int a(int b, ...) { __builtin_ms_va_list list; __builtin_ms_va_start(list,b); } -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_mabi_ms=yes -else case e in #( - e) ac_cv_mabi_ms=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$saved_CFLAGS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mabi_ms" >&5 -printf "%s\n" "$ac_cv_mabi_ms" >&6; } - if test "x$ac_cv_mabi_ms" = xyes -then : - MSVCRTFLAGS="$MSVCRTFLAGS -mabi=ms" -else case e in #( - e) test -n "$PE_ARCHS" || as_fn_error $? "The compiler doesn't support -mabi=ms. Use gcc instead of clang, or install mingw-w64." "$LINENO" 5 - DLLEXT="" ;; -esac -fi ;; - esac ;; - arm) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wincompatible-function-pointer-types" >&5 -printf %s "checking whether the compiler supports -Wincompatible-function-pointer-types... " >&6; } -if test ${ac_cv_cflags__Wincompatible_function_pointer_types+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wincompatible-function-pointer-types" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wincompatible_function_pointer_types=yes -else case e in #( - e) ac_cv_cflags__Wincompatible_function_pointer_types=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wincompatible_function_pointer_types" >&5 -printf "%s\n" "$ac_cv_cflags__Wincompatible_function_pointer_types" >&6; } -if test "x$ac_cv_cflags__Wincompatible_function_pointer_types" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Wno-error=incompatible-function-pointer-types" -fi ;; - esac - - CFLAGS=$saved_CFLAGS - - if test "x$enable_werror" = "xyes" - then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Werror" >&5 -printf %s "checking whether the compiler supports -Werror... " >&6; } -if test ${ac_cv_cflags__Werror+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Werror" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Werror=yes -else case e in #( - e) ac_cv_cflags__Werror=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Werror" >&5 -printf "%s\n" "$ac_cv_cflags__Werror" >&6; } -if test "x$ac_cv_cflags__Werror" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -Werror" -fi - fi - - if test "x$enable_build_id" = xyes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,--build-id" >&5 -printf %s "checking whether the compiler supports -Wl,--build-id... " >&6; } -if test ${ac_cv_cflags__Wl___build_id+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wl,--build-id" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(int argc, char **argv) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_cflags__Wl___build_id=yes -else case e in #( - e) ac_cv_cflags__Wl___build_id=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl___build_id" >&5 -printf "%s\n" "$ac_cv_cflags__Wl___build_id" >&6; } -if test "x$ac_cv_cflags__Wl___build_id" = xyes -then : - LDFLAGS="$LDFLAGS -Wl,--build-id" -fi -fi -fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the need to disable Fortify" >&5 -printf %s "checking for the need to disable Fortify... " >&6; } -if test ${ac_cv_c_fortify_enabled+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -#if (defined(__USE_FORTIFY_LEVEL) && __USE_FORTIFY_LEVEL > 0) || (defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0) -#error Fortify enabled -#endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_c_fortify_enabled=no -else case e in #( - e) ac_cv_c_fortify_enabled=yes ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_fortify_enabled" >&5 -printf "%s\n" "$ac_cv_c_fortify_enabled" >&6; } -if test "$ac_cv_c_fortify_enabled" = yes -then - CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" -fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether CFI directives are supported in assembly code" >&5 -printf %s "checking whether CFI directives are supported in assembly code... " >&6; } -if test ${ac_cv_c_cfi_support+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -asm(".text\nac_test:\t.cfi_startproc\n\t.long 0\n\t.cfi_endproc"); -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_c_cfi_support="yes" -else case e in #( - e) ac_cv_c_cfi_support="no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_cfi_support" >&5 -printf "%s\n" "$ac_cv_c_cfi_support" >&6; } -if test "$ac_cv_c_cfi_support" = "yes" -then - DLLFLAGS="$DLLFLAGS -fasynchronous-unwind-tables" - LDDLLFLAGS="$LDDLLFLAGS -fasynchronous-unwind-tables" - UNIXDLLFLAGS="$UNIXDLLFLAGS -fasynchronous-unwind-tables" -elif test $HOST_ARCH = x86_64 -then - as_fn_append wine_warnings "|building 64-bit Wine without support for CFI directives; exception handling will not work properly." -fi - - -case "$HOST_ARCH,$PE_ARCHS" in - x86_64,*i386*) wine_binary="wine" ;; - x86_64,*) wine_binary="wine64" ;; - *) wine_binary="wine" ;; -esac -WINELOADER_PROGRAMS="$wine_binary" - - -case $host_os in - linux*) - if test $HOST_ARCH != unknown - then - wine_use_preloader=yes - fi - ;; -esac - -if test "$wine_use_preloader" = "yes" -then - test "$wine_binary" = wine || as_fn_append CONFIGURE_TARGETS " loader/wine-preloader" - WINELOADER_PROGRAMS="$WINELOADER_PROGRAMS $wine_binary-preloader" - -printf "%s\n" "#define HAVE_WINE_PRELOADER 1" >>confdefs.h - -fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 -printf %s "checking for library containing dlopen... " >&6; } -if test ${ac_cv_search_dlopen+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (void); -int -main (void) -{ -return dlopen (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dl -do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO" -then : - ac_cv_search_dlopen=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext - if test ${ac_cv_search_dlopen+y} -then : - break -fi -done -if test ${ac_cv_search_dlopen+y} -then : - -else case e in #( - e) ac_cv_search_dlopen=no ;; -esac -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 -printf "%s\n" "$ac_cv_search_dlopen" >&6; } -ac_res=$ac_cv_search_dlopen -if test "$ac_res" != no -then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - -ac_save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS $BUILTINFLAG" -ac_fn_c_check_func "$LINENO" "dladdr1" "ac_cv_func_dladdr1" -if test "x$ac_cv_func_dladdr1" = xyes -then : - printf "%s\n" "#define HAVE_DLADDR1 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "dlinfo" "ac_cv_func_dlinfo" -if test "x$ac_cv_func_dlinfo" = xyes -then : - printf "%s\n" "#define HAVE_DLINFO 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "epoll_create" "ac_cv_func_epoll_create" -if test "x$ac_cv_func_epoll_create" = xyes -then : - printf "%s\n" "#define HAVE_EPOLL_CREATE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "fstatfs" "ac_cv_func_fstatfs" -if test "x$ac_cv_func_fstatfs" = xyes -then : - printf "%s\n" "#define HAVE_FSTATFS 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "futimens" "ac_cv_func_futimens" -if test "x$ac_cv_func_futimens" = xyes -then : - printf "%s\n" "#define HAVE_FUTIMENS 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "futimes" "ac_cv_func_futimes" -if test "x$ac_cv_func_futimes" = xyes -then : - printf "%s\n" "#define HAVE_FUTIMES 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "futimesat" "ac_cv_func_futimesat" -if test "x$ac_cv_func_futimesat" = xyes -then : - printf "%s\n" "#define HAVE_FUTIMESAT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo" -if test "x$ac_cv_func_getaddrinfo" = xyes -then : - printf "%s\n" "#define HAVE_GETADDRINFO 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getattrlist" "ac_cv_func_getattrlist" -if test "x$ac_cv_func_getattrlist" = xyes -then : - printf "%s\n" "#define HAVE_GETATTRLIST 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getauxval" "ac_cv_func_getauxval" -if test "x$ac_cv_func_getauxval" = xyes -then : - printf "%s\n" "#define HAVE_GETAUXVAL 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs" -if test "x$ac_cv_func_getifaddrs" = xyes -then : - printf "%s\n" "#define HAVE_GETIFADDRS 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "getrandom" "ac_cv_func_getrandom" -if test "x$ac_cv_func_getrandom" = xyes -then : - printf "%s\n" "#define HAVE_GETRANDOM 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "kqueue" "ac_cv_func_kqueue" -if test "x$ac_cv_func_kqueue" = xyes -then : - printf "%s\n" "#define HAVE_KQUEUE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2" -if test "x$ac_cv_func_pipe2" = xyes -then : - printf "%s\n" "#define HAVE_PIPE2 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "port_create" "ac_cv_func_port_create" -if test "x$ac_cv_func_port_create" = xyes -then : - printf "%s\n" "#define HAVE_PORT_CREATE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise" -if test "x$ac_cv_func_posix_fadvise" = xyes -then : - printf "%s\n" "#define HAVE_POSIX_FADVISE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "posix_fallocate" "ac_cv_func_posix_fallocate" -if test "x$ac_cv_func_posix_fallocate" = xyes -then : - printf "%s\n" "#define HAVE_POSIX_FALLOCATE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "prctl" "ac_cv_func_prctl" -if test "x$ac_cv_func_prctl" = xyes -then : - printf "%s\n" "#define HAVE_PRCTL 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sched_getcpu" "ac_cv_func_sched_getcpu" -if test "x$ac_cv_func_sched_getcpu" = xyes -then : - printf "%s\n" "#define HAVE_SCHED_GETCPU 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sched_yield" "ac_cv_func_sched_yield" -if test "x$ac_cv_func_sched_yield" = xyes -then : - printf "%s\n" "#define HAVE_SCHED_YIELD 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "setproctitle" "ac_cv_func_setproctitle" -if test "x$ac_cv_func_setproctitle" = xyes -then : - printf "%s\n" "#define HAVE_SETPROCTITLE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "setprogname" "ac_cv_func_setprogname" -if test "x$ac_cv_func_setprogname" = xyes -then : - printf "%s\n" "#define HAVE_SETPROGNAME 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" -if test "x$ac_cv_func_sigprocmask" = xyes -then : - printf "%s\n" "#define HAVE_SIGPROCMASK 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "sysinfo" "ac_cv_func_sysinfo" -if test "x$ac_cv_func_sysinfo" = xyes -then : - printf "%s\n" "#define HAVE_SYSINFO 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "tcdrain" "ac_cv_func_tcdrain" -if test "x$ac_cv_func_tcdrain" = xyes -then : - printf "%s\n" "#define HAVE_TCDRAIN 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "thr_kill2" "ac_cv_func_thr_kill2" -if test "x$ac_cv_func_thr_kill2" = xyes -then : - printf "%s\n" "#define HAVE_THR_KILL2 1" >>confdefs.h - -fi - -CFLAGS="$ac_save_CFLAGS" - -ac_save_LIBS=$LIBS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 -printf %s "checking for library containing clock_gettime... " >&6; } -if test ${ac_cv_search_clock_gettime+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. - The 'extern "C"' is for builds by C++ compilers; - although this is not generally supported in C code supporting it here - has little cost and some practical benefit (sr 110532). */ -#ifdef __cplusplus -extern "C" -#endif -char clock_gettime (void); -int -main (void) -{ -return clock_gettime (); - ; - return 0; -} -_ACEOF -for ac_lib in '' rt -do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO" -then : - ac_cv_search_clock_gettime=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext - if test ${ac_cv_search_clock_gettime+y} -then : - break -fi -done -if test ${ac_cv_search_clock_gettime+y} -then : - -else case e in #( - e) ac_cv_search_clock_gettime=no ;; -esac -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 -printf "%s\n" "$ac_cv_search_clock_gettime" >&6; } -ac_res=$ac_cv_search_clock_gettime -if test "$ac_res" != no -then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h - - test "$ac_res" = "none required" || RT_LIBS="$ac_res" - -fi - -LIBS=$ac_save_LIBS - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sched_setaffinity" >&5 -printf %s "checking for sched_setaffinity... " >&6; } -if test ${wine_cv_have_sched_setaffinity+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -sched_setaffinity(0, 0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - wine_cv_have_sched_setaffinity=yes -else case e in #( - e) wine_cv_have_sched_setaffinity=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_have_sched_setaffinity" >&5 -printf "%s\n" "$wine_cv_have_sched_setaffinity" >&6; } -if test "$wine_cv_have_sched_setaffinity" = "yes" -then - -printf "%s\n" "#define HAVE_SCHED_SETAFFINITY 1" >>confdefs.h - -fi - - -ac_fn_c_check_type "$LINENO" "request_sense" "ac_cv_type_request_sense" "#include -" -if test "x$ac_cv_type_request_sense" = xyes -then : - -printf "%s\n" "#define HAVE_REQUEST_SENSE 1" >>confdefs.h - - -fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can use re-entrant gethostbyname_r Linux style" >&5 -printf %s "checking whether we can use re-entrant gethostbyname_r Linux style... " >&6; } -if test ${wine_cv_linux_gethostbyname_r_6+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ - - char *name=0; - struct hostent he; - struct hostent *result; - char *buf=0; - int bufsize=0; - int errnr; - char *addr=0; - int addrlen=0; - int addrtype=0; - gethostbyname_r(name,&he,buf,bufsize,&result,&errnr); - gethostbyaddr_r(addr, addrlen, addrtype,&he,buf,bufsize,&result,&errnr); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - wine_cv_linux_gethostbyname_r_6=yes -else case e in #( - e) wine_cv_linux_gethostbyname_r_6=no - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_linux_gethostbyname_r_6" >&5 -printf "%s\n" "$wine_cv_linux_gethostbyname_r_6" >&6; } - if test "$wine_cv_linux_gethostbyname_r_6" = "yes" - then - -printf "%s\n" "#define HAVE_LINUX_GETHOSTBYNAME_R_6 1" >>confdefs.h - - fi - -ac_fn_c_check_member "$LINENO" "struct sockaddr_un" "sun_len" "ac_cv_member_struct_sockaddr_un_sun_len" "#include -#include -#ifdef HAVE_SYS_UN_H -# include -#endif -" -if test "x$ac_cv_member_struct_sockaddr_un_sun_len" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_UN_SUN_LEN 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "scsireq_t" "cmd" "ac_cv_member_scsireq_t_cmd" "#include -#ifdef HAVE_SCSI_SG_H -#include -#endif -" -if test "x$ac_cv_member_scsireq_t_cmd" = xyes -then : - -printf "%s\n" "#define HAVE_SCSIREQ_T_CMD 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "sg_io_hdr_t" "interface_id" "ac_cv_member_sg_io_hdr_t_interface_id" "#include -#ifdef HAVE_SCSI_SG_H -#include -#endif -" -if test "x$ac_cv_member_sg_io_hdr_t_interface_id" = xyes -then : - -printf "%s\n" "#define HAVE_SG_IO_HDR_T_INTERFACE_ID 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "siginfo_t" "si_fd" "ac_cv_member_siginfo_t_si_fd" "#include -" -if test "x$ac_cv_member_siginfo_t_si_fd" = xyes -then : - -printf "%s\n" "#define HAVE_SIGINFO_T_SI_FD 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct mtget" "mt_blksiz" "ac_cv_member_struct_mtget_mt_blksiz" "#include -#ifdef HAVE_SYS_MTIO_H -#include -#endif -" -if test "x$ac_cv_member_struct_mtget_mt_blksiz" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_MTGET_MT_BLKSIZ 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct mtget" "mt_gstat" "ac_cv_member_struct_mtget_mt_gstat" "#include -#ifdef HAVE_SYS_MTIO_H -#include -#endif -" -if test "x$ac_cv_member_struct_mtget_mt_gstat" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_MTGET_MT_GSTAT 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct mtget" "mt_blkno" "ac_cv_member_struct_mtget_mt_blkno" "#include -#ifdef HAVE_SYS_MTIO_H -#include -#endif -" -if test "x$ac_cv_member_struct_mtget_mt_blkno" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_MTGET_MT_BLKNO 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct stat" "st_mtim" "ac_cv_member_struct_stat_st_mtim" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_mtim" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_MTIM 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_mtimespec" "ac_cv_member_struct_stat_st_mtimespec" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_mtimespec" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_MTIMESPEC 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_ctim" "ac_cv_member_struct_stat_st_ctim" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_ctim" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_CTIM 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_ctimespec" "ac_cv_member_struct_stat_st_ctimespec" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_ctimespec" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_CTIMESPEC 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_atim" "ac_cv_member_struct_stat_st_atim" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_atim" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIM 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec" "ac_cv_member_struct_stat_st_atimespec" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_atimespec" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIMESPEC 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtime" "ac_cv_member_struct_stat_st_birthtime" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_birthtime" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtim" "ac_cv_member_struct_stat_st_birthtim" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_birthtim" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BIRTHTIM 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec" "ac_cv_member_struct_stat_st_birthtimespec" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_birthtimespec" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "__st_birthtime" "ac_cv_member_struct_stat___st_birthtime" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat___st_birthtime" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT___ST_BIRTHTIME 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct stat" "__st_birthtim" "ac_cv_member_struct_stat___st_birthtim" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat___st_birthtim" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_STAT___ST_BIRTHTIM 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct sockaddr_in6" "sin6_scope_id" "ac_cv_member_struct_sockaddr_in6_sin6_scope_id" "#include -#ifdef HAVE_NETINET_IN_H -#include -#endif -" -if test "x$ac_cv_member_struct_sockaddr_in6_sin6_scope_id" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct __res_state" "_u._ext.nscount6" "ac_cv_member_struct___res_state__u__ext_nscount6" "#ifdef HAVE_RESOLV_H -#include -#endif -" -if test "x$ac_cv_member_struct___res_state__u__ext_nscount6" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT___RES_STATE__U__EXT_NSCOUNT6 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct in6_pktinfo" "ipi6_addr" "ac_cv_member_struct_in6_pktinfo_ipi6_addr" "#ifdef HAVE_NETINET_IN_H -#include -#endif -" -if test "x$ac_cv_member_struct_in6_pktinfo_ipi6_addr" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct ipstat" "ips_total" "ac_cv_member_struct_ipstat_ips_total" "#include -#ifdef HAVE_SYS_SOCKETVAR_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETINET_IP_VAR_H -#include -#endif -" -if test "x$ac_cv_member_struct_ipstat_ips_total" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_IPSTAT_IPS_TOTAL 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct ip_stats" "ips_total" "ac_cv_member_struct_ip_stats_ips_total" "#ifdef HAVE_NETINET_IP_VAR_H -#include -#endif -" -if test "x$ac_cv_member_struct_ip_stats_ips_total" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_IP_STATS_IPS_TOTAL 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct ip6stat" "ip6s_total" "ac_cv_member_struct_ip6stat_ip6s_total" "#include -#ifdef HAVE_SYS_SOCKETVAR_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETINET6_IP6_VAR_H -#include -#endif -" -if test "x$ac_cv_member_struct_ip6stat_ip6s_total" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_IP6STAT_IP6S_TOTAL 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct icmpstat" "icps_error" "ac_cv_member_struct_icmpstat_icps_error" "#include -#ifdef HAVE_SYS_SOCKETVAR_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETINET_IP_H -#include -#endif -#ifdef HAVE_NETINET_IP_ICMP_H -#include -#endif -#ifdef HAVE_NETINET_ICMP_VAR_H -#include -#endif -" -if test "x$ac_cv_member_struct_icmpstat_icps_error" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_ICMPSTAT_ICPS_ERROR 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct icmp6stat" "icp6s_error" "ac_cv_member_struct_icmp6stat_icp6s_error" "#include -#ifdef HAVE_SYS_SOCKETVAR_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETINET_ICMP6_H -#include -#endif -" -if test "x$ac_cv_member_struct_icmp6stat_icp6s_error" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_ICMP6STAT_ICP6S_ERROR 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct tcpstat" "tcps_connattempt" "ac_cv_member_struct_tcpstat_tcps_connattempt" "#include -#ifdef HAVE_SYS_SOCKETVAR_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETINET_TCP_H -#include -#endif -#ifdef HAVE_NETINET_TCP_VAR_H -#include -#endif -" -if test "x$ac_cv_member_struct_tcpstat_tcps_connattempt" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_TCPSTAT_TCPS_CONNATTEMPT 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct tcp_stats" "tcps_connattempt" "ac_cv_member_struct_tcp_stats_tcps_connattempt" "#ifdef HAVE_NETINET_TCP_VAR_H -#include -#endif -" -if test "x$ac_cv_member_struct_tcp_stats_tcps_connattempt" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_TCP_STATS_TCPS_CONNATTEMPT 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct udpstat" "udps_ipackets" "ac_cv_member_struct_udpstat_udps_ipackets" "#include -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_NETINET_IP_VAR_H -#include -#endif -#ifdef HAVE_NETINET_UDP_H -#include -#endif -#ifdef HAVE_NETINET_UDP_VAR_H -#include -#endif -" -if test "x$ac_cv_member_struct_udpstat_udps_ipackets" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_UDPSTAT_UDPS_IPACKETS 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct ifreq" "ifr_hwaddr" "ac_cv_member_struct_ifreq_ifr_hwaddr" "#include -#ifdef HAVE_NET_IF_H -# include -#endif -" -if test "x$ac_cv_member_struct_ifreq_ifr_hwaddr" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_IFREQ_IFR_HWADDR 1" >>confdefs.h - - -fi - - -ac_fn_c_check_member "$LINENO" "struct sysinfo" "totalram" "ac_cv_member_struct_sysinfo_totalram" "#ifdef HAVE_SYS_SYSINFO_H -# include -#endif -" -if test "x$ac_cv_member_struct_sysinfo_totalram" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_SYSINFO_TOTALRAM 1" >>confdefs.h - - -fi -ac_fn_c_check_member "$LINENO" "struct sysinfo" "mem_unit" "ac_cv_member_struct_sysinfo_mem_unit" "#ifdef HAVE_SYS_SYSINFO_H -# include -#endif -" -if test "x$ac_cv_member_struct_sysinfo_mem_unit" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_SYSINFO_MEM_UNIT 1" >>confdefs.h - - -fi - - -LIBS="$ac_save_LIBS" - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __builtin_popcount" >&5 -printf %s "checking for __builtin_popcount... " >&6; } -if test ${ac_cv_have___builtin_popcount+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -return __builtin_popcount(1) - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_have___builtin_popcount="yes" -else case e in #( - e) ac_cv_have___builtin_popcount="no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have___builtin_popcount" >&5 -printf "%s\n" "$ac_cv_have___builtin_popcount" >&6; } -if test "$ac_cv_have___builtin_popcount" = "yes" -then - -printf "%s\n" "#define HAVE___BUILTIN_POPCOUNT 1" >>confdefs.h - -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __clear_cache" >&5 -printf %s "checking for __clear_cache... " >&6; } -if test ${ac_cv_have___clear_cache+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -__clear_cache((void*)0, (void*)0); return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_have___clear_cache="yes" -else case e in #( - e) ac_cv_have___clear_cache="no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have___clear_cache" >&5 -printf "%s\n" "$ac_cv_have___clear_cache" >&6; } -if test "$ac_cv_have___clear_cache" = "yes" -then - -printf "%s\n" "#define HAVE___CLEAR_CACHE 1" >>confdefs.h - -fi - - -case $host_cpu in - *i[3456789]86*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we need to define __i386__" >&5 -printf %s "checking whether we need to define __i386__... " >&6; } -if test ${ac_cv_cpp_def___i386__+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __i386__ -#error no -#endif -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_cpp_def___i386__=yes -else case e in #( - e) ac_cv_cpp_def___i386__=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cpp_def___i386__" >&5 -printf "%s\n" "$ac_cv_cpp_def___i386__" >&6; } -if test "x$ac_cv_cpp_def___i386__" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -D__i386__" -fi ;; - *x86_64*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we need to define __x86_64__" >&5 -printf %s "checking whether we need to define __x86_64__... " >&6; } -if test ${ac_cv_cpp_def___x86_64__+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __x86_64__ -#error no -#endif -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_cpp_def___x86_64__=yes -else case e in #( - e) ac_cv_cpp_def___x86_64__=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cpp_def___x86_64__" >&5 -printf "%s\n" "$ac_cv_cpp_def___x86_64__" >&6; } -if test "x$ac_cv_cpp_def___x86_64__" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -D__x86_64__" -fi ;; - *powerpc64*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we need to define __powerpc64__" >&5 -printf %s "checking whether we need to define __powerpc64__... " >&6; } -if test ${ac_cv_cpp_def___powerpc64__+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __powerpc64__ -#error no -#endif -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_cpp_def___powerpc64__=yes -else case e in #( - e) ac_cv_cpp_def___powerpc64__=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cpp_def___powerpc64__" >&5 -printf "%s\n" "$ac_cv_cpp_def___powerpc64__" >&6; } -if test "x$ac_cv_cpp_def___powerpc64__" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -D__powerpc64__" -fi ;; - *aarch64*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we need to define __aarch64__" >&5 -printf %s "checking whether we need to define __aarch64__... " >&6; } -if test ${ac_cv_cpp_def___aarch64__+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __aarch64__ -#error no -#endif -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_cpp_def___aarch64__=yes -else case e in #( - e) ac_cv_cpp_def___aarch64__=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cpp_def___aarch64__" >&5 -printf "%s\n" "$ac_cv_cpp_def___aarch64__" >&6; } -if test "x$ac_cv_cpp_def___aarch64__" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -D__aarch64__" -fi ;; - *arm*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we need to define __arm__" >&5 -printf %s "checking whether we need to define __arm__... " >&6; } -if test ${ac_cv_cpp_def___arm__+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __arm__ -#error no -#endif -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_cpp_def___arm__=yes -else case e in #( - e) ac_cv_cpp_def___arm__=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cpp_def___arm__" >&5 -printf "%s\n" "$ac_cv_cpp_def___arm__" >&6; } -if test "x$ac_cv_cpp_def___arm__" = xyes -then : - EXTRACFLAGS="$EXTRACFLAGS -D__arm__" -fi ;; -esac - - -enable_win16=${enable_win16:-i386} -enable_vcruntime140_1=${enable_vcruntime140_1:-x86_64,arm64ec} - -if test -n "$PE_ARCHS" -then - enable_wow64=${enable_wow64:-aarch64,x86_64} - enable_wow64win=${enable_wow64win:-aarch64,x86_64} - enable_wow64cpu=${enable_wow64cpu:-x86_64} - enable_xtajit64=${enable_xtajit64:-arm64ec} -else - enable_wow64=${enable_wow64:-no} - enable_wow64win=${enable_wow64win:-no} - enable_wow64cpu=${enable_wow64cpu:-no} - enable_xtajit64=${enable_xtajit64:-no} -fi - -enable_cmd=${enable_cmd:-yes} -enable_dllhost=${enable_dllhost:-yes} -enable_dpnsvr=${enable_dpnsvr:-i386,x86_64,arm64ec} -enable_dxdiag=${enable_dxdiag:-yes} -enable_msiexec=${enable_msiexec:-yes} -enable_netsh=${enable_netsh:-yes} -enable_regsvr32=${enable_regsvr32:-yes} -enable_rundll32=${enable_rundll32:-yes} - -enable_winetest=${enable_winetest:-$enable_tests} - - - - - -ac_config_commands="$ac_config_commands include/stamp-h" - -printf %s "creating Makefile rules..." >&6 - -makedep_flags=" -C" -test "x$enable_silent_rules" = xyes && makedep_flags="$makedep_flags -S" - -wine_srcdir= -test "$srcdir" = . || wine_srcdir="$srcdir/" - -ac_config_links="$ac_config_links wine:tools/winewrapper" -wine_fn_config_symlink wine -if test "$wine_binary" = wine64 -o -n "$with_wine64"; then -ac_config_links="$ac_config_links wine64:tools/winewrapper" -wine_fn_config_symlink wine64 -fi - -wine_fn_config_makefile dlls/acledit enable_acledit -wine_fn_config_makefile dlls/aclui enable_aclui -wine_fn_config_makefile dlls/activeds.tlb enable_activeds_tlb -wine_fn_config_makefile dlls/activeds enable_activeds -wine_fn_config_makefile dlls/activeds/tests enable_tests -wine_fn_config_makefile dlls/actxprxy enable_actxprxy -wine_fn_config_makefile dlls/adsldp enable_adsldp -wine_fn_config_makefile dlls/adsldp/tests enable_tests -wine_fn_config_makefile dlls/adsldpc enable_adsldpc -wine_fn_config_makefile dlls/advapi32 enable_advapi32 -wine_fn_config_makefile dlls/advapi32/tests enable_tests -wine_fn_config_makefile dlls/advpack enable_advpack -wine_fn_config_makefile dlls/advpack/tests enable_tests -wine_fn_config_makefile dlls/amsi enable_amsi -wine_fn_config_makefile dlls/amstream enable_amstream -wine_fn_config_makefile dlls/amstream/tests enable_tests -wine_fn_config_makefile dlls/apisetschema enable_apisetschema -wine_fn_config_makefile dlls/apphelp enable_apphelp -wine_fn_config_makefile dlls/apphelp/tests enable_tests -wine_fn_config_makefile dlls/appwiz.cpl enable_appwiz_cpl -wine_fn_config_makefile dlls/appxdeploymentclient enable_appxdeploymentclient -wine_fn_config_makefile dlls/atl enable_atl -wine_fn_config_makefile dlls/atl/tests enable_tests -wine_fn_config_makefile dlls/atl100 enable_atl100 -wine_fn_config_makefile dlls/atl100/tests enable_tests -wine_fn_config_makefile dlls/atl110 enable_atl110 -wine_fn_config_makefile dlls/atl110/tests enable_tests -wine_fn_config_makefile dlls/atl80 enable_atl80 -wine_fn_config_makefile dlls/atl80/tests enable_tests -wine_fn_config_makefile dlls/atl90 enable_atl90 -wine_fn_config_makefile dlls/atlthunk enable_atlthunk -wine_fn_config_makefile dlls/atlthunk/tests enable_tests -wine_fn_config_makefile dlls/atmlib enable_atmlib -wine_fn_config_makefile dlls/authz enable_authz -wine_fn_config_makefile dlls/avicap32 enable_avicap32 -wine_fn_config_makefile dlls/avifil32 enable_avifil32 -wine_fn_config_makefile dlls/avifil32/tests enable_tests -wine_fn_config_makefile dlls/avifile.dll16 enable_win16 -wine_fn_config_makefile dlls/avrt enable_avrt -wine_fn_config_makefile dlls/bcp47langs enable_bcp47langs -wine_fn_config_makefile dlls/bcrypt enable_bcrypt -wine_fn_config_makefile dlls/bcrypt/tests enable_tests -wine_fn_config_makefile dlls/bcryptprimitives enable_bcryptprimitives -wine_fn_config_makefile dlls/bluetoothapis enable_bluetoothapis -wine_fn_config_makefile dlls/bluetoothapis/tests enable_tests -wine_fn_config_makefile dlls/browseui enable_browseui -wine_fn_config_makefile dlls/browseui/tests enable_tests -wine_fn_config_makefile dlls/bthprops.cpl enable_bthprops_cpl -wine_fn_config_makefile dlls/cabinet enable_cabinet -wine_fn_config_makefile dlls/cabinet/tests enable_tests -wine_fn_config_makefile dlls/capi2032 enable_capi2032 -wine_fn_config_makefile dlls/cards enable_cards -wine_fn_config_makefile dlls/cdosys enable_cdosys -wine_fn_config_makefile dlls/cfgmgr32 enable_cfgmgr32 -wine_fn_config_makefile dlls/cfgmgr32/tests enable_tests -wine_fn_config_makefile dlls/clusapi enable_clusapi -wine_fn_config_makefile dlls/cng.sys enable_cng_sys -wine_fn_config_makefile dlls/colorcnv enable_colorcnv -wine_fn_config_makefile dlls/combase enable_combase -wine_fn_config_makefile dlls/combase/tests enable_tests -wine_fn_config_makefile dlls/comcat enable_comcat -wine_fn_config_makefile dlls/comcat/tests enable_tests -wine_fn_config_makefile dlls/comctl32 enable_comctl32 -wine_fn_config_makefile dlls/comctl32/tests enable_tests -wine_fn_config_makefile dlls/comdlg32 enable_comdlg32 -wine_fn_config_makefile dlls/comdlg32/tests enable_tests -wine_fn_config_makefile dlls/coml2 enable_coml2 -wine_fn_config_makefile dlls/comm.drv16 enable_win16 -wine_fn_config_makefile dlls/commdlg.dll16 enable_win16 -wine_fn_config_makefile dlls/compobj.dll16 enable_win16 -wine_fn_config_makefile dlls/compstui enable_compstui -wine_fn_config_makefile dlls/compstui/tests enable_tests -wine_fn_config_makefile dlls/comsvcs enable_comsvcs -wine_fn_config_makefile dlls/comsvcs/tests enable_tests -wine_fn_config_makefile dlls/concrt140 enable_concrt140 -wine_fn_config_makefile dlls/concrt140/tests enable_tests -wine_fn_config_makefile dlls/connect enable_connect -wine_fn_config_makefile dlls/coremessaging enable_coremessaging -wine_fn_config_makefile dlls/credui enable_credui -wine_fn_config_makefile dlls/credui/tests enable_tests -wine_fn_config_makefile dlls/crtdll enable_crtdll -wine_fn_config_makefile dlls/crypt32 enable_crypt32 -wine_fn_config_makefile dlls/crypt32/tests enable_tests -wine_fn_config_makefile dlls/cryptdlg enable_cryptdlg -wine_fn_config_makefile dlls/cryptdll enable_cryptdll -wine_fn_config_makefile dlls/cryptext enable_cryptext -wine_fn_config_makefile dlls/cryptnet enable_cryptnet -wine_fn_config_makefile dlls/cryptnet/tests enable_tests -wine_fn_config_makefile dlls/cryptowinrt enable_cryptowinrt -wine_fn_config_makefile dlls/cryptowinrt/tests enable_tests -wine_fn_config_makefile dlls/cryptsp enable_cryptsp -wine_fn_config_makefile dlls/cryptui enable_cryptui -wine_fn_config_makefile dlls/cryptui/tests enable_tests -wine_fn_config_makefile dlls/ctapi32 enable_ctapi32 -wine_fn_config_makefile dlls/ctl3d.dll16 enable_win16 -wine_fn_config_makefile dlls/ctl3d32 enable_ctl3d32 -wine_fn_config_makefile dlls/ctl3dv2.dll16 enable_win16 -wine_fn_config_makefile dlls/d2d1 enable_d2d1 -wine_fn_config_makefile dlls/d2d1/tests enable_tests -wine_fn_config_makefile dlls/d3d10 enable_d3d10 -wine_fn_config_makefile dlls/d3d10/tests enable_tests -wine_fn_config_makefile dlls/d3d10_1 enable_d3d10_1 -wine_fn_config_makefile dlls/d3d10_1/tests enable_tests -wine_fn_config_makefile dlls/d3d10core enable_d3d10core -wine_fn_config_makefile dlls/d3d10core/tests enable_tests -wine_fn_config_makefile dlls/d3d11 enable_d3d11 -wine_fn_config_makefile dlls/d3d11/tests enable_tests -wine_fn_config_makefile dlls/d3d12 enable_d3d12 -wine_fn_config_makefile dlls/d3d12/tests enable_tests -wine_fn_config_makefile dlls/d3d12core enable_d3d12core -wine_fn_config_makefile dlls/d3d8 enable_d3d8 -wine_fn_config_makefile dlls/d3d8/tests enable_tests -wine_fn_config_makefile dlls/d3d8thk enable_d3d8thk -wine_fn_config_makefile dlls/d3d9 enable_d3d9 -wine_fn_config_makefile dlls/d3d9/tests enable_tests -wine_fn_config_makefile dlls/d3dcompiler_33 enable_d3dcompiler_33 -wine_fn_config_makefile dlls/d3dcompiler_34 enable_d3dcompiler_34 -wine_fn_config_makefile dlls/d3dcompiler_35 enable_d3dcompiler_35 -wine_fn_config_makefile dlls/d3dcompiler_36 enable_d3dcompiler_36 -wine_fn_config_makefile dlls/d3dcompiler_37 enable_d3dcompiler_37 -wine_fn_config_makefile dlls/d3dcompiler_38 enable_d3dcompiler_38 -wine_fn_config_makefile dlls/d3dcompiler_39 enable_d3dcompiler_39 -wine_fn_config_makefile dlls/d3dcompiler_40 enable_d3dcompiler_40 -wine_fn_config_makefile dlls/d3dcompiler_41 enable_d3dcompiler_41 -wine_fn_config_makefile dlls/d3dcompiler_42 enable_d3dcompiler_42 -wine_fn_config_makefile dlls/d3dcompiler_43 enable_d3dcompiler_43 -wine_fn_config_makefile dlls/d3dcompiler_43/tests enable_tests -wine_fn_config_makefile dlls/d3dcompiler_46 enable_d3dcompiler_46 -wine_fn_config_makefile dlls/d3dcompiler_46/tests enable_tests -wine_fn_config_makefile dlls/d3dcompiler_47 enable_d3dcompiler_47 -wine_fn_config_makefile dlls/d3dcompiler_47/tests enable_tests -wine_fn_config_makefile dlls/d3dim enable_d3dim -wine_fn_config_makefile dlls/d3dim700 enable_d3dim700 -wine_fn_config_makefile dlls/d3drm enable_d3drm -wine_fn_config_makefile dlls/d3drm/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_33 enable_d3dx10_33 -wine_fn_config_makefile dlls/d3dx10_34 enable_d3dx10_34 -wine_fn_config_makefile dlls/d3dx10_34/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_35 enable_d3dx10_35 -wine_fn_config_makefile dlls/d3dx10_35/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_36 enable_d3dx10_36 -wine_fn_config_makefile dlls/d3dx10_36/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_37 enable_d3dx10_37 -wine_fn_config_makefile dlls/d3dx10_37/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_38 enable_d3dx10_38 -wine_fn_config_makefile dlls/d3dx10_38/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_39 enable_d3dx10_39 -wine_fn_config_makefile dlls/d3dx10_39/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_40 enable_d3dx10_40 -wine_fn_config_makefile dlls/d3dx10_40/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_41 enable_d3dx10_41 -wine_fn_config_makefile dlls/d3dx10_41/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_42 enable_d3dx10_42 -wine_fn_config_makefile dlls/d3dx10_42/tests enable_tests -wine_fn_config_makefile dlls/d3dx10_43 enable_d3dx10_43 -wine_fn_config_makefile dlls/d3dx10_43/tests enable_tests -wine_fn_config_makefile dlls/d3dx11_42 enable_d3dx11_42 -wine_fn_config_makefile dlls/d3dx11_42/tests enable_tests -wine_fn_config_makefile dlls/d3dx11_43 enable_d3dx11_43 -wine_fn_config_makefile dlls/d3dx11_43/tests enable_tests -wine_fn_config_makefile dlls/d3dx9_24 enable_d3dx9_24 -wine_fn_config_makefile dlls/d3dx9_25 enable_d3dx9_25 -wine_fn_config_makefile dlls/d3dx9_26 enable_d3dx9_26 -wine_fn_config_makefile dlls/d3dx9_27 enable_d3dx9_27 -wine_fn_config_makefile dlls/d3dx9_28 enable_d3dx9_28 -wine_fn_config_makefile dlls/d3dx9_29 enable_d3dx9_29 -wine_fn_config_makefile dlls/d3dx9_30 enable_d3dx9_30 -wine_fn_config_makefile dlls/d3dx9_31 enable_d3dx9_31 -wine_fn_config_makefile dlls/d3dx9_32 enable_d3dx9_32 -wine_fn_config_makefile dlls/d3dx9_33 enable_d3dx9_33 -wine_fn_config_makefile dlls/d3dx9_34 enable_d3dx9_34 -wine_fn_config_makefile dlls/d3dx9_35 enable_d3dx9_35 -wine_fn_config_makefile dlls/d3dx9_36 enable_d3dx9_36 -wine_fn_config_makefile dlls/d3dx9_36/tests enable_tests -wine_fn_config_makefile dlls/d3dx9_37 enable_d3dx9_37 -wine_fn_config_makefile dlls/d3dx9_38 enable_d3dx9_38 -wine_fn_config_makefile dlls/d3dx9_39 enable_d3dx9_39 -wine_fn_config_makefile dlls/d3dx9_40 enable_d3dx9_40 -wine_fn_config_makefile dlls/d3dx9_41 enable_d3dx9_41 -wine_fn_config_makefile dlls/d3dx9_42 enable_d3dx9_42 -wine_fn_config_makefile dlls/d3dx9_43 enable_d3dx9_43 -wine_fn_config_makefile dlls/d3dx9_43/tests enable_tests -wine_fn_config_makefile dlls/d3dxof enable_d3dxof -wine_fn_config_makefile dlls/d3dxof/tests enable_tests -wine_fn_config_makefile dlls/dataexchange enable_dataexchange -wine_fn_config_makefile dlls/dataexchange/tests enable_tests -wine_fn_config_makefile dlls/davclnt enable_davclnt -wine_fn_config_makefile dlls/dbgeng enable_dbgeng -wine_fn_config_makefile dlls/dbgeng/tests enable_tests -wine_fn_config_makefile dlls/dbghelp enable_dbghelp -wine_fn_config_makefile dlls/dbghelp/tests enable_tests -wine_fn_config_makefile dlls/dciman32 enable_dciman32 -wine_fn_config_makefile dlls/dcomp enable_dcomp -wine_fn_config_makefile dlls/ddeml.dll16 enable_win16 -wine_fn_config_makefile dlls/ddraw enable_ddraw -wine_fn_config_makefile dlls/ddraw/tests enable_tests -wine_fn_config_makefile dlls/ddrawex enable_ddrawex -wine_fn_config_makefile dlls/ddrawex/tests enable_tests -wine_fn_config_makefile dlls/desk.cpl enable_desk_cpl -wine_fn_config_makefile dlls/devenum enable_devenum -wine_fn_config_makefile dlls/devenum/tests enable_tests -wine_fn_config_makefile dlls/dhcpcsvc enable_dhcpcsvc -wine_fn_config_makefile dlls/dhcpcsvc/tests enable_tests -wine_fn_config_makefile dlls/dhcpcsvc6 enable_dhcpcsvc6 -wine_fn_config_makefile dlls/dhtmled.ocx enable_dhtmled_ocx -wine_fn_config_makefile dlls/diasymreader enable_diasymreader -wine_fn_config_makefile dlls/difxapi enable_difxapi -wine_fn_config_makefile dlls/dinput enable_dinput -wine_fn_config_makefile dlls/dinput/tests enable_tests -wine_fn_config_makefile dlls/dinput8 enable_dinput8 -wine_fn_config_makefile dlls/directmanipulation enable_directmanipulation -wine_fn_config_makefile dlls/directmanipulation/tests enable_tests -wine_fn_config_makefile dlls/dispdib.dll16 enable_win16 -wine_fn_config_makefile dlls/dispex enable_dispex -wine_fn_config_makefile dlls/dispex/tests enable_tests -wine_fn_config_makefile dlls/display.drv16 enable_win16 -wine_fn_config_makefile dlls/dmband enable_dmband -wine_fn_config_makefile dlls/dmband/tests enable_tests -wine_fn_config_makefile dlls/dmcompos enable_dmcompos -wine_fn_config_makefile dlls/dmcompos/tests enable_tests -wine_fn_config_makefile dlls/dmime enable_dmime -wine_fn_config_makefile dlls/dmime/tests enable_tests -wine_fn_config_makefile dlls/dmloader enable_dmloader -wine_fn_config_makefile dlls/dmloader/tests enable_tests -wine_fn_config_makefile dlls/dmscript enable_dmscript -wine_fn_config_makefile dlls/dmscript/tests enable_tests -wine_fn_config_makefile dlls/dmstyle enable_dmstyle -wine_fn_config_makefile dlls/dmstyle/tests enable_tests -wine_fn_config_makefile dlls/dmsynth enable_dmsynth -wine_fn_config_makefile dlls/dmsynth/tests enable_tests -wine_fn_config_makefile dlls/dmusic enable_dmusic -wine_fn_config_makefile dlls/dmusic/tests enable_tests -wine_fn_config_makefile dlls/dmusic32 enable_dmusic32 -wine_fn_config_makefile dlls/dnsapi enable_dnsapi -wine_fn_config_makefile dlls/dnsapi/tests enable_tests -wine_fn_config_makefile dlls/dplay enable_dplay -wine_fn_config_makefile dlls/dplayx enable_dplayx -wine_fn_config_makefile dlls/dplayx/tests enable_tests -wine_fn_config_makefile dlls/dpnaddr enable_dpnaddr -wine_fn_config_makefile dlls/dpnet enable_dpnet -wine_fn_config_makefile dlls/dpnet/tests enable_tests -wine_fn_config_makefile dlls/dpnhpast enable_dpnhpast -wine_fn_config_makefile dlls/dpnhupnp enable_dpnhupnp -wine_fn_config_makefile dlls/dpnlobby enable_dpnlobby -wine_fn_config_makefile dlls/dpvoice enable_dpvoice -wine_fn_config_makefile dlls/dpvoice/tests enable_tests -wine_fn_config_makefile dlls/dpwsockx enable_dpwsockx -wine_fn_config_makefile dlls/drmclien enable_drmclien -wine_fn_config_makefile dlls/dsdmo enable_dsdmo -wine_fn_config_makefile dlls/dsdmo/tests enable_tests -wine_fn_config_makefile dlls/dsound enable_dsound -wine_fn_config_makefile dlls/dsound/tests enable_tests -wine_fn_config_makefile dlls/dsquery enable_dsquery -wine_fn_config_makefile dlls/dssenh enable_dssenh -wine_fn_config_makefile dlls/dssenh/tests enable_tests -wine_fn_config_makefile dlls/dsuiext enable_dsuiext -wine_fn_config_makefile dlls/dswave enable_dswave -wine_fn_config_makefile dlls/dswave/tests enable_tests -wine_fn_config_makefile dlls/dwmapi enable_dwmapi -wine_fn_config_makefile dlls/dwmapi/tests enable_tests -wine_fn_config_makefile dlls/dwrite enable_dwrite -wine_fn_config_makefile dlls/dwrite/tests enable_tests -wine_fn_config_makefile dlls/dx8vb enable_dx8vb -wine_fn_config_makefile dlls/dxcore enable_dxcore -wine_fn_config_makefile dlls/dxdiagn enable_dxdiagn -wine_fn_config_makefile dlls/dxdiagn/tests enable_tests -wine_fn_config_makefile dlls/dxgi enable_dxgi -wine_fn_config_makefile dlls/dxgi/tests enable_tests -wine_fn_config_makefile dlls/dxtrans enable_dxtrans -wine_fn_config_makefile dlls/dxva2 enable_dxva2 -wine_fn_config_makefile dlls/dxva2/tests enable_tests -wine_fn_config_makefile dlls/esent enable_esent -wine_fn_config_makefile dlls/evr enable_evr -wine_fn_config_makefile dlls/evr/tests enable_tests -wine_fn_config_makefile dlls/explorerframe enable_explorerframe -wine_fn_config_makefile dlls/explorerframe/tests enable_tests -wine_fn_config_makefile dlls/faultrep enable_faultrep -wine_fn_config_makefile dlls/faultrep/tests enable_tests -wine_fn_config_makefile dlls/feclient enable_feclient -wine_fn_config_makefile dlls/fltlib enable_fltlib -wine_fn_config_makefile dlls/fltmgr.sys enable_fltmgr_sys -wine_fn_config_makefile dlls/fntcache enable_fntcache -wine_fn_config_makefile dlls/fontsub enable_fontsub -wine_fn_config_makefile dlls/fusion enable_fusion -wine_fn_config_makefile dlls/fusion/tests enable_tests -wine_fn_config_makefile dlls/fwpuclnt enable_fwpuclnt -wine_fn_config_makefile dlls/gameux enable_gameux -wine_fn_config_makefile dlls/gameux/tests enable_tests -wine_fn_config_makefile dlls/gamingtcui enable_gamingtcui -wine_fn_config_makefile dlls/gdi.exe16 enable_win16 -wine_fn_config_makefile dlls/gdi32 enable_gdi32 -wine_fn_config_makefile dlls/gdi32/tests enable_tests -wine_fn_config_makefile dlls/gdiplus enable_gdiplus -wine_fn_config_makefile dlls/gdiplus/tests enable_tests -wine_fn_config_makefile dlls/geolocation enable_geolocation -wine_fn_config_makefile dlls/geolocation/tests enable_tests -wine_fn_config_makefile dlls/glu32 enable_glu32 -wine_fn_config_makefile dlls/glu32/tests enable_tests -wine_fn_config_makefile dlls/gphoto2.ds enable_gphoto2_ds -wine_fn_config_makefile dlls/gpkcsp enable_gpkcsp -wine_fn_config_makefile dlls/graphicscapture enable_graphicscapture -wine_fn_config_makefile dlls/graphicscapture/tests enable_tests -wine_fn_config_makefile dlls/hal enable_hal -wine_fn_config_makefile dlls/hhctrl.ocx enable_hhctrl_ocx -wine_fn_config_makefile dlls/hid enable_hid -wine_fn_config_makefile dlls/hid/tests enable_tests -wine_fn_config_makefile dlls/hidclass.sys enable_hidclass_sys -wine_fn_config_makefile dlls/hidparse.sys enable_hidparse_sys -wine_fn_config_makefile dlls/hlink enable_hlink -wine_fn_config_makefile dlls/hlink/tests enable_tests -wine_fn_config_makefile dlls/hnetcfg enable_hnetcfg -wine_fn_config_makefile dlls/hnetcfg/tests enable_tests -wine_fn_config_makefile dlls/hrtfapo enable_hrtfapo -wine_fn_config_makefile dlls/http.sys enable_http_sys -wine_fn_config_makefile dlls/httpapi enable_httpapi -wine_fn_config_makefile dlls/httpapi/tests enable_tests -wine_fn_config_makefile dlls/hvsimanagementapi enable_hvsimanagementapi -wine_fn_config_makefile dlls/hvsimanagementapi/tests enable_tests -wine_fn_config_makefile dlls/ia2comproxy enable_ia2comproxy -wine_fn_config_makefile dlls/iccvid enable_iccvid -wine_fn_config_makefile dlls/icmp enable_icmp -wine_fn_config_makefile dlls/icmui enable_icmui -wine_fn_config_makefile dlls/icmui/tests enable_tests -wine_fn_config_makefile dlls/ieframe enable_ieframe -wine_fn_config_makefile dlls/ieframe/tests enable_tests -wine_fn_config_makefile dlls/ieproxy enable_ieproxy -wine_fn_config_makefile dlls/iertutil enable_iertutil -wine_fn_config_makefile dlls/iertutil/tests enable_tests -wine_fn_config_makefile dlls/ifsmgr.vxd enable_win16 -wine_fn_config_makefile dlls/imaadp32.acm enable_imaadp32_acm -wine_fn_config_makefile dlls/imagehlp enable_imagehlp -wine_fn_config_makefile dlls/imagehlp/tests enable_tests -wine_fn_config_makefile dlls/imm.dll16 enable_win16 -wine_fn_config_makefile dlls/imm32 enable_imm32 -wine_fn_config_makefile dlls/imm32/tests enable_tests -wine_fn_config_makefile dlls/inetcomm enable_inetcomm -wine_fn_config_makefile dlls/inetcomm/tests enable_tests -wine_fn_config_makefile dlls/inetcpl.cpl enable_inetcpl_cpl -wine_fn_config_makefile dlls/inetmib1 enable_inetmib1 -wine_fn_config_makefile dlls/inetmib1/tests enable_tests -wine_fn_config_makefile dlls/infosoft enable_infosoft -wine_fn_config_makefile dlls/infosoft/tests enable_tests -wine_fn_config_makefile dlls/initpki enable_initpki -wine_fn_config_makefile dlls/inkobj enable_inkobj -wine_fn_config_makefile dlls/inseng enable_inseng -wine_fn_config_makefile dlls/iphlpapi enable_iphlpapi -wine_fn_config_makefile dlls/iphlpapi/tests enable_tests -wine_fn_config_makefile dlls/iprop enable_iprop -wine_fn_config_makefile dlls/ir50_32 enable_ir50_32 -wine_fn_config_makefile dlls/irprops.cpl enable_irprops_cpl -wine_fn_config_makefile dlls/itircl enable_itircl -wine_fn_config_makefile dlls/itss enable_itss -wine_fn_config_makefile dlls/itss/tests enable_tests -wine_fn_config_makefile dlls/joy.cpl enable_joy_cpl -wine_fn_config_makefile dlls/jscript enable_jscript -wine_fn_config_makefile dlls/jscript/tests enable_tests -wine_fn_config_makefile dlls/jsproxy enable_jsproxy -wine_fn_config_makefile dlls/jsproxy/tests enable_tests -wine_fn_config_makefile dlls/kerberos enable_kerberos -wine_fn_config_makefile dlls/kernel32 enable_kernel32 -wine_fn_config_makefile dlls/kernel32/tests enable_tests -wine_fn_config_makefile dlls/kernelbase enable_kernelbase -wine_fn_config_makefile dlls/kernelbase/tests enable_tests -wine_fn_config_makefile dlls/keyboard.drv16 enable_win16 -wine_fn_config_makefile dlls/krnl386.exe16 enable_win16 -wine_fn_config_makefile dlls/ksecdd.sys enable_ksecdd_sys -wine_fn_config_makefile dlls/ksproxy.ax enable_ksproxy_ax -wine_fn_config_makefile dlls/ksuser enable_ksuser -wine_fn_config_makefile dlls/ktmw32 enable_ktmw32 -wine_fn_config_makefile dlls/l3codeca.acm enable_l3codeca_acm -wine_fn_config_makefile dlls/l3codecx.ax enable_l3codecx_ax -wine_fn_config_makefile dlls/light.msstyles enable_light_msstyles -wine_fn_config_makefile dlls/loadperf enable_loadperf -wine_fn_config_makefile dlls/localspl enable_localspl -wine_fn_config_makefile dlls/localspl/tests enable_tests -wine_fn_config_makefile dlls/localui enable_localui -wine_fn_config_makefile dlls/localui/tests enable_tests -wine_fn_config_makefile dlls/lz32 enable_lz32 -wine_fn_config_makefile dlls/lz32/tests enable_tests -wine_fn_config_makefile dlls/lzexpand.dll16 enable_win16 -wine_fn_config_makefile dlls/magnification enable_magnification -wine_fn_config_makefile dlls/mapi32 enable_mapi32 -wine_fn_config_makefile dlls/mapi32/tests enable_tests -wine_fn_config_makefile dlls/mapistub enable_mapistub -wine_fn_config_makefile dlls/mciavi32 enable_mciavi32 -wine_fn_config_makefile dlls/mcicda enable_mcicda -wine_fn_config_makefile dlls/mciqtz32 enable_mciqtz32 -wine_fn_config_makefile dlls/mciseq enable_mciseq -wine_fn_config_makefile dlls/mciwave enable_mciwave -wine_fn_config_makefile dlls/mf enable_mf -wine_fn_config_makefile dlls/mf/tests enable_tests -wine_fn_config_makefile dlls/mf3216 enable_mf3216 -wine_fn_config_makefile dlls/mfasfsrcsnk enable_mfasfsrcsnk -wine_fn_config_makefile dlls/mferror enable_mferror -wine_fn_config_makefile dlls/mfh264enc enable_mfh264enc -wine_fn_config_makefile dlls/mfmediaengine enable_mfmediaengine -wine_fn_config_makefile dlls/mfmediaengine/tests enable_tests -wine_fn_config_makefile dlls/mfmp4srcsnk enable_mfmp4srcsnk -wine_fn_config_makefile dlls/mfplat enable_mfplat -wine_fn_config_makefile dlls/mfplat/tests enable_tests -wine_fn_config_makefile dlls/mfplay enable_mfplay -wine_fn_config_makefile dlls/mfplay/tests enable_tests -wine_fn_config_makefile dlls/mfreadwrite enable_mfreadwrite -wine_fn_config_makefile dlls/mfreadwrite/tests enable_tests -wine_fn_config_makefile dlls/mfsrcsnk enable_mfsrcsnk -wine_fn_config_makefile dlls/mfsrcsnk/tests enable_tests -wine_fn_config_makefile dlls/mgmtapi enable_mgmtapi -wine_fn_config_makefile dlls/midimap enable_midimap -wine_fn_config_makefile dlls/mlang enable_mlang -wine_fn_config_makefile dlls/mlang/tests enable_tests -wine_fn_config_makefile dlls/mmcndmgr enable_mmcndmgr -wine_fn_config_makefile dlls/mmcndmgr/tests enable_tests -wine_fn_config_makefile dlls/mmdevapi enable_mmdevapi -wine_fn_config_makefile dlls/mmdevapi/tests enable_tests -wine_fn_config_makefile dlls/mmdevldr.vxd enable_win16 -wine_fn_config_makefile dlls/mmsystem.dll16 enable_win16 -wine_fn_config_makefile dlls/monodebg.vxd enable_win16 -wine_fn_config_makefile dlls/mouhid.sys enable_mouhid_sys -wine_fn_config_makefile dlls/mountmgr.sys enable_mountmgr_sys -wine_fn_config_makefile dlls/mouse.drv16 enable_win16 -wine_fn_config_makefile dlls/mp3dmod enable_mp3dmod -wine_fn_config_makefile dlls/mp3dmod/tests enable_tests -wine_fn_config_makefile dlls/mpr enable_mpr -wine_fn_config_makefile dlls/mpr/tests enable_tests -wine_fn_config_makefile dlls/mprapi enable_mprapi -wine_fn_config_makefile dlls/msacm.dll16 enable_win16 -wine_fn_config_makefile dlls/msacm32.drv enable_msacm32_drv -wine_fn_config_makefile dlls/msacm32 enable_msacm32 -wine_fn_config_makefile dlls/msacm32/tests enable_tests -wine_fn_config_makefile dlls/msado15 enable_msado15 -wine_fn_config_makefile dlls/msado15/tests enable_tests -wine_fn_config_makefile dlls/msadp32.acm enable_msadp32_acm -wine_fn_config_makefile dlls/msasn1 enable_msasn1 -wine_fn_config_makefile dlls/msasn1/tests enable_tests -wine_fn_config_makefile dlls/msauddecmft enable_msauddecmft -wine_fn_config_makefile dlls/mscat32 enable_mscat32 -wine_fn_config_makefile dlls/mscms enable_mscms -wine_fn_config_makefile dlls/mscms/tests enable_tests -wine_fn_config_makefile dlls/mscoree enable_mscoree -wine_fn_config_makefile dlls/mscoree/tests enable_tests -wine_fn_config_makefile dlls/mscorwks enable_mscorwks -wine_fn_config_makefile dlls/msctf enable_msctf -wine_fn_config_makefile dlls/msctf/tests enable_tests -wine_fn_config_makefile dlls/msctfmonitor enable_msctfmonitor -wine_fn_config_makefile dlls/msctfp enable_msctfp -wine_fn_config_makefile dlls/msdaps enable_msdaps -wine_fn_config_makefile dlls/msdasql enable_msdasql -wine_fn_config_makefile dlls/msdasql/tests enable_tests -wine_fn_config_makefile dlls/msdelta enable_msdelta -wine_fn_config_makefile dlls/msdmo enable_msdmo -wine_fn_config_makefile dlls/msdmo/tests enable_tests -wine_fn_config_makefile dlls/msdrm enable_msdrm -wine_fn_config_makefile dlls/msftedit enable_msftedit -wine_fn_config_makefile dlls/msftedit/tests enable_tests -wine_fn_config_makefile dlls/msg711.acm enable_msg711_acm -wine_fn_config_makefile dlls/msgsm32.acm enable_msgsm32_acm -wine_fn_config_makefile dlls/mshtml.tlb enable_mshtml_tlb -wine_fn_config_makefile dlls/mshtml enable_mshtml -wine_fn_config_makefile dlls/mshtml/tests enable_tests -wine_fn_config_makefile dlls/msi enable_msi -wine_fn_config_makefile dlls/msi/tests enable_tests -wine_fn_config_makefile dlls/msident enable_msident -wine_fn_config_makefile dlls/msimg32 enable_msimg32 -wine_fn_config_makefile dlls/msimsg enable_msimsg -wine_fn_config_makefile dlls/msimtf enable_msimtf -wine_fn_config_makefile dlls/msisip enable_msisip -wine_fn_config_makefile dlls/msisys.ocx enable_msisys_ocx -wine_fn_config_makefile dlls/msls31 enable_msls31 -wine_fn_config_makefile dlls/msmpeg2vdec enable_msmpeg2vdec -wine_fn_config_makefile dlls/msnet32 enable_msnet32 -wine_fn_config_makefile dlls/mspatcha enable_mspatcha -wine_fn_config_makefile dlls/mspatcha/tests enable_tests -wine_fn_config_makefile dlls/msports enable_msports -wine_fn_config_makefile dlls/msrle32 enable_msrle32 -wine_fn_config_makefile dlls/msrle32/tests enable_tests -wine_fn_config_makefile dlls/msscript.ocx enable_msscript_ocx -wine_fn_config_makefile dlls/msscript.ocx/tests enable_tests -wine_fn_config_makefile dlls/mssign32 enable_mssign32 -wine_fn_config_makefile dlls/mssip32 enable_mssip32 -wine_fn_config_makefile dlls/mstask enable_mstask -wine_fn_config_makefile dlls/mstask/tests enable_tests -wine_fn_config_makefile dlls/msttsengine enable_msttsengine -wine_fn_config_makefile dlls/msv1_0 enable_msv1_0 -wine_fn_config_makefile dlls/msvcirt enable_msvcirt -wine_fn_config_makefile dlls/msvcirt/tests enable_tests -wine_fn_config_makefile dlls/msvcm80 enable_msvcm80 -wine_fn_config_makefile dlls/msvcm90 enable_msvcm90 -wine_fn_config_makefile dlls/msvcp100 enable_msvcp100 -wine_fn_config_makefile dlls/msvcp100/tests enable_tests -wine_fn_config_makefile dlls/msvcp110 enable_msvcp110 -wine_fn_config_makefile dlls/msvcp110/tests enable_tests -wine_fn_config_makefile dlls/msvcp120 enable_msvcp120 -wine_fn_config_makefile dlls/msvcp120/tests enable_tests -wine_fn_config_makefile dlls/msvcp120_app enable_msvcp120_app -wine_fn_config_makefile dlls/msvcp140 enable_msvcp140 -wine_fn_config_makefile dlls/msvcp140/tests enable_tests -wine_fn_config_makefile dlls/msvcp140_1 enable_msvcp140_1 -wine_fn_config_makefile dlls/msvcp140_1/tests enable_tests -wine_fn_config_makefile dlls/msvcp140_2 enable_msvcp140_2 -wine_fn_config_makefile dlls/msvcp140_2/tests enable_tests -wine_fn_config_makefile dlls/msvcp140_atomic_wait enable_msvcp140_atomic_wait -wine_fn_config_makefile dlls/msvcp140_atomic_wait/tests enable_tests -wine_fn_config_makefile dlls/msvcp140_codecvt_ids enable_msvcp140_codecvt_ids -wine_fn_config_makefile dlls/msvcp60 enable_msvcp60 -wine_fn_config_makefile dlls/msvcp60/tests enable_tests -wine_fn_config_makefile dlls/msvcp70 enable_msvcp70 -wine_fn_config_makefile dlls/msvcp71 enable_msvcp71 -wine_fn_config_makefile dlls/msvcp80 enable_msvcp80 -wine_fn_config_makefile dlls/msvcp90 enable_msvcp90 -wine_fn_config_makefile dlls/msvcp90/tests enable_tests -wine_fn_config_makefile dlls/msvcp_win enable_msvcp_win -wine_fn_config_makefile dlls/msvcr100 enable_msvcr100 -wine_fn_config_makefile dlls/msvcr100/tests enable_tests -wine_fn_config_makefile dlls/msvcr110 enable_msvcr110 -wine_fn_config_makefile dlls/msvcr110/tests enable_tests -wine_fn_config_makefile dlls/msvcr120 enable_msvcr120 -wine_fn_config_makefile dlls/msvcr120/tests enable_tests -wine_fn_config_makefile dlls/msvcr120_app enable_msvcr120_app -wine_fn_config_makefile dlls/msvcr70 enable_msvcr70 -wine_fn_config_makefile dlls/msvcr70/tests enable_tests -wine_fn_config_makefile dlls/msvcr71 enable_msvcr71 -wine_fn_config_makefile dlls/msvcr71/tests enable_tests -wine_fn_config_makefile dlls/msvcr80 enable_msvcr80 -wine_fn_config_makefile dlls/msvcr80/tests enable_tests -wine_fn_config_makefile dlls/msvcr90 enable_msvcr90 -wine_fn_config_makefile dlls/msvcr90/tests enable_tests -wine_fn_config_makefile dlls/msvcrt enable_msvcrt -wine_fn_config_makefile dlls/msvcrt/tests enable_tests -wine_fn_config_makefile dlls/msvcrt20 enable_msvcrt20 -wine_fn_config_makefile dlls/msvcrt40 enable_msvcrt40 -wine_fn_config_makefile dlls/msvcrtd enable_msvcrtd -wine_fn_config_makefile dlls/msvcrtd/tests enable_tests -wine_fn_config_makefile dlls/msvfw32 enable_msvfw32 -wine_fn_config_makefile dlls/msvfw32/tests enable_tests -wine_fn_config_makefile dlls/msvidc32 enable_msvidc32 -wine_fn_config_makefile dlls/msvideo.dll16 enable_win16 -wine_fn_config_makefile dlls/msvproc enable_msvproc -wine_fn_config_makefile dlls/mswsock enable_mswsock -wine_fn_config_makefile dlls/msxml enable_msxml -wine_fn_config_makefile dlls/msxml2 enable_msxml2 -wine_fn_config_makefile dlls/msxml3 enable_msxml3 -wine_fn_config_makefile dlls/msxml3/tests enable_tests -wine_fn_config_makefile dlls/msxml4 enable_msxml4 -wine_fn_config_makefile dlls/msxml4/tests enable_tests -wine_fn_config_makefile dlls/msxml6 enable_msxml6 -wine_fn_config_makefile dlls/msxml6/tests enable_tests -wine_fn_config_makefile dlls/mtxdm enable_mtxdm -wine_fn_config_makefile dlls/ncrypt enable_ncrypt -wine_fn_config_makefile dlls/ncrypt/tests enable_tests -wine_fn_config_makefile dlls/nddeapi enable_nddeapi -wine_fn_config_makefile dlls/ndis.sys enable_ndis_sys -wine_fn_config_makefile dlls/ndis.sys/tests enable_tests -wine_fn_config_makefile dlls/netapi32 enable_netapi32 -wine_fn_config_makefile dlls/netapi32/tests enable_tests -wine_fn_config_makefile dlls/netcfgx enable_netcfgx -wine_fn_config_makefile dlls/netcfgx/tests enable_tests -wine_fn_config_makefile dlls/netio.sys enable_netio_sys -wine_fn_config_makefile dlls/netprofm enable_netprofm -wine_fn_config_makefile dlls/netprofm/tests enable_tests -wine_fn_config_makefile dlls/netutils enable_netutils -wine_fn_config_makefile dlls/newdev enable_newdev -wine_fn_config_makefile dlls/ninput enable_ninput -wine_fn_config_makefile dlls/ninput/tests enable_tests -wine_fn_config_makefile dlls/normaliz enable_normaliz -wine_fn_config_makefile dlls/npmshtml enable_npmshtml -wine_fn_config_makefile dlls/npptools enable_npptools -wine_fn_config_makefile dlls/nsi enable_nsi -wine_fn_config_makefile dlls/nsi/tests enable_tests -wine_fn_config_makefile dlls/nsiproxy.sys enable_nsiproxy_sys -wine_fn_config_makefile dlls/ntdll enable_ntdll -wine_fn_config_makefile dlls/ntdll/tests enable_tests -wine_fn_config_makefile dlls/ntdsapi enable_ntdsapi -wine_fn_config_makefile dlls/ntdsapi/tests enable_tests -wine_fn_config_makefile dlls/ntoskrnl.exe enable_ntoskrnl_exe -wine_fn_config_makefile dlls/ntoskrnl.exe/tests enable_tests -wine_fn_config_makefile dlls/ntprint enable_ntprint -wine_fn_config_makefile dlls/ntprint/tests enable_tests -wine_fn_config_makefile dlls/objsel enable_objsel -wine_fn_config_makefile dlls/odbc32 enable_odbc32 -wine_fn_config_makefile dlls/odbc32/tests enable_tests -wine_fn_config_makefile dlls/odbcbcp enable_odbcbcp -wine_fn_config_makefile dlls/odbccp32 enable_odbccp32 -wine_fn_config_makefile dlls/odbccp32/tests enable_tests -wine_fn_config_makefile dlls/odbccu32 enable_odbccu32 -wine_fn_config_makefile dlls/ole2.dll16 enable_win16 -wine_fn_config_makefile dlls/ole2conv.dll16 enable_win16 -wine_fn_config_makefile dlls/ole2disp.dll16 enable_win16 -wine_fn_config_makefile dlls/ole2nls.dll16 enable_win16 -wine_fn_config_makefile dlls/ole2prox.dll16 enable_win16 -wine_fn_config_makefile dlls/ole2thk.dll16 enable_win16 -wine_fn_config_makefile dlls/ole32 enable_ole32 -wine_fn_config_makefile dlls/ole32/tests enable_tests -wine_fn_config_makefile dlls/oleacc enable_oleacc -wine_fn_config_makefile dlls/oleacc/tests enable_tests -wine_fn_config_makefile dlls/oleaut32 enable_oleaut32 -wine_fn_config_makefile dlls/oleaut32/tests enable_tests -wine_fn_config_makefile dlls/olecli.dll16 enable_win16 -wine_fn_config_makefile dlls/olecli32 enable_olecli32 -wine_fn_config_makefile dlls/oledb32 enable_oledb32 -wine_fn_config_makefile dlls/oledb32/tests enable_tests -wine_fn_config_makefile dlls/oledlg enable_oledlg -wine_fn_config_makefile dlls/oledlg/tests enable_tests -wine_fn_config_makefile dlls/olepro32 enable_olepro32 -wine_fn_config_makefile dlls/olesvr.dll16 enable_win16 -wine_fn_config_makefile dlls/olesvr32 enable_olesvr32 -wine_fn_config_makefile dlls/olethk32 enable_olethk32 -wine_fn_config_makefile dlls/opcservices enable_opcservices -wine_fn_config_makefile dlls/opcservices/tests enable_tests -wine_fn_config_makefile dlls/opencl enable_opencl -wine_fn_config_makefile dlls/opengl32 enable_opengl32 -wine_fn_config_makefile dlls/opengl32/tests enable_tests -wine_fn_config_makefile dlls/packager enable_packager -wine_fn_config_makefile dlls/packager/tests enable_tests -wine_fn_config_makefile dlls/pdh enable_pdh -wine_fn_config_makefile dlls/pdh/tests enable_tests -wine_fn_config_makefile dlls/photometadatahandler enable_photometadatahandler -wine_fn_config_makefile dlls/pidgen enable_pidgen -wine_fn_config_makefile dlls/powrprof enable_powrprof -wine_fn_config_makefile dlls/printui enable_printui -wine_fn_config_makefile dlls/prntvpt enable_prntvpt -wine_fn_config_makefile dlls/prntvpt/tests enable_tests -wine_fn_config_makefile dlls/profapi enable_profapi -wine_fn_config_makefile dlls/propsys enable_propsys -wine_fn_config_makefile dlls/propsys/tests enable_tests -wine_fn_config_makefile dlls/psapi enable_psapi -wine_fn_config_makefile dlls/psapi/tests enable_tests -wine_fn_config_makefile dlls/pstorec enable_pstorec -wine_fn_config_makefile dlls/pstorec/tests enable_tests -wine_fn_config_makefile dlls/pwrshplugin enable_pwrshplugin -wine_fn_config_makefile dlls/qasf enable_qasf -wine_fn_config_makefile dlls/qasf/tests enable_tests -wine_fn_config_makefile dlls/qcap enable_qcap -wine_fn_config_makefile dlls/qcap/tests enable_tests -wine_fn_config_makefile dlls/qdvd enable_qdvd -wine_fn_config_makefile dlls/qdvd/tests enable_tests -wine_fn_config_makefile dlls/qedit enable_qedit -wine_fn_config_makefile dlls/qedit/tests enable_tests -wine_fn_config_makefile dlls/qmgr enable_qmgr -wine_fn_config_makefile dlls/qmgr/tests enable_tests -wine_fn_config_makefile dlls/qmgrprxy enable_qmgrprxy -wine_fn_config_makefile dlls/quartz enable_quartz -wine_fn_config_makefile dlls/quartz/tests enable_tests -wine_fn_config_makefile dlls/query enable_query -wine_fn_config_makefile dlls/qwave enable_qwave -wine_fn_config_makefile dlls/qwave/tests enable_tests -wine_fn_config_makefile dlls/rasapi16.dll16 enable_win16 -wine_fn_config_makefile dlls/rasapi32 enable_rasapi32 -wine_fn_config_makefile dlls/rasapi32/tests enable_tests -wine_fn_config_makefile dlls/rasdlg enable_rasdlg -wine_fn_config_makefile dlls/regapi enable_regapi -wine_fn_config_makefile dlls/resampledmo enable_resampledmo -wine_fn_config_makefile dlls/resutils enable_resutils -wine_fn_config_makefile dlls/riched20 enable_riched20 -wine_fn_config_makefile dlls/riched20/tests enable_tests -wine_fn_config_makefile dlls/riched32 enable_riched32 -wine_fn_config_makefile dlls/riched32/tests enable_tests -wine_fn_config_makefile dlls/rometadata enable_rometadata -wine_fn_config_makefile dlls/rometadata/tests enable_tests -wine_fn_config_makefile dlls/rpcrt4 enable_rpcrt4 -wine_fn_config_makefile dlls/rpcrt4/tests enable_tests -wine_fn_config_makefile dlls/rsabase enable_rsabase -wine_fn_config_makefile dlls/rsaenh enable_rsaenh -wine_fn_config_makefile dlls/rsaenh/tests enable_tests -wine_fn_config_makefile dlls/rstrtmgr enable_rstrtmgr -wine_fn_config_makefile dlls/rtutils enable_rtutils -wine_fn_config_makefile dlls/rtworkq enable_rtworkq -wine_fn_config_makefile dlls/rtworkq/tests enable_tests -wine_fn_config_makefile dlls/samlib enable_samlib -wine_fn_config_makefile dlls/sane.ds enable_sane_ds -wine_fn_config_makefile dlls/sapi enable_sapi -wine_fn_config_makefile dlls/sapi/tests enable_tests -wine_fn_config_makefile dlls/sas enable_sas -wine_fn_config_makefile dlls/scarddlg enable_scarddlg -wine_fn_config_makefile dlls/scardsvr enable_scardsvr -wine_fn_config_makefile dlls/sccbase enable_sccbase -wine_fn_config_makefile dlls/schannel enable_schannel -wine_fn_config_makefile dlls/schannel/tests enable_tests -wine_fn_config_makefile dlls/schedsvc enable_schedsvc -wine_fn_config_makefile dlls/schedsvc/tests enable_tests -wine_fn_config_makefile dlls/scrobj enable_scrobj -wine_fn_config_makefile dlls/scrobj/tests enable_tests -wine_fn_config_makefile dlls/scrrun enable_scrrun -wine_fn_config_makefile dlls/scrrun/tests enable_tests -wine_fn_config_makefile dlls/scsiport.sys enable_scsiport_sys -wine_fn_config_makefile dlls/sechost enable_sechost -wine_fn_config_makefile dlls/secur32 enable_secur32 -wine_fn_config_makefile dlls/secur32/tests enable_tests -wine_fn_config_makefile dlls/security enable_security -wine_fn_config_makefile dlls/sensapi enable_sensapi -wine_fn_config_makefile dlls/serialui enable_serialui -wine_fn_config_makefile dlls/serialui/tests enable_tests -wine_fn_config_makefile dlls/setupapi enable_setupapi -wine_fn_config_makefile dlls/setupapi/tests enable_tests -wine_fn_config_makefile dlls/setupx.dll16 enable_win16 -wine_fn_config_makefile dlls/sfc enable_sfc -wine_fn_config_makefile dlls/sfc_os enable_sfc_os -wine_fn_config_makefile dlls/shcore enable_shcore -wine_fn_config_makefile dlls/shcore/tests enable_tests -wine_fn_config_makefile dlls/shdoclc enable_shdoclc -wine_fn_config_makefile dlls/shdocvw enable_shdocvw -wine_fn_config_makefile dlls/shdocvw/tests enable_tests -wine_fn_config_makefile dlls/shell.dll16 enable_win16 -wine_fn_config_makefile dlls/shell32 enable_shell32 -wine_fn_config_makefile dlls/shell32/tests enable_tests -wine_fn_config_makefile dlls/shfolder enable_shfolder -wine_fn_config_makefile dlls/shlwapi enable_shlwapi -wine_fn_config_makefile dlls/shlwapi/tests enable_tests -wine_fn_config_makefile dlls/slbcsp enable_slbcsp -wine_fn_config_makefile dlls/slc enable_slc -wine_fn_config_makefile dlls/slc/tests enable_tests -wine_fn_config_makefile dlls/snmpapi enable_snmpapi -wine_fn_config_makefile dlls/snmpapi/tests enable_tests -wine_fn_config_makefile dlls/softpub enable_softpub -wine_fn_config_makefile dlls/sound.drv16 enable_win16 -wine_fn_config_makefile dlls/spoolss enable_spoolss -wine_fn_config_makefile dlls/spoolss/tests enable_tests -wine_fn_config_makefile dlls/sppc enable_sppc -wine_fn_config_makefile dlls/srclient enable_srclient -wine_fn_config_makefile dlls/srvcli enable_srvcli -wine_fn_config_makefile dlls/srvsvc enable_srvsvc -wine_fn_config_makefile dlls/sspicli enable_sspicli -wine_fn_config_makefile dlls/stdole2.tlb enable_stdole2_tlb -wine_fn_config_makefile dlls/stdole32.tlb enable_stdole32_tlb -wine_fn_config_makefile dlls/sti enable_sti -wine_fn_config_makefile dlls/sti/tests enable_tests -wine_fn_config_makefile dlls/storage.dll16 enable_win16 -wine_fn_config_makefile dlls/stress.dll16 enable_win16 -wine_fn_config_makefile dlls/strmdll enable_strmdll -wine_fn_config_makefile dlls/svrapi enable_svrapi -wine_fn_config_makefile dlls/sxs enable_sxs -wine_fn_config_makefile dlls/sxs/tests enable_tests -wine_fn_config_makefile dlls/system.drv16 enable_win16 -wine_fn_config_makefile dlls/t2embed enable_t2embed -wine_fn_config_makefile dlls/t2embed/tests enable_tests -wine_fn_config_makefile dlls/tapi32 enable_tapi32 -wine_fn_config_makefile dlls/tapi32/tests enable_tests -wine_fn_config_makefile dlls/taskschd enable_taskschd -wine_fn_config_makefile dlls/taskschd/tests enable_tests -wine_fn_config_makefile dlls/tbs enable_tbs -wine_fn_config_makefile dlls/tdh enable_tdh -wine_fn_config_makefile dlls/tdi.sys enable_tdi_sys -wine_fn_config_makefile dlls/threadpoolwinrt enable_threadpoolwinrt -wine_fn_config_makefile dlls/threadpoolwinrt/tests enable_tests -wine_fn_config_makefile dlls/toolhelp.dll16 enable_win16 -wine_fn_config_makefile dlls/traffic enable_traffic -wine_fn_config_makefile dlls/twain.dll16 enable_win16 -wine_fn_config_makefile dlls/twain_32 enable_twain_32 -wine_fn_config_makefile dlls/twain_32/tests enable_tests -wine_fn_config_makefile dlls/twinapi.appcore enable_twinapi_appcore -wine_fn_config_makefile dlls/twinapi.appcore/tests enable_tests -wine_fn_config_makefile dlls/typelib.dll16 enable_win16 -wine_fn_config_makefile dlls/tzres enable_tzres -wine_fn_config_makefile dlls/ucrtbase enable_ucrtbase -wine_fn_config_makefile dlls/ucrtbase/tests enable_tests -wine_fn_config_makefile dlls/uianimation enable_uianimation -wine_fn_config_makefile dlls/uianimation/tests enable_tests -wine_fn_config_makefile dlls/uiautomationcore enable_uiautomationcore -wine_fn_config_makefile dlls/uiautomationcore/tests enable_tests -wine_fn_config_makefile dlls/uiribbon enable_uiribbon -wine_fn_config_makefile dlls/unicows enable_unicows -wine_fn_config_makefile dlls/updspapi enable_updspapi -wine_fn_config_makefile dlls/url enable_url -wine_fn_config_makefile dlls/urlmon enable_urlmon -wine_fn_config_makefile dlls/urlmon/tests enable_tests -wine_fn_config_makefile dlls/usbd.sys enable_usbd_sys -wine_fn_config_makefile dlls/user.exe16 enable_win16 -wine_fn_config_makefile dlls/user32 enable_user32 -wine_fn_config_makefile dlls/user32/tests enable_tests -wine_fn_config_makefile dlls/userenv enable_userenv -wine_fn_config_makefile dlls/userenv/tests enable_tests -wine_fn_config_makefile dlls/usp10 enable_usp10 -wine_fn_config_makefile dlls/usp10/tests enable_tests -wine_fn_config_makefile dlls/utildll enable_utildll -wine_fn_config_makefile dlls/uxtheme enable_uxtheme -wine_fn_config_makefile dlls/uxtheme/tests enable_tests -wine_fn_config_makefile dlls/vbscript enable_vbscript -wine_fn_config_makefile dlls/vbscript/tests enable_tests -wine_fn_config_makefile dlls/vcomp enable_vcomp -wine_fn_config_makefile dlls/vcomp/tests enable_tests -wine_fn_config_makefile dlls/vcomp100 enable_vcomp100 -wine_fn_config_makefile dlls/vcomp110 enable_vcomp110 -wine_fn_config_makefile dlls/vcomp110/tests enable_tests -wine_fn_config_makefile dlls/vcomp120 enable_vcomp120 -wine_fn_config_makefile dlls/vcomp140 enable_vcomp140 -wine_fn_config_makefile dlls/vcomp90 enable_vcomp90 -wine_fn_config_makefile dlls/vcruntime140 enable_vcruntime140 -wine_fn_config_makefile dlls/vcruntime140_1 enable_vcruntime140_1 -wine_fn_config_makefile dlls/vdhcp.vxd enable_win16 -wine_fn_config_makefile dlls/vdmdbg enable_vdmdbg -wine_fn_config_makefile dlls/ver.dll16 enable_win16 -wine_fn_config_makefile dlls/version enable_version -wine_fn_config_makefile dlls/version/tests enable_tests -wine_fn_config_makefile dlls/vga enable_vga -wine_fn_config_makefile dlls/virtdisk enable_virtdisk -wine_fn_config_makefile dlls/virtdisk/tests enable_tests -wine_fn_config_makefile dlls/vmm.vxd enable_win16 -wine_fn_config_makefile dlls/vnbt.vxd enable_win16 -wine_fn_config_makefile dlls/vnetbios.vxd enable_win16 -wine_fn_config_makefile dlls/vssapi enable_vssapi -wine_fn_config_makefile dlls/vtdapi.vxd enable_win16 -wine_fn_config_makefile dlls/vulkan-1 enable_vulkan_1 -wine_fn_config_makefile dlls/vulkan-1/tests enable_tests -wine_fn_config_makefile dlls/vwin32.vxd enable_win16 -wine_fn_config_makefile dlls/w32skrnl enable_win16 -wine_fn_config_makefile dlls/w32sys.dll16 enable_win16 -wine_fn_config_makefile dlls/wbemdisp enable_wbemdisp -wine_fn_config_makefile dlls/wbemdisp/tests enable_tests -wine_fn_config_makefile dlls/wbemprox enable_wbemprox -wine_fn_config_makefile dlls/wbemprox/tests enable_tests -wine_fn_config_makefile dlls/wdscore enable_wdscore -wine_fn_config_makefile dlls/webservices enable_webservices -wine_fn_config_makefile dlls/webservices/tests enable_tests -wine_fn_config_makefile dlls/websocket enable_websocket -wine_fn_config_makefile dlls/wer enable_wer -wine_fn_config_makefile dlls/wer/tests enable_tests -wine_fn_config_makefile dlls/wevtapi enable_wevtapi -wine_fn_config_makefile dlls/wevtapi/tests enable_tests -wine_fn_config_makefile dlls/wevtsvc enable_wevtsvc -wine_fn_config_makefile dlls/wiaservc enable_wiaservc -wine_fn_config_makefile dlls/wiaservc/tests enable_tests -wine_fn_config_makefile dlls/wimgapi enable_wimgapi -wine_fn_config_makefile dlls/win32s16.dll16 enable_win16 -wine_fn_config_makefile dlls/win32u enable_win32u -wine_fn_config_makefile dlls/win32u/tests enable_tests -wine_fn_config_makefile dlls/win87em.dll16 enable_win16 -wine_fn_config_makefile dlls/winaspi.dll16 enable_win16 -wine_fn_config_makefile dlls/windebug.dll16 enable_win16 -wine_fn_config_makefile dlls/windows.applicationmodel enable_windows_applicationmodel -wine_fn_config_makefile dlls/windows.applicationmodel/tests enable_tests -wine_fn_config_makefile dlls/windows.devices.bluetooth enable_windows_devices_bluetooth -wine_fn_config_makefile dlls/windows.devices.bluetooth/tests enable_tests -wine_fn_config_makefile dlls/windows.devices.enumeration enable_windows_devices_enumeration -wine_fn_config_makefile dlls/windows.devices.enumeration/tests enable_tests -wine_fn_config_makefile dlls/windows.devices.usb enable_windows_devices_usb -wine_fn_config_makefile dlls/windows.devices.usb/tests enable_tests -wine_fn_config_makefile dlls/windows.gaming.input enable_windows_gaming_input -wine_fn_config_makefile dlls/windows.gaming.input/tests enable_tests -wine_fn_config_makefile dlls/windows.gaming.ui.gamebar enable_windows_gaming_ui_gamebar -wine_fn_config_makefile dlls/windows.gaming.ui.gamebar/tests enable_tests -wine_fn_config_makefile dlls/windows.globalization enable_windows_globalization -wine_fn_config_makefile dlls/windows.globalization/tests enable_tests -wine_fn_config_makefile dlls/windows.media.devices enable_windows_media_devices -wine_fn_config_makefile dlls/windows.media.devices/tests enable_tests -wine_fn_config_makefile dlls/windows.media.mediacontrol enable_windows_media_mediacontrol -wine_fn_config_makefile dlls/windows.media.mediacontrol/tests enable_tests -wine_fn_config_makefile dlls/windows.media.speech enable_windows_media_speech -wine_fn_config_makefile dlls/windows.media.speech/tests enable_tests -wine_fn_config_makefile dlls/windows.media enable_windows_media -wine_fn_config_makefile dlls/windows.media/tests enable_tests -wine_fn_config_makefile dlls/windows.networking.connectivity enable_windows_networking_connectivity -wine_fn_config_makefile dlls/windows.networking.connectivity/tests enable_tests -wine_fn_config_makefile dlls/windows.networking.hostname enable_windows_networking_hostname -wine_fn_config_makefile dlls/windows.networking.hostname/tests enable_tests -wine_fn_config_makefile dlls/windows.networking enable_windows_networking -wine_fn_config_makefile dlls/windows.perception.stub enable_windows_perception_stub -wine_fn_config_makefile dlls/windows.perception.stub/tests enable_tests -wine_fn_config_makefile dlls/windows.security.authentication.onlineid enable_windows_security_authentication_onlineid -wine_fn_config_makefile dlls/windows.security.authentication.onlineid/tests enable_tests -wine_fn_config_makefile dlls/windows.security.credentials.ui.userconsentverifier enable_windows_security_credentials_ui_userconsentverifier -wine_fn_config_makefile dlls/windows.security.credentials.ui.userconsentverifier/tests enable_tests -wine_fn_config_makefile dlls/windows.storage.applicationdata enable_windows_storage_applicationdata -wine_fn_config_makefile dlls/windows.storage.applicationdata/tests enable_tests -wine_fn_config_makefile dlls/windows.system.profile.systemmanufacturers enable_windows_system_profile_systemmanufacturers -wine_fn_config_makefile dlls/windows.system.profile.systemmanufacturers/tests enable_tests -wine_fn_config_makefile dlls/windows.ui enable_windows_ui -wine_fn_config_makefile dlls/windows.ui/tests enable_tests -wine_fn_config_makefile dlls/windows.web enable_windows_web -wine_fn_config_makefile dlls/windows.web/tests enable_tests -wine_fn_config_makefile dlls/windowscodecs enable_windowscodecs -wine_fn_config_makefile dlls/windowscodecs/tests enable_tests -wine_fn_config_makefile dlls/windowscodecsext enable_windowscodecsext -wine_fn_config_makefile dlls/windowscodecsext/tests enable_tests -wine_fn_config_makefile dlls/winealsa.drv enable_winealsa_drv -wine_fn_config_makefile dlls/wineandroid.drv enable_wineandroid_drv -wine_fn_config_makefile dlls/winebth.sys enable_winebth_sys -wine_fn_config_makefile dlls/winebus.sys enable_winebus_sys -wine_fn_config_makefile dlls/winecoreaudio.drv enable_winecoreaudio_drv -wine_fn_config_makefile dlls/winecrt0 enable_winecrt0 -wine_fn_config_makefile dlls/wined3d enable_wined3d -wine_fn_config_makefile dlls/winedmo enable_winedmo -wine_fn_config_makefile dlls/winegstreamer enable_winegstreamer -wine_fn_config_makefile dlls/winehid.sys enable_winehid_sys -wine_fn_config_makefile dlls/winemac.drv enable_winemac_drv -wine_fn_config_makefile dlls/winemapi enable_winemapi -wine_fn_config_makefile dlls/wineoss.drv enable_wineoss_drv -wine_fn_config_makefile dlls/wineps.drv enable_wineps_drv -wine_fn_config_makefile dlls/wineps16.drv16 enable_win16 -wine_fn_config_makefile dlls/winepulse.drv enable_winepulse_drv -wine_fn_config_makefile dlls/wineusb.sys enable_wineusb_sys -wine_fn_config_makefile dlls/winevulkan enable_winevulkan -wine_fn_config_makefile dlls/winewayland.drv enable_winewayland_drv -wine_fn_config_makefile dlls/winex11.drv enable_winex11_drv -wine_fn_config_makefile dlls/winexinput.sys enable_winexinput_sys -wine_fn_config_makefile dlls/wing.dll16 enable_win16 -wine_fn_config_makefile dlls/wing32 enable_wing32 -wine_fn_config_makefile dlls/wing32/tests enable_tests -wine_fn_config_makefile dlls/winhttp enable_winhttp -wine_fn_config_makefile dlls/winhttp/tests enable_tests -wine_fn_config_makefile dlls/wininet enable_wininet -wine_fn_config_makefile dlls/wininet/tests enable_tests -wine_fn_config_makefile dlls/winmm enable_winmm -wine_fn_config_makefile dlls/winmm/tests enable_tests -wine_fn_config_makefile dlls/winnls.dll16 enable_win16 -wine_fn_config_makefile dlls/winnls32 enable_winnls32 -wine_fn_config_makefile dlls/winprint enable_winprint -wine_fn_config_makefile dlls/winscard enable_winscard -wine_fn_config_makefile dlls/winscard/tests enable_tests -wine_fn_config_makefile dlls/winsock.dll16 enable_win16 -wine_fn_config_makefile dlls/winspool.drv enable_winspool_drv -wine_fn_config_makefile dlls/winspool.drv/tests enable_tests -wine_fn_config_makefile dlls/winsta enable_winsta -wine_fn_config_makefile dlls/wintab.dll16 enable_win16 -wine_fn_config_makefile dlls/wintab32 enable_wintab32 -wine_fn_config_makefile dlls/wintab32/tests enable_tests -wine_fn_config_makefile dlls/wintrust enable_wintrust -wine_fn_config_makefile dlls/wintrust/tests enable_tests -wine_fn_config_makefile dlls/wintypes enable_wintypes -wine_fn_config_makefile dlls/wintypes/tests enable_tests -wine_fn_config_makefile dlls/winusb enable_winusb -wine_fn_config_makefile dlls/wlanapi enable_wlanapi -wine_fn_config_makefile dlls/wlanapi/tests enable_tests -wine_fn_config_makefile dlls/wlanui enable_wlanui -wine_fn_config_makefile dlls/wldap32 enable_wldap32 -wine_fn_config_makefile dlls/wldap32/tests enable_tests -wine_fn_config_makefile dlls/wldp enable_wldp -wine_fn_config_makefile dlls/wldp/tests enable_tests -wine_fn_config_makefile dlls/wmadmod enable_wmadmod -wine_fn_config_makefile dlls/wmasf enable_wmasf -wine_fn_config_makefile dlls/wmi enable_wmi -wine_fn_config_makefile dlls/wmilib.sys enable_wmilib_sys -wine_fn_config_makefile dlls/wmiutils enable_wmiutils -wine_fn_config_makefile dlls/wmiutils/tests enable_tests -wine_fn_config_makefile dlls/wmp enable_wmp -wine_fn_config_makefile dlls/wmp/tests enable_tests -wine_fn_config_makefile dlls/wmphoto enable_wmphoto -wine_fn_config_makefile dlls/wmvcore enable_wmvcore -wine_fn_config_makefile dlls/wmvcore/tests enable_tests -wine_fn_config_makefile dlls/wmvdecod enable_wmvdecod -wine_fn_config_makefile dlls/wnaspi32 enable_wnaspi32 -wine_fn_config_makefile dlls/wofutil enable_wofutil -wine_fn_config_makefile dlls/wow32 enable_win16 -wine_fn_config_makefile dlls/wow64 enable_wow64 -wine_fn_config_makefile dlls/wow64cpu enable_wow64cpu -wine_fn_config_makefile dlls/wow64win enable_wow64win -wine_fn_config_makefile dlls/wpc enable_wpc -wine_fn_config_makefile dlls/wpc/tests enable_tests -wine_fn_config_makefile dlls/wpcap enable_wpcap -wine_fn_config_makefile dlls/wpcap/tests enable_tests -wine_fn_config_makefile dlls/ws2_32 enable_ws2_32 -wine_fn_config_makefile dlls/ws2_32/tests enable_tests -wine_fn_config_makefile dlls/wsdapi enable_wsdapi -wine_fn_config_makefile dlls/wsdapi/tests enable_tests -wine_fn_config_makefile dlls/wshom.ocx enable_wshom_ocx -wine_fn_config_makefile dlls/wshom.ocx/tests enable_tests -wine_fn_config_makefile dlls/wsnmp32 enable_wsnmp32 -wine_fn_config_makefile dlls/wsnmp32/tests enable_tests -wine_fn_config_makefile dlls/wsock32 enable_wsock32 -wine_fn_config_makefile dlls/wtsapi32 enable_wtsapi32 -wine_fn_config_makefile dlls/wtsapi32/tests enable_tests -wine_fn_config_makefile dlls/wuapi enable_wuapi -wine_fn_config_makefile dlls/wuaueng enable_wuaueng -wine_fn_config_makefile dlls/x3daudio1_0 enable_x3daudio1_0 -wine_fn_config_makefile dlls/x3daudio1_1 enable_x3daudio1_1 -wine_fn_config_makefile dlls/x3daudio1_2 enable_x3daudio1_2 -wine_fn_config_makefile dlls/x3daudio1_3 enable_x3daudio1_3 -wine_fn_config_makefile dlls/x3daudio1_4 enable_x3daudio1_4 -wine_fn_config_makefile dlls/x3daudio1_5 enable_x3daudio1_5 -wine_fn_config_makefile dlls/x3daudio1_6 enable_x3daudio1_6 -wine_fn_config_makefile dlls/x3daudio1_7 enable_x3daudio1_7 -wine_fn_config_makefile dlls/xactengine2_0 enable_xactengine2_0 -wine_fn_config_makefile dlls/xactengine2_4 enable_xactengine2_4 -wine_fn_config_makefile dlls/xactengine2_7 enable_xactengine2_7 -wine_fn_config_makefile dlls/xactengine2_9 enable_xactengine2_9 -wine_fn_config_makefile dlls/xactengine3_0 enable_xactengine3_0 -wine_fn_config_makefile dlls/xactengine3_1 enable_xactengine3_1 -wine_fn_config_makefile dlls/xactengine3_2 enable_xactengine3_2 -wine_fn_config_makefile dlls/xactengine3_3 enable_xactengine3_3 -wine_fn_config_makefile dlls/xactengine3_4 enable_xactengine3_4 -wine_fn_config_makefile dlls/xactengine3_5 enable_xactengine3_5 -wine_fn_config_makefile dlls/xactengine3_6 enable_xactengine3_6 -wine_fn_config_makefile dlls/xactengine3_7 enable_xactengine3_7 -wine_fn_config_makefile dlls/xactengine3_7/tests enable_tests -wine_fn_config_makefile dlls/xapofx1_1 enable_xapofx1_1 -wine_fn_config_makefile dlls/xapofx1_2 enable_xapofx1_2 -wine_fn_config_makefile dlls/xapofx1_3 enable_xapofx1_3 -wine_fn_config_makefile dlls/xapofx1_4 enable_xapofx1_4 -wine_fn_config_makefile dlls/xapofx1_5 enable_xapofx1_5 -wine_fn_config_makefile dlls/xaudio2_0 enable_xaudio2_0 -wine_fn_config_makefile dlls/xaudio2_1 enable_xaudio2_1 -wine_fn_config_makefile dlls/xaudio2_2 enable_xaudio2_2 -wine_fn_config_makefile dlls/xaudio2_3 enable_xaudio2_3 -wine_fn_config_makefile dlls/xaudio2_4 enable_xaudio2_4 -wine_fn_config_makefile dlls/xaudio2_5 enable_xaudio2_5 -wine_fn_config_makefile dlls/xaudio2_6 enable_xaudio2_6 -wine_fn_config_makefile dlls/xaudio2_7 enable_xaudio2_7 -wine_fn_config_makefile dlls/xaudio2_7/tests enable_tests -wine_fn_config_makefile dlls/xaudio2_8 enable_xaudio2_8 -wine_fn_config_makefile dlls/xaudio2_8/tests enable_tests -wine_fn_config_makefile dlls/xaudio2_9 enable_xaudio2_9 -wine_fn_config_makefile dlls/xinput1_1 enable_xinput1_1 -wine_fn_config_makefile dlls/xinput1_2 enable_xinput1_2 -wine_fn_config_makefile dlls/xinput1_3 enable_xinput1_3 -wine_fn_config_makefile dlls/xinput1_3/tests enable_tests -wine_fn_config_makefile dlls/xinput1_4 enable_xinput1_4 -wine_fn_config_makefile dlls/xinput9_1_0 enable_xinput9_1_0 -wine_fn_config_makefile dlls/xinputuap enable_xinputuap -wine_fn_config_makefile dlls/xmllite enable_xmllite -wine_fn_config_makefile dlls/xmllite/tests enable_tests -wine_fn_config_makefile dlls/xolehlp enable_xolehlp -wine_fn_config_makefile dlls/xpsprint enable_xpsprint -wine_fn_config_makefile dlls/xpssvcs enable_xpssvcs -wine_fn_config_makefile dlls/xtajit64 enable_xtajit64 -wine_fn_config_makefile fonts enable_fonts -wine_fn_config_makefile include enable_include -wine_fn_config_makefile libs/adsiid enable_adsiid -wine_fn_config_makefile libs/capstone enable_capstone -wine_fn_config_makefile libs/dmoguids enable_dmoguids -wine_fn_config_makefile libs/dxerr8 enable_dxerr8 -wine_fn_config_makefile libs/dxerr9 enable_dxerr9 -wine_fn_config_makefile libs/dxguid enable_dxguid -wine_fn_config_makefile libs/faudio enable_faudio -wine_fn_config_makefile libs/fluidsynth enable_fluidsynth -wine_fn_config_makefile libs/gsm enable_gsm -wine_fn_config_makefile libs/jpeg enable_jpeg -wine_fn_config_makefile libs/jxr enable_jxr -wine_fn_config_makefile libs/lcms2 enable_lcms2 -wine_fn_config_makefile libs/ldap enable_ldap -wine_fn_config_makefile libs/mfuuid enable_mfuuid -wine_fn_config_makefile libs/mpg123 enable_mpg123 -wine_fn_config_makefile libs/musl enable_musl -wine_fn_config_makefile libs/png enable_png -wine_fn_config_makefile libs/strmbase enable_strmbase -wine_fn_config_makefile libs/strmiids enable_strmiids -wine_fn_config_makefile libs/tiff enable_tiff -wine_fn_config_makefile libs/uuid enable_uuid -wine_fn_config_makefile libs/vkd3d enable_vkd3d -wine_fn_config_makefile libs/wbemuuid enable_wbemuuid -wine_fn_config_makefile libs/wmcodecdspuuid enable_wmcodecdspuuid -wine_fn_config_makefile libs/xml2 enable_xml2 -wine_fn_config_makefile libs/xslt enable_xslt -wine_fn_config_makefile libs/zlib enable_zlib -wine_fn_config_makefile loader enable_loader -wine_fn_config_makefile nls enable_nls -wine_fn_config_makefile po enable_po -wine_fn_config_makefile programs/arp enable_arp -wine_fn_config_makefile programs/aspnet_regiis enable_aspnet_regiis -wine_fn_config_makefile programs/attrib enable_attrib -wine_fn_config_makefile programs/cabarc enable_cabarc -wine_fn_config_makefile programs/cacls enable_cacls -wine_fn_config_makefile programs/certutil enable_certutil -wine_fn_config_makefile programs/chcp.com enable_chcp_com -wine_fn_config_makefile programs/clock enable_clock -wine_fn_config_makefile programs/cmd enable_cmd -wine_fn_config_makefile programs/cmd/tests enable_tests -wine_fn_config_makefile programs/conhost enable_conhost -wine_fn_config_makefile programs/conhost/tests enable_tests -wine_fn_config_makefile programs/control enable_control -wine_fn_config_makefile programs/cscript enable_cscript -wine_fn_config_makefile programs/dism enable_dism -wine_fn_config_makefile programs/dllhost enable_dllhost -wine_fn_config_makefile programs/dplaysvr enable_dplaysvr -wine_fn_config_makefile programs/dpnsvr enable_dpnsvr -wine_fn_config_makefile programs/dpvsetup enable_dpvsetup -wine_fn_config_makefile programs/dxdiag enable_dxdiag -wine_fn_config_makefile programs/eject enable_eject -wine_fn_config_makefile programs/expand enable_expand -wine_fn_config_makefile programs/explorer enable_explorer -wine_fn_config_makefile programs/explorer/tests enable_tests -wine_fn_config_makefile programs/extrac32 enable_extrac32 -wine_fn_config_makefile programs/fc enable_fc -wine_fn_config_makefile programs/fc/tests enable_tests -wine_fn_config_makefile programs/find enable_find -wine_fn_config_makefile programs/find/tests enable_tests -wine_fn_config_makefile programs/findstr enable_findstr -wine_fn_config_makefile programs/findstr/tests enable_tests -wine_fn_config_makefile programs/fsutil enable_fsutil -wine_fn_config_makefile programs/fsutil/tests enable_tests -wine_fn_config_makefile programs/hh enable_hh -wine_fn_config_makefile programs/hostname enable_hostname -wine_fn_config_makefile programs/icacls enable_icacls -wine_fn_config_makefile programs/icinfo enable_icinfo -wine_fn_config_makefile programs/iexplore enable_iexplore -wine_fn_config_makefile programs/ipconfig enable_ipconfig -wine_fn_config_makefile programs/klist enable_klist -wine_fn_config_makefile programs/lodctr enable_lodctr -wine_fn_config_makefile programs/mofcomp enable_mofcomp -wine_fn_config_makefile programs/mshta enable_mshta -wine_fn_config_makefile programs/msidb enable_msidb -wine_fn_config_makefile programs/msiexec enable_msiexec -wine_fn_config_makefile programs/msinfo32 enable_msinfo32 -wine_fn_config_makefile programs/net enable_net -wine_fn_config_makefile programs/net/tests enable_tests -wine_fn_config_makefile programs/netsh enable_netsh -wine_fn_config_makefile programs/netstat enable_netstat -wine_fn_config_makefile programs/ngen enable_ngen -wine_fn_config_makefile programs/notepad enable_notepad -wine_fn_config_makefile programs/oleview enable_oleview -wine_fn_config_makefile programs/ping enable_ping -wine_fn_config_makefile programs/plugplay enable_plugplay -wine_fn_config_makefile programs/pnputil enable_pnputil -wine_fn_config_makefile programs/powershell enable_powershell -wine_fn_config_makefile programs/presentationfontcache enable_presentationfontcache -wine_fn_config_makefile programs/progman enable_progman -wine_fn_config_makefile programs/reg enable_reg -wine_fn_config_makefile programs/reg/tests enable_tests -wine_fn_config_makefile programs/regasm enable_regasm -wine_fn_config_makefile programs/regedit enable_regedit -wine_fn_config_makefile programs/regedit/tests enable_tests -wine_fn_config_makefile programs/regini enable_regini -wine_fn_config_makefile programs/regsvcs enable_regsvcs -wine_fn_config_makefile programs/regsvr32 enable_regsvr32 -wine_fn_config_makefile programs/robocopy enable_robocopy -wine_fn_config_makefile programs/rpcss enable_rpcss -wine_fn_config_makefile programs/rundll.exe16 enable_win16 -wine_fn_config_makefile programs/rundll32 enable_rundll32 -wine_fn_config_makefile programs/sc enable_sc -wine_fn_config_makefile programs/sc/tests enable_tests -wine_fn_config_makefile programs/schtasks enable_schtasks -wine_fn_config_makefile programs/schtasks/tests enable_tests -wine_fn_config_makefile programs/sdbinst enable_sdbinst -wine_fn_config_makefile programs/secedit enable_secedit -wine_fn_config_makefile programs/servicemodelreg enable_servicemodelreg -wine_fn_config_makefile programs/services enable_services -wine_fn_config_makefile programs/services/tests enable_tests -wine_fn_config_makefile programs/setx enable_setx -wine_fn_config_makefile programs/shutdown enable_shutdown -wine_fn_config_makefile programs/sort enable_sort -wine_fn_config_makefile programs/spoolsv enable_spoolsv -wine_fn_config_makefile programs/start enable_start -wine_fn_config_makefile programs/subst enable_subst -wine_fn_config_makefile programs/svchost enable_svchost -wine_fn_config_makefile programs/systeminfo enable_systeminfo -wine_fn_config_makefile programs/taskkill enable_taskkill -wine_fn_config_makefile programs/tasklist enable_tasklist -wine_fn_config_makefile programs/tasklist/tests enable_tests -wine_fn_config_makefile programs/taskmgr enable_taskmgr -wine_fn_config_makefile programs/termsv enable_termsv -wine_fn_config_makefile programs/uninstaller enable_uninstaller -wine_fn_config_makefile programs/unlodctr enable_unlodctr -wine_fn_config_makefile programs/view enable_view -wine_fn_config_makefile programs/wevtutil enable_wevtutil -wine_fn_config_makefile programs/where enable_where -wine_fn_config_makefile programs/whoami enable_whoami -wine_fn_config_makefile programs/wineboot enable_wineboot -wine_fn_config_makefile programs/winebrowser enable_winebrowser -wine_fn_config_makefile programs/winecfg enable_winecfg -wine_fn_config_makefile programs/wineconsole enable_wineconsole -wine_fn_config_makefile programs/winedbg enable_winedbg -wine_fn_config_makefile programs/winedevice enable_winedevice -wine_fn_config_makefile programs/winefile enable_winefile -wine_fn_config_makefile programs/winemenubuilder enable_winemenubuilder -wine_fn_config_makefile programs/winemine enable_winemine -wine_fn_config_makefile programs/winemsibuilder enable_winemsibuilder -wine_fn_config_makefile programs/winepath enable_winepath -wine_fn_config_makefile programs/winetest enable_winetest -wine_fn_config_makefile programs/winevdm enable_win16 -wine_fn_config_makefile programs/winhelp.exe16 enable_win16 -wine_fn_config_makefile programs/winhlp32 enable_winhlp32 -wine_fn_config_makefile programs/winmgmt enable_winmgmt -wine_fn_config_makefile programs/winoldap.mod16 enable_win16 -wine_fn_config_makefile programs/winver enable_winver -wine_fn_config_makefile programs/wmic enable_wmic -wine_fn_config_makefile programs/wmplayer enable_wmplayer -wine_fn_config_makefile programs/wordpad enable_wordpad -wine_fn_config_makefile programs/write enable_write -wine_fn_config_makefile programs/wscript enable_wscript -wine_fn_config_makefile programs/wscript/tests enable_tests -wine_fn_config_makefile programs/wuauserv enable_wuauserv -wine_fn_config_makefile programs/wusa enable_wusa -wine_fn_config_makefile programs/xcopy enable_xcopy -wine_fn_config_makefile programs/xcopy/tests enable_tests -wine_fn_config_makefile server enable_server -test "x$enable_tools" = xno || wine_fn_config_makefile tools enable_tools -test "x$enable_tools" = xno || wine_fn_config_makefile tools/sfnt2fon enable_sfnt2fon -test "x$enable_tools" = xno || wine_fn_config_makefile tools/widl enable_widl -test "x$enable_tools" = xno || wine_fn_config_makefile tools/winebuild enable_winebuild -test "x$enable_tools" = xno || wine_fn_config_makefile tools/winedump enable_winedump -test "x$enable_tools" = xno || wine_fn_config_makefile tools/winegcc enable_winegcc -test "x$enable_tools" = xno || wine_fn_config_makefile tools/winemaker enable_winemaker -test "x$enable_tools" = xno || wine_fn_config_makefile tools/wmc enable_wmc -test "x$enable_tools" = xno || wine_fn_config_makefile tools/wrc enable_wrc - - -as_fn_append CONFIGURE_TARGETS " TAGS" -as_fn_append CONFIGURE_TARGETS " tags" -as_fn_append CONFIGURE_TARGETS " autom4te.cache" -as_fn_append CONFIGURE_TARGETS " compile_commands.json" -as_fn_append CONFIGURE_TARGETS " config.log" -as_fn_append CONFIGURE_TARGETS " config.status" -as_fn_append CONFIGURE_TARGETS " include/config.h" -as_fn_append CONFIGURE_TARGETS " include/stamp-h" -test "$wine_binary" = wine || as_fn_append CONFIGURE_TARGETS " loader/wine" - -if test "x$enable_tools" != xno -then - ac_config_commands="$ac_config_commands tools/makedep" - -fi - -ac_config_commands="$ac_config_commands Makefile" - - - -SHELL=/bin/sh - - - -as_fn_append wine_rules " -all: wine - @echo \"Wine build complete.\" -Makefile: config.status - @./config.status Makefile -config.status: ${wine_srcdir}configure - @./config.status --recheck -include/config.h: include/stamp-h -include/stamp-h: ${wine_srcdir}include/config.h.in config.status - @./config.status include/config.h include/stamp-h" - -if test "x$enable_maintainer_mode" = xyes -then - as_fn_append wine_rules " -configure: configure.ac aclocal.m4 - autoconf --warnings=all -include/config.h.in: include/stamp-h.in -include/stamp-h.in: configure.ac aclocal.m4 - autoheader --warnings=all - @echo timestamp > \$@" -fi - - -if test -n "$with_wine64" -then - case "$with_wine64" in - /*) reldir="" ;; - *) reldir="../" ;; - esac - rm -f fonts server 2>/dev/null - as_fn_append wine_rules " -all: loader/wine64 loader/wine64-preloader $with_wine64/loader/wine $with_wine64/loader/wine-preloader -loader/wine64 loader/wine64-preloader: - rm -f \$@ && \$(LN_S) $reldir$with_wine64/\$@ \$@ -$with_wine64/loader/wine: - rm -f \$@ && \$(LN_S) $ac_pwd/loader/wine \$@ -$with_wine64/loader/wine-preloader: - rm -f \$@ && \$(LN_S) $ac_pwd/loader/wine-preloader \$@ -clean:: - rm -f loader/wine64 loader/wine64-preloader $with_wine64/loader/wine $with_wine64/loader/wine-preloader" -else - TOP_INSTALL_DEV="$TOP_INSTALL_DEV include" - TOP_INSTALL_LIB="$TOP_INSTALL_LIB \ -fonts \ -loader/wine.inf \ -nls \ -programs/msidb/msidb \ -programs/msiexec/msiexec \ -programs/notepad/notepad \ -programs/regedit/regedit \ -programs/regsvr32/regsvr32 \ -programs/wineboot/wineboot \ -programs/winecfg/winecfg \ -programs/wineconsole/wineconsole \ -programs/winedbg/winedbg \ -programs/winefile/winefile \ -programs/winemine/winemine \ -programs/winepath/winepath \ -server/wineserver" - - case $host_os in - cygwin*|mingw32*|darwin*|macosx*|linux-android*) ;; - *) TOP_INSTALL_LIB="$TOP_INSTALL_LIB loader/wine.desktop" ;; - esac -fi - - -as_fn_append wine_rules " -distclean:: clean - rm -rf autom4te.cache -maintainer-clean:: - rm -f configure include/config.h.in" - - -as_fn_append wine_rules " -dlls/ntdll/unix/version.c: dummy - @version=\`(GIT_DIR=${wine_srcdir}.git git describe HEAD 2>/dev/null || echo \"wine-\$(PACKAGE_VERSION)\") | sed -n -e '\$\$s/\(.*\)/const char wine_build[] = \"\\1\";/p'\` && (echo \$\$version | cmp -s - \$@) || echo \$\$version >\$@ || (rm -f \$@ && exit 1) -programs/winetest/build.rc: dummy - @build=\"STRINGTABLE { 1 \\\"\`GIT_DIR=${wine_srcdir}.git git rev-parse HEAD 2>/dev/null\`\\\" }\" && (echo \$\$build | cmp -s - \$@) || echo \$\$build >\$@ || (rm -f \$@ && exit 1) -programs/winetest/build.nfo: - @-\$(CC) -v 2>\$@ -dlls/wineandroid.drv/wine-debug.apk: dlls/wineandroid.drv/build.gradle ${wine_srcdir}dlls/wineandroid.drv/AndroidManifest.xml ${wine_srcdir}dlls/wineandroid.drv/WineActivity.java ${wine_srcdir}dlls/wineandroid.drv/wine.svg - cd dlls/wineandroid.drv && gradle -q -Psrcdir=$srcdir assembleDebug - mv dlls/wineandroid.drv/build/outputs/apk/wine-debug.apk \$@" - - -TAGSFLAGS="--langmap='c:+.idl.l.rh,make:(Make*.in)'" - -as_fn_append wine_rules " -TAGS etags: - rm -f TAGS - (test -d .git && git ls-files || find -L $srcdir -name '*.[ch]' -print) | xargs etags -a \$(TAGSFLAGS) -tags ctags: - rm -f tags - (test -d .git && git ls-files || find -L $srcdir -name '*.[ch]' -print) | xargs ctags -a \$(TAGSFLAGS) -dummy: -.PHONY: dummy" - -printf "%s\n" " done" >&6 -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# 'ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* 'ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # 'set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # 'set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -printf "%s\n" "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -# Check whether --enable-year2038 was given. -if test ${enable_year2038+y} -then : - enableval=$enable_year2038; -fi - - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else case e in #( - e) case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac ;; -esac -fi - - - -# Reset variables that may have inherited troublesome values from -# the environment. - -# IFS needs to be set, to space, tab, and newline, in precisely that order. -# (If _AS_PATH_WALK were called with IFS unset, it would have the -# side effect of setting IFS to empty, thus disabling word splitting.) -# Quoting is to prevent editors from complaining about space-tab. -as_nl=' -' -export as_nl -IFS=" "" $as_nl" - -PS1='$ ' -PS2='> ' -PS4='+ ' - -# Ensure predictable behavior from utilities with locale-dependent output. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# We cannot yet rely on "unset" to work, but we need these variables -# to be unset--not just set to an empty or harmless value--now, to -# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct -# also avoids known problems related to "unset" and subshell syntax -# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). -for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH -do eval test \${$as_var+y} \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done - -# Ensure that fds 0, 1, and 2 are open. -if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi -if (exec 3>&2) ; then :; else exec 2>/dev/null; fi - -# The user is always right. -if ${PATH_SEPARATOR+false} :; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - test -r "$as_dir$0" && as_myself=$as_dir$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as 'sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - printf "%s\n" "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null -then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else case e in #( - e) as_fn_append () - { - eval $1=\$$1\$2 - } ;; -esac -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null -then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else case e in #( - e) as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } ;; -esac -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. - # In both cases, we have to default to 'cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" -as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated - -# Sed expression to map a string onto a valid variable name. -as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" -as_tr_sh="eval sed '$as_sed_sh'" # deprecated - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by Wine $as_me 10.0, which was -generated by GNU Autoconf 2.72. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_headers="$ac_config_headers" -config_links="$ac_config_links" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -'$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration headers: -$config_headers - -Configuration links: -$config_links - -Configuration commands: -$config_commands - -Report bugs to . -Wine home page: ." - -_ACEOF -ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` -ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config='$ac_cs_config_escaped' -ac_cs_version="\\ -Wine config.status 10.0 -configured by $0, generated by GNU Autoconf 2.72, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2023 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - printf "%s\n" "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - printf "%s\n" "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: '$1' -Try '$0 --help' for more information.";; - --help | --hel | -h ) - printf "%s\n" "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: '$1' -Try '$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - printf "%s\n" "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -wine_fn_output_makedep () -{ - as_dir=tools; as_fn_mkdir_p - $CC -c -I${wine_srcdir}tools -Iinclude -I${wine_srcdir}include -D__WINESRC__ -DWINE_UNIX_LIB $EXTRACFLAGS $CPPFLAGS $CFLAGS -o tools/makedep.o ${wine_srcdir}tools/makedep.c - $CC -o tools/makedep$ac_exeext tools/makedep.o $LDFLAGS -} -wine_fn_output_makefile () -{ - cat <<\_WINE_EOF >\$tmp/makefile && mv -f \$tmp/makefile \$1 && "$wine_makedep"$makedep_flags && return -# This Makefile understands the following targets: -# -# all (default): build wine -# clean: remove all intermediate files -# distclean: also remove all files created by configure -# test: run tests -# testclean: clean test results to force running all tests again -# install-lib: install libraries needed to run applications -# install-dev: install development environment -# install: install everything -# uninstall: uninstall everything -# ctags: create a tags file for vim and others. -# etags: create a TAGS file for Emacs. - -SHELL = $SHELL -PATH_SEPARATOR = $PATH_SEPARATOR -PACKAGE_NAME = $PACKAGE_NAME -PACKAGE_TARNAME = $PACKAGE_TARNAME -PACKAGE_VERSION = $PACKAGE_VERSION -PACKAGE_STRING = $PACKAGE_STRING -PACKAGE_BUGREPORT = $PACKAGE_BUGREPORT -PACKAGE_URL = $PACKAGE_URL -exec_prefix = $exec_prefix -prefix = $prefix -program_transform_name = $program_transform_name -bindir = $bindir -sbindir = $sbindir -libexecdir = $libexecdir -datarootdir = $datarootdir -datadir = $datadir -sysconfdir = $sysconfdir -sharedstatedir = $sharedstatedir -localstatedir = $localstatedir -runstatedir = $runstatedir -includedir = $includedir -oldincludedir = $oldincludedir -docdir = $docdir -infodir = $infodir -htmldir = $htmldir -dvidir = $dvidir -pdfdir = $pdfdir -psdir = $psdir -libdir = $libdir -localedir = $localedir -mandir = $mandir -DEFS = $DEFS -ECHO_C = $ECHO_C -ECHO_N = $ECHO_N -ECHO_T = $ECHO_T -LIBS = $LIBS -build_alias = $build_alias -host_alias = $host_alias -target_alias = $target_alias -system_dllpath = $system_dllpath -build = $build -build_cpu = $build_cpu -build_vendor = $build_vendor -build_os = $build_os -host = $host -host_cpu = $host_cpu -host_vendor = $host_vendor -host_os = $host_os -srcdir = $srcdir -SARIF_CONVERTER = $SARIF_CONVERTER -CC = $CC -CFLAGS = $CFLAGS -LDFLAGS = $LDFLAGS -CPPFLAGS = $CPPFLAGS -ac_ct_CC = $ac_ct_CC -EXEEXT = $EXEEXT -OBJEXT = $OBJEXT -CXX = $CXX -CXXFLAGS = $CXXFLAGS -ac_ct_CXX = $ac_ct_CXX -CPPBIN = $CPPBIN -LD = $LD -TARGETFLAGS = $TARGETFLAGS -toolsext = $toolsext -HOST_ARCH = $HOST_ARCH -aarch64_CC = $aarch64_CC -aarch64_CFLAGS = $aarch64_CFLAGS -aarch64_EXTRACFLAGS = $aarch64_EXTRACFLAGS -aarch64_LDFLAGS = $aarch64_LDFLAGS -aarch64_DEBUG = $aarch64_DEBUG -aarch64_TARGET = $aarch64_TARGET -aarch64_STRIP = $aarch64_STRIP -aarch64_DELAYLOADFLAG = $aarch64_DELAYLOADFLAG -aarch64_DISABLED_SUBDIRS = $aarch64_DISABLED_SUBDIRS -arm_CC = $arm_CC -arm_CFLAGS = $arm_CFLAGS -arm_EXTRACFLAGS = $arm_EXTRACFLAGS -arm_LDFLAGS = $arm_LDFLAGS -arm_DEBUG = $arm_DEBUG -arm_TARGET = $arm_TARGET -arm_STRIP = $arm_STRIP -arm_DELAYLOADFLAG = $arm_DELAYLOADFLAG -arm_DISABLED_SUBDIRS = $arm_DISABLED_SUBDIRS -arm64ec_CC = $arm64ec_CC -arm64ec_CFLAGS = $arm64ec_CFLAGS -arm64ec_EXTRACFLAGS = $arm64ec_EXTRACFLAGS -arm64ec_LDFLAGS = $arm64ec_LDFLAGS -arm64ec_DEBUG = $arm64ec_DEBUG -arm64ec_TARGET = $arm64ec_TARGET -arm64ec_STRIP = $arm64ec_STRIP -arm64ec_DELAYLOADFLAG = $arm64ec_DELAYLOADFLAG -arm64ec_DISABLED_SUBDIRS = $arm64ec_DISABLED_SUBDIRS -i386_CC = $i386_CC -i386_CFLAGS = $i386_CFLAGS -i386_EXTRACFLAGS = $i386_EXTRACFLAGS -i386_LDFLAGS = $i386_LDFLAGS -i386_DEBUG = $i386_DEBUG -i386_TARGET = $i386_TARGET -i386_STRIP = $i386_STRIP -i386_DELAYLOADFLAG = $i386_DELAYLOADFLAG -i386_DISABLED_SUBDIRS = $i386_DISABLED_SUBDIRS -x86_64_CC = $x86_64_CC -x86_64_CFLAGS = $x86_64_CFLAGS -x86_64_EXTRACFLAGS = $x86_64_EXTRACFLAGS -x86_64_LDFLAGS = $x86_64_LDFLAGS -x86_64_DEBUG = $x86_64_DEBUG -x86_64_TARGET = $x86_64_TARGET -x86_64_STRIP = $x86_64_STRIP -x86_64_DELAYLOADFLAG = $x86_64_DELAYLOADFLAG -x86_64_DISABLED_SUBDIRS = $x86_64_DISABLED_SUBDIRS -toolsdir = $toolsdir -RUNTESTFLAGS = $RUNTESTFLAGS -SED_CMD = $SED_CMD -FLEX = $FLEX -BISON = $BISON -STRIP = $STRIP -LN_S = $LN_S -PKG_CONFIG = $PKG_CONFIG -FONTFORGE = $FONTFORGE -RSVG = $RSVG -CONVERT = $CONVERT -ICOTOOL = $ICOTOOL -MSGFMT = $MSGFMT -I386_LIBS = $I386_LIBS -OPENGL_LIBS = $OPENGL_LIBS -DLLFLAGS = $DLLFLAGS -LDDLLFLAGS = $LDDLLFLAGS -LDEXECFLAGS = $LDEXECFLAGS -EXTRACFLAGS = $EXTRACFLAGS -UNIXDLLFLAGS = $UNIXDLLFLAGS -UNIXLDFLAGS = $UNIXLDFLAGS -TOP_INSTALL_LIB = $TOP_INSTALL_LIB -TOP_INSTALL_DEV = $TOP_INSTALL_DEV -WINELOADER_LDFLAGS = $WINELOADER_LDFLAGS -WINEPRELOADER_LDFLAGS = $WINEPRELOADER_LDFLAGS -DLLEXT = $DLLEXT -LDD = $LDD -OTOOL = $OTOOL -READELF = $READELF -SUBDIRS = $SUBDIRS -DISABLED_SUBDIRS = $DISABLED_SUBDIRS -CONFIGURE_TARGETS = $CONFIGURE_TARGETS -CARBON_LIBS = $CARBON_LIBS -COREFOUNDATION_LIBS = $COREFOUNDATION_LIBS -DISKARBITRATION_LIBS = $DISKARBITRATION_LIBS -IOKIT_LIBS = $IOKIT_LIBS -METAL_LIBS = $METAL_LIBS -APPLICATIONSERVICES_LIBS = $APPLICATIONSERVICES_LIBS -CORESERVICES_LIBS = $CORESERVICES_LIBS -APPKIT_LIBS = $APPKIT_LIBS -SECURITY_LIBS = $SECURITY_LIBS -SYSTEMCONFIGURATION_LIBS = $SYSTEMCONFIGURATION_LIBS -COREAUDIO_LIBS = $COREAUDIO_LIBS -OPENCL_LIBS = $OPENCL_LIBS -OBJC = $OBJC -OBJCFLAGS = $OBJCFLAGS -ac_ct_OBJC = $ac_ct_OBJC -WINELOADER_DEPENDS = $WINELOADER_DEPENDS -PE_ARCHS = $PE_ARCHS -MINGW_PKG_CONFIG = $MINGW_PKG_CONFIG -CAPSTONE_PE_CFLAGS = $CAPSTONE_PE_CFLAGS -CAPSTONE_PE_LIBS = $CAPSTONE_PE_LIBS -FAUDIO_PE_CFLAGS = $FAUDIO_PE_CFLAGS -FAUDIO_PE_LIBS = $FAUDIO_PE_LIBS -FLUIDSYNTH_PE_CFLAGS = $FLUIDSYNTH_PE_CFLAGS -FLUIDSYNTH_PE_LIBS = $FLUIDSYNTH_PE_LIBS -GSM_PE_CFLAGS = $GSM_PE_CFLAGS -GSM_PE_LIBS = $GSM_PE_LIBS -JPEG_PE_CFLAGS = $JPEG_PE_CFLAGS -JPEG_PE_LIBS = $JPEG_PE_LIBS -JXR_PE_CFLAGS = $JXR_PE_CFLAGS -JXR_PE_LIBS = $JXR_PE_LIBS -LCMS2_PE_CFLAGS = $LCMS2_PE_CFLAGS -LCMS2_PE_LIBS = $LCMS2_PE_LIBS -LDAP_PE_CFLAGS = $LDAP_PE_CFLAGS -LDAP_PE_LIBS = $LDAP_PE_LIBS -MPG123_PE_CFLAGS = $MPG123_PE_CFLAGS -MPG123_PE_LIBS = $MPG123_PE_LIBS -MUSL_PE_CFLAGS = $MUSL_PE_CFLAGS -MUSL_PE_LIBS = $MUSL_PE_LIBS -PNG_PE_CFLAGS = $PNG_PE_CFLAGS -PNG_PE_LIBS = $PNG_PE_LIBS -TIFF_PE_CFLAGS = $TIFF_PE_CFLAGS -TIFF_PE_LIBS = $TIFF_PE_LIBS -VKD3D_PE_CFLAGS = $VKD3D_PE_CFLAGS -VKD3D_PE_LIBS = $VKD3D_PE_LIBS -XML2_PE_CFLAGS = $XML2_PE_CFLAGS -XML2_PE_LIBS = $XML2_PE_LIBS -XSLT_PE_CFLAGS = $XSLT_PE_CFLAGS -XSLT_PE_LIBS = $XSLT_PE_LIBS -ZLIB_PE_CFLAGS = $ZLIB_PE_CFLAGS -ZLIB_PE_LIBS = $ZLIB_PE_LIBS -PTHREAD_LIBS = $PTHREAD_LIBS -XMKMF = $XMKMF -CPP = $CPP -X_CFLAGS = $X_CFLAGS -X_LIBS = $X_LIBS -WAYLAND_CLIENT_CFLAGS = $WAYLAND_CLIENT_CFLAGS -WAYLAND_CLIENT_LIBS = $WAYLAND_CLIENT_LIBS -WAYLAND_SCANNER = $WAYLAND_SCANNER -XKBCOMMON_CFLAGS = $XKBCOMMON_CFLAGS -XKBCOMMON_LIBS = $XKBCOMMON_LIBS -XKBREGISTRY_CFLAGS = $XKBREGISTRY_CFLAGS -XKBREGISTRY_LIBS = $XKBREGISTRY_LIBS -EGL_CFLAGS = $EGL_CFLAGS -EGL_LIBS = $EGL_LIBS -WAYLAND_EGL_CFLAGS = $WAYLAND_EGL_CFLAGS -WAYLAND_EGL_LIBS = $WAYLAND_EGL_LIBS -PCAP_LIBS = $PCAP_LIBS -PCSCLITE_LIBS = $PCSCLITE_LIBS -INOTIFY_CFLAGS = $INOTIFY_CFLAGS -INOTIFY_LIBS = $INOTIFY_LIBS -DBUS_CFLAGS = $DBUS_CFLAGS -DBUS_LIBS = $DBUS_LIBS -GNUTLS_CFLAGS = $GNUTLS_CFLAGS -GNUTLS_LIBS = $GNUTLS_LIBS -SANE_CFLAGS = $SANE_CFLAGS -SANE_LIBS = $SANE_LIBS -USB_CFLAGS = $USB_CFLAGS -USB_LIBS = $USB_LIBS -GPHOTO2_CFLAGS = $GPHOTO2_CFLAGS -GPHOTO2_LIBS = $GPHOTO2_LIBS -GPHOTO2_PORT_CFLAGS = $GPHOTO2_PORT_CFLAGS -GPHOTO2_PORT_LIBS = $GPHOTO2_PORT_LIBS -RESOLV_LIBS = $RESOLV_LIBS -FREETYPE_CFLAGS = $FREETYPE_CFLAGS -FREETYPE_LIBS = $FREETYPE_LIBS -GETTEXTPO_LIBS = $GETTEXTPO_LIBS -PULSE_CFLAGS = $PULSE_CFLAGS -PULSE_LIBS = $PULSE_LIBS -FFMPEG_CFLAGS = $FFMPEG_CFLAGS -FFMPEG_LIBS = $FFMPEG_LIBS -GSTREAMER_CFLAGS = $GSTREAMER_CFLAGS -GSTREAMER_LIBS = $GSTREAMER_LIBS -ALSA_LIBS = $ALSA_LIBS -OSS4_CFLAGS = $OSS4_CFLAGS -OSS4_LIBS = $OSS4_LIBS -UDEV_CFLAGS = $UDEV_CFLAGS -UDEV_LIBS = $UDEV_LIBS -UNWIND_CFLAGS = $UNWIND_CFLAGS -UNWIND_LIBS = $UNWIND_LIBS -SDL2_CFLAGS = $SDL2_CFLAGS -SDL2_LIBS = $SDL2_LIBS -CAPI20_CFLAGS = $CAPI20_CFLAGS -CAPI20_LIBS = $CAPI20_LIBS -CUPS_CFLAGS = $CUPS_CFLAGS -CUPS_LIBS = $CUPS_LIBS -FONTCONFIG_CFLAGS = $FONTCONFIG_CFLAGS -FONTCONFIG_LIBS = $FONTCONFIG_LIBS -KRB5_CFLAGS = $KRB5_CFLAGS -KRB5_LIBS = $KRB5_LIBS -GSSAPI_CFLAGS = $GSSAPI_CFLAGS -GSSAPI_LIBS = $GSSAPI_LIBS -PROCSTAT_LIBS = $PROCSTAT_LIBS -NETAPI_CFLAGS = $NETAPI_CFLAGS -NETAPI_LIBS = $NETAPI_LIBS -MSVCRTFLAGS = $MSVCRTFLAGS -DELAYLOADFLAG = $DELAYLOADFLAG -WINELOADER_PROGRAMS = $WINELOADER_PROGRAMS -RT_LIBS = $RT_LIBS -TAGSFLAGS = $TAGSFLAGS -LIBOBJS = $LIBOBJS -LTLIBOBJS = $LTLIBOBJS -$SET_MAKE -$wine_rules -_WINE_EOF - as_fn_error $? "could not create Makefile" "$LINENO" 5 -} - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; - "include/stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS include/stamp-h" ;; - "wine") CONFIG_LINKS="$CONFIG_LINKS wine:tools/winewrapper" ;; - "wine64") CONFIG_LINKS="$CONFIG_LINKS wine64:tools/winewrapper" ;; - "tools/makedep") CONFIG_COMMANDS="$CONFIG_COMMANDS tools/makedep" ;; - "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; - - *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers - test ${CONFIG_LINKS+y} || CONFIG_LINKS=$config_links - test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to '$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with './config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script 'defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain ':'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is 'configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -printf "%s\n" "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`printf "%s\n" "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - printf "%s\n" "/* $configure_input */" >&1 \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - printf "%s\n" "/* $configure_input */" >&1 \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi - ;; - :L) - # - # CONFIG_LINK - # - - if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then - : - else - # Prefer the file from the source tree if names are identical. - if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then - ac_source=$srcdir/$ac_source - fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5 -printf "%s\n" "$as_me: linking $ac_source to $ac_file" >&6;} - - if test ! -r "$ac_source"; then - as_fn_error $? "$ac_source: file not found" "$LINENO" 5 - fi - rm -f "$ac_file" - - # Try a relative symlink, then a hard link, then a copy. - case $ac_source in - [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; - *) ac_rel_source=$ac_top_build_prefix$ac_source ;; - esac - ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || - ln "$ac_source" "$ac_file" 2>/dev/null || - cp -p "$ac_source" "$ac_file" || - as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5 - fi - ;; - :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -printf "%s\n" "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "include/stamp-h":C) echo timestamp > include/stamp-h ;; - "tools/makedep":C) wine_fn_output_makedep || as_fn_exit $? ;; - "Makefile":C) wine_fn_output_makefile Makefile ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - - -if test "$no_create" = "yes" -then - exit 0 -fi - -ac_save_IFS="$IFS" -if test "x$wine_notices" != x; then - echo >&6 - IFS="|" - for msg in $wine_notices; do - IFS="$ac_save_IFS" - if ${msg:+false} : -then : - -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $msg" >&5 -printf "%s\n" "$as_me: $msg" >&6;} ;; -esac -fi - done -fi -IFS="|" -for msg in $wine_warnings; do - IFS="$ac_save_IFS" - if ${msg:+false} : -then : - -else case e in #( - e) echo >&2 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $msg" >&5 -printf "%s\n" "$as_me: WARNING: $msg" >&2;} ;; -esac -fi -done -IFS="$ac_save_IFS" - -printf "%s\n" " -$as_me: Finished. Do '${MAKE-make}' to compile Wine. -" >&6 - - diff --git a/include/config.h.in b/include/config.h.in deleted file mode 100644 index 6033d8674f3c..000000000000 --- a/include/config.h.in +++ /dev/null @@ -1,836 +0,0 @@ -/* include/config.h.in. Generated from configure.ac by autoheader. */ - -#ifndef __WINE_CONFIG_H -#define __WINE_CONFIG_H - -/* Define to the file extension for executables. */ -#undef EXEEXT - -/* Define to 1 if you have the header file. */ -#undef HAVE_ARPA_INET_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ARPA_NAMESER_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ASM_TERMBITS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ASM_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ASM_USER_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CAPI20_H - -/* Define to 1 if you have the 'clock_gettime' function. */ -#undef HAVE_CLOCK_GETTIME - -/* Define to 1 if you have the header file. */ -#undef HAVE_CL_CL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CUPS_CUPS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CUPS_PPD_H - -/* Define to 1 if you have the 'dladdr1' function. */ -#undef HAVE_DLADDR1 - -/* Define to 1 if you have the 'dlinfo' function. */ -#undef HAVE_DLINFO - -/* Define to 1 if you have the header file. */ -#undef HAVE_EGL_EGL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ELF_H - -/* Define to 1 if you have the 'epoll_create' function. */ -#undef HAVE_EPOLL_CREATE - -/* Define to 1 if you have the FFmpeg libraries. */ -#undef HAVE_FFMPEG - -/* Define if FreeType 2 is installed */ -#undef HAVE_FREETYPE - -/* Define to 1 if you have the 'fstatfs' function. */ -#undef HAVE_FSTATFS - -/* Define to 1 if you have the header file. */ -#undef HAVE_FT2BUILD_H - -/* Define to 1 if the system has the type 'FT_TrueTypeEngineType'. */ -#undef HAVE_FT_TRUETYPEENGINETYPE - -/* Define to 1 if you have the 'futimens' function. */ -#undef HAVE_FUTIMENS - -/* Define to 1 if you have the 'futimes' function. */ -#undef HAVE_FUTIMES - -/* Define to 1 if you have the 'futimesat' function. */ -#undef HAVE_FUTIMESAT - -/* Define to 1 if you have the 'getaddrinfo' function. */ -#undef HAVE_GETADDRINFO - -/* Define to 1 if you have the 'getattrlist' function. */ -#undef HAVE_GETATTRLIST - -/* Define to 1 if you have the 'getauxval' function. */ -#undef HAVE_GETAUXVAL - -/* Define to 1 if you have the 'getifaddrs' function. */ -#undef HAVE_GETIFADDRS - -/* Define to 1 if you have the 'getrandom' function. */ -#undef HAVE_GETRANDOM - -/* Define to 1 if you have the header file. */ -#undef HAVE_GETTEXT_PO_H - -/* Define to 1 if you have the 'gnutls_cipher_init' function. */ -#undef HAVE_GNUTLS_CIPHER_INIT - -/* Define if we have the libgphoto2_port development environment */ -#undef HAVE_GPHOTO2_PORT - -/* Define to 1 if you have the header file. */ -#undef HAVE_GSSAPI_GSSAPI_EXT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_GSSAPI_GSSAPI_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_IFADDRS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the 'kqueue' function. */ -#undef HAVE_KQUEUE - -/* Define to 1 if you have the header file. */ -#undef HAVE_KRB5_KRB5_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBAVCODEC_AVCODEC_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBAVCODEC_BSF_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBAVFORMAT_AVFORMAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBAVUTIL_AVUTIL_H - -/* Define to 1 if you have the 'gettextpo' library (-lgettextpo). */ -#undef HAVE_LIBGETTEXTPO - -/* Define to 1 if you have the 'procstat' library (-lprocstat). */ -#undef HAVE_LIBPROCSTAT - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBPROCSTAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBUDEV_H - -/* Define to 1 if you have the 'unwind' library (-lunwind). */ -#undef HAVE_LIBUNWIND - -/* Define if we have the wayland-egl development environment */ -#undef HAVE_LIBWAYLAND_EGL - -/* Define if you have the X Shape extension */ -#undef HAVE_LIBXSHAPE - -/* Define if you have the X Shm extension */ -#undef HAVE_LIBXXSHM - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINK_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_CAPI_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_CDROM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_FILTER_H - -/* Define if Linux-style gethostbyname_r and gethostbyaddr_r are available */ -#undef HAVE_LINUX_GETHOSTBYNAME_R_6 - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_HDREG_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_HIDRAW_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_INPUT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_IOCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_IPX_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_IRDA_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_MAJOR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_PARAM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_RTNETLINK_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_SERIAL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_UCDROM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_VIDEODEV2_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_WIRELESS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LWP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MACHINE_CPU_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MACHINE_SYSARCH_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MACH_MACH_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MACH_O_LOADER_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MNTENT_H - -/* Define if MTLDevice protocol has registryID property. */ -#undef HAVE_MTLDEVICE_REGISTRYID - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETDB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET6_IP6_VAR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_ICMP6_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_ICMP_VAR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IF_ETHER_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IN_PCB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IN_SYSTM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IP_ICMP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IP_VAR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_TCP_FSM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_TCP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_TCP_VAR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_UDP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_UDP_VAR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETIPX_IPX_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NET_IF_ARP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NET_IF_DL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NET_IF_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NET_IF_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NET_ROUTE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_OPENCL_OPENCL_H - -/* Define to 1 if 'numaudioengines' is a member of 'oss_sysinfo'. */ -#undef HAVE_OSS_SYSINFO_NUMAUDIOENGINES - -/* Define to 1 if you have the header file. */ -#undef HAVE_PCAP_PCAP_H - -/* Define to 1 if you have the 'pipe2' function. */ -#undef HAVE_PIPE2 - -/* Define to 1 if you have the 'port_create' function. */ -#undef HAVE_PORT_CREATE - -/* Define to 1 if you have the header file. */ -#undef HAVE_PORT_H - -/* Define to 1 if you have the 'posix_fadvise' function. */ -#undef HAVE_POSIX_FADVISE - -/* Define to 1 if you have the 'posix_fallocate' function. */ -#undef HAVE_POSIX_FALLOCATE - -/* Define to 1 if you have the 'prctl' function. */ -#undef HAVE_PRCTL - -/* Define to 1 if you have the 'pthread_getthreadid_np' function. */ -#undef HAVE_PTHREAD_GETTHREADID_NP - -/* Define to 1 if you have the header file. */ -#undef HAVE_PTHREAD_NP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_PWD_H - -/* Define to 1 if the system has the type 'request_sense'. */ -#undef HAVE_REQUEST_SENSE - -/* Define if you have the resolver library and header */ -#undef HAVE_RESOLV - -/* Define to 1 if you have the header file. */ -#undef HAVE_RESOLV_H - -/* Define to 1 if you have the 'res_getservers' function. */ -#undef HAVE_RES_GETSERVERS - -/* Define to 1 if you have the 'sched_getcpu' function. */ -#undef HAVE_SCHED_GETCPU - -/* Define to 1 if you have the header file. */ -#undef HAVE_SCHED_H - -/* Define to 1 if you have the 'sched_setaffinity' function. */ -#undef HAVE_SCHED_SETAFFINITY - -/* Define to 1 if you have the 'sched_yield' function. */ -#undef HAVE_SCHED_YIELD - -/* Define to 1 if 'cmd' is a member of 'scsireq_t'. */ -#undef HAVE_SCSIREQ_T_CMD - -/* Define to 1 if you have the header file. */ -#undef HAVE_SCSI_SCSI_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SCSI_SCSI_IOCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SCSI_SG_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SDL_H - -/* Define to 1 if you have the 'setproctitle' function. */ -#undef HAVE_SETPROCTITLE - -/* Define to 1 if you have the 'setprogname' function. */ -#undef HAVE_SETPROGNAME - -/* Define to 1 if 'interface_id' is a member of 'sg_io_hdr_t'. */ -#undef HAVE_SG_IO_HDR_T_INTERFACE_ID - -/* Define to 1 if 'si_fd' is a member of 'siginfo_t'. */ -#undef HAVE_SIGINFO_T_SI_FD - -/* Define to 1 if you have the 'sigprocmask' function. */ -#undef HAVE_SIGPROCMASK - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if 'icp6s_error' is a member of 'struct icmp6stat'. */ -#undef HAVE_STRUCT_ICMP6STAT_ICP6S_ERROR - -/* Define to 1 if 'icps_error' is a member of 'struct icmpstat'. */ -#undef HAVE_STRUCT_ICMPSTAT_ICPS_ERROR - -/* Define to 1 if 'ifr_hwaddr' is a member of 'struct ifreq'. */ -#undef HAVE_STRUCT_IFREQ_IFR_HWADDR - -/* Define to 1 if 'ipi6_addr' is a member of 'struct in6_pktinfo'. */ -#undef HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR - -/* Define to 1 if 'ip6s_total' is a member of 'struct ip6stat'. */ -#undef HAVE_STRUCT_IP6STAT_IP6S_TOTAL - -/* Define to 1 if 'ips_total' is a member of 'struct ipstat'. */ -#undef HAVE_STRUCT_IPSTAT_IPS_TOTAL - -/* Define to 1 if 'ips_total' is a member of 'struct ip_stats'. */ -#undef HAVE_STRUCT_IP_STATS_IPS_TOTAL - -/* Define to 1 if 'mt_blkno' is a member of 'struct mtget'. */ -#undef HAVE_STRUCT_MTGET_MT_BLKNO - -/* Define to 1 if 'mt_blksiz' is a member of 'struct mtget'. */ -#undef HAVE_STRUCT_MTGET_MT_BLKSIZ - -/* Define to 1 if 'mt_gstat' is a member of 'struct mtget'. */ -#undef HAVE_STRUCT_MTGET_MT_GSTAT - -/* Define to 1 if 'sin6_scope_id' is a member of 'struct sockaddr_in6'. */ -#undef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID - -/* Define to 1 if 'sun_len' is a member of 'struct sockaddr_un'. */ -#undef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN - -/* Define to 1 if 'st_atim' is a member of 'struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_ATIM - -/* Define to 1 if 'st_atimespec' is a member of 'struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_ATIMESPEC - -/* Define to 1 if 'st_birthtim' is a member of 'struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_BIRTHTIM - -/* Define to 1 if 'st_birthtime' is a member of 'struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_BIRTHTIME - -/* Define to 1 if 'st_birthtimespec' is a member of 'struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC - -/* Define to 1 if 'st_ctim' is a member of 'struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_CTIM - -/* Define to 1 if 'st_ctimespec' is a member of 'struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_CTIMESPEC - -/* Define to 1 if 'st_mtim' is a member of 'struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_MTIM - -/* Define to 1 if 'st_mtimespec' is a member of 'struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_MTIMESPEC - -/* Define to 1 if '__st_birthtim' is a member of 'struct stat'. */ -#undef HAVE_STRUCT_STAT___ST_BIRTHTIM - -/* Define to 1 if '__st_birthtime' is a member of 'struct stat'. */ -#undef HAVE_STRUCT_STAT___ST_BIRTHTIME - -/* Define to 1 if 'mem_unit' is a member of 'struct sysinfo'. */ -#undef HAVE_STRUCT_SYSINFO_MEM_UNIT - -/* Define to 1 if 'totalram' is a member of 'struct sysinfo'. */ -#undef HAVE_STRUCT_SYSINFO_TOTALRAM - -/* Define to 1 if 'tcps_connattempt' is a member of 'struct tcpstat'. */ -#undef HAVE_STRUCT_TCPSTAT_TCPS_CONNATTEMPT - -/* Define to 1 if 'tcps_connattempt' is a member of 'struct tcp_stats'. */ -#undef HAVE_STRUCT_TCP_STATS_TCPS_CONNATTEMPT - -/* Define to 1 if 'udps_ipackets' is a member of 'struct udpstat'. */ -#undef HAVE_STRUCT_UDPSTAT_UDPS_IPACKETS - -/* Define to 1 if '_u._ext.nscount6' is a member of 'struct __res_state'. */ -#undef HAVE_STRUCT___RES_STATE__U__EXT_NSCOUNT6 - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYSCALL_H - -/* Define to 1 if you have the 'sysinfo' function. */ -#undef HAVE_SYSINFO - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_ATTR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_AUXV_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_CDIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_CONF_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_EPOLL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_EVENT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_EXTATTR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_FILIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_INOTIFY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_IPC_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_LINK_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_MODEM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_MOUNT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_MTIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PRCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PTRACE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_QUEUE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_RANDOM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_RESOURCE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SCSIIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SHM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SIGNAL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SOCKETVAR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SOCKIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STATFS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STATVFS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STRTIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SYSCALL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SYSCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SYSINFO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_THR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIMES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_UCONTEXT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_UIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_UN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_USER_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_UTSNAME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_VFS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_VNODE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_XATTR_H - -/* Define to 1 if you have the 'tcdrain' function. */ -#undef HAVE_TCDRAIN - -/* Define to 1 if you have the 'thr_kill2' function. */ -#undef HAVE_THR_KILL2 - -/* Define to 1 if you have the 'udev' library (-ludev). */ -#undef HAVE_UDEV - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UTIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_VALGRIND_MEMCHECK_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_VALGRIND_VALGRIND_H - -/* Define to 1 if the Wine preloader is being used. */ -#undef HAVE_WINE_PRELOADER - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_SHAPE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XF86VMODE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XF86VMPROTO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XFIXES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XINERAMA_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XINPUT2_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XRANDR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XRENDER_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XSHM_H - -/* Define to 1 if 'xcookie' is a member of 'XEvent'. */ -#undef HAVE_XEVENT_XCOOKIE - -/* Define to 1 if 'callback' is a member of 'XICCallback'. */ -#undef HAVE_XICCALLBACK_CALLBACK - -/* Define to 1 if you have the header file. */ -#undef HAVE_XKBCOMMON_XKBCOMMON_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_XKBCOMMON_XKBREGISTRY_H - -/* Define if Xrender has the XRenderCreateLinearGradient function */ -#undef HAVE_XRENDERCREATELINEARGRADIENT - -/* Define if Xrender has the XRenderSetPictureTransform function */ -#undef HAVE_XRENDERSETPICTURETRANSFORM - -/* Define if Xrandr has the XRRGetProviderResources function */ -#undef HAVE_XRRGETPROVIDERRESOURCES - -/* Define to 1 if you have the '__builtin_popcount' built-in function. */ -#undef HAVE___BUILTIN_POPCOUNT - -/* Define to 1 if you have the '__clear_cache' (potentially built-in) - function. */ -#undef HAVE___CLEAR_CACHE - -/* Define to 1 if 'major', 'minor', and 'makedev' are declared in . - */ -#undef MAJOR_IN_MKDEV - -/* Define to 1 if 'major', 'minor', and 'makedev' are declared in - . */ -#undef MAJOR_IN_SYSMACROS - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to the soname of the libcups library. */ -#undef SONAME_LIBCUPS - -/* Define to the soname of the libdbus-1 library. */ -#undef SONAME_LIBDBUS_1 - -/* Define to the soname of the libEGL library. */ -#undef SONAME_LIBEGL - -/* Define to the soname of the libfontconfig library. */ -#undef SONAME_LIBFONTCONFIG - -/* Define to the soname of the libfreetype library. */ -#undef SONAME_LIBFREETYPE - -/* Define to the soname of the libGL library. */ -#undef SONAME_LIBGL - -/* Define to the soname of the libGLESv2 library. */ -#undef SONAME_LIBGLESV2 - -/* Define to the soname of the libgnutls library. */ -#undef SONAME_LIBGNUTLS - -/* Define to the soname of the libgssapi_krb5 library. */ -#undef SONAME_LIBGSSAPI_KRB5 - -/* Define to the soname of the libkrb5 library. */ -#undef SONAME_LIBKRB5 - -/* Define to the soname of the libMoltenVK library. */ -#undef SONAME_LIBMOLTENVK - -/* Define to the soname of the libnetapi library. */ -#undef SONAME_LIBNETAPI - -/* Define to the soname of the libodbc library. */ -#undef SONAME_LIBODBC - -/* Define to the soname of the libOSMesa library. */ -#undef SONAME_LIBOSMESA - -/* Define to the soname of the libSDL2 library. */ -#undef SONAME_LIBSDL2 - -/* Define to the soname of the libv4l2 library. */ -#undef SONAME_LIBV4L2 - -/* Define to the soname of the libvulkan library. */ -#undef SONAME_LIBVULKAN - -/* Define to the soname of the libX11 library. */ -#undef SONAME_LIBX11 - -/* Define to the soname of the libXcomposite library. */ -#undef SONAME_LIBXCOMPOSITE - -/* Define to the soname of the libXcursor library. */ -#undef SONAME_LIBXCURSOR - -/* Define to the soname of the libXext library. */ -#undef SONAME_LIBXEXT - -/* Define to the soname of the libXfixes library. */ -#undef SONAME_LIBXFIXES - -/* Define to the soname of the libXi library. */ -#undef SONAME_LIBXI - -/* Define to the soname of the libXinerama library. */ -#undef SONAME_LIBXINERAMA - -/* Define to the soname of the libXrandr library. */ -#undef SONAME_LIBXRANDR - -/* Define to the soname of the libXrender library. */ -#undef SONAME_LIBXRENDER - -/* Define to the soname of the libXxf86vm library. */ -#undef SONAME_LIBXXF86VM - -/* Define to 1 if all of the C89 standard headers exist (not just the ones - required in a freestanding environment). This macro is provided for - backward compatibility; new code need not use it. */ -#undef STDC_HEADERS - -/* Define if xattr functions take additional arguments (macOS) */ -#undef XATTR_ADDITIONAL_OPTIONS - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - -/* Define to 1 to enable GNU extensions on Linux */ -#undef _GNU_SOURCE - -/* Define to 1 on platforms where this makes off_t a 64-bit type. */ -#undef _LARGE_FILES - -/* Number of bits in time_t, on hosts where this is settable. */ -#undef _TIME_BITS - -/* Define to 1 on platforms where this makes time_t a 64-bit type. */ -#undef __MINGW_USE_VC2005_COMPAT - -#endif /* __WINE_CONFIG_H */ From 86b9c8c78fd0addd8012763c95c462c6342f3a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 4 Dec 2023 18:13:00 +0100 Subject: [PATCH 0004/2542] ntdll, win32u: Remove generated syscall files. --- dlls/ntdll/ntsyscalls.h | 493 -------------------- dlls/win32u/win32syscalls.h | 867 ------------------------------------ 2 files changed, 1360 deletions(-) delete mode 100644 dlls/ntdll/ntsyscalls.h delete mode 100644 dlls/win32u/win32syscalls.h diff --git a/dlls/ntdll/ntsyscalls.h b/dlls/ntdll/ntsyscalls.h deleted file mode 100644 index ce6e855a083f..000000000000 --- a/dlls/ntdll/ntsyscalls.h +++ /dev/null @@ -1,493 +0,0 @@ -/* Automatically generated by tools/make_specfiles */ - -#define ALL_SYSCALLS32 \ - SYSCALL_ENTRY( 0x0000, NtAcceptConnectPort, 24 ) \ - SYSCALL_ENTRY( 0x0001, NtAccessCheck, 32 ) \ - SYSCALL_ENTRY( 0x0002, NtAccessCheckAndAuditAlarm, 44 ) \ - SYSCALL_ENTRY( 0x0003, NtAddAtom, 12 ) \ - SYSCALL_ENTRY( 0x0004, NtAdjustGroupsToken, 24 ) \ - SYSCALL_ENTRY( 0x0005, NtAdjustPrivilegesToken, 24 ) \ - SYSCALL_ENTRY( 0x0006, NtAlertResumeThread, 8 ) \ - SYSCALL_ENTRY( 0x0007, NtAlertThread, 4 ) \ - SYSCALL_ENTRY( 0x0008, NtAlertThreadByThreadId, 4 ) \ - SYSCALL_ENTRY( 0x0009, NtAllocateLocallyUniqueId, 4 ) \ - SYSCALL_ENTRY( 0x000a, NtAllocateReserveObject, 12 ) \ - SYSCALL_ENTRY( 0x000b, NtAllocateUuids, 16 ) \ - SYSCALL_ENTRY( 0x000c, NtAllocateVirtualMemory, 24 ) \ - SYSCALL_ENTRY( 0x000d, NtAllocateVirtualMemoryEx, 28 ) \ - SYSCALL_ENTRY( 0x000e, NtAreMappedFilesTheSame, 8 ) \ - SYSCALL_ENTRY( 0x000f, NtAssignProcessToJobObject, 8 ) \ - SYSCALL_ENTRY( 0x0010, NtCallbackReturn, 12 ) \ - SYSCALL_ENTRY( 0x0011, NtCancelIoFile, 8 ) \ - SYSCALL_ENTRY( 0x0012, NtCancelIoFileEx, 12 ) \ - SYSCALL_ENTRY( 0x0013, NtCancelSynchronousIoFile, 12 ) \ - SYSCALL_ENTRY( 0x0014, NtCancelTimer, 8 ) \ - SYSCALL_ENTRY( 0x0015, NtClearEvent, 4 ) \ - SYSCALL_ENTRY( 0x0016, NtClose, 4 ) \ - SYSCALL_ENTRY( 0x0017, NtCommitTransaction, 8 ) \ - SYSCALL_ENTRY( 0x0018, NtCompareObjects, 8 ) \ - SYSCALL_ENTRY( 0x0019, NtCompareTokens, 12 ) \ - SYSCALL_ENTRY( 0x001a, NtCompleteConnectPort, 4 ) \ - SYSCALL_ENTRY( 0x001b, NtConnectPort, 32 ) \ - SYSCALL_ENTRY( 0x001c, NtContinue, 8 ) \ - SYSCALL_ENTRY( 0x001d, NtContinueEx, 8 ) \ - SYSCALL_ENTRY( 0x001e, NtCreateDebugObject, 16 ) \ - SYSCALL_ENTRY( 0x001f, NtCreateDirectoryObject, 12 ) \ - SYSCALL_ENTRY( 0x0020, NtCreateEvent, 20 ) \ - SYSCALL_ENTRY( 0x0021, NtCreateFile, 44 ) \ - SYSCALL_ENTRY( 0x0022, NtCreateIoCompletion, 16 ) \ - SYSCALL_ENTRY( 0x0023, NtCreateJobObject, 12 ) \ - SYSCALL_ENTRY( 0x0024, NtCreateKey, 28 ) \ - SYSCALL_ENTRY( 0x0025, NtCreateKeyTransacted, 32 ) \ - SYSCALL_ENTRY( 0x0026, NtCreateKeyedEvent, 16 ) \ - SYSCALL_ENTRY( 0x0027, NtCreateLowBoxToken, 36 ) \ - SYSCALL_ENTRY( 0x0028, NtCreateMailslotFile, 32 ) \ - SYSCALL_ENTRY( 0x0029, NtCreateMutant, 16 ) \ - SYSCALL_ENTRY( 0x002a, NtCreateNamedPipeFile, 56 ) \ - SYSCALL_ENTRY( 0x002b, NtCreatePagingFile, 16 ) \ - SYSCALL_ENTRY( 0x002c, NtCreatePort, 20 ) \ - SYSCALL_ENTRY( 0x002d, NtCreateSection, 28 ) \ - SYSCALL_ENTRY( 0x002e, NtCreateSemaphore, 20 ) \ - SYSCALL_ENTRY( 0x002f, NtCreateSymbolicLinkObject, 16 ) \ - SYSCALL_ENTRY( 0x0030, NtCreateThread, 32 ) \ - SYSCALL_ENTRY( 0x0031, NtCreateThreadEx, 44 ) \ - SYSCALL_ENTRY( 0x0032, NtCreateTimer, 16 ) \ - SYSCALL_ENTRY( 0x0033, NtCreateToken, 52 ) \ - SYSCALL_ENTRY( 0x0034, NtCreateTransaction, 40 ) \ - SYSCALL_ENTRY( 0x0035, NtCreateUserProcess, 44 ) \ - SYSCALL_ENTRY( 0x0036, NtDebugActiveProcess, 8 ) \ - SYSCALL_ENTRY( 0x0037, NtDebugContinue, 12 ) \ - SYSCALL_ENTRY( 0x0038, NtDelayExecution, 8 ) \ - SYSCALL_ENTRY( 0x0039, NtDeleteAtom, 4 ) \ - SYSCALL_ENTRY( 0x003a, NtDeleteFile, 4 ) \ - SYSCALL_ENTRY( 0x003b, NtDeleteKey, 4 ) \ - SYSCALL_ENTRY( 0x003c, NtDeleteValueKey, 8 ) \ - SYSCALL_ENTRY( 0x003d, NtDeviceIoControlFile, 40 ) \ - SYSCALL_ENTRY( 0x003e, NtDisplayString, 4 ) \ - SYSCALL_ENTRY( 0x003f, NtDuplicateObject, 28 ) \ - SYSCALL_ENTRY( 0x0040, NtDuplicateToken, 24 ) \ - SYSCALL_ENTRY( 0x0041, NtEnumerateKey, 24 ) \ - SYSCALL_ENTRY( 0x0042, NtEnumerateValueKey, 24 ) \ - SYSCALL_ENTRY( 0x0043, NtFilterToken, 24 ) \ - SYSCALL_ENTRY( 0x0044, NtFindAtom, 12 ) \ - SYSCALL_ENTRY( 0x0045, NtFlushBuffersFile, 8 ) \ - SYSCALL_ENTRY( 0x0046, NtFlushBuffersFileEx, 20 ) \ - SYSCALL_ENTRY( 0x0047, NtFlushInstructionCache, 12 ) \ - SYSCALL_ENTRY( 0x0048, NtFlushKey, 4 ) \ - SYSCALL_ENTRY( 0x0049, NtFlushProcessWriteBuffers, 0 ) \ - SYSCALL_ENTRY( 0x004a, NtFlushVirtualMemory, 16 ) \ - SYSCALL_ENTRY( 0x004b, NtFreeVirtualMemory, 16 ) \ - SYSCALL_ENTRY( 0x004c, NtFsControlFile, 40 ) \ - SYSCALL_ENTRY( 0x004d, NtGetContextThread, 8 ) \ - SYSCALL_ENTRY( 0x004e, NtGetCurrentProcessorNumber, 0 ) \ - SYSCALL_ENTRY( 0x004f, NtGetNextThread, 24 ) \ - SYSCALL_ENTRY( 0x0050, NtGetNlsSectionPtr, 20 ) \ - SYSCALL_ENTRY( 0x0051, NtGetWriteWatch, 28 ) \ - SYSCALL_ENTRY( 0x0052, NtImpersonateAnonymousToken, 4 ) \ - SYSCALL_ENTRY( 0x0053, NtInitializeNlsFiles, 12 ) \ - SYSCALL_ENTRY( 0x0054, NtInitiatePowerAction, 16 ) \ - SYSCALL_ENTRY( 0x0055, NtIsProcessInJob, 8 ) \ - SYSCALL_ENTRY( 0x0056, NtListenPort, 8 ) \ - SYSCALL_ENTRY( 0x0057, NtLoadDriver, 4 ) \ - SYSCALL_ENTRY( 0x0058, NtLoadKey, 8 ) \ - SYSCALL_ENTRY( 0x0059, NtLoadKey2, 12 ) \ - SYSCALL_ENTRY( 0x005a, NtLoadKeyEx, 32 ) \ - SYSCALL_ENTRY( 0x005b, NtLockFile, 40 ) \ - SYSCALL_ENTRY( 0x005c, NtLockVirtualMemory, 16 ) \ - SYSCALL_ENTRY( 0x005d, NtMakePermanentObject, 4 ) \ - SYSCALL_ENTRY( 0x005e, NtMakeTemporaryObject, 4 ) \ - SYSCALL_ENTRY( 0x005f, NtMapViewOfSection, 40 ) \ - SYSCALL_ENTRY( 0x0060, NtMapViewOfSectionEx, 36 ) \ - SYSCALL_ENTRY( 0x0061, NtNotifyChangeDirectoryFile, 36 ) \ - SYSCALL_ENTRY( 0x0062, NtNotifyChangeKey, 40 ) \ - SYSCALL_ENTRY( 0x0063, NtNotifyChangeMultipleKeys, 48 ) \ - SYSCALL_ENTRY( 0x0064, NtOpenDirectoryObject, 12 ) \ - SYSCALL_ENTRY( 0x0065, NtOpenEvent, 12 ) \ - SYSCALL_ENTRY( 0x0066, NtOpenFile, 24 ) \ - SYSCALL_ENTRY( 0x0067, NtOpenIoCompletion, 12 ) \ - SYSCALL_ENTRY( 0x0068, NtOpenJobObject, 12 ) \ - SYSCALL_ENTRY( 0x0069, NtOpenKey, 12 ) \ - SYSCALL_ENTRY( 0x006a, NtOpenKeyEx, 16 ) \ - SYSCALL_ENTRY( 0x006b, NtOpenKeyTransacted, 16 ) \ - SYSCALL_ENTRY( 0x006c, NtOpenKeyTransactedEx, 20 ) \ - SYSCALL_ENTRY( 0x006d, NtOpenKeyedEvent, 12 ) \ - SYSCALL_ENTRY( 0x006e, NtOpenMutant, 12 ) \ - SYSCALL_ENTRY( 0x006f, NtOpenProcess, 16 ) \ - SYSCALL_ENTRY( 0x0070, NtOpenProcessToken, 12 ) \ - SYSCALL_ENTRY( 0x0071, NtOpenProcessTokenEx, 16 ) \ - SYSCALL_ENTRY( 0x0072, NtOpenSection, 12 ) \ - SYSCALL_ENTRY( 0x0073, NtOpenSemaphore, 12 ) \ - SYSCALL_ENTRY( 0x0074, NtOpenSymbolicLinkObject, 12 ) \ - SYSCALL_ENTRY( 0x0075, NtOpenThread, 16 ) \ - SYSCALL_ENTRY( 0x0076, NtOpenThreadToken, 16 ) \ - SYSCALL_ENTRY( 0x0077, NtOpenThreadTokenEx, 20 ) \ - SYSCALL_ENTRY( 0x0078, NtOpenTimer, 12 ) \ - SYSCALL_ENTRY( 0x0079, NtPowerInformation, 20 ) \ - SYSCALL_ENTRY( 0x007a, NtPrivilegeCheck, 12 ) \ - SYSCALL_ENTRY( 0x007b, NtProtectVirtualMemory, 20 ) \ - SYSCALL_ENTRY( 0x007c, NtPulseEvent, 8 ) \ - SYSCALL_ENTRY( 0x007d, NtQueryAttributesFile, 8 ) \ - SYSCALL_ENTRY( 0x007e, NtQueryDefaultLocale, 8 ) \ - SYSCALL_ENTRY( 0x007f, NtQueryDefaultUILanguage, 4 ) \ - SYSCALL_ENTRY( 0x0080, NtQueryDirectoryFile, 44 ) \ - SYSCALL_ENTRY( 0x0081, NtQueryDirectoryObject, 28 ) \ - SYSCALL_ENTRY( 0x0082, NtQueryEaFile, 36 ) \ - SYSCALL_ENTRY( 0x0083, NtQueryEvent, 20 ) \ - SYSCALL_ENTRY( 0x0084, NtQueryFullAttributesFile, 8 ) \ - SYSCALL_ENTRY( 0x0085, NtQueryInformationAtom, 20 ) \ - SYSCALL_ENTRY( 0x0086, NtQueryInformationFile, 20 ) \ - SYSCALL_ENTRY( 0x0087, NtQueryInformationJobObject, 20 ) \ - SYSCALL_ENTRY( 0x0088, NtQueryInformationProcess, 20 ) \ - SYSCALL_ENTRY( 0x0089, NtQueryInformationThread, 20 ) \ - SYSCALL_ENTRY( 0x008a, NtQueryInformationToken, 20 ) \ - SYSCALL_ENTRY( 0x008b, NtQueryInstallUILanguage, 4 ) \ - SYSCALL_ENTRY( 0x008c, NtQueryIoCompletion, 20 ) \ - SYSCALL_ENTRY( 0x008d, NtQueryKey, 20 ) \ - SYSCALL_ENTRY( 0x008e, NtQueryLicenseValue, 20 ) \ - SYSCALL_ENTRY( 0x008f, NtQueryMultipleValueKey, 24 ) \ - SYSCALL_ENTRY( 0x0090, NtQueryMutant, 20 ) \ - SYSCALL_ENTRY( 0x0091, NtQueryObject, 20 ) \ - SYSCALL_ENTRY( 0x0092, NtQueryPerformanceCounter, 8 ) \ - SYSCALL_ENTRY( 0x0093, NtQuerySection, 20 ) \ - SYSCALL_ENTRY( 0x0094, NtQuerySecurityObject, 20 ) \ - SYSCALL_ENTRY( 0x0095, NtQuerySemaphore, 20 ) \ - SYSCALL_ENTRY( 0x0096, NtQuerySymbolicLinkObject, 12 ) \ - SYSCALL_ENTRY( 0x0097, NtQuerySystemEnvironmentValue, 16 ) \ - SYSCALL_ENTRY( 0x0098, NtQuerySystemEnvironmentValueEx, 20 ) \ - SYSCALL_ENTRY( 0x0099, NtQuerySystemInformation, 16 ) \ - SYSCALL_ENTRY( 0x009a, NtQuerySystemInformationEx, 24 ) \ - SYSCALL_ENTRY( 0x009b, NtQuerySystemTime, 4 ) \ - SYSCALL_ENTRY( 0x009c, NtQueryTimer, 20 ) \ - SYSCALL_ENTRY( 0x009d, NtQueryTimerResolution, 12 ) \ - SYSCALL_ENTRY( 0x009e, NtQueryValueKey, 24 ) \ - SYSCALL_ENTRY( 0x009f, NtQueryVirtualMemory, 24 ) \ - SYSCALL_ENTRY( 0x00a0, NtQueryVolumeInformationFile, 20 ) \ - SYSCALL_ENTRY( 0x00a1, NtQueueApcThread, 20 ) \ - SYSCALL_ENTRY( 0x00a2, NtQueueApcThreadEx, 24 ) \ - SYSCALL_ENTRY( 0x00a3, NtRaiseException, 12 ) \ - SYSCALL_ENTRY( 0x00a4, NtRaiseHardError, 24 ) \ - SYSCALL_ENTRY( 0x00a5, NtReadFile, 36 ) \ - SYSCALL_ENTRY( 0x00a6, NtReadFileScatter, 36 ) \ - SYSCALL_ENTRY( 0x00a7, NtReadVirtualMemory, 20 ) \ - SYSCALL_ENTRY( 0x00a8, NtRegisterThreadTerminatePort, 4 ) \ - SYSCALL_ENTRY( 0x00a9, NtReleaseKeyedEvent, 16 ) \ - SYSCALL_ENTRY( 0x00aa, NtReleaseMutant, 8 ) \ - SYSCALL_ENTRY( 0x00ab, NtReleaseSemaphore, 12 ) \ - SYSCALL_ENTRY( 0x00ac, NtRemoveIoCompletion, 20 ) \ - SYSCALL_ENTRY( 0x00ad, NtRemoveIoCompletionEx, 24 ) \ - SYSCALL_ENTRY( 0x00ae, NtRemoveProcessDebug, 8 ) \ - SYSCALL_ENTRY( 0x00af, NtRenameKey, 8 ) \ - SYSCALL_ENTRY( 0x00b0, NtReplaceKey, 12 ) \ - SYSCALL_ENTRY( 0x00b1, NtReplyWaitReceivePort, 16 ) \ - SYSCALL_ENTRY( 0x00b2, NtRequestWaitReplyPort, 12 ) \ - SYSCALL_ENTRY( 0x00b3, NtResetEvent, 8 ) \ - SYSCALL_ENTRY( 0x00b4, NtResetWriteWatch, 12 ) \ - SYSCALL_ENTRY( 0x00b5, NtRestoreKey, 12 ) \ - SYSCALL_ENTRY( 0x00b6, NtResumeProcess, 4 ) \ - SYSCALL_ENTRY( 0x00b7, NtResumeThread, 8 ) \ - SYSCALL_ENTRY( 0x00b8, NtRollbackTransaction, 8 ) \ - SYSCALL_ENTRY( 0x00b9, NtSaveKey, 8 ) \ - SYSCALL_ENTRY( 0x00ba, NtSecureConnectPort, 36 ) \ - SYSCALL_ENTRY( 0x00bb, NtSetContextThread, 8 ) \ - SYSCALL_ENTRY( 0x00bc, NtSetDebugFilterState, 12 ) \ - SYSCALL_ENTRY( 0x00bd, NtSetDefaultLocale, 8 ) \ - SYSCALL_ENTRY( 0x00be, NtSetDefaultUILanguage, 4 ) \ - SYSCALL_ENTRY( 0x00bf, NtSetEaFile, 16 ) \ - SYSCALL_ENTRY( 0x00c0, NtSetEvent, 8 ) \ - SYSCALL_ENTRY( 0x00c1, NtSetInformationDebugObject, 20 ) \ - SYSCALL_ENTRY( 0x00c2, NtSetInformationFile, 20 ) \ - SYSCALL_ENTRY( 0x00c3, NtSetInformationJobObject, 16 ) \ - SYSCALL_ENTRY( 0x00c4, NtSetInformationKey, 16 ) \ - SYSCALL_ENTRY( 0x00c5, NtSetInformationObject, 16 ) \ - SYSCALL_ENTRY( 0x00c6, NtSetInformationProcess, 16 ) \ - SYSCALL_ENTRY( 0x00c7, NtSetInformationThread, 16 ) \ - SYSCALL_ENTRY( 0x00c8, NtSetInformationToken, 16 ) \ - SYSCALL_ENTRY( 0x00c9, NtSetInformationVirtualMemory, 24 ) \ - SYSCALL_ENTRY( 0x00ca, NtSetIntervalProfile, 8 ) \ - SYSCALL_ENTRY( 0x00cb, NtSetIoCompletion, 20 ) \ - SYSCALL_ENTRY( 0x00cc, NtSetIoCompletionEx, 24 ) \ - SYSCALL_ENTRY( 0x00cd, NtSetLdtEntries, 24 ) \ - SYSCALL_ENTRY( 0x00ce, NtSetSecurityObject, 12 ) \ - SYSCALL_ENTRY( 0x00cf, NtSetSystemInformation, 12 ) \ - SYSCALL_ENTRY( 0x00d0, NtSetSystemTime, 8 ) \ - SYSCALL_ENTRY( 0x00d1, NtSetThreadExecutionState, 8 ) \ - SYSCALL_ENTRY( 0x00d2, NtSetTimer, 28 ) \ - SYSCALL_ENTRY( 0x00d3, NtSetTimerResolution, 12 ) \ - SYSCALL_ENTRY( 0x00d4, NtSetValueKey, 24 ) \ - SYSCALL_ENTRY( 0x00d5, NtSetVolumeInformationFile, 20 ) \ - SYSCALL_ENTRY( 0x00d6, NtShutdownSystem, 4 ) \ - SYSCALL_ENTRY( 0x00d7, NtSignalAndWaitForSingleObject, 16 ) \ - SYSCALL_ENTRY( 0x00d8, NtSuspendProcess, 4 ) \ - SYSCALL_ENTRY( 0x00d9, NtSuspendThread, 8 ) \ - SYSCALL_ENTRY( 0x00da, NtSystemDebugControl, 24 ) \ - SYSCALL_ENTRY( 0x00db, NtTerminateJobObject, 8 ) \ - SYSCALL_ENTRY( 0x00dc, NtTerminateProcess, 8 ) \ - SYSCALL_ENTRY( 0x00dd, NtTerminateThread, 8 ) \ - SYSCALL_ENTRY( 0x00de, NtTestAlert, 0 ) \ - SYSCALL_ENTRY( 0x00df, NtTraceControl, 24 ) \ - SYSCALL_ENTRY( 0x00e0, NtUnloadDriver, 4 ) \ - SYSCALL_ENTRY( 0x00e1, NtUnloadKey, 4 ) \ - SYSCALL_ENTRY( 0x00e2, NtUnlockFile, 20 ) \ - SYSCALL_ENTRY( 0x00e3, NtUnlockVirtualMemory, 16 ) \ - SYSCALL_ENTRY( 0x00e4, NtUnmapViewOfSection, 8 ) \ - SYSCALL_ENTRY( 0x00e5, NtUnmapViewOfSectionEx, 12 ) \ - SYSCALL_ENTRY( 0x00e6, NtWaitForAlertByThreadId, 8 ) \ - SYSCALL_ENTRY( 0x00e7, NtWaitForDebugEvent, 16 ) \ - SYSCALL_ENTRY( 0x00e8, NtWaitForKeyedEvent, 16 ) \ - SYSCALL_ENTRY( 0x00e9, NtWaitForMultipleObjects, 20 ) \ - SYSCALL_ENTRY( 0x00ea, NtWaitForSingleObject, 12 ) \ - SYSCALL_ENTRY( 0x00eb, NtWow64AllocateVirtualMemory64, 28 ) \ - SYSCALL_ENTRY( 0x00ec, NtWow64GetNativeSystemInformation, 16 ) \ - SYSCALL_ENTRY( 0x00ed, NtWow64IsProcessorFeaturePresent, 4 ) \ - SYSCALL_ENTRY( 0x00ee, NtWow64QueryInformationProcess64, 20 ) \ - SYSCALL_ENTRY( 0x00ef, NtWow64ReadVirtualMemory64, 28 ) \ - SYSCALL_ENTRY( 0x00f0, NtWow64WriteVirtualMemory64, 28 ) \ - SYSCALL_ENTRY( 0x00f1, NtWriteFile, 36 ) \ - SYSCALL_ENTRY( 0x00f2, NtWriteFileGather, 36 ) \ - SYSCALL_ENTRY( 0x00f3, NtWriteVirtualMemory, 20 ) \ - SYSCALL_ENTRY( 0x00f4, NtYieldExecution, 0 ) \ - SYSCALL_ENTRY( 0x00f5, wine_nt_to_unix_file_name, 16 ) \ - SYSCALL_ENTRY( 0x00f6, wine_unix_to_nt_file_name, 12 ) - -#define ALL_SYSCALLS64 \ - SYSCALL_ENTRY( 0x0000, NtAcceptConnectPort, 48 ) \ - SYSCALL_ENTRY( 0x0001, NtAccessCheck, 64 ) \ - SYSCALL_ENTRY( 0x0002, NtAccessCheckAndAuditAlarm, 88 ) \ - SYSCALL_ENTRY( 0x0003, NtAddAtom, 24 ) \ - SYSCALL_ENTRY( 0x0004, NtAdjustGroupsToken, 48 ) \ - SYSCALL_ENTRY( 0x0005, NtAdjustPrivilegesToken, 48 ) \ - SYSCALL_ENTRY( 0x0006, NtAlertResumeThread, 16 ) \ - SYSCALL_ENTRY( 0x0007, NtAlertThread, 8 ) \ - SYSCALL_ENTRY( 0x0008, NtAlertThreadByThreadId, 8 ) \ - SYSCALL_ENTRY( 0x0009, NtAllocateLocallyUniqueId, 8 ) \ - SYSCALL_ENTRY( 0x000a, NtAllocateReserveObject, 24 ) \ - SYSCALL_ENTRY( 0x000b, NtAllocateUuids, 32 ) \ - SYSCALL_ENTRY( 0x000c, NtAllocateVirtualMemory, 48 ) \ - SYSCALL_ENTRY( 0x000d, NtAllocateVirtualMemoryEx, 56 ) \ - SYSCALL_ENTRY( 0x000e, NtAreMappedFilesTheSame, 16 ) \ - SYSCALL_ENTRY( 0x000f, NtAssignProcessToJobObject, 16 ) \ - SYSCALL_ENTRY( 0x0010, NtCallbackReturn, 24 ) \ - SYSCALL_ENTRY( 0x0011, NtCancelIoFile, 16 ) \ - SYSCALL_ENTRY( 0x0012, NtCancelIoFileEx, 24 ) \ - SYSCALL_ENTRY( 0x0013, NtCancelSynchronousIoFile, 24 ) \ - SYSCALL_ENTRY( 0x0014, NtCancelTimer, 16 ) \ - SYSCALL_ENTRY( 0x0015, NtClearEvent, 8 ) \ - SYSCALL_ENTRY( 0x0016, NtClose, 8 ) \ - SYSCALL_ENTRY( 0x0017, NtCommitTransaction, 16 ) \ - SYSCALL_ENTRY( 0x0018, NtCompareObjects, 16 ) \ - SYSCALL_ENTRY( 0x0019, NtCompareTokens, 24 ) \ - SYSCALL_ENTRY( 0x001a, NtCompleteConnectPort, 8 ) \ - SYSCALL_ENTRY( 0x001b, NtConnectPort, 64 ) \ - SYSCALL_ENTRY( 0x001c, NtContinue, 16 ) \ - SYSCALL_ENTRY( 0x001d, NtContinueEx, 16 ) \ - SYSCALL_ENTRY( 0x001e, NtCreateDebugObject, 32 ) \ - SYSCALL_ENTRY( 0x001f, NtCreateDirectoryObject, 24 ) \ - SYSCALL_ENTRY( 0x0020, NtCreateEvent, 40 ) \ - SYSCALL_ENTRY( 0x0021, NtCreateFile, 88 ) \ - SYSCALL_ENTRY( 0x0022, NtCreateIoCompletion, 32 ) \ - SYSCALL_ENTRY( 0x0023, NtCreateJobObject, 24 ) \ - SYSCALL_ENTRY( 0x0024, NtCreateKey, 56 ) \ - SYSCALL_ENTRY( 0x0025, NtCreateKeyTransacted, 64 ) \ - SYSCALL_ENTRY( 0x0026, NtCreateKeyedEvent, 32 ) \ - SYSCALL_ENTRY( 0x0027, NtCreateLowBoxToken, 72 ) \ - SYSCALL_ENTRY( 0x0028, NtCreateMailslotFile, 64 ) \ - SYSCALL_ENTRY( 0x0029, NtCreateMutant, 32 ) \ - SYSCALL_ENTRY( 0x002a, NtCreateNamedPipeFile, 112 ) \ - SYSCALL_ENTRY( 0x002b, NtCreatePagingFile, 32 ) \ - SYSCALL_ENTRY( 0x002c, NtCreatePort, 40 ) \ - SYSCALL_ENTRY( 0x002d, NtCreateSection, 56 ) \ - SYSCALL_ENTRY( 0x002e, NtCreateSemaphore, 40 ) \ - SYSCALL_ENTRY( 0x002f, NtCreateSymbolicLinkObject, 32 ) \ - SYSCALL_ENTRY( 0x0030, NtCreateThread, 64 ) \ - SYSCALL_ENTRY( 0x0031, NtCreateThreadEx, 88 ) \ - SYSCALL_ENTRY( 0x0032, NtCreateTimer, 32 ) \ - SYSCALL_ENTRY( 0x0033, NtCreateToken, 104 ) \ - SYSCALL_ENTRY( 0x0034, NtCreateTransaction, 80 ) \ - SYSCALL_ENTRY( 0x0035, NtCreateUserProcess, 88 ) \ - SYSCALL_ENTRY( 0x0036, NtDebugActiveProcess, 16 ) \ - SYSCALL_ENTRY( 0x0037, NtDebugContinue, 24 ) \ - SYSCALL_ENTRY( 0x0038, NtDelayExecution, 16 ) \ - SYSCALL_ENTRY( 0x0039, NtDeleteAtom, 8 ) \ - SYSCALL_ENTRY( 0x003a, NtDeleteFile, 8 ) \ - SYSCALL_ENTRY( 0x003b, NtDeleteKey, 8 ) \ - SYSCALL_ENTRY( 0x003c, NtDeleteValueKey, 16 ) \ - SYSCALL_ENTRY( 0x003d, NtDeviceIoControlFile, 80 ) \ - SYSCALL_ENTRY( 0x003e, NtDisplayString, 8 ) \ - SYSCALL_ENTRY( 0x003f, NtDuplicateObject, 56 ) \ - SYSCALL_ENTRY( 0x0040, NtDuplicateToken, 48 ) \ - SYSCALL_ENTRY( 0x0041, NtEnumerateKey, 48 ) \ - SYSCALL_ENTRY( 0x0042, NtEnumerateValueKey, 48 ) \ - SYSCALL_ENTRY( 0x0043, NtFilterToken, 48 ) \ - SYSCALL_ENTRY( 0x0044, NtFindAtom, 24 ) \ - SYSCALL_ENTRY( 0x0045, NtFlushBuffersFile, 16 ) \ - SYSCALL_ENTRY( 0x0046, NtFlushBuffersFileEx, 40 ) \ - SYSCALL_ENTRY( 0x0047, NtFlushInstructionCache, 24 ) \ - SYSCALL_ENTRY( 0x0048, NtFlushKey, 8 ) \ - SYSCALL_ENTRY( 0x0049, NtFlushProcessWriteBuffers, 0 ) \ - SYSCALL_ENTRY( 0x004a, NtFlushVirtualMemory, 32 ) \ - SYSCALL_ENTRY( 0x004b, NtFreeVirtualMemory, 32 ) \ - SYSCALL_ENTRY( 0x004c, NtFsControlFile, 80 ) \ - SYSCALL_ENTRY( 0x004d, NtGetContextThread, 16 ) \ - SYSCALL_ENTRY( 0x004e, NtGetCurrentProcessorNumber, 0 ) \ - SYSCALL_ENTRY( 0x004f, NtGetNextThread, 48 ) \ - SYSCALL_ENTRY( 0x0050, NtGetNlsSectionPtr, 40 ) \ - SYSCALL_ENTRY( 0x0051, NtGetWriteWatch, 56 ) \ - SYSCALL_ENTRY( 0x0052, NtImpersonateAnonymousToken, 8 ) \ - SYSCALL_ENTRY( 0x0053, NtInitializeNlsFiles, 24 ) \ - SYSCALL_ENTRY( 0x0054, NtInitiatePowerAction, 32 ) \ - SYSCALL_ENTRY( 0x0055, NtIsProcessInJob, 16 ) \ - SYSCALL_ENTRY( 0x0056, NtListenPort, 16 ) \ - SYSCALL_ENTRY( 0x0057, NtLoadDriver, 8 ) \ - SYSCALL_ENTRY( 0x0058, NtLoadKey, 16 ) \ - SYSCALL_ENTRY( 0x0059, NtLoadKey2, 24 ) \ - SYSCALL_ENTRY( 0x005a, NtLoadKeyEx, 64 ) \ - SYSCALL_ENTRY( 0x005b, NtLockFile, 80 ) \ - SYSCALL_ENTRY( 0x005c, NtLockVirtualMemory, 32 ) \ - SYSCALL_ENTRY( 0x005d, NtMakePermanentObject, 8 ) \ - SYSCALL_ENTRY( 0x005e, NtMakeTemporaryObject, 8 ) \ - SYSCALL_ENTRY( 0x005f, NtMapViewOfSection, 80 ) \ - SYSCALL_ENTRY( 0x0060, NtMapViewOfSectionEx, 72 ) \ - SYSCALL_ENTRY( 0x0061, NtNotifyChangeDirectoryFile, 72 ) \ - SYSCALL_ENTRY( 0x0062, NtNotifyChangeKey, 80 ) \ - SYSCALL_ENTRY( 0x0063, NtNotifyChangeMultipleKeys, 96 ) \ - SYSCALL_ENTRY( 0x0064, NtOpenDirectoryObject, 24 ) \ - SYSCALL_ENTRY( 0x0065, NtOpenEvent, 24 ) \ - SYSCALL_ENTRY( 0x0066, NtOpenFile, 48 ) \ - SYSCALL_ENTRY( 0x0067, NtOpenIoCompletion, 24 ) \ - SYSCALL_ENTRY( 0x0068, NtOpenJobObject, 24 ) \ - SYSCALL_ENTRY( 0x0069, NtOpenKey, 24 ) \ - SYSCALL_ENTRY( 0x006a, NtOpenKeyEx, 32 ) \ - SYSCALL_ENTRY( 0x006b, NtOpenKeyTransacted, 32 ) \ - SYSCALL_ENTRY( 0x006c, NtOpenKeyTransactedEx, 40 ) \ - SYSCALL_ENTRY( 0x006d, NtOpenKeyedEvent, 24 ) \ - SYSCALL_ENTRY( 0x006e, NtOpenMutant, 24 ) \ - SYSCALL_ENTRY( 0x006f, NtOpenProcess, 32 ) \ - SYSCALL_ENTRY( 0x0070, NtOpenProcessToken, 24 ) \ - SYSCALL_ENTRY( 0x0071, NtOpenProcessTokenEx, 32 ) \ - SYSCALL_ENTRY( 0x0072, NtOpenSection, 24 ) \ - SYSCALL_ENTRY( 0x0073, NtOpenSemaphore, 24 ) \ - SYSCALL_ENTRY( 0x0074, NtOpenSymbolicLinkObject, 24 ) \ - SYSCALL_ENTRY( 0x0075, NtOpenThread, 32 ) \ - SYSCALL_ENTRY( 0x0076, NtOpenThreadToken, 32 ) \ - SYSCALL_ENTRY( 0x0077, NtOpenThreadTokenEx, 40 ) \ - SYSCALL_ENTRY( 0x0078, NtOpenTimer, 24 ) \ - SYSCALL_ENTRY( 0x0079, NtPowerInformation, 40 ) \ - SYSCALL_ENTRY( 0x007a, NtPrivilegeCheck, 24 ) \ - SYSCALL_ENTRY( 0x007b, NtProtectVirtualMemory, 40 ) \ - SYSCALL_ENTRY( 0x007c, NtPulseEvent, 16 ) \ - SYSCALL_ENTRY( 0x007d, NtQueryAttributesFile, 16 ) \ - SYSCALL_ENTRY( 0x007e, NtQueryDefaultLocale, 16 ) \ - SYSCALL_ENTRY( 0x007f, NtQueryDefaultUILanguage, 8 ) \ - SYSCALL_ENTRY( 0x0080, NtQueryDirectoryFile, 88 ) \ - SYSCALL_ENTRY( 0x0081, NtQueryDirectoryObject, 56 ) \ - SYSCALL_ENTRY( 0x0082, NtQueryEaFile, 72 ) \ - SYSCALL_ENTRY( 0x0083, NtQueryEvent, 40 ) \ - SYSCALL_ENTRY( 0x0084, NtQueryFullAttributesFile, 16 ) \ - SYSCALL_ENTRY( 0x0085, NtQueryInformationAtom, 40 ) \ - SYSCALL_ENTRY( 0x0086, NtQueryInformationFile, 40 ) \ - SYSCALL_ENTRY( 0x0087, NtQueryInformationJobObject, 40 ) \ - SYSCALL_ENTRY( 0x0088, NtQueryInformationProcess, 40 ) \ - SYSCALL_ENTRY( 0x0089, NtQueryInformationThread, 40 ) \ - SYSCALL_ENTRY( 0x008a, NtQueryInformationToken, 40 ) \ - SYSCALL_ENTRY( 0x008b, NtQueryInstallUILanguage, 8 ) \ - SYSCALL_ENTRY( 0x008c, NtQueryIoCompletion, 40 ) \ - SYSCALL_ENTRY( 0x008d, NtQueryKey, 40 ) \ - SYSCALL_ENTRY( 0x008e, NtQueryLicenseValue, 40 ) \ - SYSCALL_ENTRY( 0x008f, NtQueryMultipleValueKey, 48 ) \ - SYSCALL_ENTRY( 0x0090, NtQueryMutant, 40 ) \ - SYSCALL_ENTRY( 0x0091, NtQueryObject, 40 ) \ - SYSCALL_ENTRY( 0x0092, NtQueryPerformanceCounter, 16 ) \ - SYSCALL_ENTRY( 0x0093, NtQuerySection, 40 ) \ - SYSCALL_ENTRY( 0x0094, NtQuerySecurityObject, 40 ) \ - SYSCALL_ENTRY( 0x0095, NtQuerySemaphore, 40 ) \ - SYSCALL_ENTRY( 0x0096, NtQuerySymbolicLinkObject, 24 ) \ - SYSCALL_ENTRY( 0x0097, NtQuerySystemEnvironmentValue, 32 ) \ - SYSCALL_ENTRY( 0x0098, NtQuerySystemEnvironmentValueEx, 40 ) \ - SYSCALL_ENTRY( 0x0099, NtQuerySystemInformation, 32 ) \ - SYSCALL_ENTRY( 0x009a, NtQuerySystemInformationEx, 48 ) \ - SYSCALL_ENTRY( 0x009b, NtQuerySystemTime, 8 ) \ - SYSCALL_ENTRY( 0x009c, NtQueryTimer, 40 ) \ - SYSCALL_ENTRY( 0x009d, NtQueryTimerResolution, 24 ) \ - SYSCALL_ENTRY( 0x009e, NtQueryValueKey, 48 ) \ - SYSCALL_ENTRY( 0x009f, NtQueryVirtualMemory, 48 ) \ - SYSCALL_ENTRY( 0x00a0, NtQueryVolumeInformationFile, 40 ) \ - SYSCALL_ENTRY( 0x00a1, NtQueueApcThread, 40 ) \ - SYSCALL_ENTRY( 0x00a2, NtQueueApcThreadEx, 48 ) \ - SYSCALL_ENTRY( 0x00a3, NtRaiseException, 24 ) \ - SYSCALL_ENTRY( 0x00a4, NtRaiseHardError, 48 ) \ - SYSCALL_ENTRY( 0x00a5, NtReadFile, 72 ) \ - SYSCALL_ENTRY( 0x00a6, NtReadFileScatter, 72 ) \ - SYSCALL_ENTRY( 0x00a7, NtReadVirtualMemory, 40 ) \ - SYSCALL_ENTRY( 0x00a8, NtRegisterThreadTerminatePort, 8 ) \ - SYSCALL_ENTRY( 0x00a9, NtReleaseKeyedEvent, 32 ) \ - SYSCALL_ENTRY( 0x00aa, NtReleaseMutant, 16 ) \ - SYSCALL_ENTRY( 0x00ab, NtReleaseSemaphore, 24 ) \ - SYSCALL_ENTRY( 0x00ac, NtRemoveIoCompletion, 40 ) \ - SYSCALL_ENTRY( 0x00ad, NtRemoveIoCompletionEx, 48 ) \ - SYSCALL_ENTRY( 0x00ae, NtRemoveProcessDebug, 16 ) \ - SYSCALL_ENTRY( 0x00af, NtRenameKey, 16 ) \ - SYSCALL_ENTRY( 0x00b0, NtReplaceKey, 24 ) \ - SYSCALL_ENTRY( 0x00b1, NtReplyWaitReceivePort, 32 ) \ - SYSCALL_ENTRY( 0x00b2, NtRequestWaitReplyPort, 24 ) \ - SYSCALL_ENTRY( 0x00b3, NtResetEvent, 16 ) \ - SYSCALL_ENTRY( 0x00b4, NtResetWriteWatch, 24 ) \ - SYSCALL_ENTRY( 0x00b5, NtRestoreKey, 24 ) \ - SYSCALL_ENTRY( 0x00b6, NtResumeProcess, 8 ) \ - SYSCALL_ENTRY( 0x00b7, NtResumeThread, 16 ) \ - SYSCALL_ENTRY( 0x00b8, NtRollbackTransaction, 16 ) \ - SYSCALL_ENTRY( 0x00b9, NtSaveKey, 16 ) \ - SYSCALL_ENTRY( 0x00ba, NtSecureConnectPort, 72 ) \ - SYSCALL_ENTRY( 0x00bb, NtSetContextThread, 16 ) \ - SYSCALL_ENTRY( 0x00bc, NtSetDebugFilterState, 24 ) \ - SYSCALL_ENTRY( 0x00bd, NtSetDefaultLocale, 16 ) \ - SYSCALL_ENTRY( 0x00be, NtSetDefaultUILanguage, 8 ) \ - SYSCALL_ENTRY( 0x00bf, NtSetEaFile, 32 ) \ - SYSCALL_ENTRY( 0x00c0, NtSetEvent, 16 ) \ - SYSCALL_ENTRY( 0x00c1, NtSetInformationDebugObject, 40 ) \ - SYSCALL_ENTRY( 0x00c2, NtSetInformationFile, 40 ) \ - SYSCALL_ENTRY( 0x00c3, NtSetInformationJobObject, 32 ) \ - SYSCALL_ENTRY( 0x00c4, NtSetInformationKey, 32 ) \ - SYSCALL_ENTRY( 0x00c5, NtSetInformationObject, 32 ) \ - SYSCALL_ENTRY( 0x00c6, NtSetInformationProcess, 32 ) \ - SYSCALL_ENTRY( 0x00c7, NtSetInformationThread, 32 ) \ - SYSCALL_ENTRY( 0x00c8, NtSetInformationToken, 32 ) \ - SYSCALL_ENTRY( 0x00c9, NtSetInformationVirtualMemory, 48 ) \ - SYSCALL_ENTRY( 0x00ca, NtSetIntervalProfile, 16 ) \ - SYSCALL_ENTRY( 0x00cb, NtSetIoCompletion, 40 ) \ - SYSCALL_ENTRY( 0x00cc, NtSetIoCompletionEx, 48 ) \ - SYSCALL_ENTRY( 0x00cd, NtSetLdtEntries, 32 ) \ - SYSCALL_ENTRY( 0x00ce, NtSetSecurityObject, 24 ) \ - SYSCALL_ENTRY( 0x00cf, NtSetSystemInformation, 24 ) \ - SYSCALL_ENTRY( 0x00d0, NtSetSystemTime, 16 ) \ - SYSCALL_ENTRY( 0x00d1, NtSetThreadExecutionState, 16 ) \ - SYSCALL_ENTRY( 0x00d2, NtSetTimer, 56 ) \ - SYSCALL_ENTRY( 0x00d3, NtSetTimerResolution, 24 ) \ - SYSCALL_ENTRY( 0x00d4, NtSetValueKey, 48 ) \ - SYSCALL_ENTRY( 0x00d5, NtSetVolumeInformationFile, 40 ) \ - SYSCALL_ENTRY( 0x00d6, NtShutdownSystem, 8 ) \ - SYSCALL_ENTRY( 0x00d7, NtSignalAndWaitForSingleObject, 32 ) \ - SYSCALL_ENTRY( 0x00d8, NtSuspendProcess, 8 ) \ - SYSCALL_ENTRY( 0x00d9, NtSuspendThread, 16 ) \ - SYSCALL_ENTRY( 0x00da, NtSystemDebugControl, 48 ) \ - SYSCALL_ENTRY( 0x00db, NtTerminateJobObject, 16 ) \ - SYSCALL_ENTRY( 0x00dc, NtTerminateProcess, 16 ) \ - SYSCALL_ENTRY( 0x00dd, NtTerminateThread, 16 ) \ - SYSCALL_ENTRY( 0x00de, NtTestAlert, 0 ) \ - SYSCALL_ENTRY( 0x00df, NtTraceControl, 48 ) \ - SYSCALL_ENTRY( 0x00e0, NtUnloadDriver, 8 ) \ - SYSCALL_ENTRY( 0x00e1, NtUnloadKey, 8 ) \ - SYSCALL_ENTRY( 0x00e2, NtUnlockFile, 40 ) \ - SYSCALL_ENTRY( 0x00e3, NtUnlockVirtualMemory, 32 ) \ - SYSCALL_ENTRY( 0x00e4, NtUnmapViewOfSection, 16 ) \ - SYSCALL_ENTRY( 0x00e5, NtUnmapViewOfSectionEx, 24 ) \ - SYSCALL_ENTRY( 0x00e6, NtWaitForAlertByThreadId, 16 ) \ - SYSCALL_ENTRY( 0x00e7, NtWaitForDebugEvent, 32 ) \ - SYSCALL_ENTRY( 0x00e8, NtWaitForKeyedEvent, 32 ) \ - SYSCALL_ENTRY( 0x00e9, NtWaitForMultipleObjects, 40 ) \ - SYSCALL_ENTRY( 0x00ea, NtWaitForSingleObject, 24 ) \ - SYSCALL_ENTRY( 0x00eb, NtWriteFile, 72 ) \ - SYSCALL_ENTRY( 0x00ec, NtWriteFileGather, 72 ) \ - SYSCALL_ENTRY( 0x00ed, NtWriteVirtualMemory, 40 ) \ - SYSCALL_ENTRY( 0x00ee, NtYieldExecution, 0 ) \ - SYSCALL_ENTRY( 0x00ef, wine_nt_to_unix_file_name, 32 ) \ - SYSCALL_ENTRY( 0x00f0, wine_unix_to_nt_file_name, 24 ) diff --git a/dlls/win32u/win32syscalls.h b/dlls/win32u/win32syscalls.h deleted file mode 100644 index 172b43805210..000000000000 --- a/dlls/win32u/win32syscalls.h +++ /dev/null @@ -1,867 +0,0 @@ -/* Automatically generated by tools/make_specfiles */ - -#define ALL_SYSCALLS32 \ - SYSCALL_ENTRY( 0x0000, NtGdiAbortDoc, 4 ) \ - SYSCALL_ENTRY( 0x0001, NtGdiAbortPath, 4 ) \ - SYSCALL_ENTRY( 0x0002, NtGdiAddFontMemResourceEx, 20 ) \ - SYSCALL_ENTRY( 0x0003, NtGdiAddFontResourceW, 24 ) \ - SYSCALL_ENTRY( 0x0004, NtGdiAlphaBlend, 48 ) \ - SYSCALL_ENTRY( 0x0005, NtGdiAngleArc, 24 ) \ - SYSCALL_ENTRY( 0x0006, NtGdiArcInternal, 40 ) \ - SYSCALL_ENTRY( 0x0007, NtGdiBeginPath, 4 ) \ - SYSCALL_ENTRY( 0x0008, NtGdiBitBlt, 44 ) \ - SYSCALL_ENTRY( 0x0009, NtGdiCloseFigure, 4 ) \ - SYSCALL_ENTRY( 0x000a, NtGdiCombineRgn, 16 ) \ - SYSCALL_ENTRY( 0x000b, NtGdiComputeXformCoefficients, 4 ) \ - SYSCALL_ENTRY( 0x000c, NtGdiCreateBitmap, 20 ) \ - SYSCALL_ENTRY( 0x000d, NtGdiCreateClientObj, 4 ) \ - SYSCALL_ENTRY( 0x000e, NtGdiCreateCompatibleBitmap, 12 ) \ - SYSCALL_ENTRY( 0x000f, NtGdiCreateCompatibleDC, 4 ) \ - SYSCALL_ENTRY( 0x0010, NtGdiCreateDIBBrush, 24 ) \ - SYSCALL_ENTRY( 0x0011, NtGdiCreateDIBSection, 36 ) \ - SYSCALL_ENTRY( 0x0012, NtGdiCreateDIBitmapInternal, 44 ) \ - SYSCALL_ENTRY( 0x0013, NtGdiCreateEllipticRgn, 16 ) \ - SYSCALL_ENTRY( 0x0014, NtGdiCreateHalftonePalette, 4 ) \ - SYSCALL_ENTRY( 0x0015, NtGdiCreateHatchBrushInternal, 12 ) \ - SYSCALL_ENTRY( 0x0016, NtGdiCreateMetafileDC, 4 ) \ - SYSCALL_ENTRY( 0x0017, NtGdiCreatePaletteInternal, 8 ) \ - SYSCALL_ENTRY( 0x0018, NtGdiCreatePatternBrushInternal, 12 ) \ - SYSCALL_ENTRY( 0x0019, NtGdiCreatePen, 16 ) \ - SYSCALL_ENTRY( 0x001a, NtGdiCreateRectRgn, 16 ) \ - SYSCALL_ENTRY( 0x001b, NtGdiCreateRoundRectRgn, 24 ) \ - SYSCALL_ENTRY( 0x001c, NtGdiCreateSolidBrush, 8 ) \ - SYSCALL_ENTRY( 0x001d, NtGdiDdDDICheckVidPnExclusiveOwnership, 4 ) \ - SYSCALL_ENTRY( 0x001e, NtGdiDdDDICloseAdapter, 4 ) \ - SYSCALL_ENTRY( 0x001f, NtGdiDdDDICreateAllocation, 4 ) \ - SYSCALL_ENTRY( 0x0020, NtGdiDdDDICreateAllocation2, 4 ) \ - SYSCALL_ENTRY( 0x0021, NtGdiDdDDICreateDCFromMemory, 4 ) \ - SYSCALL_ENTRY( 0x0022, NtGdiDdDDICreateDevice, 4 ) \ - SYSCALL_ENTRY( 0x0023, NtGdiDdDDICreateKeyedMutex, 4 ) \ - SYSCALL_ENTRY( 0x0024, NtGdiDdDDICreateKeyedMutex2, 4 ) \ - SYSCALL_ENTRY( 0x0025, NtGdiDdDDICreateSynchronizationObject, 4 ) \ - SYSCALL_ENTRY( 0x0026, NtGdiDdDDICreateSynchronizationObject2, 4 ) \ - SYSCALL_ENTRY( 0x0027, NtGdiDdDDIDestroyAllocation, 4 ) \ - SYSCALL_ENTRY( 0x0028, NtGdiDdDDIDestroyAllocation2, 4 ) \ - SYSCALL_ENTRY( 0x0029, NtGdiDdDDIDestroyDCFromMemory, 4 ) \ - SYSCALL_ENTRY( 0x002a, NtGdiDdDDIDestroyDevice, 4 ) \ - SYSCALL_ENTRY( 0x002b, NtGdiDdDDIDestroyKeyedMutex, 4 ) \ - SYSCALL_ENTRY( 0x002c, NtGdiDdDDIDestroySynchronizationObject, 4 ) \ - SYSCALL_ENTRY( 0x002d, NtGdiDdDDIEnumAdapters, 4 ) \ - SYSCALL_ENTRY( 0x002e, NtGdiDdDDIEnumAdapters2, 4 ) \ - SYSCALL_ENTRY( 0x002f, NtGdiDdDDIEscape, 4 ) \ - SYSCALL_ENTRY( 0x0030, NtGdiDdDDIOpenAdapterFromDeviceName, 4 ) \ - SYSCALL_ENTRY( 0x0031, NtGdiDdDDIOpenAdapterFromHdc, 4 ) \ - SYSCALL_ENTRY( 0x0032, NtGdiDdDDIOpenAdapterFromLuid, 4 ) \ - SYSCALL_ENTRY( 0x0033, NtGdiDdDDIOpenKeyedMutex, 4 ) \ - SYSCALL_ENTRY( 0x0034, NtGdiDdDDIOpenKeyedMutex2, 4 ) \ - SYSCALL_ENTRY( 0x0035, NtGdiDdDDIOpenKeyedMutexFromNtHandle, 4 ) \ - SYSCALL_ENTRY( 0x0036, NtGdiDdDDIOpenResource, 4 ) \ - SYSCALL_ENTRY( 0x0037, NtGdiDdDDIOpenResource2, 4 ) \ - SYSCALL_ENTRY( 0x0038, NtGdiDdDDIOpenResourceFromNtHandle, 4 ) \ - SYSCALL_ENTRY( 0x0039, NtGdiDdDDIOpenSyncObjectFromNtHandle, 4 ) \ - SYSCALL_ENTRY( 0x003a, NtGdiDdDDIOpenSyncObjectFromNtHandle2, 4 ) \ - SYSCALL_ENTRY( 0x003b, NtGdiDdDDIOpenSyncObjectNtHandleFromName, 4 ) \ - SYSCALL_ENTRY( 0x003c, NtGdiDdDDIOpenSynchronizationObject, 4 ) \ - SYSCALL_ENTRY( 0x003d, NtGdiDdDDIQueryAdapterInfo, 4 ) \ - SYSCALL_ENTRY( 0x003e, NtGdiDdDDIQueryResourceInfo, 4 ) \ - SYSCALL_ENTRY( 0x003f, NtGdiDdDDIQueryResourceInfoFromNtHandle, 4 ) \ - SYSCALL_ENTRY( 0x0040, NtGdiDdDDIQueryStatistics, 4 ) \ - SYSCALL_ENTRY( 0x0041, NtGdiDdDDIQueryVideoMemoryInfo, 4 ) \ - SYSCALL_ENTRY( 0x0042, NtGdiDdDDISetQueuedLimit, 4 ) \ - SYSCALL_ENTRY( 0x0043, NtGdiDdDDISetVidPnSourceOwner, 4 ) \ - SYSCALL_ENTRY( 0x0044, NtGdiDdDDIShareObjects, 20 ) \ - SYSCALL_ENTRY( 0x0045, NtGdiDeleteClientObj, 4 ) \ - SYSCALL_ENTRY( 0x0046, NtGdiDeleteObjectApp, 4 ) \ - SYSCALL_ENTRY( 0x0047, NtGdiDescribePixelFormat, 16 ) \ - SYSCALL_ENTRY( 0x0048, NtGdiDoPalette, 24 ) \ - SYSCALL_ENTRY( 0x0049, NtGdiDrawStream, 12 ) \ - SYSCALL_ENTRY( 0x004a, NtGdiEllipse, 20 ) \ - SYSCALL_ENTRY( 0x004b, NtGdiEndDoc, 4 ) \ - SYSCALL_ENTRY( 0x004c, NtGdiEndPage, 4 ) \ - SYSCALL_ENTRY( 0x004d, NtGdiEndPath, 4 ) \ - SYSCALL_ENTRY( 0x004e, NtGdiEnumFonts, 32 ) \ - SYSCALL_ENTRY( 0x004f, NtGdiEqualRgn, 8 ) \ - SYSCALL_ENTRY( 0x0050, NtGdiExcludeClipRect, 20 ) \ - SYSCALL_ENTRY( 0x0051, NtGdiExtCreatePen, 44 ) \ - SYSCALL_ENTRY( 0x0052, NtGdiExtCreateRegion, 12 ) \ - SYSCALL_ENTRY( 0x0053, NtGdiExtEscape, 32 ) \ - SYSCALL_ENTRY( 0x0054, NtGdiExtFloodFill, 20 ) \ - SYSCALL_ENTRY( 0x0055, NtGdiExtGetObjectW, 12 ) \ - SYSCALL_ENTRY( 0x0056, NtGdiExtSelectClipRgn, 12 ) \ - SYSCALL_ENTRY( 0x0057, NtGdiExtTextOutW, 36 ) \ - SYSCALL_ENTRY( 0x0058, NtGdiFillPath, 4 ) \ - SYSCALL_ENTRY( 0x0059, NtGdiFillRgn, 12 ) \ - SYSCALL_ENTRY( 0x005a, NtGdiFlattenPath, 4 ) \ - SYSCALL_ENTRY( 0x005b, NtGdiFlush, 0 ) \ - SYSCALL_ENTRY( 0x005c, NtGdiFontIsLinked, 4 ) \ - SYSCALL_ENTRY( 0x005d, NtGdiFrameRgn, 20 ) \ - SYSCALL_ENTRY( 0x005e, NtGdiGetAndSetDCDword, 16 ) \ - SYSCALL_ENTRY( 0x005f, NtGdiGetAppClipBox, 8 ) \ - SYSCALL_ENTRY( 0x0060, NtGdiGetBitmapBits, 12 ) \ - SYSCALL_ENTRY( 0x0061, NtGdiGetBitmapDimension, 8 ) \ - SYSCALL_ENTRY( 0x0062, NtGdiGetBoundsRect, 12 ) \ - SYSCALL_ENTRY( 0x0063, NtGdiGetCharABCWidthsW, 24 ) \ - SYSCALL_ENTRY( 0x0064, NtGdiGetCharWidthInfo, 8 ) \ - SYSCALL_ENTRY( 0x0065, NtGdiGetCharWidthW, 24 ) \ - SYSCALL_ENTRY( 0x0066, NtGdiGetColorAdjustment, 8 ) \ - SYSCALL_ENTRY( 0x0067, NtGdiGetDCDword, 12 ) \ - SYSCALL_ENTRY( 0x0068, NtGdiGetDCObject, 8 ) \ - SYSCALL_ENTRY( 0x0069, NtGdiGetDCPoint, 12 ) \ - SYSCALL_ENTRY( 0x006a, NtGdiGetDIBitsInternal, 36 ) \ - SYSCALL_ENTRY( 0x006b, NtGdiGetDeviceCaps, 8 ) \ - SYSCALL_ENTRY( 0x006c, NtGdiGetDeviceGammaRamp, 8 ) \ - SYSCALL_ENTRY( 0x006d, NtGdiGetFontData, 20 ) \ - SYSCALL_ENTRY( 0x006e, NtGdiGetFontFileData, 20 ) \ - SYSCALL_ENTRY( 0x006f, NtGdiGetFontFileInfo, 20 ) \ - SYSCALL_ENTRY( 0x0070, NtGdiGetFontUnicodeRanges, 8 ) \ - SYSCALL_ENTRY( 0x0071, NtGdiGetGlyphIndicesW, 20 ) \ - SYSCALL_ENTRY( 0x0072, NtGdiGetGlyphOutline, 32 ) \ - SYSCALL_ENTRY( 0x0073, NtGdiGetKerningPairs, 12 ) \ - SYSCALL_ENTRY( 0x0074, NtGdiGetNearestColor, 8 ) \ - SYSCALL_ENTRY( 0x0075, NtGdiGetNearestPaletteIndex, 8 ) \ - SYSCALL_ENTRY( 0x0076, NtGdiGetOutlineTextMetricsInternalW, 16 ) \ - SYSCALL_ENTRY( 0x0077, NtGdiGetPath, 16 ) \ - SYSCALL_ENTRY( 0x0078, NtGdiGetPixel, 12 ) \ - SYSCALL_ENTRY( 0x0079, NtGdiGetRandomRgn, 12 ) \ - SYSCALL_ENTRY( 0x007a, NtGdiGetRasterizerCaps, 8 ) \ - SYSCALL_ENTRY( 0x007b, NtGdiGetRealizationInfo, 8 ) \ - SYSCALL_ENTRY( 0x007c, NtGdiGetRegionData, 12 ) \ - SYSCALL_ENTRY( 0x007d, NtGdiGetRgnBox, 8 ) \ - SYSCALL_ENTRY( 0x007e, NtGdiGetSpoolMessage, 16 ) \ - SYSCALL_ENTRY( 0x007f, NtGdiGetSystemPaletteUse, 4 ) \ - SYSCALL_ENTRY( 0x0080, NtGdiGetTextCharsetInfo, 12 ) \ - SYSCALL_ENTRY( 0x0081, NtGdiGetTextExtentExW, 32 ) \ - SYSCALL_ENTRY( 0x0082, NtGdiGetTextFaceW, 16 ) \ - SYSCALL_ENTRY( 0x0083, NtGdiGetTextMetricsW, 12 ) \ - SYSCALL_ENTRY( 0x0084, NtGdiGetTransform, 12 ) \ - SYSCALL_ENTRY( 0x0085, NtGdiGradientFill, 24 ) \ - SYSCALL_ENTRY( 0x0086, NtGdiHfontCreate, 20 ) \ - SYSCALL_ENTRY( 0x0087, NtGdiIcmBrushInfo, 32 ) \ - SYSCALL_ENTRY( 0x0088, NtGdiInitSpool, 0 ) \ - SYSCALL_ENTRY( 0x0089, NtGdiIntersectClipRect, 20 ) \ - SYSCALL_ENTRY( 0x008a, NtGdiInvertRgn, 8 ) \ - SYSCALL_ENTRY( 0x008b, NtGdiLineTo, 12 ) \ - SYSCALL_ENTRY( 0x008c, NtGdiMaskBlt, 52 ) \ - SYSCALL_ENTRY( 0x008d, NtGdiModifyWorldTransform, 12 ) \ - SYSCALL_ENTRY( 0x008e, NtGdiMoveTo, 16 ) \ - SYSCALL_ENTRY( 0x008f, NtGdiOffsetClipRgn, 12 ) \ - SYSCALL_ENTRY( 0x0090, NtGdiOffsetRgn, 12 ) \ - SYSCALL_ENTRY( 0x0091, NtGdiOpenDCW, 32 ) \ - SYSCALL_ENTRY( 0x0092, NtGdiPatBlt, 24 ) \ - SYSCALL_ENTRY( 0x0093, NtGdiPathToRegion, 4 ) \ - SYSCALL_ENTRY( 0x0094, NtGdiPlgBlt, 44 ) \ - SYSCALL_ENTRY( 0x0095, NtGdiPolyDraw, 16 ) \ - SYSCALL_ENTRY( 0x0096, NtGdiPolyPolyDraw, 20 ) \ - SYSCALL_ENTRY( 0x0097, NtGdiPtInRegion, 12 ) \ - SYSCALL_ENTRY( 0x0098, NtGdiPtVisible, 12 ) \ - SYSCALL_ENTRY( 0x0099, NtGdiRectInRegion, 8 ) \ - SYSCALL_ENTRY( 0x009a, NtGdiRectVisible, 8 ) \ - SYSCALL_ENTRY( 0x009b, NtGdiRectangle, 20 ) \ - SYSCALL_ENTRY( 0x009c, NtGdiRemoveFontMemResourceEx, 4 ) \ - SYSCALL_ENTRY( 0x009d, NtGdiRemoveFontResourceW, 24 ) \ - SYSCALL_ENTRY( 0x009e, NtGdiResetDC, 20 ) \ - SYSCALL_ENTRY( 0x009f, NtGdiResizePalette, 8 ) \ - SYSCALL_ENTRY( 0x00a0, NtGdiRestoreDC, 8 ) \ - SYSCALL_ENTRY( 0x00a1, NtGdiRoundRect, 28 ) \ - SYSCALL_ENTRY( 0x00a2, NtGdiSaveDC, 4 ) \ - SYSCALL_ENTRY( 0x00a3, NtGdiScaleViewportExtEx, 24 ) \ - SYSCALL_ENTRY( 0x00a4, NtGdiScaleWindowExtEx, 24 ) \ - SYSCALL_ENTRY( 0x00a5, NtGdiSelectBitmap, 8 ) \ - SYSCALL_ENTRY( 0x00a6, NtGdiSelectBrush, 8 ) \ - SYSCALL_ENTRY( 0x00a7, NtGdiSelectClipPath, 8 ) \ - SYSCALL_ENTRY( 0x00a8, NtGdiSelectFont, 8 ) \ - SYSCALL_ENTRY( 0x00a9, NtGdiSelectPen, 8 ) \ - SYSCALL_ENTRY( 0x00aa, NtGdiSetBitmapBits, 12 ) \ - SYSCALL_ENTRY( 0x00ab, NtGdiSetBitmapDimension, 16 ) \ - SYSCALL_ENTRY( 0x00ac, NtGdiSetBoundsRect, 12 ) \ - SYSCALL_ENTRY( 0x00ad, NtGdiSetBrushOrg, 16 ) \ - SYSCALL_ENTRY( 0x00ae, NtGdiSetColorAdjustment, 8 ) \ - SYSCALL_ENTRY( 0x00af, NtGdiSetDIBitsToDeviceInternal, 64 ) \ - SYSCALL_ENTRY( 0x00b0, NtGdiSetDeviceGammaRamp, 8 ) \ - SYSCALL_ENTRY( 0x00b1, NtGdiSetLayout, 12 ) \ - SYSCALL_ENTRY( 0x00b2, NtGdiSetMagicColors, 12 ) \ - SYSCALL_ENTRY( 0x00b3, NtGdiSetMetaRgn, 4 ) \ - SYSCALL_ENTRY( 0x00b4, NtGdiSetPixel, 16 ) \ - SYSCALL_ENTRY( 0x00b5, NtGdiSetPixelFormat, 8 ) \ - SYSCALL_ENTRY( 0x00b6, NtGdiSetRectRgn, 20 ) \ - SYSCALL_ENTRY( 0x00b7, NtGdiSetSystemPaletteUse, 8 ) \ - SYSCALL_ENTRY( 0x00b8, NtGdiSetTextJustification, 12 ) \ - SYSCALL_ENTRY( 0x00b9, NtGdiSetVirtualResolution, 20 ) \ - SYSCALL_ENTRY( 0x00ba, NtGdiStartDoc, 16 ) \ - SYSCALL_ENTRY( 0x00bb, NtGdiStartPage, 4 ) \ - SYSCALL_ENTRY( 0x00bc, NtGdiStretchBlt, 48 ) \ - SYSCALL_ENTRY( 0x00bd, NtGdiStretchDIBitsInternal, 64 ) \ - SYSCALL_ENTRY( 0x00be, NtGdiStrokeAndFillPath, 4 ) \ - SYSCALL_ENTRY( 0x00bf, NtGdiStrokePath, 4 ) \ - SYSCALL_ENTRY( 0x00c0, NtGdiSwapBuffers, 4 ) \ - SYSCALL_ENTRY( 0x00c1, NtGdiTransformPoints, 20 ) \ - SYSCALL_ENTRY( 0x00c2, NtGdiTransparentBlt, 44 ) \ - SYSCALL_ENTRY( 0x00c3, NtGdiUnrealizeObject, 4 ) \ - SYSCALL_ENTRY( 0x00c4, NtGdiUpdateColors, 4 ) \ - SYSCALL_ENTRY( 0x00c5, NtGdiWidenPath, 4 ) \ - SYSCALL_ENTRY( 0x00c6, NtUserActivateKeyboardLayout, 8 ) \ - SYSCALL_ENTRY( 0x00c7, NtUserAddClipboardFormatListener, 4 ) \ - SYSCALL_ENTRY( 0x00c8, NtUserAssociateInputContext, 12 ) \ - SYSCALL_ENTRY( 0x00c9, NtUserAttachThreadInput, 12 ) \ - SYSCALL_ENTRY( 0x00ca, NtUserBeginPaint, 8 ) \ - SYSCALL_ENTRY( 0x00cb, NtUserBuildHimcList, 16 ) \ - SYSCALL_ENTRY( 0x00cc, NtUserBuildHwndList, 32 ) \ - SYSCALL_ENTRY( 0x00cd, NtUserBuildNameList, 16 ) \ - SYSCALL_ENTRY( 0x00ce, NtUserBuildPropList, 16 ) \ - SYSCALL_ENTRY( 0x00cf, NtUserCallHwnd, 8 ) \ - SYSCALL_ENTRY( 0x00d0, NtUserCallHwndParam, 12 ) \ - SYSCALL_ENTRY( 0x00d1, NtUserCallMsgFilter, 8 ) \ - SYSCALL_ENTRY( 0x00d2, NtUserCallNextHookEx, 16 ) \ - SYSCALL_ENTRY( 0x00d3, NtUserCallNoParam, 4 ) \ - SYSCALL_ENTRY( 0x00d4, NtUserCallOneParam, 8 ) \ - SYSCALL_ENTRY( 0x00d5, NtUserCallTwoParam, 12 ) \ - SYSCALL_ENTRY( 0x00d6, NtUserChangeClipboardChain, 8 ) \ - SYSCALL_ENTRY( 0x00d7, NtUserChangeDisplaySettings, 20 ) \ - SYSCALL_ENTRY( 0x00d8, NtUserCheckMenuItem, 12 ) \ - SYSCALL_ENTRY( 0x00d9, NtUserChildWindowFromPointEx, 16 ) \ - SYSCALL_ENTRY( 0x00da, NtUserClipCursor, 4 ) \ - SYSCALL_ENTRY( 0x00db, NtUserCloseClipboard, 0 ) \ - SYSCALL_ENTRY( 0x00dc, NtUserCloseDesktop, 4 ) \ - SYSCALL_ENTRY( 0x00dd, NtUserCloseWindowStation, 4 ) \ - SYSCALL_ENTRY( 0x00de, NtUserCopyAcceleratorTable, 12 ) \ - SYSCALL_ENTRY( 0x00df, NtUserCountClipboardFormats, 0 ) \ - SYSCALL_ENTRY( 0x00e0, NtUserCreateAcceleratorTable, 8 ) \ - SYSCALL_ENTRY( 0x00e1, NtUserCreateCaret, 16 ) \ - SYSCALL_ENTRY( 0x00e2, NtUserCreateDesktopEx, 24 ) \ - SYSCALL_ENTRY( 0x00e3, NtUserCreateInputContext, 4 ) \ - SYSCALL_ENTRY( 0x00e4, NtUserCreateWindowEx, 68 ) \ - SYSCALL_ENTRY( 0x00e5, NtUserCreateWindowStation, 28 ) \ - SYSCALL_ENTRY( 0x00e6, NtUserDeferWindowPosAndBand, 40 ) \ - SYSCALL_ENTRY( 0x00e7, NtUserDeleteMenu, 12 ) \ - SYSCALL_ENTRY( 0x00e8, NtUserDestroyAcceleratorTable, 4 ) \ - SYSCALL_ENTRY( 0x00e9, NtUserDestroyCursor, 8 ) \ - SYSCALL_ENTRY( 0x00ea, NtUserDestroyInputContext, 4 ) \ - SYSCALL_ENTRY( 0x00eb, NtUserDestroyMenu, 4 ) \ - SYSCALL_ENTRY( 0x00ec, NtUserDestroyWindow, 4 ) \ - SYSCALL_ENTRY( 0x00ed, NtUserDisableThreadIme, 4 ) \ - SYSCALL_ENTRY( 0x00ee, NtUserDispatchMessage, 4 ) \ - SYSCALL_ENTRY( 0x00ef, NtUserDisplayConfigGetDeviceInfo, 4 ) \ - SYSCALL_ENTRY( 0x00f0, NtUserDragDetect, 12 ) \ - SYSCALL_ENTRY( 0x00f1, NtUserDragObject, 20 ) \ - SYSCALL_ENTRY( 0x00f2, NtUserDrawCaptionTemp, 28 ) \ - SYSCALL_ENTRY( 0x00f3, NtUserDrawIconEx, 36 ) \ - SYSCALL_ENTRY( 0x00f4, NtUserDrawMenuBarTemp, 20 ) \ - SYSCALL_ENTRY( 0x00f5, NtUserEmptyClipboard, 0 ) \ - SYSCALL_ENTRY( 0x00f6, NtUserEnableMenuItem, 12 ) \ - SYSCALL_ENTRY( 0x00f7, NtUserEnableMouseInPointer, 4 ) \ - SYSCALL_ENTRY( 0x00f8, NtUserEnableMouseInPointerForThread, 0 ) \ - SYSCALL_ENTRY( 0x00f9, NtUserEnableScrollBar, 12 ) \ - SYSCALL_ENTRY( 0x00fa, NtUserEndDeferWindowPosEx, 8 ) \ - SYSCALL_ENTRY( 0x00fb, NtUserEndMenu, 0 ) \ - SYSCALL_ENTRY( 0x00fc, NtUserEndPaint, 8 ) \ - SYSCALL_ENTRY( 0x00fd, NtUserEnumDisplayDevices, 16 ) \ - SYSCALL_ENTRY( 0x00fe, NtUserEnumDisplayMonitors, 16 ) \ - SYSCALL_ENTRY( 0x00ff, NtUserEnumDisplaySettings, 16 ) \ - SYSCALL_ENTRY( 0x0100, NtUserExcludeUpdateRgn, 8 ) \ - SYSCALL_ENTRY( 0x0101, NtUserFindExistingCursorIcon, 12 ) \ - SYSCALL_ENTRY( 0x0102, NtUserFindWindowEx, 20 ) \ - SYSCALL_ENTRY( 0x0103, NtUserFlashWindowEx, 4 ) \ - SYSCALL_ENTRY( 0x0104, NtUserGetAncestor, 8 ) \ - SYSCALL_ENTRY( 0x0105, NtUserGetAsyncKeyState, 4 ) \ - SYSCALL_ENTRY( 0x0106, NtUserGetAtomName, 8 ) \ - SYSCALL_ENTRY( 0x0107, NtUserGetCaretBlinkTime, 0 ) \ - SYSCALL_ENTRY( 0x0108, NtUserGetCaretPos, 4 ) \ - SYSCALL_ENTRY( 0x0109, NtUserGetClassInfoEx, 20 ) \ - SYSCALL_ENTRY( 0x010a, NtUserGetClassName, 12 ) \ - SYSCALL_ENTRY( 0x010b, NtUserGetClipboardData, 8 ) \ - SYSCALL_ENTRY( 0x010c, NtUserGetClipboardFormatName, 12 ) \ - SYSCALL_ENTRY( 0x010d, NtUserGetClipboardOwner, 0 ) \ - SYSCALL_ENTRY( 0x010e, NtUserGetClipboardSequenceNumber, 0 ) \ - SYSCALL_ENTRY( 0x010f, NtUserGetClipboardViewer, 0 ) \ - SYSCALL_ENTRY( 0x0110, NtUserGetCursor, 0 ) \ - SYSCALL_ENTRY( 0x0111, NtUserGetCursorFrameInfo, 16 ) \ - SYSCALL_ENTRY( 0x0112, NtUserGetCursorInfo, 4 ) \ - SYSCALL_ENTRY( 0x0113, NtUserGetDC, 4 ) \ - SYSCALL_ENTRY( 0x0114, NtUserGetDCEx, 12 ) \ - SYSCALL_ENTRY( 0x0115, NtUserGetDisplayConfigBufferSizes, 12 ) \ - SYSCALL_ENTRY( 0x0116, NtUserGetDoubleClickTime, 0 ) \ - SYSCALL_ENTRY( 0x0117, NtUserGetDpiForMonitor, 16 ) \ - SYSCALL_ENTRY( 0x0118, NtUserGetForegroundWindow, 0 ) \ - SYSCALL_ENTRY( 0x0119, NtUserGetGUIThreadInfo, 8 ) \ - SYSCALL_ENTRY( 0x011a, NtUserGetIconInfo, 24 ) \ - SYSCALL_ENTRY( 0x011b, NtUserGetIconSize, 16 ) \ - SYSCALL_ENTRY( 0x011c, NtUserGetInternalWindowPos, 12 ) \ - SYSCALL_ENTRY( 0x011d, NtUserGetKeyNameText, 12 ) \ - SYSCALL_ENTRY( 0x011e, NtUserGetKeyState, 4 ) \ - SYSCALL_ENTRY( 0x011f, NtUserGetKeyboardLayout, 4 ) \ - SYSCALL_ENTRY( 0x0120, NtUserGetKeyboardLayoutList, 8 ) \ - SYSCALL_ENTRY( 0x0121, NtUserGetKeyboardLayoutName, 4 ) \ - SYSCALL_ENTRY( 0x0122, NtUserGetKeyboardState, 4 ) \ - SYSCALL_ENTRY( 0x0123, NtUserGetLayeredWindowAttributes, 16 ) \ - SYSCALL_ENTRY( 0x0124, NtUserGetMenuBarInfo, 16 ) \ - SYSCALL_ENTRY( 0x0125, NtUserGetMenuItemRect, 16 ) \ - SYSCALL_ENTRY( 0x0126, NtUserGetMessage, 16 ) \ - SYSCALL_ENTRY( 0x0127, NtUserGetMouseMovePointsEx, 20 ) \ - SYSCALL_ENTRY( 0x0128, NtUserGetObjectInformation, 20 ) \ - SYSCALL_ENTRY( 0x0129, NtUserGetOpenClipboardWindow, 0 ) \ - SYSCALL_ENTRY( 0x012a, NtUserGetPointerInfoList, 32 ) \ - SYSCALL_ENTRY( 0x012b, NtUserGetPriorityClipboardFormat, 8 ) \ - SYSCALL_ENTRY( 0x012c, NtUserGetProcessDpiAwarenessContext, 4 ) \ - SYSCALL_ENTRY( 0x012d, NtUserGetProcessWindowStation, 0 ) \ - SYSCALL_ENTRY( 0x012e, NtUserGetProp, 8 ) \ - SYSCALL_ENTRY( 0x012f, NtUserGetQueueStatus, 4 ) \ - SYSCALL_ENTRY( 0x0130, NtUserGetRawInputBuffer, 12 ) \ - SYSCALL_ENTRY( 0x0131, NtUserGetRawInputData, 20 ) \ - SYSCALL_ENTRY( 0x0132, NtUserGetRawInputDeviceInfo, 16 ) \ - SYSCALL_ENTRY( 0x0133, NtUserGetRawInputDeviceList, 12 ) \ - SYSCALL_ENTRY( 0x0134, NtUserGetRegisteredRawInputDevices, 12 ) \ - SYSCALL_ENTRY( 0x0135, NtUserGetScrollBarInfo, 12 ) \ - SYSCALL_ENTRY( 0x0136, NtUserGetSystemDpiForProcess, 4 ) \ - SYSCALL_ENTRY( 0x0137, NtUserGetSystemMenu, 8 ) \ - SYSCALL_ENTRY( 0x0138, NtUserGetThreadDesktop, 4 ) \ - SYSCALL_ENTRY( 0x0139, NtUserGetTitleBarInfo, 8 ) \ - SYSCALL_ENTRY( 0x013a, NtUserGetUpdateRect, 12 ) \ - SYSCALL_ENTRY( 0x013b, NtUserGetUpdateRgn, 12 ) \ - SYSCALL_ENTRY( 0x013c, NtUserGetUpdatedClipboardFormats, 12 ) \ - SYSCALL_ENTRY( 0x013d, NtUserGetWindowDC, 4 ) \ - SYSCALL_ENTRY( 0x013e, NtUserGetWindowPlacement, 8 ) \ - SYSCALL_ENTRY( 0x013f, NtUserGetWindowRgnEx, 12 ) \ - SYSCALL_ENTRY( 0x0140, NtUserHideCaret, 4 ) \ - SYSCALL_ENTRY( 0x0141, NtUserHiliteMenuItem, 16 ) \ - SYSCALL_ENTRY( 0x0142, NtUserInitializeClientPfnArrays, 16 ) \ - SYSCALL_ENTRY( 0x0143, NtUserInternalGetWindowIcon, 8 ) \ - SYSCALL_ENTRY( 0x0144, NtUserInternalGetWindowText, 12 ) \ - SYSCALL_ENTRY( 0x0145, NtUserInvalidateRect, 12 ) \ - SYSCALL_ENTRY( 0x0146, NtUserInvalidateRgn, 12 ) \ - SYSCALL_ENTRY( 0x0147, NtUserIsClipboardFormatAvailable, 4 ) \ - SYSCALL_ENTRY( 0x0148, NtUserIsMouseInPointerEnabled, 0 ) \ - SYSCALL_ENTRY( 0x0149, NtUserKillTimer, 8 ) \ - SYSCALL_ENTRY( 0x014a, NtUserLockWindowUpdate, 4 ) \ - SYSCALL_ENTRY( 0x014b, NtUserLogicalToPerMonitorDPIPhysicalPoint, 8 ) \ - SYSCALL_ENTRY( 0x014c, NtUserMapVirtualKeyEx, 12 ) \ - SYSCALL_ENTRY( 0x014d, NtUserMenuItemFromPoint, 16 ) \ - SYSCALL_ENTRY( 0x014e, NtUserMessageCall, 28 ) \ - SYSCALL_ENTRY( 0x014f, NtUserMoveWindow, 24 ) \ - SYSCALL_ENTRY( 0x0150, NtUserMsgWaitForMultipleObjectsEx, 20 ) \ - SYSCALL_ENTRY( 0x0151, NtUserNotifyIMEStatus, 8 ) \ - SYSCALL_ENTRY( 0x0152, NtUserNotifyWinEvent, 16 ) \ - SYSCALL_ENTRY( 0x0153, NtUserOpenClipboard, 8 ) \ - SYSCALL_ENTRY( 0x0154, NtUserOpenDesktop, 12 ) \ - SYSCALL_ENTRY( 0x0155, NtUserOpenInputDesktop, 12 ) \ - SYSCALL_ENTRY( 0x0156, NtUserOpenWindowStation, 8 ) \ - SYSCALL_ENTRY( 0x0157, NtUserPeekMessage, 20 ) \ - SYSCALL_ENTRY( 0x0158, NtUserPerMonitorDPIPhysicalToLogicalPoint, 8 ) \ - SYSCALL_ENTRY( 0x0159, NtUserPostMessage, 16 ) \ - SYSCALL_ENTRY( 0x015a, NtUserPostThreadMessage, 16 ) \ - SYSCALL_ENTRY( 0x015b, NtUserPrintWindow, 12 ) \ - SYSCALL_ENTRY( 0x015c, NtUserQueryDisplayConfig, 24 ) \ - SYSCALL_ENTRY( 0x015d, NtUserQueryInputContext, 8 ) \ - SYSCALL_ENTRY( 0x015e, NtUserQueryWindow, 8 ) \ - SYSCALL_ENTRY( 0x015f, NtUserRealChildWindowFromPoint, 12 ) \ - SYSCALL_ENTRY( 0x0160, NtUserRedrawWindow, 16 ) \ - SYSCALL_ENTRY( 0x0161, NtUserRegisterClassExWOW, 28 ) \ - SYSCALL_ENTRY( 0x0162, NtUserRegisterHotKey, 16 ) \ - SYSCALL_ENTRY( 0x0163, NtUserRegisterRawInputDevices, 12 ) \ - SYSCALL_ENTRY( 0x0164, NtUserRegisterTouchPadCapable, 4 ) \ - SYSCALL_ENTRY( 0x0165, NtUserReleaseDC, 8 ) \ - SYSCALL_ENTRY( 0x0166, NtUserRemoveClipboardFormatListener, 4 ) \ - SYSCALL_ENTRY( 0x0167, NtUserRemoveMenu, 12 ) \ - SYSCALL_ENTRY( 0x0168, NtUserRemoveProp, 8 ) \ - SYSCALL_ENTRY( 0x0169, NtUserScrollDC, 28 ) \ - SYSCALL_ENTRY( 0x016a, NtUserScrollWindowEx, 32 ) \ - SYSCALL_ENTRY( 0x016b, NtUserSelectPalette, 12 ) \ - SYSCALL_ENTRY( 0x016c, NtUserSendInput, 12 ) \ - SYSCALL_ENTRY( 0x016d, NtUserSetActiveWindow, 4 ) \ - SYSCALL_ENTRY( 0x016e, NtUserSetCapture, 4 ) \ - SYSCALL_ENTRY( 0x016f, NtUserSetClassLong, 16 ) \ - SYSCALL_ENTRY( 0x0170, NtUserSetClassLongPtr, 16 ) \ - SYSCALL_ENTRY( 0x0171, NtUserSetClassWord, 12 ) \ - SYSCALL_ENTRY( 0x0172, NtUserSetClipboardData, 12 ) \ - SYSCALL_ENTRY( 0x0173, NtUserSetClipboardViewer, 4 ) \ - SYSCALL_ENTRY( 0x0174, NtUserSetCursor, 4 ) \ - SYSCALL_ENTRY( 0x0175, NtUserSetCursorIconData, 16 ) \ - SYSCALL_ENTRY( 0x0176, NtUserSetCursorPos, 8 ) \ - SYSCALL_ENTRY( 0x0177, NtUserSetFocus, 4 ) \ - SYSCALL_ENTRY( 0x0178, NtUserSetInternalWindowPos, 16 ) \ - SYSCALL_ENTRY( 0x0179, NtUserSetKeyboardState, 4 ) \ - SYSCALL_ENTRY( 0x017a, NtUserSetLayeredWindowAttributes, 16 ) \ - SYSCALL_ENTRY( 0x017b, NtUserSetMenu, 8 ) \ - SYSCALL_ENTRY( 0x017c, NtUserSetMenuContextHelpId, 8 ) \ - SYSCALL_ENTRY( 0x017d, NtUserSetMenuDefaultItem, 12 ) \ - SYSCALL_ENTRY( 0x017e, NtUserSetObjectInformation, 16 ) \ - SYSCALL_ENTRY( 0x017f, NtUserSetParent, 8 ) \ - SYSCALL_ENTRY( 0x0180, NtUserSetProcessDpiAwarenessContext, 8 ) \ - SYSCALL_ENTRY( 0x0181, NtUserSetProcessWindowStation, 4 ) \ - SYSCALL_ENTRY( 0x0182, NtUserSetProp, 12 ) \ - SYSCALL_ENTRY( 0x0183, NtUserSetScrollInfo, 16 ) \ - SYSCALL_ENTRY( 0x0184, NtUserSetShellWindowEx, 8 ) \ - SYSCALL_ENTRY( 0x0185, NtUserSetSysColors, 12 ) \ - SYSCALL_ENTRY( 0x0186, NtUserSetSystemMenu, 8 ) \ - SYSCALL_ENTRY( 0x0187, NtUserSetSystemTimer, 12 ) \ - SYSCALL_ENTRY( 0x0188, NtUserSetThreadDesktop, 4 ) \ - SYSCALL_ENTRY( 0x0189, NtUserSetTimer, 20 ) \ - SYSCALL_ENTRY( 0x018a, NtUserSetWinEventHook, 32 ) \ - SYSCALL_ENTRY( 0x018b, NtUserSetWindowLong, 16 ) \ - SYSCALL_ENTRY( 0x018c, NtUserSetWindowLongPtr, 16 ) \ - SYSCALL_ENTRY( 0x018d, NtUserSetWindowPlacement, 8 ) \ - SYSCALL_ENTRY( 0x018e, NtUserSetWindowPos, 28 ) \ - SYSCALL_ENTRY( 0x018f, NtUserSetWindowRgn, 12 ) \ - SYSCALL_ENTRY( 0x0190, NtUserSetWindowWord, 12 ) \ - SYSCALL_ENTRY( 0x0191, NtUserSetWindowsHookEx, 24 ) \ - SYSCALL_ENTRY( 0x0192, NtUserShowCaret, 4 ) \ - SYSCALL_ENTRY( 0x0193, NtUserShowCursor, 4 ) \ - SYSCALL_ENTRY( 0x0194, NtUserShowScrollBar, 12 ) \ - SYSCALL_ENTRY( 0x0195, NtUserShowWindow, 8 ) \ - SYSCALL_ENTRY( 0x0196, NtUserShowWindowAsync, 8 ) \ - SYSCALL_ENTRY( 0x0197, NtUserSwitchDesktop, 4 ) \ - SYSCALL_ENTRY( 0x0198, NtUserSystemParametersInfo, 16 ) \ - SYSCALL_ENTRY( 0x0199, NtUserSystemParametersInfoForDpi, 20 ) \ - SYSCALL_ENTRY( 0x019a, NtUserThunkedMenuInfo, 8 ) \ - SYSCALL_ENTRY( 0x019b, NtUserThunkedMenuItemInfo, 24 ) \ - SYSCALL_ENTRY( 0x019c, NtUserToUnicodeEx, 28 ) \ - SYSCALL_ENTRY( 0x019d, NtUserTrackMouseEvent, 4 ) \ - SYSCALL_ENTRY( 0x019e, NtUserTrackPopupMenuEx, 24 ) \ - SYSCALL_ENTRY( 0x019f, NtUserTranslateAccelerator, 12 ) \ - SYSCALL_ENTRY( 0x01a0, NtUserTranslateMessage, 8 ) \ - SYSCALL_ENTRY( 0x01a1, NtUserUnhookWinEvent, 4 ) \ - SYSCALL_ENTRY( 0x01a2, NtUserUnhookWindowsHookEx, 4 ) \ - SYSCALL_ENTRY( 0x01a3, NtUserUnregisterClass, 12 ) \ - SYSCALL_ENTRY( 0x01a4, NtUserUnregisterHotKey, 8 ) \ - SYSCALL_ENTRY( 0x01a5, NtUserUpdateInputContext, 12 ) \ - SYSCALL_ENTRY( 0x01a6, NtUserUpdateLayeredWindow, 40 ) \ - SYSCALL_ENTRY( 0x01a7, NtUserValidateRect, 8 ) \ - SYSCALL_ENTRY( 0x01a8, NtUserVkKeyScanEx, 8 ) \ - SYSCALL_ENTRY( 0x01a9, NtUserWaitForInputIdle, 12 ) \ - SYSCALL_ENTRY( 0x01aa, NtUserWaitMessage, 0 ) \ - SYSCALL_ENTRY( 0x01ab, NtUserWindowFromDC, 4 ) \ - SYSCALL_ENTRY( 0x01ac, NtUserWindowFromPoint, 8 ) \ - SYSCALL_ENTRY( 0x01ad, __wine_get_file_outline_text_metric, 16 ) \ - SYSCALL_ENTRY( 0x01ae, __wine_get_icm_profile, 16 ) - -#define ALL_SYSCALLS64 \ - SYSCALL_ENTRY( 0x0000, NtGdiAbortDoc, 8 ) \ - SYSCALL_ENTRY( 0x0001, NtGdiAbortPath, 8 ) \ - SYSCALL_ENTRY( 0x0002, NtGdiAddFontMemResourceEx, 40 ) \ - SYSCALL_ENTRY( 0x0003, NtGdiAddFontResourceW, 48 ) \ - SYSCALL_ENTRY( 0x0004, NtGdiAlphaBlend, 96 ) \ - SYSCALL_ENTRY( 0x0005, NtGdiAngleArc, 48 ) \ - SYSCALL_ENTRY( 0x0006, NtGdiArcInternal, 80 ) \ - SYSCALL_ENTRY( 0x0007, NtGdiBeginPath, 8 ) \ - SYSCALL_ENTRY( 0x0008, NtGdiBitBlt, 88 ) \ - SYSCALL_ENTRY( 0x0009, NtGdiCloseFigure, 8 ) \ - SYSCALL_ENTRY( 0x000a, NtGdiCombineRgn, 32 ) \ - SYSCALL_ENTRY( 0x000b, NtGdiComputeXformCoefficients, 8 ) \ - SYSCALL_ENTRY( 0x000c, NtGdiCreateBitmap, 40 ) \ - SYSCALL_ENTRY( 0x000d, NtGdiCreateClientObj, 8 ) \ - SYSCALL_ENTRY( 0x000e, NtGdiCreateCompatibleBitmap, 24 ) \ - SYSCALL_ENTRY( 0x000f, NtGdiCreateCompatibleDC, 8 ) \ - SYSCALL_ENTRY( 0x0010, NtGdiCreateDIBBrush, 48 ) \ - SYSCALL_ENTRY( 0x0011, NtGdiCreateDIBSection, 72 ) \ - SYSCALL_ENTRY( 0x0012, NtGdiCreateDIBitmapInternal, 88 ) \ - SYSCALL_ENTRY( 0x0013, NtGdiCreateEllipticRgn, 32 ) \ - SYSCALL_ENTRY( 0x0014, NtGdiCreateHalftonePalette, 8 ) \ - SYSCALL_ENTRY( 0x0015, NtGdiCreateHatchBrushInternal, 24 ) \ - SYSCALL_ENTRY( 0x0016, NtGdiCreateMetafileDC, 8 ) \ - SYSCALL_ENTRY( 0x0017, NtGdiCreatePaletteInternal, 16 ) \ - SYSCALL_ENTRY( 0x0018, NtGdiCreatePatternBrushInternal, 24 ) \ - SYSCALL_ENTRY( 0x0019, NtGdiCreatePen, 32 ) \ - SYSCALL_ENTRY( 0x001a, NtGdiCreateRectRgn, 32 ) \ - SYSCALL_ENTRY( 0x001b, NtGdiCreateRoundRectRgn, 48 ) \ - SYSCALL_ENTRY( 0x001c, NtGdiCreateSolidBrush, 16 ) \ - SYSCALL_ENTRY( 0x001d, NtGdiDdDDICheckVidPnExclusiveOwnership, 8 ) \ - SYSCALL_ENTRY( 0x001e, NtGdiDdDDICloseAdapter, 8 ) \ - SYSCALL_ENTRY( 0x001f, NtGdiDdDDICreateAllocation, 8 ) \ - SYSCALL_ENTRY( 0x0020, NtGdiDdDDICreateAllocation2, 8 ) \ - SYSCALL_ENTRY( 0x0021, NtGdiDdDDICreateDCFromMemory, 8 ) \ - SYSCALL_ENTRY( 0x0022, NtGdiDdDDICreateDevice, 8 ) \ - SYSCALL_ENTRY( 0x0023, NtGdiDdDDICreateKeyedMutex, 8 ) \ - SYSCALL_ENTRY( 0x0024, NtGdiDdDDICreateKeyedMutex2, 8 ) \ - SYSCALL_ENTRY( 0x0025, NtGdiDdDDICreateSynchronizationObject, 8 ) \ - SYSCALL_ENTRY( 0x0026, NtGdiDdDDICreateSynchronizationObject2, 8 ) \ - SYSCALL_ENTRY( 0x0027, NtGdiDdDDIDestroyAllocation, 8 ) \ - SYSCALL_ENTRY( 0x0028, NtGdiDdDDIDestroyAllocation2, 8 ) \ - SYSCALL_ENTRY( 0x0029, NtGdiDdDDIDestroyDCFromMemory, 8 ) \ - SYSCALL_ENTRY( 0x002a, NtGdiDdDDIDestroyDevice, 8 ) \ - SYSCALL_ENTRY( 0x002b, NtGdiDdDDIDestroyKeyedMutex, 8 ) \ - SYSCALL_ENTRY( 0x002c, NtGdiDdDDIDestroySynchronizationObject, 8 ) \ - SYSCALL_ENTRY( 0x002d, NtGdiDdDDIEnumAdapters, 8 ) \ - SYSCALL_ENTRY( 0x002e, NtGdiDdDDIEnumAdapters2, 8 ) \ - SYSCALL_ENTRY( 0x002f, NtGdiDdDDIEscape, 8 ) \ - SYSCALL_ENTRY( 0x0030, NtGdiDdDDIOpenAdapterFromDeviceName, 8 ) \ - SYSCALL_ENTRY( 0x0031, NtGdiDdDDIOpenAdapterFromHdc, 8 ) \ - SYSCALL_ENTRY( 0x0032, NtGdiDdDDIOpenAdapterFromLuid, 8 ) \ - SYSCALL_ENTRY( 0x0033, NtGdiDdDDIOpenKeyedMutex, 8 ) \ - SYSCALL_ENTRY( 0x0034, NtGdiDdDDIOpenKeyedMutex2, 8 ) \ - SYSCALL_ENTRY( 0x0035, NtGdiDdDDIOpenKeyedMutexFromNtHandle, 8 ) \ - SYSCALL_ENTRY( 0x0036, NtGdiDdDDIOpenResource, 8 ) \ - SYSCALL_ENTRY( 0x0037, NtGdiDdDDIOpenResource2, 8 ) \ - SYSCALL_ENTRY( 0x0038, NtGdiDdDDIOpenResourceFromNtHandle, 8 ) \ - SYSCALL_ENTRY( 0x0039, NtGdiDdDDIOpenSyncObjectFromNtHandle, 8 ) \ - SYSCALL_ENTRY( 0x003a, NtGdiDdDDIOpenSyncObjectFromNtHandle2, 8 ) \ - SYSCALL_ENTRY( 0x003b, NtGdiDdDDIOpenSyncObjectNtHandleFromName, 8 ) \ - SYSCALL_ENTRY( 0x003c, NtGdiDdDDIOpenSynchronizationObject, 8 ) \ - SYSCALL_ENTRY( 0x003d, NtGdiDdDDIQueryAdapterInfo, 8 ) \ - SYSCALL_ENTRY( 0x003e, NtGdiDdDDIQueryResourceInfo, 8 ) \ - SYSCALL_ENTRY( 0x003f, NtGdiDdDDIQueryResourceInfoFromNtHandle, 8 ) \ - SYSCALL_ENTRY( 0x0040, NtGdiDdDDIQueryStatistics, 8 ) \ - SYSCALL_ENTRY( 0x0041, NtGdiDdDDIQueryVideoMemoryInfo, 8 ) \ - SYSCALL_ENTRY( 0x0042, NtGdiDdDDISetQueuedLimit, 8 ) \ - SYSCALL_ENTRY( 0x0043, NtGdiDdDDISetVidPnSourceOwner, 8 ) \ - SYSCALL_ENTRY( 0x0044, NtGdiDdDDIShareObjects, 40 ) \ - SYSCALL_ENTRY( 0x0045, NtGdiDeleteClientObj, 8 ) \ - SYSCALL_ENTRY( 0x0046, NtGdiDeleteObjectApp, 8 ) \ - SYSCALL_ENTRY( 0x0047, NtGdiDescribePixelFormat, 32 ) \ - SYSCALL_ENTRY( 0x0048, NtGdiDoPalette, 48 ) \ - SYSCALL_ENTRY( 0x0049, NtGdiDrawStream, 24 ) \ - SYSCALL_ENTRY( 0x004a, NtGdiEllipse, 40 ) \ - SYSCALL_ENTRY( 0x004b, NtGdiEndDoc, 8 ) \ - SYSCALL_ENTRY( 0x004c, NtGdiEndPage, 8 ) \ - SYSCALL_ENTRY( 0x004d, NtGdiEndPath, 8 ) \ - SYSCALL_ENTRY( 0x004e, NtGdiEnumFonts, 64 ) \ - SYSCALL_ENTRY( 0x004f, NtGdiEqualRgn, 16 ) \ - SYSCALL_ENTRY( 0x0050, NtGdiExcludeClipRect, 40 ) \ - SYSCALL_ENTRY( 0x0051, NtGdiExtCreatePen, 88 ) \ - SYSCALL_ENTRY( 0x0052, NtGdiExtCreateRegion, 24 ) \ - SYSCALL_ENTRY( 0x0053, NtGdiExtEscape, 64 ) \ - SYSCALL_ENTRY( 0x0054, NtGdiExtFloodFill, 40 ) \ - SYSCALL_ENTRY( 0x0055, NtGdiExtGetObjectW, 24 ) \ - SYSCALL_ENTRY( 0x0056, NtGdiExtSelectClipRgn, 24 ) \ - SYSCALL_ENTRY( 0x0057, NtGdiExtTextOutW, 72 ) \ - SYSCALL_ENTRY( 0x0058, NtGdiFillPath, 8 ) \ - SYSCALL_ENTRY( 0x0059, NtGdiFillRgn, 24 ) \ - SYSCALL_ENTRY( 0x005a, NtGdiFlattenPath, 8 ) \ - SYSCALL_ENTRY( 0x005b, NtGdiFlush, 0 ) \ - SYSCALL_ENTRY( 0x005c, NtGdiFontIsLinked, 8 ) \ - SYSCALL_ENTRY( 0x005d, NtGdiFrameRgn, 40 ) \ - SYSCALL_ENTRY( 0x005e, NtGdiGetAndSetDCDword, 32 ) \ - SYSCALL_ENTRY( 0x005f, NtGdiGetAppClipBox, 16 ) \ - SYSCALL_ENTRY( 0x0060, NtGdiGetBitmapBits, 24 ) \ - SYSCALL_ENTRY( 0x0061, NtGdiGetBitmapDimension, 16 ) \ - SYSCALL_ENTRY( 0x0062, NtGdiGetBoundsRect, 24 ) \ - SYSCALL_ENTRY( 0x0063, NtGdiGetCharABCWidthsW, 48 ) \ - SYSCALL_ENTRY( 0x0064, NtGdiGetCharWidthInfo, 16 ) \ - SYSCALL_ENTRY( 0x0065, NtGdiGetCharWidthW, 48 ) \ - SYSCALL_ENTRY( 0x0066, NtGdiGetColorAdjustment, 16 ) \ - SYSCALL_ENTRY( 0x0067, NtGdiGetDCDword, 24 ) \ - SYSCALL_ENTRY( 0x0068, NtGdiGetDCObject, 16 ) \ - SYSCALL_ENTRY( 0x0069, NtGdiGetDCPoint, 24 ) \ - SYSCALL_ENTRY( 0x006a, NtGdiGetDIBitsInternal, 72 ) \ - SYSCALL_ENTRY( 0x006b, NtGdiGetDeviceCaps, 16 ) \ - SYSCALL_ENTRY( 0x006c, NtGdiGetDeviceGammaRamp, 16 ) \ - SYSCALL_ENTRY( 0x006d, NtGdiGetFontData, 40 ) \ - SYSCALL_ENTRY( 0x006e, NtGdiGetFontFileData, 40 ) \ - SYSCALL_ENTRY( 0x006f, NtGdiGetFontFileInfo, 40 ) \ - SYSCALL_ENTRY( 0x0070, NtGdiGetFontUnicodeRanges, 16 ) \ - SYSCALL_ENTRY( 0x0071, NtGdiGetGlyphIndicesW, 40 ) \ - SYSCALL_ENTRY( 0x0072, NtGdiGetGlyphOutline, 64 ) \ - SYSCALL_ENTRY( 0x0073, NtGdiGetKerningPairs, 24 ) \ - SYSCALL_ENTRY( 0x0074, NtGdiGetNearestColor, 16 ) \ - SYSCALL_ENTRY( 0x0075, NtGdiGetNearestPaletteIndex, 16 ) \ - SYSCALL_ENTRY( 0x0076, NtGdiGetOutlineTextMetricsInternalW, 32 ) \ - SYSCALL_ENTRY( 0x0077, NtGdiGetPath, 32 ) \ - SYSCALL_ENTRY( 0x0078, NtGdiGetPixel, 24 ) \ - SYSCALL_ENTRY( 0x0079, NtGdiGetRandomRgn, 24 ) \ - SYSCALL_ENTRY( 0x007a, NtGdiGetRasterizerCaps, 16 ) \ - SYSCALL_ENTRY( 0x007b, NtGdiGetRealizationInfo, 16 ) \ - SYSCALL_ENTRY( 0x007c, NtGdiGetRegionData, 24 ) \ - SYSCALL_ENTRY( 0x007d, NtGdiGetRgnBox, 16 ) \ - SYSCALL_ENTRY( 0x007e, NtGdiGetSpoolMessage, 32 ) \ - SYSCALL_ENTRY( 0x007f, NtGdiGetSystemPaletteUse, 8 ) \ - SYSCALL_ENTRY( 0x0080, NtGdiGetTextCharsetInfo, 24 ) \ - SYSCALL_ENTRY( 0x0081, NtGdiGetTextExtentExW, 64 ) \ - SYSCALL_ENTRY( 0x0082, NtGdiGetTextFaceW, 32 ) \ - SYSCALL_ENTRY( 0x0083, NtGdiGetTextMetricsW, 24 ) \ - SYSCALL_ENTRY( 0x0084, NtGdiGetTransform, 24 ) \ - SYSCALL_ENTRY( 0x0085, NtGdiGradientFill, 48 ) \ - SYSCALL_ENTRY( 0x0086, NtGdiHfontCreate, 40 ) \ - SYSCALL_ENTRY( 0x0087, NtGdiIcmBrushInfo, 64 ) \ - SYSCALL_ENTRY( 0x0088, NtGdiInitSpool, 0 ) \ - SYSCALL_ENTRY( 0x0089, NtGdiIntersectClipRect, 40 ) \ - SYSCALL_ENTRY( 0x008a, NtGdiInvertRgn, 16 ) \ - SYSCALL_ENTRY( 0x008b, NtGdiLineTo, 24 ) \ - SYSCALL_ENTRY( 0x008c, NtGdiMaskBlt, 104 ) \ - SYSCALL_ENTRY( 0x008d, NtGdiModifyWorldTransform, 24 ) \ - SYSCALL_ENTRY( 0x008e, NtGdiMoveTo, 32 ) \ - SYSCALL_ENTRY( 0x008f, NtGdiOffsetClipRgn, 24 ) \ - SYSCALL_ENTRY( 0x0090, NtGdiOffsetRgn, 24 ) \ - SYSCALL_ENTRY( 0x0091, NtGdiOpenDCW, 64 ) \ - SYSCALL_ENTRY( 0x0092, NtGdiPatBlt, 48 ) \ - SYSCALL_ENTRY( 0x0093, NtGdiPathToRegion, 8 ) \ - SYSCALL_ENTRY( 0x0094, NtGdiPlgBlt, 88 ) \ - SYSCALL_ENTRY( 0x0095, NtGdiPolyDraw, 32 ) \ - SYSCALL_ENTRY( 0x0096, NtGdiPolyPolyDraw, 40 ) \ - SYSCALL_ENTRY( 0x0097, NtGdiPtInRegion, 24 ) \ - SYSCALL_ENTRY( 0x0098, NtGdiPtVisible, 24 ) \ - SYSCALL_ENTRY( 0x0099, NtGdiRectInRegion, 16 ) \ - SYSCALL_ENTRY( 0x009a, NtGdiRectVisible, 16 ) \ - SYSCALL_ENTRY( 0x009b, NtGdiRectangle, 40 ) \ - SYSCALL_ENTRY( 0x009c, NtGdiRemoveFontMemResourceEx, 8 ) \ - SYSCALL_ENTRY( 0x009d, NtGdiRemoveFontResourceW, 48 ) \ - SYSCALL_ENTRY( 0x009e, NtGdiResetDC, 40 ) \ - SYSCALL_ENTRY( 0x009f, NtGdiResizePalette, 16 ) \ - SYSCALL_ENTRY( 0x00a0, NtGdiRestoreDC, 16 ) \ - SYSCALL_ENTRY( 0x00a1, NtGdiRoundRect, 56 ) \ - SYSCALL_ENTRY( 0x00a2, NtGdiSaveDC, 8 ) \ - SYSCALL_ENTRY( 0x00a3, NtGdiScaleViewportExtEx, 48 ) \ - SYSCALL_ENTRY( 0x00a4, NtGdiScaleWindowExtEx, 48 ) \ - SYSCALL_ENTRY( 0x00a5, NtGdiSelectBitmap, 16 ) \ - SYSCALL_ENTRY( 0x00a6, NtGdiSelectBrush, 16 ) \ - SYSCALL_ENTRY( 0x00a7, NtGdiSelectClipPath, 16 ) \ - SYSCALL_ENTRY( 0x00a8, NtGdiSelectFont, 16 ) \ - SYSCALL_ENTRY( 0x00a9, NtGdiSelectPen, 16 ) \ - SYSCALL_ENTRY( 0x00aa, NtGdiSetBitmapBits, 24 ) \ - SYSCALL_ENTRY( 0x00ab, NtGdiSetBitmapDimension, 32 ) \ - SYSCALL_ENTRY( 0x00ac, NtGdiSetBoundsRect, 24 ) \ - SYSCALL_ENTRY( 0x00ad, NtGdiSetBrushOrg, 32 ) \ - SYSCALL_ENTRY( 0x00ae, NtGdiSetColorAdjustment, 16 ) \ - SYSCALL_ENTRY( 0x00af, NtGdiSetDIBitsToDeviceInternal, 128 ) \ - SYSCALL_ENTRY( 0x00b0, NtGdiSetDeviceGammaRamp, 16 ) \ - SYSCALL_ENTRY( 0x00b1, NtGdiSetLayout, 24 ) \ - SYSCALL_ENTRY( 0x00b2, NtGdiSetMagicColors, 24 ) \ - SYSCALL_ENTRY( 0x00b3, NtGdiSetMetaRgn, 8 ) \ - SYSCALL_ENTRY( 0x00b4, NtGdiSetPixel, 32 ) \ - SYSCALL_ENTRY( 0x00b5, NtGdiSetPixelFormat, 16 ) \ - SYSCALL_ENTRY( 0x00b6, NtGdiSetRectRgn, 40 ) \ - SYSCALL_ENTRY( 0x00b7, NtGdiSetSystemPaletteUse, 16 ) \ - SYSCALL_ENTRY( 0x00b8, NtGdiSetTextJustification, 24 ) \ - SYSCALL_ENTRY( 0x00b9, NtGdiSetVirtualResolution, 40 ) \ - SYSCALL_ENTRY( 0x00ba, NtGdiStartDoc, 32 ) \ - SYSCALL_ENTRY( 0x00bb, NtGdiStartPage, 8 ) \ - SYSCALL_ENTRY( 0x00bc, NtGdiStretchBlt, 96 ) \ - SYSCALL_ENTRY( 0x00bd, NtGdiStretchDIBitsInternal, 128 ) \ - SYSCALL_ENTRY( 0x00be, NtGdiStrokeAndFillPath, 8 ) \ - SYSCALL_ENTRY( 0x00bf, NtGdiStrokePath, 8 ) \ - SYSCALL_ENTRY( 0x00c0, NtGdiSwapBuffers, 8 ) \ - SYSCALL_ENTRY( 0x00c1, NtGdiTransformPoints, 40 ) \ - SYSCALL_ENTRY( 0x00c2, NtGdiTransparentBlt, 88 ) \ - SYSCALL_ENTRY( 0x00c3, NtGdiUnrealizeObject, 8 ) \ - SYSCALL_ENTRY( 0x00c4, NtGdiUpdateColors, 8 ) \ - SYSCALL_ENTRY( 0x00c5, NtGdiWidenPath, 8 ) \ - SYSCALL_ENTRY( 0x00c6, NtUserActivateKeyboardLayout, 16 ) \ - SYSCALL_ENTRY( 0x00c7, NtUserAddClipboardFormatListener, 8 ) \ - SYSCALL_ENTRY( 0x00c8, NtUserAssociateInputContext, 24 ) \ - SYSCALL_ENTRY( 0x00c9, NtUserAttachThreadInput, 24 ) \ - SYSCALL_ENTRY( 0x00ca, NtUserBeginPaint, 16 ) \ - SYSCALL_ENTRY( 0x00cb, NtUserBuildHimcList, 32 ) \ - SYSCALL_ENTRY( 0x00cc, NtUserBuildHwndList, 64 ) \ - SYSCALL_ENTRY( 0x00cd, NtUserBuildNameList, 32 ) \ - SYSCALL_ENTRY( 0x00ce, NtUserBuildPropList, 32 ) \ - SYSCALL_ENTRY( 0x00cf, NtUserCallHwnd, 16 ) \ - SYSCALL_ENTRY( 0x00d0, NtUserCallHwndParam, 24 ) \ - SYSCALL_ENTRY( 0x00d1, NtUserCallMsgFilter, 16 ) \ - SYSCALL_ENTRY( 0x00d2, NtUserCallNextHookEx, 32 ) \ - SYSCALL_ENTRY( 0x00d3, NtUserCallNoParam, 8 ) \ - SYSCALL_ENTRY( 0x00d4, NtUserCallOneParam, 16 ) \ - SYSCALL_ENTRY( 0x00d5, NtUserCallTwoParam, 24 ) \ - SYSCALL_ENTRY( 0x00d6, NtUserChangeClipboardChain, 16 ) \ - SYSCALL_ENTRY( 0x00d7, NtUserChangeDisplaySettings, 40 ) \ - SYSCALL_ENTRY( 0x00d8, NtUserCheckMenuItem, 24 ) \ - SYSCALL_ENTRY( 0x00d9, NtUserChildWindowFromPointEx, 32 ) \ - SYSCALL_ENTRY( 0x00da, NtUserClipCursor, 8 ) \ - SYSCALL_ENTRY( 0x00db, NtUserCloseClipboard, 0 ) \ - SYSCALL_ENTRY( 0x00dc, NtUserCloseDesktop, 8 ) \ - SYSCALL_ENTRY( 0x00dd, NtUserCloseWindowStation, 8 ) \ - SYSCALL_ENTRY( 0x00de, NtUserCopyAcceleratorTable, 24 ) \ - SYSCALL_ENTRY( 0x00df, NtUserCountClipboardFormats, 0 ) \ - SYSCALL_ENTRY( 0x00e0, NtUserCreateAcceleratorTable, 16 ) \ - SYSCALL_ENTRY( 0x00e1, NtUserCreateCaret, 32 ) \ - SYSCALL_ENTRY( 0x00e2, NtUserCreateDesktopEx, 48 ) \ - SYSCALL_ENTRY( 0x00e3, NtUserCreateInputContext, 8 ) \ - SYSCALL_ENTRY( 0x00e4, NtUserCreateWindowEx, 136 ) \ - SYSCALL_ENTRY( 0x00e5, NtUserCreateWindowStation, 56 ) \ - SYSCALL_ENTRY( 0x00e6, NtUserDeferWindowPosAndBand, 80 ) \ - SYSCALL_ENTRY( 0x00e7, NtUserDeleteMenu, 24 ) \ - SYSCALL_ENTRY( 0x00e8, NtUserDestroyAcceleratorTable, 8 ) \ - SYSCALL_ENTRY( 0x00e9, NtUserDestroyCursor, 16 ) \ - SYSCALL_ENTRY( 0x00ea, NtUserDestroyInputContext, 8 ) \ - SYSCALL_ENTRY( 0x00eb, NtUserDestroyMenu, 8 ) \ - SYSCALL_ENTRY( 0x00ec, NtUserDestroyWindow, 8 ) \ - SYSCALL_ENTRY( 0x00ed, NtUserDisableThreadIme, 8 ) \ - SYSCALL_ENTRY( 0x00ee, NtUserDispatchMessage, 8 ) \ - SYSCALL_ENTRY( 0x00ef, NtUserDisplayConfigGetDeviceInfo, 8 ) \ - SYSCALL_ENTRY( 0x00f0, NtUserDragDetect, 24 ) \ - SYSCALL_ENTRY( 0x00f1, NtUserDragObject, 40 ) \ - SYSCALL_ENTRY( 0x00f2, NtUserDrawCaptionTemp, 56 ) \ - SYSCALL_ENTRY( 0x00f3, NtUserDrawIconEx, 72 ) \ - SYSCALL_ENTRY( 0x00f4, NtUserDrawMenuBarTemp, 40 ) \ - SYSCALL_ENTRY( 0x00f5, NtUserEmptyClipboard, 0 ) \ - SYSCALL_ENTRY( 0x00f6, NtUserEnableMenuItem, 24 ) \ - SYSCALL_ENTRY( 0x00f7, NtUserEnableMouseInPointer, 8 ) \ - SYSCALL_ENTRY( 0x00f8, NtUserEnableMouseInPointerForThread, 0 ) \ - SYSCALL_ENTRY( 0x00f9, NtUserEnableScrollBar, 24 ) \ - SYSCALL_ENTRY( 0x00fa, NtUserEndDeferWindowPosEx, 16 ) \ - SYSCALL_ENTRY( 0x00fb, NtUserEndMenu, 0 ) \ - SYSCALL_ENTRY( 0x00fc, NtUserEndPaint, 16 ) \ - SYSCALL_ENTRY( 0x00fd, NtUserEnumDisplayDevices, 32 ) \ - SYSCALL_ENTRY( 0x00fe, NtUserEnumDisplayMonitors, 32 ) \ - SYSCALL_ENTRY( 0x00ff, NtUserEnumDisplaySettings, 32 ) \ - SYSCALL_ENTRY( 0x0100, NtUserExcludeUpdateRgn, 16 ) \ - SYSCALL_ENTRY( 0x0101, NtUserFindExistingCursorIcon, 24 ) \ - SYSCALL_ENTRY( 0x0102, NtUserFindWindowEx, 40 ) \ - SYSCALL_ENTRY( 0x0103, NtUserFlashWindowEx, 8 ) \ - SYSCALL_ENTRY( 0x0104, NtUserGetAncestor, 16 ) \ - SYSCALL_ENTRY( 0x0105, NtUserGetAsyncKeyState, 8 ) \ - SYSCALL_ENTRY( 0x0106, NtUserGetAtomName, 16 ) \ - SYSCALL_ENTRY( 0x0107, NtUserGetCaretBlinkTime, 0 ) \ - SYSCALL_ENTRY( 0x0108, NtUserGetCaretPos, 8 ) \ - SYSCALL_ENTRY( 0x0109, NtUserGetClassInfoEx, 40 ) \ - SYSCALL_ENTRY( 0x010a, NtUserGetClassName, 24 ) \ - SYSCALL_ENTRY( 0x010b, NtUserGetClipboardData, 16 ) \ - SYSCALL_ENTRY( 0x010c, NtUserGetClipboardFormatName, 24 ) \ - SYSCALL_ENTRY( 0x010d, NtUserGetClipboardOwner, 0 ) \ - SYSCALL_ENTRY( 0x010e, NtUserGetClipboardSequenceNumber, 0 ) \ - SYSCALL_ENTRY( 0x010f, NtUserGetClipboardViewer, 0 ) \ - SYSCALL_ENTRY( 0x0110, NtUserGetCursor, 0 ) \ - SYSCALL_ENTRY( 0x0111, NtUserGetCursorFrameInfo, 32 ) \ - SYSCALL_ENTRY( 0x0112, NtUserGetCursorInfo, 8 ) \ - SYSCALL_ENTRY( 0x0113, NtUserGetDC, 8 ) \ - SYSCALL_ENTRY( 0x0114, NtUserGetDCEx, 24 ) \ - SYSCALL_ENTRY( 0x0115, NtUserGetDisplayConfigBufferSizes, 24 ) \ - SYSCALL_ENTRY( 0x0116, NtUserGetDoubleClickTime, 0 ) \ - SYSCALL_ENTRY( 0x0117, NtUserGetDpiForMonitor, 32 ) \ - SYSCALL_ENTRY( 0x0118, NtUserGetForegroundWindow, 0 ) \ - SYSCALL_ENTRY( 0x0119, NtUserGetGUIThreadInfo, 16 ) \ - SYSCALL_ENTRY( 0x011a, NtUserGetIconInfo, 48 ) \ - SYSCALL_ENTRY( 0x011b, NtUserGetIconSize, 32 ) \ - SYSCALL_ENTRY( 0x011c, NtUserGetInternalWindowPos, 24 ) \ - SYSCALL_ENTRY( 0x011d, NtUserGetKeyNameText, 24 ) \ - SYSCALL_ENTRY( 0x011e, NtUserGetKeyState, 8 ) \ - SYSCALL_ENTRY( 0x011f, NtUserGetKeyboardLayout, 8 ) \ - SYSCALL_ENTRY( 0x0120, NtUserGetKeyboardLayoutList, 16 ) \ - SYSCALL_ENTRY( 0x0121, NtUserGetKeyboardLayoutName, 8 ) \ - SYSCALL_ENTRY( 0x0122, NtUserGetKeyboardState, 8 ) \ - SYSCALL_ENTRY( 0x0123, NtUserGetLayeredWindowAttributes, 32 ) \ - SYSCALL_ENTRY( 0x0124, NtUserGetMenuBarInfo, 32 ) \ - SYSCALL_ENTRY( 0x0125, NtUserGetMenuItemRect, 32 ) \ - SYSCALL_ENTRY( 0x0126, NtUserGetMessage, 32 ) \ - SYSCALL_ENTRY( 0x0127, NtUserGetMouseMovePointsEx, 40 ) \ - SYSCALL_ENTRY( 0x0128, NtUserGetObjectInformation, 40 ) \ - SYSCALL_ENTRY( 0x0129, NtUserGetOpenClipboardWindow, 0 ) \ - SYSCALL_ENTRY( 0x012a, NtUserGetPointerInfoList, 64 ) \ - SYSCALL_ENTRY( 0x012b, NtUserGetPriorityClipboardFormat, 16 ) \ - SYSCALL_ENTRY( 0x012c, NtUserGetProcessDpiAwarenessContext, 8 ) \ - SYSCALL_ENTRY( 0x012d, NtUserGetProcessWindowStation, 0 ) \ - SYSCALL_ENTRY( 0x012e, NtUserGetProp, 16 ) \ - SYSCALL_ENTRY( 0x012f, NtUserGetQueueStatus, 8 ) \ - SYSCALL_ENTRY( 0x0130, NtUserGetRawInputBuffer, 24 ) \ - SYSCALL_ENTRY( 0x0131, NtUserGetRawInputData, 40 ) \ - SYSCALL_ENTRY( 0x0132, NtUserGetRawInputDeviceInfo, 32 ) \ - SYSCALL_ENTRY( 0x0133, NtUserGetRawInputDeviceList, 24 ) \ - SYSCALL_ENTRY( 0x0134, NtUserGetRegisteredRawInputDevices, 24 ) \ - SYSCALL_ENTRY( 0x0135, NtUserGetScrollBarInfo, 24 ) \ - SYSCALL_ENTRY( 0x0136, NtUserGetSystemDpiForProcess, 8 ) \ - SYSCALL_ENTRY( 0x0137, NtUserGetSystemMenu, 16 ) \ - SYSCALL_ENTRY( 0x0138, NtUserGetThreadDesktop, 8 ) \ - SYSCALL_ENTRY( 0x0139, NtUserGetTitleBarInfo, 16 ) \ - SYSCALL_ENTRY( 0x013a, NtUserGetUpdateRect, 24 ) \ - SYSCALL_ENTRY( 0x013b, NtUserGetUpdateRgn, 24 ) \ - SYSCALL_ENTRY( 0x013c, NtUserGetUpdatedClipboardFormats, 24 ) \ - SYSCALL_ENTRY( 0x013d, NtUserGetWindowDC, 8 ) \ - SYSCALL_ENTRY( 0x013e, NtUserGetWindowPlacement, 16 ) \ - SYSCALL_ENTRY( 0x013f, NtUserGetWindowRgnEx, 24 ) \ - SYSCALL_ENTRY( 0x0140, NtUserHideCaret, 8 ) \ - SYSCALL_ENTRY( 0x0141, NtUserHiliteMenuItem, 32 ) \ - SYSCALL_ENTRY( 0x0142, NtUserInitializeClientPfnArrays, 32 ) \ - SYSCALL_ENTRY( 0x0143, NtUserInternalGetWindowIcon, 16 ) \ - SYSCALL_ENTRY( 0x0144, NtUserInternalGetWindowText, 24 ) \ - SYSCALL_ENTRY( 0x0145, NtUserInvalidateRect, 24 ) \ - SYSCALL_ENTRY( 0x0146, NtUserInvalidateRgn, 24 ) \ - SYSCALL_ENTRY( 0x0147, NtUserIsClipboardFormatAvailable, 8 ) \ - SYSCALL_ENTRY( 0x0148, NtUserIsMouseInPointerEnabled, 0 ) \ - SYSCALL_ENTRY( 0x0149, NtUserKillTimer, 16 ) \ - SYSCALL_ENTRY( 0x014a, NtUserLockWindowUpdate, 8 ) \ - SYSCALL_ENTRY( 0x014b, NtUserLogicalToPerMonitorDPIPhysicalPoint, 16 ) \ - SYSCALL_ENTRY( 0x014c, NtUserMapVirtualKeyEx, 24 ) \ - SYSCALL_ENTRY( 0x014d, NtUserMenuItemFromPoint, 32 ) \ - SYSCALL_ENTRY( 0x014e, NtUserMessageCall, 56 ) \ - SYSCALL_ENTRY( 0x014f, NtUserMoveWindow, 48 ) \ - SYSCALL_ENTRY( 0x0150, NtUserMsgWaitForMultipleObjectsEx, 40 ) \ - SYSCALL_ENTRY( 0x0151, NtUserNotifyIMEStatus, 16 ) \ - SYSCALL_ENTRY( 0x0152, NtUserNotifyWinEvent, 32 ) \ - SYSCALL_ENTRY( 0x0153, NtUserOpenClipboard, 16 ) \ - SYSCALL_ENTRY( 0x0154, NtUserOpenDesktop, 24 ) \ - SYSCALL_ENTRY( 0x0155, NtUserOpenInputDesktop, 24 ) \ - SYSCALL_ENTRY( 0x0156, NtUserOpenWindowStation, 16 ) \ - SYSCALL_ENTRY( 0x0157, NtUserPeekMessage, 40 ) \ - SYSCALL_ENTRY( 0x0158, NtUserPerMonitorDPIPhysicalToLogicalPoint, 16 ) \ - SYSCALL_ENTRY( 0x0159, NtUserPostMessage, 32 ) \ - SYSCALL_ENTRY( 0x015a, NtUserPostThreadMessage, 32 ) \ - SYSCALL_ENTRY( 0x015b, NtUserPrintWindow, 24 ) \ - SYSCALL_ENTRY( 0x015c, NtUserQueryDisplayConfig, 48 ) \ - SYSCALL_ENTRY( 0x015d, NtUserQueryInputContext, 16 ) \ - SYSCALL_ENTRY( 0x015e, NtUserQueryWindow, 16 ) \ - SYSCALL_ENTRY( 0x015f, NtUserRealChildWindowFromPoint, 24 ) \ - SYSCALL_ENTRY( 0x0160, NtUserRedrawWindow, 32 ) \ - SYSCALL_ENTRY( 0x0161, NtUserRegisterClassExWOW, 56 ) \ - SYSCALL_ENTRY( 0x0162, NtUserRegisterHotKey, 32 ) \ - SYSCALL_ENTRY( 0x0163, NtUserRegisterRawInputDevices, 24 ) \ - SYSCALL_ENTRY( 0x0164, NtUserRegisterTouchPadCapable, 8 ) \ - SYSCALL_ENTRY( 0x0165, NtUserReleaseDC, 16 ) \ - SYSCALL_ENTRY( 0x0166, NtUserRemoveClipboardFormatListener, 8 ) \ - SYSCALL_ENTRY( 0x0167, NtUserRemoveMenu, 24 ) \ - SYSCALL_ENTRY( 0x0168, NtUserRemoveProp, 16 ) \ - SYSCALL_ENTRY( 0x0169, NtUserScrollDC, 56 ) \ - SYSCALL_ENTRY( 0x016a, NtUserScrollWindowEx, 64 ) \ - SYSCALL_ENTRY( 0x016b, NtUserSelectPalette, 24 ) \ - SYSCALL_ENTRY( 0x016c, NtUserSendInput, 24 ) \ - SYSCALL_ENTRY( 0x016d, NtUserSetActiveWindow, 8 ) \ - SYSCALL_ENTRY( 0x016e, NtUserSetCapture, 8 ) \ - SYSCALL_ENTRY( 0x016f, NtUserSetClassLong, 32 ) \ - SYSCALL_ENTRY( 0x0170, NtUserSetClassLongPtr, 32 ) \ - SYSCALL_ENTRY( 0x0171, NtUserSetClassWord, 24 ) \ - SYSCALL_ENTRY( 0x0172, NtUserSetClipboardData, 24 ) \ - SYSCALL_ENTRY( 0x0173, NtUserSetClipboardViewer, 8 ) \ - SYSCALL_ENTRY( 0x0174, NtUserSetCursor, 8 ) \ - SYSCALL_ENTRY( 0x0175, NtUserSetCursorIconData, 32 ) \ - SYSCALL_ENTRY( 0x0176, NtUserSetCursorPos, 16 ) \ - SYSCALL_ENTRY( 0x0177, NtUserSetFocus, 8 ) \ - SYSCALL_ENTRY( 0x0178, NtUserSetInternalWindowPos, 32 ) \ - SYSCALL_ENTRY( 0x0179, NtUserSetKeyboardState, 8 ) \ - SYSCALL_ENTRY( 0x017a, NtUserSetLayeredWindowAttributes, 32 ) \ - SYSCALL_ENTRY( 0x017b, NtUserSetMenu, 16 ) \ - SYSCALL_ENTRY( 0x017c, NtUserSetMenuContextHelpId, 16 ) \ - SYSCALL_ENTRY( 0x017d, NtUserSetMenuDefaultItem, 24 ) \ - SYSCALL_ENTRY( 0x017e, NtUserSetObjectInformation, 32 ) \ - SYSCALL_ENTRY( 0x017f, NtUserSetParent, 16 ) \ - SYSCALL_ENTRY( 0x0180, NtUserSetProcessDpiAwarenessContext, 16 ) \ - SYSCALL_ENTRY( 0x0181, NtUserSetProcessWindowStation, 8 ) \ - SYSCALL_ENTRY( 0x0182, NtUserSetProp, 24 ) \ - SYSCALL_ENTRY( 0x0183, NtUserSetScrollInfo, 32 ) \ - SYSCALL_ENTRY( 0x0184, NtUserSetShellWindowEx, 16 ) \ - SYSCALL_ENTRY( 0x0185, NtUserSetSysColors, 24 ) \ - SYSCALL_ENTRY( 0x0186, NtUserSetSystemMenu, 16 ) \ - SYSCALL_ENTRY( 0x0187, NtUserSetSystemTimer, 24 ) \ - SYSCALL_ENTRY( 0x0188, NtUserSetThreadDesktop, 8 ) \ - SYSCALL_ENTRY( 0x0189, NtUserSetTimer, 40 ) \ - SYSCALL_ENTRY( 0x018a, NtUserSetWinEventHook, 64 ) \ - SYSCALL_ENTRY( 0x018b, NtUserSetWindowLong, 32 ) \ - SYSCALL_ENTRY( 0x018c, NtUserSetWindowLongPtr, 32 ) \ - SYSCALL_ENTRY( 0x018d, NtUserSetWindowPlacement, 16 ) \ - SYSCALL_ENTRY( 0x018e, NtUserSetWindowPos, 56 ) \ - SYSCALL_ENTRY( 0x018f, NtUserSetWindowRgn, 24 ) \ - SYSCALL_ENTRY( 0x0190, NtUserSetWindowWord, 24 ) \ - SYSCALL_ENTRY( 0x0191, NtUserSetWindowsHookEx, 48 ) \ - SYSCALL_ENTRY( 0x0192, NtUserShowCaret, 8 ) \ - SYSCALL_ENTRY( 0x0193, NtUserShowCursor, 8 ) \ - SYSCALL_ENTRY( 0x0194, NtUserShowScrollBar, 24 ) \ - SYSCALL_ENTRY( 0x0195, NtUserShowWindow, 16 ) \ - SYSCALL_ENTRY( 0x0196, NtUserShowWindowAsync, 16 ) \ - SYSCALL_ENTRY( 0x0197, NtUserSwitchDesktop, 8 ) \ - SYSCALL_ENTRY( 0x0198, NtUserSystemParametersInfo, 32 ) \ - SYSCALL_ENTRY( 0x0199, NtUserSystemParametersInfoForDpi, 40 ) \ - SYSCALL_ENTRY( 0x019a, NtUserThunkedMenuInfo, 16 ) \ - SYSCALL_ENTRY( 0x019b, NtUserThunkedMenuItemInfo, 48 ) \ - SYSCALL_ENTRY( 0x019c, NtUserToUnicodeEx, 56 ) \ - SYSCALL_ENTRY( 0x019d, NtUserTrackMouseEvent, 8 ) \ - SYSCALL_ENTRY( 0x019e, NtUserTrackPopupMenuEx, 48 ) \ - SYSCALL_ENTRY( 0x019f, NtUserTranslateAccelerator, 24 ) \ - SYSCALL_ENTRY( 0x01a0, NtUserTranslateMessage, 16 ) \ - SYSCALL_ENTRY( 0x01a1, NtUserUnhookWinEvent, 8 ) \ - SYSCALL_ENTRY( 0x01a2, NtUserUnhookWindowsHookEx, 8 ) \ - SYSCALL_ENTRY( 0x01a3, NtUserUnregisterClass, 24 ) \ - SYSCALL_ENTRY( 0x01a4, NtUserUnregisterHotKey, 16 ) \ - SYSCALL_ENTRY( 0x01a5, NtUserUpdateInputContext, 24 ) \ - SYSCALL_ENTRY( 0x01a6, NtUserUpdateLayeredWindow, 80 ) \ - SYSCALL_ENTRY( 0x01a7, NtUserValidateRect, 16 ) \ - SYSCALL_ENTRY( 0x01a8, NtUserVkKeyScanEx, 16 ) \ - SYSCALL_ENTRY( 0x01a9, NtUserWaitForInputIdle, 24 ) \ - SYSCALL_ENTRY( 0x01aa, NtUserWaitMessage, 0 ) \ - SYSCALL_ENTRY( 0x01ab, NtUserWindowFromDC, 8 ) \ - SYSCALL_ENTRY( 0x01ac, NtUserWindowFromPoint, 16 ) \ - SYSCALL_ENTRY( 0x01ad, __wine_get_file_outline_text_metric, 32 ) \ - SYSCALL_ENTRY( 0x01ae, __wine_get_icm_profile, 32 ) From 3516a4f3d6c240d366ec86ea4e3c216127470db8 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Thu, 18 Jan 2024 18:18:23 +0200 Subject: [PATCH 0005/2542] wine: Add autogen.sh. --- autogen.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 autogen.sh diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 000000000000..0e3ca52c1787 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -e +tools/make_requests +tools/make_specfiles +dlls/winevulkan/make_vulkan -x vk.xml -X video.xml +autoreconf -ifv +rm -rf autom4te.cache + +echo "Now run ./configure" From 3101ee529419cb355dbc45749cdc5cff2f7ad476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 22 Nov 2024 15:08:14 +0100 Subject: [PATCH 0006/2542] win32u: Fix a spurious warning. --- dlls/win32u/winstation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/win32u/winstation.c b/dlls/win32u/winstation.c index d774cd2c9862..233eb8b79b8e 100644 --- a/dlls/win32u/winstation.c +++ b/dlls/win32u/winstation.c @@ -182,7 +182,7 @@ static NTSTATUS find_shared_session_block( SIZE_T offset, SIZE_T size, struct se static const shared_object_t *find_shared_session_object( struct obj_locator locator ) { const shared_object_t *object; - struct session_block *block; + struct session_block *block = NULL; NTSTATUS status; if (locator.id && !(status = find_shared_session_block( locator.offset, sizeof(*object), &block ))) From 722b639dddbc1ea6c12a0d28c04fd9866ee14f33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 26 Sep 2023 16:34:16 +0200 Subject: [PATCH 0007/2542] makedep: Allow using an external wine object dir. CW-Bug-Id: #22729 --- tools/makedep.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tools/makedep.c b/tools/makedep.c index c1937363c394..3b1c4e2116ce 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -144,6 +144,7 @@ static struct strarray subdirs; static struct strarray delay_import_libs; static struct strarray top_install[NB_INSTALL_RULES]; static const char *root_src_dir; +static const char *root_obj_dir; static const char *tools_dir; static const char *tools_ext; static const char *exe_ext; @@ -688,6 +689,16 @@ static char *root_src_dir_path( const char *path ) } +/******************************************************************* + * root_obj_dir_path + */ +static char *root_obj_dir_path( const char *path ) +{ + if (!root_obj_dir) return (char *)path; + return concat_paths( root_obj_dir, path ); +} + + /******************************************************************* * tools_dir_path */ @@ -2438,8 +2449,8 @@ static const char *cmd_prefix( const char *cmd ) */ static void output_winegcc_command( struct makefile *make, unsigned int arch ) { - output( "\t%s%s -o $@", cmd_prefix( "CCLD" ), tools_path( make, "winegcc" )); - output_filename( "--wine-objdir ." ); + output( "\t%s%s -o $@", cmd_prefix( "CCLD" ), tools_path( make, "winegcc" ) ); + output_filename( strmake( "--wine-objdir %s", root_obj_dir_path( "." ) ) ); if (tools_dir) { output_filename( "--winebuild" ); @@ -4474,7 +4485,7 @@ static void load_sources( struct makefile *make ) strarray_add( &make->include_args, strmake( "-I%s", make->src_dir )); if (make->parent_dir) strarray_add( &make->include_args, strmake( "-I%s", src_dir_path( make, make->parent_dir ))); - strarray_add( &make->include_args, "-Iinclude" ); + strarray_add( &make->include_args, strmake( "-I%s", root_obj_dir_path( "include" ) ) ); if (root_src_dir) strarray_add( &make->include_args, strmake( "-I%s", root_src_dir_path( "include" ))); list_init( &make->sources ); @@ -4604,6 +4615,7 @@ int main( int argc, char *argv[] ) top_install[i] = get_expanded_make_var_array( top_makefile, strmake( "TOP_%s", install_variables[i] )); root_src_dir = get_expanded_make_variable( top_makefile, "srcdir" ); + root_obj_dir = get_expanded_make_variable( top_makefile, "objdir" ); tools_dir = get_expanded_make_variable( top_makefile, "toolsdir" ); tools_ext = get_expanded_make_variable( top_makefile, "toolsext" ); exe_ext = get_expanded_make_variable( top_makefile, "EXEEXT" ); From 24fe3c19122270fe161edb38741ca48de624b86c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 26 Sep 2023 16:34:50 +0200 Subject: [PATCH 0008/2542] makedep: Allow include to be missing from SUBDIRS. CW-Bug-Id: #22729 --- tools/makedep.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/makedep.c b/tools/makedep.c index 3b1c4e2116ce..659ddde1792c 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -1491,9 +1491,9 @@ static struct file *open_include_file( const struct makefile *make, struct incl_ if ((file = open_local_file( make, pFile->name, &pFile->filename ))) return file; /* check for global importlib (module dependency) */ - if (pFile->type == INCL_IMPORTLIB && find_importlib_module( pFile->name )) + if (pFile->type == INCL_IMPORTLIB) { - pFile->filename = pFile->name; + if (find_importlib_module( pFile->name )) pFile->filename = pFile->name; return NULL; } @@ -4691,6 +4691,8 @@ int main( int argc, char *argv[] ) for (i = 0; i < subdirs.count; i++) submakes[i] = parse_makefile( subdirs.str[i] ); + if (!include_makefile) include_makefile = parse_makefile( root_src_dir_path( "include" ) ); + load_sources( top_makefile ); load_sources( include_makefile ); for (i = 0; i < subdirs.count; i++) From d6b545bf1862e73397cba1b8228f85f061f0871b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 20 Sep 2023 00:03:48 +0200 Subject: [PATCH 0009/2542] makedep: Allow building modules from external sources. CW-Bug-Id: #22729 --- tools/makedep.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tools/makedep.c b/tools/makedep.c index 659ddde1792c..83fcd0dbfe13 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -207,6 +207,7 @@ struct makefile int data_only; int is_win16; int is_exe; + int is_external; int disabled[MAX_ARCHS]; /* values generated at output time */ @@ -1546,7 +1547,7 @@ static struct file *open_include_file( const struct makefile *make, struct incl_ return file; } - if (make->extlib) return NULL; /* ignore missing files in external libs */ + if (make->extlib || make->is_external) return NULL; /* ignore missing files in external libs */ fprintf( stderr, "%s:%d: error: ", pFile->included_by->file->name, pFile->included_line ); perror( pFile->name ); @@ -1664,7 +1665,7 @@ static struct incl_file *add_src_file( struct makefile *make, const char *name ) memset( file, 0, sizeof(*file) ); file->name = xstrdup(name); file->use_msvcrt = is_using_msvcrt( make ); - file->is_external = !!make->extlib; + file->is_external = !!make->extlib || make->is_external; list_add_tail( &make->sources, &file->entry ); if (make == include_makefile) { @@ -2197,7 +2198,7 @@ static struct strarray add_unix_libraries( const struct makefile *make, struct s struct strarray all_libs = empty_strarray; unsigned int i, j; - if (strcmp( make->unixlib, "ntdll.so" )) strarray_add( &all_libs, "-lntdll" ); + if (strcmp( make->unixlib, "ntdll.so" ) && !make->is_external) strarray_add( &all_libs, "-lntdll" ); strarray_addall( &all_libs, get_expanded_make_var_array( make, "UNIX_LIBS" )); for (i = 0; i < all_libs.count; i++) @@ -4573,7 +4574,7 @@ static unsigned int find_pe_arch( const char *arch ) int main( int argc, char *argv[] ) { const char *makeflags = getenv( "MAKEFLAGS" ); - const char *target; + const char *target, *tmp; unsigned int i, j, arch, ec_arch; if (makeflags) parse_makeflags( makeflags ); @@ -4689,7 +4690,16 @@ int main( int argc, char *argv[] ) subdirs = get_expanded_make_var_array( top_makefile, "SUBDIRS" ); submakes = xmalloc( subdirs.count * sizeof(*submakes) ); - for (i = 0; i < subdirs.count; i++) submakes[i] = parse_makefile( subdirs.str[i] ); + for (i = 0; i < subdirs.count; i++) + { + submakes[i] = parse_makefile( subdirs.str[i] ); + if (*(tmp = subdirs.str[i]) == '/') + { + tmp = strmake( "dlls%s", strrchr( tmp, '/' ) ); + submakes[i]->is_external = 1; + } + submakes[i]->obj_dir = subdirs.str[i] = tmp; + } if (!include_makefile) include_makefile = parse_makefile( root_src_dir_path( "include" ) ); From f48709d7cd7e4d83a2cc684483155ec114248a1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 20 Sep 2023 09:49:29 +0200 Subject: [PATCH 0010/2542] makedep: Allow modules to have a different 64bit name. CW-Bug-Id: #22729 --- tools/makedep.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/tools/makedep.c b/tools/makedep.c index 83fcd0dbfe13..cff7f1c5459a 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -3418,12 +3418,14 @@ static const struct static void output_fake_module( struct makefile *make, const char *spec_file ) { unsigned int arch = 0; /* fake modules are always native */ - const char *name = strmake( "%s%s", arch_pe_dirs[arch], make->module ); + const char *name, *module; if (make->disabled[arch]) return; + if (!(module = get_expanded_make_variable( make, strmake( "%s_%s", archs.str[arch], "MODULE" ) ))) module = make->module; + name = strmake( "%s%s", arch_pe_dirs[arch], module ); strarray_add( &make->all_targets[arch], name ); - add_install_rule( make, make->module, arch, name, strmake( "d$(libdir)/wine/%s", name )); + add_install_rule( make, module, arch, name, strmake( "d$(libdir)/wine/%s", name )); output( "%s:", obj_dir_path( make, name )); if (spec_file) output_filename( spec_file ); @@ -3450,27 +3452,28 @@ static void output_module( struct makefile *make, unsigned int arch ) struct strarray all_libs = empty_strarray; struct strarray dep_libs = empty_strarray; struct strarray imports = make->imports; - const char *module_name; + const char *module_name, *module; const char *debug_file; char *spec_file = NULL; unsigned int i, link_arch; + if (!(module = get_expanded_arch_var( make, "MODULE", arch ))) module = make->module; if (!make->is_exe) { if (make->data_only || strarray_exists( &make->extradllflags, "-Wl,--subsystem,native" )) { /* spec file is optional */ - struct incl_file *spec = find_src_file( make, replace_extension( make->module, ".dll", ".spec" )); + struct incl_file *spec = find_src_file( make, replace_extension( module, ".dll", ".spec" )); if (spec) spec_file = spec->filename; } - else spec_file = src_dir_path( make, replace_extension( make->module, ".dll", ".spec" )); + else spec_file = src_dir_path( make, replace_extension( module, ".dll", ".spec" )); } if (!make->data_only) { if (!get_link_arch( make, arch, &link_arch )) return; - module_name = arch_module_name( make->module, arch ); + module_name = arch_module_name( module, arch ); if (!strarray_exists( &make->extradllflags, "-nodefaultlibs" )) default_imports = get_default_imports( make, imports ); @@ -3494,16 +3497,16 @@ static void output_module( struct makefile *make, unsigned int arch ) if (make->disabled[arch]) return; link_arch = arch; - module_name = strmake( "%s%s", arch_pe_dirs[arch], make->module ); + module_name = strmake( "%s%s", arch_pe_dirs[arch], module ); } strarray_add( &make->all_targets[link_arch], module_name ); if (make->data_only) - add_install_rule( make, make->module, link_arch, module_name, - strmake( "d$(libdir)/wine/%s%s", arch_pe_dirs[arch], make->module )); + add_install_rule( make, module, link_arch, module_name, + strmake( "d$(libdir)/wine/%s%s", arch_pe_dirs[arch], module )); else - add_install_rule( make, make->module, link_arch, module_name, - strmake( "%c%s%s%s", '0' + arch, arch_install_dirs[arch], make->module, + add_install_rule( make, module, link_arch, module_name, + strmake( "%c%s%s%s", '0' + arch, arch_install_dirs[arch], module, dll_ext[arch] )); output( "%s:", obj_dir_path( make, module_name )); @@ -4452,6 +4455,13 @@ static void load_sources( struct makefile *make ) if (make->importlib) strarray_add( &make->install[INSTALL_DEV], make->importlib ); if (make->staticlib) strarray_add( &make->install[INSTALL_DEV], make->staticlib ); else strarray_add( &make->install[INSTALL_LIB], make->module ); + for (arch = 1; arch < archs.count; arch++) + { + char *module; + if (!(module = get_expanded_arch_var( make, "MODULE", arch ))) continue; + strarray_add( &make->install[INSTALL_LIB], module ); + free( module ); + } } } From 95c4e71635f89a0db9796a608d5ff30c8bf21e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 20 Sep 2023 09:49:29 +0200 Subject: [PATCH 0011/2542] makedep: Allow unixlibs to have a different 64bit name. CW-Bug-Id: #22729 --- tools/makedep.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/makedep.c b/tools/makedep.c index cff7f1c5459a..5a6bc2b046a2 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -3583,13 +3583,15 @@ static void output_unix_lib( struct makefile *make ) struct strarray unix_deps = empty_strarray; struct strarray unix_libs = add_unix_libraries( make, &unix_deps ); unsigned int arch = 0; /* unix libs are always native */ + const char *unixlib; if (make->disabled[arch]) return; + if (!(unixlib = get_expanded_make_variable( make, strmake( "%s_%s", archs.str[arch], "UNIXLIB" ) ))) unixlib = make->unixlib; - strarray_add( &make->all_targets[arch], make->unixlib ); - add_install_rule( make, make->module, arch, make->unixlib, - strmake( "p%s%s", arch_install_dirs[arch], make->unixlib )); - output( "%s:", obj_dir_path( make, make->unixlib )); + strarray_add( &make->all_targets[arch], unixlib ); + add_install_rule( make, make->module, arch, unixlib, + strmake( "p%s%s", arch_install_dirs[arch], unixlib )); + output( "%s:", obj_dir_path( make, unixlib )); output_filenames_obj_dir( make, make->unixobj_files ); output_filenames( unix_deps ); output( "\n" ); From 1d400e3aea5c3e1931d357844d5664a1965c9a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 21 Oct 2020 17:19:30 +0200 Subject: [PATCH 0012/2542] makedep: Allow building modules with C++ sources. CW-Bug-Id: #22729 --- configure.ac | 2 +- tools/makedep.c | 45 +++++++++++++++++++++++++++++++-------------- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index b999e3506e0e..99c5a2a4a8ab 100644 --- a/configure.ac +++ b/configure.ac @@ -175,7 +175,7 @@ case "$host_cpu" in x86_64) HOST_ARCH=x86_64 ;; esac m4_set_add_all([_AC_SUBST_VARS],[HOST_ARCH]m4_foreach([cpu],[aarch64,arm,arm64ec,i386,x86_64], - [m4_foreach([var],[CC,CFLAGS,EXTRACFLAGS,LDFLAGS,DEBUG,TARGET,STRIP,DELAYLOADFLAG,DISABLED_SUBDIRS],[,cpu[_]var])])) + [m4_foreach([var],[CC,CFLAGS,EXTRACFLAGS,CXXFLAGS,LDFLAGS,DEBUG,TARGET,STRIP,DELAYLOADFLAG,DISABLED_SUBDIRS],[,cpu[_]var])])) AC_CACHE_CHECK([for the directory containing the Wine tools], wine_cv_toolsdir, [wine_cv_toolsdir="$with_wine_tools" diff --git a/tools/makedep.c b/tools/makedep.c index 5a6bc2b046a2..6c3a0250ecce 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -207,6 +207,7 @@ struct makefile int data_only; int is_win16; int is_exe; + int has_cxx; int is_external; int disabled[MAX_ARCHS]; @@ -1233,6 +1234,7 @@ static const struct } parse_functions[] = { { ".c", parse_c_file }, + { ".cpp", parse_c_file }, { ".h", parse_c_file }, { ".inl", parse_c_file }, { ".l", parse_c_file }, @@ -2448,9 +2450,11 @@ static const char *cmd_prefix( const char *cmd ) /******************************************************************* * output_winegcc_command */ -static void output_winegcc_command( struct makefile *make, unsigned int arch ) +static void output_winegcc_command( struct makefile *make, unsigned int arch, int is_cxx ) { - output( "\t%s%s -o $@", cmd_prefix( "CCLD" ), tools_path( make, "winegcc" ) ); + const char *tool = tools_path( make, "winegcc" ); + if (is_cxx) strcpy( strrchr( tool, 'w' ), "wineg++" ); + output( "\t%s%s -o $@", cmd_prefix( "CCLD" ), tool ); output_filename( strmake( "--wine-objdir %s", root_obj_dir_path( "." ) ) ); if (tools_dir) { @@ -3170,7 +3174,7 @@ static void output_source_testdll( struct makefile *make, struct incl_file *sour output_filename( tools_path( make, "winebuild" )); output_filename( tools_path( make, "winegcc" )); output( "\n" ); - output_winegcc_command( make, link_arch ); + output_winegcc_command( make, link_arch, 0 ); output_filename( "-s" ); output_filenames( dll_flags ); if (link_arch) output_filenames( get_expanded_arch_var_array( make, "EXTRADLLFLAGS", link_arch )); @@ -3210,11 +3214,13 @@ static void output_source_one_arch( struct makefile *make, struct incl_file *sou struct strarray defines, struct strarray *targets, unsigned int arch ) { - const char *obj_name, *var_cc, *var_cflags; + const int is_cxx = strendswith( source->name, ".cpp" ); + const char *obj_name, *var_cc, *var_cxx, *var_cflags, *var_cxxflags; struct compile_command *cmd; struct strarray cflags = empty_strarray; if (make->disabled[arch] && !(source->file->flags & FLAG_C_IMPLIB)) return; + make->has_cxx |= is_cxx; if (arch) { @@ -3247,15 +3253,19 @@ static void output_source_one_arch( struct makefile *make, struct incl_file *sou if ((source->file->flags & FLAG_ARM64EC_X64) && !strcmp( archs.str[arch], "arm64ec" )) { var_cc = "$(x86_64_CC)"; + var_cxx = "$(x86_64_CXX)"; var_cflags = "$(x86_64_CFLAGS)"; + var_cxxflags = "$(x86_64_CXXFLAGS)"; strarray_add( &cflags, "-D__arm64ec_x64__" ); strarray_addall( &cflags, get_expanded_make_var_array( top_makefile, "x86_64_EXTRACFLAGS" )); } else { var_cc = arch_make_variable( "CC", arch ); + var_cxx = arch_make_variable( "CXX", arch ); var_cflags = arch_make_variable( "CFLAGS", arch ); - strarray_addall( &cflags, make->extlib ? extra_cflags_extlib[arch] : extra_cflags[arch] ); + var_cxxflags = arch_make_variable( "CXXFLAGS", arch ); + strarray_addall( &cflags, make->extlib || is_cxx ? extra_cflags_extlib[arch] : extra_cflags[arch] ); } if (!arch) @@ -3279,10 +3289,10 @@ static void output_source_one_arch( struct makefile *make, struct incl_file *sou } output( "%s: %s\n", obj_dir_path( make, obj_name ), source->filename ); - output( "\t%s%s -c -o $@ %s", cmd_prefix( "CC" ), var_cc, source->filename ); + output( "\t%s%s -c -o $@ %s", cmd_prefix( is_cxx ? "CXX" : "CC" ), is_cxx ? var_cxx : var_cc, source->filename ); output_filenames( defines ); output_filenames( cflags ); - output_filename( var_cflags ); + output_filename( is_cxx ? var_cxxflags : var_cflags ); output( "\n" ); if (make->testdll && strendswith( source->name, ".c" ) && @@ -3433,7 +3443,7 @@ static void output_fake_module( struct makefile *make, const char *spec_file ) output_filename( tools_path( make, "winebuild" )); output_filename( tools_path( make, "winegcc" )); output( "\n" ); - output_winegcc_command( make, arch ); + output_winegcc_command( make, arch, 0 ); output_filename( "-Wb,--fake-module" ); if (!make->is_exe) output_filename( "-shared" ); if (spec_file) output_filename( spec_file ); @@ -3454,7 +3464,7 @@ static void output_module( struct makefile *make, unsigned int arch ) struct strarray imports = make->imports; const char *module_name, *module; const char *debug_file; - char *spec_file = NULL; + char *tool, *spec_file = NULL; unsigned int i, link_arch; if (!(module = get_expanded_arch_var( make, "MODULE", arch ))) module = make->module; @@ -3516,9 +3526,15 @@ static void output_module( struct makefile *make, unsigned int arch ) output_filenames_obj_dir( make, make->res_files[arch] ); output_filenames( dep_libs ); output_filename( tools_path( make, "winebuild" )); - output_filename( tools_path( make, "winegcc" )); + tool = tools_path( make, "winegcc" ); + output_filename( tool ); + if (make->has_cxx) + { + strcpy( strrchr( tool, 'w' ), "wineg++" ); + output_filename( tool ); + } output( "\n" ); - output_winegcc_command( make, link_arch ); + output_winegcc_command( make, link_arch, make->has_cxx ); if (arch) output_filename( "-Wl,--wine-builtin" ); if (!make->is_exe) output_filename( "-shared" ); if (spec_file) output_filename( spec_file ); @@ -3595,7 +3611,8 @@ static void output_unix_lib( struct makefile *make ) output_filenames_obj_dir( make, make->unixobj_files ); output_filenames( unix_deps ); output( "\n" ); - output( "\t%s$(CC) -o $@", cmd_prefix( "CCLD" )); + if (make->has_cxx) output( "\t%s$(CXX) -o $@", cmd_prefix( "CCLD" )); + else output( "\t%s$(CC) -o $@", cmd_prefix( "CCLD" )); output_filenames( get_expanded_make_var_array( make, "UNIXLDFLAGS" )); output_filenames_obj_dir( make, make->unixobj_files ); output_filenames( unix_libs ); @@ -3655,7 +3672,7 @@ static void output_test_module( struct makefile *make, unsigned int arch ) strarray_add( &make->all_targets[arch], testmodule ); strarray_add( &make->clean_files, stripped ); output( "%s:\n", obj_dir_path( make, testmodule )); - output_winegcc_command( make, link_arch ); + output_winegcc_command( make, link_arch, 0 ); output_filenames( make->extradllflags ); output_filenames_obj_dir( make, make->object_files[arch] ); if (link_arch != arch) output_filenames_obj_dir( make, make->object_files[link_arch] ); @@ -3666,7 +3683,7 @@ static void output_test_module( struct makefile *make, unsigned int arch ) output_filename( arch_make_variable( "LDFLAGS", link_arch )); output( "\n" ); output( "%s:\n", obj_dir_path( make, stripped )); - output_winegcc_command( make, link_arch ); + output_winegcc_command( make, link_arch, 0 ); output_filename( "-s" ); output_filename( strmake( "-Wb,-F,%s_test.exe", basemodule )); output_filenames( make->extradllflags ); From e5cf25c3ed40aef8f04dd2667af06286ff47c372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 14 Nov 2023 13:44:00 +0100 Subject: [PATCH 0013/2542] Revert "makedep: Assume that all modules are built with msvcrt." This reverts commit a9183c7e3bd6ee25aeab2aed6c57a58d9558b614. CW-Bug-Id: #22729 --- tools/makedep.c | 52 +++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/tools/makedep.c b/tools/makedep.c index 6c3a0250ecce..4c9333e401bd 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -204,6 +204,7 @@ struct makefile const char *staticlib; const char *importlib; const char *unixlib; + int use_msvcrt; int data_only; int is_win16; int is_exe; @@ -634,17 +635,6 @@ static int is_multiarch( unsigned int arch ) } -/******************************************************************* - * is_using_msvcrt - * - * Check if the files of a makefile use msvcrt by default. - */ -static int is_using_msvcrt( struct makefile *make ) -{ - return make->module || make->testdll; -} - - /******************************************************************* * arch_module_name */ @@ -913,7 +903,7 @@ static struct incl_file *add_generated_source( struct makefile *make, const char file->basename = xstrdup( filename ? filename : name ); file->filename = obj_dir_path( make, file->basename ); file->file->flags = FLAG_GENERATED; - file->use_msvcrt = is_using_msvcrt( make ); + file->use_msvcrt = make->use_msvcrt; list_add_tail( &make->sources, &file->entry ); if (make == include_makefile) { @@ -1666,7 +1656,7 @@ static struct incl_file *add_src_file( struct makefile *make, const char *name ) memset( file, 0, sizeof(*file) ); file->name = xstrdup(name); - file->use_msvcrt = is_using_msvcrt( make ); + file->use_msvcrt = make->use_msvcrt; file->is_external = !!make->extlib || make->is_external; list_add_tail( &make->sources, &file->entry ); if (make == include_makefile) @@ -1864,12 +1854,13 @@ static void add_generated_sources( struct makefile *make ) unsigned int i, arch; struct incl_file *source, *next, *file, *dlldata = NULL; struct strarray objs = get_expanded_make_var_array( make, "EXTRA_OBJS" ); + int multiarch = archs.count > 1 && make->use_msvcrt; LIST_FOR_EACH_ENTRY_SAFE( source, next, &make->sources, struct incl_file, entry ) { for (arch = 0; arch < archs.count; arch++) { - if (!is_multiarch( arch )) continue; + if (!arch != !multiarch) continue; if (source->file->flags & FLAG_IDL_CLIENT) { file = add_generated_source( make, replace_extension( source->name, ".idl", "_c.c" ), NULL, arch ); @@ -1988,7 +1979,7 @@ static void add_generated_sources( struct makefile *make ) { for (arch = 0; arch < archs.count; arch++) { - if (!is_multiarch( arch )) continue; + if (!arch != !multiarch) continue; file = add_generated_source( make, "testlist.o", "testlist.c", arch ); add_dependency( file->file, "wine/test.h", INCL_NORMAL ); add_all_includes( make, file, file->file ); @@ -2242,6 +2233,7 @@ static int is_crt_module( const char *file ) */ static const char *get_default_crt( const struct makefile *make ) { + if (!make->use_msvcrt) return NULL; if (make->module && is_crt_module( make->module )) return NULL; /* don't add crt import to crt dlls */ return !make->testdll && (!make->staticlib || make->extlib) ? "ucrtbase" : "msvcrt"; } @@ -2400,7 +2392,6 @@ static struct strarray get_source_defines( struct makefile *make, struct incl_fi strarray_add( &ret, strmake( "-I%s", root_src_dir_path( "include/msvcrt" ))); for (i = 0; i < make->include_paths.count; i++) strarray_add( &ret, strmake( "-I%s", make->include_paths.str[i] )); - strarray_add( &ret, get_crt_define( make )); } strarray_addall( &ret, make->define_args ); strarray_addall( &ret, get_expanded_file_local_var( make, obj, "EXTRADEFS" )); @@ -2465,7 +2456,6 @@ static void output_winegcc_command( struct makefile *make, unsigned int arch, in if (native_archs[arch] && !make->disabled[native_archs[arch]]) output_filenames( hybrid_target_flags[arch] ); if (arch) return; - output_filename( "-mno-cygwin" ); output_filenames( lddll_flags ); } @@ -2865,6 +2855,7 @@ static void output_source_idl( struct makefile *make, struct incl_file *source, struct strarray multiarch_targets[MAX_ARCHS] = { empty_strarray }; const char *dest; unsigned int i, arch; + int multiarch; if (find_include_file( make, strmake( "%s.h", obj ))) source->file->flags |= FLAG_IDL_HEADER; if (!source->file->flags) return; @@ -2888,9 +2879,10 @@ static void output_source_idl( struct makefile *make, struct incl_file *source, for (i = 0; i < ARRAY_SIZE(idl_outputs); i++) { if (!(source->file->flags & idl_outputs[i].flag)) continue; + multiarch = (make->use_msvcrt && archs.count > 1); for (arch = 0; arch < archs.count; arch++) { - if (!is_multiarch( arch )) continue; + if (!arch != !multiarch) continue; if (make->disabled[arch]) continue; dest = strmake( "%s%s%s", arch_dirs[arch], obj, idl_outputs[i].ext ); if (!find_src_file( make, dest )) strarray_add( &make->clean_files, dest ); @@ -3225,13 +3217,13 @@ static void output_source_one_arch( struct makefile *make, struct incl_file *sou if (arch) { if (source->file->flags & FLAG_C_UNIX) return; - if (!is_using_msvcrt( make ) && !make->staticlib && !(source->file->flags & FLAG_C_IMPLIB)) return; + if (!make->use_msvcrt && !make->staticlib && !(source->file->flags & FLAG_C_IMPLIB)) return; } else if (source->file->flags & FLAG_C_UNIX) { if (!unix_lib_supported) return; } - else if (archs.count > 1 && is_using_msvcrt( make )) + else if (archs.count > 1 && make->use_msvcrt) { if (!so_dll_supported) return; if (!(source->file->flags & FLAG_C_IMPLIB) && (!make->staticlib || make->extlib)) return; @@ -3249,7 +3241,8 @@ static void output_source_one_arch( struct makefile *make, struct incl_file *sou else strarray_add( &make->clean_files, obj_name ); - if (!source->use_msvcrt) strarray_addall( &cflags, make->unix_cflags ); + if (source->file->flags & FLAG_C_UNIX) strarray_addall( &cflags, make->unix_cflags ); + if (!make->use_msvcrt && !make->module) strarray_addall( &cflags, make->unix_cflags ); if ((source->file->flags & FLAG_ARM64EC_X64) && !strcmp( archs.str[arch], "arm64ec" )) { var_cc = "$(x86_64_CC)"; @@ -3492,6 +3485,12 @@ static void output_module( struct makefile *make, unsigned int arch ) strarray_addall( &all_libs, add_import_libs( make, &dep_libs, default_imports, IMPORT_TYPE_DEFAULT, arch ) ); if (!arch) strarray_addall( &all_libs, libs ); + if (!make->use_msvcrt) + { + strarray_addall( &all_libs, get_expanded_make_var_array( make, "UNIX_LIBS" )); + strarray_addall( &all_libs, libs ); + } + if (delay_load_flags[arch]) { for (i = 0; i < make->delayimports.count; i++) @@ -3716,7 +3715,7 @@ static void output_test_module( struct makefile *make, unsigned int arch ) output( ": %s", obj_dir_path( make, testmodule )); if (parent) { - char *parent_module = arch_module_name( make->testdll, arch ); + char *parent_module = arch_module_name( make->testdll, parent->use_msvcrt ? arch : 0 ); output_filename( obj_dir_path( parent, parent_module )); if (parent->unixlib) output_filename( obj_dir_path( parent, parent->unixlib )); } @@ -3988,7 +3987,8 @@ static void output_sources( struct makefile *make ) } else if (make->module) { - for (arch = 0; arch < archs.count; arch++) + if (!make->use_msvcrt) output_module( make, 0 ); + else for (arch = 0; arch < archs.count; arch++) { if (is_multiarch( arch )) output_module( make, arch ); if (make->importlib && (is_multiarch( arch ) || !is_native_arch_disabled( make ))) @@ -4462,9 +4462,13 @@ static void load_sources( struct makefile *make ) } make->is_win16 = strarray_exists( &make->extradllflags, "-m16" ); make->data_only = strarray_exists( &make->extradllflags, "-Wb,--data-only" ); + make->use_msvcrt = (make->module || make->testdll || make->is_win16) && + !strarray_exists( &make->extradllflags, "-mcygwin" ); make->is_exe = strarray_exists( &make->extradllflags, "-mconsole" ) || strarray_exists( &make->extradllflags, "-mwindows" ); + if (make->use_msvcrt) strarray_add_uniq( &make->extradllflags, "-mno-cygwin" ); + if (make->module) { /* add default install rules if nothing was specified */ @@ -4526,6 +4530,8 @@ static void load_sources( struct makefile *make ) add_generated_sources( make ); + if (make->use_msvcrt) strarray_add( &make->define_args, get_crt_define( make )); + LIST_FOR_EACH_ENTRY( file, &make->includes, struct incl_file, entry ) parse_file( make, file, 0 ); LIST_FOR_EACH_ENTRY( file, &make->sources, struct incl_file, entry ) get_dependencies( file, file ); From 3e21e7bd60a84dec269fe6f5fa0cd4d3a7f8106d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 1 Dec 2023 21:24:07 +0100 Subject: [PATCH 0014/2542] vrclient: Revert "winevulkan: Check if instance extensions are supported." This reverts commit e84999bd7ab859746e893ed2d49b1d42b0323c3a. Vulkan VR games will try to load some extensions that winevulkan doesn't support. --- dlls/winevulkan/vulkan.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 61b3a42d63f2..f8a7064f0937 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -688,11 +688,6 @@ static VkResult wine_vk_instance_convert_create_info(struct conversion_context * { const char *extension_name = src->ppEnabledExtensionNames[i]; TRACE("Extension %u: %s.\n", i, debugstr_a(extension_name)); - if (!wine_vk_instance_extension_supported(extension_name)) - { - WARN("Extension %s is not supported.\n", debugstr_a(extension_name)); - return VK_ERROR_EXTENSION_NOT_PRESENT; - } } new_extensions = conversion_context_alloc(ctx, (src->enabledExtensionCount + 2) * From 18138491a912d2a26cb2fdf68314fb7af28e0a20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 1 Dec 2023 21:24:10 +0100 Subject: [PATCH 0015/2542] vrclient: Revert "winevulkan: Check if device extensions are supported." This reverts commit 4907ffdf2a15ab3a1e3749def37f4be67b758a35. Vulkan VR games will try to load some extensions that winevulkan doesn't support. --- dlls/winevulkan/vulkan.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index f8a7064f0937..ad7fc06cc0e6 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -559,11 +559,6 @@ static VkResult wine_vk_device_convert_create_info(VkPhysicalDevice client_physi { const char *extension_name = extensions[i]; TRACE("Extension %u: %s.\n", i, debugstr_a(extension_name)); - if (!wine_vk_device_extension_supported(extension_name)) - { - WARN("Extension %s is not supported.\n", debugstr_a(extension_name)); - return VK_ERROR_EXTENSION_NOT_PRESENT; - } } if (phys_dev->map_placed_align) From 7ecc1d7fe67fb23f0082432e052fb6eaeb84748a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 1 Dec 2023 21:24:16 +0100 Subject: [PATCH 0016/2542] vrclient: winevulkan: Retrieve XR extensions from the environment. --- dlls/winevulkan/vulkan.c | 68 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index ad7fc06cc0e6..82aae4ad0bf4 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -531,6 +531,49 @@ static void wine_vk_device_init_queues(struct wine_device *object, const VkDevic object->queue_count += info->queueCount; } +static char *cc_strdup(struct conversion_context *ctx, const char *s) +{ + int len = strlen(s) + 1; + char *ret; + + ret = conversion_context_alloc(ctx, len); + memcpy(ret, s, len); + return ret; +} + +static void parse_xr_extensions(struct conversion_context *ctx, const char **extra_extensions, unsigned int *extra_count) +{ + char *iter, *start; + + iter = getenv("__WINE_OPENXR_VK_DEVICE_EXTENSIONS"); + if (!iter) return; + iter = cc_strdup(ctx, iter); + + TRACE("got var: %s\n", iter); + start = iter; + do + { + if(*iter == ' ') + { + *iter = 0; + extra_extensions[(*extra_count)++] = cc_strdup(ctx, start); + TRACE("added %s to list\n", extra_extensions[(*extra_count) - 1]); + iter++; + start = iter; + } + else if(*iter == 0) + { + extra_extensions[(*extra_count)++] = cc_strdup(ctx, start); + TRACE("added %s to list\n", extra_extensions[(*extra_count) - 1]); + break; + } + else + { + iter++; + } + } while (1); +} + static const char *find_extension(const char *const *extensions, uint32_t count, const char *ext) { while (count--) @@ -544,9 +587,12 @@ static const char *find_extension(const char *const *extensions, uint32_t count, static VkResult wine_vk_device_convert_create_info(VkPhysicalDevice client_physical_device, struct conversion_context *ctx, const VkDeviceCreateInfo *src, VkDeviceCreateInfo *dst) { + static const char *wine_xr_extension_name = "VK_WINE_openxr_device_extensions"; struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(client_physical_device); - const char *extra_extensions[2], * const*extensions = src->ppEnabledExtensionNames; + const char *extra_extensions[64], * const*extensions = src->ppEnabledExtensionNames; unsigned int i, extra_count = 0, extensions_count = src->enabledExtensionCount; + unsigned int j, remove_count = 0; + const char *remove_extensions[64]; *dst = *src; @@ -561,6 +607,12 @@ static VkResult wine_vk_device_convert_create_info(VkPhysicalDevice client_physi TRACE("Extension %u: %s.\n", i, debugstr_a(extension_name)); } + if (find_extension(extensions, extensions_count, wine_xr_extension_name)) + { + parse_xr_extensions(ctx, extra_extensions, &extra_count); + remove_extensions[remove_count++] = wine_xr_extension_name; + } + if (phys_dev->map_placed_align) { VkPhysicalDeviceMapMemoryPlacedFeaturesEXT *map_placed_features; @@ -592,6 +644,20 @@ static VkResult wine_vk_device_convert_create_info(VkPhysicalDevice client_physi dst->enabledExtensionCount += extra_count; new_extensions = conversion_context_alloc(ctx, dst->enabledExtensionCount * sizeof(*new_extensions)); memcpy(new_extensions, extensions, extensions_count * sizeof(*new_extensions)); + for (i = 0; i < extensions_count; i++) + { + for (j = 0; j < remove_count; ++j) + { + if (!strcmp(new_extensions[i], remove_extensions[j])) + { + --dst->enabledExtensionCount; + --extensions_count; + memmove(&new_extensions[i], &new_extensions[i + 1], sizeof(*new_extensions) * (extensions_count - i)); + --i; + break; + } + } + } memcpy(new_extensions + extensions_count, extra_extensions, extra_count * sizeof(*new_extensions)); dst->ppEnabledExtensionNames = new_extensions; } From 2685a7b09f9337b0d5e5cc39e9f12bac7e5dc9a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 1 Dec 2023 21:24:24 +0100 Subject: [PATCH 0017/2542] vrclient: winevulkan: Add custom Vk structures for creating instance and device through OpenXR. --- dlls/winevulkan/make_vulkan | 35 +++++++++++++++++++++++++++- dlls/winevulkan/vulkan.c | 46 ++++++++++++++++++++++++++++++++++--- 2 files changed, 77 insertions(+), 4 deletions(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 72a8d548b5d7..c8e112f8134d 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -2493,7 +2493,18 @@ class StructConversionFunction(object): body += " default:\n" if self.direction == Direction.INPUT: - body += ident + "FIXME(\"Unhandled sType %u.\\n\", in_header->sType);\n" + body += ident + "if ((in_header->sType >> 16) == 0x7ead)\n" + body += ident + "{\n" + body += ident + " VkBaseOutStructure *out_ext = conversion_context_alloc(ctx, 32);\n"; + body += ident + " memcpy(out_ext, in_header, 32);\n"; + body += ident + " out_ext->pNext = NULL;\n"; + body += ident + " out_header->pNext = (void *)out_ext;\n"; + body += ident + " out_header = (void *)out_ext;\n"; + body += ident + "}\n" + body += ident + "else\n" + body += ident + "{\n" + body += ident + " FIXME(\"Unhandled sType %u.\\n\", in_header->sType);\n" + body += ident + "}\n" body += " break;\n" body += " }\n" body += " }\n" @@ -3148,6 +3159,28 @@ class VkGenerator(object): f.write(" \\\n USE_VK_FUNC({0})".format(vk_func.name)) f.write("\n\n") + f.write("typedef VkResult (*PFN_native_vkCreateInstance)(const VkInstanceCreateInfo *, const VkAllocationCallbacks *, VkInstance *,\n") + f.write(" void * (*)(VkInstance, const char *), void *);\n"); + f.write("typedef VkResult (*PFN_native_vkCreateDevice)(VkPhysicalDevice, const VkDeviceCreateInfo *, const VkAllocationCallbacks *, VkDevice *,\n"); + f.write(" void * (*)(VkInstance, const char *), void *);\n\n"); + f.write("typedef struct VkCreateInfoWineDeviceCallback {\n"); + f.write(" VkStructureType sType;\n"); + f.write(" const void* pNext;\n"); + f.write(" PFN_native_vkCreateDevice native_create_callback;\n"); + f.write(" void* context;\n"); + f.write("} VkCreateInfoWineDeviceCallback;\n"); + + f.write("#define VK_STRUCTURE_TYPE_CREATE_INFO_WINE_DEVICE_CALLBACK 2125312001\n"); + + f.write("typedef struct VkCreateInfoWineInstanceCallback {\n"); + f.write(" VkStructureType sType;\n"); + f.write(" const void* pNext;\n"); + f.write(" PFN_native_vkCreateInstance native_create_callback;\n"); + f.write(" void* context;\n"); + f.write("} VkCreateInfoWineInstanceCallback;\n"); + + f.write("#define VK_STRUCTURE_TYPE_CREATE_INFO_WINE_INSTANCE_CALLBACK 2125312002\n"); + f.write("#endif /* __WINE_VULKAN_H */\n") def generate_vulkan_spec(self, f): diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 82aae4ad0bf4..7c8990172f58 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -593,8 +593,11 @@ static VkResult wine_vk_device_convert_create_info(VkPhysicalDevice client_physi unsigned int i, extra_count = 0, extensions_count = src->enabledExtensionCount; unsigned int j, remove_count = 0; const char *remove_extensions[64]; + VkBaseOutStructure *header; *dst = *src; + if ((header = (VkBaseOutStructure *)dst->pNext) && header->sType == VK_STRUCTURE_TYPE_CREATE_INFO_WINE_DEVICE_CALLBACK) + dst->pNext = header->pNext; /* Should be filtered out by loader as ICDs don't support layers. */ dst->enabledLayerCount = 0; @@ -707,6 +710,9 @@ static VkResult wine_vk_instance_convert_create_info(struct conversion_context * *dst = *src; + if ((header = (VkBaseInStructure *)dst->pNext) && header->sType == VK_STRUCTURE_TYPE_CREATE_INFO_WINE_INSTANCE_CALLBACK) + dst->pNext = header->pNext; + instance->utils_messenger_count = wine_vk_count_struct(dst, DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT); instance->utils_messengers = calloc(instance->utils_messenger_count, sizeof(*instance->utils_messengers)); header = (VkBaseInStructure *) dst; @@ -922,6 +928,10 @@ VkResult wine_vkCreateDevice(VkPhysicalDevice client_physical_device, const VkDe unsigned int queue_count, i; VkResult res; + PFN_native_vkCreateDevice native_create_device = NULL; + void *native_create_device_context = NULL; + VkCreateInfoWineDeviceCallback *callback; + if (allocator) FIXME("Support for allocation callbacks not implemented yet\n"); @@ -943,11 +953,25 @@ VkResult wine_vkCreateDevice(VkPhysicalDevice client_physical_device, const VkDe if (!(device = calloc(1, offsetof(struct wine_device, queues[queue_count])))) return VK_ERROR_OUT_OF_HOST_MEMORY; + if ((callback = (VkCreateInfoWineDeviceCallback *)create_info->pNext) + && callback->sType == VK_STRUCTURE_TYPE_CREATE_INFO_WINE_DEVICE_CALLBACK) + { + native_create_device = callback->native_create_callback; + native_create_device_context = callback->context; + } + init_conversion_context(&ctx); res = wine_vk_device_convert_create_info(client_physical_device, &ctx, create_info, &create_info_host); if (res == VK_SUCCESS) - res = instance->p_vkCreateDevice(physical_device->host.physical_device, &create_info_host, - NULL /* allocator */, &host_device); + { + if (native_create_device) + res = native_create_device(physical_device->host.physical_device, &create_info_host, + NULL /* allocator */, &host_device, + (void *)vk_funcs->p_vkGetInstanceProcAddr, native_create_device_context); + else + res = instance->p_vkCreateDevice(physical_device->host.physical_device, &create_info_host, + NULL /* allocator */, &host_device); + } free_conversion_context(&ctx); if (res != VK_SUCCESS) { @@ -990,6 +1014,9 @@ VkResult wine_vkCreateInstance(const VkInstanceCreateInfo *create_info, const VkAllocationCallbacks *allocator, VkInstance *ret, void *client_ptr) { + PFN_native_vkCreateInstance native_create_instance = NULL; + void *native_create_instance_context = NULL; + VkCreateInfoWineInstanceCallback *callback; VkInstanceCreateInfo create_info_host; const VkApplicationInfo *app_info; struct conversion_context ctx; @@ -1007,10 +1034,23 @@ VkResult wine_vkCreateInstance(const VkInstanceCreateInfo *create_info, return VK_ERROR_OUT_OF_HOST_MEMORY; } + if ((callback = (VkCreateInfoWineInstanceCallback *)create_info->pNext) + && callback->sType == VK_STRUCTURE_TYPE_CREATE_INFO_WINE_INSTANCE_CALLBACK) + { + native_create_instance = callback->native_create_callback; + native_create_instance_context = callback->context; + } + init_conversion_context(&ctx); res = wine_vk_instance_convert_create_info(&ctx, create_info, &create_info_host, instance); if (res == VK_SUCCESS) - res = p_vkCreateInstance(&create_info_host, NULL /* allocator */, &host_instance); + { + if (native_create_instance) + res = native_create_instance(&create_info_host, NULL /* allocator */, &host_instance, + (void *)vk_funcs->p_vkGetInstanceProcAddr, native_create_instance_context); + else + res = p_vkCreateInstance(&create_info_host, NULL /* allocator */, &host_instance); + } free_conversion_context(&ctx); if (res != VK_SUCCESS) { From a1ae4c11f3fd35bcdef512e9fd4861e06a1cc70e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sun, 1 Dec 2024 10:45:03 +0100 Subject: [PATCH 0018/2542] include: Install wine/vulkan_driver.h. --- dlls/winevulkan/make_vulkan | 5 +++++ include/wine/rbtree.h | 4 ++++ include/wine/vulkan_driver.h | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index c8e112f8134d..b1080d0c9515 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -3034,6 +3034,11 @@ class VkGenerator(object): def generate_vulkan_h(self, f): self._generate_copyright(f) + + f.write("#if 0\n") + f.write("#pragma makedep install\n") + f.write("#endif\n\n") + f.write("#ifndef __WINE_VULKAN_H\n") f.write("#define __WINE_VULKAN_H\n\n") diff --git a/include/wine/rbtree.h b/include/wine/rbtree.h index 81367f3f7c4a..12004010a850 100644 --- a/include/wine/rbtree.h +++ b/include/wine/rbtree.h @@ -20,6 +20,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + #ifndef __WINE_WINE_RBTREE_H #define __WINE_WINE_RBTREE_H diff --git a/include/wine/vulkan_driver.h b/include/wine/vulkan_driver.h index 4b4908f201ee..39263084c82f 100644 --- a/include/wine/vulkan_driver.h +++ b/include/wine/vulkan_driver.h @@ -17,6 +17,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + #ifndef __WINE_VULKAN_DRIVER_H #define __WINE_VULKAN_DRIVER_H From 38e8f39bda73a48a5aa5153e29ed2a32c635d342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 22 Nov 2022 11:02:52 +0100 Subject: [PATCH 0019/2542] HACK: steam: ntdll: Setup steamclient trampolines to lsteamclient. This uses exec page faults to jump from native steamclient into our lsteamclient entry points. --- dlls/ntdll/loader.c | 23 ++++++ dlls/ntdll/unix/loader.c | 130 ++++++++++++++++++++++++++++++++ dlls/ntdll/unix/signal_i386.c | 7 ++ dlls/ntdll/unix/signal_x86_64.c | 7 ++ dlls/ntdll/unix/unix_private.h | 1 + dlls/ntdll/unixlib.h | 7 ++ 6 files changed, 175 insertions(+) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 0c25fe141338..c659684e307f 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2206,12 +2206,16 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name, DWORD flags, BOOL system, WINE_MODREF **pwm ) { static const char builtin_signature[] = "Wine builtin DLL"; + static HMODULE lsteamclient = NULL; char *signature = (char *)((IMAGE_DOS_HEADER *)*module + 1); + UNICODE_STRING lsteamclient_us; BOOL is_builtin; IMAGE_NT_HEADERS *nt; WINE_MODREF *wm; NTSTATUS status; SIZE_T map_size; + WCHAR *basename, *tmp; + ULONG basename_len; if (!(nt = RtlImageNtHeader( *module ))) return STATUS_INVALID_IMAGE_FORMAT; @@ -2232,6 +2236,25 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name, update_load_config( *module ); + basename = nt_name->Buffer; + if ((tmp = wcsrchr(basename, '\\'))) basename = tmp + 1; + if ((tmp = wcsrchr(basename, '/'))) basename = tmp + 1; + basename_len = wcslen(basename); + if (basename_len >= 4 && !wcscmp(basename + basename_len - 4, L".dll")) basename_len -= 4; + + if ((!RtlCompareUnicodeStrings(basename, basename_len, L"steamclient", 11, TRUE) || + !RtlCompareUnicodeStrings(basename, basename_len, L"steamclient64", 13, TRUE) || + !RtlCompareUnicodeStrings(basename, basename_len, L"gameoverlayrenderer", 19, TRUE) || + !RtlCompareUnicodeStrings(basename, basename_len, L"gameoverlayrenderer64", 21, TRUE)) && + RtlCreateUnicodeStringFromAsciiz(&lsteamclient_us, "lsteamclient.dll") && + (lsteamclient || LdrLoadDll(load_path, 0, &lsteamclient_us, &lsteamclient) == STATUS_SUCCESS)) + { + struct steamclient_setup_trampolines_params params = {.src_mod = *module, .tgt_mod = lsteamclient}; + WINE_UNIX_CALL( unix_steamclient_setup_trampolines, ¶ms ); + wm->ldr.Flags |= LDR_DONT_RESOLVE_REFS; + flags |= DONT_RESOLVE_DLL_REFERENCES; + } + /* fixup imports */ if (!(flags & DONT_RESOLVE_DLL_REFERENCES) && diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 68cd4f504207..f57b16c548a0 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1005,6 +1005,121 @@ static NTSTATUS load_so_dll( void *args ) return status; } +static void *steamclient_srcs[128]; +static void *steamclient_tgts[128]; +static int steamclient_count; + +void *steamclient_handle_fault( LPCVOID addr, DWORD err ) +{ + int i; + + if (!(err & EXCEPTION_EXECUTE_FAULT)) return NULL; + + for (i = 0; i < steamclient_count; ++i) + { + if (addr == steamclient_srcs[i]) + return steamclient_tgts[i]; + } + + return NULL; +} + +static void steamclient_write_jump_x64(void *src_addr, ULONGLONG tgt_addr) +{ + static const char mov[] = {0x48, 0xb8}; + static const char jmp[] = {0xff, 0xe0}; + memcpy(src_addr, mov, sizeof(mov)); + memcpy((char *)src_addr + sizeof(mov), &tgt_addr, sizeof(tgt_addr)); + memcpy((char *)src_addr + sizeof(mov) + sizeof(tgt_addr), jmp, sizeof(jmp)); +} + +static void steamclient_write_jump_x86(void *src_addr, ULONG tgt_addr) +{ + static const char mov[] = {0xb8}; + static const char jmp[] = {0xff, 0xe0}; + memcpy(src_addr, mov, sizeof(mov)); + memcpy((char *)src_addr + sizeof(mov), &tgt_addr, sizeof(tgt_addr)); + memcpy((char *)src_addr + sizeof(mov) + sizeof(tgt_addr), jmp, sizeof(jmp)); +} + +static NTSTATUS steamclient_setup_trampolines( void *args ) +{ + static int noexec_cached = -1; + + struct steamclient_setup_trampolines_params *params = args; + HMODULE src_mod = params->src_mod, tgt_mod = params->tgt_mod; + SYSTEM_BASIC_INFORMATION info; + IMAGE_NT_HEADERS *src_nt = get_rva( src_mod, ((IMAGE_DOS_HEADER *)src_mod)->e_lfanew ); + IMAGE_NT_HEADERS *tgt_nt = get_rva( tgt_mod, ((IMAGE_DOS_HEADER *)tgt_mod)->e_lfanew ); + IMAGE_SECTION_HEADER *src_sec = IMAGE_FIRST_SECTION( src_nt ); + BOOL x64 = src_nt->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC; + const IMAGE_EXPORT_DIRECTORY *src_exp, *tgt_exp; + const DWORD *names; + SIZE_T size; + void *addr, *src_addr, *tgt_addr; + char *name, *wsne; + UINT_PTR page_mask; + int i; + + if (noexec_cached == -1) + noexec_cached = (wsne = getenv("WINESTEAMNOEXEC")) && atoi(wsne); + + virtual_get_system_info( &info, !!NtCurrentTeb()->WowTebOffset ); + page_mask = info.PageSize - 1; + + for (i = 0; i < src_nt->FileHeader.NumberOfSections; ++i) + { + if (memcmp(src_sec[i].Name, ".text", 5)) continue; + addr = (void *)(((UINT_PTR)src_mod + src_sec[i].VirtualAddress) & ~page_mask); + size = (src_sec[i].Misc.VirtualSize + page_mask) & ~page_mask; + if (noexec_cached) mprotect(addr, size, PROT_READ); + else mprotect(addr, size, PROT_READ|PROT_WRITE|PROT_EXEC); + } + + src_exp = get_module_data_dir( src_mod, IMAGE_FILE_EXPORT_DIRECTORY, NULL ); + tgt_exp = get_module_data_dir( tgt_mod, IMAGE_FILE_EXPORT_DIRECTORY, NULL ); + names = (const DWORD *)((UINT_PTR)src_mod + src_exp->AddressOfNames); + for (i = 0; i < src_exp->NumberOfNames; ++i) + { + if (!names[i] || !(name = (char *)((UINT_PTR)src_mod + names[i]))) continue; + if (!(src_addr = (void *)find_named_export(src_mod, src_exp, name))) continue; + if (!(tgt_addr = (void *)find_named_export(tgt_mod, tgt_exp, name))) continue; + assert(steamclient_count < ARRAY_SIZE(steamclient_srcs)); + steamclient_srcs[steamclient_count] = src_addr; + steamclient_tgts[steamclient_count] = tgt_addr; + if (!noexec_cached) + { + if (x64) steamclient_write_jump_x64( src_addr, (ULONG_PTR)tgt_addr ); + else steamclient_write_jump_x86( src_addr, PtrToUlong(tgt_addr) ); + } + else steamclient_count++; + } + + if (x64) + { + IMAGE_NT_HEADERS64 *src_nt64 = (IMAGE_NT_HEADERS64 *)src_nt, *tgt_nt64 = (IMAGE_NT_HEADERS64 *)tgt_nt; + src_addr = (void *)((UINT_PTR)src_mod + src_nt64->OptionalHeader.AddressOfEntryPoint); + tgt_addr = (void *)((UINT_PTR)tgt_mod + tgt_nt64->OptionalHeader.AddressOfEntryPoint); + } + else + { + IMAGE_NT_HEADERS32 *src_nt32 = (IMAGE_NT_HEADERS32 *)src_nt, *tgt_nt32 = (IMAGE_NT_HEADERS32 *)tgt_nt; + src_addr = (void *)((UINT_PTR)src_mod + src_nt32->OptionalHeader.AddressOfEntryPoint); + tgt_addr = (void *)((UINT_PTR)tgt_mod + tgt_nt32->OptionalHeader.AddressOfEntryPoint); + } + + assert(steamclient_count < ARRAY_SIZE(steamclient_srcs)); + steamclient_srcs[steamclient_count] = src_addr; + steamclient_tgts[steamclient_count] = tgt_addr; + if (!noexec_cached) + { + if (x64) steamclient_write_jump_x64( src_addr, (ULONG_PTR)tgt_addr ); + else steamclient_write_jump_x86( src_addr, PtrToUlong(tgt_addr) ); + } + else steamclient_count++; + + return STATUS_SUCCESS; +} static const unixlib_entry_t unix_call_funcs[] = { @@ -1016,6 +1131,7 @@ static const unixlib_entry_t unix_call_funcs[] = unixcall_wine_server_handle_to_fd, unixcall_wine_spawnvp, system_time_precise, + steamclient_setup_trampolines, }; @@ -1024,6 +1140,19 @@ static const unixlib_entry_t unix_call_funcs[] = static NTSTATUS wow64_load_so_dll( void *args ) { return STATUS_INVALID_IMAGE_FORMAT; } static NTSTATUS wow64_unwind_builtin_dll( void *args ) { return STATUS_UNSUCCESSFUL; } +static NTSTATUS wow64_steamclient_setup_trampolines( void *args ) +{ + struct + { + ULONG src_mod; + ULONG tgt_mod; + } const *params32 = args; + struct steamclient_setup_trampolines_params params; + params.src_mod = (HMODULE)(UINT_PTR)params32->src_mod; + params.tgt_mod = (HMODULE)(UINT_PTR)params32->tgt_mod; + return steamclient_setup_trampolines( ¶ms ); +} + const unixlib_entry_t unix_call_wow64_funcs[] = { wow64_load_so_dll, @@ -1034,6 +1163,7 @@ const unixlib_entry_t unix_call_wow64_funcs[] = wow64_wine_server_handle_to_fd, wow64_wine_spawnvp, system_time_precise, + wow64_steamclient_setup_trampolines, }; #endif /* _WIN64 */ diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 8ae7afc769e4..a4345a5b5893 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -1905,6 +1905,7 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext ) struct xcontext xcontext; ucontext_t *ucontext = sigcontext; void *stack = setup_exception_record( sigcontext, &rec, &xcontext ); + void *steamclient_addr = NULL; switch (TRAP_sig(ucontext)) { @@ -1939,6 +1940,12 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext ) } break; case TRAP_x86_PAGEFLT: /* Page fault */ + if ((steamclient_addr = steamclient_handle_fault( siginfo->si_addr, (ERROR_sig(ucontext) >> 1) & 0x09 ))) + { + EIP_sig(ucontext) = (intptr_t)steamclient_addr; + return; + } + rec.NumberParameters = 2; rec.ExceptionInformation[0] = (ERROR_sig(ucontext) >> 1) & 0x09; rec.ExceptionInformation[1] = (ULONG_PTR)siginfo->si_addr; diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index caa85249896f..aace1b59b035 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -1977,6 +1977,7 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext ) EXCEPTION_RECORD rec = { 0 }; struct xcontext context; ucontext_t *ucontext = init_handler( sigcontext ); + void *steamclient_addr = NULL; rec.ExceptionAddress = (void *)RIP_sig(ucontext); save_context( &context, ucontext ); @@ -2008,6 +2009,12 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext ) } break; case TRAP_x86_PAGEFLT: /* Page fault */ + if ((steamclient_addr = steamclient_handle_fault( siginfo->si_addr, (ERROR_sig(ucontext) >> 1) & 0x09 ))) + { + RIP_sig(ucontext) = (intptr_t)steamclient_addr; + return; + } + rec.NumberParameters = 2; rec.ExceptionInformation[0] = (ERROR_sig(ucontext) >> 1) & 0x09; rec.ExceptionInformation[1] = (ULONG_PTR)siginfo->si_addr; diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index f840045f8419..2f956af6966c 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -264,6 +264,7 @@ extern unsigned int alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, stru data_size_t *ret_len ); extern NTSTATUS system_time_precise( void *args ); +extern void *steamclient_handle_fault( LPCVOID addr, DWORD err ); extern void *anon_mmap_fixed( void *start, size_t size, int prot, int flags ); extern void *anon_mmap_alloc( size_t size, int prot ); extern void virtual_init(void); diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h index 9cb444342fe2..475e532b8cfa 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h @@ -66,6 +66,12 @@ struct unwind_builtin_dll_params CONTEXT *context; }; +struct steamclient_setup_trampolines_params +{ + HMODULE src_mod; + HMODULE tgt_mod; +}; + enum ntdll_unix_funcs { unix_load_so_dll, @@ -76,6 +82,7 @@ enum ntdll_unix_funcs unix_wine_server_handle_to_fd, unix_wine_spawnvp, unix_system_time_precise, + unix_steamclient_setup_trampolines, }; extern unixlib_handle_t __wine_unixlib_handle; From 0e7d14bbe6da71871cba29594e3976af742cd0c6 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 3 Nov 2021 18:07:13 +0300 Subject: [PATCH 0020/2542] HACK: ntdll: Enable WINESTEAMNOEXEC for Mafia II. CW-Bug-Id: #19605 --- dlls/ntdll/unix/loader.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index f57b16c548a0..ceb467f718bf 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1977,6 +1977,18 @@ static ULONG_PTR get_image_address(void) return 0; } +static void hacks_init(void) +{ + const char *sgi = getenv( "SteamGameId" ); + + switch (sgi ? atoi( sgi ) : -1) + { + case 50130: /* Mafia II */ + setenv( "WINESTEAMNOEXEC", "1", 0 ); + break; + } +} + /*********************************************************************** * start_main_thread */ @@ -1988,6 +2000,7 @@ static void start_main_thread(void) signal_alloc_thread( teb ); dbg_init(); startup_info_size = server_init_process(); + hacks_init(); virtual_map_user_shared_data(); init_cpu_info(); init_files(); From 0c9d47404ff82d12d736b258d1bcaca932f3eb25 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 24 Jun 2022 13:03:05 -0500 Subject: [PATCH 0021/2542] HACK: ntdll: Enable WINESTEAMNOEXEC for CoD Black Ops II Multiplayer and Zombies. CW-Bug-Id: #20869 --- dlls/ntdll/unix/loader.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index ceb467f718bf..6848b71462bd 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1984,6 +1984,8 @@ static void hacks_init(void) switch (sgi ? atoi( sgi ) : -1) { case 50130: /* Mafia II */ + case 202990: /* CoD Black Ops II Multiplayer */ + case 212910: /* CoD Black Ops II Zombies */ setenv( "WINESTEAMNOEXEC", "1", 0 ); break; } From b1c169c4cf42007249437b1f61821ca5c3d788c8 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 14 Apr 2023 20:20:21 -0600 Subject: [PATCH 0022/2542] HACK: ntdll: Enable WINESTEAMNOEXEC for Madballs in Babo: Invasion. CW-Bug-Id: #22137 --- dlls/ntdll/unix/loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 6848b71462bd..25de00b98f88 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1983,6 +1983,7 @@ static void hacks_init(void) switch (sgi ? atoi( sgi ) : -1) { + case 25700: /* Madballs in Babo: Invasion */ case 50130: /* Mafia II */ case 202990: /* CoD Black Ops II Multiplayer */ case 212910: /* CoD Black Ops II Zombies */ From 11bcb0d6812374c0dcca7509f0dbd730327d9b26 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 10 Sep 2024 10:51:43 -0600 Subject: [PATCH 0023/2542] HACK: ntdll: Enable WINESTEAMNOEXEC for Sniper Elite: Nazi Zombie Army 2. CW-Bug-Id: #24238 --- dlls/ntdll/unix/loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 25de00b98f88..de2666aff891 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1987,6 +1987,7 @@ static void hacks_init(void) case 50130: /* Mafia II */ case 202990: /* CoD Black Ops II Multiplayer */ case 212910: /* CoD Black Ops II Zombies */ + case 247910: /* Sniper Elite: Nazi Zombie Army 2 */ setenv( "WINESTEAMNOEXEC", "1", 0 ); break; } From 912e1b4b9fe992e961371657c9be880690ff27ef Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Thu, 27 Apr 2017 13:25:04 -0500 Subject: [PATCH 0024/2542] HACK: steam: kernelbase: Substitute the current pid for the Steam client pid. --- dlls/kernelbase/process.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index df3447a90149..25c1d919b7cd 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -1100,6 +1100,21 @@ HANDLE WINAPI DECLSPEC_HOTPATCH OpenProcess( DWORD access, BOOL inherit, DWORD i attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; + /* PROTON HACK: + * On Windows, the Steam client puts its process ID into the registry + * at: + * + * [HKCU\Software\Valve\Steam\ActiveProcess] + * PID=dword:00000008 + * + * Games get that pid from the registry and then query it with + * OpenProcess to ensure Steam is running. Since we aren't running the + * Windows Steam in Wine, instead we hack this magic number into the + * registry and then substitute the game's process itself in its place + * so it can query a valid process. + */ + if (id == 0xfffe) id = GetCurrentProcessId(); + cid.UniqueProcess = ULongToHandle(id); cid.UniqueThread = 0; From c096529fe444099b9bd28e0803ba2a9ea0782631 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Tue, 13 Jun 2017 12:35:56 -0500 Subject: [PATCH 0025/2542] HACK: steam: ntdll: Append C:/Program Files (x86)/Steam to PATH. --- dlls/ntdll/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index c659684e307f..0dd5c686ecf6 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -85,7 +85,7 @@ const WCHAR windows_dir[] = L"C:\\windows"; const WCHAR system_dir[] = L"C:\\windows\\system32\\"; /* system search path */ -static const WCHAR system_path[] = L"C:\\windows\\system32;C:\\windows\\system;C:\\windows"; +static const WCHAR system_path[] = L"C:\\windows\\system32;C:\\windows\\system;C:\\windows;C:\\Program Files (x86)\\Steam"; static BOOL is_prefix_bootstrap; /* are we bootstrapping the prefix? */ static BOOL imports_fixup_done = FALSE; /* set once the imports have been fixed up, before attaching them */ From 447ecf2a3333aa9fd0e441ca323e74924551015f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 14 Nov 2023 11:35:53 +0100 Subject: [PATCH 0026/2542] HACK: steam: wine.inf: Add required Steam registry entries. --- loader/wine.inf.in | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index e3426b7ec95c..477ce436b704 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -69,6 +69,7 @@ AddReg=\ Printing,\ Services, \ SessionMgr,\ + SteamClient,\ Tapi,\ ThemeManager,\ LicenseInformation @@ -92,6 +93,7 @@ AddReg=\ Printing,\ Services, \ SessionMgr,\ + SteamClient,\ Tapi,\ ThemeManager,\ VersionInfo,\ @@ -117,6 +119,7 @@ AddReg=\ Printing,\ Services, \ SessionMgr,\ + SteamClient64,\ Tapi,\ ThemeManager,\ VersionInfo,\ @@ -142,6 +145,7 @@ AddReg=\ Printing,\ Services, \ SessionMgr,\ + SteamClient64,\ Tapi,\ ThemeManager,\ VersionInfo,\ @@ -158,6 +162,7 @@ AddReg=\ DirectX,\ MCI,\ Misc,\ + SteamClient64,\ Tapi,\ VersionInfo,\ LicenseInformation @@ -173,6 +178,7 @@ AddReg=\ DirectX,\ MCI,\ Misc,\ + SteamClient64,\ Tapi,\ VersionInfo,\ LicenseInformation @@ -2728,3 +2734,19 @@ EtcFiles = 12,etc InfFiles = 17 NlsFiles = 11 SortFiles = 10,globalization\sorting + +[SteamClient] +HKCU,Software\Valve\Steam,"SteamPath",,"%16422%\Steam" +HKCU,Software\Valve\Steam,"SteamExe",,"%16422%\Steam\Steam.exe" +HKCU,Software\Valve\Steam\ActiveProcess,"PID",0x10001,0x0000fffe +HKCU,Software\Valve\Steam\ActiveProcess,"SteamClientDll",,"%16422%\Steam\steamclient.dll" +HKCU,Software\Valve\Steam\ActiveProcess,"SteamPath",,"%16422%\Steam" + +[SteamClient64] +HKCU,Software\Valve\Steam,"SteamPath",,"%16422%\Steam" +HKCU,Software\Valve\Steam,"SteamExe",,"%16422%\Steam\Steam.exe" +HKCU,Software\Valve\Steam\ActiveProcess,"PID",0x10001,0x0000fffe +HKCU,Software\Valve\Steam\ActiveProcess,"SteamClientDll",,"%16426%\Steam\steamclient.dll" +HKCU,Software\Valve\Steam\ActiveProcess,"SteamClientDll64",,"%16426%\Steam\steamclient64.dll" +HKCU,Software\Valve\Steam\ActiveProcess,"SteamPath",,"%16426%\Steam" +HKLM,Software\Wow6432Node\Valve\Steam,"InstallPath",,"%16422%\Steam" From 44cda99f5d668102af57d2bfbd9dabf194312d39 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 18 May 2020 14:20:30 -0500 Subject: [PATCH 0027/2542] HACK: steam: wine.inf: Associate the steam protocol with steam.exe. For 2K Launcher. CW-Bug-Id: 18912 --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 477ce436b704..74f186501271 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -342,6 +342,7 @@ HKCR,ftp\shell\open\command,,2,"""%11%\winebrowser.exe"" ""%1""" HKCR,http\shell\open\command,,2,"""%11%\winebrowser.exe"" ""%1""" HKCR,https\shell\open\command,,2,"""%11%\winebrowser.exe"" ""%1""" HKCR,mailto\shell\open\command,,2,"""%11%\winebrowser.exe"" ""%1""" +HKCR,steam\shell\open\command,,,"""%16426%\Steam\Steam.exe"" -- ""%1""" [ContentIndex] HKLM,System\CurrentControlSet\Control\ContentIndex\Language\Neutral,"WBreakerClass",,"{369647e0-17b0-11ce-9950-00aa004bbb1f}" From 5beb6c487dd070e712b50594aecf562817c2f67f Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Fri, 19 Jan 2018 14:01:07 -0600 Subject: [PATCH 0028/2542] HACK: proton: advapi32: Use steamuser as Wine username. --- dlls/advapi32/advapi.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/dlls/advapi32/advapi.c b/dlls/advapi32/advapi.c index 2284e92b2638..127cec572522 100644 --- a/dlls/advapi32/advapi.c +++ b/dlls/advapi32/advapi.c @@ -44,14 +44,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(advapi); */ BOOL WINAPI GetUserNameA( LPSTR name, LPDWORD size ) { - DWORD len = GetEnvironmentVariableA( "WINEUSERNAME", name, *size ); - BOOL ret; - - if (!len) return FALSE; - if ((ret = (len < *size))) len++; - else SetLastError( ERROR_INSUFFICIENT_BUFFER ); - *size = len; - return ret; + static const char steamuserA[] = {'s','t','e','a','m','u','s','e','r',0}; + if(*size < ARRAY_SIZE(steamuserA)){ + SetLastError( ERROR_INSUFFICIENT_BUFFER ); + *size = ARRAY_SIZE(steamuserA); + return FALSE; + } + memcpy(name, steamuserA, sizeof(steamuserA)); + *size = ARRAY_SIZE(steamuserA); + return TRUE; } /****************************************************************************** @@ -59,14 +60,15 @@ BOOL WINAPI GetUserNameA( LPSTR name, LPDWORD size ) */ BOOL WINAPI GetUserNameW( LPWSTR name, LPDWORD size ) { - DWORD len = GetEnvironmentVariableW( L"WINEUSERNAME", name, *size ); - BOOL ret; - - if (!len) return FALSE; - if ((ret = (len < *size))) len++; - else SetLastError( ERROR_INSUFFICIENT_BUFFER ); - *size = len; - return ret; + static const WCHAR steamuserW[] = {'s','t','e','a','m','u','s','e','r',0}; + if(*size < ARRAY_SIZE(steamuserW)){ + SetLastError( ERROR_INSUFFICIENT_BUFFER ); + *size = ARRAY_SIZE(steamuserW); + return FALSE; + } + memcpy(name, steamuserW, sizeof(steamuserW)); + *size = ARRAY_SIZE(steamuserW); + return TRUE; } /****************************************************************************** From fc5a4a843d140f2325d6531dbdec8cee4eb322e4 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Thu, 30 Sep 2021 19:44:00 +0200 Subject: [PATCH 0029/2542] HACK: proton: shell32: Never create links to the user's home dirs. --- dlls/shell32/shellpath.c | 178 --------------------------------------- 1 file changed, 178 deletions(-) diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index 0350453a466b..aee4b42ff193 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -2651,180 +2651,6 @@ static HRESULT _SHExpandEnvironmentStrings(LPCWSTR szSrc, LPWSTR szDest) return hr; } -static char *xdg_config; -static DWORD xdg_config_len; - -static BOOL WINAPI init_xdg_dirs( INIT_ONCE *once, void *param, void **context ) -{ - const WCHAR *var, *fmt = L"\\??\\unix%s/user-dirs.dirs"; - char *p; - WCHAR *name, *ptr; - HANDLE file; - DWORD len; - - if (!(var = _wgetenv( L"XDG_CONFIG_HOME" )) || var[0] != '/') - { - if (!(var = _wgetenv( L"WINEHOMEDIR" ))) return TRUE; - fmt = L"%s/.config/user-dirs.dirs"; - } - len = lstrlenW(var) + lstrlenW(fmt); - name = malloc( len * sizeof(WCHAR) ); - swprintf( name, len, fmt, var ); - name[1] = '\\'; /* change \??\ to \\?\ */ - for (ptr = name; *ptr; ptr++) if (*ptr == '/') *ptr = '\\'; - - file = CreateFileW( name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); - free( name ); - if (file != INVALID_HANDLE_VALUE) - { - len = GetFileSize( file, NULL ); - if (!(xdg_config = malloc( len + 1 ))) return TRUE; - if (!ReadFile( file, xdg_config, len, &xdg_config_len, NULL )) - { - free( xdg_config ); - xdg_config = NULL; - } - else - { - for (p = xdg_config; p < xdg_config + xdg_config_len; p++) if (*p == '\n') *p = 0; - *p = 0; /* append null to simplify string parsing */ - } - CloseHandle( file ); - } - return TRUE; -} - -static char *get_xdg_path( const char *var ) -{ - static INIT_ONCE once; - char *p, *ret = NULL; - int i; - - InitOnceExecuteOnce( &once, init_xdg_dirs, NULL, NULL ); - if (!xdg_config) return NULL; - - for (p = xdg_config; p < xdg_config + xdg_config_len; p += strlen(p) + 1) - { - while (*p == ' ' || *p == '\t') p++; - if (strncmp( p, var, strlen(var) )) continue; - p += strlen(var); - while (*p == ' ' || *p == '\t') p++; - if (*p != '=') continue; - p++; - while (*p == ' ' || *p == '\t') p++; - if (*p != '"') continue; - p++; - if (*p != '/' && strncmp( p, "$HOME/", 6 )) continue; - - if (!(ret = malloc( strlen(p) + 1 ))) break; - for (i = 0; *p && *p != '"'; i++, p++) - { - if (*p == '\\' && p[1]) p++; - ret[i] = *p; - } - ret[i] = 0; - if (*p != '"') - { - free( ret ); - ret = NULL; - } - break; - } - return ret; -} - -static BOOL link_folder( HANDLE mgr, const UNICODE_STRING *path, const char *link ) -{ - struct mountmgr_shell_folder *ioctl; - DWORD len = sizeof(*ioctl) + path->Length + strlen(link) + 1; - BOOL ret; - - if (!(ioctl = malloc( len ))) return FALSE; - ioctl->create_backup = FALSE; - ioctl->folder_offset = sizeof(*ioctl); - ioctl->folder_size = path->Length; - memcpy( (char *)ioctl + ioctl->folder_offset, path->Buffer, ioctl->folder_size ); - ioctl->symlink_offset = ioctl->folder_offset + ioctl->folder_size; - strcpy( (char *)ioctl + ioctl->symlink_offset, link ); - - ret = DeviceIoControl( mgr, IOCTL_MOUNTMGR_DEFINE_SHELL_FOLDER, ioctl, len, NULL, 0, NULL, NULL ); - free( ioctl ); - return ret; -} - -/****************************************************************************** - * create_link - * - * Sets up a symbolic link for one of the 'My Whatever' shell folders to point - * into the corresponding XDG directory. - */ -static void create_link( const WCHAR *path, const char *xdg_name, const char *default_name ) -{ - UNICODE_STRING nt_name; - char *target = NULL; - HANDLE mgr; - - if ((mgr = CreateFileW( MOUNTMGR_DOS_DEVICE_NAME, GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, - 0, 0 )) == INVALID_HANDLE_VALUE) - { - FIXME( "failed to connect to mount manager\n" ); - return; - } - - nt_name.Buffer = NULL; - if (!RtlDosPathNameToNtPathName_U( path, &nt_name, NULL, NULL )) goto done; - - if ((target = get_xdg_path( xdg_name ))) - { - if (link_folder( mgr, &nt_name, target )) goto done; - } - link_folder( mgr, &nt_name, default_name ); - -done: - RtlFreeUnicodeString( &nt_name ); - free( target ); - CloseHandle( mgr ); -} - -/****************************************************************************** - * _SHCreateSymbolicLink [Internal] - * - * Sets up a symbolic link for one of the special shell folders to point into - * the users home directory. - * - * PARAMS - * nFolder [I] CSIDL identifying the folder. - */ -static void _SHCreateSymbolicLink(int nFolder, const WCHAR *path) -{ - DWORD folder = nFolder & CSIDL_FOLDER_MASK; - - switch (folder) { - case CSIDL_PERSONAL: - create_link( path, "XDG_DOCUMENTS_DIR", "$HOME/Documents" ); - break; - case CSIDL_DESKTOPDIRECTORY: - create_link( path, "XDG_DESKTOP_DIR", "$HOME/Desktop" ); - break; - case CSIDL_MYPICTURES: - create_link( path, "XDG_PICTURES_DIR", "$HOME/Pictures" ); - break; - case CSIDL_MYVIDEO: - create_link( path, "XDG_VIDEOS_DIR", "$HOME/Movies" ); - break; - case CSIDL_MYMUSIC: - create_link( path, "XDG_MUSIC_DIR", "$HOME/Music" ); - break; - case CSIDL_DOWNLOADS: - create_link( path, "XDG_DOWNLOAD_DIR", "$HOME/Downloads" ); - break; - case CSIDL_TEMPLATES: - create_link( path, "XDG_TEMPLATES_DIR", "$HOME/Templates" ); - break; - } -} - /****************************************************************************** * SHGetFolderPathW [SHELL32.@] * @@ -3013,10 +2839,6 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW( goto end; } - /* create symbolic links rather than directories for specific - * user shell folders */ - _SHCreateSymbolicLink(folder, szBuildPath); - /* create directory/directories */ ret = SHCreateDirectoryExW(hwndOwner, szBuildPath, NULL); if (ret && ret != ERROR_ALREADY_EXISTS) From 0011334a4dc4e0ae86f170dd60ce8129f658b335 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Mon, 22 Jan 2018 14:35:51 -0600 Subject: [PATCH 0030/2542] HACK: proton: wineboot: Don't show "updating prefix" window. --- programs/wineboot/wineboot.c | 60 ------------------------------------ 1 file changed, 60 deletions(-) diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c index 1b04fd3b202e..fa33c6b50964 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c @@ -1476,64 +1476,6 @@ static BOOL start_services_process(void) return TRUE; } -static void set_wait_dialog_text( HWND hwnd, HWND text, const WCHAR *string ) -{ - RECT win_rect, old_rect, new_rect; - HDC hdc = GetDC( text ); - - GetClientRect( text, &old_rect ); - new_rect = old_rect; - SelectObject( hdc, (HFONT)SendMessageW( text, WM_GETFONT, 0, 0 )); - DrawTextW( hdc, string, -1, &new_rect, DT_CALCRECT | DT_EDITCONTROL | DT_WORDBREAK | DT_NOPREFIX ); - ReleaseDC( text, hdc ); - if (new_rect.bottom > old_rect.bottom) - { - GetWindowRect( hwnd, &win_rect ); - win_rect.bottom += new_rect.bottom - old_rect.bottom; - SetWindowPos( hwnd, 0, 0, 0, win_rect.right - win_rect.left, win_rect.bottom - win_rect.top, - SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER ); - SetWindowPos( text, 0, 0, 0, new_rect.right, new_rect.bottom, - SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER ); - } - SendMessageW( text, WM_SETTEXT, 0, (LPARAM)string ); -} - -static INT_PTR CALLBACK wait_dlgproc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) -{ - switch (msg) - { - case WM_INITDIALOG: - { - DWORD len, icon_size; - RECT rect; - WCHAR *buffer, text[1024]; - const WCHAR *name = (WCHAR *)lp; - HICON icon; - - GetClientRect( GetDlgItem( hwnd, IDC_WAITICON ), &rect ); - icon_size = min( rect.right, rect.bottom ); - icon = LoadImageW( 0, (LPCWSTR)IDI_WINLOGO, IMAGE_ICON, icon_size, icon_size, LR_SHARED ); - SendDlgItemMessageW( hwnd, IDC_WAITICON, STM_SETICON, (WPARAM)icon, 0 ); - SendDlgItemMessageW( hwnd, IDC_WAITTEXT, WM_GETTEXT, 1024, (LPARAM)text ); - len = lstrlenW(text) + lstrlenW(name) + 1; - buffer = malloc( len * sizeof(WCHAR) ); - swprintf( buffer, len, text, name ); - set_wait_dialog_text( hwnd, GetDlgItem( hwnd, IDC_WAITTEXT ), buffer ); - free( buffer ); - } - break; - } - return 0; -} - -static HWND show_wait_window(void) -{ - HWND hwnd = CreateDialogParamW( GetModuleHandleW(0), MAKEINTRESOURCEW(IDD_WAITDLG), 0, - wait_dlgproc, (LPARAM)prettyprint_configdir() ); - ShowWindow( hwnd, SW_SHOWNORMAL ); - return hwnd; -} - static HANDLE start_rundll32( const WCHAR *inf_path, const WCHAR *install, WORD machine ) { WCHAR app[MAX_PATH + ARRAY_SIZE(L"\\rundll32.exe" )]; @@ -1685,7 +1627,6 @@ static void update_wineprefix( BOOL force ) if ((process = start_rundll32( inf_path, L"PreInstall", IMAGE_FILE_MACHINE_TARGET_HOST ))) { - HWND hwnd = show_wait_window(); for (;;) { if (process) @@ -1706,7 +1647,6 @@ static void update_wineprefix( BOOL force ) process = start_rundll32( inf_path, L"Wow64Install", machines[count].Machine ); count++; } - DestroyWindow( hwnd ); } install_root_pnp_devices(); update_user_profile(); From ca561896b60fe2cb13df627aba6a5aec21dd0f00 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Wed, 28 Mar 2018 08:52:14 -0500 Subject: [PATCH 0031/2542] HACK: proton: user32: Replace Wine glass with generic window icon. --- dlls/user32/resources/oic_winlogo.ico | Bin 48230 -> 25214 bytes dlls/user32/resources/oic_winlogo.svg | 1296 ++----------------------- 2 files changed, 63 insertions(+), 1233 deletions(-) diff --git a/dlls/user32/resources/oic_winlogo.ico b/dlls/user32/resources/oic_winlogo.ico index ea183d07bf69e7b4cac5298de0e29b90e1e46abb..8cdda91509f8434ce6417d1bd4eb14584173f353 100644 GIT binary patch literal 25214 zcmeHPNsJsx75&vqx%Yi{ce{GEyX|f_%aOxKAb|!XE=XLt%-90v$bbZrTgFVo!HX;} zn$e6A!ys9+9ALl#qk+D`#S)9e*=sMhdtYpK+a0_YSy5e;nbD+ORoPu8zw|3I;{S;M zGcqDG{{Imr5|eVNs}rONIbI@iNhFysljEf#TPUjoLrhBKP)y|Y3Xw#@$aHnaG*{%sb~d)Q45O;YGGj!xS$sG zHB#iwwWgt*ysVR6e|}+JP2Ibv?h&VwsmZ66k%zqQ`iqb`GcyaE*~aO#>s0wHbXxG# zUtV5T4<09p5?2GyzcssA3s*>>+8TZ zwZ6u5U9BZim+LanP)1&N{f*5H_2kKu6h40PSo7%=*XcC!y6bN~eX2fq?Tdksyzcs2 zTU%=4)kGj9ue-i_PH@$~%=~lWWi$S>Nfl<%INnJwf~=eQp25qDfc8?5c8zf_nB#)^ zEO@Shc_ElHf_@h~Q^EWe%y+@K7mOXj^AwDI!I%+ruV8+H2las%LnvPpj7OBu2Q8#vg` zd}DoUYil2{wZ4)0SUg@@x_^IZX*?cdzH{hkWliOwn#!X?oy;c&5A=_Yc8~TS7)&rf z+|t?E*$eD!8D_qzwz;FWs;ai5xweV*Tqa~+D*zaD(0e} z5@_rdAlKU(u*No!>wYrry3=I;Id@lIZ~D)<>)zfdZ+gOvgXhibal|o2FyqR}1|guFA7#&*bji zyLzo<)>l(gQ*!RyIlacZ^2XQo8jEYIrKKe~fBw8|Y;4G_TetMu>M7P%H$Ht|KKbb} zIeq$cYJK(DyFb(Gs2iXDO0InWRlT0#8j9TOD?Ch+gYxEoSK-2?!zXz(?cL2D8 z+WS+>B+o@Z+(qrxeO9OrL~pW!uHRE^g&wwFpIWwgF6v2-RazlNdUI-(=ecMmy|mv7 zrKES1SfPXT@-i!wYkHRzG(FK{g#_!@#;j0FdT+B8dP#5WutFp0MF}euk=~N|rA^PZ zXnLa+G(Fy8g*fZ)-vLOkXzjK@YlWuMB=84^-ev`dUUR?#HJaX7VFmVI!w%D{y&>!O zgIO<(@8UXz&g1U@&3b%1ZJiRNt_?Fzcb4UL6(Peq~@S(Pwubux<%69(i zm7nXF1mh5A&z{w`^YrwzjzQ3V{`a3hl7IZ^sK=3xiXHyipm5OP-@*TuN$Pj_tAavvvWXW3dn_B{s1UUH|C)U!CUPsiC0S=i~5tdD+l_pixk#%&Yib~frdS9|TZ0t&SO z6F~0&9m*53?F5jrD3j1QF){I5#FkZ1)^5LsgVW6LUo)_SmhcJ+`-1pD34*DF0IZu(t zl(O9Nc~*k+A`GM~w|t(v*gg+p&V}SBr7X96_|x@y6^@O3BW3x?=eP(1{p4fco^uWc z&xX$@pGaBm`$ybDQLiwNvfT2qPf@Wv45Tc#e4h1Tc^F7pZuztuZv6gzh5eNIMaUrd z$;X~f6$aYmV~?o{18wqu`NlUC_Oj*`DZ?$FwgAUOSU_1x`$Mn)FI~Fy8;pl7j){

{LmytS97wSaas3Udd{cu-C?Wt3zeu4MSW=QXt ztlwqS_2kKu6Vx5p#5`@(FnmP0kU?Fc^9FSX*0A5%ZWunMT*yfCQ*mB|?x)K39@6xu z`jP%2`8UmTds+J*XR}lxpkM#f#}bB*H5W2=+fSRVKiJRD%CfNhyxGd})1SUu?9nU; z^z$=^>F4J6KO6MZpFYBj|ISJMUyk2@=*5ze|(eQ-!T3B*~Sz6;sh+ip5uZ* zKmF<3&3AkwSMA&46#D;~%>Op+;nXkA!Ll%7EV+>3r$1vSTvrqV`o(#|j5B2$&+^kh z%s5rHu`s_l7t8ovD+Kh@Kg>8?w(&r}I3LUST_^)=KcnX{c$c;6$0Ay$N5}U2x!wE=Y>@vpiO_Al~#p-HvMrvTNMJ@ z^ndreUsdnC{^dQ5)X}X!&bs5XzM;zt;fHH9>TLXn7cN}*3GxLKzozaNFJAny(LYL~ e9(d6naOSJ`ywf-v%;FqXRNv{pNhCX+C;Klcd1NyH literal 48230 zcmeFa2|U)z_c%V!W8bobDA_`kBB@kDddgmiQX!HevLsouJobIdzGPpMJ!B`M2$c$v zC3`Acg)GniJaxOb+wI=_{r-R7`}usnuh)0(J!U&IbI#0}nKNhR{e%z(Q6o`N1U@Co zT!Tc3zvofGvClnkNjn19Bfs&K%qYFki(6i3x z$j|pFa&rkoxrO@1AQndH5qyPB_bi=E$Euf4Rp7n3@IG(Mq#1v(CwUA zL`zkLs3|U@(TOo+a6TDD#l|2HZ%;&y4Mg&n?B{<2AreDWQeKJzLxPZl?I=o2ss{XSgh=gCNm)BuSXxAtHC4#X?IrNnH1 zh(Q9IyAhuNA9_DCg$j#{5WnCEQc|iyhvghlKyV=N)`-rZe}Z<4HK4%27?hfkhU65- zP*6Z3@c0y|AA5)t6+O`W=LJ+zU5T7s@yOG?73gtA$B#cpPoH-nLxX7GJq($d4xov* zZ%|HtE^=_lLA+c6sG;dTs;+&7c=>!$+|3l^?>_=%@1mZ*UX+jwZJ@Kr#55cFFCD^l zX!heA(l_Wr>KeykCf!Br*m}^T$89Ji>;~GtEfn1djY7j?BhYtQ$khBYs;qp7?iLRM zoo>j@(;e!FM=42AchU%YH~k*Dxu&7RxHeR9rw|Ej@&=yr0jCV;J&8yld|JyN)m6Vi zRn>FoLCZsQ{(>P|%lI1gy&ga*>8a>O&=ib!CMvJ0Kg*NL^@!b*_x67!dy%i0O4x@eh z&5(+UH?p=aLAqzNQE*Tps;;YnzIYDx2O@h1n8YX&J@4#AlT+_dUQq!mC@e)y%@2@Y zpg-CwFodcq7Xasfy_5Xa{TEn~53PegZ< z24($C0i}J`nRU@-luy|#Ux>db_B--7_>!Xx&k9?*{k*O=iX|NouY2(~_y|Z&%`7yV z*zP%zbm|uU-=P!PBX-Y$T-}MkW%j$i*xvqKLz($J{@pNU~no$Rr!}-0&!#J!I`4vVTmFyc~YUc!(JaTsKVF z-FNfH{2$_y22V)H)0+l|pozQBuSYgy{ebX8G~=<{#r^wB_#Q$VOtPiP1x`O8{5~rA zQd|3Mk-szv`7s}jfT29*^(KEg3~RNu?No{cnbgxPM>c?_*oFwfj_x zaS3uGp)F(>&TbHJ-&G;F^H7GQB;#M> zw~Q1X*(am(LfFXpUQEo>7*U{tK)k+_MlNFdpZP!H|5^M;{{JriYyW(s z`&&N|z!7=)>I=fC{dP`;!z(!aSMN(0j<>%$XJ=<(IfxU%8P(R-{+joX1&Fhp@p~%1 zw#4{#&N2SbE=HY~_e;(XB{00a{F=lvKc)k|8p5#rn2s1(c-2^-`$oa<{Xab~l@Jr6&A1Y$RLAylv1JBF{)xM_x(7>3;L4|Fo|@~aU$^vAJb;^kH62dDW5e8^B&*W~B< z9sLOKiRgd82l@X}K>c@Yfy_ekmjXXY|5D_q=|Iv?)1j_Eq<@)>nm?u^7MOT|{sUV; z5DT%ukHZd3{`tK7eGmLe?AvFQ>oXV0D? zbMvR@#EHi!Dk=)XJ!o=r5=lwfLfIsgmzRga!;8?FGp)$pz6#QAAq|ai6dhdx_MHIq z>eVZB`m{gt^^Jo(1N7m;2Q)AUcB!;fh?}CjckhCo%>if#MeXgx)4LPGU|djmWCYY3 zjc~YJur1w%wxdyGY&7cX>Oy&7D@8~Fd3Z#kxWoiBH8q7AA2uOI#%E~v?krSPRD>ug z6Hs$=GvJ+v_6E@)Kxvsk9>S?px)kIz)u7lZ3-$aEk(-8kI{`AH&A+d7BVxd zMW9up%&aUF77>o{ZZ0S}xf$Kcxec_$LK~CF!lDaxc6LJDvFQE#_h{d~eUMiIwsLz! zO&yLNK75EIr4FFP)Ksv&g3%jYK%}H6!A={DY;61h-T__)N`?I3@K7{AKMy#z=;qBf z6dD2cZ00EB?B(xp_CkdS~9Qj*c^>?|rNDM9k`T~PiaN&&lSNJt3uGuTQo&(ZMkFv`r#ggjRO zKNJ%a19bHvPd^{@?%g{S7k?9pi4{TK3FP8ZguK0DAzTMG+aMGO5FJgl!CIn6kDj5l zjC539UXJ$et@&anjgIa|pW z1?o1RG76$Z2qU`K!bo8hn;6$Q(_wGU8bO9YNpznzDE(^x%CW?zA zh6};Ynuw;Sr_r4|cYxj|Nc*34nE!?|)VoX;qUmV(^CE`!2gA>7lG$^(Y{ySAI>p?a zJ;$F!Kc}K9|5*)&*CaTl6-_VZJ$3(Sc?`zzp?_@4?iB4m$tG4>uJ*I4e@nC6_*?jA zq3p_^rT&&Cocde%C!w7;bqary{A-e~>t=^vBYzBJ)(Q%$^ZhaXmy}TzCz6sH?xTN# zaBsuDt7FM~t=bO#6rqZmlf!aukn_sewOw0W~cs$K=CYhotH%w zzilM`l05Yv@(ruSRXMm4s-(<=U!>C|{b7gtH~X^!mHwEIp}BB4AY6|0*s%eV)}Lf!A}-i;O;Gu) zah4O4{aLTtO48-P>W?+!x5qnG$^CoI6m9Xj+|2{_C_ zzWA>-U~t6K;BRp_q!ABezgF@RmmHiX0NRd18E_}f$QT3R;4eBHCFLE^d;L)N%Wj0lUP6&EiC=Wteft9;90fX49x5#_ zLq#QbzMLuUH#Ne0hfK(eMxQ=?LgCSIUvze&ju;dcgX-@$!2NtW+&f32V7L#DjZHvJ zO-(2QbVs7joDAoJP|%x+=Z?I>0+a}PC>>q!7ag{$rW$y2fxGJvI4>k1U${TcFDwK- zEEnC*&4KqEaX@1t=vS4XqY-tp|8xJ>1OLH2KrOAnf>r;OKmi_BDHS0N#a|P4uH8X< zg#Fhj1on`9A45oj`S)?Pt-p(J$NcU(mR$4%1rz_T7~*Ujw@Fg{cK3lhO0UGQnPbg2 zgne4;`A%+Gr}-_;C`@`>Rrc_23-j*1o0K_uzhxsNM!D;dyvT3yV>J8eNDlrMM>2wf za$lnhTnJ6mBSiF9oqvO6>91+TyzhaC_YH_RM1A77b@r=1f&Z?h?{|y;H+|xpotB0F z>z0LK`NfJxruwzLZ+rhYpZP1tm|u2WX567K3Czr2cieA23;$Q6B<7c`4fD&6`OW{T zf&5SOlPJ)s2S9vh_r>vj_5SbgPkVs)Sb!+R;sCn*z0)5M^0|81FoJP@7;a8KD&8)F1dKPPdU1}ytZ|8Xfri8i&H&* z+!)G80?9i8sQ+E0)6&vzF)=f};p*u=1v)_=ynTFlr}$1?eM3W2%cGW7u$4Ur+tkbF zFP`^2?dW&~_PAcK1NBA4MvuFCc}x?_Qd3hC$K)?xN&Hj%**Mr|g-1trHa&cp`{>c5 z?83rAFe60=;_-NIOG`^{0|Nsh1lZWvM0tCAr-1#b1Z;e5VEcOyw$%5a4^3RPwaEqg zX#Oc0|Eyj(nqk1+^`W)BJw$H%!^^A*) z%aog&+Z-+!uE6ESwauG1Uk96CHrT#CfPBpp>-w{H{>gL?U#|jqPg)E%KxgPz%gD$` zV=F5w9YsaO6EGi4K(6Lp0FJ4v+n+db!phOn(F^RBNzb1@ZvY$cOwGO8UN;|4qM`EN z;(UC3=sbLVVtoVr-=$_{+-YoT3LPIGcL)2c-~FbhVtXft&t{euOE<#8y1)kiI4CIS zNkC9QhhKnyH`r2VV1CCE>-e`2|6QX%0|$)71(2r{fPR1lu%|EL-Q8C09356bjy_vh zTP>Pen2j2l7#CeMF}5L=`L2rpxS+eQ*C|gQ?^!o5k690IZ>|400{?~}4?k}$FF)TI zcQ4Nw;N|4sp#R5Zd-{4C!@T$eWAM?_&->zk9D#pBke8p2Gu(Bo`1<>;K-lqb(EsDI zz5IRCL&L)ezyks1^IyJd`;Q|Y2=Wf_e-?N1CLt_5oZ#i}L%az4U*q6TkpkxKLV89z z;bwe1!PD1g0dxxT|1Au-`FY{I{e5R)KPChR2NPf~nDOxOIrP7UetRd!atlk#)qsEi zf`^9(0luqPwROA>A3*%)J5OKV1MXg4ixCkw2>}5S1b_cj*S7bp$%PhXe_UP68f326Lf};O!l;6`^ zNQ5f@_5iK`J^;Z0L|$S65@3!O60))$uRvXI{*_|@{iWpY4j+&L?L<&kb|xexRRaC# zgwv;qbgBSo0_Xr30$c{T3UD331;7))7a$Pi=n?D@q3=N!f3rXT)>Z#V2-(qS$1w}q#)23{Yp;Y3&OnmV4FLA`NR#32o{&OX) zTbBX!PXPU|q5pdbXU;r_^{4@$1@fN)bisPrN1&n_gn2zoSigRRz{fXC5ELAQb?PNy z-@Z1`Gjf5~f1Uh5TPFJY&VwM&b6Bh!p`v0K=kF7-Xgl=&k}F?!Aow4*`gK zaO*EXjmsV$<%<_C z6fDuv1;E!7#QiHAfVhVdWj<;Zg9%^4VuKbin1DqLCUAv{%Ci@bzf}ja(*<=Z|EuVS zxwaMPCq8Z@I@0Os+1SCs(YvLk4@>?0ZdYvIZkjC%`IEDXm8uLO&`EeL`38wfDwc*h>D7y2b*;Y^!@z5 za{nUs5cGe0XlN+$t_3YGFKfeF)^xCa2Em(LdwAD*YQu&Nd%^B33!uQq$9D|)&=3+5 z(h?LDJpButl9!j)OG-*ghW`JTpYLJ3lK{>U=?D9_H1LoD?>K$?`ueWI+h!f0UxbZ~ zZTH5F8xO!(90L2fJlM~bh+{$o2rKLB>uW7d^Z z0R2tGHi33{a7IW3aD};G1n;y}uUxqz0C!xRaHqjfyyL)2F$B_ft?u8?pSq!$I4z@aCOJ_Z5KK0Bx(Qt8c(x0U$tl9^hMeVP$1y z80L8s%#$=2qbtzw*P)K+e+TWvHlhEl;hT+VSohoEO?zKfR@Mi2TRsEt{d<9~M*#J| zz$2jb6@0red;9k75AgQCAKr^Sg|bsHepdf3`hm9d(EbYS13tw04DaWOvhtUXh(p9B zmVxrbvzNhN7WfA<;hO*&py3_B5P$R-N>|_}}vX%ioI=AKen`{4;-n>udfupZJ)U zh);ZMOZ0zuock+XzkJWW{9pWD{71Z%U&^iENu-JGtTYk6`t85>SKA5B#QZ<_Q@^Cw zl6=YkLMxG8>1D!~F#Ysb{~I3!aK!wtzK`lrIXdd~#5I6UK^_O^DdLoZ7sSNd9_=fc z7r-OEcu?gaLIpuI%lbq^AGd+LI(*eo6oS80a6p1`nESp=Ab$QxZXh zJY54UFSQD|gBrFk-&NT~ah$ZksCJP1*O5=@8JvkQ-L}a%^~ocnPw{=X zO!khgKG8e?Z!&fs@O$=jyt3UY{?Wp`6<1=Y6Hm`jk#*$Nh6V9ESq-u&!UJ zU}jyXh>r61Iulm5ZfiN+x_62^|A=B4b?rXh(?V%)v5!a7PN0`N?vib&MHc#roCFiL0OWjvWg!`miDtmPnddxA3X7rj>$%LIh1; z;4N2HT-=Saj`Vl#z^$n*!hP5zG_rQab~)N4x2)0ZgUZcYs@TV<*QVbw+k=4%P3xmP zGClFn@$1QWn`wCB4gDQMcYHEWSZLVXxZd$t22&W~*bEAb5hw>-tg^kbxG{O5=S6v* zXnHH}=ST1q#;sXX;*+Y#;Ep55j?tT3zFZY<<&+&(So~z(su1rjVA}J(Y$83jWY1^a z2r;PaP_K2TPUMxg8j3{65WhB(aSGAl!~IREVQX>X+tcEL)sKoc&en}ew%Ik7T&BQ# z-#=%JhZ~R z^Nz5~Va)csOX84Zg3KG8>A^i&Qtep>D>T-0EMjP1c(R3CCV6 zV5)5@x!m)~CScW3iB1s(VoJ>WokGKA+w1{-&Dtj^h%-{XS}@IF!gGUJl<9{lEz@4R zv70&tT5lzJ8pv>0v%+Ru(Y`m1%DAfmljZ%VeB0C2RI&LF?#{LCuMk(+uZT1CY~eu1 zunXjjD;AS4a#jMWr;g|^eR>y*(cb31;E3{KN6IiV?LfxrttazU8WzI#em9>&pE(P; zXMSV~QV^2PoBSM^SM}+oY0A_`TnakPx6qkqO1@O@>&;pIzI@Wj&-;AJ)C}%^ll1Bg6>{!_Q+7vR->NX4roNLw?PSW7 zm5}~!D<%EF>6G{S@J6M!39_V%2b6bzmWpHw zBg=oloh&4@X{#M}T8h`czX}FKMsYDOZjNic=gfy)o!X)19~}2k_mr9+V|>D|-fW{N z)W6kT>p;gxTq-&HHr_BKES4Jf@y?<-UvjJm!=Bi5WApy%m6PhtXXS;Q>)5XAXOWYo zgrEsigqqxH`NAqWmpUO>AxqR&SoikWW+N zZzA2p#<*7p(aM=pvzwPbn8(rCys|z?G3Kxf--^2`fbXQ_(H(lXr}NC3F^=3x&!U7L z7=p;}ep zCkOZpOs`zMD*mdYW9ZR*i@m+QKlIcIA;S#@w>1^J1>B7`C!Yu#=+hoDo z59o*EhL-2r<#MtiNU$U3&`V{4PIP28lzxsS9&4*BnFtDVS52s|(5 z)7PgfxiH|S*-6cFqTiyP&aH_sv+Y18TP?4vmD529B##?^E3B!dqoZ^8ZDEVWL|SBX zQWDRHj~|~5)_d&`6T>z|+wdP)$5&AM(ykzJa^JrF`wK2T-*VN)#^B?d=hL2>!k#>5 zdG~(p6Fb3HTx!0IAVv#E$aS;KuWM)^eL5kYo}QlUFc3h)s@RymI zZ1~Dv;@>$tV!-dPR)lr0Hg((Ht2%PRtcN5yVFYC0f3awsShVm|hPn`Zii@8sCs_^| zfBUv!K+n)n#9hKU{=SfVBB`FGrLM%LXyy0V>6k_4BRC^to#w@D6LV<34zMoNxipsKW!`;npxU<+uQB`G*MWo1e&^M>gqr208p4tRvS?(#m|wHtS7Wp? zE+_pmZF1j!ivgMU(u6tbv&0#sjRy7Zd7${%ITb+-J%wr`x_gHQX@y4eE`COgDtf0G zmfOeC3z9DX8*HZJ`IuTo)S~vrP|L==e27fQ@Py)CK6kdYvi|!5JI)HT(nqIv@7cG{ zexaa=bHBqY>&}3sNH3{2%s>j)iqTF+_A>3j%}i7;^Ysrk&5pDLDGJRqK4E8UKhw%^ zhbW<>@9TujZ1=T6>Hs zE${#ne}P_Kb->dYlHM9~!jcCAd!8vlVr$yfv@km!T%Yx;+d~q^1BZr9d)i{tqg&65 zt%c)tO8-LRp2q6=swoyV_T#*X&%(x1ii?ZyjVNbyj3m$_PyL3CO;64huoYd7wQQTX zM9K*_wsA=4p@P}(1=UrbEF^&H<^-{rlQ9o8I-dh>&q-a9_E?2~R+yR{N@O4Z`hrRF0KnWFrV24hWe zF^jt5tj~6L!L|Ewt7UgY6;M~Hc|wK#$4dd;Q9}~KtbS^eoShlz>AIIL-8#(@pdfUX zV&G!ao9LU=up?0htLrj9$$s}3G>1K^7a3dBK8plCWI8o*HKuBLwnZNkr9z8m8Wi%K z?z4O~Odp@OYwOcIr;l65ZYXVk;_cmCqJr+~v!xop)E6>z@n%X2(kA6cG_KG?h;iEk zf}GL9^trl1;pPiPz1BMO75yu@ZcGywi?Ob$^UAi=Oj0tV4-B}9({Vv;B0LzqslF<) z*w*HV2v!x!gR+!YbRzT4lx`1sc>bDE%%{fg_=8o{SKQJ7+yYq3N0hl8%23Qkx&?p*o3Ttf^qwMQcNgF{|x z$}ZltjuBha5u*KQm))KB}`q;ZVYQB2mo#k>xBnRx^ zGNO&!eWOSo7YI*wS_xjL!w!^hR}gwAu5zJgcag9k3pLq=7=i0E_t#}F6B47jre{np z4?6GW3_AI2IVlQZJ3SfO{Cr6sY))`^T0Yynbyt(6w^f_C$|l~|Gq#m`-q=i*J25J* zO%;4Z0y5^k{=#@*tajK z-eZJ38at;9&{Ksu)UcwFYh=h3J1(_mlhs=5T+u0gJ9jGp^PjXWc@cj~r(F&c4NERhW^DjuY}4CFKl1H_RVS1jeMxa+T7J3qwK} zvx|$vi|^dgSp1M=FuFJgbEaUrSg^Pv(g5SBFIq1OBCg!|QO^`FxA=K*>Xv1ol2CX2 zf$P+PL*wd-t=2kg@M}W^(t0<}u<6d%lF*M^Ib5aY1V)jp_Z}Ws*kalaqw=wts^RkO z-6gHAyaVQLvXA@w&8c{9Jy<8;B+N>~bi+%&{i@EG)F55GVCXJh(Fe)$d6WC-(*<`- zx7fk<&(UekNj&j6RzqW6&lwVb*rz4;2=LvSo-yhK?Y8^Js=mds5WiMS|3# zPN!k+YpZqAi6{o3Zz-bp+h?_FsD|Xg~a+)oyeOmSQGZQ68Mf;?&gj3sqCw z(XJR$w^8RDJv|9fU<7g;p4!lPdV2bTdhEAU6S<>NJ?oi;Kxo!__VE>ZE2{D>wyLbP z_Zaw5`=<{d9vL#?%gJgtyY(wHZg!SoUY>ijmTdX$Md_mYUC#N9^X)vUJrtJ~AxS!1n1SF(h|f<>MA8b00t?>i+Wy9L}O*qpZClCE7&BGrqZzEr*k zH{5=Inc@vIo_oS=v_=G5a(QRoZjm!s_>7}%dRmlBfitM-6!Xl1n!Y{lZn^kl_UXp! z>6xUIPZQRwbVNnoO~AS`Rt9?I&9_`%9Eqfve&j5aHu@@iRN`p3b(%eC8FI~;atC2{I(AjUQ|?+xX7wj<{$cyv0qE)%@(B5{@2 zc5l$F67n?^g%0AbSXeynEi_be4VQ_tQcP2qE9y2~m^**!#Uw`3ftE1EPsNYsaCAj; zwI4grI$vFL|Jida!)}6G6HenA2CMM0q*d2;kgR3$#$@UIPTRTzXBlKkFQP5`s5}(7 zy2u}LzU9-9S|eTf*ius(wUvE{&mqM_7u*|djg6$@@!rws&hV_edvEx|^S6$Wi#2YC z<$f=mvzOJ1W%wBn>~9i#@#w19txq-_UW;dh`2DWXnD#_O82W&sUWTzspsg3QS*E&% zo%P{T>p5x7^i-UV@)TNar$B9smD>=UKTq0^G=o09u5WpCk5wM~+P*2h+{yPH;_rG@ z+08TODwwgVSW$Y(=~|L<;}}g7M9K4JH{rlDT682tI%;5X86>{RGWG0IMebH_Z%;3; zR`f9X?Bu4$%xrf^MM-9=Vye&S!cQ-8FWqL9sXBmRHyE)3wWCP5<;IL{-1T<%$?`S4 zZ%8c6GM76!g9uJppbw6@I7m6~=4EX^@4s>>@bKYsRK&;?AI&)e${>v2+v&mj3)~M* zKCx^HYM^klbP;qYBde9mH((fxvuxXIa66eKn89^vta6)yzoqn|T~XYSZfF0MZjfKH zMz+no0XrH~!z81X1CL0S?3(X)CNv+Z*|2#-7R|{)RqcX zxc0Imtmkn*f;(+xHHT~1sZ-;)^r^ek;H2Q8GGs++@V22D4Z8!I~u*y6hrl-Ut;c|T$T`?!|ivraN%O+K%jasc#vWnXsp5qdC zapCe69$V{BDcewExhcrW9cb_l;(PW4sT@6egvEvj&&5@<=k>5B6TU2^nXoyzZ-d!g z{VRbZSG`O=>g8}9UJ#t)>Zm)&k47YwO41BgG@e-X`Z;xx{9&wXwWg z{9L64Y9|>Vd|p~oImN!Pb$)<`ynh*=u;)Red9O%m`%))q@~66S-TaLSc57|I_G1^D z>iV2+uh$&&_Vzl>+FbV#E|4TE%P^JO%#DqGPP1LD-)PhOM5B`{DNz`|_w_EdX!YjE zF;#M~)zOqLd3kV~l06b2?_+*>t|@RM%XXRklKGYEq_;87e#TtV<4nN}$<0iZeP?}2 zSyrVLgjTrq8PwEj3t70`r&m_>R8^^Y_zY;}0y%aZaN%y-yQ5JsTKNKeVwWACr_Xlr z9H&`#79~HjIuwSK`-p}SYo~Zs-}8BMJ6&Z(kI$b?80M$Z*7!)T=U*qTauN2yj}N&% zt+=_*`)mxvJi;wAOtj2%a9{UeL*7iTTNe1{RS!CyW%xAJf0moKk!@=QFPJlq_kA3k zvZV_{&&Z%9eAw)5@5-B2g7@+qw|+*rk62RF$i~s+!|ax?bvL&qkn_N4Z*J#svVo}- zSbp4GrOL2&nho=FD~<`%Qcv7kUHW!Z_N()g)}7``@;OM7%#C?aP_Uy@TxCzRa-&0b z#<2ARamHc~-`vj$%*mk9m}M3sHiL>c%cgdWM|n@LeLqd2@d=AdyfzUM6#cg$IL%Wbg#H{`1?leI@6d zuUvVmED);DzJ;5YSEZv-r}J{`J7;xoPipK7s;M-oopB=WwrOp=%}Q1t+wh4&T)D4S z*6*KoG_>KaJaBbfl}Fi0nF2Y^QjplO9F!qwbB{OqcwbMqS(IelA(B85WI~EsFx3{+ zWTacME>6*_RSb;qnr5eu;N5&7IOM1)2#AZwgTJFadPH9@4~3 zYy%{>I(uozSC*}GRgMkj)=b|fsi{{EUaq68cJ?<;rbr>w2}))kUaqwx?je-edCEt; z587NiDROVBF?)Ll`TH}w-jl&ehAXo0#?Oz!F*Ms!@DcS0_8FCsVd|-g^7p1#Ro#$v zsA}%!l(v`Z<1K<%%7sNW6}N+PFX^evb6b=x-a zL`rLx(3V$tys_?-Y?5Yr&15;tXw5pBU_ooD?TL4k*($H&ctalG!df~eK1?9peQkLU z6(|fb&!~8CVW*<2W*RpvU0gKEr#~<`KCU$xE~nPRog9O8b0n}E7}DrFI8>_AFJA2V zT8AWgXCBR{jOfT#Wt>^lBT;zTc{(Sz)5+tF~hyZboJyiCFy$u)A#B=ZZD;EeIZlEQcF+kd1-~3hMQqLy9JwB5RT(3 z>b`AqDk4^%kG7xsvA7C)faEoqIi8$LQKjQYA2;1PlGU_)v2NQ~ zFRB{H;5I7puEqBYoC?N8=n0ERw3o$=nKoW=or}wvv^;g#csNK1H6_cQT{OEDWh zI~H@PCk`FUR|xh_O;{c>-EG1j`cNYL5n0WMzIwz9Ey{>2Vf;S0u5r?ME{GF9P9x(n zF=cM8Gqq+9hI|{QM?B!|g6)<)yI*KTMaho}2*k8Le8{>pRN>U|W*A(NSi1dJUbOycR{xizLyW@?` zI1`M_;u&;vIBj){FFDzsQNW3XK8$LK*k(fWVXIz&mas|8g@wh0S9ed247)Jl_gReH zw7JG}jy?ZW4BD#fEN$6#5(7UQDZB4g+(xcrqm7L*MMFbb5PcIRU?b_eKZ2}N>0U{T zhiCXJ{G@hpiv!GSlTFe z>k?rPYUwO4sdij`oJ2!&{P;tlWmt>Vs`7Miv9OHyE&9&Tx7uqMk`*uK*A5w+@C+-s z(9zp}1n3^9s4`+ydpn77tLm!?$n-hcvYRI(DqbdE`9(IfOv!AXt z2L#m@+`iI&SMUbuyjv4(+DyH^D+nE{^6C*9@<_1@w#oVSS7vX_eO~fl_oMUQv+Ld7 zuI{oq3%MqIm^$YH`#Y3*rOEwoqvZK`J5M~bb|eAi8a5hhy!Y-SR}Bx?x9;lHP*GXo z9N-{dX2eX9Jl^QgUGXApA9}%yTj*8x(YI&zkBgDrib(K*PZKUBKGR&&S3qEY)iPJn zu{cuZ($CO4|L!7H?M&NV7squS$>JU6v0nK6(Q}q6Rt0x2tSl__n5t~pU~Fuc6;!Ye zo3jB8(8xSbcGHTRptH`F;1ejYp3 zjalAB(iZ=2j?FlqyEgO5(PHiPgd#QQEbnB;`(Z21i9$IQkYCX}PT#Q?iS+&D( zNtE35iTJ1PPILL3@*Mk~bqgDACa1`F8?b@?u8xjzo83{$Cmf$&(#qh>0SD z)2IwwnQBP%b8Il7JJRRU9C?Q-t+=LKb#~B)@^bdcNGi^1sVy(*HJG+FQ!^YtZvA}K zPl$AI<+NSMq_f;xic$`lt%@u5CzH?foJYz@%uJSleD9w-zwNcHig{fF<|z6 zW?V22T4M)A$wfW+#_*FT9Ba~zp<+Z21n<(%?DIAU)U^760CLNbdi|yr$kEb z;2`!uw}kL`^y~^tU^oNX*vmi!LvZeyORs6oHc~w5Dfgl$@eh}pBE#M=vROPQ#M!+ zdhXeoC8-L8(dq5Mw+b$16w9wWySwU=HS?kg6^SbQib(%D#Z~D;m!D+K+a}2}^wIZU zv`Bbusk%i|v9&c(gIe#l@)dTzs-ZBSvwi#4xDVCd5oWHuAT7;pgrh|G-Ga~Hx}y6D zYa1msQe|>EAh>HW$FuXTm*Tzqo3!!MGuk;=#%aPN3;uro8qs>zY5Bev%pTQdyt@OeQ4 z8-*w)kt8iWn>pPlDPv0o(=$-UlXsG{k@JlO$3;@68V3iGkjp5g)w&Ck)pAe_OK|5I zJWf7M5$CpRk6Y;-e44u6wrz={7xG`6P*tMI%%TcY43|$(mZer(-zVJg!HMqPCYev% zgK3u!*)|=Q3wk{svMGvfy(keG>9gV|2*;z~WJ>G+!O^*$FZ@H% zQ$cITchff_luxj57`~5ew_GDeE8mDZ$>tt%`C&LQy(29yR_$b+*7-8CWO(l_CCVL& zBM}$+wuPMTsEvt{i6MW{tNq!*YG;&w*eqQN&a4g7{*0Vab-nMImlQ}S<9P6L?ir>G z?!lGyeI*$_Q&T;=qlRRn1kyi$7Jb>{H|R#8f1zmP;#Q>_bqPL#o{=I z0Uy%4`e6^a`s|mO3yvjegl8CY>rja2+{rUWV`$89hoB#x;2^uJ$~-(w!MtZA=g#HY z9>pHd{L9R8ay!bLrH@>D-|*zXb-i_dED;I|>@*$1Yn|_z(0R+8N$F4eLXt~Z;jPWl zCa2isvdHxIZlU<}jEQ7h2;T38phV_}rLD@=$xLM^Unb{tyi7x$BSxO*miHNfvQqwI zv=2lTANJGh9It*MifSrlsuR}r-dl%F#5pu!B+nhk51c>6az=|aPMN%{Pd9b`{e8ID zVS80X;Smzzd$I9?U3#)AzLo8WkKRu5ZKu&QEYD6bfxZ>J$9`|pLLFI9@+&27vd|A> z>+-;g*9&qjx#4?dW|!_AqBK%>RXP>lkfI%bv5y4*!9@NnhwFvAXSaH_d6ZIegog2} zQN_&igmUJdQLt|(;}%lF4s@=@PfewEh+e-QB5i@9tEH4bebm2Ox^A)Ft0mW;pv-nD z^nimTSz@R4lfhFcuHf`GMsns$vOrJf`t!UT8I>Yxv-26MZ*IK|oOoYb`$5UXP)z<# zNrdz|_U9C;%wT<2+PQN2#6*Smx?raAuo0(Of6AdnN!m7jd8&>0?fmDExDZb&>72Zv zX1&K|>}nG-T1(q#qEJA|Vxc zZ(Q){$_ktGRm$#qFa2XjU+`V2I#2(e>tNQIenwQ2WjsFn8Hw^v8__@q(t`1H|1Di^ z_9r76$$Z%3eH6=#m#f*dqMuTqP^+4_6ykU^44;NN?Ev=Qcj zTsRqADjd`jBwIaFNneVh;^G<#A6xHaOgZ6n7||lr4Y`*O4bSE8*qJnXdZ_J0qqg#= zvR*k%t(pkk_4W?wJhD$iGZK~e4>oTispsb9M_=S7)83^QPb0d)H0(3Q+rCnIlkL@a z-!91&FOqz;X`ETYaEKIgWs5=XQDt)V?N<-v&2*2pwcVJSI)wqXG))65N>mvGZ^iR# z7z{jAX6vdb)sAv|>NnM%zab8ry}XgJhnlJEy=&{_kb)CM_|BD7HQwtyuRlkh)^uHJ zefLgt4*P75AfybI^0yCChMz{(1(coKBKPTSmfd!V=hsBZGN@^S7K$YI@QIm$c3tLl zByl*lCo}HD&aumLePx-~b26xQz0nG40tFgF(|~x>%_ta0MrRTd#9%~eyam@e6^w2| zhbY!?OYb7vq(&g!Rb9-W>?G}~-+6ydFuG~g9v$H(yZAY&R;qGNDv35vS=7g~06Ic? zy<=C;>3sJ(C5W1|yxsr%l!FdrkPc0=KVIhBjSH4*SHB6NQK z*fEE-KY`zd(=al;qQ<$vfqUQeYK{n zjh;=i)U+eLaIyWsR_^11xYk4Vl+?SDgz?>KAF;dgw2fOc5_OJAoqB)xt}5G%$43jg z7thpoEzgu7{AUwqZ2p_dxh*lshcbN#M^!s`*ls|HxfvU^k>VaZP=C`>YRvUYXlU2R zhS$QH>y!k>de;wzTBXN)!YS;0zN(UwV|1o87w6PYZISA}$?#c1@+e6h=8GOP+c_wC z?vashadX@;yJO2eHQSmUcQi7Xo8?Zv)MLo+Gp;#yUTxgzok`1unuMn%8@qeQ%HPlV z&DKT=e$gztXuOS-be-DvULVz6pFh@pafkhR%M-WF-o3eHmwV!}GjDns^%Kw1$~2CZ z`5b&ow6ez3?GJQ&dLLH^(qH$1bw{|X+V?kH;OK{&A6Cu(s z>)$;m^fr3RnQQH#Lp0S{8nxJ{Z8xN2x#J!PI8WQw8%7@7>F@ippXbKm&Va*`$#SgA z!I2WgQwy)X1g}W(>^&Oi0|~R*O?4^#%cHJS*=bc9J@ud6PFu%I8Nj!w+-d66S+T{{ z*?$KI8`u1Pc#AefCOyo*hIk6ITHT5JP~2@h5`KR%VsSah**}SdV)SG8EH^u^@YyQ+ z6Kfr-`OH%#a8&iaR_%u;8v|JCq#M~jt)a!085~->cI_O~_;D&l^rp7BQ#Y1BnLs_3 zaU!QYxM^t9oY3*R+gIT=no_9sBg`O~LZr1#=ez6#!Qxd16GDg7^587JjL2fJ!R&h8?L_LXTbYn=_nOgrFu{v6r4 zm=mGPJ452z3oqXhB`wvtc++Df&)LzgEAQ+Q;Zi#%4dbY^!P^AZnW?jds#w*{-s2R4 ztutyaA0xF3UA#x1?_@xni;a6k|G(b811hRz+qRo5AW;w%NfISBQ8I{#h#-i8oK+;W zWF$8^XAqE#Bo)b$Ln9zaPD;)>=M3HbtIv7&zyI&}|D89+J@@UwVt4nhs#SYe?TTxz zDI-RQN=5C(f0y(R_-9LjWQx%bZ;9rL$f6$qm|gr*f8!BUZz|Ohe3YEbYiGT^rw%b zk#xRHO=uPNHB{;^N7Q=TW{y}pSpOue0!DlUkZ0x7yINMwXPta*<_(KfUJ0Ii)EmwV z(Mo%SkuEcdgnPAhMn=*L*58T@xlgV-8YZL95f4ghYgOD0iPFYOnps*uc47Dp-8Rcd z=MNvJY=B1a0Y$&ztubP)JPs=R5D7xJO%*IH!?x8 zc!Z_jbdoXkn&DKe ztuy3|WKN@tnc11&#(LF|7q3XSCnYT@U_5xdsi`zANktU&k2EvWO2xcX88Ko>qVU_) z(^tJwgk(Rz<=+2*z86-41hxTx?&#TUmJgFbt9a+GNN$s3U~Px1$AibZBC7XPhVzMf zZ&C4(L?RZs#m?69?TJZ6E6eXwVHCni6n>-W8}}-aH@Q96E5BTLjyvuy^r>ejv*pzN zzEPC}BLvf44t93-E$EK2m~5J|W7=-R@hfPYX8!Ed*r7l(XTcEeFIEe6yfoC=uSM?O zk2?=r>(QpKxPW($a!qCsYgl2s90rNZ6MhwZbNv_n%ITKoD z9FJ?~$=(zc7)^yCTj+x9>rMt9iBU-7YoytudqVkY-hA!fZfOV0MI?>nh?C}9nuZ>Z z)LxI8mgDP}M0#2Z_4O9^`@{lUwOlM)Ork0-voC&SX@o8W1`1qsaKBkyyWNemP|)y* zS)h2pd?AwlL-fym8XwnSX-23KBy8w~)!D@|rD0jF&q{hxA1S6osY zuGgXu4NHzQ1JzSf!W^Kbfn>iOxM}CE^8{2I=IfC$4gK;9ubd2MX$^nx>p^!fSF1(s zc*{SG3E0r*0o2;~4HQ{QSK|3~P2%TZNPhmBYtf#lfC&$Bdh5YLLy^1xPsc|rGv!1! zt&NZcMMa2pD${gF3z8-F*8cz?mbZ*b-Txe6F9bKE_L_&y{h0H1G8$YhR;h!&dqs6%zkml)CFsuA zV0F#;DRl@TS==O4mI2t+#_;mm*jL*b*@&jQGB2+OlXqRAPE@0SUAPd)spS-(4W=vZ zrP#|Egl~s>L3ZXj(p!{xEaLf|N$mS1E*FcUs&AN)H% zv%I27#s+fzi8iE)14k7Ow^5}o-n@UQru#WwL=J@?u4l>f{NgkF^m`izgO9S0gVYSV zF+2Q-;JeaaipU`|Mc^IDy+GghA;#eod{LlN9v*}iTGQ)vS6iRQkpdIAiTe2_l*&1 z(d6}l)2p|s#&}%zS4mr--}GF$UQBpO0*jsyC0Q5lbE$)ieL52n!}fGl6_pF`q$M}o zOdqc{B151yK{x&o=C%K^NB8{r9{M29DB`KXqT>Eo{Wa6#yxgcMB=U>Dk&O5EQ$5K9 zIa4tkI#N6w$Tb2DMighvwyUQ2&p^3Getta9lXXMWk4HXvNSNw=<=gthA(br5a1H@L zB~Tci4J3>KYkp=H6C4OrYa27-!gR-~;wAn`x9^k;J>jayxsj?$SMtU_s>@x0WdisO zsH?pJzcWn=?~K1a=W8F9#O_&V&#_nDj!DclM;5f6Fy7#VinTh=coXV`{+PR`(Ghx! zznG^_4MA-B=97v$?HYd+BfWy_wgHUm>idN@W%UdDl1}~y`-~WYD3uqKhJpdU0GD{s z2(2pjKr_}9o=@Gdt}B7~o8o{BL$T)h54jlec9wpU_(2d$*I19X32!BBaZuP?O0lA) zmVDRL{W?;-`s!_Bod<+T=#@w#J$HeZc)M)N&gdQEI+zUEFRj@Tl5EeuvO%^-NJF3I~g6vW~A-;h4O>j zD27kf)lCZtQ=UVPyDMqZViNnVM2H)aZL+pt&AiKURmA@+6K_ULUisniT zp|ak^zO##crHF|5hlWlhbp@PPV7mj4I2okJq8bgKk;{3^D`v|a39J~5dyXs+nu;ZM z&s`-XYy1M=t5rDoT%cR&+0c*q{TV!n%Z&iPaBd7ikTX#Ngn?4S*=-4OdPqX)05MS& z{!$;sfTUBSYTi{n-(JNd*eoiWS2rM@+#M49h@aPSF`TL4^33Pvz!LuS^wkmo4v=-n zwg8{{F}>Enrg0+zFPkbF!1W)6-L_g)5JRh774#xN3C&-WnpmGygPKdzdE zk@NU%%q~eoW(o?F>dzXwXp=7guX?oMh6m(-w-Tpf{ulBC4);i}pBuCFZDwXMb&l zTIH+`H{<)oeh!B8D*!fHj2a zG?Z(Ay?PPbM@dMFrGA?VHTU^hpNNFc+T9gh9OF4qFdE%bZ%+{2@Dr`V^(_hHGAe~@m7udb?x~Dq$yI^5dKDFBo z=RB<=m5>zKK}SV)-`~EzE6RC!2_3}2Ue?#dsHuN$PK7sZP1fd&G`juOl0-(K^u*juLJ*S2^RhPVE2Fq2c zsYhUfKJoII^fxl1+-5?drldoC6vXxQ#bh^qL}2P$CVC~1U}L5RPiZRMij36>d&=p$ zYOATh_O0ZL7CM5^`%-rVeJ+Vx-a$!uA(IjltMc>m+RP93U#R2Q$j>#LZ%Jwr?IIu- ztyaULYO2PY3#>JJr%H2WUa%8fYbLgoUE3fPf>JHNp$XE0`kSpC?~Q5~a7Alytaf1Mwh8-RC1P4=Jy#M36QvL%wx8c|2wJ4X>t; zccF#)w=mVIJ!ztlFl2^IH9YdW_k+bLXYe<7mVzl!BS0#^&zBWtpZZ&XR^_`b7F@&h z5u>WW7^~4E;T>w6qyxt5E4;1ixD?J<=_onl8$@NC!;rpbV+5}Hp$WIRM&Lu0*+33@E zy@d6c{Z13qn?=hLpHBY)H3;{7ODqJ+{b7LQ*2TrJa3SVy%UEJLGn$|)U}rPuAotBIV6bNwP@gK%8SjypJ&ls$(N z9C_-88b6kY=@ZSJN}0$vMp4mHh9m`;NRf#XHl5q}#=FN?cT>lITZ0(45{HzU^f@-;d5uUQ1l_G$|+4|aSn zRV8BfG~m&?BXV}i*>$-CN9^IQKmUZ2HzW;=xgeC@LYGt4jT|-{^p&8)<+H>boD$~Y z?fbH)?XugJ2lh`AZ~Xc;!@!%&Ny#z!TW7IdL6Smp=ws9M0?*$r<=P*=MY%)bFHI?#MO;l0B z;qaBUHF|^ua3x<9u79kr zzYL*I*eR?u*c+NvlqCUx7*Go$9x$Ls(cFdZ=WGzs$nc2ow(ij4XcbXlh64aR-+%@6 z99~K@jI?FmmX+!fYwSbtfi3{ro%}&lIar0=7g&EXCv*ZVfY#7K@st+N5=rAQdLv#9 zrJt4V-E@(u=LMGh4v^4{tgG35 zPJ)4arn*-gRqk_fE^9M0LdeL#t4fixN^Ty~FEmEMGe`UrN2Xkh@6X-HnUYf(qG~-S z6=AI%tQ;)DA|lKTk-jeauDqQf4LSB$Z+ODe>=k)Aa-m$mVCQuI&``*h$Rq^vxT>-rsck$9>IBvI?mL)O->8u+^XnBU75J*%st_*~ zr!Oj2hImcqcbf=%alPQW5U)k8_vuOaP}?K~8~6!4L}R5f`7j!O46gz(wB+dO0d-ten&B{`~89>UWp-+%k#=g*gd6>zvU3wa1p zeiVyWq(npgSD=cl$jO!TPsPsa0$ywcR2O$4&%3%`4v36nvNVe4)gbsn%Tfa?)7Stw z#Vs}fS9*kdU?(P<+})+@I!*kE4T5)C2AmeT>)-ikqXAaFsqmsN?uzjz^ggGMQaLfQ z)4v*_D{Wbchsr3tp)O_)_T#wZXJ&2UvGR&3}7UVrx?$7GZYc%QB_3l(t)7~$O4}2e)pYaNF7Dbom+TJ9hYtB^J~I{}8>Gv+P9?AR)29hDi2bgvpD6psf?hXXF#D_EID9;a`>n}S~H5yNl1hz&eeg@ZQz&)B;LRfI71ig}Y}FFD;Lp_jmC z@V=0OaP%5A_nw^QyhTE}A%c7R3cJjlJlfby*yzhJq#B9~C|yQhtzZ3dB_1s9^4My{ zi+B^cYL-KoZWAzZT=&2bx6y(uhyeg9J>+?;i$Xa5CxY-^^krfWA<$3bM9I-an^|HA zAvoa8XaQsCD{@z&bFP$yc!Aa;CXmYODQ>hv;RfEb%Q&i{XRS05ynn{ZmEeDN{e5Hslf5hIxEhfy(6t6j%iOkp+lg6Fy{Zg(#cH ziw)G~JP2Lv4;usN0tn=*;&g3O3I3nWqqMYiw_;gIz+IjMoP0WCe~MrCGialnspYJ{ zoOt1NH60wxv@dBr|G>IijJFvTb&Wv$Hjyu@O`L$sv%#b@>$+XVMV6EWkR2*47+YYl zD}^mbN*5-P{BVqw`3`i1D8rKP)x%4PF8LFrBPq&V^AQUa-eg35o<1x1{g11*dXA20 z+zP9guGjYWJ~DO!BdNRngM(Q=bWD~7+v>Hb^zmjcLmuO1@D9COC>!L)?^T0XG~u*s zDh=@C?_9Zbd~NVb5x`Xk`Clz4P6XM&nXQm~EBU~;4u?upxi1Hj6!H7r!%GWb%1o{P z1-@mt*hcm`T{}@Oetg6F}i(Ph857#YmzI3GdQ zF|ISCmt)&*ZFFbiV!IsJc!#ZeKyCFY6Ad$-u~R}bVjz770=InpCe~}_+^V~N9fQTv zhO19lka+4}*A=hO;wwY0dr59zbh(b_VA_cgoZjVaE0#Q$#O0};QeC;#l)Hof!C{IT z52%k*#K7z5)cT z+UDzQTkv*j0yU=TMjcIL4rDiYSXR5wn&f_o42usGJ4%mwsN*V9kWp| zYnR7vZ=-*eDPxk_DkRyE+Eb;(rk+dGx&U9{7YNOb~Z5|VrO z?)mrk_g|cxaF&khb$#o~zEUdGAE!kl6vo~vCT2QwozRRvMF`9&Q7v?0V7oLcKflbu zo{F4uAukWMeMwFdg4;+7$vb6zr=ReM>l&p%E8YIyLuGARXyJPFv;hN=-i zw_t=;pw78tC7QozC!W^1_znAM-vz)KB~=C&l5$IWdR~34uaAX9<(d!JrUbjoyc-b? zeOscX(iGSEp*2ak(A$#!`f!FheVFYVork0yOnSU`H7C*j;|OED?hEaM?!%Q z3S1?wRg!m86{<>S^w8bWLbI^;p29+~tZn7FwNch9GxED!4`+rGB|FKfZ9(d#W&<#3 z3N3Xy>6e&0L>dsOaWR*et8#aB-Vrn71u2sR#9z2VhaHW^MS+PpV3Y|~kVzi~K+pL0 zm*4dG+N4Rmt`g&e68Z2-yUUiIN*>0=X4{jwF5#eW9o|M=0Ecga0WbKAc%|+8!{mEv z$4ebzfA@TDy*GNk3JY`Dcr(ZN8<_1Q$+zbx=@S>9twqm}`WB$sWtl%3x3Al7H=&c#Rq|bddw-gnOQ&$-|=%~O2vKxoyW1|}e291hIM0|EmJ0A^;9 zoKeOKn!&4E@zuHa+;f@nVo9>i)<~PSRgoRc)R?nLROex;Wh|(@(PhuInzy8KU9d2* z<%yY;8%epgs)JR9>rw#N`%>_;h=_U&sI9ouhWSQGfl%X z4r5D$20LX?fNJ~3w2IQ1a@60dDcq{zOHNAaAiaF~kWtFn<|PJ=iUsJ-pHjfrf_9s& zSBx_SWG>}ger~(jp70YAiO^79C1MsHcT(p``ngP!*rCEKEsoz-&YZIoWcUTu?PES( zQBUvnSfLJJV<9bcu@EcBeHOdmpZGJdR{GY&!GVFMvGH*iGqb!B*Tc1!02=ei&CPA# zmJGP-@Am^}T*oWQnN|T1-)g)Sc)f@`Iy}6L z^_Y-_^||n~uP@41<5_y<6@C6#1Lb!4wrq2qQyn!TA_%;8mKu@2eikx=TC``+9k}+b zJdZ-{Sp-4XD|-MM*hZqS74e+B!jE9iIk-<4CSd50h}`xbD%4M|0uB*|zcxD!<5<~IxSQjoR|a)3*egtW zYYU&UQ+@_s@^r zIr1ZBP>kr@d9f~G)#eKLWGN5$4?F~Uym|BHWHyj-%CYU{J9<0%2P|^0^@lspAz*R* z6*F*lKB(n2(dZzR>2osW5~DGI1^?%ZrdOOI0=CQ4VbMy@DxWp%T!bFW?zTMb{eDYG zc?khq(JU-M%{NMG65X8{8Gp6Yo1?+CIc8ZTy$xpl4KII$&{*Qc%i*K<&oMHGV3DM0 zk_MlnWN|4OGbfid?HfyDp_qa1Bc^{nnwP(Nps=gFd0W!h|K9_%>kFEgBqL$>h86XP`QJtU%AuABJPCT_;5ZQJF$ zln#KKMNUhQ6B7OnX9lku4gH*ZB+SJ84OR0r$nx*p`4b%!Bg+acL7&{!6k6&{m-KZV zJu>LyyI(JER!*Y_784B7h%F=rZ4DfMIQ+72Sos*5mCIpT_|n?^K+;AKK=w%d{3hrN zi-lF)m?_n&My*6=lg}#PHvm*h{Gb+jUK<$}9{x~&*yCwZrovlf1<(1Rw@!oA*{~R2 zG6sr7PH+)IfSXlSu(={LJT(RUC3p_@_3cmt5E45JSzIk)tfAw18^Z@^oTW2Tp1GBd zMGu#0fx&336u2xp`JstCpWHq|&C8W6j!OBhO^gBd>=3(8^Q~8n3u{i>1Nsc%%cJ;Oz+x z!tc#u73(S^(rTnKPGf7zj=N5Y&r6LND=mi!3%}ePEn8MUX%Jhce>--SfKdpPgLu=Y_2{>l3b{ij`I{OXY{W*Xxzc=i-M46tc;J!zs%PzzJ ze0t)R{pi;t=UyCn3Rbr`$qeXBAUWe>*~4FhhEDVx16_Qyp;?irjS`Hc$op~@6(>WY z4why*)6D%>C3`IyO*BMN^&1j+g|C3Ko?ygDAmStyI0U-ro^?wGaFa(|`MJ{e^v4ue zmM#OwNEGrlZgkJrI4KK8z`(d>P&8e13wf|(QA@&CH4{!Qeb6@w%7Q-)2^?7*1IR=z z0~Zn7TtXIVrwir9)!o$Zfv4v$XH?j9lSp(?`nc0@dwtSvrfAA@aZ$6fqWo<{n~8p| zIm1oH8`H->)fi9@Wzs93eEIDyw{P1%YOapIV?Vpw}_IeWb!%8Y_Jed<@A#x8sTl+N8XX-#{3C?~#kSSdXE34SRSMQH{ z+d{fOa0j`W2^=3SULM=+c0o{(+tasAm6`Q60M8S9GnEa81pqnCum0uk?C{PG(ao)i z`3J{OzRY%_E6tb{F5T;sjSSgHXx}6WK!jcI_uQtx*d~rx+PCn)lc$EUVad ztU}Le^p#nf+g5c^zhiw3@4!9L1QE>kG%7t2I3U{2kFz_-H#|MVcRSj6hzo;?sV7o{ znK&td*NLIW53!@+M!*~d>{BtwixP z{d+%t^NC)CFT-|p!0hVcyZZIDDCqenkkb(mE*6Fgrj-I8ZZaP2C z&R0m}D^df6$#F9Ug=)P*n3R;1-AZ3(7U=cqPEUIgG7|tp=5KkJAxS|&Kpd5fuaEmI zY1Vic$~hUv&$8p!Sjp!@3spB~ewH!~eDDm8PaReK29P9!WAnV!3fIlC^2uNYlgC1l z5nybDoL z)qZ$t6u$k!T>9>{oV@v2vUuwsL?&V`n&i!HG zaQhx@fVE1&TBSHN!-Sh*-=5umZ)I+7Zed}e46xI80Dvvqn2tbw>0K3xHD|31=rb{A z{>$CV>6qt_L=y@eKh&D_PGOxmosUJTf7$c}Fp1y4<{ZJ2*aao67oOJ%M+LfQdVOoF zq5qZxtAl=9$RhVq;i`d~^Y1TjDQ)l*Whn@tPl$-*Pm|K)?-JHf1{+FyWPK=#_@56DqfyTcrc3ZckAa+$ULmX@}`?YQO75LF#7;5aC(V}WqNVD?9tM0k(7PcVHRL! zNR2_OO`k2FpOGIet5=7pC!U~RWCGNy7M)2VyJsI2=WqjPug<4!da9S*HSQdQ+w+Wf zFWc4UYHz^JABN}ZjM;I&_}W)nQzHS6vGK7n36m17Q5_;GG1#~G`%%9udAz(tDC$~e z8EK+XjJXn27A$K zJ%Q-;Oih7$JBqpj-#1Wo59ksEm@VC_=AwAdLUE5Nsc>E5+!{0gZo0vCur;!U)O5;M zlYace&t>}uf}<1BfB+QA3>zJtTK!g8S@!Jq?_d4>(ZFXM{4E@=$_~JJPr)JhLB%=N zx>$>cmV*VLo`7?Jdq1t-=?~M$S3y2$@#sKiY6>~85WnV25CWb_m{T8L1@kXrum!dR z+&CD&e5t^2Q$|@q2{i7!kIF^)EiEi`a?N$@8jxk`oOL^Eg_DNo35e64rv@*gPCWM> zS_d4_{Bak70p@#zKN{ua@PIk7!ENrQRxW zJ&ascv=_W46s9Fbd&eYLK`>gSB{@v1PCPnDq|IbE*O_IAHnMG;&a}*F=`*2*GPktI z;ZJUUn%o0dn()J zc7<#$&{sc3@z)6pN?rWCM=pJlg-b}L;&S>V`}nv!C_4$g6#R5INAktYC#)Nq+Y%#w zl~?r-&fXUx=GUi(Mn@fOStw=GgTfRsiKf628`xTtmUVYnXy-_GJ}XHu^mHK=8a_e~ z-8WyHft`k`FQnfA{h>?~&dm1uCtjRIRAFJ^$)Yv#!l&F)6WLImvpAt3|9b1tmb;%B5L2GQ8wAK8^ArWYm!+do6vih%aQAP zyg6REzT1{AwIcS|{L-BHuSf1T*kTA{)!cuNno(xp&5X!DU^_*<%ot#StWo>#p|#CY zf0w-KY!%V(Oeg^Fxk0K5tEOemROb4aV2?{}t~p$5;*z0Wnw}`0*{m5gcrZqRu+aSP|DL-9qupzg9-jB2*qF)`l zoG)*>9L7u^Z}Y}kIHhmAVEPQ1766+&t=^_d2d*tI+79C2p${*rFP7~hme(k82-!-{ zxs*I*xiDxkFmMQl2AB^7#?p>h5UFg^+|C+8R3~Cez6!}syc$+y+x0zffP6}7fP#f= zlcuYFuv6b)!V2`2DVe1`BtcPXr-ROSOMK<>igbGZ({m@LUb2*@Z(v|^L24(M;fmL% z77Nx8CAn`9yh;|6b!wTq!%K{8c*Gn`pekL)YiFeO4l!>PKtPFNWD|XGGT0ZS+Ci!P z`k{iUXDRjh{~t~5!5G3UStaYZH#dF(pT=ws_q7~e8aup_FtvLHP7pzufEX`Km{$S^ysoV1&B=SfNnf$cGbrW&$Dy z1p3D(@B!;v`CmV9K@vBC@BqQ`)$;)XHe?Vi7a#W8zw2O>xhwO++Ri4^KR9SCAth-y zJuCAfGbj5zDK%x^C%|t4dkq@~WZ>`S1;n>;uuDuyPdfp8<$H5;bNhf7es^Saba!-g z^ZKTE?_<90?wQ^(9d)M4(?UJ@4Frn z5;6uj)TcqOxd*m%P=FKt@bA=(O)EG&)GIMH`S52)`^wbx^wRjm#C%YAC>rprq9-ON zch=U{P9~?OPCtLmKk*F?^!mH?W77)=3%DH+77`p59n};4K5omy8-a0fd53XFcck$uxewF_b4o<)qf)gGURTLZ?1333$F<1!* zj6#J*MC4o+y zf?;71yL^21Xi7?Fz|R^2_ynp-n#PV9=;l%=u;9jS@;3$-cN}mBPXSKdN$_5bU{qBH z0iSL95s0hzH|T#58XDOM$Vk3%Ifb^~cf0l}SdwZF~!^2)+MNkFH zPYAdP9|LfjCYEE7o15DJa4YHq{b?Z17B=p`svjF4q*V#@KL+V>0RFLLz}@AXl9Hl? z<*)<1d{TfH@&14C3n~LnL=9jlnGV8N{vEpiL%#<|F9hhn1SAmh%0KrF#{Uk=TmM-gXdXHB3EbOP^)ee3J%|B!C*{RbHP*MQ&R zv0<@s{x1F4bin;gf)%-0koF9aG9Vv7nPC0*VR_I#009gC(X&}uSu-H)_}{4;n-)m> zCy+xRF+lHqF#e_dhYnEQ6o5xv5uD?|^&=pE@G}16`rmN|?Z73F?t4%d=E3`hgz?Yt zSehlD~!2__)_dz}IgeEEyR zHzed%cuaI^c5cpa$+xokZizOHe0zl!_M z*T6h3$uBrC;h%s1?|u&q4gL`j65RCP4gY_J18WC#K>x`f^H?ya{Xeh$)o1@m|7)H; zp{s6)L=?g|8RZ)oxqGN8Kw%bR`1$yv1T=^HxnSMkBxL25%& z!-K)Wu{2gzC5sz3?zytD$vQc^I!6VBhUENp{6M4lq(nO`?{8mUpIu2wi9O&FwFwRj zP4f*7F#fCfzM-MasTt`V0|NuaV0+?YQBhG2u%$^zN=xkn^_S_d;$yD|g@$Z|M@EK& z_D&2dp#2R3YXY19ow(RA!C_$*Aipypoox^gD~loF;g - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From e54998b6ec7dcaa804d5ff8999580e44b6ab0106 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Wed, 28 Mar 2018 09:17:30 -0500 Subject: [PATCH 0032/2542] HACK: proton: wine.inf: Don't show crash dialog by default. --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 74f186501271..fc8c7e78a8f0 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -455,6 +455,7 @@ HKLM,%CurrentVersionNT%\AeDebug,"Debugger",2,"winedbg --auto %ld %ld" HKLM,%CurrentVersionNT%\AeDebug,"Auto",2,"1" HKCU,Software\Wine\Debug,"RelayExclude",2,"ntdll.RtlEnterCriticalSection;ntdll.RtlTryEnterCriticalSection;ntdll.RtlLeaveCriticalSection;kernel32.48;kernel32.49;kernel32.94;kernel32.95;kernel32.96;kernel32.97;kernel32.98;kernel32.TlsGetValue;kernel32.TlsSetValue;kernel32.FlsGetValue;kernel32.FlsSetValue;kernel32.SetLastError" HKCU,Software\Wine\Debug,"RelayFromExclude",2,"winex11.drv;winemac.drv;user32;gdi32;advapi32;kernel32" +HKCU,Software\Wine\WineDbg,"ShowCrashDialog",0x00010003,0x00000000 [DirectX] HKLM,Software\Microsoft\DirectX,"Version",,"4.09.00.0904" From 0edd7c10054a6becf65fcc1896efb9f8aa5003e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sat, 16 Nov 2024 14:15:14 +0100 Subject: [PATCH 0033/2542] HACK: proton: wine.inf: Add native,builtin overrides for msvcrt DLLs. Squashed with: wine.inf: Set msvcp140_atomic_wait to native,builtin. --- loader/wine.inf.in | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index fc8c7e78a8f0..5bfbd8327397 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -67,6 +67,7 @@ AddReg=\ Misc,\ OLE,\ Printing,\ + ProtonOverrides,\ Services, \ SessionMgr,\ SteamClient,\ @@ -91,6 +92,7 @@ AddReg=\ Misc,\ OLE,\ Printing,\ + ProtonOverrides,\ Services, \ SessionMgr,\ SteamClient,\ @@ -117,6 +119,7 @@ AddReg=\ Misc,\ OLE,\ Printing,\ + ProtonOverrides,\ Services, \ SessionMgr,\ SteamClient64,\ @@ -143,6 +146,7 @@ AddReg=\ Misc,\ OLE,\ Printing,\ + ProtonOverrides,\ Services, \ SessionMgr,\ SteamClient64,\ @@ -162,6 +166,7 @@ AddReg=\ DirectX,\ MCI,\ Misc,\ + ProtonOverrides,\ SteamClient64,\ Tapi,\ VersionInfo,\ @@ -178,6 +183,7 @@ AddReg=\ DirectX,\ MCI,\ Misc,\ + ProtonOverrides,\ SteamClient64,\ Tapi,\ VersionInfo,\ @@ -2752,3 +2758,37 @@ HKCU,Software\Valve\Steam\ActiveProcess,"SteamClientDll",,"%16426%\Steam\steamcl HKCU,Software\Valve\Steam\ActiveProcess,"SteamClientDll64",,"%16426%\Steam\steamclient64.dll" HKCU,Software\Valve\Steam\ActiveProcess,"SteamPath",,"%16426%\Steam" HKLM,Software\Wow6432Node\Valve\Steam,"InstallPath",,"%16422%\Steam" + +[ProtonOverrides] +;;Likely want *80 and *90 too, but those require removing Wine's manifest files. +HKCU,Software\Wine\DllOverrides,"atl100",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcp100",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcr100",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"vcomp100",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"atl110",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcp110",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcr110",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"vcomp110",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"atl120",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcp120",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcr120",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"vcomp120",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"api-ms-win-crt-conio-l1-1-0",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"api-ms-win-crt-heap-l1-1-0",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"api-ms-win-crt-locale-l1-1-0",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"api-ms-win-crt-math-l1-1-0",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"api-ms-win-crt-runtime-l1-1-0",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"api-ms-win-crt-stdio-l1-1-0",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"api-ms-win-crt-time-l1-1-0",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"atl140",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"concrt140",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcp140",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcp140_1",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcp140_2",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcp140_atomic_wait",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcp140_codecvt_ids",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"msvcr140",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"ucrtbase",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"vcomp140",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"vcruntime140",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"vcruntime140_1",0x2,"native,builtin" From c405f26e3143cb07e62d71b2f939496f24768e84 Mon Sep 17 00:00:00 2001 From: Patryk Obara Date: Fri, 26 Apr 2019 20:40:31 +0200 Subject: [PATCH 0034/2542] HACK: proton: winex11: Fill WM_CLASS based on Steam appid. Some desktop environments (Gnome 3, Cinnamon) decide on an application icon in the following order: - If the first string in WM_CLASS property can be correlated to a name or StartupWMClass key in a .desktop entry file, then the associated icon will be used. - If the second string in WM_CLASS property can be correlated to a name or StartupWMClass key in a .desktop entry file, then the associated icon will be used. - If the application has indicated an icon resource through WM_HINTS property, then the associated X window or pixmaps will be used. Upstream Wine usually deals with this by placing a .desktop file with StartupWMClass filled to match first string in WM_CLASS property (which is the name of exe file being run). Wine in Proton does not do it, but still puts "Wine" as second string, therefore desktop environment can't differentiate between Wine in Proton and Wine installed in OS. By replacing "Wine" with "steam_app_" we force DE to fallback to icon indicated by WM_HINTS (ico file embedded in exe file). Steam can override this behaviour by installing properly crafted .desktop entry file. If SteamAppId environment variable is missing, then generic "steam_proton" name is used instead. --- dlls/winex11.drv/window.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 32c3800abfe1..65b56061184b 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1021,8 +1021,19 @@ static void set_initial_wm_hints( Display *display, Window window ) /* class hints */ if ((class_hints = XAllocClassHint())) { - class_hints->res_name = process_name; - class_hints->res_class = process_name; + static char steam_proton[] = "steam_proton"; + const char *app_id = getenv("SteamAppId"); + char proton_app_class[128]; + + if(app_id && *app_id){ + snprintf(proton_app_class, sizeof(proton_app_class), "steam_app_%s", app_id); + class_hints->res_name = proton_app_class; + class_hints->res_class = proton_app_class; + }else{ + class_hints->res_name = steam_proton; + class_hints->res_class = steam_proton; + } + XSetClassHint( display, window, class_hints ); XFree( class_hints ); } From 0e038a59e6a602c527d0889721aec7df1863c2d1 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Mon, 20 Aug 2018 10:58:09 -0500 Subject: [PATCH 0035/2542] HACK: proton: secur32: Return real Unix username from GetUserNameEx(NameDisplay) --- dlls/secur32/secur32.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/secur32/secur32.c b/dlls/secur32/secur32.c index f757ea6d34f2..deae7f1a60d0 100644 --- a/dlls/secur32/secur32.c +++ b/dlls/secur32/secur32.c @@ -1158,9 +1158,22 @@ BOOLEAN WINAPI GetUserNameExW( return FALSE; } + case NameDisplay: + { + static const WCHAR wineusernameW[] = {'W','I','N','E','U','S','E','R','N','A','M','E',0}; + + DWORD needed = GetEnvironmentVariableW(wineusernameW, NULL, 0); + if (*nSize < needed) { + *nSize = needed; + SetLastError(ERROR_MORE_DATA); + return FALSE; + } + *nSize = GetEnvironmentVariableW(wineusernameW, lpNameBuffer, *nSize); + return TRUE; + } + case NameUnknown: case NameFullyQualifiedDN: - case NameDisplay: case NameUniqueId: case NameCanonical: case NameUserPrincipal: From d33ddb5cc4a2c282e4d1102b1cf75971c8641d39 Mon Sep 17 00:00:00 2001 From: Sven Baars Date: Thu, 5 Dec 2019 13:48:38 +0100 Subject: [PATCH 0036/2542] HACK: proton: ntdll: Return a handle to kernel32 when being asked for mfc42. For some applications mfc42 is loaded, but never actually used. We can add Steam game IDs when we find more of such applications. --- dlls/ntdll/loader.c | 58 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 0dd5c686ecf6..eccdcb1e0708 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -3198,6 +3198,44 @@ static NTSTATUS search_dll_file( LPCWSTR paths, LPCWSTR search, UNICODE_STRING * return status; } + +static WCHAR *strstriW( const WCHAR *str, const WCHAR *sub ) +{ + while (*str) + { + const WCHAR *p1 = str, *p2 = sub; + while (*p1 && *p2 && tolower(*p1) == tolower(*p2)) { p1++; p2++; } + if (!*p2) return (WCHAR *)str; + str++; + } + return NULL; +} + +static WCHAR *get_env( const WCHAR *var ) +{ + UNICODE_STRING name, value; + + RtlInitUnicodeString( &name, var ); + value.Length = 0; + value.MaximumLength = 0; + value.Buffer = NULL; + + if (RtlQueryEnvironmentVariable_U( NULL, &name, &value ) == STATUS_BUFFER_TOO_SMALL) { + + value.Buffer = RtlAllocateHeap( GetProcessHeap(), 0, value.Length + sizeof(WCHAR) ); + value.MaximumLength = value.Length; + + if (RtlQueryEnvironmentVariable_U( NULL, &name, &value ) == STATUS_SUCCESS) { + value.Buffer[value.Length / sizeof(WCHAR)] = 0; + return value.Buffer; + } + + RtlFreeHeap( GetProcessHeap(), 0, value.Buffer ); + } + + return NULL; +} + /*********************************************************************** * find_dll_file * @@ -3261,6 +3299,26 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, UNI done: RtlFreeHeap( GetProcessHeap(), 0, fullname ); if (wow64_old_value) RtlWow64EnableFsRedirectionEx( 1, &wow64_old_value ); + + if (status != STATUS_SUCCESS) + { + /* HACK for Proton issue #17 + * + * Some games try to load mfc42.dll, but then proceed to not use it. + * Just return a handle to kernel32 in that case. + */ + WCHAR *sgi = get_env( L"SteamGameId" ); + if (sgi) + { + if (!wcscmp( sgi, L"105450") && + strstriW( libname, L"mfc42" )) + { + WARN_(loaddll)( "Using a fake mfc42 handle\n" ); + status = find_dll_file( load_path, L"kernel32.dll", nt_name, pwm, mapping, image_info, id, TRUE ); + } + RtlFreeHeap(GetProcessHeap(), 0, sgi); + } + } return status; } From 2af0f80a80543b90bee37750a3a4faed63a1fee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 18 Dec 2019 13:49:00 +0100 Subject: [PATCH 0037/2542] HACK: proton: ntdll: Strip gameoverlayrenderer.so from LD_PRELOAD before executing explorer.exe. Work around a bug in gameoverlayrenderer which introduces 50ms hangs during XCheckIfEvent after approx 40 minutes of gameplay. The original user32 hack broke Steam overlay in Origin games, and Steam Input consequently. This ntdll implementation should be safer as it'll modify the environment after the new process has started forking. Link: https://github.com/ValveSoftware/Proton/issues/3316 CW-Bug-Id: #18946 --- dlls/ntdll/unix/loader.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index de2666aff891..966973148560 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -581,11 +581,42 @@ NTSTATUS exec_wineloader( char **argv, int socketfd, const struct pe_image_info WORD machine = pe_info->machine; ULONGLONG res_start = pe_info->base; ULONGLONG res_end = pe_info->base + pe_info->map_size; + const char *ld_preload = getenv( "LD_PRELOAD" ); char preloader_reserve[64], socket_env[64]; if (pe_info->wine_fakedll) res_start = res_end = 0; if (pe_info->image_flags & IMAGE_FLAGS_ComPlusNativeReady) machine = native_machine; + /* HACK: Unset LD_PRELOAD before executing explorer.exe to disable buggy gameoverlayrenderer.so */ + if (ld_preload && argv[2] && !strcmp( argv[2], "C:\\windows\\system32\\explorer.exe" ) && + argv[3] && !strcmp( argv[3], "/desktop" )) + { + static char const gorso[] = "gameoverlayrenderer.so"; + static int gorso_len = sizeof(gorso) - 1; + int len = strlen( ld_preload ); + char *next, *tmp, *env = malloc( sizeof("LD_PRELOAD=") + len ); + + if (!env) return STATUS_NO_MEMORY; + strcpy( env, "LD_PRELOAD=" ); + strcat( env, ld_preload ); + + tmp = env + 11; + do + { + if (!(next = strchr( tmp, ':' ))) next = tmp + strlen( tmp ); + if (next - tmp >= gorso_len && strncmp( next - gorso_len, gorso, gorso_len ) == 0) + { + if (*next) memmove( tmp, next + 1, strlen(next) ); + else *tmp = 0; + next = tmp; + } + else tmp = next + 1; + } + while (*next); + + putenv( env ); + } + signal( SIGPIPE, SIG_DFL ); snprintf( socket_env, sizeof(socket_env), "WINESERVERSOCKET=%u", socketfd ); From e3c9be6c2bc9d1b25737238436adb3bb4978fba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 11 Jan 2023 18:42:15 +0100 Subject: [PATCH 0038/2542] HACK: ntdll: Ignore unsupported Unix locales and initialize regardless. We shouldn't rely very much on Unix locale anymore, and not having the Unix locale configured shouldn't prevent us from running applications in a localized Windows environment if they need it. CW-Bug-Id: #21346 --- dlls/ntdll/unix/env.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index 0e49b6f2d063..0158d56a4f4b 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -63,6 +63,7 @@ #include "error.h" WINE_DEFAULT_DEBUG_CHANNEL(environ); +WINE_DECLARE_DEBUG_CHANNEL(nls); PEB *peb = NULL; WOW_PEB *wow_peb = NULL; @@ -278,13 +279,14 @@ static const struct { const char *name; UINT cp; } charset_names[] = static void init_unix_codepage(void) { + const char *name, *ctype; char charset_name[16]; - const char *name; size_t i, j; int min = 0, max = ARRAY_SIZE(charset_names) - 1; - setlocale( LC_CTYPE, "" ); - if (!(name = nl_langinfo( CODESET ))) return; + if (!(ctype = setlocale( LC_CTYPE, "" ))) name = "UTF-8"; + else if (!(name = nl_langinfo( CODESET ))) return; + TRACE_(nls)( "Unix LC_CTYPE %s, using %s codeset\n", debugstr_a(ctype), debugstr_a(name) ); /* remove punctuation characters from charset name */ for (i = j = 0; name[i] && j < sizeof(charset_name)-1; i++) @@ -801,13 +803,22 @@ static const NLS_LOCALE_DATA *get_win_locale( const NLS_LOCALE_HEADER *header, c static void init_locale(void) { struct locale_nls_header *header; + const char *all, *ctype, *messages; const NLS_LOCALE_HEADER *locale_table; const NLS_LOCALE_DATA *locale; char *p; - setlocale( LC_ALL, "" ); - if (!unix_to_win_locale( setlocale( LC_CTYPE, NULL ), system_locale )) system_locale[0] = 0; - if (!unix_to_win_locale( setlocale( LC_MESSAGES, NULL ), user_locale )) user_locale[0] = 0; + if (!(all = setlocale( LC_ALL, "" )) && (all = getenv( "LC_ALL" ))) + FIXME_(nls)( "Failed to set LC_ALL to %s, is the locale supported?\n", debugstr_a(all) ); + if (!(ctype = setlocale( LC_CTYPE, "" )) && (ctype = getenv( "LC_CTYPE" ))) + FIXME_(nls)( "Failed to set LC_CTYPE to %s, is the locale supported?\n", debugstr_a(ctype) ); + if (!(messages = setlocale( LC_MESSAGES, "" )) && (messages = getenv( "LC_MESSAGES" ))) + FIXME_(nls)( "Failed to set LC_MESSAGES to %s, is the locale supported?\n", debugstr_a(messages) ); + + if (!unix_to_win_locale( ctype, system_locale )) system_locale[0] = 0; + TRACE_(nls)( "Unix LC_CTYPE is %s, setting system locale to %s\n", debugstr_a(ctype), debugstr_a(user_locale) ); + if (!unix_to_win_locale( messages, user_locale )) user_locale[0] = 0; + TRACE_(nls)( "Unix LC_MESSAGES is %s, user system locale to %s\n", debugstr_a(messages), debugstr_a(user_locale) ); #ifdef __APPLE__ if (!system_locale[0]) From 741a2b52b40fb752df3a0218cd93add4449c4cb8 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Thu, 10 Sep 2020 11:07:01 -0500 Subject: [PATCH 0039/2542] HACK: ntdll: Don't let applications change permissions on wine's files The 2019 VCRuntime installer will chmod a+w on files that it can't open for writing, which would leak through the library symlinks and modify the global installation. --- dlls/ntdll/unix/file.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 8bc69557057e..4a2c3a84b6f9 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -1698,9 +1698,24 @@ static int fd_set_dos_attrib( int fd, UINT attr, BOOL force_set ) else return xattr_fremove( fd, SAMBA_XATTR_DOS_ATTRIB ); } +static unsigned int server_get_unix_name( HANDLE handle, char **unix_name ); + +/* return TRUE if this is a file owned by Wine which applications should not try to mess with. */ +static BOOL is_wine_file( HANDLE handle ) +{ + char *unix_name; + BOOL ret; + + if (server_get_unix_name( handle, &unix_name )) + return FALSE; + ret = strstr(unix_name, "/lib/wine/" ) || strstr( unix_name, "/lib64/wine/" ) ||strstr( unix_name, "/share/wine/" ); + free(unix_name); + return ret; +} + /* set the stat info and file attributes for a file (by file descriptor) */ -static NTSTATUS fd_set_file_info( int fd, UINT attr, BOOL force_set_xattr ) +static NTSTATUS fd_set_file_info( int fd, HANDLE handle, UINT attr, BOOL force_set_xattr ) { struct stat st; @@ -1714,8 +1729,16 @@ static NTSTATUS fd_set_file_info( int fd, UINT attr, BOOL force_set_xattr ) } else { - /* add write permission only where we already have read permission */ - st.st_mode |= (0600 | ((st.st_mode & 044) >> 1)) & (~start_umask); + if (is_wine_file( handle )) + { + TRACE("HACK: Not giving write permission to wine file!\n"); + return STATUS_ACCESS_DENIED; + } + else + { + /* add write permission only where we already have read permission */ + st.st_mode |= (0600 | ((st.st_mode & 044) >> 1)) & (~start_umask); + } } if (fchmod( fd, st.st_mode ) == -1) return errno_to_status( errno ); @@ -4659,8 +4682,8 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io, status = set_file_times( fd, &mtime, &atime ); if (status == STATUS_SUCCESS) - status = fd_set_file_info( fd, info->FileAttributes, - unix_name && is_hidden_file( unix_name )); + status = fd_set_file_info( fd, handle, info->FileAttributes, + unix_name && is_hidden_file( unix_name ) ); if (needs_close) close( fd ); free( unix_name ); From 4d57cb85c0efebf529b48bacc36293e853e061ee Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Thu, 22 Jul 2021 16:11:18 -0500 Subject: [PATCH 0040/2542] HACK: shell32: Update knownfolder paths in the registry Guilty Gear Strive requires that the path be in the new format. Since we haven't yet found a game that has a problem with the new format, let's just use that in all cases. For Steam cloud sync failures. CW-Bug-Id: #18905 --- dlls/shell32/shellpath.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index aee4b42ff193..be96a1786da8 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -2893,6 +2893,8 @@ static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken, LPCWSTR szUserShellFolderPath, LPCWSTR szShellFolderPath, const UINT folders[], UINT foldersLen) { + static const WCHAR WineVistaPathsW[] = {'_','_','W','i','n','e','V','i','s','t','a','P','a','t','h','s',0}; + const WCHAR *szValueName; WCHAR buffer[40]; UINT i; @@ -2901,6 +2903,7 @@ static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken, HKEY hUserKey = NULL, hKey = NULL; DWORD dwType, dwPathLen; LONG ret; + DWORD already_vista_paths = 0; TRACE("%p,%p,%s,%p,%u\n", hRootKey, hToken, debugstr_w(szUserShellFolderPath), folders, foldersLen); @@ -2914,6 +2917,12 @@ static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken, if (ret) hr = HRESULT_FROM_WIN32(ret); } + + /* check if the registry has already been updated to the vista+ style paths */ + dwPathLen = sizeof(already_vista_paths); + RegQueryValueExW(hUserKey, WineVistaPathsW, NULL, &dwType, + (LPBYTE)&already_vista_paths, &dwPathLen); + for (i = 0; SUCCEEDED(hr) && i < foldersLen; i++) { dwPathLen = MAX_PATH * sizeof(WCHAR); @@ -2926,9 +2935,10 @@ static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken, szValueName = &buffer[0]; } - if (RegQueryValueExW(hUserKey, szValueName, NULL, - &dwType, (LPBYTE)path, &dwPathLen) || (dwType != REG_SZ && - dwType != REG_EXPAND_SZ)) + if (!already_vista_paths || + RegQueryValueExW(hUserKey, szValueName, NULL, &dwType, + (LPBYTE)path, &dwPathLen) || + (dwType != REG_SZ && dwType != REG_EXPAND_SZ)) { *path = '\0'; if (CSIDL_Data[folders[i]].type == CSIDL_Type_User) @@ -2969,6 +2979,11 @@ static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken, hToken, SHGFP_TYPE_DEFAULT, path); } } + + already_vista_paths = 1; + RegSetValueExW(hUserKey, WineVistaPathsW, 0, REG_DWORD, + (LPBYTE)&already_vista_paths, sizeof(already_vista_paths)); + if (hUserKey) RegCloseKey(hUserKey); if (hKey) From 04bfcda76db5fcadfa0ddaf2b5b4197de73ce3e8 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Thu, 3 Feb 2022 11:35:13 -0600 Subject: [PATCH 0041/2542] HACK: shell32: Preserve duplicated Documents/Stuff directories --- dlls/shell32/shellpath.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index be96a1786da8..07295713cb32 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -3123,6 +3123,23 @@ static HRESULT create_extra_folders(void) hr = SHGetFolderPathAndSubDirW(0, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_DEFAULT, L"Microsoft\\Windows\\Themes", path); } + + + /* Proton HACK: In older Proton versions, duplicate Stuff directories were + * created at both %PROFILE%\Music and %PROFILE\Documents\Music. Due to + * some bugs when downgrading to those older Proton versions, create those + * missing Documents directories here, too. */ + SHGetFolderPathAndSubDirW(0, CSIDL_PERSONAL | CSIDL_FLAG_CREATE, NULL, + SHGFP_TYPE_DEFAULT, L"Downloads", path); + SHGetFolderPathAndSubDirW(0, CSIDL_PERSONAL | CSIDL_FLAG_CREATE, NULL, + SHGFP_TYPE_DEFAULT, L"Music", path); + SHGetFolderPathAndSubDirW(0, CSIDL_PERSONAL | CSIDL_FLAG_CREATE, NULL, + SHGFP_TYPE_DEFAULT, L"Pictures", path); + SHGetFolderPathAndSubDirW(0, CSIDL_PERSONAL | CSIDL_FLAG_CREATE, NULL, + SHGFP_TYPE_DEFAULT, L"Templates", path); + SHGetFolderPathAndSubDirW(0, CSIDL_PERSONAL | CSIDL_FLAG_CREATE, NULL, + SHGFP_TYPE_DEFAULT, L"Videos", path); + return hr; } From 96af40dae6aae33583d0c3b3c0c4d5401f57571c Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Tue, 15 Jan 2019 10:10:47 -0600 Subject: [PATCH 0042/2542] HACK: ntdll: Don't pass SDL_AUDIODRIVER from Linux environment. --- dlls/ntdll/unix/env.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index 0158d56a4f4b..077976742fe0 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -346,6 +346,7 @@ static BOOL is_special_env_var( const char *var ) STARTS_WITH( var, "TEMP=" ) || STARTS_WITH( var, "TMP=" ) || STARTS_WITH( var, "QT_" ) || + STARTS_WITH( var, "SDL_AUDIODRIVER=" ) || STARTS_WITH( var, "VK_" ) || STARTS_WITH( var, "XDG_SESSION_TYPE=" )); } From 4c5b4a7307d7d174efbd61a4bd1cd8238f4dd42d Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Thu, 19 Dec 2019 09:12:17 -0600 Subject: [PATCH 0043/2542] HACK: winex11: Remove nvidia hack workaround. This breaks things for users who legitimately have only one resolution. --- dlls/winex11.drv/xrandr.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index 48b579e87e3a..3747b5e16909 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -36,9 +36,6 @@ #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(xrandr); -#ifdef HAVE_XRRGETPROVIDERRESOURCES -WINE_DECLARE_DEBUG_CHANNEL(winediag); -#endif #ifdef SONAME_LIBXRANDR @@ -456,7 +453,6 @@ static BOOL is_broken_driver(void) XRRScreenResources *screen_resources; XRROutputInfo *output_info; XRRModeInfo *first_mode; - INT major, event, error; INT output_idx, i, j; BOOL only_one_mode; @@ -507,15 +503,6 @@ static BOOL is_broken_driver(void) if (!only_one_mode) continue; - - /* Check if it is NVIDIA proprietary driver */ - if (XQueryExtension( gdi_display, "NV-CONTROL", &major, &event, &error )) - { - ERR_(winediag)("Broken NVIDIA RandR detected, falling back to RandR 1.0. " - "Please consider using the Nouveau driver instead.\n"); - pXRRFreeScreenResources( screen_resources ); - return TRUE; - } } pXRRFreeScreenResources( screen_resources ); return FALSE; From ea59818c0893fe447ab32f4b7ba5c0dc48993f8c Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Mon, 23 May 2022 13:17:32 -0500 Subject: [PATCH 0044/2542] HACK: ntdll: Disable 16-bit TIB hack. MechWarrior Online (342200) writes directly to the SubSystemTib field, which Wine would interpret to mean it's a 16-bit executable and then crash. We're unlikely to run into any real 16-bit applications in Proton (they won't work on modern Windows, anyway), so let's just disable that hack entirely. CW-Bug-Id: #20673 --- dlls/kernelbase/loader.c | 2 +- dlls/ntdll/env.c | 2 +- dlls/ntdll/path.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/kernelbase/loader.c b/dlls/kernelbase/loader.c index 7afbe0460ebb..22f84d664ce8 100644 --- a/dlls/kernelbase/loader.c +++ b/dlls/kernelbase/loader.c @@ -301,7 +301,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetModuleFileNameW( HMODULE module, LPWSTR filena UNICODE_STRING name; NTSTATUS status; - if (!module && ((win16_tib = NtCurrentTeb()->Tib.SubSystemTib)) && win16_tib->exe_name) + if (!module && (0 && (win16_tib = NtCurrentTeb()->Tib.SubSystemTib)) && win16_tib->exe_name) { len = min( size, win16_tib->exe_name->Length / sizeof(WCHAR) ); memcpy( filename, win16_tib->exe_name->Buffer, len * sizeof(WCHAR) ); diff --git a/dlls/ntdll/env.c b/dlls/ntdll/env.c index 7fae94f3b52c..700ab0803b1f 100644 --- a/dlls/ntdll/env.c +++ b/dlls/ntdll/env.c @@ -617,7 +617,7 @@ NTSTATUS WINAPI RtlCreateProcessParametersEx( RTL_USER_PROCESS_PARAMETERS **resu if (!DllPath) DllPath = &null_str; if (!CurrentDirectoryName) { - if (NtCurrentTeb()->Tib.SubSystemTib) /* FIXME: hack */ + if (0 && NtCurrentTeb()->Tib.SubSystemTib) /* FIXME: hack */ curdir = ((WIN16_SUBSYSTEM_TIB *)NtCurrentTeb()->Tib.SubSystemTib)->curdir.DosPath; else curdir = cur_params->CurrentDirectory.DosPath; diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c index 8956ff07f6c1..6aa4bb3fdff0 100644 --- a/dlls/ntdll/path.c +++ b/dlls/ntdll/path.c @@ -528,7 +528,7 @@ static ULONG get_full_path_helper(LPCWSTR name, LPWSTR buffer, ULONG size) RtlAcquirePebLock(); - if (NtCurrentTeb()->Tib.SubSystemTib) /* FIXME: hack */ + if (0 && NtCurrentTeb()->Tib.SubSystemTib) /* FIXME: hack */ cd = &((WIN16_SUBSYSTEM_TIB *)NtCurrentTeb()->Tib.SubSystemTib)->curdir.DosPath; else cd = &NtCurrentTeb()->Peb->ProcessParameters->CurrentDirectory.DosPath; @@ -883,7 +883,7 @@ ULONG WINAPI RtlGetCurrentDirectory_U(ULONG buflen, LPWSTR buf) RtlAcquirePebLock(); - if (NtCurrentTeb()->Tib.SubSystemTib) /* FIXME: hack */ + if (0 && NtCurrentTeb()->Tib.SubSystemTib) /* FIXME: hack */ us = &((WIN16_SUBSYSTEM_TIB *)NtCurrentTeb()->Tib.SubSystemTib)->curdir.DosPath; else us = &NtCurrentTeb()->Peb->ProcessParameters->CurrentDirectory.DosPath; @@ -927,7 +927,7 @@ NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING* dir) RtlAcquirePebLock(); - if (NtCurrentTeb()->Tib.SubSystemTib) /* FIXME: hack */ + if (0 && NtCurrentTeb()->Tib.SubSystemTib) /* FIXME: hack */ curdir = &((WIN16_SUBSYSTEM_TIB *)NtCurrentTeb()->Tib.SubSystemTib)->curdir; else curdir = &NtCurrentTeb()->Peb->ProcessParameters->CurrentDirectory; From e277c9f152d529894bb78260553970d9b276a5d4 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Mon, 6 Aug 2018 08:06:03 -0500 Subject: [PATCH 0045/2542] HACK: proton: server: Set default timeout to 0 The Steam client will be waiting for the wineserver to exit to set up some environment variables, so make it wait as short as possible. --- server/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/main.c b/server/main.c index 1248b92f24d5..efddef7f7150 100644 --- a/server/main.c +++ b/server/main.c @@ -38,7 +38,7 @@ /* command-line options */ int debug_level = 0; int foreground = 0; -timeout_t master_socket_timeout = 3 * -TICKS_PER_SEC; /* master socket timeout, default is 3 seconds */ +timeout_t master_socket_timeout = 0; /* master socket timeout, default is 3 seconds */ const char *server_argv0; /* parse-line args */ From b485d5901b813304ab9fefd3e77478b1facf76b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 5 Dec 2023 17:27:46 +0100 Subject: [PATCH 0046/2542] HACK: wineboot: Print more information when TSC calibration fails. --- programs/wineboot/wineboot.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c index fa33c6b50964..ac419b4d1f43 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c @@ -360,7 +360,13 @@ static UINT64 read_tsc_frequency(void) } while (error > 500 && --retries); - if (!retries) WARN( "TSC frequency calibration failed, unstable TSC?\n" ); + if (!retries) + { + FIXME( "TSC frequency calibration failed, unstable TSC?"); + FIXME( "time0 %I64u ns, time1 %I64u ns\n", time0 * 100, time1 * 100 ); + FIXME( "tsc2 - tsc0 %I64u, tsc3 - tsc1 %I64u\n", tsc2 - tsc0, tsc3 - tsc1 ); + FIXME( "freq0 %I64u Hz, freq2 %I64u Hz, error %I64u ppm\n", freq0, freq1, error ); + } else { freq = (freq0 + freq1) / 2; From f71ce5910f72b31dc7452a1e0e117de0487f0744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 16 Oct 2020 23:37:09 +0200 Subject: [PATCH 0047/2542] dotnetfx35.exe: Add stub program. This makes it possible to override native dotnetfx35 installer, which is broken in an unfixable way. Recent Windows versions also bypass its execution somehow. --- configure.ac | 1 + programs/dotnetfx35/Makefile.in | 7 +++++++ programs/dotnetfx35/main.c | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 programs/dotnetfx35/Makefile.in create mode 100644 programs/dotnetfx35/main.c diff --git a/configure.ac b/configure.ac index 99c5a2a4a8ab..e1a89e8f83b7 100644 --- a/configure.ac +++ b/configure.ac @@ -3445,6 +3445,7 @@ WINE_CONFIG_MAKEFILE(programs/cscript) WINE_CONFIG_MAKEFILE(programs/dism) WINE_CONFIG_MAKEFILE(programs/dllhost) WINE_CONFIG_MAKEFILE(programs/dplaysvr) +WINE_CONFIG_MAKEFILE(programs/dotnetfx35) WINE_CONFIG_MAKEFILE(programs/dpnsvr) WINE_CONFIG_MAKEFILE(programs/dpvsetup) WINE_CONFIG_MAKEFILE(programs/dxdiag) diff --git a/programs/dotnetfx35/Makefile.in b/programs/dotnetfx35/Makefile.in new file mode 100644 index 000000000000..91d0876db613 --- /dev/null +++ b/programs/dotnetfx35/Makefile.in @@ -0,0 +1,7 @@ +MODULE = dotnetfx35.exe +IMPORTS = + +EXTRADLLFLAGS = -mwindows -mno-cygwin + +SOURCES = \ + main.c diff --git a/programs/dotnetfx35/main.c b/programs/dotnetfx35/main.c new file mode 100644 index 000000000000..cd6df5bcf416 --- /dev/null +++ b/programs/dotnetfx35/main.c @@ -0,0 +1,32 @@ +/* + * Fake dotnetfx35.exe installer + * + * Copyright 2020 Rémi Bernon + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dotnetfx); + +int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + FIXME("stub!"); + return 0; +} From c11f46420ea7b20427f60fcdf5def378ee8b78d7 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Mon, 19 Jun 2023 17:45:01 +0300 Subject: [PATCH 0048/2542] winemenubuilder: Force-disable creating associations. CW-Bug-Id: #20433 --- programs/winemenubuilder/winemenubuilder.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c index 36569fa9d5f7..bc92ddd1cccb 100644 --- a/programs/winemenubuilder/winemenubuilder.c +++ b/programs/winemenubuilder/winemenubuilder.c @@ -2864,20 +2864,7 @@ static BOOL init_xdg(void) static BOOL associations_enabled(void) { - BOOL ret = TRUE; - HKEY hkey; - BYTE buf[32]; - DWORD len; - - if ((hkey = open_associations_reg_key())) - { - len = sizeof(buf); - if (!RegQueryValueExA(hkey, "Enable", NULL, NULL, buf, &len)) - ret = IS_OPTION_TRUE(buf[0]); - RegCloseKey( hkey ); - } - - return ret; + return FALSE; } /*********************************************************************** From efdff8454cb2e2f63be18b5119faf6d3f671fa78 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Mon, 19 Jun 2023 17:46:18 +0300 Subject: [PATCH 0049/2542] winemenubuilder: Save .desktop files in c:\proton_shortcuts\. CW-Bug-Id: #20433 --- programs/winemenubuilder/winemenubuilder.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c index bc92ddd1cccb..4149de5f5036 100644 --- a/programs/winemenubuilder/winemenubuilder.c +++ b/programs/winemenubuilder/winemenubuilder.c @@ -1265,6 +1265,7 @@ static BOOL write_desktop_entry(const WCHAR *link, const WCHAR *location, const int needs_chmod = FALSE; const WCHAR *name; const WCHAR *prefix = _wgetenv( L"WINECONFIGDIR" ); + WCHAR *shortcuts_dir; WINE_TRACE("(%s,%s,%s,%s,%s,%s,%s,%s,%s)\n", wine_dbgstr_w(link), wine_dbgstr_w(location), wine_dbgstr_w(linkname), wine_dbgstr_w(path), wine_dbgstr_w(args), @@ -1272,11 +1273,12 @@ static BOOL write_desktop_entry(const WCHAR *link, const WCHAR *location, const wine_dbgstr_w(wmclass)); name = PathFindFileNameW( linkname ); - if (!location) - { - location = heap_wprintf(L"%s\\%s.desktop", xdg_desktop_dir, name); - needs_chmod = TRUE; - } + + shortcuts_dir = heap_wprintf(L"%s", L"c:\\proton_shortcuts"); + create_directories(shortcuts_dir); + location = heap_wprintf(L"%s\\%s.desktop", shortcuts_dir, name); + heap_free(shortcuts_dir); + needs_chmod = TRUE; file = _wfopen( location, L"wb" ); if (file == NULL) From f4cf406a982f260685b98be4058c0f6b61597df9 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Mon, 19 Jun 2023 17:47:02 +0300 Subject: [PATCH 0050/2542] winemenubuilder: User raw exe path in the created .desktop files. We don't need the magic wine/prefix invocations. CW-Bug-Id: #20433 --- programs/winemenubuilder/winemenubuilder.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c index 4149de5f5036..ca92810c421c 100644 --- a/programs/winemenubuilder/winemenubuilder.c +++ b/programs/winemenubuilder/winemenubuilder.c @@ -1264,7 +1264,6 @@ static BOOL write_desktop_entry(const WCHAR *link, const WCHAR *location, const char *workdir_unix; int needs_chmod = FALSE; const WCHAR *name; - const WCHAR *prefix = _wgetenv( L"WINECONFIGDIR" ); WCHAR *shortcuts_dir; WINE_TRACE("(%s,%s,%s,%s,%s,%s,%s,%s,%s)\n", wine_dbgstr_w(link), wine_dbgstr_w(location), @@ -1287,13 +1286,8 @@ static BOOL write_desktop_entry(const WCHAR *link, const WCHAR *location, const fprintf(file, "[Desktop Entry]\n"); fprintf(file, "Name=%s\n", wchars_to_utf8_chars(name)); fprintf(file, "Exec=" ); - if (prefix) - { - char *path = wine_get_unix_file_name( prefix ); - fprintf(file, "env WINEPREFIX=\"%s\" ", path); - heap_free( path ); - } - fprintf(file, "wine %s", escape(path)); + + fprintf(file, "%s", escape(path)); if (args) fprintf(file, " %s", escape(args) ); fputc( '\n', file ); fprintf(file, "Type=Application\n"); From 00c2ed4f5b6907e2027fd3558c8748a688339e96 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Mon, 19 Jun 2023 17:48:37 +0300 Subject: [PATCH 0051/2542] winemenubuilder: Don't create menu entries. CW-Bug-Id: #20433 --- programs/winemenubuilder/winemenubuilder.c | 100 --------------------- 1 file changed, 100 deletions(-) diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c index ca92810c421c..b05cafdfd7a8 100644 --- a/programs/winemenubuilder/winemenubuilder.c +++ b/programs/winemenubuilder/winemenubuilder.c @@ -1319,100 +1319,6 @@ static BOOL write_desktop_entry(const WCHAR *link, const WCHAR *location, const return TRUE; } -static BOOL write_directory_entry(const WCHAR *directory, const WCHAR *location) -{ - FILE *file; - - WINE_TRACE("(%s,%s)\n", wine_dbgstr_w(directory), wine_dbgstr_w(location)); - - file = _wfopen( location, L"wb" ); - if (file == NULL) - return FALSE; - - fprintf(file, "[Desktop Entry]\n"); - fprintf(file, "Type=Directory\n"); - if (wcscmp(directory, L"wine") == 0) - { - fprintf(file, "Name=Wine\n"); - fprintf(file, "Icon=wine\n"); - } - else - { - fprintf(file, "Name=%s\n", wchars_to_utf8_chars(directory)); - fprintf(file, "Icon=folder\n"); - } - - fclose(file); - return TRUE; -} - -static BOOL write_menu_file(const WCHAR *windows_link, const WCHAR *link) -{ - WCHAR tempfilename[MAX_PATH]; - FILE *tempfile = NULL; - WCHAR *filename, *lastEntry, *menuPath; - int i; - int count = 0; - BOOL ret = FALSE; - - WINE_TRACE("(%s)\n", wine_dbgstr_w(link)); - - GetTempFileNameW( xdg_menu_dir, L"mnu", 0, tempfilename ); - if (!(tempfile = _wfopen( tempfilename, L"wb" ))) return FALSE; - - fprintf(tempfile, "\n"); - fprintf(tempfile, "

\n"); - fprintf(tempfile, " Applications\n"); - - filename = heap_wprintf(L"wine\\%s.desktop", link); - lastEntry = filename; - for (i = 0; filename[i]; i++) - { - if (filename[i] == '\\') - { - WCHAR *dir_file_name; - const char *prefix = count ? "" : "wine-"; - - filename[i] = 0; - fprintf(tempfile, " \n"); - fprintf(tempfile, " %s%s\n", - prefix, wchars_to_xml_text(filename)); - fprintf(tempfile, " %s%s.directory\n", - prefix, wchars_to_xml_text(filename)); - dir_file_name = heap_wprintf(L"%s\\desktop-directories\\%s%s.directory", - xdg_data_dir, count ? L"" : L"wine-", filename); - if (GetFileAttributesW( dir_file_name ) == INVALID_FILE_ATTRIBUTES) - write_directory_entry(lastEntry, dir_file_name); - free(dir_file_name); - filename[i] = '-'; - lastEntry = &filename[i+1]; - ++count; - } - } - filename[i] = 0; - - fprintf(tempfile, " \n"); - fprintf(tempfile, " %s\n", wchars_to_xml_text(filename)); - fprintf(tempfile, " \n"); - for (i = 0; i < count; i++) - fprintf(tempfile, " \n"); - fprintf(tempfile, "\n"); - - menuPath = heap_wprintf(L"%s\\%s", xdg_menu_dir, filename); - lstrcpyW(menuPath + lstrlenW(menuPath) - lstrlenW(L".desktop"), L".menu"); - - fclose(tempfile); - ret = MoveFileExW( tempfilename, menuPath, MOVEFILE_REPLACE_EXISTING ); - if (ret) - register_menus_entry(menuPath, windows_link); - else - DeleteFileW( tempfilename ); - free(filename); - free(menuPath); - return ret; -} - static BOOL write_menu_entry(const WCHAR *windows_link, const WCHAR *link, const WCHAR *path, const WCHAR *args, const WCHAR *descr, const WCHAR *workdir, const WCHAR *icon, const WCHAR *wmclass) { @@ -1442,12 +1348,6 @@ static BOOL write_menu_entry(const WCHAR *windows_link, const WCHAR *link, const goto end; } - if (!write_menu_file(windows_link, link)) - { - WINE_WARN("couldn't make menu file %s\n", wine_dbgstr_w(filename)); - ret = FALSE; - } - end: free(desktopPath); free(filename); From 49a25bfdad25ae2d824bb5e93dc3f8a42f24a00e Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Mon, 19 Jun 2023 17:49:13 +0300 Subject: [PATCH 0052/2542] winemenubuilder: Save icons in c:\proton_shortcuts\icons\ CW-Bug-Id: #20433 --- programs/winemenubuilder/winemenubuilder.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c index b05cafdfd7a8..6d34fa687ad9 100644 --- a/programs/winemenubuilder/winemenubuilder.c +++ b/programs/winemenubuilder/winemenubuilder.c @@ -1082,7 +1082,8 @@ static HRESULT platform_write_icon(IStream *icoStream, ICONDIRENTRY *iconDirEntr LARGE_INTEGER zero; *nativeIdentifier = compute_native_identifier(exeIndex, icoPathW, destFilename); - iconsDir = heap_wprintf(L"%s\\icons\\hicolor", xdg_data_dir); + iconsDir = heap_wprintf(L"%s", L"c:\\proton_shortcuts\\icons"); + create_directories(iconsDir); for (i = 0; i < numEntries; i++) { From d26c9d7af0223563b189854bba3b8d42cee32025 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Mon, 19 Jun 2023 16:28:01 +0300 Subject: [PATCH 0053/2542] wine.inf: Don't use winemenubuilder to create filetype associations. CW-Bug-Id: #20433 --- loader/wine.inf.in | 1 - 1 file changed, 1 deletion(-) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 5bfbd8327397..adc39f23ab47 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2529,7 +2529,6 @@ StartType=3 ErrorControl=1 [Services] -HKLM,%CurrentVersion%\RunServices,"winemenubuilder",2,"%11%\winemenubuilder.exe -a -r" HKLM,"System\CurrentControlSet\Services\Eventlog\Application",,16 HKLM,"System\CurrentControlSet\Services\Eventlog\System","Sources",0x10000,"" HKLM,"System\CurrentControlSet\Services\Tcpip\Parameters","DataBasePath",,"%12%\etc" From ad390733ac309e5764bbce0fdab8c6978fde4dbe Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Mon, 24 Sep 2018 12:37:49 -0500 Subject: [PATCH 0054/2542] HACK: proton: dbghelp: Disable DWARF parsing. Patch by Zeb. Our DWARF parser has been known to crash winedbg in some cases. Since probably no concerned parties are going to be using plain winedbg, just don't bother parsing anything. --- dlls/dbghelp/dwarf.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 84e861890d57..3190dfecd0a3 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -4208,6 +4208,11 @@ BOOL dwarf2_parse(struct module* module, ULONG_PTR load_offset, struct module_format* dwarf2_modfmt; dwarf2_parse_module_context_t module_ctx; +/* Our DWARF parser has been known to crash winedbg in some cases. Since + * probably no concerned parties are going to be using plain winedbg, just don't + * bother parsing anything. */ +return FALSE; + if (!dwarf2_init_section(&eh_frame, fmap, ".eh_frame", NULL, &eh_frame_sect)) /* lld produces .eh_fram to avoid generating a long name */ dwarf2_init_section(&eh_frame, fmap, ".eh_fram", NULL, &eh_frame_sect); From cb984a1fe68dd66a594839999c16a6d2eaa8ddef Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Mon, 23 Sep 2019 13:29:16 -0500 Subject: [PATCH 0055/2542] HACK: dxdiag: Dump to stdout if no filename is given --- programs/dxdiag/main.c | 8 +++++++- programs/dxdiag/output.c | 10 +++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/programs/dxdiag/main.c b/programs/dxdiag/main.c index b6ea5306d06a..47909dcf2c63 100644 --- a/programs/dxdiag/main.c +++ b/programs/dxdiag/main.c @@ -72,7 +72,13 @@ static BOOL process_file_name(const WCHAR *cmdline, enum output_type output_type endptr = cmdline + lstrlenW(cmdline); len = endptr - cmdline; - if (len == 0 || len >= filename_len) + if (len == 0) + { + *filename = 0; + return TRUE; + } + + if (len >= filename_len) return FALSE; memcpy(filename, cmdline, len * sizeof(WCHAR)); diff --git a/programs/dxdiag/output.c b/programs/dxdiag/output.c index a8eb733ba4b2..63d091395b0f 100644 --- a/programs/dxdiag/output.c +++ b/programs/dxdiag/output.c @@ -149,8 +149,12 @@ static BOOL output_text_information(struct dxdiag_information *dxdiag_info, cons fill_system_text_output_table(dxdiag_info, output_table[0].fields); - hFile = CreateFileW(filename, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if (filename && *filename) + hFile = CreateFileW(filename, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + else + hFile = GetStdHandle(STD_OUTPUT_HANDLE); + if (hFile == INVALID_HANDLE_VALUE) { WINE_ERR("File creation failed, last error %lu\n", GetLastError()); @@ -207,7 +211,7 @@ static HRESULT save_xml_document(IXMLDOMDocument *xmldoc, const WCHAR *filename) VARIANT destVar; HRESULT hr; - if (!bstr) + if (!bstr || !filename || !*filename) return E_OUTOFMEMORY; V_VT(&destVar) = VT_BSTR; From 0ff2d47d212f5d3b4d1eaa3b48dcf1468488e807 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Fri, 30 Mar 2018 10:40:43 -0500 Subject: [PATCH 0056/2542] HACK: winedbg: When crash dialog is not shown, dump crash info to stderr Use the real unix stderr via __wine_dbg_output(). CW-Bug-Id: #21872 --- programs/winedbg/debugger.h | 1 + programs/winedbg/tgt_active.c | 3 +++ programs/winedbg/winedbg.c | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h index 45a91e2a6f5e..ae181a781966 100644 --- a/programs/winedbg/debugger.h +++ b/programs/winedbg/debugger.h @@ -311,6 +311,7 @@ extern DWORD dbg_curr_tid; extern dbg_ctx_t dbg_context; extern BOOL dbg_interactiveP; extern HANDLE dbg_houtput; +extern BOOL dbg_use_wine_dbg_output; struct dbg_internal_var { diff --git a/programs/winedbg/tgt_active.c b/programs/winedbg/tgt_active.c index a919f70a486a..6b951bc2b355 100644 --- a/programs/winedbg/tgt_active.c +++ b/programs/winedbg/tgt_active.c @@ -922,6 +922,9 @@ enum dbg_start dbg_active_auto(int argc, char* argv[]) if (event) thread = display_crash_details( event ); if (thread) dbg_houtput = output = create_temp_file(); break; + case TRUE: + dbg_use_wine_dbg_output = TRUE; + break; } input = parser_generate_command_file("echo Modules:", "info share", diff --git a/programs/winedbg/winedbg.c b/programs/winedbg/winedbg.c index c7f14e8238f1..40ceae48937b 100644 --- a/programs/winedbg/winedbg.c +++ b/programs/winedbg/winedbg.c @@ -82,6 +82,7 @@ DWORD dbg_curr_pid = 0; dbg_ctx_t dbg_context; BOOL dbg_interactiveP = FALSE; HANDLE dbg_houtput = 0; +BOOL dbg_use_wine_dbg_output = FALSE; static struct list dbg_process_list = LIST_INIT(dbg_process_list); @@ -94,6 +95,12 @@ static void dbg_outputA(const char* buffer, int len) DWORD w, i; + if (dbg_use_wine_dbg_output) + { + __wine_dbg_output(buffer); + return; + } + while (len > 0) { unsigned int count = min( len, sizeof(line_buff) - line_pos ); From abc56ec0eb6565e413dd2a25fda88086b7bdac65 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Tue, 18 May 2021 13:34:47 -0500 Subject: [PATCH 0057/2542] HACK: proton: winedbg: Support dumping crash logs to a directory CW-Bug-Id: #18944 --- programs/winedbg/debugger.h | 1 + programs/winedbg/tgt_active.c | 45 +++++++++++++++++++++++++++++++++++ programs/winedbg/winedbg.c | 9 +++---- 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h index ae181a781966..f3b02e9c5df3 100644 --- a/programs/winedbg/debugger.h +++ b/programs/winedbg/debugger.h @@ -311,6 +311,7 @@ extern DWORD dbg_curr_tid; extern dbg_ctx_t dbg_context; extern BOOL dbg_interactiveP; extern HANDLE dbg_houtput; +extern HANDLE dbg_crash_report_file; extern BOOL dbg_use_wine_dbg_output; struct dbg_internal_var diff --git a/programs/winedbg/tgt_active.c b/programs/winedbg/tgt_active.c index 6b951bc2b355..8bb20ecadf2d 100644 --- a/programs/winedbg/tgt_active.c +++ b/programs/winedbg/tgt_active.c @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include "debugger.h" #include "psapi.h" @@ -832,6 +834,48 @@ static HANDLE create_temp_file(void) NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, 0 ); } +static HANDLE create_crash_report_file(void) +{ + const char *dir = getenv("WINE_CRASH_REPORT_DIR"); + const char *sgi; + char timestr[32]; + char name[MAX_PATH], *c; + time_t t; + struct tm lt; + + if(!dir || dir[0] == 0) + return INVALID_HANDLE_VALUE; + + strcpy(name, dir); + + for(c = name + 1; *c; ++c){ + if(*c == '/'){ + *c = 0; + CreateDirectoryA(name, NULL); + *c = '/'; + } + } + CreateDirectoryA(name, NULL); + + sgi = getenv("SteamGameId"); + + t = time(NULL); + lt = *localtime(&t); + strftime(timestr, ARRAY_SIZE(timestr), "%Y-%m-%d_%H:%M:%S", <); + + /* /path/to/crash/reports/2021-05-18_13:21:15_appid-976310_crash.log */ + snprintf(name, ARRAY_SIZE(name), + "%s%s/%s_appid-%s_crash.log", + dir[0] == '/' ? "Z:/" : "", + dir, + timestr, + sgi ? sgi : "0" + ); + + return CreateFileA( name, GENERIC_WRITE, FILE_SHARE_READ, + NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0 ); +} + /****************************************************************** * dbg_active_attach * @@ -924,6 +968,7 @@ enum dbg_start dbg_active_auto(int argc, char* argv[]) break; case TRUE: dbg_use_wine_dbg_output = TRUE; + dbg_crash_report_file = create_crash_report_file(); break; } diff --git a/programs/winedbg/winedbg.c b/programs/winedbg/winedbg.c index 40ceae48937b..b7c899d55c47 100644 --- a/programs/winedbg/winedbg.c +++ b/programs/winedbg/winedbg.c @@ -82,6 +82,7 @@ DWORD dbg_curr_pid = 0; dbg_ctx_t dbg_context; BOOL dbg_interactiveP = FALSE; HANDLE dbg_houtput = 0; +HANDLE dbg_crash_report_file = INVALID_HANDLE_VALUE; BOOL dbg_use_wine_dbg_output = FALSE; static struct list dbg_process_list = LIST_INIT(dbg_process_list); @@ -96,10 +97,7 @@ static void dbg_outputA(const char* buffer, int len) DWORD w, i; if (dbg_use_wine_dbg_output) - { __wine_dbg_output(buffer); - return; - } while (len > 0) { @@ -114,7 +112,10 @@ static void dbg_outputA(const char* buffer, int len) if (len > 0) i = line_pos; /* buffer is full, flush anyway */ else break; } - WriteFile(dbg_houtput, line_buff, i, &w, NULL); + if (!dbg_use_wine_dbg_output) + WriteFile(dbg_houtput, line_buff, i, &w, NULL); + if (dbg_crash_report_file != INVALID_HANDLE_VALUE) + WriteFile(dbg_crash_report_file, line_buff, i, &w, NULL); memmove( line_buff, line_buff + i, line_pos - i ); line_pos -= i; } From b8a5502b612d3445afd7aea4352d11be2b0d3b11 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 17 May 2022 09:38:08 +0300 Subject: [PATCH 0058/2542] getminidump: Add a small tool to create minidumps. Signed-off-by: Nikolay Sivov --- configure.ac | 1 + programs/getminidump/Makefile.in | 7 ++++ programs/getminidump/main.c | 60 ++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 programs/getminidump/Makefile.in create mode 100644 programs/getminidump/main.c diff --git a/configure.ac b/configure.ac index e1a89e8f83b7..6080645c12ce 100644 --- a/configure.ac +++ b/configure.ac @@ -3462,6 +3462,7 @@ WINE_CONFIG_MAKEFILE(programs/findstr) WINE_CONFIG_MAKEFILE(programs/findstr/tests) WINE_CONFIG_MAKEFILE(programs/fsutil) WINE_CONFIG_MAKEFILE(programs/fsutil/tests) +WINE_CONFIG_MAKEFILE(programs/getminidump) WINE_CONFIG_MAKEFILE(programs/hh) WINE_CONFIG_MAKEFILE(programs/hostname) WINE_CONFIG_MAKEFILE(programs/icacls) diff --git a/programs/getminidump/Makefile.in b/programs/getminidump/Makefile.in new file mode 100644 index 000000000000..56d148dfb9d2 --- /dev/null +++ b/programs/getminidump/Makefile.in @@ -0,0 +1,7 @@ +MODULE = getminidump.exe +IMPORTS = shcore dbghelp + +EXTRADLLFLAGS = -mwindows -municode + +SOURCES = \ + main.c diff --git a/programs/getminidump/main.c b/programs/getminidump/main.c new file mode 100644 index 000000000000..3cc5010797a2 --- /dev/null +++ b/programs/getminidump/main.c @@ -0,0 +1,60 @@ +/* + * Copyright 2022 Nikolay Sivov for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +#include +#include +#include + +int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, WCHAR *cmdline, int nCmdShow) +{ + HANDLE process, dumpfile; + WCHAR **argv, *ptr; + DWORD pid; + int argc; + BOOL ret; + + argv = CommandLineToArgvW(cmdline, &argc); + if (argc < 1) return 1; + + ptr = argv[0]; + if (ptr[0] == '0' && towlower(ptr[1]) == 'x') + pid = wcstoul(ptr, NULL, 16); + else + pid = wcstoul(ptr, NULL, 10); + + process = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid); + if (!process) + return 2; + + dumpfile = CreateFileW(L"minidump.dmp", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if (dumpfile == INVALID_HANDLE_VALUE) + { + CloseHandle(process); + return 3; + } + + ret = MiniDumpWriteDump(process, pid, dumpfile, MiniDumpNormal | MiniDumpWithFullMemory, NULL, NULL, NULL); + + CloseHandle(dumpfile); + CloseHandle(process); + + return ret ? 0 : 4; +} From 8ba2e76cd79ccd93d44e2018a34368eee0a2bd4e Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Thu, 9 Feb 2023 21:24:57 +0200 Subject: [PATCH 0059/2542] HACK: kernelbase: Do not flash the winedbg console window. Depending on what the crashing software does with the handles / own console we may end up creating a new console window for windbg. Since Proton defaults to starting windbg in a non-interactive mode without displaying the crash dialog and redirects the log to unix's stderr we want to avoid confusing users. CW-Bug-Id: #21872 --- dlls/kernelbase/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/kernelbase/debug.c b/dlls/kernelbase/debug.c index cbefc0c87334..26e145ed575a 100644 --- a/dlls/kernelbase/debug.c +++ b/dlls/kernelbase/debug.c @@ -627,7 +627,7 @@ static BOOL start_debugger( EXCEPTION_POINTERS *epointers, HANDLE event ) startup.cb = sizeof(startup); startup.dwFlags = STARTF_USESHOWWINDOW; startup.wShowWindow = SW_SHOWNORMAL; - ret = CreateProcessW( NULL, cmdline, NULL, NULL, TRUE, CREATE_UNICODE_ENVIRONMENT, env, NULL, &startup, &info ); + ret = CreateProcessW( NULL, cmdline, NULL, NULL, TRUE, CREATE_UNICODE_ENVIRONMENT | CREATE_NO_WINDOW, env, NULL, &startup, &info ); FreeEnvironmentStringsW( env ); if (ret) From 6c3760eee7f303ca084b92cb701ddd05a5300ff8 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Fri, 25 Aug 2023 09:34:45 +0200 Subject: [PATCH 0060/2542] dbghelp: Protect ELF's link_map walking in case of bogus entries. That's not fixing the cause of the bug below, but protects it from hanging while walking the bogus list. CW-Bug-Id: #22658 --- dlls/dbghelp/elf_module.c | 86 +++++++++++++++++++++++++++++++-------- 1 file changed, 70 insertions(+), 16 deletions(-) diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c index a4cf37942f05..7f5c05b46826 100644 --- a/dlls/dbghelp/elf_module.c +++ b/dlls/dbghelp/elf_module.c @@ -1466,6 +1466,59 @@ static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename, typedef BOOL (*enum_elf_modules_cb)(const WCHAR*, ULONG_PTR load_addr, ULONG_PTR dyn_addr, BOOL is_system, void* user); +static BOOL elf_linkmap_validate_entry(const struct process* pcs, DWORD64 base, DWORD64 name_addr, WCHAR* buffer, SIZE_T buflen) +{ + static DWORD page_size; + MEMORY_BASIC_INFORMATION mem_info; + char bufstr[MAX_PATH]; + + if (!page_size) + { + SYSTEM_INFO sys_info; + GetSystemInfo(&sys_info); + page_size = sys_info.dwPageSize; + } + if (base & (page_size - 1)) + { + WARN("Unaligned base addr=%I64x page_size=%lx\n", base, page_size); + return FALSE; + } + if (VirtualQueryEx(pcs->handle, (void*)(ULONG_PTR)base, &mem_info, sizeof(mem_info))) + { + if (mem_info.BaseAddress != (void*)(ULONG_PTR)base) + { + WARN("Invalid base addr %I64x (beg map at %p)\n", base, mem_info.BaseAddress); + return FALSE; + } + } + else + { + /* Some ELF modules are loaded in 32bit mode above 2G limit, + * and virtual query will fail on these addresses when process is not large address aware. + * Don't consider this as an error for a 32bit debuggee. + */ + if (pcs->is_64bit) + { + WARN("Invalid base addr %I64x\n", base); + return FALSE; + } + } + + memset(bufstr, ' ', sizeof(bufstr)); + if (!read_process_memory(pcs, name_addr, bufstr, sizeof(bufstr))) + { + WARN("Invalid name_address %I64x\n", name_addr); + return FALSE; + } + if (!memchr(bufstr, '\0', sizeof(bufstr))) + { + WARN("Unterminated string %s\n", wine_dbgstr_an(bufstr, sizeof(bufstr))); + return FALSE; + } + MultiByteToWideChar(CP_UNIXCP, 0, bufstr, -1, buffer, buflen); + return TRUE; +} + /****************************************************************** * elf_enum_modules_internal * @@ -1475,8 +1528,7 @@ static BOOL elf_enum_modules_internal(const struct process* pcs, const WCHAR* main_name, enum_elf_modules_cb cb, void* user) { - WCHAR bufstrW[MAX_PATH]; - char bufstr[256]; + WCHAR bufstr[MAX_PATH]; ULONG_PTR lm_addr; if (pcs->is_host_64bit) @@ -1510,15 +1562,16 @@ static BOOL elf_enum_modules_internal(const struct process* pcs, if (!read_process_memory(pcs, lm_addr, &lm, sizeof(lm))) return FALSE; - if (lm.l_prev && /* skip first entry, normally debuggee itself */ - lm.l_name && read_process_memory(pcs, lm.l_name, bufstr, sizeof(bufstr))) + /* skip first entry(normally debuggee itself) and entries without names */ + if (!lm.l_prev || !lm.l_name) continue; + if (!elf_linkmap_validate_entry(pcs, lm.l_addr, lm.l_name, bufstr, ARRAY_SIZE(bufstr))) { - bufstr[sizeof(bufstr) - 1] = '\0'; - MultiByteToWideChar(CP_UNIXCP, 0, bufstr, -1, bufstrW, ARRAY_SIZE(bufstrW)); - if (main_name && !bufstrW[0]) lstrcpyW(bufstrW, main_name); - if (!cb(bufstrW, (ULONG_PTR)lm.l_addr, (ULONG_PTR)lm.l_ld, FALSE, user)) - break; + FIXME("Incorrect link_map entry, bailing out\n"); + return FALSE; } + if (main_name && !bufstr[0]) lstrcpyW(bufstr, main_name); + if (!cb(bufstr, (ULONG_PTR)lm.l_addr, (ULONG_PTR)lm.l_ld, FALSE, user)) + break; } } else @@ -1552,15 +1605,16 @@ static BOOL elf_enum_modules_internal(const struct process* pcs, if (!read_process_memory(pcs, lm_addr, &lm, sizeof(lm))) return FALSE; - if (lm.l_prev && /* skip first entry, normally debuggee itself */ - lm.l_name && read_process_memory(pcs, lm.l_name, bufstr, sizeof(bufstr))) + /* skip first entry(normally debuggee itself) and entries without names */ + if (!lm.l_prev || !lm.l_name) continue; + if (!elf_linkmap_validate_entry(pcs, lm.l_addr, lm.l_name, bufstr, ARRAY_SIZE(bufstr))) { - bufstr[sizeof(bufstr) - 1] = '\0'; - MultiByteToWideChar(CP_UNIXCP, 0, bufstr, -1, bufstrW, ARRAY_SIZE(bufstrW)); - if (main_name && !bufstrW[0]) lstrcpyW(bufstrW, main_name); - if (!cb(bufstrW, (ULONG_PTR)lm.l_addr, (ULONG_PTR)lm.l_ld, FALSE, user)) - break; + FIXME("Incorrect link_map entry, bailing out\n"); + return FALSE; } + if (main_name && !bufstr[0]) lstrcpyW(bufstr, main_name); + if (!cb(bufstr, (ULONG_PTR)lm.l_addr, (ULONG_PTR)lm.l_ld, FALSE, user)) + break; } } From 5b90c18096f1f7a2d408351957413c7af31c09bf Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 15 Feb 2023 21:00:47 -0600 Subject: [PATCH 0061/2542] kernelbase: Do not attempt to start winedbg if logging is disabled. CW-Bug-Id: #20812 --- dlls/kernelbase/debug.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/kernelbase/debug.c b/dlls/kernelbase/debug.c index 26e145ed575a..a48babd01301 100644 --- a/dlls/kernelbase/debug.c +++ b/dlls/kernelbase/debug.c @@ -662,6 +662,8 @@ static BOOL start_debugger_atomic( EXCEPTION_POINTERS *epointers ) { static HANDLE once; + if (!ERR_ON(seh)) return FALSE; + if (once == 0) { OBJECT_ATTRIBUTES attr; From a02f839bd69b7ef82442122af913ff3a50d69e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 2 Nov 2020 13:21:49 +0100 Subject: [PATCH 0062/2542] wine/server: Add traces for client requests. --- dlls/ntdll/unix/thread.c | 2 +- include/wine/server.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index b64a7dd40afb..e20658a56f8f 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -1925,7 +1925,7 @@ static void set_native_thread_name( HANDLE handle, const UNICODE_STRING *name ) #ifdef linux unsigned int status; char path[64], nameA[64]; - int unix_pid, unix_tid, len, fd; + int unix_pid = -1, unix_tid = -1, len, fd; SERVER_START_REQ( get_thread_times ) { diff --git a/include/wine/server.h b/include/wine/server.h index 458c33c27b56..6b55b10f0884 100644 --- a/include/wine/server.h +++ b/include/wine/server.h @@ -26,6 +26,7 @@ #include #include #include +#include /* client communication functions */ @@ -149,6 +150,8 @@ static inline struct rectangle wine_server_rectangle( RECT rect ) #define SERVER_START_REQ(type) \ do { \ + WINE_DECLARE_DEBUG_CHANNEL(client); \ + static const char *const __req_name = #type; \ struct __server_request_info __req; \ struct type##_request * const req = &__req.u.req.type##_request; \ const struct type##_reply * const reply = &__req.u.reply.type##_reply; \ @@ -156,10 +159,12 @@ static inline struct rectangle wine_server_rectangle( RECT rect ) __req.u.req.request_header.req = REQ_##type; \ __req.data_count = 0; \ (void)reply; \ + TRACE_(client)("%s start\n", __req_name); \ do #define SERVER_END_REQ \ while(0); \ + TRACE_(client)("%s end\n", __req_name); \ } while(0) From 387ef3e4967c267df1c7cb05d2988c7e8b120e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 2 Nov 2020 13:32:07 +0100 Subject: [PATCH 0063/2542] ntdll: Add +microsecs channel for precise timestamps. --- dlls/ntdll/thread.c | 10 +++++++++- dlls/ntdll/unix/debug.c | 10 +++++++++- dlls/winecrt0/debug.c | 12 +++++++++++- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index 2e1c3ce349e8..25f301b57f41 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -35,6 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(thread); WINE_DECLARE_DEBUG_CHANNEL(relay); WINE_DECLARE_DEBUG_CHANNEL(pid); WINE_DECLARE_DEBUG_CHANNEL(timestamp); +WINE_DECLARE_DEBUG_CHANNEL(microsecs); struct _KUSER_SHARED_DATA *user_shared_data = (void *)0x7ffe0000; @@ -148,7 +149,14 @@ int __cdecl __wine_dbg_header( enum __wine_debug_class cls, struct __wine_debug_ /* only print header if we are at the beginning of the line */ if (info->out_pos) return 0; - if (TRACE_ON(timestamp)) + if (TRACE_ON(microsecs)) + { + LARGE_INTEGER counter, frequency, microsecs; + NtQueryPerformanceCounter(&counter, &frequency); + microsecs.QuadPart = counter.QuadPart * 1000000 / frequency.QuadPart; + pos += sprintf( pos, "%3u.%06u:", (unsigned int)(microsecs.QuadPart / 1000000), (unsigned int)(microsecs.QuadPart % 1000000) ); + } + else if (TRACE_ON(timestamp)) { ULONG ticks = NtGetTickCount(); pos += sprintf( pos, "%3lu.%03lu:", ticks / 1000, ticks % 1000 ); diff --git a/dlls/ntdll/unix/debug.c b/dlls/ntdll/unix/debug.c index e84a47f58a42..76832bc92fa1 100644 --- a/dlls/ntdll/unix/debug.c +++ b/dlls/ntdll/unix/debug.c @@ -44,6 +44,7 @@ WINE_DECLARE_DEBUG_CHANNEL(pid); WINE_DECLARE_DEBUG_CHANNEL(timestamp); +WINE_DECLARE_DEBUG_CHANNEL(microsecs); WINE_DEFAULT_DEBUG_CHANNEL(ntdll); struct debug_info @@ -335,7 +336,14 @@ int __cdecl __wine_dbg_header( enum __wine_debug_class cls, struct __wine_debug_ if (init_done) { - if (TRACE_ON(timestamp)) + if (TRACE_ON(microsecs)) + { + LARGE_INTEGER counter, frequency, microsecs; + NtQueryPerformanceCounter(&counter, &frequency); + microsecs.QuadPart = counter.QuadPart * 1000000 / frequency.QuadPart; + pos += sprintf( pos, "%3u.%06u:", (unsigned int)(microsecs.QuadPart / 1000000), (unsigned int)(microsecs.QuadPart % 1000000) ); + } + else if (TRACE_ON(timestamp)) { UINT ticks = NtGetTickCount(); pos += snprintf( pos, sizeof(info->output) - (pos - info->output), "%3u.%03u:", ticks / 1000, ticks % 1000 ); diff --git a/dlls/winecrt0/debug.c b/dlls/winecrt0/debug.c index 2ac4505fb858..fe516e088c5f 100644 --- a/dlls/winecrt0/debug.c +++ b/dlls/winecrt0/debug.c @@ -30,6 +30,7 @@ WINE_DECLARE_DEBUG_CHANNEL(pid); WINE_DECLARE_DEBUG_CHANNEL(timestamp); +WINE_DECLARE_DEBUG_CHANNEL(microsecs); static const char * (__cdecl *p__wine_dbg_strdup)( const char *str ); static int (__cdecl *p__wine_dbg_output)( const char *str ); @@ -189,7 +190,16 @@ static int __cdecl fallback__wine_dbg_header( enum __wine_debug_class cls, /* skip header if partial line and no other thread came in between */ if (partial_line_tid == GetCurrentThreadId()) return 0; - if (TRACE_ON(timestamp)) + if (TRACE_ON(microsecs)) + { + static LARGE_INTEGER frequency; + LARGE_INTEGER counter, microsecs; + if (!frequency.QuadPart) QueryPerformanceFrequency(&frequency); + QueryPerformanceCounter(&counter); + microsecs.QuadPart = counter.QuadPart * 1000000 / frequency.QuadPart; + pos += sprintf( pos, "%3u.%06u:", (unsigned int)(microsecs.QuadPart / 1000000), (unsigned int)(microsecs.QuadPart % 1000000) ); + } + else if (TRACE_ON(timestamp)) { UINT ticks = GetTickCount(); pos += sprintf( pos, "%3u.%03u:", ticks / 1000, ticks % 1000 ); From cf4f0046737437cd8f0010bde4bb0ac0cdb10197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 21 Jun 2021 21:33:09 +0200 Subject: [PATCH 0064/2542] tools: Add gdbinit helper with LoadSymbolFiles command. To help gdb reload symbol files from /proc//maps, making it possible to load debug info for ELF and PE modules for Wine processes. When sourced (from ~/.gdbinit for instance), this adds a new "load-symbol-files" command (with an "lsf" alias), which automatically calls add-symbol-file on every mapped file that can be read as ELF or PE, with the correct section offset. The command has to be run manually, for instance after executing for a while, to load new modules that may have been loaded, as there's no way for gdb to be notified of such changes automatically. --- tools/Makefile.in | 1 + tools/gdbinit.py | 113 ++++++++++++++++++++++++++++++++++++++++++++ tools/gdbinit.py.in | 1 + 3 files changed, 115 insertions(+) create mode 100644 tools/gdbinit.py create mode 120000 tools/gdbinit.py.in diff --git a/tools/Makefile.in b/tools/Makefile.in index 453d41e06e15..39dd237fa998 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -3,6 +3,7 @@ PROGRAMS = \ make_xftmpl SOURCES = \ + gdbinit.py.in \ make_xftmpl.c \ makedep.c \ wineapploader.in diff --git a/tools/gdbinit.py b/tools/gdbinit.py new file mode 100644 index 000000000000..ba3b7d003ac7 --- /dev/null +++ b/tools/gdbinit.py @@ -0,0 +1,113 @@ +#!/bin/env python3 + +# Copyright 2021 Rémi Bernon for CodeWeavers +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + +from __future__ import print_function + +import gdb +import re +import subprocess +import sys + +class LoadSymbolFiles(gdb.Command): + 'Command to load symbol files directly from /proc//maps.' + + def __init__(self): + sup = super(LoadSymbolFiles, self) + sup.__init__('load-symbol-files', gdb.COMMAND_FILES, gdb.COMPLETE_NONE, + False) + + self.libs = {} + gdb.execute('alias -a lsf = load-symbol-files', True) + + def invoke(self, arg, from_tty): + pid = gdb.selected_inferior().pid + if not pid in self.libs: self.libs[pid] = {} + + def command(cmd, confirm=from_tty, to_string=not from_tty): + gdb.execute(cmd, from_tty=confirm, to_string=to_string) + + def execute(cmd): + return subprocess.check_output(cmd, stderr=subprocess.STDOUT) \ + .decode('utf-8') + + # load mappings addresses + libs = {} + with open('/proc/{}/maps'.format(pid), 'r') as maps: + for line in maps: + addr, _, _, _, node, path = re.split(r'\s+', line, 5) + path = path.strip() + if node == '0': continue + if path in libs: continue + libs[path] = int(addr.split('-')[0], 16) + + # unload symbol file if address changed + for k in set(libs) & set(self.libs[pid]): + if libs[k] != self.libs[pid][k]: + command('remove-symbol-file "{}"'.format(k), confirm=False) + del self.libs[k] + + # load symbol file for new mappings + for k in set(libs) - set(self.libs[pid]): + if arg is not None and re.search(arg, k) is None: continue + addr = self.libs[pid][k] = libs[k] + has_debug = False + offs = None + + try: + out = execute(['file', k]) + except: + continue + + # try loading mapping as ELF + try: + out = execute(['readelf', '-l', k]) + for line in out.split('\n'): + if not 'LOAD' in line: continue + base = int(line.split()[2], 16) + break + except: + # assume mapping is PE + base = -1 + + try: + name = None + cmd = 'add-symbol-file "{}"'.format(k) + out = execute(['objdump', '-h', k]) + for line in out.split('\n'): + if '2**' in line: + _, name, _, vma, _, off, _ = line.split(maxsplit=6) + if base < 0: offs = int(off, 16) + else: offs = int(vma, 16) - base + if 'ALLOC' in line: + cmd += ' -s {} 0x{:x}'.format(name, addr + offs) + elif name in ['.gnu_debuglink', '.debug_info']: + has_debug = True + elif 'DEBUGGING' in line: + has_debug = True + except: + continue + + if not has_debug: + print('no debugging info found in {}'.format(k)) + continue + + print('loading symbols for {}'.format(k)) + command(cmd, confirm=False, to_string=True) + + +LoadSymbolFiles() diff --git a/tools/gdbinit.py.in b/tools/gdbinit.py.in new file mode 120000 index 000000000000..9fb7fdf9b920 --- /dev/null +++ b/tools/gdbinit.py.in @@ -0,0 +1 @@ +gdbinit.py \ No newline at end of file From f67c0c14dcb770a019c8aa91143c71f632a8e736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sun, 26 Nov 2023 18:59:54 +0100 Subject: [PATCH 0065/2542] loader: Expose the standard debugging symbols for GDB. CW-Bug-Id: #22176 --- loader/main.c | 3 ++- loader/preloader.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/loader/main.c b/loader/main.c index ecb51efa1362..2ba32ea51766 100644 --- a/loader/main.c +++ b/loader/main.c @@ -73,7 +73,8 @@ static void init_reserved_areas(void) #else -/* the preloader will set this variable */ +/* the preloader will set these variables */ +__attribute((visibility("default"))) struct r_debug *wine_r_debug = NULL; const __attribute((visibility("default"))) struct wine_preload_info *wine_main_preload_info = NULL; static void init_reserved_areas(void) diff --git a/loader/preloader.c b/loader/preloader.c index d0551bae63a6..f27d6df8c170 100644 --- a/loader/preloader.c +++ b/loader/preloader.c @@ -79,12 +79,16 @@ #ifdef HAVE_ELF_H # include #endif + +/* define _r_debug so we can re-define it as r_debug_extended */ +#define _r_debug no_r_debug; #ifdef HAVE_LINK_H # include #endif #ifdef HAVE_SYS_LINK_H # include #endif +#undef _r_debug #include "wine/asm.h" #include "main.h" @@ -1387,6 +1391,39 @@ static void set_process_name( int argc, char *argv[] ) for (i = 1; i < argc; i++) argv[i] -= off; } +struct wld_r_debug_extended +{ + struct r_debug base; + struct wld_r_debug_extended *r_next; +}; + +/* GDB integration, _r_debug_state is *required* for GDB to hook the preloader */ +__attribute((visibility("default"))) void _r_debug_state(void) {} +__attribute((visibility("default"))) struct wld_r_debug_extended _r_debug = {{0}}; + +/* sets the preloader r_debug address into DT_DEBUG */ +static void init_r_debug( struct wld_auxv *av ) +{ + ElfW(Phdr) *phdr, *ph; + ElfW(Dyn) *dyn = NULL; + char *l_addr; + int phnum; + + _r_debug.base.r_version = 2; + _r_debug.base.r_brk = (ElfW(Addr))_r_debug_state; + + if (!(phnum = get_auxiliary( av, AT_PHNUM, 0 ))) return; + if (!(phdr = (void *)get_auxiliary( av, AT_PHDR, 0 ))) return; + l_addr = (char *)phdr - sizeof(ElfW(Ehdr)); + _r_debug.base.r_ldbase = (ElfW(Addr))l_addr; + + for (ph = phdr; ph < &phdr[phnum]; ++ph) if (ph->p_type == PT_DYNAMIC) break; + if (ph >= &phdr[phnum]) return; + + dyn = (void *)(ph->p_vaddr + l_addr); + while (dyn->d_tag != DT_DEBUG && dyn->d_tag != DT_NULL) dyn++; + if (dyn->d_tag == DT_DEBUG) dyn->d_un.d_ptr = (uintptr_t)&_r_debug; +} /* * wld_start @@ -1403,6 +1440,7 @@ void* wld_start( void **stack ) struct wld_auxv new_av[8], delete_av[3], *av; struct wld_link_map main_binary_map, ld_so_map; struct wine_preload_info **wine_main_preload_info; + struct r_debug *ld_so_r_debug, **wine_r_debug; pargc = *stack; argv = (char **)pargc + 1; @@ -1432,6 +1470,8 @@ void* wld_start( void **stack ) dump_auxiliary( av ); #endif + init_r_debug( av ); + /* reserve memory that Wine needs */ if (reserve) preload_reserve( reserve ); for (i = 0; preload_info[i].size; i++) @@ -1470,6 +1510,17 @@ void* wld_start( void **stack ) interp = (char *)main_binary_map.l_addr + main_binary_map.l_interp; map_so_lib( interp, &ld_so_map ); + /* expose ld.so _r_debug as a separate namespace in r_next */ + ld_so_r_debug = find_symbol( &ld_so_map, "_r_debug", STT_OBJECT ); + if (ld_so_r_debug) _r_debug.r_next = (struct wld_r_debug_extended *)ld_so_r_debug; + else wld_printf( "_r_debug not found in ld.so\n" ); + + _r_debug_state(); /* notify GDB that _r_debug is ready */ + + wine_r_debug = find_symbol( &main_binary_map, "wine_r_debug", STT_OBJECT ); + if (wine_r_debug) *wine_r_debug = &_r_debug.base; + else wld_printf( "wine_r_debug not found\n" ); + /* store pointer to the preload info into the appropriate main binary variable */ wine_main_preload_info = find_symbol( &main_binary_map, "wine_main_preload_info", STT_OBJECT ); if (wine_main_preload_info) *wine_main_preload_info = preload_info; From 7049e3f79b98ea67fdb9464d5904f71c59d358c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sun, 26 Nov 2023 18:59:54 +0100 Subject: [PATCH 0066/2542] ntdll: Maintain a PE module link map and expose it to GDB. CW-Bug-Id: #22176 --- dlls/ntdll/unix/virtual.c | 130 +++++++++++++++++++++++++++++++++++++- 1 file changed, 129 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 0c0a12c394df..1d1654346cab 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -51,6 +51,12 @@ #ifdef HAVE_SYS_USER_H # include #endif +#ifdef HAVE_LINK_H +# include +#endif +#ifdef HAVE_SYS_LINK_H +# include +#endif #ifdef HAVE_LIBPROCSTAT_H # include #endif @@ -79,6 +85,120 @@ WINE_DEFAULT_DEBUG_CHANNEL(virtual); WINE_DECLARE_DEBUG_CHANNEL(module); WINE_DECLARE_DEBUG_CHANNEL(virtual_ranges); +/* Gdb integration, in loader/main.c */ +static struct r_debug *wine_r_debug; + +#if defined(HAVE_LINK_H) || defined(HAVE_SYS_LINK_H) + +struct link_map_entry +{ + struct link_map map; + const void *module; +}; +static struct link_map link_map = {.l_name = (char *)""}; + +static void r_debug_set_state( int state ) +{ + wine_r_debug->r_map = &link_map; + wine_r_debug->r_state = state; + ((void (*)(void))wine_r_debug->r_brk)(); +} + +static char *get_path_from_fd( int fd, int sz ) +{ +#ifdef linux + char *ret = malloc( 32 + sz ); + + if (ret) sprintf( ret, "/proc/self/fd/%u", fd ); + return ret; +#elif defined(F_GETPATH) + char *ret = malloc( PATH_MAX + sz ); + + if (!ret) return NULL; + if (!fcntl( fd, F_GETPATH, ret )) return ret; + free( ret ); + return NULL; +#else + return NULL; +#endif +} + +static char *r_debug_path_from_fd( int fd ) +{ + char *real, *path; + if (!(path = get_path_from_fd( fd, 0 ))) return NULL; + if (!(real = realpath( path, NULL ))) return path; + free( path ); + return real; +} + +static void r_debug_add_module( void *module, int fd, INT_PTR offset ) +{ + struct link_map *ptr = link_map.l_next, *next; + struct link_map_entry *entry; + + if (!wine_r_debug) return; + + while (ptr) + { + entry = LIST_ENTRY(ptr, struct link_map_entry, map); + if (entry->module == module) break; + ptr = ptr->l_next; + } + + r_debug_set_state( RT_ADD ); + + if (ptr) entry->map.l_addr = offset; + else if ((entry = calloc( 1, sizeof(*entry) ))) + { + entry->module = module; + entry->map.l_addr = offset; + entry->map.l_name = r_debug_path_from_fd( fd ); + + entry->map.l_next = link_map.l_next; + if ((next = entry->map.l_next)) next->l_prev = &entry->map; + entry->map.l_prev = &link_map; + link_map.l_next = &entry->map; + } + + r_debug_set_state( RT_CONSISTENT ); +} + +static void r_debug_remove_module( void *module ) +{ + struct link_map *ptr = link_map.l_next, *next; + struct link_map_entry *entry; + + if (!wine_r_debug) return; + + while (ptr) + { + entry = LIST_ENTRY(ptr, struct link_map_entry, map); + if (entry->module == module) break; + ptr = ptr->l_next; + } + if (!ptr) return; + + r_debug_set_state( RT_DELETE ); + + entry->map.l_prev->l_next = entry->map.l_next; + if ((next = entry->map.l_next)) next->l_prev = entry->map.l_prev; + + r_debug_set_state( RT_CONSISTENT ); + + free( entry->map.l_name ); + free( entry ); +} + +#else /* defined(HAVE_LINK_H) || defined(HAVE_SYS_LINK_H) */ + +#define RT_CONSISTENT 0 +static void r_debug_set_state( int state ) {} +static void r_debug_add_module( void *module, int fd, INT_PTR offset ) {} +static void r_debug_remove_module( void *module ) {} + +#endif /* defined(HAVE_LINK_H) || defined(HAVE_SYS_LINK_H) */ + struct preload_info { void *addr; @@ -2956,6 +3076,7 @@ static NTSTATUS map_image_into_view( struct file_view *view, const WCHAR *filena #ifdef VALGRIND_LOAD_PDB_DEBUGINFO VALGRIND_LOAD_PDB_DEBUGINFO(fd, ptr, total_size, ptr - (char *)wine_server_get_ptr( image_info->base )); #endif + r_debug_add_module( ptr, fd, ptr - (char *)wine_server_get_ptr( image_info->base ) ); return STATUS_SUCCESS; } @@ -3318,11 +3439,14 @@ static void *alloc_virtual_heap( SIZE_T size ) void virtual_init(void) { const struct preload_info **preload_info = dlsym( RTLD_DEFAULT, "wine_main_preload_info" ); + struct r_debug **r_debug = dlsym( RTLD_DEFAULT, "wine_r_debug" ); const char *preload; size_t size; int i; pthread_mutexattr_t attr; + if (r_debug && (wine_r_debug = *r_debug)) r_debug_set_state( RT_CONSISTENT ); + pthread_mutexattr_init( &attr ); pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_RECURSIVE ); pthread_mutex_init( &virtual_mutex, &attr ); @@ -5834,7 +5958,11 @@ static NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr, ULONG flags ) SERVER_END_REQ; if (!status) { - if (view->protect & SEC_IMAGE) release_builtin_module( view->base ); + if (view->protect & SEC_IMAGE) + { + r_debug_remove_module( view->base ); + release_builtin_module( view->base ); + } if (flags & MEM_PRESERVE_PLACEHOLDER) free_pages_preserve_placeholder( view, view->base, view->size ); else delete_view( view ); } From 86a9c23b7b8f61b85e18a9bb2428c5f356198e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sun, 26 Nov 2023 18:35:47 +0100 Subject: [PATCH 0067/2542] tools: Add gdbunwind.py script with a syscall unwinder. CW-Bug-Id: #22176 --- tools/gdbunwind.py | 177 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 tools/gdbunwind.py diff --git a/tools/gdbunwind.py b/tools/gdbunwind.py new file mode 100644 index 000000000000..8611d789f1fb --- /dev/null +++ b/tools/gdbunwind.py @@ -0,0 +1,177 @@ +#!/bin/env python3 + +# Copyright 2021 Rémi Bernon for CodeWeavers +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + +from gdb.unwinder import Unwinder +import gdb +import re + +ARCH_OFFSETS_X86_64 = { + "rax": (0x0000, 'void *'), + "rbx": (0x0008, 'void *'), + "rcx": (0x0010, 'void *'), + "rdx": (0x0018, 'void *'), + "rsi": (0x0020, 'void *'), + "rdi": (0x0028, 'void *'), + "r8": (0x0030, 'void *'), + "r9": (0x0038, 'void *'), + "r10": (0x0040, 'void *'), + "r11": (0x0048, 'void *'), + "r12": (0x0050, 'void *'), + "r13": (0x0058, 'void *'), + "r14": (0x0060, 'void *'), + "r15": (0x0068, 'void *'), + "rip": (0x0070, 'void *'), + "cs": (0x0078, 'void *'), + "eflags": (0x0080, 'void *'), + "rsp": (0x0088, 'void *'), + "ss": (0x0090, 'void *'), + "rbp": (0x0098, 'void *'), + "prev_frame": (0x00a0, 'void *'), + "syscall_cfa": (0x00a8, 'void *'), + # "syscall_flags": (0x00b0, 'unsigned int'), + # "restore_flags": (0x00b4, 'unsigned int'), + "teb_offset": (0x0328, 'void *'), +} + +ARCH_OFFSETS_I386 = { + # "syscall_flags": (0x000, 'unsigned short'), + # "restore_flags": (0x002, 'unsigned short'), + "eflags": (0x004, 'unsigned int'), + "eip": (0x008, 'void *'), + "esp": (0x00c, 'void *'), + "cs": (0x010, 'unsigned short'), + "ss": (0x012, 'unsigned short'), + "ds": (0x014, 'unsigned short'), + "es": (0x016, 'unsigned short'), + "fs": (0x018, 'unsigned short'), + "gs": (0x01a, 'unsigned short'), + "eax": (0x01c, 'void *'), + "ebx": (0x020, 'void *'), + "ecx": (0x024, 'void *'), + "edx": (0x028, 'void *'), + "edi": (0x02c, 'void *'), + "esi": (0x030, 'void *'), + "ebp": (0x034, 'void *'), + "syscall_cfa": (0x038, 'void *'), + "prev_frame": (0x03c, 'void *'), + "teb_offset": (0x1f8, 'void *'), +} + + +def arch_offsets(arch): + if 'x86-64' in arch: + return ARCH_OFFSETS_X86_64 + if 'i386' in arch: + return ARCH_OFFSETS_I386 + + +def find_syscall_frame(sp, arch, teb): + (off, type) = arch_offsets(arch)['teb_offset'] + frame = int(gdb.parse_and_eval(f'*(void **){teb + off}')) + + while frame: + (off, type) = arch_offsets(arch)['prev_frame'] + next_frame = int(gdb.parse_and_eval(f'*(void **){(frame + off)}')) + if not next_frame: return frame + + (off, type) = arch_offsets(arch)['ebp'] + ebp = int(gdb.parse_and_eval(f'*(void **){(next_frame + off)}')) + if ebp >= sp: return frame + + +def callback_registers(pc, sp, pending_frame): + arch = pending_frame.architecture().name() + + if 'x86-64' in arch: + frame = int(pending_frame.read_register("rbp")) + frame = (frame - 0x448) & ~0x3f + + (off, type) = arch_offsets(arch)['syscall_cfa'] + val = gdb.parse_and_eval(f'*({type} *){int(frame + off)}') + yield 'rip', gdb.parse_and_eval(f'*(void **){int(val - 8)}') + yield 'rbp', val - 16 + + elif 'i386' in arch: + teb = int(pending_frame.read_register('edx')) + frame = find_syscall_frame(sp, arch, teb) + + (off, type) = arch_offsets(arch)['syscall_cfa'] + val = gdb.parse_and_eval(f'*({type} *){int(frame + off)}') + yield 'eip', gdb.parse_and_eval(f'*(void **){int(val - 4)}') + yield 'ebp', val - 8 + + +def registers(pc, sp, pending_frame): + arch = pending_frame.architecture().name() + frame = sp + + if 'x86-64' in arch: + if 'syscall' in str(pc): + rbp = pending_frame.read_register("rbp") + frame = rbp - 0x98 + elif 'i386' in arch: + if 'syscall' in str(pc): + ebp = pending_frame.read_register("ebp") + frame = ebp - 0x34 + else: + frame += 16 + + for reg, (off, type) in arch_offsets(arch).items(): + val = gdb.parse_and_eval(f'*({type} *){int(frame + off)}') + + if reg in ('eflags', 'cs', 'ss', 'ds', 'es', 'fs', 'gs'): + int32 = gdb.lookup_type('int') + val = val.cast(int32) + if reg in ('syscall_cfa', 'prev_frame', 'teb_offset'): + continue + + yield reg, val + + +class WineSyscallFrameId(object): + def __init__(self, sp, pc): + self.sp = sp + self.pc = pc + + +class WineSyscallUnwinder(Unwinder): + def __init__(self): + super().__init__("WineSyscallUnwinder", gdb.SIGTRAMP_FRAME) + self.pattern = re.compile('__wine_(syscall|unix_call)' + '|KiUserCallbackDispatcher') + + def __call__(self, pending_frame): + pc = pending_frame.read_register("pc") + if self.pattern.search(str(pc)) is None: + return None + + sp = pending_frame.read_register("sp") + frame = WineSyscallFrameId(sp, pc) + if 'KiUserCallbackDispatcher' in str(pc): + unwind_info = pending_frame.create_unwind_info(frame) + for reg, val in callback_registers(pc, sp, pending_frame): + unwind_info.add_saved_register(reg, val) + return unwind_info + + unwind_info = pending_frame.create_unwind_info(frame) + for reg, val in registers(pc, sp, pending_frame): + unwind_info.add_saved_register(reg, val) + return unwind_info + + +gdb.unwinder.register_unwinder(None, WineSyscallUnwinder(), replace=True) From 346dbc48f8af2c7203e49cbe432bba6570562aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 22 Jan 2024 20:28:29 +0100 Subject: [PATCH 0068/2542] HACK: loader: Map /run/host to / in the link map. CW-Bug-Id: #22176 --- dlls/ntdll/unix/virtual.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 1d1654346cab..8dee2d38505a 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -128,6 +128,7 @@ static char *r_debug_path_from_fd( int fd ) char *real, *path; if (!(path = get_path_from_fd( fd, 0 ))) return NULL; if (!(real = realpath( path, NULL ))) return path; + if (!strncmp( real, "/run/host", 9 )) memmove( real, real + 9, strlen( real ) - 8 ); free( path ); return real; } From 6612a6cacbc9b8d9b365f9b1f1ed2293549c9050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 3 Dec 2024 09:52:36 +0100 Subject: [PATCH 0069/2542] winex11: Keep track of the _NET_SUPPORTING_WM_CHECK window. --- dlls/winex11.drv/event.c | 8 ++++++++ dlls/winex11.drv/window.c | 28 ++++++++++++++++++++++++++++ dlls/winex11.drv/x11drv.h | 2 ++ dlls/winex11.drv/x11drv_main.c | 2 ++ 4 files changed, 40 insertions(+) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 428dcb7b8b71..95e43e84fb37 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1262,6 +1262,13 @@ static void handle_net_supported_notify( XPropertyEvent *event ) if (event->state == PropertyNewValue) net_supported_init( data ); } +static void handle_net_supporting_wm_check_notify( XPropertyEvent *event ) +{ + struct x11drv_thread_data *data = x11drv_thread_data(); + + if (event->state == PropertyNewValue) net_supporting_wm_check_init( data ); +} + /*********************************************************************** * X11DRV_PropertyNotify */ @@ -1274,6 +1281,7 @@ static BOOL X11DRV_PropertyNotify( HWND hwnd, XEvent *xev ) if (event->atom == x11drv_atom(_XEMBED_INFO)) handle_xembed_info_notify( hwnd, event ); if (event->atom == x11drv_atom(_NET_WM_STATE)) handle_net_wm_state_notify( hwnd, event ); if (event->atom == x11drv_atom(_NET_SUPPORTED)) handle_net_supported_notify( event ); + if (event->atom == x11drv_atom(_NET_SUPPORTING_WM_CHECK)) handle_net_supporting_wm_check_notify( event ); return TRUE; } diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 65b56061184b..0d6421d7e78a 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -3447,6 +3447,34 @@ void net_supported_init( struct x11drv_thread_data *data ) } } +static Window get_net_supporting_wm_check( Display *display, Window window ) +{ + unsigned long count, remaining; + Window *tmp, support = None; + int format; + Atom type; + + if (!XGetWindowProperty( display, window, x11drv_atom(_NET_SUPPORTING_WM_CHECK), 0, 65536 / sizeof(CARD32), + False, XA_WINDOW, &type, &format, &count, &remaining, (unsigned char **)&tmp )) + { + support = *tmp; + free( tmp ); + } + + return support; +} + +void net_supporting_wm_check_init( struct x11drv_thread_data *data ) +{ + Window window = None, other; + + window = get_net_supporting_wm_check( data->display, DefaultRootWindow( data->display ) ); + /* the window itself must have the property set too */ + X11DRV_expect_error( data->display, host_window_error, NULL ); + other = get_net_supporting_wm_check( data->display, window ); + if (X11DRV_check_error() || window != other) WARN( "Invalid _NET_SUPPORTING_WM_CHECK window\n" ); +} + void init_win_context(void) { init_recursive_mutex( &win_data_mutex ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index ee5bbe07dd49..b5d47553ce3b 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -487,6 +487,7 @@ enum x11drv_atoms XATOM__NET_STARTUP_INFO_BEGIN, XATOM__NET_STARTUP_INFO, XATOM__NET_SUPPORTED, + XATOM__NET_SUPPORTING_WM_CHECK, XATOM__NET_SYSTEM_TRAY_OPCODE, XATOM__NET_SYSTEM_TRAY_S0, XATOM__NET_SYSTEM_TRAY_VISUAL, @@ -668,6 +669,7 @@ extern void window_configure_notify( struct x11drv_win_data *data, unsigned long extern BOOL get_window_state_updates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, RECT *rect ); extern void net_supported_init( struct x11drv_thread_data *data ); +extern void net_supporting_wm_check_init( struct x11drv_thread_data *data ); extern Window init_clip_window(void); extern void update_user_time( Time time ); diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index e58d3afca633..30b93fcb0fcc 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -129,6 +129,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "_NET_STARTUP_INFO_BEGIN", "_NET_STARTUP_INFO", "_NET_SUPPORTED", + "_NET_SUPPORTING_WM_CHECK", "_NET_SYSTEM_TRAY_OPCODE", "_NET_SYSTEM_TRAY_S0", "_NET_SYSTEM_TRAY_VISUAL", @@ -755,6 +756,7 @@ struct x11drv_thread_data *x11drv_init_thread_data(void) if (use_xim) xim_thread_attach( data ); x11drv_xinput2_init( data ); net_supported_init( data ); + net_supporting_wm_check_init( data ); return data; } From c0b0d998fb57e68a4b71b2b2ef98d2223e409be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 3 Dec 2024 09:58:18 +0100 Subject: [PATCH 0070/2542] winex11: Keep track of the window manager name. --- dlls/winex11.drv/event.c | 6 ++++++ dlls/winex11.drv/window.c | 33 +++++++++++++++++++++++++++++++++ dlls/winex11.drv/x11drv.h | 2 ++ dlls/winex11.drv/x11drv_main.c | 2 ++ 4 files changed, 43 insertions(+) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 95e43e84fb37..c7dde3e75c0d 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1266,6 +1266,12 @@ static void handle_net_supporting_wm_check_notify( XPropertyEvent *event ) { struct x11drv_thread_data *data = x11drv_thread_data(); + if (data->window_manager) + { + XFree( data->window_manager ); + data->window_manager = NULL; + } + if (event->state == PropertyNewValue) net_supporting_wm_check_init( data ); } diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 0d6421d7e78a..fea8452b70d5 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -3464,6 +3464,33 @@ static Window get_net_supporting_wm_check( Display *display, Window window ) return support; } + +static BOOL get_window_net_wm_name( Display *display, Window window, char **name ) +{ + unsigned long count, remaining; + int format, ret; + Atom type; + + *name = NULL; + X11DRV_expect_error( display, host_window_error, NULL ); + ret = XGetWindowProperty( display, window, x11drv_atom(_NET_WM_NAME), 0, 65536 / sizeof(CARD32), False, x11drv_atom(UTF8_STRING), + &type, &format, &count, &remaining, (unsigned char **)name ); + return !X11DRV_check_error() && !ret && *name; +} + +static BOOL get_window_wm_name( Display *display, Window window, char **name ) +{ + unsigned long count, remaining; + int format, ret; + Atom type; + + *name = NULL; + X11DRV_expect_error( display, host_window_error, NULL ); + ret = XGetWindowProperty( display, window, x11drv_atom(WM_NAME), 0, 65536 / sizeof(CARD32), False, XA_STRING, + &type, &format, &count, &remaining, (unsigned char **)name ); + return !X11DRV_check_error() && !ret && *name; +} + void net_supporting_wm_check_init( struct x11drv_thread_data *data ) { Window window = None, other; @@ -3473,6 +3500,12 @@ void net_supporting_wm_check_init( struct x11drv_thread_data *data ) X11DRV_expect_error( data->display, host_window_error, NULL ); other = get_net_supporting_wm_check( data->display, window ); if (X11DRV_check_error() || window != other) WARN( "Invalid _NET_SUPPORTING_WM_CHECK window\n" ); + else if (get_window_net_wm_name( data->display, window, &data->window_manager ) || + get_window_wm_name( data->display, window, &data->window_manager )) + { + if (!strcmp( data->window_manager, "GNOME Shell" )) strcpy( data->window_manager, "Mutter" ); + TRACE( "Detected window manager: %s\n", debugstr_a(data->window_manager) ); + } } void init_win_context(void) diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index b5d47553ce3b..94b9636ca46e 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -397,6 +397,7 @@ struct x11drv_thread_data Atom *net_supported; /* list of _NET_SUPPORTED atoms */ int net_supported_count; /* number of _NET_SUPPORTED atoms */ UINT net_wm_state_mask; /* mask of supported _NET_WM_STATE *bits */ + char *window_manager; /* name of the supporting window manager */ #ifdef HAVE_X11_EXTENSIONS_XINPUT2_H XIValuatorClassInfo x_valuator; XIValuatorClassInfo y_valuator; @@ -477,6 +478,7 @@ enum x11drv_atoms XATOM_RAW_CAP_HEIGHT, XATOM_WM_PROTOCOLS, XATOM_WM_DELETE_WINDOW, + XATOM_WM_NAME, XATOM_WM_STATE, XATOM_WM_TAKE_FOCUS, XATOM_DndProtocol, diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 30b93fcb0fcc..7e03c31c6d2f 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -119,6 +119,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "RAW_CAP_HEIGHT", "WM_PROTOCOLS", "WM_DELETE_WINDOW", + "WM_NAME", "WM_STATE", "WM_TAKE_FOCUS", "DndProtocol", @@ -688,6 +689,7 @@ void X11DRV_ThreadDetach(void) if (data->xim) XCloseIM( data->xim ); if (data->font_set) XFreeFontSet( data->display, data->font_set ); if (data->net_supported) XFree( data->net_supported ); + if (data->window_manager) XFree( data->window_manager ); XSync( gdi_display, False ); /* make sure XReparentWindow requests have completed before closing the thread display */ XCloseDisplay( data->display ); free( data ); From aa28610ebf228f5af8504dc396f01fc4726a2f81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 3 Dec 2024 12:46:56 +0100 Subject: [PATCH 0071/2542] win32u: Add a new driver entry to check window manager name. --- dlls/win32u/driver.c | 12 ++++++++++++ dlls/winex11.drv/init.c | 1 + dlls/winex11.drv/window.c | 6 ++++++ dlls/winex11.drv/x11drv.h | 1 + include/wine/gdi_driver.h | 1 + 5 files changed, 21 insertions(+) diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index 22e48fa67827..88fedbd000c0 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -793,6 +793,11 @@ static void nulldrv_FlashWindowEx( FLASHWINFO *info ) { } +static BOOL nulldrv_HasWindowManager( const char *name ) +{ + return FALSE; +} + static void nulldrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect, const RECT *top_rect, DWORD flags ) { @@ -1206,6 +1211,11 @@ static void loaderdrv_FlashWindowEx( FLASHWINFO *info ) load_driver()->pFlashWindowEx( info ); } +static BOOL loaderdrv_HasWindowManager( const char *name ) +{ + return load_driver()->pHasWindowManager( name ); +} + static void loaderdrv_SetDesktopWindow( HWND hwnd ) { load_driver()->pSetDesktopWindow( hwnd ); @@ -1274,6 +1284,7 @@ static const struct user_driver_funcs lazy_load_driver = nulldrv_DesktopWindowProc, nulldrv_DestroyWindow, loaderdrv_FlashWindowEx, + loaderdrv_HasWindowManager, loaderdrv_GetDC, nulldrv_ProcessEvents, nulldrv_ReleaseDC, @@ -1371,6 +1382,7 @@ void __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version SET_USER_FUNC(DesktopWindowProc); SET_USER_FUNC(DestroyWindow); SET_USER_FUNC(FlashWindowEx); + SET_USER_FUNC(HasWindowManager); SET_USER_FUNC(GetDC); SET_USER_FUNC(ProcessEvents); SET_USER_FUNC(ReleaseDC); diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index a0bfab2fb463..0c7ae196ea44 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -448,6 +448,7 @@ static const struct user_driver_funcs x11drv_funcs = .pDesktopWindowProc = X11DRV_DesktopWindowProc, .pDestroyWindow = X11DRV_DestroyWindow, .pFlashWindowEx = X11DRV_FlashWindowEx, + .pHasWindowManager = X11DRV_HasWindowManager, .pGetDC = X11DRV_GetDC, .pProcessEvents = X11DRV_ProcessEvents, .pReleaseDC = X11DRV_ReleaseDC, diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index fea8452b70d5..950401c0b1ea 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -3508,6 +3508,12 @@ void net_supporting_wm_check_init( struct x11drv_thread_data *data ) } } +BOOL X11DRV_HasWindowManager( const char *name ) +{ + struct x11drv_thread_data *data = x11drv_init_thread_data(); + return data->window_manager && !strcmp( data->window_manager, name ); +} + void init_win_context(void) { init_recursive_mutex( &win_data_mutex ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 94b9636ca46e..64cbc101ca27 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -222,6 +222,7 @@ extern BOOL X11DRV_CreateWindow( HWND hwnd ); extern LRESULT X11DRV_DesktopWindowProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ); extern void X11DRV_DestroyWindow( HWND hwnd ); extern void X11DRV_FlashWindowEx( PFLASHWINFO pfinfo ); +extern BOOL X11DRV_HasWindowManager( const char *name ); extern void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, const RECT *top_rect, DWORD flags ); extern void X11DRV_ReleaseDC( HWND hwnd, HDC hdc ); diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index 51a095fd2b00..8d935560e8b0 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -366,6 +366,7 @@ struct user_driver_funcs LRESULT (*pDesktopWindowProc)(HWND,UINT,WPARAM,LPARAM); void (*pDestroyWindow)(HWND); void (*pFlashWindowEx)(FLASHWINFO*); + BOOL (*pHasWindowManager)(const char *); void (*pGetDC)(HDC,HWND,HWND,const RECT *,const RECT *,DWORD); BOOL (*pProcessEvents)(DWORD); void (*pReleaseDC)(HWND,HDC); From a751b3976b0a0f2adbef813955de6d0c4741f6d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 1 Dec 2023 23:36:54 +0100 Subject: [PATCH 0072/2542] server: Introduce new set_thread_priority helper. --- server/thread.c | 39 ++++++++++++++++++++++++++------------- server/thread.h | 1 + 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/server/thread.c b/server/thread.c index b3ce5d9ac952..0e690cf505fb 100644 --- a/server/thread.c +++ b/server/thread.c @@ -608,25 +608,35 @@ affinity_t get_thread_affinity( struct thread *thread ) #define THREAD_PRIORITY_REALTIME_HIGHEST 6 #define THREAD_PRIORITY_REALTIME_LOWEST -7 +int set_thread_priority( struct thread *thread, int priority_class, int priority ) +{ + int max = THREAD_PRIORITY_HIGHEST; + int min = THREAD_PRIORITY_LOWEST; + if (priority_class == PROCESS_PRIOCLASS_REALTIME) + { + max = THREAD_PRIORITY_REALTIME_HIGHEST; + min = THREAD_PRIORITY_REALTIME_LOWEST; + } + if ((priority < min || priority > max) && + priority != THREAD_PRIORITY_IDLE && + priority != THREAD_PRIORITY_TIME_CRITICAL) + return STATUS_INVALID_PARAMETER; + + if (thread->state == TERMINATED) + return STATUS_THREAD_IS_TERMINATING; + + thread->priority = priority; + return STATUS_SUCCESS; +} + /* set all information about a thread */ static void set_thread_info( struct thread *thread, const struct set_thread_info_request *req ) { if (req->mask & SET_THREAD_INFO_PRIORITY) { - int max = THREAD_PRIORITY_HIGHEST; - int min = THREAD_PRIORITY_LOWEST; - if (thread->process->priority == PROCESS_PRIOCLASS_REALTIME) - { - max = THREAD_PRIORITY_REALTIME_HIGHEST; - min = THREAD_PRIORITY_REALTIME_LOWEST; - } - if ((req->priority >= min && req->priority <= max) || - req->priority == THREAD_PRIORITY_IDLE || - req->priority == THREAD_PRIORITY_TIME_CRITICAL) - thread->priority = req->priority; - else - set_error( STATUS_INVALID_PARAMETER ); + int status = set_thread_priority( thread, thread->process->priority, req->priority ); + if (status) set_error( status ); } if (req->mask & SET_THREAD_INFO_AFFINITY) { @@ -1422,6 +1432,8 @@ DECL_HANDLER(init_first_thread) else set_thread_affinity( current, current->affinity ); + set_thread_priority( current, process->priority, current->priority ); + debug_level = max( debug_level, req->debug_level ); reply->pid = get_process_id( process ); @@ -1451,6 +1463,7 @@ DECL_HANDLER(init_thread) init_thread_context( current ); generate_debug_event( current, DbgCreateThreadStateChange, &req->entry ); + apply_thread_priority( current, get_base_priority( current->process->priority, current->priority )); set_thread_affinity( current, current->affinity ); reply->suspend = (current->suspend || current->process->suspend || current->context != NULL); diff --git a/server/thread.h b/server/thread.h index 754e617b4842..213b921c35ea 100644 --- a/server/thread.h +++ b/server/thread.h @@ -122,6 +122,7 @@ extern void thread_cancel_apc( struct thread *thread, struct object *owner, enum extern int thread_add_inflight_fd( struct thread *thread, int client, int server ); extern int thread_get_inflight_fd( struct thread *thread, int client ); extern struct token *thread_get_impersonation_token( struct thread *thread ); +extern int set_thread_priority( struct thread *thread, int priority_class, int priority ); extern int set_thread_affinity( struct thread *thread, affinity_t affinity ); extern int suspend_thread( struct thread *thread ); extern int resume_thread( struct thread *thread ); From 341501fecaf45201e1cd3107a540052cdd7e9be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 1 Dec 2023 23:40:17 +0100 Subject: [PATCH 0073/2542] ntdll: Set RLIMIT_NICE to its hard limit. --- dlls/ntdll/unix/loader.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 966973148560..8720a74c11e2 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2356,6 +2356,9 @@ DECLSPEC_EXPORT void __wine_main( int argc, char *argv[] ) #ifdef RLIMIT_AS set_max_limit( RLIMIT_AS ); #endif +#ifdef RLIMIT_NICE + set_max_limit( RLIMIT_NICE ); +#endif virtual_init(); init_environment(); From 88514f59742c66c7fef940ab85c608de3db46add Mon Sep 17 00:00:00 2001 From: Marc-Aurel Zent Date: Mon, 29 Jan 2024 12:01:31 +0100 Subject: [PATCH 0074/2542] server: Use setpriority to update thread niceness when safe. --- server/main.c | 1 + server/object.h | 4 ++++ server/thread.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 66 insertions(+), 2 deletions(-) diff --git a/server/main.c b/server/main.c index efddef7f7150..e2ae1bcaabc1 100644 --- a/server/main.c +++ b/server/main.c @@ -234,6 +234,7 @@ int main( int argc, char *argv[] ) init_signals(); init_memory(); init_directories( load_intl_file() ); + init_threading(); init_registry(); main_loop(); return 0; diff --git a/server/object.h b/server/object.h index 7555f564a08d..1058f9bfb0a3 100644 --- a/server/object.h +++ b/server/object.h @@ -287,6 +287,10 @@ extern struct object *get_directory_obj( struct process *process, obj_handle_t h extern int directory_link_name( struct object *obj, struct object_name *name, struct object *parent ); extern void init_directories( struct fd *intl_fd ); +/* thread functions */ + +extern void init_threading(void); + /* symbolic link functions */ extern struct object *create_root_symlink( struct object *root, const struct unicode_str *name, diff --git a/server/thread.c b/server/thread.c index 0e690cf505fb..f36fa46c822c 100644 --- a/server/thread.c +++ b/server/thread.c @@ -37,6 +37,9 @@ #define _WITH_CPU_SET_T #include #endif +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif #include "ntstatus.h" #define WIN32_NO_STATUS @@ -216,6 +219,45 @@ static const struct fd_ops thread_fd_ops = static struct list thread_list = LIST_INIT(thread_list); +#if defined(__linux__) && defined(RLIMIT_NICE) +static int nice_limit; + +void init_threading(void) +{ + struct rlimit rlimit; + if (!getrlimit( RLIMIT_NICE, &rlimit )) + { + rlimit.rlim_cur = rlimit.rlim_max; + setrlimit( RLIMIT_NICE, &rlimit ); + if (rlimit.rlim_max <= 40) nice_limit = 20 - rlimit.rlim_max; + else if (rlimit.rlim_max == -1) nice_limit = -20; + if (nice_limit >= 0 && debug_level) fprintf(stderr, "wine: RLIMIT_NICE is <= 20, unable to use setpriority safely\n"); + } + if (nice_limit < 0 && debug_level) fprintf(stderr, "wine: Using setpriority to control niceness in the [%d,%d] range\n", nice_limit, -nice_limit ); +} + +static void apply_thread_priority( struct thread *thread, int base_priority ) +{ + int min = -nice_limit, max = nice_limit, range = max - min, niceness; + /* FIXME: handle realtime priorities using SCHED_RR if possible */ + if (base_priority > THREAD_BASE_PRIORITY_LOWRT) base_priority = THREAD_BASE_PRIORITY_LOWRT; + /* map an NT application band [1,15] base priority to [-nice_limit, nice_limit] */ + niceness = (min + (base_priority - 1) * range / 14); + setpriority( PRIO_PROCESS, thread->unix_tid, niceness ); +} + +#else + +void init_threading(void) +{ +} + +static void apply_thread_priority( struct thread *thread, int base_priority ) +{ +} + +#endif + /* initialize the structure for a newly allocated thread */ static inline void init_thread_structure( struct thread *thread ) { @@ -605,13 +647,23 @@ affinity_t get_thread_affinity( struct thread *thread ) return mask; } +static int get_base_priority( int priority_class, int priority ) +{ + /* offsets taken from https://learn.microsoft.com/en-us/windows/win32/procthread/scheduling-priorities */ + static const int class_offsets[] = { 4, 8, 13, 24, 6, 10 }; + if (priority == THREAD_PRIORITY_IDLE) return (priority_class == PROCESS_PRIOCLASS_REALTIME ? 16 : 1); + if (priority == THREAD_PRIORITY_TIME_CRITICAL) return (priority_class == PROCESS_PRIOCLASS_REALTIME ? 31 : 15); + if (priority_class >= ARRAY_SIZE(class_offsets)) return 8; + return class_offsets[priority_class - 1] + priority; +} + #define THREAD_PRIORITY_REALTIME_HIGHEST 6 #define THREAD_PRIORITY_REALTIME_LOWEST -7 int set_thread_priority( struct thread *thread, int priority_class, int priority ) { - int max = THREAD_PRIORITY_HIGHEST; - int min = THREAD_PRIORITY_LOWEST; + int min = THREAD_PRIORITY_LOWEST, max = THREAD_PRIORITY_HIGHEST, base_priority; + if (priority_class == PROCESS_PRIOCLASS_REALTIME) { max = THREAD_PRIORITY_REALTIME_HIGHEST; @@ -626,6 +678,13 @@ int set_thread_priority( struct thread *thread, int priority_class, int priority return STATUS_THREAD_IS_TERMINATING; thread->priority = priority; + + /* if unix_tid == -1, thread is gone or hasn't started yet, this will be called again from init_thread with a unix_tid */ + if (thread->unix_tid == -1) + return STATUS_SUCCESS; + + base_priority = get_base_priority( priority_class, priority ); + apply_thread_priority( thread, base_priority ); return STATUS_SUCCESS; } From 79bfa4c9bcc313b8a403e4930907ff6553fbe4a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 29 Nov 2023 23:20:41 +0300 Subject: [PATCH 0075/2542] server: Check wineserver privileges on init with -20 niceness. Link: https://github.com/ValveSoftware/wine/issues/261 --- server/thread.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/thread.c b/server/thread.c index f36fa46c822c..ff58ebaab509 100644 --- a/server/thread.c +++ b/server/thread.c @@ -225,7 +225,12 @@ static int nice_limit; void init_threading(void) { struct rlimit rlimit; - if (!getrlimit( RLIMIT_NICE, &rlimit )) + + /* if wineserver has cap_sys_nice we are unlimited, but leave -20 to the user */ + if (!setpriority( PRIO_PROCESS, getpid(), -20 )) nice_limit = -19; + setpriority( PRIO_PROCESS, getpid(), 0 ); + + if (!nice_limit && !getrlimit( RLIMIT_NICE, &rlimit )) { rlimit.rlim_cur = rlimit.rlim_max; setrlimit( RLIMIT_NICE, &rlimit ); From 3d042453dbf162b212fc951e4b3b9b835d27daea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 27 Jul 2023 09:23:05 +0200 Subject: [PATCH 0076/2542] Revert "ntoskrnl/tests: Fix a test failure." This reverts commit 03034f2c0ef23964891d60e5995d167a113f2d3e. CW-Bug-Id: #22500 --- dlls/ntoskrnl.exe/tests/driver_pnp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/ntoskrnl.exe/tests/driver_pnp.c b/dlls/ntoskrnl.exe/tests/driver_pnp.c index 70678b1a45c9..ae350451844f 100644 --- a/dlls/ntoskrnl.exe/tests/driver_pnp.c +++ b/dlls/ntoskrnl.exe/tests/driver_pnp.c @@ -804,8 +804,7 @@ static NTSTATUS fdo_ioctl(IRP *irp, IO_STACK_LOCATION *stack, ULONG code) * handles to the device are closed (and the user-space thread is * currently blocked in this ioctl and won't close its handle * yet.) */ - todo_wine_if (remove_device_count) - ok(!remove_device_count, "Got %u remove events.\n", remove_device_count); + ok(!remove_device_count, "Got %u remove events.\n", remove_device_count); return STATUS_SUCCESS; } From fe9f1ff74947c73644f4e858bfc4f29a854c5118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 27 Jul 2023 09:23:11 +0200 Subject: [PATCH 0077/2542] Revert "ntoskrnl: Enumerate child devices on a separate thread." This reverts commit 9fbdf2b43435caf62742d997bf8b3fb8752f606c. CW-Bug-Id: #22500 --- dlls/ntoskrnl.exe/ntoskrnl_private.h | 1 - dlls/ntoskrnl.exe/pnp.c | 40 +--------------------------- dlls/ntoskrnl.exe/tests/driver_pnp.c | 10 +++---- 3 files changed, 6 insertions(+), 45 deletions(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl_private.h b/dlls/ntoskrnl.exe/ntoskrnl_private.h index 472dc46fde32..ad53ee181a5d 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl_private.h +++ b/dlls/ntoskrnl.exe/ntoskrnl_private.h @@ -22,7 +22,6 @@ #define __WINE_NTOSKRNL_PRIVATE_H #include -#include #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" diff --git a/dlls/ntoskrnl.exe/pnp.c b/dlls/ntoskrnl.exe/pnp.c index f887bfc619d2..67c9e5dbe050 100644 --- a/dlls/ntoskrnl.exe/pnp.c +++ b/dlls/ntoskrnl.exe/pnp.c @@ -36,12 +36,6 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); WINE_DEFAULT_DEBUG_CHANNEL(plugplay); -DECLARE_CRITICAL_SECTION(invalidated_devices_cs); -static CONDITION_VARIABLE invalidated_devices_cv = CONDITION_VARIABLE_INIT; - -static DEVICE_OBJECT **invalidated_devices; -static size_t invalidated_devices_count; - static inline const char *debugstr_propkey( const DEVPROPKEY *id ) { if (!id) return "(null)"; @@ -489,14 +483,8 @@ void WINAPI IoInvalidateDeviceRelations( DEVICE_OBJECT *device_object, DEVICE_RE switch (type) { case BusRelations: - EnterCriticalSection( &invalidated_devices_cs ); - invalidated_devices = realloc( invalidated_devices, - (invalidated_devices_count + 1) * sizeof(*invalidated_devices) ); - invalidated_devices[invalidated_devices_count++] = device_object; - LeaveCriticalSection( &invalidated_devices_cs ); - WakeConditionVariable( &invalidated_devices_cv ); + handle_bus_relations( device_object ); break; - default: FIXME("Unhandled relation %#x.\n", type); break; @@ -1228,30 +1216,6 @@ static NTSTATUS WINAPI pnp_manager_driver_entry( DRIVER_OBJECT *driver, UNICODE_ return STATUS_SUCCESS; } -static DWORD CALLBACK device_enum_thread_proc(void *arg) -{ - for (;;) - { - DEVICE_OBJECT *device; - - EnterCriticalSection( &invalidated_devices_cs ); - - while (!invalidated_devices_count) - SleepConditionVariableCS( &invalidated_devices_cv, &invalidated_devices_cs, INFINITE ); - - device = invalidated_devices[--invalidated_devices_count]; - - /* Don't hold the CS while enumerating the device. Tests show that - * calling IoInvalidateDeviceRelations() from another thread shouldn't - * block, even if this thread is blocked in an IRP handler. */ - LeaveCriticalSection( &invalidated_devices_cs ); - - handle_bus_relations( device ); - } - - return 0; -} - void pnp_manager_start(void) { WCHAR endpoint[] = L"\\pipe\\wine_plugplay"; @@ -1273,8 +1237,6 @@ void pnp_manager_start(void) RpcStringFreeW( &binding_str ); if (err) ERR("RpcBindingFromStringBinding() failed, error %#lx\n", err); - - CreateThread( NULL, 0, device_enum_thread_proc, NULL, 0, NULL ); } void pnp_manager_stop_driver( struct wine_driver *driver ) diff --git a/dlls/ntoskrnl.exe/tests/driver_pnp.c b/dlls/ntoskrnl.exe/tests/driver_pnp.c index ae350451844f..eb0f469ebbe3 100644 --- a/dlls/ntoskrnl.exe/tests/driver_pnp.c +++ b/dlls/ntoskrnl.exe/tests/driver_pnp.c @@ -301,11 +301,11 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device_obj, IRP *irp) device->power_state = PowerDeviceD0; status = ZwWaitForSingleObject(device->plug_event, TRUE, &wait_time); - ok(!status, "Failed to wait for child plug event, status %#lx.\n", status); + todo_wine ok(!status, "Failed to wait for child plug event, status %#lx.\n", status); status = ZwSetEvent(device->plug_event2, NULL); ok(!status, "Failed to set event, status %#lx.\n", status); status = ZwWaitForSingleObject(device->plug_event, TRUE, &wait_time); - ok(!status, "Failed to wait for child plug event, status %#lx.\n", status); + todo_wine ok(!status, "Failed to wait for child plug event, status %#lx.\n", status); ret = STATUS_SUCCESS; break; @@ -796,15 +796,15 @@ static NTSTATUS fdo_ioctl(IRP *irp, IO_STACK_LOCATION *stack, ULONG code) * for the other. */ status = ZwSetEvent(plug_event, NULL); - ok(!status, "Failed to set event, status %#lx.\n", status); + todo_wine ok(!status, "Failed to set event, status %#lx.\n", status); status = ZwWaitForSingleObject(plug_event2, TRUE, &wait_time); - ok(!status, "Failed to wait for child plug event, status %#lx.\n", status); + todo_wine ok(!status, "Failed to wait for child plug event, status %#lx.\n", status); ok(surprise_removal_count == 1, "Got %u surprise removal events.\n", surprise_removal_count); /* We shouldn't get IRP_MN_REMOVE_DEVICE until all user-space * handles to the device are closed (and the user-space thread is * currently blocked in this ioctl and won't close its handle * yet.) */ - ok(!remove_device_count, "Got %u remove events.\n", remove_device_count); + todo_wine ok(!remove_device_count, "Got %u remove events.\n", remove_device_count); return STATUS_SUCCESS; } From b15f1c9b2725a9875ba61e1e15d6ad32e6731ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 19 Jun 2024 13:16:58 +0200 Subject: [PATCH 0078/2542] winebus: Don't try to create rumble effect on device startup. It causes a 30s timeout delay with Steam Input virtual controller, lets assume that it will later work, without the timeout. CW-Bug-Id: #23185 CW-Bug-Id: #23928 CW-Bug-Id: #23931 --- dlls/winebus.sys/bus_udev.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index 561f0cdc0e4b..262528afc20b 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -538,7 +538,6 @@ static NTSTATUS build_report_descriptor(struct unix_device *iface, struct udev_d BYTE absbits[(ABS_MAX+7)/8]; BYTE relbits[(REL_MAX+7)/8]; BYTE ffbits[(FF_MAX+7)/8]; - struct ff_effect effect; USAGE_AND_PAGE usage; USHORT count = 0; USAGE usages[16]; @@ -617,21 +616,8 @@ static NTSTATUS build_report_descriptor(struct unix_device *iface, struct udev_d impl->haptic_effect_id = -1; for (i = 0; i < ARRAY_SIZE(impl->effect_ids); ++i) impl->effect_ids[i] = -1; - if (test_bit(ffbits, FF_RUMBLE)) - { - effect.id = -1; - effect.type = FF_RUMBLE; - effect.replay.length = 0; - effect.u.rumble.strong_magnitude = 0; - effect.u.rumble.weak_magnitude = 0; - - if (ioctl(impl->base.device_fd, EVIOCSFF, &effect) == -1) - WARN("couldn't allocate rumble effect for haptics: %d %s\n", errno, strerror(errno)); - else if (!hid_device_add_haptics(iface)) - return FALSE; - else - impl->haptic_effect_id = effect.id; - } + if (test_bit(ffbits, FF_RUMBLE) && !hid_device_add_haptics(iface)) + return STATUS_NO_MEMORY; for (i = 0; i < FF_MAX; ++i) if (test_bit(ffbits, i)) break; if (i != FF_MAX) @@ -779,7 +765,7 @@ static NTSTATUS lnxev_device_haptics_start(struct unix_device *iface, UINT durat effect.u.rumble.strong_magnitude = rumble_intensity; effect.u.rumble.weak_magnitude = buzz_intensity; - if (ioctl(impl->base.device_fd, EVIOCSFF, &effect) == -1) + if (effect.id == -1 || ioctl(impl->base.device_fd, EVIOCSFF, &effect) == -1) { effect.id = -1; if (ioctl(impl->base.device_fd, EVIOCSFF, &effect) == 1) From 9ad665f7e97b79e062942f94f3f39070d41caa7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 24 Jun 2024 19:47:10 +0200 Subject: [PATCH 0079/2542] winebus: Force the ordering of some common evdev gamepad buttons. CW-Bug-Id: #23185 CW-Bug-Id: #23928 CW-Bug-Id: #23931 --- dlls/winebus.sys/bus_udev.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index 262528afc20b..2a363d72b845 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -494,6 +494,24 @@ static const USAGE_AND_PAGE *what_am_I(struct udev_device *dev, int fd) static INT count_buttons(int device_fd, BYTE *map) { + static const UINT gamepad_buttons[] = + { + BTN_A, + BTN_B, + BTN_X, + BTN_Y, + BTN_TL, + BTN_TR, + BTN_SELECT, + BTN_START, + BTN_THUMBL, + BTN_THUMBR, + BTN_MODE, + BTN_C, + BTN_Z, + BTN_TL2, + BTN_TR2, + }; int i; int button_count = 0; BYTE keybits[(KEY_MAX+7)/8]; @@ -504,7 +522,16 @@ static INT count_buttons(int device_fd, BYTE *map) return FALSE; } - for (i = BTN_MISC; i < KEY_MAX; i++) + for (i = 0; i < ARRAY_SIZE(gamepad_buttons); i++) + { + if (test_bit(keybits, gamepad_buttons[i])) + { + if (map) map[gamepad_buttons[i]] = button_count; + button_count++; + } + } + + for (i = BTN_DIGI; i < KEY_MAX; i++) { if (test_bit(keybits, i)) { From c9a7339f9945abe923299d331c2a67e72170e9f1 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Tue, 15 Dec 2020 12:23:31 -0600 Subject: [PATCH 0080/2542] winebus: Enable SDL input logging when hid channel is enabled. --- dlls/winebus.sys/bus_sdl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index e050742ca66c..18c846139a9f 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -115,6 +115,7 @@ MAKE_FUNCPTR(SDL_GameControllerAddMapping); MAKE_FUNCPTR(SDL_RegisterEvents); MAKE_FUNCPTR(SDL_PushEvent); MAKE_FUNCPTR(SDL_GetTicks); +MAKE_FUNCPTR(SDL_LogSetPriority); static int (*pSDL_JoystickRumble)(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); static int (*pSDL_JoystickRumbleTriggers)(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); static Uint16 (*pSDL_JoystickGetProduct)(SDL_Joystick * joystick); @@ -1141,6 +1142,7 @@ NTSTATUS sdl_bus_init(void *args) LOAD_FUNCPTR(SDL_RegisterEvents); LOAD_FUNCPTR(SDL_PushEvent); LOAD_FUNCPTR(SDL_GetTicks); + LOAD_FUNCPTR(SDL_LogSetPriority); #undef LOAD_FUNCPTR pSDL_JoystickRumble = dlsym(sdl_handle, "SDL_JoystickRumble"); pSDL_JoystickRumbleTriggers = dlsym(sdl_handle, "SDL_JoystickRumbleTriggers"); @@ -1162,6 +1164,11 @@ NTSTATUS sdl_bus_init(void *args) goto failed; } + if (TRACE_ON(hid)) + { + pSDL_LogSetPriority(SDL_LOG_CATEGORY_INPUT, SDL_LOG_PRIORITY_VERBOSE); + } + pSDL_JoystickEventState(SDL_ENABLE); pSDL_GameControllerEventState(SDL_ENABLE); From 17004cbb420cd5e9b373e5bf510d0d726a157d2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 8 Jan 2024 14:35:42 +0100 Subject: [PATCH 0081/2542] windows.gaming.input: Forward get_NonRoamableId to Wine provider. CW-Bug-Id: #23185 --- dlls/windows.gaming.input/controller.c | 4 ++-- dlls/windows.gaming.input/provider.c | 7 +++++++ dlls/windows.gaming.input/provider.idl | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/windows.gaming.input/controller.c b/dlls/windows.gaming.input/controller.c index e1749a3032d3..1adbc5cce0b5 100644 --- a/dlls/windows.gaming.input/controller.c +++ b/dlls/windows.gaming.input/controller.c @@ -364,8 +364,8 @@ static HRESULT WINAPI raw_controller_2_get_SimpleHapticsControllers( IRawGameCon static HRESULT WINAPI raw_controller_2_get_NonRoamableId( IRawGameController2 *iface, HSTRING* value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + struct controller *impl = impl_from_IRawGameController2( iface ); + return IWineGameControllerProvider_get_NonRoamableId( impl->wine_provider, value ); } static HRESULT WINAPI raw_controller_2_get_DisplayName( IRawGameController2 *iface, HSTRING* value ) diff --git a/dlls/windows.gaming.input/provider.c b/dlls/windows.gaming.input/provider.c index 6908d733a53b..381f4ccfadba 100644 --- a/dlls/windows.gaming.input/provider.c +++ b/dlls/windows.gaming.input/provider.c @@ -148,6 +148,12 @@ static BOOL CALLBACK count_ffb_axes( const DIDEVICEOBJECTINSTANCEW *obj, void *a return DIENUM_CONTINUE; } +static HRESULT WINAPI wine_provider_get_NonRoamableId( IWineGameControllerProvider *iface, HSTRING *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + static HRESULT WINAPI wine_provider_get_Type( IWineGameControllerProvider *iface, WineGameControllerType *value ) { struct provider *impl = impl_from_IWineGameControllerProvider( iface ); @@ -354,6 +360,7 @@ static const struct IWineGameControllerProviderVtbl wine_provider_vtbl = wine_provider_GetRuntimeClassName, wine_provider_GetTrustLevel, /* IWineGameControllerProvider methods */ + wine_provider_get_NonRoamableId, wine_provider_get_Type, wine_provider_get_AxisCount, wine_provider_get_ButtonCount, diff --git a/dlls/windows.gaming.input/provider.idl b/dlls/windows.gaming.input/provider.idl index e7b6e96b8aae..a6fcc6e84f3d 100644 --- a/dlls/windows.gaming.input/provider.idl +++ b/dlls/windows.gaming.input/provider.idl @@ -173,6 +173,8 @@ namespace Windows.Gaming.Input.Custom { interface IWineGameControllerProvider : IInspectable requires Windows.Gaming.Input.Custom.IGameControllerProvider { + [propget] HRESULT NonRoamableId([out, retval] HSTRING *value); + [propget] HRESULT Type([out, retval] WineGameControllerType *value); [propget] HRESULT AxisCount([out, retval] INT32 *value); [propget] HRESULT ButtonCount([out, retval] INT32 *value); From 6646937517c6db37710a77d574cce14d3d430d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 23 Nov 2022 01:02:13 +0100 Subject: [PATCH 0082/2542] xinput1_3: Move controller_(destroy|disable) code around. CW-Bug-Id: #20528 --- dlls/xinput1_3/main.c | 68 +++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/dlls/xinput1_3/main.c b/dlls/xinput1_3/main.c index 28f57e93bcea..17450134e82a 100644 --- a/dlls/xinput1_3/main.c +++ b/dlls/xinput1_3/main.c @@ -337,7 +337,40 @@ static DWORD HID_set_state(struct xinput_controller *controller, XINPUT_VIBRATIO return ERROR_SUCCESS; } -static void controller_destroy(struct xinput_controller *controller, BOOL already_removed); +static void controller_disable(struct xinput_controller *controller) +{ + XINPUT_VIBRATION state = {0}; + + if (!controller->enabled) return; + if (controller->caps.Flags & XINPUT_CAPS_FFB_SUPPORTED) HID_set_state(controller, &state); + controller->enabled = FALSE; + + CancelIoEx(controller->device, &controller->hid.read_ovl); + WaitForSingleObject(controller->hid.read_ovl.hEvent, INFINITE); + SetEvent(update_event); +} + +static void controller_destroy(struct xinput_controller *controller, BOOL already_removed) +{ + EnterCriticalSection(&controller->crit); + + if (controller->device) + { + TRACE("removing device %s from index %Iu\n", debugstr_w(controller->device_path), controller - controllers); + + if (!already_removed) controller_disable(controller); + CloseHandle(controller->device); + controller->device = NULL; + + free(controller->hid.input_report_buf); + free(controller->hid.output_report_buf); + free(controller->hid.feature_report_buf); + HidD_FreePreparsedData(controller->hid.preparsed); + memset(&controller->hid, 0, sizeof(controller->hid)); + } + + LeaveCriticalSection(&controller->crit); +} static void controller_enable(struct xinput_controller *controller) { @@ -357,19 +390,6 @@ static void controller_enable(struct xinput_controller *controller) else SetEvent(update_event); } -static void controller_disable(struct xinput_controller *controller) -{ - XINPUT_VIBRATION state = {0}; - - if (!controller->enabled) return; - if (controller->caps.Flags & XINPUT_CAPS_FFB_SUPPORTED) HID_set_state(controller, &state); - controller->enabled = FALSE; - - CancelIoEx(controller->device, &controller->hid.read_ovl); - WaitForSingleObject(controller->hid.read_ovl.hEvent, INFINITE); - SetEvent(update_event); -} - static BOOL controller_init(struct xinput_controller *controller, PHIDP_PREPARSED_DATA preparsed, HIDP_CAPS *caps, HANDLE device, const WCHAR *device_path) { @@ -525,26 +545,6 @@ static void update_controller_list(void) SetupDiDestroyDeviceInfoList(set); } -static void controller_destroy(struct xinput_controller *controller, BOOL already_removed) -{ - EnterCriticalSection(&controller->crit); - - if (controller->device) - { - if (!already_removed) controller_disable(controller); - CloseHandle(controller->device); - controller->device = NULL; - - free(controller->hid.input_report_buf); - free(controller->hid.output_report_buf); - free(controller->hid.feature_report_buf); - HidD_FreePreparsedData(controller->hid.preparsed); - memset(&controller->hid, 0, sizeof(controller->hid)); - } - - LeaveCriticalSection(&controller->crit); -} - static LONG sign_extend(ULONG value, const HIDP_VALUE_CAPS *caps) { UINT sign = 1 << (caps->BitSize - 1); From f5721727db673e60434751cda74a86651db018b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 23 Nov 2022 01:02:13 +0100 Subject: [PATCH 0083/2542] xinput1_3: Introduce a new open_device_at_index helper. CW-Bug-Id: #20528 --- dlls/xinput1_3/main.c | 47 ++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/dlls/xinput1_3/main.c b/dlls/xinput1_3/main.c index 17450134e82a..ffcf05b961d1 100644 --- a/dlls/xinput1_3/main.c +++ b/dlls/xinput1_3/main.c @@ -123,19 +123,6 @@ static HMODULE xinput_instance; static HANDLE start_event; static HANDLE update_event; -static BOOL find_opened_device(const WCHAR *device_path, int *free_slot) -{ - int i; - - *free_slot = XUSER_MAX_COUNT; - for (i = XUSER_MAX_COUNT; i > 0; i--) - { - if (!controllers[i - 1].device) *free_slot = i - 1; - else if (!wcsicmp(device_path, controllers[i - 1].device_path)) return TRUE; - } - return FALSE; -} - static void check_value_caps(struct xinput_controller *controller, USHORT usage, HIDP_VALUE_CAPS *caps) { switch (usage) @@ -473,17 +460,13 @@ static BOOL device_is_overridden(HANDLE device) return disable; } -static BOOL try_add_device(const WCHAR *device_path) +static BOOL open_device_at_index(const WCHAR *device_path, int index) { SP_DEVICE_INTERFACE_DATA iface = {sizeof(iface)}; PHIDP_PREPARSED_DATA preparsed; HIDP_CAPS caps; NTSTATUS status; HANDLE device; - int i; - - if (find_opened_device(device_path, &i)) return TRUE; /* already opened */ - if (i == XUSER_MAX_COUNT) return FALSE; /* no more slots */ device = CreateFileW(device_path, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING, NULL); @@ -501,16 +484,42 @@ static BOOL try_add_device(const WCHAR *device_path) WARN("ignoring HID device, unsupported usage %04x:%04x\n", caps.UsagePage, caps.Usage); else if (device_is_overridden(device)) WARN("ignoring HID device, overridden for dinput\n"); - else if (!controller_init(&controllers[i], preparsed, &caps, device, device_path)) + else if (!controller_init(&controllers[index], preparsed, &caps, device, device_path)) WARN("ignoring HID device, failed to initialize\n"); else + { + TRACE("opened device %s at index %u\n", debugstr_w(device_path), index); return TRUE; + } CloseHandle(device); HidD_FreePreparsedData(preparsed); return TRUE; } +static BOOL find_opened_device(const WCHAR *device_path, int *free_slot) +{ + int i; + + *free_slot = XUSER_MAX_COUNT; + for (i = XUSER_MAX_COUNT; i > 0; i--) + { + if (!controllers[i - 1].device) *free_slot = i - 1; + else if (!wcsicmp(device_path, controllers[i - 1].device_path)) return TRUE; + } + return FALSE; +} + +static BOOL try_add_device(const WCHAR *device_path) +{ + SP_DEVICE_INTERFACE_DATA iface = {sizeof(iface)}; + int i; + + if (find_opened_device(device_path, &i)) return TRUE; /* already opened */ + if (i == XUSER_MAX_COUNT) return FALSE; /* no more slots */ + return open_device_at_index(device_path, i); +} + static void try_remove_device(const WCHAR *device_path) { int i; From 15f2422bb3ea03cfaab57926cf247dfb25260dcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 11 Oct 2021 10:48:49 +0200 Subject: [PATCH 0084/2542] HACK: xinput1_3: Check Steam overlay presence and disconnect controllers when enabled. Squashed with: HACK: gamescope: xinput1_3: Ignore gamepad input when Steam Keyboard is opened. --- dlls/xinput1_3/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/xinput1_3/main.c b/dlls/xinput1_3/main.c index ffcf05b961d1..1ccbe834d093 100644 --- a/dlls/xinput1_3/main.c +++ b/dlls/xinput1_3/main.c @@ -122,6 +122,7 @@ static struct xinput_controller controllers[XUSER_MAX_COUNT] = static HMODULE xinput_instance; static HANDLE start_event; static HANDLE update_event; +static HANDLE steam_overlay_event; static void check_value_caps(struct xinput_controller *controller, USHORT usage, HIDP_VALUE_CAPS *caps) { @@ -750,6 +751,8 @@ static BOOL WINAPI start_update_thread_once( INIT_ONCE *once, void *param, void if (!GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (void*)hid_update_thread_proc, &module)) WARN("Failed to increase module's reference count, error: %lu\n", GetLastError()); + steam_overlay_event = CreateEventA(NULL, TRUE, FALSE, "__wine_steamclient_GameOverlayActivated"); + start_event = CreateEventA(NULL, FALSE, FALSE, NULL); if (!start_event) ERR("failed to create start event, error %lu\n", GetLastError()); @@ -836,7 +839,8 @@ DWORD WINAPI DECLSPEC_HOTPATCH XInputSetState(DWORD index, XINPUT_VIBRATION *vib if (index >= XUSER_MAX_COUNT) return ERROR_BAD_ARGUMENTS; if (!controller_lock(&controllers[index])) return ERROR_DEVICE_NOT_CONNECTED; - ret = HID_set_state(&controllers[index], vibration); + if (WaitForSingleObject(steam_overlay_event, 0) == WAIT_OBJECT_0) ret = ERROR_SUCCESS; + else ret = HID_set_state(&controllers[index], vibration); controller_unlock(&controllers[index]); @@ -854,7 +858,9 @@ static DWORD xinput_get_state(DWORD index, XINPUT_STATE *state) if (index >= XUSER_MAX_COUNT) return ERROR_BAD_ARGUMENTS; if (!controller_lock(&controllers[index])) return ERROR_DEVICE_NOT_CONNECTED; - *state = controllers[index].state; + if (WaitForSingleObject(steam_overlay_event, 0) == WAIT_OBJECT_0) memset(state, 0, sizeof(*state)); + else *state = controllers[index].state; + controller_unlock(&controllers[index]); return ERROR_SUCCESS; From e8363f6227ac045402ed411c38beb49bfbdd2961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sat, 9 Jan 2021 20:11:52 +0100 Subject: [PATCH 0085/2542] HACK: dinput: Check Steam overlay presence and clear device state when enabled. CW-Bug-Id: #20083 --- dlls/dinput/dinput_main.c | 4 ++++ dlls/dinput/dinput_private.h | 1 + dlls/dinput/joystick_hid.c | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index eb38bbe4ee93..d7c1d4729d5e 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -508,6 +508,8 @@ void check_dinput_events(void) MsgWaitForMultipleObjectsEx(0, NULL, 0, QS_ALLINPUT, 0); } +HANDLE steam_overlay_event; + BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved ) { TRACE( "inst %p, reason %lu, reserved %p.\n", inst, reason, reserved ); @@ -516,12 +518,14 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved ) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(inst); + steam_overlay_event = CreateEventA(NULL, TRUE, FALSE, "__wine_steamclient_GameOverlayActivated"); DINPUT_instance = inst; register_di_em_win_class(); break; case DLL_PROCESS_DETACH: if (reserved) break; unregister_di_em_win_class(); + CloseHandle(steam_overlay_event); break; } return TRUE; diff --git a/dlls/dinput/dinput_private.h b/dlls/dinput/dinput_private.h index 0609b816b3b5..433dfcf949d1 100644 --- a/dlls/dinput/dinput_private.h +++ b/dlls/dinput/dinput_private.h @@ -46,6 +46,7 @@ struct dinput extern const IDirectInput7AVtbl dinput7_a_vtbl; extern const IDirectInput8AVtbl dinput8_a_vtbl; +extern HANDLE steam_overlay_event; extern void dinput_internal_addref( struct dinput *dinput ); extern void dinput_internal_release( struct dinput *dinput ); diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 367d6356195f..6989a3d4a443 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -1101,6 +1101,7 @@ struct parse_device_state_params { BYTE old_state[DEVICE_STATE_MAX_SIZE]; BYTE buttons[128]; + BOOL reset_state; DWORD time; DWORD seq; }; @@ -1116,6 +1117,8 @@ static BOOL check_device_state_button( struct dinput_device *device, UINT index, value = params->buttons[instance->wUsage - 1]; old_value = params->old_state[instance->dwOfs]; + if (params->reset_state) value = 0; + device->device_state[instance->dwOfs] = value; if (old_value != value) queue_event( iface, index, value, params->time, params->seq ); @@ -1201,6 +1204,16 @@ static BOOL read_device_state_value( struct dinput_device *device, UINT index, s if (instance->dwType & DIDFT_AXIS) value = scale_axis_value( logical_value, properties ); else value = scale_value( logical_value, properties ); + if (params->reset_state) + { + if (instance->dwType & DIDFT_POV) value = -1; + else if (instance->dwType & DIDFT_AXIS) + { + if (!properties->range_min) value = properties->range_max / 2; + else value = round( (properties->range_min + properties->range_max) / 2.0 ); + } + } + old_value = *(LONG *)(params->old_state + instance->dwOfs); *(LONG *)(impl->base.device_state + instance->dwOfs) = value; if (old_value != value) queue_event( iface, index, value, params->time, params->seq ); @@ -1230,6 +1243,11 @@ static HRESULT hid_joystick_read( IDirectInputDevice8W *iface ) ret = GetOverlappedResult( impl->device, &impl->read_ovl, &count, FALSE ); + if (WaitForSingleObject(steam_overlay_event, 0) == WAIT_OBJECT_0) /* steam overlay is enabled */ + params.reset_state = TRUE; + else + params.reset_state = FALSE; + EnterCriticalSection( &impl->base.crit ); while (ret) { From e5ded9f55d14820054e2da4a400de2ce30c5d3d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sat, 16 Nov 2024 22:13:34 +0100 Subject: [PATCH 0086/2542] HACK: hidclass: Do not send WM_INPUT messages when overlay is open. So that games listening to them, such as ICEY, do not have input bleeding through the overlay. Note that some other games, such as Hades, which are reading the HID devices directly, have the input bleeding through on Windows, so we do the same here. CW-Bug-Id: #20083 --- dlls/hidclass.sys/device.c | 6 +++++- dlls/hidclass.sys/hid.h | 4 ++++ dlls/hidclass.sys/pnp.c | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c index 8725ca7bba94..479e49701d1d 100644 --- a/dlls/hidclass.sys/device.c +++ b/dlls/hidclass.sys/device.c @@ -222,6 +222,7 @@ static void hid_device_queue_input( DEVICE_OBJECT *device, HID_XFER_PACKET *pack HIDP_COLLECTION_DESC *desc = ext->u.pdo.collection_desc; ULONG size, report_len = polled ? packet->reportBufferLen : desc->InputLength; struct hid_report *last_report, *report; + BOOL steam_overlay_open = FALSE; struct hid_queue *queue; LIST_ENTRY completed, *entry; KIRQL irql; @@ -229,7 +230,10 @@ static void hid_device_queue_input( DEVICE_OBJECT *device, HID_XFER_PACKET *pack TRACE("device %p, packet %p\n", device, packet); - if (IsEqualGUID( ext->class_guid, &GUID_DEVINTERFACE_HID )) + if (WaitForSingleObject(ext->steam_overlay_event, 0) == WAIT_OBJECT_0) /* steam overlay is open */ + steam_overlay_open = TRUE; + + if (IsEqualGUID( ext->class_guid, &GUID_DEVINTERFACE_HID ) && !steam_overlay_open) { struct hid_packet *hid; diff --git a/dlls/hidclass.sys/hid.h b/dlls/hidclass.sys/hid.h index 3924c72dcc37..af835c3dd7c1 100644 --- a/dlls/hidclass.sys/hid.h +++ b/dlls/hidclass.sys/hid.h @@ -88,6 +88,8 @@ typedef struct _BASE_DEVICE_EXTENSION WCHAR container_id[MAX_GUID_STRING_LEN]; const GUID *class_guid; + HANDLE steam_overlay_event; + BOOL is_fdo; } BASE_DEVICE_EXTENSION; @@ -119,6 +121,8 @@ typedef struct _minidriver PDRIVER_ADD_DEVICE AddDevice; PDRIVER_DISPATCH PNPDispatch; + + HANDLE steam_overlay_event; } minidriver; void call_minidriver( ULONG code, DEVICE_OBJECT *device, void *in_buff, ULONG in_size, diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c index 156b9a65f9f3..54447cbb86c6 100644 --- a/dlls/hidclass.sys/pnp.c +++ b/dlls/hidclass.sys/pnp.c @@ -171,6 +171,8 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b if (get_device_id(bus_pdo, BusQueryContainerID, ext->container_id)) ext->container_id[0] = 0; + ext->steam_overlay_event = minidriver->steam_overlay_event; + is_xinput_class = !wcsncmp(device_id, L"WINEXINPUT\\", 7) && wcsstr(device_id, L"&XI_") != NULL; if (is_xinput_class) ext->class_guid = &GUID_DEVINTERFACE_WINEXINPUT; else ext->class_guid = &GUID_DEVINTERFACE_HID; @@ -312,6 +314,8 @@ static NTSTATUS create_child_pdos( minidriver *minidriver, DEVICE_OBJECT *device pdo_ext->u.pdo.information.Polled = minidriver->minidriver.DevicesArePolled; pdo_ext->u.pdo.information.DescriptorSize = pdo_ext->u.pdo.collection_desc->PreparsedDataLength; + pdo_ext->steam_overlay_event = minidriver->steam_overlay_event; + page = pdo_ext->u.pdo.collection_desc->UsagePage; usage = pdo_ext->u.pdo.collection_desc->Usage; if (page == HID_USAGE_PAGE_GENERIC && usage == HID_USAGE_GENERIC_MOUSE) @@ -659,6 +663,8 @@ static void WINAPI driver_unload(DRIVER_OBJECT *driver) if (md->DriverUnload) md->DriverUnload(md->minidriver.DriverObject); list_remove(&md->entry); + + CloseHandle(md->steam_overlay_event); free(md); } } @@ -674,6 +680,8 @@ NTSTATUS WINAPI HidRegisterMinidriver(HID_MINIDRIVER_REGISTRATION *registration) if (!(driver = calloc(1, sizeof(*driver)))) return STATUS_NO_MEMORY; + driver->steam_overlay_event = CreateEventA(NULL, TRUE, FALSE, "__wine_steamclient_GameOverlayActivated"); + driver->DriverUnload = registration->DriverObject->DriverUnload; registration->DriverObject->DriverUnload = driver_unload; From 065fe6d17f9767dfe272d3aac751ea21c32cda98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sat, 3 Dec 2022 08:03:58 +0100 Subject: [PATCH 0087/2542] HACK: winebus: Introduce new PROTON_(ENABLE|DISABLE)_HIDRAW env vars. To easily enable/disable hidraw for new devices. --- dlls/winebus.sys/main.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c index 82bc8667bde8..9dbfd1bf074c 100644 --- a/dlls/winebus.sys/main.c +++ b/dlls/winebus.sys/main.c @@ -417,17 +417,43 @@ static DWORD check_bus_option(const WCHAR *option, DWORD default_value) return default_value; } +static const WCHAR *wcscasestr(const WCHAR *search, const WCHAR *needle) +{ + UNICODE_STRING search_str, needle_str; + + RtlInitUnicodeString(&search_str, search); + RtlInitUnicodeString(&needle_str, needle); + + while (needle_str.Length <= search_str.Length) + { + if (!RtlCompareUnicodeString(&search_str, &needle_str, TRUE)) return search_str.Buffer; + search_str.Length -= sizeof(WCHAR); + search_str.Buffer += 1; + } + + return NULL; +} + static BOOL is_hidraw_enabled(WORD vid, WORD pid, const USAGE_AND_PAGE *usages, UINT buttons) { char buffer[FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data[1024])]; KEY_VALUE_PARTIAL_INFORMATION *info = (KEY_VALUE_PARTIAL_INFORMATION *)buffer; - WCHAR vidpid[MAX_PATH], *tmp; + WCHAR vidpid[MAX_PATH], *tmp, value[1024]; BOOL prefer_hidraw = FALSE; UNICODE_STRING str; + SIZE_T len; DWORD size; if (check_bus_option(L"DisableHidraw", FALSE)) return FALSE; + if (!RtlQueryEnvironmentVariable(NULL, L"PROTON_DISABLE_HIDRAW", 20, value, ARRAY_SIZE(value) - 1, &len)) + { + value[len] = 0; + if (wcscmp(value, L"1")) return FALSE; + swprintf(vidpid, ARRAY_SIZE(vidpid), L"0x%04X/0x%04X", vid, pid); + if (wcscasestr(value, vidpid)) return FALSE; + } + if (usages->UsagePage == HID_USAGE_PAGE_DIGITIZER) { WARN("Ignoring unsupported %04X:%04X hidraw touchscreen\n", vid, pid); @@ -436,6 +462,14 @@ static BOOL is_hidraw_enabled(WORD vid, WORD pid, const USAGE_AND_PAGE *usages, if (usages->UsagePage != HID_USAGE_PAGE_GENERIC) return TRUE; if (usages->Usage != HID_USAGE_GENERIC_GAMEPAD && usages->Usage != HID_USAGE_GENERIC_JOYSTICK) return TRUE; + if (!RtlQueryEnvironmentVariable(NULL, L"PROTON_ENABLE_HIDRAW", 20, value, ARRAY_SIZE(value) - 1, &len)) + { + value[len] = 0; + if (wcscmp(value, L"1")) return TRUE; + swprintf(vidpid, ARRAY_SIZE(vidpid), L"0x%04X/0x%04X", vid, pid); + if (wcscasestr(value, vidpid)) return TRUE; + } + if (!check_bus_option(L"Enable SDL", 1) && check_bus_option(L"DisableInput", 0)) prefer_hidraw = TRUE; From 3828dfc725cfd9f2db0d1d19f9abf0c47cfa2ec6 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 10 Nov 2020 18:32:28 +0000 Subject: [PATCH 0088/2542] winebus: Automatically bypass udevd in Flatpak or pressure-vessel. Flatpak uses unprivileged containers that don't normally map uid 0 into the container, so netlink events won't work there, as described in previous commits. Steam's pressure-vessel container tool behaves similarly. --- dlls/winebus.sys/bus_udev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index 2a363d72b845..1c81415673c7 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -1701,6 +1701,12 @@ NTSTATUS udev_bus_init(void *args) goto error; } + if (access("/run/pressure-vessel", R_OK) || access("/.flatpak-info", R_OK)) + { + TRACE("Container detected, bypassing udevd by default\n"); + options.disable_udevd = TRUE; + } + #ifdef HAVE_SYS_INOTIFY_H if (options.disable_udevd) monitor_fd = create_inotify(); if (monitor_fd < 0) options.disable_udevd = FALSE; From ba045634e2e84012e63138c9465fcdf52f8957d2 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 10 Nov 2020 19:03:47 +0000 Subject: [PATCH 0089/2542] winebus: Guess the type of evdev input devices. Ordinarily, we can get the type of an evdev input device from udev: the input_id builtin sets udev properties of the form ID_INPUT_FOO that we can read. However, in a container there is no guarantee that the libudev in the container will interoperate with the udevd on the host system, so we need to be prepared to do this ourselves from first principles, using a heuristic similar to the one in udev's input_id. We cannot simply copy the heuristic from udev's input_id, because its licensing is incompatible (GPL). Instead, use a vaguely similar heuristic that works from the same inputs and will generally produce similar results. --- dlls/winebus.sys/bus_udev.c | 325 ++++++++++++++++++++++++++++++++++++ 1 file changed, 325 insertions(+) diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index 1c81415673c7..7ad9c51fd3fb 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -25,6 +25,7 @@ #include "config.h" #include #include +#include #include #include #include @@ -455,6 +456,302 @@ static const struct raw_device_vtbl hidraw_device_vtbl = #define test_bit(arr,bit) (((BYTE*)(arr))[(bit)>>3]&(1<<((bit)&7))) +/* Minimal compatibility with code taken from steam-runtime-tools */ +typedef int gboolean; +#define g_debug(fmt, ...) TRACE(fmt "\n", ## __VA_ARGS__) +#define G_N_ELEMENTS(arr) (sizeof(arr)/sizeof(arr[0])) + +typedef enum +{ + SRT_INPUT_DEVICE_TYPE_FLAGS_JOYSTICK = (1 << 0), + SRT_INPUT_DEVICE_TYPE_FLAGS_ACCELEROMETER = (1 << 1), + SRT_INPUT_DEVICE_TYPE_FLAGS_KEYBOARD = (1 << 2), + SRT_INPUT_DEVICE_TYPE_FLAGS_HAS_KEYS = (1 << 3), + SRT_INPUT_DEVICE_TYPE_FLAGS_MOUSE = (1 << 4), + SRT_INPUT_DEVICE_TYPE_FLAGS_TOUCHPAD = (1 << 5), + SRT_INPUT_DEVICE_TYPE_FLAGS_TOUCHSCREEN = (1 << 6), + SRT_INPUT_DEVICE_TYPE_FLAGS_TABLET = (1 << 7), + SRT_INPUT_DEVICE_TYPE_FLAGS_TABLET_PAD = (1 << 8), + SRT_INPUT_DEVICE_TYPE_FLAGS_POINTING_STICK = (1 << 9), + SRT_INPUT_DEVICE_TYPE_FLAGS_SWITCH = (1 << 10), + SRT_INPUT_DEVICE_TYPE_FLAGS_NONE = 0 +} SrtInputDeviceTypeFlags; + +#define BITS_PER_LONG (sizeof (unsigned long) * CHAR_BIT) +#define LONGS_FOR_BITS(x) ((((x)-1)/BITS_PER_LONG)+1) +typedef struct +{ + unsigned long ev[LONGS_FOR_BITS (EV_MAX)]; + unsigned long keys[LONGS_FOR_BITS (KEY_MAX)]; + unsigned long abs[LONGS_FOR_BITS (ABS_MAX)]; + unsigned long rel[LONGS_FOR_BITS (REL_MAX)]; + unsigned long ff[LONGS_FOR_BITS (FF_MAX)]; + unsigned long props[LONGS_FOR_BITS (INPUT_PROP_MAX)]; +} SrtEvdevCapabilities; + +static gboolean +_srt_get_caps_from_evdev (int fd, + unsigned int type, + unsigned long *bitmask, + size_t bitmask_len_longs) +{ + size_t bitmask_len_bytes = bitmask_len_longs * sizeof (*bitmask); + + memset (bitmask, 0, bitmask_len_bytes); + + if (ioctl (fd, EVIOCGBIT (type, bitmask_len_bytes), bitmask) < 0) + return FALSE; + + return TRUE; +} + +static gboolean +_srt_evdev_capabilities_set_from_evdev (SrtEvdevCapabilities *caps, + int fd) +{ + if (_srt_get_caps_from_evdev (fd, 0, caps->ev, G_N_ELEMENTS (caps->ev))) + { + _srt_get_caps_from_evdev (fd, EV_KEY, caps->keys, G_N_ELEMENTS (caps->keys)); + _srt_get_caps_from_evdev (fd, EV_ABS, caps->abs, G_N_ELEMENTS (caps->abs)); + _srt_get_caps_from_evdev (fd, EV_REL, caps->rel, G_N_ELEMENTS (caps->rel)); + _srt_get_caps_from_evdev (fd, EV_FF, caps->ff, G_N_ELEMENTS (caps->ff)); + ioctl (fd, EVIOCGPROP (sizeof (caps->props)), caps->props); + return TRUE; + } + + memset (caps, 0, sizeof (*caps)); + return FALSE; +} + +#define JOYSTICK_ABS_AXES \ + ((1 << ABS_X) | (1 << ABS_Y) \ + | (1 << ABS_RX) | (1 << ABS_RY) \ + | (1 << ABS_THROTTLE) | (1 << ABS_RUDDER) \ + | (1 << ABS_WHEEL) | (1 << ABS_GAS) | (1 << ABS_BRAKE) \ + | (1 << ABS_HAT0X) | (1 << ABS_HAT0Y) \ + | (1 << ABS_HAT1X) | (1 << ABS_HAT1Y) \ + | (1 << ABS_HAT2X) | (1 << ABS_HAT2Y) \ + | (1 << ABS_HAT3X) | (1 << ABS_HAT3Y)) + +static const unsigned int first_mouse_button = BTN_MOUSE; +static const unsigned int last_mouse_button = BTN_JOYSTICK - 1; + +static const unsigned int first_joystick_button = BTN_JOYSTICK; +static const unsigned int last_joystick_button = BTN_GAMEPAD - 1; + +static const unsigned int first_gamepad_button = BTN_GAMEPAD; +static const unsigned int last_gamepad_button = BTN_DIGI - 1; + +static const unsigned int first_dpad_button = BTN_DPAD_UP; +static const unsigned int last_dpad_button = BTN_DPAD_RIGHT; + +static const unsigned int first_extra_joystick_button = BTN_TRIGGER_HAPPY; +static const unsigned int last_extra_joystick_button = BTN_TRIGGER_HAPPY40; + +SrtInputDeviceTypeFlags +_srt_evdev_capabilities_guess_type (const SrtEvdevCapabilities *caps) +{ + SrtInputDeviceTypeFlags flags = SRT_INPUT_DEVICE_TYPE_FLAGS_NONE; + unsigned int i; + gboolean has_joystick_axes = FALSE; + gboolean has_joystick_buttons = FALSE; + + /* Some properties let us be fairly sure about a device */ + if (test_bit (caps->props, INPUT_PROP_ACCELEROMETER)) + { + g_debug ("INPUT_PROP_ACCELEROMETER => is accelerometer"); + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_ACCELEROMETER; + } + + if (test_bit (caps->props, INPUT_PROP_POINTING_STICK)) + { + g_debug ("INPUT_PROP_POINTING_STICK => is pointing stick"); + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_POINTING_STICK; + } + + if (test_bit (caps->props, INPUT_PROP_BUTTONPAD) + || test_bit (caps->props, INPUT_PROP_TOPBUTTONPAD)) + { + g_debug ("INPUT_PROP_[TOP]BUTTONPAD => is touchpad"); + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_TOUCHPAD; + } + + /* Devices with a stylus or pen are assumed to be graphics tablets */ + if (test_bit (caps->keys, BTN_STYLUS) + || test_bit (caps->keys, BTN_TOOL_PEN)) + { + g_debug ("Stylus or pen => is tablet"); + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_TABLET; + } + + /* Devices that accept a finger touch are assumed to be touchpads or + * touchscreens. + * + * In Steam we mostly only care about these as a way to + * reject non-joysticks, so we're not very precise here yet. + * + * SDL assumes that TOUCH means a touchscreen and FINGER + * means a touchpad. */ + if (flags == SRT_INPUT_DEVICE_TYPE_FLAGS_NONE + && (test_bit (caps->keys, BTN_TOOL_FINGER) + || test_bit (caps->keys, BTN_TOUCH) + || test_bit (caps->props, INPUT_PROP_SEMI_MT))) + { + g_debug ("Finger or touch or semi-MT => is touchpad or touchscreen"); + + if (test_bit (caps->props, INPUT_PROP_POINTER)) + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_TOUCHPAD; + else + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_TOUCHSCREEN; + } + + /* Devices with mouse buttons are ... probably mice? */ + if (flags == SRT_INPUT_DEVICE_TYPE_FLAGS_NONE) + { + for (i = first_mouse_button; i <= last_mouse_button; i++) + { + if (test_bit (caps->keys, i)) + { + g_debug ("Mouse button => mouse"); + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_MOUSE; + } + } + } + + if (flags == SRT_INPUT_DEVICE_TYPE_FLAGS_NONE) + { + for (i = ABS_X; i < ABS_Z; i++) + { + if (!test_bit (caps->abs, i)) + break; + } + + /* If it has 3 axes and no buttons it's probably an accelerometer. */ + if (i == ABS_Z && !test_bit (caps->ev, EV_KEY)) + { + g_debug ("3 left axes and no buttons => accelerometer"); + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_ACCELEROMETER; + } + + /* Same for RX..RZ (e.g. Wiimote) */ + for (i = ABS_RX; i < ABS_RZ; i++) + { + if (!test_bit (caps->abs, i)) + break; + } + + if (i == ABS_RZ && !test_bit (caps->ev, EV_KEY)) + { + g_debug ("3 right axes and no buttons => accelerometer"); + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_ACCELEROMETER; + } + } + + /* Bits 1 to 31 are ESC, numbers and Q to D, which SDL and udev both + * consider to be enough to count as a fully-functioned keyboard. */ + if ((caps->keys[0] & 0xfffffffe) == 0xfffffffe) + { + g_debug ("First few keys => keyboard"); + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_KEYBOARD; + } + + /* If we have *any* keys, consider it to be something a bit + * keyboard-like. Bits 0 to 63 are all keyboard keys. + * Make sure we stop before reaching KEY_UP which is sometimes + * used on game controller mappings, e.g. for the Wiimote. */ + for (i = 0; i < (64 / BITS_PER_LONG); i++) + { + if (caps->keys[i] != 0) + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_HAS_KEYS; + } + + if (caps->abs[0] & JOYSTICK_ABS_AXES) + has_joystick_axes = TRUE; + + /* Flight stick buttons */ + for (i = first_joystick_button; i <= last_joystick_button; i++) + { + if (test_bit (caps->keys, i)) + has_joystick_buttons = TRUE; + } + + /* Gamepad buttons (Xbox, PS3, etc.) */ + for (i = first_gamepad_button; i <= last_gamepad_button; i++) + { + if (test_bit (caps->keys, i)) + has_joystick_buttons = TRUE; + } + + /* Gamepad digital dpad */ + for (i = first_dpad_button; i <= last_dpad_button; i++) + { + if (test_bit (caps->keys, i)) + has_joystick_buttons = TRUE; + } + + /* Steering wheel gear-change buttons */ + for (i = BTN_GEAR_DOWN; i <= BTN_GEAR_UP; i++) + { + if (test_bit (caps->keys, i)) + has_joystick_buttons = TRUE; + } + + /* Reserved space for extra game-controller buttons, e.g. on Corsair + * gaming keyboards */ + for (i = first_extra_joystick_button; i <= last_extra_joystick_button; i++) + { + if (test_bit (caps->keys, i)) + has_joystick_buttons = TRUE; + } + + if (test_bit (caps->keys, last_mouse_button)) + { + /* Mice with a very large number of buttons can apparently + * overflow into the joystick-button space, but they're still not + * joysticks. */ + has_joystick_buttons = FALSE; + } + + /* TODO: Do we want to consider BTN_0 up to BTN_9 to be joystick buttons? + * libmanette and SDL look for BTN_1, udev does not. + * + * They're used by some game controllers, like BTN_1 and BTN_2 for the + * Wiimote, BTN_1..BTN_9 for the SpaceTec SpaceBall and BTN_0..BTN_3 + * for Playstation dance pads, but they're also used by + * non-game-controllers like Logitech mice. For now we entirely ignore + * these buttons: they are not evidence that it's a joystick, but + * neither are they evidence that it *isn't* a joystick. */ + + /* We consider it to be a joystick if there is some evidence that it is, + * and no evidence that it's something else. + * + * Unlike SDL, we accept devices with only axes and no buttons as a + * possible joystick, unless they have X/Y/Z axes in which case we + * assume they're accelerometers. */ + if ((has_joystick_buttons || has_joystick_axes) + && (flags == SRT_INPUT_DEVICE_TYPE_FLAGS_NONE)) + { + g_debug ("Looks like a joystick"); + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_JOYSTICK; + } + + /* If we have *any* keys below BTN_MISC, consider it to be something + * a bit keyboard-like, but don't rule out *also* being considered + * to be a joystick (again for e.g. the Wiimote). */ + for (i = 0; i < (BTN_MISC / BITS_PER_LONG); i++) + { + if (caps->keys[i] != 0) + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_HAS_KEYS; + } + + /* Also non-exclusive: don't rule out a device being a joystick and + * having a switch */ + if (test_bit (caps->ev, EV_SW)) + flags |= SRT_INPUT_DEVICE_TYPE_FLAGS_SWITCH; + + return flags; +} + static const USAGE_AND_PAGE *what_am_I(struct udev_device *dev, int fd) { static const USAGE_AND_PAGE Unknown = {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = 0}; @@ -465,6 +762,7 @@ static const USAGE_AND_PAGE *what_am_I(struct udev_device *dev, int fd) static const USAGE_AND_PAGE Tablet = {.UsagePage = HID_USAGE_PAGE_DIGITIZER, .Usage = HID_USAGE_DIGITIZER_PEN}; static const USAGE_AND_PAGE Touchscreen = {.UsagePage = HID_USAGE_PAGE_DIGITIZER, .Usage = HID_USAGE_DIGITIZER_TOUCH_SCREEN}; static const USAGE_AND_PAGE Touchpad = {.UsagePage = HID_USAGE_PAGE_DIGITIZER, .Usage = HID_USAGE_DIGITIZER_TOUCH_PAD}; + SrtEvdevCapabilities caps; struct udev_device *parent = dev; @@ -489,6 +787,33 @@ static const USAGE_AND_PAGE *what_am_I(struct udev_device *dev, int fd) parent = udev_device_get_parent_with_subsystem_devtype(parent, "input", NULL); } + /* In a container, udev properties might not be available. Fall back to deriving the device + * type from the fd's evdev capabilities. */ + if (_srt_evdev_capabilities_set_from_evdev (&caps, fd)) + { + SrtInputDeviceTypeFlags guessed_type; + + guessed_type = _srt_evdev_capabilities_guess_type (&caps); + + if (guessed_type & (SRT_INPUT_DEVICE_TYPE_FLAGS_MOUSE + | SRT_INPUT_DEVICE_TYPE_FLAGS_POINTING_STICK)) + return &Mouse; + else if (guessed_type & SRT_INPUT_DEVICE_TYPE_FLAGS_KEYBOARD) + return &Keyboard; + else if (guessed_type & SRT_INPUT_DEVICE_TYPE_FLAGS_JOYSTICK) + return &Gamepad; + else if (guessed_type & SRT_INPUT_DEVICE_TYPE_FLAGS_HAS_KEYS) + return &Keypad; + else if (guessed_type & SRT_INPUT_DEVICE_TYPE_FLAGS_TOUCHPAD) + return &Touchpad; + else if (guessed_type & SRT_INPUT_DEVICE_TYPE_FLAGS_TOUCHSCREEN) + return &Touchscreen; + else if (guessed_type & SRT_INPUT_DEVICE_TYPE_FLAGS_TABLET) + return &Tablet; + + /* Mapped to Unknown: ACCELEROMETER, TABLET_PAD, SWITCH. */ + } + return &Unknown; } From 8c3a62f0daa0931337ebbb9833dfe4cc3d1144b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sun, 17 Nov 2024 10:50:49 +0100 Subject: [PATCH 0090/2542] HACK: winebus: Ignore some SDL controllers and joysticks. --- dlls/winebus.sys/bus_sdl.c | 23 +++++++++++++++++++++++ dlls/winebus.sys/bus_udev.c | 6 ++++++ dlls/winebus.sys/unix_private.h | 2 ++ 3 files changed, 31 insertions(+) diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index 18c846139a9f..e2340fc06f5b 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -926,6 +926,21 @@ static BOOL set_report_from_controller_event(struct sdl_device *impl, SDL_Event return FALSE; } +/* logic from SDL2's SDL_ShouldIgnoreGameController */ +BOOL is_sdl_ignored_device(WORD vid, WORD pid) +{ + const char *whitelist = getenv("SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT"); + const char *blacklist = getenv("SDL_GAMECONTROLLER_IGNORE_DEVICES"); + char needle[16]; + + if (vid == 0x056a) return TRUE; /* all Wacom devices */ + + sprintf(needle, "0x%04x/0x%04x", vid, pid); + if (whitelist) return strcasestr(whitelist, needle) == NULL; + if (blacklist) return strcasestr(blacklist, needle) != NULL; + return FALSE; +} + static void sdl_add_device(unsigned int index) { struct device_desc desc = @@ -970,6 +985,14 @@ static void sdl_add_device(unsigned int index) desc.version = 0; } + if (is_sdl_ignored_device(desc.vid, desc.pid)) + { + TRACE("ignoring %s\n", debugstr_device_desc(&desc)); + if (controller) pSDL_GameControllerClose(controller); + pSDL_JoystickClose(joystick); + return; + } + if (pSDL_JoystickGetSerial && (sdl_serial = pSDL_JoystickGetSerial(joystick))) { ntdll_umbstowcs(sdl_serial, strlen(sdl_serial) + 1, desc.serialnumber, ARRAY_SIZE(desc.serialnumber)); diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index 7ad9c51fd3fb..0fd91182f561 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -1617,6 +1617,12 @@ static void udev_add_device(struct udev_device *dev, int fd) if (is_xbox_gamepad(desc.vid, desc.pid)) desc.is_gamepad = TRUE; + else if (is_sdl_ignored_device(desc.vid, desc.pid)) + { + TRACE("evdev %s: ignoring %s, in SDL ignore list\n", debugstr_a(devnode), debugstr_device_desc(&desc)); + close(fd); + return; + } #ifdef HAS_PROPER_INPUT_HEADER else if (!strcmp(subsystem, "input")) { diff --git a/dlls/winebus.sys/unix_private.h b/dlls/winebus.sys/unix_private.h index f2f4e71f0140..797ec7de7404 100644 --- a/dlls/winebus.sys/unix_private.h +++ b/dlls/winebus.sys/unix_private.h @@ -266,4 +266,6 @@ extern void hid_device_drop_report(struct unix_device *iface); extern void hid_device_set_effect_state(struct unix_device *iface, BYTE index, BYTE flags); +extern BOOL is_sdl_ignored_device(WORD vid, WORD pid); + #endif /* __WINEBUS_UNIX_PRIVATE_H */ From 067ae0012646cabb246358b66d446c9157ff7cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 12 Jan 2024 11:39:11 +0100 Subject: [PATCH 0091/2542] HACK: winebus: Disable SDL2.30 new behavior for the SDL unix backend. CW-Bug-Id: #23185 --- dlls/winebus.sys/bus_sdl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index e2340fc06f5b..bdd982421fc3 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -116,6 +116,7 @@ MAKE_FUNCPTR(SDL_RegisterEvents); MAKE_FUNCPTR(SDL_PushEvent); MAKE_FUNCPTR(SDL_GetTicks); MAKE_FUNCPTR(SDL_LogSetPriority); +MAKE_FUNCPTR(SDL_SetHintWithPriority); static int (*pSDL_JoystickRumble)(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); static int (*pSDL_JoystickRumbleTriggers)(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); static Uint16 (*pSDL_JoystickGetProduct)(SDL_Joystick * joystick); @@ -1166,6 +1167,7 @@ NTSTATUS sdl_bus_init(void *args) LOAD_FUNCPTR(SDL_PushEvent); LOAD_FUNCPTR(SDL_GetTicks); LOAD_FUNCPTR(SDL_LogSetPriority); + LOAD_FUNCPTR(SDL_SetHintWithPriority); #undef LOAD_FUNCPTR pSDL_JoystickRumble = dlsym(sdl_handle, "SDL_JoystickRumble"); pSDL_JoystickRumbleTriggers = dlsym(sdl_handle, "SDL_JoystickRumbleTriggers"); @@ -1175,6 +1177,10 @@ NTSTATUS sdl_bus_init(void *args) pSDL_JoystickGetType = dlsym(sdl_handle, "SDL_JoystickGetType"); pSDL_JoystickGetSerial = dlsym(sdl_handle, "SDL_JoystickGetSerial"); + /* CW-Bug-Id: #23185: Disable SDL 2.30 new behavior, we need the steam virtual + * controller name to figure which slot number it represents. */ + pSDL_SetHintWithPriority("SteamVirtualGamepadInfo", "", SDL_HINT_OVERRIDE); + if (pSDL_Init(SDL_INIT_GAMECONTROLLER | SDL_INIT_HAPTIC) < 0) { ERR("could not init SDL: %s\n", pSDL_GetError()); From ed841579ca6861462abd67c2acbc232d1cc464a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 14 Jun 2024 17:31:38 +0200 Subject: [PATCH 0092/2542] HACK: winebus: Use evdev backend for the Steam Input virtual controllers. CW-Bug-Id: #23185 CW-Bug-Id: #23928 CW-Bug-Id: #23931 CW-Bug-Id: #24642 --- dlls/winebus.sys/bus_sdl.c | 1 + dlls/winebus.sys/bus_udev.c | 19 ++++++++++++++++++- dlls/winebus.sys/main.c | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index bdd982421fc3..81bc61dd3bec 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -935,6 +935,7 @@ BOOL is_sdl_ignored_device(WORD vid, WORD pid) char needle[16]; if (vid == 0x056a) return TRUE; /* all Wacom devices */ + if (vid == 0x28de && pid == 0x11ff) return TRUE; /* Steam Input virtual controller, handled with evdev */ sprintf(needle, "0x%04x/0x%04x", vid, pid); if (whitelist) return strcasestr(whitelist, needle) == NULL; diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index 0fd91182f561..935a66b39fc8 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -1602,7 +1602,10 @@ static void udev_add_device(struct udev_device *dev, int fd) if (!desc.manufacturer[0]) memcpy(desc.manufacturer, evdev, sizeof(evdev)); if (!desc.product[0] && ioctl(fd, EVIOCGNAME(sizeof(buffer) - 1), buffer) > 0) + { + if (sscanf(buffer, "Microsoft X-Box 360 pad %u", &desc.input) != 1) desc.input = -1; ntdll_umbstowcs(buffer, strlen(buffer) + 1, desc.product, ARRAY_SIZE(desc.product)); + } if (!desc.serialnumber[0] && ioctl(fd, EVIOCGUNIQ(sizeof(buffer)), buffer) >= 0) ntdll_umbstowcs(buffer, strlen(buffer) + 1, desc.serialnumber, ARRAY_SIZE(desc.serialnumber)); @@ -1615,14 +1618,28 @@ static void udev_add_device(struct udev_device *dev, int fd) memcpy(desc.serialnumber, zeros, sizeof(zeros)); } - if (is_xbox_gamepad(desc.vid, desc.pid)) + if (desc.vid == 0x28de && desc.pid == 0x11ff && !strcmp(subsystem, "input")) + { + TRACE("evdev %s: detected steam input virtual controller\n", debugstr_a(devnode)); desc.is_gamepad = TRUE; + desc.version = 0; /* keep version fixed as 0 so we can hardcode it in ntdll rawinput pipe redirection */ + } else if (is_sdl_ignored_device(desc.vid, desc.pid)) { TRACE("evdev %s: ignoring %s, in SDL ignore list\n", debugstr_a(devnode), debugstr_device_desc(&desc)); close(fd); return; } + else if (!strcmp(subsystem, "input")) + { + TRACE("evdev %s: deferring %s to a different backend\n", debugstr_a(devnode), debugstr_device_desc(&desc)); + close(fd); + return; + } + else if (is_xbox_gamepad(desc.vid, desc.pid)) + { + desc.is_gamepad = TRUE; + } #ifdef HAS_PROPER_INPUT_HEADER else if (!strcmp(subsystem, "input")) { diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c index 9dbfd1bf074c..f287533702f2 100644 --- a/dlls/winebus.sys/main.c +++ b/dlls/winebus.sys/main.c @@ -1055,7 +1055,7 @@ static NTSTATUS udev_driver_init(BOOL enable_sdl) bus_options.disable_hidraw = check_bus_option(L"DisableHidraw", 0); if (bus_options.disable_hidraw) TRACE("UDEV hidraw devices disabled in registry\n"); - bus_options.disable_input = check_bus_option(L"DisableInput", 0) || enable_sdl; + bus_options.disable_input = check_bus_option(L"DisableInput", 0); if (bus_options.disable_input) TRACE("UDEV input devices disabled in registry\n"); bus_options.disable_udevd = check_bus_option(L"DisableUdevd", 0); if (bus_options.disable_udevd) TRACE("UDEV udevd use disabled in registry\n"); From b711e19d91e62b4e7b4c5b448a03299ab3602e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sun, 17 Nov 2024 11:10:17 +0100 Subject: [PATCH 0093/2542] HACK: xinput: Emulate Steam Input native hooks. CW-Bug-Id: #23185 --- dlls/xinput1_3/main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dlls/xinput1_3/main.c b/dlls/xinput1_3/main.c index 1ccbe834d093..92cd439f6b9f 100644 --- a/dlls/xinput1_3/main.c +++ b/dlls/xinput1_3/main.c @@ -508,6 +508,17 @@ static BOOL find_opened_device(const WCHAR *device_path, int *free_slot) if (!controllers[i - 1].device) *free_slot = i - 1; else if (!wcsicmp(device_path, controllers[i - 1].device_path)) return TRUE; } + + /* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ + if ((swscanf(device_path, L"\\\\?\\hid#vid_28de&pid_11ff&xi_%02u#", &i) == 1 || + swscanf(device_path, L"\\\\?\\HID#VID_28DE&PID_11FF&XI_%02u#", &i) == 1) && + i < XUSER_MAX_COUNT && *free_slot != i) + { + controller_destroy(&controllers[i], TRUE); + if (*free_slot != XUSER_MAX_COUNT) open_device_at_index(controllers[i].device_path, *free_slot); + *free_slot = i; + } + return FALSE; } @@ -1157,6 +1168,8 @@ DWORD WINAPI DECLSPEC_HOTPATCH XInputGetCapabilitiesEx(DWORD unk, DWORD index, D caps->VendorId = attr.VendorID; caps->ProductId = attr.ProductID; caps->VersionNumber = attr.VersionNumber; + /* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ + caps->unk2 = index; } controller_unlock(&controllers[index]); From 4de93694219ec005756bd2ed8fce2c215528f7a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 8 Jan 2024 14:35:42 +0100 Subject: [PATCH 0094/2542] HACK: dinput: Emulate Steam Input native hooks. CW-Bug-Id: #23185 --- dlls/dinput/joystick_hid.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 6989a3d4a443..b66e8f3deff2 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -821,6 +821,16 @@ static HRESULT hid_joystick_get_property( IDirectInputDevice8W *iface, DWORD pro { DIPROPGUIDANDPATH *value = (DIPROPGUIDANDPATH *)header; value->guidClass = GUID_DEVCLASS_HIDCLASS; + + /* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ + if (impl->attrs.VendorID == 0x28de && impl->attrs.ProductID == 0x11ff) + { + const WCHAR *tmp; + if ((tmp = wcschr( impl->device_path, '#' ))) tmp = wcschr( tmp + 1, '#' ); + lstrcpynW( value->wszPath, impl->device_path, tmp - impl->device_path + 1 ); + return DI_OK; + } + lstrcpynW( value->wszPath, impl->device_path, MAX_PATH ); return DI_OK; } From e9f99a2660072e5746cdf399f1b1a3d3ad133135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 8 Jan 2024 14:35:42 +0100 Subject: [PATCH 0095/2542] HACK: hidclass: Emulate Steam Input native hooks. CW-Bug-Id: #23185 --- dlls/hidclass.sys/device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c index 479e49701d1d..2020b8ce3a5b 100644 --- a/dlls/hidclass.sys/device.c +++ b/dlls/hidclass.sys/device.c @@ -403,6 +403,8 @@ struct device_strings static const struct device_strings device_strings[] = { + /* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ + { .id = L"VID_28DE&PID_11FF", .product = L"Controller (XBOX 360 For Windows)" }, /* Microsoft controllers */ { .id = L"VID_045E&PID_028E", .product = L"Controller (XBOX 360 For Windows)" }, { .id = L"VID_045E&PID_028F", .product = L"Controller (XBOX 360 For Windows)" }, From 3e95eab6896540c8c2328aca7b994c8ee5f52b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 8 Jan 2024 14:35:42 +0100 Subject: [PATCH 0096/2542] HACK: ntdll: Emulate Steam Input native hooks. CW-Bug-Id: #23185 --- dlls/ntdll/unix/file.c | 68 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 4a2c3a84b6f9..6d8a81e7f4fd 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -2925,6 +2925,67 @@ static NTSTATUS find_file_in_dir( char *unix_name, int pos, const WCHAR *name, i return STATUS_OBJECT_NAME_NOT_FOUND; } +/* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ +static BOOL replace_steam_input_path( OBJECT_ATTRIBUTES *attr, UNICODE_STRING *redir ) +{ + static const WCHAR pipe_prefixW[] = + { + '\\','?','?','\\','p','i','p','e','\\','H','I','D','#','V','I','D','_','0','4','5','E', + '&','P','I','D','_','0','2','8','E','&','I','G','_','0','0', + }; + static const WCHAR hid_prefixW[] = + { + '\\','?','?','\\','h','i','d','#','v','i','d','_','2','8','d','e', + '&','p','i','d','_','1','1','f','f','&','i','g','_','0' + }; + static const WCHAR hid_midW[] = + { + '#','0', + }; + static const WCHAR hid_tailW[] = + { + '&','0','&','0','&','1','#','{','4','d','1','e','5','5','b','2','-','f','1','6','f','-', + '1','1','c','f','-','8','8','c','b','-','0','0','1','1','1','1','0','0','0','0','3','0','}' + }; + UNICODE_STRING *path = attr->ObjectName; + const WCHAR *slot = NULL, *slot_end = NULL, *serial, *serial_end = NULL; + UINT len = 0; + + if (!path || !path->Buffer || path->Length <= sizeof(pipe_prefixW)) return FALSE; + if (wcsnicmp( path->Buffer, pipe_prefixW, ARRAY_SIZE(pipe_prefixW) )) return FALSE; + + serial = path->Buffer + path->Length / sizeof(WCHAR); + while (serial > path->Buffer && *serial != '&') + { + if (*serial == '#') + { + slot_end = serial_end; + serial_end = serial; + slot = serial_end + 1; + } + serial--; + } + if (serial == path->Buffer || *serial != '&' || !slot_end || !serial_end) return FALSE; + + redir->Length = sizeof(hid_prefixW) + sizeof(hid_midW) + sizeof(hid_tailW); + redir->Length += (serial_end - serial + slot_end - slot) * sizeof(WCHAR); + redir->MaximumLength = redir->Length + sizeof(WCHAR); + if (!(redir->Buffer = malloc( redir->MaximumLength ))) return FALSE; + + memcpy( redir->Buffer, hid_prefixW, sizeof(hid_prefixW) ); + len += ARRAY_SIZE(hid_prefixW); + memcpy( redir->Buffer + len, slot, (slot_end - slot) * sizeof(WCHAR) ); + len += slot_end - slot; + memcpy( redir->Buffer + len, hid_midW, sizeof(hid_midW) ); + len += ARRAY_SIZE(hid_midW); + memcpy( redir->Buffer + len, serial, (serial_end - serial) * sizeof(WCHAR) ); + len += serial_end - serial; + memcpy( redir->Buffer + len, hid_tailW, sizeof(hid_tailW) ); + + TRACE( "HACK: %s -> %s\n", debugstr_us(attr->ObjectName), debugstr_us(redir) ); + attr->ObjectName = redir; + return TRUE; +} #ifndef _WIN64 @@ -3026,6 +3087,10 @@ BOOL get_redirect( OBJECT_ATTRIBUTES *attr, UNICODE_STRING *redir ) unsigned int i, prefix_len = 0, len = attr->ObjectName->Length / sizeof(WCHAR); redir->Buffer = NULL; + + /* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ + if (replace_steam_input_path( attr, redir )) return TRUE; + if (!NtCurrentTeb64()) return FALSE; if (!len) return FALSE; @@ -3085,7 +3150,8 @@ BOOL get_redirect( OBJECT_ATTRIBUTES *attr, UNICODE_STRING *redir ) BOOL get_redirect( OBJECT_ATTRIBUTES *attr, UNICODE_STRING *redir ) { redir->Buffer = NULL; - return FALSE; + /* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ + return replace_steam_input_path( attr, redir ); } #endif From 59add17c083e08e8724b80fa6648c824f199226f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 8 Jan 2024 14:35:42 +0100 Subject: [PATCH 0097/2542] HACK: win32u: Emulate Steam Input native hooks. CW-Bug-Id: #23185 --- dlls/win32u/rawinput.c | 69 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/dlls/win32u/rawinput.c b/dlls/win32u/rawinput.c index 62b1707dbfe9..5e875e655803 100644 --- a/dlls/win32u/rawinput.c +++ b/dlls/win32u/rawinput.c @@ -374,6 +374,30 @@ UINT WINAPI NtUserGetRawInputDeviceList( RAWINPUTDEVICELIST *device_list, UINT * return count; } +static BOOL steam_input_get_vid_pid( UINT slot, UINT16 *vid, UINT16 *pid ) +{ + const char *info = getenv( "SteamVirtualGamepadInfo" ); + char buffer[256]; + UINT current; + FILE *file; + + TRACE( "reading SteamVirtualGamepadInfo %s\n", debugstr_a(info) ); + + if (!info || !(file = fopen( info, "r" ))) return FALSE; + while (fscanf( file, "%255[^\n]\n", buffer ) == 1) + { + if (sscanf( buffer, "[slot %d]", ¤t )) continue; + if (current < slot) continue; + if (current > slot) break; + if (sscanf( buffer, "VID=0x%hx", vid )) continue; + if (sscanf( buffer, "PID=0x%hx", pid )) continue; + } + + fclose( file ); + + return TRUE; +} + /********************************************************************** * NtUserGetRawInputDeviceInfo (win32u.@) */ @@ -411,10 +435,51 @@ UINT WINAPI NtUserGetRawInputDeviceInfo( HANDLE handle, UINT command, void *data switch (command) { case RIDI_DEVICENAME: - if ((len = wcslen( device->path ) + 1) <= data_len && data) - memcpy( data, device->path, len * sizeof(WCHAR) ); + { + static const WCHAR steam_input_idW[] = + { + '\\','\\','?','\\','H','I','D','#','V','I','D','_','2','8','D','E','&','P','I','D','_','1','1','F','F','&','I','G','_',0 + }; + const WCHAR *device_path; + WCHAR bufferW[MAX_PATH]; + + /* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ + if (wcsnicmp( device->path, steam_input_idW, 29 )) device_path = device->path; + else + { + char buffer[MAX_PATH]; + UINT size = 0, slot; + const WCHAR *tmpW; + UINT16 vid, pid; + + tmpW = device->path + 29; + while (*tmpW && *tmpW != '#' && size < ARRAY_SIZE(buffer)) buffer[size++] = *tmpW++; + buffer[size] = 0; + if (sscanf( buffer, "%02u", &slot ) != 1) slot = 0; + + if (!steam_input_get_vid_pid( slot, &vid, &pid )) + { + vid = 0x045e; + pid = 0x028e; + } + + size = snprintf( buffer, ARRAY_SIZE(buffer), "\\\\.\\pipe\\HID#VID_045E&PID_028E&IG_00#%04X&%04X", vid, pid ); + if ((tmpW = wcschr( device->path + 29, '&' ))) + { + do buffer[size++] = *tmpW++; + while (*tmpW != '&' && size < ARRAY_SIZE(buffer)); + } + size += snprintf( buffer + size, ARRAY_SIZE(buffer) - size, "#%d#%u", slot, (UINT)GetCurrentProcessId() ); + + ntdll_umbstowcs( buffer, size + 1, bufferW, sizeof(bufferW) ); + device_path = bufferW; + } + + if ((len = wcslen( device_path ) + 1) <= data_len && data) + memcpy( data, device_path, len * sizeof(WCHAR) ); *data_size = len; break; + } case RIDI_DEVICEINFO: if ((len = sizeof(info)) <= data_len && data) From f1f3b5d3bbc3a3bc222be92ce583d5ce6746d069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 8 Jan 2024 14:35:42 +0100 Subject: [PATCH 0098/2542] HACK: windows.gaming.input: Emulate Steam Input native hooks. CW-Bug-Id: #23185 --- dlls/windows.gaming.input/provider.c | 53 ++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/dlls/windows.gaming.input/provider.c b/dlls/windows.gaming.input/provider.c index 381f4ccfadba..d9389ebbeedd 100644 --- a/dlls/windows.gaming.input/provider.c +++ b/dlls/windows.gaming.input/provider.c @@ -148,9 +148,62 @@ static BOOL CALLBACK count_ffb_axes( const DIDEVICEOBJECTINSTANCEW *obj, void *a return DIENUM_CONTINUE; } +static BOOL steam_input_get_vid_pid( UINT slot, UINT16 *vid, UINT16 *pid ) +{ + const char *info = getenv( "SteamVirtualGamepadInfo" ); + char buffer[256]; + UINT current; + FILE *file; + + TRACE( "reading SteamVirtualGamepadInfo %s\n", debugstr_a(info) ); + + if (!info || !(file = fopen( info, "r" ))) return FALSE; + while (fscanf( file, "%255[^\n]\n", buffer ) == 1) + { + if (sscanf( buffer, "[slot %d]", ¤t )) continue; + if (current < slot) continue; + if (current > slot) break; + if (sscanf( buffer, "VID=0x%hx", vid )) continue; + if (sscanf( buffer, "PID=0x%hx", pid )) continue; + } + + fclose( file ); + + return TRUE; +} + static HRESULT WINAPI wine_provider_get_NonRoamableId( IWineGameControllerProvider *iface, HSTRING *value ) { + struct provider *impl = impl_from_IWineGameControllerProvider( iface ); + WCHAR buffer[1024]; + UINT16 vid, pid; + HRESULT hr; + FIXME( "iface %p, value %p stub!\n", iface, value ); + + if (FAILED(hr = IGameControllerProvider_get_HardwareVendorId( &impl->IGameControllerProvider_iface, &vid ))) return hr; + if (FAILED(hr = IGameControllerProvider_get_HardwareProductId( &impl->IGameControllerProvider_iface, &pid ))) return hr; + + /* CW-Bug-Id: #23185 Emulate Steam Input native hooks for native SDL */ + if (vid == 0x28de && pid == 0x11ff) + { + const WCHAR *tmp; + char serial[256]; + UINT32 len, slot; + + if (!(tmp = wcschr( impl->device_path + 8, '#' )) || wcsnicmp( tmp - 6, L"&XI_", 4 )) return E_NOTIMPL; + if (swscanf( tmp - 2, L"%02u#%*u&%255[^&]&", &slot, serial ) != 2) return E_NOTIMPL; + + if (!steam_input_get_vid_pid( slot, &vid, &pid )) + { + vid = 0x045e; + pid = 0x028e; + } + + len = swprintf( buffer, ARRAY_SIZE(buffer), L"{wgi/nrid/:steam-%04X&%04X&%s#%d#%u}", vid, pid, serial, slot, GetCurrentProcessId() ); + return WindowsCreateString( buffer, len, value ); + } + return E_NOTIMPL; } From f03ef8b7b29a4809a10625f52e4e64eea60eb9ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 22 Nov 2022 09:05:04 +0100 Subject: [PATCH 0099/2542] windows.gaming.input: Only create Gamepad instances for XInput devices. --- dlls/windows.gaming.input/provider.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/windows.gaming.input/provider.c b/dlls/windows.gaming.input/provider.c index d9389ebbeedd..3515d5c9ba66 100644 --- a/dlls/windows.gaming.input/provider.c +++ b/dlls/windows.gaming.input/provider.c @@ -211,16 +211,18 @@ static HRESULT WINAPI wine_provider_get_Type( IWineGameControllerProvider *iface { struct provider *impl = impl_from_IWineGameControllerProvider( iface ); DIDEVICEINSTANCEW instance = {.dwSize = sizeof(DIDEVICEINSTANCEW)}; + const WCHAR *tmp; HRESULT hr; TRACE( "iface %p, value %p.\n", iface, value ); if (FAILED(hr = IDirectInputDevice8_GetDeviceInfo( impl->dinput_device, &instance ))) return hr; - switch (GET_DIDEVICE_TYPE( instance.dwDevType )) + if ((tmp = wcschr( impl->device_path + 8, '#' )) && !wcsnicmp( tmp - 6, L"&XI_", 4 )) + *value = WineGameControllerType_Gamepad; + else switch (GET_DIDEVICE_TYPE( instance.dwDevType )) { case DI8DEVTYPE_DRIVING: *value = WineGameControllerType_RacingWheel; break; - case DI8DEVTYPE_GAMEPAD: *value = WineGameControllerType_Gamepad; break; default: { DWORD count = 0; From c4b4ee97127b06a8813e956839551d84f7c91842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sun, 17 Nov 2024 11:35:14 +0100 Subject: [PATCH 0100/2542] winebus: Add Logitech G920 mapping to the SDL backend. The HID input report format is different between Linux (hid_logitech_hidpp) and Windows when it comes to axis HID usages. To correct that we can use the device through SDL and craft our own HID mapping. --- dlls/winebus.sys/bus_sdl.c | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index 81bc61dd3bec..6342c3490d94 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -249,6 +249,13 @@ static BOOL descriptor_add_haptic(struct sdl_device *impl, BOOL force) return TRUE; } +static const USAGE_AND_PAGE g920_absolute_usages[] = +{ + {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_X}, /* wheel */ + {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_Y}, /* accelerator */ + {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_Z}, /* brake */ + {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_RZ}, /* clutch */ +}; static const USAGE_AND_PAGE absolute_axis_usages[] = { {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_X}, @@ -273,6 +280,18 @@ static const USAGE_AND_PAGE relative_axis_usages[] = {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_WHEEL}, }; +static int get_absolute_usages(struct sdl_device *impl, const USAGE_AND_PAGE **absolute_usages) +{ + if (pSDL_JoystickGetVendor(impl->sdl_joystick) == 0x046D && pSDL_JoystickGetProduct(impl->sdl_joystick) == 0xC262) + { + *absolute_usages = g920_absolute_usages; + return ARRAY_SIZE(g920_absolute_usages); + } + + *absolute_usages = absolute_axis_usages; + return ARRAY_SIZE(absolute_axis_usages); +} + static NTSTATUS build_joystick_report_descriptor(struct unix_device *iface) { const USAGE_AND_PAGE device_usage = {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_JOYSTICK}; @@ -280,12 +299,15 @@ static NTSTATUS build_joystick_report_descriptor(struct unix_device *iface) int i, button_count, axis_count, ball_count, hat_count; USAGE_AND_PAGE physical_usage; + const USAGE_AND_PAGE *absolute_usages = NULL; + size_t absolute_usages_count = get_absolute_usages(impl, &absolute_usages); + axis_count = pSDL_JoystickNumAxes(impl->sdl_joystick); if (options.split_controllers) axis_count = min(6, axis_count - impl->axis_offset); - if (axis_count > ARRAY_SIZE(absolute_axis_usages)) + if (axis_count > absolute_usages_count) { - FIXME("More than %zu absolute axes found, ignoring.\n", ARRAY_SIZE(absolute_axis_usages)); - axis_count = ARRAY_SIZE(absolute_axis_usages); + FIXME("More than %zu absolute axes found, ignoring.\n", absolute_usages_count); + axis_count = absolute_usages_count; } ball_count = pSDL_JoystickNumBalls(impl->sdl_joystick); @@ -341,8 +363,8 @@ static NTSTATUS build_joystick_report_descriptor(struct unix_device *iface) for (i = 0; i < axis_count; i++) { - if (!hid_device_add_axes(iface, 1, absolute_axis_usages[i].UsagePage, - &absolute_axis_usages[i].Usage, FALSE, -32768, 32767)) + if (!hid_device_add_axes(iface, 1, absolute_usages[i].UsagePage, + &absolute_usages[i].Usage, FALSE, -32768, 32767)) return STATUS_NO_MEMORY; } From faf8d0fc57a6404bdf8f9b3c8381f2d599936d2f Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Tue, 18 Jan 2022 14:29:59 +0200 Subject: [PATCH 0101/2542] dinput: Make it possible to add hacks that override names and GUID of axes. --- dlls/dinput/joystick_hid.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index b66e8f3deff2..bb851089938b 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -540,6 +540,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *filter, struct hid_collection_node *node, *node_end; WORD version = impl->base.dinput->dwVersion; BOOL ret, seen_axis[6] = {0}; + const GUID *hack_guid; + const WCHAR *hack_name; const WCHAR *tmp; button_ofs += impl->caps.NumberInputValueCaps * sizeof(LONG); @@ -559,6 +561,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *filter, value_ofs += (caps->usage_max - caps->usage_min + 1) * sizeof(LONG); else for (j = caps->usage_min; j <= caps->usage_max; ++j) { + hack_name = NULL; + hack_guid = NULL; instance.dwOfs = value_ofs; switch (MAKELONG(j, caps->usage_page)) { @@ -605,12 +609,16 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *filter, } instance.wUsagePage = caps->usage_page; instance.wUsage = j; - instance.guidType = *object_usage_to_guid( instance.wUsagePage, instance.wUsage ); + if (hack_guid) + instance.guidType = *hack_guid; + else + instance.guidType = *object_usage_to_guid( instance.wUsagePage, instance.wUsage ); instance.wReportId = caps->report_id; instance.wCollectionNumber = caps->link_collection; instance.dwDimension = caps->units; instance.wExponent = caps->units_exp; - if ((tmp = object_usage_to_string( &instance ))) lstrcpynW( instance.tszName, tmp, MAX_PATH ); + if (hack_name) lstrcpynW( instance.tszName, hack_name, MAX_PATH ); + else if ((tmp = object_usage_to_string( &instance ))) lstrcpynW( instance.tszName, tmp, MAX_PATH ); else swprintf( instance.tszName, MAX_PATH, L"Unknown %u", DIDFT_GETINSTANCE( instance.dwType ) ); check_pid_effect_axis_caps( impl, &instance ); ret = enum_object( impl, filter, flags, callback, object, caps, &instance, data ); From 01fa0f5965080bbda7a3a555869716d658890f98 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Tue, 18 Jan 2022 14:30:46 +0200 Subject: [PATCH 0102/2542] dinput: Add mapping for Logitech G920. The wheel has a custom mapping and type override on Windows that do not correspond what dinput would create by itself basing on HID descriptors. --- dlls/dinput/joystick_hid.c | 39 +++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index bb851089938b..de01025109e4 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -47,6 +47,9 @@ #include "wine/debug.h" #include "wine/hid.h" +#define VID_LOGITECH 0x046D +#define PID_LOGITECH_G920 0xC262 + WINE_DEFAULT_DEBUG_CHANNEL(dinput); DEFINE_GUID( GUID_DEVINTERFACE_WINEXINPUT,0x6c53d5fd,0x6480,0x440f,0xb6,0x18,0x47,0x67,0x50,0xc5,0xe1,0xa6 ); @@ -572,7 +575,38 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *filter, case MAKELONG(HID_USAGE_GENERIC_RX, HID_USAGE_PAGE_GENERIC): case MAKELONG(HID_USAGE_GENERIC_RY, HID_USAGE_PAGE_GENERIC): case MAKELONG(HID_USAGE_GENERIC_RZ, HID_USAGE_PAGE_GENERIC): - set_axis_type( &instance, seen_axis, j - HID_USAGE_GENERIC_X, &axis ); + if (impl->attrs.VendorID == VID_LOGITECH && impl->attrs.ProductID == PID_LOGITECH_G920) + { + if (j == HID_USAGE_GENERIC_X) + { + set_axis_type( &instance, seen_axis, 0, &axis ); + hack_guid = &GUID_XAxis; + hack_name = L"Wheel axis"; + } + else if (j == HID_USAGE_GENERIC_Y) + { + set_axis_type( &instance, seen_axis, 2, &axis ); + hack_guid = &GUID_YAxis; + hack_name = L"Accelerator"; + } + else if (j == HID_USAGE_GENERIC_Z) + { + set_axis_type( &instance, seen_axis, 5, &axis ); + hack_guid = &GUID_RzAxis; + hack_name = L"Brake"; + } + else if (j == HID_USAGE_GENERIC_RZ) + { + instance.dwType = DIDFT_ABSAXIS | DIDFT_MAKEINSTANCE( 6 + axis++ ); + hack_guid = &GUID_Slider; + hack_name = L"Clutch"; + } + else WARN("unknown axis usage page %x usage %lx for Logitech G920\n", caps->usage_page, j); + } + else + { + set_axis_type( &instance, seen_axis, j - HID_USAGE_GENERIC_X, &axis ); + } instance.dwFlags = DIDOI_ASPECTPOSITION; break; case MAKELONG(HID_USAGE_SIMULATION_STEERING, HID_USAGE_PAGE_SIMULATION): @@ -1572,6 +1606,9 @@ static HRESULT hid_joystick_device_try_open( const WCHAR *path, HANDLE *device, break; } + if (attrs->VendorID == VID_LOGITECH && attrs->ProductID == PID_LOGITECH_G920) + type = DI8DEVTYPE_DRIVING | (DI8DEVTYPEDRIVING_DUALPEDALS << 8); + instance->dwDevType = device_type_for_version( type, version ) | DIDEVTYPE_HID; TRACE("detected device type %#lx\n", instance->dwDevType); From 720d09c51e72d081bb1f435f9ff7299c6407fd5c Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Fri, 2 Dec 2022 20:56:46 +0200 Subject: [PATCH 0103/2542] dinput: Don't apply G920 mapping when used through windows.gaming.input. Our windows.gaming.input.dll implementation is built on top of dinput while on Windows it seems to be completely independent. This means it doesn't respect the mapping entries created by Logitech's drivers for dinput and does regular axis mapping on top of hid. Because of that we have to ignore our dinput mapping for the device when we know it was opened through the special WGI GUID. --- dlls/dinput/joystick_hid.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index de01025109e4..cad9abdc6345 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -175,6 +175,7 @@ struct pid_effect_state struct hid_joystick { struct dinput_device base; + BOOL wgi_device; HANDLE device; OVERLAPPED read_ovl; @@ -575,7 +576,7 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *filter, case MAKELONG(HID_USAGE_GENERIC_RX, HID_USAGE_PAGE_GENERIC): case MAKELONG(HID_USAGE_GENERIC_RY, HID_USAGE_PAGE_GENERIC): case MAKELONG(HID_USAGE_GENERIC_RZ, HID_USAGE_PAGE_GENERIC): - if (impl->attrs.VendorID == VID_LOGITECH && impl->attrs.ProductID == PID_LOGITECH_G920) + if (!impl->wgi_device && impl->attrs.VendorID == VID_LOGITECH && impl->attrs.ProductID == PID_LOGITECH_G920) { if (j == HID_USAGE_GENERIC_X) { @@ -2095,6 +2096,7 @@ HRESULT hid_joystick_create_device( struct dinput *dinput, const GUID *guid, IDi &attrs, &impl->caps, dinput->dwVersion ); else { + impl->wgi_device = TRUE; wcscpy( impl->device_path, *(const WCHAR **)guid ); hr = hid_joystick_device_try_open( impl->device_path, &impl->device, &impl->preparsed, &attrs, &impl->caps, &impl->base.instance, dinput->dwVersion ); From cb68aa28dae3dc32020f49840547a4b6e86b0f9d Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Mon, 5 Dec 2022 22:31:40 +0200 Subject: [PATCH 0104/2542] winebus: Don't consider wheels / flight sticks as controllers. CW-Bug-Id: #21657 --- dlls/winebus.sys/bus_sdl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index 6342c3490d94..66195d5c9362 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -977,6 +977,7 @@ static void sdl_add_device(unsigned int index) SDL_Joystick* joystick; SDL_JoystickID id; + SDL_JoystickType joystick_type; SDL_GameController *controller = NULL; const char *product, *sdl_serial; char guid_str[33], buffer[ARRAY_SIZE(desc.product)]; @@ -988,7 +989,10 @@ static void sdl_add_device(unsigned int index) return; } - if (options.map_controllers && pSDL_IsGameController(index)) + joystick_type = pSDL_JoystickGetType(joystick); + if (options.map_controllers && pSDL_IsGameController(index) + && joystick_type != SDL_JOYSTICK_TYPE_WHEEL + && joystick_type != SDL_JOYSTICK_TYPE_FLIGHT_STICK) controller = pSDL_GameControllerOpen(index); if (controller) product = pSDL_GameControllerName(controller); From 299688c29f9a27f4c8850233e1980a2a304b26f0 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Tue, 29 Oct 2019 09:16:37 -0500 Subject: [PATCH 0105/2542] setupapi: Support DICGF_PRESENT when looking for devices CW-Bug-Id: #17243 --- dlls/setupapi/devinst.c | 83 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 2 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 4e406fe700e7..dd08cf70d22f 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -108,6 +108,7 @@ static const WCHAR Linked[] = {'L','i','n','k','e','d',0}; static const WCHAR dotInterfaces[] = {'.','I','n','t','e','r','f','a','c','e','s',0}; static const WCHAR AddInterface[] = {'A','d','d','I','n','t','e','r','f','a','c','e',0}; static const WCHAR backslashW[] = {'\\',0}; +static const WCHAR hashW[] = {'#',0}; static const WCHAR emptyW[] = {0}; #define SERVICE_CONTROL_REENUMERATE_ROOT_DEVICES 128 @@ -373,7 +374,6 @@ static WCHAR *get_iface_key_path(struct device_iface *iface) static WCHAR *get_refstr_key_path(struct device_iface *iface) { - static const WCHAR hashW[] = {'#',0}; static const WCHAR slashW[] = {'\\',0}; WCHAR *path, *ptr; size_t len = lstrlenW(DeviceClasses) + 1 + 38 + 1 + lstrlenW(iface->symlink) + 1 + 1; @@ -2479,6 +2479,80 @@ static void SETUPDI_EnumerateInterfaces(HDEVINFO DeviceInfoSet, } } + +/* iterate over all interfaces supported by this device instance. if any of + * them are "linked", return TRUE */ +static BOOL is_device_instance_linked(HKEY interfacesKey, const WCHAR *deviceInstance) +{ + LONG l; + DWORD class_idx = 0, device_idx, len, type; + HKEY class_key, device_key, link_key; + WCHAR class_keyname[40], device_keyname[MAX_DEVICE_ID_LEN]; + WCHAR interface_devinstance[MAX_DEVICE_ID_LEN]; + + while (1) + { + len = ARRAY_SIZE(class_keyname); + l = RegEnumKeyExW(interfacesKey, class_idx++, class_keyname, &len, NULL, NULL, NULL, NULL); + if (l) + break; + + l = RegOpenKeyExW(interfacesKey, class_keyname, 0, KEY_READ, &class_key); + if (l) + continue; + + device_idx = 0; + while (1) + { + len = ARRAY_SIZE(device_keyname); + l = RegEnumKeyExW(class_key, device_idx++, device_keyname, &len, NULL, NULL, NULL, NULL); + if (l) + break; + + l = RegOpenKeyExW(class_key, device_keyname, 0, KEY_READ, &device_key); + if (l) + continue; + + len = ARRAY_SIZE(interface_devinstance); + l = RegQueryValueExW(device_key, DeviceInstance, NULL, &type, (BYTE *)interface_devinstance, &len); + if (l || type != REG_SZ) + { + RegCloseKey(device_key); + continue; + } + + if (lstrcmpiW(interface_devinstance, deviceInstance)) + { + /* not our device instance */ + RegCloseKey(device_key); + continue; + } + + l = RegOpenKeyExW(device_key, hashW, 0, KEY_READ, &link_key); + if (l) + { + RegCloseKey(device_key); + continue; + } + + if (is_linked(link_key)) + { + RegCloseKey(link_key); + RegCloseKey(device_key); + RegCloseKey(class_key); + return TRUE; + } + + RegCloseKey(link_key); + RegCloseKey(device_key); + } + + RegCloseKey(class_key); + } + + return FALSE; +} + static void SETUPDI_EnumerateMatchingDeviceInstances(struct DeviceInfoSet *set, LPCWSTR enumerator, LPCWSTR deviceName, HKEY deviceKey, const GUID *class, DWORD flags) @@ -2487,6 +2561,7 @@ static void SETUPDI_EnumerateMatchingDeviceInstances(struct DeviceInfoSet *set, DWORD i, len; WCHAR deviceInstance[MAX_PATH]; LONG l = ERROR_SUCCESS; + HKEY interfacesKey = SetupDiOpenClassRegKeyExW(NULL, KEY_READ, DIOCR_INTERFACE, NULL, NULL); TRACE("%s %s\n", debugstr_w(enumerator), debugstr_w(deviceName)); @@ -2523,7 +2598,9 @@ static void SETUPDI_EnumerateMatchingDeviceInstances(struct DeviceInfoSet *set, {'%','s','\\','%','s','\\','%','s',0}; if (swprintf(id, ARRAY_SIZE(id), fmt, enumerator, - deviceName, deviceInstance) != -1) + deviceName, deviceInstance) != -1 && + (!(flags & DIGCF_PRESENT) || + is_device_instance_linked(interfacesKey, id))) { create_device(set, &deviceClass, id, FALSE); } @@ -2536,6 +2613,8 @@ static void SETUPDI_EnumerateMatchingDeviceInstances(struct DeviceInfoSet *set, l = ERROR_SUCCESS; } } + + RegCloseKey(interfacesKey); } static void SETUPDI_EnumerateMatchingDevices(HDEVINFO DeviceInfoSet, From 658d1b97f55e31980f831e2febe72c88ea7228c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 21 Oct 2024 17:30:19 +0200 Subject: [PATCH 0106/2542] setupapi: Implement SetupDiOpenDeviceInterface(A|W). CW-Bug-Id: #24378 --- dlls/setupapi/devinst.c | 66 ++++++++++++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 17 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index dd08cf70d22f..d369537e5099 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -3774,29 +3774,61 @@ BOOL WINAPI SetupDiOpenDeviceInfoW(HDEVINFO devinfo, PCWSTR instance_id, HWND hw /*********************************************************************** * SetupDiOpenDeviceInterfaceW (SETUPAPI.@) */ -BOOL WINAPI SetupDiOpenDeviceInterfaceW( - HDEVINFO DeviceInfoSet, - PCWSTR DevicePath, - DWORD OpenFlags, - PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData) -{ - FIXME("%p %s %08lx %p\n", - DeviceInfoSet, debugstr_w(DevicePath), OpenFlags, DeviceInterfaceData); +BOOL WINAPI SetupDiOpenDeviceInterfaceW(HDEVINFO devinfo, const WCHAR *device_path, + DWORD flags, SP_DEVICE_INTERFACE_DATA *iface_data) +{ + SP_DEVINFO_DATA device_data = {.cbSize = sizeof(device_data)}; + WCHAR instance_id[MAX_PATH], *tmp; + struct device_iface *iface; + struct device *device; + + TRACE("%p %s %#lx %p\n", devinfo, debugstr_w(device_path), flags, iface_data); + + if (flags) + FIXME("flags %#lx not implemented\n", flags); + + wcscpy(instance_id, device_path + 4); + if ((tmp = wcsrchr(instance_id, '#'))) *tmp = 0; + while ((tmp = wcschr(instance_id, '#'))) *tmp = '\\'; + + if (!SetupDiGetClassDevsExW(NULL, instance_id, NULL, DIGCF_DEVICEINTERFACE | DIGCF_PRESENT | DIGCF_ALLCLASSES, + devinfo, NULL, NULL)) + return FALSE; + if (!SetupDiOpenDeviceInfoW(devinfo, instance_id, NULL, 0, &device_data)) + return FALSE; + + if (!(device = get_device(devinfo, &device_data))) + return FALSE; + LIST_FOR_EACH_ENTRY(iface, &device->interfaces, struct device_iface, entry) + { + if (iface->symlink && !wcsicmp(device_path, iface->symlink)) + { + copy_device_iface_data(iface_data, iface); + return TRUE; + } + } + return FALSE; } /*********************************************************************** * SetupDiOpenDeviceInterfaceA (SETUPAPI.@) */ -BOOL WINAPI SetupDiOpenDeviceInterfaceA( - HDEVINFO DeviceInfoSet, - PCSTR DevicePath, - DWORD OpenFlags, - PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData) -{ - FIXME("%p %s %08lx %p\n", DeviceInfoSet, - debugstr_a(DevicePath), OpenFlags, DeviceInterfaceData); - return FALSE; +BOOL WINAPI SetupDiOpenDeviceInterfaceA(HDEVINFO devinfo, const char *device_path, + DWORD flags, SP_DEVICE_INTERFACE_DATA *iface_data) +{ + WCHAR device_pathW[MAX_PATH]; + + TRACE("%p %s %#lx %p\n", devinfo, debugstr_a(device_path), flags, iface_data); + + if (!device_path || strlen(device_path) >= MAX_PATH) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + MultiByteToWideChar(CP_ACP, 0, device_path, -1, device_pathW, ARRAY_SIZE(device_pathW)); + return SetupDiOpenDeviceInterfaceW(devinfo, device_pathW, flags, iface_data); } /*********************************************************************** From b45b668f0a6b2a155b0b0327570dab4f659955bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 5 Dec 2023 15:03:25 +0100 Subject: [PATCH 0107/2542] HACK: user32: Always call get_message request after waiting. Because with esync and fsync the wait happens on the client-side, so we need to make the request to do the server side effects. --- dlls/win32u/message.c | 4 +++- dlls/win32u/ntuser_private.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 2f1e14c82c8a..4d321b589bfb 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2770,7 +2770,7 @@ int peek_message( MSG *msg, const struct peek_message_filter *filter ) thread_info->client_info.msg_source = prev_source; wake_mask = filter->mask & (QS_SENDMESSAGE | QS_SMRESULT); - if (NtGetTickCount() - thread_info->last_getmsg_time < 3000 && /* avoid hung queue */ + if (!filter->waited && NtGetTickCount() - thread_info->last_getmsg_time < 3000 && /* avoid hung queue */ check_queue_bits( wake_mask, filter->mask, wake_mask | signal_bits, filter->mask | clear_bits, &wake_bits, &changed_bits )) res = STATUS_PENDING; @@ -2970,6 +2970,7 @@ int peek_message( MSG *msg, const struct peek_message_filter *filter ) .last = info.msg.message, .mask = filter->mask, .internal = filter->internal, + .waited = TRUE, }; peek_message( msg, &new_filter ); } @@ -3341,6 +3342,7 @@ BOOL WINAPI NtUserGetMessage( MSG *msg, HWND hwnd, UINT first, UINT last ) filter.mask = mask; filter.flags = PM_REMOVE | (mask << 16); + filter.waited = TRUE; while (!(ret = peek_message( msg, &filter ))) { wait_objects( 1, &server_queue, INFINITE, mask & (QS_SENDMESSAGE | QS_SMRESULT), mask, 0 ); diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h index 2f3bbdf91c0e..7c6861ab5542 100644 --- a/dlls/win32u/ntuser_private.h +++ b/dlls/win32u/ntuser_private.h @@ -215,6 +215,7 @@ struct peek_message_filter UINT mask; UINT flags; BOOL internal; + BOOL waited; }; extern int peek_message( MSG *msg, const struct peek_message_filter *filter ); From 4b7342236aedf9db88dcdebd251889262a93505f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 1 Mar 2021 20:19:52 +0100 Subject: [PATCH 0108/2542] HACK: user32: Always pretend that GetAsyncKeyState recent bit is 0. --- dlls/win32u/input.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index ae7aeba90f78..c6d463ffb468 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -811,7 +811,6 @@ SHORT WINAPI NtUserGetAsyncKeyState( INT key ) struct object_lock lock = OBJECT_LOCK_INIT; NTSTATUS status; BYTE state = 0; - SHORT ret = 0; if (key < 0 || key >= 256) return 0; @@ -821,22 +820,7 @@ SHORT WINAPI NtUserGetAsyncKeyState( INT key ) state = desktop_shm->keystate[key]; if (status) return 0; - if (!(state & 0x40)) return (state & 0x80) << 8; - - /* Need to make a server call to reset the last pressed bit */ - SERVER_START_REQ( get_key_state ) - { - req->async = 1; - req->key = key; - if (!wine_server_call( req )) - { - if (reply->state & 0x40) ret |= 0x0001; - if (reply->state & 0x80) ret |= 0x8000; - } - } - SERVER_END_REQ; - - return ret; + return (state & 0x80) << 8; } /*********************************************************************** From ff103b3500ad44ba15ffb4fc45146d1e7bc8a217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 27 Jan 2022 18:21:29 +0100 Subject: [PATCH 0109/2542] user32: Prevent a recursive loop with the activation messages. When activating a window and sending activation messages to the window procedure, Windows avoids a recursive loop by not sending more of these messages or hooks while it's still activating the window. CW-Bug-Id: #19612 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46274 Wine-Staging: user32-recursive-activation --- dlls/win32u/input.c | 16 +++++++++++----- dlls/win32u/ntuser_private.h | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index c6d463ffb468..7490ddb6fa43 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -1899,7 +1899,7 @@ static HWND set_focus_window( HWND hwnd ) BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new_active_thread_id ) { HWND previous = get_active_window(); - BOOL ret; + BOOL ret = FALSE; DWORD old_thread, new_thread; CBTACTIVATESTRUCT cbt; @@ -1909,6 +1909,9 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new goto done; } + if (prev) *prev = previous; + if (win_set_flags( hwnd, WIN_IS_ACTIVATING, 0 ) & WIN_IS_ACTIVATING) return TRUE; + /* call CBT hook chain */ cbt.fMouse = mouse; cbt.hWndActive = previous; @@ -1928,7 +1931,7 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new previous = wine_server_ptr_handle( reply->previous ); } SERVER_END_REQ; - if (!ret) return FALSE; + if (!ret) goto done; if (prev) *prev = previous; if (previous == hwnd) goto done; @@ -1940,7 +1943,7 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new if (send_message( hwnd, WM_QUERYNEWPALETTE, 0, 0 )) send_message_timeout( HWND_BROADCAST, WM_PALETTEISCHANGING, (WPARAM)hwnd, 0, SMTO_ABORTIFHUNG, 2000, FALSE ); - if (!is_window(hwnd)) return FALSE; + if (!(ret = is_window(hwnd))) goto done; } old_thread = previous ? get_window_thread( previous, NULL ) : 0; @@ -1975,7 +1978,9 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new if (is_window(hwnd)) { - send_message( hwnd, WM_NCACTIVATE, hwnd == NtUserGetForegroundWindow(), (LPARAM)previous ); + send_message( hwnd, WM_NCACTIVATE, + (hwnd == NtUserGetForegroundWindow()) && !(win_get_flags(previous) & WIN_IS_ACTIVATING), + (LPARAM)previous ); send_message( hwnd, WM_ACTIVATE, MAKEWPARAM( mouse ? WA_CLICKACTIVE : WA_ACTIVE, is_iconic(hwnd) ), (LPARAM)previous ); @@ -1999,8 +2004,9 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new } done: + win_set_flags( hwnd, 0, WIN_IS_ACTIVATING ); if (hwnd) clip_fullscreen_window( hwnd, FALSE ); - return TRUE; + return ret; } /********************************************************************** diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h index 7c6861ab5542..5b2a40e8d741 100644 --- a/dlls/win32u/ntuser_private.h +++ b/dlls/win32u/ntuser_private.h @@ -92,6 +92,7 @@ typedef struct tagWND #define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0020 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */ #define WIN_CHILDREN_MOVED 0x0040 /* children may have moved, ignore stored positions */ #define WIN_HAS_IME_WIN 0x0080 /* the window has been registered with imm32 */ +#define WIN_IS_ACTIVATING 0x0100 /* the window is being activated */ #define WND_OTHER_PROCESS ((WND *)1) /* returned by get_win_ptr on unknown window handles */ #define WND_DESKTOP ((WND *)2) /* returned by get_win_ptr on the desktop window */ From fcbab0781b274cb3447e94cd48a3f9aadb9f6eca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 3 Dec 2024 18:28:55 +0100 Subject: [PATCH 0110/2542] user32: Use PostMessageW in set_foreground_window. Instead of SendNotifyMessageW for WM_WINE_SETACTIVEWINDOW. CW-Bug-Id: #19612 --- dlls/win32u/input.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 7490ddb6fa43..530aa48b1609 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2124,14 +2124,12 @@ BOOL set_foreground_window( HWND hwnd, BOOL mouse ) if (ret && previous != hwnd) { if (send_msg_old) /* old window belongs to other thread */ - NtUserMessageCall( previous, WM_WINE_SETACTIVEWINDOW, 0, new_thread_id, - 0, NtUserSendNotifyMessage, FALSE ); + NtUserPostMessage( previous, WM_WINE_SETACTIVEWINDOW, 0, new_thread_id ); else if (send_msg_new) /* old window belongs to us but new one to other thread */ ret = set_active_window( 0, NULL, mouse, TRUE, new_thread_id ); if (send_msg_new) /* new window belongs to other thread */ - NtUserMessageCall( hwnd, WM_WINE_SETACTIVEWINDOW, (WPARAM)hwnd, 0, - 0, NtUserSendNotifyMessage, FALSE ); + NtUserPostMessage( hwnd, WM_WINE_SETACTIVEWINDOW, (WPARAM)hwnd, 0 ); else /* new window belongs to us */ ret = set_active_window( hwnd, NULL, mouse, TRUE, 0 ); } From dcf770478caffbe7bb46410039cab9e41a90e535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 27 Jan 2022 18:24:02 +0100 Subject: [PATCH 0111/2542] user32: Do not deactivate if thread is foreground. Instead of only checking that the window is foreground. CW-Bug-Id: #19612 --- dlls/win32u/message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 4d321b589bfb..97339666aefa 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2101,7 +2101,7 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR { HWND prev; - if (!wparam && NtUserGetForegroundWindow() == hwnd) return 0; + if (!wparam && NtUserGetWindowThread( NtUserGetForegroundWindow(), NULL ) == GetCurrentThreadId()) return 0; if (!set_active_window( (HWND)wparam, &prev, FALSE, TRUE, lparam )) return 0; return (LRESULT)prev; } From 782cc86761af591f9aca8cdb4ece47505e48910e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 27 Jan 2022 18:24:57 +0100 Subject: [PATCH 0112/2542] user32: Send WM_NCACTIVATE on SetForegroundWindow call. When window is already active but has lost foreground, as shown by concurrent SetForegroundWindow tests. CW-Bug-Id: #19612 --- dlls/win32u/input.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 530aa48b1609..58b234072cca 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2128,6 +2128,10 @@ BOOL set_foreground_window( HWND hwnd, BOOL mouse ) else if (send_msg_new) /* old window belongs to us but new one to other thread */ ret = set_active_window( 0, NULL, mouse, TRUE, new_thread_id ); + /* already active, set_active_window will do no nothing */ + if (!send_msg_new && hwnd == get_active_window()) + send_message( hwnd, WM_NCACTIVATE, TRUE, (LPARAM)hwnd ); + if (send_msg_new) /* new window belongs to other thread */ NtUserPostMessage( hwnd, WM_WINE_SETACTIVEWINDOW, (WPARAM)hwnd, 0 ); else /* new window belongs to us */ From 460f8784167ed23a80b260ea4b3a2893790ef37d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 27 Jan 2022 18:25:44 +0100 Subject: [PATCH 0113/2542] user32: Send WM_*FOCUS messages even if already focused. CW-Bug-Id: #19612 --- dlls/win32u/input.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 58b234072cca..1bea3e0307c4 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -1851,7 +1851,7 @@ BOOL release_capture(void) * * Change the focus window, sending the WM_SETFOCUS and WM_KILLFOCUS messages */ -static HWND set_focus_window( HWND hwnd ) +static HWND set_focus_window( HWND hwnd, BOOL force ) { HWND previous = 0, ime_hwnd; BOOL ret; @@ -1865,6 +1865,7 @@ static HWND set_focus_window( HWND hwnd ) SERVER_END_REQ; if (!ret) return 0; if (previous == hwnd) return previous; + if (!force && hwnd == previous) return previous; if (previous) { @@ -1999,7 +2000,7 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new if (hwnd == info.hwndActive) { if (!info.hwndFocus || !hwnd || NtUserGetAncestor( info.hwndFocus, GA_ROOT ) != hwnd) - set_focus_window( hwnd ); + set_focus_window( hwnd, FALSE ); } } @@ -2094,7 +2095,7 @@ HWND WINAPI NtUserSetFocus( HWND hwnd ) } /* change focus and send messages */ - return set_focus_window( hwnd ); + return set_focus_window( hwnd, hwnd != previous ); } /******************************************************************* From ee4caa1ab77e9bc4b5558bdb548f80b137c2184d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 27 Jan 2022 18:26:41 +0100 Subject: [PATCH 0114/2542] server: Drop pending internal messages in set_active_window. When changing the active window in the foreground thread. CW-Bug-Id: #19612 --- dlls/win32u/input.c | 1 + server/protocol.def | 1 + server/queue.c | 13 +++++++++++++ 3 files changed, 15 insertions(+) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 1bea3e0307c4..011b407f38f9 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -1928,6 +1928,7 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new SERVER_START_REQ( set_active_window ) { req->handle = wine_server_user_handle( hwnd ); + req->internal_msg = WM_WINE_SETACTIVEWINDOW; if ((ret = !wine_server_call_err( req ))) previous = wine_server_ptr_handle( reply->previous ); } diff --git a/server/protocol.def b/server/protocol.def index 292303c385fc..73b1ecec24f6 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -3067,6 +3067,7 @@ enum coords_relative /* Set the current thread active window */ @REQ(set_active_window) user_handle_t handle; /* handle to the active window */ + unsigned int internal_msg; /* set active window internal message */ @REPLY user_handle_t previous; /* handle to the previous active window */ @END diff --git a/server/queue.c b/server/queue.c index 76a82dcf7123..72586b9677e6 100644 --- a/server/queue.c +++ b/server/queue.c @@ -3844,7 +3844,11 @@ DECL_HANDLER(set_focus_window) /* set the current thread active window */ DECL_HANDLER(set_active_window) { + struct message *msg, *next; struct msg_queue *queue = get_current_queue(); + struct desktop *desktop; + + if (!(desktop = get_thread_desktop( current, 0 ))) return; reply->previous = 0; if (queue && check_queue_input_window( queue, req->handle )) @@ -3852,15 +3856,24 @@ DECL_HANDLER(set_active_window) if (!req->handle || make_window_active( req->handle )) { const input_shm_t *input_shm = queue->input->shared; + SHARED_WRITE_BEGIN( input_shm, input_shm_t ) { reply->previous = shared->active; shared->active = get_user_full_handle( req->handle ); } SHARED_WRITE_END; + + if (desktop->foreground_input == queue->input && req->handle != reply->previous) + { + LIST_FOR_EACH_ENTRY_SAFE( msg, next, &queue->msg_list[POST_MESSAGE], struct message, entry ) + if (msg->msg == req->internal_msg) remove_queue_message( queue, msg, POST_MESSAGE ); + } } else set_error( STATUS_INVALID_HANDLE ); } + + release_object( desktop ); } From 0c7d6c0265010f90e285647157fe62cc44bb513e Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Thu, 30 Jan 2020 14:44:00 -0600 Subject: [PATCH 0115/2542] HACK: gamescope: user32: On steamcompmgr, don't limit window size to screen size HACK: user32: Don't resize new windows to fit the display. --- dlls/win32u/defwnd.c | 12 ++++++++++-- dlls/win32u/window.c | 14 ++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index a1b6d1d9f0ad..bd1416230f6f 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -477,8 +477,16 @@ static LONG handle_window_pos_changing( HWND hwnd, WINDOWPOS *winpos ) if ((style & WS_THICKFRAME) || ((style & (WS_POPUP | WS_CHILD)) == 0)) { MINMAXINFO info = get_min_max_info( hwnd ); - winpos->cx = min( winpos->cx, info.ptMaxTrackSize.x ); - winpos->cy = min( winpos->cy, info.ptMaxTrackSize.y ); + + /* HACK: This code changes the window's size to fit the display. However, + * some games (Bayonetta, Dragon's Dogma) will then have the incorrect + * render size. So just let windows be too big to fit the display. */ + if (!user_driver->pHasWindowManager( "steamcompmgr" )) + { + winpos->cx = min( winpos->cx, info.ptMaxTrackSize.x ); + winpos->cy = min( winpos->cy, info.ptMaxTrackSize.y ); + } + if (!(style & WS_MINIMIZE)) { winpos->cx = max( winpos->cx, info.ptMinTrackSize.x ); diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index ba204957669b..ac2b50f6a7bb 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -5633,8 +5633,18 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, if ((cs.style & WS_THICKFRAME) || !(cs.style & (WS_POPUP | WS_CHILD))) { MINMAXINFO info = get_min_max_info( hwnd ); - cx = max( min( cx, info.ptMaxTrackSize.x ), info.ptMinTrackSize.x ); - cy = max( min( cy, info.ptMaxTrackSize.y ), info.ptMinTrackSize.y ); + + /* HACK: This code changes the window's size to fit the display. However, + * some games (Bayonetta, Dragon's Dogma) will then have the incorrect + * render size. So just let windows be too big to fit the display. */ + if (!user_driver->pHasWindowManager( "steamcompmgr" )) + { + cx = min( cx, info.ptMaxTrackSize.x ); + cy = min( cy, info.ptMaxTrackSize.y ); + } + + cx = max( cx, info.ptMinTrackSize.x ); + cy = max( cy, info.ptMinTrackSize.y ); } if (cx < 0) cx = 0; From 536ac1a0158701dbc7adeabc98f66b24f3ff901e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 16 Mar 2020 19:52:52 +0100 Subject: [PATCH 0116/2542] HACK: gamescope: user32: Pretend that windows are undecorated with gamescope. The original commit made all window have their client rect always match their window rects. This was to make sure games always use the full available window size, even when windowed, and end up with an optimal rendering area. Some games, such as Bayonetta or Dragon's Dogma: Dark Arisen, ask for an optimal window size, but, when in windowed mode, the client rect is then adjusted to add a title bar and borders. On Windows, the back buffer is always the requested size, but the rendering is then scaled to match the client rect. With Proton and gamescope, we want to avoid this suboptimal scaling, and make sure both front and back buffer are optimally sized, including when in windowed mode. Then, we still need to keep adjustments on WS_POPUP / WS_EX_TOOLWINDOW windows: This styles usually translates into a single pixel border, and is used for splash screens. Several of them do not expect their client rect to be sized as the window rect and it causes a visible 1px white border on the bottom and the right of the window. WS_EX_TOOLWINDOW should be safe enough, as it means the window is not supposed to be displayed in the taskbar or in the alt-tab menu, which is unlikely for an actual game window. WS_POPUP otoh means that only a 1px border is used, which should not make much of a difference with an undecorated window (although it could cause suboptimal client rect sizes, which we wanted to solve in the first place). CW-Bug-Id: #17639 CW-Bug-Id: #20038 --- dlls/user32/nonclient.c | 1 + dlls/win32u/defwnd.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c index d65e7c9864c9..5e5d7ddd18ed 100644 --- a/dlls/user32/nonclient.c +++ b/dlls/user32/nonclient.c @@ -21,6 +21,7 @@ #include "user_private.h" #include "controls.h" #include "wine/debug.h" +#include "ntuser.h" #define SC_ABOUTWINE (SC_SCREENSAVE+1) diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index bd1416230f6f..b1830b71a527 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -256,6 +256,8 @@ BOOL adjust_window_rect( RECT *rect, DWORD style, BOOL menu, DWORD ex_style, UIN NONCLIENTMETRICSW ncm = {.cbSize = sizeof(ncm)}; int adjust = 0; + if (user_driver->pHasWindowManager( "steamcompmgr" ) && !((style & WS_POPUP) && (ex_style & WS_EX_TOOLWINDOW))) return TRUE; + NtUserSystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0, dpi ); if ((ex_style & (WS_EX_STATICEDGE|WS_EX_DLGMODALFRAME)) == WS_EX_STATICEDGE) @@ -1863,6 +1865,9 @@ static void handle_nc_calc_size( HWND hwnd, WPARAM wparam, RECT *win_rect ) if (!win_rect) return; + if (user_driver->pHasWindowManager( "steamcompmgr" ) && !((style & WS_POPUP) && (ex_style & WS_EX_TOOLWINDOW))) + return; + if (!(style & WS_MINIMIZE)) { adjust_window_rect( &rect, style, FALSE, ex_style & ~WS_EX_CLIENTEDGE, get_system_dpi() ); From 582cf8c39053d914f149741e0d38a817c253061c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 28 May 2021 17:41:43 +0200 Subject: [PATCH 0117/2542] HACK: gamescope: winex11.drv: Disable gamescope hacks for Street Fighter V. CW-Bug-Id: #18903 --- dlls/winex11.drv/window.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 950401c0b1ea..29fd1cbe4f3b 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -3503,8 +3503,19 @@ void net_supporting_wm_check_init( struct x11drv_thread_data *data ) else if (get_window_net_wm_name( data->display, window, &data->window_manager ) || get_window_wm_name( data->display, window, &data->window_manager )) { + char const *sgi = getenv( "SteamGameId" ); + if (!strcmp( data->window_manager, "GNOME Shell" )) strcpy( data->window_manager, "Mutter" ); TRACE( "Detected window manager: %s\n", debugstr_a(data->window_manager) ); + + /* Street Fighter V expects a certain sequence of window resizes + or gets stuck on startup. The AdjustWindowRect / WM_NCCALCSIZE + hacks confuse it completely, so let's disable them */ + if (sgi && !strcmp(sgi, "310950")) + { + XFree( data->window_manager ); + data->window_manager = NULL; + } } } From 9efd33978d467263ef53eef63161b2797b394593 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Fri, 11 Jan 2019 11:31:13 -0600 Subject: [PATCH 0118/2542] winex11.drv: Don't show border if WS_CAPTION is unset. Into the Breach wants a borderless window with WS_THICKFRAME. If we leave the BORDER and RESIZEH styles on, then we get a window with a border and a caption on Linux. --- dlls/winex11.drv/window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 29fd1cbe4f3b..dfc3639bb64d 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -445,9 +445,10 @@ static unsigned long get_mwm_decorations_for_style( DWORD style, DWORD ex_style if (style & WS_SYSMENU) ret |= MWM_DECOR_MENU; if (style & WS_MINIMIZEBOX) ret |= MWM_DECOR_MINIMIZE; if (style & WS_MAXIMIZEBOX) ret |= MWM_DECOR_MAXIMIZE; + if (style & WS_THICKFRAME) ret |= MWM_DECOR_RESIZEH; } if (ex_style & WS_EX_DLGMODALFRAME) ret |= MWM_DECOR_BORDER; - else if (style & WS_THICKFRAME) ret |= MWM_DECOR_BORDER | MWM_DECOR_RESIZEH; + else if (style & WS_THICKFRAME) return ret; else if ((style & (WS_DLGFRAME|WS_BORDER)) == WS_DLGFRAME) ret |= MWM_DECOR_BORDER; return ret; } From a357bc610c879a79aa33329c1f732ff21b608681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 7 Mar 2022 16:53:09 +0100 Subject: [PATCH 0119/2542] winex11.drv: Call SetForegroundWindow instead of SetActiveWindow on restore. So that the window is both active and foreground before we send the SC_RESTORE command. Project Cars 3 expects that as it tries to reacquire DInput devices on SC_RESTORE. CW-Bug-Id: #19011 CW-Bug-Id: #20227 --- dlls/win32u/message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 97339666aefa..50c3406b5ff5 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2134,7 +2134,7 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR if (!user_driver->pGetWindowStateUpdates( hwnd, &state_cmd, &config_cmd, &window_rect )) return 0; if (state_cmd) { - if (LOWORD(state_cmd) == SC_RESTORE && HIWORD(state_cmd)) NtUserSetActiveWindow( hwnd ); + if (LOWORD(state_cmd) == SC_RESTORE && HIWORD(state_cmd)) NtUserSetForegroundWindow( hwnd ); send_message( hwnd, WM_SYSCOMMAND, LOWORD(state_cmd), 0 ); /* state change might have changed the window config already, check again */ From 477d8f7e1e1a084fba85a4af549968481b7d462f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 23 Nov 2021 10:54:06 +0100 Subject: [PATCH 0120/2542] HACK: proton: winex11.drv: Track GAMESCOPE_FOCUSED_APP property changes. CW-Bug-Id: #19673 CW-Bug-Id: #19991 --- dlls/winex11.drv/event.c | 33 +++++++++++++++++++++++++++++++++ dlls/winex11.drv/x11drv.h | 1 + dlls/winex11.drv/x11drv_main.c | 3 ++- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index c7dde3e75c0d..8ffe588ce602 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1275,6 +1275,37 @@ static void handle_net_supporting_wm_check_notify( XPropertyEvent *event ) if (event->state == PropertyNewValue) net_supporting_wm_check_init( data ); } +static int handle_gamescope_focused_app_error( Display *dpy, XErrorEvent *event, void *arg ) +{ + WARN( "Failed to read GAMESCOPE_FOCUSED_APP property, ignoring.\n" ); + return 1; +} + +static void handle_gamescope_focused_app( XPropertyEvent *event ) +{ + static const char *sgi = NULL; + + unsigned long count, remaining, *property; + int format, app_id, focused_app_id; + Atom type; + + if (!sgi && !(sgi = getenv( "SteamGameId" ))) return; + app_id = atoi( sgi ); + + X11DRV_expect_error( event->display, handle_gamescope_focused_app_error, NULL ); + XGetWindowProperty( event->display, DefaultRootWindow( event->display ), x11drv_atom( GAMESCOPE_FOCUSED_APP ), + 0, ~0UL, False, XA_CARDINAL, &type, &format, &count, &remaining, (unsigned char **)&property ); + if (X11DRV_check_error()) focused_app_id = app_id; + else + { + if (!property) focused_app_id = app_id; + else focused_app_id = *property; + XFree( property ); + } + + TRACE( "Got app id %u, focused app %u\n", app_id, focused_app_id ); +} + /*********************************************************************** * X11DRV_PropertyNotify */ @@ -1282,6 +1313,8 @@ static BOOL X11DRV_PropertyNotify( HWND hwnd, XEvent *xev ) { XPropertyEvent *event = &xev->xproperty; + if (event->atom == x11drv_atom(GAMESCOPE_FOCUSED_APP)) handle_gamescope_focused_app( event ); + if (!hwnd) return FALSE; if (event->atom == x11drv_atom(WM_STATE)) handle_wm_state_notify( hwnd, event ); if (event->atom == x11drv_atom(_XEMBED_INFO)) handle_xembed_info_notify( hwnd, event ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 64cbc101ca27..762fc8c15d91 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -551,6 +551,7 @@ enum x11drv_atoms XATOM_text_rtf, XATOM_text_richtext, XATOM_text_uri_list, + XATOM_GAMESCOPE_FOCUSED_APP, NB_XATOMS }; diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 7e03c31c6d2f..ba02687ea055 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -190,7 +190,8 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "text/plain", "text/rtf", "text/richtext", - "text/uri-list" + "text/uri-list", + "GAMESCOPE_FOCUSED_APP" }; /*********************************************************************** From 3b7769fc4fe1830c84d6d6ab9e9e0311e09d7fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 17 Dec 2020 18:47:44 +0100 Subject: [PATCH 0121/2542] HACK: proton: winex11.drv: Check Steam overlay presence and drop events when enabled. Squashed with: winex11.drv: Don't allow querying pointer while overlay is active. HACK: gamescope: winex11.drv: Ignore mouse events when Steam Keyboard is opened. Using a global __wine_steamclient_KeyboardActivated event. We need to keep keyboard events though as it's how the OSK will communicate its input. CW-Bug-Id: #19673 winex11.drv: Don't fail GetCursorPos() from X11DRV_GetCursorPos() when Steam overlay is active. CW-Bug-Id: #20732 HACK: gamescope: winex11.drv: Turn OSK input filtering messages to FIXME. --- dlls/winex11.drv/event.c | 8 +++++++- dlls/winex11.drv/mouse.c | 3 +++ dlls/winex11.drv/x11drv.h | 1 + dlls/winex11.drv/x11drv_main.c | 14 ++++++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 8ffe588ce602..27c65e284233 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -472,13 +472,19 @@ static BOOL process_events( Display *display, Bool (*filter)(Display*, XEvent*,X { XEvent event, prev_event; int count = 0; - BOOL queued = FALSE; + BOOL queued = FALSE, overlay_enabled = FALSE; enum event_merge_action action = MERGE_DISCARD; + ULONG_PTR overlay_filter = QS_KEY | QS_MOUSEBUTTON | QS_MOUSEMOVE; + LARGE_INTEGER timeout = {0}; + + if (NtWaitForSingleObject(steam_overlay_event, FALSE, &timeout) == WAIT_OBJECT_0) + overlay_enabled = TRUE; prev_event.type = 0; while (XCheckIfEvent( display, &event, filter, (char *)arg )) { count++; + if (overlay_enabled && filter_event( display, &event, (char *)overlay_filter )) continue; if (XFilterEvent( &event, None )) { /* diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 9d25b71c9927..6fc7031e1819 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -1418,11 +1418,14 @@ BOOL X11DRV_SetCursorPos( INT x, INT y ) BOOL X11DRV_GetCursorPos(LPPOINT pos) { Display *display = thread_init_display(); + LARGE_INTEGER timeout = {0}; Window root, child; int rootX, rootY, winX, winY; unsigned int xstate; BOOL ret; + if (NtWaitForSingleObject(steam_overlay_event, FALSE, &timeout) == WAIT_OBJECT_0) return TRUE; + ret = XQueryPointer( display, root_window, &root, &child, &rootX, &rootY, &winX, &winY, &xstate ); if (ret) { diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 762fc8c15d91..fd9ace3e5f96 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -457,6 +457,7 @@ extern int alloc_system_colors; extern int xrender_error_base; extern char *process_name; extern Display *clipboard_display; +extern HANDLE steam_overlay_event; /* atoms */ diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index ba02687ea055..86b1f2132692 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -82,6 +82,7 @@ int copy_default_colors = 128; int alloc_system_colors = 256; int xrender_error_base = 0; char *process_name = NULL; +HANDLE steam_overlay_event; static x11drv_error_callback err_callback; /* current callback for error */ static Display *err_callback_display; /* display callback is set for */ @@ -622,6 +623,19 @@ static NTSTATUS x11drv_init( void *arg ) { Display *display; void *libx11 = dlopen( SONAME_LIBX11, RTLD_NOW|RTLD_GLOBAL ); + OBJECT_ATTRIBUTES attr; + WCHAR buffer[MAX_PATH]; + char path[MAX_PATH]; + UNICODE_STRING str; + + RtlInitUnicodeString( &str, buffer ); + InitializeObjectAttributes( &attr, &str, OBJ_CASE_INSENSITIVE | OBJ_OPENIF, 0, NULL ); + + str.Length = sprintf( path, "\\Sessions\\%u\\BaseNamedObjects\\__wine_steamclient_GameOverlayActivated", + (int)NtCurrentTeb()->Peb->SessionId ); + ascii_to_unicode( buffer, path, str.Length + 1 ); + str.Length *= sizeof(WCHAR); + NtCreateEvent( &steam_overlay_event, EVENT_ALL_ACCESS, &attr, NotificationEvent, FALSE ); if (!libx11) { From 2c94da3625a3fe5a1012bb3f720051882859c366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 18 May 2022 20:12:41 +0200 Subject: [PATCH 0122/2542] HACK: proton: winex11.drv: Expose GWL_STYLE and GWL_EXSTYLE as X11 properties. As _WINE_HWND_STYLE and _WINE_HWND_EXSTYLE respectively. CW-Bug-Id: #20663 --- dlls/winex11.drv/window.c | 4 ++++ dlls/winex11.drv/x11drv.h | 2 ++ dlls/winex11.drv/x11drv_main.c | 2 ++ 3 files changed, 8 insertions(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index dfc3639bb64d..7b38f7b5674c 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -996,6 +996,10 @@ static void set_style_hints( struct x11drv_win_data *data, DWORD style, DWORD ex else XDeleteProperty( data->display, data->whole_window, x11drv_atom(_NET_WM_ICON) ); + XChangeProperty( data->display, data->whole_window, x11drv_atom(_WINE_HWND_STYLE), XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)&style, sizeof(style) / 4 ); + XChangeProperty( data->display, data->whole_window, x11drv_atom(_WINE_HWND_EXSTYLE), XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)&ex_style, sizeof(ex_style) / 4 ); } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index fd9ace3e5f96..85d196640404 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -520,6 +520,8 @@ enum x11drv_atoms XATOM__GTK_WORKAREAS_D0, XATOM__XEMBED, XATOM__XEMBED_INFO, + XATOM__WINE_HWND_STYLE, + XATOM__WINE_HWND_EXSTYLE, XATOM_XdndAware, XATOM_XdndEnter, XATOM_XdndPosition, diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 86b1f2132692..96ebca46c729 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -160,6 +160,8 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "_GTK_WORKAREAS_D0", "_XEMBED", "_XEMBED_INFO", + "_WINE_HWND_STYLE", + "_WINE_HWND_EXSTYLE", "XdndAware", "XdndEnter", "XdndPosition", From b2cdeaa801173f4c984b730d978618bb60cd706a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 14 Dec 2022 21:21:50 +0100 Subject: [PATCH 0123/2542] HACK: winex11.drv: Workaround focusing out of exclusive fullscreen windows. This retargets some old window manager workarounds which don't seem to be required anymore for the original issues but is still necessary to be able to focus out of exclusive fullscreen windows. Original commits were: commit e35f70c300b8f59e1d45e7c9d7b3b93d55741955 Author: Andrew Eikum Date: Tue Sep 18 08:11:59 2018 -0500 winex11: Don't set ABOVE on minimized fullscreened windows This is a workaround for mutter bug #306. commit 41022f9151475da15ec64a2ac64fd4830253e3f5 Author: Andrew Eikum Date: Mon Jun 1 09:18:35 2020 -0500 winex11.drv: Don't set ABOVE for fullscreen windows on KDE --- dlls/winex11.drv/window.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 7b38f7b5674c..936d9b51e17a 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1386,7 +1386,15 @@ static void update_net_wm_states( struct x11drv_win_data *data ) new_state |= (1 << NET_WM_STATE_MAXIMIZED); ex_style = NtUserGetWindowLongW( data->hwnd, GWL_EXSTYLE ); - if (ex_style & WS_EX_TOPMOST) + if ((ex_style & WS_EX_TOPMOST) && + /* This workaround was initially targetting some mutter and KDE issues, but + * removing it causes failure to focus out from exclusive fullscreen windows. + * + * Many games do not have any specific logic to get out of exclusive fullscreen + * mode, and we have currently no way to tell exclusive fullscreen from a window + * with topmost + fullscreen styles, so we cannot properly implement it either. + */ + !(new_state & (1 << NET_WM_STATE_FULLSCREEN))) new_state |= (1 << NET_WM_STATE_ABOVE); if (!data->add_taskbar) { From 407a8e412e62bbd3e7e6cfc47be7fdc557713999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 20 Apr 2021 11:08:53 +0200 Subject: [PATCH 0124/2542] HACK: user32: Disable layered windows support for Zombie Army 4. CW-Bug-Id: 18691 --- dlls/win32u/window.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index ac2b50f6a7bb..e858e262f8d1 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1217,6 +1217,8 @@ static HWND set_window_owner( HWND hwnd, HWND owner ) /* Helper function for SetWindowLong(). */ LONG_PTR set_window_long( HWND hwnd, INT offset, UINT size, LONG_PTR newval, BOOL ansi ) { + const char *sgi = getenv( "SteamGameId" ); + BOOL ok, made_visible = FALSE, layered = FALSE; LONG_PTR retval = 0; STYLESTRUCT style; @@ -1272,6 +1274,8 @@ LONG_PTR set_window_long( HWND hwnd, INT offset, UINT size, LONG_PTR newval, BOO if (win->dwStyle & WS_MINIMIZE) newval |= WS_MINIMIZE; break; case GWL_EXSTYLE: + /* FIXME: Layered windows don't work well right now, disable them */ + if (sgi && !strcmp( sgi, "694280" )) newval &= ~WS_EX_LAYERED; style.styleOld = win->dwExStyle; style.styleNew = newval; release_win_ptr( win ); From fdf1ee59375640c49c31387b49e911e29b42d125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 20 Apr 2021 19:37:22 +0200 Subject: [PATCH 0125/2542] HACK: user32: Disable layered windows for Strange Brigade. CW-Bug-Id: 18691 --- dlls/win32u/window.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index e858e262f8d1..ea728d7f8b74 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1276,6 +1276,7 @@ LONG_PTR set_window_long( HWND hwnd, INT offset, UINT size, LONG_PTR newval, BOO case GWL_EXSTYLE: /* FIXME: Layered windows don't work well right now, disable them */ if (sgi && !strcmp( sgi, "694280" )) newval &= ~WS_EX_LAYERED; + if (sgi && !strcmp( sgi, "312670" )) newval &= ~WS_EX_LAYERED; style.styleOld = win->dwExStyle; style.styleNew = newval; release_win_ptr( win ); From c4ca399e05c95e5a0f25a0b15d842fcb707f8c88 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Wed, 28 Apr 2021 14:32:04 -0500 Subject: [PATCH 0126/2542] HACK: user32: Disable layered windows for Evil Genius 2. CW-Bug-Id: 18691 --- dlls/win32u/window.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index ea728d7f8b74..7e2d2fc3c969 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1277,6 +1277,7 @@ LONG_PTR set_window_long( HWND hwnd, INT offset, UINT size, LONG_PTR newval, BOO /* FIXME: Layered windows don't work well right now, disable them */ if (sgi && !strcmp( sgi, "694280" )) newval &= ~WS_EX_LAYERED; if (sgi && !strcmp( sgi, "312670" )) newval &= ~WS_EX_LAYERED; + if (sgi && !strcmp( sgi, "700600" )) newval &= ~WS_EX_LAYERED; style.styleOld = win->dwExStyle; style.styleNew = newval; release_win_ptr( win ); From 8a381a80b270fc1b58d8c55242b9ceed00bec075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 16 Nov 2021 21:41:28 +0100 Subject: [PATCH 0127/2542] HACK: mscoree: Build a dummy CameraQuakeViewer.dll for Nights of Azure. The game references types from a non-existing DLL, and Mono cannot be taught to handle it easily. This is an ugly hack to make sure the load succeeds. CW-Bug-Id: #19046 --- dlls/mscoree/metahost.c | 62 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/dlls/mscoree/metahost.c b/dlls/mscoree/metahost.c index e1dd00656e94..07f245c64b03 100644 --- a/dlls/mscoree/metahost.c +++ b/dlls/mscoree/metahost.c @@ -1730,6 +1730,44 @@ static MonoAssembly* mono_assembly_try_load(WCHAR *path) return result; } +static BOOL compile_assembly(const char *source, const char *target, char *target_path, DWORD target_path_len) +{ + static const char *csc = "C:\\windows\\Microsoft.NET\\Framework\\v2.0.50727\\csc.exe"; + char cmdline[2 * MAX_PATH + 74], tmp[MAX_PATH], tmpdir[MAX_PATH], source_path[MAX_PATH]; + STARTUPINFOA si = {.cb = sizeof(STARTUPINFOA)}; + PROCESS_INFORMATION pi; + HANDLE file; + DWORD size; + BOOL ret; + LUID id; + + if (!PathFileExistsA(csc)) return FALSE; + if (!AllocateLocallyUniqueId(&id)) return FALSE; + + GetTempPathA(MAX_PATH, tmp); + if (!GetTempFileNameA(tmp, "assembly", id.LowPart, tmpdir)) return FALSE; + if (!CreateDirectoryA(tmpdir, NULL) && GetLastError() != ERROR_ALREADY_EXISTS) return FALSE; + + snprintf(source_path, MAX_PATH, "%s\\source.cs", tmpdir); + snprintf(target_path, target_path_len, "%s\\%s", tmpdir, target); + + file = CreateFileA(source_path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); + if (file == INVALID_HANDLE_VALUE) return FALSE; + ret = WriteFile(file, source, strlen(source), &size, NULL); + CloseHandle(file); + if (!ret) return FALSE; + + snprintf(cmdline, ARRAY_SIZE(cmdline), "%s /t:library /out:\"%s\" \"%s\"", csc, target_path, source_path); + ret = CreateProcessA(csc, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + if (!ret) return FALSE; + + WaitForSingleObject(pi.hProcess, INFINITE); + CloseHandle(pi.hThread); + CloseHandle(pi.hProcess); + + return PathFileExistsA(target_path); +} + static MonoAssembly* CDECL mono_assembly_preload_hook_fn(MonoAssemblyName *aname, char **assemblies_path, void *user_data) { int flags = 0; @@ -1818,6 +1856,30 @@ static MonoAssembly* CDECL wine_mono_assembly_preload_hook_v2_fn(MonoAssemblyNam } } + if (!strcmp(assemblyname, "CameraQuakeViewer")) + { + /* HACK for Nights of Azure which references type from a non-existing DLL. + * Native .NET framework normally gets away with it but Mono cannot + * due to some deeply rooted differences. */ + const char* sgi = getenv("SteamGameId"); + if (sgi && !strcmp(sgi, "527280")) + { + char assembly_path[MAX_PATH]; + + FIXME("HACK: Building CameraQuakeViewer.dll\n"); + + if (compile_assembly("namespace CQViewer { class CQMgr {} }", "CameraQuakeViewer.dll", assembly_path, MAX_PATH)) + result = mono_assembly_open(assembly_path, &stat); + else + ERR("HACK: Failed to build CameraQuakeViewer.dll\n"); + + if (result) + goto done; + else + ERR("HACK: Failed to load CameraQuakeViewer.dll\n"); + } + } + if ((search_flags & ASSEMBLY_SEARCH_GAC) != 0) { stringnameW_size = MultiByteToWideChar(CP_UTF8, 0, stringname, -1, NULL, 0); From 60c4d396b673ec5fe9b5223bf15e1d61665be456 Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Thu, 22 Apr 2021 14:35:40 -0500 Subject: [PATCH 0128/2542] HACK: mscoree: For M&B2:Bannerlord, redirect ManagedStarter loads to Bannerlord.exe For M&B2:Bannerlord. CW-Bug-Id: #18843 --- dlls/mscoree/metahost.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dlls/mscoree/metahost.c b/dlls/mscoree/metahost.c index 07f245c64b03..04e37291395b 100644 --- a/dlls/mscoree/metahost.c +++ b/dlls/mscoree/metahost.c @@ -1856,6 +1856,30 @@ static MonoAssembly* CDECL wine_mono_assembly_preload_hook_v2_fn(MonoAssemblyNam } } + if (!strcmp(assemblyname, "ManagedStarter")) + { + /* HACK for Mount & Blade II: Bannerlord + * + * The launcher executable uses an AssemblyResolve event handler + * to redirect loads of the "ManagedStarter" assembly to + * Bannerlord.exe. Due to Mono issue #11319, the runtime attempts + * to load ManagedStarter before executing the static constructor + * that adds this event handler. We work around this by doing the + * same thing in our own assembly load hook. */ + const char* sgi = getenv("SteamGameId"); + if (sgi && !strcmp(sgi, "261550")) + { + FIXME("hack, using Bannerlord.exe\n"); + + result = mono_assembly_open("Bannerlord.exe", &stat); + + if (result) + goto done; + else + ERR("Bannerlord.exe failed to load\n"); + } + } + if (!strcmp(assemblyname, "CameraQuakeViewer")) { /* HACK for Nights of Azure which references type from a non-existing DLL. From 7b65190ccc226ce87c8ea42ab3e63c0dce7cc5c2 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Tue, 7 Jun 2022 13:02:38 -0500 Subject: [PATCH 0129/2542] HACK: mscoree: Add hack for missing UnrealEdCSharp assembly for Karmaflow CW-Bug-Id: #20672 --- dlls/mscoree/metahost.c | 60 +++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/dlls/mscoree/metahost.c b/dlls/mscoree/metahost.c index 04e37291395b..1ff6f9dbf006 100644 --- a/dlls/mscoree/metahost.c +++ b/dlls/mscoree/metahost.c @@ -1800,6 +1800,8 @@ static MonoAssembly* CDECL wine_mono_assembly_preload_hook_v2_fn(MonoAssemblyNam static const WCHAR dotdllW[] = {'.','d','l','l',0}; static const WCHAR dotexeW[] = {'.','e','x','e',0}; + const char *sgi = getenv("SteamGameId"); + stringname = mono_stringify_assembly_name(aname); assemblyname = mono_assembly_name_get_name(aname); culture = mono_assembly_name_get_culture(aname); @@ -1866,7 +1868,6 @@ static MonoAssembly* CDECL wine_mono_assembly_preload_hook_v2_fn(MonoAssemblyNam * to load ManagedStarter before executing the static constructor * that adds this event handler. We work around this by doing the * same thing in our own assembly load hook. */ - const char* sgi = getenv("SteamGameId"); if (sgi && !strcmp(sgi, "261550")) { FIXME("hack, using Bannerlord.exe\n"); @@ -1880,27 +1881,52 @@ static MonoAssembly* CDECL wine_mono_assembly_preload_hook_v2_fn(MonoAssemblyNam } } - if (!strcmp(assemblyname, "CameraQuakeViewer")) + /* HACK for games which reference a type from a non-existing DLL. + * Native .NET framework normally gets away with it but Mono cannot + * due to some deeply rooted differences. */ + if (sgi) { - /* HACK for Nights of Azure which references type from a non-existing DLL. - * Native .NET framework normally gets away with it but Mono cannot - * due to some deeply rooted differences. */ - const char* sgi = getenv("SteamGameId"); - if (sgi && !strcmp(sgi, "527280")) + size_t i; + + static const struct { + const char *assembly_name; + const char *module_name; + const char *appid; + const char *source; + } assembly_hacks[] = { + { + "CameraQuakeViewer", + "CameraQuakeViewer.dll", + "527280", /* Nights of Azure */ + "namespace CQViewer { class CQMgr {} }" + }, + { + "UnrealEdCSharp", + "UnrealEdCSharp.dll", + "317940", /* Karmaflow */ + "namespace ContentBrowser { class IContentBrowserBackendInterface {} class Package {} } " + }, + }; + + for (i = 0; i < ARRAY_SIZE(assembly_hacks); ++i) { - char assembly_path[MAX_PATH]; + if (!strcmp(assemblyname, assembly_hacks[i].assembly_name) && + !strcmp(sgi, assembly_hacks[i].appid)) + { + char assembly_path[MAX_PATH]; - FIXME("HACK: Building CameraQuakeViewer.dll\n"); + FIXME("HACK: Building %s\n", assembly_hacks[i].module_name); - if (compile_assembly("namespace CQViewer { class CQMgr {} }", "CameraQuakeViewer.dll", assembly_path, MAX_PATH)) - result = mono_assembly_open(assembly_path, &stat); - else - ERR("HACK: Failed to build CameraQuakeViewer.dll\n"); + if (compile_assembly(assembly_hacks[i].source, assembly_hacks[i].module_name, assembly_path, MAX_PATH)) + result = mono_assembly_open(assembly_path, &stat); + else + ERR("HACK: Failed to build %s\n", assembly_hacks[i].assembly_name); - if (result) - goto done; - else - ERR("HACK: Failed to load CameraQuakeViewer.dll\n"); + if (result) + goto done; + + ERR("HACK: Failed to load %s\n", assembly_hacks[i].assembly_name); + } } } From 99dc99eca66d9847de6324078aafb49cab816c51 Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Tue, 6 Sep 2022 13:40:05 -0500 Subject: [PATCH 0130/2542] HACK: mscoree: Enable field-loading hack for Primal Carnage: Extinction. --- dlls/mscoree/metahost.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/mscoree/metahost.c b/dlls/mscoree/metahost.c index 1ff6f9dbf006..52f9670b63f1 100644 --- a/dlls/mscoree/metahost.c +++ b/dlls/mscoree/metahost.c @@ -1906,6 +1906,12 @@ static MonoAssembly* CDECL wine_mono_assembly_preload_hook_v2_fn(MonoAssemblyNam "317940", /* Karmaflow */ "namespace ContentBrowser { class IContentBrowserBackendInterface {} class Package {} } " }, + { + "UnrealEdCSharp", + "UnrealEdCSharp.dll", + "321360", /* Primal Carnage: Extinction */ + "namespace ContentBrowser { class IContentBrowserBackendInterface {} class Package {} } " + }, }; for (i = 0; i < ARRAY_SIZE(assembly_hacks); ++i) From 091016a2a7aa3ae996b114ca516ff4bf6479d838 Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Mon, 9 Oct 2023 15:49:27 -0500 Subject: [PATCH 0131/2542] HACK: mscoree: Add work-around for Grotesque Tactics. CW-Bug-Id: #22841 --- dlls/mscoree/metahost.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/mscoree/metahost.c b/dlls/mscoree/metahost.c index 52f9670b63f1..46e22490e8e8 100644 --- a/dlls/mscoree/metahost.c +++ b/dlls/mscoree/metahost.c @@ -1912,6 +1912,12 @@ static MonoAssembly* CDECL wine_mono_assembly_preload_hook_v2_fn(MonoAssemblyNam "321360", /* Primal Carnage: Extinction */ "namespace ContentBrowser { class IContentBrowserBackendInterface {} class Package {} } " }, + { + "DockPanel", + "DockPanel.dll", + "46450", /* Grotesque Tactics: Evil Heroes */ + "namespace WeifenLuo.WinFormsUI { class DockPanel {} }" + }, }; for (i = 0; i < ARRAY_SIZE(assembly_hacks); ++i) From 54b6a4d23f5b80435d894bb22f182c6e4dd1dae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 25 Oct 2023 17:24:56 +0200 Subject: [PATCH 0132/2542] dmime: Implement IDirectMusicTrack_EndPlay for wave track. CW-Bug-Id: #16680 CW-Bug-Id: #20424 CW-Bug-Id: #22409 --- dlls/dmime/wavetrack.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dlls/dmime/wavetrack.c b/dlls/dmime/wavetrack.c index 64480c6422f2..f34e8eeab8f5 100644 --- a/dlls/dmime/wavetrack.c +++ b/dlls/dmime/wavetrack.c @@ -139,7 +139,20 @@ static HRESULT WINAPI wave_track_InitPlay(IDirectMusicTrack8 *iface, static HRESULT WINAPI wave_track_EndPlay(IDirectMusicTrack8 *iface, void *pStateData) { struct wave_track *This = impl_from_IDirectMusicTrack8(iface); + struct wave_part *part; + struct wave_item *item; + FIXME("(%p, %p): stub\n", This, pStateData); + + LIST_FOR_EACH_ENTRY(part, &This->parts, struct wave_part, entry) + { + LIST_FOR_EACH_ENTRY(item, &part->items, struct wave_item, entry) + { + if (!item->buffer) continue; + IDirectSoundBuffer_Stop(item->buffer); + } + } + return S_OK; } From fa9522ea33d58555b24a7bb8331928b029e7ab72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 26 Oct 2023 14:19:31 +0200 Subject: [PATCH 0133/2542] dmime: Stop previously playing primary segment in PlaySegmentEx. CW-Bug-Id: #16680 CW-Bug-Id: #20424 CW-Bug-Id: #22409 --- dlls/dmime/performance.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c index 500bc8b536f6..57cacc6bcf0b 100644 --- a/dlls/dmime/performance.c +++ b/dlls/dmime/performance.c @@ -1583,6 +1583,13 @@ static HRESULT WINAPI performance_PlaySegmentEx(IDirectMusicPerformance8 *iface, if (FAILED(hr = IUnknown_QueryInterface(source, &IID_IDirectMusicSegment, (void **)&segment))) return hr; + if (primary && SUCCEEDED(hr = IDirectMusicPerformance8_GetSegmentState(iface, &state, start_time))) + { + if (FAILED(hr = IDirectMusicPerformance_Stop(&This->IDirectMusicPerformance8_iface, NULL, state, start_time, 0))) + ERR("Failed to stop current previous segment, hr %#lx\n", hr); + IDirectMusicSegmentState_Release(state); + } + EnterCriticalSection(&This->safe); if (primary) performance_set_primary_segment(This, segment); From 7e437f217b6718fde615877fb5599fd8bd3f76ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 26 Oct 2023 14:26:41 +0200 Subject: [PATCH 0134/2542] HACK: dmime: Don't send segment end message for secondary segments. CW-Bug-Id: #16680 CW-Bug-Id: #20424 CW-Bug-Id: #22409 --- dlls/dmime/dmime_private.h | 2 +- dlls/dmime/performance.c | 2 +- dlls/dmime/segmentstate.c | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dlls/dmime/dmime_private.h b/dlls/dmime/dmime_private.h index f2d1947d9a17..b3a297bebe81 100644 --- a/dlls/dmime/dmime_private.h +++ b/dlls/dmime/dmime_private.h @@ -77,7 +77,7 @@ extern void set_audiopath_perf_pointer(IDirectMusicAudioPath*,IDirectMusicPerfor extern void set_audiopath_dsound_buffer(IDirectMusicAudioPath*,IDirectSoundBuffer*); extern void set_audiopath_primary_dsound_buffer(IDirectMusicAudioPath*,IDirectSoundBuffer*); -extern HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time, +extern HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time, DWORD segment_flags, IDirectMusicPerformance8 *performance, IDirectMusicSegmentState **ret_iface); extern HRESULT segment_state_play(IDirectMusicSegmentState *iface, IDirectMusicPerformance8 *performance); extern HRESULT segment_state_tick(IDirectMusicSegmentState *iface, IDirectMusicPerformance8 *performance); diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c index 57cacc6bcf0b..d9efe7167963 100644 --- a/dlls/dmime/performance.c +++ b/dlls/dmime/performance.c @@ -1596,7 +1596,7 @@ static HRESULT WINAPI performance_PlaySegmentEx(IDirectMusicPerformance8 *iface, if (control) performance_set_control_segment(This, segment); if ((!(music_time = start_time) && FAILED(hr = IDirectMusicPerformance8_GetTime(iface, NULL, &music_time))) - || FAILED(hr = segment_state_create(segment, music_time, iface, &state))) + || FAILED(hr = segment_state_create(segment, music_time, segment_flags, iface, &state))) { if (primary) performance_set_primary_segment(This, NULL); if (control) performance_set_control_segment(This, NULL); diff --git a/dlls/dmime/segmentstate.c b/dlls/dmime/segmentstate.c index 4fece4181e18..2c6f88930d88 100644 --- a/dlls/dmime/segmentstate.c +++ b/dlls/dmime/segmentstate.c @@ -61,6 +61,7 @@ struct segment_state BOOL auto_download; DWORD repeats, actual_repeats; DWORD track_flags; + DWORD segment_flags; struct list tracks; }; @@ -118,7 +119,7 @@ static ULONG WINAPI segment_state_Release(IDirectMusicSegmentState8 *iface) if (!ref) { - segment_state_end_play((IDirectMusicSegmentState *)iface, NULL); + if (!(This->segment_flags & DMUS_SEGF_SECONDARY)) segment_state_end_play((IDirectMusicSegmentState *)iface, NULL); if (This->segment) IDirectMusicSegment_Release(This->segment); if (This->parent_graph) IDirectMusicGraph_Release(This->parent_graph); free(This); @@ -309,7 +310,7 @@ HRESULT create_dmsegmentstate(REFIID riid, void **ret_iface) return hr; } -HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time, +HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time, DWORD segment_flags, IDirectMusicPerformance8 *performance, IDirectMusicSegmentState **ret_iface) { IDirectMusicSegmentState *iface; @@ -324,6 +325,7 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time if (FAILED(hr = create_dmsegmentstate(&IID_IDirectMusicSegmentState, (void **)&iface))) return hr; This = impl_from_IDirectMusicSegmentState8((IDirectMusicSegmentState8 *)iface); + This->segment_flags = segment_flags; This->segment = segment; IDirectMusicSegment_AddRef(This->segment); @@ -436,6 +438,7 @@ static HRESULT segment_state_play_chunk(struct segment_state *This, IDirectMusic { MUSIC_TIME end_time = This->start_time + This->played; + if (This->segment_flags & DMUS_SEGF_SECONDARY) return S_OK; if (FAILED(hr = performance_send_segment_end(performance, end_time, iface, FALSE))) { ERR("Failed to send segment end, hr %#lx\n", hr); From 88b257a6f9458cd83696b32a20a480f20ef19b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 29 Jun 2023 14:36:32 +0200 Subject: [PATCH 0135/2542] winhttp: Move connect end checks out of the loop. This is only done when InitializeSecurityContextW returns SEC_E_OK, which will break out of the loop, and the checks forcefully break out of the loop if any failed. CW-Bug-Id: #18449 CW-Bug-Id: #22371 --- dlls/winhttp/net.c | 80 ++++++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 41 deletions(-) diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index e46f2023fae8..784a07116b14 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -387,60 +387,58 @@ DWORD netconn_secure_connect( struct netconn *conn, WCHAR *hostname, DWORD secur status = InitializeSecurityContextW(cred_handle, &ctx, hostname, isc_req_flags, 0, 0, &in_desc, 0, NULL, &out_desc, &attrs, NULL); TRACE( "InitializeSecurityContext ret %#lx\n", status ); + if(status == SEC_E_OK && in_bufs[1].BufferType == SECBUFFER_EXTRA) + FIXME("SECBUFFER_EXTRA not supported\n"); + } - if(status == SEC_E_OK) { - if(in_bufs[1].BufferType == SECBUFFER_EXTRA) - FIXME("SECBUFFER_EXTRA not supported\n"); - - status = QueryContextAttributesW(&ctx, SECPKG_ATTR_STREAM_SIZES, &conn->ssl_sizes); - if(status != SEC_E_OK) { - WARN("Could not get sizes\n"); - break; - } + free(read_buf); - status = QueryContextAttributesW(&ctx, SECPKG_ATTR_REMOTE_CERT_CONTEXT, (void*)&cert); - if(status == SEC_E_OK) { - res = netconn_verify_cert(cert, hostname, security_flags, check_revocation); - CertFreeCertificateContext(cert); - if(res != ERROR_SUCCESS) { - WARN( "cert verify failed: %lu\n", res ); - break; - } - }else { - WARN("Could not get cert\n"); - break; - } + if(status != SEC_E_OK || res != ERROR_SUCCESS) + goto failed; - conn->ssl_read_buf = malloc(conn->ssl_sizes.cbHeader + conn->ssl_sizes.cbMaximumMessage + conn->ssl_sizes.cbTrailer); - if(!conn->ssl_read_buf) { - res = ERROR_OUTOFMEMORY; - break; - } - conn->ssl_write_buf = malloc(conn->ssl_sizes.cbHeader + conn->ssl_sizes.cbMaximumMessage + conn->ssl_sizes.cbTrailer); - if(!conn->ssl_write_buf) { - res = ERROR_OUTOFMEMORY; - break; - } - } + status = QueryContextAttributesW(&ctx, SECPKG_ATTR_STREAM_SIZES, &conn->ssl_sizes); + if(status != SEC_E_OK) { + WARN("Could not get sizes\n"); + goto failed; } - free(read_buf); + status = QueryContextAttributesW(&ctx, SECPKG_ATTR_REMOTE_CERT_CONTEXT, (void*)&cert); + if(status != SEC_E_OK) { + WARN("Could not get cert\n"); + goto failed; + } - if(status != SEC_E_OK || res != ERROR_SUCCESS) { - WARN( "Failed to initialize security context: %#lx\n", status ); - free(conn->ssl_read_buf); - conn->ssl_read_buf = NULL; - free(conn->ssl_write_buf); - conn->ssl_write_buf = NULL; - DeleteSecurityContext(&ctx); - return ERROR_WINHTTP_SECURE_CHANNEL_ERROR; + res = netconn_verify_cert(cert, hostname, security_flags, check_revocation); + CertFreeCertificateContext(cert); + if(res != ERROR_SUCCESS) { + WARN( "cert verify failed: %lu\n", res ); + goto failed; } + conn->ssl_read_buf = malloc(conn->ssl_sizes.cbHeader + conn->ssl_sizes.cbMaximumMessage + conn->ssl_sizes.cbTrailer); + if(!conn->ssl_read_buf) { + res = ERROR_OUTOFMEMORY; + goto failed; + } + conn->ssl_write_buf = malloc(conn->ssl_sizes.cbHeader + conn->ssl_sizes.cbMaximumMessage + conn->ssl_sizes.cbTrailer); + if(!conn->ssl_write_buf) { + res = ERROR_OUTOFMEMORY; + goto failed; + } TRACE("established SSL connection\n"); conn->secure = TRUE; conn->ssl_ctx = ctx; return ERROR_SUCCESS; + +failed: + WARN( "Failed to initialize security context: %#lx\n", status ); + free(conn->ssl_read_buf); + conn->ssl_read_buf = NULL; + free(conn->ssl_write_buf); + conn->ssl_write_buf = NULL; + DeleteSecurityContext(&ctx); + return ERROR_WINHTTP_SECURE_CHANNEL_ERROR; } static DWORD send_ssl_chunk( struct netconn *conn, const void *msg, size_t size, WSAOVERLAPPED *ovr ) From 2fc28586a92747ec1c5acefe1b37bb29d500e321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 29 Jun 2023 14:39:06 +0200 Subject: [PATCH 0136/2542] winhttp: Introduce new netconn_negotiate helper. CW-Bug-Id: #18449 CW-Bug-Id: #22371 --- dlls/winhttp/net.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index 784a07116b14..c2964c8fb166 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -306,28 +306,24 @@ void netconn_release( struct netconn *conn ) free(conn); } -DWORD netconn_secure_connect( struct netconn *conn, WCHAR *hostname, DWORD security_flags, CredHandle *cred_handle, - BOOL check_revocation ) +static DWORD netconn_negotiate( struct netconn *conn, WCHAR *hostname, CredHandle *cred_handle, + CtxtHandle *ctx ) { SecBuffer out_buf = {0, SECBUFFER_TOKEN, NULL}, in_bufs[2] = {{0, SECBUFFER_TOKEN}, {0, SECBUFFER_EMPTY}}; SecBufferDesc out_desc = {SECBUFFER_VERSION, 1, &out_buf}, in_desc = {SECBUFFER_VERSION, 2, in_bufs}; BYTE *read_buf; SIZE_T read_buf_size = 2048; ULONG attrs = 0; - CtxtHandle ctx; SSIZE_T size; - const CERT_CONTEXT *cert; SECURITY_STATUS status; - DWORD res = ERROR_SUCCESS; const DWORD isc_req_flags = ISC_REQ_ALLOCATE_MEMORY|ISC_REQ_USE_SESSION_KEY|ISC_REQ_CONFIDENTIALITY |ISC_REQ_SEQUENCE_DETECT|ISC_REQ_REPLAY_DETECT|ISC_REQ_MANUAL_CRED_VALIDATION; if (!(read_buf = malloc( read_buf_size ))) return ERROR_OUTOFMEMORY; - memset( &ctx, 0, sizeof(ctx) ); status = InitializeSecurityContextW(cred_handle, NULL, hostname, isc_req_flags, 0, 0, NULL, 0, - &ctx, &out_desc, &attrs, NULL); + ctx, &out_desc, &attrs, NULL); assert(status != SEC_E_OK); @@ -340,7 +336,7 @@ DWORD netconn_secure_connect( struct netconn *conn, WCHAR *hostname, DWORD secur size = sock_send(conn->socket, out_buf.pvBuffer, out_buf.cbBuffer, NULL); if(size != out_buf.cbBuffer) { ERR("send failed\n"); - res = ERROR_WINHTTP_SECURE_CHANNEL_ERROR; + status = ERROR_WINHTTP_SECURE_CHANNEL_ERROR; break; } @@ -384,7 +380,7 @@ DWORD netconn_secure_connect( struct netconn *conn, WCHAR *hostname, DWORD secur in_bufs[0].cbBuffer += size; in_bufs[0].pvBuffer = read_buf; - status = InitializeSecurityContextW(cred_handle, &ctx, hostname, isc_req_flags, 0, 0, &in_desc, + status = InitializeSecurityContextW(cred_handle, ctx, hostname, isc_req_flags, 0, 0, &in_desc, 0, NULL, &out_desc, &attrs, NULL); TRACE( "InitializeSecurityContext ret %#lx\n", status ); if(status == SEC_E_OK && in_bufs[1].BufferType == SECBUFFER_EXTRA) @@ -393,6 +389,18 @@ DWORD netconn_secure_connect( struct netconn *conn, WCHAR *hostname, DWORD secur free(read_buf); + return status; +} + +DWORD netconn_secure_connect( struct netconn *conn, WCHAR *hostname, DWORD security_flags, CredHandle *cred_handle, + BOOL check_revocation ) +{ + CtxtHandle ctx = {0}; + const CERT_CONTEXT *cert; + SECURITY_STATUS status; + DWORD res = ERROR_SUCCESS; + + status = netconn_negotiate(conn, hostname, cred_handle, &ctx); if(status != SEC_E_OK || res != ERROR_SUCCESS) goto failed; From 31204813f23700411cec8ed014aebc49509c62a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 29 Jun 2023 16:01:39 +0200 Subject: [PATCH 0137/2542] winhttp: Handle SEC_I_RENEGOTIATE after DecryptMessage. By performing renegotiation as we should, instead of incorrectly returning ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED. MSDN says we should pass returned SECBUFFER_EXTRA as SECBUFFER_TOKEN, so we also do that, although it's usually empty. CW-Bug-Id: #18449 CW-Bug-Id: #22371 --- dlls/winhttp/net.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index c2964c8fb166..695b370a8102 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -307,7 +307,7 @@ void netconn_release( struct netconn *conn ) } static DWORD netconn_negotiate( struct netconn *conn, WCHAR *hostname, CredHandle *cred_handle, - CtxtHandle *ctx ) + CtxtHandle *prev_ctx, SecBufferDesc *prev_buf, CtxtHandle *ctx ) { SecBuffer out_buf = {0, SECBUFFER_TOKEN, NULL}, in_bufs[2] = {{0, SECBUFFER_TOKEN}, {0, SECBUFFER_EMPTY}}; SecBufferDesc out_desc = {SECBUFFER_VERSION, 1, &out_buf}, in_desc = {SECBUFFER_VERSION, 2, in_bufs}; @@ -322,8 +322,9 @@ static DWORD netconn_negotiate( struct netconn *conn, WCHAR *hostname, CredHandl if (!(read_buf = malloc( read_buf_size ))) return ERROR_OUTOFMEMORY; - status = InitializeSecurityContextW(cred_handle, NULL, hostname, isc_req_flags, 0, 0, NULL, 0, + status = InitializeSecurityContextW(cred_handle, prev_ctx, hostname, isc_req_flags, 0, 0, prev_buf, 0, ctx, &out_desc, &attrs, NULL); + if (!ctx) ctx = prev_ctx; assert(status != SEC_E_OK); @@ -400,7 +401,7 @@ DWORD netconn_secure_connect( struct netconn *conn, WCHAR *hostname, DWORD secur SECURITY_STATUS status; DWORD res = ERROR_SUCCESS; - status = netconn_negotiate(conn, hostname, cred_handle, &ctx); + status = netconn_negotiate(conn, hostname, cred_handle, NULL, NULL, &ctx); if(status != SEC_E_OK || res != ERROR_SUCCESS) goto failed; @@ -561,8 +562,23 @@ static DWORD read_ssl_chunk( struct netconn *conn, void *buf, SIZE_T buf_size, S break; case SEC_I_RENEGOTIATE: + { + SecBuffer out_buf = {0, SECBUFFER_TOKEN, NULL}; + SecBufferDesc out_desc = {SECBUFFER_VERSION, 1, &out_buf}; + TRACE("renegotiate\n"); - return ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED; + + for(i = 0; i < ARRAY_SIZE(bufs); i++) { + if(bufs[i].BufferType == SECBUFFER_EXTRA) { + out_buf.cbBuffer = bufs[i].cbBuffer; + out_buf.pvBuffer = bufs[i].pvBuffer; + } + } + + res = netconn_negotiate(conn, conn->host->hostname, NULL, &conn->ssl_ctx, &out_desc, NULL); + if (res != SEC_E_OK) return res; + continue; + } case SEC_I_CONTEXT_EXPIRED: TRACE("context expired\n"); From ad0e5397b2cc2c3ee0a20ae51e9127f917530f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 5 Dec 2023 17:29:39 +0100 Subject: [PATCH 0138/2542] secur32: Perform TLS re-handshake after SEC_I_RENEGOTIATE was returned. Even if input buffer is empty, as this is often the case. CW-Bug-Id: #18449 CW-Bug-Id: #22371 --- dlls/secur32/schannel.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/secur32/schannel.c b/dlls/secur32/schannel.c index 3ad6be5e7382..8ce0ac833cf3 100644 --- a/dlls/secur32/schannel.c +++ b/dlls/secur32/schannel.c @@ -65,6 +65,7 @@ struct schan_context enum control_token control_token; unsigned int alert_type; unsigned int alert_number; + BOOL rehandshake_requested; }; static struct schan_handle *schan_handle_table; @@ -898,7 +899,7 @@ static SECURITY_STATUS establish_context( buffer = &pInput->pBuffers[idx]; ptr = buffer->pvBuffer; - if (buffer->cbBuffer < ctx->header_size) + if (buffer->cbBuffer < ctx->header_size && !ctx->rehandshake_requested) { TRACE("Expected at least %Iu bytes, but buffer only contains %lu bytes.\n", ctx->header_size, buffer->cbBuffer); @@ -915,7 +916,7 @@ static SECURITY_STATUS establish_context( ptr += record_size; } - if (!expected_size) + if (!expected_size && !ctx->rehandshake_requested) { TRACE("Expected at least %Iu bytes, but buffer only contains %lu bytes.\n", max(ctx->header_size, record_size), buffer->cbBuffer); @@ -967,6 +968,7 @@ static SECURITY_STATUS establish_context( params.alert_type = ctx->alert_type; params.alert_number = ctx->alert_number; ctx->control_token = CONTROL_TOKEN_NONE; + ctx->rehandshake_requested = FALSE; ret = GNUTLS_CALL( handshake, ¶ms ); if (output_buffer_idx != -1) @@ -1569,6 +1571,7 @@ static SECURITY_STATUS SEC_ENTRY schan_DecryptMessage(PCtxtHandle context_handle buffer->BufferType = SECBUFFER_STREAM_HEADER; buffer->cbBuffer = ctx->header_size; + if (status == SEC_I_RENEGOTIATE) ctx->rehandshake_requested = TRUE; return status; } From 9e137d6dfb5d6129c7470c4d5bc6030d2f7a83e9 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Fri, 6 Nov 2020 12:20:16 -0600 Subject: [PATCH 0139/2542] Revert "winex11.drv: Interpret mouse 6/7 as horiz scroll." This reverts commit 893080e4df5a45929320ebb88b8668eea316476c. We have a trade-off here between supporting horizontal scroll, or mapping those actions to the XBUTTON{1,2} messages. Some users were using those buttons in their games, which broke with this change. It seems more likely that the extra button mapping will be useful than horizontal scrolling, so let's revert this commit. --- dlls/winex11.drv/mouse.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 6fc7031e1819..208ece049b2f 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -75,8 +75,8 @@ static const UINT button_down_flags[NB_BUTTONS] = MOUSEEVENTF_RIGHTDOWN, MOUSEEVENTF_WHEEL, MOUSEEVENTF_WHEEL, - MOUSEEVENTF_HWHEEL, - MOUSEEVENTF_HWHEEL, + MOUSEEVENTF_XDOWN, /* FIXME: horizontal wheel */ + MOUSEEVENTF_XDOWN, MOUSEEVENTF_XDOWN, MOUSEEVENTF_XDOWN }; @@ -88,8 +88,8 @@ static const UINT button_up_flags[NB_BUTTONS] = MOUSEEVENTF_RIGHTUP, 0, 0, - 0, - 0, + MOUSEEVENTF_XUP, + MOUSEEVENTF_XUP, MOUSEEVENTF_XUP, MOUSEEVENTF_XUP }; @@ -101,8 +101,8 @@ static const UINT button_down_data[NB_BUTTONS] = 0, WHEEL_DELTA, -WHEEL_DELTA, - -WHEEL_DELTA, - WHEEL_DELTA, + XBUTTON1, + XBUTTON2, XBUTTON1, XBUTTON2 }; @@ -114,8 +114,8 @@ static const UINT button_up_data[NB_BUTTONS] = 0, 0, 0, - 0, - 0, + XBUTTON1, + XBUTTON2, XBUTTON1, XBUTTON2 }; From 45fecd02ddb002be61eaf7bfd5d83723876839bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 8 Mar 2024 10:48:31 +0100 Subject: [PATCH 0140/2542] server: Add support for absolute rawinput mouse messages. --- server/queue.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/queue.c b/server/queue.c index 72586b9677e6..e01dca880a8b 100644 --- a/server/queue.c +++ b/server/queue.c @@ -2034,7 +2034,9 @@ static void rawmouse_init( struct rawinput *header, RAWMOUSE *rawmouse, int x, i header->wparam = 0; header->usage = MAKELONG(HID_USAGE_GENERIC_MOUSE, HID_USAGE_PAGE_GENERIC); - rawmouse->usFlags = MOUSE_MOVE_RELATIVE; + rawmouse->usFlags = 0; + if (flags & MOUSEEVENTF_ABSOLUTE) rawmouse->usFlags |= MOUSE_MOVE_ABSOLUTE; + if (flags & MOUSEEVENTF_VIRTUALDESK) rawmouse->usFlags |= MOUSE_VIRTUAL_DESKTOP; rawmouse->usButtonFlags = 0; rawmouse->usButtonData = 0; for (i = 1; i < ARRAY_SIZE(button_flags); ++i) @@ -2274,7 +2276,7 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons raw_msg.time = time; raw_msg.message = WM_INPUT; raw_msg.flags = flags; - rawmouse_init( &raw_msg.rawinput, &raw_msg.data.mouse, x - desktop_shm->cursor.x, y - desktop_shm->cursor.y, + rawmouse_init( &raw_msg.rawinput, &raw_msg.data.mouse, input->mouse.x, input->mouse.y, raw_msg.flags, input->mouse.data, input->mouse.info ); dispatch_rawinput_message( desktop, &raw_msg ); From f69aaefe46033f5cdcc6f1f6c4348e0163d81c72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 8 Mar 2024 11:08:53 +0100 Subject: [PATCH 0141/2542] winex11: Clear the MOUSEEVENTF_MOVE flag when accumulating motion. --- dlls/winex11.drv/mouse.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 208ece049b2f..156b140c82e5 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -1696,19 +1696,17 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) values++; } - input->mi.dx = round( x->value ); - input->mi.dy = round( y->value ); - - TRACE( "event %f,%f value %f,%f input %d,%d\n", x_value, y_value, x->value, y->value, - (int)input->mi.dx, (int)input->mi.dy ); - - x->value -= input->mi.dx; - y->value -= input->mi.dy; - - if (!input->mi.dx && !input->mi.dy) + if (!(input->mi.dx = round( x->value )) && !(input->mi.dy = round( y->value ))) { - TRACE( "accumulating motion\n" ); - return FALSE; + TRACE( "event %f,%f value %f,%f, accumulating motion\n", x_value, y_value, x->value, y->value ); + input->mi.dwFlags &= ~MOUSEEVENTF_MOVE; + } + else + { + TRACE( "event %f,%f value %f,%f, input %d,%d\n", x_value, y_value, x->value, y->value, + (int)input->mi.dx, (int)input->mi.dy ); + x->value -= input->mi.dx; + y->value -= input->mi.dy; } return TRUE; @@ -1736,6 +1734,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev ) input.mi.dx = 0; input.mi.dy = 0; if (!map_raw_event_coords( event, &input )) return FALSE; + if (!(input.mi.dwFlags & MOUSEEVENTF_MOVE)) return FALSE; NtUserSendHardwareInput( 0, 0, &input, 0 ); return TRUE; From 2682098e3229edc87b5d5bed93b42bae713a8b92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 8 Mar 2024 11:15:57 +0100 Subject: [PATCH 0142/2542] winex11: Add support for absolute position in RawMotion events. --- dlls/winex11.drv/mouse.c | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 156b140c82e5..00eeeb91a45b 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -240,12 +240,18 @@ static void update_relative_valuators( XIAnyClassInfo **classes, int num_classes { valuator = (XIValuatorClassInfo *)classes[num_classes]; if (classes[num_classes]->type != XIValuatorClass) continue; - if (valuator->number == 0 && valuator->mode == XIModeRelative) thread_data->x_valuator = *valuator; - if (valuator->number == 1 && valuator->mode == XIModeRelative) thread_data->y_valuator = *valuator; + if (valuator->number == 0) thread_data->x_valuator = *valuator; + if (valuator->number == 1) thread_data->y_valuator = *valuator; } if (thread_data->x_valuator.number < 0 || thread_data->y_valuator.number < 0) WARN( "X/Y axis valuators not found, ignoring RawMotion events\n" ); + else if (thread_data->x_valuator.mode != thread_data->y_valuator.mode) + { + WARN( "Relative/Absolute mismatch between X/Y axis, ignoring RawMotion events\n" ); + thread_data->x_valuator.number = -1; + thread_data->y_valuator.number = -1; + } thread_data->x_valuator.value = 0; thread_data->y_valuator.value = 0; @@ -1663,6 +1669,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) { struct x11drv_thread_data *thread_data = x11drv_thread_data(); XIValuatorClassInfo *x = &thread_data->x_valuator, *y = &thread_data->y_valuator; + const UINT absolute_flags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_VIRTUALDESK; double x_value = 0, y_value = 0, x_scale, y_scale; const double *values = event->valuators.values; RECT virtual_rect; @@ -1673,7 +1680,15 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) if (!xinput2_available) return FALSE; if (event->deviceid != thread_data->xinput2_pointer) return FALSE; - virtual_rect = NtUserGetVirtualScreenRect( MDT_RAW_DPI ); + if (x->mode == XIModeRelative && y->mode == XIModeRelative) + input->mi.dwFlags &= ~absolute_flags; + else if (x->mode == XIModeAbsolute && y->mode == XIModeAbsolute) + input->mi.dwFlags |= absolute_flags; + else + FIXME( "Unsupported relative/absolute X/Y axis mismatch\n." ); + + if (input->mi.dwFlags & MOUSEEVENTF_VIRTUALDESK) SetRect( &virtual_rect, 0, 0, 65535, 65535 ); + else virtual_rect = NtUserGetVirtualScreenRect( MDT_RAW_DPI ); if (x->max <= x->min) x_scale = 1; else x_scale = (virtual_rect.right - virtual_rect.left) / (x->max - x->min); @@ -1686,17 +1701,26 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) if (i == x->number) { x_value = *values; - x->value += x_value * x_scale; + if (x->mode == XIModeRelative) x->value += x_value * x_scale; + else x->value = (x_value - x->min) * x_scale; } if (i == y->number) { y_value = *values; - y->value += y_value * y_scale; + if (y->mode == XIModeRelative) y->value += y_value * y_scale; + else y->value = (y_value - y->min) * y_scale; } values++; } - if (!(input->mi.dx = round( x->value )) && !(input->mi.dy = round( y->value ))) + if (input->mi.dwFlags & MOUSEEVENTF_ABSOLUTE) + { + input->mi.dx = round( x->value ); + input->mi.dy = round( y->value ); + TRACE( "event %f,%f value %f,%f absolute input %d,%d\n", x_value, y_value, x->value, y->value, + (int)input->mi.dx, (int)input->mi.dy ); + } + else if (!(input->mi.dx = round( x->value )) && !(input->mi.dy = round( y->value ))) { TRACE( "event %f,%f value %f,%f, accumulating motion\n", x_value, y_value, x->value, y->value ); input->mi.dwFlags &= ~MOUSEEVENTF_MOVE; From 7f37ed90a81a42636d363a89b81372bd5e9c0178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 26 Aug 2019 14:37:20 +0200 Subject: [PATCH 0143/2542] server: Add send_hardware_message flags for rawinput translation. --- include/ntuser.h | 4 ++++ server/protocol.def | 3 +-- server/queue.c | 22 ++++++++++++++-------- server/user.h | 1 + 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/include/ntuser.h b/include/ntuser.h index 01fdd4b17e44..dabd7d1c92a8 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -1664,6 +1664,10 @@ struct hid_packet C_ASSERT(sizeof(struct hid_packet) == offsetof(struct hid_packet, data[0])); +#define SEND_HWMSG_INJECTED 1 +#define SEND_HWMSG_NO_RAW 2 +#define SEND_HWMSG_NO_MSG 4 + struct send_hardware_input_params { UINT flags; diff --git a/server/protocol.def b/server/protocol.def index 73b1ecec24f6..55a44ba0f8fb 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -2299,7 +2299,7 @@ enum message_type @REQ(send_hardware_message) user_handle_t win; /* window handle */ union hw_input input; /* input data */ - unsigned int flags; /* flags (see below) */ + unsigned int flags; /* flags (see ntuser.h) */ VARARG(report,bytes); /* HID report data */ @REPLY int wait; /* do we need to wait for a reply? */ @@ -2308,7 +2308,6 @@ enum message_type int new_x; /* new cursor position */ int new_y; @END -#define SEND_HWMSG_INJECTED 0x01 /* Get a message from the current queue */ diff --git a/server/queue.c b/server/queue.c index e01dca880a8b..e43a2ac37a22 100644 --- a/server/queue.c +++ b/server/queue.c @@ -2207,7 +2207,7 @@ static void dispatch_rawinput_message( struct desktop *desktop, struct rawinput_ /* queue a hardware message for a mouse event */ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, const union hw_input *input, - unsigned int origin, struct msg_queue *sender ) + unsigned int origin, struct msg_queue *sender, unsigned int send_flags ) { const desktop_shm_t *desktop_shm = desktop->shared; struct hardware_msg_data *msg_data; @@ -2268,7 +2268,7 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons y = desktop_shm->cursor.y; } - if ((foreground = get_foreground_thread( desktop, win ))) + if (!(send_flags & SEND_HWMSG_NO_RAW) && (foreground = get_foreground_thread( desktop, win ))) { memset( &raw_msg, 0, sizeof(raw_msg) ); raw_msg.foreground = foreground; @@ -2283,6 +2283,8 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons release_object( foreground ); } + if (send_flags & SEND_HWMSG_NO_MSG) return 0; + for (i = 0; i < ARRAY_SIZE( messages ); i++) { if (!messages[i]) continue; @@ -2313,14 +2315,15 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons } static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, const union hw_input *input, - unsigned int origin, struct msg_queue *sender, int repeat ); + unsigned int origin, struct msg_queue *sender, unsigned int flags, int repeat ); static void key_repeat_timeout( void *private ) { struct desktop *desktop = private; desktop->key_repeat.timeout = NULL; - queue_keyboard_message( desktop, desktop->key_repeat.win, &desktop->key_repeat.input, IMO_HARDWARE, NULL, 1 ); + queue_keyboard_message( desktop, desktop->key_repeat.win, &desktop->key_repeat.input, + IMO_HARDWARE, NULL, desktop->key_repeat.flags, 1 ); } static void stop_key_repeat( struct desktop *desktop ) @@ -2333,7 +2336,7 @@ static void stop_key_repeat( struct desktop *desktop ) /* queue a hardware message for a keyboard event */ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, const union hw_input *input, - unsigned int origin, struct msg_queue *sender, int repeat ) + unsigned int origin, struct msg_queue *sender, unsigned int send_flags, int repeat ) { const desktop_shm_t *desktop_shm = desktop->shared; struct hw_msg_source source = { IMDT_KEYBOARD, origin }; @@ -2449,6 +2452,7 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c { timeout_t timeout = repeat ? desktop->key_repeat.period : desktop->key_repeat.delay; desktop->key_repeat.input = *input; + desktop->key_repeat.flags = send_flags; desktop->key_repeat.input.kbd.time = 0; desktop->key_repeat.win = win; if (desktop->key_repeat.timeout) remove_timeout_user( desktop->key_repeat.timeout ); @@ -2456,7 +2460,7 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c } } - if (!unicode && (foreground = get_foreground_thread( desktop, win ))) + if (!unicode && !(send_flags & SEND_HWMSG_NO_RAW) && (foreground = get_foreground_thread( desktop, win ))) { struct rawinput_message raw_msg = {0}; raw_msg.foreground = foreground; @@ -2471,6 +2475,8 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c release_object( foreground ); } + if (send_flags & SEND_HWMSG_NO_MSG) return 0; + if (!(msg = alloc_hardware_message( input->kbd.info, source, time, 0 ))) return 0; msg_data = msg->data; @@ -3249,10 +3255,10 @@ DECL_HANDLER(send_hardware_message) switch (req->input.type) { case INPUT_MOUSE: - wait = queue_mouse_message( desktop, req->win, &req->input, origin, sender ); + wait = queue_mouse_message( desktop, req->win, &req->input, origin, sender, req->flags ); break; case INPUT_KEYBOARD: - wait = queue_keyboard_message( desktop, req->win, &req->input, origin, sender, 0 ); + wait = queue_keyboard_message( desktop, req->win, &req->input, origin, sender, req->flags, 0 ); break; case INPUT_HARDWARE: queue_custom_hardware_message( desktop, req->win, origin, &req->input ); diff --git a/server/user.h b/server/user.h index ce463b9395d5..6e632fef385d 100644 --- a/server/user.h +++ b/server/user.h @@ -66,6 +66,7 @@ struct key_repeat timeout_t delay; /* auto-repeat delay */ timeout_t period; /* auto-repeat period */ union hw_input input; /* the input to repeat */ + unsigned int flags; /* the queue_keyboard_message flags */ user_handle_t win; /* target window for input event */ struct timeout_user *timeout; /* timeout for repeat */ }; From 1de504660eb4b084b2dbf57802ab44f91e469138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 19 Dec 2019 22:34:44 +0100 Subject: [PATCH 0144/2542] winex11: Keep track of mouse device and pointer button mappings. We are going to receive raw button events and we will need to apply the correct button mappings ourselves. Original patch by Andrew Eikum . --- configure.ac | 1 + dlls/winex11.drv/keyboard.c | 24 +++++++-- dlls/winex11.drv/mouse.c | 93 +++++++++++++++++++++++++++++++++- dlls/winex11.drv/x11drv.h | 1 + dlls/winex11.drv/x11drv_main.c | 1 + 5 files changed, 114 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 6080645c12ce..2e477c2b8f43 100644 --- a/configure.ac +++ b/configure.ac @@ -1210,6 +1210,7 @@ then dnl *** All of the following tests require X11/Xlib.h AC_CHECK_HEADERS([X11/extensions/shape.h \ + X11/extensions/XInput.h \ X11/extensions/XInput2.h \ X11/extensions/XShm.h \ X11/extensions/Xfixes.h \ diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index 7b7371ed6969..fdca9d67e0b6 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -1820,11 +1820,7 @@ BOOL X11DRV_ActivateKeyboardLayout(HKL hkl, UINT flags) return TRUE; } - -/*********************************************************************** - * X11DRV_MappingNotify - */ -BOOL X11DRV_MappingNotify( HWND dummy, XEvent *event ) +static BOOL X11DRV_KeyboardMappingNotify( HWND dummy, XEvent *event ) { HWND hwnd; @@ -1838,6 +1834,24 @@ BOOL X11DRV_MappingNotify( HWND dummy, XEvent *event ) return TRUE; } +/*********************************************************************** + * X11DRV_MappingNotify + */ +BOOL X11DRV_MappingNotify( HWND dummy, XEvent *event ) +{ + switch (event->xmapping.request) + { + case MappingModifier: + case MappingKeyboard: + return X11DRV_KeyboardMappingNotify( dummy, event ); + case MappingPointer: + X11DRV_InitMouse( event->xmapping.display ); + break; + } + + return TRUE; +} + /*********************************************************************** * VkKeyScanEx (X11DRV.@) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 00eeeb91a45b..f2c3a383e04c 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -30,6 +30,9 @@ #include #include #include +#ifdef HAVE_X11_EXTENSIONS_XINPUT_H +#include +#endif #ifdef HAVE_X11_EXTENSIONS_XINPUT2_H #include #endif @@ -137,6 +140,14 @@ MAKE_FUNCPTR(XISelectEvents); #undef MAKE_FUNCPTR #endif +#ifdef HAVE_X11_EXTENSIONS_XINPUT_H +#define MAKE_FUNCPTR(f) static typeof(f) * p##f +MAKE_FUNCPTR(XOpenDevice); +MAKE_FUNCPTR(XCloseDevice); +MAKE_FUNCPTR(XGetDeviceButtonMapping); +#undef MAKE_FUNCPTR +#endif + /*********************************************************************** * X11DRV_Xcursor_Init * @@ -224,6 +235,75 @@ void set_window_cursor( Window window, HCURSOR handle ) XFlush( gdi_display ); } +struct mouse_button_mapping +{ + int deviceid; + unsigned int button_count; + unsigned char buttons[256]; +}; + +static struct mouse_button_mapping *pointer_mapping; +static struct mouse_button_mapping *device_mapping; + +#ifdef HAVE_X11_EXTENSIONS_XINPUT_H + +static void update_pointer_mapping( Display *display ) +{ + struct mouse_button_mapping *tmp; + + if (!(tmp = malloc( sizeof(*tmp) ))) + { + WARN("Unable to allocate device mapping.\n"); + return; + } + + tmp->button_count = ARRAY_SIZE( tmp->buttons ); + tmp->button_count = XGetPointerMapping( display, tmp->buttons, tmp->button_count ); + + free( InterlockedExchangePointer( (void**)&pointer_mapping, tmp ) ); +} + +static void update_device_mapping( Display *display, int deviceid ) +{ + struct mouse_button_mapping *tmp; + XDevice *device; + + if (!(device = pXOpenDevice( display, deviceid ))) + { + WARN( "Unable to open cursor device %d\n", deviceid ); + return; + } + + if (!(tmp = malloc( sizeof(*tmp) ))) + { + WARN( "Unable to allocate device mapping.\n" ); + pXCloseDevice( display, device ); + return; + } + + tmp->deviceid = deviceid; + tmp->button_count = ARRAY_SIZE( tmp->buttons ); + tmp->button_count = pXGetDeviceButtonMapping( display, device, tmp->buttons, tmp->button_count ); + + free( InterlockedExchangePointer( (void**)&device_mapping, tmp ) ); + + pXCloseDevice( display, device ); +} + +void X11DRV_InitMouse( Display *display ) +{ + update_pointer_mapping( display ); +} + +#else /* HAVE_X11_EXTENSIONS_XINPUT_H */ + +void X11DRV_InitMouse( Display *display ) +{ +} + +#endif /* HAVE_X11_EXTENSIONS_XINPUT_H */ + + #ifdef HAVE_X11_EXTENSIONS_XINPUT2_H /*********************************************************************** * update_relative_valuators @@ -1662,6 +1742,8 @@ static BOOL X11DRV_DeviceChanged( XGenericEventCookie *xev ) if (event->deviceid != data->xinput2_pointer) return FALSE; update_relative_valuators( event->classes, event->num_classes ); + update_device_mapping( event->display, event->sourceid ); + return TRUE; } @@ -1810,7 +1892,7 @@ static BOOL X11DRV_TouchEvent( HWND hwnd, XGenericEventCookie *xev ) */ void x11drv_xinput2_load(void) { -#if defined(SONAME_LIBXI) && defined(HAVE_X11_EXTENSIONS_XINPUT2_H) +#if defined(SONAME_LIBXI) int event, error; void *libxi_handle = dlopen( SONAME_LIBXI, RTLD_NOW ); @@ -1826,11 +1908,20 @@ void x11drv_xinput2_load(void) return; \ } +#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H LOAD_FUNCPTR(XIGetClientPointer); LOAD_FUNCPTR(XIFreeDeviceInfo); LOAD_FUNCPTR(XIQueryDevice); LOAD_FUNCPTR(XIQueryVersion); LOAD_FUNCPTR(XISelectEvents); +#endif + +#ifdef HAVE_X11_EXTENSIONS_XINPUT_H + LOAD_FUNCPTR(XOpenDevice); + LOAD_FUNCPTR(XCloseDevice); + LOAD_FUNCPTR(XGetDeviceButtonMapping); +#endif + #undef LOAD_FUNCPTR xinput2_available = XQueryExtension( gdi_display, "XInputExtension", &xinput2_opcode, &event, &error ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 85d196640404..190f66e53170 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -713,6 +713,7 @@ extern void reapply_cursor_clipping(void); extern void ungrab_clipping_window(void); extern void move_resize_window( HWND hwnd, int dir, POINT pos ); extern void X11DRV_InitKeyboard( Display *display ); +extern void X11DRV_InitMouse( Display *display ); extern BOOL X11DRV_ProcessEvents( DWORD mask ); extern HWND *build_hwnd_list(void); diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 96ebca46c729..36b506f94395 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -687,6 +687,7 @@ static NTSTATUS x11drv_init( void *arg ) XkbUseExtension( gdi_display, NULL, NULL ); X11DRV_InitKeyboard( gdi_display ); + X11DRV_InitMouse( gdi_display ); if (use_xim) use_xim = xim_init( input_style ); init_user_driver(); From dfdf8f4cc2f0cebbdd0caa9cd3eced19b2cf1eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 25 Oct 2021 11:45:47 +0200 Subject: [PATCH 0145/2542] winex11: Listen to Raw(Motion|Button) events in the desktop thread. We still need to send "normal" input from the clipping window thread to trigger low-level hooks callbacks when clipping cursor. This is for instance used in our dinput implementation. --- dlls/winex11.drv/event.c | 10 ++++-- dlls/winex11.drv/mouse.c | 73 ++++++++++++++++++++++++++++++++++++--- dlls/winex11.drv/window.c | 4 +++ dlls/winex11.drv/x11drv.h | 1 + 4 files changed, 81 insertions(+), 7 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 27c65e284233..19f39d7d1dd4 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -378,6 +378,10 @@ static enum event_merge_action merge_raw_motion_events( XIRawEvent *prev, XIRawE */ static enum event_merge_action merge_events( XEvent *prev, XEvent *next ) { +#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H + struct x11drv_thread_data *thread_data = x11drv_thread_data(); +#endif + switch (prev->type) { case ConfigureNotify: @@ -409,19 +413,21 @@ static enum event_merge_action merge_events( XEvent *prev, XEvent *next ) case GenericEvent: if (next->xcookie.extension != xinput2_opcode) break; if (next->xcookie.evtype != XI_RawMotion) break; - if (x11drv_thread_data()->warp_serial) break; + if (thread_data->xinput2_rawinput) break; + if (thread_data->warp_serial) break; return MERGE_KEEP; } break; case GenericEvent: if (prev->xcookie.extension != xinput2_opcode) break; if (prev->xcookie.evtype != XI_RawMotion) break; + if (thread_data->xinput2_rawinput) break; switch (next->type) { case GenericEvent: if (next->xcookie.extension != xinput2_opcode) break; if (next->xcookie.evtype != XI_RawMotion) break; - if (x11drv_thread_data()->warp_serial) break; + if (thread_data->warp_serial) break; return merge_raw_motion_events( prev->xcookie.data, next->xcookie.data ); #endif } diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index f2c3a383e04c..b836ba342e16 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -343,6 +343,7 @@ static void update_relative_valuators( XIAnyClassInfo **classes, int num_classes */ void x11drv_xinput2_enable( Display *display, Window window ) { + struct x11drv_thread_data *thread_data = x11drv_thread_data(); XIEventMask mask; unsigned char mask_bits[XIMaskLen(XI_LASTEVENT)]; @@ -357,7 +358,13 @@ void x11drv_xinput2_enable( Display *display, Window window ) { XISetMask( mask_bits, XI_DeviceChanged ); XISetMask( mask_bits, XI_RawMotion ); - XISetMask( mask_bits, XI_ButtonPress ); + if (!thread_data->xinput2_rawinput) + XISetMask( mask_bits, XI_ButtonPress ); + else + { + XISetMask( mask_bits, XI_RawButtonPress ); + XISetMask( mask_bits, XI_RawButtonRelease ); + } } else { @@ -375,10 +382,12 @@ void x11drv_xinput2_enable( Display *display, Window window ) */ void x11drv_xinput2_disable( Display *display, Window window ) { + struct x11drv_thread_data *thread_data = x11drv_thread_data(); unsigned char mask_bits[XIMaskLen(XI_LASTEVENT)]; XIEventMask mask; if (!xinput2_available) return; + if (thread_data->xinput2_rawinput) return; mask.mask = mask_bits; mask.mask_len = sizeof(mask_bits); @@ -629,7 +638,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU { struct x11drv_thread_data *thread_data = x11drv_thread_data(); if (!thread_data->clipping_cursor || thread_data->clip_window != window) return; - NtUserSendHardwareInput( hwnd, 0, input, 0 ); + NtUserSendHardwareInput( hwnd, SEND_HWMSG_NO_RAW, input, 0 ); return; } @@ -653,7 +662,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU SERVER_END_REQ; } - NtUserSendHardwareInput( hwnd, 0, input, 0 ); + NtUserSendHardwareInput( hwnd, SEND_HWMSG_NO_RAW, input, 0 ); } #ifdef SONAME_LIBXCURSOR @@ -1595,7 +1604,7 @@ void move_resize_window( HWND hwnd, int dir, POINT pos ) input.mi.dwFlags = button_up_flags[button - 1] | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE; input.mi.time = NtGetTickCount(); input.mi.dwExtraInfo = 0; - NtUserSendHardwareInput( hwnd, 0, &input, 0 ); + NtUserSendHardwareInput( hwnd, SEND_HWMSG_NO_RAW, &input, 0 ); } while (NtUserPeekMessage( &msg, 0, 0, 0, PM_REMOVE )) @@ -1823,6 +1832,8 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) */ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev ) { + struct x11drv_thread_data *thread_data = x11drv_thread_data(); + UINT flags = thread_data->xinput2_rawinput ? SEND_HWMSG_NO_MSG : SEND_HWMSG_NO_RAW; XIRawEvent *event = xev->data; INPUT input; @@ -1842,7 +1853,55 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev ) if (!map_raw_event_coords( event, &input )) return FALSE; if (!(input.mi.dwFlags & MOUSEEVENTF_MOVE)) return FALSE; - NtUserSendHardwareInput( 0, 0, &input, 0 ); + NtUserSendHardwareInput( 0, flags, &input, 0 ); + return TRUE; +} + +/*********************************************************************** + * X11DRV_RawButtonEvent + */ +static BOOL X11DRV_RawButtonEvent( XGenericEventCookie *cookie ) +{ + struct x11drv_thread_data *thread_data = x11drv_thread_data(); + const UINT *button_data, *button_flags; + XIRawEvent *event = cookie->data; + int button = event->detail - 1; + INPUT input; + + if (!thread_data->xinput2_rawinput) return FALSE; + + if (!device_mapping || device_mapping->deviceid != event->sourceid) + update_device_mapping( event->display, event->sourceid ); + + if (button >= 0 && device_mapping) button = device_mapping->buttons[button] - 1; + if (button >= 0 && pointer_mapping) button = pointer_mapping->buttons[button] - 1; + + if (button < 0 || button >= NB_BUTTONS) return FALSE; + if (event->deviceid != thread_data->xinput2_pointer) return FALSE; + + TRACE( "raw button %u (raw: %u) %s\n", button, event->detail, event->evtype == XI_RawButtonRelease ? "up" : "down" ); + + if (event->evtype == XI_RawButtonRelease) + { + button_data = button_up_data; + button_flags = button_up_flags; + } + else + { + button_data = button_down_data; + button_flags = button_down_flags; + } + + input.type = INPUT_MOUSE; + input.mi.mouseData = button_data[button]; + input.mi.dwFlags = button_flags[button] | MOUSEEVENTF_MOVE; + input.mi.time = EVENT_x11_time_to_win32_time( event->time ); + input.mi.dwExtraInfo = 0; + input.mi.dx = 0; + input.mi.dy = 0; + map_raw_event_coords( event, &input ); + + NtUserSendHardwareInput( 0, SEND_HWMSG_NO_MSG, &input, 0 ); return TRUE; } @@ -1957,6 +2016,10 @@ BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *xev ) case XI_RawMotion: ret = X11DRV_RawMotion( event ); break; + case XI_RawButtonPress: + case XI_RawButtonRelease: + ret = X11DRV_RawButtonEvent( event ); + break; case XI_TouchBegin: case XI_TouchUpdate: diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 936d9b51e17a..5a75bc1e4243 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2464,6 +2464,10 @@ BOOL X11DRV_CreateWindow( HWND hwnd ) struct x11drv_thread_data *data = x11drv_init_thread_data(); XSetWindowAttributes attr; + /* listen to raw xinput event in the desktop window thread */ + data->xinput2_rawinput = TRUE; + x11drv_xinput2_enable( data->display, DefaultRootWindow( data->display ) ); + /* create the cursor clipping window */ attr.override_redirect = TRUE; attr.event_mask = StructureNotifyMask | FocusChangeMask; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 190f66e53170..244183da79a9 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -403,6 +403,7 @@ struct x11drv_thread_data XIValuatorClassInfo x_valuator; XIValuatorClassInfo y_valuator; int xinput2_pointer; /* XInput2 master pointer device id */ + int xinput2_rawinput; /* XInput2 rawinput-only thread */ #endif /* HAVE_X11_EXTENSIONS_XINPUT2_H */ }; From c91c088f4780b40929fd535b510e95085fb6b70f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 8 Mar 2024 11:11:27 +0100 Subject: [PATCH 0146/2542] winex11: Send relative RawMotion events position unprocessed. This makes relative raw input independent from cursor speed, as it is the case on Windows. Absolute raw input is already translated to virtual desktop space, and cursor speed is meaningless in this case. This does not support mixed relative/absolute X/Y axis. --- dlls/winex11.drv/mouse.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index b836ba342e16..3a134a6f048c 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -1756,13 +1756,13 @@ static BOOL X11DRV_DeviceChanged( XGenericEventCookie *xev ) return TRUE; } -static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) +static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input, BOOL send_raw ) { struct x11drv_thread_data *thread_data = x11drv_thread_data(); XIValuatorClassInfo *x = &thread_data->x_valuator, *y = &thread_data->y_valuator; + const double *values = event->valuators.values, *raw_values = event->raw_values; const UINT absolute_flags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_VIRTUALDESK; - double x_value = 0, y_value = 0, x_scale, y_scale; - const double *values = event->valuators.values; + double x_raw = 0, y_raw = 0, x_value = 0, y_value = 0, x_scale, y_scale; RECT virtual_rect; int i; @@ -1791,16 +1791,19 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) if (!XIMaskIsSet( event->valuators.mask, i )) continue; if (i == x->number) { + x_raw = *raw_values; x_value = *values; if (x->mode == XIModeRelative) x->value += x_value * x_scale; else x->value = (x_value - x->min) * x_scale; } if (i == y->number) { + y_raw = *raw_values; y_value = *values; if (y->mode == XIModeRelative) y->value += y_value * y_scale; else y->value = (y_value - y->min) * y_scale; } + raw_values++; values++; } @@ -1811,6 +1814,13 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) TRACE( "event %f,%f value %f,%f absolute input %d,%d\n", x_value, y_value, x->value, y->value, (int)input->mi.dx, (int)input->mi.dy ); } + else if (send_raw) + { + input->mi.dx = round( x_raw ); + input->mi.dy = round( y_raw ); + TRACE( "event %f,%f raw value %f,%f, raw input %d,%d\n", x_value, y_value, x_raw, y_raw, + (int)input->mi.dx, (int)input->mi.dy ); + } else if (!(input->mi.dx = round( x->value )) && !(input->mi.dy = round( y->value ))) { TRACE( "event %f,%f value %f,%f, accumulating motion\n", x_value, y_value, x->value, y->value ); @@ -1850,7 +1860,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev ) input.mi.dwExtraInfo = 0; input.mi.dx = 0; input.mi.dy = 0; - if (!map_raw_event_coords( event, &input )) return FALSE; + if (!map_raw_event_coords( event, &input, flags & SEND_HWMSG_NO_MSG )) return FALSE; if (!(input.mi.dwFlags & MOUSEEVENTF_MOVE)) return FALSE; NtUserSendHardwareInput( 0, flags, &input, 0 ); @@ -1899,7 +1909,7 @@ static BOOL X11DRV_RawButtonEvent( XGenericEventCookie *cookie ) input.mi.dwExtraInfo = 0; input.mi.dx = 0; input.mi.dy = 0; - map_raw_event_coords( event, &input ); + map_raw_event_coords( event, &input, TRUE ); NtUserSendHardwareInput( 0, SEND_HWMSG_NO_MSG, &input, 0 ); return TRUE; From 3391f160bd9558bc291fcac1145eccd30b2e0ed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 10 Mar 2023 20:51:53 +0100 Subject: [PATCH 0147/2542] user32: Add more devnotify traces on +rawinput. CW-Bug-Id: #22037 --- dlls/user32/input.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 38c44d7d831a..72314cc36868 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -31,6 +31,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(win); WINE_DECLARE_DEBUG_CHANNEL(keyboard); +WINE_DECLARE_DEBUG_CHANNEL(rawinput); /*********************************************************************** * get_locale_kbd_layout @@ -491,6 +492,7 @@ BOOL WINAPI UnloadKeyboardLayout( HKL layout ) static DWORD CALLBACK devnotify_window_callbackW(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header) { + TRACE_(rawinput)("handle %p, flags %#lx, header %p\n", handle, flags, header); SendMessageTimeoutW(handle, WM_DEVICECHANGE, flags, (LPARAM)header, SMTO_ABORTIFHUNG, 2000, NULL); return 0; } @@ -577,7 +579,7 @@ HDEVNOTIFY WINAPI RegisterDeviceNotificationW( HANDLE handle, void *filter, DWOR DEV_BROADCAST_HDR *header = filter; device_notify_callback callback; - TRACE("handle %p, filter %p, flags %#lx\n", handle, filter, flags); + TRACE_(rawinput)("handle %p, filter %p, flags %#lx\n", handle, filter, flags); if (flags & ~(DEVICE_NOTIFY_SERVICE_HANDLE | DEVICE_NOTIFY_ALL_INTERFACE_CLASSES)) { From 00112618795da3ff30d3ac0ed18f5ea33835135f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 5 Oct 2021 14:47:24 +0200 Subject: [PATCH 0148/2542] user32: Translate WM_POINTER* messages to WM_TOUCH in DefWindowProc. CW-Bug-Id: #18214 --- dlls/user32/input.c | 9 --------- dlls/user32/user32.spec | 2 +- dlls/win32u/defwnd.c | 32 ++++++++++++++++++++++++++++++++ dlls/win32u/input.c | 9 +++++++++ dlls/win32u/main.c | 5 +++++ dlls/win32u/win32u.spec | 2 +- dlls/wow64win/user.c | 8 ++++++++ include/ntuser.h | 1 + 8 files changed, 57 insertions(+), 11 deletions(-) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 72314cc36868..bdbbe687deb9 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -704,15 +704,6 @@ BOOL WINAPI GetTouchInputInfo( HTOUCHINPUT handle, UINT count, TOUCHINPUT *ptr, return FALSE; } -/********************************************************************** - * IsTouchWindow (USER32.@) - */ -BOOL WINAPI IsTouchWindow( HWND hwnd, ULONG *flags ) -{ - FIXME( "hwnd %p, flags %p stub!\n", hwnd, flags ); - return FALSE; -} - /***************************************************************************** * RegisterTouchWindow (USER32.@) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 9d3a8f7bef8c..d942ad8db687 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -798,7 +798,7 @@ # @ stub IsThreadDesktopComposited # @ stub IsThreadTSFEventAware # @ stub IsTopLevelWindow -@ stdcall IsTouchWindow(long ptr) +@ stdcall IsTouchWindow(long ptr) NtUserIsTouchWindow @ stdcall IsValidDpiAwarenessContext(long) @ stdcall IsWinEventHookInstalled(long) @ stdcall IsWindow(long) diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index b1830b71a527..7e1233a4eed7 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -30,6 +30,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(win); +#define WINE_MOUSE_HANDLE ((HANDLE)1) +#define WINE_KEYBOARD_HANDLE ((HANDLE)2) #define DRAG_FILE 0x454c4946 @@ -2955,6 +2957,36 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, 0, NtUserSendMessage, ansi ); } break; + + case WM_POINTERDOWN: + case WM_POINTERUP: + case WM_POINTERUPDATE: + { + TOUCHINPUT touchinput; + + if (!NtUserIsTouchWindow( hwnd, NULL )) return 0; + touchinput.x = LOWORD( lparam ) * 100; + touchinput.y = HIWORD( lparam ) * 100; + touchinput.hSource = WINE_MOUSE_HANDLE; + touchinput.dwID = GET_POINTERID_WPARAM( wparam ); + touchinput.dwFlags = TOUCHEVENTF_NOCOALESCE | TOUCHEVENTF_PALM; + if (msg == WM_POINTERDOWN) touchinput.dwFlags |= TOUCHEVENTF_DOWN; + if (msg == WM_POINTERUP) touchinput.dwFlags |= TOUCHEVENTF_UP; + if (msg == WM_POINTERUPDATE) touchinput.dwFlags |= TOUCHEVENTF_MOVE; + if (IS_POINTER_PRIMARY_WPARAM( wparam )) touchinput.dwFlags |= TOUCHEVENTF_PRIMARY; + touchinput.dwMask = 0; + touchinput.dwTime = NtGetTickCount(); + touchinput.dwExtraInfo = 0; + touchinput.cxContact = 0; + touchinput.cyContact = 0; + + send_message( hwnd, WM_TOUCH, MAKELONG( 1, 0 ), (LPARAM)&touchinput ); + break; + } + + case WM_TOUCH: + /* FIXME: CloseTouchInputHandle( (HTOUCHINPUT)lparam ); */ + return 0; } return result; diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 011b407f38f9..e079febdbaed 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2600,6 +2600,15 @@ BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ) return ret; } +/********************************************************************** + * NtUserIsTouchWindow (win32u.@) + */ +BOOL WINAPI NtUserIsTouchWindow( HWND hwnd, ULONG *flags ) +{ + FIXME( "hwnd %p, flags %p stub!\n", hwnd, flags ); + return FALSE; +} + /********************************************************************** * NtUserGetPointerInfoList (win32u.@) */ diff --git a/dlls/win32u/main.c b/dlls/win32u/main.c index 11628dccccaa..38497e8addf1 100644 --- a/dlls/win32u/main.c +++ b/dlls/win32u/main.c @@ -1776,6 +1776,11 @@ BOOL SYSCALL_API NtUserIsMouseInPointerEnabled(void) SYSCALL_FUNC( NtUserIsMouseInPointerEnabled ); } +BOOL SYSCALL_API NtUserIsTouchWindow( HWND hwnd, ULONG *flags ) +{ + SYSCALL_FUNC( NtUserIsTouchWindow ); +} + BOOL SYSCALL_API NtUserKillTimer( HWND hwnd, UINT_PTR id ) { SYSCALL_FUNC( NtUserKillTimer ); diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 08f27ad6671b..50098f44806c 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1173,7 +1173,7 @@ @ stub NtUserIsQueueAttached @ stub NtUserIsResizeLayoutSynchronizationEnabled @ stub NtUserIsTopLevelWindow -@ stub NtUserIsTouchWindow +@ stdcall -syscall NtUserIsTouchWindow(long ptr) @ stub NtUserIsWindowBroadcastingDpiToChildren @ stub NtUserIsWindowDisplayChangeSuppressed @ stub NtUserIsWindowGDIScaledDpiMessageEnabled diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 28944f15d077..f937825a164f 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -3233,6 +3233,14 @@ NTSTATUS WINAPI wow64_NtUserIsMouseInPointerEnabled( UINT *args ) return NtUserIsMouseInPointerEnabled(); } +NTSTATUS WINAPI wow64_NtUserIsTouchWindow( UINT *args ) +{ + HWND hwnd = get_handle( &args ); + ULONG *flags = get_ptr( &args ); + + return NtUserIsTouchWindow( hwnd, flags ); +} + NTSTATUS WINAPI wow64_NtUserKillTimer( UINT *args ) { HWND hwnd = get_handle( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index dabd7d1c92a8..fcada74e07ab 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -856,6 +856,7 @@ W32KAPI BOOL WINAPI NtUserIsClipboardFormatAvailable( UINT format ); W32KAPI BOOL WINAPI NtUserIsMouseInPointerEnabled(void); W32KAPI BOOL WINAPI NtUserInvalidateRect( HWND hwnd, const RECT *rect, BOOL erase ); W32KAPI BOOL WINAPI NtUserInvalidateRgn( HWND hwnd, HRGN hrgn, BOOL erase ); +W32KAPI BOOL WINAPI NtUserIsTouchWindow( HWND hwnd, ULONG *flags ); W32KAPI BOOL WINAPI NtUserKillTimer( HWND hwnd, UINT_PTR id ); W32KAPI BOOL WINAPI NtUserLockWindowUpdate( HWND hwnd ); W32KAPI BOOL WINAPI NtUserLogicalToPerMonitorDPIPhysicalPoint( HWND hwnd, POINT *pt ); From e55afd7e2a25cd76bd231364ca5217fa521cdedf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 22 Nov 2022 08:45:36 +0100 Subject: [PATCH 0149/2542] user32: Implement semi-stub touch input support. CW-Bug-Id: #18214 --- dlls/user32/input.c | 19 +++++++++---------- dlls/win32u/input.c | 21 +++++++++++++++++++-- dlls/win32u/ntuser_private.h | 1 + dlls/win32u/sysparams.c | 6 ++++++ dlls/win32u/win32u_private.h | 2 ++ include/ntuser.h | 2 ++ 6 files changed, 39 insertions(+), 12 deletions(-) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index bdbbe687deb9..16028f4f12a3 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -689,9 +689,8 @@ LRESULT WINAPI DefRawInputProc( RAWINPUT **data, INT data_count, UINT header_siz */ BOOL WINAPI CloseTouchInputHandle( HTOUCHINPUT handle ) { - FIXME( "handle %p stub!\n", handle ); - SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); - return FALSE; + TRACE( "handle %p.\n", handle ); + return TRUE; } /***************************************************************************** @@ -699,9 +698,9 @@ BOOL WINAPI CloseTouchInputHandle( HTOUCHINPUT handle ) */ BOOL WINAPI GetTouchInputInfo( HTOUCHINPUT handle, UINT count, TOUCHINPUT *ptr, int size ) { - FIXME( "handle %p, count %u, ptr %p, size %u stub!\n", handle, count, ptr, size ); - SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); - return FALSE; + TRACE( "handle %p, count %u, ptr %p, size %u.\n", handle, count, ptr, size ); + *ptr = *(TOUCHINPUT *)handle; + return TRUE; } /***************************************************************************** @@ -709,8 +708,8 @@ BOOL WINAPI GetTouchInputInfo( HTOUCHINPUT handle, UINT count, TOUCHINPUT *ptr, */ BOOL WINAPI RegisterTouchWindow( HWND hwnd, ULONG flags ) { - FIXME( "hwnd %p, flags %#lx stub!\n", hwnd, flags ); - return TRUE; + TRACE( "hwnd %p, flags %#lx.\n", hwnd, flags ); + return NtUserCallTwoParam( (ULONG_PTR)hwnd, flags, NtUserCallTwoParam_RegisterTouchWindow ); } /***************************************************************************** @@ -718,8 +717,8 @@ BOOL WINAPI RegisterTouchWindow( HWND hwnd, ULONG flags ) */ BOOL WINAPI UnregisterTouchWindow( HWND hwnd ) { - FIXME( "hwnd %p stub!\n", hwnd ); - return TRUE; + TRACE( "hwnd %p.\n", hwnd ); + return NtUserCallOneParam( (ULONG_PTR)hwnd, NtUserCallOneParam_UnregisterTouchWindow ); } /***************************************************************************** diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index e079febdbaed..23869a64e216 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2605,8 +2605,25 @@ BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ) */ BOOL WINAPI NtUserIsTouchWindow( HWND hwnd, ULONG *flags ) { - FIXME( "hwnd %p, flags %p stub!\n", hwnd, flags ); - return FALSE; + DWORD win_flags = win_set_flags( hwnd, 0, 0 ); + TRACE( "hwnd %p, flags %p.\n", hwnd, flags ); + return (win_flags & WIN_IS_TOUCH) != 0; +} + + +BOOL register_touch_window( HWND hwnd, UINT flags ) +{ + DWORD win_flags = win_set_flags( hwnd, WIN_IS_TOUCH, 0 ); + TRACE( "hwnd %p, flags %#x.\n", hwnd, flags ); + return (win_flags & WIN_IS_TOUCH) == 0; +} + + +BOOL unregister_touch_window( HWND hwnd ) +{ + DWORD win_flags = win_set_flags( hwnd, 0, WIN_IS_TOUCH ); + TRACE( "hwnd %p.\n", hwnd ); + return (win_flags & WIN_IS_TOUCH) != 0; } /********************************************************************** diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h index 5b2a40e8d741..2f91bab11277 100644 --- a/dlls/win32u/ntuser_private.h +++ b/dlls/win32u/ntuser_private.h @@ -93,6 +93,7 @@ typedef struct tagWND #define WIN_CHILDREN_MOVED 0x0040 /* children may have moved, ignore stored positions */ #define WIN_HAS_IME_WIN 0x0080 /* the window has been registered with imm32 */ #define WIN_IS_ACTIVATING 0x0100 /* the window is being activated */ +#define WIN_IS_TOUCH 0x0200 /* the window has been registered for touch input */ #define WND_OTHER_PROCESS ((WND *)1) /* returned by get_win_ptr on unknown window handles */ #define WND_DESKTOP ((WND *)2) /* returned by get_win_ptr on the desktop window */ diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 15c85a44e13e..27a9d2b97884 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -7066,6 +7066,9 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code ) case NtUserCallOneParam_GetAsyncKeyboardState: return get_async_keyboard_state( (void *)arg ); + case NtUserCallOneParam_UnregisterTouchWindow: + return unregister_touch_window( (HWND)arg ); + /* temporary exports */ case NtUserGetDeskPattern: return get_entry( &entry_DESKPATTERN, 256, (WCHAR *)arg ); @@ -7098,6 +7101,9 @@ ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code case NtUserCallTwoParam_MonitorFromRect: return HandleToUlong( monitor_from_rect( (const RECT *)arg1, arg2, get_thread_dpi() )); + case NtUserCallTwoParam_RegisterTouchWindow: + return register_touch_window( (HWND)arg1, arg2 ); + case NtUserCallTwoParam_SetCaretPos: return set_caret_pos( arg1, arg2 ); diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index f1e286b74e72..b1ee04577f43 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -111,6 +111,8 @@ extern BOOL get_clip_cursor( RECT *rect, UINT dpi, MONITOR_DPI_TYPE type ); extern BOOL process_wine_clipcursor( HWND hwnd, UINT flags, BOOL reset ); extern BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ); extern USHORT map_scan_to_kbd_vkey( USHORT scan, HKL layout ); +extern BOOL register_touch_window( HWND hwnd, UINT flags ); +extern BOOL unregister_touch_window( HWND hwnd ); /* menu.c */ extern HMENU create_menu( BOOL is_popup ); diff --git a/include/ntuser.h b/include/ntuser.h index fcada74e07ab..20b2ee3c1260 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -1074,6 +1074,7 @@ enum NtUserCallOneParam_SetThreadDpiAwarenessContext, NtUserCallOneParam_D3DKMTOpenAdapterFromGdiDisplayName, NtUserCallOneParam_GetAsyncKeyboardState, + NtUserCallOneParam_UnregisterTouchWindow, /* temporary exports */ NtUserGetDeskPattern, }; @@ -1217,6 +1218,7 @@ enum NtUserCallTwoParam_GetMonitorInfo, NtUserCallTwoParam_GetSystemMetricsForDpi, NtUserCallTwoParam_MonitorFromRect, + NtUserCallTwoParam_RegisterTouchWindow, NtUserCallTwoParam_SetCaretPos, NtUserCallTwoParam_SetIconParam, NtUserCallTwoParam_SetIMECompositionRect, From 895193ccf16c7529369fbaa1eb51d1755d915956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 21 May 2021 14:57:46 +0200 Subject: [PATCH 0150/2542] user32: Implement rudimentary EnableMouseInPointer support. CW-Bug-Id: 18943 Squashed with: user32: Send EnableMouseInPointer emulated messages earlier. Emulating these messages should probably be done elsewhere. CW-Bug-Id: #21331 winex11.drv: Send legacy and rawinput mouse messages on touch input. CW-Bug-Id: #18214 user32: Better emulate EnableMouseInPointer messages. This is still not very good, but it better matches what Windows does, and it fixes mouse input with Return to Monkey Island. CW-Bug-Id: #21331 --- dlls/win32u/input.c | 8 ++++--- dlls/win32u/message.c | 45 ++++++++++++++++++++++++++++++++++++ dlls/win32u/win32u_private.h | 1 + 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 23869a64e216..9f7997577f9f 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -546,6 +546,8 @@ static WCHAR kbd_tables_vkey_to_wchar( const KBDTABLES *tables, UINT vkey, const #undef NEXT_ENTRY +BOOL enable_mouse_in_pointer = FALSE; + /******************************************************************* * NtUserGetForegroundWindow (win32u.@) */ @@ -2513,9 +2515,9 @@ void toggle_caret( HWND hwnd ) */ BOOL WINAPI NtUserEnableMouseInPointer( BOOL enable ) { - FIXME( "enable %u stub!\n", enable ); - RtlSetLastWin32Error( ERROR_CALL_NOT_IMPLEMENTED ); - return FALSE; + FIXME( "enable %u semi-stub!\n", enable ); + enable_mouse_in_pointer = TRUE; + return TRUE; } /********************************************************************** diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 50c3406b5ff5..1fa55313c581 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2487,6 +2487,51 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H msg->pt = point_phys_to_win_dpi( msg->hwnd, msg->pt ); set_thread_dpi_awareness_context( get_window_dpi_awareness_context( msg->hwnd )); + if ((extra_info & 0xffffff00) != 0xff515700 && enable_mouse_in_pointer) + { + WORD flags = POINTER_MESSAGE_FLAG_PRIMARY; + DWORD message = 0; + + switch (msg->message) + { + case WM_MOUSEMOVE: + message = WM_POINTERUPDATE; + flags |= POINTER_MESSAGE_FLAG_INRANGE; + break; + case WM_LBUTTONDOWN: + case WM_RBUTTONDOWN: + case WM_MBUTTONDOWN: + case WM_XBUTTONDOWN: + message = WM_POINTERDOWN; + flags |= POINTER_MESSAGE_FLAG_INRANGE|POINTER_MESSAGE_FLAG_INCONTACT; + if (msg->message == WM_LBUTTONDOWN) flags |= POINTER_MESSAGE_FLAG_FIRSTBUTTON; + if (msg->message == WM_RBUTTONDOWN) flags |= POINTER_MESSAGE_FLAG_SECONDBUTTON; + if (msg->message == WM_MBUTTONDOWN) flags |= POINTER_MESSAGE_FLAG_THIRDBUTTON; + if (msg->message == WM_XBUTTONDOWN && LOWORD( msg->wParam ) == MK_LBUTTON) flags |= POINTER_MESSAGE_FLAG_FIRSTBUTTON; + if (msg->message == WM_XBUTTONDOWN && LOWORD( msg->wParam ) == MK_RBUTTON) flags |= POINTER_MESSAGE_FLAG_SECONDBUTTON; + if (msg->message == WM_XBUTTONDOWN && LOWORD( msg->wParam ) == MK_MBUTTON) flags |= POINTER_MESSAGE_FLAG_THIRDBUTTON; + if (msg->message == WM_XBUTTONDOWN && LOWORD( msg->wParam ) == MK_XBUTTON1) flags |= POINTER_MESSAGE_FLAG_FOURTHBUTTON; + if (msg->message == WM_XBUTTONDOWN && LOWORD( msg->wParam ) == MK_XBUTTON2) flags |= POINTER_MESSAGE_FLAG_FIFTHBUTTON; + break; + case WM_LBUTTONUP: + case WM_RBUTTONUP: + case WM_MBUTTONUP: + case WM_XBUTTONUP: + message = WM_POINTERUP; + break; + case WM_MOUSEWHEEL: + message = WM_POINTERWHEEL; + flags = HIWORD( msg->wParam ); + break; + case WM_MOUSEHWHEEL: + message = WM_POINTERHWHEEL; + flags = HIWORD( msg->wParam ); + break; + } + + if (message) send_message( msg->hwnd, message, MAKELONG( 1, flags ), MAKELONG( msg->pt.x, msg->pt.y ) ); + } + /* FIXME: is this really the right place for this hook? */ event.message = msg->message; event.time = msg->time; diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index b1ee04577f43..af9f675c5001 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -88,6 +88,7 @@ extern BOOL register_imm_window( HWND hwnd ); extern void unregister_imm_window( HWND hwnd ); /* input.c */ +extern BOOL enable_mouse_in_pointer; extern BOOL grab_pointer; extern BOOL grab_fullscreen; extern BOOL destroy_caret(void); From a119c95d7946fe16288ca713e8ec58fa58bb041a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 27 Feb 2023 23:01:03 +0100 Subject: [PATCH 0151/2542] user32: Move GetTouchInputInfo to win32u NtUserGetTouchInputInfo. CW-Bug-Id: #21796 --- dlls/user32/input.c | 10 ---------- dlls/user32/user32.spec | 2 +- dlls/win32u/input.c | 10 ++++++++++ dlls/win32u/main.c | 5 +++++ dlls/win32u/ntuser_private.h | 8 ++++++++ dlls/win32u/win32u.spec | 2 +- dlls/wow64win/user.c | 10 ++++++++++ include/ntuser.h | 1 + 8 files changed, 36 insertions(+), 12 deletions(-) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 16028f4f12a3..5f9ee0daac13 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -693,16 +693,6 @@ BOOL WINAPI CloseTouchInputHandle( HTOUCHINPUT handle ) return TRUE; } -/***************************************************************************** - * GetTouchInputInfo (USER32.@) - */ -BOOL WINAPI GetTouchInputInfo( HTOUCHINPUT handle, UINT count, TOUCHINPUT *ptr, int size ) -{ - TRACE( "handle %p, count %u, ptr %p, size %u.\n", handle, count, ptr, size ); - *ptr = *(TOUCHINPUT *)handle; - return TRUE; -} - /***************************************************************************** * RegisterTouchWindow (USER32.@) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index d942ad8db687..72f0de352395 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -686,7 +686,7 @@ @ stdcall GetTitleBarInfo(long ptr) NtUserGetTitleBarInfo # @ stub GetTopLevelWindow @ stdcall GetTopWindow(long) -@ stdcall GetTouchInputInfo(long long ptr long) +@ stdcall GetTouchInputInfo(long long ptr long) NtUserGetTouchInputInfo # @ stub GetUnpredictedMessagePos @ stdcall GetUpdateRect(long ptr long) NtUserGetUpdateRect @ stdcall GetUpdateRgn(long long long) NtUserGetUpdateRgn diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 9f7997577f9f..c66cdf9186e1 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2733,3 +2733,13 @@ BOOL WINAPI NtUserRegisterTouchPadCapable( BOOL capable ) RtlSetLastWin32Error( ERROR_CALL_NOT_IMPLEMENTED ); return FALSE; } + +/***************************************************************************** + * NtUserGetTouchInputInfo (WIN32U.@) + */ +BOOL WINAPI NtUserGetTouchInputInfo( HTOUCHINPUT handle, UINT count, TOUCHINPUT *ptr, int size ) +{ + TRACE( "handle %p, count %u, ptr %p, size %u.\n", handle, count, ptr, size ); + *ptr = *(TOUCHINPUT *)handle; + return TRUE; +} diff --git a/dlls/win32u/main.c b/dlls/win32u/main.c index 38497e8addf1..af210469a21e 100644 --- a/dlls/win32u/main.c +++ b/dlls/win32u/main.c @@ -1699,6 +1699,11 @@ BOOL SYSCALL_API NtUserGetTitleBarInfo( HWND hwnd, TITLEBARINFO *info ) SYSCALL_FUNC( NtUserGetTitleBarInfo ); } +BOOL SYSCALL_API NtUserGetTouchInputInfo( HTOUCHINPUT handle, UINT count, TOUCHINPUT *ptr, int size ) +{ + SYSCALL_FUNC( NtUserGetTouchInputInfo ); +} + BOOL SYSCALL_API NtUserGetUpdateRect( HWND hwnd, RECT *rect, BOOL erase ) { SYSCALL_FUNC( NtUserGetUpdateRect ); diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h index 2f91bab11277..b24da51a4b31 100644 --- a/dlls/win32u/ntuser_private.h +++ b/dlls/win32u/ntuser_private.h @@ -104,6 +104,13 @@ static inline BOOL is_broadcast( HWND hwnd ) return hwnd == HWND_BROADCAST || hwnd == HWND_TOPMOST; } +struct touchinput_thread_data +{ + BYTE index; /* history index */ + TOUCHINPUT current[8]; /* current touch state */ + TOUCHINPUT history[128][8]; /* touches history buffer */ +}; + /* this is the structure stored in TEB->Win32ClientInfo */ /* no attempt is made to keep the layout compatible with the Windows one */ struct user_thread_info @@ -120,6 +127,7 @@ struct user_thread_info HKL kbd_layout; /* Current keyboard layout */ UINT kbd_layout_id; /* Current keyboard layout ID */ struct hardware_msg_data *rawinput; /* Current rawinput message data */ + struct touchinput_thread_data *touchinput; /* touch input thread local buffer */ UINT spy_indent; /* Current spy indent */ BOOL clipping_cursor; /* thread is currently clipping */ DWORD clipping_reset; /* time when clipping was last reset */ diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 50098f44806c..a5a20a78381e 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1104,7 +1104,7 @@ @ stub NtUserGetThreadState @ stdcall -syscall NtUserGetTitleBarInfo(long ptr) @ stub NtUserGetTopLevelWindow -@ stub NtUserGetTouchInputInfo +@ stdcall -syscall NtUserGetTouchInputInfo(ptr long ptr long) @ stub NtUserGetTouchValidationStatus @ stub NtUserGetUniformSpaceMapping @ stub NtUserGetUnpredictedMessagePos diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index f937825a164f..b79b314217aa 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -3108,6 +3108,16 @@ NTSTATUS WINAPI wow64_NtUserGetTitleBarInfo( UINT *args ) return NtUserGetTitleBarInfo( hwnd, info ); } +NTSTATUS WINAPI wow64_NtUserGetTouchInputInfo( UINT *args ) +{ + HTOUCHINPUT handle = get_handle( &args ); + UINT count = get_ulong( &args ); + TOUCHINPUT *ptr = get_ptr( &args ); + int size = get_ulong( &args ); + + return NtUserGetTouchInputInfo( handle, count, ptr, size ); +} + NTSTATUS WINAPI wow64_NtUserGetUpdateRect( UINT *args ) { HWND hwnd = get_handle( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index 20b2ee3c1260..dec3e3502402 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -839,6 +839,7 @@ W32KAPI ULONG WINAPI NtUserGetSystemDpiForProcess( HANDLE process ); W32KAPI HMENU WINAPI NtUserGetSystemMenu( HWND hwnd, BOOL revert ); W32KAPI HDESK WINAPI NtUserGetThreadDesktop( DWORD thread ); W32KAPI BOOL WINAPI NtUserGetTitleBarInfo( HWND hwnd, TITLEBARINFO *info ); +W32KAPI BOOL WINAPI NtUserGetTouchInputInfo( HTOUCHINPUT handle, UINT count, TOUCHINPUT *ptr, int size ); W32KAPI INT WINAPI NtUserGetUpdateRgn( HWND hwnd, HRGN hrgn, BOOL erase ); W32KAPI BOOL WINAPI NtUserGetUpdatedClipboardFormats( UINT *formats, UINT size, UINT *out_size ); W32KAPI BOOL WINAPI NtUserGetUpdateRect( HWND hwnd, RECT *rect, BOOL erase ); From 917df817ed30f50b8cd0c57f4181757dc657fdb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 13 Jan 2023 10:59:12 +0100 Subject: [PATCH 0152/2542] win32u: Support multiple touches in WM_TOUCH message. CW-Bug-Id: #21796 CW-Bug-Id: #22849 --- dlls/win32u/defwnd.c | 74 ++++++++++++++++++++++++++++++++++---------- dlls/win32u/input.c | 14 ++++++++- 2 files changed, 70 insertions(+), 18 deletions(-) diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index 7e1233a4eed7..3bcc2d69c649 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -2399,6 +2399,14 @@ static LRESULT handle_nc_mouse_leave( HWND hwnd ) return 0; } +static struct touchinput_thread_data *touch_input_thread_data(void) +{ + struct user_thread_info *thread_info = get_user_thread_info(); + struct touchinput_thread_data *data = thread_info->touchinput; + + if (!data) data = thread_info->touchinput = calloc( 1, sizeof(struct touchinput_thread_data) ); + return data; +} LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL ansi ) { @@ -2962,25 +2970,57 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, case WM_POINTERUP: case WM_POINTERUPDATE: { - TOUCHINPUT touchinput; + TOUCHINPUT *touches, *end, *touch, *match = NULL; + struct touchinput_thread_data *thread_data; + UINT i; if (!NtUserIsTouchWindow( hwnd, NULL )) return 0; - touchinput.x = LOWORD( lparam ) * 100; - touchinput.y = HIWORD( lparam ) * 100; - touchinput.hSource = WINE_MOUSE_HANDLE; - touchinput.dwID = GET_POINTERID_WPARAM( wparam ); - touchinput.dwFlags = TOUCHEVENTF_NOCOALESCE | TOUCHEVENTF_PALM; - if (msg == WM_POINTERDOWN) touchinput.dwFlags |= TOUCHEVENTF_DOWN; - if (msg == WM_POINTERUP) touchinput.dwFlags |= TOUCHEVENTF_UP; - if (msg == WM_POINTERUPDATE) touchinput.dwFlags |= TOUCHEVENTF_MOVE; - if (IS_POINTER_PRIMARY_WPARAM( wparam )) touchinput.dwFlags |= TOUCHEVENTF_PRIMARY; - touchinput.dwMask = 0; - touchinput.dwTime = NtGetTickCount(); - touchinput.dwExtraInfo = 0; - touchinput.cxContact = 0; - touchinput.cyContact = 0; - - send_message( hwnd, WM_TOUCH, MAKELONG( 1, 0 ), (LPARAM)&touchinput ); + if (!(thread_data = touch_input_thread_data())) return 0; + + touches = thread_data->current; + end = touches + ARRAY_SIZE(thread_data->current); + for (touch = touches; touch < end && touch->dwID; touch++) + { + if (touch->dwID == GET_POINTERID_WPARAM( wparam )) match = touch; + touch->dwFlags &= ~TOUCHEVENTF_DOWN; + touch->dwFlags |= TOUCHEVENTF_MOVE; + } + if (match) touch = match; + + if (touch == end || (msg != WM_POINTERDOWN && !touch->dwID)) + { + if (msg != WM_POINTERDOWN) FIXME("Touch point not found!\n"); + else FIXME("Unsupported number of touch points!\n"); + break; + } + + while (end > (touch + 1) && !(end - 1)->dwID) end--; + + touch->x = LOWORD( lparam ) * 100; + touch->y = HIWORD( lparam ) * 100; + touch->hSource = WINE_MOUSE_HANDLE; + touch->dwID = GET_POINTERID_WPARAM( wparam ); + touch->dwFlags = 0; + if (msg == WM_POINTERUP) touch->dwFlags |= TOUCHEVENTF_UP; + if (msg == WM_POINTERDOWN) touch->dwFlags |= TOUCHEVENTF_INRANGE | TOUCHEVENTF_DOWN; + if (msg == WM_POINTERUPDATE) touch->dwFlags |= TOUCHEVENTF_INRANGE | TOUCHEVENTF_MOVE; + if (IS_POINTER_PRIMARY_WPARAM( wparam )) touch->dwFlags |= TOUCHEVENTF_PRIMARY; + touch->dwMask = 0; + touch->dwTime = NtGetTickCount(); + touch->dwExtraInfo = 0; + touch->cxContact = 0; + touch->cyContact = 0; + + i = thread_data->index++ % ARRAY_SIZE(thread_data->history); + memcpy( thread_data->history + i, thread_data->current, sizeof(thread_data->current) ); + + send_message( hwnd, WM_TOUCH, MAKELONG(end - touches, 0), (LPARAM)i ); + + if (msg == WM_POINTERUP) + { + while (++touch < end) *(touch - 1) = *touch; + memset( touch - 1, 0, sizeof(*touch) ); + } break; } diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index c66cdf9186e1..60595f2eb45b 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2739,7 +2739,19 @@ BOOL WINAPI NtUserRegisterTouchPadCapable( BOOL capable ) */ BOOL WINAPI NtUserGetTouchInputInfo( HTOUCHINPUT handle, UINT count, TOUCHINPUT *ptr, int size ) { + struct user_thread_info *thread_info = get_user_thread_info(); + struct touchinput_thread_data *thread_data; + UINT index = (ULONG_PTR)handle; + TRACE( "handle %p, count %u, ptr %p, size %u.\n", handle, count, ptr, size ); - *ptr = *(TOUCHINPUT *)handle; + + if (!thread_info || !(thread_data = thread_info->touchinput) || size != sizeof(TOUCHINPUT) || + index >= ARRAY_SIZE(thread_data->history)) + { + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); + return FALSE; + } + + memcpy( ptr, thread_data->history + index, min( count, ARRAY_SIZE(thread_data->current) ) * size ); return TRUE; } From 486f317d32b581bf761af885fca49cd607364536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 8 Aug 2023 17:55:31 +0200 Subject: [PATCH 0153/2542] imm32: Return success from WM_IME_CONTROL. CW-Bug-Id: #22569 --- dlls/imm32/ime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/imm32/ime.c b/dlls/imm32/ime.c index 24270e89291a..6f1d68ad0d4f 100644 --- a/dlls/imm32/ime.c +++ b/dlls/imm32/ime.c @@ -433,7 +433,7 @@ static LRESULT WINAPI ime_ui_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LP case WM_IME_CONTROL: FIXME( "hwnd %p, himc %p, msg %s, wparam %s, lparam %#Ix stub!\n", hwnd, himc, debugstr_wm_ime(msg), debugstr_imc(wparam), lparam ); - return 1; + return 0; } return DefWindowProcW( hwnd, msg, wparam, lparam ); From 161ae4d374152cc8067c0e10d33d9698b8fc657c Mon Sep 17 00:00:00 2001 From: Etaash Mathamsetty Date: Mon, 16 Oct 2023 15:33:54 -0400 Subject: [PATCH 0154/2542] winex11.drv: Ensure initialized thread data in X11DRV_get_ic. Link: https://github.com/ValveSoftware/wine/pull/201 --- dlls/winex11.drv/xim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index acbe1c3aac1f..f09067f232e0 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -473,7 +473,7 @@ XIC X11DRV_get_ic( HWND hwnd ) XIC ret; if (!(data = get_win_data( hwnd ))) return 0; - x11drv_thread_data()->last_xic_hwnd = hwnd; + x11drv_init_thread_data()->last_xic_hwnd = hwnd; if (!(ret = data->xic) && (xim = x11drv_thread_data()->xim)) ret = data->xic = xic_create( xim, hwnd, data->whole_window ); release_win_data( data ); From aee5164d57d20efeb3f543cbaf3a5087ee16bba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 16 Jun 2021 17:36:15 +0200 Subject: [PATCH 0155/2542] devenum: Register IEEE float for Direct Sound default device. Fixes some music does not play in Planet Coaster. CW-Bug-Id: #18986 --- dlls/devenum/createdevenum.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dlls/devenum/createdevenum.c b/dlls/devenum/createdevenum.c index bc91b2358047..16a2dcc565b0 100644 --- a/dlls/devenum/createdevenum.c +++ b/dlls/devenum/createdevenum.c @@ -473,7 +473,7 @@ static BOOL CALLBACK register_dsound_devices(GUID *guid, const WCHAR *desc, cons static const WCHAR defaultW[] = L"Default DirectSound Device"; IPropertyBag *prop_bag = NULL; REGFILTERPINS2 rgpins = {0}; - REGPINTYPES rgtypes = {0}; + REGPINTYPES rgtypes[2] = {}; REGFILTER2 rgf = {0}; WCHAR clsid[CHARS_IN_GUID]; VARIANT var; @@ -504,10 +504,12 @@ static BOOL CALLBACK register_dsound_devices(GUID *guid, const WCHAR *desc, cons rgf.rgPins2 = &rgpins; rgpins.dwFlags = REG_PINFLAG_B_RENDERER; /* FIXME: native registers many more formats */ - rgpins.nMediaTypes = 1; - rgpins.lpMediaType = &rgtypes; - rgtypes.clsMajorType = &MEDIATYPE_Audio; - rgtypes.clsMinorType = &MEDIASUBTYPE_PCM; + rgpins.nMediaTypes = 2; + rgpins.lpMediaType = rgtypes; + rgtypes[0].clsMajorType = &MEDIATYPE_Audio; + rgtypes[0].clsMinorType = &MEDIASUBTYPE_PCM; + rgtypes[1].clsMajorType = &MEDIATYPE_Audio; + rgtypes[1].clsMinorType = &MEDIASUBTYPE_IEEE_FLOAT; write_filter_data(prop_bag, &rgf); From ea088a06758354efa10500fc996dd729f2ed00a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 15 Dec 2022 23:28:52 +0100 Subject: [PATCH 0156/2542] dsound: Initialize primary buffer with device's channel layout Fixes surround sound in some games, like Borderlands GOTY and Dead Space. --- dlls/dsound/dsound.c | 77 +----------------------------------- dlls/dsound/dsound_private.h | 1 - dlls/dsound/primary.c | 75 ++++++++++++++++++++++++++++++++++- 3 files changed, 76 insertions(+), 77 deletions(-) diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c index 7629810db505..e548cbbd5b1b 100644 --- a/dlls/dsound/dsound.c +++ b/dlls/dsound/dsound.c @@ -23,7 +23,6 @@ #include #include #include -#include #define COBJMACROS @@ -137,9 +136,9 @@ static HRESULT DirectSoundDevice_Create(DirectSoundDevice ** ppDevice) device->ref = 1; device->priolevel = DSSCL_NORMAL; device->stopped = 1; - device->speaker_config = DSSPEAKER_COMBINED(DSSPEAKER_STEREO, DSSPEAKER_GEOMETRY_WIDE); - DSOUND_ParseSpeakerConfig(device); + device->speaker_config = 0; + device->num_speakers = 0; /* 3D listener initial parameters */ device->ds3dl.dwSize = sizeof(DS3DLISTENER); @@ -1128,75 +1127,3 @@ HRESULT WINAPI DirectSoundCreate8( return hr; } - -void DSOUND_ParseSpeakerConfig(DirectSoundDevice *device) -{ - switch (DSSPEAKER_CONFIG(device->speaker_config)) { - case DSSPEAKER_MONO: - device->speaker_angles[0] = M_PI/180.0f * 0.0f; - device->speaker_num[0] = 0; - device->num_speakers = 1; - device->lfe_channel = -1; - break; - - case DSSPEAKER_STEREO: - case DSSPEAKER_HEADPHONE: - device->speaker_angles[0] = M_PI/180.0f * -90.0f; - device->speaker_angles[1] = M_PI/180.0f * 90.0f; - device->speaker_num[0] = 0; /* Left */ - device->speaker_num[1] = 1; /* Right */ - device->num_speakers = 2; - device->lfe_channel = -1; - break; - - case DSSPEAKER_QUAD: - device->speaker_angles[0] = M_PI/180.0f * -135.0f; - device->speaker_angles[1] = M_PI/180.0f * -45.0f; - device->speaker_angles[2] = M_PI/180.0f * 45.0f; - device->speaker_angles[3] = M_PI/180.0f * 135.0f; - device->speaker_num[0] = 2; /* Rear left */ - device->speaker_num[1] = 0; /* Front left */ - device->speaker_num[2] = 1; /* Front right */ - device->speaker_num[3] = 3; /* Rear right */ - device->num_speakers = 4; - device->lfe_channel = -1; - break; - - case DSSPEAKER_5POINT1_BACK: - device->speaker_angles[0] = M_PI/180.0f * -135.0f; - device->speaker_angles[1] = M_PI/180.0f * -45.0f; - device->speaker_angles[2] = M_PI/180.0f * 0.0f; - device->speaker_angles[3] = M_PI/180.0f * 45.0f; - device->speaker_angles[4] = M_PI/180.0f * 135.0f; - device->speaker_angles[5] = 9999.0f; - device->speaker_num[0] = 4; /* Rear left */ - device->speaker_num[1] = 0; /* Front left */ - device->speaker_num[2] = 2; /* Front centre */ - device->speaker_num[3] = 1; /* Front right */ - device->speaker_num[4] = 5; /* Rear right */ - device->speaker_num[5] = 3; /* LFE */ - device->num_speakers = 6; - device->lfe_channel = 3; - break; - - case DSSPEAKER_5POINT1_SURROUND: - device->speaker_angles[0] = M_PI/180.0f * -90.0f; - device->speaker_angles[1] = M_PI/180.0f * -30.0f; - device->speaker_angles[2] = M_PI/180.0f * 0.0f; - device->speaker_angles[3] = M_PI/180.0f * 30.0f; - device->speaker_angles[4] = M_PI/180.0f * 90.0f; - device->speaker_angles[5] = 9999.0f; - device->speaker_num[0] = 4; /* Rear left */ - device->speaker_num[1] = 0; /* Front left */ - device->speaker_num[2] = 2; /* Front centre */ - device->speaker_num[3] = 1; /* Front right */ - device->speaker_num[4] = 5; /* Rear right */ - device->speaker_num[5] = 3; /* LFE */ - device->num_speakers = 6; - device->lfe_channel = 3; - break; - - default: - WARN("unknown speaker_config %lu\n", device->speaker_config); - } -} diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index 28bba6cd64ec..6b9fbfd6048c 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -209,7 +209,6 @@ HRESULT IKsPrivatePropertySetImpl_Create(REFIID riid, void **ppv); HRESULT DSOUND_Create(REFIID riid, void **ppv); HRESULT DSOUND_Create8(REFIID riid, void **ppv); HRESULT IDirectSoundImpl_Create(IUnknown *outer_unk, REFIID riid, void **ppv, BOOL has_ds8); -void DSOUND_ParseSpeakerConfig(DirectSoundDevice *device); /* primary.c */ diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c index 2073a32240cd..c9b5a08cf5ef 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c @@ -24,6 +24,7 @@ */ #include +#include #define COBJMACROS #include "windef.h" @@ -107,6 +108,78 @@ static DWORD DSOUND_FindSpeakerConfig(IMMDevice *mmdevice, int channels) return def; } +static void DSOUND_ParseSpeakerConfig(DirectSoundDevice *device) +{ + switch (DSSPEAKER_CONFIG(device->speaker_config)) { + case DSSPEAKER_MONO: + device->speaker_angles[0] = M_PI/180.0f * 0.0f; + device->speaker_num[0] = 0; + device->num_speakers = 1; + device->lfe_channel = -1; + break; + + case DSSPEAKER_STEREO: + case DSSPEAKER_HEADPHONE: + device->speaker_angles[0] = M_PI/180.0f * -90.0f; + device->speaker_angles[1] = M_PI/180.0f * 90.0f; + device->speaker_num[0] = 0; /* Left */ + device->speaker_num[1] = 1; /* Right */ + device->num_speakers = 2; + device->lfe_channel = -1; + break; + + case DSSPEAKER_QUAD: + device->speaker_angles[0] = M_PI/180.0f * -135.0f; + device->speaker_angles[1] = M_PI/180.0f * -45.0f; + device->speaker_angles[2] = M_PI/180.0f * 45.0f; + device->speaker_angles[3] = M_PI/180.0f * 135.0f; + device->speaker_num[0] = 2; /* Rear left */ + device->speaker_num[1] = 0; /* Front left */ + device->speaker_num[2] = 1; /* Front right */ + device->speaker_num[3] = 3; /* Rear right */ + device->num_speakers = 4; + device->lfe_channel = -1; + break; + + case DSSPEAKER_5POINT1_BACK: + device->speaker_angles[0] = M_PI/180.0f * -135.0f; + device->speaker_angles[1] = M_PI/180.0f * -45.0f; + device->speaker_angles[2] = M_PI/180.0f * 0.0f; + device->speaker_angles[3] = M_PI/180.0f * 45.0f; + device->speaker_angles[4] = M_PI/180.0f * 135.0f; + device->speaker_angles[5] = 9999.0f; + device->speaker_num[0] = 4; /* Rear left */ + device->speaker_num[1] = 0; /* Front left */ + device->speaker_num[2] = 2; /* Front centre */ + device->speaker_num[3] = 1; /* Front right */ + device->speaker_num[4] = 5; /* Rear right */ + device->speaker_num[5] = 3; /* LFE */ + device->num_speakers = 6; + device->lfe_channel = 3; + break; + + case DSSPEAKER_5POINT1_SURROUND: + device->speaker_angles[0] = M_PI/180.0f * -90.0f; + device->speaker_angles[1] = M_PI/180.0f * -30.0f; + device->speaker_angles[2] = M_PI/180.0f * 0.0f; + device->speaker_angles[3] = M_PI/180.0f * 30.0f; + device->speaker_angles[4] = M_PI/180.0f * 90.0f; + device->speaker_angles[5] = 9999.0f; + device->speaker_num[0] = 4; /* Rear left */ + device->speaker_num[1] = 0; /* Front left */ + device->speaker_num[2] = 2; /* Front centre */ + device->speaker_num[3] = 1; /* Front right */ + device->speaker_num[4] = 5; /* Rear right */ + device->speaker_num[5] = 3; /* LFE */ + device->num_speakers = 6; + device->lfe_channel = 3; + break; + + default: + WARN("unknown speaker_config %lu\n", device->speaker_config); + } +} + static HRESULT DSOUND_WaveFormat(DirectSoundDevice *device, IAudioClient *client, BOOL forcewave, WAVEFORMATEX **wfx) { @@ -121,7 +194,7 @@ static HRESULT DSOUND_WaveFormat(DirectSoundDevice *device, IAudioClient *client if (FAILED(hr)) return hr; - if (mixwfe->Format.nChannels < device->num_speakers) { + if (device->num_speakers == 0 || mixwfe->Format.nChannels < device->num_speakers) { device->speaker_config = DSOUND_FindSpeakerConfig(device->mmdevice, mixwfe->Format.nChannels); DSOUND_ParseSpeakerConfig(device); } else if (mixwfe->Format.nChannels > device->num_speakers) { From e55610334ccb5e215871e2e2e7d652716d442eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 5 Apr 2023 12:38:11 +0200 Subject: [PATCH 0157/2542] ddraw: Remove topmost from the previous window when releasing exclusive cooperative level. Fixes The Binding of Isaac staying topmost, regression after upstream commit e44afcd8bf17eb628fcb1ea0b012970b6e611da4. Note: this is possibly a hack and maybe we should use exclusive_window instead, but it is cleared when focus is lost in device_parent_activate, and removing topmost there as well is a bigger, riskier change. CW-Bug-Id: #22108 --- dlls/ddraw/ddraw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index ed342bfd7084..214befa9aa0e 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -973,7 +973,7 @@ static HRESULT ddraw_set_cooperative_level(struct ddraw *ddraw, HWND window, topmost bit unless the DDSCL_NOWINDOWCHANGES flag is set in this call that sets it to normal, not in the old coop level. */ if (!(cooplevel & DDSCL_NOWINDOWCHANGES)) - SetWindowPos(window, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); + SetWindowPos(ddraw->dest_window, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); if (restore_mode_on_normal && FAILED(ddraw7_RestoreDisplayMode(&ddraw->IDirectDraw7_iface))) ERR("RestoreDisplayMode failed\n"); From 658284f76fc3e1201a2c51cb434877ee6473d1bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 31 Jan 2024 17:30:20 +0100 Subject: [PATCH 0158/2542] explorer: Create the standalone systray window with WS_EX_NOACTIVATE. CW-Bug-Id: #23341 --- programs/explorer/systray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index fcbceb6fda4d..02fe50787063 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -1253,7 +1253,7 @@ void initialize_systray( BOOL arg_using_root, BOOL arg_enable_shell, BOOL arg_sh else { SIZE size = get_window_size(); - tray_window = CreateWindowExW( 0, shell_traywnd_class.lpszClassName, L"", WS_CAPTION | WS_SYSMENU, + tray_window = CreateWindowExW( WS_EX_NOACTIVATE, shell_traywnd_class.lpszClassName, L"", WS_CAPTION | WS_SYSMENU, CW_USEDEFAULT, CW_USEDEFAULT, size.cx, size.cy, 0, 0, 0, 0 ); NtUserMessageCall( tray_window, WINE_SYSTRAY_DOCK_INIT, 0, 0, NULL, NtUserSystemTrayCall, FALSE ); } From 2a49840caaa97016cafe8645c0e156f2e177dd45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 21 Jan 2020 21:05:05 +0100 Subject: [PATCH 0159/2542] winex11.drv: Ignore ClipCursor if desktop window is foreground. CW-Bug-Id: #21879 --- dlls/win32u/input.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 60595f2eb45b..b6cd1c53eb9f 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2701,6 +2701,12 @@ BOOL WINAPI NtUserClipCursor( const RECT *rect ) TRACE( "Clipping to %s\n", wine_dbgstr_rect(rect) ); + if (NtUserGetForegroundWindow() == NtUserGetDesktopWindow()) + { + WARN( "desktop is foreground, ignoring ClipCursor\n" ); + rect = NULL; + } + if (rect) { if (rect->left > rect->right || rect->top > rect->bottom) return FALSE; From afbe9f3dc416a9fb0a36138737e581c136d3cf8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 19 Sep 2019 15:42:09 +0200 Subject: [PATCH 0160/2542] winex11.drv: Wait for pointer grab on FocusIn/WM_TAKE_FOCUS events. The FocusIn/WM_TAKE_FOCUS events are received as soon as a window is clicked, but when some modifier key is pressed or when the click is on the window frame, the WM may still be controlling the window size or position. It usually grabs the cursor while doing so - and if not then there's apparently nothing we can do. When using undecorated mode we handle this case "correctly" by going through the corresponding Windows non-client message loop until mouse buttons are released, but when using decorated windows the window decoration is empty from the Wine perspective and any window event is considered as happening in the client area. This leads to some issues when the window is moved or resized, with applications applying clipping rectangles immediately and not updating it on subsequent window move/resize messages. Delaying the WM_ACTIVATE until the WM releases its grab and the window move is complete helps solving this situation. This delay is implemented here by resending the FocusIn/WM_TAKE_FOCUS events to the window until the cursor can be grabbed and then processing them normally. winex11.drv: Fix focus delay issues with desktop clipping. CW-Bug-Id: #21879 --- dlls/winex11.drv/event.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 19f39d7d1dd4..78a087244e2a 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -322,6 +322,27 @@ static Bool filter_event( Display *display, XEvent *event, char *arg ) } } +static void wait_grab_pointer( Display *display ) +{ + RECT rect; + + /* release cursor grab held by any Wine process */ + NtUserGetClipCursor( &rect ); + NtUserClipCursor( NULL ); + + while (XGrabPointer( display, root_window, False, 0, GrabModeAsync, GrabModeAsync, + None, None, CurrentTime ) != GrabSuccess) + { + LARGE_INTEGER timeout = {.QuadPart = -10 * (ULONGLONG)10000}; + NtDelayExecution( FALSE, &timeout ); + } + + XUngrabPointer( display, CurrentTime ); + XFlush( display ); + + /* restore the previously used clipping rect */ + NtUserClipCursor( &rect ); +} enum event_merge_action { @@ -658,6 +679,8 @@ static void set_focus( Display *display, HWND hwnd, Time time ) Window win; GUITHREADINFO threadinfo; + wait_grab_pointer( display ); + TRACE( "setting foreground window to %p\n", hwnd ); NtUserSetForegroundWindow( hwnd ); From d1ad817d7d63e842310cdcab67e0aae296548e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 17 Dec 2019 16:58:07 +0100 Subject: [PATCH 0161/2542] Revert "winex11.drv: Only call XWarpPointer if we can get exclusive pointer grab." This reverts commit 74efb3e872aebf57a42d62b52e149ae26f320c9a. We are now only activating windows only once the window manager has released its grab, it should be safer to let them move the pointer around and this should not be needed anymore. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47771 CW-Bug-Id: #21879 --- dlls/winex11.drv/mouse.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 3a134a6f048c..c5115fd87d3d 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -1486,21 +1486,8 @@ BOOL X11DRV_SetCursorPos( INT x, INT y ) return FALSE; } - if (!clipping_cursor && - XGrabPointer( data->display, root_window, False, - PointerMotionMask | ButtonPressMask | ButtonReleaseMask, - GrabModeAsync, GrabModeAsync, None, None, CurrentTime ) != GrabSuccess) - { - WARN( "refusing to warp pointer to %u, %u without exclusive grab\n", (int)pos.x, (int)pos.y ); - return FALSE; - } - XWarpPointer( data->display, root_window, root_window, 0, 0, 0, 0, pos.x, pos.y ); data->warp_serial = NextRequest( data->display ); - - if (!clipping_cursor) - XUngrabPointer( data->display, CurrentTime ); - XNoOp( data->display ); XFlush( data->display ); /* avoids bad mouse lag in games that do their own mouse warping */ TRACE( "warped to %d,%d serial %lu\n", x, y, data->warp_serial ); From 2d2b882f65f6dab1f55b88fdf948c6cbfeb2f0b1 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Mon, 15 Mar 2021 12:01:25 -0500 Subject: [PATCH 0162/2542] winex11.drv: Flush X connection after ungrabbing the pointer. CW-Bug-Id: #18169 CW-Bug-Id: #21879 --- dlls/winex11.drv/mouse.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index c5115fd87d3d..69f6e6d922c6 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -546,7 +546,11 @@ void ungrab_clipping_window(void) TRACE( "no longer clipping\n" ); XUnmapWindow( data->display, clip_window ); - if (clipping_cursor) XUngrabPointer( data->display, CurrentTime ); + if (clipping_cursor) + { + XUngrabPointer( data->display, CurrentTime ); + XFlush( data->display ); + } clipping_cursor = FALSE; data->clipping_cursor = FALSE; x11drv_xinput2_disable( data->display, DefaultRootWindow( data->display ) ); From 119f47c62986aeff9733a2e36847c4c8109732e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 9 Dec 2019 20:28:20 +0100 Subject: [PATCH 0163/2542] HACK: mutter: winex11.drv: Add a bit of delay before restoring mouse grabs on FocusIn. CW-Bug-Id: #21879 --- dlls/winex11.drv/event.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 78a087244e2a..bb339bce68fa 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -893,6 +893,17 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev ) if (is_virtual_desktop() && hwnd == NtUserGetDesktopWindow()) reapply_cursor_clipping(); if (hwnd == NtUserGetDesktopWindow()) return FALSE; + /* Focus was just restored but it can be right after super was + * pressed and gnome-shell needs a bit of time to respond and + * toggle the activity view. If we grab the cursor right away + * it will cancel it and super key will do nothing. + */ + if (event->mode == NotifyUngrab && X11DRV_HasWindowManager( "Mutter" )) + { + LARGE_INTEGER timeout = {.QuadPart = 100 * -10000}; + NtDelayExecution( FALSE, &timeout ); + } + x11drv_thread_data()->keymapnotify_hwnd = hwnd; /* when keyboard grab is released, re-apply the cursor clipping rect */ From 09f3708f11d7fd8e3e614c2ef4fad220923404a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 26 Jun 2023 10:37:59 +0200 Subject: [PATCH 0164/2542] win32u: Keep the clipping rectangle inside a fullscreen window. CW-Bug-Id: #21707 --- dlls/win32u/input.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index b6cd1c53eb9f..379023b5f3d3 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2696,12 +2696,14 @@ BOOL process_wine_clipcursor( HWND hwnd, UINT flags, BOOL reset ) */ BOOL WINAPI NtUserClipCursor( const RECT *rect ) { - RECT new_rect; + static int keep_inside_window = -1; + HWND foreground = NtUserGetForegroundWindow(); + RECT new_rect, full_rect; BOOL ret; TRACE( "Clipping to %s\n", wine_dbgstr_rect(rect) ); - if (NtUserGetForegroundWindow() == NtUserGetDesktopWindow()) + if (foreground == NtUserGetDesktopWindow()) { WARN( "desktop is foreground, ignoring ClipCursor\n" ); rect = NULL; @@ -2710,6 +2712,24 @@ BOOL WINAPI NtUserClipCursor( const RECT *rect ) if (rect) { if (rect->left > rect->right || rect->top > rect->bottom) return FALSE; + + if (keep_inside_window == -1) + { + const char *sgi = getenv( "SteamGameId" ); + keep_inside_window = sgi && !strcmp( sgi, "730830" ); /* Escape from Monkey Island */ + } + + /* keep the mouse clipped inside of a fullscreen foreground window */ + if (keep_inside_window && NtUserGetWindowRect( foreground, &full_rect, get_thread_dpi() ) && + is_window_rect_full_screen( &full_rect, get_thread_dpi() )) + { + full_rect.left = max( full_rect.left, min( full_rect.right - 1, rect->left ) ); + full_rect.right = max( full_rect.left, min( full_rect.right - 1, rect->right ) ); + full_rect.top = max( full_rect.top, min( full_rect.bottom - 1, rect->top ) ); + full_rect.bottom = max( full_rect.top, min( full_rect.bottom - 1, rect->bottom ) ); + rect = &full_rect; + } + new_rect = map_rect_virt_to_raw( *rect, get_thread_dpi() ); rect = &new_rect; } From 3af0b571ee44e12f194443a360bd8d5782b7d040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 12 Mar 2021 00:10:49 +0100 Subject: [PATCH 0165/2542] winex11.drv: Move Xfixes extension query to process_attach. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45277 CW-Bug-Id: 16608 --- dlls/winex11.drv/clipboard.c | 26 ++------------ dlls/winex11.drv/x11drv.h | 2 ++ dlls/winex11.drv/x11drv_main.c | 63 ++++++++++++++++++++++++++++++++++ dlls/winex11.drv/xfixes.h | 36 +++++++++++++++++++ 4 files changed, 103 insertions(+), 24 deletions(-) create mode 100644 dlls/winex11.drv/xfixes.h diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index 04b346603315..d2dcb03f8c21 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -83,6 +83,7 @@ #include "ntstatus.h" #define WIN32_NO_STATUS #include "x11drv.h" +#include "xfixes.h" #ifdef HAVE_X11_EXTENSIONS_XFIXES_H #include @@ -199,7 +200,6 @@ static UINT rendered_formats; static ULONG last_clipboard_update; static struct clipboard_format **current_x11_formats; static unsigned int nb_current_x11_formats; -static BOOL use_xfixes; Display *clipboard_display = NULL; @@ -2170,28 +2170,6 @@ static BOOL selection_notify_event( HWND hwnd, XEvent *event ) static void xfixes_init(void) { #ifdef SONAME_LIBXFIXES - typeof(XFixesSelectSelectionInput) *pXFixesSelectSelectionInput; - typeof(XFixesQueryExtension) *pXFixesQueryExtension; - typeof(XFixesQueryVersion) *pXFixesQueryVersion; - - int event_base, error_base; - int major = 3, minor = 0; - void *handle; - - handle = dlopen(SONAME_LIBXFIXES, RTLD_NOW); - if (!handle) return; - - pXFixesQueryExtension = dlsym(handle, "XFixesQueryExtension"); - if (!pXFixesQueryExtension) return; - pXFixesQueryVersion = dlsym(handle, "XFixesQueryVersion"); - if (!pXFixesQueryVersion) return; - pXFixesSelectSelectionInput = dlsym(handle, "XFixesSelectSelectionInput"); - if (!pXFixesSelectSelectionInput) return; - - if (!pXFixesQueryExtension(clipboard_display, &event_base, &error_base)) - return; - pXFixesQueryVersion(clipboard_display, &major, &minor); - use_xfixes = (major >= 1); if (!use_xfixes) return; pXFixesSelectSelectionInput(clipboard_display, import_window, x11drv_atom(CLIPBOARD), @@ -2205,7 +2183,7 @@ static void xfixes_init(void) XFixesSelectionWindowDestroyNotifyMask | XFixesSelectionClientCloseNotifyMask); } - X11DRV_register_event_handler(event_base + XFixesSelectionNotify, + X11DRV_register_event_handler(xfixes_event_base + XFixesSelectionNotify, selection_notify_event, "XFixesSelectionNotify"); TRACE("xfixes succesully initialized\n"); #else diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 244183da79a9..56d08616c6b5 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -450,12 +450,14 @@ extern BOOL use_primary_selection; extern BOOL use_system_cursors; extern BOOL grab_fullscreen; extern BOOL usexcomposite; +extern BOOL use_xfixes; extern BOOL managed_mode; extern BOOL private_color_map; extern int primary_monitor; extern int copy_default_colors; extern int alloc_system_colors; extern int xrender_error_base; +extern int xfixes_event_base; extern char *process_name; extern Display *clipboard_display; extern HANDLE steam_overlay_event; diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 36b506f94395..0be4d12c17a8 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -47,6 +47,7 @@ #include "x11drv.h" #include "winreg.h" #include "xcomposite.h" +#include "xfixes.h" #include "wine/server.h" #include "wine/debug.h" #include "wine/list.h" @@ -68,6 +69,7 @@ Window root_window; BOOL usexvidmode = TRUE; BOOL usexrandr = TRUE; BOOL usexcomposite = TRUE; +BOOL use_xfixes = FALSE; BOOL use_take_focus = TRUE; BOOL use_primary_selection = FALSE; BOOL use_system_cursors = TRUE; @@ -81,6 +83,7 @@ BOOL shape_layered_windows = TRUE; int copy_default_colors = 128; int alloc_system_colors = 256; int xrender_error_base = 0; +int xfixes_event_base = 0; char *process_name = NULL; HANDLE steam_overlay_event; @@ -565,6 +568,63 @@ static void X11DRV_XComposite_Init(void) } #endif /* defined(SONAME_LIBXCOMPOSITE) */ +#ifdef SONAME_LIBXFIXES + +#define MAKE_FUNCPTR(f) typeof(f) * p##f; +MAKE_FUNCPTR(XFixesQueryExtension) +MAKE_FUNCPTR(XFixesQueryVersion) +MAKE_FUNCPTR(XFixesCreateRegion) +MAKE_FUNCPTR(XFixesCreateRegionFromGC) +MAKE_FUNCPTR(XFixesSelectSelectionInput) +#undef MAKE_FUNCPTR + +static void x11drv_load_xfixes(void) +{ + int event, error, major = 3, minor = 0; + void *xfixes; + + if (!(xfixes = dlopen(SONAME_LIBXFIXES, RTLD_NOW))) + { + WARN("Xfixes library %s not found, disabled.\n", SONAME_LIBXFIXES); + return; + } + +#define LOAD_FUNCPTR(f) \ + if (!(p##f = dlsym(xfixes, #f))) \ + { \ + WARN("Xfixes function %s not found, disabled\n", #f); \ + dlclose(xfixes); \ + return; \ + } + LOAD_FUNCPTR(XFixesQueryExtension) + LOAD_FUNCPTR(XFixesQueryVersion) + LOAD_FUNCPTR(XFixesCreateRegion) + LOAD_FUNCPTR(XFixesCreateRegionFromGC) + LOAD_FUNCPTR(XFixesSelectSelectionInput) +#undef LOAD_FUNCPTR + + if (!pXFixesQueryExtension(gdi_display, &event, &error)) + { + WARN("Xfixes extension not found, disabled.\n"); + dlclose(xfixes); + return; + } + + if (!pXFixesQueryVersion(gdi_display, &major, &minor) || + major < 2) + { + WARN("Xfixes version 2.0 not found, disabled.\n"); + dlclose(xfixes); + return; + } + + TRACE("Xfixes, error %d, event %d, version %d.%d found\n", + error, event, major, minor); + use_xfixes = TRUE; + xfixes_event_base = event; +} +#endif /* SONAME_LIBXFIXES */ + static void init_visuals( Display *display, int screen ) { int count; @@ -680,6 +740,9 @@ static NTSTATUS x11drv_init( void *arg ) X11DRV_XF86VM_Init(); /* initialize XRandR */ X11DRV_XRandR_Init(); +#ifdef SONAME_LIBXFIXES + x11drv_load_xfixes(); +#endif #ifdef SONAME_LIBXCOMPOSITE X11DRV_XComposite_Init(); #endif diff --git a/dlls/winex11.drv/xfixes.h b/dlls/winex11.drv/xfixes.h new file mode 100644 index 000000000000..f3beea5efede --- /dev/null +++ b/dlls/winex11.drv/xfixes.h @@ -0,0 +1,36 @@ +/* + * Wine X11DRV Xfixes interface + * + * Copyright 2021 Rémi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef __WINE_XFIXES_H +#define __WINE_XFIXES_H + +#ifndef __WINE_CONFIG_H +# error You must include config.h to use this header +#endif + +#ifdef SONAME_LIBXFIXES +#include +#define MAKE_FUNCPTR(f) extern typeof(f) * p##f; +MAKE_FUNCPTR(XFixesQueryExtension) +MAKE_FUNCPTR(XFixesQueryVersion) +MAKE_FUNCPTR(XFixesSelectSelectionInput) +#undef MAKE_FUNCPTR +#endif /* defined(SONAME_LIBXFIXES) */ + +#endif /* __WINE_XFIXES_H */ From 716972002e9a344115991f7c12024dcef1f5beb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 25 Jul 2023 10:38:35 +0200 Subject: [PATCH 0166/2542] winex11: Use XFixes to hide cursor before warping it. XWayland only allows warping the cursor if it is not visible. Fixes a regression from the periodic cursor sync removal. CW-Bug-Id: #21879 --- dlls/winex11.drv/mouse.c | 4 +++- dlls/winex11.drv/x11drv_main.c | 4 ++++ dlls/winex11.drv/xfixes.h | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 69f6e6d922c6..bfcfa019f1a0 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -54,6 +54,7 @@ MAKE_FUNCPTR(XcursorLibraryLoadCursor); #define OEMRESOURCE #include "x11drv.h" +#include "xfixes.h" #include "winreg.h" #include "wine/server.h" #include "wine/debug.h" @@ -1490,9 +1491,10 @@ BOOL X11DRV_SetCursorPos( INT x, INT y ) return FALSE; } + pXFixesHideCursor( data->display, root_window ); XWarpPointer( data->display, root_window, root_window, 0, 0, 0, 0, pos.x, pos.y ); data->warp_serial = NextRequest( data->display ); - XNoOp( data->display ); + pXFixesShowCursor( data->display, root_window ); XFlush( data->display ); /* avoids bad mouse lag in games that do their own mouse warping */ TRACE( "warped to %d,%d serial %lu\n", x, y, data->warp_serial ); return TRUE; diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 0be4d12c17a8..20447a3378be 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -571,11 +571,13 @@ static void X11DRV_XComposite_Init(void) #ifdef SONAME_LIBXFIXES #define MAKE_FUNCPTR(f) typeof(f) * p##f; +MAKE_FUNCPTR(XFixesHideCursor) MAKE_FUNCPTR(XFixesQueryExtension) MAKE_FUNCPTR(XFixesQueryVersion) MAKE_FUNCPTR(XFixesCreateRegion) MAKE_FUNCPTR(XFixesCreateRegionFromGC) MAKE_FUNCPTR(XFixesSelectSelectionInput) +MAKE_FUNCPTR(XFixesShowCursor) #undef MAKE_FUNCPTR static void x11drv_load_xfixes(void) @@ -596,11 +598,13 @@ static void x11drv_load_xfixes(void) dlclose(xfixes); \ return; \ } + LOAD_FUNCPTR(XFixesHideCursor) LOAD_FUNCPTR(XFixesQueryExtension) LOAD_FUNCPTR(XFixesQueryVersion) LOAD_FUNCPTR(XFixesCreateRegion) LOAD_FUNCPTR(XFixesCreateRegionFromGC) LOAD_FUNCPTR(XFixesSelectSelectionInput) + LOAD_FUNCPTR(XFixesShowCursor) #undef LOAD_FUNCPTR if (!pXFixesQueryExtension(gdi_display, &event, &error)) diff --git a/dlls/winex11.drv/xfixes.h b/dlls/winex11.drv/xfixes.h index f3beea5efede..6cd4e48425bd 100644 --- a/dlls/winex11.drv/xfixes.h +++ b/dlls/winex11.drv/xfixes.h @@ -27,9 +27,11 @@ #ifdef SONAME_LIBXFIXES #include #define MAKE_FUNCPTR(f) extern typeof(f) * p##f; +MAKE_FUNCPTR(XFixesHideCursor) MAKE_FUNCPTR(XFixesQueryExtension) MAKE_FUNCPTR(XFixesQueryVersion) MAKE_FUNCPTR(XFixesSelectSelectionInput) +MAKE_FUNCPTR(XFixesShowCursor) #undef MAKE_FUNCPTR #endif /* defined(SONAME_LIBXFIXES) */ From e7b1a117930241af6b044fcfeab2d1bd572ac9ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 8 Sep 2023 14:24:11 +0200 Subject: [PATCH 0167/2542] winex11: Always ignore MotionNotify event after SetCursorPos. Trying to workaround spurious Wayland mouse motion. CW-Bug-Id: #22650 --- dlls/winex11.drv/mouse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index bfcfa019f1a0..6ccb466268b6 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -1689,7 +1689,7 @@ BOOL X11DRV_MotionNotify( HWND hwnd, XEvent *xev ) input.mi.time = EVENT_x11_time_to_win32_time( event->time ); input.mi.dwExtraInfo = 0; - if (!hwnd && is_old_motion_event( event->serial )) + if (is_old_motion_event( event->serial )) { TRACE( "pos %d,%d old serial %lu, ignoring\n", event->x, event->y, event->serial ); return FALSE; From c45fe084728d51f9f255a8a14ffdf7e913d12eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 29 Nov 2023 14:52:21 +0100 Subject: [PATCH 0168/2542] HACK: winex11: Drop X11DRV_GetCursorPos entirely. CW-Bug-Id: #22849 --- dlls/winex11.drv/init.c | 1 - dlls/winex11.drv/mouse.c | 24 ------------------------ dlls/winex11.drv/x11drv.h | 1 - 3 files changed, 26 deletions(-) diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 0c7ae196ea44..5764c05be889 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -434,7 +434,6 @@ static const struct user_driver_funcs x11drv_funcs = .pSetIMECompositionRect = X11DRV_SetIMECompositionRect, .pDestroyCursorIcon = X11DRV_DestroyCursorIcon, .pSetCursor = X11DRV_SetCursor, - .pGetCursorPos = X11DRV_GetCursorPos, .pSetCursorPos = X11DRV_SetCursorPos, .pClipCursor = X11DRV_ClipCursor, .pSystrayDockInit = X11DRV_SystrayDockInit, diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 6ccb466268b6..b5ff6b302757 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -1500,30 +1500,6 @@ BOOL X11DRV_SetCursorPos( INT x, INT y ) return TRUE; } -/*********************************************************************** - * GetCursorPos (X11DRV.@) - */ -BOOL X11DRV_GetCursorPos(LPPOINT pos) -{ - Display *display = thread_init_display(); - LARGE_INTEGER timeout = {0}; - Window root, child; - int rootX, rootY, winX, winY; - unsigned int xstate; - BOOL ret; - - if (NtWaitForSingleObject(steam_overlay_event, FALSE, &timeout) == WAIT_OBJECT_0) return TRUE; - - ret = XQueryPointer( display, root_window, &root, &child, &rootX, &rootY, &winX, &winY, &xstate ); - if (ret) - { - POINT old = *pos; - *pos = root_to_virtual_screen( winX, winY ); - TRACE( "pointer at %s server pos %s\n", wine_dbgstr_point(pos), wine_dbgstr_point(&old) ); - } - return ret; -} - /*********************************************************************** * ClipCursor (X11DRV.@) */ diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 56d08616c6b5..a525e75d8931 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -209,7 +209,6 @@ extern BOOL X11DRV_SetIMECompositionRect( HWND hwnd, RECT rect ); extern void X11DRV_DestroyCursorIcon( HCURSOR handle ); extern void X11DRV_SetCursor( HWND hwnd, HCURSOR handle ); extern BOOL X11DRV_SetCursorPos( INT x, INT y ); -extern BOOL X11DRV_GetCursorPos( LPPOINT pos ); extern BOOL X11DRV_ClipCursor( const RECT *clip, BOOL reset ); extern void X11DRV_SystrayDockInit( HWND systray ); extern BOOL X11DRV_SystrayDockInsert( HWND owner, UINT cx, UINT cy, void *icon ); From bf04e7604b721e55f10f8268c052a1043da6ca6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 23 Jan 2024 10:49:37 +0100 Subject: [PATCH 0169/2542] winex11: Consistently use set_focus to change foreground window. It does more than that and also waits for the window manager to release its grabs. CW-Bug-Id: #23288 CW-Bug-Id: #23320 --- dlls/winex11.drv/event.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index bb339bce68fa..7fc0fb89854f 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -925,7 +925,12 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev ) if (!hwnd) hwnd = x11drv_thread_data()->last_focus; if (hwnd && can_activate_window(hwnd)) set_focus( event->display, hwnd, CurrentTime ); } - else NtUserSetForegroundWindow( hwnd ); + else + { + wait_grab_pointer( event->display ); + NtUserSetForegroundWindow( hwnd ); + } + return TRUE; } From 9cae9016c296d715c7a431bcaa31b17a203b68ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 22 Mar 2024 18:56:05 +0100 Subject: [PATCH 0170/2542] HACK: winex11: Disable pointer grab wait with gamescope. CW-Bug-Id: #23595 --- dlls/winex11.drv/event.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 7fc0fb89854f..0a7c3f9e0ec0 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -326,6 +326,9 @@ static void wait_grab_pointer( Display *display ) { RECT rect; + /* unnecessary on gamescope, windows cannot be moved with the mouse */ + if (X11DRV_HasWindowManager( "steamcompmgr" )) return; + /* release cursor grab held by any Wine process */ NtUserGetClipCursor( &rect ); NtUserClipCursor( NULL ); From 62b68bc5b6b1272f7a54011eb97ae8135d18b0cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 3 Dec 2024 11:23:18 +0100 Subject: [PATCH 0171/2542] HACK: fshack: win32u: Emulate modesetting by default. --- dlls/win32u/sysparams.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 27a9d2b97884..e0f5dd43a4f8 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -159,7 +159,7 @@ static INT64 last_query_display_time; static UINT64 monitor_update_serial; static pthread_mutex_t display_lock = PTHREAD_MUTEX_INITIALIZER; -static BOOL emulate_modeset; +static BOOL emulate_modeset = TRUE; BOOL decorated_mode = TRUE; UINT64 thunk_lock_callback = 0; @@ -5463,7 +5463,7 @@ void sysparams_init(void) if (!get_config_key( hkey, appkey, "Decorated", buffer, sizeof(buffer) )) decorated_mode = IS_OPTION_TRUE( buffer[0] ); if (!get_config_key( hkey, appkey, "EmulateModeset", buffer, sizeof(buffer) )) - emulate_modeset = IS_OPTION_TRUE( buffer[0] ); + emulate_modeset = !IS_OPTION_TRUE( buffer[0] ); #undef IS_OPTION_TRUE From 8cdaea484efa408b367cafdec0bf959f88b290ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 3 Dec 2024 12:48:31 +0100 Subject: [PATCH 0172/2542] HACK: win32u: Disable modesetting emulation with gamescope. --- dlls/win32u/sysparams.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index e0f5dd43a4f8..e65f62c897a6 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -2276,6 +2276,8 @@ static BOOL lock_display_devices( BOOL force ) init_display_driver(); /* make sure to load the driver before anything else */ + if (user_driver->pHasWindowManager( "steamcompmgr" )) emulate_modeset = FALSE; + pthread_mutex_lock( &display_lock ); serial = get_monitor_update_serial(); From 6ca5961b844e444d01a7395a0f51c347b04b96ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 4 Dec 2024 21:20:44 +0100 Subject: [PATCH 0173/2542] HACK: win32u: Disable modesetting emulation with Xwayland. --- dlls/win32u/sysparams.c | 1 + dlls/winex11.drv/window.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index e65f62c897a6..a939f5629e2b 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -2277,6 +2277,7 @@ static BOOL lock_display_devices( BOOL force ) init_display_driver(); /* make sure to load the driver before anything else */ if (user_driver->pHasWindowManager( "steamcompmgr" )) emulate_modeset = FALSE; + if (user_driver->pHasWindowManager( "xwayland" )) emulate_modeset = FALSE; pthread_mutex_lock( &display_lock ); diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 5a75bc1e4243..f030a4e1c42a 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -3539,6 +3539,9 @@ void net_supporting_wm_check_init( struct x11drv_thread_data *data ) BOOL X11DRV_HasWindowManager( const char *name ) { struct x11drv_thread_data *data = x11drv_init_thread_data(); + int opcode, event, error; + + if (!strcmp( name, "xwayland" )) return XQueryExtension( gdi_display, "XWAYLAND", &opcode, &event, &error ); return data->window_manager && !strcmp( data->window_manager, name ); } From 49602aa65cfc2e8564895e2e0fb1049e576a5ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 21 Nov 2024 12:26:30 +0100 Subject: [PATCH 0174/2542] HACK: ntdll: Convert VR_CONFIG_PATH and VR_LOG_PATH environment variables. CW-Bug-Id: #24510 --- dlls/ntdll/unix/env.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index 077976742fe0..a6e736ef8667 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -1097,6 +1097,7 @@ static void add_dynamic_environment( WCHAR **env, SIZE_T *pos, SIZE_T *size ) { const char *overrides = getenv( "WINEDLLOVERRIDES" ); const char *wineloader = getenv( "WINELOADER" ); + const char *var; unsigned int i; char str[22]; @@ -1124,6 +1125,9 @@ static void add_dynamic_environment( WCHAR **env, SIZE_T *pos, SIZE_T *size ) append_envA( env, pos, size, "WINEUSERLOCALE", user_locale ); append_envA( env, pos, size, "SystemDrive", "C:" ); append_envA( env, pos, size, "SystemRoot", "C:\\windows" ); + + if ((var = getenv( "VR_CONFIG_PATH" ))) add_path_var( env, pos, size, "VR_CONFIG_PATH", var ); + if ((var = getenv( "VR_LOG_PATH" ))) add_path_var( env, pos, size, "VR_LOG_PATH", var ); } From 7ddf8da07e0d55fe8044d71f93f7515f0a16150d Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 14 Jan 2020 21:39:23 +0300 Subject: [PATCH 0175/2542] ntdll: Increase step after failed map attempt in try_map_free_area(). --- dlls/ntdll/unix/virtual.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 8dee2d38505a..7b39ba895803 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -1452,6 +1452,7 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step, step == 0) break; start = (char *)start + step; + step *= 2; } return NULL; From 9e77ff77524aad0c1309a598836958777095651a Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 23 Jul 2020 18:40:39 +0300 Subject: [PATCH 0176/2542] ntdll: Increase free ranges view block size on 64 bit. --- dlls/ntdll/unix/virtual.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 7b39ba895803..09d438a59aa3 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -326,7 +326,11 @@ static BYTE *pages_vprot; #endif static struct file_view *view_block_start, *view_block_end, *next_free_view; +#ifdef _WIN64 +static const size_t view_block_size = 0x200000; +#else static const size_t view_block_size = 0x100000; +#endif static void *preload_reserve_start; static void *preload_reserve_end; static BOOL force_exec_prot; /* whether to force PROT_EXEC on all PROT_READ mmaps */ From 24130c918772648fda01f363893298789990b68e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 25 Nov 2019 12:19:20 +0300 Subject: [PATCH 0177/2542] ntdll: Force virtual memory allocation order. Windows allocates virtual memory strictly bottom up or top down depending on the requested flags (when ASLR is disabled). Modern Linux VM allocator always allocates memory top down. Some applications break if the allocated memory addresses are from higher memory than they expect. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48175 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46568 --- dlls/ntdll/unix/virtual.c | 410 +++++++++++++++----------------------- 1 file changed, 164 insertions(+), 246 deletions(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 09d438a59aa3..56c79c59bbd3 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -1394,43 +1394,15 @@ static struct file_view *find_view_range( const void *addr, size_t size ) } -/*********************************************************************** - * find_view_inside_range - * - * Find first (resp. last, if top_down) view inside a range. - * virtual_mutex must be held by caller. - */ -static struct wine_rb_entry *find_view_inside_range( void **base_ptr, void **end_ptr, int top_down ) -{ - struct wine_rb_entry *first = NULL, *ptr = views_tree.root; - void *base = *base_ptr, *end = *end_ptr; - - /* find the first (resp. last) view inside the range */ - while (ptr) - { - struct file_view *view = WINE_RB_ENTRY_VALUE( ptr, struct file_view, entry ); - if ((char *)view->base + view->size >= (char *)end) - { - end = min( end, view->base ); - ptr = ptr->left; - } - else if (view->base <= base) - { - base = max( (char *)base, (char *)view->base + view->size ); - ptr = ptr->right; - } - else - { - first = ptr; - ptr = top_down ? ptr->right : ptr->left; - } - } - - *base_ptr = base; - *end_ptr = end; - return first; -} +struct alloc_area +{ + size_t size; + ptrdiff_t step; + int unix_prot; + BOOL top_down; + UINT_PTR align_mask; +}; /*********************************************************************** * try_map_free_area @@ -1463,112 +1435,6 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step, } -/*********************************************************************** - * map_free_area - * - * Find a free area between views inside the specified range and map it. - * virtual_mutex must be held by caller. - */ -static void *map_free_area( void *base, void *end, size_t size, int top_down, int unix_prot, size_t align_mask ) -{ - struct wine_rb_entry *first = find_view_inside_range( &base, &end, top_down ); - ptrdiff_t step = top_down ? -(align_mask + 1) : (align_mask + 1); - void *start; - - if (top_down) - { - start = ROUND_ADDR( (char *)end - size, align_mask ); - if (start >= end || start < base) return NULL; - - while (first) - { - struct file_view *view = WINE_RB_ENTRY_VALUE( first, struct file_view, entry ); - if ((start = try_map_free_area( (char *)view->base + view->size, (char *)start + size, step, - start, size, unix_prot ))) break; - start = ROUND_ADDR( (char *)view->base - size, align_mask ); - /* stop if remaining space is not large enough */ - if (!start || start >= end || start < base) return NULL; - first = rb_prev( first ); - } - } - else - { - start = ROUND_ADDR( (char *)base + align_mask, align_mask ); - if (!start || start >= end || (char *)end - (char *)start < size) return NULL; - - while (first) - { - struct file_view *view = WINE_RB_ENTRY_VALUE( first, struct file_view, entry ); - if ((start = try_map_free_area( start, view->base, step, - start, size, unix_prot ))) break; - start = ROUND_ADDR( (char *)view->base + view->size + align_mask, align_mask ); - /* stop if remaining space is not large enough */ - if (!start || start >= end || (char *)end - (char *)start < size) return NULL; - first = rb_next( first ); - } - } - - if (!first) - start = try_map_free_area( base, end, step, start, size, unix_prot ); - - if (!start) - ERR( "couldn't map free area in range %p-%p, size %p\n", base, end, (void *)size ); - - return start; -} - - -/*********************************************************************** - * find_reserved_free_area - * - * Find a free area between views inside the specified range. - * virtual_mutex must be held by caller. - * The range must be inside a reserved area. - */ -static void *find_reserved_free_area( void *base, void *end, size_t size, int top_down, size_t align_mask ) -{ - struct range_entry *range; - void *start; - - base = ROUND_ADDR( (char *)base + align_mask, align_mask ); - end = (char *)ROUND_ADDR( (char *)end - size, align_mask ) + size; - - if (top_down) - { - start = (char *)end - size; - range = free_ranges_lower_bound( start ); - assert(range != free_ranges_end && range->end >= start); - - if ((char *)range->end - (char *)start < size) start = ROUND_ADDR( (char *)range->end - size, align_mask ); - do - { - if (start >= end || start < base || (char *)end - (char *)start < size) return NULL; - if (start < range->end && start >= range->base && (char *)range->end - (char *)start >= size) break; - if (--range < free_ranges) return NULL; - start = ROUND_ADDR( (char *)range->end - size, align_mask ); - } - while (1); - } - else - { - start = base; - range = free_ranges_lower_bound( start ); - assert(range != free_ranges_end && range->end >= start); - - if (start < range->base) start = ROUND_ADDR( (char *)range->base + align_mask, align_mask ); - do - { - if (start >= end || start < base || (char *)end - (char *)start < size) return NULL; - if (start < range->end && start >= range->base && (char *)range->end - (char *)start >= size) break; - if (++range == free_ranges_end) return NULL; - start = ROUND_ADDR( (char *)range->base + align_mask, align_mask ); - } - while (1); - } - return start; -} - - /*********************************************************************** * remove_reserved_area * @@ -1678,8 +1544,7 @@ static void free_view( struct file_view *view ) */ static void unregister_view( struct file_view *view ) { - if (mmap_is_in_reserved_area( view->base, view->size )) - free_ranges_remove_view( view ); + free_ranges_remove_view( view ); wine_rb_remove( &views_tree, &view->entry ); } @@ -1707,8 +1572,7 @@ static void delete_view( struct file_view *view ) /* [in] View */ static void register_view( struct file_view *view ) { wine_rb_put( &views_tree, view->base, &view->entry ); - if (mmap_is_in_reserved_area( view->base, view->size )) - free_ranges_insert_view( view ); + free_ranges_insert_view( view ); } @@ -1980,89 +1844,176 @@ static inline void *unmap_extra_space( void *ptr, size_t total_size, size_t want return ptr; } - -/*********************************************************************** - * find_reserved_free_area_outside_preloader - * - * Find a free area inside a reserved area, skipping the preloader reserved range. - * virtual_mutex must be held by caller. - */ -static void *find_reserved_free_area_outside_preloader( void *start, void *end, size_t size, - int top_down, size_t align_mask ) +static void *try_map_free_area_range( struct alloc_area *area, char *start, char *end ) { - void *ret; + char *alloc_start; - if (preload_reserve_end >= end) + if (area->top_down) { - if (preload_reserve_start <= start) return NULL; /* no space in that area */ - if (preload_reserve_start < end) end = preload_reserve_start; + if (end - start < area->size) return NULL; + alloc_start = ROUND_ADDR( end - area->size, area->align_mask ); + return try_map_free_area( start, alloc_start + area->size, area->step, alloc_start, area->size, area->unix_prot ); } - else if (preload_reserve_start <= start) - { - if (preload_reserve_end > start) start = preload_reserve_end; - } - else /* range is split in two by the preloader reservation, try both parts */ + + alloc_start = ROUND_ADDR( start + area->align_mask, area->align_mask ); + return try_map_free_area( start, end, area->step, alloc_start, area->size, area->unix_prot ); +} + +static void *alloc_free_area_in_range( struct alloc_area *area, char *base, char *end ) +{ + UINT_PTR align_mask = area->align_mask; + char *intersect_start, *intersect_end, *result, *alloc_start; + struct reserved_area *res_area; + + TRACE("range %p-%p.\n", base, end); + + if (base >= end) + return NULL; + + if (area->top_down) { - if (top_down) + if ((ULONG_PTR)end < area->size) return NULL; + alloc_start = ROUND_ADDR( end - area->size, align_mask ); + if (alloc_start >= end || alloc_start < base) return NULL; + + LIST_FOR_EACH_ENTRY_REV( res_area, &reserved_areas, struct reserved_area, entry ) { - ret = find_reserved_free_area( preload_reserve_end, end, size, top_down, align_mask ); - if (ret) return ret; - end = preload_reserve_start; + char *res_start = res_area->base; + char *res_end = res_start + res_area->size; + + if (res_start >= end) continue; + if (res_end <= base) break; + + intersect_start = max( res_start, base ); + intersect_end = min( res_end, end ); + assert( intersect_start <= intersect_end ); + if ((result = try_map_free_area_range( area, intersect_end, end))) return result; + + if (intersect_end - intersect_start >= area->size) + { + alloc_start = ROUND_ADDR( intersect_end - area->size, align_mask ); + if (alloc_start >= intersect_start) + { + if ((result = anon_mmap_fixed( alloc_start, area->size, area->unix_prot, 0 )) != alloc_start) + ERR("Could not map in reserved area, alloc_start %p, size %p.\n", + alloc_start, (void *)area->size); + return result; + } + } + + end = intersect_start; + if (end - base < area->size) return NULL; } - else + return try_map_free_area_range( area, base, end ); + } + + if (base + align_mask < base) return NULL; + alloc_start = ROUND_ADDR( base + align_mask, align_mask ); + if (alloc_start >= end || end - alloc_start < area->size) + return NULL; + + LIST_FOR_EACH_ENTRY( res_area, &reserved_areas, struct reserved_area, entry ) + { + char *res_start = res_area->base; + char *res_end = res_start + res_area->size; + + if (res_end <= base) continue; + if (res_start >= end) break; + + intersect_start = max( res_start, base ); + intersect_end = min( res_end, end ); + assert( intersect_start <= intersect_end ); + if ((result = try_map_free_area_range( area, base, intersect_start ))) return result; + + if (intersect_end - intersect_start >= area->size) { - ret = find_reserved_free_area( start, preload_reserve_start, size, top_down, align_mask ); - if (ret) return ret; - start = preload_reserve_end; + alloc_start = ROUND_ADDR( intersect_start + align_mask, align_mask ); + if (alloc_start + area->size <= intersect_end) + { + if ((result = anon_mmap_fixed( alloc_start, area->size, area->unix_prot, 0 )) != alloc_start) + ERR("Could not map in reserved area, alloc_start %p, size %p.\n", alloc_start, (void *)area->size); + return result; + } } + base = intersect_end; + if (end - base < area->size) return NULL; } - return find_reserved_free_area( start, end, size, top_down, align_mask ); + return try_map_free_area_range( area, base, end ); } -/*********************************************************************** - * map_reserved_area - * - * Try to map some space inside a reserved area. - * virtual_mutex must be held by caller. - */ -static void *map_reserved_area( void *limit_low, void *limit_high, size_t size, int top_down, - int unix_prot, size_t align_mask ) +static void *alloc_free_area( char *limit_low, char *limit_high, size_t size, BOOL top_down, int unix_prot, UINT_PTR align_mask ) { - void *ptr = NULL; - struct reserved_area *area; + struct range_entry *range, *ranges_start, *ranges_end; + char *reserve_start, *reserve_end; + struct alloc_area area; + void *result = NULL; + char *base, *end; + int ranges_inc; + + TRACE("limit %p-%p, size %p, top_down %#x.\n", limit_low, limit_high, (void *)size, top_down); if (top_down) { - LIST_FOR_EACH_ENTRY_REV( area, &reserved_areas, struct reserved_area, entry ) - { - void *start = area->base; - void *end = (char *)start + area->size; - - if (start >= limit_high) continue; - if (end <= limit_low) return NULL; - if (start < limit_low) start = limit_low; - if (end > limit_high) end = limit_high; - ptr = find_reserved_free_area_outside_preloader( start, end, size, top_down, align_mask ); - if (ptr) break; - } + ranges_start = free_ranges_end - 1; + ranges_end = free_ranges - 1; + ranges_inc = -1; } else { - LIST_FOR_EACH_ENTRY( area, &reserved_areas, struct reserved_area, entry ) + ranges_start = free_ranges; + ranges_end = free_ranges_end; + ranges_inc = 1; + } + + memset( &area, 0, sizeof(area) ); + area.step = top_down ? -(align_mask + 1) : (align_mask + 1); + area.size = size; + area.top_down = top_down; + area.unix_prot = unix_prot; + area.align_mask = align_mask; + + reserve_start = preload_reserve_start; + reserve_end = preload_reserve_end; + + for (range = ranges_start; range != ranges_end; range += ranges_inc) + { + base = range->base; + end = range->end; + + TRACE("range %p-%p.\n", base, end); + + if (base < limit_low) base = limit_low; + if (end > limit_high) end = limit_high; + if (base > end || end - base < size) continue; + + if (reserve_end >= base) { - void *start = area->base; - void *end = (char *)start + area->size; - - if (start >= limit_high) return NULL; - if (end <= limit_low) continue; - if (start < limit_low) start = limit_low; - if (end > limit_high) end = limit_high; - ptr = find_reserved_free_area_outside_preloader( start, end, size, top_down, align_mask ); - if (ptr) break; + if (reserve_end >= end) + { + if (reserve_start <= base) + continue; /* no space in that area */ + + if (reserve_start < end) + end = reserve_start; + } + else if (reserve_start <= base) + { + base = reserve_end; + } + else + { + /* range is split in two by the preloader reservation, try first part. */ + if ((result = alloc_free_area_in_range( &area, base, reserve_start ))) + break; + /* then fall through to try second part. */ + base = reserve_end; + } } + + if ((result = alloc_free_area_in_range( &area, base, end ))) + break; } - if (ptr && anon_mmap_fixed( ptr, size, unix_prot, 0 ) != ptr) ptr = NULL; - return ptr; + return result; } /*********************************************************************** @@ -2166,48 +2117,13 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size, } else { - void *start = address_space_start; - void *end = min( user_space_limit, host_addr_space_limit ); - size_t view_size, unmap_size; - + limit_high = limit_high ? min( limit_high + 1, (UINT_PTR)user_space_limit) : (UINT_PTR)user_space_limit; + if (limit_low < (ULONG_PTR)address_space_start) limit_low = (ULONG_PTR)address_space_start; if (!align_mask) align_mask = granularity_mask; - view_size = size + align_mask + 1; - - if (limit_low && (void *)limit_low > start) start = (void *)limit_low; - if (limit_high && (void *)limit_high < end) end = (char *)limit_high + 1; - - if ((ptr = map_reserved_area( start, end, size, top_down, get_unix_prot(vprot), align_mask ))) - { - TRACE( "got mem in reserved area %p-%p\n", ptr, (char *)ptr + size ); - goto done; - } - if (start > address_space_start || end < host_addr_space_limit || top_down) - { - if (!(ptr = map_free_area( start, end, size, top_down, get_unix_prot(vprot), align_mask ))) - return STATUS_NO_MEMORY; - TRACE( "got mem with map_free_area %p-%p\n", ptr, (char *)ptr + size ); - goto done; - } - - for (;;) - { - if ((ptr = anon_mmap_alloc( view_size, get_unix_prot(vprot) )) == MAP_FAILED) - { - status = (errno == ENOMEM) ? STATUS_NO_MEMORY : STATUS_INVALID_PARAMETER; - ERR( "anon mmap error %s, size %p, unix_prot %#x\n", - strerror(errno), (void *)view_size, get_unix_prot( vprot ) ); - return status; - } - TRACE( "got mem with anon mmap %p-%p\n", ptr, (char *)ptr + size ); - /* if we got something beyond the user limit, unmap it and retry */ - if (!is_beyond_limit( ptr, view_size, user_space_limit )) break; - unmap_size = unmap_area_above_user_limit( ptr, view_size ); - if (unmap_size) munmap( ptr, unmap_size ); - } - ptr = unmap_extra_space( ptr, view_size, size, align_mask ); + if (!(ptr = alloc_free_area( (void *)limit_low, (void *)limit_high, size, top_down, get_unix_prot( vprot ), align_mask ))) + return STATUS_NO_MEMORY; } -done: status = create_view( view_ret, ptr, size, vprot ); if (status != STATUS_SUCCESS) unmap_area( ptr, size ); return status; @@ -3401,6 +3317,7 @@ static unsigned int virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG_P done: server_leave_uninterrupted_section( &virtual_mutex, &sigset ); if (needs_close) close( unix_handle ); + TRACE("status %#x.\n", res); return res; } @@ -6526,6 +6443,7 @@ NTSTATUS WINAPI NtWow64AllocateVirtualMemory64( HANDLE process, ULONG64 *ret, UL *ret = (ULONG_PTR)base; *size_ptr = size; } + TRACE("status %#x.\n", status); return status; } From 629690fbfa689d964255fc1b50ee47522e175c45 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 1 Dec 2023 14:55:20 -0600 Subject: [PATCH 0178/2542] ntdll: Exclude natively mapped areas from free areas list. --- dlls/ntdll/unix/virtual.c | 104 ++++++++++++++++++++++++++++++++++---- 1 file changed, 95 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 56c79c59bbd3..6ce9f32a5130 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -248,6 +248,7 @@ struct file_view #define VPROT_SYSTEM 0x0200 /* system view (underlying mmap not under our control) */ #define VPROT_PLACEHOLDER 0x0400 #define VPROT_FREE_PLACEHOLDER 0x0800 +#define VPROT_NATIVE 0x1000 /* Conversion from VPROT_* to Win32 flags */ static const BYTE VIRTUAL_Win32Flags[16] = @@ -296,6 +297,8 @@ static void *working_set_limit = (void *)0x7fff0000; static void *host_addr_space_limit; /* top of the host virtual address space */ static struct file_view *arm64ec_view; +static const ptrdiff_t max_try_map_step = 0x40000000; +static BOOL increase_try_map_step = TRUE; ULONG_PTR user_space_wow_limit = 0; struct _KUSER_SHARED_DATA *user_shared_data = (void *)0x7ffe0000; @@ -1282,7 +1285,9 @@ static void dump_view( struct file_view *view ) BYTE prot = get_page_vprot( addr ); TRACE( "View: %p - %p", addr, addr + view->size - 1 ); - if (view->protect & VPROT_SYSTEM) + if (view->protect & VPROT_NATIVE) + TRACE(" (native)\n"); + else if (view->protect & VPROT_SYSTEM) TRACE( " (builtin image)\n" ); else if (view->protect & VPROT_FREE_PLACEHOLDER) TRACE( " (placeholder)\n" ); @@ -1402,6 +1407,8 @@ struct alloc_area int unix_prot; BOOL top_down; UINT_PTR align_mask; + char *native_mapped; + size_t native_mapped_size; }; /*********************************************************************** @@ -1410,9 +1417,12 @@ struct alloc_area * Try mmaping some expected free memory region, eventually stepping and * retrying inside it, and return where it actually succeeded, or NULL. */ -static void* try_map_free_area( void *base, void *end, ptrdiff_t step, - void *start, size_t size, int unix_prot ) +static void* try_map_free_area( struct alloc_area *area, void *base, void *end, void *start ) { + ptrdiff_t step = area->step; + size_t abs_step = step > 0 ? step : -step; + size_t size = area->size; + int unix_prot = area->unix_prot; while (start && base <= start && (char*)start + size <= (char*)end) { if (anon_mmap_tryfixed( start, size, unix_prot, 0 ) != MAP_FAILED) return start; @@ -1423,12 +1433,19 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step, strerror(errno), start, (char *)start + size, unix_prot ); return NULL; } + if (!area->native_mapped && step && abs_step < (granularity_mask + 1) * 2) + { + area->native_mapped = start; + area->native_mapped_size = abs_step; + area->native_mapped_size = min(area->native_mapped_size, (char *)end - (char *)start); + } if ((step > 0 && (char *)end - (char *)start < step) || (step < 0 && (char *)start - (char *)base < -step) || step == 0) break; start = (char *)start + step; - step *= 2; + if (increase_try_map_step && llabs(step) < max_try_map_step) + step *= 2; } return NULL; @@ -1852,11 +1869,11 @@ static void *try_map_free_area_range( struct alloc_area *area, char *start, char { if (end - start < area->size) return NULL; alloc_start = ROUND_ADDR( end - area->size, area->align_mask ); - return try_map_free_area( start, alloc_start + area->size, area->step, alloc_start, area->size, area->unix_prot ); + return try_map_free_area( area, start, alloc_start + area->size, alloc_start ); } alloc_start = ROUND_ADDR( start + area->align_mask, area->align_mask ); - return try_map_free_area( start, end, area->step, alloc_start, area->size, area->unix_prot ); + return try_map_free_area( area, start, end, alloc_start ); } static void *alloc_free_area_in_range( struct alloc_area *area, char *base, char *end ) @@ -1946,9 +1963,10 @@ static void *alloc_free_area( char *limit_low, char *limit_high, size_t size, BO struct range_entry *range, *ranges_start, *ranges_end; char *reserve_start, *reserve_end; struct alloc_area area; - void *result = NULL; + char *result = NULL; char *base, *end; int ranges_inc; + UINT status; TRACE("limit %p-%p, size %p, top_down %#x.\n", limit_low, limit_high, (void *)size, top_down); @@ -2013,6 +2031,50 @@ static void *alloc_free_area( char *limit_low, char *limit_high, size_t size, BO if ((result = alloc_free_area_in_range( &area, base, end ))) break; } + + if (area.native_mapped) + { + char *native_mapped_start, *native_mapped_end; + + TRACE("Excluding %p - %p from free list.\n", + area.native_mapped, (char *)area.native_mapped + area.native_mapped_size ); + + native_mapped_start = ROUND_ADDR(area.native_mapped, granularity_mask); + native_mapped_end = ROUND_ADDR(area.native_mapped + area.native_mapped_size + granularity_mask, + granularity_mask); + + if (result >= native_mapped_end || result + size < native_mapped_start) + /* In case of top down allocation try_map_free_area() result area can overlap the + * area previously marked as native if the latter was unmapped behind our back. */ + { + struct file_view *prev, *next; + + prev = find_view_range( native_mapped_start - 1, native_mapped_end - native_mapped_start + 2 ); + if (prev && (char *)prev->base >= native_mapped_end) + { + next = prev; + prev = WINE_RB_ENTRY_VALUE( rb_prev( &next->entry ), struct file_view, entry ); + } + else if (prev) next = WINE_RB_ENTRY_VALUE( rb_next( &prev->entry ), struct file_view, entry ); + else next = NULL; + + if (prev && prev->protect & VPROT_NATIVE && (char *)prev->base + prev->size >= native_mapped_start) + { + assert( (char *)prev->base + prev->size == native_mapped_start ); + native_mapped_start = prev->base; + delete_view( prev ); + } + if (next && next->protect & VPROT_NATIVE && native_mapped_end >= (char *)next->base) + { + assert( native_mapped_end == (char *)next->base ); + native_mapped_end = (char *)next->base + next->size; + delete_view( next ); + } + if ((status = create_view( &next, native_mapped_start, native_mapped_end - native_mapped_start, + VPROT_SYSTEM | VPROT_NATIVE ))) + ERR("Could not create view for natively mapped area, status %#x.\n", status); + } + } return result; } @@ -2072,6 +2134,17 @@ static NTSTATUS map_fixed_area( void *base, size_t size, unsigned int vprot ) return status; } +static void clear_native_views(void) +{ + struct file_view *view, *next_view; + + WINE_RB_FOR_EACH_ENTRY_DESTRUCTOR( view, next_view, &views_tree, struct file_view, entry ) + { + if (view->protect & VPROT_NATIVE) + delete_view( view ); + } +} + /*********************************************************************** * map_view * @@ -2122,7 +2195,15 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size, if (!align_mask) align_mask = granularity_mask; if (!(ptr = alloc_free_area( (void *)limit_low, (void *)limit_high, size, top_down, get_unix_prot( vprot ), align_mask ))) - return STATUS_NO_MEMORY; + { + WARN("Allocation failed, clearing native views.\n"); + + clear_native_views(); + if (!is_win64) increase_try_map_step = FALSE; + ptr = alloc_free_area( (void *)limit_low, (void *)limit_high, size, top_down, get_unix_prot( vprot ), align_mask ); + if (!is_win64) increase_try_map_step = TRUE; + if (!ptr) return STATUS_NO_MEMORY; + } } status = create_view( view_ret, ptr, size, vprot ); if (status != STATUS_SUCCESS) unmap_area( ptr, size ); @@ -4474,7 +4555,12 @@ void virtual_set_force_exec( BOOL enable ) WINE_RB_FOR_EACH_ENTRY( view, &views_tree, struct file_view, entry ) { /* file mappings are always accessible */ - BYTE commit = is_view_valloc( view ) ? 0 : VPROT_COMMITTED; + BYTE commit; + + if (view->protect & VPROT_NATIVE) + continue; + + commit = is_view_valloc( view ) ? 0 : VPROT_COMMITTED; mprotect_range( view->base, view->size, commit, 0 ); } From 52209893d74f209712ecdb8db46af3c48e914dab Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 29 Dec 2022 11:30:18 -0600 Subject: [PATCH 0179/2542] ntdll: HACK: Load Unix libs at once in load_builtin_unixlib(). CW-Bug-Id: #21736 --- dlls/ntdll/unix/virtual.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 6ce9f32a5130..53524a33e591 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -811,6 +811,7 @@ NTSTATUS load_builtin_unixlib( void *module, const char *name ) if (builtin->module != module) continue; if (!builtin->unix_path) builtin->unix_path = strdup( name ); else status = STATUS_IMAGE_ALREADY_LOADED; + if (!builtin->unix_handle) builtin->unix_handle = dlopen( builtin->unix_path, RTLD_NOW ); break; } server_leave_uninterrupted_section( &virtual_mutex, &sigset ); From e795bde078f6d0b4ed590de469dc3aadba1d2b15 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 8 May 2020 14:32:09 +0300 Subject: [PATCH 0180/2542] ntdll: Use UFFD for write watches support if available. Requires Linux kernel 6.7+ to have effect. CW-Bug-Id: #23524 --- dlls/kernel32/tests/virtual.c | 162 ++++++++++++++++++++++++++++- dlls/ntdll/unix/uffd_tmp_defs.h | 77 ++++++++++++++ dlls/ntdll/unix/virtual.c | 176 ++++++++++++++++++++++++++++++-- dlls/ws2_32/tests/sock.c | 16 ++- 4 files changed, 412 insertions(+), 19 deletions(-) create mode 100644 dlls/ntdll/unix/uffd_tmp_defs.h diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index cfbfcac09503..41eb79b75af6 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -1735,7 +1735,7 @@ static void test_write_watch(void) MEMORY_BASIC_INFORMATION info; HANDLE readpipe, writepipe, file; OVERLAPPED overlapped, *overlapped2; - void *results[64]; + void *results[2048]; ULONG_PTR count; ULONG i, pagesize; BOOL success; @@ -1775,6 +1775,7 @@ static void test_write_watch(void) SetLastError( 0xdeadbeef ); ret = pGetWriteWatch( 0, GetModuleHandleW(NULL), size, results, &count, &pagesize ); + ok(ret, "failed.\n"); if (ret) { ok( ret == ~0u, "GetWriteWatch succeeded %lu\n", ret ); @@ -1798,6 +1799,7 @@ static void test_write_watch(void) ok( results[0] == base + pagesize, "wrong result %p\n", results[0] ); count = 64; + results[0] = (void *)0xdeadbeef; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); ok( count == 1, "wrong count %Iu\n", count ); @@ -2207,6 +2209,16 @@ static void test_write_watch(void) base = VirtualAlloc( 0, size, MEM_RESERVE | MEM_WRITE_WATCH, PAGE_NOACCESS ); ok( base != NULL, "VirtualAlloc failed %lu\n", GetLastError() ); + + count = 64; + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 0, "wrong count %Iu\n", count ); + + ret = pResetWriteWatch( base, size ); + ok( !ret, "pResetWriteWatch failed %lu\n", GetLastError() ); + + base = VirtualAlloc( base, size, MEM_COMMIT, PAGE_NOACCESS ); ok( base != NULL, "VirtualAlloc failed %lu\n", GetLastError() ); @@ -2226,20 +2238,160 @@ static void test_write_watch(void) ok( old_prot == PAGE_READWRITE, "wrong old prot %lx\n", old_prot ); count = 64; - ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ret = pGetWriteWatch( /*0*/WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); ok( count == 1, "wrong count %Iu\n", count ); ok( results[0] == base + 5*pagesize, "wrong result %p\n", results[0] ); + ret = pResetWriteWatch( base, size ); + ret = pResetWriteWatch( base + 6*pagesize, size - 6 * pagesize ); + ok( !ret, "pResetWriteWatch failed %lu\n", GetLastError() ); + + count = 64; + results[0] = (void *)0xdeadbeef; + ret = pGetWriteWatch( /*0*/WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 0, "wrong count %Iu\n", count ); + ok( results[0] == (void *)0xdeadbeef, "wrong result %p\n", results[0] ); + + ret = VirtualFree( base + pagesize, pagesize, MEM_DECOMMIT ); + ok( ret, "VirtualFree failed %lu\n", GetLastError() ); + + ret = VirtualProtect( base + 2*pagesize, pagesize, PAGE_READWRITE, &old_prot ); + ok( ret, "VirtualProtect failed error %lu\n", GetLastError() ); + ok( old_prot == PAGE_NOACCESS, "wrong old prot %lx\n", old_prot ); + + count = 64; + results[0] = (void *)0xdeadbeef; + ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 0, "wrong count %Iu\n", count ); + ok( results[0] == (void *)0xdeadbeef, "wrong result %p\n", results[0] ); + + base[2*pagesize + 200] = 3; + count = 64; + results[0] = (void *)0xdeadbeef; + ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 1, "wrong count %Iu\n", count ); + ok( results[0] == base + 2*pagesize, "wrong result %p\n", results[0] ); + + base = VirtualAlloc( base, size, MEM_COMMIT, PAGE_NOACCESS ); + ok( !!base, "VirtualFree failed %lu\n", GetLastError() ); + + ret = VirtualProtect( base, 6*pagesize, PAGE_READWRITE, &old_prot ); + ok( ret, "VirtualProtect failed error %lu\n", GetLastError() ); + ok( old_prot == PAGE_NOACCESS, "wrong old prot %lx\n", old_prot ); + + base[3*pagesize + 200] = 3; + base[5*pagesize + 200] = 3; + ret = VirtualFree( base, size, MEM_DECOMMIT ); ok( ret, "VirtualFree failed %lu\n", GetLastError() ); count = 64; ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); - ok( count == 1 || broken(count == 0), /* win98 */ - "wrong count %Iu\n", count ); - if (count) ok( results[0] == base + 5*pagesize, "wrong result %p\n", results[0] ); + ok( !count, "wrong count %Iu\n", count ); + + base = VirtualAlloc( base, size, MEM_COMMIT, PAGE_READWRITE ); + ok(!!base, "VirtualAlloc failed.\n"); + + count = 64; + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( !count, "wrong count %Iu\n", count ); + + /* Looks like VirtualProtect latches write watch state somewhere, so if pages are decommitted after, + * (which normally clears write watch state), a page from range which previously had protection change + * is still reported as dirty. */ + base[3*pagesize + 200] = 3; + ret = VirtualProtect( base, 6*pagesize, PAGE_READWRITE, &old_prot ); + ok( ret, "VirtualProtect failed error %lu\n", GetLastError() ); + ok( old_prot == PAGE_READWRITE, "wrong old prot %lx\n", old_prot ); + + base[5*pagesize + 200] = 3; + count = 64; + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 2, "wrong c ount %Iu\n", count ); + ok( results[0] == base + 3*pagesize && results[1] == base + 5*pagesize, "wrong result %p\n", results[0] ); + + ret = VirtualFree( base, size, MEM_DECOMMIT ); + ok( ret, "VirtualFree failed %lu\n", GetLastError() ); + + count = 64; + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + todo_wine ok( count == 1, "wrong count %Iu\n", count ); + ok( results[0] == base + 3*pagesize, "wrong result %p\n", results[0] ); + + base = VirtualAlloc( base, size, MEM_COMMIT, PAGE_READWRITE ); + ok(!!base, "VirtualAlloc failed.\n"); + + count = 64; + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + todo_wine ok( count == 1, "wrong count %Iu\n", count ); + ok( results[0] == base + 3*pagesize, "wrong result %p\n", results[0] ); + + base[4*pagesize + 200] = 4; + base[2*pagesize + 200] = 4; + base[6*pagesize + 200] = 4; + + count = 64; + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + todo_wine ok( count == 4, "wrong count %Iu\n", count ); + ok( results[0] == base + 2*pagesize, "wrong result %p\n", results[0] ); + todo_wine ok( results[1] == base + 3*pagesize, "wrong result %p\n", results[0] ); + todo_wine ok( results[2] == base + 4*pagesize, "wrong result %p\n", results[0] ); + todo_wine ok( results[3] == base + 6*pagesize, "wrong result %p\n", results[0] ); + + VirtualFree( base, 0, MEM_RELEASE ); + + /* Test longer range */ + size = 2048 * pagesize; + base = VirtualAlloc( 0, size, MEM_RESERVE | MEM_COMMIT | MEM_WRITE_WATCH, PAGE_READWRITE ); + ok( base != NULL, "VirtualAlloc failed %lu\n", GetLastError() ); + + count = 2048; + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 0, "wrong count %Iu\n", count ); + + count = 2048; + for (i = 0; i < count; i += 2) + ++base[i * pagesize]; + + ret = VirtualProtect( base, size / 2, PAGE_READONLY, &old_prot ); + ok( ret, "VirtualProtect failed error %lu\n", GetLastError() ); + + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 1024, "wrong count %Iu\n", count ); + + for (i = 0; i < count; ++i) + { + ok( results[i] == base + i * 2 * pagesize, "wrong result %p\n", results[i] ); + if (results[i] != base + i * 2 * pagesize) + break; + } + + ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 1024, "wrong count %Iu\n", count ); + + for (i = 0; i < count; ++i) + { + ok( results[i] == base + i * 2 * pagesize, "wrong result %p\n", results[i] ); + if (results[i] != base + i * 2 * pagesize) + break; + } + + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 0, "wrong count %Iu\n", count ); VirtualFree( base, 0, MEM_RELEASE ); } diff --git a/dlls/ntdll/unix/uffd_tmp_defs.h b/dlls/ntdll/unix/uffd_tmp_defs.h new file mode 100644 index 000000000000..d9f7a286c580 --- /dev/null +++ b/dlls/ntdll/unix/uffd_tmp_defs.h @@ -0,0 +1,77 @@ +#ifndef __UFFD_TMP_DEFS__ +#define __UFFD_TMP_DEFS__ + +#define UFFD_USER_MODE_ONLY 1 + +#ifdef __x86_64__ +#define __NR_userfaultfd 323 +#else +#define __NR_userfaultfd 374 +#endif + +#ifndef UFFD_FEATURE_WP_ASYNC +#define UFFD_FEATURE_WP_UNPOPULATED (1<<13) +#define UFFD_FEATURE_WP_ASYNC (1<<15) +#endif + +#ifndef PAGEMAP_SCAN +/* Pagemap ioctl */ +#define PAGEMAP_SCAN _IOWR('f', 16, struct pm_scan_arg) + +/* Bits are set in flags of the page_region and masks in pm_scan_args */ +#define PAGE_IS_WPALLOWED (1 << 0) +#define PAGE_IS_WRITTEN (1 << 1) +#define PAGE_IS_FILE (1 << 2) +#define PAGE_IS_PRESENT (1 << 3) +#define PAGE_IS_SWAPPED (1 << 4) +#define PAGE_IS_PFNZERO (1 << 5) +#define PAGE_IS_HUGE (1 << 6) +/* + * struct page_region - Page region with flags + * @start: Start of the region + * @end: End of the region (exclusive) + * @categories: PAGE_IS_* category bitmask for the region + */ +struct page_region { + __u64 start; + __u64 end; + __u64 categories; +}; + +/* Flags for PAGEMAP_SCAN ioctl */ +#define PM_SCAN_WP_MATCHING (1 << 0) /* Write protect the pages matched. */ +#define PM_SCAN_CHECK_WPASYNC (1 << 1) /* Abort the scan when a non-WP-enabled page is found. */ + +/* + * struct pm_scan_arg - Pagemap ioctl argument + * @size: Size of the structure + * @flags: Flags for the IOCTL + * @start: Starting address of the region + * @end: Ending address of the region + * @walk_end Address where the scan stopped (written by kernel). + * walk_end == end informs that the scan completed on entire range. + * @vec: Address of page_region struct array for output + * @vec_len: Length of the page_region struct array + * @max_pages: Optional limit for number of returned pages (0 = disabled) + * @category_inverted: PAGE_IS_* categories which values match if 0 instead of 1 + * @category_mask: Skip pages for which any category doesn't match + * @category_anyof_mask: Skip pages for which no category matches + * @return_mask: PAGE_IS_* categories that are to be reported in `page_region`s returned + */ +struct pm_scan_arg { + __u64 size; + __u64 flags; + __u64 start; + __u64 end; + __u64 walk_end; + __u64 vec; + __u64 vec_len; + __u64 max_pages; + __u64 category_inverted; + __u64 category_mask; + __u64 category_anyof_mask; + __u64 return_mask; +}; +#endif + +#endif diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 53524a33e591..2cb6db8758a3 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -70,6 +70,10 @@ # include #endif +#include +#include +#include "uffd_tmp_defs.h" + #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" @@ -328,6 +332,9 @@ static BYTE **pages_vprot; static BYTE *pages_vprot; #endif +static int use_kernel_writewatch; +static int uffd_fd, pagemap_fd; + static struct file_view *view_block_start, *view_block_end, *next_free_view; #ifdef _WIN64 static const size_t view_block_size = 0x200000; @@ -371,6 +378,127 @@ void *anon_mmap_alloc( size_t size, int prot ) return mmap( NULL, size, prot, MAP_PRIVATE | MAP_ANON, -1, 0 ); } +static void kernel_writewatch_init(void) +{ + struct uffdio_api uffdio_api; + + uffd_fd = syscall( __NR_userfaultfd, O_CLOEXEC | O_NONBLOCK | UFFD_USER_MODE_ONLY ); + if (uffd_fd == -1) return; + + uffdio_api.api = UFFD_API; + uffdio_api.features = UFFD_FEATURE_WP_ASYNC | UFFD_FEATURE_WP_UNPOPULATED; + if (ioctl( uffd_fd, UFFDIO_API, &uffdio_api ) || uffdio_api.api != UFFD_API) + { + close( uffd_fd ); + return; + } + pagemap_fd = open( "/proc/self/pagemap", O_CLOEXEC | O_RDONLY ); + if (pagemap_fd == -1) + { + ERR("Error opening /proc/self/pagemap.\n"); + close( uffd_fd ); + return; + } + use_kernel_writewatch = 1; +} + +static void kernel_writewatch_reset( void *start, SIZE_T len ) +{ + struct pm_scan_arg arg = { 0 }; + + arg.size = sizeof(arg); + arg.start = (UINT_PTR)start; + arg.end = arg.start + len; + arg.flags = PM_SCAN_WP_MATCHING; + arg.category_mask = PAGE_IS_WRITTEN; + arg.return_mask = PAGE_IS_WRITTEN; + if (ioctl( pagemap_fd, PAGEMAP_SCAN, &arg ) < 0) + ERR( "ioctl(PAGEMAP_SCAN) failed, err %s.\n", strerror(errno) ); +} + +static void kernel_writewatch_register_range( struct file_view *view, void *base, size_t size ) +{ + struct uffdio_register uffdio_register; + struct uffdio_writeprotect wp; + + if (!(view->protect & VPROT_WRITEWATCH) || !use_kernel_writewatch) return; + + madvise( base, size, MADV_NOHUGEPAGE ); + uffdio_register.range.start = (UINT_PTR)base; + uffdio_register.range.len = size; + uffdio_register.mode = UFFDIO_REGISTER_MODE_WP; + if (ioctl( uffd_fd, UFFDIO_REGISTER, &uffdio_register ) == -1) + { + ERR( "ioctl( UFFDIO_REGISTER ) failed, %s.\n", strerror(errno) ); + return; + } + + if (!(uffdio_register.ioctls & UFFDIO_WRITEPROTECT)) + { + ERR( "uffdio_register.ioctls %s.\n", wine_dbgstr_longlong(uffdio_register.ioctls) ); + return; + } + wp.range.start = (UINT_PTR)base; + wp.range.len = size; + wp.mode = UFFDIO_WRITEPROTECT_MODE_WP; + + if (ioctl(uffd_fd, UFFDIO_WRITEPROTECT, &wp) == -1) + { + perror("ioctl(UFFDIO_WRITEPROTECT)"); + exit(-1); + } +} + +static NTSTATUS kernel_get_write_watches( void *base, SIZE_T size, void **buffer, ULONG_PTR *count, BOOL reset ) +{ + SIZE_T buffer_len = count ? *count : 0; + struct pm_scan_arg arg = { 0 }; + char *addr = base, *next_addr; + struct page_region rgns[256]; + int rgn_count, i; + size_t c_addr; + + assert( !(size & page_mask) ); + + arg.size = sizeof(arg); + arg.vec = (UINT_PTR)rgns; + arg.vec_len = ARRAY_SIZE(rgns); + if (reset) + arg.flags |= PM_SCAN_WP_MATCHING; + arg.category_mask = PAGE_IS_WRITTEN; + arg.return_mask = PAGE_IS_WRITTEN; + + *count = 0; + while (1) + { + arg.start = (UINT_PTR)addr; + arg.end = arg.start + size; + arg.max_pages = buffer_len; + + if ((rgn_count = ioctl( pagemap_fd, PAGEMAP_SCAN, &arg )) < 0) + { + ERR( "ioctl( PAGEMAP_SCAN ) failed, error %s.\n", strerror(errno) ); + return STATUS_INTERNAL_ERROR; + } + if (!rgn_count) break; + + assert( rgn_count <= ARRAY_SIZE(rgns) ); + for (i = 0; i < rgn_count; ++i) + { + assert( rgns[i].categories == PAGE_IS_WRITTEN ); + assert( !buffer || buffer_len >= ((rgns[i].end - rgns[i].start) >> page_shift) ); + for (c_addr = rgns[i].start; buffer_len && c_addr != rgns[i].end; c_addr += page_size, --buffer_len) + buffer[(*count)++] = (void *)c_addr; + } + if (!buffer_len || rgn_count < arg.vec_len) break; + next_addr = (void *)(UINT_PTR)arg.walk_end; + assert( size >= next_addr - addr ); + if (!(size -= next_addr - addr)) break; + addr = next_addr; + } + return STATUS_SUCCESS; +} + static void mmap_add_reserved_area( void *addr, SIZE_T size ) { @@ -1269,7 +1397,7 @@ static int get_unix_prot( BYTE vprot ) if (vprot & VPROT_WRITE) prot |= PROT_WRITE | PROT_READ; if (vprot & VPROT_WRITECOPY) prot |= PROT_WRITE | PROT_READ; if (vprot & VPROT_EXEC) prot |= PROT_EXEC | PROT_READ; - if (vprot & VPROT_WRITEWATCH) prot &= ~PROT_WRITE; + if (vprot & VPROT_WRITEWATCH && !use_kernel_writewatch) prot &= ~PROT_WRITE; } if (!prot) prot = PROT_NONE; return prot; @@ -1643,6 +1771,8 @@ static NTSTATUS create_view( struct file_view **view_ret, void *base, size_t siz TRACE( "forcing exec permission on %p-%p\n", base, (char *)base + size - 1 ); mprotect( base, size, unix_prot | PROT_EXEC ); } + + kernel_writewatch_register_range( view, view->base, view->size ); return STATUS_SUCCESS; } @@ -1760,7 +1890,7 @@ static void mprotect_range( void *base, size_t size, BYTE set, BYTE clear ) */ static BOOL set_vprot( struct file_view *view, void *base, size_t size, BYTE vprot ) { - if (view->protect & VPROT_WRITEWATCH) + if (!use_kernel_writewatch && view->protect & VPROT_WRITEWATCH) { /* each page may need different protections depending on write watch flag */ set_page_vprot_bits( base, size, vprot & ~VPROT_WRITEWATCH, ~vprot & ~VPROT_WRITEWATCH ); @@ -1838,8 +1968,12 @@ static void update_write_watches( void *base, size_t size, size_t accessed_size */ static void reset_write_watches( void *base, SIZE_T size ) { - set_page_vprot_bits( base, size, VPROT_WRITEWATCH, 0 ); - mprotect_range( base, size, 0, 0 ); + if (use_kernel_writewatch) kernel_writewatch_reset( base, size ); + else + { + set_page_vprot_bits( base, size, VPROT_WRITEWATCH, 0 ); + mprotect_range( base, size, 0, 0 ); + } } @@ -2172,7 +2306,11 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size, view->protect = vprot | VPROT_PLACEHOLDER; set_vprot( view, base, size, vprot ); - if (vprot & VPROT_WRITEWATCH) reset_write_watches( base, size ); + if (vprot & VPROT_WRITEWATCH) + { + kernel_writewatch_register_range( view, base, size ); + reset_write_watches( base, size ); + } *view_ret = view; return STATUS_SUCCESS; } @@ -2342,6 +2480,7 @@ static NTSTATUS decommit_pages( struct file_view *view, size_t start, size_t siz if (anon_mmap_fixed( (char *)view->base + start, size, PROT_NONE, 0 ) != MAP_FAILED) { set_page_vprot_bits( (char *)view->base + start, size, 0, VPROT_COMMITTED ); + kernel_writewatch_register_range( view, (char *)view->base + start, size ); return STATUS_SUCCESS; } return STATUS_NO_MEMORY; @@ -3449,6 +3588,7 @@ void virtual_init(void) size_t size; int i; pthread_mutexattr_t attr; + const char *env_var; if (r_debug && (wine_r_debug = *r_debug)) r_debug_set_state( RT_CONSISTENT ); @@ -3464,6 +3604,12 @@ void virtual_init(void) host_addr_space_limit = address_space_limit; #endif + if (!((env_var = getenv( "WINE_DISABLE_KERNEL_WRITEWATCH" )) && atoi( env_var ))) + kernel_writewatch_init(); + + if (use_kernel_writewatch) + WARN( "using kernel write watches, use_kernel_writewatch %d.\n", use_kernel_writewatch ); + if (preload_info && *preload_info) for (i = 0; (*preload_info)[i].size; i++) mmap_add_reserved_area( (*preload_info)[i].addr, (*preload_info)[i].size ); @@ -4181,7 +4327,7 @@ NTSTATUS virtual_handle_fault( EXCEPTION_RECORD *rec, void *stack ) } else ret = grow_thread_stack( page, &stack_info ); } - else if (err & EXCEPTION_WRITE_FAULT) + else if (!use_kernel_writewatch && err & EXCEPTION_WRITE_FAULT) { if (vprot & VPROT_WRITEWATCH) { @@ -4275,11 +4421,11 @@ static NTSTATUS check_write_access( void *base, size_t size, BOOL *has_write_wat for (i = 0; i < size; i += page_size) { BYTE vprot = get_page_vprot( addr + i ); - if (vprot & VPROT_WRITEWATCH) *has_write_watch = TRUE; + if (!use_kernel_writewatch && vprot & VPROT_WRITEWATCH) *has_write_watch = TRUE; if (!(get_unix_prot( vprot & ~VPROT_WRITEWATCH ) & PROT_WRITE)) return STATUS_INVALID_USER_BUFFER; } - if (*has_write_watch) + if (!use_kernel_writewatch && *has_write_watch) mprotect_range( addr, size, 0, VPROT_WRITEWATCH ); /* temporarily enable write access */ return STATUS_SUCCESS; } @@ -4321,7 +4467,7 @@ ssize_t virtual_locked_read( int fd, void *addr, size_t size ) int err = EFAULT; ssize_t ret = read( fd, addr, size ); - if (ret != -1 || errno != EFAULT) return ret; + if (ret != -1 || use_kernel_writewatch || errno != EFAULT) return ret; server_enter_uninterrupted_section( &virtual_mutex, &sigset ); if (!check_write_access( addr, size, &has_write_watch )) @@ -4346,7 +4492,7 @@ ssize_t virtual_locked_pread( int fd, void *addr, size_t size, off_t offset ) int err = EFAULT; ssize_t ret = pread( fd, addr, size, offset ); - if (ret != -1 || errno != EFAULT) return ret; + if (ret != -1 || use_kernel_writewatch || errno != EFAULT) return ret; server_enter_uninterrupted_section( &virtual_mutex, &sigset ); if (!check_write_access( addr, size, &has_write_watch )) @@ -4372,7 +4518,7 @@ ssize_t virtual_locked_recvmsg( int fd, struct msghdr *hdr, int flags ) int err = EFAULT; ssize_t ret = recvmsg( fd, hdr, flags ); - if (ret != -1 || errno != EFAULT) return ret; + if (ret != -1 || use_kernel_writewatch || errno != EFAULT) return ret; server_enter_uninterrupted_section( &virtual_mutex, &sigset ); for (i = 0; i < hdr->msg_iovlen; i++) @@ -6175,6 +6321,13 @@ NTSTATUS WINAPI NtGetWriteWatch( HANDLE process, ULONG flags, PVOID base, SIZE_T char *addr = base; char *end = addr + size; + if (use_kernel_writewatch) + { + if (!(status = kernel_get_write_watches( base, size, addresses, count, flags & WRITE_WATCH_FLAG_RESET ))) + *granularity = page_size; + goto done; + } + while (pos < *count && addr < end) { if (!(get_page_vprot( addr ) & VPROT_WRITEWATCH)) addresses[pos++] = addr; @@ -6186,6 +6339,7 @@ NTSTATUS WINAPI NtGetWriteWatch( HANDLE process, ULONG flags, PVOID base, SIZE_T } else status = STATUS_INVALID_PARAMETER; +done: server_leave_uninterrupted_section( &virtual_mutex, &sigset ); return status; } diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 4fd5fc00cdda..0f822402c713 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -8062,6 +8062,7 @@ static void test_write_watch(void) ok( count == 9 || !count /* Win 11 */, "wrong count %Iu\n", count ); ok( !base[0], "data set\n" ); + base[0x1000] = 1; send(src, "test message", sizeof("test message"), 0); ret = GetOverlappedResult( (HANDLE)dest, &ov, &bytesReturned, TRUE ); @@ -8070,10 +8071,19 @@ static void test_write_watch(void) ok( !memcmp( base, "test ", 5 ), "wrong data %s\n", base ); ok( !memcmp( base + 0x4000, "message", 8 ), "wrong data %s\n", base + 0x4000 ); + count = 64; + ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); + ok( !ret, " GetWriteWatch failed %lu\n", GetLastError() ); + todo_wine_if( count == 3 ) ok( count == 1, "wrong count %Iu\n", count ); + todo_wine_if( count == 3 ) ok( results[0] == base + 0x1000, "got page %Iu.\n", ((char *)results[0] - base) / 0x1000 ); + + base[0x2000] = 1; count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); - ok( count == 0, "wrong count %Iu\n", count ); + todo_wine_if( count == 4 ) ok( count == 2, "wrong count %Iu\n", count ); + todo_wine_if( count == 4 ) ok( results[0] == base + 0x1000, "got page %Iu.\n", ((char *)results[0] - base) / 0x1000 ); + todo_wine_if( count == 4 ) ok( results[1] == base + 0x2000, "got page %Iu.\n", ((char *)results[1] - base) / 0x1000 ); memset( base, 0, size ); count = 64; @@ -8104,7 +8114,7 @@ static void test_write_watch(void) count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); - ok( count == 0, "wrong count %Iu\n", count ); + todo_wine_if( count == 2 ) ok( count == 0, "wrong count %Iu\n", count ); memset( base, 0, size ); count = 64; @@ -8133,7 +8143,7 @@ static void test_write_watch(void) count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); - ok( count == 0, "wrong count %Iu\n", count ); + todo_wine_if( count == 1 ) ok( count == 0, "wrong count %Iu\n", count ); } WSACloseEvent( event ); closesocket( dest ); From fbae1587e8fd17826b44bf4b42e313fd858b8992 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 11 Mar 2024 13:53:08 -0600 Subject: [PATCH 0181/2542] ntdll: Use kernel soft dirty flags for write watches support. Requires custom kernel patches to have effect. CW-Bug-Id: #23524 --- dlls/ntdll/unix/virtual.c | 121 +++++++++++++++++++++++++++++++++++++- 1 file changed, 120 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 2cb6db8758a3..ac01aaf51479 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -334,6 +334,9 @@ static BYTE *pages_vprot; static int use_kernel_writewatch; static int uffd_fd, pagemap_fd; +static int pagemap_reset_fd, clear_refs_fd; +#define PAGE_FLAGS_BUFFER_LENGTH 1024 +#define PM_SOFT_DIRTY_PAGE (1ull << 57) static struct file_view *view_block_start, *view_block_end, *next_free_view; #ifdef _WIN64 @@ -378,18 +381,40 @@ void *anon_mmap_alloc( size_t size, int prot ) return mmap( NULL, size, prot, MAP_PRIVATE | MAP_ANON, -1, 0 ); } +static void kernel_writewatch_softdirty_init(void) +{ + if ((pagemap_reset_fd = open( "/proc/self/pagemap_reset", O_RDONLY | O_CLOEXEC )) == -1) return; + + if ((pagemap_fd = open( "/proc/self/pagemap", O_RDONLY | O_CLOEXEC )) == -1) + { + ERR( "Could not open pagemap file, error %s.\n", strerror( errno )); + exit(-1); + } + if ((clear_refs_fd = open( "/proc/self/clear_refs", O_WRONLY | O_CLOEXEC )) == -1) + { + ERR( "Could not open clear_refs file, error %s.\n", strerror( errno )); + exit(-1); + } + use_kernel_writewatch = 2; +} + static void kernel_writewatch_init(void) { struct uffdio_api uffdio_api; uffd_fd = syscall( __NR_userfaultfd, O_CLOEXEC | O_NONBLOCK | UFFD_USER_MODE_ONLY ); - if (uffd_fd == -1) return; + if (uffd_fd == -1) + { + kernel_writewatch_softdirty_init(); + return; + } uffdio_api.api = UFFD_API; uffdio_api.features = UFFD_FEATURE_WP_ASYNC | UFFD_FEATURE_WP_UNPOPULATED; if (ioctl( uffd_fd, UFFDIO_API, &uffdio_api ) || uffdio_api.api != UFFD_API) { close( uffd_fd ); + kernel_writewatch_softdirty_init(); return; } pagemap_fd = open( "/proc/self/pagemap", O_CLOEXEC | O_RDONLY ); @@ -406,6 +431,21 @@ static void kernel_writewatch_reset( void *start, SIZE_T len ) { struct pm_scan_arg arg = { 0 }; + if (use_kernel_writewatch == 2) + { + char buffer[17]; + ssize_t ret; + + memset(buffer, 0, sizeof(buffer)); + buffer[0] = '6'; + *(ULONG64 *)&buffer[1] = (ULONG_PTR)start; + *(ULONG64 *)&buffer[1 + 8] = (ULONG_PTR)start + len; + + if ((ret = write(clear_refs_fd, buffer, sizeof(buffer))) != sizeof(buffer)) + ERR("Could not clear soft dirty bits, ret %zd, error %s.\n", ret, strerror(errno)); + return; + } + arg.size = sizeof(arg); arg.start = (UINT_PTR)start; arg.end = arg.start + len; @@ -424,6 +464,12 @@ static void kernel_writewatch_register_range( struct file_view *view, void *base if (!(view->protect & VPROT_WRITEWATCH) || !use_kernel_writewatch) return; madvise( base, size, MADV_NOHUGEPAGE ); + if (use_kernel_writewatch == 2) + { + kernel_writewatch_reset( base, size ); + return; + } + uffdio_register.range.start = (UINT_PTR)base; uffdio_register.range.len = size; uffdio_register.mode = UFFDIO_REGISTER_MODE_WP; @@ -449,6 +495,77 @@ static void kernel_writewatch_register_range( struct file_view *view, void *base } } +static NTSTATUS kernel_soft_dirty_get_write_watches( void *base, SIZE_T size, void **addresses, ULONG_PTR *count, BOOL reset ) +{ + static UINT64 buffer[PAGE_FLAGS_BUFFER_LENGTH]; + char *addr = base; + char *end = addr + size; + unsigned int i, length; + ssize_t read_length; + ULONG_PTR pos = 0; + + if (reset) + { + if (is_win64) + { + addresses[0] = end; + if ((read_length = pread(pagemap_reset_fd, addresses, *count * sizeof(*addresses), + ((ULONG_PTR)addr >> page_shift) * sizeof(*addresses))) == -1) + { + ERR("Error reading page flags, read_length %zd, error %s.\n", read_length, strerror(errno)); + return STATUS_INVALID_ADDRESS; + } + *count = read_length / sizeof(*addresses); + return STATUS_SUCCESS; + } + + while (pos < *count && addr < end) + { + length = min(PAGE_FLAGS_BUFFER_LENGTH, *count - pos); + + buffer[0] = (ULONG_PTR)end; + if ((read_length = pread(pagemap_reset_fd, buffer, length * sizeof(*buffer), + ((ULONG_PTR)addr >> page_shift) * sizeof(*buffer))) == -1) + { + ERR("Error reading page flags, read_length %zd, error %s.\n", read_length, strerror(errno)); + return STATUS_INVALID_ADDRESS; + } + read_length /= sizeof(*buffer); + for (i = 0; i < read_length; ++i) + { + assert(pos < *count); + addresses[pos++] = (void *)(ULONG_PTR)buffer[i]; + } + if (read_length < length) + break; + addr = (char *)(ULONG_PTR)buffer[read_length - 1] + page_size; + } + *count = pos; + return STATUS_SUCCESS; + } + + while (pos < *count && addr < end) + { + length = min(PAGE_FLAGS_BUFFER_LENGTH, (end - addr) >> page_shift); + + if ((read_length = pread(pagemap_fd, buffer, length * sizeof(*buffer), + ((ULONG_PTR)addr >> page_shift) * sizeof(*buffer))) != length * sizeof(*buffer)) + { + ERR("Error reading page flags, read_length %zd, error %s.\n", read_length, strerror(errno)); + return STATUS_INVALID_ADDRESS; + } + for (i = 0; i < length && pos < *count; ++i) + { + if (buffer[i] & PM_SOFT_DIRTY_PAGE) + addresses[pos++] = addr; + + addr += page_size; + } + } + *count = pos; + return STATUS_SUCCESS; +} + static NTSTATUS kernel_get_write_watches( void *base, SIZE_T size, void **buffer, ULONG_PTR *count, BOOL reset ) { SIZE_T buffer_len = count ? *count : 0; @@ -460,6 +577,8 @@ static NTSTATUS kernel_get_write_watches( void *base, SIZE_T size, void **buffer assert( !(size & page_mask) ); + if (use_kernel_writewatch == 2) return kernel_soft_dirty_get_write_watches( base, size, buffer, count, reset ); + arg.size = sizeof(arg); arg.vec = (UINT_PTR)rgns; arg.vec_len = ARRAY_SIZE(rgns); From dccdf5c729899b78fe0d5b864ae6e29d0bf90477 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Wed, 4 Mar 2020 18:49:37 +0100 Subject: [PATCH 0182/2542] HACK: ntdll: Mark first gta5.exe page as copied. --- dlls/ntdll/unix/virtual.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index ac01aaf51479..909c089cf07d 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -247,6 +247,7 @@ struct file_view #define VPROT_GUARD 0x10 #define VPROT_COMMITTED 0x20 #define VPROT_WRITEWATCH 0x40 +#define VPROT_COPIED 0x80 /* per-mapping protection flags */ #define VPROT_ARM64EC 0x0100 /* view may contain ARM64EC code */ #define VPROT_SYSTEM 0x0200 /* system view (underlying mmap not under our control) */ @@ -1495,7 +1496,8 @@ static const char *get_prot_str( BYTE prot ) buffer[0] = (prot & VPROT_COMMITTED) ? 'c' : '-'; buffer[1] = (prot & VPROT_GUARD) ? 'g' : ((prot & VPROT_WRITEWATCH) ? 'H' : '-'); buffer[2] = (prot & VPROT_READ) ? 'r' : '-'; - buffer[3] = (prot & VPROT_WRITECOPY) ? 'W' : ((prot & VPROT_WRITE) ? 'w' : '-'); + buffer[3] = (prot & VPROT_WRITECOPY) ? (prot & VPROT_COPIED ? 'w' : 'W') + : ((prot & VPROT_WRITE) ? 'w' : '-'); buffer[4] = (prot & VPROT_EXEC) ? 'x' : '-'; buffer[5] = 0; return buffer; @@ -1903,7 +1905,11 @@ static NTSTATUS create_view( struct file_view **view_ret, void *base, size_t siz */ static DWORD get_win32_prot( BYTE vprot, unsigned int map_prot ) { - DWORD ret = VIRTUAL_Win32Flags[vprot & 0x0f]; + DWORD ret; + + if ((vprot & (VPROT_COPIED | VPROT_WRITECOPY)) == (VPROT_COPIED | VPROT_WRITECOPY)) + vprot = (vprot & ~VPROT_WRITECOPY) | VPROT_WRITE; + ret = VIRTUAL_Win32Flags[vprot & 0x0f]; if (vprot & VPROT_GUARD) ret |= PAGE_GUARD; if (map_prot & SEC_NOCACHE) ret |= PAGE_NOCACHE; return ret; @@ -5396,6 +5402,24 @@ NTSTATUS WINAPI NtProtectVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T { old = get_win32_prot( vprot, view->protect ); status = set_protection( view, base, size, new_prot ); + + /* GTA5 HACK: Mark first page as copied. */ + if (status == STATUS_SUCCESS && (view->protect & SEC_IMAGE) && + base == (void*)NtCurrentTeb()->Peb->ImageBaseAddress) + { + const WCHAR gta5W[] = { 'g','t','a','5','.','e','x','e',0 }; + WCHAR *name, *p; + + name = NtCurrentTeb()->Peb->ProcessParameters->ImagePathName.Buffer; + p = wcsrchr(name, '\\'); + p = p ? p+1 : name; + + if(!wcsicmp(p, gta5W)) + { + FIXME("HACK: changing GTA5.exe vprot\n"); + set_page_vprot_bits(base, page_size, VPROT_COPIED, 0); + } + } } else status = STATUS_NOT_COMMITTED; } From 245dfe63a720eae04890a8d3e0f74ebae800ffbd Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Wed, 17 Oct 2018 04:13:37 -0700 Subject: [PATCH 0183/2542] ntdll/loader: add support for overriding IMAGE_FILE_LARGE_ADDRESS_AWARE --- dlls/kernel32/heap.c | 8 +++++++- dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/signal_arm64ec.c | 1 + dlls/ntdll/unix/unix_private.h | 2 ++ dlls/ntdll/unix/virtual.c | 22 ++++++++++++++++++++-- dlls/wow64/system.c | 6 ++++++ 6 files changed, 37 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/heap.c b/dlls/kernel32/heap.c index 1ec2f5cce0da..10f6895478e5 100644 --- a/dlls/kernel32/heap.c +++ b/dlls/kernel32/heap.c @@ -42,6 +42,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(globalmem); +extern BOOL WINAPI __wine_needs_override_large_address_aware(void); + /*********************************************************************** * HeapCreate (KERNEL32.@) * @@ -424,6 +426,7 @@ VOID WINAPI GlobalMemoryStatus( LPMEMORYSTATUS lpBuffer ) OSVERSIONINFOW osver; #ifndef _WIN64 IMAGE_NT_HEADERS *nt = RtlImageNtHeader( GetModuleHandleW(0) ); + static int force_large_address_aware = -1; #endif /* Because GlobalMemoryStatus is identical to GlobalMemoryStatusEX save @@ -450,6 +453,8 @@ VOID WINAPI GlobalMemoryStatus( LPMEMORYSTATUS lpBuffer ) lpBuffer->dwAvailVirtual = memstatus.ullAvailVirtual; #ifndef _WIN64 + if (force_large_address_aware == -1) + force_large_address_aware = __wine_needs_override_large_address_aware(); if ( osver.dwMajorVersion >= 5 || osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) { lpBuffer->dwTotalPhys = min( memstatus.ullTotalPhys, MAXDWORD ); @@ -463,7 +468,8 @@ VOID WINAPI GlobalMemoryStatus( LPMEMORYSTATUS lpBuffer ) /* values are limited to 2Gb unless the app has the IMAGE_FILE_LARGE_ADDRESS_AWARE flag */ /* page file sizes are not limited (Adobe Illustrator 8 depends on this) */ - if (!(nt->FileHeader.Characteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE)) + if (!(nt->FileHeader.Characteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE) && + !force_large_address_aware) { if (lpBuffer->dwTotalPhys > MAXLONG) lpBuffer->dwTotalPhys = MAXLONG; if (lpBuffer->dwAvailPhys > MAXLONG) lpBuffer->dwAvailPhys = MAXLONG; diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 620d96a59926..b3d93326d8c3 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1760,3 +1760,4 @@ # Filesystem @ stdcall -syscall wine_nt_to_unix_file_name(ptr ptr ptr long) @ stdcall -syscall wine_unix_to_nt_file_name(str ptr ptr) +@ stdcall -syscall __wine_needs_override_large_address_aware() diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index 4505aeacfbae..d64647f7b45a 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -581,6 +581,7 @@ DEFINE_SYSCALL(NtWriteVirtualMemory, (HANDLE process, void *addr, const void *bu DEFINE_SYSCALL(NtYieldExecution, (void)) DEFINE_SYSCALL(wine_nt_to_unix_file_name, (const OBJECT_ATTRIBUTES *attr, char *nameA, ULONG *size, UINT disposition)) DEFINE_SYSCALL(wine_unix_to_nt_file_name, (const char *name, WCHAR *buffer, ULONG *size)) +DEFINE_SYSCALL_(BOOL, __wine_needs_override_large_address_aware, (void)) NTSTATUS SYSCALL_API NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG_PTR zero_bits, SIZE_T *size_ptr, ULONG type, ULONG protect ) diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 2f956af6966c..007b4fb85bc9 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -575,4 +575,6 @@ static inline NTSTATUS map_section( HANDLE mapping, void **ptr, SIZE_T *size, UL 0, NULL, size, ViewShare, 0, protect ); } +BOOL WINAPI __wine_needs_override_large_address_aware(void); + #endif /* __NTDLL_UNIX_PRIVATE_H */ diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 909c089cf07d..31fa04fdab39 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -4904,6 +4904,24 @@ static void virtual_release_address_space(void) #endif /* _WIN64 */ +BOOL WINAPI __wine_needs_override_large_address_aware(void) +{ + static int needs_override = -1; + + if (needs_override == -1) + { + const char *str = getenv( "WINE_LARGE_ADDRESS_AWARE" ); + + needs_override = !str || atoi(str) == 1; + } + return needs_override; +} + +static BOOL is_large_address_aware(void) +{ + return (main_image_info.ImageCharacteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE) + || __wine_needs_override_large_address_aware(); +} /*********************************************************************** * virtual_set_large_address_space @@ -4915,7 +4933,7 @@ void virtual_set_large_address_space(void) if (is_win64) { if (is_wow64()) - user_space_wow_limit = ((main_image_info.ImageCharacteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE) ? limit_4g : limit_2g) - 1; + user_space_wow_limit = (is_large_address_aware() ? limit_4g : limit_2g) - 1; #ifndef __APPLE__ /* don't free the zerofill section on macOS */ else if ((main_image_info.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA) && (main_image_info.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE)) @@ -4924,7 +4942,7 @@ void virtual_set_large_address_space(void) } else { - if (!(main_image_info.ImageCharacteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE)) return; + if (!is_large_address_aware()) return; free_reserved_memory( (char *)0x80000000, address_space_limit ); } user_space_limit = working_set_limit = address_space_limit; diff --git a/dlls/wow64/system.c b/dlls/wow64/system.c index 5f3056a41790..2f466d869dd5 100644 --- a/dlls/wow64/system.c +++ b/dlls/wow64/system.c @@ -855,3 +855,9 @@ NTSTATUS WINAPI wow64_NtWow64GetNativeSystemInformation( UINT *args ) return STATUS_INVALID_INFO_CLASS; } } + +BOOL WINAPI __wine_needs_override_large_address_aware(void); +NTSTATUS WINAPI wow64___wine_needs_override_large_address_aware( UINT * args ) +{ + return __wine_needs_override_large_address_aware(); +} From bda7a520407ec38af62061bdb71947424124459e Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Wed, 15 Jul 2020 14:57:28 -0500 Subject: [PATCH 0184/2542] wineboot: On prefix upgrade, update win10 build number Some games (Death Stranding) require later build numbers than we had shipped earlier. So fix it up on existing prefixes. --- programs/wineboot/wineboot.c | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c index ac419b4d1f43..1a2fda608e2e 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c @@ -1600,6 +1600,46 @@ static void update_user_profile(void) LocalFree(sid); } +static void update_win_version(void) +{ + static const WCHAR win10_buildW[] = L"19043"; + static const WCHAR win10_ntW[] = L"6.3"; + + HKEY cv_h; + DWORD type, sz; + WCHAR current_version[256]; + + if(RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion", + 0, KEY_ALL_ACCESS, &cv_h) == ERROR_SUCCESS){ + /* get the current windows version */ + sz = sizeof(current_version); + if(RegQueryValueExW(cv_h, L"CurrentVersion", NULL, &type, (BYTE *)current_version, &sz) == ERROR_SUCCESS && + type == REG_SZ){ + if(!wcscmp(current_version, L"6.3") || !wcscmp(current_version, L"10.0")){ + RegSetValueExW(cv_h, L"CurrentVersion", 0, REG_SZ, (const BYTE *)win10_ntW, sizeof(win10_ntW)); + RegSetValueExW(cv_h, L"CurrentBuild", 0, REG_SZ, (const BYTE *)win10_buildW, sizeof(win10_buildW)); + RegSetValueExW(cv_h, L"CurrentBuildNumber", 0, REG_SZ, (const BYTE *)win10_buildW, sizeof(win10_buildW)); + } + } + RegCloseKey(cv_h); + } + + if(RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Wow6432Node\\Microsoft\\Windows NT\\CurrentVersion", + 0, KEY_ALL_ACCESS, &cv_h) == ERROR_SUCCESS){ + /* get the current windows version */ + sz = sizeof(current_version); + if(RegQueryValueExW(cv_h, L"CurrentVersion", NULL, &type, (BYTE *)current_version, &sz) == ERROR_SUCCESS && + type == REG_SZ){ + if(!wcscmp(current_version, L"6.3") || !wcscmp(current_version, L"10.0")){ + RegSetValueExW(cv_h, L"CurrentVersion", 0, REG_SZ, (const BYTE *)win10_ntW, sizeof(win10_ntW)); + RegSetValueExW(cv_h, L"CurrentBuild", 0, REG_SZ, (const BYTE *)win10_buildW, sizeof(win10_buildW)); + RegSetValueExW(cv_h, L"CurrentBuildNumber", 0, REG_SZ, (const BYTE *)win10_buildW, sizeof(win10_buildW)); + } + } + RegCloseKey(cv_h); + } +} + /* execute rundll32 on the wine.inf file if necessary */ static void update_wineprefix( BOOL force ) { @@ -1656,6 +1696,7 @@ static void update_wineprefix( BOOL force ) } install_root_pnp_devices(); update_user_profile(); + update_win_version(); TRACE( "wine: configuration in %s has been updated.\n", debugstr_w(prettyprint_configdir()) ); } From 38d555517daac63e96e8176f7c3f3a58110bd89d Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 22 Dec 2021 00:57:25 +0300 Subject: [PATCH 0185/2542] wine.inf: Set a valid Win10 ProductId. CW-Bug-Id: #19702 --- loader/wine.inf.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index adc39f23ab47..63f84b4baf2a 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -377,7 +377,7 @@ HKCU,%CurrentVersion%\Run,,16 HKCU,%CurrentVersionNT%\Winlogon,,16 HKLM,%CurrentVersion%,"CommonFilesDir",,"%16427%" HKLM,%CurrentVersion%,"FirstInstallDateTime",1,21,81,7c,23 -HKLM,%CurrentVersion%,"ProductId",,"12345-oem-0000001-54321" +HKLM,%CurrentVersion%,"ProductId",,"00330-50000-00000-AAOEM" HKLM,%CurrentVersion%,"ProgramFilesDir",,"%16422%" HKLM,%CurrentVersion%,"ProgramFilesPath",0x20000,"%%ProgramFiles%%" HKLM,%CurrentVersion%,"RegisteredOrganization",2,"" @@ -403,7 +403,7 @@ HKLM,%CurrentVersion%\Shell Extensions\Approved,,16 HKLM,%CurrentVersion%\Time Zones,"SymbolicLinkValue",0x60000,"\Registry\Machine\%CurrentVersionNT%\Time Zones" HKLM,%CurrentVersion%\Uninstall,,16 HKLM,%CurrentVersionNT%,"InstallDate",0x10003,1273299354 -HKLM,%CurrentVersionNT%,"ProductId",,"12345-oem-0000001-54321" +HKLM,%CurrentVersionNT%,"ProductId",,"00330-50000-00000-AAOEM" HKLM,%CurrentVersionNT%,"RegisteredOrganization",2,"" HKLM,%CurrentVersionNT%,"RegisteredOwner",2,"" HKLM,%CurrentVersionNT%,"SystemRoot",,"%10%" From 2abd87ef2003a970d29e8f1714ecc4ddeff62512 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 22 Dec 2021 00:59:32 +0300 Subject: [PATCH 0186/2542] wineboot: Generate better DigitalProductId. CW-Bug-Id: #19702 --- loader/wine.inf.in | 2 +- programs/wineboot/wineboot.c | 48 ++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 63f84b4baf2a..9eeefbbc799e 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2543,7 +2543,7 @@ HKLM,%CurrentVersionNT%,"CurrentMinorVersionNumber",0x10003,0 HKLM,%CurrentVersionNT%,"CurrentBuild",2,"19043" HKLM,%CurrentVersionNT%,"CurrentBuildNumber",2,"19043" HKLM,%CurrentVersionNT%,"CurrentType",2,"Multiprocessor Free" -HKLM,%CurrentVersionNT%,"DigitalProductId",1,00,00,00,00,00,00,00,00,00,00,00,\ +HKLM,%CurrentVersionNT%,"DigitalProductId",2,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c index 1a2fda608e2e..a24274483a18 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c @@ -68,6 +68,7 @@ #include #include #include +#include #include #include #include @@ -1798,6 +1799,52 @@ static void usage( int status ) exit( status ); } +static void create_digitalproductid(void) +{ + BYTE digital_product_id[0xa4]; + char product_id[256]; + LSTATUS status; + unsigned int i; + DWORD size; + DWORD type; + HKEY key; + + if ((status = RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion", + 0, KEY_ALL_ACCESS, &key ))) + return; + size = sizeof(product_id); + status = RegQueryValueExA( key, "ProductId", NULL, &type, (BYTE *)product_id, &size ); + if (status) goto done; + if (!size) goto done; + if (product_id[size - 1]) + { + if (size == sizeof(product_id)) goto done; + product_id[size++] = 0; + } + + if (!RegQueryValueExA( key, "DigitalProductId", NULL, &type, NULL, &size ) && size == sizeof(digital_product_id)) + { + if (RegQueryValueExA( key, "DigitalProductId", NULL, &type, digital_product_id, &size )) + goto done; + for (i = 0; i < size; ++i) + if (digital_product_id[i]) break; + if (i < size) goto done; + } + + memset( digital_product_id, 0, sizeof(digital_product_id) ); + *(DWORD *)digital_product_id = sizeof(digital_product_id); + digital_product_id[4] = 3; + strcpy( (char *)digital_product_id + 8, product_id ); + *(DWORD *)(digital_product_id + 0x20) = 0x0cec; + *(DWORD *)(digital_product_id + 0x34) = 0x0cec; + strcpy( (char *)digital_product_id + 0x24, "[TH] X19-99481" ); + digital_product_id[0x42] = 8; + RtlGenRandom( digital_product_id + 0x38, 0x18 ); + RegSetValueExA( key, "DigitalProductId", 0, REG_BINARY, digital_product_id, sizeof(digital_product_id) ); +done: + RegCloseKey( key ); +} + int __cdecl main( int argc, char *argv[] ) { /* First, set the current directory to SystemRoot */ @@ -1907,6 +1954,7 @@ int __cdecl main( int argc, char *argv[] ) } if (init || update) update_wineprefix( update ); + create_digitalproductid(); create_volatile_environment_registry_key(); ProcessRunKeys( HKEY_LOCAL_MACHINE, L"RunOnce", TRUE, TRUE ); From 4fc516234b9da29b955b34a517339784e0510688 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 24 Mar 2023 17:32:02 -0600 Subject: [PATCH 0187/2542] wineboot: Load root certificates on prefix update. CW-Bug-Id: #22034 --- programs/wineboot/Makefile.in | 2 +- programs/wineboot/wineboot.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/programs/wineboot/Makefile.in b/programs/wineboot/Makefile.in index 0983420a91f0..035197970d85 100644 --- a/programs/wineboot/Makefile.in +++ b/programs/wineboot/Makefile.in @@ -1,6 +1,6 @@ MODULE = wineboot.exe IMPORTS = uuid advapi32 ws2_32 kernelbase -DELAYIMPORTS = shell32 shlwapi version user32 gdi32 setupapi newdev +DELAYIMPORTS = shell32 shlwapi version user32 gdi32 setupapi newdev crypt32 EXTRADLLFLAGS = -mconsole diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c index a24274483a18..31c2c4645599 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c @@ -79,6 +79,7 @@ #include #include #include +#include #include "resource.h" WINE_DEFAULT_DEBUG_CHANNEL(wineboot); @@ -1641,6 +1642,15 @@ static void update_win_version(void) } } +static void update_root_certs(void) +{ + HCERTSTORE store; + + store = CertOpenStore( CERT_STORE_PROV_SYSTEM_REGISTRY_W, 0, 0, CERT_STORE_OPEN_EXISTING_FLAG + | CERT_STORE_READONLY_FLAG | CERT_SYSTEM_STORE_LOCAL_MACHINE, L"Root"); + CertCloseStore( store, 0 ); +} + /* execute rundll32 on the wine.inf file if necessary */ static void update_wineprefix( BOOL force ) { @@ -1698,6 +1708,7 @@ static void update_wineprefix( BOOL force ) install_root_pnp_devices(); update_user_profile(); update_win_version(); + update_root_certs(); TRACE( "wine: configuration in %s has been updated.\n", debugstr_w(prettyprint_configdir()) ); } From 160a200105244206f1f7d5a6bf69c676b5a9d57f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 21 Nov 2023 18:42:14 +0100 Subject: [PATCH 0188/2542] HACK: winegstreamer/wma_decoder: Support XMAudio2 input format in WMA decoder. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51931 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52391 CW-Bug-Id: #16839 CW-Bug-Id: #18678 CW-Bug-Id: #19362 Wine-Staging: mfplat-streaming-support CW-Bug-Id: #20833 --- dlls/winegstreamer/mfplat.c | 11 ++++++++++- dlls/winegstreamer/quartz_parser.c | 14 ++++++++++++-- dlls/winegstreamer/unixlib.h | 1 + dlls/winegstreamer/wg_format.c | 18 ++++++++++++++---- dlls/winegstreamer/wma_decoder.c | 3 +++ 5 files changed, 40 insertions(+), 7 deletions(-) diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index fd2c6995d8c5..7e332b29eb23 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -39,6 +39,7 @@ DEFINE_GUID(DMOVideoFormat_RGB565,D3DFMT_R5G6B5,0x524f,0x11ce,0x9f,0x53,0x00,0x2 DEFINE_GUID(DMOVideoFormat_RGB555,D3DFMT_X1R5G5B5,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); DEFINE_GUID(DMOVideoFormat_RGB8,D3DFMT_P8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); DEFINE_MEDIATYPE_GUID(MFAudioFormat_RAW_AAC,WAVE_FORMAT_RAW_AAC1); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_XMAudio2, 0x0166); DEFINE_MEDIATYPE_GUID(MFVideoFormat_VC1S,MAKEFOURCC('V','C','1','S')); DEFINE_MEDIATYPE_GUID(MFVideoFormat_IV50,MAKEFOURCC('I','V','5','0')); DEFINE_MEDIATYPE_GUID(MFVideoFormat_ABGR32,D3DFMT_A8B8G8R8); @@ -668,6 +669,7 @@ static void mf_media_type_to_wg_format_audio_wma(IMFMediaType *type, const GUID { UINT32 rate, depth, channels, block_align, bytes_per_second, codec_data_len; BYTE codec_data[64]; + bool is_xma = false; UINT32 version; if (FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &rate))) @@ -709,6 +711,11 @@ static void mf_media_type_to_wg_format_audio_wma(IMFMediaType *type, const GUID version = 3; else if (IsEqualGUID(subtype, &MFAudioFormat_WMAudio_Lossless)) version = 4; + else if (IsEqualGUID(subtype, &MFAudioFormat_XMAudio2)) + { + version = 2; + is_xma = true; + } else { assert(0); @@ -724,6 +731,7 @@ static void mf_media_type_to_wg_format_audio_wma(IMFMediaType *type, const GUID format->u.audio.block_align = block_align; format->u.audio.codec_data_len = codec_data_len; memcpy(format->u.audio.codec_data, codec_data, codec_data_len); + format->u.audio.is_xma = is_xma; } static void mf_media_type_to_wg_format_video_h264(IMFMediaType *type, struct wg_format *format) @@ -880,7 +888,8 @@ void mf_media_type_to_wg_format(IMFMediaType *type, struct wg_format *format) else if (IsEqualGUID(&subtype, &MEDIASUBTYPE_MSAUDIO1) || IsEqualGUID(&subtype, &MFAudioFormat_WMAudioV8) || IsEqualGUID(&subtype, &MFAudioFormat_WMAudioV9) || - IsEqualGUID(&subtype, &MFAudioFormat_WMAudio_Lossless)) + IsEqualGUID(&subtype, &MFAudioFormat_WMAudio_Lossless) || + IsEqualGUID(&subtype, &MFAudioFormat_XMAudio2)) mf_media_type_to_wg_format_audio_wma(type, &subtype, format); else if (IsEqualGUID(&subtype, &MFAudioFormat_AAC) || IsEqualGUID(&subtype, &MFAudioFormat_RAW_AAC)) mf_media_type_to_wg_format_audio_mpeg4(type, &subtype, format); diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index 19b104d55dfa..581ea3af8ab0 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -41,6 +41,7 @@ static const GUID MEDIASUBTYPE_VC1S = {mmioFOURCC('V','C','1','S'), 0x0000, 0x00 static const GUID MEDIASUBTYPE_MP3 = {WAVE_FORMAT_MPEGLAYER3, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}; static const GUID MEDIASUBTYPE_WMV_Unknown = {0x7ce12ca9, 0xbfbf, 0x43d9, {0x9d, 0x00, 0x82, 0xb8, 0xed, 0x54, 0x31, 0x6b}}; DEFINE_GUID(MEDIASUBTYPE_ABGR32,D3DFMT_A8B8G8R8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); +static const GUID MEDIASUBTYPE_XMAUDIO2 = {0x0166, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}; struct parser { @@ -304,6 +305,11 @@ static bool amt_from_wg_format_audio_wma(AM_MEDIA_TYPE *mt, const struct wg_form subtype = &MEDIASUBTYPE_WMAUDIO2; codec_data_len = WMAUDIO2_WFX_EXTRA_BYTES; fmt_tag = WAVE_FORMAT_WMAUDIO2; + if (format->u.audio.is_xma) + { + subtype = &MEDIASUBTYPE_XMAUDIO2; + fmt_tag = 0x0166; + } break; case 3: subtype = &MEDIASUBTYPE_WMAUDIO3; @@ -876,7 +882,8 @@ static bool amt_to_wg_format_audio_mpeg1_layer3(const AM_MEDIA_TYPE *mt, struct return true; } -static bool amt_to_wg_format_audio_wma(const AM_MEDIA_TYPE *mt, struct wg_format *format) +static bool amt_to_wg_format_audio_wma(const AM_MEDIA_TYPE *mt, struct wg_format *format, + bool is_xma) { const WAVEFORMATEX *audio_format = (const WAVEFORMATEX *)mt->pbFormat; @@ -902,6 +909,7 @@ static bool amt_to_wg_format_audio_wma(const AM_MEDIA_TYPE *mt, struct wg_format else assert(false); format->major_type = WG_MAJOR_TYPE_AUDIO_WMA; + format->u.audio.is_xma = is_xma; format->u.audio.bitrate = audio_format->nAvgBytesPerSec * 8; format->u.audio.rate = audio_format->nSamplesPerSec; format->u.audio.depth = audio_format->wBitsPerSample; @@ -1107,7 +1115,9 @@ bool amt_to_wg_format(const AM_MEDIA_TYPE *mt, struct wg_format *format) || IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_WMAUDIO2) || IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_WMAUDIO3) || IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_WMAUDIO_LOSSLESS)) - return amt_to_wg_format_audio_wma(mt, format); + return amt_to_wg_format_audio_wma(mt, format, false); + if (IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_XMAUDIO2)) + return amt_to_wg_format_audio_wma(mt, format, true); return amt_to_wg_format_audio(mt, format); } diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h index 19270bd731ba..7e87fd565309 100644 --- a/dlls/winegstreamer/unixlib.h +++ b/dlls/winegstreamer/unixlib.h @@ -144,6 +144,7 @@ struct wg_format uint32_t payload_type; uint32_t codec_data_len; unsigned char codec_data[64]; + UINT8 is_xma; } audio; /* Valid members for different video formats: diff --git a/dlls/winegstreamer/wg_format.c b/dlls/winegstreamer/wg_format.c index 12fee8c49237..fd8f99c256bc 100644 --- a/dlls/winegstreamer/wg_format.c +++ b/dlls/winegstreamer/wg_format.c @@ -833,10 +833,20 @@ static GstCaps *wg_format_to_caps_audio_wma(const struct wg_format *format) GstBuffer *buffer; GstCaps *caps; - if (!(caps = gst_caps_new_empty_simple("audio/x-wma"))) - return NULL; - if (format->u.audio.version) - gst_caps_set_simple(caps, "wmaversion", G_TYPE_INT, format->u.audio.version, NULL); + if (format->u.audio.is_xma) + { + if (!(caps = gst_caps_new_empty_simple("audio/x-xma"))) + return NULL; + if (format->u.audio.version) + gst_caps_set_simple(caps, "xmaversion", G_TYPE_INT, format->u.audio.version, NULL); + } + else + { + if (!(caps = gst_caps_new_empty_simple("audio/x-wma"))) + return NULL; + if (format->u.audio.version) + gst_caps_set_simple(caps, "wmaversion", G_TYPE_INT, format->u.audio.version, NULL); + } if (format->u.audio.bitrate) gst_caps_set_simple(caps, "bitrate", G_TYPE_INT, format->u.audio.bitrate, NULL); diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c index 09b2ee647b37..6c1e5ed2ea8d 100644 --- a/dlls/winegstreamer/wma_decoder.c +++ b/dlls/winegstreamer/wma_decoder.c @@ -32,12 +32,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(wmadec); WINE_DECLARE_DEBUG_CHANNEL(winediag); +extern const GUID MFAudioFormat_XMAudio2; + static const GUID *const wma_decoder_input_types[] = { &MEDIASUBTYPE_MSAUDIO1, &MFAudioFormat_WMAudioV8, &MFAudioFormat_WMAudioV9, &MFAudioFormat_WMAudio_Lossless, + &MFAudioFormat_XMAudio2, }; static const GUID *const wma_decoder_output_types[] = { From 6dd9c6214278901e019d58e0c80ba0523176cc57 Mon Sep 17 00:00:00 2001 From: Ziqing Hui Date: Wed, 15 Nov 2023 11:43:21 +0800 Subject: [PATCH 0189/2542] winegstreamer: Integrate media-converter to winegstreamer. CW-Bug-Id: #23225 --- dlls/winegstreamer/Makefile.in | 6 + .../winegstreamer/media-converter/audioconv.c | 1102 +++++++++++++++++ .../media-converter/audioconvbin.c | 148 +++ .../winegstreamer/media-converter/fossilize.c | 722 +++++++++++ dlls/winegstreamer/media-converter/lib.c | 329 +++++ .../media-converter/media-converter.h | 290 +++++ dlls/winegstreamer/media-converter/murmur3.c | 371 ++++++ .../winegstreamer/media-converter/videoconv.c | 938 ++++++++++++++ dlls/winegstreamer/unixlib.c | 9 + 9 files changed, 3915 insertions(+) create mode 100644 dlls/winegstreamer/media-converter/audioconv.c create mode 100644 dlls/winegstreamer/media-converter/audioconvbin.c create mode 100644 dlls/winegstreamer/media-converter/fossilize.c create mode 100644 dlls/winegstreamer/media-converter/lib.c create mode 100644 dlls/winegstreamer/media-converter/media-converter.h create mode 100644 dlls/winegstreamer/media-converter/murmur3.c create mode 100644 dlls/winegstreamer/media-converter/videoconv.c diff --git a/dlls/winegstreamer/Makefile.in b/dlls/winegstreamer/Makefile.in index 63ca3f61fdfa..e2cc1123f10c 100644 --- a/dlls/winegstreamer/Makefile.in +++ b/dlls/winegstreamer/Makefile.in @@ -10,6 +10,12 @@ SOURCES = \ aac_decoder.c \ color_convert.c \ main.c \ + media-converter/audioconv.c \ + media-converter/audioconvbin.c \ + media-converter/fossilize.c \ + media-converter/lib.c \ + media-converter/murmur3.c \ + media-converter/videoconv.c \ media_sink.c \ media_source.c \ mfplat.c \ diff --git a/dlls/winegstreamer/media-converter/audioconv.c b/dlls/winegstreamer/media-converter/audioconv.c new file mode 100644 index 000000000000..71612cbfddd0 --- /dev/null +++ b/dlls/winegstreamer/media-converter/audioconv.c @@ -0,0 +1,1102 @@ +/* + * Copyright 2024 Ziqing Hui for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* Algorithm + * --------- + * + * The application feeds encoded audio into XAudio2 in chunks. Since we don't have access to all + * chunks in a stream on initialization (as we do with the video converter), we continuously hash + * the stream as it is sent to us. Each "chunk" is identified as the hash of the entire stream up + * to that chunk. + * + * Since chunks are small (~2 kilobytes), this leads to a significant possibility of two different + * streams having identical intro chunks (imagine two streams that start with several seconds of + * silence). This means we need a tree of chunks. Suppose two incoming streams with chunks that + * hash as shown (i.e. identical intro chunks that diverge later): + * + * Stream 1: [AA BB CC DD] + * + * Stream 2: [AA BB YY ZZ] + * + * We record a tree and the transcoder will walk it depth-first in order to reconstruct each unique + * stream: + * + * AA => aa.ptna + * AA+BB => bb.ptna + * AA+BB+CC => cc.ptna + * AA+BB+CC+DD => dd.ptna + * AA+BB+YY => yy.ptna + * AA+BB+YY+ZZ => zz.ptna + * + * Upon playback, we chain each transcoded stream chunk together as the packets come in: + * + * AA -> start stream with aa.ptna + * BB -> play bb.ptna + * CC -> play cc.ptna + * DD -> play dd.ptna + * + * or: + * + * AA -> start stream with aa.ptna + * BB -> play bb.ptna + * YY -> play yy.ptna + * ZZ -> play zz.ptna + * + * or: + * + * AA -> start stream with aa.ptna + * NN -> not recognized, instead play blank.ptna and mark this stream as needs-transcoding + * OO -> play blank.ptna + * PP -> play blank.ptna + * When the Stream is destroyed, we'll record AA+NN+OO+PP into the needs-transcode database + * for the transcoder to convert later. + * + * + * Physical Format + * --------------- + * + * All stored values are little-endian. + * + * Transcoded audio is stored in the "transcoded" Fossilize database under the + * AUDIO_CONV_FOZ_TAG_PTNADATA tag. Each chunk is stored in one entry with as many of the following + * "Proton Audio" (ptna) packets as are required to store the entire transcoded chunk: + * + * uint32_t packet_header: Information about the upcoming packet, see bitmask: + * MSB [FFFF PPPP PPPP PPPP PPPP LLLL LLLL LLLL] LSB + * L: Number of _bytes_ in this packet following this header. + * P: Number of _samples_ at the end of this packet which are padding and should be skipped. + * F: Flag bits: + * 0x1: This packet is an Opus header + * 0x2, 0x4, 0x8: Reserved for future use. + * + * If the Opus header flag is set: + * Following packet is an Opus identification header, as defined in RFC 7845 "Ogg + * Encapsulation for the Opus Audio Codec" Section 5.1. + * + * + * If the header flag is not set: + * Following packet is raw Opus data to be sent to an Opus decoder. + * + * + * If we encounter a stream which needs transcoding, we record the buffers and metadata in + * a Fossilize database. The database has three tag types: + * + * AUDIO_CONV_FOZ_TAG_STREAM: This identifies each unique stream of buffers. For example: + * [hash(AA+BB+CC+DD)] -> [AA, BB, CC, DD] + * [hash(AA+BB+XX+YY)] -> [AA, BB, XX, YY] + * + * AUDIO_CONV_FOZ_TAG_AUDIODATA: This contans the actual encoded audio data. For example: + * [AA] -> [AA's buffer data] + * [BB] -> [BB's buffer data] + * + * AUDIO_CONV_FOZ_TAG_CODECINFO: This contans the codec data required to decode the buffer. Only + * the "head" of each stream is recorded. For example: + * [AA] -> [ + * uint32_t wmaversion (from WAVEFORMATEX.wFormatTag) + * uint32_t bitrate (from WAVEFORMATEX.nAvgBytesPerSec) + * uint32_t channels (WAVEFORMATEX.nChannels) + * uint32_t rate (WAVEFORMATEX.nSamplesPerSec) + * uint32_t block_align (WAVEFORMATEX.nBlockAlign) + * uint32_t depth (WAVEFORMATEX.wBitsPerSample) + * char[remainder of entry] codec_data (codec data which follows WAVEFORMATEX) + * ] + * + */ + +#if 0 +#pragma makedep unix +#endif + +#include "media-converter.h" + +#include +#include +#include +#include + +GST_DEBUG_CATEGORY_EXTERN(media_converter_debug); +#undef GST_CAT_DEFAULT +#define GST_CAT_DEFAULT media_converter_debug + +#define AUDIO_CONV_ENCODED_LENGTH_MASK 0x00000fff /* 4kB fits in here. */ +#define AUDIO_CONV_PADDING_LENGTH_MASK 0x0ffff000 /* 120ms of samples at 48kHz fits in here. */ +#define AUDIO_CONV_PADDING_LENGTH_SHIFT 12 +#define AUDIO_CONV_FLAG_MASK 0xf0000000 +#define AUDIO_CONV_FLAG_HEADER 0x10000000 /* This chunk is the Opus header. */ +#define _AUDIO_CONV_FLAG_RESERVED1 0x20000000 /* Not yet used */ +#define _AUDIO_CONV_FLAG_RESERVED2 0x40000000 /* Not yet used */ +#define _AUDIO_CONV_FLAG_V2 0x80000000 /* Indicates a "version 2" header, process somehow differently (TBD). */ + +/* Properties of the "blank" audio file. */ +#define _BLANK_AUDIO_FILE_LENGTH_MS 10.0 +#define _BLANK_AUDIO_FILE_RATE 48000.0 + +#define AUDIO_CONV_FOZ_TAG_STREAM 0 +#define AUDIO_CONV_FOZ_TAG_CODECINFO 1 +#define AUDIO_CONV_FOZ_TAG_AUDIODATA 2 +#define AUDIO_CONV_FOZ_TAG_PTNADATA 3 +#define AUDIO_CONV_FOZ_NUM_TAGS 4 + +typedef enum +{ + NO_LOOP, + LOOPING, + LOOP_ENDED, + LOOP_ERROR, +} loop_state; + +struct buffer_entry +{ + struct payload_hash hash; + GstBuffer *buffer; +}; + +/* Followed by codec_data_size bytes codec data. */ +struct need_transcode_head +{ + size_t codec_data_size; + uint32_t wmaversion; + uint32_t bitrate; + uint32_t channels; + uint32_t rate; + uint32_t block_align; + uint32_t depth; +} __attribute__((packed)); + +/* Represents a Stream, a sequence of buffers. */ +struct stream_state +{ + struct murmur3_128_state hash_state; + struct payload_hash current_hash; + GList *buffers; /* Entry type: struct buffer_entry. */ + GList *loop_buffers; /* Entry type: struct buffer_entry. */ + struct need_transcode_head *codec_info; + bool needs_dump; +}; + +struct stream_state_serializer +{ + struct stream_state *state; + int index; +}; + +struct audio_conv_state +{ + bool sent_header; + struct need_transcode_head *codec_data; + struct murmur3_128_state hash_state; + struct murmur3_128_state loop_hash_state; + struct stream_state *stream_state; + struct fozdb *read_fozdb; +}; + +typedef struct +{ + GstElement element; + GstPad *sink_pad, *src_pad; + pthread_mutex_t state_mutex; + struct audio_conv_state *state; +} AudioConv; + +typedef struct +{ + GstElementClass class; +} AudioConvClass; + +G_DEFINE_TYPE(AudioConv, audio_conv, GST_TYPE_ELEMENT); +#define AUDIO_CONV_TYPE (audio_conv_get_type()) +#define AUDIO_CONV(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), AUDIO_CONV_TYPE, AudioConv)) +#define parent_class (audio_conv_parent_class) +GST_ELEMENT_REGISTER_DEFINE(protonaudioconverter, "protonaudioconverter", + GST_RANK_MARGINAL, AUDIO_CONV_TYPE); + +static GstStaticPadTemplate audio_conv_sink_template = GST_STATIC_PAD_TEMPLATE("sink", + GST_PAD_SINK, GST_PAD_ALWAYS, + GST_STATIC_CAPS("audio/x-wma;")); + +static GstStaticPadTemplate audio_conv_src_template = GST_STATIC_PAD_TEMPLATE("src", + GST_PAD_SRC, GST_PAD_ALWAYS, + GST_STATIC_CAPS("audio/x-opus;")); + +static struct dump_fozdb dump_fozdb = {PTHREAD_MUTEX_INITIALIZER, NULL, false}; + +static struct buffer_entry *buffer_entry_create(struct payload_hash *hash, GstBuffer *buffer) +{ + struct buffer_entry *entry = calloc(1, sizeof(*entry)); + entry->hash = *hash; + entry->buffer = gst_buffer_ref(buffer); + return entry; +} + +static void buffer_entry_release(void *arg) +{ + struct buffer_entry *entry = arg; + gst_buffer_unref(entry->buffer); + free(entry); +} + +static bool dumping_disabled(void) +{ + return option_enabled("MEDIACONV_AUDIO_DONT_DUMP"); +} + +static bool hash_data(const uint8_t *data, size_t size, struct murmur3_128_state *hash_state, struct payload_hash *hash) +{ + struct bytes_reader reader; + bytes_reader_init(&reader, data, size); + return murmur3_128_full(&reader, bytes_reader_read, hash_state, hash); +} + +static int dump_fozdb_open_audio(bool create) +{ + return dump_fozdb_open(&dump_fozdb, create, "MEDIACONV_AUDIO_DUMP_FILE", AUDIO_CONV_FOZ_NUM_TAGS); +} + +static void dump_fozdb_discard_transcoded(void) +{ + GList *chunks_to_discard = NULL, *chunks_to_keep = NULL, *chunks = NULL, *list_iter; + struct payload_hash chunk_id, *stream_id; + struct fozdb *read_fozdb; + char *read_fozdb_path; + GHashTableIter iter; + int ret; + + if (dump_fozdb.already_cleaned) + return; + dump_fozdb.already_cleaned = true; + + if (discarding_disabled()) + return; + if (!file_exists(getenv("MEDIACONV_AUDIO_DUMP_FILE"))) + return; + + if ((dump_fozdb_open_audio(false)) < 0) + return; + + if (!(read_fozdb_path = getenv("MEDIACONV_AUDIO_TRANSCODED_FILE"))) + { + GST_ERROR("Env MEDIACONV_AUDIO_TRANSCODED_FILE not set."); + return; + } + + if ((ret = fozdb_create(read_fozdb_path, O_RDONLY, true /* Read-only? */, AUDIO_CONV_FOZ_NUM_TAGS, &read_fozdb)) < 0) + { + GST_ERROR("Failed to create read fozdb, ret %d.", ret); + return; + } + + fozdb_iter_tag(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, &iter); + while (g_hash_table_iter_next(&iter, (void *)&stream_id, NULL)) + { + uint32_t chunks_size, i; + size_t read_size; + + if (fozdb_entry_size(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, stream_id, &chunks_size) == CONV_OK) + { + uint8_t *buffer = calloc(1, chunks_size); + if (fozdb_read_entry_data(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, stream_id, + 0, buffer, chunks_size, &read_size, true) == CONV_OK) + { + GList *stream_chunks = NULL; + bool has_all = true; + + for (i = 0; i < read_size / sizeof(chunk_id); ++i) + { + payload_hash_from_bytes(&chunk_id, buffer + i * sizeof(chunk_id)); + if (!fozdb_has_entry(read_fozdb, AUDIO_CONV_FOZ_TAG_PTNADATA, &chunk_id)) + { + has_all = false; + break; + } + stream_chunks = g_list_append(stream_chunks, + entry_name_create(AUDIO_CONV_FOZ_TAG_AUDIODATA, &chunk_id)); + } + + for (list_iter = stream_chunks; list_iter; list_iter = list_iter->next) + { + struct entry_name *entry = list_iter->data; + if (has_all) + { + chunks_to_discard = g_list_append(chunks_to_discard, + entry_name_create(entry->tag, &entry->hash)); + chunks_to_discard = g_list_append(chunks_to_discard, + entry_name_create(AUDIO_CONV_FOZ_TAG_CODECINFO, &entry->hash)); + } + else + { + chunks_to_keep = g_list_append(chunks_to_keep, + entry_name_create(entry->tag, &entry->hash)); + chunks_to_keep = g_list_append(chunks_to_keep, + entry_name_create(AUDIO_CONV_FOZ_TAG_CODECINFO, &entry->hash)); + } + } + + if (has_all) + chunks_to_discard = g_list_append(chunks_to_discard, + entry_name_create(AUDIO_CONV_FOZ_TAG_STREAM, stream_id)); + + g_list_free_full(stream_chunks, free); + } + free(buffer); + } + } + + for (list_iter = chunks_to_discard; list_iter; list_iter = list_iter->next) + { + struct entry_name *entry = list_iter->data; + if (!g_list_find_custom(chunks_to_keep, entry, entry_name_compare)) + chunks = g_list_append(chunks, entry_name_create(entry->tag, &entry->hash)); + } + + if ((ret = fozdb_discard_entries(dump_fozdb.fozdb, chunks)) < 0) + { + GST_ERROR("Failed to discard entries, ret %d.", ret); + dump_fozdb_close(&dump_fozdb); + } + + g_list_free_full(chunks, free); + g_list_free_full(chunks_to_keep, free); + g_list_free_full(chunks_to_discard, free); +} + +static bool need_transcode_head_create_from_caps(GstCaps *caps, struct need_transcode_head **out) +{ + int wmaversion, bitrate, channels, rate, block_align, depth; + const GstStructure *structure = gst_caps_get_structure(caps, 0); + struct need_transcode_head *head; + const GValue *codec_data_value; + GstBuffer *codec_data_buffer; + gsize codec_data_size; + + GST_DEBUG("caps %"GST_PTR_FORMAT", out %p.", caps, out); + + if (!gst_structure_get_int(structure, "wmaversion", &wmaversion)) + { + GST_ERROR("Caps have no wmaversion field."); + return false; + } + if (!gst_structure_get_int(structure, "bitrate", &bitrate)) + { + GST_ERROR("Caps have no bitrate field."); + return false; + } + if (!gst_structure_get_int(structure, "channels", &channels)) + { + GST_ERROR("Caps have no channels field."); + return false; + } + if (!gst_structure_get_int(structure, "rate", &rate)) + { + GST_ERROR("Caps have no rate field."); + return false; + } + if (!gst_structure_get_int(structure, "block_align", &block_align)) + { + GST_ERROR("Caps have no block_align field."); + return false; + } + if (!gst_structure_get_int(structure, "depth", &depth)) + { + GST_ERROR("Caps have no depth field."); + return false; + } + if (!(codec_data_value = gst_structure_get_value(structure, "codec_data")) + || !(codec_data_buffer = gst_value_get_buffer(codec_data_value))) + { + GST_ERROR("Caps have no codec_data field."); + return false; + } + + codec_data_size = gst_buffer_get_size(codec_data_buffer); + head = calloc(1, sizeof(*head) + codec_data_size); + head->codec_data_size = codec_data_size; + head->wmaversion = wmaversion; + head->bitrate = bitrate; + head->channels = channels; + head->rate = rate; + head->block_align = block_align; + head->depth = depth; + gst_buffer_extract(codec_data_buffer, 0, head + 1, codec_data_size); + + *out = head; + return true; +} + +static struct need_transcode_head *need_transcode_head_dup(struct need_transcode_head *head) +{ + size_t size = sizeof(*head) + head->codec_data_size; + struct need_transcode_head *dup; + + dup = calloc(1, size); + memcpy(dup, head, size); + + return dup; +} + + +static void need_transcode_head_serialize(struct need_transcode_head *head, + uint8_t *buffer, size_t buffer_size, size_t *out_size) +{ + *out_size = sizeof(*head) - sizeof(head->codec_data_size) + head->codec_data_size; + + if (buffer_size < *out_size) + { + GST_ERROR("Buffer too small: buffer size %zu, out size %zu.", buffer_size, *out_size); + return; + } + memcpy(buffer, &head->wmaversion, *out_size); +} + +static void stream_state_serializer_init(struct stream_state_serializer *serializer, struct stream_state *state) +{ + serializer->state = state; + serializer->index = 0; +} + +static int stream_state_serializer_read(void *data_reader, uint8_t *buffer, size_t size, size_t *read_size) +{ + struct stream_state_serializer *serializer = data_reader; + struct buffer_entry *entry; + + if (!size) + { + *read_size = 0; + return CONV_OK; + } + + if (serializer->index >= g_list_length(serializer->state->buffers)) + return CONV_ERROR_DATA_END; + + entry = g_list_nth_data(serializer->state->buffers, serializer->index++); + memcpy(buffer, &entry->hash, sizeof(entry->hash)); + + *read_size = sizeof(entry->hash); + return CONV_OK; +} + +static struct stream_state *stream_state_create(void) +{ + struct stream_state *state; + state = calloc(1, sizeof(*state)); + murmur3_128_state_init(&state->hash_state, HASH_SEED); + return state; +} + +static void stream_state_release(struct stream_state *state) +{ + g_list_free_full(state->buffers, buffer_entry_release); + g_list_free_full(state->loop_buffers, buffer_entry_release); + if (state->codec_info) + free(state->codec_info); + free(state); +} + +static void stream_state_reset(struct stream_state *state) +{ + murmur3_128_state_reset(&state->hash_state); + memset(&state->current_hash, 0, sizeof(state->current_hash)); + g_list_free_full(g_steal_pointer(&state->buffers), buffer_entry_release); + g_list_free_full(g_steal_pointer(&state->loop_buffers), buffer_entry_release); + free(state->codec_info); + state->codec_info = NULL; + state->needs_dump = false; +} + +static loop_state stream_state_record_buffer(struct stream_state *state, struct payload_hash *buffer_hash, + struct payload_hash *loop_hash, GstBuffer *buffer, struct need_transcode_head *codec_info) +{ + if (!state->codec_info && codec_info) + state->codec_info = need_transcode_head_dup(codec_info); + + if (g_list_length(state->loop_buffers) < g_list_length(state->buffers)) + { + struct buffer_entry *entry = g_list_nth_data(state->buffers, g_list_length(state->loop_buffers)); + if (!memcmp(&entry->hash, loop_hash, sizeof(*loop_hash))) + { + state->loop_buffers = g_list_append(state->loop_buffers, + buffer_entry_create(buffer_hash /* Not loop_hash! */, buffer)); + if (g_list_length(state->loop_buffers) == g_list_length(state->buffers)) + { + /* Full loop, just drop them. */ + g_list_free_full(g_steal_pointer(&state->loop_buffers), buffer_entry_release); + return LOOP_ENDED; + } + + return LOOPING; + } + } + + /* Partial loop, track them and then continue */ + if (state->loop_buffers) + state->buffers = g_list_concat(state->buffers, g_steal_pointer(&state->loop_buffers)); + + state->buffers = g_list_append(state->buffers, buffer_entry_create(buffer_hash, buffer)); + + if (!hash_data((const uint8_t *)buffer_hash, sizeof(*buffer_hash), &state->hash_state, &state->current_hash)) + return LOOP_ERROR; + + return NO_LOOP; +} + +static bool stream_state_is_stream_subset(struct stream_state *state, struct fozdb *db, struct payload_hash *stream_id) +{ + uint64_t offset = 0; + GList *list_iter; + + for (list_iter = state->buffers; list_iter; list_iter = list_iter->next) + { + struct buffer_entry *entry = list_iter->data; + struct payload_hash buffer_id; + size_t read_size; + + if ((fozdb_read_entry_data(db, AUDIO_CONV_FOZ_TAG_STREAM, stream_id, + offset, (uint8_t *)&buffer_id, sizeof(buffer_id), &read_size, true)) < 0 + || read_size != sizeof(buffer_id)) + return false; + + if (memcmp(&buffer_id, &entry->hash, sizeof(buffer_id)) != 0) + return false; + + offset += sizeof(buffer_id); + } + + GST_LOG("Stream id %s is a subset of %s, so not recording stream.", + format_hash(&state->current_hash), format_hash(stream_id)); + + return true; +} + +static int stream_state_write_to_foz(struct stream_state *state) +{ + struct stream_state_serializer serializer; + struct buffer_entry *entry; + struct bytes_reader reader; + uint8_t buffer[1024]; + size_t header_size; + GList *list_iter; + bool found; + int ret; + + GST_DEBUG("state %p, current hash %s.", state, format_hash(&state->current_hash)); + + if (!state->needs_dump || !state->buffers) + return CONV_OK; + + pthread_mutex_lock(&dump_fozdb.mutex); + + if ((ret = dump_fozdb_open_audio(true)) < 0) + { + GST_ERROR("Failed to open audio dump fozdb, ret %d.", ret); + pthread_mutex_unlock(&dump_fozdb.mutex); + return ret; + } + + found = fozdb_has_entry(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, &state->current_hash); + if (!found) + { + /* Are there any recorded streams of which this stream is a subset? */ + struct payload_hash *stream_id; + GHashTableIter stream_ids; + + fozdb_iter_tag(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, &stream_ids); + while (g_hash_table_iter_next(&stream_ids, (void **)&stream_id, NULL)) + { + if (stream_state_is_stream_subset(state, dump_fozdb.fozdb, stream_id)) + { + found = true; + break; + } + } + } + + if (!found) + { + if (dumping_disabled()) + { + GST_LOG("Dumping disabled, so not recording stream id %s.", format_hash(&state->current_hash)); + } + else + { + GST_LOG("Recording stream id %s.", format_hash(&state->current_hash)); + + need_transcode_head_serialize(state->codec_info, buffer, sizeof(buffer), &header_size); + bytes_reader_init(&reader, buffer, header_size); + entry = state->buffers->data; + if ((ret = fozdb_write_entry(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_CODECINFO, &entry->hash, + &reader, bytes_reader_read, true)) < 0) + { + GST_ERROR("Unable to write stream header, ret %d.\n", ret); + pthread_mutex_unlock(&dump_fozdb.mutex); + return ret; + } + + stream_state_serializer_init(&serializer, state); + if ((ret = fozdb_write_entry(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, &state->current_hash, + &serializer, stream_state_serializer_read, true)) < 0) + { + GST_ERROR("Unable to write stream, ret %d.\n", ret); + pthread_mutex_unlock(&dump_fozdb.mutex); + return ret; + } + + for (list_iter = state->buffers; list_iter; list_iter = list_iter->next) + { + struct gst_buffer_reader buffer_reader; + + entry = list_iter->data; + gst_buffer_reader_init(&buffer_reader, entry->buffer); + if ((ret = fozdb_write_entry(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_AUDIODATA, &entry->hash, + &buffer_reader, gst_buffer_reader_read, true)) < 0) + { + GST_ERROR("Unable to write audio data, ret %d.\n", ret); + pthread_mutex_unlock(&dump_fozdb.mutex); + return ret; + } + } + } + } + + pthread_mutex_unlock(&dump_fozdb.mutex); + return CONV_OK; +} + +static int audio_conv_state_create(struct audio_conv_state **out) +{ + struct audio_conv_state *state; + struct fozdb *fozdb = NULL; + char *read_fozdb_path; + int ret; + + if (!(read_fozdb_path = getenv("MEDIACONV_AUDIO_TRANSCODED_FILE"))) + { + GST_ERROR("Env MEDIACONV_AUDIO_TRANSCODED_FILE is not set!"); + return CONV_ERROR_ENV_NOT_SET; + } + + if ((ret = fozdb_create(read_fozdb_path, O_RDONLY, true /* Read-only? */, AUDIO_CONV_FOZ_NUM_TAGS, &fozdb)) < 0) + GST_ERROR("Failed to create fozdb from %s, ret %d.", read_fozdb_path, ret); + + state = calloc(1, sizeof(*state)); + murmur3_128_state_init(&state->hash_state, HASH_SEED); + murmur3_128_state_init(&state->loop_hash_state, HASH_SEED); + state->stream_state = stream_state_create(); + state->read_fozdb = fozdb; + + *out = state; + return CONV_OK; +} + +static void audio_conv_state_release(struct audio_conv_state *state) +{ + free(state->codec_data); + stream_state_release(state->stream_state); + if (state->read_fozdb) + fozdb_release(state->read_fozdb); + free(state); +} + +static void audio_conv_state_reset(struct audio_conv_state *state) +{ + if (stream_state_write_to_foz(state->stream_state) < 0) + GST_ERROR("Failed to write stream to dump fozdb."); + + stream_state_reset(state->stream_state); + murmur3_128_state_reset(&state->hash_state); + murmur3_128_state_reset(&state->loop_hash_state); +} + +/* Allocate a buffer on success, free it after usage. */ +static int audio_conv_state_open_transcode_file(struct audio_conv_state *state, GstBuffer *buffer, + uint8_t **out_data, size_t *out_size) +{ + struct payload_hash hash, loop_hash; + uint32_t transcoded_size; + const char *blank_audio; + bool try_loop, hash_ok; + GstMapInfo map_info; + uint64_t file_size; + loop_state loop; + uint8_t *data; + size_t size; + int fd; + + /* Hash buffer. */ + if (!gst_buffer_map(buffer, &map_info, GST_MAP_READ)) + return CONV_ERROR; + hash_ok = hash_data(map_info.data, map_info.size, &state->hash_state, &hash) + && hash_data(map_info.data, map_info.size, &state->loop_hash_state, &loop_hash); + gst_buffer_unmap(buffer, &map_info); + if (!hash_ok) + { + GST_ERROR("Failed to hash buffer."); + return CONV_ERROR; + } + + loop = stream_state_record_buffer(state->stream_state, &hash, &loop_hash, buffer, state->codec_data); + gst_buffer_unref(buffer); /* Buffer has been recorded, so unref it. */ + switch (loop) + { + case NO_LOOP: + murmur3_128_state_reset(&state->loop_hash_state); + try_loop = false; + break; + + case LOOP_ENDED: + murmur3_128_state_reset(&state->loop_hash_state); + case LOOPING: + try_loop = true; + break; + + case LOOP_ERROR: + default: + return CONV_ERROR; + } + + if (try_loop) + GST_INFO("Buffer hash: %s (Loop: %s).", format_hash(&hash), format_hash(&loop_hash)); + else + GST_INFO("Buffer hash: %s.", format_hash(&hash)); + + /* Try to read transcoded data. */ + if (state->read_fozdb) + { + if (fozdb_entry_size(state->read_fozdb, + AUDIO_CONV_FOZ_TAG_PTNADATA, &hash, &transcoded_size) == CONV_OK) + { + data = calloc(1, transcoded_size); + if (fozdb_read_entry_data(state->read_fozdb, AUDIO_CONV_FOZ_TAG_PTNADATA, &hash, 0, + data, transcoded_size, &size, false) == CONV_OK) + { + *out_data = data; + *out_size = size; + return CONV_OK; + } + free(data); + } + + if (try_loop && fozdb_entry_size(state->read_fozdb, + AUDIO_CONV_FOZ_TAG_PTNADATA, &loop_hash, &transcoded_size) == CONV_OK) + { + data = calloc(1, transcoded_size); + if (fozdb_read_entry_data(state->read_fozdb, AUDIO_CONV_FOZ_TAG_PTNADATA, &loop_hash, 0, + data, transcoded_size, &size, false) == CONV_OK) + { + *out_data = data; + *out_size = size; + return CONV_OK; + } + free(data); + } + } + + /* If we can't, return the blank file */ + state->stream_state->needs_dump = true; + if (!(blank_audio = getenv("MEDIACONV_BLANK_AUDIO_FILE"))) + { + GST_ERROR("Env MEDIACONV_BLANK_AUDIO_FILE not set."); + return CONV_ERROR_ENV_NOT_SET; + } + if (!open_file(blank_audio, O_RDONLY, &fd)) + return CONV_ERROR_OPEN_FAILED; + if (!get_file_size(fd, &file_size)) + { + close(fd); + return CONV_ERROR; + } + data = calloc(1, file_size); + if (!complete_read(fd, data, file_size)) + { + free(data); + close(fd); + return CONV_ERROR_READ_FAILED; + } + + create_placeholder_file("placeholder-audio-used"); + + *out_data = data; + *out_size = file_size; + + return CONV_OK; +} + +/* Call pthread_mutex_unlock() to unlock after usage. */ +static struct audio_conv_state *audio_conv_lock_state(AudioConv *conv) +{ + pthread_mutex_lock(&conv->state_mutex); + if (!conv->state) + pthread_mutex_unlock(&conv->state_mutex); + return conv->state; +} + +static GstStateChangeReturn audio_conv_change_state(GstElement *element, GstStateChange transition) +{ + AudioConv *conv = AUDIO_CONV(element); + struct audio_conv_state *state; + int ret; + + GST_DEBUG_OBJECT(element, "State transition %s.", gst_state_change_get_name(transition)); + + switch (transition) + { + case GST_STATE_CHANGE_NULL_TO_READY: + /* Do runtime setup. */ + + /* Open fozdb here; this is the right place to fail + * and opening may be expensive. */ + pthread_mutex_lock(&dump_fozdb.mutex); + dump_fozdb_discard_transcoded(); + ret = dump_fozdb_open_audio(true); + pthread_mutex_unlock(&dump_fozdb.mutex); + if (ret < 0) + { + GST_ERROR("Failed to open dump fozdb, ret %d.", ret); + return GST_STATE_CHANGE_FAILURE; + } + + /* Create audio conv state. */ + if ((ret = audio_conv_state_create(&state)) < 0) + { + GST_ERROR("Failed to create audio conv state, ret %d.", ret); + return GST_STATE_CHANGE_FAILURE; + } + pthread_mutex_lock(&conv->state_mutex); + assert(!conv->state); + conv->state = state; + pthread_mutex_unlock(&conv->state_mutex); + break; + + case GST_STATE_CHANGE_READY_TO_NULL: + /* Do runtime teardown. */ + pthread_mutex_lock(&conv->state_mutex); + state = conv->state; + conv->state = NULL; + pthread_mutex_unlock(&conv->state_mutex); + + if (state && (ret = stream_state_write_to_foz(state->stream_state)) < 0) + GST_WARNING("Error writing out stream data, ret %d.", ret); + audio_conv_state_release(state); + break; + + default: + break; + } + + return GST_ELEMENT_CLASS(parent_class)->change_state(element, transition); + + /* XXX on ReadyToNull, sodium drops state _again_ here... why? */ +} + +static gboolean audio_conv_sink_event(GstPad *pad, GstObject *parent, GstEvent *event) +{ + AudioConv *conv = AUDIO_CONV(parent); + struct audio_conv_state *state; + GstCaps *caps; + bool ret; + + GST_DEBUG_OBJECT(pad, "Got sink event %"GST_PTR_FORMAT".", event); + + switch (event->type) + { + case GST_EVENT_CAPS: + if ((state = audio_conv_lock_state(conv))) + { + gst_event_parse_caps(event, &caps); + if (!need_transcode_head_create_from_caps(caps, &state->codec_data)) + { + GST_ERROR("Invalid WMA caps!"); + pthread_mutex_unlock(&conv->state_mutex); + return false; + } + pthread_mutex_unlock(&conv->state_mutex); + } + + caps = gst_caps_from_string("audio/x-opus, channel-mapping-family=0"); + ret = push_event(conv->src_pad, gst_event_new_caps(caps)); + gst_caps_unref(caps); + return ret; + + case GST_EVENT_FLUSH_STOP: + if ((state = audio_conv_lock_state(conv))) + { + audio_conv_state_reset(state); + pthread_mutex_unlock(&conv->state_mutex); + } + return gst_pad_event_default(pad, parent, event); + + default: + return gst_pad_event_default(pad, parent, event); + } +} + +static GstFlowReturn audio_conv_chain(GstPad *pad, GstObject *parent, GstBuffer *buffer) +{ + size_t ptna_data_size, offset, encoded_len; + GstFlowReturn flow_ret = GST_FLOW_ERROR; + AudioConv *conv = AUDIO_CONV(parent); + struct audio_conv_state *state; + uint8_t *ptna_data = NULL; + int ret; + + GST_LOG_OBJECT(pad, "Handling buffer <%"GST_PTR_FORMAT">.", buffer); + + if (!(state = audio_conv_lock_state(conv))) + return flow_ret; + + if ((ret = audio_conv_state_open_transcode_file(state, buffer, &ptna_data, &ptna_data_size)) < 0) + { + GST_ERROR("Failed to read transcoded audio, ret %d. Things will go badly...", ret); + goto done; + } + + for (offset = 0; offset < ptna_data_size; offset += encoded_len) + { + uint32_t packet_header, flags, padding_len; + GstBuffer *new_buffer; + bool packet_is_header; + + if (offset + 4 >= ptna_data_size) + { + GST_WARNING( "Short read on ptna header?"); + break; + } + + packet_header = bytes_to_uint32(&ptna_data[offset]); + offset += 4; + + flags = packet_header & AUDIO_CONV_FLAG_MASK, + padding_len = (packet_header & AUDIO_CONV_PADDING_LENGTH_MASK) >> AUDIO_CONV_PADDING_LENGTH_SHIFT; + encoded_len = packet_header & AUDIO_CONV_ENCODED_LENGTH_MASK; + + if (offset + encoded_len > ptna_data_size) + { + GST_WARNING("Short read on ptna data?"); + break; + } + + packet_is_header = flags & AUDIO_CONV_FLAG_HEADER; + if (packet_is_header && state->sent_header) + continue; /* Only send one header. */ + + /* TODO: can we use a GstBuffer cache here? */ + new_buffer = gst_buffer_new_and_alloc(encoded_len); + if (!packet_is_header && padding_len > 0) + gst_buffer_add_audio_clipping_meta(new_buffer, GST_FORMAT_DEFAULT, 0, padding_len); + gst_buffer_fill(new_buffer, 0, ptna_data + offset, encoded_len); + + GST_LOG("Pushing one packet of len %zu.", encoded_len); + if ((flow_ret = gst_pad_push(conv->src_pad, new_buffer)) < 0) + { + GST_ERROR("Failed to push buffer <%"GST_PTR_FORMAT"> to src pad %"GST_PTR_FORMAT, + new_buffer, conv->src_pad); + goto done; + } + + if (packet_is_header) + state->sent_header = true; + } + + flow_ret = GST_FLOW_OK; + +done: + if (ptna_data) + free(ptna_data); + pthread_mutex_unlock(&conv->state_mutex); + return flow_ret; +} + +static gboolean audio_conv_src_query(GstPad *pad, GstObject *parent, GstQuery *query) +{ + AudioConv *conv = AUDIO_CONV(parent); + GstSchedulingFlags flags; + gint min, max, align; + GstQuery *peer_query; + + GST_DEBUG_OBJECT(pad, "Got query %"GST_PTR_FORMAT".", query); + + switch (query->type) + { + case GST_QUERY_SCHEDULING: + peer_query = gst_query_new_scheduling(); + if (!gst_pad_peer_query(conv->sink_pad, peer_query)) + { + gst_query_unref(peer_query); + return false; + } + gst_query_parse_scheduling(peer_query, &flags, &min, &max, &align); + gst_query_unref(peer_query); + gst_query_set_scheduling(query, flags, min, max, align); + return true; + + default: + return gst_pad_query_default(pad, parent, query); + } + +} + +static gboolean audio_conv_active_mode(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean active) +{ + AudioConv *conv = AUDIO_CONV(parent); + return gst_pad_activate_mode(conv->sink_pad, mode, active); +} + +static void audio_conv_finalize(GObject *object) +{ + AudioConv *conv = AUDIO_CONV(object); + + pthread_mutex_destroy(&conv->state_mutex); + if (conv->state) + audio_conv_state_release(conv->state); + + G_OBJECT_CLASS(parent_class)->finalize(object); +} + +static void audio_conv_class_init(AudioConvClass *klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS(klass); + GObjectClass *object_class = G_OBJECT_CLASS(klass); + + gst_element_class_set_metadata(element_class, + "Proton audio converter", + "Codec/Demuxer", + "Converts audio for Proton", + "Andrew Eikum , Ziqing Hui "); + + element_class->change_state = audio_conv_change_state; + object_class->finalize = audio_conv_finalize; + + gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&audio_conv_sink_template)); + gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&audio_conv_src_template)); +} + +static void audio_conv_init(AudioConv *conv) +{ + GstElement *element = GST_ELEMENT(conv); + + conv->sink_pad = gst_pad_new_from_static_template(&audio_conv_sink_template, "sink"); + gst_pad_set_event_function(conv->sink_pad, GST_DEBUG_FUNCPTR(audio_conv_sink_event)); + gst_pad_set_chain_function(conv->sink_pad, GST_DEBUG_FUNCPTR(audio_conv_chain)); + gst_element_add_pad(element, conv->sink_pad); + + conv->src_pad = gst_pad_new_from_static_template(&audio_conv_src_template, "src"); + gst_pad_set_query_function(conv->src_pad, GST_DEBUG_FUNCPTR(audio_conv_src_query)); + gst_pad_set_activatemode_function(conv->src_pad, GST_DEBUG_FUNCPTR(audio_conv_active_mode)); + gst_element_add_pad(element, conv->src_pad); + + pthread_mutex_init(&conv->state_mutex, NULL); + conv->state = NULL; +} diff --git a/dlls/winegstreamer/media-converter/audioconvbin.c b/dlls/winegstreamer/media-converter/audioconvbin.c new file mode 100644 index 000000000000..9857a0ff5072 --- /dev/null +++ b/dlls/winegstreamer/media-converter/audioconvbin.c @@ -0,0 +1,148 @@ +/* + * Copyright 2024 Ziqing Hui for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "media-converter.h" + +GST_DEBUG_CATEGORY_EXTERN(media_converter_debug); +#undef GST_CAT_DEFAULT +#define GST_CAT_DEFAULT media_converter_debug + +typedef struct +{ + GstBin bin; + GstElement *audio_conv, *opus_dec, *caps_setter; + GstPad *sink_pad, *src_pad; /* Ghost pads. */ +} AudioConvBin; + +typedef struct +{ + GstBinClass class; +} AudioConvBinClass; + +G_DEFINE_TYPE(AudioConvBin, audio_conv_bin, GST_TYPE_BIN); +#define AUDIO_CONV_BIN_TYPE (audio_conv_bin_get_type()) +#define AUDIO_CONV_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), AUDIO_CONV_BIN_TYPE, AudioConvBin)) +GST_ELEMENT_REGISTER_DEFINE(protonaudioconverterbin, "protonaudioconverterbin", + GST_RANK_MARGINAL + 1, AUDIO_CONV_BIN_TYPE); + +static GstStaticPadTemplate audio_conv_bin_sink_template = GST_STATIC_PAD_TEMPLATE("sink", + GST_PAD_SINK, GST_PAD_ALWAYS, + GST_STATIC_CAPS("audio/x-wma;")); + +static GstStaticPadTemplate audio_conv_bin_src_template = GST_STATIC_PAD_TEMPLATE("src", + GST_PAD_SRC, GST_PAD_ALWAYS, + GST_STATIC_CAPS("audio/x-raw, format=S16LE;")); + +static void link_elements(GstElement *src_element, GstElement *sink_element) +{ + if (!gst_element_link(src_element, sink_element)) + GST_ERROR("Failed to link src element %"GST_PTR_FORMAT" to sink element %"GST_PTR_FORMAT".", + src_element, sink_element); +} + +static gboolean audio_conv_bin_sink_event(GstPad *pad, GstObject *parent, GstEvent *event) +{ + AudioConvBin * bin = AUDIO_CONV_BIN(parent); + GstCaps *caps, *rate_caps; + GstStructure *structure; + GstPad *audio_conv_sink; + gint override_rate; + gboolean ret; + + GST_DEBUG_OBJECT(pad, "Got sink event %"GST_PTR_FORMAT".", event); + + switch (event->type) + { + case GST_EVENT_CAPS: + gst_event_parse_caps(event, &caps); + if ((structure = gst_caps_get_structure(caps, 0)) + && gst_structure_get_int(structure, "rate", &override_rate)) + { + rate_caps = gst_caps_new_simple("audio/x-raw", "rate", G_TYPE_INT, override_rate, NULL); + g_object_set(bin->caps_setter, "caps", rate_caps, NULL); + } + else + { + GST_WARNING("Event has no rate."); + } + + /* Forward on to the real pad. */ + audio_conv_sink = gst_element_get_static_pad(bin->audio_conv, "sink"); + ret = gst_pad_send_event(audio_conv_sink, event); + gst_object_unref(audio_conv_sink); + return ret; + + default: + return gst_pad_event_default(pad, parent, event); + } +} + +static void audio_conv_bin_class_init(AudioConvBinClass * klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS(klass); + + gst_element_class_set_metadata(element_class, + "Proton audio converter with rate fixup", + "Codec/Decoder/Audio", + "Converts audio for Proton, fixing up samplerates", + "Andrew Eikum , Ziqing Hui "); + + gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&audio_conv_bin_sink_template)); + gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&audio_conv_bin_src_template)); +} + +static void audio_conv_bin_init(AudioConvBin *bin) +{ + GstElement *element = GST_ELEMENT(bin); + GstPad *sink, *src; + + bin->sink_pad = gst_ghost_pad_new_no_target_from_template("sink", + gst_element_get_pad_template(element, "sink")); + bin->src_pad = gst_ghost_pad_new_no_target_from_template("src", + gst_element_get_pad_template(element, "src")); + gst_pad_set_event_function(bin->sink_pad, GST_DEBUG_FUNCPTR(audio_conv_bin_sink_event)); + + bin->audio_conv = create_element("protonaudioconverter", "protonmediaconverter"); + bin->opus_dec = create_element("opusdec", "base"); + bin->caps_setter = create_element("capssetter", "good"); + + gst_bin_add(GST_BIN(bin), bin->audio_conv); + gst_bin_add(GST_BIN(bin), bin->opus_dec); + gst_bin_add(GST_BIN(bin), bin->caps_setter); + + link_elements(bin->audio_conv, bin->opus_dec); + link_elements(bin->opus_dec, bin->caps_setter); + + sink = gst_element_get_static_pad(bin->audio_conv, "sink"); + src = gst_element_get_static_pad(bin->caps_setter, "src"); + gst_ghost_pad_set_target(GST_GHOST_PAD(bin->sink_pad), sink); + gst_ghost_pad_set_target(GST_GHOST_PAD(bin->src_pad), src); + gst_object_unref(src); + gst_object_unref(sink); + + gst_element_add_pad(element, bin->sink_pad); + gst_element_add_pad(element, bin->src_pad); + + GST_INFO("Initialized AudioConvBin %"GST_PTR_FORMAT": audio_conv %"GST_PTR_FORMAT", opus_dec %"GST_PTR_FORMAT", " + "caps_setter %"GST_PTR_FORMAT", sink_pad %"GST_PTR_FORMAT", src_pad %"GST_PTR_FORMAT".", + bin, bin->audio_conv, bin->opus_dec, bin->caps_setter, bin->sink_pad, bin->src_pad); +} diff --git a/dlls/winegstreamer/media-converter/fossilize.c b/dlls/winegstreamer/media-converter/fossilize.c new file mode 100644 index 000000000000..057825ad5b58 --- /dev/null +++ b/dlls/winegstreamer/media-converter/fossilize.c @@ -0,0 +1,722 @@ +/* + * Copyright 2024 Ziqing Hui for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + * Based on "Fossilize," which is + * Copyright (c) 2018-2019 Hans-Kristian Arntzen + * https://github.com/ValveSoftware/Fossilize/ + */ + +/* This is a read/write implementation of the Fossilize database format. + * + * https://github.com/ValveSoftware/Fossilize/ + * + * That C++ implementation is specific to Vulkan, while this one tries to be generic to store any + * type of data. + */ + +#if 0 +#pragma makedep unix +#endif + +#include "media-converter.h" + +/* Fossilize StreamArchive database format version 6: + * + * The file consists of a header, followed by an unlimited series of "entries". + * + * All multi-byte entities are little-endian. + * + * The file header is as follows: + * + * Field Type Description + * ----- ---- ----------- + * magic_number uint8_t[12] Constant value: "\x81""FOSSILIZEDB" + * version uint32_t StreamArchive version: 6 + * + * + * Each entry follows this format: + * + * Field Type Description + * ----- ---- ----------- + * name unsigned char[40] Application-defined entry identifier, stored in hexadecimal big-endian + * ASCII. Usually N-char tag followed by (40 - N)-char hash. + * size uint32_t Size of the payload as stored in this file. + * flags uint32_t Flags for this entry (e.g. compression). See below. + * crc32 uint32_t CRC32 of the payload as stored in this file. + * full_size uint32_t Size of this payload after decompression. + * payload uint8_t[stored_size] Entry data. + * + * The flags field may contain: + * 0x1: No compression. + * 0x2: Deflate compression. + */ + +#define FOZDB_MIN_COMPAT_VERSION 5 +#define FOZDB_VERSION 6 + +#define FOZDB_COMPRESSION_NONE 1 +#define FOZDB_COMPRESSION_DEFLATE 2 + +#define ENTRY_NAME_SIZE 40 + +#define BUFFER_COPY_BYTES (8 * 1024 * 1024) /* Tuneable. */ + +static const uint8_t FOZDB_MAGIC[] = {0x81, 'F', 'O', 'S', 'S', 'I', 'L', 'I', 'Z', 'E', 'D', 'B'}; + +struct file_header +{ + uint8_t magic[12]; + uint8_t unused1; + uint8_t unused2; + uint8_t unused3; + uint8_t version; +} __attribute__((packed)); + +struct payload_header +{ + uint32_t size; + uint32_t compression; + uint32_t crc; + uint32_t full_size; +} __attribute__((packed)); + +struct payload_entry +{ + struct payload_hash hash; + struct payload_header header; + uint64_t offset; +}; + +static guint hash_func(gconstpointer key) +{ + const struct payload_hash *payload_hash = key; + + return payload_hash->hash[0] + ^ payload_hash->hash[1] + ^ payload_hash->hash[2] + ^ payload_hash->hash[3]; +} + +static gboolean hash_equal(gconstpointer a, gconstpointer b) +{ + return memcmp(a, b, sizeof(struct payload_hash)) == 0; +} + +static bool tag_from_ascii_bytes(uint32_t *tag, const uint8_t *ascii_bytes) +{ + char str[sizeof(*tag) * 2 + 1] = {}; + + memcpy(str, ascii_bytes, sizeof(*tag) * 2); + + *tag = strtoul(str, NULL, 16); + if (errno != 0) + { + GST_ERROR("Failed to convert string \"%s\" to tag. %s.", str, strerror(errno)); + return false; + } + + return true; +} + +static bool hash_from_ascii_bytes(struct payload_hash *hash, const uint8_t *ascii_bytes) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(hash->hash); ++i) + { + uint32_t *hash_part = &hash->hash[ARRAY_SIZE(hash->hash) - 1 - i]; + char str[sizeof(hash_part) * 2 + 1] = {}; + + memcpy(str, ascii_bytes + sizeof(*hash_part) * 2 * i, sizeof(*hash_part) * 2); + + *hash_part = strtoul(str, NULL, 16); + + if (errno != 0) + { + GST_ERROR("Failed to convert string \"%s\" to hash part %u. %s.", str, 4 - i, strerror(errno)); + return false; + } + } + + return true; +} + +static void tag_to_ascii_bytes(uint32_t tag, uint8_t *ascii_bytes) +{ + char buffer[sizeof(tag) * 2 + 1]; + sprintf(buffer, "%08x", tag); + memcpy(ascii_bytes, buffer, sizeof(tag) * 2); +} + +static void hash_to_ascii_bytes(const struct payload_hash *hash, uint8_t *ascii_bytes) +{ + char buffer[sizeof(*hash) * 2 + 1]; + sprintf(buffer, "%08x%08x%08x%08x", hash->hash[3], hash->hash[2], hash->hash[1], hash->hash[0]); + memcpy(ascii_bytes, buffer, sizeof(*hash) * 2); +} + +static void payload_header_from_bytes(struct payload_header *header, const uint8_t *bytes) +{ + header->size = bytes_to_uint32(bytes); + header->compression = bytes_to_uint32(bytes + 4); + header->crc = bytes_to_uint32(bytes + 8); + header->full_size = bytes_to_uint32(bytes + 12); +} + +static int fozdb_read_file_header(struct fozdb *db) +{ + struct file_header header; + + if (!complete_read(db->file, &header, sizeof(header))) + { + GST_ERROR("Failed to read file header."); + return CONV_ERROR_READ_FAILED; + } + if (memcmp(&header.magic, FOZDB_MAGIC, sizeof(FOZDB_MAGIC)) != 0) + { + GST_ERROR("Bad magic."); + return CONV_ERROR_CORRUPT_DATABASE; + } + if (header.version < FOZDB_MIN_COMPAT_VERSION || header.version > FOZDB_VERSION) + { + GST_ERROR("Incompatible version %u.", header.version); + return CONV_ERROR_CORRUPT_DATABASE; + } + + return CONV_OK; +} + +static int fozdb_read_entry_tag_hash_header(struct fozdb *db, + uint32_t *out_tag, struct payload_hash *out_hash, struct payload_header *out_header) +{ + uint8_t entry_name_and_header[ENTRY_NAME_SIZE + sizeof(struct payload_header)]; + struct payload_hash hash; + uint32_t tag; + + if (!complete_read(db->file, entry_name_and_header, sizeof(entry_name_and_header))) + { + GST_ERROR("Failed to read entry name and header."); + return CONV_ERROR_READ_FAILED; + } + + if (!tag_from_ascii_bytes(&tag, entry_name_and_header) + || !hash_from_ascii_bytes(&hash, entry_name_and_header + sizeof(tag) * 2)) + return CONV_ERROR_CORRUPT_DATABASE; + + payload_header_from_bytes(out_header, entry_name_and_header + ENTRY_NAME_SIZE); + + *out_tag = tag; + *out_hash = hash; + return CONV_OK; +} + +static bool fozdb_seek_to_next_entry(struct fozdb *db, struct payload_header *header, bool *truncated) +{ + uint64_t file_size = 0, data_offset = lseek(db->file, 0, SEEK_CUR); + + if (truncated) + *truncated = false; + + get_file_size(db->file, &file_size); + + if (lseek(db->file, header->size, SEEK_CUR) < 0) + { + GST_ERROR("Failed to seek to next entry. %s. " + "Entry data offset %#"PRIx64", size %#x, file size %#"PRIx64".", + strerror(errno), data_offset, header->size, file_size); + return false; + } + + if (file_size && data_offset + header->size > file_size) + { + /* Truncated chunk is not fatal. */ + GST_WARNING("Entry data larger than file, truncating database here. " + "Entry data offset %#"PRIx64", size %#x, file size %#"PRIx64".", + data_offset, header->size, file_size); + if (truncated) + *truncated = true; + } + + return true; +} + +static bool fozdb_write_entry_name(struct fozdb *db, uint32_t tag, struct payload_hash *hash) +{ + uint8_t entry_name[ENTRY_NAME_SIZE]; + + tag_to_ascii_bytes(tag, entry_name); + hash_to_ascii_bytes(hash, entry_name + sizeof(tag) * 2); + + if (!complete_write(db->file, entry_name, sizeof(entry_name))) + { + GST_ERROR("Failed to write entry name."); + return false; + } + + return true; +} + +/* Copy an entry to write_pos. */ +static int fozdb_copy_entry(struct fozdb *db, + struct entry_name *name, struct payload_header *header, uint64_t entry_data_offset) +{ + uint64_t read_offset, entry_end = entry_data_offset + header->size; + ssize_t read_size; + uint8_t *buffer; + + if (lseek(db->file, db->write_pos, SEEK_SET) < 0) + { + GST_ERROR("Failed to seek file to write_pos."); + return CONV_ERROR_SEEK_FAILED; + } + + /* Write entry name. */ + if (!fozdb_write_entry_name(db, name->tag, &name->hash)) + return CONV_ERROR_WRITE_FAILED; + db->write_pos += ENTRY_NAME_SIZE; + + /* Write entry header. */ + if (!complete_write(db->file, header, sizeof(*header))) + { + GST_ERROR("Failed to write entry header."); + return CONV_ERROR_WRITE_FAILED; + } + db->write_pos += sizeof(*header); + + /* Copy entry data. */ + buffer = calloc(1, BUFFER_COPY_BYTES); + for (read_offset = entry_data_offset; read_offset < entry_end; read_offset += read_size) + { + size_t to_read = min(entry_end - read_offset, BUFFER_COPY_BYTES); + + /* Read data from entry. */ + if (lseek(db->file, read_offset, SEEK_SET) < 0) + { + GST_ERROR("Failed to seek to read offset. %s.", strerror(errno)); + free(buffer); + return CONV_ERROR_SEEK_FAILED; + } + if ((read_size = read(db->file, buffer, to_read)) < 0) + { + GST_ERROR("Failed to read entry data. %s.", strerror(errno)); + free(buffer); + return CONV_ERROR_READ_FAILED; + } + if (read_size == 0) + break; + + /* Write data to write_pos. */ + if (lseek(db->file, db->write_pos, SEEK_SET) < 0) + { + GST_ERROR("Failed to seek to write_pos. %s.", strerror(errno)); + free(buffer); + return CONV_ERROR_SEEK_FAILED; + } + if (!complete_write(db->file, buffer, read_size)) + { + GST_ERROR("Failed to write entry data to write_pos."); + free(buffer); + return CONV_ERROR_WRITE_FAILED; + } + db->write_pos += read_size; + } + free(buffer); + + if (lseek(db->file, read_offset, SEEK_SET) < 0) + { + GST_ERROR("Failed to seek to read offset. %s.", strerror(errno)); + return CONV_ERROR_SEEK_FAILED; + } + + return CONV_OK; +} + +int fozdb_create(const char *file_name, int open_flags, bool read_only, uint32_t num_tags, struct fozdb **out) +{ + struct fozdb *db; + size_t i; + int ret; + + GST_DEBUG("file_name %s, open_flags %d, read_only %d, num_tags %u, out %p.", + file_name, open_flags, read_only, num_tags, out); + + db = calloc(1, sizeof(*db)); + + if (!open_file(file_name, open_flags, &db->file)) + { + free(db); + return CONV_ERROR_OPEN_FAILED; + } + + db->file_name = file_name; + db->num_tags = num_tags; + db->read_only = read_only; + + /* Create entry hash tables. */ + db->seen_blobs = calloc(num_tags, sizeof(*db->seen_blobs)); + for (i = 0; i < num_tags; ++i) + db->seen_blobs[i] = g_hash_table_new_full(hash_func, hash_equal, NULL, free); + + /* Load entries. */ + if ((ret = fozdb_prepare(db)) < 0) + { + GST_ERROR("Failed to prepare fozdb, ret %d.", ret); + fozdb_release(db); + return ret; + } + + GST_INFO("Created fozdb %p from %s.", db, file_name); + + *out = db; + return CONV_OK; +} + +void fozdb_release(struct fozdb *db) +{ + int i; + + GST_DEBUG("db %p.", db); + + for (i = 0; i < db->num_tags; ++i) + g_hash_table_destroy(db->seen_blobs[i]); + free(db->seen_blobs); + close(db->file); + free(db); +} + +int fozdb_prepare(struct fozdb *db) +{ + uint64_t file_size; + int ret; + + GST_DEBUG("db %p, file_name %s, read_only %d, num_tags %u.", + db, db->file_name, db->read_only, db->num_tags); + + db->write_pos = lseek(db->file, 0, SEEK_SET); + if (!get_file_size(db->file, &file_size)) + return CONV_ERROR; + + /* New file, write foz header. */ + if (!file_size) + { + struct file_header file_header; + + memcpy(file_header.magic, FOZDB_MAGIC, sizeof(FOZDB_MAGIC)); + file_header.unused1 = 0; + file_header.unused2 = 0; + file_header.unused3 = 0; + file_header.version = FOZDB_VERSION; + + if (!complete_write(db->file, &file_header, sizeof(file_header))) + { + GST_ERROR("Failed to write file header."); + return CONV_ERROR_WRITE_FAILED; + } + db->write_pos = sizeof(file_header); + + return CONV_OK; + } + + /* Read file header. */ + if ((ret = fozdb_read_file_header(db)) < 0) + return ret; + db->write_pos = lseek(db->file, 0, SEEK_CUR); + + /* Read entries to seen_blobs. */ + while (db->write_pos < file_size) + { + struct payload_entry entry, *table_entry; + uint32_t tag; + + /* Read an entry. */ + if ((ret = fozdb_read_entry_tag_hash_header(db, &tag, &entry.hash, &entry.header) < 0)) + return ret; + entry.offset = lseek(db->file, 0, SEEK_CUR); + + if (!fozdb_seek_to_next_entry(db, &entry.header, NULL)) + return CONV_ERROR_SEEK_FAILED; + db->write_pos = lseek(db->file, 0, SEEK_CUR); + + GST_INFO("Got entry: tag %u, hash %s, offset %#"PRIx64", size %#x, crc %#x.", + tag, format_hash(&entry.hash), entry.offset, entry.header.size, entry.header.crc); + + /* Insert entry to hash table. */ + if (tag >= db->num_tags) + { + GST_WARNING("Invalid tag %u.", tag); + + /* Ignore unknown tags for read-only DBs. */ + if (db->read_only) + continue; + else + return CONV_ERROR_INVALID_TAG; + } + table_entry = calloc(1, sizeof(*table_entry)); + *table_entry = entry; + g_hash_table_insert(db->seen_blobs[tag], &table_entry->hash, table_entry); + } + + return CONV_OK; +} + +bool fozdb_has_entry(struct fozdb *db, uint32_t tag, struct payload_hash *hash) +{ + if (tag >= db->num_tags) + return false; + return g_hash_table_contains(db->seen_blobs[tag], hash); +} + +int fozdb_entry_size(struct fozdb *db, uint32_t tag, struct payload_hash *hash, uint32_t *size) +{ + struct payload_entry *entry; + + if (tag >= db->num_tags) + return CONV_ERROR_INVALID_TAG; + if (!(entry = g_hash_table_lookup(db->seen_blobs[tag], hash))) + return CONV_ERROR_ENTRY_NOT_FOUND; + + *size = entry->header.full_size; + + return CONV_OK; +} + +void fozdb_iter_tag(struct fozdb *db, uint32_t tag, GHashTableIter *iter) +{ + if (tag > db->num_tags) + { + GST_ERROR("Invalid tag %u.", tag); + return; + } + g_hash_table_iter_init(iter, db->seen_blobs[tag]); +} + +int fozdb_read_entry_data(struct fozdb *db, uint32_t tag, struct payload_hash *hash, + uint64_t offset, uint8_t *buffer, size_t size, size_t *read_size, bool with_crc) +{ + struct payload_entry *entry; + size_t to_copy; + + GST_DEBUG("db %p, file_name %s, tag %u, hash %s, offset %#"PRIx64", buffer %p, size %zu, read_size %p, with_crc %d.", + db, db->file_name, tag, format_hash(hash), offset, buffer, size, read_size, with_crc); + + if (tag >= db->num_tags) + return CONV_ERROR_INVALID_TAG; + if (!(entry = g_hash_table_lookup(db->seen_blobs[tag], hash))) + return CONV_ERROR_ENTRY_NOT_FOUND; + + if (entry->header.compression != FOZDB_COMPRESSION_NONE) + return CONV_ERROR_NOT_IMPLEMENTED; + + if (offset >= entry->header.full_size) + return CONV_OK; + + if (lseek(db->file, entry->offset + offset, SEEK_SET) < 0) + return CONV_ERROR_SEEK_FAILED; + + to_copy = min(entry->header.full_size - offset, size); + if (!complete_read(db->file, buffer, to_copy)) + { + GST_ERROR("Failed to read entry data."); + return CONV_ERROR_READ_FAILED; + } + *read_size = to_copy; + + if (entry->header.crc != 0 && with_crc && entry->header.crc != crc32(0, buffer, to_copy)) + { + GST_ERROR("Wrong check sum."); + return CONV_ERROR_WRONG_CHECKSUM; + } + + return CONV_OK; +} + +int fozdb_write_entry(struct fozdb *db, uint32_t tag, struct payload_hash *hash, + void *data_src, data_read_callback read_callback, bool with_crc) +{ + struct payload_header header; + struct payload_entry *entry; + off_t header_offset; + uint32_t size = 0; + size_t read_size; + uint8_t *buffer; + uint64_t offset; + int ret; + + GST_DEBUG("db %p, file_name %s, tag %u, hash %s, data_src %p, read_callback %p, with_crc %d.", + db, db->file_name, tag, format_hash(hash), data_src, read_callback, with_crc); + + if (tag >= db->num_tags) + { + GST_ERROR("Invalid tag %u.", tag); + return CONV_ERROR_INVALID_TAG; + } + if (fozdb_has_entry(db, tag, hash)) + return CONV_OK; + + if (lseek(db->file, db->write_pos, SEEK_SET) < 0) + { + GST_ERROR("Failed to seek file to write_pos %#"PRIx64".", db->write_pos); + return CONV_ERROR_SEEK_FAILED; + } + + /* Write entry name. */ + if (!fozdb_write_entry_name(db, tag, hash)) + return CONV_ERROR_WRITE_FAILED; + + /* Write payload header first. */ + header_offset = lseek(db->file, 0, SEEK_CUR); + header.size = UINT32_MAX; /* Will be filled later. */ + header.compression = FOZDB_COMPRESSION_NONE; + header.crc = 0; /* Will be filled later. */ + header.full_size = UINT32_MAX; /* Will be filled later. */ + if (!complete_write(db->file, &header, sizeof(header))) + { + GST_ERROR("Failed to write entry header."); + return CONV_ERROR_WRITE_FAILED; + } + offset = lseek(db->file, 0, SEEK_CUR); + + /* Write data. */ + buffer = calloc(1, BUFFER_COPY_BYTES); + while ((ret = read_callback(data_src, buffer, BUFFER_COPY_BYTES, &read_size)) == CONV_OK) + { + if (size + read_size > UINT32_MAX) + { + GST_ERROR("Data too large. Fossilize format only supports 4 GB entries."); + free(buffer); + return CONV_ERROR; + } + + size += read_size; + if (!complete_write(db->file, buffer, read_size)) + { + GST_ERROR("Failed to write entry data."); + free(buffer); + return CONV_ERROR_WRITE_FAILED; + } + + if (with_crc) + header.crc = crc32(header.crc, buffer, read_size); + } + db->write_pos = lseek(db->file, 0, SEEK_CUR); + free(buffer); + if (ret != CONV_ERROR_DATA_END) + { + GST_ERROR("Failed to read data from data src, ret %d.", ret); + return ret; + } + + /* Seek back and fill in the size to header. */ + if (lseek(db->file, header_offset, SEEK_SET) < 0) + { + GST_ERROR("Failed to seek back to entry header. %s.", strerror(errno)); + return CONV_ERROR_SEEK_FAILED; + } + header.size = size; + header.full_size = size; + if (!complete_write(db->file, &header, sizeof(header))) + { + GST_ERROR("Failed to write entry header."); + return CONV_ERROR_WRITE_FAILED; + } + + /* Success. Record entry and exit. */ + entry = calloc(1, sizeof(*entry)); + entry->header = header; + entry->hash = *hash; + entry->offset = offset; + g_hash_table_insert(db->seen_blobs[tag], &entry->hash, entry); + + GST_INFO("Wrote entry: tag %u, hash %s, offset %#"PRIx64", size %#x, crc %#x.", + tag, format_hash(&entry->hash), entry->offset, entry->header.size, entry->header.crc); + + return CONV_OK; +} + +/* Rewrites the database, discarding entries listed. */ +int fozdb_discard_entries(struct fozdb *db, GList *to_discard_names) +{ + uint8_t entry_name_and_header[ENTRY_NAME_SIZE + sizeof(struct payload_header)]; + uint64_t file_size; + int i, ret; + + GST_DEBUG("db %p, file_name %s, to_discard_entries %p.", db, db->file_name, to_discard_names); + + /* Rewind the file and clear the entry tables. */ + if (lseek(db->file, 0, SEEK_SET) < 0) + { + GST_ERROR("Failed to seek to file start. %s.", strerror(errno)); + return CONV_ERROR_SEEK_FAILED; + } + for (i = 0; i < db->num_tags; ++i) + g_hash_table_remove_all(db->seen_blobs[i]); + + /* Read file header. */ + if ((ret = fozdb_read_file_header(db)) < 0) + return ret; + db->write_pos = lseek(db->file, 0, SEEK_CUR); + + /* Read each entry and see if it should be discarded. */ + if (!get_file_size(db->file, &file_size)) + return CONV_ERROR; + while (lseek(db->file, 0, SEEK_CUR) < file_size) + { + struct payload_header header; + uint64_t entry_data_offset; + struct entry_name name; + bool truncated; + + if ((ret = fozdb_read_entry_tag_hash_header(db, &name.tag, &name.hash, &header) < 0)) + return CONV_ERROR_READ_FAILED; + entry_data_offset = lseek(db->file, 0, SEEK_CUR); + + /* Check if entry should be discarded. */ + if (g_list_find_custom(to_discard_names, &name, entry_name_compare)) + { + if (!fozdb_seek_to_next_entry(db, &header, &truncated)) + return CONV_ERROR_SEEK_FAILED; + if (truncated) + break; + } + else + { + if (db->write_pos == entry_data_offset - sizeof(entry_name_and_header)) + { + /* If we haven't dropped any chunks, we can just skip it rather than rewrite it. */ + if (!fozdb_seek_to_next_entry(db, &header, &truncated)) + return CONV_ERROR_SEEK_FAILED; + if (truncated) + break; + db->write_pos = lseek(db->file, 0, SEEK_CUR); + } + else + { + /* We're offset, so we have to rewrite. */ + if ((ret = fozdb_copy_entry(db, &name, &header, entry_data_offset)) < 0) + return ret; + } + } + } + + if (ftruncate(db->file, db->write_pos) < 0) + { + GST_ERROR("Failed to truncate file. %s.", strerror(errno)); + return CONV_ERROR; + } + + return fozdb_prepare(db); +} diff --git a/dlls/winegstreamer/media-converter/lib.c b/dlls/winegstreamer/media-converter/lib.c new file mode 100644 index 000000000000..852bf7b6bc48 --- /dev/null +++ b/dlls/winegstreamer/media-converter/lib.c @@ -0,0 +1,329 @@ +/* + * Copyright 2024 Ziqing Hui for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#if 0 +#pragma makedep unix +#endif + +#include "media-converter.h" + +GST_ELEMENT_REGISTER_DECLARE(protonvideoconverter); +GST_ELEMENT_REGISTER_DECLARE(protonaudioconverter); +GST_ELEMENT_REGISTER_DECLARE(protonaudioconverterbin); + +GST_DEBUG_CATEGORY(media_converter_debug); + +static void get_dirname(const char *path, char *result) +{ + size_t i; + + for (i = strlen(path) - 1; i > 0; --i) + { + if (path[i] == '\\' || path[i] == '/') + break; + } + + memcpy(result, path, i); + result[i] = 0; +} + +static void path_concat(char *result, const char *a, const char *b) +{ + size_t a_len, b_offset; + + a_len = strlen(a); + b_offset = a_len; + memcpy(result, a, a_len); + + if (result[a_len - 1] != '/') + { + result[a_len] = '/'; + ++b_offset; + } + + strcpy(result + b_offset, b); +} + +static bool create_all_dir(const char *dir) +{ + char *ptr, buffer[4096] = {0}; + + strcpy(buffer, dir); + if (buffer[strlen(dir) - 1] != '/') + buffer[strlen(dir)] = '/'; + + ptr = strchr(buffer + 1, '/'); + while (ptr) + { + *ptr = '\0'; + + if (mkdir(buffer, 0777) < 0) + { + if (errno != EEXIST) + { + GST_ERROR("Failed to make directory %s. %s.", buffer, strerror(errno)); + return false; + } + } + *ptr = '/'; + + ptr = strchr(ptr + 1, '/'); + } + return true; +} + +static int create_file(const char *file_name) +{ + int fd, ret = CONV_OK; + char dir[4096]; + + get_dirname(file_name, dir); + if (access(dir, F_OK) < 0 && !create_all_dir(dir)) + return CONV_ERROR_PATH_NOT_FOUND; + + if ((fd = open(file_name, O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)) < 0) + { + GST_WARNING("Failed to open file %s with O_CREAT. %s.", file_name, strerror(errno)); + return CONV_ERROR_OPEN_FAILED; + } + + if (futimens(fd, NULL) < 0) + { + GST_WARNING("Failed to set file %s timestamps. %s.", file_name, strerror(errno)); + ret = CONV_ERROR; + } + + close(fd); + + return ret; +} + +bool open_file(const char *file_name, int open_flags, int *out_fd) +{ + int fd; + + if ((fd = open(file_name, open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)) < 0) + { + GST_WARNING("Failed to open %s with flags %d. %s.", file_name, open_flags, strerror(errno)); + return false; + } + + *out_fd = fd; + return true; +} + +bool get_file_size(int fd, uint64_t *file_size) +{ + struct stat file_info; + + if (fstat(fd, &file_info) < 0) + { + GST_WARNING("Failed to fstat fd %d. %s.", fd, strerror(errno)); + return false; + } + + *file_size = file_info.st_size; + return true; +} + +bool complete_read(int file, void *buffer, size_t size) +{ + size_t current_read = 0; + ssize_t read_size; + errno = 0; + + while (current_read < size) + { + read_size = read(file, ((char *)buffer) + current_read, size - current_read); + if(read_size <= 0) + { + if(errno != EINTR && errno != EAGAIN) + return false; + } + else + { + current_read += read_size; + } + } + + return current_read == size; +} + +bool complete_write(int file, const void *buffer, size_t size) +{ + size_t current_write = 0; + ssize_t write_size; + errno = 0; + + while (current_write < size) + { + write_size = write(file, (const char *)buffer + current_write, size - current_write); + if(write_size < 0) + { + if(errno != EINTR && errno != EAGAIN) + return false; + } + else + { + current_write += write_size; + } + } + + return current_write == size; +} + +uint32_t crc32(uint32_t crc, const uint8_t *ptr, size_t buf_len) +{ + static const uint32_t s_crc_table[256] = + { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, + 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, + 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, + 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, + 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, + 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, + 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, + 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, + 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, + 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, + 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, + 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, + 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, + 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, + 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, + 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, + 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, + 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, + 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, + 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, + 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, + 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, + 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, + 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, + 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, + 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, + 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + }; + uint32_t crc32 = (uint32_t)crc ^ 0xffffffff; + const uint8_t *buffer = (const uint8_t *)ptr; + + while (buf_len >= 4) + { + crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ buffer[0]) & 0xff]; + crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ buffer[1]) & 0xff]; + crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ buffer[2]) & 0xff]; + crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ buffer[3]) & 0xff]; + buffer += 4; + buf_len -= 4; + } + + while (buf_len) + { + crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ buffer[0]) & 0xff]; + ++buffer; + --buf_len; + } + + return ~crc32; +} + +int create_placeholder_file(const char *file_name) +{ + const char *shader_path; + char path[1024]; + int ret; + + if ((shader_path = getenv("STEAM_COMPAT_TRANSCODED_MEDIA_PATH"))) + { + path_concat(path, shader_path, file_name); + if ((ret = create_file(path)) < 0) + GST_ERROR("Failed to create %s file, ret %d.", file_name, ret); + } + else + { + GST_ERROR("Env STEAM_COMPAT_TRANSCODED_MEDIA_PATH not set."); + ret = CONV_ERROR_ENV_NOT_SET; + } + + return ret; +} + +int dump_fozdb_open(struct dump_fozdb *db, bool create, const char *file_path_env, int num_tags) +{ + char *dump_file_path; + + if (db->fozdb) + return CONV_OK; + + if (!(dump_file_path = getenv(file_path_env))) + { + GST_ERROR("Env %s not set.", file_path_env); + return CONV_ERROR_ENV_NOT_SET; + } + + if (create) + create_file(dump_file_path); + + return fozdb_create(dump_file_path, O_RDWR, false, num_tags, &db->fozdb); +} + +void dump_fozdb_close(struct dump_fozdb *db) +{ + if (db->fozdb) + { + fozdb_release(db->fozdb); + db->fozdb = NULL; + } +} + +bool media_converter_init(void) +{ + GST_DEBUG_CATEGORY_INIT(media_converter_debug, + "protonmediaconverter", GST_DEBUG_FG_YELLOW, "Proton media converter"); + + if (!GST_ELEMENT_REGISTER(protonvideoconverter, NULL)) + { + GST_ERROR("Failed to register protonvideoconverter."); + return false; + } + + if (!GST_ELEMENT_REGISTER(protonaudioconverter, NULL)) + { + GST_ERROR("Failed to register protonaudioconverter."); + return false; + } + + if (!GST_ELEMENT_REGISTER(protonaudioconverterbin, NULL)) + { + GST_ERROR("Failed to register protonaudioconverterbin."); + return false; + } + + return true; +} diff --git a/dlls/winegstreamer/media-converter/media-converter.h b/dlls/winegstreamer/media-converter/media-converter.h new file mode 100644 index 000000000000..8cd4b31344aa --- /dev/null +++ b/dlls/winegstreamer/media-converter/media-converter.h @@ -0,0 +1,290 @@ +/* + * Copyright 2024 Ziqing Hui for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __MEDIA_CONVERTER_H__ +#define __MEDIA_CONVERTER_H__ + +#define _FILE_OFFSET_BITS 64 + +#include +#include +#include +#include +#include +#include +#include + +#include "unix_private.h" + +GST_DEBUG_CATEGORY_EXTERN(media_converter_debug); +#undef GST_CAT_DEFAULT +#define GST_CAT_DEFAULT media_converter_debug + +typedef int (*data_read_callback)(void *data_reader, uint8_t *buffer, size_t size, size_t *read_size); + +/* Changing this will invalidate the cache. You MUST clear it. */ +#define HASH_SEED 0x4AA61F63 + +enum conv_ret +{ + CONV_OK = 0, + CONV_ERROR = -1, + CONV_ERROR_NOT_IMPLEMENTED = -2, + CONV_ERROR_INVALID_ARGUMENT = -3, + CONV_ERROR_OPEN_FAILED = -4, + CONV_ERROR_READ_FAILED = -5, + CONV_ERROR_WRITE_FAILED = -6, + CONV_ERROR_SEEK_FAILED = -7, + CONV_ERROR_CORRUPT_DATABASE = -8, + CONV_ERROR_WRONG_CHECKSUM = -9, + CONV_ERROR_ENTRY_NOT_FOUND = -10, + CONV_ERROR_ENV_NOT_SET = -11, + CONV_ERROR_PATH_NOT_FOUND = -12, + CONV_ERROR_INVALID_TAG = -13, + CONV_ERROR_DATA_END = -14, +}; + +struct murmur3_x64_128_state +{ + uint32_t seed; + uint64_t h1; + uint64_t h2; + size_t processed; +}; + +struct murmur3_x86_128_state +{ + uint32_t seed; + uint32_t h1; + uint32_t h2; + uint32_t h3; + uint32_t h4; + size_t processed; +}; + +struct bytes_reader +{ + const uint8_t *data; + size_t size; + size_t offset; +}; + +struct gst_buffer_reader +{ + GstBuffer *buffer; /* No ref here, no need to unref. */ + size_t offset; +}; + +struct payload_hash +{ + uint32_t hash[4]; +}; + +struct entry_name +{ + uint32_t tag; + struct payload_hash hash; +}; + +struct dump_fozdb +{ + pthread_mutex_t mutex; + struct fozdb *fozdb; + bool already_cleaned; +}; + +struct fozdb +{ + const char *file_name; + int file; + bool read_only; + uint64_t write_pos; + GHashTable **seen_blobs; + uint32_t num_tags; +}; + +/* lib.c. */ +extern bool open_file(const char *file_name, int open_flags, int *out_fd); +extern bool get_file_size(int fd, uint64_t *file_size); +extern bool complete_read(int file, void *buffer, size_t size); +extern bool complete_write(int file, const void *buffer, size_t size); +extern uint32_t crc32(uint32_t crc, const uint8_t *ptr, size_t buf_len); +extern int create_placeholder_file(const char *file_name); +extern int dump_fozdb_open(struct dump_fozdb *db, bool create, const char *file_path_env, int num_tags); +extern void dump_fozdb_close(struct dump_fozdb *db); + +/* murmur3.c. */ +extern void murmur3_x64_128_state_init(struct murmur3_x64_128_state *state, uint32_t seed); +extern void murmur3_x64_128_state_reset(struct murmur3_x64_128_state *state); +extern bool murmur3_x64_128_full(void *data_src, data_read_callback read_callback, + struct murmur3_x64_128_state* state, void *out); +extern bool murmur3_x64_128(void *data_src, data_read_callback read_callback, uint32_t seed, void *out); +extern void murmur3_x86_128_state_init(struct murmur3_x86_128_state *state, uint32_t seed); +extern void murmur3_x86_128_state_reset(struct murmur3_x86_128_state *state); +extern bool murmur3_x86_128_full(void *data_src, data_read_callback read_callback, + struct murmur3_x86_128_state* state, void *out); +extern bool murmur3_x86_128(void *data_src, data_read_callback read_callback, uint32_t seed, void *out); +#if defined(__x86_64__) || defined(__aarch64__) +#define murmur3_128_state murmur3_x64_128_state +#define murmur3_128_state_init murmur3_x64_128_state_init +#define murmur3_128_state_reset murmur3_x64_128_state_reset +#define murmur3_128_full murmur3_x64_128_full +#define murmur3_128 murmur3_x64_128 +#elif defined(__i386__) +#define murmur3_128_state murmur3_x86_128_state +#define murmur3_128_state_init murmur3_x86_128_state_init +#define murmur3_128_state_reset murmur3_x86_128_state_reset +#define murmur3_128_full murmur3_x86_128_full +#define murmur3_128 murmur3_x86_128 +#endif /* __x86_64__ */ + +/* fossilize.c. */ +extern int fozdb_create(const char *file_name, int open_flags, bool read_only, uint32_t num_tags, struct fozdb **out); +extern void fozdb_release(struct fozdb *db); +extern int fozdb_prepare(struct fozdb *db); +extern bool fozdb_has_entry(struct fozdb *db, uint32_t tag, struct payload_hash *hash); +extern int fozdb_entry_size(struct fozdb *db, uint32_t tag, struct payload_hash *hash, uint32_t *size); +extern void fozdb_iter_tag(struct fozdb *db, uint32_t tag, GHashTableIter *iter); +extern int fozdb_read_entry_data(struct fozdb *db, uint32_t tag, struct payload_hash *hash, + uint64_t offset, uint8_t *buffer, size_t size, size_t *read_size, bool with_crc); +extern int fozdb_write_entry(struct fozdb *db, uint32_t tag, struct payload_hash *hash, + void *data_src, data_read_callback read_callback, bool with_crc); +extern int fozdb_discard_entries(struct fozdb *db, GList *to_discard_entries); + +static inline bool option_enabled(const char *env) +{ + const char *env_var; + + if (!(env_var = getenv(env))) + return false; + + return strcmp(env_var, "0") != 0; +} + +static inline bool discarding_disabled(void) +{ + return option_enabled("MEDIACONV_DONT_DISCARD"); +} + +static inline const char *format_hash(struct payload_hash *hash) +{ + int hash_str_size = 2 + sizeof(*hash) * 2 + 1; + static char buffer[1024] = {}; + static int offset = 0; + char *ret; + + if (offset + hash_str_size > sizeof(buffer)) + offset = 0; + + ret = buffer + offset; + sprintf(ret, "0x%08x%08x%08x%08x", hash->hash[3], hash->hash[2], hash->hash[1], hash->hash[0]); + offset += hash_str_size; + + return ret; +} + +static inline void bytes_reader_init(struct bytes_reader *reader, const uint8_t *data, size_t size) +{ + reader->data = data; + reader->size = size; + reader->offset = 0; +} + +static inline int bytes_reader_read(void *data_reader, uint8_t *buffer, size_t size, size_t *read_size) +{ + struct bytes_reader *reader = data_reader; + size_t data_size, to_copy; + + if (!size) + { + *read_size = 0; + return CONV_OK; + } + + if (!(data_size = reader->size - reader->offset)) + return CONV_ERROR_DATA_END; + + to_copy = min(data_size, size); + memcpy(buffer, reader->data + reader->offset, to_copy); + reader->offset += to_copy; + + *read_size = to_copy; + return CONV_OK; +} + +static inline void gst_buffer_reader_init(struct gst_buffer_reader *reader, GstBuffer *buffer) +{ + reader->buffer = buffer; /* No ref here, so no need to unref. */ + reader->offset = 0; +} + +static inline int gst_buffer_reader_read(void *data_reader, uint8_t *buffer, size_t size, size_t *read_size) +{ + struct gst_buffer_reader *reader = data_reader; + + if (!size) + { + *read_size = 0; + return CONV_OK; + } + + *read_size = gst_buffer_extract(reader->buffer, reader->offset, buffer, size); + reader->offset += *read_size; + if (!*read_size) + return CONV_ERROR_DATA_END; + + return CONV_OK; +} + +static inline bool file_exists(const char *file_path) +{ + if (!file_path) + return false; + return access(file_path, F_OK) == 0; +} + +static inline struct entry_name *entry_name_create(uint32_t tag, struct payload_hash *hash) +{ + struct entry_name *entry = calloc(1, sizeof(*entry)); + entry->tag = tag; + entry->hash = *hash; + return entry; +} + +static inline gint entry_name_compare(const void *a, const void *b) +{ + return memcmp(a, b, sizeof(struct entry_name)); +} + +static inline uint32_t bytes_to_uint32(const uint8_t *bytes) +{ + return ((uint32_t)bytes[0] << 0) + | ((uint32_t)bytes[1] << 8) + | ((uint32_t)bytes[2] << 16) + | ((uint32_t)bytes[3] << 24); +} + +static inline void payload_hash_from_bytes(struct payload_hash *hash, uint8_t *bytes) +{ + hash->hash[0] = bytes_to_uint32(bytes + 0); + hash->hash[1] = bytes_to_uint32(bytes + 4); + hash->hash[2] = bytes_to_uint32(bytes + 8); + hash->hash[3] = bytes_to_uint32(bytes + 12); +} + +#endif /* __MEDIA_CONVERTER_H__ */ diff --git a/dlls/winegstreamer/media-converter/murmur3.c b/dlls/winegstreamer/media-converter/murmur3.c new file mode 100644 index 000000000000..014345e61d51 --- /dev/null +++ b/dlls/winegstreamer/media-converter/murmur3.c @@ -0,0 +1,371 @@ +/* + * Copyright 2024 Ziqing Hui for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "media-converter.h" + +static uint64_t rotl64(uint64_t value, uint8_t shift) +{ + return (value << shift) | (value >> (64 - shift)); +} + +static uint32_t rotl32(uint32_t value, uint8_t shift) +{ + return (value << shift) | (value >> (32 - shift)); +} + +static uint64_t fmix64(uint64_t h) +{ + const uint64_t c1 = 0xff51afd7ed558ccd; + const uint64_t c2 = 0xc4ceb9fe1a85ec53; + const uint32_t r = 33; + + h ^= h >> r; + h *= c1; + h ^= h >> r; + h *= c2; + h ^= h >> r; + + return h; +} + +static uint32_t fmix32 (uint32_t h) +{ + const uint32_t c1 = 0x85ebca6b; + const uint32_t c2 = 0xc2b2ae35; + const uint32_t r1 = 16; + const uint32_t r2 = 13; + + h ^= h >> r1; + h *= c1; + h ^= h >> r2; + h *= c2; + h ^= h >> r1; + + return h; +} + +void murmur3_x64_128_state_init(struct murmur3_x64_128_state *state, uint32_t seed) +{ + state->seed = seed; + state->h1 = seed; + state->h2 = seed; + state->processed = 0; +} + +void murmur3_x64_128_state_reset(struct murmur3_x64_128_state *state) +{ + state->h1 = state->seed; + state->h2 = state->seed; + state->processed = 0; +} + +bool murmur3_x64_128_full(void *data_reader, data_read_callback read_callback, + struct murmur3_x64_128_state* state, void *out) +{ + const uint64_t c1 = 0x87c37b91114253d5, c2 = 0x4cf5ad432745937f, c3 = 0x52dce729, c4 = 0x38495ab5, m = 5; + size_t read_size, processed = state->processed; + const uint32_t r1 = 27, r2 = 31, r3 = 33; + uint64_t h1 = state->h1, h2 = state->h2; + uint8_t buffer[16] = {0}; + uint64_t k1, k2; + int ret; + + while ((ret = read_callback(data_reader, buffer, sizeof(buffer), &read_size)) == CONV_OK) + { + processed += read_size; + + if (read_size == 16) + { + k1 = *(uint64_t *)&buffer[0]; + k2 = *(uint64_t *)&buffer[8]; + + k1 *= c1; + k1 = rotl64(k1, r2); + k1 *= c2; + h1 ^= k1; + h1 = rotl64(h1, r1); + h1 += h2; + h1 = h1 * m + c3; + + k2 *= c2; + k2 = rotl64(k2, r3); + k2 *= c1; + h2 ^= k2; + h2 = rotl64(h2, r2); + h2 += h1; + h2 = h2 * m + c4; + } + else + { + k1 = 0; + k2 = 0; + + switch (read_size) + { + case 15: + k2 ^= ((uint64_t)buffer[14]) << 48; + case 14: + k2 ^= ((uint64_t)buffer[13]) << 40; + case 13: + k2 ^= ((uint64_t)buffer[12]) << 32; + case 12: + k2 ^= ((uint64_t)buffer[11]) << 24; + case 11: + k2 ^= ((uint64_t)buffer[10]) << 16; + case 10: + k2 ^= ((uint64_t)buffer[9]) << 8; + case 9: + k2 ^= ((uint64_t)buffer[8]) << 0; + k2 *= c2; + k2 = rotl64(k2, r3); + k2 *= c1; + h2 ^= k2; + case 8: + k1 ^= ((uint64_t)buffer[7]) << 56; + case 7: + k1 ^= ((uint64_t)buffer[6]) << 48; + case 6: + k1 ^= ((uint64_t)buffer[5]) << 40; + case 5: + k1 ^= ((uint64_t)buffer[4]) << 32; + case 4: + k1 ^= ((uint64_t)buffer[3]) << 24; + case 3: + k1 ^= ((uint64_t)buffer[2]) << 16; + case 2: + k1 ^= ((uint64_t)buffer[1]) << 8; + case 1: + k1 ^= ((uint64_t)buffer[0]) << 0; + k1 *= c1; + k1 = rotl64(k1, r2); + k1 *= c2; + h1 ^= k1; + } + } + } + + if (ret != CONV_ERROR_DATA_END) + return false; + + state->processed = processed; + state->h1 = h1; + state->h2 = h2; + + h1 ^= (uint64_t)processed; + h2 ^= (uint64_t)processed; + h1 += h2; + h2 += h1; + h1 = fmix64(h1); + h2 = fmix64(h2); + h1 += h2; + h2 += h1; + + ((uint64_t *)out)[0] = h1; + ((uint64_t *)out)[1] = h2; + + return true; +} + +bool murmur3_x64_128(void *data_src, data_read_callback read_callback, uint32_t seed, void *out) +{ + struct murmur3_x64_128_state state; + murmur3_x64_128_state_init(&state, seed); + return murmur3_x64_128_full(data_src, read_callback, &state, out); +} + +void murmur3_x86_128_state_init(struct murmur3_x86_128_state *state, uint32_t seed) +{ + state->seed = seed; + state->h1 = seed; + state->h2 = seed; + state->h3 = seed; + state->h4 = seed; + state->processed = 0; +} + +void murmur3_x86_128_state_reset(struct murmur3_x86_128_state *state) +{ + state->h1 = state->seed; + state->h2 = state->seed; + state->h3 = state->seed; + state->h4 = state->seed; + state->processed = 0; +} + +bool murmur3_x86_128_full(void *data_reader, data_read_callback read_callback, + struct murmur3_x86_128_state *state, void *out) +{ + const uint32_t c1 = 0x239b961b, c2 = 0xab0e9789, c3 = 0x38b34ae5, c4 = 0xa1e38b93; + const uint32_t c5 = 0x561ccd1b, c6 = 0x0bcaa747, c7 = 0x96cd1c35, c8 = 0x32ac3b17; + uint32_t h1 = state->h1, h2 = state->h2, h3 = state->h3, h4 = state->h4; + size_t read_size, processed = state->processed; + unsigned char buffer[16] = {0}; + uint64_t k1, k2, k3, k4; + const uint32_t m = 5; + int ret; + + while ((ret = read_callback(data_reader, buffer, sizeof(buffer), &read_size)) == CONV_OK) + { + processed += read_size; + + if (read_size == 16) + { + k1 = *(uint32_t*)&buffer[0]; + k2 = *(uint32_t*)&buffer[4]; + k3 = *(uint32_t*)&buffer[8]; + k4 = *(uint32_t*)&buffer[12]; + + k1 *= c1; + k1 = rotl32(k1, 15); + k1 *= c2; + h1 ^= k1; + h1 = rotl32(h1, 19); + h1 += h2; + h1 = h1 * m + c5; + + k2 *= c2; + k2 = rotl32(k2, 16); + k2 *= c3; + h2 ^= k2; + h2 = rotl32(h2, 17); + h2 += h3; + h2 = h2 * m + c6; + + k3 *= c3; + k3 = rotl32(k3, 17); + k3 *= c4; + h3 ^= k3; + h3 = rotl32(h3, 15); + h3 += h4; + h3 = h3 * m + c7; + + k4 *= c4; + k4 = rotl32(k4, 18); + k4 *= c1; + h4 ^= k4; + h4 = rotl32(h4, 13); + h4 += h1; + h4 = h4 * m + c8; + } + else + { + k1 = 0; + k2 = 0; + k3 = 0; + k4 = 0; + + switch (read_size) + { + case 15: + k4 ^= buffer[14] << 16; + case 14: + k4 ^= buffer[13] << 8; + case 13: + k4 ^= buffer[12] << 0; + k4 *= c4; + k4 = rotl32(k4,18); + k4 *= c1; + h4 ^= k4; + case 12: + k3 ^= buffer[11] << 24; + case 11: + k3 ^= buffer[10] << 16; + case 10: + k3 ^= buffer[9] << 8; + case 9: + k3 ^= buffer[8] << 0; + k3 *= c3; + k3 = rotl32(k3, 17); + k3 *= c4; + h3 ^= k3; + case 8: + k2 ^= buffer[7] << 24; + case 7: + k2 ^= buffer[6] << 16; + case 6: + k2 ^= buffer[5] << 8; + case 5: + k2 ^= buffer[4] << 0; + k2 *= c2; + k2 = rotl32(k2, 16); + k2 *= c3; + h2 ^= k2; + case 4: + k1 ^= buffer[3] << 24; + case 3: + k1 ^= buffer[2] << 16; + case 2: + k1 ^= buffer[1] << 8; + case 1: + k1 ^= buffer[0] << 0; + k1 *= c1; + k1 = rotl32(k1, 15); + k1 *= c2; + h1 ^= k1; + } + } + } + + if (ret != CONV_ERROR_DATA_END) + return false; + + state->processed = processed; + state->h1 = h1; + state->h2 = h2; + state->h3 = h3; + state->h4 = h4; + + h1 ^= processed; + h2 ^= processed; + h3 ^= processed; + h4 ^= processed; + h1 += h2; + h1 += h3; + h1 += h4; + h2 += h1; + h3 += h1; + h4 += h1; + h1 = fmix32(h1); + h2 = fmix32(h2); + h3 = fmix32(h3); + h4 = fmix32(h4); + h1 += h2; + h1 += h3; + h1 += h4; + h2 += h1; + h3 += h1; + h4 += h1; + + ((uint32_t*)out)[0] = h1; + ((uint32_t*)out)[1] = h2; + ((uint32_t*)out)[2] = h3; + ((uint32_t*)out)[3] = h4; + + return true; +} + +bool murmur3_x86_128(void *data_src, data_read_callback read_callback, uint32_t seed, void *out) +{ + struct murmur3_x86_128_state state; + murmur3_x86_128_state_init(&state, seed); + return murmur3_x86_128_full(data_src, read_callback, &state, out); +} diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c new file mode 100644 index 000000000000..b91aa96f1bf1 --- /dev/null +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -0,0 +1,938 @@ +/* + * Copyright 2024 Ziqing Hui for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* Algorithm + * --------- + * + * Nicely, both Quartz and Media Foundation allow us random access to the entire data stream. So we + * can easily hash the entire incoming stream and substitute it with our Ogg Theora video. If there + * is a cache miss, then we dump the entire incoming stream. In case of a cache hit, we dump + * nothing. + * + * Incoming video data is stored in the video.foz Fossilize database. + * + * Transcoded video data is stored in the transcoded_video.foz Fossilize database. + * + * + * Hashing algorithm + * ----------------- + * + * We use murmur3 hash with the seed given below. We use the x32 variant for 32-bit programs, and + * the x64 variant for 64-bit programs. + * + * For speed when hashing, we specify a stride which will skip over chunks of the input. However, + * we will always hash the first "stride" number of bytes, to try to avoid collisions on smaller + * files with size between chunk and stride. + * + * For example, the 'H's below are hashed, the 'x's are skipped: + * + * int chunk = 4; + * int stride = chunk * 3; + * H = hashed, x = skipped + * [HHHH HHHH HHHH HHHH xxxx xxxx HHHH xxxx xxxx HHHH xxxx] < data stream + * ^^^^ ^^^^ ^^^^ stride prefix, hashed + * ^^^^ chunk + * ^^^^ ^^^^ ^^^^ stride + * ^^^^ chunk + * ^^^^ ^^^^ ^^^^ stride + * ^^^^ chunk + * ^^^^ ^^^^ stride + */ + +#if 0 +#pragma makedep unix +#endif + +#include "media-converter.h" + +#include + +#define HASH_CHUNK_SIZE (8 * 1024 * 1024) /* 8 MB. */ +#define HASH_STRIDE (HASH_CHUNK_SIZE * 6) + +#define VIDEO_CONV_FOZ_TAG_VIDEODATA 0 +#define VIDEO_CONV_FOZ_TAG_OGVDATA 1 +#define VIDEO_CONV_FOZ_TAG_STREAM 2 +#define VIDEO_CONV_FOZ_TAG_MKVDATA 3 +#define VIDEO_CONV_FOZ_NUM_TAGS 4 + +#define DURATION_NONE (UINT64_MAX) + +struct pad_reader +{ + GstPad *pad; + size_t offset; + uint8_t *chunk; + size_t chunk_offset; + size_t chunk_end; + size_t stride; /* Set to SIZE_MAX to skip no bytes. */ +}; + +struct hashes_reader +{ + GList *current_hash; +}; + +struct video_conv_state +{ + struct payload_hash transcode_hash; + struct fozdb *read_fozdb; + uint64_t upstream_duration; + uint64_t our_duration; + uint32_t transcoded_tag; + bool has_transcoded, need_stream_start; +}; + +typedef struct +{ + GstElement element; + GstPad *sink_pad, *src_pad; + pthread_mutex_t state_mutex; + struct video_conv_state *state; +} VideoConv; + +typedef struct +{ + GstElementClass class; +} VideoConvClass; + +G_DEFINE_TYPE(VideoConv, video_conv, GST_TYPE_ELEMENT); +#define VIDEO_CONV_TYPE (video_conv_get_type()) +#define VIDEO_CONV(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), VIDEO_CONV_TYPE, VideoConv)) +#define parent_class (video_conv_parent_class) +GST_ELEMENT_REGISTER_DEFINE(protonvideoconverter, "protonvideoconverter", + GST_RANK_MARGINAL, VIDEO_CONV_TYPE); + +static GstStaticPadTemplate video_conv_sink_template = GST_STATIC_PAD_TEMPLATE("sink", + GST_PAD_SINK, GST_PAD_ALWAYS, + GST_STATIC_CAPS("video/x-ms-asf; video/x-msvideo; video/mpeg; video/quicktime;")); + +static GstStaticPadTemplate video_conv_src_template = GST_STATIC_PAD_TEMPLATE("src", + GST_PAD_SRC, GST_PAD_ALWAYS, + GST_STATIC_CAPS("video/x-matroska; application/ogg;")); + +static struct dump_fozdb dump_fozdb = {PTHREAD_MUTEX_INITIALIZER, NULL, false}; + +void hashes_reader_init(struct hashes_reader *reader, GList *hashes) +{ + reader->current_hash = hashes; +} + +static int hashes_reader_read(void *reader, uint8_t *buffer, size_t size, size_t *read_size) +{ + struct payload_hash *hash = (struct payload_hash *)buffer; + struct hashes_reader *hashes_reader = reader; + + if (!size) + { + *read_size = 0; + return CONV_OK; + } + + if (!hashes_reader->current_hash) + return CONV_ERROR_DATA_END; + + *hash = *(struct payload_hash *)(hashes_reader->current_hash->data); + hashes_reader->current_hash = hashes_reader->current_hash->next; + + *read_size = sizeof(*hash); + return CONV_OK; +} + +static int dump_fozdb_open_video(bool create) +{ + return dump_fozdb_open(&dump_fozdb, create, "MEDIACONV_VIDEO_DUMP_FILE", VIDEO_CONV_FOZ_NUM_TAGS); +} + +static void dump_fozdb_discard_transcoded(void) +{ + GList *to_discard_chunks = NULL; + struct payload_hash *stream_id; + struct fozdb *read_fozdb; + char *read_fozdb_path; + GHashTableIter iter; + int ret; + + if (dump_fozdb.already_cleaned) + return; + dump_fozdb.already_cleaned = true; + + if (discarding_disabled()) + return; + if (!file_exists(getenv("MEDIACONV_VIDEO_DUMP_FILE"))) + return; + + if (dump_fozdb_open_video(false) < 0) + return; + + if (!(read_fozdb_path = getenv("MEDIACONV_VIDEO_TRANSCODED_FILE"))) + { + GST_ERROR("Env MEDIACONV_VIDEO_TRANSCODED_FILE not set."); + return; + } + + if ((ret = fozdb_create(read_fozdb_path, O_RDONLY, true /* Read-only? */, VIDEO_CONV_FOZ_NUM_TAGS, &read_fozdb)) < 0) + { + GST_ERROR("Failed to create read fozdb, ret %d.", ret); + return; + } + + fozdb_iter_tag(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_STREAM, &iter); + while (g_hash_table_iter_next(&iter, (void **)&stream_id, NULL)) + { + struct payload_hash chunk_id; + uint32_t chunks_size, i; + size_t read_size; + + if (fozdb_has_entry(read_fozdb, VIDEO_CONV_FOZ_TAG_OGVDATA, stream_id)) + { + if (fozdb_entry_size(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_STREAM, stream_id, &chunks_size) == CONV_OK) + { + uint8_t *buffer = calloc(1, chunks_size); + if (fozdb_read_entry_data(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_STREAM, stream_id, + 0, buffer, chunks_size, &read_size, true) == CONV_OK) + { + for (i = 0; i < read_size / sizeof(chunk_id); ++i) + { + payload_hash_from_bytes(&chunk_id, buffer + i * sizeof(chunk_id)); + to_discard_chunks = g_list_append(to_discard_chunks, + entry_name_create(VIDEO_CONV_FOZ_TAG_VIDEODATA, &chunk_id)); + } + } + free(buffer); + } + + to_discard_chunks = g_list_append(to_discard_chunks, + entry_name_create(VIDEO_CONV_FOZ_TAG_STREAM, stream_id)); + } + } + + if ((ret = fozdb_discard_entries(dump_fozdb.fozdb, to_discard_chunks)) < 0) + { + GST_ERROR("Failed to discard entries, ret %d.", ret); + dump_fozdb_close(&dump_fozdb); + } + + g_list_free_full(to_discard_chunks, free); +} + +struct pad_reader *pad_reader_create_with_stride(GstPad *pad, size_t stride) +{ + struct pad_reader *pad_reader; + + pad_reader = calloc(1, sizeof(*pad_reader)); + pad_reader->chunk = calloc(HASH_CHUNK_SIZE, sizeof(*pad_reader->chunk)); + pad_reader->stride = stride; + gst_object_ref((pad_reader->pad = pad)); + + return pad_reader; +} + +struct pad_reader *pad_reader_create(GstPad *pad) +{ + return pad_reader_create_with_stride(pad, SIZE_MAX); +} + +void pad_reader_release(struct pad_reader *reader) +{ + gst_object_unref(reader->pad); + free(reader->chunk); + free(reader); +} + +int pad_reader_read(void *data_src, uint8_t *buffer, size_t size, size_t *read_size) +{ + struct pad_reader *reader = data_src; + GstBuffer *gst_buffer = NULL; + GstFlowReturn gst_ret; + size_t to_copy; + + if (!size) + { + *read_size = 0; + return CONV_OK; + } + + if (reader->chunk_offset >= reader->chunk_end) + { + reader->chunk_offset = 0; + reader->chunk_end = 0; + + if ((gst_ret = gst_pad_pull_range(reader->pad, + reader->offset, HASH_CHUNK_SIZE, &gst_buffer)) == GST_FLOW_OK) + { + gsize buffer_size = gst_buffer_get_size(gst_buffer); + + if (reader->offset + buffer_size < reader->stride) + { + to_copy = buffer_size; + reader->offset += to_copy; + } + else if (reader->offset < reader->stride) + { + to_copy = reader->stride - reader->offset; + reader->offset = reader->stride; + } + else + { + to_copy = buffer_size; + reader->offset += reader->stride; + } + + if (size >= to_copy) /* Copy directly into out buffer and return. */ + { + *read_size = gst_buffer_extract(gst_buffer, 0, buffer, to_copy); + gst_buffer_unref(gst_buffer); + return CONV_OK; + } + else + { + reader->chunk_end = gst_buffer_extract(gst_buffer, 0, reader->chunk, to_copy); + gst_buffer_unref(gst_buffer); + } + } + else if (gst_ret == GST_FLOW_EOS) + { + return CONV_ERROR_DATA_END; + } + else + { + GST_WARNING("Failed to pull data from %"GST_PTR_FORMAT", reason %s.", + reader->pad, gst_flow_get_name(gst_ret)); + return CONV_ERROR; + } + } + + /* Copy chunk data to output buffer. */ + to_copy = min(reader->chunk_end - reader->chunk_offset, size); + memcpy(buffer, reader->chunk + reader->chunk_offset, to_copy); + reader->chunk_offset += to_copy; + + *read_size = to_copy; + return CONV_OK; +} + +static int video_conv_state_create(struct video_conv_state **out) +{ + struct video_conv_state *state; + struct fozdb *fozdb = NULL; + char *read_fozdb_path; + int ret; + + if (!(read_fozdb_path = getenv("MEDIACONV_VIDEO_TRANSCODED_FILE"))) + { + GST_ERROR("MEDIACONV_VIDEO_TRANSCODED_FILE is not set."); + return CONV_ERROR_ENV_NOT_SET; + } + + if ((ret = fozdb_create(read_fozdb_path, O_RDONLY, true /* Read-only? */, VIDEO_CONV_FOZ_NUM_TAGS, &fozdb)) < 0) + GST_ERROR("Failed to create read fozdb from %s, ret %d.", read_fozdb_path, ret); + + state = calloc(1, sizeof(*state)); + state->read_fozdb = fozdb; + state->upstream_duration = DURATION_NONE; + state->our_duration = DURATION_NONE; + state->transcoded_tag = VIDEO_CONV_FOZ_TAG_MKVDATA; + state->need_stream_start = true; + + *out = state; + return CONV_OK; +} + +static void video_conv_state_release(struct video_conv_state *state) +{ + if (state->read_fozdb) + fozdb_release(state->read_fozdb); + free(state); +} + +/* Return true if the file is transcoded, false if not. */ +bool video_conv_state_begin_transcode(struct video_conv_state *state, struct payload_hash *hash) +{ + const char *blank_video; + uint64_t file_size = 0; + int fd; + + GST_DEBUG("state %p, hash %s.", state, format_hash(hash)); + + if (state->read_fozdb) + { + uint32_t entry_size; + + if (fozdb_entry_size(state->read_fozdb, VIDEO_CONV_FOZ_TAG_MKVDATA, hash, &entry_size) == CONV_OK) + { + GST_DEBUG("Found an MKV video for hash %s.", format_hash(hash)); + state->transcode_hash = *hash; + state->our_duration = entry_size; + state->transcoded_tag = VIDEO_CONV_FOZ_TAG_MKVDATA; + state->has_transcoded = true; + return true; + } + + if (fozdb_entry_size(state->read_fozdb, VIDEO_CONV_FOZ_TAG_OGVDATA, hash, &entry_size) == CONV_OK) + { + GST_DEBUG("Found an OGV video for hash %s.", format_hash(hash)); + state->transcode_hash = *hash; + state->our_duration = entry_size; + state->transcoded_tag = VIDEO_CONV_FOZ_TAG_OGVDATA; + state->has_transcoded = true; + return true; + } + } + + GST_INFO("No transcoded video for %s. Substituting a blank video.", format_hash(hash)); + + if (!(blank_video = getenv("MEDIACONV_BLANK_VIDEO_FILE"))) + { + GST_ERROR("Env MEDIACONV_BLANK_VIDEO_FILE not set."); + return false; + } + if (open_file(blank_video, O_RDONLY, &fd)) + { + get_file_size(fd, &file_size); + close(fd); + } + state->our_duration = file_size; + state->has_transcoded = false; + + create_placeholder_file("placeholder-video-used"); + + return false; +} + +int video_conv_state_fill_buffer(struct video_conv_state *state, uint64_t offset, + uint8_t *buffer, size_t size, size_t *fill_size) +{ + const char *blank_video; + uint64_t file_size; + size_t to_copy; + bool read_ok; + int fd, ret; + + if (state->has_transcoded) + { + if ((ret = fozdb_read_entry_data(state->read_fozdb, state->transcoded_tag, &state->transcode_hash, + offset, buffer, size, fill_size, false)) < 0) + GST_ERROR("Failed to read entry data, ret %d.", ret); + return ret; + } + else /* Fill blank video data to buffer. */ + { + if (!(blank_video = getenv("MEDIACONV_BLANK_VIDEO_FILE"))) + { + GST_ERROR("Env MEDIACONV_BLANK_VIDEO_FILE not set."); + return CONV_ERROR_ENV_NOT_SET; + } + if (!open_file(blank_video, O_RDONLY, &fd)) + return CONV_ERROR_OPEN_FAILED; + if (!get_file_size(fd, &file_size)) + { + close(fd); + return CONV_ERROR; + } + + /* Get copy size. */ + if (offset >= file_size) + { + close(fd); + return CONV_OK; + } + to_copy = min(file_size - offset, size); + + /* Copy data. */ + if (lseek(fd, offset, SEEK_SET) < 0) + { + GST_ERROR("Failed to seek %s to %#"PRIx64". %s.", blank_video, offset, strerror(errno)); + close(fd); + return CONV_ERROR; + } + read_ok = complete_read(fd, buffer, to_copy); + close(fd); + + if (!read_ok) + { + GST_ERROR("Failed to read blank video data."); + return CONV_ERROR_READ_FAILED; + } + *fill_size = to_copy; + return CONV_OK; + } +} + +/* Call pthread_mutex_unlock() to unlock after usage. */ +static struct video_conv_state *video_conv_lock_state(VideoConv *conv) +{ + pthread_mutex_lock(&conv->state_mutex); + if (!conv->state) + pthread_mutex_unlock(&conv->state_mutex); + return conv->state; +} + +static GstStateChangeReturn video_conv_change_state(GstElement *element, GstStateChange transition) +{ + VideoConv *conv = VIDEO_CONV(element); + struct video_conv_state *state; + int ret; + + GST_INFO_OBJECT(element, "State transition: %s.", gst_state_change_get_name(transition)); + + switch (transition) + { + case GST_STATE_CHANGE_NULL_TO_READY: + /* Do runtime setup. */ + if ((ret = video_conv_state_create(&state)) < 0) + { + GST_ERROR("Failed to create video conv state, ret %d.", ret); + return GST_STATE_CHANGE_FAILURE; + } + pthread_mutex_lock(&conv->state_mutex); + assert(!conv->state); + conv->state = state; + pthread_mutex_unlock(&conv->state_mutex); + break; + + case GST_STATE_CHANGE_READY_TO_NULL: + /* Do runtime teardown. */ + pthread_mutex_lock(&conv->state_mutex); + video_conv_state_release(conv->state); + conv->state = NULL; + pthread_mutex_unlock(&conv->state_mutex); + break; + + default: + break; + } + + return GST_ELEMENT_CLASS(parent_class)->change_state(element, transition); + + /* XXX on ReadyToNull, sodium drops state _again_ here... why? */ +} + +static uint64_t video_conv_duration_ours_to_upstream(VideoConv *conv, uint64_t pos) +{ + struct video_conv_state *state = conv->state; + + if (state->upstream_duration != DURATION_NONE && state->our_duration != DURATION_NONE) + return pos * state->upstream_duration / state->our_duration; + else + return DURATION_NONE; +} + +static void video_conv_query_upstream_duration(VideoConv *conv) +{ + gint64 duration; + + if (gst_pad_peer_query_duration(conv->sink_pad, GST_FORMAT_BYTES, &duration)) + conv->state->upstream_duration = duration; + else + GST_ERROR_OBJECT(conv, "Failed to query upstream duration."); +} + +static bool video_conv_get_upstream_range(VideoConv *conv, uint64_t offset, uint32_t requested_size, + uint64_t *upstream_offset, uint64_t *upstream_requested_size) +{ + struct video_conv_state *state; + + if (!(state = video_conv_lock_state(conv))) + return false; + + if (state->upstream_duration == DURATION_NONE) + video_conv_query_upstream_duration(conv); + + *upstream_offset = video_conv_duration_ours_to_upstream(conv, offset); + *upstream_requested_size = video_conv_duration_ours_to_upstream(conv, requested_size); + + pthread_mutex_unlock(&conv->state_mutex); + + return true; +} + +static bool video_conv_hash_upstream_data(VideoConv *conv, struct payload_hash *hash) +{ + struct pad_reader *reader; + bool ret; + + memset(hash, 0, sizeof(*hash)); + + reader = pad_reader_create_with_stride(conv->sink_pad, HASH_STRIDE); + ret = murmur3_128(reader, pad_reader_read, HASH_SEED, hash); + pad_reader_release(reader); + + return ret; +} + +static int video_conv_dump_upstream_data(VideoConv *conv, struct payload_hash *hash) +{ + struct hashes_reader chunk_hashes_reader; + struct pad_reader *pad_reader = NULL; + GList *chunk_hashes = NULL; + uint8_t *buffer = NULL; + size_t read_size; + int ret; + + GST_DEBUG("Dumping upstream data, hash %s.", format_hash(hash)); + + if ((ret = dump_fozdb_open_video(true)) < 0) + { + GST_ERROR("Failed to open video dump fozdb, ret %d.", ret); + goto done; + } + + buffer = calloc(1, HASH_CHUNK_SIZE); + pad_reader = pad_reader_create(conv->sink_pad); + while ((ret = pad_reader_read(pad_reader, buffer, HASH_CHUNK_SIZE, &read_size)) == CONV_OK) + { + struct bytes_reader bytes_reader; + struct payload_hash *chunk_hash; + + bytes_reader_init(&bytes_reader, buffer, read_size); + chunk_hash = calloc(1, sizeof(*chunk_hash)); + murmur3_128(&bytes_reader, bytes_reader_read, HASH_SEED, chunk_hash); + chunk_hashes = g_list_append(chunk_hashes, chunk_hash); + + bytes_reader_init(&bytes_reader, buffer, read_size); + if ((ret = fozdb_write_entry(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_VIDEODATA, chunk_hash, + &bytes_reader, bytes_reader_read, true)) < 0) + { + GST_ERROR("Error writing video data to fozdb, ret %d.", ret); + goto done; + } + } + + if (ret != CONV_ERROR_DATA_END) + { + GST_ERROR("Failed to read data from pad reader, ret %d.", ret); + goto done; + } + + hashes_reader_init(&chunk_hashes_reader, chunk_hashes); + if ((ret = fozdb_write_entry(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_STREAM, hash, + &chunk_hashes_reader, hashes_reader_read, true)) < 0) + GST_ERROR("Error writing stream data to fozdb, ret %d.", ret); + +done: + if (chunk_hashes) + g_list_free_full(chunk_hashes, free); + if (pad_reader) + pad_reader_release(pad_reader); + if (buffer) + free(buffer); + return ret; +} + +static void video_conv_init_transcode(VideoConv *conv) +{ + struct video_conv_state *state = conv->state; + struct payload_hash hash; + int ret; + + if (state->has_transcoded) + return; + + pthread_mutex_lock(&dump_fozdb.mutex); + + dump_fozdb_discard_transcoded(); + + if (video_conv_hash_upstream_data(conv, &hash)) + { + GST_INFO("Got upstream data hash: %s.", format_hash(&hash)); + if (!video_conv_state_begin_transcode(state, &hash) + && (ret = video_conv_dump_upstream_data(conv, &hash)) < 0) + GST_ERROR("Failed to dump upstream data, ret %d.", ret); + } + else + { + GST_WARNING("Failed to hash upstream data."); + } + + pthread_mutex_unlock(&dump_fozdb.mutex); +} + +static gboolean video_conv_sink_event(GstPad *pad, GstObject *parent, GstEvent *event) +{ + VideoConv *conv = VIDEO_CONV(parent); + bool ret; + + GST_DEBUG_OBJECT(pad, "Got event %"GST_PTR_FORMAT".", event); + + if (event->type == GST_EVENT_CAPS) + { + struct video_conv_state *state; + uint32_t transcode_tag; + GstCaps *caps; + + /* push_event, below, can also grab state and cause a deadlock, so make sure it's + * unlocked before calling */ + if (!(state = video_conv_lock_state(conv))) + { + GST_ERROR("VideoConv not yet in READY state?"); + return false; + } + + if (!gst_pad_activate_mode(conv->sink_pad, GST_PAD_MODE_PULL, true)) + { + GST_ERROR("Failed to activate sink pad in pull mode."); + pthread_mutex_unlock(&conv->state_mutex); + return false; + } + + video_conv_init_transcode(conv); + transcode_tag = state->transcoded_tag; + + pthread_mutex_unlock(&conv->state_mutex); + + if (transcode_tag == VIDEO_CONV_FOZ_TAG_MKVDATA) + caps = gst_caps_from_string("video/x-matroska"); + else if (transcode_tag == VIDEO_CONV_FOZ_TAG_OGVDATA) + caps = gst_caps_from_string("application/ogg"); + else + return false; + + ret = push_event(conv->src_pad, gst_event_new_caps(caps)); + gst_caps_unref(caps); + return ret; + } + + return gst_pad_event_default(pad, parent, event); +} + +static GstFlowReturn video_conv_src_get_range(GstPad *pad, GstObject *parent, + guint64 offset, guint request_size, GstBuffer **buffer) +{ + GstBuffer *my_buffer, *upstream_buffer = NULL, *new_buffer = NULL; + uint64_t upstream_offset, upstream_request_size; + GstFlowReturn flow_ret = GST_FLOW_ERROR; + VideoConv *conv = VIDEO_CONV(parent); + struct video_conv_state *state; + size_t fill_size; + GstMapInfo map; + int ret; + + if (!video_conv_get_upstream_range(conv, offset, request_size, &upstream_offset, &upstream_request_size)) + return flow_ret; + + if (!(state = video_conv_lock_state(conv))) + return flow_ret; + + /* Read and ignore upstream bytes. */ + if ((flow_ret = gst_pad_pull_range(conv->sink_pad, upstream_offset, upstream_request_size, &upstream_buffer)) < 0) + { + GST_ERROR("Failed to pull upstream data from %"GST_PTR_FORMAT", offset %#"PRIx64", size %#"PRIx64", reason %s.", + conv->sink_pad, upstream_offset, upstream_request_size, gst_flow_get_name(flow_ret)); + goto done; + } + gst_buffer_unref(upstream_buffer); + + /* Allocate and map buffer. */ + my_buffer = *buffer; + if (!my_buffer) + { + /* XXX: can we use a buffer cache here? */ + if (!(new_buffer = gst_buffer_new_and_alloc(request_size))) + { + GST_ERROR("Failed to allocate buffer of %u bytes.", request_size); + goto done; + } + my_buffer = new_buffer; + } + if (!gst_buffer_map(my_buffer, &map, GST_MAP_READWRITE)) + { + GST_ERROR("Failed to map buffer <%"GST_PTR_FORMAT">.", my_buffer); + goto done; + } + + /* Fill buffer. */ + ret = video_conv_state_fill_buffer(state, offset, map.data, map.size, &fill_size); + gst_buffer_unmap(my_buffer, &map); + if (ret < 0) + { + GST_ERROR("Failed to fill buffer, ret %d.", ret); + goto done; + } + + if (fill_size > 0 || !gst_buffer_get_size(my_buffer)) + { + gst_buffer_set_size(my_buffer, fill_size); + *buffer = my_buffer; + flow_ret = GST_FLOW_OK; + } + else + { + flow_ret = GST_FLOW_EOS; + } + +done: + if (flow_ret < 0 && new_buffer) + gst_buffer_unref(new_buffer); + pthread_mutex_unlock(&conv->state_mutex); + return flow_ret; +} + +static gboolean video_conv_src_query(GstPad *pad, GstObject *parent, GstQuery *query) +{ + VideoConv *conv = VIDEO_CONV(parent); + struct video_conv_state *state; + GstSchedulingFlags flags; + gint min, max, align; + GstQuery *peer_query; + uint64_t duration; + GstFormat format; + + GST_DEBUG_OBJECT(pad, "Got query %"GST_PTR_FORMAT".", query); + + switch (query->type) + { + case GST_QUERY_SCHEDULING: + peer_query = gst_query_new_scheduling(); + if (!gst_pad_peer_query(conv->sink_pad, peer_query)) + { + GST_ERROR_OBJECT(conv->sink_pad, "Failed to query scheduling from peer."); + gst_query_unref(peer_query); + return false; + } + gst_query_parse_scheduling(peer_query, &flags, &min, &max, &align); + gst_query_unref(peer_query); + + gst_query_set_scheduling(query, flags, min, max, align); + gst_query_add_scheduling_mode(query, GST_PAD_MODE_PULL); + + return true; + + case GST_QUERY_DURATION: + gst_query_parse_duration(query, &format, NULL); + if (format != GST_FORMAT_BYTES) + { + GST_WARNING("Duration query format is not GST_FORMAT_BYTES."); + return false; + } + + if (!(state = video_conv_lock_state(conv))) + return false; + if (state->upstream_duration == DURATION_NONE) + video_conv_query_upstream_duration(conv); + duration = state->our_duration; + pthread_mutex_unlock(&conv->state_mutex); + + if (duration == DURATION_NONE) + return false; + gst_query_set_duration(query, GST_FORMAT_BYTES, duration); + return true; + + default: + return gst_pad_query_default(pad, parent, query); + } +} + +static gboolean video_conv_src_active_mode(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean active) +{ + VideoConv *conv = VIDEO_CONV(parent); + struct video_conv_state *state; + struct payload_hash hash; + bool need_stream_start; + bool has_transcoded; + + GST_DEBUG_OBJECT(pad, "mode %s, active %d.", gst_pad_mode_get_name(mode), active); + + if (!gst_pad_activate_mode(conv->sink_pad, mode, active)) + { + GST_ERROR_OBJECT(conv->sink_pad, "Failed to active sink pad: mode %s, active %d.", + gst_pad_mode_get_name(mode), active); + return false; + } + + if (mode != GST_PAD_MODE_PULL) + return true; + + if (!(state = video_conv_lock_state(conv))) + { + GST_ERROR("VideoConv not yet in READY state?"); + return false; + } + + video_conv_init_transcode(conv); + hash = state->transcode_hash; + need_stream_start = state->need_stream_start; + has_transcoded = state->has_transcoded; + + /* push_event, below, can also grab state and cause a deadlock, so make sure it's + * unlocked before calling */ + pthread_mutex_unlock(&conv->state_mutex); + + if (need_stream_start && active && has_transcoded) + { + push_event(conv->src_pad, gst_event_new_stream_start(format_hash(&hash))); + + if (!(state = video_conv_lock_state(conv))) + { + GST_ERROR("VideoConv not yet in READY state?"); + return false; + } + state->need_stream_start = false; + pthread_mutex_unlock(&conv->state_mutex); + } + + return true; +} + + +static void video_conv_finalize(GObject *object) +{ + VideoConv *conv = VIDEO_CONV(object); + + pthread_mutex_destroy(&conv->state_mutex); + if (conv->state) + video_conv_state_release(conv->state); + + G_OBJECT_CLASS(parent_class)->finalize(object); +} + +static void video_conv_class_init(VideoConvClass * klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS(klass); + GObjectClass *object_class = G_OBJECT_CLASS(klass); + + gst_element_class_set_metadata(element_class, + "Proton video converter", + "Codec/Demuxer", + "Converts video for Proton", + "Andrew Eikum , Ziqing Hui "); + + element_class->change_state = video_conv_change_state; + object_class->finalize = video_conv_finalize; + + gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&video_conv_sink_template)); + gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&video_conv_src_template)); +} + +static void video_conv_init(VideoConv *conv) +{ + GstElement *element = GST_ELEMENT(conv); + + conv->sink_pad = gst_pad_new_from_static_template(&video_conv_sink_template, "sink"); + gst_pad_set_event_function(conv->sink_pad, GST_DEBUG_FUNCPTR(video_conv_sink_event)); + gst_element_add_pad(element, conv->sink_pad); + + conv->src_pad = gst_pad_new_from_static_template(&video_conv_src_template, "src"); + gst_pad_set_getrange_function(conv->src_pad, GST_DEBUG_FUNCPTR(video_conv_src_get_range)); + gst_pad_set_query_function(conv->src_pad, GST_DEBUG_FUNCPTR(video_conv_src_query)); + gst_pad_set_activatemode_function(conv->src_pad, GST_DEBUG_FUNCPTR(video_conv_src_active_mode)); + gst_element_add_pad(element, conv->src_pad); + + pthread_mutex_init(&conv->state_mutex, NULL); + conv->state = NULL; +} diff --git a/dlls/winegstreamer/unixlib.c b/dlls/winegstreamer/unixlib.c index 729008e1f46e..644f700027d2 100644 --- a/dlls/winegstreamer/unixlib.c +++ b/dlls/winegstreamer/unixlib.c @@ -47,6 +47,8 @@ GST_DEBUG_CATEGORY(wine); +extern bool media_converter_init(void); + static UINT thread_count; GstStreamType stream_type_from_caps(GstCaps *caps) @@ -300,6 +302,13 @@ NTSTATUS wg_init_gstreamer(void *arg) GST_INFO("GStreamer library version %s; wine built with %d.%d.%d.", gst_version_string(), GST_VERSION_MAJOR, GST_VERSION_MINOR, GST_VERSION_MICRO); + + if (!media_converter_init()) + { + GST_ERROR("Failed to init media converter."); + return STATUS_UNSUCCESSFUL; + } + return STATUS_SUCCESS; } From 42b420cec9e4d6c93ab3c4a9dd785a85d9a6f7d4 Mon Sep 17 00:00:00 2001 From: Ziqing Hui Date: Thu, 23 May 2024 13:22:53 +0800 Subject: [PATCH 0190/2542] winegstreamer/media-converter: Continue creating state object even if env is not set. This make sure media-converter work with steam shader cache disabled. STEAM_COMPAT_MEDIA_PATH and STEAM_COMPAT_TRANSCODED_MEDIA_PATH won't be set with steam shader cache disabled, resuling in other media-converter envs missing. CW-Bug-Id: #23856 --- .../winegstreamer/media-converter/audioconv.c | 18 +++++++-------- .../winegstreamer/media-converter/videoconv.c | 22 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/dlls/winegstreamer/media-converter/audioconv.c b/dlls/winegstreamer/media-converter/audioconv.c index 71612cbfddd0..462cec16a8a6 100644 --- a/dlls/winegstreamer/media-converter/audioconv.c +++ b/dlls/winegstreamer/media-converter/audioconv.c @@ -682,15 +682,18 @@ static int audio_conv_state_create(struct audio_conv_state **out) char *read_fozdb_path; int ret; - if (!(read_fozdb_path = getenv("MEDIACONV_AUDIO_TRANSCODED_FILE"))) + if ((read_fozdb_path = getenv("MEDIACONV_AUDIO_TRANSCODED_FILE"))) + { + if ((ret = fozdb_create(read_fozdb_path, O_RDONLY, true /* Read-only? */, + AUDIO_CONV_FOZ_NUM_TAGS, &fozdb)) < 0) + GST_ERROR("Failed to create fozdb from %s, ret %d.", read_fozdb_path, ret); + } + else { GST_ERROR("Env MEDIACONV_AUDIO_TRANSCODED_FILE is not set!"); - return CONV_ERROR_ENV_NOT_SET; + ret = CONV_ERROR_ENV_NOT_SET; } - if ((ret = fozdb_create(read_fozdb_path, O_RDONLY, true /* Read-only? */, AUDIO_CONV_FOZ_NUM_TAGS, &fozdb)) < 0) - GST_ERROR("Failed to create fozdb from %s, ret %d.", read_fozdb_path, ret); - state = calloc(1, sizeof(*state)); murmur3_128_state_init(&state->hash_state, HASH_SEED); murmur3_128_state_init(&state->loop_hash_state, HASH_SEED); @@ -698,7 +701,7 @@ static int audio_conv_state_create(struct audio_conv_state **out) state->read_fozdb = fozdb; *out = state; - return CONV_OK; + return ret; } static void audio_conv_state_release(struct audio_conv_state *state) @@ -870,10 +873,7 @@ static GstStateChangeReturn audio_conv_change_state(GstElement *element, GstStat /* Create audio conv state. */ if ((ret = audio_conv_state_create(&state)) < 0) - { GST_ERROR("Failed to create audio conv state, ret %d.", ret); - return GST_STATE_CHANGE_FAILURE; - } pthread_mutex_lock(&conv->state_mutex); assert(!conv->state); conv->state = state; diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index b91aa96f1bf1..a73292a59eb8 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -334,14 +334,17 @@ static int video_conv_state_create(struct video_conv_state **out) char *read_fozdb_path; int ret; - if (!(read_fozdb_path = getenv("MEDIACONV_VIDEO_TRANSCODED_FILE"))) + if ((read_fozdb_path = getenv("MEDIACONV_VIDEO_TRANSCODED_FILE"))) { - GST_ERROR("MEDIACONV_VIDEO_TRANSCODED_FILE is not set."); - return CONV_ERROR_ENV_NOT_SET; + if ((ret = fozdb_create(read_fozdb_path, O_RDONLY, true /* Read-only? */, + VIDEO_CONV_FOZ_NUM_TAGS, &fozdb)) < 0) + GST_ERROR("Failed to create read fozdb from %s, ret %d.", read_fozdb_path, ret); + } + else + { + GST_ERROR("Env MEDIACONV_VIDEO_TRANSCODED_FILE is not set."); + ret = CONV_ERROR_ENV_NOT_SET; } - - if ((ret = fozdb_create(read_fozdb_path, O_RDONLY, true /* Read-only? */, VIDEO_CONV_FOZ_NUM_TAGS, &fozdb)) < 0) - GST_ERROR("Failed to create read fozdb from %s, ret %d.", read_fozdb_path, ret); state = calloc(1, sizeof(*state)); state->read_fozdb = fozdb; @@ -351,7 +354,7 @@ static int video_conv_state_create(struct video_conv_state **out) state->need_stream_start = true; *out = state; - return CONV_OK; + return ret; } static void video_conv_state_release(struct video_conv_state *state) @@ -486,7 +489,7 @@ static struct video_conv_state *video_conv_lock_state(VideoConv *conv) static GstStateChangeReturn video_conv_change_state(GstElement *element, GstStateChange transition) { VideoConv *conv = VIDEO_CONV(element); - struct video_conv_state *state; + struct video_conv_state *state = NULL; int ret; GST_INFO_OBJECT(element, "State transition: %s.", gst_state_change_get_name(transition)); @@ -496,10 +499,7 @@ static GstStateChangeReturn video_conv_change_state(GstElement *element, GstStat case GST_STATE_CHANGE_NULL_TO_READY: /* Do runtime setup. */ if ((ret = video_conv_state_create(&state)) < 0) - { GST_ERROR("Failed to create video conv state, ret %d.", ret); - return GST_STATE_CHANGE_FAILURE; - } pthread_mutex_lock(&conv->state_mutex); assert(!conv->state); conv->state = state; From 4365f425b91e7bce55a9375a9c9ab7d047a7e754 Mon Sep 17 00:00:00 2001 From: Ziqing Hui Date: Wed, 7 Aug 2024 09:05:43 +0800 Subject: [PATCH 0191/2542] winegstreamer/media-converter: Log error if failed to pull data from upstream. --- dlls/winegstreamer/media-converter/videoconv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index a73292a59eb8..2dd7446cedbc 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -312,7 +312,7 @@ int pad_reader_read(void *data_src, uint8_t *buffer, size_t size, size_t *read_s } else { - GST_WARNING("Failed to pull data from %"GST_PTR_FORMAT", reason %s.", + GST_ERROR("Failed to pull data from %"GST_PTR_FORMAT", reason %s.", reader->pad, gst_flow_get_name(gst_ret)); return CONV_ERROR; } @@ -657,7 +657,7 @@ static void video_conv_init_transcode(VideoConv *conv) } else { - GST_WARNING("Failed to hash upstream data."); + GST_ERROR("Failed to hash upstream data."); } pthread_mutex_unlock(&dump_fozdb.mutex); From 5828ad84759d46ec6004b6dc94bdcf31dc5bdb98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 5 Mar 2024 10:55:06 +0100 Subject: [PATCH 0192/2542] winegstreamer/media-converter: Split videoconv caps event handler to a separate helper. CW-Bug-Id: #22319 --- .../winegstreamer/media-converter/videoconv.c | 71 ++++++++++--------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index 2dd7446cedbc..9c82f0a9cbf8 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -663,50 +663,55 @@ static void video_conv_init_transcode(VideoConv *conv) pthread_mutex_unlock(&dump_fozdb.mutex); } -static gboolean video_conv_sink_event(GstPad *pad, GstObject *parent, GstEvent *event) +static gboolean video_conv_sink_event_caps(VideoConv *conv, GstEvent *event) { - VideoConv *conv = VIDEO_CONV(parent); + struct video_conv_state *state; + uint32_t transcode_tag; + GstCaps *caps; bool ret; - GST_DEBUG_OBJECT(pad, "Got event %"GST_PTR_FORMAT".", event); + gst_event_unref(event); - if (event->type == GST_EVENT_CAPS) + /* push_event, below, can also grab state and cause a deadlock, so make sure it's + * unlocked before calling */ + if (!(state = video_conv_lock_state(conv))) { - struct video_conv_state *state; - uint32_t transcode_tag; - GstCaps *caps; + GST_ERROR("VideoConv not yet in READY state?"); + return false; + } - /* push_event, below, can also grab state and cause a deadlock, so make sure it's - * unlocked before calling */ - if (!(state = video_conv_lock_state(conv))) - { - GST_ERROR("VideoConv not yet in READY state?"); - return false; - } + if (!gst_pad_activate_mode(conv->sink_pad, GST_PAD_MODE_PULL, true)) + { + GST_ERROR("Failed to activate sink pad in pull mode."); + pthread_mutex_unlock(&conv->state_mutex); + return false; + } - if (!gst_pad_activate_mode(conv->sink_pad, GST_PAD_MODE_PULL, true)) - { - GST_ERROR("Failed to activate sink pad in pull mode."); - pthread_mutex_unlock(&conv->state_mutex); - return false; - } + video_conv_init_transcode(conv); + transcode_tag = state->transcoded_tag; - video_conv_init_transcode(conv); - transcode_tag = state->transcoded_tag; + pthread_mutex_unlock(&conv->state_mutex); - pthread_mutex_unlock(&conv->state_mutex); + if (transcode_tag == VIDEO_CONV_FOZ_TAG_MKVDATA) + caps = gst_caps_from_string("video/x-matroska"); + else if (transcode_tag == VIDEO_CONV_FOZ_TAG_OGVDATA) + caps = gst_caps_from_string("application/ogg"); + else + return false; - if (transcode_tag == VIDEO_CONV_FOZ_TAG_MKVDATA) - caps = gst_caps_from_string("video/x-matroska"); - else if (transcode_tag == VIDEO_CONV_FOZ_TAG_OGVDATA) - caps = gst_caps_from_string("application/ogg"); - else - return false; + ret = push_event(conv->src_pad, gst_event_new_caps(caps)); + gst_caps_unref(caps); + return ret; +} - ret = push_event(conv->src_pad, gst_event_new_caps(caps)); - gst_caps_unref(caps); - return ret; - } +static gboolean video_conv_sink_event(GstPad *pad, GstObject *parent, GstEvent *event) +{ + VideoConv *conv = VIDEO_CONV(parent); + + GST_DEBUG_OBJECT(pad, "Got event %"GST_PTR_FORMAT".", event); + + if (event->type == GST_EVENT_CAPS) + return video_conv_sink_event_caps(conv, event); return gst_pad_event_default(pad, parent, event); } From 3478d88e1bd6d5cda1165e7ecc4c0dd322647cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 5 Mar 2024 11:04:31 +0100 Subject: [PATCH 0193/2542] winegstreamer/media-converter: Split videoconv upstream chunk dump to a separate helper. CW-Bug-Id: #22319 --- .../winegstreamer/media-converter/videoconv.c | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index 9c82f0a9cbf8..1d691a10ad2d 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -576,6 +576,22 @@ static bool video_conv_hash_upstream_data(VideoConv *conv, struct payload_hash * return ret; } +static int video_conv_dump_upstream_chunk(VideoConv *conv, void *buffer, size_t read_size, + GList **chunk_hashes) +{ + struct bytes_reader bytes_reader; + struct payload_hash *chunk_hash; + + bytes_reader_init(&bytes_reader, buffer, read_size); + chunk_hash = calloc(1, sizeof(*chunk_hash)); + murmur3_128(&bytes_reader, bytes_reader_read, HASH_SEED, chunk_hash); + *chunk_hashes = g_list_append(*chunk_hashes, chunk_hash); + + bytes_reader_init(&bytes_reader, buffer, read_size); + return fozdb_write_entry(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_VIDEODATA, chunk_hash, + &bytes_reader, bytes_reader_read, true); +} + static int video_conv_dump_upstream_data(VideoConv *conv, struct payload_hash *hash) { struct hashes_reader chunk_hashes_reader; @@ -597,17 +613,7 @@ static int video_conv_dump_upstream_data(VideoConv *conv, struct payload_hash *h pad_reader = pad_reader_create(conv->sink_pad); while ((ret = pad_reader_read(pad_reader, buffer, HASH_CHUNK_SIZE, &read_size)) == CONV_OK) { - struct bytes_reader bytes_reader; - struct payload_hash *chunk_hash; - - bytes_reader_init(&bytes_reader, buffer, read_size); - chunk_hash = calloc(1, sizeof(*chunk_hash)); - murmur3_128(&bytes_reader, bytes_reader_read, HASH_SEED, chunk_hash); - chunk_hashes = g_list_append(chunk_hashes, chunk_hash); - - bytes_reader_init(&bytes_reader, buffer, read_size); - if ((ret = fozdb_write_entry(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_VIDEODATA, chunk_hash, - &bytes_reader, bytes_reader_read, true)) < 0) + if ((ret = video_conv_dump_upstream_chunk(conv, buffer, read_size, &chunk_hashes)) < 0) { GST_ERROR("Error writing video data to fozdb, ret %d.", ret); goto done; From 1fb58b9be4938b6a58aa9c8cc9fddd6c23163bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 5 Mar 2024 11:52:12 +0100 Subject: [PATCH 0194/2542] winegstreamer/media-converter: Split videoconv stream-start event push to a separate helper. CW-Bug-Id: #22319 --- .../winegstreamer/media-converter/videoconv.c | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index 1d691a10ad2d..fd5a2dfab67a 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -669,6 +669,23 @@ static void video_conv_init_transcode(VideoConv *conv) pthread_mutex_unlock(&dump_fozdb.mutex); } +static gboolean video_conv_push_stream_start(VideoConv *conv, struct payload_hash *hash) +{ + struct video_conv_state *state; + + push_event(conv->src_pad, gst_event_new_stream_start(format_hash(hash))); + + if (!(state = video_conv_lock_state(conv))) + { + GST_ERROR("VideoConv not yet in READY state?"); + return false; + } + state->need_stream_start = false; + pthread_mutex_unlock(&conv->state_mutex); + + return true; +} + static gboolean video_conv_sink_event_caps(VideoConv *conv, GstEvent *event) { struct video_conv_state *state; @@ -885,18 +902,7 @@ static gboolean video_conv_src_active_mode(GstPad *pad, GstObject *parent, GstPa pthread_mutex_unlock(&conv->state_mutex); if (need_stream_start && active && has_transcoded) - { - push_event(conv->src_pad, gst_event_new_stream_start(format_hash(&hash))); - - if (!(state = video_conv_lock_state(conv))) - { - GST_ERROR("VideoConv not yet in READY state?"); - return false; - } - state->need_stream_start = false; - pthread_mutex_unlock(&conv->state_mutex); - } - + return video_conv_push_stream_start(conv, &hash); return true; } From 7ea0c77c5675cc4d3aeb3bfb33f9257ed89ac755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 5 Mar 2024 17:10:58 +0100 Subject: [PATCH 0195/2542] winegstreamer/media-converter: Split videoconv event caps push to a separate helper. CW-Bug-Id: #22319 --- .../winegstreamer/media-converter/videoconv.c | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index fd5a2dfab67a..e47e1822abeb 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -686,12 +686,27 @@ static gboolean video_conv_push_stream_start(VideoConv *conv, struct payload_has return true; } +static gboolean video_conv_push_caps(VideoConv *conv, uint32_t transcode_tag) +{ + GstCaps *caps; + gboolean ret; + + if (transcode_tag == VIDEO_CONV_FOZ_TAG_MKVDATA) + caps = gst_caps_from_string("video/x-matroska"); + else if (transcode_tag == VIDEO_CONV_FOZ_TAG_OGVDATA) + caps = gst_caps_from_string("application/ogg"); + else + return false; + + ret = push_event(conv->src_pad, gst_event_new_caps(caps)); + gst_caps_unref(caps); + return ret; +} + static gboolean video_conv_sink_event_caps(VideoConv *conv, GstEvent *event) { struct video_conv_state *state; uint32_t transcode_tag; - GstCaps *caps; - bool ret; gst_event_unref(event); @@ -715,16 +730,7 @@ static gboolean video_conv_sink_event_caps(VideoConv *conv, GstEvent *event) pthread_mutex_unlock(&conv->state_mutex); - if (transcode_tag == VIDEO_CONV_FOZ_TAG_MKVDATA) - caps = gst_caps_from_string("video/x-matroska"); - else if (transcode_tag == VIDEO_CONV_FOZ_TAG_OGVDATA) - caps = gst_caps_from_string("application/ogg"); - else - return false; - - ret = push_event(conv->src_pad, gst_event_new_caps(caps)); - gst_caps_unref(caps); - return ret; + return video_conv_push_caps(conv, transcode_tag); } static gboolean video_conv_sink_event(GstPad *pad, GstObject *parent, GstEvent *event) From 8571e0ea3367d266d9d27c2ad04869f77bd17bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 5 Mar 2024 10:54:28 +0100 Subject: [PATCH 0196/2542] winegstreamer/media-converter: Open the blank file on videoconv state creation. CW-Bug-Id: #22319 --- .../winegstreamer/media-converter/videoconv.c | 73 +++++++------------ 1 file changed, 26 insertions(+), 47 deletions(-) diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index e47e1822abeb..9a8ba4f73a7e 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -92,6 +92,7 @@ struct video_conv_state { struct payload_hash transcode_hash; struct fozdb *read_fozdb; + int blank_file; uint64_t upstream_duration; uint64_t our_duration; uint32_t transcoded_tag; @@ -331,8 +332,9 @@ static int video_conv_state_create(struct video_conv_state **out) { struct video_conv_state *state; struct fozdb *fozdb = NULL; - char *read_fozdb_path; - int ret; + char *read_fozdb_path, *blank_video; + uint64_t blank_file_size; + int ret, fd; if ((read_fozdb_path = getenv("MEDIACONV_VIDEO_TRANSCODED_FILE"))) { @@ -345,11 +347,25 @@ static int video_conv_state_create(struct video_conv_state **out) GST_ERROR("Env MEDIACONV_VIDEO_TRANSCODED_FILE is not set."); ret = CONV_ERROR_ENV_NOT_SET; } + if (!(blank_video = getenv("MEDIACONV_BLANK_VIDEO_FILE"))) + { + GST_ERROR("Env MEDIACONV_BLANK_VIDEO_FILE not set."); + return CONV_ERROR_ENV_NOT_SET; + } + + if (!open_file(blank_video, O_RDONLY, &fd)) + return CONV_ERROR_OPEN_FAILED; + if (!get_file_size(fd, &blank_file_size)) + { + close(fd); + return CONV_ERROR_OPEN_FAILED; + } state = calloc(1, sizeof(*state)); state->read_fozdb = fozdb; + state->blank_file = fd; state->upstream_duration = DURATION_NONE; - state->our_duration = DURATION_NONE; + state->our_duration = blank_file_size; state->transcoded_tag = VIDEO_CONV_FOZ_TAG_MKVDATA; state->need_stream_start = true; @@ -361,16 +377,13 @@ static void video_conv_state_release(struct video_conv_state *state) { if (state->read_fozdb) fozdb_release(state->read_fozdb); + close(state->blank_file); free(state); } /* Return true if the file is transcoded, false if not. */ bool video_conv_state_begin_transcode(struct video_conv_state *state, struct payload_hash *hash) { - const char *blank_video; - uint64_t file_size = 0; - int fd; - GST_DEBUG("state %p, hash %s.", state, format_hash(hash)); if (state->read_fozdb) @@ -399,18 +412,6 @@ bool video_conv_state_begin_transcode(struct video_conv_state *state, struct pay } GST_INFO("No transcoded video for %s. Substituting a blank video.", format_hash(hash)); - - if (!(blank_video = getenv("MEDIACONV_BLANK_VIDEO_FILE"))) - { - GST_ERROR("Env MEDIACONV_BLANK_VIDEO_FILE not set."); - return false; - } - if (open_file(blank_video, O_RDONLY, &fd)) - { - get_file_size(fd, &file_size); - close(fd); - } - state->our_duration = file_size; state->has_transcoded = false; create_placeholder_file("placeholder-video-used"); @@ -421,11 +422,9 @@ bool video_conv_state_begin_transcode(struct video_conv_state *state, struct pay int video_conv_state_fill_buffer(struct video_conv_state *state, uint64_t offset, uint8_t *buffer, size_t size, size_t *fill_size) { - const char *blank_video; - uint64_t file_size; size_t to_copy; bool read_ok; - int fd, ret; + int ret; if (state->has_transcoded) { @@ -436,38 +435,18 @@ int video_conv_state_fill_buffer(struct video_conv_state *state, uint64_t offset } else /* Fill blank video data to buffer. */ { - if (!(blank_video = getenv("MEDIACONV_BLANK_VIDEO_FILE"))) - { - GST_ERROR("Env MEDIACONV_BLANK_VIDEO_FILE not set."); - return CONV_ERROR_ENV_NOT_SET; - } - if (!open_file(blank_video, O_RDONLY, &fd)) - return CONV_ERROR_OPEN_FAILED; - if (!get_file_size(fd, &file_size)) - { - close(fd); - return CONV_ERROR; - } - /* Get copy size. */ - if (offset >= file_size) - { - close(fd); + if (offset >= state->our_duration) return CONV_OK; - } - to_copy = min(file_size - offset, size); + to_copy = min(state->our_duration - offset, size); /* Copy data. */ - if (lseek(fd, offset, SEEK_SET) < 0) + if (lseek(state->blank_file, offset, SEEK_SET) < 0) { - GST_ERROR("Failed to seek %s to %#"PRIx64". %s.", blank_video, offset, strerror(errno)); - close(fd); + GST_ERROR("Failed to seek to %#"PRIx64". %s.", offset, strerror(errno)); return CONV_ERROR; } - read_ok = complete_read(fd, buffer, to_copy); - close(fd); - - if (!read_ok) + if (!(read_ok = complete_read(state->blank_file, buffer, to_copy))) { GST_ERROR("Failed to read blank video data."); return CONV_ERROR_READ_FAILED; From 659a03a51b6b40a1cbb7aa49c7f4228eafe227c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 5 Mar 2024 10:54:28 +0100 Subject: [PATCH 0197/2542] winegstreamer/media-converter: Use an enum for video conv state flags. CW-Bug-Id: #22319 --- .../winegstreamer/media-converter/videoconv.c | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index 9a8ba4f73a7e..25cda8cc331a 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -88,6 +88,12 @@ struct hashes_reader GList *current_hash; }; +enum video_conv_state_flags +{ + VIDEO_CONV_STREAM_STARTED = 1, + VIDEO_CONV_HAS_TRANSCODED = 2, +}; + struct video_conv_state { struct payload_hash transcode_hash; @@ -96,7 +102,7 @@ struct video_conv_state uint64_t upstream_duration; uint64_t our_duration; uint32_t transcoded_tag; - bool has_transcoded, need_stream_start; + uint32_t state_flags; }; typedef struct @@ -367,7 +373,6 @@ static int video_conv_state_create(struct video_conv_state **out) state->upstream_duration = DURATION_NONE; state->our_duration = blank_file_size; state->transcoded_tag = VIDEO_CONV_FOZ_TAG_MKVDATA; - state->need_stream_start = true; *out = state; return ret; @@ -396,7 +401,7 @@ bool video_conv_state_begin_transcode(struct video_conv_state *state, struct pay state->transcode_hash = *hash; state->our_duration = entry_size; state->transcoded_tag = VIDEO_CONV_FOZ_TAG_MKVDATA; - state->has_transcoded = true; + state->state_flags |= VIDEO_CONV_HAS_TRANSCODED; return true; } @@ -406,13 +411,13 @@ bool video_conv_state_begin_transcode(struct video_conv_state *state, struct pay state->transcode_hash = *hash; state->our_duration = entry_size; state->transcoded_tag = VIDEO_CONV_FOZ_TAG_OGVDATA; - state->has_transcoded = true; + state->state_flags |= VIDEO_CONV_HAS_TRANSCODED; return true; } } GST_INFO("No transcoded video for %s. Substituting a blank video.", format_hash(hash)); - state->has_transcoded = false; + state->state_flags &= ~VIDEO_CONV_HAS_TRANSCODED; create_placeholder_file("placeholder-video-used"); @@ -426,7 +431,7 @@ int video_conv_state_fill_buffer(struct video_conv_state *state, uint64_t offset bool read_ok; int ret; - if (state->has_transcoded) + if (state->state_flags & VIDEO_CONV_HAS_TRANSCODED) { if ((ret = fozdb_read_entry_data(state->read_fozdb, state->transcoded_tag, &state->transcode_hash, offset, buffer, size, fill_size, false)) < 0) @@ -626,7 +631,7 @@ static void video_conv_init_transcode(VideoConv *conv) struct payload_hash hash; int ret; - if (state->has_transcoded) + if (state->state_flags & VIDEO_CONV_HAS_TRANSCODED) return; pthread_mutex_lock(&dump_fozdb.mutex); @@ -659,7 +664,7 @@ static gboolean video_conv_push_stream_start(VideoConv *conv, struct payload_has GST_ERROR("VideoConv not yet in READY state?"); return false; } - state->need_stream_start = false; + state->state_flags |= VIDEO_CONV_STREAM_STARTED; pthread_mutex_unlock(&conv->state_mutex); return true; @@ -856,8 +861,7 @@ static gboolean video_conv_src_active_mode(GstPad *pad, GstObject *parent, GstPa VideoConv *conv = VIDEO_CONV(parent); struct video_conv_state *state; struct payload_hash hash; - bool need_stream_start; - bool has_transcoded; + uint32_t state_flags; GST_DEBUG_OBJECT(pad, "mode %s, active %d.", gst_pad_mode_get_name(mode), active); @@ -879,14 +883,13 @@ static gboolean video_conv_src_active_mode(GstPad *pad, GstObject *parent, GstPa video_conv_init_transcode(conv); hash = state->transcode_hash; - need_stream_start = state->need_stream_start; - has_transcoded = state->has_transcoded; + state_flags = state->state_flags; /* push_event, below, can also grab state and cause a deadlock, so make sure it's * unlocked before calling */ pthread_mutex_unlock(&conv->state_mutex); - if (need_stream_start && active && has_transcoded) + if (active && !(state_flags & VIDEO_CONV_STREAM_STARTED) && (state_flags & VIDEO_CONV_HAS_TRANSCODED)) return video_conv_push_stream_start(conv, &hash); return true; } From f46c3f0b0b179f88aab17c1d5ca172b72d7e5873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 29 Mar 2024 15:17:07 +0100 Subject: [PATCH 0198/2542] winegstreamer/media-converter: Wrap around the blank video if shorter than upstream data. CW-Bug-Id: #22319 --- dlls/winegstreamer/media-converter/videoconv.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index 25cda8cc331a..8bb35ad41fe2 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -440,9 +440,7 @@ int video_conv_state_fill_buffer(struct video_conv_state *state, uint64_t offset } else /* Fill blank video data to buffer. */ { - /* Get copy size. */ - if (offset >= state->our_duration) - return CONV_OK; + offset = offset % state->our_duration; to_copy = min(state->our_duration - offset, size); /* Copy data. */ From ecb309b51fae74340dbf5ca12568ad4121966297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 29 Mar 2024 15:17:07 +0100 Subject: [PATCH 0199/2542] winegstreamer/media-converter: Use gst_util_uint64_scale_round to round upstream position. CW-Bug-Id: #22319 --- dlls/winegstreamer/media-converter/videoconv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index 8bb35ad41fe2..97c7e1d35f3d 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -510,7 +510,7 @@ static uint64_t video_conv_duration_ours_to_upstream(VideoConv *conv, uint64_t p struct video_conv_state *state = conv->state; if (state->upstream_duration != DURATION_NONE && state->our_duration != DURATION_NONE) - return pos * state->upstream_duration / state->our_duration; + return gst_util_uint64_scale_round(pos, state->upstream_duration, state->our_duration); else return DURATION_NONE; } From c6b239a1b8cac64c47cc2e23c8af06491c2696e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 29 Mar 2024 15:17:07 +0100 Subject: [PATCH 0200/2542] winegstreamer/media-converter: Implement support for push mode in videoconv. CW-Bug-Id: #22319 --- .../winegstreamer/media-converter/videoconv.c | 334 +++++++++++++++++- 1 file changed, 319 insertions(+), 15 deletions(-) diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index 97c7e1d35f3d..97bb098f311d 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -59,6 +59,7 @@ #endif #include "media-converter.h" +#include #include @@ -92,6 +93,7 @@ enum video_conv_state_flags { VIDEO_CONV_STREAM_STARTED = 1, VIDEO_CONV_HAS_TRANSCODED = 2, + VIDEO_CONV_IS_DUMPING = 4, }; struct video_conv_state @@ -103,6 +105,8 @@ struct video_conv_state uint64_t our_duration; uint32_t transcoded_tag; uint32_t state_flags; + uint64_t read_offset; + GList *chunk_hashes; }; typedef struct @@ -111,6 +115,8 @@ typedef struct GstPad *sink_pad, *src_pad; pthread_mutex_t state_mutex; struct video_conv_state *state; + GstPadMode active_mode; + GstAdapter *adapter; } VideoConv; typedef struct @@ -391,6 +397,8 @@ bool video_conv_state_begin_transcode(struct video_conv_state *state, struct pay { GST_DEBUG("state %p, hash %s.", state, format_hash(hash)); + state->transcode_hash = *hash; + if (state->read_fozdb) { uint32_t entry_size; @@ -398,7 +406,6 @@ bool video_conv_state_begin_transcode(struct video_conv_state *state, struct pay if (fozdb_entry_size(state->read_fozdb, VIDEO_CONV_FOZ_TAG_MKVDATA, hash, &entry_size) == CONV_OK) { GST_DEBUG("Found an MKV video for hash %s.", format_hash(hash)); - state->transcode_hash = *hash; state->our_duration = entry_size; state->transcoded_tag = VIDEO_CONV_FOZ_TAG_MKVDATA; state->state_flags |= VIDEO_CONV_HAS_TRANSCODED; @@ -408,7 +415,6 @@ bool video_conv_state_begin_transcode(struct video_conv_state *state, struct pay if (fozdb_entry_size(state->read_fozdb, VIDEO_CONV_FOZ_TAG_OGVDATA, hash, &entry_size) == CONV_OK) { GST_DEBUG("Found an OGV video for hash %s.", format_hash(hash)); - state->transcode_hash = *hash; state->our_duration = entry_size; state->transcoded_tag = VIDEO_CONV_FOZ_TAG_OGVDATA; state->state_flags |= VIDEO_CONV_HAS_TRANSCODED; @@ -544,21 +550,63 @@ static bool video_conv_get_upstream_range(VideoConv *conv, uint64_t offset, uint return true; } +static uint64_t video_conv_duration_ours_to_downstream(VideoConv *conv, uint64_t pos) +{ + struct video_conv_state *state = conv->state; + + if (state->upstream_duration != DURATION_NONE && state->our_duration != DURATION_NONE) + return gst_util_uint64_scale_round(pos, state->our_duration, state->upstream_duration); + else + return DURATION_NONE; +} + +static bool video_conv_get_downstream_range(VideoConv *conv, uint64_t offset, uint32_t end, + uint64_t *downstream_offset, uint64_t *downstream_end) +{ + struct video_conv_state *state; + + if (!(state = video_conv_lock_state(conv))) + return false; + + if (state->upstream_duration == DURATION_NONE) + video_conv_query_upstream_duration(conv); + + *downstream_offset = video_conv_duration_ours_to_downstream(conv, offset); + *downstream_end = video_conv_duration_ours_to_downstream(conv, end); + + pthread_mutex_unlock(&conv->state_mutex); + + return true; +} + static bool video_conv_hash_upstream_data(VideoConv *conv, struct payload_hash *hash) { - struct pad_reader *reader; - bool ret; + bool ret = false; memset(hash, 0, sizeof(*hash)); - reader = pad_reader_create_with_stride(conv->sink_pad, HASH_STRIDE); - ret = murmur3_128(reader, pad_reader_read, HASH_SEED, hash); - pad_reader_release(reader); + if (conv->active_mode == GST_PAD_MODE_PUSH && gst_adapter_available(conv->adapter) > 0) + { + struct bytes_reader bytes_reader; + gsize read_size = gst_adapter_available(conv->adapter); + const void *buffer = gst_adapter_map(conv->adapter, read_size); + bytes_reader_init(&bytes_reader, buffer, read_size); + ret = murmur3_128(&bytes_reader, bytes_reader_read, HASH_SEED, hash); + gst_adapter_unmap(conv->adapter); + gst_adapter_clear(conv->adapter); + } + else if (gst_pad_activate_mode(conv->sink_pad, GST_PAD_MODE_PULL, true)) + { + struct pad_reader *reader = pad_reader_create_with_stride(conv->sink_pad, HASH_STRIDE); + ret = murmur3_128(reader, pad_reader_read, HASH_SEED, hash); + pad_reader_release(reader); + conv->active_mode = GST_PAD_MODE_PULL; + } return ret; } -static int video_conv_dump_upstream_chunk(VideoConv *conv, void *buffer, size_t read_size, +static int video_conv_dump_upstream_chunk(VideoConv *conv, const void *buffer, size_t read_size, GList **chunk_hashes) { struct bytes_reader bytes_reader; @@ -591,6 +639,12 @@ static int video_conv_dump_upstream_data(VideoConv *conv, struct payload_hash *h goto done; } + if (conv->active_mode == GST_PAD_MODE_PUSH) + { + conv->state->state_flags |= VIDEO_CONV_IS_DUMPING; + return 0; + } + buffer = calloc(1, HASH_CHUNK_SIZE); pad_reader = pad_reader_create(conv->sink_pad); while ((ret = pad_reader_read(pad_reader, buffer, HASH_CHUNK_SIZE, &read_size)) == CONV_OK) @@ -648,7 +702,24 @@ static void video_conv_init_transcode(VideoConv *conv) GST_ERROR("Failed to hash upstream data."); } - pthread_mutex_unlock(&dump_fozdb.mutex); + if (!(state->state_flags & VIDEO_CONV_IS_DUMPING)) + pthread_mutex_unlock(&dump_fozdb.mutex); +} + +static uint32_t video_conv_get_state_flags(VideoConv *conv) +{ + struct video_conv_state *state; + uint32_t state_flags; + + if (!(state = video_conv_lock_state(conv))) + { + GST_ERROR("VideoConv not yet in READY state?"); + return 0; + } + state_flags = state->state_flags; + pthread_mutex_unlock(&conv->state_mutex); + + return state_flags; } static gboolean video_conv_push_stream_start(VideoConv *conv, struct payload_hash *hash) @@ -700,19 +771,81 @@ static gboolean video_conv_sink_event_caps(VideoConv *conv, GstEvent *event) return false; } - if (!gst_pad_activate_mode(conv->sink_pad, GST_PAD_MODE_PULL, true)) + video_conv_init_transcode(conv); + transcode_tag = state->transcoded_tag; + + pthread_mutex_unlock(&conv->state_mutex); + + return video_conv_push_caps(conv, transcode_tag); +} + +static gboolean video_conv_sink_event_eos(VideoConv *conv, GstEvent *event) +{ + struct video_conv_state *state; + struct payload_hash hash; + uint32_t transcode_tag; + uint32_t state_flags; + int ret; + + gst_event_unref(event); + + if (!(state = video_conv_lock_state(conv))) + return false; + + if (state->state_flags & VIDEO_CONV_IS_DUMPING) { - GST_ERROR("Failed to activate sink pad in pull mode."); + struct hashes_reader chunk_hashes_reader; + gsize read_bytes; + + if ((read_bytes = gst_adapter_available(conv->adapter))) + { + const void *buffer = gst_adapter_map(conv->adapter, read_bytes); + + if ((ret = video_conv_dump_upstream_chunk(conv, buffer, read_bytes, &state->chunk_hashes)) < 0) + GST_ERROR("Error writing stream data to fozdb, ret %d.", ret); + + gst_adapter_unmap(conv->adapter); + gst_adapter_clear(conv->adapter); + } + + hashes_reader_init(&chunk_hashes_reader, state->chunk_hashes); + if ((ret = fozdb_write_entry(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_STREAM, &state->transcode_hash, + &chunk_hashes_reader, hashes_reader_read, true)) < 0) + GST_ERROR("Error writing stream data to fozdb, ret %d.", ret); + + if (state->chunk_hashes) + g_list_free_full(state->chunk_hashes, free); + + pthread_mutex_unlock(&dump_fozdb.mutex); + state->state_flags &= ~VIDEO_CONV_IS_DUMPING; pthread_mutex_unlock(&conv->state_mutex); - return false; + + return gst_pad_push_event(conv->src_pad, gst_event_new_eos()); } video_conv_init_transcode(conv); + hash = state->transcode_hash; + state_flags = state->state_flags; transcode_tag = state->transcoded_tag; pthread_mutex_unlock(&conv->state_mutex); - return video_conv_push_caps(conv, transcode_tag); + if (!(state_flags & VIDEO_CONV_STREAM_STARTED)) + { + /* rewind and start a new stream for dumping or playback */ + if (!push_event(conv->sink_pad, gst_event_new_seek(1.0, GST_FORMAT_BYTES, GST_SEEK_FLAG_FLUSH, + GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_NONE, -1))) + return false; + if (!video_conv_push_stream_start(conv, &hash)) + return false; + if (!video_conv_push_caps(conv, transcode_tag)) + return false; + + /* return false to cancel upstream pads EOS event handling and avoid setting EOS flag */ + return false; + } + + return gst_pad_push_event(conv->src_pad, gst_event_new_eos()); } static gboolean video_conv_sink_event(GstPad *pad, GstObject *parent, GstEvent *event) @@ -723,8 +856,167 @@ static gboolean video_conv_sink_event(GstPad *pad, GstObject *parent, GstEvent * if (event->type == GST_EVENT_CAPS) return video_conv_sink_event_caps(conv, event); + if (event->type == GST_EVENT_EOS) + return video_conv_sink_event_eos(conv, event); + + if (video_conv_get_state_flags(conv) & VIDEO_CONV_STREAM_STARTED) + return gst_pad_event_default(pad, parent, event); + + gst_event_unref(event); + return true; +} + +static gboolean video_conv_src_event_seek(VideoConv *conv, GstEvent *event) +{ + guint seqnum = gst_event_get_seqnum(event); + guint64 upstream_offset, upstream_size; + GstSeekType offset_type, stop_type; + struct video_conv_state *state; + gint64 offset, stop; + GstSeekFlags flags; + GstFormat format; + gdouble rate; + + gst_event_parse_seek(event, &rate, &format, &flags, &offset_type, &offset, &stop_type, &stop); + gst_event_unref(event); + if (format != GST_FORMAT_BYTES) + return false; + + GST_TRACE("conv %p, rate %f, format %s, flags %#x, offset_type %u, cur %#" G_GINT64_MODIFIER "x, " + "stop_type %u, stop %#" G_GINT64_MODIFIER "x.", conv, rate, gst_format_get_name(format), + flags, offset_type, offset, stop_type, stop); + + if (!(state = video_conv_lock_state(conv))) + return GST_FLOW_ERROR; + if (state->state_flags & VIDEO_CONV_IS_DUMPING) + { + pthread_mutex_unlock(&conv->state_mutex); + return true; + } + pthread_mutex_unlock(&conv->state_mutex); + + if (!video_conv_get_upstream_range(conv, offset, HASH_CHUNK_SIZE, &upstream_offset, &upstream_size)) + return false; + + if ((event = gst_event_new_seek(1.0, GST_FORMAT_BYTES, GST_SEEK_FLAG_FLUSH, + GST_SEEK_TYPE_SET, upstream_offset, GST_SEEK_TYPE_NONE, -1))) + gst_event_set_seqnum(event, seqnum); + return push_event(conv->sink_pad, event); +} + +static gboolean video_conv_src_event(GstPad *pad, GstObject *parent, GstEvent *event) +{ + VideoConv *conv = VIDEO_CONV(parent); + + GST_DEBUG_OBJECT(pad, "Got event %"GST_PTR_FORMAT".", event); + + if (event->type == GST_EVENT_SEEK) + return video_conv_src_event_seek(conv, event); + + if (video_conv_get_state_flags(conv) & VIDEO_CONV_STREAM_STARTED) + return gst_pad_event_default(pad, parent, event); + + gst_event_unref(event); + return true; +} + +static void video_conv_dump_buffered_chunks(VideoConv *conv, gsize bytes_available) +{ + struct video_conv_state *state = conv->state; + int ret; + + while (bytes_available >= HASH_CHUNK_SIZE) + { + const void *buffer = gst_adapter_map(conv->adapter, HASH_CHUNK_SIZE); + if ((ret = video_conv_dump_upstream_chunk(conv, buffer, HASH_CHUNK_SIZE, &state->chunk_hashes)) < 0) + { + pthread_mutex_unlock(&dump_fozdb.mutex); + state->state_flags &= ~VIDEO_CONV_IS_DUMPING; + break; + } + + gst_adapter_unmap(conv->adapter); + gst_adapter_flush(conv->adapter, HASH_CHUNK_SIZE); + bytes_available -= HASH_CHUNK_SIZE; + } +} + +static GstFlowReturn video_conv_sink_chain(GstPad *pad, GstObject *parent, GstBuffer *buffer) +{ + gsize buffer_size = gst_buffer_get_size(buffer), buffer_offset = GST_BUFFER_OFFSET(buffer); + uint64_t downstream_offset, downstream_end, seek_offset = -1; + VideoConv *conv = VIDEO_CONV(parent); + struct video_conv_state *state; + GstBuffer *transcoded = NULL; + uint32_t state_flags; + int ret = 0; + + GST_DEBUG_OBJECT(pad, "Got buffer %"GST_PTR_FORMAT".", buffer); + + if (!(state = video_conv_lock_state(conv))) + return GST_FLOW_ERROR; + state_flags = state->state_flags; + + if ((state_flags & VIDEO_CONV_IS_DUMPING) || !(state_flags & VIDEO_CONV_STREAM_STARTED)) + { + gsize bytes_available = gst_adapter_available(conv->adapter) + buffer_size; + gst_adapter_push(conv->adapter, buffer); + + if (state_flags & VIDEO_CONV_IS_DUMPING) + video_conv_dump_buffered_chunks(conv, bytes_available); + else if (!(bytes_available % HASH_CHUNK_SIZE) && bytes_available >= HASH_STRIDE) + { + state->read_offset += HASH_STRIDE; + seek_offset = state->read_offset; + } + } + + pthread_mutex_unlock(&conv->state_mutex); + + if (ret < 0) + { + GST_ERROR("Failed to dump or read transcoded buffer, error %d.", ret); + if (transcoded) + gst_buffer_unref(transcoded); + return GST_FLOW_ERROR; + } + + if (seek_offset != -1 && !push_event(pad, gst_event_new_seek(1.0, GST_FORMAT_BYTES, GST_SEEK_FLAG_FLUSH, + GST_SEEK_TYPE_SET, seek_offset, GST_SEEK_TYPE_NONE, -1))) + return GST_FLOW_ERROR; + if (!(state_flags & VIDEO_CONV_STREAM_STARTED)) + return GST_FLOW_OK; - return gst_pad_event_default(pad, parent, event); + if (!video_conv_get_downstream_range(conv, buffer_offset, buffer_offset + buffer_size, + &downstream_offset, &downstream_end)) + return GST_FLOW_ERROR; + + if (downstream_end == downstream_offset) + return GST_FLOW_OK; + if (!(transcoded = gst_buffer_new_and_alloc(downstream_end - downstream_offset))) + return GST_FLOW_ERROR; + else + { + GstBufferMapInfo map; + size_t fill_size = 0; + + if (gst_buffer_map(transcoded, &map, GST_MAP_READWRITE)) + { + ret = video_conv_state_fill_buffer(state, downstream_offset, map.data, map.size, &fill_size); + gst_buffer_unmap(transcoded, &map); + gst_buffer_set_size(transcoded, fill_size); + } + + if (gst_buffer_get_size(transcoded)) + { + GST_BUFFER_OFFSET(transcoded) = downstream_offset; + return gst_pad_push(conv->src_pad, transcoded); + } + + gst_buffer_unref(transcoded); + } + + return GST_FLOW_OK; } static GstFlowReturn video_conv_src_get_range(GstPad *pad, GstObject *parent, @@ -825,7 +1117,13 @@ static gboolean video_conv_src_query(GstPad *pad, GstObject *parent, GstQuery *q gst_query_unref(peer_query); gst_query_set_scheduling(query, flags, min, max, align); - gst_query_add_scheduling_mode(query, GST_PAD_MODE_PULL); + if (conv->active_mode != GST_PAD_MODE_NONE) + gst_query_add_scheduling_mode(query, conv->active_mode); + else + { + gst_query_add_scheduling_mode(query, GST_PAD_MODE_PULL); + gst_query_add_scheduling_mode(query, GST_PAD_MODE_PUSH); + } return true; @@ -870,6 +1168,7 @@ static gboolean video_conv_src_active_mode(GstPad *pad, GstObject *parent, GstPa return false; } + conv->active_mode = mode; if (mode != GST_PAD_MODE_PULL) return true; @@ -897,6 +1196,7 @@ static void video_conv_finalize(GObject *object) { VideoConv *conv = VIDEO_CONV(object); + gst_object_unref(conv->adapter); pthread_mutex_destroy(&conv->state_mutex); if (conv->state) video_conv_state_release(conv->state); @@ -928,9 +1228,11 @@ static void video_conv_init(VideoConv *conv) conv->sink_pad = gst_pad_new_from_static_template(&video_conv_sink_template, "sink"); gst_pad_set_event_function(conv->sink_pad, GST_DEBUG_FUNCPTR(video_conv_sink_event)); + gst_pad_set_chain_function(conv->sink_pad, GST_DEBUG_FUNCPTR(video_conv_sink_chain)); gst_element_add_pad(element, conv->sink_pad); conv->src_pad = gst_pad_new_from_static_template(&video_conv_src_template, "src"); + gst_pad_set_event_function(conv->src_pad, GST_DEBUG_FUNCPTR(video_conv_src_event)); gst_pad_set_getrange_function(conv->src_pad, GST_DEBUG_FUNCPTR(video_conv_src_get_range)); gst_pad_set_query_function(conv->src_pad, GST_DEBUG_FUNCPTR(video_conv_src_query)); gst_pad_set_activatemode_function(conv->src_pad, GST_DEBUG_FUNCPTR(video_conv_src_active_mode)); @@ -938,4 +1240,6 @@ static void video_conv_init(VideoConv *conv) pthread_mutex_init(&conv->state_mutex, NULL); conv->state = NULL; + conv->adapter = gst_adapter_new(); + conv->active_mode = GST_PAD_MODE_NONE; } From 8181dd33d9ea7959e78ee3c179db8c3be5e0d62e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 5 Mar 2024 10:54:28 +0100 Subject: [PATCH 0201/2542] winegstreamer/media-converter: Wrap videoconv and a demuxer in a new protondemuxer bin. CW-Bug-Id: #22319 --- dlls/winegstreamer/Makefile.in | 1 + dlls/winegstreamer/media-converter/lib.c | 7 + .../media-converter/protondemuxer.c | 223 ++++++++++++++++++ .../winegstreamer/media-converter/videoconv.c | 2 +- 4 files changed, 232 insertions(+), 1 deletion(-) create mode 100644 dlls/winegstreamer/media-converter/protondemuxer.c diff --git a/dlls/winegstreamer/Makefile.in b/dlls/winegstreamer/Makefile.in index e2cc1123f10c..c623b90f8961 100644 --- a/dlls/winegstreamer/Makefile.in +++ b/dlls/winegstreamer/Makefile.in @@ -15,6 +15,7 @@ SOURCES = \ media-converter/fossilize.c \ media-converter/lib.c \ media-converter/murmur3.c \ + media-converter/protondemuxer.c \ media-converter/videoconv.c \ media_sink.c \ media_source.c \ diff --git a/dlls/winegstreamer/media-converter/lib.c b/dlls/winegstreamer/media-converter/lib.c index 852bf7b6bc48..97c5e0f0ec39 100644 --- a/dlls/winegstreamer/media-converter/lib.c +++ b/dlls/winegstreamer/media-converter/lib.c @@ -26,6 +26,7 @@ GST_ELEMENT_REGISTER_DECLARE(protonvideoconverter); GST_ELEMENT_REGISTER_DECLARE(protonaudioconverter); GST_ELEMENT_REGISTER_DECLARE(protonaudioconverterbin); +GST_ELEMENT_REGISTER_DECLARE(protondemuxer); GST_DEBUG_CATEGORY(media_converter_debug); @@ -325,5 +326,11 @@ bool media_converter_init(void) return false; } + if (!GST_ELEMENT_REGISTER(protondemuxer, NULL)) + { + GST_ERROR("Failed to register protondemuxer."); + return false; + } + return true; } diff --git a/dlls/winegstreamer/media-converter/protondemuxer.c b/dlls/winegstreamer/media-converter/protondemuxer.c new file mode 100644 index 000000000000..9ab4be5ae3c8 --- /dev/null +++ b/dlls/winegstreamer/media-converter/protondemuxer.c @@ -0,0 +1,223 @@ +/* + * Copyright 2024 Remi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "media-converter.h" + +GST_DEBUG_CATEGORY_EXTERN(media_converter_debug); +#undef GST_CAT_DEFAULT +#define GST_CAT_DEFAULT media_converter_debug + +typedef struct +{ + GstBin bin; + GstElement *video_conv, *demuxer; + GstPad *sink_pad; /* Ghost pad. */ + GstPad *inner_sink, *inner_src; +} ProtonDemuxer; + +typedef struct +{ + GstBinClass class; +} ProtonDemuxerClass; + +G_DEFINE_TYPE(ProtonDemuxer, proton_demuxer, GST_TYPE_BIN); +#define PROTON_DEMUXER_TYPE (proton_demuxer_get_type()) +#define PROTON_DEMUXER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PROTON_DEMUXER_TYPE, ProtonDemuxer)) +GST_ELEMENT_REGISTER_DEFINE(protondemuxer, "protondemuxer", GST_RANK_MARGINAL, PROTON_DEMUXER_TYPE); + +static GstStaticPadTemplate proton_demuxer_sink_template = GST_STATIC_PAD_TEMPLATE("sink", GST_PAD_SINK, + GST_PAD_ALWAYS, GST_STATIC_CAPS("video/x-ms-asf; video/x-msvideo; video/mpeg; video/quicktime;")); +static GstStaticPadTemplate proton_demuxer_src_template = GST_STATIC_PAD_TEMPLATE("src", GST_PAD_SRC, + GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY); + +static gboolean proton_demuxer_sink_event(GstPad *pad, GstObject *parent, GstEvent *event) +{ + GST_DEBUG_OBJECT(pad, "Got sink event %"GST_PTR_FORMAT".", event); + return gst_pad_event_default(pad, parent, event); +} + +static void proton_demuxer_pad_added(GstElement *element, GstPad *pad, gpointer user) +{ + ProtonDemuxer *bin = PROTON_DEMUXER(user); + GstPad *ghost_src; + GstEvent *event; + + GST_DEBUG_OBJECT(element, "Got inner pad added %"GST_PTR_FORMAT".", pad); + + ghost_src = gst_ghost_pad_new(GST_PAD_NAME(pad), pad); + gst_pad_set_active(ghost_src, true); + + if ((event = gst_pad_get_sticky_event(pad, GST_EVENT_STREAM_START, 0))) + { + gst_pad_store_sticky_event(ghost_src, event); + gst_event_unref(event); + } + + gst_element_add_pad(GST_ELEMENT(&bin->bin), ghost_src); +} + +static void proton_demuxer_no_more_pads(GstElement *element, gpointer user) +{ + ProtonDemuxer *bin = PROTON_DEMUXER(user); + GST_DEBUG_OBJECT(element, "Got inner no-more-pads."); + gst_element_no_more_pads(GST_ELEMENT(&bin->bin)); +} + +static GstFlowReturn proton_demuxer_inner_sink_chain(GstPad *pad, GstObject *parent, GstBuffer *buffer) +{ + ProtonDemuxer *bin = PROTON_DEMUXER(gst_pad_get_element_private(pad)); + GST_DEBUG_OBJECT(pad, "Got inner sink buffer %"GST_PTR_FORMAT".", buffer); + return gst_pad_push(bin->inner_src, buffer); +} + +static gboolean proton_demuxer_inner_sink_event_caps(ProtonDemuxer *bin, GstEvent *event) +{ + GstCaps *src_caps, *any_caps; + GstEvent *stream_start; + GstPad *src; + + gst_event_parse_caps(event, &src_caps); + + if (!bin->demuxer) + { + if (!(any_caps = gst_caps_new_any())) + return false; + if (!(bin->demuxer = find_element(GST_ELEMENT_FACTORY_TYPE_DECODABLE, src_caps, any_caps))) + { + gst_caps_unref(any_caps); + return false; + } + gst_caps_unref(any_caps); + g_signal_connect(bin->demuxer, "pad-added", G_CALLBACK(proton_demuxer_pad_added), bin); + g_signal_connect(bin->demuxer, "no-more-pads", G_CALLBACK(proton_demuxer_no_more_pads), bin); + + if ((src = gst_element_get_static_pad(bin->demuxer, "src"))) + { + GstPad *ghost_src = gst_ghost_pad_new_no_target_from_template(GST_PAD_NAME(src), + gst_element_get_pad_template(GST_ELEMENT(&bin->bin), "src")); + gst_ghost_pad_set_target(GST_GHOST_PAD(ghost_src), src); + gst_element_add_pad(GST_ELEMENT(&bin->bin), ghost_src); + gst_object_unref(src); + + gst_element_no_more_pads(GST_ELEMENT(&bin->bin)); + } + + gst_bin_add(GST_BIN(bin), bin->demuxer); + link_src_to_element(bin->inner_src, bin->demuxer); + gst_pad_set_active(bin->inner_src, true); + + if ((stream_start = gst_pad_get_sticky_event(bin->inner_sink, GST_EVENT_STREAM_START, 0))) + push_event(bin->inner_src, stream_start); + + gst_element_sync_state_with_parent(bin->demuxer); + } + + return gst_pad_push_event(bin->inner_src, event); +} + +static gboolean proton_demuxer_inner_sink_event(GstPad *pad, GstObject *parent, GstEvent *event) +{ + ProtonDemuxer *bin = PROTON_DEMUXER(gst_pad_get_element_private(pad)); + + GST_DEBUG_OBJECT(pad, "Got inner sink event %"GST_PTR_FORMAT".", event); + + if (event->type == GST_EVENT_CAPS) + return proton_demuxer_inner_sink_event_caps(bin, event); + if (!bin->demuxer) + return gst_pad_event_default(pad, parent, event); + if (event->type == GST_EVENT_STREAM_START) + { + GstEvent *stream_start; + if ((stream_start = gst_pad_get_sticky_event(bin->inner_src, GST_EVENT_STREAM_START, 0))) + push_event(bin->inner_src, stream_start); + return gst_pad_event_default(pad, parent, event); + } + + return gst_pad_push_event(bin->inner_src, event); +} + +static gboolean proton_demuxer_inner_src_query(GstPad *pad, GstObject *parent, GstQuery *query) +{ + ProtonDemuxer *bin = PROTON_DEMUXER(gst_pad_get_element_private(pad)); + + GST_DEBUG_OBJECT(pad, "Got inner src query %"GST_PTR_FORMAT".", query); + + if (!bin->demuxer) + return gst_pad_query_default(pad, parent, query); + return gst_pad_peer_query(bin->inner_sink, query); +} + +static gboolean proton_demuxer_inner_src_event(GstPad *pad, GstObject *parent, GstEvent *event) +{ + ProtonDemuxer *bin = PROTON_DEMUXER(gst_pad_get_element_private(pad)); + GST_DEBUG_OBJECT(pad, "Got inner src event %"GST_PTR_FORMAT".", event); + return gst_pad_push_event(bin->inner_sink, event); +} + +static void proton_demuxer_class_init(ProtonDemuxerClass * klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS(klass); + + /* wg_parser autoplugging ordering relies on the element "Proton video converter" name */ + gst_element_class_set_metadata(element_class, "Proton video converter", "Codec/Demuxer", "Demuxes video for Proton", + "Andrew Eikum , Ziqing Hui "); + + gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&proton_demuxer_sink_template)); + gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&proton_demuxer_src_template)); +} + +static void proton_demuxer_init(ProtonDemuxer *bin) +{ + GstStaticPadTemplate inner_sink_template = GST_STATIC_PAD_TEMPLATE("inner-sink", + GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY); + GstStaticPadTemplate inner_src_template = GST_STATIC_PAD_TEMPLATE("inner-src", + GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY); + GstElement *element = GST_ELEMENT(bin); + GstPad *sink; + + bin->sink_pad = gst_ghost_pad_new_no_target_from_template("sink", gst_element_get_pad_template(element, "sink")); + gst_pad_set_event_function(bin->sink_pad, GST_DEBUG_FUNCPTR(proton_demuxer_sink_event)); + + bin->inner_sink = gst_pad_new_from_static_template(&inner_sink_template, "inner-sink"); + gst_pad_set_chain_function(bin->inner_sink, GST_DEBUG_FUNCPTR(proton_demuxer_inner_sink_chain)); + gst_pad_set_event_function(bin->inner_sink, GST_DEBUG_FUNCPTR(proton_demuxer_inner_sink_event)); + gst_pad_set_element_private(bin->inner_sink, bin); + + bin->inner_src = gst_pad_new_from_static_template(&inner_src_template, "inner-src"); + gst_pad_set_query_function(bin->inner_src, GST_DEBUG_FUNCPTR(proton_demuxer_inner_src_query)); + gst_pad_set_event_function(bin->inner_src, GST_DEBUG_FUNCPTR(proton_demuxer_inner_src_event)); + gst_pad_set_element_private(bin->inner_src, bin); + + bin->video_conv = create_element("protonvideoconverter", "protonmediaconverter"); + gst_bin_add(GST_BIN(bin), bin->video_conv); + link_element_to_sink(bin->video_conv, bin->inner_sink); + gst_pad_set_active(bin->inner_sink, true); + + sink = gst_element_get_static_pad(bin->video_conv, "sink"); + gst_ghost_pad_set_target(GST_GHOST_PAD(bin->sink_pad), sink); + gst_object_unref(sink); + + gst_element_add_pad(element, bin->sink_pad); + + GST_INFO("Initialized ProtonDemuxer %"GST_PTR_FORMAT": video_conv %"GST_PTR_FORMAT", demuxer %"GST_PTR_FORMAT", " + "sink_pad %"GST_PTR_FORMAT".", bin, bin->video_conv, bin->demuxer, bin->sink_pad); +} diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index 97bb098f311d..cecac16c85a0 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -129,7 +129,7 @@ G_DEFINE_TYPE(VideoConv, video_conv, GST_TYPE_ELEMENT); #define VIDEO_CONV(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), VIDEO_CONV_TYPE, VideoConv)) #define parent_class (video_conv_parent_class) GST_ELEMENT_REGISTER_DEFINE(protonvideoconverter, "protonvideoconverter", - GST_RANK_MARGINAL, VIDEO_CONV_TYPE); + GST_RANK_MARGINAL + 1, VIDEO_CONV_TYPE); static GstStaticPadTemplate video_conv_sink_template = GST_STATIC_PAD_TEMPLATE("sink", GST_PAD_SINK, GST_PAD_ALWAYS, From 49cd1cda74626432b7b5e4b1df7eb6e30d7847e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 5 Mar 2024 22:23:44 +0100 Subject: [PATCH 0202/2542] winegstreamer/media-converter: Automatically add an audio decoder to protondemuxer. CW-Bug-Id: #22319 --- .../media-converter/protondemuxer.c | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/dlls/winegstreamer/media-converter/protondemuxer.c b/dlls/winegstreamer/media-converter/protondemuxer.c index 9ab4be5ae3c8..124d105ca460 100644 --- a/dlls/winegstreamer/media-converter/protondemuxer.c +++ b/dlls/winegstreamer/media-converter/protondemuxer.c @@ -58,13 +58,39 @@ static gboolean proton_demuxer_sink_event(GstPad *pad, GstObject *parent, GstEve static void proton_demuxer_pad_added(GstElement *element, GstPad *pad, gpointer user) { ProtonDemuxer *bin = PROTON_DEMUXER(user); - GstPad *ghost_src; + GstPad *ghost_src, *src_pad; + GstElement *decoder = NULL; GstEvent *event; + GstCaps *caps; GST_DEBUG_OBJECT(element, "Got inner pad added %"GST_PTR_FORMAT".", pad); - ghost_src = gst_ghost_pad_new(GST_PAD_NAME(pad), pad); - gst_pad_set_active(ghost_src, true); + if ((caps = gst_pad_get_current_caps(pad))) + { + const char *mime_type = gst_structure_get_name(gst_caps_get_structure(caps, 0)); + GST_DEBUG_OBJECT(element, "Got inner pad caps %"GST_PTR_FORMAT".", caps); + + if (!strcmp(mime_type, "audio/x-vorbis")) + decoder = create_element("vorbisdec", "base"); + else if (!strcmp(mime_type, "audio/x-opus")) + decoder = create_element("opusdec", "base"); + + gst_caps_unref(caps); + } + + if (!decoder) + ghost_src = gst_ghost_pad_new(GST_PAD_NAME(pad), pad); + else + { + gst_bin_add(GST_BIN(bin), decoder); + link_src_to_element(pad, decoder); + + src_pad = gst_element_get_static_pad(decoder, "src"); + ghost_src = gst_ghost_pad_new(GST_PAD_NAME(src_pad), src_pad); + gst_object_unref(src_pad); + + gst_element_sync_state_with_parent(decoder); + } if ((event = gst_pad_get_sticky_event(pad, GST_EVENT_STREAM_START, 0))) { @@ -72,6 +98,7 @@ static void proton_demuxer_pad_added(GstElement *element, GstPad *pad, gpointer gst_event_unref(event); } + gst_pad_set_active(ghost_src, true); gst_element_add_pad(GST_ELEMENT(&bin->bin), ghost_src); } From 5aa4a0af6d4b5f5ce72cc1d11e54c65b92ad3e28 Mon Sep 17 00:00:00 2001 From: Ziqing Hui Date: Mon, 29 Apr 2024 16:49:51 +0800 Subject: [PATCH 0203/2542] winegstreamer/media-converter: Expose untranscoded stream codec format. For transcoded videos, codec formats change. However, some games rely on the untranscoded codec format. So we have to expose the untranscoded codec formats for them. This also needs transcoded files holding untranscoded stream codec info. CW-Bug-Id: #21303 CW-Bug-Id: #22008 --- .../winegstreamer/media-converter/videoconv.c | 164 +++++++++++++++++- dlls/winegstreamer/unix_private.h | 5 + dlls/winegstreamer/unixlib.c | 2 - 3 files changed, 167 insertions(+), 4 deletions(-) diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index cecac16c85a0..51e78c39ec0d 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -70,7 +70,8 @@ #define VIDEO_CONV_FOZ_TAG_OGVDATA 1 #define VIDEO_CONV_FOZ_TAG_STREAM 2 #define VIDEO_CONV_FOZ_TAG_MKVDATA 3 -#define VIDEO_CONV_FOZ_NUM_TAGS 4 +#define VIDEO_CONV_FOZ_TAG_CODEC 4 +#define VIDEO_CONV_FOZ_NUM_TAGS 5 #define DURATION_NONE (UINT64_MAX) @@ -1191,7 +1192,6 @@ static gboolean video_conv_src_active_mode(GstPad *pad, GstObject *parent, GstPa return true; } - static void video_conv_finalize(GObject *object) { VideoConv *conv = VIDEO_CONV(object); @@ -1243,3 +1243,163 @@ static void video_conv_init(VideoConv *conv) conv->adapter = gst_adapter_new(); conv->active_mode = GST_PAD_MODE_NONE; } + +static bool codec_info_to_wg_format(char *codec_info, struct wg_format *codec_format) +{ + char *codec_name = codec_info; + + /* Get codec name. */ + while (*codec_info && *codec_info != ' ') + ++codec_info; + *(codec_info++) = 0; + + /* FIXME: Get width, height, fps etc. from codec info string. */ + if (strcmp(codec_name, "cinepak") == 0) + { + codec_format->major_type = WG_MAJOR_TYPE_VIDEO_CINEPAK; + } + else if (strcmp(codec_name, "h264") == 0) + { + codec_format->major_type = WG_MAJOR_TYPE_VIDEO_H264; + } + else if (strcmp(codec_name, "wmv1") == 0) + { + codec_format->major_type = WG_MAJOR_TYPE_VIDEO_WMV; + codec_format->u.video.format = WG_VIDEO_FORMAT_WMV1; + } + else if (strcmp(codec_name, "wmv2") == 0) + { + codec_format->major_type = WG_MAJOR_TYPE_VIDEO_WMV; + codec_format->u.video.format = WG_VIDEO_FORMAT_WMV2; + } + else if (strcmp(codec_name, "wmv3") == 0) + { + codec_format->major_type = WG_MAJOR_TYPE_VIDEO_WMV; + codec_format->u.video.format = WG_VIDEO_FORMAT_WMV3; + } + else if (strcmp(codec_name, "vc1") == 0) + { + codec_format->major_type = WG_MAJOR_TYPE_VIDEO_WMV; + codec_format->u.video.format = WG_VIDEO_FORMAT_WVC1; + } + else if (strcmp(codec_name, "wmav1") == 0) + { + codec_format->major_type = WG_MAJOR_TYPE_AUDIO_WMA; + codec_format->u.audio.version = 1; + } + else if (strcmp(codec_name, "wmav2") == 0) + { + codec_format->major_type = WG_MAJOR_TYPE_AUDIO_WMA; + codec_format->u.audio.version = 2; + } + else if (strcmp(codec_name, "wmapro") == 0) + { + codec_format->major_type = WG_MAJOR_TYPE_AUDIO_WMA; + codec_format->u.audio.version = 3; + } + else if (strcmp(codec_name, "wmalossless") == 0) + { + codec_format->major_type = WG_MAJOR_TYPE_AUDIO_WMA; + codec_format->u.audio.version = 4; + } + else if (strcmp(codec_name, "xma1") == 0) + { + codec_format->major_type = WG_MAJOR_TYPE_AUDIO_WMA; + codec_format->u.audio.version = 1; + codec_format->u.audio.is_xma = true; + } + else if (strcmp(codec_name, "xma2") == 0) + { + codec_format->major_type = WG_MAJOR_TYPE_AUDIO_WMA; + codec_format->u.audio.version = 2; + codec_format->u.audio.is_xma = true; + } + else + { + GST_FIXME("Unsupported codec name: %s.\n", codec_name); + return false; + } + + GST_INFO("Got codec format major type %u.", codec_format->major_type); + + return true; +} + +gint compare_type(const GValue *value_element, GType type) +{ + GstElement *element = g_value_get_object(value_element); + return !G_TYPE_CHECK_INSTANCE_TYPE(element, type); +} + +static GstElement *gst_bin_get_by_type(GstBin * bin, GType type) +{ + GstElement *element = NULL; + GstIterator *children; + GValue result = {0}; + gboolean found; + + children = gst_bin_iterate_recurse(bin); + found = gst_iterator_find_custom(children, (GCompareFunc)compare_type, + &result, (gpointer)type); + gst_iterator_free(children); + + if (found) + { + element = g_value_dup_object(&result); + g_value_unset (&result); + } + + return element; +} + +bool get_untranscoded_stream_format(GstElement *container, uint32_t stream_index, struct wg_format *codec_format) +{ + struct video_conv_state *state; + uint8_t *buffer = NULL; + uint32_t entry_size, i; + char *codec_info; + size_t read_size; + bool ret = false; + VideoConv *conv; + int conv_ret; + + if (!(conv = VIDEO_CONV(gst_bin_get_by_type(GST_BIN(container), VIDEO_CONV_TYPE)))) + { + GST_WARNING("Failed to find video converter from %"GST_PTR_FORMAT".", container); + return false; + } + + if (!(state = video_conv_lock_state(conv))) + return false; + if (!(state->state_flags & VIDEO_CONV_HAS_TRANSCODED)) + goto done; + + if (fozdb_entry_size(state->read_fozdb, VIDEO_CONV_FOZ_TAG_CODEC, &state->transcode_hash, &entry_size) < 0) + { + GST_WARNING("Failed to find codec info entry for stream %s.", format_hash(&state->transcode_hash)); + goto done; + } + + buffer = calloc(1, entry_size + 1); + if ((conv_ret = fozdb_read_entry_data(state->read_fozdb, VIDEO_CONV_FOZ_TAG_CODEC, &state->transcode_hash, 0, + buffer, entry_size, &read_size, false)) < 0) + { + GST_ERROR("Failed to read codec info, ret %d.", ret); + goto done; + } + + /* Get stream codec info line by line. */ + codec_info = strtok((char *)buffer, "\n"); + for (i = 0; codec_info && i < stream_index; ++i) + codec_info = strtok(NULL, "\n"); + + GST_INFO("Got codec info \"%s\" for stream %d.\n", codec_info, stream_index); + + ret = codec_info_to_wg_format(codec_info, codec_format); + +done: + if (buffer) + free(buffer); + pthread_mutex_unlock(&conv->state_mutex); + return ret; +} \ No newline at end of file diff --git a/dlls/winegstreamer/unix_private.h b/dlls/winegstreamer/unix_private.h index b2cc036c9148..4a887849577e 100644 --- a/dlls/winegstreamer/unix_private.h +++ b/dlls/winegstreamer/unix_private.h @@ -104,4 +104,9 @@ extern void wg_allocator_provide_sample(GstAllocator *allocator, struct wg_sampl extern void wg_allocator_release_sample(GstAllocator *allocator, struct wg_sample *sample, bool discard_data); +/* media-converter */ +extern bool media_converter_init(void); +extern bool get_untranscoded_stream_format(GstElement *container, uint32_t stream_index, + struct wg_format *codec_format); + #endif /* __WINE_WINEGSTREAMER_UNIX_PRIVATE_H */ diff --git a/dlls/winegstreamer/unixlib.c b/dlls/winegstreamer/unixlib.c index 644f700027d2..406c6f4f5f97 100644 --- a/dlls/winegstreamer/unixlib.c +++ b/dlls/winegstreamer/unixlib.c @@ -47,8 +47,6 @@ GST_DEBUG_CATEGORY(wine); -extern bool media_converter_init(void); - static UINT thread_count; GstStreamType stream_type_from_caps(GstCaps *caps) From bdebcca3b01f65ba5f3e61660e675c03a64a93c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 15 May 2024 21:12:06 +0200 Subject: [PATCH 0204/2542] winegstreamer/media-converter: Push segment event before data in push mode. CW-Bug-Id: #20833 --- .../winegstreamer/media-converter/videoconv.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index 51e78c39ec0d..c9ec31be422d 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -757,6 +757,23 @@ static gboolean video_conv_push_caps(VideoConv *conv, uint32_t transcode_tag) return ret; } +static gboolean video_conv_push_segment(VideoConv *conv) +{ + struct video_conv_state *state; + GstSegment segment; + + gst_segment_init(&segment, GST_FORMAT_BYTES); + if (!(state = video_conv_lock_state(conv))) + { + GST_ERROR("VideoConv not yet in READY state?"); + return false; + } + segment.stop = state->our_duration; + pthread_mutex_unlock(&conv->state_mutex); + + return push_event(conv->src_pad, gst_event_new_segment(&segment)); +} + static gboolean video_conv_sink_event_caps(VideoConv *conv, GstEvent *event) { struct video_conv_state *state; @@ -841,6 +858,8 @@ static gboolean video_conv_sink_event_eos(VideoConv *conv, GstEvent *event) return false; if (!video_conv_push_caps(conv, transcode_tag)) return false; + if (!video_conv_push_segment(conv)) + return false; /* return false to cancel upstream pads EOS event handling and avoid setting EOS flag */ return false; From 37b304e027e6561f71cf0615d32deaae97c6632b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 9 Jul 2024 15:22:33 +0200 Subject: [PATCH 0205/2542] winegstreamer/media-converter: Avoid leaking lock when dumping is interrupted. CW-Bug-Id: #20833 --- dlls/winegstreamer/media-converter/videoconv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index c9ec31be422d..d45e2d8be8a2 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -387,6 +387,8 @@ static int video_conv_state_create(struct video_conv_state **out) static void video_conv_state_release(struct video_conv_state *state) { + if ((state->state_flags & VIDEO_CONV_IS_DUMPING)) + pthread_mutex_unlock(&dump_fozdb.mutex); if (state->read_fozdb) fozdb_release(state->read_fozdb); close(state->blank_file); From 3fa6b13db39a154c3dbc1a12a96de39fe299b47c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 23 Nov 2023 00:45:55 +0100 Subject: [PATCH 0206/2542] HACK: winegstreamer: Use a different gst registry file per architecture --- dlls/winegstreamer/unixlib.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dlls/winegstreamer/unixlib.c b/dlls/winegstreamer/unixlib.c index 406c6f4f5f97..a0d7286cc32d 100644 --- a/dlls/winegstreamer/unixlib.c +++ b/dlls/winegstreamer/unixlib.c @@ -265,6 +265,7 @@ NTSTATUS wg_init_gstreamer(void *arg) char *args[] = {arg0, arg1, NULL}; int argc = ARRAY_SIZE(args) - 1; char **argv = args; + const char *e; GError *err; DWORD_PTR process_mask; @@ -283,6 +284,23 @@ NTSTATUS wg_init_gstreamer(void *arg) */ gst_segtrap_set_enabled(false); + if ((e = getenv("WINE_GST_REGISTRY_DIR"))) + { + char gst_reg[PATH_MAX]; +#if defined(__x86_64__) + const char *arch = "/registry.x86_64.bin"; +#elif defined(__i386__) + const char *arch = "/registry.i386.bin"; +#elif defined(__aarch64__) + const char *arch = "/registry.aarch64.bin"; +#else +#error Bad arch +#endif + strcpy(gst_reg, e); + strcat(gst_reg, arch); + setenv("GST_REGISTRY_1_0", gst_reg, 1); + } + if (!gst_init_check(&argc, &argv, &err)) { fprintf(stderr, "winegstreamer: failed to initialize GStreamer: %s\n", err->message); From 89c9406c8ee567d50726467a797866040be23f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 23 Nov 2023 00:53:28 +0100 Subject: [PATCH 0207/2542] HACK: winegstreamer/wg_parser: Enable protonvideoconv when decodebin fails. Squashed with: HACK: winegstreamer/wg_parser: Fail to plug elements when parser has an error. CW-Bug-Id: #20819 winegstreamer/wg_parser: Block protonvideoconvert autoplug when not trying for it. --- dlls/winegstreamer/wg_parser.c | 77 +++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 710cfe6a0a58..f7735aec373d 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -30,6 +30,7 @@ #include #include +#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_30 #include #include #include @@ -96,6 +97,8 @@ struct wg_parser gchar *sink_caps; struct input_cache_chunk input_cache_chunks[4]; + + bool use_mediaconv; }; static const unsigned int input_cache_chunk_size = 512 << 10; @@ -538,6 +541,8 @@ static GstAutoplugSelectResult autoplug_select_cb(GstElement *bin, GstPad *pad, GST_INFO("Using \"%s\".", name); + if (parser->error) + return GST_AUTOPLUG_SELECT_SKIP; if (strstr(name, "Player protection")) { GST_WARNING("Blacklisted a/52 decoder because it only works in Totem."); @@ -548,6 +553,11 @@ static GstAutoplugSelectResult autoplug_select_cb(GstElement *bin, GstPad *pad, GST_WARNING("Disabled video acceleration since it breaks in wine."); return GST_AUTOPLUG_SELECT_SKIP; } + if (!strcmp(name, "Proton video converter") && !parser->use_mediaconv) + { + GST_INFO("Skipping \"Proton video converter\"."); + return GST_AUTOPLUG_SELECT_SKIP; + } if (!parser->sink_caps && strstr(klass, GST_ELEMENT_FACTORY_KLASS_DEMUXER)) parser->sink_caps = g_strdup(gst_structure_get_name(gst_caps_get_structure(caps, 0))); @@ -555,6 +565,34 @@ static GstAutoplugSelectResult autoplug_select_cb(GstElement *bin, GstPad *pad, return GST_AUTOPLUG_SELECT_TRY; } +static gint find_videoconv_cb(gconstpointer a, gconstpointer b) +{ + const GValue *val_a = a, *val_b = b; + GstElementFactory *factory_a = g_value_get_object(val_a), *factory_b = g_value_get_object(val_b); + const char *name_a = gst_element_factory_get_longname(factory_a), *name_b = gst_element_factory_get_longname(factory_b); + + if (!strcmp(name_a, "Proton video converter")) + return -1; + if (!strcmp(name_b, "Proton video converter")) + return 1; + return 0; +} + +static GValueArray *autoplug_sort_cb(GstElement *bin, GstPad *pad, + GstCaps *caps, GValueArray *factories, gpointer user) +{ + struct wg_parser *parser = user; + GValueArray *ret = g_value_array_copy(factories); + + if (!parser->use_mediaconv) + return NULL; + + GST_DEBUG("parser %p.", parser); + + g_value_array_sort(ret, find_videoconv_cb); + return ret; +} + static void no_more_pads_cb(GstElement *element, gpointer user) { struct wg_parser *parser = user; @@ -1369,6 +1407,7 @@ static gboolean src_activate_mode_cb(GstPad *pad, GstObject *parent, GstPadMode static GstBusSyncReply bus_handler_cb(GstBus *bus, GstMessage *msg, gpointer user) { struct wg_parser *parser = user; + const GstStructure *structure; gchar *dbg_info = NULL; GError *err = NULL; @@ -1409,6 +1448,21 @@ static GstBusSyncReply bus_handler_cb(GstBus *bus, GstMessage *msg, gpointer use pthread_cond_signal(&parser->init_cond); break; + case GST_MESSAGE_ELEMENT: + structure = gst_message_get_structure(msg); + if (gst_structure_has_name(structure, "missing-plugin")) + { + pthread_mutex_lock(&parser->mutex); + if (!parser->use_mediaconv && !parser->output_compressed) + { + GST_WARNING("Autoplugged element failed to initialise, trying again with protonvideoconvert."); + parser->error = true; + pthread_cond_signal(&parser->init_cond); + } + pthread_mutex_unlock(&parser->mutex); + } + break; + default: break; } @@ -1574,6 +1628,8 @@ static NTSTATUS wg_parser_connect(void *args) unsigned int i; int ret; + bool use_mediaconv = false; + parser->file_size = params->file_size; parser->sink_connected = true; if (uri) @@ -1611,9 +1667,16 @@ static NTSTATUS wg_parser_connect(void *args) gst_element_set_state(parser->container, GST_STATE_PAUSED); ret = gst_element_get_state(parser->container, NULL, NULL, -1); + if (ret == GST_STATE_CHANGE_FAILURE) { - GST_ERROR("Failed to play stream."); + if (!parser->use_mediaconv && !parser->output_compressed) + { + GST_WARNING("Failed to play media, trying again with protonvideoconvert."); + use_mediaconv = true; + } + else + GST_ERROR("Failed to play stream."); goto out; } @@ -1623,6 +1686,8 @@ static NTSTATUS wg_parser_connect(void *args) pthread_cond_wait(&parser->init_cond, &parser->mutex); if (parser->error) { + if (!parser->use_mediaconv && !parser->output_compressed) + use_mediaconv = true; pthread_mutex_unlock(&parser->mutex); goto out; } @@ -1739,6 +1804,15 @@ static NTSTATUS wg_parser_connect(void *args) pthread_mutex_unlock(&parser->mutex); pthread_cond_signal(&parser->read_cond); + if (use_mediaconv) + { + HRESULT hr; + parser->use_mediaconv = true; + hr = wg_parser_connect(args); + parser->use_mediaconv = false; + return hr; + } + return E_FAIL; } @@ -1802,6 +1876,7 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) g_signal_connect(element, "pad-removed", G_CALLBACK(pad_removed_cb), parser); g_signal_connect(element, "autoplug-continue", G_CALLBACK(autoplug_continue_cb), parser); g_signal_connect(element, "autoplug-select", G_CALLBACK(autoplug_select_cb), parser); + g_signal_connect(element, "autoplug-sort", G_CALLBACK(autoplug_sort_cb), parser); g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads_cb), parser); g_signal_connect(element, "deep-element-added", G_CALLBACK(deep_element_added_cb), parser); From da52b13d085344fd9d21ba7526fb356c3eba8531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 22 Feb 2022 21:31:55 +0100 Subject: [PATCH 0208/2542] HACK: winegstreamer/wg_transform: Check if the decoder accepted our caps. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51931 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52391 CW-Bug-Id: #19854 CW-Bug-Id: #20966 CW-Bug-Id: #20833 --- dlls/winegstreamer/wg_transform.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index 558f6572a1bb..196180035fab 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -653,6 +653,20 @@ NTSTATUS wg_transform_create(void *args) || !push_event(transform->my_src, event)) goto out; + /* Check that the caps event have been accepted */ + if (!strcmp(input_mime, "video/x-h264")) + { + GstPad *peer; + if (!(peer = gst_pad_get_peer(transform->my_src))) + goto out; + else if (!gst_pad_has_current_caps(peer)) + { + gst_object_unref(peer); + goto out; + } + gst_object_unref(peer); + } + /* We need to use GST_FORMAT_TIME here because it's the only format * some elements such avdec_wmav2 correctly support. */ gst_segment_init(&transform->segment, GST_FORMAT_TIME); From 720cad5fac4679bcdfd8ef0300664947c22599d3 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Thu, 3 Nov 2022 18:54:06 +0200 Subject: [PATCH 0209/2542] HACK: winegstreamer: Detect h264 use and create a tag file. CW-Bug-Id: #21473 CW-Bug-Id: #20833 --- dlls/winegstreamer/unix_private.h | 35 +++++++++++++++++++++++++++++++ dlls/winegstreamer/wg_parser.c | 15 +++++++++++++ dlls/winegstreamer/wg_transform.c | 3 +++ 3 files changed, 53 insertions(+) diff --git a/dlls/winegstreamer/unix_private.h b/dlls/winegstreamer/unix_private.h index 4a887849577e..a0f1d3ddafda 100644 --- a/dlls/winegstreamer/unix_private.h +++ b/dlls/winegstreamer/unix_private.h @@ -27,6 +27,11 @@ #include #include +#include +#include +#include +#include + /* unixlib.c */ GST_DEBUG_CATEGORY_EXTERN(wine); @@ -109,4 +114,34 @@ extern bool media_converter_init(void); extern bool get_untranscoded_stream_format(GstElement *container, uint32_t stream_index, struct wg_format *codec_format); +static inline void touch_h264_used_tag(void) +{ + const char *e; + + GST_LOG("h264 is used"); + + if ((e = getenv("STEAM_COMPAT_TRANSCODED_MEDIA_PATH"))) + { + char buffer[PATH_MAX]; + int fd; + + snprintf(buffer, sizeof(buffer), "%s/h264-used", e); + + fd = open(buffer, O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); + if (fd == -1) + { + GST_WARNING("Failed to open/create \"%s/h264-used\"", e); + return; + } + + futimens(fd, NULL); + + close(fd); + } + else + { + GST_WARNING("STEAM_COMPAT_TRANSCODED_MEDIA_PATH not set, cannot create h264-used file"); + } +} + #endif /* __WINE_WINEGSTREAMER_UNIX_PRIVATE_H */ diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index f7735aec373d..3c28c4926f81 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -532,6 +532,19 @@ static gboolean autoplug_continue_cb(GstElement * decodebin, GstPad *pad, GstCap return !caps_is_compressed(caps); } +gboolean caps_detect_h264(GstCapsFeatures *features, GstStructure *structure, gpointer user_data) +{ + const char *cap_name = gst_structure_get_name(structure); + + if (!strcmp(cap_name, "video/x-h264")) + { + touch_h264_used_tag(); + return FALSE; + } + + return TRUE; +} + static GstAutoplugSelectResult autoplug_select_cb(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *fact, gpointer user) { @@ -541,6 +554,8 @@ static GstAutoplugSelectResult autoplug_select_cb(GstElement *bin, GstPad *pad, GST_INFO("Using \"%s\".", name); + gst_caps_foreach(caps, caps_detect_h264, NULL); + if (parser->error) return GST_AUTOPLUG_SELECT_SKIP; if (strstr(name, "Player protection")) diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index 196180035fab..61fdae40d11e 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -592,6 +592,9 @@ NTSTATUS wg_transform_create(void *args) GST_INFO("transform %p input caps %"GST_PTR_FORMAT, transform, transform->input_caps); input_mime = gst_structure_get_name(gst_caps_get_structure(transform->input_caps, 0)); + if (!strcmp(input_mime, "video/x-h264")) + touch_h264_used_tag(); + if (!(transform->output_caps = caps_from_media_type(¶ms->output_type))) goto out; GST_INFO("transform %p output caps %"GST_PTR_FORMAT, transform, transform->output_caps); From 790f525d9b7092426e478927d731c70b1f2e32e7 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 10 Aug 2022 19:11:51 +0200 Subject: [PATCH 0210/2542] HACK: winegstreamer/wg_parser: Use capssetter to ignore non-default YUV color spaces. --- dlls/winegstreamer/wg_parser.c | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 3c28c4926f81..130a3e5669d8 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -923,6 +923,49 @@ static bool stream_create_post_processing_elements(GstPad *pad, struct wg_parser if (!strcmp(name, "video/x-raw")) { + /* Hack?: Flatten down the colorimetry to default values, without + * actually modifying the video at all. + * + * We want to do color matrix conversions when converting from YUV to + * RGB or vice versa. We do *not* want to do color matrix conversions + * when converting YUV <-> YUV or RGB <-> RGB, because these are slow + * (it essentially means always using the slow path, never going through + * liborc). However, we have two videoconvert elements, and it's + * basically impossible to know what conversions each is going to do + * until caps are negotiated (without depending on some implementation + * details, and even then it'snot exactly trivial). And setting + * matrix-mode after caps are negotiated has no effect. + * + * Nor can we just retain colorimetry information the way we retain + * other caps values, because videoconvert automatically clears it if + * not doing passthrough. I think that this would only happen if we have + * to do a double conversion, but that is possible. Not likely, but I + * don't want to have to be the one to find out that there's still a + * game broken. + * + * [Note that we'd actually kind of like to retain colorimetry + * information, just in case it does ever become relevant to pass that + * on to the next DirectShow filter. Hence I think the correct solution + * for upstream is to get videoconvert to Not Do That.] + * + * So as a fallback solution, we force an identity transformation of + * the caps to those with a "default" color matrix—i.e. transform the + * caps, but not the data. We do this by *pre*pending a capssetter to + * the front of the chain, and we remove the matrix-mode setting for the + * videoconvert elements. + */ + if (!(element = create_element("capssetter", "good")) + || !append_element(parser->container, element, &first, &last)) + return false; + gst_util_set_object_arg(G_OBJECT(element), "join", "true"); + /* Actually, this is invalid, but it causes videoconvert to use default + * colorimetry as a result. Yes, this is depending on undocumented + * implementation details. It's a hack. + * + * Sadly there doesn't seem to be a way to get capssetter to clear + * certain fields while leaving others untouched. */ + gst_util_set_object_arg(G_OBJECT(element), "caps", "video/x-raw,colorimetry=0:0:0:0"); + /* DirectShow can express interlaced video, but downstream filters can't * necessarily consume it. In particular, the video renderer can't. */ if (!(element = create_element("deinterlace", "good")) From 64c78f4438d3226595844b1500fc6ce196d54f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 12 May 2023 12:20:17 +0200 Subject: [PATCH 0211/2542] HACK: winegstreamer/wg_parser: Unlink sink pad when freeing streams. As a hack as it is should not be necessary, but, sometimes it looks like the reference leaks. CW-Bug-Id: #22045 --- dlls/winegstreamer/wg_parser.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 130a3e5669d8..09bf94a3c738 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -888,8 +888,14 @@ static struct wg_parser_stream *create_stream(struct wg_parser *parser) static void free_stream(struct wg_parser_stream *stream) { + GstPad *peer; unsigned int i; + if ((peer = gst_pad_get_peer(stream->my_sink))) + { + gst_pad_unlink(peer, stream->my_sink); + gst_object_unref(peer); + } gst_object_unref(stream->my_sink); if (stream->buffer) From e3f03cba8cbbf55010365b976dd528f2cb75465c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 15 Jun 2022 19:12:54 +0200 Subject: [PATCH 0212/2542] HACK: winegstreamer/wg_parser: Set unlimited decodebin buffered size. Fixes problems with Persona 4 while keeping the memory usage lower. CW-Bug-Id: #18799 CW-Bug-Id: #18994 CW-Bug-Id: #20182 CW-Bug-Id: #20363 CW-Bug-Id: #20905 CW-Bug-Id: #20980 --- dlls/winegstreamer/wg_parser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 09bf94a3c738..b4c8dba0c136 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -1936,6 +1936,7 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) gst_bin_add(GST_BIN(parser->container), element); parser->decodebin = element; + g_object_set(element, "max-size-bytes", G_MAXUINT, NULL); g_signal_connect(element, "pad-added", G_CALLBACK(pad_added_cb), parser); g_signal_connect(element, "pad-removed", G_CALLBACK(pad_removed_cb), parser); g_signal_connect(element, "autoplug-continue", G_CALLBACK(autoplug_continue_cb), parser); From 4df93391b0ee6e6630bd5e402cd75d02df4606ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 16 May 2023 12:41:04 +0200 Subject: [PATCH 0213/2542] winegstreamer/wg_parser: Request live latency with WINE_ENABLE_GST_LIVE_LATENCY=1. Effectively greatly reducing the memory overhead from avdec_h264, which otherwise starts one decoding thread per frame. CW-Bug-Id: #22045 --- dlls/winegstreamer/wg_parser.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index b4c8dba0c136..93e3da291c0a 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -1367,6 +1367,13 @@ static gboolean src_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) } return FALSE; + case GST_QUERY_LATENCY: + { + const char *live = getenv("WINE_ENABLE_GST_LIVE_LATENCY"); + gst_query_set_latency(query, live && !strcmp(live, "1"), 0, 0); + return TRUE; + } + default: GST_WARNING("Unhandled query type %s.", GST_QUERY_TYPE_NAME(query)); return FALSE; From 8037ee85e724b792f2f15dae43fa34388a36bf40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 16 May 2023 12:53:46 +0200 Subject: [PATCH 0214/2542] HACK: ntdll: Enable WINE_ENABLE_GST_LIVE_LATENCY for some games. CW-Bug-Id: #22045 CW-Bug-Id: #22090 --- dlls/ntdll/unix/loader.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 8720a74c11e2..0be3596ddd2b 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2022,6 +2022,15 @@ static void hacks_init(void) setenv( "WINESTEAMNOEXEC", "1", 0 ); break; } + + if (sgi && (0 + || !strcmp(sgi, "1364780") || !strcmp(sgi, "1952120") || !strcmp(sgi, "2154900") /* Street Fighter 6 */ + || !strcmp(sgi, "1740720") /* Have a Nice Death */ + )) + { + ERR("HACK: setting WINE_ENABLE_GST_LIVE_LATENCY.\n"); + setenv("WINE_ENABLE_GST_LIVE_LATENCY", "1", 0); + } } /*********************************************************************** From 04a5ef18c39405aef030d7d335f1b3680079f4df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 2 Aug 2022 10:50:35 +0200 Subject: [PATCH 0215/2542] HACK: winegstreamer/wma_decoder: Allow WMA decoder DMO to pass-through buffers. CW-Bug-Id: #18799 CW-Bug-Id: #18994 CW-Bug-Id: #20182 CW-Bug-Id: #20905 CW-Bug-Id: #20833 --- dlls/winegstreamer/wma_decoder.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c index 6c1e5ed2ea8d..352d2c6a8e70 100644 --- a/dlls/winegstreamer/wma_decoder.c +++ b/dlls/winegstreamer/wma_decoder.c @@ -30,7 +30,6 @@ #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(wmadec); -WINE_DECLARE_DEBUG_CHANNEL(winediag); extern const GUID MFAudioFormat_XMAudio2; @@ -712,7 +711,6 @@ static HRESULT WINAPI media_object_SetInputType(IMediaObject *iface, DWORD index const DMO_MEDIA_TYPE *type, DWORD flags) { struct wma_decoder *decoder = impl_from_IMediaObject(iface); - unsigned int i; TRACE("iface %p, index %lu, type %p, flags %#lx.\n", iface, index, type, flags); @@ -740,12 +738,6 @@ static HRESULT WINAPI media_object_SetInputType(IMediaObject *iface, DWORD index if (!IsEqualGUID(&type->majortype, &MEDIATYPE_Audio)) return DMO_E_TYPE_NOT_ACCEPTED; - for (i = 0; i < ARRAY_SIZE(wma_decoder_input_types); ++i) - if (IsEqualGUID(&type->subtype, wma_decoder_input_types[i])) - break; - if (i == ARRAY_SIZE(wma_decoder_input_types)) - return DMO_E_TYPE_NOT_ACCEPTED; - if (flags & DMO_SET_TYPEF_TEST_ONLY) return S_OK; @@ -1057,27 +1049,11 @@ static const IPropertyBagVtbl property_bag_vtbl = HRESULT wma_decoder_create(IUnknown *outer, IUnknown **out) { - static const WAVEFORMATEX output_format = - { - .wFormatTag = WAVE_FORMAT_IEEE_FLOAT, .wBitsPerSample = 32, .nSamplesPerSec = 44100, .nChannels = 1, - }; - static const WMAUDIO2WAVEFORMAT input_format = - { - .wfx = {.wFormatTag = WAVE_FORMAT_WMAUDIO2, .wBitsPerSample = 16, .nSamplesPerSec = 44100, .nChannels = 1, - .nAvgBytesPerSec = 3000, .nBlockAlign = 139, .cbSize = sizeof(input_format) - sizeof(WAVEFORMATEX)}, - .wEncodeOptions = 1, - }; struct wma_decoder *decoder; HRESULT hr; TRACE("outer %p, out %p.\n", outer, out); - if (FAILED(hr = check_audio_transform_support(&input_format.wfx, &output_format))) - { - ERR_(winediag)("GStreamer doesn't support WMA decoding, please install appropriate plugins.\n"); - return hr; - } - if (!(decoder = calloc(1, sizeof(*decoder)))) return E_OUTOFMEMORY; From e50e41c57aa16533080c59cea77d41c9ca3bdbfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 21 Nov 2023 14:11:01 +0100 Subject: [PATCH 0216/2542] HACK: winegstreamer/wmv_decoder: Implement WMVDecMediaObject pass-through DMO. CW-Bug-Id: #18799 CW-Bug-Id: #18994 CW-Bug-Id: #20182 CW-Bug-Id: #20833 --- dlls/winegstreamer/video_decoder.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/dlls/winegstreamer/video_decoder.c b/dlls/winegstreamer/video_decoder.c index 83fb713d5da5..f8d5bee25e25 100644 --- a/dlls/winegstreamer/video_decoder.c +++ b/dlls/winegstreamer/video_decoder.c @@ -1137,7 +1137,6 @@ static HRESULT WINAPI media_object_SetInputType(IMediaObject *iface, DWORD index { struct video_decoder *decoder = impl_from_IMediaObject(iface); IMFMediaType *media_type; - unsigned int i; TRACE("iface %p, index %lu, type %p, flags %#lx.\n", iface, index, type, flags); @@ -1163,12 +1162,6 @@ static HRESULT WINAPI media_object_SetInputType(IMediaObject *iface, DWORD index if (!IsEqualGUID(&type->majortype, &MEDIATYPE_Video)) return DMO_E_TYPE_NOT_ACCEPTED; - for (i = 0; i < decoder->input_type_count; ++i) - if (IsEqualGUID(&type->subtype, get_dmo_subtype(decoder->input_types[i]))) - break; - if (i == decoder->input_type_count) - return DMO_E_TYPE_NOT_ACCEPTED; - if (FAILED(MFCreateMediaTypeFromRepresentation(AM_MEDIA_TYPE_REPRESENTATION, (void *)type, &media_type))) return DMO_E_TYPE_NOT_ACCEPTED; @@ -1722,29 +1715,11 @@ static const GUID *const wmv_decoder_output_types[] = HRESULT wmv_decoder_create(IUnknown *outer, IUnknown **out) { - const MFVIDEOFORMAT output_format = - { - .dwSize = sizeof(MFVIDEOFORMAT), - .videoInfo = {.dwWidth = 1920, .dwHeight = 1080}, - .guidFormat = MFVideoFormat_I420, - }; - const MFVIDEOFORMAT input_format = - { - .dwSize = sizeof(MFVIDEOFORMAT), - .videoInfo = {.dwWidth = 1920, .dwHeight = 1080}, - .guidFormat = MFVideoFormat_WMV3, - }; struct video_decoder *decoder; HRESULT hr; TRACE("outer %p, out %p.\n", outer, out); - if (FAILED(hr = check_video_transform_support(&input_format, &output_format))) - { - ERR_(winediag)("GStreamer doesn't support WMV decoding, please install appropriate plugins\n"); - return hr; - } - if (FAILED(hr = video_decoder_create_with_types(wmv_decoder_input_types, ARRAY_SIZE(wmv_decoder_input_types), wmv_decoder_output_types, ARRAY_SIZE(wmv_decoder_output_types), outer, &decoder))) return hr; From 0ead1ac80f89678fc0a9751ff9f4f51a2d18e4e9 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Fri, 4 Feb 2022 16:44:54 -0600 Subject: [PATCH 0217/2542] HACK: winegstreamer/wm_reader: Report BGRx for Persona 4 Golden. --- dlls/winegstreamer/wm_reader.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index ce79aa04cd7d..dac5c0064c40 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -1531,6 +1531,18 @@ static HRESULT init_stream(struct wm_reader *reader) /* API consumers expect RGB video to be bottom-up. */ if (stream->format.u.video.height > 0) stream->format.u.video.height = -stream->format.u.video.height; + + { + /* HACK: Persona 4 Golden tries to read compressed samples, and + * then autoplug them via quartz to a filter that only accepts + * BGRx. This is not trivial to implement. Return BGRx from the + * wmvcore reader for now. */ + + const char *id = getenv("SteamGameId"); + + if (id && !strcmp(id, "1113000")) + stream->format.u.video.format = WG_VIDEO_FORMAT_BGRx; + } } wg_parser_stream_enable(stream->wg_stream, &stream->format); } From e00f170e80aa1d6779890d45f880d448ff528449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 16 Jun 2022 16:50:42 +0200 Subject: [PATCH 0218/2542] HACK: winegstreamer/wm_reader: Expose BGRA video format from wm_reader. For Deadly Premonition. CW-Bug-Id: #18799 --- dlls/winegstreamer/wm_reader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index dac5c0064c40..e1495289fb0e 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -1664,6 +1664,7 @@ static const enum wg_video_format video_formats[] = WG_VIDEO_FORMAT_YUY2, WG_VIDEO_FORMAT_UYVY, WG_VIDEO_FORMAT_YVYU, + WG_VIDEO_FORMAT_BGRA, WG_VIDEO_FORMAT_BGRx, WG_VIDEO_FORMAT_BGR, WG_VIDEO_FORMAT_RGB16, From 6680378b75408281fdd60cb3fbaf3c1b5746286b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 21 Nov 2023 13:47:07 +0100 Subject: [PATCH 0219/2542] HACK: qasf/asfreader: Name the output pin as out0 for KoFXIII. King of Fighters XIII requests them by name, to connect them to the Samplegrabber filter. CW-Bug-Id: #20244 CW-Bug-Id: #23966 --- dlls/qasf/asfreader.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/qasf/asfreader.c b/dlls/qasf/asfreader.c index 91fdc6fbb348..39e9db15e371 100644 --- a/dlls/qasf/asfreader.c +++ b/dlls/qasf/asfreader.c @@ -789,11 +789,20 @@ static HRESULT WINAPI reader_callback_OnStatus(IWMReaderCallback *iface, WMT_STA for (i = 0; i < stream_count; ++i) { struct asf_stream *stream = filter->streams + i; + const char *sgi = getenv("SteamGameId"); if (FAILED(hr = asf_stream_get_media_type(&stream->source.pin, 0, &stream_media_type))) WARN("Failed to get stream media type, hr %#lx.\n", hr); if (IsEqualGUID(&stream_media_type.majortype, &MEDIATYPE_Video)) - swprintf(name, ARRAY_SIZE(name), L"Raw Video %u", stream->index); + { + /* King of Fighters XIII requests the WMV decoder filter pins by name + * to connect them to a Sample Grabber filter. + */ + if (sgi && !strcmp(sgi, "222940")) + swprintf(name, ARRAY_SIZE(name), L"out0"); + else + swprintf(name, ARRAY_SIZE(name), L"Raw Video %u", stream->index); + } else swprintf(name, ARRAY_SIZE(name), L"Raw Audio %u", stream->index); FreeMediaType(&stream_media_type); From 673427381813b4fe957714e11de8551d9c44f1e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 11 Mar 2022 00:26:59 +0100 Subject: [PATCH 0220/2542] HACK: quartz: Return the reader on WMVideo Decoder DMO lookup. King of Fighters XIII requests it by name, and expects it to be present to connect it to a Samplegrabber filter. CW-Bug-Id: #20244 CW-Bug-Id: #23966 --- dlls/quartz/filtergraph.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 987821f3fb15..b5a506c563a5 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -522,6 +522,13 @@ static IBaseFilter *find_filter_by_name(struct filter_graph *graph, const WCHAR { struct filter *filter; + /* King of Fighters XIII requests the WMV decoder filter by name to + * connect it to a Sample Grabber filter, return our custom decoder + * filter instance instead. + */ + if (!wcscmp(name, L"WMVideo Decoder DMO")) + name = L"Reader"; + LIST_FOR_EACH_ENTRY(filter, &graph->filters, struct filter, entry) { if (!wcscmp(filter->name, name)) From 6d2c347225b00d6bfd5bac36ec6c472fbd95e613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 2 Aug 2022 11:26:20 +0200 Subject: [PATCH 0221/2542] winegstreamer/wg_transform: Allow more input buffer to be queued for uncompressed formats. CW-Bug-Id: #18799 CW-Bug-Id: #18994 CW-Bug-Id: #20182 CW-Bug-Id: #20905 --- dlls/winegstreamer/wg_transform.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index 61fdae40d11e..d1d35197f81f 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -478,7 +478,10 @@ static bool transform_create_decoder_elements(struct wg_transform *transform, bool ret = false; if (!strcmp(input_mime, "audio/x-raw") || !strcmp(input_mime, "video/x-raw")) + { + transform->attrs.input_queue_length = 16; return true; + } if (!(parsed_caps = transform_get_parsed_caps(transform->input_caps, input_mime))) return false; From a516d6f4235f01ceb0f35c3fabca6b5a60874f57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sun, 17 Nov 2024 20:50:13 +0100 Subject: [PATCH 0222/2542] HACK: winegstreamer/h264_decoder: Do not report live latency for some games. CW-Bug-Id: #22581 --- dlls/winegstreamer/video_decoder.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/winegstreamer/video_decoder.c b/dlls/winegstreamer/video_decoder.c index f8d5bee25e25..3efd36c85c02 100644 --- a/dlls/winegstreamer/video_decoder.c +++ b/dlls/winegstreamer/video_decoder.c @@ -272,6 +272,12 @@ static HRESULT try_create_wg_transform(struct video_decoder *decoder, IMFMediaTy if (SUCCEEDED(IMFAttributes_GetUINT32(decoder->attributes, &MF_LOW_LATENCY, &low_latency))) decoder->wg_transform_attrs.low_latency = !!low_latency; + { + const char *sgi; + if ((sgi = getenv("SteamGameId")) && (!strcmp(sgi, "2009100") || !strcmp(sgi, "2555360") || !strcmp(sgi, "1630110"))) + decoder->wg_transform_attrs.low_latency = FALSE; + } + return wg_transform_create_mf(decoder->input_type, output_type, &decoder->wg_transform_attrs, &decoder->wg_transform); } From 6b2ac9c45723b04638881bfa06f140983900c32e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sun, 17 Nov 2024 20:53:02 +0100 Subject: [PATCH 0223/2542] HACK: winegstreamer/h264_decoder: Disable MF_SA_D3D11_AWARE for some games. CW-Bug-Id: #22581 --- dlls/winegstreamer/video_decoder.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/winegstreamer/video_decoder.c b/dlls/winegstreamer/video_decoder.c index 3efd36c85c02..efedff5e983b 100644 --- a/dlls/winegstreamer/video_decoder.c +++ b/dlls/winegstreamer/video_decoder.c @@ -1563,6 +1563,12 @@ static HRESULT video_decoder_create_with_types(const GUID *const *input_types, U &MFT_DECODER_EXPOSE_OUTPUT_TYPES_IN_NATIVE_ORDER, FALSE))) goto failed; + { + const char *sgi; + if ((sgi = getenv("SteamGameId")) && ((!strcmp(sgi, "2009100")) || (!strcmp(sgi, "2555360")))) + IMFAttributes_SetUINT32(decoder->attributes, &MF_SA_D3D11_AWARE, FALSE); + } + if (FAILED(hr = MFCreateAttributes(&decoder->output_attributes, 0))) goto failed; if (FAILED(hr = wg_sample_queue_create(&decoder->wg_sample_queue))) From ad48bd69657c355b5b2f02fd48de79b3b5864075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 8 Dec 2023 15:42:32 +0100 Subject: [PATCH 0224/2542] mf/evr: Increase the number of prerolled samples to 3. Native seems to only preroll 2 samples, but it still stutters a bit in Secret of Mana without at least 3 buffers. This is probably caused by a different sample decoding pattern, and 3 buffers in flight should be fine. CW-Bug-Id: #21713 --- dlls/mf/evr.c | 15 ++++++++++++--- dlls/mf/session.c | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c index eb366ea599af..f09cf43f8bf4 100644 --- a/dlls/mf/evr.c +++ b/dlls/mf/evr.c @@ -64,6 +64,7 @@ struct video_stream LONG refcount; unsigned int id; unsigned int flags; + unsigned int preroll_count; struct video_renderer *parent; IMFMediaEventQueue *event_queue; IMFVideoSampleAllocator *allocator; @@ -426,9 +427,16 @@ static HRESULT WINAPI video_stream_sink_ProcessSample(IMFStreamSink *iface, IMFS if (stream->flags & EVR_STREAM_PREROLLING) { - IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEStreamSinkPrerolled, &GUID_NULL, S_OK, NULL); - stream->flags &= ~EVR_STREAM_PREROLLING; - stream->flags |= EVR_STREAM_PREROLLED; + if (stream->preroll_count--) + IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEStreamSinkRequestSample, + &GUID_NULL, S_OK, NULL); + else + { + IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEStreamSinkPrerolled, + &GUID_NULL, S_OK, NULL); + stream->flags &= ~EVR_STREAM_PREROLLING; + stream->flags |= EVR_STREAM_PREROLLED; + } } } @@ -1534,6 +1542,7 @@ static HRESULT WINAPI video_renderer_preroll_NotifyPreroll(IMFMediaSinkPreroll * IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEStreamSinkRequestSample, &GUID_NULL, S_OK, NULL); stream->flags |= EVR_STREAM_PREROLLING; + stream->preroll_count = 3; } LeaveCriticalSection(&stream->cs); } diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 483ea6f904f7..b42975818000 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -1879,7 +1879,7 @@ static HRESULT session_append_node(struct media_session *session, IMFTopologyNod &IID_IMFVideoSampleAllocator, (void **)&topo_node->u.sink.allocator))) { if (FAILED(hr = IMFVideoSampleAllocator_InitializeSampleAllocator(topo_node->u.sink.allocator, - 2, media_type))) + 4, media_type))) { WARN("Failed to initialize sample allocator for the stream, hr %#lx.\n", hr); } From 19283c037ac652831baffba011ad2173c26f31fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 27 Jan 2022 13:21:24 +0100 Subject: [PATCH 0225/2542] strmbase: Add stub IPropertyBag interface for strmbase_filter. Required for Final Fantasy XIV intro video. CW-Bug-Id: #19624 --- include/wine/strmbase.h | 1 + libs/strmbase/filter.c | 48 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 978d1c671602..ae025e78ecfc 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -142,6 +142,7 @@ void strmbase_sink_cleanup(struct strmbase_sink *pin); struct strmbase_filter { IBaseFilter IBaseFilter_iface; + IPropertyBag IPropertyBag_iface; IUnknown IUnknown_inner; IUnknown *outer_unk; LONG refcount; diff --git a/libs/strmbase/filter.c b/libs/strmbase/filter.c index 3229c7ba82a6..244899b41cca 100644 --- a/libs/strmbase/filter.c +++ b/libs/strmbase/filter.c @@ -226,6 +226,8 @@ static HRESULT WINAPI filter_inner_QueryInterface(IUnknown *iface, REFIID iid, v { *out = &filter->IBaseFilter_iface; } + else if (IsEqualIID(iid, &IID_IPropertyBag)) + *out = &filter->IPropertyBag_iface; else { WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); @@ -509,6 +511,51 @@ static const IBaseFilterVtbl filter_vtbl = filter_QueryVendorInfo, }; +static inline struct strmbase_filter *impl_from_IPropertyBag(IPropertyBag *iface) +{ + return CONTAINING_RECORD(iface, struct strmbase_filter, IPropertyBag_iface); +} + +static HRESULT WINAPI property_bag_QueryInterface(IPropertyBag *iface, REFIID iid, void **out) +{ + struct strmbase_filter *filter = impl_from_IPropertyBag(iface); + return IUnknown_QueryInterface(filter->outer_unk, iid, out); +} + +static ULONG WINAPI property_bag_AddRef(IPropertyBag *iface) +{ + struct strmbase_filter *filter = impl_from_IPropertyBag(iface); + return IUnknown_AddRef(filter->outer_unk); +} + +static ULONG WINAPI property_bag_Release(IPropertyBag *iface) +{ + struct strmbase_filter *filter = impl_from_IPropertyBag(iface); + return IUnknown_Release(filter->outer_unk); +} + +static HRESULT WINAPI property_bag_Read(IPropertyBag *iface, const WCHAR *prop_name, VARIANT *value, + IErrorLog *error_log) +{ + FIXME("iface %p, prop_name %s, value %p, error_log %p stub!\n", iface, debugstr_w(prop_name), value, error_log); + return E_NOTIMPL; +} + +static HRESULT WINAPI property_bag_Write(IPropertyBag *iface, const WCHAR *prop_name, VARIANT *value) +{ + FIXME("iface %p, prop_name %s, value %p stub!\n", iface, debugstr_w(prop_name), value); + return E_NOTIMPL; +} + +static const IPropertyBagVtbl property_bag_vtbl = +{ + property_bag_QueryInterface, + property_bag_AddRef, + property_bag_Release, + property_bag_Read, + property_bag_Write, +}; + VOID WINAPI BaseFilterImpl_IncrementPinVersion(struct strmbase_filter *filter) { InterlockedIncrement(&filter->pin_version); @@ -520,6 +567,7 @@ void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer, memset(filter, 0, sizeof(*filter)); filter->IBaseFilter_iface.lpVtbl = &filter_vtbl; + filter->IPropertyBag_iface.lpVtbl = &property_bag_vtbl; filter->IUnknown_inner.lpVtbl = &filter_inner_vtbl; filter->outer_unk = outer ? outer : &filter->IUnknown_inner; filter->refcount = 1; From 16cbafe7592d778c279505af1b618bf263efab5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 27 Jan 2022 13:24:44 +0100 Subject: [PATCH 0226/2542] strmbase: Return S_OK from strmbase_filter IPropertyBag_Write. Required for Final Fantasy XIV intro video. CW-Bug-Id: #19624 --- libs/strmbase/filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/strmbase/filter.c b/libs/strmbase/filter.c index 244899b41cca..91e459c18ada 100644 --- a/libs/strmbase/filter.c +++ b/libs/strmbase/filter.c @@ -544,7 +544,7 @@ static HRESULT WINAPI property_bag_Read(IPropertyBag *iface, const WCHAR *prop_n static HRESULT WINAPI property_bag_Write(IPropertyBag *iface, const WCHAR *prop_name, VARIANT *value) { FIXME("iface %p, prop_name %s, value %p stub!\n", iface, debugstr_w(prop_name), value); - return E_NOTIMPL; + return S_OK; } static const IPropertyBagVtbl property_bag_vtbl = From bb3068a898d49f1752b12fac24e1327ca70b572b Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Thu, 27 May 2021 19:40:45 +0200 Subject: [PATCH 0227/2542] HACK: mfreadwrite: Ignore source reader flushes for The Medium. --- dlls/mfreadwrite/reader.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c index 4d223f1de6ec..19e1bf6b1f93 100644 --- a/dlls/mfreadwrite/reader.c +++ b/dlls/mfreadwrite/reader.c @@ -2492,8 +2492,19 @@ static HRESULT WINAPI src_reader_Flush(IMFSourceReaderEx *iface, DWORD index) struct source_reader *reader = impl_from_IMFSourceReaderEx(iface); HRESULT hr; + const char *sgi; + TRACE("%p, %#lx.\n", iface, index); + sgi = getenv("SteamGameId"); + if (sgi && strcmp(sgi, "1293160") == 0) + { + /* In The Medium flushes sometimes lead to the callback + calling objects that have already been destroyed. */ + WARN("ignoring flush\n"); + return S_OK; + } + EnterCriticalSection(&reader->cs); if (reader->async_callback) From 164af86dd770f975cdff3e09884f14ebc14b856b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 4 Mar 2024 09:54:09 +0100 Subject: [PATCH 0228/2542] mfreadwrite/reader: Rely on the video processor sample allocator. CW-Bug-Id: #20833 --- dlls/mfreadwrite/reader.c | 143 -------------------------------------- 1 file changed, 143 deletions(-) diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c index 19e1bf6b1f93..fcb8d8dec949 100644 --- a/dlls/mfreadwrite/reader.c +++ b/dlls/mfreadwrite/reader.c @@ -89,7 +89,6 @@ struct media_stream IMFMediaStream *stream; IMFMediaType *current; struct list transforms; - IMFVideoSampleAllocatorEx *allocator; IMFTransform *transform_service; DWORD id; unsigned int index; @@ -232,8 +231,6 @@ static void media_stream_destroy(struct media_stream *stream) IMFMediaStream_Release(stream->stream); if (stream->current) IMFMediaType_Release(stream->current); - if (stream->allocator) - IMFVideoSampleAllocatorEx_Release(stream->allocator); } static ULONG source_reader_release(struct source_reader *reader) @@ -429,39 +426,6 @@ static void source_reader_response_ready(struct source_reader *reader, struct st stream->requests--; } -static void source_reader_copy_sample_buffer(IMFSample *src, IMFSample *dst) -{ - IMFMediaBuffer *buffer; - LONGLONG time; - DWORD flags; - HRESULT hr; - - IMFSample_CopyAllItems(src, (IMFAttributes *)dst); - - IMFSample_SetSampleDuration(dst, 0); - IMFSample_SetSampleTime(dst, 0); - IMFSample_SetSampleFlags(dst, 0); - - if (SUCCEEDED(IMFSample_GetSampleDuration(src, &time))) - IMFSample_SetSampleDuration(dst, time); - - if (SUCCEEDED(IMFSample_GetSampleTime(src, &time))) - IMFSample_SetSampleTime(dst, time); - - if (SUCCEEDED(IMFSample_GetSampleFlags(src, &flags))) - IMFSample_SetSampleFlags(dst, flags); - - if (SUCCEEDED(IMFSample_ConvertToContiguousBuffer(src, NULL))) - { - if (SUCCEEDED(IMFSample_GetBufferByIndex(dst, 0, &buffer))) - { - if (FAILED(hr = IMFSample_CopyToBuffer(src, buffer))) - WARN("Failed to copy a buffer, hr %#lx.\n", hr); - IMFMediaBuffer_Release(buffer); - } - } -} - static HRESULT source_reader_queue_response(struct source_reader *reader, struct media_stream *stream, HRESULT status, DWORD stream_flags, LONGLONG timestamp, IMFSample *sample) { @@ -1219,8 +1183,6 @@ static struct stream_response * media_stream_detach_response(struct source_reade static struct stream_response *media_stream_pop_response(struct source_reader *reader, struct media_stream *stream) { struct stream_response *response; - IMFSample *sample; - HRESULT hr; LIST_FOR_EACH_ENTRY(response, &reader->responses, struct stream_response, entry) { @@ -1229,26 +1191,6 @@ static struct stream_response *media_stream_pop_response(struct source_reader *r if (!stream) stream = &reader->streams[response->stream_index]; - if (response->sample && stream->allocator) - { - /* Return allocation error to the caller, while keeping original response sample in for later. */ - if (SUCCEEDED(hr = IMFVideoSampleAllocatorEx_AllocateSample(stream->allocator, &sample))) - { - source_reader_copy_sample_buffer(response->sample, sample); - IMFSample_Release(response->sample); - response->sample = sample; - } - else - { - if (!(response = calloc(1, sizeof(*response)))) - return NULL; - - response->status = hr; - response->stream_flags = MF_SOURCE_READERF_ERROR; - return response; - } - } - return media_stream_detach_response(reader, response); } @@ -1661,7 +1603,6 @@ static ULONG WINAPI src_reader_Release(IMFSourceReaderEx *iface) { struct source_reader *reader = impl_from_IMFSourceReaderEx(iface); ULONG refcount = InterlockedDecrement(&reader->public_refcount); - unsigned int i; TRACE("%p, refcount %lu.\n", iface, refcount); @@ -1681,23 +1622,6 @@ static ULONG WINAPI src_reader_Release(IMFSourceReaderEx *iface) LeaveCriticalSection(&reader->cs); } - for (i = 0; i < reader->stream_count; ++i) - { - struct media_stream *stream = &reader->streams[i]; - IMFVideoSampleAllocatorCallback *callback; - - if (!stream->allocator) - continue; - - if (SUCCEEDED(IMFVideoSampleAllocatorEx_QueryInterface(stream->allocator, &IID_IMFVideoSampleAllocatorCallback, - (void **)&callback))) - { - IMFVideoSampleAllocatorCallback_SetCallback(callback, NULL); - IMFVideoSampleAllocatorCallback_Release(callback); - } - } - - MFUnlockWorkQueue(reader->queue); source_reader_release(reader); } @@ -1948,71 +1872,6 @@ static HRESULT source_reader_set_compatible_media_type(struct source_reader *rea return type_set ? S_OK : S_FALSE; } -static HRESULT source_reader_create_sample_allocator_attributes(const struct source_reader *reader, - IMFAttributes **attributes) -{ - UINT32 shared = 0, shared_without_mutex = 0; - HRESULT hr; - - if (FAILED(hr = MFCreateAttributes(attributes, 1))) - return hr; - - IMFAttributes_GetUINT32(reader->attributes, &MF_SA_D3D11_SHARED, &shared); - IMFAttributes_GetUINT32(reader->attributes, &MF_SA_D3D11_SHARED_WITHOUT_MUTEX, &shared_without_mutex); - - if (shared_without_mutex) - hr = IMFAttributes_SetUINT32(*attributes, &MF_SA_D3D11_SHARED_WITHOUT_MUTEX, TRUE); - else if (shared) - hr = IMFAttributes_SetUINT32(*attributes, &MF_SA_D3D11_SHARED, TRUE); - - return hr; -} - -static HRESULT source_reader_setup_sample_allocator(struct source_reader *reader, unsigned int index) -{ - struct media_stream *stream = &reader->streams[index]; - IMFAttributes *attributes = NULL; - GUID major = { 0 }; - HRESULT hr; - - IMFMediaType_GetMajorType(stream->current, &major); - if (!IsEqualGUID(&major, &MFMediaType_Video)) - return S_OK; - - if (!(reader->flags & SOURCE_READER_HAS_DEVICE_MANAGER)) - return S_OK; - - if (!stream->allocator) - { - if (FAILED(hr = MFCreateVideoSampleAllocatorEx(&IID_IMFVideoSampleAllocatorEx, (void **)&stream->allocator))) - { - WARN("Failed to create sample allocator, hr %#lx.\n", hr); - return hr; - } - } - - IMFVideoSampleAllocatorEx_UninitializeSampleAllocator(stream->allocator); - if (FAILED(hr = IMFVideoSampleAllocatorEx_SetDirectXManager(stream->allocator, reader->device_manager))) - { - WARN("Failed to set device manager, hr %#lx.\n", hr); - return hr; - } - - if (FAILED(hr = source_reader_create_sample_allocator_attributes(reader, &attributes))) - WARN("Failed to create allocator attributes, hr %#lx.\n", hr); - - if (FAILED(hr = IMFVideoSampleAllocatorEx_InitializeSampleAllocatorEx(stream->allocator, 2, 8, - attributes, stream->current))) - { - WARN("Failed to initialize sample allocator, hr %#lx.\n", hr); - } - - if (attributes) - IMFAttributes_Release(attributes); - - return hr; -} - static BOOL source_reader_allow_video_processor(struct source_reader *reader, BOOL *advanced) { UINT32 value; @@ -2265,8 +2124,6 @@ static HRESULT WINAPI src_reader_SetCurrentMediaType(IMFSourceReaderEx *iface, D hr = source_reader_set_compatible_media_type(reader, index, type); if (hr == S_FALSE) hr = source_reader_create_decoder_for_stream(reader, index, type); - if (SUCCEEDED(hr)) - hr = source_reader_setup_sample_allocator(reader, index); LeaveCriticalSection(&reader->cs); From 0216ca22cdf2f391f366b038b6a4923921ac2899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 4 Mar 2024 09:54:09 +0100 Subject: [PATCH 0229/2542] mfreadwrite/reader: Use MFCreateMediaBufferFromMediaType to allocate samples. CW-Bug-Id: #20833 --- dlls/mfreadwrite/reader.c | 23 ++++++++++++++--------- dlls/mfreadwrite/tests/mfplat.c | 6 +++--- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c index fcb8d8dec949..465071c9dc03 100644 --- a/dlls/mfreadwrite/reader.c +++ b/dlls/mfreadwrite/reader.c @@ -644,26 +644,31 @@ static ULONG WINAPI source_reader_stream_events_callback_Release(IMFAsyncCallbac return source_reader_release(reader); } -static HRESULT source_reader_allocate_stream_sample(MFT_OUTPUT_STREAM_INFO *info, IMFSample **out) +static HRESULT source_reader_allocate_stream_sample(IMFTransform *transform, MFT_OUTPUT_STREAM_INFO *info, IMFSample **out) { + IMFMediaType *media_type; IMFMediaBuffer *buffer; IMFSample *sample; HRESULT hr; *out = NULL; - if (FAILED(hr = MFCreateSample(&sample))) + if (SUCCEEDED(hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type))) + { + hr = MFCreateMediaBufferFromMediaType(media_type, 10000000, info->cbSize, info->cbAlignment, &buffer); + IMFMediaType_Release(media_type); + } + if (FAILED(hr) && FAILED(hr = MFCreateAlignedMemoryBuffer(info->cbSize, info->cbAlignment, &buffer))) return hr; - if (SUCCEEDED(hr = MFCreateAlignedMemoryBuffer(info->cbSize, info->cbAlignment, &buffer))) + + if (SUCCEEDED(hr = MFCreateSample(&sample))) { if (SUCCEEDED(hr = IMFSample_AddBuffer(sample, buffer))) - { *out = sample; - IMFSample_AddRef(sample); - } - IMFMediaBuffer_Release(buffer); + else + IMFSample_Release(sample); } - IMFSample_Release(sample); + IMFMediaBuffer_Release(buffer); return hr; } @@ -849,7 +854,7 @@ static HRESULT source_reader_pull_transform_samples(struct source_reader *reader IMFMediaType *media_type; if (!(stream_info.dwFlags & (MFT_OUTPUT_STREAM_PROVIDES_SAMPLES | MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES)) - && FAILED(hr = source_reader_allocate_stream_sample(&stream_info, &out_buffer.pSample))) + && FAILED(hr = source_reader_allocate_stream_sample(entry->transform, &stream_info, &out_buffer.pSample))) break; if (SUCCEEDED(hr = IMFTransform_ProcessOutput(entry->transform, 0, 1, &out_buffer, &status))) diff --git a/dlls/mfreadwrite/tests/mfplat.c b/dlls/mfreadwrite/tests/mfplat.c index b6981479a1b6..e90931253fc8 100644 --- a/dlls/mfreadwrite/tests/mfplat.c +++ b/dlls/mfreadwrite/tests/mfplat.c @@ -2644,11 +2644,11 @@ static HRESULT WINAPI test_decoder_ProcessOutput(IMFTransform *iface, DWORD flag hr = IMFSample_GetBufferByIndex(data->pSample, 0, &buffer); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine check_interface(buffer, &IID_IMF2DBuffer2, TRUE); - todo_wine check_interface(buffer, &IID_IMFGetService, TRUE); + check_interface(buffer, &IID_IMF2DBuffer2, TRUE); + check_interface(buffer, &IID_IMFGetService, TRUE); check_interface(buffer, &IID_IMFDXGIBuffer, FALSE); hr = MFGetService((IUnknown *)buffer, &MR_BUFFER_SERVICE, &IID_IDirect3DSurface9, (void **)&unknown); - todo_wine ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr); + ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr); IMFMediaBuffer_Release(buffer); } From 622812dc89ad361e8ea012158de2ec5a778e18b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 21 May 2024 13:37:08 +0200 Subject: [PATCH 0230/2542] mfreadwrite/reader: Make a copy of the output type in SetCurrentMediaType. CW-Bug-Id: #20833 --- dlls/mfreadwrite/reader.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c index 465071c9dc03..36b9fdbe5be5 100644 --- a/dlls/mfreadwrite/reader.c +++ b/dlls/mfreadwrite/reader.c @@ -2103,6 +2103,7 @@ static HRESULT WINAPI src_reader_SetCurrentMediaType(IMFSourceReaderEx *iface, D IMFMediaType *type) { struct source_reader *reader = impl_from_IMFSourceReaderEx(iface); + IMFMediaType *output_type; HRESULT hr; TRACE("%p, %#lx, %p, %p.\n", iface, index, reserved, type); @@ -2122,16 +2123,25 @@ static HRESULT WINAPI src_reader_SetCurrentMediaType(IMFSourceReaderEx *iface, D if (index >= reader->stream_count) return MF_E_INVALIDSTREAMNUMBER; + if (FAILED(hr = MFCreateMediaType(&output_type))) + return hr; + if (FAILED(IMFMediaType_CopyAllItems(type, (IMFAttributes *)output_type))) + { + IMFMediaType_Release(output_type); + return hr; + } + /* FIXME: setting the output type while streaming should trigger a flush */ EnterCriticalSection(&reader->cs); - hr = source_reader_set_compatible_media_type(reader, index, type); + hr = source_reader_set_compatible_media_type(reader, index, output_type); if (hr == S_FALSE) - hr = source_reader_create_decoder_for_stream(reader, index, type); + hr = source_reader_create_decoder_for_stream(reader, index, output_type); LeaveCriticalSection(&reader->cs); + IMFMediaType_Release(output_type); return hr; } From ed055fabe5dc252615631f0c3d82e302df03032b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 21 May 2024 13:37:08 +0200 Subject: [PATCH 0231/2542] mfreadwrite/reader: Set MF_MT_AUDIO_BITS_PER_SAMPLE attribute when missing. CW-Bug-Id: #20833 --- dlls/mfreadwrite/reader.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c index 36b9fdbe5be5..79425be0bbbe 100644 --- a/dlls/mfreadwrite/reader.c +++ b/dlls/mfreadwrite/reader.c @@ -1923,12 +1923,21 @@ static HRESULT source_reader_create_transform(struct source_reader *reader, BOOL list_init(&entry->entry); entry->category = category; - if (IsEqualGUID(&out_type.guidMajorType, &MFMediaType_Audio) - && SUCCEEDED(IMFMediaType_GetUINT32(output_type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, &entry->min_buffer_size))) + if (IsEqualGUID(&out_type.guidMajorType, &MFMediaType_Audio)) { UINT32 bytes_per_second; - if (SUCCEEDED(IMFMediaType_GetUINT32(output_type, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, &bytes_per_second))) + /* decoders require to have MF_MT_AUDIO_BITS_PER_SAMPLE attribute set, but the source reader doesn't */ + if (FAILED(IMFMediaType_GetItem(output_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, NULL))) + { + if (IsEqualGUID(&out_type.guidSubtype, &MFAudioFormat_PCM)) + IMFMediaType_SetUINT32(output_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, 16); + else if (IsEqualGUID(&out_type.guidSubtype, &MFAudioFormat_Float)) + IMFMediaType_SetUINT32(output_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, 32); + } + + if (SUCCEEDED(IMFMediaType_GetUINT32(output_type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, &entry->min_buffer_size)) + && SUCCEEDED(IMFMediaType_GetUINT32(output_type, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, &bytes_per_second))) entry->min_buffer_size = max(entry->min_buffer_size, bytes_per_second); } From 6b553ef12c9a32d7cf70b27f966d5d65d4a0e5ce Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Wed, 24 Jul 2024 12:02:34 +1000 Subject: [PATCH 0232/2542] mfmediaengine: Retrieve frame size from frame sink. This was previously retrieved from the media source, but this may no longer know the frame size (as parsing/decoding occurs in the MFT). CW-Bug-Id: #23810 --- dlls/mfmediaengine/main.c | 73 ++++++++++++--------------------------- 1 file changed, 23 insertions(+), 50 deletions(-) diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c index 27249f09fa68..8457ba0853db 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c @@ -811,55 +811,41 @@ static unsigned int get_gcd(unsigned int a, unsigned int b) return a; } -static void media_engine_get_frame_size(struct media_engine *engine, IMFTopology *topology) +static void media_engine_get_frame_size(struct media_engine *engine) { IMFMediaTypeHandler *handler; IMFMediaType *media_type; - IMFStreamDescriptor *sd; - IMFTopologyNode *node; - unsigned int gcd; - UINT64 size; - HRESULT hr; engine->video_frame.size.cx = 0; engine->video_frame.size.cy = 0; engine->video_frame.ratio.cx = 1; engine->video_frame.ratio.cy = 1; - if (FAILED(IMFTopology_GetNodeByID(topology, engine->video_frame.node_id, &node))) - return; - - hr = IMFTopologyNode_GetUnknown(node, &MF_TOPONODE_STREAM_DESCRIPTOR, - &IID_IMFStreamDescriptor, (void **)&sd); - IMFTopologyNode_Release(node); - if (FAILED(hr)) - return; - - hr = IMFStreamDescriptor_GetMediaTypeHandler(sd, &handler); - IMFStreamDescriptor_Release(sd); - if (FAILED(hr)) - return; - - hr = IMFMediaTypeHandler_GetCurrentMediaType(handler, &media_type); - IMFMediaTypeHandler_Release(handler); - if (FAILED(hr)) + video_frame_sink_query_iface(engine->presentation.frame_sink, &IID_IMFMediaTypeHandler, (void**)&handler); + if (SUCCEEDED(IMFMediaTypeHandler_GetCurrentMediaType(handler, &media_type))) { - WARN("Failed to get current media type %#lx.\n", hr); - return; - } - - IMFMediaType_GetUINT64(media_type, &MF_MT_FRAME_SIZE, &size); + UINT64 size; + HRESULT hr = IMFMediaType_GetUINT64(media_type, &MF_MT_FRAME_SIZE, &size); + if (SUCCEEDED(hr)) + { + unsigned int gcd; + engine->video_frame.size.cx = size >> 32; + engine->video_frame.size.cy = size; - engine->video_frame.size.cx = size >> 32; - engine->video_frame.size.cy = size; + if ((gcd = get_gcd(engine->video_frame.size.cx, engine->video_frame.size.cy))) + { + engine->video_frame.ratio.cx = engine->video_frame.size.cx / gcd; + engine->video_frame.ratio.cy = engine->video_frame.size.cy / gcd; + } + } + else + { + WARN("Failed to get frame size %#lx.\n", hr); + } - if ((gcd = get_gcd(engine->video_frame.size.cx, engine->video_frame.size.cy))) - { - engine->video_frame.ratio.cx = engine->video_frame.size.cx / gcd; - engine->video_frame.ratio.cy = engine->video_frame.size.cy / gcd; + IMFMediaType_Release(media_type); } - - IMFMediaType_Release(media_type); + IMFMediaTypeHandler_Release(handler); } static void media_engine_apply_volume(const struct media_engine *engine) @@ -941,32 +927,19 @@ static HRESULT WINAPI media_engine_session_events_Invoke(IMFAsyncCallback *iface case MESessionTopologyStatus: { UINT32 topo_status = 0; - IMFTopology *topology; PROPVARIANT value; IMFMediaEvent_GetUINT32(event, &MF_EVENT_TOPOLOGY_STATUS, &topo_status); if (topo_status != MF_TOPOSTATUS_READY) break; - value.vt = VT_EMPTY; - if (FAILED(IMFMediaEvent_GetValue(event, &value))) - break; - - if (value.vt != VT_UNKNOWN) - { - PropVariantClear(&value); - break; - } - - topology = (IMFTopology *)value.punkVal; - EnterCriticalSection(&engine->cs); media_engine_apply_volume(engine); engine->ready_state = MF_MEDIA_ENGINE_READY_HAVE_METADATA; - media_engine_get_frame_size(engine, topology); + media_engine_get_frame_size(engine); IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_DURATIONCHANGE, 0, 0); IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_LOADEDMETADATA, 0, 0); From 541b9e83ccb766d28d29ada3012cd8c7a8b9c6ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 23 Nov 2023 00:45:19 +0100 Subject: [PATCH 0233/2542] HACK: mfplat: Stub out MFCreateDXGIDeviceManager, to avoid the d3d path. Squashed with: HACK: mfplat: Return E_NOTIMPL from MFCreateDXGIDeviceManager for TOHU. Without this the game renders the videos as garbage. CW-Bug-Id: #20194 HACK: mfplat: Move MFDXGIDeviceManager hack appid list to proton script mfplat: Remove comment about games requiring MFCreateDXGIDeviceManager() hack. It is not outdated and partially incorrect. CW-Bug-Id: #19126 CW-Bug-Id: #20985 --- dlls/mfplat/main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 4ed607686f18..8e15abc4de0f 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -9210,9 +9210,16 @@ static const IMFDXGIDeviceManagerVtbl dxgi_device_manager_vtbl = HRESULT WINAPI MFCreateDXGIDeviceManager(UINT *token, IMFDXGIDeviceManager **manager) { struct dxgi_device_manager *object; + const char *do_not_create = getenv("WINE_DO_NOT_CREATE_DXGI_DEVICE_MANAGER"); TRACE("%p, %p.\n", token, manager); + if (do_not_create && do_not_create[0] != '\0') + { + FIXME("stubbing out\n"); + return E_NOTIMPL; + } + if (!token || !manager) return E_POINTER; From 93c63b6da595380f897560f677860ae61dea9354 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Mon, 6 Jun 2022 13:37:48 +0200 Subject: [PATCH 0234/2542] mfplat/sample: Use Copy2DTo when copying samples, if available. CW-Bug-Id: #19126 --- dlls/mfplat/sample.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/dlls/mfplat/sample.c b/dlls/mfplat/sample.c index 4d75924b939f..9ce102ba5390 100644 --- a/dlls/mfplat/sample.c +++ b/dlls/mfplat/sample.c @@ -791,6 +791,28 @@ static HRESULT WINAPI sample_GetTotalLength(IMFSample *iface, DWORD *total_lengt return S_OK; } +static HRESULT copy_2d_buffer(IMFMediaBuffer *src, IMFMediaBuffer *dst) +{ + IMF2DBuffer2 *src2d = NULL, *dst2d = NULL; + HRESULT hr = S_OK; + + hr = IMFMediaBuffer_QueryInterface(src, &IID_IMF2DBuffer2, (void **)&src2d); + + if (SUCCEEDED(hr)) + hr = IMFMediaBuffer_QueryInterface(dst, &IID_IMF2DBuffer2, (void **)&dst2d); + + if (SUCCEEDED(hr)) + hr = IMF2DBuffer2_Copy2DTo(src2d, dst2d); + + if (src2d) + IMF2DBuffer2_Release(src2d); + + if (dst2d) + IMF2DBuffer2_Release(dst2d); + + return hr; +} + static HRESULT WINAPI sample_CopyToBuffer(IMFSample *iface, IMFMediaBuffer *buffer) { struct sample *sample = impl_from_IMFSample(iface); @@ -805,6 +827,15 @@ static HRESULT WINAPI sample_CopyToBuffer(IMFSample *iface, IMFMediaBuffer *buff EnterCriticalSection(&sample->attributes.cs); + if (sample->buffer_count == 1) + { + if (SUCCEEDED(hr = copy_2d_buffer(sample->buffers[0], buffer))) + { + LeaveCriticalSection(&sample->attributes.cs); + return hr; + } + } + total_length = sample_get_total_length(sample); dst_current_length = 0; From 89824d78e95f6f8929a55a25a0fc1e98c0afad1a Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Mon, 6 Jun 2022 14:56:34 +0200 Subject: [PATCH 0235/2542] mfplat/sample: Use contiguous copy. CW-Bug-Id: #19126 --- dlls/mfplat/sample.c | 52 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 9 deletions(-) diff --git a/dlls/mfplat/sample.c b/dlls/mfplat/sample.c index 9ce102ba5390..4b9151b56b23 100644 --- a/dlls/mfplat/sample.c +++ b/dlls/mfplat/sample.c @@ -791,24 +791,58 @@ static HRESULT WINAPI sample_GetTotalLength(IMFSample *iface, DWORD *total_lengt return S_OK; } +static HRESULT copy_2d_buffer_from_contiguous(IMFMediaBuffer *src, IMF2DBuffer *dst) +{ + DWORD current_length; + HRESULT hr, hr2; + BYTE *ptr; + + hr = IMFMediaBuffer_Lock(src, &ptr, NULL, ¤t_length); + + if (SUCCEEDED(hr)) + { + hr = IMF2DBuffer_ContiguousCopyFrom(dst, ptr, current_length); + + hr2 = IMFMediaBuffer_Unlock(src); + if (FAILED(hr2)) + WARN("Unlocking source buffer %p failed with hr %#lx.\n", src, hr2); + if (FAILED(hr2) && SUCCEEDED(hr)) + hr = hr2; + } + + return hr; +} + static HRESULT copy_2d_buffer(IMFMediaBuffer *src, IMFMediaBuffer *dst) { - IMF2DBuffer2 *src2d = NULL, *dst2d = NULL; - HRESULT hr = S_OK; + IMF2DBuffer2 *src2d2 = NULL, *dst2d2 = NULL; + IMF2DBuffer *dst2 = NULL; + HRESULT hr; - hr = IMFMediaBuffer_QueryInterface(src, &IID_IMF2DBuffer2, (void **)&src2d); + hr = IMFMediaBuffer_QueryInterface(src, &IID_IMF2DBuffer2, (void **)&src2d2); + + if (SUCCEEDED(hr)) + hr = IMFMediaBuffer_QueryInterface(dst, &IID_IMF2DBuffer2, (void **)&dst2d2); if (SUCCEEDED(hr)) - hr = IMFMediaBuffer_QueryInterface(dst, &IID_IMF2DBuffer2, (void **)&dst2d); + hr = IMF2DBuffer2_Copy2DTo(src2d2, dst2d2); + + if (src2d2) + IMF2DBuffer2_Release(src2d2); + + if (dst2d2) + IMF2DBuffer2_Release(dst2d2); if (SUCCEEDED(hr)) - hr = IMF2DBuffer2_Copy2DTo(src2d, dst2d); + return hr; - if (src2d) - IMF2DBuffer2_Release(src2d); + hr = IMFMediaBuffer_QueryInterface(dst, &IID_IMF2DBuffer, (void **)&dst2); + + if (SUCCEEDED(hr)) + hr = copy_2d_buffer_from_contiguous(src, dst2); - if (dst2d) - IMF2DBuffer2_Release(dst2d); + if (dst2) + IMF2DBuffer_Release(dst2); return hr; } From a055ab387a962d9909f4f3624bed27ace3c96afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 16 Jul 2024 10:51:02 +0200 Subject: [PATCH 0236/2542] mfplat: Flush D3D11 context after CopySubresourceRegion on unmap. Fixes some garbled video frames when the texture is later used as input by the video processor. CW-Bug-Id: #20833 --- dlls/mfplat/buffer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c index 65fab78d427d..f3eb7f9222eb 100644 --- a/dlls/mfplat/buffer.c +++ b/dlls/mfplat/buffer.c @@ -1004,6 +1004,7 @@ static void dxgi_surface_buffer_unmap(struct buffer *buffer, MF2DBuffer_LockFlag { ID3D11DeviceContext_CopySubresourceRegion(immediate_context, (ID3D11Resource *)buffer->dxgi_surface.texture, buffer->dxgi_surface.sub_resource_idx, 0, 0, 0, (ID3D11Resource *)buffer->dxgi_surface.rb_texture, 0, NULL); + ID3D11DeviceContext_Flush(immediate_context); } ID3D11DeviceContext_Release(immediate_context); From 144dcbbc40cab72c45f427e783b3732a0f210466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 6 Sep 2022 22:01:26 +0200 Subject: [PATCH 0237/2542] mf: Discard end of presentation on IMFMediaSession_Stop. MR !607 was trying to fix an issue with Life Is Strange Remastered, but although it fixed some race conditions with presentation end, the issue it was trying to fix is still there. The game calls IMFMediaSession_Stop while the presentation is ending, expects that command to quickly execute, interrupting the presentation end and emitting a MESessionStopped event instead of the MESessionEnded. Delaying the Stop command and emitting the MESessionEnded event breaks the game assumptions and it crashes. CW-Bug-Id: #20916 --- dlls/mf/session.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/mf/session.c b/dlls/mf/session.c index b42975818000..c9d003cf3e89 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -2791,6 +2791,13 @@ static HRESULT WINAPI session_commands_callback_Invoke(IMFAsyncCallback *iface, EnterCriticalSection(&session->cs); + if ((session->presentation.flags & SESSION_FLAG_END_OF_PRESENTATION) && op->command != SESSION_CMD_STOP) + { + WARN("session %p command is ending, waiting for it to complete.\n", session); + LeaveCriticalSection(&session->cs); + return S_OK; + } + if (session->presentation.flags & SESSION_FLAG_PENDING_COMMAND) { WARN("session %p command is in progress, waiting for it to complete.\n", session); @@ -2817,6 +2824,9 @@ static HRESULT WINAPI session_commands_callback_Invoke(IMFAsyncCallback *iface, session_pause(session); break; case SESSION_CMD_STOP: + if (session->presentation.flags & SESSION_FLAG_END_OF_PRESENTATION) + session_set_topo_status(session, S_OK, MF_TOPOSTATUS_ENDED); + session_clear_end_of_presentation(session); session_stop(session); break; case SESSION_CMD_CLOSE: @@ -4134,7 +4144,7 @@ static void session_raise_end_of_presentation(struct media_session *session) { if (session_nodes_is_mask_set(session, MF_TOPOLOGY_MAX, SOURCE_FLAG_END_OF_PRESENTATION)) { - session->presentation.flags |= SESSION_FLAG_END_OF_PRESENTATION | SESSION_FLAG_PENDING_COMMAND; + session->presentation.flags |= SESSION_FLAG_END_OF_PRESENTATION; IMFMediaEventQueue_QueueEventParamVar(session->event_queue, MEEndOfPresentation, &GUID_NULL, S_OK, NULL); } } From 454b8a6088fc8db7bcf64cd126c3e541a79fb113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 31 Oct 2022 10:34:38 +0100 Subject: [PATCH 0238/2542] HACK: mf: Return E_NOTIMPL from media session SetRate if rate is 0 (scrubbing). CW-Bug-Id: #21498 --- dlls/mf/session.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/mf/session.c b/dlls/mf/session.c index c9d003cf3e89..a5c603343219 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -4731,6 +4731,13 @@ static HRESULT WINAPI session_rate_control_SetRate(IMFRateControl *iface, BOOL t TRACE("%p, %d, %f.\n", iface, thin, rate); + if (!rate) + { + /* The Anacrusis fails to play its video if we succeed here */ + ERR("Scrubbing not implemented!\n"); + return E_NOTIMPL; + } + if (FAILED(hr = create_session_op(SESSION_CMD_SET_RATE, &op))) return hr; From 099e6e15aa665e905dc5137cd829afe4e312c41c Mon Sep 17 00:00:00 2001 From: Santino Mazza Date: Fri, 9 Jun 2023 16:59:27 -0300 Subject: [PATCH 0239/2542] mf: Clear end of presentation if topo_status is not invalid. Cw-Bug-Id: #22719 Cw-Bug-Id: #21809 --- dlls/mf/session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/mf/session.c b/dlls/mf/session.c index a5c603343219..8ceb7c3e88c2 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -2826,7 +2826,8 @@ static HRESULT WINAPI session_commands_callback_Invoke(IMFAsyncCallback *iface, case SESSION_CMD_STOP: if (session->presentation.flags & SESSION_FLAG_END_OF_PRESENTATION) session_set_topo_status(session, S_OK, MF_TOPOSTATUS_ENDED); - session_clear_end_of_presentation(session); + if (session->presentation.topo_status != MF_TOPOSTATUS_INVALID) + session_clear_end_of_presentation(session); session_stop(session); break; case SESSION_CMD_CLOSE: From d03926aae719efd5854a819e7a15fc92684acfeb Mon Sep 17 00:00:00 2001 From: Santino Mazza Date: Tue, 31 Oct 2023 20:44:53 -0300 Subject: [PATCH 0240/2542] mf: Signal event_cond in wg_parser_stream_disable. A workaround to fix a hang in media_source_Shutdown in old media source, because the wg_parser receives an EOS signal after media_source_Shutdown disabled the streams, and event_cond never gets signaled so it never stops being busy. Cw-Bug-Id: #21809 --- dlls/winegstreamer/wg_parser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 93e3da291c0a..f3e89979d6be 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -295,6 +295,7 @@ static NTSTATUS wg_parser_stream_disable(void *args) stream->desired_caps = NULL; } pthread_mutex_unlock(&parser->mutex); + pthread_cond_signal(&stream->event_cond); pthread_cond_signal(&stream->event_empty_cond); return S_OK; } From 5f38aaebdb73d3b7a0ec02f20ee23fcaa38cb2f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 13 Jan 2023 09:08:33 +0100 Subject: [PATCH 0241/2542] mf: Drop late samples in audio renderer. CW-Bug-Id: #21159 Squashed with: mf: Don't leak dropped samples. CW-Bug-Id: #22798 --- dlls/mf/sar.c | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/dlls/mf/sar.c b/dlls/mf/sar.c index 84824f954dd3..970063497b18 100644 --- a/dlls/mf/sar.c +++ b/dlls/mf/sar.c @@ -1339,6 +1339,7 @@ static HRESULT stream_queue_sample(struct audio_renderer *renderer, IMFSample *s { struct queued_object *object; DWORD sample_len, sample_frames; + MFTIME time, clocktime, systime; HRESULT hr; if (FAILED(hr = IMFSample_GetTotalLength(sample, &sample_len))) @@ -1346,15 +1347,33 @@ static HRESULT stream_queue_sample(struct audio_renderer *renderer, IMFSample *s sample_frames = sample_len / renderer->frame_size; - if (!(object = calloc(1, sizeof(*object)))) - return E_OUTOFMEMORY; + if (FAILED(hr = IMFSample_GetSampleTime(sample, &time))) + { + WARN("Failed to get sample time, hr %#lx.\n", hr); + return hr; + } - object->type = OBJECT_TYPE_SAMPLE; - object->u.sample.sample = sample; - IMFSample_AddRef(object->u.sample.sample); + if (!renderer->clock) + clocktime = time; + else if (FAILED(hr = IMFPresentationClock_GetCorrelatedTime(renderer->clock, 0, &clocktime, &systime))) + { + WARN("Failed to get clock time, hr %#lx.\n", hr); + return hr; + } - list_add_tail(&renderer->queue, &object->entry); - renderer->queued_frames += sample_frames; + if (time < clocktime) + FIXME("Dropping sample %p, time %I64u, clocktime %I64u, systime %I64u.\n", sample, time, clocktime, systime); + else + { + if (!(object = calloc(1, sizeof(*object)))) + return E_OUTOFMEMORY; + + object->type = OBJECT_TYPE_SAMPLE; + object->u.sample.sample = sample; + IMFSample_AddRef(object->u.sample.sample); + list_add_tail(&renderer->queue, &object->entry); + renderer->queued_frames += sample_frames; + } return S_OK; } From c56fdfd4239ab9afd57ce3247173fc9b326758fb Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Thu, 12 Oct 2023 11:28:45 +0100 Subject: [PATCH 0242/2542] mf: Don't make stream sink shutdown dependent on IMFActivate presence in node. Base on Bernhard's upstream MR: https://gitlab.winehq.org/wine/wine/-/merge_requests/3067 This fixes a media engine leak after it's shut down. CW-Bug-Id: #22798 --- dlls/mf/session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 8ceb7c3e88c2..87c46673cca3 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -840,7 +840,7 @@ static void session_shutdown_current_topology(struct media_session *session) WARN("Failed to shut down activation object for the sink, hr %#lx.\n", hr); IMFActivate_Release(activate); } - else if (SUCCEEDED(topology_node_get_object(node, &IID_IMFStreamSink, (void **)&stream_sink))) + if (SUCCEEDED(topology_node_get_object(node, &IID_IMFStreamSink, (void **)&stream_sink))) { if (SUCCEEDED(IMFStreamSink_GetMediaSink(stream_sink, &sink))) { From 9eb2d28c07e50780310c0218b04d3af7979d42ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 2 Apr 2024 13:08:27 +0200 Subject: [PATCH 0243/2542] mf/session: Keep previously allocated sample with the transform streams. CW-Bug-Id: #20833 --- dlls/mf/session.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 87c46673cca3..e5e24b36ffb6 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -159,6 +159,7 @@ struct transform_stream struct list samples; unsigned int requests; unsigned int min_buffer_size; + IMFSample *allocated_sample; BOOL draining; }; @@ -762,6 +763,12 @@ static void transform_stream_drop_events(struct transform_stream *stream) { IMFMediaEvent *event; + if (stream->allocated_sample) + { + IMFSample_Release(stream->allocated_sample); + stream->allocated_sample = NULL; + } + while (SUCCEEDED(transform_stream_pop_event(stream, &event))) IMFMediaEvent_Release(event); } @@ -3424,12 +3431,22 @@ static void session_set_sink_stream_state(struct media_session *session, IMFStre static HRESULT transform_get_external_output_sample(const struct media_session *session, struct topo_node *transform, DWORD output, const MFT_OUTPUT_STREAM_INFO *stream_info, IMFSample **sample) { + struct transform_stream *stream = &transform->u.transform.outputs[output]; + DWORD buffer_size, sample_size, input; IMFMediaBuffer *buffer = NULL; struct topo_node *topo_node; - unsigned int buffer_size; - DWORD input; HRESULT hr; + buffer_size = max(stream_info->cbSize, stream->min_buffer_size); + if ((*sample = stream->allocated_sample)) + { + stream->allocated_sample = NULL; + if (SUCCEEDED(IMFSample_GetTotalLength(*sample, &sample_size)) && sample_size >= buffer_size) + return S_OK; + IMFSample_Release(*sample); + *sample = NULL; + } + if (!(topo_node = session_get_topo_node_output(session, transform, output, &input))) { WARN("Failed to node %p/%lu output.\n", transform, output); @@ -3442,8 +3459,6 @@ static HRESULT transform_get_external_output_sample(const struct media_session * } else { - buffer_size = max(stream_info->cbSize, transform->u.transform.outputs[output].min_buffer_size); - hr = MFCreateAlignedMemoryBuffer(buffer_size, stream_info->cbAlignment, &buffer); if (SUCCEEDED(hr)) hr = MFCreateSample(sample); @@ -3661,6 +3676,11 @@ static HRESULT transform_node_pull_samples(const struct media_session *session, if (FAILED(hr = transform_stream_push_sample(stream, buffers[i].pSample))) WARN("Failed to queue output sample, hr %#lx\n", hr); } + else if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT && !stream->allocated_sample) + { + stream->allocated_sample = buffers[i].pSample; + buffers[i].pSample = NULL; + } } done: From a7f51d661284d0a827a60c64301891ab9809868f Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Tue, 25 Jan 2022 10:29:58 -0600 Subject: [PATCH 0244/2542] HACK: mf: Always allow enumerating source types in topology This lets us connect directly to a source format without a color converter. CW-Bug-Id: #19516 CW-Bug-Id: #19859 --- dlls/mf/session.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/mf/session.c b/dlls/mf/session.c index e5e24b36ffb6..d2cfc4db9959 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -2092,6 +2092,8 @@ static void session_set_topology(struct media_session *session, DWORD flags, IMF { hr = session_bind_output_nodes(topology); + IMFTopology_SetUINT32(topology, &MF_TOPOLOGY_ENUMERATE_SOURCE_TYPES, TRUE); + if (SUCCEEDED(hr)) hr = IMFTopoLoader_Load(session->topo_loader, topology, &resolved_topology, NULL /* FIXME? */); if (SUCCEEDED(hr)) From b489302007fda617baa16af1e1a6849c90cf1e3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 18 Aug 2022 16:38:19 +0200 Subject: [PATCH 0245/2542] HACK: mf/topology_loader: Force initialize downstream media type if it's not. --- dlls/mf/topology_loader.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/mf/topology_loader.c b/dlls/mf/topology_loader.c index 73f70e62bc66..a1b201fd4d24 100644 --- a/dlls/mf/topology_loader.c +++ b/dlls/mf/topology_loader.c @@ -383,7 +383,10 @@ static HRESULT get_first_supported_media_type(IMFMediaTypeHandler *handler, IMFM for (i = 0; SUCCEEDED(hr = IMFMediaTypeHandler_GetMediaTypeByIndex(handler, i, &media_type)); i++) { - if (SUCCEEDED(hr = IMFMediaTypeHandler_IsMediaTypeSupported(handler, media_type, NULL))) + /* HACK: Force initialize media type here, this is now something the topology laoder should do + * according to conformance tests but it should hopefully going to solve uninitialized audio + * renderer issues. */ + if (SUCCEEDED(hr = IMFMediaTypeHandler_SetCurrentMediaType(handler, media_type))) { *type = media_type; return hr; From 94595027e1195a7ceb807a3ae8c7f08ef2392999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 20 May 2022 21:48:59 +0200 Subject: [PATCH 0246/2542] qasf: Register ASF Reader filter media type. --- dlls/qasf/qasf.rgs | 15 +++++++++++++++ dlls/qasf/version.rc | 3 +++ 2 files changed, 18 insertions(+) create mode 100644 dlls/qasf/qasf.rgs diff --git a/dlls/qasf/qasf.rgs b/dlls/qasf/qasf.rgs new file mode 100644 index 000000000000..de0d3e425ed7 --- /dev/null +++ b/dlls/qasf/qasf.rgs @@ -0,0 +1,15 @@ +HKCR +{ + NoRemove 'Media Type' + { + '{e436eb83-524f-11ce-9f53-0020af0ba770}' + { + '{6b6d0801-9ada-11d0-a520-00a0d10129c0}' + { + val '0' = s '0,4,,3026b275' + val '1' = s '0,4,,d129e2d6' + val 'Source Filter' = s '{187463a0-5bb7-11d3-acbe-0080c75e246e}' + } + } + } +} diff --git a/dlls/qasf/version.rc b/dlls/qasf/version.rc index dab461943950..70ec03ad6b13 100644 --- a/dlls/qasf/version.rc +++ b/dlls/qasf/version.rc @@ -24,3 +24,6 @@ #define WINE_PRODUCTVERSION_STR "9.0.0.4503" #include "wine/wine_common_ver.rc" + +/* @makedep: qasf.rgs */ +1 WINE_REGISTRY qasf.rgs From 38d16a236ba4adaa8cc4642bba23034cb503dd31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 2 Aug 2022 11:26:09 +0200 Subject: [PATCH 0247/2542] qasf: Keep calling DMO ProcessOutput until error is returned. CW-Bug-Id: #18799 CW-Bug-Id: #18994 CW-Bug-Id: #20182 CW-Bug-Id: #20905 --- dlls/qasf/dmowrapper.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/dlls/qasf/dmowrapper.c b/dlls/qasf/dmowrapper.c index 7c6358b60295..0af8dccd35d6 100644 --- a/dlls/qasf/dmowrapper.c +++ b/dlls/qasf/dmowrapper.c @@ -247,17 +247,15 @@ static HRESULT process_output(struct dmo_wrapper *filter, IMediaObject *dmo) DMO_OUTPUT_DATA_BUFFER *buffers = filter->buffers; HRESULT hr = S_OK; DWORD status, i; - BOOL more_data; do { - more_data = FALSE; - if (FAILED(hr = get_output_samples(filter))) return hr; - if (FAILED(IMediaObject_ProcessOutput(dmo, DMO_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER, - filter->source_count, buffers, &status))) + hr = IMediaObject_ProcessOutput(dmo, DMO_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER, + filter->source_count, buffers, &status); + if (hr != S_OK) { release_output_samples(filter); break; @@ -270,9 +268,6 @@ static HRESULT process_output(struct dmo_wrapper *filter, IMediaObject *dmo) if (!buffers[i].pBuffer) continue; - if (buffers[i].dwStatus & DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE) - more_data = TRUE; - if (buffers[i].dwStatus & DMO_OUTPUT_DATA_BUFFERF_TIME) { if (buffers[i].dwStatus & DMO_OUTPUT_DATA_BUFFERF_TIMELENGTH) @@ -299,7 +294,7 @@ static HRESULT process_output(struct dmo_wrapper *filter, IMediaObject *dmo) } release_output_samples(filter); - } while (more_data); + } while (1); return hr; } From cbf7224ee33bf3ddf6ed0dd9f72bb68c876811e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 1 Sep 2022 21:04:06 +0200 Subject: [PATCH 0248/2542] qasf: Query the IWMReaderAdvanced2 reader interface. CW-Bug-Id: #21147 --- dlls/qasf/asfreader.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/qasf/asfreader.c b/dlls/qasf/asfreader.c index 39e9db15e371..1e332b1befa4 100644 --- a/dlls/qasf/asfreader.c +++ b/dlls/qasf/asfreader.c @@ -417,13 +417,13 @@ static HRESULT asf_reader_init_stream(struct strmbase_filter *iface) struct asf_reader *filter = impl_from_strmbase_filter(iface); WMT_STREAM_SELECTION selections[ARRAY_SIZE(filter->streams)]; WORD stream_numbers[ARRAY_SIZE(filter->streams)]; - IWMReaderAdvanced *reader_advanced; + IWMReaderAdvanced2 *reader_advanced; HRESULT hr = S_OK; int i; TRACE("iface %p\n", iface); - if (FAILED(hr = IWMReader_QueryInterface(filter->reader, &IID_IWMReaderAdvanced, (void **)&reader_advanced))) + if (FAILED(hr = IWMReader_QueryInterface(filter->reader, &IID_IWMReaderAdvanced2, (void **)&reader_advanced))) return hr; for (i = 0; i < filter->stream_count; ++i) @@ -443,7 +443,7 @@ static HRESULT asf_reader_init_stream(struct strmbase_filter *iface) break; } - if (FAILED(hr = IWMReaderAdvanced_SetAllocateForOutput(reader_advanced, i, TRUE))) + if (FAILED(hr = IWMReaderAdvanced2_SetAllocateForOutput(reader_advanced, i, TRUE))) { WARN("Failed to enable allocation for stream %u, hr %#lx\n", i, hr); break; @@ -474,11 +474,11 @@ static HRESULT asf_reader_init_stream(struct strmbase_filter *iface) selections[i] = WMT_ON; } - if (SUCCEEDED(hr) && FAILED(hr = IWMReaderAdvanced_SetStreamsSelected(reader_advanced, + if (SUCCEEDED(hr) && FAILED(hr = IWMReaderAdvanced2_SetStreamsSelected(reader_advanced, filter->stream_count, stream_numbers, selections))) WARN("Failed to set reader %p stream selection, hr %#lx\n", filter->reader, hr); - IWMReaderAdvanced_Release(reader_advanced); + IWMReaderAdvanced2_Release(reader_advanced); if (FAILED(hr)) return hr; From 8a7bca626f6d59a96215f2a5364338413cac7855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 30 Aug 2022 15:44:15 +0200 Subject: [PATCH 0249/2542] qasf: Set the DedicatedDeliveryThread property according to ReceiveCanBlock. CW-Bug-Id: #21147 --- dlls/qasf/asfreader.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/qasf/asfreader.c b/dlls/qasf/asfreader.c index 1e332b1befa4..0abfce644884 100644 --- a/dlls/qasf/asfreader.c +++ b/dlls/qasf/asfreader.c @@ -419,6 +419,7 @@ static HRESULT asf_reader_init_stream(struct strmbase_filter *iface) WORD stream_numbers[ARRAY_SIZE(filter->streams)]; IWMReaderAdvanced2 *reader_advanced; HRESULT hr = S_OK; + BOOL value; int i; TRACE("iface %p\n", iface); @@ -471,6 +472,14 @@ static HRESULT asf_reader_init_stream(struct strmbase_filter *iface) break; } + value = IMemInputPin_ReceiveCanBlock(stream->source.pMemInputPin) == S_OK; + if (FAILED(hr = IWMReaderAdvanced2_SetOutputSetting(reader_advanced, i, L"DedicatedDeliveryThread", + WMT_TYPE_BOOL, (BYTE *)&value, sizeof(value)))) + { + WARN("Failed to set DedicatedDeliveryThread for stream %u, hr %#lx\n", i, hr); + break; + } + selections[i] = WMT_ON; } From a0e3e4e8a5ec94e786e24e948dd8a0641851b02c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 1 Sep 2022 21:04:37 +0200 Subject: [PATCH 0250/2542] qasf: Set user provided clock and time to prevent waits in WMReader. CW-Bug-Id: #21147 --- dlls/qasf/asfreader.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/qasf/asfreader.c b/dlls/qasf/asfreader.c index 0abfce644884..4d5718ae0862 100644 --- a/dlls/qasf/asfreader.c +++ b/dlls/qasf/asfreader.c @@ -487,6 +487,12 @@ static HRESULT asf_reader_init_stream(struct strmbase_filter *iface) filter->stream_count, stream_numbers, selections))) WARN("Failed to set reader %p stream selection, hr %#lx\n", filter->reader, hr); + if (SUCCEEDED(hr) && FAILED(hr = IWMReaderAdvanced2_SetUserProvidedClock(reader_advanced, TRUE))) + WARN("Failed to set user provided clock, hr %#lx\n", hr); + + if (SUCCEEDED(hr) && FAILED(hr = IWMReaderAdvanced2_DeliverTime(reader_advanced, -1))) + WARN("Failed to set user time, hr %#lx\n", hr); + IWMReaderAdvanced2_Release(reader_advanced); if (FAILED(hr)) From 86a9aa23797369e3b200a5af2d6f7695b513a341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 2 Sep 2022 13:23:21 +0200 Subject: [PATCH 0251/2542] qasf: Increase the minimum number of buffers in asf_reader_DecideBufferSize. Required for Sang Froid. CW-Bug-Id: #18799 CW-Bug-Id: #18994 CW-Bug-Id: #20182 CW-Bug-Id: #20905 --- dlls/qasf/asfreader.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/qasf/asfreader.c b/dlls/qasf/asfreader.c index 4d5718ae0862..8deea2e2551a 100644 --- a/dlls/qasf/asfreader.c +++ b/dlls/qasf/asfreader.c @@ -583,7 +583,11 @@ static HRESULT WINAPI asf_reader_DecideBufferSize(struct strmbase_source *iface, buffer_size = format->nAvgBytesPerSec; } - req_props->cBuffers = max(req_props->cBuffers, 1); + if (IsEqualGUID(&stream->source.pin.mt.majortype, &MEDIATYPE_Audio)) + req_props->cBuffers = max(req_props->cBuffers, 50); + else + req_props->cBuffers = max(req_props->cBuffers, 10); + req_props->cbBuffer = max(req_props->cbBuffer, buffer_size); req_props->cbAlign = max(req_props->cbAlign, 1); return IMemAllocator_SetProperties(allocator, req_props, &ret_props); From 6670ae8a1510010c80ba48bb4b1581da3ab21469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 27 May 2022 10:45:33 +0200 Subject: [PATCH 0252/2542] qasf: Implement ASF Reader SourceSeeking interface. CW-Bug-Id: #18799 CW-Bug-Id: #18994 CW-Bug-Id: #20182 CW-Bug-Id: #20905 --- dlls/qasf/asfreader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/qasf/asfreader.c b/dlls/qasf/asfreader.c index 8deea2e2551a..783fa84f5899 100644 --- a/dlls/qasf/asfreader.c +++ b/dlls/qasf/asfreader.c @@ -466,7 +466,7 @@ static HRESULT asf_reader_init_stream(struct strmbase_filter *iface) break; } - if (FAILED(hr = IPin_NewSegment(stream->source.pin.peer, 0, 0, 1))) + if (FAILED(hr = IPin_NewSegment(stream->source.pin.peer, stream->seek.llCurrent, stream->seek.llStop, stream->seek.dRate))) { WARN("Failed to start stream %u new segment, hr %#lx\n", i, hr); break; From f3fe8e6ece4324754277f7de45fccaa1b97ce280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 31 Aug 2022 12:50:21 +0200 Subject: [PATCH 0253/2542] HACK: qasf: Only force user provided time to -1 if no quartz clock is set. This satisfies both Sang Froid intro song which expects the audio stream to fast forward decode by not providing any sync source to the filter, and Space Engineers which expects the filter to respect the system clock timing when decoding its videos. This is likely a hack and there's probably something to do with wmvcore sync clock source to make it match quartz clock. CW-Bug-Id: #21139 --- dlls/qasf/asfreader.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/qasf/asfreader.c b/dlls/qasf/asfreader.c index 783fa84f5899..cf7e892022e1 100644 --- a/dlls/qasf/asfreader.c +++ b/dlls/qasf/asfreader.c @@ -487,11 +487,13 @@ static HRESULT asf_reader_init_stream(struct strmbase_filter *iface) filter->stream_count, stream_numbers, selections))) WARN("Failed to set reader %p stream selection, hr %#lx\n", filter->reader, hr); - if (SUCCEEDED(hr) && FAILED(hr = IWMReaderAdvanced2_SetUserProvidedClock(reader_advanced, TRUE))) + if (SUCCEEDED(hr) && FAILED(hr = IWMReaderAdvanced2_SetUserProvidedClock(reader_advanced, !filter->filter.clock))) WARN("Failed to set user provided clock, hr %#lx\n", hr); - - if (SUCCEEDED(hr) && FAILED(hr = IWMReaderAdvanced2_DeliverTime(reader_advanced, -1))) - WARN("Failed to set user time, hr %#lx\n", hr); + else if (!filter->filter.clock) + { + if (SUCCEEDED(hr) && FAILED(hr = IWMReaderAdvanced2_DeliverTime(reader_advanced, -1))) + WARN("Failed to set user time, hr %#lx\n", hr); + } IWMReaderAdvanced2_Release(reader_advanced); From d365fd58b46174f88239a594ea6daf0db2969088 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Thu, 23 Nov 2023 10:25:57 +0200 Subject: [PATCH 0254/2542] winegstreamer: Support WMA with 5.1 and 7.1 audio. --- dlls/winegstreamer/mfplat.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index 7e332b29eb23..93f787a90402 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -492,6 +492,10 @@ static void mf_media_type_to_wg_format_audio(IMFMediaType *type, const GUID *sub channel_mask = KSAUDIO_SPEAKER_MONO; else if (channels == 2) channel_mask = KSAUDIO_SPEAKER_STEREO; + else if (channels == 6) + channel_mask = KSAUDIO_SPEAKER_5POINT1; + else if (channels == 8) + channel_mask = KSAUDIO_SPEAKER_7POINT1; else { FIXME("Channel mask is not set.\n"); From ca7957d4ab83bd9677f5a48d22c489cb9a992657 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 20 Jan 2023 14:50:38 -0600 Subject: [PATCH 0255/2542] winegstreamer: Implement MFT_MESSAGE_COMMAND_DRAIN for wma decoder. CW-Bug-Id: #21804 CW-Bug-Id: #22299 --- dlls/winegstreamer/wma_decoder.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c index 352d2c6a8e70..ccde829e9889 100644 --- a/dlls/winegstreamer/wma_decoder.c +++ b/dlls/winegstreamer/wma_decoder.c @@ -506,7 +506,18 @@ static HRESULT WINAPI transform_ProcessEvent(IMFTransform *iface, DWORD id, IMFM static HRESULT WINAPI transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_TYPE message, ULONG_PTR param) { - FIXME("iface %p, message %#x, param %p stub!\n", iface, message, (void *)param); + struct wma_decoder *decoder = impl_from_IMFTransform(iface); + + TRACE("iface %p, message %#x, param %p.\n", iface, message, (void *)param); + + if (!decoder->wg_transform) + return MF_E_TRANSFORM_TYPE_NOT_SET; + + if (message == MFT_MESSAGE_COMMAND_DRAIN) + return wg_transform_drain(decoder->wg_transform); + + FIXME("Ignoring message %#x.\n", message); + return S_OK; } From 73c04249ef8c348585ebf4e551308f74fbc28c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 10 May 2024 12:07:07 +0200 Subject: [PATCH 0256/2542] winegstreamer: Support hardware buffer conversion with D3D11 video processor. CW-Bug-Id: #20833 --- dlls/winegstreamer/video_processor.c | 270 ++++++++++++++++++++++++++- 1 file changed, 262 insertions(+), 8 deletions(-) diff --git a/dlls/winegstreamer/video_processor.c b/dlls/winegstreamer/video_processor.c index 3cb2c1a5bc6e..c7f43ec328f7 100644 --- a/dlls/winegstreamer/video_processor.c +++ b/dlls/winegstreamer/video_processor.c @@ -23,6 +23,9 @@ #include "mftransform.h" #include "wmcodecdsp.h" +#include "initguid.h" +#include "d3d11.h" + #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(mfplat); @@ -84,6 +87,7 @@ struct video_processor IMFMediaType *output_type; MFT_OUTPUT_STREAM_INFO output_info; + IMFSample *input_sample; wg_transform_t wg_transform; struct wg_sample_queue *wg_sample_queue; @@ -212,6 +216,237 @@ static HRESULT video_processor_uninit_allocator(struct video_processor *processo return hr; } +static HRESULT video_processor_get_d3d11_resource(IMFSample *sample, ID3D11Resource **resource) +{ + IMFMediaBuffer *buffer; + DWORD count; + HRESULT hr; + + if (FAILED(IMFSample_GetBufferCount(sample, &count)) || count > 1) + return E_FAIL; + + if (SUCCEEDED(hr = IMFSample_GetBufferByIndex(sample, 0, &buffer))) + { + IMFDXGIBuffer *dxgi_buffer; + + if (SUCCEEDED(hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMFDXGIBuffer, (void **)&dxgi_buffer))) + { + hr = IMFDXGIBuffer_GetResource(dxgi_buffer, &IID_ID3D11Resource, (void **)resource); + IMFDXGIBuffer_Release(dxgi_buffer); + } + + IMFMediaBuffer_Release(buffer); + } + + return hr; +} + +static HRESULT get_d3d11_video_device(ID3D11Resource *resource, ID3D11VideoDevice **video_device) +{ + ID3D11Device *device; + HRESULT hr; + + ID3D11Resource_GetDevice(resource, &device); + hr = ID3D11Device_QueryInterface(device, &IID_ID3D11VideoDevice, (void **)video_device); + ID3D11Device_Release(device); + return hr; +} + +static HRESULT get_d3d11_video_context(ID3D11Resource *resource, ID3D11VideoContext **video_context) +{ + ID3D11DeviceContext *context; + ID3D11Device *device; + HRESULT hr; + + ID3D11Resource_GetDevice(resource, &device); + ID3D11Device_GetImmediateContext(device, &context); + hr = ID3D11DeviceContext_QueryInterface(context, &IID_ID3D11VideoContext, (void **)video_context); + ID3D11DeviceContext_Release(context); + ID3D11Device_Release(device); + return hr; +} + +static HRESULT create_video_processor_enumerator(ID3D11Resource *resource, UINT64 input_size, UINT64 output_size, + ID3D11VideoDevice **video_device, ID3D11VideoProcessorEnumerator **enumerator) +{ + D3D11_VIDEO_PROCESSOR_CONTENT_DESC enum_desc = {0}; + HRESULT hr; + + enum_desc.InputFrameFormat = D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE; + enum_desc.InputFrameRate.Denominator = 1; + enum_desc.InputFrameRate.Numerator = 1; + enum_desc.InputWidth = input_size >> 32; + enum_desc.InputHeight = (UINT32)input_size; + enum_desc.OutputFrameRate.Denominator = 1; + enum_desc.OutputFrameRate.Numerator = 1; + enum_desc.OutputWidth = output_size >> 32; + enum_desc.OutputHeight = (UINT32)output_size; + enum_desc.Usage = D3D11_VIDEO_USAGE_PLAYBACK_NORMAL; + + if (FAILED(hr = get_d3d11_video_device(resource, video_device))) + return hr; + if (FAILED(hr = ID3D11VideoDevice_CreateVideoProcessorEnumerator(*video_device, &enum_desc, enumerator))) + { + ID3D11VideoDevice_Release(*video_device); + *video_device = NULL; + } + + return hr; +} + +struct resource_desc +{ + GUID subtype; + UINT64 frame_size; +}; + +static HRESULT init_d3d11_video_processor(const struct resource_desc *input_desc, ID3D11Resource *input, + const struct resource_desc *output_desc, ID3D11Resource *output, ID3D11VideoProcessor **processor, + ID3D11VideoProcessorInputView **input_view, ID3D11VideoProcessorOutputView **output_view) +{ + D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC output_view_desc = {0}; + D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC input_view_desc = {0}; + ID3D11VideoProcessorEnumerator *enumerator; + UINT input_flags = 0, output_flags = 0; + ID3D11VideoDevice *device; + HRESULT hr; + + *processor = NULL; + *input_view = NULL; + *output_view = NULL; + + input_view_desc.FourCC = input_desc->subtype.Data1; + input_view_desc.ViewDimension = D3D11_VPIV_DIMENSION_TEXTURE2D; + input_view_desc.Texture2D.MipSlice = 0; + input_view_desc.Texture2D.ArraySlice = 0; + + output_view_desc.ViewDimension = D3D11_VPOV_DIMENSION_TEXTURE2D; + output_view_desc.Texture2D.MipSlice = 0; + + /* assume input and output have the same device */ + if (FAILED(hr = create_video_processor_enumerator(input, input_desc->frame_size, + output_desc->frame_size, &device, &enumerator))) + return hr; + + if (FAILED(hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(enumerator, + input_desc->subtype.Data1, &input_flags)) + || FAILED(hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(enumerator, + output_desc->subtype.Data1, &output_flags))) + goto failed; + if (!(input_flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT) + || !(output_flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT)) + { + hr = MF_E_INVALIDMEDIATYPE; + goto failed; + } + + if (FAILED(hr = ID3D11VideoDevice_CreateVideoProcessorInputView(device, input, enumerator, + &input_view_desc, input_view))) + goto failed; + if (FAILED(hr = ID3D11VideoDevice_CreateVideoProcessorOutputView(device, output, enumerator, + &output_view_desc, output_view))) + { + ID3D11VideoProcessorInputView_Release(*input_view); + *input_view = NULL; + goto failed; + } + + if (FAILED(hr = ID3D11VideoDevice_CreateVideoProcessor(device, enumerator, 0, processor))) + { + ID3D11VideoProcessorOutputView_Release(*output_view); + *output_view = NULL; + ID3D11VideoProcessorInputView_Release(*input_view); + *input_view = NULL; + goto failed; + } + +failed: + ID3D11VideoProcessorEnumerator_Release(enumerator); + ID3D11VideoDevice_Release(device); + return hr; +} + +static HRESULT video_processor_process_output_d3d11(struct video_processor *processor, + IMFSample *input_sample, IMFSample *output_sample) +{ + D3D11_VIDEO_PROCESSOR_STREAM streams = {0}; + struct resource_desc input_desc, output_desc; + ID3D11VideoProcessorOutputView *output_view; + ID3D11VideoProcessorInputView *input_view; + ID3D11VideoProcessor *video_processor; + ID3D11VideoContext *video_context; + ID3D11Resource *input, *output; + MFVideoArea aperture; + RECT rect = {0}; + LONGLONG time; + DWORD flags; + HRESULT hr; + + if (FAILED(hr = IMFMediaType_GetUINT64(processor->input_type, &MF_MT_FRAME_SIZE, &input_desc.frame_size)) + || FAILED(hr = IMFMediaType_GetGUID(processor->input_type, &MF_MT_SUBTYPE, &input_desc.subtype)) + || FAILED(hr = IMFMediaType_GetUINT64(processor->output_type, &MF_MT_FRAME_SIZE, &output_desc.frame_size)) + || FAILED(hr = IMFMediaType_GetGUID(processor->output_type, &MF_MT_SUBTYPE, &output_desc.subtype))) + return hr; + + if (FAILED(hr = video_processor_get_d3d11_resource(input_sample, &input))) + return hr; + if (FAILED(hr = video_processor_get_d3d11_resource(output_sample, &output))) + { + ID3D11Resource_Release(input); + return hr; + } + + if (FAILED(hr = get_d3d11_video_context(input, &video_context))) + goto failed; + if (FAILED(hr = init_d3d11_video_processor(&input_desc, input, &output_desc, output, + &video_processor, &input_view, &output_view))) + { + ID3D11VideoContext_Release(video_context); + goto failed; + } + + streams.Enable = TRUE; + streams.OutputIndex = 0; + streams.InputFrameOrField = 0; + streams.PastFrames = 0; + streams.FutureFrames = 0; + streams.pInputSurface = input_view; + + if (SUCCEEDED(IMFMediaType_GetBlob(processor->input_type, &MF_MT_MINIMUM_DISPLAY_APERTURE, (BYTE *)&aperture, sizeof(aperture), NULL))) + SetRect(&rect, aperture.OffsetX.value, aperture.OffsetY.value, aperture.OffsetX.value + aperture.Area.cx, + aperture.OffsetY.value + aperture.Area.cy); + else + SetRect(&rect, 0, 0, input_desc.frame_size >> 32, (UINT32)input_desc.frame_size); + ID3D11VideoContext_VideoProcessorSetStreamSourceRect(video_context, video_processor, 0, TRUE, &rect); + + if (SUCCEEDED(IMFMediaType_GetBlob(processor->output_type, &MF_MT_MINIMUM_DISPLAY_APERTURE, (BYTE *)&aperture, sizeof(aperture), NULL))) + SetRect(&rect, aperture.OffsetX.value, aperture.OffsetY.value, aperture.OffsetX.value + aperture.Area.cx, + aperture.OffsetY.value + aperture.Area.cy); + else + SetRect(&rect, 0, 0, output_desc.frame_size >> 32, (UINT32)output_desc.frame_size); + ID3D11VideoContext_VideoProcessorSetStreamDestRect(video_context, video_processor, 0, TRUE, &rect); + + ID3D11VideoContext_VideoProcessorBlt(video_context, video_processor, output_view, 0, 1, &streams); + + IMFSample_CopyAllItems(input_sample, (IMFAttributes *)output_sample); + if (SUCCEEDED(IMFSample_GetSampleDuration(input_sample, &time))) + IMFSample_SetSampleDuration(output_sample, time); + if (SUCCEEDED(IMFSample_GetSampleTime(input_sample, &time))) + IMFSample_SetSampleTime(output_sample, time); + if (SUCCEEDED(IMFSample_GetSampleFlags(input_sample, &flags))) + IMFSample_SetSampleFlags(output_sample, flags); + + ID3D11VideoProcessorOutputView_Release(output_view); + ID3D11VideoProcessorInputView_Release(input_view); + ID3D11VideoProcessor_Release(video_processor); + ID3D11VideoContext_Release(video_context); + +failed: + ID3D11Resource_Release(output); + ID3D11Resource_Release(input); + return hr; +} + static struct video_processor *impl_from_IMFTransform(IMFTransform *iface) { return CONTAINING_RECORD(iface, struct video_processor, IMFTransform_iface); @@ -685,8 +920,12 @@ static HRESULT WINAPI video_processor_ProcessInput(IMFTransform *iface, DWORD id if (!impl->wg_transform) return MF_E_TRANSFORM_TYPE_NOT_SET; + if (impl->input_sample) + return MF_E_NOTACCEPTING; - return wg_transform_push_mf(impl->wg_transform, sample, impl->wg_sample_queue); + impl->input_sample = sample; + IMFSample_AddRef(impl->input_sample); + return S_OK; } static HRESULT WINAPI video_processor_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count, @@ -694,7 +933,7 @@ static HRESULT WINAPI video_processor_ProcessOutput(IMFTransform *iface, DWORD f { struct video_processor *impl = impl_from_IMFTransform(iface); MFT_OUTPUT_STREAM_INFO info; - IMFSample *output_sample; + IMFSample *input_sample, *output_sample; HRESULT hr; TRACE("iface %p, flags %#lx, count %lu, samples %p, status %p.\n", iface, flags, count, samples, status); @@ -709,23 +948,37 @@ static HRESULT WINAPI video_processor_ProcessOutput(IMFTransform *iface, DWORD f if (FAILED(hr = IMFTransform_GetOutputStreamInfo(iface, 0, &info))) return hr; + if (!(input_sample = impl->input_sample)) + return MF_E_TRANSFORM_NEED_MORE_INPUT; + impl->input_sample = NULL; + if (impl->output_info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES) { - if (FAILED(hr = video_processor_init_allocator(impl))) - return hr; - if (FAILED(hr = IMFVideoSampleAllocatorEx_AllocateSample(impl->allocator, &output_sample))) + if (FAILED(hr = video_processor_init_allocator(impl)) + || FAILED(hr = IMFVideoSampleAllocatorEx_AllocateSample(impl->allocator, &output_sample))) + { + IMFSample_Release(input_sample); return hr; + } } else { if (!(output_sample = samples->pSample)) + { + IMFSample_Release(input_sample); return E_INVALIDARG; + } IMFSample_AddRef(output_sample); } - if (FAILED(hr = wg_transform_read_mf(impl->wg_transform, output_sample, info.cbSize, &samples->dwStatus))) - goto done; - wg_sample_queue_flush(impl->wg_sample_queue, false); + if (FAILED(hr = video_processor_process_output_d3d11(impl, input_sample, output_sample))) + { + if (FAILED(hr = wg_transform_push_mf(impl->wg_transform, input_sample, impl->wg_sample_queue))) + goto done; + if (FAILED(hr = wg_transform_read_mf(impl->wg_transform, output_sample, info.cbSize, &samples->dwStatus))) + goto done; + wg_sample_queue_flush(impl->wg_sample_queue, false); + } if (impl->output_info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES) { @@ -735,6 +988,7 @@ static HRESULT WINAPI video_processor_ProcessOutput(IMFTransform *iface, DWORD f done: IMFSample_Release(output_sample); + IMFSample_Release(input_sample); return hr; } From 29633bbaa8d09e3850b0088bb295b8f016ee3a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 11 Sep 2024 18:21:13 +0200 Subject: [PATCH 0257/2542] winegstreamer/video_processor: Support colorspace range in the D3D11 video processor. CW-Bug-Id: #24235 --- dlls/winegstreamer/video_processor.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dlls/winegstreamer/video_processor.c b/dlls/winegstreamer/video_processor.c index c7f43ec328f7..5ecc736718bc 100644 --- a/dlls/winegstreamer/video_processor.c +++ b/dlls/winegstreamer/video_processor.c @@ -369,6 +369,7 @@ static HRESULT init_d3d11_video_processor(const struct resource_desc *input_desc static HRESULT video_processor_process_output_d3d11(struct video_processor *processor, IMFSample *input_sample, IMFSample *output_sample) { + D3D11_VIDEO_PROCESSOR_COLOR_SPACE color_space; D3D11_VIDEO_PROCESSOR_STREAM streams = {0}; struct resource_desc input_desc, output_desc; ID3D11VideoProcessorOutputView *output_view; @@ -379,6 +380,7 @@ static HRESULT video_processor_process_output_d3d11(struct video_processor *proc MFVideoArea aperture; RECT rect = {0}; LONGLONG time; + UINT32 value; DWORD flags; HRESULT hr; @@ -426,6 +428,18 @@ static HRESULT video_processor_process_output_d3d11(struct video_processor *proc SetRect(&rect, 0, 0, output_desc.frame_size >> 32, (UINT32)output_desc.frame_size); ID3D11VideoContext_VideoProcessorSetStreamDestRect(video_context, video_processor, 0, TRUE, &rect); + memset(&color_space, 0, sizeof(color_space)); + if (SUCCEEDED(IMFMediaType_GetUINT32(processor->input_type, &MF_MT_VIDEO_NOMINAL_RANGE, &value))) + color_space.Nominal_Range = value == MFNominalRange_Wide ? D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_16_235 + : D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_0_255; + ID3D11VideoContext_VideoProcessorSetStreamColorSpace(video_context, video_processor, 0, &color_space); + + memset(&color_space, 0, sizeof(color_space)); + if (SUCCEEDED(IMFMediaType_GetUINT32(processor->output_type, &MF_MT_VIDEO_NOMINAL_RANGE, &value))) + color_space.Nominal_Range = value == MFNominalRange_Wide ? D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_16_235 + : D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_0_255; + ID3D11VideoContext_VideoProcessorSetOutputColorSpace(video_context, video_processor, &color_space); + ID3D11VideoContext_VideoProcessorBlt(video_context, video_processor, output_view, 0, 1, &streams); IMFSample_CopyAllItems(input_sample, (IMFAttributes *)output_sample); From f7d01c7f23dab2ab46d2d3dc297683bd11c0ee34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 13 Aug 2024 19:19:33 +0200 Subject: [PATCH 0258/2542] winegstreamer: Avoid using the aperture for padding with the H264 decoder. It can change stream sizes during playback, and the video info aren't updated accordingly. CW-Bug-Id: #20833 --- dlls/winegstreamer/wg_transform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index d1d35197f81f..7fb43bdbc930 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -81,7 +81,7 @@ static void align_video_info_planes(MFVideoInfo *video_info, gsize plane_align, align->padding_right = ((plane_align + 1) - (info->width & plane_align)) & plane_align; align->padding_bottom = ((plane_align + 1) - (info->height & plane_align)) & plane_align; - if (!is_mf_video_area_empty(aperture)) + if (!is_mf_video_area_empty(aperture) && !plane_align) { align->padding_right = max(align->padding_right, video_info->dwWidth - aperture->OffsetX.value - aperture->Area.cx); align->padding_bottom = max(align->padding_bottom, video_info->dwHeight - aperture->OffsetY.value - aperture->Area.cy); From 0304a425fd7832e1692d224388e411ae253a70fe Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Thu, 18 Jul 2024 17:55:53 +1000 Subject: [PATCH 0259/2542] winegstreamer: Remove 'au' alignment for h264. h264parse does not correctly determine 'nal' alignment if this caps is provided. CW-Bug-Id: #23226 CW-Bug-Id: #23425 --- dlls/winegstreamer/wg_format.c | 1 - dlls/winegstreamer/wg_media_type.c | 1 - 2 files changed, 2 deletions(-) diff --git a/dlls/winegstreamer/wg_format.c b/dlls/winegstreamer/wg_format.c index fd8f99c256bc..afbc8eab1371 100644 --- a/dlls/winegstreamer/wg_format.c +++ b/dlls/winegstreamer/wg_format.c @@ -884,7 +884,6 @@ static GstCaps *wg_format_to_caps_video_h264(const struct wg_format *format) if (!(caps = gst_caps_new_empty_simple("video/x-h264"))) return NULL; gst_caps_set_simple(caps, "stream-format", G_TYPE_STRING, "byte-stream", NULL); - gst_caps_set_simple(caps, "alignment", G_TYPE_STRING, "au", NULL); if (format->u.video.width) gst_caps_set_simple(caps, "width", G_TYPE_INT, format->u.video.width, NULL); diff --git a/dlls/winegstreamer/wg_media_type.c b/dlls/winegstreamer/wg_media_type.c index 3e0effcbe660..c26a6518a029 100644 --- a/dlls/winegstreamer/wg_media_type.c +++ b/dlls/winegstreamer/wg_media_type.c @@ -296,7 +296,6 @@ static void init_caps_from_video_h264(GstCaps *caps, const MFVIDEOFORMAT *format gst_structure_remove_field(gst_caps_get_structure(caps, 0), "format"); gst_structure_set_name(gst_caps_get_structure(caps, 0), "video/x-h264"); gst_caps_set_simple(caps, "stream-format", G_TYPE_STRING, "byte-stream", NULL); - gst_caps_set_simple(caps, "alignment", G_TYPE_STRING, "au", NULL); if (format_size > sizeof(*format) && (buffer = gst_buffer_new_and_alloc(format_size - sizeof(*format)))) { From 9cbf94fb0c8d26f9d623216b0fbef631a6cc6b50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 16 Aug 2024 14:22:51 +0200 Subject: [PATCH 0260/2542] winegstreamer/resampler: Use WAVEFORMATEX for input/output media types. CW-Bug-Id: #20833 --- dlls/winegstreamer/resampler.c | 123 ++++++++++++++++----------------- 1 file changed, 60 insertions(+), 63 deletions(-) diff --git a/dlls/winegstreamer/resampler.c b/dlls/winegstreamer/resampler.c index c1ce9897ef1b..38478b22ecc1 100644 --- a/dlls/winegstreamer/resampler.c +++ b/dlls/winegstreamer/resampler.c @@ -45,18 +45,20 @@ struct resampler IUnknown *outer; LONG refcount; - IMFMediaType *input_type; + WAVEFORMATEX *input_format; MFT_INPUT_STREAM_INFO input_info; - IMFMediaType *output_type; + WAVEFORMATEX *output_format; MFT_OUTPUT_STREAM_INFO output_info; wg_transform_t wg_transform; struct wg_sample_queue *wg_sample_queue; }; -static HRESULT try_create_wg_transform(struct resampler *impl) +static HRESULT try_create_wg_transform(struct resampler *impl, WAVEFORMATEX *input_format, WAVEFORMATEX *output_format) { + IMFMediaType *input_type, *output_type; struct wg_transform_attrs attrs = {0}; + HRESULT hr; if (impl->wg_transform) { @@ -64,7 +66,18 @@ static HRESULT try_create_wg_transform(struct resampler *impl) impl->wg_transform = 0; } - return wg_transform_create_mf(impl->input_type, impl->output_type, &attrs, &impl->wg_transform); + if (FAILED(hr = MFCreateAudioMediaType(input_format, (IMFAudioMediaType **)&input_type))) + return hr; + if (FAILED(hr = MFCreateAudioMediaType(output_format, (IMFAudioMediaType **)&output_type))) + { + IMFMediaType_Release(input_type); + return hr; + } + + hr = wg_transform_create_mf(input_type, output_type, &attrs, &impl->wg_transform); + IMFMediaType_Release(input_type); + IMFMediaType_Release(output_type); + return hr; } static inline struct resampler *impl_from_IUnknown(IUnknown *iface) @@ -122,10 +135,10 @@ static ULONG WINAPI unknown_Release(IUnknown *iface) { if (impl->wg_transform) wg_transform_destroy(impl->wg_transform); - if (impl->input_type) - IMFMediaType_Release(impl->input_type); - if (impl->output_type) - IMFMediaType_Release(impl->output_type); + if (impl->input_format) + CoTaskMemFree(impl->input_format); + if (impl->output_format) + CoTaskMemFree(impl->output_format); wg_sample_queue_destroy(impl->wg_sample_queue); free(impl); @@ -191,7 +204,7 @@ static HRESULT WINAPI transform_GetInputStreamInfo(IMFTransform *iface, DWORD id TRACE("iface %p, id %#lx, info %p.\n", iface, id, info); - if (!impl->input_type || !impl->output_type) + if (!impl->input_format || !impl->output_format) { memset(info, 0, sizeof(*info)); return MF_E_TRANSFORM_TYPE_NOT_SET; @@ -207,7 +220,7 @@ static HRESULT WINAPI transform_GetOutputStreamInfo(IMFTransform *iface, DWORD i TRACE("iface %p, id %#lx, info %p.\n", iface, id, info); - if (!impl->input_type || !impl->output_type) + if (!impl->input_format || !impl->output_format) { memset(info, 0, sizeof(*info)); return MF_E_TRANSFORM_TYPE_NOT_SET; @@ -359,34 +372,34 @@ static HRESULT check_media_type(IMFMediaType *type) static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) { struct resampler *impl = impl_from_IMFTransform(iface); - UINT32 block_alignment; + WAVEFORMATEX *format; + UINT32 value; HRESULT hr; TRACE("iface %p, id %#lx, type %p, flags %#lx.\n", iface, id, type, flags); if (FAILED(hr = check_media_type(type))) return hr; - if (FAILED(hr = IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, &block_alignment))) + if (FAILED(hr = IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, &value))) return MF_E_INVALIDMEDIATYPE; if (flags & MFT_SET_TYPE_TEST_ONLY) return S_OK; - if (!impl->input_type && FAILED(hr = MFCreateMediaType(&impl->input_type))) - return hr; - - if (impl->output_type) + if (impl->input_format) { - IMFMediaType_Release(impl->output_type); - impl->output_type = NULL; + CoTaskMemFree(impl->input_format); + impl->input_format = NULL; + } + if (impl->output_format) + { + CoTaskMemFree(impl->output_format); + impl->output_format = NULL; } - if (SUCCEEDED(hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *)impl->input_type))) - impl->input_info.cbSize = block_alignment; - else + if (SUCCEEDED(hr = MFCreateWaveFormatExFromMFMediaType(type, &format, &value, 0))) { - IMFMediaType_Release(impl->input_type); - impl->input_info.cbSize = 0; - impl->input_type = NULL; + impl->input_info.cbSize = format->nBlockAlign; + impl->input_format = format; } return hr; @@ -395,82 +408,66 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) { struct resampler *impl = impl_from_IMFTransform(iface); - UINT32 block_alignment; + WAVEFORMATEX *format; + UINT32 value; HRESULT hr; TRACE("iface %p, id %#lx, type %p, flags %#lx.\n", iface, id, type, flags); - if (!impl->input_type) + if (!impl->input_format) return MF_E_TRANSFORM_TYPE_NOT_SET; if (FAILED(hr = check_media_type(type))) return hr; - if (FAILED(hr = IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, &block_alignment))) + if (FAILED(hr = IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, &value))) return MF_E_INVALIDMEDIATYPE; if (flags & MFT_SET_TYPE_TEST_ONLY) return S_OK; - if (!impl->output_type && FAILED(hr = MFCreateMediaType(&impl->output_type))) - return hr; - - if (FAILED(hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *)impl->output_type))) - goto failed; - - if (FAILED(hr = try_create_wg_transform(impl))) - goto failed; + if (impl->output_format) + { + CoTaskMemFree(impl->output_format); + impl->output_format = NULL; + } - impl->output_info.cbSize = block_alignment; - return hr; + if (SUCCEEDED(hr = MFCreateWaveFormatExFromMFMediaType(type, &format, &value, 0))) + { + if (FAILED(hr = try_create_wg_transform(impl, impl->input_format, format))) + CoTaskMemFree(format); + else + { + impl->output_info.cbSize = format->nBlockAlign; + impl->output_format = format; + } + } -failed: - IMFMediaType_Release(impl->output_type); - impl->output_info.cbSize = 0; - impl->output_type = NULL; return hr; } static HRESULT WINAPI transform_GetInputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type) { struct resampler *impl = impl_from_IMFTransform(iface); - HRESULT hr; TRACE("iface %p, id %#lx, type %p.\n", iface, id, type); if (id != 0) return MF_E_INVALIDSTREAMNUMBER; - - if (!impl->input_type) + if (!impl->input_format) return MF_E_TRANSFORM_TYPE_NOT_SET; - - if (FAILED(hr = MFCreateMediaType(type))) - return hr; - - if (FAILED(hr = IMFMediaType_CopyAllItems(impl->input_type, (IMFAttributes *)*type))) - IMFMediaType_Release(*type); - - return hr; + return MFCreateAudioMediaType(impl->input_format, (IMFAudioMediaType **)type); } static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type) { struct resampler *impl = impl_from_IMFTransform(iface); - HRESULT hr; TRACE("iface %p, id %#lx, type %p.\n", iface, id, type); if (id != 0) return MF_E_INVALIDSTREAMNUMBER; - - if (!impl->output_type) + if (!impl->output_format) return MF_E_TRANSFORM_TYPE_NOT_SET; - - if (FAILED(hr = MFCreateMediaType(type))) - return hr; - - if (FAILED(hr = IMFMediaType_CopyAllItems(impl->output_type, (IMFAttributes *)*type))) - IMFMediaType_Release(*type); - - return hr; + return MFCreateAudioMediaType(impl->output_format, (IMFAudioMediaType **)type); } static HRESULT WINAPI transform_GetInputStatus(IMFTransform *iface, DWORD id, DWORD *flags) From 969f918a9b9902583df0007d566c5da69267012a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 16 Aug 2024 14:22:56 +0200 Subject: [PATCH 0261/2542] winegstreamer/resampler: Recalculate resampler nBlockAlign and avgBytesPerSec values. CW-Bug-Id: #20833 --- dlls/winegstreamer/resampler.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/winegstreamer/resampler.c b/dlls/winegstreamer/resampler.c index 38478b22ecc1..c9c81cde5551 100644 --- a/dlls/winegstreamer/resampler.c +++ b/dlls/winegstreamer/resampler.c @@ -398,6 +398,8 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM if (SUCCEEDED(hr = MFCreateWaveFormatExFromMFMediaType(type, &format, &value, 0))) { + format->nBlockAlign = format->wBitsPerSample * format->nChannels / 8; + format->nAvgBytesPerSec = format->nSamplesPerSec * format->nBlockAlign; impl->input_info.cbSize = format->nBlockAlign; impl->input_format = format; } @@ -432,6 +434,9 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF if (SUCCEEDED(hr = MFCreateWaveFormatExFromMFMediaType(type, &format, &value, 0))) { + format->nBlockAlign = format->wBitsPerSample * format->nChannels / 8; + format->nAvgBytesPerSec = format->nSamplesPerSec * format->nBlockAlign; + if (FAILED(hr = try_create_wg_transform(impl, impl->input_format, format))) CoTaskMemFree(format); else From 561f4b87ddafbc92cc72b089770247c2cca3a2f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 17 Nov 2023 11:13:35 +0100 Subject: [PATCH 0262/2542] winegstreamer: Rename aac_decoder to audio_decoder. CW-Bug-Id: #21953 CW-Bug-Id: #20833 --- dlls/winegstreamer/Makefile.in | 2 +- .../{aac_decoder.c => audio_decoder.c} | 54 +++++++++---------- 2 files changed, 28 insertions(+), 28 deletions(-) rename dlls/winegstreamer/{aac_decoder.c => audio_decoder.c} (91%) diff --git a/dlls/winegstreamer/Makefile.in b/dlls/winegstreamer/Makefile.in index c623b90f8961..74f286580577 100644 --- a/dlls/winegstreamer/Makefile.in +++ b/dlls/winegstreamer/Makefile.in @@ -7,7 +7,7 @@ UNIX_CFLAGS = $(GSTREAMER_CFLAGS) UNIX_LIBS = $(GSTREAMER_LIBS) $(PTHREAD_LIBS) SOURCES = \ - aac_decoder.c \ + audio_decoder.c \ color_convert.c \ main.c \ media-converter/audioconv.c \ diff --git a/dlls/winegstreamer/aac_decoder.c b/dlls/winegstreamer/audio_decoder.c similarity index 91% rename from dlls/winegstreamer/aac_decoder.c rename to dlls/winegstreamer/audio_decoder.c index d8e8246e1ca5..7490362e5b4f 100644 --- a/dlls/winegstreamer/aac_decoder.c +++ b/dlls/winegstreamer/audio_decoder.c @@ -1,4 +1,4 @@ -/* AAC Decoder Transform +/* Audio Decoder Transform * * Copyright 2022 Rémi Bernon for CodeWeavers * @@ -34,7 +34,7 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag); #define NEXT_WAVEFORMATEXTENSIBLE(format) (WAVEFORMATEXTENSIBLE *)((BYTE *)(&(format)->Format + 1) + (format)->Format.cbSize) -static WAVEFORMATEXTENSIBLE const aac_decoder_output_types[] = +static WAVEFORMATEXTENSIBLE const audio_decoder_output_types[] = { {.Format = {.wFormatTag = WAVE_FORMAT_IEEE_FLOAT, .wBitsPerSample = 32, .nSamplesPerSec = 48000, .nChannels = 2, .cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)}}, @@ -53,7 +53,7 @@ static const UINT32 default_channel_mask[7] = KSAUDIO_SPEAKER_5POINT1, }; -struct aac_decoder +struct audio_decoder { IMFTransform IMFTransform_iface; LONG refcount; @@ -68,12 +68,12 @@ struct aac_decoder struct wg_sample_queue *wg_sample_queue; }; -static struct aac_decoder *impl_from_IMFTransform(IMFTransform *iface) +static struct audio_decoder *impl_from_IMFTransform(IMFTransform *iface) { - return CONTAINING_RECORD(iface, struct aac_decoder, IMFTransform_iface); + return CONTAINING_RECORD(iface, struct audio_decoder, IMFTransform_iface); } -static HRESULT try_create_wg_transform(struct aac_decoder *decoder) +static HRESULT try_create_wg_transform(struct audio_decoder *decoder) { struct wg_transform_attrs attrs = {0}; @@ -88,7 +88,7 @@ static HRESULT try_create_wg_transform(struct aac_decoder *decoder) static HRESULT WINAPI transform_QueryInterface(IMFTransform *iface, REFIID iid, void **out) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); @@ -107,7 +107,7 @@ static HRESULT WINAPI transform_QueryInterface(IMFTransform *iface, REFIID iid, static ULONG WINAPI transform_AddRef(IMFTransform *iface) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); ULONG refcount = InterlockedIncrement(&decoder->refcount); TRACE("iface %p increasing refcount to %lu.\n", decoder, refcount); return refcount; @@ -115,7 +115,7 @@ static ULONG WINAPI transform_AddRef(IMFTransform *iface) static ULONG WINAPI transform_Release(IMFTransform *iface) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); ULONG refcount = InterlockedDecrement(&decoder->refcount); TRACE("iface %p decreasing refcount to %lu.\n", decoder, refcount); @@ -220,7 +220,7 @@ static HRESULT WINAPI transform_AddInputStreams(IMFTransform *iface, DWORD strea static HRESULT WINAPI transform_GetInputAvailableType(IMFTransform *iface, DWORD id, DWORD index, IMFMediaType **type) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); const WAVEFORMATEXTENSIBLE *format = decoder->input_types; UINT count = decoder->input_type_count; @@ -237,7 +237,7 @@ static HRESULT WINAPI transform_GetInputAvailableType(IMFTransform *iface, DWORD static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWORD id, DWORD index, IMFMediaType **type) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); UINT32 channel_count, sample_rate; WAVEFORMATEXTENSIBLE wfx = {{0}}; IMFMediaType *media_type; @@ -252,7 +252,7 @@ static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWOR if (!decoder->input_type) return MF_E_TRANSFORM_TYPE_NOT_SET; - wfx = aac_decoder_output_types[index % ARRAY_SIZE(aac_decoder_output_types)]; + wfx = audio_decoder_output_types[index % ARRAY_SIZE(audio_decoder_output_types)]; if (FAILED(hr = IMFMediaType_GetUINT32(decoder->input_type, &MF_MT_AUDIO_NUM_CHANNELS, &channel_count)) || !channel_count) @@ -263,15 +263,15 @@ static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWOR if (channel_count >= ARRAY_SIZE(default_channel_mask)) return MF_E_INVALIDMEDIATYPE; - if (channel_count > 2 && index >= ARRAY_SIZE(aac_decoder_output_types)) + if (channel_count > 2 && index >= ARRAY_SIZE(audio_decoder_output_types)) { /* If there are more than two channels in the input type GetOutputAvailableType additionally lists * types with 2 channels. */ - index -= ARRAY_SIZE(aac_decoder_output_types); + index -= ARRAY_SIZE(audio_decoder_output_types); channel_count = 2; } - if (index >= ARRAY_SIZE(aac_decoder_output_types)) + if (index >= ARRAY_SIZE(audio_decoder_output_types)) return MF_E_NO_MORE_TYPES; wfx.Format.nChannels = channel_count; @@ -314,7 +314,7 @@ static BOOL matches_format(const WAVEFORMATEXTENSIBLE *a, const WAVEFORMATEXTENS static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); UINT32 size, count = decoder->input_type_count; WAVEFORMATEXTENSIBLE *format, wfx; HRESULT hr; @@ -375,7 +375,7 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); WAVEFORMATEXTENSIBLE *format, wfx; UINT32 size; HRESULT hr; @@ -411,10 +411,10 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF wfx = *format; CoTaskMemFree(format); - for (i = 0; i < ARRAY_SIZE(aac_decoder_output_types); ++i) - if (matches_format(&aac_decoder_output_types[i], &wfx)) + for (i = 0; i < ARRAY_SIZE(audio_decoder_output_types); ++i) + if (matches_format(&audio_decoder_output_types[i], &wfx)) break; - if (i == ARRAY_SIZE(aac_decoder_output_types)) + if (i == ARRAY_SIZE(audio_decoder_output_types)) return MF_E_INVALIDMEDIATYPE; if (!wfx.Format.wBitsPerSample || !wfx.Format.nChannels || !wfx.Format.nSamplesPerSec) @@ -441,7 +441,7 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF static HRESULT WINAPI transform_GetInputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **out) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); IMFMediaType *type; HRESULT hr; @@ -463,7 +463,7 @@ static HRESULT WINAPI transform_GetInputCurrentType(IMFTransform *iface, DWORD i static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **out) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); IMFMediaType *type; HRESULT hr; @@ -485,7 +485,7 @@ static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD static HRESULT WINAPI transform_GetInputStatus(IMFTransform *iface, DWORD id, DWORD *flags) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); bool accepts_input; TRACE("iface %p, id %#lx, flags %p.\n", iface, id, flags); @@ -526,7 +526,7 @@ static HRESULT WINAPI transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_ static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); TRACE("iface %p, id %#lx, sample %p, flags %#lx.\n", iface, id, sample, flags); @@ -539,7 +539,7 @@ static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFS static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count, MFT_OUTPUT_DATA_BUFFER *samples, DWORD *status) { - struct aac_decoder *decoder = impl_from_IMFTransform(iface); + struct audio_decoder *decoder = impl_from_IMFTransform(iface); MFT_OUTPUT_STREAM_INFO info; HRESULT hr; @@ -615,12 +615,12 @@ static HEAACWAVEINFO aac_decoder_input_types[] = HRESULT aac_decoder_create(REFIID riid, void **ret) { - struct aac_decoder *decoder; + struct audio_decoder *decoder; HRESULT hr; TRACE("riid %s, ret %p.\n", debugstr_guid(riid), ret); - if (FAILED(hr = check_audio_transform_support(&aac_decoder_input_types[0].wfx, &aac_decoder_output_types[0].Format))) + if (FAILED(hr = check_audio_transform_support(&aac_decoder_input_types[0].wfx, &audio_decoder_output_types[0].Format))) { ERR_(winediag)("GStreamer doesn't support AAC decoding, please install appropriate plugins\n"); return hr; From 208fbbf5d3a8e289f5a35a65d08abda05089d150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 22 May 2024 14:56:04 +0200 Subject: [PATCH 0263/2542] winegstreamer: Implement drain and flush for the audio decoder. CW-Bug-Id: #20833 --- dlls/winegstreamer/audio_decoder.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/dlls/winegstreamer/audio_decoder.c b/dlls/winegstreamer/audio_decoder.c index 7490362e5b4f..498540587eed 100644 --- a/dlls/winegstreamer/audio_decoder.c +++ b/dlls/winegstreamer/audio_decoder.c @@ -520,8 +520,22 @@ static HRESULT WINAPI transform_ProcessEvent(IMFTransform *iface, DWORD id, IMFM static HRESULT WINAPI transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_TYPE message, ULONG_PTR param) { - FIXME("iface %p, message %#x, param %p stub!\n", iface, message, (void *)param); - return S_OK; + struct audio_decoder *decoder = impl_from_IMFTransform(iface); + + TRACE("iface %p, message %#x, param %Ix.\n", iface, message, param); + + switch (message) + { + case MFT_MESSAGE_COMMAND_DRAIN: + return wg_transform_drain(decoder->wg_transform); + + case MFT_MESSAGE_COMMAND_FLUSH: + return wg_transform_flush(decoder->wg_transform); + + default: + FIXME("Ignoring message %#x.\n", message); + return S_OK; + } } static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags) From 722233dd495b57e657655feb62c98bf6a0250156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 19 Jun 2024 14:23:20 +0200 Subject: [PATCH 0264/2542] winegstreamer/audio_decoder: Fill output block align and bytes per second if not set. Fixes audio in Halo Infinite as well, as we're propagating upstream block align from the AAC media type, which isn't right for the decoded media type. This breaks a couple of aacdec tests, though in a harmless way: no additional information should be added to the output media type when it is read back. We could just do that internally or flag the tests todo. CW-Bug-Id: #20833 CW-Bug-Id: #24641 --- dlls/winegstreamer/audio_decoder.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dlls/winegstreamer/audio_decoder.c b/dlls/winegstreamer/audio_decoder.c index 498540587eed..02ff0b8309f8 100644 --- a/dlls/winegstreamer/audio_decoder.c +++ b/dlls/winegstreamer/audio_decoder.c @@ -422,10 +422,15 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF if (flags & MFT_SET_TYPE_TEST_ONLY) return S_OK; - if (!decoder->output_type && FAILED(hr = MFCreateMediaType(&decoder->output_type))) - return hr; + wfx.Format.nBlockAlign = wfx.Format.wBitsPerSample * wfx.Format.nChannels / 8; + wfx.Format.nAvgBytesPerSec = wfx.Format.nBlockAlign * wfx.Format.nSamplesPerSec; - if (FAILED(hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *)decoder->output_type))) + if (decoder->output_type) + { + IMFMediaType_Release(decoder->output_type); + decoder->output_type = NULL; + } + if (FAILED(hr = MFCreateAudioMediaType(&wfx.Format, (IMFAudioMediaType **)&decoder->output_type))) return hr; if (FAILED(hr = try_create_wg_transform(decoder))) From 205ee933ef27a8cb64eb0815d81c72c61cb2b7dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 5 Dec 2024 23:36:09 +0100 Subject: [PATCH 0265/2542] HACK: winegstreamer/wg_transform: Implement vorbis decoder support. --- dlls/winegstreamer/wg_media_type.c | 13 ++++++ dlls/winegstreamer/wg_transform.c | 71 ++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) diff --git a/dlls/winegstreamer/wg_media_type.c b/dlls/winegstreamer/wg_media_type.c index c26a6518a029..9e204567b8b6 100644 --- a/dlls/winegstreamer/wg_media_type.c +++ b/dlls/winegstreamer/wg_media_type.c @@ -163,6 +163,17 @@ static void init_caps_from_wave_format_wma3(GstCaps *caps, const WMAUDIO3WAVEFOR gst_caps_set_simple(caps, "bitrate", G_TYPE_INT, format->wfx.nAvgBytesPerSec * 8, NULL); } +static void init_caps_from_wave_format_vorbis(GstCaps *caps, const WAVEFORMATEX *format, UINT32 format_size) +{ + init_caps_codec_data(caps, format + 1, format->cbSize); + + gst_structure_remove_field(gst_caps_get_structure(caps, 0), "format"); + gst_structure_set_name(gst_caps_get_structure(caps, 0), "audio/x-vorbis"); + gst_caps_set_simple(caps, "block_align", G_TYPE_INT, format->nBlockAlign, NULL); + gst_caps_set_simple(caps, "depth", G_TYPE_INT, format->wBitsPerSample, NULL); + gst_caps_set_simple(caps, "bitrate", G_TYPE_INT, format->nAvgBytesPerSec * 8, NULL); +} + static void init_caps_from_wave_format(GstCaps *caps, const GUID *subtype, const void *format, UINT32 format_size) { @@ -182,6 +193,8 @@ static void init_caps_from_wave_format(GstCaps *caps, const GUID *subtype, return init_caps_from_wave_format_wma3(caps, format, format_size, 3); if (IsEqualGUID(subtype, &MFAudioFormat_WMAudio_Lossless)) return init_caps_from_wave_format_wma3(caps, format, format_size, 4); + if (IsEqualGUID(subtype, &MFAudioFormat_Vorbis)) + return init_caps_from_wave_format_vorbis(caps, format, format_size); GST_FIXME("Unsupported subtype " WG_GUID_FORMAT, WG_GUID_ARGS(*subtype)); } diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index 7fb43bdbc930..18a6599f7b9e 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -470,6 +470,74 @@ static GstCaps *transform_get_parsed_caps(GstCaps *caps, const char *media_type) return parsed_caps; } +static GstBuffer *caps_get_buffer(const GstCaps *caps, const char *name, UINT32 *buffer_size) +{ + const GstStructure *structure = gst_caps_get_structure(caps, 0); + const GValue *buffer_value; + + if ((buffer_value = gst_structure_get_value(structure, name))) + { + GstBuffer *buffer = gst_value_get_buffer(buffer_value); + *buffer_size = gst_buffer_get_size(buffer); + return buffer; + } + + *buffer_size = 0; + return NULL; +} + +static void push_vorbis_headers(struct wg_transform *transform) +{ + const uint8_t *ptr, *beg, *end; + GstBuffer *codec_data, *hdr; + UINT32 codec_data_size; + GstBufferMapInfo info; + int i, count, len; + + if (!(codec_data = caps_get_buffer(transform->input_caps, "codec_data", + &codec_data_size)) || !codec_data_size) return; + gst_buffer_map(codec_data, &info, GST_MAP_READ); + ptr = info.data; + end = ptr + info.size; + + for (len = 0, i = 0, count = *ptr++; ptr < end && i < count; i++) + { + while (ptr < end && *ptr++ == 0xff) len += 0xff; + len += ptr[-1]; + GST_DEBUG("buffer %d: %u bytes", i, len); + } + if (len > end - ptr) goto failed; + beg = ptr; + ptr = info.data; + + GST_DEBUG("%u stream headers, total length=%u bytes", count + 1, codec_data_size); + for (len = 0, i = 0, count = *ptr++; ptr < end && i < count; i++, len = 0) + { + while (ptr < end && *ptr++ == 0xff) len += 0xff; + len += ptr[-1]; + + if (!(hdr = gst_buffer_new_memdup(beg, len))) break; + GST_DEBUG("buffer %d: %u bytes", i, len); + GST_BUFFER_FLAG_SET(hdr, GST_BUFFER_FLAG_HEADER); + GST_MEMDUMP("data", beg, len); + gst_pad_push(transform->my_src, hdr); + beg += len; + } + + if ((hdr = gst_buffer_new_memdup(beg, end - beg))) + { + GST_DEBUG("buffer %d: %zu bytes", i, end - beg); + GST_MEMDUMP("data", beg, end - beg); + GST_BUFFER_FLAG_SET(hdr, GST_BUFFER_FLAG_HEADER); + gst_pad_push(transform->my_src, hdr); + } + +failed: + gst_buffer_unmap(codec_data, &info); + gst_buffer_unref(codec_data); +} + + static bool transform_create_decoder_elements(struct wg_transform *transform, const gchar *input_mime, const gchar *output_mime, GstElement **first, GstElement **last) { @@ -682,6 +750,9 @@ NTSTATUS wg_transform_create(void *args) || !push_event(transform->my_src, event)) goto out; + if (!strcmp(input_mime, "audio/x-vorbis")) + push_vorbis_headers(transform); + GST_INFO("Created winegstreamer transform %p.", transform); params->transform = (wg_transform_t)(ULONG_PTR)transform; return STATUS_SUCCESS; From a3feeabebeb010229a6377fb81bdb4c823366fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 5 Dec 2024 23:36:09 +0100 Subject: [PATCH 0266/2542] HACK: winegstreamer/audio_decoder: Expose a vorbis audio decoder. --- dlls/winegstreamer/audio_decoder.c | 33 ++++++++++++++++++++ dlls/winegstreamer/gst_private.h | 1 + dlls/winegstreamer/mfplat.c | 2 ++ dlls/winegstreamer/winegstreamer_classes.idl | 6 ++++ 4 files changed, 42 insertions(+) diff --git a/dlls/winegstreamer/audio_decoder.c b/dlls/winegstreamer/audio_decoder.c index 02ff0b8309f8..a675ef84f35e 100644 --- a/dlls/winegstreamer/audio_decoder.c +++ b/dlls/winegstreamer/audio_decoder.c @@ -663,3 +663,36 @@ HRESULT aac_decoder_create(REFIID riid, void **ret) TRACE("Created decoder %p\n", *ret); return S_OK; } + +static WAVEFORMATEXTENSIBLE audio_decoder_input_types[] = +{ + {.Format = {.wFormatTag = WAVE_FORMAT_EXTENSIBLE, .nChannels = 6, .nSamplesPerSec = 48000, .nAvgBytesPerSec = 1152000, \ + .nBlockAlign = 24, .wBitsPerSample = 32, .cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)}, \ + .SubFormat = {0x8d2fd10b,0x5841,0x4a6b,{0x89,0x05,0x58,0x8f,0xec,0x1a,0xde,0xd9}}}, +}; + +HRESULT audio_decoder_create(REFIID riid, void **ret) +{ + struct audio_decoder *decoder; + HRESULT hr; + + TRACE("riid %s, ret %p.\n", debugstr_guid(riid), ret); + + if (!(decoder = calloc(1, sizeof(*decoder)))) + return E_OUTOFMEMORY; + decoder->input_types = (WAVEFORMATEXTENSIBLE *)audio_decoder_input_types; + decoder->input_type_count = ARRAY_SIZE(audio_decoder_input_types); + + if (FAILED(hr = wg_sample_queue_create(&decoder->wg_sample_queue))) + { + free(decoder); + return hr; + } + + decoder->IMFTransform_iface.lpVtbl = &transform_vtbl; + decoder->refcount = 1; + + *ret = &decoder->IMFTransform_iface; + TRACE("Created decoder %p\n", *ret); + return S_OK; +} diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 9db484c033fb..f9f0048bbe1a 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -183,6 +183,7 @@ unsigned int wg_format_get_stride(const struct wg_format *format); bool wg_video_format_is_rgb(enum wg_video_format format); +HRESULT audio_decoder_create(REFIID riid, void **ret); HRESULT aac_decoder_create(REFIID riid, void **ret); HRESULT h264_decoder_create(REFIID riid, void **ret); HRESULT video_processor_create(REFIID riid, void **ret); diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index 93f787a90402..35777a552f9a 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -121,6 +121,7 @@ static const IClassFactoryVtbl class_factory_vtbl = class_factory_LockServer, }; +static const GUID CLSID_GStreamerAudioDecoder = {0x480b1517, 0xc8e9, 0x4eae, {0xb0, 0x06, 0xe6, 0x30, 0x07, 0x18, 0xd8, 0x5d}}; static const GUID CLSID_GStreamerByteStreamHandler = {0x317df618, 0x5e5a, 0x468a, {0x9f, 0x15, 0xd8, 0x27, 0xa9, 0xa0, 0x81, 0x62}}; static const GUID CLSID_wg_video_processor = {0xd527607f,0x89cb,0x4e94,{0x95,0x71,0xbc,0xfe,0x62,0x17,0x56,0x13}}; static const GUID CLSID_wg_aac_decoder = {0xe7889a8a,0x2083,0x4844,{0x83,0x70,0x5e,0xe3,0x49,0xb1,0x45,0x03}}; @@ -135,6 +136,7 @@ static const struct class_object class_objects[] = { { &CLSID_wg_video_processor, &video_processor_create }, + { &CLSID_GStreamerAudioDecoder, &audio_decoder_create }, { &CLSID_GStreamerByteStreamHandler, &gstreamer_byte_stream_handler_create }, { &CLSID_wg_aac_decoder, &aac_decoder_create }, { &CLSID_wg_h264_decoder, &h264_decoder_create }, diff --git a/dlls/winegstreamer/winegstreamer_classes.idl b/dlls/winegstreamer/winegstreamer_classes.idl index bb9f81c23411..d435ea68232a 100644 --- a/dlls/winegstreamer/winegstreamer_classes.idl +++ b/dlls/winegstreamer/winegstreamer_classes.idl @@ -77,6 +77,12 @@ coclass wg_video_processor {} ] coclass GStreamerByteStreamHandler {} +[ + threading(both), + uuid(480b1517-c8e9-4eae-b006-e6300718d85d) +] +coclass GStreamerAudioDecoder {} + [ threading(both), uuid(5b4d4e54-0620-4cf9-94ae-7823965c28b6) From 22d8bc2c8028baf68e313834f4caed9fc916704c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 5 Dec 2024 23:36:09 +0100 Subject: [PATCH 0267/2542] HACK: msauddecmft: Expose a vorbis audio decoder. --- dlls/msauddecmft/msauddecmft.c | 37 ++++++++++++++++++++++++++++++++ dlls/msauddecmft/msauddecmft.idl | 6 ++++++ 2 files changed, 43 insertions(+) diff --git a/dlls/msauddecmft/msauddecmft.c b/dlls/msauddecmft/msauddecmft.c index 813d81387b51..dd6f91fe5b64 100644 --- a/dlls/msauddecmft/msauddecmft.c +++ b/dlls/msauddecmft/msauddecmft.c @@ -34,6 +34,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmo); #include "initguid.h" DEFINE_MEDIATYPE_GUID(MFAudioFormat_RAW_AAC,WAVE_FORMAT_RAW_AAC1); +static const GUID CLSID_WineAudioDecoder = {0x480b1517,0xc8e9,0x4eaf,{0xb0,0x06,0xe6,0x30,0x07,0x18,0xd8,0x5d}}; + +static HRESULT WINAPI audio_decoder_factory_CreateInstance(IClassFactory *iface, IUnknown *outer, + REFIID riid, void **out) +{ + static const GUID CLSID_GStreamerAudioDecoder = {0x480b1517,0xc8e9,0x4eae,{0xb0,0x06,0xe6,0x30,0x07,0x18,0xd8,0x5d}}; + return CoCreateInstance(&CLSID_GStreamerAudioDecoder, outer, CLSCTX_INPROC_SERVER, riid, out); +} static HRESULT WINAPI aac_decoder_factory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **out) @@ -71,6 +79,17 @@ static const IClassFactoryVtbl aac_decoder_factory_vtbl = static IClassFactory aac_decoder_factory = {&aac_decoder_factory_vtbl}; +static const IClassFactoryVtbl audio_decoder_factory_vtbl = +{ + class_factory_QueryInterface, + class_factory_AddRef, + class_factory_Release, + audio_decoder_factory_CreateInstance, + class_factory_LockServer, +}; + +static IClassFactory audio_decoder_factory = {&audio_decoder_factory_vtbl}; + /*********************************************************************** * DllGetClassObject (msauddecmft.@) */ @@ -78,6 +97,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out) { if (IsEqualGUID(clsid, &CLSID_MSAACDecMFT)) return IClassFactory_QueryInterface(&aac_decoder_factory, riid, out); + if (IsEqualGUID(clsid, &CLSID_WineAudioDecoder)) + return IClassFactory_QueryInterface(&audio_decoder_factory, riid, out); *out = NULL; FIXME("Unknown clsid %s.\n", debugstr_guid(clsid)); @@ -100,6 +121,15 @@ HRESULT WINAPI DllRegisterServer(void) {MFMediaType_Audio, MFAudioFormat_Float}, {MFMediaType_Audio, MFAudioFormat_PCM}, }; + MFT_REGISTER_TYPE_INFO audio_decoder_mft_inputs[] = + { + {MFMediaType_Audio, MFAudioFormat_Vorbis}, + }; + MFT_REGISTER_TYPE_INFO audio_decoder_mft_outputs[] = + { + {MFMediaType_Audio, MFAudioFormat_Float}, + {MFMediaType_Audio, MFAudioFormat_PCM}, + }; HRESULT hr; TRACE("\n"); @@ -111,6 +141,11 @@ HRESULT WINAPI DllRegisterServer(void) ARRAY_SIZE(aac_decoder_mft_inputs), aac_decoder_mft_inputs, ARRAY_SIZE(aac_decoder_mft_outputs), aac_decoder_mft_outputs, NULL))) return hr; + if (FAILED(hr = MFTRegister(CLSID_WineAudioDecoder, MFT_CATEGORY_AUDIO_DECODER, + (WCHAR *)L"Wine Audio Decoder", MFT_ENUM_FLAG_SYNCMFT, + ARRAY_SIZE(audio_decoder_mft_inputs), audio_decoder_mft_inputs, + ARRAY_SIZE(audio_decoder_mft_outputs), audio_decoder_mft_outputs, NULL))) + return hr; return S_OK; } @@ -128,6 +163,8 @@ HRESULT WINAPI DllUnregisterServer(void) return hr; if (FAILED(hr = MFTUnregister(CLSID_MSAACDecMFT))) return hr; + if (FAILED(hr = MFTUnregister(CLSID_WineAudioDecoder))) + return hr; return S_OK; } diff --git a/dlls/msauddecmft/msauddecmft.idl b/dlls/msauddecmft/msauddecmft.idl index f1b2a62a2d24..1aba2baf7b13 100644 --- a/dlls/msauddecmft/msauddecmft.idl +++ b/dlls/msauddecmft/msauddecmft.idl @@ -23,3 +23,9 @@ uuid(32d186a7-218f-4c75-8876-dd77273a8999) ] coclass CMSAACDecMFT {} + +[ + threading(both), + uuid(480b1517-c8e9-4eaf-b006-e6300718d85d) +] +coclass WineAudioDecoder {} From 39148a9f343e2f8f1a84c262994ba45f227a0d63 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Mon, 12 Dec 2022 05:41:47 +0200 Subject: [PATCH 0268/2542] configure: Check for sys/eventfd.h, ppoll(), and shm_open(). We use ppoll() instead of poll() for the better time granularity. Although perhaps we shouldn't since the server doesn't do this. Wine-Staging: eventfd_synchronization --- configure.ac | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure.ac b/configure.ac index 2e477c2b8f43..992c41b3a22c 100644 --- a/configure.ac +++ b/configure.ac @@ -411,6 +411,7 @@ AC_CHECK_HEADERS(\ sys/cdio.h \ sys/epoll.h \ sys/event.h \ + sys/eventfd.h \ sys/extattr.h \ sys/filio.h \ sys/ipc.h \ @@ -2080,6 +2081,7 @@ AC_CHECK_FUNCS(\ port_create \ posix_fadvise \ posix_fallocate \ + ppoll \ prctl \ sched_getcpu \ sched_yield \ @@ -2099,6 +2101,12 @@ AC_SEARCH_LIBS(clock_gettime, rt, test "$ac_res" = "none required" || AC_SUBST(RT_LIBS,"$ac_res")]) LIBS=$ac_save_LIBS +ac_save_LIBS=$LIBS +AC_SEARCH_LIBS(shm_open, rt, + [AC_DEFINE(HAVE_SHM_OPEN, 1, [Define to 1 if you have the `shm_open' function.]) + test "$ac_res" = "none required" || AC_SUBST(RT_LIBS,"$ac_res")]) +LIBS=$ac_save_LIBS + AC_CACHE_CHECK([for sched_setaffinity],wine_cv_have_sched_setaffinity, AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include ]], [[sched_setaffinity(0, 0, 0);]])],[wine_cv_have_sched_setaffinity=yes],[wine_cv_have_sched_setaffinity=no])) From d8bed4caee2bad7ab3a11eaaf403bbf067ee548a Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 7 Jun 2018 20:09:59 -0500 Subject: [PATCH 0269/2542] server: Create server objects for eventfd-based synchronization objects. Wine-Staging: eventfd_synchronization --- server/Makefile.in | 1 + server/esync.c | 318 ++++++++++++++++++++++++++++++++++++++++++++ server/esync.h | 24 ++++ server/main.c | 4 + server/protocol.def | 25 +++- 5 files changed, 371 insertions(+), 1 deletion(-) create mode 100644 server/esync.c create mode 100644 server/esync.h diff --git a/server/Makefile.in b/server/Makefile.in index 7e571ac2ba64..9632c4e694fe 100644 --- a/server/Makefile.in +++ b/server/Makefile.in @@ -11,6 +11,7 @@ SOURCES = \ debugger.c \ device.c \ directory.c \ + esync.c \ event.c \ fd.c \ file.c \ diff --git a/server/esync.c b/server/esync.c new file mode 100644 index 000000000000..35b4833fd4ca --- /dev/null +++ b/server/esync.c @@ -0,0 +1,318 @@ +/* + * eventfd-based synchronization objects + * + * Copyright (C) 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" + + +#include +#include +#include +#ifdef HAVE_SYS_EVENTFD_H +# include +#endif +#include +#ifdef HAVE_SYS_STAT_H +# include +#endif +#include + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winternl.h" + +#include "handle.h" +#include "request.h" +#include "file.h" + +int do_esync(void) +{ +#ifdef HAVE_SYS_EVENTFD_H + static int do_esync_cached = -1; + + if (do_esync_cached == -1) + do_esync_cached = getenv("WINEESYNC") && atoi(getenv("WINEESYNC")); + + return do_esync_cached; +#else + return 0; +#endif +} + +static char shm_name[29]; +static int shm_fd; +static off_t shm_size; +static void **shm_addrs; +static int shm_addrs_size; /* length of the allocated shm_addrs array */ +static long pagesize; + +static void shm_cleanup(void) +{ + close( shm_fd ); + if (shm_unlink( shm_name ) == -1) + perror( "shm_unlink" ); +} + +void esync_init(void) +{ + struct stat st; + + if (fstat( config_dir_fd, &st ) == -1) + fatal_error( "cannot stat config dir\n" ); + + if (st.st_ino != (unsigned long)st.st_ino) + sprintf( shm_name, "/wine-%lx%08lx-esync", (unsigned long)((unsigned long long)st.st_ino >> 32), (unsigned long)st.st_ino ); + else + sprintf( shm_name, "/wine-%lx-esync", (unsigned long)st.st_ino ); + + shm_unlink( shm_name ); + + shm_fd = shm_open( shm_name, O_RDWR | O_CREAT | O_EXCL, 0644 ); + if (shm_fd == -1) + perror( "shm_open" ); + + pagesize = sysconf( _SC_PAGESIZE ); + + shm_addrs = calloc( 128, sizeof(shm_addrs[0]) ); + shm_addrs_size = 128; + + shm_size = pagesize; + if (ftruncate( shm_fd, shm_size ) == -1) + perror( "ftruncate" ); + + fprintf( stderr, "esync: up and running.\n" ); + + atexit( shm_cleanup ); +} + +struct esync +{ + struct object obj; /* object header */ + int fd; /* eventfd file descriptor */ + enum esync_type type; + unsigned int shm_idx; /* index into the shared memory section */ +}; + +static void esync_dump( struct object *obj, int verbose ); +static void esync_destroy( struct object *obj ); + +static const struct object_ops esync_ops = +{ + sizeof(struct esync), /* size */ + &no_type, /* type */ + esync_dump, /* dump */ + no_add_queue, /* add_queue */ + NULL, /* remove_queue */ + NULL, /* signaled */ + NULL, /* satisfied */ + no_signal, /* signal */ + no_get_fd, /* get_fd */ + default_map_access, /* map_access */ + default_get_sd, /* get_sd */ + default_set_sd, /* set_sd */ + default_get_full_name, /* get_full_name */ + no_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ + no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_close_handle, /* close_handle */ + esync_destroy /* destroy */ +}; + +static void esync_dump( struct object *obj, int verbose ) +{ + struct esync *esync = (struct esync *)obj; + assert( obj->ops == &esync_ops ); + fprintf( stderr, "esync fd=%d\n", esync->fd ); +} + +static void esync_destroy( struct object *obj ) +{ + struct esync *esync = (struct esync *)obj; + close( esync->fd ); +} + +static int type_matches( enum esync_type type1, enum esync_type type2 ) +{ + return (type1 == type2) || + ((type1 == ESYNC_AUTO_EVENT || type1 == ESYNC_MANUAL_EVENT) && + (type2 == ESYNC_AUTO_EVENT || type2 == ESYNC_MANUAL_EVENT)); +} + +static void *get_shm( unsigned int idx ) +{ + int entry = (idx * 8) / pagesize; + int offset = (idx * 8) % pagesize; + + if (entry >= shm_addrs_size) + { + int new_size = max(shm_addrs_size * 2, entry + 1); + + if (!(shm_addrs = realloc( shm_addrs, new_size * sizeof(shm_addrs[0]) ))) + fprintf( stderr, "esync: couldn't expand shm_addrs array to size %d\n", entry + 1 ); + + memset( shm_addrs + shm_addrs_size, 0, (new_size - shm_addrs_size) * sizeof(shm_addrs[0]) ); + + shm_addrs_size = new_size; + } + + if (!shm_addrs[entry]) + { + void *addr = mmap( NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, shm_fd, entry * pagesize ); + if (addr == (void *)-1) + { + fprintf( stderr, "esync: failed to map page %d (offset %#lx): ", entry, entry * pagesize ); + perror( "mmap" ); + } + + if (debug_level) + fprintf( stderr, "esync: Mapping page %d at %p.\n", entry, addr ); + + if (__sync_val_compare_and_swap( &shm_addrs[entry], 0, addr )) + munmap( addr, pagesize ); /* someone beat us to it */ + } + + return (void *)((unsigned long)shm_addrs[entry] + offset); +} + +struct semaphore +{ + int max; + int count; +}; +C_ASSERT(sizeof(struct semaphore) == 8); + +struct esync *create_esync( struct object *root, const struct unicode_str *name, + unsigned int attr, int initval, int max, enum esync_type type, + const struct security_descriptor *sd ) +{ +#ifdef HAVE_SYS_EVENTFD_H + struct esync *esync; + + if ((esync = create_named_object( root, &esync_ops, name, attr, sd ))) + { + if (get_error() != STATUS_OBJECT_NAME_EXISTS) + { + int flags = EFD_CLOEXEC | EFD_NONBLOCK; + + if (type == ESYNC_SEMAPHORE) + flags |= EFD_SEMAPHORE; + + /* initialize it if it didn't already exist */ + esync->fd = eventfd( initval, flags ); + if (esync->fd == -1) + { + perror( "eventfd" ); + file_set_error(); + release_object( esync ); + return NULL; + } + esync->type = type; + + /* Use the fd as index, since that'll be unique across all + * processes, but should hopefully end up also allowing reuse. */ + esync->shm_idx = esync->fd + 1; /* we keep index 0 reserved */ + while (esync->shm_idx * 8 >= shm_size) + { + /* Better expand the shm section. */ + shm_size += pagesize; + if (ftruncate( shm_fd, shm_size ) == -1) + { + fprintf( stderr, "esync: couldn't expand %s to size %ld: ", + shm_name, (long)shm_size ); + perror( "ftruncate" ); + } + } + + /* Initialize the shared memory portion. We want to do this on the + * server side to avoid a potential though unlikely race whereby + * the same object is opened and used between the time it's created + * and the time its shared memory portion is initialized. */ + switch (type) + { + case ESYNC_SEMAPHORE: + { + struct semaphore *semaphore = get_shm( esync->shm_idx ); + semaphore->max = max; + semaphore->count = initval; + break; + } + default: + assert( 0 ); + } + } + else + { + /* validate the type */ + if (!type_matches( type, esync->type )) + { + release_object( &esync->obj ); + set_error( STATUS_OBJECT_TYPE_MISMATCH ); + return NULL; + } + } + } + return esync; +#else + /* FIXME: Provide a fallback implementation using pipe(). */ + set_error( STATUS_NOT_IMPLEMENTED ); + return NULL; +#endif +} + +DECL_HANDLER(create_esync) +{ + struct esync *esync; + struct unicode_str name; + struct object *root; + const struct security_descriptor *sd; + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root ); + + if (!do_esync()) + { + set_error( STATUS_NOT_IMPLEMENTED ); + return; + } + + if (!req->type) + { + set_error( STATUS_INVALID_PARAMETER ); + return; + } + + if (!objattr) return; + + if ((esync = create_esync( root, &name, objattr->attributes, req->initval, req->max, req->type, sd ))) + { + if (get_error() == STATUS_OBJECT_NAME_EXISTS) + reply->handle = alloc_handle( current->process, esync, req->access, objattr->attributes ); + else + reply->handle = alloc_handle_no_access_check( current->process, esync, + req->access, objattr->attributes ); + + reply->type = esync->type; + reply->shm_idx = esync->shm_idx; + send_client_fd( current->process, esync->fd, reply->handle ); + release_object( esync ); + } + + if (root) release_object( root ); +} diff --git a/server/esync.h b/server/esync.h new file mode 100644 index 000000000000..00f9e638d83a --- /dev/null +++ b/server/esync.h @@ -0,0 +1,24 @@ +/* + * eventfd-based synchronization objects + * + * Copyright (C) 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +extern int do_esync(void); +void esync_init(void); diff --git a/server/main.c b/server/main.c index e2ae1bcaabc1..c4bb790db8a2 100644 --- a/server/main.c +++ b/server/main.c @@ -34,6 +34,7 @@ #include "thread.h" #include "request.h" #include "unicode.h" +#include "esync.h" /* command-line options */ int debug_level = 0; @@ -229,6 +230,9 @@ int main( int argc, char *argv[] ) sock_init(); open_master_socket(); + if (do_esync()) + esync_init(); + if (debug_level) fprintf( stderr, "wineserver: starting (pid=%ld)\n", (long) getpid() ); set_current_time(); init_signals(); diff --git a/server/protocol.def b/server/protocol.def index 55a44ba0f8fb..db143a9eb198 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -4058,7 +4058,6 @@ struct handle_info obj_handle_t handle; /* process handle */ @END - /* Iterate thread list for process */ @REQ(get_next_thread) obj_handle_t process; /* process handle */ @@ -4079,3 +4078,27 @@ struct handle_info @REPLY int enable; /* previous state of auto-repeat enable */ @END + +enum esync_type +{ + ESYNC_SEMAPHORE = 1, + ESYNC_AUTO_EVENT, + ESYNC_MANUAL_EVENT, + ESYNC_MUTEX, + ESYNC_AUTO_SERVER, + ESYNC_MANUAL_SERVER, + ESYNC_QUEUE, +}; + +/* Create a new eventfd-based synchronization object */ +@REQ(create_esync) + unsigned int access; /* wanted access rights */ + int initval; /* initial value */ + int type; /* type of esync object */ + int max; /* maximum count on a semaphore */ + VARARG(objattr,object_attributes); /* object attributes */ +@REPLY + obj_handle_t handle; /* handle to the object */ + int type; /* actual type (may be different for events) */ + unsigned int shm_idx; +@END From f8ed2bfa7299c3352da926475fd49d5ed1c4f889 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 12:09:22 -0500 Subject: [PATCH 0270/2542] ntdll: Create eventfd-based objects for semaphores. Wine-Staging: eventfd_synchronization --- dlls/ntdll/Makefile.in | 1 + dlls/ntdll/unix/esync.c | 270 +++++++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/esync.h | 35 +++++ dlls/ntdll/unix/loader.c | 2 + dlls/ntdll/unix/server.c | 4 +- dlls/ntdll/unix/sync.c | 4 + server/esync.c | 1 + 7 files changed, 315 insertions(+), 2 deletions(-) create mode 100644 dlls/ntdll/unix/esync.c create mode 100644 dlls/ntdll/unix/esync.h diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in index 37bd6c86e31f..01a0cf4ab379 100644 --- a/dlls/ntdll/Makefile.in +++ b/dlls/ntdll/Makefile.in @@ -48,6 +48,7 @@ SOURCES = \ unix/cdrom.c \ unix/debug.c \ unix/env.c \ + unix/esync.c \ unix/file.c \ unix/loader.c \ unix/loadorder.c \ diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c new file mode 100644 index 000000000000..89b8542433ed --- /dev/null +++ b/dlls/ntdll/unix/esync.c @@ -0,0 +1,270 @@ +/* + * eventfd-based synchronization objects + * + * Copyright (C) 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_STAT_H +# include +#endif +#include +#include + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winternl.h" +#include "wine/server.h" +#include "wine/debug.h" + +#include "unix_private.h" +#include "esync.h" + +WINE_DEFAULT_DEBUG_CHANNEL(esync); + +int do_esync(void) +{ +#ifdef HAVE_SYS_EVENTFD_H + static int do_esync_cached = -1; + + if (do_esync_cached == -1) + do_esync_cached = getenv("WINEESYNC") && atoi(getenv("WINEESYNC")); + + return do_esync_cached; +#else + static int once; + if (!once++) + FIXME("eventfd not supported on this platform.\n"); + return 0; +#endif +} + +struct esync +{ + enum esync_type type; + int fd; + void *shm; +}; + +struct semaphore +{ + int max; + int count; +}; +C_ASSERT(sizeof(struct semaphore) == 8); + +static char shm_name[29]; +static int shm_fd; +static void **shm_addrs; +static int shm_addrs_size; /* length of the allocated shm_addrs array */ +static long pagesize; + +static pthread_mutex_t shm_addrs_mutex = PTHREAD_MUTEX_INITIALIZER; + +static void *get_shm( unsigned int idx ) +{ + int entry = (idx * 8) / pagesize; + int offset = (idx * 8) % pagesize; + void *ret; + + pthread_mutex_lock( &shm_addrs_mutex ); + + if (entry >= shm_addrs_size) + { + int new_size = max(shm_addrs_size * 2, entry + 1); + + if (!(shm_addrs = realloc( shm_addrs, new_size * sizeof(shm_addrs[0]) ))) + ERR("Failed to grow shm_addrs array to size %d.\n", shm_addrs_size); + memset( shm_addrs + shm_addrs_size, 0, (new_size - shm_addrs_size) * sizeof(shm_addrs[0]) ); + shm_addrs_size = new_size; + } + + if (!shm_addrs[entry]) + { + void *addr = mmap( NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, shm_fd, entry * pagesize ); + if (addr == (void *)-1) + ERR("Failed to map page %d (offset %#lx).\n", entry, entry * pagesize); + + TRACE("Mapping page %d at %p.\n", entry, addr); + + if (InterlockedCompareExchangePointer( &shm_addrs[entry], addr, 0 )) + munmap( addr, pagesize ); /* someone beat us to it */ + } + + ret = (void *)((unsigned long)shm_addrs[entry] + offset); + + pthread_mutex_unlock( &shm_addrs_mutex ); + + return ret; +} + +/* We'd like lookup to be fast. To that end, we use a static list indexed by handle. + * This is copied and adapted from the fd cache code. */ + +#define ESYNC_LIST_BLOCK_SIZE (65536 / sizeof(struct esync)) +#define ESYNC_LIST_ENTRIES 256 + +static struct esync *esync_list[ESYNC_LIST_ENTRIES]; +static struct esync esync_list_initial_block[ESYNC_LIST_BLOCK_SIZE]; + +static inline UINT_PTR handle_to_index( HANDLE handle, UINT_PTR *entry ) +{ + UINT_PTR idx = (((UINT_PTR)handle) >> 2) - 1; + *entry = idx / ESYNC_LIST_BLOCK_SIZE; + return idx % ESYNC_LIST_BLOCK_SIZE; +} + +static struct esync *add_to_list( HANDLE handle, enum esync_type type, int fd, void *shm ) +{ + UINT_PTR entry, idx = handle_to_index( handle, &entry ); + + if (entry >= ESYNC_LIST_ENTRIES) + { + FIXME( "too many allocated handles, not caching %p\n", handle ); + return FALSE; + } + + if (!esync_list[entry]) /* do we need to allocate a new block of entries? */ + { + if (!entry) esync_list[0] = esync_list_initial_block; + else + { + void *ptr = anon_mmap_alloc( ESYNC_LIST_BLOCK_SIZE * sizeof(struct esync), + PROT_READ | PROT_WRITE ); + if (ptr == MAP_FAILED) return FALSE; + esync_list[entry] = ptr; + } + } + + if (!InterlockedCompareExchange( (LONG *)&esync_list[entry][idx].type, type, 0 )) + { + esync_list[entry][idx].fd = fd; + esync_list[entry][idx].shm = shm; + } + return &esync_list[entry][idx]; +} + +static NTSTATUS create_esync( enum esync_type type, HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, int initval, int max ) +{ + NTSTATUS ret; + data_size_t len; + struct object_attributes *objattr; + obj_handle_t fd_handle; + unsigned int shm_idx; + sigset_t sigset; + int fd; + + if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret; + + /* We have to synchronize on the fd cache CS so that our calls to + * receive_fd don't race with theirs. */ + server_enter_uninterrupted_section( &fd_cache_mutex, &sigset ); + SERVER_START_REQ( create_esync ) + { + req->access = access; + req->initval = initval; + req->type = type; + req->max = max; + wine_server_add_data( req, objattr, len ); + ret = wine_server_call( req ); + if (!ret || ret == STATUS_OBJECT_NAME_EXISTS) + { + *handle = wine_server_ptr_handle( reply->handle ); + type = reply->type; + shm_idx = reply->shm_idx; + fd = receive_fd( &fd_handle ); + assert( wine_server_ptr_handle(fd_handle) == *handle ); + } + } + SERVER_END_REQ; + server_leave_uninterrupted_section( &fd_cache_mutex, &sigset ); + + if (!ret || ret == STATUS_OBJECT_NAME_EXISTS) + { + add_to_list( *handle, type, fd, shm_idx ? get_shm( shm_idx ) : 0 ); + TRACE("-> handle %p, fd %d.\n", *handle, fd); + } + + free( objattr ); + return ret; +} + +extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max) +{ + TRACE("name %s, initial %d, max %d.\n", + attr ? debugstr_us(attr->ObjectName) : "", (int)initial, (int)max); + + return create_esync( ESYNC_SEMAPHORE, handle, access, attr, initial, max ); +} + +void esync_init(void) +{ + struct stat st; + + if (!do_esync()) + { + /* make sure the server isn't running with WINEESYNC */ + HANDLE handle; + NTSTATUS ret; + + ret = create_esync( 0, &handle, 0, NULL, 0, 0 ); + if (ret != STATUS_NOT_IMPLEMENTED) + { + ERR("Server is running with WINEESYNC but this process is not, please enable WINEESYNC or restart wineserver.\n"); + exit(1); + } + + return; + } + + if (stat( config_dir, &st ) == -1) + ERR("Cannot stat %s\n", config_dir); + + if (st.st_ino != (unsigned long)st.st_ino) + sprintf( shm_name, "/wine-%lx%08lx-esync", (unsigned long)((unsigned long long)st.st_ino >> 32), (unsigned long)st.st_ino ); + else + sprintf( shm_name, "/wine-%lx-esync", (unsigned long)st.st_ino ); + + if ((shm_fd = shm_open( shm_name, O_RDWR, 0644 )) == -1) + { + /* probably the server isn't running with WINEESYNC, tell the user and bail */ + if (errno == ENOENT) + ERR("Failed to open esync shared memory file; make sure no stale wineserver instances are running without WINEESYNC.\n"); + else + ERR("Failed to initialize shared memory: %s\n", strerror( errno )); + exit(1); + } + + pagesize = sysconf( _SC_PAGESIZE ); + + shm_addrs = calloc( 128, sizeof(shm_addrs[0]) ); + shm_addrs_size = 128; +} diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h new file mode 100644 index 000000000000..5fec18860f8b --- /dev/null +++ b/dlls/ntdll/unix/esync.h @@ -0,0 +1,35 @@ +/* + * eventfd-based synchronization objects + * + * Copyright (C) 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +extern int do_esync(void); +extern void esync_init(void); + +extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max); + + +/* We have to synchronize on the fd cache mutex so that our calls to receive_fd + * don't race with theirs. It looks weird, I know. + * + * If we weren't trying to avoid touching the code I'd rename the mutex to + * "server_fd_mutex" or something similar. */ +extern pthread_mutex_t fd_cache_mutex; + +extern int receive_fd( obj_handle_t *handle ); diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 0be3596ddd2b..43627cb258df 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -90,6 +90,7 @@ #include "winioctl.h" #include "winternl.h" #include "unix_private.h" +#include "esync.h" #include "wine/list.h" #include "ntsyscalls.h" #include "wine/debug.h" @@ -2045,6 +2046,7 @@ static void start_main_thread(void) dbg_init(); startup_info_size = server_init_process(); hacks_init(); + esync_init(); virtual_map_user_shared_data(); init_cpu_info(); init_files(); diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c index b40e7c2a1d79..b318de114627 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c @@ -103,7 +103,7 @@ sigset_t server_block_set; /* signals to block during server calls */ static int fd_socket = -1; /* socket to exchange file descriptors with the server */ static int initial_cwd = -1; static pid_t server_pid; -static pthread_mutex_t fd_cache_mutex = PTHREAD_MUTEX_INITIALIZER; +pthread_mutex_t fd_cache_mutex = PTHREAD_MUTEX_INITIALIZER; /* atomically exchange a 64-bit value */ static inline LONG64 interlocked_xchg64( LONG64 *dest, LONG64 val ) @@ -932,7 +932,7 @@ void wine_server_send_fd( int fd ) * * Receive a file descriptor passed from the server. */ -static int receive_fd( obj_handle_t *handle ) +int receive_fd( obj_handle_t *handle ) { struct iovec vec; struct msghdr msghdr; diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index d486b50001dc..3281dcd26917 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -66,6 +66,7 @@ #include "wine/server.h" #include "wine/debug.h" #include "unix_private.h" +#include "esync.h" WINE_DEFAULT_DEBUG_CHANNEL(sync); @@ -315,6 +316,9 @@ NTSTATUS WINAPI NtCreateSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJ if (max <= 0 || initial < 0 || initial > max) return STATUS_INVALID_PARAMETER; if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret; + if (do_esync()) + return esync_create_semaphore( handle, access, attr, initial, max ); + SERVER_START_REQ( create_semaphore ) { req->access = access; diff --git a/server/esync.c b/server/esync.c index 35b4833fd4ca..75ef586df305 100644 --- a/server/esync.c +++ b/server/esync.c @@ -41,6 +41,7 @@ #include "handle.h" #include "request.h" #include "file.h" +#include "esync.h" int do_esync(void) { From 12ff7f438a55d2cde293b3e8024ba79ebb2abb79 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 12:16:34 -0500 Subject: [PATCH 0271/2542] ntdll: Implement NtReleaseSemaphore(). Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 43 +++++++++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/esync.h | 1 + dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 47 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 89b8542433ed..50bf84eabe5a 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #ifdef HAVE_SYS_STAT_H @@ -170,6 +171,16 @@ static struct esync *add_to_list( HANDLE handle, enum esync_type type, int fd, v return &esync_list[entry][idx]; } +static struct esync *get_cached_object( HANDLE handle ) +{ + UINT_PTR entry, idx = handle_to_index( handle, &entry ); + + if (entry >= ESYNC_LIST_ENTRIES || !esync_list[entry]) return NULL; + if (!esync_list[entry][idx].type) return NULL; + + return &esync_list[entry][idx]; +} + static NTSTATUS create_esync( enum esync_type type, HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, int initval, int max ) { @@ -225,6 +236,38 @@ extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access, return create_esync( ESYNC_SEMAPHORE, handle, access, attr, initial, max ); } +NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) +{ + struct esync *obj; + struct semaphore *semaphore; + uint64_t count64 = count; + ULONG current; + + TRACE("%p, %d, %p.\n", handle, (int)count, prev); + + if (!(obj = get_cached_object( handle ))) return STATUS_INVALID_HANDLE; + semaphore = obj->shm; + + do + { + current = semaphore->count; + + if (count + current > semaphore->max) + return STATUS_SEMAPHORE_LIMIT_EXCEEDED; + } while (InterlockedCompareExchange( (LONG *)&semaphore->count, count + current, current ) != current); + + if (prev) *prev = current; + + /* We don't have to worry about a race between increasing the count and + * write(). The fact that we were able to increase the count means that we + * have permission to actually write that many releases to the semaphore. */ + + if (write( obj->fd, &count64, sizeof(count64) ) == -1) + return errno_to_status( errno ); + + return STATUS_SUCCESS; +} + void esync_init(void) { struct stat st; diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h index 5fec18860f8b..cbaaed3e3087 100644 --- a/dlls/ntdll/unix/esync.h +++ b/dlls/ntdll/unix/esync.h @@ -23,6 +23,7 @@ extern void esync_init(void); extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max); +extern NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ); /* We have to synchronize on the fd cache mutex so that our calls to receive_fd diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 3281dcd26917..193c51d9f1c4 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -401,6 +401,9 @@ NTSTATUS WINAPI NtReleaseSemaphore( HANDLE handle, ULONG count, ULONG *previous { unsigned int ret; + if (do_esync()) + return esync_release_semaphore( handle, count, previous ); + SERVER_START_REQ( release_semaphore ) { req->handle = wine_server_obj_handle( handle ); From 45be8cbfecd5f44194463bae62e42691a6f8777e Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 12:20:44 -0500 Subject: [PATCH 0272/2542] ntdll: Implement NtClose(). Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 18 ++++++++++++++++++ dlls/ntdll/unix/esync.h | 1 + dlls/ntdll/unix/server.c | 4 ++++ 3 files changed, 23 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 50bf84eabe5a..e289dc13c012 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -181,6 +181,24 @@ static struct esync *get_cached_object( HANDLE handle ) return &esync_list[entry][idx]; } +NTSTATUS esync_close( HANDLE handle ) +{ + UINT_PTR entry, idx = handle_to_index( handle, &entry ); + + TRACE("%p.\n", handle); + + if (entry < ESYNC_LIST_ENTRIES && esync_list[entry]) + { + if (InterlockedExchange((LONG *)&esync_list[entry][idx].type, 0)) + { + close( esync_list[entry][idx].fd ); + return STATUS_SUCCESS; + } + } + + return STATUS_INVALID_HANDLE; +} + static NTSTATUS create_esync( enum esync_type type, HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, int initval, int max ) { diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h index cbaaed3e3087..c63491dcaada 100644 --- a/dlls/ntdll/unix/esync.h +++ b/dlls/ntdll/unix/esync.h @@ -20,6 +20,7 @@ extern int do_esync(void); extern void esync_init(void); +extern NTSTATUS esync_close( HANDLE handle ); extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max); diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c index b318de114627..600ee4e33a09 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c @@ -79,6 +79,7 @@ #include "wine/server.h" #include "wine/debug.h" #include "unix_private.h" +#include "esync.h" #include "ddk/wdm.h" WINE_DEFAULT_DEBUG_CHANNEL(server); @@ -1870,6 +1871,9 @@ NTSTATUS WINAPI NtClose( HANDLE handle ) * retrieve it again */ fd = remove_fd_from_cache( handle ); + if (do_esync()) + esync_close( handle ); + SERVER_START_REQ( close_handle ) { req->handle = wine_server_obj_handle( handle ); From af11eddd2d15d993e09164f177904b0a5d0a9c20 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 12:34:42 -0500 Subject: [PATCH 0273/2542] ntdll: Implement NtWaitForMultipleObjects(). Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 163 ++++++++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/esync.h | 3 + dlls/ntdll/unix/sync.c | 7 ++ 3 files changed, 173 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index e289dc13c012..af321027a54c 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -34,6 +34,7 @@ #ifdef HAVE_SYS_STAT_H # include #endif +#include #include #include @@ -286,6 +287,168 @@ NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) return STATUS_SUCCESS; } +#define TICKSPERSEC 10000000 +#define TICKSPERMSEC 10000 + +static LONGLONG update_timeout( ULONGLONG end ) +{ + LARGE_INTEGER now; + LONGLONG timeleft; + + NtQuerySystemTime( &now ); + timeleft = end - now.QuadPart; + if (timeleft < 0) timeleft = 0; + return timeleft; +} + +static int do_poll( struct pollfd *fds, nfds_t nfds, ULONGLONG *end ) +{ + if (end) + { + LONGLONG timeleft = update_timeout( *end ); + +#ifdef HAVE_PPOLL + /* We use ppoll() if available since the time granularity is better. */ + struct timespec tmo_p; + tmo_p.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; + tmo_p.tv_nsec = (timeleft % TICKSPERSEC) * 100; + return ppoll( fds, nfds, &tmo_p, NULL ); +#else + return poll( fds, nfds, timeleft / TICKSPERMSEC ); +#endif + } + else + return poll( fds, nfds, -1 ); +} + +static void update_grabbed_object( struct esync *obj ) +{ + if (obj->type == ESYNC_SEMAPHORE) + { + struct semaphore *semaphore = obj->shm; + /* We don't have to worry about a race between this and read(); the + * fact that we were able to grab it at all means the count is nonzero, + * and if someone else grabbed it then the count must have been >= 2, + * etc. */ + InterlockedExchangeAdd( (LONG *)&semaphore->count, -1 ); + } +} + +/* A value of STATUS_NOT_IMPLEMENTED returned from this function means that we + * need to delegate to server_select(). */ +NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, + BOOLEAN alertable, const LARGE_INTEGER *timeout ) +{ + struct esync *objs[MAXIMUM_WAIT_OBJECTS]; + struct pollfd fds[MAXIMUM_WAIT_OBJECTS]; + int has_esync = 0, has_server = 0; + LONGLONG timeleft; + LARGE_INTEGER now; + ULONGLONG end; + int i, ret; + + NtQuerySystemTime( &now ); + if (timeout) + { + if (timeout->QuadPart == TIMEOUT_INFINITE) + timeout = NULL; + else if (timeout->QuadPart >= 0) + end = timeout->QuadPart; + else + end = now.QuadPart - timeout->QuadPart; + } + + for (i = 0; i < count; i++) + { + if ((objs[i] = get_cached_object( handles[i] ))) + has_esync = 1; + else + has_server = 1; + } + + if (has_esync && has_server) + FIXME("Can't wait on esync and server objects at the same time!\n"); + else if (has_server) + return STATUS_NOT_IMPLEMENTED; + + if (TRACE_ON(esync)) + { + TRACE("Waiting for %s of %d handles:", wait_any ? "any" : "all", (int)count); + for (i = 0; i < count; i++) + TRACE(" %p", handles[i]); + + if (!timeout) + TRACE(", timeout = INFINITE.\n"); + else + { + timeleft = update_timeout( end ); + TRACE(", timeout = %ld.%07ld sec.\n", + (long) timeleft / TICKSPERSEC, (long) timeleft % TICKSPERSEC); + } + } + + if (wait_any || count == 1) + { + for (i = 0; i < count; i++) + { + fds[i].fd = objs[i] ? objs[i]->fd : -1; + fds[i].events = POLLIN; + } + + while (1) + { + ret = do_poll( fds, count, timeout ? &end : NULL ); + if (ret > 0) + { + /* Find out which object triggered the wait. */ + for (i = 0; i < count; i++) + { + struct esync *obj = objs[i]; + + if (fds[i].revents & (POLLERR | POLLHUP | POLLNVAL)) + { + ERR("Polling on fd %d returned %#x.\n", fds[i].fd, fds[i].revents); + return STATUS_INVALID_HANDLE; + } + + if (obj) + { + int64_t value; + ssize_t size; + + if ((size = read( fds[i].fd, &value, sizeof(value) )) == sizeof(value)) + { + /* We found our object. */ + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + update_grabbed_object( obj ); + return i; + } + } + } + + /* If we got here, someone else stole (or reset, etc.) whatever + * we were waiting for. So keep waiting. */ + NtQuerySystemTime( &now ); + } + else if (ret == 0) + { + TRACE("Wait timed out.\n"); + return STATUS_TIMEOUT; + } + else + { + ERR("ppoll failed: %s\n", strerror( errno )); + return errno_to_status( errno ); + } + } + } + else + { + FIXME("Wait-all not implemented.\n"); + return STATUS_NOT_IMPLEMENTED; + } +} + void esync_init(void) { struct stat st; diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h index c63491dcaada..92b609ebd27e 100644 --- a/dlls/ntdll/unix/esync.h +++ b/dlls/ntdll/unix/esync.h @@ -26,6 +26,9 @@ extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max); extern NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ); +extern NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, + BOOLEAN alertable, const LARGE_INTEGER *timeout ); + /* We have to synchronize on the fd cache mutex so that our calls to receive_fd * don't race with theirs. It looks weird, I know. diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 193c51d9f1c4..77c4e7437e4d 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -1584,6 +1584,13 @@ NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles, BO if (!count || count > MAXIMUM_WAIT_OBJECTS) return STATUS_INVALID_PARAMETER_1; + if (do_esync()) + { + NTSTATUS ret = esync_wait_objects( count, handles, wait_any, alertable, timeout ); + if (ret != STATUS_NOT_IMPLEMENTED) + return ret; + } + if (alertable) flags |= SELECT_ALERTABLE; select_op.wait.op = wait_any ? SELECT_WAIT : SELECT_WAIT_ALL; for (i = 0; i < count; i++) select_op.wait.handles[i] = wine_server_obj_handle( handles[i] ); From 712f60736301c2987cbeecf285e2f7647d8bf075 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 14:40:43 -0500 Subject: [PATCH 0274/2542] ntdll, server: Implement NtCreateEvent(). Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 27 +++++++++++++++++++++++++++ dlls/ntdll/unix/esync.h | 3 +++ dlls/ntdll/unix/sync.c | 4 ++++ server/esync.c | 15 +++++++++++++++ 4 files changed, 49 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index af321027a54c..38ca751eec2a 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -81,6 +81,13 @@ struct semaphore }; C_ASSERT(sizeof(struct semaphore) == 8); +struct event +{ + int signaled; + int locked; +}; +C_ASSERT(sizeof(struct event) == 8); + static char shm_name[29]; static int shm_fd; static void **shm_addrs; @@ -287,6 +294,18 @@ NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) return STATUS_SUCCESS; } +NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, EVENT_TYPE event_type, BOOLEAN initial ) +{ + enum esync_type type = (event_type == SynchronizationEvent ? ESYNC_AUTO_EVENT : ESYNC_MANUAL_EVENT); + + TRACE("name %s, %s-reset, initial %d.\n", + attr ? debugstr_us(attr->ObjectName) : "", + event_type == NotificationEvent ? "manual" : "auto", initial); + + return create_esync( type, handle, access, attr, initial, 0 ); +} + #define TICKSPERSEC 10000000 #define TICKSPERMSEC 10000 @@ -332,6 +351,14 @@ static void update_grabbed_object( struct esync *obj ) * etc. */ InterlockedExchangeAdd( (LONG *)&semaphore->count, -1 ); } + else if (obj->type == ESYNC_AUTO_EVENT) + { + struct event *event = obj->shm; + /* We don't have to worry about a race between this and read(), since + * this is just a hint, and the real state is in the kernel object. + * This might already be 0, but that's okay! */ + event->signaled = 0; + } } /* A value of STATUS_NOT_IMPLEMENTED returned from this function means that we diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h index 92b609ebd27e..7bb963faf51b 100644 --- a/dlls/ntdll/unix/esync.h +++ b/dlls/ntdll/unix/esync.h @@ -26,6 +26,9 @@ extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max); extern NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ); +extern NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial ); + extern NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 77c4e7437e4d..9ef9df912cc6 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -430,6 +430,10 @@ NTSTATUS WINAPI NtCreateEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_ *handle = 0; if (type != NotificationEvent && type != SynchronizationEvent) return STATUS_INVALID_PARAMETER; + + if (do_esync()) + return esync_create_event( handle, access, attr, type, state ); + if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret; SERVER_START_REQ( create_event ) diff --git a/server/esync.c b/server/esync.c index 75ef586df305..6a63c0dd5e9a 100644 --- a/server/esync.c +++ b/server/esync.c @@ -201,6 +201,13 @@ struct semaphore }; C_ASSERT(sizeof(struct semaphore) == 8); +struct event +{ + int signaled; + int locked; +}; +C_ASSERT(sizeof(struct event) == 8); + struct esync *create_esync( struct object *root, const struct unicode_str *name, unsigned int attr, int initval, int max, enum esync_type type, const struct security_descriptor *sd ) @@ -256,6 +263,14 @@ struct esync *create_esync( struct object *root, const struct unicode_str *name, semaphore->count = initval; break; } + case ESYNC_AUTO_EVENT: + case ESYNC_MANUAL_EVENT: + { + struct event *event = get_shm( esync->shm_idx ); + event->signaled = initval ? 1 : 0; + event->locked = 0; + break; + } default: assert( 0 ); } From 8089f641d3c2b5fd4fba63b20ce7ec0c2479abf3 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 14:46:24 -0500 Subject: [PATCH 0275/2542] ntdll: Implement NtSetEvent(). Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 15 +++++++++++++++ dlls/ntdll/unix/esync.h | 1 + dlls/ntdll/unix/sync.c | 4 ++++ 3 files changed, 20 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 38ca751eec2a..38eb1c7306b6 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -306,6 +306,21 @@ NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, return create_esync( type, handle, access, attr, initial, 0 ); } +NTSTATUS esync_set_event( HANDLE handle ) +{ + static const uint64_t value = 1; + struct esync *obj; + + TRACE("%p.\n", handle); + + if (!(obj = get_cached_object( handle ))) return STATUS_INVALID_HANDLE; + + if (write( obj->fd, &value, sizeof(value) ) == -1) + ERR("write: %s\n", strerror(errno)); + + return STATUS_SUCCESS; +} + #define TICKSPERSEC 10000000 #define TICKSPERMSEC 10000 diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h index 7bb963faf51b..d92165214d61 100644 --- a/dlls/ntdll/unix/esync.h +++ b/dlls/ntdll/unix/esync.h @@ -28,6 +28,7 @@ extern NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev extern NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial ); +extern NTSTATUS esync_set_event( HANDLE handle ); extern NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 9ef9df912cc6..86f407484c58 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -482,8 +482,12 @@ NTSTATUS WINAPI NtOpenEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_AT */ NTSTATUS WINAPI NtSetEvent( HANDLE handle, LONG *prev_state ) { + /* This comment is a dummy to make sure this patch applies in the right place. */ unsigned int ret; + if (do_esync()) + return esync_set_event( handle ); + SERVER_START_REQ( event_op ) { req->handle = wine_server_obj_handle( handle ); From e952171c8f5792122b1b939f9ef980aacb919557 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 14:51:21 -0500 Subject: [PATCH 0276/2542] ntdll: Implement NtResetEvent(). Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 15 +++++++++++++++ dlls/ntdll/unix/esync.h | 1 + dlls/ntdll/unix/sync.c | 5 +++++ 3 files changed, 21 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 38eb1c7306b6..d33d8e013f40 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -321,6 +321,21 @@ NTSTATUS esync_set_event( HANDLE handle ) return STATUS_SUCCESS; } +NTSTATUS esync_reset_event( HANDLE handle ) +{ + uint64_t value; + struct esync *obj; + + TRACE("%p.\n", handle); + + if (!(obj = get_cached_object( handle ))) return STATUS_INVALID_HANDLE; + + if (read( obj->fd, &value, sizeof(value) ) == -1 && errno != EWOULDBLOCK && errno != EAGAIN) + ERR("read: %s\n", strerror(errno)); + + return STATUS_SUCCESS; +} + #define TICKSPERSEC 10000000 #define TICKSPERMSEC 10000 diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h index d92165214d61..6e5d6233a2e4 100644 --- a/dlls/ntdll/unix/esync.h +++ b/dlls/ntdll/unix/esync.h @@ -28,6 +28,7 @@ extern NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev extern NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial ); +extern NTSTATUS esync_reset_event( HANDLE handle ); extern NTSTATUS esync_set_event( HANDLE handle ); extern NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 86f407484c58..70d038bf64ef 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -505,8 +505,13 @@ NTSTATUS WINAPI NtSetEvent( HANDLE handle, LONG *prev_state ) */ NTSTATUS WINAPI NtResetEvent( HANDLE handle, LONG *prev_state ) { + /* This comment is a dummy to make sure this patch applies in the right place. */ unsigned int ret; + if (do_esync()) + return esync_reset_event( handle ); + + SERVER_START_REQ( event_op ) { req->handle = wine_server_obj_handle( handle ); From 869d19a3598a82baf844b5d6dd8ec1603c1360aa Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 14:57:42 -0500 Subject: [PATCH 0277/2542] ntdll: Implement waiting on manual-reset events. Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index d33d8e013f40..0d15defdd9cd 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -473,12 +473,24 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an int64_t value; ssize_t size; - if ((size = read( fds[i].fd, &value, sizeof(value) )) == sizeof(value)) + if (obj->type == ESYNC_MANUAL_EVENT) { - /* We found our object. */ - TRACE("Woken up by handle %p [%d].\n", handles[i], i); - update_grabbed_object( obj ); - return i; + /* Don't grab the object, just check if it's signaled. */ + if (fds[i].revents & POLLIN) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + return i; + } + } + else + { + if ((size = read( fds[i].fd, &value, sizeof(value) )) == sizeof(value)) + { + /* We found our object. */ + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + update_grabbed_object( obj ); + return i; + } } } } From f05250bcff9c2c9eae1e3fc86850ff5349cacae1 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Fri, 8 Jun 2018 18:51:40 -0500 Subject: [PATCH 0278/2542] server: Add an object operation to grab the esync file descriptor. Split off to decrease patch size. Wine-Staging: eventfd_synchronization --- server/async.c | 2 ++ server/atom.c | 1 + server/change.c | 1 + server/clipboard.c | 1 + server/completion.c | 2 ++ server/console.c | 7 +++++++ server/debugger.c | 2 ++ server/device.c | 4 ++++ server/directory.c | 2 ++ server/esync.c | 1 + server/event.c | 2 ++ server/fd.c | 4 ++++ server/file.c | 1 + server/handle.c | 1 + server/hook.c | 1 + server/mailslot.c | 4 ++++ server/mapping.c | 3 +++ server/mutex.c | 1 + server/named_pipe.c | 6 ++++++ server/object.c | 2 ++ server/object.h | 2 ++ server/process.c | 3 +++ server/queue.c | 2 ++ server/registry.c | 1 + server/request.c | 1 + server/semaphore.c | 1 + server/serial.c | 1 + server/signal.c | 1 + server/sock.c | 3 +++ server/symlink.c | 1 + server/thread.c | 3 +++ server/timer.c | 1 + server/token.c | 1 + server/window.c | 1 + server/winstation.c | 2 ++ 35 files changed, 72 insertions(+) diff --git a/server/async.c b/server/async.c index d2d929c9709f..9768a4932a6c 100644 --- a/server/async.c +++ b/server/async.c @@ -78,6 +78,7 @@ static const struct object_ops async_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ async_signaled, /* signaled */ + NULL, /* get_esync_fd */ async_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -698,6 +699,7 @@ static const struct object_ops iosb_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/atom.c b/server/atom.c index ff0799f5880d..d9824de8eac3 100644 --- a/server/atom.c +++ b/server/atom.c @@ -79,6 +79,7 @@ static const struct object_ops atom_table_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/change.c b/server/change.c index f42ce0663407..d0a90a992614 100644 --- a/server/change.c +++ b/server/change.c @@ -112,6 +112,7 @@ static const struct object_ops dir_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ dir_get_fd, /* get_fd */ diff --git a/server/clipboard.c b/server/clipboard.c index 91f159bc7c9b..0df7fd2f18e7 100644 --- a/server/clipboard.c +++ b/server/clipboard.c @@ -76,6 +76,7 @@ static const struct object_ops clipboard_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/completion.c b/server/completion.c index 99680ae06806..3d750154d1ba 100644 --- a/server/completion.c +++ b/server/completion.c @@ -92,6 +92,7 @@ static const struct object_ops completion_wait_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ completion_wait_signaled, /* signaled */ + NULL, /* get_esync_fd */ completion_wait_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -166,6 +167,7 @@ static const struct object_ops completion_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ completion_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/console.c b/server/console.c index c3e7bf57e924..e8a805ec0b2f 100644 --- a/server/console.c +++ b/server/console.c @@ -81,6 +81,7 @@ static const struct object_ops console_ops = console_add_queue, /* add_queue */ remove_queue, /* remove_queue */ console_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ console_get_fd, /* get_fd */ @@ -158,6 +159,7 @@ static const struct object_ops console_server_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ console_server_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ console_server_get_fd, /* get_fd */ @@ -227,6 +229,7 @@ static const struct object_ops screen_buffer_ops = screen_buffer_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ screen_buffer_get_fd, /* get_fd */ @@ -276,6 +279,7 @@ static const struct object_ops console_device_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -313,6 +317,7 @@ static const struct object_ops console_input_ops = console_input_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ console_input_get_fd, /* get_fd */ @@ -370,6 +375,7 @@ static const struct object_ops console_output_ops = console_output_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ console_output_get_fd, /* get_fd */ @@ -428,6 +434,7 @@ static const struct object_ops console_connection_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ console_connection_get_fd, /* get_fd */ diff --git a/server/debugger.c b/server/debugger.c index 39a740e07e53..0c01ec1c0d3a 100644 --- a/server/debugger.c +++ b/server/debugger.c @@ -86,6 +86,7 @@ static const struct object_ops debug_event_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ debug_event_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -114,6 +115,7 @@ static const struct object_ops debug_obj_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ debug_obj_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/device.c b/server/device.c index cab09700d8c1..ddfe6c6e931b 100644 --- a/server/device.c +++ b/server/device.c @@ -66,6 +66,7 @@ static const struct object_ops irp_call_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -106,6 +107,7 @@ static const struct object_ops device_manager_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ device_manager_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -163,6 +165,7 @@ static const struct object_ops device_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -215,6 +218,7 @@ static const struct object_ops device_file_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ device_file_get_fd, /* get_fd */ diff --git a/server/directory.c b/server/directory.c index fd689c561bc9..2894f7669dbf 100644 --- a/server/directory.c +++ b/server/directory.c @@ -69,6 +69,7 @@ static const struct object_ops object_type_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -119,6 +120,7 @@ static const struct object_ops directory_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/esync.c b/server/esync.c index 6a63c0dd5e9a..f95dc5a391fe 100644 --- a/server/esync.c +++ b/server/esync.c @@ -122,6 +122,7 @@ static const struct object_ops esync_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/event.c b/server/event.c index ad7c09acc992..16cea16e9c27 100644 --- a/server/event.c +++ b/server/event.c @@ -72,6 +72,7 @@ static const struct object_ops event_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ event_signaled, /* signaled */ + NULL, /* get_esync_fd */ event_satisfied, /* satisfied */ event_signal, /* signal */ no_get_fd, /* get_fd */ @@ -119,6 +120,7 @@ static const struct object_ops keyed_event_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ keyed_event_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/fd.c b/server/fd.c index ce32e7f8397d..690d8b777f5e 100644 --- a/server/fd.c +++ b/server/fd.c @@ -167,6 +167,7 @@ static const struct object_ops fd_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -208,6 +209,7 @@ static const struct object_ops device_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -248,6 +250,7 @@ static const struct object_ops inode_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -290,6 +293,7 @@ static const struct object_ops file_lock_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ file_lock_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/file.c b/server/file.c index 8f6566a0077d..8dbcae1da7e9 100644 --- a/server/file.c +++ b/server/file.c @@ -94,6 +94,7 @@ static const struct object_ops file_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ file_get_fd, /* get_fd */ diff --git a/server/handle.c b/server/handle.c index c43b19c1160f..3b79982f18cb 100644 --- a/server/handle.c +++ b/server/handle.c @@ -126,6 +126,7 @@ static const struct object_ops handle_table_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/hook.c b/server/hook.c index ffe7206369e1..921aa8aba2e0 100644 --- a/server/hook.c +++ b/server/hook.c @@ -81,6 +81,7 @@ static const struct object_ops hook_table_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/mailslot.c b/server/mailslot.c index b14954ad6c3c..e2ee8246633f 100644 --- a/server/mailslot.c +++ b/server/mailslot.c @@ -81,6 +81,7 @@ static const struct object_ops mailslot_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ mailslot_get_fd, /* get_fd */ @@ -142,6 +143,7 @@ static const struct object_ops mail_writer_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ mail_writer_get_fd, /* get_fd */ @@ -207,6 +209,7 @@ static const struct object_ops mailslot_device_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -237,6 +240,7 @@ static const struct object_ops mailslot_device_file_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ mailslot_device_file_get_fd, /* get_fd */ diff --git a/server/mapping.c b/server/mapping.c index 4bdd7c5080ac..a8593de3a5bc 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -67,6 +67,7 @@ static const struct object_ops ranges_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -103,6 +104,7 @@ static const struct object_ops shared_map_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -176,6 +178,7 @@ static const struct object_ops mapping_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ mapping_get_fd, /* get_fd */ diff --git a/server/mutex.c b/server/mutex.c index af0efe721323..4785a830e92b 100644 --- a/server/mutex.c +++ b/server/mutex.c @@ -73,6 +73,7 @@ static const struct object_ops mutex_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ mutex_signaled, /* signaled */ + NULL, /* get_esync_fd */ mutex_satisfied, /* satisfied */ mutex_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/named_pipe.c b/server/named_pipe.c index 59a90c36663d..1535c5188ec3 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -119,6 +119,7 @@ static const struct object_ops named_pipe_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -167,6 +168,7 @@ static const struct object_ops pipe_server_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ pipe_end_get_fd, /* get_fd */ @@ -211,6 +213,7 @@ static const struct object_ops pipe_client_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ pipe_end_get_fd, /* get_fd */ @@ -258,6 +261,7 @@ static const struct object_ops named_pipe_device_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -289,6 +293,7 @@ static const struct object_ops named_pipe_device_file_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ named_pipe_device_file_get_fd, /* get_fd */ @@ -339,6 +344,7 @@ static const struct object_ops named_pipe_dir_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ named_pipe_dir_get_fd, /* get_fd */ diff --git a/server/object.c b/server/object.c index cd368ef724a7..4d8fcc5a7742 100644 --- a/server/object.c +++ b/server/object.c @@ -108,6 +108,7 @@ static const struct object_ops apc_reserve_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -132,6 +133,7 @@ static const struct object_ops completion_reserve_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/object.h b/server/object.h index 1058f9bfb0a3..4acf6f035723 100644 --- a/server/object.h +++ b/server/object.h @@ -78,6 +78,8 @@ struct object_ops void (*remove_queue)(struct object *,struct wait_queue_entry *); /* is object signaled? */ int (*signaled)(struct object *,struct wait_queue_entry *); + /* return the esync fd for this object */ + int (*get_esync_fd)(struct object *, enum esync_type *type); /* wait satisfied */ void (*satisfied)(struct object *,struct wait_queue_entry *); /* signal an object */ diff --git a/server/process.c b/server/process.c index e06350f73112..0c6f71c2769e 100644 --- a/server/process.c +++ b/server/process.c @@ -105,6 +105,7 @@ static const struct object_ops process_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ process_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -156,6 +157,7 @@ static const struct object_ops startup_info_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ startup_info_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -217,6 +219,7 @@ static const struct object_ops job_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ job_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/queue.c b/server/queue.c index e43a2ac37a22..0cdc949dc890 100644 --- a/server/queue.c +++ b/server/queue.c @@ -164,6 +164,7 @@ static const struct object_ops msg_queue_ops = msg_queue_add_queue, /* add_queue */ msg_queue_remove_queue, /* remove_queue */ msg_queue_signaled, /* signaled */ + NULL, /* get_esync_fd */ msg_queue_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -201,6 +202,7 @@ static const struct object_ops thread_input_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/registry.c b/server/registry.c index 3f02faaaefda..7bf65ba499c1 100644 --- a/server/registry.c +++ b/server/registry.c @@ -180,6 +180,7 @@ static const struct object_ops key_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/request.c b/server/request.c index 2254315b79e5..f4f5e713935d 100644 --- a/server/request.c +++ b/server/request.c @@ -89,6 +89,7 @@ static const struct object_ops master_socket_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/semaphore.c b/server/semaphore.c index 53b42a886df5..e3889f24601b 100644 --- a/server/semaphore.c +++ b/server/semaphore.c @@ -70,6 +70,7 @@ static const struct object_ops semaphore_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ semaphore_signaled, /* signaled */ + NULL, /* get_esync_fd */ semaphore_satisfied, /* satisfied */ semaphore_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/serial.c b/server/serial.c index 209f2e9174e2..0d49a996c2a8 100644 --- a/server/serial.c +++ b/server/serial.c @@ -91,6 +91,7 @@ static const struct object_ops serial_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ serial_get_fd, /* get_fd */ diff --git a/server/signal.c b/server/signal.c index 19b76d44c169..55cd6aa037ea 100644 --- a/server/signal.c +++ b/server/signal.c @@ -62,6 +62,7 @@ static const struct object_ops handler_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/sock.c b/server/sock.c index 32d622aaebc6..2bb027a563c2 100644 --- a/server/sock.c +++ b/server/sock.c @@ -471,6 +471,7 @@ static const struct object_ops sock_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ sock_get_fd, /* get_fd */ @@ -3599,6 +3600,7 @@ static const struct object_ops ifchange_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ ifchange_get_fd, /* get_fd */ @@ -3820,6 +3822,7 @@ static const struct object_ops socket_device_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/symlink.c b/server/symlink.c index 74b60162c015..2dd9c6a798df 100644 --- a/server/symlink.c +++ b/server/symlink.c @@ -71,6 +71,7 @@ static const struct object_ops symlink_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/thread.c b/server/thread.c index ff58ebaab509..88c3d7da9aa7 100644 --- a/server/thread.c +++ b/server/thread.c @@ -99,6 +99,7 @@ static const struct object_ops thread_apc_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ thread_apc_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -141,6 +142,7 @@ static const struct object_ops context_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ context_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -190,6 +192,7 @@ static const struct object_ops thread_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ thread_signaled, /* signaled */ + NULL, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/timer.c b/server/timer.c index b0b6ec815351..883f30fa97e8 100644 --- a/server/timer.c +++ b/server/timer.c @@ -76,6 +76,7 @@ static const struct object_ops timer_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ timer_signaled, /* signaled */ + NULL, /* get_esync_fd */ timer_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/token.c b/server/token.c index 7e20c670a166..b638ed192cb8 100644 --- a/server/token.c +++ b/server/token.c @@ -145,6 +145,7 @@ static const struct object_ops token_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/window.c b/server/window.c index 9d6ce4ba169a..be2c68b95fc3 100644 --- a/server/window.c +++ b/server/window.c @@ -107,6 +107,7 @@ static const struct object_ops window_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/winstation.c b/server/winstation.c index b3746090ccf8..126b70d625aa 100644 --- a/server/winstation.c +++ b/server/winstation.c @@ -76,6 +76,7 @@ static const struct object_ops winstation_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -116,6 +117,7 @@ static const struct object_ops desktop_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ + NULL, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ From cdb9dc1ebb868c0dc4b32d0f25d474fb976fda99 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Fri, 8 Jun 2018 18:55:49 -0500 Subject: [PATCH 0279/2542] server: Add a request to get the eventfd file descriptor associated with a waitable handle. Wine-Staging: eventfd_synchronization --- server/esync.c | 37 +++++++++++++++++++++++++++++++++++++ server/protocol.def | 8 ++++++++ 2 files changed, 45 insertions(+) diff --git a/server/esync.c b/server/esync.c index f95dc5a391fe..85f7f1e060f2 100644 --- a/server/esync.c +++ b/server/esync.c @@ -333,3 +333,40 @@ DECL_HANDLER(create_esync) if (root) release_object( root ); } + +/* Retrieve a file descriptor for an esync object which will be signaled by the + * server. The client should only read from (i.e. wait on) this object. */ +DECL_HANDLER(get_esync_fd) +{ + struct object *obj; + enum esync_type type; + int fd; + + if (!(obj = get_handle_obj( current->process, req->handle, SYNCHRONIZE, NULL ))) + return; + + if (obj->ops->get_esync_fd) + { + fd = obj->ops->get_esync_fd( obj, &type ); + reply->type = type; + if (obj->ops == &esync_ops) + { + struct esync *esync = (struct esync *)obj; + reply->shm_idx = esync->shm_idx; + } + else + reply->shm_idx = 0; + send_client_fd( current->process, fd, req->handle ); + } + else + { + if (debug_level) + { + fprintf( stderr, "%04x: esync: can't wait on object: ", current->id ); + obj->ops->dump( obj, 0 ); + } + set_error( STATUS_NOT_IMPLEMENTED ); + } + + release_object( obj ); +} diff --git a/server/protocol.def b/server/protocol.def index db143a9eb198..ba58356cf3b9 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -4102,3 +4102,11 @@ enum esync_type int type; /* actual type (may be different for events) */ unsigned int shm_idx; @END + +/* Retrieve the esync fd for an object. */ +@REQ(get_esync_fd) + obj_handle_t handle; /* handle to the object */ +@REPLY + int type; + unsigned int shm_idx; +@END From 174a45efdf93aa151e30b3d37e408ed74521335f Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 15:11:12 -0500 Subject: [PATCH 0280/2542] server: Create eventfd file descriptors for process objects. Wine-Staging: eventfd_synchronization --- server/esync.c | 18 ++++++++++++++++++ server/esync.h | 1 + server/process.c | 16 +++++++++++++++- server/process.h | 1 + 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/server/esync.c b/server/esync.c index 85f7f1e060f2..44214e5fe025 100644 --- a/server/esync.c +++ b/server/esync.c @@ -295,6 +295,24 @@ struct esync *create_esync( struct object *root, const struct unicode_str *name, #endif } +/* Create a file descriptor for an existing handle. + * Caller must close the handle when it's done; it's not linked to an esync + * server object in any way. */ +int esync_create_fd( int initval, int flags ) +{ +#ifdef HAVE_SYS_EVENTFD_H + int fd; + + fd = eventfd( initval, flags | EFD_CLOEXEC | EFD_NONBLOCK ); + if (fd == -1) + perror( "eventfd" ); + + return fd; +#else + return -1; +#endif +} + DECL_HANDLER(create_esync) { struct esync *esync; diff --git a/server/esync.h b/server/esync.h index 00f9e638d83a..8522d8a69ae4 100644 --- a/server/esync.h +++ b/server/esync.h @@ -22,3 +22,4 @@ extern int do_esync(void); void esync_init(void); +int esync_create_fd( int initval, int flags ); diff --git a/server/process.c b/server/process.c index 0c6f71c2769e..d7934b770dd7 100644 --- a/server/process.c +++ b/server/process.c @@ -63,6 +63,7 @@ #include "request.h" #include "user.h" #include "security.h" +#include "esync.h" /* process object */ @@ -95,6 +96,7 @@ static struct security_descriptor *process_get_sd( struct object *obj ); static void process_poll_event( struct fd *fd, int event ); static struct list *process_get_kernel_obj_list( struct object *obj ); static void process_destroy( struct object *obj ); +static int process_get_esync_fd( struct object *obj, enum esync_type *type ); static void terminate_process( struct process *process, struct thread *skip, int exit_code ); static const struct object_ops process_ops = @@ -105,7 +107,7 @@ static const struct object_ops process_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ process_signaled, /* signaled */ - NULL, /* get_esync_fd */ + process_get_esync_fd, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -688,6 +690,7 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla process->rawinput_mouse = NULL; process->rawinput_kbd = NULL; memset( &process->image_info, 0, sizeof(process->image_info) ); + process->esync_fd = -1; list_init( &process->rawinput_entry ); list_init( &process->kernel_object ); list_init( &process->thread_list ); @@ -739,6 +742,9 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla if (!process->handles || !process->token) goto error; process->session_id = token_get_session_id( process->token ); + if (do_esync()) + process->esync_fd = esync_create_fd( 0, 0 ); + set_fd_events( process->msg_fd, POLLIN ); /* start listening to events */ return process; @@ -787,6 +793,7 @@ static void process_destroy( struct object *obj ) free( process->rawinput_devices ); free( process->dir_cache ); free( process->image ); + if (do_esync()) close( process->esync_fd ); } /* dump a process on stdout for debugging purposes */ @@ -804,6 +811,13 @@ static int process_signaled( struct object *obj, struct wait_queue_entry *entry return !process->running_threads; } +static int process_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct process *process = (struct process *)obj; + *type = ESYNC_MANUAL_SERVER; + return process->esync_fd; +} + static unsigned int process_map_access( struct object *obj, unsigned int access ) { access = default_map_access( obj, access ); diff --git a/server/process.h b/server/process.h index 96814ab7cf8b..ec74ba0490a0 100644 --- a/server/process.h +++ b/server/process.h @@ -86,6 +86,7 @@ struct process struct list rawinput_entry; /* entry in the rawinput process list */ struct list kernel_object; /* list of kernel object pointers */ struct pe_image_info image_info; /* main exe image info */ + int esync_fd; /* esync file descriptor (signaled on exit) */ }; /* process functions */ From 067e4aa375123245622a2b6a86ac9227f8e1edf9 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 15:19:37 -0500 Subject: [PATCH 0281/2542] ntdll, server: Implement waiting on server-bound objects. The code here is sort of self-explanatory, but since I split it up over several patches I'll provide a quick explanation. The basic principle is that we can create an eventfd descriptor for any synchronizable handle, and signal it on the server side whenever a wakeup would be triggered. This means not only that we can wait simultaneously on esync primitives and on other primitives, but that we can do it all in "user-mode", i.e. without having to make a server call. With this patch we break waiting on svcctl.exe. Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 84 ++++++++++++++++++++++++++++++++++++++--- server/esync.c | 16 ++++++++ server/esync.h | 1 + server/thread.c | 4 ++ 4 files changed, 99 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 0d15defdd9cd..e783517f644d 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -189,6 +189,72 @@ static struct esync *get_cached_object( HANDLE handle ) return &esync_list[entry][idx]; } +/* Gets an object. This is either a proper esync object (i.e. an event, + * semaphore, etc. created using create_esync) or a generic synchronizable + * server-side object which the server will signal (e.g. a process, thread, + * message queue, etc.) */ +static NTSTATUS get_object( HANDLE handle, struct esync **obj ) +{ + NTSTATUS ret = STATUS_SUCCESS; + enum esync_type type = 0; + unsigned int shm_idx = 0; + obj_handle_t fd_handle; + sigset_t sigset; + int fd = -1; + + if ((*obj = get_cached_object( handle ))) return STATUS_SUCCESS; + + if ((INT_PTR)handle < 0) + { + /* We can deal with pseudo-handles, but it's just easier this way */ + return STATUS_NOT_IMPLEMENTED; + } + + if (!handle) + { + /* Shadow of the Tomb Raider really likes passing in NULL handles to + * various functions. Concerning, but let's avoid a server call. */ + return STATUS_INVALID_HANDLE; + } + + /* We need to try grabbing it from the server. */ + server_enter_uninterrupted_section( &fd_cache_mutex, &sigset ); + if (!(*obj = get_cached_object( handle ))) + { + SERVER_START_REQ( get_esync_fd ) + { + req->handle = wine_server_obj_handle( handle ); + if (!(ret = wine_server_call( req ))) + { + type = reply->type; + shm_idx = reply->shm_idx; + fd = receive_fd( &fd_handle ); + assert( wine_server_ptr_handle(fd_handle) == handle ); + } + } + SERVER_END_REQ; + } + server_leave_uninterrupted_section( &fd_cache_mutex, &sigset ); + + if (*obj) + { + /* We managed to grab it while in the CS; return it. */ + return STATUS_SUCCESS; + } + + if (ret) + { + WARN("Failed to retrieve fd for handle %p, status %#x.\n", handle, (unsigned int)ret); + *obj = NULL; + return ret; + } + + TRACE("Got fd %d for handle %p.\n", fd, handle); + + *obj = add_to_list( handle, type, fd, shm_idx ? get_shm( shm_idx ) : 0 ); + return ret; +} + NTSTATUS esync_close( HANDLE handle ) { UINT_PTR entry, idx = handle_to_index( handle, &entry ); @@ -268,10 +334,11 @@ NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) struct semaphore *semaphore; uint64_t count64 = count; ULONG current; + NTSTATUS ret; TRACE("%p, %d, %p.\n", handle, (int)count, prev); - if (!(obj = get_cached_object( handle ))) return STATUS_INVALID_HANDLE; + if ((ret = get_object( handle, &obj))) return ret; semaphore = obj->shm; do @@ -310,10 +377,11 @@ NTSTATUS esync_set_event( HANDLE handle ) { static const uint64_t value = 1; struct esync *obj; + NTSTATUS ret; TRACE("%p.\n", handle); - if (!(obj = get_cached_object( handle ))) return STATUS_INVALID_HANDLE; + if ((ret = get_object( handle, &obj))) return ret; if (write( obj->fd, &value, sizeof(value) ) == -1) ERR("write: %s\n", strerror(errno)); @@ -325,10 +393,11 @@ NTSTATUS esync_reset_event( HANDLE handle ) { uint64_t value; struct esync *obj; + NTSTATUS ret; TRACE("%p.\n", handle); - if (!(obj = get_cached_object( handle ))) return STATUS_INVALID_HANDLE; + if ((ret = get_object( handle, &obj))) return ret; if (read( obj->fd, &value, sizeof(value) ) == -1 && errno != EWOULDBLOCK && errno != EAGAIN) ERR("read: %s\n", strerror(errno)); @@ -417,10 +486,13 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an for (i = 0; i < count; i++) { - if ((objs[i] = get_cached_object( handles[i] ))) + ret = get_object( handles[i], &objs[i] ); + if (ret == STATUS_SUCCESS) has_esync = 1; - else + else if (ret == STATUS_NOT_IMPLEMENTED) has_server = 1; + else + return ret; } if (has_esync && has_server) @@ -473,7 +545,7 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an int64_t value; ssize_t size; - if (obj->type == ESYNC_MANUAL_EVENT) + if (obj->type == ESYNC_MANUAL_EVENT || obj->type == ESYNC_MANUAL_SERVER) { /* Don't grab the object, just check if it's signaled. */ if (fds[i].revents & POLLIN) diff --git a/server/esync.c b/server/esync.c index 44214e5fe025..60e989364557 100644 --- a/server/esync.c +++ b/server/esync.c @@ -313,6 +313,22 @@ int esync_create_fd( int initval, int flags ) #endif } +/* Wake up a server-side esync object. */ +void esync_wake_up( struct object *obj ) +{ + static const uint64_t value = 1; + enum esync_type dummy; + int fd; + + if (obj->ops->get_esync_fd) + { + fd = obj->ops->get_esync_fd( obj, &dummy ); + + if (write( fd, &value, sizeof(value) ) == -1) + perror( "esync: write" ); + } +} + DECL_HANDLER(create_esync) { struct esync *esync; diff --git a/server/esync.h b/server/esync.h index 8522d8a69ae4..1241e6d9f1af 100644 --- a/server/esync.h +++ b/server/esync.h @@ -23,3 +23,4 @@ extern int do_esync(void); void esync_init(void); int esync_create_fd( int initval, int flags ); +void esync_wake_up( struct object *obj ); diff --git a/server/thread.c b/server/thread.c index 88c3d7da9aa7..f77a982fd34e 100644 --- a/server/thread.c +++ b/server/thread.c @@ -53,6 +53,7 @@ #include "request.h" #include "user.h" #include "security.h" +#include "esync.h" /* thread queues */ @@ -1142,6 +1143,9 @@ void wake_up( struct object *obj, int max ) struct list *ptr; int ret; + if (do_esync()) + esync_wake_up( obj ); + LIST_FOR_EACH( ptr, &obj->wait_queue ) { struct wait_queue_entry *entry = LIST_ENTRY( ptr, struct wait_queue_entry, entry ); From e40371e1e635293ac623aa8042ed96137b88c03f Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Fri, 8 Jun 2018 21:01:24 -0500 Subject: [PATCH 0282/2542] server: Create eventfd file descriptors for event objects. We still need this, since there are some events which the server signals. This lets system processes shut down. Wine-Staging: eventfd_synchronization --- server/esync.c | 8 ++++++++ server/esync.h | 1 + server/event.c | 29 +++++++++++++++++++++++++++-- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/server/esync.c b/server/esync.c index 60e989364557..b37438cbecc7 100644 --- a/server/esync.c +++ b/server/esync.c @@ -329,6 +329,14 @@ void esync_wake_up( struct object *obj ) } } +void esync_clear( int fd ) +{ + uint64_t value; + + /* we don't care about the return value */ + read( fd, &value, sizeof(value) ); +} + DECL_HANDLER(create_esync) { struct esync *esync; diff --git a/server/esync.h b/server/esync.h index 1241e6d9f1af..d259b5f604da 100644 --- a/server/esync.h +++ b/server/esync.h @@ -24,3 +24,4 @@ extern int do_esync(void); void esync_init(void); int esync_create_fd( int initval, int flags ); void esync_wake_up( struct object *obj ); +void esync_clear( int fd ); diff --git a/server/event.c b/server/event.c index 16cea16e9c27..918b7fa237be 100644 --- a/server/event.c +++ b/server/event.c @@ -35,6 +35,7 @@ #include "thread.h" #include "request.h" #include "security.h" +#include "esync.h" static const WCHAR event_name[] = {'E','v','e','n','t'}; @@ -56,13 +57,16 @@ struct event struct list kernel_object; /* list of kernel object pointers */ int manual_reset; /* is it a manual reset event? */ int signaled; /* event has been signaled */ + int esync_fd; /* esync file descriptor */ }; static void event_dump( struct object *obj, int verbose ); static int event_signaled( struct object *obj, struct wait_queue_entry *entry ); static void event_satisfied( struct object *obj, struct wait_queue_entry *entry ); +static int event_get_esync_fd( struct object *obj, enum esync_type *type ); static int event_signal( struct object *obj, unsigned int access); static struct list *event_get_kernel_obj_list( struct object *obj ); +static void event_destroy( struct object *obj ); static const struct object_ops event_ops = { @@ -72,7 +76,7 @@ static const struct object_ops event_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ event_signaled, /* signaled */ - NULL, /* get_esync_fd */ + event_get_esync_fd, /* get_esync_fd */ event_satisfied, /* satisfied */ event_signal, /* signal */ no_get_fd, /* get_fd */ @@ -86,7 +90,7 @@ static const struct object_ops event_ops = no_open_file, /* open_file */ event_get_kernel_obj_list, /* get_kernel_obj_list */ no_close_handle, /* close_handle */ - no_destroy /* destroy */ + event_destroy /* destroy */ }; @@ -152,6 +156,9 @@ struct event *create_event( struct object *root, const struct unicode_str *name, list_init( &event->kernel_object ); event->manual_reset = manual_reset; event->signaled = initial_state; + + if (do_esync()) + event->esync_fd = esync_create_fd( initial_state, 0 ); } } return event; @@ -180,6 +187,9 @@ void set_event( struct event *event ) void reset_event( struct event *event ) { event->signaled = 0; + + if (do_esync()) + esync_clear( event->esync_fd ); } static void event_dump( struct object *obj, int verbose ) @@ -197,6 +207,13 @@ static int event_signaled( struct object *obj, struct wait_queue_entry *entry ) return event->signaled; } +static int event_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct event *event = (struct event *)obj; + *type = event->manual_reset ? ESYNC_MANUAL_SERVER : ESYNC_AUTO_SERVER; + return event->esync_fd; +} + static void event_satisfied( struct object *obj, struct wait_queue_entry *entry ) { struct event *event = (struct event *)obj; @@ -225,6 +242,14 @@ static struct list *event_get_kernel_obj_list( struct object *obj ) return &event->kernel_object; } +static void event_destroy( struct object *obj ) +{ + struct event *event = (struct event *)obj; + + if (do_esync()) + close( event->esync_fd ); +} + struct keyed_event *create_keyed_event( struct object *root, const struct unicode_str *name, unsigned int attr, const struct security_descriptor *sd ) { From 2cb5ad66f18a8690744f5ff75a445da8be3462c2 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Fri, 8 Jun 2018 21:43:37 -0500 Subject: [PATCH 0283/2542] server: Allow (re)setting esync events on the server side. Some server calls pass an event handle, most notably asyncs. We need to be able to handle these correctly. Accordingly we pass them along to esync if it turns out the underlying object is actually an esync object. In an ideal world we'd just convert all instances of events on the server side to use esyncs instead. But we want to keep esync perfectly configurable, so this is how we do it. Wine-Staging: eventfd_synchronization --- server/esync.c | 22 +++++++++++++++++++++- server/esync.h | 6 ++++++ server/event.c | 15 +++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/server/esync.c b/server/esync.c index b37438cbecc7..669afbc70d7d 100644 --- a/server/esync.c +++ b/server/esync.c @@ -114,7 +114,7 @@ struct esync static void esync_dump( struct object *obj, int verbose ); static void esync_destroy( struct object *obj ); -static const struct object_ops esync_ops = +const struct object_ops esync_ops = { sizeof(struct esync), /* size */ &no_type, /* type */ @@ -337,6 +337,26 @@ void esync_clear( int fd ) read( fd, &value, sizeof(value) ); } +/* Server-side event support. */ +void esync_set_event( struct esync *esync ) +{ + static const uint64_t value = 1; + + assert( esync->obj.ops == &esync_ops ); + if (write( esync->fd, &value, sizeof(value) ) == -1) + perror( "esync: write" ); +} + +void esync_reset_event( struct esync *esync ) +{ + static uint64_t value = 1; + + assert( esync->obj.ops == &esync_ops ); + + /* we don't care about the return value */ + read( esync->fd, &value, sizeof(value) ); +} + DECL_HANDLER(create_esync) { struct esync *esync; diff --git a/server/esync.h b/server/esync.h index d259b5f604da..689d8569b73c 100644 --- a/server/esync.h +++ b/server/esync.h @@ -25,3 +25,9 @@ void esync_init(void); int esync_create_fd( int initval, int flags ); void esync_wake_up( struct object *obj ); void esync_clear( int fd ); + +struct esync; + +extern const struct object_ops esync_ops; +void esync_set_event( struct esync *esync ); +void esync_reset_event( struct esync *esync ); diff --git a/server/event.c b/server/event.c index 918b7fa237be..28a5620268fb 100644 --- a/server/event.c +++ b/server/event.c @@ -166,6 +166,10 @@ struct event *create_event( struct object *root, const struct unicode_str *name, struct event *get_event_obj( struct process *process, obj_handle_t handle, unsigned int access ) { + struct object *obj; + if (do_esync() && (obj = get_handle_obj( process, handle, access, &esync_ops))) + return (struct event *)obj; /* even though it's not an event */ + return (struct event *)get_handle_obj( process, handle, access, &event_ops ); } @@ -179,6 +183,12 @@ static void pulse_event( struct event *event ) void set_event( struct event *event ) { + if (do_esync() && event->obj.ops == &esync_ops) + { + esync_set_event( (struct esync *)event ); + return; + } + event->signaled = 1; /* wake up all waiters if manual reset, a single one otherwise */ wake_up( &event->obj, !event->manual_reset ); @@ -186,6 +196,11 @@ void set_event( struct event *event ) void reset_event( struct event *event ) { + if (do_esync() && event->obj.ops == &esync_ops) + { + esync_reset_event( (struct esync *)event ); + return; + } event->signaled = 0; if (do_esync()) From 368719054d893b30cb3dab2ae2313ec7e42cb8a8 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Fri, 8 Jun 2018 21:58:37 -0500 Subject: [PATCH 0284/2542] ntdll: Try again if poll() returns EINTR. I originally had this return STATUS_USER_APC, but that isn't correct. The server code here is a bit confusing, but only the thread that waits *during* the suspend should receive STATUS_USER_APC (and I imagine that it really should receive STATUS_KERNEL_APC instead). The thread that is suspended should just keep on waiting. Besides, we could be suspended for reasons other than to deliver a system APC. Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index e783517f644d..2f402eb77cdc 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -421,22 +421,32 @@ static LONGLONG update_timeout( ULONGLONG end ) static int do_poll( struct pollfd *fds, nfds_t nfds, ULONGLONG *end ) { - if (end) + int ret; + + do { - LONGLONG timeleft = update_timeout( *end ); + if (end) + { + LONGLONG timeleft = update_timeout( *end ); #ifdef HAVE_PPOLL - /* We use ppoll() if available since the time granularity is better. */ - struct timespec tmo_p; - tmo_p.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; - tmo_p.tv_nsec = (timeleft % TICKSPERSEC) * 100; - return ppoll( fds, nfds, &tmo_p, NULL ); + /* We use ppoll() if available since the time granularity is better. */ + struct timespec tmo_p; + tmo_p.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; + tmo_p.tv_nsec = (timeleft % TICKSPERSEC) * 100; + ret = ppoll( fds, nfds, &tmo_p, NULL ); #else - return poll( fds, nfds, timeleft / TICKSPERMSEC ); + ret = poll( fds, nfds, timeleft / TICKSPERMSEC ); #endif - } - else - return poll( fds, nfds, -1 ); + } + else + ret = poll( fds, nfds, -1 ); + + /* If we receive EINTR we were probably suspended (SIGUSR1), possibly for a + * system APC. The right thing to do is just try again. */ + } while (ret < 0 && errno == EINTR); + + return ret; } static void update_grabbed_object( struct esync *obj ) From 7b623fe6e6f014709226124e5183d67d2cb184fe Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Fri, 8 Jun 2018 22:04:29 -0500 Subject: [PATCH 0285/2542] server: Create eventfd file descriptors for thread objects. Wine-Staging: eventfd_synchronization --- server/thread.c | 17 ++++++++++++++++- server/thread.h | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/server/thread.c b/server/thread.c index f77a982fd34e..f1f9daf90958 100644 --- a/server/thread.c +++ b/server/thread.c @@ -180,6 +180,7 @@ struct type_descr thread_type = static void dump_thread( struct object *obj, int verbose ); static int thread_signaled( struct object *obj, struct wait_queue_entry *entry ); +static int thread_get_esync_fd( struct object *obj, enum esync_type *type ); static unsigned int thread_map_access( struct object *obj, unsigned int access ); static void thread_poll_event( struct fd *fd, int event ); static struct list *thread_get_kernel_obj_list( struct object *obj ); @@ -193,7 +194,7 @@ static const struct object_ops thread_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ thread_signaled, /* signaled */ - NULL, /* get_esync_fd */ + thread_get_esync_fd, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -277,6 +278,7 @@ static inline void init_thread_structure( struct thread *thread ) thread->context = NULL; thread->teb = 0; thread->entry_point = 0; + thread->esync_fd = -1; thread->system_regs = 0; thread->queue = NULL; thread->wait = NULL; @@ -424,6 +426,9 @@ struct thread *create_thread( int fd, struct process *process, const struct secu } } + if (do_esync()) + thread->esync_fd = esync_create_fd( 0, 0 ); + set_fd_events( thread->request_fd, POLLIN ); /* start listening to events */ add_process_thread( thread->process, thread ); return thread; @@ -503,6 +508,9 @@ static void destroy_thread( struct object *obj ) release_object( thread->process ); if (thread->id) free_ptid( thread->id ); if (thread->token) release_object( thread->token ); + + if (do_esync()) + close( thread->esync_fd ); } /* dump a thread on stdout for debugging purposes */ @@ -521,6 +529,13 @@ static int thread_signaled( struct object *obj, struct wait_queue_entry *entry ) return (mythread->state == TERMINATED); } +static int thread_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct thread *thread = (struct thread *)obj; + *type = ESYNC_MANUAL_SERVER; + return thread->esync_fd; +} + static unsigned int thread_map_access( struct object *obj, unsigned int access ) { access = default_map_access( obj, access ); diff --git a/server/thread.h b/server/thread.h index 213b921c35ea..d9c7462c686d 100644 --- a/server/thread.h +++ b/server/thread.h @@ -56,6 +56,7 @@ struct thread struct process *process; thread_id_t id; /* thread id */ struct list mutex_list; /* list of currently owned mutexes */ + int esync_fd; /* esync file descriptor (signalled on exit) */ unsigned int system_regs; /* which system regs have been set */ struct msg_queue *queue; /* message queue */ struct thread_wait *wait; /* current wait condition if sleeping */ From 47c8559e820c8739c408c340527b0dec8b4f5e7f Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Fri, 8 Jun 2018 23:30:17 -0500 Subject: [PATCH 0286/2542] rpcrt4: Avoid closing the server thread handle while it is being waited on. This, or something like this, should go upstream. This is invalid behaviour. Wine-Staging: eventfd_synchronization --- dlls/rpcrt4/rpc_server.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c index eb733f699808..02193b862ba6 100644 --- a/dlls/rpcrt4/rpc_server.c +++ b/dlls/rpcrt4/rpc_server.c @@ -701,10 +701,6 @@ static DWORD CALLBACK RPCRT4_server_thread(LPVOID the_arg) } LeaveCriticalSection(&cps->cs); - EnterCriticalSection(&listen_cs); - CloseHandle(cps->server_thread); - cps->server_thread = NULL; - LeaveCriticalSection(&listen_cs); TRACE("done\n"); return 0; } @@ -1570,7 +1566,10 @@ RPC_STATUS WINAPI RpcMgmtWaitServerListen( void ) LIST_FOR_EACH_ENTRY(protseq, &protseqs, RpcServerProtseq, entry) { if ((wait_thread = protseq->server_thread)) + { + protseq->server_thread = NULL; break; + } } LeaveCriticalSection(&server_cs); if (!wait_thread) @@ -1579,6 +1578,7 @@ RPC_STATUS WINAPI RpcMgmtWaitServerListen( void ) TRACE("waiting for thread %lu\n", GetThreadId(wait_thread)); LeaveCriticalSection(&listen_cs); WaitForSingleObject(wait_thread, INFINITE); + CloseHandle(wait_thread); EnterCriticalSection(&listen_cs); } if (listen_done_event == event) From 7a476038f206827d085b08506dee985a1a934c17 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 16:01:56 -0500 Subject: [PATCH 0287/2542] server: Create eventfd file descriptors for message queues. Wine-Staging: eventfd_synchronization --- server/queue.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/server/queue.c b/server/queue.c index 0cdc949dc890..fa9283cd6a90 100644 --- a/server/queue.c +++ b/server/queue.c @@ -44,6 +44,7 @@ #include "process.h" #include "request.h" #include "user.h" +#include "esync.h" #define WM_NCMOUSEFIRST WM_NCMOUSEMOVE #define WM_NCMOUSELAST (WM_NCMOUSEFIRST+(WM_MOUSELAST-WM_MOUSEFIRST)) @@ -133,6 +134,7 @@ struct msg_queue timeout_t last_get_msg; /* time of last get message call */ int keystate_lock; /* owns an input keystate lock */ const queue_shm_t *shared; /* queue in session shared memory */ + int esync_fd; /* esync file descriptor (signalled on message) */ }; struct hotkey @@ -149,6 +151,7 @@ static void msg_queue_dump( struct object *obj, int verbose ); static int msg_queue_add_queue( struct object *obj, struct wait_queue_entry *entry ); static void msg_queue_remove_queue( struct object *obj, struct wait_queue_entry *entry ); static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entry ); +static int msg_queue_get_esync_fd( struct object *obj, enum esync_type *type ); static void msg_queue_satisfied( struct object *obj, struct wait_queue_entry *entry ); static void msg_queue_destroy( struct object *obj ); static void msg_queue_poll_event( struct fd *fd, int event ); @@ -164,7 +167,7 @@ static const struct object_ops msg_queue_ops = msg_queue_add_queue, /* add_queue */ msg_queue_remove_queue, /* remove_queue */ msg_queue_signaled, /* signaled */ - NULL, /* get_esync_fd */ + msg_queue_get_esync_fd, /* get_esync_fd */ msg_queue_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -314,6 +317,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ queue->hooks = NULL; queue->last_get_msg = current_time; queue->keystate_lock = 0; + queue->esync_fd = -1; list_init( &queue->send_result ); list_init( &queue->callback_result ); list_init( &queue->pending_timers ); @@ -336,6 +340,9 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ } SHARED_WRITE_END; + if (do_esync()) + queue->esync_fd = esync_create_fd( 0, 0 ); + thread->queue = queue; if ((desktop = get_thread_desktop( thread, 0 ))) @@ -745,6 +752,9 @@ static inline void clear_queue_bits( struct msg_queue *queue, unsigned int bits } SHARED_WRITE_END; + if (do_esync() && !is_signaled( queue )) + esync_clear( queue->esync_fd ); + if (!(queue_shm->wake_bits & (QS_KEY | QS_MOUSEBUTTON))) { if (queue->keystate_lock) unlock_input_keystate( queue->input ); @@ -1284,6 +1294,13 @@ static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entr return ret || is_signaled( queue ); } +static int msg_queue_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct msg_queue *queue = (struct msg_queue *)obj; + *type = ESYNC_QUEUE; + return queue->esync_fd; +} + static void msg_queue_satisfied( struct object *obj, struct wait_queue_entry *entry ) { struct msg_queue *queue = (struct msg_queue *)obj; @@ -1340,6 +1357,7 @@ static void msg_queue_destroy( struct object *obj ) if (queue->hooks) release_object( queue->hooks ); if (queue->fd) release_object( queue->fd ); if (queue->shared) free_shared_object( queue->shared ); + if (do_esync()) close( queue->esync_fd ); } static void msg_queue_poll_event( struct fd *fd, int event ) @@ -3127,6 +3145,9 @@ DECL_HANDLER(set_queue_mask) } else wake_up( &queue->obj, 0 ); } + + if (do_esync() && !is_signaled( queue )) + esync_clear( queue->esync_fd ); } } @@ -3139,6 +3160,9 @@ DECL_HANDLER(get_queue_status) { const queue_shm_t *queue_shm = queue->shared; + if (do_esync() && !is_signaled( queue )) + esync_clear( queue->esync_fd ); + reply->wake_bits = queue_shm->wake_bits; reply->changed_bits = queue_shm->changed_bits; @@ -3404,6 +3428,10 @@ DECL_HANDLER(get_message) SHARED_WRITE_END; set_error( STATUS_PENDING ); /* FIXME */ + + if (do_esync() && !is_signaled( queue )) + esync_clear( queue->esync_fd ); + } From 2880810bc15c7fafc552fe4c77937e2d3073ad01 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 16:11:23 -0500 Subject: [PATCH 0288/2542] server, ntdll: Implement message waits. Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 51 +++++++++++++++++++++++++++++++++++++++-- server/protocol.def | 5 ++++ server/queue.c | 20 ++++++++++++++++ 3 files changed, 74 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 2f402eb77cdc..91ac73399e54 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -472,12 +472,13 @@ static void update_grabbed_object( struct esync *obj ) /* A value of STATUS_NOT_IMPLEMENTED returned from this function means that we * need to delegate to server_select(). */ -NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, +static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ) { struct esync *objs[MAXIMUM_WAIT_OBJECTS]; struct pollfd fds[MAXIMUM_WAIT_OBJECTS]; int has_esync = 0, has_server = 0; + BOOL msgwait = FALSE; LONGLONG timeleft; LARGE_INTEGER now; ULONGLONG end; @@ -505,6 +506,9 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an return ret; } + if (objs[count - 1] && objs[count - 1]->type == ESYNC_QUEUE) + msgwait = TRUE; + if (has_esync && has_server) FIXME("Can't wait on esync and server objects at the same time!\n"); else if (has_server) @@ -516,6 +520,9 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an for (i = 0; i < count; i++) TRACE(" %p", handles[i]); + if (msgwait) + TRACE(" or driver events"); + if (!timeout) TRACE(", timeout = INFINITE.\n"); else @@ -555,7 +562,9 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an int64_t value; ssize_t size; - if (obj->type == ESYNC_MANUAL_EVENT || obj->type == ESYNC_MANUAL_SERVER) + if (obj->type == ESYNC_MANUAL_EVENT + || obj->type == ESYNC_MANUAL_SERVER + || obj->type == ESYNC_QUEUE) { /* Don't grab the object, just check if it's signaled. */ if (fds[i].revents & POLLIN) @@ -600,6 +609,44 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an } } +/* We need to let the server know when we are doing a message wait, and when we + * are done with one, so that all of the code surrounding hung queues works. + * We also need this for WaitForInputIdle(). */ +static void server_set_msgwait( int in_msgwait ) +{ + SERVER_START_REQ( esync_msgwait ) + { + req->in_msgwait = in_msgwait; + wine_server_call( req ); + } + SERVER_END_REQ; +} + +/* This is a very thin wrapper around the proper implementation above. The + * purpose is to make sure the server knows when we are doing a message wait. + * This is separated into a wrapper function since there are at least a dozen + * exit paths from esync_wait_objects(). */ +NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, + BOOLEAN alertable, const LARGE_INTEGER *timeout ) +{ + BOOL msgwait = FALSE; + struct esync *obj; + NTSTATUS ret; + + if (count && !get_object( handles[count - 1], &obj ) && obj->type == ESYNC_QUEUE) + { + msgwait = TRUE; + server_set_msgwait( 1 ); + } + + ret = __esync_wait_objects( count, handles, wait_any, alertable, timeout ); + + if (msgwait) + server_set_msgwait( 0 ); + + return ret; +} + void esync_init(void) { struct stat st; diff --git a/server/protocol.def b/server/protocol.def index ba58356cf3b9..56f6aa29fdef 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -4110,3 +4110,8 @@ enum esync_type int type; unsigned int shm_idx; @END + +/* Notify the server that we are doing a message wait or done with one. */ +@REQ(esync_msgwait) + int in_msgwait; /* are we in a message wait? */ +@END diff --git a/server/queue.c b/server/queue.c index fa9283cd6a90..29e4b0178533 100644 --- a/server/queue.c +++ b/server/queue.c @@ -135,6 +135,7 @@ struct msg_queue int keystate_lock; /* owns an input keystate lock */ const queue_shm_t *shared; /* queue in session shared memory */ int esync_fd; /* esync file descriptor (signalled on message) */ + int esync_in_msgwait; /* our thread is currently waiting on us */ }; struct hotkey @@ -318,6 +319,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ queue->last_get_msg = current_time; queue->keystate_lock = 0; queue->esync_fd = -1; + queue->esync_in_msgwait = 0; list_init( &queue->send_result ); list_init( &queue->callback_result ); list_init( &queue->pending_timers ); @@ -1240,6 +1242,10 @@ static int is_queue_hung( struct msg_queue *queue ) if (get_wait_queue_thread(entry)->queue == queue) return 0; /* thread is waiting on queue -> not hung */ } + + if (do_esync() && queue->esync_in_msgwait) + return 0; /* thread is waiting on queue in absentia -> not hung */ + return 1; } @@ -4235,3 +4241,17 @@ DECL_HANDLER(set_keyboard_repeat) release_object( desktop ); } + +DECL_HANDLER(esync_msgwait) +{ + struct msg_queue *queue = get_current_queue(); + + if (!queue) return; + queue->esync_in_msgwait = req->in_msgwait; + + check_thread_queue_idle( current ); + + /* and start/stop waiting on the driver */ + if (queue->fd) + set_fd_events( queue->fd, req->in_msgwait ? POLLIN : 0 ); +} From d7dbcf749751a81efec7aac5d95fb260c6e58f9e Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 9 Jun 2018 15:39:37 -0500 Subject: [PATCH 0289/2542] server: Create eventfd descriptors for device manager objects. We don't have to worry about synchronization here because wine_ntoskrnl_main_loop() is only ever called from one thread per winedevice process. This lets drivers like mountmgr finally work, and so winecfg can open the Drives tab. Wine-Staging: eventfd_synchronization --- server/device.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/server/device.c b/server/device.c index ddfe6c6e931b..52a22968ed2a 100644 --- a/server/device.c +++ b/server/device.c @@ -38,6 +38,7 @@ #include "handle.h" #include "request.h" #include "process.h" +#include "esync.h" /* IRP object */ @@ -93,10 +94,12 @@ struct device_manager struct list requests; /* list of pending irps across all devices */ struct irp_call *current_call; /* call currently executed on client side */ struct wine_rb_tree kernel_objects; /* map of objects that have client side pointer associated */ + int esync_fd; /* esync file descriptor */ }; static void device_manager_dump( struct object *obj, int verbose ); static int device_manager_signaled( struct object *obj, struct wait_queue_entry *entry ); +static int device_manager_get_esync_fd( struct object *obj, enum esync_type *type ); static void device_manager_destroy( struct object *obj ); static const struct object_ops device_manager_ops = @@ -107,7 +110,7 @@ static const struct object_ops device_manager_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ device_manager_signaled, /* signaled */ - NULL, /* get_esync_fd */ + device_manager_get_esync_fd, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -752,6 +755,9 @@ static void delete_file( struct device_file *file ) /* terminate all pending requests */ LIST_FOR_EACH_ENTRY_SAFE( irp, next, &file->requests, struct irp_call, dev_entry ) { + if (do_esync() && file->device->manager && list_empty( &file->device->manager->requests )) + esync_clear( file->device->manager->esync_fd ); + list_remove( &irp->mgr_entry ); set_irp_result( irp, STATUS_FILE_DELETED, NULL, 0, 0 ); } @@ -787,6 +793,13 @@ static int device_manager_signaled( struct object *obj, struct wait_queue_entry return !list_empty( &manager->requests ); } +static int device_manager_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct device_manager *manager = (struct device_manager *)obj; + *type = ESYNC_MANUAL_SERVER; + return manager->esync_fd; +} + static void device_manager_destroy( struct object *obj ) { struct device_manager *manager = (struct device_manager *)obj; @@ -821,6 +834,9 @@ static void device_manager_destroy( struct object *obj ) assert( !irp->file && !irp->async ); release_object( irp ); } + + if (do_esync()) + close( manager->esync_fd ); } static struct device_manager *create_device_manager(void) @@ -833,6 +849,9 @@ static struct device_manager *create_device_manager(void) list_init( &manager->devices ); list_init( &manager->requests ); wine_rb_init( &manager->kernel_objects, compare_kernel_object ); + + if (do_esync()) + manager->esync_fd = esync_create_fd( 0, 0 ); } return manager; } @@ -1022,6 +1041,9 @@ DECL_HANDLER(get_next_device_request) /* we already own the object if it's only on manager queue */ if (irp->file) grab_object( irp ); manager->current_call = irp; + + if (do_esync() && list_empty( &manager->requests )) + esync_clear( manager->esync_fd ); } else close_handle( current->process, reply->next ); } From ec42ca4d8676bf97b2baf0133b97aed871bd693b Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 16:34:56 -0500 Subject: [PATCH 0290/2542] ntdll, server: Implement NtCreateMutant(). Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 16 ++++++++++++++++ dlls/ntdll/unix/esync.h | 3 +++ dlls/ntdll/unix/sync.c | 4 ++++ server/esync.c | 14 ++++++++++++++ 4 files changed, 37 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 91ac73399e54..263b3ef21846 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -81,6 +81,13 @@ struct semaphore }; C_ASSERT(sizeof(struct semaphore) == 8); +struct mutex +{ + DWORD tid; + int count; /* recursion count */ +}; +C_ASSERT(sizeof(struct mutex) == 8); + struct event { int signaled; @@ -405,6 +412,15 @@ NTSTATUS esync_reset_event( HANDLE handle ) return STATUS_SUCCESS; } +NTSTATUS esync_create_mutex( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, BOOLEAN initial ) +{ + TRACE("name %s, initial %d.\n", + attr ? debugstr_us(attr->ObjectName) : "", initial); + + return create_esync( ESYNC_MUTEX, handle, access, attr, initial ? 0 : 1, 0 ); +} + #define TICKSPERSEC 10000000 #define TICKSPERMSEC 10000 diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h index 6e5d6233a2e4..9b2f88670d1f 100644 --- a/dlls/ntdll/unix/esync.h +++ b/dlls/ntdll/unix/esync.h @@ -31,6 +31,9 @@ extern NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, extern NTSTATUS esync_reset_event( HANDLE handle ); extern NTSTATUS esync_set_event( HANDLE handle ); +extern NTSTATUS esync_create_mutex( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, BOOLEAN initial ); + extern NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 70d038bf64ef..75fa9fcc44b1 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -598,6 +598,10 @@ NTSTATUS WINAPI NtCreateMutant( HANDLE *handle, ACCESS_MASK access, const OBJECT struct object_attributes *objattr; *handle = 0; + + if (do_esync()) + return esync_create_mutex( handle, access, attr, owned ); + if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret; SERVER_START_REQ( create_mutex ) diff --git a/server/esync.c b/server/esync.c index 669afbc70d7d..3f1c61bc1f00 100644 --- a/server/esync.c +++ b/server/esync.c @@ -202,6 +202,13 @@ struct semaphore }; C_ASSERT(sizeof(struct semaphore) == 8); +struct mutex +{ + DWORD tid; + int count; /* recursion count */ +}; +C_ASSERT(sizeof(struct mutex) == 8); + struct event { int signaled; @@ -272,6 +279,13 @@ struct esync *create_esync( struct object *root, const struct unicode_str *name, event->locked = 0; break; } + case ESYNC_MUTEX: + { + struct mutex *mutex = get_shm( esync->shm_idx ); + mutex->tid = initval ? 0 : current->id; + mutex->count = initval ? 0 : 1; + break; + } default: assert( 0 ); } From 08ba715ea5ae0fd7e66835d43a7a20c65f4692df Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 16:37:49 -0500 Subject: [PATCH 0291/2542] ntdll: Implement NtReleaseMutant(). Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 34 ++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/esync.h | 1 + dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 38 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 263b3ef21846..829388bc68bc 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -421,6 +421,40 @@ NTSTATUS esync_create_mutex( HANDLE *handle, ACCESS_MASK access, return create_esync( ESYNC_MUTEX, handle, access, attr, initial ? 0 : 1, 0 ); } +NTSTATUS esync_release_mutex( HANDLE *handle, LONG *prev ) +{ + struct esync *obj; + struct mutex *mutex; + static const uint64_t value = 1; + NTSTATUS ret; + + TRACE("%p, %p.\n", handle, prev); + + if ((ret = get_object( handle, &obj ))) return ret; + mutex = obj->shm; + + /* This is thread-safe, because the only thread that can change the tid to + * or from our tid is ours. */ + if (mutex->tid != GetCurrentThreadId()) return STATUS_MUTANT_NOT_OWNED; + + if (prev) *prev = mutex->count; + + mutex->count--; + + if (!mutex->count) + { + /* This is also thread-safe, as long as signaling the file is the last + * thing we do. Other threads don't care about the tid if it isn't + * theirs. */ + mutex->tid = 0; + + if (write( obj->fd, &value, sizeof(value) ) == -1) + return errno_to_status( errno ); + } + + return STATUS_SUCCESS; +} + #define TICKSPERSEC 10000000 #define TICKSPERMSEC 10000 diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h index 9b2f88670d1f..8eaa79a58239 100644 --- a/dlls/ntdll/unix/esync.h +++ b/dlls/ntdll/unix/esync.h @@ -33,6 +33,7 @@ extern NTSTATUS esync_set_event( HANDLE handle ); extern NTSTATUS esync_create_mutex( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, BOOLEAN initial ); +extern NTSTATUS esync_release_mutex( HANDLE *handle, LONG *prev ); extern NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 75fa9fcc44b1..a822fab014ad 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -651,6 +651,9 @@ NTSTATUS WINAPI NtReleaseMutant( HANDLE handle, LONG *prev_count ) { unsigned int ret; + if (do_esync()) + return esync_release_mutex( handle, prev_count ); + SERVER_START_REQ( release_mutex ) { req->handle = wine_server_obj_handle( handle ); From 2d6026e237e155c6956d13faf17ef79ed338570e Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 16:42:13 -0500 Subject: [PATCH 0292/2542] ntdll: Implement waiting on mutexes. Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 829388bc68bc..7c09f8a35039 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -501,7 +501,16 @@ static int do_poll( struct pollfd *fds, nfds_t nfds, ULONGLONG *end ) static void update_grabbed_object( struct esync *obj ) { - if (obj->type == ESYNC_SEMAPHORE) + if (obj->type == ESYNC_MUTEX) + { + struct mutex *mutex = obj->shm; + /* We don't have to worry about a race between this and read(); the + * fact that we grabbed it means the count is now zero, so nobody else + * can (and the only thread that can release it is us). */ + mutex->tid = GetCurrentThreadId(); + mutex->count++; + } + else if (obj->type == ESYNC_SEMAPHORE) { struct semaphore *semaphore = obj->shm; /* We don't have to worry about a race between this and read(); the @@ -587,7 +596,25 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA { for (i = 0; i < count; i++) { - fds[i].fd = objs[i] ? objs[i]->fd : -1; + struct esync *obj = objs[i]; + + if (obj && obj->type == ESYNC_MUTEX) + { + /* If we already own the mutex, return immediately. */ + /* Note: This violates the assumption that the *first* object + * to be signaled will be returned. If that becomes a problem, + * we can always check the state of each object before waiting. */ + struct mutex *mutex = (struct mutex *)obj; + + if (mutex->tid == GetCurrentThreadId()) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + mutex->count++; + return i; + } + } + + fds[i].fd = obj ? obj->fd : -1; fds[i].events = POLLIN; } From 9f3fa9aa3113ecb0f572779fd41d9dfe66bc68f6 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 16:47:38 -0500 Subject: [PATCH 0293/2542] ntdll: Implement wait-all. Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 142 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 129 insertions(+), 13 deletions(-) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 7c09f8a35039..8874a16d4751 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -541,7 +541,9 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA LONGLONG timeleft; LARGE_INTEGER now; ULONGLONG end; - int i, ret; + int64_t value; + ssize_t size; + int i, j, ret; NtQuerySystemTime( &now ); if (timeout) @@ -636,9 +638,6 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA if (obj) { - int64_t value; - ssize_t size; - if (obj->type == ESYNC_MANUAL_EVENT || obj->type == ESYNC_MANUAL_SERVER || obj->type == ESYNC_QUEUE) @@ -667,22 +666,139 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA * we were waiting for. So keep waiting. */ NtQuerySystemTime( &now ); } - else if (ret == 0) + else + goto err; + } + } + else + { + /* Wait-all is a little trickier to implement correctly. Fortunately, + * it's not as common. + * + * The idea is basically just to wait in sequence on every object in the + * set. Then when we're done, try to grab them all in a tight loop. If + * that fails, release any resources we've grabbed (and yes, we can + * reliably do this—it's just mutexes and semaphores that we have to + * put back, and in both cases we just put back 1), and if any of that + * fails we start over. + * + * What makes this inherently bad is that we might temporarily grab a + * resource incorrectly. Hopefully it'll be quick (and hey, it won't + * block on wineserver) so nobody will notice. Besides, consider: if + * object A becomes signaled but someone grabs it before we can grab it + * and everything else, then they could just as well have grabbed it + * before it became signaled. Similarly if object A was signaled and we + * were blocking on object B, then B becomes available and someone grabs + * A before we can, then they might have grabbed A before B became + * signaled. In either case anyone who tries to wait on A or B will be + * waiting for an instant while we put things back. */ + + while (1) + { +tryagain: + /* First step: try to poll on each object in sequence. */ + fds[0].events = POLLIN; + for (i = 0; i < count; i++) { - TRACE("Wait timed out.\n"); - return STATUS_TIMEOUT; + struct esync *obj = objs[i]; + + fds[0].fd = obj ? obj->fd : -1; + + if (obj && obj->type == ESYNC_MUTEX) + { + /* It might be ours. */ + struct mutex *mutex = obj->shm; + + if (mutex->tid == GetCurrentThreadId()) + continue; + } + + ret = do_poll( fds, 1, timeout ? &end : NULL ); + if (ret <= 0) + goto err; + + if (fds[0].revents & (POLLHUP | POLLERR | POLLNVAL)) + { + ERR("Polling on fd %d returned %#x.\n", fds[0].fd, fds[0].revents); + return STATUS_INVALID_HANDLE; + } } - else + + /* If we got here and we haven't timed out, that means all of the + * handles were signaled. Check to make sure they still are. */ + for (i = 0; i < count; i++) { - ERR("ppoll failed: %s\n", strerror( errno )); - return errno_to_status( errno ); + fds[i].fd = objs[i] ? objs[i]->fd : -1; + fds[i].events = POLLIN; } - } + + /* Poll everything to see if they're still signaled. */ + ret = poll( fds, count, 0 ); + if (ret == count) + { + /* Quick, grab everything. */ + for (i = 0; i < count; i++) + { + struct esync *obj = objs[i]; + + switch (obj->type) + { + case ESYNC_MUTEX: + { + struct mutex *mutex = obj->shm; + if (mutex->tid == GetCurrentThreadId()) + break; + /* otherwise fall through */ + } + case ESYNC_SEMAPHORE: + case ESYNC_AUTO_EVENT: + if ((size = read( fds[i].fd, &value, sizeof(value) )) != sizeof(value)) + { + /* We were too slow. Put everything back. */ + value = 1; + for (j = i; j >= 0; j--) + { + if (write( obj->fd, &value, sizeof(value) ) == -1) + return errno_to_status( errno ); + } + + goto tryagain; /* break out of two loops and a switch */ + } + break; + default: + /* If a manual-reset event changed between there and + * here, it's shouldn't be a problem. */ + break; + } + } + + /* If we got here, we successfully waited on every object. */ + /* Make sure to let ourselves know that we grabbed the mutexes + * and semaphores. */ + for (i = 0; i < count; i++) + update_grabbed_object( objs[i] ); + + TRACE("Wait successful.\n"); + return STATUS_SUCCESS; + } + + /* If we got here, ppoll() returned less than all of our objects. + * So loop back to the beginning and try again. */ + } /* while(1) */ + } /* else (wait-all) */ + +err: + /* We should only get here if poll() failed. */ + + if (ret == 0) + { + TRACE("Wait timed out.\n"); + return STATUS_TIMEOUT; } else { - FIXME("Wait-all not implemented.\n"); - return STATUS_NOT_IMPLEMENTED; + ERR("ppoll failed: %s\n", strerror(errno)); + return errno_to_status( errno ); } } From 8f5902e15f6318a5f048db52a71425097b0c0736 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 9 Jun 2018 22:44:57 -0500 Subject: [PATCH 0294/2542] esync: Add a README. Wine-Staging: eventfd_synchronization --- README.esync | 184 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 README.esync diff --git a/README.esync b/README.esync new file mode 100644 index 000000000000..8fcb969011b1 --- /dev/null +++ b/README.esync @@ -0,0 +1,184 @@ +This is eventfd-based synchronization, or 'esync' for short. Turn it on with +WINEESYNC=1 (note that it checks the presence and not the value); debug it +with +esync. + +The aim is to execute all synchronization operations in "user-space", that is, +without going through wineserver. We do this using Linux's eventfd +facility. The main impetus to using eventfd is so that we can poll multiple +objects at once; in particular we can't do this with futexes, or pthread +semaphores, or the like. The only way I know of to wait on any of multiple +objects is to use select/poll/epoll to wait on multiple fds, and eventfd gives +us those fds in a quite usable way. + +Whenever a semaphore, event, or mutex is created, we have the server, instead +of creating a traditional server-side event/semaphore/mutex, instead create an +'esync' primitive. These live in esync.c and are very slim objects; in fact, +they don't even know what type of primitive they are. The server is involved +at all because we still need a way of creating named objects, passing handles +to another process, etc. + +The server creates an eventfd file descriptor with the requested parameters +and passes it back to ntdll. ntdll creates an object of the appropriate type, +then caches it in a table. This table is copied almost wholesale from the fd +cache code in server.c. + +Specific operations follow quite straightforwardly from eventfd: + +* To release an object, or set an event, we simply write() to it. +* An object is signalled if read() succeeds on it. Notably, we create all + eventfd descriptors with O_NONBLOCK, so that we can atomically check if an + object is signalled and grab it if it is. This also lets us reset events. +* For objects whose state should not be reset upon waiting—e.g. manual-reset + events—we simply check for the POLLIN flag instead of reading. +* Semaphores are handled by the EFD_SEMAPHORE flag. This matches up quite well + (although with some difficulties; see below). +* Mutexes store their owner thread locally. This isn't reliable information if + a different process's thread owns the mutex, but this doesn't matter—a + thread should only care whether it owns the mutex, so it knows whether to + try waiting on it or simply to increase the recursion count. + +The interesting part about esync is that (almost) all waits happen in ntdll, +including those on server-bound objects. The idea here is that on the server +side, for any waitable object, we create an eventfd file descriptor (not an +esync primitive), and then pass it to ntdll if the program tries to wait on +it. These are cached too, so only the first wait will require a round trip to +the server. Then the server signals the file descriptor as appropriate, and +thereby wakes up the client. So far this is implemented for processes, +threads, message queues (difficult; see below), and device managers (necessary +for drivers to work). All of these are necessarily server-bound, so we +wouldn't really gain anything by signalling on the client side instead. Of +course, except possibly for message queues, it's not likely that any program +(cutting-edge D3D game or not) is going to be causing a great wineserver load +by waiting on any of these objects; the motivation was rather to provide a way +to wait on ntdll-bound and server-bound objects at the same time. + +Some cases are still passed to the server, and there's probably no reason not +to keep them that way. Those that I noticed while testing include: async +objects, which are internal to the file APIs and never exposed to userspace, +startup_info objects, which are internal to the loader and signalled when a +process starts, and keyed events, which are exposed through an ntdll API +(although not through kernel32) but can't be mixed with other objects (you +have to use NtWaitForKeyedEvent()). Other cases include: named pipes, debug +events, sockets, and timers. It's unlikely we'll want to optimize debug events +or sockets (or any of the other, rather rare, objects), but it is possible +we'll want to optimize named pipes or timers. + +There were two sort of complications when working out the above. The first one +was events. The trouble is that (1) the server actually creates some events by +itself and (2) the server sometimes manipulates events passed by the +client. Resolving the first case was easy enough, and merely entailed creating +eventfd descriptors for the events the same way as for processes and threads +(note that we don't really lose anything this way; the events include +"LowMemoryCondition" and the event that signals system processes to shut +down). For the second case I basically had to hook the server-side event +functions to redirect to esync versions if the event was actually an esync +primitive. + +The second complication was message queues. The difficulty here is that X11 +signals events by writing into a pipe (at least I think it's a pipe?), and so +as a result wineserver has to poll on that descriptor. In theory we could just +let wineserver do so and then signal us as appropriate, except that wineserver +only polls on the pipe when the thread is waiting for events (otherwise we'd +get e.g. keyboard input while the thread is doing something else, and spin +forever trying to wake up a thread that doesn't care). The obvious solution is +just to poll on that fd ourselves, and that's what I did—it's just that +getting the fd from wineserver was kind of ugly, and the code for waiting was +also kind of ugly basically because we have to wait on both X11's fd and the +"normal" process/thread-style wineserver fd that we use to signal sent +messages. The upshot about the whole thing was that races are basically +impossible, since a thread can only wait on its own queue. + +I had kind of figured that APCs just wouldn't work, but then poll() spat EINTR +at me and I realized that this wasn't necessarily true. It seems that the +server will suspend a thread when trying to deliver a system APC to a thread +that's not waiting, and since the server has no idea that we're waiting it +just suspends us. This of course interrupts poll(), which complains at us, and +it turns out that just returning STATUS_USER_APC in that case is enough to +make rpcrt4 happy. + +There are a couple things that this infrastructure can't handle, although +surprisingly there aren't that many. In particular: +* We can't return the previous count on a semaphore, since we have no way to + query the count on a semaphore through eventfd. Currently the code lies and + returns 1 every time. We can make this work (in a single process, or [if + necessary] in multiple processes through shared memory) by keeping a count + locally. We can't guarantee that it's the exact count at the moment the + semaphore was released, but I guess any program that runs into that race + shouldn't be depending on that fact anyway. +* Similarly, we can't enforce the maximum count on a semaphore, since we have + no way to get the current count and subsequently compare it with the + maximum. +* We can't use NtQueryMutant to get the mutant's owner or count if it lives in + a different process. If necessary we can use shared memory to make this + work, I guess, but see below. +* User APCs don't work. However, it's not impossible to make them work; in + particular I think this could be relatively easily implemented by waiting on + another internal file descriptor when we execute an alertable wait. +* Implementing wait-all, i.e. WaitForMultipleObjects(..., TRUE, ...), is not + exactly possible the way we'd like it to be possible. In theory that + function should wait until it knows all objects are available, then grab + them all at once atomically. The server (like the kernel) can do this + because the server is single-threaded and can't race with itself. We can't + do this in ntdll, though. The approach I've taken I've laid out in great + detail in the relevant patch, but for a quick summary we poll on each object + until it's signaled (but don't grab it), check them all again, and if + they're all signaled we try to grab them all at once in a tight loop, and if + we fail on any of them we reset the count on whatever we shouldn't have + consumed. Such a blip would necessarily be very quick. +* The whole patchset only works on Linux, where eventfd is available. However, + it should be possible to make it work on a Mac, since eventfd is just a + quicker, easier way to use pipes (i.e. instead of writing 1 to the fd you'd + write 1 byte; instead of reading a 64-bit value from the fd you'd read as + many bytes as you can carry, which is admittedly less than 2**64 but + can probably be something reasonable.) It's also possible, although I + haven't yet looked, to use some different kind of synchronization + primitives, but pipes would be easiest to tack onto this framework. +* We might hit the maximum number of open fd's. On my system the soft limit is + 1024 and the hard limit is 1048576. I'm inclined to hope this won't be an + issue, since a hypothetical Linux port of any application might just as well + use the same number of eventfds. +* PulseEvent() can't work the way it's supposed to work. Fortunately it's rare + and deprecated. It's also explicitly mentioned on MSDN that a thread can + miss the notification for a kernel APC, so in a sense we're not necessarily + doing anything wrong. + +There are some things that are perfectly implementable but that I just haven't +done yet: +* NtOpen* (aka Open*). This is just a matter of adding another open_esync + request analogous to those for other server primitives. +* NtQuery*. This can be done to some degree (the difficulties are outlined + above). That said, these APIs aren't exposed through kernel32 in any way, so + I doubt anyone is going to be using them. +* SignalObjectAndWait(). The server combines this into a single operation, but + according to MSDN it doesn't need to be atomic, so we can just signal the + appropriate object and wait, and woe betide anyone who gets in the way of + those two operations. +* Other synchronizable server primitives. It's unlikely we'll need any of + these, except perhaps named pipes (which would honestly be rather difficult) + and (maybe) timers. + +This patchset was inspired by Daniel Santos' "hybrid synchronization" +patchset. My idea was to create a framework whereby even contended waits could +be executed in userspace, eliminating a lot of the complexity that his +synchronization primitives used. I do however owe some significant gratitude +toward him for setting me on the right path. + +I've tried to maximize code separation, both to make any potential rebases +easier and to ensure that esync is only active when configured. All code in +existing source files is guarded with "if (do_esync())", and generally that +condition is followed by "return esync_version_of_this_method(...);", where +the latter lives in esync.c and is declared in esync.h. I've also tried to +make the patchset very clear and readable—to write it as if I were going to +submit it upstream. (Some intermediate patches do break things, which Wine is +generally against, but I think it's for the better in this case.) I have cut +some corners, though; there is some error checking missing, or implicit +assumptions that the program is behaving correctly. + +I've tried to be careful about races. There are a lot of comments whose +purpose are basically to assure me that races are impossible. In most cases we +don't have to worry about races since all of the low-level synchronization is +done by the kernel. + +Anyway, yeah, this is esync. Use it if you like. + +--Zebediah Figura \ No newline at end of file From 6b49e43528a3ca2c98241659f8c5f01b88d59fb4 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 16:52:39 -0500 Subject: [PATCH 0295/2542] ntdll: Implement NtSignalAndWaitForSingleObject(). Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 28 ++++++++++++++++++++++++++++ dlls/ntdll/unix/esync.h | 2 ++ dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 33 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 8874a16d4751..2c7702cd120a 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -840,6 +840,34 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an return ret; } +NTSTATUS esync_signal_and_wait( HANDLE signal, HANDLE wait, BOOLEAN alertable, + const LARGE_INTEGER *timeout ) +{ + struct esync *obj; + NTSTATUS ret; + + if ((ret = get_object( signal, &obj ))) return ret; + + switch (obj->type) + { + case ESYNC_SEMAPHORE: + ret = esync_release_semaphore( signal, 1, NULL ); + break; + case ESYNC_AUTO_EVENT: + case ESYNC_MANUAL_EVENT: + ret = esync_set_event( signal ); + break; + case ESYNC_MUTEX: + ret = esync_release_mutex( signal, NULL ); + break; + default: + return STATUS_OBJECT_TYPE_MISMATCH; + } + if (ret) return ret; + + return esync_wait_objects( 1, &wait, TRUE, alertable, timeout ); +} + void esync_init(void) { struct stat st; diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h index 8eaa79a58239..88a6d5c89751 100644 --- a/dlls/ntdll/unix/esync.h +++ b/dlls/ntdll/unix/esync.h @@ -37,6 +37,8 @@ extern NTSTATUS esync_release_mutex( HANDLE *handle, LONG *prev ); extern NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ); +extern NTSTATUS esync_signal_and_wait( HANDLE signal, HANDLE wait, BOOLEAN alertable, + const LARGE_INTEGER *timeout ); /* We have to synchronize on the fd cache mutex so that our calls to receive_fd diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index a822fab014ad..fcfbb61df14d 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -1636,6 +1636,9 @@ NTSTATUS WINAPI NtSignalAndWaitForSingleObject( HANDLE signal, HANDLE wait, union select_op select_op; UINT flags = SELECT_INTERRUPTIBLE; + if (do_esync()) + return esync_signal_and_wait( signal, wait, alertable, timeout ); + if (!signal) return STATUS_INVALID_HANDLE; if (alertable) flags |= SELECT_ALERTABLE; From 5c1b967c317d092b33238ef3715df921699a2f52 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 16:56:09 -0500 Subject: [PATCH 0296/2542] ntdll: Implement NtOpenSemaphore(). Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 47 +++++++++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/esync.h | 2 ++ dlls/ntdll/unix/sync.c | 4 ++++ server/esync.c | 31 +++++++++++++++++++++++++++ server/protocol.def | 12 +++++++++++ 5 files changed, 96 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 2c7702cd120a..ee550e29b747 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -326,6 +326,45 @@ static NTSTATUS create_esync( enum esync_type type, HANDLE *handle, ACCESS_MASK return ret; } +static NTSTATUS open_esync( enum esync_type type, HANDLE *handle, + ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) +{ + NTSTATUS ret; + obj_handle_t fd_handle; + unsigned int shm_idx; + sigset_t sigset; + int fd; + + server_enter_uninterrupted_section( &fd_cache_mutex, &sigset ); + SERVER_START_REQ( open_esync ) + { + req->access = access; + req->attributes = attr->Attributes; + req->rootdir = wine_server_obj_handle( attr->RootDirectory ); + req->type = type; + if (attr->ObjectName) + wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length ); + if (!(ret = wine_server_call( req ))) + { + *handle = wine_server_ptr_handle( reply->handle ); + type = reply->type; + shm_idx = reply->shm_idx; + fd = receive_fd( &fd_handle ); + assert( wine_server_ptr_handle(fd_handle) == *handle ); + } + } + SERVER_END_REQ; + server_leave_uninterrupted_section( &fd_cache_mutex, &sigset ); + + if (!ret) + { + add_to_list( *handle, type, fd, shm_idx ? get_shm( shm_idx ) : 0 ); + + TRACE("-> handle %p, fd %d.\n", *handle, fd); + } + return ret; +} + extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max) { @@ -335,6 +374,14 @@ extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access, return create_esync( ESYNC_SEMAPHORE, handle, access, attr, initial, max ); } +NTSTATUS esync_open_semaphore( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ) +{ + TRACE("name %s.\n", debugstr_us(attr->ObjectName)); + + return open_esync( ESYNC_SEMAPHORE, handle, access, attr ); +} + NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) { struct esync *obj; diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h index 88a6d5c89751..6818be9c16f5 100644 --- a/dlls/ntdll/unix/esync.h +++ b/dlls/ntdll/unix/esync.h @@ -24,6 +24,8 @@ extern NTSTATUS esync_close( HANDLE handle ); extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max); +extern NTSTATUS esync_open_semaphore( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ); extern NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ); extern NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index fcfbb61df14d..8c664d6898db 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -343,6 +343,10 @@ NTSTATUS WINAPI NtOpenSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJEC unsigned int ret; *handle = 0; + + if (do_esync()) + return esync_open_semaphore( handle, access, attr ); + if ((ret = validate_open_object_attributes( attr ))) return ret; SERVER_START_REQ( open_semaphore ) diff --git a/server/esync.c b/server/esync.c index 3f1c61bc1f00..eca9b6aa67db 100644 --- a/server/esync.c +++ b/server/esync.c @@ -410,6 +410,37 @@ DECL_HANDLER(create_esync) if (root) release_object( root ); } +DECL_HANDLER(open_esync) +{ + struct unicode_str name = get_req_unicode_str(); + + reply->handle = open_object( current->process, req->rootdir, req->access, + &esync_ops, &name, req->attributes ); + + /* send over the fd */ + if (reply->handle) + { + struct esync *esync; + + if (!(esync = (struct esync *)get_handle_obj( current->process, reply->handle, + 0, &esync_ops ))) + return; + + if (!type_matches( req->type, esync->type )) + { + set_error( STATUS_OBJECT_TYPE_MISMATCH ); + release_object( esync ); + return; + } + + reply->type = esync->type; + reply->shm_idx = esync->shm_idx; + + send_client_fd( current->process, esync->fd, reply->handle ); + release_object( esync ); + } +} + /* Retrieve a file descriptor for an esync object which will be signaled by the * server. The client should only read from (i.e. wait on) this object. */ DECL_HANDLER(get_esync_fd) diff --git a/server/protocol.def b/server/protocol.def index 56f6aa29fdef..a29a56d671a3 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -4103,6 +4103,18 @@ enum esync_type unsigned int shm_idx; @END +@REQ(open_esync) + unsigned int access; /* wanted access rights */ + unsigned int attributes; /* object attributes */ + obj_handle_t rootdir; /* root directory */ + int type; /* type of esync object (above) */ + VARARG(name,unicode_str); /* object name */ +@REPLY + obj_handle_t handle; /* handle to the event */ + int type; /* type of esync object (above) */ + unsigned int shm_idx; /* this object's index into the shm section */ +@END + /* Retrieve the esync fd for an object. */ @REQ(get_esync_fd) obj_handle_t handle; /* handle to the object */ From 6b77960a2c8435b1cadf22c42ea2ca3bd2af42a2 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 16:58:19 -0500 Subject: [PATCH 0297/2542] ntdll: Implement NtOpenEvent(). Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 8 ++++++++ dlls/ntdll/unix/esync.h | 2 ++ dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 13 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index ee550e29b747..38a6d30c868b 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -427,6 +427,14 @@ NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, return create_esync( type, handle, access, attr, initial, 0 ); } +NTSTATUS esync_open_event( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ) +{ + TRACE("name %s.\n", debugstr_us(attr->ObjectName)); + + return open_esync( ESYNC_AUTO_EVENT, handle, access, attr ); /* doesn't matter which */ +} + NTSTATUS esync_set_event( HANDLE handle ) { static const uint64_t value = 1; diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h index 6818be9c16f5..03894d61fcfb 100644 --- a/dlls/ntdll/unix/esync.h +++ b/dlls/ntdll/unix/esync.h @@ -30,6 +30,8 @@ extern NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev extern NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial ); +extern NTSTATUS esync_open_event( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ); extern NTSTATUS esync_reset_event( HANDLE handle ); extern NTSTATUS esync_set_event( HANDLE handle ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 8c664d6898db..aadb3f3acdbc 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -466,6 +466,9 @@ NTSTATUS WINAPI NtOpenEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_AT *handle = 0; if ((ret = validate_open_object_attributes( attr ))) return ret; + if (do_esync()) + return esync_open_event( handle, access, attr ); + SERVER_START_REQ( open_event ) { req->access = access; From 98cb0830309778577912a4cbdbdccf846d052e51 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 16:59:35 -0500 Subject: [PATCH 0298/2542] ntdll: Implement NtOpenMutant(). Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 8 ++++++++ dlls/ntdll/unix/esync.h | 2 ++ dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 13 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 38a6d30c868b..875bf9cd6520 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -476,6 +476,14 @@ NTSTATUS esync_create_mutex( HANDLE *handle, ACCESS_MASK access, return create_esync( ESYNC_MUTEX, handle, access, attr, initial ? 0 : 1, 0 ); } +NTSTATUS esync_open_mutex( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ) +{ + TRACE("name %s.\n", debugstr_us(attr->ObjectName)); + + return open_esync( ESYNC_MUTEX, handle, access, attr ); +} + NTSTATUS esync_release_mutex( HANDLE *handle, LONG *prev ) { struct esync *obj; diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h index 03894d61fcfb..ac12604a815a 100644 --- a/dlls/ntdll/unix/esync.h +++ b/dlls/ntdll/unix/esync.h @@ -37,6 +37,8 @@ extern NTSTATUS esync_set_event( HANDLE handle ); extern NTSTATUS esync_create_mutex( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, BOOLEAN initial ); +extern NTSTATUS esync_open_mutex( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ); extern NTSTATUS esync_release_mutex( HANDLE *handle, LONG *prev ); extern NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index aadb3f3acdbc..1caa142f5a05 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -636,6 +636,9 @@ NTSTATUS WINAPI NtOpenMutant( HANDLE *handle, ACCESS_MASK access, const OBJECT_A *handle = 0; if ((ret = validate_open_object_attributes( attr ))) return ret; + if (do_esync()) + return esync_open_mutex( handle, access, attr ); + SERVER_START_REQ( open_mutex ) { req->access = access; From 12ec1815b2ddca4e61c45729eef24e414b6c7805 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 10 Jun 2018 19:08:18 -0500 Subject: [PATCH 0299/2542] server: Implement esync_map_access(). Wine-Staging: eventfd_synchronization --- server/esync.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/server/esync.c b/server/esync.c index eca9b6aa67db..3a334b3b330c 100644 --- a/server/esync.c +++ b/server/esync.c @@ -112,6 +112,7 @@ struct esync }; static void esync_dump( struct object *obj, int verbose ); +static unsigned int esync_map_access( struct object *obj, unsigned int access ); static void esync_destroy( struct object *obj ); const struct object_ops esync_ops = @@ -126,7 +127,7 @@ const struct object_ops esync_ops = NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ - default_map_access, /* map_access */ + esync_map_access, /* map_access */ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ default_get_full_name, /* get_full_name */ @@ -146,6 +147,16 @@ static void esync_dump( struct object *obj, int verbose ) fprintf( stderr, "esync fd=%d\n", esync->fd ); } +static unsigned int esync_map_access( struct object *obj, unsigned int access ) +{ + /* Sync objects have the same flags. */ + if (access & GENERIC_READ) access |= STANDARD_RIGHTS_READ | EVENT_QUERY_STATE; + if (access & GENERIC_WRITE) access |= STANDARD_RIGHTS_WRITE | EVENT_MODIFY_STATE; + if (access & GENERIC_EXECUTE) access |= STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE; + if (access & GENERIC_ALL) access |= STANDARD_RIGHTS_ALL | EVENT_QUERY_STATE | EVENT_MODIFY_STATE; + return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL); +} + static void esync_destroy( struct object *obj ) { struct esync *esync = (struct esync *)obj; From 93139e6c65670794a34f7a95b3a5d8483e34ed3b Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 17:03:05 -0500 Subject: [PATCH 0300/2542] server: Implement NtDuplicateObject(). Wine-Staging: eventfd_synchronization --- server/esync.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server/esync.c b/server/esync.c index 3a334b3b330c..c5587bef6cfd 100644 --- a/server/esync.c +++ b/server/esync.c @@ -112,6 +112,7 @@ struct esync }; static void esync_dump( struct object *obj, int verbose ); +static int esync_get_esync_fd( struct object *obj, enum esync_type *type ); static unsigned int esync_map_access( struct object *obj, unsigned int access ); static void esync_destroy( struct object *obj ); @@ -123,7 +124,7 @@ const struct object_ops esync_ops = no_add_queue, /* add_queue */ NULL, /* remove_queue */ NULL, /* signaled */ - NULL, /* get_esync_fd */ + esync_get_esync_fd, /* get_esync_fd */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -147,6 +148,13 @@ static void esync_dump( struct object *obj, int verbose ) fprintf( stderr, "esync fd=%d\n", esync->fd ); } +static int esync_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct esync *esync = (struct esync *)obj; + *type = esync->type; + return esync->fd; +} + static unsigned int esync_map_access( struct object *obj, unsigned int access ) { /* Sync objects have the same flags. */ From c81f62e1b1d0fec9c3a4e9fef428b3d131b5f382 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Fri, 15 Jun 2018 11:01:44 -0500 Subject: [PATCH 0301/2542] server: Create eventfd descriptors for timers. Wine-Staging: eventfd_synchronization --- server/timer.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/server/timer.c b/server/timer.c index 883f30fa97e8..b4ab61132113 100644 --- a/server/timer.c +++ b/server/timer.c @@ -35,6 +35,7 @@ #include "file.h" #include "handle.h" #include "request.h" +#include "esync.h" static const WCHAR timer_name[] = {'T','i','m','e','r'}; @@ -61,10 +62,12 @@ struct timer struct thread *thread; /* thread that set the APC function */ client_ptr_t callback; /* callback APC function */ client_ptr_t arg; /* callback argument */ + int esync_fd; /* esync file descriptor */ }; static void timer_dump( struct object *obj, int verbose ); static int timer_signaled( struct object *obj, struct wait_queue_entry *entry ); +static int timer_get_esync_fd( struct object *obj, enum esync_type *type ); static void timer_satisfied( struct object *obj, struct wait_queue_entry *entry ); static void timer_destroy( struct object *obj ); @@ -76,7 +79,7 @@ static const struct object_ops timer_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ timer_signaled, /* signaled */ - NULL, /* get_esync_fd */ + timer_get_esync_fd, /* get_esync_fd */ timer_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -111,6 +114,10 @@ static struct timer *create_timer( struct object *root, const struct unicode_str timer->period = 0; timer->timeout = NULL; timer->thread = NULL; + timer->esync_fd = -1; + + if (do_esync()) + timer->esync_fd = esync_create_fd( 0, 0 ); } } return timer; @@ -182,6 +189,9 @@ static int set_timer( struct timer *timer, timeout_t expire, unsigned int period { period = 0; /* period doesn't make any sense for a manual timer */ timer->signaled = 0; + + if (do_esync()) + esync_clear( timer->esync_fd ); } timer->when = (expire <= 0) ? expire - monotonic_time : max( expire, current_time ); timer->period = period; @@ -209,6 +219,13 @@ static int timer_signaled( struct object *obj, struct wait_queue_entry *entry ) return timer->signaled; } +static int timer_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct timer *timer = (struct timer *)obj; + *type = timer->manual ? ESYNC_MANUAL_SERVER : ESYNC_AUTO_SERVER; + return timer->esync_fd; +} + static void timer_satisfied( struct object *obj, struct wait_queue_entry *entry ) { struct timer *timer = (struct timer *)obj; @@ -223,6 +240,7 @@ static void timer_destroy( struct object *obj ) if (timer->timeout) remove_timeout_user( timer->timeout ); if (timer->thread) release_object( timer->thread ); + if (do_esync()) close( timer->esync_fd ); } /* create a timer */ From 0331c47fb2f1021f74e682795b65443eeabf049e Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 17:17:31 -0500 Subject: [PATCH 0302/2542] ntdll, server: Implement alertable waits. Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 77 +++++++++++++++++++++++++++++++--- dlls/ntdll/unix/unix_private.h | 1 + dlls/ntdll/unix/virtual.c | 1 + server/esync.c | 20 +++++++-- server/esync.h | 1 + server/protocol.def | 4 ++ server/thread.c | 13 ++++++ server/thread.h | 1 + 8 files changed, 109 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 875bf9cd6520..db453daa2294 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -597,17 +597,42 @@ static void update_grabbed_object( struct esync *obj ) static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ) { + static const LARGE_INTEGER zero; + struct esync *objs[MAXIMUM_WAIT_OBJECTS]; - struct pollfd fds[MAXIMUM_WAIT_OBJECTS]; + struct pollfd fds[MAXIMUM_WAIT_OBJECTS + 1]; int has_esync = 0, has_server = 0; BOOL msgwait = FALSE; LONGLONG timeleft; LARGE_INTEGER now; + DWORD pollcount; ULONGLONG end; int64_t value; ssize_t size; int i, j, ret; + /* Grab the APC fd if we don't already have it. */ + if (alertable && ntdll_get_thread_data()->esync_apc_fd == -1) + { + obj_handle_t fd_handle; + sigset_t sigset; + int fd = -1; + + server_enter_uninterrupted_section( &fd_cache_mutex, &sigset ); + SERVER_START_REQ( get_esync_apc_fd ) + { + if (!(ret = wine_server_call( req ))) + { + fd = receive_fd( &fd_handle ); + assert( fd_handle == GetCurrentThreadId() ); + } + } + SERVER_END_REQ; + server_leave_uninterrupted_section( &fd_cache_mutex, &sigset ); + + ntdll_get_thread_data()->esync_apc_fd = fd; + } + NtQuerySystemTime( &now ); if (timeout) { @@ -646,6 +671,8 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA if (msgwait) TRACE(" or driver events"); + if (alertable) + TRACE(", alertable"); if (!timeout) TRACE(", timeout = INFINITE.\n"); @@ -682,12 +709,27 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA fds[i].fd = obj ? obj->fd : -1; fds[i].events = POLLIN; } + if (alertable) + { + fds[i].fd = ntdll_get_thread_data()->esync_apc_fd; + fds[i].events = POLLIN; + i++; + } + pollcount = i; while (1) { - ret = do_poll( fds, count, timeout ? &end : NULL ); + ret = do_poll( fds, pollcount, timeout ? &end : NULL ); if (ret > 0) { + /* We must check this first! The server may set an event that + * we're waiting on, but we need to return STATUS_USER_APC. */ + if (alertable) + { + if (fds[pollcount - 1].revents & POLLIN) + goto userapc; + } + /* Find out which object triggered the wait. */ for (i = 0; i < count; i++) { @@ -761,6 +803,14 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA tryagain: /* First step: try to poll on each object in sequence. */ fds[0].events = POLLIN; + pollcount = 1; + if (alertable) + { + /* We also need to wait on APCs. */ + fds[1].fd = ntdll_get_thread_data()->esync_apc_fd; + fds[1].events = POLLIN; + pollcount++; + } for (i = 0; i < count; i++) { struct esync *obj = objs[i]; @@ -776,9 +826,11 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA continue; } - ret = do_poll( fds, 1, timeout ? &end : NULL ); + ret = do_poll( fds, pollcount, timeout ? &end : NULL ); if (ret <= 0) goto err; + else if (alertable && (fds[1].revents & POLLIN)) + goto userapc; if (fds[0].revents & (POLLHUP | POLLERR | POLLNVAL)) { @@ -794,10 +846,12 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA fds[i].fd = objs[i] ? objs[i]->fd : -1; fds[i].events = POLLIN; } + /* There's no reason to check for APCs here. */ + pollcount = i; /* Poll everything to see if they're still signaled. */ - ret = poll( fds, count, 0 ); - if (ret == count) + ret = poll( fds, pollcount, 0 ); + if (ret == pollcount) { /* Quick, grab everything. */ for (i = 0; i < count; i++) @@ -863,6 +917,19 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA ERR("ppoll failed: %s\n", strerror(errno)); return errno_to_status( errno ); } + +userapc: + TRACE("Woken up by user APC.\n"); + + /* We have to make a server call anyway to get the APC to execute, so just + * delegate down to server_select(). */ + ret = server_wait( NULL, 0, SELECT_INTERRUPTIBLE | SELECT_ALERTABLE, &zero ); + + /* This can happen if we received a system APC, and the APC fd was woken up + * before we got SIGUSR1. poll() doesn't return EINTR in that case. The + * right thing to do seems to be to return STATUS_USER_APC anyway. */ + if (ret == STATUS_TIMEOUT) ret = STATUS_USER_APC; + return ret; } /* We need to let the server know when we are doing a message wait, and when we diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 007b4fb85bc9..2b66358e9d0d 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -103,6 +103,7 @@ struct ntdll_thread_data { void *cpu_data[16]; /* reserved for CPU-specific data */ void *kernel_stack; /* stack for thread startup and kernel syscalls */ + int esync_apc_fd; /* fd to wait on for user APCs */ int request_fd; /* fd for sending server requests */ int reply_fd; /* fd for receiving server replies */ int wait_fd[2]; /* fd for sleeping server requests */ diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 31fa04fdab39..0cb73466ad21 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -4085,6 +4085,7 @@ static TEB *init_teb( void *ptr, BOOL is_wow ) teb->StaticUnicodeString.Buffer = teb->StaticUnicodeBuffer; teb->StaticUnicodeString.MaximumLength = sizeof(teb->StaticUnicodeBuffer); thread_data = (struct ntdll_thread_data *)&teb->GdiTebBatch; + thread_data->esync_apc_fd = -1; thread_data->request_fd = -1; thread_data->reply_fd = -1; thread_data->wait_fd[0] = -1; diff --git a/server/esync.c b/server/esync.c index c5587bef6cfd..0c365006f0ba 100644 --- a/server/esync.c +++ b/server/esync.c @@ -346,19 +346,25 @@ int esync_create_fd( int initval, int flags ) #endif } +/* Wake up a specific fd. */ +void esync_wake_fd( int fd ) +{ + static const uint64_t value = 1; + + if (write( fd, &value, sizeof(value) ) == -1) + perror( "esync: write" ); +} + /* Wake up a server-side esync object. */ void esync_wake_up( struct object *obj ) { - static const uint64_t value = 1; enum esync_type dummy; int fd; if (obj->ops->get_esync_fd) { fd = obj->ops->get_esync_fd( obj, &dummy ); - - if (write( fd, &value, sizeof(value) ) == -1) - perror( "esync: write" ); + esync_wake_fd( fd ); } } @@ -496,3 +502,9 @@ DECL_HANDLER(get_esync_fd) release_object( obj ); } + +/* Return the fd used for waiting on user APCs. */ +DECL_HANDLER(get_esync_apc_fd) +{ + send_client_fd( current->process, current->esync_apc_fd, current->id ); +} diff --git a/server/esync.h b/server/esync.h index 689d8569b73c..e1588d205d91 100644 --- a/server/esync.h +++ b/server/esync.h @@ -23,6 +23,7 @@ extern int do_esync(void); void esync_init(void); int esync_create_fd( int initval, int flags ); +void esync_wake_fd( int fd ); void esync_wake_up( struct object *obj ); void esync_clear( int fd ); diff --git a/server/protocol.def b/server/protocol.def index a29a56d671a3..f71c0415b8eb 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -4127,3 +4127,7 @@ enum esync_type @REQ(esync_msgwait) int in_msgwait; /* are we in a message wait? */ @END + +/* Retrieve the fd to wait on for user APCs. */ +@REQ(get_esync_apc_fd) +@END diff --git a/server/thread.c b/server/thread.c index f1f9daf90958..ed31e7f98ce7 100644 --- a/server/thread.c +++ b/server/thread.c @@ -279,6 +279,7 @@ static inline void init_thread_structure( struct thread *thread ) thread->teb = 0; thread->entry_point = 0; thread->esync_fd = -1; + thread->esync_apc_fd = -1; thread->system_regs = 0; thread->queue = NULL; thread->wait = NULL; @@ -427,7 +428,10 @@ struct thread *create_thread( int fd, struct process *process, const struct secu } if (do_esync()) + { thread->esync_fd = esync_create_fd( 0, 0 ); + thread->esync_apc_fd = esync_create_fd( 0, 0 ); + } set_fd_events( thread->request_fd, POLLIN ); /* start listening to events */ add_process_thread( thread->process, thread ); @@ -1245,8 +1249,13 @@ static int queue_apc( struct process *process, struct thread *thread, struct thr grab_object( apc ); list_add_tail( queue, &apc->entry ); if (!list_prev( queue, &apc->entry )) /* first one */ + { wake_thread( thread ); + if (do_esync() && queue == &thread->user_apc) + esync_wake_fd( thread->esync_apc_fd ); + } + return 1; } @@ -1292,6 +1301,10 @@ static struct thread_apc *thread_dequeue_apc( struct thread *thread, int system apc = LIST_ENTRY( ptr, struct thread_apc, entry ); list_remove( ptr ); } + + if (do_esync() && list_empty( &thread->system_apc ) && list_empty( &thread->user_apc )) + esync_clear( thread->esync_apc_fd ); + return apc; } diff --git a/server/thread.h b/server/thread.h index d9c7462c686d..ffab4bbffae0 100644 --- a/server/thread.h +++ b/server/thread.h @@ -57,6 +57,7 @@ struct thread thread_id_t id; /* thread id */ struct list mutex_list; /* list of currently owned mutexes */ int esync_fd; /* esync file descriptor (signalled on exit) */ + int esync_apc_fd; /* esync apc fd (signalled when APCs are present) */ unsigned int system_regs; /* which system regs have been set */ struct msg_queue *queue; /* message queue */ struct thread_wait *wait; /* current wait condition if sleeping */ From df9beed834539b49ee3f54ddcf7b3b2b92cf1e7f Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 10 Jun 2018 13:53:08 -0500 Subject: [PATCH 0303/2542] esync: Update README. Wine-Staging: eventfd_synchronization --- README.esync | 48 +++++++++++++++++------------------------------- 1 file changed, 17 insertions(+), 31 deletions(-) diff --git a/README.esync b/README.esync index 8fcb969011b1..627cc3f481e7 100644 --- a/README.esync +++ b/README.esync @@ -88,32 +88,23 @@ also kind of ugly basically because we have to wait on both X11's fd and the messages. The upshot about the whole thing was that races are basically impossible, since a thread can only wait on its own queue. -I had kind of figured that APCs just wouldn't work, but then poll() spat EINTR -at me and I realized that this wasn't necessarily true. It seems that the -server will suspend a thread when trying to deliver a system APC to a thread -that's not waiting, and since the server has no idea that we're waiting it -just suspends us. This of course interrupts poll(), which complains at us, and -it turns out that just returning STATUS_USER_APC in that case is enough to -make rpcrt4 happy. +System APCs already work, since the server will forcibly suspend a thread if +it's not already waiting, and so we just need to check for EINTR from +poll(). User APCs and alertable waits are implemented in a similar style to +message queues (well, sort of): whenever someone executes an alertable wait, +we add an additional eventfd to the list, which the server signals when an APC +arrives. If that eventfd gets signaled, we hand it off to the server to take +care of, and return STATUS_USER_APC. + +Originally I kept the volatile state of semaphores and mutexes inside a +variable local to the handle, with the knowledge that this would break if +someone tried to open the handle elsewhere or duplicate it. It did, and so now +this state is stored inside shared memory. This is of the POSIX variety, is +allocated by the server (but never mapped there) and lives under the path +"/wine-esync". There are a couple things that this infrastructure can't handle, although surprisingly there aren't that many. In particular: -* We can't return the previous count on a semaphore, since we have no way to - query the count on a semaphore through eventfd. Currently the code lies and - returns 1 every time. We can make this work (in a single process, or [if - necessary] in multiple processes through shared memory) by keeping a count - locally. We can't guarantee that it's the exact count at the moment the - semaphore was released, but I guess any program that runs into that race - shouldn't be depending on that fact anyway. -* Similarly, we can't enforce the maximum count on a semaphore, since we have - no way to get the current count and subsequently compare it with the - maximum. -* We can't use NtQueryMutant to get the mutant's owner or count if it lives in - a different process. If necessary we can use shared memory to make this - work, I guess, but see below. -* User APCs don't work. However, it's not impossible to make them work; in - particular I think this could be relatively easily implemented by waiting on - another internal file descriptor when we execute an alertable wait. * Implementing wait-all, i.e. WaitForMultipleObjects(..., TRUE, ...), is not exactly possible the way we'd like it to be possible. In theory that function should wait until it knows all objects are available, then grab @@ -144,18 +135,13 @@ surprisingly there aren't that many. In particular: There are some things that are perfectly implementable but that I just haven't done yet: -* NtOpen* (aka Open*). This is just a matter of adding another open_esync - request analogous to those for other server primitives. -* NtQuery*. This can be done to some degree (the difficulties are outlined - above). That said, these APIs aren't exposed through kernel32 in any way, so +* NtQuery*. That said, these APIs aren't exposed through kernel32 in any way, so I doubt anyone is going to be using them. -* SignalObjectAndWait(). The server combines this into a single operation, but - according to MSDN it doesn't need to be atomic, so we can just signal the - appropriate object and wait, and woe betide anyone who gets in the way of - those two operations. * Other synchronizable server primitives. It's unlikely we'll need any of these, except perhaps named pipes (which would honestly be rather difficult) and (maybe) timers. +* Access masks. We'd need to store these inside ntdll, and validate them when + someone tries to execute esync operations. This patchset was inspired by Daniel Santos' "hybrid synchronization" patchset. My idea was to create a framework whereby even contended waits could From cd6713ae8f8d53137fdb550c07349a0e15005061 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 13 Jun 2018 22:25:40 -0500 Subject: [PATCH 0304/2542] kernel32/tests: Mark some existing tests as failing under esync. Wine-Staging: eventfd_synchronization --- dlls/kernel32/tests/sync.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c index 49420e4519f6..9a5136699d71 100644 --- a/dlls/kernel32/tests/sync.c +++ b/dlls/kernel32/tests/sync.c @@ -269,7 +269,8 @@ static void test_mutex(void) SetLastError(0xdeadbeef); hOpened = OpenMutexA(GENERIC_READ | GENERIC_WRITE, FALSE, "WineTestMutex"); ok(hOpened != NULL, "OpenMutex failed with error %ld\n", GetLastError()); - wait_ret = WaitForSingleObject(hOpened, INFINITE); + wait_ret = WaitForSingleObject(hOpened, 0); +todo_wine_if(getenv("WINEESYNC")) /* XFAIL: validation is not implemented */ ok(wait_ret == WAIT_FAILED, "WaitForSingleObject succeeded\n"); CloseHandle(hOpened); @@ -300,6 +301,7 @@ static void test_mutex(void) SetLastError(0xdeadbeef); ret = ReleaseMutex(hCreated); +todo_wine_if(getenv("WINEESYNC")) /* XFAIL: due to the above */ ok(!ret && (GetLastError() == ERROR_NOT_OWNER), "ReleaseMutex should have failed with ERROR_NOT_OWNER instead of %ld\n", GetLastError()); From 6adc22d62ac227062a63f7b1d78f90ce4fc46fd0 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 13 Jun 2018 22:40:47 -0500 Subject: [PATCH 0305/2542] kernel32/tests: Add some semaphore tests. Wine-Staging: eventfd_synchronization --- dlls/kernel32/tests/sync.c | 98 +++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c index 9a5136699d71..79d9f82dd4ce 100644 --- a/dlls/kernel32/tests/sync.c +++ b/dlls/kernel32/tests/sync.c @@ -628,7 +628,10 @@ static void test_event(void) static void test_semaphore(void) { - HANDLE handle, handle2; + HANDLE handle, handle2, handles[2]; + DWORD ret; + LONG prev; + int i; /* test case sensitivity */ @@ -670,6 +673,99 @@ static void test_semaphore(void) ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError()); CloseHandle( handle ); + + handle = CreateSemaphoreA( NULL, 0, 5, NULL ); + ok(!!handle, "CreateSemaphore failed: %lu\n", GetLastError()); + + ret = WaitForSingleObject( handle, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + ret = ReleaseSemaphore( handle, 1, &prev ); + ok(ret, "got error %lu\n", GetLastError()); + ok(prev == 0, "got prev %ld\n", prev); + + ret = ReleaseSemaphore( handle, 1, &prev ); + ok(ret, "got error %lu\n", GetLastError()); + ok(prev == 1, "got prev %ld\n", prev); + + ret = ReleaseSemaphore( handle, 5, &prev ); + ok(!ret, "got %ld\n", ret); + ok(GetLastError() == ERROR_TOO_MANY_POSTS, "got error %lu\n", GetLastError()); + ok(prev == 1, "got prev %ld\n", prev); + + ret = ReleaseSemaphore( handle, 2, &prev ); + ok(ret, "got error %lu\n", GetLastError()); + ok(prev == 2, "got prev %ld\n", prev); + + ret = ReleaseSemaphore( handle, 1, &prev ); + ok(ret, "got error %lu\n", GetLastError()); + ok(prev == 4, "got prev %ld\n", prev); + + for (i = 0; i < 5; i++) + { + ret = WaitForSingleObject( handle, 0 ); + ok(ret == 0, "got %lu\n", ret); + } + + ret = WaitForSingleObject( handle, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + handle2 = CreateSemaphoreA( NULL, 3, 5, NULL ); + ok(!!handle2, "CreateSemaphore failed: %lu\n", GetLastError()); + + ret = ReleaseSemaphore( handle2, 1, &prev ); + ok(ret, "got error %lu\n", GetLastError()); + ok(prev == 3, "got prev %ld\n", prev); + + for (i = 0; i < 4; i++) + { + ret = WaitForSingleObject( handle2, 0 ); + ok(ret == 0, "got %lu\n", ret); + } + + ret = WaitForSingleObject( handle2, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + handles[0] = handle; + handles[1] = handle2; + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + ReleaseSemaphore( handle, 1, NULL ); + ReleaseSemaphore( handle2, 1, NULL ); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == 1, "got %lu\n", ret); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + ReleaseSemaphore( handle, 1, NULL ); + ReleaseSemaphore( handle2, 1, NULL ); + + ret = WaitForMultipleObjects( 2, handles, TRUE, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + ReleaseSemaphore( handle, 1, NULL ); + + ret = WaitForMultipleObjects( 2, handles, TRUE, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + ret = WaitForSingleObject( handle, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ret = CloseHandle( handle ); + ok(ret, "got error %lu\n", ret); + + ret = CloseHandle( handle2 ); + ok(ret, "got error %lu\n", ret); } static void test_waitable_timer(void) From d0b87a9721a910bc6d68c6a22234465bdd6df793 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 13 Jun 2018 22:59:37 -0500 Subject: [PATCH 0306/2542] kernel32/tests: Add some event tests. Wine-Staging: eventfd_synchronization --- dlls/kernel32/tests/sync.c | 119 ++++++++++++++++++++++++++++++++++++- 1 file changed, 118 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c index 79d9f82dd4ce..95af04253cff 100644 --- a/dlls/kernel32/tests/sync.c +++ b/dlls/kernel32/tests/sync.c @@ -515,12 +515,13 @@ static void test_slist(void) static void test_event(void) { - HANDLE handle, handle2; + HANDLE handle, handle2, handles[2]; SECURITY_ATTRIBUTES sa; SECURITY_DESCRIPTOR sd; ACL acl; DWORD ret; BOOL val; + int i; /* no sd */ handle = CreateEventA(NULL, FALSE, FALSE, __FILE__ ": Test Event"); @@ -624,6 +625,122 @@ static void test_event(void) ok( ret, "QueryMemoryResourceNotification failed err %lu\n", GetLastError() ); ok( val == FALSE || val == TRUE, "wrong value %u\n", val ); CloseHandle( handle ); + + handle = CreateEventA( NULL, TRUE, FALSE, NULL ); + ok(!!handle, "got error %lu\n", GetLastError()); + + ret = WaitForSingleObject( handle, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + ret = SetEvent( handle ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = SetEvent( handle ); + ok(ret, "got error %lu\n", GetLastError()); + + for (i = 0; i < 100; i++) + { + ret = WaitForSingleObject( handle, 0 ); + ok(ret == 0, "got %lu\n", ret); + } + + ret = ResetEvent( handle ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = ResetEvent( handle ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = WaitForSingleObject( handle, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + handle2 = CreateEventA( NULL, FALSE, TRUE, NULL ); + ok(!!handle2, "got error %lu\n", GetLastError()); + + ret = WaitForSingleObject( handle2, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ret = WaitForSingleObject( handle2, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + ret = SetEvent( handle2 ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = SetEvent( handle2 ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = ResetEvent( handle2 ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = ResetEvent( handle2 ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = WaitForSingleObject( handle2, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + handles[0] = handle; + handles[1] = handle2; + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + SetEvent( handle ); + SetEvent( handle2 ); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ret = WaitForSingleObject( handle2, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ResetEvent( handle ); + SetEvent( handle2 ); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == 1, "got %lu\n", ret); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + SetEvent( handle ); + SetEvent( handle2 ); + + ret = WaitForMultipleObjects( 2, handles, TRUE, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ret = WaitForMultipleObjects( 2, handles, TRUE, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + SetEvent( handle2 ); + ResetEvent( handle ); + + ret = WaitForMultipleObjects( 2, handles, TRUE, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + ret = WaitForSingleObject( handle2, 0 ); + ok(ret == 0, "got %lu\n", ret); + + handles[0] = handle2; + handles[1] = handle; + SetEvent( handle ); + SetEvent( handle2 ); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == 1, "got %lu\n", ret); + + ret = WaitForMultipleObjects( 2, handles, FALSE, 0 ); + ok(ret == 1, "got %lu\n", ret); + + ret = CloseHandle( handle ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = CloseHandle( handle2 ); + ok(ret, "got error %lu\n", GetLastError()); } static void test_semaphore(void) From b1450f76b8dba509e3b7895eb5285703e965e9fe Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 13 Jun 2018 23:32:04 -0500 Subject: [PATCH 0307/2542] kernel32/tests: Add some mutex tests. Wine-Staging: eventfd_synchronization --- dlls/kernel32/tests/sync.c | 94 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c index 95af04253cff..ca9d58167439 100644 --- a/dlls/kernel32/tests/sync.c +++ b/dlls/kernel32/tests/sync.c @@ -228,8 +228,23 @@ static void test_temporary_objects(void) ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %lu\n", GetLastError()); } +static HANDLE mutex, mutex2, mutices[2]; + +static DWORD WINAPI mutex_thread( void *param ) +{ + DWORD expect = (DWORD)(DWORD_PTR)param; + DWORD ret; + + ret = WaitForSingleObject( mutex, 0 ); + ok(ret == expect, "expected %lu, got %lu\n", expect, ret); + + if (!ret) ReleaseMutex( mutex ); + return 0; +} + static void test_mutex(void) { + HANDLE thread; DWORD wait_ret; BOOL ret; HANDLE hCreated; @@ -340,6 +355,85 @@ todo_wine_if(getenv("WINEESYNC")) /* XFAIL: due to the above */ CloseHandle(hOpened); CloseHandle(hCreated); + + mutex = CreateMutexA( NULL, FALSE, NULL ); + ok(!!mutex, "got error %lu\n", GetLastError()); + + ret = ReleaseMutex( mutex ); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_NOT_OWNER, "got error %lu\n", GetLastError()); + + for (i = 0; i < 100; i++) + { + ret = WaitForSingleObject( mutex, 0 ); + ok(ret == 0, "got %u\n", ret); + } + + for (i = 0; i < 100; i++) + { + ret = ReleaseMutex( mutex ); + ok(ret, "got error %lu\n", GetLastError()); + } + + ret = ReleaseMutex( mutex ); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_NOT_OWNER, "got error %lu\n", GetLastError()); + + thread = CreateThread( NULL, 0, mutex_thread, (void *)0, 0, NULL ); + ret = WaitForSingleObject( thread, 2000 ); + ok(ret == 0, "wait failed: %u\n", ret); + + WaitForSingleObject( mutex, 0 ); + + thread = CreateThread( NULL, 0, mutex_thread, (void *)WAIT_TIMEOUT, 0, NULL ); + ret = WaitForSingleObject( thread, 2000 ); + ok(ret == 0, "wait failed: %u\n", ret); + + ret = ReleaseMutex( mutex ); + ok(ret, "got error %lu\n", GetLastError()); + + thread = CreateThread( NULL, 0, mutex_thread, (void *)0, 0, NULL ); + ret = WaitForSingleObject( thread, 2000 ); + ok(ret == 0, "wait failed: %u\n", ret); + + mutex2 = CreateMutexA( NULL, TRUE, NULL ); + ok(!!mutex2, "got error %lu\n", GetLastError()); + + ret = ReleaseMutex( mutex2 ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = ReleaseMutex( mutex2 ); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_NOT_OWNER, "got error %lu\n", GetLastError()); + + mutices[0] = mutex; + mutices[1] = mutex2; + + ret = WaitForMultipleObjects( 2, mutices, FALSE, 0 ); + ok(ret == 0, "got %u\n", ret); + + ret = ReleaseMutex( mutex ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = ReleaseMutex( mutex2 ); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_NOT_OWNER, "got error %lu\n", GetLastError()); + + ret = WaitForMultipleObjects( 2, mutices, TRUE, 0 ); + ok(ret == 0, "got %u\n", ret); + + ret = ReleaseMutex( mutex ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = ReleaseMutex( mutex2 ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = CloseHandle( mutex ); + ok(ret, "got error %lu\n", GetLastError()); + + ret = CloseHandle( mutex2 ); + ok(ret, "got error %lu\n", GetLastError()); + } static void test_slist(void) From 651ca040531201cd2f6ed77afab1864406c3cbad Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 13 Jun 2018 23:58:01 -0500 Subject: [PATCH 0308/2542] kernel32/tests: Add some tests for wait timeouts. Wine-Staging: eventfd_synchronization --- dlls/kernel32/tests/sync.c | 68 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c index ca9d58167439..8d281ef130d7 100644 --- a/dlls/kernel32/tests/sync.c +++ b/dlls/kernel32/tests/sync.c @@ -58,6 +58,7 @@ static BOOLEAN (WINAPI *pTryAcquireSRWLockShared)(PSRWLOCK); static NTSTATUS (WINAPI *pNtAllocateVirtualMemory)(HANDLE, PVOID *, ULONG_PTR, SIZE_T *, ULONG, ULONG); static NTSTATUS (WINAPI *pNtFreeVirtualMemory)(HANDLE, PVOID *, SIZE_T *, ULONG); +static NTSTATUS (WINAPI *pNtQuerySystemTime)(LARGE_INTEGER *); static NTSTATUS (WINAPI *pNtWaitForSingleObject)(HANDLE, BOOLEAN, const LARGE_INTEGER *); static NTSTATUS (WINAPI *pNtWaitForMultipleObjects)(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*); static PSLIST_ENTRY (__fastcall *pRtlInterlockedPushListSList)(PSLIST_HEADER list, PSLIST_ENTRY first, @@ -1531,11 +1532,15 @@ static HANDLE modify_handle(HANDLE handle, DWORD modify) return ULongToHandle(tmp); } +#define TIMEOUT_INFINITE (((LONGLONG)0x7fffffff) << 32 | 0xffffffff) + static void test_WaitForSingleObject(void) { HANDLE signaled, nonsignaled, invalid; + LARGE_INTEGER ntnow, ntthen; LARGE_INTEGER timeout; NTSTATUS status; + DWORD now, then; DWORD ret; signaled = CreateEventW(NULL, TRUE, TRUE, NULL); @@ -1620,6 +1625,68 @@ static void test_WaitForSingleObject(void) status = pNtWaitForSingleObject(GetCurrentThread(), FALSE, &timeout); ok(status == STATUS_TIMEOUT, "expected STATUS_TIMEOUT, got %08lx\n", status); + ret = WaitForSingleObject( signaled, 0 ); + ok(ret == 0, "got %lu\n", ret); + + ret = WaitForSingleObject( nonsignaled, 0 ); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + + /* test that a timed wait actually does wait */ + now = GetTickCount(); + ret = WaitForSingleObject( nonsignaled, 100 ); + then = GetTickCount(); + ok(ret == WAIT_TIMEOUT, "got %lu\n", ret); + ok(abs((then - now) - 100) < 5, "got %lu ms\n", then - now); + + now = GetTickCount(); + ret = WaitForSingleObject( signaled, 100 ); + then = GetTickCount(); + ok(ret == 0, "got %lu\n", ret); + ok(abs(then - now) < 5, "got %lu ms\n", then - now); + + ret = WaitForSingleObject( signaled, INFINITE ); + ok(ret == 0, "got %lu\n", ret); + + /* test NT timeouts */ + pNtQuerySystemTime( &ntnow ); + timeout.QuadPart = ntnow.QuadPart + 100 * 10000; + status = pNtWaitForSingleObject( nonsignaled, FALSE, &timeout ); + pNtQuerySystemTime( &ntthen ); + ok(status == STATUS_TIMEOUT, "got %#lx\n", status); + ok(abs(((ntthen.QuadPart - ntnow.QuadPart) / 10000) - 100) < 5, "got %s ns\n", + wine_dbgstr_longlong((ntthen.QuadPart - ntnow.QuadPart) * 100)); + + pNtQuerySystemTime( &ntnow ); + timeout.QuadPart = -100 * 10000; + status = pNtWaitForSingleObject( nonsignaled, FALSE, &timeout ); + pNtQuerySystemTime( &ntthen ); + ok(status == STATUS_TIMEOUT, "got %#lx\n", status); + ok(abs(((ntthen.QuadPart - ntnow.QuadPart) / 10000) - 100) < 5, "got %s ns\n", + wine_dbgstr_longlong((ntthen.QuadPart - ntnow.QuadPart) * 100)); + + status = pNtWaitForSingleObject( signaled, FALSE, NULL ); + ok(status == 0, "got %#lx\n", status); + + timeout.QuadPart = TIMEOUT_INFINITE; + status = pNtWaitForSingleObject( signaled, FALSE, &timeout ); + ok(status == 0, "got %#lx\n", status); + + pNtQuerySystemTime( &ntnow ); + timeout.QuadPart = ntnow.QuadPart; + status = pNtWaitForSingleObject( nonsignaled, FALSE, &timeout ); + pNtQuerySystemTime( &ntthen ); + ok(status == STATUS_TIMEOUT, "got %#lx\n", status); + ok(abs((ntthen.QuadPart - ntnow.QuadPart) / 10000) < 5, "got %s ns\n", + wine_dbgstr_longlong((ntthen.QuadPart - ntnow.QuadPart) * 100)); + + pNtQuerySystemTime( &ntnow ); + timeout.QuadPart = ntnow.QuadPart - 100 * 10000; + status = pNtWaitForSingleObject( nonsignaled, FALSE, &timeout ); + pNtQuerySystemTime( &ntthen ); + ok(status == STATUS_TIMEOUT, "got %#lx\n", status); + ok(abs((ntthen.QuadPart - ntnow.QuadPart) / 10000) < 5, "got %s ns\n", + wine_dbgstr_longlong((ntthen.QuadPart - ntnow.QuadPart) * 100)); + CloseHandle(signaled); CloseHandle(nonsignaled); } @@ -3239,6 +3306,7 @@ START_TEST(sync) pTryAcquireSRWLockShared = (void *)GetProcAddress(hdll, "TryAcquireSRWLockShared"); pNtAllocateVirtualMemory = (void *)GetProcAddress(hntdll, "NtAllocateVirtualMemory"); pNtFreeVirtualMemory = (void *)GetProcAddress(hntdll, "NtFreeVirtualMemory"); + pNtQuerySystemTime = (void *)GetProcAddress(hntdll, "NtQuerySystemTime"); pNtWaitForSingleObject = (void *)GetProcAddress(hntdll, "NtWaitForSingleObject"); pNtWaitForMultipleObjects = (void *)GetProcAddress(hntdll, "NtWaitForMultipleObjects"); pRtlInterlockedPushListSList = (void *)GetProcAddress(hntdll, "RtlInterlockedPushListSList"); From 8df37ee1f754b27878ac664f1192cf39d7a72c6d Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Tue, 26 Jun 2018 18:44:44 -0500 Subject: [PATCH 0309/2542] kernel32/tests: Zigzag test. The primary function is to check for races. The secondary function is to measure performance. Wine-Staging: eventfd_synchronization --- dlls/kernel32/tests/sync.c | 79 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c index 8d281ef130d7..f2e1e13b33ab 100644 --- a/dlls/kernel32/tests/sync.c +++ b/dlls/kernel32/tests/sync.c @@ -3280,6 +3280,84 @@ static void test_QueueUserAPC(void) ok(apc_count == 1, "APC count %u\n", apc_count); } +static int zigzag_state, zigzag_count[2], zigzag_stop; + +static DWORD CALLBACK zigzag_event0(void *arg) +{ + HANDLE *events = arg; + + while (!zigzag_stop) + { + WaitForSingleObject(events[0], INFINITE); + ResetEvent(events[0]); + ok(zigzag_state == 0, "got wrong state %d\n", zigzag_state); + zigzag_state++; + SetEvent(events[1]); + zigzag_count[0]++; + } + trace("thread 0 got done\n"); + return 0; +} + +static DWORD CALLBACK zigzag_event1(void *arg) +{ + HANDLE *events = arg; + + while (!zigzag_stop) + { + WaitForSingleObject(events[1], INFINITE); + ResetEvent(events[1]); + ok(zigzag_state == 1, "got wrong state %d\n", zigzag_state); + zigzag_state--; + SetEvent(events[0]); + zigzag_count[1]++; + } + trace("thread 1 got done\n"); + return 0; +} + +static void test_zigzag_event(void) +{ + /* The basic idea is to test SetEvent/Wait back and forth between two + * threads. Each thread clears their own event, sets some common data, + * signals the other's, then waits on their own. We make sure the common + * data is always in the right state. We also print performance data. */ + + HANDLE threads[2], events[2]; + BOOL ret; + + events[0] = CreateEventA(NULL, FALSE, FALSE, NULL); + events[1] = CreateEventA(NULL, FALSE, FALSE, NULL); + + threads[0] = CreateThread(NULL, 0, zigzag_event0, events, 0, NULL); + threads[1] = CreateThread(NULL, 0, zigzag_event1, events, 0, NULL); + + zigzag_state = 0; + zigzag_count[0] = zigzag_count[1] = 0; + zigzag_stop = 0; + + trace("starting zigzag test (events)\n"); + SetEvent(events[0]); + Sleep(2000); + zigzag_stop = 1; + ret = WaitForMultipleObjects(2, threads, FALSE, INFINITE); + trace("%d\n", ret); + ok(ret == 0 || ret == 1, "wait failed: %u\n", ret); + + ok(zigzag_count[0] == zigzag_count[1] || zigzag_count[0] == zigzag_count[1] + 1, + "count did not match: %d != %d\n", zigzag_count[0], zigzag_count[1]); + + /* signal the other thread to finish, if it didn't already + * (in theory they both would at the same time, but there's a slight race on teardown if we get + * thread 1 SetEvent -> thread 0 ResetEvent -> thread 0 Wait -> thread 1 exits */ + zigzag_state = 1-ret; + SetEvent(events[1-ret]); + ret = WaitForSingleObject(threads[1-ret], 1000); + ok(!ret, "wait failed: %u\n", ret); + + trace("count: %d\n", zigzag_count[0]); +} + START_TEST(sync) { char **argv; @@ -3351,5 +3429,6 @@ START_TEST(sync) test_srwlock_example(); test_alertable_wait(); test_apc_deadlock(); + test_zigzag_event(); test_crit_section(); } From edbfa3aa41b5a6673641719565fc525e916f9ecb Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 17:24:17 -0500 Subject: [PATCH 0310/2542] ntdll: Implement NtQuerySemaphore(). Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 19 +++++++++++++++++++ dlls/ntdll/unix/esync.h | 1 + dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 23 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index db453daa2294..d0ddd0c265e2 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -415,6 +415,25 @@ NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) return STATUS_SUCCESS; } +NTSTATUS esync_query_semaphore( HANDLE handle, void *info, ULONG *ret_len ) +{ + struct esync *obj; + struct semaphore *semaphore; + SEMAPHORE_BASIC_INFORMATION *out = info; + NTSTATUS ret; + + TRACE("handle %p, info %p, ret_len %p.\n", handle, info, ret_len); + + if ((ret = get_object( handle, &obj ))) return ret; + semaphore = obj->shm; + + out->CurrentCount = semaphore->count; + out->MaximumCount = semaphore->max; + if (ret_len) *ret_len = sizeof(*out); + + return STATUS_SUCCESS; +} + NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, EVENT_TYPE event_type, BOOLEAN initial ) { diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h index ac12604a815a..e7d4cd2aba4d 100644 --- a/dlls/ntdll/unix/esync.h +++ b/dlls/ntdll/unix/esync.h @@ -26,6 +26,7 @@ extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max); extern NTSTATUS esync_open_semaphore( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ); +extern NTSTATUS esync_query_semaphore( HANDLE handle, void *info, ULONG *ret_len ); extern NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ); extern NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 1caa142f5a05..f9b82b4487c9 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -383,6 +383,9 @@ NTSTATUS WINAPI NtQuerySemaphore( HANDLE handle, SEMAPHORE_INFORMATION_CLASS cla if (len != sizeof(SEMAPHORE_BASIC_INFORMATION)) return STATUS_INFO_LENGTH_MISMATCH; + if (do_esync()) + return esync_query_semaphore( handle, info, ret_len ); + SERVER_START_REQ( query_semaphore ) { req->handle = wine_server_obj_handle( handle ); From 24944d600ae91135bb431d0b23c8498e2b7509c1 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 17:26:56 -0500 Subject: [PATCH 0311/2542] ntdll: Implement NtQueryEvent(). Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 20 ++++++++++++++++++++ dlls/ntdll/unix/esync.h | 1 + dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 24 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index d0ddd0c265e2..e5d6ca145a54 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -486,6 +486,26 @@ NTSTATUS esync_reset_event( HANDLE handle ) return STATUS_SUCCESS; } +NTSTATUS esync_query_event( HANDLE handle, void *info, ULONG *ret_len ) +{ + struct esync *obj; + EVENT_BASIC_INFORMATION *out = info; + struct pollfd fd; + NTSTATUS ret; + + TRACE("handle %p, info %p, ret_len %p.\n", handle, info, ret_len); + + if ((ret = get_object( handle, &obj ))) return ret; + + fd.fd = obj->fd; + fd.events = POLLIN; + out->EventState = poll( &fd, 1, 0 ); + out->EventType = (obj->type == ESYNC_AUTO_EVENT ? SynchronizationEvent : NotificationEvent); + if (ret_len) *ret_len = sizeof(*out); + + return STATUS_SUCCESS; +} + NTSTATUS esync_create_mutex( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, BOOLEAN initial ) { diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h index e7d4cd2aba4d..9a0fcd163dd9 100644 --- a/dlls/ntdll/unix/esync.h +++ b/dlls/ntdll/unix/esync.h @@ -33,6 +33,7 @@ extern NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial ); extern NTSTATUS esync_open_event( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ); +extern NTSTATUS esync_query_event( HANDLE handle, void *info, ULONG *ret_len ); extern NTSTATUS esync_reset_event( HANDLE handle ); extern NTSTATUS esync_set_event( HANDLE handle ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index f9b82b4487c9..329480933844 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -582,6 +582,9 @@ NTSTATUS WINAPI NtQueryEvent( HANDLE handle, EVENT_INFORMATION_CLASS class, if (len != sizeof(EVENT_BASIC_INFORMATION)) return STATUS_INFO_LENGTH_MISMATCH; + if (do_esync()) + return esync_query_event( handle, info, ret_len ); + SERVER_START_REQ( query_event ) { req->handle = wine_server_obj_handle( handle ); From 2786bcd5328298b52fa851b3e62ab224288ea5a5 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 17:28:58 -0500 Subject: [PATCH 0312/2542] ntdll: Implement NtQueryMutant(). Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 20 ++++++++++++++++++++ dlls/ntdll/unix/esync.h | 1 + dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 24 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index e5d6ca145a54..7ee00ab34895 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -557,6 +557,26 @@ NTSTATUS esync_release_mutex( HANDLE *handle, LONG *prev ) return STATUS_SUCCESS; } +NTSTATUS esync_query_mutex( HANDLE handle, void *info, ULONG *ret_len ) +{ + struct esync *obj; + struct mutex *mutex; + MUTANT_BASIC_INFORMATION *out = info; + NTSTATUS ret; + + TRACE("handle %p, info %p, ret_len %p.\n", handle, info, ret_len); + + if ((ret = get_object( handle, &obj ))) return ret; + mutex = obj->shm; + + out->CurrentCount = 1 - mutex->count; + out->OwnedByCaller = (mutex->tid == GetCurrentThreadId()); + out->AbandonedState = FALSE; + if (ret_len) *ret_len = sizeof(*out); + + return STATUS_SUCCESS; +} + #define TICKSPERSEC 10000000 #define TICKSPERMSEC 10000 diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h index 9a0fcd163dd9..61846238ab7d 100644 --- a/dlls/ntdll/unix/esync.h +++ b/dlls/ntdll/unix/esync.h @@ -41,6 +41,7 @@ extern NTSTATUS esync_create_mutex( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, BOOLEAN initial ); extern NTSTATUS esync_open_mutex( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ); +extern NTSTATUS esync_query_mutex( HANDLE handle, void *info, ULONG *ret_len ); extern NTSTATUS esync_release_mutex( HANDLE *handle, LONG *prev ); extern NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 329480933844..3d6070ec7ab4 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -700,6 +700,9 @@ NTSTATUS WINAPI NtQueryMutant( HANDLE handle, MUTANT_INFORMATION_CLASS class, if (len != sizeof(MUTANT_BASIC_INFORMATION)) return STATUS_INFO_LENGTH_MISMATCH; + if (do_esync()) + return esync_query_mutex( handle, info, ret_len ); + SERVER_START_REQ( query_mutex ) { req->handle = wine_server_obj_handle( handle ); From b10b0521c0b7287b7a5254decd9dd61d39db4188 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 7 Jul 2018 12:57:47 +0200 Subject: [PATCH 0313/2542] server: Create eventfd descriptors for pseudo-fd objects and use them for named pipes. Wine-Staging: eventfd_synchronization --- server/fd.c | 22 ++++++++++++++++++++++ server/file.h | 1 + server/named_pipe.c | 4 ++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/server/fd.c b/server/fd.c index 690d8b777f5e..845028d5286c 100644 --- a/server/fd.c +++ b/server/fd.c @@ -94,6 +94,7 @@ #include "handle.h" #include "process.h" #include "request.h" +#include "esync.h" #include "winternl.h" #include "winioctl.h" @@ -154,6 +155,7 @@ struct fd struct completion *completion; /* completion object attached to this fd */ apc_param_t comp_key; /* completion key to set in completion events */ unsigned int comp_flags; /* completion flags */ + int esync_fd; /* esync file descriptor */ }; static void fd_dump( struct object *obj, int verbose ); @@ -1576,6 +1578,9 @@ static void fd_destroy( struct object *obj ) if (fd->unix_fd != -1) close( fd->unix_fd ); free( fd->unix_name ); } + + if (do_esync()) + close( fd->esync_fd ); } /* check if the desired access is possible without violating */ @@ -1694,6 +1699,7 @@ static struct fd *alloc_fd_object(void) fd->poll_index = -1; fd->completion = NULL; fd->comp_flags = 0; + fd->esync_fd = -1; init_async_queue( &fd->read_q ); init_async_queue( &fd->write_q ); init_async_queue( &fd->wait_q ); @@ -1735,11 +1741,15 @@ struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *use fd->completion = NULL; fd->comp_flags = 0; fd->no_fd_status = STATUS_BAD_DEVICE_TYPE; + fd->esync_fd = -1; init_async_queue( &fd->read_q ); init_async_queue( &fd->write_q ); init_async_queue( &fd->wait_q ); list_init( &fd->inode_entry ); list_init( &fd->locks ); + + if (do_esync()) + fd->esync_fd = esync_create_fd( 0, 0 ); return fd; } @@ -2145,6 +2155,9 @@ void set_fd_signaled( struct fd *fd, int signaled ) if (fd->comp_flags & FILE_SKIP_SET_EVENT_ON_HANDLE) return; fd->signaled = signaled; if (signaled) wake_up( fd->user, 0 ); + + if (do_esync() && !signaled) + esync_clear( fd->esync_fd ); } /* check if events are pending and if yes return which one(s) */ @@ -2170,6 +2183,15 @@ int default_fd_signaled( struct object *obj, struct wait_queue_entry *entry ) return ret; } +int default_fd_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct fd *fd = get_obj_fd( obj ); + int ret = fd->esync_fd; + *type = ESYNC_MANUAL_SERVER; + release_object( fd ); + return ret; +} + int default_fd_get_poll_events( struct fd *fd ) { int events = 0; diff --git a/server/file.h b/server/file.h index 4f5fc7b26f1d..82660f6f40c9 100644 --- a/server/file.h +++ b/server/file.h @@ -109,6 +109,7 @@ extern char *dup_fd_name( struct fd *root, const char *name ) __WINE_DEALLOC(fre extern void get_nt_name( struct fd *fd, struct unicode_str *name ); extern int default_fd_signaled( struct object *obj, struct wait_queue_entry *entry ); +extern int default_fd_get_esync_fd( struct object *obj, enum esync_type *type ); extern int default_fd_get_poll_events( struct fd *fd ); extern void default_poll_event( struct fd *fd, int event ); extern void fd_cancel_async( struct fd *fd, struct async *async ); diff --git a/server/named_pipe.c b/server/named_pipe.c index 1535c5188ec3..06a8e9d46256 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -168,7 +168,7 @@ static const struct object_ops pipe_server_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ - NULL, /* get_esync_fd */ + default_fd_get_esync_fd, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ pipe_end_get_fd, /* get_fd */ @@ -213,7 +213,7 @@ static const struct object_ops pipe_client_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ - NULL, /* get_esync_fd */ + default_fd_get_esync_fd, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ pipe_end_get_fd, /* get_fd */ From a9caa3394db951ed50b63385ed7001d9711ac6e7 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 4 Jul 2018 14:58:33 +0200 Subject: [PATCH 0314/2542] esync: Update README. Wine-Staging: eventfd_synchronization --- README.esync | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/README.esync b/README.esync index 627cc3f481e7..30e241755ad9 100644 --- a/README.esync +++ b/README.esync @@ -2,6 +2,29 @@ This is eventfd-based synchronization, or 'esync' for short. Turn it on with WINEESYNC=1 (note that it checks the presence and not the value); debug it with +esync. +== BUGS AND LIMITATIONS == + +Please let me know if you find any bugs. If you can, also attach a log with ++seh,+pid,+esync,+server. + +If you get something like "eventfd: Too many open files" and then things start +crashing, you've probably run out of file descriptors. esync creates one +eventfd descriptor for each synchronization object, and some games may use a +large number of these. Linux by default limits a process to 4096 file +descriptors, which probably was reasonable back in the nineties but isn't +really anymore. (Fortunately Debian and derivatives [Ubuntu, Mint] already +have a reasonable limit.) To raise the limit you'll want to edit +/etc/security/limits.conf and add a line like + +* hard nofile 1048576 + +then restart your session. + +Also note that if the wineserver has esync active, all clients also must, and +vice versa. Otherwise things will probably crash quite badly. + +== EXPLANATION == + The aim is to execute all synchronization operations in "user-space", that is, without going through wineserver. We do this using Linux's eventfd facility. The main impetus to using eventfd is so that we can poll multiple @@ -135,8 +158,6 @@ surprisingly there aren't that many. In particular: There are some things that are perfectly implementable but that I just haven't done yet: -* NtQuery*. That said, these APIs aren't exposed through kernel32 in any way, so - I doubt anyone is going to be using them. * Other synchronizable server primitives. It's unlikely we'll need any of these, except perhaps named pipes (which would honestly be rather difficult) and (maybe) timers. From 987a9a81f65b11e4343371f61feefeb8df56d269 Mon Sep 17 00:00:00 2001 From: Mathieu Comandon Date: Sat, 21 Jul 2018 12:56:50 -0700 Subject: [PATCH 0315/2542] esync: Add note about file limits not being raised when using systemd. Wine-Staging: eventfd_synchronization --- README.esync | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.esync b/README.esync index 30e241755ad9..7706f395ebd1 100644 --- a/README.esync +++ b/README.esync @@ -20,6 +20,16 @@ have a reasonable limit.) To raise the limit you'll want to edit then restart your session. +On distributions using systemd, the settings in `/etc/security/limits.conf` will +be overridden by systemd's own settings. If you run `ulimit -Hn` and it returns +a lower number than the one you've previously set then you can set + +DefaultLimitNOFILE=100000 + +in both `/etc/systemd/system.conf` and `/etc/systemd/user.conf`. You can then +execute `sudo systemctl daemon-reexec` and restart your session. Check again +with `ulimit -Hn` that the limit is correct. + Also note that if the wineserver has esync active, all clients also must, and vice versa. Otherwise things will probably crash quite badly. @@ -188,4 +198,4 @@ done by the kernel. Anyway, yeah, this is esync. Use it if you like. ---Zebediah Figura \ No newline at end of file +--Zebediah Figura From aa36a288ae276919a618fa31f271994c9aaaee35 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 17:37:29 -0500 Subject: [PATCH 0316/2542] ntdll: Try to avoid poll() for uncontended objects. Just semaphores and mutexes thus far. We don't have to worry about races because this is just a hint: we still call read() eventually. Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 60 ++++++++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 7ee00ab34895..84a4dc18a141 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -745,23 +745,63 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA if (wait_any || count == 1) { + /* Try to check objects now, so we can obviate poll() at least. */ for (i = 0; i < count; i++) { struct esync *obj = objs[i]; - if (obj && obj->type == ESYNC_MUTEX) + if (obj) { - /* If we already own the mutex, return immediately. */ - /* Note: This violates the assumption that the *first* object - * to be signaled will be returned. If that becomes a problem, - * we can always check the state of each object before waiting. */ - struct mutex *mutex = (struct mutex *)obj; + switch (obj->type) + { + case ESYNC_MUTEX: + { + struct mutex *mutex = obj->shm; - if (mutex->tid == GetCurrentThreadId()) + if (mutex->tid == GetCurrentThreadId()) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + mutex->count++; + return i; + } + else if (!mutex->count) + { + if ((size = read( obj->fd, &value, sizeof(value) )) == sizeof(value)) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + mutex->tid = GetCurrentThreadId(); + mutex->count++; + return i; + } + } + break; + } + case ESYNC_SEMAPHORE: { - TRACE("Woken up by handle %p [%d].\n", handles[i], i); - mutex->count++; - return i; + struct semaphore *semaphore = obj->shm; + + if (semaphore->count) + { + if ((size = read( obj->fd, &value, sizeof(value) )) == sizeof(value)) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + InterlockedDecrement( (LONG *)&semaphore->count ); + return i; + } + } + break; + } + case ESYNC_AUTO_EVENT: + case ESYNC_MANUAL_EVENT: + /* TODO */ + break; + case ESYNC_AUTO_SERVER: + case ESYNC_MANUAL_SERVER: + case ESYNC_QUEUE: + /* We can't wait on any of these. Fortunately I don't think + * they'll ever be uncontended anyway (at least, they won't be + * performance-critical). */ + break; } } From 18050a4d1ff85e20c5a3bff9c878bd0de2bbe705 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 17:44:26 -0500 Subject: [PATCH 0317/2542] ntdll, server: Try to avoid poll() for signaled events. Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 147 ++++++++++++++++++++++++++++++++++++++-- server/esync.c | 61 +++++++++++++++-- 2 files changed, 197 insertions(+), 11 deletions(-) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 84a4dc18a141..880cf5006ae3 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -454,18 +454,103 @@ NTSTATUS esync_open_event( HANDLE *handle, ACCESS_MASK access, return open_esync( ESYNC_AUTO_EVENT, handle, access, attr ); /* doesn't matter which */ } +static inline void small_pause(void) +{ +#ifdef __i386__ + __asm__ __volatile__( "rep;nop" : : : "memory" ); +#else + __asm__ __volatile__( "" : : : "memory" ); +#endif +} + +/* Manual-reset events are actually racier than other objects in terms of shm + * state. With other objects, races don't matter, because we only treat the shm + * state as a hint that lets us skip poll()—we still have to read(). But with + * manual-reset events we don't, which means that the shm state can be out of + * sync with the actual state. + * + * In general we shouldn't have to worry about races between modifying the + * event and waiting on it. If the state changes while we're waiting, it's + * equally plausible that we caught it before or after the state changed. + * However, we can have races between SetEvent() and ResetEvent(), so that the + * event has inconsistent internal state. + * + * To solve this we have to use the other field to lock the event. Currently + * this is implemented as a spinlock, but I'm not sure if a futex might be + * better. I'm also not sure if it's possible to obviate locking by arranging + * writes and reads in a certain way. + * + * Note that we don't have to worry about locking in esync_wait_objects(). + * There's only two general patterns: + * + * WaitFor() SetEvent() + * ------------------------- + * read() + * signaled = 0 + * signaled = 1 + * write() + * ------------------------- + * read() + * signaled = 1 + * signaled = 0 + * + * ------------------------- + * + * That is, if SetEvent() tries to signal the event before WaitFor() resets its + * signaled state, it won't bother trying to write(), and then the signaled + * state will be reset, so the result is a consistent non-signaled event. + * There's several variations to this pattern but all of them are protected in + * the same way. Note however this is why we have to use interlocked_xchg() + * event inside of the lock. + */ + +/* Removing this spinlock is harder than it looks. esync_wait_objects() can + * deal with inconsistent state well enough, and a race between SetEvent() and + * ResetEvent() gives us license to yield either result as long as we act + * consistently, but that's not enough. Notably, esync_wait_objects() should + * probably act like a fence, so that the second half of esync_set_event() does + * not seep past a subsequent reset. That's one problem, but no guarantee there + * aren't others. */ + NTSTATUS esync_set_event( HANDLE handle ) { static const uint64_t value = 1; struct esync *obj; + struct event *event; NTSTATUS ret; TRACE("%p.\n", handle); - if ((ret = get_object( handle, &obj))) return ret; + if ((ret = get_object( handle, &obj ))) return ret; + event = obj->shm; + + if (obj->type == ESYNC_MANUAL_EVENT) + { + /* Acquire the spinlock. */ + while (InterlockedCompareExchange( (LONG *)&event->locked, 1, 0 )) + small_pause(); + } + + /* For manual-reset events, as long as we're in a lock, we can take the + * optimization of only calling write() if the event wasn't already + * signaled. + * + * For auto-reset events, esync_wait_objects() must grab the kernel object. + * Thus if we got into a race so that the shm state is signaled but the + * eventfd is unsignaled (i.e. reset shm, set shm, set fd, reset fd), we + * *must* signal the fd now, or any waiting threads will never wake up. */ + + if (!InterlockedExchange( (LONG *)&event->signaled, 1 ) || obj->type == ESYNC_AUTO_EVENT) + { + if (write( obj->fd, &value, sizeof(value) ) == -1) + ERR("write: %s\n", strerror(errno)); + } - if (write( obj->fd, &value, sizeof(value) ) == -1) - ERR("write: %s\n", strerror(errno)); + if (obj->type == ESYNC_MANUAL_EVENT) + { + /* Release the spinlock. */ + event->locked = 0; + } return STATUS_SUCCESS; } @@ -474,14 +559,40 @@ NTSTATUS esync_reset_event( HANDLE handle ) { uint64_t value; struct esync *obj; + struct event *event; NTSTATUS ret; TRACE("%p.\n", handle); - if ((ret = get_object( handle, &obj))) return ret; + if ((ret = get_object( handle, &obj ))) return ret; + event = obj->shm; - if (read( obj->fd, &value, sizeof(value) ) == -1 && errno != EWOULDBLOCK && errno != EAGAIN) - ERR("read: %s\n", strerror(errno)); + if (obj->type == ESYNC_MANUAL_EVENT) + { + /* Acquire the spinlock. */ + while (InterlockedCompareExchange( (LONG *)&event->locked, 1, 0 )) + small_pause(); + } + + /* For manual-reset events, as long as we're in a lock, we can take the + * optimization of only calling read() if the event was already signaled. + * + * For auto-reset events, we have no guarantee that the previous "signaled" + * state is actually correct. We need to leave both states unsignaled after + * leaving this function, so we always have to read(). */ + if (InterlockedExchange( (LONG *)&event->signaled, 0 ) || obj->type == ESYNC_AUTO_EVENT) + { + if (read( obj->fd, &value, sizeof(value) ) == -1 && errno != EWOULDBLOCK && errno != EAGAIN) + { + ERR("read: %s\n", strerror(errno)); + } + } + + if (obj->type == ESYNC_MANUAL_EVENT) + { + /* Release the spinlock. */ + event->locked = 0; + } return STATUS_SUCCESS; } @@ -792,9 +903,31 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA break; } case ESYNC_AUTO_EVENT: + { + struct event *event = obj->shm; + + if (event->signaled) + { + if ((size = read( obj->fd, &value, sizeof(value) )) == sizeof(value)) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + event->signaled = 0; + return i; + } + } + break; + } case ESYNC_MANUAL_EVENT: - /* TODO */ + { + struct event *event = obj->shm; + + if (event->signaled) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + return i; + } break; + } case ESYNC_AUTO_SERVER: case ESYNC_MANUAL_SERVER: case ESYNC_QUEUE: diff --git a/server/esync.c b/server/esync.c index 0c365006f0ba..20ea97869e92 100644 --- a/server/esync.c +++ b/server/esync.c @@ -376,24 +376,77 @@ void esync_clear( int fd ) read( fd, &value, sizeof(value) ); } +static inline void small_pause(void) +{ +#ifdef __i386__ + __asm__ __volatile__( "rep;nop" : : : "memory" ); +#else + __asm__ __volatile__( "" : : : "memory" ); +#endif +} + /* Server-side event support. */ void esync_set_event( struct esync *esync ) { static const uint64_t value = 1; + struct event *event = get_shm( esync->shm_idx ); assert( esync->obj.ops == &esync_ops ); - if (write( esync->fd, &value, sizeof(value) ) == -1) - perror( "esync: write" ); + assert( event != NULL ); + + if (debug_level) + fprintf( stderr, "esync_set_event() fd=%d\n", esync->fd ); + + if (esync->type == ESYNC_MANUAL_EVENT) + { + /* Acquire the spinlock. */ + while (__sync_val_compare_and_swap( &event->locked, 0, 1 )) + small_pause(); + } + + if (!__atomic_exchange_n( &event->signaled, 1, __ATOMIC_SEQ_CST )) + { + if (write( esync->fd, &value, sizeof(value) ) == -1) + perror( "esync: write" ); + } + + if (esync->type == ESYNC_MANUAL_EVENT) + { + /* Release the spinlock. */ + event->locked = 0; + } } void esync_reset_event( struct esync *esync ) { static uint64_t value = 1; + struct event *event = get_shm( esync->shm_idx ); assert( esync->obj.ops == &esync_ops ); + assert( event != NULL ); - /* we don't care about the return value */ - read( esync->fd, &value, sizeof(value) ); + if (debug_level) + fprintf( stderr, "esync_reset_event() fd=%d\n", esync->fd ); + + if (esync->type == ESYNC_MANUAL_EVENT) + { + /* Acquire the spinlock. */ + while (__sync_val_compare_and_swap( &event->locked, 0, 1 )) + small_pause(); + } + + /* Only bother signaling the fd if we weren't already signaled. */ + if (__atomic_exchange_n( &event->signaled, 0, __ATOMIC_SEQ_CST )) + { + /* we don't care about the return value */ + read( esync->fd, &value, sizeof(value) ); + } + + if (esync->type == ESYNC_MANUAL_EVENT) + { + /* Release the spinlock. */ + event->locked = 0; + } } DECL_HANDLER(create_esync) From 1678f215847849a8148850d72a6ca0c43dfee75e Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 4 Aug 2018 15:18:24 -0500 Subject: [PATCH 0318/2542] esync: Update README. Wine-Staging: eventfd_synchronization --- README.esync | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/README.esync b/README.esync index 7706f395ebd1..b64bfefc1a31 100644 --- a/README.esync +++ b/README.esync @@ -5,7 +5,7 @@ with +esync. == BUGS AND LIMITATIONS == Please let me know if you find any bugs. If you can, also attach a log with -+seh,+pid,+esync,+server. ++seh,+pid,+esync,+server,+timestamp. If you get something like "eventfd: Too many open files" and then things start crashing, you've probably run out of file descriptors. esync creates one @@ -20,11 +20,11 @@ have a reasonable limit.) To raise the limit you'll want to edit then restart your session. -On distributions using systemd, the settings in `/etc/security/limits.conf` will -be overridden by systemd's own settings. If you run `ulimit -Hn` and it returns -a lower number than the one you've previously set then you can set +On distributions using systemd, the settings in `/etc/security/limits.conf` +will be overridden by systemd's own settings. If you run `ulimit -Hn` and it +returns a lower number than the one you've previously set, then you can set -DefaultLimitNOFILE=100000 +DefaultLimitNOFILE=1048576 in both `/etc/systemd/system.conf` and `/etc/systemd/user.conf`. You can then execute `sudo systemctl daemon-reexec` and restart your session. Check again @@ -157,10 +157,6 @@ surprisingly there aren't that many. In particular: can probably be something reasonable.) It's also possible, although I haven't yet looked, to use some different kind of synchronization primitives, but pipes would be easiest to tack onto this framework. -* We might hit the maximum number of open fd's. On my system the soft limit is - 1024 and the hard limit is 1048576. I'm inclined to hope this won't be an - issue, since a hypothetical Linux port of any application might just as well - use the same number of eventfds. * PulseEvent() can't work the way it's supposed to work. Fortunately it's rare and deprecated. It's also explicitly mentioned on MSDN that a thread can miss the notification for a kernel APC, so in a sense we're not necessarily From d3a321b7e9f018336f3b7c61dd48b0b6f229328d Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 17:56:40 -0500 Subject: [PATCH 0319/2542] ntdll: Implement NtPulseEvent(). Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 25 +++++++++++++++++++++++++ dlls/ntdll/unix/esync.h | 1 + dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 29 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 880cf5006ae3..e9aa3b5194f7 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -597,6 +597,31 @@ NTSTATUS esync_reset_event( HANDLE handle ) return STATUS_SUCCESS; } +NTSTATUS esync_pulse_event( HANDLE handle ) +{ + uint64_t value = 1; + struct esync *obj; + NTSTATUS ret; + + TRACE("%p.\n", handle); + + if ((ret = get_object( handle, &obj ))) return ret; + + /* This isn't really correct; an application could miss the write. + * Unfortunately we can't really do much better. Fortunately this is rarely + * used (and publicly deprecated). */ + if (write( obj->fd, &value, sizeof(value) ) == -1) + return errno_to_status( errno ); + + /* Try to give other threads a chance to wake up. Hopefully erring on this + * side is the better thing to do... */ + NtYieldExecution(); + + read( obj->fd, &value, sizeof(value) ); + + return STATUS_SUCCESS; +} + NTSTATUS esync_query_event( HANDLE handle, void *info, ULONG *ret_len ) { struct esync *obj; diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h index 61846238ab7d..59f8809fc1a0 100644 --- a/dlls/ntdll/unix/esync.h +++ b/dlls/ntdll/unix/esync.h @@ -33,6 +33,7 @@ extern NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial ); extern NTSTATUS esync_open_event( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ); +extern NTSTATUS esync_pulse_event( HANDLE handle ); extern NTSTATUS esync_query_event( HANDLE handle, void *info, ULONG *ret_len ); extern NTSTATUS esync_reset_event( HANDLE handle ); extern NTSTATUS esync_set_event( HANDLE handle ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 3d6070ec7ab4..75525f34bf76 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -551,6 +551,9 @@ NTSTATUS WINAPI NtPulseEvent( HANDLE handle, LONG *prev_state ) { unsigned int ret; + if (do_esync()) + return esync_pulse_event( handle ); + SERVER_START_REQ( event_op ) { req->handle = wine_server_obj_handle( handle ); From 5422c84bcd08ba3d2065383d149f5ec273df0025 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 19 Aug 2018 13:40:05 -0500 Subject: [PATCH 0320/2542] esync: Update README. Wine-Staging: eventfd_synchronization --- README.esync | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.esync b/README.esync index b64bfefc1a31..11d86563a105 100644 --- a/README.esync +++ b/README.esync @@ -1,6 +1,5 @@ This is eventfd-based synchronization, or 'esync' for short. Turn it on with -WINEESYNC=1 (note that it checks the presence and not the value); debug it -with +esync. +WINEESYNC=1; debug it with +esync. == BUGS AND LIMITATIONS == From a466a011a84129f271877d1275387b02876fcadd Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 24 Apr 2019 23:21:25 -0500 Subject: [PATCH 0321/2542] server: Create esync file descriptors for true file objects and use them for directory change notifications. Wine-Staging: eventfd_synchronization --- server/change.c | 2 +- server/fd.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/server/change.c b/server/change.c index d0a90a992614..1c394c9d3a24 100644 --- a/server/change.c +++ b/server/change.c @@ -112,7 +112,7 @@ static const struct object_ops dir_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ - NULL, /* get_esync_fd */ + default_fd_get_esync_fd, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ dir_get_fd, /* get_fd */ diff --git a/server/fd.c b/server/fd.c index 845028d5286c..c9a8b5d13009 100644 --- a/server/fd.c +++ b/server/fd.c @@ -1706,6 +1706,9 @@ static struct fd *alloc_fd_object(void) list_init( &fd->inode_entry ); list_init( &fd->locks ); + if (do_esync()) + fd->esync_fd = esync_create_fd( 1, 0 ); + if ((fd->poll_index = add_poll_user( fd )) == -1) { release_object( fd ); From 1f4601ab2c4fdad790c9571fc605ee7d450f4152 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 18:01:32 -0500 Subject: [PATCH 0322/2542] ntdll, server: Abandon esync mutexes on thread exit. Wine-Staging: eventfd_synchronization --- dlls/ntdll/unix/esync.c | 31 ++++++++++++++++++++++++++----- server/esync.c | 25 +++++++++++++++++++++++++ server/esync.h | 1 + server/thread.c | 2 ++ 4 files changed, 54 insertions(+), 5 deletions(-) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index e9aa3b5194f7..da3d3a2ab299 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -707,7 +707,7 @@ NTSTATUS esync_query_mutex( HANDLE handle, void *info, ULONG *ret_len ) out->CurrentCount = 1 - mutex->count; out->OwnedByCaller = (mutex->tid == GetCurrentThreadId()); - out->AbandonedState = FALSE; + out->AbandonedState = (mutex->tid == ~0); if (ret_len) *ret_len = sizeof(*out); return STATUS_SUCCESS; @@ -757,14 +757,19 @@ static int do_poll( struct pollfd *fds, nfds_t nfds, ULONGLONG *end ) return ret; } -static void update_grabbed_object( struct esync *obj ) +/* Return TRUE if abandoned. */ +static BOOL update_grabbed_object( struct esync *obj ) { + BOOL ret = FALSE; + if (obj->type == ESYNC_MUTEX) { struct mutex *mutex = obj->shm; /* We don't have to worry about a race between this and read(); the * fact that we grabbed it means the count is now zero, so nobody else * can (and the only thread that can release it is us). */ + if (mutex->tid == ~0) + ret = TRUE; mutex->tid = GetCurrentThreadId(); mutex->count++; } @@ -785,6 +790,8 @@ static void update_grabbed_object( struct esync *obj ) * This might already be 0, but that's okay! */ event->signaled = 0; } + + return ret; } /* A value of STATUS_NOT_IMPLEMENTED returned from this function means that we @@ -904,7 +911,13 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA { if ((size = read( obj->fd, &value, sizeof(value) )) == sizeof(value)) { - TRACE("Woken up by handle %p [%d].\n", handles[i], i); + if (mutex->tid == ~0) + { + TRACE("Woken up by abandoned mutex %p [%d].\n", handles[i], i); + i += STATUS_ABANDONED_WAIT_0; + } + else + TRACE("Woken up by handle %p [%d].\n", handles[i], i); mutex->tid = GetCurrentThreadId(); mutex->count++; return i; @@ -1017,7 +1030,8 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA { /* We found our object. */ TRACE("Woken up by handle %p [%d].\n", handles[i], i); - update_grabbed_object( obj ); + if (update_grabbed_object( obj )) + return STATUS_ABANDONED_WAIT_0 + i; return i; } } @@ -1110,6 +1124,8 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA ret = poll( fds, pollcount, 0 ); if (ret == pollcount) { + BOOL abandoned = FALSE; + /* Quick, grab everything. */ for (i = 0; i < count; i++) { @@ -1150,8 +1166,13 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA /* Make sure to let ourselves know that we grabbed the mutexes * and semaphores. */ for (i = 0; i < count; i++) - update_grabbed_object( objs[i] ); + abandoned |= update_grabbed_object( objs[i] ); + if (abandoned) + { + TRACE("Wait successful, but some object(s) were abandoned.\n"); + return STATUS_ABANDONED; + } TRACE("Wait successful.\n"); return STATUS_SUCCESS; } diff --git a/server/esync.c b/server/esync.c index 20ea97869e92..e193f61b3a76 100644 --- a/server/esync.c +++ b/server/esync.c @@ -103,12 +103,15 @@ void esync_init(void) atexit( shm_cleanup ); } +static struct list mutex_list = LIST_INIT(mutex_list); + struct esync { struct object obj; /* object header */ int fd; /* eventfd file descriptor */ enum esync_type type; unsigned int shm_idx; /* index into the shared memory section */ + struct list mutex_entry; /* entry in the mutex list (if applicable) */ }; static void esync_dump( struct object *obj, int verbose ); @@ -168,6 +171,8 @@ static unsigned int esync_map_access( struct object *obj, unsigned int access ) static void esync_destroy( struct object *obj ) { struct esync *esync = (struct esync *)obj; + if (esync->type == ESYNC_MUTEX) + list_remove( &esync->mutex_entry ); close( esync->fd ); } @@ -303,6 +308,7 @@ struct esync *create_esync( struct object *root, const struct unicode_str *name, struct mutex *mutex = get_shm( esync->shm_idx ); mutex->tid = initval ? 0 : current->id; mutex->count = initval ? 0 : 1; + list_add_tail( &mutex_list, &esync->mutex_entry ); break; } default: @@ -449,6 +455,25 @@ void esync_reset_event( struct esync *esync ) } } +void esync_abandon_mutexes( struct thread *thread ) +{ + struct esync *esync; + + LIST_FOR_EACH_ENTRY( esync, &mutex_list, struct esync, mutex_entry ) + { + struct mutex *mutex = get_shm( esync->shm_idx ); + + if (mutex->tid == thread->id) + { + if (debug_level) + fprintf( stderr, "esync_abandon_mutexes() fd=%d\n", esync->fd ); + mutex->tid = ~0; + mutex->count = 0; + esync_wake_fd( esync->fd ); + } + } +} + DECL_HANDLER(create_esync) { struct esync *esync; diff --git a/server/esync.h b/server/esync.h index e1588d205d91..d39f4efa3ecf 100644 --- a/server/esync.h +++ b/server/esync.h @@ -32,3 +32,4 @@ struct esync; extern const struct object_ops esync_ops; void esync_set_event( struct esync *esync ); void esync_reset_event( struct esync *esync ); +void esync_abandon_mutexes( struct thread *thread ); diff --git a/server/thread.c b/server/thread.c index ed31e7f98ce7..c0a34a12a1c6 100644 --- a/server/thread.c +++ b/server/thread.c @@ -1400,6 +1400,8 @@ void kill_thread( struct thread *thread, int violent_death ) } kill_console_processes( thread, 0 ); abandon_mutexes( thread ); + if (do_esync()) + esync_abandon_mutexes( thread ); wake_up( &thread->obj, 0 ); if (violent_death) send_thread_signal( thread, SIGQUIT ); cleanup_thread( thread ); From 02d6bf6267695cd7f8c1222d50adfbfabf628a56 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 17 Oct 2020 19:13:16 -0500 Subject: [PATCH 0323/2542] server: Create esync file descriptors for console servers. Wine-Staging: eventfd_synchronization --- server/console.c | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/server/console.c b/server/console.c index e8a805ec0b2f..c85eb98fa1f5 100644 --- a/server/console.c +++ b/server/console.c @@ -41,6 +41,7 @@ #include "wincon.h" #include "winternl.h" #include "wine/condrv.h" +#include "esync.h" struct screen_buffer; @@ -131,20 +132,22 @@ struct console_host_ioctl struct console_server { - struct object obj; /* object header */ - struct fd *fd; /* pseudo-fd for ioctls */ - struct console *console; /* attached console */ - struct list queue; /* ioctl queue */ - struct list read_queue; /* blocking read queue */ + struct object obj; /* object header */ + struct fd *fd; /* pseudo-fd for ioctls */ + struct console *console; /* attached console */ + struct list queue; /* ioctl queue */ + struct list read_queue; /* blocking read queue */ unsigned int busy : 1; /* flag if server processing an ioctl */ unsigned int once_input : 1; /* flag if input thread has already been requested */ - int term_fd; /* UNIX terminal fd */ - struct termios termios; /* original termios */ + int term_fd; /* UNIX terminal fd */ + struct termios termios; /* original termios */ + int esync_fd; }; static void console_server_dump( struct object *obj, int verbose ); static void console_server_destroy( struct object *obj ); static int console_server_signaled( struct object *obj, struct wait_queue_entry *entry ); +static int console_server_get_esync_fd( struct object *obj, enum esync_type *type ); static struct fd *console_server_get_fd( struct object *obj ); static struct object *console_server_lookup_name( struct object *obj, struct unicode_str *name, unsigned int attr, struct object *root ); @@ -159,7 +162,7 @@ static const struct object_ops console_server_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ console_server_signaled, /* signaled */ - NULL, /* get_esync_fd */ + console_server_get_esync_fd, /* get_esync_fd */ no_satisfied, /* satisfied */ no_signal, /* signal */ console_server_get_fd, /* get_fd */ @@ -597,6 +600,8 @@ static void disconnect_console_server( struct console_server *server ) list_remove( &call->entry ); console_host_ioctl_terminate( call, STATUS_CANCELLED ); } + if (do_esync()) + esync_clear( server->esync_fd ); while (!list_empty( &server->read_queue )) { struct console_host_ioctl *call = LIST_ENTRY( list_head( &server->read_queue ), struct console_host_ioctl, entry ); @@ -885,6 +890,7 @@ static void console_server_destroy( struct object *obj ) assert( obj->ops == &console_server_ops ); disconnect_console_server( server ); if (server->fd) release_object( server->fd ); + if (do_esync()) close( server->esync_fd ); } static struct object *console_server_lookup_name( struct object *obj, struct unicode_str *name, @@ -932,6 +938,13 @@ static int console_server_signaled( struct object *obj, struct wait_queue_entry return !server->console || !list_empty( &server->queue ); } +static int console_server_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct console_server *server = (struct console_server*)obj; + *type = ESYNC_MANUAL_SERVER; + return server->esync_fd; +} + static struct fd *console_server_get_fd( struct object* obj ) { struct console_server *server = (struct console_server*)obj; @@ -963,6 +976,10 @@ static struct object *create_console_server( void ) return NULL; } allow_fd_caching(server->fd); + server->esync_fd = -1; + + if (do_esync()) + server->esync_fd = esync_create_fd( 0, 0 ); return &server->obj; } @@ -1576,6 +1593,8 @@ DECL_HANDLER(get_next_console_request) /* set result of previous ioctl */ ioctl = LIST_ENTRY( list_head( &server->queue ), struct console_host_ioctl, entry ); list_remove( &ioctl->entry ); + if (do_esync() && list_empty( &server->queue )) + esync_clear( server->esync_fd ); } if (ioctl) @@ -1661,6 +1680,8 @@ DECL_HANDLER(get_next_console_request) { set_error( STATUS_PENDING ); } + if (do_esync() && list_empty( &server->queue )) + esync_clear( server->esync_fd ); release_object( server ); } From d0e1ed24f48ee397a694fa3661782afeda57d2dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20P=C3=A1ral?= Date: Wed, 10 Oct 2018 19:17:00 +0200 Subject: [PATCH 0324/2542] readme: only adjust hard limit in systemd (#20) Instead of increasing both soft and hard fileno limit in systemd instructions, increase just the hard limit. Soft limit needs to stay at 1024 for compatibility with programs using select() instead of newer poll()/epoll(), otherwise such programs might fail. --- README.esync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.esync b/README.esync index 11d86563a105..6520f2da5640 100644 --- a/README.esync +++ b/README.esync @@ -23,7 +23,7 @@ On distributions using systemd, the settings in `/etc/security/limits.conf` will be overridden by systemd's own settings. If you run `ulimit -Hn` and it returns a lower number than the one you've previously set, then you can set -DefaultLimitNOFILE=1048576 +DefaultLimitNOFILE=1024:1048576 in both `/etc/systemd/system.conf` and `/etc/systemd/user.conf`. You can then execute `sudo systemctl daemon-reexec` and restart your session. Check again From a6d4f94e8d9a1d7c0c5251d54c69bc978c9d1560 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 12 Mar 2021 23:58:39 +0300 Subject: [PATCH 0325/2542] esync: Fix restoring the objects state on wait all objects retry. For Forza Horizon 4. --- dlls/ntdll/unix/esync.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index da3d3a2ab299..6eea9d3afc4d 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -1146,10 +1146,22 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA { /* We were too slow. Put everything back. */ value = 1; - for (j = i; j >= 0; j--) + for (j = i - 1; j >= 0; j--) { - if (write( obj->fd, &value, sizeof(value) ) == -1) + struct esync *obj = objs[j]; + + if (obj->type == ESYNC_MUTEX) + { + struct mutex *mutex = obj->shm; + + if (mutex->tid == GetCurrentThreadId()) + continue; + } + if (write( fds[j].fd, &value, sizeof(value) ) == -1) + { + ERR("write failed.\n"); return errno_to_status( errno ); + } } goto tryagain; /* break out of two loops and a switch */ From 0c426abf74adad167ddcc388099ba6b32efb8713 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 15:17:29 -0500 Subject: [PATCH 0326/2542] server: Create server objects for futex-based synchronization objects. --- server/Makefile.in | 1 + server/fsync.c | 286 ++++++++++++++++++++++++++++++++++++++++++++ server/fsync.h | 22 ++++ server/main.c | 4 + server/protocol.def | 11 ++ 5 files changed, 324 insertions(+) create mode 100644 server/fsync.c create mode 100644 server/fsync.h diff --git a/server/Makefile.in b/server/Makefile.in index 9632c4e694fe..4e2008a761f2 100644 --- a/server/Makefile.in +++ b/server/Makefile.in @@ -15,6 +15,7 @@ SOURCES = \ event.c \ fd.c \ file.c \ + fsync.c \ handle.c \ hook.c \ mach.c \ diff --git a/server/fsync.c b/server/fsync.c new file mode 100644 index 000000000000..5f36e9888038 --- /dev/null +++ b/server/fsync.c @@ -0,0 +1,286 @@ +/* + * futex-based synchronization objects + * + * Copyright (C) 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_SYS_SYSCALL_H +# include +#endif +#include + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winternl.h" + +#include "handle.h" +#include "request.h" +#include "fsync.h" + +#include "pshpack4.h" +struct futex_wait_block +{ + int *addr; +#if __SIZEOF_POINTER__ == 4 + int pad; +#endif + int val; +}; +#include "poppack.h" + +static inline int futex_wait_multiple( const struct futex_wait_block *futexes, + int count, const struct timespec *timeout ) +{ + return syscall( __NR_futex, futexes, 13, count, timeout, 0, 0 ); +} + +int do_fsync(void) +{ +#ifdef __linux__ + static int do_fsync_cached = -1; + + if (do_fsync_cached == -1) + { + static const struct timespec zero; + futex_wait_multiple( NULL, 0, &zero ); + do_fsync_cached = getenv("WINEFSYNC") && atoi(getenv("WINEFSYNC")) && errno != ENOSYS; + } + + return do_fsync_cached; +#else + return 0; +#endif +} + +static char shm_name[29]; +static int shm_fd; +static off_t shm_size; +static void **shm_addrs; +static int shm_addrs_size; /* length of the allocated shm_addrs array */ +static long pagesize; + +static void shm_cleanup(void) +{ + close( shm_fd ); + if (shm_unlink( shm_name ) == -1) + perror( "shm_unlink" ); +} + +void fsync_init(void) +{ + struct stat st; + + if (fstat( config_dir_fd, &st ) == -1) + fatal_error( "cannot stat config dir\n" ); + + if (st.st_ino != (unsigned long)st.st_ino) + sprintf( shm_name, "/wine-%lx%08lx-fsync", (unsigned long)((unsigned long long)st.st_ino >> 32), (unsigned long)st.st_ino ); + else + sprintf( shm_name, "/wine-%lx-fsync", (unsigned long)st.st_ino ); + + if (!shm_unlink( shm_name )) + fprintf( stderr, "fsync: warning: a previous shm file %s was not properly removed\n", shm_name ); + + shm_fd = shm_open( shm_name, O_RDWR | O_CREAT | O_EXCL, 0644 ); + if (shm_fd == -1) + perror( "shm_open" ); + + pagesize = sysconf( _SC_PAGESIZE ); + + shm_addrs = calloc( 128, sizeof(shm_addrs[0]) ); + shm_addrs_size = 128; + + shm_size = pagesize; + if (ftruncate( shm_fd, shm_size ) == -1) + perror( "ftruncate" ); + + atexit( shm_cleanup ); +} + +struct fsync +{ + struct object obj; + unsigned int shm_idx; +}; + +static void fsync_dump( struct object *obj, int verbose ); +static void fsync_destroy( struct object *obj ); + +static const struct object_ops fsync_ops = +{ + sizeof(struct fsync), /* size */ + &no_type, /* type */ + fsync_dump, /* dump */ + no_add_queue, /* add_queue */ + NULL, /* remove_queue */ + NULL, /* signaled */ + NULL, /* get_esync_fd */ + NULL, /* satisfied */ + no_signal, /* signal */ + no_get_fd, /* get_fd */ + default_map_access, /* map_access */ + default_get_sd, /* get_sd */ + default_set_sd, /* set_sd */ + default_get_full_name, /* get_full_name */ + no_lookup_name, /* lookup_name */ + directory_link_name, /* link_name */ + default_unlink_name, /* unlink_name */ + no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_close_handle, /* close_handle */ + fsync_destroy /* destroy */ +}; + +static void fsync_dump( struct object *obj, int verbose ) +{ + struct fsync *fsync = (struct fsync *)obj; + assert( obj->ops == &fsync_ops ); + fprintf( stderr, "fsync idx=%d\n", fsync->shm_idx ); +} + +static void fsync_destroy( struct object *obj ) +{ +} + +static void *get_shm( unsigned int idx ) +{ + int entry = (idx * 8) / pagesize; + int offset = (idx * 8) % pagesize; + + if (entry >= shm_addrs_size) + { + int new_size = max(shm_addrs_size * 2, entry + 1); + + if (!(shm_addrs = realloc( shm_addrs, new_size * sizeof(shm_addrs[0]) ))) + fprintf( stderr, "fsync: couldn't expand shm_addrs array to size %d\n", entry + 1 ); + + memset( shm_addrs + shm_addrs_size, 0, (new_size - shm_addrs_size) * sizeof(shm_addrs[0]) ); + + shm_addrs_size = new_size; + } + + if (!shm_addrs[entry]) + { + void *addr = mmap( NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, shm_fd, entry * pagesize ); + if (addr == (void *)-1) + { + fprintf( stderr, "fsync: failed to map page %d (offset %#lx): ", entry, entry * pagesize ); + perror( "mmap" ); + } + + if (debug_level) + fprintf( stderr, "fsync: Mapping page %d at %p.\n", entry, addr ); + + if (__sync_val_compare_and_swap( &shm_addrs[entry], 0, addr )) + munmap( addr, pagesize ); /* someone beat us to it */ + } + + return (void *)((unsigned long)shm_addrs[entry] + offset); +} + +/* FIXME: This is rather inefficient... */ +static unsigned int shm_idx_counter = 1; + +struct fsync *create_fsync( struct object *root, const struct unicode_str *name, + unsigned int attr, int low, int high, + const struct security_descriptor *sd ) +{ +#ifdef __linux__ + struct fsync *fsync; + + if ((fsync = create_named_object( root, &fsync_ops, name, attr, sd ))) + { + if (get_error() != STATUS_OBJECT_NAME_EXISTS) + { + int *shm; + + /* initialize it if it didn't already exist */ + + fsync->shm_idx = shm_idx_counter++; + while (fsync->shm_idx * 8 >= shm_size) + { + /* Better expand the shm section. */ + shm_size += pagesize; + if (ftruncate( shm_fd, shm_size ) == -1) + { + fprintf( stderr, "fsync: couldn't expand %s to size %lld: ", + shm_name, (long long)shm_size ); + perror( "ftruncate" ); + } + } + + /* Initialize the shared memory portion. We want to do this on the + * server side to avoid a potential though unlikely race whereby + * the same object is opened and used between the time it's created + * and the time its shared memory portion is initialized. */ + + shm = get_shm( fsync->shm_idx ); + assert(shm); + shm[0] = low; + shm[1] = high; + } + } + + return fsync; +#else + set_error( STATUS_NOT_IMPLEMENTED ); + return NULL; +#endif +} + +DECL_HANDLER(create_fsync) +{ + struct fsync *fsync; + struct unicode_str name; + struct object *root; + const struct security_descriptor *sd; + const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, &root ); + + if (!do_fsync()) + { + set_error( STATUS_NOT_IMPLEMENTED ); + return; + } + + if (!objattr) return; + + if ((fsync = create_fsync( root, &name, objattr->attributes, req->low, + req->high, sd ))) + { + if (get_error() == STATUS_OBJECT_NAME_EXISTS) + reply->handle = alloc_handle( current->process, fsync, req->access, objattr->attributes ); + else + reply->handle = alloc_handle_no_access_check( current->process, fsync, + req->access, objattr->attributes ); + + reply->shm_idx = fsync->shm_idx; + release_object( fsync ); + } + + if (root) release_object( root ); +} diff --git a/server/fsync.h b/server/fsync.h new file mode 100644 index 000000000000..0b7e46cdaf3e --- /dev/null +++ b/server/fsync.h @@ -0,0 +1,22 @@ +/* + * futex-based synchronization objects + * + * Copyright (C) 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +extern int do_fsync(void); +extern void fsync_init(void); diff --git a/server/main.c b/server/main.c index c4bb790db8a2..457b044a36ac 100644 --- a/server/main.c +++ b/server/main.c @@ -35,6 +35,7 @@ #include "request.h" #include "unicode.h" #include "esync.h" +#include "fsync.h" /* command-line options */ int debug_level = 0; @@ -230,6 +231,9 @@ int main( int argc, char *argv[] ) sock_init(); open_master_socket(); + if (do_fsync()) + fsync_init(); + if (do_esync()) esync_init(); diff --git a/server/protocol.def b/server/protocol.def index f71c0415b8eb..c3013dab7422 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -4131,3 +4131,14 @@ enum esync_type /* Retrieve the fd to wait on for user APCs. */ @REQ(get_esync_apc_fd) @END + +/* Create a new futex-based synchronization object */ +@REQ(create_fsync) + unsigned int access; /* wanted access rights */ + int low; /* initial value of low word */ + int high; /* initial value of high word */ + VARARG(objattr,object_attributes); /* object attributes */ +@REPLY + obj_handle_t handle; /* handle to the object */ + unsigned int shm_idx; /* this object's index into the shm section */ +@END From eddc00c60de97abc55494a5e7d0ddfb8dd12585a Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 19:14:24 -0500 Subject: [PATCH 0327/2542] ntdll: Create futex-based objects for semaphores. --- dlls/ntdll/Makefile.in | 1 + dlls/ntdll/unix/fsync.c | 277 +++++++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/fsync.h | 25 ++++ dlls/ntdll/unix/loader.c | 2 + dlls/ntdll/unix/sync.c | 4 + 5 files changed, 309 insertions(+) create mode 100644 dlls/ntdll/unix/fsync.c create mode 100644 dlls/ntdll/unix/fsync.h diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in index 01a0cf4ab379..457ae5773997 100644 --- a/dlls/ntdll/Makefile.in +++ b/dlls/ntdll/Makefile.in @@ -50,6 +50,7 @@ SOURCES = \ unix/env.c \ unix/esync.c \ unix/file.c \ + unix/fsync.c \ unix/loader.c \ unix/loadorder.c \ unix/process.c \ diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c new file mode 100644 index 000000000000..d6475e0b5010 --- /dev/null +++ b/dlls/ntdll/unix/fsync.c @@ -0,0 +1,277 @@ +/* + * futex-based synchronization objects + * + * Copyright (C) 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_SYS_SYSCALL_H +# include +#endif +#include + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winternl.h" +#include "wine/debug.h" +#include "wine/server.h" + +#include "unix_private.h" +#include "fsync.h" + +WINE_DEFAULT_DEBUG_CHANNEL(fsync); + +#include "pshpack4.h" +struct futex_wait_block +{ + int *addr; +#if __SIZEOF_POINTER__ == 4 + int pad; +#endif + int val; +}; +#include "poppack.h" + +static inline int futex_wait_multiple( const struct futex_wait_block *futexes, + int count, const struct timespec *timeout ) +{ + return syscall( __NR_futex, futexes, 13, count, timeout, 0, 0 ); +} + +int do_fsync(void) +{ +#ifdef __linux__ + static int do_fsync_cached = -1; + + if (do_fsync_cached == -1) + { + static const struct timespec zero; + futex_wait_multiple( NULL, 0, &zero ); + do_fsync_cached = getenv("WINEFSYNC") && atoi(getenv("WINEFSYNC")) && errno != ENOSYS; + } + + return do_fsync_cached; +#else + static int once; + if (!once++) + FIXME("futexes not supported on this platform.\n"); + return 0; +#endif +} + +enum fsync_type +{ + FSYNC_SEMAPHORE = 1, +}; + +struct fsync +{ + enum fsync_type type; + void *shm; /* pointer to shm section */ +}; + +struct semaphore +{ + int count; + int max; +}; +C_ASSERT(sizeof(struct semaphore) == 8); + + +static char shm_name[29]; +static int shm_fd; +static void **shm_addrs; +static int shm_addrs_size; /* length of the allocated shm_addrs array */ +static long pagesize; + +static void *get_shm( unsigned int idx ) +{ + int entry = (idx * 8) / pagesize; + int offset = (idx * 8) % pagesize; + + if (entry >= shm_addrs_size) + { + int new_size = max(shm_addrs_size * 2, entry + 1); + + if (!(shm_addrs = realloc( shm_addrs, new_size * sizeof(shm_addrs[0]) ))) + ERR("Failed to grow shm_addrs array to size %d.\n", shm_addrs_size); + memset( shm_addrs + shm_addrs_size, 0, (new_size - shm_addrs_size) * sizeof(shm_addrs[0]) ); + shm_addrs_size = new_size; + } + + if (!shm_addrs[entry]) + { + void *addr = mmap( NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, shm_fd, entry * pagesize ); + if (addr == (void *)-1) + ERR("Failed to map page %d (offset %#lx).\n", entry, entry * pagesize); + + TRACE("Mapping page %d at %p.\n", entry, addr); + + if (__sync_val_compare_and_swap( &shm_addrs[entry], 0, addr )) + munmap( addr, pagesize ); /* someone beat us to it */ + } + + return (void *)((unsigned long)shm_addrs[entry] + offset); +} + +/* We'd like lookup to be fast. To that end, we use a static list indexed by handle. + * This is copied and adapted from the fd cache code. */ + +#define FSYNC_LIST_BLOCK_SIZE (65536 / sizeof(struct fsync)) +#define FSYNC_LIST_ENTRIES 256 + +static struct fsync *fsync_list[FSYNC_LIST_ENTRIES]; +static struct fsync fsync_list_initial_block[FSYNC_LIST_BLOCK_SIZE]; + +static inline UINT_PTR handle_to_index( HANDLE handle, UINT_PTR *entry ) +{ + UINT_PTR idx = (((UINT_PTR)handle) >> 2) - 1; + *entry = idx / FSYNC_LIST_BLOCK_SIZE; + return idx % FSYNC_LIST_BLOCK_SIZE; +} + +static struct fsync *add_to_list( HANDLE handle, enum fsync_type type, void *shm ) +{ + UINT_PTR entry, idx = handle_to_index( handle, &entry ); + + if (entry >= FSYNC_LIST_ENTRIES) + { + FIXME( "too many allocated handles, not caching %p\n", handle ); + return FALSE; + } + + if (!fsync_list[entry]) /* do we need to allocate a new block of entries? */ + { + if (!entry) fsync_list[0] = fsync_list_initial_block; + else + { + void *ptr = anon_mmap_alloc( FSYNC_LIST_BLOCK_SIZE * sizeof(struct fsync), + PROT_READ | PROT_WRITE ); + if (ptr == MAP_FAILED) return FALSE; + fsync_list[entry] = ptr; + } + } + + if (!__sync_val_compare_and_swap((int *)&fsync_list[entry][idx].type, 0, type )) + fsync_list[entry][idx].shm = shm; + + return &fsync_list[entry][idx]; +} + +static NTSTATUS create_fsync( enum fsync_type type, HANDLE *handle, + ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, int low, int high ) +{ + NTSTATUS ret; + data_size_t len; + struct object_attributes *objattr; + unsigned int shm_idx; + + if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret; + + SERVER_START_REQ( create_fsync ) + { + req->access = access; + req->low = low; + req->high = high; + wine_server_add_data( req, objattr, len ); + ret = wine_server_call( req ); + if (!ret || ret == STATUS_OBJECT_NAME_EXISTS) + { + *handle = wine_server_ptr_handle( reply->handle ); + shm_idx = reply->shm_idx; + } + } + SERVER_END_REQ; + + if (!ret || ret == STATUS_OBJECT_NAME_EXISTS) + { + add_to_list( *handle, type, get_shm( shm_idx )); + TRACE("-> handle %p, shm index %d.\n", *handle, shm_idx); + } + + free( objattr ); + return ret; +} + +void fsync_init(void) +{ + struct stat st; + + if (!do_fsync()) + { + /* make sure the server isn't running with WINEFSYNC */ + HANDLE handle; + NTSTATUS ret; + + ret = create_fsync( 0, &handle, 0, NULL, 0, 0 ); + if (ret != STATUS_NOT_IMPLEMENTED) + { + ERR("Server is running with WINEFSYNC but this process is not, please enable WINEFSYNC or restart wineserver.\n"); + exit(1); + } + + return; + } + + if (stat( config_dir, &st ) == -1) + ERR("Cannot stat %s\n", config_dir); + + if (st.st_ino != (unsigned long)st.st_ino) + sprintf( shm_name, "/wine-%lx%08lx-fsync", (unsigned long)((unsigned long long)st.st_ino >> 32), (unsigned long)st.st_ino ); + else + sprintf( shm_name, "/wine-%lx-fsync", (unsigned long)st.st_ino ); + + if ((shm_fd = shm_open( shm_name, O_RDWR, 0644 )) == -1) + { + /* probably the server isn't running with WINEFSYNC, tell the user and bail */ + if (errno == ENOENT) + ERR("Failed to open fsync shared memory file; make sure no stale wineserver instances are running without WINEFSYNC.\n"); + else + ERR("Failed to initialize shared memory: %s\n", strerror( errno )); + exit(1); + } + + pagesize = sysconf( _SC_PAGESIZE ); + + shm_addrs = calloc( 128, sizeof(shm_addrs[0]) ); + shm_addrs_size = 128; +} + +NTSTATUS fsync_create_semaphore( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max ) +{ + TRACE("name %s, initial %d, max %d.\n", + attr ? debugstr_us(attr->ObjectName) : "", (int)initial, (int)max); + + return create_fsync( FSYNC_SEMAPHORE, handle, access, attr, initial, max ); +} diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h new file mode 100644 index 000000000000..273a4817dd01 --- /dev/null +++ b/dlls/ntdll/unix/fsync.h @@ -0,0 +1,25 @@ +/* + * futex-based synchronization objects + * + * Copyright (C) 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +extern int do_fsync(void); +extern void fsync_init(void); + +extern NTSTATUS fsync_create_semaphore(HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max); diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 43627cb258df..940f261d2988 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -91,6 +91,7 @@ #include "winternl.h" #include "unix_private.h" #include "esync.h" +#include "fsync.h" #include "wine/list.h" #include "ntsyscalls.h" #include "wine/debug.h" @@ -2046,6 +2047,7 @@ static void start_main_thread(void) dbg_init(); startup_info_size = server_init_process(); hacks_init(); + fsync_init(); esync_init(); virtual_map_user_shared_data(); init_cpu_info(); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 75525f34bf76..897b17d49416 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -67,6 +67,7 @@ #include "wine/debug.h" #include "unix_private.h" #include "esync.h" +#include "fsync.h" WINE_DEFAULT_DEBUG_CHANNEL(sync); @@ -316,6 +317,9 @@ NTSTATUS WINAPI NtCreateSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJ if (max <= 0 || initial < 0 || initial > max) return STATUS_INVALID_PARAMETER; if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret; + if (do_fsync()) + return fsync_create_semaphore( handle, access, attr, initial, max ); + if (do_esync()) return esync_create_semaphore( handle, access, attr, initial, max ); From 07d7b2f782b4be3d158c11636e5ca1bb0d7aa02c Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 19:21:55 -0500 Subject: [PATCH 0328/2542] ntdll: Implement NtReleaseSemaphore(). --- dlls/ntdll/unix/fsync.c | 41 +++++++++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/fsync.h | 1 + dlls/ntdll/unix/sync.c | 3 +++ server/esync.c | 1 + 4 files changed, 46 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index d6475e0b5010..5281d1cbce8a 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -68,6 +68,11 @@ static inline int futex_wait_multiple( const struct futex_wait_block *futexes, return syscall( __NR_futex, futexes, 13, count, timeout, 0, 0 ); } +static inline int futex_wake( int *addr, int val ) +{ + return syscall( __NR_futex, addr, 1, val, NULL, 0, 0 ); +} + int do_fsync(void) { #ifdef __linux__ @@ -188,6 +193,16 @@ static struct fsync *add_to_list( HANDLE handle, enum fsync_type type, void *shm return &fsync_list[entry][idx]; } +static struct fsync *get_cached_object( HANDLE handle ) +{ + UINT_PTR entry, idx = handle_to_index( handle, &entry ); + + if (entry >= FSYNC_LIST_ENTRIES || !fsync_list[entry]) return NULL; + if (!fsync_list[entry][idx].type) return NULL; + + return &fsync_list[entry][idx]; +} + static NTSTATUS create_fsync( enum fsync_type type, HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, int low, int high ) { @@ -275,3 +290,29 @@ NTSTATUS fsync_create_semaphore( HANDLE *handle, ACCESS_MASK access, return create_fsync( FSYNC_SEMAPHORE, handle, access, attr, initial, max ); } + +NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) +{ + struct fsync *obj; + struct semaphore *semaphore; + ULONG current; + + TRACE("%p, %d, %p.\n", handle, (int)count, prev); + + if (!(obj = get_cached_object( handle ))) return STATUS_INVALID_HANDLE; + semaphore = obj->shm; + + do + { + current = semaphore->count; + if (count + current > semaphore->max) + return STATUS_SEMAPHORE_LIMIT_EXCEEDED; + } while (__sync_val_compare_and_swap( &semaphore->count, current, count + current ) != current); + + if (prev) *prev = current; + + if (!current) + futex_wake( &semaphore->count, count ); + + return STATUS_SUCCESS; +} diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h index 273a4817dd01..0ec618385ed5 100644 --- a/dlls/ntdll/unix/fsync.h +++ b/dlls/ntdll/unix/fsync.h @@ -23,3 +23,4 @@ extern void fsync_init(void); extern NTSTATUS fsync_create_semaphore(HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max); +extern NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 897b17d49416..8785e0118ad1 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -412,6 +412,9 @@ NTSTATUS WINAPI NtReleaseSemaphore( HANDLE handle, ULONG count, ULONG *previous { unsigned int ret; + if (do_fsync()) + return fsync_release_semaphore( handle, count, previous ); + if (do_esync()) return esync_release_semaphore( handle, count, previous ); diff --git a/server/esync.c b/server/esync.c index e193f61b3a76..fc8120f94490 100644 --- a/server/esync.c +++ b/server/esync.c @@ -23,6 +23,7 @@ #include #include +#include #include #ifdef HAVE_SYS_EVENTFD_H # include From 19dcdff94c958e7ca2c15dc2f7e24799feb2ecf1 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 15:50:37 -0500 Subject: [PATCH 0329/2542] ntdll: Close fsync objects. --- dlls/ntdll/unix/fsync.c | 15 +++++++++++++++ dlls/ntdll/unix/fsync.h | 1 + dlls/ntdll/unix/server.c | 4 ++++ 3 files changed, 20 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 5281d1cbce8a..2f1992869504 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -203,6 +203,21 @@ static struct fsync *get_cached_object( HANDLE handle ) return &fsync_list[entry][idx]; } +NTSTATUS fsync_close( HANDLE handle ) +{ + UINT_PTR entry, idx = handle_to_index( handle, &entry ); + + TRACE("%p.\n", handle); + + if (entry < FSYNC_LIST_ENTRIES && fsync_list[entry]) + { + if (__atomic_exchange_n( &fsync_list[entry][idx].type, 0, __ATOMIC_SEQ_CST )) + return STATUS_SUCCESS; + } + + return STATUS_INVALID_HANDLE; +} + static NTSTATUS create_fsync( enum fsync_type type, HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, int low, int high ) { diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h index 0ec618385ed5..ed10eeb2d7b6 100644 --- a/dlls/ntdll/unix/fsync.h +++ b/dlls/ntdll/unix/fsync.h @@ -20,6 +20,7 @@ extern int do_fsync(void); extern void fsync_init(void); +extern NTSTATUS fsync_close( HANDLE handle ); extern NTSTATUS fsync_create_semaphore(HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max); diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c index 600ee4e33a09..59cc5b4056f6 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c @@ -80,6 +80,7 @@ #include "wine/debug.h" #include "unix_private.h" #include "esync.h" +#include "fsync.h" #include "ddk/wdm.h" WINE_DEFAULT_DEBUG_CHANNEL(server); @@ -1871,6 +1872,9 @@ NTSTATUS WINAPI NtClose( HANDLE handle ) * retrieve it again */ fd = remove_fd_from_cache( handle ); + if (do_fsync()) + fsync_close( handle ); + if (do_esync()) esync_close( handle ); From 95c4c54431a0f979daedd7248d0b06e2f67bf89e Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 16:25:59 -0500 Subject: [PATCH 0330/2542] ntdll: Implement waiting on fsync objects. --- dlls/ntdll/unix/fsync.c | 145 ++++++++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/fsync.h | 3 + dlls/ntdll/unix/sync.c | 7 ++ 3 files changed, 155 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 2f1992869504..504806ae10a2 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -331,3 +331,148 @@ NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) return STATUS_SUCCESS; } + +static LONGLONG update_timeout( ULONGLONG end ) +{ + LARGE_INTEGER now; + LONGLONG timeleft; + + NtQuerySystemTime( &now ); + timeleft = end - now.QuadPart; + if (timeleft < 0) timeleft = 0; + return timeleft; +} + +NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, + BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ) +{ + struct futex_wait_block futexes[MAXIMUM_WAIT_OBJECTS]; + struct fsync *objs[MAXIMUM_WAIT_OBJECTS]; + int has_fsync = 0, has_server = 0; + int dummy_futex = 0; + LONGLONG timeleft; + LARGE_INTEGER now; + ULONGLONG end; + int i, ret; + + NtQuerySystemTime( &now ); + if (timeout) + { + if (timeout->QuadPart == TIMEOUT_INFINITE) + timeout = NULL; + else if (timeout->QuadPart > 0) + end = timeout->QuadPart; + else + end = now.QuadPart - timeout->QuadPart; + } + + for (i = 0; i < count; i++) + { + if ((objs[i] = get_cached_object( handles[i] ))) + has_fsync = 1; + else + has_server = 1; + } + + if (has_fsync && has_server) + FIXME("Can't wait on fsync and server objects at the same time!\n"); + else if (has_server) + return STATUS_NOT_IMPLEMENTED; + + if (TRACE_ON(fsync)) + { + TRACE("Waiting for %s of %d handles:", wait_any ? "any" : "all", (int)count); + for (i = 0; i < count; i++) + TRACE(" %p", handles[i]); + + if (!timeout) + TRACE(", timeout = INFINITE.\n"); + else + { + timeleft = update_timeout( end ); + TRACE(", timeout = %ld.%07ld sec.\n", + (long) (timeleft / TICKSPERSEC), (long) (timeleft % TICKSPERSEC)); + } + } + + if (wait_any || count == 1) + { + while (1) + { + /* Try to grab anything. */ + + for (i = 0; i < count; i++) + { + struct fsync *obj = objs[i]; + + if (obj) + { + switch (obj->type) + { + case FSYNC_SEMAPHORE: + { + struct semaphore *semaphore = obj->shm; + int current; + + do + { + if (!(current = semaphore->count)) break; + } while (__sync_val_compare_and_swap( &semaphore->count, current, current - 1 ) != current); + + if (current) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + return i; + } + + futexes[i].addr = &semaphore->count; + futexes[i].val = current; + break; + } + default: + assert(0); + } + } + else + { + /* Avoid breaking things entirely. */ + futexes[i].addr = &dummy_futex; + futexes[i].val = dummy_futex; + } + +#if __SIZEOF_POINTER__ == 4 + futexes[i].pad = 0; +#endif + } + + /* Looks like everything is contended, so wait. */ + + if (timeout) + { + LONGLONG timeleft = update_timeout( end ); + struct timespec tmo_p; + tmo_p.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; + tmo_p.tv_nsec = (timeleft % TICKSPERSEC) * 100; + + ret = futex_wait_multiple( futexes, count, &tmo_p ); + } + else + ret = futex_wait_multiple( futexes, count, NULL ); + + /* FUTEX_WAIT_MULTIPLE can succeed or return -EINTR, -EAGAIN, + * -EFAULT/-EACCES, -ETIMEDOUT. In the first three cases we need to + * try again, bad address is already handled by the fact that we + * tried to read from it, so only break out on a timeout. */ + if (ret == -1 && errno == ETIMEDOUT) + { + TRACE("Wait timed out.\n"); + return STATUS_TIMEOUT; + } + } /* while (1) */ + } + else + { + FIXME("Wait-all not implemented.\n"); + return STATUS_NOT_IMPLEMENTED; + } +} diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h index ed10eeb2d7b6..4a5c00ca0a79 100644 --- a/dlls/ntdll/unix/fsync.h +++ b/dlls/ntdll/unix/fsync.h @@ -25,3 +25,6 @@ extern NTSTATUS fsync_close( HANDLE handle ); extern NTSTATUS fsync_create_semaphore(HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max); extern NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ); + +extern NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, + BOOLEAN alertable, const LARGE_INTEGER *timeout ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 8785e0118ad1..8370d01c10e8 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -1633,6 +1633,13 @@ NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles, BO if (!count || count > MAXIMUM_WAIT_OBJECTS) return STATUS_INVALID_PARAMETER_1; + if (do_fsync()) + { + NTSTATUS ret = fsync_wait_objects( count, handles, wait_any, alertable, timeout ); + if (ret != STATUS_NOT_IMPLEMENTED) + return ret; + } + if (do_esync()) { NTSTATUS ret = esync_wait_objects( count, handles, wait_any, alertable, timeout ); From 5c89d3b1d5e828615ae2127e255fc4991056906d Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 16:31:54 -0500 Subject: [PATCH 0331/2542] ntdll: Create fsync objects for events. --- dlls/ntdll/unix/fsync.c | 20 ++++++++++++++++++++ dlls/ntdll/unix/fsync.h | 2 ++ dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 25 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 504806ae10a2..2a7dee5f6613 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -97,6 +97,8 @@ int do_fsync(void) enum fsync_type { FSYNC_SEMAPHORE = 1, + FSYNC_AUTO_EVENT, + FSYNC_MANUAL_EVENT, }; struct fsync @@ -112,6 +114,12 @@ struct semaphore }; C_ASSERT(sizeof(struct semaphore) == 8); +struct event +{ + int signaled; + int unused; +}; +C_ASSERT(sizeof(struct event) == 8); static char shm_name[29]; static int shm_fd; @@ -332,6 +340,18 @@ NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) return STATUS_SUCCESS; } +NTSTATUS fsync_create_event( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, EVENT_TYPE event_type, BOOLEAN initial ) +{ + enum fsync_type type = (event_type == SynchronizationEvent ? FSYNC_AUTO_EVENT : FSYNC_MANUAL_EVENT); + + TRACE("name %s, %s-reset, initial %d.\n", + attr ? debugstr_us(attr->ObjectName) : "", + event_type == NotificationEvent ? "manual" : "auto", initial); + + return create_fsync( type, handle, access, attr, initial, 0xdeadbeef ); +} + static LONGLONG update_timeout( ULONGLONG end ) { LARGE_INTEGER now; diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h index 4a5c00ca0a79..cc93044f38f8 100644 --- a/dlls/ntdll/unix/fsync.h +++ b/dlls/ntdll/unix/fsync.h @@ -25,6 +25,8 @@ extern NTSTATUS fsync_close( HANDLE handle ); extern NTSTATUS fsync_create_semaphore(HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max); extern NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ); +extern NTSTATUS fsync_create_event( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial ); extern NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 8370d01c10e8..9c766cddc374 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -445,6 +445,9 @@ NTSTATUS WINAPI NtCreateEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_ *handle = 0; if (type != NotificationEvent && type != SynchronizationEvent) return STATUS_INVALID_PARAMETER; + if (do_fsync()) + return fsync_create_event( handle, access, attr, type, state ); + if (do_esync()) return esync_create_event( handle, access, attr, type, state ); From aac8e0df46ccc1789eea6a01cf07090a17a71a11 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 16:36:16 -0500 Subject: [PATCH 0332/2542] ntdll: Implement NtSetEvent(). --- dlls/ntdll/unix/fsync.c | 20 ++++++++++++++++++++ dlls/ntdll/unix/fsync.h | 1 + dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 24 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 2a7dee5f6613..a8c364162cc6 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -352,6 +353,25 @@ NTSTATUS fsync_create_event( HANDLE *handle, ACCESS_MASK access, return create_fsync( type, handle, access, attr, initial, 0xdeadbeef ); } +NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ) +{ + struct event *event; + struct fsync *obj; + LONG current; + + TRACE("%p.\n", handle); + + if (!(obj = get_cached_object( handle ))) return STATUS_INVALID_HANDLE; + event = obj->shm; + + if (!(current = __atomic_exchange_n( &event->signaled, 1, __ATOMIC_SEQ_CST ))) + futex_wake( &event->signaled, obj->type == FSYNC_AUTO_EVENT ? 1 : INT_MAX ); + + if (prev) *prev = current; + + return STATUS_SUCCESS; +} + static LONGLONG update_timeout( ULONGLONG end ) { LARGE_INTEGER now; diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h index cc93044f38f8..2ba03261c17b 100644 --- a/dlls/ntdll/unix/fsync.h +++ b/dlls/ntdll/unix/fsync.h @@ -27,6 +27,7 @@ extern NTSTATUS fsync_create_semaphore(HANDLE *handle, ACCESS_MASK access, extern NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ); extern NTSTATUS fsync_create_event( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial ); +extern NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ); extern NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 9c766cddc374..e02df0103943 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -505,6 +505,9 @@ NTSTATUS WINAPI NtSetEvent( HANDLE handle, LONG *prev_state ) /* This comment is a dummy to make sure this patch applies in the right place. */ unsigned int ret; + if (do_fsync()) + return fsync_set_event( handle, prev_state ); + if (do_esync()) return esync_set_event( handle ); From 847963791dd99014c31fcfd43e7e104c44e9abb4 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 16:39:38 -0500 Subject: [PATCH 0333/2542] ntdll: Implement NtResetEvent(). --- dlls/ntdll/unix/fsync.c | 18 ++++++++++++++++++ dlls/ntdll/unix/fsync.h | 1 + dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 22 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index a8c364162cc6..c7b4ee1a298b 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -372,6 +372,24 @@ NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ) return STATUS_SUCCESS; } +NTSTATUS fsync_reset_event( HANDLE handle, LONG *prev ) +{ + struct event *event; + struct fsync *obj; + LONG current; + + TRACE("%p.\n", handle); + + if (!(obj = get_cached_object( handle ))) return STATUS_INVALID_HANDLE; + event = obj->shm; + + current = __atomic_exchange_n( &event->signaled, 0, __ATOMIC_SEQ_CST ); + + if (prev) *prev = current; + + return STATUS_SUCCESS; +} + static LONGLONG update_timeout( ULONGLONG end ) { LARGE_INTEGER now; diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h index 2ba03261c17b..56afeb1f9e8b 100644 --- a/dlls/ntdll/unix/fsync.h +++ b/dlls/ntdll/unix/fsync.h @@ -28,6 +28,7 @@ extern NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev extern NTSTATUS fsync_create_event( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial ); extern NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ); +extern NTSTATUS fsync_reset_event( HANDLE handle, LONG *prev ); extern NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index e02df0103943..160d8517017e 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -531,6 +531,9 @@ NTSTATUS WINAPI NtResetEvent( HANDLE handle, LONG *prev_state ) /* This comment is a dummy to make sure this patch applies in the right place. */ unsigned int ret; + if (do_fsync()) + return fsync_reset_event( handle, prev_state ); + if (do_esync()) return esync_reset_event( handle ); From 3d41b1b89ffcf010639317f8bcb00829aa8f4cff Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 16:45:43 -0500 Subject: [PATCH 0334/2542] ntdll: Implement waiting on events. --- dlls/ntdll/unix/fsync.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index c7b4ee1a298b..e7a495be365b 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -487,6 +487,34 @@ NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, futexes[i].val = current; break; } + case FSYNC_AUTO_EVENT: + { + struct event *event = obj->shm; + + if (__sync_val_compare_and_swap( &event->signaled, 1, 0 )) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + return i; + } + + futexes[i].addr = &event->signaled; + futexes[i].val = 0; + break; + } + case FSYNC_MANUAL_EVENT: + { + struct event *event = obj->shm; + + if (__atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + return i; + } + + futexes[i].addr = &event->signaled; + futexes[i].val = 0; + break; + } default: assert(0); } From b6707bd2170a2305558f5ab3296712e6bcfa4154 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 16:52:01 -0500 Subject: [PATCH 0335/2542] server: Add an object operation to grab the fsync shm index. --- server/async.c | 2 ++ server/atom.c | 1 + server/change.c | 1 + server/clipboard.c | 1 + server/completion.c | 2 ++ server/console.c | 7 +++++++ server/debugger.c | 2 ++ server/device.c | 4 ++++ server/directory.c | 2 ++ server/esync.c | 1 + server/event.c | 2 ++ server/fd.c | 4 ++++ server/file.c | 1 + server/fsync.c | 1 + server/handle.c | 1 + server/hook.c | 1 + server/mailslot.c | 4 ++++ server/mapping.c | 3 +++ server/mutex.c | 1 + server/named_pipe.c | 6 ++++++ server/object.c | 2 ++ server/object.h | 2 ++ server/process.c | 3 +++ server/queue.c | 2 ++ server/registry.c | 1 + server/request.c | 1 + server/semaphore.c | 1 + server/serial.c | 1 + server/signal.c | 1 + server/sock.c | 3 +++ server/symlink.c | 1 + server/thread.c | 3 +++ server/timer.c | 1 + server/token.c | 1 + server/window.c | 1 + server/winstation.c | 2 ++ 36 files changed, 73 insertions(+) diff --git a/server/async.c b/server/async.c index 9768a4932a6c..10089b20a0e0 100644 --- a/server/async.c +++ b/server/async.c @@ -79,6 +79,7 @@ static const struct object_ops async_ops = remove_queue, /* remove_queue */ async_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ async_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -700,6 +701,7 @@ static const struct object_ops iosb_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/atom.c b/server/atom.c index d9824de8eac3..6b95a5465976 100644 --- a/server/atom.c +++ b/server/atom.c @@ -80,6 +80,7 @@ static const struct object_ops atom_table_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/change.c b/server/change.c index 1c394c9d3a24..1341977fcf75 100644 --- a/server/change.c +++ b/server/change.c @@ -113,6 +113,7 @@ static const struct object_ops dir_ops = remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ default_fd_get_esync_fd, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ dir_get_fd, /* get_fd */ diff --git a/server/clipboard.c b/server/clipboard.c index 0df7fd2f18e7..a2e0af2ba32f 100644 --- a/server/clipboard.c +++ b/server/clipboard.c @@ -77,6 +77,7 @@ static const struct object_ops clipboard_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/completion.c b/server/completion.c index 3d750154d1ba..2ff82b4e7bce 100644 --- a/server/completion.c +++ b/server/completion.c @@ -93,6 +93,7 @@ static const struct object_ops completion_wait_ops = remove_queue, /* remove_queue */ completion_wait_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ completion_wait_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -168,6 +169,7 @@ static const struct object_ops completion_ops = remove_queue, /* remove_queue */ completion_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/console.c b/server/console.c index c85eb98fa1f5..09e8b53ca341 100644 --- a/server/console.c +++ b/server/console.c @@ -83,6 +83,7 @@ static const struct object_ops console_ops = remove_queue, /* remove_queue */ console_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ console_get_fd, /* get_fd */ @@ -163,6 +164,7 @@ static const struct object_ops console_server_ops = remove_queue, /* remove_queue */ console_server_signaled, /* signaled */ console_server_get_esync_fd, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ console_server_get_fd, /* get_fd */ @@ -233,6 +235,7 @@ static const struct object_ops screen_buffer_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ screen_buffer_get_fd, /* get_fd */ @@ -283,6 +286,7 @@ static const struct object_ops console_device_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -321,6 +325,7 @@ static const struct object_ops console_input_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ console_input_get_fd, /* get_fd */ @@ -379,6 +384,7 @@ static const struct object_ops console_output_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ console_output_get_fd, /* get_fd */ @@ -438,6 +444,7 @@ static const struct object_ops console_connection_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ console_connection_get_fd, /* get_fd */ diff --git a/server/debugger.c b/server/debugger.c index 0c01ec1c0d3a..5494eb517df1 100644 --- a/server/debugger.c +++ b/server/debugger.c @@ -87,6 +87,7 @@ static const struct object_ops debug_event_ops = remove_queue, /* remove_queue */ debug_event_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -116,6 +117,7 @@ static const struct object_ops debug_obj_ops = remove_queue, /* remove_queue */ debug_obj_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/device.c b/server/device.c index 52a22968ed2a..233346da0160 100644 --- a/server/device.c +++ b/server/device.c @@ -69,6 +69,7 @@ static const struct object_ops irp_call_ops = NULL, /* signaled */ NULL, /* get_esync_fd */ NULL, /* satisfied */ + NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ default_map_access, /* map_access */ @@ -111,6 +112,7 @@ static const struct object_ops device_manager_ops = remove_queue, /* remove_queue */ device_manager_signaled, /* signaled */ device_manager_get_esync_fd, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -169,6 +171,7 @@ static const struct object_ops device_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -222,6 +225,7 @@ static const struct object_ops device_file_ops = remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ device_file_get_fd, /* get_fd */ diff --git a/server/directory.c b/server/directory.c index 2894f7669dbf..cd17883458e3 100644 --- a/server/directory.c +++ b/server/directory.c @@ -70,6 +70,7 @@ static const struct object_ops object_type_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -121,6 +122,7 @@ static const struct object_ops directory_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/esync.c b/server/esync.c index fc8120f94490..064bdd61b253 100644 --- a/server/esync.c +++ b/server/esync.c @@ -129,6 +129,7 @@ const struct object_ops esync_ops = NULL, /* remove_queue */ NULL, /* signaled */ esync_get_esync_fd, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/event.c b/server/event.c index 28a5620268fb..6c9d71e9fd35 100644 --- a/server/event.c +++ b/server/event.c @@ -77,6 +77,7 @@ static const struct object_ops event_ops = remove_queue, /* remove_queue */ event_signaled, /* signaled */ event_get_esync_fd, /* get_esync_fd */ + NULL, /* get_fsync_idx */ event_satisfied, /* satisfied */ event_signal, /* signal */ no_get_fd, /* get_fd */ @@ -125,6 +126,7 @@ static const struct object_ops keyed_event_ops = remove_queue, /* remove_queue */ keyed_event_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/fd.c b/server/fd.c index c9a8b5d13009..8a597e10efa6 100644 --- a/server/fd.c +++ b/server/fd.c @@ -170,6 +170,7 @@ static const struct object_ops fd_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -212,6 +213,7 @@ static const struct object_ops device_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -253,6 +255,7 @@ static const struct object_ops inode_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -296,6 +299,7 @@ static const struct object_ops file_lock_ops = remove_queue, /* remove_queue */ file_lock_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/file.c b/server/file.c index 8dbcae1da7e9..e98c2132e0d7 100644 --- a/server/file.c +++ b/server/file.c @@ -95,6 +95,7 @@ static const struct object_ops file_ops = remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ file_get_fd, /* get_fd */ diff --git a/server/fsync.c b/server/fsync.c index 5f36e9888038..55a8e709dbfb 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -140,6 +140,7 @@ static const struct object_ops fsync_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/handle.c b/server/handle.c index 3b79982f18cb..6385e9aa1617 100644 --- a/server/handle.c +++ b/server/handle.c @@ -127,6 +127,7 @@ static const struct object_ops handle_table_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/hook.c b/server/hook.c index 921aa8aba2e0..499b333dc3a2 100644 --- a/server/hook.c +++ b/server/hook.c @@ -82,6 +82,7 @@ static const struct object_ops hook_table_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/mailslot.c b/server/mailslot.c index e2ee8246633f..37f8f1a679c5 100644 --- a/server/mailslot.c +++ b/server/mailslot.c @@ -82,6 +82,7 @@ static const struct object_ops mailslot_ops = remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ mailslot_get_fd, /* get_fd */ @@ -144,6 +145,7 @@ static const struct object_ops mail_writer_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ mail_writer_get_fd, /* get_fd */ @@ -210,6 +212,7 @@ static const struct object_ops mailslot_device_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -241,6 +244,7 @@ static const struct object_ops mailslot_device_file_ops = remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ mailslot_device_file_get_fd, /* get_fd */ diff --git a/server/mapping.c b/server/mapping.c index a8593de3a5bc..32385662165f 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -68,6 +68,7 @@ static const struct object_ops ranges_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -105,6 +106,7 @@ static const struct object_ops shared_map_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -179,6 +181,7 @@ static const struct object_ops mapping_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ mapping_get_fd, /* get_fd */ diff --git a/server/mutex.c b/server/mutex.c index 4785a830e92b..2503d12057f4 100644 --- a/server/mutex.c +++ b/server/mutex.c @@ -74,6 +74,7 @@ static const struct object_ops mutex_ops = remove_queue, /* remove_queue */ mutex_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ mutex_satisfied, /* satisfied */ mutex_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/named_pipe.c b/server/named_pipe.c index 06a8e9d46256..7b8f4f2edb4e 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -120,6 +120,7 @@ static const struct object_ops named_pipe_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -169,6 +170,7 @@ static const struct object_ops pipe_server_ops = remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ default_fd_get_esync_fd, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ pipe_end_get_fd, /* get_fd */ @@ -214,6 +216,7 @@ static const struct object_ops pipe_client_ops = remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ default_fd_get_esync_fd, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ pipe_end_get_fd, /* get_fd */ @@ -262,6 +265,7 @@ static const struct object_ops named_pipe_device_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -294,6 +298,7 @@ static const struct object_ops named_pipe_device_file_ops = remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ named_pipe_device_file_get_fd, /* get_fd */ @@ -345,6 +350,7 @@ static const struct object_ops named_pipe_dir_ops = remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ named_pipe_dir_get_fd, /* get_fd */ diff --git a/server/object.c b/server/object.c index 4d8fcc5a7742..948c3b3e9744 100644 --- a/server/object.c +++ b/server/object.c @@ -109,6 +109,7 @@ static const struct object_ops apc_reserve_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -134,6 +135,7 @@ static const struct object_ops completion_reserve_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/object.h b/server/object.h index 4acf6f035723..ebe9c6a1ccef 100644 --- a/server/object.h +++ b/server/object.h @@ -80,6 +80,8 @@ struct object_ops int (*signaled)(struct object *,struct wait_queue_entry *); /* return the esync fd for this object */ int (*get_esync_fd)(struct object *, enum esync_type *type); + /* return the fsync shm idx for this object */ + unsigned int (*get_fsync_idx)(struct object *); /* wait satisfied */ void (*satisfied)(struct object *,struct wait_queue_entry *); /* signal an object */ diff --git a/server/process.c b/server/process.c index d7934b770dd7..4a0f31681381 100644 --- a/server/process.c +++ b/server/process.c @@ -108,6 +108,7 @@ static const struct object_ops process_ops = remove_queue, /* remove_queue */ process_signaled, /* signaled */ process_get_esync_fd, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -160,6 +161,7 @@ static const struct object_ops startup_info_ops = remove_queue, /* remove_queue */ startup_info_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -222,6 +224,7 @@ static const struct object_ops job_ops = remove_queue, /* remove_queue */ job_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/queue.c b/server/queue.c index 29e4b0178533..ac4f2e8edc11 100644 --- a/server/queue.c +++ b/server/queue.c @@ -169,6 +169,7 @@ static const struct object_ops msg_queue_ops = msg_queue_remove_queue, /* remove_queue */ msg_queue_signaled, /* signaled */ msg_queue_get_esync_fd, /* get_esync_fd */ + NULL, /* get_fsync_idx */ msg_queue_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -207,6 +208,7 @@ static const struct object_ops thread_input_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/registry.c b/server/registry.c index 7bf65ba499c1..33452cf8a20c 100644 --- a/server/registry.c +++ b/server/registry.c @@ -181,6 +181,7 @@ static const struct object_ops key_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/request.c b/server/request.c index f4f5e713935d..478e1f9cabf7 100644 --- a/server/request.c +++ b/server/request.c @@ -90,6 +90,7 @@ static const struct object_ops master_socket_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/semaphore.c b/server/semaphore.c index e3889f24601b..d354892c2240 100644 --- a/server/semaphore.c +++ b/server/semaphore.c @@ -71,6 +71,7 @@ static const struct object_ops semaphore_ops = remove_queue, /* remove_queue */ semaphore_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ semaphore_satisfied, /* satisfied */ semaphore_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/serial.c b/server/serial.c index 0d49a996c2a8..2d9b2cd5318f 100644 --- a/server/serial.c +++ b/server/serial.c @@ -92,6 +92,7 @@ static const struct object_ops serial_ops = remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ serial_get_fd, /* get_fd */ diff --git a/server/signal.c b/server/signal.c index 55cd6aa037ea..802b7f936b9f 100644 --- a/server/signal.c +++ b/server/signal.c @@ -63,6 +63,7 @@ static const struct object_ops handler_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/sock.c b/server/sock.c index 2bb027a563c2..3d0307b990e7 100644 --- a/server/sock.c +++ b/server/sock.c @@ -472,6 +472,7 @@ static const struct object_ops sock_ops = remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ sock_get_fd, /* get_fd */ @@ -3601,6 +3602,7 @@ static const struct object_ops ifchange_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ ifchange_get_fd, /* get_fd */ @@ -3823,6 +3825,7 @@ static const struct object_ops socket_device_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/symlink.c b/server/symlink.c index 2dd9c6a798df..27a90d91dff0 100644 --- a/server/symlink.c +++ b/server/symlink.c @@ -72,6 +72,7 @@ static const struct object_ops symlink_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/thread.c b/server/thread.c index c0a34a12a1c6..943e66baa525 100644 --- a/server/thread.c +++ b/server/thread.c @@ -101,6 +101,7 @@ static const struct object_ops thread_apc_ops = remove_queue, /* remove_queue */ thread_apc_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -144,6 +145,7 @@ static const struct object_ops context_ops = remove_queue, /* remove_queue */ context_signaled, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -195,6 +197,7 @@ static const struct object_ops thread_ops = remove_queue, /* remove_queue */ thread_signaled, /* signaled */ thread_get_esync_fd, /* get_esync_fd */ + NULL, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/timer.c b/server/timer.c index b4ab61132113..c92162b59ed9 100644 --- a/server/timer.c +++ b/server/timer.c @@ -80,6 +80,7 @@ static const struct object_ops timer_ops = remove_queue, /* remove_queue */ timer_signaled, /* signaled */ timer_get_esync_fd, /* get_esync_fd */ + NULL, /* get_fsync_idx */ timer_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/token.c b/server/token.c index b638ed192cb8..2c0e1795bb96 100644 --- a/server/token.c +++ b/server/token.c @@ -146,6 +146,7 @@ static const struct object_ops token_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/window.c b/server/window.c index be2c68b95fc3..9ac827bfe4e9 100644 --- a/server/window.c +++ b/server/window.c @@ -108,6 +108,7 @@ static const struct object_ops window_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ diff --git a/server/winstation.c b/server/winstation.c index 126b70d625aa..33b644f5d8bb 100644 --- a/server/winstation.c +++ b/server/winstation.c @@ -77,6 +77,7 @@ static const struct object_ops winstation_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -118,6 +119,7 @@ static const struct object_ops desktop_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ + NULL, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ From 44c6d2bc03ba0c7478cce071e70a2565c515904e Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 16:57:08 -0500 Subject: [PATCH 0336/2542] server: Add a request to get the shm index associated with a waitable handle. --- dlls/ntdll/unix/fsync.c | 7 ------- server/fsync.c | 28 ++++++++++++++++++++++++++++ server/object.h | 2 +- server/protocol.def | 16 ++++++++++++++++ 4 files changed, 45 insertions(+), 8 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index e7a495be365b..2f680212fc00 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -95,13 +95,6 @@ int do_fsync(void) #endif } -enum fsync_type -{ - FSYNC_SEMAPHORE = 1, - FSYNC_AUTO_EVENT, - FSYNC_MANUAL_EVENT, -}; - struct fsync { enum fsync_type type; diff --git a/server/fsync.c b/server/fsync.c index 55a8e709dbfb..21f41f54ca1b 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -285,3 +285,31 @@ DECL_HANDLER(create_fsync) if (root) release_object( root ); } + + +/* Retrieve the index of a shm section which will be signaled by the server. */ +DECL_HANDLER(get_fsync_idx) +{ + struct object *obj; + enum fsync_type type; + + if (!(obj = get_handle_obj( current->process, req->handle, SYNCHRONIZE, NULL ))) + return; + + if (obj->ops->get_fsync_idx) + { + reply->shm_idx = obj->ops->get_fsync_idx( obj, &type ); + reply->type = type; + } + else + { + if (debug_level) + { + fprintf( stderr, "%04x: fsync: can't wait on object: ", current->id ); + obj->ops->dump( obj, 0 ); + } + set_error( STATUS_NOT_IMPLEMENTED ); + } + + release_object( obj ); +} diff --git a/server/object.h b/server/object.h index ebe9c6a1ccef..f8fc9a8afdb4 100644 --- a/server/object.h +++ b/server/object.h @@ -81,7 +81,7 @@ struct object_ops /* return the esync fd for this object */ int (*get_esync_fd)(struct object *, enum esync_type *type); /* return the fsync shm idx for this object */ - unsigned int (*get_fsync_idx)(struct object *); + unsigned int (*get_fsync_idx)(struct object *, enum fsync_type *type); /* wait satisfied */ void (*satisfied)(struct object *,struct wait_queue_entry *); /* signal an object */ diff --git a/server/protocol.def b/server/protocol.def index c3013dab7422..76d85433dfc0 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -4132,6 +4132,14 @@ enum esync_type @REQ(get_esync_apc_fd) @END +enum fsync_type +{ + FSYNC_SEMAPHORE = 1, + FSYNC_AUTO_EVENT, + FSYNC_MANUAL_EVENT, + FSYNC_MANUAL_SERVER, +}; + /* Create a new futex-based synchronization object */ @REQ(create_fsync) unsigned int access; /* wanted access rights */ @@ -4142,3 +4150,11 @@ enum esync_type obj_handle_t handle; /* handle to the object */ unsigned int shm_idx; /* this object's index into the shm section */ @END + +/* Retrieve the shm index for an object. */ +@REQ(get_fsync_idx) + obj_handle_t handle; /* handle to the object */ +@REPLY + int type; + unsigned int shm_idx; +@END From 4d0b67d5b6ded804286398667db00a7901575356 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 17:20:36 -0500 Subject: [PATCH 0337/2542] server: Create futex sections for process objects. --- server/fsync.c | 49 +++++++++++++++++++++++++++++------------------- server/fsync.h | 1 + server/process.c | 15 ++++++++++++++- server/process.h | 1 + 4 files changed, 46 insertions(+), 20 deletions(-) diff --git a/server/fsync.c b/server/fsync.c index 21f41f54ca1b..ae4dc7d7318f 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -207,6 +207,35 @@ static void *get_shm( unsigned int idx ) /* FIXME: This is rather inefficient... */ static unsigned int shm_idx_counter = 1; +unsigned int fsync_alloc_shm( int low, int high ) +{ +#ifdef __linux__ + int shm_idx = shm_idx_counter++; + int *shm; + + while (shm_idx * 8 >= shm_size) + { + /* Better expand the shm section. */ + shm_size += pagesize; + if (ftruncate( shm_fd, shm_size ) == -1) + { + fprintf( stderr, "fsync: couldn't expand %s to size %jd: ", + shm_name, shm_size ); + perror( "ftruncate" ); + } + } + + shm = get_shm( shm_idx ); + assert(shm); + shm[0] = low; + shm[1] = high; + + return shm_idx; +#else + return 0; +#endif +} + struct fsync *create_fsync( struct object *root, const struct unicode_str *name, unsigned int attr, int low, int high, const struct security_descriptor *sd ) @@ -218,32 +247,14 @@ struct fsync *create_fsync( struct object *root, const struct unicode_str *name, { if (get_error() != STATUS_OBJECT_NAME_EXISTS) { - int *shm; - /* initialize it if it didn't already exist */ - fsync->shm_idx = shm_idx_counter++; - while (fsync->shm_idx * 8 >= shm_size) - { - /* Better expand the shm section. */ - shm_size += pagesize; - if (ftruncate( shm_fd, shm_size ) == -1) - { - fprintf( stderr, "fsync: couldn't expand %s to size %lld: ", - shm_name, (long long)shm_size ); - perror( "ftruncate" ); - } - } - /* Initialize the shared memory portion. We want to do this on the * server side to avoid a potential though unlikely race whereby * the same object is opened and used between the time it's created * and the time its shared memory portion is initialized. */ - shm = get_shm( fsync->shm_idx ); - assert(shm); - shm[0] = low; - shm[1] = high; + fsync->shm_idx = fsync_alloc_shm( low, high ); } } diff --git a/server/fsync.h b/server/fsync.h index 0b7e46cdaf3e..bbd104f3e16e 100644 --- a/server/fsync.h +++ b/server/fsync.h @@ -20,3 +20,4 @@ extern int do_fsync(void); extern void fsync_init(void); +extern unsigned int fsync_alloc_shm( int low, int high ); diff --git a/server/process.c b/server/process.c index 4a0f31681381..d47ff12449ef 100644 --- a/server/process.c +++ b/server/process.c @@ -64,6 +64,7 @@ #include "user.h" #include "security.h" #include "esync.h" +#include "fsync.h" /* process object */ @@ -97,6 +98,7 @@ static void process_poll_event( struct fd *fd, int event ); static struct list *process_get_kernel_obj_list( struct object *obj ); static void process_destroy( struct object *obj ); static int process_get_esync_fd( struct object *obj, enum esync_type *type ); +static unsigned int process_get_fsync_idx( struct object *obj, enum fsync_type *type ); static void terminate_process( struct process *process, struct thread *skip, int exit_code ); static const struct object_ops process_ops = @@ -108,7 +110,7 @@ static const struct object_ops process_ops = remove_queue, /* remove_queue */ process_signaled, /* signaled */ process_get_esync_fd, /* get_esync_fd */ - NULL, /* get_fsync_idx */ + process_get_fsync_idx, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -694,6 +696,7 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla process->rawinput_kbd = NULL; memset( &process->image_info, 0, sizeof(process->image_info) ); process->esync_fd = -1; + process->fsync_idx = 0; list_init( &process->rawinput_entry ); list_init( &process->kernel_object ); list_init( &process->thread_list ); @@ -745,6 +748,9 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla if (!process->handles || !process->token) goto error; process->session_id = token_get_session_id( process->token ); + if (do_fsync()) + process->fsync_idx = fsync_alloc_shm( 0, 0 ); + if (do_esync()) process->esync_fd = esync_create_fd( 0, 0 ); @@ -821,6 +827,13 @@ static int process_get_esync_fd( struct object *obj, enum esync_type *type ) return process->esync_fd; } +static unsigned int process_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct process *process = (struct process *)obj; + *type = FSYNC_MANUAL_SERVER; + return process->fsync_idx; +} + static unsigned int process_map_access( struct object *obj, unsigned int access ) { access = default_map_access( obj, access ); diff --git a/server/process.h b/server/process.h index ec74ba0490a0..c6de4a3cda33 100644 --- a/server/process.h +++ b/server/process.h @@ -87,6 +87,7 @@ struct process struct list kernel_object; /* list of kernel object pointers */ struct pe_image_info image_info; /* main exe image info */ int esync_fd; /* esync file descriptor (signaled on exit) */ + unsigned int fsync_idx; }; /* process functions */ From 16fa0e6edd979c4741faec6c9840a83e63a6d618 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 17:30:47 -0500 Subject: [PATCH 0338/2542] ntdll, server: Implement waiting on server-bound objects. --- dlls/ntdll/unix/fsync.c | 51 +++++++++++++++++++++++++++++++++++++++-- server/fsync.c | 27 ++++++++++++++++++++++ server/fsync.h | 2 ++ server/thread.c | 4 ++++ 4 files changed, 82 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 2f680212fc00..ec8b3121ed19 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -205,6 +205,49 @@ static struct fsync *get_cached_object( HANDLE handle ) return &fsync_list[entry][idx]; } +/* Gets an object. This is either a proper fsync object (i.e. an event, + * semaphore, etc. created using create_fsync) or a generic synchronizable + * server-side object which the server will signal (e.g. a process, thread, + * message queue, etc.) */ +static NTSTATUS get_object( HANDLE handle, struct fsync **obj ) +{ + NTSTATUS ret = STATUS_SUCCESS; + unsigned int shm_idx = 0; + enum fsync_type type; + + if ((*obj = get_cached_object( handle ))) return STATUS_SUCCESS; + + if ((INT_PTR)handle < 0) + { + /* We can deal with pseudo-handles, but it's just easier this way */ + return STATUS_NOT_IMPLEMENTED; + } + + /* We need to try grabbing it from the server. */ + SERVER_START_REQ( get_fsync_idx ) + { + req->handle = wine_server_obj_handle( handle ); + if (!(ret = wine_server_call( req ))) + { + shm_idx = reply->shm_idx; + type = reply->type; + } + } + SERVER_END_REQ; + + if (ret) + { + WARN("Failed to retrieve shm index for handle %p, status %#x.\n", handle, (unsigned int)ret); + *obj = NULL; + return ret; + } + + TRACE("Got shm index %d for handle %p.\n", shm_idx, handle); + + *obj = add_to_list( handle, type, get_shm( shm_idx ) ); + return ret; +} + NTSTATUS fsync_close( HANDLE handle ) { UINT_PTR entry, idx = handle_to_index( handle, &entry ); @@ -419,10 +462,13 @@ NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, for (i = 0; i < count; i++) { - if ((objs[i] = get_cached_object( handles[i] ))) + ret = get_object( handles[i], &objs[i] ); + if (ret == STATUS_SUCCESS) has_fsync = 1; - else + else if (ret == STATUS_NOT_IMPLEMENTED) has_server = 1; + else + return ret; } if (has_fsync && has_server) @@ -495,6 +541,7 @@ NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, break; } case FSYNC_MANUAL_EVENT: + case FSYNC_MANUAL_SERVER: { struct event *event = obj->shm; diff --git a/server/fsync.c b/server/fsync.c index ae4dc7d7318f..da30d94f1f7c 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -265,6 +266,32 @@ struct fsync *create_fsync( struct object *root, const struct unicode_str *name, #endif } +static inline int futex_wake( int *addr, int val ) +{ + return syscall( __NR_futex, addr, 1, val, NULL, 0, 0 ); +} + +/* shm layout for events or event-like objects. */ +struct fsync_event +{ + int signaled; + int unused; +}; + +void fsync_wake_up( struct object *obj ) +{ + struct fsync_event *event; + enum fsync_type type; + + if (obj->ops->get_fsync_idx) + { + event = get_shm( obj->ops->get_fsync_idx( obj, &type ) ); + + if (!__atomic_exchange_n( &event->signaled, 1, __ATOMIC_SEQ_CST )) + futex_wake( &event->signaled, INT_MAX ); + } +} + DECL_HANDLER(create_fsync) { struct fsync *fsync; diff --git a/server/fsync.h b/server/fsync.h index bbd104f3e16e..2ff98cb64cbd 100644 --- a/server/fsync.h +++ b/server/fsync.h @@ -21,3 +21,5 @@ extern int do_fsync(void); extern void fsync_init(void); extern unsigned int fsync_alloc_shm( int low, int high ); +extern void fsync_wake_up( struct object *obj ); +extern void fsync_clear( struct object *obj ); diff --git a/server/thread.c b/server/thread.c index 943e66baa525..1e51729630f6 100644 --- a/server/thread.c +++ b/server/thread.c @@ -54,6 +54,7 @@ #include "user.h" #include "security.h" #include "esync.h" +#include "fsync.h" /* thread queues */ @@ -1165,6 +1166,9 @@ void wake_up( struct object *obj, int max ) struct list *ptr; int ret; + if (do_fsync()) + fsync_wake_up( obj ); + if (do_esync()) esync_wake_up( obj ); From 9973dcac77d22bfef2d16fce1d548a1b10361987 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 17:37:55 -0500 Subject: [PATCH 0339/2542] server: Create futexes for event objects. --- server/event.c | 21 ++++++++++++++++++++- server/fsync.c | 13 +++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/server/event.c b/server/event.c index 6c9d71e9fd35..6796deabaa77 100644 --- a/server/event.c +++ b/server/event.c @@ -36,6 +36,7 @@ #include "request.h" #include "security.h" #include "esync.h" +#include "fsync.h" static const WCHAR event_name[] = {'E','v','e','n','t'}; @@ -58,12 +59,14 @@ struct event int manual_reset; /* is it a manual reset event? */ int signaled; /* event has been signaled */ int esync_fd; /* esync file descriptor */ + unsigned int fsync_idx; }; static void event_dump( struct object *obj, int verbose ); static int event_signaled( struct object *obj, struct wait_queue_entry *entry ); static void event_satisfied( struct object *obj, struct wait_queue_entry *entry ); static int event_get_esync_fd( struct object *obj, enum esync_type *type ); +static unsigned int event_get_fsync_idx( struct object *obj, enum fsync_type *type ); static int event_signal( struct object *obj, unsigned int access); static struct list *event_get_kernel_obj_list( struct object *obj ); static void event_destroy( struct object *obj ); @@ -77,7 +80,7 @@ static const struct object_ops event_ops = remove_queue, /* remove_queue */ event_signaled, /* signaled */ event_get_esync_fd, /* get_esync_fd */ - NULL, /* get_fsync_idx */ + event_get_fsync_idx, /* get_fsync_idx */ event_satisfied, /* satisfied */ event_signal, /* signal */ no_get_fd, /* get_fd */ @@ -159,6 +162,9 @@ struct event *create_event( struct object *root, const struct unicode_str *name, event->manual_reset = manual_reset; event->signaled = initial_state; + if (do_fsync()) + event->fsync_idx = fsync_alloc_shm( initial_state, 0 ); + if (do_esync()) event->esync_fd = esync_create_fd( initial_state, 0 ); } @@ -181,6 +187,9 @@ static void pulse_event( struct event *event ) /* wake up all waiters if manual reset, a single one otherwise */ wake_up( &event->obj, !event->manual_reset ); event->signaled = 0; + + if (do_fsync()) + fsync_clear( &event->obj ); } void set_event( struct event *event ) @@ -205,6 +214,9 @@ void reset_event( struct event *event ) } event->signaled = 0; + if (do_fsync()) + fsync_clear( &event->obj ); + if (do_esync()) esync_clear( event->esync_fd ); } @@ -231,6 +243,13 @@ static int event_get_esync_fd( struct object *obj, enum esync_type *type ) return event->esync_fd; } +static unsigned int event_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct event *event = (struct event *)obj; + *type = FSYNC_MANUAL_SERVER; + return event->fsync_idx; +} + static void event_satisfied( struct object *obj, struct wait_queue_entry *entry ) { struct event *event = (struct event *)obj; diff --git a/server/fsync.c b/server/fsync.c index da30d94f1f7c..07c0367d02c4 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -292,6 +292,19 @@ void fsync_wake_up( struct object *obj ) } } +void fsync_clear( struct object *obj ) +{ + struct fsync_event *event; + enum fsync_type type; + + if (obj->ops->get_fsync_idx) + { + event = get_shm( obj->ops->get_fsync_idx( obj, &type ) ); + + __atomic_store_n( &event->signaled, 0, __ATOMIC_SEQ_CST ); + } +} + DECL_HANDLER(create_fsync) { struct fsync *fsync; From bdbe81da632733c78c420931785a0eafe578b4fc Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 17:44:18 -0500 Subject: [PATCH 0340/2542] server: Allow (re)setting fsync events on the server side. --- server/event.c | 16 ++++++++++++++++ server/fsync.c | 19 ++++++++++++++++++- server/fsync.h | 6 ++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/server/event.c b/server/event.c index 6796deabaa77..a0a1495145cd 100644 --- a/server/event.c +++ b/server/event.c @@ -175,6 +175,10 @@ struct event *create_event( struct object *root, const struct unicode_str *name, struct event *get_event_obj( struct process *process, obj_handle_t handle, unsigned int access ) { struct object *obj; + + if (do_fsync() && (obj = get_handle_obj( process, handle, access, &fsync_ops))) + return (struct event *)obj; /* even though it's not an event */ + if (do_esync() && (obj = get_handle_obj( process, handle, access, &esync_ops))) return (struct event *)obj; /* even though it's not an event */ @@ -194,6 +198,12 @@ static void pulse_event( struct event *event ) void set_event( struct event *event ) { + if (do_fsync() && event->obj.ops == &fsync_ops) + { + fsync_set_event( (struct fsync *)event ); + return; + } + if (do_esync() && event->obj.ops == &esync_ops) { esync_set_event( (struct esync *)event ); @@ -207,6 +217,12 @@ void set_event( struct event *event ) void reset_event( struct event *event ) { + if (do_fsync() && event->obj.ops == &fsync_ops) + { + fsync_reset_event( (struct fsync *)event ); + return; + } + if (do_esync() && event->obj.ops == &esync_ops) { esync_reset_event( (struct esync *)event ); diff --git a/server/fsync.c b/server/fsync.c index 07c0367d02c4..1d6a49fb5170 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -132,7 +132,7 @@ struct fsync static void fsync_dump( struct object *obj, int verbose ); static void fsync_destroy( struct object *obj ); -static const struct object_ops fsync_ops = +const struct object_ops fsync_ops = { sizeof(struct fsync), /* size */ &no_type, /* type */ @@ -305,6 +305,23 @@ void fsync_clear( struct object *obj ) } } +void fsync_set_event( struct fsync *fsync ) +{ + struct fsync_event *event = get_shm( fsync->shm_idx ); + assert( fsync->obj.ops == &fsync_ops ); + + if (!__atomic_exchange_n( &event->signaled, 1, __ATOMIC_SEQ_CST )) + futex_wake( &event->signaled, INT_MAX ); +} + +void fsync_reset_event( struct fsync *fsync ) +{ + struct fsync_event *event = get_shm( fsync->shm_idx ); + assert( fsync->obj.ops == &fsync_ops ); + + __atomic_store_n( &event->signaled, 0, __ATOMIC_SEQ_CST ); +} + DECL_HANDLER(create_fsync) { struct fsync *fsync; diff --git a/server/fsync.h b/server/fsync.h index 2ff98cb64cbd..087d482717be 100644 --- a/server/fsync.h +++ b/server/fsync.h @@ -23,3 +23,9 @@ extern void fsync_init(void); extern unsigned int fsync_alloc_shm( int low, int high ); extern void fsync_wake_up( struct object *obj ); extern void fsync_clear( struct object *obj ); + +struct fsync; + +extern const struct object_ops fsync_ops; +extern void fsync_set_event( struct fsync *fsync ); +extern void fsync_reset_event( struct fsync *fsync ); From ae05f7a180cb48d8fd858d4d28046ae14b65a7a7 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 17:47:50 -0500 Subject: [PATCH 0341/2542] server: Create futexes for thread objects. --- server/thread.c | 14 +++++++++++++- server/thread.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/server/thread.c b/server/thread.c index 1e51729630f6..87de2a82dd94 100644 --- a/server/thread.c +++ b/server/thread.c @@ -184,6 +184,7 @@ struct type_descr thread_type = static void dump_thread( struct object *obj, int verbose ); static int thread_signaled( struct object *obj, struct wait_queue_entry *entry ); static int thread_get_esync_fd( struct object *obj, enum esync_type *type ); +static unsigned int thread_get_fsync_idx( struct object *obj, enum fsync_type *type ); static unsigned int thread_map_access( struct object *obj, unsigned int access ); static void thread_poll_event( struct fd *fd, int event ); static struct list *thread_get_kernel_obj_list( struct object *obj ); @@ -198,7 +199,7 @@ static const struct object_ops thread_ops = remove_queue, /* remove_queue */ thread_signaled, /* signaled */ thread_get_esync_fd, /* get_esync_fd */ - NULL, /* get_fsync_idx */ + thread_get_fsync_idx, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -284,6 +285,7 @@ static inline void init_thread_structure( struct thread *thread ) thread->entry_point = 0; thread->esync_fd = -1; thread->esync_apc_fd = -1; + thread->fsync_idx = 0; thread->system_regs = 0; thread->queue = NULL; thread->wait = NULL; @@ -431,6 +433,9 @@ struct thread *create_thread( int fd, struct process *process, const struct secu } } + if (do_fsync()) + thread->fsync_idx = fsync_alloc_shm( 0, 0 ); + if (do_esync()) { thread->esync_fd = esync_create_fd( 0, 0 ); @@ -544,6 +549,13 @@ static int thread_get_esync_fd( struct object *obj, enum esync_type *type ) return thread->esync_fd; } +static unsigned int thread_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct thread *thread = (struct thread *)obj; + *type = FSYNC_MANUAL_SERVER; + return thread->fsync_idx; +} + static unsigned int thread_map_access( struct object *obj, unsigned int access ) { access = default_map_access( obj, access ); diff --git a/server/thread.h b/server/thread.h index ffab4bbffae0..903aed9e3ba2 100644 --- a/server/thread.h +++ b/server/thread.h @@ -58,6 +58,7 @@ struct thread struct list mutex_list; /* list of currently owned mutexes */ int esync_fd; /* esync file descriptor (signalled on exit) */ int esync_apc_fd; /* esync apc fd (signalled when APCs are present) */ + unsigned int fsync_idx; unsigned int system_regs; /* which system regs have been set */ struct msg_queue *queue; /* message queue */ struct thread_wait *wait; /* current wait condition if sleeping */ From ae28ead53439ea183fbd3a5f3e863006cc87b3c9 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 17:53:59 -0500 Subject: [PATCH 0342/2542] server: Create futexes for message queues. --- server/protocol.def | 1 + server/queue.c | 34 ++++++++++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/server/protocol.def b/server/protocol.def index 76d85433dfc0..0891a8e368bc 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -4138,6 +4138,7 @@ enum fsync_type FSYNC_AUTO_EVENT, FSYNC_MANUAL_EVENT, FSYNC_MANUAL_SERVER, + FSYNC_QUEUE, }; /* Create a new futex-based synchronization object */ diff --git a/server/queue.c b/server/queue.c index ac4f2e8edc11..24130175e996 100644 --- a/server/queue.c +++ b/server/queue.c @@ -45,6 +45,7 @@ #include "request.h" #include "user.h" #include "esync.h" +#include "fsync.h" #define WM_NCMOUSEFIRST WM_NCMOUSEMOVE #define WM_NCMOUSELAST (WM_NCMOUSEFIRST+(WM_MOUSELAST-WM_MOUSEFIRST)) @@ -136,6 +137,7 @@ struct msg_queue const queue_shm_t *shared; /* queue in session shared memory */ int esync_fd; /* esync file descriptor (signalled on message) */ int esync_in_msgwait; /* our thread is currently waiting on us */ + unsigned int fsync_idx; }; struct hotkey @@ -153,6 +155,7 @@ static int msg_queue_add_queue( struct object *obj, struct wait_queue_entry *ent static void msg_queue_remove_queue( struct object *obj, struct wait_queue_entry *entry ); static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entry ); static int msg_queue_get_esync_fd( struct object *obj, enum esync_type *type ); +static unsigned int msg_queue_get_fsync_idx( struct object *obj, enum fsync_type *type ); static void msg_queue_satisfied( struct object *obj, struct wait_queue_entry *entry ); static void msg_queue_destroy( struct object *obj ); static void msg_queue_poll_event( struct fd *fd, int event ); @@ -169,7 +172,7 @@ static const struct object_ops msg_queue_ops = msg_queue_remove_queue, /* remove_queue */ msg_queue_signaled, /* signaled */ msg_queue_get_esync_fd, /* get_esync_fd */ - NULL, /* get_fsync_idx */ + msg_queue_get_fsync_idx, /* get_fsync_idx */ msg_queue_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -322,12 +325,19 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ queue->keystate_lock = 0; queue->esync_fd = -1; queue->esync_in_msgwait = 0; + queue->fsync_idx = 0; list_init( &queue->send_result ); list_init( &queue->callback_result ); list_init( &queue->pending_timers ); list_init( &queue->expired_timers ); for (i = 0; i < NB_MSG_KINDS; i++) list_init( &queue->msg_list[i] ); + if (do_fsync()) + queue->fsync_idx = fsync_alloc_shm( 0, 0 ); + + if (do_esync()) + queue->esync_fd = esync_create_fd( 0, 0 ); + if (!(queue->shared = alloc_shared_object())) { release_object( queue ); @@ -344,9 +354,6 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ } SHARED_WRITE_END; - if (do_esync()) - queue->esync_fd = esync_create_fd( 0, 0 ); - thread->queue = queue; if ((desktop = get_thread_desktop( thread, 0 ))) @@ -756,6 +763,9 @@ static inline void clear_queue_bits( struct msg_queue *queue, unsigned int bits } SHARED_WRITE_END; + if (do_fsync() && !is_signaled( queue )) + fsync_clear( &queue->obj ); + if (do_esync() && !is_signaled( queue )) esync_clear( queue->esync_fd ); @@ -1309,6 +1319,13 @@ static int msg_queue_get_esync_fd( struct object *obj, enum esync_type *type ) return queue->esync_fd; } +static unsigned int msg_queue_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct msg_queue *queue = (struct msg_queue *)obj; + *type = FSYNC_QUEUE; + return queue->fsync_idx; +} + static void msg_queue_satisfied( struct object *obj, struct wait_queue_entry *entry ) { struct msg_queue *queue = (struct msg_queue *)obj; @@ -3154,6 +3171,9 @@ DECL_HANDLER(set_queue_mask) else wake_up( &queue->obj, 0 ); } + if (do_fsync() && !is_signaled( queue )) + fsync_clear( &queue->obj ); + if (do_esync() && !is_signaled( queue )) esync_clear( queue->esync_fd ); } @@ -3168,6 +3188,9 @@ DECL_HANDLER(get_queue_status) { const queue_shm_t *queue_shm = queue->shared; + if (do_fsync() && !is_signaled( queue )) + fsync_clear( &queue->obj ); + if (do_esync() && !is_signaled( queue )) esync_clear( queue->esync_fd ); @@ -3437,6 +3460,9 @@ DECL_HANDLER(get_message) set_error( STATUS_PENDING ); /* FIXME */ + if (do_fsync() && !is_signaled( queue )) + fsync_clear( &queue->obj ); + if (do_esync() && !is_signaled( queue )) esync_clear( queue->esync_fd ); From 35f7bb9e33ec7fc7ef3ac472e86eb73e925036b3 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 19:24:15 -0500 Subject: [PATCH 0343/2542] server, ntdll: Implement message waits. The approach of giving the queue fd to ntdll to wait on doesn't work here. Fortunately, the way esync has ended up lends itself very easily to a rather clean approach: let the server do it the normal way. --- dlls/ntdll/unix/fsync.c | 52 ++++++++++++++++++++++++++++++++++++++++- server/protocol.def | 4 ++++ server/queue.c | 19 +++++++++++++++ 3 files changed, 74 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index ec8b3121ed19..edad675fa7ac 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -437,12 +437,13 @@ static LONGLONG update_timeout( ULONGLONG end ) return timeleft; } -NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, +static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ) { struct futex_wait_block futexes[MAXIMUM_WAIT_OBJECTS]; struct fsync *objs[MAXIMUM_WAIT_OBJECTS]; int has_fsync = 0, has_server = 0; + BOOL msgwait = FALSE; int dummy_futex = 0; LONGLONG timeleft; LARGE_INTEGER now; @@ -471,6 +472,9 @@ NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, return ret; } + if (objs[count - 1] && objs[count - 1]->type == FSYNC_QUEUE) + msgwait = TRUE; + if (has_fsync && has_server) FIXME("Can't wait on fsync and server objects at the same time!\n"); else if (has_server) @@ -482,6 +486,9 @@ NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, for (i = 0; i < count; i++) TRACE(" %p", handles[i]); + if (msgwait) + TRACE(" or driver events"); + if (!timeout) TRACE(", timeout = INFINITE.\n"); else @@ -542,6 +549,7 @@ NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, } case FSYNC_MANUAL_EVENT: case FSYNC_MANUAL_SERVER: + case FSYNC_QUEUE: { struct event *event = obj->shm; @@ -602,3 +610,45 @@ NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, return STATUS_NOT_IMPLEMENTED; } } + +/* Like esync, we need to let the server know when we are doing a message wait, + * and when we are done with one, so that all of the code surrounding hung + * queues works, and we also need this for WaitForInputIdle(). + * + * Unlike esync, we can't wait on the queue fd itself locally. Instead we let + * the server do that for us, the way it normally does. This could actually + * work for esync too, and that might be better. */ +static void server_set_msgwait( int in_msgwait ) +{ + SERVER_START_REQ( fsync_msgwait ) + { + req->in_msgwait = in_msgwait; + wine_server_call( req ); + } + SERVER_END_REQ; +} + +/* This is a very thin wrapper around the proper implementation above. The + * purpose is to make sure the server knows when we are doing a message wait. + * This is separated into a wrapper function since there are at least a dozen + * exit paths from fsync_wait_objects(). */ +NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, + BOOLEAN alertable, const LARGE_INTEGER *timeout ) +{ + BOOL msgwait = FALSE; + struct fsync *obj; + NTSTATUS ret; + + if (!get_object( handles[count - 1], &obj ) && obj->type == FSYNC_QUEUE) + { + msgwait = TRUE; + server_set_msgwait( 1 ); + } + + ret = __fsync_wait_objects( count, handles, wait_any, alertable, timeout ); + + if (msgwait) + server_set_msgwait( 0 ); + + return ret; +} diff --git a/server/protocol.def b/server/protocol.def index 0891a8e368bc..c5140ef28ede 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -4159,3 +4159,7 @@ enum fsync_type int type; unsigned int shm_idx; @END + +@REQ(fsync_msgwait) + int in_msgwait; /* are we in a message wait? */ +@END diff --git a/server/queue.c b/server/queue.c index 24130175e996..c62a40a7c70e 100644 --- a/server/queue.c +++ b/server/queue.c @@ -138,6 +138,7 @@ struct msg_queue int esync_fd; /* esync file descriptor (signalled on message) */ int esync_in_msgwait; /* our thread is currently waiting on us */ unsigned int fsync_idx; + int fsync_in_msgwait; /* our thread is currently waiting on us */ }; struct hotkey @@ -326,6 +327,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ queue->esync_fd = -1; queue->esync_in_msgwait = 0; queue->fsync_idx = 0; + queue->fsync_in_msgwait = 0; list_init( &queue->send_result ); list_init( &queue->callback_result ); list_init( &queue->pending_timers ); @@ -1255,6 +1257,9 @@ static int is_queue_hung( struct msg_queue *queue ) return 0; /* thread is waiting on queue -> not hung */ } + if (do_fsync() && queue->fsync_in_msgwait) + return 0; /* thread is waiting on queue in absentia -> not hung */ + if (do_esync() && queue->esync_in_msgwait) return 0; /* thread is waiting on queue in absentia -> not hung */ @@ -4283,3 +4288,17 @@ DECL_HANDLER(esync_msgwait) if (queue->fd) set_fd_events( queue->fd, req->in_msgwait ? POLLIN : 0 ); } + +DECL_HANDLER(fsync_msgwait) +{ + struct msg_queue *queue = get_current_queue(); + + if (!queue) return; + queue->fsync_in_msgwait = req->in_msgwait; + + check_thread_queue_idle( current ); + + /* and start/stop waiting on the driver */ + if (queue->fd) + set_fd_events( queue->fd, req->in_msgwait ? POLLIN : 0 ); +} From ace59622309a466b524d066d4f215f4a380fc220 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 19:29:56 -0500 Subject: [PATCH 0344/2542] server: Create futexes for device manager objects. --- server/device.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/server/device.c b/server/device.c index 233346da0160..40795d480b51 100644 --- a/server/device.c +++ b/server/device.c @@ -39,6 +39,7 @@ #include "request.h" #include "process.h" #include "esync.h" +#include "fsync.h" /* IRP object */ @@ -96,11 +97,13 @@ struct device_manager struct irp_call *current_call; /* call currently executed on client side */ struct wine_rb_tree kernel_objects; /* map of objects that have client side pointer associated */ int esync_fd; /* esync file descriptor */ + unsigned int fsync_idx; }; static void device_manager_dump( struct object *obj, int verbose ); static int device_manager_signaled( struct object *obj, struct wait_queue_entry *entry ); static int device_manager_get_esync_fd( struct object *obj, enum esync_type *type ); +static unsigned int device_manager_get_fsync_idx( struct object *obj, enum fsync_type *type ); static void device_manager_destroy( struct object *obj ); static const struct object_ops device_manager_ops = @@ -112,7 +115,7 @@ static const struct object_ops device_manager_ops = remove_queue, /* remove_queue */ device_manager_signaled, /* signaled */ device_manager_get_esync_fd, /* get_esync_fd */ - NULL, /* get_fsync_idx */ + device_manager_get_fsync_idx, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -759,6 +762,9 @@ static void delete_file( struct device_file *file ) /* terminate all pending requests */ LIST_FOR_EACH_ENTRY_SAFE( irp, next, &file->requests, struct irp_call, dev_entry ) { + if (do_fsync() && file->device->manager && list_empty( &file->device->manager->requests )) + fsync_clear( &file->device->manager->obj ); + if (do_esync() && file->device->manager && list_empty( &file->device->manager->requests )) esync_clear( file->device->manager->esync_fd ); @@ -804,6 +810,13 @@ static int device_manager_get_esync_fd( struct object *obj, enum esync_type *typ return manager->esync_fd; } +static unsigned int device_manager_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct device_manager *manager = (struct device_manager *)obj; + *type = FSYNC_MANUAL_SERVER; + return manager->fsync_idx; +} + static void device_manager_destroy( struct object *obj ) { struct device_manager *manager = (struct device_manager *)obj; @@ -854,6 +867,9 @@ static struct device_manager *create_device_manager(void) list_init( &manager->requests ); wine_rb_init( &manager->kernel_objects, compare_kernel_object ); + if (do_fsync()) + manager->fsync_idx = fsync_alloc_shm( 0, 0 ); + if (do_esync()) manager->esync_fd = esync_create_fd( 0, 0 ); } @@ -1046,6 +1062,9 @@ DECL_HANDLER(get_next_device_request) if (irp->file) grab_object( irp ); manager->current_call = irp; + if (do_fsync() && list_empty( &manager->requests )) + fsync_clear( &manager->obj ); + if (do_esync() && list_empty( &manager->requests )) esync_clear( manager->esync_fd ); } From 28f2e7f2187f30785b23fc41bd74b855135be611 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 19:36:23 -0500 Subject: [PATCH 0345/2542] ntdll: Implement NtCreateMutant(). --- dlls/ntdll/unix/fsync.c | 17 +++++++++++++++++ dlls/ntdll/unix/fsync.h | 2 ++ dlls/ntdll/unix/sync.c | 3 +++ server/protocol.def | 1 + 4 files changed, 23 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index edad675fa7ac..9d4d61ad389e 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -115,6 +115,13 @@ struct event }; C_ASSERT(sizeof(struct event) == 8); +struct mutex +{ + int tid; + int count; /* recursion count */ +}; +C_ASSERT(sizeof(struct mutex) == 8); + static char shm_name[29]; static int shm_fd; static void **shm_addrs; @@ -426,6 +433,16 @@ NTSTATUS fsync_reset_event( HANDLE handle, LONG *prev ) return STATUS_SUCCESS; } +NTSTATUS fsync_create_mutex( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, BOOLEAN initial ) +{ + TRACE("name %s, initial %d.\n", + attr ? debugstr_us(attr->ObjectName) : "", initial); + + return create_fsync( FSYNC_MUTEX, handle, access, attr, + initial ? GetCurrentThreadId() : 0, initial ? 1 : 0 ); +} + static LONGLONG update_timeout( ULONGLONG end ) { LARGE_INTEGER now; diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h index 56afeb1f9e8b..e7cc1e87b4e3 100644 --- a/dlls/ntdll/unix/fsync.h +++ b/dlls/ntdll/unix/fsync.h @@ -29,6 +29,8 @@ extern NTSTATUS fsync_create_event( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial ); extern NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ); extern NTSTATUS fsync_reset_event( HANDLE handle, LONG *prev ); +extern NTSTATUS fsync_create_mutex( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr, BOOLEAN initial ); extern NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 160d8517017e..c67955bf3d83 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -631,6 +631,9 @@ NTSTATUS WINAPI NtCreateMutant( HANDLE *handle, ACCESS_MASK access, const OBJECT *handle = 0; + if (do_fsync()) + return fsync_create_mutex( handle, access, attr, owned ); + if (do_esync()) return esync_create_mutex( handle, access, attr, owned ); diff --git a/server/protocol.def b/server/protocol.def index c5140ef28ede..84b1d0d87d68 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -4137,6 +4137,7 @@ enum fsync_type FSYNC_SEMAPHORE = 1, FSYNC_AUTO_EVENT, FSYNC_MANUAL_EVENT, + FSYNC_MUTEX, FSYNC_MANUAL_SERVER, FSYNC_QUEUE, }; From 614d987ce32418ceb2801c62761f55bb7c6bf990 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 19:42:17 -0500 Subject: [PATCH 0346/2542] ntdll: Implement NtReleaseMutant(). --- dlls/ntdll/unix/fsync.c | 23 +++++++++++++++++++++++ dlls/ntdll/unix/fsync.h | 1 + dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 27 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 9d4d61ad389e..22b67e5d4a4a 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -443,6 +443,29 @@ NTSTATUS fsync_create_mutex( HANDLE *handle, ACCESS_MASK access, initial ? GetCurrentThreadId() : 0, initial ? 1 : 0 ); } +NTSTATUS fsync_release_mutex( HANDLE handle, LONG *prev ) +{ + struct mutex *mutex; + struct fsync *obj; + + TRACE("%p, %p.\n", handle, prev); + + if (!(obj = get_cached_object( handle ))) return STATUS_INVALID_HANDLE; + mutex = obj->shm; + + if (mutex->tid != GetCurrentThreadId()) return STATUS_MUTANT_NOT_OWNED; + + if (prev) *prev = mutex->count; + + if (!--mutex->count) + { + __atomic_store_n( &mutex->tid, 0, __ATOMIC_SEQ_CST ); + futex_wake( &mutex->tid, 1 ); + } + + return STATUS_SUCCESS; +} + static LONGLONG update_timeout( ULONGLONG end ) { LARGE_INTEGER now; diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h index e7cc1e87b4e3..1867ba881120 100644 --- a/dlls/ntdll/unix/fsync.h +++ b/dlls/ntdll/unix/fsync.h @@ -31,6 +31,7 @@ extern NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ); extern NTSTATUS fsync_reset_event( HANDLE handle, LONG *prev ); extern NTSTATUS fsync_create_mutex( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, BOOLEAN initial ); +extern NTSTATUS fsync_release_mutex( HANDLE handle, LONG *prev ); extern NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index c67955bf3d83..480ae1ea76e6 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -689,6 +689,9 @@ NTSTATUS WINAPI NtReleaseMutant( HANDLE handle, LONG *prev_count ) { unsigned int ret; + if (do_fsync()) + return fsync_release_mutex( handle, prev_count ); + if (do_esync()) return esync_release_mutex( handle, prev_count ); From 1bdffe64b7e5bfbfc5e8394032b4d8238eebd440 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 19:46:17 -0500 Subject: [PATCH 0347/2542] ntdll: Implement waiting on mutexes. --- dlls/ntdll/unix/fsync.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 22b67e5d4a4a..f4d3c8953cfd 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -573,6 +573,28 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, futexes[i].val = current; break; } + case FSYNC_MUTEX: + { + struct mutex *mutex = obj->shm; + + if (mutex->tid == GetCurrentThreadId()) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + mutex->count++; + return i; + } + + if (!__sync_val_compare_and_swap( &mutex->tid, 0, GetCurrentThreadId() )) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + mutex->count = 1; + return i; + } + + futexes[i].addr = &mutex->tid; + futexes[i].val = mutex->tid; + break; + } case FSYNC_AUTO_EVENT: { struct event *event = obj->shm; From c1793c691e18f4a02dda0aacf2e1dbaaa35a4e71 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 1 Sep 2018 20:35:44 -0500 Subject: [PATCH 0348/2542] ntdll: Implement wait-all. --- dlls/ntdll/unix/fsync.c | 204 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 201 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index f4d3c8953cfd..0c382de40aea 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -74,6 +74,11 @@ static inline int futex_wake( int *addr, int val ) return syscall( __NR_futex, addr, 1, val, NULL, 0, 0 ); } +static inline int futex_wait( int *addr, int val, struct timespec *timeout ) +{ + return syscall( __NR_futex, addr, 0, val, timeout, 0, 0 ); +} + int do_fsync(void) { #ifdef __linux__ @@ -477,6 +482,29 @@ static LONGLONG update_timeout( ULONGLONG end ) return timeleft; } +static NTSTATUS do_single_wait( int *addr, int val, ULONGLONG *end ) +{ + int ret; + + if (end) + { + LONGLONG timeleft = update_timeout( *end ); + struct timespec tmo_p; + tmo_p.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; + tmo_p.tv_nsec = (timeleft % TICKSPERSEC) * 100; + ret = futex_wait( addr, val, &tmo_p ); + } + else + ret = futex_wait( addr, val, NULL ); + + if (!ret) + return 0; + else if (ret < 0 && errno == ETIMEDOUT) + return STATUS_TIMEOUT; + else + return STATUS_PENDING; +} + static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ) { @@ -668,9 +696,179 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, } else { - FIXME("Wait-all not implemented.\n"); - return STATUS_NOT_IMPLEMENTED; - } + /* Wait-all is a little trickier to implement correctly. Fortunately, + * it's not as common. + * + * The idea is basically just to wait in sequence on every object in the + * set. Then when we're done, try to grab them all in a tight loop. If + * that fails, release any resources we've grabbed (and yes, we can + * reliably do this—it's just mutexes and semaphores that we have to + * put back, and in both cases we just put back 1), and if any of that + * fails we start over. + * + * What makes this inherently bad is that we might temporarily grab a + * resource incorrectly. Hopefully it'll be quick (and hey, it won't + * block on wineserver) so nobody will notice. Besides, consider: if + * object A becomes signaled but someone grabs it before we can grab it + * and everything else, then they could just as well have grabbed it + * before it became signaled. Similarly if object A was signaled and we + * were blocking on object B, then B becomes available and someone grabs + * A before we can, then they might have grabbed A before B became + * signaled. In either case anyone who tries to wait on A or B will be + * waiting for an instant while we put things back. */ + + NTSTATUS status = STATUS_SUCCESS; + int current; + + while (1) + { +tryagain: + /* First step: try to wait on each object in sequence. */ + + for (i = 0; i < count; i++) + { + struct fsync *obj = objs[i]; + + if (obj && obj->type == FSYNC_MUTEX) + { + struct mutex *mutex = obj->shm; + + if (mutex->tid == GetCurrentThreadId()) + continue; + + while ((current = __atomic_load_n( &mutex->tid, __ATOMIC_SEQ_CST ))) + { + status = do_single_wait( &mutex->tid, current, timeout ? &end : NULL ); + if (status != STATUS_PENDING) + break; + } + } + else if (obj) + { + /* this works for semaphores too */ + struct event *event = obj->shm; + + while (!__atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )) + { + status = do_single_wait( &event->signaled, 0, timeout ? &end : NULL ); + if (status != STATUS_PENDING) + break; + } + } + + if (status == STATUS_TIMEOUT) + { + TRACE("Wait timed out.\n"); + return status; + } + } + + /* If we got here and we haven't timed out, that means all of the + * handles were signaled. Check to make sure they still are. */ + for (i = 0; i < count; i++) + { + struct fsync *obj = objs[i]; + + if (obj && obj->type == FSYNC_MUTEX) + { + struct mutex *mutex = obj->shm; + + if (mutex->tid == GetCurrentThreadId()) + continue; /* ok */ + + if (__atomic_load_n( &mutex->tid, __ATOMIC_SEQ_CST )) + goto tryagain; + } + else if (obj) + { + struct event *event = obj->shm; + + if (!__atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )) + goto tryagain; + } + } + + /* Yep, still signaled. Now quick, grab everything. */ + for (i = 0; i < count; i++) + { + struct fsync *obj = objs[i]; + switch (obj->type) + { + case FSYNC_MUTEX: + { + struct mutex *mutex = obj->shm; + if (mutex->tid == GetCurrentThreadId()) + break; + if (__sync_val_compare_and_swap( &mutex->tid, 0, GetCurrentThreadId() )) + goto tooslow; + break; + } + case FSYNC_SEMAPHORE: + { + struct semaphore *semaphore = obj->shm; + if (__sync_fetch_and_sub( &semaphore->count, 1 ) <= 0) + goto tooslow; + break; + } + case FSYNC_AUTO_EVENT: + { + struct event *event = obj->shm; + if (!__sync_val_compare_and_swap( &event->signaled, 1, 0 )) + goto tooslow; + break; + } + default: + /* If a manual-reset event changed between there and + * here, it's shouldn't be a problem. */ + break; + } + } + + /* If we got here, we successfully waited on every object. + * Make sure to let ourselves know that we grabbed the mutexes. */ + for (i = 0; i < count; i++) + { + if (objs[i] && objs[i]->type == FSYNC_MUTEX) + { + struct mutex *mutex = objs[i]->shm; + mutex->count++; + } + } + + TRACE("Wait successful.\n"); + return STATUS_SUCCESS; + +tooslow: + for (--i; i >= 0; i--) + { + struct fsync *obj = objs[i]; + switch (obj->type) + { + case FSYNC_MUTEX: + { + struct mutex *mutex = obj->shm; + __atomic_store_n( &mutex->tid, 0, __ATOMIC_SEQ_CST ); + break; + } + case FSYNC_SEMAPHORE: + { + struct semaphore *semaphore = obj->shm; + __sync_fetch_and_add( &semaphore->count, 1 ); + break; + } + case FSYNC_AUTO_EVENT: + { + struct event *event = obj->shm; + __atomic_store_n( &event->signaled, 1, __ATOMIC_SEQ_CST ); + break; + } + default: + /* doesn't need to be put back */ + break; + } + } + } /* while (1) */ + } /* else (wait-all) */ } /* Like esync, we need to let the server know when we are doing a message wait, From b8dc36f24e61adba381ad8b9e8c1e9e4081fcae4 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 2 Sep 2018 11:41:07 -0500 Subject: [PATCH 0349/2542] ntdll: Implement NtSignalAndWaitForSingleObject(). --- dlls/ntdll/unix/fsync.c | 28 ++++++++++++++++++++++++++++ dlls/ntdll/unix/fsync.h | 2 ++ dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 33 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 0c382de40aea..b5116e079209 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -912,3 +912,31 @@ NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an return ret; } + +NTSTATUS fsync_signal_and_wait( HANDLE signal, HANDLE wait, BOOLEAN alertable, + const LARGE_INTEGER *timeout ) +{ + struct fsync *obj = get_cached_object( signal ); + NTSTATUS ret; + + if (!obj) return STATUS_INVALID_HANDLE; + + switch (obj->type) + { + case FSYNC_SEMAPHORE: + ret = fsync_release_semaphore( signal, 1, NULL ); + break; + case FSYNC_AUTO_EVENT: + case FSYNC_MANUAL_EVENT: + ret = fsync_set_event( signal, NULL ); + break; + case FSYNC_MUTEX: + ret = fsync_release_mutex( signal, NULL ); + break; + default: + return STATUS_OBJECT_TYPE_MISMATCH; + } + if (ret) return ret; + + return fsync_wait_objects( 1, &wait, TRUE, alertable, timeout ); +} diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h index 1867ba881120..c39c3a14e594 100644 --- a/dlls/ntdll/unix/fsync.h +++ b/dlls/ntdll/unix/fsync.h @@ -35,3 +35,5 @@ extern NTSTATUS fsync_release_mutex( HANDLE handle, LONG *prev ); extern NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ); +extern NTSTATUS fsync_signal_and_wait( HANDLE signal, HANDLE wait, + BOOLEAN alertable, const LARGE_INTEGER *timeout ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 480ae1ea76e6..0c75edc1e98e 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -1687,6 +1687,9 @@ NTSTATUS WINAPI NtSignalAndWaitForSingleObject( HANDLE signal, HANDLE wait, union select_op select_op; UINT flags = SELECT_INTERRUPTIBLE; + if (do_fsync()) + return fsync_signal_and_wait( signal, wait, alertable, timeout ); + if (do_esync()) return esync_signal_and_wait( signal, wait, alertable, timeout ); From 3d16eda520086ea09627e3a6ece9d1b6c494a482 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 2 Sep 2018 11:48:26 -0500 Subject: [PATCH 0350/2542] server, ntdll: Also store the fsync type in the server. --- dlls/ntdll/unix/fsync.c | 2 ++ server/fsync.c | 26 +++++++++++++++++++++++--- server/protocol.def | 2 ++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index b5116e079209..e65abc525ede 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -290,12 +290,14 @@ static NTSTATUS create_fsync( enum fsync_type type, HANDLE *handle, req->access = access; req->low = low; req->high = high; + req->type = type; wine_server_add_data( req, objattr, len ); ret = wine_server_call( req ); if (!ret || ret == STATUS_OBJECT_NAME_EXISTS) { *handle = wine_server_ptr_handle( reply->handle ); shm_idx = reply->shm_idx; + type = reply->type; } } SERVER_END_REQ; diff --git a/server/fsync.c b/server/fsync.c index 1d6a49fb5170..d32d5f9c6899 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -127,6 +127,7 @@ struct fsync { struct object obj; unsigned int shm_idx; + enum fsync_type type; }; static void fsync_dump( struct object *obj, int verbose ); @@ -237,9 +238,16 @@ unsigned int fsync_alloc_shm( int low, int high ) #endif } +static int type_matches( enum fsync_type type1, enum fsync_type type2 ) +{ + return (type1 == type2) || + ((type1 == FSYNC_AUTO_EVENT || type1 == FSYNC_MANUAL_EVENT) && + (type2 == FSYNC_AUTO_EVENT || type2 == FSYNC_MANUAL_EVENT)); +} + struct fsync *create_fsync( struct object *root, const struct unicode_str *name, - unsigned int attr, int low, int high, - const struct security_descriptor *sd ) + unsigned int attr, int low, int high, enum fsync_type type, + const struct security_descriptor *sd ) { #ifdef __linux__ struct fsync *fsync; @@ -256,6 +264,17 @@ struct fsync *create_fsync( struct object *root, const struct unicode_str *name, * and the time its shared memory portion is initialized. */ fsync->shm_idx = fsync_alloc_shm( low, high ); + fsync->type = type; + } + else + { + /* validate the type */ + if (!type_matches( type, fsync->type )) + { + release_object( &fsync->obj ); + set_error( STATUS_OBJECT_TYPE_MISMATCH ); + return NULL; + } } } @@ -339,7 +358,7 @@ DECL_HANDLER(create_fsync) if (!objattr) return; if ((fsync = create_fsync( root, &name, objattr->attributes, req->low, - req->high, sd ))) + req->high, req->type, sd ))) { if (get_error() == STATUS_OBJECT_NAME_EXISTS) reply->handle = alloc_handle( current->process, fsync, req->access, objattr->attributes ); @@ -348,6 +367,7 @@ DECL_HANDLER(create_fsync) req->access, objattr->attributes ); reply->shm_idx = fsync->shm_idx; + reply->type = fsync->type; release_object( fsync ); } diff --git a/server/protocol.def b/server/protocol.def index 84b1d0d87d68..6c4c6cb7a30e 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -4147,9 +4147,11 @@ enum fsync_type unsigned int access; /* wanted access rights */ int low; /* initial value of low word */ int high; /* initial value of high word */ + int type; /* type of fsync object */ VARARG(objattr,object_attributes); /* object attributes */ @REPLY obj_handle_t handle; /* handle to the object */ + int type; /* type of fsync object */ unsigned int shm_idx; /* this object's index into the shm section */ @END From d1f61ce3dee3dfd3cd265d4f02a308e8e05f1ba1 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 2 Sep 2018 12:02:39 -0500 Subject: [PATCH 0351/2542] ntdll, server: Implement NtOpenSemaphore(). --- dlls/ntdll/unix/fsync.c | 40 ++++++++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/fsync.h | 2 ++ dlls/ntdll/unix/sync.c | 3 +++ server/fsync.c | 27 +++++++++++++++++++++++++++ server/protocol.def | 13 +++++++++++++ 5 files changed, 85 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index e65abc525ede..81bd29634b12 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -312,6 +312,38 @@ static NTSTATUS create_fsync( enum fsync_type type, HANDLE *handle, return ret; } +static NTSTATUS open_fsync( enum fsync_type type, HANDLE *handle, + ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) +{ + NTSTATUS ret; + unsigned int shm_idx; + + SERVER_START_REQ( open_fsync ) + { + req->access = access; + req->attributes = attr->Attributes; + req->rootdir = wine_server_obj_handle( attr->RootDirectory ); + req->type = type; + if (attr->ObjectName) + wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length ); + if (!(ret = wine_server_call( req ))) + { + *handle = wine_server_ptr_handle( reply->handle ); + type = reply->type; + shm_idx = reply->shm_idx; + } + } + SERVER_END_REQ; + + if (!ret) + { + add_to_list( *handle, type, get_shm( shm_idx ) ); + + TRACE("-> handle %p, shm index %u.\n", *handle, shm_idx); + } + return ret; +} + void fsync_init(void) { struct stat st; @@ -365,6 +397,14 @@ NTSTATUS fsync_create_semaphore( HANDLE *handle, ACCESS_MASK access, return create_fsync( FSYNC_SEMAPHORE, handle, access, attr, initial, max ); } +NTSTATUS fsync_open_semaphore( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ) +{ + TRACE("name %s.\n", debugstr_us(attr->ObjectName)); + + return open_fsync( FSYNC_SEMAPHORE, handle, access, attr ); +} + NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) { struct fsync *obj; diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h index c39c3a14e594..b70851499fe3 100644 --- a/dlls/ntdll/unix/fsync.h +++ b/dlls/ntdll/unix/fsync.h @@ -25,6 +25,8 @@ extern NTSTATUS fsync_close( HANDLE handle ); extern NTSTATUS fsync_create_semaphore(HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max); extern NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ); +extern NTSTATUS fsync_open_semaphore( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ); extern NTSTATUS fsync_create_event( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial ); extern NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 0c75edc1e98e..643e1958b551 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -348,6 +348,9 @@ NTSTATUS WINAPI NtOpenSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJEC *handle = 0; + if (do_fsync()) + return fsync_open_semaphore( handle, access, attr ); + if (do_esync()) return esync_open_semaphore( handle, access, attr ); diff --git a/server/fsync.c b/server/fsync.c index d32d5f9c6899..3fbc17347359 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -374,6 +374,33 @@ DECL_HANDLER(create_fsync) if (root) release_object( root ); } +DECL_HANDLER(open_fsync) +{ + struct unicode_str name = get_req_unicode_str(); + + reply->handle = open_object( current->process, req->rootdir, req->access, + &fsync_ops, &name, req->attributes ); + + if (reply->handle) + { + struct fsync *fsync; + + if (!(fsync = (struct fsync *)get_handle_obj( current->process, reply->handle, + 0, &fsync_ops ))) + return; + + if (!type_matches( req->type, fsync->type )) + { + set_error( STATUS_OBJECT_TYPE_MISMATCH ); + release_object( fsync ); + return; + } + + reply->type = fsync->type; + reply->shm_idx = fsync->shm_idx; + release_object( fsync ); + } +} /* Retrieve the index of a shm section which will be signaled by the server. */ DECL_HANDLER(get_fsync_idx) diff --git a/server/protocol.def b/server/protocol.def index 6c4c6cb7a30e..781dbdd3d011 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -4155,6 +4155,19 @@ enum fsync_type unsigned int shm_idx; /* this object's index into the shm section */ @END +/* Open an fsync object */ +@REQ(open_fsync) + unsigned int access; /* wanted access rights */ + unsigned int attributes; /* object attributes */ + obj_handle_t rootdir; /* root directory */ + int type; /* type of fsync object */ + VARARG(name,unicode_str); /* object name */ +@REPLY + obj_handle_t handle; /* handle to the event */ + int type; /* type of fsync object */ + unsigned int shm_idx; /* this object's index into the shm section */ +@END + /* Retrieve the shm index for an object. */ @REQ(get_fsync_idx) obj_handle_t handle; /* handle to the object */ From d690852fcf211c0be0ee62f22428e21537db9e6f Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 2 Sep 2018 12:05:37 -0500 Subject: [PATCH 0352/2542] ntdll: Implement NtOpenEvent(). --- dlls/ntdll/unix/fsync.c | 8 ++++++++ dlls/ntdll/unix/fsync.h | 2 ++ dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 13 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 81bd29634b12..dfb54c667a89 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -443,6 +443,14 @@ NTSTATUS fsync_create_event( HANDLE *handle, ACCESS_MASK access, return create_fsync( type, handle, access, attr, initial, 0xdeadbeef ); } +NTSTATUS fsync_open_event( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ) +{ + TRACE("name %s.\n", debugstr_us(attr->ObjectName)); + + return open_fsync( FSYNC_AUTO_EVENT, handle, access, attr ); +} + NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ) { struct event *event; diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h index b70851499fe3..9a777ef3521c 100644 --- a/dlls/ntdll/unix/fsync.h +++ b/dlls/ntdll/unix/fsync.h @@ -29,6 +29,8 @@ extern NTSTATUS fsync_open_semaphore( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ); extern NTSTATUS fsync_create_event( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial ); +extern NTSTATUS fsync_open_event( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ); extern NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ); extern NTSTATUS fsync_reset_event( HANDLE handle, LONG *prev ); extern NTSTATUS fsync_create_mutex( HANDLE *handle, ACCESS_MASK access, diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 643e1958b551..2cf3bf4fabb9 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -482,6 +482,9 @@ NTSTATUS WINAPI NtOpenEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_AT *handle = 0; if ((ret = validate_open_object_attributes( attr ))) return ret; + if (do_fsync()) + return fsync_open_event( handle, access, attr ); + if (do_esync()) return esync_open_event( handle, access, attr ); From 4846174c6b6e6427413e12c7714477925ddf2f6e Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 2 Sep 2018 12:06:40 -0500 Subject: [PATCH 0353/2542] ntdll: Implement NtOpenMutant(). --- dlls/ntdll/unix/fsync.c | 8 ++++++++ dlls/ntdll/unix/fsync.h | 2 ++ dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 13 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index dfb54c667a89..383df952e4b9 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -498,6 +498,14 @@ NTSTATUS fsync_create_mutex( HANDLE *handle, ACCESS_MASK access, initial ? GetCurrentThreadId() : 0, initial ? 1 : 0 ); } +NTSTATUS fsync_open_mutex( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ) +{ + TRACE("name %s.\n", debugstr_us(attr->ObjectName)); + + return open_fsync( FSYNC_MUTEX, handle, access, attr ); +} + NTSTATUS fsync_release_mutex( HANDLE handle, LONG *prev ) { struct mutex *mutex; diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h index 9a777ef3521c..0fc2305bd5c7 100644 --- a/dlls/ntdll/unix/fsync.h +++ b/dlls/ntdll/unix/fsync.h @@ -35,6 +35,8 @@ extern NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ); extern NTSTATUS fsync_reset_event( HANDLE handle, LONG *prev ); extern NTSTATUS fsync_create_mutex( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, BOOLEAN initial ); +extern NTSTATUS fsync_open_mutex( HANDLE *handle, ACCESS_MASK access, + const OBJECT_ATTRIBUTES *attr ); extern NTSTATUS fsync_release_mutex( HANDLE handle, LONG *prev ); extern NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 2cf3bf4fabb9..7af61d90e892 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -670,6 +670,9 @@ NTSTATUS WINAPI NtOpenMutant( HANDLE *handle, ACCESS_MASK access, const OBJECT_A *handle = 0; if ((ret = validate_open_object_attributes( attr ))) return ret; + if (do_fsync()) + return fsync_open_mutex( handle, access, attr ); + if (do_esync()) return esync_open_mutex( handle, access, attr ); From ac335fd778848646fef4fbf7319b4939f39f3b94 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 2 Sep 2018 12:07:48 -0500 Subject: [PATCH 0354/2542] server: Implement fsync_map_access(). --- server/fsync.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/server/fsync.c b/server/fsync.c index 3fbc17347359..1df3aff91b67 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -131,6 +131,7 @@ struct fsync }; static void fsync_dump( struct object *obj, int verbose ); +static unsigned int fsync_map_access( struct object *obj, unsigned int access ); static void fsync_destroy( struct object *obj ); const struct object_ops fsync_ops = @@ -146,7 +147,7 @@ const struct object_ops fsync_ops = NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ - default_map_access, /* map_access */ + fsync_map_access, /* map_access */ default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ default_get_full_name, /* get_full_name */ @@ -166,6 +167,16 @@ static void fsync_dump( struct object *obj, int verbose ) fprintf( stderr, "fsync idx=%d\n", fsync->shm_idx ); } +static unsigned int fsync_map_access( struct object *obj, unsigned int access ) +{ + /* Sync objects have the same flags. */ + if (access & GENERIC_READ) access |= STANDARD_RIGHTS_READ | EVENT_QUERY_STATE; + if (access & GENERIC_WRITE) access |= STANDARD_RIGHTS_WRITE | EVENT_MODIFY_STATE; + if (access & GENERIC_EXECUTE) access |= STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE; + if (access & GENERIC_ALL) access |= STANDARD_RIGHTS_ALL | EVENT_QUERY_STATE | EVENT_MODIFY_STATE; + return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL); +} + static void fsync_destroy( struct object *obj ) { } From ab7894d1b917dac823e9ea8272d20c76224b246a Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 2 Sep 2018 12:12:10 -0500 Subject: [PATCH 0355/2542] ntdll, server: Implement handle duplication. --- dlls/ntdll/unix/fsync.c | 16 ++++++++++------ server/fsync.c | 10 +++++++++- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 383df952e4b9..142e3ee284bd 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -410,10 +410,11 @@ NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) struct fsync *obj; struct semaphore *semaphore; ULONG current; + NTSTATUS ret; TRACE("%p, %d, %p.\n", handle, (int)count, prev); - if (!(obj = get_cached_object( handle ))) return STATUS_INVALID_HANDLE; + if ((ret = get_object( handle, &obj ))) return ret; semaphore = obj->shm; do @@ -456,10 +457,11 @@ NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ) struct event *event; struct fsync *obj; LONG current; + NTSTATUS ret; TRACE("%p.\n", handle); - if (!(obj = get_cached_object( handle ))) return STATUS_INVALID_HANDLE; + if ((ret = get_object( handle, &obj ))) return ret; event = obj->shm; if (!(current = __atomic_exchange_n( &event->signaled, 1, __ATOMIC_SEQ_CST ))) @@ -475,10 +477,11 @@ NTSTATUS fsync_reset_event( HANDLE handle, LONG *prev ) struct event *event; struct fsync *obj; LONG current; + NTSTATUS ret; TRACE("%p.\n", handle); - if (!(obj = get_cached_object( handle ))) return STATUS_INVALID_HANDLE; + if ((ret = get_object( handle, &obj ))) return ret; event = obj->shm; current = __atomic_exchange_n( &event->signaled, 0, __ATOMIC_SEQ_CST ); @@ -510,10 +513,11 @@ NTSTATUS fsync_release_mutex( HANDLE handle, LONG *prev ) { struct mutex *mutex; struct fsync *obj; + NTSTATUS ret; TRACE("%p, %p.\n", handle, prev); - if (!(obj = get_cached_object( handle ))) return STATUS_INVALID_HANDLE; + if ((ret = get_object( handle, &obj ))) return ret; mutex = obj->shm; if (mutex->tid != GetCurrentThreadId()) return STATUS_MUTANT_NOT_OWNED; @@ -974,10 +978,10 @@ NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an NTSTATUS fsync_signal_and_wait( HANDLE signal, HANDLE wait, BOOLEAN alertable, const LARGE_INTEGER *timeout ) { - struct fsync *obj = get_cached_object( signal ); + struct fsync *obj; NTSTATUS ret; - if (!obj) return STATUS_INVALID_HANDLE; + if ((ret = get_object( signal, &obj ))) return ret; switch (obj->type) { diff --git a/server/fsync.c b/server/fsync.c index 1df3aff91b67..73d1873759b9 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -131,6 +131,7 @@ struct fsync }; static void fsync_dump( struct object *obj, int verbose ); +static unsigned int fsync_get_fsync_idx( struct object *obj, enum fsync_type *type ); static unsigned int fsync_map_access( struct object *obj, unsigned int access ); static void fsync_destroy( struct object *obj ); @@ -143,7 +144,7 @@ const struct object_ops fsync_ops = NULL, /* remove_queue */ NULL, /* signaled */ NULL, /* get_esync_fd */ - NULL, /* get_fsync_idx */ + fsync_get_fsync_idx, /* get_fsync_idx */ NULL, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -167,6 +168,13 @@ static void fsync_dump( struct object *obj, int verbose ) fprintf( stderr, "fsync idx=%d\n", fsync->shm_idx ); } +static unsigned int fsync_get_fsync_idx( struct object *obj, enum fsync_type *type) +{ + struct fsync *fsync = (struct fsync *)obj; + *type = fsync->type; + return fsync->shm_idx; +} + static unsigned int fsync_map_access( struct object *obj, unsigned int access ) { /* Sync objects have the same flags. */ From ebf6615260f62ca048cd8c125415c5880cda9fab Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 2 Sep 2018 13:19:09 -0500 Subject: [PATCH 0356/2542] ntdll, server: Implement alertable waits. --- dlls/ntdll/unix/fsync.c | 107 +++++++++++++++++++++++++++++---- dlls/ntdll/unix/unix_private.h | 1 + dlls/ntdll/unix/virtual.c | 1 + server/fsync.c | 33 ++++++---- server/fsync.h | 2 + server/protocol.def | 5 ++ server/thread.c | 10 +++ server/thread.h | 1 + 8 files changed, 135 insertions(+), 25 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 142e3ee284bd..9518f1f0960e 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -544,20 +544,53 @@ static LONGLONG update_timeout( ULONGLONG end ) return timeleft; } -static NTSTATUS do_single_wait( int *addr, int val, ULONGLONG *end ) +static NTSTATUS do_single_wait( int *addr, int val, ULONGLONG *end, BOOLEAN alertable ) { int ret; - if (end) + if (alertable) { - LONGLONG timeleft = update_timeout( *end ); - struct timespec tmo_p; - tmo_p.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; - tmo_p.tv_nsec = (timeleft % TICKSPERSEC) * 100; - ret = futex_wait( addr, val, &tmo_p ); + struct event *apc_event = get_shm( ntdll_get_thread_data()->fsync_apc_idx ); + struct futex_wait_block futexes[2]; + + if (__atomic_load_n( &apc_event->signaled, __ATOMIC_SEQ_CST )) + return STATUS_USER_APC; + + futexes[0].addr = addr; + futexes[0].val = val; + futexes[1].addr = &apc_event->signaled; + futexes[1].val = 0; +#if __SIZEOF_POINTER__ == 4 + futexes[0].pad = futexes[1].pad = 0; +#endif + + if (end) + { + LONGLONG timeleft = update_timeout( *end ); + struct timespec tmo_p; + tmo_p.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; + tmo_p.tv_nsec = (timeleft % TICKSPERSEC) * 100; + ret = futex_wait_multiple( futexes, 2, &tmo_p ); + } + else + ret = futex_wait_multiple( futexes, 2, NULL ); + + if (__atomic_load_n( &apc_event->signaled, __ATOMIC_SEQ_CST )) + return STATUS_USER_APC; } else - ret = futex_wait( addr, val, NULL ); + { + if (end) + { + LONGLONG timeleft = update_timeout( *end ); + struct timespec tmo_p; + tmo_p.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; + tmo_p.tv_nsec = (timeleft % TICKSPERSEC) * 100; + ret = futex_wait( addr, val, &tmo_p ); + } + else + ret = futex_wait( addr, val, NULL ); + } if (!ret) return 0; @@ -570,16 +603,30 @@ static NTSTATUS do_single_wait( int *addr, int val, ULONGLONG *end ) static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ) { - struct futex_wait_block futexes[MAXIMUM_WAIT_OBJECTS]; + static const LARGE_INTEGER zero = {0}; + + struct futex_wait_block futexes[MAXIMUM_WAIT_OBJECTS + 1]; struct fsync *objs[MAXIMUM_WAIT_OBJECTS]; int has_fsync = 0, has_server = 0; BOOL msgwait = FALSE; int dummy_futex = 0; LONGLONG timeleft; LARGE_INTEGER now; + DWORD waitcount; ULONGLONG end; int i, ret; + /* Grab the APC futex if we don't already have it. */ + if (alertable && !ntdll_get_thread_data()->fsync_apc_idx) + { + SERVER_START_REQ( get_fsync_apc_idx ) + { + if (!(ret = wine_server_call( req ))) + ntdll_get_thread_data()->fsync_apc_idx = reply->shm_idx; + } + SERVER_END_REQ; + } + NtQuerySystemTime( &now ); if (timeout) { @@ -618,6 +665,8 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, if (msgwait) TRACE(" or driver events"); + if (alertable) + TRACE(", alertable"); if (!timeout) TRACE(", timeout = INFINITE.\n"); @@ -731,6 +780,21 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, #endif } + if (alertable) + { + struct event *event = get_shm( ntdll_get_thread_data()->fsync_apc_idx ); + if (__atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )) + goto userapc; + + futexes[i].addr = &event->signaled; + futexes[i].val = 0; +#if __SIZEOF_POINTER__ == 4 + futexes[i].pad = 0; +#endif + i++; + } + waitcount = i; + /* Looks like everything is contended, so wait. */ if (timeout) @@ -740,10 +804,10 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, tmo_p.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; tmo_p.tv_nsec = (timeleft % TICKSPERSEC) * 100; - ret = futex_wait_multiple( futexes, count, &tmo_p ); + ret = futex_wait_multiple( futexes, waitcount, &tmo_p ); } else - ret = futex_wait_multiple( futexes, count, NULL ); + ret = futex_wait_multiple( futexes, waitcount, NULL ); /* FUTEX_WAIT_MULTIPLE can succeed or return -EINTR, -EAGAIN, * -EFAULT/-EACCES, -ETIMEDOUT. In the first three cases we need to @@ -800,7 +864,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, while ((current = __atomic_load_n( &mutex->tid, __ATOMIC_SEQ_CST ))) { - status = do_single_wait( &mutex->tid, current, timeout ? &end : NULL ); + status = do_single_wait( &mutex->tid, current, timeout ? &end : NULL, alertable ); if (status != STATUS_PENDING) break; } @@ -812,7 +876,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, while (!__atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )) { - status = do_single_wait( &event->signaled, 0, timeout ? &end : NULL ); + status = do_single_wait( &event->signaled, 0, timeout ? &end : NULL, alertable ); if (status != STATUS_PENDING) break; } @@ -823,6 +887,8 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, TRACE("Wait timed out.\n"); return status; } + else if (status == STATUS_USER_APC) + goto userapc; } /* If we got here and we haven't timed out, that means all of the @@ -931,6 +997,21 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, } } /* while (1) */ } /* else (wait-all) */ + + assert(0); /* shouldn't reach here... */ + +userapc: + TRACE("Woken up by user APC.\n"); + + /* We have to make a server call anyway to get the APC to execute, so just + * delegate down to server_wait(). */ + ret = server_wait( NULL, 0, SELECT_INTERRUPTIBLE | SELECT_ALERTABLE, &zero ); + + /* This can happen if we received a system APC, and the APC fd was woken up + * before we got SIGUSR1. poll() doesn't return EINTR in that case. The + * right thing to do seems to be to return STATUS_USER_APC anyway. */ + if (ret == STATUS_TIMEOUT) ret = STATUS_USER_APC; + return ret; } /* Like esync, we need to let the server know when we are doing a message wait, diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 2b66358e9d0d..3dce95cb5aa5 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -104,6 +104,7 @@ struct ntdll_thread_data void *cpu_data[16]; /* reserved for CPU-specific data */ void *kernel_stack; /* stack for thread startup and kernel syscalls */ int esync_apc_fd; /* fd to wait on for user APCs */ + unsigned int fsync_apc_idx; int request_fd; /* fd for sending server requests */ int reply_fd; /* fd for receiving server replies */ int wait_fd[2]; /* fd for sleeping server requests */ diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 0cb73466ad21..174fdb5473a3 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -4086,6 +4086,7 @@ static TEB *init_teb( void *ptr, BOOL is_wow ) teb->StaticUnicodeString.MaximumLength = sizeof(teb->StaticUnicodeBuffer); thread_data = (struct ntdll_thread_data *)&teb->GdiTebBatch; thread_data->esync_apc_fd = -1; + thread_data->fsync_apc_idx = 0; thread_data->request_fd = -1; thread_data->reply_fd = -1; thread_data->wait_fd[0] = -1; diff --git a/server/fsync.c b/server/fsync.c index 73d1873759b9..10d8eb74bc35 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -316,31 +316,35 @@ struct fsync_event int unused; }; +void fsync_wake_futex( unsigned int shm_idx ) +{ + struct fsync_event *event = get_shm( shm_idx ); + + if (!__atomic_exchange_n( &event->signaled, 1, __ATOMIC_SEQ_CST )) + futex_wake( &event->signaled, INT_MAX ); +} + void fsync_wake_up( struct object *obj ) { - struct fsync_event *event; enum fsync_type type; if (obj->ops->get_fsync_idx) - { - event = get_shm( obj->ops->get_fsync_idx( obj, &type ) ); + fsync_wake_futex( obj->ops->get_fsync_idx( obj, &type ) ); +} - if (!__atomic_exchange_n( &event->signaled, 1, __ATOMIC_SEQ_CST )) - futex_wake( &event->signaled, INT_MAX ); - } +void fsync_clear_futex( unsigned int shm_idx ) +{ + struct fsync_event *event = get_shm( shm_idx ); + + __atomic_store_n( &event->signaled, 0, __ATOMIC_SEQ_CST ); } void fsync_clear( struct object *obj ) { - struct fsync_event *event; enum fsync_type type; if (obj->ops->get_fsync_idx) - { - event = get_shm( obj->ops->get_fsync_idx( obj, &type ) ); - - __atomic_store_n( &event->signaled, 0, __ATOMIC_SEQ_CST ); - } + fsync_clear_futex( obj->ops->get_fsync_idx( obj, &type ) ); } void fsync_set_event( struct fsync *fsync ) @@ -447,3 +451,8 @@ DECL_HANDLER(get_fsync_idx) release_object( obj ); } + +DECL_HANDLER(get_fsync_apc_idx) +{ + reply->shm_idx = current->fsync_apc_idx; +} diff --git a/server/fsync.h b/server/fsync.h index 087d482717be..f6f1a48b31e3 100644 --- a/server/fsync.h +++ b/server/fsync.h @@ -21,6 +21,8 @@ extern int do_fsync(void); extern void fsync_init(void); extern unsigned int fsync_alloc_shm( int low, int high ); +extern void fsync_wake_futex( unsigned int shm_idx ); +extern void fsync_clear_futex( unsigned int shm_idx ); extern void fsync_wake_up( struct object *obj ); extern void fsync_clear( struct object *obj ); diff --git a/server/protocol.def b/server/protocol.def index 781dbdd3d011..c42792d3f6c1 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -4179,3 +4179,8 @@ enum fsync_type @REQ(fsync_msgwait) int in_msgwait; /* are we in a message wait? */ @END + +@REQ(get_fsync_apc_idx) +@REPLY + unsigned int shm_idx; +@END diff --git a/server/thread.c b/server/thread.c index 87de2a82dd94..c286d94b8a1c 100644 --- a/server/thread.c +++ b/server/thread.c @@ -434,7 +434,10 @@ struct thread *create_thread( int fd, struct process *process, const struct secu } if (do_fsync()) + { thread->fsync_idx = fsync_alloc_shm( 0, 0 ); + thread->fsync_apc_idx = fsync_alloc_shm( 0, 0 ); + } if (do_esync()) { @@ -608,6 +611,7 @@ static struct thread_apc *create_apc( struct object *owner, const union apc_call apc->result.type = APC_NONE; if (owner) grab_object( owner ); } + return apc; } @@ -1271,6 +1275,9 @@ static int queue_apc( struct process *process, struct thread *thread, struct thr { wake_thread( thread ); + if (do_fsync() && queue == &thread->user_apc) + fsync_wake_futex( thread->fsync_apc_idx ); + if (do_esync() && queue == &thread->user_apc) esync_wake_fd( thread->esync_apc_fd ); } @@ -1321,6 +1328,9 @@ static struct thread_apc *thread_dequeue_apc( struct thread *thread, int system list_remove( ptr ); } + if (do_fsync() && list_empty( &thread->system_apc ) && list_empty( &thread->user_apc )) + fsync_clear_futex( thread->fsync_apc_idx ); + if (do_esync() && list_empty( &thread->system_apc ) && list_empty( &thread->user_apc )) esync_clear( thread->esync_apc_fd ); diff --git a/server/thread.h b/server/thread.h index 903aed9e3ba2..057ad9ec2aee 100644 --- a/server/thread.h +++ b/server/thread.h @@ -59,6 +59,7 @@ struct thread int esync_fd; /* esync file descriptor (signalled on exit) */ int esync_apc_fd; /* esync apc fd (signalled when APCs are present) */ unsigned int fsync_idx; + unsigned int fsync_apc_idx; unsigned int system_regs; /* which system regs have been set */ struct msg_queue *queue; /* message queue */ struct thread_wait *wait; /* current wait condition if sleeping */ From e973a8c242c372f06494e384ddf0f149f778d7b2 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 3 Mar 2019 10:45:10 -0600 Subject: [PATCH 0357/2542] ntdll: Wake all threads in futex_wake(). Because wait-all exists, this unfortunately seems necessary. --- dlls/ntdll/unix/fsync.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 9518f1f0960e..690898f7eac1 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -426,8 +426,7 @@ NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) if (prev) *prev = current; - if (!current) - futex_wake( &semaphore->count, count ); + futex_wake( &semaphore->count, INT_MAX ); return STATUS_SUCCESS; } @@ -465,7 +464,7 @@ NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ) event = obj->shm; if (!(current = __atomic_exchange_n( &event->signaled, 1, __ATOMIC_SEQ_CST ))) - futex_wake( &event->signaled, obj->type == FSYNC_AUTO_EVENT ? 1 : INT_MAX ); + futex_wake( &event->signaled, INT_MAX ); if (prev) *prev = current; @@ -527,7 +526,7 @@ NTSTATUS fsync_release_mutex( HANDLE handle, LONG *prev ) if (!--mutex->count) { __atomic_store_n( &mutex->tid, 0, __ATOMIC_SEQ_CST ); - futex_wake( &mutex->tid, 1 ); + futex_wake( &mutex->tid, INT_MAX ); } return STATUS_SUCCESS; From f75ad8f339485d0075f841b6fe4dbb7a8b9af487 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 3 Mar 2019 11:02:28 -0600 Subject: [PATCH 0358/2542] server: Create futex sections for timer objects. --- dlls/ntdll/unix/fsync.c | 3 +++ server/protocol.def | 1 + server/timer.c | 18 +++++++++++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 690898f7eac1..f2ae70ee1ab5 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -734,6 +734,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, break; } case FSYNC_AUTO_EVENT: + case FSYNC_AUTO_SERVER: { struct event *event = obj->shm; @@ -938,6 +939,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, break; } case FSYNC_AUTO_EVENT: + case FSYNC_AUTO_SERVER: { struct event *event = obj->shm; if (!__sync_val_compare_and_swap( &event->signaled, 1, 0 )) @@ -984,6 +986,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, break; } case FSYNC_AUTO_EVENT: + case FSYNC_AUTO_SERVER: { struct event *event = obj->shm; __atomic_store_n( &event->signaled, 1, __ATOMIC_SEQ_CST ); diff --git a/server/protocol.def b/server/protocol.def index c42792d3f6c1..21f7f02d4479 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -4138,6 +4138,7 @@ enum fsync_type FSYNC_AUTO_EVENT, FSYNC_MANUAL_EVENT, FSYNC_MUTEX, + FSYNC_AUTO_SERVER, FSYNC_MANUAL_SERVER, FSYNC_QUEUE, }; diff --git a/server/timer.c b/server/timer.c index c92162b59ed9..b614c49bd552 100644 --- a/server/timer.c +++ b/server/timer.c @@ -36,6 +36,7 @@ #include "handle.h" #include "request.h" #include "esync.h" +#include "fsync.h" static const WCHAR timer_name[] = {'T','i','m','e','r'}; @@ -63,11 +64,13 @@ struct timer client_ptr_t callback; /* callback APC function */ client_ptr_t arg; /* callback argument */ int esync_fd; /* esync file descriptor */ + unsigned int fsync_idx; /* fsync shm index */ }; static void timer_dump( struct object *obj, int verbose ); static int timer_signaled( struct object *obj, struct wait_queue_entry *entry ); static int timer_get_esync_fd( struct object *obj, enum esync_type *type ); +static unsigned int timer_get_fsync_idx( struct object *obj, enum fsync_type *type ); static void timer_satisfied( struct object *obj, struct wait_queue_entry *entry ); static void timer_destroy( struct object *obj ); @@ -80,7 +83,7 @@ static const struct object_ops timer_ops = remove_queue, /* remove_queue */ timer_signaled, /* signaled */ timer_get_esync_fd, /* get_esync_fd */ - NULL, /* get_fsync_idx */ + timer_get_fsync_idx, /* get_fsync_idx */ timer_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -117,6 +120,9 @@ static struct timer *create_timer( struct object *root, const struct unicode_str timer->thread = NULL; timer->esync_fd = -1; + if (do_fsync()) + timer->fsync_idx = fsync_alloc_shm( 0, 0 ); + if (do_esync()) timer->esync_fd = esync_create_fd( 0, 0 ); } @@ -191,6 +197,9 @@ static int set_timer( struct timer *timer, timeout_t expire, unsigned int period period = 0; /* period doesn't make any sense for a manual timer */ timer->signaled = 0; + if (do_fsync()) + fsync_clear( &timer->obj ); + if (do_esync()) esync_clear( timer->esync_fd ); } @@ -227,6 +236,13 @@ static int timer_get_esync_fd( struct object *obj, enum esync_type *type ) return timer->esync_fd; } +static unsigned int timer_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct timer *timer = (struct timer *)obj; + *type = timer->manual ? FSYNC_MANUAL_SERVER : FSYNC_AUTO_SERVER; + return timer->fsync_idx; +} + static void timer_satisfied( struct object *obj, struct wait_queue_entry *entry ) { struct timer *timer = (struct timer *)obj; From fcd793be8e7c87a7b8e0530d1e42967ed1a59293 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 3 Mar 2019 11:07:55 -0600 Subject: [PATCH 0359/2542] server: Create futex sections for console input events objects. --- server/console.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/server/console.c b/server/console.c index 09e8b53ca341..3330651680a6 100644 --- a/server/console.c +++ b/server/console.c @@ -42,6 +42,7 @@ #include "winternl.h" #include "wine/condrv.h" #include "esync.h" +#include "fsync.h" struct screen_buffer; @@ -143,12 +144,14 @@ struct console_server int term_fd; /* UNIX terminal fd */ struct termios termios; /* original termios */ int esync_fd; + unsigned int fsync_idx; }; static void console_server_dump( struct object *obj, int verbose ); static void console_server_destroy( struct object *obj ); static int console_server_signaled( struct object *obj, struct wait_queue_entry *entry ); static int console_server_get_esync_fd( struct object *obj, enum esync_type *type ); +static unsigned int console_server_get_fsync_idx( struct object *obj, enum fsync_type *type ); static struct fd *console_server_get_fd( struct object *obj ); static struct object *console_server_lookup_name( struct object *obj, struct unicode_str *name, unsigned int attr, struct object *root ); @@ -164,7 +167,7 @@ static const struct object_ops console_server_ops = remove_queue, /* remove_queue */ console_server_signaled, /* signaled */ console_server_get_esync_fd, /* get_esync_fd */ - NULL, /* get_fsync_idx */ + console_server_get_fsync_idx, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ console_server_get_fd, /* get_fd */ @@ -607,6 +610,8 @@ static void disconnect_console_server( struct console_server *server ) list_remove( &call->entry ); console_host_ioctl_terminate( call, STATUS_CANCELLED ); } + if (do_fsync()) + fsync_clear( &server->obj ); if (do_esync()) esync_clear( server->esync_fd ); while (!list_empty( &server->read_queue )) @@ -952,6 +957,13 @@ static int console_server_get_esync_fd( struct object *obj, enum esync_type *typ return server->esync_fd; } +static unsigned int console_server_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct console_server *server = (struct console_server*)obj; + *type = FSYNC_MANUAL_SERVER; + return server->fsync_idx; +} + static struct fd *console_server_get_fd( struct object* obj ) { struct console_server *server = (struct console_server*)obj; @@ -984,6 +996,10 @@ static struct object *create_console_server( void ) } allow_fd_caching(server->fd); server->esync_fd = -1; + server->fsync_idx = 0; + + if (do_fsync()) + server->fsync_idx = fsync_alloc_shm( 0, 0 ); if (do_esync()) server->esync_fd = esync_create_fd( 0, 0 ); @@ -1600,6 +1616,8 @@ DECL_HANDLER(get_next_console_request) /* set result of previous ioctl */ ioctl = LIST_ENTRY( list_head( &server->queue ), struct console_host_ioctl, entry ); list_remove( &ioctl->entry ); + if (do_fsync() && list_empty( &server->queue )) + fsync_clear( &server->obj ); if (do_esync() && list_empty( &server->queue )) esync_clear( server->esync_fd ); } @@ -1687,6 +1705,8 @@ DECL_HANDLER(get_next_console_request) { set_error( STATUS_PENDING ); } + if (do_fsync() && list_empty( &server->queue )) + fsync_clear( &server->obj ); if (do_esync() && list_empty( &server->queue )) esync_clear( server->esync_fd ); From d0be8d8eec98c98a3f04a5b8cea3ac62c54a706a Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 3 Mar 2019 11:23:23 -0600 Subject: [PATCH 0360/2542] ntdll: Implement NtQuerySemaphore(). --- dlls/ntdll/unix/fsync.c | 19 +++++++++++++++++++ dlls/ntdll/unix/fsync.h | 1 + dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 23 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index f2ae70ee1ab5..fb51a55aed73 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -431,6 +431,25 @@ NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) return STATUS_SUCCESS; } +NTSTATUS fsync_query_semaphore( HANDLE handle, void *info, ULONG *ret_len ) +{ + struct fsync *obj; + struct semaphore *semaphore; + SEMAPHORE_BASIC_INFORMATION *out = info; + NTSTATUS ret; + + TRACE("handle %p, info %p, ret_len %p.\n", handle, info, ret_len); + + if ((ret = get_object( handle, &obj ))) return ret; + semaphore = obj->shm; + + out->CurrentCount = semaphore->count; + out->MaximumCount = semaphore->max; + if (ret_len) *ret_len = sizeof(*out); + + return STATUS_SUCCESS; +} + NTSTATUS fsync_create_event( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, EVENT_TYPE event_type, BOOLEAN initial ) { diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h index 0fc2305bd5c7..72a36d4517ef 100644 --- a/dlls/ntdll/unix/fsync.h +++ b/dlls/ntdll/unix/fsync.h @@ -27,6 +27,7 @@ extern NTSTATUS fsync_create_semaphore(HANDLE *handle, ACCESS_MASK access, extern NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ); extern NTSTATUS fsync_open_semaphore( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ); +extern NTSTATUS fsync_query_semaphore( HANDLE handle, void *info, ULONG *ret_len ); extern NTSTATUS fsync_create_event( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial ); extern NTSTATUS fsync_open_event( HANDLE *handle, ACCESS_MASK access, diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 7af61d90e892..1951ec0d8606 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -390,6 +390,9 @@ NTSTATUS WINAPI NtQuerySemaphore( HANDLE handle, SEMAPHORE_INFORMATION_CLASS cla if (len != sizeof(SEMAPHORE_BASIC_INFORMATION)) return STATUS_INFO_LENGTH_MISMATCH; + if (do_fsync()) + return fsync_query_semaphore( handle, info, ret_len ); + if (do_esync()) return esync_query_semaphore( handle, info, ret_len ); From f2ee0cc7cfb2e66ee798d3102f953571a333f4d8 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 20:11:08 -0500 Subject: [PATCH 0361/2542] ntdll: Implement NtQueryEvent(). --- dlls/ntdll/unix/fsync.c | 19 +++++++++++++++++++ dlls/ntdll/unix/fsync.h | 1 + dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 23 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index fb51a55aed73..3cb8cb50d361 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -509,6 +509,25 @@ NTSTATUS fsync_reset_event( HANDLE handle, LONG *prev ) return STATUS_SUCCESS; } +NTSTATUS fsync_query_event( HANDLE handle, void *info, ULONG *ret_len ) +{ + struct event *event; + struct fsync *obj; + EVENT_BASIC_INFORMATION *out = info; + NTSTATUS ret; + + TRACE("handle %p, info %p, ret_len %p.\n", handle, info, ret_len); + + if ((ret = get_object( handle, &obj ))) return ret; + event = obj->shm; + + out->EventState = event->signaled; + out->EventType = (obj->type == FSYNC_AUTO_EVENT ? SynchronizationEvent : NotificationEvent); + if (ret_len) *ret_len = sizeof(*out); + + return STATUS_SUCCESS; +} + NTSTATUS fsync_create_mutex( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, BOOLEAN initial ) { diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h index 72a36d4517ef..388ae479eed3 100644 --- a/dlls/ntdll/unix/fsync.h +++ b/dlls/ntdll/unix/fsync.h @@ -34,6 +34,7 @@ extern NTSTATUS fsync_open_event( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ); extern NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ); extern NTSTATUS fsync_reset_event( HANDLE handle, LONG *prev ); +extern NTSTATUS fsync_query_event( HANDLE handle, void *info, ULONG *ret_len ); extern NTSTATUS fsync_create_mutex( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, BOOLEAN initial ); extern NTSTATUS fsync_open_mutex( HANDLE *handle, ACCESS_MASK access, diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 1951ec0d8606..b9a71eb47429 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -610,6 +610,9 @@ NTSTATUS WINAPI NtQueryEvent( HANDLE handle, EVENT_INFORMATION_CLASS class, if (len != sizeof(EVENT_BASIC_INFORMATION)) return STATUS_INFO_LENGTH_MISMATCH; + if (do_fsync()) + return fsync_query_event( handle, info, ret_len ); + if (do_esync()) return esync_query_event( handle, info, ret_len ); From e08ad2407d1e8dd17e464c5b564df4774ab7bc99 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 3 Mar 2019 11:29:55 -0600 Subject: [PATCH 0362/2542] ntdll: Implement NtQueryMutant(). --- dlls/ntdll/unix/fsync.c | 20 ++++++++++++++++++++ dlls/ntdll/unix/fsync.h | 1 + dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 24 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 3cb8cb50d361..522803268dc9 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -570,6 +570,26 @@ NTSTATUS fsync_release_mutex( HANDLE handle, LONG *prev ) return STATUS_SUCCESS; } +NTSTATUS fsync_query_mutex( HANDLE handle, void *info, ULONG *ret_len ) +{ + struct fsync *obj; + struct mutex *mutex; + MUTANT_BASIC_INFORMATION *out = info; + NTSTATUS ret; + + TRACE("handle %p, info %p, ret_len %p.\n", handle, info, ret_len); + + if ((ret = get_object( handle, &obj ))) return ret; + mutex = obj->shm; + + out->CurrentCount = 1 - mutex->count; + out->OwnedByCaller = (mutex->tid == GetCurrentThreadId()); + out->AbandonedState = FALSE; + if (ret_len) *ret_len = sizeof(*out); + + return STATUS_SUCCESS; +} + static LONGLONG update_timeout( ULONGLONG end ) { LARGE_INTEGER now; diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h index 388ae479eed3..fe354b39dad1 100644 --- a/dlls/ntdll/unix/fsync.h +++ b/dlls/ntdll/unix/fsync.h @@ -40,6 +40,7 @@ extern NTSTATUS fsync_create_mutex( HANDLE *handle, ACCESS_MASK access, extern NTSTATUS fsync_open_mutex( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ); extern NTSTATUS fsync_release_mutex( HANDLE handle, LONG *prev ); +extern NTSTATUS fsync_query_mutex( HANDLE handle, void *info, ULONG *ret_len ); extern NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index b9a71eb47429..b99aa548085c 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -740,6 +740,9 @@ NTSTATUS WINAPI NtQueryMutant( HANDLE handle, MUTANT_INFORMATION_CLASS class, if (len != sizeof(MUTANT_BASIC_INFORMATION)) return STATUS_INFO_LENGTH_MISMATCH; + if (do_fsync()) + return fsync_query_mutex( handle, info, ret_len ); + if (do_esync()) return esync_query_mutex( handle, info, ret_len ); From e3d6136668a9426b6080a2d6e7bbd95c21b2daf8 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 3 Mar 2019 11:35:22 -0600 Subject: [PATCH 0363/2542] server: Create futex sections for pseudo-fd objects and use them for named pipes. --- server/fd.c | 18 ++++++++++++++++++ server/file.h | 1 + server/named_pipe.c | 4 ++-- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/server/fd.c b/server/fd.c index 8a597e10efa6..999fb9ea6406 100644 --- a/server/fd.c +++ b/server/fd.c @@ -95,6 +95,7 @@ #include "process.h" #include "request.h" #include "esync.h" +#include "fsync.h" #include "winternl.h" #include "winioctl.h" @@ -156,6 +157,7 @@ struct fd apc_param_t comp_key; /* completion key to set in completion events */ unsigned int comp_flags; /* completion flags */ int esync_fd; /* esync file descriptor */ + unsigned int fsync_idx; /* fsync shm index */ }; static void fd_dump( struct object *obj, int verbose ); @@ -1755,8 +1757,12 @@ struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *use list_init( &fd->inode_entry ); list_init( &fd->locks ); + if (do_fsync()) + fd->fsync_idx = fsync_alloc_shm( 0, 0 ); + if (do_esync()) fd->esync_fd = esync_create_fd( 0, 0 ); + return fd; } @@ -2163,6 +2169,9 @@ void set_fd_signaled( struct fd *fd, int signaled ) fd->signaled = signaled; if (signaled) wake_up( fd->user, 0 ); + if (do_fsync() && !signaled) + fsync_clear( &fd->obj ); + if (do_esync() && !signaled) esync_clear( fd->esync_fd ); } @@ -2199,6 +2208,15 @@ int default_fd_get_esync_fd( struct object *obj, enum esync_type *type ) return ret; } +unsigned int default_fd_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct fd *fd = get_obj_fd( obj ); + unsigned int ret = fd->fsync_idx; + *type = FSYNC_MANUAL_SERVER; + release_object( fd ); + return ret; +} + int default_fd_get_poll_events( struct fd *fd ) { int events = 0; diff --git a/server/file.h b/server/file.h index 82660f6f40c9..f7edd7bf4e7a 100644 --- a/server/file.h +++ b/server/file.h @@ -110,6 +110,7 @@ extern void get_nt_name( struct fd *fd, struct unicode_str *name ); extern int default_fd_signaled( struct object *obj, struct wait_queue_entry *entry ); extern int default_fd_get_esync_fd( struct object *obj, enum esync_type *type ); +extern unsigned int default_fd_get_fsync_idx( struct object *obj, enum fsync_type *type ); extern int default_fd_get_poll_events( struct fd *fd ); extern void default_poll_event( struct fd *fd, int event ); extern void fd_cancel_async( struct fd *fd, struct async *async ); diff --git a/server/named_pipe.c b/server/named_pipe.c index 7b8f4f2edb4e..f638a3038341 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -170,7 +170,7 @@ static const struct object_ops pipe_server_ops = remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ default_fd_get_esync_fd, /* get_esync_fd */ - NULL, /* get_fsync_idx */ + default_fd_get_fsync_idx, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ pipe_end_get_fd, /* get_fd */ @@ -216,7 +216,7 @@ static const struct object_ops pipe_client_ops = remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ default_fd_get_esync_fd, /* get_esync_fd */ - NULL, /* get_fsync_idx */ + default_fd_get_fsync_idx, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ pipe_end_get_fd, /* get_fd */ From 25d174cd999cc5d17c8f74d156a94733362a3cce Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 3 Mar 2019 11:44:00 -0600 Subject: [PATCH 0364/2542] server: Create futex sections for true file objects and use them for directory change notifications. --- server/change.c | 2 +- server/fd.c | 3 +++ server/fsync.c | 13 ++++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/server/change.c b/server/change.c index 1341977fcf75..7e9e51e2c92c 100644 --- a/server/change.c +++ b/server/change.c @@ -113,7 +113,7 @@ static const struct object_ops dir_ops = remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ default_fd_get_esync_fd, /* get_esync_fd */ - NULL, /* get_fsync_idx */ + default_fd_get_fsync_idx, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ dir_get_fd, /* get_fd */ diff --git a/server/fd.c b/server/fd.c index 999fb9ea6406..501b3c040f6e 100644 --- a/server/fd.c +++ b/server/fd.c @@ -1715,6 +1715,9 @@ static struct fd *alloc_fd_object(void) if (do_esync()) fd->esync_fd = esync_create_fd( 1, 0 ); + if (do_fsync()) + fd->fsync_idx = fsync_alloc_shm( 1, 0 ); + if ((fd->poll_index = add_poll_user( fd )) == -1) { release_object( fd ); diff --git a/server/fsync.c b/server/fsync.c index 10d8eb74bc35..6a67d22d14e8 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -85,6 +85,8 @@ static void **shm_addrs; static int shm_addrs_size; /* length of the allocated shm_addrs array */ static long pagesize; +static int is_fsync_initialized; + static void shm_cleanup(void) { close( shm_fd ); @@ -120,6 +122,8 @@ void fsync_init(void) if (ftruncate( shm_fd, shm_size ) == -1) perror( "ftruncate" ); + is_fsync_initialized = 1; + atexit( shm_cleanup ); } @@ -231,9 +235,16 @@ static unsigned int shm_idx_counter = 1; unsigned int fsync_alloc_shm( int low, int high ) { #ifdef __linux__ - int shm_idx = shm_idx_counter++; + int shm_idx; int *shm; + /* this is arguably a bit of a hack, but we need some way to prevent + * allocating shm for the master socket */ + if (!is_fsync_initialized) + return 0; + + shm_idx = shm_idx_counter++; + while (shm_idx * 8 >= shm_size) { /* Better expand the shm section. */ From 32413d2882f1b91d6e5b4bee9b32f83c052ab235 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Tue, 4 Jun 2019 12:29:31 -0500 Subject: [PATCH 0365/2542] ntdll: Skip zero-length waits. An optimization that avoids a syscall. --- dlls/ntdll/unix/fsync.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 522803268dc9..30c996a6329b 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -855,7 +855,14 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, /* Looks like everything is contended, so wait. */ - if (timeout) + if (timeout && !timeout->QuadPart) + { + /* Unlike esync, we already know that we've timed out, so we + * can avoid a syscall. */ + TRACE("Wait timed out.\n"); + return STATUS_TIMEOUT; + } + else if (timeout) { LONGLONG timeleft = update_timeout( end ); struct timespec tmo_p; From 0951a4f015bc843ee1820adc489361dd306750be Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 13 Jun 2019 12:58:27 -0500 Subject: [PATCH 0366/2542] server: Add a diagnostic message for fsync. --- server/fsync.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/fsync.c b/server/fsync.c index 6a67d22d14e8..d4dbd66d22ad 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -124,6 +124,8 @@ void fsync_init(void) is_fsync_initialized = 1; + fprintf( stderr, "fsync: up and running.\n" ); + atexit( shm_cleanup ); } From a06edd3fa71e9d70da4e69fdf933a677582a2997 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 13 Jun 2019 12:59:53 -0500 Subject: [PATCH 0367/2542] ntdll, server: Make extra sure that esync is never used if fsync is used. --- dlls/ntdll/unix/esync.c | 3 ++- server/esync.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 6eea9d3afc4d..7c39f02da50a 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -47,6 +47,7 @@ #include "unix_private.h" #include "esync.h" +#include "fsync.h" WINE_DEFAULT_DEBUG_CHANNEL(esync); @@ -56,7 +57,7 @@ int do_esync(void) static int do_esync_cached = -1; if (do_esync_cached == -1) - do_esync_cached = getenv("WINEESYNC") && atoi(getenv("WINEESYNC")); + do_esync_cached = getenv("WINEESYNC") && atoi(getenv("WINEESYNC")) && !do_fsync(); return do_esync_cached; #else diff --git a/server/esync.c b/server/esync.c index 064bdd61b253..a5164435ed6b 100644 --- a/server/esync.c +++ b/server/esync.c @@ -43,6 +43,7 @@ #include "request.h" #include "file.h" #include "esync.h" +#include "fsync.h" int do_esync(void) { @@ -50,7 +51,7 @@ int do_esync(void) static int do_esync_cached = -1; if (do_esync_cached == -1) - do_esync_cached = getenv("WINEESYNC") && atoi(getenv("WINEESYNC")); + do_esync_cached = getenv("WINEESYNC") && atoi(getenv("WINEESYNC")) && !do_fsync(); return do_esync_cached; #else From 717e4a75d474df8fb8b60d5ace642b28a3350280 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 17 Jul 2019 15:29:04 -0500 Subject: [PATCH 0368/2542] ntdll, server: Switch to testing ABI. --- dlls/ntdll/unix/fsync.c | 6 +++++- server/fsync.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 30c996a6329b..885633296a46 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -60,13 +60,14 @@ struct futex_wait_block int pad; #endif int val; + int bitset; }; #include "poppack.h" static inline int futex_wait_multiple( const struct futex_wait_block *futexes, int count, const struct timespec *timeout ) { - return syscall( __NR_futex, futexes, 13, count, timeout, 0, 0 ); + return syscall( __NR_futex, futexes, 31, count, timeout, 0, 0 ); } static inline int futex_wake( int *addr, int val ) @@ -620,6 +621,7 @@ static NTSTATUS do_single_wait( int *addr, int val, ULONGLONG *end, BOOLEAN aler #if __SIZEOF_POINTER__ == 4 futexes[0].pad = futexes[1].pad = 0; #endif + futexes[0].bitset = futexes[1].bitset = ~0; if (end) { @@ -836,6 +838,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, #if __SIZEOF_POINTER__ == 4 futexes[i].pad = 0; #endif + futexes[i].bitset = ~0; } if (alertable) @@ -849,6 +852,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, #if __SIZEOF_POINTER__ == 4 futexes[i].pad = 0; #endif + futexes[i].bitset = ~0; i++; } waitcount = i; diff --git a/server/fsync.c b/server/fsync.c index d4dbd66d22ad..2cb804517dc8 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -57,7 +57,7 @@ struct futex_wait_block static inline int futex_wait_multiple( const struct futex_wait_block *futexes, int count, const struct timespec *timeout ) { - return syscall( __NR_futex, futexes, 13, count, timeout, 0, 0 ); + return syscall( __NR_futex, futexes, 31, count, timeout, 0, 0 ); } int do_fsync(void) From a8d901f036ae9e88186e9ae01fe89767566be9ea Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Tue, 23 Jul 2019 17:22:44 -0500 Subject: [PATCH 0369/2542] ntdll: Check the APC futex first. --- dlls/ntdll/unix/fsync.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 885633296a46..92c8bb4b7ef8 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -743,6 +743,16 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, { /* Try to grab anything. */ + if (alertable) + { + /* We must check this first! The server may set an event that + * we're waiting on, but we need to return STATUS_USER_APC. */ + struct event *event = get_shm( ntdll_get_thread_data()->fsync_apc_idx ); + TRACE("...%d\n", __atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )); + if (__atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )) + goto userapc; + } + for (i = 0; i < count; i++) { struct fsync *obj = objs[i]; @@ -844,9 +854,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, if (alertable) { struct event *event = get_shm( ntdll_get_thread_data()->fsync_apc_idx ); - if (__atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )) - goto userapc; - + /* We already checked if it was signaled; don't bother doing it again. */ futexes[i].addr = &event->signaled; futexes[i].val = 0; #if __SIZEOF_POINTER__ == 4 From c03bd0746dad3b2f032ba7b184fba627f15ad1af Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 24 Jul 2019 14:44:15 -0500 Subject: [PATCH 0370/2542] server: Fix an invalid use of fsync_clear(). The fd object has no get_fsync_idx callback, so this would do nothing. --- server/fd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/fd.c b/server/fd.c index 501b3c040f6e..2cb2c5c552fe 100644 --- a/server/fd.c +++ b/server/fd.c @@ -2173,7 +2173,7 @@ void set_fd_signaled( struct fd *fd, int signaled ) if (signaled) wake_up( fd->user, 0 ); if (do_fsync() && !signaled) - fsync_clear( &fd->obj ); + fsync_clear( fd->user ); if (do_esync() && !signaled) esync_clear( fd->esync_fd ); From 2400a1d1a448bdbe4abb24f7524a73ec822d0fd6 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 24 Jul 2019 14:45:24 -0500 Subject: [PATCH 0371/2542] server: Be a little more careful about futex operations. --- server/fd.c | 2 ++ server/fsync.c | 24 ++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/server/fd.c b/server/fd.c index 2cb2c5c552fe..2d4ec26d1c6f 100644 --- a/server/fd.c +++ b/server/fd.c @@ -1706,6 +1706,7 @@ static struct fd *alloc_fd_object(void) fd->completion = NULL; fd->comp_flags = 0; fd->esync_fd = -1; + fd->fsync_idx = 0; init_async_queue( &fd->read_q ); init_async_queue( &fd->write_q ); init_async_queue( &fd->wait_q ); @@ -1754,6 +1755,7 @@ struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *use fd->comp_flags = 0; fd->no_fd_status = STATUS_BAD_DEVICE_TYPE; fd->esync_fd = -1; + fd->fsync_idx = 0; init_async_queue( &fd->read_q ); init_async_queue( &fd->write_q ); init_async_queue( &fd->wait_q ); diff --git a/server/fsync.c b/server/fsync.c index 2cb804517dc8..ca57d7f9cb85 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -331,8 +331,15 @@ struct fsync_event void fsync_wake_futex( unsigned int shm_idx ) { - struct fsync_event *event = get_shm( shm_idx ); + struct fsync_event *event; + if (debug_level) + fprintf( stderr, "fsync_wake_futex: index %u\n", shm_idx ); + + if (!shm_idx) + return; + + event = get_shm( shm_idx ); if (!__atomic_exchange_n( &event->signaled, 1, __ATOMIC_SEQ_CST )) futex_wake( &event->signaled, INT_MAX ); } @@ -341,14 +348,24 @@ void fsync_wake_up( struct object *obj ) { enum fsync_type type; + if (debug_level) + fprintf( stderr, "fsync_wake_up: object %p\n", obj ); + if (obj->ops->get_fsync_idx) fsync_wake_futex( obj->ops->get_fsync_idx( obj, &type ) ); } void fsync_clear_futex( unsigned int shm_idx ) { - struct fsync_event *event = get_shm( shm_idx ); + struct fsync_event *event; + if (debug_level) + fprintf( stderr, "fsync_clear_futex: index %u\n", shm_idx ); + + if (!shm_idx) + return; + + event = get_shm( shm_idx ); __atomic_store_n( &event->signaled, 0, __ATOMIC_SEQ_CST ); } @@ -356,6 +373,9 @@ void fsync_clear( struct object *obj ) { enum fsync_type type; + if (debug_level) + fprintf( stderr, "fsync_clear: object %p\n", obj ); + if (obj->ops->get_fsync_idx) fsync_clear_futex( obj->ops->get_fsync_idx( obj, &type ) ); } From 4b9de38521caba171c1aa0bb48f6e46c24615109 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 24 Jul 2019 15:02:01 -0500 Subject: [PATCH 0372/2542] ntdll: Catch closed handles more gracefully. --- dlls/ntdll/unix/fsync.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 92c8bb4b7ef8..af0d688b85cc 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -759,6 +759,13 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, if (obj) { + if (!obj->type) /* gcc complains if we put this in the switch */ + { + /* Someone probably closed an object while waiting on it. */ + WARN("Handle %p has type 0; was it closed?\n", handles[i]); + return STATUS_INVALID_HANDLE; + } + switch (obj->type) { case FSYNC_SEMAPHORE: @@ -835,6 +842,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, break; } default: + ERR("Invalid type %#x for handle %p.\n", obj->type, handles[i]); assert(0); } } From 4fafaa1d7aabe66db7b0212a4283203f925bfb67 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 24 Jul 2019 15:04:08 -0500 Subject: [PATCH 0373/2542] ntdll: Implement fsync_pulse_event(). --- dlls/ntdll/unix/fsync.c | 29 +++++++++++++++++++++++++++++ dlls/ntdll/unix/fsync.h | 1 + dlls/ntdll/unix/sync.c | 3 +++ 3 files changed, 33 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index af0d688b85cc..feb5fc17100a 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -510,6 +510,35 @@ NTSTATUS fsync_reset_event( HANDLE handle, LONG *prev ) return STATUS_SUCCESS; } +NTSTATUS fsync_pulse_event( HANDLE handle, LONG *prev ) +{ + struct event *event; + struct fsync *obj; + LONG current; + NTSTATUS ret; + + TRACE("%p.\n", handle); + + if ((ret = get_object( handle, &obj ))) return ret; + event = obj->shm; + + /* This isn't really correct; an application could miss the write. + * Unfortunately we can't really do much better. Fortunately this is rarely + * used (and publicly deprecated). */ + if (!(current = __atomic_exchange_n( &event->signaled, 1, __ATOMIC_SEQ_CST ))) + futex_wake( &event->signaled, INT_MAX ); + + /* Try to give other threads a chance to wake up. Hopefully erring on this + * side is the better thing to do... */ + NtYieldExecution(); + + __atomic_store_n( &event->signaled, 0, __ATOMIC_SEQ_CST ); + + if (prev) *prev = current; + + return STATUS_SUCCESS; +} + NTSTATUS fsync_query_event( HANDLE handle, void *info, ULONG *ret_len ) { struct event *event; diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h index fe354b39dad1..763e7891ab84 100644 --- a/dlls/ntdll/unix/fsync.h +++ b/dlls/ntdll/unix/fsync.h @@ -34,6 +34,7 @@ extern NTSTATUS fsync_open_event( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ); extern NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ); extern NTSTATUS fsync_reset_event( HANDLE handle, LONG *prev ); +extern NTSTATUS fsync_pulse_event( HANDLE handle, LONG *prev ); extern NTSTATUS fsync_query_event( HANDLE handle, void *info, ULONG *ret_len ); extern NTSTATUS fsync_create_mutex( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, BOOLEAN initial ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index b99aa548085c..1b06152c6d2f 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -576,6 +576,9 @@ NTSTATUS WINAPI NtPulseEvent( HANDLE handle, LONG *prev_state ) { unsigned int ret; + if (do_fsync()) + return fsync_pulse_event( handle, prev_state ); + if (do_esync()) return esync_pulse_event( handle ); From 983c51bc438b80fd1aec9f6ad454e6904c3b9d81 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 31 Jul 2019 12:18:37 -0500 Subject: [PATCH 0374/2542] server: Print a message when using server-side synchronization. --- server/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/main.c b/server/main.c index 457b044a36ac..9559ad83584a 100644 --- a/server/main.c +++ b/server/main.c @@ -237,6 +237,9 @@ int main( int argc, char *argv[] ) if (do_esync()) esync_init(); + if (!do_fsync() && !do_esync()) + fprintf( stderr, "wineserver: using server-side synchronization.\n" ); + if (debug_level) fprintf( stderr, "wineserver: starting (pid=%ld)\n", (long) getpid() ); set_current_time(); init_signals(); From 2e5936087026949c3a6a8c38839b9814c35a2282 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 7 Aug 2019 17:07:15 -0500 Subject: [PATCH 0375/2542] ntdll: Store the fsync APC futex in the thread data directly. Essentially so we can take get_shm() out of any critical paths. --- dlls/ntdll/unix/fsync.c | 26 +++++++++++++++----------- dlls/ntdll/unix/unix_private.h | 2 +- dlls/ntdll/unix/virtual.c | 2 +- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index feb5fc17100a..bf3581aa0cd4 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -637,15 +637,15 @@ static NTSTATUS do_single_wait( int *addr, int val, ULONGLONG *end, BOOLEAN aler if (alertable) { - struct event *apc_event = get_shm( ntdll_get_thread_data()->fsync_apc_idx ); + int *apc_futex = ntdll_get_thread_data()->fsync_apc_futex; struct futex_wait_block futexes[2]; - if (__atomic_load_n( &apc_event->signaled, __ATOMIC_SEQ_CST )) + if (__atomic_load_n( apc_futex, __ATOMIC_SEQ_CST )) return STATUS_USER_APC; futexes[0].addr = addr; futexes[0].val = val; - futexes[1].addr = &apc_event->signaled; + futexes[1].addr = apc_futex; futexes[1].val = 0; #if __SIZEOF_POINTER__ == 4 futexes[0].pad = futexes[1].pad = 0; @@ -663,7 +663,7 @@ static NTSTATUS do_single_wait( int *addr, int val, ULONGLONG *end, BOOLEAN aler else ret = futex_wait_multiple( futexes, 2, NULL ); - if (__atomic_load_n( &apc_event->signaled, __ATOMIC_SEQ_CST )) + if (__atomic_load_n( apc_futex, __ATOMIC_SEQ_CST )) return STATUS_USER_APC; } else @@ -705,14 +705,21 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, int i, ret; /* Grab the APC futex if we don't already have it. */ - if (alertable && !ntdll_get_thread_data()->fsync_apc_idx) + if (alertable && !ntdll_get_thread_data()->fsync_apc_futex) { + unsigned int idx = 0; SERVER_START_REQ( get_fsync_apc_idx ) { if (!(ret = wine_server_call( req ))) - ntdll_get_thread_data()->fsync_apc_idx = reply->shm_idx; + idx = reply->shm_idx; } SERVER_END_REQ; + + if (idx) + { + struct event *apc_event = get_shm( idx ); + ntdll_get_thread_data()->fsync_apc_futex = &apc_event->signaled; + } } NtQuerySystemTime( &now ); @@ -776,9 +783,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, { /* We must check this first! The server may set an event that * we're waiting on, but we need to return STATUS_USER_APC. */ - struct event *event = get_shm( ntdll_get_thread_data()->fsync_apc_idx ); - TRACE("...%d\n", __atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )); - if (__atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )) + if (__atomic_load_n( ntdll_get_thread_data()->fsync_apc_futex, __ATOMIC_SEQ_CST )) goto userapc; } @@ -890,9 +895,8 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, if (alertable) { - struct event *event = get_shm( ntdll_get_thread_data()->fsync_apc_idx ); /* We already checked if it was signaled; don't bother doing it again. */ - futexes[i].addr = &event->signaled; + futexes[i].addr = ntdll_get_thread_data()->fsync_apc_futex; futexes[i].val = 0; #if __SIZEOF_POINTER__ == 4 futexes[i].pad = 0; diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 3dce95cb5aa5..ac255964eb4c 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -104,7 +104,7 @@ struct ntdll_thread_data void *cpu_data[16]; /* reserved for CPU-specific data */ void *kernel_stack; /* stack for thread startup and kernel syscalls */ int esync_apc_fd; /* fd to wait on for user APCs */ - unsigned int fsync_apc_idx; + int *fsync_apc_futex; int request_fd; /* fd for sending server requests */ int reply_fd; /* fd for receiving server replies */ int wait_fd[2]; /* fd for sleeping server requests */ diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 174fdb5473a3..604e7fede00b 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -4086,7 +4086,7 @@ static TEB *init_teb( void *ptr, BOOL is_wow ) teb->StaticUnicodeString.MaximumLength = sizeof(teb->StaticUnicodeBuffer); thread_data = (struct ntdll_thread_data *)&teb->GdiTebBatch; thread_data->esync_apc_fd = -1; - thread_data->fsync_apc_idx = 0; + thread_data->fsync_apc_futex = NULL; thread_data->request_fd = -1; thread_data->reply_fd = -1; thread_data->wait_fd[0] = -1; From a0036a94629ae97f3181ccb1e5225f1b515dfb05 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 7 Aug 2019 17:14:59 -0500 Subject: [PATCH 0376/2542] ntdll/fsync: Lock accessing the shm_addrs array. --- dlls/ntdll/unix/fsync.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index bf3581aa0cd4..b2de93549399 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -134,10 +134,15 @@ static void **shm_addrs; static int shm_addrs_size; /* length of the allocated shm_addrs array */ static long pagesize; +static pthread_mutex_t shm_addrs_mutex = PTHREAD_MUTEX_INITIALIZER; + static void *get_shm( unsigned int idx ) { int entry = (idx * 8) / pagesize; int offset = (idx * 8) % pagesize; + void *ret; + + pthread_mutex_lock( &shm_addrs_mutex ); if (entry >= shm_addrs_size) { @@ -161,7 +166,11 @@ static void *get_shm( unsigned int idx ) munmap( addr, pagesize ); /* someone beat us to it */ } - return (void *)((unsigned long)shm_addrs[entry] + offset); + ret = (void *)((unsigned long)shm_addrs[entry] + offset); + + pthread_mutex_unlock( &shm_addrs_mutex ); + + return ret; } /* We'd like lookup to be fast. To that end, we use a static list indexed by handle. From ed02b414dce0aa757b8f3b536db309a1ca9ce18a Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 8 Aug 2019 17:12:46 -0500 Subject: [PATCH 0377/2542] ntdll/fsync: Fix a race condition when waiting on a mutex. --- dlls/ntdll/unix/fsync.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index b2de93549399..d3d4a3943e75 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -834,6 +834,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, case FSYNC_MUTEX: { struct mutex *mutex = obj->shm; + int tid; if (mutex->tid == GetCurrentThreadId()) { @@ -842,7 +843,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, return i; } - if (!__sync_val_compare_and_swap( &mutex->tid, 0, GetCurrentThreadId() )) + if (!(tid = __sync_val_compare_and_swap( &mutex->tid, 0, GetCurrentThreadId() ))) { TRACE("Woken up by handle %p [%d].\n", handles[i], i); mutex->count = 1; @@ -850,7 +851,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, } futexes[i].addr = &mutex->tid; - futexes[i].val = mutex->tid; + futexes[i].val = tid; break; } case FSYNC_AUTO_EVENT: From 390d7037df1399e1ce57c7eb6e7ae763be45745d Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 19 Aug 2019 18:25:42 -0500 Subject: [PATCH 0378/2542] ntdll/fsync: Introduce a configurable spin count. --- dlls/ntdll/unix/fsync.c | 68 +++++++++++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 19 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index d3d4a3943e75..2e633c517922 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -64,6 +64,15 @@ struct futex_wait_block }; #include "poppack.h" +static inline void small_pause(void) +{ +#if defined(__i386__) || defined(__x86_64__) + __asm__ __volatile__( "rep;nop" : : : "memory" ); +#else + __asm__ __volatile__( "" : : : "memory" ); +#endif +} + static inline int futex_wait_multiple( const struct futex_wait_block *futexes, int count, const struct timespec *timeout ) { @@ -80,6 +89,8 @@ static inline int futex_wait( int *addr, int val, struct timespec *timeout ) return syscall( __NR_futex, addr, 0, val, timeout, 0, 0 ); } +static unsigned int spincount; + int do_fsync(void) { #ifdef __linux__ @@ -90,6 +101,8 @@ int do_fsync(void) static const struct timespec zero; futex_wait_multiple( NULL, 0, &zero ); do_fsync_cached = getenv("WINEFSYNC") && atoi(getenv("WINEFSYNC")) && errno != ENOSYS; + if (getenv("WINEFSYNC_SPINCOUNT")) + spincount = atoi(getenv("WINEFSYNC_SPINCOUNT")); } return do_fsync_cached; @@ -707,6 +720,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, int has_fsync = 0, has_server = 0; BOOL msgwait = FALSE; int dummy_futex = 0; + unsigned int spin; LONGLONG timeleft; LARGE_INTEGER now; DWORD waitcount; @@ -816,19 +830,23 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, struct semaphore *semaphore = obj->shm; int current; - do - { - if (!(current = semaphore->count)) break; - } while (__sync_val_compare_and_swap( &semaphore->count, current, current - 1 ) != current); - - if (current) + /* It would be a little clearer (and less error-prone) + * to use a dedicated interlocked_dec_if_nonzero() + * helper, but nesting loops like that is probably not + * great for performance... */ + for (spin = 0; spin <= spincount || current; ++spin) { - TRACE("Woken up by handle %p [%d].\n", handles[i], i); - return i; + if ((current = __atomic_load_n( &semaphore->count, __ATOMIC_SEQ_CST )) + && __sync_val_compare_and_swap( &semaphore->count, current, current - 1 ) == current) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + return i; + } + small_pause(); } futexes[i].addr = &semaphore->count; - futexes[i].val = current; + futexes[i].val = 0; break; } case FSYNC_MUTEX: @@ -843,11 +861,15 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, return i; } - if (!(tid = __sync_val_compare_and_swap( &mutex->tid, 0, GetCurrentThreadId() ))) + for (spin = 0; spin <= spincount; ++spin) { - TRACE("Woken up by handle %p [%d].\n", handles[i], i); - mutex->count = 1; - return i; + if (!(tid = __sync_val_compare_and_swap( &mutex->tid, 0, GetCurrentThreadId() ))) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + mutex->count = 1; + return i; + } + small_pause(); } futexes[i].addr = &mutex->tid; @@ -859,10 +881,14 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, { struct event *event = obj->shm; - if (__sync_val_compare_and_swap( &event->signaled, 1, 0 )) + for (spin = 0; spin <= spincount; ++spin) { - TRACE("Woken up by handle %p [%d].\n", handles[i], i); - return i; + if (__sync_val_compare_and_swap( &event->signaled, 1, 0 )) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + return i; + } + small_pause(); } futexes[i].addr = &event->signaled; @@ -875,10 +901,14 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, { struct event *event = obj->shm; - if (__atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )) + for (spin = 0; spin <= spincount; ++spin) { - TRACE("Woken up by handle %p [%d].\n", handles[i], i); - return i; + if (__atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + return i; + } + small_pause(); } futexes[i].addr = &event->signaled; From 64b5fca3f19f6d711190c3b4a7cf7bdd01b14d2c Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 17 Feb 2020 11:57:40 -0600 Subject: [PATCH 0379/2542] ntdll, server: Abandon fsync mutexes on thread exit. --- dlls/ntdll/unix/fsync.c | 35 ++++++++++++++++++++++++++++------- server/fsync.c | 33 +++++++++++++++++++++++++++++++++ server/fsync.h | 1 + server/thread.c | 2 ++ 4 files changed, 64 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 2e633c517922..da5245f9e85a 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -636,7 +636,7 @@ NTSTATUS fsync_query_mutex( HANDLE handle, void *info, ULONG *ret_len ) out->CurrentCount = 1 - mutex->count; out->OwnedByCaller = (mutex->tid == GetCurrentThreadId()); - out->AbandonedState = FALSE; + out->AbandonedState = (mutex->tid == ~0); if (ret_len) *ret_len = sizeof(*out); return STATUS_SUCCESS; @@ -869,6 +869,12 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, mutex->count = 1; return i; } + else if (tid == ~0 && (tid = __sync_val_compare_and_swap( &mutex->tid, ~0, GetCurrentThreadId() )) == ~0) + { + TRACE("Woken up by abandoned mutex %p [%d].\n", handles[i], i); + mutex->count = 1; + return STATUS_ABANDONED_WAIT_0 + i; + } small_pause(); } @@ -1006,7 +1012,11 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, while (1) { + BOOL abandoned; + tryagain: + abandoned = FALSE; + /* First step: try to wait on each object in sequence. */ for (i = 0; i < count; i++) @@ -1058,11 +1068,9 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, if (obj && obj->type == FSYNC_MUTEX) { struct mutex *mutex = obj->shm; + int tid = __atomic_load_n( &mutex->tid, __ATOMIC_SEQ_CST ); - if (mutex->tid == GetCurrentThreadId()) - continue; /* ok */ - - if (__atomic_load_n( &mutex->tid, __ATOMIC_SEQ_CST )) + if (tid && tid != ~0 && tid != GetCurrentThreadId()) goto tryagain; } else if (obj) @@ -1083,10 +1091,15 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, case FSYNC_MUTEX: { struct mutex *mutex = obj->shm; - if (mutex->tid == GetCurrentThreadId()) + int tid = __atomic_load_n( &mutex->tid, __ATOMIC_SEQ_CST ); + if (tid == GetCurrentThreadId()) break; - if (__sync_val_compare_and_swap( &mutex->tid, 0, GetCurrentThreadId() )) + if (tid && tid != ~0) + goto tooslow; + if (__sync_val_compare_and_swap( &mutex->tid, tid, GetCurrentThreadId() ) != tid) goto tooslow; + if (tid == ~0) + abandoned = TRUE; break; } case FSYNC_SEMAPHORE: @@ -1122,6 +1135,11 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, } } + if (abandoned) + { + TRACE("Wait successful, but some object(s) were abandoned.\n"); + return STATUS_ABANDONED; + } TRACE("Wait successful.\n"); return STATUS_SUCCESS; @@ -1134,6 +1152,9 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, case FSYNC_MUTEX: { struct mutex *mutex = obj->shm; + /* HACK: This won't do the right thing with abandoned + * mutexes, but fixing it is probably more trouble than + * it's worth. */ __atomic_store_n( &mutex->tid, 0, __ATOMIC_SEQ_CST ); break; } diff --git a/server/fsync.c b/server/fsync.c index ca57d7f9cb85..3ad59f4735f2 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -129,11 +129,14 @@ void fsync_init(void) atexit( shm_cleanup ); } +static struct list mutex_list = LIST_INIT(mutex_list); + struct fsync { struct object obj; unsigned int shm_idx; enum fsync_type type; + struct list mutex_entry; }; static void fsync_dump( struct object *obj, int verbose ); @@ -193,6 +196,9 @@ static unsigned int fsync_map_access( struct object *obj, unsigned int access ) static void fsync_destroy( struct object *obj ) { + struct fsync *fsync = (struct fsync *)obj; + if (fsync->type == FSYNC_MUTEX) + list_remove( &fsync->mutex_entry ); } static void *get_shm( unsigned int idx ) @@ -297,6 +303,8 @@ struct fsync *create_fsync( struct object *root, const struct unicode_str *name, fsync->shm_idx = fsync_alloc_shm( low, high ); fsync->type = type; + if (type == FSYNC_MUTEX) + list_add_tail( &mutex_list, &fsync->mutex_entry ); } else { @@ -397,6 +405,31 @@ void fsync_reset_event( struct fsync *fsync ) __atomic_store_n( &event->signaled, 0, __ATOMIC_SEQ_CST ); } +struct mutex +{ + int tid; + int count; /* recursion count */ +}; + +void fsync_abandon_mutexes( struct thread *thread ) +{ + struct fsync *fsync; + + LIST_FOR_EACH_ENTRY( fsync, &mutex_list, struct fsync, mutex_entry ) + { + struct mutex *mutex = get_shm( fsync->shm_idx ); + + if (mutex->tid == thread->id) + { + if (debug_level) + fprintf( stderr, "fsync_abandon_mutexes() idx=%d\n", fsync->shm_idx ); + mutex->tid = ~0; + mutex->count = 0; + futex_wake( &mutex->tid, INT_MAX ); + } + } +} + DECL_HANDLER(create_fsync) { struct fsync *fsync; diff --git a/server/fsync.h b/server/fsync.h index f6f1a48b31e3..a91939b7f0a7 100644 --- a/server/fsync.h +++ b/server/fsync.h @@ -31,3 +31,4 @@ struct fsync; extern const struct object_ops fsync_ops; extern void fsync_set_event( struct fsync *fsync ); extern void fsync_reset_event( struct fsync *fsync ); +extern void fsync_abandon_mutexes( struct thread *thread ); diff --git a/server/thread.c b/server/thread.c index c286d94b8a1c..e4c4d3a50bd9 100644 --- a/server/thread.c +++ b/server/thread.c @@ -1429,6 +1429,8 @@ void kill_thread( struct thread *thread, int violent_death ) } kill_console_processes( thread, 0 ); abandon_mutexes( thread ); + if (do_fsync()) + fsync_abandon_mutexes( thread ); if (do_esync()) esync_abandon_mutexes( thread ); wake_up( &thread->obj, 0 ); From 4890afea8de4a1a67f2cf4b4bae57bcaf7b8fd4c Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 18 Mar 2020 20:03:42 -0500 Subject: [PATCH 0380/2542] ntdll: Default the spin count to 100. --- dlls/ntdll/unix/fsync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index da5245f9e85a..c28b4e275975 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -89,7 +89,7 @@ static inline int futex_wait( int *addr, int val, struct timespec *timeout ) return syscall( __NR_futex, addr, 0, val, timeout, 0, 0 ); } -static unsigned int spincount; +static unsigned int spincount = 100; int do_fsync(void) { From 1343df229f1774cbf5a214760d2f214f09b243f1 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Fri, 13 Mar 2020 15:52:15 -0500 Subject: [PATCH 0381/2542] ntdll: Implement an esync/fsync path for alertable NtDelayExecution(). --- dlls/ntdll/unix/esync.c | 4 ++-- dlls/ntdll/unix/fsync.c | 6 +++--- dlls/ntdll/unix/sync.c | 19 ++++++++++++++++++- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 7c39f02da50a..823e78eaf5a8 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -858,7 +858,7 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA return ret; } - if (objs[count - 1] && objs[count - 1]->type == ESYNC_QUEUE) + if (count && objs[count - 1] && objs[count - 1]->type == ESYNC_QUEUE) msgwait = TRUE; if (has_esync && has_server) @@ -887,7 +887,7 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA } } - if (wait_any || count == 1) + if (wait_any || count <= 1) { /* Try to check objects now, so we can obviate poll() at least. */ for (i = 0; i < count; i++) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index c28b4e275975..f419e4b826dc 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -767,7 +767,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, return ret; } - if (objs[count - 1] && objs[count - 1]->type == FSYNC_QUEUE) + if (count && objs[count - 1] && objs[count - 1]->type == FSYNC_QUEUE) msgwait = TRUE; if (has_fsync && has_server) @@ -796,7 +796,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, } } - if (wait_any || count == 1) + if (wait_any || count <= 1) { while (1) { @@ -1223,7 +1223,7 @@ NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an struct fsync *obj; NTSTATUS ret; - if (!get_object( handles[count - 1], &obj ) && obj->type == FSYNC_QUEUE) + if (count && !get_object( handles[count - 1], &obj ) && obj->type == FSYNC_QUEUE) { msgwait = TRUE; server_set_msgwait( 1 ); diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 1b06152c6d2f..15029aa8f1c5 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -1754,7 +1754,24 @@ NTSTATUS WINAPI NtYieldExecution(void) NTSTATUS WINAPI NtDelayExecution( BOOLEAN alertable, const LARGE_INTEGER *timeout ) { /* if alertable, we need to query the server */ - if (alertable) return server_wait( NULL, 0, SELECT_INTERRUPTIBLE | SELECT_ALERTABLE, timeout ); + if (alertable) + { + if (do_fsync()) + { + NTSTATUS ret = fsync_wait_objects( 0, NULL, TRUE, TRUE, timeout ); + if (ret != STATUS_NOT_IMPLEMENTED) + return ret; + } + + if (do_esync()) + { + NTSTATUS ret = esync_wait_objects( 0, NULL, TRUE, TRUE, timeout ); + if (ret != STATUS_NOT_IMPLEMENTED) + return ret; + } + + return server_wait( NULL, 0, SELECT_INTERRUPTIBLE | SELECT_ALERTABLE, timeout ); + } if (!timeout || timeout->QuadPart == TIMEOUT_INFINITE) /* sleep forever */ { From aa94401dd48335bbb3316e8fbddb8339b50400e9 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 25 Jun 2021 23:17:43 +0300 Subject: [PATCH 0382/2542] esync, fsync: Use usleep(0) instead of NtYieldExecution() in esync_pulse_event(). For Mafia III: Definitive Edition when FPS limit is set. CW-Bug-Id: #19024 --- dlls/ntdll/unix/esync.c | 2 +- dlls/ntdll/unix/fsync.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 823e78eaf5a8..159d25349dc8 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -616,7 +616,7 @@ NTSTATUS esync_pulse_event( HANDLE handle ) /* Try to give other threads a chance to wake up. Hopefully erring on this * side is the better thing to do... */ - NtYieldExecution(); + usleep(0); read( obj->fd, &value, sizeof(value) ); diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index f419e4b826dc..2ee7a1d2cb92 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -552,7 +552,7 @@ NTSTATUS fsync_pulse_event( HANDLE handle, LONG *prev ) /* Try to give other threads a chance to wake up. Hopefully erring on this * side is the better thing to do... */ - NtYieldExecution(); + usleep(0); __atomic_store_n( &event->signaled, 0, __ATOMIC_SEQ_CST ); From 63f9b3a44ce1ae4dae7643d45eb0743fa899c963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Almeida?= Date: Fri, 27 Nov 2020 14:05:14 -0300 Subject: [PATCH 0383/2542] ntdll: Call waitv just when nr_futexes > 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit futex_waitv() needs to do an extra copy from userspace compared to futex(), so use the latter when we are waiting in a single futex. Signed-off-by: André Almeida Link: https://github.com/ValveSoftware/wine/pull/128 --- dlls/ntdll/unix/fsync.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 2ee7a1d2cb92..54e45d6471ac 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -968,10 +968,18 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, tmo_p.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; tmo_p.tv_nsec = (timeleft % TICKSPERSEC) * 100; - ret = futex_wait_multiple( futexes, waitcount, &tmo_p ); + if (waitcount == 1) + ret = futex_wait( futexes[0].addr, futexes[0].val, &tmo_p ); + else + ret = futex_wait_multiple( futexes, waitcount, &tmo_p ); } else - ret = futex_wait_multiple( futexes, waitcount, NULL ); + { + if (waitcount == 1) + ret = futex_wait( futexes[0].addr, futexes[0].val, NULL ); + else + ret = futex_wait_multiple( futexes, waitcount, NULL ); + } /* FUTEX_WAIT_MULTIPLE can succeed or return -EINTR, -EAGAIN, * -EFAULT/-EACCES, -ETIMEDOUT. In the first three cases we need to From bf745d8d54183b5a256c52063c68837af10e5142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Almeida?= Date: Wed, 20 Oct 2021 10:35:58 -0300 Subject: [PATCH 0384/2542] ntdll/fsync: Encapsulate timeout conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Simplify the wait path by dealing with the timeout conversion inside of futex_wait. Signed-off-by: André Almeida Link: https://github.com/ValveSoftware/wine/pull/128 --- dlls/ntdll/unix/fsync.c | 96 ++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 53 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 54e45d6471ac..58a9e28b61c5 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -73,10 +73,32 @@ static inline void small_pause(void) #endif } +static LONGLONG update_timeout( ULONGLONG end ) +{ + LARGE_INTEGER now; + LONGLONG timeleft; + + NtQuerySystemTime( &now ); + timeleft = end - now.QuadPart; + if (timeleft < 0) timeleft = 0; + return timeleft; +} + static inline int futex_wait_multiple( const struct futex_wait_block *futexes, - int count, const struct timespec *timeout ) + int count, const ULONGLONG *end ) { - return syscall( __NR_futex, futexes, 31, count, timeout, 0, 0 ); + if (end) + { + LONGLONG timeleft = update_timeout( *end ); + struct timespec timeout; + timeout.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; + timeout.tv_nsec = (timeleft % TICKSPERSEC) * 100; + return syscall( __NR_futex, futexes, 31, count, timeout, 0, 0 ); + } + else + { + return syscall( __NR_futex, futexes, 31, count, NULL, 0, 0 ); + } } static inline int futex_wake( int *addr, int val ) @@ -84,9 +106,20 @@ static inline int futex_wake( int *addr, int val ) return syscall( __NR_futex, addr, 1, val, NULL, 0, 0 ); } -static inline int futex_wait( int *addr, int val, struct timespec *timeout ) +static inline int futex_wait( int *addr, int val, const ULONGLONG *end ) { - return syscall( __NR_futex, addr, 0, val, timeout, 0, 0 ); + if (end) + { + LONGLONG timeleft = update_timeout( *end ); + struct timespec timeout; + timeout.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; + timeout.tv_nsec = (timeleft % TICKSPERSEC) * 100; + return syscall( __NR_futex, addr, 0, val, &timeout, 0, 0 ); + } + else + { + return syscall( __NR_futex, addr, 0, val, NULL, 0, 0 ); + } } static unsigned int spincount = 100; @@ -98,7 +131,7 @@ int do_fsync(void) if (do_fsync_cached == -1) { - static const struct timespec zero; + static const ULONGLONG zero; futex_wait_multiple( NULL, 0, &zero ); do_fsync_cached = getenv("WINEFSYNC") && atoi(getenv("WINEFSYNC")) && errno != ENOSYS; if (getenv("WINEFSYNC_SPINCOUNT")) @@ -642,17 +675,6 @@ NTSTATUS fsync_query_mutex( HANDLE handle, void *info, ULONG *ret_len ) return STATUS_SUCCESS; } -static LONGLONG update_timeout( ULONGLONG end ) -{ - LARGE_INTEGER now; - LONGLONG timeleft; - - NtQuerySystemTime( &now ); - timeleft = end - now.QuadPart; - if (timeleft < 0) timeleft = 0; - return timeleft; -} - static NTSTATUS do_single_wait( int *addr, int val, ULONGLONG *end, BOOLEAN alertable ) { int ret; @@ -674,32 +696,14 @@ static NTSTATUS do_single_wait( int *addr, int val, ULONGLONG *end, BOOLEAN aler #endif futexes[0].bitset = futexes[1].bitset = ~0; - if (end) - { - LONGLONG timeleft = update_timeout( *end ); - struct timespec tmo_p; - tmo_p.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; - tmo_p.tv_nsec = (timeleft % TICKSPERSEC) * 100; - ret = futex_wait_multiple( futexes, 2, &tmo_p ); - } - else - ret = futex_wait_multiple( futexes, 2, NULL ); + ret = futex_wait_multiple( futexes, 2, end ); if (__atomic_load_n( apc_futex, __ATOMIC_SEQ_CST )) return STATUS_USER_APC; } else { - if (end) - { - LONGLONG timeleft = update_timeout( *end ); - struct timespec tmo_p; - tmo_p.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; - tmo_p.tv_nsec = (timeleft % TICKSPERSEC) * 100; - ret = futex_wait( addr, val, &tmo_p ); - } - else - ret = futex_wait( addr, val, NULL ); + ret = futex_wait( addr, val, end ); } if (!ret) @@ -961,25 +965,11 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, TRACE("Wait timed out.\n"); return STATUS_TIMEOUT; } - else if (timeout) - { - LONGLONG timeleft = update_timeout( end ); - struct timespec tmo_p; - tmo_p.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; - tmo_p.tv_nsec = (timeleft % TICKSPERSEC) * 100; - if (waitcount == 1) - ret = futex_wait( futexes[0].addr, futexes[0].val, &tmo_p ); - else - ret = futex_wait_multiple( futexes, waitcount, &tmo_p ); - } + if (waitcount == 1) + ret = futex_wait( futexes[0].addr, futexes[0].val, timeout ? &end : NULL ); else - { - if (waitcount == 1) - ret = futex_wait( futexes[0].addr, futexes[0].val, NULL ); - else - ret = futex_wait_multiple( futexes, waitcount, NULL ); - } + ret = futex_wait_multiple( futexes, waitcount, timeout ? &end : NULL ); /* FUTEX_WAIT_MULTIPLE can succeed or return -EINTR, -EAGAIN, * -EFAULT/-EACCES, -ETIMEDOUT. In the first three cases we need to From 215c3a8efa54c8c636e4ae7387498f3779c5ff97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Almeida?= Date: Thu, 21 Oct 2021 13:36:14 -0300 Subject: [PATCH 0385/2542] ntdll/fsync: Support futex_waitv() API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since an interface for wait on multiple futexes was merged, we no longer need to support different interfaces. Drop out FUTEX_WAIT_MULTIPLE (opcode 31) in favor of the futex_waitv() interface accepted by upstream Linux. Signed-off-by: André Almeida Link: https://github.com/ValveSoftware/wine/pull/128 --- dlls/ntdll/unix/fsync.c | 101 ++++++++++++++++++++-------------------- server/fsync.c | 19 ++------ 2 files changed, 55 insertions(+), 65 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 58a9e28b61c5..c72c4be6774b 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -39,6 +39,7 @@ # include #endif #include +#include #include "ntstatus.h" #define WIN32_NO_STATUS @@ -53,16 +54,30 @@ WINE_DEFAULT_DEBUG_CHANNEL(fsync); #include "pshpack4.h" -struct futex_wait_block -{ - int *addr; -#if __SIZEOF_POINTER__ == 4 - int pad; +#include "poppack.h" + +/* futex_waitv interface */ + +#ifndef __NR_futex_waitv + +# define __NR_futex_waitv 449 +# define FUTEX_32 2 +struct futex_waitv { + uint64_t val; + uint64_t uaddr; + uint32_t flags; + uint32_t __reserved; +}; + #endif - int val; - int bitset; + +#define u64_to_ptr(x) (void *)(uintptr_t)(x) + +struct timespec64 +{ + long long tv_sec; + long long tv_nsec; }; -#include "poppack.h" static inline void small_pause(void) { @@ -84,20 +99,29 @@ static LONGLONG update_timeout( ULONGLONG end ) return timeleft; } -static inline int futex_wait_multiple( const struct futex_wait_block *futexes, +static inline void futex_vector_set( struct futex_waitv *waitv, int *addr, int val ) +{ + waitv->uaddr = (uintptr_t) addr; + waitv->val = val; + waitv->flags = FUTEX_32; + waitv->__reserved = 0; +} + +static inline int futex_wait_multiple( const struct futex_waitv *futexes, int count, const ULONGLONG *end ) { if (end) { - LONGLONG timeleft = update_timeout( *end ); - struct timespec timeout; - timeout.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; - timeout.tv_nsec = (timeleft % TICKSPERSEC) * 100; - return syscall( __NR_futex, futexes, 31, count, timeout, 0, 0 ); + struct timespec64 timeout; + ULONGLONG tmp = *end - SECS_1601_TO_1970 * TICKSPERSEC; + timeout.tv_sec = tmp / (ULONGLONG)TICKSPERSEC; + timeout.tv_nsec = (tmp % TICKSPERSEC) * 100; + + return syscall( __NR_futex_waitv, futexes, count, 0, &timeout, CLOCK_REALTIME ); } else { - return syscall( __NR_futex, futexes, 31, count, NULL, 0, 0 ); + return syscall( __NR_futex_waitv, futexes, count, 0, NULL, 0 ); } } @@ -131,8 +155,7 @@ int do_fsync(void) if (do_fsync_cached == -1) { - static const ULONGLONG zero; - futex_wait_multiple( NULL, 0, &zero ); + syscall( __NR_futex_waitv, NULL, 0, 0, NULL, 0 ); do_fsync_cached = getenv("WINEFSYNC") && atoi(getenv("WINEFSYNC")) && errno != ENOSYS; if (getenv("WINEFSYNC_SPINCOUNT")) spincount = atoi(getenv("WINEFSYNC_SPINCOUNT")); @@ -682,19 +705,13 @@ static NTSTATUS do_single_wait( int *addr, int val, ULONGLONG *end, BOOLEAN aler if (alertable) { int *apc_futex = ntdll_get_thread_data()->fsync_apc_futex; - struct futex_wait_block futexes[2]; + struct futex_waitv futexes[2]; if (__atomic_load_n( apc_futex, __ATOMIC_SEQ_CST )) return STATUS_USER_APC; - futexes[0].addr = addr; - futexes[0].val = val; - futexes[1].addr = apc_futex; - futexes[1].val = 0; -#if __SIZEOF_POINTER__ == 4 - futexes[0].pad = futexes[1].pad = 0; -#endif - futexes[0].bitset = futexes[1].bitset = ~0; + futex_vector_set( &futexes[0], addr, val ); + futex_vector_set( &futexes[1], apc_futex, 0 ); ret = futex_wait_multiple( futexes, 2, end ); @@ -719,7 +736,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, { static const LARGE_INTEGER zero = {0}; - struct futex_wait_block futexes[MAXIMUM_WAIT_OBJECTS + 1]; + struct futex_waitv futexes[MAXIMUM_WAIT_OBJECTS + 1]; struct fsync *objs[MAXIMUM_WAIT_OBJECTS]; int has_fsync = 0, has_server = 0; BOOL msgwait = FALSE; @@ -849,8 +866,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, small_pause(); } - futexes[i].addr = &semaphore->count; - futexes[i].val = 0; + futex_vector_set( &futexes[i], &semaphore->count, 0 ); break; } case FSYNC_MUTEX: @@ -882,8 +898,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, small_pause(); } - futexes[i].addr = &mutex->tid; - futexes[i].val = tid; + futex_vector_set( &futexes[i], &mutex->tid, tid ); break; } case FSYNC_AUTO_EVENT: @@ -901,8 +916,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, small_pause(); } - futexes[i].addr = &event->signaled; - futexes[i].val = 0; + futex_vector_set( &futexes[i], &event->signaled, 0 ); break; } case FSYNC_MANUAL_EVENT: @@ -921,8 +935,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, small_pause(); } - futexes[i].addr = &event->signaled; - futexes[i].val = 0; + futex_vector_set( &futexes[i], &event->signaled, 0 ); break; } default: @@ -933,26 +946,14 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, else { /* Avoid breaking things entirely. */ - futexes[i].addr = &dummy_futex; - futexes[i].val = dummy_futex; + futex_vector_set( &futexes[i], &dummy_futex, dummy_futex ); } - -#if __SIZEOF_POINTER__ == 4 - futexes[i].pad = 0; -#endif - futexes[i].bitset = ~0; } if (alertable) { /* We already checked if it was signaled; don't bother doing it again. */ - futexes[i].addr = ntdll_get_thread_data()->fsync_apc_futex; - futexes[i].val = 0; -#if __SIZEOF_POINTER__ == 4 - futexes[i].pad = 0; -#endif - futexes[i].bitset = ~0; - i++; + futex_vector_set( &futexes[i++], ntdll_get_thread_data()->fsync_apc_futex, 0 ); } waitcount = i; @@ -967,7 +968,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, } if (waitcount == 1) - ret = futex_wait( futexes[0].addr, futexes[0].val, timeout ? &end : NULL ); + ret = futex_wait( u64_to_ptr(futexes[0].uaddr), futexes[0].val, timeout ? &end : NULL ); else ret = futex_wait_multiple( futexes, waitcount, timeout ? &end : NULL ); diff --git a/server/fsync.c b/server/fsync.c index 3ad59f4735f2..593070ad62e6 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -44,21 +44,11 @@ #include "fsync.h" #include "pshpack4.h" -struct futex_wait_block -{ - int *addr; -#if __SIZEOF_POINTER__ == 4 - int pad; -#endif - int val; -}; #include "poppack.h" -static inline int futex_wait_multiple( const struct futex_wait_block *futexes, - int count, const struct timespec *timeout ) -{ - return syscall( __NR_futex, futexes, 31, count, timeout, 0, 0 ); -} +#ifndef __NR_futex_waitv +#define __NR_futex_waitv 449 +#endif int do_fsync(void) { @@ -67,8 +57,7 @@ int do_fsync(void) if (do_fsync_cached == -1) { - static const struct timespec zero; - futex_wait_multiple( NULL, 0, &zero ); + syscall( __NR_futex_waitv, 0, 0, 0, 0, 0); do_fsync_cached = getenv("WINEFSYNC") && atoi(getenv("WINEFSYNC")) && errno != ENOSYS; } From c76aa58a135a36590f6d8d128d4ccb6cca06034f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Almeida?= Date: Thu, 21 Oct 2021 20:33:58 -0300 Subject: [PATCH 0386/2542] ntdll/fsync: Use absolute timeouts for futex_wait MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the FUTEX_WAIT_BITSET operation instead of FUTEX_WAIT, that allow us to use absolute timeouts rather than relative ones that requires an extra syscall to update the timeout. Signed-off-by: André Almeida Link: https://github.com/ValveSoftware/wine/pull/128 --- dlls/ntdll/unix/fsync.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index c72c4be6774b..66e2b6a6841f 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -56,6 +56,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(fsync); #include "pshpack4.h" #include "poppack.h" +#define FUTEX_WAIT_BITSET 9 +#define FUTEX_CLOCK_REALTIME 256 +#define FUTEX_BITSET_MATCH_ANY 0xffffffff + /* futex_waitv interface */ #ifndef __NR_futex_waitv @@ -134,11 +138,13 @@ static inline int futex_wait( int *addr, int val, const ULONGLONG *end ) { if (end) { - LONGLONG timeleft = update_timeout( *end ); struct timespec timeout; - timeout.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC; - timeout.tv_nsec = (timeleft % TICKSPERSEC) * 100; - return syscall( __NR_futex, addr, 0, val, &timeout, 0, 0 ); + ULONGLONG tmp = *end - SECS_1601_TO_1970 * TICKSPERSEC; + timeout.tv_sec = tmp / (ULONGLONG)TICKSPERSEC; + timeout.tv_nsec = (tmp % TICKSPERSEC) * 100; + + return syscall( __NR_futex, addr, FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME, + val, &timeout, 0, FUTEX_BITSET_MATCH_ANY ); } else { From bb25e07014b086d0a3f899de90b876bbf7c4f7be Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 1 Apr 2021 20:19:35 +0300 Subject: [PATCH 0387/2542] esync, fsync: Yield execution before alertable wait for AC Odyssey. CW-Bug-ID: #18881 --- dlls/ntdll/unix/esync.c | 11 +++++++++++ dlls/ntdll/unix/fsync.c | 9 +++++++++ dlls/ntdll/unix/loader.c | 8 ++++++++ dlls/ntdll/unix/unix_private.h | 2 ++ 4 files changed, 30 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 159d25349dc8..12d7f7e4938f 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -947,6 +947,8 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA if (event->signaled) { + if (ac_odyssey && alertable) + usleep( 0 ); if ((size = read( obj->fd, &value, sizeof(value) )) == sizeof(value)) { TRACE("Woken up by handle %p [%d].\n", handles[i], i); @@ -962,6 +964,12 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA if (event->signaled) { + if (ac_odyssey && alertable) + { + usleep( 0 ); + if (!event->signaled) + break; + } TRACE("Woken up by handle %p [%d].\n", handles[i], i); return i; } @@ -990,6 +998,9 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA while (1) { + if (ac_odyssey && alertable) + usleep( 0 ); + ret = do_poll( fds, pollcount, timeout ? &end : NULL ); if (ret > 0) { diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 66e2b6a6841f..65fc9d2ac813 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -916,6 +916,9 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, { if (__sync_val_compare_and_swap( &event->signaled, 1, 0 )) { + if (ac_odyssey && alertable) + usleep( 0 ); + TRACE("Woken up by handle %p [%d].\n", handles[i], i); return i; } @@ -935,6 +938,9 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, { if (__atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )) { + if (ac_odyssey && alertable) + usleep( 0 ); + TRACE("Woken up by handle %p [%d].\n", handles[i], i); return i; } @@ -965,6 +971,9 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, /* Looks like everything is contended, so wait. */ + if (ac_odyssey && alertable) + usleep( 0 ); + if (timeout && !timeout->QuadPart) { /* Unlike esync, we already know that we've timed out, so we diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 940f261d2988..96ea051f0deb 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2010,10 +2010,18 @@ static ULONG_PTR get_image_address(void) return 0; } +BOOL ac_odyssey; + static void hacks_init(void) { const char *sgi = getenv( "SteamGameId" ); + if (main_argc > 1 && strstr(main_argv[1], "ACOdyssey.exe")) + { + ERR("HACK: AC Odyssey sync tweak on.\n"); + ac_odyssey = TRUE; + } + switch (sgi ? atoi( sgi ) : -1) { case 25700: /* Madballs in Babo: Invasion */ diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index ac255964eb4c..054860a03a2b 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -189,6 +189,8 @@ extern SYSTEM_CPU_INFORMATION cpu_info; extern struct ldt_copy __wine_ldt_copy; #endif +extern BOOL ac_odyssey; + extern void init_environment(void); extern void init_startup_info(void); extern void *create_startup_info( const UNICODE_STRING *nt_image, ULONG process_flags, From f79a62117688106fe02eda177829987877922b39 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 6 Apr 2021 19:43:48 +0300 Subject: [PATCH 0388/2542] ntdll: Simulate async file read and IO cancellation to workaround AC:Odyssey out of order dialogues bug. CW-Bug-ID: #18881 --- dlls/ntdll/unix/file.c | 250 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 250 insertions(+) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 6d8a81e7f4fd..c3ccb3d4d302 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -5567,6 +5567,243 @@ static unsigned int set_pending_write( HANDLE device ) return status; } +static pthread_mutex_t async_file_read_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t async_file_read_cond = PTHREAD_COND_INITIALIZER; + +struct async_file_read_job +{ + HANDLE handle; + int unix_handle; + int needs_close; + HANDLE event; + IO_STATUS_BLOCK *io; + void *buffer; + ULONG length; + LARGE_INTEGER offset; + DWORD thread_id; + LONG cancelled; + struct list queue_entry; + struct async_file_read_job *next; + ULONG64 queue_time_mcs; +}; + + +static struct list async_file_read_queue = LIST_INIT( async_file_read_queue ); +static struct async_file_read_job *async_file_read_running, *async_file_read_free; + +static void async_file_complete_io( struct async_file_read_job *job, NTSTATUS status, ULONG total ) +{ + job->io->Status = status; + job->io->Information = total; + + if (job->event) NtSetEvent( job->event, NULL ); +} + +static void *async_file_read_thread(void *dummy) +{ + struct async_file_read_job *job, *ptr; + ULONG buffer_length = 0; + void *buffer = NULL; + struct list *entry; + struct timespec ts; + NTSTATUS status; + ULONG64 delay; + ULONG total; + int result; + + pthread_mutex_lock( &async_file_read_mutex ); + while (1) + { + while (!(entry = list_head( &async_file_read_queue ))) + { + pthread_cond_wait( &async_file_read_cond, &async_file_read_mutex ); + continue; + } + + job = LIST_ENTRY( entry, struct async_file_read_job, queue_entry ); + list_remove( entry ); + + total = 0; + + if ( job->cancelled ) + { + pthread_mutex_unlock( &async_file_read_mutex ); + status = STATUS_CANCELLED; + goto done; + } + + job->next = async_file_read_running; + async_file_read_running = job; + pthread_mutex_unlock( &async_file_read_mutex ); + + if (!buffer_length) + { + buffer = malloc(job->length); + buffer_length = job->length; + } + else if (buffer_length < job->length) + { + buffer = realloc(buffer, job->length); + buffer_length = job->length; + } + + while ((result = pread( job->unix_handle, buffer, job->length, job->offset.QuadPart )) == -1) + { + if (errno != EINTR) + { + status = errno_to_status( errno ); + goto done; + } + if (job->cancelled) + break; + } + + clock_gettime( CLOCK_MONOTONIC, &ts ); + delay = ts.tv_sec * (ULONG64)1000000 + ts.tv_nsec / 1000 - job->queue_time_mcs; + if (delay < 1000) + usleep( 1000 - delay ); + else + usleep( 50 ); + + total = result; + status = (total || !job->length) ? STATUS_SUCCESS : STATUS_END_OF_FILE; +done: + if (job->needs_close) close( job->unix_handle ); + + if (!InterlockedCompareExchange(&job->cancelled, 1, 0)) + { + if (status == STATUS_SUCCESS) + memcpy( job->buffer, buffer, total ); + + async_file_complete_io( job, status, total ); + } + + pthread_mutex_lock( &async_file_read_mutex ); + + if (status != STATUS_CANCELLED) + { + ptr = async_file_read_running; + if (job == ptr) + { + async_file_read_running = job->next; + } + else + { + while (ptr && ptr->next != job) + ptr = ptr->next; + + assert( ptr ); + ptr->next = job->next; + } + } + + job->next = async_file_read_free; + async_file_read_free = job; + } + + return NULL; +} + +static pthread_once_t async_file_read_once = PTHREAD_ONCE_INIT; + +static void async_file_read_init(void) +{ + pthread_t async_file_read_thread_id; + pthread_attr_t pthread_attr; + + ERR("HACK: AC Odyssey async read workaround.\n"); + + pthread_attr_init( &pthread_attr ); + pthread_attr_setscope( &pthread_attr, PTHREAD_SCOPE_SYSTEM ); + pthread_attr_setdetachstate( &pthread_attr, PTHREAD_CREATE_DETACHED ); + + pthread_create( &async_file_read_thread_id, &pthread_attr, (void * (*)(void *))async_file_read_thread, NULL); + pthread_attr_destroy( &pthread_attr ); +} + +static NTSTATUS queue_async_file_read( HANDLE handle, int unix_handle, int needs_close, HANDLE event, + IO_STATUS_BLOCK *io, void *buffer, ULONG length, LARGE_INTEGER *offset ) +{ + struct async_file_read_job *job; + struct timespec ts; + + pthread_once( &async_file_read_once, async_file_read_init ); + + NtResetEvent( event, NULL ); + + pthread_mutex_lock( &async_file_read_mutex ); + + if (async_file_read_free) + { + job = async_file_read_free; + async_file_read_free = async_file_read_free->next; + } + else + { + if (!(job = malloc( sizeof(*job) ))) + { + pthread_mutex_unlock( &async_file_read_mutex ); + return STATUS_NO_MEMORY; + } + } + + job->handle = handle; + job->unix_handle = unix_handle; + job->needs_close = needs_close; + job->event = event; + job->io = io; + job->buffer = buffer; + job->length = length; + job->offset = *offset; + job->thread_id = GetCurrentThreadId(); + job->cancelled = 0; + clock_gettime( CLOCK_MONOTONIC, &ts ); + job->queue_time_mcs = ts.tv_sec * (ULONG64)1000000 + ts.tv_nsec / 1000; + + list_add_tail( &async_file_read_queue, &job->queue_entry ); + + pthread_cond_signal( &async_file_read_cond ); + pthread_mutex_unlock( &async_file_read_mutex ); + + return STATUS_PENDING; +} + +static NTSTATUS cancel_async_file_read( HANDLE handle, IO_STATUS_BLOCK *io ) +{ + DWORD thread_id = GetCurrentThreadId(); + struct async_file_read_job *job; + unsigned int count = 0; + + TRACE( "handle %p, io %p.\n", handle, io ); + + pthread_mutex_lock( &async_file_read_mutex ); + job = async_file_read_running; + while (job) + { + if (((io && job->io == io) + || (!io && job->handle == handle && job->thread_id == thread_id)) + && !InterlockedCompareExchange(&job->cancelled, 1, 0)) + { + async_file_complete_io( job, STATUS_CANCELLED, 0 ); + ++count; + } + job = job->next; + } + + LIST_FOR_EACH_ENTRY( job, &async_file_read_queue, struct async_file_read_job, queue_entry ) + { + if (((io && job->io == io) + || (!io && job->handle == handle && job->thread_id == thread_id)) + && !InterlockedCompareExchange(&job->cancelled, 1, 0)) + { + async_file_complete_io( job, STATUS_CANCELLED, 0 ); + ++count; + } + } + + pthread_mutex_unlock( &async_file_read_mutex ); + return count ? STATUS_SUCCESS : STATUS_NOT_FOUND; +} /****************************************************************************** * NtReadFile (NTDLL.@) @@ -5608,6 +5845,13 @@ NTSTATUS WINAPI NtReadFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, vo goto done; } + if (ac_odyssey && async_read && length && event && !apc) + { + status = queue_async_file_read( handle, unix_handle, needs_close, event, io, buffer, length, offset ); + needs_close = 0; + goto err; + } + if (offset && offset->QuadPart != FILE_USE_FILE_POINTER_POSITION) { /* async I/O doesn't make sense on regular files */ @@ -6431,6 +6675,9 @@ NTSTATUS WINAPI NtCancelIoFile( HANDLE handle, IO_STATUS_BLOCK *io_status ) TRACE( "%p %p\n", handle, io_status ); + if (ac_odyssey && !cancel_async_file_read( handle, NULL )) + return (io_status->Status = STATUS_SUCCESS); + SERVER_START_REQ( cancel_async ) { req->handle = wine_server_obj_handle( handle ); @@ -6456,6 +6703,9 @@ NTSTATUS WINAPI NtCancelIoFileEx( HANDLE handle, IO_STATUS_BLOCK *io, IO_STATUS_ TRACE( "%p %p %p\n", handle, io, io_status ); + if (ac_odyssey && !cancel_async_file_read( handle, io )) + return (io_status->Status = STATUS_SUCCESS); + SERVER_START_REQ( cancel_async ) { req->handle = wine_server_obj_handle( handle ); From 9050415eeb54328e841a6d27a0a98b3ca20f7286 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 15 Feb 2022 17:20:40 +0300 Subject: [PATCH 0389/2542] fsync: Add WINE_FSYNC_SIMULATE_SCHED_QUANTUM config option. And auto enable it for Uplay laucher. CW-Bug-Id: #20155 --- dlls/ntdll/unix/fsync.c | 17 ++++++++++++++++- dlls/ntdll/unix/loader.c | 9 +++++++++ dlls/ntdll/unix/unix_private.h | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 65fc9d2ac813..193bd37e6b8b 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -111,6 +111,15 @@ static inline void futex_vector_set( struct futex_waitv *waitv, int *addr, int v waitv->__reserved = 0; } +static void simulate_sched_quantum(void) +{ + if (!fsync_simulate_sched_quantum) return; + /* futex wait is often very quick to resume a waiting thread when woken. + * That reveals synchonization bugs in some games which happen to work on + * Windows due to the waiting threads having some minimal delay to wake up. */ + usleep(0); +} + static inline int futex_wait_multiple( const struct futex_waitv *futexes, int count, const ULONGLONG *end ) { @@ -744,8 +753,8 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, struct futex_waitv futexes[MAXIMUM_WAIT_OBJECTS + 1]; struct fsync *objs[MAXIMUM_WAIT_OBJECTS]; + BOOL msgwait = FALSE, waited = FALSE; int has_fsync = 0, has_server = 0; - BOOL msgwait = FALSE; int dummy_futex = 0; unsigned int spin; LONGLONG timeleft; @@ -867,6 +876,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, && __sync_val_compare_and_swap( &semaphore->count, current, current - 1 ) == current) { TRACE("Woken up by handle %p [%d].\n", handles[i], i); + if (waited) simulate_sched_quantum(); return i; } small_pause(); @@ -884,6 +894,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, { TRACE("Woken up by handle %p [%d].\n", handles[i], i); mutex->count++; + if (waited) simulate_sched_quantum(); return i; } @@ -893,6 +904,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, { TRACE("Woken up by handle %p [%d].\n", handles[i], i); mutex->count = 1; + if (waited) simulate_sched_quantum(); return i; } else if (tid == ~0 && (tid = __sync_val_compare_and_swap( &mutex->tid, ~0, GetCurrentThreadId() )) == ~0) @@ -920,6 +932,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, usleep( 0 ); TRACE("Woken up by handle %p [%d].\n", handles[i], i); + if (waited) simulate_sched_quantum(); return i; } small_pause(); @@ -942,6 +955,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, usleep( 0 ); TRACE("Woken up by handle %p [%d].\n", handles[i], i); + if (waited) simulate_sched_quantum(); return i; } small_pause(); @@ -996,6 +1010,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, TRACE("Wait timed out.\n"); return STATUS_TIMEOUT; } + else waited = TRUE; } /* while (1) */ } else diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 96ea051f0deb..5c7f980b1949 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2011,16 +2011,25 @@ static ULONG_PTR get_image_address(void) } BOOL ac_odyssey; +BOOL fsync_simulate_sched_quantum; static void hacks_init(void) { const char *sgi = getenv( "SteamGameId" ); + const char *env_str; if (main_argc > 1 && strstr(main_argv[1], "ACOdyssey.exe")) { ERR("HACK: AC Odyssey sync tweak on.\n"); ac_odyssey = TRUE; } + env_str = getenv("WINE_FSYNC_SIMULATE_SCHED_QUANTUM"); + if (env_str) + fsync_simulate_sched_quantum = !!atoi(env_str); + else if (main_argc > 1) + fsync_simulate_sched_quantum = !!strstr(main_argv[1], "Ubisoft Game Launcher\\upc.exe"); + if (fsync_simulate_sched_quantum) + ERR("HACK: Simulating sched quantum in fsync.\n"); switch (sgi ? atoi( sgi ) : -1) { diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 054860a03a2b..1a13ba34664e 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -190,6 +190,7 @@ extern struct ldt_copy __wine_ldt_copy; #endif extern BOOL ac_odyssey; +extern BOOL fsync_simulate_sched_quantum; extern void init_environment(void); extern void init_startup_info(void); From faa6688d8f8dd3116eb1b376133cd209aef5d5a3 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 2 Feb 2022 17:02:44 -0500 Subject: [PATCH 0390/2542] esync: Type-check HANDLE in esync_set_event. Signed-off-by: Derek Lesho --- dlls/ntdll/unix/esync.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 12d7f7e4938f..7b85981cd772 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -525,6 +525,9 @@ NTSTATUS esync_set_event( HANDLE handle ) if ((ret = get_object( handle, &obj ))) return ret; event = obj->shm; + if (obj->type != ESYNC_MANUAL_EVENT && obj->type != ESYNC_AUTO_EVENT) + return STATUS_OBJECT_TYPE_MISMATCH; + if (obj->type == ESYNC_MANUAL_EVENT) { /* Acquire the spinlock. */ From 205d875392a92e6fec5b26d11ea4a1a10eb64843 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Mon, 14 Feb 2022 12:51:27 -0500 Subject: [PATCH 0391/2542] fsync: Type-check HANDLE in fsync_set_event(). Signed-off-by: Derek Lesho --- dlls/ntdll/unix/fsync.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 193bd37e6b8b..f9b75fd2fafc 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -576,6 +576,9 @@ NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ) if ((ret = get_object( handle, &obj ))) return ret; event = obj->shm; + if (obj->type != FSYNC_MANUAL_EVENT && obj->type != FSYNC_AUTO_EVENT) + return STATUS_OBJECT_TYPE_MISMATCH; + if (!(current = __atomic_exchange_n( &event->signaled, 1, __ATOMIC_SEQ_CST ))) futex_wake( &event->signaled, INT_MAX ); From d9623a6d261ffce7f13307774de5e00746d8ad04 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 18 Feb 2022 12:56:58 +0300 Subject: [PATCH 0392/2542] fsync: Fix semaphore grab attempt on wait all path. CW-Bug-Id: #20189 --- dlls/ntdll/unix/fsync.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index f9b75fd2fafc..321a6b5a79ad 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -1137,7 +1137,10 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, case FSYNC_SEMAPHORE: { struct semaphore *semaphore = obj->shm; - if (__sync_fetch_and_sub( &semaphore->count, 1 ) <= 0) + int current; + + if (!(current = __atomic_load_n( &semaphore->count, __ATOMIC_SEQ_CST )) + || __sync_val_compare_and_swap( &semaphore->count, current, current - 1 ) != current) goto tooslow; break; } From 408256981ef1afae0eea8a7559ca7cd08c374788 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 18 Feb 2022 12:58:53 +0300 Subject: [PATCH 0393/2542] fsync: Always check for NULL object on wait all path. CW-Bug-Id: #20189 --- dlls/ntdll/unix/fsync.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 321a6b5a79ad..c386b7484307 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -1118,6 +1118,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, for (i = 0; i < count; i++) { struct fsync *obj = objs[i]; + if (!obj) continue; switch (obj->type) { case FSYNC_MUTEX: @@ -1182,6 +1183,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, for (--i; i >= 0; i--) { struct fsync *obj = objs[i]; + if (!obj) continue; switch (obj->type) { case FSYNC_MUTEX: From 43db61248229205efed8dff06252add3460e426d Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 18 Feb 2022 13:04:01 +0300 Subject: [PATCH 0394/2542] fsync: Get rid of spin before futex wait. CW-Bug-Id: #20189 --- dlls/ntdll/unix/fsync.c | 99 +++++++++++++---------------------------- 1 file changed, 31 insertions(+), 68 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index c386b7484307..dc974a7e4d18 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -83,15 +83,6 @@ struct timespec64 long long tv_nsec; }; -static inline void small_pause(void) -{ -#if defined(__i386__) || defined(__x86_64__) - __asm__ __volatile__( "rep;nop" : : : "memory" ); -#else - __asm__ __volatile__( "" : : : "memory" ); -#endif -} - static LONGLONG update_timeout( ULONGLONG end ) { LARGE_INTEGER now; @@ -153,7 +144,7 @@ static inline int futex_wait( int *addr, int val, const ULONGLONG *end ) timeout.tv_nsec = (tmp % TICKSPERSEC) * 100; return syscall( __NR_futex, addr, FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME, - val, &timeout, 0, FUTEX_BITSET_MATCH_ANY ); + val, &timeout, 0, FUTEX_BITSET_MATCH_ANY ); } else { @@ -161,8 +152,6 @@ static inline int futex_wait( int *addr, int val, const ULONGLONG *end ) } } -static unsigned int spincount = 100; - int do_fsync(void) { #ifdef __linux__ @@ -172,8 +161,6 @@ int do_fsync(void) { syscall( __NR_futex_waitv, NULL, 0, 0, NULL, 0 ); do_fsync_cached = getenv("WINEFSYNC") && atoi(getenv("WINEFSYNC")) && errno != ENOSYS; - if (getenv("WINEFSYNC_SPINCOUNT")) - spincount = atoi(getenv("WINEFSYNC_SPINCOUNT")); } return do_fsync_cached; @@ -759,7 +746,6 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, BOOL msgwait = FALSE, waited = FALSE; int has_fsync = 0, has_server = 0; int dummy_futex = 0; - unsigned int spin; LONGLONG timeleft; LARGE_INTEGER now; DWORD waitcount; @@ -869,22 +855,13 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, struct semaphore *semaphore = obj->shm; int current; - /* It would be a little clearer (and less error-prone) - * to use a dedicated interlocked_dec_if_nonzero() - * helper, but nesting loops like that is probably not - * great for performance... */ - for (spin = 0; spin <= spincount || current; ++spin) + if ((current = __atomic_load_n( &semaphore->count, __ATOMIC_SEQ_CST )) + && __sync_val_compare_and_swap( &semaphore->count, current, current - 1 ) == current) { - if ((current = __atomic_load_n( &semaphore->count, __ATOMIC_SEQ_CST )) - && __sync_val_compare_and_swap( &semaphore->count, current, current - 1 ) == current) - { - TRACE("Woken up by handle %p [%d].\n", handles[i], i); - if (waited) simulate_sched_quantum(); - return i; - } - small_pause(); + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + if (waited) simulate_sched_quantum(); + return i; } - futex_vector_set( &futexes[i], &semaphore->count, 0 ); break; } @@ -901,22 +878,18 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, return i; } - for (spin = 0; spin <= spincount; ++spin) + if (!(tid = __sync_val_compare_and_swap( &mutex->tid, 0, GetCurrentThreadId() ))) { - if (!(tid = __sync_val_compare_and_swap( &mutex->tid, 0, GetCurrentThreadId() ))) - { - TRACE("Woken up by handle %p [%d].\n", handles[i], i); - mutex->count = 1; - if (waited) simulate_sched_quantum(); - return i; - } - else if (tid == ~0 && (tid = __sync_val_compare_and_swap( &mutex->tid, ~0, GetCurrentThreadId() )) == ~0) - { - TRACE("Woken up by abandoned mutex %p [%d].\n", handles[i], i); - mutex->count = 1; - return STATUS_ABANDONED_WAIT_0 + i; - } - small_pause(); + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + mutex->count = 1; + if (waited) simulate_sched_quantum(); + return i; + } + else if (tid == ~0 && (tid = __sync_val_compare_and_swap( &mutex->tid, ~0, GetCurrentThreadId() )) == ~0) + { + TRACE("Woken up by abandoned mutex %p [%d].\n", handles[i], i); + mutex->count = 1; + return STATUS_ABANDONED_WAIT_0 + i; } futex_vector_set( &futexes[i], &mutex->tid, tid ); @@ -927,20 +900,15 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, { struct event *event = obj->shm; - for (spin = 0; spin <= spincount; ++spin) + if (__sync_val_compare_and_swap( &event->signaled, 1, 0 )) { - if (__sync_val_compare_and_swap( &event->signaled, 1, 0 )) - { - if (ac_odyssey && alertable) - usleep( 0 ); - - TRACE("Woken up by handle %p [%d].\n", handles[i], i); - if (waited) simulate_sched_quantum(); - return i; - } - small_pause(); - } + if (ac_odyssey && alertable) + usleep( 0 ); + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + if (waited) simulate_sched_quantum(); + return i; + } futex_vector_set( &futexes[i], &event->signaled, 0 ); break; } @@ -950,20 +918,15 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, { struct event *event = obj->shm; - for (spin = 0; spin <= spincount; ++spin) + if (__atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )) { - if (__atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )) - { - if (ac_odyssey && alertable) - usleep( 0 ); - - TRACE("Woken up by handle %p [%d].\n", handles[i], i); - if (waited) simulate_sched_quantum(); - return i; - } - small_pause(); - } + if (ac_odyssey && alertable) + usleep( 0 ); + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + if (waited) simulate_sched_quantum(); + return i; + } futex_vector_set( &futexes[i], &event->signaled, 0 ); break; } From 68d0506ef220de5b13e8d792494e7b8d46a6bdfe Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 18 Feb 2022 12:46:59 +0300 Subject: [PATCH 0395/2542] fsync: Always use futex_waitv for wait. CW-Bug-Id: #20189 --- dlls/ntdll/unix/fsync.c | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index dc974a7e4d18..64eed0c1e237 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -56,10 +56,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(fsync); #include "pshpack4.h" #include "poppack.h" -#define FUTEX_WAIT_BITSET 9 -#define FUTEX_CLOCK_REALTIME 256 -#define FUTEX_BITSET_MATCH_ANY 0xffffffff - /* futex_waitv interface */ #ifndef __NR_futex_waitv @@ -134,24 +130,6 @@ static inline int futex_wake( int *addr, int val ) return syscall( __NR_futex, addr, 1, val, NULL, 0, 0 ); } -static inline int futex_wait( int *addr, int val, const ULONGLONG *end ) -{ - if (end) - { - struct timespec timeout; - ULONGLONG tmp = *end - SECS_1601_TO_1970 * TICKSPERSEC; - timeout.tv_sec = tmp / (ULONGLONG)TICKSPERSEC; - timeout.tv_nsec = (tmp % TICKSPERSEC) * 100; - - return syscall( __NR_futex, addr, FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME, - val, &timeout, 0, FUTEX_BITSET_MATCH_ANY ); - } - else - { - return syscall( __NR_futex, addr, 0, val, NULL, 0, 0 ); - } -} - int do_fsync(void) { #ifdef __linux__ @@ -705,17 +683,18 @@ NTSTATUS fsync_query_mutex( HANDLE handle, void *info, ULONG *ret_len ) static NTSTATUS do_single_wait( int *addr, int val, ULONGLONG *end, BOOLEAN alertable ) { + struct futex_waitv futexes[2]; int ret; + futex_vector_set( &futexes[0], addr, val ); + if (alertable) { int *apc_futex = ntdll_get_thread_data()->fsync_apc_futex; - struct futex_waitv futexes[2]; if (__atomic_load_n( apc_futex, __ATOMIC_SEQ_CST )) return STATUS_USER_APC; - futex_vector_set( &futexes[0], addr, val ); futex_vector_set( &futexes[1], apc_futex, 0 ); ret = futex_wait_multiple( futexes, 2, end ); @@ -725,7 +704,7 @@ static NTSTATUS do_single_wait( int *addr, int val, ULONGLONG *end, BOOLEAN aler } else { - ret = futex_wait( addr, val, end ); + ret = futex_wait_multiple( futexes, 1, end ); } if (!ret) @@ -962,10 +941,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, return STATUS_TIMEOUT; } - if (waitcount == 1) - ret = futex_wait( u64_to_ptr(futexes[0].uaddr), futexes[0].val, timeout ? &end : NULL ); - else - ret = futex_wait_multiple( futexes, waitcount, timeout ? &end : NULL ); + ret = futex_wait_multiple( futexes, waitcount, timeout ? &end : NULL ); /* FUTEX_WAIT_MULTIPLE can succeed or return -EINTR, -EAGAIN, * -EFAULT/-EACCES, -ETIMEDOUT. In the first three cases we need to From 8baac1ccb853ed01cd55ad3299d5657276335e34 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 21 Feb 2022 12:32:49 -0600 Subject: [PATCH 0396/2542] ntdll: Include linux/futex.h in fsync.c. --- configure.ac | 1 + dlls/ntdll/unix/fsync.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index 992c41b3a22c..668387ec5706 100644 --- a/configure.ac +++ b/configure.ac @@ -378,6 +378,7 @@ AC_CHECK_HEADERS(\ link.h \ linux/cdrom.h \ linux/filter.h \ + linux/futex.h \ linux/hdreg.h \ linux/hidraw.h \ linux/input.h \ diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 64eed0c1e237..f620b5caff82 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -38,6 +38,9 @@ #ifdef HAVE_SYS_SYSCALL_H # include #endif +#ifdef HAVE_LINUX_FUTEX_H +# include +#endif #include #include From 308cabe6f9fb44bb3f42fcf4b5c51c7d3e76644f Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 27 Apr 2022 15:52:53 -0500 Subject: [PATCH 0397/2542] fsync: Reuse shared mem indices. CW-Bug-Id: #20560 --- server/console.c | 1 + server/device.c | 2 ++ server/event.c | 2 ++ server/fd.c | 1 + server/fsync.c | 66 +++++++++++++++++++++++++++++++++++++++++++++--- server/fsync.h | 1 + server/process.c | 1 + server/queue.c | 1 + server/thread.c | 7 +++++ server/timer.c | 2 ++ 10 files changed, 81 insertions(+), 3 deletions(-) diff --git a/server/console.c b/server/console.c index 3330651680a6..58ec10fa8564 100644 --- a/server/console.c +++ b/server/console.c @@ -903,6 +903,7 @@ static void console_server_destroy( struct object *obj ) disconnect_console_server( server ); if (server->fd) release_object( server->fd ); if (do_esync()) close( server->esync_fd ); + if (server->fsync_idx) fsync_free_shm_idx( server->fsync_idx ); } static struct object *console_server_lookup_name( struct object *obj, struct unicode_str *name, diff --git a/server/device.c b/server/device.c index 40795d480b51..20950f507101 100644 --- a/server/device.c +++ b/server/device.c @@ -854,6 +854,7 @@ static void device_manager_destroy( struct object *obj ) if (do_esync()) close( manager->esync_fd ); + if (manager->fsync_idx) fsync_free_shm_idx( manager->fsync_idx ); } static struct device_manager *create_device_manager(void) @@ -866,6 +867,7 @@ static struct device_manager *create_device_manager(void) list_init( &manager->devices ); list_init( &manager->requests ); wine_rb_init( &manager->kernel_objects, compare_kernel_object ); + manager->fsync_idx = 0; if (do_fsync()) manager->fsync_idx = fsync_alloc_shm( 0, 0 ); diff --git a/server/event.c b/server/event.c index a0a1495145cd..be120695e6e3 100644 --- a/server/event.c +++ b/server/event.c @@ -161,6 +161,7 @@ struct event *create_event( struct object *root, const struct unicode_str *name, list_init( &event->kernel_object ); event->manual_reset = manual_reset; event->signaled = initial_state; + event->fsync_idx = 0; if (do_fsync()) event->fsync_idx = fsync_alloc_shm( initial_state, 0 ); @@ -300,6 +301,7 @@ static void event_destroy( struct object *obj ) if (do_esync()) close( event->esync_fd ); + if (event->fsync_idx) fsync_free_shm_idx( event->fsync_idx ); } struct keyed_event *create_keyed_event( struct object *root, const struct unicode_str *name, diff --git a/server/fd.c b/server/fd.c index 2d4ec26d1c6f..1843d4ca48ce 100644 --- a/server/fd.c +++ b/server/fd.c @@ -1587,6 +1587,7 @@ static void fd_destroy( struct object *obj ) if (do_esync()) close( fd->esync_fd ); + if (fd->fsync_idx) fsync_free_shm_idx( fd->fsync_idx ); } /* check if the desired access is possible without violating */ diff --git a/server/fsync.c b/server/fsync.c index 593070ad62e6..3c1e709d7e36 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -26,6 +26,7 @@ #include #include #include +#include #ifdef HAVE_SYS_STAT_H # include #endif @@ -76,6 +77,12 @@ static long pagesize; static int is_fsync_initialized; +static uint64_t *shm_idx_free_map; +static uint32_t shm_idx_free_map_size; /* uint64_t word count */ +static uint32_t shm_idx_free_search_start_hint; + +#define BITS_IN_FREE_MAP_WORD (8 * sizeof(*shm_idx_free_map)) + static void shm_cleanup(void) { close( shm_fd ); @@ -115,6 +122,11 @@ void fsync_init(void) fprintf( stderr, "fsync: up and running.\n" ); + shm_idx_free_map_size = 256; + shm_idx_free_map = malloc( shm_idx_free_map_size * sizeof(*shm_idx_free_map) ); + memset( shm_idx_free_map, 0xff, shm_idx_free_map_size * sizeof(*shm_idx_free_map) ); + shm_idx_free_map[0] &= ~(uint64_t)1; /* Avoid allocating shm_index 0. */ + atexit( shm_cleanup ); } @@ -188,6 +200,7 @@ static void fsync_destroy( struct object *obj ) struct fsync *fsync = (struct fsync *)obj; if (fsync->type == FSYNC_MUTEX) list_remove( &fsync->mutex_entry ); + fsync_free_shm_idx( fsync->shm_idx ); } static void *get_shm( unsigned int idx ) @@ -226,12 +239,22 @@ static void *get_shm( unsigned int idx ) return (void *)((unsigned long)shm_addrs[entry] + offset); } -/* FIXME: This is rather inefficient... */ -static unsigned int shm_idx_counter = 1; +static int alloc_shm_idx_from_word( unsigned int word_index ) +{ + int ret; + + if (!shm_idx_free_map[word_index]) return 0; + + ret = __builtin_ctzll( shm_idx_free_map[word_index] ); + shm_idx_free_map[word_index] &= ~((uint64_t)1 << ret); + shm_idx_free_search_start_hint = shm_idx_free_map[word_index] ? word_index : word_index + 1; + return word_index * BITS_IN_FREE_MAP_WORD + ret; +} unsigned int fsync_alloc_shm( int low, int high ) { #ifdef __linux__ + unsigned int i; int shm_idx; int *shm; @@ -240,7 +263,29 @@ unsigned int fsync_alloc_shm( int low, int high ) if (!is_fsync_initialized) return 0; - shm_idx = shm_idx_counter++; + /* shm_idx_free_search_start_hint is always at the first word with a free index or before that. */ + for (i = shm_idx_free_search_start_hint; i < shm_idx_free_map_size; ++i) + if ((shm_idx = alloc_shm_idx_from_word( i ))) break; + + if (!shm_idx) + { + uint32_t old_size, new_size; + uint64_t *new_alloc; + + old_size = shm_idx_free_map_size; + new_size = old_size + 256; + new_alloc = realloc( shm_idx_free_map, new_size * sizeof(*new_alloc) ); + if (!new_alloc) + { + fprintf( stderr, "fsync: couldn't expand shm_idx_free_map to size %zd.", + new_size * sizeof(*new_alloc) ); + return 0; + } + memset( new_alloc + old_size, 0xff, (new_size - old_size) * sizeof(*new_alloc) ); + shm_idx_free_map = new_alloc; + shm_idx_free_map_size = new_size; + shm_idx = alloc_shm_idx_from_word( old_size ); + } while (shm_idx * 8 >= shm_size) { @@ -265,6 +310,21 @@ unsigned int fsync_alloc_shm( int low, int high ) #endif } +void fsync_free_shm_idx( int shm_idx ) +{ + unsigned int idx; + uint64_t mask; + + assert( shm_idx ); + assert( shm_idx < shm_idx_free_map_size * BITS_IN_FREE_MAP_WORD ); + idx = shm_idx / BITS_IN_FREE_MAP_WORD; + mask = (uint64_t)1 << (shm_idx % BITS_IN_FREE_MAP_WORD); + assert( !(shm_idx_free_map[idx] & mask) ); + shm_idx_free_map[idx] |= mask; + if (idx < shm_idx_free_search_start_hint) + shm_idx_free_search_start_hint = idx; +} + static int type_matches( enum fsync_type type1, enum fsync_type type2 ) { return (type1 == type2) || diff --git a/server/fsync.h b/server/fsync.h index a91939b7f0a7..ee1a729e77e5 100644 --- a/server/fsync.h +++ b/server/fsync.h @@ -21,6 +21,7 @@ extern int do_fsync(void); extern void fsync_init(void); extern unsigned int fsync_alloc_shm( int low, int high ); +extern void fsync_free_shm_idx( int shm_idx ); extern void fsync_wake_futex( unsigned int shm_idx ); extern void fsync_clear_futex( unsigned int shm_idx ); extern void fsync_wake_up( struct object *obj ); diff --git a/server/process.c b/server/process.c index d47ff12449ef..d322a53593a6 100644 --- a/server/process.c +++ b/server/process.c @@ -803,6 +803,7 @@ static void process_destroy( struct object *obj ) free( process->dir_cache ); free( process->image ); if (do_esync()) close( process->esync_fd ); + if (process->fsync_idx) fsync_free_shm_idx( process->fsync_idx ); } /* dump a process on stdout for debugging purposes */ diff --git a/server/queue.c b/server/queue.c index c62a40a7c70e..4689a0ba4c9b 100644 --- a/server/queue.c +++ b/server/queue.c @@ -1388,6 +1388,7 @@ static void msg_queue_destroy( struct object *obj ) if (queue->fd) release_object( queue->fd ); if (queue->shared) free_shared_object( queue->shared ); if (do_esync()) close( queue->esync_fd ); + if (queue->fsync_idx) fsync_free_shm_idx( queue->fsync_idx ); } static void msg_queue_poll_event( struct fd *fd, int event ) diff --git a/server/thread.c b/server/thread.c index e4c4d3a50bd9..5a642870ab20 100644 --- a/server/thread.c +++ b/server/thread.c @@ -433,6 +433,8 @@ struct thread *create_thread( int fd, struct process *process, const struct secu } } + thread->fsync_idx = 0; + if (do_fsync()) { thread->fsync_idx = fsync_alloc_shm( 0, 0 ); @@ -527,6 +529,11 @@ static void destroy_thread( struct object *obj ) if (do_esync()) close( thread->esync_fd ); + if (thread->fsync_idx) + { + fsync_free_shm_idx( thread->fsync_idx ); + fsync_free_shm_idx( thread->fsync_apc_idx ); + } } /* dump a thread on stdout for debugging purposes */ diff --git a/server/timer.c b/server/timer.c index b614c49bd552..53286dbc56c6 100644 --- a/server/timer.c +++ b/server/timer.c @@ -119,6 +119,7 @@ static struct timer *create_timer( struct object *root, const struct unicode_str timer->timeout = NULL; timer->thread = NULL; timer->esync_fd = -1; + timer->fsync_idx = 0; if (do_fsync()) timer->fsync_idx = fsync_alloc_shm( 0, 0 ); @@ -258,6 +259,7 @@ static void timer_destroy( struct object *obj ) if (timer->timeout) remove_timeout_user( timer->timeout ); if (timer->thread) release_object( timer->thread ); if (do_esync()) close( timer->esync_fd ); + if (timer->fsync_idx) fsync_free_shm_idx( timer->fsync_idx ); } /* create a timer */ From 071175a3d424805a09c781eab9a7189ddb202abf Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 29 Apr 2022 16:57:13 -0500 Subject: [PATCH 0398/2542] fsync: Use CLOCK_MONOTONIC for relative timeouts. CW-Bug-Id: #20548 Test shows that relative wait timeouts on Windows do not include the time spent is suspend. Using CLOCK_MONOTONIC on Linux is a closer approximation for that. --- dlls/ntdll/unix/fsync.c | 88 +++++++++++++++++++++++++---------------- 1 file changed, 54 insertions(+), 34 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index f620b5caff82..f83b17d47107 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -82,13 +82,50 @@ struct timespec64 long long tv_nsec; }; -static LONGLONG update_timeout( ULONGLONG end ) +static LONGLONG nt_time_from_ts( struct timespec *ts ) { - LARGE_INTEGER now; + return ticks_from_time_t( ts->tv_sec ) + (ts->tv_nsec + 50) / 100; +} + +static void get_wait_end_time( const LARGE_INTEGER **timeout, struct timespec64 *end, clockid_t *clock_id ) +{ + ULONGLONG nt_end; + + if (!*timeout) return; + if ((*timeout)->QuadPart == TIMEOUT_INFINITE) + { + *timeout = NULL; + return; + } + + if ((*timeout)->QuadPart > 0) + { + nt_end = (*timeout)->QuadPart; + *clock_id = CLOCK_REALTIME; + } + else + { + struct timespec ts; + + clock_gettime( CLOCK_MONOTONIC, &ts ); + nt_end = nt_time_from_ts( &ts ) - (*timeout)->QuadPart; + *clock_id = CLOCK_MONOTONIC; + } + + nt_end -= SECS_1601_TO_1970 * TICKSPERSEC; + end->tv_sec = nt_end / (ULONGLONG)TICKSPERSEC; + end->tv_nsec = (nt_end % TICKSPERSEC) * 100; +} + +static LONGLONG update_timeout( const struct timespec64 *end, clockid_t clock_id ) +{ + struct timespec end_ts, ts; LONGLONG timeleft; - NtQuerySystemTime( &now ); - timeleft = end - now.QuadPart; + clock_gettime( clock_id, &ts ); + end_ts.tv_sec = end->tv_sec; + end_ts.tv_nsec = end->tv_nsec; + timeleft = nt_time_from_ts( &end_ts ) - nt_time_from_ts( &ts ); if (timeleft < 0) timeleft = 0; return timeleft; } @@ -111,21 +148,12 @@ static void simulate_sched_quantum(void) } static inline int futex_wait_multiple( const struct futex_waitv *futexes, - int count, const ULONGLONG *end ) + int count, const struct timespec64 *end, clockid_t clock_id ) { if (end) - { - struct timespec64 timeout; - ULONGLONG tmp = *end - SECS_1601_TO_1970 * TICKSPERSEC; - timeout.tv_sec = tmp / (ULONGLONG)TICKSPERSEC; - timeout.tv_nsec = (tmp % TICKSPERSEC) * 100; - - return syscall( __NR_futex_waitv, futexes, count, 0, &timeout, CLOCK_REALTIME ); - } + return syscall( __NR_futex_waitv, futexes, count, 0, end, clock_id ); else - { return syscall( __NR_futex_waitv, futexes, count, 0, NULL, 0 ); - } } static inline int futex_wake( int *addr, int val ) @@ -684,7 +712,8 @@ NTSTATUS fsync_query_mutex( HANDLE handle, void *info, ULONG *ret_len ) return STATUS_SUCCESS; } -static NTSTATUS do_single_wait( int *addr, int val, ULONGLONG *end, BOOLEAN alertable ) +static NTSTATUS do_single_wait( int *addr, int val, const struct timespec64 *end, clockid_t clock_id, + BOOLEAN alertable ) { struct futex_waitv futexes[2]; int ret; @@ -700,14 +729,14 @@ static NTSTATUS do_single_wait( int *addr, int val, ULONGLONG *end, BOOLEAN aler futex_vector_set( &futexes[1], apc_futex, 0 ); - ret = futex_wait_multiple( futexes, 2, end ); + ret = futex_wait_multiple( futexes, 2, end, clock_id ); if (__atomic_load_n( apc_futex, __ATOMIC_SEQ_CST )) return STATUS_USER_APC; } else { - ret = futex_wait_multiple( futexes, 1, end ); + ret = futex_wait_multiple( futexes, 1, end, clock_id ); } if (!ret) @@ -727,11 +756,11 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, struct fsync *objs[MAXIMUM_WAIT_OBJECTS]; BOOL msgwait = FALSE, waited = FALSE; int has_fsync = 0, has_server = 0; + clockid_t clock_id = 0; + struct timespec64 end; int dummy_futex = 0; LONGLONG timeleft; - LARGE_INTEGER now; DWORD waitcount; - ULONGLONG end; int i, ret; /* Grab the APC futex if we don't already have it. */ @@ -752,16 +781,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, } } - NtQuerySystemTime( &now ); - if (timeout) - { - if (timeout->QuadPart == TIMEOUT_INFINITE) - timeout = NULL; - else if (timeout->QuadPart > 0) - end = timeout->QuadPart; - else - end = now.QuadPart - timeout->QuadPart; - } + get_wait_end_time( &timeout, &end, &clock_id ); for (i = 0; i < count; i++) { @@ -797,7 +817,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, TRACE(", timeout = INFINITE.\n"); else { - timeleft = update_timeout( end ); + timeleft = update_timeout( &end, clock_id ); TRACE(", timeout = %ld.%07ld sec.\n", (long) (timeleft / TICKSPERSEC), (long) (timeleft % TICKSPERSEC)); } @@ -944,7 +964,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, return STATUS_TIMEOUT; } - ret = futex_wait_multiple( futexes, waitcount, timeout ? &end : NULL ); + ret = futex_wait_multiple( futexes, waitcount, timeout ? &end : NULL, clock_id ); /* FUTEX_WAIT_MULTIPLE can succeed or return -EINTR, -EAGAIN, * -EFAULT/-EACCES, -ETIMEDOUT. In the first three cases we need to @@ -1006,7 +1026,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, while ((current = __atomic_load_n( &mutex->tid, __ATOMIC_SEQ_CST ))) { - status = do_single_wait( &mutex->tid, current, timeout ? &end : NULL, alertable ); + status = do_single_wait( &mutex->tid, current, timeout ? &end : NULL, clock_id, alertable ); if (status != STATUS_PENDING) break; } @@ -1018,7 +1038,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, while (!__atomic_load_n( &event->signaled, __ATOMIC_SEQ_CST )) { - status = do_single_wait( &event->signaled, 0, timeout ? &end : NULL, alertable ); + status = do_single_wait( &event->signaled, 0, timeout ? &end : NULL, clock_id, alertable ); if (status != STATUS_PENDING) break; } From 4c9e693c9174dbcea83c2ad752cd624f9c5f9e18 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 4 Jul 2022 10:27:12 -0500 Subject: [PATCH 0399/2542] fsync: Return a copy of the object instead of cache pointer from get_object(). CW-Bug-Id: #20826 --- dlls/ntdll/unix/fsync.c | 123 +++++++++++++++++++++------------------- 1 file changed, 65 insertions(+), 58 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index f83b17d47107..c397129680ae 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -269,14 +269,14 @@ static inline UINT_PTR handle_to_index( HANDLE handle, UINT_PTR *entry ) return idx % FSYNC_LIST_BLOCK_SIZE; } -static struct fsync *add_to_list( HANDLE handle, enum fsync_type type, void *shm ) +static void add_to_list( HANDLE handle, enum fsync_type type, void *shm ) { UINT_PTR entry, idx = handle_to_index( handle, &entry ); if (entry >= FSYNC_LIST_ENTRIES) { FIXME( "too many allocated handles, not caching %p\n", handle ); - return FALSE; + return; } if (!fsync_list[entry]) /* do we need to allocate a new block of entries? */ @@ -286,38 +286,37 @@ static struct fsync *add_to_list( HANDLE handle, enum fsync_type type, void *shm { void *ptr = anon_mmap_alloc( FSYNC_LIST_BLOCK_SIZE * sizeof(struct fsync), PROT_READ | PROT_WRITE ); - if (ptr == MAP_FAILED) return FALSE; + if (ptr == MAP_FAILED) return; fsync_list[entry] = ptr; } } if (!__sync_val_compare_and_swap((int *)&fsync_list[entry][idx].type, 0, type )) fsync_list[entry][idx].shm = shm; - - return &fsync_list[entry][idx]; } -static struct fsync *get_cached_object( HANDLE handle ) +static BOOL get_cached_object( HANDLE handle, struct fsync *obj ) { UINT_PTR entry, idx = handle_to_index( handle, &entry ); - if (entry >= FSYNC_LIST_ENTRIES || !fsync_list[entry]) return NULL; - if (!fsync_list[entry][idx].type) return NULL; + if (entry >= FSYNC_LIST_ENTRIES || !fsync_list[entry]) return FALSE; + if (!fsync_list[entry][idx].type) return FALSE; - return &fsync_list[entry][idx]; + *obj = fsync_list[entry][idx]; + return TRUE; } /* Gets an object. This is either a proper fsync object (i.e. an event, * semaphore, etc. created using create_fsync) or a generic synchronizable * server-side object which the server will signal (e.g. a process, thread, * message queue, etc.) */ -static NTSTATUS get_object( HANDLE handle, struct fsync **obj ) +static NTSTATUS get_object( HANDLE handle, struct fsync *obj ) { NTSTATUS ret = STATUS_SUCCESS; unsigned int shm_idx = 0; enum fsync_type type; - if ((*obj = get_cached_object( handle ))) return STATUS_SUCCESS; + if (get_cached_object( handle, obj )) return STATUS_SUCCESS; if ((INT_PTR)handle < 0) { @@ -340,13 +339,14 @@ static NTSTATUS get_object( HANDLE handle, struct fsync **obj ) if (ret) { WARN("Failed to retrieve shm index for handle %p, status %#x.\n", handle, (unsigned int)ret); - *obj = NULL; return ret; } TRACE("Got shm index %d for handle %p.\n", shm_idx, handle); - *obj = add_to_list( handle, type, get_shm( shm_idx ) ); + obj->type = type; + obj->shm = get_shm( shm_idx ); + add_to_list( handle, type, obj->shm ); return ret; } @@ -497,7 +497,7 @@ NTSTATUS fsync_open_semaphore( HANDLE *handle, ACCESS_MASK access, NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) { - struct fsync *obj; + struct fsync obj; struct semaphore *semaphore; ULONG current; NTSTATUS ret; @@ -505,7 +505,7 @@ NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) TRACE("%p, %d, %p.\n", handle, (int)count, prev); if ((ret = get_object( handle, &obj ))) return ret; - semaphore = obj->shm; + semaphore = obj.shm; do { @@ -523,7 +523,7 @@ NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) NTSTATUS fsync_query_semaphore( HANDLE handle, void *info, ULONG *ret_len ) { - struct fsync *obj; + struct fsync obj; struct semaphore *semaphore; SEMAPHORE_BASIC_INFORMATION *out = info; NTSTATUS ret; @@ -531,7 +531,7 @@ NTSTATUS fsync_query_semaphore( HANDLE handle, void *info, ULONG *ret_len ) TRACE("handle %p, info %p, ret_len %p.\n", handle, info, ret_len); if ((ret = get_object( handle, &obj ))) return ret; - semaphore = obj->shm; + semaphore = obj.shm; out->CurrentCount = semaphore->count; out->MaximumCount = semaphore->max; @@ -563,16 +563,16 @@ NTSTATUS fsync_open_event( HANDLE *handle, ACCESS_MASK access, NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ) { struct event *event; - struct fsync *obj; + struct fsync obj; LONG current; NTSTATUS ret; TRACE("%p.\n", handle); if ((ret = get_object( handle, &obj ))) return ret; - event = obj->shm; + event = obj.shm; - if (obj->type != FSYNC_MANUAL_EVENT && obj->type != FSYNC_AUTO_EVENT) + if (obj.type != FSYNC_MANUAL_EVENT && obj.type != FSYNC_AUTO_EVENT) return STATUS_OBJECT_TYPE_MISMATCH; if (!(current = __atomic_exchange_n( &event->signaled, 1, __ATOMIC_SEQ_CST ))) @@ -586,14 +586,14 @@ NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ) NTSTATUS fsync_reset_event( HANDLE handle, LONG *prev ) { struct event *event; - struct fsync *obj; + struct fsync obj; LONG current; NTSTATUS ret; TRACE("%p.\n", handle); if ((ret = get_object( handle, &obj ))) return ret; - event = obj->shm; + event = obj.shm; current = __atomic_exchange_n( &event->signaled, 0, __ATOMIC_SEQ_CST ); @@ -605,14 +605,14 @@ NTSTATUS fsync_reset_event( HANDLE handle, LONG *prev ) NTSTATUS fsync_pulse_event( HANDLE handle, LONG *prev ) { struct event *event; - struct fsync *obj; + struct fsync obj; LONG current; NTSTATUS ret; TRACE("%p.\n", handle); if ((ret = get_object( handle, &obj ))) return ret; - event = obj->shm; + event = obj.shm; /* This isn't really correct; an application could miss the write. * Unfortunately we can't really do much better. Fortunately this is rarely @@ -634,17 +634,17 @@ NTSTATUS fsync_pulse_event( HANDLE handle, LONG *prev ) NTSTATUS fsync_query_event( HANDLE handle, void *info, ULONG *ret_len ) { struct event *event; - struct fsync *obj; + struct fsync obj; EVENT_BASIC_INFORMATION *out = info; NTSTATUS ret; TRACE("handle %p, info %p, ret_len %p.\n", handle, info, ret_len); if ((ret = get_object( handle, &obj ))) return ret; - event = obj->shm; + event = obj.shm; out->EventState = event->signaled; - out->EventType = (obj->type == FSYNC_AUTO_EVENT ? SynchronizationEvent : NotificationEvent); + out->EventType = (obj.type == FSYNC_AUTO_EVENT ? SynchronizationEvent : NotificationEvent); if (ret_len) *ret_len = sizeof(*out); return STATUS_SUCCESS; @@ -671,13 +671,13 @@ NTSTATUS fsync_open_mutex( HANDLE *handle, ACCESS_MASK access, NTSTATUS fsync_release_mutex( HANDLE handle, LONG *prev ) { struct mutex *mutex; - struct fsync *obj; + struct fsync obj; NTSTATUS ret; TRACE("%p, %p.\n", handle, prev); if ((ret = get_object( handle, &obj ))) return ret; - mutex = obj->shm; + mutex = obj.shm; if (mutex->tid != GetCurrentThreadId()) return STATUS_MUTANT_NOT_OWNED; @@ -694,7 +694,7 @@ NTSTATUS fsync_release_mutex( HANDLE handle, LONG *prev ) NTSTATUS fsync_query_mutex( HANDLE handle, void *info, ULONG *ret_len ) { - struct fsync *obj; + struct fsync obj; struct mutex *mutex; MUTANT_BASIC_INFORMATION *out = info; NTSTATUS ret; @@ -702,7 +702,7 @@ NTSTATUS fsync_query_mutex( HANDLE handle, void *info, ULONG *ret_len ) TRACE("handle %p, info %p, ret_len %p.\n", handle, info, ret_len); if ((ret = get_object( handle, &obj ))) return ret; - mutex = obj->shm; + mutex = obj.shm; out->CurrentCount = 1 - mutex->count; out->OwnedByCaller = (mutex->tid == GetCurrentThreadId()); @@ -753,7 +753,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, static const LARGE_INTEGER zero = {0}; struct futex_waitv futexes[MAXIMUM_WAIT_OBJECTS + 1]; - struct fsync *objs[MAXIMUM_WAIT_OBJECTS]; + struct fsync objs[MAXIMUM_WAIT_OBJECTS]; BOOL msgwait = FALSE, waited = FALSE; int has_fsync = 0, has_server = 0; clockid_t clock_id = 0; @@ -787,14 +787,28 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, { ret = get_object( handles[i], &objs[i] ); if (ret == STATUS_SUCCESS) + { + if (!objs[i].type) + { + /* Someone probably closed an object while waiting on it. */ + WARN("Handle %p has type 0; was it closed?\n", handles[i]); + return STATUS_INVALID_HANDLE; + } has_fsync = 1; + } else if (ret == STATUS_NOT_IMPLEMENTED) + { + objs[i].type = 0; + objs[i].shm = NULL; has_server = 1; + } else + { return ret; + } } - if (count && objs[count - 1] && objs[count - 1]->type == FSYNC_QUEUE) + if (count && objs[count - 1].type == FSYNC_QUEUE) msgwait = TRUE; if (has_fsync && has_server) @@ -839,17 +853,10 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, for (i = 0; i < count; i++) { - struct fsync *obj = objs[i]; + struct fsync *obj = &objs[i]; - if (obj) + if (obj->type) { - if (!obj->type) /* gcc complains if we put this in the switch */ - { - /* Someone probably closed an object while waiting on it. */ - WARN("Handle %p has type 0; was it closed?\n", handles[i]); - return STATUS_INVALID_HANDLE; - } - switch (obj->type) { case FSYNC_SEMAPHORE: @@ -1015,9 +1022,9 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, for (i = 0; i < count; i++) { - struct fsync *obj = objs[i]; + struct fsync *obj = &objs[i]; - if (obj && obj->type == FSYNC_MUTEX) + if (obj->type == FSYNC_MUTEX) { struct mutex *mutex = obj->shm; @@ -1031,7 +1038,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, break; } } - else if (obj) + else if (obj->type) { /* this works for semaphores too */ struct event *event = obj->shm; @@ -1057,9 +1064,9 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, * handles were signaled. Check to make sure they still are. */ for (i = 0; i < count; i++) { - struct fsync *obj = objs[i]; + struct fsync *obj = &objs[i]; - if (obj && obj->type == FSYNC_MUTEX) + if (obj->type == FSYNC_MUTEX) { struct mutex *mutex = obj->shm; int tid = __atomic_load_n( &mutex->tid, __ATOMIC_SEQ_CST ); @@ -1067,7 +1074,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, if (tid && tid != ~0 && tid != GetCurrentThreadId()) goto tryagain; } - else if (obj) + else if (obj->type) { struct event *event = obj->shm; @@ -1079,8 +1086,8 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, /* Yep, still signaled. Now quick, grab everything. */ for (i = 0; i < count; i++) { - struct fsync *obj = objs[i]; - if (!obj) continue; + struct fsync *obj = &objs[i]; + if (!obj->type) continue; switch (obj->type) { case FSYNC_MUTEX: @@ -1126,9 +1133,9 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, * Make sure to let ourselves know that we grabbed the mutexes. */ for (i = 0; i < count; i++) { - if (objs[i] && objs[i]->type == FSYNC_MUTEX) + if (objs[i].type == FSYNC_MUTEX) { - struct mutex *mutex = objs[i]->shm; + struct mutex *mutex = objs[i].shm; mutex->count++; } } @@ -1144,8 +1151,8 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, tooslow: for (--i; i >= 0; i--) { - struct fsync *obj = objs[i]; - if (!obj) continue; + struct fsync *obj = &objs[i]; + if (!obj->type) continue; switch (obj->type) { case FSYNC_MUTEX: @@ -1219,10 +1226,10 @@ NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an BOOLEAN alertable, const LARGE_INTEGER *timeout ) { BOOL msgwait = FALSE; - struct fsync *obj; + struct fsync obj; NTSTATUS ret; - if (count && !get_object( handles[count - 1], &obj ) && obj->type == FSYNC_QUEUE) + if (count && !get_object( handles[count - 1], &obj ) && obj.type == FSYNC_QUEUE) { msgwait = TRUE; server_set_msgwait( 1 ); @@ -1239,12 +1246,12 @@ NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an NTSTATUS fsync_signal_and_wait( HANDLE signal, HANDLE wait, BOOLEAN alertable, const LARGE_INTEGER *timeout ) { - struct fsync *obj; + struct fsync obj; NTSTATUS ret; if ((ret = get_object( signal, &obj ))) return ret; - switch (obj->type) + switch (obj.type) { case FSYNC_SEMAPHORE: ret = fsync_release_semaphore( signal, 1, NULL ); From bbad065ca939d1fcf0b86f5bdf9815ac428ccd74 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 4 Jul 2022 11:40:08 -0500 Subject: [PATCH 0400/2542] fsync: Synchronize access to object cache. CW-Bug-Id: #20826 --- dlls/ntdll/unix/fsync.c | 57 +++++++++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index c397129680ae..d6b5dba12027 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -261,6 +261,7 @@ static void *get_shm( unsigned int idx ) static struct fsync *fsync_list[FSYNC_LIST_ENTRIES]; static struct fsync fsync_list_initial_block[FSYNC_LIST_BLOCK_SIZE]; +static int cache_locked; static inline UINT_PTR handle_to_index( HANDLE handle, UINT_PTR *entry ) { @@ -269,6 +270,26 @@ static inline UINT_PTR handle_to_index( HANDLE handle, UINT_PTR *entry ) return idx % FSYNC_LIST_BLOCK_SIZE; } +static void small_pause(void) +{ +#ifdef __i386__ + __asm__ __volatile__( "rep;nop" : : : "memory" ); +#else + __asm__ __volatile__( "" : : : "memory" ); +#endif +} + +static void lock_obj_cache(void) +{ + while (__sync_val_compare_and_swap( &cache_locked, 0, 1 )) + small_pause(); +} + +static void unlock_obj_cache(void) +{ + __atomic_store_n( &cache_locked, 0, __ATOMIC_SEQ_CST ); +} + static void add_to_list( HANDLE handle, enum fsync_type type, void *shm ) { UINT_PTR entry, idx = handle_to_index( handle, &entry ); @@ -287,23 +308,29 @@ static void add_to_list( HANDLE handle, enum fsync_type type, void *shm ) void *ptr = anon_mmap_alloc( FSYNC_LIST_BLOCK_SIZE * sizeof(struct fsync), PROT_READ | PROT_WRITE ); if (ptr == MAP_FAILED) return; - fsync_list[entry] = ptr; + if (__sync_val_compare_and_swap( &fsync_list[entry], NULL, ptr )) + munmap( ptr, FSYNC_LIST_BLOCK_SIZE * sizeof(struct fsync) ); } } - if (!__sync_val_compare_and_swap((int *)&fsync_list[entry][idx].type, 0, type )) - fsync_list[entry][idx].shm = shm; + lock_obj_cache(); + fsync_list[entry][idx].type = type; + fsync_list[entry][idx].shm = shm; + unlock_obj_cache(); } static BOOL get_cached_object( HANDLE handle, struct fsync *obj ) { + BOOL ret = TRUE; UINT_PTR entry, idx = handle_to_index( handle, &entry ); if (entry >= FSYNC_LIST_ENTRIES || !fsync_list[entry]) return FALSE; - if (!fsync_list[entry][idx].type) return FALSE; - *obj = fsync_list[entry][idx]; - return TRUE; + lock_obj_cache(); + if (!fsync_list[entry][idx].type) ret = FALSE; + else *obj = fsync_list[entry][idx]; + unlock_obj_cache(); + return ret; } /* Gets an object. This is either a proper fsync object (i.e. an event, @@ -358,7 +385,16 @@ NTSTATUS fsync_close( HANDLE handle ) if (entry < FSYNC_LIST_ENTRIES && fsync_list[entry]) { - if (__atomic_exchange_n( &fsync_list[entry][idx].type, 0, __ATOMIC_SEQ_CST )) + enum fsync_type type; + + lock_obj_cache(); + if ((type = fsync_list[entry][idx].type)) + { + fsync_list[entry][idx].type = 0; + fsync_list[entry][idx].shm = NULL; + } + unlock_obj_cache(); + if (type) return STATUS_SUCCESS; } @@ -788,12 +824,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, ret = get_object( handles[i], &objs[i] ); if (ret == STATUS_SUCCESS) { - if (!objs[i].type) - { - /* Someone probably closed an object while waiting on it. */ - WARN("Handle %p has type 0; was it closed?\n", handles[i]); - return STATUS_INVALID_HANDLE; - } + assert( objs[i].type ); has_fsync = 1; } else if (ret == STATUS_NOT_IMPLEMENTED) From 9b5c8d9fced67548a1c8a42cc5ed29a8dfe662cd Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 1 Aug 2022 10:50:13 -0500 Subject: [PATCH 0401/2542] fsync: Use atomic cache stores and load instead of locking cache. CW-Bug-Id: #21050 (replaces "fsync: Synchronize access to object cache.") --- dlls/ntdll/unix/fsync.c | 91 +++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 49 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index d6b5dba12027..0e3752421ed7 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -259,9 +259,16 @@ static void *get_shm( unsigned int idx ) #define FSYNC_LIST_BLOCK_SIZE (65536 / sizeof(struct fsync)) #define FSYNC_LIST_ENTRIES 256 -static struct fsync *fsync_list[FSYNC_LIST_ENTRIES]; -static struct fsync fsync_list_initial_block[FSYNC_LIST_BLOCK_SIZE]; -static int cache_locked; +struct fsync_cache +{ + enum fsync_type type; + unsigned int shm_idx; +}; + +C_ASSERT(sizeof(struct fsync_cache) == sizeof(uint64_t)); + +static struct fsync_cache *fsync_list[FSYNC_LIST_ENTRIES]; +static struct fsync_cache fsync_list_initial_block[FSYNC_LIST_BLOCK_SIZE]; static inline UINT_PTR handle_to_index( HANDLE handle, UINT_PTR *entry ) { @@ -270,29 +277,10 @@ static inline UINT_PTR handle_to_index( HANDLE handle, UINT_PTR *entry ) return idx % FSYNC_LIST_BLOCK_SIZE; } -static void small_pause(void) -{ -#ifdef __i386__ - __asm__ __volatile__( "rep;nop" : : : "memory" ); -#else - __asm__ __volatile__( "" : : : "memory" ); -#endif -} - -static void lock_obj_cache(void) -{ - while (__sync_val_compare_and_swap( &cache_locked, 0, 1 )) - small_pause(); -} - -static void unlock_obj_cache(void) -{ - __atomic_store_n( &cache_locked, 0, __ATOMIC_SEQ_CST ); -} - -static void add_to_list( HANDLE handle, enum fsync_type type, void *shm ) +static void add_to_list( HANDLE handle, enum fsync_type type, unsigned int shm_idx ) { UINT_PTR entry, idx = handle_to_index( handle, &entry ); + struct fsync_cache cache; if (entry >= FSYNC_LIST_ENTRIES) { @@ -305,32 +293,41 @@ static void add_to_list( HANDLE handle, enum fsync_type type, void *shm ) if (!entry) fsync_list[0] = fsync_list_initial_block; else { - void *ptr = anon_mmap_alloc( FSYNC_LIST_BLOCK_SIZE * sizeof(struct fsync), + void *ptr = anon_mmap_alloc( FSYNC_LIST_BLOCK_SIZE * sizeof(*fsync_list[entry]), PROT_READ | PROT_WRITE ); if (ptr == MAP_FAILED) return; if (__sync_val_compare_and_swap( &fsync_list[entry], NULL, ptr )) - munmap( ptr, FSYNC_LIST_BLOCK_SIZE * sizeof(struct fsync) ); + munmap( ptr, FSYNC_LIST_BLOCK_SIZE * sizeof(*fsync_list[entry]) ); } } - lock_obj_cache(); - fsync_list[entry][idx].type = type; - fsync_list[entry][idx].shm = shm; - unlock_obj_cache(); + cache.type = type; + cache.shm_idx = shm_idx; + __atomic_store_n( (uint64_t *)&fsync_list[entry][idx], *(uint64_t *)&cache, __ATOMIC_SEQ_CST ); } static BOOL get_cached_object( HANDLE handle, struct fsync *obj ) { - BOOL ret = TRUE; UINT_PTR entry, idx = handle_to_index( handle, &entry ); + struct fsync_cache cache; if (entry >= FSYNC_LIST_ENTRIES || !fsync_list[entry]) return FALSE; - lock_obj_cache(); - if (!fsync_list[entry][idx].type) ret = FALSE; - else *obj = fsync_list[entry][idx]; - unlock_obj_cache(); - return ret; +again: + *(uint64_t *)&cache = __atomic_load_n( (uint64_t *)&fsync_list[entry][idx], __ATOMIC_SEQ_CST ); + + if (!cache.type || !cache.shm_idx) return FALSE; + + obj->type = cache.type; + obj->shm = get_shm( cache.shm_idx ); + if (*(uint64_t *)&cache != __atomic_load_n( (uint64_t *)&fsync_list[entry][idx], __ATOMIC_SEQ_CST )) + { + /* This check does not strictly guarantee that we avoid the potential race but is supposed to greatly + * reduce the probability of that. */ + FIXME( "Cache changed while getting object.\n" ); + goto again; + } + return TRUE; } /* Gets an object. This is either a proper fsync object (i.e. an event, @@ -373,7 +370,7 @@ static NTSTATUS get_object( HANDLE handle, struct fsync *obj ) obj->type = type; obj->shm = get_shm( shm_idx ); - add_to_list( handle, type, obj->shm ); + add_to_list( handle, type, shm_idx ); return ret; } @@ -385,17 +382,13 @@ NTSTATUS fsync_close( HANDLE handle ) if (entry < FSYNC_LIST_ENTRIES && fsync_list[entry]) { - enum fsync_type type; + struct fsync_cache cache; - lock_obj_cache(); - if ((type = fsync_list[entry][idx].type)) - { - fsync_list[entry][idx].type = 0; - fsync_list[entry][idx].shm = NULL; - } - unlock_obj_cache(); - if (type) - return STATUS_SUCCESS; + cache.type = 0; + cache.shm_idx = 0; + *(uint64_t *)&cache = __atomic_exchange_n( (uint64_t *)&fsync_list[entry][idx], + *(uint64_t *)&cache, __ATOMIC_SEQ_CST ); + if (cache.type) return STATUS_SUCCESS; } return STATUS_INVALID_HANDLE; @@ -430,7 +423,7 @@ static NTSTATUS create_fsync( enum fsync_type type, HANDLE *handle, if (!ret || ret == STATUS_OBJECT_NAME_EXISTS) { - add_to_list( *handle, type, get_shm( shm_idx )); + add_to_list( *handle, type, shm_idx ); TRACE("-> handle %p, shm index %d.\n", *handle, shm_idx); } @@ -463,7 +456,7 @@ static NTSTATUS open_fsync( enum fsync_type type, HANDLE *handle, if (!ret) { - add_to_list( *handle, type, get_shm( shm_idx ) ); + add_to_list( *handle, type, shm_idx ); TRACE("-> handle %p, shm index %u.\n", *handle, shm_idx); } From 1a32e2398be27ebc3fd8c2cb9a69da15ba13d57a Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 4 Jul 2022 15:11:23 -0500 Subject: [PATCH 0402/2542] fsync: Implement reference counting for sync objects shared memory. CW-Bug-Id: #20826 --- dlls/ntdll/unix/fsync.c | 150 ++++++++++++++++++++++++++++++++++++---- server/fsync.c | 64 ++++++++++++++++- server/fsync.h | 1 + server/process.c | 6 +- server/protocol.def | 5 ++ 5 files changed, 210 insertions(+), 16 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 0e3752421ed7..309e2eb2affd 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -191,22 +191,28 @@ struct semaphore { int count; int max; + int ref; + int last_pid; }; -C_ASSERT(sizeof(struct semaphore) == 8); +C_ASSERT(sizeof(struct semaphore) == 16); struct event { int signaled; int unused; + int ref; + int last_pid; }; -C_ASSERT(sizeof(struct event) == 8); +C_ASSERT(sizeof(struct event) == 16); struct mutex { int tid; int count; /* recursion count */ + int ref; + int last_pid; }; -C_ASSERT(sizeof(struct mutex) == 8); +C_ASSERT(sizeof(struct mutex) == 16); static char shm_name[29]; static int shm_fd; @@ -218,8 +224,8 @@ static pthread_mutex_t shm_addrs_mutex = PTHREAD_MUTEX_INITIALIZER; static void *get_shm( unsigned int idx ) { - int entry = (idx * 8) / pagesize; - int offset = (idx * 8) % pagesize; + int entry = (idx * 16) / pagesize; + int offset = (idx * 16) % pagesize; void *ret; pthread_mutex_lock( &shm_addrs_mutex ); @@ -306,6 +312,59 @@ static void add_to_list( HANDLE handle, enum fsync_type type, unsigned int shm_i __atomic_store_n( (uint64_t *)&fsync_list[entry][idx], *(uint64_t *)&cache, __ATOMIC_SEQ_CST ); } +static void grab_object( struct fsync *obj ) +{ + int *shm = obj->shm; + + __atomic_add_fetch( &shm[2], 1, __ATOMIC_SEQ_CST ); +} + +static unsigned int shm_index_from_shm( char *shm ) +{ + unsigned int count = shm_addrs_size; + unsigned int i, idx_offset; + + for (i = 0; i < count; ++i) + { + if (shm >= (char *)shm_addrs[i] && shm < (char *)shm_addrs[i] + pagesize) + { + idx_offset = (shm - (char *)shm_addrs[i]) / 16; + return i * (pagesize / 16) + idx_offset; + } + } + + ERR( "Index for shm %p not found.\n", shm ); + return ~0u; +} + +static void put_object( struct fsync *obj ) +{ + int *shm = obj->shm; + + if (__atomic_load_n( &shm[2], __ATOMIC_SEQ_CST ) == 1) + { + /* We are holding the last reference, it should be released on server so shm idx get freed. */ + SERVER_START_REQ( fsync_free_shm_idx ) + { + req->shm_idx = shm_index_from_shm( obj->shm ); + wine_server_call( req ); + } + SERVER_END_REQ; + } + else + { + __atomic_sub_fetch( &shm[2], 1, __ATOMIC_SEQ_CST ); + } +} + +static void put_object_from_wait( struct fsync *obj ) +{ + int *shm = obj->shm; + + __sync_val_compare_and_swap( &shm[3], GetCurrentProcessId(), 0 ); + put_object( obj ); +} + static BOOL get_cached_object( HANDLE handle, struct fsync *obj ) { UINT_PTR entry, idx = handle_to_index( handle, &entry ); @@ -320,10 +379,13 @@ static BOOL get_cached_object( HANDLE handle, struct fsync *obj ) obj->type = cache.type; obj->shm = get_shm( cache.shm_idx ); - if (*(uint64_t *)&cache != __atomic_load_n( (uint64_t *)&fsync_list[entry][idx], __ATOMIC_SEQ_CST )) + grab_object( obj ); + if (((int *)obj->shm)[2] < 2 || + *(uint64_t *)&cache != __atomic_load_n( (uint64_t *)&fsync_list[entry][idx], __ATOMIC_SEQ_CST )) { /* This check does not strictly guarantee that we avoid the potential race but is supposed to greatly * reduce the probability of that. */ + put_object( obj ); FIXME( "Cache changed while getting object.\n" ); goto again; } @@ -371,9 +433,24 @@ static NTSTATUS get_object( HANDLE handle, struct fsync *obj ) obj->type = type; obj->shm = get_shm( shm_idx ); add_to_list( handle, type, shm_idx ); + /* get_fsync_idx server request increments shared mem refcount, so not grabbing object here. */ return ret; } +static NTSTATUS get_object_for_wait( HANDLE handle, struct fsync *obj ) +{ + NTSTATUS ret; + int *shm; + + if ((ret = get_object( handle, obj ))) return ret; + + shm = obj->shm; + /* Give wineserver a chance to cleanup shm index if the process + * is killed while we are waiting on the object. */ + __atomic_store_n( &shm[3], GetCurrentProcessId(), __ATOMIC_SEQ_CST ); + return STATUS_SUCCESS; +} + NTSTATUS fsync_close( HANDLE handle ) { UINT_PTR entry, idx = handle_to_index( handle, &entry ); @@ -540,13 +617,17 @@ NTSTATUS fsync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) { current = semaphore->count; if (count + current > semaphore->max) + { + put_object( &obj ); return STATUS_SEMAPHORE_LIMIT_EXCEEDED; + } } while (__sync_val_compare_and_swap( &semaphore->count, current, count + current ) != current); if (prev) *prev = current; futex_wake( &semaphore->count, INT_MAX ); + put_object( &obj ); return STATUS_SUCCESS; } @@ -566,6 +647,7 @@ NTSTATUS fsync_query_semaphore( HANDLE handle, void *info, ULONG *ret_len ) out->MaximumCount = semaphore->max; if (ret_len) *ret_len = sizeof(*out); + put_object( &obj ); return STATUS_SUCCESS; } @@ -602,13 +684,17 @@ NTSTATUS fsync_set_event( HANDLE handle, LONG *prev ) event = obj.shm; if (obj.type != FSYNC_MANUAL_EVENT && obj.type != FSYNC_AUTO_EVENT) + { + put_object( &obj ); return STATUS_OBJECT_TYPE_MISMATCH; + } if (!(current = __atomic_exchange_n( &event->signaled, 1, __ATOMIC_SEQ_CST ))) futex_wake( &event->signaled, INT_MAX ); if (prev) *prev = current; + put_object( &obj ); return STATUS_SUCCESS; } @@ -628,6 +714,7 @@ NTSTATUS fsync_reset_event( HANDLE handle, LONG *prev ) if (prev) *prev = current; + put_object( &obj ); return STATUS_SUCCESS; } @@ -657,6 +744,7 @@ NTSTATUS fsync_pulse_event( HANDLE handle, LONG *prev ) if (prev) *prev = current; + put_object( &obj ); return STATUS_SUCCESS; } @@ -676,6 +764,7 @@ NTSTATUS fsync_query_event( HANDLE handle, void *info, ULONG *ret_len ) out->EventType = (obj.type == FSYNC_AUTO_EVENT ? SynchronizationEvent : NotificationEvent); if (ret_len) *ret_len = sizeof(*out); + put_object( &obj ); return STATUS_SUCCESS; } @@ -708,7 +797,11 @@ NTSTATUS fsync_release_mutex( HANDLE handle, LONG *prev ) if ((ret = get_object( handle, &obj ))) return ret; mutex = obj.shm; - if (mutex->tid != GetCurrentThreadId()) return STATUS_MUTANT_NOT_OWNED; + if (mutex->tid != GetCurrentThreadId()) + { + put_object( &obj ); + return STATUS_MUTANT_NOT_OWNED; + } if (prev) *prev = mutex->count; @@ -718,6 +811,7 @@ NTSTATUS fsync_release_mutex( HANDLE handle, LONG *prev ) futex_wake( &mutex->tid, INT_MAX ); } + put_object( &obj ); return STATUS_SUCCESS; } @@ -738,6 +832,7 @@ NTSTATUS fsync_query_mutex( HANDLE handle, void *info, ULONG *ret_len ) out->AbandonedState = (mutex->tid == ~0); if (ret_len) *ret_len = sizeof(*out); + put_object( &obj ); return STATUS_SUCCESS; } @@ -776,6 +871,14 @@ static NTSTATUS do_single_wait( int *addr, int val, const struct timespec64 *end return STATUS_PENDING; } +static void put_objects( struct fsync *objs, unsigned int count ) +{ + unsigned int i; + + for (i = 0; i < count; ++i) + if (objs[i].type) put_object_from_wait( &objs[i] ); +} + static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ) { @@ -814,7 +917,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, for (i = 0; i < count; i++) { - ret = get_object( handles[i], &objs[i] ); + ret = get_object_for_wait( handles[i], &objs[i] ); if (ret == STATUS_SUCCESS) { assert( objs[i].type ); @@ -828,6 +931,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, } else { + put_objects( objs, i ); return ret; } } @@ -838,7 +942,10 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, if (has_fsync && has_server) FIXME("Can't wait on fsync and server objects at the same time!\n"); else if (has_server) + { + put_objects( objs, count ); return STATUS_NOT_IMPLEMENTED; + } if (TRACE_ON(fsync)) { @@ -893,6 +1000,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, { TRACE("Woken up by handle %p [%d].\n", handles[i], i); if (waited) simulate_sched_quantum(); + put_objects( objs, count ); return i; } futex_vector_set( &futexes[i], &semaphore->count, 0 ); @@ -908,6 +1016,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, TRACE("Woken up by handle %p [%d].\n", handles[i], i); mutex->count++; if (waited) simulate_sched_quantum(); + put_objects( objs, count ); return i; } @@ -916,12 +1025,14 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, TRACE("Woken up by handle %p [%d].\n", handles[i], i); mutex->count = 1; if (waited) simulate_sched_quantum(); + put_objects( objs, count ); return i; } else if (tid == ~0 && (tid = __sync_val_compare_and_swap( &mutex->tid, ~0, GetCurrentThreadId() )) == ~0) { TRACE("Woken up by abandoned mutex %p [%d].\n", handles[i], i); mutex->count = 1; + put_objects( objs, count ); return STATUS_ABANDONED_WAIT_0 + i; } @@ -940,6 +1051,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, TRACE("Woken up by handle %p [%d].\n", handles[i], i); if (waited) simulate_sched_quantum(); + put_objects( objs, count ); return i; } futex_vector_set( &futexes[i], &event->signaled, 0 ); @@ -958,6 +1070,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, TRACE("Woken up by handle %p [%d].\n", handles[i], i); if (waited) simulate_sched_quantum(); + put_objects( objs, count ); return i; } futex_vector_set( &futexes[i], &event->signaled, 0 ); @@ -992,6 +1105,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, /* Unlike esync, we already know that we've timed out, so we * can avoid a syscall. */ TRACE("Wait timed out.\n"); + put_objects( objs, count ); return STATUS_TIMEOUT; } @@ -1004,6 +1118,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, if (ret == -1 && errno == ETIMEDOUT) { TRACE("Wait timed out.\n"); + put_objects( objs, count ); return STATUS_TIMEOUT; } else waited = TRUE; @@ -1078,6 +1193,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, if (status == STATUS_TIMEOUT) { TRACE("Wait timed out.\n"); + put_objects( objs, count ); return status; } else if (status == STATUS_USER_APC) @@ -1167,9 +1283,11 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, if (abandoned) { TRACE("Wait successful, but some object(s) were abandoned.\n"); + put_objects( objs, count ); return STATUS_ABANDONED; } TRACE("Wait successful.\n"); + put_objects( objs, count ); return STATUS_SUCCESS; tooslow: @@ -1214,6 +1332,8 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, userapc: TRACE("Woken up by user APC.\n"); + put_objects( objs, count ); + /* We have to make a server call anyway to get the APC to execute, so just * delegate down to server_wait(). */ ret = server_wait( NULL, 0, SELECT_INTERRUPTIBLE | SELECT_ALERTABLE, &zero ); @@ -1253,10 +1373,14 @@ NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an struct fsync obj; NTSTATUS ret; - if (count && !get_object( handles[count - 1], &obj ) && obj.type == FSYNC_QUEUE) + if (count && !get_object( handles[count - 1], &obj )) { - msgwait = TRUE; - server_set_msgwait( 1 ); + if (obj.type == FSYNC_QUEUE) + { + msgwait = TRUE; + server_set_msgwait( 1 ); + } + put_object( &obj ); } ret = __fsync_wait_objects( count, handles, wait_any, alertable, timeout ); @@ -1288,8 +1412,10 @@ NTSTATUS fsync_signal_and_wait( HANDLE signal, HANDLE wait, BOOLEAN alertable, ret = fsync_release_mutex( signal, NULL ); break; default: - return STATUS_OBJECT_TYPE_MISMATCH; + ret = STATUS_OBJECT_TYPE_MISMATCH; + break; } + put_object( &obj ); if (ret) return ret; return fsync_wait_objects( 1, &wait, TRUE, alertable, timeout ); diff --git a/server/fsync.c b/server/fsync.c index 3c1e709d7e36..0e3862389da8 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -205,8 +205,8 @@ static void fsync_destroy( struct object *obj ) static void *get_shm( unsigned int idx ) { - int entry = (idx * 8) / pagesize; - int offset = (idx * 8) % pagesize; + int entry = (idx * 16) / pagesize; + int offset = (idx * 16) % pagesize; if (entry >= shm_addrs_size) { @@ -287,7 +287,7 @@ unsigned int fsync_alloc_shm( int low, int high ) shm_idx = alloc_shm_idx_from_word( old_size ); } - while (shm_idx * 8 >= shm_size) + while (shm_idx * 16 >= shm_size) { /* Better expand the shm section. */ shm_size += pagesize; @@ -303,6 +303,8 @@ unsigned int fsync_alloc_shm( int low, int high ) assert(shm); shm[0] = low; shm[1] = high; + shm[2] = 1; /* Reference count. */ + shm[3] = 0; /* Last reference process id. */ return shm_idx; #else @@ -314,9 +316,24 @@ void fsync_free_shm_idx( int shm_idx ) { unsigned int idx; uint64_t mask; + int *shm; assert( shm_idx ); assert( shm_idx < shm_idx_free_map_size * BITS_IN_FREE_MAP_WORD ); + + shm = get_shm( shm_idx ); + if (shm[2] <= 0) + { + fprintf( stderr, "wineserver: fsync err: shm refcount is %d.\n", shm[2] ); + return; + } + + if (__atomic_sub_fetch( &shm[2], 1, __ATOMIC_SEQ_CST )) + { + /* Sync object is still referenced in a process. */ + return; + } + idx = shm_idx / BITS_IN_FREE_MAP_WORD; mask = (uint64_t)1 << (shm_idx % BITS_IN_FREE_MAP_WORD); assert( !(shm_idx_free_map[idx] & mask) ); @@ -325,6 +342,31 @@ void fsync_free_shm_idx( int shm_idx ) shm_idx_free_search_start_hint = idx; } +/* Try to cleanup the shared mem indices locked by the wait on the killed processes. + * This is not fully reliable but should avoid leaking the majority of indices on + * process kill. */ +void fsync_cleanup_process_shm_indices( process_id_t id ) +{ + uint64_t free_word; + unsigned int i, j; + void *shmbase; + int *shm; + + for (i = 0; i < shm_idx_free_map_size; ++i) + { + free_word = shm_idx_free_map[i]; + if (free_word == ~(uint64_t)0) continue; + shmbase = get_shm( i * BITS_IN_FREE_MAP_WORD ); + for (j = !i; j < BITS_IN_FREE_MAP_WORD; ++j) + { + shm = (int *)((char *)shmbase + j * 16); + if (!(free_word & ((uint64_t)1 << j)) && shm[3] == id + && __atomic_load_n( &shm[2], __ATOMIC_SEQ_CST ) == 1) + fsync_free_shm_idx( i * BITS_IN_FREE_MAP_WORD + j ); + } + } +} + static int type_matches( enum fsync_type type1, enum fsync_type type2 ) { return (type1 == type2) || @@ -384,6 +426,8 @@ struct fsync_event { int signaled; int unused; + int ref; + int last_pid; }; void fsync_wake_futex( unsigned int shm_idx ) @@ -551,8 +595,12 @@ DECL_HANDLER(get_fsync_idx) if (obj->ops->get_fsync_idx) { + int *shm; + reply->shm_idx = obj->ops->get_fsync_idx( obj, &type ); reply->type = type; + shm = get_shm( reply->shm_idx ); + __atomic_add_fetch( &shm[2], 1, __ATOMIC_SEQ_CST ); } else { @@ -571,3 +619,13 @@ DECL_HANDLER(get_fsync_apc_idx) { reply->shm_idx = current->fsync_apc_idx; } + +DECL_HANDLER(fsync_free_shm_idx) +{ + if (!req->shm_idx || req->shm_idx >= shm_idx_free_map_size * BITS_IN_FREE_MAP_WORD) + { + set_error( STATUS_INVALID_PARAMETER ); + return; + } + fsync_free_shm_idx( req->shm_idx ); +} diff --git a/server/fsync.h b/server/fsync.h index ee1a729e77e5..d4bd889a7f88 100644 --- a/server/fsync.h +++ b/server/fsync.h @@ -33,3 +33,4 @@ extern const struct object_ops fsync_ops; extern void fsync_set_event( struct fsync *fsync ); extern void fsync_reset_event( struct fsync *fsync ); extern void fsync_abandon_mutexes( struct thread *thread ); +extern void fsync_cleanup_process_shm_indices( process_id_t id ); diff --git a/server/process.c b/server/process.c index d322a53593a6..d59fdc8c0eab 100644 --- a/server/process.c +++ b/server/process.c @@ -803,7 +803,11 @@ static void process_destroy( struct object *obj ) free( process->dir_cache ); free( process->image ); if (do_esync()) close( process->esync_fd ); - if (process->fsync_idx) fsync_free_shm_idx( process->fsync_idx ); + if (process->fsync_idx) + { + fsync_cleanup_process_shm_indices( process->id ); + fsync_free_shm_idx( process->fsync_idx ); + } } /* dump a process on stdout for debugging purposes */ diff --git a/server/protocol.def b/server/protocol.def index 21f7f02d4479..aa74e72b15a4 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -4185,3 +4185,8 @@ enum fsync_type @REPLY unsigned int shm_idx; @END + +@REQ(fsync_free_shm_idx) + unsigned int shm_idx; +@REPLY +@END From fe480411d51673ed36be20453e7bdc7579f1dae7 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 1 Aug 2022 10:53:28 -0500 Subject: [PATCH 0403/2542] fsync: Increase shm page size. CW-Bug-Id: #21050 --- dlls/ntdll/unix/fsync.c | 19 +++++++++---------- server/fsync.c | 19 +++++++++---------- server/protocol.def | 2 ++ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 309e2eb2affd..e709f2cbc00a 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -218,14 +218,13 @@ static char shm_name[29]; static int shm_fd; static void **shm_addrs; static int shm_addrs_size; /* length of the allocated shm_addrs array */ -static long pagesize; static pthread_mutex_t shm_addrs_mutex = PTHREAD_MUTEX_INITIALIZER; static void *get_shm( unsigned int idx ) { - int entry = (idx * 16) / pagesize; - int offset = (idx * 16) % pagesize; + int entry = (idx * 16) / FSYNC_SHM_PAGE_SIZE; + int offset = (idx * 16) % FSYNC_SHM_PAGE_SIZE; void *ret; pthread_mutex_lock( &shm_addrs_mutex ); @@ -242,14 +241,16 @@ static void *get_shm( unsigned int idx ) if (!shm_addrs[entry]) { - void *addr = mmap( NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, shm_fd, entry * pagesize ); + void *addr = mmap( NULL, FSYNC_SHM_PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, shm_fd, + (off_t)entry * FSYNC_SHM_PAGE_SIZE ); if (addr == (void *)-1) - ERR("Failed to map page %d (offset %#lx).\n", entry, entry * pagesize); + ERR("Failed to map page %d (offset %s).\n", entry, + wine_dbgstr_longlong((off_t)entry * FSYNC_SHM_PAGE_SIZE)); TRACE("Mapping page %d at %p.\n", entry, addr); if (__sync_val_compare_and_swap( &shm_addrs[entry], 0, addr )) - munmap( addr, pagesize ); /* someone beat us to it */ + munmap( addr, FSYNC_SHM_PAGE_SIZE ); /* someone beat us to it */ } ret = (void *)((unsigned long)shm_addrs[entry] + offset); @@ -326,10 +327,10 @@ static unsigned int shm_index_from_shm( char *shm ) for (i = 0; i < count; ++i) { - if (shm >= (char *)shm_addrs[i] && shm < (char *)shm_addrs[i] + pagesize) + if (shm >= (char *)shm_addrs[i] && shm < (char *)shm_addrs[i] + FSYNC_SHM_PAGE_SIZE) { idx_offset = (shm - (char *)shm_addrs[i]) / 16; - return i * (pagesize / 16) + idx_offset; + return i * (FSYNC_SHM_PAGE_SIZE / 16) + idx_offset; } } @@ -578,8 +579,6 @@ void fsync_init(void) exit(1); } - pagesize = sysconf( _SC_PAGESIZE ); - shm_addrs = calloc( 128, sizeof(shm_addrs[0]) ); shm_addrs_size = 128; } diff --git a/server/fsync.c b/server/fsync.c index 0e3862389da8..dc50aa0a1f39 100644 --- a/server/fsync.c +++ b/server/fsync.c @@ -73,7 +73,6 @@ static int shm_fd; static off_t shm_size; static void **shm_addrs; static int shm_addrs_size; /* length of the allocated shm_addrs array */ -static long pagesize; static int is_fsync_initialized; @@ -109,12 +108,10 @@ void fsync_init(void) if (shm_fd == -1) perror( "shm_open" ); - pagesize = sysconf( _SC_PAGESIZE ); - shm_addrs = calloc( 128, sizeof(shm_addrs[0]) ); shm_addrs_size = 128; - shm_size = pagesize; + shm_size = FSYNC_SHM_PAGE_SIZE; if (ftruncate( shm_fd, shm_size ) == -1) perror( "ftruncate" ); @@ -205,8 +202,8 @@ static void fsync_destroy( struct object *obj ) static void *get_shm( unsigned int idx ) { - int entry = (idx * 16) / pagesize; - int offset = (idx * 16) % pagesize; + int entry = (idx * 16) / FSYNC_SHM_PAGE_SIZE; + int offset = (idx * 16) % FSYNC_SHM_PAGE_SIZE; if (entry >= shm_addrs_size) { @@ -222,10 +219,12 @@ static void *get_shm( unsigned int idx ) if (!shm_addrs[entry]) { - void *addr = mmap( NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, shm_fd, entry * pagesize ); + void *addr = mmap( NULL, FSYNC_SHM_PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, shm_fd, + (off_t)entry * FSYNC_SHM_PAGE_SIZE ); if (addr == (void *)-1) { - fprintf( stderr, "fsync: failed to map page %d (offset %#lx): ", entry, entry * pagesize ); + fprintf( stderr, "fsync: failed to map page %d (offset %#zx): ", + entry, (size_t)entry * FSYNC_SHM_PAGE_SIZE ); perror( "mmap" ); } @@ -233,7 +232,7 @@ static void *get_shm( unsigned int idx ) fprintf( stderr, "fsync: Mapping page %d at %p.\n", entry, addr ); if (__sync_val_compare_and_swap( &shm_addrs[entry], 0, addr )) - munmap( addr, pagesize ); /* someone beat us to it */ + munmap( addr, FSYNC_SHM_PAGE_SIZE ); /* someone beat us to it */ } return (void *)((unsigned long)shm_addrs[entry] + offset); @@ -290,7 +289,7 @@ unsigned int fsync_alloc_shm( int low, int high ) while (shm_idx * 16 >= shm_size) { /* Better expand the shm section. */ - shm_size += pagesize; + shm_size += FSYNC_SHM_PAGE_SIZE; if (ftruncate( shm_fd, shm_size ) == -1) { fprintf( stderr, "fsync: couldn't expand %s to size %jd: ", diff --git a/server/protocol.def b/server/protocol.def index aa74e72b15a4..7751a75c42ba 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -4132,6 +4132,8 @@ enum esync_type @REQ(get_esync_apc_fd) @END +#define FSYNC_SHM_PAGE_SIZE 0x10000 + enum fsync_type { FSYNC_SEMAPHORE = 1, From 5cea9a23f04a4cad67fbe9b69a4b84cd44f93477 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 1 Aug 2022 11:01:51 -0500 Subject: [PATCH 0404/2542] fsync: Use static shm_addrs array and get rid of locking in get_shm(). CW-Bug-Id: #21050 --- dlls/ntdll/unix/fsync.c | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index e709f2cbc00a..be27906a37c6 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -216,27 +216,18 @@ C_ASSERT(sizeof(struct mutex) == 16); static char shm_name[29]; static int shm_fd; -static void **shm_addrs; -static int shm_addrs_size; /* length of the allocated shm_addrs array */ - -static pthread_mutex_t shm_addrs_mutex = PTHREAD_MUTEX_INITIALIZER; +static volatile void *shm_addrs[8192]; static void *get_shm( unsigned int idx ) { int entry = (idx * 16) / FSYNC_SHM_PAGE_SIZE; int offset = (idx * 16) % FSYNC_SHM_PAGE_SIZE; - void *ret; - - pthread_mutex_lock( &shm_addrs_mutex ); - if (entry >= shm_addrs_size) + if (entry >= ARRAY_SIZE(shm_addrs)) { - int new_size = max(shm_addrs_size * 2, entry + 1); - - if (!(shm_addrs = realloc( shm_addrs, new_size * sizeof(shm_addrs[0]) ))) - ERR("Failed to grow shm_addrs array to size %d.\n", shm_addrs_size); - memset( shm_addrs + shm_addrs_size, 0, (new_size - shm_addrs_size) * sizeof(shm_addrs[0]) ); - shm_addrs_size = new_size; + ERR( "idx %u exceeds maximum of %u.\n", idx, + (unsigned int)ARRAY_SIZE(shm_addrs) * (FSYNC_SHM_PAGE_SIZE / 16) ); + return NULL; } if (!shm_addrs[entry]) @@ -253,11 +244,7 @@ static void *get_shm( unsigned int idx ) munmap( addr, FSYNC_SHM_PAGE_SIZE ); /* someone beat us to it */ } - ret = (void *)((unsigned long)shm_addrs[entry] + offset); - - pthread_mutex_unlock( &shm_addrs_mutex ); - - return ret; + return (char *)shm_addrs[entry] + offset; } /* We'd like lookup to be fast. To that end, we use a static list indexed by handle. @@ -322,10 +309,9 @@ static void grab_object( struct fsync *obj ) static unsigned int shm_index_from_shm( char *shm ) { - unsigned int count = shm_addrs_size; unsigned int i, idx_offset; - for (i = 0; i < count; ++i) + for (i = 0; i < ARRAY_SIZE(shm_addrs); ++i) { if (shm >= (char *)shm_addrs[i] && shm < (char *)shm_addrs[i] + FSYNC_SHM_PAGE_SIZE) { @@ -578,9 +564,6 @@ void fsync_init(void) ERR("Failed to initialize shared memory: %s\n", strerror( errno )); exit(1); } - - shm_addrs = calloc( 128, sizeof(shm_addrs[0]) ); - shm_addrs_size = 128; } NTSTATUS fsync_create_semaphore( HANDLE *handle, ACCESS_MASK access, From 97000b4e523cf03c507a2f79105c082c7955eb13 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 16 Aug 2022 12:34:09 -0500 Subject: [PATCH 0405/2542] esync, fsync: Support waiting on file handles. CW-Bug-Id: #21132 --- server/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/file.c b/server/file.c index e98c2132e0d7..e1342f0951d4 100644 --- a/server/file.c +++ b/server/file.c @@ -94,8 +94,8 @@ static const struct object_ops file_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ - NULL, /* get_esync_fd */ - NULL, /* get_fsync_idx */ + default_fd_get_esync_fd, /* get_esync_fd */ + default_fd_get_fsync_idx, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ file_get_fd, /* get_fd */ From b49b425cd42c9005fc0d03ba6d62e05856204dda Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 7 Oct 2024 14:56:53 -0600 Subject: [PATCH 0406/2542] ntdll: fsync: Introduce explicit server wait helper and use it for some internal waits. CW-Bug-Id: #24295 --- dlls/ntdll/unix/sync.c | 14 ++++++++++++-- dlls/ntdll/unix/unix_private.h | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 15029aa8f1c5..0390e330f04c 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -1698,6 +1698,16 @@ NTSTATUS WINAPI NtWaitForSingleObject( HANDLE handle, BOOLEAN alertable, const L return NtWaitForMultipleObjects( 1, &handle, FALSE, alertable, timeout ); } +NTSTATUS wait_internal_server( HANDLE handle, BOOLEAN alertable, const LARGE_INTEGER *timeout ) +{ + union select_op select_op; + UINT flags = SELECT_INTERRUPTIBLE; + + if (alertable) flags |= SELECT_ALERTABLE; + select_op.wait.op = SELECT_WAIT; + select_op.wait.handles[0] = wine_server_obj_handle( handle ); + return server_wait( &select_op, offsetof( union select_op, wait.handles[1] ), flags, timeout ); +} /****************************************************************** * NtSignalAndWaitForSingleObject (NTDLL.@) @@ -2178,7 +2188,7 @@ NTSTATUS WINAPI NtRemoveIoCompletion( HANDLE handle, ULONG_PTR *key, ULONG_PTR * } SERVER_END_REQ; if (status != STATUS_PENDING) return status; - if (!timeout || timeout->QuadPart) status = NtWaitForSingleObject( wait_handle, FALSE, timeout ); + if (!timeout || timeout->QuadPart) status = wait_internal_server( wait_handle, FALSE, timeout ); else status = STATUS_TIMEOUT; if (status != WAIT_OBJECT_0) return status; @@ -2240,7 +2250,7 @@ NTSTATUS WINAPI NtRemoveIoCompletionEx( HANDLE handle, FILE_IO_COMPLETION_INFORM assert( status == STATUS_USER_APC ); goto done; } - if (!timeout || timeout->QuadPart) status = NtWaitForSingleObject( wait_handle, alertable, timeout ); + if (!timeout || timeout->QuadPart) status = wait_internal_server( wait_handle, alertable, timeout ); else status = STATUS_TIMEOUT; if (status != WAIT_OBJECT_0) goto done; diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 1a13ba34664e..87f3e49eebeb 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -217,6 +217,7 @@ extern unsigned int server_select( const union select_op *select_op, data_size_t timeout_t abs_timeout, struct context_data *context, struct user_apc *user_apc ); extern unsigned int server_wait( const union select_op *select_op, data_size_t size, UINT flags, const LARGE_INTEGER *timeout ); +extern NTSTATUS wait_internal_server( HANDLE handle, BOOLEAN alertable, const LARGE_INTEGER *timeout ); extern unsigned int server_queue_process_apc( HANDLE process, const union apc_call *call, union apc_result *result ); extern int server_get_unix_fd( HANDLE handle, unsigned int wanted_access, int *unix_fd, @@ -457,7 +458,7 @@ static inline struct async_data server_async( HANDLE handle, struct async_fileio static inline NTSTATUS wait_async( HANDLE handle, BOOL alertable ) { - return NtWaitForSingleObject( handle, alertable, NULL ); + return wait_internal_server( handle, alertable, NULL ); } static inline BOOL in_wow64_call(void) From 6338d7480d783299d510a71a5b396b7c2bfd2673 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 7 Oct 2024 16:26:51 -0600 Subject: [PATCH 0407/2542] esync, fsync: Support wait on completion ports. CW-Bug-Id: #24295 --- server/completion.c | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/server/completion.c b/server/completion.c index 2ff82b4e7bce..4c5d2f79bc13 100644 --- a/server/completion.c +++ b/server/completion.c @@ -35,6 +35,8 @@ #include "file.h" #include "handle.h" #include "request.h" +#include "esync.h" +#include "fsync.h" static const WCHAR completion_name[] = {'I','o','C','o','m','p','l','e','t','i','o','n'}; @@ -77,6 +79,8 @@ struct completion struct list wait_queue; unsigned int depth; int closed; + int esync_fd; + unsigned int fsync_idx; }; static void completion_wait_dump( struct object*, int ); @@ -151,12 +155,19 @@ static void completion_wait_satisfied( struct object *obj, struct wait_queue_ent msg = LIST_ENTRY( msg_entry, struct comp_msg, queue_entry ); --wait->completion->depth; list_remove( &msg->queue_entry ); + if (list_empty( &wait->completion->queue )) + { + if (do_esync()) esync_clear( wait->completion->esync_fd ); + if (do_fsync()) fsync_clear( &wait->completion->obj ); + } if (wait->msg) free( wait->msg ); wait->msg = msg; } static void completion_dump( struct object*, int ); static int completion_signaled( struct object *obj, struct wait_queue_entry *entry ); +static int completion_get_esync_fd( struct object *obj, enum esync_type *type ); +static unsigned int completion_get_fsync_idx( struct object *obj, enum fsync_type *type ); static int completion_close_handle( struct object *obj, struct process *process, obj_handle_t handle ); static void completion_destroy( struct object * ); @@ -168,8 +179,8 @@ static const struct object_ops completion_ops = add_queue, /* add_queue */ remove_queue, /* remove_queue */ completion_signaled, /* signaled */ - NULL, /* get_esync_fd */ - NULL, /* get_fsync_idx */ + completion_get_esync_fd, /* get_esync_fd */ + completion_get_fsync_idx, /* get_fsync_idx */ no_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ @@ -191,6 +202,9 @@ static void completion_destroy( struct object *obj) struct completion *completion = (struct completion *) obj; struct comp_msg *tmp, *next; + if (do_esync()) close( completion->esync_fd ); + if (completion->fsync_idx) fsync_free_shm_idx( completion->fsync_idx ); + LIST_FOR_EACH_ENTRY_SAFE( tmp, next, &completion->queue, struct comp_msg, queue_entry ) { free( tmp ); @@ -212,6 +226,23 @@ static int completion_signaled( struct object *obj, struct wait_queue_entry *ent return !list_empty( &completion->queue ) || completion->closed; } +static int completion_get_esync_fd( struct object *obj, enum esync_type *type ) +{ + struct completion *completion = (struct completion *)obj; + + *type = ESYNC_MANUAL_SERVER; + return completion->esync_fd; +} + +static unsigned int completion_get_fsync_idx( struct object *obj, enum fsync_type *type ) +{ + struct completion *completion = (struct completion *)obj; + + assert( obj->ops == &completion_ops ); + *type = FSYNC_MANUAL_SERVER; + return completion->fsync_idx; +} + static int completion_close_handle( struct object *obj, struct process *process, obj_handle_t handle ) { struct completion *completion = (struct completion *)obj; @@ -281,7 +312,9 @@ static struct completion *create_completion( struct object *root, const struct u completion->closed = 0; } } - + if (do_esync()) completion->esync_fd = esync_create_fd( 0, 0 ); + completion->fsync_idx = 0; + if (do_fsync()) completion->fsync_idx = fsync_alloc_shm( 0, 0 ); return completion; } @@ -412,6 +445,11 @@ DECL_HANDLER(remove_completion) reply->information = msg->information; free( msg ); reply->wait_handle = 0; + if (list_empty( &completion->queue )) + { + if (do_esync()) esync_clear( completion->esync_fd ); + if (do_fsync()) fsync_clear( &completion->obj ); + } } release_object( completion ); From 3ce1b76081b97e87f4e34e670ad06f19afc5f103 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 7 Oct 2024 21:11:04 -0600 Subject: [PATCH 0408/2542] ntdll: esync, fsync: Check for port signal state for zero timeout in NtRemoveIoCompletion[Ex]. CW-Bug-Id: #24295 --- dlls/ntdll/unix/sync.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 0390e330f04c..b3b3ebc69fee 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -2173,6 +2173,12 @@ NTSTATUS WINAPI NtRemoveIoCompletion( HANDLE handle, ULONG_PTR *key, ULONG_PTR * TRACE( "(%p, %p, %p, %p, %p)\n", handle, key, value, io, timeout ); + if (timeout && !timeout->QuadPart && (do_esync() || do_fsync())) + { + status = NtWaitForSingleObject( handle, FALSE, timeout ); + if (status != WAIT_OBJECT_0) return status; + } + SERVER_START_REQ( remove_completion ) { req->handle = wine_server_obj_handle( handle ); @@ -2220,6 +2226,12 @@ NTSTATUS WINAPI NtRemoveIoCompletionEx( HANDLE handle, FILE_IO_COMPLETION_INFORM TRACE( "%p %p %u %p %p %u\n", handle, info, (int)count, written, timeout, alertable ); + if (timeout && !timeout->QuadPart && (do_esync() || do_fsync())) + { + status = NtWaitForSingleObject( handle, alertable, timeout ); + if (status != WAIT_OBJECT_0) goto done; + } + while (i < count) { SERVER_START_REQ( remove_completion ) From e8f3c583ca91e597a50de3d1390116c2302f56c4 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 17 Aug 2022 18:22:35 -0500 Subject: [PATCH 0409/2542] ntdll: Enable WINE_FSYNC_SIMULATE_SCHED_QUANTUM for Planet Zoo. CW-Bug-Id: #21142 --- dlls/ntdll/unix/loader.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 5c7f980b1949..97f5280a2f88 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2027,7 +2027,10 @@ static void hacks_init(void) if (env_str) fsync_simulate_sched_quantum = !!atoi(env_str); else if (main_argc > 1) + { fsync_simulate_sched_quantum = !!strstr(main_argv[1], "Ubisoft Game Launcher\\upc.exe"); + fsync_simulate_sched_quantum = fsync_simulate_sched_quantum || !!strstr(main_argv[1], "PlanetZoo.exe"); + } if (fsync_simulate_sched_quantum) ERR("HACK: Simulating sched quantum in fsync.\n"); From ab746c33532e76835acbe920efdfbbafd1a3eb0d Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 9 Sep 2022 17:37:39 -0500 Subject: [PATCH 0410/2542] ntdll: Enable WINE_FSYNC_SIMULATE_SCHED_QUANTUM for GTA5. CW-Bug-Id: #21194 --- dlls/ntdll/unix/loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 97f5280a2f88..38705dca8ba0 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2030,6 +2030,7 @@ static void hacks_init(void) { fsync_simulate_sched_quantum = !!strstr(main_argv[1], "Ubisoft Game Launcher\\upc.exe"); fsync_simulate_sched_quantum = fsync_simulate_sched_quantum || !!strstr(main_argv[1], "PlanetZoo.exe"); + fsync_simulate_sched_quantum = fsync_simulate_sched_quantum || !!strstr(main_argv[1], "GTA5.exe"); } if (fsync_simulate_sched_quantum) ERR("HACK: Simulating sched quantum in fsync.\n"); From 6b88d76f9405aa1397ab93e0d8037efec07d41b2 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 9 Sep 2022 18:21:26 -0500 Subject: [PATCH 0411/2542] ntdll: HACK: Add WINE_ALERT_SIMULATE_SCHED_QUANTUM option. And enable it for GTA 5. CW-Bug-Id: #21194 --- dlls/ntdll/unix/loader.c | 11 +++++++++++ dlls/ntdll/unix/sync.c | 8 ++++++++ dlls/ntdll/unix/unix_private.h | 1 + 3 files changed, 20 insertions(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 38705dca8ba0..2c34474f8c9c 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2012,6 +2012,7 @@ static ULONG_PTR get_image_address(void) BOOL ac_odyssey; BOOL fsync_simulate_sched_quantum; +BOOL alert_simulate_sched_quantum; static void hacks_init(void) { @@ -2035,6 +2036,16 @@ static void hacks_init(void) if (fsync_simulate_sched_quantum) ERR("HACK: Simulating sched quantum in fsync.\n"); + env_str = getenv("WINE_ALERT_SIMULATE_SCHED_QUANTUM"); + if (env_str) + alert_simulate_sched_quantum = !!atoi(env_str); + else if (main_argc > 1) + { + alert_simulate_sched_quantum = !!strstr(main_argv[1], "GTA5.exe"); + } + if (alert_simulate_sched_quantum) + ERR("HACK: Simulating sched quantum in NtWaitForAlertByThreadId.\n"); + switch (sgi ? atoi( sgi ) : -1) { case 25700: /* Madballs in Babo: Invasion */ diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index b3b3ebc69fee..68e9223e5ee2 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -2844,6 +2844,7 @@ static LONGLONG update_timeout( ULONGLONG end ) NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEGER *timeout ) { union tid_alert_entry *entry = get_tid_alert_entry( NtCurrentTeb()->ClientId.UniqueThread ); + BOOL waited = FALSE; TRACE( "%p %s\n", address, debugstr_timeout( timeout ) ); @@ -2877,8 +2878,15 @@ NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEG else ret = futex_wait( futex, 0, NULL ); + if (!timeout || timeout->QuadPart) + waited = TRUE; + if (ret == -1 && errno == ETIMEDOUT) return STATUS_TIMEOUT; } + + if (alert_simulate_sched_quantum && waited) + usleep(0); + return STATUS_ALERTED; } #elif defined(HAVE_KQUEUE) diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 87f3e49eebeb..6fdbb58f1ef4 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -191,6 +191,7 @@ extern struct ldt_copy __wine_ldt_copy; extern BOOL ac_odyssey; extern BOOL fsync_simulate_sched_quantum; +extern BOOL alert_simulate_sched_quantum; extern void init_environment(void); extern void init_startup_info(void); From b6cb080297a41a563db049f523be0a6e0f1c9f7b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 16 Dec 2022 16:21:50 -0600 Subject: [PATCH 0412/2542] ntdll: HACK: Also simulate async file read and IO cancellation for Immortals Fenyx Rising. CW-Bug-Id: #21711 --- dlls/ntdll/unix/loader.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 2c34474f8c9c..65f53ecd83aa 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2019,11 +2019,15 @@ static void hacks_init(void) const char *sgi = getenv( "SteamGameId" ); const char *env_str; - if (main_argc > 1 && strstr(main_argv[1], "ACOdyssey.exe")) - { - ERR("HACK: AC Odyssey sync tweak on.\n"); + env_str = getenv("WINE_SIMULATE_ASYNC_READ"); + if (env_str) + ac_odyssey = !!atoi(env_str); + else if (main_argc > 1 && (strstr(main_argv[1], "ACOdyssey.exe") || strstr(main_argv[1], "ImmortalsFenyxRising.exe"))) ac_odyssey = TRUE; - } + + if (ac_odyssey) + ERR("HACK: AC Odyssey sync tweak on.\n"); + env_str = getenv("WINE_FSYNC_SIMULATE_SCHED_QUANTUM"); if (env_str) fsync_simulate_sched_quantum = !!atoi(env_str); From df66461b793b31ea2592cfda3008c5e53b1371f4 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 7 Mar 2023 15:54:01 -0600 Subject: [PATCH 0413/2542] fsync: Retry grabbing semaphore if count has changed. CW-Bug-Id: #21996 --- dlls/ntdll/unix/fsync.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index be27906a37c6..4dade5eb27fe 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -975,15 +975,18 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, case FSYNC_SEMAPHORE: { struct semaphore *semaphore = obj->shm; - int current; + int current, new; - if ((current = __atomic_load_n( &semaphore->count, __ATOMIC_SEQ_CST )) - && __sync_val_compare_and_swap( &semaphore->count, current, current - 1 ) == current) + new = __atomic_load_n( &semaphore->count, __ATOMIC_SEQ_CST ); + while ((current = new)) { - TRACE("Woken up by handle %p [%d].\n", handles[i], i); - if (waited) simulate_sched_quantum(); - put_objects( objs, count ); - return i; + if ((new = __sync_val_compare_and_swap( &semaphore->count, current, current - 1 )) == current) + { + TRACE("Woken up by handle %p [%d].\n", handles[i], i); + if (waited) simulate_sched_quantum(); + put_objects( objs, count ); + return i; + } } futex_vector_set( &futexes[i], &semaphore->count, 0 ); break; @@ -1229,10 +1232,15 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, case FSYNC_SEMAPHORE: { struct semaphore *semaphore = obj->shm; - int current; + int current, new; - if (!(current = __atomic_load_n( &semaphore->count, __ATOMIC_SEQ_CST )) - || __sync_val_compare_and_swap( &semaphore->count, current, current - 1 ) != current) + new = __atomic_load_n( &semaphore->count, __ATOMIC_SEQ_CST ); + while ((current = new)) + { + if ((new = __sync_val_compare_and_swap( &semaphore->count, current, current - 1 )) == current) + break; + } + if (!current) goto tooslow; break; } From 7ea88b2d2d79d7522e79b68d478c051977ac9b59 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 27 Apr 2023 16:53:17 -0600 Subject: [PATCH 0414/2542] fsync: Cache current process ID. CW-Bug-Id: #22194 --- dlls/ntdll/unix/fsync.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 4dade5eb27fe..c5d38754ea6e 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -59,6 +59,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(fsync); #include "pshpack4.h" #include "poppack.h" +static int current_pid; + /* futex_waitv interface */ #ifndef __NR_futex_waitv @@ -348,7 +350,7 @@ static void put_object_from_wait( struct fsync *obj ) { int *shm = obj->shm; - __sync_val_compare_and_swap( &shm[3], GetCurrentProcessId(), 0 ); + __sync_val_compare_and_swap( &shm[3], current_pid, 0 ); put_object( obj ); } @@ -434,7 +436,7 @@ static NTSTATUS get_object_for_wait( HANDLE handle, struct fsync *obj ) shm = obj->shm; /* Give wineserver a chance to cleanup shm index if the process * is killed while we are waiting on the object. */ - __atomic_store_n( &shm[3], GetCurrentProcessId(), __ATOMIC_SEQ_CST ); + __atomic_store_n( &shm[3], current_pid, __ATOMIC_SEQ_CST ); return STATUS_SUCCESS; } @@ -564,6 +566,9 @@ void fsync_init(void) ERR("Failed to initialize shared memory: %s\n", strerror( errno )); exit(1); } + + current_pid = GetCurrentProcessId(); + assert(current_pid); } NTSTATUS fsync_create_semaphore( HANDLE *handle, ACCESS_MASK access, From 69a0856a6216fad0ec7e24b91f6a9e544cf8e31b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 27 Apr 2023 16:56:26 -0600 Subject: [PATCH 0415/2542] fsync: Cache current TID in __fsync_wait_objects(). CW-Bug-Id: #22194 --- dlls/ntdll/unix/fsync.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index c5d38754ea6e..d3ad97886005 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -871,6 +871,9 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, { static const LARGE_INTEGER zero = {0}; + int current_tid = 0; +#define CURRENT_TID (current_tid ? current_tid : (current_tid = GetCurrentThreadId())) + struct futex_waitv futexes[MAXIMUM_WAIT_OBJECTS + 1]; struct fsync objs[MAXIMUM_WAIT_OBJECTS]; BOOL msgwait = FALSE, waited = FALSE; @@ -1001,7 +1004,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, struct mutex *mutex = obj->shm; int tid; - if (mutex->tid == GetCurrentThreadId()) + if (mutex->tid == CURRENT_TID) { TRACE("Woken up by handle %p [%d].\n", handles[i], i); mutex->count++; @@ -1010,7 +1013,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, return i; } - if (!(tid = __sync_val_compare_and_swap( &mutex->tid, 0, GetCurrentThreadId() ))) + if (!(tid = __sync_val_compare_and_swap( &mutex->tid, 0, CURRENT_TID ))) { TRACE("Woken up by handle %p [%d].\n", handles[i], i); mutex->count = 1; @@ -1018,7 +1021,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, put_objects( objs, count ); return i; } - else if (tid == ~0 && (tid = __sync_val_compare_and_swap( &mutex->tid, ~0, GetCurrentThreadId() )) == ~0) + else if (tid == ~0 && (tid = __sync_val_compare_and_swap( &mutex->tid, ~0, CURRENT_TID )) == ~0) { TRACE("Woken up by abandoned mutex %p [%d].\n", handles[i], i); mutex->count = 1; @@ -1157,7 +1160,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, { struct mutex *mutex = obj->shm; - if (mutex->tid == GetCurrentThreadId()) + if (mutex->tid == CURRENT_TID) continue; while ((current = __atomic_load_n( &mutex->tid, __ATOMIC_SEQ_CST ))) @@ -1201,7 +1204,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, struct mutex *mutex = obj->shm; int tid = __atomic_load_n( &mutex->tid, __ATOMIC_SEQ_CST ); - if (tid && tid != ~0 && tid != GetCurrentThreadId()) + if (tid && tid != ~0 && tid != CURRENT_TID) goto tryagain; } else if (obj->type) @@ -1224,11 +1227,11 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, { struct mutex *mutex = obj->shm; int tid = __atomic_load_n( &mutex->tid, __ATOMIC_SEQ_CST ); - if (tid == GetCurrentThreadId()) + if (tid == CURRENT_TID) break; if (tid && tid != ~0) goto tooslow; - if (__sync_val_compare_and_swap( &mutex->tid, tid, GetCurrentThreadId() ) != tid) + if (__sync_val_compare_and_swap( &mutex->tid, tid, CURRENT_TID ) != tid) goto tooslow; if (tid == ~0) abandoned = TRUE; @@ -1338,6 +1341,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, * right thing to do seems to be to return STATUS_USER_APC anyway. */ if (ret == STATUS_TIMEOUT) ret = STATUS_USER_APC; return ret; +#undef CURRENT_TID } /* Like esync, we need to let the server know when we are doing a message wait, From 9398d051c53a9b006ce93c6b962835cfe7c6640f Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 27 Apr 2023 17:32:38 -0600 Subject: [PATCH 0416/2542] fsync: Add WINE_FSYNC_YIELD_TO_WAITERS option. CW-Bug-Id: #22194 --- dlls/ntdll/unix/fsync.c | 37 +++++++++++++++++++++++++++++++--- dlls/ntdll/unix/loader.c | 7 +++++++ dlls/ntdll/unix/unix_private.h | 1 + 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index d3ad97886005..0e862e5bbc29 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -426,7 +426,7 @@ static NTSTATUS get_object( HANDLE handle, struct fsync *obj ) return ret; } -static NTSTATUS get_object_for_wait( HANDLE handle, struct fsync *obj ) +static NTSTATUS get_object_for_wait( HANDLE handle, struct fsync *obj, int *prev_pid ) { NTSTATUS ret; int *shm; @@ -436,7 +436,10 @@ static NTSTATUS get_object_for_wait( HANDLE handle, struct fsync *obj ) shm = obj->shm; /* Give wineserver a chance to cleanup shm index if the process * is killed while we are waiting on the object. */ - __atomic_store_n( &shm[3], current_pid, __ATOMIC_SEQ_CST ); + if (fsync_yield_to_waiters) + *prev_pid = __atomic_exchange_n( &shm[3], current_pid, __ATOMIC_SEQ_CST ); + else + __atomic_store_n( &shm[3], current_pid, __ATOMIC_SEQ_CST ); return STATUS_SUCCESS; } @@ -823,6 +826,24 @@ NTSTATUS fsync_query_mutex( HANDLE handle, void *info, ULONG *ret_len ) return STATUS_SUCCESS; } +static inline void try_yield_to_waiters( int prev_pid ) +{ + if (!fsync_yield_to_waiters) return; + + /* On Windows singaling an object will wake the threads waiting on the object. With fsync + * it may happen that signaling thread (or other thread) grabs the object before the already waiting + * thread gets a chance. Try to workaround that for the affected apps. Non-zero 'prev_pid' indicates + * that the object is grabbed in __fsync_wait_objects() by some other thread. It is the same for + * a non-current pid, but we may currently have a stale PID on an object from a terminated process + * and it is probably safer to skip this workaround. This won't work great if the object is used in 'wait all' + * and the waiter is blocked on the other object. + * This check is also not entirely reliable as if multiple waiters from the same process enter + * __fsync_wait_objects() the first one leaving will clear 'last_pid' in the object. */ + + if (prev_pid == current_pid) + usleep(0); +} + static NTSTATUS do_single_wait( int *addr, int val, const struct timespec64 *end, clockid_t clock_id, BOOLEAN alertable ) { @@ -877,6 +898,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, struct futex_waitv futexes[MAXIMUM_WAIT_OBJECTS + 1]; struct fsync objs[MAXIMUM_WAIT_OBJECTS]; BOOL msgwait = FALSE, waited = FALSE; + int prev_pids[MAXIMUM_WAIT_OBJECTS]; int has_fsync = 0, has_server = 0; clockid_t clock_id = 0; struct timespec64 end; @@ -907,7 +929,7 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, for (i = 0; i < count; i++) { - ret = get_object_for_wait( handles[i], &objs[i] ); + ret = get_object_for_wait( handles[i], &objs[i], &prev_pids[i] ); if (ret == STATUS_SUCCESS) { assert( objs[i].type ); @@ -986,6 +1008,9 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, int current, new; new = __atomic_load_n( &semaphore->count, __ATOMIC_SEQ_CST ); + if (!waited && new) + try_yield_to_waiters(prev_pids[i]); + while ((current = new)) { if ((new = __sync_val_compare_and_swap( &semaphore->count, current, current - 1 )) == current) @@ -1013,6 +1038,9 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, return i; } + if (!waited && !mutex->tid) + try_yield_to_waiters(prev_pids[i]); + if (!(tid = __sync_val_compare_and_swap( &mutex->tid, 0, CURRENT_TID ))) { TRACE("Woken up by handle %p [%d].\n", handles[i], i); @@ -1037,6 +1065,9 @@ static NTSTATUS __fsync_wait_objects( DWORD count, const HANDLE *handles, { struct event *event = obj->shm; + if (!waited && event->signaled) + try_yield_to_waiters(prev_pids[i]); + if (__sync_val_compare_and_swap( &event->signaled, 1, 0 )) { if (ac_odyssey && alertable) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 65f53ecd83aa..1fc631a5753b 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2013,6 +2013,7 @@ static ULONG_PTR get_image_address(void) BOOL ac_odyssey; BOOL fsync_simulate_sched_quantum; BOOL alert_simulate_sched_quantum; +BOOL fsync_yield_to_waiters; static void hacks_init(void) { @@ -2050,6 +2051,12 @@ static void hacks_init(void) if (alert_simulate_sched_quantum) ERR("HACK: Simulating sched quantum in NtWaitForAlertByThreadId.\n"); + env_str = getenv("WINE_FSYNC_YIELD_TO_WAITERS"); + if (env_str) + fsync_yield_to_waiters = !!atoi(env_str); + if (fsync_yield_to_waiters) + ERR("HACK: fsync: yield to waiters.\n"); + switch (sgi ? atoi( sgi ) : -1) { case 25700: /* Madballs in Babo: Invasion */ diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 6fdbb58f1ef4..8f463c7fe917 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -192,6 +192,7 @@ extern struct ldt_copy __wine_ldt_copy; extern BOOL ac_odyssey; extern BOOL fsync_simulate_sched_quantum; extern BOOL alert_simulate_sched_quantum; +extern BOOL fsync_yield_to_waiters; extern void init_environment(void); extern void init_startup_info(void); From 2d49b2c3a50664daa58b67b9619c267065899b7d Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 27 Apr 2023 18:19:01 -0600 Subject: [PATCH 0417/2542] ntdll: HACK: Enable WINE_FSYNC_YIELD_TO_WAITERS for FFXIII. CW-Bug-Id: #22194 --- dlls/ntdll/unix/loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 1fc631a5753b..2007a94402f8 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2054,6 +2054,7 @@ static void hacks_init(void) env_str = getenv("WINE_FSYNC_YIELD_TO_WAITERS"); if (env_str) fsync_yield_to_waiters = !!atoi(env_str); + else if (sgi) fsync_yield_to_waiters = !strcmp(sgi, "292120"); if (fsync_yield_to_waiters) ERR("HACK: fsync: yield to waiters.\n"); From db653fc055feeb46024b68cc8b7e88037641841f Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 21 Nov 2023 18:06:59 -0600 Subject: [PATCH 0418/2542] ntdll: HACK: Enable fsync_yield_to_waiters for LIGHTNING RETURNS: FFXIII. CW-Bug-Id: #23021 --- dlls/ntdll/unix/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 2007a94402f8..b8c2555c3ac3 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2054,7 +2054,7 @@ static void hacks_init(void) env_str = getenv("WINE_FSYNC_YIELD_TO_WAITERS"); if (env_str) fsync_yield_to_waiters = !!atoi(env_str); - else if (sgi) fsync_yield_to_waiters = !strcmp(sgi, "292120"); + else if (sgi) fsync_yield_to_waiters = !strcmp(sgi, "292120") || !strcmp(sgi, "345350"); if (fsync_yield_to_waiters) ERR("HACK: fsync: yield to waiters.\n"); From 192ca53febeb0972ec032cf2e6a5e84a63682877 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 6 Dec 2023 21:06:56 -0600 Subject: [PATCH 0419/2542] ntdll: HACK: Enable fsync_yield_to_waiters for FFXIII-2. CW-Bug-Id: #23021 --- dlls/ntdll/unix/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index b8c2555c3ac3..c2a33682f62f 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2054,7 +2054,7 @@ static void hacks_init(void) env_str = getenv("WINE_FSYNC_YIELD_TO_WAITERS"); if (env_str) fsync_yield_to_waiters = !!atoi(env_str); - else if (sgi) fsync_yield_to_waiters = !strcmp(sgi, "292120") || !strcmp(sgi, "345350"); + else if (sgi) fsync_yield_to_waiters = !strcmp(sgi, "292120") || !strcmp(sgi, "345350") || !strcmp(sgi, "292140"); if (fsync_yield_to_waiters) ERR("HACK: fsync: yield to waiters.\n"); From d85f1ce34b87783773a849118484be0c7623119e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 13 Mar 2023 21:39:04 -0600 Subject: [PATCH 0420/2542] fsync: Avoid race between NtClose() and get_object(). CW-Bug-Id: #22029 --- dlls/ntdll/unix/fsync.c | 19 ++++++++++++++++--- dlls/ntdll/unix/fsync.h | 5 +++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 0e862e5bbc29..3aa32872a800 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -374,8 +374,9 @@ static BOOL get_cached_object( HANDLE handle, struct fsync *obj ) { /* This check does not strictly guarantee that we avoid the potential race but is supposed to greatly * reduce the probability of that. */ + FIXME( "Cache changed while getting object, handle %p, shm_idx %d, refcount %d.\n", + handle, cache.shm_idx, ((int *)obj->shm)[2] ); put_object( obj ); - FIXME( "Cache changed while getting object.\n" ); goto again; } return TRUE; @@ -390,6 +391,7 @@ static NTSTATUS get_object( HANDLE handle, struct fsync *obj ) NTSTATUS ret = STATUS_SUCCESS; unsigned int shm_idx = 0; enum fsync_type type; + sigset_t sigset; if (get_cached_object( handle, obj )) return STATUS_SUCCESS; @@ -399,7 +401,17 @@ static NTSTATUS get_object( HANDLE handle, struct fsync *obj ) return STATUS_NOT_IMPLEMENTED; } - /* We need to try grabbing it from the server. */ + + /* We need to try grabbing it from the server. Uninterrupted section + * is needed to avoid race with NtClose() which first calls fsync_close() + * and then closes handle on server. Without the section we might cache + * already closed handle back. */ + server_enter_uninterrupted_section( &fd_cache_mutex, &sigset ); + if (get_cached_object( handle, obj )) + { + server_leave_uninterrupted_section( &fd_cache_mutex, &sigset ); + return STATUS_SUCCESS; + } SERVER_START_REQ( get_fsync_idx ) { req->handle = wine_server_obj_handle( handle ); @@ -410,6 +422,8 @@ static NTSTATUS get_object( HANDLE handle, struct fsync *obj ) } } SERVER_END_REQ; + if (!ret) add_to_list( handle, type, shm_idx ); + server_leave_uninterrupted_section( &fd_cache_mutex, &sigset ); if (ret) { @@ -421,7 +435,6 @@ static NTSTATUS get_object( HANDLE handle, struct fsync *obj ) obj->type = type; obj->shm = get_shm( shm_idx ); - add_to_list( handle, type, shm_idx ); /* get_fsync_idx server request increments shared mem refcount, so not grabbing object here. */ return ret; } diff --git a/dlls/ntdll/unix/fsync.h b/dlls/ntdll/unix/fsync.h index 763e7891ab84..6005c0fa322b 100644 --- a/dlls/ntdll/unix/fsync.h +++ b/dlls/ntdll/unix/fsync.h @@ -47,3 +47,8 @@ extern NTSTATUS fsync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN BOOLEAN alertable, const LARGE_INTEGER *timeout ); extern NTSTATUS fsync_signal_and_wait( HANDLE signal, HANDLE wait, BOOLEAN alertable, const LARGE_INTEGER *timeout ); + +/* We have to synchronize on the fd cache mutex so that fsync_close(), close_handle() sequence + * called from NtClose() doesn't race with get_fsync_idx(), add_to_list() sequence called + * from get_object(). */ +extern pthread_mutex_t fd_cache_mutex; From 1a1e15b56656cf6d55065bf9664315a4e2d87ee1 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 3 Jul 2023 13:30:33 -0600 Subject: [PATCH 0421/2542] fsync: Check for NULL handle in get_object(). CW-Bug-Id: #22395 --- dlls/ntdll/unix/fsync.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 3aa32872a800..8f20f7cab4ac 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -401,6 +401,7 @@ static NTSTATUS get_object( HANDLE handle, struct fsync *obj ) return STATUS_NOT_IMPLEMENTED; } + if (!handle) return STATUS_INVALID_HANDLE; /* We need to try grabbing it from the server. Uninterrupted section * is needed to avoid race with NtClose() which first calls fsync_close() From 901cc61883eb38c8e2c3f6d0917433989876c696 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Fri, 9 Jun 2023 15:12:31 +0800 Subject: [PATCH 0422/2542] fsync: Type-check HANDLE in fsync_reset_event(). Oddworld: Stranger's Wrath HD (15750) calls ResetEvent() on a file handle and then waits for the handle with an infinite timeout. Without esync/fsync, NtResetEvent() should return STATUS_OBJECT_TYPE_MISMATCH because the handle is not an event handle. With esync/fsync, the file handle is set to non-signaled successfully and causes the game to hang at start-up. The same check should also apply to fsync_pulse_event(), esync_reset_event(), and esync_pulse_event(). CW-Bug-Id: #22326 --- dlls/ntdll/unix/fsync.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 8f20f7cab4ac..3dfa7c4e035a 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -714,6 +714,12 @@ NTSTATUS fsync_reset_event( HANDLE handle, LONG *prev ) if ((ret = get_object( handle, &obj ))) return ret; event = obj.shm; + if (obj.type != FSYNC_MANUAL_EVENT && obj.type != FSYNC_AUTO_EVENT) + { + put_object( &obj ); + return STATUS_OBJECT_TYPE_MISMATCH; + } + current = __atomic_exchange_n( &event->signaled, 0, __ATOMIC_SEQ_CST ); if (prev) *prev = current; From 2d46670338bad398ae541ca5706b255e17c25a33 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Fri, 9 Jun 2023 15:13:12 +0800 Subject: [PATCH 0423/2542] fsync: Type-check HANDLE in fsync_pulse_event(). CW-Bug-Id: #22326 --- dlls/ntdll/unix/fsync.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index 3dfa7c4e035a..c3da44e4f268 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -740,6 +740,12 @@ NTSTATUS fsync_pulse_event( HANDLE handle, LONG *prev ) if ((ret = get_object( handle, &obj ))) return ret; event = obj.shm; + if (obj.type != FSYNC_MANUAL_EVENT && obj.type != FSYNC_AUTO_EVENT) + { + put_object( &obj ); + return STATUS_OBJECT_TYPE_MISMATCH; + } + /* This isn't really correct; an application could miss the write. * Unfortunately we can't really do much better. Fortunately this is rarely * used (and publicly deprecated). */ From b9f2373ac8321718b97445c1edeec77170cf3639 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Fri, 9 Jun 2023 15:14:59 +0800 Subject: [PATCH 0424/2542] esync: Type-check HANDLE in esync_reset_event(). CW-Bug-Id: #22326 --- dlls/ntdll/unix/esync.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 7b85981cd772..8b3983151d36 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -571,6 +571,9 @@ NTSTATUS esync_reset_event( HANDLE handle ) if ((ret = get_object( handle, &obj ))) return ret; event = obj->shm; + if (obj->type != ESYNC_MANUAL_EVENT && obj->type != ESYNC_AUTO_EVENT) + return STATUS_OBJECT_TYPE_MISMATCH; + if (obj->type == ESYNC_MANUAL_EVENT) { /* Acquire the spinlock. */ From 4ecaac7c806ab8a439db4f00b55710da40cc145f Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Fri, 9 Jun 2023 15:15:55 +0800 Subject: [PATCH 0425/2542] esync: Type-check HANDLE in esync_pulse_event(). CW-Bug-Id: #22326 --- dlls/ntdll/unix/esync.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 8b3983151d36..3074f7c72ea8 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c @@ -614,6 +614,9 @@ NTSTATUS esync_pulse_event( HANDLE handle ) if ((ret = get_object( handle, &obj ))) return ret; + if (obj->type != ESYNC_MANUAL_EVENT && obj->type != ESYNC_AUTO_EVENT) + return STATUS_OBJECT_TYPE_MISMATCH; + /* This isn't really correct; an application could miss the write. * Unfortunately we can't really do much better. Fortunately this is rarely * used (and publicly deprecated). */ From df3a5bf608ed0549cb7ba3642cd43e45ef7dab2a Mon Sep 17 00:00:00 2001 From: Tatsuyuki Ishi Date: Sat, 17 Feb 2024 22:11:43 +0900 Subject: [PATCH 0426/2542] ntdll: Don't leak objattr allocation in NtCreateSemaphore. https://github.com/ValveSoftware/wine/pull/219 --- dlls/ntdll/unix/sync.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 68e9223e5ee2..5e7e458958f0 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -315,7 +315,6 @@ NTSTATUS WINAPI NtCreateSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJ *handle = 0; if (max <= 0 || initial < 0 || initial > max) return STATUS_INVALID_PARAMETER; - if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret; if (do_fsync()) return fsync_create_semaphore( handle, access, attr, initial, max ); @@ -323,6 +322,8 @@ NTSTATUS WINAPI NtCreateSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJ if (do_esync()) return esync_create_semaphore( handle, access, attr, initial, max ); + if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret; + SERVER_START_REQ( create_semaphore ) { req->access = access; From deaa18f797d39c453b42d9767661263f26553744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 14 Dec 2022 21:57:01 +0100 Subject: [PATCH 0427/2542] HACK: ntdll: Set LIBGL_ALWAYS_SOFTWARE for Witcher 3 (Launcher). CW-Bug-Id: #21699 --- dlls/ntdll/unix/loader.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index c2a33682f62f..4d184e6210d1 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2077,6 +2077,11 @@ static void hacks_init(void) ERR("HACK: setting WINE_ENABLE_GST_LIVE_LATENCY.\n"); setenv("WINE_ENABLE_GST_LIVE_LATENCY", "1", 0); } + if (sgi && !strcmp(sgi, "292030")) + { + ERR("HACK: setting LIBGL_ALWAYS_SOFTWARE.\n"); + setenv("LIBGL_ALWAYS_SOFTWARE", "1", 0); + } } /*********************************************************************** From 989b2e3e58d7b9b198f495ee59195761f5271ca1 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 8 Jul 2022 20:01:17 -0500 Subject: [PATCH 0428/2542] win32u: Don't load bitmap only TTF fonts without bitmap table. CW-Bug-Id: #20934 --- dlls/win32u/freetype.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/freetype.c b/dlls/win32u/freetype.c index d1e46a681eac..48f7a792ae4b 100644 --- a/dlls/win32u/freetype.c +++ b/dlls/win32u/freetype.c @@ -256,6 +256,8 @@ MAKE_FUNCPTR(FcStrSetMember); #define GET_BE_DWORD(x) RtlUlongByteSwap(x) #endif +#define MS_EBDT_TAG MS_MAKE_TAG('E','B','D','T') + /* 'gasp' flags */ #define GASP_GRIDFIT 0x01 #define GASP_DOGRAY 0x02 @@ -1180,6 +1182,8 @@ static struct unix_face *unix_face_create( const char *unix_name, void *data_ptr struct stat st; DWORD face_count; int fd, length; + FT_Error error; + FT_ULong len; TRACE( "unix_name %s, face_index %u, data_ptr %p, data_size %u, flags %#x\n", unix_name, face_index, data_ptr, data_size, flags ); @@ -1276,7 +1280,20 @@ static struct unix_face *unix_face_create( const char *unix_name, void *data_ptr else This->weight = This->ntm_flags & NTM_BOLD ? FW_BOLD : FW_NORMAL; This->font_version = get_font_version( This->ft_face ); - if (!This->scalable) get_bitmap_size( This->ft_face, &This->size ); + if (!This->scalable) + { + error = pFT_Load_Sfnt_Table( This->ft_face, RtlUlongByteSwap(MS_EBDT_TAG), 0, NULL, &len ); + if (error == FT_Err_Table_Missing) + { + WARN( "EBDT table is missing in bitmap only font %s.\n", + debugstr_w(ft_face_get_family_name( This->ft_face, system_lcid ))); + pFT_Done_Face( This->ft_face ); + free( This ); + This = NULL; + goto done; + } + get_bitmap_size( This->ft_face, &This->size ); + } get_fontsig( This->ft_face, &This->fs ); } else From dde6902fe4bb902b8b8b0a020431c6636bea7eb2 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Thu, 24 Jun 2021 17:27:08 +0200 Subject: [PATCH 0429/2542] HACK: win32u/font: Support font linking for Arial and Courier New. This helps the Rockstar installer to fallback to appropriate fonts for CJK languages. CW-Bug-Id: #18969 CW-Bug-Id: #19917 --- dlls/win32u/font.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c index 62a4dc510359..f80d008a2002 100644 --- a/dlls/win32u/font.c +++ b/dlls/win32u/font.c @@ -1561,6 +1561,14 @@ static const WCHAR ms_minchoW[] = {'M','S',' ','M','i','n','c','h','o',0}; static const WCHAR ms_p_minchoW[] = {'M','S',' ','P','M','i','n','c','h','o',0}; +static const WCHAR arialW[] = + {'A','r','i','a','l',0}; +static const WCHAR arial_boldW[] = + {'A','r','i','a','l',' ','B','o','l','d',0}; +static const WCHAR courier_newW[] = + {'C','o','u','r','i','e','r',' ','N','e','w',0}; +static const WCHAR courier_new_boldW[] = + {'C','o','u','r','i','e','r',' ','N','e','w',' ','B','o','l','d',0}; static const WCHAR * const font_links_list[] = { @@ -3118,6 +3126,10 @@ static void update_font_system_link_info(void) } set_multi_value_key(hkey, link_reg->font_name, link, len); } + set_multi_value_key(hkey, arialW, link, len); + set_multi_value_key(hkey, arial_boldW, link, len); + set_multi_value_key(hkey, courier_newW, link, len); + set_multi_value_key(hkey, courier_new_boldW, link, len); NtClose( hkey ); } } @@ -3156,7 +3168,13 @@ static void update_codepage( UINT screen_dpi ) if (query_reg_ascii_value( wine_fonts_key, "Codepages", info, sizeof(value_buffer) )) { cp_match = !wcscmp( (const WCHAR *)info->Data, cpbufW ); - if (cp_match && screen_dpi == font_dpi) return; /* already set correctly */ + if (cp_match && screen_dpi == font_dpi) + { + /* already set correctly, but, as a HACK, update font link + info anyway, so that old Proton prefixes are fixed */ + update_font_system_link_info(); + return; + } TRACE( "updating registry, codepages/logpixels changed %s/%u -> %u,%u/%u\n", debugstr_w((const WCHAR *)info->Data), font_dpi, ansi_cp.CodePage, oem_cp.CodePage, screen_dpi ); } From f79b71a8846089474bbba13c812ad3e345bacb33 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 23 Oct 2018 16:18:20 +0300 Subject: [PATCH 0430/2542] wine.inf: Add font registry entries. --- loader/wine.inf.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 9eeefbbc799e..e95514bc2d07 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -276,6 +276,7 @@ CurrentVersion="Software\Microsoft\Windows\CurrentVersion" CurrentVersionNT="Software\Microsoft\Windows NT\CurrentVersion" FontSubStr="Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes" Control="System\CurrentControlSet\Control" +FontsNT="Software\Microsoft\Windows NT\CurrentVersion\Fonts" [Classes] HKCR,.chm,,2,"chm.file" @@ -533,6 +534,10 @@ HKLM,%FontSubStr%,"Times New Roman CYR,204",,"Times New Roman,204" HKLM,%FontSubStr%,"Times New Roman Greek,161",,"Times New Roman,161" HKLM,%FontSubStr%,"Times New Roman TUR,162",,"Times New Roman,162" HKLM,System\CurrentControlSet\Hardware Profiles\Current\Software\Fonts,"LogPixels",0x10003,0x00000060 +HKLM,%FontsNT%,"Arial (TrueType)",,"arial.ttf" +HKLM,%FontsNT%,"Arial Bold (TrueType)",,"arialbd.ttf" +HKLM,%FontsNT%,"Times New Roman (TrueType)",,"times.ttf" +HKLM,%FontsNT%,"Courier New (TrueType)",,"cour.ttf" [MCI] HKLM,%Mci32Str%,"AVIVideo",,"mciavi32.dll" From dd5635b5b4f1a84fce39f5c09233750af898537c Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Tue, 30 Oct 2018 13:04:06 -0500 Subject: [PATCH 0431/2542] wine.inf: Substitute Times New Roman for Palatino Linotype For AOE2HD launcher. CW-Bug-Id: #16410 --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index e95514bc2d07..e3dd6dc8b364 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -538,6 +538,7 @@ HKLM,%FontsNT%,"Arial (TrueType)",,"arial.ttf" HKLM,%FontsNT%,"Arial Bold (TrueType)",,"arialbd.ttf" HKLM,%FontsNT%,"Times New Roman (TrueType)",,"times.ttf" HKLM,%FontsNT%,"Courier New (TrueType)",,"cour.ttf" +HKCU,Software\Wine\Fonts\Replacements,"Palatino Linotype",,"Times New Roman" [MCI] HKLM,%Mci32Str%,"AVIVideo",,"mciavi32.dll" From 7fb5b7ed3ac926d606fe53e1d641df42d67b5b17 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Tue, 10 Aug 2021 11:56:55 +0200 Subject: [PATCH 0432/2542] HACK: loader/wine.inf: Add registry entries for the new fonts. They are required for DWrite to enumerate the fonts. For Cyberpunk 2077 launcher font support. CW-Bug-Id: #19125 --- loader/wine.inf.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index e3dd6dc8b364..05288864cdcb 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -538,6 +538,10 @@ HKLM,%FontsNT%,"Arial (TrueType)",,"arial.ttf" HKLM,%FontsNT%,"Arial Bold (TrueType)",,"arialbd.ttf" HKLM,%FontsNT%,"Times New Roman (TrueType)",,"times.ttf" HKLM,%FontsNT%,"Courier New (TrueType)",,"cour.ttf" +HKLM,%FontsNT%,"Malgun Gothic (TrueType)",,"malgun.ttf" +HKLM,%FontsNT%,"Microsoft YaHei (TrueType)",,"msyh.ttf" +HKLM,%FontsNT%,"MS Gothic (TrueType)",,"msgothic.ttc" +HKLM,%FontsNT%,"SimSun (TrueType)",,"simsun.ttc" HKCU,Software\Wine\Fonts\Replacements,"Palatino Linotype",,"Times New Roman" [MCI] From 34b382fa2b1d8b11392b0becdc2e477ff5f91ce9 Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Sun, 26 Sep 2021 14:58:45 +0800 Subject: [PATCH 0433/2542] loader/wine.inf: Add registry entries for Microsoft Sans Serif (micross.ttf) and Nirmala UI (nirmala.ttf). CW-Bug-Id: #17132 --- loader/wine.inf.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 05288864cdcb..fb203fa2f688 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -539,8 +539,10 @@ HKLM,%FontsNT%,"Arial Bold (TrueType)",,"arialbd.ttf" HKLM,%FontsNT%,"Times New Roman (TrueType)",,"times.ttf" HKLM,%FontsNT%,"Courier New (TrueType)",,"cour.ttf" HKLM,%FontsNT%,"Malgun Gothic (TrueType)",,"malgun.ttf" +HKLM,%FontsNT%,"Microsoft Sans Serif (TrueType)",,"micross.ttf" HKLM,%FontsNT%,"Microsoft YaHei (TrueType)",,"msyh.ttf" HKLM,%FontsNT%,"MS Gothic (TrueType)",,"msgothic.ttc" +HKLM,%FontsNT%,"Nirmala UI (TrueType)",,"nirmala.ttf" HKLM,%FontsNT%,"SimSun (TrueType)",,"simsun.ttc" HKCU,Software\Wine\Fonts\Replacements,"Palatino Linotype",,"Times New Roman" From 21bd521b33debe827179b611485864cd5bbedd17 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Thu, 12 Jan 2023 16:57:40 +0100 Subject: [PATCH 0434/2542] dwrite: Use fonts distributed with Proton as fallback. --- dlls/dwrite/analyzer.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c index 783312f68e8d..11d4719e7060 100644 --- a/dlls/dwrite/analyzer.c +++ b/dlls/dwrite/analyzer.c @@ -248,7 +248,7 @@ system_fallback_config[] = { "0D00-0D7F", L"Noto Sans Malayalam" }, { "0D80-0DFF", L"Noto Sans Sinhala" }, - { "0E00-0E7F", L"Noto Sans Thai" }, + { "0E00-0E7F", L"Microsoft Sans Serif" }, { "0E80-0EFF", L"Noto Sans Lao" }, { "0F00-0FFF", L"Noto Serif Tibetan" }, @@ -268,7 +268,7 @@ system_fallback_config[] = { "1100-11FF, 3130-318F, " "3200-321F, 3260-327F, " "A960-A97F, AC00-D7FF, " - "D7B0-D7FF", L"Noto Sans CJK KR" }, + "D7B0-D7FF", L"Malgun Gothic" }, { "1680-169F", L"Noto Sans Ogham" }, @@ -297,27 +297,27 @@ system_fallback_config[] = /* CJK Radicals Supplement - 2E80-2EFF */ - { "2E80-2EFF", L"Noto Sans CJK SC", L"zh-Hans" }, + { "2E80-2EFF", L"Microsoft YaHei", L"zh-Hans" }, { "2E80-2EFF", L"Noto Sans CJK TC", L"zh-Hant" }, - { "2E80-2EFF", L"Noto Sans CJK KR", L"ko" }, + { "2E80-2EFF", L"Malgun Gothic", L"ko" }, /* CJK Symbols and Punctuation - 3000-303F Hiragana - 3040-309F Katakana - 30A0-30FF Katakana Phonetic Ext. - 31F0-31FF */ - { "3000-30FF, 31F0-31FF", L"Noto Sans CJK SC", L"zh-Hans" }, + { "3000-30FF, 31F0-31FF", L"Microsoft YaHei", L"zh-Hans" }, { "3000-30FF, 31F0-31FF", L"Noto Sans CJK TC", L"zh-Hant" }, - { "3000-30FF, 31F0-31FF", L"Noto Sans CJK KR", L"ko" }, - { "3000-30FF, 31F0-31FF", L"Noto Sans CJK JP" }, + { "3000-30FF, 31F0-31FF", L"Malgun Gothic", L"ko" }, + { "3000-30FF, 31F0-31FF", L"MS Gothic" }, /* CJK Unified Ext A - 3400-4DBF CJK Unified - 4E00-9FFF */ - { "3400-4DBF, 4E00-9FFF", L"Noto Sans CJK SC", L"zh-Hans" }, + { "3400-4DBF, 4E00-9FFF", L"Microsoft YaHei", L"zh-Hans" }, { "3400-4DBF, 4E00-9FFF", L"Noto Sans CJK TC", L"zh-Hant" }, - { "3400-4DBF, 4E00-9FFF", L"Noto Sans CJK KR", L"ko" }, - { "3400-4DBF, 4E00-9FFF", L"Noto Sans CJK JP" }, + { "3400-4DBF, 4E00-9FFF", L"Malgun Gothic", L"ko" }, + { "3400-4DBF, 4E00-9FFF", L"MS Gothic" }, { "A000-A4CF", L"Noto Sans Yi" }, { "A4D0-A4FF", L"Noto Sans Lisu" }, @@ -333,30 +333,30 @@ system_fallback_config[] = /* CJK Compatibility Ideographs - F900-FAFF */ - { "F900-FAFF", L"Noto Sans CJK SC", L"zh-Hans" }, + { "F900-FAFF", L"Microsoft YaHei", L"zh-Hans" }, { "F900-FAFF", L"Noto Sans CJK TC", L"zh-Hant" }, - { "F900-FAFF", L"Noto Sans CJK KR", L"ko" }, - { "F900-FAFF", L"Noto Sans CJK JP" }, + { "F900-FAFF", L"Malgun Gothic", L"ko" }, + { "F900-FAFF", L"MS Gothic" }, /* Vertical Forms - FE10-FE1F */ - { "FE10-FE1F", L"Noto Sans CJK SC", L"zh-Hans" }, - { "FE10-FE1F", L"Noto Sans CJK KR", L"ko" }, + { "FE10-FE1F", L"Microsoft YaHei", L"zh-Hans" }, + { "FE10-FE1F", L"Malgun Gothic", L"ko" }, { "FE10-FE1F", L"Noto Sans CJK TC" }, /* CJK Compatibility Forms - FE30-FE4F Small Form Variants - FE50-FE6F */ - { "FE30-FE6F", L"Noto Sans CJK SC", L"zh-Hans" }, - { "FE30-FE6F", L"Noto Sans CJK KR", L"ko" }, - { "FE30-FE6F", L"Noto Sans CJK JP", L"ja" }, + { "FE30-FE6F", L"Microsoft YaHei", L"zh-Hans" }, + { "FE30-FE6F", L"Malgun Gothic", L"ko" }, + { "FE30-FE6F", L"MS Gothic", L"ja" }, { "FE30-FE6F", L"Noto Sans CJK TC" }, /* Halfwidth and Fullwidth Forms */ - { "FF00-FFEF", L"Noto Sans CJK SC", L"zh-Hans" }, + { "FF00-FFEF", L"Microsoft YaHei", L"zh-Hans" }, { "FF00-FFEF", L"Noto Sans CJK TC", L"zh-Hant" }, - { "FF00-FFEF", L"Noto Sans CJK KR", L"ko" }, - { "FF00-FFEF", L"Noto Sans CJK JP" }, + { "FF00-FFEF", L"Malgun Gothic", L"ko" }, + { "FF00-FFEF", L"MS Gothic" }, }; struct text_source_context From 5dbad88a141d2219e2c7ee2dcd5e7d8236426ded Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Tue, 24 Jan 2023 12:12:01 +0100 Subject: [PATCH 0435/2542] loader: Install all fonts provided by Proton in the registry. --- loader/wine.inf.in | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index fb203fa2f688..a6aeca531bc2 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -536,14 +536,24 @@ HKLM,%FontSubStr%,"Times New Roman TUR,162",,"Times New Roman,162" HKLM,System\CurrentControlSet\Hardware Profiles\Current\Software\Fonts,"LogPixels",0x10003,0x00000060 HKLM,%FontsNT%,"Arial (TrueType)",,"arial.ttf" HKLM,%FontsNT%,"Arial Bold (TrueType)",,"arialbd.ttf" -HKLM,%FontsNT%,"Times New Roman (TrueType)",,"times.ttf" HKLM,%FontsNT%,"Courier New (TrueType)",,"cour.ttf" +HKLM,%FontsNT%,"Courier New Bold (TrueType)",,"courbd.ttf" HKLM,%FontsNT%,"Malgun Gothic (TrueType)",,"malgun.ttf" +HKLM,%FontsNT%,"Marlett (TrueType)",,"marlett.ttf" HKLM,%FontsNT%,"Microsoft Sans Serif (TrueType)",,"micross.ttf" -HKLM,%FontsNT%,"Microsoft YaHei (TrueType)",,"msyh.ttf" HKLM,%FontsNT%,"MS Gothic (TrueType)",,"msgothic.ttc" +HKLM,%FontsNT%,"MS PGothic (TrueType)",,"msgothic.ttc" +HKLM,%FontsNT%,"MS UI Gothic (TrueType)",,"msgothic.ttc" +HKLM,%FontsNT%,"Microsoft YaHei (TrueType)",,"msyh.ttf" HKLM,%FontsNT%,"Nirmala UI (TrueType)",,"nirmala.ttf" HKLM,%FontsNT%,"SimSun (TrueType)",,"simsun.ttc" +HKLM,%FontsNT%,"NSimSun (TrueType)",,"simsun.ttc" +HKLM,%FontsNT%,"Symbol (TrueType)",,"symbol.ttf" +HKLM,%FontsNT%,"Tahoma (TrueType)",,"tahoma.ttf" +HKLM,%FontsNT%,"Tahoma Bold (TrueType)",,"tahomabd.ttf" +HKLM,%FontsNT%,"Times New Roman (TrueType)",,"times.ttf" +HKLM,%FontsNT%,"Webdings (TrueType)",,"webdings.ttf" +HKLM,%FontsNT%,"Wingdings (TrueType)",,"wingdings.ttf" HKCU,Software\Wine\Fonts\Replacements,"Palatino Linotype",,"Times New Roman" [MCI] From 8ed48507e986dc70b4e5c651ff222a0ded6c3fbf Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 17 Oct 2023 20:11:43 -0600 Subject: [PATCH 0436/2542] wine.inf: Substitute Times New Roman for Verdana. CW-Bug-Id: #22875 --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index a6aeca531bc2..e47736636c28 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -555,6 +555,7 @@ HKLM,%FontsNT%,"Times New Roman (TrueType)",,"times.ttf" HKLM,%FontsNT%,"Webdings (TrueType)",,"webdings.ttf" HKLM,%FontsNT%,"Wingdings (TrueType)",,"wingdings.ttf" HKCU,Software\Wine\Fonts\Replacements,"Palatino Linotype",,"Times New Roman" +HKCU,Software\Wine\Fonts\Replacements,"Verdana",,"Times New Roman" [MCI] HKLM,%Mci32Str%,"AVIVideo",,"mciavi32.dll" From 445ed6049c17acdb36e049fa6ef1bd1432dc0960 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 15 Nov 2023 21:37:09 -0600 Subject: [PATCH 0437/2542] win32u: Set all glyph load flags in get_load_flags(). CW-Bug-Id: #22992 --- dlls/win32u/freetype.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dlls/win32u/freetype.c b/dlls/win32u/freetype.c index 48f7a792ae4b..ee3b7b734730 100644 --- a/dlls/win32u/freetype.c +++ b/dlls/win32u/freetype.c @@ -3426,10 +3426,13 @@ static unsigned int get_bezier_glyph_outline(FT_Outline *outline, unsigned int b return needed; } -static FT_Int get_load_flags( UINT format ) +static FT_Int get_load_flags( UINT format, BOOL vertical_metrics, BOOL force_no_bitmap ) { FT_Int load_flags = FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH; + if (vertical_metrics) load_flags |= FT_LOAD_VERTICAL_LAYOUT; + if (force_no_bitmap || format != GGO_BITMAP) load_flags |= FT_LOAD_NO_BITMAP; + if (format & GGO_UNHINTED) return load_flags | FT_LOAD_NO_HINTING; @@ -3469,7 +3472,7 @@ static UINT freetype_get_glyph_outline( struct gdi_font *font, UINT glyph, UINT FT_Glyph_Metrics metrics; FT_Error err; FT_BBox bbox; - FT_Int load_flags = get_load_flags(format); + FT_Int load_flags; FT_Matrix transform_matrices[3], *matrices = NULL; BOOL vertical_metrics; @@ -3479,8 +3482,6 @@ static UINT freetype_get_glyph_outline( struct gdi_font *font, UINT glyph, UINT font->matrix.eM11, font->matrix.eM12, font->matrix.eM21, font->matrix.eM22); - format &= ~GGO_UNHINTED; - matrices = get_transform_matrices( font, tategaki, lpmat, transform_matrices ); vertical_metrics = (tategaki && FT_HAS_VERTICAL(ft_face)); @@ -3488,9 +3489,7 @@ static UINT freetype_get_glyph_outline( struct gdi_font *font, UINT glyph, UINT properly scaled and correct in 2.4.0 or greater */ if (vertical_metrics && FT_SimpleVersion < FT_VERSION_VALUE(2, 4, 0)) vertical_metrics = FALSE; - - if (matrices || format != GGO_BITMAP) load_flags |= FT_LOAD_NO_BITMAP; - if (vertical_metrics) load_flags |= FT_LOAD_VERTICAL_LAYOUT; + load_flags = get_load_flags(format, vertical_metrics, !!matrices); err = pFT_Load_Glyph(ft_face, glyph, load_flags & FT_LOAD_NO_HINTING ? load_flags : load_flags | FT_LOAD_PEDANTIC); if (err && !(load_flags & FT_LOAD_NO_HINTING)) @@ -3505,6 +3504,8 @@ static UINT freetype_get_glyph_outline( struct gdi_font *font, UINT glyph, UINT return GDI_ERROR; } + format &= ~GGO_UNHINTED; + metrics = ft_face->glyph->metrics; if(font->fake_bold) { if (!get_bold_glyph_outline(ft_face->glyph, font->ppem, &metrics) && metrics.width) From f78df9ae64ac7f39566bb7a1758abf597eb8014a Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 26 Feb 2024 13:37:03 -0600 Subject: [PATCH 0438/2542] win32u: Store effective AA flags in font_physdev. CW-Bug-Id: #22992 --- dlls/win32u/font.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c index f80d008a2002..6e5a442b4a69 100644 --- a/dlls/win32u/font.c +++ b/dlls/win32u/font.c @@ -55,6 +55,7 @@ struct font_physdev { struct gdi_physdev dev; struct gdi_font *font; + UINT aa_flags; }; static inline struct font_physdev *get_font_dev( PHYSDEV dev ) @@ -4709,6 +4710,7 @@ static HFONT font_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags ) *aa_flags = font_smoothing; } *aa_flags = font_funcs->get_aa_flags( font, *aa_flags, antialias_fakes ); + physdev->aa_flags = *aa_flags; } TRACE( "%p %s %d aa %x\n", hfont, debugstr_w(lf.lfFaceName), (int)lf.lfHeight, *aa_flags ); pthread_mutex_unlock( &font_lock ); From e6c67752f84581e35a87e9187678fae364d8f284 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 15 Nov 2023 21:30:12 -0600 Subject: [PATCH 0439/2542] win32u: Use font AA flags when querying glyph outline with GGO_METRICS. CW-Bug-Id: #22992 --- dlls/win32u/font.c | 16 ++++++++-------- dlls/win32u/freetype.c | 18 ++++++++++++++++-- dlls/win32u/ntgdi_private.h | 2 +- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c index 6e5a442b4a69..60adb8ede4ab 100644 --- a/dlls/win32u/font.c +++ b/dlls/win32u/font.c @@ -3871,7 +3871,7 @@ static UINT get_glyph_index_linked( struct gdi_font **font, UINT glyph ) static DWORD get_glyph_outline( struct gdi_font *font, UINT glyph, UINT format, GLYPHMETRICS *gm_ret, ABC *abc_ret, DWORD buflen, void *buf, - const MAT2 *mat ) + const MAT2 *mat, UINT aa_flags ) { GLYPHMETRICS gm; ABC abc; @@ -3905,7 +3905,7 @@ static DWORD get_glyph_outline( struct gdi_font *font, UINT glyph, UINT format, if (format == GGO_METRICS && !mat && get_gdi_font_glyph_metrics( font, index, &gm, &abc )) goto done; - ret = font_funcs->get_glyph_outline( font, index, format, &gm, &abc, buflen, buf, mat, tategaki ); + ret = font_funcs->get_glyph_outline( font, index, format, &gm, &abc, buflen, buf, mat, tategaki, aa_flags ); if (ret == GDI_ERROR) return ret; if (format == GGO_METRICS && !mat) @@ -3954,7 +3954,7 @@ static BOOL font_GetCharABCWidths( PHYSDEV dev, UINT first, UINT count, WCHAR *c for (i = 0; i < count; i++) { c = chars ? chars[i] : first + i; - get_glyph_outline( physdev->font, c, GGO_METRICS, NULL, &buffer[i], 0, NULL, NULL ); + get_glyph_outline( physdev->font, c, GGO_METRICS, NULL, &buffer[i], 0, NULL, NULL, physdev->aa_flags ); } pthread_mutex_unlock( &font_lock ); return TRUE; @@ -3980,7 +3980,7 @@ static BOOL font_GetCharABCWidthsI( PHYSDEV dev, UINT first, UINT count, WORD *g pthread_mutex_lock( &font_lock ); for (c = 0; c < count; c++, buffer++) get_glyph_outline( physdev->font, gi ? gi[c] : first + c, GGO_METRICS | GGO_GLYPH_INDEX, - NULL, buffer, 0, NULL, NULL ); + NULL, buffer, 0, NULL, NULL, physdev->aa_flags ); pthread_mutex_unlock( &font_lock ); return TRUE; } @@ -4007,7 +4007,7 @@ static BOOL font_GetCharWidth( PHYSDEV dev, UINT first, UINT count, const WCHAR for (i = 0; i < count; i++) { c = chars ? chars[i] : i + first; - if (get_glyph_outline( physdev->font, c, GGO_METRICS, NULL, &abc, 0, NULL, NULL ) == GDI_ERROR) + if (get_glyph_outline( physdev->font, c, GGO_METRICS, NULL, &abc, 0, NULL, NULL, physdev->aa_flags ) == GDI_ERROR) buffer[i] = 0; else buffer[i] = abc.abcA + abc.abcB + abc.abcC; @@ -4186,7 +4186,7 @@ static DWORD font_GetGlyphOutline( PHYSDEV dev, UINT glyph, UINT format, return dev->funcs->pGetGlyphOutline( dev, glyph, format, gm, buflen, buf, mat ); } pthread_mutex_lock( &font_lock ); - ret = get_glyph_outline( physdev->font, glyph, format, gm, NULL, buflen, buf, mat ); + ret = get_glyph_outline( physdev->font, glyph, format, gm, NULL, buflen, buf, mat, physdev->aa_flags ); pthread_mutex_unlock( &font_lock ); return ret; } @@ -4366,7 +4366,7 @@ static BOOL font_GetTextExtentExPoint( PHYSDEV dev, const WCHAR *str, INT count, pthread_mutex_lock( &font_lock ); for (i = pos = 0; i < count; i++) { - get_glyph_outline( physdev->font, str[i], GGO_METRICS, NULL, &abc, 0, NULL, NULL ); + get_glyph_outline( physdev->font, str[i], GGO_METRICS, NULL, &abc, 0, NULL, NULL, physdev->aa_flags ); pos += abc.abcA + abc.abcB + abc.abcC; dxs[i] = pos; } @@ -4396,7 +4396,7 @@ static BOOL font_GetTextExtentExPointI( PHYSDEV dev, const WORD *indices, INT co for (i = pos = 0; i < count; i++) { get_glyph_outline( physdev->font, indices[i], GGO_METRICS | GGO_GLYPH_INDEX, - NULL, &abc, 0, NULL, NULL ); + NULL, &abc, 0, NULL, NULL, physdev->aa_flags ); pos += abc.abcA + abc.abcB + abc.abcC; dxs[i] = pos; } diff --git a/dlls/win32u/freetype.c b/dlls/win32u/freetype.c index ee3b7b734730..c781e1d5b3e2 100644 --- a/dlls/win32u/freetype.c +++ b/dlls/win32u/freetype.c @@ -3460,12 +3460,18 @@ static FT_Int get_load_flags( UINT format, BOOL vertical_metrics, BOOL force_no_ return load_flags; } +static BOOL is_curve_format(UINT format) +{ + format &= ~(GGO_GLYPH_INDEX | GGO_UNHINTED); + return format == GGO_BEZIER || format == GGO_NATIVE; +} + /************************************************************* * freetype_get_glyph_outline */ static UINT freetype_get_glyph_outline( struct gdi_font *font, UINT glyph, UINT format, GLYPHMETRICS *lpgm, ABC *abc, UINT buflen, void *buf, - const MAT2 *lpmat, BOOL tategaki ) + const MAT2 *lpmat, BOOL tategaki, UINT aa_flags ) { struct gdi_font *base_font = font->base_font ? font->base_font : font; FT_Face ft_face = get_ft_face( font ); @@ -3475,6 +3481,7 @@ static UINT freetype_get_glyph_outline( struct gdi_font *font, UINT glyph, UINT FT_Int load_flags; FT_Matrix transform_matrices[3], *matrices = NULL; BOOL vertical_metrics; + UINT effective_format = format; TRACE("%p, %04x, %08x, %p, %08x, %p, %p\n", font, glyph, format, lpgm, buflen, buf, lpmat); @@ -3484,14 +3491,21 @@ static UINT freetype_get_glyph_outline( struct gdi_font *font, UINT glyph, UINT matrices = get_transform_matrices( font, tategaki, lpmat, transform_matrices ); + if (aa_flags && !is_curve_format( format )) effective_format = aa_flags | (format & GGO_GLYPH_INDEX); vertical_metrics = (tategaki && FT_HAS_VERTICAL(ft_face)); /* there is a freetype bug where vertical metrics are only properly scaled and correct in 2.4.0 or greater */ if (vertical_metrics && FT_SimpleVersion < FT_VERSION_VALUE(2, 4, 0)) vertical_metrics = FALSE; - load_flags = get_load_flags(format, vertical_metrics, !!matrices); + load_flags = get_load_flags(effective_format, vertical_metrics, !!matrices); err = pFT_Load_Glyph(ft_face, glyph, load_flags & FT_LOAD_NO_HINTING ? load_flags : load_flags | FT_LOAD_PEDANTIC); + if (err && format != effective_format) + { + WARN("Failed to load glyph %#x, retrying with GGO_METRICS. Error %#x.\n", glyph, err); + load_flags = get_load_flags(effective_format, vertical_metrics, !!matrices); + err = pFT_Load_Glyph(ft_face, glyph, load_flags); + } if (err && !(load_flags & FT_LOAD_NO_HINTING)) { WARN("Failed to load glyph %#x, retrying without hinting. Error %#x.\n", glyph, err); diff --git a/dlls/win32u/ntgdi_private.h b/dlls/win32u/ntgdi_private.h index ce54a6591a01..41d3c1140cad 100644 --- a/dlls/win32u/ntgdi_private.h +++ b/dlls/win32u/ntgdi_private.h @@ -328,7 +328,7 @@ struct font_backend_funcs UINT (*get_default_glyph)( struct gdi_font *gdi_font ); UINT (*get_glyph_outline)( struct gdi_font *font, UINT glyph, UINT format, GLYPHMETRICS *gm, ABC *abc, UINT buflen, void *buf, - const MAT2 *mat, BOOL tategaki ); + const MAT2 *mat, BOOL tategaki, UINT aa_flags ); UINT (*get_unicode_ranges)( struct gdi_font *font, GLYPHSET *gs ); BOOL (*get_char_width_info)( struct gdi_font *font, struct char_width_info *info ); BOOL (*set_outline_text_metrics)( struct gdi_font *font ); From ae774cd4ed72662ceecc87f0c8941a6866d9aeef Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 10 May 2024 16:08:58 -0600 Subject: [PATCH 0440/2542] win32u: HACK: Ignore font GASP flags for Alien Swarm Reactive Drop. CW-Bug-Id: #23776 --- dlls/win32u/freetype.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/freetype.c b/dlls/win32u/freetype.c index c781e1d5b3e2..c6d622c9fff3 100644 --- a/dlls/win32u/freetype.c +++ b/dlls/win32u/freetype.c @@ -555,8 +555,11 @@ static BOOL is_hinting_enabled(void) if (enabled == -1) { + const char *sgi; + + if ((sgi = getenv("SteamGameId")) && !strcmp(sgi, "563560")) enabled = FALSE; /* Use the >= 2.2.0 function if available */ - if (pFT_Get_TrueType_Engine_Type) + else if (pFT_Get_TrueType_Engine_Type) { FT_TrueTypeEngineType type = pFT_Get_TrueType_Engine_Type(library); enabled = (type == FT_TRUETYPE_ENGINE_TYPE_PATENTED); From 51863f9bc9338bb5a6ca8244f36c526bacccde7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Mon, 23 Jul 2018 19:53:20 +0200 Subject: [PATCH 0441/2542] amd_ags_x64: Import v5.1.1 amd_ags.h. Imported from https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK. --- dlls/amd_ags_x64/amd_ags.h | 944 +++++++++++++++++++++++++++++++++++++ 1 file changed, 944 insertions(+) create mode 100644 dlls/amd_ags_x64/amd_ags.h diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h new file mode 100644 index 000000000000..9c3e37e52e50 --- /dev/null +++ b/dlls/amd_ags_x64/amd_ags.h @@ -0,0 +1,944 @@ +// +// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +/// \file +/// \mainpage +/// AGS Library Overview +/// -------------------- +/// This document provides an overview of the AGS (AMD GPU Services) library. The AGS library provides software developers with the ability to query +/// AMD GPU software and hardware state information that is not normally available through standard operating systems or graphic APIs. +/// +/// The latest version of the API is publicly hosted here: https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK/. +/// It is also worth checking http://gpuopen.com/gaming-product/amd-gpu-services-ags-library/ for any updates and articles on AGS. +/// \internal +/// Online documentation is publicly hosted here: http://gpuopen-librariesandsdks.github.io/ags/ +/// \endinternal +/// +/// What's new in AGS 5.1.1 since version 5.0.6 +/// --------------------------------------- +/// AGS 5.1.1 includes the following updates: +/// * An API change for DX11 extensions +/// - It is now mandatory to call agsDriverExtensionsDX11_CreateDevice() when creating a device if the user wants to access any DX11 AMD extensions. +/// - The corresponding agsDriverExtensionsDX11_DestroyDevice() call must be called to release the device and free up the internal resources allocated by the create call. +/// * App registration extension for DX11. +/// * Freesync 2 HDR support. +/// * Wave reduce and wave scan shader extensions. +/// * AMD user markers for DX12. +/// * Eyefinity bug fixes. +/// * MultiDrawIndexedInstancedIndirectCountIndirect parameter bug fix. +/// * Static lib versions of the binary. +/// * VS2017 support for the samples. +/// +/// What's new in AGS 5.x since version 4.x +/// --------------------------------------- +/// Version 5.x is a major overhaul of the library designed to provide a much clearer view of the GPUs in the system and the displays attached to them. +/// It also exposes the ability to query each display for HDR capabilities and put those HDR capable displays into various HDR modes. +/// Some functions such as agsGetGPUMemorySize and agsGetEyefinityConfigInfo have been removed in favor of including this information in the device & display enumeration. +/// Features include: +/// * Full GPU enumeration with adapter string, device id, revision id and vendor id. +/// * Per GPU display enumeration including information on display name, resolution and HDR capabilities. +/// * Optional user supplied memory allocator. +/// * Function to set displays into HDR mode. +/// * A Microsoft WACK compliant version of the library. +/// * DirectX11 shader compiler controls. +/// * DirectX11 multiview extension enabling MultiView and MultiRes rendering. +/// * DirectX11 Crossfire API now supports using the API without needing a driver profile. Can also specify the transfer engine. +/// +/// Using the AGS library +/// --------------------- +/// It is recommended to take a look at the source code for the samples that come with the AGS SDK: +/// * AGSSample +/// * CrossfireSample +/// * EyefinitySample +/// The AGSSample application is the simplest of the three examples and demonstrates the code required to initialize AGS and use it to query the GPU and Eyefinity state. +/// The CrossfireSample application demonstrates the use of the new API to transfer resources on GPUs in Crossfire mode. Lastly, the EyefinitySample application provides a more +/// extensive example of Eyefinity setup than the basic example provided in AGSSample. +/// There are other samples on Github that demonstrate the DirectX shader extensions, such as the Barycentrics11 and Barycentrics12 samples. +/// +/// To add AGS support to an existing project, follow these steps: +/// * Link your project against the correct import library. Choose from either the 32 bit or 64 bit version. +/// * Copy the AGS dll into the same directory as your game executable. +/// * Include the amd_ags.h header file from your source code. +/// * Include the AGS hlsl files if you are using the shader intrinsics. +/// * Declare a pointer to an AGSContext and make this available for all subsequent calls to AGS. +/// * On game initialization, call agsInit() passing in the address of the context. On success, this function will return a valid context pointer. +/// * The agsInit() function should be called before the D3D device is created if the Crossfire mode is specified. +/// +/// Don't forget to cleanup AGS by calling agsDeInit() when the app exits, after the device has been destroyed. + +#ifndef AMD_AGS_H +#define AMD_AGS_H + +#define AMD_AGS_VERSION_MAJOR 5 ///< AGS major version +#define AMD_AGS_VERSION_MINOR 1 ///< AGS minor version +#define AMD_AGS_VERSION_PATCH 1 ///< AGS patch version + +#ifdef __cplusplus +extern "C" { +#endif + + +#define AMD_AGS_API __declspec(dllexport) ///< AGS calling convention + +// Forward declaration of D3D11 types +struct IDXGIAdapter; +enum D3D_DRIVER_TYPE; +enum D3D_FEATURE_LEVEL; +struct DXGI_SWAP_CHAIN_DESC; +struct ID3D11Device; +struct ID3D11DeviceContext; +struct IDXGISwapChain; +struct ID3D11Resource; +struct ID3D11Buffer; +struct ID3D11Texture1D; +struct ID3D11Texture2D; +struct ID3D11Texture3D; +struct D3D11_BUFFER_DESC; +struct D3D11_TEXTURE1D_DESC; +struct D3D11_TEXTURE2D_DESC; +struct D3D11_TEXTURE3D_DESC; +struct D3D11_SUBRESOURCE_DATA; +struct tagRECT; +typedef tagRECT D3D11_RECT; ///< typedef this ourselves so we don't have to drag d3d11.h in + +// Forward declaration of D3D12 types +struct ID3D12Device; +struct ID3D12GraphicsCommandList; + + +/// The return codes +enum AGSReturnCode +{ + AGS_SUCCESS, ///< Successful function call + AGS_FAILURE, ///< Failed to complete call for some unspecified reason + AGS_INVALID_ARGS, ///< Invalid arguments into the function + AGS_OUT_OF_MEMORY, ///< Out of memory when allocating space internally + AGS_ERROR_MISSING_DLL, ///< Returned when a driver dll fails to load - most likely due to not being present in legacy driver installation + AGS_ERROR_LEGACY_DRIVER, ///< Returned if a feature is not present in the installed driver + AGS_EXTENSION_NOT_SUPPORTED, ///< Returned if the driver does not support the requested driver extension + AGS_ADL_FAILURE, ///< Failure in ADL (the AMD Display Library) +}; + +/// The DirectX11 extension support bits +enum AGSDriverExtensionDX11 +{ + AGS_DX11_EXTENSION_QUADLIST = 1 << 0, + AGS_DX11_EXTENSION_SCREENRECTLIST = 1 << 1, + AGS_DX11_EXTENSION_UAV_OVERLAP = 1 << 2, + AGS_DX11_EXTENSION_DEPTH_BOUNDS_TEST = 1 << 3, + AGS_DX11_EXTENSION_MULTIDRAWINDIRECT = 1 << 4, + AGS_DX11_EXTENSION_MULTIDRAWINDIRECT_COUNTINDIRECT = 1 << 5, + AGS_DX11_EXTENSION_CROSSFIRE_API = 1 << 6, + AGS_DX11_EXTENSION_INTRINSIC_READFIRSTLANE = 1 << 7, + AGS_DX11_EXTENSION_INTRINSIC_READLANE = 1 << 8, + AGS_DX11_EXTENSION_INTRINSIC_LANEID = 1 << 9, + AGS_DX11_EXTENSION_INTRINSIC_SWIZZLE = 1 << 10, + AGS_DX11_EXTENSION_INTRINSIC_BALLOT = 1 << 11, + AGS_DX11_EXTENSION_INTRINSIC_MBCOUNT = 1 << 12, + AGS_DX11_EXTENSION_INTRINSIC_COMPARE3 = 1 << 13, + AGS_DX11_EXTENSION_INTRINSIC_BARYCENTRICS = 1 << 14, + AGS_DX11_EXTENSION_INTRINSIC_WAVE_REDUCE = 1 << 15, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX11_EXTENSION_INTRINSIC_WAVE_SCAN = 1 << 16, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX11_EXTENSION_CREATE_SHADER_CONTROLS = 1 << 17, + AGS_DX11_EXTENSION_MULTIVIEW = 1 << 18, + AGS_DX11_EXTENSION_APP_REGISTRATION = 1 << 19 ///< Supported in Radeon Software Version 17.9.1 onwards. +}; + +/// The DirectX12 extension support bits +enum AGSDriverExtensionDX12 +{ + AGS_DX12_EXTENSION_INTRINSIC_READFIRSTLANE = 1 << 0, ///< Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. + AGS_DX12_EXTENSION_INTRINSIC_READLANE = 1 << 1, ///< Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. + AGS_DX12_EXTENSION_INTRINSIC_LANEID = 1 << 2, ///< Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. + AGS_DX12_EXTENSION_INTRINSIC_SWIZZLE = 1 << 3, ///< Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. + AGS_DX12_EXTENSION_INTRINSIC_BALLOT = 1 << 4, ///< Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. + AGS_DX12_EXTENSION_INTRINSIC_MBCOUNT = 1 << 5, ///< Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. + AGS_DX12_EXTENSION_INTRINSIC_COMPARE3 = 1 << 6, ///< Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. + AGS_DX12_EXTENSION_INTRINSIC_BARYCENTRICS = 1 << 7, ///< Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. + AGS_DX12_EXTENSION_INTRINSIC_WAVE_REDUCE = 1 << 8, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX12_EXTENSION_INTRINSIC_WAVE_SCAN = 1 << 9, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX12_EXTENSION_USER_MARKERS = 1 << 10 ///< Supported in Radeon Software Version 17.9.1 onwards. +}; + +/// The space id for DirectX12 intrinsic support +const unsigned int AGS_DX12_SHADER_INSTRINSICS_SPACE_ID = 0x7FFF0ADE; // 2147420894 + + +/// Additional topologies supported via extensions +enum AGSPrimitiveTopology +{ + AGS_PRIMITIVE_TOPOLOGY_QUADLIST = 7, + AGS_PRIMITIVE_TOPOLOGY_SCREENRECTLIST = 9 +}; + +/// The different modes to control Crossfire behavior. +enum AGSCrossfireMode +{ + AGS_CROSSFIRE_MODE_DRIVER_AFR = 0, ///< Use the default driver-based AFR rendering + AGS_CROSSFIRE_MODE_EXPLICIT_AFR, ///< Use the AGS Crossfire API functions to perform explicit AFR rendering without requiring a CF driver profile + AGS_CROSSFIRE_MODE_DISABLE ///< Completely disable AFR rendering +}; + + +/// The Crossfire API transfer types +enum AGSAfrTransferType +{ + AGS_AFR_TRANSFER_DEFAULT = 0, ///< Default Crossfire driver resource tracking + AGS_AFR_TRANSFER_DISABLE = 1, ///< Turn off driver resource tracking + AGS_AFR_TRANSFER_1STEP_P2P = 2, ///< App controlled GPU to next GPU transfer + AGS_AFR_TRANSFER_2STEP_NO_BROADCAST = 3, ///< App controlled GPU to next GPU transfer using intermediate system memory + AGS_AFR_TRANSFER_2STEP_WITH_BROADCAST = 4, ///< App controlled GPU to all render GPUs transfer using intermediate system memory +}; + +/// The Crossfire API transfer engines +enum AGSAfrTransferEngine +{ + AGS_AFR_TRANSFERENGINE_DEFAULT = 0, ///< Use default engine for Crossfire API transfers + AGS_AFR_TRANSFERENGINE_3D_ENGINE = 1, ///< Use 3D engine for Crossfire API transfers + AGS_AFR_TRANSFERENGINE_COPY_ENGINE = 2, ///< Use Copy engine for Crossfire API transfers +}; + +/// The display flags describing various properties of the display. +enum AGSDisplayFlags +{ + AGS_DISPLAYFLAG_PRIMARY_DISPLAY = 1 << 0, ///< Whether this display is marked as the primary display. Not set on the WACK version. + AGS_DISPLAYFLAG_HDR10 = 1 << 1, ///< HDR10 is supported on this display + AGS_DISPLAYFLAG_DOLBYVISION = 1 << 2, ///< Dolby Vision is supported on this display + AGS_DISPLAYFLAG_FREESYNC = 1 << 3, ///< Freesync is supported on this display + AGS_DISPLAYFLAG_FREESYNC_2 = 1 << 4, ///< Freesync 2 is supported on this display + AGS_DISPLAYFLAG_EYEFINITY_IN_GROUP = 1 << 5, ///< The display is part of the Eyefinity group + AGS_DISPLAYFLAG_EYEFINITY_PREFERRED_DISPLAY = 1 << 6, ///< The display is the preferred display in the Eyefinity group for displaying the UI + AGS_DISPLAYFLAG_EYEFINITY_IN_PORTRAIT_MODE = 1 << 7, ///< The display is in the Eyefinity group but in portrait mode +}; + +struct AGSContext; ///< All function calls in AGS require a pointer to a context. This is generated via \ref agsInit + +/// The rectangle struct used by AGS. +struct AGSRect +{ + int offsetX; ///< Offset on X axis + int offsetY; ///< Offset on Y axis + int width; ///< Width of rectangle + int height; ///< Height of rectangle +}; + +/// The clip rectangle struct used by \ref agsDriverExtensionsDX11_SetClipRects +struct AGSClipRect +{ + /// The inclusion mode for the rect + enum Mode + { + ClipRectIncluded = 0, ///< Include the rect + ClipRectExcluded = 1 ///< Exclude the rect + }; + + Mode mode; ///< Include/exclude rect region + AGSRect rect; ///< The rect to include/exclude +}; + +/// The display info struct used to describe a display enumerated by AGS +struct AGSDisplayInfo +{ + char name[ 256 ]; ///< The name of the display + char displayDeviceName[ 32 ]; ///< The display device name, i.e. DISPLAY_DEVICE::DeviceName + + unsigned int displayFlags; ///< Bitfield of ::AGSDisplayFlags + + int maxResolutionX; ///< The maximum supported resolution of the unrotated display + int maxResolutionY; ///< The maximum supported resolution of the unrotated display + float maxRefreshRate; ///< The maximum supported refresh rate of the display + + AGSRect currentResolution; ///< The current resolution and position in the desktop, ignoring Eyefinity bezel compensation + AGSRect visibleResolution; ///< The visible resolution and position. When Eyefinity bezel compensation is enabled this will + ///< be the sub region in the Eyefinity single large surface (SLS) + float currentRefreshRate; ///< The current refresh rate + + int eyefinityGridCoordX; ///< The X coordinate in the Eyefinity grid. -1 if not in an Eyefinity group + int eyefinityGridCoordY; ///< The Y coordinate in the Eyefinity grid. -1 if not in an Eyefinity group + + double chromaticityRedX; ///< Red display primary X coord + double chromaticityRedY; ///< Red display primary Y coord + + double chromaticityGreenX; ///< Green display primary X coord + double chromaticityGreenY; ///< Green display primary Y coord + + double chromaticityBlueX; ///< Blue display primary X coord + double chromaticityBlueY; ///< Blue display primary Y coord + + double chromaticityWhitePointX; ///< White point X coord + double chromaticityWhitePointY; ///< White point Y coord + + double screenDiffuseReflectance; ///< Percentage expressed between 0 - 1 + double screenSpecularReflectance; ///< Percentage expressed between 0 - 1 + + double minLuminance; ///< The minimum luminance of the display in nits + double maxLuminance; ///< The maximum luminance of the display in nits + double avgLuminance; ///< The average luminance of the display in nits + + int logicalDisplayIndex; ///< The internally used index of this display + int adlAdapterIndex; ///< The internally used ADL adapter index +}; + +/// The device info struct used to describe a physical GPU enumerated by AGS +struct AGSDeviceInfo +{ + /// The architecture version + enum ArchitectureVersion + { + ArchitectureVersion_Unknown, ///< Unknown architecture, potentially from another IHV. Check AGSDeviceInfo::vendorId + ArchitectureVersion_PreGCN, ///< AMD architecture, pre-GCN + ArchitectureVersion_GCN ///< AMD GCN architecture + }; + + ArchitectureVersion architectureVersion; ///< Set to Unknown if not AMD hardware + const char* adapterString; ///< The adapter name string + int vendorId; ///< The vendor id + int deviceId; ///< The device id + int revisionId; ///< The revision id + + int numCUs; ///< Number of GCN compute units. Zero if not GCN + int coreClock; ///< Core clock speed at 100% power in MHz + int memoryClock; ///< Memory clock speed at 100% power in MHz + float teraFlops; ///< Teraflops of GPU. Zero if not GCN. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD + + int isPrimaryDevice; ///< Whether or not this is the primary adapter in the system. Not set on the WACK version. + long long localMemoryInBytes; ///< The size of local memory in bytes. 0 for non AMD hardware. + + int numDisplays; ///< The number of active displays found to be attached to this adapter. + AGSDisplayInfo* displays; ///< List of displays allocated by AGS to be numDisplays in length. + + int eyefinityEnabled; ///< Indicates if Eyefinity is active + int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityGridHeight; ///< Contains height of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityResolutionX; ///< Contains width in pixels of the multi-monitor Single Large Surface. + int eyefinityResolutionY; ///< Contains height in pixels of the multi-monitor Single Large Surface. + int eyefinityBezelCompensated; ///< Indicates if bezel compensation is used for the current SLS display area. 1 if enabled, and 0 if disabled. + + int adlAdapterIndex; ///< Internally used index into the ADL list of adapters +}; + +/// \defgroup general General API functions +/// API for initialization, cleanup, HDR display modes and Crossfire GPU count +/// @{ + +typedef void* (__stdcall *AGS_ALLOC_CALLBACK)( int allocationSize ); ///< AGS user defined allocation prototype +typedef void (__stdcall *AGS_FREE_CALLBACK)( void* allocationPtr ); ///< AGS user defined free prototype + + /// The configuration options that can be passed in to \ref agsInit +struct AGSConfiguration +{ + AGS_ALLOC_CALLBACK allocCallback; ///< Optional memory allocation callback. If not supplied, malloc() is used + AGS_FREE_CALLBACK freeCallback; ///< Optional memory freeing callback. If not supplied, free() is used + AGSCrossfireMode crossfireMode; ///< Desired Crossfire mode +}; + +/// The top level GPU information returned from \ref agsInit +struct AGSGPUInfo +{ + int agsVersionMajor; ///< Major field of Major.Minor.Patch AGS version number + int agsVersionMinor; ///< Minor field of Major.Minor.Patch AGS version number + int agsVersionPatch; ///< Patch field of Major.Minor.Patch AGS version number + int isWACKCompliant; ///< 1 if WACK compliant. + + const char* driverVersion; ///< The AMD driver package version + const char* radeonSoftwareVersion; ///< The Radeon Software Version + + int numDevices; ///< Number of GPUs in the system + AGSDeviceInfo* devices; ///< List of GPUs in the system +}; + +/// The struct to specify the display settings to the driver. +struct AGSDisplaySettings +{ + /// The display mode + enum Mode + { + Mode_SDR, ///< SDR mode + Mode_HDR10_PQ, ///< HDR10 PQ encoding, requiring a 1010102 UNORM swapchain and PQ encoding in the output shader. + Mode_HDR10_scRGB, ///< HDR10 scRGB, requiring an FP16 swapchain. Values of 1.0 == 80 nits, 125.0 == 10000 nits. + Mode_Freesync2_scRGB, ///< Freesync2 scRGB, requiring an FP16 swapchain. Values in the range of 0.0 to 125.0 where 125.0 == AGSDisplayInfo::maxLuminance. + Mode_DolbyVision ///< Dolby Vision, requiring an 8888 UNORM swapchain + }; + + Mode mode; ///< The display mode to set the display into + + double chromaticityRedX; ///< Red display primary X coord + double chromaticityRedY; ///< Red display primary Y coord + + double chromaticityGreenX; ///< Green display primary X coord + double chromaticityGreenY; ///< Green display primary Y coord + + double chromaticityBlueX; ///< Blue display primary X coord + double chromaticityBlueY; ///< Blue display primary Y coord + + double chromaticityWhitePointX; ///< White point X coord + double chromaticityWhitePointY; ///< White point Y coord + + double minLuminance; ///< The minimum scene luminance in nits + double maxLuminance; ///< The maximum scene luminance in nits + + double maxContentLightLevel; ///< The maximum content light level in nits (MaxCLL) + double maxFrameAverageLightLevel; ///< The maximum frame average light level in nits (MaxFALL) +}; + +/// +/// Function used to initialize the AGS library. +/// Must be called prior to any of the subsequent AGS API calls. +/// Must be called prior to ID3D11Device or ID3D12Device creation. +/// \note This function will fail with AGS_ERROR_LEGACY_DRIVER in Catalyst versions before 12.20. +/// \note It is good practice to check the AGS version returned from AGSGPUInfo against the version defined in the header in case a mismatch between the dll and header has occurred. +/// +/// \param [in, out] context Address of a pointer to a context. This function allocates a context on the heap which is then required for all subsequent API calls. +/// \param [in] config Optional pointer to a AGSConfiguration struct to override the default library configuration. +/// \param [out] gpuInfo Optional pointer to a AGSGPUInfo struct which will get filled in for all the GPUs in the system. +/// +AMD_AGS_API AGSReturnCode agsInit( AGSContext** context, const AGSConfiguration* config, AGSGPUInfo* gpuInfo ); + +/// +/// Function used to clean up the AGS library. +/// +/// \param [in] context Pointer to a context. This function will deallocate the context from the heap. +/// +AMD_AGS_API AGSReturnCode agsDeInit( AGSContext* context ); + +/// +/// Function used to query the number of GPUs used for Crossfire acceleration. +/// This may be different from the total number of GPUs present in the system. +/// +/// \param [in] context Pointer to a context. +/// \param [out] numGPUs Number of GPUs used for Crossfire acceleration +/// +AMD_AGS_API AGSReturnCode agsGetCrossfireGPUCount( AGSContext* context, int* numGPUs ); + +/// +/// Function used to set a specific display into HDR mode +/// \note Setting all of the values apart from color space and transfer function to zero will cause the display to use defaults. +/// \note Call this function after each mode change (switch to fullscreen, any change in swapchain etc). +/// \note HDR10 PQ mode requires a 1010102 swapchain. +/// \note HDR10 scRGB mode requires an FP16 swapchain. +/// \note Freesync2 Gamma mode requires a 1010102 swapchain. +/// \note Freesync2 scRGB mode requires an FP16 swapchain. +/// \note Dolby Vision requires a 8888 UNORM swapchain. +/// +/// \param [in] context Pointer to a context. This is generated by \ref agsInit +/// \param [in] deviceIndex The index of the device listed in \ref AGSGPUInfo::devices. +/// \param [in] displayIndex The index of the display listed in \ref AGSDeviceInfo::displays. +/// \param [in] settings Pointer to the display settings to use. +/// +AMD_AGS_API AGSReturnCode agsSetDisplayMode( AGSContext* context, int deviceIndex, int displayIndex, const AGSDisplaySettings* settings ); + +/// @} + +/// \defgroup dx12 DirectX12 Extensions +/// DirectX12 driver extensions +/// @{ + +/// \defgroup dx12init Initialization and Cleanup +/// @{ + +/// +/// Function used to initialize the AMD-specific driver extensions for D3D12. +/// Extensions require support in the driver, therefore it is important to check the extensionsSupported bitfield. +/// +/// When using the HLSL shader extensions please note: +/// * The shader compiler should not use the D3DCOMPILE_SKIP_OPTIMIZATION option, otherwise it will not work. +/// * The intrinsic instructions require a 5.1 shader model. +/// * The Root Signature will need to use an extra resource and sampler. These are not real resources/samplers, they are just used to encode the intrinsic instruction. +/// +/// \param [in] context Pointer to a context. This is generated by \ref agsInit +/// \param [in] device The D3D12 device. +/// \param [out] extensionsSupported Pointer to a bit mask that this function will fill in to indicate which extensions are supported. See ::AGSDriverExtensionDX12 +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_Init( AGSContext* context, ID3D12Device* device, unsigned int* extensionsSupported ); + +/// +/// Function used to cleanup any AMD-specific driver extensions for D3D12 +/// +/// \param [in] context Pointer to a context. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_DeInit( AGSContext* context ); + +/// @} + +/// \defgroup dx12usermarkers User Markers +/// @{ + +/// +/// Function used to push an AMD user marker onto the command list. +/// This is only has an effect if AGS_DX12_EXTENSION_USER_MARKERS is present in the extensionsSupported bitfield of agsDriverExtensionsDX12_Init() +/// Supported in Radeon Software Version 17.9.1 onwards. +/// +/// \param [in] context Pointer to a context. +/// \param [in] commandList Pointer to the command list. +/// \param [in] data The marker string. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_PushMarker( AGSContext* context, ID3D12GraphicsCommandList* commandList, const char* data ); + +/// +/// Function used to pop an AMD user marker on the command list. +/// Supported in Radeon Software Version 17.9.1 onwards. +/// +/// \param [in] context Pointer to a context. +/// \param [in] commandList Pointer to the command list. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_PopMarker( AGSContext* context, ID3D12GraphicsCommandList* commandList ); + +/// +/// Function used to insert an single event AMD user marker onto the command list. +/// Supported in Radeon Software Version 17.9.1 onwards. +/// +/// \param [in] context Pointer to a context. +/// \param [in] commandList Pointer to the command list. +/// \param [in] data The marker string. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_SetMarker( AGSContext* context, ID3D12GraphicsCommandList* commandList, const char* data ); + +/// @} + +/// @} + +/// \defgroup dx11 DirectX11 Extensions +/// DirectX11 driver extensions +/// @{ + +/// \defgroup dx11init Device creation and cleanup +/// It is now mandatory to call agsDriverExtensionsDX11_CreateDevice() when creating a device if the user wants to access any DX11 AMD extensions. +/// The corresponding agsDriverExtensionsDX11_DestroyDevice() call must be called to release the device and free up the internal resources allocated by the create call. +/// @{ + +/// The struct to specify the existing DX11 device creation parameters +struct AGSDX11DeviceCreationParams +{ + IDXGIAdapter* pAdapter; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + D3D_DRIVER_TYPE DriverType; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + HMODULE Software; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + UINT Flags; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + const D3D_FEATURE_LEVEL* pFeatureLevels; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + UINT FeatureLevels; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + UINT SDKVersion; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + const DXGI_SWAP_CHAIN_DESC* pSwapChainDesc; ///< Optional swapchain description. Specify this to invoke D3D11CreateDeviceAndSwapChain instead of D3D11CreateDevice. This must be null on the WACK compliant version +}; + +#define AGS_MAKE_VERSION( major, minor, patch ) ( ( major << 22 ) | ( minor << 12 ) | patch ) ///< Macro to create the app and engine versions for the fields in \ref AGSDX11ExtensionParams +#define AGS_UNSPECIFIED_VERSION 0xFFFFAD00 ///< Use this to specify no version + +/// The struct to specify DX11 additional device creation parameters +struct AGSDX11ExtensionParams +{ + unsigned int uavSlot; ///< The UAV slot reserved for intrinsic support. This must match the slot defined in the HLSL, i.e. #define AmdDxExtShaderIntrinsicsUAVSlot. + /// The default slot is 7, but the caller is free to use an alternative slot. + const WCHAR* pAppName; ///< Application name + UINT appVersion; ///< Application version + const WCHAR* pEngineName; ///< Engine name + UINT engineVersion; ///< Engine version +}; + +/// The struct to hold all the returned parameters from the device creation call +struct AGSDX11ReturnedParams +{ + ID3D11Device* pDevice; ///< The newly created device + D3D_FEATURE_LEVEL FeatureLevel; ///< The feature level supported by the newly created device + ID3D11DeviceContext* pImmediateContext; ///< The newly created immediate device context + IDXGISwapChain* pSwapChain; ///< The newly created swap chain. This is only created if a valid pSwapChainDesc is supplied in AGSDX11DeviceCreationParams. This is not supported on the WACK compliant version + unsigned int extensionsSupported; ///< Bit mask that \ref agsDriverExtensionsDX11_CreateDevice will fill in to indicate which extensions are supported. See AGSDriverExtensionDX11 +}; + +/// +/// Function used to create a D3D11 device with additional AMD-specific initialization parameters. +/// +/// When using the HLSL shader extensions please note: +/// * The shader compiler should not use the D3DCOMPILE_SKIP_OPTIMIZATION option, otherwise it will not work. +/// +/// \param [in] context Pointer to a context. This is generated by \ref agsInit +/// \param [in] creationParams Pointer to the struct to specify the existing DX11 device creation parameters. +/// \param [in] extensionParams Optional pointer to the struct to specify DX11 additional device creation parameters. +/// \param [out] returnedParams Pointer to struct to hold all the returned parameters from the call. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_CreateDevice( AGSContext* context, AGSDX11DeviceCreationParams* creationParams, AGSDX11ExtensionParams* extensionParams, AGSDX11ReturnedParams* returnedParams ); + +/// +/// Function to destroy the D3D11 device. +/// This call will also cleanup any AMD-specific driver extensions for D3D11. +/// +/// \param [in] context Pointer to a context. +/// \param [in] device Pointer to the D3D11 device. +/// \param [out] references Optional pointer to an unsigned int that will be set to the value returned from device->Release(). +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_DestroyDevice( AGSContext* context, ID3D11Device* device, unsigned int* references ); + +/// @} + + +/// \defgroup dx11appreg App Registration +/// @{ +/// This extension allows an apllication to voluntarily register itself with the driver, providing a more robust app detection solution and avoid the issue of the driver +/// relying on exe names to match the app to a driver profile. +/// This feature is supported in Radeon Software Version 17.9.2 onwards. +/// Rules: +/// * AppName or EngineName must be set, but both are not required. Engine profiles will be used only if app specific profiles do not exist. +/// * In an engine, the EngineName should be set, so a default profile can be built. If an app modifies the engine, the AppName should be set, to allow a profile for the specific app. +/// * Version number is not mandatory, but heavily suggested. The use of which can prevent the use of profiles for incompatible versions (for instance engine versions that introduce or change features), and can help prevent older profiles from being used (and introducing new bugs) before the profile is tested with new app builds. +/// * If Version numbers are used and a new version is introduced, a new profile will not be enabled until an AMD engineer has been able to update a previous profile, or make a new one. +/// +/// The cases for profile selection are as follows: +/// +/// |Case|Profile Applied| +/// |----|---------------| +/// | App or Engine Version has profile | The profile is used. | +/// | App or Engine Version num < profile version num | The closest profile > the version number is used. | +/// | App or Engine Version num > profile version num | No profile selected/The previous method is used. | +/// | App and Engine Version have profile | The App's profile is used. | +/// | App and Engine Version num < profile version | The closest App profile > the version number is used. | +/// | App and Engine Version, no App profile found | The Engine profile will be used. | +/// | App/Engine name but no Version, has profile | The latest profile is used. | +/// | No name or version, or no profile | The previous app detection method is used. | +/// +/// As shown above, if an App name is given, and a profile is found for that app, that will be prioritized. The Engine name and profile will be used only if no app name is given, or no viable profile is found for the app name. +/// In the case that App nor Engine have a profile, the previous app detection methods will be used. If given a version number that is larger than any profile version number, no profile will be selected. +/// This is specifically to prevent cases where an update to an engine or app will cause catastrophic breaks in the profile, allowing an engineer to test the profile before clearing it for public use with the new engine/app update. +/// +/// @} + +/// \defgroup dx11misc Misc Extensions +/// API for depth bounds test, UAV overlap and prim topologies +/// @{ + +/// +/// Function used to set the primitive topology. If you are using any of the extended topology types, then this function should +/// be called to set ALL topology types. +/// +/// The Quad List extension is a convenient way to submit quads without using an index buffer. Note that this still submits two triangles at the driver level. +/// In order to use this function, AGS must already be initialized and agsDriverExtensionsDX11_Init must have been called successfully. +/// +/// The Screen Rect extension, which is only available on GCN hardware, allows the user to pass in three of the four corners of a rectangle. +/// The hardware then uses the bounding box of the vertices to rasterize the rectangle primitive (i.e. as a rectangle rather than two triangles). +/// \note Note that this will not return valid interpolated values, only valid SV_Position values. +/// \note If either the Quad List or Screen Rect extension are used, then agsDriverExtensionsDX11_IASetPrimitiveTopology should be called in place of the native DirectX11 equivalent all the time. +/// +/// \param [in] context Pointer to a context. +/// \param [in] topology The topology to set on the D3D11 device. This can be either an AGS-defined topology such as AGS_PRIMITIVE_TOPOLOGY_QUAD_LIST +/// or a standard D3D-defined topology such as D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP. +/// NB. the AGS-defined types will require casting to a D3D_PRIMITIVE_TOPOLOGY type. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_IASetPrimitiveTopology( AGSContext* context, enum D3D_PRIMITIVE_TOPOLOGY topology ); + +/// +/// Function used indicate to the driver it can overlap the subsequent batch of back-to-back dispatches. +/// When calling back-to-back draw calls or dispatch calls that write to the same UAV, the AMD DX11 driver will automatically insert a barrier to ensure there are no write after write (WAW) hazards. +/// If the app can guarantee there is no overlap between the writes between these calls, then this extension will remove those barriers allowing the work to run in parallel on the GPU. +/// +/// Usage would be as follows: +/// \code{.cpp} +/// // Disable automatic WAW syncs +/// agsDriverExtensionsDX11_BeginUAVOverlap( m_agsContext ); +/// +/// // Submit back-to-back dispatches that write to the same UAV +/// m_device->Dispatch( ... ); // First half of UAV +/// m_device->Dispatch( ... ); // Second half of UAV +/// +/// // Reenable automatic WAW syncs +/// agsDriverExtensionsDX11_EndUAVOverlap( m_agsContext ); +/// \endcode +/// +/// \param [in] context Pointer to a context. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_BeginUAVOverlap( AGSContext* context ); + +/// +/// Function used indicate to the driver it can no longer overlap the batch of back-to-back dispatches that has been submitted. +/// +/// \param [in] context Pointer to a context. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_EndUAVOverlap( AGSContext* context ); + +/// +/// Function used to set the depth bounds test extension +/// +/// \param [in] context Pointer to a context. +/// \param [in] enabled Whether to enable or disable the depth bounds testing. If disabled, the next two args are ignored. +/// \param [in] minDepth The near depth range to clip against. +/// \param [in] maxDepth The far depth range to clip against. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDepthBounds( AGSContext* context, bool enabled, float minDepth, float maxDepth ); + +/// @} + +/// \defgroup mdi Multi Draw Indirect (MDI) +/// API for dispatching multiple instanced draw commands. +/// The multi draw indirect extensions allow multiple sets of DrawInstancedIndirect to be submitted in one API call. +/// The draw calls are issued on the GPU's command processor (CP), potentially saving the significant CPU overheads incurred by submitting the equivalent draw calls on the CPU. +/// +/// The extension allows the following code: +/// \code{.cpp} +/// // Submit n batches of DrawIndirect calls +/// for ( int i = 0; i < n; i++ ) +/// DrawIndexedInstancedIndirect( buffer, i * sizeof( cmd ) ); +/// \endcode +/// To be replaced by the following call: +/// \code{.cpp} +/// // Submit all n batches in one call +/// agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect( m_agsContext, n, buffer, 0, sizeof( cmd ) ); +/// \endcode +/// +/// The buffer used for the indirect args must be of the following formats: +/// \code{.cpp} +/// // Buffer layout for agsDriverExtensions_MultiDrawInstancedIndirect +/// struct DrawInstancedIndirectArgs +/// { +/// UINT VertexCountPerInstance; +/// UINT InstanceCount; +/// UINT StartVertexLocation; +/// UINT StartInstanceLocation; +/// }; +/// +/// // Buffer layout for agsDriverExtensions_MultiDrawIndexedInstancedIndirect +/// struct DrawIndexedInstancedIndirectArgs +/// { +/// UINT IndexCountPerInstance; +/// UINT InstanceCount; +/// UINT StartIndexLocation; +/// UINT BaseVertexLocation; +/// UINT StartInstanceLocation; +/// }; +/// \endcode +/// +/// @{ + +/// +/// Function used to submit a batch of draws via MultiDrawIndirect +/// +/// \param [in] context Pointer to a context. +/// \param [in] drawCount The number of draws. +/// \param [in] pBufferForArgs The args buffer. +/// \param [in] alignedByteOffsetForArgs The offset into the args buffer. +/// \param [in] byteStrideForArgs The per element stride of the args buffer. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawInstancedIndirect( AGSContext* context, unsigned int drawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); + +/// +/// Function used to submit a batch of draws via MultiDrawIndirect +/// +/// \param [in] context Pointer to a context. +/// \param [in] drawCount The number of draws. +/// \param [in] pBufferForArgs The args buffer. +/// \param [in] alignedByteOffsetForArgs The offset into the args buffer. +/// \param [in] byteStrideForArgs The per element stride of the args buffer. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect( AGSContext* context, unsigned int drawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); + +/// +/// Function used to submit a batch of draws via MultiDrawIndirect +/// +/// \param [in] context Pointer to a context. +/// \param [in] pBufferForDrawCount The draw count buffer. +/// \param [in] alignedByteOffsetForDrawCount The offset into the draw count buffer. +/// \param [in] pBufferForArgs The args buffer. +/// \param [in] alignedByteOffsetForArgs The offset into the args buffer. +/// \param [in] byteStrideForArgs The per element stride of the args buffer. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect( AGSContext* context, ID3D11Buffer* pBufferForDrawCount, unsigned int alignedByteOffsetForDrawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); + +/// +/// Function used to submit a batch of draws via MultiDrawIndirect +/// +/// \param [in] context Pointer to a context. +/// \param [in] pBufferForDrawCount The draw count buffer. +/// \param [in] alignedByteOffsetForDrawCount The offset into the draw count buffer. +/// \param [in] pBufferForArgs The args buffer. +/// \param [in] alignedByteOffsetForArgs The offset into the args buffer. +/// \param [in] byteStrideForArgs The per element stride of the args buffer. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect( AGSContext* context, ID3D11Buffer* pBufferForDrawCount, unsigned int alignedByteOffsetForDrawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); + +/// @} + +/// \defgroup shadercompiler Shader Compiler Controls +/// API for controlling DirectX11 shader compilation. +/// Check support for this feature using the AGS_DX11_EXTENSION_CREATE_SHADER_CONTROLS bit. +/// Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. +/// @{ + +/// +/// This method can be used to limit the maximum number of threads the driver uses for asynchronous shader compilation. +/// Setting it to 0 will disable asynchronous compilation completely and force the shaders to be compiled "inline" on the threads that call Create*Shader. +/// +/// This method can only be called before any shaders are created and being compiled by the driver. +/// If this method is called after shaders have been created the function will return AGS_FAILURE. +/// This function only sets an upper limit.The driver may create fewer threads than allowed by this function. +/// +/// \param [in] context Pointer to a context. +/// \param [in] numberOfThreads The maximum number of threads to use. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetMaxAsyncCompileThreadCount( AGSContext* context, unsigned int numberOfThreads ); + +/// +/// This method can be used to determine the total number of asynchronous shader compile jobs that are either +/// queued for waiting for compilation or being compiled by the driver’s asynchronous compilation threads. +/// This method can be called at any during the lifetime of the driver. +/// +/// \param [in] context Pointer to a context. +/// \param [out] numberOfJobs Pointer to the number of jobs in flight currently. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_NumPendingAsyncCompileJobs( AGSContext* context, unsigned int* numberOfJobs ); + +/// +/// This method can be used to enable or disable the disk based shader cache. +/// Enabling/disabling the disk cache is not supported if is it disabled explicitly via Radeon Settings or by an app profile. +/// Calling this method under these conditions will result in AGS_FAILURE being returned. +/// It is recommended that this method be called before any shaders are created by the application and being compiled by the driver. +/// Doing so at any other time may result in the cache being left in an inconsistent state. +/// +/// \param [in] context Pointer to a context. +/// \param [in] enable Whether to enable the disk cache. 0 to disable, 1 to enable. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDiskShaderCacheEnabled( AGSContext* context, int enable ); + +/// @} + +/// \defgroup multiview Multiview +/// API for multiview broadcasting. +/// Check support for this feature using the AGS_DX11_EXTENSION_MULTIVIEW bit. +/// Supported in Radeon Software Version 16.12.1 (driver version 16.50.2001) onwards. +/// @{ + +/// +/// Function to control draw calls replication to multiple viewports and RT slices. +/// Setting any mask to 0 disables draw replication. +/// +/// \param [in] context Pointer to a context. +/// \param [in] vpMask Viewport control bit mask. +/// \param [in] rtSliceMask RT slice control bit mask. +/// \param [in] vpMaskPerRtSliceEnabled If 0, 16 lower bits of vpMask apply to all RT slices; if 1 each 16 bits of 64-bit mask apply to corresponding 4 RT slices. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetViewBroadcastMasks( AGSContext* context, unsigned long long vpMask, unsigned long long rtSliceMask, int vpMaskPerRtSliceEnabled ); + +/// +/// Function returns max number of supported clip rectangles. +/// +/// \param [in] context Pointer to a context. +/// \param [out] maxRectCount Returned max number of clip rectangles. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_GetMaxClipRects( AGSContext* context, unsigned int* maxRectCount ); + +/// +/// Function sets clip rectangles. +/// +/// \param [in] context Pointer to a context. +/// \param [in] clipRectCount Number of specified clip rectangles. Use 0 to disable clip rectangles. +/// \param [in] clipRects Array of clip rectangles. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetClipRects( AGSContext* context, unsigned int clipRectCount, const AGSClipRect* clipRects ); + +/// @} + +/// \defgroup cfxapi Explicit Crossfire API +/// API for explicit control over Crossfire +/// @{ + +/// +/// Function to create a Direct3D11 resource with the specified AFR transfer type and specified transfer engine. +/// +/// \param [in] context Pointer to a context. +/// \param [in] desc Pointer to the D3D11 resource description. +/// \param [in] initialData Optional pointer to the initializing data for the resource. +/// \param [out] buffer Returned pointer to the resource. +/// \param [in] transferType The transfer behavior. +/// \param [in] transferEngine The transfer engine to use. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_CreateBuffer( AGSContext* context, const D3D11_BUFFER_DESC* desc, const D3D11_SUBRESOURCE_DATA* initialData, ID3D11Buffer** buffer, AGSAfrTransferType transferType, AGSAfrTransferEngine transferEngine ); + +/// +/// Function to create a Direct3D11 resource with the specified AFR transfer type and specified transfer engine. +/// +/// \param [in] context Pointer to a context. +/// \param [in] desc Pointer to the D3D11 resource description. +/// \param [in] initialData Optional pointer to the initializing data for the resource. +/// \param [out] texture1D Returned pointer to the resource. +/// \param [in] transferType The transfer behavior. +/// \param [in] transferEngine The transfer engine to use. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_CreateTexture1D( AGSContext* context, const D3D11_TEXTURE1D_DESC* desc, const D3D11_SUBRESOURCE_DATA* initialData, ID3D11Texture1D** texture1D, AGSAfrTransferType transferType, AGSAfrTransferEngine transferEngine ); + +/// +/// Function to create a Direct3D11 resource with the specified AFR transfer type and specified transfer engine. +/// +/// \param [in] context Pointer to a context. +/// \param [in] desc Pointer to the D3D11 resource description. +/// \param [in] initialData Optional pointer to the initializing data for the resource. +/// \param [out] texture2D Returned pointer to the resource. +/// \param [in] transferType The transfer behavior. +/// \param [in] transferEngine The transfer engine to use. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_CreateTexture2D( AGSContext* context, const D3D11_TEXTURE2D_DESC* desc, const D3D11_SUBRESOURCE_DATA* initialData, ID3D11Texture2D** texture2D, AGSAfrTransferType transferType, AGSAfrTransferEngine transferEngine ); + +/// +/// Function to create a Direct3D11 resource with the specified AFR transfer type and specified transfer engine. +/// +/// \param [in] context Pointer to a context. +/// \param [in] desc Pointer to the D3D11 resource description. +/// \param [in] initialData Optional pointer to the initializing data for the resource. +/// \param [out] texture3D Returned pointer to the resource. +/// \param [in] transferType The transfer behavior. +/// \param [in] transferEngine The transfer engine to use. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_CreateTexture3D( AGSContext* context, const D3D11_TEXTURE3D_DESC* desc, const D3D11_SUBRESOURCE_DATA* initialData, ID3D11Texture3D** texture3D, AGSAfrTransferType transferType, AGSAfrTransferEngine transferEngine ); + +/// +/// Function to notify the driver that we have finished writing to the resource this frame. +/// This will initiate a transfer for AGS_AFR_TRANSFER_1STEP_P2P, +/// AGS_AFR_TRANSFER_2STEP_NO_BROADCAST, and AGS_AFR_TRANSFER_2STEP_WITH_BROADCAST. +/// +/// \param [in] context Pointer to a context. +/// \param [in] resource Pointer to the resource. +/// \param [in] transferRegions An array of transfer regions (can be null to specify the whole area). +/// \param [in] subresourceArray An array of subresource indices (can be null to specify all subresources). +/// \param [in] numSubresources The number of subresources in subresourceArray OR number of transferRegions. Use 0 to specify ALL subresources and one transferRegion (which may be null if specifying the whole area). +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_NotifyResourceEndWrites( AGSContext* context, ID3D11Resource* resource, const D3D11_RECT* transferRegions, const unsigned int* subresourceArray, unsigned int numSubresources ); + +/// +/// This will notify the driver that the app will begin read/write access to the resource. +/// +/// \param [in] context Pointer to a context. +/// \param [in] resource Pointer to the resource. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_NotifyResourceBeginAllAccess( AGSContext* context, ID3D11Resource* resource ); + +/// +/// This is used for AGS_AFR_TRANSFER_1STEP_P2P to notify when it is safe to initiate a transfer. +/// This call in frame N-(NumGpus-1) allows a 1 step P2P in frame N to start. +/// This should be called after agsDriverExtensionsDX11_NotifyResourceEndWrites. +/// +/// \param [in] context Pointer to a context. +/// \param [in] resource Pointer to the resource. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_NotifyResourceEndAllAccess( AGSContext* context, ID3D11Resource* resource ); + +/// @} + +/// @} + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // AMD_AGS_H From 5dc56048ea9d9ca8fe2dc7d36cd597550fb7bcc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Mon, 23 Jul 2018 19:53:20 +0200 Subject: [PATCH 0442/2542] amd_ags_x64: Make amd_ags.h usable with gcc. --- dlls/amd_ags_x64/amd_ags.h | 110 +++++++++++++++++-------------------- 1 file changed, 51 insertions(+), 59 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index 9c3e37e52e50..a83a1f886923 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -96,8 +96,7 @@ extern "C" { #endif - -#define AMD_AGS_API __declspec(dllexport) ///< AGS calling convention +#define AMD_AGS_API WINAPI // Forward declaration of D3D11 types struct IDXGIAdapter; @@ -117,8 +116,6 @@ struct D3D11_TEXTURE1D_DESC; struct D3D11_TEXTURE2D_DESC; struct D3D11_TEXTURE3D_DESC; struct D3D11_SUBRESOURCE_DATA; -struct tagRECT; -typedef tagRECT D3D11_RECT; ///< typedef this ourselves so we don't have to drag d3d11.h in // Forward declaration of D3D12 types struct ID3D12Device; @@ -126,7 +123,7 @@ struct ID3D12GraphicsCommandList; /// The return codes -enum AGSReturnCode +typedef enum AGSReturnCode { AGS_SUCCESS, ///< Successful function call AGS_FAILURE, ///< Failed to complete call for some unspecified reason @@ -136,10 +133,10 @@ enum AGSReturnCode AGS_ERROR_LEGACY_DRIVER, ///< Returned if a feature is not present in the installed driver AGS_EXTENSION_NOT_SUPPORTED, ///< Returned if the driver does not support the requested driver extension AGS_ADL_FAILURE, ///< Failure in ADL (the AMD Display Library) -}; +} AGSReturnCode; /// The DirectX11 extension support bits -enum AGSDriverExtensionDX11 +typedef enum AGSDriverExtensionDX11 { AGS_DX11_EXTENSION_QUADLIST = 1 << 0, AGS_DX11_EXTENSION_SCREENRECTLIST = 1 << 1, @@ -161,10 +158,10 @@ enum AGSDriverExtensionDX11 AGS_DX11_EXTENSION_CREATE_SHADER_CONTROLS = 1 << 17, AGS_DX11_EXTENSION_MULTIVIEW = 1 << 18, AGS_DX11_EXTENSION_APP_REGISTRATION = 1 << 19 ///< Supported in Radeon Software Version 17.9.1 onwards. -}; +} AGSDriverExtensionDX11; /// The DirectX12 extension support bits -enum AGSDriverExtensionDX12 +typedef enum AGSDriverExtensionDX12 { AGS_DX12_EXTENSION_INTRINSIC_READFIRSTLANE = 1 << 0, ///< Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. AGS_DX12_EXTENSION_INTRINSIC_READLANE = 1 << 1, ///< Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. @@ -177,48 +174,48 @@ enum AGSDriverExtensionDX12 AGS_DX12_EXTENSION_INTRINSIC_WAVE_REDUCE = 1 << 8, ///< Supported in Radeon Software Version 17.9.1 onwards. AGS_DX12_EXTENSION_INTRINSIC_WAVE_SCAN = 1 << 9, ///< Supported in Radeon Software Version 17.9.1 onwards. AGS_DX12_EXTENSION_USER_MARKERS = 1 << 10 ///< Supported in Radeon Software Version 17.9.1 onwards. -}; +} AGSDriverExtensionDX12; /// The space id for DirectX12 intrinsic support const unsigned int AGS_DX12_SHADER_INSTRINSICS_SPACE_ID = 0x7FFF0ADE; // 2147420894 /// Additional topologies supported via extensions -enum AGSPrimitiveTopology +typedef enum AGSPrimitiveTopology { AGS_PRIMITIVE_TOPOLOGY_QUADLIST = 7, AGS_PRIMITIVE_TOPOLOGY_SCREENRECTLIST = 9 -}; +} AGSPrimitiveTopology; /// The different modes to control Crossfire behavior. -enum AGSCrossfireMode +typedef enum AGSCrossfireMode { AGS_CROSSFIRE_MODE_DRIVER_AFR = 0, ///< Use the default driver-based AFR rendering AGS_CROSSFIRE_MODE_EXPLICIT_AFR, ///< Use the AGS Crossfire API functions to perform explicit AFR rendering without requiring a CF driver profile AGS_CROSSFIRE_MODE_DISABLE ///< Completely disable AFR rendering -}; +} AGSCrossfireMode; /// The Crossfire API transfer types -enum AGSAfrTransferType +typedef enum AGSAfrTransferType { AGS_AFR_TRANSFER_DEFAULT = 0, ///< Default Crossfire driver resource tracking AGS_AFR_TRANSFER_DISABLE = 1, ///< Turn off driver resource tracking AGS_AFR_TRANSFER_1STEP_P2P = 2, ///< App controlled GPU to next GPU transfer AGS_AFR_TRANSFER_2STEP_NO_BROADCAST = 3, ///< App controlled GPU to next GPU transfer using intermediate system memory AGS_AFR_TRANSFER_2STEP_WITH_BROADCAST = 4, ///< App controlled GPU to all render GPUs transfer using intermediate system memory -}; +} AGSAfrTransferType; /// The Crossfire API transfer engines -enum AGSAfrTransferEngine +typedef enum AGSAfrTransferEngine { AGS_AFR_TRANSFERENGINE_DEFAULT = 0, ///< Use default engine for Crossfire API transfers AGS_AFR_TRANSFERENGINE_3D_ENGINE = 1, ///< Use 3D engine for Crossfire API transfers AGS_AFR_TRANSFERENGINE_COPY_ENGINE = 2, ///< Use Copy engine for Crossfire API transfers -}; +} AGSAfrTransferEngine; /// The display flags describing various properties of the display. -enum AGSDisplayFlags +typedef enum AGSDisplayFlags { AGS_DISPLAYFLAG_PRIMARY_DISPLAY = 1 << 0, ///< Whether this display is marked as the primary display. Not set on the WACK version. AGS_DISPLAYFLAG_HDR10 = 1 << 1, ///< HDR10 is supported on this display @@ -228,35 +225,33 @@ enum AGSDisplayFlags AGS_DISPLAYFLAG_EYEFINITY_IN_GROUP = 1 << 5, ///< The display is part of the Eyefinity group AGS_DISPLAYFLAG_EYEFINITY_PREFERRED_DISPLAY = 1 << 6, ///< The display is the preferred display in the Eyefinity group for displaying the UI AGS_DISPLAYFLAG_EYEFINITY_IN_PORTRAIT_MODE = 1 << 7, ///< The display is in the Eyefinity group but in portrait mode -}; +} AGSDisplayFlags; -struct AGSContext; ///< All function calls in AGS require a pointer to a context. This is generated via \ref agsInit +typedef struct AGSContext AGSContext; ///< All function calls in AGS require a pointer to a context. This is generated via \ref agsInit /// The rectangle struct used by AGS. -struct AGSRect +typedef struct AGSRect { int offsetX; ///< Offset on X axis int offsetY; ///< Offset on Y axis int width; ///< Width of rectangle int height; ///< Height of rectangle -}; +} AGSRect; /// The clip rectangle struct used by \ref agsDriverExtensionsDX11_SetClipRects -struct AGSClipRect +typedef struct AGSClipRect { /// The inclusion mode for the rect - enum Mode + enum { ClipRectIncluded = 0, ///< Include the rect ClipRectExcluded = 1 ///< Exclude the rect - }; - - Mode mode; ///< Include/exclude rect region + } mode; ; ///< Include/exclude rect region AGSRect rect; ///< The rect to include/exclude -}; +} AGSClipRect; /// The display info struct used to describe a display enumerated by AGS -struct AGSDisplayInfo +typedef struct AGSDisplayInfo { char name[ 256 ]; ///< The name of the display char displayDeviceName[ 32 ]; ///< The display device name, i.e. DISPLAY_DEVICE::DeviceName @@ -296,19 +291,19 @@ struct AGSDisplayInfo int logicalDisplayIndex; ///< The internally used index of this display int adlAdapterIndex; ///< The internally used ADL adapter index -}; +} AGSDisplayInfo; -/// The device info struct used to describe a physical GPU enumerated by AGS -struct AGSDeviceInfo +/// The architecture version +typedef enum ArchitectureVersion { - /// The architecture version - enum ArchitectureVersion - { - ArchitectureVersion_Unknown, ///< Unknown architecture, potentially from another IHV. Check AGSDeviceInfo::vendorId - ArchitectureVersion_PreGCN, ///< AMD architecture, pre-GCN - ArchitectureVersion_GCN ///< AMD GCN architecture - }; + ArchitectureVersion_Unknown, ///< Unknown architecture, potentially from another IHV. Check \ref AGSDeviceInfo::vendorId + ArchitectureVersion_PreGCN, ///< AMD architecture, pre-GCN + ArchitectureVersion_GCN ///< AMD GCN architecture +} ArchitectureVersion; +/// The device info struct used to describe a physical GPU enumerated by AGS +typedef struct AGSDeviceInfo +{ ArchitectureVersion architectureVersion; ///< Set to Unknown if not AMD hardware const char* adapterString; ///< The adapter name string int vendorId; ///< The vendor id @@ -334,7 +329,7 @@ struct AGSDeviceInfo int eyefinityBezelCompensated; ///< Indicates if bezel compensation is used for the current SLS display area. 1 if enabled, and 0 if disabled. int adlAdapterIndex; ///< Internally used index into the ADL list of adapters -}; +} AGSDeviceInfo; /// \defgroup general General API functions /// API for initialization, cleanup, HDR display modes and Crossfire GPU count @@ -343,16 +338,15 @@ struct AGSDeviceInfo typedef void* (__stdcall *AGS_ALLOC_CALLBACK)( int allocationSize ); ///< AGS user defined allocation prototype typedef void (__stdcall *AGS_FREE_CALLBACK)( void* allocationPtr ); ///< AGS user defined free prototype - /// The configuration options that can be passed in to \ref agsInit -struct AGSConfiguration +/// The configuration options that can be passed in to \ref agsInit +typedef struct AGSConfiguration { AGS_ALLOC_CALLBACK allocCallback; ///< Optional memory allocation callback. If not supplied, malloc() is used AGS_FREE_CALLBACK freeCallback; ///< Optional memory freeing callback. If not supplied, free() is used - AGSCrossfireMode crossfireMode; ///< Desired Crossfire mode -}; +} AGSConfiguration; /// The top level GPU information returned from \ref agsInit -struct AGSGPUInfo +typedef struct AGSGPUInfo { int agsVersionMajor; ///< Major field of Major.Minor.Patch AGS version number int agsVersionMinor; ///< Minor field of Major.Minor.Patch AGS version number @@ -364,22 +358,20 @@ struct AGSGPUInfo int numDevices; ///< Number of GPUs in the system AGSDeviceInfo* devices; ///< List of GPUs in the system -}; +} AGSGPUInfo; /// The struct to specify the display settings to the driver. -struct AGSDisplaySettings +typedef struct AGSDisplaySettings { /// The display mode - enum Mode + enum { Mode_SDR, ///< SDR mode Mode_HDR10_PQ, ///< HDR10 PQ encoding, requiring a 1010102 UNORM swapchain and PQ encoding in the output shader. Mode_HDR10_scRGB, ///< HDR10 scRGB, requiring an FP16 swapchain. Values of 1.0 == 80 nits, 125.0 == 10000 nits. Mode_Freesync2_scRGB, ///< Freesync2 scRGB, requiring an FP16 swapchain. Values in the range of 0.0 to 125.0 where 125.0 == AGSDisplayInfo::maxLuminance. Mode_DolbyVision ///< Dolby Vision, requiring an 8888 UNORM swapchain - }; - - Mode mode; ///< The display mode to set the display into + } mode; ///< The display mode to set the display into double chromaticityRedX; ///< Red display primary X coord double chromaticityRedY; ///< Red display primary Y coord @@ -398,7 +390,7 @@ struct AGSDisplaySettings double maxContentLightLevel; ///< The maximum content light level in nits (MaxCLL) double maxFrameAverageLightLevel; ///< The maximum frame average light level in nits (MaxFALL) -}; +} AGSDisplaySettings; /// /// Function used to initialize the AGS library. @@ -526,7 +518,7 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_SetMarker( AGSContext* context /// @{ /// The struct to specify the existing DX11 device creation parameters -struct AGSDX11DeviceCreationParams +typedef struct AGSDX11DeviceCreationParams { IDXGIAdapter* pAdapter; ///< Consult the DX documentation on D3D11CreateDevice for this parameter D3D_DRIVER_TYPE DriverType; ///< Consult the DX documentation on D3D11CreateDevice for this parameter @@ -536,13 +528,13 @@ struct AGSDX11DeviceCreationParams UINT FeatureLevels; ///< Consult the DX documentation on D3D11CreateDevice for this parameter UINT SDKVersion; ///< Consult the DX documentation on D3D11CreateDevice for this parameter const DXGI_SWAP_CHAIN_DESC* pSwapChainDesc; ///< Optional swapchain description. Specify this to invoke D3D11CreateDeviceAndSwapChain instead of D3D11CreateDevice. This must be null on the WACK compliant version -}; +} AGSDX11DeviceCreationParams; #define AGS_MAKE_VERSION( major, minor, patch ) ( ( major << 22 ) | ( minor << 12 ) | patch ) ///< Macro to create the app and engine versions for the fields in \ref AGSDX11ExtensionParams #define AGS_UNSPECIFIED_VERSION 0xFFFFAD00 ///< Use this to specify no version /// The struct to specify DX11 additional device creation parameters -struct AGSDX11ExtensionParams +typedef struct AGSDX11ExtensionParams { unsigned int uavSlot; ///< The UAV slot reserved for intrinsic support. This must match the slot defined in the HLSL, i.e. #define AmdDxExtShaderIntrinsicsUAVSlot. /// The default slot is 7, but the caller is free to use an alternative slot. @@ -550,17 +542,17 @@ struct AGSDX11ExtensionParams UINT appVersion; ///< Application version const WCHAR* pEngineName; ///< Engine name UINT engineVersion; ///< Engine version -}; +} AGSDX11ExtensionParams; /// The struct to hold all the returned parameters from the device creation call -struct AGSDX11ReturnedParams +typedef struct AGSDX11ReturnedParams { ID3D11Device* pDevice; ///< The newly created device D3D_FEATURE_LEVEL FeatureLevel; ///< The feature level supported by the newly created device ID3D11DeviceContext* pImmediateContext; ///< The newly created immediate device context IDXGISwapChain* pSwapChain; ///< The newly created swap chain. This is only created if a valid pSwapChainDesc is supplied in AGSDX11DeviceCreationParams. This is not supported on the WACK compliant version unsigned int extensionsSupported; ///< Bit mask that \ref agsDriverExtensionsDX11_CreateDevice will fill in to indicate which extensions are supported. See AGSDriverExtensionDX11 -}; +} AGSDX11ReturnedParams; /// /// Function used to create a D3D11 device with additional AMD-specific initialization parameters. From ce120d0055178c972bf419bc047c5f3dc429f6ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Mon, 23 Jul 2018 19:53:20 +0200 Subject: [PATCH 0443/2542] amd_ags_x64: Add dll. This is needed to avoid Wolfenstein 2 showing a driver warning dialog on AMD hardware. --- configure.ac | 1 + dlls/amd_ags_x64/Makefile.in | 9 ++ dlls/amd_ags_x64/amd_ags_x64.spec | 29 +++++ dlls/amd_ags_x64/amd_ags_x64_main.c | 189 ++++++++++++++++++++++++++++ 4 files changed, 228 insertions(+) create mode 100644 dlls/amd_ags_x64/Makefile.in create mode 100644 dlls/amd_ags_x64/amd_ags_x64.spec create mode 100644 dlls/amd_ags_x64/amd_ags_x64_main.c diff --git a/configure.ac b/configure.ac index 668387ec5706..4291637213ab 100644 --- a/configure.ac +++ b/configure.ac @@ -2408,6 +2408,7 @@ WINE_CONFIG_MAKEFILE(dlls/advapi32/tests) WINE_CONFIG_MAKEFILE(dlls/advpack) WINE_CONFIG_MAKEFILE(dlls/advpack/tests) WINE_CONFIG_MAKEFILE(dlls/amsi) +WINE_CONFIG_MAKEFILE(dlls/amd_ags_x64) WINE_CONFIG_MAKEFILE(dlls/amstream) WINE_CONFIG_MAKEFILE(dlls/amstream/tests) WINE_CONFIG_MAKEFILE(dlls/apisetschema) diff --git a/dlls/amd_ags_x64/Makefile.in b/dlls/amd_ags_x64/Makefile.in new file mode 100644 index 000000000000..b2c2a28c0649 --- /dev/null +++ b/dlls/amd_ags_x64/Makefile.in @@ -0,0 +1,9 @@ +EXTRADEFS = -DWINE_NO_LONG_TYPES +MODULE = amd_ags_x64.dll +IMPORTS = vulkan-1 +IMPORTLIB = amd_ags_x64 + +EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native + +SOURCES = \ + amd_ags_x64_main.c diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec new file mode 100644 index 000000000000..b4da6136a643 --- /dev/null +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -0,0 +1,29 @@ +1 stdcall agsDeInit(ptr) +2 stub agsDriverExtensionsDX11_BeginUAVOverlap +3 stub agsDriverExtensionsDX11_CreateBuffer +4 stub agsDriverExtensionsDX11_CreateTexture1D +5 stub agsDriverExtensionsDX11_CreateTexture2D +6 stub agsDriverExtensionsDX11_CreateTexture3D +7 stub agsDriverExtensionsDX11_DeInit +8 stub agsDriverExtensionsDX11_EndUAVOverlap +9 stub agsDriverExtensionsDX11_GetMaxClipRects +10 stub agsDriverExtensionsDX11_IASetPrimitiveTopology +11 stub agsDriverExtensionsDX11_Init +12 stub agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect +13 stub agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect +14 stub agsDriverExtensionsDX11_MultiDrawInstancedIndirect +15 stub agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect +16 stub agsDriverExtensionsDX11_NotifyResourceBeginAllAccess +17 stub agsDriverExtensionsDX11_NotifyResourceEndAllAccess +18 stub agsDriverExtensionsDX11_NotifyResourceEndWrites +19 stub agsDriverExtensionsDX11_NumPendingAsyncCompileJobs +20 stub agsDriverExtensionsDX11_SetClipRects +21 stub agsDriverExtensionsDX11_SetDepthBounds +22 stub agsDriverExtensionsDX11_SetDiskShaderCacheEnabled +23 stub agsDriverExtensionsDX11_SetMaxAsyncCompileThreadCount +24 stub agsDriverExtensionsDX11_SetViewBroadcastMasks +25 stub agsDriverExtensionsDX12_DeInit +26 stub agsDriverExtensionsDX12_Init +27 stub agsGetCrossfireGPUCount +28 stdcall agsInit(ptr ptr ptr) +29 stub agsSetDisplayMode diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c new file mode 100644 index 000000000000..aa337dff8a22 --- /dev/null +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -0,0 +1,189 @@ +#include +#include + +#include "windef.h" +#include "winbase.h" +#include "wine/debug.h" +#include "wine/heap.h" + +#include "wine/vulkan.h" + +#include "d3d11.h" +#include "d3d12.h" + +#include "amd_ags.h" + +WINE_DEFAULT_DEBUG_CHANNEL(amd_ags); + +struct AGSContext +{ + unsigned int device_count; + AGSDeviceInfo *devices; + VkPhysicalDeviceProperties *properties; +}; + +static AGSReturnCode vk_get_physical_device_properties(unsigned int *out_count, + VkPhysicalDeviceProperties **out) +{ + VkPhysicalDeviceProperties *properties = NULL; + VkPhysicalDevice *vk_physical_devices = NULL; + VkInstance vk_instance = VK_NULL_HANDLE; + VkInstanceCreateInfo create_info; + AGSReturnCode ret = AGS_SUCCESS; + uint32_t count, i; + VkResult vr; + + *out = NULL; + *out_count = 0; + + memset(&create_info, 0, sizeof(create_info)); + create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; + if ((vr = vkCreateInstance(&create_info, NULL, &vk_instance) < 0)) + { + WARN("Failed to create Vulkan instance, vr %d.\n", vr); + goto done; + } + + if ((vr = vkEnumeratePhysicalDevices(vk_instance, &count, NULL)) < 0) + { + WARN("Failed to enumerate devices, vr %d.\n", vr); + goto done; + } + + if (!(vk_physical_devices = heap_calloc(count, sizeof(*vk_physical_devices)))) + { + WARN("Failed to allocate memory.\n"); + ret = AGS_OUT_OF_MEMORY; + goto done; + } + + if ((vr = vkEnumeratePhysicalDevices(vk_instance, &count, vk_physical_devices)) < 0) + { + WARN("Failed to enumerate devices, vr %d.\n", vr); + goto done; + } + + if (!(properties = heap_calloc(count, sizeof(*properties)))) + { + WARN("Failed to allocate memory.\n"); + ret = AGS_OUT_OF_MEMORY; + goto done; + } + + for (i = 0; i < count; ++i) + vkGetPhysicalDeviceProperties(vk_physical_devices[i], &properties[i]); + + *out_count = count; + *out = properties; + +done: + heap_free(vk_physical_devices); + if (vk_instance) + vkDestroyInstance(vk_instance, NULL); + return ret; +} + +static AGSReturnCode init_ags_context(AGSContext *context) +{ + AGSReturnCode ret; + unsigned int i; + + context->device_count = 0; + context->devices = NULL; + context->properties = NULL; + + ret = vk_get_physical_device_properties(&context->device_count, &context->properties); + if (ret != AGS_SUCCESS || !context->device_count) + return ret; + + if (!(context->devices = heap_calloc(context->device_count, sizeof(*context->devices)))) + { + WARN("Failed to allocate memory.\n"); + heap_free(context->properties); + return AGS_OUT_OF_MEMORY; + } + + for (i = 0; i < context->device_count; ++i) + { + const VkPhysicalDeviceProperties *vk_properties = &context->properties[i]; + AGSDeviceInfo *device = &context->devices[i]; + + device->adapterString = vk_properties->deviceName; + device->vendorId = vk_properties->vendorID; + device->deviceId = vk_properties->deviceID; + + if (device->vendorId == 0x1002) + device->architectureVersion = ArchitectureVersion_GCN; + + if (!i) + device->isPrimaryDevice = 1; + } + + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *config, AGSGPUInfo *gpu_info) +{ + struct AGSContext *object; + AGSReturnCode ret; + + TRACE("context %p, config %p, gpu_info %p.\n", context, config, gpu_info); + + if (!context || !gpu_info) + return AGS_INVALID_ARGS; + + if (config) + FIXME("Ignoring config %p.\n", config); + + if (!(object = heap_alloc(sizeof(*object)))) + return AGS_OUT_OF_MEMORY; + + if ((ret = init_ags_context(object)) != AGS_SUCCESS) + { + heap_free(object); + return ret; + } + + memset(gpu_info, 0, sizeof(*gpu_info)); + gpu_info->agsVersionMajor = AMD_AGS_VERSION_MAJOR; + gpu_info->agsVersionMinor = AMD_AGS_VERSION_MINOR; + gpu_info->agsVersionPatch = AMD_AGS_VERSION_PATCH; + gpu_info->driverVersion = "18.10.16-180516a-328911C-RadeonSoftwareAdrenalin"; + gpu_info->radeonSoftwareVersion = "18.5.1"; + gpu_info->numDevices = object->device_count; + gpu_info->devices = object->devices; + + TRACE("Created context %p.\n", object); + + *context = object; + + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDeInit(AGSContext *context) +{ + TRACE("context %p.\n", context); + + if (context) + { + heap_free(context->properties); + heap_free(context->devices); + heap_free(context); + } + + return AGS_SUCCESS; +} + +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) +{ + TRACE("%p, %u, %p.\n", instance, reason, reserved); + + switch (reason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(instance); + break; + } + + return TRUE; +} From abf758bd064812c356bb2e9d8f9816b63e83120e Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Tue, 1 Oct 2019 09:28:29 +0800 Subject: [PATCH 0444/2542] amd_ags_x64: Add agsGetCrossfireGPUCount stub. Signed-off-by: Zhiyi Zhang --- dlls/amd_ags_x64/amd_ags_x64.spec | 2 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index b4da6136a643..a302d2fc6578 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -24,6 +24,6 @@ 24 stub agsDriverExtensionsDX11_SetViewBroadcastMasks 25 stub agsDriverExtensionsDX12_DeInit 26 stub agsDriverExtensionsDX12_Init -27 stub agsGetCrossfireGPUCount +27 stdcall agsGetCrossfireGPUCount(ptr ptr) 28 stdcall agsInit(ptr ptr ptr) 29 stub agsSetDisplayMode diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index aa337dff8a22..e339d7b7d2bc 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -174,6 +174,17 @@ AGSReturnCode WINAPI agsDeInit(AGSContext *context) return AGS_SUCCESS; } +AGSReturnCode WINAPI agsGetCrossfireGPUCount(AGSContext *context, int *gpu_count) +{ + TRACE("context %p gpu_count %p stub!\n", context, gpu_count); + + if (!context || !gpu_count) + return AGS_INVALID_ARGS; + + *gpu_count = 1; + return AGS_SUCCESS; +} + BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) { TRACE("%p, %u, %p.\n", instance, reason, reserved); From 8d89883add5a09bec90757d77067ea9abe3a4773 Mon Sep 17 00:00:00 2001 From: Brendan Shanks Date: Thu, 11 Jun 2020 17:33:56 -0700 Subject: [PATCH 0445/2542] amd_ags_x64: Update to 5.2.0. --- dlls/amd_ags_x64/amd_ags.h | 577 +++++++++++++++++++++++----- dlls/amd_ags_x64/amd_ags_x64_main.c | 60 ++- 2 files changed, 531 insertions(+), 106 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index a83a1f886923..b647f912aa75 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -24,7 +24,7 @@ /// \mainpage /// AGS Library Overview /// -------------------- -/// This document provides an overview of the AGS (AMD GPU Services) library. The AGS library provides software developers with the ability to query +/// This document provides an overview of the AGS (AMD GPU Services) library. The AGS library provides software developers with the ability to query /// AMD GPU software and hardware state information that is not normally available through standard operating systems or graphic APIs. /// /// The latest version of the API is publicly hosted here: https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK/. @@ -33,6 +33,15 @@ /// Online documentation is publicly hosted here: http://gpuopen-librariesandsdks.github.io/ags/ /// \endinternal /// +/// What's new in AGS 5.2.0 since version 5.1 +/// --------------------------------------- +/// AGS 5.2 includes the following updates: +/// * DX12 app registration API +/// * DX11 breadcrumb marker API for tracking down GPU hangs:\ref agsDriverExtensionsDX11_WriteBreadcrumb +/// * DX12 extensions now require the creation of the device via \ref agsDriverExtensionsDX12_CreateDevice +/// * agsGetCrossfireGPUCount has been removed in favor of retrieving the value from \ref agsDriverExtensionsDX11_CreateDevice +/// * API change that fixes a reference leak in \ref agsDriverExtensionsDX11_DestroyDevice +/// /// What's new in AGS 5.1.1 since version 5.0.6 /// --------------------------------------- /// AGS 5.1.1 includes the following updates: @@ -50,7 +59,7 @@ /// /// What's new in AGS 5.x since version 4.x /// --------------------------------------- -/// Version 5.x is a major overhaul of the library designed to provide a much clearer view of the GPUs in the system and the displays attached to them. +/// Version 5.x is a major overhaul of the library designed to provide a much clearer view of the GPUs in the system and the displays attached to them. /// It also exposes the ability to query each display for HDR capabilities and put those HDR capable displays into various HDR modes. /// Some functions such as agsGetGPUMemorySize and agsGetEyefinityConfigInfo have been removed in favor of including this information in the device & display enumeration. /// Features include: @@ -69,8 +78,8 @@ /// * AGSSample /// * CrossfireSample /// * EyefinitySample -/// The AGSSample application is the simplest of the three examples and demonstrates the code required to initialize AGS and use it to query the GPU and Eyefinity state. -/// The CrossfireSample application demonstrates the use of the new API to transfer resources on GPUs in Crossfire mode. Lastly, the EyefinitySample application provides a more +/// The AGSSample application is the simplest of the three examples and demonstrates the code required to initialize AGS and use it to query the GPU and Eyefinity state. +/// The CrossfireSample application demonstrates the use of the new API to transfer resources on GPUs in Crossfire mode. Lastly, the EyefinitySample application provides a more /// extensive example of Eyefinity setup than the basic example provided in AGSSample. /// There are other samples on Github that demonstrate the DirectX shader extensions, such as the Barycentrics11 and Barycentrics12 samples. /// @@ -80,17 +89,16 @@ /// * Include the amd_ags.h header file from your source code. /// * Include the AGS hlsl files if you are using the shader intrinsics. /// * Declare a pointer to an AGSContext and make this available for all subsequent calls to AGS. -/// * On game initialization, call agsInit() passing in the address of the context. On success, this function will return a valid context pointer. -/// * The agsInit() function should be called before the D3D device is created if the Crossfire mode is specified. +/// * On game initialization, call \ref agsInit passing in the address of the context. On success, this function will return a valid context pointer. /// -/// Don't forget to cleanup AGS by calling agsDeInit() when the app exits, after the device has been destroyed. +/// Don't forget to cleanup AGS by calling \ref agsDeInit when the app exits, after the device has been destroyed. #ifndef AMD_AGS_H #define AMD_AGS_H #define AMD_AGS_VERSION_MAJOR 5 ///< AGS major version -#define AMD_AGS_VERSION_MINOR 1 ///< AGS minor version -#define AMD_AGS_VERSION_PATCH 1 ///< AGS patch version +#define AMD_AGS_VERSION_MINOR 2 ///< AGS minor version +#define AMD_AGS_VERSION_PATCH 0 ///< AGS patch version #ifdef __cplusplus extern "C" { @@ -138,42 +146,44 @@ typedef enum AGSReturnCode /// The DirectX11 extension support bits typedef enum AGSDriverExtensionDX11 { - AGS_DX11_EXTENSION_QUADLIST = 1 << 0, - AGS_DX11_EXTENSION_SCREENRECTLIST = 1 << 1, - AGS_DX11_EXTENSION_UAV_OVERLAP = 1 << 2, - AGS_DX11_EXTENSION_DEPTH_BOUNDS_TEST = 1 << 3, - AGS_DX11_EXTENSION_MULTIDRAWINDIRECT = 1 << 4, - AGS_DX11_EXTENSION_MULTIDRAWINDIRECT_COUNTINDIRECT = 1 << 5, - AGS_DX11_EXTENSION_CROSSFIRE_API = 1 << 6, - AGS_DX11_EXTENSION_INTRINSIC_READFIRSTLANE = 1 << 7, - AGS_DX11_EXTENSION_INTRINSIC_READLANE = 1 << 8, - AGS_DX11_EXTENSION_INTRINSIC_LANEID = 1 << 9, - AGS_DX11_EXTENSION_INTRINSIC_SWIZZLE = 1 << 10, - AGS_DX11_EXTENSION_INTRINSIC_BALLOT = 1 << 11, - AGS_DX11_EXTENSION_INTRINSIC_MBCOUNT = 1 << 12, - AGS_DX11_EXTENSION_INTRINSIC_COMPARE3 = 1 << 13, - AGS_DX11_EXTENSION_INTRINSIC_BARYCENTRICS = 1 << 14, + AGS_DX11_EXTENSION_QUADLIST = 1 << 0, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_SCREENRECTLIST = 1 << 1, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_UAV_OVERLAP = 1 << 2, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_DEPTH_BOUNDS_TEST = 1 << 3, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_MULTIDRAWINDIRECT = 1 << 4, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_MULTIDRAWINDIRECT_COUNTINDIRECT = 1 << 5, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_CROSSFIRE_API = 1 << 6, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_READFIRSTLANE = 1 << 7, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_READLANE = 1 << 8, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_LANEID = 1 << 9, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_SWIZZLE = 1 << 10, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_BALLOT = 1 << 11, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_MBCOUNT = 1 << 12, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_MED3 = 1 << 13, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_BARYCENTRICS = 1 << 14, ///< Supported in Radeon Software Version 16.9.2 onwards. AGS_DX11_EXTENSION_INTRINSIC_WAVE_REDUCE = 1 << 15, ///< Supported in Radeon Software Version 17.9.1 onwards. AGS_DX11_EXTENSION_INTRINSIC_WAVE_SCAN = 1 << 16, ///< Supported in Radeon Software Version 17.9.1 onwards. - AGS_DX11_EXTENSION_CREATE_SHADER_CONTROLS = 1 << 17, - AGS_DX11_EXTENSION_MULTIVIEW = 1 << 18, - AGS_DX11_EXTENSION_APP_REGISTRATION = 1 << 19 ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX11_EXTENSION_CREATE_SHADER_CONTROLS = 1 << 17, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_MULTIVIEW = 1 << 18, ///< Supported in Radeon Software Version 16.12.1 onwards. + AGS_DX11_EXTENSION_APP_REGISTRATION = 1 << 19, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX11_EXTENSION_BREADCRUMB_MARKERS = 1 << 20, ///< Supported in Radeon Software Version 17.11.1 onwards. } AGSDriverExtensionDX11; /// The DirectX12 extension support bits typedef enum AGSDriverExtensionDX12 { - AGS_DX12_EXTENSION_INTRINSIC_READFIRSTLANE = 1 << 0, ///< Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. - AGS_DX12_EXTENSION_INTRINSIC_READLANE = 1 << 1, ///< Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. - AGS_DX12_EXTENSION_INTRINSIC_LANEID = 1 << 2, ///< Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. - AGS_DX12_EXTENSION_INTRINSIC_SWIZZLE = 1 << 3, ///< Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. - AGS_DX12_EXTENSION_INTRINSIC_BALLOT = 1 << 4, ///< Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. - AGS_DX12_EXTENSION_INTRINSIC_MBCOUNT = 1 << 5, ///< Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. - AGS_DX12_EXTENSION_INTRINSIC_COMPARE3 = 1 << 6, ///< Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. - AGS_DX12_EXTENSION_INTRINSIC_BARYCENTRICS = 1 << 7, ///< Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. + AGS_DX12_EXTENSION_INTRINSIC_READFIRSTLANE = 1 << 0, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_READLANE = 1 << 1, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_LANEID = 1 << 2, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_SWIZZLE = 1 << 3, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_BALLOT = 1 << 4, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_MBCOUNT = 1 << 5, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_MED3 = 1 << 6, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_BARYCENTRICS = 1 << 7, ///< Supported in Radeon Software Version 16.9.2 onwards. AGS_DX12_EXTENSION_INTRINSIC_WAVE_REDUCE = 1 << 8, ///< Supported in Radeon Software Version 17.9.1 onwards. AGS_DX12_EXTENSION_INTRINSIC_WAVE_SCAN = 1 << 9, ///< Supported in Radeon Software Version 17.9.1 onwards. - AGS_DX12_EXTENSION_USER_MARKERS = 1 << 10 ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX12_EXTENSION_USER_MARKERS = 1 << 10, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX12_EXTENSION_APP_REGISTRATION = 1 << 11 ///< Supported in Radeon Software Version 17.9.1 onwards. } AGSDriverExtensionDX12; /// The space id for DirectX12 intrinsic support @@ -183,37 +193,10 @@ const unsigned int AGS_DX12_SHADER_INSTRINSICS_SPACE_ID = 0x7FFF0ADE; // 2147420 /// Additional topologies supported via extensions typedef enum AGSPrimitiveTopology { - AGS_PRIMITIVE_TOPOLOGY_QUADLIST = 7, - AGS_PRIMITIVE_TOPOLOGY_SCREENRECTLIST = 9 + AGS_PRIMITIVE_TOPOLOGY_QUADLIST = 7, ///< Quad list + AGS_PRIMITIVE_TOPOLOGY_SCREENRECTLIST = 9 ///< Screen rect list } AGSPrimitiveTopology; -/// The different modes to control Crossfire behavior. -typedef enum AGSCrossfireMode -{ - AGS_CROSSFIRE_MODE_DRIVER_AFR = 0, ///< Use the default driver-based AFR rendering - AGS_CROSSFIRE_MODE_EXPLICIT_AFR, ///< Use the AGS Crossfire API functions to perform explicit AFR rendering without requiring a CF driver profile - AGS_CROSSFIRE_MODE_DISABLE ///< Completely disable AFR rendering -} AGSCrossfireMode; - - -/// The Crossfire API transfer types -typedef enum AGSAfrTransferType -{ - AGS_AFR_TRANSFER_DEFAULT = 0, ///< Default Crossfire driver resource tracking - AGS_AFR_TRANSFER_DISABLE = 1, ///< Turn off driver resource tracking - AGS_AFR_TRANSFER_1STEP_P2P = 2, ///< App controlled GPU to next GPU transfer - AGS_AFR_TRANSFER_2STEP_NO_BROADCAST = 3, ///< App controlled GPU to next GPU transfer using intermediate system memory - AGS_AFR_TRANSFER_2STEP_WITH_BROADCAST = 4, ///< App controlled GPU to all render GPUs transfer using intermediate system memory -} AGSAfrTransferType; - -/// The Crossfire API transfer engines -typedef enum AGSAfrTransferEngine -{ - AGS_AFR_TRANSFERENGINE_DEFAULT = 0, ///< Use default engine for Crossfire API transfers - AGS_AFR_TRANSFERENGINE_3D_ENGINE = 1, ///< Use 3D engine for Crossfire API transfers - AGS_AFR_TRANSFERENGINE_COPY_ENGINE = 2, ///< Use Copy engine for Crossfire API transfers -} AGSAfrTransferEngine; - /// The display flags describing various properties of the display. typedef enum AGSDisplayFlags { @@ -227,6 +210,13 @@ typedef enum AGSDisplayFlags AGS_DISPLAYFLAG_EYEFINITY_IN_PORTRAIT_MODE = 1 << 7, ///< The display is in the Eyefinity group but in portrait mode } AGSDisplayFlags; +/// The display settings flags. +typedef enum AGSDisplaySettingsFlags +{ + AGS_DISPLAYSETTINGSFLAG_DISABLE_LOCAL_DIMMING = 1 << 0, ///< Disables local dimming if possible +} AGSDisplaySettingsFlags; + + typedef struct AGSContext AGSContext; ///< All function calls in AGS require a pointer to a context. This is generated via \ref agsInit /// The rectangle struct used by AGS. @@ -302,7 +292,7 @@ typedef enum ArchitectureVersion } ArchitectureVersion; /// The device info struct used to describe a physical GPU enumerated by AGS -typedef struct AGSDeviceInfo +typedef struct AGSDeviceInfo_511 { ArchitectureVersion architectureVersion; ///< Set to Unknown if not AMD hardware const char* adapterString; ///< The adapter name string @@ -329,20 +319,71 @@ typedef struct AGSDeviceInfo int eyefinityBezelCompensated; ///< Indicates if bezel compensation is used for the current SLS display area. 1 if enabled, and 0 if disabled. int adlAdapterIndex; ///< Internally used index into the ADL list of adapters +} AGSDeviceInfo_511; + +/// The device info struct used to describe a physical GPU enumerated by AGS +typedef struct AGSDeviceInfo_520 +{ + const char* adapterString; ///< The adapter name string + ArchitectureVersion architectureVersion; ///< Set to Unknown if not AMD hardware + int vendorId; ///< The vendor id + int deviceId; ///< The device id + int revisionId; ///< The revision id + + int numCUs; ///< Number of compute units. Zero if not GCN onwards + int numROPs; ///< Number of ROPs + int coreClock; ///< Core clock speed at 100% power in MHz + int memoryClock; ///< Memory clock speed at 100% power in MHz + int memoryBandwidth; ///< Memory bandwidth in MB/s + float teraFlops; ///< Teraflops of GPU. Zero if not GCN onwards. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD + + int isPrimaryDevice; ///< Whether or not this is the primary adapter in the system. Not set on the WACK version. + long long localMemoryInBytes; ///< The size of local memory in bytes. 0 for non AMD hardware. + + int numDisplays; ///< The number of active displays found to be attached to this adapter. + AGSDisplayInfo* displays; ///< List of displays allocated by AGS to be numDisplays in length. + + int eyefinityEnabled; ///< Indicates if Eyefinity is active + int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityGridHeight; ///< Contains height of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityResolutionX; ///< Contains width in pixels of the multi-monitor Single Large Surface. + int eyefinityResolutionY; ///< Contains height in pixels of the multi-monitor Single Large Surface. + int eyefinityBezelCompensated; ///< Indicates if bezel compensation is used for the current SLS display area. 1 if enabled, and 0 if disabled. + + int adlAdapterIndex; ///< Internally used index into the ADL list of adapters +} AGSDeviceInfo_520; + +typedef union AGSDeviceInfo +{ + AGSDeviceInfo_511 agsDeviceInfo511; + AGSDeviceInfo_520 agsDeviceInfo520; } AGSDeviceInfo; /// \defgroup general General API functions /// API for initialization, cleanup, HDR display modes and Crossfire GPU count /// @{ -typedef void* (__stdcall *AGS_ALLOC_CALLBACK)( int allocationSize ); ///< AGS user defined allocation prototype -typedef void (__stdcall *AGS_FREE_CALLBACK)( void* allocationPtr ); ///< AGS user defined free prototype +typedef void* (__stdcall *AGS_ALLOC_CALLBACK_511)( int allocationSize ); ///< AGS user defined allocation prototype +typedef void* (__stdcall *AGS_ALLOC_CALLBACK)( size_t allocationSize ); ///< AGS user defined allocation prototype +typedef void (__stdcall *AGS_FREE_CALLBACK)( void* allocationPtr ); ///< AGS user defined free prototype /// The configuration options that can be passed in to \ref agsInit -typedef struct AGSConfiguration +typedef struct AGSConfiguration_511 +{ + AGS_ALLOC_CALLBACK_511 allocCallback; ///< Optional memory allocation callback. If not supplied, malloc() is used + AGS_FREE_CALLBACK freeCallback; ///< Optional memory freeing callback. If not supplied, free() is used +} AGSConfiguration_511; + +typedef struct AGSConfiguration_520 { AGS_ALLOC_CALLBACK allocCallback; ///< Optional memory allocation callback. If not supplied, malloc() is used AGS_FREE_CALLBACK freeCallback; ///< Optional memory freeing callback. If not supplied, free() is used +} AGSConfiguration_520; + +typedef union AGSConfiguration +{ + AGSConfiguration_511 agsConfiguration511; + AGSConfiguration_520 agsConfiguration520; } AGSConfiguration; /// The top level GPU information returned from \ref agsInit @@ -369,7 +410,7 @@ typedef struct AGSDisplaySettings Mode_SDR, ///< SDR mode Mode_HDR10_PQ, ///< HDR10 PQ encoding, requiring a 1010102 UNORM swapchain and PQ encoding in the output shader. Mode_HDR10_scRGB, ///< HDR10 scRGB, requiring an FP16 swapchain. Values of 1.0 == 80 nits, 125.0 == 10000 nits. - Mode_Freesync2_scRGB, ///< Freesync2 scRGB, requiring an FP16 swapchain. Values in the range of 0.0 to 125.0 where 125.0 == AGSDisplayInfo::maxLuminance. + Mode_Freesync2_scRGB, ///< Freesync2 scRGB, requiring an FP16 swapchain. 1.0 == 80 nits. Tonemap your scene to the range of 0.0 to AGSDisplayInfo::maxLuminance. Mode_DolbyVision ///< Dolby Vision, requiring an 8888 UNORM swapchain } mode; ///< The display mode to set the display into @@ -390,13 +431,16 @@ typedef struct AGSDisplaySettings double maxContentLightLevel; ///< The maximum content light level in nits (MaxCLL) double maxFrameAverageLightLevel; ///< The maximum frame average light level in nits (MaxFALL) + + // ADDED IN 5.2.0 + int flags; ///< Bitfield of ::AGSDisplaySettingsFlags } AGSDisplaySettings; /// /// Function used to initialize the AGS library. /// Must be called prior to any of the subsequent AGS API calls. /// Must be called prior to ID3D11Device or ID3D12Device creation. -/// \note This function will fail with AGS_ERROR_LEGACY_DRIVER in Catalyst versions before 12.20. +/// \note This function will fail with \ref AGS_ERROR_LEGACY_DRIVER in Catalyst versions before 12.20. /// \note It is good practice to check the AGS version returned from AGSGPUInfo against the version defined in the header in case a mismatch between the dll and header has occurred. /// /// \param [in, out] context Address of a pointer to a context. This function allocates a context on the heap which is then required for all subsequent API calls. @@ -419,6 +463,7 @@ AMD_AGS_API AGSReturnCode agsDeInit( AGSContext* context ); /// \param [in] context Pointer to a context. /// \param [out] numGPUs Number of GPUs used for Crossfire acceleration /// +/// REMOVED IN 5.2.0 AMD_AGS_API AGSReturnCode agsGetCrossfireGPUCount( AGSContext* context, int* numGPUs ); /// @@ -427,7 +472,6 @@ AMD_AGS_API AGSReturnCode agsGetCrossfireGPUCount( AGSContext* context, int* num /// \note Call this function after each mode change (switch to fullscreen, any change in swapchain etc). /// \note HDR10 PQ mode requires a 1010102 swapchain. /// \note HDR10 scRGB mode requires an FP16 swapchain. -/// \note Freesync2 Gamma mode requires a 1010102 swapchain. /// \note Freesync2 scRGB mode requires an FP16 swapchain. /// \note Dolby Vision requires a 8888 UNORM swapchain. /// @@ -444,9 +488,65 @@ AMD_AGS_API AGSReturnCode agsSetDisplayMode( AGSContext* context, int deviceInde /// DirectX12 driver extensions /// @{ -/// \defgroup dx12init Initialization and Cleanup +/// \defgroup dx12init Device creation and cleanup +/// It is now mandatory to call \ref agsDriverExtensionsDX12_CreateDevice when creating a device if the user wants to access any future DX12 AMD extensions. +/// The corresponding \ref agsDriverExtensionsDX12_DestroyDevice call must be called to release the device and free up the internal resources allocated by the create call. /// @{ +/// The struct to specify the DX12 device creation parameters +typedef struct AGSDX12DeviceCreationParams +{ + IDXGIAdapter* pAdapter; ///< Pointer to the adapter to use when creating the device. This may be null. + IID iid; ///< The interface ID for the type of device to be created. + D3D_FEATURE_LEVEL FeatureLevel; ///< The minimum feature level to create the device with. +} AGSDX12DeviceCreationParams; + +#define AGS_MAKE_VERSION( major, minor, patch ) ( ( major << 22 ) | ( minor << 12 ) | patch ) ///< Macro to create the app and engine versions for the fields in \ref AGSDX12ExtensionParams and \ref AGSDX11ExtensionParams +#define AGS_UNSPECIFIED_VERSION 0xFFFFAD00 ///< Use this to specify no version + +/// The struct to specify DX12 additional device creation parameters +typedef struct AGSDX12ExtensionParams +{ + const WCHAR* pAppName; ///< Application name + const WCHAR* pEngineName; ///< Engine name + unsigned int appVersion; ///< Application version + unsigned int engineVersion; ///< Engine version +} AGSDX12ExtensionParams; + +/// The struct to hold all the returned parameters from the device creation call +typedef struct AGSDX12ReturnedParams +{ + ID3D12Device* pDevice; ///< The newly created device + unsigned int extensionsSupported; ///< Bit mask that \ref agsDriverExtensionsDX12_CreateDevice will fill in to indicate which extensions are supported. See \ref AGSDriverExtensionDX12 +} AGSDX12ReturnedParams; + + +/// +/// Function used to create a D3D12 device with additional AMD-specific initialization parameters. +/// +/// When using the HLSL shader extensions please note: +/// * The shader compiler should not use the D3DCOMPILE_SKIP_OPTIMIZATION (/Od) option, otherwise it will not work. +/// * The shader compiler needs D3DCOMPILE_ENABLE_STRICTNESS (/Ges) enabled. +/// * The intrinsic instructions require a 5.1 shader model. +/// * The Root Signature will need to use an extra resource and sampler. These are not real resources/samplers, they are just used to encode the intrinsic instruction. +/// +/// \param [in] context Pointer to a context. This is generated by \ref agsInit +/// \param [in] creationParams Pointer to the struct to specify the existing DX12 device creation parameters. +/// \param [in] extensionParams Optional pointer to the struct to specify DX12 additional device creation parameters. +/// \param [out] returnedParams Pointer to struct to hold all the returned parameters from the call. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_CreateDevice( AGSContext* context, const AGSDX12DeviceCreationParams* creationParams, const AGSDX12ExtensionParams* extensionParams, AGSDX12ReturnedParams* returnedParams ); + +/// +/// Function to destroy the D3D12 device. +/// This call will also cleanup any AMD-specific driver extensions for D3D12. +/// +/// \param [in] context Pointer to a context. +/// \param [in] device Pointer to the D3D12 device. +/// \param [out] deviceReferences Optional pointer to an unsigned int that will be set to the value returned from device->Release(). +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_DestroyDevice( AGSContext* context, ID3D12Device* device, unsigned int* deviceReferences ); + /// /// Function used to initialize the AMD-specific driver extensions for D3D12. /// Extensions require support in the driver, therefore it is important to check the extensionsSupported bitfield. @@ -460,6 +560,7 @@ AMD_AGS_API AGSReturnCode agsSetDisplayMode( AGSContext* context, int deviceInde /// \param [in] device The D3D12 device. /// \param [out] extensionsSupported Pointer to a bit mask that this function will fill in to indicate which extensions are supported. See ::AGSDriverExtensionDX12 /// +/// REMOVED IN 5.2.0 AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_Init( AGSContext* context, ID3D12Device* device, unsigned int* extensionsSupported ); /// @@ -467,6 +568,7 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_Init( AGSContext* context, ID3 /// /// \param [in] context Pointer to a context. /// +/// REMOVED IN 5.2.0 AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_DeInit( AGSContext* context ); /// @} @@ -476,7 +578,7 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_DeInit( AGSContext* context ); /// /// Function used to push an AMD user marker onto the command list. -/// This is only has an effect if AGS_DX12_EXTENSION_USER_MARKERS is present in the extensionsSupported bitfield of agsDriverExtensionsDX12_Init() +/// This is only has an effect if AGS_DX12_EXTENSION_USER_MARKERS is present in the extensionsSupported bitfield of \ref agsDriverExtensionsDX12_CreateDevice /// Supported in Radeon Software Version 17.9.1 onwards. /// /// \param [in] context Pointer to a context. @@ -513,10 +615,18 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_SetMarker( AGSContext* context /// @{ /// \defgroup dx11init Device creation and cleanup -/// It is now mandatory to call agsDriverExtensionsDX11_CreateDevice() when creating a device if the user wants to access any DX11 AMD extensions. -/// The corresponding agsDriverExtensionsDX11_DestroyDevice() call must be called to release the device and free up the internal resources allocated by the create call. +/// It is now mandatory to call \ref agsDriverExtensionsDX11_CreateDevice when creating a device if the user wants to access any DX11 AMD extensions. +/// The corresponding \ref agsDriverExtensionsDX11_DestroyDevice call must be called to release the device and free up the internal resources allocated by the create call. /// @{ +/// The different modes to control Crossfire behavior. +typedef enum AGSCrossfireMode +{ + AGS_CROSSFIRE_MODE_DRIVER_AFR = 0, ///< Use the default driver-based AFR rendering + AGS_CROSSFIRE_MODE_EXPLICIT_AFR, ///< Use the AGS Crossfire API functions to perform explicit AFR rendering without requiring a CF driver profile + AGS_CROSSFIRE_MODE_DISABLE ///< Completely disable AFR rendering +} AGSCrossfireMode; + /// The struct to specify the existing DX11 device creation parameters typedef struct AGSDX11DeviceCreationParams { @@ -530,11 +640,8 @@ typedef struct AGSDX11DeviceCreationParams const DXGI_SWAP_CHAIN_DESC* pSwapChainDesc; ///< Optional swapchain description. Specify this to invoke D3D11CreateDeviceAndSwapChain instead of D3D11CreateDevice. This must be null on the WACK compliant version } AGSDX11DeviceCreationParams; -#define AGS_MAKE_VERSION( major, minor, patch ) ( ( major << 22 ) | ( minor << 12 ) | patch ) ///< Macro to create the app and engine versions for the fields in \ref AGSDX11ExtensionParams -#define AGS_UNSPECIFIED_VERSION 0xFFFFAD00 ///< Use this to specify no version - /// The struct to specify DX11 additional device creation parameters -typedef struct AGSDX11ExtensionParams +typedef struct AGSDX11ExtensionParams_511 { unsigned int uavSlot; ///< The UAV slot reserved for intrinsic support. This must match the slot defined in the HLSL, i.e. #define AmdDxExtShaderIntrinsicsUAVSlot. /// The default slot is 7, but the caller is free to use an alternative slot. @@ -542,30 +649,80 @@ typedef struct AGSDX11ExtensionParams UINT appVersion; ///< Application version const WCHAR* pEngineName; ///< Engine name UINT engineVersion; ///< Engine version +} AGSDX11ExtensionParams_511; + +typedef struct AGSDX11ExtensionParams_520 +{ + const WCHAR* pAppName; ///< Application name + const WCHAR* pEngineName; ///< Engine name + unsigned int appVersion; ///< Application version + unsigned int engineVersion; ///< Engine version + unsigned int numBreadcrumbMarkers; ///< The number of breadcrumb markers to allocate. Each marker is a uint64 (ie 8 bytes). If 0, the system is disabled. + unsigned int uavSlot; ///< The UAV slot reserved for intrinsic support. This must match the slot defined in the HLSL, i.e. "#define AmdDxExtShaderIntrinsicsUAVSlot". + /// The default slot is 7, but the caller is free to use an alternative slot. + /// If 0 is specified, then the default of 7 will be used. + AGSCrossfireMode crossfireMode; ///< Desired Crossfire mode +} AGSDX11ExtensionParams_520; + +typedef union AGSDX11ExtensionParams +{ + AGSDX11ExtensionParams_511 agsDX11ExtensionParams511; + AGSDX11ExtensionParams_520 agsDX11ExtensionParams520; } AGSDX11ExtensionParams; /// The struct to hold all the returned parameters from the device creation call -typedef struct AGSDX11ReturnedParams +typedef struct AGSDX11ReturnedParams_511 { ID3D11Device* pDevice; ///< The newly created device D3D_FEATURE_LEVEL FeatureLevel; ///< The feature level supported by the newly created device ID3D11DeviceContext* pImmediateContext; ///< The newly created immediate device context IDXGISwapChain* pSwapChain; ///< The newly created swap chain. This is only created if a valid pSwapChainDesc is supplied in AGSDX11DeviceCreationParams. This is not supported on the WACK compliant version unsigned int extensionsSupported; ///< Bit mask that \ref agsDriverExtensionsDX11_CreateDevice will fill in to indicate which extensions are supported. See AGSDriverExtensionDX11 +} AGSDX11ReturnedParams_511; + +typedef struct AGSDX11ReturnedParams_520 +{ + ID3D11Device* pDevice; ///< The newly created device + ID3D11DeviceContext* pImmediateContext; ///< The newly created immediate device context + IDXGISwapChain* pSwapChain; ///< The newly created swap chain. This is only created if a valid pSwapChainDesc is supplied in AGSDX11DeviceCreationParams. This is not supported on the WACK compliant version + D3D_FEATURE_LEVEL FeatureLevel; ///< The feature level supported by the newly created device + unsigned int extensionsSupported; ///< Bit mask that \ref agsDriverExtensionsDX11_CreateDevice will fill in to indicate which extensions are supported. See \ref AGSDriverExtensionDX11 + unsigned int crossfireGPUCount; ///< The number of GPUs that are active for this app + void* breadcrumbBuffer; ///< The CPU buffer returned if the initialization of the breadcrumb was successful. +} AGSDX11ReturnedParams_520; + +typedef union AGSDX11ReturnedParams +{ + AGSDX11ReturnedParams_511 agsDX11ReturnedParams511; + AGSDX11ReturnedParams_520 agsDX11ReturnedParams520; } AGSDX11ReturnedParams; /// /// Function used to create a D3D11 device with additional AMD-specific initialization parameters. /// /// When using the HLSL shader extensions please note: -/// * The shader compiler should not use the D3DCOMPILE_SKIP_OPTIMIZATION option, otherwise it will not work. +/// * The shader compiler should not use the D3DCOMPILE_SKIP_OPTIMIZATION (/Od) option, otherwise it will not work. +/// * The shader compiler needs D3DCOMPILE_ENABLE_STRICTNESS (/Ges) enabled. /// /// \param [in] context Pointer to a context. This is generated by \ref agsInit /// \param [in] creationParams Pointer to the struct to specify the existing DX11 device creation parameters. /// \param [in] extensionParams Optional pointer to the struct to specify DX11 additional device creation parameters. /// \param [out] returnedParams Pointer to struct to hold all the returned parameters from the call. /// -AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_CreateDevice( AGSContext* context, AGSDX11DeviceCreationParams* creationParams, AGSDX11ExtensionParams* extensionParams, AGSDX11ReturnedParams* returnedParams ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_CreateDevice( AGSContext* context, const AGSDX11DeviceCreationParams* creationParams, const AGSDX11ExtensionParams* extensionParams, AGSDX11ReturnedParams* returnedParams ); + +/// +/// Function to destroy the D3D11 device and its immediate context. +/// This call will also cleanup any AMD-specific driver extensions for D3D11. +/// +/// \param [in] context Pointer to a context. +/// \param [in] device Pointer to the D3D11 device. +/// \param [out] deviceReferences Optional pointer to an unsigned int that will be set to the value returned from device->Release(). +/// \param [in] immediateContext Pointer to the D3D11 immediate device context. +/// \param [out] immediateContextReferences Optional pointer to an unsigned int that will be set to the value returned from immediateContext->Release(). +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_DestroyDevice_520( AGSContext* context, ID3D11Device* device, unsigned int* deviceReferences, ID3D11DeviceContext* immediateContext, unsigned int* immediateContextReferences ); + /// /// Function to destroy the D3D11 device. @@ -575,7 +732,7 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_CreateDevice( AGSContext* cont /// \param [in] device Pointer to the D3D11 device. /// \param [out] references Optional pointer to an unsigned int that will be set to the value returned from device->Release(). /// -AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_DestroyDevice( AGSContext* context, ID3D11Device* device, unsigned int* references ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_DestroyDevice_511( AGSContext* context, ID3D11Device* device, unsigned int* references ); /// @} @@ -610,6 +767,211 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_DestroyDevice( AGSContext* con /// /// @} +/// \defgroup breadcrumbs Breadcrumb API +/// API for writing top-of-pipe and bottom-of-pipe markers to help track down GPU hangs. +/// +/// The API is available if the \ref AGS_DX11_EXTENSION_BREADCRUMB_MARKERS is present in \ref AGSDX11ReturnedParams::extensionsSupported. +/// +/// To use the API, a non zero value needs to be specificed in \ref AGSDX11ExtensionParams::numBreadcrumbMarkers. This enables the API (if available) and allocates a system memory buffer +/// which is returned to the user in \ref AGSDX11ReturnedParams::breadcrumbBuffer. +/// +/// The user can now write markers before and after draw calls using \ref agsDriverExtensionsDX11_WriteBreadcrumb. +/// +/// \section background Background +/// +/// A top-of-pipe (TOP) command is scheduled for execution as soon as the command processor (CP) reaches the command. +/// A bottom-of-pipe (BOP) command is scheduled for execution once the previous rendering commands (draw and dispatch) finish execution. +/// TOP and BOP commands do not block CP. i.e. the CP schedules the command for execution then proceeds to the next command without waiting. +/// To effectively use TOP and BOP commands, it is important to understand how they interact with rendering commands: +/// +/// When the CP encounters a rendering command it queues it for execution and moves to the next command. The queued rendering commands are issued in order. +/// There can be multiple rendering commands running in parallel. When a rendering command is issued we say it is at the top of the pipe. When a rendering command +/// finishes execution we say it has reached the bottom of the pipe. +/// +/// A BOP command remains in a waiting queue and is executed once prior rendering commands finish. The queue of BOP commands is limited to 64 entries in GCN generation 1, 2, 3, 4 and 5. +/// If the 64 limit is reached the CP will stop queueing BOP commands and also rendering commands. Developers should limit the number of BOP commands that write markers to avoid contention. +/// In general, developers should limit both TOP and BOP commands to avoid stalling the CP. +/// +/// \subsection eg1 Example 1: +/// +/// \code{.cpp} +/// // Start of a command buffer +/// WriteMarker(TopOfPipe, 1) +/// WriteMarker(BottomOfPipe, 2) +/// WriteMarker(BottomOfPipe, 3) +/// DrawX +/// WriteMarker(BottomOfPipe, 4) +/// WriteMarker(BottomOfPipe, 5) +/// WriteMarker(TopOfPipe, 6) +/// // End of command buffer +/// \endcode +/// +/// In the above example, the CP writes markers 1, 2 and 3 without waiting: +/// Marker 1 is TOP so it's independent from other commands +/// There's no wait for marker 2 and 3 because there are no draws preceding the BOP commands +/// Marker 4 is only written once DrawX finishes execution +/// Marker 5 doesn't wait for additional draws so it is written right after marker 4 +/// Marker 6 can be written as soon as the CP reaches the command. For instance, it is very possible that CP writes marker 6 while DrawX +/// is running and therefore marker 6 gets written before markers 4 and 5 +/// +/// \subsection eg2 Example 2: +/// +/// \code{.cpp} +/// WriteMarker(TopOfPipe, 1) +/// DrawX +/// WriteMarker(BottomOfPipe, 2) +/// WriteMarker(TopOfPipe, 3) +/// DrawY +/// WriteMarker(BottomOfPipe, 4) +/// \endcode +/// +/// In this example marker 1 is written before the start of DrawX +/// Marker 2 is written once DrawX finishes execution +/// Similarly marker 3 is written before the start of DrawY +/// Marker 4 is written once DrawY finishes execution +/// In case of a GPU hang, if markers 1 and 3 are written but markers 2 and 4 are missing we can conclude that: +/// The CP has reached both DrawX and DrawY commands since marker 1 and 3 are present +/// The fact that marker 2 and 4 are missing means that either DrawX is hanging while DrawY is at the top of the pipe or both DrawX and DrawY +/// started and both are simultaneously hanging +/// +/// \subsection eg3 Example 3: +/// +/// \code{.cpp} +/// // Start of a command buffer +/// WriteMarker(BottomOfPipe, 1) +/// DrawX +/// WriteMarker(BottomOfPipe, 2) +/// DrawY +/// WriteMarker(BottomOfPipe, 3) +/// DrawZ +/// WriteMarker(BottomOfPipe, 4) +/// // End of command buffer +/// \endcode +/// +/// In this example marker 1 is written before the start of DrawX +/// Marker 2 is written once DrawX finishes +/// Marker 3 is written once DrawY finishes +/// Marker 4 is written once DrawZ finishes +/// If the GPU hangs and only marker 1 is written we can conclude that the hang is happening in either DrawX, DrawY or DrawZ +/// If the GPU hangs and only marker 1 and 2 are written we can conclude that the hang is happening in DrawY or DrawZ +/// If the GPU hangs and only marker 4 is missing we can conclude that the hang is happening in DrawZ +/// +/// \subsection eg4 Example 4: +/// +/// \code{.cpp} +/// Start of a command buffer +/// WriteMarker(TopOfPipe, 1) +/// DrawX +/// WriteMarker(TopOfPipe, 2) +/// DrawY +/// WriteMarker(TopOfPipe, 3) +/// DrawZ +/// // End of command buffer +/// \endcode +/// +/// In this example, in case the GPU hangs and only marker 1 is written we can conclude that the hang is happening in DrawX +/// In case the GPU hangs and only marker 1 and 2 are written we can conclude that the hang is happening in DrawX or DrawY +/// In case the GPU hangs and all 3 markers are written we can conclude that the hang is happening in any of DrawX, DrawY or DrawZ +/// +/// \subsection eg5 Example 5: +/// +/// \code{.cpp} +/// DrawX +/// WriteMarker(TopOfPipe, 1) +/// WriteMarker(BottomOfPipe, 2) +/// DrawY +/// WriteMarker(TopOfPipe, 3) +/// WriteMarker(BottomOfPipe, 4) +/// \endcode +/// +/// Marker 1 is written right after DrawX is queued for execution. +/// Marker 2 is only written once DrawX finishes execution. +/// Marker 3 is written right after DrawY is queued for execution. +/// Marker 4 is only written once DrawY finishes execution +/// If marker 1 is written we would know that the CP has reached the command DrawX (DrawX at the top of the pipe). +/// If marker 2 is written we can say that DrawX has finished execution (DrawX at the bottom of the pipe). +/// In case the GPU hangs and only marker 1 and 3 are written we can conclude that the hang is happening in DrawX or DrawY +/// In case the GPU hangs and only marker 1 is written we can conclude that the hang is happening in DrawX +/// In case the GPU hangs and only marker 4 is missing we can conclude that the hang is happening in DrawY +/// +/// \section data Retrieving GPU Data +/// +/// In the event of a GPU hang, the user can inspect the system memory buffer to determine which draw has caused the hang. +/// For example: +/// \code{.cpp} +/// // Force the work to be flushed to prevent CPU ahead of GPU +/// g_pImmediateContext->Flush(); +/// +/// // Present the information rendered to the back buffer to the front buffer (the screen) +/// HRESULT hr = g_pSwapChain->Present( 0, 0 ); +/// +/// // Read the marker data buffer once detect device lost +/// if ( hr != S_OK ) +/// { +/// for (UINT i = 0; i < g_NumMarkerWritten; i++) +/// { +/// UINT64* pTempData; +/// pTempData = static_cast(pMarkerBuffer); +/// +/// // Write the marker data to file +/// ofs << i << "\r\n"; +/// ofs << std::hex << *(pTempData + i * 2) << "\r\n"; +/// ofs << std::hex << *(pTempData + (i * 2 + 1)) << "\r\n"; +/// +/// WCHAR s1[256]; +/// setlocale(LC_NUMERIC, "en_US.iso88591"); +/// +/// // Output the marker data to console +/// swprintf(s1, 256, L" The Draw count is %d; The Top maker is % 016llX and the Bottom marker is % 016llX \r\n", i, *(pTempData + i * 2), *(pTempData + (i * 2 + 1))); +/// +/// OutputDebugStringW(s1); +/// } +/// } +/// \endcode +/// +/// The console output would resemble something like: +/// \code{.cpp} +/// D3D11: Removing Device. +/// D3D11 ERROR: ID3D11Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_DEVICE_HUNG: The Device took an unreasonable amount of time to execute its commands, or the hardware crashed/hung. As a result, the TDR (Timeout Detection and Recovery) mechanism has been triggered. The current Device Context was executing commands when the hang occurred. The application may want to respawn and fallback to less aggressive use of the display hardware). [ EXECUTION ERROR #378: DEVICE_REMOVAL_PROCESS_AT_FAULT] +/// The Draw count is 0; The Top maker is 00000000DEADCAFE and the Bottom marker is 00000000DEADBEEF +/// The Draw count is 1; The Top maker is 00000000DEADCAFE and the Bottom marker is 00000000DEADBEEF +/// The Draw count is 2; The Top maker is 00000000DEADCAFE and the Bottom marker is 00000000DEADBEEF +/// The Draw count is 3; The Top maker is 00000000DEADCAFE and the Bottom marker is 00000000DEADBEEF +/// The Draw count is 4; The Top maker is 00000000DEADCAFE and the Bottom marker is 00000000DEADBEEF +/// The Draw count is 5; The Top maker is CDCDCDCDCDCDCDCD and the Bottom marker is CDCDCDCDCDCDCDCD +/// The Draw count is 6; The Top maker is CDCDCDCDCDCDCDCD and the Bottom marker is CDCDCDCDCDCDCDCD +/// The Draw count is 7; The Top maker is CDCDCDCDCDCDCDCD and the Bottom marker is CDCDCDCDCDCDCDCD +/// \endcode +/// +/// @{ + +/// The breadcrumb marker struct used by \ref agsDriverExtensionsDX11_WriteBreadcrumb +typedef struct AGSBreadcrumbMarker +{ + unsigned long long markerData; ///< The user data to write. + enum + { + TopOfPipe = 0, ///< Top-of-pipe marker + BottomOfPipe = 1 ///< Bottom-of-pipe marker + } type; ///< Whether this marker is top or bottom of pipe. + unsigned int index; ///< The index of the marker. This should be less than the value specified in \ref AGSDX11ExtensionParams::numBreadcrumbMarkers +} AGSBreadcrumbMarker; + +/// +/// Function to write a breadcrumb marker. +/// +/// This method inserts a write marker operation in the GPU command stream. In the case where the GPU is hanging the write +/// command will never be reached and the marker will never get written to memory. +/// +/// In order to use this function, \ref AGSDX11ExtensionParams::numBreadcrumbMarkers must be set to a non zero value. +/// +/// \param [in] context Pointer to a context. +/// \param [in] marker Pointer to a marker. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_WriteBreadcrumb( AGSContext* context, const AGSBreadcrumbMarker* marker ); + +/// @} + /// \defgroup dx11misc Misc Extensions /// API for depth bounds test, UAV overlap and prim topologies /// @{ @@ -618,34 +980,37 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_DestroyDevice( AGSContext* con /// Function used to set the primitive topology. If you are using any of the extended topology types, then this function should /// be called to set ALL topology types. /// -/// The Quad List extension is a convenient way to submit quads without using an index buffer. Note that this still submits two triangles at the driver level. +/// The Quad List extension is a convenient way to submit quads without using an index buffer. Note that this still submits two triangles at the driver level. /// In order to use this function, AGS must already be initialized and agsDriverExtensionsDX11_Init must have been called successfully. /// -/// The Screen Rect extension, which is only available on GCN hardware, allows the user to pass in three of the four corners of a rectangle. -/// The hardware then uses the bounding box of the vertices to rasterize the rectangle primitive (i.e. as a rectangle rather than two triangles). +/// The Screen Rect extension, which is only available on GCN hardware, allows the user to pass in three of the four corners of a rectangle. +/// The hardware then uses the bounding box of the vertices to rasterize the rectangle primitive (i.e. as a rectangle rather than two triangles). /// \note Note that this will not return valid interpolated values, only valid SV_Position values. /// \note If either the Quad List or Screen Rect extension are used, then agsDriverExtensionsDX11_IASetPrimitiveTopology should be called in place of the native DirectX11 equivalent all the time. /// /// \param [in] context Pointer to a context. -/// \param [in] topology The topology to set on the D3D11 device. This can be either an AGS-defined topology such as AGS_PRIMITIVE_TOPOLOGY_QUAD_LIST +/// \param [in] topology The topology to set on the D3D11 device. This can be either an AGS-defined topology such as AGS_PRIMITIVE_TOPOLOGY_QUADLIST /// or a standard D3D-defined topology such as D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP. /// NB. the AGS-defined types will require casting to a D3D_PRIMITIVE_TOPOLOGY type. /// AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_IASetPrimitiveTopology( AGSContext* context, enum D3D_PRIMITIVE_TOPOLOGY topology ); /// -/// Function used indicate to the driver it can overlap the subsequent batch of back-to-back dispatches. +/// Function used indicate to the driver that it doesn't need to sync the UAVs bound for the subsequent set of back-to-back dispatches. /// When calling back-to-back draw calls or dispatch calls that write to the same UAV, the AMD DX11 driver will automatically insert a barrier to ensure there are no write after write (WAW) hazards. /// If the app can guarantee there is no overlap between the writes between these calls, then this extension will remove those barriers allowing the work to run in parallel on the GPU. /// /// Usage would be as follows: /// \code{.cpp} +/// m_device->Dispatch( ... ); // First call that writes to the UAV +/// /// // Disable automatic WAW syncs /// agsDriverExtensionsDX11_BeginUAVOverlap( m_agsContext ); /// -/// // Submit back-to-back dispatches that write to the same UAV -/// m_device->Dispatch( ... ); // First half of UAV -/// m_device->Dispatch( ... ); // Second half of UAV +/// // Submit other dispatches that write to the same UAV concurrently +/// m_device->Dispatch( ... ); +/// m_device->Dispatch( ... ); +/// m_device->Dispatch( ... ); /// /// // Reenable automatic WAW syncs /// agsDriverExtensionsDX11_EndUAVOverlap( m_agsContext ); @@ -713,6 +1078,8 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDepthBounds( AGSContext* co /// }; /// \endcode /// +/// Example usage can be seen in AMD's GeometryFX (https://github.com/GPUOpen-Effects/GeometryFX). In particular, in this file: https://github.com/GPUOpen-Effects/GeometryFX/blob/master/amd_geometryfx/src/AMD_GeometryFX_Filtering.cpp +/// /// @{ /// @@ -846,6 +1213,24 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetClipRects( AGSContext* cont /// API for explicit control over Crossfire /// @{ +/// The Crossfire API transfer types +typedef enum AGSAfrTransferType +{ + AGS_AFR_TRANSFER_DEFAULT = 0, ///< Default Crossfire driver resource tracking + AGS_AFR_TRANSFER_DISABLE = 1, ///< Turn off driver resource tracking + AGS_AFR_TRANSFER_1STEP_P2P = 2, ///< App controlled GPU to next GPU transfer + AGS_AFR_TRANSFER_2STEP_NO_BROADCAST = 3, ///< App controlled GPU to next GPU transfer using intermediate system memory + AGS_AFR_TRANSFER_2STEP_WITH_BROADCAST = 4, ///< App controlled GPU to all render GPUs transfer using intermediate system memory +} AGSAfrTransferType; + +/// The Crossfire API transfer engines +typedef enum AGSAfrTransferEngine +{ + AGS_AFR_TRANSFERENGINE_DEFAULT = 0, ///< Use default engine for Crossfire API transfers + AGS_AFR_TRANSFERENGINE_3D_ENGINE = 1, ///< Use 3D engine for Crossfire API transfers + AGS_AFR_TRANSFERENGINE_COPY_ENGINE = 2, ///< Use Copy engine for Crossfire API transfers +} AGSAfrTransferEngine; + /// /// Function to create a Direct3D11 resource with the specified AFR transfer type and specified transfer engine. /// @@ -916,9 +1301,9 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_NotifyResourceEndWrites( AGSCo AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_NotifyResourceBeginAllAccess( AGSContext* context, ID3D11Resource* resource ); /// -/// This is used for AGS_AFR_TRANSFER_1STEP_P2P to notify when it is safe to initiate a transfer. -/// This call in frame N-(NumGpus-1) allows a 1 step P2P in frame N to start. -/// This should be called after agsDriverExtensionsDX11_NotifyResourceEndWrites. +/// This is used for AGS_AFR_TRANSFER_1STEP_P2P to notify when it is safe to initiate a transfer. +/// This call in frame N-(NumGpus-1) allows a 1 step P2P in frame N to start. +/// This should be called after agsDriverExtensionsDX11_NotifyResourceEndWrites. /// /// \param [in] context Pointer to a context. /// \param [in] resource Pointer to the resource. diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index e339d7b7d2bc..5c8bcaf395b5 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -15,8 +15,29 @@ WINE_DEFAULT_DEBUG_CHANNEL(amd_ags); +enum amd_ags_version +{ + AMD_AGS_VERSION_5_1_1, + AMD_AGS_VERSION_5_2_0, + + AMD_AGS_VERSION_COUNT +}; + +struct +{ + int major; + int minor; + int patch; +} +static const amd_ags_versions[AMD_AGS_VERSION_COUNT] = +{ + {5, 1, 1}, + {5, 2, 0}, +}; + struct AGSContext { + enum amd_ags_version version; unsigned int device_count; AGSDeviceInfo *devices; VkPhysicalDeviceProperties *properties; @@ -88,6 +109,8 @@ static AGSReturnCode init_ags_context(AGSContext *context) AGSReturnCode ret; unsigned int i; + // TODO: version check + context->version = AMD_AGS_VERSION_5_1_1; context->device_count = 0; context->devices = NULL; context->properties = NULL; @@ -108,15 +131,32 @@ static AGSReturnCode init_ags_context(AGSContext *context) const VkPhysicalDeviceProperties *vk_properties = &context->properties[i]; AGSDeviceInfo *device = &context->devices[i]; - device->adapterString = vk_properties->deviceName; - device->vendorId = vk_properties->vendorID; - device->deviceId = vk_properties->deviceID; + switch (context->version) + { + case AMD_AGS_VERSION_5_1_1: + device->agsDeviceInfo511.adapterString = vk_properties->deviceName; + device->agsDeviceInfo511.vendorId = vk_properties->vendorID; + device->agsDeviceInfo511.deviceId = vk_properties->deviceID; + + if (device->agsDeviceInfo511.vendorId == 0x1002) + device->agsDeviceInfo511.architectureVersion = ArchitectureVersion_GCN; - if (device->vendorId == 0x1002) - device->architectureVersion = ArchitectureVersion_GCN; + if (!i) + device->agsDeviceInfo511.isPrimaryDevice = 1; + break; + case AMD_AGS_VERSION_5_2_0: + default: + device->agsDeviceInfo520.adapterString = vk_properties->deviceName; + device->agsDeviceInfo520.vendorId = vk_properties->vendorID; + device->agsDeviceInfo520.deviceId = vk_properties->deviceID; + + if (device->agsDeviceInfo520.vendorId == 0x1002) + device->agsDeviceInfo520.architectureVersion = ArchitectureVersion_GCN; - if (!i) - device->isPrimaryDevice = 1; + if (!i) + device->agsDeviceInfo520.isPrimaryDevice = 1; + break; + } } return AGS_SUCCESS; @@ -145,9 +185,9 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi } memset(gpu_info, 0, sizeof(*gpu_info)); - gpu_info->agsVersionMajor = AMD_AGS_VERSION_MAJOR; - gpu_info->agsVersionMinor = AMD_AGS_VERSION_MINOR; - gpu_info->agsVersionPatch = AMD_AGS_VERSION_PATCH; + gpu_info->agsVersionMajor = amd_ags_versions[object->version].major; + gpu_info->agsVersionMinor = amd_ags_versions[object->version].minor; + gpu_info->agsVersionPatch = amd_ags_versions[object->version].patch; gpu_info->driverVersion = "18.10.16-180516a-328911C-RadeonSoftwareAdrenalin"; gpu_info->radeonSoftwareVersion = "18.5.1"; gpu_info->numDevices = object->device_count; From e89ab2d82ce14a50c178faef06d42a88a6a11ddc Mon Sep 17 00:00:00 2001 From: Brendan Shanks Date: Wed, 17 Jun 2020 14:32:18 -0700 Subject: [PATCH 0446/2542] amd_ags_x64: Update to 5.2.1. --- dlls/amd_ags_x64/amd_ags.h | 14 ++++++++++---- dlls/amd_ags_x64/amd_ags_x64_main.c | 3 +++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index b647f912aa75..c39adb536783 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -33,6 +33,12 @@ /// Online documentation is publicly hosted here: http://gpuopen-librariesandsdks.github.io/ags/ /// \endinternal /// +/// What's new in AGS 5.2.1 since version 5.2.0 +/// --------------------------------------- +/// * Fix for crash when using Eyefinity +/// * Fix for DX12 app registration in the UWP version +/// +/// /// What's new in AGS 5.2.0 since version 5.1 /// --------------------------------------- /// AGS 5.2 includes the following updates: @@ -98,7 +104,7 @@ #define AMD_AGS_VERSION_MAJOR 5 ///< AGS major version #define AMD_AGS_VERSION_MINOR 2 ///< AGS minor version -#define AMD_AGS_VERSION_PATCH 0 ///< AGS patch version +#define AMD_AGS_VERSION_PATCH 1 ///< AGS patch version #ifdef __cplusplus extern "C" { @@ -622,7 +628,7 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_SetMarker( AGSContext* context /// The different modes to control Crossfire behavior. typedef enum AGSCrossfireMode { - AGS_CROSSFIRE_MODE_DRIVER_AFR = 0, ///< Use the default driver-based AFR rendering + AGS_CROSSFIRE_MODE_DRIVER_AFR = 0, ///< Use the default driver-based AFR rendering. If this mode is specified, do NOT use the agsDriverExtensionsDX11_Create*() APIs to create resources AGS_CROSSFIRE_MODE_EXPLICIT_AFR, ///< Use the AGS Crossfire API functions to perform explicit AFR rendering without requiring a CF driver profile AGS_CROSSFIRE_MODE_DISABLE ///< Completely disable AFR rendering } AGSCrossfireMode; @@ -739,7 +745,7 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_DestroyDevice_511( AGSContext* /// \defgroup dx11appreg App Registration /// @{ -/// This extension allows an apllication to voluntarily register itself with the driver, providing a more robust app detection solution and avoid the issue of the driver +/// This extension allows an apllication to voluntarily register itself with the driver, providing a more robust app detection solution and avoid the issue of the driver /// relying on exe names to match the app to a driver profile. /// This feature is supported in Radeon Software Version 17.9.2 onwards. /// Rules: @@ -1151,7 +1157,7 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetMaxAsyncCompileThreadCount( /// /// This method can be used to determine the total number of asynchronous shader compile jobs that are either -/// queued for waiting for compilation or being compiled by the driver’s asynchronous compilation threads. +/// queued for waiting for compilation or being compiled by the driverÂ’s asynchronous compilation threads. /// This method can be called at any during the lifetime of the driver. /// /// \param [in] context Pointer to a context. diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 5c8bcaf395b5..e8b55bf9d428 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -19,6 +19,7 @@ enum amd_ags_version { AMD_AGS_VERSION_5_1_1, AMD_AGS_VERSION_5_2_0, + AMD_AGS_VERSION_5_2_1, AMD_AGS_VERSION_COUNT }; @@ -33,6 +34,7 @@ static const amd_ags_versions[AMD_AGS_VERSION_COUNT] = { {5, 1, 1}, {5, 2, 0}, + {5, 2, 1}, }; struct AGSContext @@ -145,6 +147,7 @@ static AGSReturnCode init_ags_context(AGSContext *context) device->agsDeviceInfo511.isPrimaryDevice = 1; break; case AMD_AGS_VERSION_5_2_0: + case AMD_AGS_VERSION_5_2_1: default: device->agsDeviceInfo520.adapterString = vk_properties->deviceName; device->agsDeviceInfo520.vendorId = vk_properties->vendorID; From 14d9b56c31132502dc94bea18b808f2ff6ece11c Mon Sep 17 00:00:00 2001 From: Brendan Shanks Date: Wed, 17 Jun 2020 14:44:25 -0700 Subject: [PATCH 0447/2542] amd_ags_x64: Update to 5.3.0. --- dlls/amd_ags_x64/amd_ags.h | 98 +++++++++++++++++++++++------ dlls/amd_ags_x64/amd_ags_x64_main.c | 3 + 2 files changed, 82 insertions(+), 19 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index c39adb536783..58f7bb84e372 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -33,6 +33,14 @@ /// Online documentation is publicly hosted here: http://gpuopen-librariesandsdks.github.io/ags/ /// \endinternal /// +/// --------------------------------------- +/// What's new in AGS 5.3 since version 5.2 +/// --------------------------------------- +/// AGS 5.3 includes the following updates: +/// * DX11 deferred context support for Multi Draw Indirect and UAV Overlap extensions. +/// * A Radeon Software Version helper to determine whether the installed driver meets your game's minimum driver version requirements. +/// * Freesync2 Gamma 2.2 mode which uses a 1010102 swapchain and can be considered as an alternative to using the 64 bit swapchain required for Freesync2 scRGB. +/// /// What's new in AGS 5.2.1 since version 5.2.0 /// --------------------------------------- /// * Fix for crash when using Eyefinity @@ -103,8 +111,8 @@ #define AMD_AGS_H #define AMD_AGS_VERSION_MAJOR 5 ///< AGS major version -#define AMD_AGS_VERSION_MINOR 2 ///< AGS minor version -#define AMD_AGS_VERSION_PATCH 1 ///< AGS patch version +#define AMD_AGS_VERSION_MINOR 3 ///< AGS minor version +#define AMD_AGS_VERSION_PATCH 0 ///< AGS patch version #ifdef __cplusplus extern "C" { @@ -112,6 +120,9 @@ extern "C" { #define AMD_AGS_API WINAPI +#define AGS_MAKE_VERSION( major, minor, patch ) ( ( major << 22 ) | ( minor << 12 ) | patch ) ///< Macro to create the app and engine versions for the fields in \ref AGSDX12ExtensionParams and \ref AGSDX11ExtensionParams and the Radeon Software Version +#define AGS_UNSPECIFIED_VERSION 0xFFFFAD00 ///< Use this to specify no version + // Forward declaration of D3D11 types struct IDXGIAdapter; enum D3D_DRIVER_TYPE; @@ -147,6 +158,7 @@ typedef enum AGSReturnCode AGS_ERROR_LEGACY_DRIVER, ///< Returned if a feature is not present in the installed driver AGS_EXTENSION_NOT_SUPPORTED, ///< Returned if the driver does not support the requested driver extension AGS_ADL_FAILURE, ///< Failure in ADL (the AMD Display Library) + AGS_DX_FAILURE ///< Failure from DirectX runtime } AGSReturnCode; /// The DirectX11 extension support bits @@ -173,6 +185,9 @@ typedef enum AGSDriverExtensionDX11 AGS_DX11_EXTENSION_MULTIVIEW = 1 << 18, ///< Supported in Radeon Software Version 16.12.1 onwards. AGS_DX11_EXTENSION_APP_REGISTRATION = 1 << 19, ///< Supported in Radeon Software Version 17.9.1 onwards. AGS_DX11_EXTENSION_BREADCRUMB_MARKERS = 1 << 20, ///< Supported in Radeon Software Version 17.11.1 onwards. + AGS_DX11_EXTENSION_MDI_DEFERRED_CONTEXTS = 1 << 21, ///< Supported in Radeon Software Version XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX onwards. + AGS_DX11_EXTENSION_UAV_OVERLAP_DEFERRED_CONTEXTS = 1 << 22, ///< Supported in Radeon Software Version XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX onwards. + AGS_DX11_EXTENSION_DEPTH_BOUNDS_DEFERRED_CONTEXTS = 1 << 23 ///< Supported in Radeon Software Version XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX onwards. } AGSDriverExtensionDX11; /// The DirectX12 extension support bits @@ -417,6 +432,8 @@ typedef struct AGSDisplaySettings Mode_HDR10_PQ, ///< HDR10 PQ encoding, requiring a 1010102 UNORM swapchain and PQ encoding in the output shader. Mode_HDR10_scRGB, ///< HDR10 scRGB, requiring an FP16 swapchain. Values of 1.0 == 80 nits, 125.0 == 10000 nits. Mode_Freesync2_scRGB, ///< Freesync2 scRGB, requiring an FP16 swapchain. 1.0 == 80 nits. Tonemap your scene to the range of 0.0 to AGSDisplayInfo::maxLuminance. + // Mode_Freesync2_Gamma22 ADDED IN 5.3.0 + Mode_Freesync2_Gamma22, ///< Freesync2 Gamma 2.2, requiring a 1010102 UNORM swapchain. The output needs to be encoded to gamma 2.2. Mode_DolbyVision ///< Dolby Vision, requiring an 8888 UNORM swapchain } mode; ///< The display mode to set the display into @@ -442,6 +459,24 @@ typedef struct AGSDisplaySettings int flags; ///< Bitfield of ::AGSDisplaySettingsFlags } AGSDisplaySettings; +/// The result returned from \ref agsCheckDriverVersion +typedef enum AGSDriverVersionResult +{ + AGS_SOFTWAREVERSIONCHECK_OK, ///< The reported Radeon Software Version is newer or the same as the required version + AGS_SOFTWAREVERSIONCHECK_OLDER, ///< The reported Radeon Software Version is older than the required version + AGS_SOFTWAREVERSIONCHECK_UNDEFINED ///< The check could not determine as result. This could be because it is a private or custom driver or just invalid arguments. +} AGSDriverVersionResult; + +/// +/// Helper function to check the installed software version against the required software version. +/// +/// \param [in] radeonSoftwareVersionReported The Radeon Software Version returned from \ref AGSGPUInfo::radeonSoftwareVersion. +/// \param [in] radeonSoftwareVersionRequired The Radeon Software Version to check against. This is specificed using \ref AGS_MAKE_VERSION. +/// \return The result of the check. +/// +AMD_AGS_API AGSDriverVersionResult agsCheckDriverVersion( const char* radeonSoftwareVersionReported, unsigned int radeonSoftwareVersionRequired ); + + /// /// Function used to initialize the AGS library. /// Must be called prior to any of the subsequent AGS API calls. @@ -494,7 +529,7 @@ AMD_AGS_API AGSReturnCode agsSetDisplayMode( AGSContext* context, int deviceInde /// DirectX12 driver extensions /// @{ -/// \defgroup dx12init Device creation and cleanup +/// \defgroup dx12init Device and device object creation and cleanup /// It is now mandatory to call \ref agsDriverExtensionsDX12_CreateDevice when creating a device if the user wants to access any future DX12 AMD extensions. /// The corresponding \ref agsDriverExtensionsDX12_DestroyDevice call must be called to release the device and free up the internal resources allocated by the create call. /// @{ @@ -507,9 +542,6 @@ typedef struct AGSDX12DeviceCreationParams D3D_FEATURE_LEVEL FeatureLevel; ///< The minimum feature level to create the device with. } AGSDX12DeviceCreationParams; -#define AGS_MAKE_VERSION( major, minor, patch ) ( ( major << 22 ) | ( minor << 12 ) | patch ) ///< Macro to create the app and engine versions for the fields in \ref AGSDX12ExtensionParams and \ref AGSDX11ExtensionParams -#define AGS_UNSPECIFIED_VERSION 0xFFFFAD00 ///< Use this to specify no version - /// The struct to specify DX12 additional device creation parameters typedef struct AGSDX12ExtensionParams { @@ -628,7 +660,7 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_SetMarker( AGSContext* context /// The different modes to control Crossfire behavior. typedef enum AGSCrossfireMode { - AGS_CROSSFIRE_MODE_DRIVER_AFR = 0, ///< Use the default driver-based AFR rendering. If this mode is specified, do NOT use the agsDriverExtensionsDX11_Create*() APIs to create resources + AGS_CROSSFIRE_MODE_DRIVER_AFR = 0, ///< Use the default driver-based AFR rendering. If this mode is specified, do NOT use the agsDriverExtensionsDX11_Create*() APIs to create resources AGS_CROSSFIRE_MODE_EXPLICIT_AFR, ///< Use the AGS Crossfire API functions to perform explicit AFR rendering without requiring a CF driver profile AGS_CROSSFIRE_MODE_DISABLE ///< Completely disable AFR rendering } AGSCrossfireMode; @@ -978,8 +1010,8 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_WriteBreadcrumb( AGSContext* c /// @} -/// \defgroup dx11misc Misc Extensions -/// API for depth bounds test, UAV overlap and prim topologies +/// \defgroup dx11Topology Extended Topology +/// API for primitive topologies /// @{ /// @@ -1001,6 +1033,12 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_WriteBreadcrumb( AGSContext* c /// AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_IASetPrimitiveTopology( AGSContext* context, enum D3D_PRIMITIVE_TOPOLOGY topology ); +/// @} + +/// \defgroup dx11UAVOverlap UAV Overlap +/// API for enabling overlapping UAV writes +/// @{ + /// /// Function used indicate to the driver that it doesn't need to sync the UAVs bound for the subsequent set of back-to-back dispatches. /// When calling back-to-back draw calls or dispatch calls that write to the same UAV, the AMD DX11 driver will automatically insert a barrier to ensure there are no write after write (WAW) hazards. @@ -1023,25 +1061,39 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_IASetPrimitiveTopology( AGSCon /// \endcode /// /// \param [in] context Pointer to a context. +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. +/// with the AGS_DX11_EXTENSION_DEFERRED_CONTEXTS bit. /// -AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_BeginUAVOverlap( AGSContext* context ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_BeginUAVOverlap_520( AGSContext* context ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_BeginUAVOverlap( AGSContext* context, ID3D11DeviceContext* dxContext ); /// /// Function used indicate to the driver it can no longer overlap the batch of back-to-back dispatches that has been submitted. /// /// \param [in] context Pointer to a context. +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. +/// with the AGS_DX11_EXTENSION_DEFERRED_CONTEXTS bit. /// -AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_EndUAVOverlap( AGSContext* context ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_EndUAVOverlap_520( AGSContext* context ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_EndUAVOverlap( AGSContext* context, ID3D11DeviceContext* dxContext ); + +/// @} + +/// \defgroup dx11DepthBoundsTest Depth Bounds Test +/// API for enabling depth bounds testing +/// @{ /// /// Function used to set the depth bounds test extension /// -/// \param [in] context Pointer to a context. +/// \param [in] context Pointer to a context +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. /// \param [in] enabled Whether to enable or disable the depth bounds testing. If disabled, the next two args are ignored. /// \param [in] minDepth The near depth range to clip against. /// \param [in] maxDepth The far depth range to clip against. /// -AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDepthBounds( AGSContext* context, bool enabled, float minDepth, float maxDepth ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDepthBounds_520( AGSContext* context, bool enabled, float minDepth, float maxDepth ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDepthBounds( AGSContext* context, ID3D11DeviceContext* dxContext, bool enabled, float minDepth, float maxDepth ); /// @} @@ -1054,12 +1106,12 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDepthBounds( AGSContext* co /// \code{.cpp} /// // Submit n batches of DrawIndirect calls /// for ( int i = 0; i < n; i++ ) -/// DrawIndexedInstancedIndirect( buffer, i * sizeof( cmd ) ); +/// deviceContext->DrawIndexedInstancedIndirect( buffer, i * sizeof( cmd ) ); /// \endcode /// To be replaced by the following call: /// \code{.cpp} /// // Submit all n batches in one call -/// agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect( m_agsContext, n, buffer, 0, sizeof( cmd ) ); +/// agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect( m_agsContext, deviceContext, n, buffer, 0, sizeof( cmd ) ); /// \endcode /// /// The buffer used for the indirect args must be of the following formats: @@ -1092,47 +1144,55 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDepthBounds( AGSContext* co /// Function used to submit a batch of draws via MultiDrawIndirect /// /// \param [in] context Pointer to a context. +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. /// \param [in] drawCount The number of draws. /// \param [in] pBufferForArgs The args buffer. /// \param [in] alignedByteOffsetForArgs The offset into the args buffer. /// \param [in] byteStrideForArgs The per element stride of the args buffer. /// -AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawInstancedIndirect( AGSContext* context, unsigned int drawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawInstancedIndirect_520( AGSContext* context, unsigned int drawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawInstancedIndirect( AGSContext* context, ID3D11DeviceContext* dxContext, unsigned int drawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); /// /// Function used to submit a batch of draws via MultiDrawIndirect /// /// \param [in] context Pointer to a context. +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. /// \param [in] drawCount The number of draws. /// \param [in] pBufferForArgs The args buffer. /// \param [in] alignedByteOffsetForArgs The offset into the args buffer. /// \param [in] byteStrideForArgs The per element stride of the args buffer. /// -AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect( AGSContext* context, unsigned int drawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect_520( AGSContext* context, unsigned int drawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect( AGSContext* context, ID3D11DeviceContext* dxContext, unsigned int drawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); /// /// Function used to submit a batch of draws via MultiDrawIndirect /// /// \param [in] context Pointer to a context. +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. /// \param [in] pBufferForDrawCount The draw count buffer. /// \param [in] alignedByteOffsetForDrawCount The offset into the draw count buffer. /// \param [in] pBufferForArgs The args buffer. /// \param [in] alignedByteOffsetForArgs The offset into the args buffer. /// \param [in] byteStrideForArgs The per element stride of the args buffer. /// -AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect( AGSContext* context, ID3D11Buffer* pBufferForDrawCount, unsigned int alignedByteOffsetForDrawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect_520( AGSContext* context, ID3D11Buffer* pBufferForDrawCount, unsigned int alignedByteOffsetForDrawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect( AGSContext* context, ID3D11DeviceContext* dxContext, ID3D11Buffer* pBufferForDrawCount, unsigned int alignedByteOffsetForDrawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); /// /// Function used to submit a batch of draws via MultiDrawIndirect /// /// \param [in] context Pointer to a context. +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. /// \param [in] pBufferForDrawCount The draw count buffer. /// \param [in] alignedByteOffsetForDrawCount The offset into the draw count buffer. /// \param [in] pBufferForArgs The args buffer. /// \param [in] alignedByteOffsetForArgs The offset into the args buffer. /// \param [in] byteStrideForArgs The per element stride of the args buffer. /// -AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect( AGSContext* context, ID3D11Buffer* pBufferForDrawCount, unsigned int alignedByteOffsetForDrawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect_520( AGSContext* context, ID3D11Buffer* pBufferForDrawCount, unsigned int alignedByteOffsetForDrawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect( AGSContext* context, ID3D11DeviceContext* dxContext, ID3D11Buffer* pBufferForDrawCount, unsigned int alignedByteOffsetForDrawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); /// @} diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index e8b55bf9d428..b3cf309da413 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -20,6 +20,7 @@ enum amd_ags_version AMD_AGS_VERSION_5_1_1, AMD_AGS_VERSION_5_2_0, AMD_AGS_VERSION_5_2_1, + AMD_AGS_VERSION_5_3_0, AMD_AGS_VERSION_COUNT }; @@ -35,6 +36,7 @@ static const amd_ags_versions[AMD_AGS_VERSION_COUNT] = {5, 1, 1}, {5, 2, 0}, {5, 2, 1}, + {5, 3, 0}, }; struct AGSContext @@ -148,6 +150,7 @@ static AGSReturnCode init_ags_context(AGSContext *context) break; case AMD_AGS_VERSION_5_2_0: case AMD_AGS_VERSION_5_2_1: + case AMD_AGS_VERSION_5_3_0: default: device->agsDeviceInfo520.adapterString = vk_properties->deviceName; device->agsDeviceInfo520.vendorId = vk_properties->vendorID; From 07edd05296a75e48876e1c0a5db276a3d5f3be50 Mon Sep 17 00:00:00 2001 From: Brendan Shanks Date: Wed, 17 Jun 2020 15:03:02 -0700 Subject: [PATCH 0448/2542] amd_ags_x64: Update to 5.4.0. --- dlls/amd_ags_x64/amd_ags.h | 92 ++++++++++++++++++++++++++--- dlls/amd_ags_x64/amd_ags_x64_main.c | 15 ++++- 2 files changed, 99 insertions(+), 8 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index 58f7bb84e372..c615ba4c2030 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -34,6 +34,14 @@ /// \endinternal /// /// --------------------------------------- +/// What's new in AGS 5.4 since version 5.3 +/// --------------------------------------- +/// AGS 5.4 includes the following updates: +/// * A more detailed description of the GPU architecture, now including RDNA GPUs. +/// * Navi 10, Navi 14 and Radeon 7 core and memory speeds returned. +/// * Draw index and Atomic U64 intrinsics for both DX11 and DX12. +/// +/// --------------------------------------- /// What's new in AGS 5.3 since version 5.2 /// --------------------------------------- /// AGS 5.3 includes the following updates: @@ -111,7 +119,7 @@ #define AMD_AGS_H #define AMD_AGS_VERSION_MAJOR 5 ///< AGS major version -#define AMD_AGS_VERSION_MINOR 3 ///< AGS minor version +#define AMD_AGS_VERSION_MINOR 4 ///< AGS minor version #define AMD_AGS_VERSION_PATCH 0 ///< AGS patch version #ifdef __cplusplus @@ -185,9 +193,11 @@ typedef enum AGSDriverExtensionDX11 AGS_DX11_EXTENSION_MULTIVIEW = 1 << 18, ///< Supported in Radeon Software Version 16.12.1 onwards. AGS_DX11_EXTENSION_APP_REGISTRATION = 1 << 19, ///< Supported in Radeon Software Version 17.9.1 onwards. AGS_DX11_EXTENSION_BREADCRUMB_MARKERS = 1 << 20, ///< Supported in Radeon Software Version 17.11.1 onwards. - AGS_DX11_EXTENSION_MDI_DEFERRED_CONTEXTS = 1 << 21, ///< Supported in Radeon Software Version XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX onwards. - AGS_DX11_EXTENSION_UAV_OVERLAP_DEFERRED_CONTEXTS = 1 << 22, ///< Supported in Radeon Software Version XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX onwards. - AGS_DX11_EXTENSION_DEPTH_BOUNDS_DEFERRED_CONTEXTS = 1 << 23 ///< Supported in Radeon Software Version XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX onwards. + AGS_DX11_EXTENSION_MDI_DEFERRED_CONTEXTS = 1 << 21, ///< Supported in Radeon Software Version 18.8.1 onwards. + AGS_DX11_EXTENSION_UAV_OVERLAP_DEFERRED_CONTEXTS = 1 << 22, ///< Supported in Radeon Software Version 18.8.1 onwards. + AGS_DX11_EXTENSION_DEPTH_BOUNDS_DEFERRED_CONTEXTS = 1 << 23, ///< Supported in Radeon Software Version 18.8.1 onwards. + AGS_DX11_EXTENSION_INTRINSIC_DRAW_INDEX = 1 << 24, ///< Supported in Radeon Software Version 19.12.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_ATOMIC_U64 = 1 << 25 ///< Supported in Radeon Software Version 19.12.2 onwards. } AGSDriverExtensionDX11; /// The DirectX12 extension support bits @@ -204,7 +214,10 @@ typedef enum AGSDriverExtensionDX12 AGS_DX12_EXTENSION_INTRINSIC_WAVE_REDUCE = 1 << 8, ///< Supported in Radeon Software Version 17.9.1 onwards. AGS_DX12_EXTENSION_INTRINSIC_WAVE_SCAN = 1 << 9, ///< Supported in Radeon Software Version 17.9.1 onwards. AGS_DX12_EXTENSION_USER_MARKERS = 1 << 10, ///< Supported in Radeon Software Version 17.9.1 onwards. - AGS_DX12_EXTENSION_APP_REGISTRATION = 1 << 11 ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX12_EXTENSION_APP_REGISTRATION = 1 << 11, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX12_EXTENSION_INTRINSIC_UAV_BIND_SLOT = 1 << 12, ///< Supported in Radeon Software Version 19.5.1 onwards. + AGS_DX12_EXTENSION_INTRINSIC_DRAW_INDEX = 1 << 13, ///< Supported in Radeon Software Version 19.12.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_ATOMIC_U64 = 1 << 14 ///< Supported in Radeon Software Version 19.12.2 onwards. } AGSDriverExtensionDX12; /// The space id for DirectX12 intrinsic support @@ -312,6 +325,19 @@ typedef enum ArchitectureVersion ArchitectureVersion_GCN ///< AMD GCN architecture } ArchitectureVersion; +/// The ASIC family +typedef enum AsicFamily +{ + AsicFamily_Unknown, ///< Unknown architecture, potentially from another IHV. Check \ref AGSDeviceInfo::vendorId + AsicFamily_PreGCN, ///< Pre GCN architecture. + AsicFamily_GCN1, ///< AMD GCN 1 architecture: Oland, Cape Verde, Pitcairn & Tahiti. + AsicFamily_GCN2, ///< AMD GCN 2 architecture: Hawaii & Bonaire. This also includes APUs Kaveri and Carrizo. + AsicFamily_GCN3, ///< AMD GCN 3 architecture: Tonga & Fiji. + AsicFamily_GCN4, ///< AMD GCN 4 architecture: Polaris. + AsicFamily_Vega, ///< AMD Vega architecture, including Raven Ridge (ie AMD Ryzen CPU + AMD Vega GPU). + AsicFamily_RDNA ///< AMD RDNA architecture +} AsicFamily; + /// The device info struct used to describe a physical GPU enumerated by AGS typedef struct AGSDeviceInfo_511 { @@ -374,10 +400,48 @@ typedef struct AGSDeviceInfo_520 int adlAdapterIndex; ///< Internally used index into the ADL list of adapters } AGSDeviceInfo_520; +/// The device info struct used to describe a physical GPU enumerated by AGS +typedef struct AGSDeviceInfo_540 +{ + const char* adapterString; ///< The adapter name string + AsicFamily asicFamily; ///< Set to Unknown if not AMD hardware + int isAPU; ///< Whether or not this is an APU + int vendorId; ///< The vendor id + int deviceId; ///< The device id + int revisionId; ///< The revision id + + int numCUs; ///< Number of compute units. + int numWGPs; ///< Number of RDNA Work Group Processors. Only valid if ASIC is RDNA onwards. + + int numROPs; ///< Number of ROPs + int coreClock; ///< Core clock speed at 100% power in MHz + int memoryClock; ///< Memory clock speed at 100% power in MHz + int memoryBandwidth; ///< Memory bandwidth in MB/s + float teraFlops; ///< Teraflops of GPU. Zero if not GCN onwards. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD + + int isPrimaryDevice; ///< Whether or not this is the primary adapter in the system. Not set on the WACK version. + unsigned long long localMemoryInBytes; ///< The size of local memory in bytes. + unsigned long long sharedMemoryInBytes; ///< The size of system memory available to the GPU in bytes. It is important to factor this into your VRAM budget for APUs + ///< as the reported local memory will only be a small fraction of the total memory available to the GPU. + + int numDisplays; ///< The number of active displays found to be attached to this adapter. + AGSDisplayInfo* displays; ///< List of displays allocated by AGS to be numDisplays in length. + + int eyefinityEnabled; ///< Indicates if Eyefinity is active + int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityGridHeight; ///< Contains height of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityResolutionX; ///< Contains width in pixels of the multi-monitor Single Large Surface. + int eyefinityResolutionY; ///< Contains height in pixels of the multi-monitor Single Large Surface. + int eyefinityBezelCompensated; ///< Indicates if bezel compensation is used for the current SLS display area. 1 if enabled, and 0 if disabled. + + int adlAdapterIndex; ///< Internally used index into the ADL list of adapters +} AGSDeviceInfo_540; + typedef union AGSDeviceInfo { AGSDeviceInfo_511 agsDeviceInfo511; AGSDeviceInfo_520 agsDeviceInfo520; + AGSDeviceInfo_540 agsDeviceInfo540; } AGSDeviceInfo; /// \defgroup general General API functions @@ -549,6 +613,8 @@ typedef struct AGSDX12ExtensionParams const WCHAR* pEngineName; ///< Engine name unsigned int appVersion; ///< Application version unsigned int engineVersion; ///< Engine version + // ADDED IN 5.4.0 + unsigned int uavSlot; ///< The UAV slot reserved for intrinsic support. Refer to the \ref agsDriverExtensionsDX12_CreateDevice documentation for more details. } AGSDX12ExtensionParams; /// The struct to hold all the returned parameters from the device creation call @@ -566,7 +632,19 @@ typedef struct AGSDX12ReturnedParams /// * The shader compiler should not use the D3DCOMPILE_SKIP_OPTIMIZATION (/Od) option, otherwise it will not work. /// * The shader compiler needs D3DCOMPILE_ENABLE_STRICTNESS (/Ges) enabled. /// * The intrinsic instructions require a 5.1 shader model. -/// * The Root Signature will need to use an extra resource and sampler. These are not real resources/samplers, they are just used to encode the intrinsic instruction. +/// * The Root Signature will need to reserve an extra UAV resource slot. This is not a real resource that requires allocating, it is just used to encode the intrinsic instructions. +/// +/// The easiest way to set up the reserved UAV slot is to specify it at u0. The register space id will automatically be assumed to be \ref AGS_DX12_SHADER_INSTRINSICS_SPACE_ID. +/// The HLSL expects this as default and the set up code would look similar to this: +/// \code{.cpp} +/// CD3DX12_DESCRIPTOR_RANGE range[]; +/// ... +/// range[ 0 ].Init( D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 1, 0, AGS_DX12_SHADER_INSTRINSICS_SPACE_ID ); // u0 at driver-reserved space id +/// \endcode +/// +/// Newer drivers also support a user-specified slot in which case the register space id is assumed to be 0. It is important that the \ref AGS_DX12_EXTENSION_INTRINSIC_UAV_BIND_SLOT bit is set +/// to ensure the driver can support this. If not, then u0 and \ref AGS_DX12_SHADER_INSTRINSICS_SPACE_ID must be used. +/// If the driver does support this feature and a non zero slot is required, then the HLSL must also define AMD_EXT_SHADER_INTRINSIC_UAV_OVERRIDE as the matching slot value. /// /// \param [in] context Pointer to a context. This is generated by \ref agsInit /// \param [in] creationParams Pointer to the struct to specify the existing DX12 device creation parameters. @@ -616,7 +694,7 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_DeInit( AGSContext* context ); /// /// Function used to push an AMD user marker onto the command list. -/// This is only has an effect if AGS_DX12_EXTENSION_USER_MARKERS is present in the extensionsSupported bitfield of \ref agsDriverExtensionsDX12_CreateDevice +/// This is only has an effect if \ref AGS_DX12_EXTENSION_USER_MARKERS is present in the extensionsSupported bitfield of \ref agsDriverExtensionsDX12_CreateDevice /// Supported in Radeon Software Version 17.9.1 onwards. /// /// \param [in] context Pointer to a context. diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index b3cf309da413..9b45ec721c21 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -21,6 +21,7 @@ enum amd_ags_version AMD_AGS_VERSION_5_2_0, AMD_AGS_VERSION_5_2_1, AMD_AGS_VERSION_5_3_0, + AMD_AGS_VERSION_5_4_0, AMD_AGS_VERSION_COUNT }; @@ -37,6 +38,7 @@ static const amd_ags_versions[AMD_AGS_VERSION_COUNT] = {5, 2, 0}, {5, 2, 1}, {5, 3, 0}, + {5, 4, 0}, }; struct AGSContext @@ -151,7 +153,6 @@ static AGSReturnCode init_ags_context(AGSContext *context) case AMD_AGS_VERSION_5_2_0: case AMD_AGS_VERSION_5_2_1: case AMD_AGS_VERSION_5_3_0: - default: device->agsDeviceInfo520.adapterString = vk_properties->deviceName; device->agsDeviceInfo520.vendorId = vk_properties->vendorID; device->agsDeviceInfo520.deviceId = vk_properties->deviceID; @@ -162,6 +163,18 @@ static AGSReturnCode init_ags_context(AGSContext *context) if (!i) device->agsDeviceInfo520.isPrimaryDevice = 1; break; + case AMD_AGS_VERSION_5_4_0: + default: + device->agsDeviceInfo540.adapterString = vk_properties->deviceName; + device->agsDeviceInfo540.vendorId = vk_properties->vendorID; + device->agsDeviceInfo540.deviceId = vk_properties->deviceID; + + if (device->agsDeviceInfo540.vendorId == 0x1002) + device->agsDeviceInfo540.asicFamily = AsicFamily_GCN4; + + if (!i) + device->agsDeviceInfo540.isPrimaryDevice = 1; + break; } } From 7942a6bdbdfd21f28756b69324bba3a52145e73f Mon Sep 17 00:00:00 2001 From: Brendan Shanks Date: Wed, 17 Jun 2020 15:16:44 -0700 Subject: [PATCH 0449/2542] amd_ags_x64: Update to 5.4.1 --- dlls/amd_ags_x64/amd_ags.h | 101 +++++++++++++++++++++++----- dlls/amd_ags_x64/amd_ags_x64_main.c | 15 ++++- 2 files changed, 98 insertions(+), 18 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index c615ba4c2030..30f3735915c6 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2020 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -34,11 +34,21 @@ /// \endinternal /// /// --------------------------------------- +/// What's new in AGS 5.4.1 since version 5.4.0 +/// --------------------------------------- +/// AGS 5.4.1 includes the following updates: +/// * AsicFamily_Count to help with code maintenance. +/// * Visual Studio 2019 support. +/// * x86 support +/// * BaseInstance and BaseVertex intrinsics along with corresponding caps bits. +/// * GetWaveSize intrinsic along with corresponding caps bits. +/// +/// --------------------------------------- /// What's new in AGS 5.4 since version 5.3 /// --------------------------------------- /// AGS 5.4 includes the following updates: /// * A more detailed description of the GPU architecture, now including RDNA GPUs. -/// * Navi 10, Navi 14 and Radeon 7 core and memory speeds returned. +/// * Radeon 7 core and memory speeds returned. /// * Draw index and Atomic U64 intrinsics for both DX11 and DX12. /// /// --------------------------------------- @@ -47,7 +57,7 @@ /// AGS 5.3 includes the following updates: /// * DX11 deferred context support for Multi Draw Indirect and UAV Overlap extensions. /// * A Radeon Software Version helper to determine whether the installed driver meets your game's minimum driver version requirements. -/// * Freesync2 Gamma 2.2 mode which uses a 1010102 swapchain and can be considered as an alternative to using the 64 bit swapchain required for Freesync2 scRGB. +/// * Freesync HDR Gamma 2.2 mode which uses a 1010102 swapchain and can be considered as an alternative to using the 64 bit swapchain required for Freesync HDR scRGB. /// /// What's new in AGS 5.2.1 since version 5.2.0 /// --------------------------------------- @@ -120,16 +130,19 @@ #define AMD_AGS_VERSION_MAJOR 5 ///< AGS major version #define AMD_AGS_VERSION_MINOR 4 ///< AGS minor version -#define AMD_AGS_VERSION_PATCH 0 ///< AGS patch version +#define AMD_AGS_VERSION_PATCH 1 ///< AGS patch version #ifdef __cplusplus extern "C" { #endif +/// \defgroup Defines AGS defines +/// @{ #define AMD_AGS_API WINAPI #define AGS_MAKE_VERSION( major, minor, patch ) ( ( major << 22 ) | ( minor << 12 ) | patch ) ///< Macro to create the app and engine versions for the fields in \ref AGSDX12ExtensionParams and \ref AGSDX11ExtensionParams and the Radeon Software Version #define AGS_UNSPECIFIED_VERSION 0xFFFFAD00 ///< Use this to specify no version +/// @} // Forward declaration of D3D11 types struct IDXGIAdapter; @@ -154,6 +167,8 @@ struct D3D11_SUBRESOURCE_DATA; struct ID3D12Device; struct ID3D12GraphicsCommandList; +/// \defgroup enums General enumerations +/// @{ /// The return codes typedef enum AGSReturnCode @@ -162,8 +177,10 @@ typedef enum AGSReturnCode AGS_FAILURE, ///< Failed to complete call for some unspecified reason AGS_INVALID_ARGS, ///< Invalid arguments into the function AGS_OUT_OF_MEMORY, ///< Out of memory when allocating space internally - AGS_ERROR_MISSING_DLL, ///< Returned when a driver dll fails to load - most likely due to not being present in legacy driver installation - AGS_ERROR_LEGACY_DRIVER, ///< Returned if a feature is not present in the installed driver + AGS_MISSING_D3D_DLL, ///< Returned when a D3D dll fails to load + AGS_LEGACY_DRIVER, ///< Returned if a feature is not present in the installed driver + // AGS_NO_AMD_DRIVER_INSTALLED ADDED IN 5.4.1 + AGS_NO_AMD_DRIVER_INSTALLED, ///< Returned if the AMD GPU driver does not appear to be installed AGS_EXTENSION_NOT_SUPPORTED, ///< Returned if the driver does not support the requested driver extension AGS_ADL_FAILURE, ///< Failure in ADL (the AMD Display Library) AGS_DX_FAILURE ///< Failure from DirectX runtime @@ -197,7 +214,10 @@ typedef enum AGSDriverExtensionDX11 AGS_DX11_EXTENSION_UAV_OVERLAP_DEFERRED_CONTEXTS = 1 << 22, ///< Supported in Radeon Software Version 18.8.1 onwards. AGS_DX11_EXTENSION_DEPTH_BOUNDS_DEFERRED_CONTEXTS = 1 << 23, ///< Supported in Radeon Software Version 18.8.1 onwards. AGS_DX11_EXTENSION_INTRINSIC_DRAW_INDEX = 1 << 24, ///< Supported in Radeon Software Version 19.12.2 onwards. - AGS_DX11_EXTENSION_INTRINSIC_ATOMIC_U64 = 1 << 25 ///< Supported in Radeon Software Version 19.12.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_ATOMIC_U64 = 1 << 25, ///< Supported in Radeon Software Version 19.12.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_GET_WAVE_SIZE = 1 << 26, ///< Supported in Radeon Software Version 20.2.1 onwards. + AGS_DX11_EXTENSION_INTRINSIC_BASE_VERTEX = 1 << 27, ///< Supported in Radeon Software Version 20.2.1 onwards. + AGS_DX11_EXTENSION_INTRINSIC_BASE_INSTANCE = 1 << 28 ///< Supported in Radeon Software Version 20.2.1 onwards. } AGSDriverExtensionDX11; /// The DirectX12 extension support bits @@ -217,7 +237,10 @@ typedef enum AGSDriverExtensionDX12 AGS_DX12_EXTENSION_APP_REGISTRATION = 1 << 11, ///< Supported in Radeon Software Version 17.9.1 onwards. AGS_DX12_EXTENSION_INTRINSIC_UAV_BIND_SLOT = 1 << 12, ///< Supported in Radeon Software Version 19.5.1 onwards. AGS_DX12_EXTENSION_INTRINSIC_DRAW_INDEX = 1 << 13, ///< Supported in Radeon Software Version 19.12.2 onwards. - AGS_DX12_EXTENSION_INTRINSIC_ATOMIC_U64 = 1 << 14 ///< Supported in Radeon Software Version 19.12.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_ATOMIC_U64 = 1 << 14, ///< Supported in Radeon Software Version 19.12.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_BASE_VERTEX = 1 << 15, ///< Supported in Radeon Software Version 20.2.1 onwards. + AGS_DX12_EXTENSION_INTRINSIC_BASE_INSTANCE = 1 << 16, ///< Supported in Radeon Software Version 20.2.1 onwards. + AGS_DX12_EXTENSION_INTRINSIC_GET_WAVE_SIZE = 1 << 17 ///< Supported in Radeon Software Version 20.5.1 onwards. } AGSDriverExtensionDX12; /// The space id for DirectX12 intrinsic support @@ -238,7 +261,7 @@ typedef enum AGSDisplayFlags AGS_DISPLAYFLAG_HDR10 = 1 << 1, ///< HDR10 is supported on this display AGS_DISPLAYFLAG_DOLBYVISION = 1 << 2, ///< Dolby Vision is supported on this display AGS_DISPLAYFLAG_FREESYNC = 1 << 3, ///< Freesync is supported on this display - AGS_DISPLAYFLAG_FREESYNC_2 = 1 << 4, ///< Freesync 2 is supported on this display + AGS_DISPLAYFLAG_FREESYNC_HDR = 1 << 4, ///< Freesync HDR is supported on this display AGS_DISPLAYFLAG_EYEFINITY_IN_GROUP = 1 << 5, ///< The display is part of the Eyefinity group AGS_DISPLAYFLAG_EYEFINITY_PREFERRED_DISPLAY = 1 << 6, ///< The display is the preferred display in the Eyefinity group for displaying the UI AGS_DISPLAYFLAG_EYEFINITY_IN_PORTRAIT_MODE = 1 << 7, ///< The display is in the Eyefinity group but in portrait mode @@ -250,6 +273,7 @@ typedef enum AGSDisplaySettingsFlags AGS_DISPLAYSETTINGSFLAG_DISABLE_LOCAL_DIMMING = 1 << 0, ///< Disables local dimming if possible } AGSDisplaySettingsFlags; +/// @} typedef struct AGSContext AGSContext; ///< All function calls in AGS require a pointer to a context. This is generated via \ref agsInit @@ -280,7 +304,7 @@ typedef struct AGSDisplayInfo char name[ 256 ]; ///< The name of the display char displayDeviceName[ 32 ]; ///< The display device name, i.e. DISPLAY_DEVICE::DeviceName - unsigned int displayFlags; ///< Bitfield of ::AGSDisplayFlags + unsigned int displayFlags; ///< Bitfield of \ref AGSDisplayFlags int maxResolutionX; ///< The maximum supported resolution of the unrotated display int maxResolutionY; ///< The maximum supported resolution of the unrotated display @@ -335,7 +359,9 @@ typedef enum AsicFamily AsicFamily_GCN3, ///< AMD GCN 3 architecture: Tonga & Fiji. AsicFamily_GCN4, ///< AMD GCN 4 architecture: Polaris. AsicFamily_Vega, ///< AMD Vega architecture, including Raven Ridge (ie AMD Ryzen CPU + AMD Vega GPU). - AsicFamily_RDNA ///< AMD RDNA architecture + AsicFamily_RDNA, ///< AMD RDNA architecture + + AsicFamily_Count ///< Number of enumerated ASIC families } AsicFamily; /// The device info struct used to describe a physical GPU enumerated by AGS @@ -437,11 +463,47 @@ typedef struct AGSDeviceInfo_540 int adlAdapterIndex; ///< Internally used index into the ADL list of adapters } AGSDeviceInfo_540; +/// The device info struct used to describe a physical GPU enumerated by AGS +typedef struct AGSDeviceInfo_541 +{ + const char* adapterString; ///< The adapter name string + AsicFamily asicFamily; ///< Set to Unknown if not AMD hardware + int isAPU; ///< Whether or not this is an APU + int vendorId; ///< The vendor id + int deviceId; ///< The device id + int revisionId; ///< The revision id + + int numCUs; ///< Number of compute units. + int numWGPs; ///< Number of RDNA Work Group Processors. Only valid if ASIC is RDNA onwards. + + int numROPs; ///< Number of ROPs + int coreClock; ///< Core clock speed at 100% power in MHz + int memoryClock; ///< Memory clock speed at 100% power in MHz + int memoryBandwidth; ///< Memory bandwidth in MB/s + float teraFlops; ///< Teraflops of GPU. Zero if not GCN onwards. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD + + int isPrimaryDevice; ///< Whether or not this is the primary adapter in the system. Not set on the WACK version. + long long localMemoryInBytes; ///< The size of local memory in bytes. 0 for non AMD hardware. + + int numDisplays; ///< The number of active displays found to be attached to this adapter. + AGSDisplayInfo* displays; ///< List of displays allocated by AGS to be numDisplays in length. + + int eyefinityEnabled; ///< Indicates if Eyefinity is active + int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityGridHeight; ///< Contains height of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityResolutionX; ///< Contains width in pixels of the multi-monitor Single Large Surface. + int eyefinityResolutionY; ///< Contains height in pixels of the multi-monitor Single Large Surface. + int eyefinityBezelCompensated; ///< Indicates if bezel compensation is used for the current SLS display area. 1 if enabled, and 0 if disabled. + + int adlAdapterIndex; ///< Internally used index into the ADL list of adapters +} AGSDeviceInfo_541; + typedef union AGSDeviceInfo { AGSDeviceInfo_511 agsDeviceInfo511; AGSDeviceInfo_520 agsDeviceInfo520; AGSDeviceInfo_540 agsDeviceInfo540; + AGSDeviceInfo_541 agsDeviceInfo541; } AGSDeviceInfo; /// \defgroup general General API functions @@ -495,10 +557,12 @@ typedef struct AGSDisplaySettings Mode_SDR, ///< SDR mode Mode_HDR10_PQ, ///< HDR10 PQ encoding, requiring a 1010102 UNORM swapchain and PQ encoding in the output shader. Mode_HDR10_scRGB, ///< HDR10 scRGB, requiring an FP16 swapchain. Values of 1.0 == 80 nits, 125.0 == 10000 nits. - Mode_Freesync2_scRGB, ///< Freesync2 scRGB, requiring an FP16 swapchain. 1.0 == 80 nits. Tonemap your scene to the range of 0.0 to AGSDisplayInfo::maxLuminance. - // Mode_Freesync2_Gamma22 ADDED IN 5.3.0 - Mode_Freesync2_Gamma22, ///< Freesync2 Gamma 2.2, requiring a 1010102 UNORM swapchain. The output needs to be encoded to gamma 2.2. - Mode_DolbyVision ///< Dolby Vision, requiring an 8888 UNORM swapchain + Mode_FreesyncHDR_scRGB, ///< Freesync HDR scRGB, requiring an FP16 swapchain. A value of 1.0 == 80 nits. + // Mode_FreesyncHDR_Gamma22 ADDED IN 5.3.0 + Mode_FreesyncHDR_Gamma22, ///< Freesync HDR Gamma 2.2, requiring a 1010102 UNORM swapchain. The output needs to be encoded to gamma 2.2. + Mode_DolbyVision, ///< Dolby Vision, requiring an 8888 UNORM swapchain + + Mode_Count ///< Number of enumerated display modes } mode; ///< The display mode to set the display into double chromaticityRedX; ///< Red display primary X coord @@ -545,7 +609,9 @@ AMD_AGS_API AGSDriverVersionResult agsCheckDriverVersion( const char* radeonSoft /// Function used to initialize the AGS library. /// Must be called prior to any of the subsequent AGS API calls. /// Must be called prior to ID3D11Device or ID3D12Device creation. -/// \note This function will fail with \ref AGS_ERROR_LEGACY_DRIVER in Catalyst versions before 12.20. +/// \note The caller of this function should handle the possibility of the call failing in the cases below. One option is to do a vendor id check and only call \ref agsInit if there is an AMD GPU present. +/// \note This function will fail with \ref AGS_NO_AMD_DRIVER_INSTALLED if there is no AMD driver found on the system. +/// \note This function will fail with \ref AGS_LEGACY_DRIVER in Catalyst versions before 12.20. /// \note It is good practice to check the AGS version returned from AGSGPUInfo against the version defined in the header in case a mismatch between the dll and header has occurred. /// /// \param [in, out] context Address of a pointer to a context. This function allocates a context on the heap which is then required for all subsequent API calls. @@ -577,7 +643,8 @@ AMD_AGS_API AGSReturnCode agsGetCrossfireGPUCount( AGSContext* context, int* num /// \note Call this function after each mode change (switch to fullscreen, any change in swapchain etc). /// \note HDR10 PQ mode requires a 1010102 swapchain. /// \note HDR10 scRGB mode requires an FP16 swapchain. -/// \note Freesync2 scRGB mode requires an FP16 swapchain. +/// \note Freesync HDR scRGB mode requires an FP16 swapchain. +/// \note Freesync HDR Gamma 2.2 mode requires a 1010102 swapchain. /// \note Dolby Vision requires a 8888 UNORM swapchain. /// /// \param [in] context Pointer to a context. This is generated by \ref agsInit diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 9b45ec721c21..85b2db0b9364 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -22,6 +22,7 @@ enum amd_ags_version AMD_AGS_VERSION_5_2_1, AMD_AGS_VERSION_5_3_0, AMD_AGS_VERSION_5_4_0, + AMD_AGS_VERSION_5_4_1, AMD_AGS_VERSION_COUNT }; @@ -39,6 +40,7 @@ static const amd_ags_versions[AMD_AGS_VERSION_COUNT] = {5, 2, 1}, {5, 3, 0}, {5, 4, 0}, + {5, 4, 1}, }; struct AGSContext @@ -164,7 +166,6 @@ static AGSReturnCode init_ags_context(AGSContext *context) device->agsDeviceInfo520.isPrimaryDevice = 1; break; case AMD_AGS_VERSION_5_4_0: - default: device->agsDeviceInfo540.adapterString = vk_properties->deviceName; device->agsDeviceInfo540.vendorId = vk_properties->vendorID; device->agsDeviceInfo540.deviceId = vk_properties->deviceID; @@ -175,6 +176,18 @@ static AGSReturnCode init_ags_context(AGSContext *context) if (!i) device->agsDeviceInfo540.isPrimaryDevice = 1; break; + case AMD_AGS_VERSION_5_4_1: + default: + device->agsDeviceInfo541.adapterString = vk_properties->deviceName; + device->agsDeviceInfo541.vendorId = vk_properties->vendorID; + device->agsDeviceInfo541.deviceId = vk_properties->deviceID; + + if (device->agsDeviceInfo541.vendorId == 0x1002) + device->agsDeviceInfo541.asicFamily = AsicFamily_GCN4; + + if (!i) + device->agsDeviceInfo541.isPrimaryDevice = 1; + break; } } From 0ff7f0f73a782bee50987da0953e2319fbf58cc9 Mon Sep 17 00:00:00 2001 From: Brendan Shanks Date: Wed, 17 Jun 2020 16:33:08 -0700 Subject: [PATCH 0450/2542] amd_ags_x64: Fill in localMemoryInBytes. --- dlls/amd_ags_x64/amd_ags_x64_main.c | 39 ++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 85b2db0b9364..d845a0978d81 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -49,12 +49,14 @@ struct AGSContext unsigned int device_count; AGSDeviceInfo *devices; VkPhysicalDeviceProperties *properties; + VkPhysicalDeviceMemoryProperties *memory_properties; }; static AGSReturnCode vk_get_physical_device_properties(unsigned int *out_count, - VkPhysicalDeviceProperties **out) + VkPhysicalDeviceProperties **out, VkPhysicalDeviceMemoryProperties **out_memory) { VkPhysicalDeviceProperties *properties = NULL; + VkPhysicalDeviceMemoryProperties *memory_properties = NULL; VkPhysicalDevice *vk_physical_devices = NULL; VkInstance vk_instance = VK_NULL_HANDLE; VkInstanceCreateInfo create_info; @@ -99,11 +101,23 @@ static AGSReturnCode vk_get_physical_device_properties(unsigned int *out_count, goto done; } + if (!(memory_properties = heap_calloc(count, sizeof(*memory_properties)))) + { + WARN("Failed to allocate memory.\n"); + heap_free(properties); + ret = AGS_OUT_OF_MEMORY; + goto done; + } + for (i = 0; i < count; ++i) vkGetPhysicalDeviceProperties(vk_physical_devices[i], &properties[i]); + for (i = 0; i < count; ++i) + vkGetPhysicalDeviceMemoryProperties(vk_physical_devices[i], &memory_properties[i]); + *out_count = count; *out = properties; + *out_memory = memory_properties; done: heap_free(vk_physical_devices); @@ -115,15 +129,16 @@ static AGSReturnCode vk_get_physical_device_properties(unsigned int *out_count, static AGSReturnCode init_ags_context(AGSContext *context) { AGSReturnCode ret; - unsigned int i; + unsigned int i, j; // TODO: version check context->version = AMD_AGS_VERSION_5_1_1; context->device_count = 0; context->devices = NULL; context->properties = NULL; + context->memory_properties = NULL; - ret = vk_get_physical_device_properties(&context->device_count, &context->properties); + ret = vk_get_physical_device_properties(&context->device_count, &context->properties, &context->memory_properties); if (ret != AGS_SUCCESS || !context->device_count) return ret; @@ -131,13 +146,26 @@ static AGSReturnCode init_ags_context(AGSContext *context) { WARN("Failed to allocate memory.\n"); heap_free(context->properties); + heap_free(context->memory_properties); return AGS_OUT_OF_MEMORY; } for (i = 0; i < context->device_count; ++i) { const VkPhysicalDeviceProperties *vk_properties = &context->properties[i]; + const VkPhysicalDeviceMemoryProperties *vk_memory_properties = &context->memory_properties[i]; AGSDeviceInfo *device = &context->devices[i]; + VkDeviceSize local_memory_size = 0; + + for (j = 0; j < vk_memory_properties->memoryHeapCount; j++) + { + if (vk_memory_properties->memoryHeaps[j].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) + { + local_memory_size = vk_memory_properties->memoryHeaps[j].size; + break; + } + } + TRACE("reporting local memory size 0x%s bytes\n", wine_dbgstr_longlong(local_memory_size)); switch (context->version) { @@ -145,6 +173,7 @@ static AGSReturnCode init_ags_context(AGSContext *context) device->agsDeviceInfo511.adapterString = vk_properties->deviceName; device->agsDeviceInfo511.vendorId = vk_properties->vendorID; device->agsDeviceInfo511.deviceId = vk_properties->deviceID; + device->agsDeviceInfo511.localMemoryInBytes = local_memory_size; if (device->agsDeviceInfo511.vendorId == 0x1002) device->agsDeviceInfo511.architectureVersion = ArchitectureVersion_GCN; @@ -158,6 +187,7 @@ static AGSReturnCode init_ags_context(AGSContext *context) device->agsDeviceInfo520.adapterString = vk_properties->deviceName; device->agsDeviceInfo520.vendorId = vk_properties->vendorID; device->agsDeviceInfo520.deviceId = vk_properties->deviceID; + device->agsDeviceInfo520.localMemoryInBytes = local_memory_size; if (device->agsDeviceInfo520.vendorId == 0x1002) device->agsDeviceInfo520.architectureVersion = ArchitectureVersion_GCN; @@ -169,6 +199,7 @@ static AGSReturnCode init_ags_context(AGSContext *context) device->agsDeviceInfo540.adapterString = vk_properties->deviceName; device->agsDeviceInfo540.vendorId = vk_properties->vendorID; device->agsDeviceInfo540.deviceId = vk_properties->deviceID; + device->agsDeviceInfo540.localMemoryInBytes = local_memory_size; if (device->agsDeviceInfo540.vendorId == 0x1002) device->agsDeviceInfo540.asicFamily = AsicFamily_GCN4; @@ -181,6 +212,7 @@ static AGSReturnCode init_ags_context(AGSContext *context) device->agsDeviceInfo541.adapterString = vk_properties->deviceName; device->agsDeviceInfo541.vendorId = vk_properties->vendorID; device->agsDeviceInfo541.deviceId = vk_properties->deviceID; + device->agsDeviceInfo541.localMemoryInBytes = local_memory_size; if (device->agsDeviceInfo541.vendorId == 0x1002) device->agsDeviceInfo541.asicFamily = AsicFamily_GCN4; @@ -238,6 +270,7 @@ AGSReturnCode WINAPI agsDeInit(AGSContext *context) if (context) { + heap_free(context->memory_properties); heap_free(context->properties); heap_free(context->devices); heap_free(context); From a956d7549e74e05922c182e4d2effaea51da699d Mon Sep 17 00:00:00 2001 From: Brendan Shanks Date: Wed, 17 Jun 2020 16:36:24 -0700 Subject: [PATCH 0451/2542] amd_ags_x64: Update reported driver version to 20.20.2. Needed to silence warnings in Red Dead Redemption 2. --- dlls/amd_ags_x64/amd_ags_x64_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index d845a0978d81..62a1a02c8234 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -252,8 +252,8 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi gpu_info->agsVersionMajor = amd_ags_versions[object->version].major; gpu_info->agsVersionMinor = amd_ags_versions[object->version].minor; gpu_info->agsVersionPatch = amd_ags_versions[object->version].patch; - gpu_info->driverVersion = "18.10.16-180516a-328911C-RadeonSoftwareAdrenalin"; - gpu_info->radeonSoftwareVersion = "18.5.1"; + gpu_info->driverVersion = "20.20.2-180516a-328911C-RadeonSoftwareAdrenalin"; + gpu_info->radeonSoftwareVersion = "20.20.2"; gpu_info->numDevices = object->device_count; gpu_info->devices = object->devices; From 4ae1c24d4527c93f45343d8cde3568800f0ff37a Mon Sep 17 00:00:00 2001 From: Brendan Shanks Date: Thu, 25 Jun 2020 15:54:59 -0700 Subject: [PATCH 0452/2542] amd_ags_x64: Detect library version from DLL included with game. --- dlls/amd_ags_x64/Makefile.in | 2 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 70 ++++++++++++++++++++++++++++- 2 files changed, 69 insertions(+), 3 deletions(-) diff --git a/dlls/amd_ags_x64/Makefile.in b/dlls/amd_ags_x64/Makefile.in index b2c2a28c0649..5cd98895ff67 100644 --- a/dlls/amd_ags_x64/Makefile.in +++ b/dlls/amd_ags_x64/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = amd_ags_x64.dll -IMPORTS = vulkan-1 +IMPORTS = version vulkan-1 IMPORTLIB = amd_ags_x64 EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 62a1a02c8234..b2f8149bcd84 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -126,13 +126,79 @@ static AGSReturnCode vk_get_physical_device_properties(unsigned int *out_count, return ret; } +static enum amd_ags_version determine_ags_version(void) +{ + /* AMD AGS is not binary compatible between versions (even minor versions), and the game + * does not request a specific version when calling agsInit(). + * Checking the version of amd_ags_x64.dll shipped with the game is the only way to + * determine what version the game was built against. + * + * An update to AGS 5.4.1 included an amd_ags_x64.dll with no file version info. + * In case of an error, assume it's that version. + */ + enum amd_ags_version ret = AMD_AGS_VERSION_5_4_1; + DWORD infosize; + void *infobuf = NULL; + void *val; + UINT vallen, i; + VS_FIXEDFILEINFO *info; + UINT16 major, minor, patch; + + infosize = GetFileVersionInfoSizeW(L"amd_ags_x64.dll", NULL); + if (!infosize) + { + WARN("Unable to determine desired version of amd_ags_x64.dll.\n"); + goto done; + } + + if (!(infobuf = heap_alloc(infosize))) + { + WARN("Failed to allocate memory.\n"); + goto done; + } + + if (!GetFileVersionInfoW(L"amd_ags_x64.dll", 0, infosize, infobuf)) + { + WARN("Unable to determine desired version of amd_ags_x64.dll.\n"); + goto done; + } + + if (!VerQueryValueW(infobuf, L"\\", &val, &vallen) || (vallen != sizeof(VS_FIXEDFILEINFO))) + { + WARN("Unable to determine desired version of amd_ags_x64.dll.\n"); + goto done; + } + + info = val; + major = info->dwFileVersionMS >> 16; + minor = info->dwFileVersionMS; + patch = info->dwFileVersionLS >> 16; + TRACE("Found amd_ags_x64.dll v%d.%d.%d\n", major, minor, patch); + + for (i = 0; i < ARRAY_SIZE(amd_ags_versions); i++) + { + if ((major == amd_ags_versions[i].major) && + (minor == amd_ags_versions[i].minor) && + (patch == amd_ags_versions[i].patch)) + { + ret = i; + break; + } + } + +done: + heap_free(infobuf); + TRACE("Using AGS v%d.%d.%d interface\n", + amd_ags_versions[ret].major, amd_ags_versions[ret].minor, amd_ags_versions[ret].patch); + return ret; +} + static AGSReturnCode init_ags_context(AGSContext *context) { AGSReturnCode ret; unsigned int i, j; - // TODO: version check - context->version = AMD_AGS_VERSION_5_1_1; + context->version = determine_ags_version(); context->device_count = 0; context->devices = NULL; context->properties = NULL; From 2682ba26533ec5ca451423c523c0a1c85177988b Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Wed, 21 Apr 2021 16:16:55 +0300 Subject: [PATCH 0453/2542] setupapi: Don't install built-in amd_ags_x64.dll in system32/syswow64. The DLL ships with the games and having the built-in version in system32/syswow64 has unexpected consequences. If the game is launched from a subdirectory, but the DLL is in current working directory, the built-in takes precedence as CWD has lower search priority than system directories (with the default SafeDllSearchMode). By not installing amd_ags_x64.dll in system32/syswow64 the built-in is still picked up correctly from lib/ when necessary. This fixes Evil Genius 2. CW-Bug-Id: 18804 --- dlls/setupapi/fakedll.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/setupapi/fakedll.c b/dlls/setupapi/fakedll.c index 25305d8a4f68..fb01d21b3ba5 100644 --- a/dlls/setupapi/fakedll.c +++ b/dlls/setupapi/fakedll.c @@ -978,6 +978,7 @@ static void install_lib_dir( WCHAR *dest, WCHAR *file, const WCHAR *wildcard, if (lstrlenW( data.name ) > max_dll_name_len) continue; if (!wcscmp( data.name, L"." )) continue; if (!wcscmp( data.name, L".." )) continue; + if (!wcscmp( data.name, L"amd_ags_x64.dll" )) continue; lstrcpyW( name, data.name ); if (default_ext) /* inside build dir */ { From 1508d483895b8b9fe90c5b75c8352bd5a483ea48 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 16 Apr 2021 20:21:29 +0300 Subject: [PATCH 0454/2542] amd_ags_x64: Don't use ordinals in spec file. For Forza Horizon 4. --- dlls/amd_ags_x64/amd_ags_x64.spec | 58 +++++++++++++++---------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index a302d2fc6578..c571dac2184d 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -1,29 +1,29 @@ -1 stdcall agsDeInit(ptr) -2 stub agsDriverExtensionsDX11_BeginUAVOverlap -3 stub agsDriverExtensionsDX11_CreateBuffer -4 stub agsDriverExtensionsDX11_CreateTexture1D -5 stub agsDriverExtensionsDX11_CreateTexture2D -6 stub agsDriverExtensionsDX11_CreateTexture3D -7 stub agsDriverExtensionsDX11_DeInit -8 stub agsDriverExtensionsDX11_EndUAVOverlap -9 stub agsDriverExtensionsDX11_GetMaxClipRects -10 stub agsDriverExtensionsDX11_IASetPrimitiveTopology -11 stub agsDriverExtensionsDX11_Init -12 stub agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect -13 stub agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect -14 stub agsDriverExtensionsDX11_MultiDrawInstancedIndirect -15 stub agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect -16 stub agsDriverExtensionsDX11_NotifyResourceBeginAllAccess -17 stub agsDriverExtensionsDX11_NotifyResourceEndAllAccess -18 stub agsDriverExtensionsDX11_NotifyResourceEndWrites -19 stub agsDriverExtensionsDX11_NumPendingAsyncCompileJobs -20 stub agsDriverExtensionsDX11_SetClipRects -21 stub agsDriverExtensionsDX11_SetDepthBounds -22 stub agsDriverExtensionsDX11_SetDiskShaderCacheEnabled -23 stub agsDriverExtensionsDX11_SetMaxAsyncCompileThreadCount -24 stub agsDriverExtensionsDX11_SetViewBroadcastMasks -25 stub agsDriverExtensionsDX12_DeInit -26 stub agsDriverExtensionsDX12_Init -27 stdcall agsGetCrossfireGPUCount(ptr ptr) -28 stdcall agsInit(ptr ptr ptr) -29 stub agsSetDisplayMode +@ stdcall agsDeInit(ptr) +@ stub agsDriverExtensionsDX11_BeginUAVOverlap +@ stub agsDriverExtensionsDX11_CreateBuffer +@ stub agsDriverExtensionsDX11_CreateTexture1D +@ stub agsDriverExtensionsDX11_CreateTexture2D +@ stub agsDriverExtensionsDX11_CreateTexture3D +@ stub agsDriverExtensionsDX11_DeInit +@ stub agsDriverExtensionsDX11_EndUAVOverlap +@ stub agsDriverExtensionsDX11_GetMaxClipRects +@ stub agsDriverExtensionsDX11_IASetPrimitiveTopology +@ stub agsDriverExtensionsDX11_Init +@ stub agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect +@ stub agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect +@ stub agsDriverExtensionsDX11_MultiDrawInstancedIndirect +@ stub agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect +@ stub agsDriverExtensionsDX11_NotifyResourceBeginAllAccess +@ stub agsDriverExtensionsDX11_NotifyResourceEndAllAccess +@ stub agsDriverExtensionsDX11_NotifyResourceEndWrites +@ stub agsDriverExtensionsDX11_NumPendingAsyncCompileJobs +@ stub agsDriverExtensionsDX11_SetClipRects +@ stub agsDriverExtensionsDX11_SetDepthBounds +@ stub agsDriverExtensionsDX11_SetDiskShaderCacheEnabled +@ stub agsDriverExtensionsDX11_SetMaxAsyncCompileThreadCount +@ stub agsDriverExtensionsDX11_SetViewBroadcastMasks +@ stub agsDriverExtensionsDX12_DeInit +@ stub agsDriverExtensionsDX12_Init +@ stdcall agsGetCrossfireGPUCount(ptr ptr) +@ stdcall agsInit(ptr ptr ptr) +@ stub agsSetDisplayMode From 3b54adfa9a6af9312a8396861478c9fce94c5e5e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 16 Apr 2021 20:07:28 +0300 Subject: [PATCH 0455/2542] amd_ags_x64: Add more stubs to spec file. For Forza Horizon 4. --- dlls/amd_ags_x64/amd_ags_x64.spec | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index c571dac2184d..f483cc6380b6 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -1,10 +1,15 @@ @ stdcall agsDeInit(ptr) +@ stub agsCheckDriverVersion @ stub agsDriverExtensionsDX11_BeginUAVOverlap @ stub agsDriverExtensionsDX11_CreateBuffer +@ stub agsDriverExtensionsDX11_CreateDevice +@ stub agsDriverExtensionsDX11_CreateFromDevice @ stub agsDriverExtensionsDX11_CreateTexture1D @ stub agsDriverExtensionsDX11_CreateTexture2D @ stub agsDriverExtensionsDX11_CreateTexture3D @ stub agsDriverExtensionsDX11_DeInit +@ stub agsDriverExtensionsDX11_Destroy +@ stub agsDriverExtensionsDX11_DestroyDevice @ stub agsDriverExtensionsDX11_EndUAVOverlap @ stub agsDriverExtensionsDX11_GetMaxClipRects @ stub agsDriverExtensionsDX11_IASetPrimitiveTopology @@ -22,8 +27,16 @@ @ stub agsDriverExtensionsDX11_SetDiskShaderCacheEnabled @ stub agsDriverExtensionsDX11_SetMaxAsyncCompileThreadCount @ stub agsDriverExtensionsDX11_SetViewBroadcastMasks +@ stub agsDriverExtensionsDX11_WriteBreadcrumb +@ stub agsDriverExtensionsDX12_CreateDevice +@ stub agsDriverExtensionsDX12_CreateFromDevice @ stub agsDriverExtensionsDX12_DeInit +@ stub agsDriverExtensionsDX12_Destroy +@ stub agsDriverExtensionsDX12_DestroyDevice @ stub agsDriverExtensionsDX12_Init +@ stub agsDriverExtensionsDX12_PopMarker +@ stub agsDriverExtensionsDX12_PushMarker +@ stub agsDriverExtensionsDX12_SetMarker @ stdcall agsGetCrossfireGPUCount(ptr ptr) @ stdcall agsInit(ptr ptr ptr) @ stub agsSetDisplayMode From 22635ce693735edc47702ac67a5365d2731659e1 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 16 Apr 2021 20:30:22 +0300 Subject: [PATCH 0456/2542] amd_ags_x64: Add partial stub for agsCheckDriverVersion(). For Forza Horizon 4. --- dlls/amd_ags_x64/amd_ags_x64.spec | 2 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index f483cc6380b6..6806b1457512 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -1,5 +1,5 @@ @ stdcall agsDeInit(ptr) -@ stub agsCheckDriverVersion +@ stdcall agsCheckDriverVersion(ptr long) @ stub agsDriverExtensionsDX11_BeginUAVOverlap @ stub agsDriverExtensionsDX11_CreateBuffer @ stub agsDriverExtensionsDX11_CreateDevice diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index b2f8149bcd84..d4bc099dedbd 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -356,6 +356,13 @@ AGSReturnCode WINAPI agsGetCrossfireGPUCount(AGSContext *context, int *gpu_count return AGS_SUCCESS; } +AGSDriverVersionResult WINAPI agsCheckDriverVersion(const char* version_reported, unsigned int version_required) +{ + FIXME("version_reported %s, version_required %d semi-stub.\n", debugstr_a(version_reported), version_required); + + return AGS_SOFTWAREVERSIONCHECK_OK; +} + BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) { TRACE("%p, %u, %p.\n", instance, reason, reserved); From 529bc673be4bca9a53199ceb1a8d088aace6fda3 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 16 Apr 2021 20:35:31 +0300 Subject: [PATCH 0457/2542] amd_ags_x64: Implement agsDriverExtensionsDX12_CreateDevice(). For Forza Horizon 4. --- dlls/amd_ags_x64/amd_ags_x64.spec | 2 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 43 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index 6806b1457512..7551a9346d83 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -28,7 +28,7 @@ @ stub agsDriverExtensionsDX11_SetMaxAsyncCompileThreadCount @ stub agsDriverExtensionsDX11_SetViewBroadcastMasks @ stub agsDriverExtensionsDX11_WriteBreadcrumb -@ stub agsDriverExtensionsDX12_CreateDevice +@ stdcall agsDriverExtensionsDX12_CreateDevice(ptr ptr ptr ptr) @ stub agsDriverExtensionsDX12_CreateFromDevice @ stub agsDriverExtensionsDX12_DeInit @ stub agsDriverExtensionsDX12_Destroy diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index d4bc099dedbd..f54b40da609f 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -52,6 +52,21 @@ struct AGSContext VkPhysicalDeviceMemoryProperties *memory_properties; }; +static HMODULE hd3d12; +static typeof(D3D12CreateDevice) *pD3D12CreateDevice; + +static BOOL load_d3d12_functions(void) +{ + if (hd3d12) + return TRUE; + + if (!(hd3d12 = LoadLibraryA("d3d12.dll"))) + return FALSE; + + pD3D12CreateDevice = (void *)GetProcAddress(hd3d12, "D3D12CreateDevice"); + return TRUE; +} + static AGSReturnCode vk_get_physical_device_properties(unsigned int *out_count, VkPhysicalDeviceProperties **out, VkPhysicalDeviceMemoryProperties **out_memory) { @@ -356,6 +371,34 @@ AGSReturnCode WINAPI agsGetCrossfireGPUCount(AGSContext *context, int *gpu_count return AGS_SUCCESS; } +AGSReturnCode WINAPI agsDriverExtensionsDX12_CreateDevice(AGSContext *context, + const AGSDX12DeviceCreationParams *creation_params, const AGSDX12ExtensionParams *extension_params, + AGSDX12ReturnedParams *returned_params) +{ + HRESULT hr; + + TRACE("feature level %#x, app %s, engine %s %#x %#x.\n", creation_params->FeatureLevel, debugstr_w(extension_params->pAppName), + debugstr_w(extension_params->pEngineName), extension_params->appVersion, extension_params->engineVersion); + + if (!load_d3d12_functions()) + { + ERR("Could not load d3d12.dll.\n"); + return AGS_MISSING_D3D_DLL; + } + + memset(returned_params, 0, sizeof(*returned_params)); + if (FAILED(hr = pD3D12CreateDevice((IUnknown *)creation_params->pAdapter, creation_params->FeatureLevel, + &creation_params->iid, (void **)&returned_params->pDevice))) + { + ERR("D3D12CreateDevice failed, hr %#x.\n", hr); + return AGS_DX_FAILURE; + } + + TRACE("Created d3d12 device %p.\n", returned_params->pDevice); + + return AGS_SUCCESS; +} + AGSDriverVersionResult WINAPI agsCheckDriverVersion(const char* version_reported, unsigned int version_required) { FIXME("version_reported %s, version_required %d semi-stub.\n", debugstr_a(version_reported), version_required); From 4d2da614964014d17cc358a1f0f28ae27a45bbf7 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 16 Apr 2021 17:29:31 +0300 Subject: [PATCH 0458/2542] amd_ags_x64: Fix devices array layout. And refactor multiple layout device structure handling on the way to avoid more switches in future patches. For Forza Horizon 4. --- dlls/amd_ags_x64/amd_ags.h | 10 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 152 +++++++++++++++------------- 2 files changed, 83 insertions(+), 79 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index 30f3735915c6..47ed5b91a144 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -498,13 +498,7 @@ typedef struct AGSDeviceInfo_541 int adlAdapterIndex; ///< Internally used index into the ADL list of adapters } AGSDeviceInfo_541; -typedef union AGSDeviceInfo -{ - AGSDeviceInfo_511 agsDeviceInfo511; - AGSDeviceInfo_520 agsDeviceInfo520; - AGSDeviceInfo_540 agsDeviceInfo540; - AGSDeviceInfo_541 agsDeviceInfo541; -} AGSDeviceInfo; +struct AGSDeviceInfo; /// \defgroup general General API functions /// API for initialization, cleanup, HDR display modes and Crossfire GPU count @@ -545,7 +539,7 @@ typedef struct AGSGPUInfo const char* radeonSoftwareVersion; ///< The Radeon Software Version int numDevices; ///< Number of GPUs in the system - AGSDeviceInfo* devices; ///< List of GPUs in the system + struct AGSDeviceInfo* devices; ///< List of GPUs in the system } AGSGPUInfo; /// The struct to specify the display settings to the driver. diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index f54b40da609f..1669f08fae7c 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -1,5 +1,6 @@ #include #include +#include #include "windef.h" #include "winbase.h" @@ -27,27 +28,74 @@ enum amd_ags_version AMD_AGS_VERSION_COUNT }; -struct +static const struct { int major; int minor; int patch; + unsigned int device_size; } -static const amd_ags_versions[AMD_AGS_VERSION_COUNT] = +amd_ags_info[AMD_AGS_VERSION_COUNT] = { - {5, 1, 1}, - {5, 2, 0}, - {5, 2, 1}, - {5, 3, 0}, - {5, 4, 0}, - {5, 4, 1}, + {5, 1, 1, sizeof(AGSDeviceInfo_511)}, + {5, 2, 0, sizeof(AGSDeviceInfo_520)}, + {5, 2, 1, sizeof(AGSDeviceInfo_520)}, + {5, 3, 0, sizeof(AGSDeviceInfo_520)}, + {5, 4, 0, sizeof(AGSDeviceInfo_540)}, + {5, 4, 1, sizeof(AGSDeviceInfo_541)}, }; +#define DEF_FIELD(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ + offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ + offsetof(AGSDeviceInfo_541, name)}} +#define DEF_FIELD_520_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ + offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), -1, \ + -1}} +#define DEF_FIELD_540_UP(name) {DEVICE_FIELD_##name, {-1, -1, \ + -1, -1, offsetof(AGSDeviceInfo_540, name), \ + offsetof(AGSDeviceInfo_541, name)}} + +#define DEVICE_FIELD_adapterString 0 +#define DEVICE_FIELD_architectureVersion 1 +#define DEVICE_FIELD_asicFamily 2 +#define DEVICE_FIELD_vendorId 3 +#define DEVICE_FIELD_deviceId 4 +#define DEVICE_FIELD_isPrimaryDevice 5 +#define DEVICE_FIELD_localMemoryInBytes 6 + +static const struct +{ + unsigned int field_index; + int offset[AMD_AGS_VERSION_COUNT]; +} +device_struct_fields[] = +{ + DEF_FIELD(adapterString), + DEF_FIELD_520_BELOW(architectureVersion), + DEF_FIELD_540_UP(asicFamily), + DEF_FIELD(vendorId), + DEF_FIELD(deviceId), + DEF_FIELD(isPrimaryDevice), + DEF_FIELD(localMemoryInBytes), +}; + +#undef DEF_FIELD + +#define GET_DEVICE_FIELD_ADDR(device, name, type, version) \ + (device_struct_fields[DEVICE_FIELD_##name].offset[version] == -1 ? NULL \ + : (type *)((BYTE *)device + device_struct_fields[DEVICE_FIELD_##name].offset[version])) + +#define SET_DEVICE_FIELD(device, name, type, version, value) { \ + type *addr; \ + if ((addr = GET_DEVICE_FIELD_ADDR(device, name, type, version))) \ + *addr = value; \ + } + struct AGSContext { enum amd_ags_version version; unsigned int device_count; - AGSDeviceInfo *devices; + struct AGSDeviceInfo *devices; VkPhysicalDeviceProperties *properties; VkPhysicalDeviceMemoryProperties *memory_properties; }; @@ -190,11 +238,11 @@ static enum amd_ags_version determine_ags_version(void) patch = info->dwFileVersionLS >> 16; TRACE("Found amd_ags_x64.dll v%d.%d.%d\n", major, minor, patch); - for (i = 0; i < ARRAY_SIZE(amd_ags_versions); i++) + for (i = 0; i < ARRAY_SIZE(amd_ags_info); i++) { - if ((major == amd_ags_versions[i].major) && - (minor == amd_ags_versions[i].minor) && - (patch == amd_ags_versions[i].patch)) + if ((major == amd_ags_info[i].major) && + (minor == amd_ags_info[i].minor) && + (patch == amd_ags_info[i].patch)) { ret = i; break; @@ -204,7 +252,7 @@ static enum amd_ags_version determine_ags_version(void) done: heap_free(infobuf); TRACE("Using AGS v%d.%d.%d interface\n", - amd_ags_versions[ret].major, amd_ags_versions[ret].minor, amd_ags_versions[ret].patch); + amd_ags_info[ret].major, amd_ags_info[ret].minor, amd_ags_info[ret].patch); return ret; } @@ -212,6 +260,7 @@ static AGSReturnCode init_ags_context(AGSContext *context) { AGSReturnCode ret; unsigned int i, j; + BYTE *device; context->version = determine_ags_version(); context->device_count = 0; @@ -223,7 +272,9 @@ static AGSReturnCode init_ags_context(AGSContext *context) if (ret != AGS_SUCCESS || !context->device_count) return ret; - if (!(context->devices = heap_calloc(context->device_count, sizeof(*context->devices)))) + assert(context->version < AMD_AGS_VERSION_COUNT); + + if (!(context->devices = heap_calloc(context->device_count, amd_ags_info[context->version].device_size))) { WARN("Failed to allocate memory.\n"); heap_free(context->properties); @@ -231,11 +282,11 @@ static AGSReturnCode init_ags_context(AGSContext *context) return AGS_OUT_OF_MEMORY; } + device = (BYTE *)context->devices; for (i = 0; i < context->device_count; ++i) { const VkPhysicalDeviceProperties *vk_properties = &context->properties[i]; const VkPhysicalDeviceMemoryProperties *vk_memory_properties = &context->memory_properties[i]; - AGSDeviceInfo *device = &context->devices[i]; VkDeviceSize local_memory_size = 0; for (j = 0; j < vk_memory_properties->memoryHeapCount; j++) @@ -248,60 +299,19 @@ static AGSReturnCode init_ags_context(AGSContext *context) } TRACE("reporting local memory size 0x%s bytes\n", wine_dbgstr_longlong(local_memory_size)); - switch (context->version) + SET_DEVICE_FIELD(device, adapterString, const char *, context->version, vk_properties->deviceName); + SET_DEVICE_FIELD(device, vendorId, int, context->version, vk_properties->vendorID); + SET_DEVICE_FIELD(device, deviceId, int, context->version, vk_properties->deviceID); + if (vk_properties->vendorID == 0x1002) { - case AMD_AGS_VERSION_5_1_1: - device->agsDeviceInfo511.adapterString = vk_properties->deviceName; - device->agsDeviceInfo511.vendorId = vk_properties->vendorID; - device->agsDeviceInfo511.deviceId = vk_properties->deviceID; - device->agsDeviceInfo511.localMemoryInBytes = local_memory_size; - - if (device->agsDeviceInfo511.vendorId == 0x1002) - device->agsDeviceInfo511.architectureVersion = ArchitectureVersion_GCN; - - if (!i) - device->agsDeviceInfo511.isPrimaryDevice = 1; - break; - case AMD_AGS_VERSION_5_2_0: - case AMD_AGS_VERSION_5_2_1: - case AMD_AGS_VERSION_5_3_0: - device->agsDeviceInfo520.adapterString = vk_properties->deviceName; - device->agsDeviceInfo520.vendorId = vk_properties->vendorID; - device->agsDeviceInfo520.deviceId = vk_properties->deviceID; - device->agsDeviceInfo520.localMemoryInBytes = local_memory_size; - - if (device->agsDeviceInfo520.vendorId == 0x1002) - device->agsDeviceInfo520.architectureVersion = ArchitectureVersion_GCN; - - if (!i) - device->agsDeviceInfo520.isPrimaryDevice = 1; - break; - case AMD_AGS_VERSION_5_4_0: - device->agsDeviceInfo540.adapterString = vk_properties->deviceName; - device->agsDeviceInfo540.vendorId = vk_properties->vendorID; - device->agsDeviceInfo540.deviceId = vk_properties->deviceID; - device->agsDeviceInfo540.localMemoryInBytes = local_memory_size; - - if (device->agsDeviceInfo540.vendorId == 0x1002) - device->agsDeviceInfo540.asicFamily = AsicFamily_GCN4; - - if (!i) - device->agsDeviceInfo540.isPrimaryDevice = 1; - break; - case AMD_AGS_VERSION_5_4_1: - default: - device->agsDeviceInfo541.adapterString = vk_properties->deviceName; - device->agsDeviceInfo541.vendorId = vk_properties->vendorID; - device->agsDeviceInfo541.deviceId = vk_properties->deviceID; - device->agsDeviceInfo541.localMemoryInBytes = local_memory_size; - - if (device->agsDeviceInfo541.vendorId == 0x1002) - device->agsDeviceInfo541.asicFamily = AsicFamily_GCN4; - - if (!i) - device->agsDeviceInfo541.isPrimaryDevice = 1; - break; + SET_DEVICE_FIELD(device, architectureVersion, ArchitectureVersion, context->version, ArchitectureVersion_GCN); + SET_DEVICE_FIELD(device, asicFamily, AsicFamily, context->version, AsicFamily_GCN4); } + SET_DEVICE_FIELD(device, localMemoryInBytes, ULONG64, context->version, local_memory_size); + if (!i) + SET_DEVICE_FIELD(device, isPrimaryDevice, int, context->version, 1); + + device += amd_ags_info[context->version].device_size; } return AGS_SUCCESS; @@ -330,9 +340,9 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi } memset(gpu_info, 0, sizeof(*gpu_info)); - gpu_info->agsVersionMajor = amd_ags_versions[object->version].major; - gpu_info->agsVersionMinor = amd_ags_versions[object->version].minor; - gpu_info->agsVersionPatch = amd_ags_versions[object->version].patch; + gpu_info->agsVersionMajor = amd_ags_info[object->version].major; + gpu_info->agsVersionMinor = amd_ags_info[object->version].minor; + gpu_info->agsVersionPatch = amd_ags_info[object->version].patch; gpu_info->driverVersion = "20.20.2-180516a-328911C-RadeonSoftwareAdrenalin"; gpu_info->radeonSoftwareVersion = "20.20.2"; gpu_info->numDevices = object->device_count; From a0bf67d476ad9a395ebf56815a9343847795c4bb Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 16 Apr 2021 19:33:36 +0300 Subject: [PATCH 0459/2542] amd_ags_x64: Fill display info in AGS context. For Forza Horizon 4. --- dlls/amd_ags_x64/Makefile.in | 2 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 130 +++++++++++++++++++++++++++- 2 files changed, 130 insertions(+), 2 deletions(-) diff --git a/dlls/amd_ags_x64/Makefile.in b/dlls/amd_ags_x64/Makefile.in index 5cd98895ff67..74253dcf5fd3 100644 --- a/dlls/amd_ags_x64/Makefile.in +++ b/dlls/amd_ags_x64/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = amd_ags_x64.dll -IMPORTS = version vulkan-1 +IMPORTS = version vulkan-1 user32 IMPORTLIB = amd_ags_x64 EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 1669f08fae7c..0b56fdf477c3 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -62,6 +62,8 @@ amd_ags_info[AMD_AGS_VERSION_COUNT] = #define DEVICE_FIELD_deviceId 4 #define DEVICE_FIELD_isPrimaryDevice 5 #define DEVICE_FIELD_localMemoryInBytes 6 +#define DEVICE_FIELD_numDisplays 7 +#define DEVICE_FIELD_displays 8 static const struct { @@ -77,6 +79,8 @@ device_struct_fields[] = DEF_FIELD(deviceId), DEF_FIELD(isPrimaryDevice), DEF_FIELD(localMemoryInBytes), + DEF_FIELD(numDisplays), + DEF_FIELD(displays), }; #undef DEF_FIELD @@ -256,6 +260,116 @@ static enum amd_ags_version determine_ags_version(void) return ret; } +struct monitor_enum_context +{ + const char *adapter_name; + AGSDisplayInfo **ret_displays; + int *ret_display_count; +}; + +static BOOL WINAPI monitor_enum_proc(HMONITOR hmonitor, HDC hdc, RECT *rect, LPARAM context) +{ + struct monitor_enum_context *c = (struct monitor_enum_context *)context; + MONITORINFOEXA monitor_info; + AGSDisplayInfo *new_alloc; + DISPLAY_DEVICEA device; + AGSDisplayInfo *info; + unsigned int i, mode; + DEVMODEA dev_mode; + + + monitor_info.cbSize = sizeof(monitor_info); + GetMonitorInfoA(hmonitor, (MONITORINFO *)&monitor_info); + TRACE("monitor_info.szDevice %s.\n", debugstr_a(monitor_info.szDevice)); + + device.cb = sizeof(device); + i = 0; + while (EnumDisplayDevicesA(NULL, i, &device, 0)) + { + TRACE("device.DeviceName %s, device.DeviceString %s.\n", debugstr_a(device.DeviceName), debugstr_a(device.DeviceString)); + ++i; + if (strcmp(device.DeviceString, c->adapter_name) || strcmp(device.DeviceName, monitor_info.szDevice)) + continue; + + if (*c->ret_display_count) + { + if (!(new_alloc = heap_realloc(*c->ret_displays, sizeof(*new_alloc) * (*c->ret_display_count + 1)))) + { + ERR("No memory."); + return FALSE; + } + *c->ret_displays = new_alloc; + } + else if (!(*c->ret_displays = heap_alloc(sizeof(**c->ret_displays)))) + { + ERR("No memory."); + return FALSE; + } + info = &(*c->ret_displays)[*c->ret_display_count]; + memset(info, 0, sizeof(*info)); + strcpy(info->displayDeviceName, device.DeviceName); + if (EnumDisplayDevicesA(info->displayDeviceName, 0, &device, 0)) + { + strcpy(info->name, device.DeviceString); + } + else + { + ERR("Could not get monitor name for device %s.\n", debugstr_a(info->displayDeviceName)); + strcpy(info->name, "Unknown"); + } + if (monitor_info.dwFlags & MONITORINFOF_PRIMARY) + info->displayFlags |= AGS_DISPLAYFLAG_PRIMARY_DISPLAY; + + mode = 0; + memset(&dev_mode, 0, sizeof(dev_mode)); + dev_mode.dmSize = sizeof(dev_mode); + while (EnumDisplaySettingsExA(monitor_info.szDevice, mode, &dev_mode, EDS_RAWMODE)) + { + ++mode; + if (dev_mode.dmPelsWidth > info->maxResolutionX) + info->maxResolutionX = dev_mode.dmPelsWidth; + if (dev_mode.dmPelsHeight > info->maxResolutionY) + info->maxResolutionY = dev_mode.dmPelsHeight; + if (dev_mode.dmDisplayFrequency > info->maxRefreshRate) + info->maxRefreshRate = dev_mode.dmDisplayFrequency; + memset(&dev_mode, 0, sizeof(dev_mode)); + dev_mode.dmSize = sizeof(dev_mode); + } + + info->currentResolution.offsetX = monitor_info.rcMonitor.left; + info->currentResolution.offsetY = monitor_info.rcMonitor.top; + info->currentResolution.width = monitor_info.rcMonitor.right - monitor_info.rcMonitor.left; + info->currentResolution.height = monitor_info.rcMonitor.bottom - monitor_info.rcMonitor.top; + info->visibleResolution = info->currentResolution; + + memset(&dev_mode, 0, sizeof(dev_mode)); + dev_mode.dmSize = sizeof(dev_mode); + + if (EnumDisplaySettingsExA(monitor_info.szDevice, ENUM_CURRENT_SETTINGS, &dev_mode, EDS_RAWMODE)) + info->currentRefreshRate = dev_mode.dmDisplayFrequency; + else + ERR("Could not get current display settings.\n"); + ++*c->ret_display_count; + + TRACE("Added display %s for %s.\n", debugstr_a(monitor_info.szDevice), debugstr_a(c->adapter_name)); + } + + return TRUE; +} + +static void init_device_displays(const char *adapter_name, AGSDisplayInfo **ret_displays, int *ret_display_count) +{ + struct monitor_enum_context context; + + TRACE("adapter_name %s.\n", debugstr_a(adapter_name)); + + context.adapter_name = adapter_name; + context.ret_displays = ret_displays; + context.ret_display_count = ret_display_count; + + EnumDisplayMonitors(NULL, NULL, monitor_enum_proc, (LPARAM)&context); +} + static AGSReturnCode init_ags_context(AGSContext *context) { AGSReturnCode ret; @@ -297,7 +411,8 @@ static AGSReturnCode init_ags_context(AGSContext *context) break; } } - TRACE("reporting local memory size 0x%s bytes\n", wine_dbgstr_longlong(local_memory_size)); + TRACE("device %s, %04x:%04x, reporting local memory size 0x%s bytes\n", debugstr_a(vk_properties->deviceName), + vk_properties->vendorID, vk_properties->deviceID, wine_dbgstr_longlong(local_memory_size)); SET_DEVICE_FIELD(device, adapterString, const char *, context->version, vk_properties->deviceName); SET_DEVICE_FIELD(device, vendorId, int, context->version, vk_properties->vendorID); @@ -311,6 +426,10 @@ static AGSReturnCode init_ags_context(AGSContext *context) if (!i) SET_DEVICE_FIELD(device, isPrimaryDevice, int, context->version, 1); + init_device_displays(vk_properties->deviceName, + GET_DEVICE_FIELD_ADDR(device, displays, AGSDisplayInfo *, context->version), + GET_DEVICE_FIELD_ADDR(device, numDisplays, int, context->version)); + device += amd_ags_info[context->version].device_size; } @@ -357,12 +476,21 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi AGSReturnCode WINAPI agsDeInit(AGSContext *context) { + unsigned int i; + BYTE *device; + TRACE("context %p.\n", context); if (context) { heap_free(context->memory_properties); heap_free(context->properties); + device = (BYTE *)context->devices; + for (i = 0; i < context->device_count; ++i) + { + heap_free(*GET_DEVICE_FIELD_ADDR(device, displays, AGSDisplayInfo *, context->version)); + device += amd_ags_info[context->version].device_size; + } heap_free(context->devices); heap_free(context); } From a95c04dfea10b7ff7dc8c5d002a92e822b7840dd Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 16 Apr 2021 20:03:12 +0300 Subject: [PATCH 0460/2542] amd_ags_x64: Bump driver version. For Forza Horizon 4. --- dlls/amd_ags_x64/amd_ags_x64_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 0b56fdf477c3..3a4dafa7a3a8 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -462,8 +462,8 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi gpu_info->agsVersionMajor = amd_ags_info[object->version].major; gpu_info->agsVersionMinor = amd_ags_info[object->version].minor; gpu_info->agsVersionPatch = amd_ags_info[object->version].patch; - gpu_info->driverVersion = "20.20.2-180516a-328911C-RadeonSoftwareAdrenalin"; - gpu_info->radeonSoftwareVersion = "20.20.2"; + gpu_info->driverVersion = "20.50.03.05-210326a-365573E-RadeonSoftwareAdrenalin2020"; + gpu_info->radeonSoftwareVersion = "21.3.2"; gpu_info->numDevices = object->device_count; gpu_info->devices = object->devices; From 3d41904bdf1c1977f0d61e53b1ff52c7746ce327 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Sat, 8 May 2021 04:39:30 +0100 Subject: [PATCH 0461/2542] amd_ags_x64: Implement agsDriverExtensionsDX12_DestroyDevice Signed-off-by: Joshua Ashton --- dlls/amd_ags_x64/amd_ags_x64.spec | 2 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index 7551a9346d83..ae825462f282 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -32,7 +32,7 @@ @ stub agsDriverExtensionsDX12_CreateFromDevice @ stub agsDriverExtensionsDX12_DeInit @ stub agsDriverExtensionsDX12_Destroy -@ stub agsDriverExtensionsDX12_DestroyDevice +@ stdcall agsDriverExtensionsDX12_DestroyDevice(ptr ptr ptr) @ stub agsDriverExtensionsDX12_Init @ stub agsDriverExtensionsDX12_PopMarker @ stub agsDriverExtensionsDX12_PushMarker diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 3a4dafa7a3a8..81942e4041e9 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -9,6 +9,7 @@ #include "wine/vulkan.h" +#define COBJMACROS #include "d3d11.h" #include "d3d12.h" @@ -537,6 +538,20 @@ AGSReturnCode WINAPI agsDriverExtensionsDX12_CreateDevice(AGSContext *context, return AGS_SUCCESS; } +AGSReturnCode WINAPI agsDriverExtensionsDX12_DestroyDevice(AGSContext* context, ID3D12Device* device, unsigned int* device_refs) +{ + ULONG ref_count; + + if (!device) + return AGS_SUCCESS; + + ref_count = ID3D12Device_Release(device); + if (device_refs) + *device_refs = (unsigned int)ref_count; + + return AGS_SUCCESS; +} + AGSDriverVersionResult WINAPI agsCheckDriverVersion(const char* version_reported, unsigned int version_required) { FIXME("version_reported %s, version_required %d semi-stub.\n", debugstr_a(version_reported), version_required); From 6750683f0f1c0953c683baafc57ab997d2719b09 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Sat, 8 May 2021 04:41:40 +0100 Subject: [PATCH 0462/2542] amd_ags_x64: Implement AGS 5.4.2 Signed-off-by: Joshua Ashton --- dlls/amd_ags_x64/amd_ags.h | 46 ++++++++++++++++++++++++++++- dlls/amd_ags_x64/amd_ags_x64_main.c | 8 +++-- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index 47ed5b91a144..0656e3fbbb33 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -34,6 +34,13 @@ /// \endinternal /// /// --------------------------------------- +/// What's new in AGS 5.4.2 since version 5.4.1 +/// --------------------------------------- +/// AGS 5.4.2 includes the following updates: +/// * sharedMemoryInBytes has been reinstated. +/// * Clock speed returned for APUs. +/// +/// --------------------------------------- /// What's new in AGS 5.4.1 since version 5.4.0 /// --------------------------------------- /// AGS 5.4.1 includes the following updates: @@ -130,7 +137,7 @@ #define AMD_AGS_VERSION_MAJOR 5 ///< AGS major version #define AMD_AGS_VERSION_MINOR 4 ///< AGS minor version -#define AMD_AGS_VERSION_PATCH 1 ///< AGS patch version +#define AMD_AGS_VERSION_PATCH 2 ///< AGS patch version #ifdef __cplusplus extern "C" { @@ -498,6 +505,43 @@ typedef struct AGSDeviceInfo_541 int adlAdapterIndex; ///< Internally used index into the ADL list of adapters } AGSDeviceInfo_541; +/// The device info struct used to describe a physical GPU enumerated by AGS +typedef struct AGSDeviceInfo_542 +{ + const char* adapterString; ///< The adapter name string + AsicFamily asicFamily; ///< Set to Unknown if not AMD hardware + int isAPU; ///< Whether or not this is an APU + int vendorId; ///< The vendor id + int deviceId; ///< The device id + int revisionId; ///< The revision id + + int numCUs; ///< Number of compute units. + int numWGPs; ///< Number of RDNA Work Group Processors. Only valid if ASIC is RDNA onwards. + + int numROPs; ///< Number of ROPs + int coreClock; ///< Core clock speed at 100% power in MHz + int memoryClock; ///< Memory clock speed at 100% power in MHz + int memoryBandwidth; ///< Memory bandwidth in MB/s + float teraFlops; ///< Teraflops of GPU. Zero if not GCN onwards. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD + + int isPrimaryDevice; ///< Whether or not this is the primary adapter in the system. Not set on the WACK version. + unsigned long long localMemoryInBytes; ///< The size of local memory in bytes. 0 for non AMD hardware. + unsigned long long sharedMemoryInBytes; ///< The size of system memory available to the GPU in bytes. It is important to factor this into your VRAM budget for APUs + ///< as the reported local memory will only be a small fraction of the total memory available to the GPU. + + int numDisplays; ///< The number of active displays found to be attached to this adapter. + AGSDisplayInfo* displays; ///< List of displays allocated by AGS to be numDisplays in length. + + int eyefinityEnabled; ///< Indicates if Eyefinity is active + int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityGridHeight; ///< Contains height of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityResolutionX; ///< Contains width in pixels of the multi-monitor Single Large Surface. + int eyefinityResolutionY; ///< Contains height in pixels of the multi-monitor Single Large Surface. + int eyefinityBezelCompensated; ///< Indicates if bezel compensation is used for the current SLS display area. 1 if enabled, and 0 if disabled. + + int adlAdapterIndex; ///< Internally used index into the ADL list of adapters +} AGSDeviceInfo_542; + struct AGSDeviceInfo; /// \defgroup general General API functions diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 81942e4041e9..750401a845e2 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -25,6 +25,7 @@ enum amd_ags_version AMD_AGS_VERSION_5_3_0, AMD_AGS_VERSION_5_4_0, AMD_AGS_VERSION_5_4_1, + AMD_AGS_VERSION_5_4_2, AMD_AGS_VERSION_COUNT }; @@ -44,17 +45,18 @@ amd_ags_info[AMD_AGS_VERSION_COUNT] = {5, 3, 0, sizeof(AGSDeviceInfo_520)}, {5, 4, 0, sizeof(AGSDeviceInfo_540)}, {5, 4, 1, sizeof(AGSDeviceInfo_541)}, + {5, 4, 2, sizeof(AGSDeviceInfo_542)}, }; #define DEF_FIELD(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ - offsetof(AGSDeviceInfo_541, name)}} + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name)}} #define DEF_FIELD_520_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), -1, \ - -1}} + -1, -1}} #define DEF_FIELD_540_UP(name) {DEVICE_FIELD_##name, {-1, -1, \ -1, -1, offsetof(AGSDeviceInfo_540, name), \ - offsetof(AGSDeviceInfo_541, name)}} + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name)}} #define DEVICE_FIELD_adapterString 0 #define DEVICE_FIELD_architectureVersion 1 From 20f4736de08c4c48350a3816909eb85f7b51568e Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Sat, 8 May 2021 05:14:39 +0100 Subject: [PATCH 0463/2542] amd_ags_x64: Implement AGS 6.0.0 Signed-off-by: Joshua Ashton --- dlls/amd_ags_x64/amd_ags.h | 409 +++++++++++++++++++++++----- dlls/amd_ags_x64/amd_ags_x64.spec | 3 + dlls/amd_ags_x64/amd_ags_x64_main.c | 137 ++++++++-- 3 files changed, 468 insertions(+), 81 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index 0656e3fbbb33..af9c48c1dd5b 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -34,6 +34,20 @@ /// \endinternal /// /// --------------------------------------- +/// What's new in AGS 6.0 since version 5.4.2 +/// --------------------------------------- +/// AGS 6.0 includes the following updates: +/// * DX12 ray tracing hit token for RDNA2 hardware. +/// * Shader intrinsic that exposes ReadLaneAt in DX12. +/// * Shader intrinsics that expose explicit float conversions in DX12. +/// * Refactored and revised API to minimize user error. +/// * Added agsGetVersionNumber. +/// * Detection for external GPUs. +/// * Detection of RDNA2 architecture. +/// * Grouped the more established intrinsics together into per year support. +/// * Function pointer typedefs for the API +/// +/// --------------------------------------- /// What's new in AGS 5.4.2 since version 5.4.1 /// --------------------------------------- /// AGS 5.4.2 includes the following updates: @@ -128,16 +142,16 @@ /// * Include the amd_ags.h header file from your source code. /// * Include the AGS hlsl files if you are using the shader intrinsics. /// * Declare a pointer to an AGSContext and make this available for all subsequent calls to AGS. -/// * On game initialization, call \ref agsInit passing in the address of the context. On success, this function will return a valid context pointer. +/// * On game initialization, call \ref agsInitialize passing in the address of the context. On success, this function will return a valid context pointer. /// -/// Don't forget to cleanup AGS by calling \ref agsDeInit when the app exits, after the device has been destroyed. +/// Don't forget to cleanup AGS by calling \ref agsDeInitialize when the app exits, after the device has been destroyed. #ifndef AMD_AGS_H #define AMD_AGS_H -#define AMD_AGS_VERSION_MAJOR 5 ///< AGS major version -#define AMD_AGS_VERSION_MINOR 4 ///< AGS minor version -#define AMD_AGS_VERSION_PATCH 2 ///< AGS patch version +#define AMD_AGS_VERSION_MAJOR 6 ///< AGS major version +#define AMD_AGS_VERSION_MINOR 0 ///< AGS minor version +#define AMD_AGS_VERSION_PATCH 0 ///< AGS patch version #ifdef __cplusplus extern "C" { @@ -151,14 +165,17 @@ extern "C" { #define AGS_UNSPECIFIED_VERSION 0xFFFFAD00 ///< Use this to specify no version /// @} -// Forward declaration of D3D11 types +// Forward declaration of D3D and DXGI types struct IDXGIAdapter; +struct IDXGISwapChain; +struct DXGI_SWAP_CHAIN_DESC; enum D3D_DRIVER_TYPE; enum D3D_FEATURE_LEVEL; -struct DXGI_SWAP_CHAIN_DESC; + enum D3D_PRIMITIVE_TOPOLOGY; + +// Forward declaration of D3D11 types struct ID3D11Device; struct ID3D11DeviceContext; -struct IDXGISwapChain; struct ID3D11Resource; struct ID3D11Buffer; struct ID3D11Texture1D; @@ -253,14 +270,6 @@ typedef enum AGSDriverExtensionDX12 /// The space id for DirectX12 intrinsic support const unsigned int AGS_DX12_SHADER_INSTRINSICS_SPACE_ID = 0x7FFF0ADE; // 2147420894 - -/// Additional topologies supported via extensions -typedef enum AGSPrimitiveTopology -{ - AGS_PRIMITIVE_TOPOLOGY_QUADLIST = 7, ///< Quad list - AGS_PRIMITIVE_TOPOLOGY_SCREENRECTLIST = 9 ///< Screen rect list -} AGSPrimitiveTopology; - /// The display flags describing various properties of the display. typedef enum AGSDisplayFlags { @@ -282,7 +291,7 @@ typedef enum AGSDisplaySettingsFlags /// @} -typedef struct AGSContext AGSContext; ///< All function calls in AGS require a pointer to a context. This is generated via \ref agsInit +typedef struct AGSContext AGSContext; ///< All function calls in AGS require a pointer to a context. This is generated via \ref agsInitialize /// The rectangle struct used by AGS. typedef struct AGSRect @@ -293,25 +302,64 @@ typedef struct AGSRect int height; ///< Height of rectangle } AGSRect; -/// The clip rectangle struct used by \ref agsDriverExtensionsDX11_SetClipRects -typedef struct AGSClipRect +/// The display info struct used to describe a display enumerated by AGS +typedef struct AGSDisplayInfo_511 { - /// The inclusion mode for the rect - enum - { - ClipRectIncluded = 0, ///< Include the rect - ClipRectExcluded = 1 ///< Exclude the rect - } mode; ; ///< Include/exclude rect region - AGSRect rect; ///< The rect to include/exclude -} AGSClipRect; + char name[ 256 ]; ///< The name of the display + char displayDeviceName[ 32 ]; ///< The display device name, i.e. DISPLAY_DEVICE::DeviceName + + unsigned int displayFlags; ///< Bitfield of \ref AGSDisplayFlags + + int maxResolutionX; ///< The maximum supported resolution of the unrotated display + int maxResolutionY; ///< The maximum supported resolution of the unrotated display + float maxRefreshRate; ///< The maximum supported refresh rate of the display + + AGSRect currentResolution; ///< The current resolution and position in the desktop, ignoring Eyefinity bezel compensation + AGSRect visibleResolution; ///< The visible resolution and position. When Eyefinity bezel compensation is enabled this will + ///< be the sub region in the Eyefinity single large surface (SLS) + float currentRefreshRate; ///< The current refresh rate + + int eyefinityGridCoordX; ///< The X coordinate in the Eyefinity grid. -1 if not in an Eyefinity group + int eyefinityGridCoordY; ///< The Y coordinate in the Eyefinity grid. -1 if not in an Eyefinity group + + double chromaticityRedX; ///< Red display primary X coord + double chromaticityRedY; ///< Red display primary Y coord + + double chromaticityGreenX; ///< Green display primary X coord + double chromaticityGreenY; ///< Green display primary Y coord + + double chromaticityBlueX; ///< Blue display primary X coord + double chromaticityBlueY; ///< Blue display primary Y coord + + double chromaticityWhitePointX; ///< White point X coord + double chromaticityWhitePointY; ///< White point Y coord + + double screenDiffuseReflectance; ///< Percentage expressed between 0 - 1 + double screenSpecularReflectance; ///< Percentage expressed between 0 - 1 + + double minLuminance; ///< The minimum luminance of the display in nits + double maxLuminance; ///< The maximum luminance of the display in nits + double avgLuminance; ///< The average luminance of the display in nits + + int logicalDisplayIndex; ///< The internally used index of this display + int adlAdapterIndex; ///< The internally used ADL adapter index +} AGSDisplayInfo_511; /// The display info struct used to describe a display enumerated by AGS -typedef struct AGSDisplayInfo +typedef struct AGSDisplayInfo_600 { char name[ 256 ]; ///< The name of the display char displayDeviceName[ 32 ]; ///< The display device name, i.e. DISPLAY_DEVICE::DeviceName - unsigned int displayFlags; ///< Bitfield of \ref AGSDisplayFlags + unsigned int isPrimaryDisplay : 1; ///< Whether this display is marked as the primary display + unsigned int HDR10 : 1; ///< HDR10 is supported on this display + unsigned int dolbyVision : 1; ///< Dolby Vision is supported on this display + unsigned int freesync : 1; ///< Freesync is supported on this display + unsigned int freesyncHDR : 1; ///< Freesync HDR is supported on this display + unsigned int eyefinityInGroup : 1; ///< The display is part of the Eyefinity group + unsigned int eyefinityPreferredDisplay : 1; ///< The display is the preferred display in the Eyefinity group for displaying the UI + unsigned int eyefinityInPortraitMode : 1; ///< The display is in the Eyefinity group but in portrait mode + unsigned int reservedPadding : 24; ///< Reserved for future use int maxResolutionX; ///< The maximum supported resolution of the unrotated display int maxResolutionY; ///< The maximum supported resolution of the unrotated display @@ -346,7 +394,8 @@ typedef struct AGSDisplayInfo int logicalDisplayIndex; ///< The internally used index of this display int adlAdapterIndex; ///< The internally used ADL adapter index -} AGSDisplayInfo; + int reserved; ///< reserved field +} AGSDisplayInfo_600; /// The architecture version typedef enum ArchitectureVersion @@ -367,6 +416,7 @@ typedef enum AsicFamily AsicFamily_GCN4, ///< AMD GCN 4 architecture: Polaris. AsicFamily_Vega, ///< AMD Vega architecture, including Raven Ridge (ie AMD Ryzen CPU + AMD Vega GPU). AsicFamily_RDNA, ///< AMD RDNA architecture + AsicFamily_RDNA2, ///< AMD RDNA2 architecture AsicFamily_Count ///< Number of enumerated ASIC families } AsicFamily; @@ -389,7 +439,7 @@ typedef struct AGSDeviceInfo_511 long long localMemoryInBytes; ///< The size of local memory in bytes. 0 for non AMD hardware. int numDisplays; ///< The number of active displays found to be attached to this adapter. - AGSDisplayInfo* displays; ///< List of displays allocated by AGS to be numDisplays in length. + AGSDisplayInfo_511* displays; ///< List of displays allocated by AGS to be numDisplays in length. int eyefinityEnabled; ///< Indicates if Eyefinity is active int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. @@ -421,7 +471,7 @@ typedef struct AGSDeviceInfo_520 long long localMemoryInBytes; ///< The size of local memory in bytes. 0 for non AMD hardware. int numDisplays; ///< The number of active displays found to be attached to this adapter. - AGSDisplayInfo* displays; ///< List of displays allocated by AGS to be numDisplays in length. + AGSDisplayInfo_511* displays; ///< List of displays allocated by AGS to be numDisplays in length. int eyefinityEnabled; ///< Indicates if Eyefinity is active int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. @@ -458,7 +508,7 @@ typedef struct AGSDeviceInfo_540 ///< as the reported local memory will only be a small fraction of the total memory available to the GPU. int numDisplays; ///< The number of active displays found to be attached to this adapter. - AGSDisplayInfo* displays; ///< List of displays allocated by AGS to be numDisplays in length. + AGSDisplayInfo_511* displays; ///< List of displays allocated by AGS to be numDisplays in length. int eyefinityEnabled; ///< Indicates if Eyefinity is active int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. @@ -493,7 +543,7 @@ typedef struct AGSDeviceInfo_541 long long localMemoryInBytes; ///< The size of local memory in bytes. 0 for non AMD hardware. int numDisplays; ///< The number of active displays found to be attached to this adapter. - AGSDisplayInfo* displays; ///< List of displays allocated by AGS to be numDisplays in length. + AGSDisplayInfo_511* displays; ///< List of displays allocated by AGS to be numDisplays in length. int eyefinityEnabled; ///< Indicates if Eyefinity is active int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. @@ -530,7 +580,7 @@ typedef struct AGSDeviceInfo_542 ///< as the reported local memory will only be a small fraction of the total memory available to the GPU. int numDisplays; ///< The number of active displays found to be attached to this adapter. - AGSDisplayInfo* displays; ///< List of displays allocated by AGS to be numDisplays in length. + AGSDisplayInfo_511* displays; ///< List of displays allocated by AGS to be numDisplays in length. int eyefinityEnabled; ///< Indicates if Eyefinity is active int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. @@ -542,6 +592,47 @@ typedef struct AGSDeviceInfo_542 int adlAdapterIndex; ///< Internally used index into the ADL list of adapters } AGSDeviceInfo_542; +/// The device info struct used to describe a physical GPU enumerated by AGS +typedef struct AGSDeviceInfo_600 +{ + const char* adapterString; ///< The adapter name string + AsicFamily asicFamily; ///< Set to Unknown if not AMD hardware + unsigned int isAPU : 1; ///< Whether this device is an APU + unsigned int isPrimaryDevice : 1; ///< Whether this device is marked as the primary device + unsigned int isExternal :1; ///< Whether this device is a detachable, external device + unsigned int reservedPadding : 29; ///< Reserved for future use + + int vendorId; ///< The vendor id + int deviceId; ///< The device id + int revisionId; ///< The revision id + + int numCUs; ///< Number of compute units + int numWGPs; ///< Number of RDNA Work Group Processors. Only valid if ASIC is RDNA onwards. + + int numROPs; ///< Number of ROPs + int coreClock; ///< Core clock speed at 100% power in MHz + int memoryClock; ///< Memory clock speed at 100% power in MHz + int memoryBandwidth; ///< Memory bandwidth in MB/s + float teraFlops; ///< Teraflops of GPU. Zero if not GCN onwards. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD + + unsigned long long localMemoryInBytes; ///< The size of local memory in bytes. 0 for non AMD hardware. + unsigned long long sharedMemoryInBytes; ///< The size of system memory available to the GPU in bytes. It is important to factor this into your VRAM budget for APUs + ///< as the reported local memory will only be a small fraction of the total memory available to the GPU. + + int numDisplays; ///< The number of active displays found to be attached to this adapter. + AGSDisplayInfo_600* displays; ///< List of displays allocated by AGS to be numDisplays in length. + + int eyefinityEnabled; ///< Indicates if Eyefinity is active + int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityGridHeight; ///< Contains height of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityResolutionX; ///< Contains width in pixels of the multi-monitor Single Large Surface. + int eyefinityResolutionY; ///< Contains height in pixels of the multi-monitor Single Large Surface. + int eyefinityBezelCompensated; ///< Indicates if bezel compensation is used for the current SLS display area. 1 if enabled, and 0 if disabled. + + int adlAdapterIndex; ///< Internally used index into the ADL list of adapters + int reserved; ///< reserved field +} AGSDeviceInfo_600; + struct AGSDeviceInfo; /// \defgroup general General API functions @@ -552,7 +643,7 @@ typedef void* (__stdcall *AGS_ALLOC_CALLBACK_511)( int allocationSize ); ///< typedef void* (__stdcall *AGS_ALLOC_CALLBACK)( size_t allocationSize ); ///< AGS user defined allocation prototype typedef void (__stdcall *AGS_FREE_CALLBACK)( void* allocationPtr ); ///< AGS user defined free prototype -/// The configuration options that can be passed in to \ref agsInit +/// The configuration options that can be passed in to \ref agsInititalize typedef struct AGSConfiguration_511 { AGS_ALLOC_CALLBACK_511 allocCallback; ///< Optional memory allocation callback. If not supplied, malloc() is used @@ -571,8 +662,8 @@ typedef union AGSConfiguration AGSConfiguration_520 agsConfiguration520; } AGSConfiguration; -/// The top level GPU information returned from \ref agsInit -typedef struct AGSGPUInfo +/// The top level GPU information returned from \ref agsInitialize +typedef struct AGSGPUInfo_511 { int agsVersionMajor; ///< Major field of Major.Minor.Patch AGS version number int agsVersionMinor; ///< Minor field of Major.Minor.Patch AGS version number @@ -584,24 +675,35 @@ typedef struct AGSGPUInfo int numDevices; ///< Number of GPUs in the system struct AGSDeviceInfo* devices; ///< List of GPUs in the system -} AGSGPUInfo; +} AGSGPUInfo_511; -/// The struct to specify the display settings to the driver. -typedef struct AGSDisplaySettings +/// The top level GPU information returned from \ref agsInit +typedef struct AGSGPUInfo_600 { - /// The display mode - enum - { - Mode_SDR, ///< SDR mode - Mode_HDR10_PQ, ///< HDR10 PQ encoding, requiring a 1010102 UNORM swapchain and PQ encoding in the output shader. - Mode_HDR10_scRGB, ///< HDR10 scRGB, requiring an FP16 swapchain. Values of 1.0 == 80 nits, 125.0 == 10000 nits. - Mode_FreesyncHDR_scRGB, ///< Freesync HDR scRGB, requiring an FP16 swapchain. A value of 1.0 == 80 nits. - // Mode_FreesyncHDR_Gamma22 ADDED IN 5.3.0 - Mode_FreesyncHDR_Gamma22, ///< Freesync HDR Gamma 2.2, requiring a 1010102 UNORM swapchain. The output needs to be encoded to gamma 2.2. - Mode_DolbyVision, ///< Dolby Vision, requiring an 8888 UNORM swapchain + const char* driverVersion; ///< The AMD driver package version + const char* radeonSoftwareVersion; ///< The Radeon Software Version + + int numDevices; ///< Number of GPUs in the system + struct AGSDeviceInfo* devices; ///< List of GPUs in the system +} AGSGPUInfo_600; - Mode_Count ///< Number of enumerated display modes - } mode; ///< The display mode to set the display into +/// The display mode +typedef enum AGSDisplaySettings_Mode +{ + Mode_SDR, ///< SDR mode + Mode_HDR10_PQ, ///< HDR10 PQ encoding, requiring a 1010102 UNORM swapchain and PQ encoding in the output shader. + Mode_HDR10_scRGB, ///< HDR10 scRGB, requiring an FP16 swapchain. Values of 1.0 == 80 nits, 125.0 == 10000 nits. + Mode_FreesyncHDR_scRGB, ///< Freesync HDR scRGB, requiring an FP16 swapchain. A value of 1.0 == 80 nits. + Mode_FreesyncHDR_Gamma22, ///< Freesync HDR Gamma 2.2, requiring a 1010102 UNORM swapchain. The output needs to be encoded to gamma 2.2. + Mode_DolbyVision, ///< Dolby Vision, requiring an 8888 UNORM swapchain + + Mode_Count ///< Number of enumerated display modes +} AGSDisplaySettings_Mode; + +/// The struct to specify the display settings to the driver. +typedef struct AGSDisplaySettings_511 +{ + AGSDisplaySettings_Mode mode; ///< The display mode to set the display into double chromaticityRedX; ///< Red display primary X coord double chromaticityRedY; ///< Red display primary Y coord @@ -623,6 +725,39 @@ typedef struct AGSDisplaySettings // ADDED IN 5.2.0 int flags; ///< Bitfield of ::AGSDisplaySettingsFlags +} AGSDisplaySettings_511; + +/// The struct to specify the display settings to the driver. +typedef struct AGSDisplaySettings_600 +{ + AGSDisplaySettings_Mode mode; ///< The display mode to set the display into + + double chromaticityRedX; ///< Red display primary X coord + double chromaticityRedY; ///< Red display primary Y coord + + double chromaticityGreenX; ///< Green display primary X coord + double chromaticityGreenY; ///< Green display primary Y coord + + double chromaticityBlueX; ///< Blue display primary X coord + double chromaticityBlueY; ///< Blue display primary Y coord + + double chromaticityWhitePointX; ///< White point X coord + double chromaticityWhitePointY; ///< White point Y coord + + double minLuminance; ///< The minimum scene luminance in nits + double maxLuminance; ///< The maximum scene luminance in nits + + double maxContentLightLevel; ///< The maximum content light level in nits (MaxCLL) + double maxFrameAverageLightLevel; ///< The maximum frame average light level in nits (MaxFALL) + + unsigned int disableLocalDimming : 1; ///< Disables local dimming if possible + unsigned int reservedPadding : 31; ///< Reserved +} AGSDisplaySettings_600; + +typedef union AGSDisplaySettings +{ + AGSDisplaySettings_511 agsDisplaySettings511; + AGSDisplaySettings_600 agsDisplaySettings600; } AGSDisplaySettings; /// The result returned from \ref agsCheckDriverVersion @@ -642,6 +777,12 @@ typedef enum AGSDriverVersionResult /// AMD_AGS_API AGSDriverVersionResult agsCheckDriverVersion( const char* radeonSoftwareVersionReported, unsigned int radeonSoftwareVersionRequired ); +/// +/// Function to return the AGS version number. +/// +/// \return The version number made using AGS_MAKE_VERSION( AMD_AGS_VERSION_MAJOR, AMD_AGS_VERSION_MINOR, AMD_AGS_VERSION_PATCH ). +/// +AMD_AGS_API int agsGetVersionNumber( void ); /// /// Function used to initialize the AGS library. @@ -656,7 +797,23 @@ AMD_AGS_API AGSDriverVersionResult agsCheckDriverVersion( const char* radeonSoft /// \param [in] config Optional pointer to a AGSConfiguration struct to override the default library configuration. /// \param [out] gpuInfo Optional pointer to a AGSGPUInfo struct which will get filled in for all the GPUs in the system. /// -AMD_AGS_API AGSReturnCode agsInit( AGSContext** context, const AGSConfiguration* config, AGSGPUInfo* gpuInfo ); +AMD_AGS_API AGSReturnCode agsInit( AGSContext** context, const AGSConfiguration* config, AGSGPUInfo_511* gpuInfo ); + +/// +/// Function used to initialize the AGS library. +/// agsVersion must be specified as AGS_MAKE_VERSION( AMD_AGS_VERSION_MAJOR, AMD_AGS_VERSION_MINOR, AMD_AGS_VERSION_PATCH ) or the call will return \ref AGS_INVALID_ARGS. +/// Must be called prior to any of the subsequent AGS API calls. +/// Must be called prior to ID3D11Device or ID3D12Device creation. +/// \note The caller of this function should handle the possibility of the call failing in the cases below. One option is to do a vendor id check and only call \ref agsInitialize if there is an AMD GPU present. +/// \note This function will fail with \ref AGS_NO_AMD_DRIVER_INSTALLED if there is no AMD driver found on the system. +/// \note This function will fail with \ref AGS_LEGACY_DRIVER in Catalyst versions before 12.20. +/// +/// \param [in] agsVersion The API version specified using the \ref AGS_MAKE_VERSION macro. If this does not match the version in the binary this initialization call will fail. +/// \param [in] config Optional pointer to a AGSConfiguration struct to override the default library configuration. +/// \param [out] context Address of a pointer to a context. This function allocates a context on the heap which is then required for all subsequent API calls. +/// \param [out] gpuInfo Optional pointer to a AGSGPUInfo struct which will get filled in for all the GPUs in the system. +/// +AMD_AGS_API AGSReturnCode agsInitialize( int agsVersion, const AGSConfiguration* config, AGSContext** context, AGSGPUInfo_600* gpuInfo ); /// /// Function used to clean up the AGS library. @@ -665,6 +822,13 @@ AMD_AGS_API AGSReturnCode agsInit( AGSContext** context, const AGSConfiguration* /// AMD_AGS_API AGSReturnCode agsDeInit( AGSContext* context ); +/// +/// Function used to clean up the AGS library. +/// +/// \param [in] context Pointer to a context. This function will deallocate the context from the heap. +/// +AMD_AGS_API AGSReturnCode agsDeInitialize( AGSContext* context ); + /// /// Function used to query the number of GPUs used for Crossfire acceleration. /// This may be different from the total number of GPUs present in the system. @@ -685,7 +849,7 @@ AMD_AGS_API AGSReturnCode agsGetCrossfireGPUCount( AGSContext* context, int* num /// \note Freesync HDR Gamma 2.2 mode requires a 1010102 swapchain. /// \note Dolby Vision requires a 8888 UNORM swapchain. /// -/// \param [in] context Pointer to a context. This is generated by \ref agsInit +/// \param [in] context Pointer to a context. This is generated by \ref agsInitialize /// \param [in] deviceIndex The index of the device listed in \ref AGSGPUInfo::devices. /// \param [in] displayIndex The index of the display listed in \ref AGSDeviceInfo::displays. /// \param [in] settings Pointer to the display settings to use. @@ -726,6 +890,29 @@ typedef struct AGSDX12ExtensionParams typedef struct AGSDX12ReturnedParams { ID3D12Device* pDevice; ///< The newly created device + /* + This was changed to a struct in 6.0.0+ but it's still the size of an unsigned int. + Ignoring this change for now. + + typedef struct ExtensionsSupported /// Extensions for DX12 + { + unsigned int intrinsics16 : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. ReadFirstLane, ReadLane, LaneID, Swizzle, Ballot, MBCount, Med3, Barycentrics + unsigned int intrinsics17 : 1; ///< Supported in Radeon Software Version 17.9.1 onwards. WaveReduce, WaveScan + unsigned int userMarkers : 1; ///< Supported in Radeon Software Version 17.9.1 onwards. + unsigned int appRegistration : 1; ///< Supported in Radeon Software Version 17.9.1 onwards. + unsigned int UAVBindSlot : 1; ///< Supported in Radeon Software Version 19.5.1 onwards. + unsigned int intrinsics19 : 1; ///< Supported in Radeon Software Version 19.12.2 onwards. DrawIndex, AtomicU64 + unsigned int baseVertex : 1; ///< Supported in Radeon Software Version 20.2.1 onwards. + unsigned int baseInstance : 1; ///< Supported in Radeon Software Version 20.2.1 onwards. + unsigned int getWaveSize : 1; ///< Supported in Radeon Software Version 20.5.1 onwards. + unsigned int floatConversion : 1; ///< Supported in Radeon Software Version 20.5.1 onwards. + unsigned int readLaneAt : 1; ///< Supported in Radeon Software Version 20.11.1 onwards. + unsigned int rayHitToken : 1; ///< Supported in Radeon Software Version 20.11.1 onwards. + unsigned int padding : 20; ///< Reserved + } ExtensionsSupported; + ExtensionsSupported extensionsSupported; ///< List of supported extensions + */ + unsigned int extensionsSupported; ///< Bit mask that \ref agsDriverExtensionsDX12_CreateDevice will fill in to indicate which extensions are supported. See \ref AGSDriverExtensionDX12 } AGSDX12ReturnedParams; @@ -747,11 +934,11 @@ typedef struct AGSDX12ReturnedParams /// range[ 0 ].Init( D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 1, 0, AGS_DX12_SHADER_INSTRINSICS_SPACE_ID ); // u0 at driver-reserved space id /// \endcode /// -/// Newer drivers also support a user-specified slot in which case the register space id is assumed to be 0. It is important that the \ref AGS_DX12_EXTENSION_INTRINSIC_UAV_BIND_SLOT bit is set +/// Newer drivers also support a user-specified slot in which case the register space id is assumed to be 0. It is important that the \ref AGSDX12ReturnedParams::ExtensionsSupported::UAVBindSlot bit is set. /// to ensure the driver can support this. If not, then u0 and \ref AGS_DX12_SHADER_INSTRINSICS_SPACE_ID must be used. /// If the driver does support this feature and a non zero slot is required, then the HLSL must also define AMD_EXT_SHADER_INTRINSIC_UAV_OVERRIDE as the matching slot value. /// -/// \param [in] context Pointer to a context. This is generated by \ref agsInit +/// \param [in] context Pointer to a context. This is generated by \ref agsInitialize /// \param [in] creationParams Pointer to the struct to specify the existing DX12 device creation parameters. /// \param [in] extensionParams Optional pointer to the struct to specify DX12 additional device creation parameters. /// \param [out] returnedParams Pointer to struct to hold all the returned parameters from the call. @@ -777,7 +964,7 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_DestroyDevice( AGSContext* con /// * The intrinsic instructions require a 5.1 shader model. /// * The Root Signature will need to use an extra resource and sampler. These are not real resources/samplers, they are just used to encode the intrinsic instruction. /// -/// \param [in] context Pointer to a context. This is generated by \ref agsInit +/// \param [in] context Pointer to a context. This is generated by \ref agsInitialize /// \param [in] device The D3D12 device. /// \param [out] extensionsSupported Pointer to a bit mask that this function will fill in to indicate which extensions are supported. See ::AGSDriverExtensionDX12 /// @@ -799,7 +986,7 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_DeInit( AGSContext* context ); /// /// Function used to push an AMD user marker onto the command list. -/// This is only has an effect if \ref AGS_DX12_EXTENSION_USER_MARKERS is present in the extensionsSupported bitfield of \ref agsDriverExtensionsDX12_CreateDevice +/// This is only has an effect if \ref AGSDX12ReturnedParams::ExtensionsSupported::userMarkers is present. /// Supported in Radeon Software Version 17.9.1 onwards. /// /// \param [in] context Pointer to a context. @@ -912,10 +1099,47 @@ typedef struct AGSDX11ReturnedParams_520 void* breadcrumbBuffer; ///< The CPU buffer returned if the initialization of the breadcrumb was successful. } AGSDX11ReturnedParams_520; +typedef struct AGSDX11ExtensionsSupported_600 /// Extensions for DX11 +{ + unsigned int quadList : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. + unsigned int screenRectList : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. + unsigned int uavOverlap : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. + unsigned int depthBoundsTest : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. + unsigned int multiDrawIndirect : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. + unsigned int multiDrawIndirectCountIndirect : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. + unsigned int crossfireAPI : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. + unsigned int createShaderControls : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. + unsigned int intrinsics16 : 1; ///< Supported in Radeon Software Version 16.9.2 onwards. ReadFirstLane, ReadLane, LaneID, Swizzle, Ballot, MBCount, Med3, Barycentrics + unsigned int multiView : 1; ///< Supported in Radeon Software Version 16.12.1 onwards. + unsigned int intrinsics17 : 1; ///< Supported in Radeon Software Version 17.9.1 onwards. WaveReduce, WaveScan + unsigned int appRegistration : 1; ///< Supported in Radeon Software Version 17.9.1 onwards. + unsigned int breadcrumbMarkers : 1; ///< Supported in Radeon Software Version 17.11.1 onwards. + unsigned int MDIDeferredContexts : 1; ///< Supported in Radeon Software Version 18.8.1 onwards. + unsigned int UAVOverlapDeferredContexts : 1; ///< Supported in Radeon Software Version 18.8.1 onwards. + unsigned int depthBoundsDeferredContexts : 1; ///< Supported in Radeon Software Version 18.8.1 onwards. + unsigned int intrinsics19 : 1; ///< Supported in Radeon Software Version 19.12.2 onwards. DrawIndex, AtomicU64 + unsigned int getWaveSize : 1; ///< Supported in Radeon Software Version 20.2.1 onwards. + unsigned int baseVertex : 1; ///< Supported in Radeon Software Version 20.2.1 onwards. + unsigned int baseInstance : 1; ///< Supported in Radeon Software Version 20.2.1 onwards. + unsigned int padding : 12; ///< Reserved +} AGSDX11ExtensionsSupported_600; + +typedef struct AGSDX11ReturnedParams_600 +{ + ID3D11Device* pDevice; ///< The newly created device + ID3D11DeviceContext* pImmediateContext; ///< The newly created immediate device context + IDXGISwapChain* pSwapChain; ///< The newly created swap chain. This is only created if a valid pSwapChainDesc is supplied in AGSDX11DeviceCreationParams. + D3D_FEATURE_LEVEL featureLevel; ///< The feature level supported by the newly created device + AGSDX11ExtensionsSupported_600 extensionsSupported; ///< List of supported extensions + unsigned int crossfireGPUCount; ///< The number of GPUs that are active for this app + void* breadcrumbBuffer; ///< The CPU buffer returned if the initialization of the breadcrumb was successful +} AGSDX11ReturnedParams_600; + typedef union AGSDX11ReturnedParams { AGSDX11ReturnedParams_511 agsDX11ReturnedParams511; AGSDX11ReturnedParams_520 agsDX11ReturnedParams520; + AGSDX11ReturnedParams_600 agsDX11ReturnedParams600; } AGSDX11ReturnedParams; /// @@ -925,7 +1149,7 @@ typedef union AGSDX11ReturnedParams /// * The shader compiler should not use the D3DCOMPILE_SKIP_OPTIMIZATION (/Od) option, otherwise it will not work. /// * The shader compiler needs D3DCOMPILE_ENABLE_STRICTNESS (/Ges) enabled. /// -/// \param [in] context Pointer to a context. This is generated by \ref agsInit +/// \param [in] context Pointer to a context. This is generated by \ref agsInititalize /// \param [in] creationParams Pointer to the struct to specify the existing DX11 device creation parameters. /// \param [in] extensionParams Optional pointer to the struct to specify DX11 additional device creation parameters. /// \param [out] returnedParams Pointer to struct to hold all the returned parameters from the call. @@ -991,7 +1215,7 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_DestroyDevice_511( AGSContext* /// \defgroup breadcrumbs Breadcrumb API /// API for writing top-of-pipe and bottom-of-pipe markers to help track down GPU hangs. /// -/// The API is available if the \ref AGS_DX11_EXTENSION_BREADCRUMB_MARKERS is present in \ref AGSDX11ReturnedParams::extensionsSupported. +/// The API is available if the \ref AGSDX11ReturnedParams::ExtensionsSupported::breadcrumbMarkers is present. /// /// To use the API, a non zero value needs to be specificed in \ref AGSDX11ExtensionParams::numBreadcrumbMarkers. This enables the API (if available) and allocates a system memory buffer /// which is returned to the user in \ref AGSDX11ReturnedParams::breadcrumbBuffer. @@ -1197,6 +1421,13 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_WriteBreadcrumb( AGSContext* c /// API for primitive topologies /// @{ +/// Additional topologies supported via extensions +typedef enum AGSPrimitiveTopology +{ + AGS_PRIMITIVE_TOPOLOGY_QUADLIST = 7, ///< Quad list + AGS_PRIMITIVE_TOPOLOGY_SCREENRECTLIST = 9 ///< Screen rect list +} AGSPrimitiveTopology; + /// /// Function used to set the primitive topology. If you are using any of the extended topology types, then this function should /// be called to set ALL topology types. @@ -1447,6 +1678,22 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetViewBroadcastMasks( AGSCont /// AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_GetMaxClipRects( AGSContext* context, unsigned int* maxRectCount ); +/// The inclusion mode for the rect +typedef enum AGSClipRect_Mode +{ + ClipRectIncluded = 0, ///< Include the rect + ClipRectExcluded = 1 ///< Exclude the rect +} AGSClipRect_Mode; + +/// The clip rectangle struct used by \ref agsDriverExtensionsDX11_SetClipRects +typedef struct AGSClipRect +{ + AGSClipRect_Mode mode; ///< Include/exclude rect region + AGSRect rect; ///< The rect to include/exclude +} AGSClipRect; + + + /// /// Function sets clip rectangles. /// @@ -1563,6 +1810,46 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_NotifyResourceEndAllAccess( AG /// @} +/// \defgroup typedefs Function pointer typedefs +/// List of function pointer typedefs for the API +/// @{ + +typedef AMD_AGS_API AGSDriverVersionResult (*AGS_CHECKDRIVERVERSION)( const char*, unsigned int ); ///< \ref agsCheckDriverVersion +typedef AMD_AGS_API int (*AGS_GETVERSIONNUMBER)( void ); ///< \ref agsGetVersionNumber +typedef AMD_AGS_API AGSReturnCode (*AGS_INITIALIZE)( int, const AGSConfiguration*, AGSContext**, AGSGPUInfo_600* ); ///< \ref agsInitialize +typedef AMD_AGS_API AGSReturnCode (*AGS_DEINITIALIZE)( AGSContext* ); ///< \ref agsDeInitialize +typedef AMD_AGS_API AGSReturnCode (*AGS_SETDISPLAYMODE)( AGSContext*, int, int, const AGSDisplaySettings* ); ///< \ref agsSetDisplayMode +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX12_CREATEDEVICE)( AGSContext*, const AGSDX12DeviceCreationParams*, const AGSDX12ExtensionParams*, AGSDX12ReturnedParams* ); ///< \ref agsDriverExtensionsDX12_CreateDevice +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX12_DESTROYDEVICE)( AGSContext*, ID3D12Device*, unsigned int* ); ///< \ref agsDriverExtensionsDX12_DestroyDevice +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX12_PUSHMARKER)( AGSContext*, ID3D12GraphicsCommandList*, const char* ); ///< \ref agsDriverExtensionsDX12_PushMarker +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX12_POPMARKER)( AGSContext*, ID3D12GraphicsCommandList* ); ///< \ref agsDriverExtensionsDX12_PopMarker +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX12_SETMARKER)( AGSContext*, ID3D12GraphicsCommandList*, const char* ); ///< \ref agsDriverExtensionsDX12_SetMarker +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_CREATEDEVICE)( AGSContext*, const AGSDX11DeviceCreationParams*, const AGSDX11ExtensionParams*, AGSDX11ReturnedParams* ); ///< \ref agsDriverExtensionsDX11_CreateDevice +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_DESTROYDEVICE)( AGSContext*, ID3D11Device*, unsigned int*, ID3D11DeviceContext*, unsigned int* ); ///< \ref agsDriverExtensionsDX11_DestroyDevice +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_WRITEBREADCRUMB)( AGSContext*, const AGSBreadcrumbMarker* ); ///< \ref agsDriverExtensionsDX11_WriteBreadcrumb +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_IASETPRIMITIVETOPOLOGY)( AGSContext*, enum D3D_PRIMITIVE_TOPOLOGY ); ///< \ref agsDriverExtensionsDX11_IASetPrimitiveTopology +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_BEGINUAVOVERLAP)( AGSContext*, ID3D11DeviceContext* ); ///< \ref agsDriverExtensionsDX11_BeginUAVOverlap +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_ENDUAVOVERLAP)( AGSContext*, ID3D11DeviceContext* ); ///< \ref agsDriverExtensionsDX11_EndUAVOverlap +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_SETDEPTHBOUNDS)( AGSContext*, ID3D11DeviceContext*, bool, float, float ); ///< \ref agsDriverExtensionsDX11_SetDepthBounds +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_MULTIDRAWINSTANCEDINDIRECT)( AGSContext*, ID3D11DeviceContext*, unsigned int, ID3D11Buffer*, unsigned int, unsigned int ); ///< \ref agsDriverExtensionsDX11_MultiDrawInstancedIndirect +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_MULTIDRAWINDEXEDINSTANCEDINDIRECT)( AGSContext*, ID3D11DeviceContext*, unsigned int, ID3D11Buffer*, unsigned int, unsigned int ); ///< \ref agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_MULTIDRAWINSTANCEDINDIRECTCOUNTINDIRECT)( AGSContext*, ID3D11DeviceContext*, ID3D11Buffer*, unsigned int, ID3D11Buffer*, unsigned int, unsigned int ); ///< \ref agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_MULTIDRAWINDEXEDINSTANCEDINDIRECTCOUNTINDIRECT)( AGSContext*, ID3D11DeviceContext*, ID3D11Buffer*, unsigned int, ID3D11Buffer*, unsigned int, unsigned int ); ///< \ref agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_SETMAXASYNCCOMPILETHREADCOUNT)( AGSContext*, unsigned int ); ///< \ref agsDriverExtensionsDX11_SetMaxAsyncCompileThreadCount +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_NUMPENDINGASYNCOMPILEJOBS)( AGSContext*, unsigned int* ); ///< \ref agsDriverExtensionsDX11_NumPendingAsyncCompileJobs +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_SETDISKSHADERCACHEENABLED)( AGSContext*, int ); ///< \ref agsDriverExtensionsDX11_SetDiskShaderCacheEnabled +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_SETVIEWBROADCASTMASKS)( AGSContext*, unsigned long long, unsigned long long, int ); ///< \ref agsDriverExtensionsDX11_SetViewBroadcastMasks +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_GETMAXCLIPRECTS)( AGSContext*, unsigned int* ); ///< \ref agsDriverExtensionsDX11_GetMaxClipRects +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_SETCLIPRECTS)( AGSContext*, unsigned int, const AGSClipRect* ); ///< \ref agsDriverExtensionsDX11_SetClipRects +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_CREATEBUFFER)( AGSContext*, const D3D11_BUFFER_DESC*, const D3D11_SUBRESOURCE_DATA*, ID3D11Buffer**, AGSAfrTransferType, AGSAfrTransferEngine ); ///< \ref agsDriverExtensionsDX11_CreateBuffer +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_CREATETEXTURE1D)( AGSContext*, const D3D11_TEXTURE1D_DESC*, const D3D11_SUBRESOURCE_DATA*, ID3D11Texture1D**, AGSAfrTransferType, AGSAfrTransferEngine ); ///< \ref agsDriverExtensionsDX11_CreateTexture1D +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_CREATETEXTURE2D)( AGSContext*, const D3D11_TEXTURE2D_DESC*, const D3D11_SUBRESOURCE_DATA*, ID3D11Texture2D**, AGSAfrTransferType, AGSAfrTransferEngine ); ///< \ref agsDriverExtensionsDX11_CreateTexture2D +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_CREATETEXTURE3D)( AGSContext*, const D3D11_TEXTURE3D_DESC*, const D3D11_SUBRESOURCE_DATA*, ID3D11Texture3D**, AGSAfrTransferType, AGSAfrTransferEngine ); ///< \ref agsDriverExtensionsDX11_CreateTexture3D +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_NOTIFYRESOURCEENDWRITES)( AGSContext*, ID3D11Resource*, const D3D11_RECT*, const unsigned int*, unsigned int ); ///< \ref agsDriverExtensionsDX11_NotifyResourceEndWrites +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_NOTIFYRESOURCEBEGINALLACCESS)( AGSContext*, ID3D11Resource* ); ///< \ref agsDriverExtensionsDX11_NotifyResourceBeginAllAccess +typedef AMD_AGS_API AGSReturnCode (*AGS_DRIVEREXTENSIONSDX11_NOTIFYRESOURCEENDALLACCESS)( AGSContext*, ID3D11Resource* ); ///< \ref agsDriverExtensionsDX11_NotifyResourceEndAllAccess +/// @} + #ifdef __cplusplus } // extern "C" #endif diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index ae825462f282..562c41033433 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -1,4 +1,5 @@ @ stdcall agsDeInit(ptr) +@ stdcall agsDeInitialize(ptr) @ stdcall agsCheckDriverVersion(ptr long) @ stub agsDriverExtensionsDX11_BeginUAVOverlap @ stub agsDriverExtensionsDX11_CreateBuffer @@ -38,5 +39,7 @@ @ stub agsDriverExtensionsDX12_PushMarker @ stub agsDriverExtensionsDX12_SetMarker @ stdcall agsGetCrossfireGPUCount(ptr ptr) +@ stdcall agsGetVersionNumber() @ stdcall agsInit(ptr ptr ptr) +@ stdcall agsInitialize(long ptr ptr ptr) @ stub agsSetDisplayMode diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 750401a845e2..88ce02f9e1b4 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -26,6 +26,7 @@ enum amd_ags_version AMD_AGS_VERSION_5_4_0, AMD_AGS_VERSION_5_4_1, AMD_AGS_VERSION_5_4_2, + AMD_AGS_VERSION_6_0_0, AMD_AGS_VERSION_COUNT }; @@ -46,17 +47,21 @@ amd_ags_info[AMD_AGS_VERSION_COUNT] = {5, 4, 0, sizeof(AGSDeviceInfo_540)}, {5, 4, 1, sizeof(AGSDeviceInfo_541)}, {5, 4, 2, sizeof(AGSDeviceInfo_542)}, + {6, 0, 0, sizeof(AGSDeviceInfo_600)}, }; #define DEF_FIELD(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ - offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name)}} + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name)}} #define DEF_FIELD_520_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), -1, \ - -1, -1}} + -1, -1, -1}} #define DEF_FIELD_540_UP(name) {DEVICE_FIELD_##name, {-1, -1, \ -1, -1, offsetof(AGSDeviceInfo_540, name), \ - offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name)}} + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name)}} +#define DEF_FIELD_600_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ + offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), -1}} #define DEVICE_FIELD_adapterString 0 #define DEVICE_FIELD_architectureVersion 1 @@ -80,7 +85,7 @@ device_struct_fields[] = DEF_FIELD_540_UP(asicFamily), DEF_FIELD(vendorId), DEF_FIELD(deviceId), - DEF_FIELD(isPrimaryDevice), + DEF_FIELD_600_BELOW(isPrimaryDevice), DEF_FIELD(localMemoryInBytes), DEF_FIELD(numDisplays), DEF_FIELD(displays), @@ -263,20 +268,20 @@ static enum amd_ags_version determine_ags_version(void) return ret; } -struct monitor_enum_context +struct monitor_enum_context_600 { const char *adapter_name; - AGSDisplayInfo **ret_displays; + AGSDisplayInfo_600 **ret_displays; int *ret_display_count; }; -static BOOL WINAPI monitor_enum_proc(HMONITOR hmonitor, HDC hdc, RECT *rect, LPARAM context) +static BOOL WINAPI monitor_enum_proc_600(HMONITOR hmonitor, HDC hdc, RECT *rect, LPARAM context) { - struct monitor_enum_context *c = (struct monitor_enum_context *)context; + struct monitor_enum_context_600 *c = (struct monitor_enum_context_600 *)context; MONITORINFOEXA monitor_info; - AGSDisplayInfo *new_alloc; + AGSDisplayInfo_600 *new_alloc; DISPLAY_DEVICEA device; - AGSDisplayInfo *info; + AGSDisplayInfo_600 *info; unsigned int i, mode; DEVMODEA dev_mode; @@ -321,7 +326,7 @@ static BOOL WINAPI monitor_enum_proc(HMONITOR hmonitor, HDC hdc, RECT *rect, LPA strcpy(info->name, "Unknown"); } if (monitor_info.dwFlags & MONITORINFOF_PRIMARY) - info->displayFlags |= AGS_DISPLAYFLAG_PRIMARY_DISPLAY; + info->isPrimaryDisplay = 1; mode = 0; memset(&dev_mode, 0, sizeof(dev_mode)); @@ -360,9 +365,9 @@ static BOOL WINAPI monitor_enum_proc(HMONITOR hmonitor, HDC hdc, RECT *rect, LPA return TRUE; } -static void init_device_displays(const char *adapter_name, AGSDisplayInfo **ret_displays, int *ret_display_count) +static void init_device_displays_600(const char *adapter_name, AGSDisplayInfo_600 **ret_displays, int *ret_display_count) { - struct monitor_enum_context context; + struct monitor_enum_context_600 context; TRACE("adapter_name %s.\n", debugstr_a(adapter_name)); @@ -370,9 +375,32 @@ static void init_device_displays(const char *adapter_name, AGSDisplayInfo **ret_ context.ret_displays = ret_displays; context.ret_display_count = ret_display_count; - EnumDisplayMonitors(NULL, NULL, monitor_enum_proc, (LPARAM)&context); + EnumDisplayMonitors(NULL, NULL, monitor_enum_proc_600, (LPARAM)&context); +} + +static void init_device_displays_511(const char *adapter_name, AGSDisplayInfo_511 **ret_displays, int *ret_display_count) +{ + AGSDisplayInfo_600 *displays = NULL; + int display_count = 0; + int i; + *ret_displays = NULL; + *ret_display_count = 0; + + init_device_displays_600(adapter_name, &displays, &display_count); + + if ((*ret_displays = heap_alloc(sizeof(**ret_displays) * display_count))) + { + for (i = 0; i < display_count; i++) + { + memcpy(&(*ret_displays)[i], &displays[i], sizeof(AGSDisplayInfo_511)); + } + *ret_display_count = display_count; + } + + heap_free(displays); } + static AGSReturnCode init_ags_context(AGSContext *context) { AGSReturnCode ret; @@ -427,11 +455,31 @@ static AGSReturnCode init_ags_context(AGSContext *context) } SET_DEVICE_FIELD(device, localMemoryInBytes, ULONG64, context->version, local_memory_size); if (!i) - SET_DEVICE_FIELD(device, isPrimaryDevice, int, context->version, 1); + { + if (context->version >= AMD_AGS_VERSION_6_0_0) + { + // This is a bitfield now... Nice... + struct AGSDeviceInfo_600 *device_600 = (struct AGSDeviceInfo_600 *)device; + device_600->isPrimaryDevice = 1; + } + else + { + SET_DEVICE_FIELD(device, isPrimaryDevice, int, context->version, 1); + } + } - init_device_displays(vk_properties->deviceName, - GET_DEVICE_FIELD_ADDR(device, displays, AGSDisplayInfo *, context->version), - GET_DEVICE_FIELD_ADDR(device, numDisplays, int, context->version)); + if (context->version >= AMD_AGS_VERSION_6_0_0) + { + init_device_displays_600(vk_properties->deviceName, + GET_DEVICE_FIELD_ADDR(device, displays, AGSDisplayInfo_600 *, context->version), + GET_DEVICE_FIELD_ADDR(device, numDisplays, int, context->version)); + } + else + { + init_device_displays_511(vk_properties->deviceName, + GET_DEVICE_FIELD_ADDR(device, displays, AGSDisplayInfo_511 *, context->version), + GET_DEVICE_FIELD_ADDR(device, numDisplays, int, context->version)); + } device += amd_ags_info[context->version].device_size; } @@ -439,7 +487,7 @@ static AGSReturnCode init_ags_context(AGSContext *context) return AGS_SUCCESS; } -AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *config, AGSGPUInfo *gpu_info) +AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *config, AGSGPUInfo_511 *gpu_info) { struct AGSContext *object; AGSReturnCode ret; @@ -477,7 +525,47 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi return AGS_SUCCESS; } +AGSReturnCode WINAPI agsInitialize(int ags_version, const AGSConfiguration *config, AGSContext **context, AGSGPUInfo_600 *gpu_info) +{ + struct AGSContext *object; + AGSReturnCode ret; + + TRACE("ags_verison %d, context %p, config %p, gpu_info %p.\n", ags_version, context, config, gpu_info); + + if (!context || !gpu_info) + return AGS_INVALID_ARGS; + + if (config) + FIXME("Ignoring config %p.\n", config); + + if (!(object = heap_alloc(sizeof(*object)))) + return AGS_OUT_OF_MEMORY; + + if ((ret = init_ags_context(object)) != AGS_SUCCESS) + { + heap_free(object); + return ret; + } + + memset(gpu_info, 0, sizeof(*gpu_info)); + gpu_info->driverVersion = "20.50.03.05-210326a-365573E-RadeonSoftwareAdrenalin2020"; + gpu_info->radeonSoftwareVersion = "21.3.2"; + gpu_info->numDevices = object->device_count; + gpu_info->devices = object->devices; + + TRACE("Created context %p.\n", object); + + *context = object; + + return AGS_SUCCESS; +} + AGSReturnCode WINAPI agsDeInit(AGSContext *context) +{ + return agsDeInitialize(context); +} + +AGSReturnCode WINAPI agsDeInitialize(AGSContext *context) { unsigned int i; BYTE *device; @@ -491,7 +579,7 @@ AGSReturnCode WINAPI agsDeInit(AGSContext *context) device = (BYTE *)context->devices; for (i = 0; i < context->device_count; ++i) { - heap_free(*GET_DEVICE_FIELD_ADDR(device, displays, AGSDisplayInfo *, context->version)); + heap_free(*GET_DEVICE_FIELD_ADDR(device, displays, void *, context->version)); device += amd_ags_info[context->version].device_size; } heap_free(context->devices); @@ -561,6 +649,15 @@ AGSDriverVersionResult WINAPI agsCheckDriverVersion(const char* version_reported return AGS_SOFTWAREVERSIONCHECK_OK; } +int WINAPI agsGetVersionNumber(void) +{ + enum amd_ags_version version = determine_ags_version(); + + TRACE("version %d.\n", version); + + return AGS_MAKE_VERSION(amd_ags_info[version].major, amd_ags_info[version].minor, amd_ags_info[version].patch); +} + BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) { TRACE("%p, %u, %p.\n", instance, reason, reserved); From 9fc2f987559d0d7a67ce46ec3653c19ba54597c9 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Sat, 8 May 2021 05:20:08 +0100 Subject: [PATCH 0464/2542] amd_ags_x64: Implement AGS 6.0.1 Signed-off-by: Joshua Ashton --- dlls/amd_ags_x64/amd_ags.h | 8 ++++---- dlls/amd_ags_x64/amd_ags_x64_main.c | 13 +++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index af9c48c1dd5b..20fef455f001 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -151,7 +151,7 @@ #define AMD_AGS_VERSION_MAJOR 6 ///< AGS major version #define AMD_AGS_VERSION_MINOR 0 ///< AGS minor version -#define AMD_AGS_VERSION_PATCH 0 ///< AGS patch version +#define AMD_AGS_VERSION_PATCH 1 ///< AGS patch version #ifdef __cplusplus extern "C" { @@ -906,8 +906,8 @@ typedef struct AGSDX12ReturnedParams unsigned int baseInstance : 1; ///< Supported in Radeon Software Version 20.2.1 onwards. unsigned int getWaveSize : 1; ///< Supported in Radeon Software Version 20.5.1 onwards. unsigned int floatConversion : 1; ///< Supported in Radeon Software Version 20.5.1 onwards. - unsigned int readLaneAt : 1; ///< Supported in Radeon Software Version 20.11.1 onwards. - unsigned int rayHitToken : 1; ///< Supported in Radeon Software Version 20.11.1 onwards. + unsigned int readLaneAt : 1; ///< Supported in Radeon Software Version 20.11.2 onwards. + unsigned int rayHitToken : 1; ///< Supported in Radeon Software Version 20.11.2 onwards. unsigned int padding : 20; ///< Reserved } ExtensionsSupported; ExtensionsSupported extensionsSupported; ///< List of supported extensions @@ -1631,7 +1631,7 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetMaxAsyncCompileThreadCount( /// /// This method can be used to determine the total number of asynchronous shader compile jobs that are either -/// queued for waiting for compilation or being compiled by the driverÂ’s asynchronous compilation threads. +/// queued for waiting for compilation or being compiled by the driverÂ’'s asynchronous compilation threads. /// This method can be called at any during the lifetime of the driver. /// /// \param [in] context Pointer to a context. diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 88ce02f9e1b4..b1910def3cdc 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -27,6 +27,7 @@ enum amd_ags_version AMD_AGS_VERSION_5_4_1, AMD_AGS_VERSION_5_4_2, AMD_AGS_VERSION_6_0_0, + AMD_AGS_VERSION_6_0_1, AMD_AGS_VERSION_COUNT }; @@ -48,20 +49,24 @@ amd_ags_info[AMD_AGS_VERSION_COUNT] = {5, 4, 1, sizeof(AGSDeviceInfo_541)}, {5, 4, 2, sizeof(AGSDeviceInfo_542)}, {6, 0, 0, sizeof(AGSDeviceInfo_600)}, + {6, 0, 1, sizeof(AGSDeviceInfo_600)}, }; #define DEF_FIELD(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ - offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name)}} + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name), \ + offsetof(AGSDeviceInfo_600, name)}} #define DEF_FIELD_520_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), -1, \ - -1, -1, -1}} + -1, -1, -1, -1}} #define DEF_FIELD_540_UP(name) {DEVICE_FIELD_##name, {-1, -1, \ -1, -1, offsetof(AGSDeviceInfo_540, name), \ - offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name)}} + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name), \ + offsetof(AGSDeviceInfo_600, name)}} #define DEF_FIELD_600_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ - offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), -1}} + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), -1, \ + -1}} #define DEVICE_FIELD_adapterString 0 #define DEVICE_FIELD_architectureVersion 1 From 9bb75a2a6a40589c5a728d5d1a5f41136a603f82 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 6 Oct 2021 22:56:07 +0300 Subject: [PATCH 0465/2542] amd_ags_x64: Add agsDriverExtensionsDX11_Init() semi-stub. --- dlls/amd_ags_x64/amd_ags_x64.spec | 2 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index 562c41033433..ebb026da35e4 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -14,7 +14,7 @@ @ stub agsDriverExtensionsDX11_EndUAVOverlap @ stub agsDriverExtensionsDX11_GetMaxClipRects @ stub agsDriverExtensionsDX11_IASetPrimitiveTopology -@ stub agsDriverExtensionsDX11_Init +@ stdcall agsDriverExtensionsDX11_Init(ptr ptr long ptr) @ stub agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect @ stub agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect @ stub agsDriverExtensionsDX11_MultiDrawInstancedIndirect diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index b1910def3cdc..5b6d852b9e7f 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -663,6 +663,14 @@ int WINAPI agsGetVersionNumber(void) return AGS_MAKE_VERSION(amd_ags_info[version].major, amd_ags_info[version].minor, amd_ags_info[version].patch); } +AGSReturnCode WINAPI agsDriverExtensionsDX11_Init( AGSContext* context, ID3D11Device* device, unsigned int uavSlot, unsigned int* extensionsSupported ) +{ + FIXME("context %p, device %p, uavSlot %u, extensionsSupported %p stub.\n", context, device, uavSlot, extensionsSupported); + + *extensionsSupported = 0; + return AGS_SUCCESS; +} + BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) { TRACE("%p, %u, %p.\n", instance, reason, reserved); From cad87be467d13257aa39e1580652327625c99ce0 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 10 Nov 2021 22:11:59 +0300 Subject: [PATCH 0466/2542] amd_ags_x64: Bump driver version to 21.10.2. For FH5. --- dlls/amd_ags_x64/amd_ags_x64_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 5b6d852b9e7f..24b16021acfa 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -518,8 +518,8 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi gpu_info->agsVersionMajor = amd_ags_info[object->version].major; gpu_info->agsVersionMinor = amd_ags_info[object->version].minor; gpu_info->agsVersionPatch = amd_ags_info[object->version].patch; - gpu_info->driverVersion = "20.50.03.05-210326a-365573E-RadeonSoftwareAdrenalin2020"; - gpu_info->radeonSoftwareVersion = "21.3.2"; + gpu_info->driverVersion = "21.30.25.05-211005a-372402E-RadeonSoftware"; + gpu_info->radeonSoftwareVersion = "21.10.2"; gpu_info->numDevices = object->device_count; gpu_info->devices = object->devices; @@ -553,8 +553,8 @@ AGSReturnCode WINAPI agsInitialize(int ags_version, const AGSConfiguration *conf } memset(gpu_info, 0, sizeof(*gpu_info)); - gpu_info->driverVersion = "20.50.03.05-210326a-365573E-RadeonSoftwareAdrenalin2020"; - gpu_info->radeonSoftwareVersion = "21.3.2"; + gpu_info->driverVersion = "21.30.25.05-211005a-372402E-RadeonSoftware"; + gpu_info->radeonSoftwareVersion = "21.10.2"; gpu_info->numDevices = object->device_count; gpu_info->devices = object->devices; From 1b825321e9f181516ba3092ecd3cca88faf79cf2 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 2 Feb 2022 16:36:37 +0300 Subject: [PATCH 0467/2542] amd_ags_x64: Implement agsDriverExtensionsDX11_CreateDevice(). CW-Bug-Id: #19944 --- dlls/amd_ags_x64/amd_ags_x64.spec | 2 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 106 +++++++++++++++++++++++++--- 2 files changed, 97 insertions(+), 11 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index ebb026da35e4..d4a558729aaa 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -3,7 +3,7 @@ @ stdcall agsCheckDriverVersion(ptr long) @ stub agsDriverExtensionsDX11_BeginUAVOverlap @ stub agsDriverExtensionsDX11_CreateBuffer -@ stub agsDriverExtensionsDX11_CreateDevice +@ stdcall agsDriverExtensionsDX11_CreateDevice(ptr ptr ptr ptr) @ stub agsDriverExtensionsDX11_CreateFromDevice @ stub agsDriverExtensionsDX11_CreateTexture1D @ stub agsDriverExtensionsDX11_CreateTexture2D diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 24b16021acfa..6ae20547e7a9 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -38,18 +38,19 @@ static const struct int minor; int patch; unsigned int device_size; + unsigned int dx11_returned_params_size; } amd_ags_info[AMD_AGS_VERSION_COUNT] = { - {5, 1, 1, sizeof(AGSDeviceInfo_511)}, - {5, 2, 0, sizeof(AGSDeviceInfo_520)}, - {5, 2, 1, sizeof(AGSDeviceInfo_520)}, - {5, 3, 0, sizeof(AGSDeviceInfo_520)}, - {5, 4, 0, sizeof(AGSDeviceInfo_540)}, - {5, 4, 1, sizeof(AGSDeviceInfo_541)}, - {5, 4, 2, sizeof(AGSDeviceInfo_542)}, - {6, 0, 0, sizeof(AGSDeviceInfo_600)}, - {6, 0, 1, sizeof(AGSDeviceInfo_600)}, + {5, 1, 1, sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511)}, + {5, 2, 0, sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520)}, + {5, 2, 1, sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520)}, + {5, 3, 0, sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520)}, + {5, 4, 0, sizeof(AGSDeviceInfo_540), sizeof(AGSDX11ReturnedParams_520)}, + {5, 4, 1, sizeof(AGSDeviceInfo_541), sizeof(AGSDX11ReturnedParams_520)}, + {5, 4, 2, sizeof(AGSDeviceInfo_542), sizeof(AGSDX11ReturnedParams_520)}, + {6, 0, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)}, + {6, 0, 1, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)}, }; #define DEF_FIELD(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ @@ -117,8 +118,10 @@ struct AGSContext VkPhysicalDeviceMemoryProperties *memory_properties; }; -static HMODULE hd3d12; +static HMODULE hd3d11, hd3d12; static typeof(D3D12CreateDevice) *pD3D12CreateDevice; +static typeof(D3D11CreateDevice) *pD3D11CreateDevice; +static typeof(D3D11CreateDeviceAndSwapChain) *pD3D11CreateDeviceAndSwapChain; static BOOL load_d3d12_functions(void) { @@ -132,6 +135,19 @@ static BOOL load_d3d12_functions(void) return TRUE; } +static BOOL load_d3d11_functions(void) +{ + if (hd3d11) + return TRUE; + + if (!(hd3d11 = LoadLibraryA("d3d11.dll"))) + return FALSE; + + pD3D11CreateDevice = (void *)GetProcAddress(hd3d11, "D3D11CreateDevice"); + pD3D11CreateDeviceAndSwapChain = (void *)GetProcAddress(hd3d11, "D3D11CreateDeviceAndSwapChain"); + return TRUE; +} + static AGSReturnCode vk_get_physical_device_properties(unsigned int *out_count, VkPhysicalDeviceProperties **out, VkPhysicalDeviceMemoryProperties **out_memory) { @@ -605,6 +621,76 @@ AGSReturnCode WINAPI agsGetCrossfireGPUCount(AGSContext *context, int *gpu_count return AGS_SUCCESS; } +AGSReturnCode WINAPI agsDriverExtensionsDX11_CreateDevice( AGSContext* context, + const AGSDX11DeviceCreationParams* creation_params, const AGSDX11ExtensionParams* extension_params, + AGSDX11ReturnedParams* returned_params ) +{ + ID3D11DeviceContext *device_context; + IDXGISwapChain *swapchain = NULL; + D3D_FEATURE_LEVEL feature_level; + ID3D11Device *device; + HRESULT hr; + + TRACE("feature levels %u, pSwapChainDesc %p, app %s, engine %s %#x %#x.\n", creation_params->FeatureLevels, + creation_params->pSwapChainDesc, + debugstr_w(extension_params->agsDX11ExtensionParams511.pAppName), + debugstr_w(extension_params->agsDX11ExtensionParams511.pEngineName), + extension_params->agsDX11ExtensionParams511.appVersion, + extension_params->agsDX11ExtensionParams511.engineVersion); + + if (!load_d3d11_functions()) + { + ERR("Could not load d3d11.dll.\n"); + return AGS_MISSING_D3D_DLL; + } + memset( returned_params, 0, amd_ags_info[context->version].dx11_returned_params_size ); + if (creation_params->pSwapChainDesc) + { + hr = pD3D11CreateDeviceAndSwapChain(creation_params->pAdapter, creation_params->DriverType, + creation_params->Software, creation_params->Flags, creation_params->pFeatureLevels, + creation_params->FeatureLevels, creation_params->SDKVersion, creation_params->pSwapChainDesc, + &swapchain, &device, &feature_level, &device_context); + } + else + { + hr = pD3D11CreateDevice(creation_params->pAdapter, creation_params->DriverType, + creation_params->Software, creation_params->Flags, creation_params->pFeatureLevels, + creation_params->FeatureLevels, creation_params->SDKVersion, + &device, &feature_level, &device_context); + } + if (FAILED(hr)) + { + ERR("Device creation failed, hr %#x.\n", hr); + return AGS_DX_FAILURE; + } + if (context->version < AMD_AGS_VERSION_5_2_0) + { + AGSDX11ReturnedParams_511 *r = &returned_params->agsDX11ReturnedParams511; + r->pDevice = device; + r->pImmediateContext = device_context; + r->pSwapChain = swapchain; + r->FeatureLevel = feature_level; + } + else if (context->version < AMD_AGS_VERSION_6_0_0) + { + AGSDX11ReturnedParams_520 *r = &returned_params->agsDX11ReturnedParams520; + r->pDevice = device; + r->pImmediateContext = device_context; + r->pSwapChain = swapchain; + r->FeatureLevel = feature_level; + } + else + { + AGSDX11ReturnedParams_600 *r = &returned_params->agsDX11ReturnedParams600; + r->pDevice = device; + r->pImmediateContext = device_context; + r->pSwapChain = swapchain; + r->featureLevel = feature_level; + } + + return AGS_SUCCESS; +} + AGSReturnCode WINAPI agsDriverExtensionsDX12_CreateDevice(AGSContext *context, const AGSDX12DeviceCreationParams *creation_params, const AGSDX12ExtensionParams *extension_params, AGSDX12ReturnedParams *returned_params) From a4c73c7fe5f6d50a58750d94f70dd58b8708ffdd Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 2 Feb 2022 17:07:53 +0300 Subject: [PATCH 0468/2542] amd_ags_x64: Add stub for agsDriverExtensionsDX11_SetDepthBounds(). CW-Bug-Id: #19944 --- dlls/amd_ags_x64/amd_ags.h | 6 +++-- dlls/amd_ags_x64/amd_ags_x64.spec | 2 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 34 +++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index 20fef455f001..9b521de75b87 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -1506,8 +1506,10 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_EndUAVOverlap( AGSContext* con /// \param [in] minDepth The near depth range to clip against. /// \param [in] maxDepth The far depth range to clip against. /// -AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDepthBounds_520( AGSContext* context, bool enabled, float minDepth, float maxDepth ); -AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDepthBounds( AGSContext* context, ID3D11DeviceContext* dxContext, bool enabled, float minDepth, float maxDepth ); +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDepthBounds( AGSContext* context, bool enabled, float minDepth, float maxDepth ); + +/* Since 5.3.0 */ +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDepthBounds_530( AGSContext* context, ID3D11DeviceContext* dxContext, bool enabled, float minDepth, float maxDepth ); /// @} diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index d4a558729aaa..0eab37b34602 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -24,7 +24,7 @@ @ stub agsDriverExtensionsDX11_NotifyResourceEndWrites @ stub agsDriverExtensionsDX11_NumPendingAsyncCompileJobs @ stub agsDriverExtensionsDX11_SetClipRects -@ stub agsDriverExtensionsDX11_SetDepthBounds +@ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_SetDepthBounds() DX11_SetDepthBounds_impl @ stub agsDriverExtensionsDX11_SetDiskShaderCacheEnabled @ stub agsDriverExtensionsDX11_SetMaxAsyncCompileThreadCount @ stub agsDriverExtensionsDX11_SetViewBroadcastMasks diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 6ae20547e7a9..c44b4757d475 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -1,3 +1,7 @@ +#if 0 +#pragma makedep arm64ec_x64 +#endif + #include #include #include @@ -8,6 +12,7 @@ #include "wine/heap.h" #include "wine/vulkan.h" +#include "wine/asm.h" #define COBJMACROS #include "d3d11.h" @@ -770,3 +775,32 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) return TRUE; } + +#ifdef __x86_64__ +AGSReturnCode WINAPI agsDriverExtensionsDX11_SetDepthBounds(AGSContext* context, bool enabled, + float minDepth, float maxDepth ) +{ + static int once; + + if (!once++) + FIXME("context %p, enabled %#x, minDepth %f, maxDepth %f stub.\n", context, enabled, minDepth, maxDepth); + return AGS_EXTENSION_NOT_SUPPORTED; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_SetDepthBounds_530(AGSContext* context, + ID3D11DeviceContext* dxContext, bool enabled, float minDepth, float maxDepth ) +{ + static int once; + + if (!once++) + FIXME("context %p, enabled %#x, minDepth %f, maxDepth %f stub.\n", context, enabled, minDepth, maxDepth); + return AGS_EXTENSION_NOT_SUPPORTED; +} + +__ASM_GLOBAL_FUNC( DX11_SetDepthBounds_impl, + "mov (%rcx),%eax\n\t" /* version */ + "cmp $3,%eax\n\t" + "jge 1f\n\t" + "jmp " __ASM_NAME("agsDriverExtensionsDX11_SetDepthBounds") "\n\t" + "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_SetDepthBounds_530") ) +#endif From 87ef9c5a16a9fbdd1c03c6ed7711e45c4b0b3780 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 2 Feb 2022 17:42:41 +0300 Subject: [PATCH 0469/2542] amd_ags_x64: Implement agsDriverExtensionsDX11_DestroyDevice(). CW-Bug-Id: #19944 --- dlls/amd_ags_x64/amd_ags_x64.spec | 2 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 39 +++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index 0eab37b34602..1a456e2aa715 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -10,7 +10,7 @@ @ stub agsDriverExtensionsDX11_CreateTexture3D @ stub agsDriverExtensionsDX11_DeInit @ stub agsDriverExtensionsDX11_Destroy -@ stub agsDriverExtensionsDX11_DestroyDevice +@ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_DestroyDevice() @ stub agsDriverExtensionsDX11_EndUAVOverlap @ stub agsDriverExtensionsDX11_GetMaxClipRects @ stub agsDriverExtensionsDX11_IASetPrimitiveTopology diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index c44b4757d475..3dec5338e78b 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -803,4 +803,43 @@ __ASM_GLOBAL_FUNC( DX11_SetDepthBounds_impl, "jge 1f\n\t" "jmp " __ASM_NAME("agsDriverExtensionsDX11_SetDepthBounds") "\n\t" "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_SetDepthBounds_530") ) + +AGSReturnCode WINAPI agsDriverExtensionsDX11_DestroyDevice_520(AGSContext *context, ID3D11Device* device, + unsigned int *device_ref, ID3D11DeviceContext *device_context, + unsigned int *context_ref) +{ + ULONG ref; + + TRACE("context %p, device %p, device_ref %p, device_context %p, context_ref %p.\n", + context, device, device_ref, device_context, context_ref); + + if (!device) + return AGS_SUCCESS; + + ref = ID3D11Device_Release(device); + if (device_ref) + *device_ref = ref; + + if (!device_context) + return AGS_SUCCESS; + + ref = ID3D11DeviceContext_Release(device_context); + if (context_ref) + *context_ref = ref; + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_DestroyDevice_511(AGSContext *context, ID3D11Device *device, + unsigned int *references ) +{ + TRACE("context %p, device %p, references %p.\n", context, device, references); + + return agsDriverExtensionsDX11_DestroyDevice_520(context, device, references, NULL, NULL); +} +__ASM_GLOBAL_FUNC( agsDriverExtensionsDX11_DestroyDevice, + "mov (%rcx),%eax\n\t" /* version */ + "cmp $1,%eax\n\t" + "jge 1f\n\t" + "jmp " __ASM_NAME("agsDriverExtensionsDX11_DestroyDevice_511") "\n\t" + "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_DestroyDevice_520") ) #endif From b288c5b1eef0157e45e0b676ebe6ac0af26ff300 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 21 Dec 2022 15:45:58 -0600 Subject: [PATCH 0470/2542] amd_ags_x64: Copy native module to a temporary file for getting version info. Otherwise we are searching for version info in our builtin module (that changed with Wine 8.0). --- dlls/amd_ags_x64/amd_ags_x64_main.c | 34 ++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 3dec5338e78b..232d5fdccc9a 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -244,29 +244,48 @@ static enum amd_ags_version determine_ags_version(void) UINT vallen, i; VS_FIXEDFILEINFO *info; UINT16 major, minor, patch; + WCHAR dllname[MAX_PATH], temp_path[MAX_PATH], temp_name[MAX_PATH]; - infosize = GetFileVersionInfoSizeW(L"amd_ags_x64.dll", NULL); + *temp_name = 0; + if (!(infosize = GetModuleFileNameW(GetModuleHandleW(L"amd_ags_x64.dll"), dllname, ARRAY_SIZE(dllname))) + || infosize == ARRAY_SIZE(dllname)) + { + ERR("GetModuleFileNameW failed.\n"); + goto done; + } + if (!GetTempPathW(MAX_PATH, temp_path) || !GetTempFileNameW(temp_path, L"tmp", 0, temp_name)) + { + ERR("Failed getting temp file name.\n"); + goto done; + } + if (!CopyFileW(dllname, temp_name, FALSE)) + { + ERR("Failed to copy file.\n"); + goto done; + } + + infosize = GetFileVersionInfoSizeW(temp_name, NULL); if (!infosize) { - WARN("Unable to determine desired version of amd_ags_x64.dll.\n"); + ERR("Unable to determine desired version of amd_ags_x64.dll.\n"); goto done; } if (!(infobuf = heap_alloc(infosize))) { - WARN("Failed to allocate memory.\n"); + ERR("Failed to allocate memory.\n"); goto done; } - if (!GetFileVersionInfoW(L"amd_ags_x64.dll", 0, infosize, infobuf)) + if (!GetFileVersionInfoW(temp_name, 0, infosize, infobuf)) { - WARN("Unable to determine desired version of amd_ags_x64.dll.\n"); + ERR("Unable to determine desired version of amd_ags_x64.dll.\n"); goto done; } if (!VerQueryValueW(infobuf, L"\\", &val, &vallen) || (vallen != sizeof(VS_FIXEDFILEINFO))) { - WARN("Unable to determine desired version of amd_ags_x64.dll.\n"); + ERR("Unable to determine desired version of amd_ags_x64.dll.\n"); goto done; } @@ -288,6 +307,9 @@ static enum amd_ags_version determine_ags_version(void) } done: + if (*temp_name) + DeleteFileW(temp_name); + heap_free(infobuf); TRACE("Using AGS v%d.%d.%d interface\n", amd_ags_info[ret].major, amd_ags_info[ret].minor, amd_ags_info[ret].patch); From 79adeec3774fd5b3d78c06554d37efb45aa46764 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Mon, 10 Apr 2023 16:54:38 +0800 Subject: [PATCH 0471/2542] amd_ags_x64: Stub agsSetDisplayMode(). CW-Bug-Id: #22067 --- dlls/amd_ags_x64/amd_ags_x64.spec | 2 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index 1a456e2aa715..4fe7ea9ebfcb 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -42,4 +42,4 @@ @ stdcall agsGetVersionNumber() @ stdcall agsInit(ptr ptr ptr) @ stdcall agsInitialize(long ptr ptr ptr) -@ stub agsSetDisplayMode +@ stdcall agsSetDisplayMode(ptr long long ptr) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 232d5fdccc9a..772b803a013a 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -637,6 +637,17 @@ AGSReturnCode WINAPI agsDeInitialize(AGSContext *context) return AGS_SUCCESS; } +AGSReturnCode WINAPI agsSetDisplayMode(AGSContext *context, int device_index, int display_index, const AGSDisplaySettings *settings) +{ + FIXME("context %p device_index %d display_index %d settings %p stub!\n", context, device_index, + display_index, settings); + + if (!context) + return AGS_INVALID_ARGS; + + return AGS_SUCCESS; +} + AGSReturnCode WINAPI agsGetCrossfireGPUCount(AGSContext *context, int *gpu_count) { TRACE("context %p gpu_count %p stub!\n", context, gpu_count); From 733cfcd9e009073b290b283a7cf688a298dbc870 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 19 Apr 2023 13:22:16 -0600 Subject: [PATCH 0472/2542] amd_ags_x64: Add agsDriverExtensionsDX11_BeginUAVOverlap() stub. CW-Bug-Id: #22146 --- dlls/amd_ags_x64/amd_ags_x64.spec | 2 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index 4fe7ea9ebfcb..699e5e83acf0 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -1,7 +1,7 @@ @ stdcall agsDeInit(ptr) @ stdcall agsDeInitialize(ptr) @ stdcall agsCheckDriverVersion(ptr long) -@ stub agsDriverExtensionsDX11_BeginUAVOverlap +@ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_BeginUAVOverlap() DX11_BeginUAVOverlap_impl @ stub agsDriverExtensionsDX11_CreateBuffer @ stdcall agsDriverExtensionsDX11_CreateDevice(ptr ptr ptr ptr) @ stub agsDriverExtensionsDX11_CreateFromDevice diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 772b803a013a..ba143e58ec93 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -837,6 +837,32 @@ __ASM_GLOBAL_FUNC( DX11_SetDepthBounds_impl, "jmp " __ASM_NAME("agsDriverExtensionsDX11_SetDepthBounds") "\n\t" "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_SetDepthBounds_530") ) +AGSReturnCode WINAPI agsDriverExtensionsDX11_BeginUAVOverlap_520(AGSContext *context) +{ + static int once; + + if (!once++) + FIXME("context %p stub.\n", context); + return AGS_EXTENSION_NOT_SUPPORTED; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_BeginUAVOverlap(AGSContext *context, ID3D11DeviceContext *dx_context) +{ + static int once; + + if (!once++) + FIXME("context %p, dx_context %p stub.\n", context, dx_context); + + return AGS_EXTENSION_NOT_SUPPORTED; +} + +__ASM_GLOBAL_FUNC( DX11_BeginUAVOverlap_impl, + "mov (%rcx),%eax\n\t" /* version */ + "cmp $3,%eax\n\t" + "jge 1f\n\t" + "jmp " __ASM_NAME("agsDriverExtensionsDX11_BeginUAVOverlap_520") "\n\t" + "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_BeginUAVOverlap") ) + AGSReturnCode WINAPI agsDriverExtensionsDX11_DestroyDevice_520(AGSContext *context, ID3D11Device* device, unsigned int *device_ref, ID3D11DeviceContext *device_context, unsigned int *context_ref) From 6948eff28ead839b6de54ed526f2ea2ad9711044 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 19 Apr 2023 14:41:04 -0600 Subject: [PATCH 0473/2542] amd_ags_x64: Add agsDriverExtensionsDX11_EndUAVOverlap() stub. CW-Bug-Id: #22146 --- dlls/amd_ags_x64/amd_ags_x64.spec | 2 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index 699e5e83acf0..316eec6bf23b 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -11,7 +11,7 @@ @ stub agsDriverExtensionsDX11_DeInit @ stub agsDriverExtensionsDX11_Destroy @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_DestroyDevice() -@ stub agsDriverExtensionsDX11_EndUAVOverlap +@ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_EndUAVOverlap() DX11_EndUAVOverlap_impl @ stub agsDriverExtensionsDX11_GetMaxClipRects @ stub agsDriverExtensionsDX11_IASetPrimitiveTopology @ stdcall agsDriverExtensionsDX11_Init(ptr ptr long ptr) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index ba143e58ec93..26edce51ac94 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -863,6 +863,32 @@ __ASM_GLOBAL_FUNC( DX11_BeginUAVOverlap_impl, "jmp " __ASM_NAME("agsDriverExtensionsDX11_BeginUAVOverlap_520") "\n\t" "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_BeginUAVOverlap") ) +AGSReturnCode WINAPI agsDriverExtensionsDX11_EndUAVOverlap_520(AGSContext *context) +{ + static int once; + + if (!once++) + FIXME("context %p stub.\n", context); + return AGS_EXTENSION_NOT_SUPPORTED; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_EndUAVOverlap(AGSContext *context, ID3D11DeviceContext *dx_context) +{ + static int once; + + if (!once++) + FIXME("context %p, dx_context %p stub.\n", context, dx_context); + + return AGS_EXTENSION_NOT_SUPPORTED; +} + +__ASM_GLOBAL_FUNC( DX11_EndUAVOverlap_impl, + "mov (%rcx),%eax\n\t" /* version */ + "cmp $3,%eax\n\t" + "jge 1f\n\t" + "jmp " __ASM_NAME("agsDriverExtensionsDX11_EndUAVOverlap_520") "\n\t" + "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_EndUAVOverlap") ) + AGSReturnCode WINAPI agsDriverExtensionsDX11_DestroyDevice_520(AGSContext *context, ID3D11Device* device, unsigned int *device_ref, ID3D11DeviceContext *device_context, unsigned int *context_ref) From 0c6c3e57fd179cad2db1046cac0e6ff9c573498c Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 19 Apr 2023 14:50:31 -0600 Subject: [PATCH 0474/2542] amd_ags_x64: Store d3d11 immediate context in AGS context. CW-Bug-Id: #22242 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 65 ++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 16 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 26edce51ac94..d3f1bf5e9dc2 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -121,6 +121,7 @@ struct AGSContext struct AGSDeviceInfo *devices; VkPhysicalDeviceProperties *properties; VkPhysicalDeviceMemoryProperties *memory_properties; + ID3D11DeviceContext *d3d11_context; }; static HMODULE hd3d11, hd3d12; @@ -455,11 +456,9 @@ static AGSReturnCode init_ags_context(AGSContext *context) unsigned int i, j; BYTE *device; + memset(context, 0, sizeof(*context)); + context->version = determine_ags_version(); - context->device_count = 0; - context->devices = NULL; - context->properties = NULL; - context->memory_properties = NULL; ret = vk_get_physical_device_properties(&context->device_count, &context->properties, &context->memory_properties); if (ret != AGS_SUCCESS || !context->device_count) @@ -620,19 +619,24 @@ AGSReturnCode WINAPI agsDeInitialize(AGSContext *context) TRACE("context %p.\n", context); - if (context) + if (!context) + return AGS_SUCCESS; + + if (context->d3d11_context) { - heap_free(context->memory_properties); - heap_free(context->properties); - device = (BYTE *)context->devices; - for (i = 0; i < context->device_count; ++i) - { - heap_free(*GET_DEVICE_FIELD_ADDR(device, displays, void *, context->version)); - device += amd_ags_info[context->version].device_size; - } - heap_free(context->devices); - heap_free(context); + ID3D11DeviceContext_Release(context->d3d11_context); + context->d3d11_context = NULL; + } + heap_free(context->memory_properties); + heap_free(context->properties); + device = (BYTE *)context->devices; + for (i = 0; i < context->device_count; ++i) + { + heap_free(*GET_DEVICE_FIELD_ADDR(device, displays, void *, context->version)); + device += amd_ags_info[context->version].device_size; } + heap_free(context->devices); + heap_free(context); return AGS_SUCCESS; } @@ -726,6 +730,15 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_CreateDevice( AGSContext* context, r->featureLevel = feature_level; } + if (context->version < AMD_AGS_VERSION_5_3_0) + { + /* Later versions pass context to functions explicitly, no need to keep it. */ + if (context->d3d11_context) + ID3D11DeviceContext_Release(context->d3d11_context); + ID3D11DeviceContext_AddRef(device_context); + context->d3d11_context = device_context; + } + return AGS_SUCCESS; } @@ -787,11 +800,25 @@ int WINAPI agsGetVersionNumber(void) return AGS_MAKE_VERSION(amd_ags_info[version].major, amd_ags_info[version].minor, amd_ags_info[version].patch); } -AGSReturnCode WINAPI agsDriverExtensionsDX11_Init( AGSContext* context, ID3D11Device* device, unsigned int uavSlot, unsigned int* extensionsSupported ) +AGSReturnCode WINAPI agsDriverExtensionsDX11_Init( AGSContext *context, ID3D11Device *device, unsigned int uavSlot, unsigned int *extensionsSupported ) { FIXME("context %p, device %p, uavSlot %u, extensionsSupported %p stub.\n", context, device, uavSlot, extensionsSupported); *extensionsSupported = 0; + if (device) + { + if (context->version < AMD_AGS_VERSION_5_3_0) + { + /* Later versions pass context to functions explicitly, no need to keep it. */ + if (context->d3d11_context) + { + ID3D11DeviceContext_Release(context->d3d11_context); + context->d3d11_context = NULL; + } + ID3D11Device_GetImmediateContext(device, &context->d3d11_context); + } + } + return AGS_SUCCESS; } @@ -901,6 +928,12 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_DestroyDevice_520(AGSContext *conte if (!device) return AGS_SUCCESS; + if (context->d3d11_context) + { + ID3D11DeviceContext_Release(context->d3d11_context); + context->d3d11_context = NULL; + } + ref = ID3D11Device_Release(device); if (device_ref) *device_ref = ref; From c4d72f24fa8b0d9b58849e7afc22dc9cdecde583 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 19 Apr 2023 18:09:02 -0600 Subject: [PATCH 0475/2542] amd_ags_x64: Implement agsDriverExtensionsDX11_SetDepthBounds(). CW-Bug-Id: #22242 --- dlls/amd_ags_x64/Makefile.in | 3 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 78 +++++++++++++++--- dlls/amd_ags_x64/dxvk_interfaces.idl | 116 +++++++++++++++++++++++++++ 3 files changed, 186 insertions(+), 11 deletions(-) create mode 100644 dlls/amd_ags_x64/dxvk_interfaces.idl diff --git a/dlls/amd_ags_x64/Makefile.in b/dlls/amd_ags_x64/Makefile.in index 74253dcf5fd3..123d06038699 100644 --- a/dlls/amd_ags_x64/Makefile.in +++ b/dlls/amd_ags_x64/Makefile.in @@ -6,4 +6,5 @@ IMPORTLIB = amd_ags_x64 EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native SOURCES = \ - amd_ags_x64_main.c + amd_ags_x64_main.c \ + dxvk_interfaces.idl diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index d3f1bf5e9dc2..fcdbde22ca14 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -18,6 +18,10 @@ #include "d3d11.h" #include "d3d12.h" +#include "initguid.h" + +#include "dxvk_interfaces.h" + #include "amd_ags.h" WINE_DEFAULT_DEBUG_CHANNEL(amd_ags); @@ -122,6 +126,7 @@ struct AGSContext VkPhysicalDeviceProperties *properties; VkPhysicalDeviceMemoryProperties *memory_properties; ID3D11DeviceContext *d3d11_context; + AGSDX11ExtensionsSupported_600 extensions; }; static HMODULE hd3d11, hd3d12; @@ -663,6 +668,23 @@ AGSReturnCode WINAPI agsGetCrossfireGPUCount(AGSContext *context, int *gpu_count return AGS_SUCCESS; } +static void get_dx11_extensions_supported(ID3D11Device *device, AGSDX11ExtensionsSupported_600 *extensions) +{ + ID3D11VkExtDevice *ext_device; + + if (FAILED(ID3D11Device_QueryInterface(device, &IID_ID3D11VkExtDevice, (void **)&ext_device))) + { + TRACE("No ID3D11VkExtDevice.\n"); + return; + } + + extensions->depthBoundsTest = !!ID3D11VkExtDevice_GetExtensionSupport(ext_device, D3D11_VK_EXT_DEPTH_BOUNDS); + + ID3D11VkExtDevice_Release(ext_device); + + TRACE("extensions %#x.\n", *(unsigned int *)extensions); +} + AGSReturnCode WINAPI agsDriverExtensionsDX11_CreateDevice( AGSContext* context, const AGSDX11DeviceCreationParams* creation_params, const AGSDX11ExtensionParams* extension_params, AGSDX11ReturnedParams* returned_params ) @@ -705,6 +727,9 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_CreateDevice( AGSContext* context, ERR("Device creation failed, hr %#x.\n", hr); return AGS_DX_FAILURE; } + + get_dx11_extensions_supported(device, &context->extensions); + if (context->version < AMD_AGS_VERSION_5_2_0) { AGSDX11ReturnedParams_511 *r = &returned_params->agsDX11ReturnedParams511; @@ -712,6 +737,7 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_CreateDevice( AGSContext* context, r->pImmediateContext = device_context; r->pSwapChain = swapchain; r->FeatureLevel = feature_level; + r->extensionsSupported = *(unsigned int *)&context->extensions; } else if (context->version < AMD_AGS_VERSION_6_0_0) { @@ -720,6 +746,7 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_CreateDevice( AGSContext* context, r->pImmediateContext = device_context; r->pSwapChain = swapchain; r->FeatureLevel = feature_level; + r->extensionsSupported = *(unsigned int *)&context->extensions; } else { @@ -728,6 +755,7 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_CreateDevice( AGSContext* context, r->pImmediateContext = device_context; r->pSwapChain = swapchain; r->featureLevel = feature_level; + r->extensionsSupported = context->extensions; } if (context->version < AMD_AGS_VERSION_5_3_0) @@ -817,6 +845,8 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_Init( AGSContext *context, ID3D11De } ID3D11Device_GetImmediateContext(device, &context->d3d11_context); } + get_dx11_extensions_supported(device, &context->extensions); + *extensionsSupported = *(unsigned int *)&context->extensions; } return AGS_SUCCESS; @@ -837,24 +867,52 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) } #ifdef __x86_64__ + +static AGSReturnCode set_depth_bounds(AGSContext* context, ID3D11DeviceContext *dx_context, bool enabled, + float min_depth, float max_depth) +{ + ID3D11VkExtContext *ext_context; + + if (!context->extensions.depthBoundsTest) + return AGS_EXTENSION_NOT_SUPPORTED; + + if (FAILED(ID3D11DeviceContext_QueryInterface(dx_context, &IID_ID3D11VkExtContext, (void **)&ext_context))) + { + TRACE("No ID3D11VkExtContext.\n"); + return AGS_EXTENSION_NOT_SUPPORTED; + } + ID3D11VkExtContext_SetDepthBoundsTest(ext_context, enabled, min_depth, max_depth); + ID3D11VkExtContext_Release(ext_context); + return AGS_SUCCESS; +} + AGSReturnCode WINAPI agsDriverExtensionsDX11_SetDepthBounds(AGSContext* context, bool enabled, - float minDepth, float maxDepth ) + float min_depth, float max_depth ) { - static int once; + TRACE("context %p, enabled %d, min_depth %f, max_depth %f.\n", context, enabled, min_depth, max_depth); - if (!once++) - FIXME("context %p, enabled %#x, minDepth %f, maxDepth %f stub.\n", context, enabled, minDepth, maxDepth); - return AGS_EXTENSION_NOT_SUPPORTED; + if (!context || !context->d3d11_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + + return set_depth_bounds(context, context->d3d11_context, enabled, min_depth, max_depth); } AGSReturnCode WINAPI agsDriverExtensionsDX11_SetDepthBounds_530(AGSContext* context, - ID3D11DeviceContext* dxContext, bool enabled, float minDepth, float maxDepth ) + ID3D11DeviceContext* dx_context, bool enabled, float min_depth, float max_depth ) { - static int once; + TRACE("context %p, dx_context %p, enabled %d, min_depth %f, max_depth %f.\n", context, dx_context, enabled, + min_depth, max_depth); - if (!once++) - FIXME("context %p, enabled %#x, minDepth %f, maxDepth %f stub.\n", context, enabled, minDepth, maxDepth); - return AGS_EXTENSION_NOT_SUPPORTED; + if (!context || !dx_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + + return set_depth_bounds(context, dx_context, enabled, min_depth, max_depth); } __ASM_GLOBAL_FUNC( DX11_SetDepthBounds_impl, diff --git a/dlls/amd_ags_x64/dxvk_interfaces.idl b/dlls/amd_ags_x64/dxvk_interfaces.idl new file mode 100644 index 000000000000..c632d926fb2d --- /dev/null +++ b/dlls/amd_ags_x64/dxvk_interfaces.idl @@ -0,0 +1,116 @@ +/* + * Copyright 2023 Paul Gofman for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "d3d11.idl"; + +typedef enum D3D11_VK_EXTENSION +{ + D3D11_VK_EXT_MULTI_DRAW_INDIRECT, + D3D11_VK_EXT_MULTI_DRAW_INDIRECT_COUNT, + D3D11_VK_EXT_DEPTH_BOUNDS, + D3D11_VK_EXT_BARRIER_CONTROL, + D3D11_VK_NVX_BINARY_IMPORT, + D3D11_VK_NVX_IMAGE_VIEW_HANDLE, +} D3D11_VK_EXTENSION; + +typedef enum D3D11_VK_BARRIER_CONTROL +{ + D3D11_VK_BARRIER_CONTROL_IGNORE_WRITE_AFTER_WRITE = 0x1, + D3D11_VK_BARRIER_CONTROL_IGNORE_GRAPHICS_UAV = 0x2, +} D3D11_VK_BARRIER_CONTROL; + +[ + object, + uuid(bb8a4fb9-3935-4762-b44b-35189a26414a), + local, + pointer_default(unique) +] +interface ID3D11VkExtShader : IUnknown +{ + HRESULT GetSpirvCode([in, out] SIZE_T *code_size, [out] void *code); +} + +[ + object, + uuid(8a6e3c42-f74c-45b7-8265-a231b677ca17), + local, + pointer_default(unique) +] +interface ID3D11VkExtDevice : IUnknown +{ + BOOL GetExtensionSupport([in] D3D11_VK_EXTENSION extension); +} + +[ + object, + uuid(cfcf64ef-9586-46d0-bca4-97cf2ca61b06), + local, + pointer_default(unique) +] +interface ID3D11VkExtDevice1 : ID3D11VkExtDevice +{ + BOOL GetResourceHandleGPUVirtualAddressAndSizeNVX([in] void *object, [out] UINT64 *gpu_va_start, + [out] UINT64 *gpu_va_size); + BOOL CreateUnorderedAccessViewAndGetDriverHandleNVX([in] ID3D11Resource *resource, + [in] const D3D11_UNORDERED_ACCESS_VIEW_DESC *desc, [out] ID3D11UnorderedAccessView **uav, + UINT32 *driver_handle); + BOOL CreateShaderResourceViewAndGetDriverHandleNVX([in] ID3D11Resource *resource, + [in] const D3D11_SHADER_RESOURCE_VIEW_DESC* desc, [out] ID3D11ShaderResourceView **srv, + UINT32 *dirver_handle); + BOOL CreateSamplerStateAndGetDriverHandleNVX([in] const D3D11_SAMPLER_DESC *sample_desc, + [out] ID3D11SamplerState **sample_state, UINT32 *driver_handle); + BOOL CreateCubinComputeShaderWithNameNVX([in] const void *cubin, [in] UINT32 size, [in] UINT32 block_x, + [in] UINT32 block_y, [in] UINT32 block_z, [in] const char *shader_name, [out] IUnknown **shader); + BOOL GetCudaTextureObjectNVX([in] UINT32 srv_driver_hadnle, [in] UINT32 sample_driver_handle, + [out] UINT32 *cuda_texture_handle); +} + +[ + object, + uuid(fd0bca13-5cb6-4c3a-987e-4750de2ca791), + local, + pointer_default(unique) +] +interface ID3D11VkExtContext : IUnknown +{ + void MultiDrawIndirect([in] UINT draw_count, [in] ID3D11Buffer *buffer_for_args, [in] UINT byte_offset_for_args, + [in] UINT byte_stride_for_args); + void MultiDrawIndexedIndirect([in] UINT draw_count, [in] ID3D11Buffer *buffer_for_args, + [in] UINT byte_offset_for_args, [in] UINT byte_stride_for_args); + void MultiDrawIndirectCount([in] UINT max_draw_count, [in] ID3D11Buffer *buffer_for_count, + [in] UINT byte_offset_for_count, [in] ID3D11Buffer *buffer_for_args, + [in] UINT byte_offset_for_args, [in] UINT byte_stride_for_args); + void MultiDrawIndexedIndirectCount([in] UINT max_draw_count, [in] ID3D11Buffer *buffer_for_count, + [in] UINT byte_offset_for_count, [in] ID3D11Buffer *buffer_for_args, + [in] UINT byte_offset_for_args, [in] UINT byte_stride_for_args); + void SetDepthBoundsTest([in] BOOL enable, [in] FLOAT min_depth_bounds, [in] FLOAT max_depth_bounds); + void SetBarrierControl([in] UINT control_flags); +} + +[ + object, + uuid(874b09b2-ae0b-41d8-8476-5f3b7a0e879d), + local, + pointer_default(unique) +] +interface ID3D11VkExtContext1 : ID3D11VkExtContext +{ + BOOL LaunchCubinShaderNVX([in] IUnknown *shader,[in] UINT32 grid_x, [in] UINT32 grid_y, [in] UINT32 grid_z, + [in] const void *params, [in] UINT32 param_size, [in] void * const *read_resources, + [in] UINT32 read_resource_count, [in] void* const *write_resources, [in] UINT32 write_resources_count); +} From 0178bae63a94eada577970c4f9902a8f603c68c7 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 4 May 2023 20:15:20 -0600 Subject: [PATCH 0476/2542] amd_ags_x64: Implement UAV overlap. CW-Bug-Id: #22242 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 66 ++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 16 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index fcdbde22ca14..505a62ca8ed5 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -679,6 +679,8 @@ static void get_dx11_extensions_supported(ID3D11Device *device, AGSDX11Extension } extensions->depthBoundsTest = !!ID3D11VkExtDevice_GetExtensionSupport(ext_device, D3D11_VK_EXT_DEPTH_BOUNDS); + extensions->uavOverlap = !!ID3D11VkExtDevice_GetExtensionSupport(ext_device, D3D11_VK_EXT_BARRIER_CONTROL); + extensions->UAVOverlapDeferredContexts = extensions->uavOverlap; ID3D11VkExtDevice_Release(ext_device); @@ -922,23 +924,48 @@ __ASM_GLOBAL_FUNC( DX11_SetDepthBounds_impl, "jmp " __ASM_NAME("agsDriverExtensionsDX11_SetDepthBounds") "\n\t" "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_SetDepthBounds_530") ) +static AGSReturnCode update_uav_overlap(AGSContext* context, ID3D11DeviceContext *dx_context, BOOL set) +{ + ID3D11VkExtContext *ext_context; + + if (!context->extensions.uavOverlap) + return AGS_EXTENSION_NOT_SUPPORTED; + + if (FAILED(ID3D11DeviceContext_QueryInterface(dx_context, &IID_ID3D11VkExtContext, (void **)&ext_context))) + { + TRACE("No ID3D11VkExtContext.\n"); + return AGS_EXTENSION_NOT_SUPPORTED; + } + + ID3D11VkExtContext_SetBarrierControl(ext_context, set ? D3D11_VK_BARRIER_CONTROL_IGNORE_WRITE_AFTER_WRITE : 0); + ID3D11VkExtContext_Release(ext_context); + return AGS_SUCCESS; +} + AGSReturnCode WINAPI agsDriverExtensionsDX11_BeginUAVOverlap_520(AGSContext *context) { - static int once; + TRACE("context %p.\n", context); - if (!once++) - FIXME("context %p stub.\n", context); - return AGS_EXTENSION_NOT_SUPPORTED; + if (!context || !context->d3d11_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + + return update_uav_overlap(context, context->d3d11_context, TRUE); } AGSReturnCode WINAPI agsDriverExtensionsDX11_BeginUAVOverlap(AGSContext *context, ID3D11DeviceContext *dx_context) { - static int once; + TRACE("context %p, dx_context %p.\n", context, dx_context); - if (!once++) - FIXME("context %p, dx_context %p stub.\n", context, dx_context); + if (!context || !dx_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } - return AGS_EXTENSION_NOT_SUPPORTED; + return update_uav_overlap(context, dx_context, TRUE); } __ASM_GLOBAL_FUNC( DX11_BeginUAVOverlap_impl, @@ -950,21 +977,28 @@ __ASM_GLOBAL_FUNC( DX11_BeginUAVOverlap_impl, AGSReturnCode WINAPI agsDriverExtensionsDX11_EndUAVOverlap_520(AGSContext *context) { - static int once; + TRACE("context %p.\n", context); - if (!once++) - FIXME("context %p stub.\n", context); - return AGS_EXTENSION_NOT_SUPPORTED; + if (!context || !context->d3d11_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + + return update_uav_overlap(context, context->d3d11_context, FALSE); } AGSReturnCode WINAPI agsDriverExtensionsDX11_EndUAVOverlap(AGSContext *context, ID3D11DeviceContext *dx_context) { - static int once; + TRACE("context %p, dx_context %p.\n", context, dx_context); - if (!once++) - FIXME("context %p, dx_context %p stub.\n", context, dx_context); + if (!context || !dx_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } - return AGS_EXTENSION_NOT_SUPPORTED; + return update_uav_overlap(context, dx_context, FALSE); } __ASM_GLOBAL_FUNC( DX11_EndUAVOverlap_impl, From 5b303183f207b717406772d10be02b7100a82b87 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 5 May 2023 17:16:58 -0600 Subject: [PATCH 0477/2542] amd_ags_x64: Update to 6.1.0. --- dlls/amd_ags_x64/amd_ags.h | 5 +++-- dlls/amd_ags_x64/amd_ags_x64_main.c | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index 9b521de75b87..f0afda73d375 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -417,6 +417,7 @@ typedef enum AsicFamily AsicFamily_Vega, ///< AMD Vega architecture, including Raven Ridge (ie AMD Ryzen CPU + AMD Vega GPU). AsicFamily_RDNA, ///< AMD RDNA architecture AsicFamily_RDNA2, ///< AMD RDNA2 architecture + AsicFamily_RDNA3, ///< AMD RDNA3 architecture AsicFamily_Count ///< Number of enumerated ASIC families } AsicFamily; @@ -1422,11 +1423,11 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_WriteBreadcrumb( AGSContext* c /// @{ /// Additional topologies supported via extensions -typedef enum AGSPrimitiveTopology +typedef enum AGSPrimitiveTopologyDX11 { AGS_PRIMITIVE_TOPOLOGY_QUADLIST = 7, ///< Quad list AGS_PRIMITIVE_TOPOLOGY_SCREENRECTLIST = 9 ///< Screen rect list -} AGSPrimitiveTopology; +} AGSPrimitiveTopologyDX11; /// /// Function used to set the primitive topology. If you are using any of the extended topology types, then this function should diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 505a62ca8ed5..f3bb56927399 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -37,6 +37,7 @@ enum amd_ags_version AMD_AGS_VERSION_5_4_2, AMD_AGS_VERSION_6_0_0, AMD_AGS_VERSION_6_0_1, + AMD_AGS_VERSION_6_1_0, AMD_AGS_VERSION_COUNT }; @@ -60,23 +61,24 @@ amd_ags_info[AMD_AGS_VERSION_COUNT] = {5, 4, 2, sizeof(AGSDeviceInfo_542), sizeof(AGSDX11ReturnedParams_520)}, {6, 0, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)}, {6, 0, 1, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)}, + {6, 1, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)}, }; #define DEF_FIELD(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name), \ - offsetof(AGSDeviceInfo_600, name)}} + offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} #define DEF_FIELD_520_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), -1, \ - -1, -1, -1, -1}} + -1, -1, -1, -1, -1}} #define DEF_FIELD_540_UP(name) {DEVICE_FIELD_##name, {-1, -1, \ -1, -1, offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name), \ - offsetof(AGSDeviceInfo_600, name)}} + offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} #define DEF_FIELD_600_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), -1, \ - -1}} + -1, -1}} #define DEVICE_FIELD_adapterString 0 #define DEVICE_FIELD_architectureVersion 1 From 4de53f5f3937e30f69532fdf00014019a678ede0 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 5 May 2023 17:43:41 -0600 Subject: [PATCH 0478/2542] amd_ags_x64: Set isAPU field in device info. --- dlls/amd_ags_x64/amd_ags_x64_main.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index f3bb56927399..a59809d1e9cf 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -75,6 +75,10 @@ amd_ags_info[AMD_AGS_VERSION_COUNT] = -1, -1, offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name), \ offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} +#define DEF_FIELD_540_600(name) {DEVICE_FIELD_##name, {-1, -1, \ + -1, -1, offsetof(AGSDeviceInfo_540, name), \ + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \ + -1, -1, -1}} #define DEF_FIELD_600_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), -1, \ @@ -89,6 +93,7 @@ amd_ags_info[AMD_AGS_VERSION_COUNT] = #define DEVICE_FIELD_localMemoryInBytes 6 #define DEVICE_FIELD_numDisplays 7 #define DEVICE_FIELD_displays 8 +#define DEVICE_FIELD_isAPU 9 static const struct { @@ -106,6 +111,7 @@ device_struct_fields[] = DEF_FIELD(localMemoryInBytes), DEF_FIELD(numDisplays), DEF_FIELD(displays), + DEF_FIELD_540_600(isAPU), }; #undef DEF_FIELD @@ -486,6 +492,7 @@ static AGSReturnCode init_ags_context(AGSContext *context) { const VkPhysicalDeviceProperties *vk_properties = &context->properties[i]; const VkPhysicalDeviceMemoryProperties *vk_memory_properties = &context->memory_properties[i]; + struct AGSDeviceInfo_600 *device_600 = (struct AGSDeviceInfo_600 *)device; VkDeviceSize local_memory_size = 0; for (j = 0; j < vk_memory_properties->memoryHeapCount; j++) @@ -496,7 +503,9 @@ static AGSReturnCode init_ags_context(AGSContext *context) break; } } - TRACE("device %s, %04x:%04x, reporting local memory size 0x%s bytes\n", debugstr_a(vk_properties->deviceName), + + TRACE("device %s, type %d, %04x:%04x, reporting local memory size 0x%s bytes\n", + debugstr_a(vk_properties->deviceName), vk_properties->deviceType, vk_properties->vendorID, vk_properties->deviceID, wine_dbgstr_longlong(local_memory_size)); SET_DEVICE_FIELD(device, adapterString, const char *, context->version, vk_properties->deviceName); @@ -506,6 +515,13 @@ static AGSReturnCode init_ags_context(AGSContext *context) { SET_DEVICE_FIELD(device, architectureVersion, ArchitectureVersion, context->version, ArchitectureVersion_GCN); SET_DEVICE_FIELD(device, asicFamily, AsicFamily, context->version, AsicFamily_GCN4); + if (vk_properties->deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU) + { + if (context->version >= AMD_AGS_VERSION_6_0_0) + device_600->isAPU = 1; + else + SET_DEVICE_FIELD(device, isAPU, int, context->version, 1); + } } SET_DEVICE_FIELD(device, localMemoryInBytes, ULONG64, context->version, local_memory_size); if (!i) @@ -513,7 +529,6 @@ static AGSReturnCode init_ags_context(AGSContext *context) if (context->version >= AMD_AGS_VERSION_6_0_0) { // This is a bitfield now... Nice... - struct AGSDeviceInfo_600 *device_600 = (struct AGSDeviceInfo_600 *)device; device_600->isPrimaryDevice = 1; } else From e41b39a7459848ccea3535f676625c6419452a28 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 5 May 2023 17:55:53 -0600 Subject: [PATCH 0479/2542] amd_ags_x64: Skip non-physical devices. --- dlls/amd_ags_x64/amd_ags_x64_main.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index a59809d1e9cf..dd49e38451b3 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -225,10 +225,18 @@ static AGSReturnCode vk_get_physical_device_properties(unsigned int *out_count, } for (i = 0; i < count; ++i) + { vkGetPhysicalDeviceProperties(vk_physical_devices[i], &properties[i]); - - for (i = 0; i < count; ++i) + if (properties[i].deviceType != VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU + && properties[i].deviceType != VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) + { + TRACE("Skipping device type %d.\n", properties[i].deviceType); + --i; + --count; + continue; + } vkGetPhysicalDeviceMemoryProperties(vk_physical_devices[i], &memory_properties[i]); + } *out_count = count; *out = properties; From 752b32b7a3e8ebd181e8346fa785d0c7b99bf216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 10 Jul 2020 10:09:21 +0200 Subject: [PATCH 0480/2542] atiadlxx: Add stub DLL, disabled by default. This is required by several Call of Duty games when using AMD GPU. --- configure.ac | 1 + dlls/atiadlxx/Makefile.in | 6 + dlls/atiadlxx/atiadlxx.spec | 1138 +++++++++++++++++++++++++++++++++ dlls/atiadlxx/atiadlxx_main.c | 91 +++ loader/wine.inf.in | 1 + 5 files changed, 1237 insertions(+) create mode 100644 dlls/atiadlxx/Makefile.in create mode 100644 dlls/atiadlxx/atiadlxx.spec create mode 100644 dlls/atiadlxx/atiadlxx_main.c diff --git a/configure.ac b/configure.ac index 4291637213ab..161d616727d6 100644 --- a/configure.ac +++ b/configure.ac @@ -2416,6 +2416,7 @@ WINE_CONFIG_MAKEFILE(dlls/apphelp) WINE_CONFIG_MAKEFILE(dlls/apphelp/tests) WINE_CONFIG_MAKEFILE(dlls/appwiz.cpl) WINE_CONFIG_MAKEFILE(dlls/appxdeploymentclient) +WINE_CONFIG_MAKEFILE(dlls/atiadlxx) WINE_CONFIG_MAKEFILE(dlls/atl) WINE_CONFIG_MAKEFILE(dlls/atl/tests) WINE_CONFIG_MAKEFILE(dlls/atl100) diff --git a/dlls/atiadlxx/Makefile.in b/dlls/atiadlxx/Makefile.in new file mode 100644 index 000000000000..80f456edb75f --- /dev/null +++ b/dlls/atiadlxx/Makefile.in @@ -0,0 +1,6 @@ +EXTRADEFS = -DWINE_NO_LONG_TYPES +MODULE = atiadlxx.dll +EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native + +SOURCES = \ + atiadlxx_main.c diff --git a/dlls/atiadlxx/atiadlxx.spec b/dlls/atiadlxx/atiadlxx.spec new file mode 100644 index 000000000000..e2a1f46a838c --- /dev/null +++ b/dlls/atiadlxx/atiadlxx.spec @@ -0,0 +1,1138 @@ +@ stub ADL2_ADC_CurrentProfileFromDrv_Get +@ stub ADL2_ADC_Display_AdapterDeviceProfileEx_Get +@ stub ADL2_ADC_DrvDataToProfile_Copy +@ stub ADL2_ADC_FindClosestMode_Get +@ stub ADL2_ADC_IsDevModeEqual_Get +@ stub ADL2_ADC_Profile_Apply +@ stub ADL2_APO_AudioDelayAdjustmentInfo_Get +@ stub ADL2_APO_AudioDelay_Restore +@ stub ADL2_APO_AudioDelay_Set +@ stub ADL2_AdapterLimitation_Caps +@ stub ADL2_AdapterX2_Caps +@ stub ADL2_Adapter_AMDAndNonAMDDIsplayClone_Get +@ stub ADL2_Adapter_ASICFamilyType_Get +@ stub ADL2_Adapter_ASICInfo_Get +@ stub ADL2_Adapter_Accessibility_Get +@ stub ADL2_Adapter_AceDefaults_Restore +@ stub ADL2_Adapter_Active_Get +@ stub ADL2_Adapter_Active_Set +@ stub ADL2_Adapter_Active_SetPrefer +@ stub ADL2_Adapter_AdapterInfoX2_Get +@ stub ADL2_Adapter_AdapterInfoX3_Get +@ stub ADL2_Adapter_AdapterInfoX4_Get +@ stub ADL2_Adapter_AdapterInfo_Get +@ stub ADL2_Adapter_AdapterList_Disable +@ stub ADL2_Adapter_AdapterLocationPath_Get +@ stub ADL2_Adapter_Aspects_Get +@ stub ADL2_Adapter_AudioChannelSplitConfiguration_Get +@ stub ADL2_Adapter_AudioChannelSplit_Disable +@ stub ADL2_Adapter_AudioChannelSplit_Enable +@ stub ADL2_Adapter_BigSw_Info_Get +@ stub ADL2_Adapter_BlackAndWhiteLevelSupport_Get +@ stub ADL2_Adapter_BlackAndWhiteLevel_Get +@ stub ADL2_Adapter_BlackAndWhiteLevel_Set +@ stub ADL2_Adapter_BoardLayout_Get +@ stub ADL2_Adapter_Caps +@ stub ADL2_Adapter_ChipSetInfo_Get +@ stub ADL2_Adapter_CloneTypes_Get +@ stub ADL2_Adapter_ConfigMemory_Cap +@ stub ADL2_Adapter_ConfigMemory_Get +@ stub ADL2_Adapter_ConfigureState_Get +@ stub ADL2_Adapter_ConnectionData_Get +@ stub ADL2_Adapter_ConnectionData_Remove +@ stub ADL2_Adapter_ConnectionData_Set +@ stub ADL2_Adapter_ConnectionState_Get +@ stub ADL2_Adapter_CrossDisplayPlatformInfo_Get +@ stub ADL2_Adapter_CrossGPUClone_Disable +@ stub ADL2_Adapter_CrossdisplayAdapterRole_Caps +@ stub ADL2_Adapter_CrossdisplayInfoX2_Set +@ stub ADL2_Adapter_CrossdisplayInfo_Get +@ stub ADL2_Adapter_CrossdisplayInfo_Set +@ stub ADL2_Adapter_CrossfireX2_Get +@ stub ADL2_Adapter_Crossfire_Caps +@ stub ADL2_Adapter_Crossfire_Get +@ stub ADL2_Adapter_Crossfire_Set +@ stub ADL2_Adapter_DefaultAudioChannelTable_Load +@ stub ADL2_Adapter_Desktop_Caps +@ stub ADL2_Adapter_Desktop_SupportedSLSGridTypes_Get +@ stub ADL2_Adapter_DeviceID_Get +@ stub ADL2_Adapter_DisplayAudioEndpoint_Enable +@ stub ADL2_Adapter_DisplayAudioEndpoint_Mute +@ stub ADL2_Adapter_DisplayAudioInfo_Get +@ stub ADL2_Adapter_DisplayGTCCaps_Get +@ stub ADL2_Adapter_Display_Caps +@ stub ADL2_Adapter_DriverSettings_Get +@ stub ADL2_Adapter_DriverSettings_Set +@ stub ADL2_Adapter_ECC_ErrorInjection_Set +@ stub ADL2_Adapter_ECC_ErrorRecords_Get +@ stub ADL2_Adapter_EDC_ErrorInjection_Set +@ stub ADL2_Adapter_EDC_ErrorRecords_Get +@ stub ADL2_Adapter_EDIDManagement_Caps +@ stub ADL2_Adapter_EmulationMode_Set +@ stub ADL2_Adapter_ExtInfo_Get +@ stub ADL2_Adapter_Feature_Caps +@ stub ADL2_Adapter_FrameMetrics_Caps +@ stub ADL2_Adapter_FrameMetrics_FrameDuration_Disable +@ stub ADL2_Adapter_FrameMetrics_FrameDuration_Enable +@ stub ADL2_Adapter_FrameMetrics_FrameDuration_Get +@ stub ADL2_Adapter_FrameMetrics_FrameDuration_Start +@ stub ADL2_Adapter_FrameMetrics_FrameDuration_Stop +@ stub ADL2_Adapter_FrameMetrics_Get +@ stub ADL2_Adapter_FrameMetrics_Start +@ stub ADL2_Adapter_FrameMetrics_Stop +@ stub ADL2_Adapter_Gamma_Get +@ stub ADL2_Adapter_Gamma_Set +@ stub ADL2_Adapter_Graphic_Core_Info_Get +@ stub ADL2_Adapter_HBC_Caps +@ stub ADL2_Adapter_HBM_ECC_UC_Check +@ stub ADL2_Adapter_Headless_Get +@ stub ADL2_Adapter_ID_Get +@ stub ADL2_Adapter_IsGamingDriver_Info_Get +@ stub ADL2_Adapter_LocalDisplayConfig_Get +@ stub ADL2_Adapter_LocalDisplayConfig_Set +@ stub ADL2_Adapter_LocalDisplayState_Get +@ stub ADL2_Adapter_MVPU_Set +@ stub ADL2_Adapter_MaxCursorSize_Get +@ stub ADL2_Adapter_MemoryInfo2_Get +@ stub ADL2_Adapter_MemoryInfo_Get +@ stub ADL2_Adapter_MirabilisSupport_Get +@ stub ADL2_Adapter_ModeSwitch +@ stub ADL2_Adapter_ModeTimingOverride_Caps +@ stub ADL2_Adapter_Modes_ReEnumerate +@ stub ADL2_Adapter_NumberOfActivatableSources_Get +@ stdcall ADL2_Adapter_NumberOfAdapters_Get(ptr ptr) +@ stub ADL2_Adapter_ObservedClockInfo_Get +@ stub ADL2_Adapter_PMLog_Start +@ stub ADL2_Adapter_PMLog_Stop +@ stub ADL2_Adapter_PMLog_Support_Get +@ stub ADL2_Adapter_PreFlipPostProcessing_Disable +@ stub ADL2_Adapter_PreFlipPostProcessing_Enable +@ stub ADL2_Adapter_PreFlipPostProcessing_Get_Status +@ stub ADL2_Adapter_PreFlipPostProcessing_Select_LUT_Algorithm +@ stub ADL2_Adapter_PreFlipPostProcessing_Select_LUT_Buffer +@ stub ADL2_Adapter_PreFlipPostProcessing_Unselect_LUT_Buffer +@ stub ADL2_Adapter_Primary_Get +@ stub ADL2_Adapter_Primary_Set +@ stub ADL2_Adapter_RAS_ErrorInjection_Set +@ stub ADL2_Adapter_RegValueInt_Get +@ stub ADL2_Adapter_RegValueInt_Set +@ stub ADL2_Adapter_RegValueString_Get +@ stub ADL2_Adapter_RegValueString_Set +@ stub ADL2_Adapter_SWInfo_Get +@ stub ADL2_Adapter_Speed_Caps +@ stub ADL2_Adapter_Speed_Get +@ stub ADL2_Adapter_Speed_Set +@ stub ADL2_Adapter_SupportedConnections_Get +@ stub ADL2_Adapter_TRNG_Get +@ stub ADL2_Adapter_Tear_Free_Cap +@ stub ADL2_Adapter_VRAMUsage_Get +@ stub ADL2_Adapter_VariBrightEnable_Set +@ stub ADL2_Adapter_VariBrightLevel_Get +@ stub ADL2_Adapter_VariBrightLevel_Set +@ stub ADL2_Adapter_VariBright_Caps +@ stub ADL2_Adapter_VerndorID_Int_get +@ stub ADL2_Adapter_VideoBiosInfo_Get +@ stub ADL2_Adapter_VideoTheaterModeInfo_Get +@ stub ADL2_Adapter_VideoTheaterModeInfo_Set +@ stub ADL2_Adapter_XConnectSupport_Get +@ stub ADL2_ApplicationProfilesX2_AppInterceptionList_Set +@ stub ADL2_ApplicationProfilesX2_AppStartStopInfo_Get +@ stub ADL2_ApplicationProfiles_AppInterceptionList_Set +@ stub ADL2_ApplicationProfiles_AppInterception_Set +@ stub ADL2_ApplicationProfiles_AppStartStopInfo_Get +@ stub ADL2_ApplicationProfiles_AppStartStop_Resume +@ stub ADL2_ApplicationProfiles_Applications_Get +@ stub ADL2_ApplicationProfiles_ConvertToCompact +@ stub ADL2_ApplicationProfiles_DriverAreaPrivacy_Get +@ stub ADL2_ApplicationProfiles_GetCustomization +@ stub ADL2_ApplicationProfiles_HitListsX2_Get +@ stub ADL2_ApplicationProfiles_HitListsX3_Get +@ stub ADL2_ApplicationProfiles_HitLists_Get +@ stub ADL2_ApplicationProfiles_ProfileApplicationX2_Assign +@ stub ADL2_ApplicationProfiles_ProfileApplication_Assign +@ stub ADL2_ApplicationProfiles_ProfileOfAnApplicationX2_Search +@ stub ADL2_ApplicationProfiles_ProfileOfAnApplication_InMemorySearch +@ stub ADL2_ApplicationProfiles_ProfileOfAnApplication_Search +@ stub ADL2_ApplicationProfiles_Profile_Create +@ stub ADL2_ApplicationProfiles_Profile_Exist +@ stub ADL2_ApplicationProfiles_Profile_Remove +@ stub ADL2_ApplicationProfiles_PropertyType_Get +@ stub ADL2_ApplicationProfiles_Release_Get +@ stub ADL2_ApplicationProfiles_RemoveApplication +@ stub ADL2_ApplicationProfiles_StatusInfo_Get +@ stub ADL2_ApplicationProfiles_System_Reload +@ stub ADL2_ApplicationProfiles_User_Load +@ stub ADL2_ApplicationProfiles_User_Unload +@ stub ADL2_Audio_CurrentSampleRate_Get +@ stub ADL2_AutoTuningResult_Get +@ stub ADL2_BOOST_Settings_Get +@ stub ADL2_BOOST_Settings_Set +@ stub ADL2_Blockchain_BlockchainMode_Caps +@ stub ADL2_Blockchain_BlockchainMode_Get +@ stub ADL2_Blockchain_BlockchainMode_Set +@ stub ADL2_Blockchain_Hashrate_Set +@ stub ADL2_CDS_UnsafeMode_Set +@ stub ADL2_CHILL_SettingsX2_Get +@ stub ADL2_CHILL_SettingsX2_Set +@ stub ADL2_CV_DongleSettings_Get +@ stub ADL2_CV_DongleSettings_Reset +@ stub ADL2_CV_DongleSettings_Set +@ stub ADL2_Chill_Caps_Get +@ stub ADL2_Chill_Settings_Get +@ stub ADL2_Chill_Settings_Notify +@ stub ADL2_Chill_Settings_Set +@ stub ADL2_CustomFan_Caps +@ stub ADL2_CustomFan_Get +@ stub ADL2_CustomFan_Set +@ stub ADL2_DELAG_Settings_Get +@ stub ADL2_DELAG_Settings_Set +@ stub ADL2_DFP_AllowOnlyCETimings_Get +@ stub ADL2_DFP_AllowOnlyCETimings_Set +@ stub ADL2_DFP_BaseAudioSupport_Get +@ stub ADL2_DFP_GPUScalingEnable_Get +@ stub ADL2_DFP_GPUScalingEnable_Set +@ stub ADL2_DFP_HDMISupport_Get +@ stub ADL2_DFP_MVPUAnalogSupport_Get +@ stub ADL2_DFP_PixelFormat_Caps +@ stub ADL2_DFP_PixelFormat_Get +@ stub ADL2_DFP_PixelFormat_Set +@ stub ADL2_DVRSupport_Get +@ stub ADL2_Desktop_DOPP_Enable +@ stub ADL2_Desktop_DOPP_EnableX2 +@ stub ADL2_Desktop_Detach +@ stub ADL2_Desktop_Device_Create +@ stub ADL2_Desktop_Device_Destroy +@ stub ADL2_Desktop_ExclusiveModeX2_Get +@ stub ADL2_Desktop_HardwareCursor_SetBitmap +@ stub ADL2_Desktop_HardwareCursor_SetPosition +@ stub ADL2_Desktop_HardwareCursor_Toggle +@ stub ADL2_Desktop_PFPAComplete_Set +@ stub ADL2_Desktop_PFPAState_Get +@ stub ADL2_Desktop_PrimaryInfo_Get +@ stub ADL2_Desktop_TextureState_Get +@ stub ADL2_Desktop_Texture_Enable +@ stub ADL2_Device_PMLog_Device_Create +@ stub ADL2_Device_PMLog_Device_Destroy +@ stub ADL2_DisplayScaling_Set +@ stub ADL2_Display_AdapterID_Get +@ stub ADL2_Display_AdjustCaps_Get +@ stub ADL2_Display_AdjustmentCoherent_Get +@ stub ADL2_Display_AdjustmentCoherent_Set +@ stub ADL2_Display_AudioMappingInfo_Get +@ stub ADL2_Display_AvivoColor_Get +@ stub ADL2_Display_AvivoCurrentColor_Set +@ stub ADL2_Display_AvivoDefaultColor_Set +@ stub ADL2_Display_BackLight_Get +@ stub ADL2_Display_BackLight_Set +@ stub ADL2_Display_BezelOffsetSteppingSize_Get +@ stub ADL2_Display_BezelOffset_Set +@ stub ADL2_Display_BezelSupported_Validate +@ stub ADL2_Display_Capabilities_Get +@ stub ADL2_Display_ColorCaps_Get +@ stub ADL2_Display_ColorDepth_Get +@ stub ADL2_Display_ColorDepth_Set +@ stub ADL2_Display_ColorTemperatureSourceDefault_Get +@ stub ADL2_Display_ColorTemperatureSource_Get +@ stub ADL2_Display_ColorTemperatureSource_Set +@ stub ADL2_Display_Color_Get +@ stub ADL2_Display_Color_Set +@ stub ADL2_Display_ConnectedDisplays_Get +@ stub ADL2_Display_ContainerID_Get +@ stub ADL2_Display_ControllerOverlayAdjustmentCaps_Get +@ stub ADL2_Display_ControllerOverlayAdjustmentData_Get +@ stub ADL2_Display_ControllerOverlayAdjustmentData_Set +@ stub ADL2_Display_CustomizedModeListNum_Get +@ stub ADL2_Display_CustomizedModeList_Get +@ stub ADL2_Display_CustomizedMode_Add +@ stub ADL2_Display_CustomizedMode_Delete +@ stub ADL2_Display_CustomizedMode_Validate +@ stub ADL2_Display_DCE_Get +@ stub ADL2_Display_DCE_Set +@ stub ADL2_Display_DDCBlockAccess_Get +@ stub ADL2_Display_DDCInfo2_Get +@ stub ADL2_Display_DDCInfo_Get +@ stub ADL2_Display_Deflicker_Get +@ stub ADL2_Display_Deflicker_Set +@ stub ADL2_Display_DeviceConfig_Get +@ stub ADL2_Display_DisplayContent_Cap +@ stub ADL2_Display_DisplayContent_Get +@ stub ADL2_Display_DisplayContent_Set +@ stub ADL2_Display_DisplayInfo_Get +@ stub ADL2_Display_DisplayMapConfigX2_Set +@ stub ADL2_Display_DisplayMapConfig_Get +@ stub ADL2_Display_DisplayMapConfig_PossibleAddAndRemove +@ stub ADL2_Display_DisplayMapConfig_Set +@ stub ADL2_Display_DisplayMapConfig_Validate +@ stub ADL2_Display_DitherState_Get +@ stub ADL2_Display_DitherState_Set +@ stub ADL2_Display_Downscaling_Caps +@ stub ADL2_Display_DpMstAuxMsg_Get +@ stub ADL2_Display_DpMstInfo_Get +@ stub ADL2_Display_DummyVirtual_Destroy +@ stub ADL2_Display_DummyVirtual_Get +@ stub ADL2_Display_EdidData_Get +@ stub ADL2_Display_EdidData_Set +@ stub ADL2_Display_EnumDisplays_Get +@ stub ADL2_Display_FilterSVideo_Get +@ stub ADL2_Display_FilterSVideo_Set +@ stub ADL2_Display_ForcibleDisplay_Get +@ stub ADL2_Display_ForcibleDisplay_Set +@ stub ADL2_Display_FormatsOverride_Get +@ stub ADL2_Display_FormatsOverride_Set +@ stub ADL2_Display_FreeSyncState_Get +@ stub ADL2_Display_FreeSyncState_Set +@ stub ADL2_Display_FreeSync_Cap +@ stub ADL2_Display_GamutMapping_Get +@ stub ADL2_Display_GamutMapping_Reset +@ stub ADL2_Display_GamutMapping_Set +@ stub ADL2_Display_Gamut_Caps +@ stub ADL2_Display_Gamut_Get +@ stub ADL2_Display_Gamut_Set +@ stub ADL2_Display_HDCP_Get +@ stub ADL2_Display_HDCP_Set +@ stub ADL2_Display_HDRState_Get +@ stub ADL2_Display_HDRState_Set +@ stub ADL2_Display_ImageExpansion_Get +@ stub ADL2_Display_ImageExpansion_Set +@ stub ADL2_Display_InfoPacket_Get +@ stub ADL2_Display_InfoPacket_Set +@ stub ADL2_Display_IsVirtual_Get +@ stub ADL2_Display_LCDRefreshRateCapability_Get +@ stub ADL2_Display_LCDRefreshRateOptions_Get +@ stub ADL2_Display_LCDRefreshRateOptions_Set +@ stub ADL2_Display_LCDRefreshRate_Get +@ stub ADL2_Display_LCDRefreshRate_Set +@ stub ADL2_Display_Limits_Get +@ stub ADL2_Display_MVPUCaps_Get +@ stub ADL2_Display_MVPUStatus_Get +@ stub ADL2_Display_ModeTimingOverrideInfo_Get +@ stub ADL2_Display_ModeTimingOverrideListX2_Get +@ stub ADL2_Display_ModeTimingOverrideListX3_Get +@ stub ADL2_Display_ModeTimingOverrideList_Get +@ stub ADL2_Display_ModeTimingOverrideX2_Get +@ stub ADL2_Display_ModeTimingOverrideX2_Set +@ stub ADL2_Display_ModeTimingOverrideX3_Get +@ stub ADL2_Display_ModeTimingOverride_Delete +@ stub ADL2_Display_ModeTimingOverride_Get +@ stub ADL2_Display_ModeTimingOverride_Set +@ stub ADL2_Display_Modes_Get +@ stub ADL2_Display_Modes_Set +@ stub ADL2_Display_Modes_X2_Get +@ stub ADL2_Display_MonitorPowerState_Set +@ stub ADL2_Display_NativeAUXChannel_Access +@ stub ADL2_Display_NeedWorkaroundFor5Clone_Get +@ stub ADL2_Display_NumberOfDisplays_Get +@ stub ADL2_Display_ODClockConfig_Set +@ stub ADL2_Display_ODClockInfo_Get +@ stub ADL2_Display_Overlap_NotifyAdjustment +@ stub ADL2_Display_Overlap_Set +@ stub ADL2_Display_Overscan_Get +@ stub ADL2_Display_Overscan_Set +@ stub ADL2_Display_PixelFormatDefault_Get +@ stub ADL2_Display_PixelFormat_Get +@ stub ADL2_Display_PixelFormat_Set +@ stub ADL2_Display_Position_Get +@ stub ADL2_Display_Position_Set +@ stub ADL2_Display_PossibleMapping_Get +@ stub ADL2_Display_PossibleMode_Get +@ stub ADL2_Display_PowerXpressActiveGPU_Get +@ stub ADL2_Display_PowerXpressActiveGPU_Set +@ stub ADL2_Display_PowerXpressActvieGPUR2_Get +@ stub ADL2_Display_PowerXpressVersion_Get +@ stub ADL2_Display_PowerXpress_AutoSwitchConfig_Get +@ stub ADL2_Display_PowerXpress_AutoSwitchConfig_Set +@ stub ADL2_Display_PreferredMode_Get +@ stub ADL2_Display_PreservedAspectRatio_Get +@ stub ADL2_Display_PreservedAspectRatio_Set +@ stub ADL2_Display_Property_Get +@ stub ADL2_Display_Property_Set +@ stub ADL2_Display_RcDisplayAdjustment +@ stub ADL2_Display_ReGammaCoefficients_Get +@ stub ADL2_Display_ReGammaCoefficients_Set +@ stub ADL2_Display_ReducedBlanking_Get +@ stub ADL2_Display_ReducedBlanking_Set +@ stub ADL2_Display_RegammaR1_Get +@ stub ADL2_Display_RegammaR1_Set +@ stub ADL2_Display_Regamma_Get +@ stub ADL2_Display_Regamma_Set +@ stub ADL2_Display_SLSBuilder_CommonMode_Get +@ stub ADL2_Display_SLSBuilder_Create +@ stub ADL2_Display_SLSBuilder_DisplaysCanBeNextCandidateInSLS_Get +@ stub ADL2_Display_SLSBuilder_DisplaysCanBeNextCandidateToEnabled_Get +@ stub ADL2_Display_SLSBuilder_Get +@ stub ADL2_Display_SLSBuilder_IsActive_Notify +@ stub ADL2_Display_SLSBuilder_MaxSLSLayoutSize_Get +@ stub ADL2_Display_SLSBuilder_TimeOut_Get +@ stub ADL2_Display_SLSBuilder_Update +@ stub ADL2_Display_SLSGrid_Caps +@ stub ADL2_Display_SLSMapConfigX2_Delete +@ stub ADL2_Display_SLSMapConfigX2_Get +@ stub ADL2_Display_SLSMapConfig_Create +@ stub ADL2_Display_SLSMapConfig_Delete +@ stub ADL2_Display_SLSMapConfig_Get +@ stub ADL2_Display_SLSMapConfig_ImageCropType_Set +@ stub ADL2_Display_SLSMapConfig_Rearrange +@ stub ADL2_Display_SLSMapConfig_SetState +@ stub ADL2_Display_SLSMapConfig_SupportedImageCropType_Get +@ stub ADL2_Display_SLSMapConfig_Valid +@ stub ADL2_Display_SLSMapIndexList_Get +@ stub ADL2_Display_SLSMapIndex_Get +@ stub ADL2_Display_SLSMiddleMode_Get +@ stub ADL2_Display_SLSMiddleMode_Set +@ stub ADL2_Display_SLSRecords_Get +@ stub ADL2_Display_Sharpness_Caps +@ stub ADL2_Display_Sharpness_Get +@ stub ADL2_Display_Sharpness_Info_Get +@ stub ADL2_Display_Sharpness_Set +@ stub ADL2_Display_Size_Get +@ stub ADL2_Display_Size_Set +@ stub ADL2_Display_SourceContentAttribute_Get +@ stub ADL2_Display_SourceContentAttribute_Set +@ stub ADL2_Display_SplitDisplay_Caps +@ stub ADL2_Display_SplitDisplay_Get +@ stub ADL2_Display_SplitDisplay_RestoreDesktopConfiguration +@ stub ADL2_Display_SplitDisplay_Set +@ stub ADL2_Display_SupportedColorDepth_Get +@ stub ADL2_Display_SupportedPixelFormat_Get +@ stub ADL2_Display_SwitchingCapability_Get +@ stub ADL2_Display_TVCaps_Get +@ stub ADL2_Display_TargetTimingX2_Get +@ stub ADL2_Display_TargetTiming_Get +@ stub ADL2_Display_UnderScan_Auto_Get +@ stub ADL2_Display_UnderScan_Auto_Set +@ stub ADL2_Display_UnderscanState_Get +@ stub ADL2_Display_UnderscanState_Set +@ stub ADL2_Display_UnderscanSupport_Get +@ stub ADL2_Display_Underscan_Get +@ stub ADL2_Display_Underscan_Set +@ stub ADL2_Display_Vector_Get +@ stub ADL2_Display_ViewPort_Cap +@ stub ADL2_Display_ViewPort_Get +@ stub ADL2_Display_ViewPort_Set +@ stub ADL2_Display_VirtualType_Get +@ stub ADL2_Display_WriteAndReadI2C +@ stub ADL2_Display_WriteAndReadI2CLargePayload +@ stub ADL2_Display_WriteAndReadI2CRev_Get +@ stub ADL2_ElmCompatibilityMode_Caps +@ stub ADL2_ElmCompatibilityMode_Status_Get +@ stub ADL2_ElmCompatibilityMode_Status_Set +@ stub ADL2_ExclusiveModeGet +@ stub ADL2_FPS_Caps +@ stub ADL2_FPS_Settings_Get +@ stub ADL2_FPS_Settings_Reset +@ stub ADL2_FPS_Settings_Set +@ stub ADL2_Feature_Settings_Get +@ stub ADL2_Feature_Settings_Set +@ stub ADL2_Flush_Driver_Data +@ stub ADL2_GPUVMPageSize_Info_Get +@ stub ADL2_GPUVMPageSize_Info_Set +@ stub ADL2_GPUVerInfo_Get +@ stub ADL2_GcnAsicInfo_Get +@ stub ADL2_Graphics_IsDetachableGraphicsPlatform_Get +@ stub ADL2_Graphics_IsGfx9AndAbove +@ stub ADL2_Graphics_MantleVersion_Get +@ stub ADL2_Graphics_Platform_Get +@ stdcall ADL2_Graphics_VersionsX2_Get(ptr ptr) +@ stub ADL2_Graphics_Versions_Get +@ stub ADL2_Graphics_VulkanVersion_Get +@ stub ADL2_HybridGraphicsGPU_Set +@ stub ADL2_MGPUSLS_Status_Set +@ stub ADL2_MMD_FeatureList_Get +@ stub ADL2_MMD_FeatureValuesX2_Get +@ stub ADL2_MMD_FeatureValuesX2_Set +@ stub ADL2_MMD_FeatureValues_Get +@ stub ADL2_MMD_FeatureValues_Set +@ stub ADL2_MMD_FeaturesX2_Caps +@ stub ADL2_MMD_Features_Caps +@ stub ADL2_MMD_VideoAdjustInfo_Get +@ stub ADL2_MMD_VideoAdjustInfo_Set +@ stub ADL2_MMD_VideoColor_Caps +@ stub ADL2_MMD_VideoColor_Get +@ stub ADL2_MMD_VideoColor_Set +@ stub ADL2_MMD_Video_Caps +@ stub ADL2_Main_ControlX2_Create +@ stdcall ADL2_Main_Control_Create(ptr long ptr) +@ stub ADL2_Main_Control_Destroy +@ stub ADL2_Main_Control_GetProcAddress +@ stub ADL2_Main_Control_IsFunctionValid +@ stub ADL2_Main_Control_Refresh +@ stub ADL2_Main_LogDebug_Set +@ stub ADL2_Main_LogError_Set +@ stub ADL2_New_QueryPMLogData_Get +@ stub ADL2_Overdrive5_CurrentActivity_Get +@ stub ADL2_Overdrive5_FanSpeedInfo_Get +@ stub ADL2_Overdrive5_FanSpeedToDefault_Set +@ stub ADL2_Overdrive5_FanSpeed_Get +@ stub ADL2_Overdrive5_FanSpeed_Set +@ stub ADL2_Overdrive5_ODParameters_Get +@ stub ADL2_Overdrive5_ODPerformanceLevels_Get +@ stub ADL2_Overdrive5_ODPerformanceLevels_Set +@ stub ADL2_Overdrive5_PowerControlAbsValue_Caps +@ stub ADL2_Overdrive5_PowerControlAbsValue_Get +@ stub ADL2_Overdrive5_PowerControlAbsValue_Set +@ stub ADL2_Overdrive5_PowerControlInfo_Get +@ stub ADL2_Overdrive5_PowerControl_Caps +@ stub ADL2_Overdrive5_PowerControl_Get +@ stub ADL2_Overdrive5_PowerControl_Set +@ stub ADL2_Overdrive5_Temperature_Get +@ stub ADL2_Overdrive5_ThermalDevices_Enum +@ stub ADL2_Overdrive6_AdvancedFan_Caps +@ stub ADL2_Overdrive6_CapabilitiesEx_Get +@ stub ADL2_Overdrive6_Capabilities_Get +@ stub ADL2_Overdrive6_ControlI2C +@ stub ADL2_Overdrive6_CurrentPower_Get +@ stub ADL2_Overdrive6_CurrentStatus_Get +@ stub ADL2_Overdrive6_FanPWMLimitData_Get +@ stub ADL2_Overdrive6_FanPWMLimitData_Set +@ stub ADL2_Overdrive6_FanPWMLimitRangeInfo_Get +@ stub ADL2_Overdrive6_FanSpeed_Get +@ stub ADL2_Overdrive6_FanSpeed_Reset +@ stub ADL2_Overdrive6_FanSpeed_Set +@ stub ADL2_Overdrive6_FuzzyController_Caps +@ stub ADL2_Overdrive6_MaxClockAdjust_Get +@ stub ADL2_Overdrive6_PowerControlInfo_Get +@ stub ADL2_Overdrive6_PowerControlInfo_Get_X2 +@ stub ADL2_Overdrive6_PowerControl_Caps +@ stub ADL2_Overdrive6_PowerControl_Get +@ stub ADL2_Overdrive6_PowerControl_Set +@ stub ADL2_Overdrive6_StateEx_Get +@ stub ADL2_Overdrive6_StateEx_Set +@ stub ADL2_Overdrive6_StateInfo_Get +@ stub ADL2_Overdrive6_State_Reset +@ stub ADL2_Overdrive6_State_Set +@ stub ADL2_Overdrive6_TargetTemperatureData_Get +@ stub ADL2_Overdrive6_TargetTemperatureData_Set +@ stub ADL2_Overdrive6_TargetTemperatureRangeInfo_Get +@ stub ADL2_Overdrive6_TemperatureEx_Get +@ stub ADL2_Overdrive6_Temperature_Get +@ stub ADL2_Overdrive6_ThermalController_Caps +@ stub ADL2_Overdrive6_ThermalLimitUnlock_Get +@ stub ADL2_Overdrive6_ThermalLimitUnlock_Set +@ stub ADL2_Overdrive6_VoltageControlInfo_Get +@ stub ADL2_Overdrive6_VoltageControl_Get +@ stub ADL2_Overdrive6_VoltageControl_Set +@ stub ADL2_Overdrive8_Current_SettingX2_Get +@ stub ADL2_Overdrive8_Current_SettingX3_Get +@ stub ADL2_Overdrive8_Current_Setting_Get +@ stub ADL2_Overdrive8_Init_SettingX2_Get +@ stub ADL2_Overdrive8_Init_Setting_Get +@ stub ADL2_Overdrive8_PMLogSenorRange_Caps +@ stub ADL2_Overdrive8_PMLogSenorType_Support_Get +@ stub ADL2_Overdrive8_PMLog_ShareMemory_Read +@ stub ADL2_Overdrive8_PMLog_ShareMemory_Start +@ stub ADL2_Overdrive8_PMLog_ShareMemory_Stop +@ stub ADL2_Overdrive8_PMLog_ShareMemory_Support +@ stub ADL2_Overdrive8_Setting_Set +@ stub ADL2_OverdriveN_AutoWattman_Caps +@ stub ADL2_OverdriveN_AutoWattman_Get +@ stub ADL2_OverdriveN_AutoWattman_Set +@ stub ADL2_OverdriveN_CapabilitiesX2_Get +@ stub ADL2_OverdriveN_Capabilities_Get +@ stub ADL2_OverdriveN_CountOfEvents_Get +@ stub ADL2_OverdriveN_FanControl_Get +@ stub ADL2_OverdriveN_FanControl_Set +@ stub ADL2_OverdriveN_MemoryClocksX2_Get +@ stub ADL2_OverdriveN_MemoryClocksX2_Set +@ stub ADL2_OverdriveN_MemoryClocks_Get +@ stub ADL2_OverdriveN_MemoryClocks_Set +@ stub ADL2_OverdriveN_MemoryTimingLevel_Get +@ stub ADL2_OverdriveN_MemoryTimingLevel_Set +@ stub ADL2_OverdriveN_PerformanceStatus_Get +@ stub ADL2_OverdriveN_PowerLimit_Get +@ stub ADL2_OverdriveN_PowerLimit_Set +@ stub ADL2_OverdriveN_SCLKAutoOverClock_Get +@ stub ADL2_OverdriveN_SCLKAutoOverClock_Set +@ stub ADL2_OverdriveN_SettingsExt_Get +@ stub ADL2_OverdriveN_SettingsExt_Set +@ stub ADL2_OverdriveN_SystemClocksX2_Get +@ stub ADL2_OverdriveN_SystemClocksX2_Set +@ stub ADL2_OverdriveN_SystemClocks_Get +@ stub ADL2_OverdriveN_SystemClocks_Set +@ stub ADL2_OverdriveN_Temperature_Get +@ stub ADL2_OverdriveN_Test_Set +@ stub ADL2_OverdriveN_ThrottleNotification_Get +@ stub ADL2_OverdriveN_ZeroRPMFan_Get +@ stub ADL2_OverdriveN_ZeroRPMFan_Set +@ stub ADL2_Overdrive_Caps +@ stub ADL2_PPLogSettings_Get +@ stub ADL2_PPLogSettings_Set +@ stub ADL2_PPW_Caps +@ stub ADL2_PPW_Status_Get +@ stub ADL2_PPW_Status_Set +@ stub ADL2_PageMigration_Settings_Get +@ stub ADL2_PageMigration_Settings_Set +@ stub ADL2_PerGPU_GDEvent_Register +@ stub ADL2_PerGPU_GDEvent_UnRegister +@ stub ADL2_PerfTuning_Status_Get +@ stub ADL2_PerfTuning_Status_Set +@ stub ADL2_PerformanceTuning_Caps +@ stub ADL2_PowerStates_Get +@ stub ADL2_PowerXpress_AncillaryDevices_Get +@ stub ADL2_PowerXpress_Config_Caps +@ stub ADL2_PowerXpress_Configuration_Get +@ stub ADL2_PowerXpress_ExtendedBatteryMode_Caps +@ stub ADL2_PowerXpress_ExtendedBatteryMode_Get +@ stub ADL2_PowerXpress_ExtendedBatteryMode_Set +@ stub ADL2_PowerXpress_LongIdleDetect_Get +@ stub ADL2_PowerXpress_LongIdleDetect_Set +@ stub ADL2_PowerXpress_PowerControlMode_Get +@ stub ADL2_PowerXpress_PowerControlMode_Set +@ stub ADL2_PowerXpress_Scheme_Get +@ stub ADL2_PowerXpress_Scheme_Set +@ stub ADL2_RIS_Settings_Get +@ stub ADL2_RIS_Settings_Set +@ stub ADL2_RegisterEvent +@ stub ADL2_RegisterEventX2 +@ stub ADL2_Remap +@ stub ADL2_RemoteDisplay_Destroy +@ stub ADL2_RemoteDisplay_Display_Acquire +@ stub ADL2_RemoteDisplay_Display_Release +@ stub ADL2_RemoteDisplay_Display_Release_All +@ stub ADL2_RemoteDisplay_Hdcp20_Create +@ stub ADL2_RemoteDisplay_Hdcp20_Destroy +@ stub ADL2_RemoteDisplay_Hdcp20_Notify +@ stub ADL2_RemoteDisplay_Hdcp20_Process +@ stub ADL2_RemoteDisplay_IEPort_Set +@ stub ADL2_RemoteDisplay_Initialize +@ stub ADL2_RemoteDisplay_Nofitiation_Register +@ stub ADL2_RemoteDisplay_Notification_UnRegister +@ stub ADL2_RemoteDisplay_Support_Caps +@ stub ADL2_RemoteDisplay_VirtualWirelessAdapter_InUse_Get +@ stub ADL2_RemoteDisplay_VirtualWirelessAdapter_Info_Get +@ stub ADL2_RemoteDisplay_VirtualWirelessAdapter_RadioState_Get +@ stub ADL2_RemoteDisplay_VirtualWirelessAdapter_WPSSetting_Change +@ stub ADL2_RemoteDisplay_VirtualWirelessAdapter_WPSSetting_Get +@ stub ADL2_RemoteDisplay_WFDDeviceInfo_Get +@ stub ADL2_RemoteDisplay_WFDDeviceName_Change +@ stub ADL2_RemoteDisplay_WFDDevice_StatusInfo_Get +@ stub ADL2_RemoteDisplay_WFDDiscover_Start +@ stub ADL2_RemoteDisplay_WFDDiscover_Stop +@ stub ADL2_RemoteDisplay_WFDLink_Connect +@ stub ADL2_RemoteDisplay_WFDLink_Creation_Accept +@ stub ADL2_RemoteDisplay_WFDLink_Disconnect +@ stub ADL2_RemoteDisplay_WFDLink_WPS_Process +@ stub ADL2_RemoteDisplay_WFDWDSPSettings_Set +@ stub ADL2_RemoteDisplay_WirelessDisplayEnableDisable_Commit +@ stub ADL2_RemotePlay_ControlFlags_Set +@ stub ADL2_ScreenPoint_AudioMappingInfo_Get +@ stub ADL2_Send +@ stub ADL2_SendX2 +@ stub ADL2_Stereo3D_2DPackedFormat_Set +@ stub ADL2_Stereo3D_3DCursorOffset_Get +@ stub ADL2_Stereo3D_3DCursorOffset_Set +@ stub ADL2_Stereo3D_CurrentFormat_Get +@ stub ADL2_Stereo3D_Info_Get +@ stub ADL2_Stereo3D_Modes_Get +@ stub ADL2_SwitchableGraphics_Applications_Get +@ stub ADL2_TV_Standard_Get +@ stub ADL2_TV_Standard_Set +@ stub ADL2_TurboSyncSupport_Get +@ stub ADL2_UnRegisterEvent +@ stub ADL2_UnRegisterEventX2 +@ stub ADL2_User_Settings_Notify +@ stub ADL2_WS_Overdrive_Caps +@ stub ADL2_Win_IsHybridAI +@ stub ADL2_Workstation_8BitGrayscale_Get +@ stub ADL2_Workstation_8BitGrayscale_Set +@ stub ADL2_Workstation_AdapterNumOfGLSyncConnectors_Get +@ stub ADL2_Workstation_Caps +@ stub ADL2_Workstation_DeepBitDepthX2_Get +@ stub ADL2_Workstation_DeepBitDepthX2_Set +@ stub ADL2_Workstation_DeepBitDepth_Get +@ stub ADL2_Workstation_DeepBitDepth_Set +@ stub ADL2_Workstation_DisplayGLSyncMode_Get +@ stub ADL2_Workstation_DisplayGLSyncMode_Set +@ stub ADL2_Workstation_DisplayGenlockCapable_Get +@ stub ADL2_Workstation_ECCData_Get +@ stub ADL2_Workstation_ECCX2_Get +@ stub ADL2_Workstation_ECC_Caps +@ stub ADL2_Workstation_ECC_Get +@ stub ADL2_Workstation_ECC_Set +@ stub ADL2_Workstation_GLSyncCounters_Get +@ stub ADL2_Workstation_GLSyncGenlockConfiguration_Get +@ stub ADL2_Workstation_GLSyncGenlockConfiguration_Set +@ stub ADL2_Workstation_GLSyncModuleDetect_Get +@ stub ADL2_Workstation_GLSyncModuleInfo_Get +@ stub ADL2_Workstation_GLSyncPortState_Get +@ stub ADL2_Workstation_GLSyncPortState_Set +@ stub ADL2_Workstation_GLSyncSupportedTopology_Get +@ stub ADL2_Workstation_GlobalEDIDPersistence_Get +@ stub ADL2_Workstation_GlobalEDIDPersistence_Set +@ stub ADL2_Workstation_LoadBalancing_Caps +@ stub ADL2_Workstation_LoadBalancing_Get +@ stub ADL2_Workstation_LoadBalancing_Set +@ stub ADL2_Workstation_RAS_ErrorCounts_Get +@ stub ADL2_Workstation_RAS_ErrorCounts_Reset +@ stub ADL2_Workstation_SDISegmentList_Get +@ stub ADL2_Workstation_SDI_Caps +@ stub ADL2_Workstation_SDI_Get +@ stub ADL2_Workstation_SDI_Set +@ stub ADL2_Workstation_Stereo_Get +@ stub ADL2_Workstation_Stereo_Set +@ stub ADL2_Workstation_UnsupportedDisplayModes_Enable +@ stub ADL_ADC_CurrentProfileFromDrv_Get +@ stub ADL_ADC_Display_AdapterDeviceProfileEx_Get +@ stub ADL_ADC_DrvDataToProfile_Copy +@ stub ADL_ADC_FindClosestMode_Get +@ stub ADL_ADC_IsDevModeEqual_Get +@ stub ADL_ADC_Profile_Apply +@ stub ADL_APO_AudioDelayAdjustmentInfo_Get +@ stub ADL_APO_AudioDelay_Restore +@ stub ADL_APO_AudioDelay_Set +@ stub ADL_AdapterLimitation_Caps +@ stub ADL_AdapterX2_Caps +@ stub ADL_Adapter_ASICFamilyType_Get +@ stub ADL_Adapter_ASICInfo_Get +@ stub ADL_Adapter_Accessibility_Get +@ stub ADL_Adapter_Active_Get +@ stub ADL_Adapter_Active_Set +@ stub ADL_Adapter_Active_SetPrefer +@ stub ADL_Adapter_AdapterInfoX2_Get +@ stub ADL_Adapter_AdapterInfo_Get +@ stub ADL_Adapter_AdapterList_Disable +@ stub ADL_Adapter_Aspects_Get +@ stub ADL_Adapter_AudioChannelSplitConfiguration_Get +@ stub ADL_Adapter_AudioChannelSplit_Disable +@ stub ADL_Adapter_AudioChannelSplit_Enable +@ stub ADL_Adapter_BigSw_Info_Get +@ stub ADL_Adapter_BlackAndWhiteLevelSupport_Get +@ stub ADL_Adapter_BlackAndWhiteLevel_Get +@ stub ADL_Adapter_BlackAndWhiteLevel_Set +@ stub ADL_Adapter_BoardLayout_Get +@ stub ADL_Adapter_Caps +@ stub ADL_Adapter_ChipSetInfo_Get +@ stub ADL_Adapter_ConfigMemory_Cap +@ stub ADL_Adapter_ConfigMemory_Get +@ stub ADL_Adapter_ConfigureState_Get +@ stub ADL_Adapter_ConnectionData_Get +@ stub ADL_Adapter_ConnectionData_Remove +@ stub ADL_Adapter_ConnectionData_Set +@ stub ADL_Adapter_ConnectionState_Get +@ stub ADL_Adapter_CrossDisplayPlatformInfo_Get +@ stub ADL_Adapter_CrossdisplayAdapterRole_Caps +@ stub ADL_Adapter_CrossdisplayInfoX2_Set +@ stub ADL_Adapter_CrossdisplayInfo_Get +@ stub ADL_Adapter_CrossdisplayInfo_Set +@ stub ADL_Adapter_CrossfireX2_Get +@ stub ADL_Adapter_Crossfire_Caps +@ stub ADL_Adapter_Crossfire_Get +@ stub ADL_Adapter_Crossfire_Set +@ stub ADL_Adapter_DefaultAudioChannelTable_Load +@ stub ADL_Adapter_DisplayAudioEndpoint_Enable +@ stub ADL_Adapter_DisplayAudioEndpoint_Mute +@ stub ADL_Adapter_DisplayAudioInfo_Get +@ stub ADL_Adapter_DisplayGTCCaps_Get +@ stub ADL_Adapter_Display_Caps +@ stub ADL_Adapter_DriverSettings_Get +@ stub ADL_Adapter_DriverSettings_Set +@ stub ADL_Adapter_EDIDManagement_Caps +@ stub ADL_Adapter_EmulationMode_Set +@ stub ADL_Adapter_ExtInfo_Get +@ stub ADL_Adapter_Gamma_Get +@ stub ADL_Adapter_Gamma_Set +@ stub ADL_Adapter_ID_Get +@ stub ADL_Adapter_LocalDisplayConfig_Get +@ stub ADL_Adapter_LocalDisplayConfig_Set +@ stub ADL_Adapter_LocalDisplayState_Get +@ stub ADL_Adapter_MaxCursorSize_Get +@ stub ADL_Adapter_MemoryInfo2_Get +@ stub ADL_Adapter_MemoryInfo_Get +@ stub ADL_Adapter_MirabilisSupport_Get +@ stub ADL_Adapter_ModeSwitch +@ stub ADL_Adapter_ModeTimingOverride_Caps +@ stub ADL_Adapter_Modes_ReEnumerate +@ stub ADL_Adapter_NumberOfActivatableSources_Get +@ stub ADL_Adapter_NumberOfAdapters_Get +@ stub ADL_Adapter_ObservedClockInfo_Get +@ stub ADL_Adapter_ObservedGameClockInfo_Get +@ stub ADL_Adapter_Primary_Get +@ stub ADL_Adapter_Primary_Set +@ stub ADL_Adapter_RegValueInt_Get +@ stub ADL_Adapter_RegValueInt_Set +@ stub ADL_Adapter_RegValueString_Get +@ stub ADL_Adapter_RegValueString_Set +@ stub ADL_Adapter_SWInfo_Get +@ stub ADL_Adapter_Speed_Caps +@ stub ADL_Adapter_Speed_Get +@ stub ADL_Adapter_Speed_Set +@ stub ADL_Adapter_SupportedConnections_Get +@ stub ADL_Adapter_Tear_Free_Cap +@ stub ADL_Adapter_VariBrightEnable_Set +@ stub ADL_Adapter_VariBrightLevel_Get +@ stub ADL_Adapter_VariBrightLevel_Set +@ stub ADL_Adapter_VariBright_Caps +@ stub ADL_Adapter_VideoBiosInfo_Get +@ stub ADL_Adapter_VideoTheaterModeInfo_Get +@ stub ADL_Adapter_VideoTheaterModeInfo_Set +@ stub ADL_ApplicationProfiles_Applications_Get +@ stub ADL_ApplicationProfiles_ConvertToCompact +@ stub ADL_ApplicationProfiles_DriverAreaPrivacy_Get +@ stub ADL_ApplicationProfiles_GetCustomization +@ stub ADL_ApplicationProfiles_HitListsX2_Get +@ stub ADL_ApplicationProfiles_HitLists_Get +@ stub ADL_ApplicationProfiles_ProfileApplicationX2_Assign +@ stub ADL_ApplicationProfiles_ProfileApplication_Assign +@ stub ADL_ApplicationProfiles_ProfileOfAnApplicationX2_Search +@ stub ADL_ApplicationProfiles_ProfileOfAnApplication_InMemorySearch +@ stub ADL_ApplicationProfiles_ProfileOfAnApplication_Search +@ stub ADL_ApplicationProfiles_Profile_Create +@ stub ADL_ApplicationProfiles_Profile_Exist +@ stub ADL_ApplicationProfiles_Profile_Remove +@ stub ADL_ApplicationProfiles_PropertyType_Get +@ stub ADL_ApplicationProfiles_Release_Get +@ stub ADL_ApplicationProfiles_RemoveApplication +@ stub ADL_ApplicationProfiles_StatusInfo_Get +@ stub ADL_ApplicationProfiles_System_Reload +@ stub ADL_ApplicationProfiles_User_Load +@ stub ADL_ApplicationProfiles_User_Unload +@ stub ADL_Audio_CurrentSampleRate_Get +@ stub ADL_CDS_UnsafeMode_Set +@ stub ADL_CV_DongleSettings_Get +@ stub ADL_CV_DongleSettings_Reset +@ stub ADL_CV_DongleSettings_Set +@ stub ADL_DFP_AllowOnlyCETimings_Get +@ stub ADL_DFP_AllowOnlyCETimings_Set +@ stub ADL_DFP_BaseAudioSupport_Get +@ stub ADL_DFP_GPUScalingEnable_Get +@ stub ADL_DFP_GPUScalingEnable_Set +@ stub ADL_DFP_HDMISupport_Get +@ stub ADL_DFP_MVPUAnalogSupport_Get +@ stub ADL_DFP_PixelFormat_Caps +@ stub ADL_DFP_PixelFormat_Get +@ stub ADL_DFP_PixelFormat_Set +@ stub ADL_DisplayScaling_Set +@ stub ADL_Display_AdapterID_Get +@ stub ADL_Display_AdjustCaps_Get +@ stub ADL_Display_AdjustmentCoherent_Get +@ stub ADL_Display_AdjustmentCoherent_Set +@ stub ADL_Display_AudioMappingInfo_Get +@ stub ADL_Display_AvivoColor_Get +@ stub ADL_Display_AvivoCurrentColor_Set +@ stub ADL_Display_AvivoDefaultColor_Set +@ stub ADL_Display_BackLight_Get +@ stub ADL_Display_BackLight_Set +@ stub ADL_Display_BezelOffsetSteppingSize_Get +@ stub ADL_Display_BezelOffset_Set +@ stub ADL_Display_BezelSupported_Validate +@ stub ADL_Display_Capabilities_Get +@ stub ADL_Display_ColorCaps_Get +@ stub ADL_Display_ColorDepth_Get +@ stub ADL_Display_ColorDepth_Set +@ stub ADL_Display_ColorTemperatureSource_Get +@ stub ADL_Display_ColorTemperatureSource_Set +@ stub ADL_Display_Color_Get +@ stub ADL_Display_Color_Set +@ stub ADL_Display_ConnectedDisplays_Get +@ stub ADL_Display_ContainerID_Get +@ stub ADL_Display_ControllerOverlayAdjustmentCaps_Get +@ stub ADL_Display_ControllerOverlayAdjustmentData_Get +@ stub ADL_Display_ControllerOverlayAdjustmentData_Set +@ stub ADL_Display_CurrentPixelClock_Get +@ stub ADL_Display_CustomizedModeListNum_Get +@ stub ADL_Display_CustomizedModeList_Get +@ stub ADL_Display_CustomizedMode_Add +@ stub ADL_Display_CustomizedMode_Delete +@ stub ADL_Display_CustomizedMode_Validate +@ stub ADL_Display_DCE_Get +@ stub ADL_Display_DCE_Set +@ stub ADL_Display_DDCBlockAccess_Get +@ stub ADL_Display_DDCInfo2_Get +@ stub ADL_Display_DDCInfo_Get +@ stub ADL_Display_Deflicker_Get +@ stub ADL_Display_Deflicker_Set +@ stub ADL_Display_DeviceConfig_Get +@ stub ADL_Display_DisplayContent_Cap +@ stub ADL_Display_DisplayContent_Get +@ stub ADL_Display_DisplayContent_Set +@ stub ADL_Display_DisplayInfo_Get +@ stub ADL_Display_DisplayMapConfig_Get +@ stub ADL_Display_DisplayMapConfig_PossibleAddAndRemove +@ stub ADL_Display_DisplayMapConfig_Set +@ stub ADL_Display_DisplayMapConfig_Validate +@ stub ADL_Display_DitherState_Get +@ stub ADL_Display_DitherState_Set +@ stub ADL_Display_Downscaling_Caps +@ stub ADL_Display_DpMstInfo_Get +@ stub ADL_Display_EdidData_Get +@ stub ADL_Display_EdidData_Set +@ stub ADL_Display_EnumDisplays_Get +@ stub ADL_Display_FilterSVideo_Get +@ stub ADL_Display_FilterSVideo_Set +@ stub ADL_Display_ForcibleDisplay_Get +@ stub ADL_Display_ForcibleDisplay_Set +@ stub ADL_Display_FormatsOverride_Get +@ stub ADL_Display_FormatsOverride_Set +@ stub ADL_Display_FreeSyncState_Get +@ stub ADL_Display_FreeSyncState_Set +@ stub ADL_Display_FreeSync_Cap +@ stub ADL_Display_GamutMapping_Get +@ stub ADL_Display_GamutMapping_Reset +@ stub ADL_Display_GamutMapping_Set +@ stub ADL_Display_Gamut_Caps +@ stub ADL_Display_Gamut_Get +@ stub ADL_Display_Gamut_Set +@ stub ADL_Display_ImageExpansion_Get +@ stub ADL_Display_ImageExpansion_Set +@ stub ADL_Display_InfoPacket_Get +@ stub ADL_Display_InfoPacket_Set +@ stub ADL_Display_LCDRefreshRateCapability_Get +@ stub ADL_Display_LCDRefreshRateOptions_Get +@ stub ADL_Display_LCDRefreshRateOptions_Set +@ stub ADL_Display_LCDRefreshRate_Get +@ stub ADL_Display_LCDRefreshRate_Set +@ stub ADL_Display_Limits_Get +@ stub ADL_Display_MVPUCaps_Get +@ stub ADL_Display_MVPUStatus_Get +@ stub ADL_Display_ModeTimingOverrideInfo_Get +@ stub ADL_Display_ModeTimingOverrideListX2_Get +@ stub ADL_Display_ModeTimingOverrideList_Get +@ stub ADL_Display_ModeTimingOverrideX2_Get +@ stub ADL_Display_ModeTimingOverride_Delete +@ stub ADL_Display_ModeTimingOverride_Get +@ stub ADL_Display_ModeTimingOverride_Set +@ stub ADL_Display_Modes_Get +@ stub ADL_Display_Modes_Set +@ stub ADL_Display_MonitorPowerState_Set +@ stub ADL_Display_NativeAUXChannel_Access +@ stub ADL_Display_NeedWorkaroundFor5Clone_Get +@ stub ADL_Display_NumberOfDisplays_Get +@ stub ADL_Display_ODClockConfig_Set +@ stub ADL_Display_ODClockInfo_Get +@ stub ADL_Display_Overlap_Set +@ stub ADL_Display_Overscan_Get +@ stub ADL_Display_Overscan_Set +@ stub ADL_Display_PixelClockAllowableRange_Set +@ stub ADL_Display_PixelClockCaps_Get +@ stub ADL_Display_PixelFormat_Get +@ stub ADL_Display_PixelFormat_Set +@ stub ADL_Display_Position_Get +@ stub ADL_Display_Position_Set +@ stub ADL_Display_PossibleMapping_Get +@ stub ADL_Display_PossibleMode_Get +@ stub ADL_Display_PowerXpressActiveGPU_Get +@ stub ADL_Display_PowerXpressActiveGPU_Set +@ stub ADL_Display_PowerXpressActvieGPUR2_Get +@ stub ADL_Display_PowerXpressVersion_Get +@ stub ADL_Display_PowerXpress_AutoSwitchConfig_Get +@ stub ADL_Display_PowerXpress_AutoSwitchConfig_Set +@ stub ADL_Display_PreservedAspectRatio_Get +@ stub ADL_Display_PreservedAspectRatio_Set +@ stub ADL_Display_Property_Get +@ stub ADL_Display_Property_Set +@ stub ADL_Display_RcDisplayAdjustment +@ stub ADL_Display_ReGammaCoefficients_Get +@ stub ADL_Display_ReGammaCoefficients_Set +@ stub ADL_Display_ReducedBlanking_Get +@ stub ADL_Display_ReducedBlanking_Set +@ stub ADL_Display_RegammaR1_Get +@ stub ADL_Display_RegammaR1_Set +@ stub ADL_Display_Regamma_Get +@ stub ADL_Display_Regamma_Set +@ stub ADL_Display_SLSGrid_Caps +@ stub ADL_Display_SLSMapConfigX2_Get +@ stub ADL_Display_SLSMapConfig_Create +@ stub ADL_Display_SLSMapConfig_Delete +@ stub ADL_Display_SLSMapConfig_Get +@ stub ADL_Display_SLSMapConfig_Rearrange +@ stub ADL_Display_SLSMapConfig_SetState +@ stub ADL_Display_SLSMapIndexList_Get +@ stub ADL_Display_SLSMapIndex_Get +@ stub ADL_Display_SLSMiddleMode_Get +@ stub ADL_Display_SLSMiddleMode_Set +@ stub ADL_Display_SLSRecords_Get +@ stub ADL_Display_Sharpness_Caps +@ stub ADL_Display_Sharpness_Get +@ stub ADL_Display_Sharpness_Info_Get +@ stub ADL_Display_Sharpness_Set +@ stub ADL_Display_Size_Get +@ stub ADL_Display_Size_Set +@ stub ADL_Display_SourceContentAttribute_Get +@ stub ADL_Display_SourceContentAttribute_Set +@ stub ADL_Display_SplitDisplay_Caps +@ stub ADL_Display_SplitDisplay_Get +@ stub ADL_Display_SplitDisplay_RestoreDesktopConfiguration +@ stub ADL_Display_SplitDisplay_Set +@ stub ADL_Display_SupportedColorDepth_Get +@ stub ADL_Display_SupportedPixelFormat_Get +@ stub ADL_Display_SwitchingCapability_Get +@ stub ADL_Display_TVCaps_Get +@ stub ADL_Display_TargetTiming_Get +@ stub ADL_Display_UnderScan_Auto_Get +@ stub ADL_Display_UnderScan_Auto_Set +@ stub ADL_Display_Underscan_Get +@ stub ADL_Display_Underscan_Set +@ stub ADL_Display_Vector_Get +@ stub ADL_Display_ViewPort_Cap +@ stub ADL_Display_ViewPort_Get +@ stub ADL_Display_ViewPort_Set +@ stub ADL_Display_WriteAndReadI2C +@ stub ADL_Display_WriteAndReadI2CLargePayload +@ stub ADL_Display_WriteAndReadI2CRev_Get +@ stub ADL_Flush_Driver_Data +@ stub ADL_Graphics_Platform_Get +@ stdcall ADL_Graphics_Versions_Get(ptr) +@ stub ADL_MMD_FeatureList_Get +@ stub ADL_MMD_FeatureValuesX2_Get +@ stub ADL_MMD_FeatureValuesX2_Set +@ stub ADL_MMD_FeatureValues_Get +@ stub ADL_MMD_FeatureValues_Set +@ stub ADL_MMD_FeaturesX2_Caps +@ stub ADL_MMD_Features_Caps +@ stub ADL_MMD_VideoAdjustInfo_Get +@ stub ADL_MMD_VideoAdjustInfo_Set +@ stub ADL_MMD_VideoColor_Caps +@ stub ADL_MMD_VideoColor_Get +@ stub ADL_MMD_VideoColor_Set +@ stub ADL_MMD_Video_Caps +@ stub ADL_Main_ControlX2_Create +@ stdcall ADL_Main_Control_Create(ptr long) +@ stdcall ADL_Main_Control_Destroy() +@ stub ADL_Main_Control_GetProcAddress +@ stub ADL_Main_Control_IsFunctionValid +@ stub ADL_Main_Control_Refresh +@ stub ADL_Main_LogDebug_Set +@ stub ADL_Main_LogError_Set +@ stub ADL_Overdrive5_CurrentActivity_Get +@ stub ADL_Overdrive5_FanSpeedInfo_Get +@ stub ADL_Overdrive5_FanSpeedToDefault_Set +@ stub ADL_Overdrive5_FanSpeed_Get +@ stub ADL_Overdrive5_FanSpeed_Set +@ stub ADL_Overdrive5_ODParameters_Get +@ stub ADL_Overdrive5_ODPerformanceLevels_Get +@ stub ADL_Overdrive5_ODPerformanceLevels_Set +@ stub ADL_Overdrive5_PowerControlAbsValue_Caps +@ stub ADL_Overdrive5_PowerControlAbsValue_Get +@ stub ADL_Overdrive5_PowerControlAbsValue_Set +@ stub ADL_Overdrive5_PowerControlInfo_Get +@ stub ADL_Overdrive5_PowerControl_Caps +@ stub ADL_Overdrive5_PowerControl_Get +@ stub ADL_Overdrive5_PowerControl_Set +@ stub ADL_Overdrive5_Temperature_Get +@ stub ADL_Overdrive5_ThermalDevices_Enum +@ stub ADL_Overdrive6_AdvancedFan_Caps +@ stub ADL_Overdrive6_CapabilitiesEx_Get +@ stub ADL_Overdrive6_Capabilities_Get +@ stub ADL_Overdrive6_CurrentStatus_Get +@ stub ADL_Overdrive6_FanPWMLimitData_Get +@ stub ADL_Overdrive6_FanPWMLimitData_Set +@ stub ADL_Overdrive6_FanPWMLimitRangeInfo_Get +@ stub ADL_Overdrive6_FanSpeed_Get +@ stub ADL_Overdrive6_FanSpeed_Reset +@ stub ADL_Overdrive6_FanSpeed_Set +@ stub ADL_Overdrive6_FuzzyController_Caps +@ stub ADL_Overdrive6_MaxClockAdjust_Get +@ stub ADL_Overdrive6_PowerControlInfo_Get +@ stub ADL_Overdrive6_PowerControl_Caps +@ stub ADL_Overdrive6_PowerControl_Get +@ stub ADL_Overdrive6_PowerControl_Set +@ stub ADL_Overdrive6_StateEx_Get +@ stub ADL_Overdrive6_StateEx_Set +@ stub ADL_Overdrive6_StateInfo_Get +@ stub ADL_Overdrive6_State_Reset +@ stub ADL_Overdrive6_State_Set +@ stub ADL_Overdrive6_TargetTemperatureData_Get +@ stub ADL_Overdrive6_TargetTemperatureData_Set +@ stub ADL_Overdrive6_TargetTemperatureRangeInfo_Get +@ stub ADL_Overdrive6_Temperature_Get +@ stub ADL_Overdrive6_ThermalController_Caps +@ stub ADL_Overdrive6_ThermalLimitUnlock_Get +@ stub ADL_Overdrive6_ThermalLimitUnlock_Set +@ stub ADL_Overdrive6_VoltageControlInfo_Get +@ stub ADL_Overdrive6_VoltageControl_Get +@ stub ADL_Overdrive6_VoltageControl_Set +@ stub ADL_Overdrive_Caps +@ stub ADL_PowerXpress_AncillaryDevices_Get +@ stub ADL_PowerXpress_Config_Caps +@ stub ADL_PowerXpress_ExtendedBatteryMode_Caps +@ stub ADL_PowerXpress_ExtendedBatteryMode_Get +@ stub ADL_PowerXpress_ExtendedBatteryMode_Set +@ stub ADL_PowerXpress_LongIdleDetect_Get +@ stub ADL_PowerXpress_LongIdleDetect_Set +@ stub ADL_PowerXpress_PowerControlMode_Get +@ stub ADL_PowerXpress_PowerControlMode_Set +@ stub ADL_PowerXpress_Scheme_Get +@ stub ADL_PowerXpress_Scheme_Set +@ stub ADL_Remap +@ stub ADL_RemoteDisplay_Destroy +@ stub ADL_RemoteDisplay_Display_Acquire +@ stub ADL_RemoteDisplay_Display_Release +@ stub ADL_RemoteDisplay_Display_Release_All +@ stub ADL_RemoteDisplay_Hdcp20_Create +@ stub ADL_RemoteDisplay_Hdcp20_Destroy +@ stub ADL_RemoteDisplay_Hdcp20_Notify +@ stub ADL_RemoteDisplay_Hdcp20_Process +@ stub ADL_RemoteDisplay_IEPort_Set +@ stub ADL_RemoteDisplay_Initialize +@ stub ADL_RemoteDisplay_Nofitiation_Register +@ stub ADL_RemoteDisplay_Notification_UnRegister +@ stub ADL_RemoteDisplay_Support_Caps +@ stub ADL_RemoteDisplay_VirtualWirelessAdapter_InUse_Get +@ stub ADL_RemoteDisplay_VirtualWirelessAdapter_Info_Get +@ stub ADL_RemoteDisplay_VirtualWirelessAdapter_RadioState_Get +@ stub ADL_RemoteDisplay_VirtualWirelessAdapter_WPSSetting_Change +@ stub ADL_RemoteDisplay_VirtualWirelessAdapter_WPSSetting_Get +@ stub ADL_RemoteDisplay_WFDDeviceInfo_Get +@ stub ADL_RemoteDisplay_WFDDeviceName_Change +@ stub ADL_RemoteDisplay_WFDDevice_StatusInfo_Get +@ stub ADL_RemoteDisplay_WFDDiscover_Start +@ stub ADL_RemoteDisplay_WFDDiscover_Stop +@ stub ADL_RemoteDisplay_WFDLink_Connect +@ stub ADL_RemoteDisplay_WFDLink_Creation_Accept +@ stub ADL_RemoteDisplay_WFDLink_Disconnect +@ stub ADL_RemoteDisplay_WFDLink_WPS_Process +@ stub ADL_RemoteDisplay_WFDWDSPSettings_Set +@ stub ADL_RemoteDisplay_WirelessDisplayEnableDisable_Commit +@ stub ADL_ScreenPoint_AudioMappingInfo_Get +@ stub ADL_Stereo3D_2DPackedFormat_Set +@ stub ADL_Stereo3D_3DCursorOffset_Get +@ stub ADL_Stereo3D_3DCursorOffset_Set +@ stub ADL_Stereo3D_CurrentFormat_Get +@ stub ADL_Stereo3D_Info_Get +@ stub ADL_Stereo3D_Modes_Get +@ stub ADL_TV_Standard_Get +@ stub ADL_TV_Standard_Set +@ stub ADL_Win_IsHybridAI +@ stub ADL_Workstation_8BitGrayscale_Get +@ stub ADL_Workstation_8BitGrayscale_Set +@ stub ADL_Workstation_AdapterNumOfGLSyncConnectors_Get +@ stub ADL_Workstation_Caps +@ stub ADL_Workstation_DeepBitDepthX2_Get +@ stub ADL_Workstation_DeepBitDepthX2_Set +@ stub ADL_Workstation_DeepBitDepth_Get +@ stub ADL_Workstation_DeepBitDepth_Set +@ stub ADL_Workstation_DisplayGLSyncMode_Get +@ stub ADL_Workstation_DisplayGLSyncMode_Set +@ stub ADL_Workstation_DisplayGenlockCapable_Get +@ stub ADL_Workstation_ECCData_Get +@ stub ADL_Workstation_ECCX2_Get +@ stub ADL_Workstation_ECC_Caps +@ stub ADL_Workstation_ECC_Get +@ stub ADL_Workstation_ECC_Set +@ stub ADL_Workstation_GLSyncCounters_Get +@ stub ADL_Workstation_GLSyncGenlockConfiguration_Get +@ stub ADL_Workstation_GLSyncGenlockConfiguration_Set +@ stub ADL_Workstation_GLSyncModuleDetect_Get +@ stub ADL_Workstation_GLSyncModuleInfo_Get +@ stub ADL_Workstation_GLSyncPortState_Get +@ stub ADL_Workstation_GLSyncPortState_Set +@ stub ADL_Workstation_GLSyncSupportedTopology_Get +@ stub ADL_Workstation_GlobalEDIDPersistence_Get +@ stub ADL_Workstation_GlobalEDIDPersistence_Set +@ stub ADL_Workstation_LoadBalancing_Caps +@ stub ADL_Workstation_LoadBalancing_Get +@ stub ADL_Workstation_LoadBalancing_Set +@ stub ADL_Workstation_RAS_Get_Error_Counts +@ stub ADL_Workstation_RAS_Get_Features +@ stub ADL_Workstation_RAS_Reset_Error_Counts +@ stub ADL_Workstation_RAS_Set_Features +@ stub ADL_Workstation_SDISegmentList_Get +@ stub ADL_Workstation_SDI_Caps +@ stub ADL_Workstation_SDI_Get +@ stub ADL_Workstation_SDI_Set +@ stub ADL_Workstation_Stereo_Get +@ stub ADL_Workstation_Stereo_Set +@ stub ADL_Workstation_UnsupportedDisplayModes_Enable +@ stub AmdPowerXpressRequestHighPerformance +@ stub Desktop_Detach +@ stub Send +@ stub SendX2 diff --git a/dlls/atiadlxx/atiadlxx_main.c b/dlls/atiadlxx/atiadlxx_main.c new file mode 100644 index 000000000000..0b037bb19463 --- /dev/null +++ b/dlls/atiadlxx/atiadlxx_main.c @@ -0,0 +1,91 @@ +#include + +#include "windef.h" +#include "winbase.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(atiadlxx); + +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) +{ + TRACE("(%p, %u, %p)\n", instance, reason, reserved); + + switch (reason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(instance); + break; + } + + return TRUE; +} + +typedef void *(CALLBACK *ADL_MAIN_MALLOC_CALLBACK)(int); +typedef void *ADL_CONTEXT_HANDLE; + +typedef struct ADLVersionsInfo +{ + char strDriverVer[256]; + char strCatalystVersion[256]; + char strCatalystWebLink[256]; +} ADLVersionsInfo, *LPADLVersionsInfo; + +typedef struct ADLVersionsInfoX2 +{ + char strDriverVer[256]; + char strCatalystVersion[256]; + char strCrimsonVersion[256]; + char strCatalystWebLink[256]; +} ADLVersionsInfoX2, *LPADLVersionsInfoX2; + +static const ADLVersionsInfo version = { + "16.11.2", + "16.11.2", + "", +}; + +static const ADLVersionsInfoX2 version2 = { + "16.11.2", + "16.11.2", + "16.11.2", + "", +}; + +int WINAPI ADL2_Main_Control_Create(ADL_MAIN_MALLOC_CALLBACK cb, int arg, ADL_CONTEXT_HANDLE *ptr) +{ + FIXME("cb %p, arg %d, ptr %p stub!\n", cb, arg, ptr); + return 0; +} + +int WINAPI ADL_Main_Control_Create(ADL_MAIN_MALLOC_CALLBACK cb, int arg) +{ + FIXME("cb %p, arg %d stub!\n", cb, arg); + return 0; +} + +int WINAPI ADL_Main_Control_Destroy(void) +{ + FIXME("stub!\n"); + return 0; +} + +int WINAPI ADL2_Adapter_NumberOfAdapters_Get(ADL_CONTEXT_HANDLE *ptr, int *count) +{ + FIXME("ptr %p, count %p stub!\n", ptr, count); + *count = 0; + return 0; +} + +int WINAPI ADL2_Graphics_VersionsX2_Get(ADL_CONTEXT_HANDLE *ptr, ADLVersionsInfoX2 *ver) +{ + FIXME("ptr %p, ver %p stub!\n", ptr, ver); + memcpy(ver, &version2, sizeof(version2)); + return 0; +} + +int WINAPI ADL_Graphics_Versions_Get(ADLVersionsInfo *ver) +{ + FIXME("ver %p stub!\n", ver); + memcpy(ver, &version, sizeof(version)); + return 0; +} diff --git a/loader/wine.inf.in b/loader/wine.inf.in index e47736636c28..01128e13b870 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2813,4 +2813,5 @@ HKCU,Software\Wine\DllOverrides,"msvcr140",0x2,"native,builtin" HKCU,Software\Wine\DllOverrides,"ucrtbase",0x2,"native,builtin" HKCU,Software\Wine\DllOverrides,"vcomp140",0x2,"native,builtin" HKCU,Software\Wine\DllOverrides,"vcruntime140",0x2,"native,builtin" +HKCU,Software\Wine\DllOverrides,"atiadlxx",,"disabled" HKCU,Software\Wine\DllOverrides,"vcruntime140_1",0x2,"native,builtin" From 6e2e3c296cc300be92ae6e6545257cd440c9cb88 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Mon, 12 Oct 2020 17:46:27 +0300 Subject: [PATCH 0481/2542] atiadlxx: Stub GPU/display enumeration and clock/memory info. Shadow of War uses atiadlxx to query the following GPU information: * current memory frequency * current core frequency * memory size * memory bandwidth Those are used to apprise the GPU and recommend user settings. Most of them can be fetched via AMD's powerplay sysfs entries / wined3d helpers. The only value that is not exposed is the memory bandwith so we set it to the value my RX580 reports on Windows. Because of that on high end system the game may recommend lower settings than it would with the real value, and the other way around on low end systems. We also report some "sane default" in case we can't find the powerplay entries - this may be the case with nvapi hack enabled when we report any NVIDIA card as RX480. ADL2 stubs used by Call of Duty games are untouched and still report 0 GPUs. --- dlls/atiadlxx/Makefile.in | 2 + dlls/atiadlxx/atiadlxx.spec | 18 +- dlls/atiadlxx/atiadlxx_main.c | 369 ++++++++++++++++++++++++++++++++-- 3 files changed, 367 insertions(+), 22 deletions(-) diff --git a/dlls/atiadlxx/Makefile.in b/dlls/atiadlxx/Makefile.in index 80f456edb75f..f8423899b3ec 100644 --- a/dlls/atiadlxx/Makefile.in +++ b/dlls/atiadlxx/Makefile.in @@ -1,5 +1,7 @@ EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = atiadlxx.dll +IMPORTS = wined3d + EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native SOURCES = \ diff --git a/dlls/atiadlxx/atiadlxx.spec b/dlls/atiadlxx/atiadlxx.spec index e2a1f46a838c..e2fb060ae8d9 100644 --- a/dlls/atiadlxx/atiadlxx.spec +++ b/dlls/atiadlxx/atiadlxx.spec @@ -681,14 +681,14 @@ @ stub ADL_APO_AudioDelay_Set @ stub ADL_AdapterLimitation_Caps @ stub ADL_AdapterX2_Caps -@ stub ADL_Adapter_ASICFamilyType_Get +@ stdcall ADL_Adapter_ASICFamilyType_Get(long ptr ptr) @ stub ADL_Adapter_ASICInfo_Get @ stub ADL_Adapter_Accessibility_Get @ stub ADL_Adapter_Active_Get @ stub ADL_Adapter_Active_Set @ stub ADL_Adapter_Active_SetPrefer @ stub ADL_Adapter_AdapterInfoX2_Get -@ stub ADL_Adapter_AdapterInfo_Get +@ stdcall ADL_Adapter_AdapterInfo_Get(ptr long) @ stub ADL_Adapter_AdapterList_Disable @ stub ADL_Adapter_Aspects_Get @ stub ADL_Adapter_AudioChannelSplitConfiguration_Get @@ -714,8 +714,8 @@ @ stub ADL_Adapter_CrossdisplayInfo_Get @ stub ADL_Adapter_CrossdisplayInfo_Set @ stub ADL_Adapter_CrossfireX2_Get -@ stub ADL_Adapter_Crossfire_Caps -@ stub ADL_Adapter_Crossfire_Get +@ stdcall ADL_Adapter_Crossfire_Caps(long ptr ptr ptr) +@ stdcall ADL_Adapter_Crossfire_Get(long ptr ptr) @ stub ADL_Adapter_Crossfire_Set @ stub ADL_Adapter_DefaultAudioChannelTable_Load @ stub ADL_Adapter_DisplayAudioEndpoint_Enable @@ -736,14 +736,14 @@ @ stub ADL_Adapter_LocalDisplayState_Get @ stub ADL_Adapter_MaxCursorSize_Get @ stub ADL_Adapter_MemoryInfo2_Get -@ stub ADL_Adapter_MemoryInfo_Get +@ stdcall ADL_Adapter_MemoryInfo_Get(long ptr) @ stub ADL_Adapter_MirabilisSupport_Get @ stub ADL_Adapter_ModeSwitch @ stub ADL_Adapter_ModeTimingOverride_Caps @ stub ADL_Adapter_Modes_ReEnumerate @ stub ADL_Adapter_NumberOfActivatableSources_Get -@ stub ADL_Adapter_NumberOfAdapters_Get -@ stub ADL_Adapter_ObservedClockInfo_Get +@ stdcall ADL_Adapter_NumberOfAdapters_Get(ptr) +@ stdcall ADL_Adapter_ObservedClockInfo_Get(long ptr ptr) @ stub ADL_Adapter_ObservedGameClockInfo_Get @ stub ADL_Adapter_Primary_Get @ stub ADL_Adapter_Primary_Set @@ -844,7 +844,7 @@ @ stub ADL_Display_DisplayContent_Cap @ stub ADL_Display_DisplayContent_Get @ stub ADL_Display_DisplayContent_Set -@ stub ADL_Display_DisplayInfo_Get +@ stdcall ADL_Display_DisplayInfo_Get(long long ptr long) @ stub ADL_Display_DisplayMapConfig_Get @ stub ADL_Display_DisplayMapConfig_PossibleAddAndRemove @ stub ADL_Display_DisplayMapConfig_Set @@ -969,7 +969,7 @@ @ stub ADL_Display_WriteAndReadI2CLargePayload @ stub ADL_Display_WriteAndReadI2CRev_Get @ stub ADL_Flush_Driver_Data -@ stub ADL_Graphics_Platform_Get +@ stdcall ADL_Graphics_Platform_Get(ptr) @ stdcall ADL_Graphics_Versions_Get(ptr) @ stub ADL_MMD_FeatureList_Get @ stub ADL_MMD_FeatureValuesX2_Get diff --git a/dlls/atiadlxx/atiadlxx_main.c b/dlls/atiadlxx/atiadlxx_main.c index 0b037bb19463..b1e7551ac820 100644 --- a/dlls/atiadlxx/atiadlxx_main.c +++ b/dlls/atiadlxx/atiadlxx_main.c @@ -1,8 +1,43 @@ +/* Headers: https://github.com/GPUOpen-LibrariesAndSDKs/display-library */ + #include +#include +#include +#define COBJMACROS #include "windef.h" #include "winbase.h" +#include "winuser.h" +#include "objbase.h" #include "wine/debug.h" +#include "wine/wined3d.h" + +#define MAX_GPUS 64 +#define VENDOR_AMD 0x1002 + +#define ADL_OK 0 +#define ADL_ERR -1 +#define ADL_ERR_INVALID_PARAM -3 +#define ADL_ERR_INVALID_ADL_IDX -5 +#define ADL_ERR_NOT_SUPPORTED -8 +#define ADL_ERR_NULL_POINTER -9 + +#define ADL_DISPLAY_DISPLAYINFO_DISPLAYCONNECTED 0x00000001 +#define ADL_DISPLAY_DISPLAYINFO_DISPLAYMAPPED 0x00000002 +#define ADL_DISPLAY_DISPLAYINFO_MASK 0x31fff + +#define ADL_ASIC_DISCRETE (1 << 0) +#define ADL_ASIC_MASK 0xAF + +enum ADLPlatForm +{ + GRAPHICS_PLATFORM_DESKTOP = 0, + GRAPHICS_PLATFORM_MOBILE = 1 +}; +#define GRAPHICS_PLATFORM_UNKNOWN -1 + + +static struct wined3d *wined3d; WINE_DEFAULT_DEBUG_CHANNEL(atiadlxx); @@ -23,21 +58,83 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) typedef void *(CALLBACK *ADL_MAIN_MALLOC_CALLBACK)(int); typedef void *ADL_CONTEXT_HANDLE; +ADL_MAIN_MALLOC_CALLBACK adl_malloc; +#define ADL_MAX_PATH 256 + typedef struct ADLVersionsInfo { - char strDriverVer[256]; - char strCatalystVersion[256]; - char strCatalystWebLink[256]; + char strDriverVer[ADL_MAX_PATH]; + char strCatalystVersion[ADL_MAX_PATH]; + char strCatalystWebLink[ADL_MAX_PATH]; } ADLVersionsInfo, *LPADLVersionsInfo; typedef struct ADLVersionsInfoX2 { - char strDriverVer[256]; - char strCatalystVersion[256]; - char strCrimsonVersion[256]; - char strCatalystWebLink[256]; + char strDriverVer[ADL_MAX_PATH]; + char strCatalystVersion[ADL_MAX_PATH]; + char strCrimsonVersion[ADL_MAX_PATH]; + char strCatalystWebLink[ADL_MAX_PATH]; } ADLVersionsInfoX2, *LPADLVersionsInfoX2; +typedef struct ADLAdapterInfo { + int iSize; + int iAdapterIndex; + char strUDID[ADL_MAX_PATH]; + int iBusNumber; + int iDeviceNumber; + int iFunctionNumber; + int iVendorID; + char strAdapterName[ADL_MAX_PATH]; + char strDisplayName[ADL_MAX_PATH]; + int iPresent; + int iExist; + char strDriverPath[ADL_MAX_PATH]; + char strDriverPathExt[ADL_MAX_PATH]; + char strPNPString[ADL_MAX_PATH]; + int iOSDisplayIndex; +} ADLAdapterInfo, *LPADLAdapterInfo; + +typedef struct ADLDisplayID +{ + int iDisplayLogicalIndex; + int iDisplayPhysicalIndex; + int iDisplayLogicalAdapterIndex; + int iDisplayPhysicalAdapterIndex; +} ADLDisplayID, *LPADLDisplayID; + +typedef struct ADLDisplayInfo +{ + ADLDisplayID displayID; + int iDisplayControllerIndex; + char strDisplayName[ADL_MAX_PATH]; + char strDisplayManufacturerName[ADL_MAX_PATH]; + int iDisplayType; + int iDisplayOutputType; + int iDisplayConnector; + int iDisplayInfoMask; + int iDisplayInfoValue; +} ADLDisplayInfo, *LPADLDisplayInfo; + +typedef struct ADLCrossfireComb +{ + int iNumLinkAdapter; + int iAdaptLink[3]; +} ADLCrossfireComb; + +typedef struct ADLCrossfireInfo +{ + int iErrorCode; + int iState; + int iSupported; +} ADLCrossfireInfo; + +typedef struct ADLMemoryInfo +{ + long long iMemorySize; + char strMemoryType[ADL_MAX_PATH]; + long long iMemoryBandwidth; +} ADLMemoryInfo, *LPADLMemoryInfo; + static const ADLVersionsInfo version = { "16.11.2", "16.11.2", @@ -54,38 +151,284 @@ static const ADLVersionsInfoX2 version2 = { int WINAPI ADL2_Main_Control_Create(ADL_MAIN_MALLOC_CALLBACK cb, int arg, ADL_CONTEXT_HANDLE *ptr) { FIXME("cb %p, arg %d, ptr %p stub!\n", cb, arg, ptr); - return 0; + return ADL_OK; } int WINAPI ADL_Main_Control_Create(ADL_MAIN_MALLOC_CALLBACK cb, int arg) { FIXME("cb %p, arg %d stub!\n", cb, arg); - return 0; + adl_malloc = cb; + + if ((wined3d = wined3d_create(0))) + return ADL_OK; + else + return ADL_ERR; } int WINAPI ADL_Main_Control_Destroy(void) { FIXME("stub!\n"); - return 0; + + if (wined3d != NULL) + wined3d_decref(wined3d); + + return ADL_OK; } int WINAPI ADL2_Adapter_NumberOfAdapters_Get(ADL_CONTEXT_HANDLE *ptr, int *count) { FIXME("ptr %p, count %p stub!\n", ptr, count); + *count = 0; - return 0; + + return ADL_OK; } int WINAPI ADL2_Graphics_VersionsX2_Get(ADL_CONTEXT_HANDLE *ptr, ADLVersionsInfoX2 *ver) { FIXME("ptr %p, ver %p stub!\n", ptr, ver); memcpy(ver, &version2, sizeof(version2)); - return 0; + return ADL_OK; } int WINAPI ADL_Graphics_Versions_Get(ADLVersionsInfo *ver) { FIXME("ver %p stub!\n", ver); memcpy(ver, &version, sizeof(version)); - return 0; + return ADL_OK; +} + +int WINAPI ADL_Adapter_NumberOfAdapters_Get(int *count) +{ + FIXME("count %p stub!\n", count); + *count = wined3d_get_adapter_count(wined3d); + TRACE("*count = %d\n", *count); + return ADL_OK; +} + +static BOOL get_adapter_identifier(int index, struct wined3d_adapter_identifier *identifier) +{ + struct wined3d_adapter *adapter; + HRESULT hr; + + adapter = wined3d_get_adapter(wined3d, index); + if (adapter == NULL) + return FALSE; + + memset(identifier, 0, sizeof(*identifier)); + hr = wined3d_adapter_get_identifier(adapter, 0, identifier); + + if (!SUCCEEDED(hr)) + return FALSE; + + return TRUE; +} + +/* yep, seriously */ +static int convert_vendor_id(int id) +{ + char str[16]; + snprintf(str, ARRAY_SIZE(str), "%x", id); + return atoi(str); +} + +int WINAPI ADL_Adapter_AdapterInfo_Get(ADLAdapterInfo *adapters, int input_size) +{ + int count, i; + struct wined3d_adapter_identifier identifier; + + FIXME("adapters %p, input_size %d, stub!\n", adapters, input_size); + + count = wined3d_get_adapter_count(wined3d); + + if (!adapters) return ADL_ERR_INVALID_PARAM; + if (input_size != count * sizeof(ADLAdapterInfo)) return ADL_ERR_INVALID_PARAM; + + memset(adapters, 0, input_size); + + for (i = 0; i < count; i++) + { + adapters[i].iSize = sizeof(ADLAdapterInfo); + adapters[i].iAdapterIndex = i; + + if (!get_adapter_identifier(i, &identifier)) + return ADL_ERR; + + adapters[i].iVendorID = convert_vendor_id(identifier.vendor_id); + } + + return ADL_OK; +} + +int WINAPI ADL_Display_DisplayInfo_Get(int adapter_index, int *num_displays, ADLDisplayInfo **info, int force_detect) +{ + struct wined3d_adapter *adapter; + struct wined3d_output *output; + int i; + + FIXME("adapter %d, num_displays %p, info %p stub!\n", adapter_index, num_displays, info); + + if (info == NULL || num_displays == NULL) return ADL_ERR_NULL_POINTER; + + adapter = wined3d_get_adapter(wined3d, adapter_index); + if (adapter == NULL) return ADL_ERR_INVALID_PARAM; + + *num_displays = wined3d_adapter_get_output_count(adapter); + + if (*num_displays == 0) + return ADL_OK; + + *info = adl_malloc(*num_displays * sizeof(**info)); + memset(*info, 0, *num_displays * sizeof(**info)); + + for (i = 0; i < *num_displays; i++) + { + output = wined3d_adapter_get_output(adapter, i); + if (output == NULL) + return ADL_ERR; + + (*info)[i].displayID.iDisplayLogicalIndex = i; + (*info)[i].iDisplayInfoValue = ADL_DISPLAY_DISPLAYINFO_DISPLAYCONNECTED | ADL_DISPLAY_DISPLAYINFO_DISPLAYMAPPED; + (*info)[i].iDisplayInfoMask = (*info)[i].iDisplayInfoValue; + } + + return ADL_OK; +} + +int WINAPI ADL_Adapter_Crossfire_Caps(int adapter_index, int *preffered, int *num_comb, ADLCrossfireComb** comb) +{ + FIXME("adapter %d, preffered %p, num_comb %p, comb %p stub!\n", adapter_index, preffered, num_comb, comb); + return ADL_ERR; +} + +int WINAPI ADL_Adapter_Crossfire_Get(int adapter_index, ADLCrossfireComb *comb, ADLCrossfireInfo *info) +{ + FIXME("adapter %d, comb %p, info %p, stub!\n", adapter_index, comb, info); + return ADL_ERR; +} + +int WINAPI ADL_Adapter_ASICFamilyType_Get(int adapter_index, int *asic_type, int *valids) +{ + struct wined3d_adapter_identifier identifier; + + FIXME("adapter %d, asic_type %p, valids %p, stub!\n", adapter_index, asic_type, valids); + + if (asic_type == NULL || valids == NULL) + return ADL_ERR_NULL_POINTER; + + if (!get_adapter_identifier(adapter_index, &identifier)) + return ADL_ERR_INVALID_ADL_IDX; + + if (identifier.vendor_id != VENDOR_AMD) + return ADL_ERR_NOT_SUPPORTED; + + *asic_type = ADL_ASIC_DISCRETE; + *valids = ADL_ASIC_MASK; + + return ADL_OK; +} + +static int get_max_clock(const char *clock, int default_value) +{ + char path[MAX_PATH], line[256]; + FILE *file; + int drm_card, value = 0; + + for (drm_card = 0; drm_card < MAX_GPUS; drm_card++) + { + sprintf(path, "/sys/class/drm/card%d/device/pp_dpm_%s", drm_card, clock); + file = fopen(path, "r"); + + if (file == NULL) + continue; + + while (fgets(line, sizeof(line), file) != NULL) + { + char *number; + + number = strchr(line, ' '); + if (number == NULL) + { + WARN("pp_dpm_%s file has unexpected format\n", clock); + break; + } + + number++; + value = max(strtol(number, NULL, 0), value); + } + } + + if (value != 0) + return value; + + return default_value; +} + +/* documented in the "Linux Specific APIs" section, present and used on Windows */ +/* the name and documentation suggests that this returns current freqs, but it's actually max */ +int WINAPI ADL_Adapter_ObservedClockInfo_Get(int adapter_index, int *core_clock, int *memory_clock) +{ + struct wined3d_adapter_identifier identifier; + + FIXME("adapter %d, core_clock %p, memory_clock %p, stub!\n", adapter_index, core_clock, memory_clock); + + if (core_clock == NULL || memory_clock == NULL) return ADL_ERR; + if (!get_adapter_identifier(adapter_index, &identifier)) return ADL_ERR; + if (identifier.vendor_id != VENDOR_AMD) return ADL_ERR_INVALID_ADL_IDX; + + /* default values based on RX580 */ + *core_clock = get_max_clock("sclk", 1350); + *memory_clock = get_max_clock("mclk", 2000); + + TRACE("*core_clock: %i, *memory_clock %i\n", *core_clock, *memory_clock); + + return ADL_OK; +} + +/* documented in the "Linux Specific APIs" section, present and used on Windows */ +int WINAPI ADL_Adapter_MemoryInfo_Get(int adapter_index, ADLMemoryInfo *mem_info) +{ + struct wined3d_adapter_identifier identifier; + + FIXME("adapter %d, mem_info %p stub!\n", adapter_index, mem_info); + + if (mem_info == NULL) return ADL_ERR_NULL_POINTER; + if (!get_adapter_identifier(adapter_index, &identifier)) return ADL_ERR_INVALID_ADL_IDX; + if (identifier.vendor_id != VENDOR_AMD) return ADL_ERR; + + mem_info->iMemorySize = identifier.video_memory; + mem_info->iMemoryBandwidth = 256000; /* not exposed on Linux, probably needs a lookup table */ + + TRACE("iMemoryBandwidth %s, iMemorySize %s\n", + wine_dbgstr_longlong(mem_info->iMemoryBandwidth), + wine_dbgstr_longlong(mem_info->iMemorySize)); + return ADL_OK; +} + +int WINAPI ADL_Graphics_Platform_Get(int *platform) +{ + struct wined3d_adapter_identifier identifier; + int count, i; + + FIXME("platform %p, stub!\n", platform); + + *platform = GRAPHICS_PLATFORM_UNKNOWN; + + count = wined3d_get_adapter_count(wined3d); + + for (i = 0; i < count; i ++) + { + if (!get_adapter_identifier(i, &identifier)) + continue; + + if (identifier.vendor_id == VENDOR_AMD) + *platform = GRAPHICS_PLATFORM_DESKTOP; + } + + /* NOTE: The real value can be obtained by doing: + * 1. ioctl(DRM_AMDGPU_INFO) with AMDGPU_INFO_DEV_INFO - dev_info.ids_flags & AMDGPU_IDS_FLAGS_FUSION + * 2. VkPhysicalDeviceType() if we ever switch to wined3d vk adapter implementation + */ + + return ADL_OK; } From d762a2651eecef211618b5048f9f77369f7a74bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 3 Nov 2020 16:26:52 +0100 Subject: [PATCH 0482/2542] atiadlxx: Update fake driver version to 20.10.1. --- dlls/atiadlxx/atiadlxx_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/atiadlxx/atiadlxx_main.c b/dlls/atiadlxx/atiadlxx_main.c index b1e7551ac820..f85c7f8ba622 100644 --- a/dlls/atiadlxx/atiadlxx_main.c +++ b/dlls/atiadlxx/atiadlxx_main.c @@ -136,15 +136,15 @@ typedef struct ADLMemoryInfo } ADLMemoryInfo, *LPADLMemoryInfo; static const ADLVersionsInfo version = { - "16.11.2", - "16.11.2", + "20.10.1", + "20.10.1", "", }; static const ADLVersionsInfoX2 version2 = { - "16.11.2", - "16.11.2", - "16.11.2", + "20.10.1", + "20.10.1", + "20.10.1", "", }; From 610ef3fa83174792743f9b75b854a3c0a8ed1e99 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Mon, 15 Nov 2021 11:33:45 -0600 Subject: [PATCH 0483/2542] atiadlxx: Update fake driver version to 21.20.01 Age of Empires IV wants this. CW-Bug-ID: #19602 --- dlls/atiadlxx/atiadlxx_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/atiadlxx/atiadlxx_main.c b/dlls/atiadlxx/atiadlxx_main.c index f85c7f8ba622..65c6d6ca988e 100644 --- a/dlls/atiadlxx/atiadlxx_main.c +++ b/dlls/atiadlxx/atiadlxx_main.c @@ -136,15 +136,15 @@ typedef struct ADLMemoryInfo } ADLMemoryInfo, *LPADLMemoryInfo; static const ADLVersionsInfo version = { - "20.10.1", - "20.10.1", + "21.20.01", + "21.20.01", "", }; static const ADLVersionsInfoX2 version2 = { - "20.10.1", - "20.10.1", - "20.10.1", + "21.20.01", + "21.20.01", + "21.20.01", "", }; From ef06e7d0e0892e4e47ee190181b138f395e9f969 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 25 Nov 2021 21:26:01 +0300 Subject: [PATCH 0484/2542] atiadlxx: Add stub for ADL_Display_DisplayMapConfig_Get(). CW-Bug-Id: #19687 --- dlls/atiadlxx/atiadlxx.spec | 2 +- dlls/atiadlxx/atiadlxx_main.c | 46 +++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/dlls/atiadlxx/atiadlxx.spec b/dlls/atiadlxx/atiadlxx.spec index e2fb060ae8d9..1e447f38dede 100644 --- a/dlls/atiadlxx/atiadlxx.spec +++ b/dlls/atiadlxx/atiadlxx.spec @@ -845,7 +845,7 @@ @ stub ADL_Display_DisplayContent_Get @ stub ADL_Display_DisplayContent_Set @ stdcall ADL_Display_DisplayInfo_Get(long long ptr long) -@ stub ADL_Display_DisplayMapConfig_Get +@ stdcall ADL_Display_DisplayMapConfig_Get(long ptr ptr ptr ptr long) @ stub ADL_Display_DisplayMapConfig_PossibleAddAndRemove @ stub ADL_Display_DisplayMapConfig_Set @ stub ADL_Display_DisplayMapConfig_Validate diff --git a/dlls/atiadlxx/atiadlxx_main.c b/dlls/atiadlxx/atiadlxx_main.c index 65c6d6ca988e..2f9b1102c37f 100644 --- a/dlls/atiadlxx/atiadlxx_main.c +++ b/dlls/atiadlxx/atiadlxx_main.c @@ -135,6 +135,40 @@ typedef struct ADLMemoryInfo long long iMemoryBandwidth; } ADLMemoryInfo, *LPADLMemoryInfo; +typedef struct ADLDisplayTarget +{ + ADLDisplayID displayID; + int iDisplayMapIndex; + int iDisplayTargetMask; + int iDisplayTargetValue; +} ADLDisplayTarget, *LPADLDisplayTarget; + +typedef struct ADLMode +{ + int iAdapterIndex; + ADLDisplayID displayID; + int iXPos; + int iYPos; + int iXRes; + int iYRes; + int iColourDepth; + float fRefreshRate; + int iOrientation; + int iModeFlag; + int iModeMask; + int iModeValue; +} ADLMode, *LPADLMode; + +typedef struct ADLDisplayMap +{ + int iDisplayMapIndex; + ADLMode displayMode; + int iNumDisplayTarget; + int iFirstDisplayTargetArrayIndex; + int iDisplayMapMask; + int iDisplayMapValue; +} ADLDisplayMap, *LPADLDisplayMap; + static const ADLVersionsInfo version = { "21.20.01", "21.20.01", @@ -432,3 +466,15 @@ int WINAPI ADL_Graphics_Platform_Get(int *platform) return ADL_OK; } + + +int WINAPI ADL_Display_DisplayMapConfig_Get(int adapter_index, int *display_map_count, ADLDisplayMap **display_maps, + int *display_target_count, ADLDisplayTarget **display_targets, int options) +{ + FIXME("adapter_index %d, display_map_count %p, display_maps %p, " + "display_target_count %p, display_targets %p, options %d stub.\n", + adapter_index, display_map_count, display_maps, display_target_count, + display_targets, options); + + return ADL_ERR; +} From 6bcd200edd510d5541c85dfa53184d6a671e5567 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Wed, 29 Dec 2021 18:00:39 +0200 Subject: [PATCH 0485/2542] atiadlxx: Query the information from dxgi instead of wined3d. so it works with DXVK's DXGI vendor/product mangling. --- dlls/atiadlxx/Makefile.in | 2 +- dlls/atiadlxx/atiadlxx_main.c | 101 +++++++++++++++++++--------------- 2 files changed, 58 insertions(+), 45 deletions(-) diff --git a/dlls/atiadlxx/Makefile.in b/dlls/atiadlxx/Makefile.in index f8423899b3ec..cc6b51bf2bcb 100644 --- a/dlls/atiadlxx/Makefile.in +++ b/dlls/atiadlxx/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = atiadlxx.dll -IMPORTS = wined3d +IMPORTS = dxgi EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native diff --git a/dlls/atiadlxx/atiadlxx_main.c b/dlls/atiadlxx/atiadlxx_main.c index 2f9b1102c37f..6ef2edd356cd 100644 --- a/dlls/atiadlxx/atiadlxx_main.c +++ b/dlls/atiadlxx/atiadlxx_main.c @@ -9,8 +9,10 @@ #include "winbase.h" #include "winuser.h" #include "objbase.h" +#include "initguid.h" #include "wine/debug.h" -#include "wine/wined3d.h" + +#include "dxgi.h" #define MAX_GPUS 64 #define VENDOR_AMD 0x1002 @@ -37,7 +39,7 @@ enum ADLPlatForm #define GRAPHICS_PLATFORM_UNKNOWN -1 -static struct wined3d *wined3d; +static IDXGIFactory *dxgi_factory; WINE_DEFAULT_DEBUG_CHANNEL(atiadlxx); @@ -193,7 +195,8 @@ int WINAPI ADL_Main_Control_Create(ADL_MAIN_MALLOC_CALLBACK cb, int arg) FIXME("cb %p, arg %d stub!\n", cb, arg); adl_malloc = cb; - if ((wined3d = wined3d_create(0))) + + if (SUCCEEDED(CreateDXGIFactory(&IID_IDXGIFactory, (void**) &dxgi_factory))) return ADL_OK; else return ADL_ERR; @@ -203,8 +206,8 @@ int WINAPI ADL_Main_Control_Destroy(void) { FIXME("stub!\n"); - if (wined3d != NULL) - wined3d_decref(wined3d); + if (dxgi_factory != NULL) + IUnknown_Release(dxgi_factory); return ADL_OK; } @@ -234,28 +237,34 @@ int WINAPI ADL_Graphics_Versions_Get(ADLVersionsInfo *ver) int WINAPI ADL_Adapter_NumberOfAdapters_Get(int *count) { + IDXGIAdapter *adapter; + FIXME("count %p stub!\n", count); - *count = wined3d_get_adapter_count(wined3d); + + *count = 0; + while (SUCCEEDED(IDXGIFactory_EnumAdapters(dxgi_factory, *count, &adapter))) + { + (*count)++; + IUnknown_Release(adapter); + } + TRACE("*count = %d\n", *count); return ADL_OK; } -static BOOL get_adapter_identifier(int index, struct wined3d_adapter_identifier *identifier) +static int get_adapter_desc(int adapter_index, DXGI_ADAPTER_DESC *desc) { - struct wined3d_adapter *adapter; + IDXGIAdapter *adapter; HRESULT hr; - adapter = wined3d_get_adapter(wined3d, index); - if (adapter == NULL) - return FALSE; + if (FAILED(IDXGIFactory_EnumAdapters(dxgi_factory, adapter_index, &adapter))) + return ADL_ERR; - memset(identifier, 0, sizeof(*identifier)); - hr = wined3d_adapter_get_identifier(adapter, 0, identifier); + hr = IDXGIAdapter_GetDesc(adapter, desc); - if (!SUCCEEDED(hr)) - return FALSE; + IUnknown_Release(adapter); - return TRUE; + return SUCCEEDED(hr) ? ADL_OK : ADL_ERR; } /* yep, seriously */ @@ -269,11 +278,11 @@ static int convert_vendor_id(int id) int WINAPI ADL_Adapter_AdapterInfo_Get(ADLAdapterInfo *adapters, int input_size) { int count, i; - struct wined3d_adapter_identifier identifier; + DXGI_ADAPTER_DESC adapter_desc; FIXME("adapters %p, input_size %d, stub!\n", adapters, input_size); - count = wined3d_get_adapter_count(wined3d); + ADL_Adapter_NumberOfAdapters_Get(&count); if (!adapters) return ADL_ERR_INVALID_PARAM; if (input_size != count * sizeof(ADLAdapterInfo)) return ADL_ERR_INVALID_PARAM; @@ -285,10 +294,10 @@ int WINAPI ADL_Adapter_AdapterInfo_Get(ADLAdapterInfo *adapters, int input_size) adapters[i].iSize = sizeof(ADLAdapterInfo); adapters[i].iAdapterIndex = i; - if (!get_adapter_identifier(i, &identifier)) + if (get_adapter_desc(i, &adapter_desc) != ADL_OK) return ADL_ERR; - adapters[i].iVendorID = convert_vendor_id(identifier.vendor_id); + adapters[i].iVendorID = convert_vendor_id(adapter_desc.VendorId); } return ADL_OK; @@ -296,18 +305,26 @@ int WINAPI ADL_Adapter_AdapterInfo_Get(ADLAdapterInfo *adapters, int input_size) int WINAPI ADL_Display_DisplayInfo_Get(int adapter_index, int *num_displays, ADLDisplayInfo **info, int force_detect) { - struct wined3d_adapter *adapter; - struct wined3d_output *output; + IDXGIAdapter *adapter; + IDXGIOutput *output; int i; FIXME("adapter %d, num_displays %p, info %p stub!\n", adapter_index, num_displays, info); if (info == NULL || num_displays == NULL) return ADL_ERR_NULL_POINTER; - adapter = wined3d_get_adapter(wined3d, adapter_index); - if (adapter == NULL) return ADL_ERR_INVALID_PARAM; + if (FAILED(IDXGIFactory_EnumAdapters(dxgi_factory, adapter_index, &adapter))) + return ADL_ERR_INVALID_PARAM; + + *num_displays = 0; + + while (SUCCEEDED(IDXGIAdapter_EnumOutputs(adapter, *num_displays, &output))) + { + (*num_displays)++; + IUnknown_Release(output); + } - *num_displays = wined3d_adapter_get_output_count(adapter); + IUnknown_Release(adapter); if (*num_displays == 0) return ADL_OK; @@ -317,10 +334,6 @@ int WINAPI ADL_Display_DisplayInfo_Get(int adapter_index, int *num_displays, ADL for (i = 0; i < *num_displays; i++) { - output = wined3d_adapter_get_output(adapter, i); - if (output == NULL) - return ADL_ERR; - (*info)[i].displayID.iDisplayLogicalIndex = i; (*info)[i].iDisplayInfoValue = ADL_DISPLAY_DISPLAYINFO_DISPLAYCONNECTED | ADL_DISPLAY_DISPLAYINFO_DISPLAYMAPPED; (*info)[i].iDisplayInfoMask = (*info)[i].iDisplayInfoValue; @@ -343,17 +356,17 @@ int WINAPI ADL_Adapter_Crossfire_Get(int adapter_index, ADLCrossfireComb *comb, int WINAPI ADL_Adapter_ASICFamilyType_Get(int adapter_index, int *asic_type, int *valids) { - struct wined3d_adapter_identifier identifier; + DXGI_ADAPTER_DESC adapter_desc; FIXME("adapter %d, asic_type %p, valids %p, stub!\n", adapter_index, asic_type, valids); if (asic_type == NULL || valids == NULL) return ADL_ERR_NULL_POINTER; - if (!get_adapter_identifier(adapter_index, &identifier)) + if (get_adapter_desc(adapter_index, &adapter_desc) != ADL_OK) return ADL_ERR_INVALID_ADL_IDX; - if (identifier.vendor_id != VENDOR_AMD) + if (adapter_desc.VendorId != VENDOR_AMD) return ADL_ERR_NOT_SUPPORTED; *asic_type = ADL_ASIC_DISCRETE; @@ -402,13 +415,13 @@ static int get_max_clock(const char *clock, int default_value) /* the name and documentation suggests that this returns current freqs, but it's actually max */ int WINAPI ADL_Adapter_ObservedClockInfo_Get(int adapter_index, int *core_clock, int *memory_clock) { - struct wined3d_adapter_identifier identifier; + DXGI_ADAPTER_DESC adapter_desc; FIXME("adapter %d, core_clock %p, memory_clock %p, stub!\n", adapter_index, core_clock, memory_clock); if (core_clock == NULL || memory_clock == NULL) return ADL_ERR; - if (!get_adapter_identifier(adapter_index, &identifier)) return ADL_ERR; - if (identifier.vendor_id != VENDOR_AMD) return ADL_ERR_INVALID_ADL_IDX; + if (get_adapter_desc(adapter_index, &adapter_desc) != ADL_OK) return ADL_ERR; + if (adapter_desc.VendorId != VENDOR_AMD) return ADL_ERR_INVALID_ADL_IDX; /* default values based on RX580 */ *core_clock = get_max_clock("sclk", 1350); @@ -422,15 +435,15 @@ int WINAPI ADL_Adapter_ObservedClockInfo_Get(int adapter_index, int *core_clock, /* documented in the "Linux Specific APIs" section, present and used on Windows */ int WINAPI ADL_Adapter_MemoryInfo_Get(int adapter_index, ADLMemoryInfo *mem_info) { - struct wined3d_adapter_identifier identifier; + DXGI_ADAPTER_DESC adapter_desc; FIXME("adapter %d, mem_info %p stub!\n", adapter_index, mem_info); if (mem_info == NULL) return ADL_ERR_NULL_POINTER; - if (!get_adapter_identifier(adapter_index, &identifier)) return ADL_ERR_INVALID_ADL_IDX; - if (identifier.vendor_id != VENDOR_AMD) return ADL_ERR; + if (get_adapter_desc(adapter_index, &adapter_desc) != ADL_OK) return ADL_ERR_INVALID_ADL_IDX; + if (adapter_desc.VendorId != VENDOR_AMD) return ADL_ERR; - mem_info->iMemorySize = identifier.video_memory; + mem_info->iMemorySize = adapter_desc.DedicatedVideoMemory; mem_info->iMemoryBandwidth = 256000; /* not exposed on Linux, probably needs a lookup table */ TRACE("iMemoryBandwidth %s, iMemorySize %s\n", @@ -441,27 +454,27 @@ int WINAPI ADL_Adapter_MemoryInfo_Get(int adapter_index, ADLMemoryInfo *mem_info int WINAPI ADL_Graphics_Platform_Get(int *platform) { - struct wined3d_adapter_identifier identifier; + DXGI_ADAPTER_DESC adapter_desc; int count, i; FIXME("platform %p, stub!\n", platform); *platform = GRAPHICS_PLATFORM_UNKNOWN; - count = wined3d_get_adapter_count(wined3d); + ADL_Adapter_NumberOfAdapters_Get(&count); for (i = 0; i < count; i ++) { - if (!get_adapter_identifier(i, &identifier)) + if (get_adapter_desc(i, &adapter_desc) != ADL_OK) continue; - if (identifier.vendor_id == VENDOR_AMD) + if (adapter_desc.VendorId == VENDOR_AMD) *platform = GRAPHICS_PLATFORM_DESKTOP; } /* NOTE: The real value can be obtained by doing: * 1. ioctl(DRM_AMDGPU_INFO) with AMDGPU_INFO_DEV_INFO - dev_info.ids_flags & AMDGPU_IDS_FLAGS_FUSION - * 2. VkPhysicalDeviceType() if we ever switch to wined3d vk adapter implementation + * 2. VkPhysicalDeviceType() if we ever want to use Vulkan directly */ return ADL_OK; From 287c01abbd2f2c831913b14101cceaabf3b1263a Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 11 Oct 2022 20:48:10 -0500 Subject: [PATCH 0486/2542] atiadlxx: Bump driver version. CW-Bug-Id: #21397 --- dlls/atiadlxx/atiadlxx_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/atiadlxx/atiadlxx_main.c b/dlls/atiadlxx/atiadlxx_main.c index 6ef2edd356cd..21dfbe710964 100644 --- a/dlls/atiadlxx/atiadlxx_main.c +++ b/dlls/atiadlxx/atiadlxx_main.c @@ -172,16 +172,16 @@ typedef struct ADLDisplayMap } ADLDisplayMap, *LPADLDisplayMap; static const ADLVersionsInfo version = { - "21.20.01", - "21.20.01", + "22.20.19.16-221003a-384125E-AMD-Software-Adrenalin-Edition", "", + "http://support.amd.com/drivers/xml/driver_09_us.xml", }; static const ADLVersionsInfoX2 version2 = { - "21.20.01", - "21.20.01", - "21.20.01", + "22.20.19.16-221003a-384125E-AMD-Software-Adrenalin-Edition", "", + "22.10.1", + "http://support.amd.com/drivers/xml/driver_09_us.xml", }; int WINAPI ADL2_Main_Control_Create(ADL_MAIN_MALLOC_CALLBACK cb, int arg, ADL_CONTEXT_HANDLE *ptr) From 5f382a8bf928737f3b4e3add060a9cd52c06b664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 30 Sep 2021 20:01:10 +0200 Subject: [PATCH 0487/2542] wine.inf: Enable builtin atiadlxx for Call of Duty games. The games call several functions from this DLL to check driver version, which we stub to some acceptable value to avoid warnings. --- loader/wine.inf.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 01128e13b870..9daa9ed82643 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2815,3 +2815,10 @@ HKCU,Software\Wine\DllOverrides,"vcomp140",0x2,"native,builtin" HKCU,Software\Wine\DllOverrides,"vcruntime140",0x2,"native,builtin" HKCU,Software\Wine\DllOverrides,"atiadlxx",,"disabled" HKCU,Software\Wine\DllOverrides,"vcruntime140_1",0x2,"native,builtin" +;;App-specific overrides for atiadlxx.dll. +HKCU,Software\Wine\AppDefaults\s2_sp64_ship.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\s2_mp64_ship.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\h1_sp64_ship.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\h1_mp64_ship.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\iw7_ship.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\BlackOps3.exe\DllOverrides,"atiadlxx",,"builtin" From 825c12ae86d478ec7e4634d40c90f1519491e4c4 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Tue, 13 Oct 2020 18:20:39 +0300 Subject: [PATCH 0488/2542] wine.inf: Enable atiadlxx and disable ags for Shadow of War. With the recent stubs game is able to use our atiadlxx without crashing. This helps with getting the resolution list populated with AMD GPUs. AGS has to be force disabled - the dll ships with the game and uses a bunch of more complex ADL2 calls that remain unimplemented. The game works fine if the DLL is not found. --- loader/wine.inf.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 9daa9ed82643..c91447fd5e3a 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2815,6 +2815,7 @@ HKCU,Software\Wine\DllOverrides,"vcomp140",0x2,"native,builtin" HKCU,Software\Wine\DllOverrides,"vcruntime140",0x2,"native,builtin" HKCU,Software\Wine\DllOverrides,"atiadlxx",,"disabled" HKCU,Software\Wine\DllOverrides,"vcruntime140_1",0x2,"native,builtin" +HKCU,Software\Wine\AppDefaults\ShadowOfWar.exe\DllOverrides,"amd_ags_x64",,"disabled" ;;App-specific overrides for atiadlxx.dll. HKCU,Software\Wine\AppDefaults\s2_sp64_ship.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\s2_mp64_ship.exe\DllOverrides,"atiadlxx",,"builtin" @@ -2822,3 +2823,4 @@ HKCU,Software\Wine\AppDefaults\h1_sp64_ship.exe\DllOverrides,"atiadlxx",,"builti HKCU,Software\Wine\AppDefaults\h1_mp64_ship.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\iw7_ship.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\BlackOps3.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\ShadowOfWar.exe\DllOverrides,"atiadlxx",,"builtin" From b1f36190e2c0611b3f9e65bcbd2105102dbe3882 Mon Sep 17 00:00:00 2001 From: Anna Lasky Date: Fri, 5 Feb 2021 08:31:07 -0600 Subject: [PATCH 0489/2542] wine.inf: Use built-in atiadlxx for Need For Speed. --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index c91447fd5e3a..028a313689da 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2823,4 +2823,5 @@ HKCU,Software\Wine\AppDefaults\h1_sp64_ship.exe\DllOverrides,"atiadlxx",,"builti HKCU,Software\Wine\AppDefaults\h1_mp64_ship.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\iw7_ship.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\BlackOps3.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\NFS16.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\ShadowOfWar.exe\DllOverrides,"atiadlxx",,"builtin" From 767621a251a9518d06b3f4d493f18a4f1b3f3323 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Mon, 15 Mar 2021 13:24:34 -0500 Subject: [PATCH 0490/2542] wine.inf: Use built-in atiadlxx for DIRT5. --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 028a313689da..6f1ce77d9f53 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2825,3 +2825,4 @@ HKCU,Software\Wine\AppDefaults\iw7_ship.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\BlackOps3.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\NFS16.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\ShadowOfWar.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\DIRT5.exe\DllOverrides,"atiadlxx",,"builtin" From 7380768bc61bc30c40282743217c8c2a554c0738 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 27 Oct 2021 17:25:25 +0300 Subject: [PATCH 0491/2542] wine.inf: Use built-in atiadlxx for GotG. CW-Bug-ID: #19579 Avoids the warning about too old drivers on start. --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 6f1ce77d9f53..3c8ddf7cb24d 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2826,3 +2826,4 @@ HKCU,Software\Wine\AppDefaults\BlackOps3.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\NFS16.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\ShadowOfWar.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\DIRT5.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\gotg.exe\DllOverrides,"atiadlxx",,"builtin" From eeeaf4ceb74ef524221c2bd986ac1a01f4e8320a Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Sun, 12 Dec 2021 14:07:16 +0100 Subject: [PATCH 0492/2542] wine.inf: Use built-in atiadlxx for Age of Empires IV. CW-Bug-ID: #19602 Avoids the warning about too old drivers on start. --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 3c8ddf7cb24d..e94cbaf907cf 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2827,3 +2827,4 @@ HKCU,Software\Wine\AppDefaults\NFS16.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\ShadowOfWar.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\DIRT5.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\gotg.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\RelicCardinal.exe\DllOverrides,"atiadlxx",,"builtin" From a32e8119732fa4fb09868632110eda40cd729c3e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 25 Nov 2021 21:33:24 +0300 Subject: [PATCH 0493/2542] wine.inf: Use built-in atiadlxx for Marvel's Avengers. CW-Bug-Id: #19687 --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index e94cbaf907cf..9970c8d5c540 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2828,3 +2828,4 @@ HKCU,Software\Wine\AppDefaults\ShadowOfWar.exe\DllOverrides,"atiadlxx",,"builtin HKCU,Software\Wine\AppDefaults\DIRT5.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\gotg.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\RelicCardinal.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\Avengers.exe\DllOverrides,"atiadlxx",,"builtin" From f3c48d1c0783c0a6122a62fc1c7722c6421b99c5 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 2 Feb 2022 18:26:36 +0300 Subject: [PATCH 0494/2542] wine.inf: Use built-in atiadlxx for STAR WARS Squadrons. CW-Bug-Id: #19944 --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 9970c8d5c540..aebd5d213341 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2829,3 +2829,4 @@ HKCU,Software\Wine\AppDefaults\DIRT5.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\gotg.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\RelicCardinal.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\Avengers.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\starwarssquadrons.exe\DllOverrides,"atiadlxx",,"builtin" From 1cc93cfd0e4f3fe900f422a471420f03ff487c1b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 29 Jun 2022 11:12:42 -0500 Subject: [PATCH 0495/2542] wine.inf: Use built-in atiadlxx for Plants vs Zombies Garden Warfare 2. CW-Bug-Id: #20818 --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index aebd5d213341..aefb05c3138a 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2830,3 +2830,4 @@ HKCU,Software\Wine\AppDefaults\gotg.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\RelicCardinal.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\Avengers.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\starwarssquadrons.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\GW2.Main_Win64_Retail.exe\DllOverrides,"atiadlxx",,"builtin" From 30ff82d57fe99da4ffe111b394c98c6db1cb66b3 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 11 Oct 2022 20:51:30 -0500 Subject: [PATCH 0496/2542] wine.inf: Use built-in atiadlxx for Spider-Man Remastered. CW-Bug-Id: #21397 --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index aefb05c3138a..64eb1fdcb435 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2831,3 +2831,4 @@ HKCU,Software\Wine\AppDefaults\RelicCardinal.exe\DllOverrides,"atiadlxx",,"built HKCU,Software\Wine\AppDefaults\Avengers.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\starwarssquadrons.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\GW2.Main_Win64_Retail.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\Spider-Man.exe\DllOverrides,"atiadlxx",,"builtin" From 8e45f6110f3a76b9b2b74838f116b8f56dc8c513 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 20 Jul 2023 20:45:34 -0600 Subject: [PATCH 0497/2542] amd_ags_x64, atiadlxx: Bump driver version. --- dlls/amd_ags_x64/amd_ags_x64_main.c | 11 +++++++---- dlls/atiadlxx/atiadlxx_main.c | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index dd49e38451b3..bad5330b2343 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -26,6 +26,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(amd_ags); +static const char driver_version[] = "23.10.01.45-230626a-393367C-AMD-Software-Adrenalin-Edition"; +static const char radeon_version[] = "23.7.1"; + enum amd_ags_version { AMD_AGS_VERSION_5_1_1, @@ -590,8 +593,8 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi gpu_info->agsVersionMajor = amd_ags_info[object->version].major; gpu_info->agsVersionMinor = amd_ags_info[object->version].minor; gpu_info->agsVersionPatch = amd_ags_info[object->version].patch; - gpu_info->driverVersion = "21.30.25.05-211005a-372402E-RadeonSoftware"; - gpu_info->radeonSoftwareVersion = "21.10.2"; + gpu_info->driverVersion = driver_version; + gpu_info->radeonSoftwareVersion = radeon_version; gpu_info->numDevices = object->device_count; gpu_info->devices = object->devices; @@ -625,8 +628,8 @@ AGSReturnCode WINAPI agsInitialize(int ags_version, const AGSConfiguration *conf } memset(gpu_info, 0, sizeof(*gpu_info)); - gpu_info->driverVersion = "21.30.25.05-211005a-372402E-RadeonSoftware"; - gpu_info->radeonSoftwareVersion = "21.10.2"; + gpu_info->driverVersion = driver_version; + gpu_info->radeonSoftwareVersion = radeon_version; gpu_info->numDevices = object->device_count; gpu_info->devices = object->devices; diff --git a/dlls/atiadlxx/atiadlxx_main.c b/dlls/atiadlxx/atiadlxx_main.c index 21dfbe710964..7104bcfa723b 100644 --- a/dlls/atiadlxx/atiadlxx_main.c +++ b/dlls/atiadlxx/atiadlxx_main.c @@ -172,15 +172,15 @@ typedef struct ADLDisplayMap } ADLDisplayMap, *LPADLDisplayMap; static const ADLVersionsInfo version = { - "22.20.19.16-221003a-384125E-AMD-Software-Adrenalin-Edition", + "23.10.01.45-230626a-393367C-AMD-Software-Adrenalin-Edition", "", "http://support.amd.com/drivers/xml/driver_09_us.xml", }; static const ADLVersionsInfoX2 version2 = { - "22.20.19.16-221003a-384125E-AMD-Software-Adrenalin-Edition", + "23.10.01.45-230626a-393367C-AMD-Software-Adrenalin-Edition", "", - "22.10.1", + "23.7.1", "http://support.amd.com/drivers/xml/driver_09_us.xml", }; From d0b269c98383a74ad459fd0b49b47c68d544abf2 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 14 Aug 2023 16:41:03 -0600 Subject: [PATCH 0498/2542] amd_ags_x64, atiadlxx: Bump driver version. --- dlls/amd_ags_x64/amd_ags_x64_main.c | 4 ++-- dlls/atiadlxx/atiadlxx_main.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index bad5330b2343..939f141272e4 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -26,8 +26,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(amd_ags); -static const char driver_version[] = "23.10.01.45-230626a-393367C-AMD-Software-Adrenalin-Edition"; -static const char radeon_version[] = "23.7.1"; +static const char driver_version[] = "23.10.23.02-230720a-394204C-AMD-Software-Adrenalin-Edition"; +static const char radeon_version[] = "23.8.1"; enum amd_ags_version { diff --git a/dlls/atiadlxx/atiadlxx_main.c b/dlls/atiadlxx/atiadlxx_main.c index 7104bcfa723b..8c52dbdc6016 100644 --- a/dlls/atiadlxx/atiadlxx_main.c +++ b/dlls/atiadlxx/atiadlxx_main.c @@ -172,15 +172,15 @@ typedef struct ADLDisplayMap } ADLDisplayMap, *LPADLDisplayMap; static const ADLVersionsInfo version = { - "23.10.01.45-230626a-393367C-AMD-Software-Adrenalin-Edition", + "23.10.23.02-230720a-394204C-AMD-Software-Adrenalin-Edition", "", "http://support.amd.com/drivers/xml/driver_09_us.xml", }; static const ADLVersionsInfoX2 version2 = { - "23.10.01.45-230626a-393367C-AMD-Software-Adrenalin-Edition", + "23.10.23.02-230720a-394204C-AMD-Software-Adrenalin-Edition", "", - "23.7.1", + "23.8.1", "http://support.amd.com/drivers/xml/driver_09_us.xml", }; From 2161a05ec6deda5e365f9e7d336418de629ddb70 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 25 Aug 2023 14:40:35 -0600 Subject: [PATCH 0499/2542] amd_ags_x64: Support version 5.0.5. Elden Ring is using this version. --- dlls/amd_ags_x64/amd_ags_x64_main.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 939f141272e4..8b9c7cc78988 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -31,6 +31,7 @@ static const char radeon_version[] = "23.8.1"; enum amd_ags_version { + AMD_AGS_VERSION_5_0_5, AMD_AGS_VERSION_5_1_1, AMD_AGS_VERSION_5_2_0, AMD_AGS_VERSION_5_2_1, @@ -55,6 +56,7 @@ static const struct } amd_ags_info[AMD_AGS_VERSION_COUNT] = { + {5, 0, 5, sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511)}, {5, 1, 1, sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511)}, {5, 2, 0, sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520)}, {5, 2, 1, sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520)}, @@ -67,22 +69,22 @@ amd_ags_info[AMD_AGS_VERSION_COUNT] = {6, 1, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)}, }; -#define DEF_FIELD(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ +#define DEF_FIELD(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name), \ offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} -#define DEF_FIELD_520_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ +#define DEF_FIELD_520_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), -1, \ -1, -1, -1, -1, -1}} -#define DEF_FIELD_540_UP(name) {DEVICE_FIELD_##name, {-1, -1, \ +#define DEF_FIELD_540_UP(name) {DEVICE_FIELD_##name, {-1, -1, -1, \ -1, -1, offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name), \ offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} -#define DEF_FIELD_540_600(name) {DEVICE_FIELD_##name, {-1, -1, \ +#define DEF_FIELD_540_600(name) {DEVICE_FIELD_##name, {-1, -1, -1, \ -1, -1, offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \ -1, -1, -1}} -#define DEF_FIELD_600_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ +#define DEF_FIELD_600_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), -1, \ -1, -1}} @@ -945,9 +947,10 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_SetDepthBounds_530(AGSContext* cont return set_depth_bounds(context, dx_context, enabled, min_depth, max_depth); } +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); __ASM_GLOBAL_FUNC( DX11_SetDepthBounds_impl, "mov (%rcx),%eax\n\t" /* version */ - "cmp $3,%eax\n\t" + "cmp $4,%eax\n\t" "jge 1f\n\t" "jmp " __ASM_NAME("agsDriverExtensionsDX11_SetDepthBounds") "\n\t" "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_SetDepthBounds_530") ) @@ -996,9 +999,10 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_BeginUAVOverlap(AGSContext *context return update_uav_overlap(context, dx_context, TRUE); } +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); __ASM_GLOBAL_FUNC( DX11_BeginUAVOverlap_impl, "mov (%rcx),%eax\n\t" /* version */ - "cmp $3,%eax\n\t" + "cmp $4,%eax\n\t" "jge 1f\n\t" "jmp " __ASM_NAME("agsDriverExtensionsDX11_BeginUAVOverlap_520") "\n\t" "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_BeginUAVOverlap") ) @@ -1029,9 +1033,10 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_EndUAVOverlap(AGSContext *context, return update_uav_overlap(context, dx_context, FALSE); } +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); __ASM_GLOBAL_FUNC( DX11_EndUAVOverlap_impl, "mov (%rcx),%eax\n\t" /* version */ - "cmp $3,%eax\n\t" + "cmp $4,%eax\n\t" "jge 1f\n\t" "jmp " __ASM_NAME("agsDriverExtensionsDX11_EndUAVOverlap_520") "\n\t" "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_EndUAVOverlap") ) @@ -1074,9 +1079,11 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_DestroyDevice_511(AGSContext *conte return agsDriverExtensionsDX11_DestroyDevice_520(context, device, references, NULL, NULL); } + +C_ASSERT(AMD_AGS_VERSION_5_2_0 == 2); __ASM_GLOBAL_FUNC( agsDriverExtensionsDX11_DestroyDevice, "mov (%rcx),%eax\n\t" /* version */ - "cmp $1,%eax\n\t" + "cmp $2,%eax\n\t" "jge 1f\n\t" "jmp " __ASM_NAME("agsDriverExtensionsDX11_DestroyDevice_511") "\n\t" "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_DestroyDevice_520") ) From e41243f0b0f602e889094102a2abf75c863aab42 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 28 Aug 2023 11:46:57 -0600 Subject: [PATCH 0500/2542] amd_ags_x64: Fill chroma info in AGSDisplayInfo. Based on a patch by Joshua Ashton. CW-Bug-Id: #22677 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 107 +++++++++++++++++++++++++++- 1 file changed, 106 insertions(+), 1 deletion(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 8b9c7cc78988..7e85ffa8fb71 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -15,10 +15,11 @@ #include "wine/asm.h" #define COBJMACROS +#include "initguid.h" #include "d3d11.h" #include "d3d12.h" -#include "initguid.h" +#include "dxgi1_6.h" #include "dxvk_interfaces.h" @@ -348,8 +349,103 @@ struct monitor_enum_context_600 const char *adapter_name; AGSDisplayInfo_600 **ret_displays; int *ret_display_count; + IDXGIFactory1 *dxgi_factory; }; +static void create_dxgi_factory(HMODULE *hdxgi, IDXGIFactory1 **factory) +{ + typeof(CreateDXGIFactory1) *pCreateDXGIFactory1; + + *factory = NULL; + + if (!(*hdxgi = LoadLibraryW(L"dxgi.dll"))) + { + ERR("Could not load dxgi.dll.\n"); + return; + } + + if (!(pCreateDXGIFactory1 = (void *)GetProcAddress(*hdxgi, "CreateDXGIFactory1"))) + { + ERR("Could not find CreateDXGIFactory1.\n"); + return; + } + + if (FAILED(pCreateDXGIFactory1(&IID_IDXGIFactory1, (void**)factory))) + return; +} + +static void release_dxgi_factory(HMODULE hdxgi, IDXGIFactory1 *factory) +{ + if (factory) + IDXGIFactory1_Release(factory); + if (hdxgi) + FreeLibrary(hdxgi); +} + +static void fill_chroma_info(AGSDisplayInfo_600 *info, struct monitor_enum_context_600 *c, HMONITOR monitor) +{ + DXGI_OUTPUT_DESC1 output_desc; + IDXGIAdapter1 *adapter; + IDXGIOutput6 *output6; + IDXGIOutput *output; + BOOL found = FALSE; + unsigned int i, j; + HRESULT hr; + + i = 0; + while (!found && (SUCCEEDED(IDXGIFactory1_EnumAdapters1(c->dxgi_factory, i++, &adapter)))) + { + j = 0; + while (SUCCEEDED(IDXGIAdapter1_EnumOutputs(adapter, j++, &output))) + { + hr = IDXGIOutput_QueryInterface(output, &IID_IDXGIOutput6, (void**)&output6); + IDXGIOutput_Release(output); + if (FAILED(hr)) + { + WARN("Failed to query IDXGIOutput6.\n"); + continue; + } + hr = IDXGIOutput6_GetDesc1(output6, &output_desc); + IDXGIOutput6_Release(output6); + + if (FAILED(hr) || output_desc.Monitor != monitor) + continue; + found = TRUE; + + TRACE("output_desc.ColorSpace %#x.\n", output_desc.ColorSpace); + if (output_desc.ColorSpace == DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020) + { + TRACE("Reporting monitor %s as HDR10 supported.\n", debugstr_a(info->displayDeviceName)); + info->HDR10 = 1; + } + + info->chromaticityRedX = output_desc.RedPrimary[0]; + info->chromaticityRedY = output_desc.RedPrimary[1]; + info->chromaticityGreenX = output_desc.GreenPrimary[0]; + info->chromaticityGreenY = output_desc.GreenPrimary[1]; + info->chromaticityBlueX = output_desc.BluePrimary[0]; + info->chromaticityBlueY = output_desc.BluePrimary[1]; + info->chromaticityWhitePointX = output_desc.WhitePoint[0]; + info->chromaticityWhitePointY = output_desc.WhitePoint[1]; + + TRACE("chromacity: (%.6lf, %.6lf) (%.6lf, %.6lf) (%.6lf, %.6lf).\n", info->chromaticityRedX, + info->chromaticityRedY, info->chromaticityGreenX, info->chromaticityGreenY, info->chromaticityBlueX, + info->chromaticityBlueY); + + info->screenDiffuseReflectance = 0; + info->screenSpecularReflectance = 0; + + info->minLuminance = output_desc.MinLuminance; + info->maxLuminance = output_desc.MaxLuminance; + info->avgLuminance = output_desc.MaxFullFrameLuminance; + } + IDXGIAdapter1_Release(adapter); + } + + if (!found) + WARN("dxgi output not found.\n"); +} + static BOOL WINAPI monitor_enum_proc_600(HMONITOR hmonitor, HDC hdc, RECT *rect, LPARAM context) { struct monitor_enum_context_600 *c = (struct monitor_enum_context_600 *)context; @@ -419,6 +515,9 @@ static BOOL WINAPI monitor_enum_proc_600(HMONITOR hmonitor, HDC hdc, RECT *rect, dev_mode.dmSize = sizeof(dev_mode); } + info->eyefinityGridCoordX = -1; + info->eyefinityGridCoordY = -1; + info->currentResolution.offsetX = monitor_info.rcMonitor.left; info->currentResolution.offsetY = monitor_info.rcMonitor.top; info->currentResolution.width = monitor_info.rcMonitor.right - monitor_info.rcMonitor.left; @@ -432,6 +531,9 @@ static BOOL WINAPI monitor_enum_proc_600(HMONITOR hmonitor, HDC hdc, RECT *rect, info->currentRefreshRate = dev_mode.dmDisplayFrequency; else ERR("Could not get current display settings.\n"); + + fill_chroma_info(info, c, hmonitor); + ++*c->ret_display_count; TRACE("Added display %s for %s.\n", debugstr_a(monitor_info.szDevice), debugstr_a(c->adapter_name)); @@ -443,14 +545,17 @@ static BOOL WINAPI monitor_enum_proc_600(HMONITOR hmonitor, HDC hdc, RECT *rect, static void init_device_displays_600(const char *adapter_name, AGSDisplayInfo_600 **ret_displays, int *ret_display_count) { struct monitor_enum_context_600 context; + HMODULE hdxgi; TRACE("adapter_name %s.\n", debugstr_a(adapter_name)); context.adapter_name = adapter_name; context.ret_displays = ret_displays; context.ret_display_count = ret_display_count; + create_dxgi_factory(&hdxgi, &context.dxgi_factory); EnumDisplayMonitors(NULL, NULL, monitor_enum_proc_600, (LPARAM)&context); + release_dxgi_factory(hdxgi, context.dxgi_factory); } static void init_device_displays_511(const char *adapter_name, AGSDisplayInfo_511 **ret_displays, int *ret_display_count) From 4a74f61573aab213aabc451d3425d0964c9b4018 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Sat, 26 Aug 2023 15:01:32 +0100 Subject: [PATCH 0501/2542] amd_ags_x64: Add definitions for AGSDisplaySettings_506 The enum stuff is slightly different here. Signed-off-by: Joshua Ashton CW-Bug-Id: #22677 --- dlls/amd_ags_x64/amd_ags.h | 55 ++++++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index f0afda73d375..52276cc1935e 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -689,22 +689,54 @@ typedef struct AGSGPUInfo_600 } AGSGPUInfo_600; /// The display mode -typedef enum AGSDisplaySettings_Mode +typedef enum AGSDisplaySettings_Mode_506 { - Mode_SDR, ///< SDR mode - Mode_HDR10_PQ, ///< HDR10 PQ encoding, requiring a 1010102 UNORM swapchain and PQ encoding in the output shader. - Mode_HDR10_scRGB, ///< HDR10 scRGB, requiring an FP16 swapchain. Values of 1.0 == 80 nits, 125.0 == 10000 nits. - Mode_FreesyncHDR_scRGB, ///< Freesync HDR scRGB, requiring an FP16 swapchain. A value of 1.0 == 80 nits. - Mode_FreesyncHDR_Gamma22, ///< Freesync HDR Gamma 2.2, requiring a 1010102 UNORM swapchain. The output needs to be encoded to gamma 2.2. - Mode_DolbyVision, ///< Dolby Vision, requiring an 8888 UNORM swapchain + Mode_506_SDR, ///< SDR mode + Mode_506_scRGB, ///< scRGB, requiring an FP16 swapchain. Values of 1.0 == 80 nits, 125.0 == 10000 nits. Uses REC709 primaries. + Mode_506_PQ, ///< PQ encoding, requiring a 1010102 UNORM swapchain and PQ encoding in the output shader. Uses BT2020 primaries. + Mode_506_DolbyVision ///< Dolby Vision, requiring an 8888 UNORM swapchain +} AGSDisplaySettings_Mode_506; - Mode_Count ///< Number of enumerated display modes -} AGSDisplaySettings_Mode; +typedef enum AGSDisplaySettings_Mode_600 +{ + Mode_600_SDR, ///< SDR mode + Mode_600_HDR10_PQ, ///< HDR10 PQ encoding, requiring a 1010102 UNORM swapchain and PQ encoding in the output shader. + Mode_600_HDR10_scRGB, ///< HDR10 scRGB, requiring an FP16 swapchain. Values of 1.0 == 80 nits, 125.0 == 10000 nits. + Mode_600_FreesyncHDR_scRGB, ///< Freesync HDR scRGB, requiring an FP16 swapchain. A value of 1.0 == 80 nits. + Mode_600_FreesyncHDR_Gamma22, ///< Freesync HDR Gamma 2.2, requiring a 1010102 UNORM swapchain. The output needs to be encoded to gamma 2.2. + Mode_600_DolbyVision, ///< Dolby Vision, requiring an 8888 UNORM swapchain + + Mode_600_Count ///< Number of enumerated display modes +} AGSDisplaySettings_Mode_600; + +/// The struct to specify the display settings to the driver. +typedef struct AGSDisplaySettings_506 +{ + AGSDisplaySettings_Mode_506 mode; ///< The display mode to set the display into + + double chromaticityRedX; ///< Red display primary X coord + double chromaticityRedY; ///< Red display primary Y coord + + double chromaticityGreenX; ///< Green display primary X coord + double chromaticityGreenY; ///< Green display primary Y coord + + double chromaticityBlueX; ///< Blue display primary X coord + double chromaticityBlueY; ///< Blue display primary Y coord + + double chromaticityWhitePointX; ///< White point X coord + double chromaticityWhitePointY; ///< White point Y coord + + double minLuminance; ///< The minimum scene luminance in nits + double maxLuminance; ///< The maximum scene luminance in nits + + double maxContentLightLevel; ///< The maximum content light level in nits (MaxCLL) + double maxFrameAverageLightLevel; ///< The maximum frame average light level in nits (MaxFALL) +} AGSDisplaySettings_506; /// The struct to specify the display settings to the driver. typedef struct AGSDisplaySettings_511 { - AGSDisplaySettings_Mode mode; ///< The display mode to set the display into + AGSDisplaySettings_Mode_600 mode; ///< The display mode to set the display into double chromaticityRedX; ///< Red display primary X coord double chromaticityRedY; ///< Red display primary Y coord @@ -731,7 +763,7 @@ typedef struct AGSDisplaySettings_511 /// The struct to specify the display settings to the driver. typedef struct AGSDisplaySettings_600 { - AGSDisplaySettings_Mode mode; ///< The display mode to set the display into + AGSDisplaySettings_Mode_600 mode; ///< The display mode to set the display into double chromaticityRedX; ///< Red display primary X coord double chromaticityRedY; ///< Red display primary Y coord @@ -757,6 +789,7 @@ typedef struct AGSDisplaySettings_600 typedef union AGSDisplaySettings { + AGSDisplaySettings_506 agsDisplaySettings506; AGSDisplaySettings_511 agsDisplaySettings511; AGSDisplaySettings_600 agsDisplaySettings600; } AGSDisplaySettings; From d49dc6ba81b5cc0dbb646109b177226d37bdd29e Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Sat, 26 Aug 2023 15:02:15 +0100 Subject: [PATCH 0502/2542] amd_ags_x64: Implement agsSetDisplayMode Gets HDR working with Elden Ring. With minor changes by Paul Gofman: - update for prior changes (create dxgi factory when needed); - still return success if anything goes wrong with getting dxgi custom interface; - add a trace with chromacity; - remove '!' in trace messages. CW-Bug-Id: #22677 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 97 +++++++++++++++++++++++++++- dlls/amd_ags_x64/dxvk_interfaces.idl | 35 ++++++++++ 2 files changed, 130 insertions(+), 2 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 7e85ffa8fb71..636f5f536957 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -781,15 +781,108 @@ AGSReturnCode WINAPI agsDeInitialize(AGSContext *context) return AGS_SUCCESS; } +static DXGI_COLOR_SPACE_TYPE convert_ags_colorspace_506(AGSDisplaySettings_Mode_506 mode) +{ + switch (mode) + { + default: + ERR("Unknown color space in AGS: %d.\n", mode); + /* fallthrough */ + case Mode_506_SDR: + TRACE("Setting Mode_506_SDR.\n"); + return DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709; + case Mode_506_PQ: + TRACE("Setting Mode_506_PQ.\n"); + return DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020; + case Mode_506_scRGB: + TRACE("Setting Mode_506_scRGB.\n"); + return DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709; + } +} + +static DXGI_COLOR_SPACE_TYPE convert_ags_colorspace_600(AGSDisplaySettings_Mode_600 mode) +{ + switch (mode) + { + default: + ERR("Unknown color space in AGS: %d\n", mode); + /* fallthrough */ + case Mode_600_SDR: + TRACE("Setting Mode_600_SDR.\n"); + return DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709; + case Mode_600_HDR10_PQ: + TRACE("Setting Mode_600_HDR10_PQ.\n"); + return DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020; + case Mode_600_HDR10_scRGB: + TRACE("Setting Mode_600_HDR10_scRGB.\n"); + return DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709; + } +} + +static DXGI_HDR_METADATA_HDR10 convert_ags_metadata(const AGSDisplaySettings_600 *settings) +{ + DXGI_HDR_METADATA_HDR10 metadata; + metadata.RedPrimary[0] = settings->chromaticityRedX * 50000; + metadata.RedPrimary[1] = settings->chromaticityRedY * 50000; + metadata.GreenPrimary[0] = settings->chromaticityGreenX * 50000; + metadata.GreenPrimary[1] = settings->chromaticityGreenY * 50000; + metadata.BluePrimary[0] = settings->chromaticityBlueX * 50000; + metadata.BluePrimary[1] = settings->chromaticityBlueY * 50000; + metadata.WhitePoint[0] = settings->chromaticityWhitePointX * 50000; + metadata.WhitePoint[1] = settings->chromaticityWhitePointY * 50000; + metadata.MaxMasteringLuminance = settings->maxLuminance; + metadata.MinMasteringLuminance = settings->minLuminance / 0.0001f; + metadata.MaxContentLightLevel = settings->maxContentLightLevel; + metadata.MaxFrameAverageLightLevel = settings->maxFrameAverageLightLevel; + return metadata; +} + AGSReturnCode WINAPI agsSetDisplayMode(AGSContext *context, int device_index, int display_index, const AGSDisplaySettings *settings) { - FIXME("context %p device_index %d display_index %d settings %p stub!\n", context, device_index, + const AGSDisplaySettings_506 *settings506 = &settings->agsDisplaySettings506; + const AGSDisplaySettings_600 *settings600 = &settings->agsDisplaySettings600; + IDXGIVkInteropFactory1 *dxgi_interop = NULL; + DXGI_COLOR_SPACE_TYPE colorspace; + DXGI_HDR_METADATA_HDR10 metadata; + AGSReturnCode ret = AGS_SUCCESS; + IDXGIFactory1 *dxgi_factory; + HMODULE hdxgi; + + TRACE("context %p device_index %d display_index %d settings %p\n", context, device_index, display_index, settings); if (!context) return AGS_INVALID_ARGS; - return AGS_SUCCESS; + create_dxgi_factory(&hdxgi, &dxgi_factory); + if (!dxgi_factory) + goto done; + + if (FAILED(IDXGIFactory1_QueryInterface(dxgi_factory, &IID_IDXGIVkInteropFactory1, (void**)&dxgi_interop))) + { + WARN("Failed to get IDXGIVkInteropFactory1.\n"); + goto done; + } + + colorspace = context->version < AMD_AGS_VERSION_5_1_1 + ? convert_ags_colorspace_506(settings506->mode) + : convert_ags_colorspace_600(settings600->mode); + /* Settings 506, 511 and 600 are identical aside from enum order + use + * of bitfield flags we do not use. */ + metadata = convert_ags_metadata(settings600); + + TRACE("chromacity: (%.6lf, %.6lf) (%.6lf, %.6lf) (%.6lf, %.6lf).\n", settings600->chromaticityRedX, + settings600->chromaticityRedY, settings600->chromaticityGreenX, settings600->chromaticityGreenY, + settings600->chromaticityBlueX, settings600->chromaticityBlueY); + + if (FAILED(IDXGIVkInteropFactory1_SetGlobalHDRState(dxgi_interop, colorspace, &metadata))) + ret = AGS_DX_FAILURE; + +done: + if (dxgi_interop) + IDXGIVkInteropFactory1_Release(dxgi_interop); + release_dxgi_factory(hdxgi, dxgi_factory); + return ret; } AGSReturnCode WINAPI agsGetCrossfireGPUCount(AGSContext *context, int *gpu_count) diff --git a/dlls/amd_ags_x64/dxvk_interfaces.idl b/dlls/amd_ags_x64/dxvk_interfaces.idl index c632d926fb2d..110cdb948964 100644 --- a/dlls/amd_ags_x64/dxvk_interfaces.idl +++ b/dlls/amd_ags_x64/dxvk_interfaces.idl @@ -17,6 +17,11 @@ */ import "d3d11.idl"; +import "dxgi1_6.idl"; + +typedef struct VkInstance_T *VkInstance; +typedef void (__stdcall *PFN_vkVoidFunction)(void); +typedef PFN_vkVoidFunction (__stdcall *PFN_vkGetInstanceProcAddr)(VkInstance instance, const char* pName); typedef enum D3D11_VK_EXTENSION { @@ -114,3 +119,33 @@ interface ID3D11VkExtContext1 : ID3D11VkExtContext [in] const void *params, [in] UINT32 param_size, [in] void * const *read_resources, [in] UINT32 read_resource_count, [in] void* const *write_resources, [in] UINT32 write_resources_count); } + +[ + object, + uuid(4c5e1b0d-b0c8-4131-bfd8-9b2476f7f408), + local, + pointer_default(unique) +] +interface IDXGIVkInteropFactory : IUnknown +{ + void GetVulkanInstance( + [out] VkInstance *pInstance, + [out] PFN_vkGetInstanceProcAddr *ppfnVkGetInstanceProcAddr); +} + +[ + object, + uuid(2a289dbd-2d0a-4a51-89f7-f2adce465cd6), + local, + pointer_default(unique) +] +interface IDXGIVkInteropFactory1 : IDXGIVkInteropFactory +{ + HRESULT GetGlobalHDRState( + [out] DXGI_COLOR_SPACE_TYPE *pOutColorSpace, + [out] DXGI_HDR_METADATA_HDR10 *ppOutMetadata) = 0; + + HRESULT SetGlobalHDRState( + [in] DXGI_COLOR_SPACE_TYPE ColorSpace, + [in] const DXGI_HDR_METADATA_HDR10 *pMetadata) = 0; +} From 1cecdae35cc7a29b0a2d2c307138665608a474a1 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 24 Oct 2023 12:17:28 -0600 Subject: [PATCH 0503/2542] amd_ags_x64,atiadll,wbemprox,win32u: Bump AMD driver version. --- dlls/amd_ags_x64/amd_ags_x64_main.c | 4 ++-- dlls/atiadlxx/atiadlxx_main.c | 6 +++--- dlls/wbemprox/builtin.c | 4 ++-- dlls/win32u/sysparams.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 636f5f536957..1d00b1ecb1ae 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -27,8 +27,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(amd_ags); -static const char driver_version[] = "23.10.23.02-230720a-394204C-AMD-Software-Adrenalin-Edition"; -static const char radeon_version[] = "23.8.1"; +static const char driver_version[] = "23.19.02-230831a-396538C-AMD-Software-Adrenalin-Edition"; +static const char radeon_version[] = "23.10.2"; enum amd_ags_version { diff --git a/dlls/atiadlxx/atiadlxx_main.c b/dlls/atiadlxx/atiadlxx_main.c index 8c52dbdc6016..8fdd2e55d029 100644 --- a/dlls/atiadlxx/atiadlxx_main.c +++ b/dlls/atiadlxx/atiadlxx_main.c @@ -172,15 +172,15 @@ typedef struct ADLDisplayMap } ADLDisplayMap, *LPADLDisplayMap; static const ADLVersionsInfo version = { - "23.10.23.02-230720a-394204C-AMD-Software-Adrenalin-Edition", + "23.19.02-230831a-396538C-AMD-Software-Adrenalin-Edition", "", "http://support.amd.com/drivers/xml/driver_09_us.xml", }; static const ADLVersionsInfoX2 version2 = { - "23.10.23.02-230720a-394204C-AMD-Software-Adrenalin-Edition", + "23.19.02-230831a-396538C-AMD-Software-Adrenalin-Edition", "", - "23.8.1", + "23.10.2", "http://support.amd.com/drivers/xml/driver_09_us.xml", }; diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 3e8c320028d0..770b49f21449 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -4242,8 +4242,8 @@ static enum fill_status fill_videocontroller( struct table *table, const struct rec->current_verticalres = vres; rec->description = wcsdup( name ); rec->device_id = L"VideoController1"; - rec->driverdate = L"20230420000000.000000-000"; - rec->driverversion = L"31.0.14051.5006"; + rec->driverdate = L"20230831000000.000000-000"; + rec->driverversion = L"31.0.21902.5"; rec->installeddriver = get_videocontroller_installeddriver( desc.VendorId ); rec->name = wcsdup( name ); rec->pnpdevice_id = get_videocontroller_pnpdeviceid( &desc ); diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index a939f5629e2b..32607e3501a2 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1207,7 +1207,7 @@ static BOOL write_gpu_to_registry( const struct gpu *gpu, const struct pci_id *p break; /* AMD */ case 0x1002: - strcpy( buffer, "31.0.14051.5006" ); + strcpy( buffer, "31.0.21902.5" ); break; /* Nvidia */ case 0x10de: From 41b21564912956d1794410349c496e8ad616bfb7 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 9 Nov 2023 16:06:37 -0600 Subject: [PATCH 0504/2542] amd_ags_x64: Implement agsDriverExtensionsDX11_DeInit(). CW-Bug-Id: #22976 --- dlls/amd_ags_x64/amd_ags_x64.spec | 2 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index 316eec6bf23b..3620bd8885b8 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -8,7 +8,7 @@ @ stub agsDriverExtensionsDX11_CreateTexture1D @ stub agsDriverExtensionsDX11_CreateTexture2D @ stub agsDriverExtensionsDX11_CreateTexture3D -@ stub agsDriverExtensionsDX11_DeInit +@ stdcall agsDriverExtensionsDX11_DeInit(ptr) @ stub agsDriverExtensionsDX11_Destroy @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_DestroyDevice() @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_EndUAVOverlap() DX11_EndUAVOverlap_impl diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 1d00b1ecb1ae..71c204b7c250 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -1082,6 +1082,19 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_Init( AGSContext *context, ID3D11De return AGS_SUCCESS; } +AGSReturnCode WINAPI agsDriverExtensionsDX11_DeInit( AGSContext* context ) +{ + TRACE("context %p.\n", context); + + if (context->d3d11_context) + { + ID3D11DeviceContext_Release(context->d3d11_context); + context->d3d11_context = NULL; + } + + return AGS_SUCCESS; +} + BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) { TRACE("%p, %u, %p.\n", instance, reason, reserved); From b9e7457f7930aa1b8a66dde33fac9be91b3fa5c3 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 9 Nov 2023 16:22:26 -0600 Subject: [PATCH 0505/2542] amd_ags_x64: Factor out get_version_number(). CW-Bug-Id: #22976 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 71c204b7c250..a067035d2614 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -255,6 +255,20 @@ static AGSReturnCode vk_get_physical_device_properties(unsigned int *out_count, return ret; } +static enum amd_ags_version get_version_number(int ags_version) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(amd_ags_info); i++) + if (AGS_MAKE_VERSION(amd_ags_info[i].major, amd_ags_info[i].minor, amd_ags_info[i].patch) == ags_version) + { + TRACE("Found AGS v%d.%d.%d.\n", amd_ags_info[i].major, amd_ags_info[i].minor, amd_ags_info[i].patch); + return i; + } + ERR("Unknown ags_version %#x, using 5.4.1.\n", ags_version); + return AMD_AGS_VERSION_5_4_1; +} + static enum amd_ags_version determine_ags_version(void) { /* AMD AGS is not binary compatible between versions (even minor versions), and the game @@ -269,7 +283,7 @@ static enum amd_ags_version determine_ags_version(void) DWORD infosize; void *infobuf = NULL; void *val; - UINT vallen, i; + UINT vallen; VS_FIXEDFILEINFO *info; UINT16 major, minor, patch; WCHAR dllname[MAX_PATH], temp_path[MAX_PATH], temp_name[MAX_PATH]; @@ -322,17 +336,7 @@ static enum amd_ags_version determine_ags_version(void) minor = info->dwFileVersionMS; patch = info->dwFileVersionLS >> 16; TRACE("Found amd_ags_x64.dll v%d.%d.%d\n", major, minor, patch); - - for (i = 0; i < ARRAY_SIZE(amd_ags_info); i++) - { - if ((major == amd_ags_info[i].major) && - (minor == amd_ags_info[i].minor) && - (patch == amd_ags_info[i].patch)) - { - ret = i; - break; - } - } + ret = get_version_number(AGS_MAKE_VERSION(major, minor, patch)); done: if (*temp_name) From d7d399b8487bbaa73173a690b5e5d9c6c0b745b3 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 27 Sep 2023 20:32:35 -0600 Subject: [PATCH 0506/2542] amd_ags_x64: Use version provided for agsInitialize(). CW-Bug-Id: #22976 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index a067035d2614..3bf3a811f2c2 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -269,7 +269,7 @@ static enum amd_ags_version get_version_number(int ags_version) return AMD_AGS_VERSION_5_4_1; } -static enum amd_ags_version determine_ags_version(void) +static enum amd_ags_version determine_ags_version(int ags_version) { /* AMD AGS is not binary compatible between versions (even minor versions), and the game * does not request a specific version when calling agsInit(). @@ -288,6 +288,11 @@ static enum amd_ags_version determine_ags_version(void) UINT16 major, minor, patch; WCHAR dllname[MAX_PATH], temp_path[MAX_PATH], temp_name[MAX_PATH]; + TRACE("ags_version %#x.\n", ags_version); + + if (ags_version) + return get_version_number(ags_version); + *temp_name = 0; if (!(infosize = GetModuleFileNameW(GetModuleHandleW(L"amd_ags_x64.dll"), dllname, ARRAY_SIZE(dllname))) || infosize == ARRAY_SIZE(dllname)) @@ -585,7 +590,7 @@ static void init_device_displays_511(const char *adapter_name, AGSDisplayInfo_51 } -static AGSReturnCode init_ags_context(AGSContext *context) +static AGSReturnCode init_ags_context(AGSContext *context, int ags_version) { AGSReturnCode ret; unsigned int i, j; @@ -593,7 +598,7 @@ static AGSReturnCode init_ags_context(AGSContext *context) memset(context, 0, sizeof(*context)); - context->version = determine_ags_version(); + context->version = determine_ags_version(ags_version); ret = vk_get_physical_device_properties(&context->device_count, &context->properties, &context->memory_properties); if (ret != AGS_SUCCESS || !context->device_count) @@ -694,7 +699,7 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi if (!(object = heap_alloc(sizeof(*object)))) return AGS_OUT_OF_MEMORY; - if ((ret = init_ags_context(object)) != AGS_SUCCESS) + if ((ret = init_ags_context(object, 0)) != AGS_SUCCESS) { heap_free(object); return ret; @@ -732,7 +737,7 @@ AGSReturnCode WINAPI agsInitialize(int ags_version, const AGSConfiguration *conf if (!(object = heap_alloc(sizeof(*object)))) return AGS_OUT_OF_MEMORY; - if ((ret = init_ags_context(object)) != AGS_SUCCESS) + if ((ret = init_ags_context(object, ags_version)) != AGS_SUCCESS) { heap_free(object); return ret; @@ -1055,7 +1060,7 @@ AGSDriverVersionResult WINAPI agsCheckDriverVersion(const char* version_reported int WINAPI agsGetVersionNumber(void) { - enum amd_ags_version version = determine_ags_version(); + enum amd_ags_version version = determine_ags_version(0); TRACE("version %d.\n", version); From 556966f354834e200998f3b70e7c1f2278763d55 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 9 Nov 2023 16:57:24 -0600 Subject: [PATCH 0507/2542] amd_ags_x64: Factor out get_ags_version_from_resource(). CW-Bug-Id: #22976 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 90 ++++++++++++++++------------- 1 file changed, 50 insertions(+), 40 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 3bf3a811f2c2..0f57cb2b4f68 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -269,6 +269,52 @@ static enum amd_ags_version get_version_number(int ags_version) return AMD_AGS_VERSION_5_4_1; } +static BOOL get_ags_version_from_resource(const WCHAR *filename, enum amd_ags_version *ret) +{ + DWORD infosize; + void *infobuf; + void *val; + UINT vallen; + VS_FIXEDFILEINFO *info; + UINT16 major, minor, patch; + + infosize = GetFileVersionInfoSizeW(filename, NULL); + if (!infosize) + { + ERR("File version info not found, err %u.\n", GetLastError()); + return FALSE; + } + + if (!(infobuf = heap_alloc(infosize))) + { + ERR("Failed to allocate memory.\n"); + return FALSE; + } + + if (!GetFileVersionInfoW(filename, 0, infosize, infobuf)) + { + ERR("GetFileVersionInfoW failed, err %u.\n", GetLastError()); + heap_free(infobuf); + return FALSE; + } + + if (!VerQueryValueW(infobuf, L"\\", &val, &vallen) || (vallen != sizeof(VS_FIXEDFILEINFO))) + { + ERR("Version value not found, err %u.\n", GetLastError()); + heap_free(infobuf); + return FALSE; + } + + info = val; + major = info->dwFileVersionMS >> 16; + minor = info->dwFileVersionMS; + patch = info->dwFileVersionLS >> 16; + TRACE("Found amd_ags_x64.dll v%d.%d.%d\n", major, minor, patch); + *ret = get_version_number(AGS_MAKE_VERSION(major, minor, patch)); + heap_free(infobuf); + return TRUE; +} + static enum amd_ags_version determine_ags_version(int ags_version) { /* AMD AGS is not binary compatible between versions (even minor versions), and the game @@ -280,13 +326,8 @@ static enum amd_ags_version determine_ags_version(int ags_version) * In case of an error, assume it's that version. */ enum amd_ags_version ret = AMD_AGS_VERSION_5_4_1; - DWORD infosize; - void *infobuf = NULL; - void *val; - UINT vallen; - VS_FIXEDFILEINFO *info; - UINT16 major, minor, patch; WCHAR dllname[MAX_PATH], temp_path[MAX_PATH], temp_name[MAX_PATH]; + DWORD size; TRACE("ags_version %#x.\n", ags_version); @@ -294,8 +335,8 @@ static enum amd_ags_version determine_ags_version(int ags_version) return get_version_number(ags_version); *temp_name = 0; - if (!(infosize = GetModuleFileNameW(GetModuleHandleW(L"amd_ags_x64.dll"), dllname, ARRAY_SIZE(dllname))) - || infosize == ARRAY_SIZE(dllname)) + if (!(size = GetModuleFileNameW(GetModuleHandleW(L"amd_ags_x64.dll"), dllname, ARRAY_SIZE(dllname))) + || size == ARRAY_SIZE(dllname)) { ERR("GetModuleFileNameW failed.\n"); goto done; @@ -311,43 +352,12 @@ static enum amd_ags_version determine_ags_version(int ags_version) goto done; } - infosize = GetFileVersionInfoSizeW(temp_name, NULL); - if (!infosize) - { - ERR("Unable to determine desired version of amd_ags_x64.dll.\n"); - goto done; - } - - if (!(infobuf = heap_alloc(infosize))) - { - ERR("Failed to allocate memory.\n"); - goto done; - } - - if (!GetFileVersionInfoW(temp_name, 0, infosize, infobuf)) - { - ERR("Unable to determine desired version of amd_ags_x64.dll.\n"); - goto done; - } - - if (!VerQueryValueW(infobuf, L"\\", &val, &vallen) || (vallen != sizeof(VS_FIXEDFILEINFO))) - { - ERR("Unable to determine desired version of amd_ags_x64.dll.\n"); - goto done; - } - - info = val; - major = info->dwFileVersionMS >> 16; - minor = info->dwFileVersionMS; - patch = info->dwFileVersionLS >> 16; - TRACE("Found amd_ags_x64.dll v%d.%d.%d\n", major, minor, patch); - ret = get_version_number(AGS_MAKE_VERSION(major, minor, patch)); + get_ags_version_from_resource(temp_name, &ret); done: if (*temp_name) DeleteFileW(temp_name); - heap_free(infobuf); TRACE("Using AGS v%d.%d.%d interface\n", amd_ags_info[ret].major, amd_ags_info[ret].minor, amd_ags_info[ret].patch); return ret; From 7e7ce043f524b19bff59af9c35a89630d42e311f Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 9 Nov 2023 17:08:32 -0600 Subject: [PATCH 0508/2542] amd_ags_x64: Try to get version from agsGetVersionNumber() if there is no version resource. CW-Bug-Id: #22976 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 0f57cb2b4f68..37ecd10f88af 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -327,6 +327,8 @@ static enum amd_ags_version determine_ags_version(int ags_version) */ enum amd_ags_version ret = AMD_AGS_VERSION_5_4_1; WCHAR dllname[MAX_PATH], temp_path[MAX_PATH], temp_name[MAX_PATH]; + int (WINAPI *pagsGetVersionNumber)(void); + HMODULE hnative = NULL; DWORD size; TRACE("ags_version %#x.\n", ags_version); @@ -352,9 +354,26 @@ static enum amd_ags_version determine_ags_version(int ags_version) goto done; } - get_ags_version_from_resource(temp_name, &ret); + if (get_ags_version_from_resource(temp_name, &ret)) + goto done; + + if (!(hnative = LoadLibraryW(temp_name))) + { + ERR("LoadLibraryW failed for %s.\n", debugstr_w(temp_name)); + goto done; + } + + if ((pagsGetVersionNumber = (void *)GetProcAddress(hnative, "agsGetVersionNumber"))) + { + ags_version = pagsGetVersionNumber(); + ret = get_version_number(ags_version); + TRACE("Got version %#x (%d) from agsGetVersionNumber.\n", ags_version, ret); + } done: + if (hnative) + FreeLibrary(hnative); + if (*temp_name) DeleteFileW(temp_name); From c7b904c0470a956fee84730864ca3e15fb85e3ff Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 9 Nov 2023 17:19:25 -0600 Subject: [PATCH 0509/2542] amd_ags_x64: Distinguish some versions through available exports if other methods failed. CW-Bug-Id: #22976 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 37ecd10f88af..e6db3e5bc5a1 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -315,15 +315,29 @@ static BOOL get_ags_version_from_resource(const WCHAR *filename, enum amd_ags_ve return TRUE; } +static enum amd_ags_version guess_version_from_exports(HMODULE hnative) +{ + /* Known DLL versions without version info: + * - An update to AGS 5.4.1 included an amd_ags_x64.dll with no file version info; + * - CoD: Modern Warfare Remastered (2017) ships dll without version info which is version 5.0.1 + * (not tagged in AGSSDK history), compatible with 5.0.5. + */ + if (GetProcAddress(hnative, "agsDriverExtensionsDX11_Init")) + { + /* agsDriverExtensionsDX11_Init was deprecated in 5.3.0 */ + TRACE("agsDriverExtensionsDX11_Init found.\n"); + return AMD_AGS_VERSION_5_0_5; + } + TRACE("Returning 5.4.1.\n"); + return AMD_AGS_VERSION_5_4_1; +} + static enum amd_ags_version determine_ags_version(int ags_version) { /* AMD AGS is not binary compatible between versions (even minor versions), and the game * does not request a specific version when calling agsInit(). * Checking the version of amd_ags_x64.dll shipped with the game is the only way to * determine what version the game was built against. - * - * An update to AGS 5.4.1 included an amd_ags_x64.dll with no file version info. - * In case of an error, assume it's that version. */ enum amd_ags_version ret = AMD_AGS_VERSION_5_4_1; WCHAR dllname[MAX_PATH], temp_path[MAX_PATH], temp_name[MAX_PATH]; @@ -368,8 +382,11 @@ static enum amd_ags_version determine_ags_version(int ags_version) ags_version = pagsGetVersionNumber(); ret = get_version_number(ags_version); TRACE("Got version %#x (%d) from agsGetVersionNumber.\n", ags_version, ret); + goto done; } + ret = guess_version_from_exports(hnative); + done: if (hnative) FreeLibrary(hnative); From 6fb6e24877c44767c4e349f74004a4b8a3b738b3 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 9 Nov 2023 17:53:47 -0600 Subject: [PATCH 0510/2542] amd_ags_x64: Recognize version 6.2.0. CW-Bug-Id: #22976 --- dlls/amd_ags_x64/amd_ags.h | 14 ++++++++------ dlls/amd_ags_x64/amd_ags_x64_main.c | 12 +++++++----- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index 52276cc1935e..aac9fb1413cf 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -207,7 +207,8 @@ typedef enum AGSReturnCode AGS_NO_AMD_DRIVER_INSTALLED, ///< Returned if the AMD GPU driver does not appear to be installed AGS_EXTENSION_NOT_SUPPORTED, ///< Returned if the driver does not support the requested driver extension AGS_ADL_FAILURE, ///< Failure in ADL (the AMD Display Library) - AGS_DX_FAILURE ///< Failure from DirectX runtime + AGS_DX_FAILURE, ///< Failure from DirectX runtime + AGS_D3DDEVICE_NOT_CREATED, ///< Failure due to not creating the D3D device successfully via AGS. } AGSReturnCode; /// The DirectX11 extension support bits @@ -268,7 +269,7 @@ typedef enum AGSDriverExtensionDX12 } AGSDriverExtensionDX12; /// The space id for DirectX12 intrinsic support -const unsigned int AGS_DX12_SHADER_INSTRINSICS_SPACE_ID = 0x7FFF0ADE; // 2147420894 +const unsigned int AGS_DX12_SHADER_INTRINSICS_SPACE_ID = 0x7FFF0ADE; // 2147420894 /// The display flags describing various properties of the display. typedef enum AGSDisplayFlags @@ -942,7 +943,8 @@ typedef struct AGSDX12ReturnedParams unsigned int floatConversion : 1; ///< Supported in Radeon Software Version 20.5.1 onwards. unsigned int readLaneAt : 1; ///< Supported in Radeon Software Version 20.11.2 onwards. unsigned int rayHitToken : 1; ///< Supported in Radeon Software Version 20.11.2 onwards. - unsigned int padding : 20; ///< Reserved + unsigned int shaderClock : 1; ///< Supported in Radeon Software Version 23.1.1 onwards. + unsigned int padding : 19; ///< Reserved } ExtensionsSupported; ExtensionsSupported extensionsSupported; ///< List of supported extensions */ @@ -960,16 +962,16 @@ typedef struct AGSDX12ReturnedParams /// * The intrinsic instructions require a 5.1 shader model. /// * The Root Signature will need to reserve an extra UAV resource slot. This is not a real resource that requires allocating, it is just used to encode the intrinsic instructions. /// -/// The easiest way to set up the reserved UAV slot is to specify it at u0. The register space id will automatically be assumed to be \ref AGS_DX12_SHADER_INSTRINSICS_SPACE_ID. +/// The easiest way to set up the reserved UAV slot is to specify it at u0. The register space id will automatically be assumed to be \ref AGS_DX12_SHADER_INTRINSICS_SPACE_ID. /// The HLSL expects this as default and the set up code would look similar to this: /// \code{.cpp} /// CD3DX12_DESCRIPTOR_RANGE range[]; /// ... -/// range[ 0 ].Init( D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 1, 0, AGS_DX12_SHADER_INSTRINSICS_SPACE_ID ); // u0 at driver-reserved space id +/// range[ 0 ].Init( D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 1, 0, AGS_DX12_SHADER_INTRINSICS_SPACE_ID ); // u0 at driver-reserved space id /// \endcode /// /// Newer drivers also support a user-specified slot in which case the register space id is assumed to be 0. It is important that the \ref AGSDX12ReturnedParams::ExtensionsSupported::UAVBindSlot bit is set. -/// to ensure the driver can support this. If not, then u0 and \ref AGS_DX12_SHADER_INSTRINSICS_SPACE_ID must be used. +/// to ensure the driver can support this. If not, then u0 and \ref AGS_DX12_SHADER_INTRINSICS_SPACE_ID must be used. /// If the driver does support this feature and a non zero slot is required, then the HLSL must also define AMD_EXT_SHADER_INTRINSIC_UAV_OVERRIDE as the matching slot value. /// /// \param [in] context Pointer to a context. This is generated by \ref agsInitialize diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index e6db3e5bc5a1..2c00b3773932 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -43,6 +43,7 @@ enum amd_ags_version AMD_AGS_VERSION_6_0_0, AMD_AGS_VERSION_6_0_1, AMD_AGS_VERSION_6_1_0, + AMD_AGS_VERSION_6_2_0, AMD_AGS_VERSION_COUNT }; @@ -68,27 +69,28 @@ amd_ags_info[AMD_AGS_VERSION_COUNT] = {6, 0, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)}, {6, 0, 1, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)}, {6, 1, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)}, + {6, 2, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)}, }; #define DEF_FIELD(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name), \ - offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} + offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} #define DEF_FIELD_520_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), -1, \ - -1, -1, -1, -1, -1}} + -1, -1, -1, -1, -1, -1}} #define DEF_FIELD_540_UP(name) {DEVICE_FIELD_##name, {-1, -1, -1, \ -1, -1, offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name), \ - offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} + offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} #define DEF_FIELD_540_600(name) {DEVICE_FIELD_##name, {-1, -1, -1, \ -1, -1, offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \ - -1, -1, -1}} + -1, -1, -1, -1}} #define DEF_FIELD_600_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), -1, \ - -1, -1}} + -1, -1, -1}} #define DEVICE_FIELD_adapterString 0 #define DEVICE_FIELD_architectureVersion 1 From 3689c05b8795e9b082a7179be79e0f6023b86e7e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 23 Nov 2023 14:30:36 -0600 Subject: [PATCH 0511/2542] amd_ags_x64: Add Unix library. CW-Bug-Id: #22976 --- configure.ac | 9 +++++ dlls/amd_ags_x64/Makefile.in | 4 +++ dlls/amd_ags_x64/amd_ags_x64_main.c | 24 +++++++++++++ dlls/amd_ags_x64/unixlib.c | 54 +++++++++++++++++++++++++++++ dlls/amd_ags_x64/unixlib.h | 26 ++++++++++++++ 5 files changed, 117 insertions(+) create mode 100644 dlls/amd_ags_x64/unixlib.c create mode 100644 dlls/amd_ags_x64/unixlib.h diff --git a/configure.ac b/configure.ac index 161d616727d6..c06d90df065d 100644 --- a/configure.ac +++ b/configure.ac @@ -1482,6 +1482,15 @@ fi WINE_WARNING_WITH(gnutls,[test "x$ac_cv_lib_soname_gnutls" = "x"], [libgnutls ${notice_platform}development files not found, no schannel support.]) +dnl **** Check for libdrm **** +WINE_PACKAGE_FLAGS(DRM,[libdrm],,,, + [AC_CHECK_HEADERS([xf86drm.h], + [WINE_CHECK_SONAME(drm,drmOpen,,,[$DRM_LIBS])])]) + +WINE_PACKAGE_FLAGS(DRMAMDGPU,[libdrm_amdgpu],,,, + [AC_CHECK_HEADERS([amdgpu_drm.h], + [WINE_CHECK_SONAME(drm_amdgpu,amdgpu_query_info,,,[$DRMAMDGPU_LIBS])])]) + dnl **** Check for SANE **** if test "x$with_sane" != "xno" then diff --git a/dlls/amd_ags_x64/Makefile.in b/dlls/amd_ags_x64/Makefile.in index 123d06038699..b8463820d76c 100644 --- a/dlls/amd_ags_x64/Makefile.in +++ b/dlls/amd_ags_x64/Makefile.in @@ -1,5 +1,8 @@ EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = amd_ags_x64.dll +UNIXLIB = amd_ags_x64.so +UNIX_CFLAGS = $(DRM_CFLAGS) +UNIX_LIBS = $(DRM_LIBS) $(DRMAMDGPU_LIBS) IMPORTS = version vulkan-1 user32 IMPORTLIB = amd_ags_x64 @@ -7,4 +10,5 @@ EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native SOURCES = \ amd_ags_x64_main.c \ + unixlib.c \ dxvk_interfaces.idl diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 2c00b3773932..816205955971 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -6,8 +6,11 @@ #include #include +#include "ntstatus.h" +#define WIN32_NO_STATUS #include "windef.h" #include "winbase.h" +#include "winternl.h" #include "wine/debug.h" #include "wine/heap.h" @@ -25,8 +28,27 @@ #include "amd_ags.h" +#include "unixlib.h" + WINE_DEFAULT_DEBUG_CHANNEL(amd_ags); +#define AMD_AGS_CALL(func, args) WINE_UNIX_CALL( unix_ ## func, args ) + +static INIT_ONCE unix_init_once = INIT_ONCE_STATIC_INIT; +static BOOL unix_lib_initialized; + +static BOOL WINAPI init_unix_lib_once( INIT_ONCE *once, void *param, void **context ) +{ + unix_lib_initialized = !__wine_init_unix_call() && !AMD_AGS_CALL( init, NULL ); + return TRUE; +} + +static BOOL init_unix_lib(void) +{ + InitOnceExecuteOnce( &unix_init_once, init_unix_lib_once, NULL, NULL ); + return unix_lib_initialized; +} + static const char driver_version[] = "23.19.02-230831a-396538C-AMD-Software-Adrenalin-Edition"; static const char radeon_version[] = "23.10.2"; @@ -688,6 +710,8 @@ static AGSReturnCode init_ags_context(AGSContext *context, int ags_version) SET_DEVICE_FIELD(device, deviceId, int, context->version, vk_properties->deviceID); if (vk_properties->vendorID == 0x1002) { + if (!init_unix_lib()) + ERR("Failed to load unix lib.\n"); SET_DEVICE_FIELD(device, architectureVersion, ArchitectureVersion, context->version, ArchitectureVersion_GCN); SET_DEVICE_FIELD(device, asicFamily, AsicFamily, context->version, AsicFamily_GCN4); if (vk_properties->deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU) diff --git a/dlls/amd_ags_x64/unixlib.c b/dlls/amd_ags_x64/unixlib.c new file mode 100644 index 000000000000..513c1903e4fc --- /dev/null +++ b/dlls/amd_ags_x64/unixlib.c @@ -0,0 +1,54 @@ +/* + * Unix library for amd_ags_x64 functions + * + * Copyright 2023 Paul Gofman for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "config.h" + +#include +#include +#include + +#include +#include + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winternl.h" + +#include "wine/debug.h" + +#include "unixlib.h" + +WINE_DEFAULT_DEBUG_CHANNEL(amd_ags); + +static NTSTATUS init( void *args ) +{ + TRACE(".\n"); + return STATUS_SUCCESS; +} + +const unixlib_entry_t __wine_unix_call_funcs[] = +{ + init, +}; diff --git a/dlls/amd_ags_x64/unixlib.h b/dlls/amd_ags_x64/unixlib.h new file mode 100644 index 000000000000..d34275198671 --- /dev/null +++ b/dlls/amd_ags_x64/unixlib.h @@ -0,0 +1,26 @@ +/* + * Unix library interface + * + * Copyright 2023 Paul Gofman for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "wine/unixlib.h" + +enum amd_ags_funcs +{ + unix_init, +}; From d69fa07bc033c55d99249849f2239852ba8d227c Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 23 Nov 2023 15:27:38 -0600 Subject: [PATCH 0512/2542] amd_ags_x64: Load libdrm amdgpu info. CW-Bug-Id: #22976 --- dlls/amd_ags_x64/unixlib.c | 61 +++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/dlls/amd_ags_x64/unixlib.c b/dlls/amd_ags_x64/unixlib.c index 513c1903e4fc..d054b17e84ce 100644 --- a/dlls/amd_ags_x64/unixlib.c +++ b/dlls/amd_ags_x64/unixlib.c @@ -27,9 +27,13 @@ #include #include #include +#include +#include +#include #include #include +#include #include "ntstatus.h" #define WIN32_NO_STATUS @@ -42,9 +46,64 @@ WINE_DEFAULT_DEBUG_CHANNEL(amd_ags); +#define MAX_DEVICE_COUNT 64 + +static unsigned int device_count; +static struct drm_amdgpu_info_device *amd_info; + static NTSTATUS init( void *args ) { - TRACE(".\n"); + drmDevicePtr devices[MAX_DEVICE_COUNT]; + amdgpu_device_handle h; + uint32_t major, minor; + int i, count, fd, ret; + + device_count = 0; + + if ((count = drmGetDevices(devices, MAX_DEVICE_COUNT)) <= 0) + { + ERR("drmGetDevices failed, err %d.\n", count); + return STATUS_UNSUCCESSFUL; + } + TRACE("Got %d devices.\n", count); + for (i = 0; i < count; ++i) + { + if (!devices[i] || !devices[i]->nodes[DRM_NODE_RENDER]) + { + TRACE("No render node, skipping.\n"); + continue; + } + if ((fd = open(devices[i]->nodes[DRM_NODE_RENDER], O_RDONLY | O_CLOEXEC)) < 0) + { + ERR("Failed to open device %s, errno %d.\n", devices[i]->nodes[DRM_NODE_RENDER], errno); + continue; + } + if ((ret = amdgpu_device_initialize(fd, &major, &minor, &h))) + { + WARN("Failed to initialize amdgpu device bustype %d, %04x:%04x, err %d.\n", devices[i]->bustype, + devices[i]->deviceinfo.pci->vendor_id, devices[i]->deviceinfo.pci->device_id, ret); + close(fd); + continue; + } + amd_info = realloc(amd_info, (device_count + 1) * sizeof(*amd_info)); + /* amdgpu_query_info() doesn't fail on short buffer (filling in the available buffer size). So older or + * newer DRM version should be fine but zero init the structure to avoid random values. */ + memset(&amd_info[device_count], 0, sizeof(*amd_info)); + if (!(ret = amdgpu_query_info(h, AMDGPU_INFO_DEV_INFO, sizeof(*amd_info), &amd_info[device_count]))) + { + TRACE("Got amdgpu info for device id %04x, family %#x, external_rev %#x, chip_rev %#x.\n", + amd_info[device_count].device_id, amd_info[device_count].family, amd_info[device_count].external_rev, + amd_info[device_count].chip_rev); + ++device_count; + } + else + { + ERR("amdgpu_query_info failed, ret %d.\n", ret); + } + amdgpu_device_deinitialize(h); + close(fd); + } + drmFreeDevices(devices, count); return STATUS_SUCCESS; } From 32406bb0329ec7ba36c49865e83b69f29d3b452f Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 23 Nov 2023 15:41:50 -0600 Subject: [PATCH 0513/2542] amd_ags_x64: Try to guess asicFamily from amdgpu info. CW-Bug-Id: #22976 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 42 +++++++---- dlls/amd_ags_x64/unixlib.c | 106 ++++++++++++++++++++++++++++ dlls/amd_ags_x64/unixlib.h | 9 +++ 3 files changed, 142 insertions(+), 15 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 816205955971..00afe4377eee 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -77,21 +77,22 @@ static const struct int patch; unsigned int device_size; unsigned int dx11_returned_params_size; + int max_asicFamily; } amd_ags_info[AMD_AGS_VERSION_COUNT] = { - {5, 0, 5, sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511)}, - {5, 1, 1, sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511)}, - {5, 2, 0, sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520)}, - {5, 2, 1, sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520)}, - {5, 3, 0, sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520)}, - {5, 4, 0, sizeof(AGSDeviceInfo_540), sizeof(AGSDX11ReturnedParams_520)}, - {5, 4, 1, sizeof(AGSDeviceInfo_541), sizeof(AGSDX11ReturnedParams_520)}, - {5, 4, 2, sizeof(AGSDeviceInfo_542), sizeof(AGSDX11ReturnedParams_520)}, - {6, 0, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)}, - {6, 0, 1, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)}, - {6, 1, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)}, - {6, 2, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)}, + {5, 0, 5, sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, + {5, 1, 1, sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, + {5, 2, 0, sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, + {5, 2, 1, sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, + {5, 3, 0, sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, + {5, 4, 0, sizeof(AGSDeviceInfo_540), sizeof(AGSDX11ReturnedParams_520), AsicFamily_RDNA}, + {5, 4, 1, sizeof(AGSDeviceInfo_541), sizeof(AGSDX11ReturnedParams_520), AsicFamily_RDNA}, + {5, 4, 2, sizeof(AGSDeviceInfo_542), sizeof(AGSDX11ReturnedParams_520), AsicFamily_RDNA}, + {6, 0, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA2}, + {6, 0, 1, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA2}, + {6, 1, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA3}, + {6, 2, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA3}, }; #define DEF_FIELD(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ @@ -710,10 +711,21 @@ static AGSReturnCode init_ags_context(AGSContext *context, int ags_version) SET_DEVICE_FIELD(device, deviceId, int, context->version, vk_properties->deviceID); if (vk_properties->vendorID == 0x1002) { - if (!init_unix_lib()) - ERR("Failed to load unix lib.\n"); + struct get_device_info_params params = + { + .device_id = vk_properties->deviceID, + }; + SET_DEVICE_FIELD(device, architectureVersion, ArchitectureVersion, context->version, ArchitectureVersion_GCN); - SET_DEVICE_FIELD(device, asicFamily, AsicFamily, context->version, AsicFamily_GCN4); + if (init_unix_lib() && !AMD_AGS_CALL(get_device_info, ¶ms)) + { + SET_DEVICE_FIELD(device, asicFamily, AsicFamily, context->version, + min(params.asic_family, amd_ags_info[context->version].max_asicFamily)); + } + else + { + SET_DEVICE_FIELD(device, asicFamily, AsicFamily, context->version, AsicFamily_GCN4); + } if (vk_properties->deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU) { if (context->version >= AMD_AGS_VERSION_6_0_0) diff --git a/dlls/amd_ags_x64/unixlib.c b/dlls/amd_ags_x64/unixlib.c index d054b17e84ce..704c219c757a 100644 --- a/dlls/amd_ags_x64/unixlib.c +++ b/dlls/amd_ags_x64/unixlib.c @@ -107,7 +107,113 @@ static NTSTATUS init( void *args ) return STATUS_SUCCESS; } +typedef enum AsicFamily +{ + AsicFamily_Unknown, ///< Unknown architecture, potentially from another IHV. Check \ref AGSDeviceInfo::vendorId + AsicFamily_PreGCN, ///< Pre GCN architecture. + AsicFamily_GCN1, ///< AMD GCN 1 architecture: Oland, Cape Verde, Pitcairn & Tahiti. + AsicFamily_GCN2, ///< AMD GCN 2 architecture: Hawaii & Bonaire. This also includes APUs Kaveri and Carrizo. + AsicFamily_GCN3, ///< AMD GCN 3 architecture: Tonga & Fiji. + AsicFamily_GCN4, ///< AMD GCN 4 architecture: Polaris. + AsicFamily_Vega, ///< AMD Vega architecture, including Raven Ridge (ie AMD Ryzen CPU + AMD Vega GPU). + AsicFamily_RDNA, ///< AMD RDNA architecture + AsicFamily_RDNA2, ///< AMD RDNA2 architecture + AsicFamily_RDNA3, ///< AMD RDNA3 architecture +} AsicFamily; + +/* Constants from Mesa source. */ +#define FAMILY_UNKNOWN 0x00 +#define FAMILY_TN 0x69 /* # 105 / Trinity APUs */ +#define FAMILY_SI 0x6E /* # 110 / Southern Islands: Tahiti, Pitcairn, CapeVerde, Oland, Hainan */ +#define FAMILY_CI 0x78 /* # 120 / Sea Islands: Bonaire, Hawaii */ +#define FAMILY_KV 0x7D /* # 125 / Kaveri APUs: Spectre, Spooky, Kalindi, Godavari */ +#define FAMILY_VI 0x82 /* # 130 / Volcanic Islands: Iceland, Tonga, Fiji */ +#define FAMILY_POLARIS 0x82 /* # 130 / Polaris: 10, 11, 12 */ +#define FAMILY_CZ 0x87 /* # 135 / Carrizo APUs: Carrizo, Stoney */ +#define FAMILY_AI 0x8D /* # 141 / Vega: 10, 20 */ +#define FAMILY_RV 0x8E /* # 142 / Raven */ +#define FAMILY_NV 0x8F /* # 143 / Navi: 10 */ +#define FAMILY_VGH 0x90 /* # 144 / Van Gogh */ +#define FAMILY_NV3 0x91 /* # 145 / Navi: 3x */ +#define FAMILY_RMB 0x92 /* # 146 / Rembrandt */ +#define FAMILY_RPL 0x95 /* # 149 / Raphael */ +#define FAMILY_GFX1103 0x94 +#define FAMILY_GFX1150 0x96 +#define FAMILY_MDN 0x97 /* # 151 / Mendocino */ + +static void fill_device_info(struct drm_amdgpu_info_device *info, struct get_device_info_params *out) +{ + uint32_t erev = info->external_rev; + + out->asic_family = AsicFamily_Unknown; + switch (info->family) + { + case FAMILY_AI: + case FAMILY_RV: + out->asic_family = AsicFamily_Vega; + break; + + /* Treat pre-Polaris cards as Polaris. */ + case FAMILY_CZ: + case FAMILY_SI: + case FAMILY_CI: + case FAMILY_KV: + case FAMILY_POLARIS: + out->asic_family = AsicFamily_GCN4; + break; + + case FAMILY_NV: + if (erev >= 0x01 && erev < 0x28) + out->asic_family = AsicFamily_RDNA; + else if (erev >= 0x28 && erev < 0x50) + out->asic_family = AsicFamily_RDNA2; + break; + + case FAMILY_RMB: + case FAMILY_RPL: + case FAMILY_MDN: + case FAMILY_VGH: + out->asic_family = AsicFamily_RDNA2; + break; + + case FAMILY_NV3: + case FAMILY_GFX1103: + case FAMILY_GFX1150: + out->asic_family = AsicFamily_RDNA3; + break; + } + TRACE("family %u, erev %#x -> asicFamily %d.\n", info->family, erev, out->asic_family); + if (out->asic_family == AsicFamily_Unknown && info->family != FAMILY_UNKNOWN) + { + if (info->family > FAMILY_GFX1150) + out->asic_family = AsicFamily_RDNA3; + else + out->asic_family = AsicFamily_GCN4; + + FIXME("Unrecognized family %u, erev %#x -> defaulting to %d.\n", info->family, erev, + out->asic_family); + } +} + +static NTSTATUS get_device_info( void *args ) +{ + struct get_device_info_params *params = args; + unsigned int i; + + for (i = 0; i < device_count; ++i) + { + if (amd_info[i].device_id != params->device_id) + continue; + TRACE("device %04x found.\n", params->device_id); + fill_device_info(&amd_info[i], params); + return STATUS_SUCCESS; + } + TRACE("Device %04x not found.\n", params->device_id); + return STATUS_NOT_FOUND; +} + const unixlib_entry_t __wine_unix_call_funcs[] = { init, + get_device_info, }; diff --git a/dlls/amd_ags_x64/unixlib.h b/dlls/amd_ags_x64/unixlib.h index d34275198671..c895a0499fce 100644 --- a/dlls/amd_ags_x64/unixlib.h +++ b/dlls/amd_ags_x64/unixlib.h @@ -23,4 +23,13 @@ enum amd_ags_funcs { unix_init, + unix_get_device_info, +}; + +struct get_device_info_params +{ + uint32_t device_id; + uint32_t _pad; + /* Output parameters. */ + uint32_t asic_family; }; From 4045a7cb1bac3867ec0293b502e6f5ce366d8a42 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 23 Nov 2023 18:11:41 -0600 Subject: [PATCH 0514/2542] amd_ags_x64: Fill more device info fields. CW-Bug-Id: #22976 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 26 +++++++++++++++ dlls/amd_ags_x64/unixlib.c | 51 +++++++++++++++++++++++++++++ dlls/amd_ags_x64/unixlib.h | 7 ++++ 3 files changed, 84 insertions(+) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 00afe4377eee..2bf61ce80934 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -102,6 +102,10 @@ amd_ags_info[AMD_AGS_VERSION_COUNT] = #define DEF_FIELD_520_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), -1, \ -1, -1, -1, -1, -1, -1}} +#define DEF_FIELD_520_UP(name) {DEVICE_FIELD_##name, {-1, -1, offsetof(AGSDeviceInfo_520, name), \ + offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name), \ + offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} #define DEF_FIELD_540_UP(name) {DEVICE_FIELD_##name, {-1, -1, -1, \ -1, -1, offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name), \ @@ -126,6 +130,14 @@ amd_ags_info[AMD_AGS_VERSION_COUNT] = #define DEVICE_FIELD_displays 8 #define DEVICE_FIELD_isAPU 9 +#define DEVICE_FIELD_numCUs 10 +#define DEVICE_FIELD_coreClock 11 +#define DEVICE_FIELD_memoryClock 12 +#define DEVICE_FIELD_teraFlops 13 +#define DEVICE_FIELD_numWGPs 14 +#define DEVICE_FIELD_numROPs 15 +#define DEVICE_FIELD_memoryBandwidth 16 + static const struct { unsigned int field_index; @@ -143,6 +155,13 @@ device_struct_fields[] = DEF_FIELD(numDisplays), DEF_FIELD(displays), DEF_FIELD_540_600(isAPU), + DEF_FIELD(numCUs), + DEF_FIELD(coreClock), + DEF_FIELD(memoryClock), + DEF_FIELD(teraFlops), + DEF_FIELD_540_UP(numWGPs), + DEF_FIELD_520_UP(numROPs), + DEF_FIELD_520_UP(memoryBandwidth), }; #undef DEF_FIELD @@ -721,6 +740,13 @@ static AGSReturnCode init_ags_context(AGSContext *context, int ags_version) { SET_DEVICE_FIELD(device, asicFamily, AsicFamily, context->version, min(params.asic_family, amd_ags_info[context->version].max_asicFamily)); + SET_DEVICE_FIELD(device, numCUs, int, context->version, params.num_cu); + SET_DEVICE_FIELD(device, numWGPs, int, context->version, params.num_wgp); + SET_DEVICE_FIELD(device, numROPs, int, context->version, params.num_rops); + SET_DEVICE_FIELD(device, coreClock, int, context->version, params.core_clock); + SET_DEVICE_FIELD(device, memoryClock, int, context->version, params.memory_clock); + SET_DEVICE_FIELD(device, memoryBandwidth, int, context->version, params.memory_bandwidth); + SET_DEVICE_FIELD(device, teraFlops, float, context->version, params.teraflops); } else { diff --git a/dlls/amd_ags_x64/unixlib.c b/dlls/amd_ags_x64/unixlib.c index 704c219c757a..be94b75eab90 100644 --- a/dlls/amd_ags_x64/unixlib.c +++ b/dlls/amd_ags_x64/unixlib.c @@ -107,6 +107,42 @@ static NTSTATUS init( void *args ) return STATUS_SUCCESS; } +#ifndef AMDGPU_VRAM_TYPE_DDR5 +# define AMDGPU_VRAM_TYPE_DDR5 10 +#endif +#ifndef AMDGPU_VRAM_TYPE_LPDDR4 +# define AMDGPU_VRAM_TYPE_LPDDR4 11 +#endif +#ifndef AMDGPU_VRAM_TYPE_LPDDR5 +# define AMDGPU_VRAM_TYPE_LPDDR5 12 +#endif + +/* From Mesa source. */ +static uint32_t memory_ops_per_clock(uint32_t vram_type) +{ + /* Based on MemoryOpsPerClockTable from PAL. */ + switch (vram_type) { + case AMDGPU_VRAM_TYPE_GDDR1: + case AMDGPU_VRAM_TYPE_GDDR3: /* last in low-end Evergreen */ + case AMDGPU_VRAM_TYPE_GDDR4: /* last in R7xx, not used much */ + case AMDGPU_VRAM_TYPE_UNKNOWN: + default: + return 0; + case AMDGPU_VRAM_TYPE_DDR2: + case AMDGPU_VRAM_TYPE_DDR3: + case AMDGPU_VRAM_TYPE_DDR4: + case AMDGPU_VRAM_TYPE_LPDDR4: + case AMDGPU_VRAM_TYPE_HBM: /* same for HBM2 and HBM3 */ + return 2; + case AMDGPU_VRAM_TYPE_DDR5: + case AMDGPU_VRAM_TYPE_LPDDR5: + case AMDGPU_VRAM_TYPE_GDDR5: /* last in Polaris and low-end Navi14 */ + return 4; + case AMDGPU_VRAM_TYPE_GDDR6: + return 16; + } +} + typedef enum AsicFamily { AsicFamily_Unknown, ///< Unknown architecture, potentially from another IHV. Check \ref AGSDeviceInfo::vendorId @@ -141,6 +177,8 @@ typedef enum AsicFamily #define FAMILY_GFX1150 0x96 #define FAMILY_MDN 0x97 /* # 151 / Mendocino */ +#define ROUND_DIV(value, div) (((value) + (div) / 2) / (div)) + static void fill_device_info(struct drm_amdgpu_info_device *info, struct get_device_info_params *out) { uint32_t erev = info->external_rev; @@ -193,6 +231,19 @@ static void fill_device_info(struct drm_amdgpu_info_device *info, struct get_dev FIXME("Unrecognized family %u, erev %#x -> defaulting to %d.\n", info->family, erev, out->asic_family); } + + out->num_cu = info->cu_active_number; + out->num_wgp = out->asic_family >= AsicFamily_RDNA ? out->num_cu / 2 : 0; + out->num_rops = info->num_rb_pipes * 4; + TRACE("num_cu %d, num_wgp %d, num_rops %d.\n", out->num_cu, out->num_wgp, out->num_rops); + out->core_clock = ROUND_DIV(info->max_engine_clock, 1000); + out->memory_clock = ROUND_DIV(info->max_memory_clock, 1000); + out->memory_bandwidth = ROUND_DIV(info->max_memory_clock * memory_ops_per_clock(info->vram_type) + * info->vram_bit_width / 8, 1000); + TRACE("core_clock %uMHz, memory_clock %uMHz, memory_bandwidth %u.\n", + out->core_clock, out->memory_clock, out->memory_bandwidth); + out->teraflops = 1e-9f * info->max_engine_clock * info->cu_active_number * 64 * 2; + TRACE("teraflops %.2f.\n", out->teraflops); } static NTSTATUS get_device_info( void *args ) diff --git a/dlls/amd_ags_x64/unixlib.h b/dlls/amd_ags_x64/unixlib.h index c895a0499fce..72422e1535ca 100644 --- a/dlls/amd_ags_x64/unixlib.h +++ b/dlls/amd_ags_x64/unixlib.h @@ -32,4 +32,11 @@ struct get_device_info_params uint32_t _pad; /* Output parameters. */ uint32_t asic_family; + uint32_t num_cu; + uint32_t num_wgp; + uint32_t num_rops; + uint32_t core_clock; + uint32_t memory_clock; + uint32_t memory_bandwidth; + float teraflops; }; From df836dc3e77b2f3986bdf1b672e81b09d6817a2f Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 23 Nov 2023 18:53:03 -0600 Subject: [PATCH 0515/2542] amd_ags_x64: Downgrade agsCheckDriverVersion() message to WARN. CW-Bug-Id: #22976 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 2bf61ce80934..4b750d31fdba 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -1163,7 +1163,7 @@ AGSReturnCode WINAPI agsDriverExtensionsDX12_DestroyDevice(AGSContext* context, AGSDriverVersionResult WINAPI agsCheckDriverVersion(const char* version_reported, unsigned int version_required) { - FIXME("version_reported %s, version_required %d semi-stub.\n", debugstr_a(version_reported), version_required); + WARN("version_reported %s, version_required %d semi-stub.\n", debugstr_a(version_reported), version_required); return AGS_SOFTWAREVERSIONCHECK_OK; } From 7542b6cdaca7871f0b946e705e81d7088cb062fb Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 24 Nov 2023 11:24:03 -0600 Subject: [PATCH 0516/2542] amd_ags_x64: Workaround zero clock reporting on Vangogh GPU. CW-Bug-Id: #22976 --- dlls/amd_ags_x64/unixlib.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dlls/amd_ags_x64/unixlib.c b/dlls/amd_ags_x64/unixlib.c index be94b75eab90..7e5bc5bf4d6c 100644 --- a/dlls/amd_ags_x64/unixlib.c +++ b/dlls/amd_ags_x64/unixlib.c @@ -182,6 +182,7 @@ typedef enum AsicFamily static void fill_device_info(struct drm_amdgpu_info_device *info, struct get_device_info_params *out) { uint32_t erev = info->external_rev; + uint64_t max_engine_clock_khz, max_memory_clock_khz; out->asic_family = AsicFamily_Unknown; switch (info->family) @@ -236,13 +237,19 @@ static void fill_device_info(struct drm_amdgpu_info_device *info, struct get_dev out->num_wgp = out->asic_family >= AsicFamily_RDNA ? out->num_cu / 2 : 0; out->num_rops = info->num_rb_pipes * 4; TRACE("num_cu %d, num_wgp %d, num_rops %d.\n", out->num_cu, out->num_wgp, out->num_rops); - out->core_clock = ROUND_DIV(info->max_engine_clock, 1000); - out->memory_clock = ROUND_DIV(info->max_memory_clock, 1000); - out->memory_bandwidth = ROUND_DIV(info->max_memory_clock * memory_ops_per_clock(info->vram_type) + /* These numbers are zero on Vangogh, workaround that (similar to how it is currently done + * in Mesa src/amd/common/ac_rgp.c. */ + if (!(max_engine_clock_khz = info->max_engine_clock)) + max_engine_clock_khz = 1300000; + if (!(max_memory_clock_khz = info->max_memory_clock)) + max_memory_clock_khz = 687000; + out->core_clock = ROUND_DIV(max_engine_clock_khz, 1000); + out->memory_clock = ROUND_DIV(max_memory_clock_khz, 1000); + out->memory_bandwidth = ROUND_DIV(max_memory_clock_khz * memory_ops_per_clock(info->vram_type) * info->vram_bit_width / 8, 1000); TRACE("core_clock %uMHz, memory_clock %uMHz, memory_bandwidth %u.\n", out->core_clock, out->memory_clock, out->memory_bandwidth); - out->teraflops = 1e-9f * info->max_engine_clock * info->cu_active_number * 64 * 2; + out->teraflops = 1e-9f * max_engine_clock_khz * info->cu_active_number * 64 * 2; TRACE("teraflops %.2f.\n", out->teraflops); } From dfcd0d95efe24b47ef11bad40074f3a49cc6e907 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 1 Dec 2023 11:19:56 -0600 Subject: [PATCH 0517/2542] amd_ags_x64: Store AGS version as a single value in ags_info. CW-Bug-Id: #22976 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 56 ++++++++++++++++------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 4b750d31fdba..9aa0400bc408 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -72,27 +72,25 @@ enum amd_ags_version static const struct { - int major; - int minor; - int patch; + unsigned int ags_public_version; unsigned int device_size; unsigned int dx11_returned_params_size; int max_asicFamily; } amd_ags_info[AMD_AGS_VERSION_COUNT] = { - {5, 0, 5, sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, - {5, 1, 1, sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, - {5, 2, 0, sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, - {5, 2, 1, sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, - {5, 3, 0, sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, - {5, 4, 0, sizeof(AGSDeviceInfo_540), sizeof(AGSDX11ReturnedParams_520), AsicFamily_RDNA}, - {5, 4, 1, sizeof(AGSDeviceInfo_541), sizeof(AGSDX11ReturnedParams_520), AsicFamily_RDNA}, - {5, 4, 2, sizeof(AGSDeviceInfo_542), sizeof(AGSDX11ReturnedParams_520), AsicFamily_RDNA}, - {6, 0, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA2}, - {6, 0, 1, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA2}, - {6, 1, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA3}, - {6, 2, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA3}, + {AGS_MAKE_VERSION(5, 0, 5), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, + {AGS_MAKE_VERSION(5, 1, 1), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, + {AGS_MAKE_VERSION(5, 2, 0), sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, + {AGS_MAKE_VERSION(5, 2, 1), sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, + {AGS_MAKE_VERSION(5, 3, 0), sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, + {AGS_MAKE_VERSION(5, 4, 0), sizeof(AGSDeviceInfo_540), sizeof(AGSDX11ReturnedParams_520), AsicFamily_RDNA}, + {AGS_MAKE_VERSION(5, 4, 1), sizeof(AGSDeviceInfo_541), sizeof(AGSDX11ReturnedParams_520), AsicFamily_RDNA}, + {AGS_MAKE_VERSION(5, 4, 2), sizeof(AGSDeviceInfo_542), sizeof(AGSDX11ReturnedParams_520), AsicFamily_RDNA}, + {AGS_MAKE_VERSION(6, 0, 0), sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA2}, + {AGS_MAKE_VERSION(6, 0, 1), sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA2}, + {AGS_MAKE_VERSION(6, 1, 0), sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA3}, + {AGS_MAKE_VERSION(6, 2, 0), sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA3}, }; #define DEF_FIELD(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ @@ -192,6 +190,15 @@ static typeof(D3D12CreateDevice) *pD3D12CreateDevice; static typeof(D3D11CreateDevice) *pD3D11CreateDevice; static typeof(D3D11CreateDeviceAndSwapChain) *pD3D11CreateDeviceAndSwapChain; +#define AGS_VER_MAJOR(ver) ((ver) >> 22) +#define AGS_VER_MINOR(ver) (((ver) >> 12) & ((1 << 10) - 1)) +#define AGS_VER_PATCH(ver) ((ver) & ((1 << 12) - 1)) + +static const char *debugstr_agsversion(unsigned int ags_version) +{ + return wine_dbg_sprintf("%d.%d.%d", AGS_VER_MAJOR(ags_version), AGS_VER_MINOR(ags_version), AGS_VER_PATCH(ags_version)); +} + static BOOL load_d3d12_functions(void) { if (hd3d12) @@ -304,12 +311,12 @@ static enum amd_ags_version get_version_number(int ags_version) unsigned int i; for (i = 0; i < ARRAY_SIZE(amd_ags_info); i++) - if (AGS_MAKE_VERSION(amd_ags_info[i].major, amd_ags_info[i].minor, amd_ags_info[i].patch) == ags_version) + if (amd_ags_info[i].ags_public_version == ags_version) { - TRACE("Found AGS v%d.%d.%d.\n", amd_ags_info[i].major, amd_ags_info[i].minor, amd_ags_info[i].patch); + TRACE("Found AGS v%s.\n", debugstr_agsversion(ags_version)); return i; } - ERR("Unknown ags_version %#x, using 5.4.1.\n", ags_version); + ERR("Unknown ags_version %s, using 5.4.1.\n", debugstr_agsversion(ags_version)); return AMD_AGS_VERSION_5_4_1; } @@ -425,7 +432,7 @@ static enum amd_ags_version determine_ags_version(int ags_version) { ags_version = pagsGetVersionNumber(); ret = get_version_number(ags_version); - TRACE("Got version %#x (%d) from agsGetVersionNumber.\n", ags_version, ret); + TRACE("Got version %s (%d) from agsGetVersionNumber.\n", debugstr_agsversion(ags_version), ret); goto done; } @@ -438,8 +445,7 @@ static enum amd_ags_version determine_ags_version(int ags_version) if (*temp_name) DeleteFileW(temp_name); - TRACE("Using AGS v%d.%d.%d interface\n", - amd_ags_info[ret].major, amd_ags_info[ret].minor, amd_ags_info[ret].patch); + TRACE("Using AGS v%s interface\n", debugstr_agsversion(amd_ags_info[ret].ags_public_version)); return ret; } @@ -816,9 +822,9 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi } memset(gpu_info, 0, sizeof(*gpu_info)); - gpu_info->agsVersionMajor = amd_ags_info[object->version].major; - gpu_info->agsVersionMinor = amd_ags_info[object->version].minor; - gpu_info->agsVersionPatch = amd_ags_info[object->version].patch; + gpu_info->agsVersionMajor = AGS_VER_MAJOR(amd_ags_info[object->version].ags_public_version); + gpu_info->agsVersionMinor = AGS_VER_MINOR(amd_ags_info[object->version].ags_public_version);; + gpu_info->agsVersionPatch = AGS_VER_PATCH(amd_ags_info[object->version].ags_public_version);; gpu_info->driverVersion = driver_version; gpu_info->radeonSoftwareVersion = radeon_version; gpu_info->numDevices = object->device_count; @@ -1174,7 +1180,7 @@ int WINAPI agsGetVersionNumber(void) TRACE("version %d.\n", version); - return AGS_MAKE_VERSION(amd_ags_info[version].major, amd_ags_info[version].minor, amd_ags_info[version].patch); + return amd_ags_info[version].ags_public_version; } AGSReturnCode WINAPI agsDriverExtensionsDX11_Init( AGSContext *context, ID3D11Device *device, unsigned int uavSlot, unsigned int *extensionsSupported ) From 4c02cdc0c992a3cb45f374112f19f707f07f523a Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 1 Dec 2023 12:38:30 -0600 Subject: [PATCH 0518/2542] amd_ags_x64: Coalesce some identical version definitions. CW-Bug-Id: #22976 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 118 ++++++++++++++-------------- 1 file changed, 60 insertions(+), 58 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 9aa0400bc408..e2ee97fb9f84 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -57,65 +57,60 @@ enum amd_ags_version AMD_AGS_VERSION_5_0_5, AMD_AGS_VERSION_5_1_1, AMD_AGS_VERSION_5_2_0, - AMD_AGS_VERSION_5_2_1, AMD_AGS_VERSION_5_3_0, AMD_AGS_VERSION_5_4_0, AMD_AGS_VERSION_5_4_1, AMD_AGS_VERSION_5_4_2, AMD_AGS_VERSION_6_0_0, - AMD_AGS_VERSION_6_0_1, AMD_AGS_VERSION_6_1_0, - AMD_AGS_VERSION_6_2_0, AMD_AGS_VERSION_COUNT }; static const struct { - unsigned int ags_public_version; + unsigned int ags_min_public_version; + unsigned int ags_max_public_version; unsigned int device_size; unsigned int dx11_returned_params_size; int max_asicFamily; } amd_ags_info[AMD_AGS_VERSION_COUNT] = { - {AGS_MAKE_VERSION(5, 0, 5), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, - {AGS_MAKE_VERSION(5, 1, 1), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, - {AGS_MAKE_VERSION(5, 2, 0), sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, - {AGS_MAKE_VERSION(5, 2, 1), sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, - {AGS_MAKE_VERSION(5, 3, 0), sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, - {AGS_MAKE_VERSION(5, 4, 0), sizeof(AGSDeviceInfo_540), sizeof(AGSDX11ReturnedParams_520), AsicFamily_RDNA}, - {AGS_MAKE_VERSION(5, 4, 1), sizeof(AGSDeviceInfo_541), sizeof(AGSDX11ReturnedParams_520), AsicFamily_RDNA}, - {AGS_MAKE_VERSION(5, 4, 2), sizeof(AGSDeviceInfo_542), sizeof(AGSDX11ReturnedParams_520), AsicFamily_RDNA}, - {AGS_MAKE_VERSION(6, 0, 0), sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA2}, - {AGS_MAKE_VERSION(6, 0, 1), sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA2}, - {AGS_MAKE_VERSION(6, 1, 0), sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA3}, - {AGS_MAKE_VERSION(6, 2, 0), sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA3}, + {AGS_MAKE_VERSION(5, 0, 5), AGS_MAKE_VERSION(5, 0, 5), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, + {AGS_MAKE_VERSION(5, 1, 1), AGS_MAKE_VERSION(5, 1, 1), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, + {AGS_MAKE_VERSION(5, 2, 0), AGS_MAKE_VERSION(5, 2, 1), sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, + {AGS_MAKE_VERSION(5, 3, 0), AGS_MAKE_VERSION(5, 3, 0), sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, + {AGS_MAKE_VERSION(5, 4, 0), AGS_MAKE_VERSION(5, 4, 0), sizeof(AGSDeviceInfo_540), sizeof(AGSDX11ReturnedParams_520), AsicFamily_RDNA}, + {AGS_MAKE_VERSION(5, 4, 1), AGS_MAKE_VERSION(5, 4, 1), sizeof(AGSDeviceInfo_541), sizeof(AGSDX11ReturnedParams_520), AsicFamily_RDNA}, + {AGS_MAKE_VERSION(5, 4, 2), AGS_MAKE_VERSION(5, 4, 2), sizeof(AGSDeviceInfo_542), sizeof(AGSDX11ReturnedParams_520), AsicFamily_RDNA}, + {AGS_MAKE_VERSION(6, 0, 0), AGS_MAKE_VERSION(6, 0, 1), sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA2}, + {AGS_MAKE_VERSION(6, 1, 0), AGS_MAKE_VERSION(6, 2, 0), sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA3}, }; #define DEF_FIELD(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ - offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ - offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name), \ - offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} + offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \ + offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} #define DEF_FIELD_520_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ - offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), -1, \ - -1, -1, -1, -1, -1, -1}} + offsetof(AGSDeviceInfo_520, name), -1, \ + -1, -1, -1, -1}} #define DEF_FIELD_520_UP(name) {DEVICE_FIELD_##name, {-1, -1, offsetof(AGSDeviceInfo_520, name), \ - offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ - offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name), \ - offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} + offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \ + offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} #define DEF_FIELD_540_UP(name) {DEVICE_FIELD_##name, {-1, -1, -1, \ - -1, -1, offsetof(AGSDeviceInfo_540, name), \ - offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name), \ - offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} + -1, offsetof(AGSDeviceInfo_540, name), \ + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \ + offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} #define DEF_FIELD_540_600(name) {DEVICE_FIELD_##name, {-1, -1, -1, \ - -1, -1, offsetof(AGSDeviceInfo_540, name), \ + -1, offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \ - -1, -1, -1, -1}} + -1, -1}} #define DEF_FIELD_600_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ - offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ - offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), -1, \ - -1, -1, -1}} + offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ + offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \ + -1, -1}} #define DEVICE_FIELD_adapterString 0 #define DEVICE_FIELD_architectureVersion 1 @@ -183,6 +178,7 @@ struct AGSContext VkPhysicalDeviceMemoryProperties *memory_properties; ID3D11DeviceContext *d3d11_context; AGSDX11ExtensionsSupported_600 extensions; + unsigned int public_version; }; static HMODULE hd3d11, hd3d12; @@ -311,16 +307,16 @@ static enum amd_ags_version get_version_number(int ags_version) unsigned int i; for (i = 0; i < ARRAY_SIZE(amd_ags_info); i++) - if (amd_ags_info[i].ags_public_version == ags_version) + if (ags_version >= amd_ags_info[i].ags_min_public_version && ags_version <= amd_ags_info[i].ags_max_public_version) { - TRACE("Found AGS v%s.\n", debugstr_agsversion(ags_version)); + TRACE("Found AGS v%s (internal %d).\n", debugstr_agsversion(ags_version), i); return i; } ERR("Unknown ags_version %s, using 5.4.1.\n", debugstr_agsversion(ags_version)); return AMD_AGS_VERSION_5_4_1; } -static BOOL get_ags_version_from_resource(const WCHAR *filename, enum amd_ags_version *ret) +static BOOL get_ags_version_from_resource(const WCHAR *filename, enum amd_ags_version *ret, int *public_version) { DWORD infosize; void *infobuf; @@ -360,8 +356,9 @@ static BOOL get_ags_version_from_resource(const WCHAR *filename, enum amd_ags_ve major = info->dwFileVersionMS >> 16; minor = info->dwFileVersionMS; patch = info->dwFileVersionLS >> 16; + *public_version = AGS_MAKE_VERSION(major, minor, patch); TRACE("Found amd_ags_x64.dll v%d.%d.%d\n", major, minor, patch); - *ret = get_version_number(AGS_MAKE_VERSION(major, minor, patch)); + *ret = get_version_number(*public_version); heap_free(infobuf); return TRUE; } @@ -383,7 +380,7 @@ static enum amd_ags_version guess_version_from_exports(HMODULE hnative) return AMD_AGS_VERSION_5_4_1; } -static enum amd_ags_version determine_ags_version(int ags_version) +static enum amd_ags_version determine_ags_version(int *ags_version) { /* AMD AGS is not binary compatible between versions (even minor versions), and the game * does not request a specific version when calling agsInit(). @@ -396,10 +393,10 @@ static enum amd_ags_version determine_ags_version(int ags_version) HMODULE hnative = NULL; DWORD size; - TRACE("ags_version %#x.\n", ags_version); + TRACE("*ags_version %#x.\n", *ags_version); - if (ags_version) - return get_version_number(ags_version); + if (*ags_version) + return get_version_number(*ags_version); *temp_name = 0; if (!(size = GetModuleFileNameW(GetModuleHandleW(L"amd_ags_x64.dll"), dllname, ARRAY_SIZE(dllname))) @@ -419,7 +416,7 @@ static enum amd_ags_version determine_ags_version(int ags_version) goto done; } - if (get_ags_version_from_resource(temp_name, &ret)) + if (get_ags_version_from_resource(temp_name, &ret, ags_version)) goto done; if (!(hnative = LoadLibraryW(temp_name))) @@ -430,22 +427,25 @@ static enum amd_ags_version determine_ags_version(int ags_version) if ((pagsGetVersionNumber = (void *)GetProcAddress(hnative, "agsGetVersionNumber"))) { - ags_version = pagsGetVersionNumber(); - ret = get_version_number(ags_version); - TRACE("Got version %s (%d) from agsGetVersionNumber.\n", debugstr_agsversion(ags_version), ret); + *ags_version = pagsGetVersionNumber(); + ret = get_version_number(*ags_version); + TRACE("Got version %s (%d) from agsGetVersionNumber.\n", debugstr_agsversion(*ags_version), ret); goto done; } ret = guess_version_from_exports(hnative); done: + if (!*ags_version) + *ags_version = amd_ags_info[ret].ags_max_public_version; + if (hnative) FreeLibrary(hnative); if (*temp_name) DeleteFileW(temp_name); - TRACE("Using AGS v%s interface\n", debugstr_agsversion(amd_ags_info[ret].ags_public_version)); + TRACE("Using AGS v%s (internal %d) interface\n", debugstr_agsversion(*ags_version), ret); return ret; } @@ -694,7 +694,8 @@ static AGSReturnCode init_ags_context(AGSContext *context, int ags_version) memset(context, 0, sizeof(*context)); - context->version = determine_ags_version(ags_version); + context->version = determine_ags_version(&ags_version); + context->public_version = ags_version; ret = vk_get_physical_device_properties(&context->device_count, &context->properties, &context->memory_properties); if (ret != AGS_SUCCESS || !context->device_count) @@ -822,9 +823,9 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi } memset(gpu_info, 0, sizeof(*gpu_info)); - gpu_info->agsVersionMajor = AGS_VER_MAJOR(amd_ags_info[object->version].ags_public_version); - gpu_info->agsVersionMinor = AGS_VER_MINOR(amd_ags_info[object->version].ags_public_version);; - gpu_info->agsVersionPatch = AGS_VER_PATCH(amd_ags_info[object->version].ags_public_version);; + gpu_info->agsVersionMajor = AGS_VER_MAJOR(object->public_version); + gpu_info->agsVersionMinor = AGS_VER_MINOR(object->public_version); + gpu_info->agsVersionPatch = AGS_VER_PATCH(object->public_version); gpu_info->driverVersion = driver_version; gpu_info->radeonSoftwareVersion = radeon_version; gpu_info->numDevices = object->device_count; @@ -1176,11 +1177,12 @@ AGSDriverVersionResult WINAPI agsCheckDriverVersion(const char* version_reported int WINAPI agsGetVersionNumber(void) { - enum amd_ags_version version = determine_ags_version(0); + int public_version = 0; + enum amd_ags_version version = determine_ags_version(&public_version); - TRACE("version %d.\n", version); + TRACE("version %s (internal %d).\n", debugstr_agsversion(public_version), version); - return amd_ags_info[version].ags_public_version; + return public_version; } AGSReturnCode WINAPI agsDriverExtensionsDX11_Init( AGSContext *context, ID3D11Device *device, unsigned int uavSlot, unsigned int *extensionsSupported ) @@ -1283,10 +1285,10 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_SetDepthBounds_530(AGSContext* cont return set_depth_bounds(context, dx_context, enabled, min_depth, max_depth); } -C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 3); __ASM_GLOBAL_FUNC( DX11_SetDepthBounds_impl, "mov (%rcx),%eax\n\t" /* version */ - "cmp $4,%eax\n\t" + "cmp $3,%eax\n\t" "jge 1f\n\t" "jmp " __ASM_NAME("agsDriverExtensionsDX11_SetDepthBounds") "\n\t" "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_SetDepthBounds_530") ) @@ -1335,10 +1337,10 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_BeginUAVOverlap(AGSContext *context return update_uav_overlap(context, dx_context, TRUE); } -C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 3); __ASM_GLOBAL_FUNC( DX11_BeginUAVOverlap_impl, "mov (%rcx),%eax\n\t" /* version */ - "cmp $4,%eax\n\t" + "cmp $3,%eax\n\t" "jge 1f\n\t" "jmp " __ASM_NAME("agsDriverExtensionsDX11_BeginUAVOverlap_520") "\n\t" "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_BeginUAVOverlap") ) @@ -1369,10 +1371,10 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_EndUAVOverlap(AGSContext *context, return update_uav_overlap(context, dx_context, FALSE); } -C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 3); __ASM_GLOBAL_FUNC( DX11_EndUAVOverlap_impl, "mov (%rcx),%eax\n\t" /* version */ - "cmp $4,%eax\n\t" + "cmp $3,%eax\n\t" "jge 1f\n\t" "jmp " __ASM_NAME("agsDriverExtensionsDX11_EndUAVOverlap_520") "\n\t" "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_EndUAVOverlap") ) From c146156baaaf369d0cad7137feb3250f8ed6580a Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 1 Dec 2023 13:02:58 -0600 Subject: [PATCH 0519/2542] amd_ags_x64: Recognize versions 5.0.1 - 5.0.6. CW-Bug-Id: #22976 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index e2ee97fb9f84..09389eb0dc19 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -77,7 +77,7 @@ static const struct } amd_ags_info[AMD_AGS_VERSION_COUNT] = { - {AGS_MAKE_VERSION(5, 0, 5), AGS_MAKE_VERSION(5, 0, 5), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, + {AGS_MAKE_VERSION(5, 0, 0), AGS_MAKE_VERSION(5, 0, 6), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, {AGS_MAKE_VERSION(5, 1, 1), AGS_MAKE_VERSION(5, 1, 1), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, {AGS_MAKE_VERSION(5, 2, 0), AGS_MAKE_VERSION(5, 2, 1), sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, {AGS_MAKE_VERSION(5, 3, 0), AGS_MAKE_VERSION(5, 3, 0), sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, From ce182a3f0019a15fe9b38b4163d0070502a74af5 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 14 Aug 2023 20:04:14 -0600 Subject: [PATCH 0520/2542] wine.inf: Enable builtin atiadlxx for Ratchet & Clank: Rift Apart. CW-Bug-Id: #22607 --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 64eb1fdcb435..e409c0d86b3f 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2832,3 +2832,4 @@ HKCU,Software\Wine\AppDefaults\Avengers.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\starwarssquadrons.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\GW2.Main_Win64_Retail.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\Spider-Man.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\RiftApart.exe\DllOverrides,"atiadlxx",,"builtin" From e70397caf734ac9e68b65c925c9183079b28848e Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Tue, 12 Dec 2023 12:38:37 +0200 Subject: [PATCH 0521/2542] amd_ags_x64: Prefer builtin. CW-Bug-Id: #22976 --- dlls/amd_ags_x64/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/amd_ags_x64/Makefile.in b/dlls/amd_ags_x64/Makefile.in index b8463820d76c..034413158025 100644 --- a/dlls/amd_ags_x64/Makefile.in +++ b/dlls/amd_ags_x64/Makefile.in @@ -6,7 +6,7 @@ UNIX_LIBS = $(DRM_LIBS) $(DRMAMDGPU_LIBS) IMPORTS = version vulkan-1 user32 IMPORTLIB = amd_ags_x64 -EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native +EXTRADLLFLAGS = -mno-cygwin SOURCES = \ amd_ags_x64_main.c \ From 42f65708edcd9cde4bbabdd934afd07e12e8e491 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 5 Jan 2024 13:51:47 -0600 Subject: [PATCH 0522/2542] amd_ags_x64: Add v4.0.0-v4.0.3 definitions. CW-Bug-Id: #23209 --- dlls/amd_ags_x64/amd_ags.h | 128 ++++++++++++++++++++++++++++++++++--- 1 file changed, 120 insertions(+), 8 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index aac9fb1413cf..982452bc96e8 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -303,7 +303,63 @@ typedef struct AGSRect int height; ///< Height of rectangle } AGSRect; +typedef struct AGSEyefinityInfo +{ + int iSLSActive; // Indicates if Eyefinity is active for the operating system display + // index passed into atiEyefinityGetConfigInfo(). 1 if enabled and 0 if disabled. + + int iSLSGridWidth; // Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + // For example, a 3 display wide by 2 high Eyefinity setup will return 3 for this entry. + int iSLSGridHeight; // Contains height of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + // For example, a 3 display wide by 2 high Eyefinity setup will return 2 for this entry. + + int iSLSWidth; // Contains width in pixels of the multi-monitor Single Large Surface. The value returned is + // a function of the width of the SLS grid, of the horizontal resolution of each display, and + // of whether or not bezel compensation is enabled. + int iSLSHeight; // Contains height in pixels of the multi-monitor Single Large Surface. The value returned is + // a function of the height of the SLS grid, of the vertical resolution of each display, and + // of whether or not bezel compensation is enabled. + + int iBezelCompensatedDisplay; // Indicates if bezel compensation is used for the current SLS display area. + // 1 if enabled, and 0 if disabled. +} AGSEyefinityInfo; + /// The display info struct used to describe a display enumerated by AGS +typedef struct AGSDisplayInfo_403 +{ + int iGridXCoord; // Contains horizontal SLS grid coordinate of the display. The value is zero based with + // increasing values from left to right of the overall SLS grid. For example, the left-most + // display of a 3x2 Eyefinity setup will have the value 0, and the right-most will have + // the value 2. + int iGridYCoord; // Contains vertical SLS grid coordinate of the display. The value is zero based with + // increasing values from top to bottom of the overall SLS grid. For example, the top + // display of a 3x2 Eyefinity setup will have the value 0, and the bottom will have the + // value 1. + + AGSRect displayRect; // Contains the base offset and dimensions in pixels of the SLS rendering + // area associated with this display. If bezel compensation is enabled, this + // area will be larger than what the display can natively present to account + // for bezel area. If bezel compensation is disabled, this area will be equal + // to what the display can support natively. + + AGSRect displayRectVisible; // Contains the base offset and dimensions in pixels of the SLS rendering area + // associated with this display that is visible to the end user. If bezel + // compensation is enabled, this area will be equal to what the display can + // natively, but smaller that the area described in the displayRect entry. If + // bezel compensation is disabled, this area will be equal to what the display + // can support natively and equal to the area described in the displayRect entry. + // Developers wishing to place UI, HUD, or other game assets on a given display + // so that it is visible and accessible to end users need to locate them inside + // of the region defined by this rect. + + int iPreferredDisplay; // Indicates whether or not this display is the preferred one for rendering of + // game HUD and UI elements. Only one display out of the whole SLS grid will have + // this be true if it is the preferred display and 0 otherwise. Developers wishing + // to place specific UI, HUD, or other game assets on a given display so that it + // is visible and accessible to end users need to locate them inside of the region + // defined by this rect. +} AGSDisplayInfo_403; + typedef struct AGSDisplayInfo_511 { char name[ 256 ]; ///< The name of the display @@ -645,7 +701,20 @@ typedef void* (__stdcall *AGS_ALLOC_CALLBACK_511)( int allocationSize ); ///< typedef void* (__stdcall *AGS_ALLOC_CALLBACK)( size_t allocationSize ); ///< AGS user defined allocation prototype typedef void (__stdcall *AGS_FREE_CALLBACK)( void* allocationPtr ); ///< AGS user defined free prototype +/// The different modes to control Crossfire behavior. +typedef enum AGSCrossfireMode +{ + AGS_CROSSFIRE_MODE_DRIVER_AFR = 0, ///< Use the default driver-based AFR rendering. If this mode is specified, do NOT use the agsDriverExtensionsDX11_Create*() APIs to create resources + AGS_CROSSFIRE_MODE_EXPLICIT_AFR, ///< Use the AGS Crossfire API functions to perform explicit AFR rendering without requiring a CF driver profile + AGS_CROSSFIRE_MODE_DISABLE ///< Completely disable AFR rendering +} AGSCrossfireMode; + /// The configuration options that can be passed in to \ref agsInititalize +struct AGSConfiguration_403 +{ + AGSCrossfireMode crossfireMode; // Desired Crossfire mode. See AGSCrossfireMode for more details +}; + typedef struct AGSConfiguration_511 { AGS_ALLOC_CALLBACK_511 allocCallback; ///< Optional memory allocation callback. If not supplied, malloc() is used @@ -664,7 +733,29 @@ typedef union AGSConfiguration AGSConfiguration_520 agsConfiguration520; } AGSConfiguration; + + /// The top level GPU information returned from \ref agsInitialize +struct AGSGPUInfo_403 +{ + int agsVersionMajor; // Major field of Major.Minor.Patch AGS version number + int agsVersionMinor; // Minor field of Major.Minor.Patch AGS version number + int agsVersionPatch; // Patch field of Major.Minor.Patch AGS version number + + ArchitectureVersion architectureVersion; // Set to Unknown if not AMD hardware + const char* adapterString; // The adapter name string. NULL if not AMD hardware + int deviceId; // The device id + int revisionId; // The revision id + + const char* driverVersion; // The driver package version + const char* radeonSoftwareVersion; // The Radeon Software Version + + int iNumCUs; // Number of GCN compute units. Zero if not GCN + int iCoreClock; // core clock speed at 100% power in MHz + int iMemoryClock; // memory clock speed at 100% power in MHz + float fTFlops; // Teraflops of GPU. Zero if not GCN. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD +}; + typedef struct AGSGPUInfo_511 { int agsVersionMajor; ///< Major field of Major.Minor.Patch AGS version number @@ -953,6 +1044,35 @@ typedef struct AGSDX12ReturnedParams } AGSDX12ReturnedParams; +// Description +// Function used to query Eyefinity configuration state information relevant to ISVs. State info returned +// includes: whether Eyefinity is enabled or not, SLS grid configuration, SLS dimensions, whether bezel +// compensation is enabled or not, SLS grid coordinate for each display, total rendering area for each +// display, visible rendering area for each display, and a preferred display flag. +// +// This function needs to be called twice. Firstly to null into eyefinityInfo and displaysInfo. This will +// return the number of AGSDisplayInfo objects to allocate. +// Second call requires valid pointers to eyefinityInfo and the newly allocated displaysInfo array. It is the +// responsibility of the caller to free this memory. +// +// +// Input params +// context - Pointer to a context. +// displayIndex - Operating system specific display index identifier. The value used should be the +// index of the display used for rendering operations. On Windows operating systems, +// the value can be queried using the EnumDisplayDevices() API. +// +// Output params +// eyefinityInfo - This is a pointer to an AGSEyefinityInfo structure that contains system Eyefinity +// configuration information. +// numDisplaysInfo - Pointer to the number of AGSDisplayInfo structures stored in the returned +// displaysInfo array. The value returned is equal to the number of displays +// used for the Eyefinity setup. +// displaysInfo - Pointer to an array of AGSDisplayInfo structures that contains per display +// Eyefinity configuration information. +// +AMD_AGS_API AGSReturnCode agsGetEyefinityConfigInfo( AGSContext *context, int displayIndex, AGSEyefinityInfo *eyefinityInfo, int *numDisplaysInfo, AGSDisplayInfo_403 *displaysInfo ); + /// /// Function used to create a D3D12 device with additional AMD-specific initialization parameters. /// @@ -1063,14 +1183,6 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_SetMarker( AGSContext* context /// The corresponding \ref agsDriverExtensionsDX11_DestroyDevice call must be called to release the device and free up the internal resources allocated by the create call. /// @{ -/// The different modes to control Crossfire behavior. -typedef enum AGSCrossfireMode -{ - AGS_CROSSFIRE_MODE_DRIVER_AFR = 0, ///< Use the default driver-based AFR rendering. If this mode is specified, do NOT use the agsDriverExtensionsDX11_Create*() APIs to create resources - AGS_CROSSFIRE_MODE_EXPLICIT_AFR, ///< Use the AGS Crossfire API functions to perform explicit AFR rendering without requiring a CF driver profile - AGS_CROSSFIRE_MODE_DISABLE ///< Completely disable AFR rendering -} AGSCrossfireMode; - /// The struct to specify the existing DX11 device creation parameters typedef struct AGSDX11DeviceCreationParams { From cf87836d7fd696214db97511531965da58d950ee Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 5 Jan 2024 15:28:35 -0600 Subject: [PATCH 0523/2542] amd_ags_x64: Support versions 4.0.0 - 4.0.3. CW-Bug-Id: #23209 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 95 ++++++++++++++++++++++------- 1 file changed, 73 insertions(+), 22 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 09389eb0dc19..1cd4a9892dac 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -54,6 +54,7 @@ static const char radeon_version[] = "23.10.2"; enum amd_ags_version { + AMD_AGS_VERSION_4_0_3, AMD_AGS_VERSION_5_0_5, AMD_AGS_VERSION_5_1_1, AMD_AGS_VERSION_5_2_0, @@ -77,6 +78,7 @@ static const struct } amd_ags_info[AMD_AGS_VERSION_COUNT] = { + {AGS_MAKE_VERSION(4, 0, 0), AGS_MAKE_VERSION(4, 0, 3), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, {AGS_MAKE_VERSION(5, 0, 0), AGS_MAKE_VERSION(5, 0, 6), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, {AGS_MAKE_VERSION(5, 1, 1), AGS_MAKE_VERSION(5, 1, 1), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, {AGS_MAKE_VERSION(5, 2, 0), AGS_MAKE_VERSION(5, 2, 1), sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, @@ -88,26 +90,29 @@ amd_ags_info[AMD_AGS_VERSION_COUNT] = {AGS_MAKE_VERSION(6, 1, 0), AGS_MAKE_VERSION(6, 2, 0), sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600), AsicFamily_RDNA3}, }; -#define DEF_FIELD(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ +#define DEF_FIELD(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), \ + offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \ offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} -#define DEF_FIELD_520_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ +#define DEF_FIELD_520_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), \ + offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), -1, \ -1, -1, -1, -1}} -#define DEF_FIELD_520_UP(name) {DEVICE_FIELD_##name, {-1, -1, offsetof(AGSDeviceInfo_520, name), \ +#define DEF_FIELD_520_UP(name) {DEVICE_FIELD_##name, {-1, -1, -1, offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \ offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} -#define DEF_FIELD_540_UP(name) {DEVICE_FIELD_##name, {-1, -1, -1, \ +#define DEF_FIELD_540_UP(name) {DEVICE_FIELD_##name, {-1, -1, -1, -1, \ -1, offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \ offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}} -#define DEF_FIELD_540_600(name) {DEVICE_FIELD_##name, {-1, -1, -1, \ +#define DEF_FIELD_540_600(name) {DEVICE_FIELD_##name, {-1, -1, -1, -1, \ -1, offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \ -1, -1}} -#define DEF_FIELD_600_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ +#define DEF_FIELD_600_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), \ + offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \ offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \ offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \ -1, -1}} @@ -370,6 +375,12 @@ static enum amd_ags_version guess_version_from_exports(HMODULE hnative) * - CoD: Modern Warfare Remastered (2017) ships dll without version info which is version 5.0.1 * (not tagged in AGSSDK history), compatible with 5.0.5. */ + if (GetProcAddress(hnative, "agsGetEyefinityConfigInfo")) + { + /* agsGetEyefinityConfigInfo was deprecated in 5.0.0 */ + TRACE("agsGetEyefinityConfigInfo found.\n"); + return AMD_AGS_VERSION_4_0_3; + } if (GetProcAddress(hnative, "agsDriverExtensionsDX11_Init")) { /* agsDriverExtensionsDX11_Init was deprecated in 5.3.0 */ @@ -822,14 +833,54 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi return ret; } - memset(gpu_info, 0, sizeof(*gpu_info)); - gpu_info->agsVersionMajor = AGS_VER_MAJOR(object->public_version); - gpu_info->agsVersionMinor = AGS_VER_MINOR(object->public_version); - gpu_info->agsVersionPatch = AGS_VER_PATCH(object->public_version); - gpu_info->driverVersion = driver_version; - gpu_info->radeonSoftwareVersion = radeon_version; - gpu_info->numDevices = object->device_count; - gpu_info->devices = object->devices; + if (object->version <= AMD_AGS_VERSION_4_0_3) + { + struct AGSDeviceInfo_511 *devices = (struct AGSDeviceInfo_511 *)object->devices, *device; + struct AGSGPUInfo_403 *info = (struct AGSGPUInfo_403 *)gpu_info; + unsigned int i; + + if (!object->device_count) + { + ERR("No devices.\n"); + agsDeInit(object); + return AGS_FAILURE; + } + + for (i = 0; i < object->device_count; ++i) + if (devices[i].isPrimaryDevice) + break; + if (i == object->device_count) + { + WARN("No primary device, using first.\n"); + i = 0; + } + device = &devices[i]; + memset(info, 0, sizeof(*info)); + info->agsVersionMajor = AGS_VER_MAJOR(object->public_version); + info->agsVersionMinor = AGS_VER_MINOR(object->public_version); + info->agsVersionPatch = AGS_VER_PATCH(object->public_version); + info->architectureVersion = device->architectureVersion; + info->adapterString = device->adapterString; + info->deviceId = device->deviceId; + info->revisionId = device->revisionId; + info->driverVersion = driver_version; + info->radeonSoftwareVersion = radeon_version; + info->iNumCUs = device->numCUs; + info->iCoreClock = device->coreClock; + info->iMemoryClock = device->memoryClock; + info->fTFlops = device->teraFlops; + } + else + { + memset(gpu_info, 0, sizeof(*gpu_info)); + gpu_info->agsVersionMajor = AGS_VER_MAJOR(object->public_version); + gpu_info->agsVersionMinor = AGS_VER_MINOR(object->public_version); + gpu_info->agsVersionPatch = AGS_VER_PATCH(object->public_version); + gpu_info->driverVersion = driver_version; + gpu_info->radeonSoftwareVersion = radeon_version; + gpu_info->numDevices = object->device_count; + gpu_info->devices = object->devices; + } TRACE("Created context %p.\n", object); @@ -1285,10 +1336,10 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_SetDepthBounds_530(AGSContext* cont return set_depth_bounds(context, dx_context, enabled, min_depth, max_depth); } -C_ASSERT(AMD_AGS_VERSION_5_3_0 == 3); +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); __ASM_GLOBAL_FUNC( DX11_SetDepthBounds_impl, "mov (%rcx),%eax\n\t" /* version */ - "cmp $3,%eax\n\t" + "cmp $4,%eax\n\t" "jge 1f\n\t" "jmp " __ASM_NAME("agsDriverExtensionsDX11_SetDepthBounds") "\n\t" "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_SetDepthBounds_530") ) @@ -1337,10 +1388,10 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_BeginUAVOverlap(AGSContext *context return update_uav_overlap(context, dx_context, TRUE); } -C_ASSERT(AMD_AGS_VERSION_5_3_0 == 3); +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); __ASM_GLOBAL_FUNC( DX11_BeginUAVOverlap_impl, "mov (%rcx),%eax\n\t" /* version */ - "cmp $3,%eax\n\t" + "cmp $4,%eax\n\t" "jge 1f\n\t" "jmp " __ASM_NAME("agsDriverExtensionsDX11_BeginUAVOverlap_520") "\n\t" "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_BeginUAVOverlap") ) @@ -1371,10 +1422,10 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_EndUAVOverlap(AGSContext *context, return update_uav_overlap(context, dx_context, FALSE); } -C_ASSERT(AMD_AGS_VERSION_5_3_0 == 3); +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); __ASM_GLOBAL_FUNC( DX11_EndUAVOverlap_impl, "mov (%rcx),%eax\n\t" /* version */ - "cmp $3,%eax\n\t" + "cmp $4,%eax\n\t" "jge 1f\n\t" "jmp " __ASM_NAME("agsDriverExtensionsDX11_EndUAVOverlap_520") "\n\t" "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_EndUAVOverlap") ) @@ -1418,10 +1469,10 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_DestroyDevice_511(AGSContext *conte return agsDriverExtensionsDX11_DestroyDevice_520(context, device, references, NULL, NULL); } -C_ASSERT(AMD_AGS_VERSION_5_2_0 == 2); +C_ASSERT(AMD_AGS_VERSION_5_2_0 == 3); __ASM_GLOBAL_FUNC( agsDriverExtensionsDX11_DestroyDevice, "mov (%rcx),%eax\n\t" /* version */ - "cmp $2,%eax\n\t" + "cmp $3,%eax\n\t" "jge 1f\n\t" "jmp " __ASM_NAME("agsDriverExtensionsDX11_DestroyDevice_511") "\n\t" "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_DestroyDevice_520") ) From 4be0cbf8800f9eb4957a7c15dcfe1e0ce71974fe Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 5 Jan 2024 15:30:27 -0600 Subject: [PATCH 0524/2542] amd_ags_x64: Implement agsGetTotalGPUCount(). CW-Bug-Id: #23209 --- dlls/amd_ags_x64/amd_ags.h | 14 ++++++++++++++ dlls/amd_ags_x64/amd_ags_x64.spec | 1 + dlls/amd_ags_x64/amd_ags_x64_main.c | 8 ++++++++ 3 files changed, 23 insertions(+) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index 982452bc96e8..848c90273a97 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -1044,6 +1044,20 @@ typedef struct AGSDX12ReturnedParams } AGSDX12ReturnedParams; +// Description +// Function used to query the number of GPUs in the system. +// This number may be different from agsGetCrossfireGPUCount as it reports +// all devices installed in the system, and not only those configured for +// Crossfire. +// +// Input params +// context - Pointer to a context. +// +// Output params +// numGPUs - Number of GPUs in the system. +// +AMD_AGS_API AGSReturnCode agsGetTotalGPUCount( AGSContext* context, int* numGPUs ); + // Description // Function used to query Eyefinity configuration state information relevant to ISVs. State info returned // includes: whether Eyefinity is enabled or not, SLS grid configuration, SLS dimensions, whether bezel diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index 3620bd8885b8..196665695998 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -43,3 +43,4 @@ @ stdcall agsInit(ptr ptr ptr) @ stdcall agsInitialize(long ptr ptr ptr) @ stdcall agsSetDisplayMode(ptr long long ptr) +@ stdcall agsGetTotalGPUCount(ptr ptr) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 1cd4a9892dac..04c3217a69ff 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -958,6 +958,14 @@ AGSReturnCode WINAPI agsDeInitialize(AGSContext *context) return AGS_SUCCESS; } +AGSReturnCode WINAPI agsGetTotalGPUCount(AGSContext *context, int *numGPUs) +{ + TRACE("context %p, numGPUs %p.\n", context, numGPUs); + + *numGPUs = context->device_count; + return AGS_SUCCESS; +} + static DXGI_COLOR_SPACE_TYPE convert_ags_colorspace_506(AGSDisplaySettings_Mode_506 mode) { switch (mode) From 3be7dcae3d1d6a032fffac31ce7158b0991eaa33 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 5 Jan 2024 15:35:46 -0600 Subject: [PATCH 0525/2542] amd_ags_x64: Implement agsGetGPUMemorySize(). CW-Bug-Id: #23209 --- dlls/amd_ags_x64/amd_ags.h | 13 +++++++++++++ dlls/amd_ags_x64/amd_ags_x64.spec | 1 + dlls/amd_ags_x64/amd_ags_x64_main.c | 13 +++++++++++++ 3 files changed, 27 insertions(+) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index 848c90273a97..8eab0732d5b1 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -1058,6 +1058,19 @@ typedef struct AGSDX12ReturnedParams // AMD_AGS_API AGSReturnCode agsGetTotalGPUCount( AGSContext* context, int* numGPUs ); +// Description +// Function used to query the memory size of a GPU. The number of GPUs should +// be obtained using agsGetTotalGPUCount +// +// Input params +// context - Pointer to a context. +// gpuIndex - The GPU index to query +// +// Output params +// sizeInBytes - Memory size on the device in bytes +// +AMD_AGS_API AGSReturnCode agsGetGPUMemorySize( AGSContext* context, int gpuIndex, long long* sizeInBytes ); + // Description // Function used to query Eyefinity configuration state information relevant to ISVs. State info returned // includes: whether Eyefinity is enabled or not, SLS grid configuration, SLS dimensions, whether bezel diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index 196665695998..20a16b4e3da1 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -44,3 +44,4 @@ @ stdcall agsInitialize(long ptr ptr ptr) @ stdcall agsSetDisplayMode(ptr long long ptr) @ stdcall agsGetTotalGPUCount(ptr ptr) +@ stdcall agsGetGPUMemorySize(ptr long ptr) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 04c3217a69ff..d17e5bd72fa4 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -966,6 +966,19 @@ AGSReturnCode WINAPI agsGetTotalGPUCount(AGSContext *context, int *numGPUs) return AGS_SUCCESS; } +AGSReturnCode WINAPI agsGetGPUMemorySize( AGSContext *context, int gpuIndex, long long *sizeInBytes ) +{ + struct AGSDeviceInfo_511 *device = &((struct AGSDeviceInfo_511 *)context->devices)[gpuIndex]; + + TRACE("context %p, gpuIndex %d, sizeInBytes %p.\n", context, gpuIndex, sizeInBytes); + + if ((unsigned)gpuIndex >= context->device_count) + return AGS_INVALID_ARGS; + + *sizeInBytes = device->localMemoryInBytes; + return AGS_SUCCESS; +} + static DXGI_COLOR_SPACE_TYPE convert_ags_colorspace_506(AGSDisplaySettings_Mode_506 mode) { switch (mode) From 9a600bc98865928301f668997942a390c98dc050 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 5 Jan 2024 16:16:03 -0600 Subject: [PATCH 0526/2542] amd_ags_x64: Implement agsGetEyefinityConfigInfo(). CW-Bug-Id: #23209 --- dlls/amd_ags_x64/amd_ags_x64.spec | 1 + dlls/amd_ags_x64/amd_ags_x64_main.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index 20a16b4e3da1..6cd8aec62dbf 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -45,3 +45,4 @@ @ stdcall agsSetDisplayMode(ptr long long ptr) @ stdcall agsGetTotalGPUCount(ptr ptr) @ stdcall agsGetGPUMemorySize(ptr long ptr) +@ stdcall agsGetEyefinityConfigInfo(ptr long ptr ptr ptr) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index d17e5bd72fa4..0827338de1ee 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -979,6 +979,30 @@ AGSReturnCode WINAPI agsGetGPUMemorySize( AGSContext *context, int gpuIndex, lon return AGS_SUCCESS; } +AGSReturnCode WINAPI agsGetEyefinityConfigInfo( AGSContext *context, int displayIndex, AGSEyefinityInfo *eyefinityInfo, + int *numDisplaysInfo, AGSDisplayInfo_403 *displaysInfo ) +{ + struct AGSDeviceInfo_511 *devices; + unsigned int i; + + TRACE("context %p, displayIndex %d, eyefinityInfo %p, numDisplaysInfo %p, displaysInfo %p\n", + context, displayIndex, eyefinityInfo, numDisplaysInfo, displaysInfo); + + devices = (struct AGSDeviceInfo_511 *)context->devices; + *numDisplaysInfo = 0; + for (i = 0; i < context->device_count; ++i) + *numDisplaysInfo += devices[i].numDisplays; + + if (!eyefinityInfo || !displaysInfo) + return AGS_SUCCESS; + + /* displaysInfo is not filled in on Windows if Eyefinity is not enabled. */ + memset(eyefinityInfo, 0, sizeof(*eyefinityInfo)); + memset(displaysInfo, 0, *numDisplaysInfo * sizeof(*displaysInfo)); + + return AGS_SUCCESS; +} + static DXGI_COLOR_SPACE_TYPE convert_ags_colorspace_506(AGSDisplaySettings_Mode_506 mode) { switch (mode) From fad3f8afbefa2febe08d8f0e68199b6ae087d0da Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 17 Jan 2024 09:55:07 -0600 Subject: [PATCH 0527/2542] amd_ags_x64: Add stubs for agsDriverExtensionsDX12_Init/DeInit. CW-Bug-Id: #23258 --- dlls/amd_ags_x64/amd_ags_x64.spec | 4 ++-- dlls/amd_ags_x64/amd_ags_x64_main.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index 6cd8aec62dbf..58db31687e80 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -31,10 +31,10 @@ @ stub agsDriverExtensionsDX11_WriteBreadcrumb @ stdcall agsDriverExtensionsDX12_CreateDevice(ptr ptr ptr ptr) @ stub agsDriverExtensionsDX12_CreateFromDevice -@ stub agsDriverExtensionsDX12_DeInit +@ stdcall agsDriverExtensionsDX12_DeInit(ptr) @ stub agsDriverExtensionsDX12_Destroy @ stdcall agsDriverExtensionsDX12_DestroyDevice(ptr ptr ptr) -@ stub agsDriverExtensionsDX12_Init +@ stdcall agsDriverExtensionsDX12_Init(ptr ptr ptr) @ stub agsDriverExtensionsDX12_PopMarker @ stub agsDriverExtensionsDX12_PushMarker @ stub agsDriverExtensionsDX12_SetMarker diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 0827338de1ee..5ebab612b0c6 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -1318,6 +1318,21 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_DeInit( AGSContext* context ) return AGS_SUCCESS; } +AGSReturnCode WINAPI agsDriverExtensionsDX12_Init( AGSContext* context, ID3D12Device* device, unsigned int* extensionsSupported ) +{ + FIXME("context %p, device %p, extensionsSupported %p stub.\n", context, device, extensionsSupported); + + *extensionsSupported = 0; + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX12_DeInit( AGSContext* context ) +{ + TRACE("context %p.\n", context); + + return AGS_SUCCESS; +} + BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) { TRACE("%p, %u, %p.\n", instance, reason, reserved); From 1efa08d3e93aae9c6cbc00d3d8dbd217b9d2d59f Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 22 Feb 2024 09:42:41 -0600 Subject: [PATCH 0528/2542] amd_ags_x64: Implement multi draw instanced functions. CW-Bug-Id: #22976 --- dlls/amd_ags_x64/amd_ags_x64.spec | 4 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 104 ++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 2 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index 58db31687e80..d308f2368790 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -15,9 +15,9 @@ @ stub agsDriverExtensionsDX11_GetMaxClipRects @ stub agsDriverExtensionsDX11_IASetPrimitiveTopology @ stdcall agsDriverExtensionsDX11_Init(ptr ptr long ptr) -@ stub agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect +@ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect() DX11_MultiDrawIndexedInstancedIndirect_impl @ stub agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect -@ stub agsDriverExtensionsDX11_MultiDrawInstancedIndirect +@ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_MultiDrawInstancedIndirect() DX11_MultiDrawInstancedIndirect_impl @ stub agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect @ stub agsDriverExtensionsDX11_NotifyResourceBeginAllAccess @ stub agsDriverExtensionsDX11_NotifyResourceEndAllAccess diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 5ebab612b0c6..968c885c64dc 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -1130,6 +1130,7 @@ static void get_dx11_extensions_supported(ID3D11Device *device, AGSDX11Extension extensions->depthBoundsTest = !!ID3D11VkExtDevice_GetExtensionSupport(ext_device, D3D11_VK_EXT_DEPTH_BOUNDS); extensions->uavOverlap = !!ID3D11VkExtDevice_GetExtensionSupport(ext_device, D3D11_VK_EXT_BARRIER_CONTROL); + extensions->multiDrawIndirect = !!ID3D11VkExtDevice_GetExtensionSupport(ext_device, D3D11_VK_EXT_MULTI_DRAW_INDIRECT); extensions->UAVOverlapDeferredContexts = extensions->uavOverlap; ID3D11VkExtDevice_Release(ext_device); @@ -1490,6 +1491,109 @@ __ASM_GLOBAL_FUNC( DX11_EndUAVOverlap_impl, "jmp " __ASM_NAME("agsDriverExtensionsDX11_EndUAVOverlap_520") "\n\t" "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_EndUAVOverlap") ) +AGSReturnCode WINAPI agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect(AGSContext *context, ID3D11DeviceContext *dx_context, + unsigned int draw_count, ID3D11Buffer *buffer_for_args, unsigned int aligned_byte_offset_for_args, + unsigned int byte_stride_for_args) +{ + ID3D11VkExtContext *ext_context; + + TRACE("context %p, dx_context %p, draw_count %u, buffer_for_args %p, aligned_byte_offset_for_args %u, byte_stride_for_args %u.\n", + context, dx_context, draw_count, buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args); + + if (!context || !dx_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + + if (!context->extensions.multiDrawIndirect) + return AGS_EXTENSION_NOT_SUPPORTED; + + if (FAILED(ID3D11DeviceContext_QueryInterface(dx_context, &IID_ID3D11VkExtContext, (void **)&ext_context))) + { + TRACE("No ID3D11VkExtContext.\n"); + return AGS_EXTENSION_NOT_SUPPORTED; + } + + ID3D11VkExtContext_MultiDrawIndexedIndirect(ext_context, draw_count, buffer_for_args, aligned_byte_offset_for_args, + byte_stride_for_args); + ID3D11VkExtContext_Release(ext_context); + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect_520(AGSContext *context, + unsigned int draw_count, ID3D11Buffer *buffer_for_args, unsigned int aligned_byte_offset_for_args, + unsigned int byte_stride_for_args) +{ + if (!context || !context->d3d11_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + return agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect(context, context->d3d11_context, draw_count, + buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args); +} + +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); +__ASM_GLOBAL_FUNC( DX11_MultiDrawIndexedInstancedIndirect_impl, + "mov (%rcx),%eax\n\t" /* version */ + "cmp $4,%eax\n\t" + "jge 1f\n\t" + "jmp " __ASM_NAME("agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect_520") "\n\t" + "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect") ) + + +AGSReturnCode WINAPI agsDriverExtensionsDX11_MultiDrawInstancedIndirect(AGSContext *context, ID3D11DeviceContext *dx_context, + unsigned int draw_count, ID3D11Buffer *buffer_for_args, unsigned int aligned_byte_offset_for_args, + unsigned int byte_stride_for_args) +{ + ID3D11VkExtContext *ext_context; + + TRACE("context %p, dx_context %p, draw_count %u, buffer_for_args %p, aligned_byte_offset_for_args %u, byte_stride_for_args %u.\n", + context, dx_context, draw_count, buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args); + + if (!context || !dx_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + + if (!context->extensions.multiDrawIndirect) + return AGS_EXTENSION_NOT_SUPPORTED; + + if (FAILED(ID3D11DeviceContext_QueryInterface(dx_context, &IID_ID3D11VkExtContext, (void **)&ext_context))) + { + TRACE("No ID3D11VkExtContext.\n"); + return AGS_EXTENSION_NOT_SUPPORTED; + } + + ID3D11VkExtContext_MultiDrawIndirect(ext_context, draw_count, buffer_for_args, aligned_byte_offset_for_args, + byte_stride_for_args); + ID3D11VkExtContext_Release(ext_context); + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_MultiDrawInstancedIndirect_520( AGSContext* context, unsigned int draw_count, + ID3D11Buffer *buffer_for_args, unsigned int aligned_byte_offset_for_args, unsigned int byte_stride_for_args) +{ + if (!context || !context->d3d11_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + return agsDriverExtensionsDX11_MultiDrawInstancedIndirect(context, context->d3d11_context, draw_count, + buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args); +} + +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); +__ASM_GLOBAL_FUNC( DX11_MultiDrawInstancedIndirect_impl, + "mov (%rcx),%eax\n\t" /* version */ + "cmp $4,%eax\n\t" + "jge 1f\n\t" + "jmp " __ASM_NAME("agsDriverExtensionsDX11_MultiDrawInstancedIndirect_520") "\n\t" + "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_MultiDrawInstancedIndirect") ) + + AGSReturnCode WINAPI agsDriverExtensionsDX11_DestroyDevice_520(AGSContext *context, ID3D11Device* device, unsigned int *device_ref, ID3D11DeviceContext *device_context, unsigned int *context_ref) From 02d28499876ae9c91d0feffe80a9c4e84274968b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 22 Feb 2024 10:50:03 -0600 Subject: [PATCH 0529/2542] amd_ags_x64: Implement multi draw instanced indirect count functions. CW-Bug-Id: #22976 --- dlls/amd_ags_x64/amd_ags_x64.spec | 4 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 130 ++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 2 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index d308f2368790..670d6cec13e4 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -16,9 +16,9 @@ @ stub agsDriverExtensionsDX11_IASetPrimitiveTopology @ stdcall agsDriverExtensionsDX11_Init(ptr ptr long ptr) @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect() DX11_MultiDrawIndexedInstancedIndirect_impl -@ stub agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect +@ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect() DX11_MultiDrawIndexedInstancedIndirectCountIndirect_impl @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_MultiDrawInstancedIndirect() DX11_MultiDrawInstancedIndirect_impl -@ stub agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect +@ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect() DX11_MultiDrawInstancedIndirectCountIndirect_impl @ stub agsDriverExtensionsDX11_NotifyResourceBeginAllAccess @ stub agsDriverExtensionsDX11_NotifyResourceEndAllAccess @ stub agsDriverExtensionsDX11_NotifyResourceEndWrites diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 968c885c64dc..9df895c9758f 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -1131,6 +1131,7 @@ static void get_dx11_extensions_supported(ID3D11Device *device, AGSDX11Extension extensions->depthBoundsTest = !!ID3D11VkExtDevice_GetExtensionSupport(ext_device, D3D11_VK_EXT_DEPTH_BOUNDS); extensions->uavOverlap = !!ID3D11VkExtDevice_GetExtensionSupport(ext_device, D3D11_VK_EXT_BARRIER_CONTROL); extensions->multiDrawIndirect = !!ID3D11VkExtDevice_GetExtensionSupport(ext_device, D3D11_VK_EXT_MULTI_DRAW_INDIRECT); + extensions->multiDrawIndirectCountIndirect = !!ID3D11VkExtDevice_GetExtensionSupport(ext_device, D3D11_VK_EXT_MULTI_DRAW_INDIRECT_COUNT); extensions->UAVOverlapDeferredContexts = extensions->uavOverlap; ID3D11VkExtDevice_Release(ext_device); @@ -1593,6 +1594,135 @@ __ASM_GLOBAL_FUNC( DX11_MultiDrawInstancedIndirect_impl, "jmp " __ASM_NAME("agsDriverExtensionsDX11_MultiDrawInstancedIndirect_520") "\n\t" "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_MultiDrawInstancedIndirect") ) +static unsigned int get_max_draw_count(ID3D11Buffer *args, unsigned int offset, unsigned int stride, unsigned int size) +{ + D3D11_BUFFER_DESC desc; + unsigned int count; + + ID3D11Buffer_GetDesc(args, &desc); + if (offset >= desc.ByteWidth) + { + WARN("offset %u, buffer size %u.\n", offset, desc.ByteWidth); + return 0; + } + count = (desc.ByteWidth - offset) / stride; + if (desc.ByteWidth - offset - count * stride >= size) + ++count; + if (!count) + WARN("zero count, buffer size %u, offset %u, stride %u, size %u.\n", desc.ByteWidth, offset, stride, size); + return count; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect(AGSContext *context, ID3D11DeviceContext *dx_context, + ID3D11Buffer *buffer_for_draw_count, unsigned int aligned_byte_offset_for_draw_count, ID3D11Buffer *buffer_for_args, + unsigned int aligned_byte_offset_for_args, unsigned int byte_stride_for_args) +{ + ID3D11VkExtContext *ext_context; + unsigned int max_draw_count; + + TRACE("context %p, dx_context %p, count buffer %p, offset %u, args buffer %p, offset %u, stride %u.\n", + context, dx_context, buffer_for_draw_count, aligned_byte_offset_for_draw_count, buffer_for_args, + aligned_byte_offset_for_args, byte_stride_for_args); + + if (!context || !dx_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + + if (!context->extensions.multiDrawIndirectCountIndirect) + return AGS_EXTENSION_NOT_SUPPORTED; + + if (FAILED(ID3D11DeviceContext_QueryInterface(dx_context, &IID_ID3D11VkExtContext, (void **)&ext_context))) + { + TRACE("No ID3D11VkExtContext.\n"); + return AGS_EXTENSION_NOT_SUPPORTED; + } + + max_draw_count = get_max_draw_count(buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args, sizeof(D3D11_DRAW_INDEXED_INSTANCED_INDIRECT_ARGS)); + ID3D11VkExtContext_MultiDrawIndexedIndirectCount(ext_context, max_draw_count, buffer_for_draw_count, aligned_byte_offset_for_draw_count, + buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args); + ID3D11VkExtContext_Release(ext_context); + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect_520(AGSContext *context, + ID3D11Buffer *buffer_for_draw_count, unsigned int aligned_byte_offset_for_draw_count, ID3D11Buffer *buffer_for_args, + unsigned int aligned_byte_offset_for_args, unsigned int byte_stride_for_args) +{ + if (!context || !context->d3d11_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + return agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect(context, context->d3d11_context, + buffer_for_draw_count, aligned_byte_offset_for_draw_count, + buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args); +} + +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); +__ASM_GLOBAL_FUNC( DX11_MultiDrawIndexedInstancedIndirectCountIndirect_impl, + "mov (%rcx),%eax\n\t" /* version */ + "cmp $4,%eax\n\t" + "jge 1f\n\t" + "jmp " __ASM_NAME("agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect_520") "\n\t" + "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect") ) + + +AGSReturnCode WINAPI agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect(AGSContext *context, ID3D11DeviceContext *dx_context, + ID3D11Buffer *buffer_for_draw_count, unsigned int aligned_byte_offset_for_draw_count, ID3D11Buffer *buffer_for_args, + unsigned int aligned_byte_offset_for_args, unsigned int byte_stride_for_args) +{ + ID3D11VkExtContext *ext_context; + unsigned int max_draw_count; + + TRACE("context %p, dx_context %p, count buffer %p, offset %u, args buffer %p, offset %u, stride %u.\n", + context, dx_context, buffer_for_draw_count, aligned_byte_offset_for_draw_count, buffer_for_args, + aligned_byte_offset_for_args, byte_stride_for_args); + + if (!context || !dx_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + + if (!context->extensions.multiDrawIndirectCountIndirect) + return AGS_EXTENSION_NOT_SUPPORTED; + + if (FAILED(ID3D11DeviceContext_QueryInterface(dx_context, &IID_ID3D11VkExtContext, (void **)&ext_context))) + { + TRACE("No ID3D11VkExtContext.\n"); + return AGS_EXTENSION_NOT_SUPPORTED; + } + + max_draw_count = get_max_draw_count(buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args, sizeof(D3D11_DRAW_INSTANCED_INDIRECT_ARGS)); + ID3D11VkExtContext_MultiDrawIndirectCount(ext_context, max_draw_count, buffer_for_draw_count, aligned_byte_offset_for_draw_count, + buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args); + ID3D11VkExtContext_Release(ext_context); + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect_520(AGSContext *context, + ID3D11Buffer *buffer_for_draw_count, unsigned int aligned_byte_offset_for_draw_count, ID3D11Buffer *buffer_for_args, + unsigned int aligned_byte_offset_for_args, unsigned int byte_stride_for_args) +{ + if (!context || !context->d3d11_context) + { + WARN("Invalid arguments.\n"); + return AGS_INVALID_ARGS; + } + return agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect(context, context->d3d11_context, + buffer_for_draw_count, aligned_byte_offset_for_draw_count, + buffer_for_args, aligned_byte_offset_for_args, byte_stride_for_args); +} + +C_ASSERT(AMD_AGS_VERSION_5_3_0 == 4); +__ASM_GLOBAL_FUNC( DX11_MultiDrawInstancedIndirectCountIndirect_impl, + "mov (%rcx),%eax\n\t" /* version */ + "cmp $4,%eax\n\t" + "jge 1f\n\t" + "jmp " __ASM_NAME("agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect_520") "\n\t" + "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect") ) AGSReturnCode WINAPI agsDriverExtensionsDX11_DestroyDevice_520(AGSContext *context, ID3D11Device* device, unsigned int *device_ref, ID3D11DeviceContext *device_context, From 5c7b500608f8658468a265cd0ae3066fa5c86a4e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 28 Feb 2024 11:41:41 -0600 Subject: [PATCH 0530/2542] amd_ags_x64: Support v3.2. CW-Bug-Id: #23474 --- dlls/amd_ags_x64/amd_ags.h | 17 ++++++++ dlls/amd_ags_x64/amd_ags_x64.spec | 3 ++ dlls/amd_ags_x64/amd_ags_x64_main.c | 67 +++++++++++++++++++++++++++-- 3 files changed, 83 insertions(+), 4 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index 8eab0732d5b1..0116a527ba5f 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -733,7 +733,24 @@ typedef union AGSConfiguration AGSConfiguration_520 agsConfiguration520; } AGSConfiguration; +struct AGSGPUInfo_320 +{ + int agsVersionMajor; // Major field of Major.Minor.Patch AGS version number + int agsVersionMinor; // Minor field of Major.Minor.Patch AGS version number + int agsVersionPatch; // Patch field of Major.Minor.Patch AGS version number + + ArchitectureVersion architectureVersion; // Set to Unknown if not AMD hardware + const char* adapterString; // The adapter name string. NULL if not AMD hardware + int deviceId; // The device id + int revisionId; // The revision id + + const char* driverVersion; // The driver package version + int iNumCUs; // Number of GCN compute units. Zero if not GCN + int iCoreClock; // core clock speed at 100% power in MHz + int iMemoryClock; // memory clock speed at 100% power in MHz + float fTFlops; // Teraflops of GPU. Zero if not GCN. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD +}; /// The top level GPU information returned from \ref agsInitialize struct AGSGPUInfo_403 diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index 670d6cec13e4..bbf1922135a5 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -2,18 +2,21 @@ @ stdcall agsDeInitialize(ptr) @ stdcall agsCheckDriverVersion(ptr long) @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_BeginUAVOverlap() DX11_BeginUAVOverlap_impl +@ stub agsDriverExtensions_IASetPrimitiveTopology @ stub agsDriverExtensionsDX11_CreateBuffer @ stdcall agsDriverExtensionsDX11_CreateDevice(ptr ptr ptr ptr) @ stub agsDriverExtensionsDX11_CreateFromDevice @ stub agsDriverExtensionsDX11_CreateTexture1D @ stub agsDriverExtensionsDX11_CreateTexture2D @ stub agsDriverExtensionsDX11_CreateTexture3D +@ stdcall agsDriverExtensions_DeInit(ptr) @ stdcall agsDriverExtensionsDX11_DeInit(ptr) @ stub agsDriverExtensionsDX11_Destroy @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_DestroyDevice() @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_EndUAVOverlap() DX11_EndUAVOverlap_impl @ stub agsDriverExtensionsDX11_GetMaxClipRects @ stub agsDriverExtensionsDX11_IASetPrimitiveTopology +@ stdcall agsDriverExtensions_Init(ptr ptr ptr) @ stdcall agsDriverExtensionsDX11_Init(ptr ptr long ptr) @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect() DX11_MultiDrawIndexedInstancedIndirect_impl @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect() DX11_MultiDrawIndexedInstancedIndirectCountIndirect_impl diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 9df895c9758f..8038050b774f 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -78,7 +78,7 @@ static const struct } amd_ags_info[AMD_AGS_VERSION_COUNT] = { - {AGS_MAKE_VERSION(4, 0, 0), AGS_MAKE_VERSION(4, 0, 3), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, + {AGS_MAKE_VERSION(3, 2, 0), AGS_MAKE_VERSION(4, 0, 3), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, {AGS_MAKE_VERSION(5, 0, 0), AGS_MAKE_VERSION(5, 0, 6), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, {AGS_MAKE_VERSION(5, 1, 1), AGS_MAKE_VERSION(5, 1, 1), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, {AGS_MAKE_VERSION(5, 2, 0), AGS_MAKE_VERSION(5, 2, 1), sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, @@ -368,13 +368,20 @@ static BOOL get_ags_version_from_resource(const WCHAR *filename, enum amd_ags_ve return TRUE; } -static enum amd_ags_version guess_version_from_exports(HMODULE hnative) +static enum amd_ags_version guess_version_from_exports(HMODULE hnative, int *ags_version) { /* Known DLL versions without version info: * - An update to AGS 5.4.1 included an amd_ags_x64.dll with no file version info; * - CoD: Modern Warfare Remastered (2017) ships dll without version info which is version 5.0.1 * (not tagged in AGSSDK history), compatible with 5.0.5. */ + if (GetProcAddress(hnative, "agsDriverExtensions_Init")) + { + /* agsGetEyefinityConfigInfo was deprecated in 4.0.0 */ + TRACE("agsDriverExtensions_Init found.\n"); + *ags_version = AGS_MAKE_VERSION(3, 2, 2); + return AMD_AGS_VERSION_4_0_3; + } if (GetProcAddress(hnative, "agsGetEyefinityConfigInfo")) { /* agsGetEyefinityConfigInfo was deprecated in 5.0.0 */ @@ -444,7 +451,7 @@ static enum amd_ags_version determine_ags_version(int *ags_version) goto done; } - ret = guess_version_from_exports(hnative); + ret = guess_version_from_exports(hnative, ags_version); done: if (!*ags_version) @@ -833,7 +840,47 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi return ret; } - if (object->version <= AMD_AGS_VERSION_4_0_3) + if (object->public_version <= AGS_MAKE_VERSION(3, 2, 2)) + { + /* Unfortunately it doesn't look sanely possible to distinguish 3.2.2 and 3.2.0 versions, while in + * 3.2.2 radeonSoftwareVersion was added in the middle of the structure. So fill the shorter one + * to avoid out of bound write. */ + struct AGSDeviceInfo_511 *devices = (struct AGSDeviceInfo_511 *)object->devices, *device; + struct AGSGPUInfo_320 *info = (struct AGSGPUInfo_320 *)gpu_info; + unsigned int i; + + TRACE("filling AGSGPUInfo_320.\n"); + if (!object->device_count) + { + ERR("No devices.\n"); + agsDeInit(object); + return AGS_FAILURE; + } + + for (i = 0; i < object->device_count; ++i) + if (devices[i].isPrimaryDevice) + break; + if (i == object->device_count) + { + WARN("No primary device, using first.\n"); + i = 0; + } + device = &devices[i]; + memset(info, 0, sizeof(*info)); + info->agsVersionMajor = AGS_VER_MAJOR(object->public_version); + info->agsVersionMinor = AGS_VER_MINOR(object->public_version); + info->agsVersionPatch = AGS_VER_PATCH(object->public_version); + info->architectureVersion = device->architectureVersion; + info->adapterString = device->adapterString; + info->deviceId = device->deviceId; + info->revisionId = device->revisionId; + info->driverVersion = driver_version; + info->iNumCUs = device->numCUs; + info->iCoreClock = device->coreClock; + info->iMemoryClock = device->memoryClock; + info->fTFlops = device->teraFlops; + } + else if (object->version <= AMD_AGS_VERSION_4_0_3) { struct AGSDeviceInfo_511 *devices = (struct AGSDeviceInfo_511 *)object->devices, *device; struct AGSGPUInfo_403 *info = (struct AGSGPUInfo_403 *)gpu_info; @@ -1307,6 +1354,13 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_Init( AGSContext *context, ID3D11De return AGS_SUCCESS; } +AGSReturnCode WINAPI agsDriverExtensions_Init( AGSContext* context, ID3D11Device* device, unsigned int* extensionsSupported ) +{ + TRACE("context %p, device %p, extensionsSupported %p.\n", context, device, extensionsSupported); + + return agsDriverExtensionsDX11_Init(context, device, ~0u, extensionsSupported); +} + AGSReturnCode WINAPI agsDriverExtensionsDX11_DeInit( AGSContext* context ) { TRACE("context %p.\n", context); @@ -1320,6 +1374,11 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_DeInit( AGSContext* context ) return AGS_SUCCESS; } +AGSReturnCode WINAPI agsDriverExtensions_DeInit(AGSContext *context) +{ + return agsDriverExtensionsDX11_DeInit(context); +} + AGSReturnCode WINAPI agsDriverExtensionsDX12_Init( AGSContext* context, ID3D12Device* device, unsigned int* extensionsSupported ) { FIXME("context %p, device %p, extensionsSupported %p stub.\n", context, device, extensionsSupported); From c25d505215b3050685e3b30a55c43237e3230187 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 28 Feb 2024 14:08:00 -0600 Subject: [PATCH 0531/2542] amd_ags_x64: Support versions 3.0-3.1. CW-Bug-Id: #23474 --- dlls/amd_ags_x64/amd_ags.h | 15 +++++++ dlls/amd_ags_x64/amd_ags_x64.spec | 1 + dlls/amd_ags_x64/amd_ags_x64_main.c | 68 +++++++++++++++++++++++++++-- 3 files changed, 81 insertions(+), 3 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags.h b/dlls/amd_ags_x64/amd_ags.h index 0116a527ba5f..f6e50cad8f32 100644 --- a/dlls/amd_ags_x64/amd_ags.h +++ b/dlls/amd_ags_x64/amd_ags.h @@ -733,6 +733,21 @@ typedef union AGSConfiguration AGSConfiguration_520 agsConfiguration520; } AGSConfiguration; +struct AGSGPUInfo_311 +{ + ArchitectureVersion version; // Set to Unknown if not AMD hardware + const char* adapterString; // The adapter name string. NULL if not AMD hardware + int deviceId; // The device id + int revisionId; // The revision id + + const char* driverVersion; // The driver package version + + int iNumCUs; // Number of GCN compute units. Zero if not GCN + int iCoreClock; // core clock speed at 100% power in MHz + int iMemoryClock; // memory clock speed at 100% power in MHz + float fTFlops; // Teraflops of GPU. Zero if not GCN. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD +}; + struct AGSGPUInfo_320 { int agsVersionMajor; // Major field of Major.Minor.Patch AGS version number diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index bbf1922135a5..d4d86db800ad 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -49,3 +49,4 @@ @ stdcall agsGetTotalGPUCount(ptr ptr) @ stdcall agsGetGPUMemorySize(ptr long ptr) @ stdcall agsGetEyefinityConfigInfo(ptr long ptr ptr ptr) +@ stdcall agsDriverExtensions_SetCrossfireMode(ptr long) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 8038050b774f..22042b95b5f6 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -78,7 +78,7 @@ static const struct } amd_ags_info[AMD_AGS_VERSION_COUNT] = { - {AGS_MAKE_VERSION(3, 2, 0), AGS_MAKE_VERSION(4, 0, 3), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, + {AGS_MAKE_VERSION(3, 1, 0), AGS_MAKE_VERSION(4, 0, 3), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, {AGS_MAKE_VERSION(5, 0, 0), AGS_MAKE_VERSION(5, 0, 6), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, {AGS_MAKE_VERSION(5, 1, 1), AGS_MAKE_VERSION(5, 1, 1), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, {AGS_MAKE_VERSION(5, 2, 0), AGS_MAKE_VERSION(5, 2, 1), sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, @@ -375,6 +375,13 @@ static enum amd_ags_version guess_version_from_exports(HMODULE hnative, int *ags * - CoD: Modern Warfare Remastered (2017) ships dll without version info which is version 5.0.1 * (not tagged in AGSSDK history), compatible with 5.0.5. */ + if (GetProcAddress(hnative, "agsDriverExtensions_SetCrossfireMode")) + { + /* agsDriverExtensions_SetCrossfireMode was deprecated in 3.2.0 */ + TRACE("agsDriverExtensions_SetCrossfireMode found.\n"); + *ags_version = AGS_MAKE_VERSION(3, 1, 1); + return AMD_AGS_VERSION_4_0_3; + } if (GetProcAddress(hnative, "agsDriverExtensions_Init")) { /* agsGetEyefinityConfigInfo was deprecated in 4.0.0 */ @@ -825,7 +832,7 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi TRACE("context %p, config %p, gpu_info %p.\n", context, config, gpu_info); - if (!context || !gpu_info) + if (!context) return AGS_INVALID_ARGS; if (config) @@ -840,7 +847,46 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi return ret; } - if (object->public_version <= AGS_MAKE_VERSION(3, 2, 2)) + if (object->public_version <= AGS_MAKE_VERSION(3, 1, 1)) + { + /* Unfortunately it doesn't look sanely possible to distinguish 3.1.1 and 3.1.0 versions, while in + * 3.1.0 radeonSoftwareVersion was present, removed in 3.1.1 and brought back in 3.2.2. */ + struct AGSDeviceInfo_511 *devices = (struct AGSDeviceInfo_511 *)object->devices, *device; + /* config parameter was added in 3.2.0, so gpu_info is actually the second parameter. */ + struct AGSGPUInfo_311 *info = (struct AGSGPUInfo_311 *)config; + unsigned int i; + + if (!info) + return AGS_INVALID_ARGS; + + TRACE("filling AGSGPUInfo_311.\n"); + if (!object->device_count) + { + ERR("No devices.\n"); + agsDeInit(object); + return AGS_FAILURE; + } + + for (i = 0; i < object->device_count; ++i) + if (devices[i].isPrimaryDevice) + break; + if (i == object->device_count) + { + WARN("No primary device, using first.\n"); + i = 0; + } + device = &devices[i]; + memset(info, 0, sizeof(*info)); + info->adapterString = device->adapterString; + info->deviceId = device->deviceId; + info->revisionId = device->revisionId; + info->driverVersion = driver_version; + info->iNumCUs = device->numCUs; + info->iCoreClock = device->coreClock; + info->iMemoryClock = device->memoryClock; + info->fTFlops = device->teraFlops; + } + else if (object->public_version <= AGS_MAKE_VERSION(3, 2, 2)) { /* Unfortunately it doesn't look sanely possible to distinguish 3.2.2 and 3.2.0 versions, while in * 3.2.2 radeonSoftwareVersion was added in the middle of the structure. So fill the shorter one @@ -849,6 +895,9 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi struct AGSGPUInfo_320 *info = (struct AGSGPUInfo_320 *)gpu_info; unsigned int i; + if (!gpu_info) + return AGS_INVALID_ARGS; + TRACE("filling AGSGPUInfo_320.\n"); if (!object->device_count) { @@ -886,6 +935,9 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi struct AGSGPUInfo_403 *info = (struct AGSGPUInfo_403 *)gpu_info; unsigned int i; + if (!gpu_info) + return AGS_INVALID_ARGS; + if (!object->device_count) { ERR("No devices.\n"); @@ -919,6 +971,9 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi } else { + if (!gpu_info) + return AGS_INVALID_ARGS; + memset(gpu_info, 0, sizeof(*gpu_info)); gpu_info->agsVersionMajor = AGS_VER_MAJOR(object->public_version); gpu_info->agsVersionMinor = AGS_VER_MINOR(object->public_version); @@ -1361,6 +1416,13 @@ AGSReturnCode WINAPI agsDriverExtensions_Init( AGSContext* context, ID3D11Device return agsDriverExtensionsDX11_Init(context, device, ~0u, extensionsSupported); } +AGSReturnCode WINAPI agsDriverExtensions_SetCrossfireMode(AGSContext *context, AGSCrossfireMode mode) +{ + FIXME("context %p, mode %d stub.\n", context, mode); + + return AGS_SUCCESS; +} + AGSReturnCode WINAPI agsDriverExtensionsDX11_DeInit( AGSContext* context ) { TRACE("context %p.\n", context); From f73d6bc1168cb398115b53ba60fd9d88820ebc49 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 28 Feb 2024 14:43:55 -0600 Subject: [PATCH 0532/2542] amd_ags_x64: Add agsDriverExtensionsDX11_SetDiskShaderCacheEnabled() stub. CW-Bug-Id: #23474 --- dlls/amd_ags_x64/amd_ags_x64.spec | 2 +- dlls/amd_ags_x64/amd_ags_x64_main.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index d4d86db800ad..bf3485a25f05 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -28,7 +28,7 @@ @ stub agsDriverExtensionsDX11_NumPendingAsyncCompileJobs @ stub agsDriverExtensionsDX11_SetClipRects @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_SetDepthBounds() DX11_SetDepthBounds_impl -@ stub agsDriverExtensionsDX11_SetDiskShaderCacheEnabled +@ stdcall agsDriverExtensionsDX11_SetDiskShaderCacheEnabled(ptr long) @ stub agsDriverExtensionsDX11_SetMaxAsyncCompileThreadCount @ stub agsDriverExtensionsDX11_SetViewBroadcastMasks @ stub agsDriverExtensionsDX11_WriteBreadcrumb diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 22042b95b5f6..6f2ded46546a 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -1892,3 +1892,9 @@ __ASM_GLOBAL_FUNC( agsDriverExtensionsDX11_DestroyDevice, "jmp " __ASM_NAME("agsDriverExtensionsDX11_DestroyDevice_511") "\n\t" "1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_DestroyDevice_520") ) #endif + +AGSReturnCode WINAPI agsDriverExtensionsDX11_SetDiskShaderCacheEnabled(AGSContext *context, int enable) +{ + FIXME("context %p, enable %d stub.\n", context, enable); + return AGS_SUCCESS; +} From 8e6e9c6efe2c34fa56e6f6e3c9f6213c5ef1c4c1 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 29 Feb 2024 22:21:25 -0600 Subject: [PATCH 0533/2542] amd_ags_x64: Add spec stubs for some v3.x functions. CW-Bug-Id: #23474 --- dlls/amd_ags_x64/amd_ags_x64.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index bf3485a25f05..8c1392d70335 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -4,11 +4,15 @@ @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_BeginUAVOverlap() DX11_BeginUAVOverlap_impl @ stub agsDriverExtensions_IASetPrimitiveTopology @ stub agsDriverExtensionsDX11_CreateBuffer +@ stub agsDriverExtensions_CreateBuffer @ stdcall agsDriverExtensionsDX11_CreateDevice(ptr ptr ptr ptr) @ stub agsDriverExtensionsDX11_CreateFromDevice @ stub agsDriverExtensionsDX11_CreateTexture1D @ stub agsDriverExtensionsDX11_CreateTexture2D @ stub agsDriverExtensionsDX11_CreateTexture3D +@ stub agsDriverExtensions_CreateTexture1D +@ stub agsDriverExtensions_CreateTexture2D +@ stub agsDriverExtensions_CreateTexture3D @ stdcall agsDriverExtensions_DeInit(ptr) @ stdcall agsDriverExtensionsDX11_DeInit(ptr) @ stub agsDriverExtensionsDX11_Destroy @@ -25,6 +29,9 @@ @ stub agsDriverExtensionsDX11_NotifyResourceBeginAllAccess @ stub agsDriverExtensionsDX11_NotifyResourceEndAllAccess @ stub agsDriverExtensionsDX11_NotifyResourceEndWrites +@ stub agsDriverExtensions_NotifyResourceBeginAllAccess +@ stub agsDriverExtensions_NotifyResourceEndAllAccess +@ stub agsDriverExtensions_NotifyResourceEndWrites @ stub agsDriverExtensionsDX11_NumPendingAsyncCompileJobs @ stub agsDriverExtensionsDX11_SetClipRects @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_SetDepthBounds() DX11_SetDepthBounds_impl From 65b8dd16a21da127c54761ef24785b8c39d967c6 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 4 Mar 2024 12:28:48 -0600 Subject: [PATCH 0534/2542] amd_ags_x64: Add WINE_HIDE_APU option. CW-Bug-Id: #23489 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 6f2ded46546a..a8e3ddbd08b8 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -710,6 +710,20 @@ static void init_device_displays_511(const char *adapter_name, AGSDisplayInfo_51 heap_free(displays); } +static int hide_apu(void) +{ + static int cached = -1; + + if (cached == -1) + { + const char *s; + + cached = ((s = getenv("WINE_HIDE_APU"))) && *s != '0'; + if (cached) + FIXME("hack: hiding APU.\n"); + } + return cached; +} static AGSReturnCode init_ags_context(AGSContext *context, int ags_version) { @@ -784,7 +798,7 @@ static AGSReturnCode init_ags_context(AGSContext *context, int ags_version) { SET_DEVICE_FIELD(device, asicFamily, AsicFamily, context->version, AsicFamily_GCN4); } - if (vk_properties->deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU) + if (vk_properties->deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU && !hide_apu()) { if (context->version >= AMD_AGS_VERSION_6_0_0) device_600->isAPU = 1; From 30ee468ded368b216185fff720054b8b61012c4d Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 4 Mar 2024 16:23:06 -0600 Subject: [PATCH 0535/2542] amd_ags_x64: Add stub implementation for DX12 marker functions. CW-Bug-Id: #23474 --- dlls/amd_ags_x64/amd_ags_x64.spec | 6 +++--- dlls/amd_ags_x64/amd_ags_x64_main.c | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index 8c1392d70335..b29dc6d759d4 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -45,9 +45,9 @@ @ stub agsDriverExtensionsDX12_Destroy @ stdcall agsDriverExtensionsDX12_DestroyDevice(ptr ptr ptr) @ stdcall agsDriverExtensionsDX12_Init(ptr ptr ptr) -@ stub agsDriverExtensionsDX12_PopMarker -@ stub agsDriverExtensionsDX12_PushMarker -@ stub agsDriverExtensionsDX12_SetMarker +@ stdcall agsDriverExtensionsDX12_PopMarker(ptr ptr) +@ stdcall agsDriverExtensionsDX12_PushMarker(ptr ptr ptr) +@ stdcall agsDriverExtensionsDX12_SetMarker(ptr ptr ptr) @ stdcall agsGetCrossfireGPUCount(ptr ptr) @ stdcall agsGetVersionNumber() @ stdcall agsInit(ptr ptr ptr) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index a8e3ddbd08b8..2bdb7ea4bc6c 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -1470,6 +1470,27 @@ AGSReturnCode WINAPI agsDriverExtensionsDX12_DeInit( AGSContext* context ) return AGS_SUCCESS; } +AGSReturnCode WINAPI agsDriverExtensionsDX12_SetMarker( AGSContext *context, ID3D12GraphicsCommandList *command_list, const char *data) +{ + WARN("context %p, command_list %p, data %p stub.\n", context, command_list, data); + + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX12_PushMarker( AGSContext *context, ID3D12GraphicsCommandList *command_list, const char* data) +{ + WARN("context %p, command_list %p, data %p stub.\n", context, command_list, data); + + return AGS_SUCCESS; +} + +AGSReturnCode WINAPI agsDriverExtensionsDX12_PopMarker(AGSContext *context, ID3D12GraphicsCommandList *command_list) +{ + WARN("context %p, command_list %p stub.\n", context, command_list); + + return AGS_SUCCESS; +} + BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) { TRACE("%p, %u, %p.\n", instance, reason, reserved); From 3f00925f8e80c1101d58fbd5c0d6401d905c1a8d Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 13 Mar 2024 11:55:42 -0600 Subject: [PATCH 0536/2542] amd_ags_x64: Do not fail context creation for NULL output GPU info. CW-Bug-Id: #23474 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 2bdb7ea4bc6c..1d48fbc0ed2e 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -871,7 +871,7 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi unsigned int i; if (!info) - return AGS_INVALID_ARGS; + goto done; TRACE("filling AGSGPUInfo_311.\n"); if (!object->device_count) @@ -910,7 +910,7 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi unsigned int i; if (!gpu_info) - return AGS_INVALID_ARGS; + goto done; TRACE("filling AGSGPUInfo_320.\n"); if (!object->device_count) @@ -950,7 +950,7 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi unsigned int i; if (!gpu_info) - return AGS_INVALID_ARGS; + goto done; if (!object->device_count) { @@ -986,7 +986,7 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi else { if (!gpu_info) - return AGS_INVALID_ARGS; + goto done; memset(gpu_info, 0, sizeof(*gpu_info)); gpu_info->agsVersionMajor = AGS_VER_MAJOR(object->public_version); @@ -998,6 +998,7 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi gpu_info->devices = object->devices; } +done: TRACE("Created context %p.\n", object); *context = object; @@ -1012,7 +1013,7 @@ AGSReturnCode WINAPI agsInitialize(int ags_version, const AGSConfiguration *conf TRACE("ags_verison %d, context %p, config %p, gpu_info %p.\n", ags_version, context, config, gpu_info); - if (!context || !gpu_info) + if (!context) return AGS_INVALID_ARGS; if (config) @@ -1027,11 +1028,14 @@ AGSReturnCode WINAPI agsInitialize(int ags_version, const AGSConfiguration *conf return ret; } - memset(gpu_info, 0, sizeof(*gpu_info)); - gpu_info->driverVersion = driver_version; - gpu_info->radeonSoftwareVersion = radeon_version; - gpu_info->numDevices = object->device_count; - gpu_info->devices = object->devices; + if (gpu_info) + { + memset(gpu_info, 0, sizeof(*gpu_info)); + gpu_info->driverVersion = driver_version; + gpu_info->radeonSoftwareVersion = radeon_version; + gpu_info->numDevices = object->device_count; + gpu_info->devices = object->devices; + } TRACE("Created context %p.\n", object); From 419d94fc2a0c4be2805335d432504277cd909e08 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 12 Jun 2024 12:29:20 -0600 Subject: [PATCH 0537/2542] amd_ags_x64: Check for NULL context in agsDriverExtensionsDX11_Init(). CW-Bug-Id: #23904 --- dlls/amd_ags_x64/amd_ags_x64_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 1d48fbc0ed2e..387a13b41734 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -1407,6 +1407,12 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_Init( AGSContext *context, ID3D11De { FIXME("context %p, device %p, uavSlot %u, extensionsSupported %p stub.\n", context, device, uavSlot, extensionsSupported); + if (!context) + { + ERR("NULL context.\n"); + return AGS_INVALID_ARGS; + } + *extensionsSupported = 0; if (device) { From 0dc6936e70474ba9c144849722f00ad2cc59a183 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Sat, 28 Sep 2024 21:28:09 -0600 Subject: [PATCH 0538/2542] atiadlxx: Bump driver version to 99. CW-Bug-Id: #24315 --- dlls/atiadlxx/atiadlxx_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/atiadlxx/atiadlxx_main.c b/dlls/atiadlxx/atiadlxx_main.c index 8fdd2e55d029..9399025f94b2 100644 --- a/dlls/atiadlxx/atiadlxx_main.c +++ b/dlls/atiadlxx/atiadlxx_main.c @@ -172,15 +172,15 @@ typedef struct ADLDisplayMap } ADLDisplayMap, *LPADLDisplayMap; static const ADLVersionsInfo version = { - "23.19.02-230831a-396538C-AMD-Software-Adrenalin-Edition", + "99.19.02-230831a-396538C-AMD-Software-Adrenalin-Edition", "", "http://support.amd.com/drivers/xml/driver_09_us.xml", }; static const ADLVersionsInfoX2 version2 = { - "23.19.02-230831a-396538C-AMD-Software-Adrenalin-Edition", + "99.19.02-230831a-396538C-AMD-Software-Adrenalin-Edition", "", - "23.10.2", + "99.10.2", "http://support.amd.com/drivers/xml/driver_09_us.xml", }; From 77761485195ec2629a0c7ecea5dfca4d3e9bf465 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Sat, 28 Sep 2024 21:29:11 -0600 Subject: [PATCH 0539/2542] wine.inf: Enable builtin atiadlxx for FFXVI. CW-Bug-Id: #24315 --- loader/wine.inf.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index e409c0d86b3f..0bd0512e73e6 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2833,3 +2833,5 @@ HKCU,Software\Wine\AppDefaults\starwarssquadrons.exe\DllOverrides,"atiadlxx",,"b HKCU,Software\Wine\AppDefaults\GW2.Main_Win64_Retail.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\Spider-Man.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\RiftApart.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\ffxvi.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\ffxvi_demo.exe\DllOverrides,"atiadlxx",,"builtin" From 92d675268a06142cee4338fe85bcf04c414faba0 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 2 Oct 2024 13:48:43 -0600 Subject: [PATCH 0540/2542] amd_ags_x64: Alias some AGS 3.2 agsDriverExtensions_ functions. CW-Bug-Id: #24337 --- dlls/amd_ags_x64/amd_ags_x64.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index b29dc6d759d4..252d9aaf116c 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -1,6 +1,7 @@ @ stdcall agsDeInit(ptr) @ stdcall agsDeInitialize(ptr) @ stdcall agsCheckDriverVersion(ptr long) +@ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensions_BeginUAVOverlap() DX11_BeginUAVOverlap_impl @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_BeginUAVOverlap() DX11_BeginUAVOverlap_impl @ stub agsDriverExtensions_IASetPrimitiveTopology @ stub agsDriverExtensionsDX11_CreateBuffer @@ -17,13 +18,16 @@ @ stdcall agsDriverExtensionsDX11_DeInit(ptr) @ stub agsDriverExtensionsDX11_Destroy @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_DestroyDevice() +@ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensions_EndUAVOverlap() DX11_EndUAVOverlap_impl @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_EndUAVOverlap() DX11_EndUAVOverlap_impl @ stub agsDriverExtensionsDX11_GetMaxClipRects @ stub agsDriverExtensionsDX11_IASetPrimitiveTopology @ stdcall agsDriverExtensions_Init(ptr ptr ptr) @ stdcall agsDriverExtensionsDX11_Init(ptr ptr long ptr) +@ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensions_MultiDrawIndexedInstancedIndirect() DX11_MultiDrawIndexedInstancedIndirect_impl @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect() DX11_MultiDrawIndexedInstancedIndirect_impl @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect() DX11_MultiDrawIndexedInstancedIndirectCountIndirect_impl +@ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensions_MultiDrawInstancedIndirect() DX11_MultiDrawInstancedIndirect_impl @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_MultiDrawInstancedIndirect() DX11_MultiDrawInstancedIndirect_impl @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect() DX11_MultiDrawInstancedIndirectCountIndirect_impl @ stub agsDriverExtensionsDX11_NotifyResourceBeginAllAccess @@ -34,6 +38,7 @@ @ stub agsDriverExtensions_NotifyResourceEndWrites @ stub agsDriverExtensionsDX11_NumPendingAsyncCompileJobs @ stub agsDriverExtensionsDX11_SetClipRects +@ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensions_SetDepthBounds() DX11_SetDepthBounds_impl @ stdcall -norelay -arch=x86_64,arm64ec agsDriverExtensionsDX11_SetDepthBounds() DX11_SetDepthBounds_impl @ stdcall agsDriverExtensionsDX11_SetDiskShaderCacheEnabled(ptr long) @ stub agsDriverExtensionsDX11_SetMaxAsyncCompileThreadCount From bd9dc47bedf81a9f4984348b488347e529207822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 1 Dec 2023 21:24:14 +0100 Subject: [PATCH 0541/2542] vrclient: vulkan-1: Prefer builtin. Games that ship their own vulkan-1 will be broken with your VR wrappers. --- dlls/vulkan-1/Makefile.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/dlls/vulkan-1/Makefile.in b/dlls/vulkan-1/Makefile.in index 185d03d32aab..5b1b6eea6123 100644 --- a/dlls/vulkan-1/Makefile.in +++ b/dlls/vulkan-1/Makefile.in @@ -2,8 +2,6 @@ MODULE = vulkan-1.dll IMPORTS = user32 IMPORTLIB = vulkan-1 -EXTRADLLFLAGS = -Wb,--prefer-native - SOURCES = \ version.rc \ vulkan.c From 22c2e09f12165412725650f47f0b75cff0c15d95 Mon Sep 17 00:00:00 2001 From: Bitwolf <65789901+Bitwolfies@users.noreply.github.com> Date: Thu, 23 Feb 2023 13:05:59 -0800 Subject: [PATCH 0542/2542] wine.inf: Use included d3d8.dll with Bloodrayne Terminal Cut 1/2. Proton defaults to use the built-in DirectX 8 implementation but the game ships with it's own d3d8.dll which uses DirectX 9 internally. This helps with massive slowdowns and a few other misc bugs. LinK: https://github.com/ValveSoftware/wine/pull/179 --- loader/wine.inf.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 0bd0512e73e6..1163b335d07c 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2835,3 +2835,5 @@ HKCU,Software\Wine\AppDefaults\Spider-Man.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\RiftApart.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\ffxvi.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\ffxvi_demo.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\rayne1.exe\DllOverrides,"d3d8",,"native" +HKCU,Software\Wine\AppDefaults\rayne2.exe\DllOverrides,"d3d8",,"native" From c83e6c9fb677af5948db0e79e67be7025cfff963 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Mon, 24 Jul 2023 13:19:04 +0300 Subject: [PATCH 0543/2542] wine.inf.in: Use native vulkan-1 for RDR2. So we don't depend only on the app id and play manifest to have the game playable. --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 1163b335d07c..667a3546825a 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2837,3 +2837,4 @@ HKCU,Software\Wine\AppDefaults\ffxvi.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\ffxvi_demo.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\rayne1.exe\DllOverrides,"d3d8",,"native" HKCU,Software\Wine\AppDefaults\rayne2.exe\DllOverrides,"d3d8",,"native" +HKCU,Software\Wine\AppDefaults\RDR2.exe\DllOverrides,"vulkan-1",,"native" From 48cb2f91fa074f3371ef6a2671edc88d312155de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 1 Dec 2023 21:24:11 +0100 Subject: [PATCH 0544/2542] vrclient: wine.inf: Add OpenXR registry entries. --- loader/wine.inf.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 667a3546825a..d6746b69b50f 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -99,7 +99,8 @@ AddReg=\ Tapi,\ ThemeManager,\ VersionInfo,\ - LicenseInformation + LicenseInformation,\ + ProtonOverrides [DefaultInstall.ntamd64] RegisterDlls=RegisterDllsSection @@ -126,7 +127,8 @@ AddReg=\ Tapi,\ ThemeManager,\ VersionInfo,\ - LicenseInformation + LicenseInformation,\ + ProtonOverrides [DefaultInstall.ntarm64] RegisterDlls=RegisterDllsSection @@ -170,7 +172,8 @@ AddReg=\ SteamClient64,\ Tapi,\ VersionInfo,\ - LicenseInformation + LicenseInformation,\ + ProtonOverrides [Wow64Install.ntarm] RegisterDlls=RegisterDllsSection @@ -2838,3 +2841,4 @@ HKCU,Software\Wine\AppDefaults\ffxvi_demo.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\rayne1.exe\DllOverrides,"d3d8",,"native" HKCU,Software\Wine\AppDefaults\rayne2.exe\DllOverrides,"d3d8",,"native" HKCU,Software\Wine\AppDefaults\RDR2.exe\DllOverrides,"vulkan-1",,"native" +HKLM,Software\Khronos\OpenXR\1,"ActiveRuntime",,"C:\openxr\wineopenxr64.json" From 80bfeebe52b89db9647f8c221f2d21560a9be94f Mon Sep 17 00:00:00 2001 From: Liam Middlebrook Date: Mon, 11 Oct 2021 11:16:49 +0200 Subject: [PATCH 0545/2542] loader: Set default regkey for NVIDIA NGX FullPath Sets the default location for the NVIDIA NGX SDK search-path to be C:\Windows\System32\ This is required for supporting NVIDIA DLSS within Proton. Reviewed-by: Adam Moss --- loader/wine.inf.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index d6746b69b50f..a7de5c21d0c9 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -100,6 +100,7 @@ AddReg=\ ThemeManager,\ VersionInfo,\ LicenseInformation,\ + NVIDIANGX, \ ProtonOverrides [DefaultInstall.ntamd64] @@ -128,6 +129,7 @@ AddReg=\ ThemeManager,\ VersionInfo,\ LicenseInformation,\ + NVIDIANGX, \ ProtonOverrides [DefaultInstall.ntarm64] @@ -173,6 +175,7 @@ AddReg=\ Tapi,\ VersionInfo,\ LicenseInformation,\ + NVIDIANGX, \ ProtonOverrides [Wow64Install.ntarm] @@ -2784,6 +2787,9 @@ HKCU,Software\Valve\Steam\ActiveProcess,"SteamClientDll64",,"%16426%\Steam\steam HKCU,Software\Valve\Steam\ActiveProcess,"SteamPath",,"%16426%\Steam" HKLM,Software\Wow6432Node\Valve\Steam,"InstallPath",,"%16422%\Steam" +[NVIDIANGX] +HKLM,Software\NVIDIA Corporation\Global\NGXCore,"FullPath",,"C:\Windows\System32" + [ProtonOverrides] ;;Likely want *80 and *90 too, but those require removing Wine's manifest files. HKCU,Software\Wine\DllOverrides,"atl100",0x2,"native,builtin" From 7844f5ccec56649b80bf6e96f460906a513fcae2 Mon Sep 17 00:00:00 2001 From: Liam Middlebrook Date: Wed, 8 Sep 2021 11:30:28 -0700 Subject: [PATCH 0546/2542] nvcuda: Add stub DLL This is needed for DLSS versions 2.1.38 through 2.1.40 to work within Proton, as they contain a link-time dependency on nvcuda.dll. In the case of what is needed by DLSS, no ordinals need to be exported for nvcuda.dll to successfully load. Signed-off-by: Liam Middlebrook Link: https://github.com/ValveSoftware/wine/pull/119 --- configure.ac | 1 + dlls/nvcuda/Makefile.in | 1 + dlls/nvcuda/nvcuda.spec | 0 3 files changed, 2 insertions(+) create mode 100644 dlls/nvcuda/Makefile.in create mode 100644 dlls/nvcuda/nvcuda.spec diff --git a/configure.ac b/configure.ac index c06d90df065d..9a5d99cd1a13 100644 --- a/configure.ac +++ b/configure.ac @@ -2982,6 +2982,7 @@ WINE_CONFIG_MAKEFILE(dlls/ntoskrnl.exe) WINE_CONFIG_MAKEFILE(dlls/ntoskrnl.exe/tests) WINE_CONFIG_MAKEFILE(dlls/ntprint) WINE_CONFIG_MAKEFILE(dlls/ntprint/tests) +WINE_CONFIG_MAKEFILE(dlls/nvcuda) WINE_CONFIG_MAKEFILE(dlls/objsel) WINE_CONFIG_MAKEFILE(dlls/odbc32) WINE_CONFIG_MAKEFILE(dlls/odbc32/tests) diff --git a/dlls/nvcuda/Makefile.in b/dlls/nvcuda/Makefile.in new file mode 100644 index 000000000000..6890c798d63e --- /dev/null +++ b/dlls/nvcuda/Makefile.in @@ -0,0 +1 @@ +MODULE = nvcuda.dll diff --git a/dlls/nvcuda/nvcuda.spec b/dlls/nvcuda/nvcuda.spec new file mode 100644 index 000000000000..e69de29bb2d1 From 52c401612a5c11fad63d3860f1b3b7d38fde387b Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Mon, 10 Dec 2018 12:48:41 -0600 Subject: [PATCH 0547/2542] winepulse: Set PulseAudio application name property in the environment. So PA doesn't present all Wine applications as "wine-preloader", and allows PA to store per-application settings. --- dlls/winepulse.drv/pulse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c index 050609d2cda9..9cb29be21b62 100644 --- a/dlls/winepulse.drv/pulse.c +++ b/dlls/winepulse.drv/pulse.c @@ -404,6 +404,7 @@ static HRESULT pulse_connect(const char *name) pa_context_unref(pulse_ctx); pulse_ctx = pa_context_new(pa_mainloop_get_api(pulse_ml), name); + setenv("PULSE_PROP_application.name", name, 1); if (!pulse_ctx) { ERR("Failed to create context\n"); return E_FAIL; From f9bb038f8f0e98b9222fc3871f074eeb455a1f41 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Mon, 21 Mar 2022 14:02:30 -0500 Subject: [PATCH 0548/2542] msv1_0: Downgrade missing ntlm_auth message This appears in almost every log and is almost never actually a problem. --- dlls/msv1_0/unixlib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/msv1_0/unixlib.c b/dlls/msv1_0/unixlib.c index 95c92233b37a..54e7c1d56aff 100644 --- a/dlls/msv1_0/unixlib.c +++ b/dlls/msv1_0/unixlib.c @@ -48,7 +48,6 @@ #endif WINE_DEFAULT_DEBUG_CHANNEL(ntlm); -WINE_DECLARE_DEBUG_CHANNEL(winediag); #define INITIAL_BUFFER_SIZE 200 @@ -239,7 +238,7 @@ static NTSTATUS ntlm_check_version( void *args ) status = STATUS_SUCCESS; } - if (status) ERR_(winediag)( "ntlm_auth was not found. Make sure that ntlm_auth >= 3.0.25 is in your path. " + if (status) WARN( "ntlm_auth was not found. Make sure that ntlm_auth >= 3.0.25 is in your path. " "Usually, you can find it in the winbind package of your distribution.\n" ); ntlm_cleanup( &ctx ); return status; From 883caa3f39d2ac3258b7989b33d90ed55dfdec59 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 11 Oct 2021 11:17:19 +0200 Subject: [PATCH 0549/2542] wine.inf: Disable nvcuda.dll by default. The nvcuda.dll stub presence may cause regressions when the games successfully load and try to use it (like Divinity The Original Sin 2). The library is enabled in proton script together with nvapi.dll. Link: https://github.com/ValveSoftware/wine/pull/119 CW-Bug-Id: #23561 --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index a7de5c21d0c9..f00a4397f2a3 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2823,6 +2823,7 @@ HKCU,Software\Wine\DllOverrides,"ucrtbase",0x2,"native,builtin" HKCU,Software\Wine\DllOverrides,"vcomp140",0x2,"native,builtin" HKCU,Software\Wine\DllOverrides,"vcruntime140",0x2,"native,builtin" HKCU,Software\Wine\DllOverrides,"atiadlxx",,"disabled" +HKCU,Software\Wine\DllOverrides,"nvcuda",0x2,"disabled" HKCU,Software\Wine\DllOverrides,"vcruntime140_1",0x2,"native,builtin" HKCU,Software\Wine\AppDefaults\ShadowOfWar.exe\DllOverrides,"amd_ags_x64",,"disabled" ;;App-specific overrides for atiadlxx.dll. From d4084e9df45599b28a9d414423986f96770a1349 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 14 Jul 2020 15:00:34 +0300 Subject: [PATCH 0550/2542] ntdll: Support x86_64 syscall emulation. Wine-Staging: ntdll-Syscall_Emulation --- configure.ac | 1 + dlls/ntdll/unix/signal_x86_64.c | 196 ++++++++++++++++++++++++++++++++ 2 files changed, 197 insertions(+) diff --git a/configure.ac b/configure.ac index 9a5d99cd1a13..cbe4ef08479b 100644 --- a/configure.ac +++ b/configure.ac @@ -385,6 +385,7 @@ AC_CHECK_HEADERS(\ linux/ioctl.h \ linux/major.h \ linux/param.h \ + linux/seccomp.h \ linux/serial.h \ linux/types.h \ linux/ucdrom.h \ diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index aace1b59b035..62773544ee32 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -27,6 +27,7 @@ #include "config.h" #include +#include #include #include #include @@ -34,6 +35,8 @@ #include #include #include +#include +#include #include #ifdef HAVE_MACHINE_SYSARCH_H # include @@ -65,6 +68,14 @@ # include #endif +#if defined(HAVE_LINUX_FILTER_H) && defined(HAVE_LINUX_SECCOMP_H) && defined(HAVE_SYS_PRCTL_H) +#define HAVE_SECCOMP 1 +# include +# include +# include +# include +#endif + #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" @@ -1824,6 +1835,190 @@ static inline DWORD is_privileged_instr( CONTEXT *context ) return 0; } +#ifdef HAVE_SECCOMP +static void sigsys_handler( int signal, siginfo_t *siginfo, void *sigcontext ) +{ + extern const void *__wine_syscall_dispatcher_prolog_end_ptr; + struct syscall_frame *frame = amd64_thread_data()->syscall_frame; + ucontext_t *ctx = sigcontext; + + TRACE_(seh)("SIGSYS, rax %#llx, rip %#llx.\n", ctx->uc_mcontext.gregs[REG_RAX], + ctx->uc_mcontext.gregs[REG_RIP]); + + if (ctx->uc_mcontext.gregs[REG_RAX] == 0xffff) + { + /* Test syscall from the Unix side (install_bpf). */ + ctx->uc_mcontext.gregs[REG_RAX] = STATUS_INVALID_PARAMETER; + return; + } + + frame->rip = ctx->uc_mcontext.gregs[REG_RIP] + 0xb; + frame->rcx = ctx->uc_mcontext.gregs[REG_RIP]; + frame->eflags = ctx->uc_mcontext.gregs[REG_EFL]; + frame->restore_flags = 0; + if (instrumentation_callback) frame->restore_flags |= RESTORE_FLAGS_INSTRUMENTATION; + ctx->uc_mcontext.gregs[REG_RCX] = (ULONG_PTR)frame; + ctx->uc_mcontext.gregs[REG_R11] = frame->eflags; + if (ctx->uc_mcontext.gregs[REG_EFL] & 0x100) + { + ctx->uc_mcontext.gregs[REG_EFL] &= ~0x100; /* clear single-step flag */ + frame->restore_flags |= CONTEXT_CONTROL; + } + ctx->uc_mcontext.gregs[REG_RIP] = (ULONG64)__wine_syscall_dispatcher_prolog_end_ptr; +} +#endif + +#ifdef HAVE_SECCOMP +static int sc_seccomp(unsigned int operation, unsigned int flags, void *args) +{ +#ifndef __NR_seccomp +# define __NR_seccomp 317 +#endif + return syscall(__NR_seccomp, operation, flags, args); +} +#endif + +static void check_bpf_jit_enable(void) +{ + char enabled; + int fd; + + fd = open("/proc/sys/net/core/bpf_jit_enable", O_RDONLY); + if (fd == -1) + { + WARN_(seh)("Could not open /proc/sys/net/core/bpf_jit_enable.\n"); + return; + } + + if (read(fd, &enabled, sizeof(enabled)) == sizeof(enabled)) + { + TRACE_(seh)("enabled %#x.\n", enabled); + + if (enabled != '1') + ERR_(seh)("BPF JIT is not enabled in the kernel, enable it to reduce syscall emulation overhead.\n"); + } + else + { + WARN_(seh)("Could not read /proc/sys/net/core/bpf_jit_enable.\n"); + } + close(fd); +} + +static void install_bpf(struct sigaction *sig_act) +{ +#ifdef HAVE_SECCOMP +# ifndef SECCOMP_FILTER_FLAG_SPEC_ALLOW +# define SECCOMP_FILTER_FLAG_SPEC_ALLOW (1UL << 2) +# endif + +# ifndef SECCOMP_SET_MODE_FILTER +# define SECCOMP_SET_MODE_FILTER 1 +# endif + static const BYTE syscall_trap_test[] = + { + 0x48, 0x89, 0xf8, /* mov %rdi, %rax */ + 0x0f, 0x05, /* syscall */ + 0xc3, /* retq */ + }; + static const unsigned int flags = SECCOMP_FILTER_FLAG_SPEC_ALLOW; + +#define NATIVE_SYSCALL_ADDRESS_START 0x700000000000 + + static struct sock_filter filter[] = + { + BPF_STMT(BPF_LD | BPF_W | BPF_ABS, offsetof(struct seccomp_data, instruction_pointer) + 4), + /* Native libs are loaded at high addresses. */ + BPF_JUMP(BPF_JMP | BPF_JGT | BPF_K, NATIVE_SYSCALL_ADDRESS_START >> 32, 0, 1), + BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW), + /* Allow i386. */ + BPF_STMT(BPF_LD | BPF_W | BPF_ABS, offsetof(struct seccomp_data, arch)), + BPF_JUMP (BPF_JMP | BPF_JEQ | BPF_K, AUDIT_ARCH_X86_64, 1, 0), + BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW), + /* Allow wine64-preloader */ + BPF_STMT(BPF_LD | BPF_W | BPF_ABS, offsetof(struct seccomp_data, instruction_pointer)), + BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 0x7d400000, 1, 0), + BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_TRAP), + BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 0x7d402000, 0, 1), + BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_TRAP), + BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW), + }; + long (*test_syscall)(long sc_number); + struct syscall_frame *frame = amd64_thread_data()->syscall_frame; + struct sock_fprog prog; + NTSTATUS status; + + if ((ULONG_PTR)sc_seccomp < NATIVE_SYSCALL_ADDRESS_START + || (ULONG_PTR)syscall < NATIVE_SYSCALL_ADDRESS_START) + { + ERR_(seh)("Native libs are being loaded in low addresses, sc_seccomp %p, syscall %p, not installing seccomp.\n", + sc_seccomp, syscall); + ERR_(seh)("The known reasons are /proc/sys/vm/legacy_va_layout set to 1 or 'ulimit -s' being 'unlimited'.\n"); + return; + } + + sig_act->sa_sigaction = sigsys_handler; + memset(&prog, 0, sizeof(prog)); + + sigaction(SIGSYS, sig_act, NULL); + + frame->syscall_flags = syscall_flags; + + test_syscall = mmap((void *)0x600000000000, 0x1000, PROT_EXEC | PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANON, -1, 0); + if (test_syscall != (void *)0x600000000000) + { + int ret; + + ERR("Could not allocate test syscall, falling back to seccomp presence check, test_syscall %p, errno %d.\n", + test_syscall, errno); + if (test_syscall != MAP_FAILED) munmap(test_syscall, 0x1000); + + if ((ret = prctl(PR_GET_SECCOMP, 0, NULL, 0, 0))) + { + if (ret == 2) + TRACE_(seh)("Seccomp filters already installed.\n"); + else + ERR_(seh)("Seccomp filters cannot be installed, ret %d, error %s.\n", ret, strerror(errno)); + return; + } + } + else + { + memcpy(test_syscall, syscall_trap_test, sizeof(syscall_trap_test)); + status = test_syscall(0xffff); + munmap(test_syscall, 0x1000); + if (status == STATUS_INVALID_PARAMETER) + { + TRACE_(seh)("Seccomp filters already installed.\n"); + return; + } + if (status != -ENOSYS && (status != -1 || errno != ENOSYS)) + { + ERR_(seh)("Unexpected status %#x, errno %d.\n", status, errno); + return; + } + } + + TRACE_(seh)("Installing seccomp filters.\n"); + + prog.len = ARRAY_SIZE(filter); + prog.filter = filter; + + if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)) + { + ERR_(seh)("prctl(PR_SET_NO_NEW_PRIVS, ...): %s.\n", strerror(errno)); + return; + } + if (sc_seccomp(SECCOMP_SET_MODE_FILTER, flags, &prog)) + { + ERR_(seh)("prctl(PR_SET_SECCOMP, ...): %s.\n", strerror(errno)); + return; + } + check_bpf_jit_enable(); +#else + WARN_(seh)("Built without seccomp.\n"); +#endif +} /*********************************************************************** * handle_interrupt @@ -2571,6 +2766,7 @@ void signal_init_process(void) sig_act.sa_sigaction = sigsys_handler; if (sigaction( SIGSYS, &sig_act, NULL ) == -1) goto error; #endif + install_bpf(&sig_act); return; error: From 05e9ae58daf1677aa510a90626bae9b26969d449 Mon Sep 17 00:00:00 2001 From: Brendan Shanks Date: Sun, 10 Oct 2021 22:03:21 +0200 Subject: [PATCH 0551/2542] HACK: ntdll: Support x86_64 syscall emulation for Red Dead Redemption 2. CW-Bug-Id: #19085 --- dlls/ntdll/unix/signal_x86_64.c | 63 +++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 62773544ee32..3c71fc4b4fc8 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -1866,6 +1866,46 @@ static void sigsys_handler( int signal, siginfo_t *siginfo, void *sigcontext ) } ctx->uc_mcontext.gregs[REG_RIP] = (ULONG64)__wine_syscall_dispatcher_prolog_end_ptr; } + +/* syscall numbers are for Windows 10 2009 (build 19043) */ +static struct +{ + unsigned int win_syscall_nr; + unsigned int wine_syscall_nr; + void *function; +} +syscall_nr_translation[] = +{ + {0x19, ~0u, NtQueryInformationProcess}, + {0x36, ~0u, NtQuerySystemInformation}, + {0xf2, ~0u, NtGetContextThread}, + {0x55, ~0u, NtCreateFile}, + {0x08, ~0u, NtWriteFile}, + {0x06, ~0u, NtReadFile}, + {0x0f, ~0u, NtClose}, + {0x23, ~0u, NtQueryVirtualMemory}, +}; + +static void sigsys_handler_rdr2( int signal, siginfo_t *siginfo, void *sigcontext ) +{ + ucontext_t *ctx = sigcontext; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(syscall_nr_translation); ++i) + { + if (ctx->uc_mcontext.gregs[REG_RAX] == syscall_nr_translation[i].win_syscall_nr) + { + ctx->uc_mcontext.gregs[REG_RAX] = syscall_nr_translation[i].wine_syscall_nr; + sigsys_handler( signal, siginfo, sigcontext ); + return; + } + } + + if (ctx->uc_mcontext.gregs[REG_RAX] == 0xffff) + sigsys_handler( signal, siginfo, sigcontext ); + else + FIXME_(seh)("Unhandled syscall %#llx.\n", ctx->uc_mcontext.gregs[REG_RAX]); +} #endif #ifdef HAVE_SECCOMP @@ -1945,6 +1985,7 @@ static void install_bpf(struct sigaction *sig_act) long (*test_syscall)(long sc_number); struct syscall_frame *frame = amd64_thread_data()->syscall_frame; struct sock_fprog prog; + unsigned int i, j; NTSTATUS status; if ((ULONG_PTR)sc_seccomp < NATIVE_SYSCALL_ADDRESS_START @@ -1959,6 +2000,28 @@ static void install_bpf(struct sigaction *sig_act) sig_act->sa_sigaction = sigsys_handler; memset(&prog, 0, sizeof(prog)); + { + const char *sgi = getenv("SteamGameId"); + if (sgi && (!strcmp(sgi, "1174180") || !strcmp(sgi, "1404210"))) + { + /* Use specific signal handler. */ + sig_act->sa_sigaction = sigsys_handler_rdr2; + + for (i = 0; i < KeServiceDescriptorTable->ServiceLimit; ++i) + { + for (j = 0; j < ARRAY_SIZE(syscall_nr_translation); ++j) + if ((void *)KeServiceDescriptorTable->ServiceTable[i] == syscall_nr_translation[j].function) + { + syscall_nr_translation[j].wine_syscall_nr = i; + break; + } + } + + for (j = 0; j < ARRAY_SIZE(syscall_nr_translation); ++j) + assert( syscall_nr_translation[j].wine_syscall_nr != ~0u ); + } + } + sigaction(SIGSYS, sig_act, NULL); frame->syscall_flags = syscall_flags; From 388691d3c9711f6dc2a6548dbe775bf5a0878573 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 29 Sep 2021 14:39:06 +0300 Subject: [PATCH 0552/2542] wine.inf: Add ReleaseId and DisplayVersion to %CurrentVersionNT%. CW-Bug-Id: #19484 --- loader/wine.inf.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index f00a4397f2a3..1b6424883095 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2579,9 +2579,11 @@ HKLM,%CurrentVersionNT%,"DigitalProductId",2,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 +HKLM,%CurrentVersionNT%,"DisplayVersion",2,"21H1" HKLM,%CurrentVersionNT%,"EditionId",2,"Professional" HKLM,%CurrentVersionNT%,"InstallationType",2,"Client" HKLM,%CurrentVersionNT%,"ProductName",2,"Windows 10 Pro" +HKLM,%CurrentVersionNT%,"ReleaseId",,"2009" HKLM,%Control%\ProductOptions,"ProductType",2,"WinNT" HKLM,%Control%\Windows,"CSDVersion",0x10003,0 HKLM,%Control%\Session Manager\Environment,"OS",2,"Windows_NT" From d67f50296bbefbacfa0003e3868b3e381b5d6423 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 10 Nov 2021 20:30:40 +0300 Subject: [PATCH 0553/2542] wine.inf: HACK: Spoof Win81 for msedgewebview2.exe. A proper fix depends on other process window Vulkan rendering and Direct Compositing implementation. CW-Bug-ID: #19618 For FH5. --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 1b6424883095..03b1b862e69d 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2840,6 +2840,7 @@ HKCU,Software\Wine\AppDefaults\ShadowOfWar.exe\DllOverrides,"atiadlxx",,"builtin HKCU,Software\Wine\AppDefaults\DIRT5.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\gotg.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\RelicCardinal.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\msedgewebview2.exe,"Version",,"win81" HKCU,Software\Wine\AppDefaults\Avengers.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\starwarssquadrons.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\GW2.Main_Win64_Retail.exe\DllOverrides,"atiadlxx",,"builtin" From 8b1164d6ccba9be94d319b129568e2a8e2d69c36 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Fri, 25 Feb 2022 11:03:00 +0800 Subject: [PATCH 0554/2542] HACK: ntdll: Replace STATUS_NETWORK_UNREACHABLE with STATUS_SUCCESS in sock_send() for VRChat UDP sockets. On Windows, when resuming from sleep and network is temporarily unavailable but network adapters are still up, send() for UDP sockets sliently drop UDP packets and report STATUS_SUCCESS. On Linux, sendmsg() reports ENETUNREACH, which eventually translated to winsock error WSAENETUNREACH and make VRChat show an internal error message and hang. CW-Bug-Id: #20008 Signed-off-by: Zhiyi Zhang --- dlls/ntdll/unix/socket.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dlls/ntdll/unix/socket.c b/dlls/ntdll/unix/socket.c index a02194f843fb..74ff284e9208 100644 --- a/dlls/ntdll/unix/socket.c +++ b/dlls/ntdll/unix/socket.c @@ -154,6 +154,8 @@ struct async_transmit_ioctl LARGE_INTEGER offset; }; +static int get_sock_type( HANDLE handle ); + static NTSTATUS sock_errno_to_status( int err ) { switch (err) @@ -1052,6 +1054,21 @@ static NTSTATUS try_send( int fd, struct async_send_ioctl *async ) return STATUS_SUCCESS; } +static void hack_update_status( HANDLE handle, unsigned int *status ) +{ + /* HACK: VRChat relies on send() reporting STATUS_SUCCESS for dropped UDP sockets when the + * network is actually lost but network adapters are still up on Windows. Fix VRChat internal + * error bug when resuming from sleep */ + const char *appid; + + if (*status == STATUS_NETWORK_UNREACHABLE && get_sock_type( handle ) == SOCK_DGRAM + && (appid = getenv( "SteamAppId" )) && !strcmp( appid, "438100" )) + { + WARN( "Replacing STATUS_NETWORK_UNREACHABLE with STATUS_SUCCESS for VRChat.\n" ); + *status = STATUS_SUCCESS; + } +} + static BOOL async_send_proc( void *user, ULONG_PTR *info, unsigned int *status ) { struct async_send_ioctl *async = user; @@ -1067,6 +1084,7 @@ static BOOL async_send_proc( void *user, ULONG_PTR *info, unsigned int *status ) *status = try_send( fd, async ); TRACE( "got status %#x\n", *status ); + hack_update_status( async->io.handle, status ); if (needs_close) close( fd ); @@ -1132,6 +1150,8 @@ static NTSTATUS sock_send( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, voi if (status == STATUS_ALERTED) { status = try_send( fd, async ); + hack_update_status( handle, &status ); + if (status == STATUS_DEVICE_NOT_READY && ((server_flags & SERVER_SOCKET_IO_FORCE_ASYNC) || !nonblocking)) status = STATUS_PENDING; From 213ba804dcbb6a47f497c0564062bc2ad471d0df Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Mon, 11 Oct 2021 11:01:33 +0200 Subject: [PATCH 0555/2542] msctf: Use list to keep thread managers. Thread managers were stored in thread local storage, which have a major flaw that they can't not be released by another thread. CW-Bug-Id: #17086 Signed-off-by: Zhiyi Zhang --- dlls/msctf/msctf.c | 46 +++++++---------------- dlls/msctf/msctf_internal.h | 1 - dlls/msctf/threadmgr.c | 73 ++++++++++++++++++++++++++++++++----- 3 files changed, 76 insertions(+), 44 deletions(-) diff --git a/dlls/msctf/msctf.c b/dlls/msctf/msctf.c index e2dde836b12f..a79a32afc025 100644 --- a/dlls/msctf/msctf.c +++ b/dlls/msctf/msctf.c @@ -67,7 +67,6 @@ static UINT array_size; static struct list AtsList = LIST_INIT(AtsList); static UINT activated = 0; -DWORD tlsIndex = 0; TfClientId processId = 0; ITfCompartmentMgr *globalCompartmentMgr = NULL; @@ -394,23 +393,19 @@ HRESULT add_active_textservice(TF_LANGUAGEPROFILE *lp) ActivatedTextService *actsvr; ITfCategoryMgr *catmgr; AtsEntry *entry; - ITfThreadMgrEx *tm = TlsGetValue(tlsIndex); + ITfThreadMgr *tm; ITfClientId *clientid; - if (!tm) return E_UNEXPECTED; + if (FAILED(TF_GetThreadMgr(&tm))) return E_UNEXPECTED; actsvr = malloc(sizeof(ActivatedTextService)); - if (!actsvr) return E_OUTOFMEMORY; + if (!actsvr) goto fail; - ITfThreadMgrEx_QueryInterface(tm, &IID_ITfClientId, (void **)&clientid); + ITfThreadMgr_QueryInterface(tm, &IID_ITfClientId, (void **)&clientid); ITfClientId_GetClientId(clientid, &lp->clsid, &actsvr->tid); ITfClientId_Release(clientid); - if (!actsvr->tid) - { - free(actsvr); - return E_OUTOFMEMORY; - } + if (!actsvr->tid) goto fail; actsvr->pITfTextInputProcessor = NULL; actsvr->LanguageProfile = *lp; @@ -437,20 +432,21 @@ HRESULT add_active_textservice(TF_LANGUAGEPROFILE *lp) deactivate_remove_conflicting_ts(&actsvr->LanguageProfile.catid); if (activated > 0) - activate_given_ts(actsvr, tm); + activate_given_ts(actsvr, (ITfThreadMgrEx *)tm); entry = malloc(sizeof(AtsEntry)); - - if (!entry) - { - free(actsvr); - return E_OUTOFMEMORY; - } + if (!entry) goto fail; entry->ats = actsvr; list_add_head(&AtsList, &entry->entry); + ITfThreadMgr_Release(tm); return S_OK; + +fail: + ITfThreadMgr_Release(tm); + free(actsvr); + return E_OUTOFMEMORY; } BOOL get_active_textservice(REFCLSID rclsid, TF_LANGUAGEPROFILE *profile) @@ -554,11 +550,9 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID fImpLoad) switch (fdwReason) { case DLL_PROCESS_ATTACH: - tlsIndex = TlsAlloc(); break; case DLL_PROCESS_DETACH: if (fImpLoad) break; - TlsFree(tlsIndex); break; } return TRUE; @@ -592,20 +586,6 @@ HRESULT WINAPI TF_CreateThreadMgr(ITfThreadMgr **pptim) return ThreadMgr_Constructor(NULL,(IUnknown**)pptim); } -/*********************************************************************** - * TF_GetThreadMgr (MSCTF.@) - */ -HRESULT WINAPI TF_GetThreadMgr(ITfThreadMgr **pptim) -{ - TRACE("\n"); - *pptim = TlsGetValue(tlsIndex); - - if (*pptim) - ITfThreadMgr_AddRef(*pptim); - - return S_OK; -} - /*********************************************************************** * SetInputScope(MSCTF.@) */ diff --git a/dlls/msctf/msctf_internal.h b/dlls/msctf/msctf_internal.h index 24c8c017ff30..3696edf55000 100644 --- a/dlls/msctf/msctf_internal.h +++ b/dlls/msctf/msctf_internal.h @@ -36,7 +36,6 @@ #define COOKIE_MAGIC_INPUTPROCESSORPROFILEACTIVATIONSINK 0x00b0 #define COOKIE_MAGIC_ACTIVELANGSINK 0x00c0 -extern DWORD tlsIndex; extern TfClientId processId; extern ITfCompartmentMgr *globalCompartmentMgr; diff --git a/dlls/msctf/threadmgr.c b/dlls/msctf/threadmgr.c index 11c79c030fff..ff2b0b95ff77 100644 --- a/dlls/msctf/threadmgr.c +++ b/dlls/msctf/threadmgr.c @@ -37,6 +37,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(msctf); +static CRITICAL_SECTION ThreadMgrCs; +static CRITICAL_SECTION_DEBUG ThreadMgrCsDebug = +{ + 0, 0, &ThreadMgrCs, + {&ThreadMgrCsDebug.ProcessLocksList, + &ThreadMgrCsDebug.ProcessLocksList }, + 0, 0, {(DWORD_PTR)(__FILE__ ": ThreadMgrCs")} +}; +static CRITICAL_SECTION ThreadMgrCs = {&ThreadMgrCsDebug, -1, 0, 0, 0, 0}; +struct list ThreadMgrList = LIST_INIT(ThreadMgrList); + typedef struct tagPreservedKey { struct list entry; @@ -98,6 +109,9 @@ typedef struct tagACLMulti { struct list ThreadMgrEventSink; struct list UIElementSink; struct list InputProcessorProfileActivationSink; + + DWORD threadId; + struct list entry; } ThreadMgr; typedef struct tagEnumTfDocumentMgr { @@ -110,6 +124,11 @@ typedef struct tagEnumTfDocumentMgr { static HRESULT EnumTfDocumentMgr_Constructor(struct list* head, IEnumTfDocumentMgrs **ppOut); +static inline ThreadMgr *impl_from_ITfThreadMgr(ITfThreadMgr *iface) +{ + return CONTAINING_RECORD(iface, ThreadMgr, ITfThreadMgrEx_iface); +} + static inline ThreadMgr *impl_from_ITfThreadMgrEx(ITfThreadMgrEx *iface) { return CONTAINING_RECORD(iface, ThreadMgr, ITfThreadMgrEx_iface); @@ -155,6 +174,35 @@ static inline EnumTfDocumentMgr *impl_from_IEnumTfDocumentMgrs(IEnumTfDocumentMg return CONTAINING_RECORD(iface, EnumTfDocumentMgr, IEnumTfDocumentMgrs_iface); } +/*********************************************************************** + * TF_GetThreadMgr (MSCTF.@) + */ +HRESULT WINAPI TF_GetThreadMgr(ITfThreadMgr **pptim) +{ + DWORD id = GetCurrentThreadId(); + ThreadMgr *cursor; + + TRACE("%p\n", pptim); + + if (!pptim) + return E_INVALIDARG; + + EnterCriticalSection(&ThreadMgrCs); + LIST_FOR_EACH_ENTRY(cursor, &ThreadMgrList, ThreadMgr, entry) + { + if (cursor->threadId == id) + { + ITfThreadMgrEx_AddRef(&cursor->ITfThreadMgrEx_iface); + *pptim = (ITfThreadMgr *)&cursor->ITfThreadMgrEx_iface; + LeaveCriticalSection(&ThreadMgrCs); + return S_OK; + } + } + LeaveCriticalSection(&ThreadMgrCs); + *pptim = NULL; + return E_FAIL; +} + static void ThreadMgr_Destructor(ThreadMgr *This) { struct list *cursor, *cursor2; @@ -163,7 +211,9 @@ static void ThreadMgr_Destructor(ThreadMgr *This) if (This->focusHook) UnhookWindowsHookEx(This->focusHook); - TlsSetValue(tlsIndex,NULL); + EnterCriticalSection(&ThreadMgrCs); + list_remove(&This->entry); + LeaveCriticalSection(&ThreadMgrCs); TRACE("destroying %p\n", This); if (This->focus) ITfDocumentMgr_Release(This->focus); @@ -386,17 +436,20 @@ static HRESULT WINAPI ThreadMgr_SetFocus(ITfThreadMgrEx *iface, ITfDocumentMgr * static LRESULT CALLBACK ThreadFocusHookProc(int nCode, WPARAM wParam, LPARAM lParam) { + ITfThreadMgr *ThreadMgr_iface; ThreadMgr *This; - This = TlsGetValue(tlsIndex); - if (!This) + if (FAILED(TF_GetThreadMgr(&ThreadMgr_iface))) { ERR("Hook proc but no ThreadMgr for this thread. Serious Error\n"); return 0; } + + This = impl_from_ITfThreadMgr(ThreadMgr_iface); if (!This->focusHook) { ERR("Hook proc but no ThreadMgr focus Hook. Serious Error\n"); + ITfThreadMgr_Release(ThreadMgr_iface); return 0; } @@ -417,6 +470,7 @@ static LRESULT CALLBACK ThreadFocusHookProc(int nCode, WPARAM wParam, LPARAM lPa } } + ITfThreadMgr_Release(ThreadMgr_iface); return CallNextHookEx(This->focusHook, nCode, wParam, lParam); } @@ -1346,13 +1400,8 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) return CLASS_E_NOAGGREGATION; /* Only 1 ThreadMgr is created per thread */ - This = TlsGetValue(tlsIndex); - if (This) - { - ThreadMgr_AddRef(&This->ITfThreadMgrEx_iface); - *ppOut = (IUnknown*)&This->ITfThreadMgrEx_iface; + if (SUCCEEDED(TF_GetThreadMgr((ITfThreadMgr **)ppOut))) return S_OK; - } This = calloc(1, sizeof(ThreadMgr)); if (This == NULL) @@ -1367,7 +1416,6 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) This->ITfUIElementMgr_iface.lpVtbl = &ThreadMgrUIElementMgrVtbl; This->ITfSourceSingle_iface.lpVtbl = &SourceSingleVtbl; This->refCount = 1; - TlsSetValue(tlsIndex,This); CompartmentMgr_Constructor((IUnknown*)&This->ITfThreadMgrEx_iface, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr); @@ -1384,6 +1432,11 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) list_init(&This->UIElementSink); list_init(&This->InputProcessorProfileActivationSink); + This->threadId = GetCurrentThreadId(); + EnterCriticalSection(&ThreadMgrCs); + list_add_tail(&ThreadMgrList, &This->entry); + LeaveCriticalSection(&ThreadMgrCs); + TRACE("returning %p\n", This); *ppOut = (IUnknown *)&This->ITfThreadMgrEx_iface; return S_OK; From 340ca4864b87ff168302f00dcc930dbf68b4f372 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Fri, 22 Dec 2023 10:44:16 +0800 Subject: [PATCH 0556/2542] HACK: winegstreamer: Reduce Biomutant_Trailer.mp4 media source duration. Hack for bug 19766 - Biomutant (597820) [T5] Title Hangs After Intro Cut Scene Unless Skipped. Unreal Engine 4 games expect presentation clock correlated time to run past media source duration[1], which assumes that all streams in a media source have the same duration. Biomutant_Trailer.mp4 from Biomutant(597820) has a 1:27.734s video stream and a 1:27.776s audio stream so the media source duration is reported to be 1:27.776s. However, the game builds a topology that only uses the video stream. So the last presentation clock correlated time could be something before the media source duration 1:27.776s before it's stopped. In Unreal Engine 4.18 source, on every frame FWmfMediaSession::GetEvents()[2] checks "Time > CurrentDuration" to decide whether to stop its media session. With the time check fails, the game will hang forever waiting for the session to stop. This hack shortens the media source duration to satisfy the condition check. The reason why it works on Windows is probably due to a delay caused a busy CPU and different scheduling. [1][2]: UnrealEngine-4.18/Engine/Plugins/Media/WmfMedia/Source/WmfMedia/Private/Wmf/WmfMediaSession.cpp#FWmfMediaSession::GetEvents() CW-Bug-Id: #19766 --- dlls/winegstreamer/media_source.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index 88056b27c5dc..caaf8d16b96a 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -1786,6 +1786,28 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc object->stream_count++; } + /* Hack for bug 19766 - Biomutant (597820) [T5] Title Hangs After Intro Cut Scene Unless Skipped. + * + * Unreal Engine 4 games expect presentation clock correlated time to run past media source + * duration[1], which assumes that all streams in a media source have the same duration. + * Biomutant_Trailer.mp4 from Biomutant(597820) has a 1:27.734s video stream and a 1:27.776s + * audio stream so the media source duration is reported to be 1:27.776s. However, the game + * builds a topology that only uses the video stream. So the last presentation clock correlated + * time could be something before the media source duration 1:27.776s before it's stopped. In + * Unreal Engine 4.18 source, on every frame FWmfMediaSession::GetEvents()[2] checks + * "Time > CurrentDuration" to decide whether to stop its media session. With the time check + * fails, the game will hang forever waiting for the session to stop. This hack shortens the + * media source duration to satisfy the condition check. The reason why it works on Windows is + * probably due to a delay caused a busy CPU and different scheduling. + * + * [1][2]: UnrealEngine-4.18/Engine/Plugins/Media/WmfMedia/Source/WmfMedia/Private/Wmf/WmfMediaSession.cpp#FWmfMediaSession::GetEvents() + */ + { + const char *id = getenv("SteamGameId"); + if (id && !strcmp(id, "597820") && object->duration == 877760000) /* Biomutant_Trailer.mp4 */ + object->duration = 877340000; + } + media_source_init_descriptors(object); object->state = SOURCE_STOPPED; From 566f6d09496c5afa4df38ef8c9c45c3395613267 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Tue, 10 Dec 2024 10:51:11 +0800 Subject: [PATCH 0557/2542] HACK: gamescope: user32: Disable gamescope undecorated windows hack for The Last Game. The Last Game (2563800) doesn't expect its game window client rect equals to window rect. CW-Bug-Id: #23342 --- dlls/win32u/defwnd.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index 3bcc2d69c649..e203a0c8ca01 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -258,7 +258,15 @@ BOOL adjust_window_rect( RECT *rect, DWORD style, BOOL menu, DWORD ex_style, UIN NONCLIENTMETRICSW ncm = {.cbSize = sizeof(ncm)}; int adjust = 0; - if (user_driver->pHasWindowManager( "steamcompmgr" ) && !((style & WS_POPUP) && (ex_style & WS_EX_TOOLWINDOW))) return TRUE; + if (user_driver->pHasWindowManager( "steamcompmgr" )) + { + /* Disable gamescope undecorated windows hack for following games. They don't expect client + * rect equals to window rect when in windowed mode. */ + const char *sgi = getenv( "SteamGameId" ); + if (!((style & WS_POPUP) && (ex_style & WS_EX_TOOLWINDOW)) && /* Bug 20038: game splash screens */ + !(sgi && !strcmp( sgi, "2563800" ))) /* Bug 23342: The Last Game */ + return TRUE; + } NtUserSystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0, dpi ); @@ -1867,8 +1875,15 @@ static void handle_nc_calc_size( HWND hwnd, WPARAM wparam, RECT *win_rect ) if (!win_rect) return; - if (user_driver->pHasWindowManager( "steamcompmgr" ) && !((style & WS_POPUP) && (ex_style & WS_EX_TOOLWINDOW))) - return; + if (user_driver->pHasWindowManager( "steamcompmgr" )) + { + /* Disable gamescope undecorated windows hack for following games. They don't expect client + * rect equals to window rect when in windowed mode. */ + const char *sgi = getenv( "SteamGameId" ); + if (!((style & WS_POPUP) && (ex_style & WS_EX_TOOLWINDOW)) && /* Bug 20038: game splash screens */ + !(sgi && !strcmp( sgi, "2563800" ))) /* Bug 23342: The Last Game */ + return; + } if (!(style & WS_MINIMIZE)) { From dfcddc58d0d1f44d0e3de4d7268800da49ef259d Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 15 May 2024 17:29:38 -0600 Subject: [PATCH 0558/2542] win32u: Disable undecorated windows hack for Halo Infinite. CW-Bug-Id: #23802 --- dlls/win32u/defwnd.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index e203a0c8ca01..09c3930c6d94 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -263,8 +263,11 @@ BOOL adjust_window_rect( RECT *rect, DWORD style, BOOL menu, DWORD ex_style, UIN /* Disable gamescope undecorated windows hack for following games. They don't expect client * rect equals to window rect when in windowed mode. */ const char *sgi = getenv( "SteamGameId" ); - if (!((style & WS_POPUP) && (ex_style & WS_EX_TOOLWINDOW)) && /* Bug 20038: game splash screens */ - !(sgi && !strcmp( sgi, "2563800" ))) /* Bug 23342: The Last Game */ + if ( + !((style & WS_POPUP) && (ex_style & WS_EX_TOOLWINDOW)) /* Bug 20038: game splash screens */ + && !(sgi && !strcmp( sgi, "2563800" )) /* Bug 23342: The Last Game */ + && !(sgi && !strcmp( sgi, "1240440" )) /* Bug 23802: Halo Infinite */ + ) return TRUE; } @@ -1880,8 +1883,10 @@ static void handle_nc_calc_size( HWND hwnd, WPARAM wparam, RECT *win_rect ) /* Disable gamescope undecorated windows hack for following games. They don't expect client * rect equals to window rect when in windowed mode. */ const char *sgi = getenv( "SteamGameId" ); - if (!((style & WS_POPUP) && (ex_style & WS_EX_TOOLWINDOW)) && /* Bug 20038: game splash screens */ - !(sgi && !strcmp( sgi, "2563800" ))) /* Bug 23342: The Last Game */ + if (!((style & WS_POPUP) && (ex_style & WS_EX_TOOLWINDOW)) /* Bug 20038: game splash screens */ + && !(sgi && !strcmp( sgi, "2563800" )) /* Bug 23342: The Last Game */ + && !(sgi && !strcmp( sgi, "1240440" )) /* Bug 23802: Halo Infinite */ + ) return; } From f1b6562f1507047e021c75a56109983e756791c2 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 20 Aug 2024 17:46:40 -0600 Subject: [PATCH 0559/2542] win32u: Disable undecorated windows hack for Dog Brew. CW-Bug-Id: #24151 --- dlls/win32u/defwnd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index 09c3930c6d94..06b81254fc8f 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -1886,6 +1886,7 @@ static void handle_nc_calc_size( HWND hwnd, WPARAM wparam, RECT *win_rect ) if (!((style & WS_POPUP) && (ex_style & WS_EX_TOOLWINDOW)) /* Bug 20038: game splash screens */ && !(sgi && !strcmp( sgi, "2563800" )) /* Bug 23342: The Last Game */ && !(sgi && !strcmp( sgi, "1240440" )) /* Bug 23802: Halo Infinite */ + && !(sgi && !strcmp( sgi, "2883280" )) /* Bug 24151: Dog Brew */ ) return; } From d97fb4c3c25c7cd6d05fdea23f67654d45e59ced Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Tue, 10 Dec 2024 12:05:34 +0800 Subject: [PATCH 0560/2542] win32u: Implement D3DKMTQueryAdapterInfo WDDM_2_7_CAPS. Used by applications to query support for "Hardware Scheduling" for GPU workloads. This is used as a proxy to determine scheduling guarantees between userspace command submission and GPU execution. From: Liam Middlebrook Signed-off-by: Liam Middlebrook Link: https://github.com/ValveSoftware/wine/pull/259 --- dlls/win32u/d3dkmt.c | 59 ++++++++++++++++++++++++++++++++++++++++-- include/ddk/d3dkmthk.h | 14 ++++++++++ 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/dlls/win32u/d3dkmt.c b/dlls/win32u/d3dkmt.c index 24a668a85b42..6d4cab058ffa 100644 --- a/dlls/win32u/d3dkmt.c +++ b/dlls/win32u/d3dkmt.c @@ -333,10 +333,65 @@ NTSTATUS WINAPI NtGdiDdDDIDestroyDevice( const D3DKMT_DESTROYDEVICE *desc ) */ NTSTATUS WINAPI NtGdiDdDDIQueryAdapterInfo( D3DKMT_QUERYADAPTERINFO *desc ) { + NTSTATUS status = STATUS_NOT_IMPLEMENTED; + struct d3dkmt_adapter *adapter; + if (!desc) return STATUS_INVALID_PARAMETER; - FIXME( "desc %p, type %d stub\n", desc, desc->Type ); - return STATUS_NOT_IMPLEMENTED; + FIXME( "desc %p, type %d semi-stub\n", desc, desc->Type ); + + if (!d3dkmt_use_vulkan()) + { + WARN("Vulkan is unavailable.\n"); + return status; + } + + pthread_mutex_lock( &d3dkmt_lock ); + if ((adapter = find_adapter_from_handle( desc->hAdapter )) && adapter->vk_device) + { + if (desc->Type == KMTQAITYPE_WDDM_2_7_CAPS) + { + VkPhysicalDeviceDriverPropertiesKHR driverProperties; + VkPhysicalDeviceProperties2KHR properties2; + D3DKMT_WDDM_2_7_CAPS *data; + const char *e; + + memset( &driverProperties, 0, sizeof(driverProperties) ); + memset( &properties2, 0, sizeof(properties2) ); + driverProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR; + properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; + properties2.pNext = &driverProperties; + pvkGetPhysicalDeviceProperties2KHR( adapter->vk_device, &properties2 ); + + /* + * Advertise Hardware-Scheduling as enabled for NVIDIA Adapters. NVIDIA driver does + * userspace submission. Allow overriding this value via the + * WINE_DISABLE_HARDWARE_SCHEDULING environment variable. + */ + data = desc->pPrivateDriverData; + e = getenv( "WINE_DISABLE_HARDWARE_SCHEDULING" ); + if ((!e || *e == '\0' || *e == '0') && (driverProperties.driverID == VK_DRIVER_ID_NVIDIA_PROPRIETARY)) + { + data->HwSchEnabled = 1; + data->HwSchSupported = 1; + data->HwSchEnabledByDefault = 1; + } + else + { + data->HwSchEnabled = 0; + data->HwSchSupported = 0; + data->HwSchEnabledByDefault = 0; + } + + status = STATUS_SUCCESS; + } + else + { + FIXME("desc %p, type %d stub\n", desc, desc->Type); + } + } + pthread_mutex_unlock( &d3dkmt_lock ); + return status; } /****************************************************************************** diff --git a/include/ddk/d3dkmthk.h b/include/ddk/d3dkmthk.h index 7828941a9d64..bc9db78770a9 100644 --- a/include/ddk/d3dkmthk.h +++ b/include/ddk/d3dkmthk.h @@ -267,6 +267,20 @@ typedef struct _D3DKMT_QUERYADAPTERINFO UINT PrivateDriverDataSize; } D3DKMT_QUERYADAPTERINFO; +typedef struct _D3DKMT_WDDM_2_7_CAPS +{ + union { + struct { + UINT HwSchSupported : 1; + UINT HwSchEnabled : 1; + UINT HwSchEnabledByDefault : 1; + UINT IndependentVidPnVSyncControl : 1; + UINT Reserved : 28; + }; + UINT Value; + }; +} D3DKMT_WDDM_2_7_CAPS; + typedef enum _D3DKMT_QUERYRESULT_PREEMPTION_ATTEMPT_RESULT { D3DKMT_PreemptionAttempt = 0, From 2a0a25c8d6cbdb9697faf8857974b0060b5b76f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 5 Dec 2024 10:54:15 +0100 Subject: [PATCH 0561/2542] winegstreamer/media-converter: Rename payload_hash to fozdb_hash. --- .../winegstreamer/media-converter/audioconv.c | 24 +++++++------- .../winegstreamer/media-converter/fossilize.c | 32 +++++++++---------- .../media-converter/media-converter.h | 25 +++++++++------ .../winegstreamer/media-converter/videoconv.c | 28 ++++++++-------- 4 files changed, 58 insertions(+), 51 deletions(-) diff --git a/dlls/winegstreamer/media-converter/audioconv.c b/dlls/winegstreamer/media-converter/audioconv.c index 462cec16a8a6..5acce9a7915a 100644 --- a/dlls/winegstreamer/media-converter/audioconv.c +++ b/dlls/winegstreamer/media-converter/audioconv.c @@ -162,7 +162,7 @@ typedef enum struct buffer_entry { - struct payload_hash hash; + struct fozdb_hash hash; GstBuffer *buffer; }; @@ -182,7 +182,7 @@ struct need_transcode_head struct stream_state { struct murmur3_128_state hash_state; - struct payload_hash current_hash; + struct fozdb_hash current_hash; GList *buffers; /* Entry type: struct buffer_entry. */ GList *loop_buffers; /* Entry type: struct buffer_entry. */ struct need_transcode_head *codec_info; @@ -235,7 +235,7 @@ static GstStaticPadTemplate audio_conv_src_template = GST_STATIC_PAD_TEMPLATE("s static struct dump_fozdb dump_fozdb = {PTHREAD_MUTEX_INITIALIZER, NULL, false}; -static struct buffer_entry *buffer_entry_create(struct payload_hash *hash, GstBuffer *buffer) +static struct buffer_entry *buffer_entry_create(struct fozdb_hash *hash, GstBuffer *buffer) { struct buffer_entry *entry = calloc(1, sizeof(*entry)); entry->hash = *hash; @@ -255,7 +255,7 @@ static bool dumping_disabled(void) return option_enabled("MEDIACONV_AUDIO_DONT_DUMP"); } -static bool hash_data(const uint8_t *data, size_t size, struct murmur3_128_state *hash_state, struct payload_hash *hash) +static bool hash_data(const uint8_t *data, size_t size, struct murmur3_128_state *hash_state, struct fozdb_hash *hash) { struct bytes_reader reader; bytes_reader_init(&reader, data, size); @@ -270,7 +270,7 @@ static int dump_fozdb_open_audio(bool create) static void dump_fozdb_discard_transcoded(void) { GList *chunks_to_discard = NULL, *chunks_to_keep = NULL, *chunks = NULL, *list_iter; - struct payload_hash chunk_id, *stream_id; + struct fozdb_hash chunk_id, *stream_id; struct fozdb *read_fozdb; char *read_fozdb_path; GHashTableIter iter; @@ -317,7 +317,7 @@ static void dump_fozdb_discard_transcoded(void) for (i = 0; i < read_size / sizeof(chunk_id); ++i) { - payload_hash_from_bytes(&chunk_id, buffer + i * sizeof(chunk_id)); + fozdb_hash_from_bytes(&chunk_id, buffer + i * sizeof(chunk_id)); if (!fozdb_has_entry(read_fozdb, AUDIO_CONV_FOZ_TAG_PTNADATA, &chunk_id)) { has_all = false; @@ -517,8 +517,8 @@ static void stream_state_reset(struct stream_state *state) state->needs_dump = false; } -static loop_state stream_state_record_buffer(struct stream_state *state, struct payload_hash *buffer_hash, - struct payload_hash *loop_hash, GstBuffer *buffer, struct need_transcode_head *codec_info) +static loop_state stream_state_record_buffer(struct stream_state *state, struct fozdb_hash *buffer_hash, + struct fozdb_hash *loop_hash, GstBuffer *buffer, struct need_transcode_head *codec_info) { if (!state->codec_info && codec_info) state->codec_info = need_transcode_head_dup(codec_info); @@ -553,7 +553,7 @@ static loop_state stream_state_record_buffer(struct stream_state *state, struct return NO_LOOP; } -static bool stream_state_is_stream_subset(struct stream_state *state, struct fozdb *db, struct payload_hash *stream_id) +static bool stream_state_is_stream_subset(struct stream_state *state, struct fozdb *db, struct fozdb_hash *stream_id) { uint64_t offset = 0; GList *list_iter; @@ -561,7 +561,7 @@ static bool stream_state_is_stream_subset(struct stream_state *state, struct foz for (list_iter = state->buffers; list_iter; list_iter = list_iter->next) { struct buffer_entry *entry = list_iter->data; - struct payload_hash buffer_id; + struct fozdb_hash buffer_id; size_t read_size; if ((fozdb_read_entry_data(db, AUDIO_CONV_FOZ_TAG_STREAM, stream_id, @@ -610,7 +610,7 @@ static int stream_state_write_to_foz(struct stream_state *state) if (!found) { /* Are there any recorded streams of which this stream is a subset? */ - struct payload_hash *stream_id; + struct fozdb_hash *stream_id; GHashTableIter stream_ids; fozdb_iter_tag(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, &stream_ids); @@ -727,7 +727,7 @@ static void audio_conv_state_reset(struct audio_conv_state *state) static int audio_conv_state_open_transcode_file(struct audio_conv_state *state, GstBuffer *buffer, uint8_t **out_data, size_t *out_size) { - struct payload_hash hash, loop_hash; + struct fozdb_hash hash, loop_hash; uint32_t transcoded_size; const char *blank_audio; bool try_loop, hash_ok; diff --git a/dlls/winegstreamer/media-converter/fossilize.c b/dlls/winegstreamer/media-converter/fossilize.c index 057825ad5b58..44a9cbf7c659 100644 --- a/dlls/winegstreamer/media-converter/fossilize.c +++ b/dlls/winegstreamer/media-converter/fossilize.c @@ -96,24 +96,24 @@ struct payload_header struct payload_entry { - struct payload_hash hash; + struct fozdb_hash hash; struct payload_header header; uint64_t offset; }; static guint hash_func(gconstpointer key) { - const struct payload_hash *payload_hash = key; + const struct fozdb_hash *fozdb_hash = key; - return payload_hash->hash[0] - ^ payload_hash->hash[1] - ^ payload_hash->hash[2] - ^ payload_hash->hash[3]; + return fozdb_hash->hash[0] + ^ fozdb_hash->hash[1] + ^ fozdb_hash->hash[2] + ^ fozdb_hash->hash[3]; } static gboolean hash_equal(gconstpointer a, gconstpointer b) { - return memcmp(a, b, sizeof(struct payload_hash)) == 0; + return memcmp(a, b, sizeof(struct fozdb_hash)) == 0; } static bool tag_from_ascii_bytes(uint32_t *tag, const uint8_t *ascii_bytes) @@ -132,7 +132,7 @@ static bool tag_from_ascii_bytes(uint32_t *tag, const uint8_t *ascii_bytes) return true; } -static bool hash_from_ascii_bytes(struct payload_hash *hash, const uint8_t *ascii_bytes) +static bool hash_from_ascii_bytes(struct fozdb_hash *hash, const uint8_t *ascii_bytes) { unsigned int i; @@ -162,7 +162,7 @@ static void tag_to_ascii_bytes(uint32_t tag, uint8_t *ascii_bytes) memcpy(ascii_bytes, buffer, sizeof(tag) * 2); } -static void hash_to_ascii_bytes(const struct payload_hash *hash, uint8_t *ascii_bytes) +static void hash_to_ascii_bytes(const struct fozdb_hash *hash, uint8_t *ascii_bytes) { char buffer[sizeof(*hash) * 2 + 1]; sprintf(buffer, "%08x%08x%08x%08x", hash->hash[3], hash->hash[2], hash->hash[1], hash->hash[0]); @@ -201,10 +201,10 @@ static int fozdb_read_file_header(struct fozdb *db) } static int fozdb_read_entry_tag_hash_header(struct fozdb *db, - uint32_t *out_tag, struct payload_hash *out_hash, struct payload_header *out_header) + uint32_t *out_tag, struct fozdb_hash *out_hash, struct payload_header *out_header) { uint8_t entry_name_and_header[ENTRY_NAME_SIZE + sizeof(struct payload_header)]; - struct payload_hash hash; + struct fozdb_hash hash; uint32_t tag; if (!complete_read(db->file, entry_name_and_header, sizeof(entry_name_and_header))) @@ -254,7 +254,7 @@ static bool fozdb_seek_to_next_entry(struct fozdb *db, struct payload_header *he return true; } -static bool fozdb_write_entry_name(struct fozdb *db, uint32_t tag, struct payload_hash *hash) +static bool fozdb_write_entry_name(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash) { uint8_t entry_name[ENTRY_NAME_SIZE]; @@ -473,14 +473,14 @@ int fozdb_prepare(struct fozdb *db) return CONV_OK; } -bool fozdb_has_entry(struct fozdb *db, uint32_t tag, struct payload_hash *hash) +bool fozdb_has_entry(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash) { if (tag >= db->num_tags) return false; return g_hash_table_contains(db->seen_blobs[tag], hash); } -int fozdb_entry_size(struct fozdb *db, uint32_t tag, struct payload_hash *hash, uint32_t *size) +int fozdb_entry_size(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash, uint32_t *size) { struct payload_entry *entry; @@ -504,7 +504,7 @@ void fozdb_iter_tag(struct fozdb *db, uint32_t tag, GHashTableIter *iter) g_hash_table_iter_init(iter, db->seen_blobs[tag]); } -int fozdb_read_entry_data(struct fozdb *db, uint32_t tag, struct payload_hash *hash, +int fozdb_read_entry_data(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash, uint64_t offset, uint8_t *buffer, size_t size, size_t *read_size, bool with_crc) { struct payload_entry *entry; @@ -544,7 +544,7 @@ int fozdb_read_entry_data(struct fozdb *db, uint32_t tag, struct payload_hash *h return CONV_OK; } -int fozdb_write_entry(struct fozdb *db, uint32_t tag, struct payload_hash *hash, +int fozdb_write_entry(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash, void *data_src, data_read_callback read_callback, bool with_crc) { struct payload_header header; diff --git a/dlls/winegstreamer/media-converter/media-converter.h b/dlls/winegstreamer/media-converter/media-converter.h index 8cd4b31344aa..d737040ad154 100644 --- a/dlls/winegstreamer/media-converter/media-converter.h +++ b/dlls/winegstreamer/media-converter/media-converter.h @@ -90,15 +90,22 @@ struct gst_buffer_reader size_t offset; }; -struct payload_hash +struct fozdb_hash { uint32_t hash[4]; }; +#define debugstr_fozdb_hash( hash ) debugstr_fozdb_hash_( (char[35]){0}, hash ) +static inline const char *debugstr_fozdb_hash_( char *buffer, const struct fozdb_hash *hash ) +{ + sprintf( buffer, "0x%08x%08x%08x%08x", hash->hash[3], hash->hash[2], hash->hash[1], hash->hash[0] ); + return buffer; +} + struct entry_name { uint32_t tag; - struct payload_hash hash; + struct fozdb_hash hash; }; struct dump_fozdb @@ -157,12 +164,12 @@ extern bool murmur3_x86_128(void *data_src, data_read_callback read_callback, ui extern int fozdb_create(const char *file_name, int open_flags, bool read_only, uint32_t num_tags, struct fozdb **out); extern void fozdb_release(struct fozdb *db); extern int fozdb_prepare(struct fozdb *db); -extern bool fozdb_has_entry(struct fozdb *db, uint32_t tag, struct payload_hash *hash); -extern int fozdb_entry_size(struct fozdb *db, uint32_t tag, struct payload_hash *hash, uint32_t *size); +extern bool fozdb_has_entry(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash); +extern int fozdb_entry_size(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash, uint32_t *size); extern void fozdb_iter_tag(struct fozdb *db, uint32_t tag, GHashTableIter *iter); -extern int fozdb_read_entry_data(struct fozdb *db, uint32_t tag, struct payload_hash *hash, +extern int fozdb_read_entry_data(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash, uint64_t offset, uint8_t *buffer, size_t size, size_t *read_size, bool with_crc); -extern int fozdb_write_entry(struct fozdb *db, uint32_t tag, struct payload_hash *hash, +extern int fozdb_write_entry(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash, void *data_src, data_read_callback read_callback, bool with_crc); extern int fozdb_discard_entries(struct fozdb *db, GList *to_discard_entries); @@ -181,7 +188,7 @@ static inline bool discarding_disabled(void) return option_enabled("MEDIACONV_DONT_DISCARD"); } -static inline const char *format_hash(struct payload_hash *hash) +static inline const char *format_hash(struct fozdb_hash *hash) { int hash_str_size = 2 + sizeof(*hash) * 2 + 1; static char buffer[1024] = {}; @@ -258,7 +265,7 @@ static inline bool file_exists(const char *file_path) return access(file_path, F_OK) == 0; } -static inline struct entry_name *entry_name_create(uint32_t tag, struct payload_hash *hash) +static inline struct entry_name *entry_name_create(uint32_t tag, struct fozdb_hash *hash) { struct entry_name *entry = calloc(1, sizeof(*entry)); entry->tag = tag; @@ -279,7 +286,7 @@ static inline uint32_t bytes_to_uint32(const uint8_t *bytes) | ((uint32_t)bytes[3] << 24); } -static inline void payload_hash_from_bytes(struct payload_hash *hash, uint8_t *bytes) +static inline void fozdb_hash_from_bytes(struct fozdb_hash *hash, uint8_t *bytes) { hash->hash[0] = bytes_to_uint32(bytes + 0); hash->hash[1] = bytes_to_uint32(bytes + 4); diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index d45e2d8be8a2..b91e0e27d8c7 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -99,7 +99,7 @@ enum video_conv_state_flags struct video_conv_state { - struct payload_hash transcode_hash; + struct fozdb_hash transcode_hash; struct fozdb *read_fozdb; int blank_file; uint64_t upstream_duration; @@ -149,7 +149,7 @@ void hashes_reader_init(struct hashes_reader *reader, GList *hashes) static int hashes_reader_read(void *reader, uint8_t *buffer, size_t size, size_t *read_size) { - struct payload_hash *hash = (struct payload_hash *)buffer; + struct fozdb_hash *hash = (struct fozdb_hash *)buffer; struct hashes_reader *hashes_reader = reader; if (!size) @@ -161,7 +161,7 @@ static int hashes_reader_read(void *reader, uint8_t *buffer, size_t size, size_t if (!hashes_reader->current_hash) return CONV_ERROR_DATA_END; - *hash = *(struct payload_hash *)(hashes_reader->current_hash->data); + *hash = *(struct fozdb_hash *)(hashes_reader->current_hash->data); hashes_reader->current_hash = hashes_reader->current_hash->next; *read_size = sizeof(*hash); @@ -176,7 +176,7 @@ static int dump_fozdb_open_video(bool create) static void dump_fozdb_discard_transcoded(void) { GList *to_discard_chunks = NULL; - struct payload_hash *stream_id; + struct fozdb_hash *stream_id; struct fozdb *read_fozdb; char *read_fozdb_path; GHashTableIter iter; @@ -209,7 +209,7 @@ static void dump_fozdb_discard_transcoded(void) fozdb_iter_tag(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_STREAM, &iter); while (g_hash_table_iter_next(&iter, (void **)&stream_id, NULL)) { - struct payload_hash chunk_id; + struct fozdb_hash chunk_id; uint32_t chunks_size, i; size_t read_size; @@ -223,7 +223,7 @@ static void dump_fozdb_discard_transcoded(void) { for (i = 0; i < read_size / sizeof(chunk_id); ++i) { - payload_hash_from_bytes(&chunk_id, buffer + i * sizeof(chunk_id)); + fozdb_hash_from_bytes(&chunk_id, buffer + i * sizeof(chunk_id)); to_discard_chunks = g_list_append(to_discard_chunks, entry_name_create(VIDEO_CONV_FOZ_TAG_VIDEODATA, &chunk_id)); } @@ -396,7 +396,7 @@ static void video_conv_state_release(struct video_conv_state *state) } /* Return true if the file is transcoded, false if not. */ -bool video_conv_state_begin_transcode(struct video_conv_state *state, struct payload_hash *hash) +bool video_conv_state_begin_transcode(struct video_conv_state *state, struct fozdb_hash *hash) { GST_DEBUG("state %p, hash %s.", state, format_hash(hash)); @@ -582,7 +582,7 @@ static bool video_conv_get_downstream_range(VideoConv *conv, uint64_t offset, ui return true; } -static bool video_conv_hash_upstream_data(VideoConv *conv, struct payload_hash *hash) +static bool video_conv_hash_upstream_data(VideoConv *conv, struct fozdb_hash *hash) { bool ret = false; @@ -613,7 +613,7 @@ static int video_conv_dump_upstream_chunk(VideoConv *conv, const void *buffer, s GList **chunk_hashes) { struct bytes_reader bytes_reader; - struct payload_hash *chunk_hash; + struct fozdb_hash *chunk_hash; bytes_reader_init(&bytes_reader, buffer, read_size); chunk_hash = calloc(1, sizeof(*chunk_hash)); @@ -625,7 +625,7 @@ static int video_conv_dump_upstream_chunk(VideoConv *conv, const void *buffer, s &bytes_reader, bytes_reader_read, true); } -static int video_conv_dump_upstream_data(VideoConv *conv, struct payload_hash *hash) +static int video_conv_dump_upstream_data(VideoConv *conv, struct fozdb_hash *hash) { struct hashes_reader chunk_hashes_reader; struct pad_reader *pad_reader = NULL; @@ -683,7 +683,7 @@ static int video_conv_dump_upstream_data(VideoConv *conv, struct payload_hash *h static void video_conv_init_transcode(VideoConv *conv) { struct video_conv_state *state = conv->state; - struct payload_hash hash; + struct fozdb_hash hash; int ret; if (state->state_flags & VIDEO_CONV_HAS_TRANSCODED) @@ -725,7 +725,7 @@ static uint32_t video_conv_get_state_flags(VideoConv *conv) return state_flags; } -static gboolean video_conv_push_stream_start(VideoConv *conv, struct payload_hash *hash) +static gboolean video_conv_push_stream_start(VideoConv *conv, struct fozdb_hash *hash) { struct video_conv_state *state; @@ -802,7 +802,7 @@ static gboolean video_conv_sink_event_caps(VideoConv *conv, GstEvent *event) static gboolean video_conv_sink_event_eos(VideoConv *conv, GstEvent *event) { struct video_conv_state *state; - struct payload_hash hash; + struct fozdb_hash hash; uint32_t transcode_tag; uint32_t state_flags; int ret; @@ -1178,7 +1178,7 @@ static gboolean video_conv_src_active_mode(GstPad *pad, GstObject *parent, GstPa { VideoConv *conv = VIDEO_CONV(parent); struct video_conv_state *state; - struct payload_hash hash; + struct fozdb_hash hash; uint32_t state_flags; GST_DEBUG_OBJECT(pad, "mode %s, active %d.", gst_pad_mode_get_name(mode), active); From 1bfdcd7cf664782e3f589ae0f1d0e86ae0f81074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 5 Dec 2024 10:55:30 +0100 Subject: [PATCH 0562/2542] winegstreamer/media-converter: Rename entry_name to fozdb_key. --- dlls/winegstreamer/media-converter/audioconv.c | 4 ++-- dlls/winegstreamer/media-converter/fossilize.c | 12 ++++++------ dlls/winegstreamer/media-converter/media-converter.h | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dlls/winegstreamer/media-converter/audioconv.c b/dlls/winegstreamer/media-converter/audioconv.c index 5acce9a7915a..8d69d8134169 100644 --- a/dlls/winegstreamer/media-converter/audioconv.c +++ b/dlls/winegstreamer/media-converter/audioconv.c @@ -329,7 +329,7 @@ static void dump_fozdb_discard_transcoded(void) for (list_iter = stream_chunks; list_iter; list_iter = list_iter->next) { - struct entry_name *entry = list_iter->data; + struct fozdb_key *entry = list_iter->data; if (has_all) { chunks_to_discard = g_list_append(chunks_to_discard, @@ -358,7 +358,7 @@ static void dump_fozdb_discard_transcoded(void) for (list_iter = chunks_to_discard; list_iter; list_iter = list_iter->next) { - struct entry_name *entry = list_iter->data; + struct fozdb_key *entry = list_iter->data; if (!g_list_find_custom(chunks_to_keep, entry, entry_name_compare)) chunks = g_list_append(chunks, entry_name_create(entry->tag, &entry->hash)); } diff --git a/dlls/winegstreamer/media-converter/fossilize.c b/dlls/winegstreamer/media-converter/fossilize.c index 44a9cbf7c659..c1fadcd52424 100644 --- a/dlls/winegstreamer/media-converter/fossilize.c +++ b/dlls/winegstreamer/media-converter/fossilize.c @@ -272,7 +272,7 @@ static bool fozdb_write_entry_name(struct fozdb *db, uint32_t tag, struct fozdb_ /* Copy an entry to write_pos. */ static int fozdb_copy_entry(struct fozdb *db, - struct entry_name *name, struct payload_header *header, uint64_t entry_data_offset) + struct fozdb_key *key, struct payload_header *header, uint64_t entry_data_offset) { uint64_t read_offset, entry_end = entry_data_offset + header->size; ssize_t read_size; @@ -285,7 +285,7 @@ static int fozdb_copy_entry(struct fozdb *db, } /* Write entry name. */ - if (!fozdb_write_entry_name(db, name->tag, &name->hash)) + if (!fozdb_write_entry_name(db, key->tag, &key->hash)) return CONV_ERROR_WRITE_FAILED; db->write_pos += ENTRY_NAME_SIZE; @@ -677,15 +677,15 @@ int fozdb_discard_entries(struct fozdb *db, GList *to_discard_names) { struct payload_header header; uint64_t entry_data_offset; - struct entry_name name; + struct fozdb_key key; bool truncated; - if ((ret = fozdb_read_entry_tag_hash_header(db, &name.tag, &name.hash, &header) < 0)) + if ((ret = fozdb_read_entry_tag_hash_header(db, &key.tag, &key.hash, &header) < 0)) return CONV_ERROR_READ_FAILED; entry_data_offset = lseek(db->file, 0, SEEK_CUR); /* Check if entry should be discarded. */ - if (g_list_find_custom(to_discard_names, &name, entry_name_compare)) + if (g_list_find_custom(to_discard_names, &key, entry_name_compare)) { if (!fozdb_seek_to_next_entry(db, &header, &truncated)) return CONV_ERROR_SEEK_FAILED; @@ -706,7 +706,7 @@ int fozdb_discard_entries(struct fozdb *db, GList *to_discard_names) else { /* We're offset, so we have to rewrite. */ - if ((ret = fozdb_copy_entry(db, &name, &header, entry_data_offset)) < 0) + if ((ret = fozdb_copy_entry(db, &key, &header, entry_data_offset)) < 0) return ret; } } diff --git a/dlls/winegstreamer/media-converter/media-converter.h b/dlls/winegstreamer/media-converter/media-converter.h index d737040ad154..3d82681d4956 100644 --- a/dlls/winegstreamer/media-converter/media-converter.h +++ b/dlls/winegstreamer/media-converter/media-converter.h @@ -102,7 +102,7 @@ static inline const char *debugstr_fozdb_hash_( char *buffer, const struct fozdb return buffer; } -struct entry_name +struct fozdb_key { uint32_t tag; struct fozdb_hash hash; @@ -265,9 +265,9 @@ static inline bool file_exists(const char *file_path) return access(file_path, F_OK) == 0; } -static inline struct entry_name *entry_name_create(uint32_t tag, struct fozdb_hash *hash) +static inline struct fozdb_key *entry_name_create(uint32_t tag, struct fozdb_hash *hash) { - struct entry_name *entry = calloc(1, sizeof(*entry)); + struct fozdb_key *entry = calloc(1, sizeof(*entry)); entry->tag = tag; entry->hash = *hash; return entry; @@ -275,7 +275,7 @@ static inline struct entry_name *entry_name_create(uint32_t tag, struct fozdb_ha static inline gint entry_name_compare(const void *a, const void *b) { - return memcmp(a, b, sizeof(struct entry_name)); + return memcmp(a, b, sizeof(struct fozdb_key)); } static inline uint32_t bytes_to_uint32(const uint8_t *bytes) From 1159d1d781d5c8c62e6f42d74c5f3614fee79223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 5 Dec 2024 10:57:41 +0100 Subject: [PATCH 0563/2542] winegstreamer/media-converter: Use a rb_tree rather than a GList. --- .../winegstreamer/media-converter/audioconv.c | 45 +++++++++---------- .../winegstreamer/media-converter/fossilize.c | 34 ++++++++++++-- .../media-converter/media-converter.h | 26 +++++------ .../winegstreamer/media-converter/videoconv.c | 14 +++--- 4 files changed, 69 insertions(+), 50 deletions(-) diff --git a/dlls/winegstreamer/media-converter/audioconv.c b/dlls/winegstreamer/media-converter/audioconv.c index 8d69d8134169..e6f2c727268d 100644 --- a/dlls/winegstreamer/media-converter/audioconv.c +++ b/dlls/winegstreamer/media-converter/audioconv.c @@ -269,8 +269,11 @@ static int dump_fozdb_open_audio(bool create) static void dump_fozdb_discard_transcoded(void) { - GList *chunks_to_discard = NULL, *chunks_to_keep = NULL, *chunks = NULL, *list_iter; + struct rb_tree chunks_to_discard = {fozdb_entry_compare}; + struct rb_tree chunks_to_keep = {fozdb_entry_compare}; + struct rb_tree chunks = {fozdb_entry_compare}; struct fozdb_hash chunk_id, *stream_id; + struct fozdb_entry *chunk; struct fozdb *read_fozdb; char *read_fozdb_path; GHashTableIter iter; @@ -312,7 +315,7 @@ static void dump_fozdb_discard_transcoded(void) if (fozdb_read_entry_data(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, stream_id, 0, buffer, chunks_size, &read_size, true) == CONV_OK) { - GList *stream_chunks = NULL; + struct rb_tree stream_chunks = {fozdb_entry_compare}; bool has_all = true; for (i = 0; i < read_size / sizeof(chunk_id); ++i) @@ -323,55 +326,47 @@ static void dump_fozdb_discard_transcoded(void) has_all = false; break; } - stream_chunks = g_list_append(stream_chunks, - entry_name_create(AUDIO_CONV_FOZ_TAG_AUDIODATA, &chunk_id)); + fozdb_entry_put(&stream_chunks, AUDIO_CONV_FOZ_TAG_AUDIODATA, &chunk_id); } - for (list_iter = stream_chunks; list_iter; list_iter = list_iter->next) + RB_FOR_EACH_ENTRY(chunk, &stream_chunks, struct fozdb_entry, entry) { - struct fozdb_key *entry = list_iter->data; if (has_all) { - chunks_to_discard = g_list_append(chunks_to_discard, - entry_name_create(entry->tag, &entry->hash)); - chunks_to_discard = g_list_append(chunks_to_discard, - entry_name_create(AUDIO_CONV_FOZ_TAG_CODECINFO, &entry->hash)); + fozdb_entry_put(&chunks_to_discard, chunk->key.tag, &chunk->key.hash); + fozdb_entry_put(&chunks_to_discard, AUDIO_CONV_FOZ_TAG_CODECINFO, &chunk->key.hash); } else { - chunks_to_keep = g_list_append(chunks_to_keep, - entry_name_create(entry->tag, &entry->hash)); - chunks_to_keep = g_list_append(chunks_to_keep, - entry_name_create(AUDIO_CONV_FOZ_TAG_CODECINFO, &entry->hash)); + fozdb_entry_put(&chunks_to_keep, chunk->key.tag, &chunk->key.hash); + fozdb_entry_put(&chunks_to_keep, AUDIO_CONV_FOZ_TAG_CODECINFO, &chunk->key.hash); } } if (has_all) - chunks_to_discard = g_list_append(chunks_to_discard, - entry_name_create(AUDIO_CONV_FOZ_TAG_STREAM, stream_id)); + fozdb_entry_put(&chunks_to_discard, AUDIO_CONV_FOZ_TAG_STREAM, stream_id); - g_list_free_full(stream_chunks, free); + rb_destroy(&stream_chunks, fozdb_entry_destroy, NULL); } free(buffer); } } - for (list_iter = chunks_to_discard; list_iter; list_iter = list_iter->next) + RB_FOR_EACH_ENTRY(chunk, &chunks_to_discard, struct fozdb_entry, entry) { - struct fozdb_key *entry = list_iter->data; - if (!g_list_find_custom(chunks_to_keep, entry, entry_name_compare)) - chunks = g_list_append(chunks, entry_name_create(entry->tag, &entry->hash)); + if (!rb_get(&chunks_to_keep, chunk)) + fozdb_entry_put(&chunks, chunk->key.tag, &chunk->key.hash); } - if ((ret = fozdb_discard_entries(dump_fozdb.fozdb, chunks)) < 0) + if ((ret = fozdb_discard_entries(dump_fozdb.fozdb, &chunks)) < 0) { GST_ERROR("Failed to discard entries, ret %d.", ret); dump_fozdb_close(&dump_fozdb); } - g_list_free_full(chunks, free); - g_list_free_full(chunks_to_keep, free); - g_list_free_full(chunks_to_discard, free); + rb_destroy(&chunks, fozdb_entry_destroy, NULL); + rb_destroy(&chunks_to_keep, fozdb_entry_destroy, NULL); + rb_destroy(&chunks_to_discard, fozdb_entry_destroy, NULL); } static bool need_transcode_head_create_from_caps(GstCaps *caps, struct need_transcode_head **out) diff --git a/dlls/winegstreamer/media-converter/fossilize.c b/dlls/winegstreamer/media-converter/fossilize.c index c1fadcd52424..08297cd861bf 100644 --- a/dlls/winegstreamer/media-converter/fossilize.c +++ b/dlls/winegstreamer/media-converter/fossilize.c @@ -101,6 +101,34 @@ struct payload_entry uint64_t offset; }; +int fozdb_entry_compare( const void *key, const struct rb_entry *ptr ) +{ + const struct fozdb_entry *entry = RB_ENTRY_VALUE( ptr, const struct fozdb_entry, entry ); + return memcmp( key, &entry->key, sizeof(entry->key) ); +} + +void fozdb_entry_destroy( struct rb_entry *entry, void *context ) +{ + struct fozdb_entry *chunk = RB_ENTRY_VALUE( entry, struct fozdb_entry, entry ); + free( chunk ); +} + +struct fozdb_entry *fozdb_entry_put( struct rb_tree *tree, uint32_t tag, const struct fozdb_hash *hash ) +{ + struct fozdb_key key = {.tag = tag, .hash = *hash}; + struct fozdb_entry *entry; + + if (!(entry = malloc( sizeof(*entry) )) || + rb_put( tree, &key, &entry->entry )) + { + free( entry ); + return NULL; + } + + entry->key = key; + return entry; +} + static guint hash_func(gconstpointer key) { const struct fozdb_hash *fozdb_hash = key; @@ -648,13 +676,13 @@ int fozdb_write_entry(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash, } /* Rewrites the database, discarding entries listed. */ -int fozdb_discard_entries(struct fozdb *db, GList *to_discard_names) +int fozdb_discard_entries(struct fozdb *db, struct rb_tree *to_discard) { uint8_t entry_name_and_header[ENTRY_NAME_SIZE + sizeof(struct payload_header)]; uint64_t file_size; int i, ret; - GST_DEBUG("db %p, file_name %s, to_discard_entries %p.", db, db->file_name, to_discard_names); + GST_DEBUG("db %p, file_name %s, to_discard %p.", db, db->file_name, to_discard); /* Rewind the file and clear the entry tables. */ if (lseek(db->file, 0, SEEK_SET) < 0) @@ -685,7 +713,7 @@ int fozdb_discard_entries(struct fozdb *db, GList *to_discard_names) entry_data_offset = lseek(db->file, 0, SEEK_CUR); /* Check if entry should be discarded. */ - if (g_list_find_custom(to_discard_names, &key, entry_name_compare)) + if (rb_get(to_discard, &key)) { if (!fozdb_seek_to_next_entry(db, &header, &truncated)) return CONV_ERROR_SEEK_FAILED; diff --git a/dlls/winegstreamer/media-converter/media-converter.h b/dlls/winegstreamer/media-converter/media-converter.h index 3d82681d4956..7150c46689b6 100644 --- a/dlls/winegstreamer/media-converter/media-converter.h +++ b/dlls/winegstreamer/media-converter/media-converter.h @@ -30,6 +30,7 @@ #include #include "unix_private.h" +#include "wine/rbtree.h" GST_DEBUG_CATEGORY_EXTERN(media_converter_debug); #undef GST_CAT_DEFAULT @@ -108,6 +109,16 @@ struct fozdb_key struct fozdb_hash hash; }; +struct fozdb_entry +{ + struct rb_entry entry; + struct fozdb_key key; +}; + +extern int fozdb_entry_compare( const void *key, const struct rb_entry *ptr ); +extern void fozdb_entry_destroy( struct rb_entry *entry, void *context ); +extern struct fozdb_entry *fozdb_entry_put( struct rb_tree *tree, uint32_t tag, const struct fozdb_hash *hash ); + struct dump_fozdb { pthread_mutex_t mutex; @@ -171,7 +182,7 @@ extern int fozdb_read_entry_data(struct fozdb *db, uint32_t tag, struct fozdb_ha uint64_t offset, uint8_t *buffer, size_t size, size_t *read_size, bool with_crc); extern int fozdb_write_entry(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash, void *data_src, data_read_callback read_callback, bool with_crc); -extern int fozdb_discard_entries(struct fozdb *db, GList *to_discard_entries); +extern int fozdb_discard_entries(struct fozdb *db, struct rb_tree *to_discard); static inline bool option_enabled(const char *env) { @@ -265,19 +276,6 @@ static inline bool file_exists(const char *file_path) return access(file_path, F_OK) == 0; } -static inline struct fozdb_key *entry_name_create(uint32_t tag, struct fozdb_hash *hash) -{ - struct fozdb_key *entry = calloc(1, sizeof(*entry)); - entry->tag = tag; - entry->hash = *hash; - return entry; -} - -static inline gint entry_name_compare(const void *a, const void *b) -{ - return memcmp(a, b, sizeof(struct fozdb_key)); -} - static inline uint32_t bytes_to_uint32(const uint8_t *bytes) { return ((uint32_t)bytes[0] << 0) diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index b91e0e27d8c7..d27a1c11a486 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -175,7 +175,7 @@ static int dump_fozdb_open_video(bool create) static void dump_fozdb_discard_transcoded(void) { - GList *to_discard_chunks = NULL; + struct rb_tree to_discard_chunks = {fozdb_entry_compare}; struct fozdb_hash *stream_id; struct fozdb *read_fozdb; char *read_fozdb_path; @@ -224,25 +224,23 @@ static void dump_fozdb_discard_transcoded(void) for (i = 0; i < read_size / sizeof(chunk_id); ++i) { fozdb_hash_from_bytes(&chunk_id, buffer + i * sizeof(chunk_id)); - to_discard_chunks = g_list_append(to_discard_chunks, - entry_name_create(VIDEO_CONV_FOZ_TAG_VIDEODATA, &chunk_id)); + fozdb_entry_put(&to_discard_chunks, VIDEO_CONV_FOZ_TAG_VIDEODATA, &chunk_id); } } free(buffer); } - to_discard_chunks = g_list_append(to_discard_chunks, - entry_name_create(VIDEO_CONV_FOZ_TAG_STREAM, stream_id)); + fozdb_entry_put(&to_discard_chunks, VIDEO_CONV_FOZ_TAG_STREAM, stream_id); } } - if ((ret = fozdb_discard_entries(dump_fozdb.fozdb, to_discard_chunks)) < 0) + if ((ret = fozdb_discard_entries(dump_fozdb.fozdb, &to_discard_chunks)) < 0) { GST_ERROR("Failed to discard entries, ret %d.", ret); dump_fozdb_close(&dump_fozdb); } - g_list_free_full(to_discard_chunks, free); + rb_destroy(&to_discard_chunks, fozdb_entry_destroy, NULL); } struct pad_reader *pad_reader_create_with_stride(GstPad *pad, size_t stride) @@ -1423,4 +1421,4 @@ bool get_untranscoded_stream_format(GstElement *container, uint32_t stream_index free(buffer); pthread_mutex_unlock(&conv->state_mutex); return ret; -} \ No newline at end of file +} From 1b019bcecb2df6e61ac0c9bdc8e6a04485ab52c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 5 Dec 2024 11:19:39 +0100 Subject: [PATCH 0564/2542] winegstreamer/media-converter: Use a rb tree for file chunks. --- .../winegstreamer/media-converter/audioconv.c | 23 ++-- .../winegstreamer/media-converter/fossilize.c | 125 +++++++++--------- .../media-converter/media-converter.h | 16 ++- .../winegstreamer/media-converter/videoconv.c | 14 +- 4 files changed, 90 insertions(+), 88 deletions(-) diff --git a/dlls/winegstreamer/media-converter/audioconv.c b/dlls/winegstreamer/media-converter/audioconv.c index e6f2c727268d..ef085dcd6c67 100644 --- a/dlls/winegstreamer/media-converter/audioconv.c +++ b/dlls/winegstreamer/media-converter/audioconv.c @@ -272,11 +272,10 @@ static void dump_fozdb_discard_transcoded(void) struct rb_tree chunks_to_discard = {fozdb_entry_compare}; struct rb_tree chunks_to_keep = {fozdb_entry_compare}; struct rb_tree chunks = {fozdb_entry_compare}; - struct fozdb_hash chunk_id, *stream_id; - struct fozdb_entry *chunk; + struct fozdb_entry *entry, *chunk; + struct fozdb_hash chunk_id; struct fozdb *read_fozdb; char *read_fozdb_path; - GHashTableIter iter; int ret; if (dump_fozdb.already_cleaned) @@ -303,16 +302,15 @@ static void dump_fozdb_discard_transcoded(void) return; } - fozdb_iter_tag(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, &iter); - while (g_hash_table_iter_next(&iter, (void *)&stream_id, NULL)) + FOZDB_FOR_EACH_TAG_ENTRY(entry, AUDIO_CONV_FOZ_TAG_STREAM, dump_fozdb.fozdb) { uint32_t chunks_size, i; size_t read_size; - if (fozdb_entry_size(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, stream_id, &chunks_size) == CONV_OK) + if (fozdb_entry_size(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, &entry->key.hash, &chunks_size) == CONV_OK) { uint8_t *buffer = calloc(1, chunks_size); - if (fozdb_read_entry_data(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, stream_id, + if (fozdb_read_entry_data(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, &entry->key.hash, 0, buffer, chunks_size, &read_size, true) == CONV_OK) { struct rb_tree stream_chunks = {fozdb_entry_compare}; @@ -344,7 +342,7 @@ static void dump_fozdb_discard_transcoded(void) } if (has_all) - fozdb_entry_put(&chunks_to_discard, AUDIO_CONV_FOZ_TAG_STREAM, stream_id); + fozdb_entry_put(&chunks_to_discard, AUDIO_CONV_FOZ_TAG_STREAM, &entry->key.hash); rb_destroy(&stream_chunks, fozdb_entry_destroy, NULL); } @@ -605,13 +603,12 @@ static int stream_state_write_to_foz(struct stream_state *state) if (!found) { /* Are there any recorded streams of which this stream is a subset? */ - struct fozdb_hash *stream_id; - GHashTableIter stream_ids; + struct fozdb_entry *entry; - fozdb_iter_tag(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, &stream_ids); - while (g_hash_table_iter_next(&stream_ids, (void **)&stream_id, NULL)) + RB_FOR_EACH_ENTRY(entry, &dump_fozdb.fozdb->entries, struct fozdb_entry, entry) { - if (stream_state_is_stream_subset(state, dump_fozdb.fozdb, stream_id)) + if (entry->key.tag != AUDIO_CONV_FOZ_TAG_STREAM) continue; + if (stream_state_is_stream_subset(state, dump_fozdb.fozdb, &entry->key.hash)) { found = true; break; diff --git a/dlls/winegstreamer/media-converter/fossilize.c b/dlls/winegstreamer/media-converter/fossilize.c index 08297cd861bf..36148d0c3ba7 100644 --- a/dlls/winegstreamer/media-converter/fossilize.c +++ b/dlls/winegstreamer/media-converter/fossilize.c @@ -94,13 +94,6 @@ struct payload_header uint32_t full_size; } __attribute__((packed)); -struct payload_entry -{ - struct fozdb_hash hash; - struct payload_header header; - uint64_t offset; -}; - int fozdb_entry_compare( const void *key, const struct rb_entry *ptr ) { const struct fozdb_entry *entry = RB_ENTRY_VALUE( ptr, const struct fozdb_entry, entry ); @@ -129,19 +122,20 @@ struct fozdb_entry *fozdb_entry_put( struct rb_tree *tree, uint32_t tag, const s return entry; } -static guint hash_func(gconstpointer key) +struct rb_entry *fozdb_tag_head( struct rb_tree *tree, uint32_t tag ) { - const struct fozdb_hash *fozdb_hash = key; + struct rb_entry *entry = tree->root, *head = entry; + struct fozdb_key key = {.tag = tag}; - return fozdb_hash->hash[0] - ^ fozdb_hash->hash[1] - ^ fozdb_hash->hash[2] - ^ fozdb_hash->hash[3]; -} + while (entry) + { + int c = tree->compare( &key, entry ); + if (!c) return entry; + if (c < 0) head = entry; + entry = c < 0 ? entry->left : entry->right; + } -static gboolean hash_equal(gconstpointer a, gconstpointer b) -{ - return memcmp(a, b, sizeof(struct fozdb_hash)) == 0; + return head; } static bool tag_from_ascii_bytes(uint32_t *tag, const uint8_t *ascii_bytes) @@ -376,7 +370,6 @@ static int fozdb_copy_entry(struct fozdb *db, int fozdb_create(const char *file_name, int open_flags, bool read_only, uint32_t num_tags, struct fozdb **out) { struct fozdb *db; - size_t i; int ret; GST_DEBUG("file_name %s, open_flags %d, read_only %d, num_tags %u, out %p.", @@ -395,9 +388,7 @@ int fozdb_create(const char *file_name, int open_flags, bool read_only, uint32_t db->read_only = read_only; /* Create entry hash tables. */ - db->seen_blobs = calloc(num_tags, sizeof(*db->seen_blobs)); - for (i = 0; i < num_tags; ++i) - db->seen_blobs[i] = g_hash_table_new_full(hash_func, hash_equal, NULL, free); + rb_init(&db->entries, fozdb_entry_compare); /* Load entries. */ if ((ret = fozdb_prepare(db)) < 0) @@ -415,13 +406,9 @@ int fozdb_create(const char *file_name, int open_flags, bool read_only, uint32_t void fozdb_release(struct fozdb *db) { - int i; - GST_DEBUG("db %p.", db); - for (i = 0; i < db->num_tags; ++i) - g_hash_table_destroy(db->seen_blobs[i]); - free(db->seen_blobs); + rb_destroy(&db->entries, fozdb_entry_destroy, NULL); close(db->file); free(db); } @@ -464,23 +451,26 @@ int fozdb_prepare(struct fozdb *db) return ret; db->write_pos = lseek(db->file, 0, SEEK_CUR); - /* Read entries to seen_blobs. */ + /* Read entries to chunks. */ while (db->write_pos < file_size) { - struct payload_entry entry, *table_entry; + struct payload_header header; + struct fozdb_entry *entry; + struct fozdb_hash hash; + uint64_t offset; uint32_t tag; /* Read an entry. */ - if ((ret = fozdb_read_entry_tag_hash_header(db, &tag, &entry.hash, &entry.header) < 0)) + if ((ret = fozdb_read_entry_tag_hash_header(db, &tag, &hash, &header) < 0)) return ret; - entry.offset = lseek(db->file, 0, SEEK_CUR); + offset = lseek(db->file, 0, SEEK_CUR); - if (!fozdb_seek_to_next_entry(db, &entry.header, NULL)) + if (!fozdb_seek_to_next_entry(db, &header, NULL)) return CONV_ERROR_SEEK_FAILED; db->write_pos = lseek(db->file, 0, SEEK_CUR); GST_INFO("Got entry: tag %u, hash %s, offset %#"PRIx64", size %#x, crc %#x.", - tag, format_hash(&entry.hash), entry.offset, entry.header.size, entry.header.crc); + tag, format_hash(&hash), offset, header.size, header.crc); /* Insert entry to hash table. */ if (tag >= db->num_tags) @@ -493,9 +483,15 @@ int fozdb_prepare(struct fozdb *db) else return CONV_ERROR_INVALID_TAG; } - table_entry = calloc(1, sizeof(*table_entry)); - *table_entry = entry; - g_hash_table_insert(db->seen_blobs[tag], &table_entry->hash, table_entry); + + if ((entry = fozdb_entry_put( &db->entries, tag, &hash ))) + { + entry->size = header.size; + entry->compression = header.compression; + entry->crc = header.crc; + entry->full_size = header.full_size; + entry->offset = offset; + } } return CONV_OK; @@ -503,39 +499,35 @@ int fozdb_prepare(struct fozdb *db) bool fozdb_has_entry(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash) { + struct fozdb_key key = {.tag = tag, .hash = *hash}; if (tag >= db->num_tags) return false; - return g_hash_table_contains(db->seen_blobs[tag], hash); + return rb_get(&db->entries, &key); } int fozdb_entry_size(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash, uint32_t *size) { - struct payload_entry *entry; + struct fozdb_key key = {.tag = tag, .hash = *hash}; + struct fozdb_entry *entry; + struct rb_entry *ptr; if (tag >= db->num_tags) return CONV_ERROR_INVALID_TAG; - if (!(entry = g_hash_table_lookup(db->seen_blobs[tag], hash))) + if (!(ptr = rb_get(&db->entries, &key))) return CONV_ERROR_ENTRY_NOT_FOUND; - *size = entry->header.full_size; + entry = RB_ENTRY_VALUE(ptr, struct fozdb_entry, entry); + *size = entry->full_size; return CONV_OK; } -void fozdb_iter_tag(struct fozdb *db, uint32_t tag, GHashTableIter *iter) -{ - if (tag > db->num_tags) - { - GST_ERROR("Invalid tag %u.", tag); - return; - } - g_hash_table_iter_init(iter, db->seen_blobs[tag]); -} - int fozdb_read_entry_data(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash, uint64_t offset, uint8_t *buffer, size_t size, size_t *read_size, bool with_crc) { - struct payload_entry *entry; + struct fozdb_key key = {.tag = tag, .hash = *hash}; + struct fozdb_entry *entry; + struct rb_entry *ptr; size_t to_copy; GST_DEBUG("db %p, file_name %s, tag %u, hash %s, offset %#"PRIx64", buffer %p, size %zu, read_size %p, with_crc %d.", @@ -543,19 +535,20 @@ int fozdb_read_entry_data(struct fozdb *db, uint32_t tag, struct fozdb_hash *has if (tag >= db->num_tags) return CONV_ERROR_INVALID_TAG; - if (!(entry = g_hash_table_lookup(db->seen_blobs[tag], hash))) + if (!(ptr = rb_get(&db->entries, &key))) return CONV_ERROR_ENTRY_NOT_FOUND; + entry = RB_ENTRY_VALUE(ptr, struct fozdb_entry, entry); - if (entry->header.compression != FOZDB_COMPRESSION_NONE) + if (entry->compression != FOZDB_COMPRESSION_NONE) return CONV_ERROR_NOT_IMPLEMENTED; - if (offset >= entry->header.full_size) + if (offset >= entry->full_size) return CONV_OK; if (lseek(db->file, entry->offset + offset, SEEK_SET) < 0) return CONV_ERROR_SEEK_FAILED; - to_copy = min(entry->header.full_size - offset, size); + to_copy = min(entry->full_size - offset, size); if (!complete_read(db->file, buffer, to_copy)) { GST_ERROR("Failed to read entry data."); @@ -563,7 +556,7 @@ int fozdb_read_entry_data(struct fozdb *db, uint32_t tag, struct fozdb_hash *has } *read_size = to_copy; - if (entry->header.crc != 0 && with_crc && entry->header.crc != crc32(0, buffer, to_copy)) + if (entry->crc != 0 && with_crc && entry->crc != crc32(0, buffer, to_copy)) { GST_ERROR("Wrong check sum."); return CONV_ERROR_WRONG_CHECKSUM; @@ -576,7 +569,7 @@ int fozdb_write_entry(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash, void *data_src, data_read_callback read_callback, bool with_crc) { struct payload_header header; - struct payload_entry *entry; + struct fozdb_entry *entry; off_t header_offset; uint32_t size = 0; size_t read_size; @@ -663,14 +656,17 @@ int fozdb_write_entry(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash, } /* Success. Record entry and exit. */ - entry = calloc(1, sizeof(*entry)); - entry->header = header; - entry->hash = *hash; - entry->offset = offset; - g_hash_table_insert(db->seen_blobs[tag], &entry->hash, entry); + if ((entry = fozdb_entry_put( &db->entries, tag, hash ))) + { + entry->size = header.size; + entry->compression = header.compression; + entry->crc = header.crc; + entry->full_size = header.full_size; + entry->offset = offset; + } GST_INFO("Wrote entry: tag %u, hash %s, offset %#"PRIx64", size %#x, crc %#x.", - tag, format_hash(&entry->hash), entry->offset, entry->header.size, entry->header.crc); + tag, format_hash(hash), offset, header.size, header.crc); return CONV_OK; } @@ -680,7 +676,7 @@ int fozdb_discard_entries(struct fozdb *db, struct rb_tree *to_discard) { uint8_t entry_name_and_header[ENTRY_NAME_SIZE + sizeof(struct payload_header)]; uint64_t file_size; - int i, ret; + int ret; GST_DEBUG("db %p, file_name %s, to_discard %p.", db, db->file_name, to_discard); @@ -690,8 +686,7 @@ int fozdb_discard_entries(struct fozdb *db, struct rb_tree *to_discard) GST_ERROR("Failed to seek to file start. %s.", strerror(errno)); return CONV_ERROR_SEEK_FAILED; } - for (i = 0; i < db->num_tags; ++i) - g_hash_table_remove_all(db->seen_blobs[i]); + rb_destroy(&db->entries, fozdb_entry_destroy, NULL); /* Read file header. */ if ((ret = fozdb_read_file_header(db)) < 0) diff --git a/dlls/winegstreamer/media-converter/media-converter.h b/dlls/winegstreamer/media-converter/media-converter.h index 7150c46689b6..4790f1d054e9 100644 --- a/dlls/winegstreamer/media-converter/media-converter.h +++ b/dlls/winegstreamer/media-converter/media-converter.h @@ -113,12 +113,25 @@ struct fozdb_entry { struct rb_entry entry; struct fozdb_key key; + + uint32_t size; + uint32_t compression; + uint32_t crc; + uint32_t full_size; + + uint64_t offset; }; extern int fozdb_entry_compare( const void *key, const struct rb_entry *ptr ); extern void fozdb_entry_destroy( struct rb_entry *entry, void *context ); extern struct fozdb_entry *fozdb_entry_put( struct rb_tree *tree, uint32_t tag, const struct fozdb_hash *hash ); +extern struct rb_entry *fozdb_tag_head( struct rb_tree *tree, uint32_t tag ); +#define FOZDB_FOR_EACH_TAG_ENTRY( e, t, d ) \ + for ((e) = RB_ENTRY_VALUE( fozdb_tag_head( (&(d)->entries), t ), struct fozdb_entry, entry ); \ + (e) != RB_ENTRY_VALUE( 0, struct fozdb_entry, entry ) && (e)->key.tag == (t); \ + (e) = RB_ENTRY_VALUE( rb_next( &e->entry ), struct fozdb_entry, entry )) + struct dump_fozdb { pthread_mutex_t mutex; @@ -129,10 +142,10 @@ struct dump_fozdb struct fozdb { const char *file_name; + struct rb_tree entries; int file; bool read_only; uint64_t write_pos; - GHashTable **seen_blobs; uint32_t num_tags; }; @@ -177,7 +190,6 @@ extern void fozdb_release(struct fozdb *db); extern int fozdb_prepare(struct fozdb *db); extern bool fozdb_has_entry(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash); extern int fozdb_entry_size(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash, uint32_t *size); -extern void fozdb_iter_tag(struct fozdb *db, uint32_t tag, GHashTableIter *iter); extern int fozdb_read_entry_data(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash, uint64_t offset, uint8_t *buffer, size_t size, size_t *read_size, bool with_crc); extern int fozdb_write_entry(struct fozdb *db, uint32_t tag, struct fozdb_hash *hash, diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index d27a1c11a486..9d917daf92d3 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -176,10 +176,9 @@ static int dump_fozdb_open_video(bool create) static void dump_fozdb_discard_transcoded(void) { struct rb_tree to_discard_chunks = {fozdb_entry_compare}; - struct fozdb_hash *stream_id; + struct fozdb_entry *entry; struct fozdb *read_fozdb; char *read_fozdb_path; - GHashTableIter iter; int ret; if (dump_fozdb.already_cleaned) @@ -206,19 +205,18 @@ static void dump_fozdb_discard_transcoded(void) return; } - fozdb_iter_tag(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_STREAM, &iter); - while (g_hash_table_iter_next(&iter, (void **)&stream_id, NULL)) + FOZDB_FOR_EACH_TAG_ENTRY(entry, VIDEO_CONV_FOZ_TAG_STREAM, dump_fozdb.fozdb) { struct fozdb_hash chunk_id; uint32_t chunks_size, i; size_t read_size; - if (fozdb_has_entry(read_fozdb, VIDEO_CONV_FOZ_TAG_OGVDATA, stream_id)) + if (fozdb_has_entry(read_fozdb, VIDEO_CONV_FOZ_TAG_OGVDATA, &entry->key.hash)) { - if (fozdb_entry_size(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_STREAM, stream_id, &chunks_size) == CONV_OK) + if (fozdb_entry_size(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_STREAM, &entry->key.hash, &chunks_size) == CONV_OK) { uint8_t *buffer = calloc(1, chunks_size); - if (fozdb_read_entry_data(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_STREAM, stream_id, + if (fozdb_read_entry_data(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_STREAM, &entry->key.hash, 0, buffer, chunks_size, &read_size, true) == CONV_OK) { for (i = 0; i < read_size / sizeof(chunk_id); ++i) @@ -230,7 +228,7 @@ static void dump_fozdb_discard_transcoded(void) free(buffer); } - fozdb_entry_put(&to_discard_chunks, VIDEO_CONV_FOZ_TAG_STREAM, stream_id); + fozdb_entry_put(&to_discard_chunks, VIDEO_CONV_FOZ_TAG_STREAM, &entry->key.hash); } } From 81da423d2fe069fa655a5f6a9d6c1b52f1cc2864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 5 Dec 2024 11:14:23 +0100 Subject: [PATCH 0565/2542] winegstreamer/media-converter: Avoid unnecessary fozdb_entry_size calls. --- dlls/winegstreamer/media-converter/audioconv.c | 8 ++++---- dlls/winegstreamer/media-converter/videoconv.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/winegstreamer/media-converter/audioconv.c b/dlls/winegstreamer/media-converter/audioconv.c index ef085dcd6c67..11cde2f8d4ad 100644 --- a/dlls/winegstreamer/media-converter/audioconv.c +++ b/dlls/winegstreamer/media-converter/audioconv.c @@ -304,14 +304,14 @@ static void dump_fozdb_discard_transcoded(void) FOZDB_FOR_EACH_TAG_ENTRY(entry, AUDIO_CONV_FOZ_TAG_STREAM, dump_fozdb.fozdb) { - uint32_t chunks_size, i; + uint32_t i; size_t read_size; - if (fozdb_entry_size(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, &entry->key.hash, &chunks_size) == CONV_OK) + if (entry->full_size) { - uint8_t *buffer = calloc(1, chunks_size); + uint8_t *buffer = calloc(1, entry->full_size); if (fozdb_read_entry_data(dump_fozdb.fozdb, AUDIO_CONV_FOZ_TAG_STREAM, &entry->key.hash, - 0, buffer, chunks_size, &read_size, true) == CONV_OK) + 0, buffer, entry->full_size, &read_size, true) == CONV_OK) { struct rb_tree stream_chunks = {fozdb_entry_compare}; bool has_all = true; diff --git a/dlls/winegstreamer/media-converter/videoconv.c b/dlls/winegstreamer/media-converter/videoconv.c index 9d917daf92d3..d8b77e5e1726 100644 --- a/dlls/winegstreamer/media-converter/videoconv.c +++ b/dlls/winegstreamer/media-converter/videoconv.c @@ -208,16 +208,16 @@ static void dump_fozdb_discard_transcoded(void) FOZDB_FOR_EACH_TAG_ENTRY(entry, VIDEO_CONV_FOZ_TAG_STREAM, dump_fozdb.fozdb) { struct fozdb_hash chunk_id; - uint32_t chunks_size, i; + uint32_t i; size_t read_size; if (fozdb_has_entry(read_fozdb, VIDEO_CONV_FOZ_TAG_OGVDATA, &entry->key.hash)) { - if (fozdb_entry_size(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_STREAM, &entry->key.hash, &chunks_size) == CONV_OK) + if (entry->full_size) { - uint8_t *buffer = calloc(1, chunks_size); + uint8_t *buffer = calloc(1, entry->full_size); if (fozdb_read_entry_data(dump_fozdb.fozdb, VIDEO_CONV_FOZ_TAG_STREAM, &entry->key.hash, - 0, buffer, chunks_size, &read_size, true) == CONV_OK) + 0, buffer, entry->full_size, &read_size, true) == CONV_OK) { for (i = 0; i < read_size / sizeof(chunk_id); ++i) { From 291b24049f4a43caaaa74e26a1f865260870752b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 5 Dec 2024 14:27:23 +0100 Subject: [PATCH 0566/2542] winedmo: Avoid seeking past the end of stream. --- dlls/winedmo/unixlib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/winedmo/unixlib.c b/dlls/winedmo/unixlib.c index 15500ee10b4f..431b612d7d6f 100644 --- a/dlls/winedmo/unixlib.c +++ b/dlls/winedmo/unixlib.c @@ -45,6 +45,7 @@ int64_t unix_seek_callback( void *opaque, int64_t offset, int whence ) if (whence == AVSEEK_SIZE) return context->length; if (whence == SEEK_END) offset += context->length; if (whence == SEEK_CUR) offset += context->position; + if ((UINT64)offset > context->length) offset = context->length; params.offset = offset; status = KeUserDispatchCallback( ¶ms.dispatch, sizeof(params), &ret_ptr, &ret_len ); From d05a187f42b593cb83fde1c4380fb0212b6a7bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 5 Dec 2024 14:27:44 +0100 Subject: [PATCH 0567/2542] winedmo: Avoid reading past the end of stream. --- dlls/winedmo/unixlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winedmo/unixlib.c b/dlls/winedmo/unixlib.c index 431b612d7d6f..fd563eef6bff 100644 --- a/dlls/winedmo/unixlib.c +++ b/dlls/winedmo/unixlib.c @@ -63,7 +63,7 @@ int unix_read_callback( void *opaque, uint8_t *buffer, int size ) TRACE( "opaque %p, buffer %p, size %#x\n", opaque, buffer, size ); - if (!size) return AVERROR_EOF; + if (!(size = min( (UINT64)size, context->length - context->position ))) return AVERROR_EOF; do { From 3af2cc5525597ed7391abe8d56a6a1dfe41ca54c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 25 Oct 2024 14:09:01 +0200 Subject: [PATCH 0568/2542] winedmo: Use the stream context to cache stream chunks. --- dlls/winedmo/main.c | 5 ++-- dlls/winedmo/unixlib.c | 63 +++++++++++++++++++++++++++--------------- dlls/winedmo/unixlib.h | 10 ++++--- 3 files changed, 50 insertions(+), 28 deletions(-) diff --git a/dlls/winedmo/main.c b/dlls/winedmo/main.c index 1e91d8e2e517..849c1e675cb7 100644 --- a/dlls/winedmo/main.c +++ b/dlls/winedmo/main.c @@ -30,11 +30,12 @@ static struct stream_context *stream_context_create( struct winedmo_stream *stre { struct stream_context *context; - if (!(context = malloc( 0x10000 ))) return NULL; + if (!(context = malloc( sizeof(*context) + 0x10000 ))) return NULL; context->stream = (UINT_PTR)stream; context->length = stream_size; context->position = 0; - context->buffer_size = 0x10000 - offsetof(struct stream_context, buffer); + context->capacity = 0x10000; + context->size = 0; return context; } diff --git a/dlls/winedmo/unixlib.c b/dlls/winedmo/unixlib.c index fd563eef6bff..ea0ccde85453 100644 --- a/dlls/winedmo/unixlib.c +++ b/dlls/winedmo/unixlib.c @@ -47,42 +47,61 @@ int64_t unix_seek_callback( void *opaque, int64_t offset, int whence ) if (whence == SEEK_CUR) offset += context->position; if ((UINT64)offset > context->length) offset = context->length; - params.offset = offset; - status = KeUserDispatchCallback( ¶ms.dispatch, sizeof(params), &ret_ptr, &ret_len ); - if (status || ret_len != sizeof(UINT64)) return AVERROR( EINVAL ); - offset = *(UINT64 *)ret_ptr; + if (offset / context->capacity != context->position / context->capacity) + { + for (;;) + { + /* seek stream to multiples of buffer capacity */ + params.offset = (offset / context->capacity) * context->capacity; + status = KeUserDispatchCallback( ¶ms.dispatch, sizeof(params), &ret_ptr, &ret_len ); + if (status || ret_len != sizeof(UINT64)) return AVERROR( EINVAL ); + if (*(UINT64 *)ret_ptr == params.offset) break; + offset = *(UINT64 *)ret_ptr; + } + context->size = 0; + } context->position = offset; return offset; } +static int stream_context_read( struct stream_context *context ) +{ + struct read_callback_params params = {.dispatch = {.callback = read_callback}, .context = (UINT_PTR)context}; + void *ret_ptr; + ULONG ret_len; + int status; + + params.size = context->capacity; + status = KeUserDispatchCallback( ¶ms.dispatch, sizeof(params), &ret_ptr, &ret_len ); + if (status || ret_len != sizeof(ULONG)) return AVERROR( EINVAL ); + context->size = *(ULONG *)ret_ptr; + return 0; +} + int unix_read_callback( void *opaque, uint8_t *buffer, int size ) { struct stream_context *context = opaque; - int ret, status, total = 0; - - TRACE( "opaque %p, buffer %p, size %#x\n", opaque, buffer, size ); + int ret, total = 0; if (!(size = min( (UINT64)size, context->length - context->position ))) return AVERROR_EOF; - do + while (size) { - struct read_callback_params params = {.dispatch = {.callback = read_callback}, .context = (UINT_PTR)context}; - void *ret_ptr; - ULONG ret_len; - - params.size = min( size, context->buffer_size ); - status = KeUserDispatchCallback( ¶ms.dispatch, sizeof(params), &ret_ptr, &ret_len ); - if (status || ret_len != sizeof(ULONG)) return AVERROR( EINVAL ); - if (!(ret = *(ULONG *)ret_ptr)) break; - memcpy( buffer, context->buffer, ret ); - buffer += ret; - total += ret; - size -= ret; - } while (size && ret == context->buffer_size); + int step, buffer_offset = context->position % context->capacity; + + if (!context->size && (ret = stream_context_read( context )) < 0) return ret; + if (!(step = min( size, context->size - buffer_offset ))) break; + memcpy( buffer, context->buffer + buffer_offset, step ); + buffer += step; + total += step; + size -= step; + + context->position += step; + if (!(context->position % context->capacity)) context->size = 0; + } if (!total) return AVERROR_EOF; - context->position += total; return total; } diff --git a/dlls/winedmo/unixlib.h b/dlls/winedmo/unixlib.h index cf37bd5342a4..b23f786fe472 100644 --- a/dlls/winedmo/unixlib.h +++ b/dlls/winedmo/unixlib.h @@ -40,10 +40,12 @@ struct process_attach_params struct stream_context { - UINT64 stream; - UINT64 length; - UINT64 position; - UINT64 buffer_size; + UINT64 stream; /* client-side stream handle */ + UINT64 length; /* total length of the stream */ + UINT64 position; /* current position in the stream */ + + UINT32 capacity; /* total allocated capacity for the buffer */ + UINT32 size; /* current data size in the buffer */ BYTE buffer[]; }; From b9debe2bb6b4053eac4ca1afae1e2827611c93f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 25 Oct 2024 14:09:01 +0200 Subject: [PATCH 0569/2542] winedmo: Return container duration if no stream duration is found. --- dlls/winedmo/unix_demuxer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/winedmo/unix_demuxer.c b/dlls/winedmo/unix_demuxer.c index 15d906e0c5f9..8a1499dce8e5 100644 --- a/dlls/winedmo/unix_demuxer.c +++ b/dlls/winedmo/unix_demuxer.c @@ -79,6 +79,7 @@ static INT64 get_context_duration( const AVFormatContext *ctx ) if (max_duration == AV_NOPTS_VALUE) max_duration = duration; } + if (max_duration == AV_NOPTS_VALUE) return get_user_time( ctx->duration, AV_TIME_BASE_Q ); return max_duration; } From d10c97c23bbe98ab0ba735ec30e0f73f0c1c1508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 6 Dec 2024 01:07:58 +0100 Subject: [PATCH 0570/2542] HACK: winedmo: Return STATUS_END_OF_FILE on error. --- dlls/winedmo/unix_demuxer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winedmo/unix_demuxer.c b/dlls/winedmo/unix_demuxer.c index 8a1499dce8e5..34011a73910d 100644 --- a/dlls/winedmo/unix_demuxer.c +++ b/dlls/winedmo/unix_demuxer.c @@ -265,7 +265,7 @@ static NTSTATUS demuxer_filter_packet( struct demuxer *demuxer, AVPacket **packe } while (!ret || ret == AVERROR(EAGAIN)); ERR( "Failed to read packet from demuxer %p, error %s.\n", demuxer, debugstr_averr( ret ) ); - return STATUS_UNSUCCESSFUL; + return STATUS_END_OF_FILE; } NTSTATUS demuxer_read( void *arg ) From 1772de52ad274357bd19a6623957cf6e5ad63bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 5 Dec 2024 15:00:43 +0100 Subject: [PATCH 0571/2542] HACK: winegstreamer/video_decoder: Support decoding theora video. --- dlls/winegstreamer/mfplat.c | 1 + dlls/winegstreamer/video_decoder.c | 2 ++ dlls/winegstreamer/wg_media_type.c | 11 +++++++++++ 3 files changed, 14 insertions(+) diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index 35777a552f9a..6cde52069bcd 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -44,6 +44,7 @@ DEFINE_MEDIATYPE_GUID(MFVideoFormat_VC1S,MAKEFOURCC('V','C','1','S')); DEFINE_MEDIATYPE_GUID(MFVideoFormat_IV50,MAKEFOURCC('I','V','5','0')); DEFINE_MEDIATYPE_GUID(MFVideoFormat_ABGR32,D3DFMT_A8B8G8R8); DEFINE_GUID(MEDIASUBTYPE_WMV_Unknown, 0x7ce12ca9,0xbfbf,0x43d9,0x9d,0x00,0x82,0xb8,0xed,0x54,0x31,0x6b); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_theora,MAKEFOURCC('t','h','e','o')); struct class_factory { diff --git a/dlls/winegstreamer/video_decoder.c b/dlls/winegstreamer/video_decoder.c index efedff5e983b..5d928d2c03c2 100644 --- a/dlls/winegstreamer/video_decoder.c +++ b/dlls/winegstreamer/video_decoder.c @@ -1696,6 +1696,7 @@ HRESULT WINAPI winegstreamer_create_video_decoder(IMFTransform **out) extern const GUID MEDIASUBTYPE_VC1S; extern const GUID MEDIASUBTYPE_WMV_Unknown; +extern const GUID MFVideoFormat_theora; static const GUID *const wmv_decoder_input_types[] = { &MEDIASUBTYPE_WMV1, @@ -1707,6 +1708,7 @@ static const GUID *const wmv_decoder_input_types[] = &MEDIASUBTYPE_WVC1, &MEDIASUBTYPE_WMV3, &MEDIASUBTYPE_VC1S, + &MFVideoFormat_theora, }; static const GUID *const wmv_decoder_output_types[] = { diff --git a/dlls/winegstreamer/wg_media_type.c b/dlls/winegstreamer/wg_media_type.c index 9e204567b8b6..ef4c915278eb 100644 --- a/dlls/winegstreamer/wg_media_type.c +++ b/dlls/winegstreamer/wg_media_type.c @@ -63,6 +63,7 @@ DEFINE_MEDIATYPE_GUID(MFVideoFormat_CVID,MAKEFOURCC('c','v','i','d')); DEFINE_MEDIATYPE_GUID(MFVideoFormat_IV50,MAKEFOURCC('I','V','5','0')); DEFINE_MEDIATYPE_GUID(MFVideoFormat_VC1S,MAKEFOURCC('V','C','1','S')); DEFINE_MEDIATYPE_GUID(MFVideoFormat_ABGR32,D3DFMT_A8B8G8R8); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_theora,MAKEFOURCC('t','h','e','o')); static void init_caps_codec_data(GstCaps *caps, const void *codec_data, int codec_data_size) { @@ -349,6 +350,14 @@ static void init_caps_from_video_mpeg(GstCaps *caps, const struct mpeg_video_for gst_caps_set_simple(caps, "parsed", G_TYPE_BOOLEAN, TRUE, NULL); } +static void init_caps_from_video_theora(GstCaps *caps, const MFVIDEOFORMAT *format, UINT format_size) +{ + init_caps_codec_data(caps, format + 1, format_size - sizeof(*format)); + + gst_structure_remove_field(gst_caps_get_structure(caps, 0), "format"); + gst_structure_set_name(gst_caps_get_structure(caps, 0), "video/x-theora"); +} + static void init_caps_from_video_subtype(GstCaps *caps, const GUID *subtype, const void *format, UINT format_size) { if (IsEqualGUID(subtype, &MFVideoFormat_CVID)) @@ -369,6 +378,8 @@ static void init_caps_from_video_subtype(GstCaps *caps, const GUID *subtype, con return init_caps_from_video_indeo(caps, format, format_size); if (IsEqualGUID(subtype, &MEDIASUBTYPE_MPEG1Payload)) return init_caps_from_video_mpeg(caps, format, format_size); + if (IsEqualGUID(subtype, &MFVideoFormat_theora)) + return init_caps_from_video_theora(caps, format, format_size); GST_FIXME("Unsupported subtype " WG_GUID_FORMAT, WG_GUID_ARGS(*subtype)); } From 30eba3e5502798305cf2ee389afb9afbcbf1afc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 5 Dec 2024 15:00:43 +0100 Subject: [PATCH 0572/2542] HACK: wmvdecod: Support decoding theora video. --- dlls/wmvdecod/video_decoder.c | 1 + dlls/wmvdecod/wmvdecod.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/dlls/wmvdecod/video_decoder.c b/dlls/wmvdecod/video_decoder.c index 7c4c0ddd6830..79b1c12362e2 100644 --- a/dlls/wmvdecod/video_decoder.c +++ b/dlls/wmvdecod/video_decoder.c @@ -22,6 +22,7 @@ DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_VC1S,MAKEFOURCC('V','C','1','S')); DEFINE_GUID(MEDIASUBTYPE_WMV_Unknown, 0x7ce12ca9,0xbfbf,0x43d9,0x9d,0x00,0x82,0xb8,0xed,0x54,0x31,0x6b); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_theora,MAKEFOURCC('t','h','e','o')); static HRESULT WINAPI h264_decoder_factory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **out) diff --git a/dlls/wmvdecod/wmvdecod.c b/dlls/wmvdecod/wmvdecod.c index 3a4e49b89dea..aba1750d1bd4 100644 --- a/dlls/wmvdecod/wmvdecod.c +++ b/dlls/wmvdecod/wmvdecod.c @@ -25,6 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmo); +extern GUID MFVideoFormat_theora; extern GUID MEDIASUBTYPE_WMV_Unknown; extern GUID MEDIASUBTYPE_VC1S; @@ -65,6 +66,7 @@ HRESULT WINAPI DllRegisterServer(void) {MFMediaType_Video, MEDIASUBTYPE_WMVA}, {MFMediaType_Video, MFVideoFormat_WVC1}, {MFMediaType_Video, MEDIASUBTYPE_VC1S}, + {MFMediaType_Video, MFVideoFormat_theora}, }; MFT_REGISTER_TYPE_INFO wmv_decoder_mft_outputs[] = { @@ -104,6 +106,7 @@ HRESULT WINAPI DllRegisterServer(void) {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_WMVP}, {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_WVP2}, {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_VC1S}, + {.type = MEDIATYPE_Video, .subtype = MFVideoFormat_theora}, }; HRESULT hr; From b9cc0a558434fbc337a447ff7c0fca325f411db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 9 Dec 2024 22:37:24 +0100 Subject: [PATCH 0573/2542] winedmo: Return an integer from wave_format_tag_from_codec_id. --- dlls/winedmo/unix_media_type.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/winedmo/unix_media_type.c b/dlls/winedmo/unix_media_type.c index ff4625530aa9..f5824d3af219 100644 --- a/dlls/winedmo/unix_media_type.c +++ b/dlls/winedmo/unix_media_type.c @@ -67,7 +67,7 @@ static inline const char *debugstr_area( const MFVideoArea *area ) } \ } while (0) -static WORD wave_format_tag_from_codec_id( enum AVCodecID id ) +static UINT wave_format_tag_from_codec_id( enum AVCodecID id ) { const struct AVCodecTag *table[] = {avformat_get_riff_audio_tags(), avformat_get_mov_audio_tags(), 0}; return av_codec_get_tag( table, id ); @@ -161,9 +161,8 @@ static NTSTATUS heaac_wave_format_from_codec_params( const AVCodecParameters *pa static NTSTATUS audio_format_from_codec_params( const AVCodecParameters *params, void *format, UINT32 *format_size ) { - UINT wave_format_size = sizeof(WAVEFORMATEX); + UINT format_tag, wave_format_size = sizeof(WAVEFORMATEX); UINT64 channel_mask; - WORD format_tag; int channels; if (params->codec_id == AV_CODEC_ID_AAC) return heaac_wave_format_from_codec_params( params, format, format_size ); From b9eb96cb0ba60d12f994a6e89b1aefe5ba0e1ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 9 Dec 2024 22:37:24 +0100 Subject: [PATCH 0574/2542] winedmo: Handle vorbis media type conversion explicitly. --- dlls/winedmo/unix_media_type.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/winedmo/unix_media_type.c b/dlls/winedmo/unix_media_type.c index f5824d3af219..3c492699326c 100644 --- a/dlls/winedmo/unix_media_type.c +++ b/dlls/winedmo/unix_media_type.c @@ -184,10 +184,14 @@ static NTSTATUS audio_format_from_codec_params( const AVCodecParameters *params, #endif format_tag = wave_format_tag_from_codec_id( params->codec_id ); - if (format_tag == WAVE_FORMAT_EXTENSIBLE || format_tag >> 16 || (channels > 2 && channel_mask != 0)) + if (format_tag == WAVE_FORMAT_EXTENSIBLE || format_tag >> 16 || (channels > 2 && channel_mask != 0) || + params->codec_id == AV_CODEC_ID_VORBIS) { GUID subtype = MFAudioFormat_Base; - subtype.Data1 = format_tag; + + if (params->codec_id == AV_CODEC_ID_VORBIS) subtype = MFAudioFormat_Vorbis; + else subtype.Data1 = format_tag; + wave_format_size += sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX); return wave_format_extensible_from_codec_params( params, format, format_size, wave_format_size, &subtype, channel_mask ); From 354eeac0af12dc20ff091f04cabcc612ec9a47b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 5 Dec 2024 09:51:58 +0100 Subject: [PATCH 0575/2542] HACK: winedmo/media-converter: Implement media converter demuxer. --- dlls/winedmo/Makefile.in | 6 + dlls/winedmo/unix_demuxer.c | 16 +- dlls/winedmo/unix_demuxer_mediaconv.c | 279 ++++++++++++++++++ dlls/winedmo/unix_private.h | 6 + .../winegstreamer/media-converter/fossilize.c | 19 ++ dlls/winegstreamer/media-converter/lib.c | 15 + .../media-converter/media-converter.h | 15 + dlls/winegstreamer/media-converter/murmur3.c | 1 + 8 files changed, 354 insertions(+), 3 deletions(-) create mode 100644 dlls/winedmo/unix_demuxer_mediaconv.c diff --git a/dlls/winedmo/Makefile.in b/dlls/winedmo/Makefile.in index 9b33d859d6aa..1cf228ffacd6 100644 --- a/dlls/winedmo/Makefile.in +++ b/dlls/winedmo/Makefile.in @@ -4,9 +4,15 @@ IMPORTLIB = winedmo IMPORTS = mfuuid UNIX_CFLAGS = $(FFMPEG_CFLAGS) UNIX_LIBS = $(FFMPEG_LIBS) $(PTHREAD_LIBS) +PARENTSRC = ../winegstreamer +EXTRADEFS = -D_WINEDMO SOURCES = \ main.c \ + media-converter/fossilize.c \ + media-converter/murmur3.c \ + media-converter/lib.c \ unix_demuxer.c \ + unix_demuxer_mediaconv.c \ unix_media_type.c \ unixlib.c diff --git a/dlls/winedmo/unix_demuxer.c b/dlls/winedmo/unix_demuxer.c index 34011a73910d..13759cf7fb5f 100644 --- a/dlls/winedmo/unix_demuxer.c +++ b/dlls/winedmo/unix_demuxer.c @@ -43,6 +43,7 @@ struct stream struct demuxer { AVFormatContext *ctx; + struct stream_context *stream_context; struct stream *streams; AVPacket *last_packet; /* last read packet */ @@ -98,9 +99,9 @@ NTSTATUS demuxer_check( void *arg ) else if (!strcmp( params->mime_type, "audio/mp3" )) format = av_find_input_format( "mp3" ); if (format) TRACE( "Found format %s (%s)\n", format->name, format->long_name ); - else FIXME( "Unsupported MIME type %s\n", debugstr_a(params->mime_type) ); + else WARN( "Found MIME type %s\n", debugstr_a(params->mime_type) ); - return format ? STATUS_SUCCESS : STATUS_NOT_SUPPORTED; + return STATUS_SUCCESS; } static NTSTATUS demuxer_create_streams( struct demuxer *demuxer ) @@ -144,11 +145,17 @@ NTSTATUS demuxer_create( void *arg ) TRACE( "context %p, url %s, mime %s\n", params->context, debugstr_a(params->url), debugstr_a(params->mime_type) ); + mediaconv_demuxer_init(); + if (!(demuxer = calloc( 1, sizeof(*demuxer) ))) return STATUS_NO_MEMORY; + demuxer->stream_context = params->context; + if (!(demuxer->ctx = avformat_alloc_context())) goto failed; if (!(demuxer->ctx->pb = avio_alloc_context( NULL, 0, 0, params->context, unix_read_callback, NULL, unix_seek_callback ))) goto failed; if ((ret = avformat_open_input( &demuxer->ctx, NULL, NULL, NULL )) < 0) + WARN( "Failed to open input, error %s.\n", debugstr_averr(ret) ); + if ((ret = mediaconv_demuxer_open( &demuxer->ctx, params->context ) < 0)) { ERR( "Failed to open input, error %s.\n", debugstr_averr(ret) ); goto failed; @@ -198,6 +205,8 @@ NTSTATUS demuxer_create( void *arg ) av_bsf_free( &demuxer->streams[i].filter ); free( demuxer->streams ); free( demuxer ); + + mediaconv_demuxer_exit(); return STATUS_UNSUCCESSFUL; } @@ -209,7 +218,7 @@ NTSTATUS demuxer_destroy( void *arg ) TRACE( "demuxer %p\n", demuxer ); - params->context = demuxer->ctx->pb->opaque; + params->context = demuxer->stream_context; avio_context_free( &demuxer->ctx->pb ); avformat_free_context( demuxer->ctx ); for (i = 0; i < demuxer->ctx->nb_streams; i++) @@ -217,6 +226,7 @@ NTSTATUS demuxer_destroy( void *arg ) free( demuxer->streams ); free( demuxer ); + mediaconv_demuxer_exit(); return STATUS_SUCCESS; } diff --git a/dlls/winedmo/unix_demuxer_mediaconv.c b/dlls/winedmo/unix_demuxer_mediaconv.c new file mode 100644 index 000000000000..3bbf59ea7367 --- /dev/null +++ b/dlls/winedmo/unix_demuxer_mediaconv.c @@ -0,0 +1,279 @@ +/* + * Copyright 2024 Rémi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "config.h" +#include "unix_private.h" + +#include + +#include "media-converter/media-converter.h" +#include "wine/debug.h" +#include "wine/list.h" + +#ifdef HAVE_FFMPEG + +WINE_DEFAULT_DEBUG_CHANNEL(dmo); + +#define HASH_CHUNK_SIZE (8 * 1024 * 1024) /* 8 MB. */ +#define HASH_STRIDE (HASH_CHUNK_SIZE * 6) + +#define VIDEO_CONV_FOZ_TAG_VIDEODATA 0 +#define VIDEO_CONV_FOZ_TAG_OGVDATA 1 +#define VIDEO_CONV_FOZ_TAG_STREAM 2 +#define VIDEO_CONV_FOZ_TAG_MKVDATA 3 +#define VIDEO_CONV_FOZ_TAG_CODEC 4 +#define VIDEO_CONV_FOZ_NUM_TAGS 5 + +static pthread_mutex_t fozdb_lock = PTHREAD_MUTEX_INITIALIZER; +static struct fozdb *dump_db, *read_db; +static int fozdb_users; + +static int64_t mediaconv_demuxer_seek_callback( void *opaque, int64_t offset, int whence ) +{ + struct stream_context *context = opaque; + + TRACE( "opaque %p, offset %#"PRIx64", whence %#x\n", opaque, offset, whence ); + + if (whence == AVSEEK_SIZE) return context->length; + if (whence == SEEK_END) offset += context->length; + if (whence == SEEK_CUR) offset += context->position; + if (offset > context->length) offset = context->length; + + context->position = offset; + return offset; +} + +static int mediaconv_demuxer_read_callback( void *opaque, uint8_t *buffer, int size ) +{ + struct stream_context *context = opaque; + struct fozdb_entry *entry = *(struct fozdb_entry **)context->buffer; + size_t read_size; + int ret; + + TRACE( "opaque %p, buffer %p, size %#x\n", opaque, buffer, size ); + + if (!size) return AVERROR_EOF; + + pthread_mutex_lock( &fozdb_lock ); + ret = fozdb_read_entry_data( read_db, entry->key.tag, &entry->key.hash, context->position, + buffer, size, &read_size, false ); + pthread_mutex_unlock( &fozdb_lock ); + + context->position += read_size; + if (ret < 0 && ret != CONV_ERROR_DATA_END) return AVERROR(EIO); + return read_size ? read_size : AVERROR_EOF; +} + +void mediaconv_demuxer_init(void) +{ + pthread_mutex_lock( &fozdb_lock ); + + if (!fozdb_users++) + { + const char *dump_path, *read_path; + + dump_path = getenv( "MEDIACONV_VIDEO_DUMP_FILE" ); + read_path = getenv( "MEDIACONV_VIDEO_TRANSCODED_FILE" ); + TRACE( "dump_path %s, read_path %s\n", debugstr_a(dump_path), debugstr_a(read_path) ); + + if (!read_path || fozdb_create( read_path, O_RDONLY, true, VIDEO_CONV_FOZ_NUM_TAGS, &read_db ) < 0) read_db = NULL; + if (!dump_path || fozdb_create( dump_path, O_RDWR | O_CREAT, false, VIDEO_CONV_FOZ_NUM_TAGS, &dump_db ) < 0) dump_db = NULL; + } + + pthread_mutex_unlock( &fozdb_lock ); +} + +void mediaconv_demuxer_exit(void) +{ + pthread_mutex_lock( &fozdb_lock ); + + if (!fozdb_users--) + { + TRACE( "closing databases\n" ); + if (read_db) fozdb_release( read_db ); + if (dump_db) fozdb_release( dump_db ); + read_db = dump_db = NULL; + } + + pthread_mutex_unlock( &fozdb_lock ); +} + +static int stream_hasher_read( void *opaque, uint8_t *buffer, size_t size, size_t *read_size ) +{ + struct stream_context *context = opaque; + size_t total = 0; + int ret = 0; + + while (size) + { + int step; + + if (context->position < HASH_STRIDE) step = min( size, HASH_STRIDE - context->position ); + else step = min( size, HASH_CHUNK_SIZE - (context->position % HASH_CHUNK_SIZE) ); + + if ((ret = unix_read_callback( context, buffer, step )) < 0) break; + buffer += ret; + total += ret; + size -= ret; + + if (context->position > HASH_STRIDE && !(context->position % HASH_CHUNK_SIZE)) + unix_seek_callback( context, HASH_STRIDE - HASH_CHUNK_SIZE, SEEK_CUR ); + } + + *read_size = total; + if (ret < 0 && ret != AVERROR_EOF) return CONV_ERROR_READ_FAILED; + return total ? CONV_OK : CONV_ERROR_DATA_END; +} + +struct hash_entry +{ + struct list entry; + struct fozdb_hash hash; +}; + +static int dump_chunk_data( const void *buffer, size_t read_size, struct list *hashes ) +{ + struct bytes_reader bytes_reader; + struct hash_entry *entry; + + if (!(entry = calloc( 1, sizeof(*entry) ))) return AVERROR(ENOMEM); + + bytes_reader_init( &bytes_reader, buffer, read_size ); + murmur3_128( &bytes_reader, bytes_reader_read, HASH_SEED, &entry->hash ); + list_add_tail( hashes, &entry->entry ); + + bytes_reader_init( &bytes_reader, buffer, read_size ); + return fozdb_write_entry( dump_db, VIDEO_CONV_FOZ_TAG_VIDEODATA, &entry->hash, + &bytes_reader, bytes_reader_read, true ); +} + +static int chunk_hasher_read( void *opaque, uint8_t *buffer, size_t size, size_t *read_size ) +{ + struct fozdb_hash *hash = (struct fozdb_hash *)buffer; + struct list *ptr, *hashes = opaque; + struct hash_entry *entry; + + *read_size = 0; + if (!size) return CONV_OK; + if (!(ptr = list_head( hashes ))) return CONV_ERROR_DATA_END; + if (size < sizeof(*hash)) return CONV_ERROR_INVALID_ARGUMENT; + + entry = LIST_ENTRY( ptr, struct hash_entry, entry ); + list_remove( &entry->entry ); + *read_size = sizeof(*hash); + *hash = entry->hash; + free( entry ); + + return CONV_OK; +} + +int mediaconv_demuxer_open( AVFormatContext **ctx, struct stream_context *context ) +{ + struct fozdb_entry *transcoded = NULL; + struct fozdb_hash stream_hash; + void *buffer; + int i, ret; + + if (*ctx) + { + AVCodecParameters *par; + for (i = 0; i < (*ctx)->nb_streams; i++) + { + par = (*ctx)->streams[i]->codecpar; + if (!par->codec_id) FIXME( "Ignoring unknown codec on stream %u\n", i ); + else if (!avcodec_find_decoder( par->codec_id )) break; + } + if (i == (*ctx)->nb_streams) return 0; + + WARN( "Failed to find decoder for stream %u, codec %#x %s\n", i, par->codec_id, avcodec_get_name(par->codec_id) ); + avio_context_free( &(*ctx)->pb ); + avformat_free_context( *ctx ); + } + + if (!(buffer = calloc( 1, HASH_CHUNK_SIZE ))) return AVERROR(ENOMEM); + + if ((ret = unix_seek_callback( context, 0, SEEK_SET )) < 0) return ret; + if (!murmur3_128( context, stream_hasher_read, HASH_SEED, &stream_hash )) return AVERROR(EINVAL); + TRACE( "stream hash %s\n", debugstr_fozdb_hash( &stream_hash ) ); + + pthread_mutex_lock( &fozdb_lock ); + + if (read_db && (transcoded = fozdb_entry_get( &read_db->entries, VIDEO_CONV_FOZ_TAG_MKVDATA, &stream_hash ))) + TRACE( "Found mkv stream for %s\n", debugstr_fozdb_hash( &stream_hash ) ); + else if (read_db && (transcoded = fozdb_entry_get( &read_db->entries, VIDEO_CONV_FOZ_TAG_OGVDATA, &stream_hash ))) + TRACE( "Found ogv stream for %s\n", debugstr_fozdb_hash( &stream_hash ) ); + else if (!dump_db) + TRACE( "No dump fozdb for stream %s\n", debugstr_fozdb_hash( &stream_hash ) ); + else + { + struct list hashes = LIST_INIT(hashes); + TRACE( "Transcoded stream %s not found, dumping\n", debugstr_fozdb_hash( &stream_hash ) ); + + unix_seek_callback( context, 0, SEEK_SET ); + while ((ret = unix_read_callback( context, buffer, HASH_CHUNK_SIZE )) > 0) + { + if ((ret = dump_chunk_data( buffer, ret, &hashes )) < 0) + { + ERR("Error writing video data to fozdb, ret %d\n.", ret); + break; + } + } + + if ((ret = fozdb_write_entry( dump_db, VIDEO_CONV_FOZ_TAG_STREAM, &stream_hash, + &hashes, chunk_hasher_read, true )) < 0) + ERR("Error writing stream data to fozdb, ret %d.", ret); + } + + pthread_mutex_unlock( &fozdb_lock ); + + if (transcoded) + { + context->position = 0; + context->length = transcoded->full_size; + *(struct fozdb_entry **)context->buffer = transcoded; + + if (!(*ctx = avformat_alloc_context())) return AVERROR(ENOMEM); + if (!((*ctx)->pb = avio_alloc_context( NULL, 0, 0, context, mediaconv_demuxer_read_callback, + NULL, mediaconv_demuxer_seek_callback ))) + { + avformat_free_context( *ctx ); + return AVERROR(ENOMEM); + } + } + else + { + const char *blank_path; + int ret; + + if (!(blank_path = getenv( "MEDIACONV_BLANK_VIDEO_FILE" ))) return AVERROR(ENOENT); + if (!(*ctx = avformat_alloc_context())) return AVERROR(ENOMEM); + if ((ret = avio_open( &(*ctx)->pb, blank_path, AVIO_FLAG_READ )) < 0) + { + avformat_free_context( *ctx ); + return ret; + } + } + + return avformat_open_input( ctx, NULL, NULL, NULL ); +} + +#endif /* HAVE_FFMPEG */ diff --git a/dlls/winedmo/unix_private.h b/dlls/winedmo/unix_private.h index 8192926bfc4f..53391118f530 100644 --- a/dlls/winedmo/unix_private.h +++ b/dlls/winedmo/unix_private.h @@ -31,6 +31,7 @@ # include #endif #else +typedef struct AVFormatContext AVFormatContext; typedef struct AVCodecParameters AVCodecParameters; typedef struct AVRational AVRational; #endif /* HAVE_FFMPEG */ @@ -38,6 +39,11 @@ typedef struct AVRational AVRational; #include "unixlib.h" #include "wine/debug.h" +/* media-converter/demuxer.c */ +extern void mediaconv_demuxer_init(void); +extern void mediaconv_demuxer_exit(void); +extern int mediaconv_demuxer_open( AVFormatContext **ctx, struct stream_context *context ); + /* unixlib.c */ extern int64_t unix_seek_callback( void *opaque, int64_t offset, int whence ); extern int unix_read_callback( void *opaque, uint8_t *buffer, int size ); diff --git a/dlls/winegstreamer/media-converter/fossilize.c b/dlls/winegstreamer/media-converter/fossilize.c index 36148d0c3ba7..5f531f0ff383 100644 --- a/dlls/winegstreamer/media-converter/fossilize.c +++ b/dlls/winegstreamer/media-converter/fossilize.c @@ -32,8 +32,18 @@ #pragma makedep unix #endif +#include "config.h" + #include "media-converter.h" +#ifdef _WINEDMO + +#include +#include "wine/debug.h" +WINE_DEFAULT_DEBUG_CHANNEL(dmo); + +#endif /* _WINEDMO */ + /* Fossilize StreamArchive database format version 6: * * The file consists of a header, followed by an unlimited series of "entries". @@ -122,6 +132,15 @@ struct fozdb_entry *fozdb_entry_put( struct rb_tree *tree, uint32_t tag, const s return entry; } +struct fozdb_entry *fozdb_entry_get( struct rb_tree *tree, uint32_t tag, const struct fozdb_hash *hash ) +{ + struct fozdb_key key = {.tag = tag, .hash = *hash}; + struct rb_entry *ptr; + + if (!(ptr = rb_get( tree, &key ))) return NULL; + return RB_ENTRY_VALUE( ptr, struct fozdb_entry, entry ); +} + struct rb_entry *fozdb_tag_head( struct rb_tree *tree, uint32_t tag ) { struct rb_entry *entry = tree->root, *head = entry; diff --git a/dlls/winegstreamer/media-converter/lib.c b/dlls/winegstreamer/media-converter/lib.c index 97c5e0f0ec39..36818ad32d8c 100644 --- a/dlls/winegstreamer/media-converter/lib.c +++ b/dlls/winegstreamer/media-converter/lib.c @@ -21,8 +21,17 @@ #pragma makedep unix #endif +#include "config.h" #include "media-converter.h" +#ifdef _WINEDMO + +#include +#include "wine/debug.h" +WINE_DEFAULT_DEBUG_CHANNEL(dmo); + +#else /* _WINEDMO */ + GST_ELEMENT_REGISTER_DECLARE(protonvideoconverter); GST_ELEMENT_REGISTER_DECLARE(protonaudioconverter); GST_ELEMENT_REGISTER_DECLARE(protonaudioconverterbin); @@ -30,6 +39,8 @@ GST_ELEMENT_REGISTER_DECLARE(protondemuxer); GST_DEBUG_CATEGORY(media_converter_debug); +#endif /* _WINEDMO */ + static void get_dirname(const char *path, char *result) { size_t i; @@ -303,6 +314,8 @@ void dump_fozdb_close(struct dump_fozdb *db) } } +#ifndef _WINEDMO + bool media_converter_init(void) { GST_DEBUG_CATEGORY_INIT(media_converter_debug, @@ -334,3 +347,5 @@ bool media_converter_init(void) return true; } + +#endif /* _WINEDMO */ diff --git a/dlls/winegstreamer/media-converter/media-converter.h b/dlls/winegstreamer/media-converter/media-converter.h index 4790f1d054e9..c70344015645 100644 --- a/dlls/winegstreamer/media-converter/media-converter.h +++ b/dlls/winegstreamer/media-converter/media-converter.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -32,10 +33,23 @@ #include "unix_private.h" #include "wine/rbtree.h" +#ifdef _WINEDMO + +#define GST_ERROR(fmt, ...) ERR(fmt "\n", ## __VA_ARGS__) +#define GST_WARNING(fmt, ...) WARN(fmt "\n", ## __VA_ARGS__) +#define GST_INFO(fmt, ...) TRACE(fmt "\n", ## __VA_ARGS__) +#define GST_DEBUG(fmt, ...) TRACE(fmt "\n", ## __VA_ARGS__) +typedef struct gst_buffer GstBuffer; /* not used */ +extern size_t gst_buffer_extract(GstBuffer*,size_t,void*,size_t); /* not used */ + +#else /* _WINEDMO */ + GST_DEBUG_CATEGORY_EXTERN(media_converter_debug); #undef GST_CAT_DEFAULT #define GST_CAT_DEFAULT media_converter_debug +#endif /* _WINEDMO */ + typedef int (*data_read_callback)(void *data_reader, uint8_t *buffer, size_t size, size_t *read_size); /* Changing this will invalidate the cache. You MUST clear it. */ @@ -125,6 +139,7 @@ struct fozdb_entry extern int fozdb_entry_compare( const void *key, const struct rb_entry *ptr ); extern void fozdb_entry_destroy( struct rb_entry *entry, void *context ); extern struct fozdb_entry *fozdb_entry_put( struct rb_tree *tree, uint32_t tag, const struct fozdb_hash *hash ); +extern struct fozdb_entry *fozdb_entry_get( struct rb_tree *tree, uint32_t tag, const struct fozdb_hash *hash ); extern struct rb_entry *fozdb_tag_head( struct rb_tree *tree, uint32_t tag ); #define FOZDB_FOR_EACH_TAG_ENTRY( e, t, d ) \ diff --git a/dlls/winegstreamer/media-converter/murmur3.c b/dlls/winegstreamer/media-converter/murmur3.c index 014345e61d51..975f9fdc2b5c 100644 --- a/dlls/winegstreamer/media-converter/murmur3.c +++ b/dlls/winegstreamer/media-converter/murmur3.c @@ -20,6 +20,7 @@ #pragma makedep unix #endif +#include "config.h" #include "media-converter.h" static uint64_t rotl64(uint64_t value, uint8_t shift) From ed71e027b81b128c2de4720ed101d51b68a419a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 5 Dec 2024 12:06:11 +0100 Subject: [PATCH 0576/2542] mfsrcsnk: Use winedmo media source by default. --- dlls/mfsrcsnk/media_source.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/mfsrcsnk/media_source.c b/dlls/mfsrcsnk/media_source.c index ac5f013d9cd5..ce4d6952c25f 100644 --- a/dlls/mfsrcsnk/media_source.c +++ b/dlls/mfsrcsnk/media_source.c @@ -1899,7 +1899,7 @@ static BOOL use_gst_byte_stream_handler(void) RRF_RT_REG_DWORD, NULL, &result, &size )) return !result; - return TRUE; + return FALSE; } static HRESULT WINAPI asf_byte_stream_plugin_factory_CreateInstance(IClassFactory *iface, From 074ba00fddcb1d8aa1310b2eee928c9d586906b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 5 Dec 2024 23:22:47 +0100 Subject: [PATCH 0577/2542] include: Add some new DMO classes to wmcodecdsp.idl. CW-Bug-Id: #20427 --- include/wmcodecdsp.idl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/wmcodecdsp.idl b/include/wmcodecdsp.idl index 9982b6e6b8ad..74cd567bc896 100644 --- a/include/wmcodecdsp.idl +++ b/include/wmcodecdsp.idl @@ -98,6 +98,21 @@ coclass CWMVDecMediaObject {} ] coclass CWMVXEncMediaObject {} +[ + uuid(01f36ce2-0907-4d8b-979d-f151be91c883) +] +coclass CFrameRateConvertDmo {} + +[ + uuid(798059f0-89ca-4160-b325-aeb48efe4f9a) +] +coclass CColorControlDmo {} + +[ + uuid(1ea1ea14-48f4-4054-ad1a-e8aee10ac805) +] +coclass CResizerDMO {} + typedef float ChMtxType; [ From 6f4ae3574b5556e7837f80162a671518f503f39b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 5 Dec 2024 23:11:06 +0100 Subject: [PATCH 0578/2542] msvdsp: Add stub DLL. CW-Bug-Id: #20427 --- configure.ac | 1 + dlls/msvdsp/Makefile.in | 6 ++ dlls/msvdsp/msvdsp.c | 194 ++++++++++++++++++++++++++++++++++++++++ dlls/msvdsp/msvdsp.idl | 31 +++++++ dlls/msvdsp/msvdsp.spec | 4 + loader/wine.inf.in | 1 + 6 files changed, 237 insertions(+) create mode 100644 dlls/msvdsp/Makefile.in create mode 100644 dlls/msvdsp/msvdsp.c create mode 100644 dlls/msvdsp/msvdsp.idl create mode 100644 dlls/msvdsp/msvdsp.spec diff --git a/configure.ac b/configure.ac index cbe4ef08479b..dd7b1c3daa55 100644 --- a/configure.ac +++ b/configure.ac @@ -2942,6 +2942,7 @@ WINE_CONFIG_MAKEFILE(dlls/msvfw32) WINE_CONFIG_MAKEFILE(dlls/msvfw32/tests) WINE_CONFIG_MAKEFILE(dlls/msvidc32) WINE_CONFIG_MAKEFILE(dlls/msvideo.dll16,enable_win16) +WINE_CONFIG_MAKEFILE(dlls/msvdsp) WINE_CONFIG_MAKEFILE(dlls/msvproc) WINE_CONFIG_MAKEFILE(dlls/mswsock) WINE_CONFIG_MAKEFILE(dlls/msxml) diff --git a/dlls/msvdsp/Makefile.in b/dlls/msvdsp/Makefile.in new file mode 100644 index 000000000000..088d5f55915b --- /dev/null +++ b/dlls/msvdsp/Makefile.in @@ -0,0 +1,6 @@ +MODULE = msvdsp.dll +IMPORTS = combase mfplat msdmo mfuuid dmoguids strmiids wmcodecdspuuid uuid + +SOURCES = \ + msvdsp.c \ + msvdsp.idl diff --git a/dlls/msvdsp/msvdsp.c b/dlls/msvdsp/msvdsp.c new file mode 100644 index 000000000000..42bcaac491ae --- /dev/null +++ b/dlls/msvdsp/msvdsp.c @@ -0,0 +1,194 @@ +/* + * Copyright 2024 Rémi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +#define COBJMACROS +#include "windef.h" +#include "winbase.h" + +#include "d3d9.h" +#include "dmoreg.h" +#include "dshow.h" +#include "mfapi.h" +#include "rpcproxy.h" +#include "wmcodecdsp.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dmo); + +#include "initguid.h" + +DEFINE_MEDIATYPE_GUID(MFVideoFormat_ABGR32, D3DFMT_A8B8G8R8); +DEFINE_GUID(DMOVideoFormat_RGB32,D3DFMT_X8R8G8B8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); +DEFINE_GUID(DMOVideoFormat_RGB24,D3DFMT_R8G8B8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); +DEFINE_GUID(DMOVideoFormat_RGB565,D3DFMT_R5G6B5,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); +DEFINE_GUID(DMOVideoFormat_RGB555,D3DFMT_X1R5G5B5,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); +DEFINE_GUID(DMOVideoFormat_RGB8,D3DFMT_P8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); + +/*********************************************************************** + * DllGetClassObject (msvproc.@) + */ +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out) +{ + *out = NULL; + FIXME("Unknown clsid %s.\n", debugstr_guid(clsid)); + return CLASS_E_CLASSNOTAVAILABLE; +} + +/*********************************************************************** + * DllRegisterServer (colorcnv.@) + */ +HRESULT WINAPI DllRegisterServer(void) +{ + MFT_REGISTER_TYPE_INFO color_converter_mft_inputs[] = + { + {MFMediaType_Video, MFVideoFormat_YV12}, + {MFMediaType_Video, MFVideoFormat_YUY2}, + {MFMediaType_Video, MFVideoFormat_UYVY}, + {MFMediaType_Video, MFVideoFormat_AYUV}, + {MFMediaType_Video, MFVideoFormat_NV12}, + {MFMediaType_Video, DMOVideoFormat_RGB32}, + {MFMediaType_Video, DMOVideoFormat_RGB565}, + {MFMediaType_Video, MFVideoFormat_I420}, + {MFMediaType_Video, MFVideoFormat_IYUV}, + {MFMediaType_Video, MFVideoFormat_YVYU}, + {MFMediaType_Video, DMOVideoFormat_RGB24}, + {MFMediaType_Video, DMOVideoFormat_RGB555}, + {MFMediaType_Video, DMOVideoFormat_RGB8}, + {MFMediaType_Video, MEDIASUBTYPE_V216}, + {MFMediaType_Video, MEDIASUBTYPE_V410}, + {MFMediaType_Video, MFVideoFormat_NV11}, + {MFMediaType_Video, MFVideoFormat_Y41P}, + {MFMediaType_Video, MFVideoFormat_Y41T}, + {MFMediaType_Video, MFVideoFormat_Y42T}, + {MFMediaType_Video, MFVideoFormat_YVU9}, + }; + MFT_REGISTER_TYPE_INFO color_converter_mft_outputs[] = + { + {MFMediaType_Video, MFVideoFormat_YV12}, + {MFMediaType_Video, MFVideoFormat_YUY2}, + {MFMediaType_Video, MFVideoFormat_UYVY}, + {MFMediaType_Video, MFVideoFormat_AYUV}, + {MFMediaType_Video, MFVideoFormat_NV12}, + {MFMediaType_Video, DMOVideoFormat_RGB32}, + {MFMediaType_Video, DMOVideoFormat_RGB565}, + {MFMediaType_Video, MFVideoFormat_I420}, + {MFMediaType_Video, MFVideoFormat_IYUV}, + {MFMediaType_Video, MFVideoFormat_YVYU}, + {MFMediaType_Video, DMOVideoFormat_RGB24}, + {MFMediaType_Video, DMOVideoFormat_RGB555}, + {MFMediaType_Video, DMOVideoFormat_RGB8}, + {MFMediaType_Video, MEDIASUBTYPE_V216}, + {MFMediaType_Video, MEDIASUBTYPE_V410}, + {MFMediaType_Video, MFVideoFormat_NV11}, + }; + DMO_PARTIAL_MEDIATYPE color_converter_dmo_inputs[] = + { + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YV12}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YUY2}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_UYVY}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_AYUV}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_NV12}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB32}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB565}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_I420}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_IYUV}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YVYU}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB24}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB555}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB8}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_V216}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_V410}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_NV11}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_Y41P}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_Y41T}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_Y42T}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YVU9}, + }; + DMO_PARTIAL_MEDIATYPE color_converter_dmo_outputs[] = + { + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YV12}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YUY2}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_UYVY}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_AYUV}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_NV12}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB32}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB565}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_I420}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_IYUV}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YVYU}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB24}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB555}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB8}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_V216}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_V410}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_NV11}, + }; + HRESULT hr; + + TRACE("\n"); + + if (FAILED(hr = __wine_register_resources())) + return hr; + if (FAILED(hr = MFTRegister(CLSID_CFrameRateConvertDmo, MFT_CATEGORY_VIDEO_EFFECT, + (WCHAR *)L"Frame Rate Converter", MFT_ENUM_FLAG_SYNCMFT, + ARRAY_SIZE(color_converter_mft_inputs), color_converter_mft_inputs, + ARRAY_SIZE(color_converter_mft_outputs), color_converter_mft_outputs, NULL))) + return hr; + if (FAILED(hr = DMORegister(L"Frame Rate Converter", &CLSID_CFrameRateConvertDmo, &DMOCATEGORY_VIDEO_EFFECT, 0, + ARRAY_SIZE(color_converter_dmo_inputs), color_converter_dmo_inputs, + ARRAY_SIZE(color_converter_dmo_outputs), color_converter_dmo_outputs))) + return hr; + if (FAILED(hr = MFTRegister(CLSID_CColorControlDmo, MFT_CATEGORY_VIDEO_EFFECT, + (WCHAR *)L"Color Control", MFT_ENUM_FLAG_SYNCMFT, + ARRAY_SIZE(color_converter_mft_inputs), color_converter_mft_inputs, + ARRAY_SIZE(color_converter_mft_outputs), color_converter_mft_outputs, NULL))) + return hr; + if (FAILED(hr = DMORegister(L"Color Control", &CLSID_CColorControlDmo, &DMOCATEGORY_VIDEO_EFFECT, 0, + ARRAY_SIZE(color_converter_dmo_inputs), color_converter_dmo_inputs, + ARRAY_SIZE(color_converter_dmo_outputs), color_converter_dmo_outputs))) + return hr; + + return S_OK; +} + +/*********************************************************************** + * DllUnregisterServer (colorcnv.@) + */ +HRESULT WINAPI DllUnregisterServer(void) +{ + HRESULT hr; + + TRACE("\n"); + + if (FAILED(hr = __wine_unregister_resources())) + return hr; + if (FAILED(hr = MFTUnregister(CLSID_CFrameRateConvertDmo))) + return hr; + if (FAILED(hr = DMOUnregister(&CLSID_CFrameRateConvertDmo, &DMOCATEGORY_VIDEO_EFFECT))) + return hr; + if (FAILED(hr = MFTUnregister(CLSID_CColorControlDmo))) + return hr; + if (FAILED(hr = DMOUnregister(&CLSID_CColorControlDmo, &DMOCATEGORY_VIDEO_EFFECT))) + return hr; + + return S_OK; +} diff --git a/dlls/msvdsp/msvdsp.idl b/dlls/msvdsp/msvdsp.idl new file mode 100644 index 000000000000..acd9ba36bac4 --- /dev/null +++ b/dlls/msvdsp/msvdsp.idl @@ -0,0 +1,31 @@ +/* + * Copyright 2024 Rémi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep register + +[ + threading(both), + uuid(01f36ce2-0907-4d8b-979d-f151be91c883) +] +coclass CFrameRateConvertDmo {} + +[ + threading(both), + uuid(798059f0-89ca-4160-b325-aeb48efe4f9a) +] +coclass CColorControlDmo {} diff --git a/dlls/msvdsp/msvdsp.spec b/dlls/msvdsp/msvdsp.spec new file mode 100644 index 000000000000..b16365d0c9fc --- /dev/null +++ b/dlls/msvdsp/msvdsp.spec @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 03b1b862e69d..c1af1c8b09f7 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2165,6 +2165,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" 11,,mshtml.dll,1 11,,msisip.dll,1 11,,msmpeg2vdec.dll,1 +11,,msvdsp.dll,1 11,,msvproc.dll,1 11,,qcap.dll,1 11,,qedit.dll,1 From 917ffc77890e9155d52b44402205b41f4a5d7a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 5 Dec 2024 23:11:06 +0100 Subject: [PATCH 0579/2542] vidreszr: Add stub DLL. CW-Bug-Id: #20427 --- configure.ac | 1 + dlls/vidreszr/Makefile.in | 6 ++ dlls/vidreszr/vidreszr.c | 181 ++++++++++++++++++++++++++++++++++++ dlls/vidreszr/vidreszr.idl | 25 +++++ dlls/vidreszr/vidreszr.spec | 4 + loader/wine.inf.in | 1 + 6 files changed, 218 insertions(+) create mode 100644 dlls/vidreszr/Makefile.in create mode 100644 dlls/vidreszr/vidreszr.c create mode 100644 dlls/vidreszr/vidreszr.idl create mode 100644 dlls/vidreszr/vidreszr.spec diff --git a/configure.ac b/configure.ac index dd7b1c3daa55..92b978613218 100644 --- a/configure.ac +++ b/configure.ac @@ -3201,6 +3201,7 @@ WINE_CONFIG_MAKEFILE(dlls/ver.dll16,enable_win16) WINE_CONFIG_MAKEFILE(dlls/version) WINE_CONFIG_MAKEFILE(dlls/version/tests) WINE_CONFIG_MAKEFILE(dlls/vga) +WINE_CONFIG_MAKEFILE(dlls/vidreszr) WINE_CONFIG_MAKEFILE(dlls/virtdisk) WINE_CONFIG_MAKEFILE(dlls/virtdisk/tests) WINE_CONFIG_MAKEFILE(dlls/vmm.vxd,enable_win16) diff --git a/dlls/vidreszr/Makefile.in b/dlls/vidreszr/Makefile.in new file mode 100644 index 000000000000..2427d28ab08f --- /dev/null +++ b/dlls/vidreszr/Makefile.in @@ -0,0 +1,6 @@ +MODULE = vidreszr.dll +IMPORTS = combase mfplat msdmo mfuuid dmoguids strmiids wmcodecdspuuid uuid + +SOURCES = \ + vidreszr.c \ + vidreszr.idl diff --git a/dlls/vidreszr/vidreszr.c b/dlls/vidreszr/vidreszr.c new file mode 100644 index 000000000000..92e4d2c37715 --- /dev/null +++ b/dlls/vidreszr/vidreszr.c @@ -0,0 +1,181 @@ +/* + * Copyright 2024 Rémi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +#define COBJMACROS +#include "windef.h" +#include "winbase.h" + +#include "d3d9.h" +#include "dmoreg.h" +#include "dshow.h" +#include "mfapi.h" +#include "rpcproxy.h" +#include "wmcodecdsp.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dmo); + +#include "initguid.h" + +DEFINE_MEDIATYPE_GUID(MFVideoFormat_ABGR32, D3DFMT_A8B8G8R8); +DEFINE_GUID(DMOVideoFormat_RGB32,D3DFMT_X8R8G8B8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); +DEFINE_GUID(DMOVideoFormat_RGB24,D3DFMT_R8G8B8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); +DEFINE_GUID(DMOVideoFormat_RGB565,D3DFMT_R5G6B5,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); +DEFINE_GUID(DMOVideoFormat_RGB555,D3DFMT_X1R5G5B5,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); +DEFINE_GUID(DMOVideoFormat_RGB8,D3DFMT_P8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70); + +/*********************************************************************** + * DllGetClassObject (msvproc.@) + */ +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out) +{ + *out = NULL; + FIXME("Unknown clsid %s.\n", debugstr_guid(clsid)); + return CLASS_E_CLASSNOTAVAILABLE; +} + +/*********************************************************************** + * DllRegisterServer (colorcnv.@) + */ +HRESULT WINAPI DllRegisterServer(void) +{ + MFT_REGISTER_TYPE_INFO color_converter_mft_inputs[] = + { + {MFMediaType_Video, MFVideoFormat_YV12}, + {MFMediaType_Video, MFVideoFormat_YUY2}, + {MFMediaType_Video, MFVideoFormat_UYVY}, + {MFMediaType_Video, MFVideoFormat_AYUV}, + {MFMediaType_Video, MFVideoFormat_NV12}, + {MFMediaType_Video, DMOVideoFormat_RGB32}, + {MFMediaType_Video, DMOVideoFormat_RGB565}, + {MFMediaType_Video, MFVideoFormat_I420}, + {MFMediaType_Video, MFVideoFormat_IYUV}, + {MFMediaType_Video, MFVideoFormat_YVYU}, + {MFMediaType_Video, DMOVideoFormat_RGB24}, + {MFMediaType_Video, DMOVideoFormat_RGB555}, + {MFMediaType_Video, DMOVideoFormat_RGB8}, + {MFMediaType_Video, MEDIASUBTYPE_V216}, + {MFMediaType_Video, MEDIASUBTYPE_V410}, + {MFMediaType_Video, MFVideoFormat_NV11}, + {MFMediaType_Video, MFVideoFormat_Y41P}, + {MFMediaType_Video, MFVideoFormat_Y41T}, + {MFMediaType_Video, MFVideoFormat_Y42T}, + {MFMediaType_Video, MFVideoFormat_YVU9}, + }; + MFT_REGISTER_TYPE_INFO color_converter_mft_outputs[] = + { + {MFMediaType_Video, MFVideoFormat_YV12}, + {MFMediaType_Video, MFVideoFormat_YUY2}, + {MFMediaType_Video, MFVideoFormat_UYVY}, + {MFMediaType_Video, MFVideoFormat_AYUV}, + {MFMediaType_Video, MFVideoFormat_NV12}, + {MFMediaType_Video, DMOVideoFormat_RGB32}, + {MFMediaType_Video, DMOVideoFormat_RGB565}, + {MFMediaType_Video, MFVideoFormat_I420}, + {MFMediaType_Video, MFVideoFormat_IYUV}, + {MFMediaType_Video, MFVideoFormat_YVYU}, + {MFMediaType_Video, DMOVideoFormat_RGB24}, + {MFMediaType_Video, DMOVideoFormat_RGB555}, + {MFMediaType_Video, DMOVideoFormat_RGB8}, + {MFMediaType_Video, MEDIASUBTYPE_V216}, + {MFMediaType_Video, MEDIASUBTYPE_V410}, + {MFMediaType_Video, MFVideoFormat_NV11}, + }; + DMO_PARTIAL_MEDIATYPE color_converter_dmo_inputs[] = + { + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YV12}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YUY2}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_UYVY}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_AYUV}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_NV12}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB32}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB565}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_I420}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_IYUV}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YVYU}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB24}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB555}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB8}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_V216}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_V410}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_NV11}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_Y41P}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_Y41T}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_Y42T}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YVU9}, + }; + DMO_PARTIAL_MEDIATYPE color_converter_dmo_outputs[] = + { + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YV12}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YUY2}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_UYVY}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_AYUV}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_NV12}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB32}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB565}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_I420}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_IYUV}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_YVYU}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB24}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB555}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_RGB8}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_V216}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_V410}, + {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_NV11}, + }; + HRESULT hr; + + TRACE("\n"); + + if (FAILED(hr = __wine_register_resources())) + return hr; + if (FAILED(hr = MFTRegister(CLSID_CResizerDMO, MFT_CATEGORY_VIDEO_EFFECT, + (WCHAR *)L"Resizer MFT", MFT_ENUM_FLAG_SYNCMFT, + ARRAY_SIZE(color_converter_mft_inputs), color_converter_mft_inputs, + ARRAY_SIZE(color_converter_mft_outputs), color_converter_mft_outputs, NULL))) + return hr; + if (FAILED(hr = DMORegister(L"Resizer DMO", &CLSID_CResizerDMO, &DMOCATEGORY_VIDEO_EFFECT, 0, + ARRAY_SIZE(color_converter_dmo_inputs), color_converter_dmo_inputs, + ARRAY_SIZE(color_converter_dmo_outputs), color_converter_dmo_outputs))) + return hr; + + return S_OK; +} + +/*********************************************************************** + * DllUnregisterServer (colorcnv.@) + */ +HRESULT WINAPI DllUnregisterServer(void) +{ + HRESULT hr; + + TRACE("\n"); + + if (FAILED(hr = __wine_unregister_resources())) + return hr; + if (FAILED(hr = MFTUnregister(CLSID_CResizerDMO))) + return hr; + if (FAILED(hr = DMOUnregister(&CLSID_CResizerDMO, &DMOCATEGORY_VIDEO_EFFECT))) + return hr; + + return S_OK; +} diff --git a/dlls/vidreszr/vidreszr.idl b/dlls/vidreszr/vidreszr.idl new file mode 100644 index 000000000000..8838f1885871 --- /dev/null +++ b/dlls/vidreszr/vidreszr.idl @@ -0,0 +1,25 @@ +/* + * Copyright 2024 Rémi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep register + +[ + threading(both), + uuid(1ea1ea14-48f4-4054-ad1a-e8aee10ac805) +] +coclass CResizerDMO {} diff --git a/dlls/vidreszr/vidreszr.spec b/dlls/vidreszr/vidreszr.spec new file mode 100644 index 000000000000..b16365d0c9fc --- /dev/null +++ b/dlls/vidreszr/vidreszr.spec @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff --git a/loader/wine.inf.in b/loader/wine.inf.in index c1af1c8b09f7..9c0445373705 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2171,6 +2171,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" 11,,qedit.dll,1 11,,resampledmo.dll,1 11,,urlmon.dll,1 +11,,vidreszr.dll,1 11,,windowscodecs.dll,1 11,,winegstreamer.dll,1 55,,wineps.drv,1 From a6b547ce95ec2478b43dd8f6c8cbfeff87913a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 6 Dec 2024 12:27:25 +0100 Subject: [PATCH 0580/2542] winex11: Pass client rect to create_client_window. --- dlls/winex11.drv/opengl.c | 4 ++-- dlls/winex11.drv/vulkan.c | 5 +++-- dlls/winex11.drv/window.c | 5 +---- dlls/winex11.drv/x11drv.h | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 74f78482b414..b2fa1409654a 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1126,7 +1126,7 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct glx_pixel gl->colormap = XCreateColormap( gdi_display, get_dummy_parent(), visual->visual, (visual->class == PseudoColor || visual->class == GrayScale || visual->class == DirectColor) ? AllocAll : AllocNone ); - gl->window = create_client_window( hwnd, visual, gl->colormap ); + gl->window = create_client_window( hwnd, gl->rect, visual, gl->colormap ); if (gl->window) gl->drawable = pglXCreateWindow( gdi_display, gl->format->fbconfig, gl->window, NULL ); TRACE( "%p created client %lx drawable %lx\n", hwnd, gl->window, gl->drawable ); @@ -1138,7 +1138,7 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct glx_pixel gl->colormap = XCreateColormap( gdi_display, get_dummy_parent(), visual->visual, (visual->class == PseudoColor || visual->class == GrayScale || visual->class == DirectColor) ? AllocAll : AllocNone ); - gl->window = create_client_window( hwnd, visual, gl->colormap ); + gl->window = create_client_window( hwnd, gl->rect, visual, gl->colormap ); if (gl->window) { struct x11drv_win_data *data; diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 147115376360..8cacaf412b46 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -96,13 +96,14 @@ static VkResult X11DRV_vulkan_surface_create( HWND hwnd, VkInstance instance, Vk ERR("Failed to allocate vulkan surface for hwnd=%p\n", hwnd); return VK_ERROR_OUT_OF_HOST_MEMORY; } - if (!(surface->window = create_client_window( hwnd, &default_visual, default_colormap ))) + NtUserGetClientRect( hwnd, &surface->rect, NtUserGetDpiForWindow( hwnd ) ); + + if (!(surface->window = create_client_window( hwnd, surface->rect, &default_visual, default_colormap ))) { ERR("Failed to allocate client window for hwnd=%p\n", hwnd); free( surface ); return VK_ERROR_OUT_OF_HOST_MEMORY; } - NtUserGetClientRect( hwnd, &surface->rect, NtUserGetDpiForWindow( hwnd ) ); info.window = surface->window; if (pvkCreateXlibSurfaceKHR( instance, &info, NULL /* allocator */, handle )) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index f030a4e1c42a..1612125f64f1 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2048,14 +2048,13 @@ void destroy_client_window( HWND hwnd, Window client_window ) /********************************************************************** * create_client_window */ -Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colormap ) +Window create_client_window( HWND hwnd, RECT client_rect, const XVisualInfo *visual, Colormap colormap ) { Window dummy_parent = get_dummy_parent(); struct x11drv_win_data *data = get_win_data( hwnd ); XSetWindowAttributes attr; Window ret; int x, y, cx, cy; - RECT client_rect; if (!data) { @@ -2077,8 +2076,6 @@ Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colo x = data->rects.client.left - data->rects.visible.left; y = data->rects.client.top - data->rects.visible.top; - - NtUserGetClientRect( hwnd, &client_rect, NtUserGetDpiForWindow( hwnd ) ); cx = min( max( 1, client_rect.right - client_rect.left ), 65535 ); cy = min( max( 1, client_rect.bottom - client_rect.top ), 65535 ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index a525e75d8931..7df9b81cc737 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -684,7 +684,7 @@ extern Window init_clip_window(void); extern void update_user_time( Time time ); extern UINT get_window_net_wm_state( Display *display, Window window ); extern void make_window_embedded( struct x11drv_win_data *data ); -extern Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colormap ); +extern Window create_client_window( HWND hwnd, RECT client_rect, const XVisualInfo *visual, Colormap colormap ); extern void detach_client_window( struct x11drv_win_data *data, Window client_window ); extern void attach_client_window( struct x11drv_win_data *data, Window client_window ); extern void destroy_client_window( HWND hwnd, Window client_window ); From cd18a2274b4a39229023978fce1570b0da03ed2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 15 Dec 2022 14:10:32 +0100 Subject: [PATCH 0581/2542] fshack: winex11: Support opengl scaling according to fake resolution. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on work by Zhiyi Zhang, includes work by Giovanni Mascellani, Rémi Bernon, Arkadiusz Hiler, Kai Krakow, Joshua Ashton, Zebediah Figura, and Matteo Bruni. fshack: winex11: Protect fshack framebuffer from glFramebufferTexture2D(). glFramebufferTexture2D() just fails with default framebuffer. But when we have substitued fshack framebuffer setting the texture destroys it instead. CW-Bug-Id: #20669 fshack: winex11: Clear fs hack depth / stencil attachment. fshack: winex11: Support adjusting gamma in the fshack CW-Bug-Id: 16421 fshack: winex11: Setup gamma shader only once per context. Fixes GL objects leak and avoids unneccessary shader recreation when the fs_hack_setup_context() is called due to switching GL drawable. For Star Wars - Knights of the Old Republic blank screen. CW-Bug-Id: #19002 fshack: winex11: Track if multisample resolve is needed in gl_drawable. As that changes per drawable and not per context. fshack: winex11: Destroy fshack GL objects only at GL context destroy. fshack: winex11: Set viewport in fs_hack_setup_context(). For Star Wars - Knights of the Old Republic blank screen. CW-Bug-Id: #19002 fshack: winex11: Also enable fshack for drawable due to gamma in create_gl_drawable(). For Star Wars - Knights of the Old Republic blank screen. CW-Bug-Id: #19002 fshack: winex11: Use window dimensions in GL if fshack is enabled for gamma only. For Star Wars - Knights of the Old Republic blank screen. CW-Bug-Id: #19002 fshack: winex11: Use window size for texture and framebuffers in fs_hack_setup_context(). For Star Wars - Knights of the Old Republic blank screen. CW-Bug-Id: #19002 fshack: winex11: Blit the contents of current framebuffer to the fshack's framebuffer in fs_hack_setup_context(). CW-Bug-Id: #20102 Some games might not clear the framebuffer on each frame and rely on the data in framebuffer to persist through glFlush(), glFinish() etc. That is currently not the case if the fshack is getting turned on after some drawing was performed already. fshack: winex11: Use specific names for textures for SWJKJA. CW-Bug-Id: #20102 fshack: winex11: Interpolate looked up colour in gamma shader. CW-Bug-Id: #20400 fshack: winex11: Enable specific names for textures for Quake III Arena. CW-Bug-Id: #21474 fshack: winex11: Enable specific names for textures for Quake III Team Arena. CW-Bug-Id: #21474 fshack: winex11: Use linear colour internal format for GL fshack buffer. CW-Bug-Id: #22260 fshack: winex11: Always blit fs_hack in wglFlush and wglFinish when drawing to front buffer. CW-Bug-Id: #22608 fshack: winex11: Resolve fbo for glCopyTexSubImage2D. Based on a patch by Illia Polishchuk from https://github.com/ValveSoftware/wine/pull/189 GL_INVALID_OPERATION is generated if: the effective value of GL_SAMPLE_BUFFERS for the read framebuffer is one. CW-Bug-Id: #22662 fshack: winex11: Resolve fbo for glCopyTexImage2D. CW-Bug-Id: #22662 fshack: winex11: Resolve fbo for glReadPixels. CW-Bug-Id: #22662 fshack: winex11: Save and restore GL_PIXEL_UNPACK_BUFFER_BINDING too. CW-Bug-Id: #23257 fshack: Use texture name hack for Descent 3 Descent 3's OpenGL renderer will use a texture conflicting with the FS hack texture, and only a small rectangle in the bottom left corner will be rendered. Signed-off-by: John Brooks https://github.com/ValveSoftware/wine/pull/211 CW-Bug-Id: #23791 fshack: winex11.drv: Enable GL fshack blitting to GL_FRONT for Arcanum (500810). CW-Bug-Id: #23916 --- dlls/win32u/dc.c | 12 + dlls/winex11.drv/init.c | 10 +- dlls/winex11.drv/opengl.c | 1286 ++++++++++++++++++++++++++++++++++++- dlls/winex11.drv/vulkan.c | 2 +- dlls/winex11.drv/x11drv.h | 5 +- 5 files changed, 1302 insertions(+), 13 deletions(-) diff --git a/dlls/win32u/dc.c b/dlls/win32u/dc.c index 3f6a501041a7..2dee4d6a7339 100644 --- a/dlls/win32u/dc.c +++ b/dlls/win32u/dc.c @@ -1316,6 +1316,16 @@ static BOOL check_gamma_ramps(void *ptr) return TRUE; } +static void update_children_window_state( HWND hwnd ) +{ + HWND *children; + int i; + + if (!(children = list_window_children( hwnd ))) return; + for (i = 0; children[i]; i++) update_window_state( children[i] ); + free( children ); +} + /*********************************************************************** * NtGdiSetDeviceGammaRamp (win32u.@) */ @@ -1333,6 +1343,8 @@ BOOL WINAPI NtGdiSetDeviceGammaRamp( HDC hdc, void *ptr ) if (check_gamma_ramps(ptr)) ret = physdev->funcs->pSetDeviceGammaRamp( physdev, ptr ); + + update_children_window_state( get_desktop_window() ); } else RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); release_dc_ptr( dc ); diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 5764c05be889..267ae384bdc7 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -217,9 +217,11 @@ static BOOL needs_client_window_clipping( HWND hwnd ) return ret > 0; } -BOOL needs_offscreen_rendering( HWND hwnd, BOOL known_child ) +BOOL needs_offscreen_rendering( HWND hwnd, BOOL known_child, BOOL check_gamma ) { - if (NtUserGetDpiForWindow( hwnd ) != NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI )) return TRUE; /* needs DPI scaling */ + if (NtUserGetDpiForWindow( hwnd ) != NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) + && !enable_fullscreen_hack( hwnd, check_gamma )) + return TRUE; /* needs DPI scaling */ if (NtUserGetAncestor( hwnd, GA_PARENT ) != NtUserGetDesktopWindow()) return TRUE; /* child window, needs compositing */ if (NtUserGetWindowRelative( hwnd, GW_CHILD ) || known_child) return needs_client_window_clipping( hwnd ); /* window has children, needs compositing */ return FALSE; @@ -392,7 +394,7 @@ static const struct user_driver_funcs x11drv_funcs = .dc_funcs.pExtFloodFill = X11DRV_ExtFloodFill, .dc_funcs.pFillPath = X11DRV_FillPath, .dc_funcs.pGetDeviceCaps = X11DRV_GetDeviceCaps, - .dc_funcs.pGetDeviceGammaRamp = X11DRV_GetDeviceGammaRamp, + .dc_funcs.pGetDeviceGammaRamp = fs_hack_get_gamma_ramp, .dc_funcs.pGetICMProfile = X11DRV_GetICMProfile, .dc_funcs.pGetImage = X11DRV_GetImage, .dc_funcs.pGetNearestColor = X11DRV_GetNearestColor, @@ -416,7 +418,7 @@ static const struct user_driver_funcs x11drv_funcs = .dc_funcs.pSetDCBrushColor = X11DRV_SetDCBrushColor, .dc_funcs.pSetDCPenColor = X11DRV_SetDCPenColor, .dc_funcs.pSetDeviceClipping = X11DRV_SetDeviceClipping, - .dc_funcs.pSetDeviceGammaRamp = X11DRV_SetDeviceGammaRamp, + .dc_funcs.pSetDeviceGammaRamp = fs_hack_set_gamma_ramp, .dc_funcs.pSetPixel = X11DRV_SetPixel, .dc_funcs.pStretchBlt = X11DRV_StretchBlt, .dc_funcs.pStrokeAndFillPath = X11DRV_StrokeAndFillPath, diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index b2fa1409654a..daf74c27fa54 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -43,6 +43,10 @@ #include "winternl.h" #include "wine/debug.h" +#ifndef ARRAY_SIZE +#define ARRAY_SIZE( array ) (sizeof(array) / sizeof((array)[0])) +#endif + #ifdef SONAME_LIBGL WINE_DEFAULT_DEBUG_CHANNEL(wgl); @@ -193,6 +197,31 @@ struct glx_pixel_format DWORD dwFlags; /* We store some PFD_* flags in here for emulated bitmap formats */ }; +struct fs_hack_fbconfig_attribs +{ + int render_type; + int buffer_size; + int red_size; + int green_size; + int blue_size; + int alpha_size; + int depth_size; + int stencil_size; + int doublebuffer; + int samples; +}; + +struct fs_hack_fbo_attachments_config +{ + GLint color_internalformat; + GLenum color_format; + GLenum color_type; + GLint ds_internalformat; + GLenum ds_format; + GLenum ds_type; + int samples; +}; + struct wgl_context { HDC hdc; @@ -205,6 +234,18 @@ struct wgl_context GLXContext ctx; struct gl_drawable *drawables[2]; struct gl_drawable *new_drawables[2]; + BOOL refresh_drawables; + BOOL fs_hack; + BOOL fs_hack_integer; + BOOL is_core; + GLuint fs_hack_fbo, fs_hack_resolve_fbo; + GLuint fs_hack_color_texture, fs_hack_ds_texture; + GLuint fs_hack_color_renderbuffer, fs_hack_ds_renderbuffer; + GLuint fs_hack_gamma_pgm, ramp_ubo; + POINT setup_for; + GLuint current_draw_fbo, current_read_fbo; + BOOL drawing_to_front; + BOOL fs_hack_needs_resolve; struct list entry; }; @@ -233,6 +274,17 @@ struct gl_drawable BOOL mutable_pf; HDC hdc_src; HDC hdc_dst; + + BOOL fs_hack; + BOOL fs_hack_did_swapbuf; + BOOL fs_hack_context_set_up; + BOOL fs_hack_needs_resolve; + BOOL has_scissor_indexed; + BOOL has_clip_control; + BOOL has_ati_frag_shader; + BOOL has_fragment_program; + BOOL has_vertex_program; + LONG last_gamma_serial; }; struct wgl_pbuffer @@ -392,6 +444,72 @@ static void wglFinish(void); static void wglFlush(void); static const GLubyte *wglGetString(GLenum name); +/* Fullscreen hack */ +static void (*pglActiveTexture)( GLenum texture ); +static void (*pglAttachShader)( GLuint program, GLuint shader ); +static void (*pglBindBuffer)( GLenum target, GLuint buffer ); +static void (*pglBindBufferBase)( GLenum target, GLuint index, GLuint buffer ); +static void (*pglBindBufferRange)( GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size ); +static void (*pglBindFramebuffer)( GLenum target, GLuint framebuffer ); +static void (*pglBindFramebufferEXT)( GLenum target, GLuint framebuffer ); +static void (*pglBindRenderbuffer)( GLenum target, GLuint renderbuffer ); +static void (*pglBindSampler)( GLuint target, GLuint sampler ); +static void (*pglBlitFramebuffer)( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, + GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter ); +static void (*pglBufferData)( GLenum target, GLsizeiptr size, const void *data, GLenum usage ); +static void (*pglClipControl)( GLenum origin, GLenum depth ); +static void (*pglColorMaski)( GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a ); +static void (*pglCompileShader)( GLuint shader ); +static GLuint (*pglCreateProgram)(void); +static GLuint (*pglCreateShader)( GLenum type ); +static void (*pglDeleteBuffers)( GLsizei n, GLuint *buffers ); +static void (*pglDeleteFramebuffers)( GLsizei n, const GLuint *framebuffers ); +static void (*pglDeleteProgram)( GLuint program ); +static void (*pglDeleteRenderbuffers)( GLsizei n, const GLuint *renderbuffers ); +static void (*pglDeleteShader)( GLuint shader ); +static void (*pglDrawArrays)( GLenum mode, GLint first, GLsizei count ); +static void (*pglDrawBuffer)( GLenum buffer ); +static void (*pglFramebufferRenderbuffer)( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer ); +static void (*pglFramebufferTexture2D)( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ); +static void (*pglGenBuffers)( GLsizei n, GLuint *buffers ); +static void (*pglGenFramebuffers)( GLsizei n, GLuint *ids ); +static void (*pglGetBooleani_v)( GLenum target, GLuint index, GLboolean *data ); +static void (*pglGetInteger64i_v)( GLenum target, GLuint index, GLint64 *data ); +static void (*pglGetIntegeri_v)( GLenum, GLuint, GLint * ); +static void (*pglGetFloati_v)( GLenum, GLuint, GLfloat * ); +static void (*pglGenRenderbuffers)( GLsizei n, GLuint *renderbuffers ); +static void (*pglGetProgramiv)( GLuint program, GLenum pname, GLint *params ); +static void (*pglGetProgramInfoLog)( GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog ); +static void (*pglGetShaderiv)( GLuint shader, GLenum pname, GLint *params ); +static void (*pglGetShaderInfoLog)( GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog ); +static GLuint (*pglGetUniformBlockIndex)( GLuint program, const GLchar *uniformBlockName ); +static GLint (*pglGetUniformLocation)( GLuint program, const GLchar *name ); +static void (*pglLinkProgram)( GLuint program ); +static void (*pglReadBuffer)( GLenum src ); +static void (*pglRenderbufferStorage)( GLenum target, GLenum internalformat, GLsizei width, GLsizei height ); +static void (*pglRenderbufferStorageMultisample)( GLenum target, GLsizei samples, GLenum internalformat, + GLsizei width, GLsizei height ); +static void (*pglScissorIndexed)( GLuint, GLint, GLint, GLsizei, GLsizei ); +static void (*pglScissorIndexedv)( GLuint, const GLint * ); +static void (*pglShaderSource)( GLuint shader, GLsizei count, const GLchar *const *string, const GLint *length ); +static void (*pglUniformBlockBinding)( GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding ); +static void (*pglUniform1i)( GLint location, GLint v0 ); +static void (*pglUseProgram)( GLuint program ); +static void (*pglViewportIndexedf)( GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h ); +static void (*pglViewportIndexedfv)( GLuint index, const GLfloat *v ); +static void (*pglGetFramebufferAttachmentParameteriv)( GLenum target, GLenum attachment, GLenum pname, GLint *params ); +static void (*pglCopyTexImage2D)( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ); +static void (*pglCopyTexSubImage2D)( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ); +static void (*pglReadPixels)( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * data); +static void wglBindFramebuffer( GLenum target, GLuint framebuffer ); +static void wglBindFramebufferEXT( GLenum target, GLuint framebuffer ); +static void wglDrawBuffer( GLenum buffer ); +static void wglReadBuffer( GLenum src ); +static void wglFramebufferTexture2D( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ); +static void wglCopyTexImage2D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ); +static void wglCopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ); +static void wglReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * data); + /* check if the extension is present in the list */ static BOOL has_extension( const char *list, const char *ext ) { @@ -567,9 +685,14 @@ static void init_opengl(void) /* redirect some standard OpenGL functions */ #define REDIRECT(func) \ do { p##func = opengl_funcs.gl.p_##func; opengl_funcs.gl.p_##func = w##func; } while(0) + REDIRECT( glDrawBuffer ); REDIRECT( glFinish ); REDIRECT( glFlush ); REDIRECT( glGetString ); + REDIRECT( glReadBuffer ); + REDIRECT( glCopyTexSubImage2D ); + REDIRECT( glCopyTexImage2D ); + REDIRECT( glReadPixels ); #undef REDIRECT pglXGetProcAddressARB = dlsym(opengl_handle, "glXGetProcAddressARB"); @@ -578,6 +701,59 @@ static void init_opengl(void) goto failed; } + /* Fullscreen hack */ +#define LOAD_FUNCPTR(func) p##func = (void *)pglXGetProcAddressARB((const unsigned char *)#func); + LOAD_FUNCPTR( glActiveTexture ); + LOAD_FUNCPTR( glAttachShader ); + LOAD_FUNCPTR( glBindBuffer ); + LOAD_FUNCPTR( glBindBufferBase ); + LOAD_FUNCPTR( glBindBufferRange ); + LOAD_FUNCPTR( glBindFramebuffer ); + LOAD_FUNCPTR( glBindFramebufferEXT ); + LOAD_FUNCPTR( glBindRenderbuffer ); + LOAD_FUNCPTR( glBindSampler ); + LOAD_FUNCPTR( glBlitFramebuffer ); + LOAD_FUNCPTR( glBufferData ); + LOAD_FUNCPTR( glClipControl ); + LOAD_FUNCPTR( glColorMaski ); + LOAD_FUNCPTR( glCompileShader ); + LOAD_FUNCPTR( glCreateProgram ); + LOAD_FUNCPTR( glCreateShader ); + LOAD_FUNCPTR( glDeleteBuffers ); + LOAD_FUNCPTR( glDeleteFramebuffers ); + LOAD_FUNCPTR( glDeleteProgram ); + LOAD_FUNCPTR( glDeleteRenderbuffers ); + LOAD_FUNCPTR( glDeleteShader ); + LOAD_FUNCPTR( glDrawArrays ); + LOAD_FUNCPTR( glFramebufferRenderbuffer ); + LOAD_FUNCPTR( glFramebufferTexture2D ); + LOAD_FUNCPTR( glGenBuffers ); + LOAD_FUNCPTR( glGenFramebuffers ); + LOAD_FUNCPTR( glGetBooleani_v ); + LOAD_FUNCPTR( glGetInteger64i_v ); + LOAD_FUNCPTR( glGetIntegeri_v ); + LOAD_FUNCPTR( glGetFloati_v ); + LOAD_FUNCPTR( glGenRenderbuffers ); + LOAD_FUNCPTR( glGetProgramiv ); + LOAD_FUNCPTR( glGetProgramInfoLog ); + LOAD_FUNCPTR( glGetShaderiv ); + LOAD_FUNCPTR( glGetShaderInfoLog ); + LOAD_FUNCPTR( glGetUniformBlockIndex ); + LOAD_FUNCPTR( glGetUniformLocation ); + LOAD_FUNCPTR( glLinkProgram ); + LOAD_FUNCPTR( glRenderbufferStorage ); + LOAD_FUNCPTR( glRenderbufferStorageMultisample ); + LOAD_FUNCPTR( glScissorIndexed ); + LOAD_FUNCPTR( glScissorIndexedv ); + LOAD_FUNCPTR( glShaderSource ); + LOAD_FUNCPTR( glUniformBlockBinding ); + LOAD_FUNCPTR( glUniform1i ); + LOAD_FUNCPTR( glUseProgram ); + LOAD_FUNCPTR( glViewportIndexedf ); + LOAD_FUNCPTR( glViewportIndexedfv ); + LOAD_FUNCPTR( glGetFramebufferAttachmentParameteriv ); +#undef LOAD_FUNCPTR + #define LOAD_FUNCPTR(f) do if((p##f = (void*)pglXGetProcAddressARB((const unsigned char*)#f)) == NULL) \ { \ ERR( "%s not found in libGL, disabling OpenGL.\n", #f ); \ @@ -963,6 +1139,553 @@ static void release_gl_drawable( struct gl_drawable *gl ) free( gl ); } +static const char *fs_hack_gamma_vertex_shader_src = +"#version 330\n" +"\n" +"const vec4 square[4] = vec4[4](\n" +" vec4(-1.0, -1.0, 0.0, 1.0),\n" +" vec4(-1.0, 1.0, 0.0, 1.0),\n" +" vec4(1.0, -1.0, 0.0, 1.0),\n" +" vec4(1.0, 1.0, 0.0, 1.0)\n" +");\n" +"const vec2 texsq[4] = vec2[4](\n" +" vec2(0.0, 0.0),\n" +" vec2(0.0, 1.0),\n" +" vec2(1.0, 0.0),\n" +" vec2(1.0, 1.0)\n" +");\n" +"\n" +"out vec2 texCoord;\n" +"\n" +"void main(void)\n" +"{\n" +" gl_Position = square[gl_VertexID];\n" +" texCoord = texsq[gl_VertexID];\n" +"}\n" +; + +static const char *fs_hack_gamma_frag_shader_src = +"#version 330\n" +"\n" +"uniform sampler2D tex;\n" +"in vec2 texCoord;\n" +"layout (std140) uniform ramp {\n" +" vec3 values[256];\n" +"};\n" +"\n" +"layout(location = 0) out vec4 outColor;\n" +"\n" +"vec3 color_from_index(vec3 index)\n" +"{\n" +" ivec3 i = ivec3(index);\n" +" return vec3(values[i.r].r, values[i.g].g, values[i.b].b);\n" +"}\n" +"\n" +"void main(void)\n" +"{\n" +" vec3 lookup = texture(tex, texCoord).xyz * 255.0;\n" +" vec3 lookup1, lookup2;\n" +" lookup1 = floor(lookup);\n" +" lookup2 = ceil(lookup);\n" +" outColor.xyz = mix(color_from_index(lookup1), color_from_index(lookup2), lookup - lookup1);\n" +" outColor.a = 1.0;\n" +"}\n" +; + +static WORD gamma_ramp_i[GAMMA_RAMP_SIZE * 3]; +static float gamma_ramp[GAMMA_RAMP_SIZE * 4]; +static LONG gamma_serial; + +/* Return whether integer scaling is on */ +BOOL fs_hack_is_integer(void) +{ + static int is_int = -1; + if (is_int < 0) + { + const char *e = getenv( "WINE_FULLSCREEN_INTEGER_SCALING" ); + is_int = e && strcmp( e, "0" ); + } + TRACE( "is_interger_scaling: %s\n", is_int ? "TRUE" : "FALSE" ); + return is_int; +} + +BOOL fs_hack_get_gamma_ramp( PHYSDEV dev, void *data ) +{ + memcpy( data, gamma_ramp_i, sizeof(gamma_ramp_i) ); + return TRUE; +} + +BOOL fs_hack_set_gamma_ramp( PHYSDEV dev, void *data ) +{ + const WORD *ramp = data; + int i; + if (memcmp( gamma_ramp_i, ramp, sizeof(gamma_ramp_i) ) == 0) + { + /* identical */ + return TRUE; + } + for (i = 0; i < GAMMA_RAMP_SIZE; ++i) + { + gamma_ramp[i * 4] = ramp[i] / 65535.f; + gamma_ramp[i * 4 + 1] = ramp[i + GAMMA_RAMP_SIZE] / 65535.f; + gamma_ramp[i * 4 + 2] = ramp[i + 2 * GAMMA_RAMP_SIZE] / 65535.f; + } + memcpy( gamma_ramp_i, ramp, sizeof(gamma_ramp_i) ); + if (!InterlockedIncrement( &gamma_serial )) InterlockedIncrement( &gamma_serial ); + TRACE( "new gamma serial: %u\n", (int)gamma_serial ); + return TRUE; +} + +const float *fs_hack_get_current_gamma_ramp( LONG *serial ) +{ + if (!(*serial = ReadNoFence( &gamma_serial ))) return NULL; + return gamma_ramp; +} + +static void fs_hack_get_attachments_config( struct gl_drawable *gl, struct fs_hack_fbconfig_attribs *attribs, + struct fs_hack_fbo_attachments_config *config ) +{ + if (attribs->render_type != GLX_RGBA_BIT) + FIXME( "Unsupported GLX_RENDER_TYPE %#x.\n", attribs->render_type ); + if (attribs->red_size != 8 || attribs->green_size != 8 || attribs->blue_size != 8) + FIXME( "Unsupported RGBA color sizes {%u, %u, %u, %u}.\n", attribs->red_size, + attribs->green_size, attribs->blue_size, attribs->alpha_size ); + config->color_internalformat = attribs->alpha_size ? GL_RGBA8 : GL_RGB8; + config->color_format = GL_BGRA; + config->color_type = GL_UNSIGNED_INT_8_8_8_8_REV; + if (attribs->depth_size || attribs->stencil_size) + { + if (attribs->depth_size != 24) FIXME( "Unsupported depth buffer size %u.\n", attribs->depth_size ); + if (attribs->stencil_size && attribs->stencil_size != 8) + FIXME( "Unsupported stencil buffer size %u.\n", attribs->stencil_size ); + config->ds_internalformat = attribs->stencil_size ? GL_DEPTH24_STENCIL8 : GL_DEPTH_COMPONENT24; + config->ds_format = attribs->stencil_size ? GL_DEPTH_STENCIL : GL_DEPTH_COMPONENT; + config->ds_type = attribs->stencil_size ? GL_UNSIGNED_INT_24_8 : GL_UNSIGNED_INT; + } + else + { + config->ds_internalformat = config->ds_format = config->ds_type = 0; + } + config->samples = attribs->samples; +} + +static const float *fs_hack_get_default_gamma_ramp(void) +{ + static float default_gamma_ramp[GAMMA_RAMP_SIZE * 4]; + static BOOL initialized; + unsigned int i; + + if (!initialized) + { + for (i = 0; i < GAMMA_RAMP_SIZE; i++) + default_gamma_ramp[i * 4] = default_gamma_ramp[i * 4 + 1] = default_gamma_ramp[i * 4 + 2] = i / (float)( GAMMA_RAMP_SIZE - 1 ); + initialized = TRUE; + } + return default_gamma_ramp; +} + +static void fs_hack_setup_gamma_shader( struct wgl_context *ctx, struct gl_drawable *gl ) +{ + GLint success; + GLuint vshader, fshader, program, ramp_index, tex_loc, prev_program; + char errstr[512]; + const float *default_gamma_ramp = fs_hack_get_default_gamma_ramp(); + + gl->last_gamma_serial = 0; + + if (ctx->fs_hack_gamma_pgm) return; + + opengl_funcs.gl.p_glGetIntegerv( GL_CURRENT_PROGRAM, (GLint *)&prev_program ); + /* vertex shader */ + vshader = pglCreateShader( GL_VERTEX_SHADER ); + if (vshader == 0) + { + ERR( "Failed to create gamma vertex shader\n" ); + return; + } + pglShaderSource( vshader, 1, &fs_hack_gamma_vertex_shader_src, NULL ); + pglCompileShader( vshader ); + + pglGetShaderiv( vshader, GL_COMPILE_STATUS, &success ); + if (!success) + { + pglGetShaderInfoLog( vshader, sizeof(errstr), NULL, errstr ); + ERR( "Compiling gamma vertex shader failed: %s\n", errstr ); + pglDeleteShader( vshader ); + return; + } + + /* fragment shader */ + fshader = pglCreateShader( GL_FRAGMENT_SHADER ); + if (fshader == 0) + { + ERR( "Failed to create gamma fragment shader\n" ); + pglDeleteShader( vshader ); + return; + } + pglShaderSource( fshader, 1, &fs_hack_gamma_frag_shader_src, NULL ); + pglCompileShader( fshader ); + + pglGetShaderiv( fshader, GL_COMPILE_STATUS, &success ); + if (!success) + { + pglGetShaderInfoLog( fshader, sizeof(errstr), NULL, errstr ); + ERR( "Compiling gamma fragment shader failed: %s\n", errstr ); + pglDeleteShader( fshader ); + pglDeleteShader( vshader ); + return; + } + + /* gamma program */ + program = pglCreateProgram(); + if (program == 0) + { + ERR( "Failed to create gamma program\n" ); + pglDeleteShader( fshader ); + pglDeleteShader( vshader ); + return; + } + + pglAttachShader( program, vshader ); + pglAttachShader( program, fshader ); + + pglLinkProgram( program ); + + pglGetProgramiv( program, GL_LINK_STATUS, &success ); + if (!success) + { + pglGetProgramInfoLog( program, sizeof(errstr), NULL, errstr ); + ERR( "Linking gamma shader failed: %s\n", errstr ); + pglDeleteProgram( program ); + pglDeleteShader( fshader ); + pglDeleteShader( vshader ); + return; + } + + pglDeleteShader( fshader ); + pglDeleteShader( vshader ); + + pglGenBuffers( 1, &ctx->ramp_ubo ); + pglBindBuffer( GL_UNIFORM_BUFFER, ctx->ramp_ubo ); + pglBufferData( GL_UNIFORM_BUFFER, sizeof(float) * 4 * GAMMA_RAMP_SIZE, default_gamma_ramp, GL_DYNAMIC_DRAW ); + + ramp_index = pglGetUniformBlockIndex( program, "ramp" ); + pglUniformBlockBinding( program, ramp_index, 0 ); + + pglUseProgram( program ); + + tex_loc = pglGetUniformLocation( program, "tex" ); + pglUniform1i( tex_loc, 0 ); + + ctx->fs_hack_gamma_pgm = program; + + pglUseProgram( prev_program ); +} + +enum fshack_texture_type +{ + FSHACK_TEXTURE_COLOUR, + FSHACK_TEXTURE_DEPTH, + FSHACK_TEXTURE_LAST, +}; + +static void gen_texture( struct wgl_context *ctx, GLuint *tex, enum fshack_texture_type type ) +{ + static const GLuint texture_names[FSHACK_TEXTURE_LAST] = + { + 65535, + 65536, + }; + static int texture_name_hack = -1; + static int once; + + if (ctx->is_core) + { + opengl_funcs.gl.p_glGenTextures( 1, tex ); + return; + } + + if (texture_name_hack == -1) + { + const char *sgi = getenv( "SteamGameId" ); + + texture_name_hack = sgi && (!strcmp( sgi, "6020" ) || !strcmp( sgi, "2200" ) || !strcmp( sgi, "2350" ) || !strcmp( sgi, "273590" )); + } + + if (!texture_name_hack || opengl_funcs.gl.p_glIsTexture( texture_names[type] )) + { + if (texture_name_hack) FIXME( "Texture %u already exists.\n", texture_names[type] ); + opengl_funcs.gl.p_glGenTextures( 1, tex ); + return; + } + /* Star Wars Jedi Knight: Jedi Academy uses texture names without allocating + * them with glGenTextures(). Trying to use a texture name which has low chances + * to overlap with what games may use. */ + if (!once++) FIXME( "Using texture name hack.\n" ); + *tex = texture_names[type]; +} + +static void fs_hack_init_context( struct wgl_context *ctx, struct gl_drawable *gl ) +{ + GLuint prev_draw_fbo, prev_read_fbo, prev_texture, prev_renderbuffer, prev_pixel_pack_buffer; + float prev_clear_color[4], prev_clear_depth; + int prev_clear_stencil; + unsigned int i; + struct fs_hack_fbo_attachments_config config; + struct fs_hack_fbconfig_attribs attribs; + static const struct fbconfig_attribs_query + { + int attribute; + unsigned int offset; + } + queries[] = + { + {GLX_RENDER_TYPE, offsetof(struct fs_hack_fbconfig_attribs, render_type)}, + {GLX_BUFFER_SIZE, offsetof(struct fs_hack_fbconfig_attribs, buffer_size)}, + {GLX_RED_SIZE, offsetof(struct fs_hack_fbconfig_attribs, red_size)}, + {GLX_GREEN_SIZE, offsetof(struct fs_hack_fbconfig_attribs, green_size)}, + {GLX_BLUE_SIZE, offsetof(struct fs_hack_fbconfig_attribs, blue_size)}, + {GLX_ALPHA_SIZE, offsetof(struct fs_hack_fbconfig_attribs, alpha_size)}, + {GLX_DEPTH_SIZE, offsetof(struct fs_hack_fbconfig_attribs, depth_size)}, + {GLX_STENCIL_SIZE, offsetof(struct fs_hack_fbconfig_attribs, stencil_size)}, + {GLX_DOUBLEBUFFER, offsetof(struct fs_hack_fbconfig_attribs, doublebuffer)}, + {GLX_SAMPLES_ARB, offsetof(struct fs_hack_fbconfig_attribs, samples)}, + }; + BYTE *ptr = (BYTE *)&attribs; + int width, height; + RECT rect = {0}; + GLuint profile; + HWND hwnd; + + hwnd = NtUserWindowFromDC( ctx->hdc ); + NtUserGetClientRect( hwnd, &rect, NtUserGetDpiForWindow( hwnd ) ); + + width = rect.right - rect.left; + height = rect.bottom - rect.top; + + TRACE( "Render buffer width:%d height:%d\n", width, height ); + + opengl_funcs.gl.p_glGetIntegerv( GL_CONTEXT_PROFILE_MASK, (GLint *)&profile ); + ctx->is_core = (profile & GL_CONTEXT_CORE_PROFILE_BIT) != 0; + ctx->fs_hack = TRUE; + + opengl_funcs.gl.p_glGetIntegerv( GL_DRAW_FRAMEBUFFER_BINDING, (GLint *)&prev_draw_fbo ); + opengl_funcs.gl.p_glGetIntegerv( GL_READ_FRAMEBUFFER_BINDING, (GLint *)&prev_read_fbo ); + opengl_funcs.gl.p_glGetIntegerv( GL_TEXTURE_BINDING_2D, (GLint *)&prev_texture ); + opengl_funcs.gl.p_glGetIntegerv( GL_RENDERBUFFER_BINDING, (GLint *)&prev_renderbuffer ); + opengl_funcs.gl.p_glGetIntegerv( GL_PIXEL_UNPACK_BUFFER_BINDING, (GLint *)&prev_pixel_pack_buffer ); + opengl_funcs.gl.p_glGetFloatv( GL_COLOR_CLEAR_VALUE, prev_clear_color ); + opengl_funcs.gl.p_glGetFloatv( GL_DEPTH_CLEAR_VALUE, &prev_clear_depth ); + opengl_funcs.gl.p_glGetIntegerv( GL_STENCIL_CLEAR_VALUE, &prev_clear_stencil ); + TRACE( "Previous draw FBO %u, read FBO %u for ctx %p\n", prev_draw_fbo, prev_read_fbo, ctx ); + + pglBindBuffer( GL_PIXEL_UNPACK_BUFFER, 0 ); + + if (!ctx->fs_hack_fbo) + { + pglGenFramebuffers( 1, &ctx->fs_hack_fbo ); + TRACE( "Created FBO %u for fullscreen hack.\n", ctx->fs_hack_fbo ); + } + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0 ); + + for (i = 0; i < ARRAY_SIZE(queries); ++i) + pglXGetFBConfigAttrib( gdi_display, gl->format->fbconfig, queries[i].attribute, + (int *)&ptr[queries[i].offset] ); + + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, ctx->fs_hack_fbo ); + + fs_hack_get_attachments_config( gl, &attribs, &config ); + + if (!ctx->fs_hack_color_texture) + gen_texture( ctx, &ctx->fs_hack_color_texture, FSHACK_TEXTURE_COLOUR ); + + opengl_funcs.gl.p_glBindTexture( GL_TEXTURE_2D, ctx->fs_hack_color_texture ); + opengl_funcs.gl.p_glTexImage2D( GL_TEXTURE_2D, 0, config.color_internalformat, width, + height, 0, config.color_format, config.color_type, NULL ); + opengl_funcs.gl.p_glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0 ); + opengl_funcs.gl.p_glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, + ctx->fs_hack_integer ? GL_NEAREST : GL_LINEAR ); + opengl_funcs.gl.p_glBindTexture( GL_TEXTURE_2D, prev_texture ); + TRACE( "Created texture %u for fullscreen hack.\n", ctx->fs_hack_color_texture ); + + if (config.samples) + { + gl->fs_hack_needs_resolve = TRUE; + + if (!ctx->fs_hack_resolve_fbo) + { + pglGenFramebuffers( 1, &ctx->fs_hack_resolve_fbo ); + TRACE( "Created resolve FBO %u for fullscreen hack.\n", ctx->fs_hack_resolve_fbo ); + } + + if (!ctx->fs_hack_color_renderbuffer) + pglGenRenderbuffers( 1, &ctx->fs_hack_color_renderbuffer ); + pglBindRenderbuffer( GL_RENDERBUFFER, ctx->fs_hack_color_renderbuffer ); + pglRenderbufferStorageMultisample( GL_RENDERBUFFER, config.samples, + config.color_internalformat, width, height ); + pglFramebufferRenderbuffer( GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, + ctx->fs_hack_color_renderbuffer ); + TRACE( "Created renderbuffer %u and FBO %u for fullscreen hack.\n", + ctx->fs_hack_color_renderbuffer, ctx->fs_hack_resolve_fbo ); + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, ctx->fs_hack_resolve_fbo ); + pglFramebufferTexture2D( GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, + ctx->fs_hack_color_texture, 0 ); + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, ctx->fs_hack_fbo ); + pglBindRenderbuffer( GL_RENDERBUFFER, prev_renderbuffer ); + } + else + { + gl->fs_hack_needs_resolve = FALSE; + pglFramebufferTexture2D( GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, + ctx->fs_hack_color_texture, 0 ); + } + + if (config.ds_internalformat) + { + if (config.samples) + { + if (!ctx->fs_hack_ds_renderbuffer) pglGenRenderbuffers( 1, &ctx->fs_hack_ds_renderbuffer ); + pglBindRenderbuffer( GL_RENDERBUFFER, ctx->fs_hack_ds_renderbuffer ); + pglRenderbufferStorageMultisample( GL_RENDERBUFFER, config.samples, + config.ds_internalformat, width, height ); + pglBindRenderbuffer( GL_RENDERBUFFER, prev_renderbuffer ); + if (attribs.depth_size) + pglFramebufferRenderbuffer( GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, + GL_RENDERBUFFER, ctx->fs_hack_ds_renderbuffer ); + if (attribs.stencil_size) + pglFramebufferRenderbuffer( GL_DRAW_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, + GL_RENDERBUFFER, ctx->fs_hack_ds_renderbuffer ); + TRACE( "Created DS renderbuffer %u for fullscreen hack.\n", ctx->fs_hack_ds_renderbuffer ); + } + else + { + if (!ctx->fs_hack_ds_texture) + gen_texture( ctx, &ctx->fs_hack_ds_texture, FSHACK_TEXTURE_DEPTH ); + + opengl_funcs.gl.p_glBindTexture( GL_TEXTURE_2D, ctx->fs_hack_ds_texture ); + opengl_funcs.gl.p_glTexImage2D( GL_TEXTURE_2D, 0, config.ds_internalformat, width, + height, 0, config.ds_format, config.ds_type, NULL ); + opengl_funcs.gl.p_glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0 ); + opengl_funcs.gl.p_glBindTexture( GL_TEXTURE_2D, prev_texture ); + if (attribs.depth_size) + pglFramebufferTexture2D( GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, + GL_TEXTURE_2D, ctx->fs_hack_ds_texture, 0 ); + if (attribs.stencil_size) + pglFramebufferTexture2D( GL_DRAW_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, + GL_TEXTURE_2D, ctx->fs_hack_ds_texture, 0 ); + TRACE( "Created DS texture %u for fullscreen hack.\n", ctx->fs_hack_ds_texture ); + } + } + + fs_hack_setup_gamma_shader( ctx, gl ); + + if (!ctx->has_been_current) opengl_funcs.gl.p_glViewport( 0, 0, width, height ); + + if (!gl->fs_hack_context_set_up) + { + if (ctx->has_been_current) + { + GLbitfield mask = GL_COLOR_BUFFER_BIT; + + if (attribs.depth_size) mask |= GL_DEPTH_BUFFER_BIT; + if (attribs.stencil_size) mask |= GL_STENCIL_BUFFER_BIT; + + pglBindFramebuffer( GL_READ_FRAMEBUFFER, 0 ); + pglBlitFramebuffer( 0, 0, width, height, 0, 0, width, height, mask, GL_NEAREST ); + } + else + { + opengl_funcs.gl.p_glClearColor( 0.0f, 0.0f, 0.0f, 1.0f ); + opengl_funcs.gl.p_glClearDepth( 1.0 ); + opengl_funcs.gl.p_glClearStencil( 0 ); + opengl_funcs.gl.p_glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT ); + } + } + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0 ); + pglDrawBuffer( GL_BACK ); + if (!gl->fs_hack_context_set_up) + { + opengl_funcs.gl.p_glClear( GL_COLOR_BUFFER_BIT ); + opengl_funcs.gl.p_glClearColor( prev_clear_color[0], prev_clear_color[1], + prev_clear_color[2], prev_clear_color[3] ); + opengl_funcs.gl.p_glClearDepth( prev_clear_depth ); + opengl_funcs.gl.p_glClearStencil( prev_clear_stencil ); + } + wglBindFramebuffer( GL_DRAW_FRAMEBUFFER, prev_draw_fbo ); + wglBindFramebuffer( GL_READ_FRAMEBUFFER, prev_read_fbo ); + + ctx->setup_for.x = width; + ctx->setup_for.y = height; + gl->has_scissor_indexed = has_extension( glExtensions, "GL_ARB_viewport_array" ); + gl->has_clip_control = has_extension( glExtensions, "GL_ARB_clip_control" ); + gl->has_ati_frag_shader = !ctx->is_core && + has_extension( glExtensions, "GL_ATI_fragment_shader" ); + gl->has_fragment_program = !ctx->is_core && + has_extension( glExtensions, "GL_ARB_fragment_program" ); + gl->has_vertex_program = !ctx->is_core && + has_extension( glExtensions, "GL_ARB_vertex_program" ); + ctx->fs_hack_integer = fs_hack_is_integer(); + ctx->fs_hack_needs_resolve = gl->fs_hack_needs_resolve; + gl->fs_hack_context_set_up = TRUE; + + pglBindBuffer( GL_PIXEL_UNPACK_BUFFER, prev_pixel_pack_buffer ); +} + +static void fs_hack_reset_context( struct wgl_context *ctx, struct gl_drawable *gl ) +{ + TRACE( "Releasing fullscreen hack texture %u and FBO %u\n", ctx->fs_hack_color_texture, ctx->fs_hack_fbo ); + if (ctx->current_draw_fbo == ctx->fs_hack_fbo) + { + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0 ); + ctx->current_draw_fbo = 0; + } + if (ctx->current_read_fbo == ctx->fs_hack_fbo) + { + pglBindFramebuffer( GL_READ_FRAMEBUFFER, 0 ); + ctx->current_read_fbo = 0; + } + ctx->fs_hack = FALSE; + gl->fs_hack_context_set_up = FALSE; +} + +static void fs_hack_update_context( struct wgl_context *ctx, struct gl_drawable *old_gl, struct gl_drawable *new_gl ) +{ + assert( !!new_gl ); + + if (new_gl->fs_hack && (!ctx->fs_hack || new_gl != old_gl || !new_gl->fs_hack_context_set_up)) + fs_hack_init_context( ctx, new_gl ); + else if (!new_gl->fs_hack && ctx->fs_hack) + fs_hack_reset_context( ctx, new_gl ); +} + +static void fs_hack_destroy_context( struct wgl_context *ctx ) +{ + GLXContext prev_context; + GLXDrawable prev_drawable; + + if (!ctx->drawables[0]) return; + + prev_context = pglXGetCurrentContext(); + prev_drawable = pglXGetCurrentDrawable(); + pglXMakeCurrent( gdi_display, ctx->drawables[0]->drawable, ctx->ctx ); + + pglDeleteBuffers( 1, &ctx->ramp_ubo ); + pglDeleteProgram( ctx->fs_hack_gamma_pgm ); + ctx->fs_hack_gamma_pgm = 0; + + if (ctx->fs_hack_ds_renderbuffer) pglDeleteRenderbuffers( 1, &ctx->fs_hack_ds_renderbuffer ); + if (ctx->fs_hack_color_renderbuffer) pglDeleteRenderbuffers( 1, &ctx->fs_hack_color_renderbuffer ); + if (ctx->fs_hack_ds_texture) opengl_funcs.gl.p_glDeleteTextures( 1, &ctx->fs_hack_ds_texture ); + if (ctx->fs_hack_color_texture) opengl_funcs.gl.p_glDeleteTextures( 1, &ctx->fs_hack_color_texture ); + ctx->fs_hack_color_renderbuffer = ctx->fs_hack_ds_renderbuffer = 0; + ctx->fs_hack_color_texture = ctx->fs_hack_ds_texture = 0; + if (ctx->fs_hack_resolve_fbo) pglDeleteFramebuffers( 1, &ctx->fs_hack_resolve_fbo ); + if (ctx->fs_hack_fbo) pglDeleteFramebuffers( 1, &ctx->fs_hack_fbo ); + ctx->fs_hack_resolve_fbo = ctx->fs_hack_fbo = 0; + + pglXMakeCurrent( gdi_display, prev_drawable, prev_context ); +} + /* Mark any allocated context using the glx drawable 'old' to use 'new' */ static void mark_drawable_dirty( struct gl_drawable *old, struct gl_drawable *new ) { @@ -1013,6 +1736,7 @@ static inline void sync_context(struct wgl_context *context) context->drawables[1]->drawable, context->ctx); else pglXMakeCurrent(gdi_display, context->drawables[0]->drawable, context->ctx); + fs_hack_update_context( context, old[0], context->drawables[0] ); release_gl_drawable( old[0] ); release_gl_drawable( old[1] ); } @@ -1090,6 +1814,31 @@ static GLXContext create_glxcontext(Display *display, struct wgl_context *contex return ctx; } +BOOL enable_fullscreen_hack( HWND hwnd, BOOL check_gamma ) +{ + if (NtUserGetDpiForWindow( hwnd ) != NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI )) return TRUE; /* needs DPI scaling */ + return check_gamma && ReadNoFence( &gamma_serial ); +} + +static RECT get_client_rect( HWND hwnd, BOOL raw ) +{ + struct x11drv_win_data *data; + RECT rect; + + if (!raw) + NtUserGetClientRect( hwnd, &rect, NtUserGetDpiForWindow( hwnd ) ); + else if (!(data = get_win_data( hwnd ))) + NtUserGetClientRect( hwnd, &rect, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); + else + { + rect = data->rects.client; + OffsetRect( &rect, -rect.left, -rect.top ); + release_win_data( data ); + } + + return rect; +} + /*********************************************************************** * create_gl_drawable */ @@ -1102,8 +1851,9 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct glx_pixel XVisualInfo *visual = format->visual; RECT rect; int width, height; + BOOL enable_fshack = enable_fullscreen_hack( hwnd, TRUE ); - NtUserGetClientRect( hwnd, &rect, NtUserGetDpiForWindow( hwnd ) ); + rect = get_client_rect( hwnd, enable_fshack ); width = min( max( 1, rect.right ), 65535 ); height = min( max( 1, rect.bottom ), 65535 ); @@ -1120,7 +1870,7 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct glx_pixel gl->rect = rect; gl->mutable_pf = mutable_pf; - if (!needs_offscreen_rendering( hwnd, known_child )) + if (!needs_offscreen_rendering( hwnd, known_child, TRUE )) { gl->type = DC_GL_WINDOW; gl->colormap = XCreateColormap( gdi_display, get_dummy_parent(), visual->visual, @@ -1129,7 +1879,9 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct glx_pixel gl->window = create_client_window( hwnd, gl->rect, visual, gl->colormap ); if (gl->window) gl->drawable = pglXCreateWindow( gdi_display, gl->format->fbconfig, gl->window, NULL ); + gl->fs_hack = enable_fshack; TRACE( "%p created client %lx drawable %lx\n", hwnd, gl->window, gl->drawable ); + if (gl->fs_hack) WARN( "Window %p has the fullscreen hack enabled\n", hwnd ); } #ifdef SONAME_LIBXCOMPOSITE else if(usexcomposite) @@ -1139,6 +1891,7 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct glx_pixel (visual->class == PseudoColor || visual->class == GrayScale || visual->class == DirectColor) ? AllocAll : AllocNone ); gl->window = create_client_window( hwnd, gl->rect, visual, gl->colormap ); + gl->fs_hack = enable_fshack; if (gl->window) { struct x11drv_win_data *data; @@ -1158,6 +1911,7 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct glx_pixel } TRACE( "%p created child %lx drawable %lx\n", hwnd, gl->window, gl->drawable ); + if (gl->fs_hack) WARN( "Window %p has the fullscreen hack enabled\n", hwnd ); } #endif else @@ -1278,7 +2032,7 @@ static void update_gl_drawable_size( struct gl_drawable *gl ) XWindowChanges changes; RECT rect; - NtUserGetClientRect( gl->hwnd, &rect, NtUserGetDpiForWindow( gl->hwnd ) ); + rect = get_client_rect( gl->hwnd, gl->fs_hack ); if (EqualRect( &rect, &gl->rect )) return; changes.width = min( max( 1, rect.right ), 65535 ); @@ -1307,7 +2061,7 @@ static void update_gl_drawable_size( struct gl_drawable *gl ) void sync_gl_drawable( HWND hwnd, BOOL known_child ) { struct gl_drawable *old, *new; - BOOL is_offscreen; + BOOL is_offscreen, enable_fshack; if (!(old = get_gl_drawable( hwnd, 0 ))) return; @@ -1316,7 +2070,8 @@ void sync_gl_drawable( HWND hwnd, BOOL known_child ) case DC_GL_WINDOW: case DC_GL_CHILD_WIN: is_offscreen = old->type == DC_GL_CHILD_WIN; - if (is_offscreen == needs_offscreen_rendering( hwnd, known_child )) + enable_fshack = enable_fullscreen_hack( hwnd, TRUE ); + if (enable_fshack == old->fs_hack && is_offscreen == needs_offscreen_rendering( hwnd, known_child, TRUE )) { update_gl_drawable_size( old ); break; @@ -1691,6 +2446,8 @@ static BOOL glxdrv_wglDeleteContext(struct wgl_context *ctx) TRACE("(%p)\n", ctx); + fs_hack_destroy_context( ctx ); + pthread_mutex_lock( &context_mutex ); list_remove( &ctx->entry ); LIST_FOR_EACH_ENTRY( pb, &pbuffer_list, struct wgl_pbuffer, entry ) @@ -1717,6 +2474,9 @@ static BOOL glxdrv_wglDeleteContext(struct wgl_context *ctx) static PROC glxdrv_wglGetProcAddress(LPCSTR lpszProc) { if (!strncmp(lpszProc, "wgl", 3)) return NULL; + if (!strcmp( lpszProc, "glBindFramebuffer" )) return (PROC)(void *)wglBindFramebuffer; + if (!strcmp( lpszProc, "glBindFramebufferEXT" )) return (PROC)(void *)wglBindFramebufferEXT; + if (!strcmp( lpszProc, "glFramebufferTexture2D" )) return (PROC)(void *)wglFramebufferTexture2D; return pglXGetProcAddressARB((const GLubyte*)lpszProc); } @@ -1733,6 +2493,7 @@ static void set_context_drawables( struct wgl_context *ctx, struct gl_drawable * ctx->drawables[0] = grab_gl_drawable( draw ); ctx->drawables[1] = read ? grab_gl_drawable( read ) : NULL; ctx->new_drawables[0] = ctx->new_drawables[1] = NULL; + fs_hack_update_context( ctx, prev[0], ctx->drawables[0] ); for (i = 0; i < 4; i++) release_gl_drawable( prev[i] ); } @@ -1770,9 +2531,9 @@ static BOOL glxdrv_wglMakeCurrent(HDC hdc, struct wgl_context *ctx) if (ret) { NtCurrentTeb()->glContext = ctx; - ctx->has_been_current = TRUE; ctx->hdc = hdc; set_context_drawables( ctx, gl, gl ); + ctx->has_been_current = TRUE; pthread_mutex_unlock( &context_mutex ); goto done; } @@ -1786,6 +2547,508 @@ static BOOL glxdrv_wglMakeCurrent(HDC hdc, struct wgl_context *ctx) return ret; } +static void wglFramebufferTexture2D( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ) +{ + struct wgl_context *ctx = NtCurrentTeb()->glContext; + + TRACE( "target %#x, attachment %#x, textarget %#x, texture %u, level %u.\n", target, attachment, + textarget, texture, level ); + + if (ctx->fs_hack) + { + /* glFramebufferTexture2D should fail for default framebuffer 0. + * Let it fail and relay appropriate error instead of breaking fs_hack FBO. */ + if (ctx->current_read_fbo == ctx->fs_hack_fbo) pglBindFramebuffer( GL_READ_FRAMEBUFFER, 0 ); + if (ctx->current_draw_fbo == ctx->fs_hack_fbo) pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0 ); + } + pglFramebufferTexture2D( target, attachment, textarget, texture, level ); + if (ctx->fs_hack) + { + if (ctx->current_read_fbo == ctx->fs_hack_fbo) + pglBindFramebuffer( GL_READ_FRAMEBUFFER, ctx->fs_hack_fbo ); + if (ctx->current_draw_fbo == ctx->fs_hack_fbo) + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, ctx->fs_hack_fbo ); + } +} + +static void wglBindFramebuffer( GLenum target, GLuint framebuffer ) +{ + struct wgl_context *ctx = NtCurrentTeb()->glContext; + + TRACE( "target %#x, framebuffer %u\n", target, framebuffer ); + if (ctx->fs_hack && !framebuffer) framebuffer = ctx->fs_hack_fbo; + + if (target == GL_DRAW_FRAMEBUFFER || target == GL_FRAMEBUFFER) ctx->current_draw_fbo = framebuffer; + if (target == GL_READ_FRAMEBUFFER || target == GL_FRAMEBUFFER) ctx->current_read_fbo = framebuffer; + + pglBindFramebuffer( target, framebuffer ); +} + +static void wglBindFramebufferEXT( GLenum target, GLuint framebuffer ) +{ + struct wgl_context *ctx = NtCurrentTeb()->glContext; + + TRACE( "target %#x, framebuffer %u\n", target, framebuffer ); + if (ctx->fs_hack && !framebuffer) framebuffer = ctx->fs_hack_fbo; + + if (target == GL_DRAW_FRAMEBUFFER || target == GL_FRAMEBUFFER) ctx->current_draw_fbo = framebuffer; + if (target == GL_READ_FRAMEBUFFER || target == GL_FRAMEBUFFER) ctx->current_read_fbo = framebuffer; + + pglBindFramebufferEXT( target, framebuffer ); +} + +static void wglDrawBuffer( GLenum buffer ) +{ + struct wgl_context *ctx = NtCurrentTeb()->glContext; + + TRACE( "buffer %#x.\n", buffer ); + + if (!ctx->current_draw_fbo || (ctx->fs_hack && ctx->current_draw_fbo == ctx->fs_hack_fbo)) + ctx->drawing_to_front = (buffer == GL_FRONT || buffer == GL_FRONT_AND_BACK); + + if (ctx->fs_hack && ctx->current_draw_fbo == ctx->fs_hack_fbo) + { + TRACE( "Overriding %#x with GL_COLOR_ATTACHMENT0\n", buffer ); + buffer = GL_COLOR_ATTACHMENT0; + } + pglDrawBuffer( buffer ); +} + +static void wglReadBuffer( GLenum buffer ) +{ + struct wgl_context *ctx = NtCurrentTeb()->glContext; + + if (ctx->fs_hack && ctx->current_read_fbo == ctx->fs_hack_fbo) + { + TRACE( "Overriding %#x with GL_COLOR_ATTACHMENT0\n", buffer ); + buffer = GL_COLOR_ATTACHMENT0; + } + pglReadBuffer( buffer ); +} + +static BOOL resolve_fs_hack_fbo( GLuint *old_read_fbo ) +{ + struct wgl_context *ctx = NtCurrentTeb()->glContext; + GLuint old_draw_fbo; + unsigned int cx, cy; + RECT user_rect; + HWND hwnd; + + if (!ctx || !ctx->fs_hack || !ctx->fs_hack_needs_resolve) return FALSE; + if (!ctx->fs_hack_needs_resolve) return FALSE; + if (ctx->current_read_fbo != ctx->fs_hack_fbo) return FALSE; + if (!(hwnd = NtUserWindowFromDC( ctx->hdc ))) return FALSE; + + NtUserGetClientRect( hwnd, &user_rect, NtUserGetDpiForWindow( hwnd ) ); + cx = user_rect.right - user_rect.left; + cy = user_rect.bottom - user_rect.top; + + TRACE( "resolving fbo, %ux%u.\n", cx, cy ); + + opengl_funcs.gl.p_glGetIntegerv( GL_READ_FRAMEBUFFER_BINDING, (GLint *)old_read_fbo ); + opengl_funcs.gl.p_glGetIntegerv( GL_READ_FRAMEBUFFER_BINDING, (GLint *)&old_draw_fbo ); + + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, ctx->fs_hack_resolve_fbo ); + pglBlitFramebuffer( 0, 0, cx, cy, 0, 0, cx, cy, GL_COLOR_BUFFER_BIT, GL_NEAREST ); + pglBindFramebuffer( GL_READ_FRAMEBUFFER, ctx->fs_hack_resolve_fbo ); + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, old_draw_fbo ); + + return TRUE; +} + +static void wglCopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) +{ + GLuint old_read_fbo; + BOOL restore; + + TRACE( "target %#x, level %d, offset %dx%d, origin %dx%d, size %dx%d.\n", + target, level, xoffset, yoffset, x, y, width, height ); + + restore = resolve_fs_hack_fbo( &old_read_fbo ); + pglCopyTexSubImage2D( target, level, xoffset, yoffset, x, y, width, height ); + if (restore) pglBindFramebuffer( GL_READ_FRAMEBUFFER, old_read_fbo ); +} + +static void wglCopyTexImage2D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) +{ + GLuint old_read_fbo; + BOOL restore; + + TRACE( "target %#x, level %d, internalformat %#x, origin %dx%d, size %dx%d, border %d.\n", + target, level, internalformat, x, y, width, height, border ); + + restore = resolve_fs_hack_fbo( &old_read_fbo ); + pglCopyTexImage2D( target, level, internalformat, x, y, width, height, border ); + if (restore) pglBindFramebuffer( GL_READ_FRAMEBUFFER, old_read_fbo ); +} + +static void wglReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * data) +{ + GLuint old_read_fbo; + BOOL restore; + + TRACE( "origin %dx%d, size %dx%d, format %#x, type %#x, data %p.\n", x, y, width, height, format, type, data ); + + restore = resolve_fs_hack_fbo( &old_read_fbo ); + pglReadPixels( x, y, width, height, format, type, data ); + if (restore) pglBindFramebuffer( GL_READ_FRAMEBUFFER, old_read_fbo ); +} + +struct fs_hack_gl_state +{ + GLuint draw_fbo; + GLuint read_fbo; + GLuint program; + GLuint bound_texture; + GLint active_texture; + GLint clip_origin, clip_depth_mode; + GLuint ubo; + GLint64 ubo_size, ubo_start; + GLint viewporti[4]; + GLfloat viewportf[4]; + float clear_color[4]; + GLboolean scissor_test, cull_face, blend, alpha_test, depth_test, stencil_test; + GLboolean arb_frag, arb_vert, ati_frag, fb_srgb; + GLboolean clip_distance[8]; + GLboolean color_mask[4]; + GLuint sampler; +}; + +#define SET 0 +#define RESET 1 + +static void fs_hack_handle_enable_switch( int mode, GLenum cap, GLboolean *b, BOOL new ) +{ + if (mode == SET) + { + *b = opengl_funcs.gl.p_glIsEnabled( cap ); + if (new) opengl_funcs.gl.p_glEnable( cap ); + else opengl_funcs.gl.p_glDisable( cap ); + } + else + { + if (*b) opengl_funcs.gl.p_glEnable( cap ); + else opengl_funcs.gl.p_glDisable( cap ); + } +} + +static void fs_hack_handle_fbo_state( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state ) +{ + if (mode == SET) + { + opengl_funcs.gl.p_glGetIntegerv( GL_DRAW_FRAMEBUFFER_BINDING, (GLint *)&state->draw_fbo ); + opengl_funcs.gl.p_glGetIntegerv( GL_READ_FRAMEBUFFER_BINDING, (GLint *)&state->read_fbo ); + TRACE( "Previous draw FBO %u, read FBO %u\n", state->draw_fbo, state->read_fbo ); + } + else + { + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, state->draw_fbo ); + pglBindFramebuffer( GL_READ_FRAMEBUFFER, state->read_fbo ); + } +} + +static void fs_hack_handle_clip_control( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state ) +{ + if (!gl->has_clip_control) return; + + if (mode == SET) + { + opengl_funcs.gl.p_glGetIntegerv( GL_CLIP_ORIGIN, (GLint *)&state->clip_origin ); + opengl_funcs.gl.p_glGetIntegerv( GL_CLIP_DEPTH_MODE, (GLint *)&state->clip_depth_mode ); + + pglClipControl( GL_LOWER_LEFT, GL_NEGATIVE_ONE_TO_ONE ); + } + else + { + pglClipControl( state->clip_origin, state->clip_depth_mode ); + } +} + +static void fs_hack_handle_shaders( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state ) +{ + if (gl->has_fragment_program) + fs_hack_handle_enable_switch( mode, GL_FRAGMENT_PROGRAM_ARB, &state->arb_frag, FALSE ); + if (gl->has_vertex_program) + fs_hack_handle_enable_switch( mode, GL_VERTEX_PROGRAM_ARB, &state->arb_vert, FALSE ); + fs_hack_handle_enable_switch( mode, GL_FRAMEBUFFER_SRGB, &state->fb_srgb, FALSE ); + + if (gl->has_ati_frag_shader) + fs_hack_handle_enable_switch( mode, GL_FRAGMENT_SHADER_ATI, &state->ati_frag, FALSE ); + + if (mode == SET) + { + opengl_funcs.gl.p_glGetIntegerv( GL_CURRENT_PROGRAM, (GLint *)&state->program ); + + pglGetIntegeri_v( GL_UNIFORM_BUFFER_BINDING, 0, (GLint *)&state->ubo ); + pglGetInteger64i_v( GL_UNIFORM_BUFFER_START, 0, &state->ubo_start ); + pglGetInteger64i_v( GL_UNIFORM_BUFFER_SIZE, 0, &state->ubo_size ); + + opengl_funcs.gl.p_glGetIntegerv( GL_ACTIVE_TEXTURE, &state->active_texture ); + pglActiveTexture( GL_TEXTURE0 ); + opengl_funcs.gl.p_glGetIntegerv( GL_TEXTURE_BINDING_2D, (GLint *)&state->bound_texture ); + pglGetIntegeri_v( GL_SAMPLER_BINDING, 0, (GLint *)&state->sampler ); + + pglBindBufferBase( GL_UNIFORM_BUFFER, 0, ctx->ramp_ubo ); + + opengl_funcs.gl.p_glBindTexture( GL_TEXTURE_2D, ctx->fs_hack_color_texture ); + pglBindSampler( 0, 0 ); + + pglUseProgram( ctx->fs_hack_gamma_pgm ); + } + else + { + pglUseProgram( state->program ); + + pglBindSampler( 0, state->sampler ); + + opengl_funcs.gl.p_glBindTexture( GL_TEXTURE_2D, state->bound_texture ); + pglActiveTexture( state->active_texture ); + + pglBindBufferRange( GL_UNIFORM_BUFFER, 0, state->ubo, state->ubo_start, state->ubo_size ); + } +} + +static void fs_hack_handle_viewport( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state ) +{ + if (mode == SET) + { + if (gl->has_scissor_indexed) + { + pglGetFloati_v( GL_VIEWPORT, 0, state->viewportf ); + } + else + { + opengl_funcs.gl.p_glGetIntegerv( GL_VIEWPORT, state->viewporti ); + } + } + else + { + if (gl->has_scissor_indexed) + { + pglViewportIndexedfv( 0, state->viewportf ); + } + else + { + opengl_funcs.gl.p_glViewport( state->viewporti[0], state->viewporti[1], + state->viewporti[2], state->viewporti[3] ); + } + } +} + +static void fs_hack_handle_clear_color( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state ) +{ + if (mode == SET) + { + opengl_funcs.gl.p_glGetFloatv( GL_COLOR_CLEAR_VALUE, state->clear_color ); + opengl_funcs.gl.p_glClearColor( 0.0f, 0.0f, 0.0f, 1.0f ); + } + else + { + opengl_funcs.gl.p_glClearColor( state->clear_color[0], state->clear_color[1], + state->clear_color[2], state->clear_color[3] ); + } +} + +static void fs_hack_handle_clip_distance( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state ) +{ + unsigned int i; + if (mode == SET) + { + for (i = 0; i < ARRAY_SIZE(state->clip_distance); ++i) + { + state->clip_distance[i] = opengl_funcs.gl.p_glIsEnabled( GL_CLIP_DISTANCE0 + i ); + opengl_funcs.gl.p_glDisable( GL_CLIP_DISTANCE0 + i ); + } + } + else + { + for (i = 0; i < ARRAY_SIZE(state->clip_distance); ++i) + { + if (state->clip_distance[i]) opengl_funcs.gl.p_glEnable( GL_CLIP_DISTANCE0 + i ); + } + } +} + +static void fs_hack_handle_color_mask( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state ) +{ + if (mode == SET) + { + pglGetBooleani_v( GL_COLOR_WRITEMASK, 0, state->color_mask ); + + pglColorMaski( 0, GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE ); + } + else + { + pglColorMaski( 0, state->color_mask[0], state->color_mask[1], state->color_mask[2], state->color_mask[3] ); + } +} + +static void fs_hack_handle_scissor( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state ) +{ + fs_hack_handle_enable_switch( mode, GL_SCISSOR_TEST, &state->scissor_test, FALSE ); +} + +static void fs_hack_handle_cull_face( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state ) +{ + fs_hack_handle_enable_switch( mode, GL_CULL_FACE, &state->cull_face, FALSE ); +} + +static void fs_hack_handle_blend( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state ) +{ + fs_hack_handle_enable_switch( mode, GL_BLEND, &state->blend, FALSE ); +} + +static void fs_hack_handle_alpha_test( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state ) +{ + if (ctx->is_core) return; + + fs_hack_handle_enable_switch( mode, GL_ALPHA_TEST, &state->alpha_test, FALSE ); +} + +static void fs_hack_handle_ds_test( int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state ) +{ + fs_hack_handle_enable_switch( mode, GL_DEPTH_TEST, &state->depth_test, FALSE ); + fs_hack_handle_enable_switch( mode, GL_STENCIL_TEST, &state->stencil_test, FALSE ); +} + +static BOOL fs_hack_direct_front_blit(void) +{ + static int cached = -1; + + if (cached == -1) + { + const char *sgi = getenv( "SteamGameId" ); + + cached = sgi && !strcmp( sgi, "500810" ); + } + + return cached; +} + +static void fs_hack_blit_framebuffer( struct gl_drawable *gl, GLenum draw_buffer ) +{ + static const struct + { + void (*state_handler)(int mode, struct gl_drawable *gl, struct wgl_context *ctx, + struct fs_hack_gl_state *state); + } + general_state_handlers[] = + { + {fs_hack_handle_fbo_state}, + {fs_hack_handle_scissor}, + {fs_hack_handle_clear_color}, + }, + draw_state_handlers[] = + { + {fs_hack_handle_clip_control}, + {fs_hack_handle_shaders}, + {fs_hack_handle_viewport}, + {fs_hack_handle_cull_face}, + {fs_hack_handle_clip_distance}, + {fs_hack_handle_color_mask}, + {fs_hack_handle_blend}, + {fs_hack_handle_alpha_test}, + {fs_hack_handle_ds_test}, + }; + struct wgl_context *ctx = NtCurrentTeb()->glContext; + struct fs_hack_gl_state state; + RECT src, dst; + const float *gamma_ramp; + LONG gamma_serial = 0; + unsigned int i; + + NtUserGetClientRect( gl->hwnd, &src, NtUserGetDpiForWindow( gl->hwnd ) ); + dst = gl->rect; + + TRACE( "Stretching from FBO %u %s to %s\n", ctx->fs_hack_fbo, wine_dbgstr_rect( &src ), wine_dbgstr_rect( &dst ) ); + + if (ctx->setup_for.x != src.right || ctx->setup_for.y != src.bottom) fs_hack_init_context( ctx, gl ); + + gamma_ramp = fs_hack_get_current_gamma_ramp( &gamma_serial ); + + /* Can't stretch blit with multisampled renderbuffers */ + if (gl->fs_hack_needs_resolve && !gamma_ramp) + { + gamma_ramp = fs_hack_get_default_gamma_ramp(); + gamma_serial = 0; + } + + for (i = 0; i < ARRAY_SIZE(general_state_handlers); i++) + general_state_handlers[i].state_handler( SET, gl, ctx, &state ); + + if (gamma_ramp) + { + for (i = 0; i < ARRAY_SIZE(draw_state_handlers); i++) + draw_state_handlers[i].state_handler( SET, gl, ctx, &state ); + + if (gl->has_scissor_indexed) pglViewportIndexedf( 0, 0, 0, dst.right, dst.bottom ); + else opengl_funcs.gl.p_glViewport( 0, 0, dst.right, dst.bottom ); + } + + pglBindFramebuffer( GL_READ_FRAMEBUFFER, ctx->fs_hack_fbo ); + + if (gl->fs_hack_needs_resolve) + { + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, ctx->fs_hack_resolve_fbo ); + pglBlitFramebuffer( 0, 0, src.right, src.bottom, 0, 0, src.right, src.bottom, + GL_COLOR_BUFFER_BIT, GL_NEAREST ); + pglBindFramebuffer( GL_READ_FRAMEBUFFER, ctx->fs_hack_resolve_fbo ); + } + + pglBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0 ); + + if (draw_buffer == GL_FRONT && fs_hack_direct_front_blit()) pglDrawBuffer( GL_FRONT ); + else pglDrawBuffer( GL_BACK ); + + opengl_funcs.gl.p_glClear( GL_COLOR_BUFFER_BIT ); + + if (gamma_ramp) + { + if (gamma_serial != gl->last_gamma_serial) + { + TRACE( "updating gamma ramp (serial: %u)\n", (int)gamma_serial ); + + pglBufferData( GL_UNIFORM_BUFFER, sizeof(float) * 4 * GAMMA_RAMP_SIZE, gamma_ramp, GL_DYNAMIC_DRAW ); + + gl->last_gamma_serial = gamma_serial; + } + + pglDrawArrays( GL_TRIANGLE_STRIP, 0, 4 ); + } + else + { + pglBlitFramebuffer( 0, 0, src.right, src.bottom, 0, 0, dst.right, dst.bottom, + GL_COLOR_BUFFER_BIT, ctx->fs_hack_integer ? GL_NEAREST : GL_LINEAR ); + } + + if (draw_buffer == GL_FRONT) + { + if (fs_hack_direct_front_blit()) pglFlush(); + else pglXSwapBuffers( gdi_display, gl->drawable ); + } + + if (gamma_ramp) + { + for (i = 0; i < ARRAY_SIZE(draw_state_handlers); i++) + draw_state_handlers[i].state_handler( RESET, gl, ctx, &state ); + } + + for (i = 0; i < ARRAY_SIZE(general_state_handlers); i++) + general_state_handlers[i].state_handler( RESET, gl, ctx, &state ); +} + /*********************************************************************** * X11DRV_wglMakeContextCurrentARB */ @@ -1814,9 +3077,9 @@ static BOOL X11DRV_wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, struct read_gl ? read_gl->drawable : 0, ctx->ctx); if (ret) { - ctx->has_been_current = TRUE; ctx->hdc = draw_hdc; set_context_drawables( ctx, draw_gl, read_gl ); + ctx->has_been_current = TRUE; NtCurrentTeb()->glContext = ctx; pthread_mutex_unlock( &context_mutex ); goto done; @@ -1931,6 +3194,8 @@ static void wglFinish(void) else { sync_context(ctx); + if (gl->fs_hack && (!gl->fs_hack_did_swapbuf || ctx->drawing_to_front)) + fs_hack_blit_framebuffer( gl, GL_FRONT ); pglFinish(); present_gl_drawable( hwnd, ctx->hdc, gl, TRUE, FALSE ); release_gl_drawable( gl ); @@ -1947,6 +3212,8 @@ static void wglFlush(void) else { sync_context(ctx); + if (gl->fs_hack && (!gl->fs_hack_did_swapbuf || ctx->drawing_to_front)) + fs_hack_blit_framebuffer( gl, GL_FRONT ); pglFlush(); present_gl_drawable( hwnd, ctx->hdc, gl, TRUE, TRUE ); release_gl_drawable( gl ); @@ -2857,6 +4124,11 @@ static BOOL glxdrv_wglSwapBuffers( HDC hdc ) if (gl->type == DC_GL_CHILD_WIN) drawable = gl->window; /* fall through */ default: + if (gl->fs_hack) + { + fs_hack_blit_framebuffer( gl, GL_BACK ); + gl->fs_hack_did_swapbuf = TRUE; + } if (ctx && drawable && pglXSwapBuffersMscOML) { pglFlush(); diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 8cacaf412b46..b44e6f76c0bc 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -159,7 +159,7 @@ static void vulkan_surface_update_size( HWND hwnd, struct x11drv_vulkan_surface static void vulkan_surface_update_offscreen( HWND hwnd, struct x11drv_vulkan_surface *surface ) { - BOOL offscreen = needs_offscreen_rendering( hwnd, FALSE ); + BOOL offscreen = needs_offscreen_rendering( hwnd, FALSE, FALSE ); struct x11drv_win_data *data; if (offscreen == surface->offscreen) return; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 7df9b81cc737..c70b2d53dbfe 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -162,6 +162,7 @@ extern BOOL X11DRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT botto extern BOOL X11DRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType ); extern BOOL X11DRV_FillPath( PHYSDEV dev ); extern BOOL X11DRV_GetDeviceGammaRamp( PHYSDEV dev, LPVOID ramp ); +extern BOOL fs_hack_get_gamma_ramp( PHYSDEV dev, LPVOID ramp ); extern BOOL X11DRV_GetICMProfile( PHYSDEV dev, BOOL allow_default, LPDWORD size, LPWSTR filename ); extern DWORD X11DRV_GetImage( PHYSDEV dev, BITMAPINFO *info, struct gdi_image_bits *bits, struct bitblt_coords *src ); @@ -190,6 +191,7 @@ extern COLORREF X11DRV_SetDCBrushColor( PHYSDEV dev, COLORREF crColor ); extern COLORREF X11DRV_SetDCPenColor( PHYSDEV dev, COLORREF crColor ); extern void X11DRV_SetDeviceClipping( PHYSDEV dev, HRGN rgn ); extern BOOL X11DRV_SetDeviceGammaRamp( PHYSDEV dev, LPVOID ramp ); +extern BOOL fs_hack_set_gamma_ramp( PHYSDEV dev, LPVOID ramp ); extern COLORREF X11DRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ); extern BOOL X11DRV_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst, PHYSDEV src_dev, struct bitblt_coords *src, DWORD rop ); @@ -353,7 +355,8 @@ struct x11drv_escape_get_drawable RECT dc_rect; /* DC rectangle relative to drawable */ }; -extern BOOL needs_offscreen_rendering( HWND hwnd, BOOL known_child ); +extern BOOL enable_fullscreen_hack( HWND hwnd, BOOL check_gamma ); +extern BOOL needs_offscreen_rendering( HWND hwnd, BOOL known_child, BOOL check_gamma ); extern void set_dc_drawable( HDC hdc, Drawable drawable, const RECT *rect, int mode ); extern Drawable get_dc_drawable( HDC hdc, RECT *rect ); extern HRGN get_dc_monitor_region( HWND hwnd, HDC hdc ); From 05559d938bca44759f3fde8ed892517a0f1b7173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 6 Dec 2024 17:48:53 +0100 Subject: [PATCH 0582/2542] winevulkan: Get rid of the internal wine_queue struct. --- dlls/winevulkan/vulkan.c | 20 ++++++++++---------- dlls/winevulkan/vulkan_private.h | 11 +---------- include/wine/vulkan_driver.h | 3 +++ 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 7c8990172f58..1a571a33a52f 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -487,7 +487,7 @@ static void wine_vk_free_command_buffers(struct vulkan_device *device, static void wine_vk_device_init_queues(struct wine_device *object, const VkDeviceQueueCreateInfo *info) { - struct wine_queue *queues = object->queues + object->queue_count; + struct vulkan_queue *queues = object->queues + object->queue_count; struct vulkan_device *device = &object->obj; VkQueue client_queues = device->client.device->queues + object->queue_count; VkDeviceQueueInfo2 queue_info; @@ -497,7 +497,7 @@ static void wine_vk_device_init_queues(struct wine_device *object, const VkDevic for (i = 0; i < info->queueCount; i++) { - struct wine_queue *queue = queues + i; + struct vulkan_queue *queue = queues + i; VkQueue host_queue, client_queue = client_queues + i; /* The Vulkan spec says: @@ -519,13 +519,13 @@ static void wine_vk_device_init_queues(struct wine_device *object, const VkDevic device->p_vkGetDeviceQueue(device->host.device, info->queueFamilyIndex, i, &host_queue); } - vulkan_object_init_ptr(&queue->obj.obj, (UINT_PTR)host_queue, &client_queue->obj); - queue->obj.device = device; + vulkan_object_init_ptr(&queue->obj, (UINT_PTR)host_queue, &client_queue->obj); + queue->device = device; queue->family_index = info->queueFamilyIndex; queue->queue_index = i; queue->flags = info->flags; - TRACE("Got device %p queue %p, host_queue %p.\n", device, queue, queue->obj.host.queue); + TRACE("Got device %p queue %p, host_queue %p.\n", device, queue, queue->host.queue); } object->queue_count += info->queueCount; @@ -1001,8 +1001,8 @@ VkResult wine_vkCreateDevice(VkPhysicalDevice client_physical_device, const VkDe TRACE("Created device %p, host_device %p.\n", device, device->obj.host.device); for (i = 0; i < device->queue_count; i++) { - struct wine_queue *queue = device->queues + i; - vulkan_instance_insert_object(instance, &queue->obj.obj); + struct vulkan_queue *queue = device->queues + i; + vulkan_instance_insert_object(instance, &queue->obj); } vulkan_instance_insert_object(instance, &device->obj.obj); @@ -1126,7 +1126,7 @@ void wine_vkDestroyDevice(VkDevice client_device, const VkAllocationCallbacks *a device->obj.p_vkDestroyDevice(device->obj.host.device, NULL /* pAllocator */); for (i = 0; i < device->queue_count; i++) - vulkan_instance_remove_object(instance, &device->queues[i].obj.obj); + vulkan_instance_remove_object(instance, &device->queues[i].obj); vulkan_instance_remove_object(instance, &device->obj.obj); free(device); @@ -1304,7 +1304,7 @@ void wine_vkFreeCommandBuffers(VkDevice client_device, VkCommandPool command_poo static VkQueue wine_vk_device_find_queue(VkDevice client_device, const VkDeviceQueueInfo2 *info) { struct wine_device *device = wine_device_from_handle(client_device); - struct wine_queue *queue; + struct vulkan_queue *queue; uint32_t i; for (i = 0; i < device->queue_count; i++) @@ -1314,7 +1314,7 @@ static VkQueue wine_vk_device_find_queue(VkDevice client_device, const VkDeviceQ && queue->queue_index == info->queueIndex && queue->flags == info->flags) { - return queue->obj.client.queue; + return queue->client.queue; } } diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index 59b900930b3e..c0c92bd88c9f 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -41,20 +41,11 @@ static inline struct wine_cmd_buffer *wine_cmd_buffer_from_handle(VkCommandBuffe return (struct wine_cmd_buffer *)(UINT_PTR)client->unix_handle; } -struct wine_queue -{ - struct vulkan_queue obj; - - uint32_t family_index; - uint32_t queue_index; - VkDeviceQueueCreateFlags flags; -}; - struct wine_device { struct vulkan_device obj; uint64_t queue_count; - struct wine_queue queues[]; + struct vulkan_queue queues[]; }; C_ASSERT(sizeof(struct wine_device) == offsetof(struct wine_device, queues[0])); diff --git a/include/wine/vulkan_driver.h b/include/wine/vulkan_driver.h index 39263084c82f..f72b2ff3b0c0 100644 --- a/include/wine/vulkan_driver.h +++ b/include/wine/vulkan_driver.h @@ -121,6 +121,9 @@ struct vulkan_queue { VULKAN_OBJECT_HEADER( VkQueue, queue ); struct vulkan_device *device; + uint32_t family_index; + uint32_t queue_index; + VkDeviceQueueCreateFlags flags; }; static inline struct vulkan_queue *vulkan_queue_from_handle( VkQueue handle ) From efe7ba3f755476549f8f369feae15d32a079f9f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 6 Dec 2024 17:50:38 +0100 Subject: [PATCH 0583/2542] winevulkan: Define struct wine_device queues as a pointer. --- dlls/winevulkan/vulkan.c | 11 +++++++++-- dlls/winevulkan/vulkan_private.h | 4 +--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 1a571a33a52f..91606023b8c0 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -927,6 +927,8 @@ VkResult wine_vkCreateDevice(VkPhysicalDevice client_physical_device, const VkDe struct wine_device *device; unsigned int queue_count, i; VkResult res; + size_t size; + void *ptr; PFN_native_vkCreateDevice native_create_device = NULL; void *native_create_device_context = NULL; @@ -946,12 +948,17 @@ VkResult wine_vkCreateDevice(VkPhysicalDevice client_physical_device, const VkDe TRACE("Driver version: %#x.\n", properties.driverVersion); } + size = sizeof(*device); + /* We need to cache all queues within the device as each requires wrapping since queues are dispatchable objects. */ for (queue_count = 0, i = 0; i < create_info->queueCreateInfoCount; i++) queue_count += create_info->pQueueCreateInfos[i].queueCount; + size += queue_count * sizeof(*device->queues); - if (!(device = calloc(1, offsetof(struct wine_device, queues[queue_count])))) - return VK_ERROR_OUT_OF_HOST_MEMORY; + if (!(device = ptr = calloc(1, size))) return VK_ERROR_OUT_OF_HOST_MEMORY; + ptr = (char *)ptr + sizeof(*device); + device->queues = ptr; + ptr = (char *)ptr + queue_count * sizeof(*device->queues); if ((callback = (VkCreateInfoWineDeviceCallback *)create_info->pNext) && callback->sType == VK_STRUCTURE_TYPE_CREATE_INFO_WINE_DEVICE_CALLBACK) diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index c0c92bd88c9f..2452dfd7dad3 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -45,11 +45,9 @@ struct wine_device { struct vulkan_device obj; uint64_t queue_count; - struct vulkan_queue queues[]; + struct vulkan_queue *queues; }; -C_ASSERT(sizeof(struct wine_device) == offsetof(struct wine_device, queues[0])); - struct wine_debug_utils_messenger; struct wine_debug_report_callback From c0435d9a2ee36b5cfc884cbba3ab7a5de605f1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 6 Dec 2024 17:52:39 +0100 Subject: [PATCH 0584/2542] winevulkan: Get rid of internal struct wine_device. --- dlls/winevulkan/vulkan.c | 39 +++++++++++++------------------- dlls/winevulkan/vulkan_private.h | 7 ------ include/wine/vulkan_driver.h | 2 ++ 3 files changed, 18 insertions(+), 30 deletions(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 91606023b8c0..56de14e3d7f7 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -48,12 +48,6 @@ static struct wine_phys_dev *wine_phys_dev_from_handle(VkPhysicalDevice handle) return CONTAINING_RECORD(object, struct wine_phys_dev, obj); } -static struct wine_device *wine_device_from_handle(VkDevice handle) -{ - struct vulkan_device *object = vulkan_device_from_handle(handle); - return CONTAINING_RECORD(object, struct wine_device, obj); -} - static void vulkan_object_init_ptr( struct vulkan_object *obj, UINT64 host_handle, struct vulkan_client_object *client ) { obj->host_handle = host_handle; @@ -485,11 +479,10 @@ static void wine_vk_free_command_buffers(struct vulkan_device *device, } } -static void wine_vk_device_init_queues(struct wine_device *object, const VkDeviceQueueCreateInfo *info) +static void wine_vk_device_init_queues(struct vulkan_device *device, const VkDeviceQueueCreateInfo *info) { - struct vulkan_queue *queues = object->queues + object->queue_count; - struct vulkan_device *device = &object->obj; - VkQueue client_queues = device->client.device->queues + object->queue_count; + struct vulkan_queue *queues = device->queues + device->queue_count; + VkQueue client_queues = device->client.device->queues + device->queue_count; VkDeviceQueueInfo2 queue_info; UINT i; @@ -528,7 +521,7 @@ static void wine_vk_device_init_queues(struct wine_device *object, const VkDevic TRACE("Got device %p queue %p, host_queue %p.\n", device, queue, queue->host.queue); } - object->queue_count += info->queueCount; + device->queue_count += info->queueCount; } static char *cc_strdup(struct conversion_context *ctx, const char *s) @@ -924,7 +917,7 @@ VkResult wine_vkCreateDevice(VkPhysicalDevice client_physical_device, const VkDe VkDevice host_device, client_device = client_ptr; VkDeviceCreateInfo create_info_host; struct conversion_context ctx; - struct wine_device *device; + struct vulkan_device *device; unsigned int queue_count, i; VkResult res; size_t size; @@ -987,16 +980,16 @@ VkResult wine_vkCreateDevice(VkPhysicalDevice client_physical_device, const VkDe return res; } - vulkan_object_init_ptr(&device->obj.obj, (UINT_PTR)host_device, &client_device->obj); - device->obj.physical_device = physical_device; + vulkan_object_init_ptr(&device->obj, (UINT_PTR)host_device, &client_device->obj); + device->physical_device = physical_device; /* Just load all function pointers we are aware off. The loader takes care of filtering. * We use vkGetDeviceProcAddr as opposed to vkGetInstanceProcAddr for efficiency reasons * as functions pass through fewer dispatch tables within the loader. */ #define USE_VK_FUNC(name) \ - device->obj.p_##name = (void *)vk_funcs->p_vkGetDeviceProcAddr(device->obj.host.device, #name); \ - if (device->obj.p_##name == NULL) TRACE("Not found '%s'.\n", #name); + device->p_##name = (void *)vk_funcs->p_vkGetDeviceProcAddr(device->host.device, #name); \ + if (device->p_##name == NULL) TRACE("Not found '%s'.\n", #name); ALL_VK_DEVICE_FUNCS #undef USE_VK_FUNC @@ -1005,13 +998,13 @@ VkResult wine_vkCreateDevice(VkPhysicalDevice client_physical_device, const VkDe client_device->quirks = CONTAINING_RECORD(instance, struct wine_instance, obj)->quirks; - TRACE("Created device %p, host_device %p.\n", device, device->obj.host.device); + TRACE("Created device %p, host_device %p.\n", device, device->host.device); for (i = 0; i < device->queue_count; i++) { struct vulkan_queue *queue = device->queues + i; vulkan_instance_insert_object(instance, &queue->obj); } - vulkan_instance_insert_object(instance, &device->obj.obj); + vulkan_instance_insert_object(instance, &device->obj); *ret = client_device; return VK_SUCCESS; @@ -1122,8 +1115,8 @@ VkResult wine_vkCreateInstance(const VkInstanceCreateInfo *create_info, void wine_vkDestroyDevice(VkDevice client_device, const VkAllocationCallbacks *allocator) { - struct wine_device *device = wine_device_from_handle(client_device); - struct vulkan_instance *instance = device->obj.physical_device->instance; + struct vulkan_device *device = vulkan_device_from_handle(client_device); + struct vulkan_instance *instance = device->physical_device->instance; unsigned int i; if (allocator) @@ -1131,10 +1124,10 @@ void wine_vkDestroyDevice(VkDevice client_device, const VkAllocationCallbacks *a if (!device) return; - device->obj.p_vkDestroyDevice(device->obj.host.device, NULL /* pAllocator */); + device->p_vkDestroyDevice(device->host.device, NULL /* pAllocator */); for (i = 0; i < device->queue_count; i++) vulkan_instance_remove_object(instance, &device->queues[i].obj); - vulkan_instance_remove_object(instance, &device->obj.obj); + vulkan_instance_remove_object(instance, &device->obj); free(device); } @@ -1310,7 +1303,7 @@ void wine_vkFreeCommandBuffers(VkDevice client_device, VkCommandPool command_poo static VkQueue wine_vk_device_find_queue(VkDevice client_device, const VkDeviceQueueInfo2 *info) { - struct wine_device *device = wine_device_from_handle(client_device); + struct vulkan_device *device = vulkan_device_from_handle(client_device); struct vulkan_queue *queue; uint32_t i; diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index 2452dfd7dad3..e0ab34026f62 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -41,13 +41,6 @@ static inline struct wine_cmd_buffer *wine_cmd_buffer_from_handle(VkCommandBuffe return (struct wine_cmd_buffer *)(UINT_PTR)client->unix_handle; } -struct wine_device -{ - struct vulkan_device obj; - uint64_t queue_count; - struct vulkan_queue *queues; -}; - struct wine_debug_utils_messenger; struct wine_debug_report_callback diff --git a/include/wine/vulkan_driver.h b/include/wine/vulkan_driver.h index f72b2ff3b0c0..ffa87ee61878 100644 --- a/include/wine/vulkan_driver.h +++ b/include/wine/vulkan_driver.h @@ -109,6 +109,8 @@ struct vulkan_device #define USE_VK_FUNC(x) PFN_ ## x p_ ## x; ALL_VK_DEVICE_FUNCS #undef USE_VK_FUNC + uint64_t queue_count; + struct vulkan_queue *queues; }; static inline struct vulkan_device *vulkan_device_from_handle( VkDevice handle ) From 5550801f26e20a864b2c31860236f022192fe911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 6 Dec 2024 17:53:22 +0100 Subject: [PATCH 0585/2542] winevulkan: Cache the VkQueueFamilyProperties with the vulkan_device. --- dlls/winevulkan/vulkan.c | 9 ++++++++- include/wine/vulkan_driver.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 56de14e3d7f7..46e25d6f8c9c 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -918,7 +918,7 @@ VkResult wine_vkCreateDevice(VkPhysicalDevice client_physical_device, const VkDe VkDeviceCreateInfo create_info_host; struct conversion_context ctx; struct vulkan_device *device; - unsigned int queue_count, i; + unsigned int queue_count, props_count, i; VkResult res; size_t size; void *ptr; @@ -943,6 +943,9 @@ VkResult wine_vkCreateDevice(VkPhysicalDevice client_physical_device, const VkDe size = sizeof(*device); + instance->p_vkGetPhysicalDeviceQueueFamilyProperties(physical_device->host.physical_device, &props_count, NULL); + size += props_count * sizeof(*device->queue_props); + /* We need to cache all queues within the device as each requires wrapping since queues are dispatchable objects. */ for (queue_count = 0, i = 0; i < create_info->queueCreateInfoCount; i++) queue_count += create_info->pQueueCreateInfos[i].queueCount; @@ -950,6 +953,8 @@ VkResult wine_vkCreateDevice(VkPhysicalDevice client_physical_device, const VkDe if (!(device = ptr = calloc(1, size))) return VK_ERROR_OUT_OF_HOST_MEMORY; ptr = (char *)ptr + sizeof(*device); + device->queue_props = ptr; + ptr = (char *)ptr + props_count * sizeof(*device->queue_props); device->queues = ptr; ptr = (char *)ptr + queue_count * sizeof(*device->queues); @@ -993,6 +998,8 @@ VkResult wine_vkCreateDevice(VkPhysicalDevice client_physical_device, const VkDe ALL_VK_DEVICE_FUNCS #undef USE_VK_FUNC + instance->p_vkGetPhysicalDeviceQueueFamilyProperties(physical_device->host.physical_device, &props_count, device->queue_props); + for (i = 0; i < create_info_host.queueCreateInfoCount; i++) wine_vk_device_init_queues(device, create_info_host.pQueueCreateInfos + i); diff --git a/include/wine/vulkan_driver.h b/include/wine/vulkan_driver.h index ffa87ee61878..d6af57154a20 100644 --- a/include/wine/vulkan_driver.h +++ b/include/wine/vulkan_driver.h @@ -111,6 +111,7 @@ struct vulkan_device #undef USE_VK_FUNC uint64_t queue_count; struct vulkan_queue *queues; + VkQueueFamilyProperties *queue_props; }; static inline struct vulkan_device *vulkan_device_from_handle( VkDevice handle ) From 8c190fa46e799197b95dd6fb0f51f7ca448f731d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 1 Dec 2023 20:23:26 +0100 Subject: [PATCH 0586/2542] fshack: winevulkan: Support vulkan scaling according to fake resolution. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Includes work by Georg Lehmann, Zhiyi Zhang, Brendan Shanks, and Joshua Ashton. fshack: winevulkan: Fixes and improvements. Old fshack causes radv assertions because of image view format mismatches. Changes: - drop the vkCmdBlitImage path, it's impossible to keep without VK_KHR_swapchain_mutable_format. - drop the compute+copy path, all drivers support swapchains with storage usage, no reason to keep untested code around. - interpolate in linear color space for slightly better results - improve compute path by interpolating at the pixel center - fix all validation errors Signed-off-by: Georg Lehmann Link: https://github.com/ValveSoftware/wine/pull/158 fshack: winex11: Support vulkan scaling according to fake resolution. Based on work by Zhiyi Zhang, includes work by Giovanni Mascellani, Rémi Bernon, Arkadiusz Hiler, Kai Krakow, Joshua Ashton, Zebediah Figura, and Matteo Bruni. fshack: winex11: Simply scale offscreen vulkan surfaces. They will be copied manually onto the screen, so we don't need to scale them to the screen dimensions. CW-Bug-Id: 16608 fshack: winex11: Transform X11DRV_FLUSH_VK_DRAWABLE rects. CW-Bug-Id: #16608 fshack: winex11: Invalidate swapchains on fshack enable/disable. CW-Bug-Id: #21836 --- dlls/win32u/vulkan.c | 918 +++++++++++++++++++++++++++++++++- dlls/winemac.drv/vulkan.c | 6 + dlls/winevulkan/make_vulkan | 1 + dlls/winevulkan/vulkan.c | 22 + dlls/winewayland.drv/vulkan.c | 6 + dlls/winex11.drv/vulkan.c | 31 +- include/wine/vulkan_driver.h | 2 + 7 files changed, 983 insertions(+), 3 deletions(-) diff --git a/dlls/win32u/vulkan.c b/dlls/win32u/vulkan.c index 84657e4c16f3..04e397508e1f 100644 --- a/dlls/win32u/vulkan.c +++ b/dlls/win32u/vulkan.c @@ -24,6 +24,7 @@ #include "config.h" +#include #include #include @@ -62,11 +63,55 @@ static struct surface *surface_from_handle( VkSurfaceKHR handle ) return CONTAINING_RECORD( obj, struct surface, obj ); } +/* Return whether integer scaling is on */ +static BOOL fs_hack_is_integer(void) +{ + static int is_int = -1; + if (is_int < 0) + { + const char *e = getenv( "WINE_FULLSCREEN_INTEGER_SCALING" ); + is_int = e && strcmp( e, "0" ); + TRACE( "is_integer_scaling: %s\n", is_int ? "TRUE" : "FALSE" ); + } + return is_int; +} + +struct fs_hack_image +{ + uint32_t cmd_queue_idx; + VkCommandBuffer cmd; + VkImage swapchain_image; + VkImage user_image; + VkSemaphore blit_finished; + VkImageView user_view, blit_view; + VkDescriptorSet descriptor_set; +}; + +static const char *debugstr_vkextent2d( const VkExtent2D *ext ) +{ + if (!ext) return "(null)"; + return wine_dbg_sprintf( "(%d,%d)", (int)ext->width, (int)ext->height ); +} + struct swapchain { struct vulkan_swapchain obj; struct surface *surface; VkExtent2D extents; + + /* fs hack data below */ + BOOL fs_hack_enabled; + uint32_t raw_monitor_dpi; + VkExtent2D host_extents; + VkCommandPool *cmd_pools; /* VkCommandPool[device->queue_count] */ + VkDeviceMemory user_image_memory; + uint32_t n_images; + struct fs_hack_image *fs_hack_images; /* struct fs_hack_image[n_images] */ + VkSampler sampler; + VkDescriptorPool descriptor_pool; + VkDescriptorSetLayout descriptor_set_layout; + VkPipelineLayout pipeline_layout; + VkPipeline pipeline; }; static struct swapchain *swapchain_from_handle( VkSwapchainKHR handle ) @@ -330,6 +375,515 @@ static VkBool32 win32u_vkGetPhysicalDeviceWin32PresentationSupportKHR( VkPhysica return driver_funcs->p_vkGetPhysicalDeviceWin32PresentationSupportKHR( physical_device->host.physical_device, queue ); } +/* +#version 460 + +layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) uniform sampler2D texSampler; +layout(binding = 1) uniform writeonly image2D outImage; +layout(push_constant) uniform pushConstants { + //both in real image coords + vec2 offset; + vec2 extents; +} constants; + +void main() +{ + vec2 texcoord = (vec2(gl_GlobalInvocationID.xy) - constants.offset) / constants.extents; + vec4 c = texture(texSampler, texcoord); + + // Convert linear -> srgb + bvec3 isLo = lessThanEqual(c.rgb, vec3(0.0031308f)); + vec3 loPart = c.rgb * 12.92f; + vec3 hiPart = pow(c.rgb, vec3(5.0f / 12.0f)) * 1.055f - 0.055f; + c.rgb = mix(hiPart, loPart, isLo); + + imageStore(outImage, ivec2(gl_GlobalInvocationID.xy), c); +} + +*/ +const uint32_t blit_comp_spv[] = +{ + 0x07230203, 0x00010000, 0x0008000a, 0x0000005e, 0x00000000, 0x00020011, 0x00000001, 0x00020011, + 0x00000038, 0x0006000b, 0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, + 0x00000000, 0x00000001, 0x0006000f, 0x00000005, 0x00000004, 0x6e69616d, 0x00000000, 0x0000000d, + 0x00060010, 0x00000004, 0x00000011, 0x00000008, 0x00000008, 0x00000001, 0x00030003, 0x00000002, + 0x000001cc, 0x00040005, 0x00000004, 0x6e69616d, 0x00000000, 0x00050005, 0x00000009, 0x63786574, + 0x64726f6f, 0x00000000, 0x00080005, 0x0000000d, 0x475f6c67, 0x61626f6c, 0x766e496c, 0x7461636f, + 0x496e6f69, 0x00000044, 0x00060005, 0x00000012, 0x68737570, 0x736e6f43, 0x746e6174, 0x00000073, + 0x00050006, 0x00000012, 0x00000000, 0x7366666f, 0x00007465, 0x00050006, 0x00000012, 0x00000001, + 0x65747865, 0x0073746e, 0x00050005, 0x00000014, 0x736e6f63, 0x746e6174, 0x00000073, 0x00030005, + 0x00000021, 0x00000063, 0x00050005, 0x00000025, 0x53786574, 0x6c706d61, 0x00007265, 0x00040005, + 0x0000002d, 0x6f4c7369, 0x00000000, 0x00040005, 0x00000035, 0x61506f6c, 0x00007472, 0x00040005, + 0x0000003a, 0x61506968, 0x00007472, 0x00050005, 0x00000055, 0x4974756f, 0x6567616d, 0x00000000, + 0x00040047, 0x0000000d, 0x0000000b, 0x0000001c, 0x00050048, 0x00000012, 0x00000000, 0x00000023, + 0x00000000, 0x00050048, 0x00000012, 0x00000001, 0x00000023, 0x00000008, 0x00030047, 0x00000012, + 0x00000002, 0x00040047, 0x00000025, 0x00000022, 0x00000000, 0x00040047, 0x00000025, 0x00000021, + 0x00000000, 0x00040047, 0x00000055, 0x00000022, 0x00000000, 0x00040047, 0x00000055, 0x00000021, + 0x00000001, 0x00030047, 0x00000055, 0x00000019, 0x00040047, 0x0000005d, 0x0000000b, 0x00000019, + 0x00020013, 0x00000002, 0x00030021, 0x00000003, 0x00000002, 0x00030016, 0x00000006, 0x00000020, + 0x00040017, 0x00000007, 0x00000006, 0x00000002, 0x00040020, 0x00000008, 0x00000007, 0x00000007, + 0x00040015, 0x0000000a, 0x00000020, 0x00000000, 0x00040017, 0x0000000b, 0x0000000a, 0x00000003, + 0x00040020, 0x0000000c, 0x00000001, 0x0000000b, 0x0004003b, 0x0000000c, 0x0000000d, 0x00000001, + 0x00040017, 0x0000000e, 0x0000000a, 0x00000002, 0x0004001e, 0x00000012, 0x00000007, 0x00000007, + 0x00040020, 0x00000013, 0x00000009, 0x00000012, 0x0004003b, 0x00000013, 0x00000014, 0x00000009, + 0x00040015, 0x00000015, 0x00000020, 0x00000001, 0x0004002b, 0x00000015, 0x00000016, 0x00000000, + 0x00040020, 0x00000017, 0x00000009, 0x00000007, 0x0004002b, 0x00000015, 0x0000001b, 0x00000001, + 0x00040017, 0x0000001f, 0x00000006, 0x00000004, 0x00040020, 0x00000020, 0x00000007, 0x0000001f, + 0x00090019, 0x00000022, 0x00000006, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x0003001b, 0x00000023, 0x00000022, 0x00040020, 0x00000024, 0x00000000, 0x00000023, + 0x0004003b, 0x00000024, 0x00000025, 0x00000000, 0x0004002b, 0x00000006, 0x00000028, 0x00000000, + 0x00020014, 0x0000002a, 0x00040017, 0x0000002b, 0x0000002a, 0x00000003, 0x00040020, 0x0000002c, + 0x00000007, 0x0000002b, 0x00040017, 0x0000002e, 0x00000006, 0x00000003, 0x0004002b, 0x00000006, + 0x00000031, 0x3b4d2e1c, 0x0006002c, 0x0000002e, 0x00000032, 0x00000031, 0x00000031, 0x00000031, + 0x00040020, 0x00000034, 0x00000007, 0x0000002e, 0x0004002b, 0x00000006, 0x00000038, 0x414eb852, + 0x0004002b, 0x00000006, 0x0000003d, 0x3ed55555, 0x0006002c, 0x0000002e, 0x0000003e, 0x0000003d, + 0x0000003d, 0x0000003d, 0x0004002b, 0x00000006, 0x00000040, 0x3f870a3d, 0x0004002b, 0x00000006, + 0x00000042, 0x3d6147ae, 0x0004002b, 0x0000000a, 0x00000049, 0x00000000, 0x00040020, 0x0000004a, + 0x00000007, 0x00000006, 0x0004002b, 0x0000000a, 0x0000004d, 0x00000001, 0x0004002b, 0x0000000a, + 0x00000050, 0x00000002, 0x00090019, 0x00000053, 0x00000006, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000002, 0x00000000, 0x00040020, 0x00000054, 0x00000000, 0x00000053, 0x0004003b, + 0x00000054, 0x00000055, 0x00000000, 0x00040017, 0x00000059, 0x00000015, 0x00000002, 0x0004002b, + 0x0000000a, 0x0000005c, 0x00000008, 0x0006002c, 0x0000000b, 0x0000005d, 0x0000005c, 0x0000005c, + 0x0000004d, 0x00050036, 0x00000002, 0x00000004, 0x00000000, 0x00000003, 0x000200f8, 0x00000005, + 0x0004003b, 0x00000008, 0x00000009, 0x00000007, 0x0004003b, 0x00000020, 0x00000021, 0x00000007, + 0x0004003b, 0x0000002c, 0x0000002d, 0x00000007, 0x0004003b, 0x00000034, 0x00000035, 0x00000007, + 0x0004003b, 0x00000034, 0x0000003a, 0x00000007, 0x0004003d, 0x0000000b, 0x0000000f, 0x0000000d, + 0x0007004f, 0x0000000e, 0x00000010, 0x0000000f, 0x0000000f, 0x00000000, 0x00000001, 0x00040070, + 0x00000007, 0x00000011, 0x00000010, 0x00050041, 0x00000017, 0x00000018, 0x00000014, 0x00000016, + 0x0004003d, 0x00000007, 0x00000019, 0x00000018, 0x00050083, 0x00000007, 0x0000001a, 0x00000011, + 0x00000019, 0x00050041, 0x00000017, 0x0000001c, 0x00000014, 0x0000001b, 0x0004003d, 0x00000007, + 0x0000001d, 0x0000001c, 0x00050088, 0x00000007, 0x0000001e, 0x0000001a, 0x0000001d, 0x0003003e, + 0x00000009, 0x0000001e, 0x0004003d, 0x00000023, 0x00000026, 0x00000025, 0x0004003d, 0x00000007, + 0x00000027, 0x00000009, 0x00070058, 0x0000001f, 0x00000029, 0x00000026, 0x00000027, 0x00000002, + 0x00000028, 0x0003003e, 0x00000021, 0x00000029, 0x0004003d, 0x0000001f, 0x0000002f, 0x00000021, + 0x0008004f, 0x0000002e, 0x00000030, 0x0000002f, 0x0000002f, 0x00000000, 0x00000001, 0x00000002, + 0x000500bc, 0x0000002b, 0x00000033, 0x00000030, 0x00000032, 0x0003003e, 0x0000002d, 0x00000033, + 0x0004003d, 0x0000001f, 0x00000036, 0x00000021, 0x0008004f, 0x0000002e, 0x00000037, 0x00000036, + 0x00000036, 0x00000000, 0x00000001, 0x00000002, 0x0005008e, 0x0000002e, 0x00000039, 0x00000037, + 0x00000038, 0x0003003e, 0x00000035, 0x00000039, 0x0004003d, 0x0000001f, 0x0000003b, 0x00000021, + 0x0008004f, 0x0000002e, 0x0000003c, 0x0000003b, 0x0000003b, 0x00000000, 0x00000001, 0x00000002, + 0x0007000c, 0x0000002e, 0x0000003f, 0x00000001, 0x0000001a, 0x0000003c, 0x0000003e, 0x0005008e, + 0x0000002e, 0x00000041, 0x0000003f, 0x00000040, 0x00060050, 0x0000002e, 0x00000043, 0x00000042, + 0x00000042, 0x00000042, 0x00050083, 0x0000002e, 0x00000044, 0x00000041, 0x00000043, 0x0003003e, + 0x0000003a, 0x00000044, 0x0004003d, 0x0000002e, 0x00000045, 0x0000003a, 0x0004003d, 0x0000002e, + 0x00000046, 0x00000035, 0x0004003d, 0x0000002b, 0x00000047, 0x0000002d, 0x000600a9, 0x0000002e, + 0x00000048, 0x00000047, 0x00000046, 0x00000045, 0x00050041, 0x0000004a, 0x0000004b, 0x00000021, + 0x00000049, 0x00050051, 0x00000006, 0x0000004c, 0x00000048, 0x00000000, 0x0003003e, 0x0000004b, + 0x0000004c, 0x00050041, 0x0000004a, 0x0000004e, 0x00000021, 0x0000004d, 0x00050051, 0x00000006, + 0x0000004f, 0x00000048, 0x00000001, 0x0003003e, 0x0000004e, 0x0000004f, 0x00050041, 0x0000004a, + 0x00000051, 0x00000021, 0x00000050, 0x00050051, 0x00000006, 0x00000052, 0x00000048, 0x00000002, + 0x0003003e, 0x00000051, 0x00000052, 0x0004003d, 0x00000053, 0x00000056, 0x00000055, 0x0004003d, + 0x0000000b, 0x00000057, 0x0000000d, 0x0007004f, 0x0000000e, 0x00000058, 0x00000057, 0x00000057, + 0x00000000, 0x00000001, 0x0004007c, 0x00000059, 0x0000005a, 0x00000058, 0x0004003d, 0x0000001f, + 0x0000005b, 0x00000021, 0x00040063, 0x00000056, 0x0000005a, 0x0000005b, 0x000100fd, 0x00010038, +}; + +static VkResult create_pipeline( struct vulkan_device *device, struct swapchain *swapchain, VkShaderModule shaderModule ) +{ + VkComputePipelineCreateInfo pipelineInfo = {0}; + VkResult res; + + pipelineInfo.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO; + pipelineInfo.stage.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; + pipelineInfo.stage.stage = VK_SHADER_STAGE_COMPUTE_BIT; + pipelineInfo.stage.module = shaderModule; + pipelineInfo.stage.pName = "main"; + pipelineInfo.layout = swapchain->pipeline_layout; + pipelineInfo.basePipelineHandle = VK_NULL_HANDLE; + pipelineInfo.basePipelineIndex = -1; + + if ((res = device->p_vkCreateComputePipelines( device->host.device, VK_NULL_HANDLE, 1, + &pipelineInfo, NULL, &swapchain->pipeline ))) + { + ERR( "vkCreateComputePipelines: %d\n", res ); + return res; + } + + return VK_SUCCESS; +} + +static VkResult create_descriptor_set( struct vulkan_device *device, struct swapchain *swapchain, struct fs_hack_image *hack ) +{ + VkDescriptorImageInfo userDescriptorImageInfo = {0}, realDescriptorImageInfo = {0}; + VkDescriptorSetAllocateInfo descriptorAllocInfo = {0}; + VkWriteDescriptorSet descriptorWrites[2] = {{0}, {0}}; + VkResult res; + + descriptorAllocInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO; + descriptorAllocInfo.descriptorPool = swapchain->descriptor_pool; + descriptorAllocInfo.descriptorSetCount = 1; + descriptorAllocInfo.pSetLayouts = &swapchain->descriptor_set_layout; + + if ((res = device->p_vkAllocateDescriptorSets( device->host.device, &descriptorAllocInfo, &hack->descriptor_set ))) + { + ERR( "vkAllocateDescriptorSets: %d\n", res ); + return res; + } + + userDescriptorImageInfo.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; + userDescriptorImageInfo.imageView = hack->user_view; + userDescriptorImageInfo.sampler = swapchain->sampler; + + realDescriptorImageInfo.imageLayout = VK_IMAGE_LAYOUT_GENERAL; + realDescriptorImageInfo.imageView = hack->blit_view; + + descriptorWrites[0].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; + descriptorWrites[0].dstSet = hack->descriptor_set; + descriptorWrites[0].dstBinding = 0; + descriptorWrites[0].dstArrayElement = 0; + descriptorWrites[0].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + descriptorWrites[0].descriptorCount = 1; + descriptorWrites[0].pImageInfo = &userDescriptorImageInfo; + + descriptorWrites[1].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; + descriptorWrites[1].dstSet = hack->descriptor_set; + descriptorWrites[1].dstBinding = 1; + descriptorWrites[1].dstArrayElement = 0; + descriptorWrites[1].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE; + descriptorWrites[1].descriptorCount = 1; + descriptorWrites[1].pImageInfo = &realDescriptorImageInfo; + + device->p_vkUpdateDescriptorSets( device->host.device, 2, descriptorWrites, 0, NULL ); + return VK_SUCCESS; +} + +static VkResult init_blit_images( struct vulkan_device *device, struct swapchain *swapchain ) +{ + VkResult res; + VkSamplerCreateInfo samplerInfo = {0}; + VkDescriptorPoolSize poolSizes[2] = {{0}, {0}}; + VkDescriptorPoolCreateInfo poolInfo = {0}; + VkDescriptorSetLayoutBinding layoutBindings[2] = {{0}, {0}}; + VkDescriptorSetLayoutCreateInfo descriptorLayoutInfo = {0}; + VkPipelineLayoutCreateInfo pipelineLayoutInfo = {0}; + VkPushConstantRange pushConstants; + VkShaderModuleCreateInfo shaderInfo = {0}; + VkShaderModule shaderModule = 0; + VkImageViewCreateInfo viewInfo = {0}; + uint32_t i; + + samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO; + samplerInfo.magFilter = samplerInfo.minFilter = fs_hack_is_integer() ? VK_FILTER_NEAREST : VK_FILTER_LINEAR; + samplerInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; + samplerInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; + samplerInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; + samplerInfo.anisotropyEnable = VK_FALSE; + samplerInfo.maxAnisotropy = 1; + samplerInfo.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK; + samplerInfo.unnormalizedCoordinates = VK_FALSE; + samplerInfo.compareEnable = VK_FALSE; + samplerInfo.compareOp = VK_COMPARE_OP_ALWAYS; + samplerInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR; + samplerInfo.mipLodBias = 0.0f; + samplerInfo.minLod = 0.0f; + samplerInfo.maxLod = 0.0f; + + if ((res = device->p_vkCreateSampler( device->host.device, &samplerInfo, NULL, &swapchain->sampler ))) + { + WARN( "vkCreateSampler failed, res=%d\n", res ); + return res; + } + + poolSizes[0].type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + poolSizes[0].descriptorCount = swapchain->n_images; + poolSizes[1].type = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE; + poolSizes[1].descriptorCount = swapchain->n_images; + + poolInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO; + poolInfo.poolSizeCount = 2; + poolInfo.pPoolSizes = poolSizes; + poolInfo.maxSets = swapchain->n_images; + + if ((res = device->p_vkCreateDescriptorPool( device->host.device, &poolInfo, NULL, &swapchain->descriptor_pool ))) + { + ERR( "vkCreateDescriptorPool: %d\n", res ); + goto fail; + } + + layoutBindings[0].binding = 0; + layoutBindings[0].descriptorCount = 1; + layoutBindings[0].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + layoutBindings[0].pImmutableSamplers = NULL; + layoutBindings[0].stageFlags = VK_SHADER_STAGE_COMPUTE_BIT; + + layoutBindings[1].binding = 1; + layoutBindings[1].descriptorCount = 1; + layoutBindings[1].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE; + layoutBindings[1].pImmutableSamplers = NULL; + layoutBindings[1].stageFlags = VK_SHADER_STAGE_COMPUTE_BIT; + + descriptorLayoutInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO; + descriptorLayoutInfo.bindingCount = 2; + descriptorLayoutInfo.pBindings = layoutBindings; + + if ((res = device->p_vkCreateDescriptorSetLayout( device->host.device, &descriptorLayoutInfo, + NULL, &swapchain->descriptor_set_layout ))) + { + ERR( "vkCreateDescriptorSetLayout: %d\n", res ); + goto fail; + } + + pushConstants.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT; + pushConstants.offset = 0; + pushConstants.size = 4 * sizeof(float); /* 2 * vec2 */ + + pipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; + pipelineLayoutInfo.setLayoutCount = 1; + pipelineLayoutInfo.pSetLayouts = &swapchain->descriptor_set_layout; + pipelineLayoutInfo.pushConstantRangeCount = 1; + pipelineLayoutInfo.pPushConstantRanges = &pushConstants; + + if ((res = device->p_vkCreatePipelineLayout( device->host.device, &pipelineLayoutInfo, NULL, + &swapchain->pipeline_layout ))) + { + ERR( "vkCreatePipelineLayout: %d\n", res ); + goto fail; + } + + shaderInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; + shaderInfo.codeSize = sizeof(blit_comp_spv); + shaderInfo.pCode = blit_comp_spv; + + if ((res = device->p_vkCreateShaderModule( device->host.device, &shaderInfo, NULL, &shaderModule ))) + { + ERR( "vkCreateShaderModule: %d\n", res ); + goto fail; + } + + if ((res = create_pipeline( device, swapchain, shaderModule ))) goto fail; + + device->p_vkDestroyShaderModule( device->host.device, shaderModule, NULL ); + + for (i = 0; i < swapchain->n_images; ++i) + { + struct fs_hack_image *hack = &swapchain->fs_hack_images[i]; + + viewInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; + viewInfo.image = hack->swapchain_image; + viewInfo.viewType = VK_IMAGE_VIEW_TYPE_2D; + viewInfo.format = VK_FORMAT_B8G8R8A8_UNORM; + viewInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + viewInfo.subresourceRange.baseMipLevel = 0; + viewInfo.subresourceRange.levelCount = 1; + viewInfo.subresourceRange.baseArrayLayer = 0; + viewInfo.subresourceRange.layerCount = 1; + + if ((res = device->p_vkCreateImageView( device->host.device, &viewInfo, NULL, &hack->blit_view ))) + { + ERR( "vkCreateImageView(blit): %d\n", res ); + goto fail; + } + + if ((res = create_descriptor_set( device, swapchain, hack ))) goto fail; + } + + return VK_SUCCESS; + +fail: + for (i = 0; i < swapchain->n_images; ++i) + { + struct fs_hack_image *hack = &swapchain->fs_hack_images[i]; + + device->p_vkDestroyImageView( device->host.device, hack->blit_view, NULL ); + hack->blit_view = VK_NULL_HANDLE; + } + + device->p_vkDestroyShaderModule( device->host.device, shaderModule, NULL ); + + device->p_vkDestroyPipeline( device->host.device, swapchain->pipeline, NULL ); + swapchain->pipeline = VK_NULL_HANDLE; + + device->p_vkDestroyPipelineLayout( device->host.device, swapchain->pipeline_layout, NULL ); + swapchain->pipeline_layout = VK_NULL_HANDLE; + + device->p_vkDestroyDescriptorSetLayout( device->host.device, swapchain->descriptor_set_layout, NULL ); + swapchain->descriptor_set_layout = VK_NULL_HANDLE; + + device->p_vkDestroyDescriptorPool( device->host.device, swapchain->descriptor_pool, NULL ); + swapchain->descriptor_pool = VK_NULL_HANDLE; + + device->p_vkDestroySampler( device->host.device, swapchain->sampler, NULL ); + swapchain->sampler = VK_NULL_HANDLE; + + return res; +} + +static void destroy_fs_hack_image( struct vulkan_device *device, struct swapchain *swapchain, struct fs_hack_image *hack ) +{ + device->p_vkDestroyImageView( device->host.device, hack->user_view, NULL ); + device->p_vkDestroyImageView( device->host.device, hack->blit_view, NULL ); + device->p_vkDestroyImage( device->host.device, hack->user_image, NULL ); + if (hack->cmd) device->p_vkFreeCommandBuffers( device->host.device, swapchain->cmd_pools[hack->cmd_queue_idx], 1, &hack->cmd ); + device->p_vkDestroySemaphore( device->host.device, hack->blit_finished, NULL ); +} + +static VkResult init_fs_hack_images( struct vulkan_device *device, struct swapchain *swapchain, + const VkSwapchainCreateInfoKHR *createinfo ) +{ + struct vulkan_physical_device *physical_device = device->physical_device; + struct vulkan_instance *instance = physical_device->instance; + VkResult res; + VkImage *real_images = NULL; + VkDeviceSize userMemTotal = 0, offs; + VkImageCreateInfo imageInfo = {0}; + VkSemaphoreCreateInfo semaphoreInfo = {0}; + VkMemoryRequirements userMemReq; + VkMemoryAllocateInfo allocInfo = {0}; + VkPhysicalDeviceMemoryProperties memProperties; + VkImageViewCreateInfo viewInfo = {0}; + uint32_t count, i = 0, user_memory_type = -1; + + if ((res = device->p_vkGetSwapchainImagesKHR( device->host.device, swapchain->obj.host.swapchain, &count, NULL ))) + { + WARN( "vkGetSwapchainImagesKHR failed, res=%d\n", res ); + return res; + } + + real_images = malloc( count * sizeof(VkImage) ); + swapchain->cmd_pools = calloc( device->queue_count, sizeof(VkCommandPool) ); + swapchain->fs_hack_images = calloc( count, sizeof(struct fs_hack_image) ); + if (!real_images || !swapchain->cmd_pools || !swapchain->fs_hack_images) goto fail; + + if ((res = device->p_vkGetSwapchainImagesKHR( device->host.device, swapchain->obj.host.swapchain, &count, real_images ))) + { + WARN( "vkGetSwapchainImagesKHR failed, res=%d\n", res ); + goto fail; + } + + /* create user images */ + for (i = 0; i < count; ++i) + { + struct fs_hack_image *hack = &swapchain->fs_hack_images[i]; + + hack->swapchain_image = real_images[i]; + + semaphoreInfo.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; + if ((res = device->p_vkCreateSemaphore( device->host.device, &semaphoreInfo, NULL, &hack->blit_finished ))) + { + WARN( "vkCreateSemaphore failed, res=%d\n", res ); + goto fail; + } + + imageInfo.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; + imageInfo.imageType = VK_IMAGE_TYPE_2D; + imageInfo.extent.width = swapchain->extents.width; + imageInfo.extent.height = swapchain->extents.height; + imageInfo.extent.depth = 1; + imageInfo.mipLevels = 1; + imageInfo.arrayLayers = createinfo->imageArrayLayers; + imageInfo.format = createinfo->imageFormat; + imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL; + imageInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; + imageInfo.usage = createinfo->imageUsage | VK_IMAGE_USAGE_SAMPLED_BIT; + imageInfo.sharingMode = createinfo->imageSharingMode; + imageInfo.samples = VK_SAMPLE_COUNT_1_BIT; + imageInfo.queueFamilyIndexCount = createinfo->queueFamilyIndexCount; + imageInfo.pQueueFamilyIndices = createinfo->pQueueFamilyIndices; + + if (createinfo->flags & VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR) + imageInfo.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_EXTENDED_USAGE_BIT; + else if (createinfo->imageFormat != VK_FORMAT_B8G8R8A8_SRGB) + imageInfo.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT; + + if ((res = device->p_vkCreateImage( device->host.device, &imageInfo, NULL, &hack->user_image ))) + { + ERR( "vkCreateImage failed: %d\n", res ); + goto fail; + } + + device->p_vkGetImageMemoryRequirements( device->host.device, hack->user_image, &userMemReq ); + + offs = userMemTotal % userMemReq.alignment; + if (offs) userMemTotal += userMemReq.alignment - offs; + + userMemTotal += userMemReq.size; + + swapchain->n_images++; + } + + /* allocate backing memory */ + instance->p_vkGetPhysicalDeviceMemoryProperties( physical_device->host.physical_device, &memProperties ); + + for (i = 0; i < memProperties.memoryTypeCount; i++) + { + UINT flag = memProperties.memoryTypes[i].propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; + if (flag == VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) + { + if (userMemReq.memoryTypeBits & (1 << i)) + { + user_memory_type = i; + break; + } + } + } + + if (user_memory_type == -1) + { + ERR( "unable to find suitable memory type\n" ); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto fail; + } + + allocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; + allocInfo.allocationSize = userMemTotal; + allocInfo.memoryTypeIndex = user_memory_type; + + if ((res = device->p_vkAllocateMemory( device->host.device, &allocInfo, NULL, &swapchain->user_image_memory ))) + { + ERR( "vkAllocateMemory: %d\n", res ); + goto fail; + } + + /* bind backing memory and create imageviews */ + userMemTotal = 0; + for (i = 0; i < count; ++i) + { + device->p_vkGetImageMemoryRequirements( device->host.device, swapchain->fs_hack_images[i].user_image, &userMemReq ); + + offs = userMemTotal % userMemReq.alignment; + if (offs) userMemTotal += userMemReq.alignment - offs; + + if ((res = device->p_vkBindImageMemory( device->host.device, swapchain->fs_hack_images[i].user_image, + swapchain->user_image_memory, userMemTotal ))) + { + ERR( "vkBindImageMemory: %d\n", res ); + goto fail; + } + + userMemTotal += userMemReq.size; + + viewInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; + viewInfo.image = swapchain->fs_hack_images[i].user_image; + viewInfo.viewType = VK_IMAGE_VIEW_TYPE_2D; + viewInfo.format = VK_FORMAT_B8G8R8A8_SRGB; + viewInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + viewInfo.subresourceRange.baseMipLevel = 0; + viewInfo.subresourceRange.levelCount = 1; + viewInfo.subresourceRange.baseArrayLayer = 0; + viewInfo.subresourceRange.layerCount = 1; + + if ((res = device->p_vkCreateImageView( device->host.device, &viewInfo, NULL, + &swapchain->fs_hack_images[i].user_view ))) + { + ERR( "vkCreateImageView(user): %d\n", res ); + goto fail; + } + } + + free( real_images ); + + return VK_SUCCESS; + +fail: + for (i = 0; i < swapchain->n_images; ++i) destroy_fs_hack_image( device, swapchain, &swapchain->fs_hack_images[i] ); + free( real_images ); + free( swapchain->cmd_pools ); + free( swapchain->fs_hack_images ); + return res; +} + static VkResult win32u_vkCreateSwapchainKHR( VkDevice client_device, const VkSwapchainCreateInfoKHR *create_info, const VkAllocationCallbacks *allocator, VkSwapchainKHR *ret ) { @@ -364,6 +918,33 @@ static VkResult win32u_vkCreateSwapchainKHR( VkDevice client_device, const VkSwa if (!(swapchain = calloc( 1, sizeof(*swapchain) ))) return VK_ERROR_OUT_OF_HOST_MEMORY; + if (driver_funcs->p_vulkan_surface_enable_fshack( surface->hwnd, surface->driver_private )) + { + VkSurfaceCapabilitiesKHR caps = {0}; + + if ((res = instance->p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR( physical_device->host.physical_device, + create_info_host.surface, &caps ))) + { + TRACE( "vkGetPhysicalDeviceSurfaceCapabilities failed, res=%d\n", res ); + free( swapchain ); + return res; + } + + if (!(caps.supportedUsageFlags & VK_IMAGE_USAGE_STORAGE_BIT)) + FIXME( "Swapchain does not support required VK_IMAGE_USAGE_STORAGE_BIT\n" ); + + swapchain->host_extents = capabilities.minImageExtent; + create_info_host.imageExtent = capabilities.minImageExtent; + create_info_host.imageFormat = VK_FORMAT_B8G8R8A8_UNORM; + create_info_host.imageUsage = VK_IMAGE_USAGE_STORAGE_BIT; + + if (create_info->imageFormat != VK_FORMAT_B8G8R8A8_UNORM && create_info->imageFormat != VK_FORMAT_B8G8R8A8_SRGB) + FIXME( "swapchain image format is not BGRA8 UNORM/SRGB. Things may go badly. %d\n", + create_info_host.imageFormat ); + + swapchain->fs_hack_enabled = TRUE; + } + if ((res = device->p_vkCreateSwapchainKHR( device->host.device, &create_info_host, NULL, &host_swapchain ))) { free( swapchain ); @@ -373,6 +954,30 @@ static VkResult win32u_vkCreateSwapchainKHR( VkDevice client_device, const VkSwa vulkan_object_init( &swapchain->obj.obj, host_swapchain ); swapchain->surface = surface; swapchain->extents = create_info->imageExtent; + + if (swapchain->fs_hack_enabled) + { + if ((res = init_fs_hack_images( device, swapchain, create_info ))) + { + ERR( "creating fs hack images failed: %d\n", res ); + device->p_vkDestroySwapchainKHR( device->host.device, swapchain->obj.host.swapchain, NULL ); + free( swapchain ); + return res; + } + + if ((res = init_blit_images( device, swapchain ))) + { + ERR( "creating blit images failed: %d\n", res ); + device->p_vkDestroySwapchainKHR( device->host.device, swapchain->obj.host.swapchain, NULL ); + free( swapchain ); + return res; + } + + swapchain->raw_monitor_dpi = NtUserGetWinMonitorDpi( surface->hwnd, MDT_RAW_DPI ); + WARN( "Enabled fullscreen hack on swapchain %p, scalind from %s -> %s\n", swapchain, + debugstr_vkextent2d(&swapchain->extents), debugstr_vkextent2d(&swapchain->host_extents) ); + } + instance->p_insert_object( instance, &swapchain->obj.obj ); *ret = swapchain->obj.client.swapchain; @@ -385,10 +990,30 @@ void win32u_vkDestroySwapchainKHR( VkDevice client_device, VkSwapchainKHR client struct vulkan_device *device = vulkan_device_from_handle( client_device ); struct vulkan_instance *instance = device->physical_device->instance; struct swapchain *swapchain = swapchain_from_handle( client_swapchain ); + int i; if (allocator) FIXME( "Support for allocation callbacks not implemented yet\n" ); if (!swapchain) return; + if (swapchain->fs_hack_enabled) + { + for (i = 0; i < swapchain->n_images; ++i) destroy_fs_hack_image( device, swapchain, &swapchain->fs_hack_images[i] ); + for (i = 0; i < device->queue_count; ++i) + { + if (!swapchain->cmd_pools[i]) continue; + device->p_vkDestroyCommandPool( device->host.device, swapchain->cmd_pools[i], NULL ); + } + + device->p_vkDestroyPipeline( device->host.device, swapchain->pipeline, NULL ); + device->p_vkDestroyPipelineLayout( device->host.device, swapchain->pipeline_layout, NULL ); + device->p_vkDestroyDescriptorSetLayout( device->host.device, swapchain->descriptor_set_layout, NULL ); + device->p_vkDestroyDescriptorPool( device->host.device, swapchain->descriptor_pool, NULL ); + device->p_vkDestroySampler( device->host.device, swapchain->sampler, NULL ); + device->p_vkFreeMemory( device->host.device, swapchain->user_image_memory, NULL ); + free( swapchain->cmd_pools ); + free( swapchain->fs_hack_images ); + } + device->p_vkDestroySwapchainKHR( device->host.device, swapchain->obj.host.swapchain, NULL ); instance->p_remove_object( instance, &swapchain->obj.obj ); @@ -414,6 +1039,13 @@ static VkResult win32u_vkAcquireNextImage2KHR( VkDevice client_device, const VkA res = device->p_vkAcquireNextImage2KHR( device->host.device, &acquire_info_host, image_index ); + if (!res && (driver_funcs->p_vulkan_surface_enable_fshack( surface->hwnd, surface->driver_private ) != swapchain->fs_hack_enabled + || (swapchain->fs_hack_enabled && swapchain->raw_monitor_dpi != NtUserGetWinMonitorDpi( surface->hwnd, MDT_RAW_DPI )))) + { + WARN( "window %p swapchain %p needs fullscreen hack VK_SUBOPTIMAL_KHR\n", surface->hwnd, swapchain ); + return VK_SUBOPTIMAL_KHR; + } + if (!res && NtUserGetClientRect( surface->hwnd, &client_rect, NtUserGetDpiForWindow( surface->hwnd ) ) && !extents_equals( &swapchain->extents, &client_rect )) { @@ -437,6 +1069,13 @@ static VkResult win32u_vkAcquireNextImageKHR( VkDevice client_device, VkSwapchai res = device->p_vkAcquireNextImageKHR( device->host.device, swapchain->obj.host.swapchain, timeout, semaphore, fence, image_index ); + if (!res && (driver_funcs->p_vulkan_surface_enable_fshack( surface->hwnd, surface->driver_private ) != swapchain->fs_hack_enabled + || (swapchain->fs_hack_enabled && swapchain->raw_monitor_dpi != NtUserGetWinMonitorDpi( surface->hwnd, MDT_RAW_DPI )))) + { + WARN( "window %p swapchain %p needs fullscreen hack VK_SUBOPTIMAL_KHR\n", surface->hwnd, swapchain ); + return VK_SUBOPTIMAL_KHR; + } + if (!res && NtUserGetClientRect( surface->hwnd, &client_rect, NtUserGetDpiForWindow( surface->hwnd ) ) && !extents_equals( &swapchain->extents, &client_rect )) { @@ -448,14 +1087,185 @@ static VkResult win32u_vkAcquireNextImageKHR( VkDevice client_device, VkSwapchai return res; } +static VkResult win32u_vkGetSwapchainImagesKHR( VkDevice client_device, VkSwapchainKHR client_swapchain, + uint32_t *count, VkImage *images ) +{ + struct vulkan_device *device = vulkan_device_from_handle( client_device ); + struct swapchain *swapchain = swapchain_from_handle( client_swapchain ); + uint32_t i; + + if (images && swapchain->fs_hack_enabled) + { + if (*count > swapchain->n_images) *count = swapchain->n_images; + for (i = 0; i < *count; ++i) images[i] = swapchain->fs_hack_images[i].user_image; + return *count == swapchain->n_images ? VK_SUCCESS : VK_INCOMPLETE; + } + + return device->p_vkGetSwapchainImagesKHR( device->host.device, swapchain->obj.host.swapchain, count, images ); +} + +static VkCommandBuffer create_hack_cmd( struct vulkan_queue *queue, struct swapchain *swapchain, uint32_t queue_idx ) +{ + VkCommandBufferAllocateInfo allocInfo = {0}; + VkCommandBuffer cmd; + VkResult res; + + if (!swapchain->cmd_pools[queue_idx]) + { + VkCommandPoolCreateInfo poolInfo = {0}; + + poolInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO; + poolInfo.queueFamilyIndex = queue_idx; + + if ((res = queue->device->p_vkCreateCommandPool( queue->device->host.device, &poolInfo, NULL, + &swapchain->cmd_pools[queue_idx] ))) + { + ERR( "vkCreateCommandPool failed, res=%d\n", res ); + return NULL; + } + } + + allocInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO; + allocInfo.commandPool = swapchain->cmd_pools[queue_idx]; + allocInfo.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY; + allocInfo.commandBufferCount = 1; + + if ((res = queue->device->p_vkAllocateCommandBuffers( queue->device->host.device, &allocInfo, &cmd ))) + { + ERR( "vkAllocateCommandBuffers failed, res=%d\n", res ); + return NULL; + } + + return cmd; +} + +static VkResult record_compute_cmd( struct vulkan_device *device, struct swapchain *swapchain, struct fs_hack_image *hack ) +{ + VkResult res; + VkImageMemoryBarrier barriers[3] = {{0}}; + VkCommandBufferBeginInfo beginInfo = {0}; + float constants[4]; + + TRACE( "recording compute command\n" ); + + beginInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; + beginInfo.flags = VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT; + + device->p_vkBeginCommandBuffer( hack->cmd, &beginInfo ); + + /* for the cs we run... */ + /* transition user image from PRESENT_SRC to SHADER_READ */ + barriers[0].sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; + barriers[0].oldLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; + barriers[0].newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; + barriers[0].srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barriers[0].dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barriers[0].image = hack->user_image; + barriers[0].subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + barriers[0].subresourceRange.baseMipLevel = 0; + barriers[0].subresourceRange.levelCount = 1; + barriers[0].subresourceRange.baseArrayLayer = 0; + barriers[0].subresourceRange.layerCount = 1; + barriers[0].srcAccessMask = 0; + barriers[0].dstAccessMask = VK_ACCESS_SHADER_READ_BIT; + + /* storage image... */ + /* transition swapchain image from whatever to GENERAL */ + barriers[1].sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; + barriers[1].oldLayout = VK_IMAGE_LAYOUT_UNDEFINED; + barriers[1].newLayout = VK_IMAGE_LAYOUT_GENERAL; + barriers[1].srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barriers[1].dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barriers[1].image = hack->swapchain_image; + barriers[1].subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + barriers[1].subresourceRange.baseMipLevel = 0; + barriers[1].subresourceRange.levelCount = 1; + barriers[1].subresourceRange.baseArrayLayer = 0; + barriers[1].subresourceRange.layerCount = 1; + barriers[1].srcAccessMask = 0; + barriers[1].dstAccessMask = VK_ACCESS_SHADER_WRITE_BIT; + + device->p_vkCmdPipelineBarrier( hack->cmd, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, + 0, 0, NULL, 0, NULL, 2, barriers ); + + /* perform blit shader */ + device->p_vkCmdBindPipeline( hack->cmd, VK_PIPELINE_BIND_POINT_COMPUTE, swapchain->pipeline ); + + device->p_vkCmdBindDescriptorSets( hack->cmd, VK_PIPELINE_BIND_POINT_COMPUTE, + swapchain->pipeline_layout, 0, 1, &hack->descriptor_set, 0, NULL ); + + /* vec2: blit dst offset in real coords */ + constants[0] = 0; + constants[1] = 0; + + /* offset by 0.5f because sampling is relative to pixel center */ + constants[0] -= 0.5f * swapchain->host_extents.width / swapchain->extents.width; + constants[1] -= 0.5f * swapchain->host_extents.height / swapchain->extents.height; + + /* vec2: blit dst extents in real coords */ + constants[2] = swapchain->host_extents.width; + constants[3] = swapchain->host_extents.height; + device->p_vkCmdPushConstants( hack->cmd, swapchain->pipeline_layout, + VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(constants), constants ); + + /* local sizes in shader are 8 */ + device->p_vkCmdDispatch( hack->cmd, ceil( swapchain->host_extents.width / 8. ), + ceil( swapchain->host_extents.height / 8. ), 1 ); + + /* transition user image from SHADER_READ back to PRESENT_SRC */ + barriers[0].sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; + barriers[0].oldLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; + barriers[0].newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; + barriers[0].srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barriers[0].dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barriers[0].image = hack->user_image; + barriers[0].subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + barriers[0].subresourceRange.baseMipLevel = 0; + barriers[0].subresourceRange.levelCount = 1; + barriers[0].subresourceRange.baseArrayLayer = 0; + barriers[0].subresourceRange.layerCount = 1; + barriers[0].srcAccessMask = VK_ACCESS_SHADER_READ_BIT; + barriers[0].dstAccessMask = 0; + + /* transition swapchain image from GENERAL to PRESENT_SRC */ + barriers[1].sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; + barriers[1].oldLayout = VK_IMAGE_LAYOUT_GENERAL; + barriers[1].newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; + barriers[1].srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barriers[1].dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barriers[1].image = hack->swapchain_image; + barriers[1].subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + barriers[1].subresourceRange.baseMipLevel = 0; + barriers[1].subresourceRange.levelCount = 1; + barriers[1].subresourceRange.baseArrayLayer = 0; + barriers[1].subresourceRange.layerCount = 1; + barriers[1].srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT; + barriers[1].dstAccessMask = 0; + + device->p_vkCmdPipelineBarrier( hack->cmd, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, + 0, 0, NULL, 0, NULL, 2, barriers ); + + if ((res = device->p_vkEndCommandBuffer( hack->cmd ))) + { + ERR( "vkEndCommandBuffer: %d\n", res ); + return res; + } + + return VK_SUCCESS; +} + static VkResult win32u_vkQueuePresentKHR( VkQueue client_queue, const VkPresentInfoKHR *present_info ) { struct vulkan_queue *queue = vulkan_queue_from_handle( client_queue ); VkSwapchainKHR swapchains_buffer[16], *swapchains = swapchains_buffer; VkPresentInfoKHR present_info_host = *present_info; struct vulkan_device *device = queue->device; + VkCommandBuffer *blit_cmds = NULL; + VkSubmitInfo submitInfo = {0}; + VkSemaphore blit_sema; + UINT i, n_hacks = 0; + uint32_t queue_idx; VkResult res; - UINT i; TRACE( "queue %p, present_info %p\n", queue, present_info ); @@ -471,6 +1281,98 @@ static VkResult win32u_vkQueuePresentKHR( VkQueue client_queue, const VkPresentI present_info_host.pSwapchains = swapchains; + for (i = 0; i < present_info_host.swapchainCount; ++i) + { + struct swapchain *swapchain = swapchain_from_handle( present_info->pSwapchains[i] ); + + if (swapchain->fs_hack_enabled) + { + struct fs_hack_image *hack = &swapchain->fs_hack_images[present_info->pImageIndices[i]]; + + if (!blit_cmds) + { + queue_idx = queue->family_index; + blit_cmds = malloc( present_info->swapchainCount * sizeof(VkCommandBuffer) ); + blit_sema = hack->blit_finished; + } + + if (!hack->cmd || hack->cmd_queue_idx != queue_idx) + { + if (hack->cmd) device->p_vkFreeCommandBuffers( queue->device->host.device, swapchain->cmd_pools[hack->cmd_queue_idx], + 1, &hack->cmd ); + + hack->cmd_queue_idx = queue_idx; + hack->cmd = create_hack_cmd( queue, swapchain, queue_idx ); + + if (!hack->cmd) + { + free( blit_cmds ); + return VK_ERROR_DEVICE_LOST; + } + + if (queue->device->queue_props[queue_idx].queueFlags & VK_QUEUE_COMPUTE_BIT) /* TODO */ + res = record_compute_cmd( queue->device, swapchain, hack ); + else + { + ERR( "Present queue does not support compute!\n" ); + res = VK_ERROR_DEVICE_LOST; + } + + if (res != VK_SUCCESS) + { + device->p_vkFreeCommandBuffers( queue->device->host.device, swapchain->cmd_pools[hack->cmd_queue_idx], + 1, &hack->cmd ); + hack->cmd = NULL; + free( blit_cmds ); + return res; + } + } + + blit_cmds[n_hacks] = hack->cmd; + + ++n_hacks; + } + } + + if (n_hacks > 0) + { + VkPipelineStageFlags waitStage, *waitStages, *waitStages_arr = NULL; + + if (present_info->waitSemaphoreCount > 1) + { + waitStages_arr = malloc( sizeof(VkPipelineStageFlags) * present_info->waitSemaphoreCount ); + for (i = 0; i < present_info->waitSemaphoreCount; ++i) + waitStages_arr[i] = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + waitStages = waitStages_arr; + } + else + { + waitStage = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + waitStages = &waitStage; + } + + /* blit user image to real image */ + submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; + submitInfo.waitSemaphoreCount = present_info_host.waitSemaphoreCount; + submitInfo.pWaitSemaphores = present_info_host.pWaitSemaphores; + submitInfo.pWaitDstStageMask = waitStages; + submitInfo.commandBufferCount = n_hacks; + submitInfo.pCommandBuffers = blit_cmds; + submitInfo.signalSemaphoreCount = 1; + submitInfo.pSignalSemaphores = &blit_sema; + + if ((res = device->p_vkQueueSubmit( queue->host.queue, 1, &submitInfo, VK_NULL_HANDLE ))) + { + ERR( "vkQueueSubmit: %d\n", res ); + } + + free( waitStages_arr ); + free( blit_cmds ); + + present_info_host.waitSemaphoreCount = 1; + present_info_host.pWaitSemaphores = &blit_sema; + } + res = device->p_vkQueuePresentKHR( queue->host.queue, &present_info_host ); for (i = 0; i < present_info->swapchainCount; i++) @@ -545,6 +1447,7 @@ static struct vulkan_funcs vulkan_funcs = .p_vkDestroySwapchainKHR = win32u_vkDestroySwapchainKHR, .p_vkAcquireNextImage2KHR = win32u_vkAcquireNextImage2KHR, .p_vkAcquireNextImageKHR = win32u_vkAcquireNextImageKHR, + .p_vkGetSwapchainImagesKHR = win32u_vkGetSwapchainImagesKHR, .p_vkQueuePresentKHR = win32u_vkQueuePresentKHR, .p_get_host_surface_extension = win32u_get_host_surface_extension, }; @@ -571,6 +1474,11 @@ static void nulldrv_vulkan_surface_presented( HWND hwnd, void *private, VkResult { } +static BOOL nulldrv_vulkan_surface_enable_fshack( HWND hwnd, void *private ) +{ + return FALSE; +} + static VkBool32 nulldrv_vkGetPhysicalDeviceWin32PresentationSupportKHR( VkPhysicalDevice device, uint32_t queue ) { return VK_TRUE; @@ -588,6 +1496,7 @@ static const struct vulkan_driver_funcs nulldrv_funcs = .p_vulkan_surface_detach = nulldrv_vulkan_surface_detach, .p_vulkan_surface_update = nulldrv_vulkan_surface_update, .p_vulkan_surface_presented = nulldrv_vulkan_surface_presented, + .p_vulkan_surface_enable_fshack = nulldrv_vulkan_surface_enable_fshack, .p_vkGetPhysicalDeviceWin32PresentationSupportKHR = nulldrv_vkGetPhysicalDeviceWin32PresentationSupportKHR, .p_get_host_surface_extension = nulldrv_get_host_surface_extension, }; @@ -643,6 +1552,12 @@ static void lazydrv_vulkan_surface_presented( HWND hwnd, void *private, VkResult driver_funcs->p_vulkan_surface_presented( hwnd, private, result ); } +static BOOL lazydrv_vulkan_surface_enable_fshack( HWND hwnd, void *private ) +{ + vulkan_driver_load(); + return driver_funcs->p_vulkan_surface_enable_fshack( hwnd, private ); +} + static VkBool32 lazydrv_vkGetPhysicalDeviceWin32PresentationSupportKHR( VkPhysicalDevice device, uint32_t queue ) { vulkan_driver_load(); @@ -662,6 +1577,7 @@ static const struct vulkan_driver_funcs lazydrv_funcs = .p_vulkan_surface_detach = lazydrv_vulkan_surface_detach, .p_vulkan_surface_update = lazydrv_vulkan_surface_update, .p_vulkan_surface_presented = lazydrv_vulkan_surface_presented, + .p_vulkan_surface_enable_fshack = lazydrv_vulkan_surface_enable_fshack, .p_vkGetPhysicalDeviceWin32PresentationSupportKHR = lazydrv_vkGetPhysicalDeviceWin32PresentationSupportKHR, .p_get_host_surface_extension = lazydrv_get_host_surface_extension, }; diff --git a/dlls/winemac.drv/vulkan.c b/dlls/winemac.drv/vulkan.c index 8b375b6a53c8..063666407cd6 100644 --- a/dlls/winemac.drv/vulkan.c +++ b/dlls/winemac.drv/vulkan.c @@ -187,6 +187,11 @@ static void macdrv_vulkan_surface_presented(HWND hwnd, void *private, VkResult r { } +static BOOL macdrv_vulkan_surface_enable_fshack(HWND hwnd, void *private) +{ + return FALSE; +} + static VkBool32 macdrv_vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice phys_dev, uint32_t index) { @@ -207,6 +212,7 @@ static const struct vulkan_driver_funcs macdrv_vulkan_driver_funcs = .p_vulkan_surface_detach = macdrv_vulkan_surface_detach, .p_vulkan_surface_update = macdrv_vulkan_surface_update, .p_vulkan_surface_presented = macdrv_vulkan_surface_presented, + .p_vulkan_surface_enable_fshack = macdrv_vulkan_surface_enable_fshack, .p_vkGetPhysicalDeviceWin32PresentationSupportKHR = macdrv_vkGetPhysicalDeviceWin32PresentationSupportKHR, .p_get_host_surface_extension = macdrv_get_host_surface_extension, diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index b1080d0c9515..bcca990959fc 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -208,6 +208,7 @@ USER_DRIVER_FUNCS = { "vkGetPhysicalDeviceSurfaceFormats2KHR", "vkGetPhysicalDeviceSurfaceFormatsKHR", "vkGetPhysicalDeviceWin32PresentationSupportKHR", + "vkGetSwapchainImagesKHR", "vkQueuePresentKHR", } diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 46e25d6f8c9c..12a37a10b608 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -969,6 +969,28 @@ VkResult wine_vkCreateDevice(VkPhysicalDevice client_physical_device, const VkDe res = wine_vk_device_convert_create_info(client_physical_device, &ctx, create_info, &create_info_host); if (res == VK_SUCCESS) { + VkPhysicalDeviceFeatures features = {0}; + VkPhysicalDeviceFeatures2 *features2; + + /* Enable shaderStorageImageWriteWithoutFormat for fshack + * This is available on all hardware and driver combinations we care about. + */ + if (create_info_host.pEnabledFeatures) + { + features = *create_info_host.pEnabledFeatures; + features.shaderStorageImageWriteWithoutFormat = VK_TRUE; + create_info_host.pEnabledFeatures = &features; + } + if ((features2 = find_next_struct(&create_info_host, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2))) + { + features2->features.shaderStorageImageWriteWithoutFormat = VK_TRUE; + } + else if (!create_info_host.pEnabledFeatures) + { + features.shaderStorageImageWriteWithoutFormat = VK_TRUE; + create_info_host.pEnabledFeatures = &features; + } + if (native_create_device) res = native_create_device(physical_device->host.physical_device, &create_info_host, NULL /* allocator */, &host_device, diff --git a/dlls/winewayland.drv/vulkan.c b/dlls/winewayland.drv/vulkan.c index 3ac23676f0df..0e1c33707d18 100644 --- a/dlls/winewayland.drv/vulkan.c +++ b/dlls/winewayland.drv/vulkan.c @@ -125,6 +125,11 @@ static void wayland_vulkan_surface_presented(HWND hwnd, void *private, VkResult ensure_window_surface_contents(toplevel); } +static BOOL wayland_vulkan_surface_enable_fshack(HWND hwnd, void *private) +{ + return FALSE; +} + static VkBool32 wayland_vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice phys_dev, uint32_t index) { @@ -146,6 +151,7 @@ static const struct vulkan_driver_funcs wayland_vulkan_driver_funcs = .p_vulkan_surface_detach = wayland_vulkan_surface_detach, .p_vulkan_surface_update = wayland_vulkan_surface_update, .p_vulkan_surface_presented = wayland_vulkan_surface_presented, + .p_vulkan_surface_enable_fshack = wayland_vulkan_surface_enable_fshack, .p_vkGetPhysicalDeviceWin32PresentationSupportKHR = wayland_vkGetPhysicalDeviceWin32PresentationSupportKHR, .p_get_host_surface_extension = wayland_get_host_surface_extension, diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index b44e6f76c0bc..57dd7f9c645c 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -80,6 +80,25 @@ static void vulkan_surface_destroy( HWND hwnd, struct x11drv_vulkan_surface *sur free( surface ); } +static RECT get_client_rect( HWND hwnd, BOOL raw ) +{ + struct x11drv_win_data *data; + RECT rect; + + if (!raw) + NtUserGetClientRect( hwnd, &rect, NtUserGetDpiForWindow( hwnd ) ); + else if (!(data = get_win_data( hwnd ))) + NtUserGetClientRect( hwnd, &rect, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); + else + { + rect = data->rects.client; + OffsetRect( &rect, -rect.left, -rect.top ); + release_win_data( data ); + } + + return rect; +} + static VkResult X11DRV_vulkan_surface_create( HWND hwnd, VkInstance instance, VkSurfaceKHR *handle, void **private ) { VkXlibSurfaceCreateInfoKHR info = @@ -88,6 +107,7 @@ static VkResult X11DRV_vulkan_surface_create( HWND hwnd, VkInstance instance, Vk .dpy = gdi_display, }; struct x11drv_vulkan_surface *surface; + BOOL enable_fshack = enable_fullscreen_hack( hwnd, FALSE ); TRACE( "%p %p %p %p\n", hwnd, instance, handle, private ); @@ -96,7 +116,7 @@ static VkResult X11DRV_vulkan_surface_create( HWND hwnd, VkInstance instance, Vk ERR("Failed to allocate vulkan surface for hwnd=%p\n", hwnd); return VK_ERROR_OUT_OF_HOST_MEMORY; } - NtUserGetClientRect( hwnd, &surface->rect, NtUserGetDpiForWindow( hwnd ) ); + surface->rect = get_client_rect( hwnd, enable_fshack ); if (!(surface->window = create_client_window( hwnd, surface->rect, &default_visual, default_colormap ))) { @@ -145,10 +165,11 @@ static void X11DRV_vulkan_surface_detach( HWND hwnd, void *private ) static void vulkan_surface_update_size( HWND hwnd, struct x11drv_vulkan_surface *surface ) { + BOOL enable_fshack = enable_fullscreen_hack( hwnd, FALSE ); XWindowChanges changes; RECT rect; - NtUserGetClientRect( hwnd, &rect, NtUserGetDpiForWindow( hwnd ) ); + rect = get_client_rect( hwnd, enable_fshack ); if (EqualRect( &surface->rect, &rect )) return; changes.width = min( max( 1, rect.right ), 65535 ); @@ -250,6 +271,11 @@ static void X11DRV_vulkan_surface_presented( HWND hwnd, void *private, VkResult if (hdc) NtUserReleaseDC( hwnd, hdc ); } +static BOOL X11DRV_vulkan_surface_enable_fshack( HWND hwnd, void *private ) +{ + return enable_fullscreen_hack( hwnd, FALSE ); +} + static VkBool32 X11DRV_vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice phys_dev, uint32_t index) { @@ -271,6 +297,7 @@ static const struct vulkan_driver_funcs x11drv_vulkan_driver_funcs = .p_vulkan_surface_detach = X11DRV_vulkan_surface_detach, .p_vulkan_surface_update = X11DRV_vulkan_surface_update, .p_vulkan_surface_presented = X11DRV_vulkan_surface_presented, + .p_vulkan_surface_enable_fshack = X11DRV_vulkan_surface_enable_fshack, .p_vkGetPhysicalDeviceWin32PresentationSupportKHR = X11DRV_vkGetPhysicalDeviceWin32PresentationSupportKHR, .p_get_host_surface_extension = X11DRV_get_host_surface_extension, diff --git a/include/wine/vulkan_driver.h b/include/wine/vulkan_driver.h index d6af57154a20..919e02ecaa91 100644 --- a/include/wine/vulkan_driver.h +++ b/include/wine/vulkan_driver.h @@ -176,6 +176,7 @@ struct vulkan_funcs PFN_vkGetPhysicalDeviceSurfaceFormats2KHR p_vkGetPhysicalDeviceSurfaceFormats2KHR; PFN_vkGetPhysicalDeviceSurfaceFormatsKHR p_vkGetPhysicalDeviceSurfaceFormatsKHR; PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR p_vkGetPhysicalDeviceWin32PresentationSupportKHR; + PFN_vkGetSwapchainImagesKHR p_vkGetSwapchainImagesKHR; PFN_vkQueuePresentKHR p_vkQueuePresentKHR; /* winevulkan specific functions */ @@ -190,6 +191,7 @@ struct vulkan_driver_funcs void (*p_vulkan_surface_detach)(HWND, void *); void (*p_vulkan_surface_update)(HWND, void *); void (*p_vulkan_surface_presented)(HWND, void *, VkResult); + BOOL (*p_vulkan_surface_enable_fshack)(HWND, void *); VkBool32 (*p_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice, uint32_t); const char *(*p_get_host_surface_extension)(void); From 7e025e243550a0637245db7b6309a185054d31b3 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 3 Mar 2021 21:58:44 +0300 Subject: [PATCH 0587/2542] bcrypt/tests: Add test for DH secret agreement. --- dlls/bcrypt/tests/bcrypt.c | 358 +++++++++++++++++++++++++++++++++++++ 1 file changed, 358 insertions(+) diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c index 772d4ecdc5d2..87a81e2b193a 100644 --- a/dlls/bcrypt/tests/bcrypt.c +++ b/dlls/bcrypt/tests/bcrypt.c @@ -4329,6 +4329,362 @@ static void test_RC4(void) ok(status == STATUS_SUCCESS, "got %#lx\n", status); } +static void test_dh_SecretAgreement(void) +{ + static BCryptBuffer hash_param_buffers[] = + { + { + sizeof(BCRYPT_SHA256_ALGORITHM), + KDF_HASH_ALGORITHM, + (void *)BCRYPT_SHA256_ALGORITHM, + } + }; + + static BCryptBufferDesc hash_params = + { + BCRYPTBUFFER_VERSION, + ARRAY_SIZE(hash_param_buffers), + hash_param_buffers, + }; + + static const ULONG private_key_data[] = + { + 0xc4caf69c, 0x57b4db27, 0x36f7135f, 0x5ccba686, 0xc37b8819, 0x1d35c9b2, 0xbb07a1cf, 0x0c5d1c1b, + 0xc79acb10, 0x31dfdabb, 0x702e02b9, 0x1efab345, 0x262a8074, 0x5edf7698, 0x9b9dc630, 0x13c34b93, + 0xacbc928b, 0xb79eed8c, 0x7413dce9, 0xa5521280, 0x88d8e695, 0xa310269f, 0xca7c5719, 0xcd0c775b, + 0x9a6e2cf2, 0x9e235c51, 0xf49db62d, 0x28e72424, 0x4a44da5a, 0x3d98268d, 0x8e4d2be3, 0x254e44e6, + + 0x18a67e55, 0x572e13a1, 0x46f81ca8, 0xc331c9b9, 0xf8fe3dd4, 0x8a889e5a, 0x6c0505fd, 0xbd97a121, + 0xed2dbd67, 0xf39efa8e, 0x36f9c287, 0xf6bbfa6c, 0x461e42ad, 0x17dc170e, 0xc002dc2e, 0x4813d9a4, + 0x0b6fabb8, 0x6a9e1860, 0xa8a8cbd9, 0xb7ed6b5d, 0xabb34d23, 0xf2fbe1fd, 0x8670df1e, 0xba7fa4e6, + 0xf7039712, 0x94448f30, 0xe10c812e, 0x3e311976, 0xcfdd72c4, 0xbdbea98f, 0xc9a540d6, 0x89646d57, + + 0x7ab63b33, 0x03a1e9b6, 0x947f7a9b, 0x5ae59eeb, 0x1d12eb05, 0x3f425d92, 0xe028c6ba, 0xbf90ddc9, + 0xb554f55a, 0x7aeb88b6, 0x4a443a5f, 0xbab35111, 0x82c78a0c, 0x298dd482, 0x02937cb1, 0xc94cdc2e, + 0x59b010eb, 0x3bbc0a2b, 0xd845fee0, 0x04c1d0db, 0x0c8c9424, 0x1cafd4b2, 0x9aa7aed9, 0x6a478486, + 0xa8841fd7, 0xbfeff40a, 0x8fd7bcc5, 0x3bb28977, 0x2b9a7955, 0xa55cd2e4, 0x1b6ad657, 0x067cdf21, + + 0x06f36920, 0x63280e1b, 0xf17d930f, 0xa06e74a8, 0x463b3a6f, 0x2a464507, 0x93f8a982, 0x8f620a7d, + 0xeda32d11, 0x9706a6d4, 0x33dce588, 0x75a1c446, 0x048ab567, 0xd735aafa, 0x806f7c1c, 0xdcb9651a, + 0x26acf3b4, 0x45f91cc9, 0x2a0de6fc, 0xf3c03d0c, 0xf5aee0aa, 0x3eeaaf36, 0x18ccee61, 0x83faa783, + 0x4b2b5250, 0xf4ccea22, 0x5ac0714b, 0x3f0b2bc6, 0x481b13ce, 0x12040ea7, 0x66e0bbed, 0x158e1a67, + }; + static const ULONG raw_shared_secret[] = + { + 0x375d89b5, 0x35a9c270, 0xfbc5ba82, 0x09eb3069, 0xd50965b0, 0xace510f7, 0x981e8731, 0x80a76115, + 0xf386d348, 0xca17b8df, 0x0b0e84ec, 0xf81f756e, 0x5030fa20, 0x03113b71, 0x97b7e879, 0x899b5fae, + 0xe6913299, 0x09270076, 0x39bc813a, 0xde3ef070, 0x65ad5b3a, 0x2b7c4ba4, 0x86c98ef9, 0x3236feaf, + 0x3e0253f7, 0x0489d2dd, 0x97669a3d, 0x50242fca, 0x5d4aecb1, 0xcf2d805f, 0x2258afff, 0x750e92cd, + }; + static const ULONG sha1_shared_secret[] = + { + 0x0babba9c, 0x0bdeacbd, 0x04e36574, 0xdd504dcd, 0x0cd88db0, + }; + static const ULONG sha256_shared_secret[] = + { + 0x3213db5b, 0x8cc8250b, 0xc829eaab, 0x00933709, 0x68160aa9, 0xfb9f1e20, 0xf92368e6, 0x2b8e18eb, + }; + + BCRYPT_DH_PARAMETER_HEADER *dh_header; + BCRYPT_SECRET_HANDLE secret, secret2; + BCRYPT_DH_KEY_BLOB *dh_key_blob; + static const ULONG length = 1024; + BCRYPT_KEY_HANDLE key, key2; + BCRYPT_ALG_HANDLE alg; + UCHAR buffer[2048]; + NTSTATUS status; + unsigned int i; + ULONG size; + + status = BCryptOpenAlgorithmProvider(&alg, BCRYPT_DH_ALGORITHM, NULL, 0); + ok(!status, "got %08lx\n", status); + if (status) + return; + + key = NULL; + + status = BCryptGenerateKeyPair(alg, &key, 256, 0); + ok(status == STATUS_INVALID_PARAMETER, "got %08lx\n", status); + + status = BCryptGenerateKeyPair(alg, &key, length, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(key != NULL, "key not set\n"); + + memset(buffer, 0xcc, sizeof(buffer)); + status = BCryptGetProperty(key, BCRYPT_DH_PARAMETERS, buffer, sizeof(buffer), &size, 0); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + status = BCryptExportKey(key, NULL, BCRYPT_DH_PUBLIC_BLOB, buffer, sizeof(buffer), &size, 0); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + status = BCryptFinalizeKeyPair(key, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + size = 0xdeadbeef; + status = BCryptGetProperty(key, BCRYPT_DH_PARAMETERS, NULL, sizeof(buffer), &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == sizeof(BCRYPT_DH_PARAMETER_HEADER) + length / 8 * 2, "Got unexpected size %lu.\n", size); + + size = 0xdeadbeef; + status = BCryptGetProperty(key, BCRYPT_DH_PARAMETERS, buffer, 28, &size, 0); + ok(status == STATUS_BUFFER_TOO_SMALL, "got %08lx\n", status); + ok(size == sizeof(BCRYPT_DH_PARAMETER_HEADER) + length / 8 * 2, "Got unexpected size %lu.\n", size); + + size = 0xdeadbeef; + status = BCryptGetProperty(key, BCRYPT_DH_PARAMETERS, buffer, sizeof(buffer), &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == sizeof(BCRYPT_DH_PARAMETER_HEADER) + length / 8 * 2, "Got unexpected size %lu.\n", size); + + dh_header = (BCRYPT_DH_PARAMETER_HEADER *)buffer; + ok(dh_header->cbLength == sizeof(*dh_header) + length / 8 * 2, "Got unexpected length %lu.\n", dh_header->cbLength); + ok(dh_header->cbKeyLength == length / 8, "Got unexpected length %lu.\n", dh_header->cbKeyLength); + ok(dh_header->dwMagic == BCRYPT_DH_PARAMETERS_MAGIC, "Got unexpected magic %#lx.\n", dh_header->dwMagic); + + status = BCryptDestroyKey(key); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + dh_key_blob = (BCRYPT_DH_KEY_BLOB *)buffer; + dh_key_blob->dwMagic = BCRYPT_DH_PRIVATE_MAGIC; + dh_key_blob->cbKey = length / 8; + memcpy(dh_key_blob + 1, private_key_data, sizeof(private_key_data)); + size = sizeof(buffer); + status = BCryptImportKeyPair(alg, NULL, BCRYPT_DH_PRIVATE_BLOB, &key, buffer, size, 0); + ok(status == STATUS_INVALID_PARAMETER, "got %08lx\n", status); + size = sizeof(*dh_key_blob) + length / 8 * 4; + status = BCryptImportKeyPair(alg, NULL, BCRYPT_DH_PRIVATE_BLOB, &key, buffer, size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + memset(buffer, 0xcc, sizeof(buffer)); + size = 0xdeadbeef; + status = BCryptExportKey(key, NULL, BCRYPT_DH_PUBLIC_BLOB, NULL, 0, &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == sizeof(BCRYPT_DH_KEY_BLOB) + length / 8 * 3, "Got unexpected size %lu.\n", size); + + size = 0xdeadbeef; + status = BCryptExportKey(key, NULL, BCRYPT_DH_PUBLIC_BLOB, buffer, sizeof(buffer), &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == sizeof(BCRYPT_DH_KEY_BLOB) + length / 8 * 3, "Got unexpected size %lu.\n", size); + dh_key_blob = (BCRYPT_DH_KEY_BLOB *)buffer; + ok(dh_key_blob->dwMagic == BCRYPT_DH_PUBLIC_MAGIC, "Got unexpected magic %#lx.\n", dh_key_blob->dwMagic); + ok(dh_key_blob->cbKey == length / 8, "Got unexpected length %lu.\n", dh_key_blob->cbKey); + ok(!memcmp(dh_key_blob + 1, private_key_data, length / 8 * 3), "Key data does not match.\n"); + + status = BCryptGenerateKeyPair(alg, &key2, length, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + dh_header = (BCRYPT_DH_PARAMETER_HEADER *)buffer; + dh_header->dwMagic = BCRYPT_DH_PARAMETERS_MAGIC; + dh_header->cbLength = sizeof(*dh_header) + length / 8 * 2; + dh_header->cbKeyLength = length / 8; + memcpy(dh_header + 1, private_key_data, length / 8 * 2); + status = BCryptSetProperty(key2, BCRYPT_DH_PARAMETERS, buffer, dh_header->cbLength, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + status = BCryptFinalizeKeyPair(key2, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + status = BCryptExportKey(key2, NULL, BCRYPT_DH_PUBLIC_BLOB, buffer, sizeof(buffer), &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == sizeof(BCRYPT_DH_KEY_BLOB) + length / 8 * 3, "Got unexpected size %lu.\n", size); + ok(dh_key_blob->dwMagic == BCRYPT_DH_PUBLIC_MAGIC, "Got unexpected dwMagic %#lx.\n", dh_key_blob->dwMagic); + ok(dh_key_blob->cbKey == length / 8, "Got unexpected length %lu.\n", dh_key_blob->cbKey); + ok(!memcmp(dh_key_blob + 1, private_key_data, length / 8 * 2), "DH parameters do not match.\n"); + ok(memcmp((BYTE *)(dh_key_blob + 1) + length / 8 * 2, (BYTE *)private_key_data + length / 8 * 2, length / 8), + "Random public key data matches.\n"); + + memset(buffer, 0xcc, sizeof(buffer)); + status = BCryptExportKey(key, NULL, BCRYPT_DH_PRIVATE_BLOB, buffer, sizeof(buffer), &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + dh_key_blob = (BCRYPT_DH_KEY_BLOB *)buffer; + ok(size == sizeof(BCRYPT_DH_KEY_BLOB) + length / 8 * 4, "Got unexpected size %lu.\n", size); + ok(dh_key_blob->dwMagic == BCRYPT_DH_PRIVATE_MAGIC, "Got unexpected dwMagic %#lx.\n", dh_key_blob->dwMagic); + ok(dh_key_blob->cbKey == length / 8, "Got unexpected length %lu.\n", dh_key_blob->cbKey); + ok(!memcmp(dh_key_blob + 1, private_key_data, length / 8 * 4), "Private key data does not match.\n"); + + status = BCryptSecretAgreement(NULL, key, &secret, 0); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + status = BCryptSecretAgreement(key, NULL, &secret, 0); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + status = BCryptSecretAgreement(key, key, NULL, 0); + ok(status == STATUS_INVALID_PARAMETER, "got %08lx\n", status); + + status = BCryptSecretAgreement(key, key, &secret, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + status = BCryptDeriveKey(NULL, L"HASH", NULL, NULL, 0, &size, 0); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + status = BCryptDeriveKey(key, L"HASH", NULL, NULL, 0, &size, 0); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + status = BCryptDeriveKey(secret, NULL, NULL, NULL, 0, &size, 0); + ok(status == STATUS_INVALID_PARAMETER, "got %08lx\n", status); + + size = 0xdeadbeef; + status = BCryptDeriveKey(secret, L"HASH", NULL, NULL, 0, &size, 0); + ok(size == 20, "Got unexpected size %lu.\n", size); + + size = 0xdeadbeef; + status = BCryptDeriveKey(secret, BCRYPT_KDF_RAW_SECRET, NULL, NULL, 0, &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == length / 8, "Got unexpected size %lu.\n", size); + + status = BCryptDeriveKey(secret, BCRYPT_KDF_RAW_SECRET, NULL, buffer, 128, &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == length / 8, "Got unexpected size %lu.\n", size); + ok(!memcmp(buffer, raw_shared_secret, size), "Raw shared secret data does not match.\n"); + + size = sizeof(buffer); + memset(buffer, 0xcc, sizeof(buffer)); + status = BCryptDeriveKey(secret, BCRYPT_KDF_HASH, NULL, buffer, 128, &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == 20, "Got unexpected size %lu.\n", size); + ok(!memcmp(buffer, sha1_shared_secret, sizeof(sha1_shared_secret)), "sha1 shared secret data does not match.\n"); + + size = sizeof(buffer); + status = BCryptDeriveKey(secret, BCRYPT_KDF_HASH, &hash_params, buffer, size, &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == 32, "Got unexpected size %lu.\n", size); + ok(!memcmp(buffer, sha256_shared_secret, sizeof(sha256_shared_secret)), "sha1 shared secret data does not match.\n"); + + for (i = size; i < sizeof(buffer); ++i) + if (buffer[i] != 0xcc) + break; + ok(i == sizeof(buffer), "Buffer modified at %i, value %#x.\n", i, buffer[i]); + + status = BCryptDestroySecret(secret); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + status = BCryptSecretAgreement(key, key2, &secret, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + status = BCryptSecretAgreement(key2, key, &secret2, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + status = BCryptDeriveKey(secret, BCRYPT_KDF_RAW_SECRET, NULL, buffer, 128, &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + status = BCryptDeriveKey(secret, BCRYPT_KDF_RAW_SECRET, NULL, buffer + size, 128, &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(!memcmp(buffer, buffer + size, size), "Shared secrets do not match.\n"); + + status = BCryptDestroyHash(secret); + ok(status == STATUS_INVALID_PARAMETER, "got %08lx\n", status); + + status = BCryptDestroyKey(secret); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + status = BCryptDestroySecret(NULL); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + status = BCryptDestroySecret(alg); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + + status = BCryptDestroySecret(secret); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + status = BCryptDestroyKey(key); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + status = BCryptDestroyKey(key2); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + status = BCryptCloseAlgorithmProvider(alg, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); +} + +static void test_dh_SecretAgreement_values(void) +{ + static const ULONG private_key_data[] = + { + 0xffffffff, 0xffffffff, 0xa2da0fc9, 0x34c26821, 0x8b62c6c4, 0xd11cdc80, 0x084e0229, 0x74cc678a, + 0xa6be0b02, 0x229b133b, 0x79084a51, 0xdd04348e, 0xb31995ef, 0x1b433acd, 0x6d0a2b30, 0x37145ff2, + 0x6d35e14f, 0x45c2516d, 0x76b585e4, 0xc67e5e62, 0xe9424cf4, 0x6bed37a6, 0xb65cff0b, 0xedb706f4, + 0xfb6b38ee, 0xa59f895a, 0x11249fae, 0xe61f4b7c, 0x51662849, 0x8153e6ec, 0xffffffff, 0xffffffff, + + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000, + + 0xa0c3c734, 0xc130c92d, 0x5265abf8, 0xff409f17, 0xbcdce187, 0xff64dae3, 0x170560aa, 0xb2423ed8, + 0x9ee5a8b9, 0x92548030, 0x02bba1f9, 0x823e39a4, 0x69c438f5, 0xf91016ac, 0x89bfd166, 0x7f996446, + 0x86224203, 0x15bf689c, 0x619354a4, 0x0c1d3a1f, 0x11bcf3d2, 0x58aae029, 0x41c69824, 0x3fafc179, + 0xa742747c, 0x60658c7a, 0xd3b0bde4, 0x78d3f08b, 0x6cefa061, 0x33752536, 0xe84d4901, 0x48cd73f4, + + 0x8d449700, 0x1f95120e, 0xceb31745, 0x3663177b, 0xbd9bb2d5, 0x9c23c0d9, 0x814d34f8, 0xbc54edb0, + 0xb874659a, 0x3bac8a30, 0xa1f3dd46, 0x1705c900, 0xbc46fefe, 0x7d13875b, 0x3064351a, 0x4bd89a1c, + 0x9e938761, 0x931949db, 0x34490719, 0x84fb08ca, 0xa9dd355a, 0x5b3f5061, 0x2ac96663, 0xc594429e, + 0xbe58395d, 0x2f7d872a, 0x303d37b3, 0xa3a9b606, 0x735a6732, 0xa095bd95, 0x3d55a7c3, 0x00e54635, + }; + static const ULONG peer_key_data[] = + { + 0xffffffff, 0xffffffff, 0xa2da0fc9, 0x34c26821, 0x8b62c6c4, 0xd11cdc80, 0x084e0229, 0x74cc678a, + 0xa6be0b02, 0x229b133b, 0x79084a51, 0xdd04348e, 0xb31995ef, 0x1b433acd, 0x6d0a2b30, 0x37145ff2, + 0x6d35e14f, 0x45c2516d, 0x76b585e4, 0xc67e5e62, 0xe9424cf4, 0x6bed37a6, 0xb65cff0b, 0xedb706f4, + 0xfb6b38ee, 0xa59f895a, 0x11249fae, 0xe61f4b7c, 0x51662849, 0x8153e6ec, 0xffffffff, 0xffffffff, + + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000, + + 0x3bf7404b, 0x6284fffe, 0x97c0d565, 0xd830c658, 0xcc21bf39, 0xcae45bb6, 0x019df7df, 0xbf4cd293, + 0x6bf1989d, 0x78a81f52, 0xa4ed861c, 0x6bacf493, 0xa3e700d1, 0xd06cc206, 0x411b9727, 0x01e9c9ab, + 0x9b7e6efa, 0xf46bb25d, 0xd1027242, 0x6130787c, 0xa7b87d8b, 0xfee41492, 0x50db6213, 0x321199b6, + 0x7dace53a, 0xe8b1ec51, 0x2181b113, 0x3b33e3c0, 0x5b3a2d67, 0xbd34f0c1, 0x7037c542, 0x4a8d5540, + }; + static const ULONG raw_shared_secret[] = + { + 0x0815f37d, 0x19ee74ab, 0x9f63f123, 0xe1b3f10c, 0xbcc9be83, 0xaddf5b9d, 0x28174e72, 0xf8a33825, + 0xfc74e47d, 0x2c950888, 0xf5b776d9, 0xfc712fef, 0x5b213b32, 0x489a9829, 0xfc0a4d1d, 0x6e641d3b, + 0x3bb2ff57, 0x63500318, 0x081ee54f, 0xf33a2805, 0xb3759e98, 0xa9a64afe, 0x964b8897, 0x04691bbc, + 0x80f4aae1, 0x617405ee, 0xab71724d, 0x6c10c214, 0x6f60b96f, 0xdc777b0b, 0x22f40d4f, 0x8a1c4eb5, + }; + + BCRYPT_DH_KEY_BLOB *dh_key_blob; + static const ULONG length = 1024; + BCRYPT_KEY_HANDLE key, key2; + BCRYPT_SECRET_HANDLE secret; + BCRYPT_ALG_HANDLE alg; + UCHAR buffer[2048]; + NTSTATUS status; + ULONG size; + + status = BCryptOpenAlgorithmProvider(&alg, BCRYPT_DH_ALGORITHM, NULL, 0); + ok(!status, "got %08lx\n", status); + + dh_key_blob = (BCRYPT_DH_KEY_BLOB *)buffer; + dh_key_blob->dwMagic = BCRYPT_DH_PRIVATE_MAGIC; + dh_key_blob->cbKey = length / 8; + memcpy(dh_key_blob + 1, private_key_data, sizeof(private_key_data)); + + size = sizeof(*dh_key_blob) + length / 8 * 4; + status = BCryptImportKeyPair(alg, NULL, BCRYPT_DH_PRIVATE_BLOB, &key, buffer, size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + dh_key_blob = (BCRYPT_DH_KEY_BLOB *)buffer; + dh_key_blob->dwMagic = BCRYPT_DH_PUBLIC_MAGIC; + dh_key_blob->cbKey = length / 8; + memcpy(dh_key_blob + 1, peer_key_data, sizeof(peer_key_data)); + + size = sizeof(*dh_key_blob) + length / 8 * 3; + status = BCryptImportKeyPair(alg, NULL, BCRYPT_DH_PUBLIC_BLOB, &key2, buffer, size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + status = BCryptSecretAgreement(key, key2, &secret, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + + status = BCryptDeriveKey(secret, BCRYPT_KDF_RAW_SECRET, NULL, buffer, 128, &size, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + ok(size == length / 8, "Got unexpected size %lu.\n", size); + ok(!memcmp(buffer, raw_shared_secret, size), "Raw shared secret data does not match.\n"); + + status = BCryptDestroySecret(secret); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + status = BCryptDestroyKey(key); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); + status = BCryptDestroyKey(key2); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); +} + START_TEST(bcrypt) { HMODULE module; @@ -4367,6 +4723,8 @@ START_TEST(bcrypt) test_SecretAgreement(); test_rsa_encrypt(); test_RC4(); + test_dh_SecretAgreement(); + test_dh_SecretAgreement_values(); FreeLibrary(module); } From ed07fba3f10c93974b65757bc18bb6606360a9db Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 7 Dec 2020 12:59:55 +0300 Subject: [PATCH 0588/2542] bcrypt: Reimplement DH using libgmp instead of private gnutls functions. --- configure.ac | 8 + dlls/bcrypt/Makefile.in | 2 +- dlls/bcrypt/bcrypt_internal.h | 1 + dlls/bcrypt/bcrypt_main.c | 3 + dlls/bcrypt/gnutls.c | 822 +++++++++++++++++++++------------- dlls/bcrypt/tests/bcrypt.c | 29 +- 6 files changed, 537 insertions(+), 328 deletions(-) diff --git a/configure.ac b/configure.ac index 92b978613218..497d0d671c59 100644 --- a/configure.ac +++ b/configure.ac @@ -1492,6 +1492,14 @@ WINE_PACKAGE_FLAGS(DRMAMDGPU,[libdrm_amdgpu],,,, [AC_CHECK_HEADERS([amdgpu_drm.h], [WINE_CHECK_SONAME(drm_amdgpu,amdgpu_query_info,,,[$DRMAMDGPU_LIBS])])]) +dnl **** Check for libgmp **** +if test "x$with_gnutls" != "xno" +then + WINE_PACKAGE_FLAGS(GMP,[gmp],[-lgmp],,, + [AC_CHECK_HEADERS([gmp.h], + [WINE_CHECK_SONAME(gmp,__gmpz_init,,[GMP_CFLAGS=""],[$GMP_LIBS],[[libgmp-*]])])]) +fi + dnl **** Check for SANE **** if test "x$with_sane" != "xno" then diff --git a/dlls/bcrypt/Makefile.in b/dlls/bcrypt/Makefile.in index 542837b2a7ae..782bd31b996c 100644 --- a/dlls/bcrypt/Makefile.in +++ b/dlls/bcrypt/Makefile.in @@ -2,7 +2,7 @@ MODULE = bcrypt.dll IMPORTS = advapi32 IMPORTLIB = bcrypt UNIXLIB = bcrypt.so -UNIX_CFLAGS = $(GNUTLS_CFLAGS) +UNIX_CFLAGS = $(GNUTLS_CFLAGS) $(GMP_CFLAGS) SOURCES = \ bcrypt_main.c \ diff --git a/dlls/bcrypt/bcrypt_internal.h b/dlls/bcrypt/bcrypt_internal.h index 81cab56e2f50..152ed2bd4013 100644 --- a/dlls/bcrypt/bcrypt_internal.h +++ b/dlls/bcrypt/bcrypt_internal.h @@ -176,6 +176,7 @@ struct key_symmetric #define KEY_FLAG_LEGACY_DSA_V2 0x00000001 #define KEY_FLAG_FINALIZED 0x00000002 +#define KEY_FLAG_DH_PARAMS_SET 0x00000004 struct key_asymmetric { diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c index 3d88430a07e7..b2f7685d0828 100644 --- a/dlls/bcrypt/bcrypt_main.c +++ b/dlls/bcrypt/bcrypt_main.c @@ -2527,6 +2527,9 @@ NTSTATUS WINAPI BCryptSecretAgreement( BCRYPT_KEY_HANDLE privkey_handle, BCRYPT_ if (!privkey || !pubkey) return STATUS_INVALID_HANDLE; if (!is_agreement_key( privkey ) || !is_agreement_key( pubkey )) return STATUS_NOT_SUPPORTED; if (!ret_handle) return STATUS_INVALID_PARAMETER; + if (privkey->alg_id != pubkey->alg_id) return STATUS_INVALID_PARAMETER; + if (privkey->alg_id == ALG_ID_DH && !(privkey->u.a.flags & pubkey->u.a.flags & KEY_FLAG_FINALIZED)) return STATUS_INVALID_PARAMETER; + if (privkey->u.a.bitlen != pubkey->u.a.bitlen) return STATUS_INVALID_PARAMETER; if (!(secret = calloc( 1, sizeof(*secret) ))) return STATUS_NO_MEMORY; secret->hdr.magic = MAGIC_SECRET; diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c index 582b868a36e1..ec0d5f5b54b0 100644 --- a/dlls/bcrypt/gnutls.c +++ b/dlls/bcrypt/gnutls.c @@ -48,6 +48,15 @@ #include "wine/debug.h" +#include + +#ifdef HAVE_GMP_H +#include +#endif + +#include +#include + WINE_DEFAULT_DEBUG_CHANNEL(bcrypt); WINE_DECLARE_DEBUG_CHANNEL(winediag); @@ -92,6 +101,11 @@ union key_data gnutls_pubkey_t pubkey; gnutls_dh_params_t dh_params; } a; + struct /* DH */ + { + UCHAR *privkey; + UCHAR *pubkey; + } d; }; C_ASSERT( sizeof(union key_data) <= sizeof(((struct key *)0)->private) ); @@ -100,6 +114,33 @@ static union key_data *key_data( struct key *key ) return (union key_data *)key->private; } +static unsigned int dh_pubkey_len( struct key *key ) +{ + return sizeof(BCRYPT_DH_KEY_BLOB) + key->u.a.bitlen / 8 * 3; +} + +static void dh_key_free( struct key *key ) +{ + free( key_data(key)->d.privkey ); + key_data(key)->d.privkey = NULL; + free( key_data(key)->d.pubkey ); + key_data(key)->d.pubkey = NULL; +} + +static void dh_key_alloc_pub( struct key *key ) +{ + if (key_data(key)->d.pubkey) return; + key_data(key)->d.pubkey = calloc( 1, dh_pubkey_len( key )); +} + +static void dh_key_alloc_priv( struct key *key ) +{ + unsigned int bitlen = key->u.a.bitlen; + + if (key_data(key)->d.privkey) return; + key_data(key)->d.privkey = calloc( 1, bitlen / 8 ); +} + /* Not present in gnutls version < 3.0 */ static int (*pgnutls_cipher_tag)(gnutls_cipher_hd_t, void *, size_t); static int (*pgnutls_cipher_add_auth)(gnutls_cipher_hd_t, const void *, size_t); @@ -166,6 +207,13 @@ static int (*pgnutls_pubkey_import_dh_raw)(gnutls_pubkey_t, const gnutls_dh_para static int (*pgnutls_x509_spki_set_rsa_oaep_params)(gnutls_x509_spki_t, gnutls_digest_algorithm_t, gnutls_datum_t *); static void *libgnutls_handle; + +static int (*pgnutls_dh_params_generate2)(gnutls_dh_params_t dparams, unsigned int bits); +static int (*pgnutls_dh_params_import_raw2)(gnutls_dh_params_t dh_params, const gnutls_datum_t * prime, + const gnutls_datum_t * generator, unsigned key_bits); +static int (*pgnutls_dh_params_export_raw)(gnutls_dh_params_t params, gnutls_datum_t * prime, + gnutls_datum_t * generator, unsigned int *bits); + #define MAKE_FUNCPTR(f) static typeof(f) * p##f MAKE_FUNCPTR(gnutls_cipher_decrypt2); MAKE_FUNCPTR(gnutls_cipher_deinit); @@ -189,6 +237,22 @@ MAKE_FUNCPTR(gnutls_pubkey_deinit); MAKE_FUNCPTR(gnutls_pubkey_encrypt_data); MAKE_FUNCPTR(gnutls_pubkey_import_privkey); MAKE_FUNCPTR(gnutls_pubkey_init); + +#if defined(HAVE_GMP_H) && defined(SONAME_LIBGMP) +static BOOL dh_supported; +static void *libgmp_handle; + +MAKE_FUNCPTR(mpz_init); +MAKE_FUNCPTR(mpz_clear); +MAKE_FUNCPTR(mpz_cmp); +MAKE_FUNCPTR(_mpz_cmp_ui); +MAKE_FUNCPTR(mpz_sizeinbase); +MAKE_FUNCPTR(mpz_import); +MAKE_FUNCPTR(mpz_export); +MAKE_FUNCPTR(mpz_mod); +MAKE_FUNCPTR(mpz_powm); +MAKE_FUNCPTR(mpz_sub_ui); +#endif #undef MAKE_FUNCPTR static int compat_gnutls_cipher_tag(gnutls_cipher_hd_t handle, void *tag, size_t tag_size) @@ -418,6 +482,37 @@ static NTSTATUS gnutls_process_attach( void *args ) LOAD_FUNCPTR(gnutls_pubkey_init); #undef LOAD_FUNCPTR +#if defined(HAVE_GMP_H) && defined(SONAME_LIBGMP) +#define LOAD_FUNCPTR_STR(f) #f +#define LOAD_FUNCPTR(f) \ + if (!(p##f = dlsym( libgmp_handle, LOAD_FUNCPTR_STR(f) ))) \ + { \ + ERR( "failed to load %s\n", LOAD_FUNCPTR_STR(f) ); \ + goto fail; \ + } + + if ((libgmp_handle = dlopen( SONAME_LIBGMP, RTLD_NOW ))) + { + LOAD_FUNCPTR(mpz_init); + LOAD_FUNCPTR(mpz_clear); + LOAD_FUNCPTR(mpz_cmp); + LOAD_FUNCPTR(_mpz_cmp_ui); + LOAD_FUNCPTR(mpz_sizeinbase); + LOAD_FUNCPTR(mpz_import); + LOAD_FUNCPTR(mpz_export); + LOAD_FUNCPTR(mpz_mod); + LOAD_FUNCPTR(mpz_powm); + LOAD_FUNCPTR(mpz_sub_ui); + } + else + { + ERR_(winediag)( "failed to load libgmp, no support for DH\n" ); + goto fail; + } +#undef LOAD_FUNCPTR +#undef LOAD_FUNCPTR_STR +#endif + #define LOAD_FUNCPTR_OPT(f) \ if (!(p##f = dlsym( libgnutls_handle, #f ))) \ { \ @@ -463,6 +558,33 @@ static NTSTATUS gnutls_process_attach( void *args ) pgnutls_perror( ret ); goto fail; } + if (!(pgnutls_dh_params_init = dlsym( libgnutls_handle, "gnutls_dh_params_init" ))) + { + WARN("gnutls_dh_params_init not found\n"); + } + if (!(pgnutls_dh_params_deinit = dlsym( libgnutls_handle, "gnutls_dh_params_deinit" ))) + { + WARN("gnutls_dh_params_deinit not found\n"); + } + if (!(pgnutls_dh_params_generate2 = dlsym( libgnutls_handle, "gnutls_dh_params_generate2" ))) + { + WARN("gnutls_dh_params_generate2 not found\n"); + } + if (!(pgnutls_dh_params_import_raw2 = dlsym( libgnutls_handle, "gnutls_dh_params_import_raw2" ))) + { + WARN("gnutls_dh_params_import_raw2 not found\n"); + } + if (!(pgnutls_dh_params_export_raw = dlsym( libgnutls_handle, "gnutls_dh_params_export_raw" ))) + { + WARN("gnutls_dh_params_export_raw not found\n"); + } + +#if defined(HAVE_GMP_H) && defined(SONAME_LIBGMP) + dh_supported = pgnutls_dh_params_init && pgnutls_dh_params_generate2 && pgnutls_dh_params_import_raw2 + && libgmp_handle; +#else + ERR_(winediag)("Compiled without DH support.\n"); +#endif if (TRACE_ON( bcrypt )) { @@ -477,6 +599,14 @@ static NTSTATUS gnutls_process_attach( void *args ) fail: dlclose( libgnutls_handle ); libgnutls_handle = NULL; + +#if defined(HAVE_GMP_H) && defined(SONAME_LIBGMP) + if (libgmp_handle) + { + dlclose( libgmp_handle ); + libgmp_handle = NULL; + } +#endif return STATUS_DLL_NOT_FOUND; } @@ -489,6 +619,11 @@ static NTSTATUS gnutls_process_detach( void *args ) libgnutls_handle = NULL; } return STATUS_SUCCESS; + +#if defined(HAVE_GMP_H) && defined(SONAME_LIBGMP) + dlclose( libgmp_handle ); + libgmp_handle = NULL; +#endif } struct buffer @@ -1090,6 +1225,183 @@ static gnutls_dh_params_t get_dh_params( gnutls_privkey_t privkey ) return params; } +#if defined(HAVE_GMP_H) && defined(SONAME_LIBGMP) +static NTSTATUS CDECL gen_random(void *buffer, unsigned int length) +{ + unsigned int read_size; + int dev_random; + + dev_random = open("/dev/urandom", O_RDONLY); + if (dev_random == -1) + { + FIXME("couldn't open /dev/urandom.\n"); + return STATUS_INTERNAL_ERROR; + } + + read_size = read(dev_random, buffer, length); + close(dev_random); + if (read_size != length) + { + FIXME("Could not read from /dev/urandom."); + return STATUS_INTERNAL_ERROR; + } + return STATUS_SUCCESS; +} + +static void import_mpz(mpz_t value, const void *input, unsigned int length) +{ + pmpz_import(value, length, 1, 1, 0, 0, input); +} + +static void export_mpz(void *output, unsigned int length, const mpz_t value) +{ + size_t export_length; + unsigned int offset; + + export_length = (pmpz_sizeinbase(value, 2) + 7) / 8; + assert(export_length <= length); + offset = length - export_length; + memset(output, 0, offset); + pmpz_export((BYTE *)output + offset, &export_length, 1, 1, 0, 0, value); + if (!export_length) + { + ERR("Zero export length, value bits %u.\n", (unsigned)pmpz_sizeinbase(value, 2)); + memset((BYTE *)output + offset, 0, length - offset); + } + else + { + assert(export_length + offset == length); + } +} + +static NTSTATUS CDECL key_dh_generate( struct key *key ) +{ + NTSTATUS status = STATUS_SUCCESS; + mpz_t p, psub1, g, privkey, pubkey; + ULONG key_length; + unsigned int i; + int ret; + + if (!dh_supported) + { + ERR("DH is not available.\n"); + return STATUS_NOT_IMPLEMENTED; + } + + if (key->u.a.flags & KEY_FLAG_FINALIZED) + { + WARN( "Key is already finalized.\n" ); + return STATUS_INVALID_HANDLE; + } + + key_length = key->u.a.bitlen / 8; + + if (!(key->u.a.flags & KEY_FLAG_DH_PARAMS_SET)) + { + gnutls_datum_t prime, generator; + gnutls_dh_params_t dh_params; + + if ((ret = pgnutls_dh_params_init( &dh_params ))) + { + pgnutls_perror( ret ); + return STATUS_INTERNAL_ERROR; + } + dh_key_alloc_pub( key ); + + if ((ret = pgnutls_dh_params_generate2( dh_params, key->u.a.bitlen ))) + { + pgnutls_perror( ret ); + pgnutls_dh_params_deinit( dh_params ); + return STATUS_INTERNAL_ERROR; + } + if ((ret = pgnutls_dh_params_export_raw( dh_params, &prime, &generator, NULL ))) + { + pgnutls_perror( ret ); + pgnutls_dh_params_deinit( dh_params ); + return STATUS_INTERNAL_ERROR; + } + pgnutls_dh_params_deinit( dh_params ); + + + export_gnutls_datum( (UCHAR *)((BCRYPT_DH_KEY_BLOB *)key_data(key)->d.pubkey + 1), key_length, &prime, 1 ); + export_gnutls_datum( (UCHAR *)((BCRYPT_DH_KEY_BLOB *)key_data(key)->d.pubkey + 1) + key_length, + key_length, &generator, 1 ); + free( prime.data ); + free( generator.data ); + + key->u.a.flags |= KEY_FLAG_DH_PARAMS_SET; + } + dh_key_alloc_priv( key ); + + pmpz_init(p); + pmpz_init(psub1); + pmpz_init(g); + pmpz_init(pubkey); + pmpz_init(privkey); + + import_mpz(p, (BCRYPT_DH_KEY_BLOB *)key_data(key)->d.pubkey + 1, key_length); + if (!mpz_sgn(p)) + { + ERR("Got zero modulus.\n"); + status = STATUS_INTERNAL_ERROR; + goto done; + } + pmpz_sub_ui(psub1, p, 1); + + import_mpz(g, (UCHAR *)((BCRYPT_DH_KEY_BLOB *)key_data(key)->d.pubkey + 1) + key_length, key_length); + if (!mpz_sgn(g)) + { + ERR("Got zero generator.\n"); + status = STATUS_INTERNAL_ERROR; + goto done; + } + for (i = 0; i < 3; ++i) + { + if ((status = gen_random(key_data(key)->d.privkey, key_length))) + { + goto done; + } + import_mpz(privkey, key_data(key)->d.privkey, key_length); + + pmpz_mod(privkey, privkey, p); + pmpz_powm(pubkey, g, privkey, p); + if (p_mpz_cmp_ui(pubkey, 1)) + break; + } + if (i == 3) + { + ERR("Could not generate key after 3 iterations.\n"); + status = STATUS_INTERNAL_ERROR; + goto done; + } + + if (pmpz_cmp(pubkey, psub1) >= 0) + { + ERR("pubkey > p - 1.\n"); + status = STATUS_INTERNAL_ERROR; + goto done; + } + + export_mpz(key_data(key)->d.privkey, key_length, privkey); + export_mpz((UCHAR *)((BCRYPT_DH_KEY_BLOB *)key_data(key)->d.pubkey + 1) + 2 * key_length, key_length, pubkey); + key->u.a.flags |= KEY_FLAG_FINALIZED; + +done: + pmpz_clear(psub1); + pmpz_clear(p); + pmpz_clear(g); + pmpz_clear(pubkey); + pmpz_clear(privkey); + return status; +} +#else +static NTSTATUS CDECL key_dh_generate( struct key *key ) +{ + ERR("Compiled without DH support.\n"); + return STATUS_NOT_IMPLEMENTED; +} +#endif + static NTSTATUS key_asymmetric_generate( void *args ) { struct key *key = args; @@ -1099,7 +1411,7 @@ static NTSTATUS key_asymmetric_generate( void *args ) unsigned int bitlen; if (!libgnutls_handle) return STATUS_INTERNAL_ERROR; - if (key_data(key)->a.privkey) return STATUS_INVALID_HANDLE; + if (key->alg_id != ALG_ID_DH && key_data(key)->a.privkey) return STATUS_INVALID_HANDLE; switch (key->alg_id) { @@ -1110,9 +1422,7 @@ static NTSTATUS key_asymmetric_generate( void *args ) break; case ALG_ID_DH: - pk_alg = GNUTLS_PK_DH; - bitlen = key->u.a.bitlen; - break; + return key_dh_generate( key ); case ALG_ID_DSA: pk_alg = GNUTLS_PK_DSA; @@ -1150,6 +1460,7 @@ static NTSTATUS key_asymmetric_generate( void *args ) if (key->alg_id == ALG_ID_DH && !key_data(key)->a.dh_params && !(key_data(key)->a.dh_params = get_dh_params( privkey ))) { + ERR("gnutls error bitlen %u.\n", bitlen); pgnutls_privkey_deinit( privkey ); return STATUS_INTERNAL_ERROR; } @@ -1664,137 +1975,6 @@ static NTSTATUS key_import_dsa_capi_public( struct key *key, UCHAR *buf, ULONG l return STATUS_SUCCESS; } -static NTSTATUS key_export_dh_public( struct key *key, UCHAR *buf, ULONG len, ULONG *ret_len ) -{ - BCRYPT_DH_KEY_BLOB *dh_blob = (BCRYPT_DH_KEY_BLOB *)buf; - ULONG size = key->u.a.bitlen / 8; - gnutls_dh_params_t params; - gnutls_datum_t p, g, y; - UCHAR *dst; - int ret = GNUTLS_E_INVALID_REQUEST; - - if ((ret = pgnutls_dh_params_init( ¶ms )) < 0) - { - pgnutls_perror( ret ); - return STATUS_INTERNAL_ERROR; - } - - if ((ret = pgnutls_pubkey_export_dh_raw( key_data(key)->a.pubkey, params, &y, 0 ))) - { - pgnutls_perror( ret ); - pgnutls_dh_params_deinit( params ); - return STATUS_INTERNAL_ERROR; - } - - if ((ret = pgnutls_dh_params_export_raw( params, &p, &g, NULL )) < 0) - { - pgnutls_perror( ret ); - free( y.data ); - pgnutls_dh_params_deinit( params ); - return STATUS_INTERNAL_ERROR; - } - - *ret_len = sizeof(*dh_blob) + EXPORT_SIZE(p, size, 1) + EXPORT_SIZE(g, size, 1) + EXPORT_SIZE(y, size, 1); - if (len >= *ret_len && buf) - { - dst = (UCHAR *)(dh_blob + 1); - dst += export_gnutls_datum( dst, size, &p, 1 ); - dst += export_gnutls_datum( dst, size, &g, 1 ); - dst += export_gnutls_datum( dst, size, &y, 1 ); - - dh_blob->dwMagic = BCRYPT_DH_PUBLIC_MAGIC; - dh_blob->cbKey = size; - } - - free( p.data ); free( g.data ); free( y.data ); - return STATUS_SUCCESS; -} - -static NTSTATUS key_export_dh( struct key *key, UCHAR *buf, ULONG len, ULONG *ret_len ) -{ - BCRYPT_DH_KEY_BLOB *dh_blob = (BCRYPT_DH_KEY_BLOB *)buf; - gnutls_datum_t p, g, y, x; - gnutls_dh_params_t params; - ULONG size = key->u.a.bitlen / 8; - UCHAR *dst; - int ret; - - if (!key_data(key)->a.privkey) return STATUS_INVALID_PARAMETER; - - if ((ret = pgnutls_dh_params_init( ¶ms )) < 0) - { - pgnutls_perror( ret ); - return STATUS_INTERNAL_ERROR; - } - - if ((ret = pgnutls_privkey_export_dh_raw( key_data(key)->a.privkey, params, &y, &x, 0 ))) - { - pgnutls_perror( ret ); - pgnutls_dh_params_deinit( params ); - return STATUS_INTERNAL_ERROR; - } - - if ((ret = pgnutls_dh_params_export_raw( params, &p, &g, NULL )) < 0) - { - pgnutls_perror( ret ); - free( y.data ); free( x.data ); - pgnutls_dh_params_deinit( params ); - return STATUS_INTERNAL_ERROR; - } - - *ret_len = sizeof(*dh_blob) + EXPORT_SIZE(p, size, 1) + EXPORT_SIZE(g, size, 1) + - EXPORT_SIZE(y, size, 1) + EXPORT_SIZE(x, size, 1); - if (len >= *ret_len && buf) - { - dst = (UCHAR *)(dh_blob + 1); - dst += export_gnutls_datum( dst, size, &p, 1 ); - dst += export_gnutls_datum( dst, size, &g, 1 ); - dst += export_gnutls_datum( dst, size, &y, 1 ); - dst += export_gnutls_datum( dst, size, &x, 1 ); - - dh_blob->dwMagic = BCRYPT_DH_PRIVATE_MAGIC; - dh_blob->cbKey = size; - } - - free( p.data ); free( g.data ); free( y.data ); free( x.data ); - pgnutls_dh_params_deinit( params ); - return STATUS_SUCCESS; -} - -static NTSTATUS key_export_dh_params( struct key *key, UCHAR *buf, ULONG len, ULONG *ret_len ) -{ - BCRYPT_DH_PARAMETER_HEADER *hdr = (BCRYPT_DH_PARAMETER_HEADER *)buf; - unsigned int size = sizeof(*hdr) + key->u.a.bitlen / 8 * 2; - gnutls_datum_t p, g; - NTSTATUS status = STATUS_SUCCESS; - UCHAR *dst; - int ret; - - if (!key_data(key)->a.dh_params) return STATUS_INVALID_PARAMETER; - - if ((ret = pgnutls_dh_params_export_raw( key_data(key)->a.dh_params, &p, &g, NULL ))) - { - pgnutls_perror( ret ); - return STATUS_INTERNAL_ERROR; - } - - *ret_len = size; - if (len < size) status = STATUS_BUFFER_TOO_SMALL; - else if (buf) - { - hdr->cbLength = size; - hdr->dwMagic = BCRYPT_DH_PARAMETERS_MAGIC; - hdr->cbKeyLength = key->u.a.bitlen / 8; - - dst = (UCHAR *)(hdr + 1); - dst += export_gnutls_datum( dst, hdr->cbKeyLength, &p, 1 ); - dst += export_gnutls_datum( dst, hdr->cbKeyLength, &g, 1 ); - } - - free( p.data ); free( g.data ); - return status; -} - static NTSTATUS key_asymmetric_export( void *args ) { const struct key_asymmetric_export_params *params = args; @@ -1831,154 +2011,55 @@ static NTSTATUS key_asymmetric_export( void *args ) return STATUS_NOT_IMPLEMENTED; case ALG_ID_DH: - if (flags & KEY_EXPORT_FLAG_DH_PARAMETERS) - return key_export_dh_params( key, params->buf, params->len, params->ret_len ); - if (flags & KEY_EXPORT_FLAG_PUBLIC) - return key_export_dh_public( key, params->buf, params->len, params->ret_len ); - return key_export_dh( key, params->buf, params->len, params->ret_len ); - - default: - FIXME( "algorithm %u not yet supported\n", key->alg_id ); - return STATUS_NOT_IMPLEMENTED; - } -} - -static NTSTATUS key_import_dh_public( struct key *key, UCHAR *buf, ULONG len ) -{ - BCRYPT_DH_KEY_BLOB *dh_blob; - gnutls_dh_params_t params; - gnutls_datum_t p, g, y; - gnutls_pubkey_t handle; - int ret; - - if ((ret = pgnutls_pubkey_init( &handle ))) - { - pgnutls_perror( ret ); - return STATUS_INTERNAL_ERROR; - } - - if ((ret = pgnutls_dh_params_init( ¶ms )) < 0) - { - pgnutls_perror( ret ); - pgnutls_pubkey_deinit( handle ); - return STATUS_INTERNAL_ERROR; - } - - dh_blob = (BCRYPT_DH_KEY_BLOB *)buf; - p.data = buf + sizeof(*dh_blob); - p.size = dh_blob->cbKey; - g.data = buf + sizeof(*dh_blob) + dh_blob->cbKey; - g.size = dh_blob->cbKey; - y.data = buf + sizeof(*dh_blob) + dh_blob->cbKey * 2; - y.size = dh_blob->cbKey; - - if ((ret = pgnutls_dh_params_import_raw( params, &p, &g )) < 0) - { - pgnutls_perror( ret ); - pgnutls_dh_params_deinit( params ); - pgnutls_pubkey_deinit( handle ); - return STATUS_INTERNAL_ERROR; - } - - if ((ret = pgnutls_pubkey_import_dh_raw( handle, params, &y ))) - { - pgnutls_perror( ret ); - pgnutls_dh_params_deinit( params ); - pgnutls_pubkey_deinit( handle ); - return STATUS_INTERNAL_ERROR; - } - - if (key_data(key)->a.pubkey) pgnutls_pubkey_deinit( key_data(key)->a.pubkey ); - key_data(key)->a.pubkey = handle; - - if (key_data(key)->a.dh_params) pgnutls_dh_params_deinit( key_data(key)->a.dh_params ); - key_data(key)->a.dh_params = params; - return STATUS_SUCCESS; -} - -static NTSTATUS key_import_dh( struct key *key, UCHAR *buf, ULONG len ) -{ - BCRYPT_DH_KEY_BLOB *dh_blob; - gnutls_dh_params_t params; - gnutls_datum_t p, g, y, x; - gnutls_privkey_t handle; - int ret; - - if ((ret = pgnutls_privkey_init( &handle ))) - { - pgnutls_perror( ret ); - return STATUS_INTERNAL_ERROR; - } + if (!(key->u.a.flags & KEY_FLAG_FINALIZED)) + { + WARN( "Key is not finalized.\n" ); + return STATUS_INVALID_HANDLE; + } - if ((ret = pgnutls_dh_params_init( ¶ms )) < 0) - { - pgnutls_perror( ret ); - pgnutls_privkey_deinit( handle ); - return STATUS_INTERNAL_ERROR; - } + if (flags & KEY_EXPORT_FLAG_DH_PARAMETERS) + { + BCRYPT_DH_PARAMETER_HEADER *h; + unsigned int data_size; + + data_size = sizeof(BCRYPT_DH_PARAMETER_HEADER) + key->u.a.bitlen / 8 * 2; + if (params->ret_len) *params->ret_len = data_size; + if (!params->buf) return STATUS_SUCCESS; + if (params->len < data_size) return STATUS_BUFFER_TOO_SMALL; + + h = (BCRYPT_DH_PARAMETER_HEADER *)params->buf; + h->cbLength = data_size; + h->dwMagic = BCRYPT_DH_PARAMETERS_MAGIC; + h->cbKeyLength = key->u.a.bitlen / 8; + memcpy( h + 1, (BCRYPT_DH_KEY_BLOB *)key_data(key)->d.pubkey + 1, h->cbKeyLength * 2); + } + else + { + BCRYPT_DH_KEY_BLOB *h = (BCRYPT_DH_KEY_BLOB *)params->buf; + BOOL dh_private = !(flags & KEY_EXPORT_FLAG_PUBLIC); - dh_blob = (BCRYPT_DH_KEY_BLOB *)buf; - p.data = buf + sizeof(*dh_blob); - p.size = dh_blob->cbKey; - g.data = buf + sizeof(*dh_blob) + dh_blob->cbKey; - g.size = dh_blob->cbKey; - y.data = buf + sizeof(*dh_blob) + dh_blob->cbKey * 2; - y.size = dh_blob->cbKey; - x.data = buf + sizeof(*dh_blob) + dh_blob->cbKey * 3; - x.size = dh_blob->cbKey; + if (!key_data(key)->d.pubkey || (dh_private && !key_data(key)->d.privkey)) + return STATUS_INVALID_HANDLE; - if ((ret = pgnutls_dh_params_import_raw( params, &p, &g )) < 0) - { - pgnutls_perror( ret ); - pgnutls_dh_params_deinit( params ); - pgnutls_privkey_deinit( handle ); - return STATUS_INTERNAL_ERROR; - } + *params->ret_len = dh_pubkey_len( key ); + if (dh_private) + *params->ret_len += key->u.a.bitlen / 8; - if ((ret = pgnutls_privkey_import_dh_raw( handle, params, &y, &x ))) - { - pgnutls_perror( ret ); - pgnutls_dh_params_deinit( params ); - pgnutls_privkey_deinit( handle ); - return STATUS_INTERNAL_ERROR; - } + if (params->len < *params->ret_len) return STATUS_SUCCESS; - if (key_data(key)->a.privkey) pgnutls_privkey_deinit( key_data(key)->a.privkey ); - key_data(key)->a.privkey = handle; + memcpy(params->buf, key_data(key)->d.pubkey, dh_pubkey_len( key )); + if (dh_private) + memcpy(params->buf + dh_pubkey_len( key ), key_data(key)->d.privkey, key->u.a.bitlen / 8); - if (key_data(key)->a.dh_params) pgnutls_dh_params_deinit( key_data(key)->a.dh_params ); - key_data(key)->a.dh_params = params; - return STATUS_SUCCESS; -} - -static NTSTATUS key_import_dh_params( struct key *key, UCHAR *buf, ULONG len ) -{ - BCRYPT_DH_PARAMETER_HEADER *dh_header = (BCRYPT_DH_PARAMETER_HEADER *)buf; - gnutls_dh_params_t params; - gnutls_datum_t p, g; - int ret; - - if ((ret = pgnutls_dh_params_init( ¶ms ))) - { - pgnutls_perror( ret ); - return STATUS_INTERNAL_ERROR; - } - - p.data = (unsigned char *)(dh_header + 1); - p.size = dh_header->cbKeyLength; - g.data = p.data + dh_header->cbKeyLength; - g.size = dh_header->cbKeyLength; + h->dwMagic = dh_private ? BCRYPT_DH_PRIVATE_MAGIC : BCRYPT_DH_PUBLIC_MAGIC; + h->cbKey = key->u.a.bitlen / 8; + } + return STATUS_SUCCESS; - if ((ret = pgnutls_dh_params_import_raw( params, &p, &g ))) - { - pgnutls_perror( ret ); - pgnutls_dh_params_deinit( params ); - return STATUS_INTERNAL_ERROR; + default: + FIXME( "algorithm %u not yet supported\n", key->alg_id ); + return STATUS_NOT_IMPLEMENTED; } - - if (key_data(key)->a.dh_params) pgnutls_dh_params_deinit( key_data(key)->a.dh_params ); - key_data(key)->a.dh_params = params; - return STATUS_SUCCESS; } static NTSTATUS key_asymmetric_import( void *args ) @@ -2023,12 +2104,56 @@ static NTSTATUS key_asymmetric_import( void *args ) return STATUS_NOT_IMPLEMENTED; case ALG_ID_DH: + if (key->u.a.flags & KEY_FLAG_FINALIZED) + { + ERR( "Key is alrady finalized.\n" ); + return STATUS_INVALID_HANDLE; + } if (flags & KEY_IMPORT_FLAG_DH_PARAMETERS) - return key_import_dh_params( key, params->buf, params->len ); - if (flags & KEY_IMPORT_FLAG_PUBLIC) - return key_import_dh_public( key, params->buf, params->len ); - ret = key_import_dh( key, params->buf, params->len ); - break; + { + const BCRYPT_DH_PARAMETER_HEADER *h = (const BCRYPT_DH_PARAMETER_HEADER *)params->buf; + ULONG param_size = sizeof(BCRYPT_DH_PARAMETER_HEADER) + key->u.a.bitlen / 8 * 2; + + if (params->len < param_size) return STATUS_BUFFER_TOO_SMALL; + if (!h || h->cbLength != param_size || h->dwMagic != BCRYPT_DH_PARAMETERS_MAGIC + || h->cbKeyLength != key->u.a.bitlen / 8) + return STATUS_INVALID_PARAMETER; + + dh_key_alloc_pub( key ); + memcpy((BCRYPT_DH_KEY_BLOB *)key_data(key)->d.pubkey + 1, h + 1, h->cbKeyLength * 2); + key->u.a.flags |= KEY_FLAG_DH_PARAMS_SET; + } + else + { + BCRYPT_DH_KEY_BLOB *h = (BCRYPT_DH_KEY_BLOB *)params->buf; + BOOL dh_private = !(flags & KEY_IMPORT_FLAG_PUBLIC); + ULONG size; + + if (h->dwMagic != (dh_private ? BCRYPT_DH_PRIVATE_MAGIC : BCRYPT_DH_PUBLIC_MAGIC)) + { + WARN("unexpected dwMagic %#x.\n", (int)h->dwMagic); + return STATUS_INVALID_PARAMETER; + } + + size = sizeof(*h) + h->cbKey * 3; + if (dh_private) + size += h->cbKey; + if (params->len != size) return STATUS_INVALID_PARAMETER; + if (h->cbKey * 8 < 512) return STATUS_INVALID_PARAMETER; + + dh_key_alloc_pub( key ); + + memcpy( key_data(key)->d.pubkey, params->buf, dh_pubkey_len( key )); + key->u.a.flags |= KEY_FLAG_DH_PARAMS_SET; + + if (dh_private) + { + dh_key_alloc_priv( key ); + memcpy( key_data(key)->d.privkey, params->buf + sizeof(*h) + h->cbKey * 3, h->cbKey); + } + key->u.a.flags |= KEY_FLAG_FINALIZED; + } + return STATUS_SUCCESS; default: FIXME( "algorithm %u not yet supported\n", key->alg_id ); @@ -2454,8 +2579,15 @@ static NTSTATUS key_asymmetric_destroy( void *args ) { struct key *key = args; - if (key_data(key)->a.privkey) pgnutls_privkey_deinit( key_data(key)->a.privkey ); - if (key_data(key)->a.pubkey) pgnutls_pubkey_deinit( key_data(key)->a.pubkey ); + if (key->alg_id == ALG_ID_DH) + { + dh_key_free( key ); + } + else + { + if (key_data(key)->a.privkey) pgnutls_privkey_deinit( key_data(key)->a.privkey ); + if (key_data(key)->a.pubkey) pgnutls_pubkey_deinit( key_data(key)->a.pubkey ); + } if (key_data(key)->a.dh_params) pgnutls_dh_params_deinit( key_data(key)->a.dh_params ); return STATUS_SUCCESS; } @@ -2508,22 +2640,7 @@ static NTSTATUS dup_privkey( struct key *key_orig, struct key *key_copy ) free( x.data ); free( y.data ); free( k.data ); break; } - case ALG_ID_DH: - { - gnutls_dh_params_t params; - gnutls_datum_t y, x; - if ((ret = pgnutls_dh_params_init( ¶ms )) < 0) break; - if ((ret = pgnutls_privkey_export_dh_raw( key_data(key_orig)->a.privkey, params, &y, &x, 0 )) < 0) - { - pgnutls_dh_params_deinit( params ); - break; - } - ret = pgnutls_privkey_import_dh_raw( privkey, params, &y, &x ); - pgnutls_dh_params_deinit( params ); - free( x.data ); free( y.data ); - break; - } default: ERR( "unhandled algorithm %u\n", key_orig->alg_id ); pgnutls_privkey_deinit( privkey ); @@ -2587,22 +2704,6 @@ static NTSTATUS dup_pubkey( struct key *key_orig, struct key *key_copy ) free( x.data ); free( y.data ); break; } - case ALG_ID_DH: - { - gnutls_dh_params_t params; - gnutls_datum_t y; - - if ((ret = pgnutls_dh_params_init( ¶ms )) < 0) break; - if ((ret = pgnutls_pubkey_export_dh_raw( key_data(key_orig)->a.pubkey, params, &y, 0 )) < 0) - { - pgnutls_dh_params_deinit( params ); - break; - } - ret = pgnutls_pubkey_import_dh_raw( pubkey, params, &y ); - pgnutls_dh_params_deinit( params ); - free( y.data ); - break; - } default: ERR( "unhandled algorithm %u\n", key_orig->alg_id ); pgnutls_pubkey_deinit( pubkey ); @@ -2625,6 +2726,23 @@ static NTSTATUS key_asymmetric_duplicate( void *args ) const struct key_asymmetric_duplicate_params *params = args; NTSTATUS status; + if (params->key_orig->alg_id == ALG_ID_DH) + { + union key_data *s = key_data( params->key_orig ); + union key_data *d = key_data( params->key_copy ); + if (s->d.privkey) + { + dh_key_alloc_priv( params->key_copy ); + memcpy( d->d.privkey, s->d.privkey, params->key_orig->u.a.bitlen / 8 ); + } + if (s->d.pubkey) + { + dh_key_alloc_pub( params->key_copy ); + memcpy( d->d.pubkey, s->d.pubkey, dh_pubkey_len( params->key_orig )); + } + return STATUS_SUCCESS; + } + if (key_data(params->key_orig)->a.privkey && (status = dup_privkey( params->key_orig, params->key_copy ))) return status; @@ -2772,15 +2890,81 @@ static NTSTATUS key_asymmetric_encrypt( void *args ) static NTSTATUS key_asymmetric_derive_key( void *args ) { const struct key_asymmetric_derive_key_params *params = args; - gnutls_datum_t s; NTSTATUS status = STATUS_SUCCESS; - int ret; + gnutls_datum_t s = { NULL }; + struct key *priv_key; + struct key *peer_key; - if ((ret = pgnutls_privkey_derive_secret( key_data(params->privkey)->a.privkey, - key_data(params->pubkey)->a.pubkey, NULL, &s, 0 ))) + priv_key = params->privkey; + peer_key = params->pubkey; + + switch (priv_key->alg_id) { - pgnutls_perror( ret ); - return STATUS_INTERNAL_ERROR; + case ALG_ID_DH: +#if defined(HAVE_GMP_H) && defined(SONAME_LIBGMP) + { + mpz_t p, priv, peer, k; + ULONG key_length; + + if (!dh_supported) + { + ERR("DH is not available.\n"); + return STATUS_NOT_IMPLEMENTED; + } + + if (!(priv_key->u.a.flags & KEY_FLAG_FINALIZED) || !(peer_key->u.a.flags & KEY_FLAG_FINALIZED) + || !key_data(priv_key)->d.privkey) + { + WARN( "Keys are not initialized.\n" ); + return STATUS_INVALID_HANDLE; + } + + key_length = priv_key->u.a.bitlen / 8; + + if (memcmp((BCRYPT_DH_KEY_BLOB *)key_data(priv_key)->d.pubkey + 1, + (BCRYPT_DH_KEY_BLOB *)key_data(peer_key)->d.pubkey + 1, 2 * key_length)) + { + ERR("peer DH paramaters do not match.\n"); + return STATUS_INTERNAL_ERROR; + } + + pmpz_init(p); + pmpz_init(priv); + pmpz_init(peer); + pmpz_init(k); + + import_mpz(p, (BCRYPT_DH_KEY_BLOB *)key_data(priv_key)->d.pubkey + 1, key_length); + if (pmpz_sizeinbase(p, 2) < 2) + { + ERR("Invalid prime.\n"); + pmpz_clear(p); + pmpz_clear(priv); + pmpz_clear(peer); + pmpz_clear(k); + return STATUS_INTERNAL_ERROR; + } + import_mpz(priv, key_data(priv_key)->d.privkey, key_length); + import_mpz(peer, key_data(peer_key)->d.pubkey + sizeof(BCRYPT_DH_KEY_BLOB) + 2 * key_length, key_length); + pmpz_powm(k, peer, priv, p); + + s.size = key_length; + s.data = malloc( s.size ); + export_mpz(s.data, key_length, k); + + pmpz_clear(p); + pmpz_clear(priv); + pmpz_clear(peer); + pmpz_clear(k); + break; + } +#else + ERR_(winediag)("Compiled without DH support.\n"); + return STATUS_NOT_IMPLEMENTED; +#endif + + default: + ERR( "unhandled algorithm %u\n", priv_key->alg_id ); + return STATUS_INVALID_HANDLE; } *params->ret_len = EXPORT_SIZE( s, params->privkey->u.a.bitlen / 8, 1 ); diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c index 87a81e2b193a..e80f5d6a0e5c 100644 --- a/dlls/bcrypt/tests/bcrypt.c +++ b/dlls/bcrypt/tests/bcrypt.c @@ -3284,12 +3284,7 @@ static void test_DH(void) ok(key != NULL, "key not set\n"); status = BCryptFinalizeKeyPair(key, 0); - todo_wine ok(status == STATUS_SUCCESS, "got %#lx\n", status); - if (status != STATUS_SUCCESS) - { - BCryptDestroyKey(key); - return; - } + ok(status == STATUS_SUCCESS, "got %#lx\n", status); size = 0; status = BCryptExportKey(key, NULL, BCRYPT_DH_PUBLIC_BLOB, NULL, 0, &size, 0); @@ -4064,7 +4059,7 @@ static void test_SecretAgreement(void) BCryptCloseAlgorithmProvider(alg, 0); return; } - todo_wine ok(status == STATUS_SUCCESS, "got %#lx\n", status); + ok(status == STATUS_SUCCESS, "got %#lx\n", status); status = BCryptSecretAgreement(key, key, &secret, 0); ok(status == STATUS_SUCCESS, "got %#lx\n", status); @@ -4073,7 +4068,7 @@ static void test_SecretAgreement(void) ok(status == STATUS_SUCCESS, "got %#lx\n", status); status = BCryptDeriveKey(secret, L"HASH", NULL, NULL, 0, &size, 0); - todo_wine ok(status == STATUS_SUCCESS, "got %#lx\n", status); + ok(status == STATUS_SUCCESS, "got %#lx\n", status); status = BCryptDestroySecret(secret); ok(status == STATUS_SUCCESS, "got %#lx\n", status); @@ -4454,6 +4449,9 @@ static void test_dh_SecretAgreement(void) status = BCryptImportKeyPair(alg, NULL, BCRYPT_DH_PRIVATE_BLOB, &key, buffer, size, 0); ok(status == STATUS_SUCCESS, "got %08lx\n", status); + status = BCryptFinalizeKeyPair(key, 0); + ok(status == STATUS_INVALID_HANDLE, "got %08lx\n", status); + memset(buffer, 0xcc, sizeof(buffer)); size = 0xdeadbeef; status = BCryptExportKey(key, NULL, BCRYPT_DH_PUBLIC_BLOB, NULL, 0, &size, 0); @@ -4469,6 +4467,14 @@ static void test_dh_SecretAgreement(void) ok(dh_key_blob->cbKey == length / 8, "Got unexpected length %lu.\n", dh_key_blob->cbKey); ok(!memcmp(dh_key_blob + 1, private_key_data, length / 8 * 3), "Key data does not match.\n"); + status = BCryptImportKeyPair(alg, NULL, BCRYPT_DH_PUBLIC_BLOB, &key2, buffer, size, 0); + ok(status == STATUS_SUCCESS, "got %#lx.\n", status); + status = BCryptFinalizeKeyPair(key2, 0); + ok(status == STATUS_INVALID_HANDLE, "got %#lx.\n", status); + status = BCryptSecretAgreement(key2, key2, &secret, 0); + todo_wine ok(status == STATUS_INVALID_PARAMETER, "got %08lx\n", status); + BCryptDestroyKey(key2); + status = BCryptGenerateKeyPair(alg, &key2, length, 0); ok(status == STATUS_SUCCESS, "got %08lx\n", status); dh_header = (BCRYPT_DH_PARAMETER_HEADER *)buffer; @@ -4478,8 +4484,15 @@ static void test_dh_SecretAgreement(void) memcpy(dh_header + 1, private_key_data, length / 8 * 2); status = BCryptSetProperty(key2, BCRYPT_DH_PARAMETERS, buffer, dh_header->cbLength, 0); ok(status == STATUS_SUCCESS, "got %08lx\n", status); + status = BCryptSetProperty(key2, BCRYPT_DH_PARAMETERS, buffer, dh_header->cbLength, 0); + ok(status == STATUS_SUCCESS, "got %08lx\n", status); status = BCryptFinalizeKeyPair(key2, 0); ok(status == STATUS_SUCCESS, "got %08lx\n", status); + if (0) + { + /* Crashes on Windows. */ + BCryptSetProperty(key2, BCRYPT_DH_PARAMETERS, buffer, dh_header->cbLength, 0); + } status = BCryptExportKey(key2, NULL, BCRYPT_DH_PUBLIC_BLOB, buffer, sizeof(buffer), &size, 0); ok(status == STATUS_SUCCESS, "got %08lx\n", status); From 313dcafea01158230f0f896e29b0688f717cefa5 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 8 Dec 2020 01:43:33 +0300 Subject: [PATCH 0589/2542] bcrypt: Add support for calculating secret ecc keys. (updated by Paul Gofman) For Rainbow 6: Siege. --- configure.ac | 14 +++ dlls/bcrypt/gnutls.c | 230 +++++++++++++++++++++++++++++++++++++ dlls/bcrypt/tests/bcrypt.c | 10 +- 3 files changed, 250 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 497d0d671c59..08704ea4f2ba 100644 --- a/configure.ac +++ b/configure.ac @@ -33,6 +33,7 @@ AC_ARG_WITH(dbus, AS_HELP_STRING([--without-dbus],[do not use DBus (dynamic AC_ARG_WITH(ffmpeg, AS_HELP_STRING([--without-ffmpeg],[do not use the FFmpeg library])) AC_ARG_WITH(fontconfig,AS_HELP_STRING([--without-fontconfig],[do not use fontconfig])) AC_ARG_WITH(freetype, AS_HELP_STRING([--without-freetype],[do not use the FreeType library])) +AC_ARG_WITH(gcrypt, AS_HELP_STRING([--without-gcrypt],[do not use libgcrypt])) AC_ARG_WITH(gettext, AS_HELP_STRING([--without-gettext],[do not use gettext])) AC_ARG_WITH(gettextpo, AS_HELP_STRING([--with-gettextpo],[use the GetTextPO library to rebuild po files]), [if test "x$withval" = "xno"; then ac_cv_header_gettext_po_h=no; fi]) @@ -1904,6 +1905,19 @@ fi WINE_NOTICE_WITH(vulkan,[test "x$ac_cv_lib_soname_vulkan" = "x" -a "x$ac_cv_lib_soname_MoltenVK" = "x"], [libvulkan and libMoltenVK ${notice_platform}development files not found, Vulkan won't be supported.]) +dnl **** Check for gcrypt **** +if test "x$with_gcrypt" != "xno" +then + WINE_PACKAGE_FLAGS(GCRYPT,[libgcrypt],,,, + [AC_CHECK_HEADERS([gcrypt.h]) + if test "$ac_cv_header_gcrypt_h" = "yes" + then + WINE_CHECK_SONAME(gcrypt,gcry_sexp_build,,,[$GCRYPT_LIBS]) + fi]) +fi +WINE_NOTICE_WITH(gcrypt,[test "x$ac_cv_lib_soname_gcrypt" = "x"], + [libgcrypt ${notice_platform}development files not found, GCRYPT won't be supported.]) + dnl **** Check for gcc specific options **** if test "x${GCC}" = "xyes" diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c index ec0d5f5b54b0..41f49441cf3b 100644 --- a/dlls/bcrypt/gnutls.c +++ b/dlls/bcrypt/gnutls.c @@ -57,6 +57,10 @@ #include #include +#ifdef HAVE_GCRYPT_H +#include +#endif + WINE_DEFAULT_DEBUG_CHANNEL(bcrypt); WINE_DECLARE_DEBUG_CHANNEL(winediag); @@ -214,6 +218,12 @@ static int (*pgnutls_dh_params_import_raw2)(gnutls_dh_params_t dh_params, const static int (*pgnutls_dh_params_export_raw)(gnutls_dh_params_t params, gnutls_datum_t * prime, gnutls_datum_t * generator, unsigned int *bits); +static int (*pgnutls_ecdh_compute_key)(gnutls_ecc_curve_t curve, + const gnutls_datum_t *x, const gnutls_datum_t *y, + const gnutls_datum_t *k, + const gnutls_datum_t *peer_x, const gnutls_datum_t *peer_y, + gnutls_datum_t *Z); + #define MAKE_FUNCPTR(f) static typeof(f) * p##f MAKE_FUNCPTR(gnutls_cipher_decrypt2); MAKE_FUNCPTR(gnutls_cipher_deinit); @@ -253,6 +263,24 @@ MAKE_FUNCPTR(mpz_mod); MAKE_FUNCPTR(mpz_powm); MAKE_FUNCPTR(mpz_sub_ui); #endif + +#if defined(HAVE_GCRYPT_H) && defined(SONAME_LIBGCRYPT) +static BOOL gcrypt_available; +static void *libgcrypt_handle; + +MAKE_FUNCPTR(gcry_check_version); +MAKE_FUNCPTR(gcry_sexp_build); +MAKE_FUNCPTR(gcry_pk_encrypt); +MAKE_FUNCPTR(gcry_mpi_new); +MAKE_FUNCPTR(gcry_mpi_print); +MAKE_FUNCPTR(gcry_sexp_release); +MAKE_FUNCPTR(gcry_mpi_release); +MAKE_FUNCPTR(gcry_strsource); +MAKE_FUNCPTR(gcry_strerror); +MAKE_FUNCPTR(gcry_sexp_find_token); +MAKE_FUNCPTR(gcry_sexp_nth_mpi); +#endif + #undef MAKE_FUNCPTR static int compat_gnutls_cipher_tag(gnutls_cipher_hd_t handle, void *tag, size_t tag_size) @@ -513,6 +541,36 @@ static NTSTATUS gnutls_process_attach( void *args ) #undef LOAD_FUNCPTR_STR #endif +#if defined(HAVE_GCRYPT_H) && defined(SONAME_LIBGCRYPT) +#define LOAD_FUNCPTR(f) \ + if (!(p##f = dlsym( libgcrypt_handle, #f ))) \ + { \ + WARN( "failed to load %s\n", #f ); \ + gcrypt_available = FALSE; \ + } + + if ((libgcrypt_handle = dlopen( SONAME_LIBGCRYPT, RTLD_NOW ))) + { + gcrypt_available = TRUE; + + LOAD_FUNCPTR(gcry_check_version); + LOAD_FUNCPTR(gcry_sexp_build); + LOAD_FUNCPTR(gcry_pk_encrypt); + LOAD_FUNCPTR(gcry_mpi_new); + LOAD_FUNCPTR(gcry_mpi_print); + LOAD_FUNCPTR(gcry_sexp_release); + LOAD_FUNCPTR(gcry_mpi_release); + LOAD_FUNCPTR(gcry_strsource); + LOAD_FUNCPTR(gcry_strerror); + LOAD_FUNCPTR(gcry_sexp_find_token); + LOAD_FUNCPTR(gcry_sexp_nth_mpi); + } + else + WARN("failed to load gcrypt, no support for ECC secret agreement\n"); + +#undef LOAD_FUNCPTR +#endif + #define LOAD_FUNCPTR_OPT(f) \ if (!(p##f = dlsym( libgnutls_handle, #f ))) \ { \ @@ -586,6 +644,12 @@ static NTSTATUS gnutls_process_attach( void *args ) ERR_(winediag)("Compiled without DH support.\n"); #endif + if (!(pgnutls_ecdh_compute_key = dlsym( libgnutls_handle, "_gnutls_ecdh_compute_key" )) + && !(pgnutls_ecdh_compute_key = dlsym( libgnutls_handle, "gnutls_ecdh_compute_key" ))) + { + WARN("gnutls_ecdh_compute_key not found\n"); + } + if (TRACE_ON( bcrypt )) { char *env = getenv("GNUTLS_DEBUG_LEVEL"); @@ -624,6 +688,11 @@ static NTSTATUS gnutls_process_detach( void *args ) dlclose( libgmp_handle ); libgmp_handle = NULL; #endif + +#if defined(HAVE_GCRYPT_H) && defined(SONAME_LIBGCRYPT) + dlclose( libgcrypt_handle ); + libgcrypt_handle = NULL; +#endif } struct buffer @@ -2887,6 +2956,60 @@ static NTSTATUS key_asymmetric_encrypt( void *args ) return status; } +#if defined(HAVE_GCRYPT_H) && defined(SONAME_LIBGCRYPT) +static NTSTATUS gcrypt_extract_result_into_secret(gcry_sexp_t result, gnutls_datum_t *s) +{ + NTSTATUS status = STATUS_SUCCESS; + gcry_mpi_t fullcoords = NULL; + gcry_sexp_t fragment = NULL; + UCHAR *tmp_buffer = NULL; + gcry_error_t err; + size_t size; + + fragment = pgcry_sexp_find_token( result, "s", 0 ); + if (!fragment) + { + status = STATUS_NO_MEMORY; + goto done; + } + + fullcoords = pgcry_sexp_nth_mpi( fragment, 1, GCRYMPI_FMT_USG ); + if (!fullcoords) + { + status = STATUS_NO_MEMORY; + goto done; + } + + if ((err = pgcry_mpi_print( GCRYMPI_FMT_USG, NULL, 0, &size, fullcoords)) ) + { + ERR("Error = %s/%s.\n", pgcry_strsource( err ), pgcry_strerror( err )); + status = STATUS_INTERNAL_ERROR; + goto done; + } + + tmp_buffer = malloc(size); + if ((err = pgcry_mpi_print( GCRYMPI_FMT_STD, tmp_buffer, size, NULL, fullcoords)) ) + { + ERR( "Error = %s/%s.\n", pgcry_strsource(err), pgcry_strerror(err) ); + status = STATUS_INTERNAL_ERROR; + goto done; + } + + s->size = size / 2; + s->data = malloc( s->size ); + memcpy( s->data, tmp_buffer + size % 2, size / 2 ); + +done: + free( tmp_buffer ); + + pgcry_mpi_release( fullcoords ); + pgcry_sexp_release( fragment ); + + return status; +} +#endif + + static NTSTATUS key_asymmetric_derive_key( void *args ) { const struct key_asymmetric_derive_key_params *params = args; @@ -2962,6 +3085,113 @@ static NTSTATUS key_asymmetric_derive_key( void *args ) return STATUS_NOT_IMPLEMENTED; #endif + case ALG_ID_ECDH_P256: + case ALG_ID_ECDH_P384: +/* this is necessary since GNUTLS doesn't support ECDH public key encryption, maybe we can replace this when it does: + https://github.com/gnutls/gnutls/blob/cdc4fc288d87f91f974aa23b6e8595a53970ce00/lib/nettle/pk.c#L495 */ +#if defined(HAVE_GCRYPT_H) && defined(SONAME_LIBGCRYPT) + { + gcry_sexp_t xchg_result = NULL; + gcry_sexp_t privkey = NULL; + gcry_sexp_t pubkey = NULL; + const char *pubkey_format; + BCRYPT_ECCKEY_BLOB *h; + UCHAR *privkey_blob; + UCHAR *pubkey_raw; + gcry_error_t err; + ULONG key_length; + NTSTATUS status; + ULONG key_len; + + if (!gcrypt_available) + { + ERR("ECDH secret agreement is not available.\n"); + return STATUS_NOT_IMPLEMENTED; + } + + if (priv_key->alg_id == ALG_ID_ECDH_P256) + { + pubkey_format = "NIST P-256"; + key_length = 32; + } + else if (priv_key->alg_id == ALG_ID_ECDH_P384) + { + pubkey_format = "NIST P-384"; + key_length = 48; + } + else return STATUS_NOT_IMPLEMENTED; + + if (key_length != priv_key->u.a.bitlen / 8) + { + ERR( "Key length mismatch, key->u.a.bitlen %u, key_length %u.\n", (int)priv_key->u.a.bitlen, + (int)key_length ); + return STATUS_INVALID_PARAMETER; + } + + if ((status = key_export_ecc( priv_key, NULL, 0, &key_len ))) + return status; + privkey_blob = malloc( key_len ); + if ((status = key_export_ecc( priv_key, privkey_blob, key_len, &key_len ))) + { + free( privkey_blob ); + return status; + } + + if ((status = key_export_ecc_public( peer_key, NULL, 0, &key_len ))) + return status; + h = malloc( key_len ); + if ((status = key_export_ecc_public( peer_key, (UCHAR *)h, key_len, &key_len ))) + { + free( privkey_blob ); + return status; + } + + /* copy public key into temporary buffer so we can prepend 0x04 (to indicate it is uncompressed) */ + pubkey_raw = malloc( (key_length * 2) + 1 ); + pubkey_raw[0] = 0x04; + memcpy( pubkey_raw + 1, h + 1, key_length * 2 ); + free( h ); + + err = pgcry_sexp_build( &pubkey, NULL, "(key-data(public-key(ecdh(curve %s)(q %b))))", pubkey_format, + (key_length * 2) + 1, pubkey_raw ); + free( pubkey_raw ); + if (err) + { + free( privkey_blob ); + ERR( "Failed to build gcrypt public key. err %s/%s\n", pgcry_strsource( err ), pgcry_strerror( err )); + return STATUS_INTERNAL_ERROR; + } + + err = pgcry_sexp_build( &privkey, NULL, "(data(flags raw)(value %b))", key_length, + privkey_blob + sizeof(BCRYPT_ECCKEY_BLOB) + key_length * 2 ); + free( privkey_blob ); + if (err) + { + pgcry_sexp_release( pubkey ); + return STATUS_INTERNAL_ERROR; + } + err = pgcry_pk_encrypt( &xchg_result, privkey, pubkey ); + pgcry_sexp_release( privkey ); + pgcry_sexp_release( pubkey ); + if (err) + { + ERR( "Failed to perform key exchange. err %s/%s\n", pgcry_strsource( err ), pgcry_strerror( err )); + return STATUS_INTERNAL_ERROR; + } + status = gcrypt_extract_result_into_secret( xchg_result, &s ); + pgcry_sexp_release(xchg_result); + if (status) + { + ERR("Failed to extract secret key.\n"); + return status; + } + break; + } +#else + WARN("Compiled without ECC secret support.\n"); + return STATUS_NOT_IMPLEMENTED; +#endif + default: ERR( "unhandled algorithm %u\n", priv_key->alg_id ); return STATUS_INVALID_HANDLE; diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c index e80f5d6a0e5c..884b6f693dfe 100644 --- a/dlls/bcrypt/tests/bcrypt.c +++ b/dlls/bcrypt/tests/bcrypt.c @@ -3105,10 +3105,13 @@ static void test_ECDH(void) win_skip("BCRYPT_KDF_RAW_SECRET not supported\n"); goto raw_secret_end; } - todo_wine ok(status == STATUS_SUCCESS, "got %#lx\n", status); - if (status != STATUS_SUCCESS) goto raw_secret_end; + ok(status == STATUS_SUCCESS, "got %#lx\n", status); ok(size == 32, "size of secret key incorrect, got %lu, expected 32\n", size); + if (!size) + goto raw_secret_end; + + buf = malloc(size); status = BCryptDeriveKey(secret, BCRYPT_KDF_RAW_SECRET, NULL, buf, size, &size, 0); ok(status == STATUS_SUCCESS, "got %#lx\n", status); @@ -3117,7 +3120,7 @@ static void test_ECDH(void) raw_secret_end: status = BCryptDeriveKey(secret, BCRYPT_KDF_HASH, &hash_params, NULL, 0, &size, 0); - todo_wine ok (status == STATUS_SUCCESS, "got %#lx\n", status); + ok (status == STATUS_SUCCESS, "got %#lx\n", status); if (status != STATUS_SUCCESS) goto derive_end; ok (size == 20, "got %lu\n", size); @@ -4019,7 +4022,6 @@ static void test_SecretAgreement(void) ok(status == STATUS_INVALID_PARAMETER, "got %#lx\n", status); status = BCryptDeriveKey(secret, L"HASH", NULL, NULL, 0, &size, 0); - todo_wine ok(status == STATUS_SUCCESS, "got %#lx\n", status); status = BCryptDestroyHash(secret); From aabe0e09bb378a4904f43fe969dd99f1b9723e59 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Fri, 1 Oct 2021 14:34:58 +0200 Subject: [PATCH 0590/2542] bcrypt: Add support for none and OAEP-padded asymmetric key encryption. (updated by Paul Gofman) For DayZ. CW-Bug-Id: #18973 --- dlls/bcrypt/bcrypt_main.c | 5 -- dlls/bcrypt/gnutls.c | 171 ++++++++++++++++++++++++++++++++++++- dlls/bcrypt/tests/bcrypt.c | 18 ++-- 3 files changed, 177 insertions(+), 17 deletions(-) diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c index b2f7685d0828..24439dd3f6e2 100644 --- a/dlls/bcrypt/bcrypt_main.c +++ b/dlls/bcrypt/bcrypt_main.c @@ -2268,11 +2268,6 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp } else { - if (flags & BCRYPT_PAD_NONE) - { - FIXME( "flags %#lx not implemented\n", flags ); - return STATUS_NOT_IMPLEMENTED; - } if (!is_asymmetric_encryption_key( key )) return STATUS_NOT_SUPPORTED; asymmetric_params.input = input; diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c index 41f49441cf3b..fe044a95ca84 100644 --- a/dlls/bcrypt/gnutls.c +++ b/dlls/bcrypt/gnutls.c @@ -264,8 +264,9 @@ MAKE_FUNCPTR(mpz_powm); MAKE_FUNCPTR(mpz_sub_ui); #endif -#if defined(HAVE_GCRYPT_H) && defined(SONAME_LIBGCRYPT) static BOOL gcrypt_available; + +#if defined(HAVE_GCRYPT_H) && defined(SONAME_LIBGCRYPT) static void *libgcrypt_handle; MAKE_FUNCPTR(gcry_check_version); @@ -279,6 +280,7 @@ MAKE_FUNCPTR(gcry_strsource); MAKE_FUNCPTR(gcry_strerror); MAKE_FUNCPTR(gcry_sexp_find_token); MAKE_FUNCPTR(gcry_sexp_nth_mpi); +MAKE_FUNCPTR(gcry_sexp_nth_data); #endif #undef MAKE_FUNCPTR @@ -564,6 +566,7 @@ static NTSTATUS gnutls_process_attach( void *args ) LOAD_FUNCPTR(gcry_strerror); LOAD_FUNCPTR(gcry_sexp_find_token); LOAD_FUNCPTR(gcry_sexp_nth_mpi); + LOAD_FUNCPTR(gcry_sexp_nth_data); } else WARN("failed to load gcrypt, no support for ECC secret agreement\n"); @@ -2908,6 +2911,169 @@ static NTSTATUS pubkey_set_rsa_oaep_params( gnutls_pubkey_t key, gnutls_digest_a return STATUS_SUCCESS; } +#if defined(HAVE_GCRYPT_H) && defined(SONAME_LIBGCRYPT) +const char * gcrypt_hash_algorithm_name(LPCWSTR alg_id) +{ + if (!wcscmp( alg_id, BCRYPT_SHA1_ALGORITHM )) return "sha1"; + if (!wcscmp( alg_id, BCRYPT_SHA256_ALGORITHM )) return "sha256"; + if (!wcscmp( alg_id, BCRYPT_SHA384_ALGORITHM )) return "sha384"; + if (!wcscmp( alg_id, BCRYPT_SHA512_ALGORITHM )) return "sha512"; + if (!wcscmp( alg_id, BCRYPT_MD2_ALGORITHM )) return "md2"; + if (!wcscmp( alg_id, BCRYPT_MD5_ALGORITHM )) return "md5"; + return NULL; +} + +static NTSTATUS key_asymmetric_encrypt_gcrypt( void *args ) +{ + const struct key_asymmetric_encrypt_params *params = args; + struct key *key = params->key; + UCHAR *input = params->input; + ULONG input_len = params->input_len; + UCHAR *output = params->output; + ULONG *ret_len = params->ret_len; + void *padding = params->padding; + ULONG flags = params->flags; + BCRYPT_OAEP_PADDING_INFO *oaep_info = padding; + NTSTATUS status; + gcry_sexp_t sexp_pubkey = NULL; + gcry_sexp_t sexp_result = NULL; + gcry_sexp_t sexp_input = NULL; + BCRYPT_RSAKEY_BLOB *rsa_blob; + gcry_sexp_t mpi_a = NULL; + gnutls_datum_t result; + size_t result_len; + gcry_error_t err; + ULONG len; + + if (!gcrypt_available) + { + ERR("Asymmetric encryption not available.\n"); + return STATUS_INTERNAL_ERROR; + } + + if (key->alg_id != ALG_ID_RSA) + { + FIXME("Unsupported algorithm id: %u\n", key->alg_id); + return STATUS_INTERNAL_ERROR; + } + + if (flags == BCRYPT_PAD_NONE && input_len != key->u.a.bitlen / 8) + { + WARN( "Invalid input_len %u for BCRYPT_PAD_NONE.\n", (int)input_len ); + return STATUS_INVALID_PARAMETER; + } + + /* import RSA key */ + if ((status = key_export_rsa_public( key, NULL, 0, &len ))) + { + ERR( "Key export failed.\n" ); + return status; + } + rsa_blob = malloc( len ); + if ((status = key_export_rsa_public( key, (UCHAR *)rsa_blob, len, &len ))) + { + ERR( "Key export failed.\n" ); + return status; + } + err = pgcry_sexp_build(&sexp_pubkey, NULL, + "(public-key(rsa (e %b)(n %b)))", + rsa_blob->cbPublicExp, + (UCHAR *)(rsa_blob + 1), + rsa_blob->cbModulus, + (UCHAR *)(rsa_blob + 1) + rsa_blob->cbPublicExp); + free( rsa_blob ); + if (err) + { + ERR("Failed to build gcrypt public key\n"); + goto done; + } + + /* import input data with necessary padding */ + if (flags == BCRYPT_PAD_PKCS1) + { + err = pgcry_sexp_build(&sexp_input, NULL, + "(data(flags pkcs1)(value %b))", + input_len, + input); + } + else if (flags == BCRYPT_PAD_OAEP) + { + if (oaep_info->pbLabel) + err = pgcry_sexp_build(&sexp_input, NULL, + "(data(flags oaep)(hash-algo %s)(label %b)(value %b))", + gcrypt_hash_algorithm_name(oaep_info->pszAlgId), + oaep_info->cbLabel, + oaep_info->pbLabel, + input_len, + input); + else + err = pgcry_sexp_build(&sexp_input, NULL, + "(data(flags oaep)(hash-algo %s)(value %b))", + gcrypt_hash_algorithm_name(oaep_info->pszAlgId), + input_len, + input); + } + else if (flags == BCRYPT_PAD_NONE) + { + err = pgcry_sexp_build(&sexp_input, NULL, + "(data(flags raw)(value %b))", + input_len, + input); + } + else + { + status = STATUS_INVALID_PARAMETER; + goto done; + } + + if (err) + { + ERR("Failed to build gcrypt padded input data\n"); + goto done; + } + + if ((err = pgcry_pk_encrypt(&sexp_result, sexp_input, sexp_pubkey))) + { + ERR("Failed to encrypt data\n"); + goto done; + } + + mpi_a = pgcry_sexp_find_token(sexp_result, "a", 0); + result.data = (void *)pgcry_sexp_nth_data(mpi_a, 1, &result_len); + + result.size = result_len; + result_len = EXPORT_SIZE(result, key->u.a.bitlen / 8, 1); + *ret_len = result_len; + + if (params->output_len >= result_len) export_gnutls_datum(output, result_len, &result, 1); + else if (params->output_len == 0) status = STATUS_SUCCESS; + else status = STATUS_BUFFER_TOO_SMALL; + +done: + pgcry_sexp_release(sexp_input); + pgcry_sexp_release(sexp_pubkey); + pgcry_sexp_release(sexp_result); + pgcry_sexp_release(mpi_a); + + if (status) + return status; + + if (err) + { + ERR("Error = %s/%s\n", pgcry_strsource (err), pgcry_strerror (err)); + return STATUS_INTERNAL_ERROR; + } + + return STATUS_SUCCESS; +} +#else +static NTSTATUS key_asymmetric_encrypt_gcrypt( void *args ) +{ + ERR("Asymmetric key encryption not supported without gcrypt.\n"); + return STATUS_NOT_IMPLEMENTED; +} +#endif + static NTSTATUS key_asymmetric_encrypt( void *args ) { const struct key_asymmetric_encrypt_params *params = args; @@ -2917,6 +3083,9 @@ static NTSTATUS key_asymmetric_encrypt( void *args ) if (!key_data(params->key)->a.pubkey) return STATUS_INVALID_HANDLE; + if (gcrypt_available && (params->flags == BCRYPT_PAD_NONE || params->flags == BCRYPT_PAD_OAEP)) + return key_asymmetric_encrypt_gcrypt( args ); + if (params->key->alg_id == ALG_ID_RSA && params->flags & BCRYPT_PAD_OAEP) { BCRYPT_OAEP_PADDING_INFO *pad = params->padding; diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c index 884b6f693dfe..a8a0b1e677c7 100644 --- a/dlls/bcrypt/tests/bcrypt.c +++ b/dlls/bcrypt/tests/bcrypt.c @@ -2475,7 +2475,6 @@ static void test_rsa_encrypt(void) ok(ret == STATUS_SUCCESS, "got %#lx\n", ret); /* No padding */ - todo_wine { memset(input_no_padding, 0, sizeof(input_no_padding)); strcpy((char *)input_no_padding, "Hello World"); encrypted_size = 0; @@ -2483,12 +2482,12 @@ static void test_rsa_encrypt(void) ok(ret == STATUS_SUCCESS, "got %lx\n", ret); ok(encrypted_size == 64, "got size of %ld\n", encrypted_size); - encrypted_a = malloc(encrypted_size); + encrypted_a = malloc(encrypted_size * 2); memset(encrypted_a, 0, encrypted_size); - encrypted_b = malloc(encrypted_size); + encrypted_b = malloc(encrypted_size * 2); memset(encrypted_b, 0xff, encrypted_size); - ret = BCryptEncrypt(key, input, sizeof(input), NULL, NULL, 0, encrypted_a, encrypted_size, &encrypted_size, BCRYPT_PAD_NONE); + ret = BCryptEncrypt(key, input, sizeof(input), NULL, NULL, 0, encrypted_a, encrypted_size * 2, &encrypted_size, BCRYPT_PAD_NONE); ok(ret == STATUS_INVALID_PARAMETER, "got %lx\n", ret); ret = BCryptEncrypt(key, input_no_padding, sizeof(input_no_padding), NULL, NULL, 0, encrypted_a, 12, &encrypted_size, BCRYPT_PAD_NONE); @@ -2501,7 +2500,6 @@ static void test_rsa_encrypt(void) ret = BCryptEncrypt(key, input_no_padding, sizeof(input_no_padding), NULL, NULL, 0, encrypted_b, encrypted_size, &encrypted_size, BCRYPT_PAD_NONE); ok(ret == STATUS_SUCCESS, "got %lx\n", ret); - } ok(!memcmp(encrypted_a, encrypted_b, encrypted_size), "Both outputs should be the same\n"); ok(!memcmp(encrypted_b, rsa_encrypted_no_padding, encrypted_size), "Data mismatch.\n"); @@ -2572,18 +2570,17 @@ static void test_rsa_encrypt(void) ret = BCryptFinalizeKeyPair(key, 0); ok(ret == STATUS_SUCCESS, "got %#lx\n", ret); - todo_wine { encrypted_size = 0; ret = BCryptEncrypt(key, input, sizeof(input), &oaep_pad, NULL, 0, NULL, 0, &encrypted_size, BCRYPT_PAD_OAEP); ok(ret == STATUS_SUCCESS, "got %lx\n", ret); ok(encrypted_size == 80, "got size of %ld\n", encrypted_size); - encrypted_a = realloc(encrypted_a, encrypted_size); - memset(encrypted_a, 0, encrypted_size); - encrypted_b = realloc(encrypted_b, encrypted_size); + encrypted_a = realloc(encrypted_a, encrypted_size * 2); + memset(encrypted_a, 0, encrypted_size * 2); + encrypted_b = realloc(encrypted_b, encrypted_size * 2); memset(encrypted_b, 0, encrypted_size); - ret = BCryptEncrypt(key, input, sizeof(input), &oaep_pad, NULL, 0, encrypted_a, encrypted_size, &encrypted_size, BCRYPT_PAD_OAEP); + ret = BCryptEncrypt(key, input, sizeof(input), &oaep_pad, NULL, 0, encrypted_a, encrypted_size * 2, &encrypted_size, BCRYPT_PAD_OAEP); ok(ret == STATUS_SUCCESS, "got %lx\n", ret); ok(encrypted_size == 80, "got size of %ld\n", encrypted_size); @@ -2602,7 +2599,6 @@ static void test_rsa_encrypt(void) ok(ret == STATUS_SUCCESS, "got %lx\n", ret); ok(decrypted_size == sizeof(input), "got %lu\n", decrypted_size); ok(!memcmp(decrypted, input, sizeof(input)), "unexpected output\n"); - } free(encrypted_a); free(encrypted_b); From de282864777dbf6a12d4799d11e7bf79e5dbe85c Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 4 Dec 2023 21:08:37 -0600 Subject: [PATCH 0591/2542] bcrypt: Add support for none and OAEP padded asymmetric key decryption. CW-Bug-Id: #18973 --- dlls/bcrypt/bcrypt_main.c | 5 -- dlls/bcrypt/gnutls.c | 146 +++++++++++++++++++++++++++++++++++++ dlls/bcrypt/tests/bcrypt.c | 6 +- 3 files changed, 149 insertions(+), 8 deletions(-) diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c index 24439dd3f6e2..248b25386669 100644 --- a/dlls/bcrypt/bcrypt_main.c +++ b/dlls/bcrypt/bcrypt_main.c @@ -2310,11 +2310,6 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp } else { - if (flags & BCRYPT_PAD_NONE) - { - FIXME( "flags %#lx not implemented\n", flags ); - return STATUS_NOT_IMPLEMENTED; - } if (!is_asymmetric_encryption_key( key )) return STATUS_NOT_SUPPORTED; params.key = key; diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c index fe044a95ca84..486513182890 100644 --- a/dlls/bcrypt/gnutls.c +++ b/dlls/bcrypt/gnutls.c @@ -269,9 +269,11 @@ static BOOL gcrypt_available; #if defined(HAVE_GCRYPT_H) && defined(SONAME_LIBGCRYPT) static void *libgcrypt_handle; +MAKE_FUNCPTR(gcry_control); MAKE_FUNCPTR(gcry_check_version); MAKE_FUNCPTR(gcry_sexp_build); MAKE_FUNCPTR(gcry_pk_encrypt); +MAKE_FUNCPTR(gcry_pk_decrypt); MAKE_FUNCPTR(gcry_mpi_new); MAKE_FUNCPTR(gcry_mpi_print); MAKE_FUNCPTR(gcry_sexp_release); @@ -555,9 +557,11 @@ static NTSTATUS gnutls_process_attach( void *args ) { gcrypt_available = TRUE; + LOAD_FUNCPTR(gcry_control); LOAD_FUNCPTR(gcry_check_version); LOAD_FUNCPTR(gcry_sexp_build); LOAD_FUNCPTR(gcry_pk_encrypt); + LOAD_FUNCPTR(gcry_pk_decrypt); LOAD_FUNCPTR(gcry_mpi_new); LOAD_FUNCPTR(gcry_mpi_print); LOAD_FUNCPTR(gcry_sexp_release); @@ -567,6 +571,12 @@ static NTSTATUS gnutls_process_attach( void *args ) LOAD_FUNCPTR(gcry_sexp_find_token); LOAD_FUNCPTR(gcry_sexp_nth_mpi); LOAD_FUNCPTR(gcry_sexp_nth_data); + + if (0) + { + pgcry_control(GCRYCTL_SET_VERBOSITY, 9); + pgcry_control(GCRYCTL_SET_DEBUG_FLAGS, ~0u); + } } else WARN("failed to load gcrypt, no support for ECC secret agreement\n"); @@ -2845,6 +2855,8 @@ static NTSTATUS privkey_set_rsa_oaep_params( gnutls_privkey_t key, gnutls_digest return STATUS_SUCCESS; } +static NTSTATUS key_asymmetric_decrypt_gcrypt( void *args ); + static NTSTATUS key_asymmetric_decrypt( void *args ) { const struct key_asymmetric_decrypt_params *params = args; @@ -2852,6 +2864,9 @@ static NTSTATUS key_asymmetric_decrypt( void *args ) NTSTATUS status = STATUS_SUCCESS; int ret; + if (gcrypt_available && (params->flags == BCRYPT_PAD_NONE || params->flags == BCRYPT_PAD_OAEP)) + return key_asymmetric_decrypt_gcrypt( args ); + if (params->key->alg_id == ALG_ID_RSA && params->flags & BCRYPT_PAD_OAEP) { BCRYPT_OAEP_PADDING_INFO *pad = params->padding; @@ -3066,12 +3081,143 @@ static NTSTATUS key_asymmetric_encrypt_gcrypt( void *args ) return STATUS_SUCCESS; } + +static NTSTATUS key_asymmetric_decrypt_gcrypt( void *args ) +{ + const struct key_asymmetric_encrypt_params *params = args; + gnutls_datum_t m, e, d, p, q, u, e1, e2; + struct key *key = params->key; + UCHAR *input = params->input; + ULONG input_len = params->input_len; + UCHAR *output = params->output; + ULONG *ret_len = params->ret_len; + void *padding = params->padding; + ULONG flags = params->flags; + BCRYPT_OAEP_PADDING_INFO *oaep_info = padding; + NTSTATUS status; + gcry_sexp_t sexp_privkey = NULL; + gcry_sexp_t sexp_result = NULL; + gcry_sexp_t sexp_input = NULL; + gnutls_datum_t result; + size_t result_len; + gcry_error_t err; + int ret; + + if (!gcrypt_available) + { + ERR( "Asymmetric decryption not available.\n" ); + return STATUS_INTERNAL_ERROR; + } + + if (key->alg_id != ALG_ID_RSA) + { + FIXME( "Unsupported algorithm id: %u\n", key->alg_id ); + return STATUS_INTERNAL_ERROR; + } + + if ((ret = pgnutls_privkey_export_rsa_raw( key_data(key)->a.privkey, &m, &e, &d, &p, &q, &u, &e1, &e2 ))) + { + pgnutls_perror( ret ); + return STATUS_INTERNAL_ERROR; + } + err = pgcry_sexp_build(&sexp_privkey, NULL, + "(private-key(rsa (e %b)(n %b)(d %b)))", + e.size, e.data, + m.size, m.data, + d.size, d.data); + free( m.data ); free( e.data ); free( d.data ); free( p.data ); free( q.data ); free( u.data ); + free( e1.data ); free( e2.data ); + + if (err) + { + ERR( "Failed to build gcrypt private key\n" ); + status = STATUS_INVALID_PARAMETER; + goto done; + } + + if (flags == BCRYPT_PAD_PKCS1) err = pgcry_sexp_build( &sexp_input, NULL, "(enc-val (flags pkcs1)(rsa (a %b)))", input_len, input ); + else if (flags == BCRYPT_PAD_OAEP) + { + if (oaep_info->pbLabel) + err = pgcry_sexp_build( &sexp_input, NULL, + "(enc-val (flags oaep)(hash-algo %s)(label %b)(rsa (a %b)))", + gcrypt_hash_algorithm_name(oaep_info->pszAlgId), + oaep_info->cbLabel, + oaep_info->pbLabel, + input_len, + input ); + else + err = pgcry_sexp_build( &sexp_input, NULL, + "(enc-val (flags oaep)(hash-algo %s)(rsa (a %b)))", + gcrypt_hash_algorithm_name(oaep_info->pszAlgId), + input_len, + input ); + } + else if (flags == BCRYPT_PAD_NONE) err = pgcry_sexp_build( &sexp_input, NULL, "(enc-val (flags raw)(rsa (a %b)))", input_len, input ); + else + { + status = STATUS_INVALID_PARAMETER; + goto done; + } + + if (err) + { + ERR( "Failed to build gcrypt padded input data\n" ); + status = STATUS_INVALID_PARAMETER; + goto done; + } + + if ((err = pgcry_pk_decrypt( &sexp_result, sexp_input, sexp_privkey ))) + { + ERR( "Failed to decrypt data\n" ); + status = STATUS_INVALID_PARAMETER; + goto done; + } + + result.data = (void *)pgcry_sexp_nth_data(sexp_result, 1, &result_len); + result.size = result_len; + if (flags == BCRYPT_PAD_NONE) result_len = EXPORT_SIZE(result, key->u.a.bitlen / 8, 1); + *ret_len = result_len; + + if (params->output_len >= result_len) + { + status = STATUS_SUCCESS; + if (flags == BCRYPT_PAD_NONE) + export_gnutls_datum(output, result_len, &result, 1); + else + memcpy(output, result.data, result_len); + } + else if (params->output_len == 0) status = STATUS_SUCCESS; + else status = STATUS_BUFFER_TOO_SMALL; + +done: + pgcry_sexp_release(sexp_input); + pgcry_sexp_release(sexp_privkey); + pgcry_sexp_release(sexp_result); + + if (status) return status; + + if (err) + { + ERR( "Error %s/%s\n", pgcry_strsource (err), pgcry_strerror (err) ); + return STATUS_INTERNAL_ERROR; + } + + return STATUS_SUCCESS; +} + #else static NTSTATUS key_asymmetric_encrypt_gcrypt( void *args ) { ERR("Asymmetric key encryption not supported without gcrypt.\n"); return STATUS_NOT_IMPLEMENTED; } + +static NTSTATUS key_asymmetric_decrypt_gcrypt( void *args ) +{ + ERR("Asymmetric key encryption not supported without gcrypt.\n"); + return STATUS_NOT_IMPLEMENTED; +} #endif static NTSTATUS key_asymmetric_encrypt( void *args ) diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c index a8a0b1e677c7..7c2964a78a0d 100644 --- a/dlls/bcrypt/tests/bcrypt.c +++ b/dlls/bcrypt/tests/bcrypt.c @@ -2503,17 +2503,17 @@ static void test_rsa_encrypt(void) ok(!memcmp(encrypted_a, encrypted_b, encrypted_size), "Both outputs should be the same\n"); ok(!memcmp(encrypted_b, rsa_encrypted_no_padding, encrypted_size), "Data mismatch.\n"); - todo_wine { decrypted_size = 0; ret = BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, NULL, 0, &decrypted_size, BCRYPT_PAD_NONE); ok(ret == STATUS_SUCCESS, "got %lx\n", ret); ok(decrypted_size == sizeof(input_no_padding), "got %lu\n", decrypted_size); + BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, decrypted, decrypted_size * 2, &decrypted_size, BCRYPT_PAD_NONE); + ok(!memcmp(decrypted, input_no_padding, sizeof(input_no_padding)), "Decrypted output it's not what expected\n"); ret = BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, decrypted, decrypted_size, &decrypted_size, BCRYPT_PAD_NONE); ok(ret == STATUS_SUCCESS, "got %lx\n", ret); ok(decrypted_size == sizeof(input_no_padding), "got %lu\n", decrypted_size); ok(!memcmp(decrypted, input_no_padding, sizeof(input_no_padding)), "unexpected output\n"); - } /* PKCS1 Padding */ encrypted_size = 0; @@ -2595,7 +2595,7 @@ static void test_rsa_encrypt(void) ok(ret == STATUS_SUCCESS, "got %lx\n", ret); ok(decrypted_size == sizeof(input), "got %lu\n", decrypted_size); - ret = BCryptDecrypt(key, encrypted_a, encrypted_size, &oaep_pad, NULL, 0, decrypted, decrypted_size, &decrypted_size, BCRYPT_PAD_OAEP); + ret = BCryptDecrypt(key, encrypted_a, encrypted_size, &oaep_pad, NULL, 0, decrypted, decrypted_size * 2, &decrypted_size, BCRYPT_PAD_OAEP); ok(ret == STATUS_SUCCESS, "got %lx\n", ret); ok(decrypted_size == sizeof(input), "got %lu\n", decrypted_size); ok(!memcmp(decrypted, input, sizeof(input)), "unexpected output\n"); From 9b09a0e40b47505b267525956707f6c9569ae476 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 2 Nov 2020 23:03:20 +0300 Subject: [PATCH 0592/2542] ntdll: Implement CPU topology override. --- dlls/ntdll/unix/server.c | 3 + dlls/ntdll/unix/system.c | 248 ++++++++++++++++++++++++++++++--- dlls/ntdll/unix/thread.c | 14 ++ dlls/ntdll/unix/unix_private.h | 1 + server/process.c | 30 ++++ server/process.h | 2 + server/protocol.def | 7 + server/thread.c | 30 +++- server/trace.c | 18 +++ 9 files changed, 330 insertions(+), 23 deletions(-) diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c index 59cc5b4056f6..a5f603c1bbdb 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c @@ -1670,6 +1670,7 @@ size_t server_init_process(void) */ void server_init_process_done(void) { + struct cpu_topology_override *cpu_override = get_cpu_topology_override(); void *teb; unsigned int status; int suspend; @@ -1694,6 +1695,8 @@ void server_init_process_done(void) /* Signal the parent process to continue */ SERVER_START_REQ( init_process_done ) { + if (cpu_override) + wine_server_add_data( req, cpu_override, sizeof(*cpu_override) ); req->teb = wine_server_client_ptr( teb ); req->peb = NtCurrentTeb64() ? NtCurrentTeb64()->Peb : wine_server_client_ptr( peb ); #ifdef __i386__ diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 13f37ee8a9ad..3efa8ef64ac5 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -257,6 +258,13 @@ static ULONG_PTR system_cpu_mask; static pthread_mutex_t timezone_mutex = PTHREAD_MUTEX_INITIALIZER; +static struct +{ + struct cpu_topology_override mapping; + ULONG_PTR siblings_mask[MAXIMUM_PROCESSORS]; +} +cpu_override; + /******************************************************************************* * Architecture specific feature detection for CPUs * @@ -673,6 +681,156 @@ static void get_cpuinfo( SYSTEM_CPU_INFORMATION *info ) #endif /* End architecture specific feature detection for CPUs */ +static void fill_performance_core_info(void); +static BOOL sysfs_parse_bitmap(const char *filename, ULONG_PTR *mask); + +static void fill_cpu_override(unsigned int host_cpu_count) +{ + const char *env_override = getenv("WINE_CPU_TOPOLOGY"); + BOOL smt = FALSE; + unsigned int i; + char *s; + + if (!env_override) + return; + + if (host_cpu_count > MAXIMUM_PROCESSORS) + { + FIXME( "%d CPUs reported, clamping to supported count %d.\n", host_cpu_count, MAXIMUM_PROCESSORS ); + host_cpu_count = MAXIMUM_PROCESSORS; + } + + cpu_override.mapping.cpu_count = strtol(env_override, &s, 10); + if (s == env_override) + goto error; + + if (!cpu_override.mapping.cpu_count || cpu_override.mapping.cpu_count > MAXIMUM_PROCESSORS) + { + ERR("Invalid logical CPU count %u, limit %u.\n", cpu_override.mapping.cpu_count, MAXIMUM_PROCESSORS); + goto error; + } + + if (!*s) + { + /* Auto assign given number of logical CPUs. */ + static const char core_info[] = "/sys/devices/system/cpu/cpu%u/topology/%s"; + char name[MAX_PATH]; + unsigned int attempt, count, j; + ULONG_PTR masks[MAXIMUM_PROCESSORS]; + + if (cpu_override.mapping.cpu_count >= host_cpu_count) + { + TRACE( "Override cpu count %u >= host cpu count %u.\n", cpu_override.mapping.cpu_count, host_cpu_count ); + cpu_override.mapping.cpu_count = 0; + return; + } + + fill_performance_core_info(); + + for (i = 0; i < host_cpu_count; ++i) + { + snprintf(name, sizeof(name), core_info, i, "thread_siblings"); + masks[i] = 0; + sysfs_parse_bitmap(name, &masks[i]); + } + for (attempt = 0; attempt < 3; ++attempt) + { + count = 0; + for (i = 0; i < host_cpu_count && count < cpu_override.mapping.cpu_count; ++i) + { + if (attempt < 2 && performance_cores_capacity) + { + if (i / 32 >= performance_cores_capacity) break; + if (!(performance_cores[i / 32] & (1 << (i % 32)))) goto skip_cpu; + } + cpu_override.mapping.host_cpu_id[count] = i; + cpu_override.siblings_mask[count] = (ULONG_PTR)1 << count; + for (j = 0; j < count; ++j) + { + if (!(masks[cpu_override.mapping.host_cpu_id[j]] & masks[i])) continue; + if (attempt < 1) goto skip_cpu; + cpu_override.siblings_mask[j] |= (ULONG_PTR)1 << count; + cpu_override.siblings_mask[count] |= (ULONG_PTR)1 << j; + } + ++count; +skip_cpu: + ; + } + if (count == cpu_override.mapping.cpu_count) break; + } + assert( count == cpu_override.mapping.cpu_count ); + goto done; + } + + if (tolower(*s) == 's') + { + cpu_override.mapping.cpu_count *= 2; + if (cpu_override.mapping.cpu_count > MAXIMUM_PROCESSORS) + { + ERR("Logical CPU count exceeds limit %u.\n", MAXIMUM_PROCESSORS); + goto error; + } + smt = TRUE; + ++s; + } + if (*s != ':') + goto error; + ++s; + for (i = 0; i < cpu_override.mapping.cpu_count; ++i) + { + char *next; + + if (i) + { + if (*s != ',') + { + if (!*s) + ERR("Incomplete host CPU mapping string, %u CPUs mapping required.\n", + cpu_override.mapping.cpu_count); + goto error; + } + ++s; + } + + cpu_override.mapping.host_cpu_id[i] = strtol(s, &next, 10); + if (smt) cpu_override.siblings_mask[i] = (ULONG_PTR)3 << (i & ~1); + else cpu_override.siblings_mask[i] = (ULONG_PTR)1 << i; + if (next == s) + goto error; + if (cpu_override.mapping.host_cpu_id[i] >= host_cpu_count) + { + ERR("Invalid host CPU index %u (host_cpu_count %u).\n", + cpu_override.mapping.host_cpu_id[i], host_cpu_count); + goto error; + } + s = next; + } + if (*s) + goto error; + +done: + if (ERR_ON(ntdll)) + { + MESSAGE("wine: overriding CPU configuration, %u logical CPUs, host CPUs ", cpu_override.mapping.cpu_count); + for (i = 0; i < cpu_override.mapping.cpu_count; ++i) + { + if (i) + MESSAGE(","); + MESSAGE("%u", cpu_override.mapping.host_cpu_id[i]); + } + MESSAGE(".\n"); + } + return; +error: + cpu_override.mapping.cpu_count = 0; + ERR("Invalid WINE_CPU_TOPOLOGY string %s (%s).\n", debugstr_a(env_override), debugstr_a(s)); +} + +struct cpu_topology_override *get_cpu_topology_override(void) +{ + return cpu_override.mapping.cpu_count ? &cpu_override.mapping : NULL; +} + static BOOL grow_logical_proc_buf(void) { SYSTEM_LOGICAL_PROCESSOR_INFORMATION *new_data; @@ -724,6 +882,7 @@ static DWORD count_bits( ULONG_PTR mask ) static BOOL logical_proc_info_ex_add_by_id( LOGICAL_PROCESSOR_RELATIONSHIP rel, DWORD id, ULONG_PTR mask ) { SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *dataex; + unsigned int phys_cpu_id; unsigned int ofs = 0; while (ofs < logical_proc_info_ex_size) @@ -753,8 +912,10 @@ static BOOL logical_proc_info_ex_add_by_id( LOGICAL_PROCESSOR_RELATIONSHIP rel, dataex->Processor.Flags = count_bits( mask ) > 1 ? LTP_PC_SMT : 0; else dataex->Processor.Flags = 0; - if (rel == RelationProcessorCore && id / 32 < performance_cores_capacity) - dataex->Processor.EfficiencyClass = (performance_cores[id / 32] >> (id % 32)) & 1; + + phys_cpu_id = cpu_override.mapping.cpu_count ? cpu_override.mapping.host_cpu_id[id] : id; + if (rel == RelationProcessorCore && phys_cpu_id / 32 < performance_cores_capacity) + dataex->Processor.EfficiencyClass = (performance_cores[phys_cpu_id / 32] >> (phys_cpu_id % 32)) & 1; else dataex->Processor.EfficiencyClass = 0; dataex->Processor.GroupCount = 1; @@ -967,6 +1128,8 @@ static void fill_performance_core_info(void) char op = ','; ULONG *p; + if (performance_cores_capacity) return; + fpcore_list = fopen("/sys/devices/cpu_core/cpus", "r"); if (!fpcore_list) return; @@ -1003,11 +1166,13 @@ static NTSTATUS create_logical_proc_info(void) static const char core_info[] = "/sys/devices/system/cpu/cpu%u/topology/%s"; static const char cache_info[] = "/sys/devices/system/cpu/cpu%u/cache/index%u/%s"; static const char numa_info[] = "/sys/devices/system/node/node%u/cpumap"; - + const char *env_fake_logical_cores = getenv("WINE_LOGICAL_CPUS_AS_CORES"); + BOOL fake_logical_cpus_as_cores = env_fake_logical_cores && atoi(env_fake_logical_cores); FILE *fcpu_list, *fnuma_list, *f; unsigned int beg, end, i, j, r, num_cpus = 0, max_cpus = 0; char op, name[MAX_PATH]; ULONG_PTR all_cpus_mask = 0; + unsigned int cpu_id; /* On systems with a large number of CPU cores (32 or 64 depending on 32-bit or 64-bit), * we have issues parsing processor information: @@ -1034,6 +1199,12 @@ static NTSTATUS create_logical_proc_info(void) if (op == '-') fscanf(fcpu_list, "%u%c ", &end, &op); else end = beg; + if (cpu_override.mapping.cpu_count) + { + beg = 0; + end = cpu_override.mapping.cpu_count - 1; + } + for(i = beg; i <= end; i++) { unsigned int phys_core = 0; @@ -1041,7 +1212,7 @@ static NTSTATUS create_logical_proc_info(void) if (i > 8 * sizeof(ULONG_PTR)) break; - snprintf(name, sizeof(name), core_info, i, "physical_package_id"); + snprintf(name, sizeof(name), core_info, cpu_override.mapping.cpu_count ? cpu_override.mapping.host_cpu_id[i] : i, "physical_package_id"); f = fopen(name, "r"); if (f) { @@ -1068,19 +1239,34 @@ static NTSTATUS create_logical_proc_info(void) /* Mask of logical threads sharing same physical core in kernel core numbering. */ snprintf(name, sizeof(name), core_info, i, "thread_siblings"); - if(!sysfs_parse_bitmap(name, &thread_mask)) thread_mask = 1<NumberOfProcessors = cpu_info.MaximumProcessors = num; + + fill_cpu_override(num); + + peb->NumberOfProcessors = cpu_info.MaximumProcessors = cpu_override.mapping.cpu_count + ? cpu_override.mapping.cpu_count : num; get_cpuinfo( &cpu_info ); TRACE( "<- CPU arch %d, level %d, rev %d, features 0x%x\n", (int)cpu_info.ProcessorArchitecture, (int)cpu_info.ProcessorLevel, diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index e20658a56f8f..c5c0b9f3302a 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -2565,6 +2565,20 @@ ULONG WINAPI NtGetCurrentProcessorNumber(void) #if defined(HAVE_SCHED_GETCPU) int res = sched_getcpu(); + if (res != -1) + { + struct cpu_topology_override *override = get_cpu_topology_override(); + unsigned int i; + + if (!override) + return res; + + for (i = 0; i < override->cpu_count; ++i) + if (override->host_cpu_id[i] == res) + return i; + + WARN("Thread is running on processor which is not in the defined override.\n"); + } if (res >= 0) return res; #elif defined(__APPLE__) && (defined(__x86_64__) || defined(__i386__)) struct { diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 8f463c7fe917..6cfb871f8593 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -371,6 +371,7 @@ extern void file_complete_async( HANDLE handle, unsigned int options, HANDLE eve IO_STATUS_BLOCK *io, NTSTATUS status, ULONG_PTR information ); extern void set_async_direct_result( HANDLE *async_handle, unsigned int options, IO_STATUS_BLOCK *io, NTSTATUS status, ULONG_PTR information, BOOL mark_pending ); +extern struct cpu_topology_override *get_cpu_topology_override(void); extern NTSTATUS unixcall_wine_dbg_write( void *args ); extern NTSTATUS unixcall_wine_server_call( void *args ); diff --git a/server/process.c b/server/process.c index d59fdc8c0eab..d350948d9999 100644 --- a/server/process.c +++ b/server/process.c @@ -100,6 +100,7 @@ static void process_destroy( struct object *obj ); static int process_get_esync_fd( struct object *obj, enum esync_type *type ); static unsigned int process_get_fsync_idx( struct object *obj, enum fsync_type *type ); static void terminate_process( struct process *process, struct thread *skip, int exit_code ); +static void set_process_affinity( struct process *process, affinity_t affinity ); static const struct object_ops process_ops = { @@ -697,6 +698,7 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla memset( &process->image_info, 0, sizeof(process->image_info) ); process->esync_fd = -1; process->fsync_idx = 0; + process->cpu_override.cpu_count = 0; list_init( &process->rawinput_entry ); list_init( &process->kernel_object ); list_init( &process->thread_list ); @@ -1453,6 +1455,26 @@ DECL_HANDLER(get_startup_info) DECL_HANDLER(init_process_done) { struct process *process = current->process; + const struct cpu_topology_override *cpu_override = get_req_data(); + unsigned int have_cpu_override = get_req_data_size() / sizeof(*cpu_override); + unsigned int i; + + if (have_cpu_override) + { + if (cpu_override->cpu_count > ARRAY_SIZE(process->wine_cpu_id_from_host)) + { + set_error( STATUS_INVALID_PARAMETER ); + return; + } + for (i = 0; i < cpu_override->cpu_count; ++i) + { + if (cpu_override->host_cpu_id[i] >= ARRAY_SIZE(process->wine_cpu_id_from_host)) + { + set_error( STATUS_INVALID_PARAMETER ); + return; + } + } + } if (is_process_init_done(process)) { @@ -1474,6 +1496,14 @@ DECL_HANDLER(init_process_done) process->idle_event = create_event( NULL, NULL, 0, 1, 0, NULL ); if (process->debug_obj) set_process_debug_flag( process, 1 ); reply->suspend = (current->suspend || process->suspend); + + if (have_cpu_override) + { + process->cpu_override = *cpu_override; + memset( process->wine_cpu_id_from_host, 0, sizeof(process->wine_cpu_id_from_host) ); + for (i = 0; i < process->cpu_override.cpu_count; ++i) + process->wine_cpu_id_from_host[process->cpu_override.host_cpu_id[i]] = i; + } } /* open a handle to a process */ diff --git a/server/process.h b/server/process.h index c6de4a3cda33..d2aadd521e8e 100644 --- a/server/process.h +++ b/server/process.h @@ -88,6 +88,8 @@ struct process struct pe_image_info image_info; /* main exe image info */ int esync_fd; /* esync file descriptor (signaled on exit) */ unsigned int fsync_idx; + struct cpu_topology_override cpu_override; /* Overridden CPUs to host CPUs mapping. */ + unsigned char wine_cpu_id_from_host[64]; /* Host to overridden CPU mapping. */ }; /* process functions */ diff --git a/server/protocol.def b/server/protocol.def index 7751a75c42ba..6f7a2e559d99 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -966,6 +966,12 @@ union udp_endpoint /****************************************************************/ /* shared session mapping structures */ +struct cpu_topology_override +{ + unsigned int cpu_count; + unsigned char host_cpu_id[64]; +}; + struct shared_cursor { int x; /* cursor position */ @@ -1091,6 +1097,7 @@ struct obj_locator client_ptr_t teb; /* TEB of new thread (in process address space) */ client_ptr_t peb; /* PEB of new process (in process address space) */ client_ptr_t ldt_copy; /* address of LDT copy (in process address space) */ + VARARG(cpu_override,cpu_topology_override); /* Overridden CPUs to host CPUs mapping. */ @REPLY int suspend; /* is process suspended? */ @END diff --git a/server/thread.c b/server/thread.c index 5a642870ab20..aae704df61ea 100644 --- a/server/thread.c +++ b/server/thread.c @@ -675,8 +675,19 @@ int set_thread_affinity( struct thread *thread, affinity_t affinity ) CPU_ZERO( &set ); for (i = 0, mask = 1; mask; i++, mask <<= 1) - if (affinity & mask) CPU_SET( i, &set ); - + if (affinity & mask) + { + if (thread->process->cpu_override.cpu_count) + { + if (i >= thread->process->cpu_override.cpu_count) + break; + CPU_SET( thread->process->cpu_override.host_cpu_id[i], &set ); + } + else + { + CPU_SET( i, &set ); + } + } ret = sched_setaffinity( thread->unix_tid, sizeof(set), &set ); } #endif @@ -694,8 +705,21 @@ affinity_t get_thread_affinity( struct thread *thread ) unsigned int i; if (!sched_getaffinity( thread->unix_tid, sizeof(set), &set )) + { for (i = 0; i < 8 * sizeof(mask); i++) - if (CPU_ISSET( i, &set )) mask |= (affinity_t)1 << i; + if (CPU_ISSET( i, &set )) + { + if (thread->process->cpu_override.cpu_count) + { + if (i < ARRAY_SIZE(thread->process->wine_cpu_id_from_host)) + mask |= (affinity_t)1 << thread->process->wine_cpu_id_from_host[i]; + } + else + { + mask |= (affinity_t)1 << i; + } + } + } } #endif if (!mask) mask = ~(affinity_t)0; diff --git a/server/trace.c b/server/trace.c index 77a91435b555..bdf7cd7c26cb 100644 --- a/server/trace.c +++ b/server/trace.c @@ -1421,6 +1421,24 @@ static void dump_varargs_handle_infos( const char *prefix, data_size_t size ) fputc( '}', stderr ); } +static void dump_varargs_cpu_topology_override( const char *prefix, data_size_t size ) +{ + const struct cpu_topology_override *cpu_topology = cur_data; + unsigned int i; + + if (size < sizeof(*cpu_topology)) + return; + + fprintf( stderr,"%s{", prefix ); + for (i = 0; i < cpu_topology->cpu_count; ++i) + { + if (i) fputc( ',', stderr ); + fprintf( stderr, "%u", cpu_topology->host_cpu_id[i] ); + } + fputc( '}', stderr ); + remove_data( size ); +} + static void dump_varargs_tcp_connections( const char *prefix, data_size_t size ) { static const char * const state_names[] = { From a1d1e5097639a47969fa4cfc81e21a5b7a5bad96 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Mon, 31 Jan 2022 10:57:51 -0600 Subject: [PATCH 0593/2542] mmdevapi: Force PCM format for DeviceFormat property Native xaudio2 returns this format directly from GetDeviceDetails. Far Cry 4 expects to get a PCM format from GetDeviceDetails, so we need to set it to PCM here. --- dlls/mmdevapi/devenum.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dlls/mmdevapi/devenum.c b/dlls/mmdevapi/devenum.c index b1993573dd9f..c32e85ea5e8c 100644 --- a/dlls/mmdevapi/devenum.c +++ b/dlls/mmdevapi/devenum.c @@ -516,6 +516,7 @@ static HRESULT set_format(MMDevice *dev) HRESULT hr; IAudioClient *client; WAVEFORMATEX *fmt; + WAVEFORMATEXTENSIBLE *fmtex; PROPVARIANT pv = { VT_EMPTY }; hr = AudioClient_Create(&dev->devguid, &dev->IMMDevice_iface, &client); @@ -530,6 +531,24 @@ static HRESULT set_format(MMDevice *dev) IAudioClient_Release(client); + /* for most devices, native Windows only allows PCM formats for + * DeviceFormat. GetMixFormat often returns float. */ + if(fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE){ + fmtex = (WAVEFORMATEXTENSIBLE *)fmt; + if(IsEqualGUID(&fmtex->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT)){ + fmt->wBitsPerSample = 16; + fmt->nBlockAlign = fmt->wBitsPerSample * fmt->nChannels / 8; + fmt->nAvgBytesPerSec = fmt->nSamplesPerSec * fmt->nBlockAlign; + fmtex->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + fmtex->Samples.wValidBitsPerSample = fmt->wBitsPerSample; + } + }else if(fmt->wFormatTag == WAVE_FORMAT_IEEE_FLOAT){ + fmt->wFormatTag = WAVE_FORMAT_PCM; + fmt->wBitsPerSample = 16; + fmt->nBlockAlign = fmt->wBitsPerSample * fmt->nChannels / 8; + fmt->nAvgBytesPerSec = fmt->nSamplesPerSec * fmt->nBlockAlign; + } + pv.vt = VT_BLOB; pv.blob.cbSize = sizeof(WAVEFORMATEX) + fmt->cbSize; pv.blob.pBlobData = (BYTE*)fmt; From 58f071184dfe887f9e5464400f00a633ab186462 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Tue, 28 Dec 2021 12:05:22 -0600 Subject: [PATCH 0594/2542] xaudio2: Prefer native This should be safe now on 64-bit due to the top-down allocation patches. --- dlls/x3daudio1_0/Makefile.in | 2 ++ dlls/x3daudio1_1/Makefile.in | 2 ++ dlls/x3daudio1_2/Makefile.in | 2 ++ dlls/x3daudio1_3/Makefile.in | 2 ++ dlls/x3daudio1_4/Makefile.in | 2 ++ dlls/x3daudio1_5/Makefile.in | 2 ++ dlls/x3daudio1_6/Makefile.in | 2 ++ dlls/x3daudio1_7/Makefile.in | 2 ++ dlls/xactengine2_0/Makefile.in | 2 ++ dlls/xactengine2_4/Makefile.in | 2 ++ dlls/xactengine2_7/Makefile.in | 2 ++ dlls/xactengine2_9/Makefile.in | 2 ++ dlls/xactengine3_0/Makefile.in | 2 ++ dlls/xactengine3_1/Makefile.in | 2 ++ dlls/xactengine3_2/Makefile.in | 2 ++ dlls/xactengine3_3/Makefile.in | 2 ++ dlls/xactengine3_4/Makefile.in | 2 ++ dlls/xactengine3_5/Makefile.in | 2 ++ dlls/xactengine3_6/Makefile.in | 2 ++ dlls/xactengine3_7/Makefile.in | 2 ++ dlls/xapofx1_1/Makefile.in | 2 ++ dlls/xapofx1_2/Makefile.in | 2 ++ dlls/xapofx1_3/Makefile.in | 2 ++ dlls/xapofx1_4/Makefile.in | 2 ++ dlls/xapofx1_5/Makefile.in | 2 ++ dlls/xaudio2_0/Makefile.in | 2 ++ dlls/xaudio2_1/Makefile.in | 2 ++ dlls/xaudio2_2/Makefile.in | 2 ++ dlls/xaudio2_3/Makefile.in | 2 ++ dlls/xaudio2_4/Makefile.in | 2 ++ dlls/xaudio2_5/Makefile.in | 2 ++ dlls/xaudio2_6/Makefile.in | 2 ++ dlls/xaudio2_7/Makefile.in | 2 ++ dlls/xaudio2_8/Makefile.in | 2 ++ dlls/xaudio2_9/Makefile.in | 2 ++ 35 files changed, 70 insertions(+) diff --git a/dlls/x3daudio1_0/Makefile.in b/dlls/x3daudio1_0/Makefile.in index d3c2cbe67438..ab5af4ac64c3 100644 --- a/dlls/x3daudio1_0/Makefile.in +++ b/dlls/x3daudio1_0/Makefile.in @@ -4,5 +4,7 @@ PARENTSRC = ../xaudio2_7 IMPORTS = $(FAUDIO_PE_LIBS) EXTRAINCL = $(FAUDIO_PE_CFLAGS) +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c diff --git a/dlls/x3daudio1_1/Makefile.in b/dlls/x3daudio1_1/Makefile.in index 8dfccce11d81..6b25e3909d48 100644 --- a/dlls/x3daudio1_1/Makefile.in +++ b/dlls/x3daudio1_1/Makefile.in @@ -4,5 +4,7 @@ PARENTSRC = ../xaudio2_7 IMPORTS = $(FAUDIO_PE_LIBS) EXTRAINCL = $(FAUDIO_PE_CFLAGS) +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c diff --git a/dlls/x3daudio1_2/Makefile.in b/dlls/x3daudio1_2/Makefile.in index 699aac41317a..150028ad4346 100644 --- a/dlls/x3daudio1_2/Makefile.in +++ b/dlls/x3daudio1_2/Makefile.in @@ -4,5 +4,7 @@ PARENTSRC = ../xaudio2_7 IMPORTS = $(FAUDIO_PE_LIBS) EXTRAINCL = $(FAUDIO_PE_CFLAGS) +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c diff --git a/dlls/x3daudio1_3/Makefile.in b/dlls/x3daudio1_3/Makefile.in index 093fe1180895..c87c19da4798 100644 --- a/dlls/x3daudio1_3/Makefile.in +++ b/dlls/x3daudio1_3/Makefile.in @@ -4,5 +4,7 @@ PARENTSRC = ../xaudio2_7 IMPORTS = $(FAUDIO_PE_LIBS) EXTRAINCL = $(FAUDIO_PE_CFLAGS) +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c diff --git a/dlls/x3daudio1_4/Makefile.in b/dlls/x3daudio1_4/Makefile.in index c67d6535a4da..a3319b81c87c 100644 --- a/dlls/x3daudio1_4/Makefile.in +++ b/dlls/x3daudio1_4/Makefile.in @@ -4,5 +4,7 @@ PARENTSRC = ../xaudio2_7 IMPORTS = $(FAUDIO_PE_LIBS) EXTRAINCL = $(FAUDIO_PE_CFLAGS) +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c diff --git a/dlls/x3daudio1_5/Makefile.in b/dlls/x3daudio1_5/Makefile.in index 471e2c6b0525..3b548bf95485 100644 --- a/dlls/x3daudio1_5/Makefile.in +++ b/dlls/x3daudio1_5/Makefile.in @@ -4,5 +4,7 @@ PARENTSRC = ../xaudio2_7 IMPORTS = $(FAUDIO_PE_LIBS) EXTRAINCL = $(FAUDIO_PE_CFLAGS) +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c diff --git a/dlls/x3daudio1_6/Makefile.in b/dlls/x3daudio1_6/Makefile.in index 7fb6f0527291..956c36912043 100644 --- a/dlls/x3daudio1_6/Makefile.in +++ b/dlls/x3daudio1_6/Makefile.in @@ -4,5 +4,7 @@ PARENTSRC = ../xaudio2_7 IMPORTS = $(FAUDIO_PE_LIBS) EXTRAINCL = $(FAUDIO_PE_CFLAGS) +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c diff --git a/dlls/x3daudio1_7/Makefile.in b/dlls/x3daudio1_7/Makefile.in index fd22a260f07d..b906e9146a59 100644 --- a/dlls/x3daudio1_7/Makefile.in +++ b/dlls/x3daudio1_7/Makefile.in @@ -4,5 +4,7 @@ PARENTSRC = ../xaudio2_7 IMPORTS = $(FAUDIO_PE_LIBS) EXTRAINCL = $(FAUDIO_PE_CFLAGS) +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c diff --git a/dlls/xactengine2_0/Makefile.in b/dlls/xactengine2_0/Makefile.in index 2064afadc3db..ea57370f9785 100644 --- a/dlls/xactengine2_0/Makefile.in +++ b/dlls/xactengine2_0/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0200 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine2_4/Makefile.in b/dlls/xactengine2_4/Makefile.in index b61774d66937..4771318e118c 100644 --- a/dlls/xactengine2_4/Makefile.in +++ b/dlls/xactengine2_4/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0204 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine2_7/Makefile.in b/dlls/xactengine2_7/Makefile.in index bd91161fd2cb..faae6a20d47d 100644 --- a/dlls/xactengine2_7/Makefile.in +++ b/dlls/xactengine2_7/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0207 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine2_9/Makefile.in b/dlls/xactengine2_9/Makefile.in index 10e0578a82c5..016efa9c76f9 100644 --- a/dlls/xactengine2_9/Makefile.in +++ b/dlls/xactengine2_9/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0209 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine3_0/Makefile.in b/dlls/xactengine3_0/Makefile.in index b944a7d5a7af..a52a282fdf2e 100644 --- a/dlls/xactengine3_0/Makefile.in +++ b/dlls/xactengine3_0/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0300 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine3_1/Makefile.in b/dlls/xactengine3_1/Makefile.in index 410ac6ce4f25..6f2466d7f254 100644 --- a/dlls/xactengine3_1/Makefile.in +++ b/dlls/xactengine3_1/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0301 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine3_2/Makefile.in b/dlls/xactengine3_2/Makefile.in index 32d855dd2c3a..70c3491ce4a1 100644 --- a/dlls/xactengine3_2/Makefile.in +++ b/dlls/xactengine3_2/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0302 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine3_3/Makefile.in b/dlls/xactengine3_3/Makefile.in index 650b577a16cd..47795dcdf61a 100644 --- a/dlls/xactengine3_3/Makefile.in +++ b/dlls/xactengine3_3/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0303 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine3_4/Makefile.in b/dlls/xactengine3_4/Makefile.in index 1fad4f2f4c48..fa459af88ca8 100644 --- a/dlls/xactengine3_4/Makefile.in +++ b/dlls/xactengine3_4/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0304 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine3_5/Makefile.in b/dlls/xactengine3_5/Makefile.in index 1e74124da750..bb1a25e9ca02 100644 --- a/dlls/xactengine3_5/Makefile.in +++ b/dlls/xactengine3_5/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0305 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine3_6/Makefile.in b/dlls/xactengine3_6/Makefile.in index 12861dbfad90..3bc687144611 100644 --- a/dlls/xactengine3_6/Makefile.in +++ b/dlls/xactengine3_6/Makefile.in @@ -4,6 +4,8 @@ EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0306 PARENTSRC = ../xactengine3_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xactengine3_7/Makefile.in b/dlls/xactengine3_7/Makefile.in index e9b815b9b6ad..8883b860c1c3 100644 --- a/dlls/xactengine3_7/Makefile.in +++ b/dlls/xactengine3_7/Makefile.in @@ -3,6 +3,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) ole32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) EXTRADEFS = -DXACT3_VER=0x0307 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xact_classes.idl \ xact_dll.c diff --git a/dlls/xapofx1_1/Makefile.in b/dlls/xapofx1_1/Makefile.in index 81e2e5ae95bb..19ca4c103b3f 100644 --- a/dlls/xapofx1_1/Makefile.in +++ b/dlls/xapofx1_1/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) ole32 EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ version.rc \ xapo.c \ diff --git a/dlls/xapofx1_2/Makefile.in b/dlls/xapofx1_2/Makefile.in index 635341424600..88532c05aa42 100644 --- a/dlls/xapofx1_2/Makefile.in +++ b/dlls/xapofx1_2/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) ole32 EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xapofx.c \ diff --git a/dlls/xapofx1_3/Makefile.in b/dlls/xapofx1_3/Makefile.in index e0c2a17f9e2f..49223bf95049 100644 --- a/dlls/xapofx1_3/Makefile.in +++ b/dlls/xapofx1_3/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) ole32 EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ version.rc \ xapo.c \ diff --git a/dlls/xapofx1_4/Makefile.in b/dlls/xapofx1_4/Makefile.in index 43dde8f047e7..19881955d1c5 100644 --- a/dlls/xapofx1_4/Makefile.in +++ b/dlls/xapofx1_4/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) ole32 EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xapofx.c \ diff --git a/dlls/xapofx1_5/Makefile.in b/dlls/xapofx1_5/Makefile.in index fb5342866268..d3586b26d34a 100644 --- a/dlls/xapofx1_5/Makefile.in +++ b/dlls/xapofx1_5/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) ole32 EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xapofx.c \ diff --git a/dlls/xaudio2_0/Makefile.in b/dlls/xaudio2_0/Makefile.in index 64a0efd39253..b7b969445df3 100644 --- a/dlls/xaudio2_0/Makefile.in +++ b/dlls/xaudio2_0/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xaudio_allocator.c \ diff --git a/dlls/xaudio2_1/Makefile.in b/dlls/xaudio2_1/Makefile.in index ebfe545f31e1..0b5a7c148b06 100644 --- a/dlls/xaudio2_1/Makefile.in +++ b/dlls/xaudio2_1/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xaudio_allocator.c \ diff --git a/dlls/xaudio2_2/Makefile.in b/dlls/xaudio2_2/Makefile.in index 3bc76019affa..7daefa0d1d7b 100644 --- a/dlls/xaudio2_2/Makefile.in +++ b/dlls/xaudio2_2/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xaudio_allocator.c \ diff --git a/dlls/xaudio2_3/Makefile.in b/dlls/xaudio2_3/Makefile.in index dec87cf0bcdc..bbb5796f3fc9 100644 --- a/dlls/xaudio2_3/Makefile.in +++ b/dlls/xaudio2_3/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xaudio_allocator.c \ diff --git a/dlls/xaudio2_4/Makefile.in b/dlls/xaudio2_4/Makefile.in index 37c0a361a7ab..4ceba7d71451 100644 --- a/dlls/xaudio2_4/Makefile.in +++ b/dlls/xaudio2_4/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xaudio_allocator.c \ diff --git a/dlls/xaudio2_5/Makefile.in b/dlls/xaudio2_5/Makefile.in index 75ec4a32d4ec..39bc137f5a3e 100644 --- a/dlls/xaudio2_5/Makefile.in +++ b/dlls/xaudio2_5/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xaudio_allocator.c \ diff --git a/dlls/xaudio2_6/Makefile.in b/dlls/xaudio2_6/Makefile.in index ba84d189fc43..5cbb89528e01 100644 --- a/dlls/xaudio2_6/Makefile.in +++ b/dlls/xaudio2_6/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ xapo.c \ xaudio_allocator.c \ diff --git a/dlls/xaudio2_7/Makefile.in b/dlls/xaudio2_7/Makefile.in index 0d88bfe6dd34..f219420bda2a 100644 --- a/dlls/xaudio2_7/Makefile.in +++ b/dlls/xaudio2_7/Makefile.in @@ -3,6 +3,8 @@ MODULE = xaudio2_7.dll IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c \ xapo.c \ diff --git a/dlls/xaudio2_8/Makefile.in b/dlls/xaudio2_8/Makefile.in index b5406fe7fd04..f4a15960e2e7 100644 --- a/dlls/xaudio2_8/Makefile.in +++ b/dlls/xaudio2_8/Makefile.in @@ -5,6 +5,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ x3daudio.c \ xapo.c \ diff --git a/dlls/xaudio2_9/Makefile.in b/dlls/xaudio2_9/Makefile.in index 1db3ea4e9c0c..9dd1795006b0 100644 --- a/dlls/xaudio2_9/Makefile.in +++ b/dlls/xaudio2_9/Makefile.in @@ -4,6 +4,8 @@ IMPORTS = $(FAUDIO_PE_LIBS) advapi32 ole32 user32 uuid EXTRAINCL = $(FAUDIO_PE_CFLAGS) PARENTSRC = ../xaudio2_7 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ version.rc \ x3daudio.c \ From 7da827e774910844f17078404d9c892f63dec3c4 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 13 Jul 2020 10:21:49 -0500 Subject: [PATCH 0595/2542] ntdll: Handle NULL object name buffer in nt_to_unix_file_name_attr(). CW-Bug-Id: #17864 --- dlls/ntdll/tests/file.c | 22 +++++++++++++++++++++- dlls/ntdll/unix/file.c | 5 ++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 02bdf67796db..08673af0444e 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -147,16 +147,36 @@ static void create_file_test(void) static const WCHAR pathInvalidDosW[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\',0}; static const char testdata[] = "Hello World"; FILE_NETWORK_OPEN_INFORMATION info; + UNICODE_STRING nameW, null_string; NTSTATUS status; HANDLE dir, file; WCHAR path[MAX_PATH]; OBJECT_ATTRIBUTES attr; IO_STATUS_BLOCK io; - UNICODE_STRING nameW; LARGE_INTEGER offset; char buf[32]; DWORD ret; + attr.Length = sizeof(attr); + attr.RootDirectory = NULL; + attr.ObjectName = &null_string; + attr.Attributes = 0; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + null_string.Buffer = NULL; + null_string.Length = 256; + + /* try various open modes and options on directories */ + status = pNtCreateFile( &dir, GENERIC_READ|GENERIC_WRITE, &attr, &io, NULL, 0, + FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, FILE_DIRECTORY_FILE, NULL, 0 ); + ok( status == STATUS_ACCESS_VIOLATION, "Got unexpected status %#x.\n", status ); + + null_string.Length = 0; + status = pNtCreateFile( &dir, GENERIC_READ|GENERIC_WRITE, &attr, &io, NULL, 0, + FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, FILE_DIRECTORY_FILE, NULL, 0 ); + ok( status == STATUS_OBJECT_PATH_SYNTAX_BAD, "Got unexpected status %#x.\n", status ); + GetCurrentDirectoryW( MAX_PATH, path ); pRtlDosPathNameToNtPathName_U( path, &nameW, NULL, NULL ); attr.Length = sizeof(attr); diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index c3ccb3d4d302..244362073d57 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -3646,7 +3646,7 @@ static NTSTATUS nt_to_unix_file_name_no_root( const UNICODE_STRING *nameW, char name = nameW->Buffer; name_len = nameW->Length / sizeof(WCHAR); - if (!name_len || name[0] != '\\') return STATUS_OBJECT_PATH_SYNTAX_BAD; + if (!name || !name_len || name[0] != '\\') return STATUS_OBJECT_PATH_SYNTAX_BAD; if (!(pos = get_dos_prefix_len( nameW ))) return STATUS_BAD_DEVICE_TYPE; /* no DOS prefix, assume NT native name */ @@ -3757,6 +3757,9 @@ NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name_ret, U int name_len, unix_len; NTSTATUS status; + if (!attr->ObjectName->Buffer && attr->ObjectName->Length) + return STATUS_ACCESS_VIOLATION; + if (!attr->RootDirectory) /* without root dir fall back to normal lookup */ return nt_to_unix_file_name_no_root( attr->ObjectName, name_ret, disposition ); From d12ad63283edd49ffe70c1db7d4622702e865672 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Sat, 22 May 2021 01:23:33 +0300 Subject: [PATCH 0596/2542] server: Update system regs from set_thread_context handler only. CW-Bug-Id: #18957 --- server/thread.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/thread.c b/server/thread.c index aae704df61ea..ffbb04969495 100644 --- a/server/thread.c +++ b/server/thread.c @@ -1869,9 +1869,7 @@ DECL_HANDLER(select) { union apc_call *data; data_size_t size = sizeof(*data) + (ctx->regs[CTX_WOW].flags ? 2 : 1) * sizeof(struct context_data); - unsigned int flags = system_flags & ctx->regs[CTX_NATIVE].flags; - if (flags) set_thread_context( current, &ctx->regs[CTX_NATIVE], flags ); size = min( size, get_reply_max_size() ); if ((data = set_reply_data_size( size ))) { @@ -2117,7 +2115,7 @@ DECL_HANDLER(set_thread_context) unsigned int flags = system_flags & contexts[CTX_NATIVE].flags; if (thread != current) stop_thread( thread ); - else if (flags) set_thread_context( thread, &contexts[CTX_NATIVE], flags ); + if (flags) set_thread_context( thread, &contexts[CTX_NATIVE], flags ); if (thread->context && !get_error()) { From 06bacde7a47a7b4f31f1d71a9b9ebd508b3f0721 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 24 May 2021 14:37:35 +0300 Subject: [PATCH 0597/2542] ntdll: Update cached debug registers in call_init_thunk(). CW-Bug-Id: #18957 --- dlls/ntdll/unix/signal_i386.c | 9 +++++++++ dlls/ntdll/unix/signal_x86_64.c | 14 +++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index a4345a5b5893..eba05d1a9582 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -2536,6 +2536,15 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB { context.ContextFlags |= CONTEXT_EXCEPTION_REPORTING | CONTEXT_EXCEPTION_ACTIVE; wait_suspend( &context ); + if (context.ContextFlags & CONTEXT_DEBUG_REGISTERS & ~CONTEXT_i386) + { + x86_thread_data()->dr0 = context.Dr0; + x86_thread_data()->dr1 = context.Dr1; + x86_thread_data()->dr2 = context.Dr2; + x86_thread_data()->dr3 = context.Dr3; + x86_thread_data()->dr6 = context.Dr6; + x86_thread_data()->dr7 = context.Dr7; + } } ctx = (CONTEXT *)((ULONG_PTR)context.Esp & ~3) - 1; diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 3c71fc4b4fc8..874a80201ec5 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -2907,7 +2907,19 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB *(XSAVE_FORMAT *)wow_context->ExtendedRegisters = context.FltSave; } - if (suspend) wait_suspend( &context ); + if (suspend) + { + wait_suspend( &context ); + if (context.ContextFlags & CONTEXT_DEBUG_REGISTERS & ~CONTEXT_AMD64) + { + amd64_thread_data()->dr0 = context.Dr0; + amd64_thread_data()->dr1 = context.Dr1; + amd64_thread_data()->dr2 = context.Dr2; + amd64_thread_data()->dr3 = context.Dr3; + amd64_thread_data()->dr6 = context.Dr6; + amd64_thread_data()->dr7 = context.Dr7; + } + } ctx = (CONTEXT *)((ULONG_PTR)context.Rsp & ~15) - 1; *ctx = context; From 2720232baa36901277c580854095de4e26b9ea40 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Sat, 22 May 2021 03:08:55 +0300 Subject: [PATCH 0598/2542] ntdll: Use cached debug registers in NtGetContextThread() if hw debug breakpoints are disabled. CW-Bug-Id: #18957 --- dlls/ntdll/unix/signal_i386.c | 37 ++++++++++++++++++++++++--------- dlls/ntdll/unix/signal_x86_64.c | 37 ++++++++++++++++++++++++--------- 2 files changed, 54 insertions(+), 20 deletions(-) diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index eba05d1a9582..4bb518fe6cb9 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -1034,10 +1034,15 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) struct syscall_frame *frame = x86_thread_data()->syscall_frame; DWORD needed_flags = context->ContextFlags & ~CONTEXT_i386; BOOL self = (handle == GetCurrentThread()); + BOOL use_cached_debug_regs = FALSE; NTSTATUS ret; - /* debug registers require a server call */ - if (needed_flags & CONTEXT_DEBUG_REGISTERS) self = FALSE; + if (self && needed_flags & CONTEXT_DEBUG_REGISTERS) + { + /* debug registers require a server call if hw breakpoints are enabled */ + if (x86_thread_data()->dr7 & 0xff) self = FALSE; + else use_cached_debug_regs = TRUE; + } if (!self) { @@ -1149,15 +1154,27 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) frame->restore_flags |= CONTEXT_XSTATE; } } - /* update the cached version of the debug registers */ - if (needed_flags & CONTEXT_DEBUG_REGISTERS) + if (context->ContextFlags & (CONTEXT_DEBUG_REGISTERS & ~CONTEXT_i386)) { - x86_thread_data()->dr0 = context->Dr0; - x86_thread_data()->dr1 = context->Dr1; - x86_thread_data()->dr2 = context->Dr2; - x86_thread_data()->dr3 = context->Dr3; - x86_thread_data()->dr6 = context->Dr6; - x86_thread_data()->dr7 = context->Dr7; + if (use_cached_debug_regs) + { + context->Dr0 = x86_thread_data()->dr0; + context->Dr1 = x86_thread_data()->dr1; + context->Dr2 = x86_thread_data()->dr2; + context->Dr3 = x86_thread_data()->dr3; + context->Dr6 = x86_thread_data()->dr6; + context->Dr7 = x86_thread_data()->dr7; + } + else + { + /* update the cached version of the debug registers */ + x86_thread_data()->dr0 = context->Dr0; + x86_thread_data()->dr1 = context->Dr1; + x86_thread_data()->dr2 = context->Dr2; + x86_thread_data()->dr3 = context->Dr3; + x86_thread_data()->dr6 = context->Dr6; + x86_thread_data()->dr7 = context->Dr7; + } } set_context_exception_reporting_flags( &context->ContextFlags, CONTEXT_SERVICE_ACTIVE ); } diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 874a80201ec5..6a454e8cec6c 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -1101,10 +1101,15 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) { struct syscall_frame *frame = amd64_thread_data()->syscall_frame; DWORD needed_flags = context->ContextFlags & ~CONTEXT_AMD64; + BOOL use_cached_debug_regs = FALSE; BOOL self = (handle == GetCurrentThread()); - /* debug registers require a server call */ - if (needed_flags & CONTEXT_DEBUG_REGISTERS) self = FALSE; + if (self && needed_flags & CONTEXT_DEBUG_REGISTERS) + { + /* debug registers require a server call if hw breakpoints are enabled */ + if (amd64_thread_data()->dr7 & 0xff) self = FALSE; + else use_cached_debug_regs = TRUE; + } if (!self) { @@ -1207,15 +1212,27 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) frame->restore_flags |= CONTEXT_XSTATE; } } - /* update the cached version of the debug registers */ - if (needed_flags & CONTEXT_DEBUG_REGISTERS) + if (context->ContextFlags & (CONTEXT_DEBUG_REGISTERS & ~CONTEXT_AMD64)) { - amd64_thread_data()->dr0 = context->Dr0; - amd64_thread_data()->dr1 = context->Dr1; - amd64_thread_data()->dr2 = context->Dr2; - amd64_thread_data()->dr3 = context->Dr3; - amd64_thread_data()->dr6 = context->Dr6; - amd64_thread_data()->dr7 = context->Dr7; + if (use_cached_debug_regs) + { + context->Dr0 = amd64_thread_data()->dr0; + context->Dr1 = amd64_thread_data()->dr1; + context->Dr2 = amd64_thread_data()->dr2; + context->Dr3 = amd64_thread_data()->dr3; + context->Dr6 = amd64_thread_data()->dr6; + context->Dr7 = amd64_thread_data()->dr7; + } + else + { + /* update the cached version of the debug registers */ + amd64_thread_data()->dr0 = context->Dr0; + amd64_thread_data()->dr1 = context->Dr1; + amd64_thread_data()->dr2 = context->Dr2; + amd64_thread_data()->dr3 = context->Dr3; + amd64_thread_data()->dr6 = context->Dr6; + amd64_thread_data()->dr7 = context->Dr7; + } } set_context_exception_reporting_flags( &context->ContextFlags, CONTEXT_SERVICE_ACTIVE ); return STATUS_SUCCESS; From 47b8a12deada6900cdcc6b773218f2eac1fb5286 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 21 May 2021 15:10:07 +0300 Subject: [PATCH 0599/2542] ntdll: Read process memory on the client side in NtReadVirtualMemory(). CW-Bug-Id: 18957 --- dlls/ntdll/unix/server.c | 2 +- dlls/ntdll/unix/virtual.c | 54 +++++++++++++++++++++++++++++++++++++++ server/process.c | 2 ++ server/protocol.def | 1 + 4 files changed, 58 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c index a5f603c1bbdb..b2ff82f181e9 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c @@ -1601,7 +1601,7 @@ size_t server_init_process(void) (version > SERVER_PROTOCOL_VERSION) ? "wine" : "wineserver" ); #if defined(__linux__) && defined(HAVE_PRCTL) /* work around Ubuntu's ptrace breakage */ - if (server_pid != -1) prctl( 0x59616d61 /* PR_SET_PTRACER */, server_pid ); + if (server_pid != -1) prctl( 0x59616d61 /* PR_SET_PTRACER */, PR_SET_PTRACER_ANY ); #endif /* ignore SIGPIPE so that we get an EPIPE error instead */ diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 604e7fede00b..0248f67aac53 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -70,6 +70,8 @@ # include #endif +#include + #include #include #include "uffd_tmp_defs.h" @@ -6544,7 +6546,58 @@ NTSTATUS WINAPI NtReadVirtualMemory( HANDLE process, const void *addr, void *buf SIZE_T size, SIZE_T *bytes_read ) { unsigned int status; +#ifdef linux + struct iovec local, remote; + int unix_pid; + ssize_t ret; + + if (process == NtCurrentProcess()) + { + unix_pid = getpid(); + status = STATUS_SUCCESS; + } + else + { + SERVER_START_REQ( read_process_memory ) + { + req->handle = wine_server_obj_handle( process ); + status = wine_server_call( req ); + unix_pid = reply->unix_pid; + } + SERVER_END_REQ; + } + + if (status) + { + WARN( "Could not get unix_pid for process %p, status %#x.\n", process, status ); + size = 0; + goto done; + } + + local.iov_base = buffer; + local.iov_len = size; + + remote.iov_base = (void *)addr; + remote.iov_len = size; + if ((ret = process_vm_readv( unix_pid, &local, 1, &remote, 1, 0 )) != size) + { + WARN( "Error reading memory from process %p, addr %p, size %p, buffer %p, ret %p, errno %d.\n", + process, addr, (void *)size, buffer, (void *)ret, errno ); + + if (ret == -1) + { + status = errno == ESRCH ? STATUS_PARTIAL_COPY : errno_to_status( errno ); + size = 0; + } + else + { + status = STATUS_PARTIAL_COPY; + size = ret; + } + } +done: +#else if (!virtual_check_buffer_for_write( buffer, size )) { status = STATUS_ACCESS_VIOLATION; @@ -6575,6 +6628,7 @@ NTSTATUS WINAPI NtReadVirtualMemory( HANDLE process, const void *addr, void *buf } SERVER_END_REQ; } +#endif if (bytes_read) *bytes_read = size; return status; } diff --git a/server/process.c b/server/process.c index d350948d9999..8e37b6a72217 100644 --- a/server/process.c +++ b/server/process.c @@ -1716,6 +1716,8 @@ DECL_HANDLER(read_process_memory) if (!(process = get_process_from_handle( req->handle, PROCESS_VM_READ ))) return; + reply->unix_pid = process->unix_pid; + if (len) { char *buffer = mem_alloc( len ); diff --git a/server/protocol.def b/server/protocol.def index 6f7a2e559d99..570a6c1c9548 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1961,6 +1961,7 @@ struct process_info obj_handle_t handle; /* process handle */ client_ptr_t addr; /* addr to read from */ @REPLY + int unix_pid; /* Unix pid of new process */ VARARG(data,bytes); /* result data */ @END From 3f5e48170656792a45595398242021ae941faa63 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 25 Mar 2021 17:53:37 +0300 Subject: [PATCH 0600/2542] wine.inf: Create package repository for VCLibs.140. For Forza Horizon 4. --- loader/wine.inf.in | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 9c0445373705..452f07e35707 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -91,6 +91,7 @@ AddReg=\ MCI,\ Misc,\ OLE,\ + Packages,\ Printing,\ ProtonOverrides,\ Services, \ @@ -120,6 +121,7 @@ AddReg=\ MCI,\ Misc,\ OLE,\ + Packages.ntamd64,\ Printing,\ ProtonOverrides,\ Services, \ @@ -149,6 +151,7 @@ AddReg=\ MCI,\ Misc,\ OLE,\ + Packages.ntarm64,\ Printing,\ ProtonOverrides,\ Services, \ @@ -172,6 +175,7 @@ AddReg=\ Misc,\ ProtonOverrides,\ SteamClient64,\ + Packages.wow64,\ Tapi,\ VersionInfo,\ LicenseInformation,\ @@ -283,6 +287,7 @@ CurrentVersionNT="Software\Microsoft\Windows NT\CurrentVersion" FontSubStr="Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes" Control="System\CurrentControlSet\Control" FontsNT="Software\Microsoft\Windows NT\CurrentVersion\Fonts" +Packages="Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\PackageRepository\Packages" [Classes] HKCR,.chm,,2,"chm.file" @@ -687,6 +692,18 @@ HKCU,Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserCho HKLM,"Software\Microsoft\OLE","EnableDCOM",,"Y" HKLM,"Software\Microsoft\OLE","EnableRemoteConnect",,"N" +[Packages] +HKLM,"%Packages%\Microsoft.VCLibs.140.00_14.0.29231.0_x86__8wekyb3d8bbwe","Path",0x00020002,"%SystemRoot%\system32" + +[Packages.ntamd64] +HKLM,"%Packages%\Microsoft.VCLibs.140.00_14.0.29231.0_x64__8wekyb3d8bbwe","Path",0x00020002,"%SystemRoot%\system32" + +[Packages.wow64] +HKLM,"%Packages%\Microsoft.VCLibs.140.00_14.0.29231.0_x86__8wekyb3d8bbwe","Path",0x00020002,"%SystemRoot%\syswow64" + +[Packages.arm64] +HKLM,"%Packages%\Microsoft.VCLibs.140.00_14.0.29231.0_arm64__8wekyb3d8bbwe","Path",0x00020002,"%SystemRoot%\system32" + [Printing] HKLM,%Control%\Print\Monitors\Local Port,"Driver",2,"localspl.dll" HKLM,%Control%\Print\Printers,"DefaultSpoolDirectory",2,"%11%\spool\printers" From e45c0f2b20b975911ba48ba2ea355d72001da208 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 15 Mar 2021 21:59:00 +0300 Subject: [PATCH 0601/2542] kernel32: Implement GetPackagesByPackageFamily(). For Forza Horizon 4. --- dlls/kernel32/kernel32.spec | 2 +- dlls/kernel32/tests/version.c | 132 ++++++++++++++++++++++++++++++++++ dlls/kernelbase/version.c | 131 ++++++++++++++++++++++++++++----- include/appmodel.h | 2 + 4 files changed, 250 insertions(+), 17 deletions(-) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 6fb4ae8c2bed..98f076d865dc 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -777,7 +777,7 @@ @ stdcall -import GetUserPreferredUILanguages(long ptr ptr ptr) @ stdcall GetPackageFamilyName(long ptr ptr) kernelbase.GetPackageFamilyName @ stdcall GetPackageFullName(long ptr ptr) kernelbase.GetPackageFullName -@ stdcall GetPackagesByPackageFamily(wstr ptr ptr ptr ptr) kernelbase.GetPackagesByPackageFamily +@ stdcall -import GetPackagesByPackageFamily(wstr ptr ptr ptr ptr) @ stdcall GetPackagePathByFullName(wstr ptr wstr) kernelbase.GetPackagePathByFullName @ stdcall -import GetPhysicallyInstalledSystemMemory(ptr) @ stdcall -import GetPriorityClass(long) diff --git a/dlls/kernel32/tests/version.c b/dlls/kernel32/tests/version.c index d7bf445b3452..98b7cb840813 100644 --- a/dlls/kernel32/tests/version.c +++ b/dlls/kernel32/tests/version.c @@ -25,6 +25,7 @@ #include "winternl.h" #include "appmodel.h" +static LONG (WINAPI * pGetPackagesByPackageFamily)(const WCHAR *, UINT32 *, WCHAR **, UINT32 *, WCHAR *); static BOOL (WINAPI * pGetProductInfo)(DWORD, DWORD, DWORD, DWORD, DWORD *); static UINT (WINAPI * pEnumSystemFirmwareTables)(DWORD, void *, DWORD); static UINT (WINAPI * pGetSystemFirmwareTable)(DWORD, DWORD, void *, DWORD); @@ -46,6 +47,7 @@ static void init_function_pointers(void) hmod = GetModuleHandleA("kernel32.dll"); + GET_PROC(GetPackagesByPackageFamily); GET_PROC(GetProductInfo); GET_PROC(EnumSystemFirmwareTables); GET_PROC(GetSystemFirmwareTable); @@ -1101,6 +1103,135 @@ static void test_pe_os_version(void) } } + +static void test_package_info(void) +{ + static const WCHAR package_family_msvc140[] = L"Microsoft.VCLibs.140.00_8wekyb3d8bbwe"; + UINT32 count, length, curr_length, size; + WCHAR *full_names[32]; + BYTE id_buffer[512]; + WCHAR buffer[2048]; + BOOL arch_found; + SYSTEM_INFO si; + unsigned int i; + PACKAGE_ID *id; + DWORD arch; + LONG ret; + + if (!pGetPackagesByPackageFamily) + { + win_skip("GetPackagesByPackageFamily not available.\n"); + return; + } + + GetSystemInfo(&si); + arch = si.wProcessorArchitecture; + + count = 0; + length = 0; + ret = pGetPackagesByPackageFamily(L"Unknown_8wekyb3d8bbwe", &count, NULL, &length, NULL); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + ok(!count, "Got unexpected count %u.\n", count); + ok(!length, "Got unexpected length %u.\n", length); + + count = 0; + length = 0; + ret = pGetPackagesByPackageFamily(L"Unknown_iekyb3d8bbwe", &count, NULL, &length, NULL); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + ok(!count, "Got unexpected count %u.\n", count); + ok(!length, "Got unexpected length %u.\n", length); + + count = 0xdeadbeef; + length = 0xdeadbeef; + ret = pGetPackagesByPackageFamily(L"Unknown", &count, NULL, &length, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(count == 0xdeadbeef, "Got unexpected count %u.\n", count); + ok(length == 0xdeadbeef, "Got unexpected length %u.\n", length); + + count = 0; + length = 0; + ret = pGetPackagesByPackageFamily(L"Unknown", &count, NULL, &length, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(!count, "Got unexpected count %u.\n", count); + ok(!length, "Got unexpected length %u.\n", length); + + count = 0; + length = 0; + ret = pGetPackagesByPackageFamily(L"Unknown_8wekyb3d8bbwe_b", &count, NULL, &length, NULL); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + ok(!count, "Got unexpected count %u.\n", count); + ok(!length, "Got unexpected length %u.\n", length); + + count = 0; + length = 0; + ret = pGetPackagesByPackageFamily(L"Unknown_", &count, NULL, &length, NULL); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + ok(!count, "Got unexpected count %u.\n", count); + ok(!length, "Got unexpected length %u.\n", length); + + length = 0; + ret = pGetPackagesByPackageFamily(package_family_msvc140, NULL, NULL, &length, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(!length, "Got unexpected length %u.\n", length); + + count = 0; + ret = pGetPackagesByPackageFamily(package_family_msvc140, &count, NULL, NULL, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(!count, "Got unexpected count %u.\n", count); + + count = ARRAY_SIZE(full_names); + length = ARRAY_SIZE(buffer); + ret = pGetPackagesByPackageFamily(package_family_msvc140, &count, NULL, &length, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(count == ARRAY_SIZE(full_names), "Got unexpected count %u.\n", count); + ok(length == ARRAY_SIZE(buffer), "Got unexpected length %u.\n", length); + + ret = pGetPackagesByPackageFamily(package_family_msvc140, &count, full_names, &length, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(count == ARRAY_SIZE(full_names), "Got unexpected count %u.\n", count); + ok(length == ARRAY_SIZE(buffer), "Got unexpected length %u.\n", length); + + ret = pGetPackagesByPackageFamily(package_family_msvc140, &count, NULL, &length, buffer); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(count == ARRAY_SIZE(full_names), "Got unexpected count %u.\n", count); + ok(length == ARRAY_SIZE(buffer), "Got unexpected length %u.\n", length); + + count = 0; + length = 0; + ret = pGetPackagesByPackageFamily(package_family_msvc140, &count, NULL, &length, NULL); + if (!ret && !count && !length) + { + win_skip("Package VCLibs.140.00 is not installed.\n"); + return; + } + + ok(ret == ERROR_INSUFFICIENT_BUFFER, "Got unexpected ret %u.\n", ret); + ok(count >= 1, "Got unexpected count %u.\n", count); + ok(length > 1, "Got unexpected length %u.\n", length); + + ret = pGetPackagesByPackageFamily(package_family_msvc140, &count, full_names, &length, buffer); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + ok(count >= 1, "Got unexpected count %u.\n", count); + ok(length > 1, "Got unexpected length %u.\n", length); + + id = (PACKAGE_ID *)id_buffer; + curr_length = 0; + arch_found = FALSE; + for (i = 0; i < count; ++i) + { + curr_length += lstrlenW(full_names[i]) + 1; + + size = sizeof(id_buffer); + ret = pPackageIdFromFullName(full_names[i], 0, &size, id_buffer); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + + if (id->processorArchitecture == arch) + arch_found = TRUE; + } + ok(curr_length == length, "Got unexpected length %u.\n", length); + ok(arch_found, "Did not find package for current arch.\n"); +} + START_TEST(version) { char **argv; @@ -1128,4 +1259,5 @@ START_TEST(version) test_pe_os_version(); test_SystemFirmwareTable(); test_PackageIdFromFullName(); + test_package_info(); } diff --git a/dlls/kernelbase/version.c b/dlls/kernelbase/version.c index d9529ee085cf..a1da6aa7c5c3 100644 --- a/dlls/kernelbase/version.c +++ b/dlls/kernelbase/version.c @@ -37,10 +37,12 @@ #include "winnls.h" #include "winternl.h" #include "winerror.h" +#include "winreg.h" #include "appmodel.h" #include "kernelbase.h" #include "wine/debug.h" +#include "wine/heap.h" WINE_DEFAULT_DEBUG_CHANNEL(ver); @@ -159,6 +161,8 @@ static const struct } }; +static const WCHAR packages_key_name[] = L"Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows" + L"\\CurrentVersion\\AppModel\\PackageRepository\\Packages"; /****************************************************************************** * init_current_version @@ -1610,22 +1614,6 @@ LONG WINAPI /* DECLSPEC_HOTPATCH */ GetPackageFamilyName( HANDLE process, UINT32 return APPMODEL_ERROR_NO_PACKAGE; } -/*********************************************************************** - * GetPackagesByPackageFamily (kernelbase.@) - */ -LONG WINAPI DECLSPEC_HOTPATCH GetPackagesByPackageFamily(const WCHAR *family_name, UINT32 *count, - WCHAR *full_names, UINT32 *buffer_len, WCHAR *buffer) -{ - FIXME( "(%s %p %p %p %p): stub\n", debugstr_w(family_name), count, full_names, buffer_len, buffer ); - - if (!count || !buffer_len) - return ERROR_INVALID_PARAMETER; - - *count = 0; - *buffer_len = 0; - return ERROR_SUCCESS; -} - /*********************************************************************** * GetPackagePathByFullName (kernelbase.@) */ @@ -1752,3 +1740,114 @@ LONG WINAPI PackageIdFromFullName(const WCHAR *full_name, UINT32 flags, UINT32 * return ERROR_SUCCESS; } + + +/*********************************************************************** + * GetPackagesByPackageFamily (kernelbase.@) + */ +LONG WINAPI GetPackagesByPackageFamily(const WCHAR *family_name, UINT32 *count, WCHAR **full_names, + UINT32 *buffer_length, WCHAR *buffer) +{ + UINT32 curr_count, curr_length, package_id_buf_size, size; + unsigned int i, name_len, publisher_id_len; + DWORD subkey_count, max_key_len, length; + const WCHAR *publisher_id; + WCHAR *package_name; + BOOL short_buffer; + PACKAGE_ID *id; + HKEY key; + + TRACE("family_name %s, count %p, full_names %p, buffer_length %p, buffer %p.\n", + debugstr_w(family_name), count, full_names, buffer_length, buffer); + + if (!buffer_length || !count || !family_name) + return ERROR_INVALID_PARAMETER; + + if ((*buffer_length || *count) && (!full_names || !buffer)) + return ERROR_INVALID_PARAMETER; + + if (!(publisher_id = wcschr(family_name, L'_'))) + return ERROR_INVALID_PARAMETER; + + name_len = publisher_id - family_name; + ++publisher_id; + publisher_id_len = lstrlenW(publisher_id); + + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, packages_key_name, 0, KEY_READ, &key)) + { + ERR("Key open failed.\n"); + *count = 0; + *buffer_length = 0; + return ERROR_SUCCESS; + } + if (RegQueryInfoKeyW(key, NULL, NULL, NULL, &subkey_count, &max_key_len, NULL, NULL, NULL, NULL, NULL, NULL)) + { + ERR("Query key info failed.\n"); + RegCloseKey(key); + *count = 0; + *buffer_length = 0; + return ERROR_SUCCESS; + } + + if (!(package_name = heap_alloc((max_key_len + 1) * sizeof(*package_name)))) + { + ERR("No memory.\n"); + RegCloseKey(key); + return ERROR_OUTOFMEMORY; + } + + package_id_buf_size = sizeof(*id) + (max_key_len + 1) * sizeof(WCHAR); + if (!(id = heap_alloc(package_id_buf_size))) + { + ERR("No memory.\n"); + heap_free(package_name); + RegCloseKey(key); + return ERROR_OUTOFMEMORY; + } + + curr_count = curr_length = 0; + for (i = 0; i < subkey_count; ++i) + { + length = max_key_len + 1; + if (RegEnumKeyExW(key, i, package_name, &length, NULL, NULL, NULL, NULL)) + { + ERR("Error enumerating key %u.\n", i); + continue; + } + + size = package_id_buf_size; + if (PackageIdFromFullName(package_name, 0, &size, (BYTE *)id)) + { + ERR("Error getting package id from full name.\n"); + continue; + } + + if (lstrlenW(id->name) != name_len) + continue; + if (wcsnicmp(family_name, id->name, name_len)) + continue; + + if (lstrlenW(id->publisherId) != publisher_id_len) + continue; + if (wcsnicmp(publisher_id, id->publisherId, publisher_id_len)) + continue; + if (curr_length + length < *buffer_length) + { + memcpy(buffer + curr_length, package_name, (length + 1) * sizeof(*package_name)); + if (curr_count < *count) + full_names[curr_count] = buffer + curr_length; + } + curr_length += length + 1; + ++curr_count; + } + + heap_free(id); + heap_free(package_name); + RegCloseKey(key); + + short_buffer = curr_length > *buffer_length || curr_count > *count; + *count = curr_count; + *buffer_length = curr_length; + + return short_buffer ? ERROR_INSUFFICIENT_BUFFER : ERROR_SUCCESS; +} diff --git a/include/appmodel.h b/include/appmodel.h index 8c219e8080a7..1e7eb88a43b9 100644 --- a/include/appmodel.h +++ b/include/appmodel.h @@ -89,6 +89,8 @@ LONG WINAPI AppPolicyGetProcessTerminationMethod(HANDLE token, AppPolicyProcessT LONG WINAPI AppPolicyGetShowDeveloperDiagnostic(HANDLE token, AppPolicyShowDeveloperDiagnostic *policy); LONG WINAPI AppPolicyGetThreadInitializationType(HANDLE token, AppPolicyThreadInitializationType *policy); LONG WINAPI AppPolicyGetWindowingModel(HANDLE processToken, AppPolicyWindowingModel *policy); +LONG WINAPI GetPackagesByPackageFamily(const WCHAR *family_name, UINT32 *count, WCHAR **full_names, + UINT32 *buffer_length, WCHAR *buffer); LONG WINAPI PackageIdFromFullName(const WCHAR *full_name, UINT32 flags, UINT32 *buffer_length, BYTE *buffer); #if defined(__cplusplus) From 03c71910580ea6918784450026dd93569f8e902a Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 26 Mar 2021 01:10:08 +0300 Subject: [PATCH 0602/2542] kernel32: Implement PackageFullNameFromId(). For Forza Horizon 4. --- dlls/kernel32/kernel32.spec | 1 + dlls/kernel32/tests/version.c | 22 ++++++++++++++++- dlls/kernelbase/kernelbase.spec | 2 +- dlls/kernelbase/version.c | 43 +++++++++++++++++++++++++++++++++ include/appmodel.h | 1 + 5 files changed, 67 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 98f076d865dc..8c9b98d9d00b 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -1168,6 +1168,7 @@ @ stdcall -import PeekConsoleInputW(ptr ptr long ptr) @ stdcall -import PeekNamedPipe(long ptr long ptr ptr ptr) @ stdcall -import PostQueuedCompletionStatus(long long ptr ptr) +@ stdcall -import PackageFullNameFromId(ptr ptr ptr) @ stdcall -import PackageIdFromFullName(wstr long ptr ptr) @ stdcall PowerClearRequest(long long) @ stdcall PowerCreateRequest(ptr) diff --git a/dlls/kernel32/tests/version.c b/dlls/kernel32/tests/version.c index 98b7cb840813..a0138f2f0865 100644 --- a/dlls/kernel32/tests/version.c +++ b/dlls/kernel32/tests/version.c @@ -29,6 +29,7 @@ static LONG (WINAPI * pGetPackagesByPackageFamily)(const WCHAR *, UINT32 *, WCHA static BOOL (WINAPI * pGetProductInfo)(DWORD, DWORD, DWORD, DWORD, DWORD *); static UINT (WINAPI * pEnumSystemFirmwareTables)(DWORD, void *, DWORD); static UINT (WINAPI * pGetSystemFirmwareTable)(DWORD, DWORD, void *, DWORD); +static LONG (WINAPI * pPackageFullNameFromId)(const PACKAGE_ID *, UINT32 *, WCHAR *); static LONG (WINAPI * pPackageIdFromFullName)(const WCHAR *, UINT32, UINT32 *, BYTE *); static NTSTATUS (WINAPI * pNtQuerySystemInformation)(SYSTEM_INFORMATION_CLASS, void *, ULONG, ULONG *); static NTSTATUS (WINAPI * pRtlGetVersion)(RTL_OSVERSIONINFOEXW *); @@ -51,6 +52,7 @@ static void init_function_pointers(void) GET_PROC(GetProductInfo); GET_PROC(EnumSystemFirmwareTables); GET_PROC(GetSystemFirmwareTable); + GET_PROC(PackageFullNameFromId); GET_PROC(PackageIdFromFullName); hmod = GetModuleHandleA("ntdll.dll"); @@ -829,9 +831,11 @@ static void test_PackageIdFromFullName(void) { 0, PROCESSOR_ARCHITECTURE_INTEL, {{.Major = 1, .Minor = 2, .Build = 3, .Revision = 4}}, - (WCHAR *)L"TestPackage", NULL, + (WCHAR *)L"TestPackage", (WCHAR *)L"TestResource", (WCHAR *)L"TestResourceId", (WCHAR *)L"0abcdefghjkme" }; + static const WCHAR test_package_fullname[] = + L"TestPackage_1.2.3.4_x86_TestResourceId_0abcdefghjkme"; UINT32 size, expected_size; PACKAGE_ID test_id; WCHAR fullname[512]; @@ -944,6 +948,22 @@ static void test_PackageIdFromFullName(void) size = sizeof(id_buffer); ret = pPackageIdFromFullName(L"TestPackage_1.2.3.4_X86_0abcdefghjkme", 0, &size, id_buffer); ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret); + + ret = pPackageFullNameFromId(&test_package_id, NULL, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + + size = sizeof(fullname); + ret = pPackageFullNameFromId(&test_package_id, &size, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + + size = 0; + ret = pPackageFullNameFromId(&test_package_id, &size, NULL); + ok(ret == ERROR_INSUFFICIENT_BUFFER, "Got unexpected ret %u.\n", ret); + ok(size == lstrlenW(test_package_fullname) + 1, "Got unexpected size %u.\n", size); + + ret = pPackageFullNameFromId(&test_package_id, &size, fullname); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + ok(!lstrcmpW(fullname, test_package_fullname), "Got unexpected fullname %s.\n", debugstr_w(fullname)); } #define TEST_VERSION_WIN7 1 diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index 27f45edcedf0..5349524cc53b 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -1045,7 +1045,7 @@ # @ stub PackageFamilyNameFromFullName # @ stub PackageFamilyNameFromId # @ stub PackageFamilyNameFromProductId -# @ stub PackageFullNameFromId +@ stdcall PackageFullNameFromId(ptr ptr ptr) # @ stub PackageFullNameFromProductId @ stdcall PackageIdFromFullName(wstr long ptr ptr) # @ stub PackageIdFromProductId diff --git a/dlls/kernelbase/version.c b/dlls/kernelbase/version.c index a1da6aa7c5c3..7f0dae25941c 100644 --- a/dlls/kernelbase/version.c +++ b/dlls/kernelbase/version.c @@ -1652,6 +1652,16 @@ static UINT32 processor_arch_from_string(const WCHAR *str, unsigned int len) return ~0u; } +const WCHAR *string_from_processor_arch(UINT32 code) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(arch_names); ++i) + if (code == arch_names[i].code) + return arch_names[i].name; + return NULL; +} + /*********************************************************************** * PackageIdFromFullName (kernelbase.@) */ @@ -1742,6 +1752,39 @@ LONG WINAPI PackageIdFromFullName(const WCHAR *full_name, UINT32 flags, UINT32 * } +/*********************************************************************** + * PackageFullNameFromId (kernelbase.@) + */ +LONG WINAPI PackageFullNameFromId(const PACKAGE_ID *package_id, UINT32 *length, WCHAR *full_name) +{ + WCHAR ver_str[5 * 4 + 3 + 1]; + const WCHAR *arch_str; + UINT32 have_length; + + TRACE("package_id %p, length %p, full_name %p.\n", package_id, length, full_name); + + if (!package_id || !length) + return ERROR_INVALID_PARAMETER; + if (!full_name && *length) + return ERROR_INVALID_PARAMETER; + if (!package_id->name || !package_id->resourceId || !package_id->publisherId + || !(arch_str = string_from_processor_arch(package_id->processorArchitecture))) + return ERROR_INVALID_PARAMETER; + + swprintf(ver_str, ARRAY_SIZE(ver_str), L"%u.%u.%u.%u", package_id->version.Major, + package_id->version.Minor, package_id->version.Build, package_id->version.Revision); + have_length = *length; + *length = lstrlenW(package_id->name) + 1 + lstrlenW(ver_str) + 1 + lstrlenW(arch_str) + 1 + + lstrlenW(package_id->resourceId) + 1 + lstrlenW(package_id->publisherId) + 1; + + if (have_length < *length) + return ERROR_INSUFFICIENT_BUFFER; + + swprintf(full_name, *length, L"%s_%s_%s_%s_%s", package_id->name, ver_str, arch_str, package_id->resourceId, package_id->publisherId); + return ERROR_SUCCESS; +} + + /*********************************************************************** * GetPackagesByPackageFamily (kernelbase.@) */ diff --git a/include/appmodel.h b/include/appmodel.h index 1e7eb88a43b9..c3a42567a42a 100644 --- a/include/appmodel.h +++ b/include/appmodel.h @@ -91,6 +91,7 @@ LONG WINAPI AppPolicyGetThreadInitializationType(HANDLE token, AppPolicyThreadIn LONG WINAPI AppPolicyGetWindowingModel(HANDLE processToken, AppPolicyWindowingModel *policy); LONG WINAPI GetPackagesByPackageFamily(const WCHAR *family_name, UINT32 *count, WCHAR **full_names, UINT32 *buffer_length, WCHAR *buffer); +LONG WINAPI PackageFullNameFromId(const PACKAGE_ID *package_id, UINT32 *length, WCHAR *full_name); LONG WINAPI PackageIdFromFullName(const WCHAR *full_name, UINT32 flags, UINT32 *buffer_length, BYTE *buffer); #if defined(__cplusplus) From dc4ab61c1725d05f24b5cfeb2cfae0c7e9b9fae3 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 15 Mar 2021 22:05:19 +0300 Subject: [PATCH 0603/2542] kernel32: Implement GetPackagePath(). For Forza Horizon 4. --- dlls/kernel32/kernel32.spec | 1 + dlls/kernel32/tests/version.c | 64 +++++++++++++++++++++++-- dlls/kernelbase/kernelbase.spec | 2 +- dlls/kernelbase/version.c | 82 +++++++++++++++++++++++++++++++++ include/appmodel.h | 1 + 5 files changed, 144 insertions(+), 6 deletions(-) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 8c9b98d9d00b..b74b5a8ce981 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -777,6 +777,7 @@ @ stdcall -import GetUserPreferredUILanguages(long ptr ptr ptr) @ stdcall GetPackageFamilyName(long ptr ptr) kernelbase.GetPackageFamilyName @ stdcall GetPackageFullName(long ptr ptr) kernelbase.GetPackageFullName +@ stdcall -import GetPackagePath(ptr long ptr ptr) @ stdcall -import GetPackagesByPackageFamily(wstr ptr ptr ptr ptr) @ stdcall GetPackagePathByFullName(wstr ptr wstr) kernelbase.GetPackagePathByFullName @ stdcall -import GetPhysicallyInstalledSystemMemory(ptr) diff --git a/dlls/kernel32/tests/version.c b/dlls/kernel32/tests/version.c index a0138f2f0865..49dae0f52963 100644 --- a/dlls/kernel32/tests/version.c +++ b/dlls/kernel32/tests/version.c @@ -25,6 +25,7 @@ #include "winternl.h" #include "appmodel.h" +static LONG (WINAPI * pGetPackagePath)(const PACKAGE_ID *, const UINT32, UINT32 *, WCHAR *); static LONG (WINAPI * pGetPackagesByPackageFamily)(const WCHAR *, UINT32 *, WCHAR **, UINT32 *, WCHAR *); static BOOL (WINAPI * pGetProductInfo)(DWORD, DWORD, DWORD, DWORD, DWORD *); static UINT (WINAPI * pEnumSystemFirmwareTables)(DWORD, void *, DWORD); @@ -48,6 +49,7 @@ static void init_function_pointers(void) hmod = GetModuleHandleA("kernel32.dll"); + GET_PROC(GetPackagePath); GET_PROC(GetPackagesByPackageFamily); GET_PROC(GetProductInfo); GET_PROC(EnumSystemFirmwareTables); @@ -1127,15 +1129,15 @@ static void test_pe_os_version(void) static void test_package_info(void) { static const WCHAR package_family_msvc140[] = L"Microsoft.VCLibs.140.00_8wekyb3d8bbwe"; - UINT32 count, length, curr_length, size; + UINT32 count, length, curr_length, size, path_length, total_length; + WCHAR buffer[2048], path[MAX_PATH]; + PACKAGE_ID *id, saved_id; WCHAR *full_names[32]; BYTE id_buffer[512]; - WCHAR buffer[2048]; + DWORD arch, attrib; BOOL arch_found; SYSTEM_INFO si; unsigned int i; - PACKAGE_ID *id; - DWORD arch; LONG ret; if (!pGetPackagesByPackageFamily) @@ -1216,6 +1218,10 @@ static void test_package_info(void) ok(count == ARRAY_SIZE(full_names), "Got unexpected count %u.\n", count); ok(length == ARRAY_SIZE(buffer), "Got unexpected length %u.\n", length); + length = 0; + ret = pGetPackagePath(NULL, 0, &length, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + count = 0; length = 0; ret = pGetPackagesByPackageFamily(package_family_msvc140, &count, NULL, &length, NULL); @@ -1234,6 +1240,7 @@ static void test_package_info(void) ok(count >= 1, "Got unexpected count %u.\n", count); ok(length > 1, "Got unexpected length %u.\n", length); + total_length = length; id = (PACKAGE_ID *)id_buffer; curr_length = 0; arch_found = FALSE; @@ -1247,9 +1254,56 @@ static void test_package_info(void) if (id->processorArchitecture == arch) arch_found = TRUE; + + path_length = 0; + ret = pGetPackagePath(id, 0, &path_length, NULL); + ok(ret == ERROR_INSUFFICIENT_BUFFER, "Got unexpected ret %u.\n", ret); + ok(path_length > 1, "Got unexpected path_length %u.\n", path_length); + + length = path_length; + ret = pGetPackagePath(id, 0, &length, path); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + ok(length == path_length, "Got unexpected length %u.\n", length); + attrib = GetFileAttributesW(path); + ok(attrib != INVALID_FILE_ATTRIBUTES && attrib & FILE_ATTRIBUTE_DIRECTORY, + "Got unexpected attrib %#x, GetLastError() %u.\n", attrib, GetLastError()); } - ok(curr_length == length, "Got unexpected length %u.\n", length); + ok(curr_length == total_length, "Got unexpected length %u.\n", length); ok(arch_found, "Did not find package for current arch.\n"); + + size = sizeof(id_buffer); + ret = pPackageIdFromFullName(full_names[0], 0, &size, id_buffer); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + saved_id = *id; + + id->publisherId = NULL; + length = ARRAY_SIZE(path); + ret = pGetPackagePath(id, 0, &length, path); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + + *id = saved_id; + id->name = NULL; + length = ARRAY_SIZE(path); + ret = pGetPackagePath(id, 0, &length, path); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + + *id = saved_id; + id->publisher = NULL; + length = ARRAY_SIZE(path); + ret = pGetPackagePath(id, 0, &length, path); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + + *id = saved_id; + id->processorArchitecture = ~0u; + length = ARRAY_SIZE(path); + ret = pGetPackagePath(id, 0, &length, path); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + + *id = saved_id; + id->name[0] = L'X'; + length = ARRAY_SIZE(path); + ret = pGetPackagePath(id, 0, &length, path); + ok(ret == ERROR_NOT_FOUND, "Got unexpected ret %u.\n", ret); } START_TEST(version) diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index 5349524cc53b..9817beb88f60 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -630,7 +630,7 @@ # @ stub GetPackageInfo # @ stub GetPackageInstallTime # @ stub GetPackageOSMaxVersionTested -# @ stub GetPackagePath +@ stdcall GetPackagePath(ptr long ptr ptr) @ stdcall GetPackagePathByFullName(wstr ptr wstr) # @ stub GetPackagePathOnVolume # @ stub GetPackageProperty diff --git a/dlls/kernelbase/version.c b/dlls/kernelbase/version.c index 7f0dae25941c..a43b74352701 100644 --- a/dlls/kernelbase/version.c +++ b/dlls/kernelbase/version.c @@ -1894,3 +1894,85 @@ LONG WINAPI GetPackagesByPackageFamily(const WCHAR *family_name, UINT32 *count, return short_buffer ? ERROR_INSUFFICIENT_BUFFER : ERROR_SUCCESS; } + + +/*********************************************************************** + * GetPackagePath (kernelbase.@) + */ +LONG WINAPI GetPackagePath(const PACKAGE_ID *package_id, const UINT32 reserved, UINT32 *length, WCHAR *path) +{ + WCHAR *key_name = NULL, *expanded_path = NULL; + UINT32 required_length, have_length; + unsigned int offset; + HKEY key = NULL; + DWORD size; + LONG ret; + + TRACE("package_id %p, reserved %u, length %p, path %p.\n", package_id, reserved, length, path); + + if (!length) + return ERROR_INVALID_PARAMETER; + if (!path && *length) + return ERROR_INVALID_PARAMETER; + + required_length = 0; + if ((ret = PackageFullNameFromId(package_id, &required_length, NULL)) != ERROR_INSUFFICIENT_BUFFER) + return ret; + + offset = lstrlenW(packages_key_name) + 1; + if (!(key_name = heap_alloc((offset + required_length) * sizeof(WCHAR)))) + { + ERR("No memory."); + return ERROR_OUTOFMEMORY; + } + + if ((ret = PackageFullNameFromId(package_id, &required_length, key_name + offset))) + goto done; + + memcpy(key_name, packages_key_name, (offset - 1) * sizeof(WCHAR)); + key_name[offset - 1] = L'\\'; + + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, key_name, 0, KEY_READ, &key)) + { + WARN("Key %s not found.\n", debugstr_w(key_name)); + ret = ERROR_NOT_FOUND; + goto done; + } + if (RegGetValueW(key, NULL, L"Path", RRF_RT_REG_SZ, NULL, NULL, &size)) + { + WARN("Path value not found in %s.\n", debugstr_w(key_name)); + ret = ERROR_NOT_FOUND; + goto done; + } + if (!(expanded_path = heap_alloc(size))) + { + ERR("No memory."); + ret = ERROR_OUTOFMEMORY; + goto done; + } + if (RegGetValueW(key, NULL, L"Path", RRF_RT_REG_SZ, NULL, expanded_path, &size)) + { + WARN("Could not get Path value from %s.\n", debugstr_w(key_name)); + ret = ERROR_NOT_FOUND; + goto done; + } + + have_length = *length; + *length = lstrlenW(expanded_path) + 1; + if (have_length >= *length) + { + memcpy(path, expanded_path, *length * sizeof(*path)); + ret = ERROR_SUCCESS; + } + else + { + ret = ERROR_INSUFFICIENT_BUFFER; + } + +done: + if (key) + RegCloseKey(key); + heap_free(expanded_path); + heap_free(key_name); + return ret; +} diff --git a/include/appmodel.h b/include/appmodel.h index c3a42567a42a..cab001f60c7c 100644 --- a/include/appmodel.h +++ b/include/appmodel.h @@ -89,6 +89,7 @@ LONG WINAPI AppPolicyGetProcessTerminationMethod(HANDLE token, AppPolicyProcessT LONG WINAPI AppPolicyGetShowDeveloperDiagnostic(HANDLE token, AppPolicyShowDeveloperDiagnostic *policy); LONG WINAPI AppPolicyGetThreadInitializationType(HANDLE token, AppPolicyThreadInitializationType *policy); LONG WINAPI AppPolicyGetWindowingModel(HANDLE processToken, AppPolicyWindowingModel *policy); +LONG WINAPI GetPackagePath(const PACKAGE_ID *package_id, const UINT32 reserved, UINT32 *length, WCHAR *path); LONG WINAPI GetPackagesByPackageFamily(const WCHAR *family_name, UINT32 *count, WCHAR **full_names, UINT32 *buffer_length, WCHAR *buffer); LONG WINAPI PackageFullNameFromId(const PACKAGE_ID *package_id, UINT32 *length, WCHAR *full_name); From 01e02ae083b9c78e7eebd8e6921f113d058431ac Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 27 Sep 2022 11:30:06 -0500 Subject: [PATCH 0604/2542] kernelbase: HACK: Do not expose version info for builtin DLLs for VC redists. So VC Runtime 2013 redist actually installs the libraries. CW-Bug-Id: #21343 --- dlls/kernelbase/version.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/dlls/kernelbase/version.c b/dlls/kernelbase/version.c index a43b74352701..2df8ea94f3bd 100644 --- a/dlls/kernelbase/version.c +++ b/dlls/kernelbase/version.c @@ -780,6 +780,27 @@ DWORD WINAPI GetFileVersionInfoSizeExW( DWORD flags, LPCWSTR filename, LPDWORD r if ((hModule = LoadLibraryExW( filename, 0, LOAD_LIBRARY_AS_IMAGE_RESOURCE ))) { HRSRC hRsrc = NULL; + + static const char builtin_signature[] = "Wine builtin DLL"; + HMODULE mod = (HMODULE)((ULONG_PTR)hModule & ~(ULONG_PTR)3); + char *signature = (char *)((IMAGE_DOS_HEADER *)mod + 1); + WCHAR exe_name[MAX_PATH]; + IMAGE_NT_HEADERS *nt; + DWORD exe_name_len; + + if ((exe_name_len = GetModuleFileNameW( NULL, exe_name, ARRAY_SIZE(exe_name) )) + && exe_name_len >= 16 + && (!memcmp( exe_name + exe_name_len - 16, L"vcredist_x64.exe", 16 * sizeof(*exe_name) ) + || !memcmp( exe_name + exe_name_len - 16, L"vcredist_x86.exe", 16 * sizeof(*exe_name) )) + && (nt = RtlImageNtHeader( mod )) && (char *)nt - signature >= sizeof(builtin_signature) + && !memcmp( signature, builtin_signature, sizeof(builtin_signature) )) + { + ERR("HACK: not exposing version info.\n"); + FreeLibrary( hModule ); + SetLastError( ERROR_RESOURCE_NAME_NOT_FOUND ); + return 0; + } + if (!(flags & FILE_VER_GET_LOCALISED)) { LANGID english = MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT ); From 18e797478405a201d7c184c962a83e5c35fe65ef Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 30 Jul 2021 21:01:13 +0300 Subject: [PATCH 0605/2542] kernelbase: HACK: Force CEF software rendering for UplayWebCore. Work around Uplay crash. (To be revisited once builtin d3dcompiler is added). --- dlls/kernelbase/process.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 25c1d919b7cd..b28d68ae76ee 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -32,6 +32,7 @@ #include "kernelbase.h" #include "wine/debug.h" #include "wine/condrv.h" +#include "wine/heap.h" WINE_DEFAULT_DEBUG_CHANNEL(process); @@ -539,7 +540,31 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR } else { - if (!(tidy_cmdline = get_file_name( cmd_line, name, ARRAY_SIZE(name) ))) return FALSE; + static const WCHAR *opt = L" --use-gl=swiftshader"; + WCHAR *cmdline_new = NULL; + + if (cmd_line && wcsstr( cmd_line, L"UplayWebCore.exe" )) + { + FIXME( "HACK: appending %s to command line %s.\n", debugstr_w(opt), debugstr_w(cmd_line) ); + + cmdline_new = heap_alloc( sizeof(WCHAR) * (lstrlenW(cmd_line) + lstrlenW(opt) + 1) ); + lstrcpyW(cmdline_new, cmd_line); + lstrcatW(cmdline_new, opt); + } + + tidy_cmdline = get_file_name( cmdline_new ? cmdline_new : cmd_line, name, ARRAY_SIZE(name) ); + + if (!tidy_cmdline) + { + heap_free( cmdline_new ); + return FALSE; + } + + if (cmdline_new) + { + if (cmdline_new == tidy_cmdline) cmd_line = NULL; + else heap_free( cmdline_new ); + } app_name = name; } From 8d6faaf6e0029c139218341f39223812ad8d9829 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 26 Jul 2021 17:36:04 +0300 Subject: [PATCH 0606/2542] kernel32: Align stack pointer for lstrcpyA() on x64. For Blood of Steel crash on launch. CW-Bug-Id: #19148 --- dlls/kernel32/virtual.c | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/virtual.c b/dlls/kernel32/virtual.c index 0314b362e86c..59332e30f725 100644 --- a/dlls/kernel32/virtual.c +++ b/dlls/kernel32/virtual.c @@ -35,6 +35,7 @@ #include "psapi.h" #include "wine/exception.h" #include "wine/debug.h" +#include "wine/asm.h" #include "kernel_private.h" @@ -293,7 +294,8 @@ LPWSTR WINAPI lstrcatW( LPWSTR dst, LPCWSTR src ) * lstrcpyA (KERNEL32.@) * lstrcpy (KERNEL32.@) */ -LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src ) +#if defined(__x86_64__) && !defined(__arm64ec__) +LPSTR WINAPI lstrcpyA_impl( LPSTR dst, LPCSTR src ) { __TRY { @@ -309,6 +311,42 @@ LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src ) return dst; } +__ASM_GLOBAL_FUNC( lstrcpyA, + ".byte 0x48, 0x8d, 0xa4, 0x24, 0x00, 0x00, 0x00, 0x00\n\t" + "pushq %rbp\n\t" + __ASM_SEH(".seh_pushreg %rbp\n\t") + __ASM_CFI(".cfi_adjust_cfa_offset 8\n\t") + __ASM_CFI(".cfi_rel_offset %rbp,0\n\t") + "movq %rsp,%rbp\n\t" + __ASM_SEH(".seh_setframe %rbp,0\n\t") + __ASM_CFI(".cfi_def_cfa_register %rbp\n\t") + __ASM_SEH(".seh_endprologue\n\t") + "subq $0x20,%rsp\n\t" + "andq $~15,%rsp\n\t" + "call " __ASM_NAME("lstrcpyA_impl") "\n\t" + "leaq 0(%rbp),%rsp\n\t" + __ASM_CFI(".cfi_def_cfa_register %rsp\n\t") + "popq %rbp\n\t" + __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t") + __ASM_CFI(".cfi_same_value %rbp\n\t") + "ret" ) +#else /* defined(__x86_64__) && !defined(__arm64ec__) */ +LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src ) +{ + __TRY + { + /* this is how Windows does it */ + memmove( dst, src, strlen(src)+1 ); + } + __EXCEPT( badptr_handler ) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return NULL; + } + __ENDTRY + return dst; +} +#endif /*********************************************************************** * lstrcpyW (KERNEL32.@) From 61ef9d52640363e2d5d08c4225018e3cbfb81518 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 14 Jul 2021 20:45:38 +0300 Subject: [PATCH 0607/2542] ntdll: Add stub implementation for NtSetInformationFile(FileAllocationInformation). CW-Bug-Id: #19085 --- dlls/ntdll/unix/file.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 244362073d57..90fd66d43982 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -4792,6 +4792,15 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io, else status = STATUS_INVALID_PARAMETER_3; break; + case FileAllocationInformation: + { + const FILE_ALLOCATION_INFORMATION *info = ptr; + + FIXME("FileAllocationInformation AllocationSize %p stub.\n", (void *)(ULONG_PTR)info->AllocationSize.QuadPart); + io->Status = STATUS_SUCCESS; + break; + } + case FilePipeInformation: if (len >= sizeof(FILE_PIPE_INFORMATION)) { From ef404a7cfe79b8f4503b0168b4cf872317792b00 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 14 Jul 2021 20:43:39 +0300 Subject: [PATCH 0608/2542] ntdll: Support '\??\GlobalRoot' prefix in get_dos_prefix_len(). CW-Bug-Id: #19085 --- dlls/ntdll/unix/file.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 90fd66d43982..3e29559997b0 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -3257,16 +3257,31 @@ static inline int get_dos_prefix_len( const UNICODE_STRING *name ) { static const WCHAR nt_prefixW[] = {'\\','?','?','\\'}; static const WCHAR dosdev_prefixW[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\'}; + static const WCHAR globalrootW[] = {'\\','?','?','\\','G','l','o','b','a','l','R','o','o','t'}; + int prefix_len = 0; + WCHAR *prefix; + USHORT length; - if (name->Length >= sizeof(nt_prefixW) && - !memcmp( name->Buffer, nt_prefixW, sizeof(nt_prefixW) )) - return ARRAY_SIZE( nt_prefixW ); + prefix = name->Buffer; + length = name->Length; - if (name->Length >= sizeof(dosdev_prefixW) && - !wcsnicmp( name->Buffer, dosdev_prefixW, ARRAY_SIZE( dosdev_prefixW ))) - return ARRAY_SIZE( dosdev_prefixW ); + if (length >= ARRAY_SIZE( globalrootW ) && + !wcsnicmp( prefix, globalrootW, ARRAY_SIZE( globalrootW ))) + { + WARN("Stripping off GlobalRoot prefix.\n"); + prefix += ARRAY_SIZE( globalrootW ); + prefix_len += ARRAY_SIZE( globalrootW ); + length -= ARRAY_SIZE( globalrootW ); + } - return 0; + if (length >= sizeof(nt_prefixW) && + !memcmp( prefix, nt_prefixW, sizeof(nt_prefixW) )) + prefix_len += ARRAY_SIZE( nt_prefixW ); + else if (length >= sizeof(dosdev_prefixW) && + !wcsnicmp( prefix, dosdev_prefixW, ARRAY_SIZE( dosdev_prefixW ))) + prefix_len += ARRAY_SIZE( dosdev_prefixW ); + + return prefix_len; } From 15752d090fd373687074e149287577f6a167b770 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 16 Sep 2021 18:01:42 +0300 Subject: [PATCH 0609/2542] kernelbase: Return an error from InitializeProcessForWsWatch() stub. CW-Bug-Id: #19445 For DeathLoop. --- dlls/kernelbase/debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/kernelbase/debug.c b/dlls/kernelbase/debug.c index a48babd01301..0b6c4f3dd7fd 100644 --- a/dlls/kernelbase/debug.c +++ b/dlls/kernelbase/debug.c @@ -1693,7 +1693,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetWsChangesEx( HANDLE process, PSAPI_WS_WATCH_INF BOOL WINAPI /* DECLSPEC_HOTPATCH */ InitializeProcessForWsWatch( HANDLE process ) { FIXME( "(process=%p): stub\n", process ); - return TRUE; + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; } From d7ba7d8ffd88d1c2f637af90cc13730d1c0c43ea Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 19 Nov 2021 16:30:57 +0300 Subject: [PATCH 0610/2542] kernelbase: HACK: Force CEF in process GPU rendering for Paradox launcher. To be removed once other process Vulkan rendering is implemented. CW-Bug-Id: #19617 Signed-off-by: Paul Gofman --- dlls/kernelbase/process.c | 49 ++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index b28d68ae76ee..59899c3cbe09 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -503,6 +503,33 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalA( HANDLE token, const char * return ret; } +static const WCHAR *hack_append_command_line( const WCHAR *cmd ) +{ + static const struct + { + const WCHAR *exe_name; + const WCHAR *append; + } + options[] = + { + {L"UplayWebCore.exe", L" --use-gl=swiftshader"}, + {L"Paradox Launcher.exe", L" --use-gl=swiftshader --in-process-gpu"}, + }; + unsigned int i; + + if (!cmd) return NULL; + + for (i = 0; i < ARRAY_SIZE(options); ++i) + { + if (wcsstr( cmd, options[i].exe_name )) + { + FIXME( "HACK: appending %s to command line.\n", debugstr_w(options[i].append) ); + return options[i].append; + } + } + return NULL; +} + /********************************************************************** * CreateProcessInternalW (kernelbase.@) */ @@ -519,6 +546,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR RTL_USER_PROCESS_PARAMETERS *params = NULL; RTL_USER_PROCESS_INFORMATION rtl_info; HANDLE parent = 0, debug = 0; + const WCHAR *append; ULONG nt_flags = 0; USHORT machine = 0; NTSTATUS status; @@ -537,33 +565,38 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR return FALSE; swprintf( tidy_cmdline, lstrlenW(app_name) + 3, L"\"%s\"", app_name ); } + else if ((append = hack_append_command_line( app_name ))) + { + tidy_cmdline = RtlAllocateHeap( GetProcessHeap(), 0, + sizeof(WCHAR) * (lstrlenW(cmd_line) + lstrlenW(append) + 1) ); + lstrcpyW(tidy_cmdline, cmd_line); + lstrcatW(tidy_cmdline, append); + } } else { - static const WCHAR *opt = L" --use-gl=swiftshader"; WCHAR *cmdline_new = NULL; - if (cmd_line && wcsstr( cmd_line, L"UplayWebCore.exe" )) + if ((append = hack_append_command_line( cmd_line ))) { - FIXME( "HACK: appending %s to command line %s.\n", debugstr_w(opt), debugstr_w(cmd_line) ); - - cmdline_new = heap_alloc( sizeof(WCHAR) * (lstrlenW(cmd_line) + lstrlenW(opt) + 1) ); + cmdline_new = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(WCHAR) + * (lstrlenW(cmd_line) + lstrlenW(append) + 1) ); lstrcpyW(cmdline_new, cmd_line); - lstrcatW(cmdline_new, opt); + lstrcatW(cmdline_new, append); } tidy_cmdline = get_file_name( cmdline_new ? cmdline_new : cmd_line, name, ARRAY_SIZE(name) ); if (!tidy_cmdline) { - heap_free( cmdline_new ); + HeapFree( GetProcessHeap(), 0, cmdline_new ); return FALSE; } if (cmdline_new) { if (cmdline_new == tidy_cmdline) cmd_line = NULL; - else heap_free( cmdline_new ); + else HeapFree( GetProcessHeap(), 0, cmdline_new ); } app_name = name; } From 2b382652934d3c44b350823540b42eb6d66e01d6 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Fri, 21 Jan 2022 14:42:12 -0500 Subject: [PATCH 0611/2542] kernelbase: Add stub for GetConsoleSelectionInfo. Signed-off-by: Derek Lesho --- dlls/kernel32/kernel32.spec | 2 +- dlls/kernelbase/console.c | 8 ++++++++ dlls/kernelbase/kernelbase.spec | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index b74b5a8ce981..e757cbd9d3d8 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -622,7 +622,7 @@ @ stdcall -import GetConsoleProcessList(ptr long) @ stdcall -import GetConsoleScreenBufferInfo(long ptr) @ stdcall -import GetConsoleScreenBufferInfoEx(long ptr) -# @ stub GetConsoleSelectionInfo +@ stdcall -import GetConsoleSelectionInfo(ptr) @ stdcall -import GetConsoleTitleA(ptr long) @ stdcall -import GetConsoleTitleW(ptr long) @ stdcall -import GetConsoleWindow() diff --git a/dlls/kernelbase/console.c b/dlls/kernelbase/console.c index 97c5462c42fb..84ae027b1177 100644 --- a/dlls/kernelbase/console.c +++ b/dlls/kernelbase/console.c @@ -1068,6 +1068,14 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetConsoleScreenBufferInfoEx( HANDLE handle, } +BOOL WINAPI DECLSPEC_HOTPATCH GetConsoleSelectionInfo(CONSOLE_SELECTION_INFO *info) +{ + FIXME("stub (%p)\n", info); + info->dwFlags = CONSOLE_NO_SELECTION; + return TRUE; +} + + /****************************************************************************** * GetConsoleTitleA (kernelbase.@) */ diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index 9817beb88f60..1e22dda5d7df 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -472,6 +472,7 @@ @ stdcall GetConsoleProcessList(ptr long) @ stdcall GetConsoleScreenBufferInfo(long ptr) @ stdcall GetConsoleScreenBufferInfoEx(long ptr) +@ stdcall GetConsoleSelectionInfo(ptr) @ stdcall GetConsoleTitleA(ptr long) @ stdcall GetConsoleTitleW(ptr long) @ stdcall GetConsoleWindow() From 7f5f16e01c667734d368f166fc26c98ca9c9e42e Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 30 Mar 2021 21:45:05 -0400 Subject: [PATCH 0612/2542] kernelbase: Redirect BattlEye Launcher process creation to game executable. Signed-off-by: Derek Lesho CW-Bug-Id: #16650 --- dlls/kernelbase/process.c | 200 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 59899c3cbe09..79d5aefcfeb1 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -26,6 +26,7 @@ #include "windef.h" #include "winbase.h" #include "winnls.h" +#include "winver.h" #include "wincontypes.h" #include "winternl.h" @@ -503,6 +504,197 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalA( HANDLE token, const char * return ret; } +static int battleye_launcher_redirect_hack(const WCHAR *app_name, WCHAR *new_name, DWORD new_name_len, WCHAR **cmd_line) +{ + WCHAR full_path[MAX_PATH], config_path[MAX_PATH]; + WCHAR *p; + UINT size; + void *block; + DWORD *translation; + char buf[100]; + char *product_name; + int launcher_exe_len, game_exe_len, arg_len; + HANDLE launcher_cfg; + LARGE_INTEGER launcher_cfg_size; + char *configs, *config, *arch_32_exe = NULL, *arch_64_exe = NULL, *game_exe, *be_arg = NULL; + BOOL wow64; + WCHAR *new_cmd_line; + + if (!GetLongPathNameW( app_name, full_path, MAX_PATH )) lstrcpynW( full_path, app_name, MAX_PATH ); + if (!GetFullPathNameW( full_path, MAX_PATH, full_path, NULL )) lstrcpynW( full_path, app_name, MAX_PATH ); + + /* We detect the BattlEye launcher executable through the product name property, as the executable name varies */ + size = GetFileVersionInfoSizeExW(0, full_path, NULL); + if (!size) + return 0; + + block = HeapAlloc( GetProcessHeap(), 0, size ); + + if (!GetFileVersionInfoExW(0, full_path, 0, size, block)) + { + HeapFree( GetProcessHeap(), 0, block ); + return 0; + } + + if (!VerQueryValueA(block, "\\VarFileInfo\\Translation", (void **) &translation, &size) || size != 4) + { + HeapFree( GetProcessHeap(), 0, block ); + return 0; + } + + sprintf(buf, "\\StringFileInfo\\%08lx\\ProductName", MAKELONG(HIWORD(*translation), LOWORD(*translation))); + + if (!VerQueryValueA(block, buf, (void **) &product_name, &size)) + { + HeapFree( GetProcessHeap(), 0, block ); + return 0; + } + + if (strcmp(product_name, "BattlEye Launcher")) + { + HeapFree( GetProcessHeap(), 0, block); + return 0; + } + + HeapFree( GetProcessHeap(), 0, block ); + + TRACE("Detected launch of a BattlEye Launcher, attempting to launch game executable instead.\n"); + + lstrcpynW(config_path, full_path, MAX_PATH); + + for (p = config_path + wcslen(config_path); p != config_path; --p) + if (*p == '\\') break; + + if (*p == '\\') + { + *p = 0; + launcher_exe_len = wcslen(p + 1); + } + else + launcher_exe_len = wcslen(full_path); + + lstrcatW(config_path, L"\\BattlEye\\BELauncher.ini"); + + launcher_cfg = CreateFileW(config_path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (launcher_cfg == INVALID_HANDLE_VALUE) + return 0; + + if(!GetFileSizeEx(launcher_cfg, &launcher_cfg_size) || launcher_cfg_size.u.HighPart) + { + CloseHandle(launcher_cfg); + return 0; + } + + configs = HeapAlloc( GetProcessHeap(), 0, launcher_cfg_size.u.LowPart); + + if (!ReadFile(launcher_cfg, configs, launcher_cfg_size.u.LowPart, (DWORD *)&size, NULL) || size != launcher_cfg_size.u.LowPart) + { + CloseHandle(launcher_cfg); + HeapFree( GetProcessHeap(), 0, configs ); + return 0; + } + + CloseHandle(launcher_cfg); + + config = configs; + do + { + if (!strncmp(config, "32BitExe=", 9)) + arch_32_exe = config + 9; + + if (!strncmp(config, "64BitExe=", 9)) + arch_64_exe = config + 9; + + if (!strncmp(config, "BEArg=", 6)) + be_arg = config + 6; + } + while ((config = strchr(config, '\n')) && *(config++)); + + if (arch_64_exe && (sizeof(void *) == 8 || (IsWow64Process(GetCurrentProcess(), &wow64) && wow64))) + game_exe = arch_64_exe; + else if (arch_32_exe) + game_exe = arch_32_exe; + else + { + HeapFree( GetProcessHeap(), 0, configs ); + WARN("Failed to find game executable name from BattlEye config.\n"); + return 0; + } + + if (strchr(game_exe, '\r')) + *(strchr(game_exe, '\r')) = 0; + if (strchr(game_exe, '\n')) + *(strchr(game_exe, '\n')) = 0; + game_exe_len = MultiByteToWideChar(CP_ACP, 0, game_exe, -1, NULL, 0) - 1; + + if (be_arg) + { + if (strchr(be_arg, '\r')) + *(strchr(be_arg, '\r')) = 0; + if (strchr(be_arg, '\n')) + *(strchr(be_arg, '\n')) = 0; + arg_len = MultiByteToWideChar(CP_ACP, 0, be_arg, -1, NULL, 0) - 1; + } + + TRACE("Launching game executable %s for BattlEye.\n", game_exe); + + if ((wcslen(app_name) - launcher_exe_len) + game_exe_len + 1 > new_name_len) + { + HeapFree( GetProcessHeap(), 0, configs ); + WARN("Game executable path doesn't fit in buffer.\n"); + return 0; + } + + wcscpy(new_name, app_name); + p = new_name + wcslen(new_name) - launcher_exe_len; + MultiByteToWideChar(CP_ACP, 0, game_exe, -1, p, game_exe_len + 1); + + /* find and replace executable name in command line, and add BE argument */ + p = *cmd_line; + if (p[0] == '\"') + p++; + + if (!wcsncmp(p, app_name, wcslen(app_name))) + p += wcslen(app_name) - launcher_exe_len; + else + p = NULL; + + if (p || be_arg) + { + size = wcslen(*cmd_line) + 1; + if (p) + size += game_exe_len - launcher_exe_len; + if (be_arg) + size += 1 /* space */ + arg_len; + size *= sizeof(WCHAR); + + /* freed by parent function */ + new_cmd_line = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size ); + + if (p) + { + lstrcpynW(new_cmd_line, *cmd_line, p - *cmd_line); + MultiByteToWideChar(CP_ACP, 0, game_exe, -1, new_cmd_line + wcslen(new_cmd_line), game_exe_len + 1); + wcscat(new_cmd_line, p + launcher_exe_len); + } + else + { + wcscpy(new_cmd_line, *cmd_line); + } + + if (be_arg) + { + wcscat(new_cmd_line, L" "); + MultiByteToWideChar(CP_ACP, 0, be_arg, -1, new_cmd_line + wcslen(new_cmd_line), arg_len + 1); + } + + *cmd_line = new_cmd_line; + } + + HeapFree( GetProcessHeap(), 0, configs ); + return 1; +} + static const WCHAR *hack_append_command_line( const WCHAR *cmd ) { static const struct @@ -601,6 +793,14 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR app_name = name; } + p = tidy_cmdline; + if (battleye_launcher_redirect_hack( app_name, name, ARRAY_SIZE(name), &tidy_cmdline )) + { + app_name = name; + if (p != tidy_cmdline && p != cmd_line) + HeapFree( GetProcessHeap(), 0, p ); + } + /* Warn if unsupported features are used */ if (flags & (IDLE_PRIORITY_CLASS | HIGH_PRIORITY_CLASS | REALTIME_PRIORITY_CLASS | From e13891a2b61e4a316da99e554c8026306b2a860c Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Fri, 21 Jan 2022 14:40:43 -0500 Subject: [PATCH 0613/2542] battleye: Add launcher process instead of redirecting CreateProcess call. Fixes Arma 3 Launcher CW-Bug-Id: #18934 --- configure.ac | 1 + dlls/kernelbase/process.c | 134 ++++---------------------------- programs/belauncher/Makefile.in | 7 ++ programs/belauncher/main.c | 118 ++++++++++++++++++++++++++++ 4 files changed, 141 insertions(+), 119 deletions(-) create mode 100644 programs/belauncher/Makefile.in create mode 100644 programs/belauncher/main.c diff --git a/configure.ac b/configure.ac index 08704ea4f2ba..831fb6701f23 100644 --- a/configure.ac +++ b/configure.ac @@ -3478,6 +3478,7 @@ WINE_CONFIG_MAKEFILE(po) WINE_CONFIG_MAKEFILE(programs/arp) WINE_CONFIG_MAKEFILE(programs/aspnet_regiis) WINE_CONFIG_MAKEFILE(programs/attrib) +WINE_CONFIG_MAKEFILE(programs/belauncher) WINE_CONFIG_MAKEFILE(programs/cabarc) WINE_CONFIG_MAKEFILE(programs/cacls) WINE_CONFIG_MAKEFILE(programs/certutil) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 79d5aefcfeb1..9d48c5887038 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -506,18 +506,15 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalA( HANDLE token, const char * static int battleye_launcher_redirect_hack(const WCHAR *app_name, WCHAR *new_name, DWORD new_name_len, WCHAR **cmd_line) { - WCHAR full_path[MAX_PATH], config_path[MAX_PATH]; + static const WCHAR belauncherW[] = L"c:\\windows\\system32\\belauncher.exe"; + + WCHAR full_path[MAX_PATH]; WCHAR *p; UINT size; void *block; DWORD *translation; char buf[100]; char *product_name; - int launcher_exe_len, game_exe_len, arg_len; - HANDLE launcher_cfg; - LARGE_INTEGER launcher_cfg_size; - char *configs, *config, *arch_32_exe = NULL, *arch_64_exe = NULL, *game_exe, *be_arg = NULL; - BOOL wow64; WCHAR *new_cmd_line; if (!GetLongPathNameW( app_name, full_path, MAX_PATH )) lstrcpynW( full_path, app_name, MAX_PATH ); @@ -558,96 +555,15 @@ static int battleye_launcher_redirect_hack(const WCHAR *app_name, WCHAR *new_nam HeapFree( GetProcessHeap(), 0, block ); - TRACE("Detected launch of a BattlEye Launcher, attempting to launch game executable instead.\n"); - - lstrcpynW(config_path, full_path, MAX_PATH); - - for (p = config_path + wcslen(config_path); p != config_path; --p) - if (*p == '\\') break; - - if (*p == '\\') - { - *p = 0; - launcher_exe_len = wcslen(p + 1); - } - else - launcher_exe_len = wcslen(full_path); - - lstrcatW(config_path, L"\\BattlEye\\BELauncher.ini"); - - launcher_cfg = CreateFileW(config_path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (launcher_cfg == INVALID_HANDLE_VALUE) - return 0; - - if(!GetFileSizeEx(launcher_cfg, &launcher_cfg_size) || launcher_cfg_size.u.HighPart) - { - CloseHandle(launcher_cfg); - return 0; - } - - configs = HeapAlloc( GetProcessHeap(), 0, launcher_cfg_size.u.LowPart); - - if (!ReadFile(launcher_cfg, configs, launcher_cfg_size.u.LowPart, (DWORD *)&size, NULL) || size != launcher_cfg_size.u.LowPart) - { - CloseHandle(launcher_cfg); - HeapFree( GetProcessHeap(), 0, configs ); - return 0; - } - - CloseHandle(launcher_cfg); - - config = configs; - do - { - if (!strncmp(config, "32BitExe=", 9)) - arch_32_exe = config + 9; - - if (!strncmp(config, "64BitExe=", 9)) - arch_64_exe = config + 9; - - if (!strncmp(config, "BEArg=", 6)) - be_arg = config + 6; - } - while ((config = strchr(config, '\n')) && *(config++)); - - if (arch_64_exe && (sizeof(void *) == 8 || (IsWow64Process(GetCurrentProcess(), &wow64) && wow64))) - game_exe = arch_64_exe; - else if (arch_32_exe) - game_exe = arch_32_exe; - else - { - HeapFree( GetProcessHeap(), 0, configs ); - WARN("Failed to find game executable name from BattlEye config.\n"); - return 0; - } - - if (strchr(game_exe, '\r')) - *(strchr(game_exe, '\r')) = 0; - if (strchr(game_exe, '\n')) - *(strchr(game_exe, '\n')) = 0; - game_exe_len = MultiByteToWideChar(CP_ACP, 0, game_exe, -1, NULL, 0) - 1; - - if (be_arg) - { - if (strchr(be_arg, '\r')) - *(strchr(be_arg, '\r')) = 0; - if (strchr(be_arg, '\n')) - *(strchr(be_arg, '\n')) = 0; - arg_len = MultiByteToWideChar(CP_ACP, 0, be_arg, -1, NULL, 0) - 1; - } - - TRACE("Launching game executable %s for BattlEye.\n", game_exe); + TRACE("Detected launch of a BattlEye Launcher, redirecting to Proton version.\n"); - if ((wcslen(app_name) - launcher_exe_len) + game_exe_len + 1 > new_name_len) + if (new_name_len < wcslen(belauncherW) + 1) { - HeapFree( GetProcessHeap(), 0, configs ); WARN("Game executable path doesn't fit in buffer.\n"); return 0; } - wcscpy(new_name, app_name); - p = new_name + wcslen(new_name) - launcher_exe_len; - MultiByteToWideChar(CP_ACP, 0, game_exe, -1, p, game_exe_len + 1); + wcscpy(new_name, belauncherW); /* find and replace executable name in command line, and add BE argument */ p = *cmd_line; @@ -655,43 +571,23 @@ static int battleye_launcher_redirect_hack(const WCHAR *app_name, WCHAR *new_nam p++; if (!wcsncmp(p, app_name, wcslen(app_name))) - p += wcslen(app_name) - launcher_exe_len; - else - p = NULL; - - if (p || be_arg) { - size = wcslen(*cmd_line) + 1; - if (p) - size += game_exe_len - launcher_exe_len; - if (be_arg) - size += 1 /* space */ + arg_len; - size *= sizeof(WCHAR); + new_cmd_line = HeapAlloc( GetProcessHeap(), 0, ( wcslen(*cmd_line) + wcslen(belauncherW) + 1 - wcslen(app_name) ) * sizeof(WCHAR) ); - /* freed by parent function */ - new_cmd_line = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size ); + wcscpy(new_cmd_line, *cmd_line); + p = new_cmd_line; + if (p[0] == '\"') + p++; - if (p) - { - lstrcpynW(new_cmd_line, *cmd_line, p - *cmd_line); - MultiByteToWideChar(CP_ACP, 0, game_exe, -1, new_cmd_line + wcslen(new_cmd_line), game_exe_len + 1); - wcscat(new_cmd_line, p + launcher_exe_len); - } - else - { - wcscpy(new_cmd_line, *cmd_line); - } + memmove( p + wcslen(belauncherW), p + wcslen(app_name), (wcslen(p) - wcslen(belauncherW)) * sizeof(WCHAR) ); + memcpy( p, belauncherW, wcslen(belauncherW) * sizeof(WCHAR) ); - if (be_arg) - { - wcscat(new_cmd_line, L" "); - MultiByteToWideChar(CP_ACP, 0, be_arg, -1, new_cmd_line + wcslen(new_cmd_line), arg_len + 1); - } + TRACE("old command line %s.\n", debugstr_w(*cmd_line)); + TRACE("new command line %s.\n", debugstr_w(new_cmd_line)); *cmd_line = new_cmd_line; } - HeapFree( GetProcessHeap(), 0, configs ); return 1; } diff --git a/programs/belauncher/Makefile.in b/programs/belauncher/Makefile.in new file mode 100644 index 000000000000..9800c0b45ba2 --- /dev/null +++ b/programs/belauncher/Makefile.in @@ -0,0 +1,7 @@ +MODULE = belauncher.exe +IMPORTS = + +EXTRADLLFLAGS = -mwindows -municode + +SOURCES = \ + main.c \ diff --git a/programs/belauncher/main.c b/programs/belauncher/main.c new file mode 100644 index 000000000000..004a7d1a711e --- /dev/null +++ b/programs/belauncher/main.c @@ -0,0 +1,118 @@ +#define WIN32_LEAN_AND_MEAN +#include +#include + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(belauncher); + +int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cmdshow) +{ + char *configs, *config, *arch_32_exe = NULL, *arch_64_exe = NULL, *game_exe, *be_arg = NULL; + LARGE_INTEGER launcher_cfg_size; + unsigned char battleye_status; + int game_exe_len, arg_len; + PROCESS_INFORMATION pi; + HANDLE launcher_cfg; + LPWSTR launch_cmd; + STARTUPINFOW si = {0}; + DWORD size; + BOOL wow64; + + battleye_status = 0x3; /* Starting */ + _write(1, &battleye_status, 1); + + launcher_cfg = CreateFileW(L"Battleye\\BELauncher.ini", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (launcher_cfg == INVALID_HANDLE_VALUE) + goto start_failed; + + if(!GetFileSizeEx(launcher_cfg, &launcher_cfg_size) || launcher_cfg_size.u.HighPart) + { + CloseHandle(launcher_cfg); + goto start_failed; + } + + configs = HeapAlloc( GetProcessHeap(), 0, launcher_cfg_size.u.LowPart); + + if (!ReadFile(launcher_cfg, configs, launcher_cfg_size.u.LowPart, &size, NULL) || size != launcher_cfg_size.u.LowPart) + { + CloseHandle(launcher_cfg); + HeapFree( GetProcessHeap(), 0, configs ); + goto start_failed; + } + + CloseHandle(launcher_cfg); + + config = configs; + do + { + if (!strncmp(config, "32BitExe=", 9)) + arch_32_exe = config + 9; + + if (!strncmp(config, "64BitExe=", 9)) + arch_64_exe = config + 9; + + if (!strncmp(config, "BEArg=", 6)) + be_arg = config + 6; + } + while ((config = strchr(config, '\n')) && *(config++)); + + if (arch_64_exe && (sizeof(void *) == 8 || (IsWow64Process(GetCurrentProcess(), &wow64) && wow64))) + game_exe = arch_64_exe; + else if (arch_32_exe) + game_exe = arch_32_exe; + else + { + HeapFree( GetProcessHeap(), 0, configs ); + WINE_WARN("Failed to find game executable name from BattlEye config.\n"); + goto start_failed; + } + + if (strchr(game_exe, '\r')) + *(strchr(game_exe, '\r')) = 0; + if (strchr(game_exe, '\n')) + *(strchr(game_exe, '\n')) = 0; + game_exe_len = MultiByteToWideChar(CP_ACP, 0, game_exe, -1, NULL, 0) - 1; + + if (!be_arg) arg_len = 0; + else + { + if (strchr(be_arg, '\r')) + *(strchr(be_arg, '\r')) = 0; + if (strchr(be_arg, '\n')) + *(strchr(be_arg, '\n')) = 0; + arg_len = MultiByteToWideChar(CP_ACP, 0, be_arg, -1, NULL, 0) - 1; + } + + WINE_TRACE("Launching game executable %s for BattlEye.\n", game_exe); + battleye_status = 0x9; /* Launching Game */ + _write(1, &battleye_status, 1); + + launch_cmd = HeapAlloc(GetProcessHeap(), 0, (game_exe_len + 1 + wcslen(cmdline) + 1 + arg_len + 1) * sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, game_exe, -1, launch_cmd, game_exe_len + 1); + launch_cmd[game_exe_len] = ' '; + + wcscpy(launch_cmd + game_exe_len + 1, cmdline); + launch_cmd[game_exe_len + 1 + wcslen(cmdline)] = ' '; + + MultiByteToWideChar(CP_ACP, 0, be_arg, -1, launch_cmd + game_exe_len + 1 + wcslen(cmdline) + 1, arg_len + 1); + + if (!CreateProcessW(NULL, launch_cmd, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi)) + { + battleye_status = 0xA; /* Launch Failed */ + _write(1, &battleye_status, 1); + + HeapFree( GetProcessHeap(), 0, launch_cmd ); + return GetLastError(); + } + HeapFree( GetProcessHeap(), 0, launch_cmd ); + + WaitForSingleObject(pi.hProcess, INFINITE); + CloseHandle(pi.hProcess); + return 0; + +start_failed: + battleye_status = 0x4; /* Start Failed */ + _write(1, &battleye_status, 1); + return 0; +} From 3893ab6c460806a73494d73fbd690459abf911cc Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Fri, 26 Mar 2021 10:48:14 -0400 Subject: [PATCH 0614/2542] ntdll: Try to load builtin DLLs from Battleye Runtime directory. Signed-off-by: Derek Lesho CW-Bug-Id: #16650 --- dlls/ntdll/unix/loader.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 4d184e6210d1..4556f6ca72b7 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -373,11 +373,14 @@ static const char *get_pe_dir( WORD machine ) static void set_dll_path(void) { - char *p, *path = getenv( "WINEDLLPATH" ); + char *p, *path = getenv( "WINEDLLPATH" ), *be_runtime = getenv( "PROTON_BATTLEYE_RUNTIME" ); int i, count = 0; if (path) for (p = path, count = 1; *p; p++) if (*p == ':') count++; + if (be_runtime) + count += 2; + dll_paths = malloc( (count + 2) * sizeof(*dll_paths) ); count = 0; @@ -390,6 +393,24 @@ static void set_dll_path(void) free( path ); } + if (be_runtime) + { + const char lib32[] = "/v1/lib/wine/"; + const char lib64[] = "/v1/lib64/wine/"; + + p = malloc( strlen(be_runtime) + strlen(lib32) + 1 ); + strcpy(p, be_runtime); + strcat(p, lib32); + + dll_paths[count++] = p; + + p = malloc( strlen(be_runtime) + strlen(lib64) + 1 ); + strcpy(p, be_runtime); + strcat(p, lib64); + + dll_paths[count++] = p; + } + for (i = 0; i < count; i++) dll_path_maxlen = max( dll_path_maxlen, strlen(dll_paths[i]) ); dll_paths[count] = NULL; } From 7ac036a186b4b6262367a02fa086e5f49903ed34 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Mon, 6 Dec 2021 15:13:40 +0100 Subject: [PATCH 0615/2542] ntdll: Load EAC bridge files from PROTON_EAC_RUNTIME path. --- dlls/ntdll/unix/loader.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 4556f6ca72b7..cb59e6391d06 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -373,7 +373,7 @@ static const char *get_pe_dir( WORD machine ) static void set_dll_path(void) { - char *p, *path = getenv( "WINEDLLPATH" ), *be_runtime = getenv( "PROTON_BATTLEYE_RUNTIME" ); + char *p, *path = getenv( "WINEDLLPATH" ), *be_runtime = getenv( "PROTON_BATTLEYE_RUNTIME" ), *eac_runtime = getenv( "PROTON_EAC_RUNTIME" ); int i, count = 0; if (path) for (p = path, count = 1; *p; p++) if (*p == ':') count++; @@ -381,6 +381,9 @@ static void set_dll_path(void) if (be_runtime) count += 2; + if (eac_runtime) + count += 2; + dll_paths = malloc( (count + 2) * sizeof(*dll_paths) ); count = 0; @@ -411,6 +414,24 @@ static void set_dll_path(void) dll_paths[count++] = p; } + if (eac_runtime) + { + const char lib32[] = "/v2/lib32/"; + const char lib64[] = "/v2/lib64/"; + + p = malloc( strlen(eac_runtime) + strlen(lib32) + 1 ); + strcpy(p, eac_runtime); + strcat(p, lib32); + + dll_paths[count++] = p; + + p = malloc( strlen(eac_runtime) + strlen(lib64) + 1 ); + strcpy(p, eac_runtime); + strcat(p, lib64); + + dll_paths[count++] = p; + } + for (i = 0; i < count; i++) dll_path_maxlen = max( dll_path_maxlen, strlen(dll_paths[i]) ); dll_paths[count] = NULL; } From 08ca5d19f5a85a85807e56fd076cb5a6a9f381e4 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 18 Jan 2022 17:16:15 -0500 Subject: [PATCH 0616/2542] ntdll: Only load EAC bridge when Linux library is present. --- dlls/ntdll/unix/loadorder.c | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/dlls/ntdll/unix/loadorder.c b/dlls/ntdll/unix/loadorder.c index aa987a801860..3d9575d83f2d 100644 --- a/dlls/ntdll/unix/loadorder.c +++ b/dlls/ntdll/unix/loadorder.c @@ -378,6 +378,10 @@ void set_load_order_app_name( const WCHAR *app_name ) */ enum loadorder get_load_order( const UNICODE_STRING *nt_name ) { + static const WCHAR easyanticheat_x86W[] = {'e','a','s','y','a','n','t','i','c','h','e','a','t','_','x','8','6','.','d','l','l',0}; + static const WCHAR easyanticheat_x64W[] = {'e','a','s','y','a','n','t','i','c','h','e','a','t','_','x','6','4','.','d','l','l',0}; + static const WCHAR soW[] = {'s','o',0}; + static const WCHAR prefixW[] = {'\\','?','?','\\'}; enum loadorder ret = LO_INVALID; const WCHAR *path = nt_name->Buffer; @@ -391,6 +395,41 @@ enum loadorder get_load_order( const UNICODE_STRING *nt_name ) TRACE("looking for %s\n", debugstr_w(path)); + /* HACK: special logic for easyanticheat bridge: only load the bridge (builtin) if there exists a native version of the library next to the windows version */ + basename = get_basename((WCHAR *)path); + if (!wcsicmp(basename, easyanticheat_x86W) || !wcsicmp(basename, easyanticheat_x64W)) + { + UNICODE_STRING eac_unix_name; + OBJECT_ATTRIBUTES attr; + char *unix_path = NULL; + NTSTATUS status; + + len = wcslen(nt_name->Buffer); + eac_unix_name.Buffer = malloc( (len + 1) * sizeof(WCHAR) ); + wcscpy(eac_unix_name.Buffer, nt_name->Buffer); + + basename = get_basename(eac_unix_name.Buffer); + wcscpy(&basename[18], soW); + eac_unix_name.Length = eac_unix_name.MaximumLength = wcslen(eac_unix_name.Buffer) * sizeof(WCHAR); + InitializeObjectAttributes(&attr, &eac_unix_name, 0, NULL, NULL); + + if (!(status = nt_to_unix_file_name(&attr, &unix_path, FILE_OPEN))) + { + free(unix_path); + free(eac_unix_name.Buffer); + ret = LO_BUILTIN; + TRACE( "got hardcoded %s for %s, as the eac unix library is present\n", debugstr_loadorder(ret), debugstr_w(path) ); + return ret; + } + else + { + ret = LO_NATIVE; + TRACE( "got hardcoded %s for %s, as the eac unix library (%s) is not present. status %x\n", debugstr_loadorder(ret), debugstr_w(path), debugstr_w(eac_unix_name.Buffer), (int)status ); + free(eac_unix_name.Buffer); + return ret; + } + } + /* Strip path information if the module resides in the system directory */ if (!wcsnicmp( system_dir + 4, path, wcslen(system_dir) - 4 )) From b5a497d11b3f3a313c3d6cb4d289e773af43d6bc Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 16 Feb 2022 14:24:41 -0500 Subject: [PATCH 0617/2542] kernelbase: Don't load EAC bridge in the EAC Launcher process. Signed-off-by: Derek Lesho --- dlls/kernelbase/process.c | 64 ++++++++++++++++++++++++++++--------- dlls/ntdll/unix/loadorder.c | 21 ++++++++++++ 2 files changed, 70 insertions(+), 15 deletions(-) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 9d48c5887038..368fcf6cd7bd 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -504,39 +504,35 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalA( HANDLE token, const char * return ret; } -static int battleye_launcher_redirect_hack(const WCHAR *app_name, WCHAR *new_name, DWORD new_name_len, WCHAR **cmd_line) +/* Returns TRUE if the product name of the app matches the parameter */ +static BOOL product_name_matches(const WCHAR *app_name, const char *match) { - static const WCHAR belauncherW[] = L"c:\\windows\\system32\\belauncher.exe"; - WCHAR full_path[MAX_PATH]; - WCHAR *p; - UINT size; - void *block; DWORD *translation; - char buf[100]; char *product_name; - WCHAR *new_cmd_line; + char buf[100]; + void *block; + UINT size; if (!GetLongPathNameW( app_name, full_path, MAX_PATH )) lstrcpynW( full_path, app_name, MAX_PATH ); if (!GetFullPathNameW( full_path, MAX_PATH, full_path, NULL )) lstrcpynW( full_path, app_name, MAX_PATH ); - /* We detect the BattlEye launcher executable through the product name property, as the executable name varies */ size = GetFileVersionInfoSizeExW(0, full_path, NULL); if (!size) - return 0; + return FALSE; block = HeapAlloc( GetProcessHeap(), 0, size ); if (!GetFileVersionInfoExW(0, full_path, 0, size, block)) { HeapFree( GetProcessHeap(), 0, block ); - return 0; + return FALSE; } if (!VerQueryValueA(block, "\\VarFileInfo\\Translation", (void **) &translation, &size) || size != 4) { HeapFree( GetProcessHeap(), 0, block ); - return 0; + return FALSE; } sprintf(buf, "\\StringFileInfo\\%08lx\\ProductName", MAKELONG(HIWORD(*translation), LOWORD(*translation))); @@ -544,16 +540,28 @@ static int battleye_launcher_redirect_hack(const WCHAR *app_name, WCHAR *new_nam if (!VerQueryValueA(block, buf, (void **) &product_name, &size)) { HeapFree( GetProcessHeap(), 0, block ); - return 0; + return FALSE; } - if (strcmp(product_name, "BattlEye Launcher")) + if (strcmp(product_name, match)) { HeapFree( GetProcessHeap(), 0, block); - return 0; + return FALSE; } HeapFree( GetProcessHeap(), 0, block ); + return TRUE; +} + +static int battleye_launcher_redirect_hack(const WCHAR *app_name, WCHAR *new_name, DWORD new_name_len, WCHAR **cmd_line) +{ + static const WCHAR belauncherW[] = L"c:\\windows\\system32\\belauncher.exe"; + WCHAR *new_cmd_line; + WCHAR *p; + + /* We detect the BattlEye launcher executable through the product name property, as the executable name varies */ + if (!product_name_matches(app_name, "BattlEye Launcher")) + return 0; TRACE("Detected launch of a BattlEye Launcher, redirecting to Proton version.\n"); @@ -722,6 +730,32 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR goto done; } + /* Set PROTON_EAC_LAUNCHER_PROCESS when launching the EAC launcher to let ntdll know to load the native EAC client library. + - We don't do this check in ntdll itself because it's harder to get the product name there + - we don't overwrite WINEDLLOVERRIDES because it's fetched from the unix environment */ + { + UNICODE_STRING is_eac_launcher_us; + UNICODE_STRING one_us; + + WCHAR *new_env = RtlAllocateHeap( GetProcessHeap(), 0, params->EnvironmentSize ); + memcpy(new_env, params->Environment, params->EnvironmentSize); + + RtlDestroyProcessParameters( params ); + + RtlInitUnicodeString( &is_eac_launcher_us, L"PROTON_EAC_LAUNCHER_PROCESS" ); + RtlInitUnicodeString( &one_us, L"1" ); + RtlSetEnvironmentVariable( &new_env, &is_eac_launcher_us, product_name_matches(app_name, "EasyAntiCheat Launcher") ? &one_us : NULL ); + + params = create_process_params( app_name, tidy_cmdline, cur_dir, new_env, flags | CREATE_UNICODE_ENVIRONMENT, startup_info ); + + RtlFreeHeap(GetProcessHeap(), 0, new_env); + if (!params) + { + status = STATUS_NO_MEMORY; + goto done; + } + } + if (flags & (DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS)) { if ((status = DbgUiConnectToDbg())) goto done; diff --git a/dlls/ntdll/unix/loadorder.c b/dlls/ntdll/unix/loadorder.c index 3d9575d83f2d..a13d54ec263a 100644 --- a/dlls/ntdll/unix/loadorder.c +++ b/dlls/ntdll/unix/loadorder.c @@ -59,6 +59,7 @@ static HANDLE std_key; static HANDLE app_key; static BOOL init_done; static BOOL main_exe_loaded; +static BOOL eac_launcher_process; /*************************************************************************** @@ -362,11 +363,24 @@ static enum loadorder get_load_order_value( HANDLE std_key, HANDLE app_key, WCHA */ void set_load_order_app_name( const WCHAR *app_name ) { + static const WCHAR eac_launcherW[] = {'P','R','O','T','O','N','_','E','A','C','_','L','A','U','N','C','H','E','R','_','P','R','O','C','E','S','S',0}; const WCHAR *p; if ((p = wcsrchr( app_name, '\\' ))) app_name = p + 1; app_key = open_app_key( app_name ); main_exe_loaded = TRUE; + + p = NtCurrentTeb()->Peb->ProcessParameters->Environment; + while(*p) + { + if (!wcsncmp( p, eac_launcherW, ARRAY_SIZE(eac_launcherW) - 1 )) + { + eac_launcher_process = TRUE; + break; + } + + p += wcslen(p) + 1; + } } @@ -404,6 +418,13 @@ enum loadorder get_load_order( const UNICODE_STRING *nt_name ) char *unix_path = NULL; NTSTATUS status; + if (eac_launcher_process) + { + ret = LO_NATIVE; + TRACE("got hardcoded %s for %s, as this is the EAC launcher process\n", debugstr_loadorder(ret), debugstr_w(path) ); + return ret; + } + len = wcslen(nt_name->Buffer); eac_unix_name.Buffer = malloc( (len + 1) * sizeof(WCHAR) ); wcscpy(eac_unix_name.Buffer, nt_name->Buffer); From 126116321f2ea3c0dde293356f5e0ac4981ec953 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 16 Feb 2022 14:26:51 -0500 Subject: [PATCH 0618/2542] ntdll: Decide load order of easyanticheat.dll based off bridge detection logic. Signed-off-by: Derek Lesho --- dlls/ntdll/unix/loadorder.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/loadorder.c b/dlls/ntdll/unix/loadorder.c index a13d54ec263a..bbe509288806 100644 --- a/dlls/ntdll/unix/loadorder.c +++ b/dlls/ntdll/unix/loadorder.c @@ -394,6 +394,7 @@ enum loadorder get_load_order( const UNICODE_STRING *nt_name ) { static const WCHAR easyanticheat_x86W[] = {'e','a','s','y','a','n','t','i','c','h','e','a','t','_','x','8','6','.','d','l','l',0}; static const WCHAR easyanticheat_x64W[] = {'e','a','s','y','a','n','t','i','c','h','e','a','t','_','x','6','4','.','d','l','l',0}; + static const WCHAR easyanticheatW[] = {'e','a','s','y','a','n','t','i','c','h','e','a','t','.','d','l','l',0}; static const WCHAR soW[] = {'s','o',0}; static const WCHAR prefixW[] = {'\\','?','?','\\'}; @@ -411,7 +412,7 @@ enum loadorder get_load_order( const UNICODE_STRING *nt_name ) /* HACK: special logic for easyanticheat bridge: only load the bridge (builtin) if there exists a native version of the library next to the windows version */ basename = get_basename((WCHAR *)path); - if (!wcsicmp(basename, easyanticheat_x86W) || !wcsicmp(basename, easyanticheat_x64W)) + if (!wcsicmp(basename, easyanticheat_x86W) || !wcsicmp(basename, easyanticheat_x64W) || !wcsicmp(basename, easyanticheatW)) { UNICODE_STRING eac_unix_name; OBJECT_ATTRIBUTES attr; @@ -426,10 +427,12 @@ enum loadorder get_load_order( const UNICODE_STRING *nt_name ) } len = wcslen(nt_name->Buffer); - eac_unix_name.Buffer = malloc( (len + 1) * sizeof(WCHAR) ); + eac_unix_name.Buffer = malloc( (len + 5) * sizeof(WCHAR) ); wcscpy(eac_unix_name.Buffer, nt_name->Buffer); basename = get_basename(eac_unix_name.Buffer); + if (!wcsicmp(basename, easyanticheatW)) + wcscpy(basename, easyanticheat_x64W); wcscpy(&basename[18], soW); eac_unix_name.Length = eac_unix_name.MaximumLength = wcslen(eac_unix_name.Buffer) * sizeof(WCHAR); InitializeObjectAttributes(&attr, &eac_unix_name, 0, NULL, NULL); From f5489b054cf6d8e614caf104cbdd5e7566aa93f0 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 12 Apr 2023 18:25:03 -0600 Subject: [PATCH 0619/2542] kernelbase: Remove command line fixup code from battleye_launcher_redirect_hack(). CW-Bug-Id: #22133 --- dlls/kernelbase/process.c | 45 ++++++--------------------------------- 1 file changed, 7 insertions(+), 38 deletions(-) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 368fcf6cd7bd..f1e37bc5496d 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -553,49 +553,23 @@ static BOOL product_name_matches(const WCHAR *app_name, const char *match) return TRUE; } -static int battleye_launcher_redirect_hack(const WCHAR *app_name, WCHAR *new_name, DWORD new_name_len, WCHAR **cmd_line) +static int battleye_launcher_redirect_hack( const WCHAR *app_name, WCHAR *new_name, DWORD new_name_len ) { static const WCHAR belauncherW[] = L"c:\\windows\\system32\\belauncher.exe"; - WCHAR *new_cmd_line; - WCHAR *p; /* We detect the BattlEye launcher executable through the product name property, as the executable name varies */ - if (!product_name_matches(app_name, "BattlEye Launcher")) + if (!product_name_matches( app_name, "BattlEye Launcher" )) return 0; - TRACE("Detected launch of a BattlEye Launcher, redirecting to Proton version.\n"); + TRACE( "Detected launch of a BattlEye Launcher, redirecting to Proton version.\n" ); - if (new_name_len < wcslen(belauncherW) + 1) + if (new_name_len < wcslen( belauncherW ) + 1) { - WARN("Game executable path doesn't fit in buffer.\n"); + ERR( "Game executable path doesn't fit in buffer.\n" ); return 0; } - wcscpy(new_name, belauncherW); - - /* find and replace executable name in command line, and add BE argument */ - p = *cmd_line; - if (p[0] == '\"') - p++; - - if (!wcsncmp(p, app_name, wcslen(app_name))) - { - new_cmd_line = HeapAlloc( GetProcessHeap(), 0, ( wcslen(*cmd_line) + wcslen(belauncherW) + 1 - wcslen(app_name) ) * sizeof(WCHAR) ); - - wcscpy(new_cmd_line, *cmd_line); - p = new_cmd_line; - if (p[0] == '\"') - p++; - - memmove( p + wcslen(belauncherW), p + wcslen(app_name), (wcslen(p) - wcslen(belauncherW)) * sizeof(WCHAR) ); - memcpy( p, belauncherW, wcslen(belauncherW) * sizeof(WCHAR) ); - - TRACE("old command line %s.\n", debugstr_w(*cmd_line)); - TRACE("new command line %s.\n", debugstr_w(new_cmd_line)); - - *cmd_line = new_cmd_line; - } - + wcscpy( new_name, belauncherW ); return 1; } @@ -697,13 +671,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR app_name = name; } - p = tidy_cmdline; - if (battleye_launcher_redirect_hack( app_name, name, ARRAY_SIZE(name), &tidy_cmdline )) - { + if (battleye_launcher_redirect_hack( app_name, name, ARRAY_SIZE(name) )) app_name = name; - if (p != tidy_cmdline && p != cmd_line) - HeapFree( GetProcessHeap(), 0, p ); - } /* Warn if unsupported features are used */ From b2ac5b3629455662d233f19bada2d8233115f28c Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 12 Apr 2023 18:51:15 -0600 Subject: [PATCH 0620/2542] kernelbase: Set PROTON_ORIG_LAUNCHER_NAME when starting builtin BattleEye launcher. CW-Bug-Id: #22133 --- dlls/kernelbase/process.c | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index f1e37bc5496d..740eff05af56 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -553,9 +553,11 @@ static BOOL product_name_matches(const WCHAR *app_name, const char *match) return TRUE; } -static int battleye_launcher_redirect_hack( const WCHAR *app_name, WCHAR *new_name, DWORD new_name_len ) +static int battleye_launcher_redirect_hack( const WCHAR *app_name, WCHAR *new_name, DWORD new_name_len, + WCHAR **orig_app_name ) { static const WCHAR belauncherW[] = L"c:\\windows\\system32\\belauncher.exe"; + unsigned int len; /* We detect the BattlEye launcher executable through the product name property, as the executable name varies */ if (!product_name_matches( app_name, "BattlEye Launcher" )) @@ -569,6 +571,13 @@ static int battleye_launcher_redirect_hack( const WCHAR *app_name, WCHAR *new_na return 0; } + len = (wcslen( app_name ) + 1) * sizeof(*app_name); + if (!(*orig_app_name = HeapAlloc( GetProcessHeap(), 0, len ))) + { + ERR( "No memory.\n" ); + return 0; + } + memcpy( *orig_app_name, app_name, len ); wcscpy( new_name, belauncherW ); return 1; } @@ -612,7 +621,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR { const struct proc_thread_attr *handle_list = NULL, *job_list = NULL; WCHAR name[MAX_PATH]; - WCHAR *p, *tidy_cmdline = cmd_line; + WCHAR *p, *tidy_cmdline = cmd_line, *orig_app_name = NULL; RTL_USER_PROCESS_PARAMETERS *params = NULL; RTL_USER_PROCESS_INFORMATION rtl_info; HANDLE parent = 0, debug = 0; @@ -671,7 +680,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR app_name = name; } - if (battleye_launcher_redirect_hack( app_name, name, ARRAY_SIZE(name) )) + if (battleye_launcher_redirect_hack( app_name, name, ARRAY_SIZE(name), &orig_app_name )) app_name = name; /* Warn if unsupported features are used */ @@ -695,6 +704,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR if (!(params = create_process_params( app_name, tidy_cmdline, cur_dir, env, flags, startup_info ))) { + HeapFree( GetProcessHeap(), 0, orig_app_name ); status = STATUS_NO_MEMORY; goto done; } @@ -703,18 +713,25 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR - We don't do this check in ntdll itself because it's harder to get the product name there - we don't overwrite WINEDLLOVERRIDES because it's fetched from the unix environment */ { - UNICODE_STRING is_eac_launcher_us; - UNICODE_STRING one_us; + UNICODE_STRING name, value; WCHAR *new_env = RtlAllocateHeap( GetProcessHeap(), 0, params->EnvironmentSize ); memcpy(new_env, params->Environment, params->EnvironmentSize); RtlDestroyProcessParameters( params ); - RtlInitUnicodeString( &is_eac_launcher_us, L"PROTON_EAC_LAUNCHER_PROCESS" ); - RtlInitUnicodeString( &one_us, L"1" ); - RtlSetEnvironmentVariable( &new_env, &is_eac_launcher_us, product_name_matches(app_name, "EasyAntiCheat Launcher") ? &one_us : NULL ); + RtlInitUnicodeString( &name, L"PROTON_EAC_LAUNCHER_PROCESS" ); + RtlInitUnicodeString( &value, L"1" ); + RtlSetEnvironmentVariable( &new_env, &name, product_name_matches(app_name, "EasyAntiCheat Launcher") ? &value : NULL ); + + if (orig_app_name) + { + RtlInitUnicodeString( &name, L"PROTON_ORIG_LAUNCHER_NAME" ); + RtlInitUnicodeString( &value, orig_app_name ); + RtlSetEnvironmentVariable( &new_env, &name, &value ); + } + HeapFree( GetProcessHeap(), 0, orig_app_name ); params = create_process_params( app_name, tidy_cmdline, cur_dir, new_env, flags | CREATE_UNICODE_ENVIRONMENT, startup_info ); RtlFreeHeap(GetProcessHeap(), 0, new_env); From 9ff53524e9afb1422d522a10cdf6d04d11394a1a Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 12 Apr 2023 19:42:00 -0600 Subject: [PATCH 0621/2542] belauncher: Use original launcher .exe path to find BELauncher.ini and executable. CW-Bug-Id: #22133 --- programs/belauncher/Makefile.in | 2 +- programs/belauncher/main.c | 54 ++++++++++++++++++++++++++------- 2 files changed, 44 insertions(+), 12 deletions(-) diff --git a/programs/belauncher/Makefile.in b/programs/belauncher/Makefile.in index 9800c0b45ba2..882d914bc03c 100644 --- a/programs/belauncher/Makefile.in +++ b/programs/belauncher/Makefile.in @@ -1,5 +1,5 @@ MODULE = belauncher.exe -IMPORTS = +IMPORTS = shlwapi EXTRADLLFLAGS = -mwindows -municode diff --git a/programs/belauncher/main.c b/programs/belauncher/main.c index 004a7d1a711e..a40e7cf88534 100644 --- a/programs/belauncher/main.c +++ b/programs/belauncher/main.c @@ -1,6 +1,7 @@ #define WIN32_LEAN_AND_MEAN #include #include +#include #include "wine/debug.h" @@ -9,9 +10,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(belauncher); int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cmdshow) { char *configs, *config, *arch_32_exe = NULL, *arch_64_exe = NULL, *game_exe, *be_arg = NULL; + WCHAR path[MAX_PATH], *p, config_path[MAX_PATH]; LARGE_INTEGER launcher_cfg_size; unsigned char battleye_status; - int game_exe_len, arg_len; + int game_exe_len, arg_len, path_len; PROCESS_INFORMATION pi; HANDLE launcher_cfg; LPWSTR launch_cmd; @@ -22,9 +24,31 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm battleye_status = 0x3; /* Starting */ _write(1, &battleye_status, 1); - launcher_cfg = CreateFileW(L"Battleye\\BELauncher.ini", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + *path = 0; + if ((size = GetEnvironmentVariableW(L"PROTON_ORIG_LAUNCHER_NAME", path, ARRAY_SIZE(path))) && size <= ARRAY_SIZE(path)) + { + WINE_TRACE("PROTON_ORIG_LAUNCHER_NAME %s.\n", wine_dbgstr_w(path)); + + for (p = path + wcslen(path); p != path; --p) + if (*p == '\\') break; + if (*p == '\\') + ++p; + *p = 0; + } + + wcscpy(config_path, path); + wcscat(config_path, L"Battleye\\BELauncher.ini"); + launcher_cfg = CreateFileW(config_path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (launcher_cfg == INVALID_HANDLE_VALUE) + { + *path = 0; + launcher_cfg = CreateFileW(L"Battleye\\BELauncher.ini", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + } if (launcher_cfg == INVALID_HANDLE_VALUE) + { + WINE_ERR("BELauncher.ini not found.\n"); goto start_failed; + } if(!GetFileSizeEx(launcher_cfg, &launcher_cfg_size) || launcher_cfg_size.u.HighPart) { @@ -64,7 +88,7 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm else { HeapFree( GetProcessHeap(), 0, configs ); - WINE_WARN("Failed to find game executable name from BattlEye config.\n"); + WINE_ERR("Failed to find game executable name from BattlEye config.\n"); goto start_failed; } @@ -88,21 +112,28 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm battleye_status = 0x9; /* Launching Game */ _write(1, &battleye_status, 1); - launch_cmd = HeapAlloc(GetProcessHeap(), 0, (game_exe_len + 1 + wcslen(cmdline) + 1 + arg_len + 1) * sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, game_exe, -1, launch_cmd, game_exe_len + 1); - launch_cmd[game_exe_len] = ' '; + if (PathIsRelativeA(game_exe)) + path_len = wcslen(path); + else + path_len = 0; + + launch_cmd = HeapAlloc(GetProcessHeap(), 0, (path_len + game_exe_len + 1 + wcslen(cmdline) + 1 + arg_len + 1) * sizeof(WCHAR)); - wcscpy(launch_cmd + game_exe_len + 1, cmdline); - launch_cmd[game_exe_len + 1 + wcslen(cmdline)] = ' '; + memcpy(launch_cmd, path, path_len * sizeof(*path)); - MultiByteToWideChar(CP_ACP, 0, be_arg, -1, launch_cmd + game_exe_len + 1 + wcslen(cmdline) + 1, arg_len + 1); + MultiByteToWideChar(CP_ACP, 0, game_exe, -1, launch_cmd + path_len, game_exe_len + 1); + launch_cmd[path_len + game_exe_len] = ' '; + + wcscpy(launch_cmd + path_len + game_exe_len + 1, cmdline); + launch_cmd[path_len + game_exe_len + 1 + wcslen(cmdline)] = ' '; + + MultiByteToWideChar(CP_ACP, 0, be_arg, -1, launch_cmd + path_len + game_exe_len + 1 + wcslen(cmdline) + 1, arg_len + 1); if (!CreateProcessW(NULL, launch_cmd, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi)) { + WINE_ERR("CreateProcessW failed.\n"); battleye_status = 0xA; /* Launch Failed */ _write(1, &battleye_status, 1); - - HeapFree( GetProcessHeap(), 0, launch_cmd ); return GetLastError(); } HeapFree( GetProcessHeap(), 0, launch_cmd ); @@ -112,6 +143,7 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm return 0; start_failed: + WINE_ERR("Failed.\n"); battleye_status = 0x4; /* Start Failed */ _write(1, &battleye_status, 1); return 0; From b24b7e299857556c566872e2d01b47b28eb520ae Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 19 Apr 2023 15:32:38 -0600 Subject: [PATCH 0622/2542] belauncher: Null terminate launch_cmd if be_arg is empty. CW-Bug-Id: #22146 --- programs/belauncher/main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/programs/belauncher/main.c b/programs/belauncher/main.c index a40e7cf88534..c8b8ccbf5326 100644 --- a/programs/belauncher/main.c +++ b/programs/belauncher/main.c @@ -127,7 +127,13 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm wcscpy(launch_cmd + path_len + game_exe_len + 1, cmdline); launch_cmd[path_len + game_exe_len + 1 + wcslen(cmdline)] = ' '; - MultiByteToWideChar(CP_ACP, 0, be_arg, -1, launch_cmd + path_len + game_exe_len + 1 + wcslen(cmdline) + 1, arg_len + 1); + + if (!MultiByteToWideChar(CP_ACP, 0, be_arg, -1, launch_cmd + path_len + game_exe_len + 1 + wcslen(cmdline) + 1, arg_len + 1)) + launch_cmd[path_len + game_exe_len + 1 + wcslen(cmdline)] = 0; + + WINE_TRACE("game_exe %s, cmdline %s.\n", wine_dbgstr_a(game_exe), wine_dbgstr_w(cmdline)); + WINE_TRACE("path %s, be_arg %s.\n", wine_dbgstr_w(path), wine_dbgstr_a(be_arg)); + WINE_TRACE("launch_cmd %s.\n", wine_dbgstr_w(launch_cmd)); if (!CreateProcessW(NULL, launch_cmd, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi)) { From 02f7b8b2eb0edcd528d401df01aeadced2b41a35 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 19 Apr 2023 17:00:49 -0600 Subject: [PATCH 0623/2542] belauncher: Support --exe command line option. CW-Bug-Id: #22146 --- programs/belauncher/Makefile.in | 2 +- programs/belauncher/main.c | 64 +++++++++++++++++++++++---------- 2 files changed, 46 insertions(+), 20 deletions(-) diff --git a/programs/belauncher/Makefile.in b/programs/belauncher/Makefile.in index 882d914bc03c..927983f74239 100644 --- a/programs/belauncher/Makefile.in +++ b/programs/belauncher/Makefile.in @@ -1,5 +1,5 @@ MODULE = belauncher.exe -IMPORTS = shlwapi +IMPORTS = shlwapi shcore EXTRADLLFLAGS = -mwindows -municode diff --git a/programs/belauncher/main.c b/programs/belauncher/main.c index c8b8ccbf5326..213378fd1087 100644 --- a/programs/belauncher/main.c +++ b/programs/belauncher/main.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "wine/debug.h" @@ -9,8 +10,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(belauncher); int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cmdshow) { - char *configs, *config, *arch_32_exe = NULL, *arch_64_exe = NULL, *game_exe, *be_arg = NULL; - WCHAR path[MAX_PATH], *p, config_path[MAX_PATH]; + char *configs, *config, *arch_32_exe = NULL, *arch_64_exe = NULL, *game_exe = NULL, *be_arg = NULL; + WCHAR path[MAX_PATH], *p, config_path[MAX_PATH], game_exeW[MAX_PATH], **argvW; LARGE_INTEGER launcher_cfg_size; unsigned char battleye_status; int game_exe_len, arg_len, path_len; @@ -18,6 +19,7 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm HANDLE launcher_cfg; LPWSTR launch_cmd; STARTUPINFOW si = {0}; + int i, argc; DWORD size; BOOL wow64; @@ -81,22 +83,47 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm } while ((config = strchr(config, '\n')) && *(config++)); - if (arch_64_exe && (sizeof(void *) == 8 || (IsWow64Process(GetCurrentProcess(), &wow64) && wow64))) - game_exe = arch_64_exe; - else if (arch_32_exe) - game_exe = arch_32_exe; - else + *game_exeW = 0; + game_exe_len = 0; + + if ((argvW = CommandLineToArgvW(cmdline, &argc))) { - HeapFree( GetProcessHeap(), 0, configs ); - WINE_ERR("Failed to find game executable name from BattlEye config.\n"); - goto start_failed; + for (i = 0; i < argc; ++i) + { + if (!wcscmp(argvW[i], L"-exe") && i < argc - 1) + { + wcscpy(game_exeW, argvW[i + 1]); + game_exe_len = wcslen(game_exeW); + break; + } + } } - if (strchr(game_exe, '\r')) - *(strchr(game_exe, '\r')) = 0; - if (strchr(game_exe, '\n')) - *(strchr(game_exe, '\n')) = 0; - game_exe_len = MultiByteToWideChar(CP_ACP, 0, game_exe, -1, NULL, 0) - 1; + if (!*game_exeW) + { + if (arch_64_exe && (sizeof(void *) == 8 || (IsWow64Process(GetCurrentProcess(), &wow64) && wow64))) + game_exe = arch_64_exe; + else if (arch_32_exe) + game_exe = arch_32_exe; + else + { + HeapFree( GetProcessHeap(), 0, configs ); + WINE_ERR("Failed to find game executable name from BattlEye config.\n"); + goto start_failed; + } + + if (strchr(game_exe, '\r')) + *(strchr(game_exe, '\r')) = 0; + if (strchr(game_exe, '\n')) + *(strchr(game_exe, '\n')) = 0; + game_exe_len = MultiByteToWideChar(CP_ACP, 0, game_exe, -1, game_exeW, ARRAY_SIZE(game_exeW)); + if (!game_exe_len) + { + WINE_ERR("Failed to convert game_exe %s.\n", wine_dbgstr_a(game_exe)); + goto start_failed; + } + --game_exe_len; + } if (!be_arg) arg_len = 0; else @@ -112,7 +139,7 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm battleye_status = 0x9; /* Launching Game */ _write(1, &battleye_status, 1); - if (PathIsRelativeA(game_exe)) + if (PathIsRelativeW(game_exeW)) path_len = wcslen(path); else path_len = 0; @@ -121,17 +148,16 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm memcpy(launch_cmd, path, path_len * sizeof(*path)); - MultiByteToWideChar(CP_ACP, 0, game_exe, -1, launch_cmd + path_len, game_exe_len + 1); + memcpy(launch_cmd + path_len, game_exeW, game_exe_len * sizeof(*launch_cmd)); launch_cmd[path_len + game_exe_len] = ' '; wcscpy(launch_cmd + path_len + game_exe_len + 1, cmdline); launch_cmd[path_len + game_exe_len + 1 + wcslen(cmdline)] = ' '; - if (!MultiByteToWideChar(CP_ACP, 0, be_arg, -1, launch_cmd + path_len + game_exe_len + 1 + wcslen(cmdline) + 1, arg_len + 1)) launch_cmd[path_len + game_exe_len + 1 + wcslen(cmdline)] = 0; - WINE_TRACE("game_exe %s, cmdline %s.\n", wine_dbgstr_a(game_exe), wine_dbgstr_w(cmdline)); + WINE_TRACE("game_exe %s, cmdline %s.\n", wine_dbgstr_w(game_exeW), wine_dbgstr_w(cmdline)); WINE_TRACE("path %s, be_arg %s.\n", wine_dbgstr_w(path), wine_dbgstr_a(be_arg)); WINE_TRACE("launch_cmd %s.\n", wine_dbgstr_w(launch_cmd)); From 118404df3e8a845ae471838be81636cce4545374 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 27 Mar 2025 18:00:59 -0600 Subject: [PATCH 0624/2542] belauncher: Handle uninstall command. CW-Bug-Id: #25124 --- programs/belauncher/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/programs/belauncher/main.c b/programs/belauncher/main.c index 213378fd1087..850c69f76132 100644 --- a/programs/belauncher/main.c +++ b/programs/belauncher/main.c @@ -86,8 +86,15 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm *game_exeW = 0; game_exe_len = 0; + WINE_TRACE("cmdline %s.\n", wine_dbgstr_w(cmdline)); if ((argvW = CommandLineToArgvW(cmdline, &argc))) { + if (argc && iswdigit(argvW[0][0]) && _wtoi(argvW[0]) == 4) + { + WINE_TRACE("uninstall cmd, exiting.\n"); + return 0; + } + for (i = 0; i < argc; ++i) { if (!wcscmp(argvW[i], L"-exe") && i < argc - 1) @@ -157,7 +164,7 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm if (!MultiByteToWideChar(CP_ACP, 0, be_arg, -1, launch_cmd + path_len + game_exe_len + 1 + wcslen(cmdline) + 1, arg_len + 1)) launch_cmd[path_len + game_exe_len + 1 + wcslen(cmdline)] = 0; - WINE_TRACE("game_exe %s, cmdline %s.\n", wine_dbgstr_w(game_exeW), wine_dbgstr_w(cmdline)); + WINE_TRACE("game_exe %s.\n", wine_dbgstr_w(game_exeW)); WINE_TRACE("path %s, be_arg %s.\n", wine_dbgstr_w(path), wine_dbgstr_a(be_arg)); WINE_TRACE("launch_cmd %s.\n", wine_dbgstr_w(launch_cmd)); From cb5a93e156be2987000a89984be3c965e71f7da7 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 11 Mar 2022 15:46:11 +0300 Subject: [PATCH 0625/2542] kernelbase: HACK: Force CEF swiftshader for Montaro/nw.exe. CW-Bug-Id: #20284 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 740eff05af56..d8574904f331 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -593,6 +593,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) { {L"UplayWebCore.exe", L" --use-gl=swiftshader"}, {L"Paradox Launcher.exe", L" --use-gl=swiftshader --in-process-gpu"}, + {L"Montaro\\nw.exe", L" --use-gl=swiftshader"}, }; unsigned int i; From 40e67541749bc98c54cef4b42b3dbf541db206a7 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Sun, 22 May 2022 11:53:12 -0500 Subject: [PATCH 0626/2542] kernelbase: HACK: Force CEF swiftshader for EpicOnlineServicesUIHelper. Enabling other process window rendering makes it dependent on the missing d3dcompiler features. CW-Bug-Id: #20680 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index d8574904f331..1ece360291c6 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -594,6 +594,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) {L"UplayWebCore.exe", L" --use-gl=swiftshader"}, {L"Paradox Launcher.exe", L" --use-gl=swiftshader --in-process-gpu"}, {L"Montaro\\nw.exe", L" --use-gl=swiftshader"}, + {L"\\EpicOnlineServicesUIHelper", L" --use-gl=desktop"}, }; unsigned int i; From 7441549d46e1d97b530855b50404786a2915b737 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 3 Aug 2022 11:56:39 -0500 Subject: [PATCH 0627/2542] ntdll: HACK: Add an option to report ntdll from RtlPcToFileHeader() for PC in Unix lib. CW-Bug-Id: #21065 (to be dropped once we have no blocking calls to Unix native libs going wthout wine_syscall_dispatcher). --- dlls/ntdll/loader.c | 9 +++++++++ dlls/ntdll/unix/loader.c | 21 +++++++++++++++++++++ dlls/ntdll/unixlib.h | 1 + 3 files changed, 31 insertions(+) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index eccdcb1e0708..11debacd9b11 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -4644,6 +4644,15 @@ PVOID WINAPI RtlPcToFileHeader( PVOID pc, PVOID *address ) RtlEnterCriticalSection( &loader_section ); if (!LdrFindEntryForAddress( pc, &module )) ret = module->DllBase; RtlLeaveCriticalSection( &loader_section ); + + if (!ret && WINE_UNIX_CALL( unix_is_pc_in_native_so, pc )) + { + LDR_DATA_TABLE_ENTRY *mod; + + mod = CONTAINING_RECORD( node_ntdll->Modules.Flink, LDR_DATA_TABLE_ENTRY, NodeModuleLink ); + ret = mod->DllBase; + } + *address = ret; return ret; } diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index cb59e6391d06..18fe4e49e7b2 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1196,6 +1196,21 @@ static NTSTATUS steamclient_setup_trampolines( void *args ) return STATUS_SUCCESS; } +static BOOL report_native_pc_as_ntdll; + +static NTSTATUS is_pc_in_native_so(void *pc) +{ + Dl_info info; + + if (!report_native_pc_as_ntdll || !dladdr( pc, &info )) return FALSE; + + TRACE( "pc %p, module %s.\n", pc, debugstr_a(info.dli_fname) ); + + if (strstr( info.dli_fname, ".dll.so")) return FALSE; + + return TRUE; +} + static const unixlib_entry_t unix_call_funcs[] = { load_so_dll, @@ -1207,6 +1222,7 @@ static const unixlib_entry_t unix_call_funcs[] = unixcall_wine_spawnvp, system_time_precise, steamclient_setup_trampolines, + is_pc_in_native_so, }; @@ -1239,6 +1255,7 @@ const unixlib_entry_t unix_call_wow64_funcs[] = wow64_wine_spawnvp, system_time_precise, wow64_steamclient_setup_trampolines, + is_pc_in_native_so, }; #endif /* _WIN64 */ @@ -2111,6 +2128,10 @@ static void hacks_init(void) break; } + env_str = getenv("WINE_UNIX_PC_AS_NTDLL"); + if (env_str) report_native_pc_as_ntdll = atoi(env_str); + else if (sgi) report_native_pc_as_ntdll = !strcmp(sgi, "700330"); + if (sgi && (0 || !strcmp(sgi, "1364780") || !strcmp(sgi, "1952120") || !strcmp(sgi, "2154900") /* Street Fighter 6 */ || !strcmp(sgi, "1740720") /* Have a Nice Death */ diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h index 475e532b8cfa..5430b8f0fe97 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h @@ -83,6 +83,7 @@ enum ntdll_unix_funcs unix_wine_spawnvp, unix_system_time_precise, unix_steamclient_setup_trampolines, + unix_is_pc_in_native_so, }; extern unixlib_handle_t __wine_unixlib_handle; From 548292ff12ddf66d7251668fb21a3e37ce2c5d90 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 19 Nov 2021 16:30:57 +0300 Subject: [PATCH 0628/2542] wine.inf: Restore default libglesv2 load order for Paradox launcher. Remove order override instead of reverting commit 13ac81ffd075d9e92486a395be9cfe822562e718 to correctly update existing prefixes. CW-Bug-Id: #19617 --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 452f07e35707..5afc250c6655 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2857,6 +2857,7 @@ HKCU,Software\Wine\AppDefaults\BlackOps3.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\NFS16.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\ShadowOfWar.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\DIRT5.exe\DllOverrides,"atiadlxx",,"builtin" +HKCU,Software\Wine\AppDefaults\Paradox Launcher.exe\DllOverrides,,4, HKCU,Software\Wine\AppDefaults\gotg.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\RelicCardinal.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\msedgewebview2.exe,"Version",,"win81" From c88c784b41cf19c2eb7a52f1d2ecf64b1efa3eb8 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 28 Oct 2022 20:24:29 -0500 Subject: [PATCH 0629/2542] kernelbase: HACK: Force GL QtWebEngine rendering for EADesktop. CW-Bug-Id: #21497 --- dlls/kernelbase/process.c | 31 +++++++++++++++++++++++++++++++ dlls/ntdll/unix/loader.c | 8 ++++++++ 2 files changed, 39 insertions(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 1ece360291c6..898c64c82d0d 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -1922,6 +1922,37 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetEnvironmentVariableW( LPCWSTR name, LPCWSTR val return FALSE; } + if (name && !lstrcmpW( name, L"QT_OPENGL" ) && value && !lstrcmpW( value, L"angle" )) + { + static const WCHAR *names[] = + { + L"\\EADesktop.exe", + L"\\Link2EA.exe", + L"\\EAConnect_microsoft.exe", + L"\\EALaunchHelper.exe", + L"\\EACrashReporter.exe", + L"EA Desktop\\ErrorReporter.exe", + }; + unsigned int i, len; + WCHAR module[256]; + DWORD size; + + if ((size = GetModuleFileNameW( NULL, module, ARRAY_SIZE(module) )) && size < ARRAY_SIZE(module)) + { + for (i = 0; i < ARRAY_SIZE(names); ++i) + { + len = lstrlenW(names[i]); + if (size > len && !memcmp( module + size - len, names[i], len * sizeof(*module) )) + { + value = L"desktop"; + FIXME( "HACK: setting QT_OPENGL=desktop.\n" ); + break; + } + } + } + } + + RtlInitUnicodeString( &us_name, name ); if (value) { diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 18fe4e49e7b2..ad92ee7af002 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2145,6 +2145,14 @@ static void hacks_init(void) ERR("HACK: setting LIBGL_ALWAYS_SOFTWARE.\n"); setenv("LIBGL_ALWAYS_SOFTWARE", "1", 0); } + + if (main_argc > 1 && (strstr(main_argv[1], "\\EADesktop.exe") || strstr(main_argv[1], "\\Link2EA.exe") + || strstr(main_argv[1], "EA Desktop\\ErrorReporter.exe") || strstr(main_argv[1], "\\EAConnect_microsoft.exe") + || strstr(main_argv[1], "\\EALaunchHelper.exe") || strstr(main_argv[1], "\\EACrashReporter.exe"))) + { + ERR("HACK: setting LIBGL_ALWAYS_SOFTWARE.\n"); + setenv("LIBGL_ALWAYS_SOFTWARE", "1", 0); + } } /*********************************************************************** From 649be0292a026bc49bb0d423db52cbf903671440 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 15 Jul 2022 20:00:08 -0500 Subject: [PATCH 0630/2542] ntdll: HACK: Report LocalSystem accound SID for MicrosoftEdgeUpdate. CW-Bug-Id: #20967 --- dlls/ntdll/unix/loader.c | 8 ++++++++ dlls/ntdll/unix/security.c | 22 ++++++++++++++++++++++ dlls/ntdll/unix/unix_private.h | 1 + 3 files changed, 31 insertions(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index ad92ee7af002..e9f6553ec78e 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2073,6 +2073,7 @@ BOOL ac_odyssey; BOOL fsync_simulate_sched_quantum; BOOL alert_simulate_sched_quantum; BOOL fsync_yield_to_waiters; +BOOL localsystem_sid; static void hacks_init(void) { @@ -2132,6 +2133,13 @@ static void hacks_init(void) if (env_str) report_native_pc_as_ntdll = atoi(env_str); else if (sgi) report_native_pc_as_ntdll = !strcmp(sgi, "700330"); + if (main_argc > 1 && strstr(main_argv[1], "MicrosoftEdgeUpdate.exe")) + { + ERR("HACK: reporting LocalSystem account SID.\n"); + localsystem_sid = TRUE; + return; + } + if (sgi && (0 || !strcmp(sgi, "1364780") || !strcmp(sgi, "1952120") || !strcmp(sgi, "2154900") /* Street Fighter 6 */ || !strcmp(sgi, "1740720") /* Have a Nice Death */ diff --git a/dlls/ntdll/unix/security.c b/dlls/ntdll/unix/security.c index 03cf26c1555b..badd72877d99 100644 --- a/dlls/ntdll/unix/security.c +++ b/dlls/ntdll/unix/security.c @@ -323,6 +323,28 @@ NTSTATUS WINAPI NtQueryInformationToken( HANDLE token, TOKEN_INFORMATION_CLASS c switch (class) { case TokenUser: + if (localsystem_sid) + { + static const struct sid local_system_sid = { SID_REVISION, 1, SECURITY_NT_AUTHORITY, { SECURITY_LOCAL_SYSTEM_RID } }; + DWORD sid_len = offsetof( struct sid, sub_auth[local_system_sid.sub_count] ); + TOKEN_USER *tuser; + PSID sid; + + if (retlen) *retlen = sid_len + sizeof(TOKEN_USER); + if (sid_len + sizeof(TOKEN_USER) > length) + { + status = STATUS_BUFFER_TOO_SMALL; + } + else + { + tuser = info; + sid = tuser + 1; + tuser->User.Sid = sid; + tuser->User.Attributes = 0; + memcpy( sid, &local_system_sid, sid_len ); + } + break; + } SERVER_START_REQ( get_token_sid ) { TOKEN_USER *tuser = info; diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 6cfb871f8593..787f20372eb3 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -193,6 +193,7 @@ extern BOOL ac_odyssey; extern BOOL fsync_simulate_sched_quantum; extern BOOL alert_simulate_sched_quantum; extern BOOL fsync_yield_to_waiters; +extern BOOL localsystem_sid; extern void init_environment(void); extern void init_startup_info(void); From 063baea7112887ad57aabbdb90bfee9d3f292dce Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 4 Jan 2022 17:41:46 +0300 Subject: [PATCH 0631/2542] advapi32: Initialize computer SID from registry. CW-Bug-Id: #19702 --- dlls/advapi32/security.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c index 97304d641098..cbf7f40a9e68 100644 --- a/dlls/advapi32/security.c +++ b/dlls/advapi32/security.c @@ -244,12 +244,42 @@ BOOL ADVAPI_IsLocalComputer(LPCWSTR ServerName) return Result; } +static BOOL WINAPI init_computer_sid( INIT_ONCE *init_once, void *parameter, void **context ) +{ + DWORD *sub_authority = parameter; + unsigned int i, count; + DWORD len, index; + BOOL found = FALSE; + DWORD values[3]; + char buffer[64]; + LSTATUS status; + + len = ARRAY_SIZE(buffer); + index = 0; + while (!(status = RegEnumKeyExA( HKEY_USERS, index, buffer, &len, NULL, NULL, NULL, NULL ))) + { + count = sscanf(buffer, "S-1-5-21-%lu-%lu-%lu", &values[0], &values[1], &values[2]); + if (count == 3) + { + if (found) + ERR( "Multiple users are not supported.\n" ); + for (i = 0; i < 3; ++i) + sub_authority[i] = values[i]; + found = TRUE; + } + ++index; + len = ARRAY_SIZE(buffer); + } + return found; +} + /************************************************************ * ADVAPI_GetComputerSid */ BOOL ADVAPI_GetComputerSid(PSID sid) { - static const struct /* same fields as struct SID */ + static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT; + static struct /* same fields as struct SID */ { BYTE Revision; BYTE SubAuthorityCount; @@ -258,6 +288,9 @@ BOOL ADVAPI_GetComputerSid(PSID sid) } computer_sid = { SID_REVISION, 4, { SECURITY_NT_AUTHORITY }, { SECURITY_NT_NON_UNIQUE, 0, 0, 0 } }; + if (!InitOnceExecuteOnce( &init_once, init_computer_sid, computer_sid.SubAuthority + 1, NULL )) + ERR( "Could not initialize computer sid.\n" ); + memcpy( sid, &computer_sid, sizeof(computer_sid) ); return TRUE; } From 233e3b3aa78efa6530068ae6cf53d6d656c6ce6a Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 4 Jan 2022 17:42:35 +0300 Subject: [PATCH 0632/2542] sechost: Initialize computer SID from registry. CW-Bug-Id: #19702 --- dlls/sechost/security.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/dlls/sechost/security.c b/dlls/sechost/security.c index 90e227b29483..e2906fa1c02e 100644 --- a/dlls/sechost/security.c +++ b/dlls/sechost/security.c @@ -580,9 +580,39 @@ BOOL WINAPI DECLSPEC_HOTPATCH ConvertSecurityDescriptorToStringSecurityDescripto return TRUE; } +static BOOL WINAPI init_computer_sid( INIT_ONCE *init_once, void *parameter, void **context ) +{ + DWORD *sub_authority = parameter; + unsigned int i, count; + DWORD len, index; + BOOL found = FALSE; + UINT values[3]; + char buffer[64]; + LSTATUS status; + + len = ARRAY_SIZE(buffer); + index = 0; + while (!(status = RegEnumKeyExA( HKEY_USERS, index, buffer, &len, NULL, NULL, NULL, NULL ))) + { + count = sscanf(buffer, "S-1-5-21-%u-%u-%u", &values[0], &values[1], &values[2]); + if (count == 3) + { + if (found) + ERR( "Multiple users are not supported.\n" ); + for (i = 0; i < 3; ++i) + sub_authority[i] = values[i]; + found = TRUE; + } + ++index; + len = ARRAY_SIZE(buffer); + } + return found; +} + static BOOL get_computer_sid( PSID sid ) { - static const struct /* same fields as struct SID */ + static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT; + static struct /* same fields as struct SID */ { BYTE Revision; BYTE SubAuthorityCount; @@ -591,6 +621,9 @@ static BOOL get_computer_sid( PSID sid ) } computer_sid = { SID_REVISION, 4, { SECURITY_NT_AUTHORITY }, { SECURITY_NT_NON_UNIQUE, 0, 0, 0 } }; + if (!InitOnceExecuteOnce( &init_once, init_computer_sid, computer_sid.SubAuthority + 1, NULL )) + ERR( "Could not initialize computer sid.\n" ); + memcpy( sid, &computer_sid, sizeof(computer_sid) ); return TRUE; } From 00519688680668b21c3dc29654cc4e35fc525dfe Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 22 Dec 2021 00:52:53 +0300 Subject: [PATCH 0633/2542] server: Initialize local user SID with unique values. CW-Bug-Id: #19702 --- server/main.c | 2 ++ server/security.h | 4 +++- server/token.c | 35 ++++++++++++++++++++++++++++++++++- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/server/main.c b/server/main.c index 9559ad83584a..d0a0a4879b55 100644 --- a/server/main.c +++ b/server/main.c @@ -34,6 +34,7 @@ #include "thread.h" #include "request.h" #include "unicode.h" +#include "security.h" #include "esync.h" #include "fsync.h" @@ -244,6 +245,7 @@ int main( int argc, char *argv[] ) set_current_time(); init_signals(); init_memory(); + init_user_sid(); init_directories( load_intl_file() ); init_threading(); init_registry(); diff --git a/server/security.h b/server/security.h index f4dff6791791..4a7616369102 100644 --- a/server/security.h +++ b/server/security.h @@ -45,7 +45,7 @@ extern const struct luid SeImpersonatePrivilege; extern const struct luid SeCreateGlobalPrivilege; extern const struct sid world_sid; -extern const struct sid local_user_sid; +extern struct sid local_user_sid; extern const struct sid local_system_sid; extern const struct sid builtin_users_sid; extern const struct sid builtin_admins_sid; @@ -59,6 +59,7 @@ struct ace unsigned int mask; }; + /* token functions */ extern struct token *get_token_obj( struct process *process, obj_handle_t handle, unsigned int access ); @@ -121,6 +122,7 @@ static inline struct ace *set_ace( struct ace *ace, const struct sid *sid, unsig extern void security_set_thread_token( struct thread *thread, obj_handle_t handle ); extern const struct sid *security_unix_uid_to_sid( uid_t uid ); +extern void init_user_sid(void); extern int check_object_access( struct token *token, struct object *obj, unsigned int *access ); static inline int thread_single_check_privilege( struct thread *thread, struct luid priv ) diff --git a/server/token.c b/server/token.c index 2c0e1795bb96..c94f1b1f7e01 100644 --- a/server/token.c +++ b/server/token.c @@ -23,11 +23,15 @@ #include "config.h" #include +#include #include #include #include #include #include +#ifdef HAVE_STDINT_H +#include +#endif #include "ntstatus.h" #define WIN32_NO_STATUS @@ -72,7 +76,7 @@ struct sid_attrs const struct sid world_sid = { SID_REVISION, 1, SECURITY_WORLD_SID_AUTHORITY, { SECURITY_WORLD_RID } }; const struct sid local_system_sid = { SID_REVISION, 1, SECURITY_NT_AUTHORITY, { SECURITY_LOCAL_SYSTEM_RID } }; -const struct sid local_user_sid = { SID_REVISION, 5, SECURITY_NT_AUTHORITY, { SECURITY_NT_NON_UNIQUE, 0, 0, 0, 1000 } }; + struct sid local_user_sid = { SID_REVISION, 5, SECURITY_NT_AUTHORITY, { SECURITY_NT_NON_UNIQUE, 0, 0, 0, 1000 } }; const struct sid builtin_admins_sid = { SID_REVISION, 2, SECURITY_NT_AUTHORITY, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS } }; const struct sid builtin_users_sid = { SID_REVISION, 2, SECURITY_NT_AUTHORITY, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_USERS } }; const struct sid domain_users_sid = { SID_REVISION, 5, SECURITY_NT_AUTHORITY, { SECURITY_NT_NON_UNIQUE, 0, 0, 0, DOMAIN_GROUP_RID_USERS } }; @@ -209,6 +213,35 @@ const struct sid *security_unix_uid_to_sid( uid_t uid ) return &anonymous_logon_sid; } +void init_user_sid(void) +{ + char machine_id[17]; + uint64_t id; + size_t n; + FILE *f; + + f = fopen( "/etc/machine-id", "r" ); + if (!f) + { + fprintf( stderr, "Failed to open /etc/machine-id, error %s.\n", strerror( errno )); + return; + } + + n = fread( machine_id, sizeof(*machine_id), 16, f ); + fclose(f); + + if (n != 16) + { + fprintf( stderr, "Failed to read /etc/machine-id, error %s.\n", strerror( errno )); + return; + } + machine_id[n] = 0; + id = strtoull( machine_id, NULL, 0x10 ); + local_user_sid.sub_auth[1] = id >> 32; + local_user_sid.sub_auth[2] = id & 0xffffffff; + local_user_sid.sub_auth[3] = getuid(); +} + static int acl_is_valid( const struct acl *acl, data_size_t size ) { ULONG i; From 95f316ea0a9a141823c77b4019d1c9bc8beeeddb Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 1 Apr 2022 17:39:50 +0300 Subject: [PATCH 0634/2542] msvcrt: HACK: Introduce asm wrapper for _isatty on x64. CW-Bug-Id: #20419 --- dlls/msvcrt/file.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index dda12a70194e..934fa72245fd 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -44,6 +44,7 @@ #include "mtdll.h" #include "wine/asm.h" #include "wine/debug.h" +#include "wine/asm.h" WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); @@ -855,12 +856,28 @@ static int msvcrt_flush_buffer(FILE* file) /********************************************************************* * _isatty (MSVCRT.@) */ +#if defined(__x86_64__) && !defined(__arm64ec__) +int CDECL MSVCRT__isatty(int fd) +{ + TRACE(":fd (%d)\n",fd); + + return get_ioinfo_nolock(fd)->wxflag & WX_TTY; +} +__ASM_GLOBAL_FUNC( _isatty, + "sub $0x30,%rsp\n\t" + "lea MSVCRT___pioinfo(%rip),%rdx\n\t" + "nop;nop;nop;nop;nop;nop;nop;nop;nop\n\t" + "add $0x30,%rsp\n\t" + "jmp " __ASM_NAME( "MSVCRT__isatty" ) ) +#else int CDECL _isatty(int fd) { TRACE(":fd (%d)\n",fd); return get_ioinfo_nolock(fd)->wxflag & WX_TTY; } +#endif + /* INTERNAL: Allocate stdio file buffer */ static BOOL msvcrt_alloc_buffer(FILE* file) From 670c907af6dd2b0d4c187eabd375d605e35ae504 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Thu, 30 Sep 2021 14:38:33 +0200 Subject: [PATCH 0635/2542] sechost: Fake presence of BEService service for ARK: Survival Evolved. The game uses the presence and status of BEService to determine whether or not the game is running in BattlEye. Since with the Proton Bridge we don't have a dedicated background service, we can just pretend the service is always running. CW-Bug-Id: #16650 --- dlls/sechost/service.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/dlls/sechost/service.c b/dlls/sechost/service.c index 474d977ac5ed..aa358925eb51 100644 --- a/dlls/sechost/service.c +++ b/dlls/sechost/service.c @@ -312,6 +312,8 @@ SC_HANDLE WINAPI DECLSPEC_HOTPATCH OpenServiceW( SC_HANDLE manager, const WCHAR SC_RPC_HANDLE handle = NULL; DWORD err; + char str[64]; + TRACE( "%p %s %#lx\n", manager, debugstr_w(name), access ); if (!manager) @@ -320,6 +322,14 @@ SC_HANDLE WINAPI DECLSPEC_HOTPATCH OpenServiceW( SC_HANDLE manager, const WCHAR return NULL; } + /* HACK for ARK: Survivial Evolved checking the status of BEService to determine whether BE is enabled. */ + if(GetEnvironmentVariableA("SteamGameId", str, sizeof(str)) && !strcmp(str, "346110") && + !wcscmp(name, L"BEService")) + { + WARN("HACK: returning fake service handle for BEService.\n"); + return (void *)0xdeadbeef; + } + __TRY { err = svcctl_OpenServiceW( manager, name, access, &handle ); @@ -1107,6 +1117,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH QueryServiceStatusEx( SC_HANDLE service, SC_STATUS { DWORD err; + char str[64]; + TRACE( "%p %d %p %ld %p\n", service, level, buffer, size, ret_size ); if (level != SC_STATUS_PROCESS_INFO) return set_error( ERROR_INVALID_LEVEL ); @@ -1117,6 +1129,24 @@ BOOL WINAPI DECLSPEC_HOTPATCH QueryServiceStatusEx( SC_HANDLE service, SC_STATUS return set_error( ERROR_INSUFFICIENT_BUFFER ); } + /* HACK for ARK: Survivial Evolved checking the status of BEService to determine whether BE is enabled. */ + if(GetEnvironmentVariableA("SteamGameId", str, sizeof(str)) && !strcmp(str, "346110") && + service == (void *)0xdeadbeef) + { + SERVICE_STATUS_PROCESS *status = (SERVICE_STATUS_PROCESS *)buffer; + WARN("HACK: returning fake data for BEService.\n"); + status->dwServiceType = SERVICE_WIN32_OWN_PROCESS; + status->dwCurrentState = SERVICE_RUNNING; + status->dwControlsAccepted = SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_STOP; + status->dwWin32ExitCode = NO_ERROR; + status->dwServiceSpecificExitCode = 0; + status->dwCheckPoint = 0; + status->dwWaitHint = 0; + status->dwProcessId = 0xdeadbee0; + status->dwServiceFlags = 0; + return TRUE; + } + __TRY { err = svcctl_QueryServiceStatusEx( service, level, buffer, size, ret_size ); From 8d5cbbe1ee79823b26ae31f488b059358939681a Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 22 Feb 2022 13:12:09 -0500 Subject: [PATCH 0636/2542] Fall Guys EOS overlay in process GPU. --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 898c64c82d0d..25283d3d7c51 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -594,6 +594,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) {L"UplayWebCore.exe", L" --use-gl=swiftshader"}, {L"Paradox Launcher.exe", L" --use-gl=swiftshader --in-process-gpu"}, {L"Montaro\\nw.exe", L" --use-gl=swiftshader"}, + {L"\\EOSOverlayRenderer-Win64-Shipping.exe", L" --use-gl=swiftshader --in-process-gpu"}, {L"\\EpicOnlineServicesUIHelper", L" --use-gl=desktop"}, }; unsigned int i; From bdf65dbe2dcb348d3034fe448234b113899eb023 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 8 Apr 2022 20:35:03 +0300 Subject: [PATCH 0637/2542] wined3d: Post WM_ACTIVATEAPP upon receiving WM_SIZE in device_process_message(). CW-Bug-Id: #20422 --- dlls/wined3d/device.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 503b377662af..4ad7f645280d 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5617,6 +5617,11 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL DefWindowProcA(window, message, wparam, lparam); } } + else if (message == WM_SIZE) + { + if (!IsIconic(window)) + PostMessageW(window, WM_ACTIVATEAPP, 1, GetCurrentThreadId()); + } if (unicode) return CallWindowProcW(proc, window, message, wparam, lparam); From 52afe945c9e8c90bc66180ebf5a86d23da886154 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 8 Apr 2022 20:34:07 +0300 Subject: [PATCH 0638/2542] wined3d: Ignore multiple app activation messages in device_process_message(). CW-Bug-Id: #20422 CW-Bug-Id: #21462 --- dlls/wined3d/device.c | 13 +++++-- dlls/wined3d/wined3d_main.c | 71 ++++++++++++++++++++++++++++++++++ dlls/wined3d/wined3d_private.h | 4 ++ 3 files changed, 85 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 4ad7f645280d..a3e113a9103f 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5594,7 +5594,10 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL } else if (message == WM_DISPLAYCHANGE) { + BOOL inside_mode_change = wined3d_set_inside_mode_change(window, TRUE); + device->device_parent->ops->mode_changed(device->device_parent); + wined3d_set_inside_mode_change(window, inside_mode_change); } else if (message == WM_ACTIVATEAPP) { @@ -5604,8 +5607,12 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL * (e.g. Deus Ex: GOTY) to destroy the device, so take care to * deactivate the implicit swapchain last, and to avoid accessing the * "device" pointer afterwards. */ - while (i--) - wined3d_swapchain_activate(device->swapchains[i], wparam); + if (!wparam || !wined3d_get_activate_processed(window)) + { + wined3d_set_activate_processed(window, !!wparam); + while (i--) + wined3d_swapchain_activate(device->swapchains[i], wparam); + } } else if (message == WM_SYSCOMMAND) { @@ -5617,7 +5624,7 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL DefWindowProcA(window, message, wparam, lparam); } } - else if (message == WM_SIZE) + else if (message == WM_SIZE && !wined3d_get_inside_mode_change(window)) { if (!IsIconic(window)) PostMessageW(window, WM_ACTIVATEAPP, 1, GetCurrentThreadId()); diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c index 3b436919559b..8d6cb41951f4 100644 --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c @@ -42,6 +42,8 @@ struct wined3d_wndproc HWND window; BOOL unicode; BOOL filter; + BOOL activate_processed; + BOOL inside_mode_change; WNDPROC proc; struct wined3d_device *device; uint32_t flags; @@ -623,6 +625,73 @@ BOOL wined3d_filter_messages(HWND window, BOOL filter) return ret; } +BOOL wined3d_get_activate_processed(HWND window) +{ + struct wined3d_wndproc *entry; + BOOL ret; + + wined3d_wndproc_mutex_lock(); + + if (!(entry = wined3d_find_wndproc(window, NULL))) + { + wined3d_wndproc_mutex_unlock(); + return FALSE; + } + ret = entry->activate_processed; + wined3d_wndproc_mutex_unlock(); + return ret; +} + +void wined3d_set_activate_processed(HWND window, BOOL activate_processed) +{ + struct wined3d_wndproc *entry; + + wined3d_wndproc_mutex_lock(); + + if (!(entry = wined3d_find_wndproc(window, NULL))) + { + wined3d_wndproc_mutex_unlock(); + return; + } + entry->activate_processed = activate_processed; + wined3d_wndproc_mutex_unlock(); +} + +BOOL wined3d_get_inside_mode_change(HWND window) +{ + struct wined3d_wndproc *entry; + BOOL ret; + + wined3d_wndproc_mutex_lock(); + + if (!(entry = wined3d_find_wndproc(window, NULL))) + { + wined3d_wndproc_mutex_unlock(); + return FALSE; + } + ret = entry->inside_mode_change; + wined3d_wndproc_mutex_unlock(); + return ret; +} + +BOOL wined3d_set_inside_mode_change(HWND window, BOOL inside_mode_change) +{ + struct wined3d_wndproc *entry; + BOOL ret; + + wined3d_wndproc_mutex_lock(); + + if (!(entry = wined3d_find_wndproc(window, NULL))) + { + wined3d_wndproc_mutex_unlock(); + return FALSE; + } + ret = entry->inside_mode_change; + entry->inside_mode_change = inside_mode_change; + wined3d_wndproc_mutex_unlock(); + return ret; +} + static LRESULT CALLBACK wined3d_wndproc(HWND window, UINT message, WPARAM wparam, LPARAM lparam) { struct wined3d_wndproc *entry; @@ -759,6 +828,8 @@ BOOL CDECL wined3d_register_window(struct wined3d *wined3d, HWND window, entry->device = device; entry->wined3d = wined3d; entry->flags = flags; + entry->activate_processed = FALSE; + entry->inside_mode_change = FALSE; wined3d_wndproc_mutex_unlock(); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index c98f8ef09a5a..63a2f19ace87 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2756,6 +2756,10 @@ struct wined3d BOOL wined3d_filter_messages(HWND window, BOOL filter); HRESULT wined3d_init(struct wined3d *wined3d, uint32_t flags); void wined3d_unregister_window(HWND window); +BOOL wined3d_get_activate_processed(HWND window); +void wined3d_set_activate_processed(HWND window, BOOL activate_processed); +BOOL wined3d_get_inside_mode_change(HWND window); +BOOL wined3d_set_inside_mode_change(HWND window, BOOL inside_mode_change); BOOL wined3d_get_app_name(char *app_name, unsigned int app_name_size); From 47ce9924f93a107d7e3a2fd2a40c81f75e9cfac3 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 4 Nov 2020 18:08:21 +0300 Subject: [PATCH 0639/2542] ws2_32: HACK Fail 'download-alt.easyanticheat.net' DNS name resolution. CW-Bug-Id: #16695 --- dlls/ws2_32/protocol.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/dlls/ws2_32/protocol.c b/dlls/ws2_32/protocol.c index 0b123136988d..eef2c34b3e46 100644 --- a/dlls/ws2_32/protocol.c +++ b/dlls/ws2_32/protocol.c @@ -148,6 +148,25 @@ static int dns_only_query( const char *node, const struct addrinfo *hints, struc return 0; } +static BOOL eac_download_hack(void) +{ + static int eac_download_hack_enabled = -1; + char str[64]; + + if (eac_download_hack_enabled == -1) + { + if (GetEnvironmentVariableA("WINE_DISABLE_EAC_ALT_DOWNLOAD", str, sizeof(str))) + eac_download_hack_enabled = !!atoi(str); + else + eac_download_hack_enabled = GetEnvironmentVariableA("SteamGameId", str, sizeof(str)) + && !strcmp(str, "626690"); + + if (eac_download_hack_enabled) + ERR("HACK: failing download-alt.easyanticheat.net resolution.\n"); + } + return eac_download_hack_enabled; +} + /*********************************************************************** * getaddrinfo (ws2_32.@) */ @@ -169,6 +188,12 @@ int WINAPI getaddrinfo( const char *node, const char *service, if (node) { + if (eac_download_hack() && !strcmp(node, "download-alt.easyanticheat.net")) + { + SetLastError(WSAHOST_NOT_FOUND); + return WSAHOST_NOT_FOUND; + } + if (!node[0]) { if (!(fqdn = get_fqdn())) return WSA_NOT_ENOUGH_MEMORY; @@ -927,6 +952,12 @@ struct hostent * WINAPI gethostbyname( const char *name ) return NULL; } + if (eac_download_hack() && name && !strcmp(name, "download-alt.easyanticheat.net")) + { + SetLastError( WSAHOST_NOT_FOUND ); + return NULL; + } + if ((ret = WS_CALL( gethostname, ¶ms ))) { SetLastError( ret ); From 3d626e8e236e35cea3e8f4f05c589151a9c1ccff Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 15 Jun 2022 17:21:55 -0500 Subject: [PATCH 0640/2542] ntdll: Do not open directory file when setting the same directory path. CW-Bug-Id: #20815 --- dlls/ntdll/path.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c index 6aa4bb3fdff0..dda6ba4ee536 100644 --- a/dlls/ntdll/path.c +++ b/dlls/ntdll/path.c @@ -914,13 +914,13 @@ ULONG WINAPI RtlGetCurrentDirectory_U(ULONG buflen, LPWSTR buf) NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING* dir) { FILE_FS_DEVICE_INFORMATION device_info; + ULONG size, compare_size; OBJECT_ATTRIBUTES attr; UNICODE_STRING newdir; IO_STATUS_BLOCK io; CURDIR *curdir; HANDLE handle; NTSTATUS nts; - ULONG size; PWSTR ptr; newdir.Buffer = NULL; @@ -938,6 +938,22 @@ NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING* dir) goto out; } + size = newdir.Length / sizeof(WCHAR); + ptr = newdir.Buffer; + ptr += 4; /* skip \??\ prefix */ + size -= 4; + + if (size && ptr[size - 1] == '\\') compare_size = size - 1; + else compare_size = size; + + if (curdir->DosPath.Length == (compare_size + 1) * sizeof(WCHAR) + && !memcmp( curdir->DosPath.Buffer, ptr, compare_size * sizeof(WCHAR) )) + { + TRACE( "dir %s is the same as current.\n", debugstr_us(dir) ); + nts = STATUS_SUCCESS; + goto out; + } + attr.Length = sizeof(attr); attr.RootDirectory = 0; attr.Attributes = OBJ_CASE_INSENSITIVE; @@ -962,10 +978,6 @@ NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING* dir) curdir->Handle = handle; /* append trailing \ if missing */ - size = newdir.Length / sizeof(WCHAR); - ptr = newdir.Buffer; - ptr += 4; /* skip \??\ prefix */ - size -= 4; if (size && ptr[size - 1] != '\\') ptr[size++] = '\\'; /* convert \??\UNC\ path to \\ prefix */ From 5bdeb2308ca9c153a33047786f7bd74fee46336b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 17 Sep 2021 21:49:11 +0300 Subject: [PATCH 0641/2542] advapi32: HACK: Don't free provider library in CryptReleaseContext() for DeathLoop. CW-Bug-Id: #19427 Avoids a lockup in DeathLoop. To be dropped once we have a GetModuleHandle() not blocking on the loader lock. --- dlls/advapi32/crypt.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/advapi32/crypt.c b/dlls/advapi32/crypt.c index 0c94999660a2..d996bc545d15 100644 --- a/dlls/advapi32/crypt.c +++ b/dlls/advapi32/crypt.c @@ -645,9 +645,19 @@ BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, DWORD dwFlags) if (InterlockedDecrement(&pProv->refcount) == 0) { + static unsigned int once; + char sgi[64]; + ret = pProv->pFuncs->pCPReleaseContext(pProv->hPrivate, dwFlags); pProv->dwMagic = 0; - FreeLibrary(pProv->hModule); + if(GetEnvironmentVariableA("SteamGameId", sgi, sizeof(sgi)) && !strcmp(sgi, "1252330")) + { + if (!once++) FIXME("HACK: not freeing provider library.\n"); + } + else + { + FreeLibrary(pProv->hModule); + } #if 0 CRYPT_Free(pProv->pVTable->pContextInfo); #endif From 592f9b799954932470853df96fa7828db4d9b3cb Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 16 Jun 2022 13:41:44 -0500 Subject: [PATCH 0642/2542] ntdll: Factor out validate_context_xstate() function. CW-Bug-Id: #20821 --- dlls/ntdll/unix/signal_i386.c | 4 +--- dlls/ntdll/unix/signal_x86_64.c | 4 +--- dlls/ntdll/unix/thread.c | 20 ++++++++++++++++++++ dlls/ntdll/unix/unix_private.h | 1 + 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 4bb518fe6cb9..81e9c7c8ee74 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -1136,9 +1136,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) XSAVE_AREA_HEADER *xstate = (XSAVE_AREA_HEADER *)((char *)context_ex + context_ex->XState.Offset); UINT64 mask; - if (context_ex->XState.Length < sizeof(XSAVE_AREA_HEADER) || - context_ex->XState.Length > sizeof(XSAVE_AREA_HEADER) + xstate_features_size) - return STATUS_INVALID_PARAMETER; + if (!validate_context_xstate( context )) return STATUS_INVALID_PARAMETER; if (xstate_compaction_enabled) frame->xstate.CompactionMask |= xstate_extended_features(); mask = (xstate_compaction_enabled ? xstate->CompactionMask : xstate->Mask) & xstate_extended_features(); diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 6a454e8cec6c..9a2fcb9430ae 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -1194,9 +1194,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) XSAVE_AREA_HEADER *xstate = (XSAVE_AREA_HEADER *)((char *)context_ex + context_ex->XState.Offset); UINT64 mask; - if (context_ex->XState.Length < sizeof(XSAVE_AREA_HEADER) || - context_ex->XState.Length > sizeof(XSAVE_AREA_HEADER) + xstate_features_size) - return STATUS_INVALID_PARAMETER; + if (!validate_context_xstate( context )) return STATUS_INVALID_PARAMETER; if (xstate_compaction_enabled) frame->xstate.CompactionMask |= xstate_extended_features(); mask = (xstate_compaction_enabled ? xstate->CompactionMask : xstate->Mask) & xstate_extended_features(); diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index c5c0b9f3302a..54a857593b7c 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -164,6 +164,26 @@ void fpu_to_fpux( XMM_SAVE_AREA32 *fpux, const I386_FLOATING_SAVE_AREA *fpu ) } +#if defined(__i386__) || defined(__x86_64__) + +/*********************************************************************** + * validate_context_xstate + */ +BOOL validate_context_xstate( CONTEXT *context ) +{ + CONTEXT_EX *context_ex; + + context_ex = (CONTEXT_EX *)(context + 1); + + if (context_ex->XState.Length < sizeof(XSAVE_AREA_HEADER) || + context_ex->XState.Length > sizeof(XSAVE_AREA_HEADER) + xstate_features_size) + return FALSE; + + return TRUE; +} + +#endif + /*********************************************************************** * get_server_context_flags */ diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 787f20372eb3..642ae0ad9d77 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -267,6 +267,7 @@ extern void DECLSPEC_NORETURN abort_process( int status ); extern void DECLSPEC_NORETURN exit_process( int status ); extern void wait_suspend( CONTEXT *context ); extern NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance, BOOL exception ); +extern BOOL validate_context_xstate( CONTEXT *context ); extern NTSTATUS set_thread_context( HANDLE handle, const void *context, BOOL *self, USHORT machine ); extern NTSTATUS get_thread_context( HANDLE handle, void *context, BOOL *self, USHORT machine ); extern unsigned int alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct object_attributes **ret, From 3478022e88084f6ef90f87a98e9f183925a319d1 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 16 Jun 2022 13:50:10 -0500 Subject: [PATCH 0643/2542] ntdll: Validate context xstate at once in NtGetContextThread(). CW-Bug-Id: #20821 --- dlls/ntdll/unix/signal_i386.c | 4 ++-- dlls/ntdll/unix/signal_x86_64.c | 4 ++-- dlls/ntdll/unix/thread.c | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 81e9c7c8ee74..b1b03ae90840 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -1037,6 +1037,8 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) BOOL use_cached_debug_regs = FALSE; NTSTATUS ret; + if (!validate_context_xstate( context )) return STATUS_INVALID_PARAMETER; + if (self && needed_flags & CONTEXT_DEBUG_REGISTERS) { /* debug registers require a server call if hw breakpoints are enabled */ @@ -1136,8 +1138,6 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) XSAVE_AREA_HEADER *xstate = (XSAVE_AREA_HEADER *)((char *)context_ex + context_ex->XState.Offset); UINT64 mask; - if (!validate_context_xstate( context )) return STATUS_INVALID_PARAMETER; - if (xstate_compaction_enabled) frame->xstate.CompactionMask |= xstate_extended_features(); mask = (xstate_compaction_enabled ? xstate->CompactionMask : xstate->Mask) & xstate_extended_features(); xstate->Mask = frame->xstate.Mask & mask; diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 9a2fcb9430ae..9574843f37ad 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -1104,6 +1104,8 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) BOOL use_cached_debug_regs = FALSE; BOOL self = (handle == GetCurrentThread()); + if (!validate_context_xstate( context )) return STATUS_INVALID_PARAMETER; + if (self && needed_flags & CONTEXT_DEBUG_REGISTERS) { /* debug registers require a server call if hw breakpoints are enabled */ @@ -1194,8 +1196,6 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) XSAVE_AREA_HEADER *xstate = (XSAVE_AREA_HEADER *)((char *)context_ex + context_ex->XState.Offset); UINT64 mask; - if (!validate_context_xstate( context )) return STATUS_INVALID_PARAMETER; - if (xstate_compaction_enabled) frame->xstate.CompactionMask |= xstate_extended_features(); mask = (xstate_compaction_enabled ? xstate->CompactionMask : xstate->Mask) & xstate_extended_features(); xstate->Mask = frame->xstate.Mask & mask; diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 54a857593b7c..eef75577690d 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -173,6 +173,8 @@ BOOL validate_context_xstate( CONTEXT *context ) { CONTEXT_EX *context_ex; + if (!((context->ContextFlags & 0x40) && xstate_extended_features())) return TRUE; + context_ex = (CONTEXT_EX *)(context + 1); if (context_ex->XState.Length < sizeof(XSAVE_AREA_HEADER) || From 301aa71d222d382a0946fe62ba5c6e825f88d445 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 16 Jun 2022 13:25:39 -0500 Subject: [PATCH 0644/2542] ntdll: Validate xstate alignment in validate_context_xstate(). CW-Bug-Id: #20821 --- dlls/ntdll/tests/exception.c | 14 ++++++++++++++ dlls/ntdll/unix/thread.c | 2 ++ 2 files changed, 16 insertions(+) diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 9b5ca2ca5086..82be444e6f0c 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -10025,6 +10025,7 @@ static void test_extended_context(void) CONTEXT_EX *context_ex; CONTEXT *context; unsigned data[8]; + NTSTATUS status; HANDLE thread; ULONG64 mask; XSTATE *xs; @@ -10859,6 +10860,19 @@ static void test_extended_context(void) thread = CreateThread(NULL, 0, test_extended_context_thread, 0, CREATE_SUSPENDED, NULL); ok(!!thread, "Failed to create thread.\n"); + /* Unaligned xstate. */ + length = sizeof(context_buffer); + memset(context_buffer, 0xcc, sizeof(context_buffer)); + bret = pInitializeContext(context_buffer, CONTEXT_FULL | CONTEXT_XSTATE | CONTEXT_FLOATING_POINT, + &context, &length); + ok(bret, "Got unexpected bret %#x.\n", bret); + context_ex = (CONTEXT_EX *)(context + 1); + context_ex->XState.Offset += 0x10; + status = pNtGetContextThread(thread, context); + ok(status == STATUS_INVALID_PARAMETER, "Unexpected status %#lx.\n", status); + status = pNtGetContextThread(GetCurrentThread(), context); + ok(status == STATUS_INVALID_PARAMETER, "Unexpected status %#lx.\n", status); + bret = pInitializeContext(context_buffer, CONTEXT_FULL | CONTEXT_XSTATE | CONTEXT_FLOATING_POINT, &context, &length); ok(bret, "Got unexpected bret %#x.\n", bret); diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index eef75577690d..10b071ddc18d 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -181,6 +181,8 @@ BOOL validate_context_xstate( CONTEXT *context ) context_ex->XState.Length > sizeof(XSAVE_AREA_HEADER) + xstate_features_size) return FALSE; + if (((ULONG_PTR)context_ex + context_ex->XState.Offset) & 63) return FALSE; + return TRUE; } From cf474b52b7571b6d8e0394a830dc0086abab0b99 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 5 Jan 2022 13:31:14 +0300 Subject: [PATCH 0645/2542] audioses: Add stub dll. CW-Bug-Id: #19918 --- configure.ac | 1 + dlls/audioses/Makefile.in | 1 + dlls/audioses/audioses.spec | 11 +++++++++++ 3 files changed, 13 insertions(+) create mode 100644 dlls/audioses/Makefile.in create mode 100644 dlls/audioses/audioses.spec diff --git a/configure.ac b/configure.ac index 831fb6701f23..1269061eb875 100644 --- a/configure.ac +++ b/configure.ac @@ -2461,6 +2461,7 @@ WINE_CONFIG_MAKEFILE(dlls/atl90) WINE_CONFIG_MAKEFILE(dlls/atlthunk) WINE_CONFIG_MAKEFILE(dlls/atlthunk/tests) WINE_CONFIG_MAKEFILE(dlls/atmlib) +WINE_CONFIG_MAKEFILE(dlls/audioses) WINE_CONFIG_MAKEFILE(dlls/authz) WINE_CONFIG_MAKEFILE(dlls/avicap32) WINE_CONFIG_MAKEFILE(dlls/avifil32) diff --git a/dlls/audioses/Makefile.in b/dlls/audioses/Makefile.in new file mode 100644 index 000000000000..370949ea4fed --- /dev/null +++ b/dlls/audioses/Makefile.in @@ -0,0 +1 @@ +MODULE = audioses.dll diff --git a/dlls/audioses/audioses.spec b/dlls/audioses/audioses.spec new file mode 100644 index 000000000000..a1884e532433 --- /dev/null +++ b/dlls/audioses/audioses.spec @@ -0,0 +1,11 @@ +# @ stub AUDIOSES_1 +# @ stub AUDIOSES_2 +# @ stub AUDIOSES_3 +# @ stub AUDIOSES_4 +# @ stub AUDIOSES_5 +# @ stub DllCanUnloadNow +# @ stub AUDIOSES_7 +# @ stub DllGetActivationFactory +# @ stub DllGetClassObject +# @ stub DllRegisterServer +# @ stub DllUnregisterServer From 9ceacdcd166333ae79fc6e423da77c049c1507c6 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 12 Aug 2022 18:12:29 -0500 Subject: [PATCH 0646/2542] ddraw: Force x87 arithmetic. CW-Bug-Id: #21119 --- dlls/ddraw/ddraw_private.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index bd1df8e1b822..7e837c40c3b8 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -19,6 +19,10 @@ #ifndef __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H #define __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H +#ifdef __i386__ +#pragma GCC target ("fpmath=387") +#endif + #include #include #include From 03044171ca156945b4c81374a1bbee63a81b16a6 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 14 Nov 2022 13:39:39 -0600 Subject: [PATCH 0647/2542] windowscodecs: HACK: Avoid using __builtin_frame_address() for setjmp(). This is a workaround to compiler bug (observed with Mingw / Gcc 10.x). CW-Bug-Id: #21563 --- dlls/windowscodecs/wincodecs_private.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/windowscodecs/wincodecs_private.h b/dlls/windowscodecs/wincodecs_private.h index 9da717fc3450..76db7439db12 100644 --- a/dlls/windowscodecs/wincodecs_private.h +++ b/dlls/windowscodecs/wincodecs_private.h @@ -398,4 +398,9 @@ extern HRESULT CommonDecoder_CreateInstance(struct decoder *decoder, extern HRESULT CommonEncoder_CreateInstance(struct encoder *encoder, const struct encoder_info *encoder_info, REFIID iid, void** ppv); +#ifdef _WIN64 +#undef setjmp +#define setjmp(buf) _setjmpex(buf, NULL) +#endif + #endif /* WINCODECS_PRIVATE_H */ From 515e5dda98a94f6a37ea683e1a743396247792b3 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 10 Mar 2022 17:58:41 +0300 Subject: [PATCH 0648/2542] ntdll: HACK: Delay resuming thread after suspending self. CW-Bug-Id: #20270 Fixes a random hang on exit in Little Nightmares 2. --- dlls/ntdll/unix/thread.c | 5 ++++- server/thread.c | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 10b071ddc18d..84f4d1f199bc 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -1651,6 +1651,7 @@ NTSTATUS WINAPI NtOpenThread( HANDLE *handle, ACCESS_MASK access, */ NTSTATUS WINAPI NtSuspendThread( HANDLE handle, ULONG *count ) { + BOOL self = FALSE; unsigned int ret; SERVER_START_REQ( suspend_thread ) @@ -1658,10 +1659,12 @@ NTSTATUS WINAPI NtSuspendThread( HANDLE handle, ULONG *count ) req->handle = wine_server_obj_handle( handle ); if (!(ret = wine_server_call( req ))) { - if (count) *count = reply->count; + self = reply->count & 0x80000000; + if (count) *count = reply->count & 0x7fffffff; } } SERVER_END_REQ; + if (self) usleep( 0 ); return ret; } diff --git a/server/thread.c b/server/thread.c index ffbb04969495..cd88e147f66c 100644 --- a/server/thread.c +++ b/server/thread.c @@ -830,7 +830,11 @@ int suspend_thread( struct thread *thread ) int old_count = thread->suspend; if (thread->suspend < MAXIMUM_SUSPEND_COUNT) { - if (!(thread->process->suspend + thread->suspend++)) stop_thread( thread ); + if (!(thread->process->suspend + thread->suspend++)) + { + stop_thread( thread ); + if (thread == current) return old_count | 0x80000000; + } } else set_error( STATUS_SUSPEND_COUNT_EXCEEDED ); return old_count; From fb2fbde88442592a9866a5ac53b23889f3c34c8d Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 8 Apr 2022 20:30:55 +0300 Subject: [PATCH 0649/2542] wine.inf: Set display mode parameters for Star Wars: Episode I Racer. CW-Bug-Id: #20422 --- loader/wine.inf.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 5afc250c6655..ca1c8061e025 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2872,3 +2872,5 @@ HKCU,Software\Wine\AppDefaults\rayne1.exe\DllOverrides,"d3d8",,"native" HKCU,Software\Wine\AppDefaults\rayne2.exe\DllOverrides,"d3d8",,"native" HKCU,Software\Wine\AppDefaults\RDR2.exe\DllOverrides,"vulkan-1",,"native" HKLM,Software\Khronos\OpenXR\1,"ActiveRuntime",,"C:\openxr\wineopenxr64.json" +HKLM,Software\Wow6432Node\lucasarts entertainment company llc\Star Wars: Episode I Racer\v1.0,"Display Height",0x10001,480 +HKLM,Software\Wow6432Node\lucasarts entertainment company llc\Star Wars: Episode I Racer\v1.0,"Display Width",0x10001,640 From 7752bd457227dc1f9ce845b69631e9db0693fd5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Tue, 30 Nov 2021 16:32:34 +0300 Subject: [PATCH 0650/2542] ntdll: Implement opening files through nt device paths. CW-Bug-Id: #19697 For Eternal Return. --- dlls/ntdll/tests/file.c | 25 +++++++- dlls/ntdll/unix/file.c | 134 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 156 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 08673af0444e..74513ea44bc9 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -138,19 +138,23 @@ static void WINAPI apc( void *arg, IO_STATUS_BLOCK *iosb, ULONG reserved ) static void create_file_test(void) { + static const WCHAR notepadW[] = {'n','o','t','e','p','a','d','.','e','x','e',0}; static const WCHAR systemrootW[] = {'\\','S','y','s','t','e','m','R','o','o','t', '\\','f','a','i','l','i','n','g',0}; + static const WCHAR systemrootExplorerW[] = {'\\','S','y','s','t','e','m','R','o','o','t', + '\\','e','x','p','l','o','r','e','r','.','e','x','e',0}; static const WCHAR questionmarkInvalidNameW[] = {'a','f','i','l','e','?',0}; static const WCHAR pipeInvalidNameW[] = {'a','|','b',0}; static const WCHAR pathInvalidNtW[] = {'\\','\\','?','\\',0}; static const WCHAR pathInvalidNt2W[] = {'\\','?','?','\\',0}; static const WCHAR pathInvalidDosW[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\',0}; static const char testdata[] = "Hello World"; + static const WCHAR sepW[] = {'\\',0}; FILE_NETWORK_OPEN_INFORMATION info; UNICODE_STRING nameW, null_string; NTSTATUS status; HANDLE dir, file; - WCHAR path[MAX_PATH]; + WCHAR path[MAX_PATH], temp[MAX_PATH]; OBJECT_ATTRIBUTES attr; IO_STATUS_BLOCK io; LARGE_INTEGER offset; @@ -349,6 +353,25 @@ static void create_file_test(void) status = pNtQueryFullAttributesFile( &attr, &info ); ok( status == STATUS_OBJECT_NAME_INVALID, "query %s failed %lx\n", wine_dbgstr_w(nameW.Buffer), status ); + + GetWindowsDirectoryW( path, MAX_PATH ); + path[2] = 0; + ok( QueryDosDeviceW( path, temp, MAX_PATH ), + "QueryDosDeviceW failed with error %u\n", GetLastError() ); + lstrcatW( temp, sepW ); + lstrcatW( temp, path+3 ); + lstrcatW( temp, sepW ); + lstrcatW( temp, notepadW ); + + pRtlInitUnicodeString( &nameW, temp ); + status = pNtQueryFullAttributesFile( &attr, &info ); + ok( status == STATUS_SUCCESS, + "query %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status ); + + pRtlInitUnicodeString( &nameW, systemrootExplorerW ); + status = pNtQueryFullAttributesFile( &attr, &info ); + ok( status == STATUS_SUCCESS, + "query %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status ); } static void open_file_test(void) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 3e29559997b0..71329279df0c 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -3755,7 +3755,7 @@ static NTSTATUS nt_to_unix_file_name_no_root( const UNICODE_STRING *nameW, char /****************************************************************************** - * nt_to_unix_file_name + * nt_to_unix_file_name_internal * * Convert a file name from NT namespace to Unix namespace. * @@ -3763,7 +3763,7 @@ static NTSTATUS nt_to_unix_file_name_no_root( const UNICODE_STRING *nameW, char * element doesn't have to exist; in that case STATUS_NO_SUCH_FILE is * returned, but the unix name is still filled in properly. */ -NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name_ret, UINT disposition ) +NTSTATUS nt_to_unix_file_name_internal( const OBJECT_ATTRIBUTES *attr, char **name_ret, UINT disposition ) { enum server_fd_type type; int old_cwd, root_fd, needs_close; @@ -3824,6 +3824,136 @@ NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name_ret, U } +/* read the contents of an NT symlink object */ +static NTSTATUS read_nt_symlink( HANDLE root, UNICODE_STRING *name, WCHAR *target, size_t length ) +{ + OBJECT_ATTRIBUTES attr; + UNICODE_STRING targetW; + NTSTATUS status; + HANDLE handle; + + attr.Length = sizeof(attr); + attr.RootDirectory = root; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.ObjectName = name; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + if (!(status = NtOpenSymbolicLinkObject( &handle, SYMBOLIC_LINK_QUERY, &attr ))) + { + targetW.Buffer = target; + targetW.MaximumLength = (length - 1) * sizeof(WCHAR); + status = NtQuerySymbolicLinkObject( handle, &targetW, NULL ); + NtClose( handle ); + } + + return status; +} + +/* try to find dos device based on nt device name */ +static NTSTATUS nt_to_dos_device( WCHAR *name, size_t length, WCHAR *device_ret ) +{ + static const WCHAR dosdevicesW[] = {'\\','D','o','s','D','e','v','i','c','e','s',0}; + UNICODE_STRING dosdevW = { sizeof(dosdevicesW) - sizeof(WCHAR), sizeof(dosdevicesW), (WCHAR *)dosdevicesW }; + WCHAR symlinkW[MAX_DIR_ENTRY_LEN]; + OBJECT_ATTRIBUTES attr; + NTSTATUS status; + char data[1024]; + HANDLE handle; + ULONG ctx = 0; + + DIRECTORY_BASIC_INFORMATION *info = (DIRECTORY_BASIC_INFORMATION *)data; + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.ObjectName = &dosdevW; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + status = NtOpenDirectoryObject( &handle, FILE_LIST_DIRECTORY, &attr ); + if (status) return STATUS_BAD_DEVICE_TYPE; + + while (!NtQueryDirectoryObject( handle, info, sizeof(data), TRUE, FALSE, &ctx, NULL )) + { + if (read_nt_symlink( handle, &info->ObjectName, symlinkW, MAX_DIR_ENTRY_LEN )) continue; + if (wcsnicmp( symlinkW, name, length )) continue; + if (info->ObjectName.Length != 2 * sizeof(WCHAR) || info->ObjectName.Buffer[1] != ':') continue; + + *device_ret = info->ObjectName.Buffer[0]; + NtClose( handle ); + return STATUS_SUCCESS; + } + + NtClose( handle ); + return STATUS_BAD_DEVICE_TYPE; +} + +/****************************************************************************** + * nt_to_unix_file_name + * + * Convert a file name from NT namespace to Unix namespace. + * + * If disposition is not FILE_OPEN or FILE_OVERWRITE, the last path + * element doesn't have to exist; in that case STATUS_NO_SUCH_FILE is + * returned, but the unix name is still filled in properly. + */ +NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name_ret, UINT disposition ) +{ + static const WCHAR systemrootW[] = {'\\','S','y','s','t','e','m','R','o','o','t','\\',0}; + static const WCHAR dosprefixW[] = {'\\','?','?','\\'}; + static const WCHAR deviceW[] = {'\\','D','e','v','i','c','e','\\',0}; + WCHAR *name, *ptr, *prefix, buffer[3] = {'c',':',0}; + UNICODE_STRING dospathW, *nameW; + OBJECT_ATTRIBUTES attr_copy; + size_t offset, name_len; + NTSTATUS status; + + if (attr->RootDirectory) return nt_to_unix_file_name_internal( attr, name_ret, disposition ); + + nameW = attr->ObjectName; + + if (nameW->Length >= sizeof(deviceW) - sizeof(WCHAR) + && !wcsnicmp( nameW->Buffer, deviceW, ARRAY_SIZE(deviceW) - 1 )) + { + offset = sizeof(deviceW) / sizeof(WCHAR); + while (offset * sizeof(WCHAR) < nameW->Length && nameW->Buffer[ offset ] != '\\') offset++; + if ((status = nt_to_dos_device( nameW->Buffer, offset, buffer ))) return status; + prefix = buffer; + } + else if (nameW->Length >= sizeof(systemrootW) - sizeof(WCHAR) && + !wcsnicmp( nameW->Buffer, systemrootW, ARRAY_SIZE(systemrootW) - 1 )) + { + offset = (sizeof(systemrootW) - 1) / sizeof(WCHAR); + prefix = user_shared_data->NtSystemRoot; + } + else + return nt_to_unix_file_name_internal( attr, name_ret, disposition ); + + name_len = sizeof(dosprefixW) + wcslen(prefix) * sizeof(WCHAR) + + sizeof(WCHAR) /* '\\' */ + nameW->Length - offset * sizeof(WCHAR) + sizeof(WCHAR); + if (!(name = malloc( name_len ))) + return STATUS_NO_MEMORY; + + ptr = name; + memcpy( ptr, dosprefixW, sizeof(dosprefixW) ); + ptr += sizeof(dosprefixW) / sizeof(WCHAR); + wcscpy( ptr, prefix ); + ptr += wcslen(ptr); + *ptr++ = '\\'; + memcpy( ptr, nameW->Buffer + offset, nameW->Length - offset * sizeof(WCHAR) ); + ptr[ nameW->Length / sizeof(WCHAR) - offset ] = 0; + + dospathW.Buffer = name; + dospathW.Length = wcslen( name ) * sizeof(WCHAR); + attr_copy = *attr; + attr_copy.ObjectName = &dospathW; + status = nt_to_unix_file_name_internal( &attr_copy, name_ret, disposition ); + + free( name ); + return status; +} + /****************************************************************************** * wine_nt_to_unix_file_name * From 90ad902c1a3695f9263e951680c86bbbb830a868 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 11 Oct 2021 11:13:39 +0200 Subject: [PATCH 0651/2542] ntdll: Resolve drive symlinks when querying section names. Based on a patch by Sebastian Lackner. For BeamNG.drive. CW-Bug-Id: 18793 --- dlls/ntdll/unix/virtual.c | 83 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 0248f67aac53..4ca19c949ec8 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -5876,6 +5876,86 @@ static NTSTATUS get_working_set_ex( HANDLE process, LPCVOID addr, return STATUS_SUCCESS; } +static NTSTATUS read_nt_symlink( UNICODE_STRING *name, WCHAR *target, DWORD size ) +{ + NTSTATUS status; + OBJECT_ATTRIBUTES attr; + HANDLE handle; + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.ObjectName = name; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + if (!(status = NtOpenSymbolicLinkObject( &handle, SYMBOLIC_LINK_QUERY, &attr ))) + { + UNICODE_STRING targetW; + targetW.Buffer = target; + targetW.MaximumLength = (size - 1) * sizeof(WCHAR); + status = NtQuerySymbolicLinkObject( handle, &targetW, NULL ); + if (!status) target[targetW.Length / sizeof(WCHAR)] = 0; + NtClose( handle ); + } + return status; +} + +static NTSTATUS resolve_drive_symlink( UNICODE_STRING *name, SIZE_T max_name_len, SIZE_T *ret_len, NTSTATUS status ) +{ + static int enabled = -1; + + static const WCHAR dosprefixW[] = {'\\','?','?','\\'}; + UNICODE_STRING device_name; + SIZE_T required_length, symlink_len; + WCHAR symlink[256]; + size_t offset = 0; + + if (enabled == -1) + { + const char *sgi = getenv("SteamGameId"); + + enabled = sgi && !strcmp(sgi, "284160"); + } + if (!enabled) return status; + if (status == STATUS_INFO_LENGTH_MISMATCH) + { + /* FIXME */ + *ret_len += 64; + return status; + } + if (status) return status; + + if (name->Length < sizeof(dosprefixW) || + memcmp( name->Buffer, dosprefixW, sizeof(dosprefixW) )) + return STATUS_SUCCESS; + + offset = ARRAY_SIZE(dosprefixW); + while (offset * sizeof(WCHAR) < name->Length && name->Buffer[ offset ] != '\\') offset++; + + device_name = *name; + device_name.Length = offset * sizeof(WCHAR); + if ((status = read_nt_symlink( &device_name, symlink, ARRAY_SIZE( symlink )))) + { + ERR("read_nt_symlink failed, status %#x.\n", (int)status); + return status; + } + symlink_len = wcslen( symlink ); + required_length = symlink_len * sizeof(WCHAR) + + name->Length - offset * sizeof(WCHAR) + sizeof(WCHAR); + if (ret_len) + *ret_len = sizeof(MEMORY_SECTION_NAME) + required_length; + if (required_length > max_name_len) + return STATUS_INFO_LENGTH_MISMATCH; + + memmove( name->Buffer + symlink_len, name->Buffer + offset, name->Length - offset * sizeof(WCHAR) ); + memcpy( name->Buffer, symlink, symlink_len * sizeof(WCHAR) ); + name->MaximumLength = required_length; + name->Length = required_length - sizeof(WCHAR); + name->Buffer[name->Length / sizeof(WCHAR)] = 0; + return STATUS_SUCCESS; +} + static unsigned int get_memory_section_name( HANDLE process, LPCVOID addr, MEMORY_SECTION_NAME *info, SIZE_T len, SIZE_T *ret_len ) { @@ -5904,7 +5984,8 @@ static unsigned int get_memory_section_name( HANDLE process, LPCVOID addr, } } SERVER_END_REQ; - return status; + + return resolve_drive_symlink( &info->SectionFileName, len - sizeof(*info), ret_len, status ); } static unsigned int get_memory_image_info( HANDLE process, LPCVOID addr, MEMORY_IMAGE_INFORMATION *info, From f8db55e844b49b89ab123072b3d8ede3b1209013 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Tue, 14 Dec 2021 13:01:58 +0100 Subject: [PATCH 0652/2542] HACK: server: Fake success when trying to bind to an IPX address. --- server/sock.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/sock.c b/server/sock.c index 3d0307b990e7..21b4621bb0c9 100644 --- a/server/sock.c +++ b/server/sock.c @@ -3023,7 +3023,11 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) if (check_addr_usage( sock, &bind_addr, v6only )) return; - if (bind( unix_fd, &bind_addr.addr, unix_len ) < 0) + /* Quake (and similar family) fails if we can't bind to an IPX address. This often + * doesn't work on Linux, so just fake success. */ + if (unix_addr.addr.sa_family == AF_IPX) + fprintf( stderr, "wine: HACK: Faking AF_IPX bind success.\n" ); + else if (bind( unix_fd, &bind_addr.addr, unix_len ) < 0) { if (errno == EADDRINUSE && sock->reuseaddr) errno = EACCES; From fcaa86e81e25fc21f78490e1a182c3b196c305bf Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 15 Mar 2021 13:10:16 -0500 Subject: [PATCH 0653/2542] ntdll: HACK: Add WINE_HEAP_DELAY_FREE variable to force the use of pending free buffer. CW-Bug-Id: #20334 --- dlls/ntdll/heap.c | 8 +++--- dlls/ntdll/loader.c | 57 +++++++++++++++++++++-------------------- dlls/ntdll/ntdll_misc.h | 2 ++ 3 files changed, 36 insertions(+), 31 deletions(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index f999fcbadf25..67592ebd56ea 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -328,6 +328,8 @@ C_ASSERT( HEAP_MIN_LARGE_BLOCK_SIZE <= HEAP_INITIAL_GROW_SIZE ); #define HEAP_VALIDATE_PARAMS 0x40000000 #define HEAP_CHECKING_ENABLED 0x80000000 +BOOL delay_heap_free = FALSE; + static struct heap *process_heap; /* main process heap */ static NTSTATUS heap_free_block_lfh( struct heap *heap, ULONG flags, struct block *block ); @@ -1481,8 +1483,8 @@ static void heap_set_debug_flags( HANDLE handle ) } } - if ((heap->flags & HEAP_GROWABLE) && !heap->pending_free && - ((flags & HEAP_FREE_CHECKING_ENABLED) || RUNNING_ON_VALGRIND)) + if (delay_heap_free || ((heap->flags & HEAP_GROWABLE) && !heap->pending_free && + ((flags & HEAP_FREE_CHECKING_ENABLED) || RUNNING_ON_VALGRIND))) { heap->pending_free = RtlAllocateHeap( handle, HEAP_ZERO_MEMORY, MAX_FREE_PENDING * sizeof(*heap->pending_free) ); @@ -2601,7 +2603,7 @@ NTSTATUS WINAPI RtlSetHeapInformation( HANDLE handle, HEAP_INFORMATION_CLASS inf FIXME( "HeapCompatibilityInformation %lu not implemented!\n", compat_info ); return STATUS_UNSUCCESSFUL; } - if (InterlockedCompareExchange( &heap->compat_info, compat_info, HEAP_STD ) != HEAP_STD) + if (!delay_heap_free && InterlockedCompareExchange( &heap->compat_info, compat_info, HEAP_STD ) != HEAP_STD) return STATUS_UNSUCCESSFUL; return STATUS_SUCCESS; } diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 11debacd9b11..eee21406e614 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -202,6 +202,21 @@ static inline BOOL contains_path( LPCWSTR name ) return ((*name && (name[1] == ':')) || wcschr(name, '/') || wcschr(name, '\\')); } +static BOOL get_env( const WCHAR *var, WCHAR *val, unsigned int len ) +{ + UNICODE_STRING name, value; + + name.Length = wcslen( var ) * sizeof(WCHAR); + name.MaximumLength = name.Length + sizeof(WCHAR); + name.Buffer = (WCHAR *)var; + + value.Length = 0; + value.MaximumLength = len; + value.Buffer = val; + + return !RtlQueryEnvironmentVariable_U( NULL, &name, &value ); +} + #define RTL_UNLOAD_EVENT_TRACE_NUMBER 64 typedef struct _RTL_UNLOAD_EVENT_TRACE @@ -3211,31 +3226,6 @@ static WCHAR *strstriW( const WCHAR *str, const WCHAR *sub ) return NULL; } -static WCHAR *get_env( const WCHAR *var ) -{ - UNICODE_STRING name, value; - - RtlInitUnicodeString( &name, var ); - value.Length = 0; - value.MaximumLength = 0; - value.Buffer = NULL; - - if (RtlQueryEnvironmentVariable_U( NULL, &name, &value ) == STATUS_BUFFER_TOO_SMALL) { - - value.Buffer = RtlAllocateHeap( GetProcessHeap(), 0, value.Length + sizeof(WCHAR) ); - value.MaximumLength = value.Length; - - if (RtlQueryEnvironmentVariable_U( NULL, &name, &value ) == STATUS_SUCCESS) { - value.Buffer[value.Length / sizeof(WCHAR)] = 0; - return value.Buffer; - } - - RtlFreeHeap( GetProcessHeap(), 0, value.Buffer ); - } - - return NULL; -} - /*********************************************************************** * find_dll_file * @@ -3307,8 +3297,9 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, UNI * Some games try to load mfc42.dll, but then proceed to not use it. * Just return a handle to kernel32 in that case. */ - WCHAR *sgi = get_env( L"SteamGameId" ); - if (sgi) + WCHAR sgi[32]; + + if (get_env( L"SteamGameId", sgi, sizeof(sgi) )) { if (!wcscmp( sgi, L"105450") && strstriW( libname, L"mfc42" )) @@ -3316,7 +3307,6 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, UNI WARN_(loaddll)( "Using a fake mfc42 handle\n" ); status = find_dll_file( load_path, L"kernel32.dll", nt_name, pwm, mapping, image_info, id, TRUE ); } - RtlFreeHeap(GetProcessHeap(), 0, sgi); } } return status; @@ -4421,6 +4411,7 @@ void loader_init( CONTEXT *context, void **entry ) ANSI_STRING ctrl_routine = RTL_CONSTANT_STRING( "CtrlRoutine" ); WINE_MODREF *kernel32; PEB *peb = NtCurrentTeb()->Peb; + WCHAR env_str[16]; unsigned int i; peb->LdrData = &ldr; @@ -4428,6 +4419,16 @@ void loader_init( CONTEXT *context, void **entry ) peb->TlsBitmap = &tls_bitmap; peb->TlsExpansionBitmap = &tls_expansion_bitmap; peb->LoaderLock = &loader_section; + + if (get_env( L"WINE_HEAP_DELAY_FREE", env_str, sizeof(env_str)) ) + { + if (env_str[0] == L'1') + { + ERR( "Enabling heap free delay hack.\n" ); + delay_heap_free = TRUE; + } + } + peb->ProcessHeap = RtlCreateHeap( HEAP_GROWABLE, NULL, 0, 0, NULL, NULL ); RtlInitializeBitMap( &tls_bitmap, peb->TlsBitmapBits, sizeof(peb->TlsBitmapBits) * 8 ); diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index fb5fb311646c..154c530ad065 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -53,6 +53,8 @@ static const UINT_PTR page_size = 0x1000; extern UINT_PTR page_size; #endif +extern BOOL delay_heap_free; + /* exceptions */ extern NTSTATUS call_seh_handlers( EXCEPTION_RECORD *rec, CONTEXT *context ); extern NTSTATUS WINAPI dispatch_exception( EXCEPTION_RECORD *rec, CONTEXT *context ); From 7e893b6b492544f929435cc2000d3fc2a016984e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 10 Feb 2022 16:17:41 +0300 Subject: [PATCH 0654/2542] ntdll: Guard against syscall stack overrun. --- dlls/ntdll/unix/signal_arm.c | 4 ++++ dlls/ntdll/unix/signal_arm64.c | 4 ++++ dlls/ntdll/unix/signal_i386.c | 4 ++++ dlls/ntdll/unix/signal_x86_64.c | 4 ++++ dlls/ntdll/unix/thread.c | 2 +- dlls/ntdll/unix/unix_private.h | 10 +++++++++- dlls/ntdll/unix/virtual.c | 6 ++++++ 7 files changed, 32 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c index c9ae492597d4..c8b67929aff3 100644 --- a/dlls/ntdll/unix/signal_arm.c +++ b/dlls/ntdll/unix/signal_arm.c @@ -800,6 +800,10 @@ static BOOL handle_syscall_fault( ucontext_t *context, EXCEPTION_RECORD *rec ) (DWORD)IP_sig(context), (DWORD)SP_sig(context), (DWORD)LR_sig(context), (DWORD)PC_sig(context), (DWORD)CPSR_sig(context) ); + if (rec->ExceptionCode == STATUS_ACCESS_VIOLATION + && is_inside_syscall_stack_guard( (char *)rec->ExceptionInformation[1] )) + ERR_(seh)( "Syscall stack overrun.\n "); + if (ntdll_get_thread_data()->jmp_buf) { TRACE( "returning to handler\n" ); diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c index 57d9c375076c..dc8a252704cb 100644 --- a/dlls/ntdll/unix/signal_arm64.c +++ b/dlls/ntdll/unix/signal_arm64.c @@ -1051,6 +1051,10 @@ static BOOL handle_syscall_fault( ucontext_t *context, EXCEPTION_RECORD *rec ) (DWORD64)REGn_sig(28, context), (DWORD64)FP_sig(context), (DWORD64)LR_sig(context), (DWORD64)SP_sig(context) ); + if (rec->ExceptionCode == STATUS_ACCESS_VIOLATION + && is_inside_syscall_stack_guard( (char *)rec->ExceptionInformation[1] )) + ERR_(seh)( "Syscall stack overrun.\n "); + if (ntdll_get_thread_data()->jmp_buf) { TRACE( "returning to handler\n" ); diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index b1b03ae90840..9c284bf06abe 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -1840,6 +1840,10 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, void *stack_ptr, context->Ebp, context->Esp, context->SegCs, context->SegDs, context->SegEs, context->SegFs, context->SegGs, context->EFlags ); + if (rec->ExceptionCode == STATUS_ACCESS_VIOLATION + && is_inside_syscall_stack_guard( (char *)rec->ExceptionInformation[1] )) + ERR_(seh)( "Syscall stack overrun.\n "); + if (ntdll_get_thread_data()->jmp_buf) { TRACE( "returning to handler\n" ); diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 9574843f37ad..5573e2c20375 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -2174,6 +2174,10 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, EXCEPTION_RECORD *rec, TRACE_(seh)( " r12=%016lx r13=%016lx r14=%016lx r15=%016lx\n", context->R12, context->R13, context->R14, context->R15 ); + if (rec->ExceptionCode == STATUS_ACCESS_VIOLATION + && is_inside_syscall_stack_guard( (char *)rec->ExceptionInformation[1] )) + ERR_(seh)( "Syscall stack overrun.\n "); + if (ntdll_get_thread_data()->jmp_buf) { TRACE_(seh)( "returning to handler\n" ); diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 84f4d1f199bc..b7c1e7d9775d 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -1264,7 +1264,7 @@ NTSTATUS init_thread_stack( TEB *teb, ULONG_PTR limit, SIZE_T reserve_size, SIZE if ((status = virtual_alloc_thread_stack( &stack, limit_4g, 0, chpev2_stack_size, chpev2_stack_size, FALSE ))) return status; - cpu_area = stack.DeallocationStack; + cpu_area = (CHPE_V2_CPU_AREA_INFO *)((char*)stack.DeallocationStack + kernel_stack_guard_size); cpu_area->ContextAmd64 = (ARM64EC_NT_CONTEXT *)&cpu_area->EmulatorDataInline; cpu_area->EmulatorStackBase = (ULONG_PTR)stack.StackBase; cpu_area->EmulatorStackLimit = (ULONG_PTR)stack.StackLimit + page_size; diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 642ae0ad9d77..cea8d1394f4a 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -138,7 +138,8 @@ static const SIZE_T teb_size = 0x3800; /* TEB64 + TEB32 + debug info */ static const SIZE_T signal_stack_mask = 0xffff; static const SIZE_T signal_stack_size = 0x10000 - 0x3800; static const SIZE_T kernel_stack_size = 0x100000; -static const SIZE_T min_kernel_stack = 0x2000; +static const SIZE_T kernel_stack_guard_size = 0x1000; +static const SIZE_T min_kernel_stack = 0x3000; static const LONG teb_offset = 0x2000; #define FILE_WRITE_TO_END_OF_FILE ((LONGLONG)-1) @@ -431,6 +432,13 @@ static inline BOOL is_inside_signal_stack( void *ptr ) (char *)ptr < (char *)get_signal_stack() + signal_stack_size); } +static inline BOOL is_inside_syscall_stack_guard( const char *stack_ptr ) +{ + const char *kernel_stack = ntdll_get_thread_data()->kernel_stack; + + return (stack_ptr >= kernel_stack && stack_ptr < kernel_stack + kernel_stack_guard_size); +} + static inline BOOL is_ec_code( ULONG_PTR ptr ) { const UINT64 *map = (const UINT64 *)peb->EcCodeBitMap; diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 4ca19c949ec8..c0c3f7ada9fb 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -4314,6 +4314,12 @@ NTSTATUS virtual_alloc_thread_stack( INITIAL_TEB *stack, ULONG_PTR limit_low, UL VPROT_READ | VPROT_WRITE | VPROT_COMMITTED | VPROT_GUARD ); mprotect_range( view->base, 2 * page_size , 0, 0 ); } + else + { + /* setup kernel stack no access guard page */ + set_page_vprot( view->base, kernel_stack_guard_size, VPROT_COMMITTED | VPROT_READ ); + mprotect_range( view->base, kernel_stack_guard_size, 0, 0 ); + } VIRTUAL_DEBUG_DUMP_VIEW( view ); /* note: limit is lower than base since the stack grows down */ From 4931b3feac8e80ffe4510c21307bb037ee631985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 1 Jun 2017 06:04:53 +0200 Subject: [PATCH 0655/2542] ntdll: Fix holes in ELF mappings. (v2) Based on a patch by Andrew Wesie. Included to fix crash on startup of WRC8. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=44650 Link: https://github.com/wine-staging/wine-staging/tree/v6.3/patches/ntdll-Builtin_Prot Link: https://github.com/ValveSoftware/wine/pull/121 CW-Bug-Id: #19337 --- dlls/ntdll/unix/virtual.c | 25 +++++++++++++++++++++++++ dlls/psapi/tests/psapi_main.c | 14 +++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index c0c3f7ada9fb..2c5124e55ecf 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -4428,6 +4428,16 @@ static NTSTATUS grow_thread_stack( char *page, struct thread_stack_info *stack_i } +/*********************************************************************** + * is_system_range + */ +static inline BOOL is_system_range( const void *addr, size_t size ) +{ + struct file_view *view = find_view( addr, size ); + return view && (view->protect & VPROT_SYSTEM); +} + + /*********************************************************************** * virtual_handle_fault */ @@ -4485,6 +4495,21 @@ NTSTATUS virtual_handle_fault( EXCEPTION_RECORD *rec, void *stack ) ret = STATUS_SUCCESS; } } + else if (!err && (get_unix_prot( vprot ) & PROT_READ) && is_system_range( page, page_size )) + { + int unix_prot = get_unix_prot( vprot ); + unsigned char vec; + + TRACE("yolo\n"); + + mprotect_range( page, page_size, 0, 0 ); + if (!mincore( page, page_size, &vec ) && (vec & 1)) + ret = STATUS_SUCCESS; + else if (anon_mmap_fixed( page, page_size, unix_prot, 0 ) == page) + ret = STATUS_SUCCESS; + else + set_page_vprot_bits( page, page_size, 0, VPROT_READ | VPROT_EXEC ); + } mutex_unlock( &virtual_mutex ); rec->ExceptionCode = ret; return ret; diff --git a/dlls/psapi/tests/psapi_main.c b/dlls/psapi/tests/psapi_main.c index 92529447afa9..3139e6628db9 100644 --- a/dlls/psapi/tests/psapi_main.c +++ b/dlls/psapi/tests/psapi_main.c @@ -581,6 +581,7 @@ static void test_EnumProcessModulesEx(void) static void test_GetModuleInformation(void) { HMODULE hMod = GetModuleHandleA(NULL); + DWORD *tmp, counter = 0; MODULEINFO info; DWORD ret; @@ -600,10 +601,21 @@ static void test_GetModuleInformation(void) GetModuleInformation(hpQV, hMod, &info, sizeof(info)-1); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected error=ERROR_INSUFFICIENT_BUFFER but got %ld\n", GetLastError()); - SetLastError(0xdeadbeef); ret = GetModuleInformation(hpQV, hMod, &info, sizeof(info)); ok(ret == 1, "failed with %ld\n", GetLastError()); ok(info.lpBaseOfDll == hMod, "lpBaseOfDll=%p hMod=%p\n", info.lpBaseOfDll, hMod); + + hMod = LoadLibraryA("shell32.dll"); + ok(hMod != NULL, "Failed to load shell32.dll, error: %u\n", GetLastError()); + + ret = GetModuleInformation(hpQV, hMod, &info, sizeof(info)); + ok(ret == 1, "failed with %d\n", GetLastError()); + info.SizeOfImage /= sizeof(DWORD); + for (tmp = (DWORD *)hMod; info.SizeOfImage; info.SizeOfImage--) + counter ^= *tmp++; + trace("xor of shell32: %08x\n", counter); + + FreeLibrary(hMod); } static BOOL check_with_margin(SIZE_T perf, SIZE_T sysperf, int margin) From 28db5c0c5d22981ae48772145d51d41960d1728b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 17 Nov 2022 20:00:24 -0600 Subject: [PATCH 0656/2542] ntdll: Return FILE_DEVICE_UNKNOWN for Unix FIFOs and sockets from get_device_info(). CW-Bug-Id: #21570 --- dlls/ntdll/unix/file.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 71329279df0c..3c59fcd11fdf 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -7212,7 +7212,7 @@ NTSTATUS get_device_info( int fd, FILE_FS_DEVICE_INFORMATION *info ) } else if (S_ISFIFO( st.st_mode ) || S_ISSOCK( st.st_mode )) { - info->DeviceType = FILE_DEVICE_NAMED_PIPE; + info->DeviceType = FILE_DEVICE_UNKNOWN; } else if (is_device_placeholder( fd )) { @@ -7321,10 +7321,11 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, IO_STATUS_BLOCK *io void *buffer, ULONG length, FS_INFORMATION_CLASS info_class ) { + enum server_fd_type fd_type; int fd, needs_close; unsigned int status; - status = server_get_unix_fd( handle, 0, &fd, &needs_close, NULL, NULL ); + status = server_get_unix_fd( handle, 0, &fd, &needs_close, &fd_type, NULL ); if (status == STATUS_BAD_DEVICE_TYPE) { struct async_irp *async; @@ -7391,7 +7392,15 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, IO_STATUS_BLOCK *io { FILE_FS_DEVICE_INFORMATION *info = buffer; - if ((status = get_device_info( fd, info )) == STATUS_SUCCESS) + if (fd_type == FD_TYPE_SOCKET) + { + info->Characteristics = 0; + info->DeviceType = FILE_DEVICE_NAMED_PIPE; + status = STATUS_SUCCESS; + } + else status = get_device_info( fd, info ); + + if (!status) io->Information = sizeof(*info); } break; From a23dbcf97ff0da79de1d41de6ba9f752d43cefea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Fri, 24 Apr 2020 14:37:58 +0300 Subject: [PATCH 0657/2542] server: Try to retrieve the unix name on handles created from file descriptors. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46070 Signed-off-by: Gabriel Ivăncescu Fixes Unity of Command II, and possibly other games that use Python38.dll. --- server/fd.c | 39 +++++++++++++++++++++++++++++++++++++++ server/file.c | 1 + server/file.h | 2 ++ 3 files changed, 42 insertions(+) diff --git a/server/fd.c b/server/fd.c index 1843d4ca48ce..47c7ec7ee9aa 100644 --- a/server/fd.c +++ b/server/fd.c @@ -2105,6 +2105,45 @@ struct fd *create_anonymous_fd( const struct fd_ops *fd_user_ops, int unix_fd, s return NULL; } +void set_unix_name_of_fd( struct fd *fd, const struct stat *fd_st ) +{ +#ifdef __linux__ + static const char procfs_fmt[] = "/proc/self/fd/%d"; + + char path[PATH_MAX], procfs_path[sizeof(procfs_fmt) - 2 /* %d */ + 11]; + struct stat path_st; + ssize_t len; + + sprintf( procfs_path, procfs_fmt, fd->unix_fd ); + len = readlink( procfs_path, path, sizeof(path) ); + if (len == -1 || len >= sizeof(path) ) + return; + path[len] = '\0'; + + /* Make sure it's an absolute path, has at least one hardlink, and the same inode */ + if (path[0] != '/' || stat( path, &path_st ) || path_st.st_nlink < 1 || + path_st.st_dev != fd_st->st_dev || path_st.st_ino != fd_st->st_ino) + return; + + if (!(fd->unix_name = mem_alloc( len + 1 ))) + return; + memcpy( fd->unix_name, path, len + 1 ); + +#elif defined(F_GETPATH) + char path[PATH_MAX]; + size_t size; + + if (fcntl( fd->unix_fd, F_GETPATH, path ) == -1 || path[0] != '/') + return; + + size = strlen(path) + 1; + if (!(fd->unix_name = mem_alloc( size ))) + return; + memcpy( fd->unix_name, path, size ); + +#endif +} + /* retrieve the object that is using an fd */ void *get_fd_user( struct fd *fd ) { diff --git a/server/file.c b/server/file.c index e1342f0951d4..bbc2ebfe920b 100644 --- a/server/file.c +++ b/server/file.c @@ -157,6 +157,7 @@ struct file *create_file_for_fd( int fd, unsigned int access, unsigned int shari release_object( file ); return NULL; } + set_unix_name_of_fd( file->fd, &st ); allow_fd_caching( file->fd ); return file; } diff --git a/server/file.h b/server/file.h index f7edd7bf4e7a..4346fc402ab4 100644 --- a/server/file.h +++ b/server/file.h @@ -22,6 +22,7 @@ #define __WINE_SERVER_FILE_H #include +#include #include "object.h" @@ -86,6 +87,7 @@ extern struct fd *open_fd( struct fd *root, const char *name, struct unicode_str unsigned int sharing, unsigned int options ); extern struct fd *create_anonymous_fd( const struct fd_ops *fd_user_ops, int unix_fd, struct object *user, unsigned int options ); +extern void set_unix_name_of_fd( struct fd *fd, const struct stat *fd_st ); extern struct fd *dup_fd_object( struct fd *orig, unsigned int access, unsigned int sharing, unsigned int options ); extern struct fd *get_fd_object_for_mapping( struct fd *fd, unsigned int access, unsigned int sharing ); From c3ec8bace870de71a95ce04e55c0044f48abdbba Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 29 Nov 2022 16:40:42 -0600 Subject: [PATCH 0658/2542] ntdll: Improve faults logging. CW-Bug-Id: #21601 --- dlls/ntdll/exception.c | 14 ++++++++ dlls/ntdll/ntdll_misc.h | 6 ++++ dlls/ntdll/signal_arm64.c | 17 +++++++-- dlls/ntdll/signal_arm64ec.c | 16 +++++++-- dlls/ntdll/signal_x86_64.c | 22 ++++++++---- dlls/ntdll/unix/loader.c | 50 +++++++++++++++++++++++++++ dlls/ntdll/unix/signal_i386.c | 3 ++ dlls/ntdll/unix/signal_x86_64.c | 61 +++++++++++++++++++++++++++++++++ dlls/ntdll/unix/unix_private.h | 2 ++ dlls/ntdll/unixlib.h | 14 ++++++++ 10 files changed, 192 insertions(+), 13 deletions(-) diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index bf4a53e1b6e6..34590d2ef4e7 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -194,6 +194,20 @@ NTSTATUS WINAPI dispatch_exception( EXCEPTION_RECORD *rec, CONTEXT *context ) NTSTATUS status; DWORD i; + if (need_backtrace(rec->ExceptionCode)) + { + struct debugstr_pc_args params; + char buffer[256]; + + params.pc = rec->ExceptionAddress; + params.buffer = buffer; + params.size = sizeof(buffer); + if (!WINE_UNIX_CALL( unix_debugstr_pc, ¶ms )) + WINE_BACKTRACE_LOG( "--- Exception %#lx at %s.\n", rec->ExceptionCode, buffer ); + else + WINE_BACKTRACE_LOG( "--- Exception %#lx.\n", rec->ExceptionCode ); + } + switch (rec->ExceptionCode) { case EXCEPTION_WINE_STUB: diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 154c530ad065..6310fc8b6401 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -129,6 +129,12 @@ static inline void ascii_to_unicode( WCHAR *dst, const char *src, size_t len ) extern TEB_FLS_DATA *fls_alloc_data(void); extern void heap_thread_detach(void); +#define need_backtrace(exc_code) \ + WINE_BACKTRACE_LOG_ON() && exc_code != EXCEPTION_WINE_NAME_THREAD \ + && exc_code != DBG_PRINTEXCEPTION_WIDE_C && exc_code != DBG_PRINTEXCEPTION_C \ + && exc_code != EXCEPTION_WINE_CXX_EXCEPTION && exc_code != 0x6ba + + /* register context */ #ifdef __i386__ diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index c8eafc36211f..550d1a122c83 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -110,9 +110,11 @@ __ASM_GLOBAL_FUNC( RtlCaptureContext, /********************************************************************** * virtual_unwind */ -static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEXT *context ) +static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEXT *context, + BOOL dump_backtrace ) { DISPATCHER_CONTEXT_NONVOLREG_ARM64 *nonvol_regs; + LDR_DATA_TABLE_ENTRY *module = NULL; DWORD64 pc = context->Pc; int i; @@ -127,6 +129,15 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX dispatch->FunctionEntry = RtlLookupFunctionEntry( pc, &dispatch->ImageBase, dispatch->HistoryTable ); + if (dump_backtrace) + { + if (!LdrFindEntryForAddress( (void *)pc, &module )) + WINE_BACKTRACE_LOG( "%p: %s + %p.\n", (void *)pc, debugstr_w(module->BaseDllName.Buffer), + (void *)((char *)pc - (char *)module->DllBase) ); + else + WINE_BACKTRACE_LOG( "%p: unknown module.\n", (void *)pc ); + } + if (RtlVirtualUnwind2( type, dispatch->ImageBase, pc, dispatch->FunctionEntry, context, NULL, &dispatch->HandlerData, &dispatch->EstablisherFrame, NULL, NULL, NULL, &dispatch->LanguageHandler, 0 )) @@ -221,7 +232,7 @@ NTSTATUS call_seh_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_context ) for (;;) { - status = virtual_unwind( UNW_FLAG_EHANDLER, &dispatch, &context ); + status = virtual_unwind( UNW_FLAG_EHANDLER, &dispatch, &context, need_backtrace( rec->ExceptionCode ) ); if (status != STATUS_SUCCESS) return status; unwind_done: @@ -495,7 +506,7 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec for (;;) { - status = virtual_unwind( UNW_FLAG_UHANDLER, &dispatch, &new_context ); + status = virtual_unwind( UNW_FLAG_UHANDLER, &dispatch, &new_context, FALSE ); if (status != STATUS_SUCCESS) raise_status( status, rec ); unwind_done: diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index d64647f7b45a..ae6d07caae40 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -993,9 +993,10 @@ void WINAPI ProcessPendingCrossProcessEmulatorWork(void) * virtual_unwind */ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT_ARM64EC *dispatch, - ARM64EC_NT_CONTEXT *context ) + ARM64EC_NT_CONTEXT *context, BOOL dump_backtrace ) { DISPATCHER_CONTEXT_NONVOLREG_ARM64 *nonvol_regs; + LDR_DATA_TABLE_ENTRY *module = NULL; DWORD64 pc = context->Pc; int i; @@ -1020,6 +1021,15 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT_ARM64EC *dispatch dispatch->FunctionEntry = RtlLookupFunctionEntry( pc, &dispatch->ImageBase, dispatch->HistoryTable ); + if (dump_backtrace) + { + if (!LdrFindEntryForAddress( (void *)pc, &module )) + WINE_BACKTRACE_LOG( "%p: %s + %p.\n", (void *)pc, debugstr_w(module->BaseDllName.Buffer), + (void *)((char *)pc - (char *)module->DllBase) ); + else + WINE_BACKTRACE_LOG( "%p: unknown module.\n", (void *)pc ); + } + if (RtlVirtualUnwind2( type, dispatch->ImageBase, pc, dispatch->FunctionEntry, &context->AMD64_Context, NULL, &dispatch->HandlerData, &dispatch->EstablisherFrame, NULL, NULL, NULL, &dispatch->LanguageHandler, 0 )) @@ -1133,7 +1143,7 @@ NTSTATUS call_seh_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_context ) for (;;) { - status = virtual_unwind( UNW_FLAG_EHANDLER, &dispatch, &context ); + status = virtual_unwind( UNW_FLAG_EHANDLER, &dispatch, &context, need_backtrace( rec->ExceptionCode ) ); if (status != STATUS_SUCCESS) return status; unwind_done: @@ -1628,7 +1638,7 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec for (;;) { - status = virtual_unwind( UNW_FLAG_UHANDLER, &dispatch, &new_context ); + status = virtual_unwind( UNW_FLAG_UHANDLER, &dispatch, &new_context, FALSE ); if (status != STATUS_SUCCESS) raise_status( status, rec ); unwind_done: diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 7320aeabd49a..806f1b824bec 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -94,15 +94,23 @@ __ASM_GLOBAL_FUNC( "EXP+#KiUserExceptionDispatcher", WINE_DEFAULT_DEBUG_CHANNEL(seh); WINE_DECLARE_DEBUG_CHANNEL(relay); - /*********************************************************************** * virtual_unwind */ -static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEXT *context ) +static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEXT *context, BOOL dump_backtrace ) { - LDR_DATA_TABLE_ENTRY *module; + LDR_DATA_TABLE_ENTRY *module = NULL; NTSTATUS status; + if (dump_backtrace) + { + if (!LdrFindEntryForAddress( (void *)context->Rip, &module )) + WINE_BACKTRACE_LOG( "%p: %s + %p.\n", (void *)context->Rip, debugstr_w(module->BaseDllName.Buffer), + (void *)((char *)context->Rip - (char *)module->DllBase) ); + else + WINE_BACKTRACE_LOG( "%p: unknown module.\n", (void *)context->Rip ); + } + dispatch->ImageBase = 0; dispatch->ScopeIndex = 0; dispatch->ControlPc = context->Rip; @@ -110,8 +118,8 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX dispatch->HistoryTable ); /* look for host system exception information */ - if (!dispatch->FunctionEntry && - (LdrFindEntryForAddress( (void *)context->Rip, &module ) || (module->Flags & LDR_WINE_INTERNAL))) + if (!dispatch->FunctionEntry && ((!module && LdrFindEntryForAddress( (void *)context->Rip, &module )) + || module->Flags & LDR_WINE_INTERNAL)) { struct unwind_builtin_dll_params params = { type, dispatch, context }; @@ -223,7 +231,7 @@ NTSTATUS call_seh_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_context ) dispatch.HistoryTable = &table; for (;;) { - status = virtual_unwind( UNW_FLAG_EHANDLER, &dispatch, &context ); + status = virtual_unwind( UNW_FLAG_EHANDLER, &dispatch, &context, need_backtrace( rec->ExceptionCode ) ); if (status != STATUS_SUCCESS) return status; unwind_done: @@ -706,7 +714,7 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec for (;;) { - status = virtual_unwind( UNW_FLAG_UHANDLER, &dispatch, &new_context ); + status = virtual_unwind( UNW_FLAG_UHANDLER, &dispatch, &new_context, FALSE ); if (status != STATUS_SUCCESS) raise_status( status, rec ); unwind_done: diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index e9f6553ec78e..9b2d5d8219c5 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1196,6 +1196,42 @@ static NTSTATUS steamclient_setup_trampolines( void *args ) return STATUS_SUCCESS; } +static BOOL debugstr_pc_impl( void *pc, char *buffer, unsigned int size ) +{ + unsigned int len; + char *s = buffer; + Dl_info info; + + snprintf( s, size, "%p:", pc ); + if (!dladdr( pc, &info )) return FALSE; + + s += (len = strlen( s )); + size -= len; + snprintf( s, size, " %s + %#zx", info.dli_fname, (char *)pc - (char *)info.dli_fbase ); + if (info.dli_sname) + { + s += (len = strlen( s )); + size -= len; + snprintf( s, size, " (%s + %#zx)", info.dli_sname, (char *)pc - (char *)info.dli_saddr ); + } + return TRUE; +} + +static NTSTATUS debugstr_pc( void *args ) +{ + struct debugstr_pc_args *params = args; + + return debugstr_pc_impl( params->pc, params->buffer, params->size ) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; +} + +const char * wine_debuginfostr_pc( void *pc ) +{ + char buffer[256]; + + debugstr_pc_impl( pc, buffer, sizeof(buffer) ); + return __wine_dbg_strdup( buffer ); +} + static BOOL report_native_pc_as_ntdll; static NTSTATUS is_pc_in_native_so(void *pc) @@ -1223,6 +1259,7 @@ static const unixlib_entry_t unix_call_funcs[] = system_time_precise, steamclient_setup_trampolines, is_pc_in_native_so, + debugstr_pc, }; @@ -1244,6 +1281,18 @@ static NTSTATUS wow64_steamclient_setup_trampolines( void *args ) return steamclient_setup_trampolines( ¶ms ); } +static NTSTATUS wow64_debugstr_pc( void *args ) +{ + struct + { + ULONG pc; + ULONG buffer; + unsigned int size; + } const *params32 = args; + return debugstr_pc_impl( ULongToPtr( params32->pc ), ULongToPtr( params32->buffer ), params32->size ) + ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; +} + const unixlib_entry_t unix_call_wow64_funcs[] = { wow64_load_so_dll, @@ -1256,6 +1305,7 @@ const unixlib_entry_t unix_call_wow64_funcs[] = system_time_precise, wow64_steamclient_setup_trampolines, is_pc_in_native_so, + wow64_debugstr_pc, }; #endif /* _WIN64 */ diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 9c284bf06abe..fedff9657438 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -1858,6 +1858,9 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, void *stack_ptr, } else { + WINE_BACKTRACE_LOG( "--- Exception %#lx at %s.\n", rec->ExceptionCode, + wine_debuginfostr_pc( rec->ExceptionAddress )); + TRACE( "returning to user mode ip=%08x ret=%08lx\n", frame->eip, rec->ExceptionCode ); stack = (UINT *)frame; *(--stack) = rec->ExceptionCode; diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 5573e2c20375..d4dd342bf86e 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -597,6 +597,7 @@ static NTSTATUS dwarf_virtual_unwind( ULONG64 ip, ULONG64 *frame,CONTEXT *contex TRACE( "function %lx base %p cie %p len %x id %x version %x aug '%s' code_align %lu data_align %ld retaddr %s\n", ip, bases->func, cie, cie->length, cie->id, cie->version, cie->augmentation, info.code_align, info.data_align, dwarf_reg_names[info.retaddr_reg] ); + WINE_BACKTRACE_LOG( "%s.\n", wine_debuginfostr_pc((void *)context->Rip) ); end = NULL; for (augmentation = cie->augmentation; *augmentation; augmentation++) @@ -2147,6 +2148,47 @@ static inline BOOL handle_interrupt( ucontext_t *sigcontext, EXCEPTION_RECORD *r return TRUE; } +static void dump_syscall_fault( CONTEXT *context, DWORD exc_code ) +{ + struct syscall_frame *frame = amd64_thread_data()->syscall_frame; + struct unwind_builtin_dll_params params; + + __TRY + { + DISPATCHER_CONTEXT dispatch; + + context->ContextFlags &= ~0x40; + + dispatch.EstablisherFrame = context->Rsp; + dispatch.TargetIp = 0; + dispatch.ContextRecord = context; + dispatch.HistoryTable = NULL; + + params.type = UNW_FLAG_UHANDLER; + params.dispatch = &dispatch; + params.context = context; + + while (1) + { + if (context->Rip >= (ULONG_PTR)__wine_syscall_dispatcher + && context->Rip <= (ULONG_PTR)__wine_syscall_dispatcher_return) + { + WINE_BACKTRACE_LOG( "__wine_syscall_dispatcher.\n" ); + break; + } + if (unwind_builtin_dll( ¶ms )) + break; + } + } + __EXCEPT + { + WINE_BACKTRACE_LOG( "Fault during unwind.\n" ); + } + __ENDTRY + + WINE_BACKTRACE_LOG( "returning to user mode ip=%016lx ret=%08x\n", frame->rip, exc_code ); + __wine_syscall_dispatcher_return( frame, exc_code ); +} /*********************************************************************** * handle_syscall_fault @@ -2188,6 +2230,25 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, EXCEPTION_RECORD *rec, } else { + const char *kernel_stack = ntdll_get_thread_data()->kernel_stack; + char *stack = (char *)RSP_sig(sigcontext); + + WINE_BACKTRACE_LOG( "--- Exception %#x at %s.\n", rec->ExceptionCode, + wine_debuginfostr_pc( rec->ExceptionAddress )); + + if (!process_exiting && WINE_BACKTRACE_LOG_ON() && stack > kernel_stack + kernel_stack_guard_size + 4096) + { + stack = (char *)((ULONG_PTR)stack & ~(ULONG_PTR)15); + stack -= sizeof(*context); + RDI_sig(sigcontext) = (ULONG_PTR)stack; + RSI_sig(sigcontext) = rec->ExceptionCode; + memcpy( stack, context, sizeof(*context) ); + stack -= 0x28; + RIP_sig(sigcontext) = (ULONG_PTR)dump_syscall_fault; + RSP_sig(sigcontext) = (ULONG_PTR)stack; + return TRUE; + } + TRACE_(seh)( "returning to user mode ip=%016lx ret=%08x\n", frame->rip, rec->ExceptionCode ); RDI_sig(sigcontext) = (ULONG_PTR)frame; RSI_sig(sigcontext) = rec->ExceptionCode; diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index cea8d1394f4a..8b3a7bf08082 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -398,6 +398,8 @@ extern void call_raise_user_exception_dispatcher(void); #define IMAGE_DLLCHARACTERISTICS_PREFER_NATIVE 0x0010 /* Wine extension */ +extern const char * wine_debuginfostr_pc(void *pc); + #define TICKSPERSEC 10000000 #define SECS_1601_TO_1970 ((369 * 365 + 89) * (ULONGLONG)86400) diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h index 5430b8f0fe97..e0870584a689 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h @@ -72,6 +72,13 @@ struct steamclient_setup_trampolines_params HMODULE tgt_mod; }; +struct debugstr_pc_args +{ + void *pc; + char *buffer; + unsigned int size; +}; + enum ntdll_unix_funcs { unix_load_so_dll, @@ -84,8 +91,15 @@ enum ntdll_unix_funcs unix_system_time_precise, unix_steamclient_setup_trampolines, unix_is_pc_in_native_so, + unix_debugstr_pc, }; extern unixlib_handle_t __wine_unixlib_handle; +#define WINE_BACKTRACE_LOG_ON() WARN_ON(seh) + +#define WINE_BACKTRACE_LOG(args...) do { \ + WARN_(seh)("backtrace: " args); \ + } while (0) + #endif /* __NTDLL_UNIXLIB_H */ From d33482b001fc0eaf388814b138aee9f2684b7c17 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 2 Feb 2023 17:06:35 -0600 Subject: [PATCH 0659/2542] kernel32/tests: Add tests for known dlls load specifics. CW-Bug-Id: #21866 --- dlls/kernel32/tests/module.c | 90 ++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/dlls/kernel32/tests/module.c b/dlls/kernel32/tests/module.c index 0619ce5f7473..f23df1cf7b6d 100644 --- a/dlls/kernel32/tests/module.c +++ b/dlls/kernel32/tests/module.c @@ -1852,6 +1852,95 @@ static void test_hash_links(void) } } +#define check_dll_path(a, b) check_dll_path_( __LINE__, a, b ) +static void check_dll_path_( unsigned int line, HMODULE h, const char *expected ) +{ + char path[MAX_PATH]; + DWORD ret; + + *path = 0; + ret = GetModuleFileNameA( h, path, MAX_PATH); + ok_(__FILE__, line)( ret && ret < MAX_PATH, "Got %lu.\n", ret ); + ok_(__FILE__, line)( !stricmp( path, expected ), "Got %s.\n", debugstr_a(path) ); +} + +static void test_known_dlls_load(void) +{ + static const char apiset_dll[] = "ext-ms-win-base-psapi-l1-1-0.dll"; + char system_path[MAX_PATH], local_path[MAX_PATH]; + static const char dll[] = "psapi.dll"; + HMODULE hlocal, hsystem, hapiset, h; + BOOL ret; + + if (GetModuleHandleA( dll ) || GetModuleHandleA( apiset_dll )) + { + skip( "%s is already loaded, skipping test.\n", dll ); + return; + } + + hapiset = LoadLibraryA( apiset_dll ); + if (!hapiset) + { + win_skip( "%s is not available.\n", apiset_dll ); + return; + } + FreeLibrary( hapiset ); + + GetSystemDirectoryA( system_path, sizeof(system_path) ); + strcat( system_path, "\\" ); + strcat( system_path, dll ); + + GetCurrentDirectoryA( sizeof(local_path), local_path ); + strcat( local_path, "\\" ); + strcat( local_path, dll ); + + /* Known dll is always found in system dir, regardless of its presence in the application dir. */ + ret = pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_USER_DIRS ); + ok( ret, "SetDefaultDllDirectories failed err %lu\n", GetLastError() ); + h = LoadLibraryA( dll ); + ret = pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_DEFAULT_DIRS ); + ok( ret, "SetDefaultDllDirectories failed err %lu\n", GetLastError() ); + todo_wine ok( !!h, "Got NULL.\n" ); + hapiset = GetModuleHandleA( apiset_dll ); + ok( hapiset == h, "Got %p, %p.\n", hapiset, h ); + FreeLibrary( h ); + + h = LoadLibraryExA( dll, 0, LOAD_LIBRARY_SEARCH_APPLICATION_DIR ); + todo_wine ok( !!h, "Got NULL.\n" ); + hapiset = GetModuleHandleA( apiset_dll ); + ok( hapiset == h, "Got %p, %p.\n", hapiset, h ); + FreeLibrary( h ); + + /* Put dll to the current directory. */ + create_test_dll( dll ); + + h = LoadLibraryExA( dll, 0, LOAD_LIBRARY_SEARCH_APPLICATION_DIR ); + ok( !!h, "Got NULL.\n" ); + hapiset = GetModuleHandleA( apiset_dll ); + todo_wine ok( hapiset == h, "Got %p, %p.\n", hapiset, h ); + FreeLibrary( h ); + + /* Local version can still be loaded if dll name contains path. */ + hlocal = LoadLibraryA( local_path ); + ok( !!hlocal, "Got NULL.\n" ); + check_dll_path( hlocal, local_path ); + + /* dll without path will match the loaded one. */ + hsystem = LoadLibraryA( dll ); + ok( hsystem == hlocal, "Got %p, %p.\n", hsystem, hlocal ); + h = GetModuleHandleA( dll ); + ok( h == hlocal, "Got %p, %p.\n", h, hlocal ); + + /* apiset dll won't match the one loaded not from system dir. */ + hapiset = GetModuleHandleA( apiset_dll ); + ok( !hapiset, "Got %p.\n", hapiset ); + + FreeLibrary( hsystem ); + FreeLibrary( hlocal ); + + DeleteFileA( dll ); +} + START_TEST(module) { WCHAR filenameW[MAX_PATH]; @@ -1891,4 +1980,5 @@ START_TEST(module) test_tls_links(); test_base_address_index_tree(); test_hash_links(); + test_known_dlls_load(); } From 9e91ad7ac4dbd2a482a023f13e2dc7bdde0ea5f1 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 2 Feb 2023 14:48:37 -0600 Subject: [PATCH 0660/2542] ntdll: Factor out prepend_system_dir() function. CW-Bug-Id: #21866 --- dlls/ntdll/loader.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index eee21406e614..6bc979ec4f5c 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -3026,6 +3026,23 @@ static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname ) } +/****************************************************************************** + * prepend_system_dir + */ +static NTSTATUS prepend_system_dir( const WCHAR *name, ULONG name_length, WCHAR **fullname ) +{ + ULONG len; + + len = wcslen( system_dir ) + name_length; + if (!(*fullname = RtlAllocateHeap( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) + return STATUS_NO_MEMORY; + wcscpy( *fullname, system_dir ); + memcpy( *fullname + wcslen( system_dir ), name, name_length * sizeof(WCHAR) ); + (*fullname)[len] = 0; + + return STATUS_SUCCESS; +} + /****************************************************************************** * find_apiset_dll @@ -3035,18 +3052,11 @@ static NTSTATUS find_apiset_dll( const WCHAR *name, WCHAR **fullname ) const API_SET_NAMESPACE *map = NtCurrentTeb()->Peb->ApiSetMap; const API_SET_NAMESPACE_ENTRY *entry; UNICODE_STRING str; - ULONG len; if (get_apiset_entry( map, name, wcslen(name), &entry )) return STATUS_APISET_NOT_PRESENT; if (get_apiset_target( map, entry, NULL, &str )) return STATUS_DLL_NOT_FOUND; - len = wcslen( system_dir ) + str.Length / sizeof(WCHAR); - if (!(*fullname = RtlAllocateHeap( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) - return STATUS_NO_MEMORY; - wcscpy( *fullname, system_dir ); - memcpy( *fullname + wcslen( system_dir ), str.Buffer, str.Length ); - (*fullname)[len] = 0; - return STATUS_SUCCESS; + return prepend_system_dir( str.Buffer, str.Length / sizeof(WCHAR), fullname ); } From 88ade93c0569d9b564ebb60f559fe1027851eade Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 7 Feb 2023 10:16:36 -0600 Subject: [PATCH 0661/2542] loader/wine.inf: Add known dlls key. CW-Bug-Id: #21866 --- loader/wine.inf.in | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index ca1c8061e025..df4b85f1e45d 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -523,6 +523,51 @@ HKLM,%Control%\Session Manager\Environment,"windir",0x00020000,"%SystemRoot%" HKLM,%Control%\Session Manager\Environment,"winsysdir",,"%11%" HKLM,%Control%\Session Manager\Memory Management,PagingFiles,,"%24%\pagefile.sys 27 77" HKLM,%Control%\Session Manager\Memory Management,WriteWatch,0x00040002,1 +;;KnownDLLs +HKLM,%Control%\Session Manager\KnownDLLs,"_wow64cpu",,"wow64cpu.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"_wowarmhw",,"wowarmhw.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"_xtajit",,"_xtajit.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"advapi32",,"advapi32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"clbcatq",,"clbcatq.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"combase",,"combase.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"COMDLG32",,"COMDLG32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"coml2",,"coml2.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"DifxApi",,"difxapi.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"gdi32",,"gdi32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"gdiplus",,"gdiplus.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"IMAGEHLP",,"IMAGEHLP.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"IMM32",,"IMM32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"kernel32",,"kernel32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"MSCTF",,"MSCTF.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"MSVCRT",,"MSVCRT.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"NORMALIZ",,"NORMALIZ.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"NSI",,"NSI.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"ole32",,"ole32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"OLEAUT32",,"OLEAUT32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"PSAPI",,"PSAPI.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"rpcrt4",,"rpcrt4.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"sechost",,"sechost.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"Setupapi",,"Setupapi.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"SHCORE",,"SHCORE.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"SHELL32",,"SHELL32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"SHLWAPI",,"SHLWAPI.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"user32",,"user32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"wow64",,"wow64.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"wow64win",,"wow64win.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"WS2_32",,"WS2_32.dll" +;;KnownDLLs not present in registry on Windows but present in \\KnownDLLs directory +HKLM,%Control%\Session Manager\KnownDLLs,"ucrtbase",,"ucrtbase.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"msvcp_win",,"msvcp_win.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"bcrypt",,"bcrypt.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"COMCTL32",,"COMCTL32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"cfgmgr32",,"cfgmgr32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"ntdll",,"ntdll.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"bcryptPrimitives",,"bcryptPrimitives.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"win32u",,"win32u.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"gdi32full",,"gdi32full.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"WINTRUST",,"WINTRUST.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"CRYPT32",,"CRYPT32.dll" +HKLM,%Control%\Session Manager\KnownDLLs,"WLDAP32",,"WLDAP32.dll" [Fonts] HKLM,%FontSubStr%,"Arial Baltic,186",,"Arial,186" From f2ea8b760e7cdfa2d27dda7c4f55cbe3d9f84857 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 2 Feb 2023 17:14:54 -0600 Subject: [PATCH 0662/2542] ntdll: Load known dlls from system directory. CW-Bug-Id: #21866 --- dlls/kernel32/tests/module.c | 9 ++++-- dlls/ntdll/loader.c | 55 +++++++++++++++++++++++++++++++++++- 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/dlls/kernel32/tests/module.c b/dlls/kernel32/tests/module.c index f23df1cf7b6d..6e3b221d9282 100644 --- a/dlls/kernel32/tests/module.c +++ b/dlls/kernel32/tests/module.c @@ -1900,13 +1900,15 @@ static void test_known_dlls_load(void) h = LoadLibraryA( dll ); ret = pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_DEFAULT_DIRS ); ok( ret, "SetDefaultDllDirectories failed err %lu\n", GetLastError() ); - todo_wine ok( !!h, "Got NULL.\n" ); + ok( !!h, "Got NULL.\n" ); + check_dll_path( h, system_path ); hapiset = GetModuleHandleA( apiset_dll ); ok( hapiset == h, "Got %p, %p.\n", hapiset, h ); FreeLibrary( h ); h = LoadLibraryExA( dll, 0, LOAD_LIBRARY_SEARCH_APPLICATION_DIR ); - todo_wine ok( !!h, "Got NULL.\n" ); + ok( !!h, "Got NULL.\n" ); + check_dll_path( h, system_path ); hapiset = GetModuleHandleA( apiset_dll ); ok( hapiset == h, "Got %p, %p.\n", hapiset, h ); FreeLibrary( h ); @@ -1916,8 +1918,9 @@ static void test_known_dlls_load(void) h = LoadLibraryExA( dll, 0, LOAD_LIBRARY_SEARCH_APPLICATION_DIR ); ok( !!h, "Got NULL.\n" ); + check_dll_path( h, system_path ); hapiset = GetModuleHandleA( apiset_dll ); - todo_wine ok( hapiset == h, "Got %p, %p.\n", hapiset, h ); + ok( hapiset == h, "Got %p, %p.\n", hapiset, h ); FreeLibrary( h ); /* Local version can still be loaded if dll name contains path. */ diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 6bc979ec4f5c..915d97951a9a 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -34,6 +34,7 @@ #include "wine/exception.h" #include "wine/debug.h" #include "wine/list.h" +#include "wine/rbtree.h" #include "ntdll_misc.h" #include "ddk/ntddk.h" #include "ddk/wdm.h" @@ -189,6 +190,13 @@ static WINE_MODREF *last_failed_modref; static LDR_DDAG_NODE *node_ntdll, *node_kernel32; +struct known_dll +{ + struct rb_entry entry; + WCHAR name[1]; +}; +static struct rb_tree known_dlls; + static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, DWORD flags, WINE_MODREF** pwm, BOOL system ); static NTSTATUS process_attach( LDR_DDAG_NODE *node, LPVOID lpReserved ); static FARPROC find_ordinal_export( HMODULE module, const IMAGE_EXPORT_DIRECTORY *exports, @@ -3245,6 +3253,7 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, UNI WINE_MODREF **pwm, HANDLE *mapping, SECTION_IMAGE_INFORMATION *image_info, struct file_id *id, BOOL find_loaded ) { + const WCHAR *known_dll_name = NULL; WCHAR *fullname = NULL; NTSTATUS status; ULONG wow64_old_value = 0; @@ -3283,6 +3292,12 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, UNI goto done; } } + if (!fullname && rb_get( &known_dlls, libname )) + { + prepend_system_dir( libname, wcslen(libname), &fullname ); + known_dll_name = libname; + libname = fullname; + } } if (RtlDetermineDosPathNameType_U( libname ) == RELATIVE_PATH) @@ -3292,7 +3307,11 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, UNI status = find_builtin_without_file( libname, nt_name, pwm, mapping, image_info, id ); } else if (!(status = RtlDosPathNameToNtPathName_U_WithStatus( libname, nt_name, NULL, NULL ))) + { status = open_dll_file( nt_name, pwm, mapping, image_info, id ); + if (status == STATUS_DLL_NOT_FOUND && known_dll_name) + status = find_builtin_without_file( known_dll_name, nt_name, pwm, mapping, image_info, id ); + } if (status == STATUS_NOT_SUPPORTED) status = STATUS_INVALID_IMAGE_FORMAT; @@ -4171,16 +4190,31 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule) return ret; } +/************************************************************************* + * compare_known_dlls + */ +static int compare_known_dlls( const void *name, const struct wine_rb_entry *entry ) +{ + struct known_dll *known_dll = WINE_RB_ENTRY_VALUE( entry, struct known_dll, entry ); + + return wcsicmp( name, known_dll->name ); +} + /*********************************************************************** * load_global_options */ static void load_global_options(void) { + char buffer[256]; + KEY_VALUE_PARTIAL_INFORMATION *info = (KEY_VALUE_PARTIAL_INFORMATION *)buffer; OBJECT_ATTRIBUTES attr; UNICODE_STRING bootstrap_mode_str = RTL_CONSTANT_STRING( L"WINEBOOTSTRAPMODE" ); UNICODE_STRING session_manager_str = RTL_CONSTANT_STRING( L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Session Manager" ); - UNICODE_STRING val_str; + UNICODE_STRING val_str, name_str; + struct known_dll *known_dll; + ULONG idx = 0, size; + NTSTATUS status; HANDLE hkey; val_str.MaximumLength = 0; @@ -4200,6 +4234,25 @@ static void load_global_options(void) query_dword_option( hkey, L"SafeDllSearchMode", &dll_safe_mode ); NtClose( hkey ); } + + rb_init( &known_dlls, compare_known_dlls ); + + RtlInitUnicodeString( &name_str, + L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Session Manager\\KnownDLLs" ); + if (NtOpenKey( &hkey, KEY_QUERY_VALUE, &attr )) return; + while (1) + { + status = NtEnumerateValueKey( hkey, idx++, KeyValuePartialInformation, buffer, sizeof(buffer), &size ); + if (status == STATUS_BUFFER_OVERFLOW) continue; + if (status) break; + if (info->Type != REG_SZ) continue; + + known_dll = RtlAllocateHeap( GetProcessHeap(), 0, offsetof(struct known_dll, name[0]) + info->DataLength ); + if (!known_dll) break; + memcpy( known_dll->name, info->Data, info->DataLength ); + rb_put( &known_dlls, known_dll->name, &known_dll->entry ); + } + NtClose( hkey ); } static BOOL needs_elevation(void) From 8fd4fb95ac1096928294ad6e6a1a2a292e7679d5 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 20 Mar 2023 10:03:16 -0600 Subject: [PATCH 0663/2542] ntdll: HACK: Search for ucrtbase using common rules. CW-Bug-Id: #22048 --- dlls/ntdll/loader.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 915d97951a9a..0951a74dd17e 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -3039,8 +3039,18 @@ static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname ) */ static NTSTATUS prepend_system_dir( const WCHAR *name, ULONG name_length, WCHAR **fullname ) { + static const WCHAR ucrtbase[] = L"ucrtbase.dll"; ULONG len; + if (name_length == sizeof(ucrtbase) / sizeof(*ucrtbase) - 1 && !_wcsnicmp( name, ucrtbase, name_length )) + { + if (!(*fullname = RtlAllocateHeap( GetProcessHeap(), 0, (name_length + 1) * sizeof(WCHAR) ))) + return STATUS_NO_MEMORY; + memcpy( *fullname, name, name_length * sizeof(WCHAR) ); + (*fullname)[name_length] = 0; + return STATUS_SUCCESS; + } + len = wcslen( system_dir ) + name_length; if (!(*fullname = RtlAllocateHeap( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) return STATUS_NO_MEMORY; From 9256e9ce051ffd346c1461bdadfef549a6af8c89 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 7 Apr 2023 19:59:49 -0600 Subject: [PATCH 0664/2542] wined3d: Set window state from the calling thread. This effectively reverts commit 1765c4594f6a11fe0df1aed7261cfafdb7514c43. CW-Bug-Id: #22121 --- dlls/wined3d/swapchain.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 6b2ad8d6954c..6f01d520add9 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -2190,7 +2190,6 @@ static void set_window_state(struct wined3d_window_state *s) static const UINT timeout = 1500; DWORD window_tid = GetWindowThreadProcessId(s->window, NULL); DWORD tid = GetCurrentThreadId(); - HANDLE thread; TRACE("Window %p belongs to thread %#lx.\n", s->window, window_tid); /* If the window belongs to a different thread, modifying the style and/or @@ -2208,18 +2207,8 @@ static void set_window_state(struct wined3d_window_state *s) else KillTimer(s->window, WINED3D_WINDOW_TOPMOST_TIMER_ID); } - - set_window_state_thread(s); - } - else if ((thread = CreateThread(NULL, 0, set_window_state_thread, s, 0, NULL))) - { - SetThreadDescription(thread, L"wined3d_set_window_state"); - CloseHandle(thread); - } - else - { - ERR("Failed to create thread.\n"); } + set_window_state_thread(s); } HRESULT wined3d_swapchain_state_setup_fullscreen(struct wined3d_swapchain_state *state, From d94eff7ed3a829330d61d5bc2c30b0a65ca46120 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 27 Mar 2023 10:44:52 -0600 Subject: [PATCH 0665/2542] kernelbase: HACK: Force swiftshader for Olympia Rising. CW-Bug-Id: #22076 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 25283d3d7c51..855147ffb2c2 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -596,6 +596,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) {L"Montaro\\nw.exe", L" --use-gl=swiftshader"}, {L"\\EOSOverlayRenderer-Win64-Shipping.exe", L" --use-gl=swiftshader --in-process-gpu"}, {L"\\EpicOnlineServicesUIHelper", L" --use-gl=desktop"}, + {L"OlympiaRising.exe", L" --use-gl=swiftshader"}, }; unsigned int i; From 9042293f664074652e14dce770f45a50449b6bf8 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 27 Mar 2023 21:18:36 -0600 Subject: [PATCH 0666/2542] wined3d: Rename Deck GPU in description table. CW-Bug-Id: #22080 --- dlls/wined3d/directx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index f236a59f9632..175fa8d688d9 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -547,7 +547,7 @@ static const struct wined3d_gpu_description gpu_description_table[] = {HW_VENDOR_AMD, CARD_AMD_RADEON_RX_NAVI_21, "Radeon RX 6800/6800 XT / 6900 XT", DRIVER_AMD_RX, 16384}, {HW_VENDOR_AMD, CARD_AMD_RADEON_PRO_V620, "Radeon Pro V620", DRIVER_AMD_RX, 32768}, {HW_VENDOR_AMD, CARD_AMD_RADEON_PRO_V620_VF, "Radeon Pro V620 VF", DRIVER_AMD_RX, 32768}, - {HW_VENDOR_AMD, CARD_AMD_VANGOGH, "AMD VANGOGH", DRIVER_AMD_RX, 4096}, + {HW_VENDOR_AMD, CARD_AMD_VANGOGH, "AMD Radeon VANGOGH", DRIVER_AMD_RX, 4096}, {HW_VENDOR_AMD, CARD_AMD_RAPHAEL, "AMD Radeon(TM) Graphics", DRIVER_AMD_RX, 4096}, /* Red Hat */ From 80f640d46f9f5370c24dd672efa0d5ec0ea74477 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 14 Mar 2023 21:12:22 -0600 Subject: [PATCH 0667/2542] ntdll: HACK: Add WINE_SIMULATE_WRITECOPY option. CW-Bug-Id: #22034 --- dlls/ntdll/unix/loader.c | 5 +++++ dlls/ntdll/unix/unix_private.h | 1 + dlls/ntdll/unix/virtual.c | 13 +++++++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 9b2d5d8219c5..3e75ec406720 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2124,6 +2124,7 @@ BOOL fsync_simulate_sched_quantum; BOOL alert_simulate_sched_quantum; BOOL fsync_yield_to_waiters; BOOL localsystem_sid; +BOOL simulate_writecopy; static void hacks_init(void) { @@ -2183,6 +2184,10 @@ static void hacks_init(void) if (env_str) report_native_pc_as_ntdll = atoi(env_str); else if (sgi) report_native_pc_as_ntdll = !strcmp(sgi, "700330"); + env_str = getenv("WINE_SIMULATE_WRITECOPY"); + if (env_str) simulate_writecopy = atoi(env_str); + else if (sgi) simulate_writecopy = !strcmp(sgi, "1608730"); + if (main_argc > 1 && strstr(main_argv[1], "MicrosoftEdgeUpdate.exe")) { ERR("HACK: reporting LocalSystem account SID.\n"); diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 8b3a7bf08082..54194b9b360e 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -195,6 +195,7 @@ extern BOOL fsync_simulate_sched_quantum; extern BOOL alert_simulate_sched_quantum; extern BOOL fsync_yield_to_waiters; extern BOOL localsystem_sid; +extern BOOL simulate_writecopy; extern void init_environment(void); extern void init_startup_info(void); diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 2c5124e55ecf..dbb672b1a489 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -5456,10 +5456,19 @@ NTSTATUS WINAPI NtProtectVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T old = get_win32_prot( vprot, view->protect ); status = set_protection( view, base, size, new_prot ); - /* GTA5 HACK: Mark first page as copied. */ - if (status == STATUS_SUCCESS && (view->protect & SEC_IMAGE) && + if (simulate_writecopy && status == STATUS_SUCCESS + && ((old == PAGE_WRITECOPY || old == PAGE_EXECUTE_WRITECOPY))) + { + TRACE("Setting VPROT_COPIED.\n"); + + set_page_vprot_bits(base, size, VPROT_COPIED, 0); + vprot |= VPROT_COPIED; + old = get_win32_prot( vprot, view->protect ); + } + else if (status == STATUS_SUCCESS && (view->protect & SEC_IMAGE) && base == (void*)NtCurrentTeb()->Peb->ImageBaseAddress) { + /* GTA5 HACK: Mark first page as copied. */ const WCHAR gta5W[] = { 'g','t','a','5','.','e','x','e',0 }; WCHAR *name, *p; From 9223b54575b3814d853503cf58e44dade5d0e355 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 24 Mar 2023 18:12:29 -0600 Subject: [PATCH 0668/2542] ntdll: HACK: Enable WINE_SIMULATE_WRITECOPY for Purgo box. CW-Bug-Id: #22034 --- dlls/ntdll/unix/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 3e75ec406720..8f4a17aeea54 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2186,7 +2186,7 @@ static void hacks_init(void) env_str = getenv("WINE_SIMULATE_WRITECOPY"); if (env_str) simulate_writecopy = atoi(env_str); - else if (sgi) simulate_writecopy = !strcmp(sgi, "1608730"); + else if (sgi) simulate_writecopy = !strcmp(sgi, "1608730") || !strcmp(sgi, "1680700"); if (main_argc > 1 && strstr(main_argv[1], "MicrosoftEdgeUpdate.exe")) { From 0cf4c5d0d6156057c326f2bb170d6a8c0b50516e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 20 Mar 2023 17:48:40 -0600 Subject: [PATCH 0669/2542] kernelbase: HACK: Add --use-angle=d3d9 command line option for nw.exe.exe. CW-Bug-Id: #22042 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 855147ffb2c2..bad7a164b84e 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -597,6 +597,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) {L"\\EOSOverlayRenderer-Win64-Shipping.exe", L" --use-gl=swiftshader --in-process-gpu"}, {L"\\EpicOnlineServicesUIHelper", L" --use-gl=desktop"}, {L"OlympiaRising.exe", L" --use-gl=swiftshader"}, + {L"nw.exe.exe", L" --use-angle=d3d9"}, }; unsigned int i; From a7bbfbd0b28b053da5b793cfd40ed1cce4eb99b1 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 22 Mar 2023 14:31:03 -0600 Subject: [PATCH 0670/2542] crypt32: Add WINE_ADDITIONAL_CERTS_DIR option. CW-Bug-Id: #22063 --- dlls/crypt32/unixlib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/crypt32/unixlib.c b/dlls/crypt32/unixlib.c index 5a255442fdff..5e65302ac9a1 100644 --- a/dlls/crypt32/unixlib.c +++ b/dlls/crypt32/unixlib.c @@ -625,6 +625,7 @@ static const char * const CRYPT_knownLocations[] = { static void load_root_certs(void) { + const char *additional_dir; unsigned int i; #ifdef __APPLE__ @@ -662,6 +663,9 @@ static void load_root_certs(void) for (i = 0; i < ARRAY_SIZE(CRYPT_knownLocations) && list_empty(&root_cert_list); i++) import_certs_from_path( CRYPT_knownLocations[i], TRUE ); + + if ((additional_dir = getenv( "WINE_ADDITIONAL_CERTS_DIR" ))) + import_certs_from_path( additional_dir, TRUE ); } static NTSTATUS enum_root_certs( void *args ) From 88604b5e6434462acf79208e54abc108759cc82e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 11 Apr 2023 14:04:18 -0600 Subject: [PATCH 0671/2542] ntdll: HACK: Enable WINE_SIMULATE_WRITECOPY for Breakout 13. CW-Bug-Id: #22130 --- dlls/ntdll/unix/loader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 8f4a17aeea54..90e2d87e84d5 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2186,7 +2186,8 @@ static void hacks_init(void) env_str = getenv("WINE_SIMULATE_WRITECOPY"); if (env_str) simulate_writecopy = atoi(env_str); - else if (sgi) simulate_writecopy = !strcmp(sgi, "1608730") || !strcmp(sgi, "1680700"); + else if (sgi) simulate_writecopy = !strcmp(sgi, "1608730") || !strcmp(sgi, "1680700") + || !strcmp(sgi, "2095300"); if (main_argc > 1 && strstr(main_argv[1], "MicrosoftEdgeUpdate.exe")) { From 0fd2baf193ec8d92394834161477a175fb467356 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Tue, 11 Apr 2023 16:34:16 +0800 Subject: [PATCH 0672/2542] HACK: ntdll: Enable WINE_SIMULATE_WRITECOPY for Mr. Hopp's Playhouse 3. CW-Bug-Id: #22127 --- dlls/ntdll/unix/loader.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 90e2d87e84d5..8194ad64d00c 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2186,8 +2186,10 @@ static void hacks_init(void) env_str = getenv("WINE_SIMULATE_WRITECOPY"); if (env_str) simulate_writecopy = atoi(env_str); - else if (sgi) simulate_writecopy = !strcmp(sgi, "1608730") || !strcmp(sgi, "1680700") - || !strcmp(sgi, "2095300"); + else if (sgi) simulate_writecopy = !strcmp(sgi, "1608730") /* Dawn of Corruption */ + || !strcmp(sgi, "1680700") /* Purgo box */ + || !strcmp(sgi, "2095300") /* Breakout 13 */ + || !strcmp(sgi, "2176450"); /* Mr. Hopp's Playhouse 3 */ if (main_argc > 1 && strstr(main_argv[1], "MicrosoftEdgeUpdate.exe")) { From 3a090968a7e7e7d2290797e9fd672a9c41a24981 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 10 Apr 2023 20:27:49 -0600 Subject: [PATCH 0673/2542] setupapi: Don't use NULL as key value in get_device_property(). CW-Bug-Id: #22126 --- dlls/setupapi/devinst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index d369537e5099..0ad66db4a2dc 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -4577,7 +4577,7 @@ static LSTATUS get_device_property(struct device *device, const DEVPROPKEY *prop if (!ls) { value_size = prop_buff_size; - ls = RegQueryValueExW(hkey, NULL, NULL, &value_type, prop_buff, &value_size); + ls = RegQueryValueExW(hkey, L"", NULL, &value_type, prop_buff, &value_size); RegCloseKey(hkey); } From e67f40fcb27cb6bf04d0dbaa356ef8df70ef5407 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 10 Apr 2023 20:28:51 -0600 Subject: [PATCH 0674/2542] combase: Don't use NULL as key value in get_object_dll_path(). CW-Bug-Id: #22126 --- dlls/combase/apartment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/combase/apartment.c b/dlls/combase/apartment.c index 85e06a6fd57f..ce1fc72ba1a0 100644 --- a/dlls/combase/apartment.c +++ b/dlls/combase/apartment.c @@ -719,7 +719,7 @@ static BOOL get_object_dll_path(const struct class_reg_data *regdata, WCHAR *dst WCHAR src[MAX_PATH]; DWORD dwLength = dstlen * sizeof(WCHAR); - if ((ret = RegQueryValueExW(regdata->u.hkey, NULL, NULL, &keytype, (BYTE*)src, &dwLength)) == ERROR_SUCCESS) + if ((ret = RegQueryValueExW(regdata->u.hkey, L"", NULL, &keytype, (BYTE*)src, &dwLength)) == ERROR_SUCCESS) { if (keytype == REG_EXPAND_SZ) { From b192425c699bc75372249bf05b6a2d8f9f1ca280 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 10 Apr 2023 20:30:22 -0600 Subject: [PATCH 0675/2542] shell32: Don't use NULL as key value in ShellExecute_GetClassKey(). CW-Bug-Id: #22126 --- dlls/shell32/shlexec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index 631601ad21a6..a76887cbdaca 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -1196,13 +1196,13 @@ static HKEY ShellExecute_GetClassKey( const SHELLEXECUTEINFOW *sei ) if (r != ERROR_SUCCESS ) return hkey; - r = RegQueryValueExW( hkey, NULL, 0, &type, NULL, &sz ); + r = RegQueryValueExW( hkey, L"", 0, &type, NULL, &sz ); if ( r == ERROR_SUCCESS && type == REG_SZ ) { sz += sizeof (WCHAR); cls = malloc( sz ); cls[0] = 0; - RegQueryValueExW( hkey, NULL, 0, &type, (LPBYTE) cls, &sz ); + RegQueryValueExW( hkey, L"", 0, &type, (LPBYTE) cls, &sz ); } RegCloseKey( hkey ); From c4bfe9c9d7aa6a06fc390634a5ea6fbd9fa2d6a8 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 10 Apr 2023 21:07:10 -0600 Subject: [PATCH 0676/2542] ntdll: Add PROTON_DISABLE_LSTEAMCLIENT config option. CW-Bug-Id: #22126 --- dlls/ntdll/loader.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 0951a74dd17e..a07c48098736 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2218,6 +2218,18 @@ static NTSTATUS perform_relocations( void *module, IMAGE_NT_HEADERS *nt, SIZE_T return STATUS_SUCCESS; } +static int use_lsteamclient(void) +{ + WCHAR env[32]; + static int use = -1; + + if (use != -1) return use; + + use = !get_env( L"PROTON_DISABLE_LSTEAMCLIENT", env, sizeof(env) ) || *env == '0'; + if (!use) + ERR("lsteamclient disabled.\n"); + return use; +} /************************************************************************* * build_module @@ -2265,7 +2277,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name, basename_len = wcslen(basename); if (basename_len >= 4 && !wcscmp(basename + basename_len - 4, L".dll")) basename_len -= 4; - if ((!RtlCompareUnicodeStrings(basename, basename_len, L"steamclient", 11, TRUE) || + if (use_lsteamclient() && (!RtlCompareUnicodeStrings(basename, basename_len, L"steamclient", 11, TRUE) || !RtlCompareUnicodeStrings(basename, basename_len, L"steamclient64", 13, TRUE) || !RtlCompareUnicodeStrings(basename, basename_len, L"gameoverlayrenderer", 19, TRUE) || !RtlCompareUnicodeStrings(basename, basename_len, L"gameoverlayrenderer64", 21, TRUE)) && From 20c4dd9364f9d0ded5fcba06dc02da17bccf1694 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 7 Mar 2023 09:01:39 -0600 Subject: [PATCH 0677/2542] kernelbase: HACK: Force Angle GL instead of Swiftshader for Paradox Launcher. CW-Bug-Id: #21997 --- dlls/kernelbase/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index bad7a164b84e..cca4dde8d415 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -592,7 +592,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) options[] = { {L"UplayWebCore.exe", L" --use-gl=swiftshader"}, - {L"Paradox Launcher.exe", L" --use-gl=swiftshader --in-process-gpu"}, + {L"Paradox Launcher.exe", L" --use-angle=gl"}, {L"Montaro\\nw.exe", L" --use-gl=swiftshader"}, {L"\\EOSOverlayRenderer-Win64-Shipping.exe", L" --use-gl=swiftshader --in-process-gpu"}, {L"\\EpicOnlineServicesUIHelper", L" --use-gl=desktop"}, From d99b90517a93def0455e531c63f844d1b9c87e60 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 5 Apr 2023 11:31:10 -0600 Subject: [PATCH 0678/2542] kernelbase: HACK: Add --use-gl=swiftshader for DC Universe Online/LaunchPad.exe. CW-Bug-Id: #22083 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index cca4dde8d415..cdf532ed023d 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -598,6 +598,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) {L"\\EpicOnlineServicesUIHelper", L" --use-gl=desktop"}, {L"OlympiaRising.exe", L" --use-gl=swiftshader"}, {L"nw.exe.exe", L" --use-angle=d3d9"}, + {L"DC Universe Online\\LaunchPad.exe", L" --use-gl=swiftshader"}, }; unsigned int i; From bc243ef798af2c21613a45f9bbbf4ae4515a71c5 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 5 Apr 2023 11:33:40 -0600 Subject: [PATCH 0679/2542] kernelbase: HACK: Add --use-gl=swiftshader for Planetside 2/LaunchPad.exe. CW-Bug-Id: #22083 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index cdf532ed023d..d72a9039f45c 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -599,6 +599,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) {L"OlympiaRising.exe", L" --use-gl=swiftshader"}, {L"nw.exe.exe", L" --use-angle=d3d9"}, {L"DC Universe Online\\LaunchPad.exe", L" --use-gl=swiftshader"}, + {L"PlanetSide 2\\LaunchPad.exe", L" --use-gl=swiftshader"}, }; unsigned int i; From 68825f7ce7c272213842c5e89ab05e2e7d6b6d57 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 28 Apr 2023 14:44:16 -0600 Subject: [PATCH 0680/2542] ntdll: HACK: Abort process on syscall fault when terminating. CW-Bug-Id: #22206 --- dlls/ntdll/unix/process.c | 12 ++++++++++++ dlls/ntdll/unix/signal_x86_64.c | 6 ++++++ dlls/ntdll/unix/unix_private.h | 2 ++ 3 files changed, 20 insertions(+) diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c index c3a730379a41..30fdbccf99fe 100644 --- a/dlls/ntdll/unix/process.c +++ b/dlls/ntdll/unix/process.c @@ -987,6 +987,8 @@ NTSTATUS WINAPI NtCreateUserProcess( HANDLE *process_handle_ptr, HANDLE *thread_ return status; } +BOOL terminate_process_running; +LONG terminate_process_exit_code; /****************************************************************************** * NtTerminateProcess (NTDLL.@) @@ -996,6 +998,14 @@ NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code ) unsigned int ret; BOOL self; + TRACE("handle %p, exit_code %d, process_exiting %d.\n", handle, (int)exit_code, process_exiting); + + if (handle == GetCurrentProcess()) + { + terminate_process_running = TRUE; + terminate_process_exit_code = exit_code; + } + SERVER_START_REQ( terminate_process ) { req->handle = wine_server_obj_handle( handle ); @@ -1004,6 +1014,8 @@ NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code ) self = reply->self; } SERVER_END_REQ; + + TRACE("handle %p, self %d, process_exiting %d.\n", handle, self, process_exiting); if (self) { if (!handle) process_exiting = TRUE; diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index d4dd342bf86e..aae2b3007bda 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -2216,6 +2216,12 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, EXCEPTION_RECORD *rec, TRACE_(seh)( " r12=%016lx r13=%016lx r14=%016lx r15=%016lx\n", context->R12, context->R13, context->R14, context->R15 ); + if (terminate_process_running) + { + FIXME_(seh)( "Process is terminating, aborting.\n" ); + abort_process( terminate_process_exit_code ); + } + if (rec->ExceptionCode == STATUS_ACCESS_VIOLATION && is_inside_syscall_stack_guard( (char *)rec->ExceptionInformation[1] )) ERR_(seh)( "Syscall stack overrun.\n "); diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 54194b9b360e..1287be0744b4 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -181,6 +181,8 @@ extern const WCHAR system_dir[]; extern unsigned int supported_machines_count; extern USHORT supported_machines[8]; extern BOOL process_exiting; +extern BOOL terminate_process_running; +extern LONG terminate_process_exit_code; extern HANDLE keyed_event; extern timeout_t server_start_time; extern sigset_t server_block_set; From f4629dc339010a21a3d89aecdb00076c048a02ec Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 1 May 2023 21:19:09 -0600 Subject: [PATCH 0681/2542] ntdll: HACK: Set thread teb earlier in start_main_thread(). CW-Bug-Id: #22218 --- dlls/ntdll/unix/loader.c | 5 +++++ dlls/ntdll/unix/signal_i386.c | 6 ++++++ dlls/ntdll/unix/signal_x86_64.c | 4 ++++ dlls/ntdll/unix/unix_private.h | 1 + 4 files changed, 16 insertions(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 8194ad64d00c..a8064f8ff892 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2238,6 +2238,11 @@ static void start_main_thread(void) virtual_map_user_shared_data(); init_cpu_info(); init_files(); + +#if defined(__x86_64__) || defined(__i386__) + set_thread_teb( teb ); +#endif + init_startup_info(); *(ULONG_PTR *)&peb->CloudFileFlags = get_image_address(); set_load_order_app_name( main_wargv[0] ); diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index fedff9657438..33958f76ee92 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -2415,6 +2415,12 @@ void signal_init_threading(void) #endif } +void set_thread_teb( TEB *teb ) +{ + struct x86_thread_data *thread_data = (struct x86_thread_data *)&teb->GdiTebBatch; + + ldt_set_fs( thread_data->fs, teb ); +} /********************************************************************** * signal_alloc_thread diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index aae2b3007bda..b749e147c1b8 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -2923,6 +2923,10 @@ void signal_init_process(void) exit(1); } +void set_thread_teb( TEB *teb ) +{ + arch_prctl( ARCH_SET_GS, teb ); +} /*********************************************************************** * call_init_thunk diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 1287be0744b4..cfc49914c345 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -327,6 +327,7 @@ extern BOOL get_thread_times( int unix_pid, int unix_tid, LARGE_INTEGER *kernel_ LARGE_INTEGER *user_time ); extern void signal_init_threading(void); extern NTSTATUS signal_alloc_thread( TEB *teb ); +extern void set_thread_teb( TEB *teb ); extern void signal_free_thread( TEB *teb ); extern void signal_init_process(void); extern void DECLSPEC_NORETURN signal_start_thread( PRTL_THREAD_START_ROUTINE entry, void *arg, From 8408147a2c63a9c609f17ef69ef18dc3a73c2af4 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 10 Dec 2024 18:16:08 -0600 Subject: [PATCH 0682/2542] ntdll: HACK: Add __wine_unix_call() back for compatibility. CW-Bug-Id: #24568 --- dlls/ntdll/loader.c | 9 +++++++++ dlls/ntdll/ntdll.spec | 1 + 2 files changed, 10 insertions(+) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index a07c48098736..6de3f07e939a 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -3441,6 +3441,15 @@ NTSTATUS WINAPI __wine_ctrl_routine( void *arg ) } +/*********************************************************************** + * __wine_unix_call + */ +NTSTATUS WINAPI compat___wine_unix_call( unixlib_handle_t handle, unsigned int code, void *args ) +{ + return __wine_unix_call( handle, code, args ); +} + + /*********************************************************************** * __wine_unix_spawnvp */ diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index b3d93326d8c3..60a6c511108d 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1738,6 +1738,7 @@ @ cdecl wine_server_handle_to_fd(long long ptr ptr) # Unix interface +@ stdcall __wine_unix_call(int64 long ptr) compat___wine_unix_call @ stdcall __wine_unix_spawnvp(long ptr) @ stdcall __wine_ctrl_routine(ptr) @ extern -private __wine_syscall_dispatcher From fd9488da3bdc71e4bc7f2dce6091f0066f622461 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 3 May 2023 17:23:40 -0600 Subject: [PATCH 0683/2542] ntdll: Do not inherit Unix std handles for files without a name. CW-Bug-Id: #22237 --- dlls/ntdll/unix/env.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index a6e736ef8667..da9cf169a788 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -1402,6 +1402,27 @@ static void add_registry_environment( WCHAR **env, SIZE_T *pos, SIZE_T *size ) } } +static void get_std_handle( int fd, unsigned int access, unsigned int attributes, HANDLE *handle ) +{ + IO_STATUS_BLOCK io; + FILE_POSITION_INFORMATION pos_info; + FILE_NAME_INFORMATION name_info; + NTSTATUS status; + + wine_server_fd_to_handle( fd, access, attributes, handle ); + if (!*handle) return; + + /* Python checks if a file is seekable and if so expects the file name to be gettable from handle. */ + if (NtQueryInformationFile( *handle, &io, &pos_info, sizeof(pos_info), FilePositionInformation )) + return; + + TRACE("handle for fd %d is seekable.\n", fd); + if (!(status = NtQueryInformationFile( *handle, &io, &name_info, sizeof(name_info), FileNameInformation )) + || status == STATUS_BUFFER_OVERFLOW) return; + TRACE("closing handle for fd %d.\n", fd); + NtClose( *handle ); + *handle = NULL; +} /************************************************************************* * get_initial_console @@ -1412,9 +1433,9 @@ static void get_initial_console( RTL_USER_PROCESS_PARAMETERS *params ) { int output_fd = -1; - wine_server_fd_to_handle( 0, GENERIC_READ|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdInput ); - wine_server_fd_to_handle( 1, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdOutput ); - wine_server_fd_to_handle( 2, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdError ); + get_std_handle( 0, GENERIC_READ|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdInput ); + get_std_handle( 1, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdOutput ); + get_std_handle( 2, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdError ); if (main_image_info.SubSystemType != IMAGE_SUBSYSTEM_WINDOWS_CUI) return; From d6b2c52b48043cf41e76d944c96fec5e312f244a Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 12 May 2023 19:22:44 -0600 Subject: [PATCH 0684/2542] ntdll: Add WINE_KERNEL_STACK_SIZE option. CW-Bug-Id: #22247 --- dlls/ntdll/unix/loader.c | 8 ++++++++ dlls/ntdll/unix/unix_private.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index a8064f8ff892..1cf3086c0651 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2125,6 +2125,7 @@ BOOL alert_simulate_sched_quantum; BOOL fsync_yield_to_waiters; BOOL localsystem_sid; BOOL simulate_writecopy; +SIZE_T kernel_stack_size = 0x100000; static void hacks_init(void) { @@ -2198,6 +2199,13 @@ static void hacks_init(void) return; } + if ((env_str = getenv( "WINE_KERNEL_STACK_SIZE" ))) + kernel_stack_size = atoll( env_str ) * 1024; + else if (sgi && !strcmp( sgi, "702700" )) + kernel_stack_size = 200 * 1024; + if (kernel_stack_size != 0x100000) + ERR( "HACK: setting kernel_stack_size to %luKB.\n", (long)(kernel_stack_size / 1024) ); + if (sgi && (0 || !strcmp(sgi, "1364780") || !strcmp(sgi, "1952120") || !strcmp(sgi, "2154900") /* Street Fighter 6 */ || !strcmp(sgi, "1740720") /* Have a Nice Death */ diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index cfc49914c345..2386cb465071 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -137,7 +137,7 @@ static const SIZE_T page_size = 0x1000; static const SIZE_T teb_size = 0x3800; /* TEB64 + TEB32 + debug info */ static const SIZE_T signal_stack_mask = 0xffff; static const SIZE_T signal_stack_size = 0x10000 - 0x3800; -static const SIZE_T kernel_stack_size = 0x100000; +extern SIZE_T kernel_stack_size; static const SIZE_T kernel_stack_guard_size = 0x1000; static const SIZE_T min_kernel_stack = 0x3000; static const LONG teb_offset = 0x2000; From fbab51451f5604f3a0a31896d04aa1b3b7c6ffe8 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 15 May 2023 19:00:02 -0600 Subject: [PATCH 0685/2542] wined3d: Avoid sysmem pinning streaming buffer. CW-Bug-Id: #22259 Currently that happens on _SOFTWARE_VERTEXPROCESSING devices and prevents _MAP_DISCARD and _MAP_NOOVERWRITE optimization. --- dlls/wined3d/buffer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index 608be16b9df8..6b92e12f3e04 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -965,7 +965,7 @@ static HRESULT wined3d_buffer_init(struct wined3d_buffer *buffer, struct wined3d access |= WINED3D_RESOURCE_ACCESS_MAP_W; if (FAILED(hr = resource_init(resource, device, WINED3D_RTYPE_BUFFER, format, - WINED3D_MULTISAMPLE_NONE, 0, desc->usage, desc->bind_flags, access, + WINED3D_MULTISAMPLE_NONE, 0, desc->usage & ~WINED3DUSAGE_CS, desc->bind_flags, access, desc->byte_width, 1, 1, desc->byte_width, parent, parent_ops, &buffer_resource_ops))) { WARN("Failed to initialize resource, hr %#lx.\n", hr); @@ -978,8 +978,8 @@ static HRESULT wined3d_buffer_init(struct wined3d_buffer *buffer, struct wined3d TRACE("buffer %p, size %#x, usage %#x, memory @ %p.\n", buffer, buffer->resource.size, buffer->resource.usage, buffer->resource.heap_memory); - if (device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING - || (desc->usage & WINED3DUSAGE_MANAGED)) + if (!(desc->usage & WINED3DUSAGE_CS) && (device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING + || (desc->usage & WINED3DUSAGE_MANAGED))) { /* SWvp and managed buffers always return the same pointer in buffer * maps and retain data in DISCARD maps. Keep a system memory copy of @@ -1356,7 +1356,7 @@ static HRESULT wined3d_streaming_buffer_prepare(struct wined3d_device *device, TRACE("Growing buffer to %u bytes.\n", size); desc.byte_width = size; - desc.usage = WINED3DUSAGE_DYNAMIC; + desc.usage = WINED3DUSAGE_DYNAMIC | WINED3DUSAGE_CS; desc.bind_flags = buffer->bind_flags; desc.access = WINED3D_RESOURCE_ACCESS_GPU | WINED3D_RESOURCE_ACCESS_MAP_W; desc.misc_flags = 0; From 985bd984c88d121b9ca7865f2282c7866c10e471 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 17 May 2023 21:08:23 -0600 Subject: [PATCH 0686/2542] kernelbase: HACK: Add WINE_SHRINK_ENV option. CW-Bug-Id: #22272 --- dlls/kernelbase/process.c | 56 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index d72a9039f45c..f94f5a341c8c 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -1727,6 +1727,59 @@ LPSTR WINAPI DECLSPEC_HOTPATCH GetEnvironmentStringsA(void) return ret; } +static void hack_shrink_environment( WCHAR *env, SIZE_T len ) +{ + static int enabled = -1; + static const char *skip[] = + { + "SteamGenericControllers=", + "STEAM_RUNTIME_LIBRARY_PATH=", + "SDL_GAMECONTROLLER_IGNORE_DEVICES=", + "SDL_GAMECONTROLLERCONFIG=", + "LD_LIBRARY_PATH=", + "ORIG_LD_LIBRARY_PATH=", + "LS_COLORS=", + "BASH_FUNC_", + "XDG_DATA_DIRS=", + }; + SIZE_T l; + unsigned int i, j; + + if (enabled == -1) + { + WCHAR str[40]; + + *str = 0; + if (GetEnvironmentVariableW( L"WINE_SHRINK_ENV", str, sizeof(str)) ) + enabled = *str != '0'; + else if (GetEnvironmentVariableW( L"SteamGameId", str, sizeof(str)) ) + enabled = !wcscmp( str, L"431590" ); + else + enabled = 0; + + if (enabled) + ERR( "HACK: shrinking environment size.\n" ); + } + + if (!enabled) return; + + while (*env) + { + for (i = 0; i < ARRAY_SIZE(skip); ++i) + { + j = 0; + while (skip[i][j] && skip[i][j] == env[j]) + ++j; + if (!skip[i][j]) break; + } + l = lstrlenW( env ); + len -= (l + 1) * sizeof(WCHAR); + if (i == ARRAY_SIZE(skip)) + env += l + 1; + else + memmove( env, env + l + 1, len ); + } +} /*********************************************************************** * GetEnvironmentStringsW (kernelbase.@) @@ -1739,7 +1792,10 @@ LPWSTR WINAPI DECLSPEC_HOTPATCH GetEnvironmentStringsW(void) RtlAcquirePebLock(); len = get_env_length( NtCurrentTeb()->Peb->ProcessParameters->Environment ) * sizeof(WCHAR); if ((ret = HeapAlloc( GetProcessHeap(), 0, len ))) + { memcpy( ret, NtCurrentTeb()->Peb->ProcessParameters->Environment, len ); + hack_shrink_environment( ret, len ); + } RtlReleasePebLock(); return ret; } From 1b4b2e404b68b569d6c15c2be46472e57cc771e7 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 22 Sep 2022 15:48:40 -0500 Subject: [PATCH 0687/2542] msvcrt: HACK: Disable SSE2 support for Indiana Jones and The Emperor Tomb. CW-Bug-Id: #21330 --- dlls/msvcrt/math.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index be345fb7a4a4..d5115b33ea1d 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -72,6 +72,15 @@ void msvcrt_init_math( void *module ) sse2_supported = IsProcessorFeaturePresent( PF_XMMI64_INSTRUCTIONS_AVAILABLE ); #if _MSVCR_VER <=71 sse2_enabled = FALSE; + { + char sgi[64]; + + if (GetEnvironmentVariableA("SteamGameId", sgi, sizeof(sgi)) && !strcmp(sgi, "560430")) + { + sse2_supported = FALSE; + FIXME("HACK: disabling sse2 support in msvcrt.\n"); + } + } #else sse2_enabled = sse2_supported; #endif From bbf7948b29165be67d447d01c9d1544a7a5b32d6 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 22 Sep 2022 15:50:33 -0500 Subject: [PATCH 0688/2542] msvcrt: HACK: Disable SSE2 support for DarkStar One. CW-Bug-Id: #21330 --- dlls/msvcrt/math.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index d5115b33ea1d..ee7a512b6905 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -75,7 +75,8 @@ void msvcrt_init_math( void *module ) { char sgi[64]; - if (GetEnvironmentVariableA("SteamGameId", sgi, sizeof(sgi)) && !strcmp(sgi, "560430")) + if (GetEnvironmentVariableA("SteamGameId", sgi, sizeof(sgi)) + && (!strcmp(sgi, "560430") || !strcmp(sgi, "12330"))) { sse2_supported = FALSE; FIXME("HACK: disabling sse2 support in msvcrt.\n"); From de138b4a24035b862fdcd93f7d955f2136e1618c Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 31 May 2023 14:47:40 -0600 Subject: [PATCH 0689/2542] kernelbase: HACK: Force Angle Vulkan instead of GL for UplayWebCore. CW-Bug-Id: #22307 --- dlls/kernelbase/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index f94f5a341c8c..14a160a3dc37 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -591,7 +591,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) } options[] = { - {L"UplayWebCore.exe", L" --use-gl=swiftshader"}, + {L"UplayWebCore.exe", L" --use-angle=vulkan"}, {L"Paradox Launcher.exe", L" --use-angle=gl"}, {L"Montaro\\nw.exe", L" --use-gl=swiftshader"}, {L"\\EOSOverlayRenderer-Win64-Shipping.exe", L" --use-gl=swiftshader --in-process-gpu"}, From b8420a24b517a98709922661320b96510e557b5c Mon Sep 17 00:00:00 2001 From: Ziqing Hui Date: Wed, 22 Mar 2023 15:41:00 +0800 Subject: [PATCH 0690/2542] kernelbase: HACK: Force desktop GL for PaladinLias. CW-Bug-Id: #20816 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 14a160a3dc37..e724013fa39b 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -600,6 +600,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) {L"nw.exe.exe", L" --use-angle=d3d9"}, {L"DC Universe Online\\LaunchPad.exe", L" --use-gl=swiftshader"}, {L"PlanetSide 2\\LaunchPad.exe", L" --use-gl=swiftshader"}, + {L"PaladinLias\\Game.exe", L" --use-gl=desktop"}, }; unsigned int i; From f92547655d1ad15e4a633f4dc51e3bd8aaf996f8 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 18 Aug 2023 18:44:58 -0600 Subject: [PATCH 0691/2542] ntdll: HACK: Enable vk_x11_override_min_image_count, vk_x11_strict_image_count for Rainbow Six Extraction. CW-Bug-Id: #22634 --- dlls/ntdll/unix/loader.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 1cf3086c0651..89b1eabd0b9a 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2227,6 +2227,13 @@ static void hacks_init(void) ERR("HACK: setting LIBGL_ALWAYS_SOFTWARE.\n"); setenv("LIBGL_ALWAYS_SOFTWARE", "1", 0); } + + if (sgi && !strcmp(sgi, "2379390")) + { + ERR("HACK: setting vk_x11_override_min_image_count, vk_x11_strict_image_count.\n"); + setenv("vk_x11_override_min_image_count", "2", 0); + setenv("vk_x11_strict_image_count", "true", 0); + } } /*********************************************************************** From 0506d408c7cdd1f7565f0905d59a93569722cdfb Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 11 Jul 2023 14:29:15 -0600 Subject: [PATCH 0692/2542] ntdll: HACK: Enable WINE_SIMULATE_WRITECOPY for Idol Hands 2. CW-Bug-Id: #22425 --- dlls/ntdll/unix/loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 89b1eabd0b9a..d6c285b0ad81 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2190,6 +2190,7 @@ static void hacks_init(void) else if (sgi) simulate_writecopy = !strcmp(sgi, "1608730") /* Dawn of Corruption */ || !strcmp(sgi, "1680700") /* Purgo box */ || !strcmp(sgi, "2095300") /* Breakout 13 */ + || !strcmp(sgi, "2053940") /* Idol Hands 2 */ || !strcmp(sgi, "2176450"); /* Mr. Hopp's Playhouse 3 */ if (main_argc > 1 && strstr(main_argv[1], "MicrosoftEdgeUpdate.exe")) From d286a941f98f65c7129ebe46130fde3cd2ee8ec7 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 21 Jul 2023 21:09:41 -0600 Subject: [PATCH 0693/2542] wine.inf: Set FLG_HEAP_ENABLE_FREE_CHECK for Chaos Code. CW-Bug-Id: #21739 --- loader/wine.inf.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index df4b85f1e45d..9f5d05236a5d 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -445,6 +445,8 @@ HKLM,%CurrentVersionNT%\Ports,,16 HKLM,%CurrentVersionNT%\Print,,16 HKLM,%CurrentVersionNT%\ProfileList,,16 HKLM,%CurrentVersionNT%\Winlogon,"Shell",,"explorer.exe" +;; App specific heap debug flags +HKLM,%CurrentVersionNT%\Image File Execution Options\ChaosCode.exe,GlobalFlag,0x00040002,0x00000020 [CurrentVersionWow64.ntamd64] HKLM,%CurrentVersion%,"ProgramFilesDir (x86)",,"%16426%" From 9a83579e6df378966dd16527016c7641585cd348 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 3 Aug 2023 13:38:37 -0600 Subject: [PATCH 0694/2542] winex11.drv: Override GL vendor for Paradox Launcher. CW-Bug-Id: #22492 --- dlls/winex11.drv/opengl.c | 48 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index daf74c27fa54..458dbb36ff46 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -37,6 +37,8 @@ #ifdef HAVE_SYS_UN_H #include #endif +#include +#include #include "x11drv.h" #include "xcomposite.h" @@ -3222,6 +3224,52 @@ static void wglFlush(void) static const GLubyte *wglGetString(GLenum name) { + static int override_vendor = -1; + if (override_vendor == -1) + { + int fd; + char buffer[4096], *env; + int sz; + + override_vendor = 0; + if ((env = getenv("WINE_GL_HIDE_NVIDIA"))) + { + override_vendor = env[0] != '0'; + } + else + { + fd = open("/proc/self/cmdline", O_RDONLY); + if (fd != -1) + { + if ((sz = read(fd, buffer, sizeof(buffer) - 1)) > 0) + { + buffer[sz] = 0; + if (strstr(buffer, "\\Paradox Launcher.exe")) + { + FIXME("HACK: overriding GL vendor and renderer.\n"); + override_vendor = 1; + } + } + close(fd); + } + } + } + if (override_vendor) + { + const GLubyte *s; + if (name == GL_RENDERER) + { + s = pglGetString(name); + if (s && strstr((const char *)s, "NVIDIA")) return (const GLubyte *)"AMD Radeon Graphics"; + return s; + } + else if (name == GL_VENDOR) + { + s = pglGetString(name); + if (s && strstr((const char *)s, "NVIDIA")) return (const GLubyte *)"AMD"; + return s; + } + } if (name == GL_EXTENSIONS && glExtensions) return (const GLubyte *)glExtensions; return pglGetString(name); } From 5d8ed2f9f047b98fd5fa1df1c6a9810d4bcf9f22 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 9 Aug 2023 16:05:55 -0600 Subject: [PATCH 0695/2542] nsiproxy.sys: HACK: Add an option to fake eth adapter presence. CW-Bug-Id: #22580 --- dlls/nsiproxy.sys/ndis.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/dlls/nsiproxy.sys/ndis.c b/dlls/nsiproxy.sys/ndis.c index c7d1f73f67bb..158a39e558dc 100644 --- a/dlls/nsiproxy.sys/ndis.c +++ b/dlls/nsiproxy.sys/ndis.c @@ -105,6 +105,8 @@ struct if_entry static struct list if_list = LIST_INIT( if_list ); static pthread_mutex_t if_list_lock = PTHREAD_MUTEX_INITIALIZER; +static BOOL have_ethernet_iface; + static struct if_entry *find_entry_from_index( UINT index ) { struct if_entry *entry; @@ -275,7 +277,22 @@ static WCHAR *strdupAtoW( const char *str ) return ret; } -static struct if_entry *add_entry( UINT index, char *name ) +static int fake_ethernet_adapter(void) +{ + static int cached = -1; + + if (cached == -1) + { + const char *s; + if ((s = getenv( "WINE_FAKE_ETH_PRESENCE" ))) + cached = atoi( s ); + else + cached = (s = getenv( "SteamGameId" )) && !strcmp( s, "1293830" ); + } + return cached; +} + +static struct if_entry *add_entry( UINT index, const char *name ) { struct if_entry *entry; int name_len = strlen( name ); @@ -304,6 +321,10 @@ static struct if_entry *add_entry( UINT index, char *name ) memcpy( entry->if_guid.Data4 + 2, "NetDev", 6 ); list_add_tail( &if_list, &entry->entry ); + + if (entry->if_luid.Info.IfType == MIB_IF_TYPE_ETHERNET) + have_ethernet_iface = TRUE; + return entry; } @@ -311,6 +332,7 @@ static unsigned int update_if_table( void ) { struct if_nameindex *indices = if_nameindex(), *entry; unsigned int append_count = 0; + struct if_entry *if_entry; for (entry = indices; entry->if_index; entry++) { @@ -319,6 +341,14 @@ static unsigned int update_if_table( void ) } if_freenameindex( indices ); + + if (!have_ethernet_iface && fake_ethernet_adapter() && (if_entry = add_entry( 0xdeadbeef, "eth0faked" ))) + { + if_entry->if_type = if_entry->if_luid.Info.IfType = MIB_IF_TYPE_ETHERNET; + have_ethernet_iface = TRUE; + ++append_count; + } + return append_count; } From a52f4f14bbdb1cd7acd833d7160b0eea0a232587 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 21 Aug 2023 20:26:03 -0600 Subject: [PATCH 0696/2542] kernelbase: HACK: Try harder to force GL QtWebEngine rendering for EADesktop. CW-Bug-Id: #22640 --- dlls/kernelbase/process.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index e724013fa39b..a3cc8f844b85 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -2006,6 +2006,16 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetEnvironmentVariableW( LPCWSTR name, LPCWSTR val len = lstrlenW(names[i]); if (size > len && !memcmp( module + size - len, names[i], len * sizeof(*module) )) { + HMODULE h = GetModuleHandleW(L"Qt5Core.dll"); + void (WINAPI *QCoreApplication_setAttribute)(int attr, BOOL set); + + QCoreApplication_setAttribute = (void *)GetProcAddress(h, "?setAttribute@QCoreApplication@@SAXW4ApplicationAttribute@Qt@@_N@Z"); + if (QCoreApplication_setAttribute) + { + QCoreApplication_setAttribute(16 /* AA_UseOpenGLES */, 0); + QCoreApplication_setAttribute(15 /* AA_UseDesktopOpenGL */, 1); + } + else ERR("QCoreApplication_setAttribute not found, h %p.\n", h); value = L"desktop"; FIXME( "HACK: setting QT_OPENGL=desktop.\n" ); break; From 47e42e3ec48488711b1a35f6f88071797a94b225 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 1 Aug 2023 09:09:37 -0600 Subject: [PATCH 0697/2542] ntdll: HACK: Enable WINE_SIMULATE_WRITECOPY for UplayWebCore. CW-Bug-Id: #22534 --- dlls/ntdll/unix/loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index d6c285b0ad81..193ec1239049 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2187,6 +2187,7 @@ static void hacks_init(void) env_str = getenv("WINE_SIMULATE_WRITECOPY"); if (env_str) simulate_writecopy = atoi(env_str); + else if (main_argc > 1 && strstr(main_argv[1], "UplayWebCore.exe")) simulate_writecopy = TRUE; else if (sgi) simulate_writecopy = !strcmp(sgi, "1608730") /* Dawn of Corruption */ || !strcmp(sgi, "1680700") /* Purgo box */ || !strcmp(sgi, "2095300") /* Breakout 13 */ From d53c2b957a47b753bc5bcfead559e58895fe0f19 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 19 Jun 2023 17:50:33 -0600 Subject: [PATCH 0698/2542] ntdll: Reimplement NtSaveKey() on the client side. CW-Bug-Id: #22347 --- dlls/ntdll/unix/registry.c | 290 ++++++++++++++++++++++++++++++++++++- server/protocol.def | 14 +- server/registry.c | 124 +++++++++++++--- 3 files changed, 399 insertions(+), 29 deletions(-) diff --git a/dlls/ntdll/unix/registry.c b/dlls/ntdll/unix/registry.c index e19414bfa867..88ad7e569a1b 100644 --- a/dlls/ntdll/unix/registry.c +++ b/dlls/ntdll/unix/registry.c @@ -27,6 +27,8 @@ #include #include +#include +#include #include "ntstatus.h" #define WIN32_NO_STATUS @@ -68,6 +70,248 @@ NTSTATUS open_hkcu_key( const char *path, HANDLE *key ) return NtCreateKey( key, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL ); } +/* dump a Unicode string with proper escaping */ +int dump_strW( const WCHAR *str, data_size_t len, FILE *f, const char escape[2] ) +{ + static const char escapes[32] = ".......abtnvfr.............e...."; + char buffer[256]; + char *pos = buffer; + int count = 0; + + for (len /= sizeof(WCHAR); len; str++, len--) + { + if (pos > buffer + sizeof(buffer) - 8) + { + fwrite( buffer, pos - buffer, 1, f ); + count += pos - buffer; + pos = buffer; + } + if (*str > 127) /* hex escape */ + { + if (len > 1 && str[1] < 128 && isxdigit( (char)str[1] )) + pos += sprintf( pos, "\\x%04x", *str ); + else + pos += sprintf( pos, "\\x%x", *str ); + continue; + } + if (*str < 32) /* octal or C escape */ + { + if (!*str && len == 1) continue; /* do not output terminating NULL */ + if (escapes[*str] != '.') + pos += sprintf( pos, "\\%c", escapes[*str] ); + else if (len > 1 && str[1] >= '0' && str[1] <= '7') + pos += sprintf( pos, "\\%03o", *str ); + else + pos += sprintf( pos, "\\%o", *str ); + continue; + } + if (*str == '\\' || *str == escape[0] || *str == escape[1]) *pos++ = '\\'; + *pos++ = *str; + } + fwrite( buffer, pos - buffer, 1, f ); + count += pos - buffer; + return count; +} + +struct saved_key +{ + data_size_t namelen; + WCHAR *name; + data_size_t classlen; + WCHAR *class; + int value_count; + int subkey_count; + unsigned int is_symlink; + timeout_t modif; + struct saved_key *parent; +}; + +/* read serialized key data */ +static char *fill_saved_key( struct saved_key *key, struct saved_key *parent, char *data ) +{ + key->parent = parent; + key->namelen = *(data_size_t *)data; + data += sizeof(data_size_t); + key->name = (WCHAR *)data; + data += key->namelen; + key->classlen = *(data_size_t *)data; + data += sizeof(data_size_t); + key->class = (WCHAR *)data; + data += key->classlen; + key->value_count = *(int *)data; + data += sizeof(int); + key->subkey_count = *(int *)data; + data += sizeof(int); + key->is_symlink = *(unsigned int *)data; + data += sizeof(unsigned int); + key->modif = *(timeout_t *)data; + data += sizeof(timeout_t); + + return data; +} + +/* dump serialized key full path */ +static char *dump_parents( char *data, FILE *f, int count ) +{ + data_size_t len; + WCHAR *name; + + len = *(data_size_t *)data; + data += sizeof(data_size_t); + name = (WCHAR *)data; + data += len; + + if (count > 1) + { + data = dump_parents( data, f, count - 1); + fprintf( f, "\\\\" ); + } + dump_strW( name, len, f, "[]" ); + return data; +} + +/* dump the full path of a key */ +static void dump_path( const struct saved_key *key, const struct saved_key *base, FILE *f ) +{ + if (key->parent && key->parent != base) + { + dump_path( key->parent, base, f ); + fprintf( f, "\\\\" ); + } + dump_strW( key->name, key->namelen, f, "[]" ); +} + +/* dump a value to a text file */ +static char *dump_value( char *data, FILE *f ) +{ + unsigned int i, dw; + int count; + data_size_t namelen, valuelen; + char *valuedata; + WCHAR *name; + unsigned int type; + + namelen = *(data_size_t *)data; + data += sizeof(data_size_t); + name = (WCHAR *)data; + data += namelen; + type = *(unsigned int *)data; + data += sizeof(unsigned int); + valuelen = *(data_size_t *)data; + data += sizeof(data_size_t); + valuedata = data; + data += valuelen; + + if (namelen) + { + fputc( '\"', f ); + count = 1 + dump_strW( name, namelen, f, "\"\"" ); + count += fprintf( f, "\"=" ); + } + else count = fprintf( f, "@=" ); + + switch(type) + { + case REG_SZ: + case REG_EXPAND_SZ: + case REG_MULTI_SZ: + /* only output properly terminated strings in string format */ + if (valuelen < sizeof(WCHAR)) break; + if (valuelen % sizeof(WCHAR)) break; + if (((WCHAR *)valuedata)[valuelen / sizeof(WCHAR) - 1]) break; + if (type != REG_SZ) fprintf( f, "str(%x):", type ); + fputc( '\"', f ); + dump_strW( (WCHAR *)valuedata, valuelen, f, "\"\"" ); + fprintf( f, "\"\n" ); + return data; + + case REG_DWORD: + if (valuelen != sizeof(dw)) break; + memcpy( &dw, valuedata, sizeof(dw) ); + fprintf( f, "dword:%08x\n", dw ); + return data; + } + + if (type == REG_BINARY) count += fprintf( f, "hex:" ); + else count += fprintf( f, "hex(%x):", type ); + for (i = 0; i < valuelen; i++) + { + count += fprintf( f, "%02x", *((unsigned char *)valuedata + i) ); + if (i < valuelen-1) + { + fputc( ',', f ); + if (++count > 76) + { + fprintf( f, "\\\n " ); + count = 2; + } + } + } + fputc( '\n', f ); + return data; +} + +/* save a registry key and all its subkeys to a text file */ +static char *save_subkeys( char *data, struct saved_key *parent, struct saved_key *base, FILE *f ) +{ + struct saved_key key; + int i; + + if (!base) base = &key; + data = fill_saved_key( &key, parent, data ); + + /* save key if it has either some values or no subkeys, or needs special options */ + /* keys with no values but subkeys are saved implicitly by saving the subkeys */ + if ((key.value_count > 0) || !key.subkey_count || key.classlen || key.is_symlink) + { + fprintf( f, "\n[" ); + if (parent) dump_path( &key, base, f ); + fprintf( f, "] %u\n", (unsigned int)((key.modif - SECS_1601_TO_1970 * TICKSPERSEC) / TICKSPERSEC) ); + fprintf( f, "#time=%x%08x\n", (unsigned int)(key.modif >> 32), (unsigned int)key.modif ); + if (key.classlen) + { + fprintf( f, "#class=\"" ); + dump_strW( key.class, key.classlen, f, "\"\"" ); + fprintf( f, "\"\n" ); + } + if (key.is_symlink) fputs( "#link\n", f ); + for (i = 0; i < key.value_count; i++) data = dump_value( data, f ); + } + for (i = 0; i < key.subkey_count; i++) data = save_subkeys( data, &key, base, f ); + return data; +} + +/* save a registry branch to a file */ +static void save_all_subkeys( char *data, FILE *f ) +{ + enum prefix_type prefix_type; + int parent_count; + + prefix_type = *(int *)data; + data += sizeof(int); + + parent_count = *(int *)data; + data += sizeof(int); + + fprintf( f, "WINE REGISTRY Version 2\n" ); + fprintf( f, ";; All keys relative to " ); + data = dump_parents( data, f, parent_count ); + fprintf( f, "\n" ); + + switch (prefix_type) + { + case PREFIX_32BIT: + fprintf( f, "\n#arch=win32\n" ); + break; + case PREFIX_64BIT: + fprintf( f, "\n#arch=win64\n" ); + break; + default: + break; + } + save_subkeys( data, NULL, NULL, f ); +} + /****************************************************************************** * NtCreateKey (NTDLL.@) @@ -791,17 +1035,53 @@ NTSTATUS WINAPI NtUnloadKey( OBJECT_ATTRIBUTES *attr ) */ NTSTATUS WINAPI NtSaveKey( HANDLE key, HANDLE file ) { + data_size_t size = 0; unsigned int ret; + char *data = NULL; + int fd, fd2, needs_close = 0; + FILE *f; TRACE( "(%p,%p)\n", key, file ); - SERVER_START_REQ( save_registry ) + while (1) { - req->hkey = wine_server_obj_handle( key ); - req->file = wine_server_obj_handle( file ); - ret = wine_server_call( req ); + SERVER_START_REQ( save_registry ) + { + req->hkey = wine_server_obj_handle( key ); + if (size) wine_server_set_reply( req, data, size ); + ret = wine_server_call( req ); + size = reply->total; + } + SERVER_END_REQ; + + if (!ret) break; + free( data ); + if (ret != STATUS_BUFFER_TOO_SMALL) return ret; + if (!(data = malloc( size ))) + { + ERR( "No memory.\n" ); + return STATUS_NO_MEMORY; + } } - SERVER_END_REQ; + + if ((ret = server_get_unix_fd( file, FILE_WRITE_DATA, &fd, &needs_close, NULL, NULL ))) goto done; + if ((fd2 = dup( fd )) == -1) + { + ret = errno_to_status( errno ); + goto done; + } + if (!(f = fdopen( fd2, "w" ))) + { + close( fd2 ); + ret = errno_to_status( errno ); + goto done; + } + save_all_subkeys( data, f ); + if (fclose(f)) ret = errno_to_status( errno ); + +done: + if (needs_close) close( fd ); + free( data ); return ret; } diff --git a/server/protocol.def b/server/protocol.def index 570a6c1c9548..d3c054deb271 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -2084,11 +2084,19 @@ struct process_info @END -/* Save a registry branch to a file */ +/* Return full registry branch non-volatile data for saving */ @REQ(save_registry) - obj_handle_t hkey; /* key to save */ - obj_handle_t file; /* file to save to */ + obj_handle_t hkey; /* key to save */ +@REPLY + data_size_t total; /* total length needed for data */ + VARARG(data,bytes); /* registry data */ @END +enum prefix_type +{ + PREFIX_UNKNOWN, + PREFIX_32BIT, + PREFIX_64BIT, +}; /* Add a registry key change notification */ diff --git a/server/registry.c b/server/registry.c index 33452cf8a20c..eff724291d78 100644 --- a/server/registry.c +++ b/server/registry.c @@ -124,7 +124,7 @@ static struct key *root_key; static const timeout_t ticks_1601_to_1970 = (timeout_t)86400 * (369 * 365 + 89) * TICKS_PER_SEC; static const timeout_t save_period = 30 * -TICKS_PER_SEC; /* delay between periodic saves */ static struct timeout_user *save_timeout_user; /* saving timer */ -static enum prefix_type { PREFIX_UNKNOWN, PREFIX_32BIT, PREFIX_64BIT } prefix_type; +static enum prefix_type prefix_type; static const WCHAR wow6432node[] = {'W','o','w','6','4','3','2','N','o','d','e'}; static const WCHAR symlink_value[] = {'S','y','m','b','o','l','i','c','L','i','n','k','V','a','l','u','e'}; @@ -2028,29 +2028,104 @@ static void save_all_subkeys( struct key *key, FILE *f ) save_subkeys( key, key, f ); } -/* save a registry branch to a file handle */ -static void save_registry( struct key *key, obj_handle_t handle ) +static data_size_t serialize_value( const struct key_value *value, char *buf ) { - struct file *file; - int fd; + data_size_t size; - if (!(file = get_file_obj( current->process, handle, FILE_WRITE_DATA ))) return; - fd = dup( get_file_unix_fd( file ) ); - release_object( file ); - if (fd != -1) + size = sizeof(data_size_t) + value->namelen + sizeof(unsigned int) + sizeof(data_size_t) + value->len; + if (!buf) return size; + + *(data_size_t *)buf = value->namelen; + buf += sizeof(data_size_t); + memcpy( buf, value->name, value->namelen ); + buf += value->namelen; + + *(unsigned int *)buf = value->type; + buf += sizeof(unsigned int); + + *(data_size_t *)buf = value->len; + buf += sizeof(data_size_t); + memcpy( buf, value->data, value->len ); + + return size; +} + +/* save a registry key with subkeys to a buffer */ +static data_size_t serialize_key( const struct key *key, char *buf ) +{ + data_size_t size; + int subkey_count, i; + + if (key->flags & KEY_VOLATILE) return 0; + + size = sizeof(data_size_t) + key->obj.name->len + sizeof(data_size_t) + key->classlen + sizeof(int) + sizeof(int) + + sizeof(unsigned int) + sizeof(timeout_t); + for (i = 0; i <= key->last_value; i++) + size += serialize_value( &key->values[i], buf ? buf + size : NULL ); + subkey_count = 0; + for (i = 0; i <= key->last_subkey; i++) { - FILE *f = fdopen( fd, "w" ); - if (f) - { - save_all_subkeys( key, f ); - if (fclose( f )) file_set_error(); - } - else - { - file_set_error(); - close( fd ); - } + if (key->subkeys[i]->flags & KEY_VOLATILE) continue; + size += serialize_key( key->subkeys[i], buf ? buf + size : NULL ); + ++subkey_count; + } + if (!buf) return size; + + *(data_size_t *)buf = key->obj.name->len; + buf += sizeof(data_size_t); + memcpy( buf, key->obj.name->name, key->obj.name->len ); + buf += key->obj.name->len; + + *(data_size_t *)buf = key->classlen; + buf += sizeof(data_size_t); + memcpy( buf, key->class, key->classlen ); + buf += key->classlen; + + *(int *)buf = key->last_value + 1; + buf += sizeof(int); + + *(int *)buf = subkey_count; + buf += sizeof(int); + + *(unsigned int *)buf = key->flags & KEY_SYMLINK; + buf += sizeof(unsigned int); + + *(timeout_t *)buf = key->modif; + + return size; +} + +/* save registry branch to buffer */ +static data_size_t save_registry( const struct key *key, char *buf ) +{ + int *parent_count = NULL; + const struct key *parent; + data_size_t size; + + size = sizeof(int) + sizeof(int); + if (buf) + { + *(int *)buf = prefix_type; + buf += sizeof(int); + parent_count = (int *)buf; + buf += sizeof(int); + *parent_count = 0; } + + parent = key; + do + { + size += sizeof(data_size_t) + parent->obj.name->len; + if (!buf) continue; + ++*parent_count; + *(data_size_t *)buf = parent->obj.name->len; + buf += sizeof(data_size_t); + memcpy( buf, parent->obj.name->name, parent->obj.name->len ); + buf += parent->obj.name->len; + } while ((parent = get_parent( parent ))); + + size += serialize_key( key, buf ); + return size; } /* save a registry branch to a file */ @@ -2379,6 +2454,7 @@ DECL_HANDLER(unload_registry) DECL_HANDLER(save_registry) { struct key *key; + char *data; if (!thread_single_check_privilege( current, SeBackupPrivilege )) { @@ -2388,7 +2464,13 @@ DECL_HANDLER(save_registry) if ((key = get_hkey_obj( req->hkey, 0 ))) { - save_registry( key, req->file ); + reply->total = save_registry( key, NULL ); + if (reply->total <= get_reply_max_size()) + { + if ((data = set_reply_data_size( reply->total ))) + save_registry( key, data ); + } + else set_error( STATUS_BUFFER_TOO_SMALL ); release_object( key ); } } From 7086303ab1bc05d94ffb5d0e4fc3ecb5de587a13 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 20 Jun 2023 11:54:06 -0600 Subject: [PATCH 0699/2542] ntdll: Implement NtFlushKey(). CW-Bug-Id: #22347 --- dlls/ntdll/unix/registry.c | 155 +++++++++++++++++++++++++++++++++++-- server/protocol.def | 12 +++ server/registry.c | 94 ++++++++++++++++++++-- 3 files changed, 247 insertions(+), 14 deletions(-) diff --git a/dlls/ntdll/unix/registry.c b/dlls/ntdll/unix/registry.c index 88ad7e569a1b..492dd00d67ab 100644 --- a/dlls/ntdll/unix/registry.c +++ b/dlls/ntdll/unix/registry.c @@ -29,6 +29,8 @@ #include #include #include +#include +#include #include "ntstatus.h" #define WIN32_NO_STATUS @@ -282,8 +284,9 @@ static char *save_subkeys( char *data, struct saved_key *parent, struct saved_ke } /* save a registry branch to a file */ -static void save_all_subkeys( char *data, FILE *f ) +static char *save_all_subkeys( char *data, FILE *f ) { + /* Output registry format should match server/registry.c:save_all_subkeys(). */ enum prefix_type prefix_type; int parent_count; @@ -309,7 +312,7 @@ static void save_all_subkeys( char *data, FILE *f ) default: break; } - save_subkeys( data, NULL, NULL, f ); + return save_subkeys( data, NULL, NULL, f ); } @@ -916,22 +919,162 @@ NTSTATUS WINAPI NtNotifyChangeKey( HANDLE key, HANDLE event, PIO_APC_ROUTINE apc io, filter, subtree, buffer, length, async ); } +/* acquire mutex for registry flush operation */ +static HANDLE get_key_flush_mutex(void) +{ + WCHAR bufferW[256]; + UNICODE_STRING name = {.Buffer = bufferW}; + OBJECT_ATTRIBUTES attr; + char buffer[256]; + HANDLE mutex; + + snprintf( buffer, ARRAY_SIZE(buffer), "\\Sessions\\%u\\BaseNamedObjects\\__wine_regkey_flush", + (int)NtCurrentTeb()->Peb->SessionId ); + name.Length = name.MaximumLength = (strlen(buffer) + 1) * sizeof(WCHAR); + ascii_to_unicode( bufferW, buffer, name.Length / sizeof(WCHAR) ); + + InitializeObjectAttributes( &attr, &name, OBJ_OPENIF, NULL, NULL ); + if (NtCreateMutant( &mutex, MUTEX_ALL_ACCESS, &attr, FALSE ) < 0) return NULL; + NtWaitForSingleObject( mutex, FALSE, NULL ); + return mutex; +} + +/* release registry flush mutex */ +static void release_key_flush_mutex( HANDLE mutex ) +{ + NtReleaseMutant( mutex, NULL ); + NtClose( mutex ); +} + +/* save registry branch to Wine regsitry storage file */ +static NTSTATUS save_registry_branch( char **data ) +{ + static const char temp_fn[] = "savereg.tmp"; + char *file_name, *path = NULL, *tmp = NULL; + int file_name_len, path_len, fd; + struct stat st; + NTSTATUS ret; + FILE *f; + + file_name_len = *(int *)*data; + *data += sizeof(int); + file_name = *data; + *data += file_name_len; + + path_len = strlen( config_dir ) + 1 + file_name_len + 1; + if (!(path = malloc( path_len ))) return STATUS_NO_MEMORY; + sprintf( path, "%s/%s", config_dir, file_name ); + + if ((fd = open( path, O_WRONLY )) != -1) + { + /* if file is not a regular file or has multiple links or is accessed + * via symbolic links, write directly into it; otherwise use a temp file */ + if (!lstat( path, &st ) && (!S_ISREG(st.st_mode) || st.st_nlink > 1)) + { + ftruncate( fd, 0 ); + goto save; + } + close( fd ); + } + + /* create a temp file in the same directory */ + if (!(tmp = malloc( strlen( config_dir ) + 1 + strlen( temp_fn ) + 1 ))) + { + ret = STATUS_NO_MEMORY; + goto done; + } + sprintf( tmp, "%s/%s", config_dir, temp_fn ); + + if ((fd = open( tmp, O_CREAT | O_EXCL | O_WRONLY, 0666 )) == -1) + { + ret = errno_to_status( errno ); + goto done; + } + +save: + if (!(f = fdopen( fd, "w" ))) + { + ret = errno_to_status( errno ); + if (tmp) unlink( tmp ); + close( fd ); + goto done; + } + + *data = save_all_subkeys( *data, f ); + + ret = fclose( f ) ? errno_to_status( errno ) : STATUS_SUCCESS; + if (tmp) + { + if (!ret && rename( tmp, path )) ret = errno_to_status( errno ); + if (ret) unlink( tmp ); + } + +done: + free( tmp ); + free( path ); + return ret; +} /****************************************************************************** * NtFlushKey (NTDLL.@) */ NTSTATUS WINAPI NtFlushKey( HANDLE key ) { + abstime_t timestamp_counter; + data_size_t size = 0; unsigned int ret; + char *data = NULL, *curr_data; + HANDLE mutex; + int i, branch_count, branch; TRACE( "key=%p\n", key ); - SERVER_START_REQ( flush_key ) + mutex = get_key_flush_mutex(); + + while (1) { - req->hkey = wine_server_obj_handle( key ); - ret = wine_server_call( req ); + SERVER_START_REQ( flush_key ) + { + req->hkey = wine_server_obj_handle( key ); + if (size) wine_server_set_reply( req, data, size ); + ret = wine_server_call( req ); + size = reply->total; + branch_count = reply->branch_count; + timestamp_counter = reply->timestamp_counter; + } + SERVER_END_REQ; + + if (ret != STATUS_BUFFER_TOO_SMALL) break; + free( data ); + if (!(data = malloc( size ))) + { + ERR( "No memory.\n" ); + ret = STATUS_NO_MEMORY; + goto done; + } } - SERVER_END_REQ; + if (ret) goto done; + + curr_data = data; + for (i = 0; i < branch_count; ++i) + { + branch = *(int *)curr_data; + curr_data += sizeof(int); + if ((ret = save_registry_branch( &curr_data ))) goto done; + + SERVER_START_REQ( flush_key_done ) + { + req->branch = branch; + req->timestamp_counter = timestamp_counter; + ret = wine_server_call( req ); + } + SERVER_END_REQ; + if (ret) break; + } + +done: + release_key_flush_mutex( mutex ); + free( data ); return ret; } diff --git a/server/protocol.def b/server/protocol.def index d3c054deb271..3bfea8c66a57 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -2004,6 +2004,18 @@ struct process_info /* Flush a registry key */ @REQ(flush_key) obj_handle_t hkey; /* handle to the key */ +@REPLY + abstime_t timestamp_counter; /* branch last change timestamp counter */ + data_size_t total; /* total length needed for data */ + int branch_count; /* number of registry branches to flush */ + VARARG(data,bytes); /* registry data */ +@END + + +/* Clear KEY_DIRTY after key flush */ +@REQ(flush_key_done) + abstime_t timestamp_counter; /* timestamp counter returned from flush_key */ + int branch; /* saved registry branch id */ @END diff --git a/server/registry.c b/server/registry.c index eff724291d78..d82652584a13 100644 --- a/server/registry.c +++ b/server/registry.c @@ -90,6 +90,7 @@ struct key unsigned int flags; /* flags */ timeout_t modif; /* last modification time */ struct list notify_list; /* list of notifications */ + abstime_t timestamp_counter; /* timestamp counter at last change */ }; /* key flags */ @@ -118,6 +119,8 @@ struct key_value #define MAX_NAME_LEN 256 /* max. length of a key name */ #define MAX_VALUE_LEN 16383 /* max. length of a value name */ +static abstime_t change_timestamp_counter; + /* the root of the registry tree */ static struct key *root_key; @@ -710,6 +713,7 @@ static struct key *create_key_object( struct object *parent, const struct unicod key->last_value = -1; key->values = NULL; key->modif = modif; + key->timestamp_counter = 0; list_init( &key->notify_list ); if (options & REG_OPTION_CREATE_LINK) key->flags |= KEY_SYMLINK; @@ -730,23 +734,25 @@ static struct key *create_key_object( struct object *parent, const struct unicod /* mark a key and all its parents as dirty (modified) */ static void make_dirty( struct key *key ) { + ++change_timestamp_counter; while (key) { if (key->flags & (KEY_DIRTY|KEY_VOLATILE)) return; /* nothing to do */ key->flags |= KEY_DIRTY; + key->timestamp_counter = change_timestamp_counter; key = get_parent( key ); } } /* mark a key and all its subkeys as clean (not modified) */ -static void make_clean( struct key *key ) +static void make_clean( struct key *key, abstime_t timestamp_counter ) { int i; if (key->flags & KEY_VOLATILE) return; if (!(key->flags & KEY_DIRTY)) return; - key->flags &= ~KEY_DIRTY; - for (i = 0; i <= key->last_subkey; i++) make_clean( key->subkeys[i] ); + if (key->timestamp_counter <= timestamp_counter) key->flags &= ~KEY_DIRTY; + for (i = 0; i <= key->last_subkey; i++) make_clean( key->subkeys[i], timestamp_counter ); } /* go through all the notifications and send them if necessary */ @@ -2010,6 +2016,7 @@ void init_registry(void) /* save a registry branch to a file */ static void save_all_subkeys( struct key *key, FILE *f ) { + /* Registry format in ntdll/registry.c:save_all_subkeys() should match. */ fprintf( f, "WINE REGISTRY Version 2\n" ); fprintf( f, ";; All keys relative to " ); dump_path( key, NULL, f ); @@ -2194,7 +2201,7 @@ static int save_branch( struct key *key, const char *filename ) } done: - if (ret) make_clean( key ); + if (ret) make_clean( key, key->timestamp_counter ); return ret; } @@ -2242,6 +2249,36 @@ static int is_wow64_thread( struct thread *thread ) return (is_machine_64bit( native_machine ) && !is_machine_64bit( thread->process->machine )); } +/* find all the branches inside the specified key or the branch containing the key */ +static void find_branches_for_key( struct key *key, int *branches, int *branch_count ) +{ + struct key *k; + int i; + + *branch_count = 0; + for (i = 0; i < save_branch_count; i++) + { + k = save_branch_info[i].key; + while ((k = get_parent(k))) + { + if (k != key) continue; + branches[(*branch_count)++] = i; + break; + } + } + + if (*branch_count) return; + + do + { + for (i = 0; i < save_branch_count; i++) + { + if(key != save_branch_info[i].key) continue; + branches[(*branch_count)++] = i; + return; + } + } while ((key = get_parent( key ))); +} /* create a registry key */ DECL_HANDLER(create_key) @@ -2310,15 +2347,56 @@ DECL_HANDLER(delete_key) } } -/* flush a registry key */ +/* return registry branches snaphot data for flushing key */ DECL_HANDLER(flush_key) { struct key *key = get_hkey_obj( req->hkey, 0 ); - if (key) + int branches[3], branch_count = 0, i, path_len; + char *data; + + if (!key) return; + + reply->total = 0; + reply->branch_count = 0; + if ((key->flags & KEY_DIRTY) && !(key->flags & KEY_VOLATILE)) + find_branches_for_key( key, branches, &branch_count ); + release_object( key ); + + reply->timestamp_counter = change_timestamp_counter; + for (i = 0; i < branch_count; ++i) { - /* we don't need to do anything here with the current implementation */ - release_object( key ); + if (!(save_branch_info[branches[i]].key->flags & KEY_DIRTY)) continue; + ++reply->branch_count; + path_len = strlen( save_branch_info[branches[i]].filename ) + 1; + reply->total += sizeof(int) + sizeof(int) + path_len + save_registry( save_branch_info[branches[i]].key, NULL ); + } + if (reply->total > get_reply_max_size()) + { + set_error( STATUS_BUFFER_TOO_SMALL ); + return; } + + if (!(data = set_reply_data_size( reply->total ))) return; + + for (i = 0; i < branch_count; ++i) + { + if (!(save_branch_info[branches[i]].key->flags & KEY_DIRTY)) continue; + *(int *)data = branches[i]; + data += sizeof(int); + path_len = strlen( save_branch_info[branches[i]].filename ) + 1; + *(int *)data = path_len; + data += sizeof(int); + memcpy( data, save_branch_info[branches[i]].filename, path_len ); + data += path_len; + data += save_registry( save_branch_info[branches[i]].key, data ); + } +} + +/* clear dirty state after successful registry branch flush */ +DECL_HANDLER(flush_key_done) +{ + if (req->branch < save_branch_count) make_clean( save_branch_info[req->branch].key, req->timestamp_counter ); + else set_error( STATUS_INVALID_PARAMETER ); } /* enumerate registry subkeys */ From 35ffcae5ff2c124fffa8610f4e4b47c7ad7410f1 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 20 Jun 2023 12:17:36 -0600 Subject: [PATCH 0700/2542] mountmgr.sys: Perform periodic registry flush instead of server. CW-Bug-Id: #22347 --- dlls/mountmgr.sys/mountmgr.c | 22 ++++++++++++++++++++++ server/registry.c | 26 -------------------------- 2 files changed, 22 insertions(+), 26 deletions(-) diff --git a/dlls/mountmgr.sys/mountmgr.c b/dlls/mountmgr.sys/mountmgr.c index 8d42fb36bad4..77c2b795ef59 100644 --- a/dlls/mountmgr.sys/mountmgr.c +++ b/dlls/mountmgr.sys/mountmgr.c @@ -609,6 +609,27 @@ static DWORD WINAPI run_loop_thread( void *arg ) return MOUNTMGR_CALL( run_loop, ¶ms ); } +static DWORD WINAPI registry_flush_thread( void *arg ) +{ + UNICODE_STRING name = RTL_CONSTANT_STRING( L"\\Registry" ); + OBJECT_ATTRIBUTES attr; + HANDLE root; + + InitializeObjectAttributes( &attr, &name, 0, 0, NULL ); + if (NtOpenKeyEx( &root, MAXIMUM_ALLOWED, &attr, 0 )) + { + ERR( "Failed opening root registry key.\n" ); + return 0; + } + + for (;;) + { + Sleep( 30000 ); + if (NtFlushKey( root )) ERR( "Failed flushing registry.\n" ); + } + + return 0; +} /* main entry point for the mount point manager driver */ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) @@ -652,6 +673,7 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) thread = CreateThread( NULL, 0, device_op_thread, NULL, 0, NULL ); CloseHandle( CreateThread( NULL, 0, run_loop_thread, thread, 0, NULL )); + CloseHandle( CreateThread( NULL, 0, registry_flush_thread, thread, 0, NULL )); #ifdef _WIN64 /* create a symlink so that the Wine port overrides key can be edited with 32-bit reg or regedit */ diff --git a/server/registry.c b/server/registry.c index d82652584a13..f733d3748822 100644 --- a/server/registry.c +++ b/server/registry.c @@ -125,15 +125,12 @@ static abstime_t change_timestamp_counter; static struct key *root_key; static const timeout_t ticks_1601_to_1970 = (timeout_t)86400 * (369 * 365 + 89) * TICKS_PER_SEC; -static const timeout_t save_period = 30 * -TICKS_PER_SEC; /* delay between periodic saves */ -static struct timeout_user *save_timeout_user; /* saving timer */ static enum prefix_type prefix_type; static const WCHAR wow6432node[] = {'W','o','w','6','4','3','2','N','o','d','e'}; static const WCHAR symlink_value[] = {'S','y','m','b','o','l','i','c','L','i','n','k','V','a','l','u','e'}; static const struct unicode_str symlink_str = { symlink_value, sizeof(symlink_value) }; -static void set_periodic_save_timer(void); static struct key_value *find_value( const struct key *key, const struct unicode_str *name, int *index ); /* information about where to save a registry branch */ @@ -1991,9 +1988,6 @@ void init_registry(void) release_object( hklm ); release_object( hkcu ); - /* start the periodic save timer */ - set_periodic_save_timer(); - /* create windows directories */ if (!mkdir( "drive_c/windows", 0777 )) @@ -2205,26 +2199,6 @@ static int save_branch( struct key *key, const char *filename ) return ret; } -/* periodic saving of the registry */ -static void periodic_save( void *arg ) -{ - int i; - - if (fchdir( config_dir_fd ) == -1) return; - save_timeout_user = NULL; - for (i = 0; i < save_branch_count; i++) - save_branch( save_branch_info[i].key, save_branch_info[i].filename ); - if (fchdir( server_dir_fd ) == -1) fatal_error( "chdir to server dir: %s\n", strerror( errno )); - set_periodic_save_timer(); -} - -/* start the periodic save timer */ -static void set_periodic_save_timer(void) -{ - if (save_timeout_user) remove_timeout_user( save_timeout_user ); - save_timeout_user = add_timeout_user( save_period, periodic_save, NULL ); -} - /* save the modified registry branches to disk */ void flush_registry(void) { From 25580f6adbe1f5a62eb9715560a5771a8493cbed Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 26 Jun 2023 15:30:13 -0600 Subject: [PATCH 0701/2542] rsaenh: Store keys as volatile for SF6. CW-Bug-Id: #22347 --- dlls/rsaenh/rsaenh.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dlls/rsaenh/rsaenh.c b/dlls/rsaenh/rsaenh.c index 36c8a4bb4d85..d65bded2ebee 100644 --- a/dlls/rsaenh/rsaenh.c +++ b/dlls/rsaenh/rsaenh.c @@ -1211,9 +1211,20 @@ static void store_key_permissions(HCRYPTKEY hCryptKey, HKEY hKey, DWORD dwKeySpe */ static BOOL create_container_key(KEYCONTAINER *pKeyContainer, REGSAM sam, HKEY *phKey) { + static DWORD key_options = ~0ul; CHAR szRSABase[sizeof(RSAENH_REGKEY) + MAX_PATH]; HKEY hRootKey; + if (key_options == ~0ul) + { + const char *sgi; + + if ((sgi = getenv("SteamGameId")) && !strcmp(sgi, "1364780")) + key_options = REG_OPTION_VOLATILE; + else + key_options = REG_OPTION_NON_VOLATILE; + } + sprintf(szRSABase, RSAENH_REGKEY, pKeyContainer->szName); if (pKeyContainer->dwFlags & CRYPT_MACHINE_KEYSET) @@ -1224,7 +1235,7 @@ static BOOL create_container_key(KEYCONTAINER *pKeyContainer, REGSAM sam, HKEY * /* @@ Wine registry key: HKLM\Software\Wine\Crypto\RSA */ /* @@ Wine registry key: HKCU\Software\Wine\Crypto\RSA */ return RegCreateKeyExA(hRootKey, szRSABase, 0, NULL, - REG_OPTION_NON_VOLATILE, sam, NULL, phKey, NULL) + key_options, sam, NULL, phKey, NULL) == ERROR_SUCCESS; } From f3ccd07db72c049c40e84001697733cdcf13ef6a Mon Sep 17 00:00:00 2001 From: Matteo Bruni Date: Fri, 1 Sep 2023 00:54:36 +0200 Subject: [PATCH 0702/2542] kernelbase: HACK: Add --use-gl=swiftshader for EverQuest 2/LaunchPad.exe. CW-Bug-Id: #18509 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index a3cc8f844b85..15ee67a0a245 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -601,6 +601,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) {L"DC Universe Online\\LaunchPad.exe", L" --use-gl=swiftshader"}, {L"PlanetSide 2\\LaunchPad.exe", L" --use-gl=swiftshader"}, {L"PaladinLias\\Game.exe", L" --use-gl=desktop"}, + {L"EverQuest 2\\LaunchPad.exe", L" --use-gl=swiftshader"}, }; unsigned int i; From e631c3f6f124dd362570bc466fc84b0c75b80067 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Thu, 17 Apr 2014 16:07:46 -0600 Subject: [PATCH 0703/2542] server: Unify the storage of security attributes for files and directories. (try 7) CW-Bug-Id: #22436 --- server/change.c | 45 ++++++--------------------------------------- server/file.c | 34 ++++++++++++++++++++++------------ server/file.h | 2 ++ 3 files changed, 30 insertions(+), 51 deletions(-) diff --git a/server/change.c b/server/change.c index 7e9e51e2c92c..c1ebb067b55b 100644 --- a/server/change.c +++ b/server/change.c @@ -366,48 +366,15 @@ static int dir_set_sd( struct object *obj, const struct security_descriptor *sd, unsigned int set_info ) { struct dir *dir = (struct dir *)obj; - const struct sid *owner; - struct stat st; - mode_t mode; - int unix_fd; + struct fd *fd; + int ret; assert( obj->ops == &dir_ops ); - unix_fd = get_dir_unix_fd( dir ); - - if (unix_fd == -1 || fstat( unix_fd, &st ) == -1) return 1; - - if (set_info & OWNER_SECURITY_INFORMATION) - { - owner = sd_get_owner( sd ); - if (!owner) - { - set_error( STATUS_INVALID_SECURITY_DESCR ); - return 0; - } - if (!obj->sd || !equal_sid( owner, sd_get_owner( obj->sd ) )) - { - /* FIXME: get Unix uid and call fchown */ - } - } - else if (obj->sd) - owner = sd_get_owner( obj->sd ); - else - owner = token_get_owner( current->process->token ); - - if (set_info & DACL_SECURITY_INFORMATION) - { - /* keep the bits that we don't map to access rights in the ACL */ - mode = st.st_mode & (S_ISUID|S_ISGID|S_ISVTX); - mode |= sd_to_mode( sd, owner ); - - if (((st.st_mode ^ mode) & (S_IRWXU|S_IRWXG|S_IRWXO)) && fchmod( unix_fd, mode ) == -1) - { - file_set_error(); - return 0; - } - } - return 1; + fd = dir_get_fd( obj ); + ret = set_file_sd( obj, fd, &dir->mode, &dir->uid, sd, set_info ); + release_object( fd ); + return ret; } static struct change_record *get_first_change_record( struct dir *dir ) diff --git a/server/file.c b/server/file.c index bbc2ebfe920b..0c6614a8b741 100644 --- a/server/file.c +++ b/server/file.c @@ -497,18 +497,13 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const struct sid *owner return new_mode; } -static int file_set_sd( struct object *obj, const struct security_descriptor *sd, - unsigned int set_info ) +int set_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid, + const struct security_descriptor *sd, unsigned int set_info ) { - struct file *file = (struct file *)obj; + int unix_fd = get_unix_fd( fd ); const struct sid *owner; struct stat st; - mode_t mode; - int unix_fd; - - assert( obj->ops == &file_ops ); - - unix_fd = get_file_unix_fd( file ); + mode_t new_mode; if (unix_fd == -1 || fstat( unix_fd, &st ) == -1) return 1; @@ -535,10 +530,10 @@ static int file_set_sd( struct object *obj, const struct security_descriptor *sd if (set_info & DACL_SECURITY_INFORMATION) { /* keep the bits that we don't map to access rights in the ACL */ - mode = st.st_mode & (S_ISUID|S_ISGID|S_ISVTX); - mode |= sd_to_mode( sd, owner ); + new_mode = st.st_mode & (S_ISUID|S_ISGID|S_ISVTX); + new_mode |= sd_to_mode( sd, owner ); - if (((st.st_mode ^ mode) & (S_IRWXU|S_IRWXG|S_IRWXO)) && fchmod( unix_fd, mode ) == -1) + if (((st.st_mode ^ new_mode) & (S_IRWXU|S_IRWXG|S_IRWXO)) && fchmod( unix_fd, new_mode ) == -1) { file_set_error(); return 0; @@ -583,6 +578,21 @@ static struct list *file_get_kernel_obj_list( struct object *obj ) return &file->kernel_object; } +static int file_set_sd( struct object *obj, const struct security_descriptor *sd, + unsigned int set_info ) +{ + struct file *file = (struct file *)obj; + struct fd *fd; + int ret; + + assert( obj->ops == &file_ops ); + + fd = file_get_fd( obj ); + ret = set_file_sd( obj, fd, &file->mode, &file->uid, sd, set_info ); + release_object( fd ); + return ret; +} + static void file_destroy( struct object *obj ) { struct file *file = (struct file *)obj; diff --git a/server/file.h b/server/file.h index 4346fc402ab4..8594960a93d9 100644 --- a/server/file.h +++ b/server/file.h @@ -174,6 +174,8 @@ extern void file_set_error(void); extern struct security_descriptor *mode_to_sd( mode_t mode, const struct sid *user, const struct sid *group ); extern mode_t sd_to_mode( const struct security_descriptor *sd, const struct sid *owner ); extern int is_file_executable( const char *name ); +extern int set_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid, + const struct security_descriptor *sd, unsigned int set_info ); /* file mapping functions */ From 600af4b9a952f203ab94d4ef6084ac2a42f2a290 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Thu, 17 Apr 2014 16:07:50 -0600 Subject: [PATCH 0704/2542] server: Unify the retrieval of security attributes for files and directories. (try 7) CW-Bug-Id: #22436 --- server/change.c | 32 +++++--------------------------- server/file.c | 32 +++++++++++++++++++++----------- server/file.h | 2 ++ 3 files changed, 28 insertions(+), 38 deletions(-) diff --git a/server/change.c b/server/change.c index c1ebb067b55b..6e1626a1c301 100644 --- a/server/change.c +++ b/server/change.c @@ -326,39 +326,17 @@ static struct fd *dir_get_fd( struct object *obj ) return (struct fd *)grab_object( dir->fd ); } -static int get_dir_unix_fd( struct dir *dir ) -{ - return get_unix_fd( dir->fd ); -} - static struct security_descriptor *dir_get_sd( struct object *obj ) { struct dir *dir = (struct dir *)obj; - int unix_fd; - struct stat st; struct security_descriptor *sd; - assert( obj->ops == &dir_ops ); - - unix_fd = get_dir_unix_fd( dir ); - - if (unix_fd == -1 || fstat( unix_fd, &st ) == -1) - return obj->sd; - - /* mode and uid the same? if so, no need to re-generate security descriptor */ - if (obj->sd && - (st.st_mode & (S_IRWXU|S_IRWXO)) == (dir->mode & (S_IRWXU|S_IRWXO)) && - (st.st_uid == dir->uid)) - return obj->sd; + struct fd *fd; - sd = mode_to_sd( st.st_mode, - security_unix_uid_to_sid( st.st_uid ), - token_get_primary_group( current->process->token )); - if (!sd) return obj->sd; + assert( obj->ops == &dir_ops ); - dir->mode = st.st_mode; - dir->uid = st.st_uid; - free( obj->sd ); - obj->sd = sd; + fd = dir_get_fd( obj ); + sd = get_file_sd( obj, fd, &dir->mode, &dir->uid ); + release_object( fd ); return sd; } diff --git a/server/file.c b/server/file.c index 0c6614a8b741..f231681a0c95 100644 --- a/server/file.c +++ b/server/file.c @@ -387,23 +387,19 @@ struct security_descriptor *mode_to_sd( mode_t mode, const struct sid *user, con return sd; } -static struct security_descriptor *file_get_sd( struct object *obj ) +struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode_t *mode, + uid_t *uid ) { - struct file *file = (struct file *)obj; + int unix_fd = get_unix_fd( fd ); struct stat st; - int unix_fd; struct security_descriptor *sd; - assert( obj->ops == &file_ops ); - - unix_fd = get_file_unix_fd( file ); - if (unix_fd == -1 || fstat( unix_fd, &st ) == -1) return obj->sd; /* mode and uid the same? if so, no need to re-generate security descriptor */ - if (obj->sd && (st.st_mode & (S_IRWXU|S_IRWXO)) == (file->mode & (S_IRWXU|S_IRWXO)) && - (st.st_uid == file->uid)) + if (obj->sd && (st.st_mode & (S_IRWXU|S_IRWXO)) == (*mode & (S_IRWXU|S_IRWXO)) && + (st.st_uid == *uid)) return obj->sd; sd = mode_to_sd( st.st_mode, @@ -411,13 +407,27 @@ static struct security_descriptor *file_get_sd( struct object *obj ) token_get_primary_group( current->process->token )); if (!sd) return obj->sd; - file->mode = st.st_mode; - file->uid = st.st_uid; + *mode = st.st_mode; + *uid = st.st_uid; free( obj->sd ); obj->sd = sd; return sd; } +static struct security_descriptor *file_get_sd( struct object *obj ) +{ + struct file *file = (struct file *)obj; + struct security_descriptor *sd; + struct fd *fd; + + assert( obj->ops == &file_ops ); + + fd = file_get_fd( obj ); + sd = get_file_sd( obj, fd, &file->mode, &file->uid ); + release_object( fd ); + return sd; +} + static mode_t file_access_to_mode( unsigned int access ) { mode_t mode = 0; diff --git a/server/file.h b/server/file.h index 8594960a93d9..e5367fdc5952 100644 --- a/server/file.h +++ b/server/file.h @@ -176,6 +176,8 @@ extern mode_t sd_to_mode( const struct security_descriptor *sd, const struct sid extern int is_file_executable( const char *name ); extern int set_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid, const struct security_descriptor *sd, unsigned int set_info ); +extern struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode_t *mode, + uid_t *uid ); /* file mapping functions */ From 4bb3ace6951320fe25b4f3132a329a18da760052 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 30 Mar 2015 12:32:34 +0200 Subject: [PATCH 0705/2542] server: Add a helper function set_sd_from_token_internal to merge two security descriptors. CW-Bug-Id: #22436 --- server/object.c | 59 +++++++++++++++++++++++++++++++------------------ server/object.h | 3 +++ 2 files changed, 40 insertions(+), 22 deletions(-) diff --git a/server/object.c b/server/object.c index 948c3b3e9744..0fc9aef451ad 100644 --- a/server/object.c +++ b/server/object.c @@ -653,8 +653,9 @@ struct security_descriptor *default_get_sd( struct object *obj ) return obj->sd; } -int set_sd_defaults_from_token( struct object *obj, const struct security_descriptor *sd, - unsigned int set_info, struct token *token ) +struct security_descriptor *set_sd_from_token_internal( const struct security_descriptor *sd, + const struct security_descriptor *old_sd, + unsigned int set_info, struct token *token ) { struct security_descriptor new_sd, *new_sd_ptr; int present; @@ -663,8 +664,6 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri struct acl *replaced_sacl = NULL; char *ptr; - if (!set_info) return 1; - new_sd.control = sd->control & ~SE_SELF_RELATIVE; if (set_info & OWNER_SECURITY_INFORMATION && sd->owner_len) @@ -672,10 +671,10 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri owner = sd_get_owner( sd ); new_sd.owner_len = sd->owner_len; } - else if (obj->sd && obj->sd->owner_len) + else if (old_sd && old_sd->owner_len) { - owner = sd_get_owner( obj->sd ); - new_sd.owner_len = obj->sd->owner_len; + owner = sd_get_owner( old_sd ); + new_sd.owner_len = old_sd->owner_len; } else if (token) { @@ -689,10 +688,10 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri group = sd_get_group( sd ); new_sd.group_len = sd->group_len; } - else if (obj->sd && obj->sd->group_len) + else if (old_sd && old_sd->group_len) { - group = sd_get_group( obj->sd ); - new_sd.group_len = obj->sd->group_len; + group = sd_get_group( old_sd ); + new_sd.group_len = old_sd->group_len; } else if (token) { @@ -710,20 +709,20 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri else if (set_info & LABEL_SECURITY_INFORMATION && present) { const struct acl *old_sacl = NULL; - if (obj->sd && obj->sd->control & SE_SACL_PRESENT) old_sacl = sd_get_sacl( obj->sd, &present ); - if (!(replaced_sacl = replace_security_labels( old_sacl, sacl ))) return 0; + if (old_sd && old_sd->control & SE_SACL_PRESENT) old_sacl = sd_get_sacl( old_sd, &present ); + if (!(replaced_sacl = replace_security_labels( old_sacl, sacl ))) return NULL; new_sd.control |= SE_SACL_PRESENT; new_sd.sacl_len = replaced_sacl->size; sacl = replaced_sacl; } else { - if (obj->sd) sacl = sd_get_sacl( obj->sd, &present ); + if (old_sd) sacl = sd_get_sacl( old_sd, &present ); - if (obj->sd && present) + if (old_sd && present) { new_sd.control |= SE_SACL_PRESENT; - new_sd.sacl_len = obj->sd->sacl_len; + new_sd.sacl_len = old_sd->sacl_len; } else new_sd.sacl_len = 0; @@ -737,12 +736,12 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri } else { - if (obj->sd) dacl = sd_get_dacl( obj->sd, &present ); + if (old_sd) dacl = sd_get_dacl( old_sd, &present ); - if (obj->sd && present) + if (old_sd && present) { new_sd.control |= SE_DACL_PRESENT; - new_sd.dacl_len = obj->sd->dacl_len; + new_sd.dacl_len = old_sd->dacl_len; } else if (token) { @@ -758,7 +757,7 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri if (!ptr) { free( replaced_sacl ); - return 0; + return NULL; } new_sd_ptr = (struct security_descriptor*)ptr; @@ -769,9 +768,25 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri mem_append( ptr, dacl, new_sd.dacl_len ); free( replaced_sacl ); - free( obj->sd ); - obj->sd = new_sd_ptr; - return 1; + return new_sd_ptr; +} + +int set_sd_defaults_from_token( struct object *obj, const struct security_descriptor *sd, + unsigned int set_info, struct token *token ) +{ + struct security_descriptor *new_sd; + + if (!set_info) return 1; + + new_sd = set_sd_from_token_internal( sd, obj->sd, set_info, token ); + if (new_sd) + { + free( obj->sd ); + obj->sd = new_sd; + return 1; + } + + return 0; } /** Set the security descriptor using the current primary token for defaults. */ diff --git a/server/object.h b/server/object.h index f8fc9a8afdb4..fb3f3211faec 100644 --- a/server/object.h +++ b/server/object.h @@ -177,6 +177,9 @@ extern struct fd *no_get_fd( struct object *obj ); extern unsigned int default_map_access( struct object *obj, unsigned int access ); extern struct security_descriptor *default_get_sd( struct object *obj ); extern int default_set_sd( struct object *obj, const struct security_descriptor *sd, unsigned int set_info ); +extern struct security_descriptor *set_sd_from_token_internal( const struct security_descriptor *sd, + const struct security_descriptor *old_sd, + unsigned int set_info, struct token *token ); extern int set_sd_defaults_from_token( struct object *obj, const struct security_descriptor *sd, unsigned int set_info, struct token *token ); extern WCHAR *no_get_full_name( struct object *obj, data_size_t *ret_len ); From 80540998bd7948bae2cae5af5e29eac97aa5627f Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 30 Mar 2015 12:50:21 +0200 Subject: [PATCH 0706/2542] server: Temporarily store the full security descriptor for file objects. CW-Bug-Id: #22436 --- dlls/advapi32/tests/security.c | 184 ++++++++++++++++++++++++++++----- server/change.c | 8 +- server/file.c | 100 +++++++++++------- server/file.h | 3 +- 4 files changed, 232 insertions(+), 63 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index e215ab9e5f21..707704d0f2b0 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -3658,7 +3658,6 @@ static void test_CreateDirectoryA(void) ok(error == ERROR_SUCCESS, "GetNamedSecurityInfo failed with error %ld\n", error); bret = GetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); ok(bret, "GetAclInformation failed\n"); - todo_wine ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%ld != 0).\n", acl_size.AceCount); LocalFree(pSD); @@ -3668,15 +3667,11 @@ static void test_CreateDirectoryA(void) (PSID *)&owner, NULL, &pDacl, NULL, &pSD); todo_wine ok(error == ERROR_SUCCESS, "GetNamedSecurityInfo failed with error %ld\n", error); - if (error == ERROR_SUCCESS) - { - bret = GetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); - ok(bret, "GetAclInformation failed\n"); - todo_wine - ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%ld != 0).\n", - acl_size.AceCount); - LocalFree(pSD); - } + bret = GetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); + ok(bret, "GetAclInformation failed\n"); + ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%ld != 0).\n", + acl_size.AceCount); + LocalFree(pSD); CloseHandle(hTemp); /* Test inheritance of ACLs in NtCreateFile without security descriptor */ @@ -3746,16 +3741,154 @@ static void test_CreateDirectoryA(void) OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, (PSID *)&owner, NULL, &pDacl, NULL, &pSD); todo_wine + ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%ld != 0).\n", + acl_size.AceCount); + LocalFree(pSD); + CloseHandle(hTemp); + + /* Test inheritance of ACLs in CreateDirectory without security descriptor */ + strcpy(tmpfile, tmpdir); + lstrcatA(tmpfile, "/tmpdir"); + bret = CreateDirectoryA(tmpfile, NULL); + ok(bret == TRUE, "CreateDirectoryA failed with error %lu\n", GetLastError()); + + error = GetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, + OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, + (PSID *)&owner, NULL, &pDacl, NULL, &pSD); + ok(error == ERROR_SUCCESS, "Failed to get permissions on file\n"); + test_inherited_dacl(pDacl, admin_sid, user_sid, + OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE | INHERITED_ACE, + 0x1f01ff, TRUE, TRUE, TRUE, __LINE__); + LocalFree(pSD); + bret = RemoveDirectoryA(tmpfile); + ok(bret == TRUE, "RemoveDirectoryA failed with error %lu\n", GetLastError()); + + /* Test inheritance of ACLs in CreateDirectory with security descriptor */ + pSD = &sd; + InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION); + pDacl = HeapAlloc(GetProcessHeap(), 0, sizeof(ACL)); + bret = InitializeAcl(pDacl, sizeof(ACL), ACL_REVISION); + ok(bret, "Failed to initialize ACL\n"); + bret = SetSecurityDescriptorDacl(pSD, TRUE, pDacl, FALSE); + ok(bret, "Failed to add ACL to security desciptor\n"); + + strcpy(tmpfile, tmpdir); + lstrcatA(tmpfile, "/tmpdir1"); + + sa.nLength = sizeof(sa); + sa.lpSecurityDescriptor = pSD; + sa.bInheritHandle = TRUE; + bret = CreateDirectoryA(tmpfile, &sa); + ok(bret == TRUE, "CreateDirectoryA failed with error %lu\n", GetLastError()); + HeapFree(GetProcessHeap(), 0, pDacl); + + error = GetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, + OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, + (PSID *)&owner, NULL, &pDacl, NULL, &pSD); + ok(error == ERROR_SUCCESS, "GetNamedSecurityInfo failed with error %lu\n", error); + bret = GetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); + ok(bret, "GetAclInformation failed\n"); + ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%lu != 0).\n", + acl_size.AceCount); + LocalFree(pSD); + + SetLastError(0xdeadbeef); + bret = RemoveDirectoryA(tmpfile); + error = GetLastError(); + ok(bret == FALSE, "RemoveDirectoryA unexpected succeeded\n"); + ok(error == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %lu\n", error); + + pSD = &sd; + InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION); + pDacl = HeapAlloc(GetProcessHeap(), 0, 100); + bret = InitializeAcl(pDacl, 100, ACL_REVISION); + ok(bret, "Failed to initialize ACL.\n"); + bret = AddAccessAllowedAceEx(pDacl, ACL_REVISION, 0, GENERIC_ALL, user_sid); + ok(bret, "Failed to add Current User to ACL.\n"); + bret = SetSecurityDescriptorDacl(pSD, TRUE, pDacl, FALSE); + ok(bret, "Failed to add ACL to security desciptor.\n"); + error = SetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL, + NULL, pDacl, NULL); + ok(error == ERROR_SUCCESS, "SetNamedSecurityInfoA failed with error %lu\n", error); + HeapFree(GetProcessHeap(), 0, pDacl); + + bret = RemoveDirectoryA(tmpfile); + ok(bret == TRUE, "RemoveDirectoryA failed with error %lu\n", GetLastError()); + + /* Test inheritance of ACLs in NtCreateFile(..., FILE_DIRECTORY_FILE, ...) without security descriptor */ + strcpy(tmpfile, tmpdir); + lstrcatA(tmpfile, "/tmpdir"); + get_nt_pathW(tmpfile, &tmpfileW); + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.ObjectName = &tmpfileW; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + status = NtCreateFile(&hTemp, GENERIC_READ | DELETE, &attr, &io, NULL, FILE_ATTRIBUTE_NORMAL, + FILE_SHARE_READ, FILE_CREATE, FILE_DIRECTORY_FILE | FILE_DELETE_ON_CLOSE, NULL, 0); + ok(!status, "NtCreateFile failed with %08lx\n", status); + RtlFreeUnicodeString(&tmpfileW); + + error = GetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, + OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, + (PSID *)&owner, NULL, &pDacl, NULL, &pSD); + ok(error == ERROR_SUCCESS, "Failed to get permissions on file\n"); + test_inherited_dacl(pDacl, admin_sid, user_sid, + OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE | INHERITED_ACE, + 0x1f01ff, TRUE, TRUE, TRUE, __LINE__); + LocalFree(pSD); + CloseHandle(hTemp); + + /* Test inheritance of ACLs in NtCreateFile(..., FILE_DIRECTORY_FILE, ...) with security descriptor */ + pSD = &sd; + InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION); + pDacl = HeapAlloc(GetProcessHeap(), 0, sizeof(ACL)); + bret = InitializeAcl(pDacl, sizeof(ACL), ACL_REVISION); + ok(bret, "Failed to initialize ACL\n"); + bret = SetSecurityDescriptorDacl(pSD, TRUE, pDacl, FALSE); + ok(bret, "Failed to add ACL to security desciptor\n"); + + strcpy(tmpfile, tmpdir); + lstrcatA(tmpfile, "/tmpdir2"); + get_nt_pathW(tmpfile, &tmpfileW); + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.ObjectName = &tmpfileW; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.SecurityDescriptor = pSD; + attr.SecurityQualityOfService = NULL; + + status = NtCreateFile(&hTemp, GENERIC_READ | DELETE, &attr, &io, NULL, FILE_ATTRIBUTE_NORMAL, + FILE_SHARE_READ, FILE_CREATE, FILE_DIRECTORY_FILE | FILE_DELETE_ON_CLOSE, NULL, 0); + ok(!status, "NtCreateFile failed with %08lx\n", status); + RtlFreeUnicodeString(&tmpfileW); + HeapFree(GetProcessHeap(), 0, pDacl); + + error = GetSecurityInfo(hTemp, SE_FILE_OBJECT, + OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, + (PSID *)&owner, NULL, &pDacl, NULL, &pSD); + ok(error == ERROR_SUCCESS, "GetNamedSecurityInfo failed with error %ld\n", error); + bret = GetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); + ok(bret, "GetAclInformation failed\n"); + todo_wine + ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%ld != 0).\n", + acl_size.AceCount); + LocalFree(pSD); + + error = GetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, + OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, + (PSID *)&owner, NULL, &pDacl, NULL, &pSD); ok(error == ERROR_SUCCESS, "GetNamedSecurityInfo failed with error %ld\n", error); - if (error == ERROR_SUCCESS) - { - bret = GetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); - ok(bret, "GetAclInformation failed\n"); - todo_wine - ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%ld != 0).\n", - acl_size.AceCount); - LocalFree(pSD); - } + bret = GetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); + ok(bret, "GetAclInformation failed\n"); + todo_wine + ok(acl_size.AceCount == 0, "GetAclInformation returned unexpected entry count (%ld != 0).\n", + acl_size.AceCount); + LocalFree(pSD); CloseHandle(hTemp); done: @@ -4753,23 +4886,22 @@ static void test_GetSecurityInfo(void) bret = GetAce(pDacl, 0, (VOID **)&ace); ok(bret, "Failed to get Current User ACE.\n"); bret = EqualSid(&ace->SidStart, user_sid); - todo_wine ok(bret, "Current User ACE (%s) != Current User SID (%s).\n", - debugstr_sid(&ace->SidStart), debugstr_sid(user_sid)); + ok(bret, "Current User ACE (%s) != Current User SID (%s).\n", debugstr_sid(&ace->SidStart), debugstr_sid(user_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Current User ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); - ok(ace->Mask == 0x1f01ff, "Current User ACE has unexpected mask (0x%lx != 0x1f01ff)\n", - ace->Mask); + todo_wine ok(ace->Mask == 0x1f01ff, + "Current User ACE has unexpected mask (0x%lx != 0x1f01ff)\n", ace->Mask); } if (acl_size.AceCount > 1) { bret = GetAce(pDacl, 1, (VOID **)&ace); ok(bret, "Failed to get Administators Group ACE.\n"); bret = EqualSid(&ace->SidStart, admin_sid); - todo_wine ok(bret, "Administators Group ACE (%s) != Administators Group SID (%s).\n", debugstr_sid(&ace->SidStart), debugstr_sid(admin_sid)); + ok(bret, "Administators Group ACE (%s) != Administators Group SID (%s).\n", debugstr_sid(&ace->SidStart), debugstr_sid(admin_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Administators Group ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); - ok(ace->Mask == 0x1f01ff, "Administators Group ACE has unexpected mask (0x%lx != 0x1f01ff)\n", - ace->Mask); + todo_wine ok(ace->Mask == 0x1f01ff, + "Administators Group ACE has unexpected mask (0x%lx != 0x1f01ff)\n", ace->Mask); } LocalFree(pSD); CloseHandle(obj); diff --git a/server/change.c b/server/change.c index 6e1626a1c301..ea551676c250 100644 --- a/server/change.c +++ b/server/change.c @@ -1080,7 +1080,8 @@ static void dir_add_to_existing_notify( struct dir *dir ) #endif /* HAVE_SYS_INOTIFY_H */ -struct object *create_dir_obj( struct fd *fd, unsigned int access, mode_t mode ) +struct object *create_dir_obj( struct fd *fd, unsigned int access, mode_t mode, + const struct security_descriptor *sd ) { struct dir *dir; @@ -1100,6 +1101,11 @@ struct object *create_dir_obj( struct fd *fd, unsigned int access, mode_t mode ) dir->client_process = NULL; set_fd_user( fd, &dir_fd_ops, &dir->obj ); + if (sd) dir_set_sd( &dir->obj, sd, OWNER_SECURITY_INFORMATION | + GROUP_SECURITY_INFORMATION | + DACL_SECURITY_INFORMATION | + SACL_SECURITY_INFORMATION ); + dir_add_to_existing_notify( dir ); return &dir->obj; diff --git a/server/file.c b/server/file.c index f231681a0c95..20b974720b05 100644 --- a/server/file.c +++ b/server/file.c @@ -189,7 +189,8 @@ struct file *create_file_for_fd_obj( struct fd *fd, unsigned int access, unsigne return file; } -static struct object *create_file_obj( struct fd *fd, unsigned int access, mode_t mode ) +static struct object *create_file_obj( struct fd *fd, unsigned int access, mode_t mode, + const struct security_descriptor *sd ) { struct file *file = alloc_object( &file_ops ); @@ -201,6 +202,12 @@ static struct object *create_file_obj( struct fd *fd, unsigned int access, mode_ list_init( &file->kernel_object ); grab_object( fd ); set_fd_user( fd, &file_fd_ops, &file->obj ); + + if (sd) file_set_sd( &file->obj, sd, OWNER_SECURITY_INFORMATION | + GROUP_SECURITY_INFORMATION | + DACL_SECURITY_INFORMATION | + SACL_SECURITY_INFORMATION ); + return &file->obj; } @@ -273,11 +280,11 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si if (!fd) goto done; if (S_ISDIR(mode)) - obj = create_dir_obj( fd, access, mode ); + obj = create_dir_obj( fd, access, mode, sd ); else if (S_ISCHR(mode) && is_serial_fd( fd )) obj = create_serial( fd ); else - obj = create_file_obj( fd, access, mode ); + obj = create_file_obj( fd, access, mode, sd ); release_object( fd ); @@ -510,46 +517,66 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const struct sid *owner int set_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid, const struct security_descriptor *sd, unsigned int set_info ) { + struct security_descriptor *new_sd; int unix_fd = get_unix_fd( fd ); - const struct sid *owner; + const struct sid *owner, *group; struct stat st; mode_t new_mode; - if (unix_fd == -1 || fstat( unix_fd, &st ) == -1) return 1; + if (!set_info || unix_fd == -1 || fstat( unix_fd, &st ) == -1) return 1; + if (!obj->sd) get_file_sd( obj, fd, mode, uid ); - if (set_info & OWNER_SECURITY_INFORMATION) - { - owner = sd_get_owner( sd ); - if (!owner) - { - set_error( STATUS_INVALID_SECURITY_DESCR ); - return 0; - } - if (!obj->sd || !equal_sid( owner, sd_get_owner( obj->sd ) )) - { - /* FIXME: get Unix uid and call fchown */ - } - } - else if (obj->sd) - owner = sd_get_owner( obj->sd ); - else - owner = token_get_owner( current->process->token ); + /* calculate the new sd, save to a temporary variable before assigning */ + new_sd = set_sd_from_token_internal( sd, obj->sd, set_info, current->process->token ); + if (new_sd) + { + if (set_info & OWNER_SECURITY_INFORMATION) + { + owner = sd_get_owner( new_sd ); + assert( owner ); - /* group and sacl not supported */ + if (!obj->sd || !equal_sid( owner, sd_get_owner( obj->sd ) )) + { + /* FIXME: get Unix uid and call fchown */ + } + } - if (set_info & DACL_SECURITY_INFORMATION) - { - /* keep the bits that we don't map to access rights in the ACL */ - new_mode = st.st_mode & (S_ISUID|S_ISGID|S_ISVTX); - new_mode |= sd_to_mode( sd, owner ); + if (set_info & GROUP_SECURITY_INFORMATION) + { + group = sd_get_group( new_sd ); + assert( group ); - if (((st.st_mode ^ new_mode) & (S_IRWXU|S_IRWXG|S_IRWXO)) && fchmod( unix_fd, new_mode ) == -1) + if (!obj->sd || !equal_sid( group, sd_get_group( obj->sd ) )) + { + /* FIXME: get Unix uid and call fchown */ + } + } + + if (set_info & DACL_SECURITY_INFORMATION) { - file_set_error(); - return 0; - } - } - return 1; + owner = sd_get_owner( new_sd ); + assert( owner ); + + /* keep the bits that we don't map to access rights in the ACL */ + new_mode = st.st_mode & (S_ISUID|S_ISGID|S_ISVTX); + new_mode |= sd_to_mode( new_sd, owner ); + + if (((st.st_mode ^ new_mode) & (S_IRWXU|S_IRWXG|S_IRWXO)) && fchmod( unix_fd, new_mode ) == -1) + { + free( new_sd ); + file_set_error(); + return 0; + } + + *mode = (*mode & S_IFMT) | new_mode; + } + + free( obj->sd ); + obj->sd = new_sd; + return 1; + } + + return 0; } static struct object *file_lookup_name( struct object *obj, struct unicode_str *name, @@ -689,7 +716,10 @@ DECL_HANDLER(create_file) if ((file = create_file( root_fd, name, name_len, nt_name, req->access, req->sharing, req->create, req->options, req->attrs, sd ))) { - reply->handle = alloc_handle( current->process, file, req->access, objattr->attributes ); + if (get_error() == STATUS_OBJECT_NAME_EXISTS) + reply->handle = alloc_handle( current->process, file, req->access, objattr->attributes ); + else + reply->handle = alloc_handle_no_access_check( current->process, file, req->access, objattr->attributes ); release_object( file ); } if (root_fd) release_object( root_fd ); diff --git a/server/file.h b/server/file.h index e5367fdc5952..e7c5a32bbb5f 100644 --- a/server/file.h +++ b/server/file.h @@ -239,7 +239,8 @@ extern struct object *create_unix_device( struct object *root, const struct unic extern void do_change_notify( int unix_fd ); extern void sigio_callback(void); -extern struct object *create_dir_obj( struct fd *fd, unsigned int access, mode_t mode ); +extern struct object *create_dir_obj( struct fd *fd, unsigned int access, mode_t mode, + const struct security_descriptor *sd ); extern struct dir *get_dir_obj( struct process *process, obj_handle_t handle, unsigned int access ); /* completion */ From 5a945330291f0e17b9f97d357f8f93aa5e6a9a4f Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Mon, 30 Mar 2015 13:04:23 +0200 Subject: [PATCH 0707/2542] server: Store file security attributes with extended file attributes. (v8) CW-Bug-Id: #22436 --- server/file.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/server/file.c b/server/file.c index 20b974720b05..476f26259d67 100644 --- a/server/file.c +++ b/server/file.c @@ -31,11 +31,21 @@ #include #include #include +#include #include #ifdef HAVE_UTIME_H #include #endif #include +#ifdef HAVE_ATTR_XATTR_H +#undef XATTR_ADDITIONAL_OPTIONS +#include +#elif defined(HAVE_SYS_XATTR_H) +#include +#endif +#ifdef HAVE_SYS_EXTATTR_H +#include +#endif #include "ntstatus.h" #define WIN32_NO_STATUS @@ -63,6 +73,21 @@ struct type_descr file_type = }, }; +#ifndef XATTR_USER_PREFIX +#define XATTR_USER_PREFIX "user." +#endif +#ifndef XATTR_SIZE_MAX +#define XATTR_SIZE_MAX 65536 +#endif + +/* We intentionally do not match the Samba 4 extended attribute for NT security descriptors (SDs): + * 1) Samba stores this information using an internal data structure (we use a flat NT SD). + * 2) Samba uses the attribute "security.NTACL". This attribute is within a namespace that only + * the administrator has write access to, which prohibits the user from copying the attributes + * when copying a file and would require Wine to run with adminstrative privileges. + */ +#define WINE_XATTR_SD XATTR_USER_PREFIX "wine.sd" + struct file { struct object obj; /* object header */ @@ -217,6 +242,56 @@ int is_file_executable( const char *name ) return len >= 4 && (!strcasecmp( name + len - 4, ".exe") || !strcasecmp( name + len - 4, ".com" )); } +#ifdef HAVE_SYS_EXTATTR_H +static inline int xattr_valid_namespace( const char *name ) +{ + if (strncmp( XATTR_USER_PREFIX, name, XATTR_USER_PREFIX_LEN ) != 0) + { + errno = EPERM; + return 0; + } + return 1; +} +#endif + +static int xattr_fset( int filedes, const char *name, void *value, size_t size ) +{ +#if defined(XATTR_ADDITIONAL_OPTIONS) + return fsetxattr( filedes, name, value, size, 0, 0 ); +#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H) + return fsetxattr( filedes, name, value, size, 0 ); +#elif defined(HAVE_SYS_EXTATTR_H) + if (!xattr_valid_namespace( name )) return -1; + return extattr_set_fd( filedes, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN], + value, size ); +#else + errno = ENOSYS; + return -1; +#endif +} + +static void set_xattr_sd( int fd, const struct security_descriptor *sd ) +{ + char buffer[XATTR_SIZE_MAX]; + int present, len; + const struct acl *dacl; + + /* there's no point in storing the security descriptor if there's no DACL */ + if (!sd) return; + dacl = sd_get_dacl( sd, &present ); + if (!present || !dacl) return; + + len = 2 + sizeof(struct security_descriptor) + sd->owner_len + + sd->group_len + sd->sacl_len + sd->dacl_len; + if (len > XATTR_SIZE_MAX) return; + + /* include the descriptor revision and resource manager control bits */ + buffer[0] = SECURITY_DESCRIPTOR_REVISION; + buffer[1] = 0; + memcpy( &buffer[2], sd, len - 2 ); + xattr_fset( fd, WINE_XATTR_SD, buffer, len ); +} + static struct object *create_file( struct fd *root, const char *nameptr, data_size_t len, struct unicode_str nt_name, unsigned int access, unsigned int sharing, int create, @@ -571,6 +646,9 @@ int set_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid, *mode = (*mode & S_IFMT) | new_mode; } + /* extended attributes are set after the file mode, to ensure it stays in sync */ + set_xattr_sd( unix_fd, new_sd ); + free( obj->sd ); obj->sd = new_sd; return 1; From e7c7e397f1baef0399a7ab3745faba6ab16cf0b4 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Fri, 18 Apr 2014 14:05:32 -0600 Subject: [PATCH 0708/2542] server: Convert return of file security masks with generic access mappings. (try 7) CW-Bug-Id: #22436 --- dlls/advapi32/tests/security.c | 6 +++--- server/file.c | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 707704d0f2b0..1a2ab7df67f5 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -4889,8 +4889,8 @@ static void test_GetSecurityInfo(void) ok(bret, "Current User ACE (%s) != Current User SID (%s).\n", debugstr_sid(&ace->SidStart), debugstr_sid(user_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Current User ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); - todo_wine ok(ace->Mask == 0x1f01ff, - "Current User ACE has unexpected mask (0x%lx != 0x1f01ff)\n", ace->Mask); + ok(ace->Mask == 0x1f01ff, "Current User ACE has unexpected mask (0x%lx != 0x1f01ff)\n", + ace->Mask); } if (acl_size.AceCount > 1) { @@ -4900,7 +4900,7 @@ static void test_GetSecurityInfo(void) ok(bret, "Administators Group ACE (%s) != Administators Group SID (%s).\n", debugstr_sid(&ace->SidStart), debugstr_sid(admin_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Administators Group ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); - todo_wine ok(ace->Mask == 0x1f01ff, + ok(ace->Mask == 0x1f01ff, "Administators Group ACE has unexpected mask (0x%lx != 0x1f01ff)\n", ace->Mask); } LocalFree(pSD); diff --git a/server/file.c b/server/file.c index 476f26259d67..63f452709695 100644 --- a/server/file.c +++ b/server/file.c @@ -469,6 +469,26 @@ struct security_descriptor *mode_to_sd( mode_t mode, const struct sid *user, con return sd; } +/* Convert generic rights into standard access rights */ +static void convert_generic_sd( struct security_descriptor *sd ) +{ + const struct acl *dacl; + int present; + + dacl = sd_get_dacl( sd, &present ); + if (present && dacl) + { + const struct ace *ace = (const struct ace *)(dacl + 1); + ULONG i; + + for (i = 0; i < dacl->count; i++, ace = ace_next( ace )) + { + DWORD *mask = (DWORD *)(ace + 1); + *mask = map_access( *mask, &file_type.mapping ); + } + } +} + struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid ) { @@ -605,6 +625,9 @@ int set_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid, new_sd = set_sd_from_token_internal( sd, obj->sd, set_info, current->process->token ); if (new_sd) { + /* convert generic rights into standard access rights */ + convert_generic_sd( new_sd ); + if (set_info & OWNER_SECURITY_INFORMATION) { owner = sd_get_owner( new_sd ); From 1989aa33dd9a898f4575dfae3119fff0802864a2 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Fri, 18 Apr 2014 14:01:35 -0600 Subject: [PATCH 0709/2542] server: Retrieve file security attributes with extended file attributes. (try 7) CW-Bug-Id: #22436 --- dlls/advapi32/tests/security.c | 19 ++++++------- server/file.c | 50 ++++++++++++++++++++++++++++++++-- 2 files changed, 56 insertions(+), 13 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 1a2ab7df67f5..b683caf06b2d 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -3612,7 +3612,7 @@ static void test_CreateDirectoryA(void) } ok(!error, "GetNamedSecurityInfo failed with error %ld\n", error); test_inherited_dacl(pDacl, admin_sid, user_sid, OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE, - 0x1f01ff, FALSE, TRUE, FALSE, __LINE__); + 0x1f01ff, FALSE, FALSE, FALSE, __LINE__); LocalFree(pSD); /* Test inheritance of ACLs in CreateFile without security descriptor */ @@ -4049,21 +4049,20 @@ static void test_GetNamedSecurityInfoA(void) bret = GetAce(pDacl, 0, (VOID **)&ace); ok(bret, "Failed to get Current User ACE.\n"); bret = EqualSid(&ace->SidStart, user_sid); - todo_wine ok(bret, "Current User ACE (%s) != Current User SID (%s).\n", - debugstr_sid(&ace->SidStart), debugstr_sid(user_sid)); + ok(bret, "Current User ACE (%s) != Current User SID (%s).\n", + debugstr_sid(&ace->SidStart), debugstr_sid(user_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Current User ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); - ok(ace->Mask == 0x1f01ff, "Current User ACE has unexpected mask (0x%lx != 0x1f01ff)\n", - ace->Mask); + ok(ace->Mask == 0x1f01ff, + "Current User ACE has unexpected mask (0x%lx != 0x1f01ff)\n", ace->Mask); } if (acl_size.AceCount > 1) { bret = GetAce(pDacl, 1, (VOID **)&ace); ok(bret, "Failed to get Administators Group ACE.\n"); bret = EqualSid(&ace->SidStart, admin_sid); - todo_wine ok(bret || broken(!bret) /* win2k */, - "Administators Group ACE (%s) != Administators Group SID (%s).\n", - debugstr_sid(&ace->SidStart), debugstr_sid(admin_sid)); + ok(bret || broken(!bret) /* win2k */, "Administators Group ACE (%s) != Administators Group SID (%s).\n", + debugstr_sid(&ace->SidStart), debugstr_sid(admin_sid)); ok(((ACE_HEADER *)ace)->AceFlags == 0, "Administators Group ACE has unexpected flags (0x%x != 0x0)\n", ((ACE_HEADER *)ace)->AceFlags); ok(ace->Mask == 0x1f01ff || broken(ace->Mask == GENERIC_ALL) /* win2k */, @@ -4090,8 +4089,8 @@ static void test_GetNamedSecurityInfoA(void) { bret = GetAce(pDacl, 0, (VOID **)&ace); ok(bret, "Failed to get ACE.\n"); - todo_wine ok(((ACE_HEADER *)ace)->AceFlags & INHERITED_ACE, - "ACE has unexpected flags: 0x%x\n", ((ACE_HEADER *)ace)->AceFlags); + ok(((ACE_HEADER *)ace)->AceFlags & INHERITED_ACE, + "ACE has unexpected flags: 0x%x\n", ((ACE_HEADER *)ace)->AceFlags); } LocalFree(pSD); diff --git a/server/file.c b/server/file.c index 63f452709695..3dbf397c2257 100644 --- a/server/file.c +++ b/server/file.c @@ -44,6 +44,7 @@ #include #endif #ifdef HAVE_SYS_EXTATTR_H +#undef XATTR_ADDITIONAL_OPTIONS #include #endif @@ -76,6 +77,9 @@ struct type_descr file_type = #ifndef XATTR_USER_PREFIX #define XATTR_USER_PREFIX "user." #endif +#ifndef XATTR_USER_PREFIX_LEN +#define XATTR_USER_PREFIX_LEN (sizeof(XATTR_USER_PREFIX) - 1) +#endif #ifndef XATTR_SIZE_MAX #define XATTR_SIZE_MAX 65536 #endif @@ -254,6 +258,22 @@ static inline int xattr_valid_namespace( const char *name ) } #endif +static int xattr_fget( int filedes, const char *name, void *value, size_t size ) +{ +#if defined(XATTR_ADDITIONAL_OPTIONS) + return fgetxattr( filedes, name, value, size, 0, 0 ); +#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H) + return fgetxattr( filedes, name, value, size ); +#elif defined(HAVE_SYS_EXTATTR_H) + if (!xattr_valid_namespace( name )) return -1; + return extattr_get_fd( filedes, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN], + value, size ); +#else + errno = ENOSYS; + return -1; +#endif +} + static int xattr_fset( int filedes, const char *name, void *value, size_t size ) { #if defined(XATTR_ADDITIONAL_OPTIONS) @@ -489,6 +509,29 @@ static void convert_generic_sd( struct security_descriptor *sd ) } } +static struct security_descriptor *get_xattr_sd( int fd ) +{ + struct security_descriptor *sd; + char buffer[XATTR_SIZE_MAX]; + int n; + + n = xattr_fget( fd, WINE_XATTR_SD, buffer, sizeof(buffer) ); + if (n == -1 || n < 2 + sizeof(struct security_descriptor)) return NULL; + + /* validate that we can handle the descriptor */ + if (buffer[0] != SECURITY_DESCRIPTOR_REVISION || buffer[1] != 0 || + !sd_is_valid( (struct security_descriptor *)&buffer[2], n - 2 )) + return NULL; + + sd = mem_alloc( n - 2 ); + if (sd) + { + memcpy( sd, &buffer[2], n - 2 ); + convert_generic_sd( sd ); /* for backwards compatibility */ + } + return sd; +} + struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid ) { @@ -504,9 +547,10 @@ struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode (st.st_uid == *uid)) return obj->sd; - sd = mode_to_sd( st.st_mode, - security_unix_uid_to_sid( st.st_uid ), - token_get_primary_group( current->process->token )); + sd = get_xattr_sd( unix_fd ); + if (!sd) sd = mode_to_sd( st.st_mode, + security_unix_uid_to_sid( st.st_uid ), + token_get_primary_group( current->process->token )); if (!sd) return obj->sd; *mode = st.st_mode; From d2d5a4602be804b5bd9007c792d9ad644fb0c276 Mon Sep 17 00:00:00 2001 From: Matteo Bruni Date: Tue, 12 Sep 2023 12:06:15 +0200 Subject: [PATCH 0710/2542] kernelbase: HACK: Add --use-gl=swiftshader for Everquest F2P/LaunchPad.exe. CW-Bug-Id: #18509 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 15ee67a0a245..17b59964a143 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -602,6 +602,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) {L"PlanetSide 2\\LaunchPad.exe", L" --use-gl=swiftshader"}, {L"PaladinLias\\Game.exe", L" --use-gl=desktop"}, {L"EverQuest 2\\LaunchPad.exe", L" --use-gl=swiftshader"}, + {L"Everquest F2P\\LaunchPad.exe", L" --use-gl=swiftshader"}, }; unsigned int i; From 46d5f9b1b353748cb6e6819346ba1716f2de8aa8 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 15 Sep 2023 15:13:10 -0600 Subject: [PATCH 0711/2542] kernelbase, winex11.drv: HACK: Add --use-angle=gl for Red Tie Runner. And override Nvidia in GL so that works on Nvidia. CW-Bug-Id: #22742 --- dlls/kernelbase/process.c | 1 + dlls/winex11.drv/opengl.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 17b59964a143..42bb5be2758a 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -603,6 +603,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) {L"PaladinLias\\Game.exe", L" --use-gl=desktop"}, {L"EverQuest 2\\LaunchPad.exe", L" --use-gl=swiftshader"}, {L"Everquest F2P\\LaunchPad.exe", L" --use-gl=swiftshader"}, + {L"Red Tie Runner.exe", L" --use-angle=gl"}, }; unsigned int i; diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 458dbb36ff46..0e831e2a05c9 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -3244,7 +3244,7 @@ static const GLubyte *wglGetString(GLenum name) if ((sz = read(fd, buffer, sizeof(buffer) - 1)) > 0) { buffer[sz] = 0; - if (strstr(buffer, "\\Paradox Launcher.exe")) + if (strstr(buffer, "\\Paradox Launcher.exe") || strstr(buffer, "Red Tie Runner.exe")) { FIXME("HACK: overriding GL vendor and renderer.\n"); override_vendor = 1; From 295d10649840b23ca5cdeca5513b2f7e9ba73b98 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 15 Sep 2023 15:16:10 -0600 Subject: [PATCH 0712/2542] ntdll: HACK: Enable WINE_SIMULATE_WRITECOPY for Red Tie Runner. CW-Bug-Id: #22742 --- dlls/ntdll/unix/loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 193ec1239049..b6b4d9b91a58 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2192,6 +2192,7 @@ static void hacks_init(void) || !strcmp(sgi, "1680700") /* Purgo box */ || !strcmp(sgi, "2095300") /* Breakout 13 */ || !strcmp(sgi, "2053940") /* Idol Hands 2 */ + || !strcmp(sgi, "391150") /* Red Tie Runner */ || !strcmp(sgi, "2176450"); /* Mr. Hopp's Playhouse 3 */ if (main_argc > 1 && strstr(main_argv[1], "MicrosoftEdgeUpdate.exe")) From 74b842fad1c8a2965ca29defcad8983e608547e7 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 20 Sep 2023 15:45:43 -0600 Subject: [PATCH 0713/2542] wine.inf: Set FLG_HEAP_ENABLE_FREE_CHECK for Crysis 2 Remastered. CW-Bug-Id: #22761 --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 9f5d05236a5d..3e56b5979ee6 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -447,6 +447,7 @@ HKLM,%CurrentVersionNT%\ProfileList,,16 HKLM,%CurrentVersionNT%\Winlogon,"Shell",,"explorer.exe" ;; App specific heap debug flags HKLM,%CurrentVersionNT%\Image File Execution Options\ChaosCode.exe,GlobalFlag,0x00040002,0x00000020 +HKLM,%CurrentVersionNT%\Image File Execution Options\Crysis2Remastered.exe,GlobalFlag,0x00040002,0x00000020 [CurrentVersionWow64.ntamd64] HKLM,%CurrentVersion%,"ProgramFilesDir (x86)",,"%16426%" From db2d784f18f8d431fed34c97174757c2ad36664a Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 11 Sep 2020 17:55:59 +1000 Subject: [PATCH 0714/2542] include: Remove interfaces already define in msxml6.idl Signed-off-by: Alistair Leslie-Hughes CW-Bug-Id: #22822 --- dlls/msxml3/factory.c | 3 +- dlls/msxml3/tests/saxreader.c | 1 + dlls/msxml3/tests/schema.c | 5 ++ dlls/msxml3/uuid.c | 10 ++++ include/msxml2.idl | 101 ---------------------------------- include/msxml6.idl | 24 ++++---- 6 files changed, 29 insertions(+), 115 deletions(-) diff --git a/dlls/msxml3/factory.c b/dlls/msxml3/factory.c index e91666c6d792..e35839db2a3a 100644 --- a/dlls/msxml3/factory.c +++ b/dlls/msxml3/factory.c @@ -31,6 +31,7 @@ #include "ole2.h" #include "msxml.h" #include "msxml2.h" +#include "msxml6.h" #include "xmlparser.h" /* undef the #define in msxml2 so that we can access the v.2 version @@ -43,8 +44,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml); -extern GUID CLSID_XMLSchemaCache60; - typedef HRESULT (*ClassFactoryCreateInstanceFunc)(void**); typedef HRESULT (*DOMFactoryCreateInstanceFunc)(MSXML_VERSION, void**); diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index e123d4eba5af..48cfa8f55930 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -29,6 +29,7 @@ #include "windows.h" #include "ole2.h" #include "msxml2.h" +#include "msxml6.h" #include "msxml2did.h" #include "ocidl.h" #include "dispex.h" diff --git a/dlls/msxml3/tests/schema.c b/dlls/msxml3/tests/schema.c index 50e5a743b82f..c83e72e136a3 100644 --- a/dlls/msxml3/tests/schema.c +++ b/dlls/msxml3/tests/schema.c @@ -32,6 +32,11 @@ #include "dispex.h" #include "cguid.h" +DEFINE_GUID(CLSID_MXXMLWriter60, 0x88d96a0f, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_SAXAttributes60, 0x88d96a0e, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_SAXXMLReader60, 0x88d96a0c, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_XMLSchemaCache60, 0x88d96a07, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); + #include "wine/test.h" static const WCHAR xdr_schema1_uri[] = L"x-schema:test1.xdr"; diff --git a/dlls/msxml3/uuid.c b/dlls/msxml3/uuid.c index 7e50b439146d..7214d23c5dc5 100644 --- a/dlls/msxml3/uuid.c +++ b/dlls/msxml3/uuid.c @@ -41,6 +41,16 @@ #include "initguid.h" #include "msxml2.h" +/* Cannot include msxml6 here since we will get a duplicate LIBID_MSXML2 error. */ +DEFINE_GUID(CLSID_FreeThreadedDOMDocument60, 0x88d96a06, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_MXNamespaceManager60, 0x88d96a11, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_MXXMLWriter60, 0x88d96a0f, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_SAXAttributes60, 0x88d96a0e, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_SAXXMLReader60, 0x88d96a0c, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_ServerXMLHTTP60, 0x88d96a0b, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_XMLHTTP60, 0x88d96a0a, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_XSLTemplate60, 0x88d96a08, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); + /* * Note that because of a #define in msxml2.h, we end up initializing * CLSID_DOMDocument2 to be the v.3 version independent DOMDocument diff --git a/include/msxml2.idl b/include/msxml2.idl index 848bc13952a1..85bb6a5b0cb7 100644 --- a/include/msxml2.idl +++ b/include/msxml2.idl @@ -1612,15 +1612,6 @@ coclass FreeThreadedDOMDocument40 [default, source] dispinterface XMLDOMDocumentEvents; } -[ - uuid(88d96a06-f192-11d4-a65f-0040963251e5), -] -coclass FreeThreadedDOMDocument60 -{ - [default] interface IXMLDOMDocument3; - [default, source] dispinterface XMLDOMDocumentEvents; -} - [ helpstring("Free threaded XML DOM Document"), progid("Msxml2.FreeThreadedDOMDocument"), @@ -1662,14 +1653,6 @@ coclass XMLHTTP40 [default] interface IXMLHTTPRequest; } -[ - uuid(88d96a0a-f192-11d4-a65f-0040963251e5) -] -coclass XMLHTTP60 -{ - [default] interface IXMLHTTPRequest; -} - [ helpstring("XML HTTP"), progid("Msxml2.XMLHTTP"), @@ -1702,14 +1685,6 @@ coclass ServerXMLHTTP40 [default] interface IServerXMLHTTPRequest2; } -[ - uuid(88d96a0b-f192-11d4-a65f-0040963251e5) -] -coclass ServerXMLHTTP60 -{ - [default] interface IServerXMLHTTPRequest2; -} - [ helpstring("Server XML HTTP"), progid("Msxml2.ServerXMLHTTP"), @@ -1790,14 +1765,6 @@ coclass XSLTemplate40 [default] interface IXSLTemplate; } -[ - uuid(88d96a08-f192-11d4-a65f-0040963251e5) -] -coclass XSLTemplate60 -{ - [default] interface IXSLTemplate; -} - [ helpstring("XSL Template"), progid("Msxml2.XSLTemplate"), @@ -3289,15 +3256,6 @@ coclass SAXXMLReader40 interface ISAXXMLReader; } -[ - uuid(88d96a0c-f192-11d4-a65f-0040963251e5) -] -coclass SAXXMLReader60 -{ - [default] interface IVBSAXXMLReader; - interface ISAXXMLReader; -} - [ helpstring("SAX XML Reader"), progid("Msxml2.SAXXMLReader"), @@ -3372,26 +3330,6 @@ coclass MXHTMLWriter40 interface IVBSAXLexicalHandler; } -[ - uuid(88d96a10-f192-11d4-a65f-0040963251e5) -] -coclass MXHTMLWriter60 -{ - [default] interface IMXWriter; - - interface ISAXContentHandler; - interface ISAXDeclHandler; - interface ISAXDTDHandler; - interface ISAXErrorHandler; - interface ISAXLexicalHandler; - - interface IVBSAXContentHandler; - interface IVBSAXDeclHandler; - interface IVBSAXDTDHandler; - interface IVBSAXErrorHandler; - interface IVBSAXLexicalHandler; -} - [ helpstring("MXXMLWriter 3.0"), progid("Msxml2.MXXMLWriter.3.0"), @@ -3436,26 +3374,6 @@ coclass MXXMLWriter40 interface IVBSAXLexicalHandler; } -[ - uuid(88d96a0f-f192-11d4-a65f-0040963251e5) -] -coclass MXXMLWriter60 -{ - [default] interface IMXWriter; - - interface ISAXContentHandler; - interface ISAXDeclHandler; - interface ISAXDTDHandler; - interface ISAXErrorHandler; - interface ISAXLexicalHandler; - - interface IVBSAXContentHandler; - interface IVBSAXDeclHandler; - interface IVBSAXDTDHandler; - interface IVBSAXErrorHandler; - interface IVBSAXLexicalHandler; -} - [ helpstring("MXXMLWriter"), progid("Msxml2.MXXMLWriter"), @@ -3498,15 +3416,6 @@ coclass MXNamespaceManager40 interface IMXNamespaceManager; } -[ - uuid(88d96a11-f192-11d4-a65f-0040963251e5) -] -coclass MXNamespaceManager60 -{ - [default] interface IVBMXNamespaceManager; - interface IMXNamespaceManager; -} - [ helpstring("SAXAttributes 3.0"), progid("Msxml2.SAXAttributes.3.0"), @@ -3531,16 +3440,6 @@ coclass SAXAttributes40 interface ISAXAttributes; } -[ - uuid(88d96a0e-f192-11d4-a65f-0040963251e5) -] -coclass SAXAttributes60 -{ - [default] interface IMXAttributes; - interface IVBSAXAttributes; - interface ISAXAttributes; -} - [ helpstring("SAXAttributes"), progid("Msxml2.SAXAttributes"), diff --git a/include/msxml6.idl b/include/msxml6.idl index ead87be7516e..bf7e0905057e 100644 --- a/include/msxml6.idl +++ b/include/msxml6.idl @@ -3065,18 +3065,6 @@ coclass DOMDocument60 [default, source] dispinterface XMLDOMDocumentEvents; } -[ - helpstring("Free threaded XML DOM Document 6.0"), - progid("Msxml2.FreeThreadedDOMDocument.6.0"), - threading(both), - uuid(88d96a06-f192-11d4-a65f-0040963251e5), -] -coclass FreeThreadedDOMDocument60 -{ - [default] interface IXMLDOMDocument3; - [default, source] dispinterface XMLDOMDocumentEvents; -} - [ helpstring("SAX XML Reader 6.0"), progid("Msxml2.SAXXMLReader.6.0"), @@ -3182,6 +3170,18 @@ coclass XSLTemplate60 [default] interface IXSLTemplate; } +[ + helpstring("Free threaded XML DOM Document 6.0"), + progid("Msxml2.FreeThreadedDOMDocument.6.0"), + threading(both), + uuid(88d96a06-f192-11d4-a65f-0040963251e5), +] +coclass FreeThreadedDOMDocument60 +{ + [default] interface IXMLDOMDocument3; + [default, source] dispinterface XMLDOMDocumentEvents; +} + [ helpstring("XML HTTP 6.0"), progid("Msxml2.XMLHTTP.6.0"), From 17e2884193444e66c0c2f162824465af4b31ea58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 8 Sep 2020 18:43:52 +0200 Subject: [PATCH 0715/2542] msxml3: Implement FreeThreadedXMLHTTP60. Update from Gijs Vermeulen CW-Bug-Id: #22822 --- dlls/msxml3/Makefile.in | 2 +- dlls/msxml3/factory.c | 5 + dlls/msxml3/httprequest.c | 495 +++++++++++++++++++++++++++++++++++- dlls/msxml3/msxml_private.h | 1 + dlls/msxml3/tests/httpreq.c | 395 +++++++++++++++++++++++++++- dlls/msxml3/tests/schema.c | 6 + dlls/msxml3/uuid.c | 5 + include/msxml6.idl | 22 +- 8 files changed, 915 insertions(+), 16 deletions(-) diff --git a/dlls/msxml3/Makefile.in b/dlls/msxml3/Makefile.in index 7e59a2231431..5044c4e2c79d 100644 --- a/dlls/msxml3/Makefile.in +++ b/dlls/msxml3/Makefile.in @@ -1,5 +1,5 @@ MODULE = msxml3.dll -IMPORTS = $(XSLT_PE_LIBS) $(XML2_PE_LIBS) uuid urlmon shlwapi oleaut32 ole32 user32 advapi32 +IMPORTS = $(XSLT_PE_LIBS) $(XML2_PE_LIBS) uuid urlmon shlwapi oleaut32 ole32 user32 advapi32 rtworkq EXTRAINCL = $(XSLT_PE_CFLAGS) $(XML2_PE_CFLAGS) SOURCES = \ diff --git a/dlls/msxml3/factory.c b/dlls/msxml3/factory.c index e35839db2a3a..0e2482d61bed 100644 --- a/dlls/msxml3/factory.c +++ b/dlls/msxml3/factory.c @@ -279,6 +279,7 @@ static HRESULT DOMClassFactory_Create(const GUID *clsid, REFIID riid, void **ppv static ClassFactory xmldoccf = { { &ClassFactoryVtbl }, XMLDocument_create }; static ClassFactory httpreqcf = { { &ClassFactoryVtbl }, XMLHTTPRequest_create }; +static ClassFactory httpreqcf2 = { { &ClassFactoryVtbl }, XMLHTTPRequest2_create }; static ClassFactory serverhttp = { { &ClassFactoryVtbl }, ServerXMLHTTP_create }; static ClassFactory xsltemplatecf = { { &ClassFactoryVtbl }, XSLTemplate_create }; static ClassFactory mxnsmanagercf = { {&ClassFactoryVtbl }, MXNamespaceManager_create }; @@ -340,6 +341,10 @@ HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, void **ppv ) { cf = &httpreqcf.IClassFactory_iface; } + else if( IsEqualCLSID( rclsid, &CLSID_FreeThreadedXMLHTTP60 )) + { + cf = &httpreqcf2.IClassFactory_iface; + } else if( IsEqualCLSID( rclsid, &CLSID_ServerXMLHTTP ) || IsEqualCLSID( rclsid, &CLSID_ServerXMLHTTP30 ) || IsEqualCLSID( rclsid, &CLSID_ServerXMLHTTP40 ) || diff --git a/dlls/msxml3/httprequest.c b/dlls/msxml3/httprequest.c index 6e4ab4c6519b..8f7e4b74ea40 100644 --- a/dlls/msxml3/httprequest.c +++ b/dlls/msxml3/httprequest.c @@ -37,10 +37,12 @@ #include "shlwapi.h" #include "msxml_dispex.h" +#include "initguid.h" +#include "rtworkq.h" #include "wine/debug.h" -WINE_DEFAULT_DEBUG_CHANNEL(msxml); +WINE_DEFAULT_DEBUG_CHANNEL(xmlhttp); static const WCHAR colspaceW[] = {':',' ',0}; static const WCHAR crlfW[] = {'\r','\n',0}; @@ -2054,6 +2056,468 @@ static const struct IServerXMLHTTPRequestVtbl ServerXMLHTTPRequestVtbl = ServerXMLHTTPRequest_setOption }; +static DWORD xhr2_work_queue; + +struct xml_http_request_2 +{ + httprequest req; + IXMLHTTPRequest3 IXMLHTTPRequest3_iface; + IRtwqAsyncCallback IRtwqAsyncCallback_iface; + IDispatch IDispatch_iface; + + IXMLHTTPRequest2Callback *callback; + IXMLHTTPRequest3Callback *callback3; + ISequentialStream *response_body; + ISequentialStream *request_body; + ULONGLONG request_body_size; +}; + +static inline struct xml_http_request_2 *impl_from_IXMLHTTPRequest3(IXMLHTTPRequest3 *iface) +{ + return CONTAINING_RECORD(iface, struct xml_http_request_2, IXMLHTTPRequest3_iface); +} + +static inline struct xml_http_request_2 *xml_http_request_2_from_IRtwqAsyncCallback(IRtwqAsyncCallback *iface) +{ + return CONTAINING_RECORD(iface, struct xml_http_request_2, IRtwqAsyncCallback_iface); +} + +static inline struct xml_http_request_2 *xml_http_request_2_from_IDispatch(IDispatch *iface) +{ + return CONTAINING_RECORD(iface, struct xml_http_request_2, IDispatch_iface); +} + +static HRESULT WINAPI xml_http_request_2_QueryInterface(IXMLHTTPRequest3 *iface, REFIID riid, void **obj) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); + + if (IsEqualGUID(riid, &IID_IXMLHTTPRequest3) || IsEqualGUID(riid, &IID_IXMLHTTPRequest2) + || IsEqualGUID(riid, &IID_IUnknown)) + { + *obj = iface; + IUnknown_AddRef((IUnknown*)*obj); + return S_OK; + } + + FIXME("Unsupported interface %s\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI xml_http_request_2_AddRef(IXMLHTTPRequest3 *iface) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + ULONG ref = InterlockedIncrement(&This->req.ref); + TRACE("(%p)->(%lu)\n", This, ref); + return ref; +} + +static ULONG WINAPI xml_http_request_2_Release(IXMLHTTPRequest3 *iface) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + ULONG ref = InterlockedDecrement(&This->req.ref); + + TRACE("(%p)->(%lu)\n", This, ref); + + if (ref == 0) + { + /* do not call httprequest_put_onreadystatechange to avoid ref cycle */ + This->req.sink = NULL; + if (This->response_body) ISequentialStream_Release(This->response_body); + if (This->request_body) ISequentialStream_Release(This->request_body); + if (This->callback3) IXMLHTTPRequest3Callback_Release(This->callback3); + if (This->callback) IXMLHTTPRequest2Callback_Release(This->callback); + free(This); + RtwqShutdown(); + } + + return ref; +} + +static HRESULT WINAPI xml_http_request_2_Open(IXMLHTTPRequest3 *iface, const WCHAR *method, + const WCHAR *url, IXMLHTTPRequest2Callback *callback, + const WCHAR *username, const WCHAR *password, + const WCHAR *proxy_username, const WCHAR *proxy_password) +{ + static const WCHAR accept_encoding[] = {'A','c','c','e','p','t','-','E','n','c','o','d','i','n','g',0}; + static const WCHAR empty = 0; + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + VARIANT async_v, username_v, password_v; + HRESULT hr; + + TRACE("(%p)->(%s %s %p %s %s %s %s)\n", This, debugstr_w(method), debugstr_w(url), callback, + debugstr_w(username), debugstr_w(password), debugstr_w(proxy_username), debugstr_w(proxy_password)); + + if (This->callback) IXMLHTTPRequest2Callback_Release(This->callback); + if (This->callback3) IXMLHTTPRequest3Callback_Release(This->callback3); + IXMLHTTPRequest2Callback_AddRef(callback); + This->callback = callback; + if (FAILED(IXMLHTTPRequest2Callback_QueryInterface(callback, &IID_IXMLHTTPRequest3Callback, (void **)&This->callback3))) + This->callback3 = NULL; + + if (proxy_username || proxy_password) FIXME("proxy credentials not implemented\n"); + + VariantInit(&async_v); + V_VT(&async_v) = VT_BOOL; + V_BOOL(&async_v) = FALSE; /* FIXME: TRUE needs a RTWQ_WINDOW_WORKQUEUE */ + + VariantInit(&username_v); + V_VT(&username_v) = VT_BSTR; + if (username) V_BSTR(&username_v) = SysAllocString(username); + else V_BSTR(&username_v) = SysAllocString(&empty); + + VariantInit(&password_v); + V_VT(&password_v) = VT_BSTR; + if (password) V_BSTR(&password_v) = SysAllocString(password); + else V_BSTR(&password_v) = SysAllocString(&empty); + + if (FAILED(hr = httprequest_open(&This->req, (BSTR)method, (BSTR)url, async_v, username_v, password_v))) + return hr; + return httprequest_setRequestHeader(&This->req, (BSTR)accept_encoding, (BSTR)&empty); +} + +static HRESULT WINAPI xml_http_request_2_Send(IXMLHTTPRequest3 *iface, ISequentialStream *body, ULONGLONG body_size) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + IRtwqAsyncResult *result; + HRESULT hr; + + TRACE("(%p)->(%p %s)\n", This, body, wine_dbgstr_longlong( body_size )); + + if (body_size) + { + ISequentialStream_AddRef(body); + This->request_body = body; + This->request_body_size = body_size; + } + + if (FAILED(hr = RtwqCreateAsyncResult(NULL, &This->IRtwqAsyncCallback_iface, NULL, &result))) + return hr; + // IRtwqAsyncCallback_Invoke(&This->IRtwqAsyncCallback_iface, result); + hr = RtwqPutWorkItem(xhr2_work_queue, 0, result); + if (result) IRtwqAsyncResult_Release(result); + + return hr; +} + +static HRESULT WINAPI xml_http_request_2_Abort(IXMLHTTPRequest3 *iface) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + TRACE("(%p) stub!\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI xml_http_request_2_SetCookie(IXMLHTTPRequest3 *iface, const XHR_COOKIE *cookie, DWORD *state) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + FIXME("(%p)->(%p %p) stub!\n", This, cookie, state); + return E_NOTIMPL; +} + +static HRESULT WINAPI xml_http_request_2_SetCustomResponseStream(IXMLHTTPRequest3 *iface, ISequentialStream *stream) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + FIXME("(%p)->(%p) stub!\n", This, stream); + return E_NOTIMPL; +} + +static HRESULT WINAPI xml_http_request_2_SetProperty(IXMLHTTPRequest3 *iface, XHR_PROPERTY property, ULONGLONG value) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + FIXME("(%p)->(%#x %s) stub!\n", This, property, wine_dbgstr_longlong( value )); + return E_NOTIMPL; +} + +static HRESULT WINAPI xml_http_request_2_SetRequestHeader(IXMLHTTPRequest3 *iface, + const WCHAR *header, const WCHAR *value) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + TRACE("(%p)->(%s %s)\n", This, debugstr_w(header), debugstr_w(value)); + return httprequest_setRequestHeader(&This->req, (BSTR)header, (BSTR)value); +} + +static HRESULT WINAPI xml_http_request_2_GetAllResponseHeaders(IXMLHTTPRequest3 *iface, WCHAR **headers) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + FIXME("(%p)->(%p) stub!\n", This, headers); + return E_NOTIMPL; +} + +static HRESULT WINAPI xml_http_request_2_GetCookie(IXMLHTTPRequest3 *iface, const WCHAR *url, + const WCHAR *name, DWORD flags, + ULONG *cookies_count, XHR_COOKIE **cookies) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + FIXME("(%p)->(%s %s %ld %p %p) stub!\n", This, debugstr_w(url), debugstr_w(name), flags, cookies_count, cookies); + return E_NOTIMPL; +} + +static HRESULT WINAPI xml_http_request_2_GetResponseHeader(IXMLHTTPRequest3 *iface, + const WCHAR *header, WCHAR **value) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + HRESULT hr; + + TRACE("(%p)->(%s %p)\n", This, debugstr_w(header), value); + + if (FAILED(hr = httprequest_getResponseHeader(&This->req, (BSTR)header, value))) + return hr; + +#define E_FILE_NOT_FOUND _HRESULT_TYPEDEF_(0x80070002) + + if (hr == S_FALSE) + { + *value = NULL; + return E_FILE_NOT_FOUND; + } + + return hr; +} + +static HRESULT WINAPI xml_http_request_3_SetClientCertificate(IXMLHTTPRequest3 *iface, DWORD count, const BYTE *hashes, const WCHAR *pin) +{ + struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); + FIXME("(%p)->(%ld %p %s) stub!\n", This, count, hashes, debugstr_w(pin)); + return E_NOTIMPL; +} + +static const struct IXMLHTTPRequest3Vtbl XMLHTTPRequest3Vtbl = { + /* IUnknown methods */ + xml_http_request_2_QueryInterface, + xml_http_request_2_AddRef, + xml_http_request_2_Release, + /* IXMLHTTPRequest2 methods */ + xml_http_request_2_Open, + xml_http_request_2_Send, + xml_http_request_2_Abort, + xml_http_request_2_SetCookie, + xml_http_request_2_SetCustomResponseStream, + xml_http_request_2_SetProperty, + xml_http_request_2_SetRequestHeader, + xml_http_request_2_GetAllResponseHeaders, + xml_http_request_2_GetCookie, + xml_http_request_2_GetResponseHeader, + /* IXMLHTTPRequest3 methods */ + xml_http_request_3_SetClientCertificate, +}; + +static HRESULT WINAPI xml_http_request_2_IRtwqAsyncCallback_QueryInterface(IRtwqAsyncCallback *iface, REFIID riid, void **obj) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IRtwqAsyncCallback(iface); + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); + + if (IsEqualGUID(riid, &IID_IRtwqAsyncCallback) || IsEqualGUID(riid, &IID_IUnknown)) + { + IRtwqAsyncCallback_AddRef(iface); + *obj = iface; + return S_OK; + } + + FIXME("Unsupported interface %s\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI xml_http_request_2_IRtwqAsyncCallback_AddRef(IRtwqAsyncCallback *iface) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IRtwqAsyncCallback(iface); + TRACE("(%p)\n", This); + return xml_http_request_2_AddRef(&This->IXMLHTTPRequest3_iface); +} + +static ULONG WINAPI xml_http_request_2_IRtwqAsyncCallback_Release(IRtwqAsyncCallback *iface) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IRtwqAsyncCallback(iface); + TRACE("(%p)\n", This); + return xml_http_request_2_Release(&This->IXMLHTTPRequest3_iface); +} + +static HRESULT WINAPI xml_http_request_2_IRtwqAsyncCallback_GetParameters(IRtwqAsyncCallback *iface, + DWORD *flags, DWORD *queue) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IRtwqAsyncCallback(iface); + + TRACE("(%p)->(%p %p)\n", This, flags, queue); + + *flags = 0; + *queue = xhr2_work_queue; + return S_OK; +} + +static HRESULT WINAPI xml_http_request_2_IRtwqAsyncCallback_Invoke(IRtwqAsyncCallback *iface, + IRtwqAsyncResult *result) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IRtwqAsyncCallback(iface); + VARIANT body_v; + HRESULT hr; + ULONG read; + + TRACE("(%p)->(%p)\n", This, result); + + VariantInit(&body_v); + + if (This->request_body) + { + V_VT(&body_v) = VT_BSTR; + V_BSTR(&body_v) = CoTaskMemAlloc(This->request_body_size); + + if (FAILED(hr = ISequentialStream_Read(This->request_body, V_BSTR(&body_v), This->request_body_size, &read)) || + read < This->request_body_size) + { + ERR("Failed to allocate request body memory, hr %#lx\n", hr); + CoTaskMemFree(V_BSTR(&body_v)); + goto done; + } + + ISequentialStream_Release(This->request_body); + This->request_body = NULL; + } + + hr = httprequest_send(&This->req, body_v); + +done: + return IRtwqAsyncResult_SetStatus(result, hr); +} + +static const struct IRtwqAsyncCallbackVtbl xml_http_request_2_IRtwqAsyncCallbackVtbl = { + /* IUnknown methods */ + xml_http_request_2_IRtwqAsyncCallback_QueryInterface, + xml_http_request_2_IRtwqAsyncCallback_AddRef, + xml_http_request_2_IRtwqAsyncCallback_Release, + /* IRtwqAsyncCallback methods */ + xml_http_request_2_IRtwqAsyncCallback_GetParameters, + xml_http_request_2_IRtwqAsyncCallback_Invoke, +}; + +static HRESULT WINAPI xml_http_request_2_IDispatch_QueryInterface(IDispatch *iface, REFIID riid, void **obj) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface); + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); + + if (IsEqualGUID(riid, &IID_IDispatch) || IsEqualGUID(riid, &IID_IUnknown)) + { + IDispatch_AddRef(iface); + *obj = iface; + return S_OK; + } + + FIXME("Unsupported interface %s\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI xml_http_request_2_IDispatch_AddRef(IDispatch *iface) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface); + TRACE("(%p)\n", This); + return xml_http_request_2_AddRef(&This->IXMLHTTPRequest3_iface); +} + +static ULONG WINAPI xml_http_request_2_IDispatch_Release(IDispatch *iface) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface); + TRACE("(%p)\n", This); + return xml_http_request_2_Release(&This->IXMLHTTPRequest3_iface); +} + +static HRESULT WINAPI xml_http_request_2_IDispatch_GetTypeInfoCount(IDispatch *iface, UINT *value) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface); + FIXME("(%p)->(%p) stub!\n", This, value); + *value = 0; + return S_OK; +} + +static HRESULT WINAPI xml_http_request_2_IDispatch_GetTypeInfo(IDispatch *iface, UINT index, + LCID lcid, ITypeInfo **value) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface); + FIXME("(%p)->(%d %lu %p) stub!\n", This, index, lcid, value); + *value = NULL; + return S_OK; +} + +static HRESULT WINAPI xml_http_request_2_IDispatch_GetIDsOfNames(IDispatch *iface, REFIID riid, + OLECHAR **names, UINT names_count, + LCID lcid, DISPID *disp_ids) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface); + FIXME("(%p)->(%s %p %d %lu %p) stub!\n", This, debugstr_guid(riid), names, names_count, lcid, disp_ids); + return S_OK; +} + +static HRESULT WINAPI xml_http_request_2_IDispatch_Invoke(IDispatch *iface, DISPID id, REFIID riid, + LCID lcid, WORD flags, DISPPARAMS *params, + VARIANT *result, EXCEPINFO *exception, UINT *arg_err) +{ + struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface); + IXMLHTTPRequest2 *xhr2_iface = (IXMLHTTPRequest2*)&This->IXMLHTTPRequest3_iface; + HRESULT hr; + LONG status; + BSTR status_str = NULL; + + TRACE("(%p)->(%ld %s %lu %d %p %p %p %p) stub!\n", This, id, debugstr_guid(riid), lcid, flags, + params, result, exception, arg_err); + + if (This->req.state == READYSTATE_COMPLETE) + { + VARIANT body_v; + VariantInit(&body_v); + + IXMLHTTPRequest2Callback_AddRef(This->callback); + if (This->callback3) + { + IXMLHTTPRequest3Callback_AddRef(This->callback3); + IXMLHTTPRequest3Callback_OnServerCertificateReceived(This->callback3, (IXMLHTTPRequest3 *)xhr2_iface, 0, 1, NULL); + IXMLHTTPRequest3Callback_Release(This->callback3); + } + + if (FAILED(hr = httprequest_get_status(&This->req, &status)) || + FAILED(hr = httprequest_get_statusText(&This->req, &status_str))) + { + WARN("failed to get response status, error %#lx\n", hr); + IXMLHTTPRequest2Callback_OnError(This->callback, xhr2_iface, hr); + IXMLHTTPRequest2Callback_Release(This->callback); + return S_OK; + } + + IXMLHTTPRequest2Callback_OnHeadersAvailable(This->callback, xhr2_iface, status, status_str); + SysFreeString(status_str); + + if (This->response_body) ISequentialStream_Release(This->response_body); + This->response_body = NULL; + + if (FAILED(hr = httprequest_get_responseStream(&This->req, &body_v)) || + FAILED(hr = IUnknown_QueryInterface(V_UNKNOWN(&body_v), &IID_ISequentialStream, (void **)&This->response_body))) + { + WARN("failed to get response stream, error %#lx\n", hr); + IXMLHTTPRequest2Callback_OnError(This->callback, xhr2_iface, hr); + IXMLHTTPRequest2Callback_Release(This->callback); + return S_OK; + } + + IXMLHTTPRequest2Callback_OnDataAvailable(This->callback, xhr2_iface, This->response_body); + IXMLHTTPRequest2Callback_OnResponseReceived(This->callback, xhr2_iface, This->response_body); + IXMLHTTPRequest2Callback_Release(This->callback); + } + + return S_OK; +} + +static const struct IDispatchVtbl xml_http_request_2_IDispatchVtbl = { + /* IUnknown methods */ + xml_http_request_2_IDispatch_QueryInterface, + xml_http_request_2_IDispatch_AddRef, + xml_http_request_2_IDispatch_Release, + /* IDispatch methods */ + xml_http_request_2_IDispatch_GetTypeInfoCount, + xml_http_request_2_IDispatch_GetTypeInfo, + xml_http_request_2_IDispatch_GetIDsOfNames, + xml_http_request_2_IDispatch_Invoke, +}; + static void init_httprequest(httprequest *req) { req->IXMLHTTPRequest_iface.lpVtbl = &XMLHTTPRequestVtbl; @@ -2103,6 +2567,35 @@ HRESULT XMLHTTPRequest_create(void **obj) return S_OK; } +HRESULT XMLHTTPRequest2_create(void **obj) +{ + struct xml_http_request_2 *xhr2; + TRACE("(%p)\n", obj); + + if (!(xhr2 = calloc(1, sizeof(*xhr2)))) return E_OUTOFMEMORY; + + init_httprequest(&xhr2->req); + xhr2->IXMLHTTPRequest3_iface.lpVtbl = &XMLHTTPRequest3Vtbl; + xhr2->IRtwqAsyncCallback_iface.lpVtbl = &xml_http_request_2_IRtwqAsyncCallbackVtbl; + xhr2->IDispatch_iface.lpVtbl = &xml_http_request_2_IDispatchVtbl; + + /* do not call httprequest_put_onreadystatechange to avoid ref cycle */ + xhr2->req.sink = &xhr2->IDispatch_iface; + + xhr2->callback = NULL; + xhr2->callback3 = NULL; + xhr2->request_body = NULL; + xhr2->response_body = NULL; + + /* for async http requests we need window message queue */ + RtwqStartup(); + if (!xhr2_work_queue) RtwqAllocateWorkQueue(RTWQ_MULTITHREADED_WORKQUEUE, &xhr2_work_queue); + + *obj = &xhr2->IXMLHTTPRequest3_iface; + TRACE("returning iface %p\n", *obj); + return S_OK; +} + HRESULT ServerXMLHTTP_create(void **obj) { serverhttp *req; diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h index ea492bc6b36d..c28275638845 100644 --- a/dlls/msxml3/msxml_private.h +++ b/dlls/msxml3/msxml_private.h @@ -343,6 +343,7 @@ extern HRESULT XMLDocument_create(void**); extern HRESULT SAXXMLReader_create(MSXML_VERSION, void**); extern HRESULT SAXAttributes_create(MSXML_VERSION, void**); extern HRESULT XMLHTTPRequest_create(void **); +extern HRESULT XMLHTTPRequest2_create(void **); extern HRESULT ServerXMLHTTP_create(void **); extern HRESULT XSLTemplate_create(void**); extern HRESULT MXWriter_create(MSXML_VERSION, void**); diff --git a/dlls/msxml3/tests/httpreq.c b/dlls/msxml3/tests/httpreq.c index bccfbaf582a1..23d7680d1965 100644 --- a/dlls/msxml3/tests/httpreq.c +++ b/dlls/msxml3/tests/httpreq.c @@ -26,9 +26,9 @@ #include #include "windows.h" - #include "msxml2.h" -#include "msxml2did.h" +#include "msxml6.h" +#include "msxml6did.h" #include "dispex.h" #include "initguid.h" @@ -1344,6 +1344,17 @@ static IXMLHttpRequest *create_xhr(void) return SUCCEEDED(hr) ? ret : NULL; } +static IXMLHTTPRequest2 *create_xhr2(void) +{ + IXMLHTTPRequest2 *ret; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_FreeThreadedXMLHTTP60, NULL, CLSCTX_INPROC_SERVER, + &IID_IXMLHTTPRequest2, (void**)&ret); + + return SUCCEEDED(hr) ? ret : NULL; +} + static IServerXMLHTTPRequest *create_server_xhr(void) { IServerXMLHTTPRequest *ret; @@ -1904,11 +1915,388 @@ static void test_supporterrorinfo(void) IServerXMLHTTPRequest_Release(server_xhr); } +struct xhr3_callback +{ + IXMLHTTPRequest3Callback IXMLHTTPRequest3Callback_iface; + LONG ref; + HANDLE event; +}; + +static inline struct xhr3_callback *xhr3_callback_from_IXMLHTTPRequest3Callback(IXMLHTTPRequest3Callback *iface) +{ + return CONTAINING_RECORD(iface, struct xhr3_callback, IXMLHTTPRequest3Callback_iface); +} + +static HRESULT WINAPI xhr3_callback_QueryInterface(IXMLHTTPRequest3Callback *iface, REFIID riid, void **obj) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + trace("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); + + if (IsEqualGUID(riid, &IID_IXMLHTTPRequest3Callback) || IsEqualGUID(riid, &IID_IXMLHTTPRequest2Callback) || IsEqualGUID(riid, &IID_IUnknown)) + { + IXMLHTTPRequest3Callback_AddRef(iface); + *obj = iface; + return S_OK; + } + + ok(0, "unexpected interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI xhr3_callback_AddRef(IXMLHTTPRequest3Callback *iface) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + ULONG ref = InterlockedIncrement(&This->ref); + trace("(%p)->(%lu)\n", This, ref); + return ref; +} + +static ULONG WINAPI xhr3_callback_Release(IXMLHTTPRequest3Callback *iface) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + ULONG ref = InterlockedDecrement(&This->ref); + trace("(%p)->(%lu)\n", This, ref); + if (ref == 0) HeapFree(GetProcessHeap(), 0, This); + return ref; +} + +static HRESULT WINAPI xhr3_callback_OnRedirect(IXMLHTTPRequest3Callback *iface, + IXMLHTTPRequest2 *request, const WCHAR* redirect_url) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + trace("(%p)->(%p %s)\n", This, request, debugstr_w(redirect_url)); + return S_OK; +} + +static HRESULT WINAPI xhr3_callback_OnHeadersAvailable(IXMLHTTPRequest3Callback *iface, + IXMLHTTPRequest2 *request, DWORD status, const WCHAR *status_str) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + WCHAR *header = NULL; + HRESULT hr; + + trace("(%p)->(%p %lu %s)\n", This, request, status, debugstr_w(status_str)); + + header = (void *)0xdeadbeef; + hr = IXMLHTTPRequest2_GetResponseHeader(request, L"Content-Length", &header); + trace("Content-Length: %p (%s), hr %#lx\n", header, debugstr_w(header), hr); + + return S_OK; +} + +static HRESULT WINAPI xhr3_callback_OnDataAvailable(IXMLHTTPRequest3Callback *iface, + IXMLHTTPRequest2 *request, ISequentialStream *response) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + trace("(%p)->(%p %p)\n", This, request, response); + return S_OK; +} + +static HRESULT WINAPI xhr3_callback_OnResponseReceived(IXMLHTTPRequest3Callback *iface, + IXMLHTTPRequest2 *request, ISequentialStream *response) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + WCHAR *header = NULL; + char *buffer = HeapAlloc( GetProcessHeap(), 0, 256 ); + ULONG read_size = 0; + HRESULT hr; + + memset(buffer, '?', 256); + buffer[255] = 0; + + trace("(%p)->(%p %p)\n", This, request, response); + + header = (void *)0xdeadbeef; + hr = IXMLHTTPRequest2_GetResponseHeader(request, L"Cache-Control", &header); + trace("Cache-Control: %p (%s), hr %#lx\n", header, debugstr_w(header), hr); + + header = (void *)0xdeadbeef; + hr = IXMLHTTPRequest2_GetResponseHeader(request, L"Expires", &header); + trace("Expires: %p (%s), hr %#lx\n", header, debugstr_w(header), hr); + + header = (void *)0xdeadbeef; + hr = IXMLHTTPRequest2_GetResponseHeader(request, L"Content-Type", &header); + trace("Content-Type: %p (%s), hr %#lx\n", header, debugstr_w(header), hr); + + read_size = 0xdeadbeef; + hr = ISequentialStream_Read(response, buffer, 214, &read_size); + trace("Response: (%ld) %s, hr %#lx\n", read_size, debugstr_a(buffer), hr); + + read_size = 0xdeadbeef; + hr = ISequentialStream_Read(response, buffer, 1, &read_size); + trace("Response: (%ld) %s, hr %#lx\n", read_size, debugstr_a(buffer), hr); + + HeapFree( GetProcessHeap(), 0, buffer ); + SetEvent(This->event); + + return S_OK; +} + +static HRESULT WINAPI xhr3_callback_OnError(IXMLHTTPRequest3Callback *iface, + IXMLHTTPRequest2 *request, HRESULT error) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + trace("(%p)->(%p %#lx)\n", This, request, error); + SetEvent(This->event); + return S_OK; +} + +static HRESULT WINAPI xhr3_callback_OnServerCertificateReceived(IXMLHTTPRequest3Callback *iface, + IXMLHTTPRequest3 *request, DWORD errors, DWORD chain_size, const XHR_CERT *chain) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + trace("(%p)->(%p %lu %lu %p)\n", This, request, errors, chain_size, chain); + return S_OK; +} + +static HRESULT WINAPI xhr3_callback_OnClientCertificateRequested(IXMLHTTPRequest3Callback *iface, + IXMLHTTPRequest3 *request, DWORD issuers_size, const WCHAR **issuers) +{ + struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface); + trace("(%p)->(%p %lu %p)\n", This, request, issuers_size, issuers); + return S_OK; +} + +static const IXMLHTTPRequest3CallbackVtbl xhr3_callback_vtbl = +{ + xhr3_callback_QueryInterface, + xhr3_callback_AddRef, + xhr3_callback_Release, + /* IXMLHTTPRequest2Callback methods */ + xhr3_callback_OnRedirect, + xhr3_callback_OnHeadersAvailable, + xhr3_callback_OnDataAvailable, + xhr3_callback_OnResponseReceived, + xhr3_callback_OnError, + /* IXMLHTTPRequest3Callback methods */ + xhr3_callback_OnServerCertificateReceived, + xhr3_callback_OnClientCertificateRequested, +}; + +static IXMLHTTPRequest2Callback* xhr3_callback_create(HANDLE event) +{ + struct xhr3_callback *This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); + ok(This != NULL, "failed to allocate object\n"); + if (!This) return NULL; + + This->IXMLHTTPRequest3Callback_iface.lpVtbl = &xhr3_callback_vtbl; + This->ref = 1; + This->event = event; + + return (IXMLHTTPRequest2Callback*)&This->IXMLHTTPRequest3Callback_iface; +} + +struct xhr2_stream +{ + IStream IStream_iface; + LONG ref; + IStream *stream; +}; + +static inline struct xhr2_stream *xhr2_stream_from_IStream(IStream *iface) +{ + return CONTAINING_RECORD(iface, struct xhr2_stream, IStream_iface); +} + +static HRESULT WINAPI xhr2_stream_QueryInterface(IStream *iface, REFIID riid, void **obj) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); + + if (IsEqualGUID(riid, &IID_IStream) || IsEqualGUID(riid, &IID_ISequentialStream) || IsEqualGUID(riid, &IID_IUnknown)) + { + IStream_AddRef(iface); + *obj = iface; + return S_OK; + } + + ok(0, "unexpected interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI xhr2_stream_AddRef(IStream *iface) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + ULONG ref = InterlockedIncrement(&This->ref); + trace("(%p)->(%lu)\n", This, ref); + return ref; +} + +static ULONG WINAPI xhr2_stream_Release(IStream *iface) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + ULONG ref = InterlockedDecrement(&This->ref); + trace("(%p)->(%lu)\n", This, ref); + if (ref == 0) + { + IStream_Release(This->stream); + HeapFree(GetProcessHeap(), 0, This); + } + return ref; +} + +static HRESULT WINAPI xhr2_stream_Read(IStream *iface, void *pv, ULONG cb, + ULONG *pcbRead) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%p %lu %p)\n", This, pv, cb, pcbRead); + return IStream_Read(This->stream, pv, cb, pcbRead); +} + +static HRESULT WINAPI xhr2_stream_Write(IStream *iface, const void *pv, + ULONG cb, ULONG *pcbWritten) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%p %lu %p)\n", This, pv, cb, pcbWritten); + return IStream_Write(This->stream, pv, cb, pcbWritten); +} + +static HRESULT WINAPI xhr2_stream_Seek(IStream *iface, LARGE_INTEGER dlibMove, + DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%I64u, %lu %p)\n", This, dlibMove.QuadPart, dwOrigin, plibNewPosition); + return IStream_Seek(This->stream, dlibMove, dwOrigin, plibNewPosition); +} + +static HRESULT WINAPI xhr2_stream_SetSize(IStream *iface, ULARGE_INTEGER libNewSize) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%I64u)\n", This, libNewSize.QuadPart); + return IStream_SetSize(This->stream, libNewSize); +} + +static HRESULT WINAPI xhr2_stream_CopyTo(IStream *iface, IStream *pstm, + ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%p %I64u %p %p)\n", This, pstm, cb.QuadPart, pcbRead, pcbWritten); + return IStream_CopyTo(This->stream, pstm, cb, pcbRead, pcbWritten); +} + +static HRESULT WINAPI xhr2_stream_Commit(IStream *iface, DWORD grfCommitFlags) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%#lx)\n", This, grfCommitFlags); + return IStream_Commit(This->stream, grfCommitFlags); +} + +static HRESULT WINAPI xhr2_stream_Revert(IStream *iface) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->()\n", This); + return IStream_Revert(This->stream); +} + +static HRESULT WINAPI xhr2_stream_LockRegion(IStream *iface, ULARGE_INTEGER libOffset, + ULARGE_INTEGER cb, DWORD dwLockType) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%I64u %I64u %lu)\n", This, libOffset.QuadPart, cb.QuadPart, dwLockType); + return IStream_LockRegion(This->stream, libOffset, cb, dwLockType); +} + +static HRESULT WINAPI xhr2_stream_UnlockRegion(IStream *iface, ULARGE_INTEGER libOffset, + ULARGE_INTEGER cb, DWORD dwLockType) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%I64u %I64u %lu)\n", This, libOffset.QuadPart, cb.QuadPart, dwLockType); + return IStream_UnlockRegion(This->stream, libOffset, cb, dwLockType); +} + +static HRESULT WINAPI xhr2_stream_Stat(IStream *iface, STATSTG *pstatstg, DWORD grfStatFlag) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%p %#lx)\n", This, pstatstg, grfStatFlag); + return IStream_Stat(This->stream, pstatstg, grfStatFlag); +} + +static HRESULT WINAPI xhr2_stream_Clone(IStream *iface, IStream **ppstm) +{ + struct xhr2_stream *This = xhr2_stream_from_IStream(iface); + trace("(%p)->(%p)\n", This, ppstm); + return IStream_Clone(This->stream, ppstm); +} + +static const IStreamVtbl xhr2_stream_vtbl = +{ + xhr2_stream_QueryInterface, + xhr2_stream_AddRef, + xhr2_stream_Release, + /* IStream methods */ + xhr2_stream_Read, + xhr2_stream_Write, + xhr2_stream_Seek, + xhr2_stream_SetSize, + xhr2_stream_CopyTo, + xhr2_stream_Commit, + xhr2_stream_Revert, + xhr2_stream_LockRegion, + xhr2_stream_UnlockRegion, + xhr2_stream_Stat, + xhr2_stream_Clone +}; + +static ISequentialStream *xhr2_stream_create(void) +{ + struct xhr2_stream *This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); + ok(This != NULL, "failed to allocate object\n"); + if (!This) return NULL; + + This->IStream_iface.lpVtbl = &xhr2_stream_vtbl; + This->ref = 1; + CreateStreamOnHGlobal(NULL, TRUE, &This->stream); + + return (ISequentialStream*)&This->IStream_iface; +} + +static void test_IXMLHTTPRequest2(void) +{ + IXMLHTTPRequest2 *xhr2[16]; + IXMLHTTPRequest2Callback *xhr3_callback; + ISequentialStream *stream; + HANDLE events[16]; + HRESULT hr; + int i = 0; + + if (!(xhr2[i] = create_xhr2())) + { + win_skip("IXMLHTTPRequest2 is not available\n"); + return; + } + + events[i] = CreateEventW(NULL, FALSE, FALSE, NULL); + if (!(xhr3_callback = xhr3_callback_create(events[i]))) + return; + + trace("%lu: IXMLHTTPRequest2_Open (%p)->(L\"GET\", L\"http://test.winehq.org/\", xhr3_callback, NULL, NULL, NULL, NULL)\n", GetCurrentThreadId(), xhr2[i]); + hr = IXMLHTTPRequest2_Open(xhr2[i], L"GET", L"http://test.winehq.org/", xhr3_callback, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "IXMLHTTPRequest2_Send failed %#lx\n", hr); + + if ((stream = xhr2_stream_create())) + { + trace("%lu: IXMLHTTPRequest2_Send (%p)->(%p 0)\n", GetCurrentThreadId(), xhr2[i], stream); + hr = IXMLHTTPRequest2_Send(xhr2[i], stream, 0); + ok(SUCCEEDED(hr), "IXMLHTTPRequest2_Send failed %#lx\n", hr); + + ISequentialStream_Release(stream); + } + + IXMLHTTPRequest2Callback_Release(xhr3_callback); + i++; + + while (i--) + { + WaitForSingleObject(events[i], INFINITE); + IXMLHTTPRequest2_Release(xhr2[i]); + } +} + START_TEST(httpreq) { IXMLHttpRequest *xhr; - CoInitialize(NULL); + CoInitializeEx(NULL, COINIT_MULTITHREADED); if (!(xhr = create_xhr())) { @@ -1923,6 +2311,7 @@ START_TEST(httpreq) test_server_xhr(); test_safe_httpreq(); test_supporterrorinfo(); + test_IXMLHTTPRequest2(); CoUninitialize(); } diff --git a/dlls/msxml3/tests/schema.c b/dlls/msxml3/tests/schema.c index c83e72e136a3..c896f1e6a044 100644 --- a/dlls/msxml3/tests/schema.c +++ b/dlls/msxml3/tests/schema.c @@ -32,10 +32,16 @@ #include "dispex.h" #include "cguid.h" +DEFINE_GUID(CLSID_FreeThreadedDOMDocument60, 0x88d96a06, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_FreeThreadedXMLHTTP60, 0x88d96a09, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); DEFINE_GUID(CLSID_MXXMLWriter60, 0x88d96a0f, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); DEFINE_GUID(CLSID_SAXAttributes60, 0x88d96a0e, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); DEFINE_GUID(CLSID_SAXXMLReader60, 0x88d96a0c, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); DEFINE_GUID(CLSID_XMLSchemaCache60, 0x88d96a07, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(IID_IXMLHTTPRequest2, 0xe5d37dc0, 0x552a, 0x4d52, 0x9c,0xc0, 0xa1,0x4d,0x54,0x6f,0xbd,0x04); +DEFINE_GUID(IID_IXMLHTTPRequest3, 0xa1c9feee, 0x0617, 0x4f23, 0x9d,0x58, 0x89,0x61,0xea,0x43,0x56,0x7c); +DEFINE_GUID(IID_IXMLHTTPRequest2Callback, 0xa44a9299, 0xe321, 0x40de, 0x88,0x66, 0x34,0x1b,0x41,0x66,0x91,0x62); +DEFINE_GUID(IID_IXMLHTTPRequest3Callback, 0xb9e57830, 0x8c6c, 0x4a6f, 0x9c,0x13, 0x47,0x77,0x2b,0xb0,0x47,0xbb); #include "wine/test.h" diff --git a/dlls/msxml3/uuid.c b/dlls/msxml3/uuid.c index 7214d23c5dc5..320a7e04fa3c 100644 --- a/dlls/msxml3/uuid.c +++ b/dlls/msxml3/uuid.c @@ -43,6 +43,7 @@ /* Cannot include msxml6 here since we will get a duplicate LIBID_MSXML2 error. */ DEFINE_GUID(CLSID_FreeThreadedDOMDocument60, 0x88d96a06, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(CLSID_FreeThreadedXMLHTTP60, 0x88d96a09, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); DEFINE_GUID(CLSID_MXNamespaceManager60, 0x88d96a11, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); DEFINE_GUID(CLSID_MXXMLWriter60, 0x88d96a0f, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); DEFINE_GUID(CLSID_SAXAttributes60, 0x88d96a0e, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); @@ -50,6 +51,10 @@ DEFINE_GUID(CLSID_SAXXMLReader60, 0x88d96a0c, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x DEFINE_GUID(CLSID_ServerXMLHTTP60, 0x88d96a0b, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); DEFINE_GUID(CLSID_XMLHTTP60, 0x88d96a0a, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); DEFINE_GUID(CLSID_XSLTemplate60, 0x88d96a08, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5); +DEFINE_GUID(IID_IXMLHTTPRequest2, 0xe5d37dc0, 0x552a, 0x4d52, 0x9c,0xc0, 0xa1,0x4d,0x54,0x6f,0xbd,0x04); +DEFINE_GUID(IID_IXMLHTTPRequest3, 0xa1c9feee, 0x0617, 0x4f23, 0x9d,0x58, 0x89,0x61,0xea,0x43,0x56,0x7c); +DEFINE_GUID(IID_IXMLHTTPRequest2Callback, 0xa44a9299, 0xe321, 0x40de, 0x88,0x66, 0x34,0x1b,0x41,0x66,0x91,0x62); +DEFINE_GUID(IID_IXMLHTTPRequest3Callback, 0xb9e57830, 0x8c6c, 0x4a6f, 0x9c,0x13, 0x47,0x77,0x2b,0xb0,0x47,0xbb); /* * Note that because of a #define in msxml2.h, we end up initializing diff --git a/include/msxml6.idl b/include/msxml6.idl index bf7e0905057e..a02f7b2db143 100644 --- a/include/msxml6.idl +++ b/include/msxml6.idl @@ -1715,17 +1715,6 @@ interface ISAXDeclHandler : IUnknown [in] int nSystemId); } -[ - helpstring("Free Threaded XML HTTP Request class 6.0"), - progid("Msxml2.FreeThreadedXMLHTTP60.6.0"), - threading(both), - uuid(88d96a09-f192-11d4-a65f-0040963251e5) -] -coclass FreeThreadedXMLHTTP60 -{ - [default] interface IXMLHTTPRequest2; -} - [ object, local, @@ -3053,6 +3042,17 @@ interface ISchemaNotation; SCHEMATYPEVARIETY __schemaTypeVariety__; } __msxml6_ReferenceRemainingTypes__; +[ + helpstring("Free Threaded XML HTTP Request class 6.0"), + progid("Msxml2.FreeThreadedXMLHTTP60.6.0"), + threading(both), + uuid(88d96a09-f192-11d4-a65f-0040963251e5) +] +coclass FreeThreadedXMLHTTP60 +{ + [default] interface IXMLHTTPRequest2; +} + [ helpstring("XML DOM Document 6.0"), progid("Msxml2.DOMDocument.6.0"), From d989b5635aac5e6f6920e491199502030760f4ae Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Thu, 5 Jan 2023 14:36:31 +1100 Subject: [PATCH 0716/2542] msxml3: Implement IXMLHTTPRequest3 SetProperty CW-Bug-Id: #22822 --- dlls/msxml3/httprequest.c | 77 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 2 deletions(-) diff --git a/dlls/msxml3/httprequest.c b/dlls/msxml3/httprequest.c index 8f7e4b74ea40..0b1ce1621c0c 100644 --- a/dlls/msxml3/httprequest.c +++ b/dlls/msxml3/httprequest.c @@ -101,6 +101,21 @@ typedef struct /* IObjectSafety */ DWORD safeopt; + + /* Properties */ + DWORD no_prompt; + DWORD no_auth; + DWORD timeout; + BOOL no_headeres; + BOOL redirect; + BOOL cache; + BOOL extended; + BOOL query_utf8; + BOOL ignore_errors; + BOOL threshold; + DWORD enterrprised_id; + DWORD max_connections; + } httprequest; typedef struct @@ -2226,8 +2241,52 @@ static HRESULT WINAPI xml_http_request_2_SetCustomResponseStream(IXMLHTTPRequest static HRESULT WINAPI xml_http_request_2_SetProperty(IXMLHTTPRequest3 *iface, XHR_PROPERTY property, ULONGLONG value) { struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface); - FIXME("(%p)->(%#x %s) stub!\n", This, property, wine_dbgstr_longlong( value )); - return E_NOTIMPL; + + TRACE("(%p)->(%#x %s) stub!\n", This, property, wine_dbgstr_longlong( value )); + + switch (property) + { + case XHR_PROP_NO_CRED_PROMPT: + This->req.no_prompt = value; + break; + case XHR_PROP_NO_AUTH: + This->req.no_auth = value; + break; + case XHR_PROP_TIMEOUT: + This->req.timeout = value; + break; + case XHR_PROP_NO_DEFAULT_HEADERS: + This->req.no_headeres = value != 0; + break; + case XHR_PROP_REPORT_REDIRECT_STATUS: + This->req.redirect = value != 0; + break; + case XHR_PROP_NO_CACHE: + This->req.cache = value != 0; + break; + case XHR_PROP_EXTENDED_ERROR: + This->req.extended = value != 0; + break; + case XHR_PROP_QUERY_STRING_UTF8: + This->req.query_utf8 = value != 0; + break; + case XHR_PROP_IGNORE_CERT_ERRORS: + This->req.ignore_errors = value != 0; + break; + case XHR_PROP_ONDATA_THRESHOLD: + This->req.threshold = value; + break; + case XHR_PROP_SET_ENTERPRISEID: + This->req.enterrprised_id = value; + break; + case XHR_PROP_MAX_CONNECTIONS: + This->req.max_connections = value; + break; + default: + WARN("Invalid property %#x\n", property); + return E_INVALIDARG; + } + return S_OK; } static HRESULT WINAPI xml_http_request_2_SetRequestHeader(IXMLHTTPRequest3 *iface, @@ -2547,6 +2606,20 @@ static void init_httprequest(httprequest *req) req->site = NULL; req->safeopt = 0; + + /* Properties */ + req->no_prompt = XHR_CRED_PROMPT_ALL; + req->no_auth = XHR_AUTH_ALL; + req->timeout = 0xFFFFFFFF; + req->no_headeres = FALSE; + req->redirect = FALSE; + req->cache = FALSE; + req->extended = FALSE; + req->query_utf8 = FALSE;; + req->ignore_errors = FALSE;; + req->threshold = 0x100; + req->enterrprised_id = 0; + req->max_connections = 10; } HRESULT XMLHTTPRequest_create(void **obj) From 8b81419e90e39c451a078f389f859564b04a60c9 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Thu, 12 Jan 2023 08:21:48 +1100 Subject: [PATCH 0717/2542] msxml3: Correct xml_http_request_2_GetResponseHeader CW-Bug-Id: #22822 --- dlls/msxml3/httprequest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/msxml3/httprequest.c b/dlls/msxml3/httprequest.c index 0b1ce1621c0c..f0c8d9537506 100644 --- a/dlls/msxml3/httprequest.c +++ b/dlls/msxml3/httprequest.c @@ -2321,8 +2321,7 @@ static HRESULT WINAPI xml_http_request_2_GetResponseHeader(IXMLHTTPRequest3 *ifa TRACE("(%p)->(%s %p)\n", This, debugstr_w(header), value); - if (FAILED(hr = httprequest_getResponseHeader(&This->req, (BSTR)header, value))) - return hr; + hr = httprequest_getResponseHeader(&This->req, (BSTR)header, value); #define E_FILE_NOT_FOUND _HRESULT_TYPEDEF_(0x80070002) From e9461018b2a1ec35ea8652e0ca101878b846736d Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 5 Oct 2023 11:38:00 -0600 Subject: [PATCH 0718/2542] msxml3: Treat body as data array in xml_http_request_2_IRtwqAsyncCallback_Invoke(). CW-Bug-Id: #22822 --- dlls/msxml3/httprequest.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/dlls/msxml3/httprequest.c b/dlls/msxml3/httprequest.c index f0c8d9537506..74a104fe9450 100644 --- a/dlls/msxml3/httprequest.c +++ b/dlls/msxml3/httprequest.c @@ -2408,6 +2408,7 @@ static HRESULT WINAPI xml_http_request_2_IRtwqAsyncCallback_Invoke(IRtwqAsyncCal IRtwqAsyncResult *result) { struct xml_http_request_2 *This = xml_http_request_2_from_IRtwqAsyncCallback(iface); + SAFEARRAY *sa = NULL; VARIANT body_v; HRESULT hr; ULONG read; @@ -2418,14 +2419,25 @@ static HRESULT WINAPI xml_http_request_2_IRtwqAsyncCallback_Invoke(IRtwqAsyncCal if (This->request_body) { - V_VT(&body_v) = VT_BSTR; - V_BSTR(&body_v) = CoTaskMemAlloc(This->request_body_size); + SAFEARRAYBOUND bound; + void *ptr; - if (FAILED(hr = ISequentialStream_Read(This->request_body, V_BSTR(&body_v), This->request_body_size, &read)) || - read < This->request_body_size) + bound.lLbound = 0; + bound.cElements = This->request_body_size; + if (!(sa = SafeArrayCreate(VT_UI1, 1, &bound))) + { + ERR("No memory.\n"); + hr = E_OUTOFMEMORY; + goto done; + } + V_ARRAY(&body_v) = sa; + V_VT(&body_v) = VT_ARRAY | VT_UI1; + SafeArrayAccessData(sa, &ptr); + hr = ISequentialStream_Read(This->request_body, ptr, This->request_body_size, &read); + SafeArrayUnaccessData(sa); + if (FAILED(hr) || read < This->request_body_size) { - ERR("Failed to allocate request body memory, hr %#lx\n", hr); - CoTaskMemFree(V_BSTR(&body_v)); + ERR("Failed to read from stream, hr %#lx\n", hr); goto done; } @@ -2436,6 +2448,8 @@ static HRESULT WINAPI xml_http_request_2_IRtwqAsyncCallback_Invoke(IRtwqAsyncCal hr = httprequest_send(&This->req, body_v); done: + if (sa) + SafeArrayDestroy(sa); return IRtwqAsyncResult_SetStatus(result, hr); } From d879529ab9b726f8d403d22206a53a7ddb1bc127 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 5 Oct 2023 12:05:28 -0600 Subject: [PATCH 0719/2542] msxml3: Try to get body size from stream in xml_http_request_2_IRtwqAsyncCallback_Invoke(). CW-Bug-Id: #22822 --- dlls/msxml3/httprequest.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/dlls/msxml3/httprequest.c b/dlls/msxml3/httprequest.c index 74a104fe9450..bad1abcf430f 100644 --- a/dlls/msxml3/httprequest.c +++ b/dlls/msxml3/httprequest.c @@ -2408,6 +2408,7 @@ static HRESULT WINAPI xml_http_request_2_IRtwqAsyncCallback_Invoke(IRtwqAsyncCal IRtwqAsyncResult *result) { struct xml_http_request_2 *This = xml_http_request_2_from_IRtwqAsyncCallback(iface); + IStream *stream = NULL; SAFEARRAY *sa = NULL; VARIANT body_v; HRESULT hr; @@ -2420,10 +2421,27 @@ static HRESULT WINAPI xml_http_request_2_IRtwqAsyncCallback_Invoke(IRtwqAsyncCal if (This->request_body) { SAFEARRAYBOUND bound; + ULONGLONG body_size; + STATSTG stream_stat; + LARGE_INTEGER li; void *ptr; + if (SUCCEEDED(ISequentialStream_QueryInterface(This->request_body, &IID_IStream, (void **)&stream)) + && SUCCEEDED(IStream_Stat(stream, &stream_stat, 0))) + { + body_size = stream_stat.cbSize.QuadPart; + li.QuadPart = 0; + IStream_Seek(stream, li, STREAM_SEEK_SET, NULL); + } + else + { + body_size = This->request_body_size; + } + + TRACE("body_size %I64u.\n", body_size); + bound.lLbound = 0; - bound.cElements = This->request_body_size; + bound.cElements = body_size; if (!(sa = SafeArrayCreate(VT_UI1, 1, &bound))) { ERR("No memory.\n"); @@ -2433,9 +2451,13 @@ static HRESULT WINAPI xml_http_request_2_IRtwqAsyncCallback_Invoke(IRtwqAsyncCal V_ARRAY(&body_v) = sa; V_VT(&body_v) = VT_ARRAY | VT_UI1; SafeArrayAccessData(sa, &ptr); - hr = ISequentialStream_Read(This->request_body, ptr, This->request_body_size, &read); + + if (stream) + hr = IStream_Read(stream, ptr, body_size, &read); + else + hr = ISequentialStream_Read(This->request_body, ptr, body_size, &read); SafeArrayUnaccessData(sa); - if (FAILED(hr) || read < This->request_body_size) + if (FAILED(hr) || read < body_size) { ERR("Failed to read from stream, hr %#lx\n", hr); goto done; @@ -2450,6 +2472,8 @@ static HRESULT WINAPI xml_http_request_2_IRtwqAsyncCallback_Invoke(IRtwqAsyncCal done: if (sa) SafeArrayDestroy(sa); + if (stream) + IStream_Release(stream); return IRtwqAsyncResult_SetStatus(result, hr); } From 9da71bec8769eaf578241e7d3b584205383d45e5 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 5 Oct 2023 12:02:44 -0600 Subject: [PATCH 0720/2542] msxml3: Don't fail xml_http_request_2_IRtwqAsyncCallback_Invoke() on stream read failures. CW-Bug-Id: #22822 --- dlls/msxml3/httprequest.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/msxml3/httprequest.c b/dlls/msxml3/httprequest.c index bad1abcf430f..c4c38e4c7bf6 100644 --- a/dlls/msxml3/httprequest.c +++ b/dlls/msxml3/httprequest.c @@ -2459,8 +2459,12 @@ static HRESULT WINAPI xml_http_request_2_IRtwqAsyncCallback_Invoke(IRtwqAsyncCal SafeArrayUnaccessData(sa); if (FAILED(hr) || read < body_size) { - ERR("Failed to read from stream, hr %#lx\n", hr); - goto done; + /* Windows doesn't send the body in this case but still sends request with Content-Length + * set to requested body size. */ + ERR("Failed to read from stream, hr %#lx, read %lu\n", hr, read); + SafeArrayDestroy(sa); + sa = NULL; + V_VT(&body_v) = VT_NULL; } ISequentialStream_Release(This->request_body); From 7afd42640f593f465726f71c46a6566ee7c00046 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 12 Oct 2023 21:38:46 -0600 Subject: [PATCH 0721/2542] ntdll: HACK: Avoid unitialized Dr7 in RtlRaiseException on x64. CW-Bug-Id: #22848 --- dlls/ntdll/signal_x86_64.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 806f1b824bec..c38621a1c8ea 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -825,6 +825,8 @@ __ASM_GLOBAL_FUNC( RtlRaiseException, "movq 0x4f8(%rsp),%rax\n\t" /* return address */ "movq %rax,0xf8(%rdx)\n\t" /* context->Rip */ "movq %rax,0x10(%rcx)\n\t" /* rec->ExceptionAddress */ + "xor %rax,%rax\n\t" + "movq %rax,0x70(%rdx)\n\t" /* Context->Dr7 */ "movl $1,%r8d\n\t" "movq %gs:(0x30),%rax\n\t" /* Teb */ "movq 0x60(%rax),%rax\n\t" /* Peb */ From 4b180d0856d8d7131d23ddce9e9233b287a8852c Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 17 Nov 2023 17:27:21 -0600 Subject: [PATCH 0722/2542] d3dx9: Implement D3DXComputeTangent CW-Bug-Id: #23002 --- dlls/d3dx9_24/d3dx9_24.spec | 2 +- dlls/d3dx9_25/d3dx9_25.spec | 2 +- dlls/d3dx9_26/d3dx9_26.spec | 2 +- dlls/d3dx9_27/d3dx9_27.spec | 2 +- dlls/d3dx9_28/d3dx9_28.spec | 2 +- dlls/d3dx9_29/d3dx9_29.spec | 2 +- dlls/d3dx9_30/d3dx9_30.spec | 2 +- dlls/d3dx9_31/d3dx9_31.spec | 2 +- dlls/d3dx9_32/d3dx9_32.spec | 2 +- dlls/d3dx9_33/d3dx9_33.spec | 2 +- dlls/d3dx9_34/d3dx9_34.spec | 2 +- dlls/d3dx9_35/d3dx9_35.spec | 2 +- dlls/d3dx9_36/d3dx9_36.spec | 2 +- dlls/d3dx9_36/mesh.c | 18 ++++++++++++++++++ dlls/d3dx9_37/d3dx9_37.spec | 2 +- dlls/d3dx9_38/d3dx9_38.spec | 2 +- dlls/d3dx9_39/d3dx9_39.spec | 2 +- dlls/d3dx9_40/d3dx9_40.spec | 2 +- dlls/d3dx9_41/d3dx9_41.spec | 2 +- dlls/d3dx9_42/d3dx9_42.spec | 2 +- dlls/d3dx9_43/d3dx9_43.spec | 2 +- 21 files changed, 38 insertions(+), 20 deletions(-) diff --git a/dlls/d3dx9_24/d3dx9_24.spec b/dlls/d3dx9_24/d3dx9_24.spec index ead018c7ae07..0d51a21afbe3 100644 --- a/dlls/d3dx9_24/d3dx9_24.spec +++ b/dlls/d3dx9_24/d3dx9_24.spec @@ -20,7 +20,7 @@ @ stdcall D3DXComputeBoundingSphere(ptr long long ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_25/d3dx9_25.spec b/dlls/d3dx9_25/d3dx9_25.spec index d1087a2d4cc5..5ad6e3d6ab20 100644 --- a/dlls/d3dx9_25/d3dx9_25.spec +++ b/dlls/d3dx9_25/d3dx9_25.spec @@ -20,7 +20,7 @@ @ stdcall D3DXComputeBoundingSphere(ptr long long ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_26/d3dx9_26.spec b/dlls/d3dx9_26/d3dx9_26.spec index 0769e250958d..ee2208755c8b 100644 --- a/dlls/d3dx9_26/d3dx9_26.spec +++ b/dlls/d3dx9_26/d3dx9_26.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_27/d3dx9_27.spec b/dlls/d3dx9_27/d3dx9_27.spec index 0769e250958d..ee2208755c8b 100644 --- a/dlls/d3dx9_27/d3dx9_27.spec +++ b/dlls/d3dx9_27/d3dx9_27.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_28/d3dx9_28.spec b/dlls/d3dx9_28/d3dx9_28.spec index 19871f33abcb..3db50029c3a3 100644 --- a/dlls/d3dx9_28/d3dx9_28.spec +++ b/dlls/d3dx9_28/d3dx9_28.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_29/d3dx9_29.spec b/dlls/d3dx9_29/d3dx9_29.spec index 19871f33abcb..3db50029c3a3 100644 --- a/dlls/d3dx9_29/d3dx9_29.spec +++ b/dlls/d3dx9_29/d3dx9_29.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_30/d3dx9_30.spec b/dlls/d3dx9_30/d3dx9_30.spec index 19871f33abcb..3db50029c3a3 100644 --- a/dlls/d3dx9_30/d3dx9_30.spec +++ b/dlls/d3dx9_30/d3dx9_30.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_31/d3dx9_31.spec b/dlls/d3dx9_31/d3dx9_31.spec index 38714f68127a..17f380f6d055 100644 --- a/dlls/d3dx9_31/d3dx9_31.spec +++ b/dlls/d3dx9_31/d3dx9_31.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_32/d3dx9_32.spec b/dlls/d3dx9_32/d3dx9_32.spec index ed8efad9c6ce..1de72897d283 100644 --- a/dlls/d3dx9_32/d3dx9_32.spec +++ b/dlls/d3dx9_32/d3dx9_32.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_33/d3dx9_33.spec b/dlls/d3dx9_33/d3dx9_33.spec index ed8efad9c6ce..1de72897d283 100644 --- a/dlls/d3dx9_33/d3dx9_33.spec +++ b/dlls/d3dx9_33/d3dx9_33.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_34/d3dx9_34.spec b/dlls/d3dx9_34/d3dx9_34.spec index ed8efad9c6ce..1de72897d283 100644 --- a/dlls/d3dx9_34/d3dx9_34.spec +++ b/dlls/d3dx9_34/d3dx9_34.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_35/d3dx9_35.spec b/dlls/d3dx9_35/d3dx9_35.spec index ed8efad9c6ce..1de72897d283 100644 --- a/dlls/d3dx9_35/d3dx9_35.spec +++ b/dlls/d3dx9_35/d3dx9_35.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec index 13405ad8909d..5bf7f675ee98 100644 --- a/dlls/d3dx9_36/d3dx9_36.spec +++ b/dlls/d3dx9_36/d3dx9_36.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c index 23ab7b597080..578bc5f51028 100644 --- a/dlls/d3dx9_36/mesh.c +++ b/dlls/d3dx9_36/mesh.c @@ -7631,6 +7631,24 @@ HRESULT WINAPI D3DXComputeTangentFrameEx(ID3DXMesh *mesh, DWORD texture_in_seman return hr; } +/************************************************************************* + * D3DXComputeTangent (D3DX9_36.@) + */ +HRESULT WINAPI D3DXComputeTangent(ID3DXMesh *mesh, DWORD stage_idx, DWORD tangent_idx, + DWORD binorm_idx, DWORD wrap, const DWORD *adjacency) +{ + TRACE("mesh %p, stage_idx %ld, tangent_idx %ld, binorm_idx %ld, wrap %ld, adjacency %p.\n", + mesh, stage_idx, tangent_idx, binorm_idx, wrap, adjacency); + + return D3DXComputeTangentFrameEx( mesh, D3DDECLUSAGE_TEXCOORD, stage_idx, + ( binorm_idx == D3DX_DEFAULT ) ? D3DX_DEFAULT : D3DDECLUSAGE_BINORMAL, + binorm_idx, + ( tangent_idx == D3DX_DEFAULT ) ? D3DX_DEFAULT : D3DDECLUSAGE_TANGENT, + tangent_idx, D3DX_DEFAULT, 0, + ( wrap ? D3DXTANGENT_WRAP_UV : 0 ) | D3DXTANGENT_GENERATE_IN_PLACE | D3DXTANGENT_ORTHOGONALIZE_FROM_U, + adjacency, -1.01f, -0.01f, -1.01f, NULL, NULL); +} + /************************************************************************* * D3DXComputeNormals (D3DX9_36.@) */ diff --git a/dlls/d3dx9_37/d3dx9_37.spec b/dlls/d3dx9_37/d3dx9_37.spec index 13405ad8909d..5bf7f675ee98 100644 --- a/dlls/d3dx9_37/d3dx9_37.spec +++ b/dlls/d3dx9_37/d3dx9_37.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_38/d3dx9_38.spec b/dlls/d3dx9_38/d3dx9_38.spec index 13405ad8909d..5bf7f675ee98 100644 --- a/dlls/d3dx9_38/d3dx9_38.spec +++ b/dlls/d3dx9_38/d3dx9_38.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_39/d3dx9_39.spec b/dlls/d3dx9_39/d3dx9_39.spec index 13405ad8909d..5bf7f675ee98 100644 --- a/dlls/d3dx9_39/d3dx9_39.spec +++ b/dlls/d3dx9_39/d3dx9_39.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_40/d3dx9_40.spec b/dlls/d3dx9_40/d3dx9_40.spec index 13405ad8909d..5bf7f675ee98 100644 --- a/dlls/d3dx9_40/d3dx9_40.spec +++ b/dlls/d3dx9_40/d3dx9_40.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_41/d3dx9_41.spec b/dlls/d3dx9_41/d3dx9_41.spec index 13405ad8909d..5bf7f675ee98 100644 --- a/dlls/d3dx9_41/d3dx9_41.spec +++ b/dlls/d3dx9_41/d3dx9_41.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_42/d3dx9_42.spec b/dlls/d3dx9_42/d3dx9_42.spec index 1f4cf67c7b24..69558e0b255c 100644 --- a/dlls/d3dx9_42/d3dx9_42.spec +++ b/dlls/d3dx9_42/d3dx9_42.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_43/d3dx9_43.spec b/dlls/d3dx9_43/d3dx9_43.spec index 1f4cf67c7b24..69558e0b255c 100644 --- a/dlls/d3dx9_43/d3dx9_43.spec +++ b/dlls/d3dx9_43/d3dx9_43.spec @@ -24,7 +24,7 @@ @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) @ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) @ stdcall D3DXComputeNormals(ptr ptr) -@ stub D3DXComputeTangent(ptr long long long long ptr) +@ stdcall D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) From f893b48a9a40054c6478098dfc5e4380028dbd37 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 4 May 2023 13:33:48 -0600 Subject: [PATCH 0723/2542] ntdll: HACK: Add WINE_RAM_REPORTING_BIAS option. CW-Bug-Id: #22241 --- dlls/ntdll/unix/loader.c | 6 ++++++ dlls/ntdll/unix/system.c | 8 ++++++++ dlls/ntdll/unix/unix_private.h | 1 + dlls/ntdll/unix/virtual.c | 1 + 4 files changed, 16 insertions(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index b6b4d9b91a58..47a256d20406 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2126,11 +2126,17 @@ BOOL fsync_yield_to_waiters; BOOL localsystem_sid; BOOL simulate_writecopy; SIZE_T kernel_stack_size = 0x100000; +long long ram_reporting_bias; static void hacks_init(void) { const char *sgi = getenv( "SteamGameId" ); const char *env_str; + if ((env_str = getenv("WINE_RAM_REPORTING_BIAS"))) + { + ram_reporting_bias = atoll(env_str) * 1024 * 1024; + ERR( "HACK: ram_reporting_bias %lldMB.\n", ram_reporting_bias / (1024 * 1024) ); + } env_str = getenv("WINE_SIMULATE_ASYNC_READ"); if (env_str) diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 3efa8ef64ac5..f1387cbdec78 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -2481,7 +2481,15 @@ static void get_performance_info( SYSTEM_PERFORMANCE_INFORMATION *info ) mem_available = value * 1024; } fclose(fp); + totalram -= min( totalram, ram_reporting_bias ); if (mem_available) freeram = mem_available; + if ((long long)freeram >= ram_reporting_bias) freeram -= ram_reporting_bias; + else + { + long long bias = ram_reporting_bias - freeram; + freeswap -= min( bias, freeswap ); + freeram = 0; + } } } #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || \ diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 2386cb465071..20a59552df56 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -198,6 +198,7 @@ extern BOOL alert_simulate_sched_quantum; extern BOOL fsync_yield_to_waiters; extern BOOL localsystem_sid; extern BOOL simulate_writecopy; +extern long long ram_reporting_bias; extern void init_environment(void); extern void init_startup_info(void); diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index dbb672b1a489..3d6c62bf0578 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -3803,6 +3803,7 @@ void virtual_get_system_info( SYSTEM_BASIC_INFORMATION *info, BOOL wow64 ) if (!sysinfo(&sinfo)) { ULONG64 total = (ULONG64)sinfo.totalram * sinfo.mem_unit; + total -= min(total, ram_reporting_bias); info->MmHighestPhysicalPage = max(1, total / page_size); } #elif defined(__APPLE__) From a211f2e7e4af16b919bb0196ea1ea5f6736a25f7 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 10 May 2023 13:17:26 -0600 Subject: [PATCH 0724/2542] ntdll: Add virtstat debug channel and log memory allocation statistics. This is solely for debugging purposes and does nothing unless +virtstat logging is enabled. CW-Bug-Id: #22045 CW-Bug-Id: #22247 --- dlls/ntdll/unix/virtual.c | 56 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 3d6c62bf0578..0aaf58fdfeeb 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -90,6 +90,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(virtual); WINE_DECLARE_DEBUG_CHANNEL(module); WINE_DECLARE_DEBUG_CHANNEL(virtual_ranges); +WINE_DECLARE_DEBUG_CHANNEL(virtstat); /* Gdb integration, in loader/main.c */ static struct r_debug *wine_r_debug; @@ -1588,6 +1589,53 @@ static void VIRTUAL_Dump(void) #endif +static void dump_memory_statistics(void) +{ + struct file_view *view; + SIZE_T anon_reserved = 0, anon_committed = 0, mapped = 0, mapped_committed = 0, marked_native = 0; + SIZE_T size, c_size; + char *base; + BYTE vprot; + + if (!TRACE_ON(virtstat)) return; + + WINE_RB_FOR_EACH_ENTRY( view, &views_tree, struct file_view, entry ) + { + if (view->protect & VPROT_NATIVE) + { + marked_native += view->size; + continue; + } + base = view->base; + c_size = 0; + while (base != (char *)view->base + view->size) + { + size = get_vprot_range_size( base, (char *)view->base + view->size - base, VPROT_COMMITTED, &vprot ); + if (vprot & VPROT_COMMITTED) c_size += size; + base += size; + } + if (is_view_valloc( view )) + { + anon_reserved += view->size; + anon_committed += c_size; + } + else + { + mapped += view->size; + mapped_committed += c_size; + } + } + + anon_reserved /= 1024 * 1024; + anon_committed /= 1024 * 1024; + mapped /= 1024 * 1024; + mapped_committed /= 1024 * 1024; + marked_native /= 1024 * 1024; + TRACE_(virtstat)( "Total: res %lu, comm %lu; Anon: res %lu, comm %lu, marked Unix %lu.\n", + anon_reserved + mapped, anon_committed + mapped_committed, anon_reserved, anon_committed, + marked_native ); +} + /*********************************************************************** * find_view * @@ -5092,7 +5140,11 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ set_arm64ec_range( base, size ); } - if (!status) VIRTUAL_DEBUG_DUMP_VIEW( view ); + if (!status) + { + VIRTUAL_DEBUG_DUMP_VIEW( view ); + dump_memory_statistics(); + } server_leave_uninterrupted_section( &virtual_mutex, &sigset ); @@ -5393,6 +5445,8 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si *addr_ptr = base; *size_ptr = size; } + + dump_memory_statistics(); server_leave_uninterrupted_section( &virtual_mutex, &sigset ); return status; } From 97161409371c01699dbd02271438594d82cb100f Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 30 Nov 2023 19:51:12 -0600 Subject: [PATCH 0725/2542] ntdll: HACK: Enable WINE_SIMULATE_WRITECOPY for Battle.net.exe. CW-Bug-Id: #23074 --- dlls/ntdll/unix/loader.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 47a256d20406..ead2731e4939 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2193,7 +2193,10 @@ static void hacks_init(void) env_str = getenv("WINE_SIMULATE_WRITECOPY"); if (env_str) simulate_writecopy = atoi(env_str); - else if (main_argc > 1 && strstr(main_argv[1], "UplayWebCore.exe")) simulate_writecopy = TRUE; + else if (main_argc > 1 && + (strstr(main_argv[1], "UplayWebCore.exe") + || (strstr(main_argv[1], "Battle.net.exe")))) + simulate_writecopy = TRUE; else if (sgi) simulate_writecopy = !strcmp(sgi, "1608730") /* Dawn of Corruption */ || !strcmp(sgi, "1680700") /* Purgo box */ || !strcmp(sgi, "2095300") /* Breakout 13 */ From bf385a9889c3de0fcb87a3f3c2bb012f455da5e8 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 6 Jan 2023 18:00:19 -0600 Subject: [PATCH 0726/2542] ntdll: Support gpuvis tracing. --- dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/signal_arm64ec.c | 1 + dlls/ntdll/unix/debug.c | 49 +++++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/server.c | 13 ++++++++-- dlls/wow64/syscall.c | 13 ++++++++++ include/wine/debug.h | 23 +++++++++++++++++ include/wine/server.h | 6 ++--- 7 files changed, 100 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 60a6c511108d..7c1be53a94d3 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1752,6 +1752,7 @@ @ cdecl -norelay __wine_dbg_header(long long str) @ cdecl -norelay __wine_dbg_output(str) @ cdecl -norelay __wine_dbg_strdup(str) +@ stdcall -syscall -norelay __wine_dbg_ftrace(ptr long long) # Version @ cdecl wine_get_version() diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index ae6d07caae40..c2df7d722dff 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -582,6 +582,7 @@ DEFINE_SYSCALL(NtYieldExecution, (void)) DEFINE_SYSCALL(wine_nt_to_unix_file_name, (const OBJECT_ATTRIBUTES *attr, char *nameA, ULONG *size, UINT disposition)) DEFINE_SYSCALL(wine_unix_to_nt_file_name, (const char *name, WCHAR *buffer, ULONG *size)) DEFINE_SYSCALL_(BOOL, __wine_needs_override_large_address_aware, (void)) +DEFINE_SYSCALL_(unsigned int, __wine_dbg_ftrace, (char *str, unsigned int str_size, unsigned int ctx)) NTSTATUS SYSCALL_API NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG_PTR zero_bits, SIZE_T *size_ptr, ULONG type, ULONG protect ) diff --git a/dlls/ntdll/unix/debug.c b/dlls/ntdll/unix/debug.c index 76832bc92fa1..6bac835264e3 100644 --- a/dlls/ntdll/unix/debug.c +++ b/dlls/ntdll/unix/debug.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "ntstatus.h" #define WIN32_NO_STATUS @@ -283,6 +284,54 @@ NTSTATUS unixcall_wine_dbg_write( void *args ) return write( 2, params->str, params->len ); } +unsigned int WINAPI __wine_dbg_ftrace( char *str, unsigned int str_size, unsigned int ctx ) +{ + static unsigned int curr_ctx; + static int ftrace_fd = -1; + unsigned int str_len; + char ctx_str[64]; + int ctx_len; + + if (ftrace_fd == -1) + { + int expected = -1; + const char *fn; + int fd; + + if (!(fn = getenv( "WINE_FTRACE_FILE" ))) fn = "/sys/kernel/tracing/trace_marker"; + if ((fd = open( fn, O_WRONLY )) == -1) + { + MESSAGE( "wine: error opening ftrace file: %s.\n", strerror(errno) ); + ftrace_fd = -2; + return 0; + } + if (!__atomic_compare_exchange_n( &ftrace_fd, &expected, fd, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST )) + close( fd ); + else + MESSAGE( "wine: ftrace initialized.\n" ); + } + if (ftrace_fd == -2) return ~0u; + + if (ctx == ~0u) ctx_len = 0; + else if (ctx) ctx_len = sprintf( ctx_str, " (end_ctx=%u)", ctx ); + else + { + ctx = __atomic_add_fetch( &curr_ctx, 1, __ATOMIC_SEQ_CST ); + ctx_len = sprintf( ctx_str, " (begin_ctx=%u)", ctx ); + } + + str_len = strlen(str); + if (ctx_len > 0) + { + if (str_size < ctx_len) return ~0u; + if (str_len + ctx_len > str_size) str_len = str_size - ctx_len; + memcpy( &str[str_len], ctx_str, ctx_len ); + str_len += ctx_len; + } + write( ftrace_fd, str, str_len ); + return ctx; +} + #ifdef _WIN64 /*********************************************************************** * wow64_wine_dbg_write diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c index b2ff82f181e9..d16f95d91692 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c @@ -84,6 +84,8 @@ #include "ddk/wdm.h" WINE_DEFAULT_DEBUG_CHANNEL(server); +WINE_DECLARE_DEBUG_CHANNEL(client); +WINE_DECLARE_DEBUG_CHANNEL(ftrace); #ifndef MSG_CMSG_CLOEXEC #define MSG_CMSG_CLOEXEC 0 @@ -263,8 +265,13 @@ unsigned int server_call_unlocked( void *req_ptr ) struct __server_request_info * const req = req_ptr; unsigned int ret; - if ((ret = send_request( req ))) return ret; - return wait_reply( req ); + FTRACE_BLOCK_START("req %s", req->name) + TRACE_(client)("%s start\n", req->name); \ + if (!(ret = send_request( req ))) + ret = wait_reply( req ); + TRACE_(client)("%s end\n", req->name); + FTRACE_BLOCK_END() + return ret; } @@ -747,7 +754,9 @@ unsigned int server_select( const union select_op *select_op, data_size_t size, pthread_sigmask( SIG_SETMASK, &old_set, NULL ); if (signaled) break; + FTRACE_BLOCK_START("select_reply") ret = wait_select_reply( &cookie ); + FTRACE_BLOCK_END() } while (ret == STATUS_USER_APC || ret == STATUS_KERNEL_APC); diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c index d2a977ee5adb..b381c76fc22b 100644 --- a/dlls/wow64/syscall.c +++ b/dlls/wow64/syscall.c @@ -647,6 +647,19 @@ NTSTATUS WINAPI wow64_NtSetContextThread( UINT *args ) } +/********************************************************************** + * wow64___wine_dbg_ftrace + */ +NTSTATUS WINAPI wow64___wine_dbg_ftrace( UINT *args ) +{ + const char *str = get_ptr( &args ); + ULONG len = get_ulong( &args ); + ULONG ctx = get_ulong( &args ); + + return __wine_dbg_ftrace( (char *)str, len, ctx ); +} + + /********************************************************************** * wow64_NtSetDebugFilterState */ diff --git a/include/wine/debug.h b/include/wine/debug.h index 3e0912de8018..3d185431ad26 100644 --- a/include/wine/debug.h +++ b/include/wine/debug.h @@ -114,6 +114,7 @@ extern DECLSPEC_EXPORT const char * __cdecl __wine_dbg_strdup( const char *str ) extern DECLSPEC_EXPORT int __cdecl __wine_dbg_output( const char *str ); extern DECLSPEC_EXPORT int __cdecl __wine_dbg_header( enum __wine_debug_class cls, struct __wine_debug_channel *channel, const char *function ); +extern DECLSPEC_EXPORT unsigned int WINAPI __wine_dbg_ftrace( char *str, unsigned int str_size, unsigned int ctx ); /* * Exported definitions and macros @@ -129,6 +130,18 @@ extern DECLSPEC_EXPORT int __cdecl __wine_dbg_header( enum __wine_debug_class cl # define __wine_dbg_cdecl #endif +static inline unsigned int __wine_dbg_cdecl __wine_dbg_ftrace_printf( unsigned int ctx, const char *format, ...) +{ + char buffer[256]; + + va_list args; + + va_start( args, format ); + vsnprintf( buffer, sizeof(buffer), format, args ); + va_end( args ); + return __wine_dbg_ftrace(buffer, sizeof(buffer), ctx); +} + static const char * __wine_dbg_cdecl wine_dbg_vsprintf( const char *format, va_list args ) __WINE_PRINTF_ATTR(1,0); static inline const char * __wine_dbg_cdecl wine_dbg_vsprintf( const char *format, va_list args ) { @@ -548,6 +561,16 @@ static inline const char *debugstr_variant( const VARIANT *v ) { return wine_dbg #define MESSAGE WINE_MESSAGE +#define FTRACE(...) do { if (TRACE_ON(ftrace)) __wine_dbg_ftrace_printf( -1, __VA_ARGS__ ); } while (0) + +#define FTRACE_BLOCK_START(...) do { \ + unsigned int ctx = TRACE_ON(ftrace) ? __wine_dbg_ftrace_printf( 0, __VA_ARGS__ ) : 0; \ + do { + +#define FTRACE_BLOCK_END() } while (0); \ + if (TRACE_ON(ftrace)) __wine_dbg_ftrace_printf( ctx, "" ); \ + } while (0); + #endif /* __WINESRC__ */ #ifdef __cplusplus diff --git a/include/wine/server.h b/include/wine/server.h index 6b55b10f0884..35dc0cbdef3f 100644 --- a/include/wine/server.h +++ b/include/wine/server.h @@ -48,6 +48,7 @@ struct __server_request_info unsigned int data_count; /* count of request data pointers */ void *reply_data; /* reply data pointer */ struct __server_iovec data[__SERVER_MAX_DATA]; /* request variable size data */ + const char *name; }; NTSYSAPI unsigned int CDECL wine_server_call( void *req_ptr ); @@ -150,21 +151,18 @@ static inline struct rectangle wine_server_rectangle( RECT rect ) #define SERVER_START_REQ(type) \ do { \ - WINE_DECLARE_DEBUG_CHANNEL(client); \ - static const char *const __req_name = #type; \ struct __server_request_info __req; \ struct type##_request * const req = &__req.u.req.type##_request; \ const struct type##_reply * const reply = &__req.u.reply.type##_reply; \ memset( &__req.u.req, 0, sizeof(__req.u.req) ); \ + __req.name = #type; \ __req.u.req.request_header.req = REQ_##type; \ __req.data_count = 0; \ (void)reply; \ - TRACE_(client)("%s start\n", __req_name); \ do #define SERVER_END_REQ \ while(0); \ - TRACE_(client)("%s end\n", __req_name); \ } while(0) From 1e5dde11006c2ff2d68cbe2f3c55566e3d37cc05 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 13 Dec 2012 14:05:03 +0100 Subject: [PATCH 0727/2542] HACK: Create HTMLDocument in dedicated thread to work around Gecko threading limitation. CW-Bug-Id: 18848 --- dlls/actxprxy/Makefile.in | 1 + dlls/actxprxy/actxprxy_mshtml.idl | 35 ++++++++++++ dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/oleobj.c | 89 +++++++++++++++++++++++++++++++ dlls/mshtml/task.c | 51 ++++++++++++++++++ include/docobjectservice.idl | 14 ++--- include/mshtmhst.idl | 6 +-- include/mshtml.idl | 18 +++++-- include/shdeprecated.idl | 4 +- 9 files changed, 203 insertions(+), 16 deletions(-) create mode 100644 dlls/actxprxy/actxprxy_mshtml.idl diff --git a/dlls/actxprxy/Makefile.in b/dlls/actxprxy/Makefile.in index 0397f7c3a935..36aa17b61ef5 100644 --- a/dlls/actxprxy/Makefile.in +++ b/dlls/actxprxy/Makefile.in @@ -8,6 +8,7 @@ SOURCES = \ actxprxy_hlink.idl \ actxprxy_htiface.idl \ actxprxy_htiframe.idl \ + actxprxy_mshtml.idl \ actxprxy_objsafe.idl \ actxprxy_ocmm.idl \ actxprxy_servprov.idl \ diff --git a/dlls/actxprxy/actxprxy_mshtml.idl b/dlls/actxprxy/actxprxy_mshtml.idl new file mode 100644 index 000000000000..6f4a7ca9fd08 --- /dev/null +++ b/dlls/actxprxy/actxprxy_mshtml.idl @@ -0,0 +1,35 @@ +/* + * Copyright 2009 Alexandre Julliard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* just a wrapper for mshtmhst.idl */ + +#pragma makedep proxy +#pragma makedep register + +#define NO_MSHTML_IMPORT + +#include "mshtml.idl" +#include "mshtmhst.idl" +#include "shdeprecated.idl" +#include "docobjectservice.idl" + +[ + threading(both), + uuid(b8da6310-e19b-11d0-933c-00a0c90dcaa9) /* IActiveScriptStats */ +] +coclass PSFactoryBuffer { interface IFactoryBuffer; } diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 95f7a5f49411..d8600e984330 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -1161,6 +1161,7 @@ HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**); HRESULT create_document_node(nsIDOMDocument*,GeckoBrowser*,HTMLInnerWindow*,HTMLInnerWindow*, compat_mode_t,HTMLDocumentNode**); HRESULT create_doctype_node(HTMLDocumentNode*,nsIDOMNode*,HTMLDOMNode**); +HRESULT create_marshaled_doc(HWND,REFIID,void**); HRESULT create_outer_window(GeckoBrowser*,mozIDOMWindowProxy*,HTMLOuterWindow*,HTMLOuterWindow**); HRESULT update_window_doc(HTMLInnerWindow*); diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index 7dffdbeeec29..dbccda23efb6 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -3699,16 +3699,105 @@ static const cpc_entry_t HTMLDocumentObj_cpc[] = { {NULL} }; + + +/* TRUE if we create a dedicated thread for all HTML documents */ +static BOOL gecko_main_thread_config; + +static LONG gecko_main_thread; +static HWND gecko_main_thread_hwnd; +static HANDLE gecko_main_thread_event; + +static DWORD WINAPI gecko_main_thread_proc(void *arg) +{ + MSG msg; + + TRACE("\n"); + + CoInitialize(NULL); + + gecko_main_thread_hwnd = get_thread_hwnd(); + if(!gecko_main_thread_hwnd) { + ERR("Could not create thread window\n"); + SetEvent(gecko_main_thread_event); + CoUninitialize(); + return 0; + } + + gecko_main_thread = GetCurrentThreadId(); + SetEvent(gecko_main_thread_event); + + while(GetMessageW(&msg, NULL, 0, 0)) { + DispatchMessageW(&msg); + TranslateMessage(&msg); + } + + CoUninitialize(); + return 0; +} + +static BOOL WINAPI read_thread_config(INIT_ONCE *once, void *param, void **context) +{ + HKEY key; + DWORD res; + static const WCHAR enable_keyW[] = + {'S','o','f','t','w','a','r','e', + '\\','W','i','n','e', + '\\','M','S','H','T','M','L', + '\\','M','a','i','n','T','h','r','e','a','d','H','a','c','k',0}; + + res = RegOpenKeyW(HKEY_CURRENT_USER, enable_keyW, &key); + if(res == ERROR_SUCCESS) { + RegCloseKey(key); + FIXME("CXHACK: Using separated main thread.\n"); + gecko_main_thread_config = TRUE; + } + + return TRUE; +} + static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID riid, void **ppv) { HTMLDocumentObj *doc; HRESULT hres; + static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT; + if(outer && !IsEqualGUID(&IID_IUnknown, riid)) { *ppv = NULL; return E_INVALIDARG; } + /* CXHACK 15579 */ + InitOnceExecuteOnce(&init_once, read_thread_config, NULL, NULL); + if(gecko_main_thread_config && !gecko_main_thread) { + HANDLE thread, event; + + event = CreateEventW(NULL, TRUE, FALSE, NULL); + if(InterlockedCompareExchangePointer(&gecko_main_thread_event, event, NULL)) + CloseHandle(event); + + thread = CreateThread(NULL, 0, gecko_main_thread_proc, NULL, 0, NULL); + if(thread) { + WaitForSingleObject(gecko_main_thread_event, INFINITE); + CloseHandle(thread); + }else { + ERR("Could not create a thread\n"); + } + } + + if(!gecko_main_thread) { + gecko_main_thread = GetCurrentThreadId(); + gecko_main_thread_hwnd = get_thread_hwnd(); + }else if(GetCurrentThreadId() != gecko_main_thread) { + FIXME("CXHACK: Creating HTMLDocument outside Gecko main thread\n"); + if(!gecko_main_thread_config) { + FIXME("CXHACK: Dedicated main thread not configured\n"); + FIXME("CXHACK: Create HKCU\\Software\\Wine\\MSHTML\\MainThreadHack key\n"); + } + return create_marshaled_doc(gecko_main_thread_hwnd, riid, ppv); + } + /* ensure that security manager is initialized */ if(!get_security_manager()) return E_OUTOFMEMORY; diff --git a/dlls/mshtml/task.c b/dlls/mshtml/task.c index 955567eaabba..e9f4a0e53e3e 100644 --- a/dlls/mshtml/task.c +++ b/dlls/mshtml/task.c @@ -33,6 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); #define WM_PROCESSTASK 0x8008 +#define WM_CREATEDOC 0x8018 #define TIMER_ID 0x3000 typedef struct { @@ -378,6 +379,13 @@ static LRESULT process_timer(void) return 0; } +typedef struct { + IUnknown *unk; + IID iid; + IStream *stream; + HRESULT hres; +} create_doc_params_t; + static LRESULT WINAPI hidden_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { thread_data_t *thread_data; @@ -423,6 +431,20 @@ static LRESULT WINAPI hidden_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa return 0; case WM_TIMER: return process_timer(); + case WM_CREATEDOC: { + create_doc_params_t *params = (create_doc_params_t*)lParam; + IUnknown *unk; + + TRACE("WM_CREATEDOC %p\n", params); + + params->hres = HTMLDocument_Create(NULL, ¶ms->iid, (void**)&unk); + if(FAILED(params->hres)) + return 0; + + params->hres = CoMarshalInterface(params->stream, ¶ms->iid, unk, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + IUnknown_Release(unk); + return 0; + } } if(msg > WM_USER) @@ -465,6 +487,35 @@ HWND get_thread_hwnd(void) return thread_data->thread_hwnd; } +HRESULT create_marshaled_doc(HWND main_thread_hwnd, REFIID riid, void **ppv) +{ + create_doc_params_t params = {NULL, *riid, NULL, E_FAIL}; + LARGE_INTEGER zero; + BOOL res; + HRESULT hres; + + hres = CreateStreamOnHGlobal(NULL, TRUE, ¶ms.stream); + if(FAILED(hres)) + return hres; + + res = SendMessageW(main_thread_hwnd, WM_CREATEDOC, 0, (LPARAM)¶ms); + TRACE("SendMessage ret %x\n", res); + if(FAILED(params.hres)) { + WARN("EM_CREATEDOC failed: %08lx\n", params.hres); + IStream_Release(params.stream); + return hres; + } + + zero.QuadPart = 0; + hres = IStream_Seek(params.stream, zero, STREAM_SEEK_SET, NULL); + if(SUCCEEDED(hres)) + hres = CoUnmarshalInterface(params.stream, riid, ppv); + IStream_Release(params.stream); + if(FAILED(hres)) + WARN("CoUnmarshalInterface failed: %08lx\n", hres); + return hres; +} + thread_data_t *get_thread_data(BOOL create) { thread_data_t *thread_data; diff --git a/include/docobjectservice.idl b/include/docobjectservice.idl index 4e931351b491..cfa007c75eb8 100644 --- a/include/docobjectservice.idl +++ b/include/docobjectservice.idl @@ -17,23 +17,25 @@ */ import "objidl.idl"; +#ifndef NO_MSHTML_IMPORT import "mshtml.idl"; +#endif [ - local, + /* local, CXHACK 15579 */ object, uuid(3050f801-98b5-11cf-bb82-00aa00bdce0b) ] interface IDocObjectService : IUnknown { HRESULT FireBeforeNavigate2( - [in] IDispatch *pDispatch, - [in] LPCWSTR lpszUrl, + [in, optional] IDispatch *pDispatch, + [in, string, unique] LPCWSTR lpszUrl, [in] DWORD dwFlags, - [in] LPCWSTR lpszFrameName, - [in] BYTE *pPostData, + [in, string, unique] LPCWSTR lpszFrameName, + [in, unique, size_is(cbPostData)] BYTE *pPostData, [in] DWORD cbPostData, - [in] LPCWSTR lpszHeaders, + [in, string, unique] LPCWSTR lpszHeaders, [in] BOOL fPlayNavSound, [out] BOOL *pfCancel); diff --git a/include/mshtmhst.idl b/include/mshtmhst.idl index 6cc500ed7a9e..efc51c6a5da2 100644 --- a/include/mshtmhst.idl +++ b/include/mshtmhst.idl @@ -163,7 +163,7 @@ typedef enum tagDOCHOSTUIFLAG object, uuid(BD3F23C0-D43E-11CF-893B-00AA00BDCE1A), pointer_default(unique), - local + /* local, CXHACK 15579 */ ] interface IDocHostUIHandler : IUnknown { @@ -237,7 +237,7 @@ cpp_quote("DEFINE_GUID(CGID_DocHostCommandHandler,0xf38bc242,0xb950,0x11d1,0x89, object, uuid(3050F6D0-98b5-11CF-BB82-00AA00BDCE0B), pointer_default(unique), - local + /* local, CXHACK 15579 */ ] interface IDocHostUIHandler2 : IDocHostUIHandler { @@ -253,7 +253,7 @@ interface IDocHostUIHandler2 : IDocHostUIHandler object, uuid(3050f3f0-98b5-11cf-bb82-00aa00bdce0b), pointer_default(unique), - local + /* local, CXHACK 15579 */ ] interface ICustomDoc : IUnknown { diff --git a/include/mshtml.idl b/include/mshtml.idl index 2a1fccba6be0..7fb245f5d5c2 100644 --- a/include/mshtml.idl +++ b/include/mshtml.idl @@ -30353,7 +30353,11 @@ interface IElementBehaviorFactory : IUnknown } /* library MSHTML */ +#ifdef MSHTML_MARSHALING_HACK +#define IOleCommandTarget IUnknown +#else interface IOleCommandTarget; +#endif /***************************************************************************** * IHTMLPrivateWindow interface @@ -30361,7 +30365,7 @@ interface IOleCommandTarget; [ object, uuid(3050f6dc-98b5-11cf-bb82-00aa00bdce0b), - local + /* local, CXHACK 15579 */ ] interface IHTMLPrivateWindow : IUnknown { @@ -30370,7 +30374,7 @@ interface IHTMLPrivateWindow : IUnknown HRESULT SetPICSTarget(IOleCommandTarget *cmdtrg); HRESULT PICSComplete(int arg); HRESULT FindWindowByName(LPCWSTR name, IHTMLWindow2 **ret); - HRESULT GetAddressBarUrl(BSTR *url); + HRESULT GetAddressBarUrl([out, retval] BSTR *url); } /***************************************************************************** @@ -30379,7 +30383,7 @@ interface IHTMLPrivateWindow : IUnknown [ object, uuid(3050f804-98b5-11cf-bb82-00aa00bdce0b), - local + /* local, CXHACK 15579 */ ] interface IWebBrowserPriv : IUnknown { @@ -30394,7 +30398,7 @@ interface IWebBrowserPriv : IUnknown [ object, uuid(3ed72303-6ffc-4214-ba90-faf1862dec8a), - local + /* local, CXHACK 15579 */ ] interface IWebBrowserPriv2IE8 : IUnknown { @@ -30416,7 +30420,7 @@ interface IWebBrowserPriv2IE8 : IUnknown [ object, uuid(3ed72303-6ffc-4214-ba90-faf1862dec8a), - local + /* local, CXHACK 15579 */ ] interface IWebBrowserPriv2IE9 : IUnknown { @@ -30424,3 +30428,7 @@ interface IWebBrowserPriv2IE9 : IUnknown VARIANT *headers, IBindCtx *bind_ctx, LPOLESTR url_fragment, DWORD unused); /* Probably more */ } + +#ifdef MSHTML_MARSHALING_HACK +#undef IOleCommandTarget +#endif diff --git a/include/shdeprecated.idl b/include/shdeprecated.idl index c8bb3fd9bf07..bb0559578e9a 100644 --- a/include/shdeprecated.idl +++ b/include/shdeprecated.idl @@ -186,7 +186,7 @@ cpp_quote("#define HLNF_ALLOW_AUTONAVIGATE 0x20000000") cpp_quote("#define HLNF_NEWWINDOWSMANAGED 0x80000000") [ - local, + /* local, CXHACK 15579 */ object, uuid(02ba3b52-0547-11d1-b833-00c04fc9b31f) ] @@ -220,7 +220,7 @@ interface IBrowserService : IUnknown HRESULT IEGetDisplayName( [in] PCIDLIST_ABSOLUTE pidl, - [out, size_is(INTERNET_MAX_URL_LENGTH)] LPWSTR pwszName, + [out, size_is(300)] LPWSTR pwszName, [in] UINT uFlags); HRESULT IEParseDisplayName( From 73c424801dfa319e00e1da3d88d8f7996354e390 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 16 Apr 2021 01:54:11 +0300 Subject: [PATCH 0728/2542] mshtml: Use environment variable instead of registry for dedicated thread hack. And auto enable it for The Bus. CW-Bug-Id: 18848 --- dlls/mshtml/oleobj.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index dbccda23efb6..a1c2b57009e5 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -3738,18 +3738,12 @@ static DWORD WINAPI gecko_main_thread_proc(void *arg) static BOOL WINAPI read_thread_config(INIT_ONCE *once, void *param, void **context) { - HKEY key; - DWORD res; - static const WCHAR enable_keyW[] = - {'S','o','f','t','w','a','r','e', - '\\','W','i','n','e', - '\\','M','S','H','T','M','L', - '\\','M','a','i','n','T','h','r','e','a','d','H','a','c','k',0}; - - res = RegOpenKeyW(HKEY_CURRENT_USER, enable_keyW, &key); - if(res == ERROR_SUCCESS) { - RegCloseKey(key); - FIXME("CXHACK: Using separated main thread.\n"); + char str[64]; + + if((GetEnvironmentVariableA("SteamGameId", str, sizeof(str)) && !strcmp(str, "491540")) + || (GetEnvironmentVariableA("WINE_GECKO_MAIN_THREAD", str, sizeof(str)) && *str != '0')) + { + FIXME("HACK: Using separated main thread.\n"); gecko_main_thread_config = TRUE; } @@ -3790,10 +3784,10 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii gecko_main_thread = GetCurrentThreadId(); gecko_main_thread_hwnd = get_thread_hwnd(); }else if(GetCurrentThreadId() != gecko_main_thread) { - FIXME("CXHACK: Creating HTMLDocument outside Gecko main thread\n"); + FIXME("HACK: Creating HTMLDocument outside Gecko main thread\n"); if(!gecko_main_thread_config) { - FIXME("CXHACK: Dedicated main thread not configured\n"); - FIXME("CXHACK: Create HKCU\\Software\\Wine\\MSHTML\\MainThreadHack key\n"); + FIXME("HACK: Dedicated main thread not configured\n"); + FIXME("HACK: Create HKCU\\Software\\Wine\\MSHTML\\MainThreadHack key\n"); } return create_marshaled_doc(gecko_main_thread_hwnd, riid, ppv); } From a3f09b988f493183e8f2f9eea89c21b458d6ea50 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 26 Jul 2021 21:18:36 +0300 Subject: [PATCH 0729/2542] mshtml: Also enable dedicated thread hack for The Sims 3. For The Sims 3 launcher crash. CW-Bug-Id: #19151 --- dlls/mshtml/oleobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index a1c2b57009e5..3b1c65c9a3b7 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -3740,7 +3740,7 @@ static BOOL WINAPI read_thread_config(INIT_ONCE *once, void *param, void **conte { char str[64]; - if((GetEnvironmentVariableA("SteamGameId", str, sizeof(str)) && !strcmp(str, "491540")) + if((GetEnvironmentVariableA("SteamGameId", str, sizeof(str)) && (!strcmp(str, "491540") || !strcmp(str,"47890"))) || (GetEnvironmentVariableA("WINE_GECKO_MAIN_THREAD", str, sizeof(str)) && *str != '0')) { FIXME("HACK: Using separated main thread.\n"); From e3ad514ad8fc268812425226fa109a926db9580b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 7 Jan 2022 23:54:20 +0300 Subject: [PATCH 0730/2542] mshtml: Also call before_async_open() for iframe in nsChannel_AsyncOpen(). CW-Bug-Id: #19930 --- dlls/ieframe/tests/webbrowser.c | 139 +++++++++++++++++++++++++++----- dlls/mshtml/nsio.c | 65 +++++++++++++++ 2 files changed, 185 insertions(+), 19 deletions(-) diff --git a/dlls/ieframe/tests/webbrowser.c b/dlls/ieframe/tests/webbrowser.c index 521b18bb599a..e3e35f7b0899 100644 --- a/dlls/ieframe/tests/webbrowser.c +++ b/dlls/ieframe/tests/webbrowser.c @@ -172,6 +172,7 @@ static HRESULT hr_site_TranslateAccelerator = E_NOTIMPL; static const WCHAR *current_url; static int wb_version, expect_update_commands_enable, set_update_commands_enable; static BOOL nav_back_todo, nav_forward_todo; /* FIXME */ +static BOOL navigation_cancelled; enum SessionOp { @@ -191,6 +192,8 @@ static LONG (WINAPI *pSetQueryNetSessionCount)(DWORD); #define DWL_HTTP 0x10 #define DWL_REFRESH 0x20 #define DWL_BACK_ENABLE 0x40 +#define DWL_IFRAME_NAV_CANCEL 0x80 +#define DWL_FROM_IFRAME_NAV_CANCEL 0x100 static DWORD dwl_flags; @@ -290,6 +293,8 @@ static void _test_ready_state(unsigned line, READYSTATE exstate, VARIANT_BOOL ex hres = IWebBrowser2_get_Busy(wb, &busy); if(expect_busy != BUSY_FAIL) { ok_(__FILE__,line)(hres == S_OK, "get_ReadyState failed: %08lx\n", hres); + todo_wine_if(dwl_flags & DWL_FROM_IFRAME_NAV_CANCEL && state == READYSTATE_LOADING + && busy != expect_busy) ok_(__FILE__,line)(busy == expect_busy, "Busy = %x, expected %x for ready state %d\n", busy, expect_busy, state); }else { @@ -415,13 +420,13 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID ok(nCmdexecopt == OLECMDEXECOPT_DONTPROMPTUSER || !nCmdexecopt, "nCmdexecopts=%08lx\n", nCmdexecopt); else - ok(!nCmdexecopt, "nCmdexecopts=%08lx\n", nCmdexecopt); + todo_wine_if(dwl_flags & DWL_IFRAME_NAV_CANCEL) ok(!nCmdexecopt, "nCmdexecopts=%08lx\n", nCmdexecopt); ok(pvaOut == NULL, "pvaOut=%p\n", pvaOut); ok(pvaIn != NULL, "pvaIn == NULL\n"); ok(V_VT(pvaIn) == VT_I4, "V_VT(pvaIn)=%d\n", V_VT(pvaIn)); switch(V_I4(pvaIn)) { case 0: - CHECK_EXPECT2(Exec_SETDOWNLOADSTATE_0); + todo_wine_if(dwl_flags & DWL_IFRAME_NAV_CANCEL) CHECK_EXPECT2(Exec_SETDOWNLOADSTATE_0); break; case 1: CHECK_EXPECT2(Exec_SETDOWNLOADSTATE_1); @@ -480,6 +485,7 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID }else if(IsEqualGUID(&CGID_ShellDocView, pguidCmdGroup)) { switch(nCmdID) { case 63: /* win10 */ + case 65: case 105: /* TODO */ case 132: /* win10 */ case 133: /* IE11 */ @@ -719,11 +725,11 @@ static void _test_invoke_bool(unsigned line, const DISPPARAMS *params, BOOL stri static void test_OnBeforeNavigate(const VARIANT *disp, const VARIANT *url, const VARIANT *flags, const VARIANT *frame, const VARIANT *post_data, const VARIANT *headers, const VARIANT *cancel) { + BOOL cancel_nav = FALSE; BSTR str; ok(V_VT(disp) == VT_DISPATCH, "V_VT(disp)=%d, expected VT_DISPATCH\n", V_VT(disp)); ok(V_DISPATCH(disp) != NULL, "V_DISPATCH(disp) == NULL\n"); - ok(V_DISPATCH(disp) == (IDispatch*)wb, "V_DISPATCH(disp)=%p, wb=%p\n", V_DISPATCH(disp), wb); ok(V_VT(url) == (VT_BYREF|VT_VARIANT), "V_VT(url)=%x, expected VT_BYREF|VT_VARIANT\n", V_VT(url)); ok(V_VARIANTREF(url) != NULL, "V_VARIANTREF(url) == NULL)\n"); @@ -731,10 +737,21 @@ static void test_OnBeforeNavigate(const VARIANT *disp, const VARIANT *url, const ok(V_VT(V_VARIANTREF(url)) == VT_BSTR, "V_VT(V_VARIANTREF(url))=%d, expected VT_BSTR\n", V_VT(V_VARIANTREF(url))); ok(V_BSTR(V_VARIANTREF(url)) != NULL, "V_BSTR(V_VARIANTREF(url)) == NULL\n"); - ok(!lstrcmpW(V_BSTR(V_VARIANTREF(url)), current_url), "unexpected url %s, expected %s\n", - wine_dbgstr_w(V_BSTR(V_VARIANTREF(url))), wine_dbgstr_w(current_url)); + if (!wcscmp(V_BSTR(V_VARIANTREF(url)), L"invalid:///")) + cancel_nav = TRUE; + if (!(dwl_flags & DWL_IFRAME_NAV_CANCEL && cancel_nav)) + ok(!lstrcmpW(V_BSTR(V_VARIANTREF(url)), current_url), "unexpected url %s, expected %s\n", + wine_dbgstr_w(V_BSTR(V_VARIANTREF(url))), wine_dbgstr_w(current_url)); } + if (dwl_flags & DWL_IFRAME_NAV_CANCEL && cancel_nav) + { + ok(!!V_DISPATCH(disp), "Got NULL disp.\n"); + todo_wine ok(V_DISPATCH(disp) != (IDispatch*)wb, "Got the same browser.\n"); + } + else + ok(V_DISPATCH(disp) == (IDispatch*)wb, "V_DISPATCH(disp)=%p, wb=%p\n", V_DISPATCH(disp), wb); + ok(V_VT(flags) == (VT_BYREF|VT_VARIANT), "V_VT(flags)=%x, expected VT_BYREF|VT_VARIANT\n", V_VT(flags)); ok(V_VT(flags) == (VT_BYREF|VT_VARIANT), "V_VT(flags)=%x, expected VT_BYREF|VT_VARIANT\n", @@ -805,8 +822,15 @@ static void test_OnBeforeNavigate(const VARIANT *disp, const VARIANT *url, const V_VT(cancel)); ok(V_BOOLREF(cancel) != NULL, "V_BOOLREF(pDispParams->rgvarg[0] == NULL)\n"); if(V_BOOLREF(cancel)) + { ok(*V_BOOLREF(cancel) == VARIANT_FALSE, "*V_BOOLREF(cancel) = %x, expected VARIANT_FALSE\n", *V_BOOLREF(cancel)); + if (cancel_nav) + { + *V_BOOLREF(cancel) = TRUE; + navigation_cancelled = TRUE; + } + } } static void test_navigatecomplete2(DISPPARAMS *dp) @@ -821,6 +845,7 @@ static void test_navigatecomplete2(DISPPARAMS *dp) ok(V_VT(dp->rgvarg) == (VT_BYREF|VT_VARIANT), "V_VT(dp->rgvarg) = %d\n", V_VT(dp->rgvarg)); v = V_VARIANTREF(dp->rgvarg); ok(V_VT(v) == VT_BSTR, "V_VT(url) = %d\n", V_VT(v)); + todo_wine_if(!memcmp(V_BSTR(v), L"file:", 10)) ok(!lstrcmpW(V_BSTR(v), current_url), "url=%s, expected %s\n", wine_dbgstr_w(V_BSTR(v)), wine_dbgstr_w(current_url)); @@ -845,6 +870,8 @@ static void test_documentcomplete(DISPPARAMS *dp) ok(V_VT(dp->rgvarg) == (VT_BYREF|VT_VARIANT), "V_VT(dp->rgvarg) = %d\n", V_VT(dp->rgvarg)); v = V_VARIANTREF(dp->rgvarg); ok(V_VT(v) == VT_BSTR, "V_VT(url) = %d\n", V_VT(v)); + + todo_wine_if(!memcmp(V_BSTR(v), L"file:", 10)) ok(!lstrcmpW(V_BSTR(v), current_url), "url=%s, expected %s\n", wine_dbgstr_w(V_BSTR(v)), wine_dbgstr_w(current_url)); @@ -907,9 +934,19 @@ static HRESULT WINAPI WebBrowserEvents2_Invoke(IDispatch *iface, DISPID dispIdMe pDispParams->rgvarg+3, pDispParams->rgvarg+2, pDispParams->rgvarg+1, pDispParams->rgvarg); if(dwl_flags & (DWL_FROM_PUT_HREF|DWL_FROM_GOFORWARD)) + { test_ready_state(READYSTATE_COMPLETE, VARIANT_FALSE); + } + else if (dwl_flags & DWL_IFRAME_NAV_CANCEL) + { + test_ready_state(READYSTATE_LOADING, navigation_cancelled ? VARIANT_TRUE : VARIANT_FALSE); + if (!navigation_cancelled) + SET_EXPECT(Invoke_BEFORENAVIGATE2); + } else - test_ready_state(READYSTATE_LOADING, VARIANT_FALSE); + { + test_ready_state(READYSTATE_LOADING, dwl_flags & DWL_FROM_IFRAME_NAV_CANCEL ? VARIANT_TRUE : VARIANT_FALSE); + } break; case DISPID_SETSECURELOCKICON: @@ -948,7 +985,7 @@ static HRESULT WINAPI WebBrowserEvents2_Invoke(IDispatch *iface, DISPID dispIdMe CHECK_EXPECT2(Invoke_COMMANDSTATECHANGE_NAVIGATEFORWARD_FALSE); } } - else if (V_I4(pDispParams->rgvarg+1) == CSC_NAVIGATEBACK) + else if (V_I4(pDispParams->rgvarg+1) == CSC_NAVIGATEBACK && !(dwl_flags & DWL_FROM_IFRAME_NAV_CANCEL)) { todo_wine_if(nav_back_todo) { if(V_BOOL(pDispParams->rgvarg)) @@ -1681,6 +1718,8 @@ static HRESULT WINAPI DocHostUIHandler_TranslateUrl(IDocHostUIHandler2 *iface, D { todo_wine_if(is_downloading && !(dwl_flags & DWL_EXPECT_BEFORE_NAVIGATE)) CHECK_EXPECT(TranslateUrl); + if (dwl_flags & DWL_IFRAME_NAV_CANCEL && wcscmp(pchURLIn, L"invalid:///")) + SET_EXPECT(TranslateUrl); return E_NOTIMPL; } @@ -2814,12 +2853,16 @@ static void test_ConnectionPoint(IWebBrowser2 *unk, BOOL init) static void test_Navigate2(IWebBrowser2 *webbrowser, const WCHAR *nav_url) { const WCHAR *title = L"WineHQ - Run Windows applications on Linux, BSD, Solaris and Mac OS X"; + const WCHAR *file_title = L"wine_test"; VARIANT url; BOOL is_file; HRESULT hres; test_LocationURL(webbrowser, is_first_load ? L"" : current_url); - test_LocationName(webbrowser, is_first_load ? L"" : (is_http ? title : current_url)); + if (current_url && !memcmp(current_url, L"file:", 10)) + test_LocationName(webbrowser, file_title); + else + test_LocationName(webbrowser, is_first_load ? L"" : (is_http ? title : current_url)); test_ready_state(is_first_load ? READYSTATE_UNINITIALIZED : READYSTATE_COMPLETE, VARIANT_FALSE); is_http = !memcmp(nav_url, "http:", 5); @@ -2990,6 +3033,8 @@ static void test_download(DWORD flags) BOOL *b = &called_Invoke_DOCUMENTCOMPLETE; MSG msg; + navigation_cancelled = FALSE; + if(flags & DWL_REFRESH) b = use_container_olecmd ? &called_Exec_SETDOWNLOADSTATE_0 : &called_Invoke_DOWNLOADCOMPLETE; else if((flags & DWL_FROM_PUT_HREF) && !use_container_olecmd && 0) @@ -3066,7 +3111,7 @@ static void test_download(DWORD flags) SET_EXPECT(GetOverridesKeyPath); /* Called randomly on some VMs. */ trace("Downloading...\n"); - while(!*b && GetMessageW(&msg, NULL, 0, 0)) { + while(!navigation_cancelled && !*b && GetMessageW(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessageW(&msg); } @@ -3097,11 +3142,14 @@ static void test_download(DWORD flags) CLEAR_CALLED(EnableModeless_FALSE); /* IE 8 */ if(!(flags & DWL_REFRESH)) { - todo_wine_if(nav_back_todo) { - if(flags & (DWL_FROM_GOFORWARD|DWL_BACK_ENABLE)) - CHECK_CALLED(Invoke_COMMANDSTATECHANGE_NAVIGATEBACK_TRUE); - else - CHECK_CALLED(Invoke_COMMANDSTATECHANGE_NAVIGATEBACK_FALSE); + if (!(flags & DWL_FROM_IFRAME_NAV_CANCEL)) + { + todo_wine_if(nav_back_todo) { + if(flags & (DWL_FROM_GOFORWARD|DWL_BACK_ENABLE)) + CHECK_CALLED(Invoke_COMMANDSTATECHANGE_NAVIGATEBACK_TRUE); + else + CHECK_CALLED(Invoke_COMMANDSTATECHANGE_NAVIGATEBACK_FALSE); + } } if(flags & DWL_FROM_GOBACK) CHECK_CALLED(Invoke_COMMANDSTATECHANGE_NAVIGATEFORWARD_TRUE); @@ -3118,20 +3166,26 @@ static void test_download(DWORD flags) if(!is_first_load) todo_wine CHECK_CALLED(GetHostInfo); if(use_container_olecmd) - CHECK_CALLED(Exec_SETDOWNLOADSTATE_0); + todo_wine_if(flags & DWL_IFRAME_NAV_CANCEL) CHECK_CALLED(Exec_SETDOWNLOADSTATE_0); else - CHECK_CALLED(Invoke_DOWNLOADCOMPLETE); + todo_wine_if(flags & DWL_IFRAME_NAV_CANCEL) CHECK_CALLED(Invoke_DOWNLOADCOMPLETE); todo_wine CHECK_CALLED(Invoke_TITLECHANGE); if(!(flags & DWL_REFRESH)) CHECK_CALLED(Invoke_NAVIGATECOMPLETE2); if(is_first_load) todo_wine CHECK_CALLED(GetDropTarget); - if(!(flags & DWL_REFRESH)) + if(!(flags & (DWL_REFRESH | DWL_IFRAME_NAV_CANCEL))) CHECK_CALLED(Invoke_DOCUMENTCOMPLETE); is_downloading = FALSE; - test_ready_state(READYSTATE_COMPLETE, VARIANT_FALSE); + if (flags & DWL_IFRAME_NAV_CANCEL) + { + test_ready_state(READYSTATE_INTERACTIVE, VARIANT_TRUE); + SET_EXPECT(Invoke_TITLECHANGE); + } + else + test_ready_state(READYSTATE_COMPLETE, VARIANT_FALSE); while(use_container_olecmd && !called_Exec_UPDATECOMMANDS && GetMessageA(&msg, NULL, 0, 0)) { TranslateMessage(&msg); @@ -3840,6 +3894,51 @@ static void init_test(IWebBrowser2 *webbrowser, DWORD flags) use_container_dochostui = !(flags & TEST_NODOCHOST); } +static const char iframe_doc_str[] = + ""; + +static void test_iframe_load(IWebBrowser2 *webbrowser) +{ + WCHAR file_path[MAX_PATH]; + WCHAR file_url[MAX_PATH]; + HRESULT hres; + HANDLE file; + VARIANT url; + DWORD size; + BOOL bret; + + GetTempPathW(MAX_PATH, file_path); + lstrcatW(file_path, L"wine_ifr_test.html"); + + file = CreateFileW(file_path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed, error %u.\n", GetLastError()); + if(file == INVALID_HANDLE_VALUE && GetLastError() != ERROR_FILE_EXISTS){ + ok(0, "CreateFile failed\n"); + return; + } + WriteFile(file, iframe_doc_str, strlen(iframe_doc_str), &size, NULL); + CloseHandle(file); + + GetLongPathNameW(file_path, file_path, ARRAY_SIZE(file_path)); + lstrcpyW(file_url, L"file://"); + lstrcatW(file_url, file_path); + + trace("iframe load...\n"); + test_Navigate2(webbrowser, file_url); + test_download(DWL_EXPECT_BEFORE_NAVIGATE|DWL_IFRAME_NAV_CANCEL|DWL_BACK_ENABLE); + + V_VT(&url) = VT_BSTR; + V_BSTR(&url) = SysAllocString(current_url = L"about:blank"); + hres = IWebBrowser2_Navigate2(webbrowser, &url, NULL, NULL, NULL, NULL); + ok(hres == S_OK, "Navigate2 failed: %08x\n", hres); + VariantClear(&url); + + test_download(DWL_EXPECT_BEFORE_NAVIGATE|DWL_FROM_IFRAME_NAV_CANCEL); + + bret = DeleteFileW(file_path); + ok(bret, "DeleteFileW failed, err %u.\n", GetLastError()); +} + static void test_WebBrowser(DWORD flags, BOOL do_close) { IWebBrowser2 *webbrowser; @@ -3868,6 +3967,7 @@ static void test_WebBrowser(DWORD flags, BOOL do_close) test_LocationURL(webbrowser, L""); test_ConnectionPoint(webbrowser, TRUE); + test_ClientSite(webbrowser, &ClientSite, !do_download); test_Extent(webbrowser); test_wb_funcs(webbrowser, TRUE); @@ -3934,6 +4034,8 @@ static void test_WebBrowser(DWORD flags, BOOL do_close) trace("GoForward...\n"); test_go_forward(webbrowser, L"http://test.winehq.org/tests/winehq_snapshot/", -1, 0); test_download(DWL_FROM_GOFORWARD|DWL_HTTP); + if (!(flags & TEST_NOOLECMD)) + test_iframe_load(webbrowser); }else { trace("Navigate2 repeated with the same URL...\n"); test_Navigate2(webbrowser, L"about:blank"); @@ -3942,7 +4044,6 @@ static void test_WebBrowser(DWORD flags, BOOL do_close) test_EnumVerbs(webbrowser); test_TranslateAccelerator(webbrowser); - test_dochost_qs(webbrowser); }else { test_ExecWB(webbrowser, TRUE); diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index a5564e1b6e49..ed8ed949fba9 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -287,6 +287,50 @@ static nsresult before_async_open(nsChannel *channel, GeckoBrowser *container, B return NS_OK; } +static nsresult fire_before_navigate(nsChannel *channel, HTMLOuterWindow *window, BOOL *cancel) +{ + BSTR frame_name = NULL; + OLECHAR *new_url; + BSTR uri_str; + HRESULT hres; + + hres = IUri_GetDisplayUri(channel->uri->uri, &uri_str); + if(FAILED(hres)) + { + ERR("IUri_GetDisplayUri failed, hres %#lx.\n", hres); + return NS_ERROR_FAILURE; + } + if(window->browser->doc->hostui) + { + hres = IDocHostUIHandler_TranslateUrl(window->browser->doc->hostui, 0, uri_str, &new_url); + if(hres == S_OK && new_url) + { + if(wcscmp(uri_str, new_url)) + { + FIXME("TranslateUrl returned new URL %s -> %s.\n", debugstr_w(uri_str), debugstr_w(new_url)); + CoTaskMemFree(new_url); + *cancel = TRUE; + SysFreeString(uri_str); + return NS_OK; + } + CoTaskMemFree(new_url); + } + } + + hres = IHTMLWindow2_get_name(&window->base.IHTMLWindow2_iface, &frame_name); + if (FAILED(hres)) + { + SysFreeString(uri_str); + return NS_ERROR_FAILURE; + } + + hres = IDocObjectService_FireBeforeNavigate2(window->browser->doc->doc_object_service, NULL, uri_str, 0x40, + frame_name, NULL, 0, NULL, TRUE, cancel); + SysFreeString(frame_name); + SysFreeString(uri_str); + return SUCCEEDED(hres) ? NS_OK : NS_ERROR_FAILURE; +} + HRESULT load_nsuri(HTMLOuterWindow *window, nsWineURI *uri, nsIInputStream *post_stream, nsChannelBSC *channelbsc, DWORD flags) { @@ -1104,6 +1148,27 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen This->content_type = strdupWtoA(window->browser->doc->mime); } } + else if (window->browser && window->frame_element && window->browser->doc + && window->browser->doc->doc_object_service) + { + IUnknown *unk; + if (SUCCEEDED(IHTMLFrameBase_QueryInterface(&window->frame_element->IHTMLFrameBase_iface, + &IID_IHTMLIFrameElement, (void **)&unk))) + { + IUnknown_Release(unk); + nsres = fire_before_navigate(This, window, &cancel); + if(NS_SUCCEEDED(nsres) && cancel) + { + TRACE("canceled.\n"); + nsres = NS_BINDING_ABORTED; + } + else + { + FIXME("fire_before_navigate returned error %#lx.\n", nsres); + nsres = NS_OK; + } + } + } } if(!cancel) From 01541ea912f880500ec86e579d75bae10b4d7c51 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 25 May 2021 20:48:17 +0300 Subject: [PATCH 0731/2542] mshtml: HACK: Split rules in HTMLStyleSheet_put_cssText(). For Open Swords of Legends Online: Beta launcher. CW-Bug-Id: #18963 --- dlls/mshtml/htmlstylesheet.c | 49 +++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/dlls/mshtml/htmlstylesheet.c b/dlls/mshtml/htmlstylesheet.c index 4b9cc3f56a65..1f040e515e23 100644 --- a/dlls/mshtml/htmlstylesheet.c +++ b/dlls/mshtml/htmlstylesheet.c @@ -950,17 +950,48 @@ static HRESULT WINAPI HTMLStyleSheet_put_cssText(IHTMLStyleSheet *iface, BSTR v) }while(NS_SUCCEEDED(nsres)); if(v && *v) { + UINT32 i, depth, idx; nsAString nsstr; - UINT32 idx; - - /* FIXME: This won't work for multiple rules in the string. */ - nsAString_InitDepend(&nsstr, v); - nsres = nsIDOMCSSStyleSheet_InsertRule(This->nsstylesheet, &nsstr, 0, &idx); - nsAString_Finish(&nsstr); - if(NS_FAILED(nsres)) { - FIXME("InsertRule failed for string %s. Probably multiple rules passed.\n", debugstr_w(v)); - return E_FAIL; + WCHAR *ws; + + depth = 0; + ws = malloc(sizeof(*ws) * (lstrlenW(v) + 1)); + do + { + for (i = 0; v[i]; ++i) + { + ws[i] = v[i]; + if (ws[i] == '{') + ++depth; + else if (ws[i] == '}' && !--depth) + break; + } + if (ws[i]) + ws[++i] = 0; + + v += i; + + for (i = 0; ws[i]; ++i) + if (!iswspace(ws[i])) + break; + + if (!ws[i]) + { + TRACE("Skipping empty part.\n"); + continue; + } + + nsAString_InitDepend(&nsstr, ws); + nsres = nsIDOMCSSStyleSheet_InsertRule(This->nsstylesheet, &nsstr, 0, &idx); + nsAString_Finish(&nsstr); + + if(NS_FAILED(nsres)) + FIXME("InsertRule failed for string %s.\n", debugstr_w(ws)); + else + TRACE("Added rule %s.\n", debugstr_w(ws)); } + while (*v); + free(ws); } return S_OK; From 122aff4e3a6bd021565dde10a0108209ebb22680 Mon Sep 17 00:00:00 2001 From: Matteo Bruni Date: Sat, 24 Aug 2019 00:58:42 +0200 Subject: [PATCH 0732/2542] wined3d: Avoid NaNs in RCP and RSQ in <= SM3. CW-Bug-Id: #21762 Fixes sporadic white screen in Chapter 1 Act 3 in A Hat in Time. FWIW the NaNs end up in a RGBA16F render target, another option that might work is to fixup NaNs when writing them into the pixel shader output. --- dlls/wined3d/glsl_shader.c | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 5deb08147448..0bd2c4655b98 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -2760,6 +2760,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c shader_addline(buffer, ";\n"); } } + shader_addline(buffer, "const float FLT_MAX = 1e38;\n"); } /* Prototypes */ @@ -4380,9 +4381,10 @@ static void shader_glsl_scalar_op(const struct wined3d_shader_instruction *ins) { DWORD shader_version = WINED3D_SHADER_VERSION(ins->ctx->reg_maps->shader_version.major, ins->ctx->reg_maps->shader_version.minor); + struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data; struct wined3d_string_buffer *buffer = ins->ctx->buffer; + struct wined3d_string_buffer *prefix, *suffix; struct glsl_src_param src0_param; - const char *prefix, *suffix; unsigned int dst_size; DWORD dst_write_mask; @@ -4394,41 +4396,50 @@ static void shader_glsl_scalar_op(const struct wined3d_shader_instruction *ins) shader_glsl_add_src_param(ins, &ins->src[0], dst_write_mask, &src0_param); + prefix = string_buffer_get(priv->string_buffers); + suffix = string_buffer_get(priv->string_buffers); + switch (ins->handler_idx) { case WINED3DSIH_EXP: case WINED3DSIH_EXPP: - prefix = "exp2("; - suffix = ")"; + string_buffer_sprintf(prefix, "exp2("); + string_buffer_sprintf(suffix, ")"); break; case WINED3DSIH_LOG: case WINED3DSIH_LOGP: - prefix = "log2(abs("; - suffix = "))"; + string_buffer_sprintf(prefix, "log2(abs("); + string_buffer_sprintf(suffix, "))"); break; case WINED3DSIH_RCP: - prefix = "1.0 / "; - suffix = ""; + if (shader_version <= WINED3D_SHADER_VERSION(3, 0)) + string_buffer_sprintf(prefix, "%s == 0.0 ? FLT_MAX : 1.0 / ", src0_param.param_str); + else + string_buffer_sprintf(prefix, "1.0 / "); break; case WINED3DSIH_RSQ: - prefix = "inversesqrt(abs("; - suffix = "))"; + if (shader_version <= WINED3D_SHADER_VERSION(3, 0)) + string_buffer_sprintf(prefix, "%s == 0.0 ? FLT_MAX : inversesqrt(abs(", src0_param.param_str); + else + string_buffer_sprintf(prefix, "inversesqrt(abs("); + string_buffer_sprintf(suffix, "))"); break; default: - prefix = ""; - suffix = ""; FIXME("Unhandled instruction %#x.\n", ins->handler_idx); break; } if (dst_size > 1 && shader_version < WINED3D_SHADER_VERSION(4, 0)) - shader_addline(buffer, "vec%u(%s%s%s));\n", dst_size, prefix, src0_param.param_str, suffix); + shader_addline(buffer, "vec%u(%s%s%s));\n", dst_size, prefix->buffer, src0_param.param_str, suffix->buffer); else - shader_addline(buffer, "%s%s%s);\n", prefix, src0_param.param_str, suffix); + shader_addline(buffer, "%s%s%s);\n", prefix->buffer, src0_param.param_str, suffix->buffer); + + string_buffer_release(priv->string_buffers, prefix); + string_buffer_release(priv->string_buffers, suffix); } /** Process the WINED3DSIO_EXPP instruction in GLSL: From e45a4d6de92ae03a7f0ef1f0cab11e99f129498c Mon Sep 17 00:00:00 2001 From: Matteo Bruni Date: Tue, 27 Aug 2019 02:55:16 +0200 Subject: [PATCH 0733/2542] wined3d: Avoid NaNs in LOG and LOGP. CW-Bug-Id: #21762 Fixes some white artifacts in A Hat in Time Chapter 2 Act 1. --- dlls/wined3d/glsl_shader.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 0bd2c4655b98..b3c28dfdba87 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -4409,7 +4409,10 @@ static void shader_glsl_scalar_op(const struct wined3d_shader_instruction *ins) case WINED3DSIH_LOG: case WINED3DSIH_LOGP: - string_buffer_sprintf(prefix, "log2(abs("); + if (shader_version <= WINED3D_SHADER_VERSION(3, 0)) + string_buffer_sprintf(prefix, "%s == 0.0 ? -FLT_MAX : log2(abs(", src0_param.param_str); + else + string_buffer_sprintf(prefix, "log2(abs("); string_buffer_sprintf(suffix, "))"); break; From 22476108760d2142b2ca23c4bdc75903f431d25e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 20 Jun 2022 12:24:04 -0500 Subject: [PATCH 0734/2542] winex11.drv: HACK: Add WINE_SHARE_ALL_GL_CONTEXTS environment variable. And auto enable it for Eador. Masters of the Broken World. CW-Bug-Id: #20830 wglShareLists() cannot be properly implemented on top of glX context sharing. --- dlls/winex11.drv/opengl.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 0e831e2a05c9..fca9ae525949 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -2411,6 +2411,34 @@ static BOOL glxdrv_wglCopyContext(struct wgl_context *src, struct wgl_context *d return TRUE; } +static int share_all_contexts = -1; + +static GLXContext get_common_context( GLXFBConfig fbconfig ) +{ + static GLXContext common_context; + + if (share_all_contexts == -1) + { + const char *e = getenv( "WINE_SHARE_ALL_GL_CONTEXTS" ); + const char *sgi = getenv( "SteamGameId" ); + + if (e) + share_all_contexts = !!atoi(e); + else + share_all_contexts = sgi && !strcmp( sgi, "232050" ); + + if (share_all_contexts) + FIXME( "HACK: sharing all the GL contexts.\n" ); + } + + if (!share_all_contexts) return NULL; + + if (!common_context) + common_context = pglXCreateNewContext( gdi_display, fbconfig, GLX_RGBA_TYPE, NULL, TRUE ); + + return common_context; +} + /*********************************************************************** * glxdrv_wglCreateContext */ @@ -2429,7 +2457,7 @@ static struct wgl_context *glxdrv_wglCreateContext( HDC hdc ) { ret->hdc = hdc; ret->fmt = gl->format; - ret->ctx = create_glxcontext(gdi_display, ret, NULL); + ret->ctx = create_glxcontext(gdi_display, ret, get_common_context( ret->fmt->fbconfig )); pthread_mutex_lock( &context_mutex ); list_add_head( &context_list, &ret->entry ); pthread_mutex_unlock( &context_mutex ); @@ -3117,6 +3145,8 @@ static BOOL glxdrv_wglShareLists(struct wgl_context *org, struct wgl_context *de * hasn't been made current and it hasn't shared display lists before. */ + if (share_all_contexts == 1) return TRUE; + if (!dest->has_been_current && !dest->sharing) { keep = org; @@ -3352,7 +3382,8 @@ static struct wgl_context *X11DRV_wglCreateContextAttribsARB( HDC hdc, struct wg } X11DRV_expect_error(gdi_display, GLXErrorHandler, NULL); - ret->ctx = create_glxcontext(gdi_display, ret, hShareContext ? hShareContext->ctx : NULL); + ret->ctx = create_glxcontext(gdi_display, ret, + hShareContext ? hShareContext->ctx : get_common_context( ret->fmt->fbconfig )); XSync(gdi_display, False); if ((err = X11DRV_check_error()) || !ret->ctx) { From 641d15d21f94c4069ff3383d792e4fb80a6dd9e1 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 20 Jun 2022 12:43:39 -0500 Subject: [PATCH 0735/2542] winex11.drv: HACK: Enable WINE_SHARE_ALL_GL_CONTEXTS for Cossacks 3. CW-Bug-Id: #20532 --- dlls/winex11.drv/opengl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index fca9ae525949..159e35c4eefe 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -2425,7 +2425,7 @@ static GLXContext get_common_context( GLXFBConfig fbconfig ) if (e) share_all_contexts = !!atoi(e); else - share_all_contexts = sgi && !strcmp( sgi, "232050" ); + share_all_contexts = sgi && (!strcmp( sgi, "232050" ) || !strcmp( sgi, "333420" )); if (share_all_contexts) FIXME( "HACK: sharing all the GL contexts.\n" ); From 95dbcfe141ec36e04d57eba9d38e212d31ea7ded Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 28 Oct 2022 20:25:39 -0500 Subject: [PATCH 0736/2542] winex11.drv: HACK: Enable WINE_SHARE_ALL_GL_CONTEXTS for EADesktop. CW-Bug-Id: #21497 --- dlls/winex11.drv/opengl.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 159e35c4eefe..d37c32c058c4 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -2425,8 +2425,24 @@ static GLXContext get_common_context( GLXFBConfig fbconfig ) if (e) share_all_contexts = !!atoi(e); else + { share_all_contexts = sgi && (!strcmp( sgi, "232050" ) || !strcmp( sgi, "333420" )); - + if (!share_all_contexts) + { + static const WCHAR ea_desktop[] = u"EADesktop.exe"; + UNICODE_STRING *name; + DWORD len, name_len; + + name = &NtCurrentTeb()->Peb->ProcessParameters->ImagePathName; + len = name->Length / sizeof(WCHAR); + if (len && !name->Buffer[len]) --len; + name_len = sizeof(ea_desktop) / sizeof(*ea_desktop) - 1; + + if (len >= name_len) + share_all_contexts = !memcmp( name->Buffer + len - name_len, ea_desktop, + name_len * sizeof(*ea_desktop) ); + } + } if (share_all_contexts) FIXME( "HACK: sharing all the GL contexts.\n" ); } From 6e63292a05732140912bfbd3f853014672299a84 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 13 Jul 2022 19:56:49 -0500 Subject: [PATCH 0737/2542] user32: Send WM_NCPAINT as notify message in send_ncpaint(). CW-Bug-Id: #20969 --- dlls/win32u/dce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index d9c5f1613855..c58029752df2 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -1571,7 +1571,7 @@ static HRGN send_ncpaint( HWND hwnd, HWND *child, UINT *flags ) if (style & WS_VSCROLL) set_standard_scroll_painted( hwnd, SB_VERT, FALSE ); - send_message( hwnd, WM_NCPAINT, (WPARAM)whole_rgn, 0 ); + send_notify_message( hwnd, WM_NCPAINT, (WPARAM)whole_rgn, 0, FALSE ); } if (whole_rgn > (HRGN)1) NtGdiDeleteObjectApp( whole_rgn ); } From 61b2604538993396416a126ba23c9c98e7561e47 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 24 May 2022 16:27:08 -0500 Subject: [PATCH 0738/2542] user32: Flush driver display in ReleaseDC() for other process window. CW-Bug-Id: #19779 --- dlls/win32u/dce.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index c58029752df2..e64108091651 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -1382,6 +1382,9 @@ HDC WINAPI NtUserGetDCEx( HWND hwnd, HRGN clip_rgn, DWORD flags ) */ INT WINAPI NtUserReleaseDC( HWND hwnd, HDC hdc ) { + if (hwnd && !is_current_process_window( hwnd )) + user_driver->pProcessEvents( 0 ); + return release_dc( hwnd, hdc, FALSE ); } From 1ae817279088b5aecf69d54a2bed93cb0cf93eaf Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Sat, 12 Nov 2022 14:03:56 -0600 Subject: [PATCH 0739/2542] win32u: Send notify message in NtUserFlashWindowEx(). CW-Bug-Id: #21562 --- dlls/win32u/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 7e2d2fc3c969..e700f6311d60 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -4924,7 +4924,7 @@ BOOL WINAPI NtUserFlashWindowEx( FLASHWINFO *info ) release_win_ptr( win ); if (!info->dwFlags || info->dwFlags & FLASHW_CAPTION) - send_message( hwnd, WM_NCACTIVATE, wparam, 0 ); + send_notify_message( hwnd, WM_NCACTIVATE, wparam, 0, 0 ); user_driver->pFlashWindowEx( info ); return wparam; From 11c7c2b7abaa18c1d2cb8406d18ded5dea0e677e Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Thu, 3 Feb 2022 09:51:28 +0100 Subject: [PATCH 0740/2542] HACK: winex11.drv/opengl: Do not trigger a libX11 bug. Sometimes The Last Campfire passes invalid parameters to wglCreateContextAttribsARB, which on the Deck can trigger a libX11 bug and crash Wine. When we see the invalid value we return an error directly, without calling glXCreateContextAttribsARB. This hack can be removed once https://gitlab.freedesktop.org/xorg/lib/libx11/-/issues/152 is fixed (which happened in libx11 1.7.4). CW-Bug-Id: #20026 --- dlls/winex11.drv/opengl.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index d37c32c058c4..837499b79830 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -3367,6 +3367,21 @@ static struct wgl_context *X11DRV_wglCreateContextAttribsARB( HDC hdc, struct wg case WGL_CONTEXT_LAYER_PLANE_ARB: break; case WGL_CONTEXT_FLAGS_ARB: + /* HACK: The Last Campfire sometimes uses an + * invalid value for WGL_CONTEXT_FLAGS_ARB, which + * triggers + * https://gitlab.freedesktop.org/xorg/lib/libx11/-/issues/152 + * on the Deck. If we see the invalid value we + * directly return an error, so that Wine doesn't + * crash. This hack can be removed once that issue + * is fixed. */ + if (attribList[1] == 0x31b3) + { + WARN("return early to avoid triggering a libX11 bug\n"); + free(ret); + release_gl_drawable(gl); + return NULL; + } pContextAttribList[0] = GLX_CONTEXT_FLAGS_ARB; pContextAttribList[1] = attribList[1]; pContextAttribList += 2; From 1953fa17b1193b0b79429e704c34f2278d9863a3 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 22 Mar 2022 21:44:24 +0300 Subject: [PATCH 0741/2542] ntdll: HACK: Also use Windows syscall numbers for Swords of Legends Online. CW-Bug-Id: #20330 --- dlls/ntdll/unix/signal_x86_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index b749e147c1b8..b4309a8ca2e7 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -2018,7 +2018,7 @@ static void install_bpf(struct sigaction *sig_act) { const char *sgi = getenv("SteamGameId"); - if (sgi && (!strcmp(sgi, "1174180") || !strcmp(sgi, "1404210"))) + if (sgi && (!strcmp(sgi, "1174180") || !strcmp(sgi, "1404210") || !strcmp(sgi, "1418100"))) { /* Use specific signal handler. */ sig_act->sa_sigaction = sigsys_handler_rdr2; From 84fd911967fe660f99925ad01c00d00e62efbb53 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 20 May 2022 18:47:05 -0500 Subject: [PATCH 0742/2542] win32u: HACK: Sync calls to vkQueuePresentKHR(). CW-Bug-Id: #18863 --- dlls/win32u/vulkan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/win32u/vulkan.c b/dlls/win32u/vulkan.c index 04e397508e1f..667fdfe5c966 100644 --- a/dlls/win32u/vulkan.c +++ b/dlls/win32u/vulkan.c @@ -1256,6 +1256,8 @@ static VkResult record_compute_cmd( struct vulkan_device *device, struct swapcha static VkResult win32u_vkQueuePresentKHR( VkQueue client_queue, const VkPresentInfoKHR *present_info ) { + static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; + struct vulkan_queue *queue = vulkan_queue_from_handle( client_queue ); VkSwapchainKHR swapchains_buffer[16], *swapchains = swapchains_buffer; VkPresentInfoKHR present_info_host = *present_info; @@ -1373,7 +1375,9 @@ static VkResult win32u_vkQueuePresentKHR( VkQueue client_queue, const VkPresentI present_info_host.pWaitSemaphores = &blit_sema; } + pthread_mutex_lock( &lock ); res = device->p_vkQueuePresentKHR( queue->host.queue, &present_info_host ); + pthread_mutex_unlock( &lock ); for (i = 0; i < present_info->swapchainCount; i++) { From 6e93c4c108f0a2edd4f89a3c0c427c17d5405add Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 1 Mar 2022 22:11:17 +0300 Subject: [PATCH 0743/2542] winex11.drv: Generate EDID if one is not available from xrandr. CW-Bug-Id: #20204 CW-Bug-Id: #19217 --- dlls/winex11.drv/xrandr.c | 110 ++++++++++++++++++++++++++++++++++---- 1 file changed, 99 insertions(+), 11 deletions(-) diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index 3747b5e16909..14ba0cf4603f 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -32,6 +32,7 @@ #include #endif #include +#include #include "x11drv.h" #include "wine/debug.h" @@ -533,23 +534,108 @@ static void get_screen_size( XRRScreenResources *resources, unsigned int *width, } } -static unsigned int get_edid( RROutput output, unsigned char **prop ) +static unsigned int get_edid( RROutput output, unsigned char **prop, + XRROutputInfo *output_info, XRRScreenResources *screen_resources ) { - int result, actual_format; + unsigned int mwidth, mheight, i; unsigned long bytes_after, len; + unsigned char *edid, *p, c; + int result, actual_format; + XRRModeInfo *mode; Atom actual_type; + *prop = NULL; result = pXRRGetOutputProperty( gdi_display, output, x11drv_atom(EDID), 0, 128, FALSE, FALSE, AnyPropertyType, &actual_type, &actual_format, &len, - &bytes_after, prop ); + &bytes_after, &edid ); + if (result == Success && len) + { + if (!(*prop = malloc( len ))) + { + XFree( edid ); + return 0; + } + memcpy( *prop, edid, len ); + return len; + } - if (result != Success) + WARN( "Could not retrieve EDID property for output %#lx.\n", output ); + if (!output_info->npreferred) { - WARN("Could not retrieve EDID property for output %#lx.\n", output); - *prop = NULL; + WARN( "No preferred modes for output %#lx.\n", output ); return 0; } - return len; + if (output_info->npreferred > 1) + WARN( "%u preferred modes for output %#lx, using first one.\n", output_info->npreferred, output ); + + for (i = 0; i < screen_resources->nmode; ++i) + if (screen_resources->modes[i].id == output_info->modes[0]) break; + + if (i == screen_resources->nmode) + { + ERR("Preferred mode not found for output %#lx.\n", output); + return 0; + } + + mode = &screen_resources->modes[i]; + + mwidth = mode->width / 60; /* Fake ~150dpi. */ + mheight = mode->height / 60; + + edid = calloc( 1, 128 ); + *prop = edid; + *(uint64_t *)edid = 0x00ffffffffffff00; + edid[18] = 1; + edid[19] = 4; + edid[20] = 0xa0; /* Digital input, 8 bit depth. */ + edid[21] = mwidth; + edid[22] = mheight; + edid[24] = 0x6; + for (i = 0; i < 16; ++i) edid[38 + i] = 1; + + p = edid + 54; + *(uint16_t *)&p[0] = mode->dotClock / 10000; + p[2] = mode->width; + p[3] = mode->hTotal - mode->width; + p[4] = (((mode->hTotal - mode->width) >> 8) & 0xf) | (((mode->width >> 8) & 0xf) << 4); + p[5] = mode->height; + p[6] = mode->vTotal - mode->height; + p[7] = (((mode->vTotal - mode->height) >> 8) & 0xf) | (((mode->height >> 8) & 0xf) << 4); + p[8] = mode->hSyncStart - mode->width; + p[9] = mode->hSyncEnd - mode->hSyncStart; + p[10] = (((mode->vSyncStart - mode->height) & 0xf) << 4) | ((mode->vSyncEnd - mode->vSyncStart) & 0xf); + p[11] = ((((mode->hSyncStart - mode->width) >> 8) & 3) << 6) + | ((((mode->hSyncEnd - mode->hSyncStart) >> 8) & 3) << 4) + | ((((mode->vSyncStart - mode->height) >> 4) & 3) << 2) + | (((mode->vSyncEnd - mode->vSyncStart) >> 4) & 3); + p[12] = mwidth; + p[13] = mheight; + p[14] = (((mwidth >> 8) & 0xf) << 4) | ((mheight >> 8) & 0xf); + if (mode->modeFlags & RR_Interlace) + p[17] |= 0x80; + p[17] |= 3 << 3; + if (mode->modeFlags & RR_HSyncPositive) + p[17] |= 2; + if (mode->modeFlags & RR_VSyncPositive) + p[17] |= 4; + + if (mode->modeFlags & (RR_DoubleScan | RR_PixelMultiplex | RR_DoubleClock | RR_ClockDivideBy2)) + FIXME( "Unsupported flags %#lx.\n", mode->modeFlags ); + + p += 18; + p[3] = 0xfc; + strcpy( (char *)p + 5, "Default" ); + + p += 18; + p[3] = 0x10; + p += 18; + p[3] = 0x10; + + c = 0; + for (i = 0; i < 127; ++i) + c += edid[i]; + edid[127] = 256 - c; + return 128; } static void set_screen_size( int width, int height ) @@ -1082,7 +1168,8 @@ static BOOL xrandr14_get_monitors( ULONG_PTR adapter_id, struct gdi_monitor **ne /* Inactive but attached monitor, no need to check for mirrored/replica monitors */ if (!output_info->crtc || !crtc_info->mode) { - monitors[monitor_count].edid_len = get_edid( adapter_id, &monitors[monitor_count].edid ); + monitors[monitor_count].edid_len = get_edid( adapter_id, &monitors[monitor_count].edid, + output_info, screen_resources ); monitor_count = 1; } /* Active monitors, need to find other monitors with the same coordinates as mirrored */ @@ -1133,7 +1220,8 @@ static BOOL xrandr14_get_monitors( ULONG_PTR adapter_id, struct gdi_monitor **ne primary_index = monitor_count; monitors[monitor_count].edid_len = get_edid( screen_resources->outputs[i], - &monitors[monitor_count].edid ); + &monitors[monitor_count].edid, + enum_output_info, screen_resources ); monitor_count++; } @@ -1177,7 +1265,7 @@ static BOOL xrandr14_get_monitors( ULONG_PTR adapter_id, struct gdi_monitor **ne for (i = 0; i < monitor_count; i++) { if (monitors[i].edid) - XFree( monitors[i].edid ); + free( monitors[i].edid ); } free( monitors ); ERR("Failed to get monitors\n"); @@ -1192,7 +1280,7 @@ static void xrandr14_free_monitors( struct gdi_monitor *monitors, int count ) for (i = 0; i < count; i++) { if (monitors[i].edid) - XFree( monitors[i].edid ); + free( monitors[i].edid ); } free( monitors ); } From 8ca70c5be9bf8d89e93a2c80d23814d13b5a0fa9 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 13 Feb 2023 17:06:08 -0600 Subject: [PATCH 0744/2542] winex11.drv: Use EDID suggested by Gamescope. CW-Bug-Id: #21894 --- dlls/winex11.drv/x11drv.h | 1 + dlls/winex11.drv/x11drv_main.c | 3 ++- dlls/winex11.drv/xrandr.c | 26 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index c70b2d53dbfe..b00bdb37a675 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -560,6 +560,7 @@ enum x11drv_atoms XATOM_text_richtext, XATOM_text_uri_list, XATOM_GAMESCOPE_FOCUSED_APP, + XATOM_GAMESCOPE_DISPLAY_EDID_PATH, NB_XATOMS }; diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 20447a3378be..a9715cfc9fdb 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -197,7 +197,8 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "text/rtf", "text/richtext", "text/uri-list", - "GAMESCOPE_FOCUSED_APP" + "GAMESCOPE_FOCUSED_APP", + "GAMESCOPE_DISPLAY_EDID_PATH", }; /*********************************************************************** diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index 14ba0cf4603f..4fe479c974a1 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -543,6 +543,7 @@ static unsigned int get_edid( RROutput output, unsigned char **prop, int result, actual_format; XRRModeInfo *mode; Atom actual_type; + char *edid_path; *prop = NULL; result = pXRRGetOutputProperty( gdi_display, output, x11drv_atom(EDID), 0, 128, FALSE, FALSE, @@ -559,6 +560,31 @@ static unsigned int get_edid( RROutput output, unsigned char **prop, return len; } + edid_path = NULL; + if ((result = XGetWindowProperty( gdi_display, DefaultRootWindow(gdi_display), x11drv_atom(GAMESCOPE_DISPLAY_EDID_PATH), 0, + PATH_MAX, False, x11drv_atom(UTF8_STRING), &actual_type, &actual_format, + &len, &bytes_after, (unsigned char **)&edid_path )) == Success + && actual_type == x11drv_atom(UTF8_STRING)) + { + char buffer[4096]; + FILE *f; + + f = fopen( edid_path, "rb" ); + if (f) + { + len = fread( buffer, 1, sizeof(buffer), f ); + fclose( f ); + if (len) + { + XFree( edid_path ); + if (!(*prop = malloc( len ))) return 0; + memcpy( *prop, buffer, len ); + return len; + } + } + } + if (edid_path) XFree( edid_path ); + WARN( "Could not retrieve EDID property for output %#lx.\n", output ); if (!output_info->npreferred) { From 7b50cb8a2df1dce5e28a521c078686815cb25724 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Tue, 19 Oct 2021 10:39:18 +0200 Subject: [PATCH 0745/2542] HACK: user32: Process WM_PAINT in peek_message for WS_EX_COMPOSITED windows. CW-Bug-Id: #19488 --- dlls/win32u/message.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 1fa55313c581..c4ec26c1ccd0 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -3045,6 +3045,15 @@ int peek_message( MSG *msg, const struct peek_message_filter *filter ) info.msg.lParam = result->lparam; } } + /* CXHACK 19488 */ + if (info.msg.message == WM_PAINT && + flags == (PM_REMOVE | PM_QS_INPUT | PM_QS_POSTMESSAGE | PM_QS_PAINT | PM_QS_SENDMESSAGE) && + (get_window_long( info.msg.hwnd, GWL_EXSTYLE ) & WS_EX_COMPOSITED )) + { + send_message( info.msg.hwnd, info.msg.message, info.msg.wParam, info.msg.lParam ); + flags &= ~PM_QS_PAINT; + continue; + } *msg = info.msg; msg->pt = point_phys_to_win_dpi( info.msg.hwnd, info.msg.pt ); thread_info->client_info.message_pos = MAKELONG( msg->pt.x, msg->pt.y ); From e6a6664fa2b694b52cca79f01908c107831a9634 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 22 Jun 2022 10:36:46 -0500 Subject: [PATCH 0746/2542] opengl32: HACK: Fixup shaders for Cossacks 3. CW-Bug-Id: #20865 --- dlls/opengl32/make_opengl | 2 + dlls/opengl32/thunks.c | 18 +------- dlls/opengl32/wgl.c | 94 +++++++++++++++++++++++++++++++++++++++ include/wine/wgl_driver.h | 2 +- 4 files changed, 99 insertions(+), 17 deletions(-) diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 1e55fdf45aaf..7a9911305708 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -174,6 +174,8 @@ my %manual_win_thunks = "glMapNamedBufferEXT" => 1, "glMapNamedBufferRange" => 1, "glMapNamedBufferRangeEXT" => 1, + "glShaderSource" => 1, + "glShaderSourceARB" => 1, "glUnmapBuffer" => 1, "glUnmapBufferARB" => 1, "glUnmapNamedBuffer" => 1, diff --git a/dlls/opengl32/thunks.c b/dlls/opengl32/thunks.c index ccabbbc7519c..506e55b7fd28 100644 --- a/dlls/opengl32/thunks.c +++ b/dlls/opengl32/thunks.c @@ -17970,22 +17970,6 @@ static void WINAPI glShaderOp3EXT( GLenum op, GLuint res, GLuint arg1, GLuint ar if ((status = UNIX_CALL( glShaderOp3EXT, &args ))) WARN( "glShaderOp3EXT returned %#lx\n", status ); } -static void WINAPI glShaderSource( GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length ) -{ - struct glShaderSource_params args = { .teb = NtCurrentTeb(), .shader = shader, .count = count, .string = string, .length = length }; - NTSTATUS status; - TRACE( "shader %d, count %d, string %p, length %p\n", shader, count, string, length ); - if ((status = UNIX_CALL( glShaderSource, &args ))) WARN( "glShaderSource returned %#lx\n", status ); -} - -static void WINAPI glShaderSourceARB( GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length ) -{ - struct glShaderSourceARB_params args = { .teb = NtCurrentTeb(), .shaderObj = shaderObj, .count = count, .string = string, .length = length }; - NTSTATUS status; - TRACE( "shaderObj %d, count %d, string %p, length %p\n", shaderObj, count, string, length ); - if ((status = UNIX_CALL( glShaderSourceARB, &args ))) WARN( "glShaderSourceARB returned %#lx\n", status ); -} - static void WINAPI glShaderStorageBlockBinding( GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding ) { struct glShaderStorageBlockBinding_params args = { .teb = NtCurrentTeb(), .program = program, .storageBlockIndex = storageBlockIndex, .storageBlockBinding = storageBlockBinding }; @@ -24306,6 +24290,8 @@ extern void * WINAPI glMapNamedBuffer( GLuint buffer, GLenum access ); extern void * WINAPI glMapNamedBufferEXT( GLuint buffer, GLenum access ); extern void * WINAPI glMapNamedBufferRange( GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access ); extern void * WINAPI glMapNamedBufferRangeEXT( GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access ); +extern void WINAPI glShaderSource( GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length ); +extern void WINAPI glShaderSourceARB( GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length ); extern GLboolean WINAPI glUnmapBuffer( GLenum target ); extern GLboolean WINAPI glUnmapBufferARB( GLenum target ); extern GLboolean WINAPI glUnmapNamedBuffer( GLuint buffer ); diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 01e0e66f0fd4..e474326d3059 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -1899,6 +1899,100 @@ static NTSTATUS WINAPI call_gl_debug_message_callback( void *args, ULONG size ) return STATUS_SUCCESS; } +static char *fixup_shader( GLsizei count, const GLchar *const*string, const GLint *length ) +{ + static int needs_fixup = -1; + static unsigned int once; + + const char add_ext[] = "#version 120\r\n" + "#extension GL_ARB_explicit_uniform_location : enable\r\n" + "#extension GL_ARB_explicit_attrib_location : enable\r\n"; + const char search_str[] = "uniform mat4 boneMatrices[NBONES];"; + const char prepend_str[] = "layout(location = 2) "; + unsigned int search_len, new_len; + const char *p, *next; + BOOL found = FALSE; + char *new, *out; + + if (needs_fixup == -1) + { + const char *sgi = getenv("SteamGameId"); + + needs_fixup = sgi && !strcmp( sgi, "333420" ); + } + + if (!needs_fixup) return NULL; + + if (length || count != 1) return NULL; + + if (!once++) + FIXME( "HACK: Fixing up shader.\n" ); + + TRACE( "Appending extension string.\n" ); + new_len = strlen( *string ) + sizeof(prepend_str) - 1 + sizeof(add_ext); + new = out = malloc( new_len ); + memcpy( out, add_ext, sizeof(add_ext) - 1 ); + out += sizeof(add_ext) - 1; + + search_len = sizeof(search_str) - 1; + next = *string; + while (*(p = next)) + { + while (*next && *next != '\r' && *next != '\n') ++next; + + if (next - p == search_len && !memcmp( p, search_str, search_len )) + { + TRACE( "Adding explicit location.\n" ); + memcpy( out, *string, p - *string ); + out += p - *string; + memcpy( out, prepend_str, sizeof(prepend_str) - 1 ); + out += sizeof(prepend_str) - 1; + strcpy( out, p ); + found = TRUE; + break; + } + + while (*next == '\n' || *next == '\r') ++next; + } + if (!found) + strcpy( out, *string ); + + return new; +} + +void WINAPI glShaderSource( GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length ) +{ + struct glShaderSource_params args = { .teb = NtCurrentTeb(), .shader = shader, .count = count, .string = string, .length = length }; + NTSTATUS status; + char *new; + TRACE( "shader %d, count %d, string %p, length %p\n", shader, count, string, length ); + if ((new = fixup_shader( count, string, length ))) + { + args.string = (const GLchar **)&new; + args.count = 1; + args.length = NULL; + } + if ((status = UNIX_CALL( glShaderSource, &args ))) WARN( "glShaderSource returned %#lx\n", status ); + free( new ); +} + +void WINAPI glShaderSourceARB( GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length ) +{ + struct glShaderSourceARB_params args = { .teb = NtCurrentTeb(), .shaderObj = shaderObj, .count = count, .string = string, .length = length }; + NTSTATUS status; + char *new; + TRACE( "shaderObj %d, count %d, string %p, length %p\n", shaderObj, count, string, length ); + if ((new = fixup_shader( count, string, length ))) + { + args.string = (const GLcharARB **)&new; + args.count = 1; + args.length = NULL; + } + if ((status = UNIX_CALL( glShaderSourceARB, &args ))) WARN( "glShaderSourceARB returned %#lx\n", status ); + free( new ); +} + + /*********************************************************************** * OpenGL initialisation routine */ diff --git a/include/wine/wgl_driver.h b/include/wine/wgl_driver.h index b4bc5abf658a..d70a5314a39b 100644 --- a/include/wine/wgl_driver.h +++ b/include/wine/wgl_driver.h @@ -7,7 +7,7 @@ #define WINE_GLAPI #endif -#define WINE_WGL_DRIVER_VERSION 28 +#define WINE_WGL_DRIVER_VERSION 29 struct wgl_context; struct wgl_pbuffer; From 95f9acd979b77d3a1c64d311f386c570262882a4 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 7 Dec 2022 12:08:43 -0600 Subject: [PATCH 0747/2542] win32u, server: Support setting desktop close timeout. And use zero timeout by default. CW-Bug-Id: #19584 CW-Bug-Id: #21645 --- dlls/win32u/winstation.c | 27 ++++++++++++++++++++++++--- server/protocol.def | 3 +++ server/user.h | 1 + server/winstation.c | 4 +++- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/dlls/win32u/winstation.c b/dlls/win32u/winstation.c index 233eb8b79b8e..ffc1be14ef50 100644 --- a/dlls/win32u/winstation.c +++ b/dlls/win32u/winstation.c @@ -741,6 +741,8 @@ BOOL WINAPI NtUserGetObjectInformation( HANDLE handle, INT index, void *info, } } +#define TICKSPERSEC 10000000 + /*********************************************************************** * NtUserSetObjectInformation (win32u.@) */ @@ -748,8 +750,19 @@ BOOL WINAPI NtUserSetObjectInformation( HANDLE handle, INT index, void *info, DW { BOOL ret; const USEROBJECTFLAGS *obj_flags = info; + LONG64 close_timeout = 0; - if (index != UOI_FLAGS || !info || len < sizeof(*obj_flags)) + if (index == 1000) + { + /* Wine specific: set desktop close timeout. */ + if (!info || len < sizeof(DWORD)) + { + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); + return FALSE; + } + close_timeout = -(*(DWORD *)info * (ULONG64)TICKSPERSEC / 1000); + } + else if (index != UOI_FLAGS || !info || len < sizeof(*obj_flags)) { RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; @@ -758,8 +771,16 @@ BOOL WINAPI NtUserSetObjectInformation( HANDLE handle, INT index, void *info, DW SERVER_START_REQ( set_user_object_info ) { req->handle = wine_server_obj_handle( handle ); - req->flags = SET_USER_OBJECT_SET_FLAGS; - req->obj_flags = obj_flags->dwFlags; + if (index == 1000) + { + req->flags = SET_USER_OBJECT_SET_CLOSE_TIMEOUT; + req->close_timeout = close_timeout; + } + else + { + req->flags = SET_USER_OBJECT_SET_FLAGS; + req->obj_flags = obj_flags->dwFlags; + } ret = !wine_server_call_err( req ); } SERVER_END_REQ; diff --git a/server/protocol.def b/server/protocol.def index 3bfea8c66a57..93c81554c01f 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -3006,6 +3006,7 @@ enum coords_relative obj_handle_t handle; /* handle to the object */ unsigned int flags; /* information to set/get */ unsigned int obj_flags; /* new object flags */ + timeout_t close_timeout; /* desktop close timeout */ @REPLY int is_desktop; /* is object a desktop? */ unsigned int old_obj_flags; /* old object flags */ @@ -3013,6 +3014,7 @@ enum coords_relative @END #define SET_USER_OBJECT_SET_FLAGS 1 #define SET_USER_OBJECT_GET_FULL_NAME 2 +#define SET_USER_OBJECT_SET_CLOSE_TIMEOUT 4 /* Register a hotkey */ @@ -3781,6 +3783,7 @@ struct handle_info /* Make the current process a system process */ @REQ(make_process_system) obj_handle_t handle; /* handle to the process */ + timeout_t desktop_close_timeout; /* set timeout for desktop close */ @REPLY obj_handle_t event; /* event signaled when all user processes have exited */ @END diff --git a/server/user.h b/server/user.h index 6e632fef385d..1269cdd607f0 100644 --- a/server/user.h +++ b/server/user.h @@ -88,6 +88,7 @@ struct desktop struct list hotkeys; /* list of registered hotkeys */ struct list pointers; /* list of active pointers */ struct timeout_user *close_timeout; /* timeout before closing the desktop */ + timeout_t close_timeout_val;/* timeout duration before closing desktop */ struct thread_input *foreground_input; /* thread input of foreground thread */ unsigned int users; /* processes and threads using this desktop */ unsigned char keystate[256]; /* asynchronous key state */ diff --git a/server/winstation.c b/server/winstation.c index 33b644f5d8bb..5a83171e6596 100644 --- a/server/winstation.c +++ b/server/winstation.c @@ -299,6 +299,7 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned desktop->taskman_window = NULL; desktop->global_hooks = NULL; desktop->close_timeout = NULL; + desktop->close_timeout_val = 0; desktop->foreground_input = NULL; desktop->users = 0; list_init( &desktop->threads ); @@ -453,7 +454,7 @@ static void remove_desktop_user( struct desktop *desktop, struct thread *thread /* if we have one remaining user, it has to be the manager of the desktop window */ if ((process = get_top_window_owner( desktop )) && desktop->users == process->running_threads && !desktop->close_timeout) - desktop->close_timeout = add_timeout_user( -TICKS_PER_SEC, close_desktop_timeout, desktop ); + desktop->close_timeout = add_timeout_user( desktop->close_timeout_val, close_desktop_timeout, desktop ); } /* remove a thread from the list of threads attached to a desktop */ @@ -901,6 +902,7 @@ DECL_HANDLER(set_user_object_info) } SHARED_WRITE_END; } + if (req->flags & SET_USER_OBJECT_SET_CLOSE_TIMEOUT) desktop->close_timeout_val = req->close_timeout; } else if (obj->ops == &winstation_ops) { From 0b511807bb5a7139677e7e0d0a4f63ee000d960f Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 21 Mar 2023 20:31:35 -0600 Subject: [PATCH 0748/2542] dwmapi: Sleep in DwmFlush(). CW-Bug-Id: #22046 --- dlls/dwmapi/dwmapi_main.c | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/dlls/dwmapi/dwmapi_main.c b/dlls/dwmapi/dwmapi_main.c index adc02552ba72..6df762c0edc2 100644 --- a/dlls/dwmapi/dwmapi_main.c +++ b/dlls/dwmapi/dwmapi_main.c @@ -83,18 +83,6 @@ HRESULT WINAPI DwmGetColorizationColor(DWORD *colorization, BOOL *opaque_blend) return E_NOTIMPL; } -/********************************************************************** - * DwmFlush (DWMAPI.@) - */ -HRESULT WINAPI DwmFlush(void) -{ - static BOOL once; - - if (!once++) FIXME("() stub\n"); - - return S_OK; -} - /********************************************************************** * DwmInvalidateIconicBitmaps (DWMAPI.@) */ @@ -301,6 +289,31 @@ HRESULT WINAPI DwmGetCompositionTimingInfo(HWND hwnd, DWM_TIMING_INFO *info) return S_OK; } +/********************************************************************** + * DwmFlush (DWMAPI.@) + */ +HRESULT WINAPI DwmFlush(void) +{ + LARGE_INTEGER qpf, qpc, delay; + LONG64 qpc_refresh_period; + int display_frequency; + static BOOL once; + + if (!once++) + FIXME("() stub\n"); + else + TRACE(".\n"); + + display_frequency = get_display_frequency(); + NtQueryPerformanceCounter(&qpc, &qpf); + qpc_refresh_period = qpf.QuadPart / display_frequency; + delay.QuadPart = (qpc.QuadPart - ((qpc.QuadPart + qpc_refresh_period - 1) / qpc_refresh_period) * qpc_refresh_period) + * 10000000 / qpf.QuadPart; + NtDelayExecution(FALSE, &delay); + + return S_OK; +} + /********************************************************************** * DwmAttachMilContent (DWMAPI.@) */ From 3808f07bee83e95416f7493ba8ecc5f544b24bec Mon Sep 17 00:00:00 2001 From: LeonTheo02 <57302337+LeonTheo02@users.noreply.github.com> Date: Thu, 23 Feb 2023 13:32:14 +0100 Subject: [PATCH 0749/2542] dxdiag: Return DirectX 12 values Changed the values DxDiag returns to reflect values taken from a modern DirectX 12 capable system via Windows DxDiag. This will allow games that check these values to detect the DirectX Version correctly. Fixes DX11 Open Beta of RAID : World War II. Link: https://github.com/ValveSoftware/wine/pull/178 --- dlls/dxdiagn/provider.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/dxdiagn/provider.c b/dlls/dxdiagn/provider.c index 88011ac87d22..48167f1d6ae9 100644 --- a/dlls/dxdiagn/provider.c +++ b/dlls/dxdiagn/provider.c @@ -613,7 +613,7 @@ static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node) WCHAR buffer[MAX_PATH], computer_name[MAX_COMPUTERNAME_LENGTH + 1], print_buf[200], localized_pagefile_fmt[200]; DWORD_PTR args[2]; - hr = add_ui4_property(node, L"dwDirectXVersionMajor", 9); + hr = add_ui4_property(node, L"dwDirectXVersionMajor", 12); if (FAILED(hr)) return hr; @@ -621,15 +621,15 @@ static HRESULT build_systeminfo_tree(IDxDiagContainerImpl_Container *node) if (FAILED(hr)) return hr; - hr = add_bstr_property(node, L"szDirectXVersionLetter", L"c"); + hr = add_bstr_property(node, L"szDirectXVersionLetter", L" "); if (FAILED(hr)) return hr; - hr = add_bstr_property(node, L"szDirectXVersionEnglish", L"4.09.0000.0904"); + hr = add_bstr_property(node, L"szDirectXVersionEnglish", L""); if (FAILED(hr)) return hr; - hr = add_bstr_property(node, L"szDirectXVersionLongEnglish", L"= \"DirectX 9.0c (4.09.0000.0904)"); + hr = add_bstr_property(node, L"szDirectXVersionLongEnglish", L"DirectX 12"); if (FAILED(hr)) return hr; From e56b6f4b63eceea310099b99fd2e3d34ed125adc Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 30 Oct 2023 10:48:12 -0600 Subject: [PATCH 0750/2542] win32u: Support DisplayConfigGetDeviceInfo(DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO) based on Gamescope setting. CW-Bug-Id: #22912 --- dlls/win32u/sysparams.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 32607e3501a2..6eddbda295c5 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -7315,11 +7315,36 @@ NTSTATUS WINAPI NtUserDisplayConfigGetDeviceInfo( DISPLAYCONFIG_DEVICE_INFO_HEAD return STATUS_NOT_SUPPORTED; } + case DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO: + { + DISPLAYCONFIG_GET_ADVANCED_COLOR_INFO *info = (DISPLAYCONFIG_GET_ADVANCED_COLOR_INFO *)packet; + const char *env; + + FIXME( "DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO semi-stub.\n" ); + + if (packet->size < sizeof(*info)) + return STATUS_INVALID_PARAMETER; + + info->advancedColorSupported = 0; + info->advancedColorEnabled = 0; + info->wideColorEnforced = 0; + info->advancedColorForceDisabled = 0; + info->colorEncoding = DISPLAYCONFIG_COLOR_ENCODING_RGB; + info->bitsPerColorChannel = 8; + if ((env = getenv("DXVK_HDR")) && *env == '1') + { + TRACE( "HDR is enabled.\n" ); + info->advancedColorSupported = 1; + info->advancedColorEnabled = 1; + info->bitsPerColorChannel = 10; + } + + return STATUS_SUCCESS; + } case DISPLAYCONFIG_DEVICE_INFO_SET_TARGET_PERSISTENCE: case DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_BASE_TYPE: case DISPLAYCONFIG_DEVICE_INFO_GET_SUPPORT_VIRTUAL_RESOLUTION: case DISPLAYCONFIG_DEVICE_INFO_SET_SUPPORT_VIRTUAL_RESOLUTION: - case DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO: case DISPLAYCONFIG_DEVICE_INFO_SET_ADVANCED_COLOR_STATE: case DISPLAYCONFIG_DEVICE_INFO_GET_SDR_WHITE_LEVEL: default: From 8e640de4ed6fe5659dabcf000cc0ab296f763b10 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 20 Dec 2023 13:43:26 -0600 Subject: [PATCH 0751/2542] server: Handle owner rights (S-1-3-4) SID in ACE. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49334 CW-Bug-Id: #23154 --- dlls/advapi32/tests/security.c | 65 ++++++++++++++++++++++++++++++++++ server/file.c | 4 +-- server/security.h | 1 + server/token.c | 1 + 4 files changed, 69 insertions(+), 2 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index b683caf06b2d..a87fe5528e67 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -728,6 +728,9 @@ static void test_lookupPrivilegeValue(void) } } +static TOKEN_OWNER *get_alloc_token_owner( HANDLE token ); +static TOKEN_PRIMARY_GROUP *get_alloc_token_primary_group( HANDLE token ); + static void test_FileSecurity(void) { char wintmpdir [MAX_PATH]; @@ -742,6 +745,16 @@ static void test_FileSecurity(void) const SECURITY_INFORMATION request = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION; + TOKEN_OWNER *owner; + PSID owner_sid; + BOOL defaulted, present; + TOKEN_PRIMARY_GROUP *group; + SECURITY_ATTRIBUTES sa; + PACL dacl; + ACL_SIZE_INFORMATION acl_size; + ACCESS_ALLOWED_ACE *ace; + static SID owner_rights_sid = { SID_REVISION, 1, { SECURITY_CREATOR_SID_AUTHORITY }, { SECURITY_CREATOR_OWNER_RIGHTS_RID } }; + const WCHAR sd_onwer_rights_str[] = L"D:(A;;FA;;;S-1-3-4)"; if (!GetTempPathA (sizeof (wintmpdir), wintmpdir)) { win_skip ("GetTempPathA failed\n"); @@ -837,6 +850,58 @@ static void test_FileSecurity(void) ok (GetLastError() == ERROR_FILE_NOT_FOUND, "last error ERROR_FILE_NOT_FOUND expected, got %ld\n", GetLastError()); + sa.nLength = sizeof(sa); + sa.bInheritHandle = FALSE; + rc = ConvertStringSecurityDescriptorToSecurityDescriptorW(sd_onwer_rights_str, SDDL_REVISION_1, &sa.lpSecurityDescriptor, NULL); + ok(rc, "got error %lu.\n", GetLastError()); + + DeleteFileA(file); + fh = CreateFileA(file, GENERIC_READ, 0, &sa, CREATE_ALWAYS, 0, NULL); + ok (fh != INVALID_HANDLE_VALUE, "error %lu\n", GetLastError()); + LocalFree(sa.lpSecurityDescriptor); + + rc = GetFileSecurityA (file, OWNER_SECURITY_INFORMATION, NULL, 0, &retSize); + ok (!rc && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %ld, error %lu.\n", rc, GetLastError()); + sd = HeapAlloc (GetProcessHeap (), 0, sdSize); + rc = GetFileSecurityA (file, OWNER_SECURITY_INFORMATION, sd, retSize, &retSize); + ok(rc, "got error %lu.\n", GetLastError()); + rc = GetSecurityDescriptorOwner(sd, &owner_sid, &defaulted); + ok(rc, "got error %lu.\n", GetLastError()); + ok(!defaulted, "got %d.\n", defaulted); + owner = get_alloc_token_owner(GetCurrentProcessToken()); + todo_wine ok(EqualSid(owner_sid, owner->Owner), "Owner SIDs are not equal %s != %s\n", debugstr_sid(owner_sid), debugstr_sid(owner->Owner)); + HeapFree (GetProcessHeap (), 0, owner); + HeapFree (GetProcessHeap (), 0, sd); + + group = get_alloc_token_primary_group(GetCurrentProcessToken()); + test_group_equal(fh, group->PrimaryGroup, __LINE__); + HeapFree (GetProcessHeap (), 0, group); + + CloseHandle(fh); + + fh = CreateFileA(file, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); + ok (fh != INVALID_HANDLE_VALUE, "error %lu\n", GetLastError()); + if (fh != INVALID_HANDLE_VALUE) + { + rc = GetFileSecurityA (file, DACL_SECURITY_INFORMATION, NULL, 0, &retSize); + ok (!rc && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %ld, error %lu.\n", rc, GetLastError()); + sd = HeapAlloc (GetProcessHeap (), 0, sdSize); + rc = GetFileSecurityA (file, DACL_SECURITY_INFORMATION, sd, retSize, &retSize); + ok(rc, "got error %lu.\n", GetLastError()); + rc = GetSecurityDescriptorDacl(sd, &present, &dacl, &defaulted); + ok(rc, "got error %lu.\n", GetLastError()); + ok(present, "got %d.\n", present); + ok(!defaulted, "got %d.\n", defaulted); + rc = GetAclInformation(dacl, &acl_size, sizeof(acl_size), AclSizeInformation); + ok(rc, "got error %lu.\n", GetLastError()); + ok(acl_size.AceCount == 1, "got %lu.\n", acl_size.AceCount); + rc = GetAce(dacl, 0, (VOID **)&ace); + ok(rc, "got error %lu.\n", GetLastError()); + ok(EqualSid(&ace->SidStart, &owner_rights_sid), "Owner SIDs are not equal %s != %s\n", debugstr_sid(&ace->SidStart), debugstr_sid(&owner_rights_sid)); + CloseHandle(fh); + HeapFree (GetProcessHeap (), 0, sd); + } + cleanup: /* Remove temporary file and directory */ DeleteFileA(file); diff --git a/server/file.c b/server/file.c index 3dbf397c2257..934c394ae342 100644 --- a/server/file.c +++ b/server/file.c @@ -617,7 +617,7 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const struct sid *owner { bits_to_set &= ~((mode << 6) | (mode << 3)); /* user + group */ } - else if (equal_sid( sid, owner )) + else if (equal_sid( sid, owner ) || equal_sid( sid, &owner_rights_sid )) { bits_to_set &= ~(mode << 6); /* user only */ } @@ -636,7 +636,7 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const struct sid *owner new_mode |= mode & bits_to_set; bits_to_set &= ~mode; } - else if (equal_sid( sid, owner )) + else if (equal_sid( sid, owner ) || equal_sid( sid, &owner_rights_sid )) { mode = (mode << 6); /* user only */ new_mode |= mode & bits_to_set; diff --git a/server/security.h b/server/security.h index 4a7616369102..7caccae24365 100644 --- a/server/security.h +++ b/server/security.h @@ -44,6 +44,7 @@ extern const struct luid SeManageVolumePrivilege; extern const struct luid SeImpersonatePrivilege; extern const struct luid SeCreateGlobalPrivilege; +extern const struct sid owner_rights_sid; extern const struct sid world_sid; extern struct sid local_user_sid; extern const struct sid local_system_sid; diff --git a/server/token.c b/server/token.c index c94f1b1f7e01..31fc4b8ddc67 100644 --- a/server/token.c +++ b/server/token.c @@ -74,6 +74,7 @@ struct sid_attrs unsigned int attrs; }; +const struct sid owner_rights_sid = { SID_REVISION, 1, SECURITY_CREATOR_SID_AUTHORITY, { SECURITY_CREATOR_OWNER_RIGHTS_RID } }; const struct sid world_sid = { SID_REVISION, 1, SECURITY_WORLD_SID_AUTHORITY, { SECURITY_WORLD_RID } }; const struct sid local_system_sid = { SID_REVISION, 1, SECURITY_NT_AUTHORITY, { SECURITY_LOCAL_SYSTEM_RID } }; struct sid local_user_sid = { SID_REVISION, 5, SECURITY_NT_AUTHORITY, { SECURITY_NT_NON_UNIQUE, 0, 0, 0, 1000 } }; From cbc1d9c2c8a47499261fca90c9f2483d0a1a3df7 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 3 Jan 2024 10:42:29 -0600 Subject: [PATCH 0752/2542] ir50_32: HACK: Don't build dll. CW-Bug-Id: #23162 --- configure.ac | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1269061eb875..6a5e2b085584 100644 --- a/configure.ac +++ b/configure.ac @@ -2777,7 +2777,6 @@ WINE_CONFIG_MAKEFILE(dlls/inseng) WINE_CONFIG_MAKEFILE(dlls/iphlpapi) WINE_CONFIG_MAKEFILE(dlls/iphlpapi/tests) WINE_CONFIG_MAKEFILE(dlls/iprop) -WINE_CONFIG_MAKEFILE(dlls/ir50_32) WINE_CONFIG_MAKEFILE(dlls/irprops.cpl) WINE_CONFIG_MAKEFILE(dlls/itircl) WINE_CONFIG_MAKEFILE(dlls/itss) From bae7c7a20eec473177548578f5867804c35800f9 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 11 Dec 2023 14:17:09 -0600 Subject: [PATCH 0753/2542] ntdll: HACK: Add 2g allocation limit option for FFX/X-2. CW-Bug-Id: #22930 --- dlls/ntdll/unix/loader.c | 4 ++++ dlls/ntdll/unix/unix_private.h | 1 + dlls/ntdll/unix/virtual.c | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index ead2731e4939..71cf05662910 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2125,6 +2125,7 @@ BOOL alert_simulate_sched_quantum; BOOL fsync_yield_to_waiters; BOOL localsystem_sid; BOOL simulate_writecopy; +BOOL wine_allocs_2g_limit; SIZE_T kernel_stack_size = 0x100000; long long ram_reporting_bias; @@ -2204,6 +2205,9 @@ static void hacks_init(void) || !strcmp(sgi, "391150") /* Red Tie Runner */ || !strcmp(sgi, "2176450"); /* Mr. Hopp's Playhouse 3 */ + if (sgi) wine_allocs_2g_limit = !strcmp(sgi, "359870"); + if (wine_allocs_2g_limit) ERR("Allocation 2g limit enabled.\n"); + if (main_argc > 1 && strstr(main_argv[1], "MicrosoftEdgeUpdate.exe")) { ERR("HACK: reporting LocalSystem account SID.\n"); diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 20a59552df56..1d978b4b6992 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -199,6 +199,7 @@ extern BOOL fsync_yield_to_waiters; extern BOOL localsystem_sid; extern BOOL simulate_writecopy; extern long long ram_reporting_bias; +extern BOOL wine_allocs_2g_limit; extern void init_environment(void); extern void init_startup_info(void); diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 0aaf58fdfeeb..b4fd773830b6 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -2468,6 +2468,8 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size, int top_down = alloc_type & MEM_TOP_DOWN; void *ptr; NTSTATUS status; + const void *effective_user_space_limit = !is_win64 && wine_allocs_2g_limit ? + (void *)0x7fff0000 : min( user_space_limit, host_addr_space_limit); if (alloc_type & MEM_REPLACE_PLACEHOLDER) { @@ -2504,7 +2506,7 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size, } else { - limit_high = limit_high ? min( limit_high + 1, (UINT_PTR)user_space_limit) : (UINT_PTR)user_space_limit; + limit_high = limit_high ? min( limit_high + 1, (UINT_PTR)effective_user_space_limit) : (UINT_PTR)effective_user_space_limit; if (limit_low < (ULONG_PTR)address_space_start) limit_low = (ULONG_PTR)address_space_start; if (!align_mask) align_mask = granularity_mask; From 090cd1002cdf3cafda573025172fb3bb5ea7c1bf Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 15 Jan 2024 20:12:46 -0600 Subject: [PATCH 0754/2542] kernelbase: HACK Force Angle Vulkan instead of GL for EpicOnlineServicesUIHelper. CW-Bug-Id: #23242 --- dlls/kernelbase/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 42bb5be2758a..bea3112359e5 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -595,7 +595,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) {L"Paradox Launcher.exe", L" --use-angle=gl"}, {L"Montaro\\nw.exe", L" --use-gl=swiftshader"}, {L"\\EOSOverlayRenderer-Win64-Shipping.exe", L" --use-gl=swiftshader --in-process-gpu"}, - {L"\\EpicOnlineServicesUIHelper", L" --use-gl=desktop"}, + {L"\\EpicOnlineServicesUIHelper", L" --use-angle=vulkan"}, {L"OlympiaRising.exe", L" --use-gl=swiftshader"}, {L"nw.exe.exe", L" --use-angle=d3d9"}, {L"DC Universe Online\\LaunchPad.exe", L" --use-gl=swiftshader"}, From e720e0bf5ba2411555b250772579acdd8d00340b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 26 Jan 2024 23:01:11 -0600 Subject: [PATCH 0755/2542] kernelbase: Workaround forced stack aligment for SignalObjectAndWait(). CW-Bug-Id: #23256 --- dlls/kernelbase/sync.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/kernelbase/sync.c b/dlls/kernelbase/sync.c index f03a6c3150a6..2fffd3ead795 100644 --- a/dlls/kernelbase/sync.c +++ b/dlls/kernelbase/sync.c @@ -310,7 +310,11 @@ DWORD WINAPI DECLSPEC_HOTPATCH SignalObjectAndWait( HANDLE signal, HANDLE wait, DWORD timeout, BOOL alertable ) { NTSTATUS status; +#ifdef __i386__ + DECLSPEC_ALIGN(4) LARGE_INTEGER time; +#else LARGE_INTEGER time; +#endif TRACE( "%p %p %ld %d\n", signal, wait, timeout, alertable ); From 65031271e70b9161ce94b5a43d23bce8b3464998 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Tue, 30 Jan 2024 23:28:04 +0200 Subject: [PATCH 0756/2542] kernelbase: HACK: Add --use-gl=swiftshader for another game. CW-Bug-Id: #23297 --- dlls/kernelbase/process.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index bea3112359e5..faafde26cac1 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -588,6 +588,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) { const WCHAR *exe_name; const WCHAR *append; + const char *steamgameid; } options[] = { @@ -604,8 +605,10 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) {L"EverQuest 2\\LaunchPad.exe", L" --use-gl=swiftshader"}, {L"Everquest F2P\\LaunchPad.exe", L" --use-gl=swiftshader"}, {L"Red Tie Runner.exe", L" --use-angle=gl"}, + {L"UnrealCEFSubProcess.exe", L" --use-gl=swiftshader", "2316580"}, }; unsigned int i; + char sgi[64]; if (!cmd) return NULL; @@ -613,6 +616,9 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) { if (wcsstr( cmd, options[i].exe_name )) { + if (options[i].steamgameid && !(GetEnvironmentVariableA( "SteamGameId", sgi, sizeof(sgi) ) + && !strcmp( sgi, options[i].steamgameid ))) + continue; FIXME( "HACK: appending %s to command line.\n", debugstr_w(options[i].append) ); return options[i].append; } From 293ebd70a54b76bc86a2f7b31e4b1a6261992387 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 6 Feb 2024 15:37:47 -0600 Subject: [PATCH 0757/2542] kernelbase: HACK: Force Vulkan rendering for EACefSubProcess. CW-Bug-Id: #23363 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index faafde26cac1..d66d19d4c80e 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -606,6 +606,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) {L"Everquest F2P\\LaunchPad.exe", L" --use-gl=swiftshader"}, {L"Red Tie Runner.exe", L" --use-angle=gl"}, {L"UnrealCEFSubProcess.exe", L" --use-gl=swiftshader", "2316580"}, + {L"\\EACefSubProcess.exe", L" --use-angle=vulkan"}, }; unsigned int i; char sgi[64]; From dc471dbaea9d181a1bf9f4e886797c35d6629d97 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 6 Feb 2024 16:13:37 -0600 Subject: [PATCH 0758/2542] ntdll: HACK: Enable WINE_SIMULATE_WRITECOPY for Dinogen Online. CW-Bug-Id: #23379 --- dlls/ntdll/unix/loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 71cf05662910..5015ac0ab031 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2203,6 +2203,7 @@ static void hacks_init(void) || !strcmp(sgi, "2095300") /* Breakout 13 */ || !strcmp(sgi, "2053940") /* Idol Hands 2 */ || !strcmp(sgi, "391150") /* Red Tie Runner */ + || !strcmp(sgi, "2152990") /* Dinogen Online */ || !strcmp(sgi, "2176450"); /* Mr. Hopp's Playhouse 3 */ if (sgi) wine_allocs_2g_limit = !strcmp(sgi, "359870"); From dea98c3b1d5ba95c318b189c141bdb623f56d4d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sat, 7 Dec 2024 11:42:50 +0100 Subject: [PATCH 0759/2542] winex11: Use the state tracker for the desktop window _NET_WM_STATE. --- dlls/winex11.drv/window.c | 49 +++++++-------------------------------- 1 file changed, 9 insertions(+), 40 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 1612125f64f1..279ebccf7fb0 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1147,35 +1147,6 @@ void update_user_time( Time time ) XUnlockDisplay( gdi_display ); } -static void update_desktop_fullscreen( Display *display ) -{ - XEvent xev; - - if (!is_virtual_desktop()) return; - - xev.xclient.type = ClientMessage; - xev.xclient.window = root_window; - xev.xclient.message_type = x11drv_atom(_NET_WM_STATE); - xev.xclient.serial = 0; - xev.xclient.display = display; - xev.xclient.send_event = True; - xev.xclient.format = 32; - xev.xclient.data.l[0] = is_desktop_fullscreen() ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE; - xev.xclient.data.l[1] = x11drv_atom(_NET_WM_STATE_FULLSCREEN); - xev.xclient.data.l[2] = 0; - xev.xclient.data.l[3] = 1; - - TRACE("action=%li\n", xev.xclient.data.l[0]); - - XSendEvent( display, DefaultRootWindow(display), False, - SubstructureRedirectMask | SubstructureNotifyMask, &xev ); - - xev.xclient.data.l[1] = x11drv_atom(_NET_WM_STATE_MAXIMIZED_VERT); - xev.xclient.data.l[2] = x11drv_atom(_NET_WM_STATE_MAXIMIZED_HORZ); - XSendEvent( display, DefaultRootWindow(display), False, - SubstructureRedirectMask | SubstructureNotifyMask, &xev ); -} - /* Update _NET_WM_FULLSCREEN_MONITORS when _NET_WM_STATE_FULLSCREEN is set to support fullscreen * windows spanning multiple monitors */ static void update_net_wm_fullscreen_monitors( struct x11drv_win_data *data ) @@ -1226,7 +1197,7 @@ static void update_net_wm_fullscreen_monitors( struct x11drv_win_data *data ) xev.xclient.format = 32; xev.xclient.data.l[4] = 1; memcpy( xev.xclient.data.l, monitors, sizeof(monitors) ); - XSendEvent( data->display, root_window, False, + XSendEvent( data->display, DefaultRootWindow( data->display ), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev ); } data->net_wm_fullscreen_monitors_set = TRUE; @@ -1290,7 +1261,7 @@ static void window_set_net_wm_state( struct x11drv_win_data *data, UINT new_stat data->net_wm_state_serial = NextRequest( data->display ); TRACE( "window %p/%lx, requesting _NET_WM_STATE %#x serial %lu\n", data->hwnd, data->whole_window, data->pending_state.net_wm_state, data->net_wm_state_serial ); - XSendEvent( data->display, root_window, False, + XSendEvent( data->display, DefaultRootWindow( data->display ), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev ); } } @@ -1363,18 +1334,21 @@ static void window_set_config( struct x11drv_win_data *data, const RECT *new_rec */ static void update_net_wm_states( struct x11drv_win_data *data ) { + static const UINT fullscreen_mask = (1 << NET_WM_STATE_MAXIMIZED) | (1 << NET_WM_STATE_FULLSCREEN); UINT style, ex_style, new_state = 0; if (!data->managed || data->embedded) return; if (data->whole_window == root_window) { - update_desktop_fullscreen(data->display); + if (!is_virtual_desktop()) return; + new_state = is_desktop_fullscreen() ? fullscreen_mask : 0; + window_set_net_wm_state( data, new_state ); return; } style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ); if (style & WS_MINIMIZE) - new_state |= data->desired_state.net_wm_state & ((1 << NET_WM_STATE_FULLSCREEN)|(1 << NET_WM_STATE_MAXIMIZED)); + new_state |= data->desired_state.net_wm_state & fullscreen_mask; if (data->is_fullscreen) { if ((style & WS_MAXIMIZE) && (style & WS_CAPTION) == WS_CAPTION) @@ -2347,6 +2321,7 @@ BOOL X11DRV_DestroyNotify( HWND hwnd, XEvent *event ) /* initialize the desktop window id in the desktop manager process */ static BOOL create_desktop_win_data( Window win, HWND hwnd ) { + static const UINT fullscreen_mask = (1 << NET_WM_STATE_MAXIMIZED) | (1 << NET_WM_STATE_FULLSCREEN); struct x11drv_thread_data *thread_data = x11drv_thread_data(); Display *display = thread_data->display; struct x11drv_win_data *data; @@ -2356,6 +2331,7 @@ static BOOL create_desktop_win_data( Window win, HWND hwnd ) data->managed = TRUE; NtUserSetProp( data->hwnd, whole_window_prop, (HANDLE)win ); set_initial_wm_hints( display, win ); + if (is_desktop_fullscreen()) window_set_net_wm_state( data, fullscreen_mask ); release_win_data( data ); if (thread_data->clip_window) XReparentWindow( display, thread_data->clip_window, win, 0, 0 ); return TRUE; @@ -2400,13 +2376,6 @@ void X11DRV_SetDesktopWindow( HWND hwnd ) ERR( "Failed to create virtual desktop window data\n" ); root_window = DefaultRootWindow( gdi_display ); } - else if (is_desktop_fullscreen()) - { - Display *display = x11drv_thread_data()->display; - TRACE("setting desktop to fullscreen\n"); - XChangeProperty( display, root_window, x11drv_atom(_NET_WM_STATE), XA_ATOM, 32, PropModeReplace, - (unsigned char*)&x11drv_atom(_NET_WM_STATE_FULLSCREEN), 1 ); - } } else { From 87e9ee42653f84bb864328b303e6e38e3fd7c070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sat, 7 Dec 2024 13:56:57 +0100 Subject: [PATCH 0760/2542] winex11: Use the current state when deciding how to reply to WM_TAKE_FOCUS. The Win32 state might not have been updated with the latest X11 state, and we want to take future updates into account when deciding to accept focus or not. At this point, and because we ignore WM_TAKE_FOCUS when a state change is pending, all the states are the same, we use current_state as the logic is to accept focus or not according to our current understanding of the X state. --- dlls/winex11.drv/event.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 0a7c3f9e0ec0..db3b9574031d 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -631,8 +631,18 @@ DWORD EVENT_x11_time_to_win32_time(Time time) static inline BOOL can_activate_window( HWND hwnd ) { LONG style = NtUserGetWindowLongW( hwnd, GWL_STYLE ); + struct x11drv_win_data *data; RECT rect; + if ((data = get_win_data( hwnd ))) + { + style = style & ~(WS_VISIBLE | WS_MINIMIZE | WS_MAXIMIZE); + if (data->current_state.wm_state != WithdrawnState) style |= WS_VISIBLE; + if (data->current_state.wm_state == IconicState) style |= WS_MINIMIZE; + if (data->current_state.net_wm_state & (1 << NET_WM_STATE_MAXIMIZED)) style |= WS_MAXIMIZE; + release_win_data( data ); + } + if (!(style & WS_VISIBLE)) return FALSE; if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return FALSE; if (style & WS_MINIMIZE) return FALSE; From 95f0a2ed506767997f23626b68bb44b37db4c18f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sun, 8 Dec 2024 22:22:37 +0100 Subject: [PATCH 0761/2542] winex11: Give focus to the expected window when unampping with focus. SetForegroundWindow calls aren't reflected to the X11 side, and we're sometimes becoming inconsistent between the X focused window and the Win32 foreground window. When a window gets unmapped, another one may receive WM_TAKE_FOCUS, and in the next change we want to rely on the foreground window activation time to make a decision on whether the foreground window is temporarily unmapping itself. It needs to be the same as the window with X input focus, or we won't know which window activation time to check. --- dlls/winex11.drv/event.c | 10 ++++++++-- dlls/winex11.drv/window.c | 8 ++++++++ dlls/winex11.drv/x11drv.h | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index db3b9574031d..0e2e1615c7a6 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -887,10 +887,13 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev ) { HWND foreground = NtUserGetForegroundWindow(); XFocusChangeEvent *event = &xev->xfocus; + struct x11drv_win_data *data; BOOL was_grabbed; if (event->detail == NotifyPointer) return FALSE; - if (!hwnd) return FALSE; + if (!(data = get_win_data( hwnd ))) return FALSE; + data->has_focus = 1; + release_win_data( data ); if (window_has_pending_wm_state( hwnd, -1 )) { @@ -988,6 +991,7 @@ static BOOL X11DRV_FocusOut( HWND hwnd, XEvent *xev ) { HWND foreground = NtUserGetForegroundWindow(); XFocusChangeEvent *event = &xev->xfocus; + struct x11drv_win_data *data; if (event->detail == NotifyPointer) { @@ -1000,7 +1004,9 @@ static BOOL X11DRV_FocusOut( HWND hwnd, XEvent *xev ) } return TRUE; } - if (!hwnd) return FALSE; + if (!(data = get_win_data( hwnd ))) return FALSE; + data->has_focus = 0; + release_win_data( data ); if (window_has_pending_wm_state( hwnd, NormalState )) /* ignore FocusOut only if the window is being shown */ { diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 279ebccf7fb0..065b6b4d7c0d 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1439,6 +1439,7 @@ static void set_xembed_flags( struct x11drv_win_data *data, unsigned long flags static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state ) { UINT old_state = data->pending_state.wm_state; + HWND foreground = NtUserGetForegroundWindow(); data->desired_state.wm_state = new_state; if (!data->whole_window) return; /* no window, nothing to update */ @@ -1461,6 +1462,13 @@ static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state ) break; } + if (new_state != NormalState && data->has_focus && data->hwnd != foreground) + { + Window window = X11DRV_get_whole_window( foreground ); + WARN( "Inconsistent input focus, activating window %p/%lx\n", foreground, window ); + XSetInputFocus( data->display, window, RevertToParent, CurrentTime ); + } + data->pending_state.wm_state = new_state; data->wm_state_serial = NextRequest( data->display ); TRACE( "window %p/%lx, requesting WM_STATE %#x -> %#x serial %lu, foreground %p\n", data->hwnd, data->whole_window, diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index b00bdb37a675..0af962cd079f 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -650,6 +650,7 @@ struct x11drv_win_data UINT is_fullscreen : 1; /* is the window visible rect fullscreen */ UINT is_offscreen : 1; /* has been moved offscreen by the window manager */ UINT parent_invalid : 1; /* is the parent host window possibly invalid */ + UINT has_focus : 1; /* does window have X input focus */ Window embedder; /* window id of embedder */ Pixmap icon_pixmap; Pixmap icon_mask; From 72195e4317e4866fac49077377059677636c080d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sun, 8 Dec 2024 20:01:02 +0100 Subject: [PATCH 0762/2542] winex11: Ignore transient state changes in other processes. Setting a __wine_x11_focus_time window property to indicate the time of the last NormalState, -1 if the window is temporarily unmapping itself, or 0 if the window is not in a NormalState. --- dlls/winex11.drv/event.c | 6 +++--- dlls/winex11.drv/window.c | 13 ++++++++++++- dlls/winex11.drv/x11drv.h | 3 ++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 0e2e1615c7a6..26acdd170513 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -795,7 +795,7 @@ static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event ) { HWND last_focus = x11drv_thread_data()->last_focus, foreground = NtUserGetForegroundWindow(); - if (window_has_pending_wm_state( hwnd, -1 )) + if (window_has_pending_wm_state( hwnd, -1 ) || (hwnd != foreground && !window_should_take_focus( foreground, event_time ))) { WARN( "Ignoring window %p/%lx WM_TAKE_FOCUS serial %lu, event_time %ld, foreground %p during WM_STATE change\n", hwnd, event->window, event->serial, event_time, foreground ); @@ -1287,7 +1287,7 @@ static void handle_wm_state_notify( HWND hwnd, XPropertyEvent *event ) if (!(data = get_win_data( hwnd ))) return; if (event->state == PropertyNewValue) value = get_window_wm_state( event->display, event->window ); - window_wm_state_notify( data, event->serial, value ); + window_wm_state_notify( data, event->serial, value, event->time ); release_win_data( data ); NtUserPostMessage( hwnd, WM_WINE_WINDOW_STATE_CHANGED, 0, 0 ); @@ -1300,7 +1300,7 @@ static void handle_xembed_info_notify( HWND hwnd, XPropertyEvent *event ) if (!(data = get_win_data( hwnd ))) return; if (event->state == PropertyNewValue) value = get_window_xembed_info( event->display, event->window ); - window_wm_state_notify( data, event->serial, value ? NormalState : WithdrawnState ); + window_wm_state_notify( data, event->serial, value ? NormalState : WithdrawnState, event->time ); release_win_data( data ); } diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 065b6b4d7c0d..6c006cbb65bd 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -108,6 +108,8 @@ static const WCHAR whole_window_prop[] = {'_','_','w','i','n','e','_','x','1','1','_','w','h','o','l','e','_','w','i','n','d','o','w',0}; static const WCHAR clip_window_prop[] = {'_','_','w','i','n','e','_','x','1','1','_','c','l','i','p','_','w','i','n','d','o','w',0}; +static const WCHAR focus_time_prop[] = + {'_','_','w','i','n','e','_','x','1','1','_','f','o','c','u','s','_','t','i','m','e',0}; static pthread_mutex_t win_data_mutex = PTHREAD_MUTEX_INITIALIZER; @@ -1640,7 +1642,7 @@ BOOL X11DRV_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, return *state_cmd || *config_cmd; } -void window_wm_state_notify( struct x11drv_win_data *data, unsigned long serial, UINT value ) +void window_wm_state_notify( struct x11drv_win_data *data, unsigned long serial, UINT value, Time time ) { UINT *desired = &data->desired_state.wm_state, *pending = &data->pending_state.wm_state, *current = &data->current_state.wm_state; unsigned long *expect_serial = &data->wm_state_serial; @@ -1677,6 +1679,9 @@ void window_wm_state_notify( struct x11drv_win_data *data, unsigned long serial, window_set_wm_state( data, data->desired_state.wm_state ); window_set_net_wm_state( data, data->desired_state.net_wm_state ); window_set_config( data, &data->desired_state.rect, FALSE ); + + if (data->current_state.wm_state == NormalState) NtUserSetProp( data->hwnd, focus_time_prop, (HANDLE)time ); + else if (!data->wm_state_serial) NtUserRemoveProp( data->hwnd, focus_time_prop ); } void window_net_wm_state_notify( struct x11drv_win_data *data, unsigned long serial, UINT value ) @@ -1761,6 +1766,12 @@ BOOL window_has_pending_wm_state( HWND hwnd, UINT state ) return pending; } +BOOL window_should_take_focus( HWND hwnd, Time time ) +{ + Time focus_time = (UINT_PTR)NtUserGetProp( hwnd, focus_time_prop ); + return !focus_time || (int)(focus_time - time) < 0; +} + /*********************************************************************** * make_window_embedded */ diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 0af962cd079f..78054103709c 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -676,8 +676,9 @@ extern void set_gl_drawable_parent( HWND hwnd, HWND parent ); extern void destroy_gl_drawable( HWND hwnd ); extern void destroy_vk_surface( HWND hwnd ); +extern BOOL window_should_take_focus( HWND hwnd, Time time ); extern BOOL window_has_pending_wm_state( HWND hwnd, UINT state ); -extern void window_wm_state_notify( struct x11drv_win_data *data, unsigned long serial, UINT value ); +extern void window_wm_state_notify( struct x11drv_win_data *data, unsigned long serial, UINT value, Time time ); extern void window_net_wm_state_notify( struct x11drv_win_data *data, unsigned long serial, UINT value ); extern void window_configure_notify( struct x11drv_win_data *data, unsigned long serial, const RECT *rect ); extern BOOL get_window_state_updates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, RECT *rect ); From ae98cb577253ed2e247878715919c364794e04da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sun, 8 Dec 2024 20:02:01 +0100 Subject: [PATCH 0763/2542] winex11: Introduce a new handle_state_change helper. --- dlls/winex11.drv/window.c | 91 ++++++++++++++------------------------- 1 file changed, 33 insertions(+), 58 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 6c006cbb65bd..ccc64868a81f 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1642,38 +1642,50 @@ BOOL X11DRV_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, return *state_cmd || *config_cmd; } -void window_wm_state_notify( struct x11drv_win_data *data, unsigned long serial, UINT value, Time time ) +static BOOL handle_state_change( struct x11drv_win_data *data, unsigned long serial, unsigned long *expect_serial, UINT size, + const void *value, void *desired, void *pending, void *current, const char *expected, + const char *received, const char *reason ) { - UINT *desired = &data->desired_state.wm_state, *pending = &data->pending_state.wm_state, *current = &data->current_state.wm_state; - unsigned long *expect_serial = &data->wm_state_serial; - const char *reason = NULL, *expected, *received; - - received = wine_dbg_sprintf( "WM_STATE %#x/%lu", value, serial ); - expected = *expect_serial ? wine_dbg_sprintf( ", expected %#x/%lu", *pending, *expect_serial ) : ""; - if (serial < *expect_serial) reason = "old "; - else if (!*expect_serial && *current == value) reason = "no-op "; - /* ignore Metacity/Mutter transient NormalState during WithdrawnState <-> IconicState transitions */ - else if (value == NormalState && *current + *pending == IconicState) reason = "transient "; + else if (!*expect_serial && !memcmp( current, value, size )) reason = "no-op "; if (reason) { WARN( "Ignoring window %p/%lx %s%s%s\n", data->hwnd, data->whole_window, reason, received, expected ); - return; + return FALSE; } if (!*expect_serial) reason = "unexpected "; - else if (*pending != value) reason = "mismatch "; + else if (memcmp( pending, value, size )) reason = "mismatch "; if (!reason) TRACE( "window %p/%lx, %s%s\n", data->hwnd, data->whole_window, received, expected ); else { WARN( "window %p/%lx, %s%s%s\n", data->hwnd, data->whole_window, reason, received, expected ); - *desired = *pending = value; /* avoid requesting the same state again */ + /* avoid requesting the same state again */ + memcpy( desired, value, size ); + memcpy( pending, value, size ); } - *current = value; + memcpy( current, value, size ); *expect_serial = 0; + return TRUE; +} + +void window_wm_state_notify( struct x11drv_win_data *data, unsigned long serial, UINT value, Time time ) +{ + UINT *desired = &data->desired_state.wm_state, *pending = &data->pending_state.wm_state, *current = &data->current_state.wm_state; + unsigned long *expect_serial = &data->wm_state_serial; + const char *reason = NULL, *expected, *received; + + received = wine_dbg_sprintf( "WM_STATE %#x/%lu", value, serial ); + expected = *expect_serial ? wine_dbg_sprintf( ", expected %#x/%lu", *pending, *expect_serial ) : ""; + /* ignore Metacity/Mutter transient NormalState during WithdrawnState <-> IconicState transitions */ + if (value == NormalState && *current + *pending == IconicState) reason = "transient "; + + if (!handle_state_change( data, serial, expect_serial, sizeof(value), &value, + desired, pending, current, expected, received, reason )) + return; /* send any pending changes from the desired state */ window_set_wm_state( data, data->desired_state.wm_state ); @@ -1688,32 +1700,14 @@ void window_net_wm_state_notify( struct x11drv_win_data *data, unsigned long ser { UINT *desired = &data->desired_state.net_wm_state, *pending = &data->pending_state.net_wm_state, *current = &data->current_state.net_wm_state; unsigned long *expect_serial = &data->net_wm_state_serial; - const char *reason = NULL, *expected, *received; + const char *expected, *received; received = wine_dbg_sprintf( "_NET_WM_STATE %#x/%lu", value, serial ); expected = *expect_serial ? wine_dbg_sprintf( ", expected %#x/%lu", *pending, *expect_serial ) : ""; - if (serial < *expect_serial) reason = "old "; - else if (!*expect_serial && *current == value) reason = "no-op "; - - if (reason) - { - WARN( "Ignoring window %p/%lx %s%s%s\n", data->hwnd, data->whole_window, reason, received, expected ); + if (!handle_state_change( data, serial, expect_serial, sizeof(value), &value, + desired, pending, current, expected, received, NULL )) return; - } - - if (!*expect_serial) reason = "unexpected "; - else if (*pending != value) reason = "mismatch "; - - if (!reason) TRACE( "window %p/%lx, %s%s\n", data->hwnd, data->whole_window, received, expected ); - else - { - WARN( "window %p/%lx, %s%s%s\n", data->hwnd, data->whole_window, reason, received, expected ); - *desired = *pending = value; /* avoid requesting the same state again */ - } - - *current = value; - *expect_serial = 0; /* send any pending changes from the desired state */ window_set_wm_state( data, data->desired_state.wm_state ); @@ -1725,32 +1719,13 @@ void window_configure_notify( struct x11drv_win_data *data, unsigned long serial { RECT *desired = &data->desired_state.rect, *pending = &data->pending_state.rect, *current = &data->current_state.rect; unsigned long *expect_serial = &data->configure_serial; - const char *reason = NULL, *expected, *received; + const char *expected, *received; received = wine_dbg_sprintf( "config %s/%lu", wine_dbgstr_rect(value), serial ); expected = *expect_serial ? wine_dbg_sprintf( ", expected %s/%lu", wine_dbgstr_rect(pending), *expect_serial ) : ""; - if (serial < *expect_serial) reason = "old "; - else if (!*expect_serial && EqualRect( current, value )) reason = "no-op "; - - if (reason) - { - WARN( "Ignoring window %p/%lx %s%s%s\n", data->hwnd, data->whole_window, reason, received, expected ); - return; - } - - if (!*expect_serial) reason = "unexpected "; - else if (!EqualRect( pending, value )) reason = "mismatch "; - - if (!reason) TRACE( "window %p/%lx, %s%s\n", data->hwnd, data->whole_window, received, expected ); - else - { - WARN( "window %p/%lx, %s%s%s\n", data->hwnd, data->whole_window, reason, received, expected ); - *desired = *pending = *value; /* avoid requesting the same state again */ - } - - *current = *value; - *expect_serial = 0; + handle_state_change( data, serial, expect_serial, sizeof(*value), value, + desired, pending, current, expected, received, NULL ); } BOOL window_has_pending_wm_state( HWND hwnd, UINT state ) From 6f5aa76eb6673b07f5ad109b53d026e31b615901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sat, 7 Dec 2024 12:17:23 +0100 Subject: [PATCH 0764/2542] winex11: Track _MOTIF_WM_HINTS property in the state tracker. --- dlls/winex11.drv/event.c | 27 +++++++++++++++++++++++ dlls/winex11.drv/window.c | 45 +++++++++++++++++++++++++++++++++------ dlls/winex11.drv/x11drv.h | 4 ++++ 3 files changed, 69 insertions(+), 7 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 26acdd170513..b73b3ab6a496 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1274,6 +1274,21 @@ static int get_window_xembed_info( Display *display, Window window ) return ret; } +static void get_window_mwm_hints( Display *display, Window window, MwmHints *hints ) +{ + unsigned long count, remaining; + MwmHints *value; + int format; + Atom type; + + if (!XGetWindowProperty( display, window, x11drv_atom(_MOTIF_WM_HINTS), 0, 65535, False, x11drv_atom(_MOTIF_WM_HINTS), + &type, &format, &count, &remaining, (unsigned char **)&value )) + { + if (type == x11drv_atom(_MOTIF_WM_HINTS) && get_property_size( format, count ) >= sizeof(*value)) + *hints = *value; + XFree( value ); + } +} /*********************************************************************** * handle_wm_state_notify @@ -1317,6 +1332,17 @@ static void handle_net_wm_state_notify( HWND hwnd, XPropertyEvent *event ) NtUserPostMessage( hwnd, WM_WINE_WINDOW_STATE_CHANGED, 0, 0 ); } +static void handle_mwm_hints_notify( HWND hwnd, XPropertyEvent *event ) +{ + struct x11drv_win_data *data; + MwmHints hints = {0}; + + if (!(data = get_win_data( hwnd ))) return; + if (event->state == PropertyNewValue) get_window_mwm_hints( event->display, event->window, &hints ); + window_mwm_hints_notify( data, event->serial, &hints ); + release_win_data( data ); +} + static void handle_net_supported_notify( XPropertyEvent *event ) { struct x11drv_thread_data *data = x11drv_thread_data(); @@ -1389,6 +1415,7 @@ static BOOL X11DRV_PropertyNotify( HWND hwnd, XEvent *xev ) if (event->atom == x11drv_atom(WM_STATE)) handle_wm_state_notify( hwnd, event ); if (event->atom == x11drv_atom(_XEMBED_INFO)) handle_xembed_info_notify( hwnd, event ); if (event->atom == x11drv_atom(_NET_WM_STATE)) handle_net_wm_state_notify( hwnd, event ); + if (event->atom == x11drv_atom(_MOTIF_WM_HINTS)) handle_mwm_hints_notify( hwnd, event ); if (event->atom == x11drv_atom(_NET_SUPPORTED)) handle_net_supported_notify( event ); if (event->atom == x11drv_atom(_NET_SUPPORTING_WM_CHECK)) handle_net_supporting_wm_check_notify( event ); diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index ccc64868a81f..097c99c394a6 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -53,7 +53,6 @@ #include "wine/debug.h" #include "wine/server.h" -#include "mwm.h" WINE_DEFAULT_DEBUG_CHANNEL(x11drv); WINE_DECLARE_DEBUG_CHANNEL(systray); @@ -111,6 +110,11 @@ static const WCHAR clip_window_prop[] = static const WCHAR focus_time_prop[] = {'_','_','w','i','n','e','_','x','1','1','_','f','o','c','u','s','_','t','i','m','e',0}; +static const char *debugstr_mwm_hints( const MwmHints *hints ) +{ + return wine_dbg_sprintf( "%lx,%lx", hints->functions, hints->decorations ); +} + static pthread_mutex_t win_data_mutex = PTHREAD_MUTEX_INITIALIZER; static void host_window_add_ref( struct host_window *win ) @@ -894,6 +898,23 @@ static void set_size_hints( struct x11drv_win_data *data, DWORD style ) } +static void window_set_mwm_hints( struct x11drv_win_data *data, const MwmHints *new_hints ) +{ + const MwmHints *old_hints = &data->pending_state.mwm_hints; + + data->desired_state.mwm_hints = *new_hints; + if (!data->whole_window) return; /* no window, nothing to update */ + if (!memcmp( old_hints, new_hints, sizeof(*new_hints) )) return; /* hints are the same, nothing to update */ + + data->pending_state.mwm_hints = *new_hints; + data->mwm_hints_serial = NextRequest( data->display ); + TRACE( "window %p/%lx, requesting _MOTIF_WM_HINTS %s serial %lu\n", data->hwnd, data->whole_window, + debugstr_mwm_hints(&data->pending_state.mwm_hints), data->mwm_hints_serial ); + XChangeProperty( data->display, data->whole_window, x11drv_atom(_MOTIF_WM_HINTS), x11drv_atom(_MOTIF_WM_HINTS), + 32, PropModeReplace, (unsigned char *)new_hints, sizeof(*new_hints) / sizeof(long) ); +} + + /*********************************************************************** * set_mwm_hints */ @@ -928,15 +949,12 @@ static void set_mwm_hints( struct x11drv_win_data *data, UINT style, UINT ex_sty } } - TRACE( "%p setting mwm hints to %lx,%lx (style %x exstyle %x)\n", - data->hwnd, mwm_hints.decorations, mwm_hints.functions, style, ex_style ); - mwm_hints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS; mwm_hints.input_mode = 0; mwm_hints.status = 0; - XChangeProperty( data->display, data->whole_window, x11drv_atom(_MOTIF_WM_HINTS), - x11drv_atom(_MOTIF_WM_HINTS), 32, PropModeReplace, - (unsigned char*)&mwm_hints, sizeof(mwm_hints)/sizeof(long) ); + TRACE( "%p setting mwm hints to %s (style %x exstyle %x)\n", + data->hwnd, debugstr_mwm_hints(&mwm_hints), style, ex_style ); + window_set_mwm_hints( data, &mwm_hints ); } @@ -1715,6 +1733,19 @@ void window_net_wm_state_notify( struct x11drv_win_data *data, unsigned long ser window_set_config( data, &data->desired_state.rect, FALSE ); } +void window_mwm_hints_notify( struct x11drv_win_data *data, unsigned long serial, const MwmHints *value ) +{ + MwmHints *desired = &data->desired_state.mwm_hints, *pending = &data->pending_state.mwm_hints, *current = &data->current_state.mwm_hints; + unsigned long *expect_serial = &data->mwm_hints_serial; + const char *expected, *received; + + received = wine_dbg_sprintf( "_MOTIF_WM_HINTS %s/%lu", debugstr_mwm_hints(value), serial ); + expected = *expect_serial ? wine_dbg_sprintf( ", expected %s/%lu", debugstr_mwm_hints(pending), *expect_serial ) : ""; + + handle_state_change( data, serial, expect_serial, sizeof(*value), value, + desired, pending, current, expected, received, NULL ); +} + void window_configure_notify( struct x11drv_win_data *data, unsigned long serial, const RECT *value ) { RECT *desired = &data->desired_state.rect, *pending = &data->pending_state.rect, *current = &data->current_state.rect; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 78054103709c..ed60e1a6b501 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -67,6 +67,7 @@ typedef int Status; #include "unixlib.h" #include "wine/list.h" #include "wine/debug.h" +#include "mwm.h" #define MAX_DASHLEN 16 @@ -624,6 +625,7 @@ struct window_state { UINT wm_state; UINT net_wm_state; + MwmHints mwm_hints; RECT rect; }; @@ -662,6 +664,7 @@ struct x11drv_win_data struct window_state current_state; /* window state tracking the current X11 state */ unsigned long wm_state_serial; /* serial of last pending WM_STATE request */ unsigned long net_wm_state_serial; /* serial of last pending _NET_WM_STATE request */ + unsigned long mwm_hints_serial; /* serial of last pending _MOTIF_WM_HINTS request */ unsigned long configure_serial; /* serial of last pending configure request */ }; @@ -680,6 +683,7 @@ extern BOOL window_should_take_focus( HWND hwnd, Time time ); extern BOOL window_has_pending_wm_state( HWND hwnd, UINT state ); extern void window_wm_state_notify( struct x11drv_win_data *data, unsigned long serial, UINT value, Time time ); extern void window_net_wm_state_notify( struct x11drv_win_data *data, unsigned long serial, UINT value ); +extern void window_mwm_hints_notify( struct x11drv_win_data *data, unsigned long serial, const MwmHints *hints ); extern void window_configure_notify( struct x11drv_win_data *data, unsigned long serial, const RECT *rect ); extern BOOL get_window_state_updates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, RECT *rect ); From ab4ab8e91e71385809f332316218c922fc76c87a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sun, 8 Dec 2024 12:37:29 +0100 Subject: [PATCH 0765/2542] winex11: Avoid creating windows with override-redirect flag set. This confuses mutter, and it will later get confused in various ways if decorations are later added or removed on the window, even if the flag has been unset. Doing it the other way, changing the flag later on, when needed works fine. This manifests with spurious IconicState WM_STATE change when mutter decides to try managing the window, but it also makes it randomly lose focus or even fail to map the window back on screen. --- dlls/winex11.drv/window.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 097c99c394a6..3f3188b50515 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2115,12 +2115,6 @@ static void create_whole_window( struct x11drv_win_data *data ) HRGN win_rgn; POINT pos; - if (!data->managed && is_window_managed( data->hwnd, SWP_NOACTIVATE, &data->rects.window )) - { - TRACE( "making win %p/%lx managed\n", data->hwnd, data->whole_window ); - data->managed = TRUE; - } - if ((win_rgn = NtGdiCreateRectRgn( 0, 0, 0, 0 )) && NtUserGetWindowRgnEx( data->hwnd, win_rgn, 0 ) == ERROR) { @@ -2132,6 +2126,7 @@ static void create_whole_window( struct x11drv_win_data *data ) if (data->vis.visualid != default_visual.visualid) data->whole_colormap = XCreateColormap( data->display, root_window, data->vis.visual, AllocNone ); + data->managed = TRUE; mask = get_window_attributes( data, &attr ); if (!(cx = data->rects.visible.right - data->rects.visible.left)) cx = 1; @@ -2148,6 +2143,7 @@ static void create_whole_window( struct x11drv_win_data *data ) data->pending_state.rect = data->current_state.rect; data->desired_state.rect = data->current_state.rect; + if (!is_window_managed( data->hwnd, SWP_NOACTIVATE, &data->rects.window )) data->managed = FALSE; x11drv_xinput2_enable( data->display, data->whole_window ); set_initial_wm_hints( data->display, data->whole_window ); set_wm_hints( data ); From cebeccff359712942f92da0ba722f53e62a39f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sat, 7 Dec 2024 12:17:23 +0100 Subject: [PATCH 0766/2542] winex11: Workaround Mutter bug when changing decorations. --- dlls/winex11.drv/window.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 3f3188b50515..eac76afe4dca 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -898,6 +898,8 @@ static void set_size_hints( struct x11drv_win_data *data, DWORD style ) } +static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state ); + static void window_set_mwm_hints( struct x11drv_win_data *data, const MwmHints *new_hints ) { const MwmHints *old_hints = &data->pending_state.mwm_hints; @@ -906,6 +908,30 @@ static void window_set_mwm_hints( struct x11drv_win_data *data, const MwmHints * if (!data->whole_window) return; /* no window, nothing to update */ if (!memcmp( old_hints, new_hints, sizeof(*new_hints) )) return; /* hints are the same, nothing to update */ + /* When removing decorations, Mutter sends UnmapNotify, FocusOut, ReparentNotify, MapNotify, WM_TAKE_FOCUS + * event sequence. We won't receive any WM_STATE property changes and cannot use it to detect when it's done, + * so explicitly request the Unmap / Map sequence ourselves, so we can follow the WM_STATE property changes. + * + * When adding decorations to a window in NormalState, Mutter first iconifies the window, then restores it + * after the same sequence. It however sometimes fails to restore focus to the window. + * + * In both cases, we will receive _MOTIF_WM_HINT PropertyNotify change right away and will then be unable to + * handle the non-atomic event sequence that follows. + * + * Instead, explicitly request an unmap / map sequence ourselves and track the corresponding events, overriding + * the Mutter generated sequence, while achieving the same thing and getting WM_TAKE_FOCUS event when the + * window is mapped again. + */ + if (data->managed && data->pending_state.wm_state == NormalState && + !old_hints->decorations != !new_hints->decorations) + { + if (data->wm_state_serial) return; /* another WM_STATE update is pending, wait for it to complete */ + WARN( "window %p/%lx adds/removes decorations, remapping\n", data->hwnd, data->whole_window ); + NtUserSetProp( data->hwnd, focus_time_prop, (HANDLE)-1 ); + window_set_wm_state( data, WithdrawnState ); + window_set_wm_state( data, NormalState ); + } + data->pending_state.mwm_hints = *new_hints; data->mwm_hints_serial = NextRequest( data->display ); TRACE( "window %p/%lx, requesting _MOTIF_WM_HINTS %s serial %lu\n", data->hwnd, data->whole_window, @@ -1698,8 +1724,6 @@ void window_wm_state_notify( struct x11drv_win_data *data, unsigned long serial, received = wine_dbg_sprintf( "WM_STATE %#x/%lu", value, serial ); expected = *expect_serial ? wine_dbg_sprintf( ", expected %#x/%lu", *pending, *expect_serial ) : ""; - /* ignore Metacity/Mutter transient NormalState during WithdrawnState <-> IconicState transitions */ - if (value == NormalState && *current + *pending == IconicState) reason = "transient "; if (!handle_state_change( data, serial, expect_serial, sizeof(value), &value, desired, pending, current, expected, received, reason )) @@ -1709,6 +1733,7 @@ void window_wm_state_notify( struct x11drv_win_data *data, unsigned long serial, window_set_wm_state( data, data->desired_state.wm_state ); window_set_net_wm_state( data, data->desired_state.net_wm_state ); window_set_config( data, &data->desired_state.rect, FALSE ); + window_set_mwm_hints( data, &data->desired_state.mwm_hints ); if (data->current_state.wm_state == NormalState) NtUserSetProp( data->hwnd, focus_time_prop, (HANDLE)time ); else if (!data->wm_state_serial) NtUserRemoveProp( data->hwnd, focus_time_prop ); @@ -1731,6 +1756,7 @@ void window_net_wm_state_notify( struct x11drv_win_data *data, unsigned long ser window_set_wm_state( data, data->desired_state.wm_state ); window_set_net_wm_state( data, data->desired_state.net_wm_state ); window_set_config( data, &data->desired_state.rect, FALSE ); + window_set_mwm_hints( data, &data->desired_state.mwm_hints ); } void window_mwm_hints_notify( struct x11drv_win_data *data, unsigned long serial, const MwmHints *value ) From a1736382e1981e2ec754cb9170ebdd405ad2d80f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sat, 7 Dec 2024 20:58:23 +0100 Subject: [PATCH 0767/2542] winex11: Keep _NET_WM_USER_TIME on the individual windows. --- dlls/winex11.drv/event.c | 2 -- dlls/winex11.drv/keyboard.c | 2 +- dlls/winex11.drv/mouse.c | 2 +- dlls/winex11.drv/window.c | 33 ++++----------------------------- dlls/winex11.drv/x11drv.h | 2 +- 5 files changed, 7 insertions(+), 34 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index b73b3ab6a496..8c4a4459b569 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -739,8 +739,6 @@ static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event ) if (protocol == x11drv_atom(WM_DELETE_WINDOW)) { - update_user_time( event_time ); - if (hwnd == NtUserGetDesktopWindow()) { /* The desktop window does not have a close button that we can diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index fdca9d67e0b6..95b98f1c40d6 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -1340,7 +1340,7 @@ BOOL X11DRV_KeyEvent( HWND hwnd, XEvent *xev ) TRACE_(key)("type %d, window %lx, state 0x%04x, keycode %u\n", event->type, event->window, event->state, event->keycode); - if (event->type == KeyPress) update_user_time( event->time ); + if (hwnd && event->type == KeyPress) update_user_time( event->display, event->window, event->time ); /* Clients should pass only KeyPress events to XmbLookupString */ if (xic && event->type == KeyPress) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index b5ff6b302757..2dfc83dbed82 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -1614,7 +1614,7 @@ BOOL X11DRV_ButtonPress( HWND hwnd, XEvent *xev ) input.mi.time = EVENT_x11_time_to_win32_time( event->time ); input.mi.dwExtraInfo = 0; - update_user_time( event->time ); + if (hwnd) update_user_time( event->display, event->window, event->time ); map_event_coords( hwnd, event->window, event->root, event->x_root, event->y_root, &input ); send_mouse_input( hwnd, event->window, event->state, &input ); return TRUE; diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index eac76afe4dca..dad907488e93 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -99,10 +99,6 @@ XContext winContext = 0; static XContext win_data_context = 0; static XContext host_window_context = 0; -/* time of last user event and window where it's stored */ -static Time last_user_time; -static Window user_time_window; - static const WCHAR whole_window_prop[] = {'_','_','w','i','n','e','_','x','1','1','_','w','h','o','l','e','_','w','i','n','d','o','w',0}; static const WCHAR clip_window_prop[] = @@ -276,7 +272,7 @@ static void remove_startup_notification(Display *display, Window window) if (!(id = getenv( "DESKTOP_STARTUP_ID" )) || !id[0]) return; - if ((src = strstr( id, "_TIME" ))) update_user_time( atol( src + 5 )); + if ((src = strstr( id, "_TIME" ))) update_user_time( display, window, atol( src + 5 ) ); pos = snprintf(message, sizeof(message), "remove: ID="); message[pos++] = '"'; @@ -1098,11 +1094,6 @@ static void set_initial_wm_hints( Display *display, Window window ) XChangeProperty( display, window, x11drv_atom(XdndAware), XA_ATOM, 32, PropModeReplace, (unsigned char*)&dndVersion, 1 ); - - update_user_time( 0 ); /* make sure that the user time window exists */ - if (user_time_window) - XChangeProperty( display, window, x11drv_atom(_NET_WM_USER_TIME_WINDOW), - XA_WINDOW, 32, PropModeReplace, (unsigned char *)&user_time_window, 1 ); } @@ -1171,26 +1162,10 @@ Window init_clip_window(void) /*********************************************************************** * update_user_time */ -void update_user_time( Time time ) +void update_user_time( Display *display, Window window, Time time ) { - if (!user_time_window) - { - Window win = XCreateWindow( gdi_display, root_window, -1, -1, 1, 1, 0, CopyFromParent, - InputOnly, CopyFromParent, 0, NULL ); - if (InterlockedCompareExchangePointer( (void **)&user_time_window, (void *)win, 0 )) - XDestroyWindow( gdi_display, win ); - TRACE( "user time window %lx\n", user_time_window ); - } - - if (!time) return; - XLockDisplay( gdi_display ); - if (!last_user_time || (long)(time - last_user_time) > 0) - { - last_user_time = time; - XChangeProperty( gdi_display, user_time_window, x11drv_atom(_NET_WM_USER_TIME), - XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&time, 1 ); - } - XUnlockDisplay( gdi_display ); + XChangeProperty( display, window, x11drv_atom(_NET_WM_USER_TIME), XA_CARDINAL, + 32, PropModeReplace, (unsigned char *)&time, 1 ); } /* Update _NET_WM_FULLSCREEN_MONITORS when _NET_WM_STATE_FULLSCREEN is set to support fullscreen diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index ed60e1a6b501..05083350d6a7 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -691,7 +691,7 @@ extern void net_supported_init( struct x11drv_thread_data *data ); extern void net_supporting_wm_check_init( struct x11drv_thread_data *data ); extern Window init_clip_window(void); -extern void update_user_time( Time time ); +extern void update_user_time( Display *display, Window window, Time time ); extern UINT get_window_net_wm_state( Display *display, Window window ); extern void make_window_embedded( struct x11drv_win_data *data ); extern Window create_client_window( HWND hwnd, RECT client_rect, const XVisualInfo *visual, Colormap colormap ); From 76a5112ed00c02bca0981d76fb1f6d04d6b4a0d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sun, 8 Dec 2024 17:29:26 +0100 Subject: [PATCH 0768/2542] winex11: Keep track of the SWP flags to be used when mapping windows. --- dlls/winex11.drv/window.c | 72 ++++++++++++++++++++------------------- dlls/winex11.drv/x11drv.h | 1 + 2 files changed, 38 insertions(+), 35 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index dad907488e93..5b7892b60185 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -894,9 +894,9 @@ static void set_size_hints( struct x11drv_win_data *data, DWORD style ) } -static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state ); +static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state, UINT swp_flags ); -static void window_set_mwm_hints( struct x11drv_win_data *data, const MwmHints *new_hints ) +static void window_set_mwm_hints( struct x11drv_win_data *data, const MwmHints *new_hints, UINT swp_flags ) { const MwmHints *old_hints = &data->pending_state.mwm_hints; @@ -924,8 +924,8 @@ static void window_set_mwm_hints( struct x11drv_win_data *data, const MwmHints * if (data->wm_state_serial) return; /* another WM_STATE update is pending, wait for it to complete */ WARN( "window %p/%lx adds/removes decorations, remapping\n", data->hwnd, data->whole_window ); NtUserSetProp( data->hwnd, focus_time_prop, (HANDLE)-1 ); - window_set_wm_state( data, WithdrawnState ); - window_set_wm_state( data, NormalState ); + window_set_wm_state( data, WithdrawnState, FALSE ); + window_set_wm_state( data, NormalState, swp_flags ); } data->pending_state.mwm_hints = *new_hints; @@ -940,7 +940,7 @@ static void window_set_mwm_hints( struct x11drv_win_data *data, const MwmHints * /*********************************************************************** * set_mwm_hints */ -static void set_mwm_hints( struct x11drv_win_data *data, UINT style, UINT ex_style ) +static void set_mwm_hints( struct x11drv_win_data *data, UINT style, UINT ex_style, UINT swp_flags ) { MwmHints mwm_hints; @@ -976,7 +976,7 @@ static void set_mwm_hints( struct x11drv_win_data *data, UINT style, UINT ex_sty mwm_hints.status = 0; TRACE( "%p setting mwm hints to %s (style %x exstyle %x)\n", data->hwnd, debugstr_mwm_hints(&mwm_hints), style, ex_style ); - window_set_mwm_hints( data, &mwm_hints ); + window_set_mwm_hints( data, &mwm_hints, swp_flags ); } @@ -1121,7 +1121,7 @@ static void make_owner_managed( HWND hwnd ) * * Set all the window manager hints for a window. */ -static void set_wm_hints( struct x11drv_win_data *data ) +static void set_wm_hints( struct x11drv_win_data *data, UINT swp_flags ) { DWORD style, ex_style; @@ -1138,7 +1138,7 @@ static void set_wm_hints( struct x11drv_win_data *data ) } set_size_hints( data, style ); - set_mwm_hints( data, style, ex_style ); + set_mwm_hints( data, style, ex_style, swp_flags ); set_style_hints( data, style, ex_style ); } @@ -1290,7 +1290,7 @@ static void window_set_net_wm_state( struct x11drv_win_data *data, UINT new_stat XFlush( data->display ); } -static void window_set_config( struct x11drv_win_data *data, const RECT *new_rect, BOOL above ) +static void window_set_config( struct x11drv_win_data *data, const RECT *new_rect, BOOL above, UINT swp_flags ) { static const UINT fullscreen_mask = (1 << NET_WM_STATE_MAXIMIZED) | (1 << NET_WM_STATE_FULLSCREEN); UINT style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ), mask = 0; @@ -1457,12 +1457,13 @@ static void set_xembed_flags( struct x11drv_win_data *data, unsigned long flags x11drv_atom(_XEMBED_INFO), 32, PropModeReplace, (unsigned char*)info, 2 ); } -static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state ) +static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state, UINT swp_flags ) { UINT old_state = data->pending_state.wm_state; HWND foreground = NtUserGetForegroundWindow(); data->desired_state.wm_state = new_state; + data->desired_state.swp_flags = swp_flags; if (!data->whole_window) return; /* no window, nothing to update */ if (data->wm_state_serial) return; /* another WM_STATE update is pending, wait for it to complete */ if (old_state == new_state) return; /* states are the same, nothing to update */ @@ -1472,14 +1473,14 @@ static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state ) case MAKELONG(WithdrawnState, IconicState): case MAKELONG(WithdrawnState, NormalState): remove_startup_notification( data->display, data->whole_window ); - set_wm_hints( data ); + set_wm_hints( data, swp_flags ); update_net_wm_states( data ); sync_window_style( data ); update_net_wm_fullscreen_monitors( data ); break; case MAKELONG(IconicState, NormalState): case MAKELONG(NormalState, IconicState): - set_wm_hints( data ); + set_wm_hints( data, swp_flags ); break; } @@ -1491,6 +1492,7 @@ static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state ) } data->pending_state.wm_state = new_state; + data->pending_state.swp_flags = swp_flags; data->wm_state_serial = NextRequest( data->display ); TRACE( "window %p/%lx, requesting WM_STATE %#x -> %#x serial %lu, foreground %p\n", data->hwnd, data->whole_window, old_state, new_state, data->wm_state_serial, NtUserGetForegroundWindow() ); @@ -1524,7 +1526,7 @@ static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state ) /*********************************************************************** * map_window */ -static void map_window( HWND hwnd, DWORD new_style ) +static void map_window( HWND hwnd, DWORD new_style, BOOL swp_flags ) { struct x11drv_win_data *data; @@ -1532,7 +1534,7 @@ static void map_window( HWND hwnd, DWORD new_style ) if (!(data = get_win_data( hwnd ))) return; TRACE( "win %p/%lx\n", data->hwnd, data->whole_window ); - window_set_wm_state( data, (new_style & WS_MINIMIZE) ? IconicState : NormalState ); + window_set_wm_state( data, (new_style & WS_MINIMIZE) ? IconicState : NormalState, swp_flags ); release_win_data( data ); } @@ -1546,7 +1548,7 @@ static void unmap_window( HWND hwnd ) if (!(data = get_win_data( hwnd ))) return; TRACE( "win %p/%lx\n", data->hwnd, data->whole_window ); - window_set_wm_state( data, WithdrawnState ); + window_set_wm_state( data, WithdrawnState, 0 ); release_win_data( data ); } @@ -1705,10 +1707,10 @@ void window_wm_state_notify( struct x11drv_win_data *data, unsigned long serial, return; /* send any pending changes from the desired state */ - window_set_wm_state( data, data->desired_state.wm_state ); + window_set_wm_state( data, data->desired_state.wm_state, data->desired_state.swp_flags ); window_set_net_wm_state( data, data->desired_state.net_wm_state ); - window_set_config( data, &data->desired_state.rect, FALSE ); - window_set_mwm_hints( data, &data->desired_state.mwm_hints ); + window_set_config( data, &data->desired_state.rect, FALSE, data->desired_state.swp_flags ); + window_set_mwm_hints( data, &data->desired_state.mwm_hints, data->desired_state.swp_flags ); if (data->current_state.wm_state == NormalState) NtUserSetProp( data->hwnd, focus_time_prop, (HANDLE)time ); else if (!data->wm_state_serial) NtUserRemoveProp( data->hwnd, focus_time_prop ); @@ -1728,10 +1730,10 @@ void window_net_wm_state_notify( struct x11drv_win_data *data, unsigned long ser return; /* send any pending changes from the desired state */ - window_set_wm_state( data, data->desired_state.wm_state ); + window_set_wm_state( data, data->desired_state.wm_state, data->desired_state.swp_flags ); window_set_net_wm_state( data, data->desired_state.net_wm_state ); - window_set_config( data, &data->desired_state.rect, FALSE ); - window_set_mwm_hints( data, &data->desired_state.mwm_hints ); + window_set_config( data, &data->desired_state.rect, FALSE, data->desired_state.swp_flags ); + window_set_mwm_hints( data, &data->desired_state.mwm_hints, data->desired_state.swp_flags ); } void window_mwm_hints_notify( struct x11drv_win_data *data, unsigned long serial, const MwmHints *value ) @@ -1785,10 +1787,10 @@ BOOL window_should_take_focus( HWND hwnd, Time time ) void make_window_embedded( struct x11drv_win_data *data ) { /* the window cannot be mapped before being embedded */ - window_set_wm_state( data, WithdrawnState ); + window_set_wm_state( data, WithdrawnState, 0 ); data->embedded = TRUE; data->managed = TRUE; - window_set_wm_state( data, NormalState ); + window_set_wm_state( data, NormalState, SWP_NOACTIVATE ); } @@ -1818,7 +1820,7 @@ static void sync_window_position( struct x11drv_win_data *data, UINT swp_flags, } set_size_hints( data, style ); - set_mwm_hints( data, style, ex_style ); + set_mwm_hints( data, style, ex_style, swp_flags ); update_net_wm_states( data ); new_rect = data->rects.visible; @@ -1828,7 +1830,7 @@ static void sync_window_position( struct x11drv_win_data *data, UINT swp_flags, if (data->is_offscreen) OffsetRect( &new_rect, window_rect.left - old_rects->window.left, window_rect.top - old_rects->window.top ); - window_set_config( data, &new_rect, above ); + window_set_config( data, &new_rect, above, swp_flags ); } @@ -2147,7 +2149,7 @@ static void create_whole_window( struct x11drv_win_data *data ) if (!is_window_managed( data->hwnd, SWP_NOACTIVATE, &data->rects.window )) data->managed = FALSE; x11drv_xinput2_enable( data->display, data->whole_window ); set_initial_wm_hints( data->display, data->whole_window ); - set_wm_hints( data ); + set_wm_hints( data, 0 ); XSaveContext( data->display, data->whole_window, winContext, (char *)data->hwnd ); NtUserSetProp( data->hwnd, whole_window_prop, (HANDLE)data->whole_window ); @@ -2284,7 +2286,7 @@ void X11DRV_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) if (!(data = get_win_data( hwnd ))) return; if (!data->whole_window) goto done; - if (offset == GWL_STYLE && (changed & WS_DISABLED)) set_wm_hints( data ); + if (offset == GWL_STYLE && (changed & WS_DISABLED)) set_wm_hints( data, 0 ); if (offset == GWL_EXSTYLE && (changed & WS_EX_LAYERED)) /* changing WS_EX_LAYERED resets attributes */ { @@ -2597,7 +2599,7 @@ BOOL X11DRV_SystrayDockRemove( HWND hwnd ) if ((data = get_win_data( hwnd ))) { - if ((ret = data->embedded)) window_set_wm_state( data, WithdrawnState ); + if ((ret = data->embedded)) window_set_wm_state( data, WithdrawnState, 0 ); release_win_data( data ); } @@ -3027,17 +3029,17 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UIN needs_map = data->layered || IsRectEmpty( &new_rects->window ); release_win_data( data ); if (needs_icon) fetch_icon_data( hwnd, 0, 0 ); - if (needs_map) map_window( hwnd, new_style ); + if (needs_map) map_window( hwnd, new_style, swp_flags ); return; } else if ((swp_flags & SWP_STATECHANGED) && ((old_style ^ new_style) & WS_MINIMIZE)) { - window_set_wm_state( data, (new_style & WS_MINIMIZE) ? IconicState : NormalState ); + window_set_wm_state( data, (new_style & WS_MINIMIZE) ? IconicState : NormalState, swp_flags ); update_net_wm_states( data ); } else { - if (swp_flags & (SWP_FRAMECHANGED|SWP_STATECHANGED)) set_wm_hints( data ); + if (swp_flags & (SWP_FRAMECHANGED|SWP_STATECHANGED)) set_wm_hints( data, swp_flags ); update_net_wm_states( data ); } } @@ -3128,7 +3130,7 @@ void X11DRV_SetWindowIcon( HWND hwnd, UINT type, HICON icon ) else fetch_icon_data( hwnd, 0, icon ); if (!(data = get_win_data( hwnd ))) return; - set_wm_hints( data ); + set_wm_hints( data, 0 ); done: release_win_data( data ); } @@ -3180,7 +3182,7 @@ void X11DRV_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWO ((style & WS_MINIMIZE) || is_window_rect_mapped( &data->rects.window ))) { release_win_data( data ); - map_window( hwnd, style ); + map_window( hwnd, style, 0 ); return; } } @@ -3217,7 +3219,7 @@ void X11DRV_UpdateLayeredWindow( HWND hwnd, UINT flags ) DWORD style = NtUserGetWindowLongW( hwnd, GWL_STYLE ); if ((style & WS_VISIBLE) && ((style & WS_MINIMIZE) || is_window_rect_mapped( &data->rects.window ))) - map_window( hwnd, style ); + map_window( hwnd, style, 0 ); } } @@ -3279,7 +3281,7 @@ LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) { /* update the full screen state */ update_net_wm_states( data ); - window_set_config( data, &data->rects.visible, FALSE ); + window_set_config( data, &data->rects.visible, FALSE, 0 ); release_win_data( data ); } return 0; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 05083350d6a7..8b991946b0b5 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -623,6 +623,7 @@ enum x11drv_net_wm_state struct window_state { + UINT swp_flags; UINT wm_state; UINT net_wm_state; MwmHints mwm_hints; From c48280ffb4bfebe9a032247bd711e183b4ecff43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sat, 7 Dec 2024 21:02:58 +0100 Subject: [PATCH 0769/2542] winex11: Set _NET_WM_USER_TIME to 0 to implement SWP_NOACTIVATE. --- dlls/winex11.drv/keyboard.c | 2 +- dlls/winex11.drv/mouse.c | 2 +- dlls/winex11.drv/window.c | 19 ++++++++++++++----- dlls/winex11.drv/x11drv.h | 2 +- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index 95b98f1c40d6..3d23b2561fef 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -1340,7 +1340,7 @@ BOOL X11DRV_KeyEvent( HWND hwnd, XEvent *xev ) TRACE_(key)("type %d, window %lx, state 0x%04x, keycode %u\n", event->type, event->window, event->state, event->keycode); - if (hwnd && event->type == KeyPress) update_user_time( event->display, event->window, event->time ); + if (hwnd && event->type == KeyPress) update_user_time( event->display, event->window, event->time, FALSE ); /* Clients should pass only KeyPress events to XmbLookupString */ if (xic && event->type == KeyPress) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 2dfc83dbed82..9e62efe91ec8 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -1614,7 +1614,7 @@ BOOL X11DRV_ButtonPress( HWND hwnd, XEvent *xev ) input.mi.time = EVENT_x11_time_to_win32_time( event->time ); input.mi.dwExtraInfo = 0; - if (hwnd) update_user_time( event->display, event->window, event->time ); + if (hwnd) update_user_time( event->display, event->window, event->time, FALSE ); map_event_coords( hwnd, event->window, event->root, event->x_root, event->y_root, &input ); send_mouse_input( hwnd, event->window, event->state, &input ); return TRUE; diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 5b7892b60185..a9b5477fe73a 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -272,7 +272,7 @@ static void remove_startup_notification(Display *display, Window window) if (!(id = getenv( "DESKTOP_STARTUP_ID" )) || !id[0]) return; - if ((src = strstr( id, "_TIME" ))) update_user_time( display, window, atol( src + 5 ) ); + if ((src = strstr( id, "_TIME" ))) update_user_time( display, window, atol( src + 5 ), FALSE ); pos = snprintf(message, sizeof(message), "remove: ID="); message[pos++] = '"'; @@ -1162,10 +1162,12 @@ Window init_clip_window(void) /*********************************************************************** * update_user_time */ -void update_user_time( Display *display, Window window, Time time ) +void update_user_time( Display *display, Window window, Time time, BOOL force ) { - XChangeProperty( display, window, x11drv_atom(_NET_WM_USER_TIME), XA_CARDINAL, - 32, PropModeReplace, (unsigned char *)&time, 1 ); + if (!force && (time == -1 || time == 0)) time = 1; + if (time == -1) XDeleteProperty( display, window, x11drv_atom(_NET_WM_USER_TIME) ); + else XChangeProperty( display, window, x11drv_atom(_NET_WM_USER_TIME), XA_CARDINAL, + 32, PropModeReplace, (unsigned char *)&time, 1 ); } /* Update _NET_WM_FULLSCREEN_MONITORS when _NET_WM_STATE_FULLSCREEN is set to support fullscreen @@ -1484,7 +1486,14 @@ static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state, U break; } - if (new_state != NormalState && data->has_focus && data->hwnd != foreground) + if (new_state == NormalState) + { + /* try forcing activation if the window is supposed to be foreground or if it is fullscreen */ + if (data->hwnd == foreground || data->is_fullscreen) swp_flags = 0; + if (swp_flags & SWP_NOACTIVATE) update_user_time( data->display, data->whole_window, 0, TRUE ); + else update_user_time( data->display, data->whole_window, -1, TRUE ); + } + else if (data->has_focus && data->hwnd != foreground) { Window window = X11DRV_get_whole_window( foreground ); WARN( "Inconsistent input focus, activating window %p/%lx\n", foreground, window ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 8b991946b0b5..86d782740b3b 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -692,7 +692,7 @@ extern void net_supported_init( struct x11drv_thread_data *data ); extern void net_supporting_wm_check_init( struct x11drv_thread_data *data ); extern Window init_clip_window(void); -extern void update_user_time( Display *display, Window window, Time time ); +extern void update_user_time( Display *display, Window window, Time time, BOOL force ); extern UINT get_window_net_wm_state( Display *display, Window window ); extern void make_window_embedded( struct x11drv_win_data *data ); extern Window create_client_window( HWND hwnd, RECT client_rect, const XVisualInfo *visual, Colormap colormap ); From 0979546743bd1c4e91d97a65179d5b3ff4ed6bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sun, 8 Dec 2024 23:57:48 +0100 Subject: [PATCH 0770/2542] winex11: Workaround KWin bug with maximized windows. --- dlls/winex11.drv/window.c | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index a9b5477fe73a..9516a2ccaf2f 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1228,6 +1228,7 @@ static void update_net_wm_fullscreen_monitors( struct x11drv_win_data *data ) static void window_set_net_wm_state( struct x11drv_win_data *data, UINT new_state ) { + static const UINT fullscreen_mask = (1 << NET_WM_STATE_MAXIMIZED) | (1 << NET_WM_STATE_FULLSCREEN); UINT i, count, old_state = data->pending_state.net_wm_state; new_state &= x11drv_thread_data()->net_wm_state_mask; @@ -1237,6 +1238,9 @@ static void window_set_net_wm_state( struct x11drv_win_data *data, UINT new_stat /* we ignore and override previous _NET_WM_STATE update requests */ if (old_state == new_state) return; /* states are the same, nothing to update */ + /* On KWin wait for _NET_WM_STATE changes to complete when they touch maximized / fullscreen states */ + if (X11DRV_HasWindowManager( "KWin" ) && data->net_wm_state_serial && (old_state ^ new_state) & fullscreen_mask) return; + if (data->pending_state.wm_state == IconicState) return; /* window is iconic, don't update its state now */ if (data->pending_state.wm_state == WithdrawnState) /* set the _NET_WM_STATE atom directly */ { @@ -1295,24 +1299,33 @@ static void window_set_net_wm_state( struct x11drv_win_data *data, UINT new_stat static void window_set_config( struct x11drv_win_data *data, const RECT *new_rect, BOOL above, UINT swp_flags ) { static const UINT fullscreen_mask = (1 << NET_WM_STATE_MAXIMIZED) | (1 << NET_WM_STATE_FULLSCREEN); - UINT style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ), mask = 0; + UINT style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ), mask = 0, net_wm_state = -1; const RECT *old_rect = &data->pending_state.rect; XWindowChanges changes; + BOOL is_maximized; data->desired_state.rect = *new_rect; if (!data->whole_window) return; /* no window, nothing to update */ if (EqualRect( old_rect, new_rect ) && !above) return; /* rects are the same, no need to be raised, nothing to update */ - if (data->pending_state.wm_state == NormalState && data->net_wm_state_serial && - !(data->pending_state.net_wm_state & fullscreen_mask) && - (data->current_state.net_wm_state & fullscreen_mask)) + /* Kwin internal maximized state tracking gets bogus if a window configure request is sent to a maximized + * window, and it loses track of whether the window was maximized state. + * + * Moving a maximized window to a different monitor requires sending a configure request but KWin bug makes + * no difference to requests with only position changes, and they trigger it all the same. + * + * Instead, explicitly request an unmap / map sequence ourselves and track the corresponding events, overriding + * the Mutter generated sequence, while achieving the same thing and getting WM_TAKE_FOCUS event when the + * window is mapped again. + */ + is_maximized = (data->net_wm_state_serial ? data->pending_state.net_wm_state : data->current_state.net_wm_state) & fullscreen_mask; + if (X11DRV_HasWindowManager( "KWin" ) && data->managed && data->pending_state.wm_state == NormalState && is_maximized) { - /* Some window managers are sending a ConfigureNotify event with the fullscreen size when - * exiting a fullscreen window, with a serial that we cannot predict. Handling that event - * will override the Win32 window size and make the window fullscreen again. - */ - WARN( "window %p/%lx is exiting maximize/fullscreen, delaying request\n", data->hwnd, data->whole_window ); - return; + if (data->wm_state_serial) return; /* another WM_STATE update is pending, wait for it to complete */ + if (data->net_wm_state_serial) return; /* another _NET_WM_STATE update is pending, wait for it to complete */ + WARN( "window %p/%lx is maximized/fullscreen, temporarily restoring\n", data->hwnd, data->whole_window ); + net_wm_state = data->pending_state.net_wm_state; + window_set_net_wm_state( data, net_wm_state & ~fullscreen_mask ); } /* resizing a managed maximized window is not allowed */ @@ -1350,6 +1363,8 @@ static void window_set_config( struct x11drv_win_data *data, const RECT *new_rec TRACE( "window %p/%lx, requesting config %s above %u, serial %lu\n", data->hwnd, data->whole_window, wine_dbgstr_rect(new_rect), above, data->configure_serial ); XReconfigureWMWindow( data->display, data->whole_window, data->vis.screen, mask, &changes ); + + if (net_wm_state != -1) window_set_net_wm_state( data, net_wm_state ); } /*********************************************************************** @@ -1829,7 +1844,6 @@ static void sync_window_position( struct x11drv_win_data *data, UINT swp_flags, } set_size_hints( data, style ); - set_mwm_hints( data, style, ex_style, swp_flags ); update_net_wm_states( data ); new_rect = data->rects.visible; @@ -1840,6 +1854,7 @@ static void sync_window_position( struct x11drv_win_data *data, UINT swp_flags, window_rect.top - old_rects->window.top ); window_set_config( data, &new_rect, above, swp_flags ); + set_mwm_hints( data, style, ex_style, swp_flags ); } From b48feed05e6980b195c4fc21cb3e6860cb4131b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 11 Dec 2024 09:40:21 +0100 Subject: [PATCH 0771/2542] HACK: win32u: Emulate display mode list with gamescope. --- dlls/win32u/sysparams.c | 58 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 6eddbda295c5..ba6a6ffb5e3d 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -159,6 +159,7 @@ static INT64 last_query_display_time; static UINT64 monitor_update_serial; static pthread_mutex_t display_lock = PTHREAD_MUTEX_INITIALIZER; +static BOOL emulate_modelist = TRUE; static BOOL emulate_modeset = TRUE; BOOL decorated_mode = TRUE; UINT64 thunk_lock_callback = 0; @@ -451,6 +452,21 @@ static const char *debugstr_devmodew( const DEVMODEW *devmode ) position ); } +static UINT devmode_get( const DEVMODEW *mode, UINT field ) +{ + switch (field) + { + case DM_DISPLAYORIENTATION: return mode->dmFields & DM_DISPLAYORIENTATION ? mode->dmDisplayOrientation : 0; + case DM_BITSPERPEL: return mode->dmFields & DM_BITSPERPEL ? mode->dmBitsPerPel : 0; + case DM_PELSWIDTH: return mode->dmFields & DM_PELSWIDTH ? mode->dmPelsWidth : 0; + case DM_PELSHEIGHT: return mode->dmFields & DM_PELSHEIGHT ? mode->dmPelsHeight : 0; + case DM_DISPLAYFLAGS: return mode->dmFields & DM_DISPLAYFLAGS ? mode->dmDisplayFlags : 0; + case DM_DISPLAYFREQUENCY: return mode->dmFields & DM_DISPLAYFREQUENCY ? mode->dmDisplayFrequency : 0; + case DM_DISPLAYFIXEDOUTPUT: return mode->dmFields & DM_DISPLAYFIXEDOUTPUT ? mode->dmDisplayFixedOutput : 0; + } + return 0; +} + static BOOL write_source_mode( HKEY hkey, UINT index, const DEVMODEW *mode ) { WCHAR bufferW[MAX_PATH] = {0}; @@ -1658,6 +1674,23 @@ static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *ini return modes; } +static DEVMODEW find_largest_mode( const DEVMODEW *found, const DEVMODEW *modes, UINT modes_count ) +{ + const DEVMODEW *mode; + + for (mode = modes; mode && modes_count; mode = NEXT_DEVMODEW(mode), modes_count--) + { + if (devmode_get( found, DM_DISPLAYORIENTATION ) != devmode_get( mode, DM_DISPLAYORIENTATION )) continue; + if (devmode_get( found, DM_BITSPERPEL ) >= devmode_get( mode, DM_BITSPERPEL )) continue; + if (devmode_get( found, DM_PELSWIDTH ) >= devmode_get( mode, DM_PELSWIDTH )) continue; + if (devmode_get( found, DM_PELSHEIGHT ) >= devmode_get( mode, DM_PELSHEIGHT )) continue; + if (devmode_get( found, DM_DISPLAYFREQUENCY ) >= devmode_get( mode, DM_DISPLAYFREQUENCY )) continue; + found = mode; + } + + return *found; +} + static void add_modes( const DEVMODEW *current, UINT modes_count, const DEVMODEW *modes, void *param ) { struct device_manager_ctx *ctx = param; @@ -1675,6 +1708,23 @@ static void add_modes( const DEVMODEW *current, UINT modes_count, const DEVMODEW modes = current; modes_count = 1; } + else if (emulate_modelist) + { + physical = find_largest_mode( current, modes, modes_count ); + if ((virtual_modes = get_virtual_modes( current, &physical, &physical, &virtual_count ))) + { + modes_count = virtual_count; + modes = virtual_modes; + } + + /* HACK: Gamescope doesn't really changes the display mode, pretend it changed to what was requested */ + if (user_driver->pHasWindowManager( "steamcompmgr" ) && read_source_mode( source->key, ENUM_CURRENT_SETTINGS, &virtual )) + { + WARN( "Faking current mode to %s\n", debugstr_devmodew(&virtual) ); + current = &virtual; + detached = *current; + } + } physical = modes_count == 1 ? *modes : *current; if (ctx->is_primary) ctx->primary = *current; @@ -1686,7 +1736,7 @@ static void add_modes( const DEVMODEW *current, UINT modes_count, const DEVMODEW if (modes_count > 1 || current == &detached) { reg_delete_value( source->key, physicalW ); - virtual_modes = NULL; + if (!emulate_modelist) virtual_modes = NULL; } else { @@ -2277,7 +2327,6 @@ static BOOL lock_display_devices( BOOL force ) init_display_driver(); /* make sure to load the driver before anything else */ if (user_driver->pHasWindowManager( "steamcompmgr" )) emulate_modeset = FALSE; - if (user_driver->pHasWindowManager( "xwayland" )) emulate_modeset = FALSE; pthread_mutex_lock( &display_lock ); @@ -3864,7 +3913,7 @@ static LONG apply_display_settings( struct source *target, const DEVMODEW *devmo struct source *primary, *source; DEVMODEW *mode, *displays; HWND restorer_window; - LONG ret; + UINT ret; if (!lock_display_devices( FALSE )) return DISP_CHANGE_FAILED; if (!(displays = get_display_settings( target, devmode ))) @@ -3894,6 +3943,7 @@ static LONG apply_display_settings( struct source *target, const DEVMODEW *devmo /* use the default implementation in virtual desktop mode */ if (is_virtual_desktop() || emulate_modeset) ret = DISP_CHANGE_SUCCESSFUL; else ret = user_driver->pChangeDisplaySettings( displays, primary_name, hwnd, flags, lparam ); + if (ret != DISP_CHANGE_SUCCESSFUL) WARN( "Failed to change display settings, ret %d\n", ret ); if (ret == DISP_CHANGE_SUCCESSFUL) { @@ -5465,6 +5515,8 @@ void sysparams_init(void) grab_fullscreen = IS_OPTION_TRUE( buffer[0] ); if (!get_config_key( hkey, appkey, "Decorated", buffer, sizeof(buffer) )) decorated_mode = IS_OPTION_TRUE( buffer[0] ); + if (!get_config_key( hkey, appkey, "EmulateModelist", buffer, sizeof(buffer) )) + emulate_modelist = !IS_OPTION_TRUE( buffer[0] ); if (!get_config_key( hkey, appkey, "EmulateModeset", buffer, sizeof(buffer) )) emulate_modeset = !IS_OPTION_TRUE( buffer[0] ); From aa5aeecd3e7f7e5f70d2751ac46407e43a7b9bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 10 Dec 2024 09:39:19 +0100 Subject: [PATCH 0772/2542] mfsrcsnk: Implement IMFMediaShutdownNotify for the winedmo media source. --- dlls/mfsrcsnk/media_source.c | 75 ++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/dlls/mfsrcsnk/media_source.c b/dlls/mfsrcsnk/media_source.c index ce4d6952c25f..4187d64b69bc 100644 --- a/dlls/mfsrcsnk/media_source.c +++ b/dlls/mfsrcsnk/media_source.c @@ -228,6 +228,7 @@ struct media_source IMFGetService IMFGetService_iface; IMFRateSupport IMFRateSupport_iface; IMFRateControl IMFRateControl_iface; + IMFMediaShutdownNotify IMFMediaShutdownNotify_iface; IMFAsyncCallback async_create_iface; IMFAsyncCallback async_start_iface; IMFAsyncCallback async_stop_iface; @@ -236,6 +237,7 @@ struct media_source LONG refcount; CRITICAL_SECTION cs; + IMFAsyncResult *shutdown_result; IMFMediaEventQueue *queue; IMFByteStream *stream; WCHAR *url; @@ -1082,6 +1084,62 @@ static const IMFRateControlVtbl media_source_IMFRateControl_vtbl = media_source_IMFRateControl_GetRate, }; +static struct media_source *media_source_from_IMFMediaShutdownNotify(IMFMediaShutdownNotify *iface) +{ + return CONTAINING_RECORD(iface, struct media_source, IMFMediaShutdownNotify_iface); +} + +static HRESULT WINAPI media_source_IMFMediaShutdownNotify_QueryInterface(IMFMediaShutdownNotify *iface, REFIID riid, void **obj) +{ + struct media_source *source = media_source_from_IMFMediaShutdownNotify(iface); + return IMFMediaSource_QueryInterface(&source->IMFMediaSource_iface, riid, obj); +} + +static ULONG WINAPI media_source_IMFMediaShutdownNotify_AddRef(IMFMediaShutdownNotify *iface) +{ + struct media_source *source = media_source_from_IMFMediaShutdownNotify(iface); + return IMFMediaSource_AddRef(&source->IMFMediaSource_iface); +} + +static ULONG WINAPI media_source_IMFMediaShutdownNotify_Release(IMFMediaShutdownNotify *iface) +{ + struct media_source *source = media_source_from_IMFMediaShutdownNotify(iface); + return IMFMediaSource_Release(&source->IMFMediaSource_iface); +} + +static HRESULT WINAPI media_source_IMFMediaShutdownNotify_set_notification_callback(IMFMediaShutdownNotify *iface, + IMFAsyncCallback *callback, IUnknown *state) +{ + struct media_source *source = media_source_from_IMFMediaShutdownNotify(iface); + IMFAsyncResult *result = NULL; + HRESULT hr = S_OK; + + EnterCriticalSection(&source->cs); + + if (source->state == SOURCE_SHUTDOWN) + hr = MF_E_SHUTDOWN; + else if (callback && FAILED(hr = MFCreateAsyncResult(NULL, callback, state, &result))) + WARN("Failed to create result, hr %#lx\n", hr); + else + { + if (source->shutdown_result) + IMFAsyncResult_Release(source->shutdown_result); + source->shutdown_result = result; + } + + LeaveCriticalSection(&source->cs); + + return hr; +} + +static const IMFMediaShutdownNotifyVtbl media_source_IMFMediaShutdownNotify_vtbl = +{ + media_source_IMFMediaShutdownNotify_QueryInterface, + media_source_IMFMediaShutdownNotify_AddRef, + media_source_IMFMediaShutdownNotify_Release, + media_source_IMFMediaShutdownNotify_set_notification_callback, +}; + static HRESULT WINAPI media_source_QueryInterface(IMFMediaSource *iface, REFIID riid, void **out) { struct media_source *source = media_source_from_IMFMediaSource(iface); @@ -1104,6 +1162,13 @@ static HRESULT WINAPI media_source_QueryInterface(IMFMediaSource *iface, REFIID return S_OK; } + if (IsEqualIID(riid, &IID_IMFMediaShutdownNotify)) + { + IMFMediaShutdownNotify_AddRef(&source->IMFMediaShutdownNotify_iface); + *out = &source->IMFMediaShutdownNotify_iface; + return S_OK; + } + FIXME("Unsupported interface %s\n", debugstr_guid(riid)); *out = NULL; return E_NOINTERFACE; @@ -1132,6 +1197,8 @@ static ULONG WINAPI media_source_Release(IMFMediaSource *iface) free(source->stream_map); free(source->streams); + if (source->shutdown_result) + IMFAsyncResult_Release(source->shutdown_result); IMFMediaEventQueue_Release(source->queue); IMFByteStream_Release(source->stream); free(source->url); @@ -1341,6 +1408,13 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) IMFMediaStream_Release(&stream->IMFMediaStream_iface); } + if (source->shutdown_result) + { + MFPutWorkItemEx(MFASYNC_CALLBACK_QUEUE_STANDARD, source->shutdown_result); + IMFAsyncResult_Release(source->shutdown_result); + source->shutdown_result = NULL; + } + LeaveCriticalSection(&source->cs); return S_OK; @@ -1711,6 +1785,7 @@ static HRESULT media_source_create(const WCHAR *url, IMFByteStream *stream, IMFM source->IMFGetService_iface.lpVtbl = &media_source_IMFGetService_vtbl; source->IMFRateSupport_iface.lpVtbl = &media_source_IMFRateSupport_vtbl; source->IMFRateControl_iface.lpVtbl = &media_source_IMFRateControl_vtbl; + source->IMFMediaShutdownNotify_iface.lpVtbl = &media_source_IMFMediaShutdownNotify_vtbl; source->async_create_iface.lpVtbl = &media_source_async_create_vtbl; source->async_start_iface.lpVtbl = &media_source_async_start_vtbl; source->async_stop_iface.lpVtbl = &media_source_async_stop_vtbl; From 72b0f28ab3316c3f1d48f55356c968ddc3b92e7b Mon Sep 17 00:00:00 2001 From: Kai Krakow Date: Sun, 10 Oct 2021 20:48:24 +0200 Subject: [PATCH 0773/2542] winex11.drv: Bypass compositor in fullscreen mode. Bypass the compositor in fullscreen mode. This reduces stutter introduced by window updates in the background and also allows for maybe a few more FPS. To not change the visual appearance of the desktop for windowed games, this hack only enables itself when the game was switched to fullscreen mode, and returns to default WM setting when the game leaves fullscreen mode. Compositors tend to cause severe stutter if the game is GPU-bound. winex11.drv: Bypass compositor only when a window is full virtual screen. Bypass compositor only when a window is full virtual screen. Otherwise, it might cause flicking on other monitors. Signed-off-by: Zhiyi Zhang --- dlls/winex11.drv/window.c | 11 ++++++++++- dlls/winex11.drv/x11drv.h | 1 + dlls/winex11.drv/x11drv_main.c | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 9516a2ccaf2f..82478e79db49 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1229,7 +1229,7 @@ static void update_net_wm_fullscreen_monitors( struct x11drv_win_data *data ) static void window_set_net_wm_state( struct x11drv_win_data *data, UINT new_state ) { static const UINT fullscreen_mask = (1 << NET_WM_STATE_MAXIMIZED) | (1 << NET_WM_STATE_FULLSCREEN); - UINT i, count, old_state = data->pending_state.net_wm_state; + UINT i, count, old_state = data->pending_state.net_wm_state, net_wm_bypass_compositor = 0; new_state &= x11drv_thread_data()->net_wm_state_mask; data->desired_state.net_wm_state = new_state; @@ -1293,6 +1293,15 @@ static void window_set_net_wm_state( struct x11drv_win_data *data, UINT new_stat } } + if (new_state & (1 << NET_WM_STATE_FULLSCREEN)) + { + RECT virtual_screen = NtUserGetVirtualScreenRect( MDT_RAW_DPI ); + net_wm_bypass_compositor = EqualRect( &data->rects.visible, &virtual_screen ); + } + + XChangeProperty( data->display, data->whole_window, x11drv_atom(_NET_WM_BYPASS_COMPOSITOR), XA_CARDINAL, + 32, PropModeReplace, (unsigned char *)&net_wm_bypass_compositor, 1 ); + XFlush( data->display ); } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 86d782740b3b..1c9843f9993f 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -501,6 +501,7 @@ enum x11drv_atoms XATOM__NET_SYSTEM_TRAY_OPCODE, XATOM__NET_SYSTEM_TRAY_S0, XATOM__NET_SYSTEM_TRAY_VISUAL, + XATOM__NET_WM_BYPASS_COMPOSITOR, XATOM__NET_WM_FULLSCREEN_MONITORS, XATOM__NET_WM_ICON, XATOM__NET_WM_MOVERESIZE, diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index a9715cfc9fdb..750f8e9fad74 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -138,6 +138,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "_NET_SYSTEM_TRAY_OPCODE", "_NET_SYSTEM_TRAY_S0", "_NET_SYSTEM_TRAY_VISUAL", + "_NET_WM_BYPASS_COMPOSITOR", "_NET_WM_FULLSCREEN_MONITORS", "_NET_WM_ICON", "_NET_WM_MOVERESIZE", From 75d34e9f549ba3243f235fd403df283858be469c Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Tue, 4 Jul 2023 12:40:52 +0200 Subject: [PATCH 0774/2542] windows.media.speech: Adding a couple of synthesizer's options tests. Signed-off-by: Eric Pouech CW-Bug-Id: #20134 --- dlls/windows.media.speech/tests/speech.c | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index ea1487d379cd..ba1acb0aa62b 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -1024,16 +1024,54 @@ static void test_SpeechSynthesizer(void) if (hr == S_OK) { + ISpeechSynthesizerOptions2 *options2; ISpeechSynthesizerOptions3 *options3; + boolean bool_value; + DOUBLE double_value; + enum SpeechAppendedSilence silence_value; + enum SpeechPunctuationSilence punctuation_value; check_interface(options, &IID_IAgileObject, TRUE); + bool_value = 0xff; + hr = ISpeechSynthesizerOptions_get_IncludeSentenceBoundaryMetadata(options, &bool_value); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(! bool_value, "Got unepected option %u\n", bool_value); + bool_value = 0xff; + hr = ISpeechSynthesizerOptions_get_IncludeWordBoundaryMetadata(options, &bool_value); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(!bool_value, "Got unepected option %u\n", bool_value); + check_optional_interface(options, &IID_ISpeechSynthesizerOptions2, TRUE); /* Requires Win10 >= 1709 */ + hr = ISpeechSynthesizerOptions_QueryInterface(options, &IID_ISpeechSynthesizerOptions2, (void **)&options2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = ISpeechSynthesizerOptions2_get_AudioPitch(options2, &double_value); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(double_value == 1.0f, "Got unepected option %f\n", double_value); + + hr = ISpeechSynthesizerOptions2_get_AudioVolume(options2, &double_value); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(double_value == 1.0f, "Got unepected option %f\n", double_value); + + hr = ISpeechSynthesizerOptions2_get_SpeakingRate(options2, &double_value); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(double_value == 1.0f, "Got unepected option %f\n", double_value); + + ISpeechSynthesizerOptions2_Release(options2); hr = ISpeechSynthesizerOptions_QueryInterface(options, &IID_ISpeechSynthesizerOptions3, (void **)&options3); ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Got unexpected hr %#lx.\n", hr); /* Requires Win10 >= 1803 */ if (hr == S_OK) { + hr = ISpeechSynthesizerOptions3_get_AppendedSilence(options3, &silence_value); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(silence_value == SpeechAppendedSilence_Default, "Got unepected option %u\n", silence_value); + + hr = ISpeechSynthesizerOptions3_get_PunctuationSilence(options3, &punctuation_value); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(punctuation_value == SpeechPunctuationSilence_Default, "Got unepected option %u\n", punctuation_value); + ref = ISpeechSynthesizerOptions3_Release(options3); ok(ref == 2, "Got unexpected ref %lu.\n", ref); } From 7daaf4bb99cdc15cfbe43b26d671390b592b211d Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Tue, 4 Jul 2023 12:40:52 +0200 Subject: [PATCH 0775/2542] windows.media.speech: Add basic implementation on synthesizer options. Signed-off-by: Eric Pouech CW-Bug-Id: #20134 --- dlls/windows.media.speech/synthesizer.c | 326 ++++++++++++++++++++++- dlls/windows.media.speech/tests/speech.c | 2 +- 2 files changed, 325 insertions(+), 3 deletions(-) diff --git a/dlls/windows.media.speech/synthesizer.c b/dlls/windows.media.speech/synthesizer.c index 39d14b84ab78..95dfe3150bba 100644 --- a/dlls/windows.media.speech/synthesizer.c +++ b/dlls/windows.media.speech/synthesizer.c @@ -280,6 +280,309 @@ static HRESULT synthesis_stream_create( ISpeechSynthesisStream **out ) return hr; } +/* + * + * SpeechSynthesizerOptions runtimeclass + * + */ +struct synthesizer_options +{ + ISpeechSynthesizerOptions ISpeechSynthesizerOptions_iface; + ISpeechSynthesizerOptions2 ISpeechSynthesizerOptions2_iface; + ISpeechSynthesizerOptions3 ISpeechSynthesizerOptions3_iface; + LONG ref; + + /* options */ + boolean include_word_boundary; + boolean include_sentence_boundary; + + /* options 2 */ + double audio_volume; + double speaking_rate; + double audio_pitch; + + /* options 3 */ + enum SpeechAppendedSilence appended_silence; + enum SpeechPunctuationSilence punctuation_silence; +}; + +static inline struct synthesizer_options *impl_from_ISpeechSynthesizerOptions( ISpeechSynthesizerOptions *iface ) +{ + return CONTAINING_RECORD(iface, struct synthesizer_options, ISpeechSynthesizerOptions_iface); +} + +static HRESULT WINAPI synthesizer_options_QueryInterface( ISpeechSynthesizerOptions *iface, REFIID iid, void **out) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions(iface); + + TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IUnknown) || + IsEqualGUID(iid, &IID_IInspectable) || + IsEqualGUID(iid, &IID_IAgileObject) || + IsEqualGUID(iid, &IID_ISpeechSynthesizerOptions)) + { + IInspectable_AddRef((*out = &impl->ISpeechSynthesizerOptions_iface)); + return S_OK; + } + + if (IsEqualGUID(iid, &IID_ISpeechSynthesizerOptions2)) + { + IInspectable_AddRef((*out = &impl->ISpeechSynthesizerOptions2_iface)); + return S_OK; + } + + if (IsEqualGUID(iid, &IID_ISpeechSynthesizerOptions3)) + { + IInspectable_AddRef((*out = &impl->ISpeechSynthesizerOptions3_iface)); + return S_OK; + } + + FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI synthesizer_options_AddRef( ISpeechSynthesizerOptions *iface ) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions(iface); + ULONG ref = InterlockedIncrement(&impl->ref); + + TRACE("iface %p, ref %lu.\n", iface, ref); + return ref; +} + +static ULONG WINAPI synthesizer_options_Release( ISpeechSynthesizerOptions *iface ) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions(iface); + ULONG ref = InterlockedDecrement(&impl->ref); + + TRACE("iface %p, ref %lu.\n", iface, ref); + if (ref == 0) + free(impl); + return ref; +} + +static HRESULT WINAPI synthesizer_options_GetIids( ISpeechSynthesizerOptions *iface, ULONG *iid_count, IID **iids ) +{ + FIXME("iface %p, iid_count %p, iids %p stub.\n", iface, iid_count, iids); + return E_NOTIMPL; +} + +static HRESULT WINAPI synthesizer_options_GetRuntimeClassName( ISpeechSynthesizerOptions *iface, HSTRING *class_name ) +{ + FIXME("iface %p, class_name %p stub.\n", iface, class_name); + return E_NOTIMPL; +} + +static HRESULT WINAPI synthesizer_options_GetTrustLevel( ISpeechSynthesizerOptions *iface, TrustLevel *trust_level ) +{ + FIXME("iface %p, trust_level %p stub.\n", iface, trust_level); + return E_NOTIMPL; +} + +static HRESULT WINAPI synthesizer_options_get_IncludeWordBoundaryMetadata( ISpeechSynthesizerOptions *iface, boolean *value ) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions(iface); + TRACE("iface %p, value %p semi-stub.\n", iface, value); + + *value = impl->include_word_boundary; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options_put_IncludeWordBoundaryMetadata( ISpeechSynthesizerOptions *iface, boolean value ) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions(iface); + TRACE("iface %p, value %s semi-stub.\n", iface, value ? "true" : "false"); + + impl->include_word_boundary = value; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options_get_IncludeSentenceBoundaryMetadata( ISpeechSynthesizerOptions *iface, boolean *value ) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions(iface); + TRACE("iface %p, value %p stub.\n", iface, value); + + *value = impl->include_sentence_boundary; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options_put_IncludeSentenceBoundaryMetadata( ISpeechSynthesizerOptions *iface, boolean value ) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions(iface); + TRACE("iface %p, value %s stub.\n", iface, value ? "true" : "false"); + + impl->include_sentence_boundary = value; + return S_OK; +} + +static const struct ISpeechSynthesizerOptionsVtbl synthesizer_options_vtbl = +{ + /*** IUnknown methods ***/ + synthesizer_options_QueryInterface, + synthesizer_options_AddRef, + synthesizer_options_Release, + /*** IInspectable methods ***/ + synthesizer_options_GetIids, + synthesizer_options_GetRuntimeClassName, + synthesizer_options_GetTrustLevel, + /*** ISpeechSynthesizerOptions methods ***/ + synthesizer_options_get_IncludeWordBoundaryMetadata, + synthesizer_options_put_IncludeWordBoundaryMetadata, + synthesizer_options_get_IncludeSentenceBoundaryMetadata, + synthesizer_options_put_IncludeSentenceBoundaryMetadata, +}; + +DEFINE_IINSPECTABLE(synthesizer_options2, ISpeechSynthesizerOptions2, struct synthesizer_options, ISpeechSynthesizerOptions_iface) + +static HRESULT WINAPI synthesizer_options2_get_AudioVolume( ISpeechSynthesizerOptions2 *iface, DOUBLE *value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions2(iface); + + TRACE("iface %p value %p semi-stub!\n", iface, value); + *value = impl->audio_volume; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options2_put_AudioVolume( ISpeechSynthesizerOptions2 *iface, DOUBLE value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions2(iface); + + TRACE("iface %p value %g semi-stub!\n", iface, value); + impl->audio_volume = value; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options2_get_SpeakingRate( ISpeechSynthesizerOptions2 *iface, DOUBLE *value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions2(iface); + + TRACE("iface %p value %p semi-stub!\n", iface, value); + *value = impl->speaking_rate; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options2_put_SpeakingRate( ISpeechSynthesizerOptions2 *iface, DOUBLE value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions2(iface); + + TRACE("iface %p value %g semi-stub!\n", iface, value); + impl->speaking_rate = value; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options2_get_AudioPitch( ISpeechSynthesizerOptions2 *iface, DOUBLE *value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions2(iface); + + TRACE("iface %p value %p semi-stub!\n", iface, value); + *value = impl->audio_pitch; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options2_put_AudioPitch( ISpeechSynthesizerOptions2 *iface, DOUBLE value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions2(iface); + + TRACE("iface %p value %g semi-stub!\n", iface, value); + impl->audio_pitch = value; + return S_OK; +} + +static const struct ISpeechSynthesizerOptions2Vtbl synthesizer_options2_vtbl = +{ + /*** IUnknown methods ***/ + synthesizer_options2_QueryInterface, + synthesizer_options2_AddRef, + synthesizer_options2_Release, + /*** IInspectable methods ***/ + synthesizer_options2_GetIids, + synthesizer_options2_GetRuntimeClassName, + synthesizer_options2_GetTrustLevel, + /*** ISpeechSynthesizerOptions methods ***/ + synthesizer_options2_get_AudioVolume, + synthesizer_options2_put_AudioVolume, + synthesizer_options2_get_SpeakingRate, + synthesizer_options2_put_SpeakingRate, + synthesizer_options2_get_AudioPitch, + synthesizer_options2_put_AudioPitch, +}; + +DEFINE_IINSPECTABLE(synthesizer_options3, ISpeechSynthesizerOptions3, struct synthesizer_options, ISpeechSynthesizerOptions_iface) + +static HRESULT WINAPI synthesizer_options3_get_AppendedSilence( ISpeechSynthesizerOptions3 *iface, enum SpeechAppendedSilence *value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions3(iface); + + TRACE("iface %p value %p semi-stub!\n", iface, value); + *value = impl->appended_silence; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options3_put_AppendedSilence( ISpeechSynthesizerOptions3 *iface, enum SpeechAppendedSilence value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions3(iface); + + TRACE("iface %p value %u semi-stub!\n", iface, value); + impl->appended_silence = value; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options3_get_PunctuationSilence( ISpeechSynthesizerOptions3 *iface, enum SpeechPunctuationSilence *value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions3(iface); + + TRACE("iface %p value %p semi-stub!\n", iface, value); + *value = impl->punctuation_silence; + return S_OK; +} + +static HRESULT WINAPI synthesizer_options3_put_PunctuationSilence( ISpeechSynthesizerOptions3 *iface, enum SpeechPunctuationSilence value) +{ + struct synthesizer_options *impl = impl_from_ISpeechSynthesizerOptions3(iface); + + TRACE("iface %p value %u semi-stub!\n", iface, value); + impl->punctuation_silence = value; + return S_OK; +} + +static const struct ISpeechSynthesizerOptions3Vtbl synthesizer_options3_vtbl = +{ + /*** IUnknown methods ***/ + synthesizer_options3_QueryInterface, + synthesizer_options3_AddRef, + synthesizer_options3_Release, + /*** IInspectable methods ***/ + synthesizer_options3_GetIids, + synthesizer_options3_GetRuntimeClassName, + synthesizer_options3_GetTrustLevel, + /*** ISpeechSynthesizerOptions methods ***/ + synthesizer_options3_get_AppendedSilence, + synthesizer_options3_put_AppendedSilence, + synthesizer_options3_get_PunctuationSilence, + synthesizer_options3_put_PunctuationSilence, +}; + +static HRESULT synthesizer_options_allocate( struct synthesizer_options **out ) +{ + struct synthesizer_options *options; + + if (!(options = calloc(1, sizeof(*options)))) return E_OUTOFMEMORY; + + options->ISpeechSynthesizerOptions_iface.lpVtbl = &synthesizer_options_vtbl; + options->ISpeechSynthesizerOptions2_iface.lpVtbl = &synthesizer_options2_vtbl; + options->ISpeechSynthesizerOptions3_iface.lpVtbl = &synthesizer_options3_vtbl; + /* all other values default to 0 or false */ + options->audio_pitch = 1.0; + options->audio_volume = 1.0; + options->speaking_rate = 1.0; + options->ref = 1; + *out = options; + + return S_OK; +} + /* * * SpeechSynthesizer runtimeclass @@ -292,6 +595,8 @@ struct synthesizer ISpeechSynthesizer2 ISpeechSynthesizer2_iface; IClosable IClosable_iface; LONG ref; + + struct synthesizer_options *options; }; /* @@ -352,7 +657,11 @@ static ULONG WINAPI synthesizer_Release( ISpeechSynthesizer *iface ) TRACE("iface %p, ref %lu.\n", iface, ref); if (!ref) + { + if (impl->options) + ISpeechSynthesizerOptions_Release(&impl->options->ISpeechSynthesizerOptions_iface); free(impl); + } return ref; } @@ -440,8 +749,21 @@ DEFINE_IINSPECTABLE(synthesizer2, ISpeechSynthesizer2, struct synthesizer, ISpee static HRESULT WINAPI synthesizer2_get_Options( ISpeechSynthesizer2 *iface, ISpeechSynthesizerOptions **value ) { - FIXME("iface %p, value %p stub.\n", iface, value); - return E_NOTIMPL; + struct synthesizer *impl = impl_from_ISpeechSynthesizer2(iface); + + WARN("iface %p, value %p semi-stub.\n", iface, value); + if (!impl->options) + { + struct synthesizer_options *options; + HRESULT hr = synthesizer_options_allocate(&options); + if (FAILED(hr)) return hr; + + if (InterlockedCompareExchangePointer((void **)&impl->options, options, NULL) != NULL) + /* another thread beat us */ + ISpeechSynthesizerOptions_AddRef(&options->ISpeechSynthesizerOptions_iface); + } + ISpeechSynthesizerOptions_AddRef(*value = &impl->options->ISpeechSynthesizerOptions_iface); + return S_OK; } static const struct ISpeechSynthesizer2Vtbl synthesizer2_vtbl = diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index ba1acb0aa62b..08d4cf02b03b 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -1020,7 +1020,7 @@ static void test_SpeechSynthesizer(void) ISpeechSynthesizerOptions *options; hr = ISpeechSynthesizer2_get_Options(synthesizer2, &options); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); if (hr == S_OK) { From 74e211a654c824899ae7dab31c8f3ba8d0fc8e5b Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Tue, 4 Jul 2023 12:40:52 +0200 Subject: [PATCH 0776/2542] windows.media.speech: Add more tests about IVoiceInformation. Signed-off-by: Eric Pouech CW-Bug-Id: #20134 --- dlls/windows.media.speech/tests/speech.c | 73 +++++++++++++++++++++++- 1 file changed, 70 insertions(+), 3 deletions(-) diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 08d4cf02b03b..20e4bfbb4728 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -674,6 +674,66 @@ static HRESULT WINAPI iterable_hstring_create_static( struct iterable_hstring *i return S_OK; } +#define check_comparable_presence(a, b) _check_comparable_presence( __LINE__, (a), (b)) +static void _check_comparable_presence( unsigned line, IVectorView_VoiceInformation *voices, IVoiceInformation *voice) +{ + HSTRING in_display, in_id, in_language; + HSTRING vc_display, vc_id, vc_language; + IVoiceInformation *vc_voice; + enum VoiceGender in_gender, vc_gender; + UINT32 size, idx, found_count = 0; + HRESULT hr; + INT32 cmp; + + hr = IVoiceInformation_get_DisplayName(voice, &in_display); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IVoiceInformation_get_Id(voice, &in_id); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IVoiceInformation_get_Language(voice, &in_language); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IVoiceInformation_get_Gender(voice, &in_gender); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IVectorView_VoiceInformation_get_Size(voices, &size); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + for (idx = 0; SUCCEEDED(hr = IVectorView_VoiceInformation_GetAt(voices, idx, &vc_voice)); idx++) + { + hr = IVoiceInformation_get_DisplayName(vc_voice, &vc_display); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IVoiceInformation_get_Id(vc_voice, &vc_id); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IVoiceInformation_get_Language(vc_voice, &vc_language); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IVoiceInformation_get_Gender(vc_voice, &vc_gender); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + trace("%u] %s/%s/%s/%u\n", + idx - 1, debugstr_hstring(vc_display), debugstr_hstring(vc_id), debugstr_hstring(vc_language), vc_gender); + + if (SUCCEEDED(WindowsCompareStringOrdinal(in_display, vc_display, &cmp)) && !cmp && + SUCCEEDED(WindowsCompareStringOrdinal(in_id, vc_id, &cmp)) && !cmp && + SUCCEEDED(WindowsCompareStringOrdinal(in_language, vc_language, &cmp)) && !cmp && + in_gender == vc_gender) + { + found_count++; + } + WindowsDeleteString(vc_display); + WindowsDeleteString(vc_id); + WindowsDeleteString(vc_language); + IVoiceInformation_Release(vc_voice); + } + ok(hr == E_BOUNDS, "Got unexpected hr %#lx.\n", hr); + ok(idx != 0, "Vector view shouldn't be empty!\n"); + ok(idx == size, "Incoherent index/size %u/%u!\n", idx, size); + + ok_(__FILE__, line)(found_count == 1, "Found several (%u) instances of %s/%s/%s/%u\n", + found_count, + debugstr_hstring(in_display), debugstr_hstring(in_id), debugstr_hstring(in_language), in_gender); + + WindowsDeleteString(in_display); + WindowsDeleteString(in_id); + WindowsDeleteString(in_language); +} + static void test_ActivationFactory(void) { static const WCHAR *synthesizer_name = L"Windows.Media.SpeechSynthesis.SpeechSynthesizer"; @@ -798,7 +858,8 @@ static void test_SpeechSynthesizer(void) HMODULE hdll; HSTRING str, str2; HRESULT hr; - UINT32 size; + UINT32 size, idx; + BOOLEAN found; ULONG ref; hr = RoInitialize(RO_INIT_MULTITHREADED); @@ -892,13 +953,19 @@ static void test_SpeechSynthesizer(void) ok(hr == S_OK, "IVectorView_VoiceInformation_GetMany failed, hr %#lx\n", hr); ok(size == 0, "IVectorView_VoiceInformation_GetMany returned count %u\n", size); - IVectorView_VoiceInformation_Release(voices); - hr = IInstalledVoicesStatic_get_DefaultVoice(voices_static, &voice); todo_wine ok(hr == S_OK, "IInstalledVoicesStatic_get_DefaultVoice failed, hr %#lx\n", hr); if (hr == S_OK) { + /* check that VoiceInformation in static vector voice are not shared when exposed to user */ + idx = size; + hr = IVectorView_VoiceInformation_IndexOf(voices, voice, &idx, &found); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(!found, "Shouldn't find default element\n"); + + check_comparable_presence(voices, voice); + IVoiceInformation_get_Description(voice, &str2); trace("SpeechSynthesizer default voice %s.\n", debugstr_hstring(str2)); From eed95f35bd8112c905d3014c181a8ac4b01c06d2 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Tue, 4 Jul 2023 12:40:52 +0200 Subject: [PATCH 0777/2542] windows.media.speech: Add basic implementation of IVoiceInformation. Signed-off-by: Eric Pouech CW-Bug-Id: #20134 --- dlls/windows.media.speech/synthesizer.c | 181 ++++++++++++++++++++++++ 1 file changed, 181 insertions(+) diff --git a/dlls/windows.media.speech/synthesizer.c b/dlls/windows.media.speech/synthesizer.c index 95dfe3150bba..f49e06dbd4ce 100644 --- a/dlls/windows.media.speech/synthesizer.c +++ b/dlls/windows.media.speech/synthesizer.c @@ -23,6 +23,187 @@ WINE_DEFAULT_DEBUG_CHANNEL(speech); +struct voice_information +{ + IVoiceInformation IVoiceInformation_iface; + LONG ref; + + HSTRING id; + HSTRING display_name; + HSTRING language; + HSTRING description; + VoiceGender gender; +}; + +static inline struct voice_information *impl_from_IVoiceInformation( IVoiceInformation *iface ) +{ + return CONTAINING_RECORD(iface, struct voice_information, IVoiceInformation_iface); +} + +static void voice_information_delete( struct voice_information *voice_info ) +{ + WindowsDeleteString(voice_info->id); + WindowsDeleteString(voice_info->display_name); + WindowsDeleteString(voice_info->language); + WindowsDeleteString(voice_info->description); + free(voice_info); +} + +static HRESULT WINAPI voice_information_QueryInterface( IVoiceInformation *iface, REFIID iid, void **ppvObject) +{ + struct voice_information *impl = impl_from_IVoiceInformation( iface ); + + TRACE("iface %p, riid %s, ppv %p\n", iface, wine_dbgstr_guid(iid), ppvObject); + + if (IsEqualGUID(iid, &IID_IUnknown) || + IsEqualGUID(iid, &IID_IInspectable) || + IsEqualGUID(iid, &IID_IVoiceInformation)) + { + IInspectable_AddRef((*ppvObject = &impl->IVoiceInformation_iface)); + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *ppvObject = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI voice_information_AddRef( IVoiceInformation *iface ) +{ + struct voice_information *impl = impl_from_IVoiceInformation(iface); + ULONG ref = InterlockedIncrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); + return ref; +} + +static ULONG WINAPI voice_information_Release( IVoiceInformation *iface ) +{ + struct voice_information *impl = impl_from_IVoiceInformation(iface); + ULONG ref = InterlockedDecrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); + /* all voices are (for now) statically allocated in all_voices vector. so don't free them */ + return ref; +} + +static HRESULT WINAPI voice_information_GetIids( IVoiceInformation *iface, ULONG *iid_count, IID **iids ) +{ + FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids); + return E_NOTIMPL; +} + +static HRESULT WINAPI voice_information_GetRuntimeClassName( IVoiceInformation *iface, HSTRING *class_name ) +{ + FIXME("iface %p, class_name %p stub!\n", iface, class_name); + return E_NOTIMPL; +} + +static HRESULT WINAPI voice_information_GetTrustLevel( IVoiceInformation *iface, TrustLevel *trust_level ) +{ + FIXME("iface %p, trust_level %p stub!\n", iface, trust_level); + return E_NOTIMPL; +} + +static HRESULT WINAPI voice_information_get_DisplayName( IVoiceInformation *iface, HSTRING *value ) +{ + struct voice_information *impl = impl_from_IVoiceInformation(iface); + + TRACE("iface %p, value %p!n", iface, value); + return WindowsDuplicateString(impl->display_name, value); +} + +static HRESULT WINAPI voice_information_get_Id( IVoiceInformation *iface, HSTRING *value ) +{ + struct voice_information *impl = impl_from_IVoiceInformation(iface); + + TRACE("iface %p, value %p\n", iface, value); + return WindowsDuplicateString(impl->id, value); +} + +static HRESULT WINAPI voice_information_get_Language( IVoiceInformation *iface, HSTRING *value ) +{ + struct voice_information *impl = impl_from_IVoiceInformation(iface); + + TRACE("iface %p, value %p\n", iface, value); + return WindowsDuplicateString(impl->language, value); +} + +static HRESULT WINAPI voice_information_get_Description( IVoiceInformation *iface, HSTRING *value ) +{ + struct voice_information *impl = impl_from_IVoiceInformation(iface); + + TRACE("iface %p, value %p\n", iface, value); + return WindowsDuplicateString(impl->description, value); +} + +static HRESULT WINAPI voice_information_get_Gender( IVoiceInformation *iface, VoiceGender *value ) +{ + struct voice_information *impl = impl_from_IVoiceInformation(iface); + + TRACE("iface %p, value %p\n", iface, value); + *value = impl->gender; + return S_OK; +} + +static const struct IVoiceInformationVtbl voice_information_vtbl = +{ + /*** IUnknown methods ***/ + voice_information_QueryInterface, + voice_information_AddRef, + voice_information_Release, + + /*** IInspectable methods ***/ + voice_information_GetIids, + voice_information_GetRuntimeClassName, + voice_information_GetTrustLevel, + + /*** IVoiceInformation methods ***/ + voice_information_get_DisplayName, + voice_information_get_Id, + voice_information_get_Language, + voice_information_get_Description, + voice_information_get_Gender, +}; + +HRESULT voice_information_allocate(const WCHAR *display_name, const WCHAR *id, const WCHAR *locale, + VoiceGender gender, IVoiceInformation **pvoice) +{ + struct voice_information *voice_info; + WCHAR *description; + HRESULT hr; + size_t len, langlen; + + voice_info = calloc(1, sizeof(*voice_info)); + if (!voice_info) return E_OUTOFMEMORY; + + len = wcslen(display_name) + 3; + langlen = GetLocaleInfoEx(locale, LOCALE_SLOCALIZEDDISPLAYNAME, NULL, 0); + description = malloc((len + langlen) * sizeof(WCHAR)); + wcscpy(description, display_name); + wcscat(description, L" - "); + GetLocaleInfoEx(locale, LOCALE_SLOCALIZEDDISPLAYNAME, description + len, langlen); + + hr = WindowsCreateString(display_name, wcslen(display_name), &voice_info->display_name); + if (SUCCEEDED(hr)) + hr = WindowsCreateString(id, wcslen(id), &voice_info->id); + if (SUCCEEDED(hr)) + hr = WindowsCreateString(locale, wcslen(locale), &voice_info->language); + if (SUCCEEDED(hr)) + hr = WindowsCreateString(description, len + langlen - 1, &voice_info->description); + if (SUCCEEDED(hr)) + { + voice_info->gender = gender; + voice_info->IVoiceInformation_iface.lpVtbl = &voice_information_vtbl; + + *pvoice = &voice_info->IVoiceInformation_iface; + } + else + { + voice_information_delete(voice_info); + } + free(description); + return hr; +} + /* * * IVectorView_VoiceInformation From 54e0c41e8e65d9bc6e79097ca4c2051aa18c677e Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Tue, 4 Jul 2023 12:40:52 +0200 Subject: [PATCH 0778/2542] windows.media.speech: Finish implement the voice information view. Signed-off-by: Eric Pouech CW-Bug-Id: #20134 --- dlls/windows.media.speech/private.h | 10 +++ dlls/windows.media.speech/synthesizer.c | 95 ++++++++++++++++++++---- dlls/windows.media.speech/tests/speech.c | 2 +- 3 files changed, 92 insertions(+), 15 deletions(-) diff --git a/dlls/windows.media.speech/private.h b/dlls/windows.media.speech/private.h index e80d73ec1fb8..d03fe0e773ed 100644 --- a/dlls/windows.media.speech/private.h +++ b/dlls/windows.media.speech/private.h @@ -126,4 +126,14 @@ HRESULT vector_inspectable_create( const struct vector_iids *iids, IVector_IInsp #define DEFINE_IINSPECTABLE_OUTER( pfx, iface_type, impl_type, outer_iface ) \ DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from_##iface_type, iface_type##_iface, impl->outer_iface ) +struct synth_provider +{ + struct IVoiceInformation **voices; + unsigned num_voices; + void (*dispose)(struct synth_provider *provider); +}; + +HRESULT voice_information_allocate(const WCHAR *display_name, const WCHAR *id, const WCHAR *locale, + VoiceGender gender, IVoiceInformation **pvoice); + #endif diff --git a/dlls/windows.media.speech/synthesizer.c b/dlls/windows.media.speech/synthesizer.c index f49e06dbd4ce..02e3e76e183e 100644 --- a/dlls/windows.media.speech/synthesizer.c +++ b/dlls/windows.media.speech/synthesizer.c @@ -214,6 +214,8 @@ struct voice_information_vector { IVectorView_VoiceInformation IVectorView_VoiceInformation_iface; LONG ref; + + struct synth_provider provider; }; static inline struct voice_information_vector *impl_from_IVectorView_VoiceInformation( IVectorView_VoiceInformation *iface ) @@ -225,7 +227,7 @@ static HRESULT WINAPI vector_view_voice_information_QueryInterface( IVectorView_ { struct voice_information_vector *impl = impl_from_IVectorView_VoiceInformation(iface); - TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out); + TRACE("iface %p, iid %s, out %p\n", iface, debugstr_guid(iid), out); if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IInspectable) || @@ -276,23 +278,39 @@ static HRESULT WINAPI vector_view_voice_information_GetTrustLevel( IVectorView_V static HRESULT WINAPI vector_view_voice_information_GetAt( IVectorView_VoiceInformation *iface, UINT32 index, IVoiceInformation **value ) { - FIXME("iface %p, index %#x, value %p stub!\n", iface, index, value); - *value = NULL; - return E_BOUNDS; + struct voice_information_vector *impl = impl_from_IVectorView_VoiceInformation(iface); + TRACE("iface %p, index %#x, value %p\n", iface, index, value); + if (index >= impl->provider.num_voices) + { + *value = NULL; + return E_BOUNDS; + } + IVoiceInformation_AddRef( *value = impl->provider.voices[index] ); + return S_OK; } static HRESULT WINAPI vector_view_voice_information_get_Size( IVectorView_VoiceInformation *iface, UINT32 *value ) { - FIXME("iface %p, value %p stub!\n", iface, value); - *value = 0; + struct voice_information_vector *impl = impl_from_IVectorView_VoiceInformation(iface); + TRACE("iface %p, value %p\n", iface, value); + *value = impl->provider.num_voices; return S_OK; } static HRESULT WINAPI vector_view_voice_information_IndexOf( IVectorView_VoiceInformation *iface, IVoiceInformation *element, UINT32 *index, BOOLEAN *found ) { - FIXME("iface %p, element %p, index %p, found %p stub!\n", iface, element, index, found); - *index = 0; + struct voice_information_vector *impl = impl_from_IVectorView_VoiceInformation(iface); + int i; + + TRACE("iface %p, element %p, index %p, found %p\n", iface, element, index, found); + for (i = 0; i < impl->provider.num_voices; i++) + if (element == impl->provider.voices[i]) + { + *index = i; + *found = TRUE; + return S_OK; + } *found = FALSE; return S_OK; } @@ -300,8 +318,18 @@ static HRESULT WINAPI vector_view_voice_information_IndexOf( IVectorView_VoiceIn static HRESULT WINAPI vector_view_voice_information_GetMany( IVectorView_VoiceInformation *iface, UINT32 start_index, UINT32 items_size, IVoiceInformation **items, UINT *value ) { - FIXME("iface %p, start_index %#x, items %p, value %p stub!\n", iface, start_index, items, value); - *value = 0; + struct voice_information_vector *impl = impl_from_IVectorView_VoiceInformation(iface); + int i; + + TRACE("iface %p, start_index %#x, items %p, value %p\n", iface, start_index, items, value); + if (start_index >= impl->provider.num_voices) + { + *value = 0; + return S_OK; + } + *value = min(impl->provider.num_voices - start_index, items_size); + for (i = 0; i < *value; i++) + IVoiceInformation_AddRef(items[i] = impl->provider.voices[start_index + i]); return S_OK; } @@ -324,7 +352,8 @@ static const struct IVectorView_VoiceInformationVtbl vector_view_voice_informati static struct voice_information_vector all_voices = { {&vector_view_voice_information_vtbl}, - 0 + 0, + {}, }; /* @@ -1107,6 +1136,26 @@ static const struct IActivationFactoryVtbl factory_vtbl = factory_ActivateInstance, }; +static HRESULT dummy_provider_init(struct synth_provider *provider) +{ + HRESULT hr; + WCHAR locale[LOCALE_NAME_MAX_LENGTH]; + + if (GetUserDefaultLocaleName(locale, ARRAY_SIZE(locale)) > ARRAY_SIZE(locale)) + return E_OUTOFMEMORY; + + provider->voices = calloc(1, sizeof(all_voices.provider.voices[0])); + if (!provider->voices) return E_OUTOFMEMORY; + hr = voice_information_allocate(L"Dummy voice", L"--noid--", locale, VoiceGender_Male, &provider->voices[0]); + if (FAILED(hr)) + { + free(provider->voices); + } + else + provider->num_voices = 1; + return hr; +} + /* * * IInstalledVoicesStatic for SpeechSynthesizer runtimeclass @@ -1115,12 +1164,30 @@ static const struct IActivationFactoryVtbl factory_vtbl = DEFINE_IINSPECTABLE(installed_voices_static, IInstalledVoicesStatic, struct synthesizer_statics, IActivationFactory_iface) +static CRITICAL_SECTION allvoices_cs; +static CRITICAL_SECTION_DEBUG allvoices_critsect_debug = +{ + 0, 0, &allvoices_cs, + { &allvoices_critsect_debug.ProcessLocksList, &allvoices_critsect_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": allvoices_cs") } +}; +static CRITICAL_SECTION allvoices_cs = { &allvoices_critsect_debug, -1, 0, 0, 0, 0 }; + static HRESULT WINAPI installed_voices_static_get_AllVoices( IInstalledVoicesStatic *iface, IVectorView_VoiceInformation **value ) { + HRESULT hr; + TRACE("iface %p, value %p.\n", iface, value); - *value = &all_voices.IVectorView_VoiceInformation_iface; - IVectorView_VoiceInformation_AddRef(*value); - return S_OK; + + EnterCriticalSection(&allvoices_cs); + if (all_voices.provider.num_voices == 0) + hr = dummy_provider_init(&all_voices.provider); + else + hr = S_OK; + if (SUCCEEDED(hr)) + IVectorView_VoiceInformation_AddRef(*value = &all_voices.IVectorView_VoiceInformation_iface); + LeaveCriticalSection(&allvoices_cs); + return hr; } static HRESULT WINAPI installed_voices_static_get_DefaultVoice( IInstalledVoicesStatic *iface, IVoiceInformation **value ) diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 20e4bfbb4728..3dda92c632f5 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -942,7 +942,7 @@ static void test_SpeechSynthesizer(void) size = 0xdeadbeef; hr = IVectorView_VoiceInformation_get_Size(voices, &size); ok(hr == S_OK, "IVectorView_VoiceInformation_get_Size voices failed, hr %#lx\n", hr); - todo_wine ok(size != 0 && size != 0xdeadbeef, "IVectorView_VoiceInformation_get_Size returned %u\n", size); + ok(size != 0 && size != 0xdeadbeef, "IVectorView_VoiceInformation_get_Size returned %u\n", size); voice = (IVoiceInformation *)0xdeadbeef; hr = IVectorView_VoiceInformation_GetAt(voices, size, &voice); From 4925ac9aa2714a5e3ea5453385962f7ef777c9d1 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Tue, 4 Jul 2023 12:40:52 +0200 Subject: [PATCH 0779/2542] windows.media.speech: Add more tests about voice selection. Signed-off-by: Eric Pouech CW-Bug-Id: #20134 --- dlls/windows.media.speech/tests/speech.c | 34 +++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 3dda92c632f5..ffc63e751c7c 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -856,7 +856,7 @@ static void test_SpeechSynthesizer(void) IClosable *closable; struct async_inspectable_handler async_inspectable_handler; HMODULE hdll; - HSTRING str, str2; + HSTRING str, str2, default_voice_id; HRESULT hr; UINT32 size, idx; BOOLEAN found; @@ -966,13 +966,18 @@ static void test_SpeechSynthesizer(void) check_comparable_presence(voices, voice); - IVoiceInformation_get_Description(voice, &str2); + hr = IVoiceInformation_get_Description(voice, &str2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); trace("SpeechSynthesizer default voice %s.\n", debugstr_hstring(str2)); - WindowsDeleteString(str2); + + hr = IVoiceInformation_get_Id(voice, &default_voice_id); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ref = IVoiceInformation_Release(voice); ok(ref == 0, "Got unexpected ref %lu.\n", ref); } + else default_voice_id = NULL; IInstalledVoicesStatic_Release(voices_static); IAgileObject_Release(agile_object); @@ -989,6 +994,29 @@ static void test_SpeechSynthesizer(void) hr = IInspectable_QueryInterface(inspectable, &IID_ISpeechSynthesizer, (void **)&synthesizer); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ISpeechSynthesizer_get_Voice(synthesizer, &voice); + todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + if (default_voice_id) + { + if (hr == S_OK) + { + INT32 cmp; + IVoiceInformation_get_Id(voice, &str); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = WindowsCompareStringOrdinal(str, default_voice_id, &cmp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = WindowsDeleteString(str); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + IVoiceInformation_Release(voice); + } + + hr = WindowsDeleteString(default_voice_id); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + } + /* Test SynthesizeTextToStreamAsync */ hr = WindowsCreateString(simple_synth_text, wcslen(simple_synth_text), &str); ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr); From 21b80f6844604b86b96c090c96a42e482ed7dc8f Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Tue, 4 Jul 2023 12:40:52 +0200 Subject: [PATCH 0780/2542] windows.media.speech: Implement default voice. Signed-off-by: Eric Pouech CW-Bug-Id: #20134 --- dlls/windows.media.speech/synthesizer.c | 50 +++++++++++++++++-- dlls/windows.media.speech/tests/speech.c | 61 +++++++++++------------- 2 files changed, 73 insertions(+), 38 deletions(-) diff --git a/dlls/windows.media.speech/synthesizer.c b/dlls/windows.media.speech/synthesizer.c index 02e3e76e183e..0d352ae8c260 100644 --- a/dlls/windows.media.speech/synthesizer.c +++ b/dlls/windows.media.speech/synthesizer.c @@ -33,6 +33,7 @@ struct voice_information HSTRING language; HSTRING description; VoiceGender gender; + BOOL is_static; }; static inline struct voice_information *impl_from_IVoiceInformation( IVoiceInformation *iface ) @@ -81,7 +82,9 @@ static ULONG WINAPI voice_information_Release( IVoiceInformation *iface ) struct voice_information *impl = impl_from_IVoiceInformation(iface); ULONG ref = InterlockedDecrement(&impl->ref); TRACE("iface %p, ref %lu.\n", iface, ref); - /* all voices are (for now) statically allocated in all_voices vector. so don't free them */ + /* only deallocate non static instances */ + if (!ref && !impl->is_static) + voice_information_delete(impl); return ref; } @@ -192,8 +195,8 @@ HRESULT voice_information_allocate(const WCHAR *display_name, const WCHAR *id, c if (SUCCEEDED(hr)) { voice_info->gender = gender; + voice_info->is_static = TRUE; voice_info->IVoiceInformation_iface.lpVtbl = &voice_information_vtbl; - *pvoice = &voice_info->IVoiceInformation_iface; } else @@ -204,6 +207,35 @@ HRESULT voice_information_allocate(const WCHAR *display_name, const WCHAR *id, c return hr; } +HRESULT voice_information_clone(IVoiceInformation *voice, IVoiceInformation **out) +{ + struct voice_information *voice_info; + HRESULT hr; + + voice_info = calloc(1, sizeof(*voice_info)); + if (!voice_info) return E_OUTOFMEMORY; + + hr = IVoiceInformation_get_DisplayName(voice, &voice_info->display_name); + if (SUCCEEDED(hr)) + hr = IVoiceInformation_get_Id(voice, &voice_info->id); + if (SUCCEEDED(hr)) + hr = IVoiceInformation_get_Language(voice, &voice_info->language); + if (SUCCEEDED(hr)) + hr = IVoiceInformation_get_Description(voice, &voice_info->description); + if (SUCCEEDED(hr)) + hr = IVoiceInformation_get_Gender(voice, &voice_info->gender); + if (SUCCEEDED(hr)) + { + voice_info->IVoiceInformation_iface.lpVtbl = &voice_information_vtbl; + voice_info->ref = 1; + *out = &voice_info->IVoiceInformation_iface; + } + else + voice_information_delete(voice_info); + + return hr; +} + /* * * IVectorView_VoiceInformation @@ -1192,8 +1224,18 @@ static HRESULT WINAPI installed_voices_static_get_AllVoices( IInstalledVoicesSta static HRESULT WINAPI installed_voices_static_get_DefaultVoice( IInstalledVoicesStatic *iface, IVoiceInformation **value ) { - FIXME("iface %p, value %p stub!\n", iface, value); - return E_NOTIMPL; + struct IVoiceInformation *static_voice; + HRESULT hr; + + TRACE("iface %p, value %p\n", iface, value); + + EnterCriticalSection(&allvoices_cs); + hr = IVectorView_VoiceInformation_GetAt(&all_voices.IVectorView_VoiceInformation_iface, 0, &static_voice); + if (SUCCEEDED(hr)) + hr = voice_information_clone(static_voice, value); + LeaveCriticalSection(&allvoices_cs); + + return hr; } static const struct IInstalledVoicesStaticVtbl installed_voices_static_vtbl = diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index ffc63e751c7c..0dadd9465f0d 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -954,30 +954,26 @@ static void test_SpeechSynthesizer(void) ok(size == 0, "IVectorView_VoiceInformation_GetMany returned count %u\n", size); hr = IInstalledVoicesStatic_get_DefaultVoice(voices_static, &voice); - todo_wine ok(hr == S_OK, "IInstalledVoicesStatic_get_DefaultVoice failed, hr %#lx\n", hr); + ok(hr == S_OK, "IInstalledVoicesStatic_get_DefaultVoice failed, hr %#lx\n", hr); - if (hr == S_OK) - { - /* check that VoiceInformation in static vector voice are not shared when exposed to user */ - idx = size; - hr = IVectorView_VoiceInformation_IndexOf(voices, voice, &idx, &found); - ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - ok(!found, "Shouldn't find default element\n"); + /* check that VoiceInformation in static vector voice are not shared when exposed to user */ + idx = size; + hr = IVectorView_VoiceInformation_IndexOf(voices, voice, &idx, &found); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(!found, "Shouldn't find default element\n"); - check_comparable_presence(voices, voice); + check_comparable_presence(voices, voice); - hr = IVoiceInformation_get_Description(voice, &str2); - ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - trace("SpeechSynthesizer default voice %s.\n", debugstr_hstring(str2)); - WindowsDeleteString(str2); + hr = IVoiceInformation_get_Description(voice, &str2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + trace("SpeechSynthesizer default voice %s.\n", debugstr_hstring(str2)); + WindowsDeleteString(str2); - hr = IVoiceInformation_get_Id(voice, &default_voice_id); - ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IVoiceInformation_get_Id(voice, &default_voice_id); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - ref = IVoiceInformation_Release(voice); - ok(ref == 0, "Got unexpected ref %lu.\n", ref); - } - else default_voice_id = NULL; + ref = IVoiceInformation_Release(voice); + ok(ref == 0, "Got unexpected ref %lu.\n", ref); IInstalledVoicesStatic_Release(voices_static); IAgileObject_Release(agile_object); @@ -997,26 +993,23 @@ static void test_SpeechSynthesizer(void) hr = ISpeechSynthesizer_get_Voice(synthesizer, &voice); todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - if (default_voice_id) + if (hr == S_OK) { - if (hr == S_OK) - { - INT32 cmp; - IVoiceInformation_get_Id(voice, &str); - ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - hr = WindowsCompareStringOrdinal(str, default_voice_id, &cmp); - ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - - hr = WindowsDeleteString(str); - ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - - IVoiceInformation_Release(voice); - } + INT32 cmp; + IVoiceInformation_get_Id(voice, &str); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = WindowsCompareStringOrdinal(str, default_voice_id, &cmp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - hr = WindowsDeleteString(default_voice_id); + hr = WindowsDeleteString(str); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + IVoiceInformation_Release(voice); } + hr = WindowsDeleteString(default_voice_id); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + /* Test SynthesizeTextToStreamAsync */ hr = WindowsCreateString(simple_synth_text, wcslen(simple_synth_text), &str); ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr); From b311a3a76e9dd230060900a74d0e91536b952489 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Tue, 4 Jul 2023 12:40:52 +0200 Subject: [PATCH 0781/2542] windows.media.speech: Implement get/put voice on synthesizer. Signed-off-by: Eric Pouech CW-Bug-Id: #20134 --- dlls/windows.media.speech/synthesizer.c | 57 ++++++++++++++++++++++-- dlls/windows.media.speech/tests/speech.c | 22 +++++---- 2 files changed, 63 insertions(+), 16 deletions(-) diff --git a/dlls/windows.media.speech/synthesizer.c b/dlls/windows.media.speech/synthesizer.c index 0d352ae8c260..bdf7325f6698 100644 --- a/dlls/windows.media.speech/synthesizer.c +++ b/dlls/windows.media.speech/synthesizer.c @@ -839,6 +839,7 @@ struct synthesizer LONG ref; struct synthesizer_options *options; + IVoiceInformation *current_voice; }; /* @@ -902,6 +903,8 @@ static ULONG WINAPI synthesizer_Release( ISpeechSynthesizer *iface ) { if (impl->options) ISpeechSynthesizerOptions_Release(&impl->options->ISpeechSynthesizerOptions_iface); + if (impl->current_voice) + IVoiceInformation_Release(impl->current_voice); free(impl); } @@ -954,14 +957,49 @@ static HRESULT WINAPI synthesizer_SynthesizeSsmlToStreamAsync( ISpeechSynthesize static HRESULT WINAPI synthesizer_put_Voice( ISpeechSynthesizer *iface, IVoiceInformation *value ) { - FIXME("iface %p, value %p stub.\n", iface, value); - return E_NOTIMPL; + struct synthesizer *impl = impl_from_ISpeechSynthesizer(iface); + IVoiceInformation *voice; + HSTRING id, id2; + HRESULT hr; + INT32 cmp, idx; + + TRACE("iface %p, value %p semi-stub.\n", iface, value); + + hr = IVoiceInformation_get_Id(value, &id); + if (FAILED(hr)) return hr; + + for (idx = 0; ; idx++) + { + if (SUCCEEDED(hr = IVectorView_VoiceInformation_GetAt(&all_voices.IVectorView_VoiceInformation_iface, idx, &voice))) + { + if (SUCCEEDED(hr = IVoiceInformation_get_Id(voice, &id2))) + { + hr = WindowsCompareStringOrdinal(id, id2, &cmp); + WindowsDeleteString(id2); + } + IVoiceInformation_Release(voice); + } + if (FAILED(hr) || cmp == 0) break; + } + WindowsDeleteString(id); + + if (SUCCEEDED(hr)) + { + if (impl->current_voice) + IVoiceInformation_Release(impl->current_voice); + IVoiceInformation_AddRef(impl->current_voice = value); + } + return hr; } static HRESULT WINAPI synthesizer_get_Voice( ISpeechSynthesizer *iface, IVoiceInformation **value ) { - FIXME("iface %p, value %p stub.\n", iface, value); - return E_NOTIMPL; + struct synthesizer *impl = impl_from_ISpeechSynthesizer(iface); + + TRACE("iface %p, value %p.\n", iface, value); + if (!impl->current_voice) return E_NOTIMPL; + IVoiceInformation_AddRef(*value = impl->current_voice); + return S_OK; } static const struct ISpeechSynthesizerVtbl synthesizer_vtbl = @@ -1136,7 +1174,9 @@ static HRESULT WINAPI factory_GetTrustLevel( IActivationFactory *iface, TrustLev static HRESULT WINAPI factory_ActivateInstance( IActivationFactory *iface, IInspectable **instance ) { + struct IVoiceInformation *static_voice; struct synthesizer *impl; + HRESULT hr; TRACE("iface %p, instance %p.\n", iface, instance); @@ -1149,6 +1189,15 @@ static HRESULT WINAPI factory_ActivateInstance( IActivationFactory *iface, IInsp impl->ISpeechSynthesizer_iface.lpVtbl = &synthesizer_vtbl; impl->ISpeechSynthesizer2_iface.lpVtbl = &synthesizer2_vtbl; impl->IClosable_iface.lpVtbl = &closable_vtbl; + /* assuming default is the first one... */ + hr = IVectorView_VoiceInformation_GetAt(&all_voices.IVectorView_VoiceInformation_iface, 0, &static_voice); + if (SUCCEEDED(hr)) + hr = voice_information_clone(static_voice, &impl->current_voice); + if (FAILED(hr)) + { + free(impl); + return hr; + } impl->ref = 1; *instance = (IInspectable *)&impl->ISpeechSynthesizer_iface; diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 0dadd9465f0d..ade056a0a392 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -861,6 +861,7 @@ static void test_SpeechSynthesizer(void) UINT32 size, idx; BOOLEAN found; ULONG ref; + INT32 cmp; hr = RoInitialize(RO_INIT_MULTITHREADED); ok(hr == S_OK, "RoInitialize failed, hr %#lx\n", hr); @@ -991,21 +992,18 @@ static void test_SpeechSynthesizer(void) ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); hr = ISpeechSynthesizer_get_Voice(synthesizer, &voice); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - if (hr == S_OK) - { - INT32 cmp; - IVoiceInformation_get_Id(voice, &str); - ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - hr = WindowsCompareStringOrdinal(str, default_voice_id, &cmp); - ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IVoiceInformation_get_Id(voice, &str); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - hr = WindowsDeleteString(str); - ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = WindowsCompareStringOrdinal(str, default_voice_id, &cmp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - IVoiceInformation_Release(voice); - } + hr = WindowsDeleteString(str); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + IVoiceInformation_Release(voice); hr = WindowsDeleteString(default_voice_id); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); From 171dd43baf81d2611a2c166d5feaf8ff13a9dd17 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 5 Dec 2023 16:27:34 +0100 Subject: [PATCH 0782/2542] HACK: winex11, winevulkan: Support faking GPU PCI IDs. CW-Bug-Id: #23140 --- dlls/win32u/sysparams.c | 33 +++++++++++++++++++++++++++++ dlls/winevulkan/loader.c | 42 +++++++++++++++++++++++++++++++++++++ dlls/winevulkan/make_vulkan | 1 + 3 files changed, 76 insertions(+) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index ba6a6ffb5e3d..29d9dc9e5fdf 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1268,6 +1268,38 @@ static struct vulkan_gpu *find_vulkan_gpu_from_pci_id( const struct device_manag return NULL; } +static void fixup_device_id( const struct pci_id **pci_id ) +{ + static struct pci_id fake_id; + const char *sgi; + + if ((*pci_id)->vendor == 0x10de /* NVIDIA */ && (sgi = getenv("WINE_HIDE_NVIDIA_GPU")) && *sgi != '0') + { + fake_id.vendor = 0x1002; /* AMD */ + fake_id.device = 0x73df; /* RX 6700XT */ + *pci_id = &fake_id; + } + else if ((*pci_id)->vendor == 0x1002 /* AMD */ && (sgi = getenv("WINE_HIDE_AMD_GPU")) && *sgi != '0') + { + fake_id.vendor = 0x10de; /* NVIDIA */ + fake_id.device = 0x2487; /* RTX 3060 */ + *pci_id = &fake_id; + } + else if ((*pci_id)->vendor == 0x1002 && ((*pci_id)->device == 0x163f || (*pci_id)->device == 0x1435) + && (sgi = getenv("WINE_HIDE_VANGOGH_GPU")) && *sgi != '0') + { + fake_id.vendor = (*pci_id)->vendor; + fake_id.device = 0x687f; /* Radeon RX Vega 56/64 */ + *pci_id = &fake_id; + } + else if ((*pci_id)->vendor == 0x8086 /* Intel */ && (sgi = getenv("WINE_HIDE_INTEL_GPU")) && *sgi != '0') + { + fake_id.vendor = 0x1002; /* AMD */ + fake_id.device = 0x73df; /* RX 6700XT */ + *pci_id = &fake_id; + } +} + static void add_gpu( const char *name, const struct pci_id *pci_id, const GUID *vulkan_uuid, void *param ) { struct device_manager_ctx *ctx = param; @@ -1317,6 +1349,7 @@ static void add_gpu( const char *name, const struct pci_id *pci_id, const GUID * else if (vulkan_gpu) gpu->vulkan_uuid = vulkan_gpu->uuid; if (!pci_id->vendor && !pci_id->device && vulkan_gpu) pci_id = &vulkan_gpu->pci_id; + fixup_device_id( &pci_id ); if ((!name || !strcmp( name, "Wine GPU" )) && vulkan_gpu) name = vulkan_gpu->name; if (name) RtlUTF8ToUnicodeN( gpu->name, sizeof(gpu->name) - sizeof(WCHAR), &len, name, strlen( name ) ); diff --git a/dlls/winevulkan/loader.c b/dlls/winevulkan/loader.c index 644e0982e7a0..9d42ae7539ce 100644 --- a/dlls/winevulkan/loader.c +++ b/dlls/winevulkan/loader.c @@ -531,6 +531,46 @@ static void fill_luid_property(VkPhysicalDeviceProperties2 *properties2) device_node_mask); } +static void fixup_device_id(UINT *vendor_id, UINT *device_id) +{ + const char *sgi; + + if (*vendor_id == 0x10de /* NVIDIA */ && (sgi = getenv("WINE_HIDE_NVIDIA_GPU")) && *sgi != '0') + { + *vendor_id = 0x1002; /* AMD */ + *device_id = 0x73df; /* RX 6700XT */ + } + else if (*vendor_id == 0x1002 /* AMD */ && (sgi = getenv("WINE_HIDE_AMD_GPU")) && *sgi != '0') + { + *vendor_id = 0x10de; /* NVIDIA */ + *device_id = 0x2487; /* RTX 3060 */ + } + else if (*vendor_id == 0x1002 && (*device_id == 0x163f || *device_id == 0x1435) && (sgi = getenv("WINE_HIDE_VANGOGH_GPU")) && *sgi != '0') + { + *device_id = 0x687f; /* Radeon RX Vega 56/64 */ + } + else if (*vendor_id == 0x8086 /* Intel */ && (sgi = getenv("WINE_HIDE_INTEL_GPU")) && *sgi != '0') + { + *vendor_id = 0x1002; /* AMD */ + *device_id = 0x73df; /* RX 6700XT */ + } +} + +void WINAPI vkGetPhysicalDeviceProperties(VkPhysicalDevice physical_device, + VkPhysicalDeviceProperties *properties) +{ + struct vkGetPhysicalDeviceProperties_params params; + NTSTATUS status; + + TRACE("%p, %p\n", physical_device, properties); + + params.physicalDevice = physical_device; + params.pProperties = properties; + status = UNIX_CALL(vkGetPhysicalDeviceProperties, ¶ms); + assert(!status); + fixup_device_id(&properties->vendorID, &properties->deviceID); +} + void WINAPI vkGetPhysicalDeviceProperties2(VkPhysicalDevice phys_dev, VkPhysicalDeviceProperties2 *properties2) { @@ -544,6 +584,7 @@ void WINAPI vkGetPhysicalDeviceProperties2(VkPhysicalDevice phys_dev, status = UNIX_CALL(vkGetPhysicalDeviceProperties2, ¶ms); assert(!status); fill_luid_property(properties2); + fixup_device_id(&properties2->properties.vendorID, &properties2->properties.deviceID); } void WINAPI vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice phys_dev, @@ -559,6 +600,7 @@ void WINAPI vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice phys_dev, status = UNIX_CALL(vkGetPhysicalDeviceProperties2KHR, ¶ms); assert(!status); fill_luid_property(properties2); + fixup_device_id(&properties2->properties.vendorID, &properties2->properties.deviceID); } VkResult WINAPI vkCreateDevice(VkPhysicalDevice phys_dev, const VkDeviceCreateInfo *create_info, diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index bcca990959fc..6606dcab5456 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -281,6 +281,7 @@ MANUAL_LOADER_THUNKS = { "vkEnumerateInstanceExtensionProperties", "vkEnumerateInstanceVersion", "vkFreeCommandBuffers", + "vkGetPhysicalDeviceProperties", "vkGetPhysicalDeviceProperties2", "vkGetPhysicalDeviceProperties2KHR", } From 463018c1ef79013097a80e74fbac401bfbe6ce04 Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Wed, 27 Dec 2023 20:20:22 +0000 Subject: [PATCH 0783/2542] gdiplus: Add GdipMeasureString hack for SpriteFontX. CW-Bug-Id: #23181 --- dlls/gdiplus/graphics.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 3ad40a7de13a..624e16c49835 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -5903,6 +5903,15 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, if(!graphics || !string || !font || !rect || !bounds) return InvalidParameter; + if (length == 1 && string[0] == '\n') + { + /* Proton hack for SpriteFontX class used by TouHou Makuka Sai. + * Returned size is passed to Bitmap constructor, but we currently measure "\n" as zero size. */ + char const *sgi = getenv("SteamGameId"); + if (sgi && (!strcmp(sgi, "882710") || !strcmp(sgi, "1031480"))) + string = L" "; + } + if(!has_gdi_dc(graphics)) { hdc = temp_hdc = CreateCompatibleDC(0); From 2de68338b1bfbe20704d6d85aa70dbd740899b8e Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Wed, 6 Oct 2021 15:44:57 -0500 Subject: [PATCH 0784/2542] setupapi: Compare dll files before overwriting them. This is mainly to prevent us from clobbering reflinks created by the proton script, and to make sure dll symlinks (which we can't overwrite) are still registered properly. CW-Bug-Id: #18633 --- dlls/setupapi/fakedll.c | 151 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 138 insertions(+), 13 deletions(-) diff --git a/dlls/setupapi/fakedll.c b/dlls/setupapi/fakedll.c index fb01d21b3ba5..a2d06490b86c 100644 --- a/dlls/setupapi/fakedll.c +++ b/dlls/setupapi/fakedll.c @@ -428,7 +428,7 @@ static const WCHAR *enum_load_path( unsigned int idx ) } /* try to load a pre-compiled fake dll */ -static void *load_fake_dll( const WCHAR *name, SIZE_T *size ) +static void *load_fake_dll( const WCHAR *name, SIZE_T *size, WCHAR **out_filename ) { const WCHAR *build_dir = _wgetenv( L"WINEBUILDDIR" ); const WCHAR *path; @@ -476,11 +476,94 @@ static void *load_fake_dll( const WCHAR *name, SIZE_T *size ) } done: + if (res == 1) + { + *out_filename = malloc( (wcslen( ptr ) + 1) * sizeof(WCHAR) ); + wcscpy( *out_filename, ptr ); + free( file ); + return data; + } free( file ); - if (res == 1) return data; return NULL; } +/* Check if the 2 files are already the same */ +static BOOL fake_dll_matches( const WCHAR *source, const WCHAR *dest ) +{ + WIN32_FILE_ATTRIBUTE_DATA data1, data2; + HANDLE h; + char *buf; + DWORD size, bytesread; + BOOL result; + + if (!GetFileAttributesExW( source, GetFileExInfoStandard, &data1 )) + return FALSE; + + if (!GetFileAttributesExW( dest, GetFileExInfoStandard, &data2 )) + return FALSE; + + if ((data2.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) == FILE_ATTRIBUTE_REPARSE_POINT) + /* If it's a symlink, assume it was put there by the proton script and is therefore correct */ + return TRUE; + + if (data1.nFileSizeHigh != 0 || + data2.nFileSizeHigh != 0 || + data1.nFileSizeLow != data2.nFileSizeLow) + { + return FALSE; + } + + size = data1.nFileSizeLow; + + /* If size and mtime matches, don't bother comparing contents */ + if ((data1.ftLastWriteTime.dwLowDateTime != 0 || data1.ftLastWriteTime.dwHighDateTime != 0) && + data1.ftLastWriteTime.dwLowDateTime == data2.ftLastWriteTime.dwLowDateTime && + data1.ftLastWriteTime.dwHighDateTime == data2.ftLastWriteTime.dwHighDateTime) + return TRUE; + + buf = malloc( size * 2 ); + + if (!buf) + return FALSE; + + h = CreateFileW( source, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL ); + if (h == INVALID_HANDLE_VALUE) + { + free( buf ); + return FALSE; + } + + if (!ReadFile( h, buf, size, &bytesread, NULL ) || bytesread != size) + { + CloseHandle( h ); + free( buf ); + return FALSE; + } + + CloseHandle( h ); + + h = CreateFileW( dest, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL ); + if (h == INVALID_HANDLE_VALUE) + { + free( buf ); + return FALSE; + } + + if (!ReadFile( h, buf + size, size, &bytesread, NULL ) || bytesread != size) + { + CloseHandle( h ); + free( buf ); + return FALSE; + } + + CloseHandle( h ); + + result = !memcmp( buf, buf + size, size ); + + free( buf ); + return result; +} + /* create the fake dll destination file */ static HANDLE create_dest_file( const WCHAR *name, BOOL delete ) { @@ -907,7 +990,11 @@ static int install_fake_dll( WCHAR *dest, WCHAR *file, BOOL delete, struct list destname[len] = 0; if (!add_handled_dll( destname )) ret = -1; - if (ret != -1) + if (ret != -1 && fake_dll_matches( file, dest )) + { + register_fake_dll( dest, data, size, delay_copy ); + } + else if (ret != -1) { HANDLE h = create_dest_file( dest, delete ); @@ -939,6 +1026,13 @@ static void delay_copy_files( struct list *delay_copy ) LIST_FOR_EACH_ENTRY_SAFE( copy, next, delay_copy, struct delay_copy, entry ) { list_remove( ©->entry ); + + if ( fake_dll_matches( copy->src, copy->dest ) ) + { + free( copy ); + continue; + } + ret = read_file( copy->src, &data, &size ); if (ret != 1) { @@ -1051,6 +1145,7 @@ BOOL create_fake_dll( const WCHAR *name, const WCHAR *source ) BOOL ret; SIZE_T size; const WCHAR *filename; + WCHAR *source_filename; void *buffer; BOOL delete = !wcscmp( source, L"-" ); /* '-' source means delete the file */ @@ -1067,25 +1162,55 @@ BOOL create_fake_dll( const WCHAR *name, const WCHAR *source ) add_handled_dll( filename ); - if (!(h = create_dest_file( name, delete ))) return TRUE; /* not a fake dll */ - if (h == INVALID_HANDLE_VALUE) return FALSE; + if (delete) + { + if (!(h = create_dest_file( name, delete ))) return TRUE; /* not a fake dll */ + if (h == INVALID_HANDLE_VALUE) return FALSE; + + /* '-' source means delete the file */ + TRACE( "deleting %s\n", debugstr_w(name) ); + ret = FALSE; - if ((buffer = load_fake_dll( source, &size ))) + CloseHandle( h ); + DeleteFileW( name ); + } + else if ((buffer = load_fake_dll( source, &size, &source_filename ))) { - DWORD written; + if (fake_dll_matches( source_filename, name )) + { + free( source_filename ); + + register_fake_dll( name, buffer, size, &delay_copy ); + ret = TRUE; + } + else + { + DWORD written; + + free( source_filename ); - ret = (WriteFile( h, buffer, size, &written, NULL ) && written == size); - if (ret) register_fake_dll( name, buffer, size, &delay_copy ); - else ERR( "failed to write to %s (error=%lu)\n", debugstr_w(name), GetLastError() ); + if (!(h = create_dest_file( name, FALSE ))) return TRUE; /* not a fake dll */ + if (h == INVALID_HANDLE_VALUE) return FALSE; + + ret = (WriteFile( h, buffer, size, &written, NULL ) && written == size); + if (ret) register_fake_dll( name, buffer, size, &delay_copy ); + else ERR( "failed to write to %s (error=%lu)\n", debugstr_w(name), GetLastError() ); + + CloseHandle( h ); + if (!ret) DeleteFileW( name ); + } } else { + if (!(h = create_dest_file( name, FALSE ))) return TRUE; /* not a fake dll */ + if (h == INVALID_HANDLE_VALUE) return FALSE; + WARN( "fake dll %s not found for %s\n", debugstr_w(source), debugstr_w(name) ); ret = build_fake_dll( h, name ); - } - CloseHandle( h ); - if (!ret) DeleteFileW( name ); + CloseHandle( h ); + if (!ret) DeleteFileW( name ); + } delay_copy_files( &delay_copy ); return ret; From 7980bb943f374f1937768d1f6999bd0c2867be68 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 9 Feb 2024 11:46:31 -0600 Subject: [PATCH 0785/2542] HACK: ntdll: Add WINE_HEAP_ZERO_MEMORY variable to force zeroing allocated memory. CW-Bug-Id: #23394 CW-Bug-Id: #23466 --- dlls/ntdll/loader.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 6de3f07e939a..ffaf72c1140e 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -4506,6 +4506,7 @@ void loader_init( CONTEXT *context, void **entry ) WINE_MODREF *kernel32; PEB *peb = NtCurrentTeb()->Peb; WCHAR env_str[16]; + ULONG heap_flags = HEAP_GROWABLE; unsigned int i; peb->LdrData = &ldr; @@ -4522,8 +4523,13 @@ void loader_init( CONTEXT *context, void **entry ) delay_heap_free = TRUE; } } + if (get_env( L"WINE_HEAP_ZERO_MEMORY", env_str, sizeof(env_str)) && env_str[0] == L'1') + { + ERR( "Enabling heap zero hack.\n" ); + heap_flags |= HEAP_ZERO_MEMORY; + } - peb->ProcessHeap = RtlCreateHeap( HEAP_GROWABLE, NULL, 0, 0, NULL, NULL ); + peb->ProcessHeap = RtlCreateHeap( heap_flags, NULL, 0, 0, NULL, NULL ); RtlInitializeBitMap( &tls_bitmap, peb->TlsBitmapBits, sizeof(peb->TlsBitmapBits) * 8 ); RtlInitializeBitMap( &tls_expansion_bitmap, peb->TlsExpansionBitmapBits, From 0fd9a6c25b40329ab7b7c314dd1d4b56b6364c32 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Mon, 4 Mar 2024 09:47:32 +0800 Subject: [PATCH 0786/2542] HACK: ntdll: Extend heap zero hack to private heaps. Call of Juarez: Bound in Blood (21980) uses uninitialized memory from msvcr80.operator_new(), which allocates memory from a private heap created specifically for MSVC runtime. CW-Bug-Id: #23466 --- dlls/ntdll/heap.c | 4 ++++ dlls/ntdll/loader.c | 2 +- dlls/ntdll/ntdll_misc.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 67592ebd56ea..1afc0e27e2a0 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -329,6 +329,7 @@ C_ASSERT( HEAP_MIN_LARGE_BLOCK_SIZE <= HEAP_INITIAL_GROW_SIZE ); #define HEAP_CHECKING_ENABLED 0x80000000 BOOL delay_heap_free = FALSE; +BOOL heap_zero_hack = FALSE; static struct heap *process_heap; /* main process heap */ @@ -1508,6 +1509,9 @@ HANDLE WINAPI RtlCreateHeap( ULONG flags, void *addr, SIZE_T total_size, SIZE_T TRACE( "flags %#lx, addr %p, total_size %#Ix, commit_size %#Ix, lock %p, params %p\n", flags, addr, total_size, commit_size, lock, params ); + if (heap_zero_hack) + flags |= HEAP_ZERO_MEMORY; + flags &= ~(HEAP_TAIL_CHECKING_ENABLED|HEAP_FREE_CHECKING_ENABLED); if (process_heap) flags |= HEAP_PRIVATE; if (!process_heap || !total_size || (flags & HEAP_SHARED)) flags |= HEAP_GROWABLE; diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index ffaf72c1140e..40dd47acc30d 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -4526,7 +4526,7 @@ void loader_init( CONTEXT *context, void **entry ) if (get_env( L"WINE_HEAP_ZERO_MEMORY", env_str, sizeof(env_str)) && env_str[0] == L'1') { ERR( "Enabling heap zero hack.\n" ); - heap_flags |= HEAP_ZERO_MEMORY; + heap_zero_hack = TRUE; } peb->ProcessHeap = RtlCreateHeap( heap_flags, NULL, 0, 0, NULL, NULL ); diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 6310fc8b6401..0ee1dfe225b4 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -54,6 +54,7 @@ extern UINT_PTR page_size; #endif extern BOOL delay_heap_free; +extern BOOL heap_zero_hack; /* exceptions */ extern NTSTATUS call_seh_handlers( EXCEPTION_RECORD *rec, CONTEXT *context ); From c7655feceee370c03c94315ccc00e3435d41c04c Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 25 Mar 2024 13:22:12 -0600 Subject: [PATCH 0787/2542] kernelbase: HACK: Force CEF swiftshader for Aisling and the Tavern of Elves/nw.exe. CW-Bug-Id: #23612 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index d66d19d4c80e..d87b32ad5460 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -595,6 +595,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) {L"UplayWebCore.exe", L" --use-angle=vulkan"}, {L"Paradox Launcher.exe", L" --use-angle=gl"}, {L"Montaro\\nw.exe", L" --use-gl=swiftshader"}, + {L"Aisling and the Tavern of Elves\\nw.exe", L" --use-gl=swiftshader"}, {L"\\EOSOverlayRenderer-Win64-Shipping.exe", L" --use-gl=swiftshader --in-process-gpu"}, {L"\\EpicOnlineServicesUIHelper", L" --use-angle=vulkan"}, {L"OlympiaRising.exe", L" --use-gl=swiftshader"}, From 891f790fd15d34203a005f9ce4c36b51e4313a16 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 25 Mar 2024 13:36:21 -0600 Subject: [PATCH 0788/2542] kernelbase: HACK: Force CEF swiftshader for Snares of Ruin 2. CW-Bug-Id: #23613 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index d87b32ad5460..9d4c1dbe150a 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -596,6 +596,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) {L"Paradox Launcher.exe", L" --use-angle=gl"}, {L"Montaro\\nw.exe", L" --use-gl=swiftshader"}, {L"Aisling and the Tavern of Elves\\nw.exe", L" --use-gl=swiftshader"}, + {L"Snares of Ruin 2\\SoR2.exe", L" --use-gl=swiftshader"}, {L"\\EOSOverlayRenderer-Win64-Shipping.exe", L" --use-gl=swiftshader --in-process-gpu"}, {L"\\EpicOnlineServicesUIHelper", L" --use-angle=vulkan"}, {L"OlympiaRising.exe", L" --use-gl=swiftshader"}, From 42d8722e4317b5fa5ded95b14a2f4faf25d4c873 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 27 Mar 2024 17:16:46 -0600 Subject: [PATCH 0789/2542] opengl32: HACK: Fixup shaders for Joe Danger 2: The Movie. CW-Bug-Id: #23619 --- dlls/opengl32/wgl.c | 72 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 58 insertions(+), 14 deletions(-) diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index e474326d3059..9a0ccaddd46c 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -1904,21 +1904,62 @@ static char *fixup_shader( GLsizei count, const GLchar *const*string, const GLin static int needs_fixup = -1; static unsigned int once; - const char add_ext[] = "#version 120\r\n" - "#extension GL_ARB_explicit_uniform_location : enable\r\n" - "#extension GL_ARB_explicit_attrib_location : enable\r\n"; - const char search_str[] = "uniform mat4 boneMatrices[NBONES];"; - const char prepend_str[] = "layout(location = 2) "; - unsigned int search_len, new_len; + static const struct + { + const char *gameid; + const char *add_ext; + const char *search_str; + const char *prepend_str; + } + replace[] = + { + { + "333420", + + /* add_ext */ + "#version 120\r\n" + "#extension GL_ARB_explicit_uniform_location : enable\r\n" + "#extension GL_ARB_explicit_attrib_location : enable\r\n", + /* search_str */ + "uniform mat4 boneMatrices[NBONES];", + /* replace_str */ + "layout(location = 2) ", + }, + { + "242110", + /* add_ext */ + "#version 120\r\n", + }, + }; + static const char *add_ext; + static const char *search_str; + static const char *prepend_str; + static unsigned int add_ext_len, search_len, prepend_len; + unsigned int new_len; const char *p, *next; BOOL found = FALSE; char *new, *out; if (needs_fixup == -1) { - const char *sgi = getenv("SteamGameId"); + const char *sgi = getenv("SteamGameId"); + unsigned int i; - needs_fixup = sgi && !strcmp( sgi, "333420" ); + if (!sgi) return NULL; + + for (i = 0; i < ARRAY_SIZE(replace); ++i) + if (!strcmp( sgi, replace[i].gameid )) break; + + needs_fixup = i < ARRAY_SIZE(replace); + if (needs_fixup) + { + add_ext = replace[i].add_ext; + add_ext_len = add_ext ? strlen(add_ext) : 0; + search_str = replace[i].search_str; + search_len = search_str ? strlen(search_str) : 0; + prepend_str = replace[i].prepend_str; + prepend_len = prepend_str ? strlen(prepend_str) : 0; + } } if (!needs_fixup) return NULL; @@ -1929,12 +1970,13 @@ static char *fixup_shader( GLsizei count, const GLchar *const*string, const GLin FIXME( "HACK: Fixing up shader.\n" ); TRACE( "Appending extension string.\n" ); - new_len = strlen( *string ) + sizeof(prepend_str) - 1 + sizeof(add_ext); + new_len = strlen( *string ) + prepend_len + add_ext_len + 1; new = out = malloc( new_len ); - memcpy( out, add_ext, sizeof(add_ext) - 1 ); - out += sizeof(add_ext) - 1; + memcpy( out, add_ext, add_ext_len ); + out += add_ext_len; + + if (!search_str) goto skip_search; - search_len = sizeof(search_str) - 1; next = *string; while (*(p = next)) { @@ -1945,8 +1987,8 @@ static char *fixup_shader( GLsizei count, const GLchar *const*string, const GLin TRACE( "Adding explicit location.\n" ); memcpy( out, *string, p - *string ); out += p - *string; - memcpy( out, prepend_str, sizeof(prepend_str) - 1 ); - out += sizeof(prepend_str) - 1; + memcpy( out, prepend_str, prepend_len ); + out += prepend_len; strcpy( out, p ); found = TRUE; break; @@ -1954,6 +1996,8 @@ static char *fixup_shader( GLsizei count, const GLchar *const*string, const GLin while (*next == '\n' || *next == '\r') ++next; } + +skip_search: if (!found) strcpy( out, *string ); From 8b69e2eb5b735799461a76e38ae3168591c17111 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 28 Mar 2024 09:58:25 -0600 Subject: [PATCH 0790/2542] opengl32: HACK: Fixup shaders for Joe Danger. CW-Bug-Id: #23619 --- dlls/opengl32/wgl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 9a0ccaddd46c..9a85687830ed 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -1930,6 +1930,11 @@ static char *fixup_shader( GLsizei count, const GLchar *const*string, const GLin /* add_ext */ "#version 120\r\n", }, + { + "229890", + /* add_ext */ + "#version 120\r\n", + }, }; static const char *add_ext; static const char *search_str; From 6f5ec291c8aca466f03137f5db42bfd3e4bce540 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 1 Apr 2024 21:15:03 -0600 Subject: [PATCH 0791/2542] kernelbase: HACK: Force in-process-gpu for Summer Islands. CW-Bug-Id: #23635 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 9d4c1dbe150a..268d75dd7983 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -592,6 +592,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) } options[] = { + {L"SummerIslands.exe", L" --in-process-gpu"}, {L"UplayWebCore.exe", L" --use-angle=vulkan"}, {L"Paradox Launcher.exe", L" --use-angle=gl"}, {L"Montaro\\nw.exe", L" --use-gl=swiftshader"}, From 1d04cb6a3ed5534b410d6df24829567ba6416b95 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 2 Apr 2024 18:05:11 -0600 Subject: [PATCH 0792/2542] kernelbase: HACK: Force in-process-gpu for Total War: WARHAMMER II. CW-Bug-Id: #23579 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 268d75dd7983..a932b9e70f6e 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -592,6 +592,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) } options[] = { + {L"Warhammer2.exe", L" --in-process-gpu"}, {L"SummerIslands.exe", L" --in-process-gpu"}, {L"UplayWebCore.exe", L" --use-angle=vulkan"}, {L"Paradox Launcher.exe", L" --use-angle=gl"}, From 6e6615d54bc34a931f494d640f4f14c8afa183d6 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 4 Apr 2024 17:53:09 -0600 Subject: [PATCH 0793/2542] kernelbase: HACK: Force CEF swiftshader for Insanity's Blade. CW-Bug-Id: #23650 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index a932b9e70f6e..bf6122d4a2f7 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -592,6 +592,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) } options[] = { + {L"Insanitys Blade\\nw.exe", L" --use-gl=swiftshader"}, {L"Warhammer2.exe", L" --in-process-gpu"}, {L"SummerIslands.exe", L" --in-process-gpu"}, {L"UplayWebCore.exe", L" --use-angle=vulkan"}, From c6e3f1d623424fced183c4a2d74e8099e71ec42c Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 4 Apr 2024 17:51:39 -0600 Subject: [PATCH 0794/2542] kernelbase: HACK: Force disable direct composition for Bloody Walls. CW-Bug-Id: #23651 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index bf6122d4a2f7..df7f2539065c 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -592,6 +592,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) } options[] = { + {L"Bloody Walls\\game.exe", L" --disable_direct_composition=1"}, {L"Insanitys Blade\\nw.exe", L" --use-gl=swiftshader"}, {L"Warhammer2.exe", L" --in-process-gpu"}, {L"SummerIslands.exe", L" --in-process-gpu"}, From 325255cf1710e2b3bcf7d939849b231df44fabfb Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 18 Mar 2024 20:33:52 -0600 Subject: [PATCH 0795/2542] winex11.drv: HACK: Don't clip child windows for C&C Red Alert 2. CW-Bug-Id: #23585 --- dlls/winex11.drv/init.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 267ae384bdc7..8de14d670058 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -219,10 +219,21 @@ static BOOL needs_client_window_clipping( HWND hwnd ) BOOL needs_offscreen_rendering( HWND hwnd, BOOL known_child, BOOL check_gamma ) { + static int no_child_clipping_cached = -1; + + if (no_child_clipping_cached == -1) + { + const char *sgi = getenv( "SteamGameId" ); + + no_child_clipping_cached = sgi && !strcmp( sgi, "2229850" ); + if (no_child_clipping_cached) FIXME( "HACK: disabling child GL window clipping.\n" ); + } + if (NtUserGetDpiForWindow( hwnd ) != NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) && !enable_fullscreen_hack( hwnd, check_gamma )) return TRUE; /* needs DPI scaling */ if (NtUserGetAncestor( hwnd, GA_PARENT ) != NtUserGetDesktopWindow()) return TRUE; /* child window, needs compositing */ + if (no_child_clipping_cached) return FALSE; if (NtUserGetWindowRelative( hwnd, GW_CHILD ) || known_child) return needs_client_window_clipping( hwnd ); /* window has children, needs compositing */ return FALSE; } From 8b736b17517629373db5dcf365dc4bf8e1f5ef2f Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 18 Mar 2024 20:38:13 -0600 Subject: [PATCH 0796/2542] winex11.drv: HACK: Don't clip child windows for C&C Tiberian Sun. CW-Bug-Id: #23586 --- dlls/winex11.drv/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 8de14d670058..f61834274d8d 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -225,7 +225,7 @@ BOOL needs_offscreen_rendering( HWND hwnd, BOOL known_child, BOOL check_gamma ) { const char *sgi = getenv( "SteamGameId" ); - no_child_clipping_cached = sgi && !strcmp( sgi, "2229850" ); + no_child_clipping_cached = sgi && (!strcmp( sgi, "2229850" ) || !strcmp( sgi, "2229880" )); if (no_child_clipping_cached) FIXME( "HACK: disabling child GL window clipping.\n" ); } From b9249568acacf0856821f941afab182bbafb5c25 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 30 Jan 2024 11:55:31 -0600 Subject: [PATCH 0797/2542] winex11.drv: Default swap interval to 0 for child window drawables in create_gl_drawable(). CW-Bug-Id: #23329 --- dlls/winex11.drv/opengl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 837499b79830..cd6aa61d6cba 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1894,6 +1894,7 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct glx_pixel visual->class == DirectColor) ? AllocAll : AllocNone ); gl->window = create_client_window( hwnd, gl->rect, visual, gl->colormap ); gl->fs_hack = enable_fshack; + gl->swap_interval = 0; if (gl->window) { struct x11drv_win_data *data; From 858f9c03e279fbe7753febbb6f31e5465f0a4004 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 13 Mar 2024 18:44:31 -0600 Subject: [PATCH 0798/2542] ntdll: Wait for thread suspension in NtSuspendThread(). CW-Bug-Id: #23552 --- dlls/ntdll/unix/thread.c | 26 ++++++++++++++++++++++---- server/protocol.def | 6 ++++-- server/thread.c | 28 ++++++++++++++++++++++++---- 3 files changed, 50 insertions(+), 10 deletions(-) diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index b7c1e7d9775d..5edca5fcf943 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -1649,22 +1649,40 @@ NTSTATUS WINAPI NtOpenThread( HANDLE *handle, ACCESS_MASK access, /****************************************************************************** * NtSuspendThread (NTDLL.@) */ -NTSTATUS WINAPI NtSuspendThread( HANDLE handle, ULONG *count ) +NTSTATUS WINAPI NtSuspendThread( HANDLE handle, ULONG *ret_count ) { BOOL self = FALSE; - unsigned int ret; + unsigned int ret, count = 0; + HANDLE wait_handle = NULL; SERVER_START_REQ( suspend_thread ) { req->handle = wine_server_obj_handle( handle ); - if (!(ret = wine_server_call( req ))) + if (!(ret = wine_server_call( req )) || ret == STATUS_PENDING) { self = reply->count & 0x80000000; - if (count) *count = reply->count & 0x7fffffff; + count = reply->count & 0x7fffffff;; + wait_handle = wine_server_ptr_handle( reply->wait_handle ); } } SERVER_END_REQ; + if (self) usleep( 0 ); + + if (ret == STATUS_PENDING && wait_handle) + { + NtWaitForSingleObject( wait_handle, FALSE, NULL ); + + SERVER_START_REQ( suspend_thread ) + { + req->handle = wine_server_obj_handle( handle ); + req->waited_handle = wine_server_obj_handle( wait_handle ); + ret = wine_server_call( req ); + } + SERVER_END_REQ; + } + + if (!ret && ret_count) *ret_count = count; return ret; } diff --git a/server/protocol.def b/server/protocol.def index 93c81554c01f..f5618c09b44b 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1268,9 +1268,11 @@ struct obj_locator /* Suspend a thread */ @REQ(suspend_thread) - obj_handle_t handle; /* thread handle */ + obj_handle_t handle; /* thread handle */ + obj_handle_t waited_handle; /* handle waited on */ @REPLY - int count; /* new suspend count */ + int count; /* new suspend count */ + obj_handle_t wait_handle; /* handle to wait on */ @END diff --git a/server/thread.c b/server/thread.c index cd88e147f66c..48cb83cb62c3 100644 --- a/server/thread.c +++ b/server/thread.c @@ -1737,12 +1737,32 @@ DECL_HANDLER(suspend_thread) { struct thread *thread; - if ((thread = get_thread_from_handle( req->handle, THREAD_SUSPEND_RESUME ))) + if (req->waited_handle) { - if (thread->state == TERMINATED) set_error( STATUS_ACCESS_DENIED ); - else reply->count = suspend_thread( thread ); - release_object( thread ); + struct context *context; + + if (!(context = (struct context *)get_handle_obj( current->process, req->waited_handle, + 0, &context_ops ))) + return; + close_handle( current->process, req->waited_handle ); /* avoid extra server call */ + set_error( context->status ); + release_object( context ); + return; } + + if (!(thread = get_thread_from_handle( req->handle, THREAD_SUSPEND_RESUME ))) return; + + if (thread->state != RUNNING) set_error( STATUS_ACCESS_DENIED ); + else + { + reply->count = suspend_thread( thread ); + if (!get_error() && thread != current && thread->context && thread->context->status == STATUS_PENDING) + { + set_error( STATUS_PENDING ); + reply->wait_handle = alloc_handle( current->process, thread->context, SYNCHRONIZE, 0 ); + } + } + release_object( thread ); } /* resume a thread */ From 46011e761cbe42bb97d180965ee53cb591a503ae Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 25 Mar 2024 16:21:46 -0600 Subject: [PATCH 0799/2542] windows.perception.stub: HACK: Set WS_EX_NOACTIVATE for window in holographicspace_interop_CreateForWindow(). CW-Bug-Id: #23614 --- dlls/windows.perception.stub/Makefile.in | 2 +- dlls/windows.perception.stub/holographicspace.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/windows.perception.stub/Makefile.in b/dlls/windows.perception.stub/Makefile.in index 18c90e697c41..9583b64bb89d 100644 --- a/dlls/windows.perception.stub/Makefile.in +++ b/dlls/windows.perception.stub/Makefile.in @@ -1,5 +1,5 @@ MODULE = windows.perception.stub.dll -IMPORTS = combase +IMPORTS = combase user32 SOURCES = \ classes.idl \ diff --git a/dlls/windows.perception.stub/holographicspace.c b/dlls/windows.perception.stub/holographicspace.c index 53e6be0e7129..f51be10a9c17 100644 --- a/dlls/windows.perception.stub/holographicspace.c +++ b/dlls/windows.perception.stub/holographicspace.c @@ -208,6 +208,9 @@ static HRESULT WINAPI holographicspace_interop_CreateForWindow( IHolographicSpac { FIXME( "iface %p, window %p, iid %s, holographic_space %p.\n", iface, window, debugstr_guid( iid ), holographic_space ); + FIXME( "HACK: Setting WS_EX_NOACTIVATE for %p.\n", window ); + SetWindowLongW( window, GWL_EXSTYLE, WS_EX_NOACTIVATE ); + *holographic_space = NULL; return E_NOTIMPL; } From 64de4a55cf13e6e2e916ccbc498aeff4ad5f0ddf Mon Sep 17 00:00:00 2001 From: Renato Pereyra Date: Thu, 7 Mar 2024 11:32:29 -0600 Subject: [PATCH 0800/2542] winex11.drv: Apply the GL vendor override for Intel GPUs too https://github.com/ValveSoftware/wine/pull/222 The vendor override forces wine to report an AMD GPU. Previously, the vendor override only applied for NVIDIA GPUs. Also, rename WINE_GL_HIDE_NVIDIA to WINE_GL_VENDOR_REPORT_AMD. More info: https://github.com/ValveSoftware/Proton/issues/7529 --- dlls/winex11.drv/opengl.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index cd6aa61d6cba..5428882751a4 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -3279,7 +3279,7 @@ static const GLubyte *wglGetString(GLenum name) int sz; override_vendor = 0; - if ((env = getenv("WINE_GL_HIDE_NVIDIA"))) + if ((env = getenv("WINE_GL_VENDOR_REPORT_AMD"))) { override_vendor = env[0] != '0'; } @@ -3307,13 +3307,19 @@ static const GLubyte *wglGetString(GLenum name) if (name == GL_RENDERER) { s = pglGetString(name); - if (s && strstr((const char *)s, "NVIDIA")) return (const GLubyte *)"AMD Radeon Graphics"; + if (s && (strstr((const char *)s, "NVIDIA") || strstr((const char *)s, "Intel"))) + { + return (const GLubyte *)"AMD Radeon Graphics"; + } return s; } else if (name == GL_VENDOR) { s = pglGetString(name); - if (s && strstr((const char *)s, "NVIDIA")) return (const GLubyte *)"AMD"; + if (s && (strstr((const char *)s, "NVIDIA") || strstr((const char *)s, "Intel"))) + { + return (const GLubyte *)"AMD"; + } return s; } } From 2dda5c48b1670b883de3e2dbbd141c1ab3bf9317 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 30 Apr 2024 14:14:23 -0600 Subject: [PATCH 0801/2542] kernelbase: HACK: Force angle d3d9 for Antenna. CW-Bug-Id: #23739 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index df7f2539065c..04e9321bff3a 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -592,6 +592,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) } options[] = { + {L"antenna\\antenna.exe", L" --use-angle=d3d9"}, {L"Bloody Walls\\game.exe", L" --disable_direct_composition=1"}, {L"Insanitys Blade\\nw.exe", L" --use-gl=swiftshader"}, {L"Warhammer2.exe", L" --in-process-gpu"}, From c9a4f59fccbbdcac09d47c8484a835bf61bd3037 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 30 Apr 2024 14:17:26 -0600 Subject: [PATCH 0802/2542] kernelbase: HACK: Force angle d3d9 for A Raven Monologue. CW-Bug-Id: #23740 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 04e9321bff3a..7e7b78c08fe6 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -592,6 +592,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) } options[] = { + {L"A Raven Monologue.exe", L" --use-angle=d3d9"}, {L"antenna\\antenna.exe", L" --use-angle=d3d9"}, {L"Bloody Walls\\game.exe", L" --disable_direct_composition=1"}, {L"Insanitys Blade\\nw.exe", L" --use-gl=swiftshader"}, From 66b407666376f37169c73f10c5626d0fc0d5b51a Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 6 May 2024 19:39:15 -0600 Subject: [PATCH 0803/2542] kernelbase: HACK: Force angle d3d9 for Alpha League. CW-Bug-Id: #23761 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 7e7b78c08fe6..ac7096a4dd54 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -614,6 +614,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) {L"Everquest F2P\\LaunchPad.exe", L" --use-gl=swiftshader"}, {L"Red Tie Runner.exe", L" --use-angle=gl"}, {L"UnrealCEFSubProcess.exe", L" --use-gl=swiftshader", "2316580"}, + {L"UnrealCEFSubProcess.exe", L" --use-angle=d3d9", "2684500"}, {L"\\EACefSubProcess.exe", L" --use-angle=vulkan"}, }; unsigned int i; From 8cd3271cf5d9744856d135160f0cf0ee9cc4900a Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Wed, 3 Apr 2024 10:35:29 +0800 Subject: [PATCH 0804/2542] HACK: ntdll: Enable WINE_SIMULATE_WRITECOPY for Hentai Maid Memories. CW-Bug-Id: #23637 --- dlls/ntdll/unix/loader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 5015ac0ab031..79ec1b98b670 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2204,7 +2204,8 @@ static void hacks_init(void) || !strcmp(sgi, "2053940") /* Idol Hands 2 */ || !strcmp(sgi, "391150") /* Red Tie Runner */ || !strcmp(sgi, "2152990") /* Dinogen Online */ - || !strcmp(sgi, "2176450"); /* Mr. Hopp's Playhouse 3 */ + || !strcmp(sgi, "2176450") /* Mr. Hopp's Playhouse 3 */ + || !strcmp(sgi, "2361360"); /* Hentai Maid Memories */ if (sgi) wine_allocs_2g_limit = !strcmp(sgi, "359870"); if (wine_allocs_2g_limit) ERR("Allocation 2g limit enabled.\n"); From b04af2fdad75aa3f9424724b6f481d21dcb74b9b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 6 May 2024 19:43:24 -0600 Subject: [PATCH 0805/2542] ntdll: HACK: Enable WINE_SIMULATE_WRITECOPY for Lovey-Dovey Lockdown. CW-Bug-Id: #23763 --- dlls/ntdll/unix/loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 79ec1b98b670..6b06ca881fd6 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2205,6 +2205,7 @@ static void hacks_init(void) || !strcmp(sgi, "391150") /* Red Tie Runner */ || !strcmp(sgi, "2152990") /* Dinogen Online */ || !strcmp(sgi, "2176450") /* Mr. Hopp's Playhouse 3 */ + || !strcmp(sgi, "2329630") /* Lovey-Dovey Lockdown */ || !strcmp(sgi, "2361360"); /* Hentai Maid Memories */ if (sgi) wine_allocs_2g_limit = !strcmp(sgi, "359870"); From a2f09cae96c0913de0c421b4adab6f9a91c05e54 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 23 Jan 2024 21:23:02 -0600 Subject: [PATCH 0806/2542] ntdll: HACK: Substitute different d3dcompiler version for BDO. CW-Bug-Id: #23314 --- dlls/ntdll/loader.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 40dd47acc30d..1b1c4d2d0395 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -3363,6 +3363,21 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, UNI return status; } +static void substitute_dll( const WCHAR **libname ) +{ + static int substitute = -1; + + if (substitute == -1) + { + WCHAR env_str[32]; + + if ((substitute = (get_env( L"SteamGameId", env_str, sizeof(env_str)) && !wcsicmp( env_str, L"582660" )))) + FIXME( "HACK: substituting dll name.\n" ); + } + if (!substitute) return; + if (*libname && !wcsicmp( *libname, L"d3dcompiler_46.dll" )) + *libname = L"d3dcompiler_43.dll"; +} /*********************************************************************** * load_dll (internal) @@ -3381,6 +3396,8 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, DWORD fl TRACE( "looking for %s in %s\n", debugstr_w(libname), debugstr_w(load_path) ); + substitute_dll( &libname ); + if (system && system_dll_path.Buffer) nts = search_dll_file( system_dll_path.Buffer, libname, &nt_name, pwm, &mapping, &image_info, &id ); From 933726fe555f7602b70e82fa4f64755e299133ed Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 15 May 2024 17:22:13 -0600 Subject: [PATCH 0807/2542] winex11.drv: HACK: Reduce SM_CYCAPTION on low resolutions. CW-Bug-Id: #23802 --- dlls/winex11.drv/x11drv_main.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 750f8e9fad74..a901d4a68ebe 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -760,6 +760,23 @@ static NTSTATUS x11drv_init( void *arg ) if (use_xim) use_xim = xim_init( input_style ); init_user_driver(); + + { + RECT rect = NtUserGetVirtualScreenRect( MDT_DEFAULT ); + + if (rect.bottom <= 800) + { + NONCLIENTMETRICSW ncm; + + ncm.cbSize = sizeof(ncm); + if (NtUserSystemParametersInfo( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ) && ncm.iCaptionHeight > 18) + { + TRACE( "Reducing iCaptionHeight from %d to 17.\n", ncm.iCaptionHeight ); + ncm.iCaptionHeight = 17; + NtUserSystemParametersInfo( SPI_SETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0); + } + } + } return STATUS_SUCCESS; } From 9903bbb12dfa3c1b1b1ebbf46f0ccb0f96c0f0f5 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 21 May 2024 19:43:54 -0600 Subject: [PATCH 0808/2542] pdh: Add stub for PdhGetFormattedCounterArray(). CW-Bug-Id: #23849 --- dlls/pdh/pdh.spec | 4 ++-- dlls/pdh/pdh_main.c | 20 ++++++++++++++++++++ include/pdh.h | 12 ++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/dlls/pdh/pdh.spec b/dlls/pdh/pdh.spec index 3d51f6257ef3..854b80043997 100644 --- a/dlls/pdh/pdh.spec +++ b/dlls/pdh/pdh.spec @@ -58,8 +58,8 @@ @ stub PdhGetDefaultPerfObjectHW @ stub PdhGetDefaultPerfObjectW @ stdcall PdhGetDllVersion(ptr) -@ stub PdhGetFormattedCounterArrayA -@ stub PdhGetFormattedCounterArrayW +@ stdcall PdhGetFormattedCounterArrayA(ptr long ptr ptr ptr) +@ stdcall PdhGetFormattedCounterArrayW(ptr long ptr ptr ptr) @ stdcall PdhGetFormattedCounterValue(ptr long ptr ptr) @ stub PdhGetLogFileSize @ stdcall PdhGetLogFileTypeA(str ptr) diff --git a/dlls/pdh/pdh_main.c b/dlls/pdh/pdh_main.c index dec86a9962b8..f915f509177f 100644 --- a/dlls/pdh/pdh_main.c +++ b/dlls/pdh/pdh_main.c @@ -793,6 +793,26 @@ PDH_STATUS WINAPI PdhGetRawCounterValue( PDH_HCOUNTER handle, LPDWORD type, return ERROR_SUCCESS; } +PDH_STATUS WINAPI PdhGetFormattedCounterArrayW( PDH_HCOUNTER handle, DWORD format, DWORD *size, DWORD *count, + PDH_FMT_COUNTERVALUE_ITEM_W *buffer) +{ + FIXME( "%p %lu %p %p %p stub.\n", handle, format, size, count, buffer ); + + *size = 0; + *count = 0; + return ERROR_SUCCESS; +} + +PDH_STATUS WINAPI PdhGetFormattedCounterArrayA( PDH_HCOUNTER handle, DWORD format, DWORD *size, DWORD *count, + PDH_FMT_COUNTERVALUE_ITEM_A *buffer) +{ + FIXME( "%p %lu %p %p %p stub.\n", handle, format, size, count, buffer ); + + *size = 0; + *count = 0; + return ERROR_SUCCESS; +} + /*********************************************************************** * PdhLookupPerfIndexByNameA (PDH.@) */ diff --git a/include/pdh.h b/include/pdh.h index 3d688bd8ded7..5a6d89e91c9c 100644 --- a/include/pdh.h +++ b/include/pdh.h @@ -189,6 +189,18 @@ typedef struct _PDH_COUNTER_INFO_W DWORD DataBuffer[1]; } PDH_COUNTER_INFO_W, *PPDH_COUNTER_INFO_W; +typedef struct _PDH_FMT_COUNTERVALUE_ITEM_A +{ + LPSTR szName; + PDH_FMT_COUNTERVALUE FmtValue; +} PDH_FMT_COUNTERVALUE_ITEM_A, *PPDH_FMT_COUNTERVALUE_ITEM_A; + +typedef struct _PDH_FMT_COUNTERVALUE_ITEM_W +{ + LPWSTR szName; + PDH_FMT_COUNTERVALUE FmtValue; +} PDH_FMT_COUNTERVALUE_ITEM_W, *PPDH_FMT_COUNTERVALUE_ITEM_W; + DECL_PDH_TYPE_AW(PDH_COUNTER_INFO) DECL_PDH_TYPE_AW(PPDH_COUNTER_INFO) From d58991d12cdff40057f424a3701ad9e9e4c1f3d6 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 23 May 2024 22:45:49 -0600 Subject: [PATCH 0809/2542] win32u: HACK: Hide a window for Syberia. Until it is possible to properly implement exclusive fullscreen ddraw mode. CW-Bug-Id: #23858 --- dlls/win32u/window.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index e700f6311d60..6e6e758f9a97 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -474,6 +474,17 @@ HWND WINAPI NtUserSetParent( HWND hwnd, HWND parent ) set_window_pos( &winpos, new_screen_rect.left - old_screen_rect.left, new_screen_rect.top - old_screen_rect.top ); + { + WCHAR name[32]; + UNICODE_STRING us = { 0, sizeof(name), name }; + + if (NtUserGetClassName( hwnd, FALSE, &us ) && !wcscmp( us.Buffer, u"SyberiaRenderWindowClass" )) + { + ERR( "HACK: Hiding window.\n" ); + was_visible = FALSE; + } + } + if (was_visible) NtUserShowWindow( hwnd, SW_SHOW ); set_thread_dpi_awareness_context( context ); From ae080ea3c897e4305e2fcd115043d9679764d39c Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 19 Jun 2024 15:59:10 -0600 Subject: [PATCH 0810/2542] dcomp: HACK: Try to workaround Chromium race fixed by Chromium commit 1c13c9105b40e8. CW-Bug-Id: #23945 --- dlls/dcomp/device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/dcomp/device.c b/dlls/dcomp/device.c index 2744d758e918..d0eb920968a6 100644 --- a/dlls/dcomp/device.c +++ b/dlls/dcomp/device.c @@ -36,6 +36,9 @@ HRESULT WINAPI DCompositionCreateDevice2(IUnknown *rendering_device, REFIID iid, { FIXME("%p, %s, %p.\n", rendering_device, debugstr_guid(iid), device); + /* Try to workaround Chromium race fixed by Chromium commit 1c13c9105b40e83f87ebcad104fab57fcef43eb9. */ + Sleep(50); + return E_NOTIMPL; } From 4e57bb839293454c344370530de092eb3152f149 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 21 Jun 2024 15:16:41 -0600 Subject: [PATCH 0811/2542] kernelbase: Don't call NtFlushInstructionCache() in FlushInstructionCache(). CW-Bug-Id: #23951 --- dlls/kernelbase/memory.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/dlls/kernelbase/memory.c b/dlls/kernelbase/memory.c index 0be178f6ab76..e102345119ab 100644 --- a/dlls/kernelbase/memory.c +++ b/dlls/kernelbase/memory.c @@ -121,11 +121,17 @@ BOOL WINAPI DECLSPEC_HOTPATCH FlushViewOfFile( const void *base, SIZE_T size ) return set_ntstatus( status ); } - /**************************************************************************** * FlushInstructionCache (kernelbase.@) */ +#if defined(__i386__) || defined(__x86_64__) BOOL WINAPI DECLSPEC_HOTPATCH FlushInstructionCache( HANDLE process, LPCVOID addr, SIZE_T size ) +{ + /* X86 processors have coherent instruction and data caches, no need to do anything */ + return TRUE; +} +#else +static BOOL flush_instruction_cache( HANDLE process, LPCVOID addr, SIZE_T size ) { CROSS_PROCESS_WORK_LIST *list; @@ -137,6 +143,28 @@ BOOL WINAPI DECLSPEC_HOTPATCH FlushInstructionCache( HANDLE process, LPCVOID add return set_ntstatus( NtFlushInstructionCache( process, addr, size )); } +#ifdef __arm64ec__ +/* Wrapper that preserves RDX/X0 */ +BOOL WINAPI __attribute__((naked)) FlushInstructionCache( HANDLE process, LPCVOID addr, SIZE_T size ) +{ + asm( ".seh_proc \"#FlushInstructionCache\"\n\t" + "stp x29, x30, [sp, #-32]!\n\t" + "str x1, [sp, #16]\n\t" + ".seh_save_fplr_x 32\n\t" + ".seh_endprologue\n\t" + "bl \"#flush_instruction_cache\"\n\t" + "ldr x1, [sp, #16]\n\t" + "ldp x29, x30, [sp], #32\n\t" + "ret\n\t" + ".seh_endproc" ); +} +#else +BOOL WINAPI DECLSPEC_HOTPATCH FlushInstructionCache( HANDLE process, LPCVOID addr, SIZE_T size ) +{ + return flush_instruction_cache( process, addr, size ); +} +#endif +#endif /*********************************************************************** * GetLargePageMinimum (kernelbase.@) From c91b7580d9d1c765841b9e50aa9d52bcd03912fb Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 1 Jul 2024 20:27:30 -0600 Subject: [PATCH 0812/2542] kernelbase: HACK: Force disable direct composition for Super. CW-Bug-Id: #23959 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index ac7096a4dd54..2f7e203b21a1 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -592,6 +592,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) } options[] = { + {L"Super\\Super.exe", L" --disable_direct_composition=1"}, {L"A Raven Monologue.exe", L" --use-angle=d3d9"}, {L"antenna\\antenna.exe", L" --use-angle=d3d9"}, {L"Bloody Walls\\game.exe", L" --disable_direct_composition=1"}, From 431e18f84266508f49cf37e360c2ef969ae74a29 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 1 Jul 2024 20:29:00 -0600 Subject: [PATCH 0813/2542] winex11.drv: Sync window position when maximizing window on Gamescope. CW-Bug-Id: #23959 --- dlls/winex11.drv/window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 82478e79db49..499f883b68fe 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -3030,7 +3030,8 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UIN } /* don't change position if we are about to minimize or maximize a managed window */ - if (!(data->managed && (swp_flags & SWP_STATECHANGED) && (new_style & (WS_MINIMIZE|WS_MAXIMIZE)))) + if (!(data->managed && (swp_flags & SWP_STATECHANGED) && (new_style & (WS_MINIMIZE|WS_MAXIMIZE))) + || (!(new_style & WS_MINIMIZE) && X11DRV_HasWindowManager( "steamcompmgr" ))) { sync_window_position( data, swp_flags, &old_rects ); #ifdef HAVE_LIBXSHAPE From d76866470bc03457bf8c6e91e2f02396e97ad2f6 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 3 Jul 2024 19:30:46 -0600 Subject: [PATCH 0814/2542] HACK: ntdll: Fixup OptionalHeader.ImageBase back in steamclient.dll. CW-Bug-Id: #23139 --- dlls/ntdll/loader.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 1b1c4d2d0395..200b40e53491 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2251,6 +2251,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name, SIZE_T map_size; WCHAR *basename, *tmp; ULONG basename_len; + BOOL is_steamclient32; if (!(nt = RtlImageNtHeader( *module ))) return STATUS_INVALID_IMAGE_FORMAT; @@ -2277,7 +2278,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name, basename_len = wcslen(basename); if (basename_len >= 4 && !wcscmp(basename + basename_len - 4, L".dll")) basename_len -= 4; - if (use_lsteamclient() && (!RtlCompareUnicodeStrings(basename, basename_len, L"steamclient", 11, TRUE) || + if (use_lsteamclient() && ((is_steamclient32 = !RtlCompareUnicodeStrings(basename, basename_len, L"steamclient", 11, TRUE)) || !RtlCompareUnicodeStrings(basename, basename_len, L"steamclient64", 13, TRUE) || !RtlCompareUnicodeStrings(basename, basename_len, L"gameoverlayrenderer", 19, TRUE) || !RtlCompareUnicodeStrings(basename, basename_len, L"gameoverlayrenderer64", 21, TRUE)) && @@ -2288,6 +2289,31 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name, WINE_UNIX_CALL( unix_steamclient_setup_trampolines, ¶ms ); wm->ldr.Flags |= LDR_DONT_RESOLVE_REFS; flags |= DONT_RESOLVE_DLL_REFERENCES; + if (is_steamclient32) + { + OBJECT_ATTRIBUTES attr; + void *addr = *module; + SIZE_T size = 0x1000; + LARGE_INTEGER offset; + IO_STATUS_BLOCK io; + DWORD protect_old; + HANDLE file; + + NtProtectVirtualMemory( NtCurrentProcess(), &addr, &size, PAGE_READWRITE, &protect_old ); + memset( &attr, 0, sizeof(attr) ); + attr.Length = sizeof(attr); + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.ObjectName = (UNICODE_STRING *)nt_name; + NtOpenFile( &file, GENERIC_READ | SYNCHRONIZE, &attr, &io, + FILE_SHARE_READ | FILE_SHARE_DELETE, + FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE ); + offset.QuadPart = (ULONG_PTR)&nt->OptionalHeader.ImageBase - (ULONG_PTR)addr; + NtReadFile( file, 0, NULL, NULL, &io, &nt->OptionalHeader.ImageBase, + sizeof(nt->OptionalHeader.ImageBase), &offset, NULL ); + NtClose( file ); + TRACE( "steamclient ImageBase %#Ix.\n", nt->OptionalHeader.ImageBase ); + NtProtectVirtualMemory( NtCurrentProcess(), &addr, &size, protect_old, &protect_old ); + } } /* fixup imports */ From 40af052fe02c8ede492823853edfb96b5fc87f0d Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 28 Aug 2024 11:58:36 -0600 Subject: [PATCH 0815/2542] ntdll: HACK: Partially fixup imports for Win Steam libs. CW-Bug-Id: #24174 --- dlls/ntdll/loader.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 200b40e53491..a6fdf00c72bd 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1141,6 +1141,14 @@ static BOOL import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *descr, LP return TRUE; } + if ((!strcmp(name, "tier0_s64.dll") || !strcmp(name, "vstdlib_s64.dll")) && current_modref->ldr.BaseDllName.Buffer + && (!wcscmp(current_modref->ldr.BaseDllName.Buffer, L"steamclient64.dll") + || !wcscmp(current_modref->ldr.BaseDllName.Buffer, L"gameoverlayrenderer64.dll"))) + { + TRACE("%s -> ntdll.\n", name); + name = "ntdll.dll"; + } + status = build_import_name( buffer, name, len ); if (!status) status = load_dll( load_path, buffer, 0, &wmImp, system ); @@ -2314,6 +2322,11 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name, TRACE( "steamclient ImageBase %#Ix.\n", nt->OptionalHeader.ImageBase ); NtProtectVirtualMemory( NtCurrentProcess(), &addr, &size, protect_old, &protect_old ); } + else + { + fixup_imports( wm, load_path ); + wm->ldr.Flags |= LDR_DONT_RESOLVE_REFS; + } } /* fixup imports */ From f000f897b380d88697c85375b8fa456f57db2130 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 12 Jul 2024 15:06:05 -0600 Subject: [PATCH 0816/2542] server: Renamed KEY_WOWSHARE constant to KEY_WOWREFLECT. CW-Bug-Id: #24021 --- server/registry.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/registry.c b/server/registry.c index f733d3748822..1eda5d8725bb 100644 --- a/server/registry.c +++ b/server/registry.c @@ -98,7 +98,7 @@ struct key #define KEY_DELETED 0x0002 /* key has been deleted */ #define KEY_DIRTY 0x0004 /* key has been modified */ #define KEY_SYMLINK 0x0008 /* key is a symbolic link */ -#define KEY_WOWSHARE 0x0010 /* key is a Wow64 shared key (used for Software\Classes) */ +#define KEY_WOWREFLECT 0x0010 /* key is a Wow64 shared and reflected key (used for Software\Classes) */ #define KEY_PREDEF 0x0020 /* key is marked as predefined */ #define OBJ_KEY_WOW64 0x100000 /* magic flag added to attributes for WoW64 redirection */ @@ -520,7 +520,7 @@ static struct object *key_lookup_name( struct object *obj, struct unicode_str *n } key = (struct key *)obj; - if (key && (key->flags & KEY_WOWSHARE) && (attr & OBJ_KEY_WOW64) && !name->str) + if (key && (key->flags & KEY_WOWREFLECT) && (attr & OBJ_KEY_WOW64) && !name->str) { key = get_parent( key ); release_object( obj ); @@ -547,7 +547,7 @@ static struct object *key_lookup_name( struct object *obj, struct unicode_str *n if (!(found = find_subkey( key, &tmp, &index ))) { - if ((key->flags & KEY_WOWSHARE) && (attr & OBJ_KEY_WOW64)) + if ((key->flags & KEY_WOWREFLECT) && (attr & OBJ_KEY_WOW64)) { /* try in the 64-bit parent */ key = get_parent( key ); @@ -782,7 +782,7 @@ static struct key *grab_wow6432node( struct key *key ) struct key *ret = key->wow6432node; if (!ret) return key; - if (ret->flags & KEY_WOWSHARE) return key; + if (ret->flags & KEY_WOWREFLECT) return key; grab_object( ret ); release_object( key ); return ret; @@ -828,7 +828,7 @@ static struct key *open_key( struct key *parent, const struct unicode_str *name, if (parent && !(access & KEY_WOW64_64KEY) && !is_wow6432node( name->str, name->len )) { key = get_wow6432node( parent ); - if (key && ((access & KEY_WOW64_32KEY) || (key->flags & KEY_WOWSHARE))) + if (key && ((access & KEY_WOW64_32KEY) || (key->flags & KEY_WOWREFLECT))) parent = key; } @@ -854,7 +854,7 @@ static struct key *create_key( struct key *parent, const struct unicode_str *nam if (parent && !(access & KEY_WOW64_64KEY) && !is_wow6432node( name->str, name->len )) { key = get_wow6432node( parent ); - if (key && ((access & KEY_WOW64_32KEY) || (key->flags & KEY_WOWSHARE))) + if (key && ((access & KEY_WOW64_32KEY) || (key->flags & KEY_WOWREFLECT))) parent = key; } @@ -1973,7 +1973,7 @@ void init_registry(void) } if ((key = create_key_recursive( hklm, &name, current_time ))) { - key->flags |= KEY_WOWSHARE; + key->flags |= KEY_WOWREFLECT; release_object( key ); } /* FIXME: handle HKCU too */ From b5dda860f77a8e1bdf31daf5c67bf469d0446528 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 11 Jul 2024 19:10:31 -0600 Subject: [PATCH 0817/2542] server: Force WoW sharing on HKCU/Software key. CW-Bug-Id: #24021 --- server/registry.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/server/registry.c b/server/registry.c index 1eda5d8725bb..4c683440fea9 100644 --- a/server/registry.c +++ b/server/registry.c @@ -100,6 +100,7 @@ struct key #define KEY_SYMLINK 0x0008 /* key is a symbolic link */ #define KEY_WOWREFLECT 0x0010 /* key is a Wow64 shared and reflected key (used for Software\Classes) */ #define KEY_PREDEF 0x0020 /* key is marked as predefined */ +#define KEY_WOWSHARE 0x0040 /* key is Wow64 shared */ #define OBJ_KEY_WOW64 0x100000 /* magic flag added to attributes for WoW64 redirection */ @@ -606,7 +607,7 @@ static int key_link_name( struct object *obj, struct object_name *name, struct o for (i = ++parent_key->last_subkey; i > index; i--) parent_key->subkeys[i] = parent_key->subkeys[i - 1]; parent_key->subkeys[index] = (struct key *)grab_object( key ); - if (is_wow6432node( name->name, name->len ) && + if (!(parent_key->flags & KEY_WOWSHARE) && is_wow6432node( name->name, name->len ) && !is_wow6432node( parent_key->obj.name->name, parent_key->obj.name->len )) parent_key->wow6432node = key; name->parent = parent; @@ -1897,6 +1898,7 @@ void init_registry(void) 'M','a','c','h','i','n','e','\\', 'S','y','s','t','e','m','\\', 'C','o','n','t','r','o','l','S','e','t','0','0','1'}; + static const WCHAR software[] = {'S','o','f','t','w','a','r','e',}; static const struct unicode_str root_name = { REGISTRY, sizeof(REGISTRY) }; static const struct unicode_str HKLM_name = { HKLM, sizeof(HKLM) }; static const struct unicode_str HKU_name = { HKU_default, sizeof(HKU_default) }; @@ -1904,7 +1906,7 @@ void init_registry(void) static const struct unicode_str controlset_name = { controlset, sizeof(controlset) }; WCHAR *current_user_path; - struct unicode_str current_user_str; + struct unicode_str current_user_str, name; struct key *key, *hklm, *hkcu; unsigned int i; char *p; @@ -1963,8 +1965,6 @@ void init_registry(void) /* set the shared flag on Software\Classes\Wow6432Node for all platforms */ for (i = 1; i < supported_machines_count; i++) { - struct unicode_str name; - switch (supported_machines[i]) { case IMAGE_FILE_MACHINE_I386: name.str = classes_i386; name.len = sizeof(classes_i386); break; @@ -1976,7 +1976,15 @@ void init_registry(void) key->flags |= KEY_WOWREFLECT; release_object( key ); } - /* FIXME: handle HKCU too */ + } + + name.str = software; + name.len = sizeof(software); + if ((key = create_key_recursive( hkcu, &name, current_time ))) + { + key->flags |= KEY_WOWSHARE; + key->wow6432node = NULL; + release_object( key ); } if ((key = create_key_recursive( hklm, &perflib_name, current_time ))) From 0dd371019dc2723e65dac4e7d160c52f13b207ed Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 12 Jul 2024 16:27:35 -0600 Subject: [PATCH 0818/2542] kernelbase: Factor out get_key_name(). CW-Bug-Id: #24021 --- dlls/kernelbase/registry.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/dlls/kernelbase/registry.c b/dlls/kernelbase/registry.c index 6b9041e17b93..a1025bdd5d72 100644 --- a/dlls/kernelbase/registry.c +++ b/dlls/kernelbase/registry.c @@ -112,20 +112,15 @@ static BOOL is_classes_root( const UNICODE_STRING *name ) return (len >= classes_root_len - 1 && !wcsnicmp( name->Buffer, classes_root, min( len, classes_root_len ) )); } -static BOOL is_classes_wow6432node( HKEY key ) +static KEY_NAME_INFORMATION *get_key_name( HKEY key, char *buffer, DWORD len ) { - char buffer[256], *buf_ptr = buffer; + char *buf_ptr = buffer; KEY_NAME_INFORMATION *info = (KEY_NAME_INFORMATION *)buffer; - DWORD len = sizeof(buffer); - UNICODE_STRING name; NTSTATUS status; - BOOL ret = FALSE; - /* Obtain the name of the root key */ - status = NtQueryKey( key, KeyNameInformation, info, len, &len ); - if (status && status != STATUS_BUFFER_OVERFLOW) return FALSE; + status = NtQueryKey( key, KeyNameInformation, buf_ptr, len, &len ); + if (status && status != STATUS_BUFFER_OVERFLOW) return NULL; - /* Retry with a dynamically allocated buffer */ while (status == STATUS_BUFFER_OVERFLOW) { if (buf_ptr != buffer) heap_free( buf_ptr ); @@ -133,9 +128,22 @@ static BOOL is_classes_wow6432node( HKEY key ) info = (KEY_NAME_INFORMATION *)buf_ptr; status = NtQueryKey( key, KeyNameInformation, info, len, &len ); } + if (!status) return (KEY_NAME_INFORMATION *)buf_ptr; + if (buf_ptr != buffer) heap_free( buf_ptr ); + return NULL; +} + +static BOOL is_classes_wow6432node( HKEY key ) +{ + KEY_NAME_INFORMATION *info; + char buffer[256]; + UNICODE_STRING name; + BOOL ret = FALSE; + + if (!(info = get_key_name( key, buffer, sizeof(buffer) ))) return FALSE; /* Check if the key ends in Wow6432Node and if the root is the Classes key*/ - if (!status && info->NameLength / sizeof(WCHAR) >= 11) + if (info->NameLength / sizeof(WCHAR) >= 11) { name.Buffer = info->Name + info->NameLength / sizeof(WCHAR) - 11; name.Length = 11 * sizeof(WCHAR); @@ -146,8 +154,7 @@ static BOOL is_classes_wow6432node( HKEY key ) ret = is_classes_root( &name ); } } - - if (buf_ptr != buffer) heap_free( buf_ptr ); + if ((char *)info != buffer) heap_free( info ); return ret; } From d18ba64e06b869073e03ae535a03ec73080477fa Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 12 Jul 2024 16:21:45 -0600 Subject: [PATCH 0819/2542] kernelbase: Force WoW sharing on HKCU/Software key. CW-Bug-Id: #24021 --- dlls/kernelbase/registry.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/dlls/kernelbase/registry.c b/dlls/kernelbase/registry.c index a1025bdd5d72..7e9c2db72fb0 100644 --- a/dlls/kernelbase/registry.c +++ b/dlls/kernelbase/registry.c @@ -159,6 +159,37 @@ static BOOL is_classes_wow6432node( HKEY key ) return ret; } +static BOOL is_wow6432_shared( HANDLE key ) +{ + static const WCHAR users_root[] = L"\\Registry\\User\\"; + const DWORD users_root_len = ARRAY_SIZE( users_root ) - 1; + static const WCHAR software[] = L"\\Software"; + const DWORD software_len = ARRAY_SIZE( software ) - 1; + KEY_NAME_INFORMATION *info; + char buffer[256]; + BOOL ret = FALSE; + WCHAR *name; + DWORD len; + + info = get_key_name( key, buffer, sizeof(buffer) ); + len = info->NameLength / sizeof(WCHAR); + if (len <= users_root_len) goto done; + name = info->Name; + if (wcsnicmp( name, users_root, users_root_len )) goto done; + name += users_root_len; + len -= users_root_len; + while (len && *name != '\\') + { + ++name; + --len; + } + if (len != software_len) goto done; + ret = !wcsnicmp( name, software, software_len ); +done: + if ((char *)info != buffer) heap_free( info ); + return ret; +} + /* Open the Wow6432Node subkey of the specified key */ static HANDLE open_wow6432node( HANDLE key ) { @@ -173,6 +204,11 @@ static HANDLE open_wow6432node( HANDLE key ) attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; if (NtOpenKeyEx( &ret, MAXIMUM_ALLOWED | KEY_WOW64_64KEY, &attr, 0 )) return key; + if (is_wow6432_shared( key )) + { + NtClose( ret ); + return key; + } return ret; } From a4e15f4295c7118e152e81ef20ca4128583494d2 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 12 Jul 2024 17:01:23 -0600 Subject: [PATCH 0820/2542] advapi32/tests: Add tests for WoW shared HKCU/Software key. CW-Bug-Id: #24021 --- dlls/advapi32/tests/registry.c | 72 ++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index cc9c0bff2c67..119e287c5db8 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -3378,6 +3378,78 @@ static void test_redirection(void) RegDeleteKeyA( key32, "" ); RegCloseKey( key32 ); + + /* HKCU\\Software is shared. */ + err = RegCreateKeyExA( HKEY_CURRENT_USER, "Software\\Wow6432Node\\tmp", 0, NULL, 0, KEY_ALL_ACCESS | KEY_WOW64_32KEY, NULL, &key, NULL ); + ok( !err, "got %#lx.\n", err ); + RegDeleteKeyA( key, "" ); + RegCloseKey( key ); + + err = RegCreateKeyExA( HKEY_CURRENT_USER, "Software\\TestKey", 0, NULL, 0, KEY_ALL_ACCESS | KEY_WOW64_32KEY, NULL, &root64, NULL ); + ok( !err, "got %#lx.\n", err ); + err = RegOpenKeyExA( HKEY_CURRENT_USER, "Software\\Wow6432Node\\TestKey", 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, &root32 ); + ok ( err == ERROR_FILE_NOT_FOUND, "got %#lx.\n", err ); + + err = RegCreateKeyExA( HKEY_CURRENT_USER, "Software\\Wow6432Node\\TestKey", 0, NULL, 0, KEY_ALL_ACCESS | KEY_WOW64_32KEY, NULL, &root32, NULL ); + ok( !err, "got %#lx.\n", err ); + + dw = 1; + err = RegSetKeyValueA( root64, NULL, "val", REG_DWORD, &dw, sizeof(dw) ); + ok( !err, "got %#lx.\n", err ); + + dw = 2; + err = RegSetKeyValueA( root32, NULL, "val", REG_DWORD, &dw, sizeof(dw) ); + ok( !err, "got %#lx.\n", err ); + + err = RegCreateKeyExA( root64, "subkey", 0, NULL, 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, NULL, &key64, NULL ); + ok( !err, "got %#lx.\n", err ); + dw = 1; + err = RegSetKeyValueA( key64, NULL, "val", REG_DWORD, &dw, sizeof(dw) ); + ok( !err, "got %#lx.\n", err ); + + err = RegCreateKeyExA( root32, "subkey", 0, NULL, 0, KEY_ALL_ACCESS | KEY_WOW64_32KEY, NULL, &key32, NULL ); + ok( !err, "got %#lx.\n", err ); + dw = 2; + err = RegSetKeyValueA( key32, NULL, "val", REG_DWORD, &dw, sizeof(dw) ); + ok( !err, "got %#lx.\n", err ); + + err = RegOpenKeyExA( HKEY_CURRENT_USER, "Software\\TestKey", 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, &key ); + ok( !err, "got %#lx.\n", err ); + len = sizeof(dw); + err = RegQueryValueExA( key, "val", NULL, NULL, (BYTE *)&dw, &len ); + ok( !err, "got %#lx.\n", err ); + ok( dw == 1, "got %lu.\n", dw ); + RegCloseKey( key ); + err = RegOpenKeyExA( HKEY_CURRENT_USER, "Software\\TestKey", 0, KEY_ALL_ACCESS | KEY_WOW64_32KEY, &key ); + ok( !err, "got %#lx.\n", err ); + len = sizeof(dw); + err = RegQueryValueExA( key, "val", NULL, NULL, (BYTE *)&dw, &len ); + ok( !err, "got %#lx.\n", err ); + ok( dw == 1, "got %lu.\n", dw ); + RegCloseKey( key ); + err = RegOpenKeyExA( HKEY_CURRENT_USER, "Software\\TestKey\\subkey", 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, &key ); + ok( !err, "got %#lx.\n", err ); + len = sizeof(dw); + err = RegQueryValueExA( key, "val", NULL, NULL, (BYTE *)&dw, &len ); + ok( !err, "got %#lx.\n", err ); + ok( dw == 1, "got %lu.\n", dw ); + RegCloseKey( key ); + err = RegOpenKeyExA( HKEY_CURRENT_USER, "Software\\TestKey\\subkey", 0, KEY_ALL_ACCESS | KEY_WOW64_32KEY, &key ); + ok( !err, "got %#lx.\n", err ); + len = sizeof(dw); + err = RegQueryValueExA( key, "val", NULL, NULL, (BYTE *)&dw, &len ); + ok( !err, "got %#lx.\n", err ); + ok( dw == 1, "got %lu.\n", dw ); + RegCloseKey( key ); + + RegDeleteKeyA( key64, "" ); + RegCloseKey( key64 ); + RegDeleteKeyA( key32, "" ); + RegCloseKey( key32 ); + RegDeleteKeyA( root32, "" ); + RegCloseKey( root32 ); + RegDeleteKeyA( root64, "" ); + RegCloseKey( root64 ); } static void test_classesroot(void) From 9ae43fd3e9eb56bf0f3167a728a5bc81307e4a26 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 24 Jul 2024 14:38:58 -0600 Subject: [PATCH 0821/2542] ntdll: Partially support querying directory entries for '\\Device\\NamedPipe\\'. CW-Bug-Id: #24062 --- dlls/ntdll/tests/pipe.c | 109 ++++++++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/file.c | 55 ++++++++++++++++++++ server/named_pipe.c | 85 ++++++++++++++++++++++++++++++- server/protocol.def | 13 +++++ server/trace.c | 23 +++++++++ 5 files changed, 284 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/tests/pipe.c b/dlls/ntdll/tests/pipe.c index df693d07cbd8..f9b2958026c2 100644 --- a/dlls/ntdll/tests/pipe.c +++ b/dlls/ntdll/tests/pipe.c @@ -3131,6 +3131,114 @@ static void test_async_cancel_on_handle_close(void) CloseHandle(process_handle); } +static void test_pipe_directory_listing(void) +{ + HANDLE hdirectory, hdirectory2, hpipe; + FILE_DIRECTORY_INFORMATION *info; + DWORD length, context, size; + OBJECT_ATTRIBUTES attr; + LARGE_INTEGER timeout; + UNICODE_STRING name; + IO_STATUS_BLOCK io; + char buffer[1024]; + NTSTATUS status; + BOOL found; + + attr.Length = sizeof(attr); + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + attr.RootDirectory = 0; + attr.ObjectName = &name; + + pRtlInitUnicodeString(&name, L"\\Device\\NamedPipe\\"); + attr.RootDirectory = 0; + attr.ObjectName = &name; + + status = pNtCreateDirectoryObject(&hdirectory, GENERIC_READ | SYNCHRONIZE, &attr); + todo_wine ok(status == STATUS_OBJECT_TYPE_MISMATCH, "Got unexpected status %#lx.\n", status); + + status = NtCreateFile(&hdirectory, SYNCHRONIZE, &attr, &io, NULL, 0, + FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, 0, NULL, 0 ); + ok(!status, "got %#lx.\n", status); + status = NtQueryDirectoryFile( hdirectory, 0, NULL, NULL, &io, buffer, sizeof(buffer), + FileDirectoryInformation, TRUE, NULL, FALSE ); + ok(status == STATUS_ACCESS_DENIED, "got %#lx.\n", status); + CloseHandle( hdirectory ); + + status = NtCreateFile(&hdirectory, FILE_LIST_DIRECTORY | SYNCHRONIZE, &attr, &io, NULL, 0, + FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, 0, NULL, 0 ); + ok(!status, "got %#lx.\n", status); + + attr.RootDirectory = 0; + pRtlInitUnicodeString( &name, L"\\??\\pipe\\test_pipe" ); + timeout.QuadPart = -(LONG64)10000000; + status = pNtCreateNamedPipeFile(&hpipe, GENERIC_READ | SYNCHRONIZE, &attr, + &io, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_CREATE, FILE_SYNCHRONOUS_IO_NONALERT, + 0, 0, 0, 3, 4096, 4096, &timeout); + ok(!status, "got %#lx.\n", status); + + status = NtQueryDirectoryFile( hdirectory, 0, NULL, NULL, &io, buffer, 1, + FileDirectoryInformation, TRUE, NULL, FALSE ); + ok(status == STATUS_INFO_LENGTH_MISMATCH, "got %#lx.\n", status); + + memset( buffer, 0xcc, sizeof(buffer) ); + status = NtQueryDirectoryFile( hdirectory, 0, NULL, NULL, &io, buffer, sizeof(buffer), + FileDirectoryInformation, TRUE, NULL, FALSE ); + ok(!status, "got %#lx.\n", status); + info = (void *)buffer; + length = offsetof(FILE_DIRECTORY_INFORMATION, FileName) + info->FileNameLength; + ok( !io.Status, "got %#lx.\n", io.Status ); + ok( io.Information == length, "got %Iu, expected %lu.\n", io.Information, length ); + found = FALSE; + while (!status) + { + length = info->FileNameLength / sizeof(WCHAR); + ok(info->FileName[length] == 0xcccc, "got %#x.\n", info->FileName[length]); + if (!found && length == 9 && !wcsnicmp( L"test_pipe", info->FileName, 9 )) + found = TRUE; + memset( buffer, 0xcc, sizeof(buffer) ); + status = NtQueryDirectoryFile( hdirectory, 0, NULL, NULL, &io, buffer, sizeof(buffer), + FileDirectoryInformation, TRUE, NULL, FALSE ); + ok(!status || status == STATUS_NO_MORE_FILES, "got %#lx.\n", status); + ok( io.Status == status, "got %#lx.\n", io.Status); + } + ok( !io.Information, "got %Iu.\n", io.Information ); + ok( found, "test_pipe not found.\n" ); + status = NtQueryDirectoryFile( hdirectory, 0, NULL, NULL, &io, buffer, sizeof(buffer), + FileDirectoryInformation, TRUE, NULL, FALSE ); + ok( status == STATUS_NO_MORE_FILES, "Got unexpected status %#lx.\n", status ); + + pRtlInitUnicodeString(&name, L"\\Device\\NamedPipe\\"); + attr.RootDirectory = 0; + attr.ObjectName = &name; + status = NtCreateFile(&hdirectory2, FILE_LIST_DIRECTORY | SYNCHRONIZE, &attr, &io, NULL, 0, + FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, 0, NULL, 0 ); + ok(!status, "got %#lx.\n", status); + status = NtQueryDirectoryFile( hdirectory2, 0, NULL, NULL, &io, buffer, sizeof(buffer), + FileDirectoryInformation, TRUE, NULL, FALSE ); + ok( !status, "got %#lx.\n", status); + CloseHandle( hdirectory2 ); + + status = NtQueryDirectoryObject( hdirectory, (void *)buffer, sizeof(buffer), TRUE, TRUE, &context, &size ); + ok( status == STATUS_OBJECT_TYPE_MISMATCH, "got %#lx\n", status ); + CloseHandle( hdirectory ); + + pRtlInitUnicodeString(&name, L"\\Device\\NamedPipe\\"); + attr.RootDirectory = 0; + attr.ObjectName = &name; + status = NtCreateFile(&hdirectory, FILE_LIST_DIRECTORY | SYNCHRONIZE, &attr, &io, NULL, 0, + FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, 0, NULL, 0 ); + ok(!status, "got %#lx.\n", status); + + status = NtQueryDirectoryFile( hdirectory, 0, NULL, NULL, &io, buffer, sizeof(buffer), + FileDirectoryInformation, TRUE, NULL, FALSE ); + ok(!status, "got %#lx.\n", status); + + CloseHandle( hpipe ); + CloseHandle( hdirectory ); +} + START_TEST(pipe) { char **argv; @@ -3210,4 +3318,5 @@ START_TEST(pipe) pipe_for_each_state(create_pipe_server, connect_pipe, test_pipe_state); pipe_for_each_state(create_pipe_server, connect_and_write_pipe, test_pipe_with_data_state); pipe_for_each_state(create_local_info_test_pipe, connect_pipe_reader, test_pipe_local_info); + test_pipe_directory_listing(); } diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 3c59fcd11fdf..4015451e3b89 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -2705,6 +2705,57 @@ static unsigned int get_cached_dir_data( HANDLE handle, struct dir_data **data_r return status; } +static NTSTATUS server_query_directory_file( HANDLE handle, IO_STATUS_BLOCK *io, void *buffer, ULONG length, + FILE_INFORMATION_CLASS info_class, BOOLEAN single_entry, + BOOLEAN restart_scan ) +{ + FILE_DIRECTORY_INFORMATION *info = (FILE_DIRECTORY_INFORMATION *)buffer; + struct directory_file_entry *entries; + unsigned int total_len; + NTSTATUS status; + + if (!(entries = malloc( length ))) return STATUS_NO_MEMORY; + + SERVER_START_REQ( query_directory_file ) + { + req->handle = wine_server_obj_handle( handle );; + req->restart_scan = restart_scan; + wine_server_set_reply( req, entries, length ); + status = wine_server_call( req ); + total_len = reply->total_len; + if (status == STATUS_OBJECT_TYPE_MISMATCH) status = STATUS_BAD_DEVICE_TYPE; + } + SERVER_END_REQ; + + if (!status && offsetof(FILE_DIRECTORY_INFORMATION, FileName) + total_len > length) + status = STATUS_INFO_LENGTH_MISMATCH; + + io->Status = status; + io->Information = 0; + if (!status) + { + static int once; + + if (info_class != FileDirectoryInformation) + { + FIXME( "Unsupprted info_class %d.\n", info_class ); + free( entries ); + return STATUS_NOT_SUPPORTED; + } + if (!single_entry) FIXME( "Multiple entries not supported.\n" ); + + memset( info, 0, sizeof(*info) ); + if (!once++) FIXME( "Not filling attributes." ); + info->FileNameLength = entries->name_len; + memcpy( info->FileName, entries + 1, entries->name_len ); + io->Information = offsetof(FILE_DIRECTORY_INFORMATION, FileName) + total_len; + TRACE( "-> %s.\n", debugstr_wn(info->FileName, info->FileNameLength / 2) ); + } + else TRACE( "-> status %#x.\n", (int)status ); + + free( entries ); + return status; +} /****************************************************************************** * NtQueryDirectoryFile (NTDLL.@) @@ -2755,7 +2806,11 @@ NTSTATUS WINAPI NtQueryDirectoryFile( HANDLE handle, HANDLE event, PIO_APC_ROUTI if (!buffer) return STATUS_ACCESS_VIOLATION; if ((status = server_get_unix_fd( handle, FILE_LIST_DIRECTORY, &fd, &needs_close, &type, NULL ))) + { + if (status == STATUS_BAD_DEVICE_TYPE) + return server_query_directory_file( handle, io, buffer, length, info_class, single_entry, restart_scan); return status; + } if (type != FD_TYPE_DIR) { diff --git a/server/named_pipe.c b/server/named_pipe.c index f638a3038341..2beb590c2cc7 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -34,6 +34,7 @@ #include "windef.h" #include "winternl.h" #include "winioctl.h" +#include "ddk/wdm.h" #include "file.h" #include "handle.h" @@ -101,6 +102,8 @@ struct named_pipe_device_file struct object obj; /* object header */ struct fd *fd; /* pseudo-fd for ioctls */ struct named_pipe_device *device; /* named pipe device */ + struct process *enum_client_process; + unsigned int enum_index; }; static void named_pipe_dump( struct object *obj, int verbose ); @@ -339,6 +342,7 @@ static struct object *named_pipe_dir_lookup_name( struct object *obj, struct uni unsigned int attr, struct object *root ); static struct object *named_pipe_dir_open_file( struct object *obj, unsigned int access, unsigned int sharing, unsigned int options ); +static int named_pipe_dir_close_handle( struct object *obj, struct process *process, obj_handle_t handle ); static void named_pipe_dir_destroy( struct object *obj ); static const struct object_ops named_pipe_dir_ops = @@ -363,7 +367,7 @@ static const struct object_ops named_pipe_dir_ops = NULL, /* unlink_name */ named_pipe_dir_open_file, /* open_file */ no_kernel_obj_list, /* get_kernel_obj_list */ - no_close_handle, /* close_handle */ + named_pipe_dir_close_handle, /* close_handle */ named_pipe_dir_destroy /* destroy */ }; @@ -572,6 +576,8 @@ static struct object *named_pipe_device_lookup_name( struct object *obj, struct dir->fd = NULL; /* defer alloc_pseudo_fd() until after we have options */ dir->device = (struct named_pipe_device *)grab_object( obj ); + dir->enum_client_process = NULL; + dir->enum_index = 0; return &dir->obj; } @@ -589,6 +595,8 @@ static struct object *named_pipe_device_open_file( struct object *obj, unsigned if (!(file = alloc_object( &named_pipe_device_file_ops ))) return NULL; file->device = (struct named_pipe_device *)grab_object( obj ); + file->enum_client_process = NULL; + file->enum_index = 0; if (!(file->fd = alloc_pseudo_fd( &named_pipe_device_fd_ops, obj, options ))) { release_object( file ); @@ -647,10 +655,18 @@ static enum server_fd_type named_pipe_device_file_get_fd_type( struct fd *fd ) return FD_TYPE_DEVICE; } +static void release_enum( struct named_pipe_device_file *file ) +{ + if (!file->enum_client_process) return; + release_object( file->enum_client_process ); + file->enum_client_process = NULL; +} + static void named_pipe_device_file_destroy( struct object *obj ) { struct named_pipe_device_file *file = (struct named_pipe_device_file*)obj; assert( obj->ops == &named_pipe_device_file_ops ); + release_enum( file ); if (file->fd) release_object( file->fd ); release_object( file->device ); } @@ -718,10 +734,20 @@ static struct object *named_pipe_dir_open_file( struct object *obj, unsigned int return grab_object( obj ); } +static int named_pipe_dir_close_handle( struct object *obj, struct process *process, obj_handle_t handle ) +{ + struct named_pipe_device_file *file = (struct named_pipe_device_file *)obj; + assert( obj->ops == &named_pipe_dir_ops ); + + release_enum( file ); + return 1; +} + static void named_pipe_dir_destroy( struct object *obj ) { struct named_pipe_device_file *file = (struct named_pipe_device_file *)obj; assert( obj->ops == &named_pipe_dir_ops ); + release_enum( file ); if (file->fd) release_object( file->fd ); release_object( file->device ); } @@ -1705,3 +1731,60 @@ DECL_HANDLER(set_named_pipe_info) release_object( pipe_end ); } + +DECL_HANDLER(query_directory_file) +{ + struct named_pipe_device_file *file; + struct directory_file_entry entry; + struct unicode_str name; + struct named_pipe *pipe; + size_t entry_size; + char *buffer; + + file = (struct named_pipe_device_file *)get_handle_obj( current->process, req->handle, + DIRECTORY_QUERY, &named_pipe_dir_ops ); + if (!file) return; + + reply->total_len = 0; + if (!file->enum_client_process) + { + file->enum_client_process = (struct process *)grab_object( current->process ); + file->enum_index = 0; + } + + if (file->enum_client_process != current->process) + { + release_object( file ); + set_error( STATUS_SHARING_VIOLATION ); + return; + } + + if (req->restart_scan) file->enum_index = 0; + if (!(pipe = (struct named_pipe *)find_object_index( file->device->pipes, file->enum_index ))) + { + release_object( file ); + set_error( STATUS_NO_MORE_FILES ); + return; + } + + assert( pipe->obj.ops == &named_pipe_ops ); + + name.str = get_object_name( &pipe->obj, &name.len ); + entry_size = (sizeof(entry) + name.len + 3) & ~3; + if (entry_size > get_reply_max_size()) + { + set_error( STATUS_INFO_LENGTH_MISMATCH ); + goto done; + } + entry.name_len = name.len; + reply->total_len = entry.name_len; + + if (!(buffer = set_reply_data_size( entry_size ))) goto done; + memcpy( buffer, &entry, sizeof(entry) ); + memcpy( buffer + sizeof(entry), name.str, name.len ); + + ++file->enum_index; +done: + release_object( &pipe->obj ); + release_object( file ); +} diff --git a/server/protocol.def b/server/protocol.def index f5618c09b44b..4c0a268282b0 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -972,6 +972,12 @@ struct cpu_topology_override unsigned char host_cpu_id[64]; }; +struct directory_file_entry +{ + data_size_t name_len; + /* VARARG(name,unicode_str,name_len); */ +}; + struct shared_cursor { int x; /* cursor position */ @@ -3623,6 +3629,13 @@ struct handle_info VARARG(entries,directory_entries); @END +@REQ(query_directory_file) + obj_handle_t handle; + unsigned int restart_scan; +@REPLY + data_size_t total_len; /* total length needed for strings */ + VARARG(entries,directory_file_entries); +@END /* Create a symbolic link object */ @REQ(create_symlink) diff --git a/server/trace.c b/server/trace.c index bdf7cd7c26cb..52b219a1f173 100644 --- a/server/trace.c +++ b/server/trace.c @@ -1439,6 +1439,29 @@ static void dump_varargs_cpu_topology_override( const char *prefix, data_size_t remove_data( size ); } +static void dump_varargs_directory_file_entries( const char *prefix, data_size_t size ) +{ + const struct directory_file_entry *entry = cur_data; + const WCHAR *str; + + fprintf( stderr, "%s{", prefix ); + if (size) + { + if (size < sizeof(*entry) || size - sizeof(*entry) < entry->name_len) + { + fprintf( stderr, "***invalid***}" ); + remove_data( size ); + return; + } + str = (const WCHAR *)(entry + 1); + fprintf( stderr, "{name=L\"" ); + dump_strW( str, entry->name_len, stderr, "\"\"" ); + fprintf( stderr, "\"}" ); + remove_data( size ); + } + fputc( '}', stderr ); +} + static void dump_varargs_tcp_connections( const char *prefix, data_size_t size ) { static const char * const state_names[] = { From 8ebfb873ac9d732653c2df7e8a97690239b798f0 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 22 Jul 2024 19:36:51 -0600 Subject: [PATCH 0822/2542] gdi32/tests: Add test for text background fill extends with ETO_OPAQUE. CW-Bug-Id: #23750 --- dlls/gdi32/tests/font.c | 131 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 06d3b042debf..9d495b4b8272 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -7837,6 +7837,136 @@ static void test_font_weight(void) ok(bret, "got error %ld\n", GetLastError()); } +static void test_text_out_fill(void) +{ + HBRUSH black = GetStockObject(GRAY_BRUSH); + RECT r = {0, 0, 256, 256}; + HBITMAP hbmp, hbmpprev; + int i, j, ystart, yend; + ABC neg_a, neg_c, abc; + BITMAPINFO bmi; + char str[3]; + HFONT hfont; + LOGFONTA lf; + DWORD *data; + BOOL bret; + SIZE sz; + HDC hdc; + int w; + + hdc = CreateCompatibleDC(0); + ok(!!hdc, "CreateCompatibleDC failed.\n"); + + memset(&bmi, 0, sizeof(bmi)); + bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmi.bmiHeader.biBitCount = 32; + bmi.bmiHeader.biPlanes = 1; + bmi.bmiHeader.biWidth = r.right; + bmi.bmiHeader.biHeight = r.bottom; + bmi.bmiHeader.biCompression = BI_RGB; + + hbmp = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, (void **)&data, NULL, 0); + ok(!!hbmp, "failed, err %lu.\n", GetLastError()); + hbmpprev = SelectObject(hdc, hbmp); + + memset(&lf, 0, sizeof(lf)); + strcpy(lf.lfFaceName, "Arial"); + lf.lfQuality = NONANTIALIASED_QUALITY; + lf.lfHeight = 90; + + hfont = CreateFontIndirectA(&lf); + ok(!!hfont, "failed, err %lu.\n", GetLastError()); + hfont = SelectObject(hdc, hfont); + + FillRect(hdc, &r, black); + + str[2] = 0; + memset(&neg_a, 0, sizeof(neg_a)); + memset(&neg_c, 0, sizeof(neg_c)); + for (i = 'A'; i <= 'z'; ++i) + { + if (!GetCharABCWidthsW(hdc, i, i, &abc)) continue; + if (abc.abcA < neg_a.abcA) + { + str[0] = i; + neg_a = abc; + } + if (abc.abcC < neg_c.abcC) + { + str[1] = i; + neg_c = abc; + } + } + if (neg_a.abcA >= 0 || neg_c.abcC >= 0) + { + skip("Could not find suitable characters.\n"); + goto done; + } + trace("Found %s.\n", debugstr_a(str)); + + for (i = 0; i < r.bottom; ++i) + { + for (j = 0; j < r.right; ++j) + { + if (data[i * r.right + j] != 0x808080) + break; + } + if (j != r.right) + break; + } + ok(i == r.bottom, "got %d.\n", i); + + bret = GetTextExtentExPointA(hdc, str, strlen(str), 32767, NULL, NULL, &sz); + ok(bret, "got error %lu.\n", GetLastError()); + w = neg_a.abcA + neg_a.abcB + neg_a.abcC + neg_c.abcA + neg_c.abcB + neg_c.abcC; + ok(sz.cx == w, "got %ld, expected %d.\n", sz.cx, w); + + bret = ExtTextOutA(hdc, 10, 0, ETO_OPAQUE, NULL, str, strlen(str), NULL); + ok(bret, "got error %lu.\n", GetLastError()); + + ystart = r.bottom - sz.cy; + yend = r.bottom; + for (j = 0; j < r.right; ++j) + { + if (data[ystart * r.right + j] != 0x808080) + break; + } + ok(j < r.right, "Expected to find white pixel.\n"); + if (j == r.right) + goto done; + todo_wine ok(j == 10 + neg_a.abcA - 1 || j == 10 + neg_a.abcA, "got %d, neg_a.abcA %d.\n", j, neg_a.abcA); + + for (i = ystart; i < yend; ++i) + { + if (data[i * r.right + j] == 0x808080) + break; + } + todo_wine ok(i == yend, "got i %d, expected %d.\n", i, yend); + + for (j = r.right - 1; j >= 0; --j) + { + if (data[ystart * r.right + j] == 0xffffff) + break; + } + ok(j >= 0, "Expected to find white pixel.\n"); + if (j < 0) + goto done; + todo_wine ok(j == 10 + sz.cx - neg_c.abcC || j == 10 + sz.cx - neg_c.abcC - 1, "got %d, neg_c.abcC %ld.\n", j, 10 + sz.cx - neg_c.abcC); + for (i = ystart; i < yend; ++i) + { + if (data[i * r.right + j] == 0x808080) + break; + } + ok(i == yend, "got i %d.\n", i); + +done: + SelectObject(hdc, hbmpprev); + hfont = SelectObject(hdc, hfont); + DeleteObject(hfont); + DeleteObject(hbmp); + DeleteDC(hdc); +} + START_TEST(font) { static const char *test_names[] = @@ -7927,6 +8057,7 @@ START_TEST(font) test_char_width(); test_select_object(); test_font_weight(); + test_text_out_fill(); /* These tests should be last test until RemoveFontResource * is properly implemented. From 73f73676d9fc039e3cdbca70fbd1b61508bb62e2 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 22 Jul 2024 18:17:42 -0600 Subject: [PATCH 0823/2542] win32u: Account for overhang in background fill in NtGdiExtTextOutW(). CW-Bug-Id: #23750 --- dlls/gdi32/tests/font.c | 6 +++--- dlls/win32u/font.c | 47 +++++++++++++++++++++++++++++++++-------- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 9d495b4b8272..4c57e6f388e9 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -7934,14 +7934,14 @@ static void test_text_out_fill(void) ok(j < r.right, "Expected to find white pixel.\n"); if (j == r.right) goto done; - todo_wine ok(j == 10 + neg_a.abcA - 1 || j == 10 + neg_a.abcA, "got %d, neg_a.abcA %d.\n", j, neg_a.abcA); + ok(j == 10 + neg_a.abcA - 1 || j == 10 + neg_a.abcA, "got %d, neg_a.abcA %d.\n", j, neg_a.abcA); for (i = ystart; i < yend; ++i) { if (data[i * r.right + j] == 0x808080) break; } - todo_wine ok(i == yend, "got i %d, expected %d.\n", i, yend); + ok(i == yend, "got i %d, expected %d.\n", i, yend); for (j = r.right - 1; j >= 0; --j) { @@ -7951,7 +7951,7 @@ static void test_text_out_fill(void) ok(j >= 0, "Expected to find white pixel.\n"); if (j < 0) goto done; - todo_wine ok(j == 10 + sz.cx - neg_c.abcC || j == 10 + sz.cx - neg_c.abcC - 1, "got %d, neg_c.abcC %ld.\n", j, 10 + sz.cx - neg_c.abcC); + ok(j == 10 + sz.cx - neg_c.abcC || j == 10 + sz.cx - neg_c.abcC - 1, "got %d, neg_c.abcC %ld.\n", j, 10 + sz.cx - neg_c.abcC); for (i = ystart; i < yend; ++i) { if (data[i * r.right + j] == 0x808080) diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c index 60adb8ede4ab..762e9cc1cda3 100644 --- a/dlls/win32u/font.c +++ b/dlls/win32u/font.c @@ -5922,11 +5922,12 @@ BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *lpr INT char_extra; SIZE sz; RECT rc; - POINT *deltas = NULL, width = {0, 0}; + POINT *deltas = NULL, width = {0, 0}, text_box_dim[2] = {{ 0 }}; DC * dc = get_dc_ptr( hdc ); PHYSDEV physdev; INT breakRem; static int quietfixme = 0; + INT fill_extra_left = 0, fill_extra_right = 0; if (!dc) return FALSE; if (count > INT_MAX) return FALSE; @@ -6079,12 +6080,22 @@ BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *lpr deltas[i].y = desired[1].y - width.y; width = desired[1]; + text_box_dim[1] = width; } flags |= ETO_PDY; } else { POINT desired[2]; + ULONG abc_flags = NTGDI_GETCHARABCWIDTHS_INT; + BOOL mirror_x = FALSE, mirror_y = FALSE; + ABC abc; + + if (dc->attr->graphics_mode == GM_COMPATIBLE && dc->vport2WorldValid) + { + mirror_x = dc->xformWorld2Vport.eM11 < 0; + mirror_y = dc->xformWorld2Vport.eM22 < 0; + } NtGdiGetTextExtentExW( hdc, str, count, 0, NULL, NULL, &sz, !!(flags & ETO_GLYPH_INDEX) ); desired[0].x = desired[0].y = 0; @@ -6094,13 +6105,31 @@ BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *lpr desired[1].x -= desired[0].x; desired[1].y -= desired[0].y; - if (dc->attr->graphics_mode == GM_COMPATIBLE) + text_box_dim[1].x = sz.cx; + if (flags & ETO_GLYPH_INDEX) + abc_flags |= NTGDI_GETCHARABCWIDTHS_INDICES; + + memset( &abc, 0, sizeof(abc) ); + NtGdiGetCharABCWidthsW( hdc, 0, 1, (WCHAR *)str, abc_flags, &abc ); + if (mirror_x && abc.abcC < 0) text_box_dim[0].x += abc.abcC; + else if (!mirror_x && abc.abcA < 0) text_box_dim[0].x += abc.abcA; + + memset( &abc, 0, sizeof(abc) ); + NtGdiGetCharABCWidthsW( hdc, 0, 1, (WCHAR *)(str + count - 1), abc_flags, &abc ); + if (mirror_x && abc.abcA < 0) text_box_dim[1].x -= abc.abcA; + else if (!mirror_x && abc.abcC < 0) text_box_dim[1].x -= abc.abcC; + + lp_to_dp(dc, text_box_dim, 2); + + text_box_dim[0].x -= desired[0].x; + text_box_dim[1].x -= desired[0].x; + if (mirror_x) { - if (dc->vport2WorldValid && dc->xformWorld2Vport.eM11 < 0) - desired[1].x = -desired[1].x; - if (dc->vport2WorldValid && dc->xformWorld2Vport.eM22 < 0) - desired[1].y = -desired[1].y; + desired[1].x = -desired[1].x; + text_box_dim[0].x = -text_box_dim[0].x; + text_box_dim[1].x = -text_box_dim[1].x; } + if (mirror_y) desired[1].y = -desired[1].y; width = desired[1]; } @@ -6157,12 +6186,12 @@ BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *lpr if(!((flags & ETO_CLIPPED) && (flags & ETO_OPAQUE))) { if(!(flags & ETO_OPAQUE) || !lprect || - x < rc.left || x + width.x >= rc.right || + x - fill_extra_left < rc.left || x + width.x + fill_extra_right >= rc.right || y - tm.tmAscent < rc.top || y + tm.tmDescent >= rc.bottom) { RECT text_box; - text_box.left = x; - text_box.right = x + width.x; + text_box.left = x + text_box_dim[0].x; + text_box.right = x + text_box_dim[1].x; text_box.top = y - tm.tmAscent; text_box.bottom = y + tm.tmDescent; From 6b04609941a2a4b49d7ffaade2843e490a4ed0a6 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 30 Jul 2024 15:00:09 -0600 Subject: [PATCH 0824/2542] kernelbase: HACK: Force disable direct composition for Banyu Lintar Angin - Little Storm. CW-Bug-Id: #24095 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 2f7e203b21a1..7f49909b417f 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -592,6 +592,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) } options[] = { + {L"Banyu Lintar Angin - Little Storm -.exe", L" --disable_direct_composition=1"}, {L"Super\\Super.exe", L" --disable_direct_composition=1"}, {L"A Raven Monologue.exe", L" --use-angle=d3d9"}, {L"antenna\\antenna.exe", L" --use-angle=d3d9"}, From 3b02c2be8a27734f2fbf8eb975701731f59a40b5 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 10 Jul 2024 16:43:25 -0600 Subject: [PATCH 0825/2542] server: Do not allow zero access mask when opening some objects. CW-Bug-Id: #24016 --- dlls/user32/tests/winstation.c | 4 ++++ server/handle.c | 11 ++++++++++- server/handle.h | 2 ++ server/process.c | 2 +- server/thread.c | 2 +- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/dlls/user32/tests/winstation.c b/dlls/user32/tests/winstation.c index bcbb55ee9180..9294db4934f5 100644 --- a/dlls/user32/tests/winstation.c +++ b/dlls/user32/tests/winstation.c @@ -172,6 +172,10 @@ static void test_handles(void) else if (le == ERROR_ACCESS_DENIED) win_skip( "Not enough privileges for CreateWindowStation\n" ); + w2 = OpenWindowStationA("winsta0", TRUE, 0 ); + ok( !w2, "got non-NULL.\n" ); + ok( GetLastError() == ERROR_ACCESS_DENIED, "got %ld.\n", GetLastError() ); + w2 = OpenWindowStationA("winsta0", TRUE, WINSTA_ALL_ACCESS ); ok( w2 != 0, "OpenWindowStation failed\n" ); ok( w2 != w1, "OpenWindowStation returned default handle\n" ); diff --git a/server/handle.c b/server/handle.c index 6385e9aa1617..f93724ce74f7 100644 --- a/server/handle.c +++ b/server/handle.c @@ -290,6 +290,15 @@ obj_handle_t alloc_handle( struct process *process, void *ptr, unsigned int acce return alloc_handle_entry( process, ptr, access, attr ); } +/* allocate handle for opening an object by userspace request */ +obj_handle_t alloc_handle_user_open( struct process *process, void *obj, unsigned int access, unsigned int attr ) +{ + if (access) return alloc_handle( process, obj, access, attr ); + + set_error( STATUS_ACCESS_DENIED ); + return 0; +} + /* allocate a global handle for an object, incrementing its refcount */ /* return the handle, or 0 on error */ static obj_handle_t alloc_global_handle_no_access_check( void *obj, unsigned int access ) @@ -647,7 +656,7 @@ obj_handle_t open_object( struct process *process, obj_handle_t parent, unsigned if ((obj = open_named_object( root, ops, name, attributes ))) { - handle = alloc_handle( process, obj, access, attributes ); + handle = alloc_handle_user_open( process, obj, access, attributes ); release_object( obj ); } if (root) release_object( root ); diff --git a/server/handle.h b/server/handle.h index a2b06ac02b11..1df997751d7b 100644 --- a/server/handle.h +++ b/server/handle.h @@ -38,6 +38,8 @@ extern obj_handle_t alloc_handle( struct process *process, void *obj, unsigned int access, unsigned int attr ); extern obj_handle_t alloc_handle_no_access_check( struct process *process, void *ptr, unsigned int access, unsigned int attr ); +extern obj_handle_t alloc_handle_user_open( struct process *process, void *obj, + unsigned int access, unsigned int attr ); extern unsigned int close_handle( struct process *process, obj_handle_t handle ); extern struct object *get_handle_obj( struct process *process, obj_handle_t handle, unsigned int access, const struct object_ops *ops ); diff --git a/server/process.c b/server/process.c index 8e37b6a72217..b5bc465f7146 100644 --- a/server/process.c +++ b/server/process.c @@ -1513,7 +1513,7 @@ DECL_HANDLER(open_process) reply->handle = 0; if (process) { - reply->handle = alloc_handle( current->process, process, req->access, req->attributes ); + reply->handle = alloc_handle_user_open( current->process, process, req->access, req->attributes ); release_object( process ); } } diff --git a/server/thread.c b/server/thread.c index 48cb83cb62c3..8296ea7bc155 100644 --- a/server/thread.c +++ b/server/thread.c @@ -1659,7 +1659,7 @@ DECL_HANDLER(open_thread) reply->handle = 0; if (thread) { - reply->handle = alloc_handle( current->process, thread, req->access, req->attributes ); + reply->handle = alloc_handle_user_open( current->process, thread, req->access, req->attributes ); release_object( thread ); } } From 3818a90a09e64fa10b2d0e8eb1c4717a170fe5b6 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 10 Jul 2024 16:53:49 -0600 Subject: [PATCH 0826/2542] server: Skip inaccessible threads in (get_next_thread). CW-Bug-Id: #24016 --- server/thread.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server/thread.c b/server/thread.c index 8296ea7bc155..fd281ee05e1a 100644 --- a/server/thread.c +++ b/server/thread.c @@ -2223,9 +2223,13 @@ DECL_HANDLER(get_next_thread) thread = LIST_ENTRY( ptr, struct thread, entry ); if (thread->process == process) { - reply->handle = alloc_handle( current->process, thread, req->access, req->attributes ); - release_object( process ); - return; + reply->handle = alloc_handle_user_open( current->process, thread, req->access, req->attributes ); + if (get_error() != STATUS_ACCESS_DENIED) + { + release_object( process ); + return; + } + clear_error(); } ptr = req->flags ? list_prev( &thread_list, &thread->entry ) : list_next( &thread_list, &thread->entry ); From ea66c6e02bbc01261378adf45e62d8798502d257 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 19 Jun 2023 17:53:47 -0500 Subject: [PATCH 0827/2542] qcap: Implement Inifinite Pin Tee. CW-Bug-Id: #22364 --- dlls/qcap/Makefile.in | 1 + dlls/qcap/inftee.c | 240 ++++++ dlls/qcap/qcap_classes.idl | 6 + dlls/qcap/qcap_main.c | 30 + dlls/qcap/qcap_private.h | 1 + dlls/qcap/tests/Makefile.in | 1 + dlls/qcap/tests/inftee.c | 1439 +++++++++++++++++++++++++++++++++++ libs/strmbase/pin.c | 11 +- 8 files changed, 1724 insertions(+), 5 deletions(-) create mode 100644 dlls/qcap/inftee.c create mode 100644 dlls/qcap/tests/inftee.c diff --git a/dlls/qcap/Makefile.in b/dlls/qcap/Makefile.in index 0f53e63f0226..3cbe479eacd8 100644 --- a/dlls/qcap/Makefile.in +++ b/dlls/qcap/Makefile.in @@ -9,6 +9,7 @@ SOURCES = \ avimux.c \ capturegraph.c \ filewriter.c \ + inftee.c \ qcap_classes.idl \ qcap_main.c \ smartteefilter.c \ diff --git a/dlls/qcap/inftee.c b/dlls/qcap/inftee.c new file mode 100644 index 000000000000..d7aa1646af04 --- /dev/null +++ b/dlls/qcap/inftee.c @@ -0,0 +1,240 @@ +/* + * Infinite pin tee filter + * + * Copyright 2023 Zeb Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "qcap_private.h" +#include + +WINE_DEFAULT_DEBUG_CHANNEL(quartz); + +struct inf_tee_source +{ + struct strmbase_source source; + struct list entry; +}; + +struct inf_tee +{ + struct strmbase_filter filter; + + struct strmbase_sink sink; + + struct list sources; + unsigned int source_index; +}; + +static struct inf_tee *impl_from_strmbase_filter(struct strmbase_filter *iface) +{ + return CONTAINING_RECORD(iface, struct inf_tee, filter); +} + +static struct inf_tee *impl_from_strmbase_pin(struct strmbase_pin *pin) +{ + return impl_from_strmbase_filter(pin->filter); +} + +static void remove_source(struct inf_tee_source *source) +{ + strmbase_source_cleanup(&source->source); + list_remove(&source->entry); + free(source); +} + +static HRESULT inf_tee_source_get_media_type(struct strmbase_pin *iface, + unsigned int index, AM_MEDIA_TYPE *mt) +{ + struct inf_tee *filter = impl_from_strmbase_pin(iface); + IEnumMediaTypes *enummt; + AM_MEDIA_TYPE *pmt; + HRESULT hr; + + if (!filter->sink.pin.peer) + return VFW_E_NOT_CONNECTED; + + if (FAILED(hr = IPin_EnumMediaTypes(filter->sink.pin.peer, &enummt))) + return hr; + + if ((!index || IEnumMediaTypes_Skip(enummt, index) == S_OK) + && IEnumMediaTypes_Next(enummt, 1, &pmt, NULL) == S_OK) + { + CopyMediaType(mt, pmt); + DeleteMediaType(pmt); + IEnumMediaTypes_Release(enummt); + return S_OK; + } + + IEnumMediaTypes_Release(enummt); + return VFW_S_NO_MORE_ITEMS; +} + +static HRESULT add_source(struct inf_tee *filter); + +static HRESULT WINAPI inf_tee_source_DecideBufferSize(struct strmbase_source *iface, + IMemAllocator *allocator, ALLOCATOR_PROPERTIES *props) +{ + struct inf_tee *filter = impl_from_strmbase_pin(&iface->pin); + ALLOCATOR_PROPERTIES ret_props; + HRESULT hr; + + if (!filter->sink.pin.peer) + { + WARN("Sink is not connected; returning VFW_E_NOT_CONNECTED.\n"); + return VFW_E_NOT_CONNECTED; + } + + /* Copy the properties from the upstream sink. */ + if (FAILED(hr = IMemAllocator_GetProperties(filter->sink.pAllocator, props))) + return hr; + + if (FAILED(hr = IMemAllocator_SetProperties(allocator, props, &ret_props))) + return hr; + + if (FAILED(hr = add_source(filter))) + return hr; + + return S_OK; +} + +static void inf_tee_source_disconnect(struct strmbase_source *iface) +{ +// struct inf_tee_source *source = impl_source_from_strmbase_pin(&iface->pin); + +// remove_source(source); +} + +static const struct strmbase_source_ops source_ops = +{ + .base.pin_get_media_type = inf_tee_source_get_media_type, + .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, + .pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator, + .pfnDecideBufferSize = inf_tee_source_DecideBufferSize, + .source_disconnect = inf_tee_source_disconnect, +}; + +static HRESULT add_source(struct inf_tee *filter) +{ + struct inf_tee_source *source; + WCHAR name[19]; + + if (!(source = calloc(1, sizeof(*source)))) + return E_OUTOFMEMORY; + + swprintf(name, ARRAY_SIZE(name), L"Output%u", filter->source_index++); + strmbase_source_init(&source->source, &filter->filter, name, &source_ops); + list_add_tail(&filter->sources, &source->entry); + return S_OK; +} + +static HRESULT inf_tee_sink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out) +{ + struct inf_tee *filter = impl_from_strmbase_pin(iface); + + if (IsEqualGUID(iid, &IID_IMemInputPin)) + *out = &filter->sink.IMemInputPin_iface; + else + return E_NOINTERFACE; + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static HRESULT WINAPI inf_tee_sink_Receive(struct strmbase_sink *iface, IMediaSample *sample) +{ + struct inf_tee *filter = impl_from_strmbase_pin(&iface->pin); + struct inf_tee_source *source; + + LIST_FOR_EACH_ENTRY(source, &filter->sources, struct inf_tee_source, entry) + { + HRESULT hr; + + if (!source->source.pin.peer) + continue; + + if (FAILED(hr = IMemInputPin_Receive(source->source.pMemInputPin, sample))) + WARN("Receive() returned %#lx.\n", hr); + } + + return S_OK; +} + +static const struct strmbase_sink_ops sink_ops = +{ + .base.pin_query_interface = inf_tee_sink_query_interface, + .pfnReceive = inf_tee_sink_Receive, +}; + +static struct strmbase_pin *inf_tee_get_pin(struct strmbase_filter *iface, unsigned int index) +{ + struct inf_tee *filter = impl_from_strmbase_filter(iface); + struct inf_tee_source *source; + + if (index == 0) + return &filter->sink.pin; + LIST_FOR_EACH_ENTRY(source, &filter->sources, struct inf_tee_source, entry) + { + if (!--index) + return &source->source.pin; + } + return NULL; +} + +static void inf_tee_destroy(struct strmbase_filter *iface) +{ + struct inf_tee *filter = impl_from_strmbase_filter(iface); + struct inf_tee_source *source, *cursor; + + LIST_FOR_EACH_ENTRY_SAFE(source, cursor, &filter->sources, struct inf_tee_source, entry) + remove_source(source); + + strmbase_sink_cleanup(&filter->sink); + strmbase_filter_cleanup(&filter->filter); + free(filter); +} + +static const struct strmbase_filter_ops filter_ops = +{ + .filter_get_pin = inf_tee_get_pin, + .filter_destroy = inf_tee_destroy, +}; + +HRESULT inf_tee_create(IUnknown *outer, IUnknown **out) +{ + struct inf_tee *object; + HRESULT hr; + + if (!(object = calloc(1, sizeof(*object)))) + return E_OUTOFMEMORY; + + strmbase_filter_init(&object->filter, outer, &CLSID_InfTee, &filter_ops); + + strmbase_sink_init(&object->sink, &object->filter, L"Input", &sink_ops, NULL); + + list_init(&object->sources); + object->source_index = 1; + + if (FAILED(hr = add_source(object))) + { + inf_tee_destroy(&object->filter); + return hr; + } + + TRACE("Created infinite tee %p.\n", object); + *out = &object->filter.IUnknown_inner; + return S_OK; +} diff --git a/dlls/qcap/qcap_classes.idl b/dlls/qcap/qcap_classes.idl index c1ec48bc3524..55c82dc24aee 100644 --- a/dlls/qcap/qcap_classes.idl +++ b/dlls/qcap/qcap_classes.idl @@ -61,6 +61,12 @@ coclass CaptureGraphBuilder2 {} ] coclass FileWriter {} +[ + threading(both), + uuid(f8388a40-d5bb-11d0-be5a-0080c706568e), +] +coclass InfTee {} + [ helpstring("Smart Tee Filter"), threading(both), diff --git a/dlls/qcap/qcap_main.c b/dlls/qcap/qcap_main.c index cd4a6ebc0ab7..43cdee177cfa 100644 --- a/dlls/qcap/qcap_main.c +++ b/dlls/qcap/qcap_main.c @@ -103,6 +103,7 @@ static struct class_factory audio_record_cf = {{&class_factory_vtbl}, audio_reco static struct class_factory avi_compressor_cf = {{&class_factory_vtbl}, avi_compressor_create}; static struct class_factory avi_mux_cf = {{&class_factory_vtbl}, avi_mux_create}; static struct class_factory capture_graph_cf = {{&class_factory_vtbl}, capture_graph_create}; +static struct class_factory inf_tee_cf = {{&class_factory_vtbl}, inf_tee_create}; static struct class_factory file_writer_cf = {{&class_factory_vtbl}, file_writer_create}; static struct class_factory smart_tee_cf = {{&class_factory_vtbl}, smart_tee_create}; static struct class_factory vfw_capture_cf = {{&class_factory_vtbl}, vfw_capture_create}; @@ -125,6 +126,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) factory = &capture_graph_cf; else if (IsEqualGUID(clsid, &CLSID_FileWriter)) factory = &file_writer_cf; + else if (IsEqualGUID(clsid, &CLSID_InfTee)) + factory = &inf_tee_cf; else if (IsEqualGUID(clsid, &CLSID_SmartTee)) factory = &smart_tee_cf; else if (IsEqualGUID(clsid, &CLSID_VfwCapture)) @@ -188,6 +191,31 @@ static const REGFILTER2 reg_smart_tee = .u.s2.rgPins2 = reg_smart_tee_pins, }; +static const REGPINTYPES reg_null_mt = {&GUID_NULL, &GUID_NULL}; + +static const REGFILTERPINS2 reg_inf_tee_pins[2] = +{ + { + .cInstances = 1, + .nMediaTypes = 1, + .lpMediaType = ®_null_mt, + }, + { + .dwFlags = REG_PINFLAG_B_OUTPUT, + .cInstances = 1, + .nMediaTypes = 1, + .lpMediaType = ®_null_mt, + }, +}; + +static const REGFILTER2 reg_inf_tee = +{ + .dwVersion = 2, + .dwMerit = MERIT_DO_NOT_USE, + .u.s2.cPins2 = 2, + .u.s2.rgPins2 = reg_inf_tee_pins, +}; + static const REGPINTYPES reg_file_writer_sink_mt = {&GUID_NULL, &GUID_NULL}; static const REGFILTERPINS2 reg_file_writer_pins[1] = @@ -226,6 +254,8 @@ HRESULT WINAPI DllRegisterServer(void) NULL, NULL, NULL, ®_avi_mux); IFilterMapper2_RegisterFilter(mapper, &CLSID_FileWriter, L"File writer", NULL, NULL, NULL, ®_file_writer); + IFilterMapper2_RegisterFilter(mapper, &CLSID_InfTee, L"Infinite Pin Tee Filter", + NULL, NULL, NULL, ®_inf_tee); IFilterMapper2_RegisterFilter(mapper, &CLSID_SmartTee, L"Smart Tee", NULL, NULL, NULL, ®_smart_tee); diff --git a/dlls/qcap/qcap_private.h b/dlls/qcap/qcap_private.h index d0acd9e3bd7d..a41bfb941fa3 100644 --- a/dlls/qcap/qcap_private.h +++ b/dlls/qcap/qcap_private.h @@ -36,6 +36,7 @@ HRESULT avi_compressor_create(IUnknown *outer, IUnknown **out); HRESULT avi_mux_create(IUnknown *outer, IUnknown **out); HRESULT capture_graph_create(IUnknown *outer, IUnknown **out); HRESULT file_writer_create(IUnknown *outer, IUnknown **out); +HRESULT inf_tee_create(IUnknown *outer, IUnknown **out); HRESULT smart_tee_create(IUnknown *outer, IUnknown **out); HRESULT vfw_capture_create(IUnknown *outer, IUnknown **out); diff --git a/dlls/qcap/tests/Makefile.in b/dlls/qcap/tests/Makefile.in index c92866409361..1b291d065bc1 100644 --- a/dlls/qcap/tests/Makefile.in +++ b/dlls/qcap/tests/Makefile.in @@ -7,6 +7,7 @@ SOURCES = \ avimux.c \ capturegraph.c \ filewriter.c \ + inftee.c \ qcap.c \ smartteefilter.c \ videocapture.c diff --git a/dlls/qcap/tests/inftee.c b/dlls/qcap/tests/inftee.c new file mode 100644 index 000000000000..0a040fe47ab4 --- /dev/null +++ b/dlls/qcap/tests/inftee.c @@ -0,0 +1,1439 @@ +/* + * Infinite pin tee filter unit tests + * + * Copyright 2023 Zeb Figura for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS +#include +#include "dshow.h" +#include "mmreg.h" +#include "wine/strmbase.h" +#include "wine/test.h" + +static IBaseFilter *create_infinite_tee(void) +{ + IBaseFilter *filter = NULL; + HRESULT hr = CoCreateInstance(&CLSID_InfTee, NULL, CLSCTX_INPROC_SERVER, + &IID_IBaseFilter, (void **)&filter); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + return filter; +} + +static ULONG get_refcount(void *iface) +{ + IUnknown *unknown = iface; + IUnknown_AddRef(unknown); + return IUnknown_Release(unknown); +} + +static bool compare_media_types(const AM_MEDIA_TYPE *a, const AM_MEDIA_TYPE *b) +{ + return !memcmp(a, b, offsetof(AM_MEDIA_TYPE, pbFormat)) + && !memcmp(a->pbFormat, b->pbFormat, a->cbFormat); +} + +struct testfilter +{ + struct strmbase_filter filter; + struct strmbase_source source; + struct strmbase_sink sink; + const AM_MEDIA_TYPE *sink_mt; + AM_MEDIA_TYPE source_mt; + bool require_temporal_compression; + HANDLE sample_event, eos_event, segment_event; + unsigned int got_begin_flush, got_end_flush; + unsigned int got_connect; +}; + +static inline struct testfilter *impl_from_strmbase_filter(struct strmbase_filter *iface) +{ + return CONTAINING_RECORD(iface, struct testfilter, filter); +} + +static struct strmbase_pin *testfilter_get_pin(struct strmbase_filter *iface, unsigned int index) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface); + if (!index) + return &filter->source.pin; + else if (index == 1) + return &filter->sink.pin; + return NULL; +} + +static void testfilter_destroy(struct strmbase_filter *iface) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface); + CloseHandle(filter->sample_event); + CloseHandle(filter->eos_event); + CloseHandle(filter->segment_event); + strmbase_source_cleanup(&filter->source); + strmbase_sink_cleanup(&filter->sink); + strmbase_filter_cleanup(&filter->filter); +} + +static const struct strmbase_filter_ops testfilter_ops = +{ + .filter_get_pin = testfilter_get_pin, + .filter_destroy = testfilter_destroy, +}; + +static HRESULT testsource_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface->filter); + + if (filter->require_temporal_compression && !mt->bTemporalCompression) + return S_FALSE; + return S_OK; +} + +static HRESULT testsource_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface->filter); + if (!index) + { + CopyMediaType(mt, &filter->source_mt); + return S_OK; + } + return VFW_S_NO_MORE_ITEMS; +} + +static void test_sink_allocator(struct strmbase_source *source) +{ + ALLOCATOR_PROPERTIES req_props = {1, 256, 1, 0}, ret_props; + IMemAllocator *req_allocator, *ret_allocator; + IMemInputPin *input; + HRESULT hr; + + IPin_QueryInterface(source->pin.peer, &IID_IMemInputPin, (void **)&input); + + hr = IMemInputPin_GetAllocatorRequirements(input, &ret_props); + ok(hr == E_NOTIMPL, "Got hr %#lx.\n", hr); + + hr = IMemInputPin_GetAllocator(input, &ret_allocator); + todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); + + if (hr == S_OK) + { + hr = IMemInputPin_NotifyAllocator(input, ret_allocator, TRUE); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + IMemAllocator_Release(ret_allocator); + } + + CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER, + &IID_IMemAllocator, (void **)&req_allocator); + + hr = IMemInputPin_NotifyAllocator(input, req_allocator, TRUE); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IMemInputPin_GetAllocator(input, &ret_allocator); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(ret_allocator == req_allocator, "Allocators didn't match.\n"); + IMemAllocator_Release(ret_allocator); + + hr = IMemAllocator_SetProperties(req_allocator, &req_props, &ret_props); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + source->pAllocator = req_allocator; + + IMemInputPin_Release(input); +} + +static HRESULT WINAPI testsource_AttemptConnection(struct strmbase_source *iface, + IPin *peer, const AM_MEDIA_TYPE *mt) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface->pin.filter); + HRESULT hr; + + ++filter->got_connect; + + iface->pin.peer = peer; + IPin_AddRef(peer); + CopyMediaType(&iface->pin.mt, mt); + + if (FAILED(hr = IPin_ReceiveConnection(peer, &iface->pin.IPin_iface, mt))) + { + ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#lx.\n", hr); + IPin_Release(peer); + iface->pin.peer = NULL; + FreeMediaType(&iface->pin.mt); + } + + test_sink_allocator(iface); + + return hr; +} + +static const struct strmbase_source_ops testsource_ops = +{ + .base.pin_query_accept = testsource_query_accept, + .base.pin_get_media_type = testsource_get_media_type, + .pfnAttemptConnection = testsource_AttemptConnection, +}; + +static HRESULT testsink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface->filter); + + if (IsEqualGUID(iid, &IID_IMemInputPin)) + *out = &filter->sink.IMemInputPin_iface; + else + return E_NOINTERFACE; + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static HRESULT testsink_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface->filter); + if (!index && filter->sink_mt) + { + CopyMediaType(mt, filter->sink_mt); + return S_OK; + } + return VFW_S_NO_MORE_ITEMS; +} + +static HRESULT testsink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *mt) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface->pin.filter); + if (filter->sink_mt && !IsEqualGUID(&mt->majortype, &filter->sink_mt->majortype)) + return VFW_E_TYPE_NOT_ACCEPTED; + return S_OK; +} + +static HRESULT WINAPI testsink_Receive(struct strmbase_sink *iface, IMediaSample *sample) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface->pin.filter); + REFERENCE_TIME start, stop; + BYTE *data, expect[200]; + LONG size, i; + HRESULT hr; + + size = IMediaSample_GetSize(sample); + ok(size == 256, "Got size %lu.\n", size); + size = IMediaSample_GetActualDataLength(sample); + ok(size == 200, "Got valid size %lu.\n", size); + + hr = IMediaSample_GetPointer(sample, &data); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + for (i = 0; i < size; ++i) + expect[i] = i; + ok(!memcmp(data, expect, size), "Data didn't match.\n"); + + hr = IMediaSample_GetTime(sample, &start, &stop); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(start == 30000, "Got start time %s.\n", wine_dbgstr_longlong(start)); + ok(stop == 40000, "Got stop time %s.\n", wine_dbgstr_longlong(stop)); + + hr = IMediaSample_GetMediaTime(sample, &start, &stop); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(start == 10000, "Got start time %s.\n", wine_dbgstr_longlong(start)); + ok(stop == 20000, "Got stop time %s.\n", wine_dbgstr_longlong(stop)); + + hr = IMediaSample_IsDiscontinuity(sample); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IMediaSample_IsPreroll(sample); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IMediaSample_IsSyncPoint(sample); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + SetEvent(filter->sample_event); + + return S_OK; +} + +static HRESULT testsink_new_segment(struct strmbase_sink *iface, + REFERENCE_TIME start, REFERENCE_TIME stop, double rate) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface->pin.filter); + ok(start == 10000, "Got start %s.\n", wine_dbgstr_longlong(start)); + ok(stop == 20000, "Got stop %s.\n", wine_dbgstr_longlong(stop)); + ok(rate == 1.0, "Got rate %.16e.\n", rate); + SetEvent(filter->segment_event); + return S_OK; +} + +static HRESULT testsink_eos(struct strmbase_sink *iface) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface->pin.filter); + SetEvent(filter->eos_event); + return S_OK; +} + +static HRESULT testsink_begin_flush(struct strmbase_sink *iface) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface->pin.filter); + ++filter->got_begin_flush; + return S_OK; +} + +static HRESULT testsink_end_flush(struct strmbase_sink *iface) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface->pin.filter); + ++filter->got_end_flush; + return S_OK; +} + +static const struct strmbase_sink_ops testsink_ops = +{ + .base.pin_query_interface = testsink_query_interface, + .base.pin_get_media_type = testsink_get_media_type, + .sink_connect = testsink_connect, + .pfnReceive = testsink_Receive, + .sink_new_segment = testsink_new_segment, + .sink_eos = testsink_eos, + .sink_begin_flush = testsink_begin_flush, + .sink_end_flush = testsink_end_flush, +}; + +static void testfilter_init(struct testfilter *filter) +{ + static const GUID clsid = {0xabacab}; + memset(filter, 0, sizeof(*filter)); + strmbase_filter_init(&filter->filter, NULL, &clsid, &testfilter_ops); + strmbase_source_init(&filter->source, &filter->filter, L"source", &testsource_ops); + strmbase_sink_init(&filter->sink, &filter->filter, L"sink", &testsink_ops, NULL); + filter->sample_event = CreateEventW(NULL, FALSE, FALSE, NULL); + filter->segment_event = CreateEventW(NULL, FALSE, FALSE, NULL); + filter->eos_event = CreateEventW(NULL, FALSE, FALSE, NULL); + filter->require_temporal_compression = true; +} + +#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c) +static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOOL supported) +{ + IUnknown *iface = iface_ptr; + HRESULT hr, expected_hr; + ULONG ref, expect_ref; + IUnknown *unk; + + expected_hr = supported ? S_OK : E_NOINTERFACE; + + expect_ref = get_refcount(iface); + + hr = IUnknown_QueryInterface(iface, iid, (void **)&unk); + ok_(__FILE__, line)(hr == expected_hr, "Got hr %#lx, expected %#lx.\n", hr, expected_hr); + if (SUCCEEDED(hr)) + { + ref = get_refcount(iface); + ok_(__FILE__, line)(ref == expect_ref + 1, "Expected %lu references, got %lu.\n", expect_ref + 1, ref); + ref = get_refcount(unk); + ok_(__FILE__, line)(ref == expect_ref + 1, "Expected %lu references, got %lu.\n", expect_ref + 1, ref); + IUnknown_Release(unk); + } +} + +static void test_interfaces(void) +{ + IBaseFilter *filter = create_infinite_tee(); + ULONG ref; + IPin *pin; + + check_interface(filter, &IID_IBaseFilter, TRUE); + check_interface(filter, &IID_IMediaFilter, TRUE); + check_interface(filter, &IID_IPersist, TRUE); + check_interface(filter, &IID_IUnknown, TRUE); + + check_interface(filter, &IID_IAMFilterMiscFlags, FALSE); + check_interface(filter, &IID_IBasicAudio, FALSE); + check_interface(filter, &IID_IBasicVideo, FALSE); + check_interface(filter, &IID_IKsPropertySet, FALSE); + check_interface(filter, &IID_IMediaPosition, FALSE); + check_interface(filter, &IID_IMediaSeeking, FALSE); + check_interface(filter, &IID_IMemInputPin, FALSE); + check_interface(filter, &IID_IPersistPropertyBag, FALSE); + check_interface(filter, &IID_IPin, FALSE); + check_interface(filter, &IID_IQualityControl, FALSE); + check_interface(filter, &IID_IQualProp, FALSE); + check_interface(filter, &IID_IReferenceClock, FALSE); + check_interface(filter, &IID_ISeekingPassThru, FALSE); + check_interface(filter, &IID_IVideoWindow, FALSE); + + IBaseFilter_FindPin(filter, L"Input", &pin); + + check_interface(pin, &IID_IMemInputPin, TRUE); + check_interface(pin, &IID_IPin, TRUE); + todo_wine check_interface(pin, &IID_IQualityControl, TRUE); + check_interface(pin, &IID_IUnknown, TRUE); + + check_interface(pin, &IID_IKsPropertySet, FALSE); + check_interface(pin, &IID_IMediaPosition, FALSE); + check_interface(pin, &IID_IMediaSeeking, FALSE); + + IPin_Release(pin); + + IBaseFilter_FindPin(filter, L"Output1", &pin); + + todo_wine check_interface(pin, &IID_IMediaPosition, TRUE); + todo_wine check_interface(pin, &IID_IMediaSeeking, TRUE); + check_interface(pin, &IID_IPin, TRUE); + todo_wine check_interface(pin, &IID_IQualityControl, TRUE); + check_interface(pin, &IID_IUnknown, TRUE); + + check_interface(pin, &IID_IAsyncReader, FALSE); + check_interface(pin, &IID_IKsPropertySet, FALSE); + check_interface(pin, &IID_IMemInputPin, FALSE); + + IPin_Release(pin); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got unexpected refcount %ld.\n", ref); +} + +static void testsink_add(struct testfilter *testsink, IBaseFilter *filter, IFilterGraph2 *graph, const WCHAR *id) +{ + AM_MEDIA_TYPE req_mt = + { + .majortype = MEDIATYPE_Stream, + .subtype = MEDIASUBTYPE_Avi, + .formattype = FORMAT_None, + .bTemporalCompression = TRUE, + }; + IPin *source; + HRESULT hr; + + testfilter_init(testsink); + IFilterGraph2_AddFilter(graph, &testsink->filter.IBaseFilter_iface, L"sink"); + hr = IBaseFilter_FindPin(filter, id, &source); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + IPin_Release(source); +} + +static void testsink_remove(struct testfilter *testsink, IBaseFilter *filter, IFilterGraph2 *graph) +{ + IPin *source = testsink->sink.pin.peer; + HRESULT hr; + ULONG ref; + + // fixme zf: this is ugly! + hr = IFilterGraph2_Disconnect(graph, &testsink->sink.pin.IPin_iface); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + IFilterGraph2_RemoveFilter(graph, &testsink->filter.IBaseFilter_iface); + ref = IBaseFilter_Release(&testsink->filter.IBaseFilter_iface); + ok(!ref, "Got outstanding refcount %ld.\n", ref); +} + +#define check_pin_info(a, b, c, d) check_pin_info_(__LINE__, a, b, c, d) +static void check_pin_info_(int line, IBaseFilter *filter, IPin *pin, const WCHAR *expect_id, PIN_DIRECTION expect_dir) +{ + PIN_DIRECTION dir; + PIN_INFO info; + ULONG count; + HRESULT hr; + IPin *pin2; + WCHAR *id; + + hr = IPin_QueryPinInfo(pin, &info); + ok_(__FILE__, line)(hr == S_OK, "Got hr %#lx.\n", hr); + ok_(__FILE__, line)(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter); + ok_(__FILE__, line)(info.dir == expect_dir, "Got direction %d.\n", info.dir); + ok_(__FILE__, line)(!wcscmp(info.achName, expect_id), "Got name %s.\n", debugstr_w(info.achName)); + IBaseFilter_Release(info.pFilter); + + hr = IPin_QueryDirection(pin, &dir); + ok_(__FILE__, line)(hr == S_OK, "Got hr %#lx.\n", hr); + ok_(__FILE__, line)(dir == expect_dir, "Got direction %d.\n", dir); + + hr = IPin_QueryId(pin, &id); + ok_(__FILE__, line)(hr == S_OK, "Got hr %#lx.\n", hr); + ok_(__FILE__, line)(!wcscmp(id, expect_id), "Got id %s.\n", debugstr_w(id)); + CoTaskMemFree(id); + + hr = IPin_QueryInternalConnections(pin, NULL, &count); + ok_(__FILE__, line)(hr == E_NOTIMPL, "Got hr %#lx.\n", hr); + + hr = IBaseFilter_FindPin(filter, expect_id, &pin2); + ok_(__FILE__, line)(hr == S_OK, "Got hr %#lx.\n", hr); + ok_(__FILE__, line)(pin2 == pin, "Pins didn't match.\n"); + IPin_Release(pin2); +} + +static void test_enum_pins(void) +{ + AM_MEDIA_TYPE req_mt = + { + .majortype = MEDIATYPE_Stream, + .subtype = MEDIASUBTYPE_Avi, + .formattype = FORMAT_None, + .bTemporalCompression = TRUE, + }; + IBaseFilter *filter = create_infinite_tee(); + struct testfilter testsource, testsinks[2]; + IEnumPins *enum1, *enum2; + IFilterGraph2 *graph; + IPin *pins[5], *sink; + ULONG count, ref; + HRESULT hr; + + /* Tests for basic IEnumPins behaviour. */ + + ref = get_refcount(filter); + ok(ref == 1, "Got unexpected refcount %ld.\n", ref); + + hr = IBaseFilter_EnumPins(filter, NULL); + ok(hr == E_POINTER, "Got hr %#lx.\n", hr); + + hr = IBaseFilter_EnumPins(filter, &enum1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ref = get_refcount(filter); + ok(ref == 2, "Got unexpected refcount %ld.\n", ref); + ref = get_refcount(enum1); + ok(ref == 1, "Got unexpected refcount %ld.\n", ref); + + hr = IEnumPins_Next(enum1, 1, NULL, NULL); + ok(hr == E_POINTER, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ref = get_refcount(filter); + ok(ref == 3, "Got unexpected refcount %ld.\n", ref); + ref = get_refcount(pins[0]); + ok(ref == 3, "Got unexpected refcount %ld.\n", ref); + ref = get_refcount(enum1); + ok(ref == 1, "Got unexpected refcount %ld.\n", ref); + IPin_Release(pins[0]); + ref = get_refcount(filter); + ok(ref == 2, "Got unexpected refcount %ld.\n", ref); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ref = get_refcount(filter); + todo_wine ok(ref == 2, "Got unexpected refcount %ld.\n", ref); + ref = get_refcount(pins[0]); + todo_wine ok(ref == 2, "Got unexpected refcount %ld.\n", ref); + ref = get_refcount(enum1); + ok(ref == 1, "Got unexpected refcount %ld.\n", ref); + IPin_Release(pins[0]); + ref = get_refcount(filter); + ok(ref == 2, "Got unexpected refcount %ld.\n", ref); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Next(enum1, 1, pins, &count); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(count == 1, "Got count %lu.\n", count); + IPin_Release(pins[0]); + + hr = IEnumPins_Next(enum1, 1, pins, &count); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(count == 1, "Got count %lu.\n", count); + IPin_Release(pins[0]); + + hr = IEnumPins_Next(enum1, 1, pins, &count); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(!count, "Got count %lu.\n", count); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Next(enum1, 2, pins, NULL); + ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Next(enum1, 2, pins, &count); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(count == 2, "Got count %lu.\n", count); + IPin_Release(pins[0]); + IPin_Release(pins[1]); + + hr = IEnumPins_Next(enum1, 2, pins, &count); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(!count, "Got count %lu.\n", count); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Next(enum1, 3, pins, &count); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(count == 2, "Got count %lu.\n", count); + IPin_Release(pins[0]); + IPin_Release(pins[1]); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Clone(enum1, &enum2); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Skip(enum1, 3); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Skip(enum1, 2); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Skip(enum1, 1); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Next(enum2, 1, pins, NULL); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + IPin_Release(pins[0]); + + IEnumPins_Release(enum2); + + /* Test pin information. + * + * Connecting to a pin adds a new pin at the end of the list. + * Disconnecting from a pin removes the pin that is disconnected from + * (rather than, say, whatever pin is currently not connected). */ + + testfilter_init(&testsource); + CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, + &IID_IFilterGraph2, (void **)&graph); + IFilterGraph2_AddFilter(graph, &testsource.filter.IBaseFilter_iface, L"source"); + IFilterGraph2_AddFilter(graph, filter, L"tee"); + IBaseFilter_FindPin(filter, L"Input", &sink); + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IEnumPins_Next(enum1, 5, pins, &count); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(count == 2, "Got count %lu.\n", count); + check_pin_info(filter, pins[0], L"Input", PINDIR_INPUT); + check_pin_info(filter, pins[1], L"Output1", PINDIR_OUTPUT); + IPin_Release(pins[0]); + IPin_Release(pins[1]); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + testsink_add(&testsinks[0], filter, graph, L"Output1"); + + hr = IEnumPins_Next(enum1, 5, pins, &count); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(count == 3, "Got count %lu.\n", count); + check_pin_info(filter, pins[0], L"Input", PINDIR_INPUT); + check_pin_info(filter, pins[1], L"Output1", PINDIR_OUTPUT); + check_pin_info(filter, pins[2], L"Output2", PINDIR_OUTPUT); + IPin_Release(pins[0]); + IPin_Release(pins[1]); + IPin_Release(pins[2]); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + testsink_remove(&testsinks[0], filter, graph); + + hr = IEnumPins_Next(enum1, 5, pins, &count); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(count == 2, "Got count %lu.\n", count); + check_pin_info(filter, pins[0], L"Input", PINDIR_INPUT); + check_pin_info(filter, pins[1], L"Output2", PINDIR_OUTPUT); + IPin_Release(pins[0]); + IPin_Release(pins[1]); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + testsink_add(&testsinks[0], filter, graph, L"Output2"); + + hr = IEnumPins_Next(enum1, 5, pins, &count); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(count == 3, "Got count %lu.\n", count); + check_pin_info(filter, pins[0], L"Input", PINDIR_INPUT); + check_pin_info(filter, pins[1], L"Output2", PINDIR_OUTPUT); + check_pin_info(filter, pins[2], L"Output3", PINDIR_OUTPUT); + IPin_Release(pins[0]); + IPin_Release(pins[1]); + IPin_Release(pins[2]); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + testsink_add(&testsinks[1], filter, graph, L"Output3"); + testsink_remove(&testsinks[1], filter, graph); + testsink_add(&testsinks[1], filter, graph, L"Output4"); + + hr = IEnumPins_Next(enum1, 5, pins, &count); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(count == 4, "Got count %lu.\n", count); + check_pin_info(filter, pins[0], L"Input", PINDIR_INPUT); + check_pin_info(filter, pins[1], L"Output2", PINDIR_OUTPUT); + check_pin_info(filter, pins[2], L"Output4", PINDIR_OUTPUT); + check_pin_info(filter, pins[3], L"Output5", PINDIR_OUTPUT); + IPin_Release(pins[0]); + IPin_Release(pins[1]); + IPin_Release(pins[2]); + IPin_Release(pins[3]); + + testsink_remove(&testsinks[0], filter, graph); + testsink_remove(&testsinks[1], filter, graph); + + IEnumPins_Release(enum1); + + IFilterGraph2_Disconnect(graph, &testsource.source.pin.IPin_iface); + IFilterGraph2_Disconnect(graph, sink); + IPin_Release(sink); + ref = IFilterGraph2_Release(graph); + ok(!ref, "Got outstanding refcount %ld.\n", ref); + ref = IBaseFilter_Release(&testsource.filter.IBaseFilter_iface); + ok(!ref, "Got outstanding refcount %ld.\n", ref); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %ld.\n", ref); +} + +static const GUID test_iid = {0x33333333}; +static LONG outer_ref = 1; + +static HRESULT WINAPI outer_QueryInterface(IUnknown *iface, REFIID iid, void **out) +{ + if (IsEqualGUID(iid, &IID_IUnknown) + || IsEqualGUID(iid, &IID_IBaseFilter) + || IsEqualGUID(iid, &test_iid)) + { + *out = (IUnknown *)0xdeadbeef; + return S_OK; + } + ok(0, "unexpected call %s\n", wine_dbgstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI outer_AddRef(IUnknown *iface) +{ + return InterlockedIncrement(&outer_ref); +} + +static ULONG WINAPI outer_Release(IUnknown *iface) +{ + return InterlockedDecrement(&outer_ref); +} + +static const IUnknownVtbl outer_vtbl = +{ + outer_QueryInterface, + outer_AddRef, + outer_Release, +}; + +static IUnknown test_outer = {&outer_vtbl}; + +static void test_aggregation(void) +{ + IBaseFilter *filter, *filter2; + IUnknown *unk, *unk2; + HRESULT hr; + ULONG ref; + + filter = (IBaseFilter *)0xdeadbeef; + hr = CoCreateInstance(&CLSID_InfTee, &test_outer, CLSCTX_INPROC_SERVER, + &IID_IBaseFilter, (void **)&filter); + ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr); + ok(!filter, "Got interface %p.\n", filter); + + hr = CoCreateInstance(&CLSID_InfTee, &test_outer, CLSCTX_INPROC_SERVER, + &IID_IUnknown, (void **)&unk); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref); + ok(unk != &test_outer, "Returned IUnknown should not be outer IUnknown.\n"); + ref = get_refcount(unk); + ok(ref == 1, "Got unexpected refcount %ld.\n", ref); + + ref = IUnknown_AddRef(unk); + ok(ref == 2, "Got unexpected refcount %ld.\n", ref); + ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref); + + ref = IUnknown_Release(unk); + ok(ref == 1, "Got unexpected refcount %ld.\n", ref); + ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref); + + hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void **)&unk2); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(unk2 == unk, "Got unexpected IUnknown %p.\n", unk2); + IUnknown_Release(unk2); + + hr = IUnknown_QueryInterface(unk, &IID_IBaseFilter, (void **)&filter); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IBaseFilter_QueryInterface(filter, &IID_IUnknown, (void **)&unk2); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2); + + hr = IBaseFilter_QueryInterface(filter, &IID_IBaseFilter, (void **)&filter2); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(filter2 == (IBaseFilter *)0xdeadbeef, "Got unexpected IBaseFilter %p.\n", filter2); + + hr = IUnknown_QueryInterface(unk, &test_iid, (void **)&unk2); + ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr); + ok(!unk2, "Got unexpected IUnknown %p.\n", unk2); + + hr = IBaseFilter_QueryInterface(filter, &test_iid, (void **)&unk2); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2); + + IBaseFilter_Release(filter); + ref = IUnknown_Release(unk); + ok(!ref, "Got unexpected refcount %ld.\n", ref); + ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref); +} + +static void test_enum_media_types(void) +{ + IBaseFilter *filter = create_infinite_tee(); + IEnumMediaTypes *enum1, *enum2; + AM_MEDIA_TYPE *mts[2]; + ULONG ref, count; + HRESULT hr; + IPin *pin; + + IBaseFilter_FindPin(filter, L"Input", &pin); + + hr = IPin_EnumMediaTypes(pin, &enum1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + hr = IEnumMediaTypes_Next(enum1, 1, mts, &count); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(!count, "Got count %lu.\n", count); + + hr = IEnumMediaTypes_Reset(enum1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + hr = IEnumMediaTypes_Clone(enum1, &enum2); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IEnumMediaTypes_Skip(enum1, 1); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + IEnumMediaTypes_Release(enum1); + IEnumMediaTypes_Release(enum2); + IPin_Release(pin); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %ld.\n", ref); +} + +static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_infinite_tee(); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %ld.\n", ref); +} + +static void test_source_media_types(const AM_MEDIA_TYPE *connection_mt, const AM_MEDIA_TYPE *source_mt, IPin *source) +{ + IEnumMediaTypes *enummt; + AM_MEDIA_TYPE *mts[3]; + AM_MEDIA_TYPE req_mt; + ULONG count; + HRESULT hr; + + hr = IPin_EnumMediaTypes(source, &enummt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IEnumMediaTypes_Next(enummt, 3, mts, &count); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(count == 1, "Got %lu types.\n", count); + ok(compare_media_types(mts[0], source_mt), "Media types didn't match.\n"); + CoTaskMemFree(mts[0]); + IEnumMediaTypes_Release(enummt); + + /* The smart tee has some logic to accept the connection media type. The + * infinite tee does not; it defers straight to the upstream filter. */ + + hr = IPin_QueryAccept(source, connection_mt); + todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + hr = IPin_QueryAccept(source, source_mt); + todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + req_mt.majortype = MEDIATYPE_Audio; + req_mt.subtype = MEDIASUBTYPE_PCM; + req_mt.formattype = test_iid; + req_mt.cbFormat = sizeof(count); + req_mt.pbFormat = (BYTE *)&count; + req_mt.bTemporalCompression = TRUE; + hr = IPin_QueryAccept(source, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); +} + +static void test_source_connection(const AM_MEDIA_TYPE *source_mt, IFilterGraph2 *graph, + IMediaControl *control, struct testfilter *testsink, struct testfilter *testsource, IPin *source) +{ + AM_MEDIA_TYPE req_mt = *source_mt; + ALLOCATOR_PROPERTIES props; + AM_MEDIA_TYPE mt; + HRESULT hr; + IPin *peer; + + ok(testsource->got_connect == 1, "Got %u calls to Connect().\n", testsource->got_connect); + testsource->got_connect = 0; + + peer = (IPin *)0xdeadbeef; + hr = IPin_ConnectedTo(source, &peer); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + ok(!peer, "Got peer %p.\n", peer); + + hr = IPin_ConnectionMediaType(source, &mt); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + + /* Exact connection. */ + + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#lx.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + /* QueryAccept() upstream is consulted. */ + + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, &req_mt); + todo_wine ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#lx.\n", hr); + if (hr == S_OK) + { + IFilterGraph2_Disconnect(graph, source); + IFilterGraph2_Disconnect(graph, &testsink->sink.pin.IPin_iface); + } + req_mt.bTemporalCompression = TRUE; + + /* The upstream filter is disconnected and reconnected with the new media + * type. Matching the upstream media type at all a priori is not necessary. + * FIXME ZF: How does having multiple output pins affect this? */ + + req_mt.majortype = MEDIATYPE_Audio; + ok(testsource->got_connect == 0, "Got %u calls to Connect().\n", testsource->got_connect); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine ok(testsource->got_connect == 1, "Got %u calls to Connect().\n", testsource->got_connect); + todo_wine ok(compare_media_types(&testsource->source.pin.mt, &req_mt), "Expected media type to be changed.\n"); + testsource->got_connect = 0; + + hr = IPin_ConnectedTo(source, &peer); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(peer == &testsink->sink.pin.IPin_iface, "Got peer %p.\n", peer); + IPin_Release(peer); + + hr = IPin_ConnectionMediaType(source, &mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(compare_media_types(&mt, &req_mt), "Media types didn't match.\n"); + ok(compare_media_types(&testsink->sink.pin.mt, &req_mt), "Media types didn't match.\n"); + + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#lx.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + ok(testsink->sink.pAllocator && testsink->sink.pAllocator != testsource->source.pAllocator, + "Got unexpected allocator %p.\n", testsink->sink.pAllocator); + + /* The sink allocators get the same properties as the source allocator. */ + hr = IMemAllocator_GetProperties(testsink->sink.pAllocator, &props); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(props.cBuffers == 1, "Got %ld buffers.\n", props.cBuffers); + ok(props.cbBuffer == 256, "Got size %ld.\n", props.cbBuffer); + ok(props.cbAlign == 1, "Got alignment %ld.\n", props.cbAlign); + ok(!props.cbPrefix, "Got prefix %ld.\n", props.cbPrefix); + + hr = IFilterGraph2_Disconnect(graph, source); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(testsink->sink.pin.peer == source, "Got peer %p.\n", testsink->sink.pin.peer); + IFilterGraph2_Disconnect(graph, &testsink->sink.pin.IPin_iface); + + /* The upstream filter isn't reconnected if the media type was already the + * same. */ + + ok(testsource->got_connect == 0, "Got %u calls to Connect().\n", testsource->got_connect); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(testsource->got_connect == 0, "Got %u calls to Connect().\n", testsource->got_connect); + IFilterGraph2_Disconnect(graph, source); + IFilterGraph2_Disconnect(graph, &testsink->sink.pin.IPin_iface); + + /* Connection with wildcards. QueryAccept() is still consulted. */ + + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, NULL); + todo_wine ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#lx.\n", hr); + if (hr == S_OK) + { + IFilterGraph2_Disconnect(graph, source); + IFilterGraph2_Disconnect(graph, &testsink->sink.pin.IPin_iface); + } + + testsource->require_temporal_compression = false; + + ok(testsource->got_connect == 0, "Got %u calls to Connect().\n", testsource->got_connect); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, NULL); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(compare_media_types(&testsink->sink.pin.mt, source_mt), "Media types didn't match.\n"); + todo_wine ok(compare_media_types(&testsource->source.pin.mt, source_mt), "Media types didn't match.\n"); + todo_wine ok(testsource->got_connect == 1, "Got %u calls to Connect().\n", testsource->got_connect); + testsource->got_connect = 0; + IFilterGraph2_Disconnect(graph, source); + IFilterGraph2_Disconnect(graph, &testsink->sink.pin.IPin_iface); + + req_mt.majortype = GUID_NULL; + ok(testsource->got_connect == 0, "Got %u calls to Connect().\n", testsource->got_connect); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(compare_media_types(&testsink->sink.pin.mt, source_mt), "Media types didn't match.\n"); + ok(testsource->got_connect == 0, "Got %u calls to Connect().\n", testsource->got_connect); + IFilterGraph2_Disconnect(graph, source); + IFilterGraph2_Disconnect(graph, &testsink->sink.pin.IPin_iface); + + req_mt.subtype = MEDIASUBTYPE_RGB32; + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, &req_mt); + ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#lx.\n", hr); + + req_mt.subtype = GUID_NULL; + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(compare_media_types(&testsink->sink.pin.mt, source_mt), "Media types didn't match.\n"); + IFilterGraph2_Disconnect(graph, source); + IFilterGraph2_Disconnect(graph, &testsink->sink.pin.IPin_iface); + + req_mt.formattype = FORMAT_WaveFormatEx; + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, &req_mt); + ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#lx.\n", hr); + + req_mt = *source_mt; + req_mt.formattype = GUID_NULL; + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(compare_media_types(&testsink->sink.pin.mt, source_mt), "Media types didn't match.\n"); + IFilterGraph2_Disconnect(graph, source); + IFilterGraph2_Disconnect(graph, &testsink->sink.pin.IPin_iface); + + req_mt.subtype = MEDIASUBTYPE_RGB32; + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, &req_mt); + ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#lx.\n", hr); + + req_mt.subtype = GUID_NULL; + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(compare_media_types(&testsink->sink.pin.mt, source_mt), "Media types didn't match.\n"); + IFilterGraph2_Disconnect(graph, source); + IFilterGraph2_Disconnect(graph, &testsink->sink.pin.IPin_iface); + + req_mt.majortype = MEDIATYPE_Audio; + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, &req_mt); + ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#lx.\n", hr); + + /* Test enumeration of sink media types. */ + + req_mt.majortype = MEDIATYPE_Audio; + req_mt.subtype = MEDIASUBTYPE_PCM; + req_mt.formattype = test_iid; + testsink->sink_mt = &req_mt; + + ok(testsource->got_connect == 0, "Got %u calls to Connect().\n", testsource->got_connect); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, NULL); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(compare_media_types(&testsink->sink.pin.mt, &req_mt), "Media types didn't match.\n"); + todo_wine ok(compare_media_types(&testsource->source.pin.mt, &req_mt), "Media types didn't match.\n"); + todo_wine ok(testsource->got_connect == 1, "Got %u calls to Connect().\n", testsource->got_connect); + testsource->got_connect = 0; + IFilterGraph2_Disconnect(graph, source); + IFilterGraph2_Disconnect(graph, &testsink->sink.pin.IPin_iface); + + testsink->sink_mt = NULL; + + testsource->require_temporal_compression = true; +} + +static void test_connect_pin(void) +{ + AM_MEDIA_TYPE req_mt = + { + .majortype = MEDIATYPE_Stream, + .subtype = MEDIASUBTYPE_Avi, + .formattype = FORMAT_None, + .lSampleSize = 1, + }; + IBaseFilter *filter = create_infinite_tee(); + struct testfilter testsource, testsink, testsink2; + IPin *sink, *source1, *source2, *peer; + AM_MEDIA_TYPE mt, *mts[3]; + IEnumMediaTypes *enummt; + IMediaControl *control; + IFilterGraph2 *graph; + HRESULT hr; + ULONG ref; + + testfilter_init(&testsource); + testfilter_init(&testsink); + testfilter_init(&testsink2); + CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, + &IID_IFilterGraph2, (void **)&graph); + IFilterGraph2_AddFilter(graph, &testsource.filter.IBaseFilter_iface, L"source"); + IFilterGraph2_AddFilter(graph, &testsink.filter.IBaseFilter_iface, L"sink"); + IFilterGraph2_AddFilter(graph, &testsink2.filter.IBaseFilter_iface, L"sink2"); + IFilterGraph2_AddFilter(graph, filter, L"tee"); + IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); + IBaseFilter_FindPin(filter, L"Input", &sink); + IBaseFilter_FindPin(filter, L"Output1", &source1); + + testsource.source_mt.majortype = MEDIATYPE_Video; + testsource.source_mt.subtype = MEDIASUBTYPE_RGB8; + testsource.source_mt.formattype = FORMAT_VideoInfo; + + hr = IPin_EnumMediaTypes(sink, &enummt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IEnumMediaTypes_Next(enummt, 1, mts, NULL); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + IEnumMediaTypes_Release(enummt); + + hr = IPin_EnumMediaTypes(source1, &enummt); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + + hr = IPin_QueryAccept(sink, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IPin_QueryAccept(source1, &req_mt); + todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + /* Test sink connection. */ + + peer = (IPin *)0xdeadbeef; + hr = IPin_ConnectedTo(sink, &peer); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + ok(!peer, "Got peer %p.\n", peer); + + hr = IPin_ConnectionMediaType(sink, &mt); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#lx.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IPin_ConnectedTo(sink, &peer); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(peer == &testsource.source.pin.IPin_iface, "Got peer %p.\n", peer); + IPin_Release(peer); + + hr = IPin_ConnectionMediaType(sink, &mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(compare_media_types(&mt, &req_mt), "Media types didn't match.\n"); + + hr = IPin_EnumMediaTypes(sink, &enummt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IEnumMediaTypes_Next(enummt, 1, mts, NULL); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + IEnumMediaTypes_Release(enummt); + + test_source_media_types(&req_mt, &testsource.source_mt, source1); + test_source_connection(&testsource.source_mt, graph, control, &testsink, &testsource, source1); + + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IFilterGraph2_Disconnect(graph, sink); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#lx.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IFilterGraph2_Disconnect(graph, sink); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IFilterGraph2_Disconnect(graph, sink); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(testsource.source.pin.peer == sink, "Got peer %p.\n", testsource.source.pin.peer); + IFilterGraph2_Disconnect(graph, &testsource.source.pin.IPin_iface); + + peer = (IPin *)0xdeadbeef; + hr = IPin_ConnectedTo(sink, &peer); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + ok(!peer, "Got peer %p.\n", peer); + + hr = IPin_ConnectionMediaType(sink, &mt); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + + /* Test connection of a second source while there's already a source + * connected. */ + req_mt.bTemporalCompression = TRUE; + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source1, &testsink.sink.pin.IPin_iface, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + req_mt.bTemporalCompression = FALSE; + + IBaseFilter_FindPin(filter, L"Output10", &source2); + test_source_connection(&testsource.source_mt, graph, control, &testsink2, &testsource, source2); + IPin_Release(source2); + + hr = IFilterGraph2_Disconnect(graph, source1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IFilterGraph2_Disconnect(graph, &testsink.sink.pin.IPin_iface); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + IFilterGraph2_Disconnect(graph, sink); + IFilterGraph2_Disconnect(graph, &testsource.source.pin.IPin_iface); + + IPin_Release(sink); + IPin_Release(source1); + IMediaControl_Release(control); + ref = IFilterGraph2_Release(graph); + ok(!ref, "Got outstanding refcount %ld.\n", ref); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %ld.\n", ref); + ref = IBaseFilter_Release(&testsource.filter.IBaseFilter_iface); + ok(!ref, "Got outstanding refcount %ld.\n", ref); + ref = IBaseFilter_Release(&testsink.filter.IBaseFilter_iface); + ok(!ref, "Got outstanding refcount %ld.\n", ref); + ref = IBaseFilter_Release(&testsink2.filter.IBaseFilter_iface); + ok(!ref, "Got outstanding refcount %ld.\n", ref); +} + +static void test_streaming(void) +{ + AM_MEDIA_TYPE req_mt = + { + .majortype = MEDIATYPE_Stream, + .subtype = MEDIASUBTYPE_Avi, + .formattype = FORMAT_None, + .bTemporalCompression = TRUE, + }; + IBaseFilter *filter = create_infinite_tee(); + struct testfilter testsource, testsinks[2]; + REFERENCE_TIME start, stop; + IMemAllocator *allocator; + IMediaControl *control; + IFilterGraph2 *graph; + IMediaSample *sample; + IMemInputPin *input; + LONG size, i; + HRESULT hr; + IPin *sink; + BYTE *data; + ULONG ref; + + testfilter_init(&testsource); + CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, + &IID_IFilterGraph2, (void **)&graph); + IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); + IFilterGraph2_AddFilter(graph, &testsource.filter.IBaseFilter_iface, L"source"); + IFilterGraph2_AddFilter(graph, filter, L"tee"); + IBaseFilter_FindPin(filter, L"Input", &sink); + IPin_QueryInterface(sink, &IID_IMemInputPin, (void **)&input); + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + testsink_add(&testsinks[0], filter, graph, L"Output1"); + testsink_add(&testsinks[1], filter, graph, L"Output2"); + + hr = IMemInputPin_ReceiveCanBlock(input); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IMemInputPin_GetAllocator(input, &allocator); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0); + ok(hr == VFW_E_NOT_COMMITTED, "Got hr %#lx.\n", hr); + + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0); + todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); + if (hr != S_OK) + { + IMemAllocator_Commit(allocator); + hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + } + + hr = IMediaSample_GetPointer(sample, &data); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + size = IMediaSample_GetSize(sample); + ok(size == 256, "Got size %ld.\n", size); + for (i = 0; i < 200; ++i) + data[i] = i; + hr = IMediaSample_SetActualDataLength(sample, 200); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + start = 10000; + stop = 20000; + hr = IMediaSample_SetMediaTime(sample, &start, &stop); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + start = 30000; + stop = 40000; + hr = IMediaSample_SetTime(sample, &start, &stop); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IMediaSample_SetDiscontinuity(sample, TRUE); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IMediaSample_SetPreroll(sample, TRUE); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IMediaSample_SetSyncPoint(sample, TRUE); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IMemInputPin_Receive(input, sample); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(!WaitForSingleObject(testsinks[0].sample_event, 1000), "Wait timed out.\n"); + ok(!WaitForSingleObject(testsinks[1].sample_event, 1000), "Wait timed out.\n"); + + hr = IPin_NewSegment(sink, 10000, 20000, 1.0); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(!WaitForSingleObject(testsinks[0].segment_event, 1000), "Wait timed out.\n"); + ok(!WaitForSingleObject(testsinks[1].segment_event, 1000), "Wait timed out.\n"); + + hr = IPin_EndOfStream(sink); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(!WaitForSingleObject(testsinks[0].eos_event, 1000), "Wait timed out.\n"); + ok(!WaitForSingleObject(testsinks[1].eos_event, 1000), "Wait timed out.\n"); + + hr = IPin_EndOfStream(sink); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(!WaitForSingleObject(testsinks[0].eos_event, 1000), "Wait timed out.\n"); + ok(!WaitForSingleObject(testsinks[1].eos_event, 1000), "Wait timed out.\n"); + + ok(!testsinks[0].got_begin_flush, "Got %u calls to IPin::BeginFlush().\n", testsinks[0].got_begin_flush); + ok(!testsinks[1].got_begin_flush, "Got %u calls to IPin::BeginFlush().\n", testsinks[1].got_begin_flush); + hr = IPin_BeginFlush(sink); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(testsinks[0].got_begin_flush == 1, "Got %u calls to IPin::BeginFlush().\n", testsinks[0].got_begin_flush); + ok(testsinks[1].got_begin_flush == 1, "Got %u calls to IPin::BeginFlush().\n", testsinks[1].got_begin_flush); + + hr = IMemInputPin_Receive(input, sample); + todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + hr = IPin_EndOfStream(sink); + todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); + /* No EOS events are sent downstream, however. */ + + ok(!testsinks[0].got_end_flush, "Got %u calls to IPin::EndFlush().\n", testsinks[0].got_end_flush); + ok(!testsinks[1].got_end_flush, "Got %u calls to IPin::EndFlush().\n", testsinks[1].got_end_flush); + hr = IPin_EndFlush(sink); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(testsinks[0].got_end_flush == 1, "Got %u calls to IPin::EndFlush().\n", testsinks[0].got_end_flush); + ok(testsinks[1].got_end_flush == 1, "Got %u calls to IPin::EndFlush().\n", testsinks[1].got_end_flush); + + hr = IMemInputPin_Receive(input, sample); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(!WaitForSingleObject(testsinks[0].sample_event, 1000), "Wait timed out.\n"); + ok(!WaitForSingleObject(testsinks[1].sample_event, 1000), "Wait timed out.\n"); + + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IMemInputPin_Receive(input, sample); + todo_wine ok(hr == VFW_E_WRONG_STATE, "Got hr %#lx.\n", hr); + + hr = IPin_EndOfStream(sink); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + /* No EOS events are sent downstream, however. */ + + IMediaSample_Release(sample); + IMemAllocator_Release(allocator); + + testsink_remove(&testsinks[0], filter, graph); + testsink_remove(&testsinks[1], filter, graph); + IFilterGraph2_Disconnect(graph, &testsource.source.pin.IPin_iface); + IFilterGraph2_Disconnect(graph, sink); + IMemInputPin_Release(input); + IPin_Release(sink); + IMediaControl_Release(control); + ref = IFilterGraph2_Release(graph); + ok(!ref, "Got outstanding refcount %ld.\n", ref); + ref = IBaseFilter_Release(&testsource.filter.IBaseFilter_iface); + ok(!ref, "Got outstanding refcount %ld.\n", ref); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %ld.\n", ref); +} + +START_TEST(inftee) +{ + CoInitialize(NULL); + + test_interfaces(); + test_enum_pins(); + test_aggregation(); + test_enum_media_types(); + test_unconnected_filter_state(); + test_connect_pin(); + test_streaming(); + + CoUninitialize(); +} diff --git a/libs/strmbase/pin.c b/libs/strmbase/pin.c index 03330837477b..70264dcb0ec8 100644 --- a/libs/strmbase/pin.c +++ b/libs/strmbase/pin.c @@ -569,10 +569,11 @@ static HRESULT WINAPI source_Disconnect(IPin *iface) { HRESULT hr; struct strmbase_source *This = impl_source_from_IPin(iface); + struct strmbase_filter *filter = This->pin.filter; TRACE("pin %p %s:%s.\n", This, debugstr_w(This->pin.filter->name), debugstr_w(This->pin.name)); - EnterCriticalSection(&This->pin.filter->filter_cs); + EnterCriticalSection(&filter->filter_cs); { if (This->pin.filter->state != State_Stopped) { @@ -581,9 +582,6 @@ static HRESULT WINAPI source_Disconnect(IPin *iface) return VFW_E_NOT_STOPPED; } - if (This->pFuncsTable->source_disconnect) - This->pFuncsTable->source_disconnect(This); - if (This->pMemInputPin) { IMemInputPin_Release(This->pMemInputPin); @@ -606,8 +604,11 @@ static HRESULT WINAPI source_Disconnect(IPin *iface) } else hr = S_FALSE; + + if (This->pFuncsTable->source_disconnect) + This->pFuncsTable->source_disconnect(This); } - LeaveCriticalSection(&This->pin.filter->filter_cs); + LeaveCriticalSection(&filter->filter_cs); return hr; } From 79c4fe5ecf040ea52db98aa8954738210ebad533 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 9 Sep 2024 19:19:37 -0600 Subject: [PATCH 0828/2542] d2d1: HACK: Ignore text rendering params for Spell Force 3. CW-Bug-Id: #24212 --- dlls/d2d1/device.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index 75da15c99a56..fe66c66b5d3e 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -1668,6 +1668,15 @@ static void STDMETHODCALLTYPE d2d_device_context_SetTextRenderingParams(ID2D1Dev TRACE("iface %p, text_rendering_params %p.\n", iface, text_rendering_params); + { + const char *sgi = getenv("SteamGameId"); + if (sgi && !strcmp(sgi, "1416260")) + { + FIXME("HACK: ignoring params.\n"); + return; + } + } + if (context->target.type == D2D_TARGET_COMMAND_LIST) d2d_command_list_set_text_rendering_params(context->target.command_list, text_rendering_params); From 75441ee92202cce2adc778dd60563065bdcda305 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 19 Sep 2024 17:45:28 -0600 Subject: [PATCH 0829/2542] winex11.drv: Set X window property to indicate if the presentation may flip. CW-Bug-Id: #24273 --- dlls/winex11.drv/opengl.c | 5 ++++- dlls/winex11.drv/window.c | 12 ++++++++++++ dlls/winex11.drv/x11drv.h | 1 + dlls/winex11.drv/x11drv_main.c | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 5428882751a4..990f5c13c6c5 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1888,6 +1888,8 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct glx_pixel #ifdef SONAME_LIBXCOMPOSITE else if(usexcomposite) { + unsigned int allow_flip = 0; + gl->type = DC_GL_CHILD_WIN; gl->colormap = XCreateColormap( gdi_display, get_dummy_parent(), visual->visual, (visual->class == PseudoColor || visual->class == GrayScale || @@ -1901,7 +1903,8 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct glx_pixel gl->drawable = pglXCreateWindow( gdi_display, gl->format->fbconfig, gl->window, NULL ); pXCompositeRedirectWindow( gdi_display, gl->window, CompositeRedirectManual ); - + XChangeProperty( gdi_display, gl->window, x11drv_atom(_WINE_ALLOW_FLIP), XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)&allow_flip, sizeof(allow_flip) / 4 ); if ((data = get_win_data( hwnd ))) { detach_client_window( data, gl->window ); diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 499f883b68fe..d54b2650dc51 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2016,11 +2016,19 @@ static void client_window_events_disable( struct x11drv_win_data *data, Window c XDeleteContext( data->display, client_window, winContext ); } +static void set_wine_allow_flip( Window client_window, unsigned int allow_flip ) +{ + if (client_window) XChangeProperty( gdi_display, client_window, x11drv_atom(_WINE_ALLOW_FLIP), XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)&allow_flip, sizeof(allow_flip) / 4 ); +} + /********************************************************************** * detach_client_window */ void detach_client_window( struct x11drv_win_data *data, Window client_window ) { + if (client_window) set_wine_allow_flip( client_window, 0 ); + if (data->client_window != client_window || !client_window) return; TRACE( "%p/%lx detaching client window %lx\n", data->hwnd, data->whole_window, client_window ); @@ -2052,6 +2060,7 @@ void attach_client_window( struct x11drv_win_data *data, Window client_window ) XReparentWindow( gdi_display, client_window, data->whole_window, data->rects.client.left - data->rects.visible.left, data->rects.client.top - data->rects.visible.top ); } + set_wine_allow_flip( client_window, 1 ); data->client_window = client_window; } @@ -2122,6 +2131,7 @@ Window create_client_window( HWND hwnd, RECT client_rect, const XVisualInfo *vis CWBackingStore | CWColormap | CWBorderPixel, &attr ); if (data->client_window) { + set_wine_allow_flip( data->client_window, 1 ); XMapWindow( gdi_display, data->client_window ); if (data->whole_window) { @@ -2175,6 +2185,8 @@ static void create_whole_window( struct x11drv_win_data *data ) cx, cy, 0, data->vis.depth, InputOutput, data->vis.visual, mask, &attr ); if (!data->whole_window) goto done; + set_wine_allow_flip( data->whole_window, 0 ); + SetRect( &data->current_state.rect, pos.x, pos.y, pos.x + cx, pos.y + cy ); data->pending_state.rect = data->current_state.rect; data->desired_state.rect = data->current_state.rect; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 1c9843f9993f..15f5e1efab58 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -527,6 +527,7 @@ enum x11drv_atoms XATOM__GTK_WORKAREAS_D0, XATOM__XEMBED, XATOM__XEMBED_INFO, + XATOM__WINE_ALLOW_FLIP, XATOM__WINE_HWND_STYLE, XATOM__WINE_HWND_EXSTYLE, XATOM_XdndAware, diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index a901d4a68ebe..5203092a6726 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -164,6 +164,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "_GTK_WORKAREAS_D0", "_XEMBED", "_XEMBED_INFO", + "_WINE_ALLOW_FLIP", "_WINE_HWND_STYLE", "_WINE_HWND_EXSTYLE", "XdndAware", From fe0491fe944b87bf29a694867745a385e599472b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 21 Aug 2024 12:34:42 -0600 Subject: [PATCH 0830/2542] ntdll: Add ftracelog debug channel enabling dumping logs to ftrace. CW-Bug-Id: #19529 --- dlls/ntdll/unix/debug.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/dlls/ntdll/unix/debug.c b/dlls/ntdll/unix/debug.c index 6bac835264e3..2ac1c541094d 100644 --- a/dlls/ntdll/unix/debug.c +++ b/dlls/ntdll/unix/debug.c @@ -47,6 +47,7 @@ WINE_DECLARE_DEBUG_CHANNEL(pid); WINE_DECLARE_DEBUG_CHANNEL(timestamp); WINE_DECLARE_DEBUG_CHANNEL(microsecs); WINE_DEFAULT_DEBUG_CHANNEL(ntdll); +WINE_DECLARE_DEBUG_CHANNEL(ftracelog); struct debug_info { @@ -284,13 +285,9 @@ NTSTATUS unixcall_wine_dbg_write( void *args ) return write( 2, params->str, params->len ); } -unsigned int WINAPI __wine_dbg_ftrace( char *str, unsigned int str_size, unsigned int ctx ) +static void __wine_dbg_ftrace_write( const char *str, unsigned int str_len ) { - static unsigned int curr_ctx; static int ftrace_fd = -1; - unsigned int str_len; - char ctx_str[64]; - int ctx_len; if (ftrace_fd == -1) { @@ -303,14 +300,24 @@ unsigned int WINAPI __wine_dbg_ftrace( char *str, unsigned int str_size, unsigne { MESSAGE( "wine: error opening ftrace file: %s.\n", strerror(errno) ); ftrace_fd = -2; - return 0; + return; } if (!__atomic_compare_exchange_n( &ftrace_fd, &expected, fd, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST )) close( fd ); else MESSAGE( "wine: ftrace initialized.\n" ); } - if (ftrace_fd == -2) return ~0u; + + if (ftrace_fd == -2) return; + write( ftrace_fd, str, str_len ); +} + +unsigned int WINAPI __wine_dbg_ftrace( char *str, unsigned int str_size, unsigned int ctx ) +{ + static unsigned int curr_ctx; + unsigned int str_len; + char ctx_str[64]; + int ctx_len; if (ctx == ~0u) ctx_len = 0; else if (ctx) ctx_len = sprintf( ctx_str, " (end_ctx=%u)", ctx ); @@ -328,7 +335,7 @@ unsigned int WINAPI __wine_dbg_ftrace( char *str, unsigned int str_size, unsigne memcpy( &str[str_len], ctx_str, ctx_len ); str_len += ctx_len; } - write( ftrace_fd, str, str_len ); + __wine_dbg_ftrace_write( str, str_len ); return ctx; } @@ -361,6 +368,7 @@ int __cdecl __wine_dbg_output( const char *str ) { ret += append_output( info, str, end + 1 - str ); write( 2, info->output, info->out_pos ); + if (TRACE_ON(ftracelog)) __wine_dbg_ftrace_write( info->output, info->out_pos ); info->out_pos = 0; str = end + 1; } From a105c7d594caafb8bae69fc913770eccdaa63477 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 17 Sep 2024 15:01:54 -0600 Subject: [PATCH 0831/2542] ntdll: Implement NtSetInformationProcess( ProcessTlsInformation ). CW-Bug-Id: #24258 --- dlls/ntdll/tests/info.c | 265 +++++++++++++++++++++++++++++++++ dlls/ntdll/unix/process.c | 27 ++++ dlls/ntdll/unix/unix_private.h | 1 + dlls/ntdll/unix/virtual.c | 89 +++++++++++ dlls/wow64/process.c | 33 ++++ dlls/wow64/struct32.h | 24 +++ include/winternl.h | 35 +++++ 7 files changed, 474 insertions(+) diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index 7741293d815b..7486c2028385 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -4087,6 +4087,270 @@ static void test_processor_idle_cycle_time(void) ok( size == cpu_count * sizeof(*buffer), "got %#lx.\n", size ); } +static DWORD WINAPI test_set_process_tls_info_thread(void *param) +{ + return 0; +} + +static void test_set_process_tls_info(void) +{ + THREAD_BASIC_INFORMATION tbi; + TEB *teb = NtCurrentTeb(), *thread_teb; + char buffer[1024]; + PROCESS_TLS_INFORMATION *tlsinfo = (PROCESS_TLS_INFORMATION *)buffer; + void **save_tls_pointers[2]; + void *tls_pointer[4], *new_tls_pointer[4], *tls_pointer2[4], *new_tls_pointer2[4]; + unsigned int i; + DWORD thread_id, curr_thread_id = GetCurrentThreadId(); + NTSTATUS status; + HANDLE thread; + BOOL wow = is_wow64 && !old_wow64; + + thread = CreateThread( NULL, 0, test_set_process_tls_info_thread, NULL, CREATE_SUSPENDED, &thread_id ); + do + { + /* workaround currently present Wine bug when thread teb may be not available immediately + * after creating a thread before it is initialized on the Unix side. */ + Sleep( 1 ); + status = NtQueryInformationThread( thread, ThreadBasicInformation, &tbi, sizeof(tbi), NULL ); + ok( !status, "got %#lx.\n", status ); + } while (!(thread_teb = tbi.TebBaseAddress)); + ok( !thread_teb->ThreadLocalStoragePointer, "got %p.\n", thread_teb->ThreadLocalStoragePointer ); + + save_tls_pointers[0] = teb->ThreadLocalStoragePointer; + save_tls_pointers[1] = thread_teb->ThreadLocalStoragePointer; + + for (i = 0; i < ARRAY_SIZE(tls_pointer); ++i) + { + tls_pointer[i] = (void *)(ULONG_PTR)(i + 1); + new_tls_pointer[i] = (void *)(ULONG_PTR)(i + 20); + } + teb->ThreadLocalStoragePointer = tls_pointer; + + /* This flag probably requests WOW64 teb update. */ + tlsinfo->Flags = 1; + tlsinfo->ThreadDataCount = 1; + tlsinfo->OperationType = ProcessTlsReplaceVector; + tlsinfo->TlsVectorLength = 2; + tlsinfo->ThreadData[0].Flags = 0; + tlsinfo->ThreadData[0].ThreadId = thread_id; + tlsinfo->ThreadData[0].TlsVector = new_tls_pointer; + status = NtSetInformationProcess( GetCurrentProcess(), ProcessTlsInformation, tlsinfo, + offsetof(PROCESS_TLS_INFORMATION, ThreadData[tlsinfo->ThreadDataCount])); + if (wow) + { + ok( !status, "got %#lx.\n", status ); + ok( tlsinfo->Flags == 1, "got %#lx.\n", tlsinfo->Flags ); + ok( tlsinfo->ThreadData[0].Flags == THREAD_TLS_INFORMATION_ASSIGNED, "got %#lx.\n", tlsinfo->ThreadData[0].Flags ); + ok( tlsinfo->ThreadData[0].ThreadId == curr_thread_id, "got %#Ix.\n", tlsinfo->ThreadData[0].ThreadId ); + } + else + { + ok( status == STATUS_INVALID_PARAMETER, "got %#lx.\n", status ); + ok( tlsinfo->Flags == 1, "got %#lx.\n", tlsinfo->Flags ); + ok( !tlsinfo->ThreadData[0].Flags, "got %#lx.\n", tlsinfo->ThreadData[0].Flags ); + ok( tlsinfo->ThreadData[0].ThreadId == thread_id, "got %#Ix.\n", tlsinfo->ThreadData[0].ThreadId ); + } + + /* Other PROCESS_TLS_INFORMATION flags are invalid. STATUS_INFO_LENGTH_MISMATCH is weird but that's for any flag + * besides 1. */ + tlsinfo->Flags = 2; + tlsinfo->ThreadData[0].Flags = 0; + tlsinfo->ThreadData[0].ThreadId = thread_id; + status = NtSetInformationProcess( GetCurrentProcess(), ProcessTlsInformation, tlsinfo, + offsetof(PROCESS_TLS_INFORMATION, ThreadData[tlsinfo->ThreadDataCount])); + ok( status == STATUS_INFO_LENGTH_MISMATCH, "got %#lx.\n", status ); + ok( tlsinfo->Flags == 2, "got %#lx.\n", tlsinfo->Flags ); + ok( !tlsinfo->ThreadData[0].Flags, "got %#lx.\n", tlsinfo->ThreadData[0].Flags ); + ok( tlsinfo->ThreadData[0].ThreadId == thread_id, "got %#Ix.\n", tlsinfo->ThreadData[0].ThreadId ); + + /* Nonzero THREAD_TLS_INFORMATION flags on input are invalid. */ + tlsinfo->Flags = 0; + tlsinfo->ThreadData[0].Flags = 1; + tlsinfo->ThreadData[0].ThreadId = thread_id; + status = NtSetInformationProcess( GetCurrentProcess(), ProcessTlsInformation, tlsinfo, + offsetof(PROCESS_TLS_INFORMATION, ThreadData[tlsinfo->ThreadDataCount])); + ok( status == STATUS_INVALID_PARAMETER, "got %#lx.\n", status ); + ok( !tlsinfo->Flags, "got %#lx.\n", tlsinfo->Flags ); + ok( tlsinfo->ThreadData[0].Flags == 1, "got %#lx.\n", tlsinfo->ThreadData[0].Flags ); + ok( tlsinfo->ThreadData[0].ThreadId == thread_id, "got %#Ix.\n", tlsinfo->ThreadData[0].ThreadId ); + + tlsinfo->ThreadData[0].Flags = 0; + tlsinfo->OperationType = MaxProcessTlsOperation; + status = NtSetInformationProcess( GetCurrentProcess(), ProcessTlsInformation, tlsinfo, + offsetof(PROCESS_TLS_INFORMATION, ThreadData[tlsinfo->ThreadDataCount])); + /* Unknown operation type. */ + ok( status == STATUS_INFO_LENGTH_MISMATCH || status == STATUS_INVALID_PARAMETER, "got %#lx.\n", status ); + + tlsinfo->OperationType = ProcessTlsReplaceVector; + status = NtSetInformationProcess( GetCurrentProcess(), ProcessTlsInformation, tlsinfo, + offsetof(PROCESS_TLS_INFORMATION, ThreadData[tlsinfo->ThreadDataCount]) + 8); + /* Larger data size. */ + ok( (!wow && status == STATUS_INFO_LENGTH_MISMATCH) || (wow && !status), "got %#lx.\n", status ); + + tlsinfo->ThreadData[0].Flags = 0; + status = NtSetInformationProcess( GetCurrentProcess(), ProcessTlsInformation, tlsinfo, + offsetof(PROCESS_TLS_INFORMATION, ThreadData[tlsinfo->ThreadDataCount])); + ok( status == STATUS_SUCCESS, "got %#lx.\n", status ); + ok( !tlsinfo->Flags, "got %#lx.\n", tlsinfo->Flags ); + ok( tlsinfo->ThreadData[0].Flags == THREAD_TLS_INFORMATION_ASSIGNED, "got %#lx.\n", tlsinfo->ThreadData[0].Flags ); + /* ThreadId is output parameter, ignored on input and contains the thread where the data were assigned on + * output. */ + ok( tlsinfo->ThreadData[0].ThreadId == curr_thread_id, "got %#Ix.\n", tlsinfo->ThreadData[0].ThreadId ); + /* TlsVector contains the repaced vector on output. */ + ok( tlsinfo->ThreadData[0].TlsVector == tls_pointer, "got %p.\n", tlsinfo->ThreadData[0].TlsVector ); + ok( teb->ThreadLocalStoragePointer == new_tls_pointer, "wrong vector.\n" ); + for (i = 0; i < ARRAY_SIZE(tls_pointer); ++i) + { + ok( tls_pointer[i] == (void *)(ULONG_PTR)(i + 1), "got %p.\n", tls_pointer ); + /* TlsVectorLength pointers are copied from the old vector to the new one. */ + if (i < 2) + ok( new_tls_pointer[i] == (void *)(ULONG_PTR)(i + 1), "got %p.\n", tls_pointer ); + else + ok( new_tls_pointer[i] == (void *)(ULONG_PTR)(i + 20), "got %p.\n", tls_pointer ); + } + + teb->ThreadLocalStoragePointer = NULL; + tlsinfo->ThreadData[0].Flags = 0; + tlsinfo->ThreadData[0].TlsVector = new_tls_pointer; + status = NtSetInformationProcess( GetCurrentProcess(), ProcessTlsInformation, tlsinfo, + offsetof(PROCESS_TLS_INFORMATION, ThreadData[tlsinfo->ThreadDataCount])); + ok( status == STATUS_SUCCESS, "got %#lx.\n", status ); + /* Threads with NULL ThreadLocalStoragePointer are ignored. */ + ok( !tlsinfo->Flags, "got %#lx.\n", tlsinfo->Flags ); + ok( !tlsinfo->ThreadData[0].Flags, "got %#lx.\n", tlsinfo->ThreadData[0].Flags ); + ok( tlsinfo->ThreadData[0].TlsVector == new_tls_pointer, "got %p.\n", tlsinfo->ThreadData[0].TlsVector ); + + memcpy( tls_pointer2, tls_pointer, sizeof(tls_pointer2) ); + thread_teb->ThreadLocalStoragePointer = tls_pointer2; + status = NtSetInformationProcess( GetCurrentProcess(), ProcessTlsInformation, tlsinfo, + offsetof(PROCESS_TLS_INFORMATION, ThreadData[tlsinfo->ThreadDataCount])); + ok( status == STATUS_SUCCESS, "got %#lx.\n", status ); + ok( tlsinfo->ThreadData[0].Flags == THREAD_TLS_INFORMATION_ASSIGNED, "got %#lx.\n", tlsinfo->ThreadData[0].Flags ); + ok( thread_teb->ThreadLocalStoragePointer == new_tls_pointer, "wrong vector.\n" ); + ok( tlsinfo->ThreadData[0].ThreadId == thread_id, "got %#Ix.\n", tlsinfo->ThreadData[0].ThreadId ); + ok( tlsinfo->ThreadData[0].TlsVector == tls_pointer2, "got %p.\n", tlsinfo->ThreadData[0].TlsVector ); + + /* Two eligible threads, data for only one are provided, that succeeds. */ + teb->ThreadLocalStoragePointer = tls_pointer; + thread_teb->ThreadLocalStoragePointer = tls_pointer2; + tlsinfo->ThreadData[0].Flags = 0; + tlsinfo->ThreadData[0].TlsVector = new_tls_pointer; + thread_teb->ThreadLocalStoragePointer = tls_pointer2; + status = NtSetInformationProcess( GetCurrentProcess(), ProcessTlsInformation, tlsinfo, + offsetof(PROCESS_TLS_INFORMATION, ThreadData[tlsinfo->ThreadDataCount])); + ok( status == STATUS_SUCCESS, "got %#lx.\n", status ); + ok( tlsinfo->ThreadDataCount == 1, "got %#lx.\n", tlsinfo->ThreadDataCount ); + ok( tlsinfo->ThreadData[0].Flags == THREAD_TLS_INFORMATION_ASSIGNED, "got %#lx.\n", tlsinfo->ThreadData[0].Flags ); + ok( teb->ThreadLocalStoragePointer == new_tls_pointer, "wrong vector.\n" ); + ok( tlsinfo->ThreadData[0].ThreadId == curr_thread_id, "got %#Ix.\n", tlsinfo->ThreadData[0].ThreadId ); + ok( tlsinfo->ThreadData[0].TlsVector == tls_pointer, "got %p.\n", tlsinfo->ThreadData[0].TlsVector ); + ok( thread_teb->ThreadLocalStoragePointer == tls_pointer2, "wrong vector.\n" ); + + /* Set for both threads at once as probably intended. Provide an extra data for the missing third thread + * which won't be used. */ + teb->ThreadLocalStoragePointer = tls_pointer; + thread_teb->ThreadLocalStoragePointer = tls_pointer2; + memcpy( new_tls_pointer2, new_tls_pointer, sizeof(new_tls_pointer2) ); + tlsinfo->ThreadDataCount = 3; + tlsinfo->ThreadData[0].TlsVector = new_tls_pointer; + tlsinfo->ThreadData[0].Flags = 0; + tlsinfo->ThreadData[1].TlsVector = new_tls_pointer2; + tlsinfo->ThreadData[1].Flags = 0; + tlsinfo->ThreadData[2].TlsVector = (void *)0xdeadbeef; + tlsinfo->ThreadData[2].Flags = 0; + tlsinfo->ThreadData[2].ThreadId = 0xdeadbeef; + status = NtSetInformationProcess( GetCurrentProcess(), ProcessTlsInformation, tlsinfo, + offsetof(PROCESS_TLS_INFORMATION, ThreadData[tlsinfo->ThreadDataCount])); + ok( status == STATUS_SUCCESS, "got %#lx.\n", status ); + ok( !tlsinfo->Flags, "got %#lx.\n", tlsinfo->Flags ); + ok( tlsinfo->ThreadDataCount == 3, "got %#lx.\n", tlsinfo->ThreadDataCount ); + ok( tlsinfo->ThreadData[0].Flags == THREAD_TLS_INFORMATION_ASSIGNED, "got %#lx.\n", tlsinfo->ThreadData[0].Flags ); + ok( teb->ThreadLocalStoragePointer == new_tls_pointer, "wrong vector.\n" ); + ok( tlsinfo->ThreadData[0].ThreadId == curr_thread_id, "got %#Ix.\n", tlsinfo->ThreadData[0].ThreadId ); + ok( tlsinfo->ThreadData[0].TlsVector == tls_pointer, "got %p.\n", tlsinfo->ThreadData[0].TlsVector ); + ok( tlsinfo->ThreadData[1].Flags == THREAD_TLS_INFORMATION_ASSIGNED, "got %#lx.\n", tlsinfo->ThreadData[1].Flags ); + ok( teb->ThreadLocalStoragePointer == new_tls_pointer, "wrong vector.\n" ); + ok( tlsinfo->ThreadData[1].ThreadId == thread_id, "got %#Ix.\n", tlsinfo->ThreadData[1].ThreadId ); + ok( tlsinfo->ThreadData[1].TlsVector == tls_pointer2, "got %p.\n", tlsinfo->ThreadData[1].TlsVector ); + ok( !tlsinfo->ThreadData[2].Flags, "got %#lx.\n", tlsinfo->ThreadData[2].Flags ); + ok( tlsinfo->ThreadData[2].ThreadId == 0xdeadbeef, "got %#Ix.\n", tlsinfo->ThreadData[2].ThreadId ); + ok( tlsinfo->ThreadData[2].TlsVector == (void *)0xdeadbeef, "got %p.\n", tlsinfo->ThreadData[2].TlsVector ); + + /* Test with unaccessible data. */ + tlsinfo->ThreadData[0].TlsVector = new_tls_pointer; + tlsinfo->ThreadData[0].ThreadId = 0; + tlsinfo->ThreadData[0].Flags = 0; + tlsinfo->ThreadData[1].TlsVector = new_tls_pointer2; + tlsinfo->ThreadData[1].ThreadId = 0; + tlsinfo->ThreadData[1].Flags = 0; + teb->ThreadLocalStoragePointer = tls_pointer; + thread_teb->ThreadLocalStoragePointer = (void *)0xdeadbee0; + status = NtSetInformationProcess( GetCurrentProcess(), ProcessTlsInformation, tlsinfo, + offsetof(PROCESS_TLS_INFORMATION, ThreadData[tlsinfo->ThreadDataCount])); + ok( status == STATUS_ACCESS_VIOLATION, "got %#lx.\n", status ); + ok( !tlsinfo->Flags, "got %#lx.\n", tlsinfo->Flags ); + ok( tlsinfo->ThreadDataCount == 3, "got %#lx.\n", tlsinfo->ThreadDataCount ); + if (wow) + { + ok( !tlsinfo->ThreadData[0].Flags, "got %#lx.\n", tlsinfo->ThreadData[0].Flags ); + ok( !tlsinfo->ThreadData[0].ThreadId, "got %#Ix.\n", tlsinfo->ThreadData[0].ThreadId ); + ok( tlsinfo->ThreadData[0].TlsVector == new_tls_pointer, "got %p.\n", tlsinfo->ThreadData[0].TlsVector ); + } + else + { + ok( tlsinfo->ThreadData[0].Flags == THREAD_TLS_INFORMATION_ASSIGNED, "got %#lx.\n", tlsinfo->ThreadData[0].Flags ); + ok( tlsinfo->ThreadData[0].ThreadId == curr_thread_id, "got %#Ix.\n", tlsinfo->ThreadData[0].ThreadId ); + ok( tlsinfo->ThreadData[0].TlsVector == tls_pointer, "got %p.\n", tlsinfo->ThreadData[0].TlsVector ); + } + ok( teb->ThreadLocalStoragePointer == new_tls_pointer, "wrong vector.\n" ); + ok( !tlsinfo->ThreadData[1].Flags, "got %#lx.\n", tlsinfo->ThreadData[1].Flags ); + ok( teb->ThreadLocalStoragePointer == new_tls_pointer, "wrong vector.\n" ); + ok( !tlsinfo->ThreadData[1].ThreadId, "got %#Ix.\n", tlsinfo->ThreadData[1].ThreadId ); + ok( tlsinfo->ThreadData[1].TlsVector == new_tls_pointer2, "got %p.\n", tlsinfo->ThreadData[1].TlsVector ); + ok( !tlsinfo->ThreadData[2].Flags, "got %#lx.\n", tlsinfo->ThreadData[2].Flags ); + ok( tlsinfo->ThreadData[2].ThreadId == 0xdeadbeef, "got %#Ix.\n", tlsinfo->ThreadData[2].ThreadId ); + ok( tlsinfo->ThreadData[2].TlsVector == (void *)0xdeadbeef, "got %p.\n", tlsinfo->ThreadData[2].TlsVector ); + + /* Test replacing TLS index. */ + teb->ThreadLocalStoragePointer = new_tls_pointer; + thread_teb->ThreadLocalStoragePointer = new_tls_pointer2; + new_tls_pointer[1] = (void *)0xcccccccc; + new_tls_pointer2[1] = (void *)0xdddddddd; + tlsinfo->ThreadDataCount = 3; + tlsinfo->OperationType = ProcessTlsReplaceIndex; + tlsinfo->TlsIndex = 1; + for (i = 0; i < 3; ++i) + { + tlsinfo->ThreadData[i].Flags = 0; + tlsinfo->ThreadData[i].ThreadId = 0xdeadbeef; + tlsinfo->ThreadData[i].TlsModulePointer = (void *)((ULONG_PTR)i + 1); + } + status = NtSetInformationProcess( GetCurrentProcess(), ProcessTlsInformation, tlsinfo, + offsetof(PROCESS_TLS_INFORMATION, ThreadData[tlsinfo->ThreadDataCount])); + ok( status == STATUS_SUCCESS, "got %#lx.\n", status ); + ok( !tlsinfo->Flags, "got %#lx.\n", tlsinfo->Flags ); + ok( tlsinfo->ThreadDataCount == 3, "got %#lx.\n", tlsinfo->ThreadDataCount ); + ok( tlsinfo->ThreadData[0].Flags == THREAD_TLS_INFORMATION_ASSIGNED, "got %#lx.\n", tlsinfo->ThreadData[0].Flags ); + ok( (ULONG_PTR)new_tls_pointer[1] == 1, "got %p.\n", new_tls_pointer[1] ); + ok( tlsinfo->ThreadData[0].ThreadId == 0xdeadbeef, "got %#Ix.\n", tlsinfo->ThreadData[0].ThreadId ); + ok( (ULONG_PTR)tlsinfo->ThreadData[0].TlsModulePointer == 0xcccccccc, "got %p.\n", tlsinfo->ThreadData[0].TlsModulePointer ); + ok( tlsinfo->ThreadData[1].Flags == THREAD_TLS_INFORMATION_ASSIGNED, "got %#lx.\n", tlsinfo->ThreadData[1].Flags ); + ok( (ULONG_PTR)new_tls_pointer2[1] == 2, "got %p.\n", new_tls_pointer2[1] ); + ok( tlsinfo->ThreadData[1].ThreadId == 0xdeadbeef, "got %#Ix.\n", tlsinfo->ThreadData[1].ThreadId ); + ok( (ULONG_PTR)tlsinfo->ThreadData[1].TlsModulePointer == 0xdddddddd, "got %p.\n", tlsinfo->ThreadData[1].TlsModulePointer ); + ok( !tlsinfo->ThreadData[2].Flags, "got %#lx.\n", tlsinfo->ThreadData[2].Flags ); + ok( tlsinfo->ThreadData[2].ThreadId == 0xdeadbeef, "got %#Ix.\n", tlsinfo->ThreadData[2].ThreadId ); + ok( (ULONG_PTR)tlsinfo->ThreadData[2].TlsModulePointer == 3, "got %p.\n", tlsinfo->ThreadData[2].TlsModulePointer ); + + /* Restore original TLS data. */ + teb->ThreadLocalStoragePointer = save_tls_pointers[0]; + thread_teb->ThreadLocalStoragePointer = save_tls_pointers[1]; + ResumeThread( thread ); + WaitForSingleObject( thread, INFINITE ); + CloseHandle( thread ); +} + START_TEST(info) { char **argv; @@ -4167,4 +4431,5 @@ START_TEST(info) test_process_token(argc, argv); test_process_id(); test_processor_idle_cycle_time(); + test_set_process_tls_info(); } diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c index 30fdbccf99fe..a11dcc40cec7 100644 --- a/dlls/ntdll/unix/process.c +++ b/dlls/ntdll/unix/process.c @@ -1723,6 +1723,33 @@ NTSTATUS WINAPI NtSetInformationProcess( HANDLE handle, PROCESSINFOCLASS class, process_error_mode = *(UINT *)info; break; + case ProcessTlsInformation: + { + PROCESS_TLS_INFORMATION *t = info; + unsigned int i; + + if (handle != NtCurrentProcess()) + { + FIXME( "ProcessTlsInformation is not supported for the other process yet, handle %p.\n", handle ); + return STATUS_INVALID_HANDLE; + } + + if (size < sizeof(*t) || size != offsetof(PROCESS_TLS_INFORMATION, ThreadData[t->ThreadDataCount])) + return STATUS_INFO_LENGTH_MISMATCH; + if (t->Flags & ~PROCESS_TLS_INFORMATION_WOW64) + { + WARN( "ProcessTlsInformation: unknown flags %#x.\n", (int)t->Flags ); + return STATUS_INFO_LENGTH_MISMATCH; + } + if (t->Flags & PROCESS_TLS_INFORMATION_WOW64 && !(is_win64 && is_wow64())) + return STATUS_INVALID_PARAMETER; + if (t->OperationType >= MaxProcessTlsOperation) return STATUS_INFO_LENGTH_MISMATCH; + for (i = 0; i < t->ThreadDataCount; ++i) + if (t->ThreadData[i].Flags) return STATUS_INVALID_PARAMETER; + ret = virtual_set_tls_information( t ); + break; + } + case ProcessAffinityMask: { const ULONG_PTR system_mask = get_system_affinity_mask(); diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 1d978b4b6992..8ed3dec2bff5 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -299,6 +299,7 @@ extern TEB *virtual_alloc_first_teb(void); extern NTSTATUS virtual_alloc_teb( TEB **ret_teb ); extern void virtual_free_teb( TEB *teb ); extern NTSTATUS virtual_clear_tls_index( ULONG index ); +extern NTSTATUS virtual_set_tls_information( PROCESS_TLS_INFORMATION *t ); extern NTSTATUS virtual_alloc_thread_stack( INITIAL_TEB *stack, ULONG_PTR limit_low, ULONG_PTR limit_high, SIZE_T reserve_size, SIZE_T commit_size, BOOL guard_page ); extern void virtual_map_user_shared_data(void); diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index b4fd773830b6..ebd5a5da1215 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -4329,6 +4329,95 @@ NTSTATUS virtual_clear_tls_index( ULONG index ) } +/*********************************************************************** + * virtual_set_tls_information_teb + */ +static NTSTATUS virtual_set_tls_information_teb( PROCESS_TLS_INFORMATION *t, unsigned int *idx, TEB *teb ) +{ + __TRY + { +#ifdef _WIN64 + if (t->Flags & PROCESS_TLS_INFORMATION_WOW64) + { + WOW_TEB *wow_teb = get_wow_teb( teb ); + ULONG *ptr; + + if (wow_teb && wow_teb->ThreadLocalStoragePointer) + { + if (t->OperationType == ProcessTlsReplaceVector) + { + ptr = t->ThreadData[*idx].TlsVector; + memcpy( ptr, ULongToPtr( wow_teb->ThreadLocalStoragePointer ), sizeof(*ptr) * t->TlsVectorLength ); + t->ThreadData[*idx].TlsVector = ULongToPtr( InterlockedExchange( (LONG *)&wow_teb->ThreadLocalStoragePointer, PtrToLong( ptr ))); + t->ThreadData[*idx].ThreadId = wow_teb->ClientId.UniqueThread; + } + else + { + ptr = ULongToPtr( wow_teb->ThreadLocalStoragePointer ); + t->ThreadData[*idx].TlsModulePointer = + ULongToPtr( InterlockedExchange( (LONG *)&ptr[t->TlsIndex], + PtrToLong( t->ThreadData[*idx].TlsModulePointer ))); + } + t->ThreadData[*idx].Flags = THREAD_TLS_INFORMATION_ASSIGNED; + ++*idx; + } + } + else +#endif + if (teb->ThreadLocalStoragePointer) + { + void **ptr; + + if (t->OperationType == ProcessTlsReplaceVector) + { + ptr = t->ThreadData[*idx].TlsVector; + memcpy( ptr, teb->ThreadLocalStoragePointer, sizeof(*ptr) * t->TlsVectorLength ); + t->ThreadData[*idx].TlsVector = InterlockedExchangePointer( &teb->ThreadLocalStoragePointer, ptr ); + t->ThreadData[*idx].ThreadId = HandleToULong( teb->ClientId.UniqueThread ); + } + else + { + ptr = teb->ThreadLocalStoragePointer; + t->ThreadData[*idx].TlsModulePointer = InterlockedExchangePointer( &ptr[t->TlsIndex], + t->ThreadData[*idx].TlsModulePointer ); + } + t->ThreadData[*idx].Flags = THREAD_TLS_INFORMATION_ASSIGNED; + ++*idx; + } + } + __EXCEPT + { + return STATUS_ACCESS_VIOLATION; + } + __ENDTRY + + return STATUS_SUCCESS; +} + + +/*********************************************************************** + * virtual_set_tls_information + */ +NTSTATUS virtual_set_tls_information( PROCESS_TLS_INFORMATION *t ) +{ + struct ntdll_thread_data *thread_data; + NTSTATUS ret = STATUS_SUCCESS; + unsigned int idx = 0; + sigset_t sigset; + + server_enter_uninterrupted_section( &virtual_mutex, &sigset ); + LIST_FOR_EACH_ENTRY_REV( thread_data, &teb_list, struct ntdll_thread_data, entry ) + { + TEB *teb = CONTAINING_RECORD( thread_data, TEB, GdiTebBatch ); + + if (idx == t->ThreadDataCount) break; + if ((ret = virtual_set_tls_information_teb( t, &idx, teb ))) break; + } + server_leave_uninterrupted_section( &virtual_mutex, &sigset ); + return ret; +} + + /*********************************************************************** * virtual_alloc_thread_stack */ diff --git a/dlls/wow64/process.c b/dlls/wow64/process.c index c459de16418b..97a1f30179e2 100644 --- a/dlls/wow64/process.c +++ b/dlls/wow64/process.c @@ -895,6 +895,39 @@ NTSTATUS WINAPI wow64_NtSetInformationProcess( UINT *args ) } else return STATUS_INVALID_PARAMETER; + case ProcessTlsInformation: + { + PROCESS_TLS_INFORMATION32 *t32 = ptr; + PROCESS_TLS_INFORMATION *t; + ULONG i; + + if (len >= sizeof(*t32) && len >= offsetof(PROCESS_TLS_INFORMATION32, ThreadData[t32->ThreadDataCount])) + { + t = Wow64AllocateTemp( offsetof(PROCESS_TLS_INFORMATION, ThreadData[t32->ThreadDataCount]) ); + t->Flags = t32->Flags ? t32->Flags : PROCESS_TLS_INFORMATION_WOW64; + t->OperationType = t32->OperationType; + t->ThreadDataCount = t32->ThreadDataCount; + t->TlsIndex = t32->TlsIndex; + for (i = 0; i < t->ThreadDataCount; ++i) + { + t->ThreadData[i].Flags = t32->ThreadData[i].Flags; + t->ThreadData[i].ThreadId = t32->ThreadData[i].ThreadId; + t->ThreadData[i].TlsVector = ULongToPtr( t32->ThreadData[i].TlsVector ); + } + if (!(status = NtSetInformationProcess( handle, class, t, offsetof(PROCESS_TLS_INFORMATION, ThreadData[t->ThreadDataCount]) ))) + { + for (i = 0; i < t->ThreadDataCount; ++i) + { + t32->ThreadData[i].Flags = t->ThreadData[i].Flags; + t32->ThreadData[i].ThreadId = t->ThreadData[i].ThreadId; + t32->ThreadData[i].TlsVector = PtrToUlong( t->ThreadData[i].TlsVector ); + } + } + return status; + } + else return STATUS_INFO_LENGTH_MISMATCH; + } + case ProcessInstrumentationCallback: /* PROCESS_INSTRUMENTATION_CALLBACK_INFORMATION */ if (len >= sizeof(ULONG)) { diff --git a/dlls/wow64/struct32.h b/dlls/wow64/struct32.h index fe2bbc758ee4..c8588bd4f4a2 100644 --- a/dlls/wow64/struct32.h +++ b/dlls/wow64/struct32.h @@ -326,6 +326,30 @@ typedef struct ULONG DefaultBase; } RTL_PROCESS_MODULE_INFORMATION_EX32; +typedef struct +{ + ULONG Flags; + union + { + ULONG TlsVector; + ULONG TlsModulePointer; + }; + ULONG ThreadId; +} THREAD_TLS_INFORMATION32; + +typedef struct +{ + ULONG Flags; + ULONG OperationType; + ULONG ThreadDataCount; + union + { + ULONG TlsIndex; + ULONG TlsVectorLength; + }; + THREAD_TLS_INFORMATION32 ThreadData[1]; +} PROCESS_TLS_INFORMATION32; + typedef struct { ULONG BaseAddress; diff --git a/include/winternl.h b/include/winternl.h index 0bae9fbf3859..f9f6fb8915b2 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2669,6 +2669,41 @@ typedef struct _PROCESS_CYCLE_TIME_INFORMATION { ULONGLONG CurrentCycleCount; } PROCESS_CYCLE_TIME_INFORMATION, *PPROCESS_CYCLE_TIME_INFORMATION; +typedef struct _THREAD_TLS_INFORMATION +{ + ULONG Flags; + union + { + void *TlsVector; + void *TlsModulePointer; + }; + ULONG_PTR ThreadId; +} THREAD_TLS_INFORMATION, * PTHREAD_TLS_INFORMATION; + +#define THREAD_TLS_INFORMATION_ASSIGNED 0x2 + +typedef enum _PROCESS_TLS_INFORMATION_TYPE +{ + ProcessTlsReplaceIndex, + ProcessTlsReplaceVector, + MaxProcessTlsOperation +} PROCESS_TLS_INFORMATION_TYPE, *PPROCESS_TLS_INFORMATION_TYPE; + +typedef struct _PROCESS_TLS_INFORMATION +{ + ULONG Flags; + ULONG OperationType; + ULONG ThreadDataCount; + union + { + ULONG TlsIndex; + ULONG TlsVectorLength; + }; + THREAD_TLS_INFORMATION ThreadData[1]; +} PROCESS_TLS_INFORMATION, *PPROCESS_TLS_INFORMATION; + +#define PROCESS_TLS_INFORMATION_WOW64 1 + typedef struct _PROCESS_STACK_ALLOCATION_INFORMATION { SIZE_T ReserveSize; From 080f48d0e0c510e3c473625ba0723b63cab0f9dc Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 23 Sep 2024 19:38:54 -0600 Subject: [PATCH 0832/2542] ntdll: Use NtSetInformationProcess( ProcessTlsInformation ) in alloc_tls_slot(). CW-Bug-Id: #24258 --- dlls/ntdll/loader.c | 98 ++++++++++++++++++++++----------------- dlls/ntdll/unix/virtual.c | 3 ++ 2 files changed, 58 insertions(+), 43 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index a6fdf00c72bd..279fd7cb1c51 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -143,6 +143,7 @@ typedef struct _wine_modref static UINT tls_module_count = 32; /* number of modules with TLS directory */ static IMAGE_TLS_DIRECTORY *tls_dirs; /* array of TLS directories */ +static ULONG tls_thread_count; /* number of threads for which ThreadLocalStoragePointer is allocated in TEB. */ static RTL_CRITICAL_SECTION loader_section; static RTL_CRITICAL_SECTION_DEBUG critsect_debug = @@ -1310,10 +1311,10 @@ static BOOL is_dll_native_subsystem( LDR_DATA_TABLE_ENTRY *mod, const IMAGE_NT_H static BOOL alloc_tls_slot( LDR_DATA_TABLE_ENTRY *mod ) { const IMAGE_TLS_DIRECTORY *dir; - ULONG i, size; + ULONG i, j, size; void *new_ptr; UINT old_module_count = tls_module_count; - HANDLE thread = NULL, next; + PROCESS_TLS_INFORMATION *t; if (!(dir = RtlImageDirectoryEntryToData( mod->DllBase, TRUE, IMAGE_DIRECTORY_ENTRY_TLS, &size ))) return FALSE; @@ -1342,57 +1343,66 @@ static BOOL alloc_tls_slot( LDR_DATA_TABLE_ENTRY *mod ) tls_dirs = new_ptr; tls_module_count = new_count; } + *(DWORD *)dir->AddressOfIndex = i; + tls_dirs[i] = *dir; - /* allocate the data block in all running threads */ - while (!NtGetNextThread( GetCurrentProcess(), thread, THREAD_QUERY_LIMITED_INFORMATION, 0, 0, &next )) + if (!tls_thread_count) return TRUE; + t = RtlAllocateHeap( GetProcessHeap(), 0, offsetof( PROCESS_TLS_INFORMATION, ThreadData[tls_thread_count] )); + if (!t) return FALSE; + + t->Flags = 0; + t->ThreadDataCount = tls_thread_count; + if (old_module_count < tls_module_count) + { + t->OperationType = ProcessTlsReplaceVector; + t->TlsVectorLength = old_module_count; + } + else + { + t->OperationType = ProcessTlsReplaceIndex; + t->TlsIndex = i; + } + for (j = 0; j < tls_thread_count; ++j) { - THREAD_BASIC_INFORMATION tbi; - TEB *teb; + void **vector; - if (thread) NtClose( thread ); - thread = next; - if (NtQueryInformationThread( thread, ThreadBasicInformation, &tbi, sizeof(tbi), NULL ) || !tbi.TebBaseAddress) + t->ThreadData[j].Flags = 0; + + if (!(new_ptr = RtlAllocateHeap( GetProcessHeap(), 0, size + dir->SizeOfZeroFill ))) return FALSE; + memcpy( new_ptr, (void *)dir->StartAddressOfRawData, size ); + memset( (char *)new_ptr + size, 0, dir->SizeOfZeroFill ); + + if (t->OperationType == ProcessTlsReplaceVector) { - ERR( "NtQueryInformationThread failed.\n" ); - continue; + vector = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, tls_module_count * sizeof(*vector) ); + if (!vector) return FALSE; + t->ThreadData[j].TlsVector = vector; + vector[i] = new_ptr; } - teb = tbi.TebBaseAddress; - if (!teb->ThreadLocalStoragePointer) + else t->ThreadData[j].TlsModulePointer = new_ptr; + } + if (NtSetInformationProcess( GetCurrentProcess(), ProcessTlsInformation, t, + offsetof(PROCESS_TLS_INFORMATION, ThreadData[t->ThreadDataCount]))) + { + ERR( "ProcessTlsInformation failed.\n" ); + return FALSE; + } + + for (j = 0; j < tls_thread_count; ++j) + { + if (!(t->ThreadData[j].Flags & THREAD_TLS_INFORMATION_ASSIGNED) && t->OperationType == ProcessTlsReplaceVector) { - /* Thread is not initialized by loader yet or already teared down. */ - TRACE( "thread %04lx NULL tls block.\n", HandleToULong(tbi.ClientId.UniqueThread) ); - continue; + /* There could be fewer active threads than we counted here due to force terminated threads, first + * free extra TLS directory data set in the new TLS vector. */ + RtlFreeHeap( GetProcessHeap(), 0, ((void **)t->ThreadData[j].TlsVector)[i] ); } - - if (old_module_count < tls_module_count) + if (!(t->ThreadData[j].Flags & THREAD_TLS_INFORMATION_ASSIGNED) || t->OperationType == ProcessTlsReplaceIndex) { - void **old = teb->ThreadLocalStoragePointer; - void **new = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, tls_module_count * sizeof(*new)); - - if (!new) return FALSE; - if (old) memcpy( new, old, old_module_count * sizeof(*new) ); - teb->ThreadLocalStoragePointer = new; -#ifdef __x86_64__ /* macOS-specific hack */ - if (teb->Instrumentation[0]) ((TEB *)teb->Instrumentation[0])->ThreadLocalStoragePointer = new; -#endif - TRACE( "thread %04lx tls block %p -> %p\n", HandleToULong(teb->ClientId.UniqueThread), old, new ); - /* FIXME: can't free old block here, should be freed at thread exit */ + /* FIXME: can't free old Tls vector here, should be freed at thread exit. */ + RtlFreeHeap( GetProcessHeap(), 0, t->ThreadData[j].TlsVector ); } - - if (!(new_ptr = RtlAllocateHeap( GetProcessHeap(), 0, size + dir->SizeOfZeroFill ))) return -1; - memcpy( new_ptr, (void *)dir->StartAddressOfRawData, size ); - memset( (char *)new_ptr + size, 0, dir->SizeOfZeroFill ); - - TRACE( "thread %04lx slot %lu: %lu/%lu bytes at %p\n", - HandleToULong(teb->ClientId.UniqueThread), i, size, dir->SizeOfZeroFill, new_ptr ); - - RtlFreeHeap( GetProcessHeap(), 0, - InterlockedExchangePointer( (void **)teb->ThreadLocalStoragePointer + i, new_ptr )); } - if (thread) NtClose( thread ); - - *(DWORD *)dir->AddressOfIndex = i; - tls_dirs[i] = *dir; + RtlFreeHeap( GetProcessHeap(), 0, t ); return TRUE; } @@ -1625,6 +1635,7 @@ static NTSTATUS alloc_thread_tls(void) TRACE( "slot %u: %u/%lu bytes at %p\n", i, size, dir->SizeOfZeroFill, pointers[i] ); } + ++tls_thread_count; NtCurrentTeb()->ThreadLocalStoragePointer = pointers; #ifdef __x86_64__ /* macOS-specific hack */ if (NtCurrentTeb()->Instrumentation[0]) @@ -4072,6 +4083,7 @@ void WINAPI LdrShutdownThread(void) if ((pointers = NtCurrentTeb()->ThreadLocalStoragePointer)) { NtCurrentTeb()->ThreadLocalStoragePointer = NULL; + --tls_thread_count; #ifdef __x86_64__ /* macOS-specific hack */ if (NtCurrentTeb()->Instrumentation[0]) ((TEB *)NtCurrentTeb()->Instrumentation[0])->ThreadLocalStoragePointer = NULL; diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index ebd5a5da1215..cbfe3fc16c47 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -4374,6 +4374,9 @@ static NTSTATUS virtual_set_tls_information_teb( PROCESS_TLS_INFORMATION *t, uns memcpy( ptr, teb->ThreadLocalStoragePointer, sizeof(*ptr) * t->TlsVectorLength ); t->ThreadData[*idx].TlsVector = InterlockedExchangePointer( &teb->ThreadLocalStoragePointer, ptr ); t->ThreadData[*idx].ThreadId = HandleToULong( teb->ClientId.UniqueThread ); +#ifdef __x86_64__ /* macOS-specific hack */ + if (teb->Instrumentation[0]) ((TEB *)teb->Instrumentation[0])->ThreadLocalStoragePointer = ptr; +#endif } else { From 8660e552d785342c4b02e16755aae26018228fb1 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 23 Sep 2024 20:51:44 -0600 Subject: [PATCH 0833/2542] ntdll: Match memory allocation layout for ThreadLocalStoragePointer. CW-Bug-Id: #24258 --- dlls/kernel32/tests/module.c | 23 ++++++++++++++++ dlls/ntdll/loader.c | 51 ++++++++++++++++++++++++++++-------- 2 files changed, 63 insertions(+), 11 deletions(-) diff --git a/dlls/kernel32/tests/module.c b/dlls/kernel32/tests/module.c index 6e3b221d9282..6bdd175412ae 100644 --- a/dlls/kernel32/tests/module.c +++ b/dlls/kernel32/tests/module.c @@ -1708,7 +1708,10 @@ static void test_tls_links(void) TEB *teb = NtCurrentTeb(), *thread_teb; THREAD_BASIC_INFORMATION tbi; NTSTATUS status; + ULONG i, count; HANDLE thread; + SIZE_T size; + void **ptr; ok(!!teb->ThreadLocalStoragePointer, "got NULL.\n"); @@ -1728,6 +1731,26 @@ static void test_tls_links(void) ResumeThread(thread); WaitForSingleObject(test_tls_links_started, INFINITE); + if (!is_old_loader_struct()) + { + ptr = teb->ThreadLocalStoragePointer; + count = (ULONG_PTR)ptr[-2]; + size = HeapSize(GetProcessHeap(), 0, ptr - 2); + ok(size == (count + 2) * sizeof(void *), "got count %lu, size %Iu.\n", count, size); + + for (i = 0; i < count; ++i) + { + if (!ptr[i]) continue; + size = HeapSize(GetProcessHeap(), 0, (void **)ptr[i] - 2); + ok(size && size < 100000, "got %Iu.\n", size); + } + + ptr = thread_teb->ThreadLocalStoragePointer; + count = (ULONG_PTR)ptr[-2]; + size = HeapSize(GetProcessHeap(), 0, ptr - 2); + ok(size == (count + 2) * sizeof(void *), "got count %lu, size %Iu.\n", count, size); + } + ok(!!thread_teb->ThreadLocalStoragePointer, "got NULL.\n"); ok(!teb->TlsLinks.Flink, "got %p.\n", teb->TlsLinks.Flink); ok(!teb->TlsLinks.Blink, "got %p.\n", teb->TlsLinks.Blink); diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 279fd7cb1c51..54154e60cc3d 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1302,6 +1302,36 @@ static BOOL is_dll_native_subsystem( LDR_DATA_TABLE_ENTRY *mod, const IMAGE_NT_H return TRUE; } + +/************************************************************************* + * alloc_tls_memory + * + * Allocate memory for TLS vector or index with an extra data. + */ +static void *alloc_tls_memory( BOOL vector, ULONG_PTR size ) +{ + ULONG_PTR *ptr; + + if (!(ptr = RtlAllocateHeap( GetProcessHeap(), vector ? HEAP_ZERO_MEMORY : 0, size + sizeof(void *) * 2 ))) return NULL; + ptr += 2; + if (vector) ptr[-2] = size / sizeof(void *); + else ptr[-2] = ptr[-1] = 0; + return ptr; +} + + +/************************************************************************* + * free_tls_memory + * + * Free TLS vector or index memory. + */ +static void free_tls_memory( void *ptr ) +{ + if (!ptr) return; + RtlFreeHeap( GetProcessHeap(), 0, (void **)ptr - 2 ); +} + + /************************************************************************* * alloc_tls_slot * @@ -1368,13 +1398,13 @@ static BOOL alloc_tls_slot( LDR_DATA_TABLE_ENTRY *mod ) t->ThreadData[j].Flags = 0; - if (!(new_ptr = RtlAllocateHeap( GetProcessHeap(), 0, size + dir->SizeOfZeroFill ))) return FALSE; + if (!(new_ptr = alloc_tls_memory( FALSE, size + dir->SizeOfZeroFill ))) return FALSE; memcpy( new_ptr, (void *)dir->StartAddressOfRawData, size ); memset( (char *)new_ptr + size, 0, dir->SizeOfZeroFill ); if (t->OperationType == ProcessTlsReplaceVector) { - vector = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, tls_module_count * sizeof(*vector) ); + vector = alloc_tls_memory( TRUE, tls_module_count * sizeof(*vector) ); if (!vector) return FALSE; t->ThreadData[j].TlsVector = vector; vector[i] = new_ptr; @@ -1394,12 +1424,12 @@ static BOOL alloc_tls_slot( LDR_DATA_TABLE_ENTRY *mod ) { /* There could be fewer active threads than we counted here due to force terminated threads, first * free extra TLS directory data set in the new TLS vector. */ - RtlFreeHeap( GetProcessHeap(), 0, ((void **)t->ThreadData[j].TlsVector)[i] ); + free_tls_memory( ((void **)t->ThreadData[j].TlsVector)[i] ); } if (!(t->ThreadData[j].Flags & THREAD_TLS_INFORMATION_ASSIGNED) || t->OperationType == ProcessTlsReplaceIndex) { /* FIXME: can't free old Tls vector here, should be freed at thread exit. */ - RtlFreeHeap( GetProcessHeap(), 0, t->ThreadData[j].TlsVector ); + free_tls_memory( t->ThreadData[j].TlsVector ); } } RtlFreeHeap( GetProcessHeap(), 0, t ); @@ -1612,8 +1642,7 @@ static NTSTATUS alloc_thread_tls(void) void **pointers; UINT i, size; - if (!(pointers = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, - tls_module_count * sizeof(*pointers) ))) + if (!(pointers = alloc_tls_memory( TRUE, tls_module_count * sizeof(*pointers) ))) return STATUS_NO_MEMORY; for (i = 0; i < tls_module_count; i++) @@ -1624,10 +1653,10 @@ static NTSTATUS alloc_thread_tls(void) size = dir->EndAddressOfRawData - dir->StartAddressOfRawData; if (!size && !dir->SizeOfZeroFill) continue; - if (!(pointers[i] = RtlAllocateHeap( GetProcessHeap(), 0, size + dir->SizeOfZeroFill ))) + if (!(pointers[i] = alloc_tls_memory( FALSE, size + dir->SizeOfZeroFill ))) { - while (i) RtlFreeHeap( GetProcessHeap(), 0, pointers[--i] ); - RtlFreeHeap( GetProcessHeap(), 0, pointers ); + while (i) free_tls_memory( pointers[--i] ); + free_tls_memory( pointers ); return STATUS_NO_MEMORY; } memcpy( pointers[i], (void *)dir->StartAddressOfRawData, size ); @@ -4088,8 +4117,8 @@ void WINAPI LdrShutdownThread(void) if (NtCurrentTeb()->Instrumentation[0]) ((TEB *)NtCurrentTeb()->Instrumentation[0])->ThreadLocalStoragePointer = NULL; #endif - for (i = 0; i < tls_module_count; i++) RtlFreeHeap( GetProcessHeap(), 0, pointers[i] ); - RtlFreeHeap( GetProcessHeap(), 0, pointers ); + for (i = 0; i < tls_module_count; i++) free_tls_memory( pointers[i] ); + free_tls_memory( pointers ); } RtlProcessFlsData( NtCurrentTeb()->FlsSlots, 2 ); NtCurrentTeb()->FlsSlots = NULL; From b49c30534754377d9cec8e4c5e417563d7f18e38 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 24 Sep 2024 14:05:13 -0600 Subject: [PATCH 0834/2542] ntdll/tests: Add a test for module function table search. --- dlls/ntdll/tests/unwind.c | 48 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/dlls/ntdll/tests/unwind.c b/dlls/ntdll/tests/unwind.c index daa90c19a11c..73c18e4a95dd 100644 --- a/dlls/ntdll/tests/unwind.c +++ b/dlls/ntdll/tests/unwind.c @@ -3412,6 +3412,53 @@ static void test_dynamic_unwind(void) } } +static void test_exception_directory(void) +{ + ULONG len, exc_dir_size, old, saved_size, saved_address; + HMODULE mod = GetModuleHandleW( NULL ); + PRUNTIME_FUNCTION func; + IMAGE_NT_HEADERS *nt; + ULONG_PTR base; + void *exc_dir; + BOOL ret; + + func = pRtlLookupFunctionTable( (ULONG_PTR)test_exception_directory, &base, &len ); + ok( !!func, "got NULL.\n" ); + + exc_dir = RtlImageDirectoryEntryToData( mod, TRUE, IMAGE_DIRECTORY_ENTRY_EXCEPTION, &exc_dir_size ); + ok( func == exc_dir, "got %p, expected %p.\n", func, exc_dir ); + ok( len == exc_dir_size, "got %lu, expected %lu.\n", len, exc_dir_size ); + ok( base == (ULONG_PTR)mod, "got %#Ix, expected %p.\n", base, mod ); + + nt = RtlImageNtHeader( mod ); + ok( !!nt, "got NULL.\n" ); + ret = VirtualProtect( &nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress, + sizeof(DWORD) * 2, PAGE_READWRITE, &old); + ok( ret, "got error %lu.\n", GetLastError() ); + saved_size = nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size; + saved_address = nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress; + nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size = 0; + nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress = 0; + ret = VirtualProtect( &nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress, + sizeof(DWORD) * 2, old, &old); + ok( ret, "got error %lu.\n", GetLastError() ); + + base = 0xdeadbeef; + len = 0xdeadbeef; + func = pRtlLookupFunctionTable( (ULONG_PTR)test_exception_directory, &base, &len ); + todo_wine ok( func == exc_dir, "got %p, expected %p.\n", func, exc_dir ); + todo_wine ok( len == exc_dir_size, "got %lu, expected %lu.\n", len, exc_dir_size ); + ok( base == (ULONG_PTR)mod, "got %#Ix, expected %p.\n", base, mod ); + ret = VirtualProtect( &nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress, + sizeof(DWORD) * 2, PAGE_READWRITE, &old); + ok( ret, "got error %lu.\n", GetLastError() ); + nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size = saved_size; + nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress = saved_address; + ret = VirtualProtect( &nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress, + sizeof(DWORD) * 2, old, &old); + ok( ret, "got error %lu.\n", GetLastError() ); +} + START_TEST(unwind) { @@ -3441,6 +3488,7 @@ START_TEST(unwind) #endif test_dynamic_unwind(); + test_exception_directory(); } #else /* !__i386__ */ From 5461388499f0b7c2408a4f21892f16d4569b585d Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 24 Sep 2024 13:38:50 -0600 Subject: [PATCH 0835/2542] ntdll: Maintain module exception directory table. --- dlls/ntdll/loader.c | 3 ++ dlls/ntdll/ntdll_misc.h | 2 + dlls/ntdll/unwind.c | 96 +++++++++++++++++++++++++++++++++++++++++ include/winnt.h | 10 +++++ 4 files changed, 111 insertions(+) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 54154e60cc3d..87908fb9564c 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1620,6 +1620,7 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name InsertTailList(&hash_table[hash_basename( &wm->ldr.BaseDllName )], &wm->ldr.HashLinks); if (rtl_rb_tree_put( &base_address_index_tree, wm->ldr.DllBase, &wm->ldr.BaseAddressIndexNode, base_address_compare )) ERR( "rtl_rb_tree_put failed.\n" ); + register_module_exception_directory( hModule ); /* wait until init is called for inserting into InInitializationOrderModuleList */ if (!(nt->OptionalHeader.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NX_COMPAT)) @@ -2386,6 +2387,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name, RemoveEntryList(&wm->ldr.InMemoryOrderLinks); RemoveEntryList(&wm->ldr.HashLinks); RtlRbRemoveNode( &base_address_index_tree, &wm->ldr.BaseAddressIndexNode ); + unregister_module_exception_directory( wm->ldr.DllBase ); /* FIXME: there are several more dangling references * left. Including dlls loaded by this dll before the @@ -4150,6 +4152,7 @@ static void free_modref( WINE_MODREF *wm ) RtlRbRemoveNode( &base_address_index_tree, &wm->ldr.BaseAddressIndexNode ); if (wm->ldr.InInitializationOrderLinks.Flink) RemoveEntryList(&wm->ldr.InInitializationOrderLinks); + unregister_module_exception_directory( wm->ldr.DllBase ); while ((entry = wm->ldr.DdagNode->Dependencies.Tail)) { diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 0ee1dfe225b4..0a2d67fad596 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -66,6 +66,8 @@ extern EXCEPTION_DISPOSITION WINAPI nested_exception_handler( EXCEPTION_RECORD * CONTEXT *context, void *dispatch ); extern void DECLSPEC_NORETURN raise_status( NTSTATUS status, EXCEPTION_RECORD *rec ); extern LONG WINAPI call_unhandled_exception_filter( PEXCEPTION_POINTERS eptr ); +extern void register_module_exception_directory( void *module ); +extern void unregister_module_exception_directory( void *module ); extern void WINAPI process_breakpoint(void); static inline BOOL is_valid_frame( ULONG_PTR frame ) diff --git a/dlls/ntdll/unwind.c b/dlls/ntdll/unwind.c index c11bd9ddb9ca..0866d93294b7 100644 --- a/dlls/ntdll/unwind.c +++ b/dlls/ntdll/unwind.c @@ -80,6 +80,92 @@ static RTL_CRITICAL_SECTION_DEBUG dynamic_unwind_debug = }; static RTL_CRITICAL_SECTION dynamic_unwind_section = { &dynamic_unwind_debug, -1, 0, 0, 0, 0 }; +struct module_exception_dir_entry +{ + void *exception_dir; + void *dllbase; + DWORD size_of_image; + DWORD exception_dir_size; +}; + +#define MAX_MODULE_EXCEPTION_DIR_ENTRIES 512 + +struct module_exception_dir_table +{ + DWORD count; + DWORD max_count; + DWORD unk; + DWORD unk2; + struct module_exception_dir_entry entries[MAX_MODULE_EXCEPTION_DIR_ENTRIES]; +}; +struct module_exception_dir_table DECLSPEC_ALLOCATE(".mrdata") exception_dir_table = { 1, MAX_MODULE_EXCEPTION_DIR_ENTRIES }; + +C_ASSERT( sizeof(struct module_exception_dir_entry) == 0x18 ); +C_ASSERT( offsetof(struct module_exception_dir_table, entries) == 0x10 ); + +void register_module_exception_directory( void *module ) +{ + SIZE_T size = sizeof(exception_dir_table); + struct module_exception_dir_entry e; + void *addr = &exception_dir_table; + IMAGE_NT_HEADERS *nt; + ULONG old_prot; + unsigned int i; + + if (!(nt = RtlImageNtHeader( module ))) return; + e.exception_dir = RtlImageDirectoryEntryToData( module, TRUE, IMAGE_DIRECTORY_ENTRY_EXCEPTION, &e.exception_dir_size ); + if (!e.exception_dir) return; + e.size_of_image = nt->OptionalHeader.SizeOfImage; + e.dllbase = module; + + RtlEnterCriticalSection( &dynamic_unwind_section ); + + if (exception_dir_table.count == MAX_MODULE_EXCEPTION_DIR_ENTRIES) goto done; + + NtProtectVirtualMemory( NtCurrentProcess(), &addr, &size, PAGE_READWRITE, &old_prot ); + /* First entry is reserved for ntdll regardless of base address order. */ + if (exception_dir_table.count <= 2) + { + MEMORY_BASIC_INFORMATION mbi; + + NtQueryVirtualMemory( GetCurrentProcess(), LdrInitializeThunk, MemoryBasicInformation, &mbi, sizeof(mbi), NULL ); + if (module == mbi.AllocationBase) + { + exception_dir_table.entries[0] = e; + goto done; + } + } + for (i = 1; i < exception_dir_table.count; ++i) + if ((ULONG_PTR)module < (ULONG_PTR)exception_dir_table.entries[i].dllbase) break; + memmove( &exception_dir_table.entries[i + 1], &exception_dir_table.entries[i], + sizeof(*exception_dir_table.entries) * (exception_dir_table.count - i) ); + exception_dir_table.entries[i] = e; + ++exception_dir_table.count; +done: + RtlLeaveCriticalSection( &dynamic_unwind_section ); +} + +void unregister_module_exception_directory( void *module ) +{ + SIZE_T size = sizeof(exception_dir_table); + void *addr = &exception_dir_table; + ULONG old_prot; + unsigned int i; + + RtlEnterCriticalSection( &dynamic_unwind_section ); + for (i = 1; i < exception_dir_table.count; ++i) + { + if (module == exception_dir_table.entries[i].dllbase) + { + NtProtectVirtualMemory( NtCurrentProcess(), &addr, &size, PAGE_READWRITE, &old_prot ); + memmove( &exception_dir_table.entries[i], &exception_dir_table.entries[i + 1], + sizeof(*exception_dir_table.entries) * (exception_dir_table.count - i - 1) ); + --exception_dir_table.count; + break; + } + } + RtlLeaveCriticalSection( &dynamic_unwind_section ); +} static RUNTIME_FUNCTION *lookup_dynamic_function_table( ULONG_PTR pc, ULONG_PTR *base, ULONG *count ) { @@ -2339,4 +2425,14 @@ void WINAPI _local_unwind( void *frame, void *target_ip ) RtlUnwind( frame, target_ip, NULL, NULL ); } +#else + +void register_module_exception_directory( void *module ) +{ +} + +void unregister_module_exception_directory( void *module ) +{ +} + #endif /* !__i386__ */ diff --git a/include/winnt.h b/include/winnt.h index 2547f841b7c4..52a48e4249b2 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -83,6 +83,16 @@ extern "C" { # endif #endif +#ifndef DECLSPEC_ALLOCATE +# if __has_declspec_attribute(allocate) && !defined(MIDL_PASS) +# define DECLSPEC_ALLOCATE(x) __declspec(allocate(x)) +# elif defined(__GNUC__) +# define DECLSPEC_ALLOCATE(x) __attribute__((section(x))) +# else +# define DECLSPEC_ALLOCATE(x) +# endif +#endif + #ifndef DECLSPEC_NOTHROW # ifdef __GNUC__ # define DECLSPEC_NOTHROW __attribute__((nothrow)) From ab5db5cb8da9a76937e932df45cf1326d9a4a1c2 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 24 Sep 2024 17:48:00 -0600 Subject: [PATCH 0836/2542] HACK: wine.inf: Add native,builting override for TDUSC / xinput1_3. CW-Bug-Id: #24258 --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 3e56b5979ee6..29dffbaeb634 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2895,6 +2895,7 @@ HKCU,Software\Wine\DllOverrides,"atiadlxx",,"disabled" HKCU,Software\Wine\DllOverrides,"nvcuda",0x2,"disabled" HKCU,Software\Wine\DllOverrides,"vcruntime140_1",0x2,"native,builtin" HKCU,Software\Wine\AppDefaults\ShadowOfWar.exe\DllOverrides,"amd_ags_x64",,"disabled" +HKCU,Software\Wine\AppDefaults\TDUSC.exe\DllOverrides,"xinput1_3",,"native,builtin" ;;App-specific overrides for atiadlxx.dll. HKCU,Software\Wine\AppDefaults\s2_sp64_ship.exe\DllOverrides,"atiadlxx",,"builtin" HKCU,Software\Wine\AppDefaults\s2_mp64_ship.exe\DllOverrides,"atiadlxx",,"builtin" From 3ac8cf892c1c5f3d5bdd75cebc3d3350ca57ac40 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 30 Sep 2024 15:15:04 -0600 Subject: [PATCH 0837/2542] ntdll: HACK: Enable WINE_ALERT_SIMULATE_SCHED_QUANTUM option for Mary Skelter 2. CW-Bug-Id: #24283 --- dlls/ntdll/unix/loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 6b06ca881fd6..62504277d84e 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2166,6 +2166,7 @@ static void hacks_init(void) else if (main_argc > 1) { alert_simulate_sched_quantum = !!strstr(main_argv[1], "GTA5.exe"); + alert_simulate_sched_quantum = alert_simulate_sched_quantum || !!strstr(main_argv[1], "MarySkelter2.exe"); } if (alert_simulate_sched_quantum) ERR("HACK: Simulating sched quantum in NtWaitForAlertByThreadId.\n"); From 690273a44e04957b9e8bdfac56d895dde4653fd7 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 30 Sep 2024 20:28:39 -0600 Subject: [PATCH 0838/2542] ntdll: HACK: Force en-US locale for EAC launcher. CW-Bug-Id: #24326 --- dlls/ntdll/unix/env.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index da9cf169a788..683c636103ee 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -818,6 +818,13 @@ static void init_locale(void) if (!unix_to_win_locale( ctype, system_locale )) system_locale[0] = 0; TRACE_(nls)( "Unix LC_CTYPE is %s, setting system locale to %s\n", debugstr_a(ctype), debugstr_a(user_locale) ); + + if (main_argc > 1 && strstr(main_argv[1], "start_protected_game.exe")) + { + FIXME( "HACK setting EN locale.\n" ); + messages = "en-US"; + } + if (!unix_to_win_locale( messages, user_locale )) user_locale[0] = 0; TRACE_(nls)( "Unix LC_MESSAGES is %s, user system locale to %s\n", debugstr_a(messages), debugstr_a(user_locale) ); From 99dbc76afcf992f324b89c89b5d9b8b0ed8b644b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 10 Oct 2024 21:32:55 -0600 Subject: [PATCH 0839/2542] ntdll: HACK: Introduce WINE_HEAP_TOP_DOWN hack. CW-Bug-Id: #24362 --- dlls/ntdll/heap.c | 6 +++++- dlls/ntdll/loader.c | 5 +++++ dlls/ntdll/ntdll_misc.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 1afc0e27e2a0..8c2a96aca1ad 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -330,6 +330,7 @@ C_ASSERT( HEAP_MIN_LARGE_BLOCK_SIZE <= HEAP_INITIAL_GROW_SIZE ); BOOL delay_heap_free = FALSE; BOOL heap_zero_hack = FALSE; +BOOL heap_top_down_hack = FALSE; static struct heap *process_heap; /* main process heap */ @@ -972,6 +973,7 @@ static struct block *split_block( struct heap *heap, ULONG flags, struct block * static void *allocate_region( struct heap *heap, ULONG flags, SIZE_T *region_size, SIZE_T *commit_size ) { const SIZE_T align = 0x400 * sizeof(void*); /* minimum alignment for virtual allocations */ + ULONG reserve_flags = MEM_RESERVE; void *addr = NULL; NTSTATUS status; @@ -984,8 +986,10 @@ static void *allocate_region( struct heap *heap, ULONG flags, SIZE_T *region_siz *region_size = ROUND_SIZE( *region_size, align - 1 ); *commit_size = ROUND_SIZE( *commit_size, align - 1 ); + if (heap_top_down_hack) reserve_flags |= MEM_TOP_DOWN; + /* allocate the memory block */ - if ((status = NtAllocateVirtualMemory( NtCurrentProcess(), &addr, 0, region_size, MEM_RESERVE, + if ((status = NtAllocateVirtualMemory( NtCurrentProcess(), &addr, 0, region_size, reserve_flags, get_protection_type( flags ) ))) { WARN( "Could not allocate %#Ix bytes, status %#lx\n", *region_size, status ); diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 87908fb9564c..75669e95b723 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -4628,6 +4628,11 @@ void loader_init( CONTEXT *context, void **entry ) ERR( "Enabling heap zero hack.\n" ); heap_zero_hack = TRUE; } + if (get_env( L"WINE_HEAP_TOP_DOWN", env_str, sizeof(env_str)) && env_str[0] == L'1') + { + ERR( "Enabling heap top down hack.\n" ); + heap_top_down_hack = TRUE; + } peb->ProcessHeap = RtlCreateHeap( heap_flags, NULL, 0, 0, NULL, NULL ); diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 0a2d67fad596..3dae3079c4e7 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -55,6 +55,7 @@ extern UINT_PTR page_size; extern BOOL delay_heap_free; extern BOOL heap_zero_hack; +extern BOOL heap_top_down_hack; /* exceptions */ extern NTSTATUS call_seh_handlers( EXCEPTION_RECORD *rec, CONTEXT *context ); From 2fac2f340481817e66513cdb1a116c2851cb1aef Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 24 Oct 2024 15:49:03 -0600 Subject: [PATCH 0840/2542] icu: Add stub dll. CW-Bug-Id: #24402 --- configure.ac | 1 + dlls/icu/Makefile.in | 3 + dlls/icu/icu.spec | 1031 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1035 insertions(+) create mode 100644 dlls/icu/Makefile.in create mode 100644 dlls/icu/icu.spec diff --git a/configure.ac b/configure.ac index 6a5e2b085584..34fc1785697a 100644 --- a/configure.ac +++ b/configure.ac @@ -2752,6 +2752,7 @@ WINE_CONFIG_MAKEFILE(dlls/iccvid) WINE_CONFIG_MAKEFILE(dlls/icmp) WINE_CONFIG_MAKEFILE(dlls/icmui) WINE_CONFIG_MAKEFILE(dlls/icmui/tests) +WINE_CONFIG_MAKEFILE(dlls/icu) WINE_CONFIG_MAKEFILE(dlls/ieframe) WINE_CONFIG_MAKEFILE(dlls/ieframe/tests) WINE_CONFIG_MAKEFILE(dlls/ieproxy) diff --git a/dlls/icu/Makefile.in b/dlls/icu/Makefile.in new file mode 100644 index 000000000000..ca8ca9030486 --- /dev/null +++ b/dlls/icu/Makefile.in @@ -0,0 +1,3 @@ +MODULE = icu.dll + +EXTRADLLFLAGS = -Wb,--prefer-native diff --git a/dlls/icu/icu.spec b/dlls/icu/icu.spec new file mode 100644 index 000000000000..6e1d3763cfb7 --- /dev/null +++ b/dlls/icu/icu.spec @@ -0,0 +1,1031 @@ +#@ stub CloseDefaultICUGroupingLetters +#@ stub GetDefaultICUGroupingLetters +#@ stub GetICUGroupingLetter +#@ stub SortCloseHandle +#@ stub SortGetHandle +#@ stub SortGetSearchKey +#@ stub UCNV_FROM_U_CALLBACK_ESCAPE +#@ stub UCNV_FROM_U_CALLBACK_SKIP +#@ stub UCNV_FROM_U_CALLBACK_STOP +#@ stub UCNV_FROM_U_CALLBACK_SUBSTITUTE +#@ stub UCNV_TO_U_CALLBACK_ESCAPE +#@ stub UCNV_TO_U_CALLBACK_SKIP +#@ stub UCNV_TO_U_CALLBACK_STOP +#@ stub UCNV_TO_U_CALLBACK_SUBSTITUTE +#@ stub u_UCharsToChars +#@ stub u_austrcpy +#@ stub u_austrncpy +#@ stub u_catclose +#@ stub u_catgets +#@ stub u_catopen +#@ stub u_charAge +#@ stub u_charDigitValue +#@ stub u_charDirection +#@ stub u_charFromName +#@ stub u_charMirror +#@ stub u_charName +#@ stub u_charType +#@ stub u_charsToUChars +#@ stub u_cleanup +#@ stub u_countChar32 +#@ stub u_digit +#@ stub u_enumCharNames +#@ stub u_enumCharTypes +#@ stub u_errorName +#@ stub u_foldCase +#@ stub u_forDigit +#@ stub u_formatMessage +#@ stub u_formatMessageWithError +#@ stub u_getBidiPairedBracket +#@ stub u_getBinaryPropertySet +#@ stub u_getCombiningClass +#@ stub u_getDataVersion +#@ stub u_getFC_NFKC_Closure +#@ stub u_getIntPropertyMap +#@ stub u_getIntPropertyMaxValue +#@ stub u_getIntPropertyMinValue +#@ stub u_getIntPropertyValue +#@ stub u_getNumericValue +#@ stub u_getPropertyEnum +#@ stub u_getPropertyName +#@ stub u_getPropertyValueEnum +#@ stub u_getPropertyValueName +#@ stub u_getUnicodeVersion +#@ stub u_getVersion +#@ stub u_hasBinaryProperty +#@ stub u_init +#@ stub u_isIDIgnorable +#@ stub u_isIDPart +#@ stub u_isIDStart +#@ stub u_isISOControl +#@ stub u_isJavaIDPart +#@ stub u_isJavaIDStart +#@ stub u_isJavaSpaceChar +#@ stub u_isMirrored +#@ stub u_isUAlphabetic +#@ stub u_isULowercase +#@ stub u_isUUppercase +#@ stub u_isUWhiteSpace +#@ stub u_isWhitespace +#@ stub u_isalnum +#@ stub u_isalpha +#@ stub u_isbase +#@ stub u_isblank +#@ stub u_iscntrl +#@ stub u_isdefined +#@ stub u_isdigit +#@ stub u_isgraph +#@ stub u_islower +#@ stub u_isprint +#@ stub u_ispunct +#@ stub u_isspace +#@ stub u_istitle +#@ stub u_isupper +#@ stub u_isxdigit +#@ stub u_memcasecmp +#@ stub u_memchr +#@ stub u_memchr32 +#@ stub u_memcmp +#@ stub u_memcmpCodePointOrder +#@ stub u_memcpy +#@ stub u_memmove +#@ stub u_memrchr +#@ stub u_memrchr32 +#@ stub u_memset +#@ stub u_parseMessage +#@ stub u_parseMessageWithError +#@ stub u_setMemoryFunctions +#@ stub u_shapeArabic +#@ stub u_strCaseCompare +#@ stub u_strCompare +#@ stub u_strCompareIter +#@ stub u_strFindFirst +#@ stub u_strFindLast +#@ stub u_strFoldCase +#@ stub u_strFromJavaModifiedUTF8WithSub +#@ stub u_strFromUTF32 +#@ stub u_strFromUTF32WithSub +#@ stub u_strFromUTF8 +#@ stub u_strFromUTF8Lenient +#@ stub u_strFromUTF8WithSub +#@ stub u_strFromWCS +#@ stub u_strHasMoreChar32Than +#@ stub u_strToJavaModifiedUTF8 +#@ stub u_strToLower +#@ stub u_strToTitle +#@ stub u_strToUTF32 +#@ stub u_strToUTF32WithSub +#@ stub u_strToUTF8 +#@ stub u_strToUTF8WithSub +#@ stub u_strToUpper +#@ stub u_strToWCS +#@ stub u_strcasecmp +#@ stub u_strcat +#@ stub u_strchr +#@ stub u_strchr32 +#@ stub u_strcmp +#@ stub u_strcmpCodePointOrder +#@ stub u_strcpy +#@ stub u_strcspn +#@ stub u_strlen +#@ stub u_strncasecmp +#@ stub u_strncat +#@ stub u_strncmp +#@ stub u_strncmpCodePointOrder +#@ stub u_strncpy +#@ stub u_strpbrk +#@ stub u_strrchr +#@ stub u_strrchr32 +#@ stub u_strrstr +#@ stub u_strspn +#@ stub u_strstr +#@ stub u_strtok_r +#@ stub u_tolower +#@ stub u_totitle +#@ stub u_toupper +#@ stub u_uastrcpy +#@ stub u_uastrncpy +#@ stub u_unescape +#@ stub u_unescapeAt +#@ stub u_versionFromString +#@ stub u_versionFromUString +#@ stub u_versionToString +#@ stub u_vformatMessage +#@ stub u_vformatMessageWithError +#@ stub u_vparseMessage +#@ stub u_vparseMessageWithError +#@ stub ubidi_close +#@ stub ubidi_countParagraphs +#@ stub ubidi_countRuns +#@ stub ubidi_getBaseDirection +#@ stub ubidi_getClassCallback +#@ stub ubidi_getCustomizedClass +#@ stub ubidi_getDirection +#@ stub ubidi_getLength +#@ stub ubidi_getLevelAt +#@ stub ubidi_getLevels +#@ stub ubidi_getLogicalIndex +#@ stub ubidi_getLogicalMap +#@ stub ubidi_getLogicalRun +#@ stub ubidi_getParaLevel +#@ stub ubidi_getParagraph +#@ stub ubidi_getParagraphByIndex +#@ stub ubidi_getProcessedLength +#@ stub ubidi_getReorderingMode +#@ stub ubidi_getReorderingOptions +#@ stub ubidi_getResultLength +#@ stub ubidi_getText +#@ stub ubidi_getVisualIndex +#@ stub ubidi_getVisualMap +#@ stub ubidi_getVisualRun +#@ stub ubidi_invertMap +#@ stub ubidi_isInverse +#@ stub ubidi_isOrderParagraphsLTR +#@ stub ubidi_open +#@ stub ubidi_openSized +#@ stub ubidi_orderParagraphsLTR +#@ stub ubidi_reorderLogical +#@ stub ubidi_reorderVisual +#@ stub ubidi_setClassCallback +#@ stub ubidi_setContext +#@ stub ubidi_setInverse +#@ stub ubidi_setLine +#@ stub ubidi_setPara +#@ stub ubidi_setReorderingMode +#@ stub ubidi_setReorderingOptions +#@ stub ubidi_writeReordered +#@ stub ubidi_writeReverse +#@ stub ubiditransform_close +#@ stub ubiditransform_open +#@ stub ubiditransform_transform +#@ stub ublock_getCode +#@ stub ubrk_close +#@ stub ubrk_countAvailable +#@ stub ubrk_current +#@ stub ubrk_first +#@ stub ubrk_following +#@ stub ubrk_getAvailable +#@ stub ubrk_getBinaryRules +#@ stub ubrk_getLocaleByType +#@ stub ubrk_getRuleStatus +#@ stub ubrk_getRuleStatusVec +#@ stub ubrk_isBoundary +#@ stub ubrk_last +#@ stub ubrk_next +#@ stub ubrk_open +#@ stub ubrk_openBinaryRules +#@ stub ubrk_openRules +#@ stub ubrk_preceding +#@ stub ubrk_previous +#@ stub ubrk_refreshUText +#@ stub ubrk_safeClone +#@ stub ubrk_setText +#@ stub ubrk_setUText +#@ stub ucal_add +#@ stub ucal_clear +#@ stub ucal_clearField +#@ stub ucal_clone +#@ stub ucal_close +#@ stub ucal_countAvailable +#@ stub ucal_equivalentTo +#@ stub ucal_get +#@ stub ucal_getAttribute +#@ stub ucal_getAvailable +#@ stub ucal_getCanonicalTimeZoneID +#@ stub ucal_getDSTSavings +#@ stub ucal_getDayOfWeekType +#@ stub ucal_getDefaultTimeZone +#@ stub ucal_getFieldDifference +#@ stub ucal_getGregorianChange +#@ stub ucal_getHostTimeZone +#@ stub ucal_getKeywordValuesForLocale +#@ stub ucal_getLimit +#@ stub ucal_getLocaleByType +#@ stub ucal_getMillis +#@ stub ucal_getNow +#@ stub ucal_getTZDataVersion +#@ stub ucal_getTimeZoneDisplayName +#@ stub ucal_getTimeZoneID +#@ stub ucal_getTimeZoneIDForWindowsID +#@ stub ucal_getTimeZoneTransitionDate +#@ stub ucal_getType +#@ stub ucal_getWeekendTransition +#@ stub ucal_getWindowsTimeZoneID +#@ stub ucal_inDaylightTime +#@ stub ucal_isSet +#@ stub ucal_isWeekend +#@ stub ucal_open +#@ stub ucal_openCountryTimeZones +#@ stub ucal_openTimeZoneIDEnumeration +#@ stub ucal_openTimeZones +#@ stub ucal_roll +#@ stub ucal_set +#@ stub ucal_setAttribute +#@ stub ucal_setDate +#@ stub ucal_setDateTime +#@ stub ucal_setDefaultTimeZone +#@ stub ucal_setGregorianChange +#@ stub ucal_setMillis +#@ stub ucal_setTimeZone +#@ stub ucasemap_close +#@ stub ucasemap_getBreakIterator +#@ stub ucasemap_getLocale +#@ stub ucasemap_getOptions +#@ stub ucasemap_open +#@ stub ucasemap_setBreakIterator +#@ stub ucasemap_setLocale +#@ stub ucasemap_setOptions +#@ stub ucasemap_toTitle +#@ stub ucasemap_utf8FoldCase +#@ stub ucasemap_utf8ToLower +#@ stub ucasemap_utf8ToTitle +#@ stub ucasemap_utf8ToUpper +#@ stub ucfpos_close +#@ stub ucfpos_constrainCategory +#@ stub ucfpos_constrainField +#@ stub ucfpos_getCategory +#@ stub ucfpos_getField +#@ stub ucfpos_getIndexes +#@ stub ucfpos_getInt64IterationContext +#@ stub ucfpos_matchesField +#@ stub ucfpos_open +#@ stub ucfpos_reset +#@ stub ucfpos_setInt64IterationContext +#@ stub ucfpos_setState +#@ stub ucnv_cbFromUWriteBytes +#@ stub ucnv_cbFromUWriteSub +#@ stub ucnv_cbFromUWriteUChars +#@ stub ucnv_cbToUWriteSub +#@ stub ucnv_cbToUWriteUChars +#@ stub ucnv_close +#@ stub ucnv_compareNames +#@ stub ucnv_convert +#@ stub ucnv_convertEx +#@ stub ucnv_countAliases +#@ stub ucnv_countAvailable +#@ stub ucnv_countStandards +#@ stub ucnv_detectUnicodeSignature +#@ stub ucnv_fixFileSeparator +#@ stub ucnv_flushCache +#@ stub ucnv_fromAlgorithmic +#@ stub ucnv_fromUChars +#@ stub ucnv_fromUCountPending +#@ stub ucnv_fromUnicode +#@ stub ucnv_getAlias +#@ stub ucnv_getAliases +#@ stub ucnv_getAvailableName +#@ stub ucnv_getCCSID +#@ stub ucnv_getCanonicalName +#@ stub ucnv_getDefaultName +#@ stub ucnv_getDisplayName +#@ stub ucnv_getFromUCallBack +#@ stub ucnv_getInvalidChars +#@ stub ucnv_getInvalidUChars +#@ stub ucnv_getMaxCharSize +#@ stub ucnv_getMinCharSize +#@ stub ucnv_getName +#@ stub ucnv_getNextUChar +#@ stub ucnv_getPlatform +#@ stub ucnv_getStandard +#@ stub ucnv_getStandardName +#@ stub ucnv_getStarters +#@ stub ucnv_getSubstChars +#@ stub ucnv_getToUCallBack +#@ stub ucnv_getType +#@ stub ucnv_getUnicodeSet +#@ stub ucnv_isAmbiguous +#@ stub ucnv_isFixedWidth +#@ stub ucnv_open +#@ stub ucnv_openAllNames +#@ stub ucnv_openCCSID +#@ stub ucnv_openPackage +#@ stub ucnv_openStandardNames +#@ stub ucnv_openU +#@ stub ucnv_reset +#@ stub ucnv_resetFromUnicode +#@ stub ucnv_resetToUnicode +#@ stub ucnv_safeClone +#@ stub ucnv_setDefaultName +#@ stub ucnv_setFallback +#@ stub ucnv_setFromUCallBack +#@ stub ucnv_setSubstChars +#@ stub ucnv_setSubstString +#@ stub ucnv_setToUCallBack +#@ stub ucnv_toAlgorithmic +#@ stub ucnv_toUChars +#@ stub ucnv_toUCountPending +#@ stub ucnv_toUnicode +#@ stub ucnv_usesFallback +#@ stub ucnvsel_close +#@ stub ucnvsel_open +#@ stub ucnvsel_openFromSerialized +#@ stub ucnvsel_selectForString +#@ stub ucnvsel_selectForUTF8 +#@ stub ucnvsel_serialize +#@ stub ucol_cloneBinary +#@ stub ucol_close +#@ stub ucol_closeElements +#@ stub ucol_countAvailable +#@ stub ucol_equal +#@ stub ucol_getAttribute +#@ stub ucol_getAvailable +#@ stub ucol_getBound +#@ stub ucol_getContractionsAndExpansions +#@ stub ucol_getDisplayName +#@ stub ucol_getEquivalentReorderCodes +#@ stub ucol_getFunctionalEquivalent +#@ stub ucol_getKeywordValues +#@ stub ucol_getKeywordValuesForLocale +#@ stub ucol_getKeywords +#@ stub ucol_getLocaleByType +#@ stub ucol_getMaxExpansion +#@ stub ucol_getMaxVariable +#@ stub ucol_getOffset +#@ stub ucol_getReorderCodes +#@ stub ucol_getRules +#@ stub ucol_getRulesEx +#@ stub ucol_getSortKey +#@ stub ucol_getStrength +#@ stub ucol_getTailoredSet +#@ stub ucol_getUCAVersion +#@ stub ucol_getVariableTop +#@ stub ucol_getVersion +#@ stub ucol_greater +#@ stub ucol_greaterOrEqual +#@ stub ucol_keyHashCode +#@ stub ucol_mergeSortkeys +#@ stub ucol_next +#@ stub ucol_nextSortKeyPart +#@ stub ucol_open +#@ stub ucol_openAvailableLocales +#@ stub ucol_openBinary +#@ stub ucol_openElements +#@ stub ucol_openRules +#@ stub ucol_previous +#@ stub ucol_primaryOrder +#@ stub ucol_reset +#@ stub ucol_safeClone +#@ stub ucol_secondaryOrder +#@ stub ucol_setAttribute +#@ stub ucol_setMaxVariable +#@ stub ucol_setOffset +#@ stub ucol_setReorderCodes +#@ stub ucol_setStrength +#@ stub ucol_setText +#@ stub ucol_strcoll +#@ stub ucol_strcollIter +#@ stub ucol_strcollUTF8 +#@ stub ucol_tertiaryOrder +#@ stub ucpmap_get +#@ stub ucpmap_getRange +#@ stub ucptrie_close +#@ stub ucptrie_get +#@ stub ucptrie_getRange +#@ stub ucptrie_getType +#@ stub ucptrie_getValueWidth +#@ stub ucptrie_internalSmallIndex +#@ stub ucptrie_internalSmallU8Index +#@ stub ucptrie_internalU8PrevIndex +#@ stub ucptrie_openFromBinary +#@ stub ucptrie_toBinary +#@ stub ucsdet_close +#@ stub ucsdet_detect +#@ stub ucsdet_detectAll +#@ stub ucsdet_enableInputFilter +#@ stub ucsdet_getAllDetectableCharsets +#@ stub ucsdet_getConfidence +#@ stub ucsdet_getLanguage +#@ stub ucsdet_getName +#@ stub ucsdet_getUChars +#@ stub ucsdet_isInputFilterEnabled +#@ stub ucsdet_open +#@ stub ucsdet_setDeclaredEncoding +#@ stub ucsdet_setText +#@ stub ucurr_countCurrencies +#@ stub ucurr_forLocale +#@ stub ucurr_forLocaleAndDate +#@ stub ucurr_getDefaultFractionDigits +#@ stub ucurr_getDefaultFractionDigitsForUsage +#@ stub ucurr_getKeywordValuesForLocale +#@ stub ucurr_getName +#@ stub ucurr_getNumericCode +#@ stub ucurr_getPluralName +#@ stub ucurr_getRoundingIncrement +#@ stub ucurr_getRoundingIncrementForUsage +#@ stub ucurr_isAvailable +#@ stub ucurr_openISOCurrencies +#@ stub ucurr_register +#@ stub ucurr_unregister +#@ stub udat_adoptNumberFormat +#@ stub udat_adoptNumberFormatForFields +#@ stub udat_applyPattern +#@ stub udat_clone +#@ stub udat_close +#@ stub udat_countAvailable +#@ stub udat_countSymbols +#@ stub udat_format +#@ stub udat_formatCalendar +#@ stub udat_formatCalendarForFields +#@ stub udat_formatForFields +#@ stub udat_get2DigitYearStart +#@ stub udat_getAvailable +#@ stub udat_getBooleanAttribute +#@ stub udat_getCalendar +#@ stub udat_getContext +#@ stub udat_getLocaleByType +#@ stub udat_getNumberFormat +#@ stub udat_getNumberFormatForField +#@ stub udat_getSymbols +#@ stub udat_isLenient +#@ stub udat_open +#@ stub udat_parse +#@ stub udat_parseCalendar +#@ stub udat_set2DigitYearStart +#@ stub udat_setBooleanAttribute +#@ stub udat_setCalendar +#@ stub udat_setContext +#@ stub udat_setLenient +#@ stub udat_setNumberFormat +#@ stub udat_setSymbols +#@ stub udat_toCalendarDateField +#@ stub udat_toPattern +#@ stub udatpg_addPattern +#@ stub udatpg_clone +#@ stub udatpg_close +#@ stub udatpg_getAppendItemFormat +#@ stub udatpg_getAppendItemName +#@ stub udatpg_getBaseSkeleton +#@ stub udatpg_getBestPattern +#@ stub udatpg_getBestPatternWithOptions +#@ stub udatpg_getDateTimeFormat +#@ stub udatpg_getDecimal +#@ stub udatpg_getFieldDisplayName +#@ stub udatpg_getPatternForSkeleton +#@ stub udatpg_getSkeleton +#@ stub udatpg_open +#@ stub udatpg_openBaseSkeletons +#@ stub udatpg_openEmpty +#@ stub udatpg_openSkeletons +#@ stub udatpg_replaceFieldTypes +#@ stub udatpg_replaceFieldTypesWithOptions +#@ stub udatpg_setAppendItemFormat +#@ stub udatpg_setAppendItemName +#@ stub udatpg_setDateTimeFormat +#@ stub udatpg_setDecimal +#@ stub udtitvfmt_close +#@ stub udtitvfmt_closeResult +#@ stub udtitvfmt_format +#@ stub udtitvfmt_open +#@ stub udtitvfmt_openResult +#@ stub udtitvfmt_resultAsValue +#@ stub uenum_close +#@ stub uenum_count +#@ stub uenum_next +#@ stub uenum_openCharStringsEnumeration +#@ stub uenum_openUCharStringsEnumeration +#@ stub uenum_reset +#@ stub uenum_unext +#@ stub ufieldpositer_close +#@ stub ufieldpositer_next +#@ stub ufieldpositer_open +#@ stub ufmt_close +#@ stub ufmt_getArrayItemByIndex +#@ stub ufmt_getArrayLength +#@ stub ufmt_getDate +#@ stub ufmt_getDecNumChars +#@ stub ufmt_getDouble +#@ stub ufmt_getInt64 +#@ stub ufmt_getLong +#@ stub ufmt_getObject +#@ stub ufmt_getType +#@ stub ufmt_getUChars +#@ stub ufmt_isNumeric +#@ stub ufmt_open +#@ stub ufmtval_getString +#@ stub ufmtval_nextPosition +#@ stub ugender_getInstance +#@ stub ugender_getListGender +#@ stub uidna_close +#@ stub uidna_labelToASCII +#@ stub uidna_labelToASCII_UTF8 +#@ stub uidna_labelToUnicode +#@ stub uidna_labelToUnicodeUTF8 +#@ stub uidna_nameToASCII +#@ stub uidna_nameToASCII_UTF8 +#@ stub uidna_nameToUnicode +#@ stub uidna_nameToUnicodeUTF8 +#@ stub uidna_openUTS46 +#@ stub uiter_current32 +#@ stub uiter_getState +#@ stub uiter_next32 +#@ stub uiter_previous32 +#@ stub uiter_setState +#@ stub uiter_setString +#@ stub uiter_setUTF16BE +#@ stub uiter_setUTF8 +#@ stub uldn_close +#@ stub uldn_getContext +#@ stub uldn_getDialectHandling +#@ stub uldn_getLocale +#@ stub uldn_keyDisplayName +#@ stub uldn_keyValueDisplayName +#@ stub uldn_languageDisplayName +#@ stub uldn_localeDisplayName +#@ stub uldn_open +#@ stub uldn_openForContext +#@ stub uldn_regionDisplayName +#@ stub uldn_scriptCodeDisplayName +#@ stub uldn_scriptDisplayName +#@ stub uldn_variantDisplayName +#@ stub ulistfmt_close +#@ stub ulistfmt_closeResult +#@ stub ulistfmt_format +#@ stub ulistfmt_formatStringsToResult +#@ stub ulistfmt_open +#@ stub ulistfmt_openForType +#@ stub ulistfmt_openResult +#@ stub ulistfmt_resultAsValue +#@ stub uloc_acceptLanguage +#@ stub uloc_acceptLanguageFromHTTP +#@ stub uloc_addLikelySubtags +#@ stub uloc_canonicalize +#@ stub uloc_countAvailable +#@ stub uloc_forLanguageTag +#@ stub uloc_getAvailable +#@ stub uloc_getBaseName +#@ stub uloc_getCharacterOrientation +#@ stub uloc_getCountry +#@ stub uloc_getDefault +#@ stub uloc_getDisplayCountry +#@ stub uloc_getDisplayKeyword +#@ stub uloc_getDisplayKeywordValue +#@ stub uloc_getDisplayLanguage +#@ stub uloc_getDisplayName +#@ stub uloc_getDisplayScript +#@ stub uloc_getDisplayVariant +#@ stub uloc_getISO3Country +#@ stub uloc_getISO3Language +#@ stub uloc_getISOCountries +#@ stub uloc_getISOLanguages +#@ stub uloc_getKeywordValue +#@ stub uloc_getLCID +#@ stub uloc_getLanguage +#@ stub uloc_getLineOrientation +#@ stub uloc_getLocaleForLCID +#@ stub uloc_getName +#@ stub uloc_getParent +#@ stub uloc_getScript +#@ stub uloc_getVariant +#@ stub uloc_isRightToLeft +#@ stub uloc_minimizeSubtags +#@ stub uloc_openAvailableByType +#@ stub uloc_openKeywords +#@ stub uloc_setDefault +#@ stub uloc_setKeywordValue +#@ stub uloc_toLanguageTag +#@ stub uloc_toLegacyKey +#@ stub uloc_toLegacyType +#@ stub uloc_toUnicodeLocaleKey +#@ stub uloc_toUnicodeLocaleType +#@ stub ulocdata_close +#@ stub ulocdata_getCLDRVersion +#@ stub ulocdata_getDelimiter +#@ stub ulocdata_getExemplarSet +#@ stub ulocdata_getLocaleDisplayPattern +#@ stub ulocdata_getLocaleSeparator +#@ stub ulocdata_getMeasurementSystem +#@ stub ulocdata_getNoSubstitute +#@ stub ulocdata_getPaperSize +#@ stub ulocdata_open +#@ stub ulocdata_setNoSubstitute +#@ stub umsg_applyPattern +#@ stub umsg_autoQuoteApostrophe +#@ stub umsg_clone +#@ stub umsg_close +#@ stub umsg_format +#@ stub umsg_getLocale +#@ stub umsg_open +#@ stub umsg_parse +#@ stub umsg_setLocale +#@ stub umsg_toPattern +#@ stub umsg_vformat +#@ stub umsg_vparse +#@ stub umutablecptrie_buildImmutable +#@ stub umutablecptrie_clone +#@ stub umutablecptrie_close +#@ stub umutablecptrie_fromUCPMap +#@ stub umutablecptrie_fromUCPTrie +#@ stub umutablecptrie_get +#@ stub umutablecptrie_getRange +#@ stub umutablecptrie_open +#@ stub umutablecptrie_set +#@ stub umutablecptrie_setRange +#@ stub unorm2_append +#@ stub unorm2_close +#@ stub unorm2_composePair +#@ stub unorm2_getCombiningClass +#@ stub unorm2_getDecomposition +#@ stub unorm2_getInstance +#@ stub unorm2_getNFCInstance +#@ stub unorm2_getNFDInstance +#@ stub unorm2_getNFKCCasefoldInstance +#@ stub unorm2_getNFKCInstance +#@ stub unorm2_getNFKDInstance +#@ stub unorm2_getRawDecomposition +#@ stub unorm2_hasBoundaryAfter +#@ stub unorm2_hasBoundaryBefore +#@ stub unorm2_isInert +#@ stub unorm2_isNormalized +#@ stub unorm2_normalize +#@ stub unorm2_normalizeSecondAndAppend +#@ stub unorm2_openFiltered +#@ stub unorm2_quickCheck +#@ stub unorm2_spanQuickCheckYes +#@ stub unorm_compare +#@ stub unum_applyPattern +#@ stub unum_clone +#@ stub unum_close +#@ stub unum_countAvailable +#@ stub unum_format +#@ stub unum_formatDecimal +#@ stub unum_formatDouble +#@ stub unum_formatDoubleCurrency +#@ stub unum_formatDoubleForFields +#@ stub unum_formatInt64 +#@ stub unum_formatUFormattable +#@ stub unum_getAttribute +#@ stub unum_getAvailable +#@ stub unum_getContext +#@ stub unum_getDoubleAttribute +#@ stub unum_getLocaleByType +#@ stub unum_getSymbol +#@ stub unum_getTextAttribute +#@ stub unum_open +#@ stub unum_parse +#@ stub unum_parseDecimal +#@ stub unum_parseDouble +#@ stub unum_parseDoubleCurrency +#@ stub unum_parseInt64 +#@ stub unum_parseToUFormattable +#@ stub unum_setAttribute +#@ stub unum_setContext +#@ stub unum_setDoubleAttribute +#@ stub unum_setSymbol +#@ stub unum_setTextAttribute +#@ stub unum_toPattern +#@ stub unumf_close +#@ stub unumf_closeResult +#@ stub unumf_formatDecimal +#@ stub unumf_formatDouble +#@ stub unumf_formatInt +#@ stub unumf_openForSkeletonAndLocale +#@ stub unumf_openForSkeletonAndLocaleWithError +#@ stub unumf_openResult +#@ stub unumf_resultAsValue +#@ stub unumf_resultGetAllFieldPositions +#@ stub unumf_resultNextFieldPosition +#@ stub unumf_resultToString +#@ stub unumsys_close +#@ stub unumsys_getDescription +#@ stub unumsys_getName +#@ stub unumsys_getRadix +#@ stub unumsys_isAlgorithmic +#@ stub unumsys_open +#@ stub unumsys_openAvailableNames +#@ stub unumsys_openByName +#@ stub uplrules_close +#@ stub uplrules_getKeywords +#@ stub uplrules_open +#@ stub uplrules_openForType +#@ stub uplrules_select +#@ stub uplrules_selectFormatted +#@ stub uregex_appendReplacement +#@ stub uregex_appendReplacementUText +#@ stub uregex_appendTail +#@ stub uregex_appendTailUText +#@ stub uregex_clone +#@ stub uregex_close +#@ stub uregex_end +#@ stub uregex_end64 +#@ stub uregex_find +#@ stub uregex_find64 +#@ stub uregex_findNext +#@ stub uregex_flags +#@ stub uregex_getFindProgressCallback +#@ stub uregex_getMatchCallback +#@ stub uregex_getStackLimit +#@ stub uregex_getText +#@ stub uregex_getTimeLimit +#@ stub uregex_getUText +#@ stub uregex_group +#@ stub uregex_groupCount +#@ stub uregex_groupNumberFromCName +#@ stub uregex_groupNumberFromName +#@ stub uregex_groupUText +#@ stub uregex_hasAnchoringBounds +#@ stub uregex_hasTransparentBounds +#@ stub uregex_hitEnd +#@ stub uregex_lookingAt +#@ stub uregex_lookingAt64 +#@ stub uregex_matches +#@ stub uregex_matches64 +#@ stub uregex_open +#@ stub uregex_openC +#@ stub uregex_openUText +#@ stub uregex_pattern +#@ stub uregex_patternUText +#@ stub uregex_refreshUText +#@ stub uregex_regionEnd +#@ stub uregex_regionEnd64 +#@ stub uregex_regionStart +#@ stub uregex_regionStart64 +#@ stub uregex_replaceAll +#@ stub uregex_replaceAllUText +#@ stub uregex_replaceFirst +#@ stub uregex_replaceFirstUText +#@ stub uregex_requireEnd +#@ stub uregex_reset +#@ stub uregex_reset64 +#@ stub uregex_setFindProgressCallback +#@ stub uregex_setMatchCallback +#@ stub uregex_setRegion +#@ stub uregex_setRegion64 +#@ stub uregex_setRegionAndStart +#@ stub uregex_setStackLimit +#@ stub uregex_setText +#@ stub uregex_setTimeLimit +#@ stub uregex_setUText +#@ stub uregex_split +#@ stub uregex_splitUText +#@ stub uregex_start +#@ stub uregex_start64 +#@ stub uregex_useAnchoringBounds +#@ stub uregex_useTransparentBounds +#@ stub uregion_areEqual +#@ stub uregion_contains +#@ stub uregion_getAvailable +#@ stub uregion_getContainedRegions +#@ stub uregion_getContainedRegionsOfType +#@ stub uregion_getContainingRegion +#@ stub uregion_getContainingRegionOfType +#@ stub uregion_getNumericCode +#@ stub uregion_getPreferredValues +#@ stub uregion_getRegionCode +#@ stub uregion_getRegionFromCode +#@ stub uregion_getRegionFromNumericCode +#@ stub uregion_getType +#@ stub ureldatefmt_close +#@ stub ureldatefmt_closeResult +#@ stub ureldatefmt_combineDateAndTime +#@ stub ureldatefmt_format +#@ stub ureldatefmt_formatNumeric +#@ stub ureldatefmt_formatNumericToResult +#@ stub ureldatefmt_formatToResult +#@ stub ureldatefmt_open +#@ stub ureldatefmt_openResult +#@ stub ureldatefmt_resultAsValue +#@ stub ures_close +#@ stub ures_getBinary +#@ stub ures_getByIndex +#@ stub ures_getByKey +#@ stub ures_getInt +#@ stub ures_getIntVector +#@ stub ures_getKey +#@ stub ures_getLocaleByType +#@ stub ures_getNextResource +#@ stub ures_getNextString +#@ stub ures_getSize +#@ stub ures_getString +#@ stub ures_getStringByIndex +#@ stub ures_getStringByKey +#@ stub ures_getType +#@ stub ures_getUInt +#@ stub ures_getUTF8String +#@ stub ures_getUTF8StringByIndex +#@ stub ures_getUTF8StringByKey +#@ stub ures_getVersion +#@ stub ures_hasNext +#@ stub ures_open +#@ stub ures_openAvailableLocales +#@ stub ures_openDirect +#@ stub ures_openU +#@ stub ures_resetIterator +#@ stub uscript_breaksBetweenLetters +#@ stub uscript_getCode +#@ stub uscript_getName +#@ stub uscript_getSampleString +#@ stub uscript_getScript +#@ stub uscript_getScriptExtensions +#@ stub uscript_getShortName +#@ stub uscript_getUsage +#@ stub uscript_hasScript +#@ stub uscript_isCased +#@ stub uscript_isRightToLeft +#@ stub usearch_close +#@ stub usearch_first +#@ stub usearch_following +#@ stub usearch_getAttribute +#@ stub usearch_getBreakIterator +#@ stub usearch_getCollator +#@ stub usearch_getMatchedLength +#@ stub usearch_getMatchedStart +#@ stub usearch_getMatchedText +#@ stub usearch_getOffset +#@ stub usearch_getPattern +#@ stub usearch_getText +#@ stub usearch_last +#@ stub usearch_next +#@ stub usearch_open +#@ stub usearch_openFromCollator +#@ stub usearch_preceding +#@ stub usearch_previous +#@ stub usearch_reset +#@ stub usearch_setAttribute +#@ stub usearch_setBreakIterator +#@ stub usearch_setCollator +#@ stub usearch_setOffset +#@ stub usearch_setPattern +#@ stub usearch_setText +#@ stub uset_add +#@ stub uset_addAll +#@ stub uset_addAllCodePoints +#@ stub uset_addRange +#@ stub uset_addString +#@ stub uset_applyIntPropertyValue +#@ stub uset_applyPattern +#@ stub uset_applyPropertyAlias +#@ stub uset_charAt +#@ stub uset_clear +#@ stub uset_clone +#@ stub uset_cloneAsThawed +#@ stub uset_close +#@ stub uset_closeOver +#@ stub uset_compact +#@ stub uset_complement +#@ stub uset_complementAll +#@ stub uset_contains +#@ stub uset_containsAll +#@ stub uset_containsAllCodePoints +#@ stub uset_containsNone +#@ stub uset_containsRange +#@ stub uset_containsSome +#@ stub uset_containsString +#@ stub uset_equals +#@ stub uset_freeze +#@ stub uset_getItem +#@ stub uset_getItemCount +#@ stub uset_getSerializedRange +#@ stub uset_getSerializedRangeCount +#@ stub uset_getSerializedSet +#@ stub uset_indexOf +#@ stub uset_isEmpty +#@ stub uset_isFrozen +#@ stub uset_open +#@ stub uset_openEmpty +#@ stub uset_openPattern +#@ stub uset_openPatternOptions +#@ stub uset_remove +#@ stub uset_removeAll +#@ stub uset_removeAllStrings +#@ stub uset_removeRange +#@ stub uset_removeString +#@ stub uset_resemblesPattern +#@ stub uset_retain +#@ stub uset_retainAll +#@ stub uset_serialize +#@ stub uset_serializedContains +#@ stub uset_set +#@ stub uset_setSerializedToOne +#@ stub uset_size +#@ stub uset_span +#@ stub uset_spanBack +#@ stub uset_spanBackUTF8 +#@ stub uset_spanUTF8 +#@ stub uset_toPattern +#@ stub uspoof_areConfusable +#@ stub uspoof_areConfusableUTF8 +#@ stub uspoof_check +#@ stub uspoof_check2 +#@ stub uspoof_check2UTF8 +#@ stub uspoof_checkUTF8 +#@ stub uspoof_clone +#@ stub uspoof_close +#@ stub uspoof_closeCheckResult +#@ stub uspoof_getAllowedChars +#@ stub uspoof_getAllowedLocales +#@ stub uspoof_getCheckResultChecks +#@ stub uspoof_getCheckResultNumerics +#@ stub uspoof_getCheckResultRestrictionLevel +#@ stub uspoof_getChecks +#@ stub uspoof_getInclusionSet +#@ stub uspoof_getRecommendedSet +#@ stub uspoof_getRestrictionLevel +#@ stub uspoof_getSkeleton +#@ stub uspoof_getSkeletonUTF8 +#@ stub uspoof_open +#@ stub uspoof_openCheckResult +#@ stub uspoof_openFromSerialized +#@ stub uspoof_openFromSource +#@ stub uspoof_serialize +#@ stub uspoof_setAllowedChars +#@ stub uspoof_setAllowedLocales +#@ stub uspoof_setChecks +#@ stub uspoof_setRestrictionLevel +#@ stub usprep_close +#@ stub usprep_open +#@ stub usprep_openByType +#@ stub usprep_prepare +#@ stub utext_char32At +#@ stub utext_clone +#@ stub utext_close +#@ stub utext_copy +#@ stub utext_current32 +#@ stub utext_equals +#@ stub utext_extract +#@ stub utext_freeze +#@ stub utext_getNativeIndex +#@ stub utext_getPreviousNativeIndex +#@ stub utext_hasMetaData +#@ stub utext_isLengthExpensive +#@ stub utext_isWritable +#@ stub utext_moveIndex32 +#@ stub utext_nativeLength +#@ stub utext_next32 +#@ stub utext_next32From +#@ stub utext_openUChars +#@ stub utext_openUTF8 +#@ stub utext_previous32 +#@ stub utext_previous32From +#@ stub utext_replace +#@ stub utext_setNativeIndex +#@ stub utext_setup +#@ stub utf8_appendCharSafeBody +#@ stub utf8_back1SafeBody +#@ stub utf8_nextCharSafeBody +#@ stub utf8_prevCharSafeBody +#@ stub utmscale_fromInt64 +#@ stub utmscale_getTimeScaleValue +#@ stub utmscale_toInt64 +#@ stub utrace_format +#@ stub utrace_functionName +#@ stub utrace_getFunctions +#@ stub utrace_getLevel +#@ stub utrace_setFunctions +#@ stub utrace_setLevel +#@ stub utrace_vformat +#@ stub utrans_clone +#@ stub utrans_close +#@ stub utrans_countAvailableIDs +#@ stub utrans_getSourceSet +#@ stub utrans_getUnicodeID +#@ stub utrans_openIDs +#@ stub utrans_openInverse +#@ stub utrans_openU +#@ stub utrans_register +#@ stub utrans_setFilter +#@ stub utrans_toRules +#@ stub utrans_trans +#@ stub utrans_transIncremental +#@ stub utrans_transIncrementalUChars +#@ stub utrans_transUChars +#@ stub utrans_unregisterID From 1d216530c5f4eb08db3def5ac22e705192c84ce8 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 28 Oct 2024 10:25:05 -0600 Subject: [PATCH 0841/2542] icu: Forward function to Unicode library v68. CW-Bug-Id: #24402 --- dlls/icu/icu.spec | 2062 ++++++++++++++++++++++----------------------- 1 file changed, 1031 insertions(+), 1031 deletions(-) diff --git a/dlls/icu/icu.spec b/dlls/icu/icu.spec index 6e1d3763cfb7..2573e120a45b 100644 --- a/dlls/icu/icu.spec +++ b/dlls/icu/icu.spec @@ -1,1031 +1,1031 @@ -#@ stub CloseDefaultICUGroupingLetters -#@ stub GetDefaultICUGroupingLetters -#@ stub GetICUGroupingLetter -#@ stub SortCloseHandle -#@ stub SortGetHandle -#@ stub SortGetSearchKey -#@ stub UCNV_FROM_U_CALLBACK_ESCAPE -#@ stub UCNV_FROM_U_CALLBACK_SKIP -#@ stub UCNV_FROM_U_CALLBACK_STOP -#@ stub UCNV_FROM_U_CALLBACK_SUBSTITUTE -#@ stub UCNV_TO_U_CALLBACK_ESCAPE -#@ stub UCNV_TO_U_CALLBACK_SKIP -#@ stub UCNV_TO_U_CALLBACK_STOP -#@ stub UCNV_TO_U_CALLBACK_SUBSTITUTE -#@ stub u_UCharsToChars -#@ stub u_austrcpy -#@ stub u_austrncpy -#@ stub u_catclose -#@ stub u_catgets -#@ stub u_catopen -#@ stub u_charAge -#@ stub u_charDigitValue -#@ stub u_charDirection -#@ stub u_charFromName -#@ stub u_charMirror -#@ stub u_charName -#@ stub u_charType -#@ stub u_charsToUChars -#@ stub u_cleanup -#@ stub u_countChar32 -#@ stub u_digit -#@ stub u_enumCharNames -#@ stub u_enumCharTypes -#@ stub u_errorName -#@ stub u_foldCase -#@ stub u_forDigit -#@ stub u_formatMessage -#@ stub u_formatMessageWithError -#@ stub u_getBidiPairedBracket -#@ stub u_getBinaryPropertySet -#@ stub u_getCombiningClass -#@ stub u_getDataVersion -#@ stub u_getFC_NFKC_Closure -#@ stub u_getIntPropertyMap -#@ stub u_getIntPropertyMaxValue -#@ stub u_getIntPropertyMinValue -#@ stub u_getIntPropertyValue -#@ stub u_getNumericValue -#@ stub u_getPropertyEnum -#@ stub u_getPropertyName -#@ stub u_getPropertyValueEnum -#@ stub u_getPropertyValueName -#@ stub u_getUnicodeVersion -#@ stub u_getVersion -#@ stub u_hasBinaryProperty -#@ stub u_init -#@ stub u_isIDIgnorable -#@ stub u_isIDPart -#@ stub u_isIDStart -#@ stub u_isISOControl -#@ stub u_isJavaIDPart -#@ stub u_isJavaIDStart -#@ stub u_isJavaSpaceChar -#@ stub u_isMirrored -#@ stub u_isUAlphabetic -#@ stub u_isULowercase -#@ stub u_isUUppercase -#@ stub u_isUWhiteSpace -#@ stub u_isWhitespace -#@ stub u_isalnum -#@ stub u_isalpha -#@ stub u_isbase -#@ stub u_isblank -#@ stub u_iscntrl -#@ stub u_isdefined -#@ stub u_isdigit -#@ stub u_isgraph -#@ stub u_islower -#@ stub u_isprint -#@ stub u_ispunct -#@ stub u_isspace -#@ stub u_istitle -#@ stub u_isupper -#@ stub u_isxdigit -#@ stub u_memcasecmp -#@ stub u_memchr -#@ stub u_memchr32 -#@ stub u_memcmp -#@ stub u_memcmpCodePointOrder -#@ stub u_memcpy -#@ stub u_memmove -#@ stub u_memrchr -#@ stub u_memrchr32 -#@ stub u_memset -#@ stub u_parseMessage -#@ stub u_parseMessageWithError -#@ stub u_setMemoryFunctions -#@ stub u_shapeArabic -#@ stub u_strCaseCompare -#@ stub u_strCompare -#@ stub u_strCompareIter -#@ stub u_strFindFirst -#@ stub u_strFindLast -#@ stub u_strFoldCase -#@ stub u_strFromJavaModifiedUTF8WithSub -#@ stub u_strFromUTF32 -#@ stub u_strFromUTF32WithSub -#@ stub u_strFromUTF8 -#@ stub u_strFromUTF8Lenient -#@ stub u_strFromUTF8WithSub -#@ stub u_strFromWCS -#@ stub u_strHasMoreChar32Than -#@ stub u_strToJavaModifiedUTF8 -#@ stub u_strToLower -#@ stub u_strToTitle -#@ stub u_strToUTF32 -#@ stub u_strToUTF32WithSub -#@ stub u_strToUTF8 -#@ stub u_strToUTF8WithSub -#@ stub u_strToUpper -#@ stub u_strToWCS -#@ stub u_strcasecmp -#@ stub u_strcat -#@ stub u_strchr -#@ stub u_strchr32 -#@ stub u_strcmp -#@ stub u_strcmpCodePointOrder -#@ stub u_strcpy -#@ stub u_strcspn -#@ stub u_strlen -#@ stub u_strncasecmp -#@ stub u_strncat -#@ stub u_strncmp -#@ stub u_strncmpCodePointOrder -#@ stub u_strncpy -#@ stub u_strpbrk -#@ stub u_strrchr -#@ stub u_strrchr32 -#@ stub u_strrstr -#@ stub u_strspn -#@ stub u_strstr -#@ stub u_strtok_r -#@ stub u_tolower -#@ stub u_totitle -#@ stub u_toupper -#@ stub u_uastrcpy -#@ stub u_uastrncpy -#@ stub u_unescape -#@ stub u_unescapeAt -#@ stub u_versionFromString -#@ stub u_versionFromUString -#@ stub u_versionToString -#@ stub u_vformatMessage -#@ stub u_vformatMessageWithError -#@ stub u_vparseMessage -#@ stub u_vparseMessageWithError -#@ stub ubidi_close -#@ stub ubidi_countParagraphs -#@ stub ubidi_countRuns -#@ stub ubidi_getBaseDirection -#@ stub ubidi_getClassCallback -#@ stub ubidi_getCustomizedClass -#@ stub ubidi_getDirection -#@ stub ubidi_getLength -#@ stub ubidi_getLevelAt -#@ stub ubidi_getLevels -#@ stub ubidi_getLogicalIndex -#@ stub ubidi_getLogicalMap -#@ stub ubidi_getLogicalRun -#@ stub ubidi_getParaLevel -#@ stub ubidi_getParagraph -#@ stub ubidi_getParagraphByIndex -#@ stub ubidi_getProcessedLength -#@ stub ubidi_getReorderingMode -#@ stub ubidi_getReorderingOptions -#@ stub ubidi_getResultLength -#@ stub ubidi_getText -#@ stub ubidi_getVisualIndex -#@ stub ubidi_getVisualMap -#@ stub ubidi_getVisualRun -#@ stub ubidi_invertMap -#@ stub ubidi_isInverse -#@ stub ubidi_isOrderParagraphsLTR -#@ stub ubidi_open -#@ stub ubidi_openSized -#@ stub ubidi_orderParagraphsLTR -#@ stub ubidi_reorderLogical -#@ stub ubidi_reorderVisual -#@ stub ubidi_setClassCallback -#@ stub ubidi_setContext -#@ stub ubidi_setInverse -#@ stub ubidi_setLine -#@ stub ubidi_setPara -#@ stub ubidi_setReorderingMode -#@ stub ubidi_setReorderingOptions -#@ stub ubidi_writeReordered -#@ stub ubidi_writeReverse -#@ stub ubiditransform_close -#@ stub ubiditransform_open -#@ stub ubiditransform_transform -#@ stub ublock_getCode -#@ stub ubrk_close -#@ stub ubrk_countAvailable -#@ stub ubrk_current -#@ stub ubrk_first -#@ stub ubrk_following -#@ stub ubrk_getAvailable -#@ stub ubrk_getBinaryRules -#@ stub ubrk_getLocaleByType -#@ stub ubrk_getRuleStatus -#@ stub ubrk_getRuleStatusVec -#@ stub ubrk_isBoundary -#@ stub ubrk_last -#@ stub ubrk_next -#@ stub ubrk_open -#@ stub ubrk_openBinaryRules -#@ stub ubrk_openRules -#@ stub ubrk_preceding -#@ stub ubrk_previous -#@ stub ubrk_refreshUText -#@ stub ubrk_safeClone -#@ stub ubrk_setText -#@ stub ubrk_setUText -#@ stub ucal_add -#@ stub ucal_clear -#@ stub ucal_clearField -#@ stub ucal_clone -#@ stub ucal_close -#@ stub ucal_countAvailable -#@ stub ucal_equivalentTo -#@ stub ucal_get -#@ stub ucal_getAttribute -#@ stub ucal_getAvailable -#@ stub ucal_getCanonicalTimeZoneID -#@ stub ucal_getDSTSavings -#@ stub ucal_getDayOfWeekType -#@ stub ucal_getDefaultTimeZone -#@ stub ucal_getFieldDifference -#@ stub ucal_getGregorianChange -#@ stub ucal_getHostTimeZone -#@ stub ucal_getKeywordValuesForLocale -#@ stub ucal_getLimit -#@ stub ucal_getLocaleByType -#@ stub ucal_getMillis -#@ stub ucal_getNow -#@ stub ucal_getTZDataVersion -#@ stub ucal_getTimeZoneDisplayName -#@ stub ucal_getTimeZoneID -#@ stub ucal_getTimeZoneIDForWindowsID -#@ stub ucal_getTimeZoneTransitionDate -#@ stub ucal_getType -#@ stub ucal_getWeekendTransition -#@ stub ucal_getWindowsTimeZoneID -#@ stub ucal_inDaylightTime -#@ stub ucal_isSet -#@ stub ucal_isWeekend -#@ stub ucal_open -#@ stub ucal_openCountryTimeZones -#@ stub ucal_openTimeZoneIDEnumeration -#@ stub ucal_openTimeZones -#@ stub ucal_roll -#@ stub ucal_set -#@ stub ucal_setAttribute -#@ stub ucal_setDate -#@ stub ucal_setDateTime -#@ stub ucal_setDefaultTimeZone -#@ stub ucal_setGregorianChange -#@ stub ucal_setMillis -#@ stub ucal_setTimeZone -#@ stub ucasemap_close -#@ stub ucasemap_getBreakIterator -#@ stub ucasemap_getLocale -#@ stub ucasemap_getOptions -#@ stub ucasemap_open -#@ stub ucasemap_setBreakIterator -#@ stub ucasemap_setLocale -#@ stub ucasemap_setOptions -#@ stub ucasemap_toTitle -#@ stub ucasemap_utf8FoldCase -#@ stub ucasemap_utf8ToLower -#@ stub ucasemap_utf8ToTitle -#@ stub ucasemap_utf8ToUpper -#@ stub ucfpos_close -#@ stub ucfpos_constrainCategory -#@ stub ucfpos_constrainField -#@ stub ucfpos_getCategory -#@ stub ucfpos_getField -#@ stub ucfpos_getIndexes -#@ stub ucfpos_getInt64IterationContext -#@ stub ucfpos_matchesField -#@ stub ucfpos_open -#@ stub ucfpos_reset -#@ stub ucfpos_setInt64IterationContext -#@ stub ucfpos_setState -#@ stub ucnv_cbFromUWriteBytes -#@ stub ucnv_cbFromUWriteSub -#@ stub ucnv_cbFromUWriteUChars -#@ stub ucnv_cbToUWriteSub -#@ stub ucnv_cbToUWriteUChars -#@ stub ucnv_close -#@ stub ucnv_compareNames -#@ stub ucnv_convert -#@ stub ucnv_convertEx -#@ stub ucnv_countAliases -#@ stub ucnv_countAvailable -#@ stub ucnv_countStandards -#@ stub ucnv_detectUnicodeSignature -#@ stub ucnv_fixFileSeparator -#@ stub ucnv_flushCache -#@ stub ucnv_fromAlgorithmic -#@ stub ucnv_fromUChars -#@ stub ucnv_fromUCountPending -#@ stub ucnv_fromUnicode -#@ stub ucnv_getAlias -#@ stub ucnv_getAliases -#@ stub ucnv_getAvailableName -#@ stub ucnv_getCCSID -#@ stub ucnv_getCanonicalName -#@ stub ucnv_getDefaultName -#@ stub ucnv_getDisplayName -#@ stub ucnv_getFromUCallBack -#@ stub ucnv_getInvalidChars -#@ stub ucnv_getInvalidUChars -#@ stub ucnv_getMaxCharSize -#@ stub ucnv_getMinCharSize -#@ stub ucnv_getName -#@ stub ucnv_getNextUChar -#@ stub ucnv_getPlatform -#@ stub ucnv_getStandard -#@ stub ucnv_getStandardName -#@ stub ucnv_getStarters -#@ stub ucnv_getSubstChars -#@ stub ucnv_getToUCallBack -#@ stub ucnv_getType -#@ stub ucnv_getUnicodeSet -#@ stub ucnv_isAmbiguous -#@ stub ucnv_isFixedWidth -#@ stub ucnv_open -#@ stub ucnv_openAllNames -#@ stub ucnv_openCCSID -#@ stub ucnv_openPackage -#@ stub ucnv_openStandardNames -#@ stub ucnv_openU -#@ stub ucnv_reset -#@ stub ucnv_resetFromUnicode -#@ stub ucnv_resetToUnicode -#@ stub ucnv_safeClone -#@ stub ucnv_setDefaultName -#@ stub ucnv_setFallback -#@ stub ucnv_setFromUCallBack -#@ stub ucnv_setSubstChars -#@ stub ucnv_setSubstString -#@ stub ucnv_setToUCallBack -#@ stub ucnv_toAlgorithmic -#@ stub ucnv_toUChars -#@ stub ucnv_toUCountPending -#@ stub ucnv_toUnicode -#@ stub ucnv_usesFallback -#@ stub ucnvsel_close -#@ stub ucnvsel_open -#@ stub ucnvsel_openFromSerialized -#@ stub ucnvsel_selectForString -#@ stub ucnvsel_selectForUTF8 -#@ stub ucnvsel_serialize -#@ stub ucol_cloneBinary -#@ stub ucol_close -#@ stub ucol_closeElements -#@ stub ucol_countAvailable -#@ stub ucol_equal -#@ stub ucol_getAttribute -#@ stub ucol_getAvailable -#@ stub ucol_getBound -#@ stub ucol_getContractionsAndExpansions -#@ stub ucol_getDisplayName -#@ stub ucol_getEquivalentReorderCodes -#@ stub ucol_getFunctionalEquivalent -#@ stub ucol_getKeywordValues -#@ stub ucol_getKeywordValuesForLocale -#@ stub ucol_getKeywords -#@ stub ucol_getLocaleByType -#@ stub ucol_getMaxExpansion -#@ stub ucol_getMaxVariable -#@ stub ucol_getOffset -#@ stub ucol_getReorderCodes -#@ stub ucol_getRules -#@ stub ucol_getRulesEx -#@ stub ucol_getSortKey -#@ stub ucol_getStrength -#@ stub ucol_getTailoredSet -#@ stub ucol_getUCAVersion -#@ stub ucol_getVariableTop -#@ stub ucol_getVersion -#@ stub ucol_greater -#@ stub ucol_greaterOrEqual -#@ stub ucol_keyHashCode -#@ stub ucol_mergeSortkeys -#@ stub ucol_next -#@ stub ucol_nextSortKeyPart -#@ stub ucol_open -#@ stub ucol_openAvailableLocales -#@ stub ucol_openBinary -#@ stub ucol_openElements -#@ stub ucol_openRules -#@ stub ucol_previous -#@ stub ucol_primaryOrder -#@ stub ucol_reset -#@ stub ucol_safeClone -#@ stub ucol_secondaryOrder -#@ stub ucol_setAttribute -#@ stub ucol_setMaxVariable -#@ stub ucol_setOffset -#@ stub ucol_setReorderCodes -#@ stub ucol_setStrength -#@ stub ucol_setText -#@ stub ucol_strcoll -#@ stub ucol_strcollIter -#@ stub ucol_strcollUTF8 -#@ stub ucol_tertiaryOrder -#@ stub ucpmap_get -#@ stub ucpmap_getRange -#@ stub ucptrie_close -#@ stub ucptrie_get -#@ stub ucptrie_getRange -#@ stub ucptrie_getType -#@ stub ucptrie_getValueWidth -#@ stub ucptrie_internalSmallIndex -#@ stub ucptrie_internalSmallU8Index -#@ stub ucptrie_internalU8PrevIndex -#@ stub ucptrie_openFromBinary -#@ stub ucptrie_toBinary -#@ stub ucsdet_close -#@ stub ucsdet_detect -#@ stub ucsdet_detectAll -#@ stub ucsdet_enableInputFilter -#@ stub ucsdet_getAllDetectableCharsets -#@ stub ucsdet_getConfidence -#@ stub ucsdet_getLanguage -#@ stub ucsdet_getName -#@ stub ucsdet_getUChars -#@ stub ucsdet_isInputFilterEnabled -#@ stub ucsdet_open -#@ stub ucsdet_setDeclaredEncoding -#@ stub ucsdet_setText -#@ stub ucurr_countCurrencies -#@ stub ucurr_forLocale -#@ stub ucurr_forLocaleAndDate -#@ stub ucurr_getDefaultFractionDigits -#@ stub ucurr_getDefaultFractionDigitsForUsage -#@ stub ucurr_getKeywordValuesForLocale -#@ stub ucurr_getName -#@ stub ucurr_getNumericCode -#@ stub ucurr_getPluralName -#@ stub ucurr_getRoundingIncrement -#@ stub ucurr_getRoundingIncrementForUsage -#@ stub ucurr_isAvailable -#@ stub ucurr_openISOCurrencies -#@ stub ucurr_register -#@ stub ucurr_unregister -#@ stub udat_adoptNumberFormat -#@ stub udat_adoptNumberFormatForFields -#@ stub udat_applyPattern -#@ stub udat_clone -#@ stub udat_close -#@ stub udat_countAvailable -#@ stub udat_countSymbols -#@ stub udat_format -#@ stub udat_formatCalendar -#@ stub udat_formatCalendarForFields -#@ stub udat_formatForFields -#@ stub udat_get2DigitYearStart -#@ stub udat_getAvailable -#@ stub udat_getBooleanAttribute -#@ stub udat_getCalendar -#@ stub udat_getContext -#@ stub udat_getLocaleByType -#@ stub udat_getNumberFormat -#@ stub udat_getNumberFormatForField -#@ stub udat_getSymbols -#@ stub udat_isLenient -#@ stub udat_open -#@ stub udat_parse -#@ stub udat_parseCalendar -#@ stub udat_set2DigitYearStart -#@ stub udat_setBooleanAttribute -#@ stub udat_setCalendar -#@ stub udat_setContext -#@ stub udat_setLenient -#@ stub udat_setNumberFormat -#@ stub udat_setSymbols -#@ stub udat_toCalendarDateField -#@ stub udat_toPattern -#@ stub udatpg_addPattern -#@ stub udatpg_clone -#@ stub udatpg_close -#@ stub udatpg_getAppendItemFormat -#@ stub udatpg_getAppendItemName -#@ stub udatpg_getBaseSkeleton -#@ stub udatpg_getBestPattern -#@ stub udatpg_getBestPatternWithOptions -#@ stub udatpg_getDateTimeFormat -#@ stub udatpg_getDecimal -#@ stub udatpg_getFieldDisplayName -#@ stub udatpg_getPatternForSkeleton -#@ stub udatpg_getSkeleton -#@ stub udatpg_open -#@ stub udatpg_openBaseSkeletons -#@ stub udatpg_openEmpty -#@ stub udatpg_openSkeletons -#@ stub udatpg_replaceFieldTypes -#@ stub udatpg_replaceFieldTypesWithOptions -#@ stub udatpg_setAppendItemFormat -#@ stub udatpg_setAppendItemName -#@ stub udatpg_setDateTimeFormat -#@ stub udatpg_setDecimal -#@ stub udtitvfmt_close -#@ stub udtitvfmt_closeResult -#@ stub udtitvfmt_format -#@ stub udtitvfmt_open -#@ stub udtitvfmt_openResult -#@ stub udtitvfmt_resultAsValue -#@ stub uenum_close -#@ stub uenum_count -#@ stub uenum_next -#@ stub uenum_openCharStringsEnumeration -#@ stub uenum_openUCharStringsEnumeration -#@ stub uenum_reset -#@ stub uenum_unext -#@ stub ufieldpositer_close -#@ stub ufieldpositer_next -#@ stub ufieldpositer_open -#@ stub ufmt_close -#@ stub ufmt_getArrayItemByIndex -#@ stub ufmt_getArrayLength -#@ stub ufmt_getDate -#@ stub ufmt_getDecNumChars -#@ stub ufmt_getDouble -#@ stub ufmt_getInt64 -#@ stub ufmt_getLong -#@ stub ufmt_getObject -#@ stub ufmt_getType -#@ stub ufmt_getUChars -#@ stub ufmt_isNumeric -#@ stub ufmt_open -#@ stub ufmtval_getString -#@ stub ufmtval_nextPosition -#@ stub ugender_getInstance -#@ stub ugender_getListGender -#@ stub uidna_close -#@ stub uidna_labelToASCII -#@ stub uidna_labelToASCII_UTF8 -#@ stub uidna_labelToUnicode -#@ stub uidna_labelToUnicodeUTF8 -#@ stub uidna_nameToASCII -#@ stub uidna_nameToASCII_UTF8 -#@ stub uidna_nameToUnicode -#@ stub uidna_nameToUnicodeUTF8 -#@ stub uidna_openUTS46 -#@ stub uiter_current32 -#@ stub uiter_getState -#@ stub uiter_next32 -#@ stub uiter_previous32 -#@ stub uiter_setState -#@ stub uiter_setString -#@ stub uiter_setUTF16BE -#@ stub uiter_setUTF8 -#@ stub uldn_close -#@ stub uldn_getContext -#@ stub uldn_getDialectHandling -#@ stub uldn_getLocale -#@ stub uldn_keyDisplayName -#@ stub uldn_keyValueDisplayName -#@ stub uldn_languageDisplayName -#@ stub uldn_localeDisplayName -#@ stub uldn_open -#@ stub uldn_openForContext -#@ stub uldn_regionDisplayName -#@ stub uldn_scriptCodeDisplayName -#@ stub uldn_scriptDisplayName -#@ stub uldn_variantDisplayName -#@ stub ulistfmt_close -#@ stub ulistfmt_closeResult -#@ stub ulistfmt_format -#@ stub ulistfmt_formatStringsToResult -#@ stub ulistfmt_open -#@ stub ulistfmt_openForType -#@ stub ulistfmt_openResult -#@ stub ulistfmt_resultAsValue -#@ stub uloc_acceptLanguage -#@ stub uloc_acceptLanguageFromHTTP -#@ stub uloc_addLikelySubtags -#@ stub uloc_canonicalize -#@ stub uloc_countAvailable -#@ stub uloc_forLanguageTag -#@ stub uloc_getAvailable -#@ stub uloc_getBaseName -#@ stub uloc_getCharacterOrientation -#@ stub uloc_getCountry -#@ stub uloc_getDefault -#@ stub uloc_getDisplayCountry -#@ stub uloc_getDisplayKeyword -#@ stub uloc_getDisplayKeywordValue -#@ stub uloc_getDisplayLanguage -#@ stub uloc_getDisplayName -#@ stub uloc_getDisplayScript -#@ stub uloc_getDisplayVariant -#@ stub uloc_getISO3Country -#@ stub uloc_getISO3Language -#@ stub uloc_getISOCountries -#@ stub uloc_getISOLanguages -#@ stub uloc_getKeywordValue -#@ stub uloc_getLCID -#@ stub uloc_getLanguage -#@ stub uloc_getLineOrientation -#@ stub uloc_getLocaleForLCID -#@ stub uloc_getName -#@ stub uloc_getParent -#@ stub uloc_getScript -#@ stub uloc_getVariant -#@ stub uloc_isRightToLeft -#@ stub uloc_minimizeSubtags -#@ stub uloc_openAvailableByType -#@ stub uloc_openKeywords -#@ stub uloc_setDefault -#@ stub uloc_setKeywordValue -#@ stub uloc_toLanguageTag -#@ stub uloc_toLegacyKey -#@ stub uloc_toLegacyType -#@ stub uloc_toUnicodeLocaleKey -#@ stub uloc_toUnicodeLocaleType -#@ stub ulocdata_close -#@ stub ulocdata_getCLDRVersion -#@ stub ulocdata_getDelimiter -#@ stub ulocdata_getExemplarSet -#@ stub ulocdata_getLocaleDisplayPattern -#@ stub ulocdata_getLocaleSeparator -#@ stub ulocdata_getMeasurementSystem -#@ stub ulocdata_getNoSubstitute -#@ stub ulocdata_getPaperSize -#@ stub ulocdata_open -#@ stub ulocdata_setNoSubstitute -#@ stub umsg_applyPattern -#@ stub umsg_autoQuoteApostrophe -#@ stub umsg_clone -#@ stub umsg_close -#@ stub umsg_format -#@ stub umsg_getLocale -#@ stub umsg_open -#@ stub umsg_parse -#@ stub umsg_setLocale -#@ stub umsg_toPattern -#@ stub umsg_vformat -#@ stub umsg_vparse -#@ stub umutablecptrie_buildImmutable -#@ stub umutablecptrie_clone -#@ stub umutablecptrie_close -#@ stub umutablecptrie_fromUCPMap -#@ stub umutablecptrie_fromUCPTrie -#@ stub umutablecptrie_get -#@ stub umutablecptrie_getRange -#@ stub umutablecptrie_open -#@ stub umutablecptrie_set -#@ stub umutablecptrie_setRange -#@ stub unorm2_append -#@ stub unorm2_close -#@ stub unorm2_composePair -#@ stub unorm2_getCombiningClass -#@ stub unorm2_getDecomposition -#@ stub unorm2_getInstance -#@ stub unorm2_getNFCInstance -#@ stub unorm2_getNFDInstance -#@ stub unorm2_getNFKCCasefoldInstance -#@ stub unorm2_getNFKCInstance -#@ stub unorm2_getNFKDInstance -#@ stub unorm2_getRawDecomposition -#@ stub unorm2_hasBoundaryAfter -#@ stub unorm2_hasBoundaryBefore -#@ stub unorm2_isInert -#@ stub unorm2_isNormalized -#@ stub unorm2_normalize -#@ stub unorm2_normalizeSecondAndAppend -#@ stub unorm2_openFiltered -#@ stub unorm2_quickCheck -#@ stub unorm2_spanQuickCheckYes -#@ stub unorm_compare -#@ stub unum_applyPattern -#@ stub unum_clone -#@ stub unum_close -#@ stub unum_countAvailable -#@ stub unum_format -#@ stub unum_formatDecimal -#@ stub unum_formatDouble -#@ stub unum_formatDoubleCurrency -#@ stub unum_formatDoubleForFields -#@ stub unum_formatInt64 -#@ stub unum_formatUFormattable -#@ stub unum_getAttribute -#@ stub unum_getAvailable -#@ stub unum_getContext -#@ stub unum_getDoubleAttribute -#@ stub unum_getLocaleByType -#@ stub unum_getSymbol -#@ stub unum_getTextAttribute -#@ stub unum_open -#@ stub unum_parse -#@ stub unum_parseDecimal -#@ stub unum_parseDouble -#@ stub unum_parseDoubleCurrency -#@ stub unum_parseInt64 -#@ stub unum_parseToUFormattable -#@ stub unum_setAttribute -#@ stub unum_setContext -#@ stub unum_setDoubleAttribute -#@ stub unum_setSymbol -#@ stub unum_setTextAttribute -#@ stub unum_toPattern -#@ stub unumf_close -#@ stub unumf_closeResult -#@ stub unumf_formatDecimal -#@ stub unumf_formatDouble -#@ stub unumf_formatInt -#@ stub unumf_openForSkeletonAndLocale -#@ stub unumf_openForSkeletonAndLocaleWithError -#@ stub unumf_openResult -#@ stub unumf_resultAsValue -#@ stub unumf_resultGetAllFieldPositions -#@ stub unumf_resultNextFieldPosition -#@ stub unumf_resultToString -#@ stub unumsys_close -#@ stub unumsys_getDescription -#@ stub unumsys_getName -#@ stub unumsys_getRadix -#@ stub unumsys_isAlgorithmic -#@ stub unumsys_open -#@ stub unumsys_openAvailableNames -#@ stub unumsys_openByName -#@ stub uplrules_close -#@ stub uplrules_getKeywords -#@ stub uplrules_open -#@ stub uplrules_openForType -#@ stub uplrules_select -#@ stub uplrules_selectFormatted -#@ stub uregex_appendReplacement -#@ stub uregex_appendReplacementUText -#@ stub uregex_appendTail -#@ stub uregex_appendTailUText -#@ stub uregex_clone -#@ stub uregex_close -#@ stub uregex_end -#@ stub uregex_end64 -#@ stub uregex_find -#@ stub uregex_find64 -#@ stub uregex_findNext -#@ stub uregex_flags -#@ stub uregex_getFindProgressCallback -#@ stub uregex_getMatchCallback -#@ stub uregex_getStackLimit -#@ stub uregex_getText -#@ stub uregex_getTimeLimit -#@ stub uregex_getUText -#@ stub uregex_group -#@ stub uregex_groupCount -#@ stub uregex_groupNumberFromCName -#@ stub uregex_groupNumberFromName -#@ stub uregex_groupUText -#@ stub uregex_hasAnchoringBounds -#@ stub uregex_hasTransparentBounds -#@ stub uregex_hitEnd -#@ stub uregex_lookingAt -#@ stub uregex_lookingAt64 -#@ stub uregex_matches -#@ stub uregex_matches64 -#@ stub uregex_open -#@ stub uregex_openC -#@ stub uregex_openUText -#@ stub uregex_pattern -#@ stub uregex_patternUText -#@ stub uregex_refreshUText -#@ stub uregex_regionEnd -#@ stub uregex_regionEnd64 -#@ stub uregex_regionStart -#@ stub uregex_regionStart64 -#@ stub uregex_replaceAll -#@ stub uregex_replaceAllUText -#@ stub uregex_replaceFirst -#@ stub uregex_replaceFirstUText -#@ stub uregex_requireEnd -#@ stub uregex_reset -#@ stub uregex_reset64 -#@ stub uregex_setFindProgressCallback -#@ stub uregex_setMatchCallback -#@ stub uregex_setRegion -#@ stub uregex_setRegion64 -#@ stub uregex_setRegionAndStart -#@ stub uregex_setStackLimit -#@ stub uregex_setText -#@ stub uregex_setTimeLimit -#@ stub uregex_setUText -#@ stub uregex_split -#@ stub uregex_splitUText -#@ stub uregex_start -#@ stub uregex_start64 -#@ stub uregex_useAnchoringBounds -#@ stub uregex_useTransparentBounds -#@ stub uregion_areEqual -#@ stub uregion_contains -#@ stub uregion_getAvailable -#@ stub uregion_getContainedRegions -#@ stub uregion_getContainedRegionsOfType -#@ stub uregion_getContainingRegion -#@ stub uregion_getContainingRegionOfType -#@ stub uregion_getNumericCode -#@ stub uregion_getPreferredValues -#@ stub uregion_getRegionCode -#@ stub uregion_getRegionFromCode -#@ stub uregion_getRegionFromNumericCode -#@ stub uregion_getType -#@ stub ureldatefmt_close -#@ stub ureldatefmt_closeResult -#@ stub ureldatefmt_combineDateAndTime -#@ stub ureldatefmt_format -#@ stub ureldatefmt_formatNumeric -#@ stub ureldatefmt_formatNumericToResult -#@ stub ureldatefmt_formatToResult -#@ stub ureldatefmt_open -#@ stub ureldatefmt_openResult -#@ stub ureldatefmt_resultAsValue -#@ stub ures_close -#@ stub ures_getBinary -#@ stub ures_getByIndex -#@ stub ures_getByKey -#@ stub ures_getInt -#@ stub ures_getIntVector -#@ stub ures_getKey -#@ stub ures_getLocaleByType -#@ stub ures_getNextResource -#@ stub ures_getNextString -#@ stub ures_getSize -#@ stub ures_getString -#@ stub ures_getStringByIndex -#@ stub ures_getStringByKey -#@ stub ures_getType -#@ stub ures_getUInt -#@ stub ures_getUTF8String -#@ stub ures_getUTF8StringByIndex -#@ stub ures_getUTF8StringByKey -#@ stub ures_getVersion -#@ stub ures_hasNext -#@ stub ures_open -#@ stub ures_openAvailableLocales -#@ stub ures_openDirect -#@ stub ures_openU -#@ stub ures_resetIterator -#@ stub uscript_breaksBetweenLetters -#@ stub uscript_getCode -#@ stub uscript_getName -#@ stub uscript_getSampleString -#@ stub uscript_getScript -#@ stub uscript_getScriptExtensions -#@ stub uscript_getShortName -#@ stub uscript_getUsage -#@ stub uscript_hasScript -#@ stub uscript_isCased -#@ stub uscript_isRightToLeft -#@ stub usearch_close -#@ stub usearch_first -#@ stub usearch_following -#@ stub usearch_getAttribute -#@ stub usearch_getBreakIterator -#@ stub usearch_getCollator -#@ stub usearch_getMatchedLength -#@ stub usearch_getMatchedStart -#@ stub usearch_getMatchedText -#@ stub usearch_getOffset -#@ stub usearch_getPattern -#@ stub usearch_getText -#@ stub usearch_last -#@ stub usearch_next -#@ stub usearch_open -#@ stub usearch_openFromCollator -#@ stub usearch_preceding -#@ stub usearch_previous -#@ stub usearch_reset -#@ stub usearch_setAttribute -#@ stub usearch_setBreakIterator -#@ stub usearch_setCollator -#@ stub usearch_setOffset -#@ stub usearch_setPattern -#@ stub usearch_setText -#@ stub uset_add -#@ stub uset_addAll -#@ stub uset_addAllCodePoints -#@ stub uset_addRange -#@ stub uset_addString -#@ stub uset_applyIntPropertyValue -#@ stub uset_applyPattern -#@ stub uset_applyPropertyAlias -#@ stub uset_charAt -#@ stub uset_clear -#@ stub uset_clone -#@ stub uset_cloneAsThawed -#@ stub uset_close -#@ stub uset_closeOver -#@ stub uset_compact -#@ stub uset_complement -#@ stub uset_complementAll -#@ stub uset_contains -#@ stub uset_containsAll -#@ stub uset_containsAllCodePoints -#@ stub uset_containsNone -#@ stub uset_containsRange -#@ stub uset_containsSome -#@ stub uset_containsString -#@ stub uset_equals -#@ stub uset_freeze -#@ stub uset_getItem -#@ stub uset_getItemCount -#@ stub uset_getSerializedRange -#@ stub uset_getSerializedRangeCount -#@ stub uset_getSerializedSet -#@ stub uset_indexOf -#@ stub uset_isEmpty -#@ stub uset_isFrozen -#@ stub uset_open -#@ stub uset_openEmpty -#@ stub uset_openPattern -#@ stub uset_openPatternOptions -#@ stub uset_remove -#@ stub uset_removeAll -#@ stub uset_removeAllStrings -#@ stub uset_removeRange -#@ stub uset_removeString -#@ stub uset_resemblesPattern -#@ stub uset_retain -#@ stub uset_retainAll -#@ stub uset_serialize -#@ stub uset_serializedContains -#@ stub uset_set -#@ stub uset_setSerializedToOne -#@ stub uset_size -#@ stub uset_span -#@ stub uset_spanBack -#@ stub uset_spanBackUTF8 -#@ stub uset_spanUTF8 -#@ stub uset_toPattern -#@ stub uspoof_areConfusable -#@ stub uspoof_areConfusableUTF8 -#@ stub uspoof_check -#@ stub uspoof_check2 -#@ stub uspoof_check2UTF8 -#@ stub uspoof_checkUTF8 -#@ stub uspoof_clone -#@ stub uspoof_close -#@ stub uspoof_closeCheckResult -#@ stub uspoof_getAllowedChars -#@ stub uspoof_getAllowedLocales -#@ stub uspoof_getCheckResultChecks -#@ stub uspoof_getCheckResultNumerics -#@ stub uspoof_getCheckResultRestrictionLevel -#@ stub uspoof_getChecks -#@ stub uspoof_getInclusionSet -#@ stub uspoof_getRecommendedSet -#@ stub uspoof_getRestrictionLevel -#@ stub uspoof_getSkeleton -#@ stub uspoof_getSkeletonUTF8 -#@ stub uspoof_open -#@ stub uspoof_openCheckResult -#@ stub uspoof_openFromSerialized -#@ stub uspoof_openFromSource -#@ stub uspoof_serialize -#@ stub uspoof_setAllowedChars -#@ stub uspoof_setAllowedLocales -#@ stub uspoof_setChecks -#@ stub uspoof_setRestrictionLevel -#@ stub usprep_close -#@ stub usprep_open -#@ stub usprep_openByType -#@ stub usprep_prepare -#@ stub utext_char32At -#@ stub utext_clone -#@ stub utext_close -#@ stub utext_copy -#@ stub utext_current32 -#@ stub utext_equals -#@ stub utext_extract -#@ stub utext_freeze -#@ stub utext_getNativeIndex -#@ stub utext_getPreviousNativeIndex -#@ stub utext_hasMetaData -#@ stub utext_isLengthExpensive -#@ stub utext_isWritable -#@ stub utext_moveIndex32 -#@ stub utext_nativeLength -#@ stub utext_next32 -#@ stub utext_next32From -#@ stub utext_openUChars -#@ stub utext_openUTF8 -#@ stub utext_previous32 -#@ stub utext_previous32From -#@ stub utext_replace -#@ stub utext_setNativeIndex -#@ stub utext_setup -#@ stub utf8_appendCharSafeBody -#@ stub utf8_back1SafeBody -#@ stub utf8_nextCharSafeBody -#@ stub utf8_prevCharSafeBody -#@ stub utmscale_fromInt64 -#@ stub utmscale_getTimeScaleValue -#@ stub utmscale_toInt64 -#@ stub utrace_format -#@ stub utrace_functionName -#@ stub utrace_getFunctions -#@ stub utrace_getLevel -#@ stub utrace_setFunctions -#@ stub utrace_setLevel -#@ stub utrace_vformat -#@ stub utrans_clone -#@ stub utrans_close -#@ stub utrans_countAvailableIDs -#@ stub utrans_getSourceSet -#@ stub utrans_getUnicodeID -#@ stub utrans_openIDs -#@ stub utrans_openInverse -#@ stub utrans_openU -#@ stub utrans_register -#@ stub utrans_setFilter -#@ stub utrans_toRules -#@ stub utrans_trans -#@ stub utrans_transIncremental -#@ stub utrans_transIncrementalUChars -#@ stub utrans_transUChars -#@ stub utrans_unregisterID +@ stub CloseDefaultICUGroupingLetters +@ stub GetDefaultICUGroupingLetters +@ stub GetICUGroupingLetter +@ stub SortCloseHandle +@ stub SortGetHandle +@ stub SortGetSearchKey +@ cdecl -norelay UCNV_FROM_U_CALLBACK_ESCAPE() icuuc68.UCNV_FROM_U_CALLBACK_ESCAPE_68 +@ cdecl -norelay UCNV_FROM_U_CALLBACK_SKIP() icuuc68.UCNV_FROM_U_CALLBACK_SKIP_68 +@ cdecl -norelay UCNV_FROM_U_CALLBACK_STOP() icuuc68.UCNV_FROM_U_CALLBACK_STOP_68 +@ cdecl -norelay UCNV_FROM_U_CALLBACK_SUBSTITUTE() icuuc68.UCNV_FROM_U_CALLBACK_SUBSTITUTE_68 +@ cdecl -norelay UCNV_TO_U_CALLBACK_ESCAPE() icuuc68.UCNV_TO_U_CALLBACK_ESCAPE_68 +@ cdecl -norelay UCNV_TO_U_CALLBACK_SKIP() icuuc68.UCNV_TO_U_CALLBACK_SKIP_68 +@ cdecl -norelay UCNV_TO_U_CALLBACK_STOP() icuuc68.UCNV_TO_U_CALLBACK_STOP_68 +@ cdecl -norelay UCNV_TO_U_CALLBACK_SUBSTITUTE() icuuc68.UCNV_TO_U_CALLBACK_SUBSTITUTE_68 +@ cdecl -norelay u_UCharsToChars() icuuc68.u_UCharsToChars_68 +@ cdecl -norelay u_austrcpy() icuuc68.u_austrcpy_68 +@ cdecl -norelay u_austrncpy() icuuc68.u_austrncpy_68 +@ cdecl -norelay u_catclose() icuuc68.u_catclose_68 +@ cdecl -norelay u_catgets() icuuc68.u_catgets_68 +@ cdecl -norelay u_catopen() icuuc68.u_catopen_68 +@ cdecl -norelay u_charAge() icuuc68.u_charAge_68 +@ cdecl -norelay u_charDigitValue() icuuc68.u_charDigitValue_68 +@ cdecl -norelay u_charDirection() icuuc68.u_charDirection_68 +@ cdecl -norelay u_charFromName() icuuc68.u_charFromName_68 +@ cdecl -norelay u_charMirror() icuuc68.u_charMirror_68 +@ cdecl -norelay u_charName() icuuc68.u_charName_68 +@ cdecl -norelay u_charType() icuuc68.u_charType_68 +@ cdecl -norelay u_charsToUChars() icuuc68.u_charsToUChars_68 +@ cdecl -norelay u_cleanup() icuuc68.u_cleanup_68 +@ cdecl -norelay u_countChar32() icuuc68.u_countChar32_68 +@ cdecl -norelay u_digit() icuuc68.u_digit_68 +@ cdecl -norelay u_enumCharNames() icuuc68.u_enumCharNames_68 +@ cdecl -norelay u_enumCharTypes() icuuc68.u_enumCharTypes_68 +@ cdecl -norelay u_errorName() icuuc68.u_errorName_68 +@ cdecl -norelay u_foldCase() icuuc68.u_foldCase_68 +@ cdecl -norelay u_forDigit() icuuc68.u_forDigit_68 +@ cdecl -norelay u_formatMessage() icuin68.u_formatMessage_68 +@ cdecl -norelay u_formatMessageWithError() icuin68.u_formatMessageWithError_68 +@ cdecl -norelay u_getBidiPairedBracket() icuuc68.u_getBidiPairedBracket_68 +@ cdecl -norelay u_getBinaryPropertySet() icuuc68.u_getBinaryPropertySet_68 +@ cdecl -norelay u_getCombiningClass() icuuc68.u_getCombiningClass_68 +@ cdecl -norelay u_getDataVersion() icuuc68.u_getDataVersion_68 +@ cdecl -norelay u_getFC_NFKC_Closure() icuuc68.u_getFC_NFKC_Closure_68 +@ cdecl -norelay u_getIntPropertyMap() icuuc68.u_getIntPropertyMap_68 +@ cdecl -norelay u_getIntPropertyMaxValue() icuuc68.u_getIntPropertyMaxValue_68 +@ cdecl -norelay u_getIntPropertyMinValue() icuuc68.u_getIntPropertyMinValue_68 +@ cdecl -norelay u_getIntPropertyValue() icuuc68.u_getIntPropertyValue_68 +@ cdecl -norelay u_getNumericValue() icuuc68.u_getNumericValue_68 +@ cdecl -norelay u_getPropertyEnum() icuuc68.u_getPropertyEnum_68 +@ cdecl -norelay u_getPropertyName() icuuc68.u_getPropertyName_68 +@ cdecl -norelay u_getPropertyValueEnum() icuuc68.u_getPropertyValueEnum_68 +@ cdecl -norelay u_getPropertyValueName() icuuc68.u_getPropertyValueName_68 +@ cdecl -norelay u_getUnicodeVersion() icuuc68.u_getUnicodeVersion_68 +@ cdecl -norelay u_getVersion() icuuc68.u_getVersion_68 +@ cdecl -norelay u_hasBinaryProperty() icuuc68.u_hasBinaryProperty_68 +@ cdecl -norelay u_init() icuuc68.u_init_68 +@ cdecl -norelay u_isIDIgnorable() icuuc68.u_isIDIgnorable_68 +@ cdecl -norelay u_isIDPart() icuuc68.u_isIDPart_68 +@ cdecl -norelay u_isIDStart() icuuc68.u_isIDStart_68 +@ cdecl -norelay u_isISOControl() icuuc68.u_isISOControl_68 +@ cdecl -norelay u_isJavaIDPart() icuuc68.u_isJavaIDPart_68 +@ cdecl -norelay u_isJavaIDStart() icuuc68.u_isJavaIDStart_68 +@ cdecl -norelay u_isJavaSpaceChar() icuuc68.u_isJavaSpaceChar_68 +@ cdecl -norelay u_isMirrored() icuuc68.u_isMirrored_68 +@ cdecl -norelay u_isUAlphabetic() icuuc68.u_isUAlphabetic_68 +@ cdecl -norelay u_isULowercase() icuuc68.u_isULowercase_68 +@ cdecl -norelay u_isUUppercase() icuuc68.u_isUUppercase_68 +@ cdecl -norelay u_isUWhiteSpace() icuuc68.u_isUWhiteSpace_68 +@ cdecl -norelay u_isWhitespace() icuuc68.u_isWhitespace_68 +@ cdecl -norelay u_isalnum() icuuc68.u_isalnum_68 +@ cdecl -norelay u_isalpha() icuuc68.u_isalpha_68 +@ cdecl -norelay u_isbase() icuuc68.u_isbase_68 +@ cdecl -norelay u_isblank() icuuc68.u_isblank_68 +@ cdecl -norelay u_iscntrl() icuuc68.u_iscntrl_68 +@ cdecl -norelay u_isdefined() icuuc68.u_isdefined_68 +@ cdecl -norelay u_isdigit() icuuc68.u_isdigit_68 +@ cdecl -norelay u_isgraph() icuuc68.u_isgraph_68 +@ cdecl -norelay u_islower() icuuc68.u_islower_68 +@ cdecl -norelay u_isprint() icuuc68.u_isprint_68 +@ cdecl -norelay u_ispunct() icuuc68.u_ispunct_68 +@ cdecl -norelay u_isspace() icuuc68.u_isspace_68 +@ cdecl -norelay u_istitle() icuuc68.u_istitle_68 +@ cdecl -norelay u_isupper() icuuc68.u_isupper_68 +@ cdecl -norelay u_isxdigit() icuuc68.u_isxdigit_68 +@ cdecl -norelay u_memcasecmp() icuuc68.u_memcasecmp_68 +@ cdecl -norelay u_memchr() icuuc68.u_memchr_68 +@ cdecl -norelay u_memchr32() icuuc68.u_memchr32_68 +@ cdecl -norelay u_memcmp() icuuc68.u_memcmp_68 +@ cdecl -norelay u_memcmpCodePointOrder() icuuc68.u_memcmpCodePointOrder_68 +@ cdecl -norelay u_memcpy() icuuc68.u_memcpy_68 +@ cdecl -norelay u_memmove() icuuc68.u_memmove_68 +@ cdecl -norelay u_memrchr() icuuc68.u_memrchr_68 +@ cdecl -norelay u_memrchr32() icuuc68.u_memrchr32_68 +@ cdecl -norelay u_memset() icuuc68.u_memset_68 +@ cdecl -norelay u_parseMessage() icuin68.u_parseMessage_68 +@ cdecl -norelay u_parseMessageWithError() icuin68.u_parseMessageWithError_68 +@ cdecl -norelay u_setMemoryFunctions() icuuc68.u_setMemoryFunctions_68 +@ cdecl -norelay u_shapeArabic() icuuc68.u_shapeArabic_68 +@ cdecl -norelay u_strCaseCompare() icuuc68.u_strCaseCompare_68 +@ cdecl -norelay u_strCompare() icuuc68.u_strCompare_68 +@ cdecl -norelay u_strCompareIter() icuuc68.u_strCompareIter_68 +@ cdecl -norelay u_strFindFirst() icuuc68.u_strFindFirst_68 +@ cdecl -norelay u_strFindLast() icuuc68.u_strFindLast_68 +@ cdecl -norelay u_strFoldCase() icuuc68.u_strFoldCase_68 +@ cdecl -norelay u_strFromJavaModifiedUTF8WithSub() icuuc68.u_strFromJavaModifiedUTF8WithSub_68 +@ cdecl -norelay u_strFromUTF32() icuuc68.u_strFromUTF32_68 +@ cdecl -norelay u_strFromUTF32WithSub() icuuc68.u_strFromUTF32WithSub_68 +@ cdecl -norelay u_strFromUTF8() icuuc68.u_strFromUTF8_68 +@ cdecl -norelay u_strFromUTF8Lenient() icuuc68.u_strFromUTF8Lenient_68 +@ cdecl -norelay u_strFromUTF8WithSub() icuuc68.u_strFromUTF8WithSub_68 +@ cdecl -norelay u_strFromWCS() icuuc68.u_strFromWCS_68 +@ cdecl -norelay u_strHasMoreChar32Than() icuuc68.u_strHasMoreChar32Than_68 +@ cdecl -norelay u_strToJavaModifiedUTF8() icuuc68.u_strToJavaModifiedUTF8_68 +@ cdecl -norelay u_strToLower() icuuc68.u_strToLower_68 +@ cdecl -norelay u_strToTitle() icuuc68.u_strToTitle_68 +@ cdecl -norelay u_strToUTF32() icuuc68.u_strToUTF32_68 +@ cdecl -norelay u_strToUTF32WithSub() icuuc68.u_strToUTF32WithSub_68 +@ cdecl -norelay u_strToUTF8() icuuc68.u_strToUTF8_68 +@ cdecl -norelay u_strToUTF8WithSub() icuuc68.u_strToUTF8WithSub_68 +@ cdecl -norelay u_strToUpper() icuuc68.u_strToUpper_68 +@ cdecl -norelay u_strToWCS() icuuc68.u_strToWCS_68 +@ cdecl -norelay u_strcasecmp() icuuc68.u_strcasecmp_68 +@ cdecl -norelay u_strcat() icuuc68.u_strcat_68 +@ cdecl -norelay u_strchr() icuuc68.u_strchr_68 +@ cdecl -norelay u_strchr32() icuuc68.u_strchr32_68 +@ cdecl -norelay u_strcmp() icuuc68.u_strcmp_68 +@ cdecl -norelay u_strcmpCodePointOrder() icuuc68.u_strcmpCodePointOrder_68 +@ cdecl -norelay u_strcpy() icuuc68.u_strcpy_68 +@ cdecl -norelay u_strcspn() icuuc68.u_strcspn_68 +@ cdecl -norelay u_strlen() icuuc68.u_strlen_68 +@ cdecl -norelay u_strncasecmp() icuuc68.u_strncasecmp_68 +@ cdecl -norelay u_strncat() icuuc68.u_strncat_68 +@ cdecl -norelay u_strncmp() icuuc68.u_strncmp_68 +@ cdecl -norelay u_strncmpCodePointOrder() icuuc68.u_strncmpCodePointOrder_68 +@ cdecl -norelay u_strncpy() icuuc68.u_strncpy_68 +@ cdecl -norelay u_strpbrk() icuuc68.u_strpbrk_68 +@ cdecl -norelay u_strrchr() icuuc68.u_strrchr_68 +@ cdecl -norelay u_strrchr32() icuuc68.u_strrchr32_68 +@ cdecl -norelay u_strrstr() icuuc68.u_strrstr_68 +@ cdecl -norelay u_strspn() icuuc68.u_strspn_68 +@ cdecl -norelay u_strstr() icuuc68.u_strstr_68 +@ cdecl -norelay u_strtok_r() icuuc68.u_strtok_r_68 +@ cdecl -norelay u_tolower() icuuc68.u_tolower_68 +@ cdecl -norelay u_totitle() icuuc68.u_totitle_68 +@ cdecl -norelay u_toupper() icuuc68.u_toupper_68 +@ cdecl -norelay u_uastrcpy() icuuc68.u_uastrcpy_68 +@ cdecl -norelay u_uastrncpy() icuuc68.u_uastrncpy_68 +@ cdecl -norelay u_unescape() icuuc68.u_unescape_68 +@ cdecl -norelay u_unescapeAt() icuuc68.u_unescapeAt_68 +@ cdecl -norelay u_versionFromString() icuuc68.u_versionFromString_68 +@ cdecl -norelay u_versionFromUString() icuuc68.u_versionFromUString_68 +@ cdecl -norelay u_versionToString() icuuc68.u_versionToString_68 +@ cdecl -norelay u_vformatMessage() icuin68.u_vformatMessage_68 +@ cdecl -norelay u_vformatMessageWithError() icuin68.u_vformatMessageWithError_68 +@ cdecl -norelay u_vparseMessage() icuin68.u_vparseMessage_68 +@ cdecl -norelay u_vparseMessageWithError() icuin68.u_vparseMessageWithError_68 +@ cdecl -norelay ubidi_close() icuuc68.ubidi_close_68 +@ cdecl -norelay ubidi_countParagraphs() icuuc68.ubidi_countParagraphs_68 +@ cdecl -norelay ubidi_countRuns() icuuc68.ubidi_countRuns_68 +@ cdecl -norelay ubidi_getBaseDirection() icuuc68.ubidi_getBaseDirection_68 +@ cdecl -norelay ubidi_getClassCallback() icuuc68.ubidi_getClassCallback_68 +@ cdecl -norelay ubidi_getCustomizedClass() icuuc68.ubidi_getCustomizedClass_68 +@ cdecl -norelay ubidi_getDirection() icuuc68.ubidi_getDirection_68 +@ cdecl -norelay ubidi_getLength() icuuc68.ubidi_getLength_68 +@ cdecl -norelay ubidi_getLevelAt() icuuc68.ubidi_getLevelAt_68 +@ cdecl -norelay ubidi_getLevels() icuuc68.ubidi_getLevels_68 +@ cdecl -norelay ubidi_getLogicalIndex() icuuc68.ubidi_getLogicalIndex_68 +@ cdecl -norelay ubidi_getLogicalMap() icuuc68.ubidi_getLogicalMap_68 +@ cdecl -norelay ubidi_getLogicalRun() icuuc68.ubidi_getLogicalRun_68 +@ cdecl -norelay ubidi_getParaLevel() icuuc68.ubidi_getParaLevel_68 +@ cdecl -norelay ubidi_getParagraph() icuuc68.ubidi_getParagraph_68 +@ cdecl -norelay ubidi_getParagraphByIndex() icuuc68.ubidi_getParagraphByIndex_68 +@ cdecl -norelay ubidi_getProcessedLength() icuuc68.ubidi_getProcessedLength_68 +@ cdecl -norelay ubidi_getReorderingMode() icuuc68.ubidi_getReorderingMode_68 +@ cdecl -norelay ubidi_getReorderingOptions() icuuc68.ubidi_getReorderingOptions_68 +@ cdecl -norelay ubidi_getResultLength() icuuc68.ubidi_getResultLength_68 +@ cdecl -norelay ubidi_getText() icuuc68.ubidi_getText_68 +@ cdecl -norelay ubidi_getVisualIndex() icuuc68.ubidi_getVisualIndex_68 +@ cdecl -norelay ubidi_getVisualMap() icuuc68.ubidi_getVisualMap_68 +@ cdecl -norelay ubidi_getVisualRun() icuuc68.ubidi_getVisualRun_68 +@ cdecl -norelay ubidi_invertMap() icuuc68.ubidi_invertMap_68 +@ cdecl -norelay ubidi_isInverse() icuuc68.ubidi_isInverse_68 +@ cdecl -norelay ubidi_isOrderParagraphsLTR() icuuc68.ubidi_isOrderParagraphsLTR_68 +@ cdecl -norelay ubidi_open() icuuc68.ubidi_open_68 +@ cdecl -norelay ubidi_openSized() icuuc68.ubidi_openSized_68 +@ cdecl -norelay ubidi_orderParagraphsLTR() icuuc68.ubidi_orderParagraphsLTR_68 +@ cdecl -norelay ubidi_reorderLogical() icuuc68.ubidi_reorderLogical_68 +@ cdecl -norelay ubidi_reorderVisual() icuuc68.ubidi_reorderVisual_68 +@ cdecl -norelay ubidi_setClassCallback() icuuc68.ubidi_setClassCallback_68 +@ cdecl -norelay ubidi_setContext() icuuc68.ubidi_setContext_68 +@ cdecl -norelay ubidi_setInverse() icuuc68.ubidi_setInverse_68 +@ cdecl -norelay ubidi_setLine() icuuc68.ubidi_setLine_68 +@ cdecl -norelay ubidi_setPara() icuuc68.ubidi_setPara_68 +@ cdecl -norelay ubidi_setReorderingMode() icuuc68.ubidi_setReorderingMode_68 +@ cdecl -norelay ubidi_setReorderingOptions() icuuc68.ubidi_setReorderingOptions_68 +@ cdecl -norelay ubidi_writeReordered() icuuc68.ubidi_writeReordered_68 +@ cdecl -norelay ubidi_writeReverse() icuuc68.ubidi_writeReverse_68 +@ cdecl -norelay ubiditransform_close() icuuc68.ubiditransform_close_68 +@ cdecl -norelay ubiditransform_open() icuuc68.ubiditransform_open_68 +@ cdecl -norelay ubiditransform_transform() icuuc68.ubiditransform_transform_68 +@ cdecl -norelay ublock_getCode() icuuc68.ublock_getCode_68 +@ cdecl -norelay ubrk_close() icuuc68.ubrk_close_68 +@ cdecl -norelay ubrk_countAvailable() icuuc68.ubrk_countAvailable_68 +@ cdecl -norelay ubrk_current() icuuc68.ubrk_current_68 +@ cdecl -norelay ubrk_first() icuuc68.ubrk_first_68 +@ cdecl -norelay ubrk_following() icuuc68.ubrk_following_68 +@ cdecl -norelay ubrk_getAvailable() icuuc68.ubrk_getAvailable_68 +@ cdecl -norelay ubrk_getBinaryRules() icuuc68.ubrk_getBinaryRules_68 +@ cdecl -norelay ubrk_getLocaleByType() icuuc68.ubrk_getLocaleByType_68 +@ cdecl -norelay ubrk_getRuleStatus() icuuc68.ubrk_getRuleStatus_68 +@ cdecl -norelay ubrk_getRuleStatusVec() icuuc68.ubrk_getRuleStatusVec_68 +@ cdecl -norelay ubrk_isBoundary() icuuc68.ubrk_isBoundary_68 +@ cdecl -norelay ubrk_last() icuuc68.ubrk_last_68 +@ cdecl -norelay ubrk_next() icuuc68.ubrk_next_68 +@ cdecl -norelay ubrk_open() icuuc68.ubrk_open_68 +@ cdecl -norelay ubrk_openBinaryRules() icuuc68.ubrk_openBinaryRules_68 +@ cdecl -norelay ubrk_openRules() icuuc68.ubrk_openRules_68 +@ cdecl -norelay ubrk_preceding() icuuc68.ubrk_preceding_68 +@ cdecl -norelay ubrk_previous() icuuc68.ubrk_previous_68 +@ cdecl -norelay ubrk_refreshUText() icuuc68.ubrk_refreshUText_68 +@ cdecl -norelay ubrk_safeClone() icuuc68.ubrk_safeClone_68 +@ cdecl -norelay ubrk_setText() icuuc68.ubrk_setText_68 +@ cdecl -norelay ubrk_setUText() icuuc68.ubrk_setUText_68 +@ cdecl -norelay ucal_add() icuin68.ucal_add_68 +@ cdecl -norelay ucal_clear() icuin68.ucal_clear_68 +@ cdecl -norelay ucal_clearField() icuin68.ucal_clearField_68 +@ cdecl -norelay ucal_clone() icuin68.ucal_clone_68 +@ cdecl -norelay ucal_close() icuin68.ucal_close_68 +@ cdecl -norelay ucal_countAvailable() icuin68.ucal_countAvailable_68 +@ cdecl -norelay ucal_equivalentTo() icuin68.ucal_equivalentTo_68 +@ cdecl -norelay ucal_get() icuin68.ucal_get_68 +@ cdecl -norelay ucal_getAttribute() icuin68.ucal_getAttribute_68 +@ cdecl -norelay ucal_getAvailable() icuin68.ucal_getAvailable_68 +@ cdecl -norelay ucal_getCanonicalTimeZoneID() icuin68.ucal_getCanonicalTimeZoneID_68 +@ cdecl -norelay ucal_getDSTSavings() icuin68.ucal_getDSTSavings_68 +@ cdecl -norelay ucal_getDayOfWeekType() icuin68.ucal_getDayOfWeekType_68 +@ cdecl -norelay ucal_getDefaultTimeZone() icuin68.ucal_getDefaultTimeZone_68 +@ cdecl -norelay ucal_getFieldDifference() icuin68.ucal_getFieldDifference_68 +@ cdecl -norelay ucal_getGregorianChange() icuin68.ucal_getGregorianChange_68 +@ cdecl -norelay ucal_getHostTimeZone() icuin68.ucal_getHostTimeZone_68 +@ cdecl -norelay ucal_getKeywordValuesForLocale() icuin68.ucal_getKeywordValuesForLocale_68 +@ cdecl -norelay ucal_getLimit() icuin68.ucal_getLimit_68 +@ cdecl -norelay ucal_getLocaleByType() icuin68.ucal_getLocaleByType_68 +@ cdecl -norelay ucal_getMillis() icuin68.ucal_getMillis_68 +@ cdecl -norelay ucal_getNow() icuin68.ucal_getNow_68 +@ cdecl -norelay ucal_getTZDataVersion() icuin68.ucal_getTZDataVersion_68 +@ cdecl -norelay ucal_getTimeZoneDisplayName() icuin68.ucal_getTimeZoneDisplayName_68 +@ cdecl -norelay ucal_getTimeZoneID() icuin68.ucal_getTimeZoneID_68 +@ cdecl -norelay ucal_getTimeZoneIDForWindowsID() icuin68.ucal_getTimeZoneIDForWindowsID_68 +@ cdecl -norelay ucal_getTimeZoneTransitionDate() icuin68.ucal_getTimeZoneTransitionDate_68 +@ cdecl -norelay ucal_getType() icuin68.ucal_getType_68 +@ cdecl -norelay ucal_getWeekendTransition() icuin68.ucal_getWeekendTransition_68 +@ cdecl -norelay ucal_getWindowsTimeZoneID() icuin68.ucal_getWindowsTimeZoneID_68 +@ cdecl -norelay ucal_inDaylightTime() icuin68.ucal_inDaylightTime_68 +@ cdecl -norelay ucal_isSet() icuin68.ucal_isSet_68 +@ cdecl -norelay ucal_isWeekend() icuin68.ucal_isWeekend_68 +@ cdecl -norelay ucal_open() icuin68.ucal_open_68 +@ cdecl -norelay ucal_openCountryTimeZones() icuin68.ucal_openCountryTimeZones_68 +@ cdecl -norelay ucal_openTimeZoneIDEnumeration() icuin68.ucal_openTimeZoneIDEnumeration_68 +@ cdecl -norelay ucal_openTimeZones() icuin68.ucal_openTimeZones_68 +@ cdecl -norelay ucal_roll() icuin68.ucal_roll_68 +@ cdecl -norelay ucal_set() icuin68.ucal_set_68 +@ cdecl -norelay ucal_setAttribute() icuin68.ucal_setAttribute_68 +@ cdecl -norelay ucal_setDate() icuin68.ucal_setDate_68 +@ cdecl -norelay ucal_setDateTime() icuin68.ucal_setDateTime_68 +@ cdecl -norelay ucal_setDefaultTimeZone() icuin68.ucal_setDefaultTimeZone_68 +@ cdecl -norelay ucal_setGregorianChange() icuin68.ucal_setGregorianChange_68 +@ cdecl -norelay ucal_setMillis() icuin68.ucal_setMillis_68 +@ cdecl -norelay ucal_setTimeZone() icuin68.ucal_setTimeZone_68 +@ cdecl -norelay ucasemap_close() icuuc68.ucasemap_close_68 +@ cdecl -norelay ucasemap_getBreakIterator() icuuc68.ucasemap_getBreakIterator_68 +@ cdecl -norelay ucasemap_getLocale() icuuc68.ucasemap_getLocale_68 +@ cdecl -norelay ucasemap_getOptions() icuuc68.ucasemap_getOptions_68 +@ cdecl -norelay ucasemap_open() icuuc68.ucasemap_open_68 +@ cdecl -norelay ucasemap_setBreakIterator() icuuc68.ucasemap_setBreakIterator_68 +@ cdecl -norelay ucasemap_setLocale() icuuc68.ucasemap_setLocale_68 +@ cdecl -norelay ucasemap_setOptions() icuuc68.ucasemap_setOptions_68 +@ cdecl -norelay ucasemap_toTitle() icuuc68.ucasemap_toTitle_68 +@ cdecl -norelay ucasemap_utf8FoldCase() icuuc68.ucasemap_utf8FoldCase_68 +@ cdecl -norelay ucasemap_utf8ToLower() icuuc68.ucasemap_utf8ToLower_68 +@ cdecl -norelay ucasemap_utf8ToTitle() icuuc68.ucasemap_utf8ToTitle_68 +@ cdecl -norelay ucasemap_utf8ToUpper() icuuc68.ucasemap_utf8ToUpper_68 +@ cdecl -norelay ucfpos_close() icuin68.ucfpos_close_68 +@ cdecl -norelay ucfpos_constrainCategory() icuin68.ucfpos_constrainCategory_68 +@ cdecl -norelay ucfpos_constrainField() icuin68.ucfpos_constrainField_68 +@ cdecl -norelay ucfpos_getCategory() icuin68.ucfpos_getCategory_68 +@ cdecl -norelay ucfpos_getField() icuin68.ucfpos_getField_68 +@ cdecl -norelay ucfpos_getIndexes() icuin68.ucfpos_getIndexes_68 +@ cdecl -norelay ucfpos_getInt64IterationContext() icuin68.ucfpos_getInt64IterationContext_68 +@ cdecl -norelay ucfpos_matchesField() icuin68.ucfpos_matchesField_68 +@ cdecl -norelay ucfpos_open() icuin68.ucfpos_open_68 +@ cdecl -norelay ucfpos_reset() icuin68.ucfpos_reset_68 +@ cdecl -norelay ucfpos_setInt64IterationContext() icuin68.ucfpos_setInt64IterationContext_68 +@ cdecl -norelay ucfpos_setState() icuin68.ucfpos_setState_68 +@ cdecl -norelay ucnv_cbFromUWriteBytes() icuuc68.ucnv_cbFromUWriteBytes_68 +@ cdecl -norelay ucnv_cbFromUWriteSub() icuuc68.ucnv_cbFromUWriteSub_68 +@ cdecl -norelay ucnv_cbFromUWriteUChars() icuuc68.ucnv_cbFromUWriteUChars_68 +@ cdecl -norelay ucnv_cbToUWriteSub() icuuc68.ucnv_cbToUWriteSub_68 +@ cdecl -norelay ucnv_cbToUWriteUChars() icuuc68.ucnv_cbToUWriteUChars_68 +@ cdecl -norelay ucnv_close() icuuc68.ucnv_close_68 +@ cdecl -norelay ucnv_compareNames() icuuc68.ucnv_compareNames_68 +@ cdecl -norelay ucnv_convert() icuuc68.ucnv_convert_68 +@ cdecl -norelay ucnv_convertEx() icuuc68.ucnv_convertEx_68 +@ cdecl -norelay ucnv_countAliases() icuuc68.ucnv_countAliases_68 +@ cdecl -norelay ucnv_countAvailable() icuuc68.ucnv_countAvailable_68 +@ cdecl -norelay ucnv_countStandards() icuuc68.ucnv_countStandards_68 +@ cdecl -norelay ucnv_detectUnicodeSignature() icuuc68.ucnv_detectUnicodeSignature_68 +@ cdecl -norelay ucnv_fixFileSeparator() icuuc68.ucnv_fixFileSeparator_68 +@ cdecl -norelay ucnv_flushCache() icuuc68.ucnv_flushCache_68 +@ cdecl -norelay ucnv_fromAlgorithmic() icuuc68.ucnv_fromAlgorithmic_68 +@ cdecl -norelay ucnv_fromUChars() icuuc68.ucnv_fromUChars_68 +@ cdecl -norelay ucnv_fromUCountPending() icuuc68.ucnv_fromUCountPending_68 +@ cdecl -norelay ucnv_fromUnicode() icuuc68.ucnv_fromUnicode_68 +@ cdecl -norelay ucnv_getAlias() icuuc68.ucnv_getAlias_68 +@ cdecl -norelay ucnv_getAliases() icuuc68.ucnv_getAliases_68 +@ cdecl -norelay ucnv_getAvailableName() icuuc68.ucnv_getAvailableName_68 +@ cdecl -norelay ucnv_getCCSID() icuuc68.ucnv_getCCSID_68 +@ cdecl -norelay ucnv_getCanonicalName() icuuc68.ucnv_getCanonicalName_68 +@ cdecl -norelay ucnv_getDefaultName() icuuc68.ucnv_getDefaultName_68 +@ cdecl -norelay ucnv_getDisplayName() icuuc68.ucnv_getDisplayName_68 +@ cdecl -norelay ucnv_getFromUCallBack() icuuc68.ucnv_getFromUCallBack_68 +@ cdecl -norelay ucnv_getInvalidChars() icuuc68.ucnv_getInvalidChars_68 +@ cdecl -norelay ucnv_getInvalidUChars() icuuc68.ucnv_getInvalidUChars_68 +@ cdecl -norelay ucnv_getMaxCharSize() icuuc68.ucnv_getMaxCharSize_68 +@ cdecl -norelay ucnv_getMinCharSize() icuuc68.ucnv_getMinCharSize_68 +@ cdecl -norelay ucnv_getName() icuuc68.ucnv_getName_68 +@ cdecl -norelay ucnv_getNextUChar() icuuc68.ucnv_getNextUChar_68 +@ cdecl -norelay ucnv_getPlatform() icuuc68.ucnv_getPlatform_68 +@ cdecl -norelay ucnv_getStandard() icuuc68.ucnv_getStandard_68 +@ cdecl -norelay ucnv_getStandardName() icuuc68.ucnv_getStandardName_68 +@ cdecl -norelay ucnv_getStarters() icuuc68.ucnv_getStarters_68 +@ cdecl -norelay ucnv_getSubstChars() icuuc68.ucnv_getSubstChars_68 +@ cdecl -norelay ucnv_getToUCallBack() icuuc68.ucnv_getToUCallBack_68 +@ cdecl -norelay ucnv_getType() icuuc68.ucnv_getType_68 +@ cdecl -norelay ucnv_getUnicodeSet() icuuc68.ucnv_getUnicodeSet_68 +@ cdecl -norelay ucnv_isAmbiguous() icuuc68.ucnv_isAmbiguous_68 +@ cdecl -norelay ucnv_isFixedWidth() icuuc68.ucnv_isFixedWidth_68 +@ cdecl -norelay ucnv_open() icuuc68.ucnv_open_68 +@ cdecl -norelay ucnv_openAllNames() icuuc68.ucnv_openAllNames_68 +@ cdecl -norelay ucnv_openCCSID() icuuc68.ucnv_openCCSID_68 +@ cdecl -norelay ucnv_openPackage() icuuc68.ucnv_openPackage_68 +@ cdecl -norelay ucnv_openStandardNames() icuuc68.ucnv_openStandardNames_68 +@ cdecl -norelay ucnv_openU() icuuc68.ucnv_openU_68 +@ cdecl -norelay ucnv_reset() icuuc68.ucnv_reset_68 +@ cdecl -norelay ucnv_resetFromUnicode() icuuc68.ucnv_resetFromUnicode_68 +@ cdecl -norelay ucnv_resetToUnicode() icuuc68.ucnv_resetToUnicode_68 +@ cdecl -norelay ucnv_safeClone() icuuc68.ucnv_safeClone_68 +@ cdecl -norelay ucnv_setDefaultName() icuuc68.ucnv_setDefaultName_68 +@ cdecl -norelay ucnv_setFallback() icuuc68.ucnv_setFallback_68 +@ cdecl -norelay ucnv_setFromUCallBack() icuuc68.ucnv_setFromUCallBack_68 +@ cdecl -norelay ucnv_setSubstChars() icuuc68.ucnv_setSubstChars_68 +@ cdecl -norelay ucnv_setSubstString() icuuc68.ucnv_setSubstString_68 +@ cdecl -norelay ucnv_setToUCallBack() icuuc68.ucnv_setToUCallBack_68 +@ cdecl -norelay ucnv_toAlgorithmic() icuuc68.ucnv_toAlgorithmic_68 +@ cdecl -norelay ucnv_toUChars() icuuc68.ucnv_toUChars_68 +@ cdecl -norelay ucnv_toUCountPending() icuuc68.ucnv_toUCountPending_68 +@ cdecl -norelay ucnv_toUnicode() icuuc68.ucnv_toUnicode_68 +@ cdecl -norelay ucnv_usesFallback() icuuc68.ucnv_usesFallback_68 +@ cdecl -norelay ucnvsel_close() icuuc68.ucnvsel_close_68 +@ cdecl -norelay ucnvsel_open() icuuc68.ucnvsel_open_68 +@ cdecl -norelay ucnvsel_openFromSerialized() icuuc68.ucnvsel_openFromSerialized_68 +@ cdecl -norelay ucnvsel_selectForString() icuuc68.ucnvsel_selectForString_68 +@ cdecl -norelay ucnvsel_selectForUTF8() icuuc68.ucnvsel_selectForUTF8_68 +@ cdecl -norelay ucnvsel_serialize() icuuc68.ucnvsel_serialize_68 +@ cdecl -norelay ucol_cloneBinary() icuin68.ucol_cloneBinary_68 +@ cdecl -norelay ucol_close() icuin68.ucol_close_68 +@ cdecl -norelay ucol_closeElements() icuin68.ucol_closeElements_68 +@ cdecl -norelay ucol_countAvailable() icuin68.ucol_countAvailable_68 +@ cdecl -norelay ucol_equal() icuin68.ucol_equal_68 +@ cdecl -norelay ucol_getAttribute() icuin68.ucol_getAttribute_68 +@ cdecl -norelay ucol_getAvailable() icuin68.ucol_getAvailable_68 +@ cdecl -norelay ucol_getBound() icuin68.ucol_getBound_68 +@ cdecl -norelay ucol_getContractionsAndExpansions() icuin68.ucol_getContractionsAndExpansions_68 +@ cdecl -norelay ucol_getDisplayName() icuin68.ucol_getDisplayName_68 +@ cdecl -norelay ucol_getEquivalentReorderCodes() icuin68.ucol_getEquivalentReorderCodes_68 +@ cdecl -norelay ucol_getFunctionalEquivalent() icuin68.ucol_getFunctionalEquivalent_68 +@ cdecl -norelay ucol_getKeywordValues() icuin68.ucol_getKeywordValues_68 +@ cdecl -norelay ucol_getKeywordValuesForLocale() icuin68.ucol_getKeywordValuesForLocale_68 +@ cdecl -norelay ucol_getKeywords() icuin68.ucol_getKeywords_68 +@ cdecl -norelay ucol_getLocaleByType() icuin68.ucol_getLocaleByType_68 +@ cdecl -norelay ucol_getMaxExpansion() icuin68.ucol_getMaxExpansion_68 +@ cdecl -norelay ucol_getMaxVariable() icuin68.ucol_getMaxVariable_68 +@ cdecl -norelay ucol_getOffset() icuin68.ucol_getOffset_68 +@ cdecl -norelay ucol_getReorderCodes() icuin68.ucol_getReorderCodes_68 +@ cdecl -norelay ucol_getRules() icuin68.ucol_getRules_68 +@ cdecl -norelay ucol_getRulesEx() icuin68.ucol_getRulesEx_68 +@ cdecl -norelay ucol_getSortKey() icuin68.ucol_getSortKey_68 +@ cdecl -norelay ucol_getStrength() icuin68.ucol_getStrength_68 +@ cdecl -norelay ucol_getTailoredSet() icuin68.ucol_getTailoredSet_68 +@ cdecl -norelay ucol_getUCAVersion() icuin68.ucol_getUCAVersion_68 +@ cdecl -norelay ucol_getVariableTop() icuin68.ucol_getVariableTop_68 +@ cdecl -norelay ucol_getVersion() icuin68.ucol_getVersion_68 +@ cdecl -norelay ucol_greater() icuin68.ucol_greater_68 +@ cdecl -norelay ucol_greaterOrEqual() icuin68.ucol_greaterOrEqual_68 +@ cdecl -norelay ucol_keyHashCode() icuin68.ucol_keyHashCode_68 +@ cdecl -norelay ucol_mergeSortkeys() icuin68.ucol_mergeSortkeys_68 +@ cdecl -norelay ucol_next() icuin68.ucol_next_68 +@ cdecl -norelay ucol_nextSortKeyPart() icuin68.ucol_nextSortKeyPart_68 +@ cdecl -norelay ucol_open() icuin68.ucol_open_68 +@ cdecl -norelay ucol_openAvailableLocales() icuin68.ucol_openAvailableLocales_68 +@ cdecl -norelay ucol_openBinary() icuin68.ucol_openBinary_68 +@ cdecl -norelay ucol_openElements() icuin68.ucol_openElements_68 +@ cdecl -norelay ucol_openRules() icuin68.ucol_openRules_68 +@ cdecl -norelay ucol_previous() icuin68.ucol_previous_68 +@ cdecl -norelay ucol_primaryOrder() icuin68.ucol_primaryOrder_68 +@ cdecl -norelay ucol_reset() icuin68.ucol_reset_68 +@ cdecl -norelay ucol_safeClone() icuin68.ucol_safeClone_68 +@ cdecl -norelay ucol_secondaryOrder() icuin68.ucol_secondaryOrder_68 +@ cdecl -norelay ucol_setAttribute() icuin68.ucol_setAttribute_68 +@ cdecl -norelay ucol_setMaxVariable() icuin68.ucol_setMaxVariable_68 +@ cdecl -norelay ucol_setOffset() icuin68.ucol_setOffset_68 +@ cdecl -norelay ucol_setReorderCodes() icuin68.ucol_setReorderCodes_68 +@ cdecl -norelay ucol_setStrength() icuin68.ucol_setStrength_68 +@ cdecl -norelay ucol_setText() icuin68.ucol_setText_68 +@ cdecl -norelay ucol_strcoll() icuin68.ucol_strcoll_68 +@ cdecl -norelay ucol_strcollIter() icuin68.ucol_strcollIter_68 +@ cdecl -norelay ucol_strcollUTF8() icuin68.ucol_strcollUTF8_68 +@ cdecl -norelay ucol_tertiaryOrder() icuin68.ucol_tertiaryOrder_68 +@ cdecl -norelay ucpmap_get() icuuc68.ucpmap_get_68 +@ cdecl -norelay ucpmap_getRange() icuuc68.ucpmap_getRange_68 +@ cdecl -norelay ucptrie_close() icuuc68.ucptrie_close_68 +@ cdecl -norelay ucptrie_get() icuuc68.ucptrie_get_68 +@ cdecl -norelay ucptrie_getRange() icuuc68.ucptrie_getRange_68 +@ cdecl -norelay ucptrie_getType() icuuc68.ucptrie_getType_68 +@ cdecl -norelay ucptrie_getValueWidth() icuuc68.ucptrie_getValueWidth_68 +@ cdecl -norelay ucptrie_internalSmallIndex() icuuc68.ucptrie_internalSmallIndex_68 +@ cdecl -norelay ucptrie_internalSmallU8Index() icuuc68.ucptrie_internalSmallU8Index_68 +@ cdecl -norelay ucptrie_internalU8PrevIndex() icuuc68.ucptrie_internalU8PrevIndex_68 +@ cdecl -norelay ucptrie_openFromBinary() icuuc68.ucptrie_openFromBinary_68 +@ cdecl -norelay ucptrie_toBinary() icuuc68.ucptrie_toBinary_68 +@ cdecl -norelay ucsdet_close() icuin68.ucsdet_close_68 +@ cdecl -norelay ucsdet_detect() icuin68.ucsdet_detect_68 +@ cdecl -norelay ucsdet_detectAll() icuin68.ucsdet_detectAll_68 +@ cdecl -norelay ucsdet_enableInputFilter() icuin68.ucsdet_enableInputFilter_68 +@ cdecl -norelay ucsdet_getAllDetectableCharsets() icuin68.ucsdet_getAllDetectableCharsets_68 +@ cdecl -norelay ucsdet_getConfidence() icuin68.ucsdet_getConfidence_68 +@ cdecl -norelay ucsdet_getLanguage() icuin68.ucsdet_getLanguage_68 +@ cdecl -norelay ucsdet_getName() icuin68.ucsdet_getName_68 +@ cdecl -norelay ucsdet_getUChars() icuin68.ucsdet_getUChars_68 +@ cdecl -norelay ucsdet_isInputFilterEnabled() icuin68.ucsdet_isInputFilterEnabled_68 +@ cdecl -norelay ucsdet_open() icuin68.ucsdet_open_68 +@ cdecl -norelay ucsdet_setDeclaredEncoding() icuin68.ucsdet_setDeclaredEncoding_68 +@ cdecl -norelay ucsdet_setText() icuin68.ucsdet_setText_68 +@ cdecl -norelay ucurr_countCurrencies() icuuc68.ucurr_countCurrencies_68 +@ cdecl -norelay ucurr_forLocale() icuuc68.ucurr_forLocale_68 +@ cdecl -norelay ucurr_forLocaleAndDate() icuuc68.ucurr_forLocaleAndDate_68 +@ cdecl -norelay ucurr_getDefaultFractionDigits() icuuc68.ucurr_getDefaultFractionDigits_68 +@ cdecl -norelay ucurr_getDefaultFractionDigitsForUsage() icuuc68.ucurr_getDefaultFractionDigitsForUsage_68 +@ cdecl -norelay ucurr_getKeywordValuesForLocale() icuuc68.ucurr_getKeywordValuesForLocale_68 +@ cdecl -norelay ucurr_getName() icuuc68.ucurr_getName_68 +@ cdecl -norelay ucurr_getNumericCode() icuuc68.ucurr_getNumericCode_68 +@ cdecl -norelay ucurr_getPluralName() icuuc68.ucurr_getPluralName_68 +@ cdecl -norelay ucurr_getRoundingIncrement() icuuc68.ucurr_getRoundingIncrement_68 +@ cdecl -norelay ucurr_getRoundingIncrementForUsage() icuuc68.ucurr_getRoundingIncrementForUsage_68 +@ cdecl -norelay ucurr_isAvailable() icuuc68.ucurr_isAvailable_68 +@ cdecl -norelay ucurr_openISOCurrencies() icuuc68.ucurr_openISOCurrencies_68 +@ cdecl -norelay ucurr_register() icuuc68.ucurr_register_68 +@ cdecl -norelay ucurr_unregister() icuuc68.ucurr_unregister_68 +@ cdecl -norelay udat_adoptNumberFormat() icuin68.udat_adoptNumberFormat_68 +@ cdecl -norelay udat_adoptNumberFormatForFields() icuin68.udat_adoptNumberFormatForFields_68 +@ cdecl -norelay udat_applyPattern() icuin68.udat_applyPattern_68 +@ cdecl -norelay udat_clone() icuin68.udat_clone_68 +@ cdecl -norelay udat_close() icuin68.udat_close_68 +@ cdecl -norelay udat_countAvailable() icuin68.udat_countAvailable_68 +@ cdecl -norelay udat_countSymbols() icuin68.udat_countSymbols_68 +@ cdecl -norelay udat_format() icuin68.udat_format_68 +@ cdecl -norelay udat_formatCalendar() icuin68.udat_formatCalendar_68 +@ cdecl -norelay udat_formatCalendarForFields() icuin68.udat_formatCalendarForFields_68 +@ cdecl -norelay udat_formatForFields() icuin68.udat_formatForFields_68 +@ cdecl -norelay udat_get2DigitYearStart() icuin68.udat_get2DigitYearStart_68 +@ cdecl -norelay udat_getAvailable() icuin68.udat_getAvailable_68 +@ cdecl -norelay udat_getBooleanAttribute() icuin68.udat_getBooleanAttribute_68 +@ cdecl -norelay udat_getCalendar() icuin68.udat_getCalendar_68 +@ cdecl -norelay udat_getContext() icuin68.udat_getContext_68 +@ cdecl -norelay udat_getLocaleByType() icuin68.udat_getLocaleByType_68 +@ cdecl -norelay udat_getNumberFormat() icuin68.udat_getNumberFormat_68 +@ cdecl -norelay udat_getNumberFormatForField() icuin68.udat_getNumberFormatForField_68 +@ cdecl -norelay udat_getSymbols() icuin68.udat_getSymbols_68 +@ cdecl -norelay udat_isLenient() icuin68.udat_isLenient_68 +@ cdecl -norelay udat_open() icuin68.udat_open_68 +@ cdecl -norelay udat_parse() icuin68.udat_parse_68 +@ cdecl -norelay udat_parseCalendar() icuin68.udat_parseCalendar_68 +@ cdecl -norelay udat_set2DigitYearStart() icuin68.udat_set2DigitYearStart_68 +@ cdecl -norelay udat_setBooleanAttribute() icuin68.udat_setBooleanAttribute_68 +@ cdecl -norelay udat_setCalendar() icuin68.udat_setCalendar_68 +@ cdecl -norelay udat_setContext() icuin68.udat_setContext_68 +@ cdecl -norelay udat_setLenient() icuin68.udat_setLenient_68 +@ cdecl -norelay udat_setNumberFormat() icuin68.udat_setNumberFormat_68 +@ cdecl -norelay udat_setSymbols() icuin68.udat_setSymbols_68 +@ cdecl -norelay udat_toCalendarDateField() icuin68.udat_toCalendarDateField_68 +@ cdecl -norelay udat_toPattern() icuin68.udat_toPattern_68 +@ cdecl -norelay udatpg_addPattern() icuin68.udatpg_addPattern_68 +@ cdecl -norelay udatpg_clone() icuin68.udatpg_clone_68 +@ cdecl -norelay udatpg_close() icuin68.udatpg_close_68 +@ cdecl -norelay udatpg_getAppendItemFormat() icuin68.udatpg_getAppendItemFormat_68 +@ cdecl -norelay udatpg_getAppendItemName() icuin68.udatpg_getAppendItemName_68 +@ cdecl -norelay udatpg_getBaseSkeleton() icuin68.udatpg_getBaseSkeleton_68 +@ cdecl -norelay udatpg_getBestPattern() icuin68.udatpg_getBestPattern_68 +@ cdecl -norelay udatpg_getBestPatternWithOptions() icuin68.udatpg_getBestPatternWithOptions_68 +@ cdecl -norelay udatpg_getDateTimeFormat() icuin68.udatpg_getDateTimeFormat_68 +@ cdecl -norelay udatpg_getDecimal() icuin68.udatpg_getDecimal_68 +@ cdecl -norelay udatpg_getFieldDisplayName() icuin68.udatpg_getFieldDisplayName_68 +@ cdecl -norelay udatpg_getPatternForSkeleton() icuin68.udatpg_getPatternForSkeleton_68 +@ cdecl -norelay udatpg_getSkeleton() icuin68.udatpg_getSkeleton_68 +@ cdecl -norelay udatpg_open() icuin68.udatpg_open_68 +@ cdecl -norelay udatpg_openBaseSkeletons() icuin68.udatpg_openBaseSkeletons_68 +@ cdecl -norelay udatpg_openEmpty() icuin68.udatpg_openEmpty_68 +@ cdecl -norelay udatpg_openSkeletons() icuin68.udatpg_openSkeletons_68 +@ cdecl -norelay udatpg_replaceFieldTypes() icuin68.udatpg_replaceFieldTypes_68 +@ cdecl -norelay udatpg_replaceFieldTypesWithOptions() icuin68.udatpg_replaceFieldTypesWithOptions_68 +@ cdecl -norelay udatpg_setAppendItemFormat() icuin68.udatpg_setAppendItemFormat_68 +@ cdecl -norelay udatpg_setAppendItemName() icuin68.udatpg_setAppendItemName_68 +@ cdecl -norelay udatpg_setDateTimeFormat() icuin68.udatpg_setDateTimeFormat_68 +@ cdecl -norelay udatpg_setDecimal() icuin68.udatpg_setDecimal_68 +@ cdecl -norelay udtitvfmt_close() icuin68.udtitvfmt_close_68 +@ cdecl -norelay udtitvfmt_closeResult() icuin68.udtitvfmt_closeResult_68 +@ cdecl -norelay udtitvfmt_format() icuin68.udtitvfmt_format_68 +@ cdecl -norelay udtitvfmt_open() icuin68.udtitvfmt_open_68 +@ cdecl -norelay udtitvfmt_openResult() icuin68.udtitvfmt_openResult_68 +@ cdecl -norelay udtitvfmt_resultAsValue() icuin68.udtitvfmt_resultAsValue_68 +@ cdecl -norelay uenum_close() icuuc68.uenum_close_68 +@ cdecl -norelay uenum_count() icuuc68.uenum_count_68 +@ cdecl -norelay uenum_next() icuuc68.uenum_next_68 +@ cdecl -norelay uenum_openCharStringsEnumeration() icuuc68.uenum_openCharStringsEnumeration_68 +@ cdecl -norelay uenum_openUCharStringsEnumeration() icuuc68.uenum_openUCharStringsEnumeration_68 +@ cdecl -norelay uenum_reset() icuuc68.uenum_reset_68 +@ cdecl -norelay uenum_unext() icuuc68.uenum_unext_68 +@ cdecl -norelay ufieldpositer_close() icuin68.ufieldpositer_close_68 +@ cdecl -norelay ufieldpositer_next() icuin68.ufieldpositer_next_68 +@ cdecl -norelay ufieldpositer_open() icuin68.ufieldpositer_open_68 +@ cdecl -norelay ufmt_close() icuin68.ufmt_close_68 +@ cdecl -norelay ufmt_getArrayItemByIndex() icuin68.ufmt_getArrayItemByIndex_68 +@ cdecl -norelay ufmt_getArrayLength() icuin68.ufmt_getArrayLength_68 +@ cdecl -norelay ufmt_getDate() icuin68.ufmt_getDate_68 +@ cdecl -norelay ufmt_getDecNumChars() icuin68.ufmt_getDecNumChars_68 +@ cdecl -norelay ufmt_getDouble() icuin68.ufmt_getDouble_68 +@ cdecl -norelay ufmt_getInt64() icuin68.ufmt_getInt64_68 +@ cdecl -norelay ufmt_getLong() icuin68.ufmt_getLong_68 +@ cdecl -norelay ufmt_getObject() icuin68.ufmt_getObject_68 +@ cdecl -norelay ufmt_getType() icuin68.ufmt_getType_68 +@ cdecl -norelay ufmt_getUChars() icuin68.ufmt_getUChars_68 +@ cdecl -norelay ufmt_isNumeric() icuin68.ufmt_isNumeric_68 +@ cdecl -norelay ufmt_open() icuin68.ufmt_open_68 +@ cdecl -norelay ufmtval_getString() icuin68.ufmtval_getString_68 +@ cdecl -norelay ufmtval_nextPosition() icuin68.ufmtval_nextPosition_68 +@ cdecl -norelay ugender_getInstance() icuin68.ugender_getInstance_68 +@ cdecl -norelay ugender_getListGender() icuin68.ugender_getListGender_68 +@ cdecl -norelay uidna_close() icuuc68.uidna_close_68 +@ cdecl -norelay uidna_labelToASCII() icuuc68.uidna_labelToASCII_68 +@ cdecl -norelay uidna_labelToASCII_UTF8() icuuc68.uidna_labelToASCII_UTF8_68 +@ cdecl -norelay uidna_labelToUnicode() icuuc68.uidna_labelToUnicode_68 +@ cdecl -norelay uidna_labelToUnicodeUTF8() icuuc68.uidna_labelToUnicodeUTF8_68 +@ cdecl -norelay uidna_nameToASCII() icuuc68.uidna_nameToASCII_68 +@ cdecl -norelay uidna_nameToASCII_UTF8() icuuc68.uidna_nameToASCII_UTF8_68 +@ cdecl -norelay uidna_nameToUnicode() icuuc68.uidna_nameToUnicode_68 +@ cdecl -norelay uidna_nameToUnicodeUTF8() icuuc68.uidna_nameToUnicodeUTF8_68 +@ cdecl -norelay uidna_openUTS46() icuuc68.uidna_openUTS46_68 +@ cdecl -norelay uiter_current32() icuuc68.uiter_current32_68 +@ cdecl -norelay uiter_getState() icuuc68.uiter_getState_68 +@ cdecl -norelay uiter_next32() icuuc68.uiter_next32_68 +@ cdecl -norelay uiter_previous32() icuuc68.uiter_previous32_68 +@ cdecl -norelay uiter_setState() icuuc68.uiter_setState_68 +@ cdecl -norelay uiter_setString() icuuc68.uiter_setString_68 +@ cdecl -norelay uiter_setUTF16BE() icuuc68.uiter_setUTF16BE_68 +@ cdecl -norelay uiter_setUTF8() icuuc68.uiter_setUTF8_68 +@ cdecl -norelay uldn_close() icuuc68.uldn_close_68 +@ cdecl -norelay uldn_getContext() icuuc68.uldn_getContext_68 +@ cdecl -norelay uldn_getDialectHandling() icuuc68.uldn_getDialectHandling_68 +@ cdecl -norelay uldn_getLocale() icuuc68.uldn_getLocale_68 +@ cdecl -norelay uldn_keyDisplayName() icuuc68.uldn_keyDisplayName_68 +@ cdecl -norelay uldn_keyValueDisplayName() icuuc68.uldn_keyValueDisplayName_68 +@ cdecl -norelay uldn_languageDisplayName() icuuc68.uldn_languageDisplayName_68 +@ cdecl -norelay uldn_localeDisplayName() icuuc68.uldn_localeDisplayName_68 +@ cdecl -norelay uldn_open() icuuc68.uldn_open_68 +@ cdecl -norelay uldn_openForContext() icuuc68.uldn_openForContext_68 +@ cdecl -norelay uldn_regionDisplayName() icuuc68.uldn_regionDisplayName_68 +@ cdecl -norelay uldn_scriptCodeDisplayName() icuuc68.uldn_scriptCodeDisplayName_68 +@ cdecl -norelay uldn_scriptDisplayName() icuuc68.uldn_scriptDisplayName_68 +@ cdecl -norelay uldn_variantDisplayName() icuuc68.uldn_variantDisplayName_68 +@ cdecl -norelay ulistfmt_close() icuin68.ulistfmt_close_68 +@ cdecl -norelay ulistfmt_closeResult() icuin68.ulistfmt_closeResult_68 +@ cdecl -norelay ulistfmt_format() icuin68.ulistfmt_format_68 +@ cdecl -norelay ulistfmt_formatStringsToResult() icuin68.ulistfmt_formatStringsToResult_68 +@ cdecl -norelay ulistfmt_open() icuin68.ulistfmt_open_68 +@ cdecl -norelay ulistfmt_openForType() icuin68.ulistfmt_openForType_68 +@ cdecl -norelay ulistfmt_openResult() icuin68.ulistfmt_openResult_68 +@ cdecl -norelay ulistfmt_resultAsValue() icuin68.ulistfmt_resultAsValue_68 +@ cdecl -norelay uloc_acceptLanguage() icuuc68.uloc_acceptLanguage_68 +@ cdecl -norelay uloc_acceptLanguageFromHTTP() icuuc68.uloc_acceptLanguageFromHTTP_68 +@ cdecl -norelay uloc_addLikelySubtags() icuuc68.uloc_addLikelySubtags_68 +@ cdecl -norelay uloc_canonicalize() icuuc68.uloc_canonicalize_68 +@ cdecl -norelay uloc_countAvailable() icuuc68.uloc_countAvailable_68 +@ cdecl -norelay uloc_forLanguageTag() icuuc68.uloc_forLanguageTag_68 +@ cdecl -norelay uloc_getAvailable() icuuc68.uloc_getAvailable_68 +@ cdecl -norelay uloc_getBaseName() icuuc68.uloc_getBaseName_68 +@ cdecl -norelay uloc_getCharacterOrientation() icuuc68.uloc_getCharacterOrientation_68 +@ cdecl -norelay uloc_getCountry() icuuc68.uloc_getCountry_68 +@ cdecl -norelay uloc_getDefault() icuuc68.uloc_getDefault_68 +@ cdecl -norelay uloc_getDisplayCountry() icuuc68.uloc_getDisplayCountry_68 +@ cdecl -norelay uloc_getDisplayKeyword() icuuc68.uloc_getDisplayKeyword_68 +@ cdecl -norelay uloc_getDisplayKeywordValue() icuuc68.uloc_getDisplayKeywordValue_68 +@ cdecl -norelay uloc_getDisplayLanguage() icuuc68.uloc_getDisplayLanguage_68 +@ cdecl -norelay uloc_getDisplayName() icuuc68.uloc_getDisplayName_68 +@ cdecl -norelay uloc_getDisplayScript() icuuc68.uloc_getDisplayScript_68 +@ cdecl -norelay uloc_getDisplayVariant() icuuc68.uloc_getDisplayVariant_68 +@ cdecl -norelay uloc_getISO3Country() icuuc68.uloc_getISO3Country_68 +@ cdecl -norelay uloc_getISO3Language() icuuc68.uloc_getISO3Language_68 +@ cdecl -norelay uloc_getISOCountries() icuuc68.uloc_getISOCountries_68 +@ cdecl -norelay uloc_getISOLanguages() icuuc68.uloc_getISOLanguages_68 +@ cdecl -norelay uloc_getKeywordValue() icuuc68.uloc_getKeywordValue_68 +@ cdecl -norelay uloc_getLCID() icuuc68.uloc_getLCID_68 +@ cdecl -norelay uloc_getLanguage() icuuc68.uloc_getLanguage_68 +@ cdecl -norelay uloc_getLineOrientation() icuuc68.uloc_getLineOrientation_68 +@ cdecl -norelay uloc_getLocaleForLCID() icuuc68.uloc_getLocaleForLCID_68 +@ cdecl -norelay uloc_getName() icuuc68.uloc_getName_68 +@ cdecl -norelay uloc_getParent() icuuc68.uloc_getParent_68 +@ cdecl -norelay uloc_getScript() icuuc68.uloc_getScript_68 +@ cdecl -norelay uloc_getVariant() icuuc68.uloc_getVariant_68 +@ cdecl -norelay uloc_isRightToLeft() icuuc68.uloc_isRightToLeft_68 +@ cdecl -norelay uloc_minimizeSubtags() icuuc68.uloc_minimizeSubtags_68 +@ cdecl -norelay uloc_openAvailableByType() icuuc68.uloc_openAvailableByType_68 +@ cdecl -norelay uloc_openKeywords() icuuc68.uloc_openKeywords_68 +@ cdecl -norelay uloc_setDefault() icuuc68.uloc_setDefault_68 +@ cdecl -norelay uloc_setKeywordValue() icuuc68.uloc_setKeywordValue_68 +@ cdecl -norelay uloc_toLanguageTag() icuuc68.uloc_toLanguageTag_68 +@ cdecl -norelay uloc_toLegacyKey() icuuc68.uloc_toLegacyKey_68 +@ cdecl -norelay uloc_toLegacyType() icuuc68.uloc_toLegacyType_68 +@ cdecl -norelay uloc_toUnicodeLocaleKey() icuuc68.uloc_toUnicodeLocaleKey_68 +@ cdecl -norelay uloc_toUnicodeLocaleType() icuuc68.uloc_toUnicodeLocaleType_68 +@ cdecl -norelay ulocdata_close() icuin68.ulocdata_close_68 +@ cdecl -norelay ulocdata_getCLDRVersion() icuin68.ulocdata_getCLDRVersion_68 +@ cdecl -norelay ulocdata_getDelimiter() icuin68.ulocdata_getDelimiter_68 +@ cdecl -norelay ulocdata_getExemplarSet() icuin68.ulocdata_getExemplarSet_68 +@ cdecl -norelay ulocdata_getLocaleDisplayPattern() icuin68.ulocdata_getLocaleDisplayPattern_68 +@ cdecl -norelay ulocdata_getLocaleSeparator() icuin68.ulocdata_getLocaleSeparator_68 +@ cdecl -norelay ulocdata_getMeasurementSystem() icuin68.ulocdata_getMeasurementSystem_68 +@ cdecl -norelay ulocdata_getNoSubstitute() icuin68.ulocdata_getNoSubstitute_68 +@ cdecl -norelay ulocdata_getPaperSize() icuin68.ulocdata_getPaperSize_68 +@ cdecl -norelay ulocdata_open() icuin68.ulocdata_open_68 +@ cdecl -norelay ulocdata_setNoSubstitute() icuin68.ulocdata_setNoSubstitute_68 +@ cdecl -norelay umsg_applyPattern() icuin68.umsg_applyPattern_68 +@ cdecl -norelay umsg_autoQuoteApostrophe() icuin68.umsg_autoQuoteApostrophe_68 +@ cdecl -norelay umsg_clone() icuin68.umsg_clone_68 +@ cdecl -norelay umsg_close() icuin68.umsg_close_68 +@ cdecl -norelay umsg_format() icuin68.umsg_format_68 +@ cdecl -norelay umsg_getLocale() icuin68.umsg_getLocale_68 +@ cdecl -norelay umsg_open() icuin68.umsg_open_68 +@ cdecl -norelay umsg_parse() icuin68.umsg_parse_68 +@ cdecl -norelay umsg_setLocale() icuin68.umsg_setLocale_68 +@ cdecl -norelay umsg_toPattern() icuin68.umsg_toPattern_68 +@ cdecl -norelay umsg_vformat() icuin68.umsg_vformat_68 +@ cdecl -norelay umsg_vparse() icuin68.umsg_vparse_68 +@ cdecl -norelay umutablecptrie_buildImmutable() icuuc68.umutablecptrie_buildImmutable_68 +@ cdecl -norelay umutablecptrie_clone() icuuc68.umutablecptrie_clone_68 +@ cdecl -norelay umutablecptrie_close() icuuc68.umutablecptrie_close_68 +@ cdecl -norelay umutablecptrie_fromUCPMap() icuuc68.umutablecptrie_fromUCPMap_68 +@ cdecl -norelay umutablecptrie_fromUCPTrie() icuuc68.umutablecptrie_fromUCPTrie_68 +@ cdecl -norelay umutablecptrie_get() icuuc68.umutablecptrie_get_68 +@ cdecl -norelay umutablecptrie_getRange() icuuc68.umutablecptrie_getRange_68 +@ cdecl -norelay umutablecptrie_open() icuuc68.umutablecptrie_open_68 +@ cdecl -norelay umutablecptrie_set() icuuc68.umutablecptrie_set_68 +@ cdecl -norelay umutablecptrie_setRange() icuuc68.umutablecptrie_setRange_68 +@ cdecl -norelay unorm2_append() icuuc68.unorm2_append_68 +@ cdecl -norelay unorm2_close() icuuc68.unorm2_close_68 +@ cdecl -norelay unorm2_composePair() icuuc68.unorm2_composePair_68 +@ cdecl -norelay unorm2_getCombiningClass() icuuc68.unorm2_getCombiningClass_68 +@ cdecl -norelay unorm2_getDecomposition() icuuc68.unorm2_getDecomposition_68 +@ cdecl -norelay unorm2_getInstance() icuuc68.unorm2_getInstance_68 +@ cdecl -norelay unorm2_getNFCInstance() icuuc68.unorm2_getNFCInstance_68 +@ cdecl -norelay unorm2_getNFDInstance() icuuc68.unorm2_getNFDInstance_68 +@ cdecl -norelay unorm2_getNFKCCasefoldInstance() icuuc68.unorm2_getNFKCCasefoldInstance_68 +@ cdecl -norelay unorm2_getNFKCInstance() icuuc68.unorm2_getNFKCInstance_68 +@ cdecl -norelay unorm2_getNFKDInstance() icuuc68.unorm2_getNFKDInstance_68 +@ cdecl -norelay unorm2_getRawDecomposition() icuuc68.unorm2_getRawDecomposition_68 +@ cdecl -norelay unorm2_hasBoundaryAfter() icuuc68.unorm2_hasBoundaryAfter_68 +@ cdecl -norelay unorm2_hasBoundaryBefore() icuuc68.unorm2_hasBoundaryBefore_68 +@ cdecl -norelay unorm2_isInert() icuuc68.unorm2_isInert_68 +@ cdecl -norelay unorm2_isNormalized() icuuc68.unorm2_isNormalized_68 +@ cdecl -norelay unorm2_normalize() icuuc68.unorm2_normalize_68 +@ cdecl -norelay unorm2_normalizeSecondAndAppend() icuuc68.unorm2_normalizeSecondAndAppend_68 +@ cdecl -norelay unorm2_openFiltered() icuuc68.unorm2_openFiltered_68 +@ cdecl -norelay unorm2_quickCheck() icuuc68.unorm2_quickCheck_68 +@ cdecl -norelay unorm2_spanQuickCheckYes() icuuc68.unorm2_spanQuickCheckYes_68 +@ cdecl -norelay unorm_compare() icuuc68.unorm_compare_68 +@ cdecl -norelay unum_applyPattern() icuin68.unum_applyPattern_68 +@ cdecl -norelay unum_clone() icuin68.unum_clone_68 +@ cdecl -norelay unum_close() icuin68.unum_close_68 +@ cdecl -norelay unum_countAvailable() icuin68.unum_countAvailable_68 +@ cdecl -norelay unum_format() icuin68.unum_format_68 +@ cdecl -norelay unum_formatDecimal() icuin68.unum_formatDecimal_68 +@ cdecl -norelay unum_formatDouble() icuin68.unum_formatDouble_68 +@ cdecl -norelay unum_formatDoubleCurrency() icuin68.unum_formatDoubleCurrency_68 +@ cdecl -norelay unum_formatDoubleForFields() icuin68.unum_formatDoubleForFields_68 +@ cdecl -norelay unum_formatInt64() icuin68.unum_formatInt64_68 +@ cdecl -norelay unum_formatUFormattable() icuin68.unum_formatUFormattable_68 +@ cdecl -norelay unum_getAttribute() icuin68.unum_getAttribute_68 +@ cdecl -norelay unum_getAvailable() icuin68.unum_getAvailable_68 +@ cdecl -norelay unum_getContext() icuin68.unum_getContext_68 +@ cdecl -norelay unum_getDoubleAttribute() icuin68.unum_getDoubleAttribute_68 +@ cdecl -norelay unum_getLocaleByType() icuin68.unum_getLocaleByType_68 +@ cdecl -norelay unum_getSymbol() icuin68.unum_getSymbol_68 +@ cdecl -norelay unum_getTextAttribute() icuin68.unum_getTextAttribute_68 +@ cdecl -norelay unum_open() icuin68.unum_open_68 +@ cdecl -norelay unum_parse() icuin68.unum_parse_68 +@ cdecl -norelay unum_parseDecimal() icuin68.unum_parseDecimal_68 +@ cdecl -norelay unum_parseDouble() icuin68.unum_parseDouble_68 +@ cdecl -norelay unum_parseDoubleCurrency() icuin68.unum_parseDoubleCurrency_68 +@ cdecl -norelay unum_parseInt64() icuin68.unum_parseInt64_68 +@ cdecl -norelay unum_parseToUFormattable() icuin68.unum_parseToUFormattable_68 +@ cdecl -norelay unum_setAttribute() icuin68.unum_setAttribute_68 +@ cdecl -norelay unum_setContext() icuin68.unum_setContext_68 +@ cdecl -norelay unum_setDoubleAttribute() icuin68.unum_setDoubleAttribute_68 +@ cdecl -norelay unum_setSymbol() icuin68.unum_setSymbol_68 +@ cdecl -norelay unum_setTextAttribute() icuin68.unum_setTextAttribute_68 +@ cdecl -norelay unum_toPattern() icuin68.unum_toPattern_68 +@ cdecl -norelay unumf_close() icuin68.unumf_close_68 +@ cdecl -norelay unumf_closeResult() icuin68.unumf_closeResult_68 +@ cdecl -norelay unumf_formatDecimal() icuin68.unumf_formatDecimal_68 +@ cdecl -norelay unumf_formatDouble() icuin68.unumf_formatDouble_68 +@ cdecl -norelay unumf_formatInt() icuin68.unumf_formatInt_68 +@ cdecl -norelay unumf_openForSkeletonAndLocale() icuin68.unumf_openForSkeletonAndLocale_68 +@ cdecl -norelay unumf_openForSkeletonAndLocaleWithError() icuin68.unumf_openForSkeletonAndLocaleWithError_68 +@ cdecl -norelay unumf_openResult() icuin68.unumf_openResult_68 +@ cdecl -norelay unumf_resultAsValue() icuin68.unumf_resultAsValue_68 +@ cdecl -norelay unumf_resultGetAllFieldPositions() icuin68.unumf_resultGetAllFieldPositions_68 +@ cdecl -norelay unumf_resultNextFieldPosition() icuin68.unumf_resultNextFieldPosition_68 +@ cdecl -norelay unumf_resultToString() icuin68.unumf_resultToString_68 +@ cdecl -norelay unumsys_close() icuin68.unumsys_close_68 +@ cdecl -norelay unumsys_getDescription() icuin68.unumsys_getDescription_68 +@ cdecl -norelay unumsys_getName() icuin68.unumsys_getName_68 +@ cdecl -norelay unumsys_getRadix() icuin68.unumsys_getRadix_68 +@ cdecl -norelay unumsys_isAlgorithmic() icuin68.unumsys_isAlgorithmic_68 +@ cdecl -norelay unumsys_open() icuin68.unumsys_open_68 +@ cdecl -norelay unumsys_openAvailableNames() icuin68.unumsys_openAvailableNames_68 +@ cdecl -norelay unumsys_openByName() icuin68.unumsys_openByName_68 +@ cdecl -norelay uplrules_close() icuin68.uplrules_close_68 +@ cdecl -norelay uplrules_getKeywords() icuin68.uplrules_getKeywords_68 +@ cdecl -norelay uplrules_open() icuin68.uplrules_open_68 +@ cdecl -norelay uplrules_openForType() icuin68.uplrules_openForType_68 +@ cdecl -norelay uplrules_select() icuin68.uplrules_select_68 +@ cdecl -norelay uplrules_selectFormatted() icuin68.uplrules_selectFormatted_68 +@ cdecl -norelay uregex_appendReplacement() icuin68.uregex_appendReplacement_68 +@ cdecl -norelay uregex_appendReplacementUText() icuin68.uregex_appendReplacementUText_68 +@ cdecl -norelay uregex_appendTail() icuin68.uregex_appendTail_68 +@ cdecl -norelay uregex_appendTailUText() icuin68.uregex_appendTailUText_68 +@ cdecl -norelay uregex_clone() icuin68.uregex_clone_68 +@ cdecl -norelay uregex_close() icuin68.uregex_close_68 +@ cdecl -norelay uregex_end() icuin68.uregex_end_68 +@ cdecl -norelay uregex_end64() icuin68.uregex_end64_68 +@ cdecl -norelay uregex_find() icuin68.uregex_find_68 +@ cdecl -norelay uregex_find64() icuin68.uregex_find64_68 +@ cdecl -norelay uregex_findNext() icuin68.uregex_findNext_68 +@ cdecl -norelay uregex_flags() icuin68.uregex_flags_68 +@ cdecl -norelay uregex_getFindProgressCallback() icuin68.uregex_getFindProgressCallback_68 +@ cdecl -norelay uregex_getMatchCallback() icuin68.uregex_getMatchCallback_68 +@ cdecl -norelay uregex_getStackLimit() icuin68.uregex_getStackLimit_68 +@ cdecl -norelay uregex_getText() icuin68.uregex_getText_68 +@ cdecl -norelay uregex_getTimeLimit() icuin68.uregex_getTimeLimit_68 +@ cdecl -norelay uregex_getUText() icuin68.uregex_getUText_68 +@ cdecl -norelay uregex_group() icuin68.uregex_group_68 +@ cdecl -norelay uregex_groupCount() icuin68.uregex_groupCount_68 +@ cdecl -norelay uregex_groupNumberFromCName() icuin68.uregex_groupNumberFromCName_68 +@ cdecl -norelay uregex_groupNumberFromName() icuin68.uregex_groupNumberFromName_68 +@ cdecl -norelay uregex_groupUText() icuin68.uregex_groupUText_68 +@ cdecl -norelay uregex_hasAnchoringBounds() icuin68.uregex_hasAnchoringBounds_68 +@ cdecl -norelay uregex_hasTransparentBounds() icuin68.uregex_hasTransparentBounds_68 +@ cdecl -norelay uregex_hitEnd() icuin68.uregex_hitEnd_68 +@ cdecl -norelay uregex_lookingAt() icuin68.uregex_lookingAt_68 +@ cdecl -norelay uregex_lookingAt64() icuin68.uregex_lookingAt64_68 +@ cdecl -norelay uregex_matches() icuin68.uregex_matches_68 +@ cdecl -norelay uregex_matches64() icuin68.uregex_matches64_68 +@ cdecl -norelay uregex_open() icuin68.uregex_open_68 +@ cdecl -norelay uregex_openC() icuin68.uregex_openC_68 +@ cdecl -norelay uregex_openUText() icuin68.uregex_openUText_68 +@ cdecl -norelay uregex_pattern() icuin68.uregex_pattern_68 +@ cdecl -norelay uregex_patternUText() icuin68.uregex_patternUText_68 +@ cdecl -norelay uregex_refreshUText() icuin68.uregex_refreshUText_68 +@ cdecl -norelay uregex_regionEnd() icuin68.uregex_regionEnd_68 +@ cdecl -norelay uregex_regionEnd64() icuin68.uregex_regionEnd64_68 +@ cdecl -norelay uregex_regionStart() icuin68.uregex_regionStart_68 +@ cdecl -norelay uregex_regionStart64() icuin68.uregex_regionStart64_68 +@ cdecl -norelay uregex_replaceAll() icuin68.uregex_replaceAll_68 +@ cdecl -norelay uregex_replaceAllUText() icuin68.uregex_replaceAllUText_68 +@ cdecl -norelay uregex_replaceFirst() icuin68.uregex_replaceFirst_68 +@ cdecl -norelay uregex_replaceFirstUText() icuin68.uregex_replaceFirstUText_68 +@ cdecl -norelay uregex_requireEnd() icuin68.uregex_requireEnd_68 +@ cdecl -norelay uregex_reset() icuin68.uregex_reset_68 +@ cdecl -norelay uregex_reset64() icuin68.uregex_reset64_68 +@ cdecl -norelay uregex_setFindProgressCallback() icuin68.uregex_setFindProgressCallback_68 +@ cdecl -norelay uregex_setMatchCallback() icuin68.uregex_setMatchCallback_68 +@ cdecl -norelay uregex_setRegion() icuin68.uregex_setRegion_68 +@ cdecl -norelay uregex_setRegion64() icuin68.uregex_setRegion64_68 +@ cdecl -norelay uregex_setRegionAndStart() icuin68.uregex_setRegionAndStart_68 +@ cdecl -norelay uregex_setStackLimit() icuin68.uregex_setStackLimit_68 +@ cdecl -norelay uregex_setText() icuin68.uregex_setText_68 +@ cdecl -norelay uregex_setTimeLimit() icuin68.uregex_setTimeLimit_68 +@ cdecl -norelay uregex_setUText() icuin68.uregex_setUText_68 +@ cdecl -norelay uregex_split() icuin68.uregex_split_68 +@ cdecl -norelay uregex_splitUText() icuin68.uregex_splitUText_68 +@ cdecl -norelay uregex_start() icuin68.uregex_start_68 +@ cdecl -norelay uregex_start64() icuin68.uregex_start64_68 +@ cdecl -norelay uregex_useAnchoringBounds() icuin68.uregex_useAnchoringBounds_68 +@ cdecl -norelay uregex_useTransparentBounds() icuin68.uregex_useTransparentBounds_68 +@ cdecl -norelay uregion_areEqual() icuin68.uregion_areEqual_68 +@ cdecl -norelay uregion_contains() icuin68.uregion_contains_68 +@ cdecl -norelay uregion_getAvailable() icuin68.uregion_getAvailable_68 +@ cdecl -norelay uregion_getContainedRegions() icuin68.uregion_getContainedRegions_68 +@ cdecl -norelay uregion_getContainedRegionsOfType() icuin68.uregion_getContainedRegionsOfType_68 +@ cdecl -norelay uregion_getContainingRegion() icuin68.uregion_getContainingRegion_68 +@ cdecl -norelay uregion_getContainingRegionOfType() icuin68.uregion_getContainingRegionOfType_68 +@ cdecl -norelay uregion_getNumericCode() icuin68.uregion_getNumericCode_68 +@ cdecl -norelay uregion_getPreferredValues() icuin68.uregion_getPreferredValues_68 +@ cdecl -norelay uregion_getRegionCode() icuin68.uregion_getRegionCode_68 +@ cdecl -norelay uregion_getRegionFromCode() icuin68.uregion_getRegionFromCode_68 +@ cdecl -norelay uregion_getRegionFromNumericCode() icuin68.uregion_getRegionFromNumericCode_68 +@ cdecl -norelay uregion_getType() icuin68.uregion_getType_68 +@ cdecl -norelay ureldatefmt_close() icuin68.ureldatefmt_close_68 +@ cdecl -norelay ureldatefmt_closeResult() icuin68.ureldatefmt_closeResult_68 +@ cdecl -norelay ureldatefmt_combineDateAndTime() icuin68.ureldatefmt_combineDateAndTime_68 +@ cdecl -norelay ureldatefmt_format() icuin68.ureldatefmt_format_68 +@ cdecl -norelay ureldatefmt_formatNumeric() icuin68.ureldatefmt_formatNumeric_68 +@ cdecl -norelay ureldatefmt_formatNumericToResult() icuin68.ureldatefmt_formatNumericToResult_68 +@ cdecl -norelay ureldatefmt_formatToResult() icuin68.ureldatefmt_formatToResult_68 +@ cdecl -norelay ureldatefmt_open() icuin68.ureldatefmt_open_68 +@ cdecl -norelay ureldatefmt_openResult() icuin68.ureldatefmt_openResult_68 +@ cdecl -norelay ureldatefmt_resultAsValue() icuin68.ureldatefmt_resultAsValue_68 +@ cdecl -norelay ures_close() icuuc68.ures_close_68 +@ cdecl -norelay ures_getBinary() icuuc68.ures_getBinary_68 +@ cdecl -norelay ures_getByIndex() icuuc68.ures_getByIndex_68 +@ cdecl -norelay ures_getByKey() icuuc68.ures_getByKey_68 +@ cdecl -norelay ures_getInt() icuuc68.ures_getInt_68 +@ cdecl -norelay ures_getIntVector() icuuc68.ures_getIntVector_68 +@ cdecl -norelay ures_getKey() icuuc68.ures_getKey_68 +@ cdecl -norelay ures_getLocaleByType() icuuc68.ures_getLocaleByType_68 +@ cdecl -norelay ures_getNextResource() icuuc68.ures_getNextResource_68 +@ cdecl -norelay ures_getNextString() icuuc68.ures_getNextString_68 +@ cdecl -norelay ures_getSize() icuuc68.ures_getSize_68 +@ cdecl -norelay ures_getString() icuuc68.ures_getString_68 +@ cdecl -norelay ures_getStringByIndex() icuuc68.ures_getStringByIndex_68 +@ cdecl -norelay ures_getStringByKey() icuuc68.ures_getStringByKey_68 +@ cdecl -norelay ures_getType() icuuc68.ures_getType_68 +@ cdecl -norelay ures_getUInt() icuuc68.ures_getUInt_68 +@ cdecl -norelay ures_getUTF8String() icuuc68.ures_getUTF8String_68 +@ cdecl -norelay ures_getUTF8StringByIndex() icuuc68.ures_getUTF8StringByIndex_68 +@ cdecl -norelay ures_getUTF8StringByKey() icuuc68.ures_getUTF8StringByKey_68 +@ cdecl -norelay ures_getVersion() icuuc68.ures_getVersion_68 +@ cdecl -norelay ures_hasNext() icuuc68.ures_hasNext_68 +@ cdecl -norelay ures_open() icuuc68.ures_open_68 +@ cdecl -norelay ures_openAvailableLocales() icuuc68.ures_openAvailableLocales_68 +@ cdecl -norelay ures_openDirect() icuuc68.ures_openDirect_68 +@ cdecl -norelay ures_openU() icuuc68.ures_openU_68 +@ cdecl -norelay ures_resetIterator() icuuc68.ures_resetIterator_68 +@ cdecl -norelay uscript_breaksBetweenLetters() icuuc68.uscript_breaksBetweenLetters_68 +@ cdecl -norelay uscript_getCode() icuuc68.uscript_getCode_68 +@ cdecl -norelay uscript_getName() icuuc68.uscript_getName_68 +@ cdecl -norelay uscript_getSampleString() icuuc68.uscript_getSampleString_68 +@ cdecl -norelay uscript_getScript() icuuc68.uscript_getScript_68 +@ cdecl -norelay uscript_getScriptExtensions() icuuc68.uscript_getScriptExtensions_68 +@ cdecl -norelay uscript_getShortName() icuuc68.uscript_getShortName_68 +@ cdecl -norelay uscript_getUsage() icuuc68.uscript_getUsage_68 +@ cdecl -norelay uscript_hasScript() icuuc68.uscript_hasScript_68 +@ cdecl -norelay uscript_isCased() icuuc68.uscript_isCased_68 +@ cdecl -norelay uscript_isRightToLeft() icuuc68.uscript_isRightToLeft_68 +@ cdecl -norelay usearch_close() icuin68.usearch_close_68 +@ cdecl -norelay usearch_first() icuin68.usearch_first_68 +@ cdecl -norelay usearch_following() icuin68.usearch_following_68 +@ cdecl -norelay usearch_getAttribute() icuin68.usearch_getAttribute_68 +@ cdecl -norelay usearch_getBreakIterator() icuin68.usearch_getBreakIterator_68 +@ cdecl -norelay usearch_getCollator() icuin68.usearch_getCollator_68 +@ cdecl -norelay usearch_getMatchedLength() icuin68.usearch_getMatchedLength_68 +@ cdecl -norelay usearch_getMatchedStart() icuin68.usearch_getMatchedStart_68 +@ cdecl -norelay usearch_getMatchedText() icuin68.usearch_getMatchedText_68 +@ cdecl -norelay usearch_getOffset() icuin68.usearch_getOffset_68 +@ cdecl -norelay usearch_getPattern() icuin68.usearch_getPattern_68 +@ cdecl -norelay usearch_getText() icuin68.usearch_getText_68 +@ cdecl -norelay usearch_last() icuin68.usearch_last_68 +@ cdecl -norelay usearch_next() icuin68.usearch_next_68 +@ cdecl -norelay usearch_open() icuin68.usearch_open_68 +@ cdecl -norelay usearch_openFromCollator() icuin68.usearch_openFromCollator_68 +@ cdecl -norelay usearch_preceding() icuin68.usearch_preceding_68 +@ cdecl -norelay usearch_previous() icuin68.usearch_previous_68 +@ cdecl -norelay usearch_reset() icuin68.usearch_reset_68 +@ cdecl -norelay usearch_setAttribute() icuin68.usearch_setAttribute_68 +@ cdecl -norelay usearch_setBreakIterator() icuin68.usearch_setBreakIterator_68 +@ cdecl -norelay usearch_setCollator() icuin68.usearch_setCollator_68 +@ cdecl -norelay usearch_setOffset() icuin68.usearch_setOffset_68 +@ cdecl -norelay usearch_setPattern() icuin68.usearch_setPattern_68 +@ cdecl -norelay usearch_setText() icuin68.usearch_setText_68 +@ cdecl -norelay uset_add() icuuc68.uset_add_68 +@ cdecl -norelay uset_addAll() icuuc68.uset_addAll_68 +@ cdecl -norelay uset_addAllCodePoints() icuuc68.uset_addAllCodePoints_68 +@ cdecl -norelay uset_addRange() icuuc68.uset_addRange_68 +@ cdecl -norelay uset_addString() icuuc68.uset_addString_68 +@ cdecl -norelay uset_applyIntPropertyValue() icuuc68.uset_applyIntPropertyValue_68 +@ cdecl -norelay uset_applyPattern() icuuc68.uset_applyPattern_68 +@ cdecl -norelay uset_applyPropertyAlias() icuuc68.uset_applyPropertyAlias_68 +@ cdecl -norelay uset_charAt() icuuc68.uset_charAt_68 +@ cdecl -norelay uset_clear() icuuc68.uset_clear_68 +@ cdecl -norelay uset_clone() icuuc68.uset_clone_68 +@ cdecl -norelay uset_cloneAsThawed() icuuc68.uset_cloneAsThawed_68 +@ cdecl -norelay uset_close() icuuc68.uset_close_68 +@ cdecl -norelay uset_closeOver() icuuc68.uset_closeOver_68 +@ cdecl -norelay uset_compact() icuuc68.uset_compact_68 +@ cdecl -norelay uset_complement() icuuc68.uset_complement_68 +@ cdecl -norelay uset_complementAll() icuuc68.uset_complementAll_68 +@ cdecl -norelay uset_contains() icuuc68.uset_contains_68 +@ cdecl -norelay uset_containsAll() icuuc68.uset_containsAll_68 +@ cdecl -norelay uset_containsAllCodePoints() icuuc68.uset_containsAllCodePoints_68 +@ cdecl -norelay uset_containsNone() icuuc68.uset_containsNone_68 +@ cdecl -norelay uset_containsRange() icuuc68.uset_containsRange_68 +@ cdecl -norelay uset_containsSome() icuuc68.uset_containsSome_68 +@ cdecl -norelay uset_containsString() icuuc68.uset_containsString_68 +@ cdecl -norelay uset_equals() icuuc68.uset_equals_68 +@ cdecl -norelay uset_freeze() icuuc68.uset_freeze_68 +@ cdecl -norelay uset_getItem() icuuc68.uset_getItem_68 +@ cdecl -norelay uset_getItemCount() icuuc68.uset_getItemCount_68 +@ cdecl -norelay uset_getSerializedRange() icuuc68.uset_getSerializedRange_68 +@ cdecl -norelay uset_getSerializedRangeCount() icuuc68.uset_getSerializedRangeCount_68 +@ cdecl -norelay uset_getSerializedSet() icuuc68.uset_getSerializedSet_68 +@ cdecl -norelay uset_indexOf() icuuc68.uset_indexOf_68 +@ cdecl -norelay uset_isEmpty() icuuc68.uset_isEmpty_68 +@ cdecl -norelay uset_isFrozen() icuuc68.uset_isFrozen_68 +@ cdecl -norelay uset_open() icuuc68.uset_open_68 +@ cdecl -norelay uset_openEmpty() icuuc68.uset_openEmpty_68 +@ cdecl -norelay uset_openPattern() icuuc68.uset_openPattern_68 +@ cdecl -norelay uset_openPatternOptions() icuuc68.uset_openPatternOptions_68 +@ cdecl -norelay uset_remove() icuuc68.uset_remove_68 +@ cdecl -norelay uset_removeAll() icuuc68.uset_removeAll_68 +@ cdecl -norelay uset_removeAllStrings() icuuc68.uset_removeAllStrings_68 +@ cdecl -norelay uset_removeRange() icuuc68.uset_removeRange_68 +@ cdecl -norelay uset_removeString() icuuc68.uset_removeString_68 +@ cdecl -norelay uset_resemblesPattern() icuuc68.uset_resemblesPattern_68 +@ cdecl -norelay uset_retain() icuuc68.uset_retain_68 +@ cdecl -norelay uset_retainAll() icuuc68.uset_retainAll_68 +@ cdecl -norelay uset_serialize() icuuc68.uset_serialize_68 +@ cdecl -norelay uset_serializedContains() icuuc68.uset_serializedContains_68 +@ cdecl -norelay uset_set() icuuc68.uset_set_68 +@ cdecl -norelay uset_setSerializedToOne() icuuc68.uset_setSerializedToOne_68 +@ cdecl -norelay uset_size() icuuc68.uset_size_68 +@ cdecl -norelay uset_span() icuuc68.uset_span_68 +@ cdecl -norelay uset_spanBack() icuuc68.uset_spanBack_68 +@ cdecl -norelay uset_spanBackUTF8() icuuc68.uset_spanBackUTF8_68 +@ cdecl -norelay uset_spanUTF8() icuuc68.uset_spanUTF8_68 +@ cdecl -norelay uset_toPattern() icuuc68.uset_toPattern_68 +@ cdecl -norelay uspoof_areConfusable() icuin68.uspoof_areConfusable_68 +@ cdecl -norelay uspoof_areConfusableUTF8() icuin68.uspoof_areConfusableUTF8_68 +@ cdecl -norelay uspoof_check() icuin68.uspoof_check_68 +@ cdecl -norelay uspoof_check2() icuin68.uspoof_check2_68 +@ cdecl -norelay uspoof_check2UTF8() icuin68.uspoof_check2UTF8_68 +@ cdecl -norelay uspoof_checkUTF8() icuin68.uspoof_checkUTF8_68 +@ cdecl -norelay uspoof_clone() icuin68.uspoof_clone_68 +@ cdecl -norelay uspoof_close() icuin68.uspoof_close_68 +@ cdecl -norelay uspoof_closeCheckResult() icuin68.uspoof_closeCheckResult_68 +@ cdecl -norelay uspoof_getAllowedChars() icuin68.uspoof_getAllowedChars_68 +@ cdecl -norelay uspoof_getAllowedLocales() icuin68.uspoof_getAllowedLocales_68 +@ cdecl -norelay uspoof_getCheckResultChecks() icuin68.uspoof_getCheckResultChecks_68 +@ cdecl -norelay uspoof_getCheckResultNumerics() icuin68.uspoof_getCheckResultNumerics_68 +@ cdecl -norelay uspoof_getCheckResultRestrictionLevel() icuin68.uspoof_getCheckResultRestrictionLevel_68 +@ cdecl -norelay uspoof_getChecks() icuin68.uspoof_getChecks_68 +@ cdecl -norelay uspoof_getInclusionSet() icuin68.uspoof_getInclusionSet_68 +@ cdecl -norelay uspoof_getRecommendedSet() icuin68.uspoof_getRecommendedSet_68 +@ cdecl -norelay uspoof_getRestrictionLevel() icuin68.uspoof_getRestrictionLevel_68 +@ cdecl -norelay uspoof_getSkeleton() icuin68.uspoof_getSkeleton_68 +@ cdecl -norelay uspoof_getSkeletonUTF8() icuin68.uspoof_getSkeletonUTF8_68 +@ cdecl -norelay uspoof_open() icuin68.uspoof_open_68 +@ cdecl -norelay uspoof_openCheckResult() icuin68.uspoof_openCheckResult_68 +@ cdecl -norelay uspoof_openFromSerialized() icuin68.uspoof_openFromSerialized_68 +@ cdecl -norelay uspoof_openFromSource() icuin68.uspoof_openFromSource_68 +@ cdecl -norelay uspoof_serialize() icuin68.uspoof_serialize_68 +@ cdecl -norelay uspoof_setAllowedChars() icuin68.uspoof_setAllowedChars_68 +@ cdecl -norelay uspoof_setAllowedLocales() icuin68.uspoof_setAllowedLocales_68 +@ cdecl -norelay uspoof_setChecks() icuin68.uspoof_setChecks_68 +@ cdecl -norelay uspoof_setRestrictionLevel() icuin68.uspoof_setRestrictionLevel_68 +@ cdecl -norelay usprep_close() icuuc68.usprep_close_68 +@ cdecl -norelay usprep_open() icuuc68.usprep_open_68 +@ cdecl -norelay usprep_openByType() icuuc68.usprep_openByType_68 +@ cdecl -norelay usprep_prepare() icuuc68.usprep_prepare_68 +@ cdecl -norelay utext_char32At() icuuc68.utext_char32At_68 +@ cdecl -norelay utext_clone() icuuc68.utext_clone_68 +@ cdecl -norelay utext_close() icuuc68.utext_close_68 +@ cdecl -norelay utext_copy() icuuc68.utext_copy_68 +@ cdecl -norelay utext_current32() icuuc68.utext_current32_68 +@ cdecl -norelay utext_equals() icuuc68.utext_equals_68 +@ cdecl -norelay utext_extract() icuuc68.utext_extract_68 +@ cdecl -norelay utext_freeze() icuuc68.utext_freeze_68 +@ cdecl -norelay utext_getNativeIndex() icuuc68.utext_getNativeIndex_68 +@ cdecl -norelay utext_getPreviousNativeIndex() icuuc68.utext_getPreviousNativeIndex_68 +@ cdecl -norelay utext_hasMetaData() icuuc68.utext_hasMetaData_68 +@ cdecl -norelay utext_isLengthExpensive() icuuc68.utext_isLengthExpensive_68 +@ cdecl -norelay utext_isWritable() icuuc68.utext_isWritable_68 +@ cdecl -norelay utext_moveIndex32() icuuc68.utext_moveIndex32_68 +@ cdecl -norelay utext_nativeLength() icuuc68.utext_nativeLength_68 +@ cdecl -norelay utext_next32() icuuc68.utext_next32_68 +@ cdecl -norelay utext_next32From() icuuc68.utext_next32From_68 +@ cdecl -norelay utext_openUChars() icuuc68.utext_openUChars_68 +@ cdecl -norelay utext_openUTF8() icuuc68.utext_openUTF8_68 +@ cdecl -norelay utext_previous32() icuuc68.utext_previous32_68 +@ cdecl -norelay utext_previous32From() icuuc68.utext_previous32From_68 +@ cdecl -norelay utext_replace() icuuc68.utext_replace_68 +@ cdecl -norelay utext_setNativeIndex() icuuc68.utext_setNativeIndex_68 +@ cdecl -norelay utext_setup() icuuc68.utext_setup_68 +@ cdecl -norelay utf8_appendCharSafeBody() icuuc68.utf8_appendCharSafeBody_68 +@ cdecl -norelay utf8_back1SafeBody() icuuc68.utf8_back1SafeBody_68 +@ cdecl -norelay utf8_nextCharSafeBody() icuuc68.utf8_nextCharSafeBody_68 +@ cdecl -norelay utf8_prevCharSafeBody() icuuc68.utf8_prevCharSafeBody_68 +@ cdecl -norelay utmscale_fromInt64() icuin68.utmscale_fromInt64_68 +@ cdecl -norelay utmscale_getTimeScaleValue() icuin68.utmscale_getTimeScaleValue_68 +@ cdecl -norelay utmscale_toInt64() icuin68.utmscale_toInt64_68 +@ cdecl -norelay utrace_format() icuuc68.utrace_format_68 +@ cdecl -norelay utrace_functionName() icuuc68.utrace_functionName_68 +@ cdecl -norelay utrace_getFunctions() icuuc68.utrace_getFunctions_68 +@ cdecl -norelay utrace_getLevel() icuuc68.utrace_getLevel_68 +@ cdecl -norelay utrace_setFunctions() icuuc68.utrace_setFunctions_68 +@ cdecl -norelay utrace_setLevel() icuuc68.utrace_setLevel_68 +@ cdecl -norelay utrace_vformat() icuuc68.utrace_vformat_68 +@ cdecl -norelay utrans_clone() icuin68.utrans_clone_68 +@ cdecl -norelay utrans_close() icuin68.utrans_close_68 +@ cdecl -norelay utrans_countAvailableIDs() icuin68.utrans_countAvailableIDs_68 +@ cdecl -norelay utrans_getSourceSet() icuin68.utrans_getSourceSet_68 +@ cdecl -norelay utrans_getUnicodeID() icuin68.utrans_getUnicodeID_68 +@ cdecl -norelay utrans_openIDs() icuin68.utrans_openIDs_68 +@ cdecl -norelay utrans_openInverse() icuin68.utrans_openInverse_68 +@ cdecl -norelay utrans_openU() icuin68.utrans_openU_68 +@ cdecl -norelay utrans_register() icuin68.utrans_register_68 +@ cdecl -norelay utrans_setFilter() icuin68.utrans_setFilter_68 +@ cdecl -norelay utrans_toRules() icuin68.utrans_toRules_68 +@ cdecl -norelay utrans_trans() icuin68.utrans_trans_68 +@ cdecl -norelay utrans_transIncremental() icuin68.utrans_transIncremental_68 +@ cdecl -norelay utrans_transIncrementalUChars() icuin68.utrans_transIncrementalUChars_68 +@ cdecl -norelay utrans_transUChars() icuin68.utrans_transUChars_68 +@ cdecl -norelay utrans_unregisterID() icuin68.utrans_unregisterID_68 From 9b07393f0c83d5cd845b64de56b45e82fa9ceb35 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 6 Nov 2024 14:59:05 -0600 Subject: [PATCH 0842/2542] opengl32: HACK: Do not check for extensions in wglGetProcAddress() for Chromacell. CW-Bug-Id: #24443 --- dlls/opengl32/unix_wgl.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 6e6fcdf76078..5ebe8ce9a382 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -574,6 +574,23 @@ static int registry_entry_cmp( const void *a, const void *b ) return strcmp( entry_a->name, entry_b->name ); } +static BOOL ignore_extenstions_for_get_proc_address(void) +{ + static int cached = -1; + + if (cached == -1) + { + const char *sgi; + + cached = (sgi = getenv( "SteamGameId" )) && ( + !strcmp( sgi, "2293310" ) + || !strcmp( sgi, "2914160" ) + ); + } + + return cached; +} + static PROC wrap_wglGetProcAddress( TEB *teb, LPCSTR name ) { const struct registry_entry entry = {.name = name}, *found; @@ -600,7 +617,7 @@ static PROC wrap_wglGetProcAddress( TEB *teb, LPCSTR name ) { void *driver_func = funcs->wgl.p_wglGetProcAddress( name ); - if (!is_extension_supported( teb, found->extension )) + if (!ignore_extenstions_for_get_proc_address() && !is_extension_supported( teb, found->extension )) { unsigned int i; static const struct { const char *name, *alt; } alternatives[] = From 51348c5c4424e06ef400bfb7549ec8c7ffa329a4 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 16 May 2024 21:27:08 -0600 Subject: [PATCH 0843/2542] ntdll: Fill object pointer in NtQueryInformation( SystemHandleInformation / SystemExtendedHandleInformation ). CW-Bug-Id: #23813 --- dlls/ntdll/tests/info.c | 37 +++++++++++++++++++++++++++++++------ dlls/ntdll/unix/system.c | 4 ++-- server/handle.c | 1 + server/protocol.def | 2 ++ tools/make_requests | 2 +- 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index 7486c2028385..94dbecf0123a 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -852,12 +852,17 @@ static void test_query_handle(void) ULONG ExpectedLength, ReturnLength; ULONG SystemInformationLength = sizeof(SYSTEM_HANDLE_INFORMATION); SYSTEM_HANDLE_INFORMATION* shi = HeapAlloc(GetProcessHeap(), 0, SystemInformationLength); - HANDLE EventHandle; + HANDLE EventHandle, handle_dup; + void *obj1, *obj2; BOOL found, ret; INT i; EventHandle = CreateEventA(NULL, FALSE, FALSE, NULL); ok( EventHandle != NULL, "CreateEventA failed %lu\n", GetLastError() ); + + ret = DuplicateHandle(GetCurrentProcess(), EventHandle, GetCurrentProcess(), &handle_dup, 0, TRUE, DUPLICATE_SAME_ACCESS); + ok(ret, "got error %lu\n", GetLastError()); + ret = SetHandleInformation(EventHandle, HANDLE_FLAG_INHERIT | HANDLE_FLAG_PROTECT_FROM_CLOSE, HANDLE_FLAG_INHERIT | HANDLE_FLAG_PROTECT_FROM_CLOSE); ok(ret, "got error %lu\n", GetLastError()); @@ -881,6 +886,7 @@ static void test_query_handle(void) memset(shi, 0x55, SystemInformationLength); status = pNtQuerySystemInformation(SystemHandleInformation, shi, SystemInformationLength, &ReturnLength); } + CloseHandle(handle_dup); ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08lx\n", status ); ExpectedLength = FIELD_OFFSET(SYSTEM_HANDLE_INFORMATION, Handle[shi->Count]); ok( ReturnLength == ExpectedLength || broken(ReturnLength == ExpectedLength - sizeof(DWORD)), /* Vista / 2008 */ @@ -895,19 +901,37 @@ static void test_query_handle(void) goto done; } - found = FALSE; + obj1 = obj2 = (void *)0xdeadbeef; for (i = 0; i < shi->Count; i++) { if (shi->Handle[i].OwnerPid == GetCurrentProcessId() && (HANDLE)(ULONG_PTR)shi->Handle[i].HandleValue == EventHandle) { + ok(obj1 == (void *)0xdeadbeef, "Found duplicate.\n"); ok(shi->Handle[i].HandleFlags == (OBJ_INHERIT | OBJ_PROTECT_CLOSE), "got attributes %#x\n", shi->Handle[i].HandleFlags); - found = TRUE; - break; + obj1 = shi->Handle[i].ObjectPointer; + } + if (shi->Handle[i].OwnerPid == GetCurrentProcessId() && + (HANDLE)(ULONG_PTR)shi->Handle[i].HandleValue == handle_dup) + { + ok(obj2 == (void *)0xdeadbeef, "Found duplicate.\n"); + ok(shi->Handle[i].HandleFlags == OBJ_INHERIT, "got attributes %#x\n", shi->Handle[i].HandleFlags); + obj2 = shi->Handle[i].ObjectPointer; } + ok((ULONG_PTR)shi->Handle[i].ObjectPointer > (ULONG_PTR)0xffff800000000000, "got %p.\n", + shi->Handle[i].ObjectPointer); + } + ok(obj1 != (void *)0xdeadbeef, "Didn't find %p (pid %lx).\n", EventHandle, GetCurrentProcessId()); + ok(obj1 == obj2, "got %p, %p.\n", obj1, obj2); + + for (i = 0; i < shi->Count; i++) + { + if (!(shi->Handle[i].OwnerPid == GetCurrentProcessId() + && ((HANDLE)(ULONG_PTR)shi->Handle[i].HandleValue == EventHandle + || (HANDLE)(ULONG_PTR)shi->Handle[i].HandleValue == handle_dup))) + ok(shi->Handle[i].ObjectPointer != obj1, "Got same object.\n"); } - ok( found, "Expected to find event handle %p (pid %lx) in handle list\n", EventHandle, GetCurrentProcessId() ); ret = SetHandleInformation(EventHandle, HANDLE_FLAG_PROTECT_FROM_CLOSE, 0); ok(ret, "got error %lu\n", GetLastError()); @@ -997,11 +1021,12 @@ static void test_query_handle_ex(void) found = FALSE; for (i = 0; i < info->NumberOfHandles; ++i) { + ok((ULONG_PTR)info->Handles[i].Object > (ULONG_PTR)0xffff800000000000, "got %p.\n", info->Handles[i].Object); if (info->Handles[i].UniqueProcessId == GetCurrentProcessId() && (HANDLE)info->Handles[i].HandleValue == event) { + ok(!found, "Found duplicate.\n"); found = TRUE; - break; } } ok(!found, "event handle found\n"); diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index f1387cbdec78..7936479f29be 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -3442,7 +3442,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, shi->Handle[i].AccessMask = handle_info[i].access; shi->Handle[i].HandleFlags = handle_info[i].attributes; shi->Handle[i].ObjectType = handle_info[i].type; - /* FIXME: Fill out ObjectPointer */ + shi->Handle[i].ObjectPointer = wine_server_get_ptr( handle_info[i].object ); } } else if (ret == STATUS_BUFFER_TOO_SMALL) @@ -3663,7 +3663,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, shi->Handles[i].GrantedAccess = handle_info[i].access; shi->Handles[i].HandleAttributes = handle_info[i].attributes; shi->Handles[i].ObjectTypeIndex = handle_info[i].type; - /* FIXME: Fill out Object */ + shi->Handles[i].Object = wine_server_get_ptr( handle_info[i].object ); } } else if (ret == STATUS_BUFFER_TOO_SMALL) diff --git a/server/handle.c b/server/handle.c index f93724ce74f7..2dca6d8155d7 100644 --- a/server/handle.c +++ b/server/handle.c @@ -867,6 +867,7 @@ static int enum_handles( struct process *process, void *user ) handle->access = entry->access & ~RESERVED_ALL; handle->type = entry->ptr->ops->type->index; handle->attributes = 0; + handle->object = (client_ptr_t)(ULONG_PTR)entry->ptr | (client_ptr_t)0xffff800000000000; if (entry->access & RESERVED_INHERIT) handle->attributes |= OBJ_INHERIT; if (entry->access & RESERVED_CLOSE_PROTECT) handle->attributes |= OBJ_PROTECT_CLOSE; info->count--; diff --git a/server/protocol.def b/server/protocol.def index 4c0a268282b0..4a4ac3772104 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -3542,11 +3542,13 @@ enum caret_state struct handle_info { + client_ptr_t object; process_id_t owner; obj_handle_t handle; unsigned int access; unsigned int attributes; unsigned int type; + unsigned int __pad; }; /* Return a list of all opened handles */ diff --git a/tools/make_requests b/tools/make_requests index 495a0ac75dbb..53c57c1615c2 100755 --- a/tools/make_requests +++ b/tools/make_requests @@ -47,7 +47,7 @@ my %formats = "union debug_event_data" => [ 160, 8 ], "struct filesystem_event" => [ 12, 4 ], "struct generic_map" => [ 16, 4 ], - "struct handle_info" => [ 20, 4 ], + "struct handle_info" => [ 32, 8 ], "union hw_input" => [ 40, 8 ], "union irp_params" => [ 32, 8 ], "struct luid" => [ 8, 4 ], From f4a63f5fb536402d8eaf4ea9f7cbb180a5f736a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 21 Nov 2023 21:34:17 +0100 Subject: [PATCH 0844/2542] HACK: winegstreamer/wm_reader: Use OpenGL video processing pipeline for WMReader. There's many 32-bit games using either the WM reader or the ASF reader filter, and which require conversion from I420 to RGBA. However, ORC fails to create an optimized routine as it doesn't support spilling vector registers and it needs more than what's available in 32-bit x86. The WM reader (and the ASF reader filter) currently reads audio and video samples synchronously, and having a high video decoding latency causes trouble on the audio stream. Using OpenGL to post-process the video, and more specifically for the color conversion makes it generally faster, enough to solve the problem in most cases. CW-Bug-Id: #18799 CW-Bug-Id: #18994 CW-Bug-Id: #20182 CW-Bug-Id: #20363 CW-Bug-Id: #20905 CW-Bug-Id: #20980 --- configure.ac | 2 +- dlls/winegstreamer/gst_private.h | 2 +- dlls/winegstreamer/main.c | 3 +- dlls/winegstreamer/media_source.c | 2 +- dlls/winegstreamer/quartz_parser.c | 2 +- dlls/winegstreamer/unixlib.c | 30 +++++++++++++++++-- dlls/winegstreamer/unixlib.h | 1 + dlls/winegstreamer/wg_parser.c | 48 +++++++++++++++++++++++++++++- dlls/winegstreamer/wm_reader.c | 7 +++-- 9 files changed, 86 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 34fc1785697a..15e0914ca5b0 100644 --- a/configure.ac +++ b/configure.ac @@ -1676,7 +1676,7 @@ WINE_NOTICE_WITH(ffmpeg,[test "x$FFMPEG_LIBS" = x], dnl **** Check for gstreamer **** if test "x$with_gstreamer" != "xno" then - WINE_PACKAGE_FLAGS(GSTREAMER,[gstreamer-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-tag-1.0],,,, + WINE_PACKAGE_FLAGS(GSTREAMER,[gstreamer-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-tag-1.0 gstreamer-gl-1.0],,,, [AC_CHECK_HEADER([gst/gst.h], [AC_MSG_CHECKING([whether gint64 defined by gst/gst.h is indeed 64-bit]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index f9f0048bbe1a..aa76b4d73241 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -72,7 +72,7 @@ HRESULT wg_sample_queue_create(struct wg_sample_queue **out); void wg_sample_queue_destroy(struct wg_sample_queue *queue); void wg_sample_queue_flush(struct wg_sample_queue *queue, bool all); -wg_parser_t wg_parser_create(bool output_compressed); +wg_parser_t wg_parser_create(bool output_compressed, bool use_opengl); void wg_parser_destroy(wg_parser_t parser); HRESULT wg_parser_connect(wg_parser_t parser, uint64_t file_size, const WCHAR *uri); diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c index d18db8b21e88..c1b7a7a7bdae 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c @@ -163,11 +163,12 @@ static HRESULT wg_media_type_to_mf(const struct wg_media_type *wg_media_type, IM return E_NOTIMPL; } -wg_parser_t wg_parser_create(bool output_compressed) +wg_parser_t wg_parser_create(bool output_compressed, bool use_opengl) { struct wg_parser_create_params params = { .output_compressed = output_compressed, + .use_opengl = use_opengl, .err_on = ERR_ON(quartz), .warn_on = WARN_ON(quartz), }; diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index caaf8d16b96a..850752564205 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -1740,7 +1740,7 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc if (FAILED(hr = MFAllocateWorkQueue(&object->async_commands_queue))) goto fail; - if (!(parser = wg_parser_create(FALSE))) + if (!(parser = wg_parser_create(FALSE, FALSE))) { hr = E_OUTOFMEMORY; goto fail; diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index 581ea3af8ab0..c1dc0d7951f3 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -1717,7 +1717,7 @@ static HRESULT parser_create(BOOL output_compressed, struct parser **parser) if (!(object = calloc(1, sizeof(*object)))) return E_OUTOFMEMORY; - if (!(object->wg_parser = wg_parser_create(output_compressed))) + if (!(object->wg_parser = wg_parser_create(output_compressed, FALSE))) { free(object); return E_OUTOFMEMORY; diff --git a/dlls/winegstreamer/unixlib.c b/dlls/winegstreamer/unixlib.c index a0d7286cc32d..a82ebd6461bd 100644 --- a/dlls/winegstreamer/unixlib.c +++ b/dlls/winegstreamer/unixlib.c @@ -28,10 +28,9 @@ #include #include +#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_30 #include -#include -#include -#include +#include #include "ntstatus.h" #define WIN32_NO_STATUS @@ -48,6 +47,7 @@ GST_DEBUG_CATEGORY(wine); static UINT thread_count; +GstGLDisplay *gl_display; GstStreamType stream_type_from_caps(GstCaps *caps) { @@ -259,6 +259,8 @@ static ULONG popcount(ULONG val) NTSTATUS wg_init_gstreamer(void *arg) { + static GstGLContext *gl_context; + struct wg_init_gstreamer_params *params = arg; char arg0[] = "wine"; char arg1[] = "--gst-disable-registry-fork"; @@ -319,6 +321,28 @@ NTSTATUS wg_init_gstreamer(void *arg) GST_INFO("GStreamer library version %s; wine built with %d.%d.%d.", gst_version_string(), GST_VERSION_MAJOR, GST_VERSION_MINOR, GST_VERSION_MICRO); + if (!(gl_display = gst_gl_display_new())) + GST_ERROR("Failed to create OpenGL display"); + else + { + GError *error = NULL; + gboolean ret; + + GST_OBJECT_LOCK(gl_display); + ret = gst_gl_display_create_context(gl_display, NULL, &gl_context, &error); + GST_OBJECT_UNLOCK(gl_display); + g_clear_error(&error); + + if (ret) + gst_gl_display_add_context(gl_display, gl_context); + else + { + GST_ERROR("Failed to create OpenGL context"); + gst_object_unref(gl_display); + gl_display = NULL; + } + } + if (!media_converter_init()) { GST_ERROR("Failed to init media converter."); diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h index 7e87fd565309..d12819a9b9b9 100644 --- a/dlls/winegstreamer/unixlib.h +++ b/dlls/winegstreamer/unixlib.h @@ -220,6 +220,7 @@ struct wg_parser_create_params { wg_parser_t parser; UINT8 output_compressed; + UINT8 use_opengl; UINT8 err_on; UINT8 warn_on; }; diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index f3e89979d6be..0e7d18a316ae 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -36,6 +36,8 @@ #include #include +#include + #include "ntstatus.h" #define WIN32_NO_STATUS #include "winternl.h" @@ -43,6 +45,8 @@ #include "unix_private.h" +extern GstGLDisplay *gl_display; + typedef enum { GST_AUTOPLUG_SELECT_TRY, @@ -99,6 +103,8 @@ struct wg_parser struct input_cache_chunk input_cache_chunks[4]; bool use_mediaconv; + bool use_opengl; + GstContext *context; }; static const unsigned int input_cache_chunk_size = 512 << 10; @@ -928,7 +934,32 @@ static bool stream_create_post_processing_elements(GstPad *pad, struct wg_parser name = gst_structure_get_name(gst_caps_get_structure(caps, 0)); gst_caps_unref(caps); - if (!strcmp(name, "video/x-raw")) + if (!strcmp(name, "video/x-raw") && parser->use_opengl) + { + if (!(element = create_element("glupload", "base")) + || !append_element(parser->container, element, &first, &last)) + return false; + if (!(element = create_element("glcolorconvert", "base")) + || !append_element(parser->container, element, &first, &last)) + return false; + if (!(element = create_element("glvideoflip", "base")) + || !append_element(parser->container, element, &first, &last)) + return false; + stream->flip = element; + if (!(element = create_element("gldeinterlace", "base")) + || !append_element(parser->container, element, &first, &last)) + return false; + if (!(element = create_element("glcolorconvert", "base")) + || !append_element(parser->container, element, &first, &last)) + return false; + if (!(element = create_element("gldownload", "base")) + || !append_element(parser->container, element, &first, &last)) + return false; + + if (!link_src_to_element(pad, first) || !link_element_to_sink(last, stream->my_sink)) + return false; + } + else if (!strcmp(name, "video/x-raw")) { /* Hack?: Flatten down the colorimetry to default values, without * actually modifying the video at all. @@ -1722,6 +1753,8 @@ static NTSTATUS wg_parser_connect(void *args) parser->container = gst_bin_new(NULL); gst_element_set_bus(parser->container, parser->bus); + if (parser->context) + gst_element_set_context(parser->container, parser->context); parser->my_src = gst_pad_new_from_static_template(&src_template, "quartz-src"); gst_pad_set_getrange_function(parser->my_src, src_getrange_cb); @@ -1971,6 +2004,16 @@ static NTSTATUS wg_parser_create(void *args) if (!(parser = calloc(1, sizeof(*parser)))) return E_OUTOFMEMORY; + if ((parser->use_opengl = params->use_opengl && gl_display)) + { + if ((parser->context = gst_context_new(GST_GL_DISPLAY_CONTEXT_TYPE, false))) + gst_context_set_gl_display(parser->context, gl_display); + else + { + GST_ERROR("Failed to create parser context"); + parser->use_opengl = FALSE; + } + } pthread_mutex_init(&parser->mutex, NULL); pthread_cond_init(&parser->init_cond, NULL); @@ -1994,6 +2037,9 @@ static NTSTATUS wg_parser_destroy(void *args) gst_object_unref(parser->bus); } + if (parser->context) + gst_context_unref(parser->context); + pthread_mutex_destroy(&parser->mutex); pthread_cond_destroy(&parser->init_cond); pthread_cond_destroy(&parser->read_cond); diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index e1495289fb0e..950c8b018ab7 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -1473,7 +1473,10 @@ static HRESULT init_stream(struct wm_reader *reader) HRESULT hr; WORD i; - if (!(wg_parser = wg_parser_create(FALSE))) + /* 32-bit GStreamer ORC cannot efficiently convert I420 to RGBA, use OpenGL converter + * in that case but keep the usual codepath otherwise. + */ + if (!(wg_parser = wg_parser_create(FALSE, sizeof(void *) == 4))) return E_OUTOFMEMORY; reader->wg_parser = wg_parser; @@ -1591,7 +1594,7 @@ static HRESULT reinit_stream(struct wm_reader *reader, bool read_compressed) wg_parser_destroy(reader->wg_parser); reader->wg_parser = 0; - if (!(wg_parser = wg_parser_create(read_compressed))) + if (!(wg_parser = wg_parser_create(read_compressed, sizeof(void *) == 4 && !read_compressed))) return E_OUTOFMEMORY; reader->wg_parser = wg_parser; From 6165c693dee32865e1ae727e66726cc9b2140f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 6 Jul 2021 14:06:11 +0200 Subject: [PATCH 0845/2542] HACK: quartz: Keep a reference on the IMediaPosition interface. In the same way we do for IMediaSeeking. Both interfaces are actually implemented with a shared refcount and releasing both makes the filter be destroyed. For Tokyo Xanadu eX+ crash on launch. CW-Bug-Id: #18994 --- dlls/quartz/filtergraph.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index b5a506c563a5..ba1fe8a9704e 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -74,6 +74,7 @@ struct filter struct list entry; IBaseFilter *filter; IMediaSeeking *seeking; + IMediaPosition *position; WCHAR *name; BOOL sorting; }; @@ -564,6 +565,7 @@ static BOOL has_output_pins(IBaseFilter *filter) static void update_seeking(struct filter *filter) { + IMediaPosition *position; IMediaSeeking *seeking; if (!filter->seeking) @@ -582,11 +584,19 @@ static void update_seeking(struct filter *filter) IMediaSeeking_Release(seeking); } } + + if (!filter->position) + { + /* Tokyo Xanadu eX+, same as above, same developer, destroys its filter when + * its IMediaPosition interface is released, so cache the interface instead + * of querying for it every time. */ + if (SUCCEEDED(IBaseFilter_QueryInterface(filter->filter, &IID_IMediaPosition, (void **)&position))) + filter->position = position; + } } static BOOL is_renderer(struct filter *filter) { - IMediaPosition *media_position; IAMFilterMiscFlags *flags; BOOL ret = FALSE; @@ -596,16 +606,11 @@ static BOOL is_renderer(struct filter *filter) ret = TRUE; IAMFilterMiscFlags_Release(flags); } - else if (SUCCEEDED(IBaseFilter_QueryInterface(filter->filter, &IID_IMediaPosition, (void **)&media_position))) - { - if (!has_output_pins(filter->filter)) - ret = TRUE; - IMediaPosition_Release(media_position); - } else { update_seeking(filter); - if (filter->seeking && !has_output_pins(filter->filter)) + if ((filter->seeking || filter->position) && + !has_output_pins(filter->filter)) ret = TRUE; } return ret; @@ -678,6 +683,7 @@ static HRESULT WINAPI FilterGraph2_AddFilter(IFilterGraph2 *iface, list_add_head(&graph->filters, &entry->entry); entry->sorting = FALSE; entry->seeking = NULL; + entry->position = NULL; ++graph->version; return duplicate_name ? VFW_S_DUPLICATE_NAME : hr; @@ -745,6 +751,8 @@ static HRESULT WINAPI FilterGraph2_RemoveFilter(IFilterGraph2 *iface, IBaseFilte { IBaseFilter_SetSyncSource(pFilter, NULL); IBaseFilter_Release(pFilter); + if (entry->position) + IMediaPosition_Release(entry->position); if (entry->seeking) IMediaSeeking_Release(entry->seeking); list_remove(&entry->entry); From 7eac3c0d56c30c245da15831b90280f763f4f9e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 17 Aug 2022 08:58:46 +0200 Subject: [PATCH 0846/2542] HACK: quartz: Reduce the number of committed buffers for P4G. The game requests 30 buffers of 8M for the video and 30 additional buffers for the audio stream. We're already near the 32bit VM limit and fragmentation often makes it fail. 8 buffers should hopefully be enough overall. CW-Bug-Id: #20363 --- dlls/quartz/memallocator.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/quartz/memallocator.c b/dlls/quartz/memallocator.c index ca786ab00463..38f2ce7a5240 100644 --- a/dlls/quartz/memallocator.c +++ b/dlls/quartz/memallocator.c @@ -162,6 +162,7 @@ static ULONG WINAPI BaseMemAllocator_Release(IMemAllocator * iface) static HRESULT WINAPI BaseMemAllocator_SetProperties(IMemAllocator * iface, ALLOCATOR_PROPERTIES *pRequest, ALLOCATOR_PROPERTIES *pActual) { BaseMemAllocator *This = impl_from_IMemAllocator(iface); + const char *sgi; HRESULT hr; TRACE("(%p)->(%p, %p)\n", This, pRequest, pActual); @@ -169,6 +170,10 @@ static HRESULT WINAPI BaseMemAllocator_SetProperties(IMemAllocator * iface, ALLO TRACE("Requested %ld buffers, size %ld, alignment %ld, prefix %ld.\n", pRequest->cBuffers, pRequest->cbBuffer, pRequest->cbAlign, pRequest->cbPrefix); + sgi = getenv("SteamGameId"); + if (sgi && (!strcmp(sgi, "1113000"))) + pRequest->cBuffers = min(8, pRequest->cBuffers); + EnterCriticalSection(This->pCritSect); { if (!list_empty(&This->used_list)) From 7e7215dbb866f7cd48fb072cb3b79e5ed4616529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 22 Aug 2022 18:49:06 +0200 Subject: [PATCH 0847/2542] winegstreamer/wm_reader: Avoid entering sync reader CS in GetNextSample when aggregated. CW-Bug-Id: #21147 --- dlls/winegstreamer/wm_reader.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 950c8b018ab7..6fa505b75262 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -1991,7 +1991,8 @@ static HRESULT WINAPI reader_GetNextSample(IWMSyncReader2 *iface, if (!stream_number && !output_number && !ret_stream_number) return E_INVALIDARG; - EnterCriticalSection(&reader->cs); + if (reader->outer == &reader->IUnknown_inner) + EnterCriticalSection(&reader->cs); if (!stream_number) stream = NULL; @@ -2029,7 +2030,8 @@ static HRESULT WINAPI reader_GetNextSample(IWMSyncReader2 *iface, if (ret_stream_number && (hr == S_OK || stream_number)) *ret_stream_number = stream_number; - LeaveCriticalSection(&reader->cs); + if (reader->outer == &reader->IUnknown_inner) + LeaveCriticalSection(&reader->cs); return hr; } From 3ddb0798797cbd94ee529b296865949a070347aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 16 Sep 2022 08:05:48 +0200 Subject: [PATCH 0848/2542] wmvcore: Spawn stream read threads for async reader streams. CW-Bug-Id: #21147 --- dlls/wmvcore/async_reader.c | 254 +++++++++++++++++++++++++++++++++--- 1 file changed, 234 insertions(+), 20 deletions(-) diff --git a/dlls/wmvcore/async_reader.c b/dlls/wmvcore/async_reader.c index ef657d561ba2..a30c5c96a4c9 100644 --- a/dlls/wmvcore/async_reader.c +++ b/dlls/wmvcore/async_reader.c @@ -60,12 +60,25 @@ struct async_op struct sample { + struct list entry; INSSBuffer *buffer; QWORD pts, duration; DWORD flags, output; WORD stream; }; +struct stream +{ + struct async_reader *reader; + WORD number; + + HANDLE read_thread; + bool read_requested; + CONDITION_VARIABLE read_cv; + struct list read_samples; + HRESULT read_result; +}; + struct async_reader { IWMReader IWMReader_iface; @@ -79,6 +92,7 @@ struct async_reader LONG refcount; IWMSyncReader2 *reader; + IWMProfile3 *profile; CRITICAL_SECTION cs; @@ -94,6 +108,9 @@ struct async_reader CRITICAL_SECTION callback_cs; CONDITION_VARIABLE callback_cv; + DWORD stream_count; + struct stream *streams; + bool running; struct list async_ops; @@ -293,31 +310,180 @@ static void async_reader_deliver_sample(struct async_reader *reader, struct samp TRACE("Callback returned %#lx.\n", hr); + list_remove(&sample->entry); INSSBuffer_Release(sample->buffer); + free(sample); +} + +static void stream_request_read(struct stream *stream) +{ + stream->read_result = E_PENDING; + stream->read_requested = true; + WakeConditionVariable(&stream->read_cv); +} + +static DWORD WINAPI stream_read_thread(void *arg) +{ + struct stream *stream = arg; + struct async_reader *reader = stream->reader; + struct sample *sample; + HRESULT hr; + + TRACE("reader %p, number %u\n", reader, stream->number); + + EnterCriticalSection(&reader->callback_cs); + + while (reader->running) + { + if (!stream->read_requested) + { + SleepConditionVariableCS(&stream->read_cv, &reader->callback_cs, INFINITE); + continue; + } + + if (!(sample = calloc(1, sizeof(*sample)))) + { + WARN("Failed to allocate memory for sample.\n"); + continue; + } + + while (stream->read_requested) + { + stream->read_requested = false; + + if (sample->buffer) + INSSBuffer_Release(sample->buffer); + sample->buffer = NULL; + + LeaveCriticalSection(&reader->callback_cs); + hr = IWMSyncReader2_GetNextSample(reader->reader, stream->number, + &sample->buffer, &sample->pts, &sample->duration, + &sample->flags, &sample->output, &sample->stream); + EnterCriticalSection(&reader->callback_cs); + } + + if (SUCCEEDED(stream->read_result = hr)) + { + TRACE("Got stream %u buffer with pts %I64d.\n", stream->number, sample->pts); + list_add_tail(&stream->read_samples, &sample->entry); + } + else + { + WARN("Failed to get stream %u sample, hr %#lx.\n", stream->number, stream->read_result); + free(sample); + } + + WakeConditionVariable(&reader->callback_cv); + } + + LeaveCriticalSection(&reader->callback_cs); + + TRACE("Reader is stopping; exiting.\n"); + return 0; +} + +static void stream_flush_samples(struct stream *stream) +{ + struct sample *sample, *next; + + LIST_FOR_EACH_ENTRY_SAFE(sample, next, &stream->read_samples, struct sample, entry) + { + list_remove(&sample->entry); + INSSBuffer_Release(sample->buffer); + free(sample); + } +} + +static void stream_close(struct stream *stream) +{ + if (stream->read_thread) + { + WakeConditionVariable(&stream->read_cv); + WaitForSingleObject(stream->read_thread, INFINITE); + CloseHandle(stream->read_thread); + stream->read_thread = NULL; + } + + stream_flush_samples(stream); +} + +static HRESULT stream_open(struct stream *stream, struct async_reader *reader, WORD number) +{ + if (stream->read_thread) + return S_OK; + + stream->number = number; + stream->reader = reader; + list_init(&stream->read_samples); + + if (!(stream->read_thread = CreateThread(NULL, 0, stream_read_thread, stream, 0, NULL))) + return E_OUTOFMEMORY; + + return S_OK; } -static void callback_thread_run(struct async_reader *reader) +static HRESULT async_reader_get_next_sample(struct async_reader *reader, + struct stream **out_stream, struct sample **out_sample) { + struct sample *sample, *first_sample = NULL; + struct stream *stream, *first_stream = NULL; + WMT_STREAM_SELECTION selection; + struct list *entry; + DWORD i; + + for (i = 0; i < reader->stream_count; ++i) + { + stream = reader->streams + i; + + if (FAILED(IWMSyncReader2_GetStreamSelected(reader->reader, i + 1, &selection)) + || selection == WMT_OFF) + continue; + if (!(entry = list_head(&stream->read_samples))) + { + if (stream->read_result == E_PENDING) + return E_PENDING; + continue; + } + + sample = LIST_ENTRY(entry, struct sample, entry); + if (!first_sample || first_sample->pts > sample->pts) + { + first_stream = stream; + first_sample = sample; + } + } + + if (!first_sample) + return NS_E_NO_MORE_SAMPLES; + + TRACE("Found first stream %u with pts %I64d.\n", first_stream->number, first_sample->pts); + *out_sample = first_sample; + *out_stream = first_stream; + return S_OK; +} + +static void async_reader_deliver_samples(struct async_reader *reader) +{ + static const DWORD zero; + IWMReaderCallbackAdvanced *callback_advanced = reader->callback_advanced; IWMReaderCallback *callback = reader->callback; - static const DWORD zero; HRESULT hr = S_OK; + TRACE("reader %p\n", reader); + while (reader->running && list_empty(&reader->async_ops)) { - struct sample sample; + struct sample *sample; + struct stream *stream; - LeaveCriticalSection(&reader->callback_cs); - hr = IWMSyncReader2_GetNextSample(reader->reader, 0, &sample.buffer, &sample.pts, - &sample.duration, &sample.flags, &sample.output, &sample.stream); - EnterCriticalSection(&reader->callback_cs); - if (hr != S_OK) + if (FAILED(hr = async_reader_get_next_sample(reader, &stream, &sample))) break; - if (async_reader_wait_pts(reader, sample.pts)) - async_reader_deliver_sample(reader, &sample); - else - INSSBuffer_Release(sample.buffer); + stream_request_read(stream); + + if (async_reader_wait_pts(reader, sample->pts)) + async_reader_deliver_sample(reader, sample); } if (hr == NS_E_NO_MORE_SAMPLES) @@ -325,6 +491,8 @@ static void callback_thread_run(struct async_reader *reader) BOOL user_clock = reader->user_clock; QWORD user_time = reader->user_time; + TRACE("No more streams samples, sending EOF notifications.\n"); + LeaveCriticalSection(&reader->callback_cs); IWMReaderCallback_OnStatus(callback, WMT_END_OF_STREAMING, S_OK, @@ -342,25 +510,27 @@ static void callback_thread_run(struct async_reader *reader) } EnterCriticalSection(&reader->callback_cs); - - TRACE("Reached end of stream; exiting.\n"); } - else if (hr != S_OK) + else if (hr == E_PENDING) { - ERR("Failed to get sample, hr %#lx.\n", hr); + TRACE("Waiting for more streams samples.\n"); } } static DWORD WINAPI async_reader_callback_thread(void *arg) { - struct async_reader *reader = arg; static const DWORD zero; + + struct async_reader *reader = arg; struct list *entry; HRESULT hr = S_OK; + DWORD i; IWMReaderCallback_OnStatus(reader->callback, WMT_OPENED, S_OK, WMT_TYPE_DWORD, (BYTE *)&zero, reader->context); + TRACE("reader %p\n", reader); + EnterCriticalSection(&reader->callback_cs); while (reader->running) @@ -379,19 +549,28 @@ static DWORD WINAPI async_reader_callback_thread(void *arg) if (SUCCEEDED(hr)) hr = IWMSyncReader2_SetRange(reader->reader, op->u.start.start, op->u.start.duration); if (SUCCEEDED(hr)) + { reader->clock_start = get_current_time(reader); + for (i = 0; i < reader->stream_count; ++i) + { + struct stream *stream = reader->streams + i; + stream_flush_samples(stream); + stream_request_read(stream); + } + } + LeaveCriticalSection(&reader->callback_cs); IWMReaderCallback_OnStatus(reader->callback, WMT_STARTED, hr, WMT_TYPE_DWORD, (BYTE *)&zero, reader->context); EnterCriticalSection(&reader->callback_cs); - - if (SUCCEEDED(hr)) - callback_thread_run(reader); break; } case ASYNC_OP_STOP: + if (SUCCEEDED(hr)) + reader->clock_start = 0; + LeaveCriticalSection(&reader->callback_cs); IWMReaderCallback_OnStatus(reader->callback, WMT_STOPPED, hr, WMT_TYPE_DWORD, (BYTE *)&zero, reader->context); @@ -412,6 +591,9 @@ static DWORD WINAPI async_reader_callback_thread(void *arg) free(op); } + if (reader->clock_start) + async_reader_deliver_samples(reader); + if (reader->running && list_empty(&reader->async_ops)) SleepConditionVariableCS(&reader->callback_cv, &reader->callback_cs, INFINITE); } @@ -425,6 +607,7 @@ static DWORD WINAPI async_reader_callback_thread(void *arg) static void async_reader_close(struct async_reader *reader) { struct async_op *op, *next; + int i; if (reader->callback_thread) { @@ -439,6 +622,15 @@ static void async_reader_close(struct async_reader *reader) free(op); } + for (i = 0; reader->streams && i < reader->stream_count; ++i) + { + struct stream *stream = reader->streams + i; + stream_close(stream); + } + free(reader->streams); + reader->streams = NULL; + reader->stream_count = 0; + if (reader->allocator) IWMReaderAllocatorEx_Release(reader->allocator); reader->allocator = NULL; @@ -456,6 +648,7 @@ static void async_reader_close(struct async_reader *reader) static HRESULT async_reader_open(struct async_reader *reader, IWMReaderCallback *callback, void *context) { HRESULT hr = E_OUTOFMEMORY; + DWORD i; IWMReaderCallback_AddRef((reader->callback = callback)); reader->context = context; @@ -470,7 +663,24 @@ static HRESULT async_reader_open(struct async_reader *reader, IWMReaderCallback reader->callback_advanced = NULL; } + if (FAILED(hr = IWMProfile3_GetStreamCount(reader->profile, &reader->stream_count))) + goto error; + + if (!(reader->streams = calloc(reader->stream_count, sizeof(*reader->streams)))) + { + hr = E_OUTOFMEMORY; + goto error; + } + reader->running = true; + + for (i = 0; i < reader->stream_count; ++i) + { + struct stream *stream = reader->streams + i; + if (FAILED(hr = stream_open(stream, reader, i + 1))) + goto error; + } + if (!(reader->callback_thread = CreateThread(NULL, 0, async_reader_callback_thread, reader, 0, NULL))) goto error; @@ -1923,6 +2133,10 @@ static HRESULT WINAPI async_reader_create(IWMReader **reader) (void **)&object->reader))) goto failed; IWMReader_Release(&object->IWMReader_iface); + if (FAILED(hr = IUnknown_QueryInterface(object->reader_inner, &IID_IWMProfile3, + (void **)&object->profile))) + goto failed; + IWMReader_Release(&object->IWMReader_iface); InitializeCriticalSectionEx(&object->cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO); object->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": async_reader.cs"); From 7bd49ac80c2003edc7323d9482f42d46fa477d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 1 Sep 2022 15:32:14 +0200 Subject: [PATCH 0849/2542] wmvcore: Implement DedicatedDeliveryThread async reader output setting. This restores the todo_wine in the allocator callback as we're now allocating samples in the delivering thread as well. We'll need to create new threads for allocation to match native behavior. CW-Bug-Id: #21147 --- dlls/wmvcore/async_reader.c | 114 ++++++++++++++++++++++++++++++++++-- 1 file changed, 108 insertions(+), 6 deletions(-) diff --git a/dlls/wmvcore/async_reader.c b/dlls/wmvcore/async_reader.c index a30c5c96a4c9..f3e8f670a991 100644 --- a/dlls/wmvcore/async_reader.c +++ b/dlls/wmvcore/async_reader.c @@ -77,6 +77,11 @@ struct stream CONDITION_VARIABLE read_cv; struct list read_samples; HRESULT read_result; + + bool dedicated_delivery_thread; + HANDLE deliver_thread; + struct list deliver_samples; + CONDITION_VARIABLE deliver_cv; }; struct async_reader @@ -322,6 +327,48 @@ static void stream_request_read(struct stream *stream) WakeConditionVariable(&stream->read_cv); } +static void stream_request_deliver(struct async_reader *reader, struct sample *sample) +{ + struct stream *stream = reader->streams + sample->output; + + list_remove(&sample->entry); + list_add_tail(&stream->deliver_samples, &sample->entry); + WakeConditionVariable(&stream->deliver_cv); +} + +static DWORD WINAPI stream_deliver_thread(void *arg) +{ + struct stream *stream = arg; + struct async_reader *reader = stream->reader; + struct list *entry; + + TRACE("reader %p, number %u\n", reader, stream->number); + + EnterCriticalSection(&reader->callback_cs); + + while (reader->running) + { + if (list_empty(&stream->deliver_samples)) + { + SleepConditionVariableCS(&stream->deliver_cv, &reader->callback_cs, INFINITE); + continue; + } + + while ((entry = list_head(&stream->deliver_samples))) + { + struct sample *sample = LIST_ENTRY(entry, struct sample, entry); + async_reader_deliver_sample(reader, sample); + } + + WakeConditionVariable(&reader->callback_cv); + } + + LeaveCriticalSection(&reader->callback_cs); + + TRACE("Reader is stopping; exiting.\n"); + return 0; +} + static DWORD WINAPI stream_read_thread(void *arg) { struct stream *stream = arg; @@ -392,6 +439,13 @@ static void stream_flush_samples(struct stream *stream) INSSBuffer_Release(sample->buffer); free(sample); } + + LIST_FOR_EACH_ENTRY_SAFE(sample, next, &stream->deliver_samples, struct sample, entry) + { + list_remove(&sample->entry); + INSSBuffer_Release(sample->buffer); + free(sample); + } } static void stream_close(struct stream *stream) @@ -404,6 +458,14 @@ static void stream_close(struct stream *stream) stream->read_thread = NULL; } + if (stream->deliver_thread) + { + WakeConditionVariable(&stream->deliver_cv); + WaitForSingleObject(stream->deliver_thread, INFINITE); + CloseHandle(stream->deliver_thread); + stream->deliver_thread = NULL; + } + stream_flush_samples(stream); } @@ -415,10 +477,17 @@ static HRESULT stream_open(struct stream *stream, struct async_reader *reader, W stream->number = number; stream->reader = reader; list_init(&stream->read_samples); + list_init(&stream->deliver_samples); if (!(stream->read_thread = CreateThread(NULL, 0, stream_read_thread, stream, 0, NULL))) return E_OUTOFMEMORY; + if (!(stream->deliver_thread = CreateThread(NULL, 0, stream_deliver_thread, stream, 0, NULL))) + { + stream_close(stream); + return E_OUTOFMEMORY; + } + return S_OK; } @@ -428,6 +497,7 @@ static HRESULT async_reader_get_next_sample(struct async_reader *reader, struct sample *sample, *first_sample = NULL; struct stream *stream, *first_stream = NULL; WMT_STREAM_SELECTION selection; + BOOL pending = FALSE; struct list *entry; DWORD i; @@ -435,6 +505,8 @@ static HRESULT async_reader_get_next_sample(struct async_reader *reader, { stream = reader->streams + i; + if (!list_empty(&stream->deliver_samples)) + pending = TRUE; if (FAILED(IWMSyncReader2_GetStreamSelected(reader->reader, i + 1, &selection)) || selection == WMT_OFF) continue; @@ -454,7 +526,7 @@ static HRESULT async_reader_get_next_sample(struct async_reader *reader, } if (!first_sample) - return NS_E_NO_MORE_SAMPLES; + return pending ? E_PENDING : NS_E_NO_MORE_SAMPLES; TRACE("Found first stream %u with pts %I64d.\n", first_stream->number, first_sample->pts); *out_sample = first_sample; @@ -474,8 +546,8 @@ static void async_reader_deliver_samples(struct async_reader *reader) while (reader->running && list_empty(&reader->async_ops)) { - struct sample *sample; struct stream *stream; + struct sample *sample; if (FAILED(hr = async_reader_get_next_sample(reader, &stream, &sample))) break; @@ -483,7 +555,12 @@ static void async_reader_deliver_samples(struct async_reader *reader) stream_request_read(stream); if (async_reader_wait_pts(reader, sample->pts)) - async_reader_deliver_sample(reader, sample); + { + if (!stream->dedicated_delivery_thread) + async_reader_deliver_sample(reader, sample); + else + stream_request_deliver(reader, sample); + } } if (hr == NS_E_NO_MORE_SAMPLES) @@ -1253,9 +1330,34 @@ static HRESULT WINAPI WMReaderAdvanced2_GetOutputSetting(IWMReaderAdvanced6 *ifa static HRESULT WINAPI WMReaderAdvanced2_SetOutputSetting(IWMReaderAdvanced6 *iface, DWORD output_num, const WCHAR *name, WMT_ATTR_DATATYPE type, const BYTE *value, WORD length) { - struct async_reader *This = impl_from_IWMReaderAdvanced6(iface); - FIXME("(%p)->(%lu %s %#x %p %u)\n", This, output_num, debugstr_w(name), type, value, length); - return E_NOTIMPL; + struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface); + struct stream *stream; + HRESULT hr = E_NOTIMPL; + + FIXME("reader %p, output_num %lu, name %s, type %u, value %p, length %u semi-stub!\n", + reader, output_num, debugstr_w(name), type, value, length); + + EnterCriticalSection(&reader->cs); + + if (!reader->streams) + { + LeaveCriticalSection(&reader->cs); + return E_UNEXPECTED; + } + + stream = reader->streams + output_num; + + EnterCriticalSection(&reader->callback_cs); + if (!wcscmp(name, L"DedicatedDeliveryThread")) + { + stream->dedicated_delivery_thread = *(BOOL *)value; + hr = S_OK; + } + LeaveCriticalSection(&reader->callback_cs); + + LeaveCriticalSection(&reader->cs); + + return hr; } static HRESULT WINAPI WMReaderAdvanced2_Preroll(IWMReaderAdvanced6 *iface, QWORD start, QWORD duration, float rate) From 7b8bd99870779466c564be53ece0a1ce61e66d92 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Mon, 11 Mar 2024 23:13:41 +0000 Subject: [PATCH 0850/2542] wm_reader: Don't reinit stream if read_compressed didn't change. CW-Bug-Id: #23483 --- dlls/winegstreamer/wm_reader.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 6fa505b75262..d1f3f5457d81 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -2512,8 +2512,11 @@ static HRESULT WINAPI reader_SetReadStreamSamples(IWMSyncReader2 *iface, WORD st return E_INVALIDARG; } - stream->read_compressed = compressed; - reinit_stream(reader, compressed); + if (stream->read_compressed != compressed) + { + stream->read_compressed = compressed; + reinit_stream(reader, compressed); + } LeaveCriticalSection(&reader->cs); return S_OK; From 55e5a1ccea37d1bd889ab269d55b499bf131ddf9 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Tue, 12 Mar 2024 13:50:23 +0000 Subject: [PATCH 0851/2542] wm_reader: Fix order of streams in reinit_stream. CW-Bug-Id: #23483 --- dlls/winegstreamer/wm_reader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index d1f3f5457d81..3334f8113360 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -1619,7 +1619,7 @@ static HRESULT reinit_stream(struct wm_reader *reader, bool read_compressed) struct wm_stream *stream = &reader->streams[i]; struct wg_format format; - stream->wg_stream = wg_parser_get_stream(reader->wg_parser, i); + stream->wg_stream = wg_parser_get_stream(reader->wg_parser, reader->stream_count - i - 1); stream->reader = reader; wg_parser_stream_get_current_format(stream->wg_stream, &format); if (stream->selection == WMT_ON) From 3e1682c9e777fb5ceb0cfba8aa9a24a747f603e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 30 Oct 2024 10:11:35 +0100 Subject: [PATCH 0852/2542] HACK: winegstreamer/wm_reader: Force faking compressed samples for some games. CW-Bug-Id: #24401 --- dlls/winegstreamer/wm_reader.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 3334f8113360..0e634265f771 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -31,6 +31,7 @@ struct wm_stream WORD index; bool eos; bool read_compressed; + bool demux_compressed; struct wg_parser_buffer current_buffer; DWORD current_buffer_offset; @@ -2512,9 +2513,16 @@ static HRESULT WINAPI reader_SetReadStreamSamples(IWMSyncReader2 *iface, WORD st return E_INVALIDARG; } - if (stream->read_compressed != compressed) + stream->read_compressed = compressed; + + { + const char *sgi = getenv("SteamGameId"); + if (sgi && !strcmp(sgi, "638160")) compressed = FALSE; + } + + if (stream->demux_compressed != compressed) { - stream->read_compressed = compressed; + stream->demux_compressed = compressed; reinit_stream(reader, compressed); } @@ -2562,7 +2570,7 @@ static HRESULT WINAPI reader_SetStreamsSelected(IWMSyncReader2 *iface, FIXME("Ignoring selection %#x for stream %u; treating as enabled.\n", selections[i], stream_numbers[i]); TRACE("Enabling stream %u.\n", stream_numbers[i]); - if (stream->read_compressed) + if (stream->demux_compressed) { struct wg_format format; wg_parser_stream_get_current_format(stream->wg_stream, &format); From b237dbfeb695597792f1e7137cc0c13837b70bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 12 May 2023 13:34:23 +0200 Subject: [PATCH 0853/2542] winegstreamer: Introduce and use a new wg_task_pool helper. To better track GStreamer threads, avoiding potential task leaks in the default pool which keeps some thread alive. CW-Bug-Id: #22045 --- dlls/winegstreamer/Makefile.in | 1 + dlls/winegstreamer/unix_private.h | 4 ++ dlls/winegstreamer/wg_parser.c | 28 +++++++++ dlls/winegstreamer/wg_task_pool.c | 98 +++++++++++++++++++++++++++++++ 4 files changed, 131 insertions(+) create mode 100644 dlls/winegstreamer/wg_task_pool.c diff --git a/dlls/winegstreamer/Makefile.in b/dlls/winegstreamer/Makefile.in index 74f286580577..9965dc0ad6da 100644 --- a/dlls/winegstreamer/Makefile.in +++ b/dlls/winegstreamer/Makefile.in @@ -34,6 +34,7 @@ SOURCES = \ wg_muxer.c \ wg_parser.c \ wg_sample.c \ + wg_task_pool.c \ wg_transform.c \ winegstreamer_classes.idl \ wm_reader.c \ diff --git a/dlls/winegstreamer/unix_private.h b/dlls/winegstreamer/unix_private.h index a0f1d3ddafda..d8fe72b570d4 100644 --- a/dlls/winegstreamer/unix_private.h +++ b/dlls/winegstreamer/unix_private.h @@ -94,6 +94,10 @@ extern NTSTATUS wg_muxer_push_sample(void *args); extern NTSTATUS wg_muxer_read_data(void *args); extern NTSTATUS wg_muxer_finalize(void *args); +/* wg_task_pool.c */ + +extern GstTaskPool *wg_task_pool_new(void); + /* wg_allocator.c */ static inline BYTE *wg_sample_data(struct wg_sample *sample) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 0e7d18a316ae..c56e5ded241d 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -71,6 +71,7 @@ struct wg_parser GstElement *container, *decodebin; GstBus *bus; + GstTaskPool *task_pool; GstPad *my_src; guint64 file_size, start_offset, next_offset, stop_offset; @@ -1566,6 +1567,24 @@ static GstBusSyncReply bus_handler_cb(GstBus *bus, GstMessage *msg, gpointer use } break; + case GST_MESSAGE_STREAM_STATUS: + { + GstStreamStatusType type; + GstElement *element; + const GValue *val; + GstTask *task; + + gst_message_parse_stream_status(msg, &type, &element); + val = gst_message_get_stream_status_object(msg); + GST_DEBUG("parser %p, message %s, type %u, value %p (%s).", parser, GST_MESSAGE_TYPE_NAME(msg), type, val, G_VALUE_TYPE_NAME(val)); + + if (G_VALUE_TYPE(val) == GST_TYPE_TASK && (task = g_value_get_object(val)) + && type == GST_STREAM_STATUS_TYPE_CREATE) + gst_task_set_pool(task, parser->task_pool); + + break; + } + default: break; } @@ -1964,6 +1983,7 @@ static NTSTATUS wg_parser_disconnect(void *args) parser->input_cache_chunks[i].data = NULL; } + gst_task_pool_cleanup(parser->task_pool); return S_OK; } @@ -2001,6 +2021,7 @@ static NTSTATUS wg_parser_create(void *args) { struct wg_parser_create_params *params = args; struct wg_parser *parser; + GError *error; if (!(parser = calloc(1, sizeof(*parser)))) return E_OUTOFMEMORY; @@ -2014,6 +2035,12 @@ static NTSTATUS wg_parser_create(void *args) parser->use_opengl = FALSE; } } + if (!(parser->task_pool = wg_task_pool_new())) + { + free(parser); + return E_OUTOFMEMORY; + } + gst_task_pool_prepare(parser->task_pool, &error); pthread_mutex_init(&parser->mutex, NULL); pthread_cond_init(&parser->init_cond, NULL); @@ -2036,6 +2063,7 @@ static NTSTATUS wg_parser_destroy(void *args) gst_bus_set_sync_handler(parser->bus, NULL, NULL, NULL); gst_object_unref(parser->bus); } + gst_object_unref(parser->task_pool); if (parser->context) gst_context_unref(parser->context); diff --git a/dlls/winegstreamer/wg_task_pool.c b/dlls/winegstreamer/wg_task_pool.c new file mode 100644 index 000000000000..ec7da286d5f1 --- /dev/null +++ b/dlls/winegstreamer/wg_task_pool.c @@ -0,0 +1,98 @@ +/* + * GStreamer task pool + * + * Copyright 2023 Rémi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "config.h" + +#include +#include + +#include + +#include "unix_private.h" + +typedef struct +{ + GstTaskPool parent; +} WgTaskPool; + +typedef struct +{ + GstTaskPoolClass parent_class; +} WgTaskPoolClass; + +G_DEFINE_TYPE(WgTaskPool, wg_task_pool, GST_TYPE_TASK_POOL); + +static void wg_task_pool_prepare(GstTaskPool *pool, GError **error) +{ + GST_LOG("pool %p, error %p", pool, error); +} + +static void wg_task_pool_cleanup(GstTaskPool *pool) +{ + GST_LOG("pool %p", pool); +} + +static gpointer wg_task_pool_push(GstTaskPool *pool, GstTaskPoolFunction func, gpointer data, GError **error) +{ + pthread_t *tid; + gint res; + + GST_LOG("pool %p, func %p, data %p, error %p", pool, func, data, error); + + if (!(tid = malloc(sizeof(*tid))) || !(res = pthread_create(tid, NULL, (void *)func, data))) + return tid; + + g_set_error(error, G_THREAD_ERROR, G_THREAD_ERROR_AGAIN, "Error creating thread: %s", g_strerror(res)); + free(tid); + + return NULL; +} + +static void wg_task_pool_join(GstTaskPool *pool, gpointer id) +{ + pthread_t *tid = id; + + GST_LOG("pool %p, id %p", pool, id); + + pthread_join(*tid, NULL); + free(tid); +} + +static void wg_task_pool_class_init(WgTaskPoolClass *klass) +{ + GstTaskPoolClass *parent_class = (GstTaskPoolClass *)klass; + parent_class->prepare = wg_task_pool_prepare; + parent_class->cleanup = wg_task_pool_cleanup; + parent_class->push = wg_task_pool_push; + parent_class->join = wg_task_pool_join; +} + +static void wg_task_pool_init(WgTaskPool *pool) +{ +} + +GstTaskPool *wg_task_pool_new(void) +{ + return g_object_new(wg_task_pool_get_type(), NULL); +} From c01bd703f54b0a8b0d361056151a4a3623289613 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 8 Mar 2021 16:41:19 +0100 Subject: [PATCH 0854/2542] webservices: Prefer native. CW-Bug-Id: #18637 --- dlls/webservices/Makefile.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/webservices/Makefile.in b/dlls/webservices/Makefile.in index 78b7e06af4bf..8a613eb6414e 100644 --- a/dlls/webservices/Makefile.in +++ b/dlls/webservices/Makefile.in @@ -2,6 +2,8 @@ MODULE = webservices.dll IMPORTLIB = webservices IMPORTS = winhttp rpcrt4 user32 ws2_32 +EXTRADLLFLAGS = -Wb,--prefer-native + SOURCES = \ channel.c \ error.c \ From cd4cc6cdbae94caa23324b2d52966b7b20762850 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 8 Dec 2021 23:36:27 +0100 Subject: [PATCH 0855/2542] kernelbase: Ignore LOAD_LIBRARY_SEARCH_SYSTEM32 flags for webservices.dll in LoadLibraryExW. CW-Bug-Id: #18637 --- dlls/kernelbase/loader.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/kernelbase/loader.c b/dlls/kernelbase/loader.c index 22f84d664ce8..f684d32e8527 100644 --- a/dlls/kernelbase/loader.c +++ b/dlls/kernelbase/loader.c @@ -552,6 +552,14 @@ HMODULE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW( LPCWSTR name, HANDLE file, DWOR SetLastError( ERROR_INVALID_PARAMETER ); return 0; } + + /* HACK: allow webservices.dll to be shipped together with remote debugger tools. */ + if (flags == LOAD_LIBRARY_SEARCH_SYSTEM32 && !file && !wcscmp( name, L"webservices.dll" )) + { + FIXME( "HACK: ignoring LOAD_LIBRARY_SEARCH_SYSTEM32 for webservices.dll\n" ); + flags = 0; + } + RtlInitUnicodeString( &str, name ); if (str.Buffer[str.Length/sizeof(WCHAR) - 1] != ' ') return load_library( &str, flags ); From 754e45a21374a0368edfb67622cd5c0737c6ef7d Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Thu, 23 May 2024 16:58:09 +0300 Subject: [PATCH 0856/2542] win32u: Update Nvidia's DriverVersion to 999.99. To avoid periodic bumps... at lest for some time. CW-Bug-Id: #23941 --- dlls/win32u/sysparams.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 29d9dc9e5fdf..9d26cd137310 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1227,7 +1227,7 @@ static BOOL write_gpu_to_registry( const struct gpu *gpu, const struct pci_id *p break; /* Nvidia */ case 0x10de: - strcpy( buffer, "31.0.15.3625" ); + strcpy( buffer, "31.0.19.9999" ); break; /* Default value for any other vendor. */ default: From a6f51c2da52f3785f7dd47185e37f183643cea79 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Tue, 9 Apr 2024 11:56:54 +0300 Subject: [PATCH 0857/2542] HACK: winebuild: Include target arch in the hash used for timestamp. So that 32 and 64 bit PEs produce different values even if they have the same name. --- tools/winebuild/spec32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index ef6bd16267ce..7c558fe532be 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -62,7 +62,7 @@ static unsigned int hash_filename( const char *name ) /* FNV-1 hash */ unsigned int ret = 2166136261u; while (*name) ret = (ret * 16777619) ^ *name++; - return ret; + return ret + target.cpu; } /* check if entry point needs a relay thunk */ From 3884c022d746cc328b0f1d0375861a423d8bbba9 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Wed, 28 Dec 2022 12:09:43 +0200 Subject: [PATCH 0858/2542] winegstreamer/wg_parser: Set n-threads for dav1d to 1. It defaults to `$(nproc)` which causes the memory footprint to skyrocet on high core count systems. Setting it to 1 makes it use a bit less memory that theora decoder and is enough to decode 1080p 30fps stream on 5950x with a speed of 4x the real time. We may want to set it to value higher than 1 for 64bit apps where limited address space is not an issue. 2 or 4 may be optimal for tiling with 2 columns and 2 rosw when encoding the video. CW-Bug-Id: #19516 --- dlls/winegstreamer/wg_parser.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index c56e5ded241d..ecd3e1caa6c9 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -627,11 +627,30 @@ static void no_more_pads_cb(GstElement *element, gpointer user) pthread_mutex_unlock(&parser->mutex); pthread_cond_signal(&parser->init_cond); } +static void set_dav1d_n_threads(GstElement *element) +{ + GstElementFactory *factory = NULL; + const char *name = NULL; + + if (element) + factory = gst_element_get_factory(element); + + if (factory) + name = gst_element_factory_get_longname(factory); + + if (name && strstr(name, "Dav1d")) + { + GST_DEBUG("%s found, setting n-threads to 1.", name); + g_object_set(element, "n-threads", G_GINT64_CONSTANT(1), NULL); + } +} static void deep_element_added_cb(GstBin *self, GstBin *sub_bin, GstElement *element, gpointer user) { if (element) set_max_threads(element); + + set_dav1d_n_threads(element); } static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) From 3f84b28bb1880b91026cc16f865cc06a604fb34f Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Tue, 17 Jan 2023 14:38:06 +0200 Subject: [PATCH 0859/2542] winegstreamer/wg_parser: Set n-threads for dav1d to 4 in 64 bit mode. CW-Bug-Id: #19516 --- dlls/winegstreamer/wg_parser.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index ecd3e1caa6c9..7ac9079120a1 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -640,8 +640,13 @@ static void set_dav1d_n_threads(GstElement *element) if (name && strstr(name, "Dav1d")) { +#if defined(__x86_64__) + GST_DEBUG("%s found, setting n-threads to 4.", name); + g_object_set(element, "n-threads", G_GINT64_CONSTANT(4), NULL); +#else GST_DEBUG("%s found, setting n-threads to 1.", name); g_object_set(element, "n-threads", G_GINT64_CONSTANT(1), NULL); +#endif } } From 9dac530989f514b6d6c6726231a1c865b90a9460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 12 Dec 2024 00:37:11 +0100 Subject: [PATCH 0860/2542] win32u: Introduce a new add_virtual_mode helper. --- dlls/win32u/sysparams.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 9d26cd137310..2fee3dc1f61b 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1618,6 +1618,13 @@ static void add_monitor( const struct gdi_monitor *gdi_monitor, void *param ) } } +static UINT add_virtual_mode( DEVMODEW *modes, UINT count, const DEVMODEW *mode ) +{ + TRACE( "adding %s\n", debugstr_devmodew(mode) ); + modes[count] = *mode; + return 1; +} + static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *initial, const DEVMODEW *maximum, UINT32 *modes_count ) { @@ -1688,18 +1695,18 @@ static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *ini if (mode.dmPelsWidth > maximum->dmPelsWidth || mode.dmPelsHeight > maximum->dmPelsHeight) continue; if (mode.dmPelsWidth == maximum->dmPelsWidth && mode.dmPelsHeight == maximum->dmPelsHeight) continue; if (mode.dmPelsWidth == initial->dmPelsWidth && mode.dmPelsHeight == initial->dmPelsHeight) continue; - modes[count++] = mode; + count += add_virtual_mode( modes, count, &mode ); } mode.dmPelsWidth = vertical ? initial->dmPelsHeight : initial->dmPelsWidth; mode.dmPelsHeight = vertical ? initial->dmPelsWidth : initial->dmPelsHeight; - modes[count++] = mode; + count += add_virtual_mode( modes, count, &mode ); if (maximum->dmPelsWidth != initial->dmPelsWidth || maximum->dmPelsHeight != initial->dmPelsHeight) { mode.dmPelsWidth = vertical ? maximum->dmPelsHeight : maximum->dmPelsWidth; mode.dmPelsHeight = vertical ? maximum->dmPelsWidth : maximum->dmPelsHeight; - modes[count++] = mode; + count += add_virtual_mode( modes, count, &mode ); } } From cf26bf5ffaf5611fdd91e2e97e27d35d9739721b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 12 Dec 2024 00:41:27 +0100 Subject: [PATCH 0861/2542] win32u: Pass host enumerated display modes to get_virtual_modes. --- dlls/win32u/sysparams.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 2fee3dc1f61b..ce0a95a95f2c 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1625,8 +1625,8 @@ static UINT add_virtual_mode( DEVMODEW *modes, UINT count, const DEVMODEW *mode return 1; } -static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *initial, - const DEVMODEW *maximum, UINT32 *modes_count ) +static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *initial, const DEVMODEW *maximum, + const DEVMODEW *host_modes, UINT host_modes_count, UINT32 *modes_count ) { static struct screen_size { @@ -1731,14 +1731,16 @@ static DEVMODEW find_largest_mode( const DEVMODEW *found, const DEVMODEW *modes, return *found; } -static void add_modes( const DEVMODEW *current, UINT modes_count, const DEVMODEW *modes, void *param ) +static void add_modes( const DEVMODEW *current, UINT host_modes_count, const DEVMODEW *host_modes, void *param ) { struct device_manager_ctx *ctx = param; DEVMODEW dummy, physical, detached = *current, virtual, *virtual_modes = NULL; + UINT virtual_count, modes_count = host_modes_count; + const DEVMODEW *modes = host_modes; struct source *source; - UINT virtual_count; - TRACE( "current %s, modes_count %u, modes %p, param %p\n", debugstr_devmodew( current ), modes_count, modes, param ); + TRACE( "current %s, host_modes_count %u, host_modes %p, param %p\n", debugstr_devmodew( current ), + host_modes_count, host_modes, param ); assert( !list_empty( &sources ) ); source = LIST_ENTRY( list_tail( &sources ), struct source, entry ); @@ -1751,7 +1753,7 @@ static void add_modes( const DEVMODEW *current, UINT modes_count, const DEVMODEW else if (emulate_modelist) { physical = find_largest_mode( current, modes, modes_count ); - if ((virtual_modes = get_virtual_modes( current, &physical, &physical, &virtual_count ))) + if ((virtual_modes = get_virtual_modes( current, &physical, &physical, host_modes, host_modes_count, &virtual_count ))) { modes_count = virtual_count; modes = virtual_modes; @@ -1783,7 +1785,7 @@ static void add_modes( const DEVMODEW *current, UINT modes_count, const DEVMODEW if (!read_source_mode( source->key, ENUM_CURRENT_SETTINGS, &virtual )) virtual = physical; - if ((virtual_modes = get_virtual_modes( &virtual, current, &physical, &virtual_count ))) + if ((virtual_modes = get_virtual_modes( &virtual, current, &physical, host_modes, host_modes_count, &virtual_count ))) { modes_count = virtual_count; modes = virtual_modes; @@ -2300,7 +2302,7 @@ static BOOL add_virtual_source( struct device_manager_ctx *ctx ) add_monitor( &monitor, ctx ); /* Expose the virtual source display modes as physical modes, to avoid DPI scaling */ - if (!(modes = get_virtual_modes( ¤t, &initial, &maximum, &modes_count ))) return STATUS_NO_MEMORY; + if (!(modes = get_virtual_modes( ¤t, &initial, &maximum, NULL, 0, &modes_count ))) return STATUS_NO_MEMORY; add_modes( ¤t, modes_count, modes, ctx ); free( modes ); From 167801d38c78ab19430f816253d63a7a444b1ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 12 Dec 2024 00:42:47 +0100 Subject: [PATCH 0862/2542] win32u: Keep screen sizes in a SIZE array. --- dlls/win32u/sysparams.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index ce0a95a95f2c..e3d25d15497e 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1628,11 +1628,8 @@ static UINT add_virtual_mode( DEVMODEW *modes, UINT count, const DEVMODEW *mode static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *initial, const DEVMODEW *maximum, const DEVMODEW *host_modes, UINT host_modes_count, UINT32 *modes_count ) { - static struct screen_size + static SIZE screen_sizes[] = { - unsigned int width; - unsigned int height; - } screen_sizes[] = { /* 4:3 */ { 320, 240}, { 400, 300}, @@ -1665,7 +1662,7 @@ static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *ini {1920, 1200}, {2560, 1600} }; - UINT depths[] = {8, 16, initial->dmBitsPerPel}, i, j, count; + UINT depths[] = {8, 16, initial->dmBitsPerPel}, i, j, count = 0; BOOL vertical; DEVMODEW *modes; @@ -1676,7 +1673,7 @@ static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *ini modes = malloc( ARRAY_SIZE(depths) * (ARRAY_SIZE(screen_sizes) + 2) * sizeof(*modes) ); - for (count = i = 0; modes && i < ARRAY_SIZE(depths); ++i) + for (i = 0; modes && i < ARRAY_SIZE(depths); ++i) { DEVMODEW mode = { @@ -1689,8 +1686,8 @@ static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *ini for (j = 0; j < ARRAY_SIZE(screen_sizes); ++j) { - mode.dmPelsWidth = vertical ? screen_sizes[j].height : screen_sizes[j].width; - mode.dmPelsHeight = vertical ? screen_sizes[j].width : screen_sizes[j].height; + mode.dmPelsWidth = vertical ? screen_sizes[j].cy : screen_sizes[j].cx; + mode.dmPelsHeight = vertical ? screen_sizes[j].cx : screen_sizes[j].cy; if (mode.dmPelsWidth > maximum->dmPelsWidth || mode.dmPelsHeight > maximum->dmPelsHeight) continue; if (mode.dmPelsWidth == maximum->dmPelsWidth && mode.dmPelsHeight == maximum->dmPelsHeight) continue; From 15919459ac6ed6396d3344b9dbba4baf82bac3d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 12 Dec 2024 00:43:38 +0100 Subject: [PATCH 0863/2542] win32u: Introduce a new get_screen_sizes helper. --- dlls/win32u/sysparams.c | 54 +++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index e3d25d15497e..6d0b7ccac535 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1618,17 +1618,10 @@ static void add_monitor( const struct gdi_monitor *gdi_monitor, void *param ) } } -static UINT add_virtual_mode( DEVMODEW *modes, UINT count, const DEVMODEW *mode ) -{ - TRACE( "adding %s\n", debugstr_devmodew(mode) ); - modes[count] = *mode; - return 1; -} - -static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *initial, const DEVMODEW *maximum, - const DEVMODEW *host_modes, UINT host_modes_count, UINT32 *modes_count ) +static SIZE *get_screen_sizes( const DEVMODEW *maximum, const DEVMODEW *modes, UINT modes_count, + UINT *sizes_count ) { - static SIZE screen_sizes[] = + static SIZE default_sizes[] = { /* 4:3 */ { 320, 240}, @@ -1643,9 +1636,6 @@ static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *ini {1400, 1050}, {1600, 1200}, {2048, 1536}, - /* 5:4 */ - {1280, 1024}, - {2560, 2048}, /* 16:9 */ {1280, 720}, {1366, 768}, @@ -1660,18 +1650,44 @@ static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *ini {1440, 900}, {1680, 1050}, {1920, 1200}, - {2560, 1600} + {2560, 1600}, + /* 5:4 */ + {1280, 1024}, + {2560, 2048}, }; - UINT depths[] = {8, 16, initial->dmBitsPerPel}, i, j, count = 0; + SIZE *sizes; + UINT count; + + count = ARRAY_SIZE(default_sizes); + if (!(sizes = malloc( count * sizeof(*sizes) ))) return NULL; + memcpy( sizes, default_sizes, count * sizeof(*sizes) ); + + *sizes_count = count; + return sizes; +} + +static UINT add_virtual_mode( DEVMODEW *modes, UINT count, const DEVMODEW *mode ) +{ + TRACE( "adding %s\n", debugstr_devmodew(mode) ); + modes[count] = *mode; + return 1; +} + +static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *initial, const DEVMODEW *maximum, + const DEVMODEW *host_modes, UINT host_modes_count, UINT32 *modes_count ) +{ + UINT depths[] = {8, 16, initial->dmBitsPerPel}, sizes_count, i, j, count = 0; + DEVMODEW *modes = NULL; + SIZE *screen_sizes; BOOL vertical; - DEVMODEW *modes; /* Check the ratio of dmPelsWidth to dmPelsHeight to determine whether the initial display mode * is in horizontal or vertical orientation. DMDO_DEFAULT is the natural orientation of the * device, which isn't necessarily a horizontal mode */ vertical = initial->dmPelsHeight > initial->dmPelsWidth; - modes = malloc( ARRAY_SIZE(depths) * (ARRAY_SIZE(screen_sizes) + 2) * sizeof(*modes) ); + if (!(screen_sizes = get_screen_sizes( maximum, host_modes, host_modes_count, &sizes_count ))) return NULL; + modes = malloc( ARRAY_SIZE(depths) * (sizes_count + 2) * sizeof(*modes) ); for (i = 0; modes && i < ARRAY_SIZE(depths); ++i) { @@ -1684,7 +1700,7 @@ static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *ini .dmDisplayOrientation = initial->dmDisplayOrientation, }; - for (j = 0; j < ARRAY_SIZE(screen_sizes); ++j) + for (j = 0; j < sizes_count; ++j) { mode.dmPelsWidth = vertical ? screen_sizes[j].cy : screen_sizes[j].cx; mode.dmPelsHeight = vertical ? screen_sizes[j].cx : screen_sizes[j].cy; @@ -1707,6 +1723,8 @@ static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *ini } } + free( screen_sizes ); + *modes_count = count; return modes; } From bf8e342f101a5d6260cdec35ec3d169544432f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 11 Dec 2024 22:09:21 +0100 Subject: [PATCH 0864/2542] win32u: Generate fake resolution list from the host modes. --- dlls/win32u/sysparams.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 6d0b7ccac535..7978b343ad58 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1618,6 +1618,15 @@ static void add_monitor( const struct gdi_monitor *gdi_monitor, void *param ) } } +static UINT add_screen_size( SIZE *sizes, UINT count, SIZE size ) +{ + UINT i = 0; + + while (i < count && memcmp( sizes + i, &size, sizeof(size) )) i++; + if (i == count) sizes[i] = size; + return i == count ? 1 : 0; +} + static SIZE *get_screen_sizes( const DEVMODEW *maximum, const DEVMODEW *modes, UINT modes_count, UINT *sizes_count ) { @@ -1655,12 +1664,29 @@ static SIZE *get_screen_sizes( const DEVMODEW *maximum, const DEVMODEW *modes, U {1280, 1024}, {2560, 2048}, }; - SIZE *sizes; - UINT count; + UINT max_width = devmode_get( maximum, DM_PELSWIDTH ), max_height = devmode_get( maximum, DM_PELSHEIGHT ); + SIZE *sizes, max_size = {.cx = max( max_width, max_height ), .cy = min( max_width, max_height )}; + const DEVMODEW *mode; + UINT i, count; - count = ARRAY_SIZE(default_sizes); + count = 1 + ARRAY_SIZE(default_sizes) + modes_count; if (!(sizes = malloc( count * sizeof(*sizes) ))) return NULL; - memcpy( sizes, default_sizes, count * sizeof(*sizes) ); + + count = add_screen_size( sizes, 0, max_size ); + for (i = 0; i < ARRAY_SIZE(default_sizes); i++) + { + if (default_sizes[i].cx > max_size.cx || default_sizes[i].cy > max_size.cy) continue; + count += add_screen_size( sizes, count, default_sizes[i] ); + } + + for (mode = modes; mode && modes_count; mode = NEXT_DEVMODEW(mode), modes_count--) + { + UINT width = devmode_get( mode, DM_PELSWIDTH ), height = devmode_get( mode, DM_PELSHEIGHT ); + SIZE size = {.cx = max( width, height ), .cy = min( width, height )}; + if (!size.cx || size.cx < 800 || size.cx > max_size.cx) continue; + if (!size.cy || size.cy < 600 || size.cy > max_size.cy) continue; + count += add_screen_size( sizes, count, size ); + } *sizes_count = count; return sizes; From 058dccf24654c1bd55703c5da962d5efa5a487ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 11 Dec 2024 22:09:40 +0100 Subject: [PATCH 0865/2542] win32u: Split the low resolution sizes to a separate list. --- dlls/win32u/sysparams.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 7978b343ad58..1fba5ee183a3 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1630,7 +1630,7 @@ static UINT add_screen_size( SIZE *sizes, UINT count, SIZE size ) static SIZE *get_screen_sizes( const DEVMODEW *maximum, const DEVMODEW *modes, UINT modes_count, UINT *sizes_count ) { - static SIZE default_sizes[] = + static SIZE lowres_sizes[] = { /* 4:3 */ { 320, 240}, @@ -1638,6 +1638,15 @@ static SIZE *get_screen_sizes( const DEVMODEW *maximum, const DEVMODEW *modes, U { 512, 384}, { 640, 480}, { 768, 576}, + /* 16:9 */ + { 960, 540}, + /* 16:10 */ + { 320, 200}, + { 640, 400}, + }; + static SIZE default_sizes[] = + { + /* 4:3 */ { 800, 600}, {1024, 768}, {1152, 864}, @@ -1653,8 +1662,6 @@ static SIZE *get_screen_sizes( const DEVMODEW *maximum, const DEVMODEW *modes, U {2560, 1440}, {3840, 2160}, /* 16:10 */ - { 320, 200}, - { 640, 400}, {1280, 800}, {1440, 900}, {1680, 1050}, @@ -1669,7 +1676,7 @@ static SIZE *get_screen_sizes( const DEVMODEW *maximum, const DEVMODEW *modes, U const DEVMODEW *mode; UINT i, count; - count = 1 + ARRAY_SIZE(default_sizes) + modes_count; + count = 1 + ARRAY_SIZE(default_sizes) + ARRAY_SIZE(lowres_sizes) + modes_count; if (!(sizes = malloc( count * sizeof(*sizes) ))) return NULL; count = add_screen_size( sizes, 0, max_size ); @@ -1679,6 +1686,9 @@ static SIZE *get_screen_sizes( const DEVMODEW *maximum, const DEVMODEW *modes, U count += add_screen_size( sizes, count, default_sizes[i] ); } + memcpy( sizes + count, lowres_sizes, ARRAY_SIZE(lowres_sizes) * sizeof(*sizes) ); + count += ARRAY_SIZE(lowres_sizes); + for (mode = modes; mode && modes_count; mode = NEXT_DEVMODEW(mode), modes_count--) { UINT width = devmode_get( mode, DM_PELSWIDTH ), height = devmode_get( mode, DM_PELSHEIGHT ); From 477466b1652fe892a63239ee2267ad3537b745be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 11 Dec 2024 21:47:32 +0100 Subject: [PATCH 0866/2542] win32u: Limit the number of screen sizes for some games. --- dlls/win32u/sysparams.c | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 1fba5ee183a3..9624e44869ba 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -161,6 +161,7 @@ static pthread_mutex_t display_lock = PTHREAD_MUTEX_INITIALIZER; static BOOL emulate_modelist = TRUE; static BOOL emulate_modeset = TRUE; +static UINT limit_resolutions = 0; BOOL decorated_mode = TRUE; UINT64 thunk_lock_callback = 0; @@ -1632,44 +1633,39 @@ static SIZE *get_screen_sizes( const DEVMODEW *maximum, const DEVMODEW *modes, U { static SIZE lowres_sizes[] = { - /* 4:3 */ - { 320, 240}, - { 400, 300}, - { 512, 384}, - { 640, 480}, - { 768, 576}, /* 16:9 */ { 960, 540}, - /* 16:10 */ - { 320, 200}, - { 640, 400}, }; static SIZE default_sizes[] = { /* 4:3 */ { 800, 600}, {1024, 768}, - {1152, 864}, - {1280, 960}, - {1400, 1050}, {1600, 1200}, - {2048, 1536}, /* 16:9 */ {1280, 720}, - {1366, 768}, {1600, 900}, {1920, 1080}, {2560, 1440}, - {3840, 2160}, + {2880, 1620}, + {3200, 1800}, /* 16:10 */ - {1280, 800}, {1440, 900}, {1680, 1050}, {1920, 1200}, {2560, 1600}, + /* 3:2 */ + {1440, 960}, + {1920, 1280}, + /* 21:9 ultra-wide */ + {2560, 1080}, + /* 12:5 */ + {1920, 800}, + {3840, 1600}, /* 5:4 */ {1280, 1024}, - {2560, 2048}, + /* 5:3 */ + {1280, 768}, }; UINT max_width = devmode_get( maximum, DM_PELSWIDTH ), max_height = devmode_get( maximum, DM_PELSHEIGHT ); SIZE *sizes, max_size = {.cx = max( max_width, max_height ), .cy = min( max_width, max_height )}; @@ -1698,6 +1694,7 @@ static SIZE *get_screen_sizes( const DEVMODEW *maximum, const DEVMODEW *modes, U count += add_screen_size( sizes, count, size ); } + if (limit_resolutions && count > limit_resolutions) count = limit_resolutions; *sizes_count = count; return sizes; } @@ -5613,6 +5610,16 @@ void sysparams_init(void) if (!get_config_key( hkey, appkey, "EmulateModeset", buffer, sizeof(buffer) )) emulate_modeset = !IS_OPTION_TRUE( buffer[0] ); + { + const char *s; + + if ((s = getenv( "PROTON_LIMIT_RESOLUTIONS" ))) + { + limit_resolutions = atoi( s ); + ERR( "HACK: limit_resolutions %u.\n", limit_resolutions ); + } + } + #undef IS_OPTION_TRUE if (app_compat_flags) From 6223e1782d2edbe96ee8226788937d0f17b0a7b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 12 Dec 2024 00:50:30 +0100 Subject: [PATCH 0867/2542] win32u: Generate modes for the host native frequency. In addition to 60Hz modes. --- dlls/win32u/sysparams.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 9624e44869ba..bc9c2c427e32 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1709,7 +1709,7 @@ static UINT add_virtual_mode( DEVMODEW *modes, UINT count, const DEVMODEW *mode static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *initial, const DEVMODEW *maximum, const DEVMODEW *host_modes, UINT host_modes_count, UINT32 *modes_count ) { - UINT depths[] = {8, 16, initial->dmBitsPerPel}, sizes_count, i, j, count = 0; + UINT depths[] = {8, 16, initial->dmBitsPerPel}, freqs[] = {60, -1}, sizes_count, i, j, f, count = 0; DEVMODEW *modes = NULL; SIZE *screen_sizes; BOOL vertical; @@ -1719,19 +1719,24 @@ static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *ini * device, which isn't necessarily a horizontal mode */ vertical = initial->dmPelsHeight > initial->dmPelsWidth; + freqs[1] = devmode_get( initial, DM_DISPLAYFREQUENCY ); + if (freqs[1] <= 60) freqs[1] = 0; + if (!(screen_sizes = get_screen_sizes( maximum, host_modes, host_modes_count, &sizes_count ))) return NULL; - modes = malloc( ARRAY_SIZE(depths) * (sizes_count + 2) * sizeof(*modes) ); + modes = malloc( ARRAY_SIZE(freqs) * ARRAY_SIZE(depths) * (sizes_count + 2) * sizeof(*modes) ); for (i = 0; modes && i < ARRAY_SIZE(depths); ++i) + for (f = 0; f < ARRAY_SIZE(freqs); ++f) { DEVMODEW mode = { .dmSize = sizeof(mode), .dmFields = DM_DISPLAYORIENTATION | DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY, - .dmDisplayFrequency = 60, + .dmDisplayFrequency = freqs[f], .dmBitsPerPel = depths[i], .dmDisplayOrientation = initial->dmDisplayOrientation, }; + if (!mode.dmDisplayFrequency) continue; for (j = 0; j < sizes_count; ++j) { From 591e67a94ec986e48368a3f0762b02fc1ee932a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 11 Dec 2024 22:09:52 +0100 Subject: [PATCH 0868/2542] HACK: win32u: Don't expose lowres screen sizes for some games. --- dlls/win32u/sysparams.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index bc9c2c427e32..7dae99e8f11e 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1672,6 +1672,8 @@ static SIZE *get_screen_sizes( const DEVMODEW *maximum, const DEVMODEW *modes, U const DEVMODEW *mode; UINT i, count; + const char *env; + count = 1 + ARRAY_SIZE(default_sizes) + ARRAY_SIZE(lowres_sizes) + modes_count; if (!(sizes = malloc( count * sizeof(*sizes) ))) return NULL; @@ -1682,8 +1684,12 @@ static SIZE *get_screen_sizes( const DEVMODEW *maximum, const DEVMODEW *modes, U count += add_screen_size( sizes, count, default_sizes[i] ); } - memcpy( sizes + count, lowres_sizes, ARRAY_SIZE(lowres_sizes) * sizeof(*sizes) ); - count += ARRAY_SIZE(lowres_sizes); + /* Titan Souls renders incorrectly if we report modes smaller than 800x600 */ + if (!(env = getenv( "SteamAppId" )) || strcmp( env, "297130" )) + { + memcpy( sizes + count, lowres_sizes, ARRAY_SIZE(lowres_sizes) * sizeof(*sizes) ); + count += ARRAY_SIZE(lowres_sizes); + } for (mode = modes; mode && modes_count; mode = NEXT_DEVMODEW(mode), modes_count--) { From e7e1606af640889d9c0dee1e3cc381dccfc1885a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 12 Dec 2024 00:53:29 +0100 Subject: [PATCH 0869/2542] HACK: win32u: Add optional centered low res modes. CW-Bug-Id: #22802 --- dlls/win32u/sysparams.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 7dae99e8f11e..ae94d5a31e12 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1705,11 +1705,16 @@ static SIZE *get_screen_sizes( const DEVMODEW *maximum, const DEVMODEW *modes, U return sizes; } -static UINT add_virtual_mode( DEVMODEW *modes, UINT count, const DEVMODEW *mode ) +static UINT add_virtual_mode( DEVMODEW *modes, UINT count, const DEVMODEW *mode, BOOL center ) { TRACE( "adding %s\n", debugstr_devmodew(mode) ); + modes[count++] = *mode; + if (!center) return 1; + modes[count] = *mode; - return 1; + modes[count].dmFields |= DM_DISPLAYFIXEDOUTPUT; + modes[count].dmDisplayFixedOutput = DMDFO_CENTER; + return 2; } static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *initial, const DEVMODEW *maximum, @@ -1720,16 +1725,24 @@ static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *ini SIZE *screen_sizes; BOOL vertical; + BOOL center_modes = FALSE; + const char *env; + /* Check the ratio of dmPelsWidth to dmPelsHeight to determine whether the initial display mode * is in horizontal or vertical orientation. DMDO_DEFAULT is the natural orientation of the * device, which isn't necessarily a horizontal mode */ vertical = initial->dmPelsHeight > initial->dmPelsWidth; + if ((env = getenv( "WINE_CENTER_DISPLAY_MODES" ))) + center_modes = (env[0] != '0'); + else if ((env = getenv( "SteamAppId" ))) + center_modes = !strcmp( env, "359870" ); + freqs[1] = devmode_get( initial, DM_DISPLAYFREQUENCY ); if (freqs[1] <= 60) freqs[1] = 0; if (!(screen_sizes = get_screen_sizes( maximum, host_modes, host_modes_count, &sizes_count ))) return NULL; - modes = malloc( ARRAY_SIZE(freqs) * ARRAY_SIZE(depths) * (sizes_count + 2) * sizeof(*modes) ); + modes = malloc( 2 * ARRAY_SIZE(freqs) * ARRAY_SIZE(depths) * (sizes_count + 2) * sizeof(*modes) ); for (i = 0; modes && i < ARRAY_SIZE(depths); ++i) for (f = 0; f < ARRAY_SIZE(freqs); ++f) @@ -1752,18 +1765,18 @@ static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *ini if (mode.dmPelsWidth > maximum->dmPelsWidth || mode.dmPelsHeight > maximum->dmPelsHeight) continue; if (mode.dmPelsWidth == maximum->dmPelsWidth && mode.dmPelsHeight == maximum->dmPelsHeight) continue; if (mode.dmPelsWidth == initial->dmPelsWidth && mode.dmPelsHeight == initial->dmPelsHeight) continue; - count += add_virtual_mode( modes, count, &mode ); + count += add_virtual_mode( modes, count, &mode, center_modes ); } mode.dmPelsWidth = vertical ? initial->dmPelsHeight : initial->dmPelsWidth; mode.dmPelsHeight = vertical ? initial->dmPelsWidth : initial->dmPelsHeight; - count += add_virtual_mode( modes, count, &mode ); + count += add_virtual_mode( modes, count, &mode, center_modes ); if (maximum->dmPelsWidth != initial->dmPelsWidth || maximum->dmPelsHeight != initial->dmPelsHeight) { mode.dmPelsWidth = vertical ? maximum->dmPelsHeight : maximum->dmPelsWidth; mode.dmPelsHeight = vertical ? maximum->dmPelsWidth : maximum->dmPelsHeight; - count += add_virtual_mode( modes, count, &mode ); + count += add_virtual_mode( modes, count, &mode, center_modes ); } } From 344497a455fa5ebeab66e68366341b7c636f0225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 11 Dec 2024 21:48:08 +0100 Subject: [PATCH 0870/2542] win32u: Don't use largest host mode as a base. --- dlls/win32u/sysparams.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index ae94d5a31e12..96919c17f9fc 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1786,23 +1786,6 @@ static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *ini return modes; } -static DEVMODEW find_largest_mode( const DEVMODEW *found, const DEVMODEW *modes, UINT modes_count ) -{ - const DEVMODEW *mode; - - for (mode = modes; mode && modes_count; mode = NEXT_DEVMODEW(mode), modes_count--) - { - if (devmode_get( found, DM_DISPLAYORIENTATION ) != devmode_get( mode, DM_DISPLAYORIENTATION )) continue; - if (devmode_get( found, DM_BITSPERPEL ) >= devmode_get( mode, DM_BITSPERPEL )) continue; - if (devmode_get( found, DM_PELSWIDTH ) >= devmode_get( mode, DM_PELSWIDTH )) continue; - if (devmode_get( found, DM_PELSHEIGHT ) >= devmode_get( mode, DM_PELSHEIGHT )) continue; - if (devmode_get( found, DM_DISPLAYFREQUENCY ) >= devmode_get( mode, DM_DISPLAYFREQUENCY )) continue; - found = mode; - } - - return *found; -} - static void add_modes( const DEVMODEW *current, UINT host_modes_count, const DEVMODEW *host_modes, void *param ) { struct device_manager_ctx *ctx = param; @@ -1824,7 +1807,7 @@ static void add_modes( const DEVMODEW *current, UINT host_modes_count, const DEV } else if (emulate_modelist) { - physical = find_largest_mode( current, modes, modes_count ); + physical = *current; if ((virtual_modes = get_virtual_modes( current, &physical, &physical, host_modes, host_modes_count, &virtual_count ))) { modes_count = virtual_count; From aaa89be55b2a5fc8bd81e05948469d99c510d314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 11 Sep 2024 19:01:42 +0200 Subject: [PATCH 0871/2542] HACK: winegstreamer: Pass H264 codec data as "codec_data" for avc bitstreams. Actually needed since we don't have FFmpeg h264_mp4toannexb BSF yet. CW-Bug-Id: #20833 --- dlls/winegstreamer/wg_media_type.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/dlls/winegstreamer/wg_media_type.c b/dlls/winegstreamer/wg_media_type.c index ef4c915278eb..09a539f1c7a0 100644 --- a/dlls/winegstreamer/wg_media_type.c +++ b/dlls/winegstreamer/wg_media_type.c @@ -65,18 +65,23 @@ DEFINE_MEDIATYPE_GUID(MFVideoFormat_VC1S,MAKEFOURCC('V','C','1','S')); DEFINE_MEDIATYPE_GUID(MFVideoFormat_ABGR32,D3DFMT_A8B8G8R8); DEFINE_MEDIATYPE_GUID(MFVideoFormat_theora,MAKEFOURCC('t','h','e','o')); -static void init_caps_codec_data(GstCaps *caps, const void *codec_data, int codec_data_size) +static void init_caps_codec_data_name(GstCaps *caps, const void *codec_data, int codec_data_size, const char *name) { GstBuffer *buffer; if (codec_data_size > 0 && (buffer = gst_buffer_new_and_alloc(codec_data_size))) { gst_buffer_fill(buffer, 0, codec_data, codec_data_size); - gst_caps_set_simple(caps, "codec_data", GST_TYPE_BUFFER, buffer, NULL); + gst_caps_set_simple(caps, name, GST_TYPE_BUFFER, buffer, NULL); gst_buffer_unref(buffer); } } +static void init_caps_codec_data(GstCaps *caps, const void *codec_data, int codec_data_size) +{ + init_caps_codec_data_name(caps, codec_data, codec_data_size, "codec_data"); +} + static void init_caps_from_wave_format_mpeg1(GstCaps *caps, const MPEG1WAVEFORMAT *format, UINT32 format_size) { init_caps_codec_data(caps, &format->wfx + 1, format->wfx.cbSize); @@ -314,7 +319,13 @@ static void init_caps_from_video_h264(GstCaps *caps, const MFVIDEOFORMAT *format if (format_size > sizeof(*format) && (buffer = gst_buffer_new_and_alloc(format_size - sizeof(*format)))) { gst_buffer_fill(buffer, 0, format + 1, format_size - sizeof(*format)); - gst_caps_set_simple(caps, "streamheader", GST_TYPE_BUFFER, buffer, NULL); + if (format_size - sizeof(*format) >= sizeof(UINT32) && *(UINT32 *)(format + 1) == 0x01000000) + gst_caps_set_simple(caps, "streamheader", GST_TYPE_BUFFER, buffer, NULL); + else + { + gst_caps_set_simple(caps, "codec_data", GST_TYPE_BUFFER, buffer, NULL); + gst_caps_set_simple(caps, "stream-format", G_TYPE_STRING, "avc", NULL); + } gst_buffer_unref(buffer); } } From b1ca399137a3f005b7cd2266c0e5eaace884a398 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 19 May 2021 13:33:36 -0400 Subject: [PATCH 0872/2542] winevulkan: Implement VK_KHR_external_memory_win32 for buffers. Signed-off-by: Derek Lesho --- dlls/vulkan-1/tests/vulkan.c | 5 +- dlls/winevulkan/make_vulkan | 51 +++++-- dlls/winevulkan/vulkan.c | 249 +++++++++++++++++++++++++++++-- dlls/winevulkan/vulkan_private.h | 4 + 4 files changed, 285 insertions(+), 24 deletions(-) diff --git a/dlls/vulkan-1/tests/vulkan.c b/dlls/vulkan-1/tests/vulkan.c index 71ad2c4cf349..10403f3bd264 100644 --- a/dlls/vulkan-1/tests/vulkan.c +++ b/dlls/vulkan-1/tests/vulkan.c @@ -1154,8 +1154,9 @@ static void import_memory(VkDevice vk_device, VkMemoryAllocateInfo alloc_info, V import_handle_info.name = L"wine_test_buffer_export_name"; vr = vkAllocateMemory(vk_device, &alloc_info, NULL, &memory); - ok(vr == VK_SUCCESS, "vkAllocateMemory failed, VkResult %d.\n", vr); - vkFreeMemory(vk_device, memory, NULL); + todo_wine ok(vr == VK_SUCCESS, "vkAllocateMemory failed, VkResult %d.\n", vr); + if (vr == VK_SUCCESS) + vkFreeMemory(vk_device, memory, NULL); } } diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 6606dcab5456..77ee1715b721 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -112,7 +112,6 @@ UNSUPPORTED_EXTENSIONS = [ "VK_EXT_physical_device_drm", "VK_GOOGLE_surfaceless_query", "VK_KHR_external_fence_fd", - "VK_KHR_external_memory_fd", "VK_KHR_external_semaphore_fd", "VK_SEC_amigo_profiling", # Angle specific. @@ -129,7 +128,6 @@ UNSUPPORTED_EXTENSIONS = [ # but not expose to applications (useful for test commits) UNEXPOSED_EXTENSIONS = { "VK_EXT_map_memory_placed", - "VK_KHR_external_memory_win32", } # The Vulkan loader provides entry-points for core functionality and important @@ -174,22 +172,27 @@ FUNCTION_OVERRIDES = { # Instance functions "vkCreateDevice" : {"extra_param" : "client_ptr"}, - "vkGetPhysicalDeviceExternalBufferProperties" : {"dispatch" : False}, + "vkGetPhysicalDeviceExternalBufferProperties" : {"dispatch" : True}, "vkGetPhysicalDeviceExternalFenceProperties" : {"dispatch" : False}, "vkGetPhysicalDeviceExternalSemaphoreProperties" : {"dispatch" : False}, # Device functions "vkCreateCommandPool" : {"extra_param" : "client_ptr"}, "vkGetDeviceProcAddr" : {"dispatch" : False}, + "vkAllocateMemory" : {"extra_param" : "pAllocateInfo"}, # VK_KHR_external_fence_capabilities "vkGetPhysicalDeviceExternalFencePropertiesKHR" : {"dispatch" : False}, # VK_KHR_external_memory_capabilities - "vkGetPhysicalDeviceExternalBufferPropertiesKHR" : {"dispatch" : False}, + "vkGetPhysicalDeviceExternalBufferPropertiesKHR" : {"dispatch" : True}, # VK_KHR_external_semaphore_capabilities "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR" : {"dispatch" : False}, + + # VK_KHR_external_memory_win32 + "vkGetMemoryWin32HandleKHR" : {"dispatch" : True}, + "vkGetMemoryWin32HandlePropertiesKHR" : {"dispatch" : True}, } # functions for which a user driver entry must be generated @@ -243,6 +246,8 @@ MANUAL_UNIX_THUNKS = { "vkGetCalibratedTimestampsEXT", "vkGetCalibratedTimestampsKHR", "vkGetDeviceProcAddr", + "vkGetMemoryWin32HandleKHR", + "vkGetMemoryWin32HandlePropertiesKHR", "vkGetDeviceQueue", "vkGetDeviceQueue2", "vkGetInstanceProcAddr", @@ -290,6 +295,10 @@ STRUCT_CHAIN_CONVERSIONS = { # Ignore to not confuse host loader. "VkDeviceCreateInfo": ["VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO"], "VkInstanceCreateInfo": ["VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO"], + + # Structs which require pNext chain modification + "VkBufferCreateInfo": [], + "VkMemoryAllocateInfo": ["VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR", "VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR"], } # Some struct members are conditionally ignored and callers are free to leave them uninitialized. @@ -808,7 +817,14 @@ class VkFunction(object): proto += ", ".join([p.definition() for p in self.params]) if is_thunk and self.extra_param: - proto += ", void *" + self.extra_param + extra_param_is_new = True + for p in self.params: + if p.name == self.extra_param: + extra_param_is_new = False + if extra_param_is_new: + proto += ", void *" + self.extra_param + else: + proto += ", void *win_" + self.extra_param proto += ")" return proto @@ -895,7 +911,7 @@ class VkFunction(object): if conv: params += ", UlongToPtr({0}{1})".format(params_prefix, self.extra_param) else: - params += ", {0}{1}".format(params_prefix, self.extra_param) + params += ", (void *){0}{1}".format(params_prefix, self.extra_param) if self.name in MANUAL_UNIX_THUNKS: func_prefix = "wine_" @@ -975,9 +991,12 @@ class VkFunction(object): if conv: thunk += " struct\n" thunk += " {\n" + extra_param_is_new = True for p in self.params: thunk += " {0};\n".format(p.definition(conv=True, is_member=True)) - if self.extra_param: + if p.name == self.extra_param: + extra_param_is_new = False + if self.extra_param and extra_param_is_new: thunk += " PTR32 {0};\n".format(self.extra_param) if self.type != "void": thunk += " {0} result;\n".format(self.type) @@ -1568,8 +1587,9 @@ class VkMember(VkVariable): return "{0}{1} = {2} ? {3} : 0;\n".format(output, self.name, self.value(input, conv), handle.unwrap_handle(self.value(input, conv), unwrap)) else: - return "{0}{1} = {2};\n".format(output, self.name, - handle.unwrap_handle(self.value(input, conv), unwrap)) + input_name = "{0}{1}".format(input, self.name) + return "{0}{1} = {2} ? {3} : VK_NULL_HANDLE;\n".format(output, self.name, + input_name, handle.unwrap_handle(self.value(input, conv), unwrap)) elif self.is_generic_handle(): if direction == Direction.OUTPUT: LOGGER.error("OUTPUT parameter {0}.{1} cannot be unwrapped".format(self.type, self.name)) @@ -2440,9 +2460,12 @@ class StructConversionFunction(object): ident = " " if self.direction == Direction.INPUT and self.type in STRUCT_CHAIN_CONVERSIONS: + has_any_chain_conversions = False for i in STRUCT_CHAIN_CONVERSIONS[self.type]: body += " case {0}:\n".format(i) - body += ident + "break;\n" + has_any_chain_conversions = True + if has_any_chain_conversions: + body += ident + "break;\n" for ext in self.operand.struct_extensions: if not ext.required: @@ -2452,6 +2475,8 @@ class StructConversionFunction(object): continue stype = next(x for x in ext.members if x.name == "sType").values + if self.type in STRUCT_CHAIN_CONVERSIONS and stype in STRUCT_CHAIN_CONVERSIONS[self.type]: + continue win_type = ext.name + "32" if self.conv and ext.needs_win32_type() else ext.name if self.direction == Direction.INPUT: in_type = "const " + win_type @@ -3024,9 +3049,13 @@ class VkGenerator(object): f.write("struct {0}_params\n".format(vk_func.name)) f.write("{\n"); + extra_param_is_new = True for p in vk_func.params: f.write(" {0};\n".format(p.definition(is_member=True))) - if vk_func.extra_param: + if p.name == vk_func.extra_param: + extra_param_is_new = False + + if vk_func.extra_param and extra_param_is_new: f.write(" void *{0};\n".format(vk_func.extra_param)) if vk_func.type != "void": f.write(" {0} result;\n".format(vk_func.type)) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 12a37a10b608..8f92368f0cbc 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -23,6 +23,11 @@ #include "config.h" #include +#include + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "wine/server.h" #include "vulkan_private.h" #include "wine/vulkan_driver.h" @@ -365,6 +370,15 @@ static VkResult wine_vk_physical_device_init(struct wine_phys_dev *object, VkPhy */ for (i = 0; i < num_host_properties; i++) { + if (!strcmp(host_properties[i].extensionName, "VK_KHR_external_memory_fd")) + { + TRACE("Substituting VK_KHR_external_memory_fd for VK_KHR_external_memory_win32\n"); + + snprintf(host_properties[i].extensionName, sizeof(host_properties[i].extensionName), + VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME); + host_properties[i].specVersion = VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION; + } + if (wine_vk_device_extension_supported(host_properties[i].extensionName)) { TRACE("Enabling extension '%s' for physical device %p\n", host_properties[i].extensionName, object); @@ -609,6 +623,12 @@ static VkResult wine_vk_device_convert_create_info(VkPhysicalDevice client_physi remove_extensions[remove_count++] = wine_xr_extension_name; } + if (find_extension(extensions, extensions_count, "VK_KHR_external_memory_win32")) + { + extra_extensions[extra_count++] = "VK_KHR_external_memory_fd"; + remove_extensions[remove_count++] = "VK_KHR_external_memory_win32"; + } + if (phys_dev->map_placed_align) { VkPhysicalDeviceMapMemoryPlacedFeaturesEXT *map_placed_features; @@ -1482,18 +1502,71 @@ void wine_vkGetPhysicalDeviceExternalFencePropertiesKHR(VkPhysicalDevice client_ properties->externalFenceFeatures = 0; } +static inline void wine_vk_normalize_handle_types_win(VkExternalMemoryHandleTypeFlags *types) +{ + *types &= + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT; +} + +static inline void wine_vk_normalize_handle_types_host(VkExternalMemoryHandleTypeFlags *types) +{ + *types &= + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT | +/* predicated on VK_KHR_external_memory_dma_buf + VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT | */ + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT; +} + +static void wine_vk_get_physical_device_external_buffer_properties(struct wine_phys_dev *phys_dev, + void (*p_vkGetPhysicalDeviceExternalBufferProperties)(VkPhysicalDevice, const VkPhysicalDeviceExternalBufferInfo *, VkExternalBufferProperties *), + const VkPhysicalDeviceExternalBufferInfo *buffer_info, VkExternalBufferProperties *properties) +{ + VkPhysicalDeviceExternalBufferInfo buffer_info_dup = *buffer_info; + + wine_vk_normalize_handle_types_win(&buffer_info_dup.handleType); + if (buffer_info_dup.handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT) + buffer_info_dup.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; + wine_vk_normalize_handle_types_host(&buffer_info_dup.handleType); + + if (buffer_info->handleType && !buffer_info_dup.handleType) + { + memset(&properties->externalMemoryProperties, 0, sizeof(properties->externalMemoryProperties)); + return; + } + + p_vkGetPhysicalDeviceExternalBufferProperties(phys_dev->obj.host.physical_device, &buffer_info_dup, properties); + + if (properties->externalMemoryProperties.exportFromImportedHandleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) + properties->externalMemoryProperties.exportFromImportedHandleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; + wine_vk_normalize_handle_types_win(&properties->externalMemoryProperties.exportFromImportedHandleTypes); + + if (properties->externalMemoryProperties.compatibleHandleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) + properties->externalMemoryProperties.compatibleHandleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; + wine_vk_normalize_handle_types_win(&properties->externalMemoryProperties.compatibleHandleTypes); +} + void wine_vkGetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice client_physical_device, const VkPhysicalDeviceExternalBufferInfo *buffer_info, VkExternalBufferProperties *properties) { - memset(&properties->externalMemoryProperties, 0, sizeof(properties->externalMemoryProperties)); + struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(client_physical_device); + wine_vk_get_physical_device_external_buffer_properties(phys_dev, phys_dev->obj.instance->p_vkGetPhysicalDeviceExternalBufferProperties, buffer_info, properties); } void wine_vkGetPhysicalDeviceExternalBufferPropertiesKHR(VkPhysicalDevice client_physical_device, const VkPhysicalDeviceExternalBufferInfo *buffer_info, VkExternalBufferProperties *properties) { - memset(&properties->externalMemoryProperties, 0, sizeof(properties->externalMemoryProperties)); + struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(client_physical_device); + wine_vk_get_physical_device_external_buffer_properties(phys_dev, phys_dev->obj.instance->p_vkGetPhysicalDeviceExternalBufferPropertiesKHR, buffer_info, properties); } VkResult wine_vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice client_physical_device, @@ -1764,12 +1837,28 @@ void wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice cli properties->externalSemaphoreFeatures = 0; } +static HANDLE create_gpu_resource(int fd, LPCWSTR name) +{ + HANDLE ret = INVALID_HANDLE_VALUE; + + TRACE("Creating shared vulkan resource fd %d name %s.\n", fd, debugstr_w(name)); + + if (name) + FIXME("Naming gpu resources not supported.\n"); + + wine_server_fd_to_handle(fd, GENERIC_ALL, 0, &ret); + + return ret; +} + VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInfo *alloc_info, - const VkAllocationCallbacks *allocator, VkDeviceMemory *ret) + const VkAllocationCallbacks *allocator, VkDeviceMemory *ret, + void *win_pAllocateInfo) { struct vulkan_device *device = vulkan_device_from_handle(client_device); struct wine_phys_dev *physical_device = CONTAINING_RECORD(device->physical_device, struct wine_phys_dev, obj); struct vulkan_instance *instance = device->physical_device->instance; + const VkMemoryAllocateInfo *win_alloc_info = win_pAllocateInfo; struct wine_device_memory *memory; VkMemoryAllocateInfo info = *alloc_info; VkImportMemoryHostPointerInfoEXT host_pointer_info; @@ -1778,12 +1867,74 @@ VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInf void *mapping = NULL; VkResult result; - /* For host visible memory, we try to use VK_EXT_external_memory_host on wow64 - * to ensure that mapped pointer is 32-bit. */ + const VkImportMemoryWin32HandleInfoKHR *handle_import_info; + const VkExportMemoryWin32HandleInfoKHR *handle_export_info; + VkExportMemoryAllocateInfo *export_info; + VkImportMemoryFdInfoKHR fd_import_info; + VkMemoryGetFdInfoKHR get_fd_info; + int fd; + + if (!(memory = calloc(sizeof(*memory), 1))) + return VK_ERROR_OUT_OF_HOST_MEMORY; + + memory->handle = INVALID_HANDLE_VALUE; + fd_import_info.fd = -1; + fd_import_info.pNext = NULL; + + /* find and process handle import/export info and grab it */ + handle_import_info = find_next_struct(win_alloc_info, VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR); + handle_export_info = find_next_struct(win_alloc_info, VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR); + if (handle_export_info && handle_export_info->pAttributes && handle_export_info->pAttributes->lpSecurityDescriptor) + FIXME("Support for custom security descriptor not implemented.\n"); + + if ((export_info = find_next_struct(alloc_info, VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO))) + { + memory->handle_types = export_info->handleTypes; + if (export_info->handleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT) + export_info->handleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; + wine_vk_normalize_handle_types_host(&export_info->handleTypes); + } + mem_flags = physical_device->memory_properties.memoryTypes[alloc_info->memoryTypeIndex].propertyFlags; - if (physical_device->external_memory_align && (mem_flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) && + + /* Vulkan consumes imported FDs, but not imported HANDLEs */ + if (handle_import_info) + { + fd_import_info.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR; + fd_import_info.pNext = info.pNext; + fd_import_info.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; + info.pNext = &fd_import_info; + + switch (handle_import_info->handleType) + { + case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT: + if (handle_import_info->handle) + NtDuplicateObject( NtCurrentProcess(), handle_import_info->handle, NtCurrentProcess(), &memory->handle, 0, 0, DUPLICATE_SAME_ACCESS ); + else if (handle_import_info->name) + FIXME("Importing device memory by resource name not supported.\n"); + break; + default: + WARN("Invalid handle type %08x passed in.\n", handle_import_info->handleType); + result = VK_ERROR_INVALID_EXTERNAL_HANDLE; + goto done; + } + + if (memory->handle != INVALID_HANDLE_VALUE) + wine_server_handle_to_fd(memory->handle, FILE_READ_DATA, &fd_import_info.fd, NULL); + + if (fd_import_info.fd == -1) + { + TRACE("Couldn't access resource handle or name. type=%08x handle=%p name=%s\n", handle_import_info->handleType, handle_import_info->handle, + handle_import_info->name ? debugstr_w(handle_import_info->name) : ""); + result = VK_ERROR_INVALID_EXTERNAL_HANDLE; + goto done; + } + } + else if (physical_device->external_memory_align && (mem_flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) && !find_next_struct(alloc_info->pNext, VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT)) { + /* For host visible memory, we try to use VK_EXT_external_memory_host on wow64 + * to ensure that mapped pointer is 32-bit. */ VkMemoryHostPointerPropertiesEXT props = { .sType = VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT, @@ -1799,6 +1950,7 @@ VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInf MEM_COMMIT, PAGE_READWRITE)) { ERR("NtAllocateVirtualMemory failed\n"); + free(memory); return VK_ERROR_OUT_OF_HOST_MEMORY; } @@ -1807,6 +1959,7 @@ VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInf if (result != VK_SUCCESS) { ERR("vkGetMemoryHostPointerPropertiesEXT failed: %d\n", result); + free(memory); return result; } @@ -1846,12 +1999,39 @@ VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInf } } - if (!(memory = malloc(sizeof(*memory)))) - return VK_ERROR_OUT_OF_HOST_MEMORY; - result = device->p_vkAllocateMemory(device->host.device, &info, NULL, &host_device_memory); + if (result == VK_SUCCESS && memory->handle == INVALID_HANDLE_VALUE && export_info && export_info->handleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) + { + get_fd_info.sType = VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR; + get_fd_info.pNext = NULL; + get_fd_info.memory = host_device_memory; + get_fd_info.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; + + if (device->p_vkGetMemoryFdKHR(device->host.device, &get_fd_info, &fd) == VK_SUCCESS) + { + memory->handle = create_gpu_resource(fd, handle_export_info ? handle_export_info->name : NULL); + memory->access = handle_export_info ? handle_export_info->dwAccess : GENERIC_ALL; + if (handle_export_info && handle_export_info->pAttributes) + memory->inherit = handle_export_info->pAttributes->bInheritHandle; + else + memory->inherit = FALSE; + close(fd); + } + + if (memory->handle == INVALID_HANDLE_VALUE) + { + device->p_vkFreeMemory(device->host.device, host_device_memory, NULL); + result = VK_ERROR_OUT_OF_HOST_MEMORY; + goto done; + } + } +done: if (result != VK_SUCCESS) { + if (fd_import_info.fd != -1) + close(fd_import_info.fd); + if (memory->handle != INVALID_HANDLE_VALUE) + NtClose(memory->handle); free(memory); return result; } @@ -1896,6 +2076,9 @@ void wine_vkFreeMemory(VkDevice client_device, VkDeviceMemory memory_handle, con NtFreeVirtualMemory(GetCurrentProcess(), &memory->vm_map, &alloc_size, MEM_RELEASE); } + if (memory->handle != INVALID_HANDLE_VALUE) + NtClose(memory->handle); + free(memory); } @@ -2040,10 +2223,16 @@ VkResult wine_vkCreateBuffer(VkDevice client_device, const VkBufferCreateInfo *c { struct vulkan_device *device = vulkan_device_from_handle(client_device); struct wine_phys_dev *physical_device = CONTAINING_RECORD(device->physical_device, struct wine_phys_dev, obj); - VkExternalMemoryBufferCreateInfo external_memory_info; + VkExternalMemoryBufferCreateInfo external_memory_info, *ext_info; VkBufferCreateInfo info = *create_info; - if (physical_device->external_memory_align && + if ((ext_info = find_next_struct(create_info, VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO))) + { + if (ext_info->handleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT) + ext_info->handleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; + wine_vk_normalize_handle_types_host(&ext_info->handleTypes); + } + else if (physical_device->external_memory_align && !find_next_struct(info.pNext, VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO)) { external_memory_info.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO; @@ -2257,6 +2446,8 @@ NTSTATUS vk_is_available_device_function(void *arg) { struct is_available_device_function_params *params = arg; struct vulkan_device *device = vulkan_device_from_handle(params->device); + if (!strcmp(params->name, "vkGetMemoryWin32HandleKHR") || !strcmp(params->name, "vkGetMemoryWin32HandlePropertiesKHR")) + params->name = "vkGetMemoryFdKHR"; return !!vk_funcs->p_vkGetDeviceProcAddr(device->host.device, params->name); } @@ -2287,5 +2478,41 @@ NTSTATUS vk_is_available_device_function32(void *arg) UINT32 name; } *params = arg; struct vulkan_device *device = vulkan_device_from_handle(UlongToPtr(params->device)); + char *name = UlongToPtr(params->name); + if (!strcmp(name, "vkGetMemoryWin32HandleKHR") || !strcmp(name, "vkGetMemoryWin32HandlePropertiesKHR")) + return !!vk_funcs->p_vkGetDeviceProcAddr(device->host.device, "vkGetMemoryFdKHR"); return !!vk_funcs->p_vkGetDeviceProcAddr(device->host.device, UlongToPtr(params->name)); } + +VkResult wine_vkGetMemoryWin32HandleKHR(VkDevice device, const VkMemoryGetWin32HandleInfoKHR *handle_info, HANDLE *handle) +{ + struct wine_device_memory *dev_mem = wine_device_memory_from_handle(handle_info->memory); + const VkBaseInStructure *chain; + + TRACE("%p, %p %p\n", device, handle_info, handle); + + if (!(dev_mem->handle_types & handle_info->handleType)) + return VK_ERROR_UNKNOWN; + + if ((chain = handle_info->pNext)) + FIXME("Ignoring a linked structure of type %u.\n", chain->sType); + + switch(handle_info->handleType) + { + case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT: + return !NtDuplicateObject( NtCurrentProcess(), dev_mem->handle, NtCurrentProcess(), handle, dev_mem->access, dev_mem->inherit ? OBJ_INHERIT : 0, 0) ? + VK_SUCCESS : VK_ERROR_OUT_OF_HOST_MEMORY; + default: + FIXME("Unable to get handle of type %x, did the application ignore the capabilities?\n", handle_info->handleType); + return VK_ERROR_UNKNOWN; + } +} + +VkResult wine_vkGetMemoryWin32HandlePropertiesKHR(VkDevice device, VkExternalMemoryHandleTypeFlagBits type, HANDLE handle, VkMemoryWin32HandlePropertiesKHR *properties) +{ + TRACE("%p %u %p %p\n", device, type, handle, properties); + + /* VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-00666 + handleType must not be one of the handle types defined as opaque */ + return VK_ERROR_INVALID_EXTERNAL_HANDLE; +} diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index e0ab34026f62..87bc1ae74b40 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -105,6 +105,10 @@ struct wine_device_memory VULKAN_OBJECT_HEADER( VkDeviceMemory, device_memory ); VkDeviceSize size; void *vm_map; + VkExternalMemoryHandleTypeFlagBits handle_types; + BOOL inherit; + DWORD access; + HANDLE handle; }; static inline struct wine_device_memory *wine_device_memory_from_handle(VkDeviceMemory handle) From f888674416866d4112ad9d6d9e6435b79a93440b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 22 Dec 2022 11:09:20 -0600 Subject: [PATCH 0873/2542] winevulkan: Factor out wine_vk_get_physical_device_image_format_properties_2(). --- dlls/winevulkan/vulkan.c | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 8f92368f0cbc..dc00ec38f3bc 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -1569,16 +1569,14 @@ void wine_vkGetPhysicalDeviceExternalBufferPropertiesKHR(VkPhysicalDevice client wine_vk_get_physical_device_external_buffer_properties(phys_dev, phys_dev->obj.instance->p_vkGetPhysicalDeviceExternalBufferPropertiesKHR, buffer_info, properties); } -VkResult wine_vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice client_physical_device, - const VkPhysicalDeviceImageFormatInfo2 *format_info, - VkImageFormatProperties2 *properties) +static VkResult wine_vk_get_physical_device_image_format_properties_2(struct vulkan_physical_device *physical_device, + VkResult (*p_vkGetPhysicalDeviceImageFormatProperties2)(VkPhysicalDevice, const VkPhysicalDeviceImageFormatInfo2 *, VkImageFormatProperties2 *), + const VkPhysicalDeviceImageFormatInfo2 *format_info, VkImageFormatProperties2 *properties) { - struct vulkan_physical_device *physical_device = vulkan_physical_device_from_handle(client_physical_device); - struct vulkan_instance *instance = physical_device->instance; VkExternalImageFormatProperties *external_image_properties; VkResult res; - res = instance->p_vkGetPhysicalDeviceImageFormatProperties2(physical_device->host.physical_device, format_info, properties); + res = p_vkGetPhysicalDeviceImageFormatProperties2(physical_device->host.physical_device, format_info, properties); if ((external_image_properties = find_next_struct(properties, VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES))) @@ -1592,27 +1590,28 @@ VkResult wine_vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice client_ return res; } +VkResult wine_vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice client_physical_device, + const VkPhysicalDeviceImageFormatInfo2 *format_info, + VkImageFormatProperties2 *properties) +{ + struct vulkan_physical_device *physical_device = vulkan_physical_device_from_handle(client_physical_device); + struct vulkan_instance *instance = physical_device->instance; + + return wine_vk_get_physical_device_image_format_properties_2(physical_device, + instance->p_vkGetPhysicalDeviceImageFormatProperties2, + format_info, properties); +} + VkResult wine_vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice client_physical_device, const VkPhysicalDeviceImageFormatInfo2 *format_info, VkImageFormatProperties2 *properties) { struct vulkan_physical_device *physical_device = vulkan_physical_device_from_handle(client_physical_device); struct vulkan_instance *instance = physical_device->instance; - VkExternalImageFormatProperties *external_image_properties; - VkResult res; - res = instance->p_vkGetPhysicalDeviceImageFormatProperties2KHR(physical_device->host.physical_device, format_info, properties); - - if ((external_image_properties = find_next_struct(properties, - VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES))) - { - VkExternalMemoryProperties *p = &external_image_properties->externalMemoryProperties; - p->externalMemoryFeatures = 0; - p->exportFromImportedHandleTypes = 0; - p->compatibleHandleTypes = 0; - } - - return res; + return wine_vk_get_physical_device_image_format_properties_2(physical_device, + instance->p_vkGetPhysicalDeviceImageFormatProperties2KHR, + format_info, properties); } /* From ntdll/unix/sync.c */ From caf940d85efb6c4c993d4e3cf4e34c8c0f113cde Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 19 May 2021 13:38:12 -0400 Subject: [PATCH 0874/2542] winevulkan: Implement VK_KHR_external_memory_win32 for images. Signed-off-by: Derek Lesho --- dlls/winevulkan/make_vulkan | 2 ++ dlls/winevulkan/vulkan.c | 39 +++++++++++++++++++++++++++++++------ 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 77ee1715b721..c6d6f7581be9 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -298,7 +298,9 @@ STRUCT_CHAIN_CONVERSIONS = { # Structs which require pNext chain modification "VkBufferCreateInfo": [], + "VkImageCreateInfo": [], "VkMemoryAllocateInfo": ["VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR", "VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR"], + "VkPhysicalDeviceImageFormatInfo2": [], } # Some struct members are conditionally ignored and callers are free to leave them uninitialized. diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index dc00ec38f3bc..d01d9a3f85b7 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -1573,18 +1573,40 @@ static VkResult wine_vk_get_physical_device_image_format_properties_2(struct vul VkResult (*p_vkGetPhysicalDeviceImageFormatProperties2)(VkPhysicalDevice, const VkPhysicalDeviceImageFormatInfo2 *, VkImageFormatProperties2 *), const VkPhysicalDeviceImageFormatInfo2 *format_info, VkImageFormatProperties2 *properties) { + VkPhysicalDeviceExternalImageFormatInfo *external_image_info; VkExternalImageFormatProperties *external_image_properties; VkResult res; + if ((external_image_info = find_next_struct(format_info, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO)) + && external_image_info->handleType) + { + wine_vk_normalize_handle_types_win(&external_image_info->handleType); + + if (external_image_info->handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT) + external_image_info->handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; + + wine_vk_normalize_handle_types_host(&external_image_info->handleType); + if (!external_image_info->handleType) + { + FIXME("Unsupported handle type %#x.\n", external_image_info->handleType); + return VK_ERROR_FORMAT_NOT_SUPPORTED; + } + } + res = p_vkGetPhysicalDeviceImageFormatProperties2(physical_device->host.physical_device, format_info, properties); if ((external_image_properties = find_next_struct(properties, VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES))) { VkExternalMemoryProperties *p = &external_image_properties->externalMemoryProperties; - p->externalMemoryFeatures = 0; - p->exportFromImportedHandleTypes = 0; - p->compatibleHandleTypes = 0; + + if (p->exportFromImportedHandleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) + p->exportFromImportedHandleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; + wine_vk_normalize_handle_types_win(&p->exportFromImportedHandleTypes); + + if (p->compatibleHandleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) + p->compatibleHandleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; + wine_vk_normalize_handle_types_win(&p->compatibleHandleTypes); } return res; @@ -2248,11 +2270,16 @@ VkResult wine_vkCreateImage(VkDevice client_device, const VkImageCreateInfo *cre { struct vulkan_device *device = vulkan_device_from_handle(client_device); struct wine_phys_dev *physical_device = CONTAINING_RECORD(device->physical_device, struct wine_phys_dev, obj); - VkExternalMemoryImageCreateInfo external_memory_info; + VkExternalMemoryImageCreateInfo external_memory_info, *update_info; VkImageCreateInfo info = *create_info; - if (physical_device->external_memory_align && - !find_next_struct(info.pNext, VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO)) + if ((update_info = find_next_struct(info.pNext, VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO))) + { + if (update_info->handleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR) + update_info->handleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR; + wine_vk_normalize_handle_types_host(&update_info->handleTypes); + } + else if (physical_device->external_memory_align) { external_memory_info.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO; external_memory_info.pNext = info.pNext; From 732ae6cd9f9db09af7f0dad1ee37dc7f400991c7 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 13 Oct 2021 13:16:44 +0200 Subject: [PATCH 0875/2542] winevulkan: Implement support for KMT handles and named objects. --- configure.ac | 1 + dlls/sharedgpures.sys/Makefile.in | 6 + dlls/sharedgpures.sys/shared_resource.c | 347 ++++++++++++++++++++ dlls/sharedgpures.sys/sharedgpures.sys.spec | 1 + dlls/winevulkan/vulkan.c | 190 ++++++++++- dlls/winevulkan/vulkan_private.h | 7 + include/ddk/wdm.h | 1 + loader/wine.inf.in | 13 + 8 files changed, 551 insertions(+), 15 deletions(-) create mode 100644 dlls/sharedgpures.sys/Makefile.in create mode 100644 dlls/sharedgpures.sys/shared_resource.c create mode 100644 dlls/sharedgpures.sys/sharedgpures.sys.spec diff --git a/configure.ac b/configure.ac index 15e0914ca5b0..0f61a2ce5d0d 100644 --- a/configure.ac +++ b/configure.ac @@ -3127,6 +3127,7 @@ WINE_CONFIG_MAKEFILE(dlls/setupapi/tests) WINE_CONFIG_MAKEFILE(dlls/setupx.dll16,enable_win16) WINE_CONFIG_MAKEFILE(dlls/sfc) WINE_CONFIG_MAKEFILE(dlls/sfc_os) +WINE_CONFIG_MAKEFILE(dlls/sharedgpures.sys) WINE_CONFIG_MAKEFILE(dlls/shcore) WINE_CONFIG_MAKEFILE(dlls/shcore/tests) WINE_CONFIG_MAKEFILE(dlls/shdoclc) diff --git a/dlls/sharedgpures.sys/Makefile.in b/dlls/sharedgpures.sys/Makefile.in new file mode 100644 index 000000000000..9aca43fb45ee --- /dev/null +++ b/dlls/sharedgpures.sys/Makefile.in @@ -0,0 +1,6 @@ +MODULE = sharedgpures.sys +IMPORTS = ntoskrnl +EXTRADLLFLAGS = -Wl,--subsystem,native + +SOURCES = \ + shared_resource.c diff --git a/dlls/sharedgpures.sys/shared_resource.c b/dlls/sharedgpures.sys/shared_resource.c new file mode 100644 index 000000000000..e1330888b046 --- /dev/null +++ b/dlls/sharedgpures.sys/shared_resource.c @@ -0,0 +1,347 @@ +#include + +#define NONAMELESSUNION +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winbase.h" +#include "winternl.h" +#include "winioctl.h" + +#include "ddk/wdm.h" + +#include "wine/debug.h" +#include "wine/list.h" +#include "wine/server.h" + +WINE_DEFAULT_DEBUG_CHANNEL(sharedgpures); + +static DRIVER_OBJECT *sharedgpures_driver; + +struct shared_resource +{ + unsigned int ref_count; + void *unix_resource; + WCHAR *name; +}; + +static struct shared_resource *resource_pool; +static unsigned int resource_pool_size; + +/* TODO: If/when ntoskrnl gets support for referencing user handles directly, remove this function */ +static void *reference_client_handle(obj_handle_t handle) +{ + HANDLE client_process, kernel_handle; + OBJECT_ATTRIBUTES attr; + void *object = NULL; + CLIENT_ID cid; + + attr.Length = sizeof(OBJECT_ATTRIBUTES); + attr.RootDirectory = 0; + attr.Attributes = OBJ_KERNEL_HANDLE; + attr.ObjectName = NULL; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + cid.UniqueProcess = PsGetCurrentProcessId(); + cid.UniqueThread = 0; + + if (NtOpenProcess(&client_process, PROCESS_ALL_ACCESS, &attr, &cid) != STATUS_SUCCESS) + return NULL; + + if (NtDuplicateObject(client_process, wine_server_ptr_handle(handle), NtCurrentProcess(), &kernel_handle, + 0, OBJ_KERNEL_HANDLE, DUPLICATE_SAME_ACCESS) != STATUS_SUCCESS) + { + NtClose(client_process); + return NULL; + } + + ObReferenceObjectByHandle(kernel_handle, 0, NULL, KernelMode, &object, NULL); + + NtClose(client_process); + NtClose(kernel_handle); + + return object; +} + +#define IOCTL_SHARED_GPU_RESOURCE_CREATE CTL_CODE(FILE_DEVICE_VIDEO, 0, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +struct shared_resource_create +{ + obj_handle_t unix_handle; + WCHAR name[1]; +}; + +static NTSTATUS shared_resource_create(struct shared_resource **res, void *buff, SIZE_T insize, IO_STATUS_BLOCK *iosb) +{ + struct shared_resource_create *input = buff; + void *unix_resource; + unsigned int i; + LPWSTR name; + + if (insize < sizeof(*input)) + return STATUS_INFO_LENGTH_MISMATCH; + + if (input->name[ ((insize - offsetof(struct shared_resource_create, name)) / sizeof(WCHAR)) - 1 ]) + return STATUS_INVALID_PARAMETER; + + if (!(unix_resource = reference_client_handle(input->unix_handle))) + return STATUS_INVALID_HANDLE; + + if (insize == sizeof(*input)) + name = NULL; + else + { + name = ExAllocatePoolWithTag(NonPagedPool, insize - offsetof(struct shared_resource_create, name), 0); + wcscpy(name, &input->name[0]); + } + + for (i = 0; i < resource_pool_size; i++) + if (!resource_pool[i].ref_count) + break; + + if (i == resource_pool_size) + { + struct shared_resource *expanded_pool = + ExAllocatePoolWithTag(NonPagedPool, sizeof(struct shared_resource) * (resource_pool_size + 1024), 0); + + if (resource_pool) + { + memcpy(expanded_pool, resource_pool, resource_pool_size * sizeof(struct shared_resource)); + ExFreePoolWithTag(resource_pool, 0); + } + + memset(&expanded_pool[resource_pool_size], 0, 1024 * sizeof (struct shared_resource)); + + resource_pool = expanded_pool; + resource_pool_size += 1024; + } + + *res = &resource_pool[i]; + (*res)->ref_count = 1; + (*res)->unix_resource = unix_resource; + (*res)->name = name; + + iosb->Information = 0; + return STATUS_SUCCESS; +} + +#define IOCTL_SHARED_GPU_RESOURCE_OPEN CTL_CODE(FILE_DEVICE_VIDEO, 1, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +struct shared_resource_open +{ + obj_handle_t kmt_handle; + WCHAR name[1]; +}; + +static unsigned int kmt_to_index(obj_handle_t kmt) +{ + if (!(kmt & 0x40000000) || (kmt - 2) % 4) + return -1; + return (((unsigned int) kmt & ~0x40000000) - 2) / 4; +} + +static NTSTATUS shared_resource_open(struct shared_resource **res, void *buff, SIZE_T insize, IO_STATUS_BLOCK *iosb) +{ + struct shared_resource_open *input = buff; + unsigned int i; + + if (insize < sizeof(*input)) + return STATUS_INFO_LENGTH_MISMATCH; + + if (input->kmt_handle) + { + if (kmt_to_index(input->kmt_handle) >= resource_pool_size) + return STATUS_INVALID_HANDLE; + + *res = &resource_pool[kmt_to_index(input->kmt_handle)]; + } + else + { + if (input->name[ ((insize - offsetof(struct shared_resource_open, name)) / sizeof(WCHAR)) - 1 ]) + return STATUS_INVALID_PARAMETER; + + /* name lookup */ + for (i = 0; i < resource_pool_size; i++) + { + if (resource_pool[i].name && !wcscmp(resource_pool[i].name, input->name)) + { + *res = &resource_pool[i]; + break; + } + } + if (i == resource_pool_size) + return STATUS_OBJECT_NAME_NOT_FOUND; + } + + (*res)->ref_count++; + iosb->Information = 0; + return STATUS_SUCCESS; +} + +#define IOCTL_SHARED_GPU_RESOURCE_GETKMT CTL_CODE(FILE_DEVICE_VIDEO, 2, METHOD_BUFFERED, FILE_READ_ACCESS) + +static obj_handle_t index_to_kmt(unsigned int idx) +{ + return (idx * 4 + 2) | 0x40000000; +} + +static NTSTATUS shared_resource_getkmt(struct shared_resource *res, void *buff, SIZE_T outsize, IO_STATUS_BLOCK *iosb) +{ + if (outsize < sizeof(unsigned int)) + return STATUS_INFO_LENGTH_MISMATCH; + + *((unsigned int *)buff) = index_to_kmt(res - resource_pool); + + iosb->Information = sizeof(unsigned int); + return STATUS_SUCCESS; +} + +/* TODO: If/when ntoskrnl gets support for opening user handles directly, remove this function */ +static obj_handle_t open_client_handle(void *object) +{ + HANDLE client_process, kernel_handle, handle = NULL; + OBJECT_ATTRIBUTES attr; + CLIENT_ID cid; + + attr.Length = sizeof(OBJECT_ATTRIBUTES); + attr.RootDirectory = 0; + attr.Attributes = OBJ_KERNEL_HANDLE; + attr.ObjectName = NULL; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + cid.UniqueProcess = PsGetCurrentProcessId(); + cid.UniqueThread = 0; + + if (NtOpenProcess(&client_process, PROCESS_ALL_ACCESS, &attr, &cid) != STATUS_SUCCESS) + return 0; + + if (ObOpenObjectByPointer(object, 0, NULL, GENERIC_ALL, NULL, KernelMode, &kernel_handle) != STATUS_SUCCESS) + { + NtClose(client_process); + return 0; + } + + NtDuplicateObject(NtCurrentProcess(), kernel_handle, client_process, &handle, + 0, 0, DUPLICATE_SAME_ACCESS); + + NtClose(client_process); + NtClose(kernel_handle); + + return wine_server_obj_handle(handle); +} + +#define IOCTL_SHARED_GPU_RESOURCE_GET_UNIX_RESOURCE CTL_CODE(FILE_DEVICE_VIDEO, 3, METHOD_BUFFERED, FILE_READ_ACCESS) + +static NTSTATUS shared_resource_get_unix_resource(struct shared_resource *res, void *buff, SIZE_T outsize, IO_STATUS_BLOCK *iosb) +{ + if (outsize < sizeof(obj_handle_t)) + return STATUS_INFO_LENGTH_MISMATCH; + + *((obj_handle_t *)buff) = open_client_handle(res->unix_resource); + + iosb->Information = sizeof(obj_handle_t); + return STATUS_SUCCESS; +} + +static NTSTATUS WINAPI dispatch_create(DEVICE_OBJECT *device, IRP *irp) +{ + irp->IoStatus.u.Status = STATUS_SUCCESS; + IoCompleteRequest(irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; +} + +static NTSTATUS WINAPI dispatch_close(DEVICE_OBJECT *device, IRP *irp) +{ + IO_STACK_LOCATION *stack = IoGetCurrentIrpStackLocation(irp); + struct shared_resource *res = stack->FileObject->FsContext; + + TRACE("Freeing shared resouce %p.\n", res); + + if (res) + { + res->ref_count--; + if (!res->ref_count && res->unix_resource) + { + /* TODO: see if its possible to destroy the object here (unlink?) */ + ObDereferenceObject(res->unix_resource); + res->unix_resource = NULL; + } + } + + irp->IoStatus.u.Status = STATUS_SUCCESS; + IoCompleteRequest(irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; +} + +static NTSTATUS WINAPI dispatch_ioctl(DEVICE_OBJECT *device, IRP *irp) +{ + IO_STACK_LOCATION *stack = IoGetCurrentIrpStackLocation( irp ); + struct shared_resource **res = (struct shared_resource **) &stack->FileObject->FsContext; + NTSTATUS status; + + TRACE( "ioctl %#lx insize %lu outsize %lu\n", + stack->Parameters.DeviceIoControl.IoControlCode, + stack->Parameters.DeviceIoControl.InputBufferLength, + stack->Parameters.DeviceIoControl.OutputBufferLength ); + + switch (stack->Parameters.DeviceIoControl.IoControlCode) + { + case IOCTL_SHARED_GPU_RESOURCE_CREATE: + status = shared_resource_create( res, + irp->AssociatedIrp.SystemBuffer, + stack->Parameters.DeviceIoControl.InputBufferLength, + &irp->IoStatus ); + break; + case IOCTL_SHARED_GPU_RESOURCE_OPEN: + status = shared_resource_open( res, + irp->AssociatedIrp.SystemBuffer, + stack->Parameters.DeviceIoControl.InputBufferLength, + &irp->IoStatus ); + break; + case IOCTL_SHARED_GPU_RESOURCE_GETKMT: + status = shared_resource_getkmt( *res, + irp->AssociatedIrp.SystemBuffer, + stack->Parameters.DeviceIoControl.OutputBufferLength, + &irp->IoStatus ); + break; + case IOCTL_SHARED_GPU_RESOURCE_GET_UNIX_RESOURCE: + status = shared_resource_get_unix_resource( *res, + irp->AssociatedIrp.SystemBuffer, + stack->Parameters.DeviceIoControl.OutputBufferLength, + &irp->IoStatus ); + break; + default: + FIXME( "ioctl %#lx not supported\n", stack->Parameters.DeviceIoControl.IoControlCode ); + status = STATUS_NOT_SUPPORTED; + break; + } + + irp->IoStatus.u.Status = status; + IoCompleteRequest( irp, IO_NO_INCREMENT ); + return status; +} + +NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) +{ + static const WCHAR device_nameW[] = L"\\Device\\SharedGpuResource"; + static const WCHAR link_nameW[] = L"\\??\\SharedGpuResource"; + UNICODE_STRING device_name, link_name; + DEVICE_OBJECT *device; + NTSTATUS status; + + sharedgpures_driver = driver; + + driver->MajorFunction[IRP_MJ_CREATE] = dispatch_create; + driver->MajorFunction[IRP_MJ_CLOSE] = dispatch_close; + driver->MajorFunction[IRP_MJ_DEVICE_CONTROL] = dispatch_ioctl; + + RtlInitUnicodeString(&device_name, device_nameW); + RtlInitUnicodeString(&link_name, link_nameW); + + if ((status = IoCreateDevice(driver, 0, &device_name, 0, 0, FALSE, &device))) + return status; + + return IoCreateSymbolicLink(&link_name, &device_name); +} diff --git a/dlls/sharedgpures.sys/sharedgpures.sys.spec b/dlls/sharedgpures.sys/sharedgpures.sys.spec new file mode 100644 index 000000000000..76421d7e35b4 --- /dev/null +++ b/dlls/sharedgpures.sys/sharedgpures.sys.spec @@ -0,0 +1 @@ +# nothing to export diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index d01d9a3f85b7..0ec6f0f2ec45 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -27,6 +27,9 @@ #include "ntstatus.h" #define WIN32_NO_STATUS +#include "windef.h" +#include "winnt.h" +#include "winioctl.h" #include "wine/server.h" #include "vulkan_private.h" @@ -1525,6 +1528,10 @@ static inline void wine_vk_normalize_handle_types_host(VkExternalMemoryHandleTyp VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT; } +static const VkExternalMemoryHandleTypeFlagBits wine_vk_handle_over_fd_types = + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT; + static void wine_vk_get_physical_device_external_buffer_properties(struct wine_phys_dev *phys_dev, void (*p_vkGetPhysicalDeviceExternalBufferProperties)(VkPhysicalDevice, const VkPhysicalDeviceExternalBufferInfo *, VkExternalBufferProperties *), const VkPhysicalDeviceExternalBufferInfo *buffer_info, VkExternalBufferProperties *properties) @@ -1532,7 +1539,7 @@ static void wine_vk_get_physical_device_external_buffer_properties(struct wine_p VkPhysicalDeviceExternalBufferInfo buffer_info_dup = *buffer_info; wine_vk_normalize_handle_types_win(&buffer_info_dup.handleType); - if (buffer_info_dup.handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT) + if (buffer_info_dup.handleType & wine_vk_handle_over_fd_types) buffer_info_dup.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; wine_vk_normalize_handle_types_host(&buffer_info_dup.handleType); @@ -1545,11 +1552,11 @@ static void wine_vk_get_physical_device_external_buffer_properties(struct wine_p p_vkGetPhysicalDeviceExternalBufferProperties(phys_dev->obj.host.physical_device, &buffer_info_dup, properties); if (properties->externalMemoryProperties.exportFromImportedHandleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) - properties->externalMemoryProperties.exportFromImportedHandleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; + properties->externalMemoryProperties.exportFromImportedHandleTypes |= wine_vk_handle_over_fd_types; wine_vk_normalize_handle_types_win(&properties->externalMemoryProperties.exportFromImportedHandleTypes); if (properties->externalMemoryProperties.compatibleHandleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) - properties->externalMemoryProperties.compatibleHandleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; + properties->externalMemoryProperties.compatibleHandleTypes |= wine_vk_handle_over_fd_types; wine_vk_normalize_handle_types_win(&properties->externalMemoryProperties.compatibleHandleTypes); } @@ -1582,7 +1589,7 @@ static VkResult wine_vk_get_physical_device_image_format_properties_2(struct vul { wine_vk_normalize_handle_types_win(&external_image_info->handleType); - if (external_image_info->handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT) + if (external_image_info->handleType & wine_vk_handle_over_fd_types) external_image_info->handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; wine_vk_normalize_handle_types_host(&external_image_info->handleType); @@ -1601,11 +1608,11 @@ static VkResult wine_vk_get_physical_device_image_format_properties_2(struct vul VkExternalMemoryProperties *p = &external_image_properties->externalMemoryProperties; if (p->exportFromImportedHandleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) - p->exportFromImportedHandleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; + p->exportFromImportedHandleTypes |= wine_vk_handle_over_fd_types; wine_vk_normalize_handle_types_win(&p->exportFromImportedHandleTypes); if (p->compatibleHandleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) - p->compatibleHandleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; + p->compatibleHandleTypes |= wine_vk_handle_over_fd_types; wine_vk_normalize_handle_types_win(&p->compatibleHandleTypes); } @@ -1858,18 +1865,154 @@ void wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice cli properties->externalSemaphoreFeatures = 0; } +#define IOCTL_SHARED_GPU_RESOURCE_CREATE CTL_CODE(FILE_DEVICE_VIDEO, 0, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +struct shared_resource_create +{ + obj_handle_t unix_handle; + WCHAR name[1]; +}; + static HANDLE create_gpu_resource(int fd, LPCWSTR name) { - HANDLE ret = INVALID_HANDLE_VALUE; + static const WCHAR shared_gpu_resourceW[] = {'\\','?','?','\\','S','h','a','r','e','d','G','p','u','R','e','s','o','u','r','c','e',0}; + HANDLE unix_resource = INVALID_HANDLE_VALUE; + struct shared_resource_create *inbuff; + UNICODE_STRING shared_gpu_resource_us; + HANDLE shared_resource; + OBJECT_ATTRIBUTES attr; + IO_STATUS_BLOCK iosb; + NTSTATUS status; + DWORD in_size; TRACE("Creating shared vulkan resource fd %d name %s.\n", fd, debugstr_w(name)); + if (wine_server_fd_to_handle(fd, GENERIC_ALL, 0, &unix_resource) != STATUS_SUCCESS) + return INVALID_HANDLE_VALUE; + + init_unicode_string(&shared_gpu_resource_us, shared_gpu_resourceW); + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.Attributes = 0; + attr.ObjectName = &shared_gpu_resource_us; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + if ((status = NtCreateFile(&shared_resource, GENERIC_READ | GENERIC_WRITE, &attr, &iosb, NULL, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_OPEN, 0, NULL, 0))) + { + ERR("Failed to load open a shared resource handle, status %#lx.\n", (long int)status); + NtClose(unix_resource); + return INVALID_HANDLE_VALUE; + } + + in_size = sizeof(*inbuff) + (name ? lstrlenW(name) * sizeof(WCHAR) : 0); + inbuff = calloc(1, in_size); + inbuff->unix_handle = wine_server_obj_handle(unix_resource); if (name) - FIXME("Naming gpu resources not supported.\n"); + lstrcpyW(&inbuff->name[0], name); - wine_server_fd_to_handle(fd, GENERIC_ALL, 0, &ret); + if ((status = NtDeviceIoControlFile(shared_resource, NULL, NULL, NULL, &iosb, IOCTL_SHARED_GPU_RESOURCE_CREATE, + inbuff, in_size, NULL, 0))) - return ret; + free(inbuff); + NtClose(unix_resource); + + if (status) + { + ERR("Failed to create video resource, status %#lx.\n", (long int)status); + NtClose(shared_resource); + return INVALID_HANDLE_VALUE; + } + + return shared_resource; +} + +#define IOCTL_SHARED_GPU_RESOURCE_OPEN CTL_CODE(FILE_DEVICE_VIDEO, 1, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +struct shared_resource_open +{ + obj_handle_t kmt_handle; + WCHAR name[1]; +}; + +static HANDLE open_shared_resource(HANDLE kmt_handle, LPCWSTR name) +{ + static const WCHAR shared_gpu_resourceW[] = {'\\','?','?','\\','S','h','a','r','e','d','G','p','u','R','e','s','o','u','r','c','e',0}; + UNICODE_STRING shared_gpu_resource_us; + struct shared_resource_open *inbuff; + HANDLE shared_resource; + OBJECT_ATTRIBUTES attr; + IO_STATUS_BLOCK iosb; + NTSTATUS status; + DWORD in_size; + + init_unicode_string(&shared_gpu_resource_us, shared_gpu_resourceW); + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.Attributes = 0; + attr.ObjectName = &shared_gpu_resource_us; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + if ((status = NtCreateFile(&shared_resource, GENERIC_READ | GENERIC_WRITE, &attr, &iosb, NULL, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_OPEN, 0, NULL, 0))) + { + ERR("Failed to load open a shared resource handle, status %#lx.\n", (long int)status); + return INVALID_HANDLE_VALUE; + } + + in_size = sizeof(*inbuff) + (name ? lstrlenW(name) * sizeof(WCHAR) : 0); + inbuff = calloc(1, in_size); + inbuff->kmt_handle = wine_server_obj_handle(kmt_handle); + if (name) + lstrcpyW(&inbuff->name[0], name); + + status = NtDeviceIoControlFile(shared_resource, NULL, NULL, NULL, &iosb, IOCTL_SHARED_GPU_RESOURCE_OPEN, + inbuff, in_size, NULL, 0); + + free(inbuff); + + if (status) + { + ERR("Failed to open video resource, status %#lx.\n", (long int)status); + NtClose(shared_resource); + return INVALID_HANDLE_VALUE; + } + + return shared_resource; +} + +#define IOCTL_SHARED_GPU_RESOURCE_GET_UNIX_RESOURCE CTL_CODE(FILE_DEVICE_VIDEO, 3, METHOD_BUFFERED, FILE_READ_ACCESS) + +static int get_shared_resource_fd(HANDLE shared_resource) +{ + IO_STATUS_BLOCK iosb; + obj_handle_t unix_resource; + NTSTATUS status; + int ret; + + if (NtDeviceIoControlFile(shared_resource, NULL, NULL, NULL, &iosb, IOCTL_SHARED_GPU_RESOURCE_GET_UNIX_RESOURCE, + NULL, 0, &unix_resource, sizeof(unix_resource))) + return -1; + + status = wine_server_handle_to_fd(wine_server_ptr_handle(unix_resource), FILE_READ_DATA, &ret, NULL); + NtClose(wine_server_ptr_handle(unix_resource)); + return status == STATUS_SUCCESS ? ret : -1; +} + +#define IOCTL_SHARED_GPU_RESOURCE_GETKMT CTL_CODE(FILE_DEVICE_VIDEO, 2, METHOD_BUFFERED, FILE_READ_ACCESS) + +static HANDLE get_shared_resource_kmt_handle(HANDLE shared_resource) +{ + IO_STATUS_BLOCK iosb; + obj_handle_t kmt_handle; + + if (NtDeviceIoControlFile(shared_resource, NULL, NULL, NULL, &iosb, IOCTL_SHARED_GPU_RESOURCE_GETKMT, + NULL, 0, &kmt_handle, sizeof(kmt_handle))) + return INVALID_HANDLE_VALUE; + + return wine_server_ptr_handle(kmt_handle); } VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInfo *alloc_info, @@ -1911,7 +2054,7 @@ VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInf if ((export_info = find_next_struct(alloc_info, VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO))) { memory->handle_types = export_info->handleTypes; - if (export_info->handleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT) + if (export_info->handleTypes & wine_vk_handle_over_fd_types) export_info->handleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; wine_vk_normalize_handle_types_host(&export_info->handleTypes); } @@ -1932,7 +2075,16 @@ VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInf if (handle_import_info->handle) NtDuplicateObject( NtCurrentProcess(), handle_import_info->handle, NtCurrentProcess(), &memory->handle, 0, 0, DUPLICATE_SAME_ACCESS ); else if (handle_import_info->name) - FIXME("Importing device memory by resource name not supported.\n"); + memory->handle = open_shared_resource( 0, handle_import_info->name ); + break; + case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT: + /* FIXME: the spec says that device memory imported from a KMT handle doesn't keep a reference to the underyling payload. + This means that in cases where on windows an application leaks VkDeviceMemory objects, we leak the full payload. To + fix this, we would need wine_dev_mem objects to store no reference to the payload, that means no host VkDeviceMemory + object (as objects imported from FDs hold a reference to the payload), and no win32 handle to the object. We would then + extend make_vulkan to have the thunks converting wine_dev_mem to native handles open the VkDeviceMemory from the KMT + handle, use it in the host function, then close it again. */ + memory->handle = open_shared_resource( handle_import_info->handle, NULL ); break; default: WARN("Invalid handle type %08x passed in.\n", handle_import_info->handleType); @@ -1941,7 +2093,7 @@ VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInf } if (memory->handle != INVALID_HANDLE_VALUE) - wine_server_handle_to_fd(memory->handle, FILE_READ_DATA, &fd_import_info.fd, NULL); + fd_import_info.fd = get_shared_resource_fd(memory->handle); if (fd_import_info.fd == -1) { @@ -2249,7 +2401,7 @@ VkResult wine_vkCreateBuffer(VkDevice client_device, const VkBufferCreateInfo *c if ((ext_info = find_next_struct(create_info, VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO))) { - if (ext_info->handleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT) + if (ext_info->handleTypes & wine_vk_handle_over_fd_types) ext_info->handleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; wine_vk_normalize_handle_types_host(&ext_info->handleTypes); } @@ -2275,7 +2427,7 @@ VkResult wine_vkCreateImage(VkDevice client_device, const VkImageCreateInfo *cre if ((update_info = find_next_struct(info.pNext, VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO))) { - if (update_info->handleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR) + if (update_info->handleTypes & wine_vk_handle_over_fd_types) update_info->handleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR; wine_vk_normalize_handle_types_host(&update_info->handleTypes); } @@ -2514,6 +2666,7 @@ VkResult wine_vkGetMemoryWin32HandleKHR(VkDevice device, const VkMemoryGetWin32H { struct wine_device_memory *dev_mem = wine_device_memory_from_handle(handle_info->memory); const VkBaseInStructure *chain; + HANDLE ret; TRACE("%p, %p %p\n", device, handle_info, handle); @@ -2528,6 +2681,13 @@ VkResult wine_vkGetMemoryWin32HandleKHR(VkDevice device, const VkMemoryGetWin32H case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT: return !NtDuplicateObject( NtCurrentProcess(), dev_mem->handle, NtCurrentProcess(), handle, dev_mem->access, dev_mem->inherit ? OBJ_INHERIT : 0, 0) ? VK_SUCCESS : VK_ERROR_OUT_OF_HOST_MEMORY; + case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT: + { + if ((ret = get_shared_resource_kmt_handle(dev_mem->handle)) == INVALID_HANDLE_VALUE) + return VK_ERROR_OUT_OF_HOST_MEMORY; + *handle = ret; + return VK_SUCCESS; + } default: FIXME("Unable to get handle of type %x, did the application ignore the capabilities?\n", handle_info->handleType); return VK_ERROR_UNKNOWN; diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index 87bc1ae74b40..9bd2d4ebeea9 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -240,4 +240,11 @@ static inline void *find_next_struct(const void *s, VkStructureType t) return NULL; } +static inline void init_unicode_string( UNICODE_STRING *str, const WCHAR *data ) +{ + str->Length = lstrlenW(data) * sizeof(WCHAR); + str->MaximumLength = str->Length + sizeof(WCHAR); + str->Buffer = (WCHAR *)data; +} + #endif /* __WINE_VULKAN_PRIVATE_H */ diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index 2ea6a81d4326..787fe5853c55 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -1871,6 +1871,7 @@ NTSTATUS WINAPI ObRegisterCallbacks(POB_CALLBACK_REGISTRATION, void**); NTSTATUS WINAPI ObReferenceObjectByHandle(HANDLE,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,PVOID*,POBJECT_HANDLE_INFORMATION); NTSTATUS WINAPI ObReferenceObjectByName(UNICODE_STRING*,ULONG,ACCESS_STATE*,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,void*,void**); NTSTATUS WINAPI ObReferenceObjectByPointer(void*,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE); +NTSTATUS WINAPI ObOpenObjectByPointer(void *,ULONG,ACCESS_STATE*,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,HANDLE*); void WINAPI ObUnRegisterCallbacks(void*); NTSTATUS WINAPI PoCallDriver(DEVICE_OBJECT*,IRP*); diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 29dffbaeb634..ad151a27ea8a 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -218,6 +218,7 @@ AddService=Winmgmt,0,WinmgmtService AddService=wuauserv,0,wuauService AddService=NDIS,0x800,NDISService AddService=nsiproxy,0x800,NsiProxyService +AddService=SharedGpuResources,0x800,SharedGpuResourcesService [DefaultInstall.NT.Services] AddService=BITS,0,BITSService @@ -238,6 +239,7 @@ AddService=Winmgmt,0,WinmgmtService AddService=wuauserv,0,wuauService AddService=NDIS,0x800,NDISService AddService=nsiproxy,0x800,NsiProxyService +AddService=SharedGpuResources,0x800,SharedGpuResourcesService [DefaultInstall.ntamd64.Services] AddService=BITS,0,BITSService @@ -258,6 +260,7 @@ AddService=Winmgmt,0,WinmgmtService AddService=wuauserv,0,wuauService AddService=NDIS,0x800,NDISService AddService=nsiproxy,0x800,NsiProxyService +AddService=SharedGpuResources,0x800,SharedGpuResourcesService [DefaultInstall.ntarm64.Services] AddService=BITS,0,BITSService @@ -278,6 +281,7 @@ AddService=Winmgmt,0,WinmgmtService AddService=wuauserv,0,wuauService AddService=NDIS,0x800,NDISService AddService=nsiproxy,0x800,NsiProxyService +AddService=SharedGpuResources,0x800,SharedGpuResourcesService [Strings] MciExtStr="Software\Microsoft\Windows NT\CurrentVersion\MCI Extensions" @@ -2481,6 +2485,15 @@ LoadOrderGroup="System Bus Extender" [NsiProxyServiceKeys] HKR,,"Tag",0x10001,1 +[SharedGpuResourcesService] +Description="Shared GPU Resources Manager Service" +DisplayName="Shared GPU Resources Manager" +ServiceBinary="%12%\sharedgpures.sys" +ServiceType=1 +StartType=2 +ErrorControl=1 +LoadOrderGroup="System Bus Extender" + [RpcSsService] Description="RPC service" DisplayName="Remote Procedure Call (RPC)" From 8f2559a523ac6befccecb987a24c86c09fec5d9d Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 13 Oct 2021 13:34:49 +0200 Subject: [PATCH 0876/2542] sharedgpures: Add support for arbitrary metadata. --- dlls/sharedgpures.sys/shared_resource.c | 57 +++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/dlls/sharedgpures.sys/shared_resource.c b/dlls/sharedgpures.sys/shared_resource.c index e1330888b046..42715f7479b5 100644 --- a/dlls/sharedgpures.sys/shared_resource.c +++ b/dlls/sharedgpures.sys/shared_resource.c @@ -23,6 +23,8 @@ struct shared_resource unsigned int ref_count; void *unix_resource; WCHAR *name; + void *metadata; + SIZE_T metadata_size; }; static struct shared_resource *resource_pool; @@ -245,6 +247,33 @@ static NTSTATUS shared_resource_get_unix_resource(struct shared_resource *res, v return STATUS_SUCCESS; } +#define IOCTL_SHARED_GPU_RESOURCE_SET_METADATA CTL_CODE(FILE_DEVICE_VIDEO, 4, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +static NTSTATUS shared_resource_set_metadata(struct shared_resource *res, void *buff, SIZE_T insize, IO_STATUS_BLOCK *iosb) +{ + res->metadata = ExAllocatePoolWithTag(NonPagedPool, insize, 0); + memcpy(res->metadata, buff, insize); + res->metadata_size = insize; + + iosb->Information = 0; + return STATUS_SUCCESS; +} + +#define IOCTL_SHARED_GPU_RESOURCE_GET_METADATA CTL_CODE(FILE_DEVICE_VIDEO, 5, METHOD_BUFFERED, FILE_READ_ACCESS) + +static NTSTATUS shared_resource_get_metadata(struct shared_resource *res, void *buff, SIZE_T outsize, IO_STATUS_BLOCK *iosb) +{ + if (!res->metadata) + return STATUS_NOT_FOUND; + + if (res->metadata_size > outsize) + return STATUS_BUFFER_TOO_SMALL; + + memcpy(buff, res->metadata, res->metadata_size); + iosb->Information = res->metadata_size; + return STATUS_SUCCESS; +} + static NTSTATUS WINAPI dispatch_create(DEVICE_OBJECT *device, IRP *irp) { irp->IoStatus.u.Status = STATUS_SUCCESS; @@ -262,11 +291,19 @@ static NTSTATUS WINAPI dispatch_close(DEVICE_OBJECT *device, IRP *irp) if (res) { res->ref_count--; - if (!res->ref_count && res->unix_resource) + if (!res->ref_count) { - /* TODO: see if its possible to destroy the object here (unlink?) */ - ObDereferenceObject(res->unix_resource); - res->unix_resource = NULL; + if (res->unix_resource) + { + /* TODO: see if its possible to destroy the object here (unlink?) */ + ObDereferenceObject(res->unix_resource); + res->unix_resource = NULL; + } + if (res->metadata) + { + ExFreePoolWithTag(res->metadata, 0); + res->metadata = NULL; + } } } @@ -312,6 +349,18 @@ static NTSTATUS WINAPI dispatch_ioctl(DEVICE_OBJECT *device, IRP *irp) stack->Parameters.DeviceIoControl.OutputBufferLength, &irp->IoStatus ); break; + case IOCTL_SHARED_GPU_RESOURCE_SET_METADATA: + status = shared_resource_set_metadata( *res, + irp->AssociatedIrp.SystemBuffer, + stack->Parameters.DeviceIoControl.InputBufferLength, + &irp->IoStatus ); + break; + case IOCTL_SHARED_GPU_RESOURCE_GET_METADATA: + status = shared_resource_get_metadata( *res, + irp->AssociatedIrp.SystemBuffer, + stack->Parameters.DeviceIoControl.OutputBufferLength, + &irp->IoStatus ); + break; default: FIXME( "ioctl %#lx not supported\n", stack->Parameters.DeviceIoControl.IoControlCode ); status = STATUS_NOT_SUPPORTED; From 1e199825c85ada2d71ef09798a5d24a1423c563d Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 13 Jul 2022 13:08:41 -0400 Subject: [PATCH 0877/2542] ntoskrnl, server: Support referencing section objects. Needed for the shared resource manager to track the shared memory object for shared fences. --- dlls/ntoskrnl.exe/ntoskrnl.c | 12 +++++++++++- server/mapping.c | 14 +++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index a375cd078b57..9a64820cef80 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -258,6 +258,15 @@ POBJECT_TYPE WINAPI ObGetObjectType( void *object ) return header->type; } +static const WCHAR section_type_name[] = {'S','e','c','t','i','o','n',0}; + +static struct _OBJECT_TYPE section_type = +{ + section_type_name +}; + +static POBJECT_TYPE p_section_type = §ion_type; + static const POBJECT_TYPE *known_types[] = { &ExEventObjectType, @@ -267,7 +276,8 @@ static const POBJECT_TYPE *known_types[] = &IoFileObjectType, &PsProcessType, &PsThreadType, - &SeTokenObjectType + &SeTokenObjectType, + &p_section_type, }; DECLARE_CRITICAL_SECTION(handle_map_cs); diff --git a/server/mapping.c b/server/mapping.c index 32385662165f..e68edf8aba43 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -159,6 +159,7 @@ struct type_descr mapping_type = struct mapping { struct object obj; /* object header */ + struct list kernel_object; /* list of kernel object pointers */ mem_size_t size; /* mapping size */ unsigned int flags; /* SEC_* flags */ struct fd *fd; /* fd for mapped file */ @@ -169,6 +170,7 @@ struct mapping static void mapping_dump( struct object *obj, int verbose ); static struct fd *mapping_get_fd( struct object *obj ); +static struct list *mapping_get_kernel_obj_list( struct object *obj ); static void mapping_destroy( struct object *obj ); static enum server_fd_type mapping_get_fd_type( struct fd *fd ); @@ -193,7 +195,7 @@ static const struct object_ops mapping_ops = directory_link_name, /* link_name */ default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ - no_kernel_obj_list, /* get_kernel_obj_list */ + mapping_get_kernel_obj_list, /* get_kernel_obj_list */ no_close_handle, /* close_handle */ mapping_destroy /* destroy */ }; @@ -1015,6 +1017,8 @@ static struct mapping *create_mapping( struct object *root, const struct unicode if (get_error() == STATUS_OBJECT_NAME_EXISTS) return mapping; /* Nothing else to do */ + list_init( &mapping->kernel_object ); + mapping->size = size; mapping->fd = NULL; mapping->shared = NULL; @@ -1106,6 +1110,8 @@ struct mapping *create_fd_mapping( struct object *root, const struct unicode_str if (!(mapping = create_named_object( root, &mapping_ops, name, attr, sd ))) return NULL; if (get_error() == STATUS_OBJECT_NAME_EXISTS) return mapping; /* Nothing else to do */ + list_init( &mapping->kernel_object ); + mapping->shared = NULL; mapping->committed = NULL; mapping->flags = SEC_FILE; @@ -1212,6 +1218,12 @@ static struct fd *mapping_get_fd( struct object *obj ) return (struct fd *)grab_object( mapping->fd ); } +static struct list *mapping_get_kernel_obj_list( struct object *obj ) +{ + struct mapping *mapping = (struct mapping *)obj; + return &mapping->kernel_object; +} + static void mapping_destroy( struct object *obj ) { struct mapping *mapping = (struct mapping *)obj; From 46d92feb4fc3cbf1174c41a73b6a3f8e7e9b2735 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 13 Jul 2022 13:11:22 -0400 Subject: [PATCH 0878/2542] sharedgpures.sys: Keep index into resource pool in FsContext instead of direct pointer to resource. This fixes the errors due to the pointers in FsContext becoming invalid when the resource pool was expanded. Signed-off-by: Derek Lesho --- dlls/sharedgpures.sys/shared_resource.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/dlls/sharedgpures.sys/shared_resource.c b/dlls/sharedgpures.sys/shared_resource.c index 42715f7479b5..8c3fa3764bd2 100644 --- a/dlls/sharedgpures.sys/shared_resource.c +++ b/dlls/sharedgpures.sys/shared_resource.c @@ -284,7 +284,7 @@ static NTSTATUS WINAPI dispatch_create(DEVICE_OBJECT *device, IRP *irp) static NTSTATUS WINAPI dispatch_close(DEVICE_OBJECT *device, IRP *irp) { IO_STACK_LOCATION *stack = IoGetCurrentIrpStackLocation(irp); - struct shared_resource *res = stack->FileObject->FsContext; + struct shared_resource *res = &resource_pool[ (UINT_PTR) stack->FileObject->FsContext ]; TRACE("Freeing shared resouce %p.\n", res); @@ -315,7 +315,7 @@ static NTSTATUS WINAPI dispatch_close(DEVICE_OBJECT *device, IRP *irp) static NTSTATUS WINAPI dispatch_ioctl(DEVICE_OBJECT *device, IRP *irp) { IO_STACK_LOCATION *stack = IoGetCurrentIrpStackLocation( irp ); - struct shared_resource **res = (struct shared_resource **) &stack->FileObject->FsContext; + struct shared_resource *res = &resource_pool[ (UINT_PTR) stack->FileObject->FsContext ]; NTSTATUS status; TRACE( "ioctl %#lx insize %lu outsize %lu\n", @@ -326,37 +326,37 @@ static NTSTATUS WINAPI dispatch_ioctl(DEVICE_OBJECT *device, IRP *irp) switch (stack->Parameters.DeviceIoControl.IoControlCode) { case IOCTL_SHARED_GPU_RESOURCE_CREATE: - status = shared_resource_create( res, + status = shared_resource_create( &res, irp->AssociatedIrp.SystemBuffer, stack->Parameters.DeviceIoControl.InputBufferLength, &irp->IoStatus ); break; case IOCTL_SHARED_GPU_RESOURCE_OPEN: - status = shared_resource_open( res, + status = shared_resource_open( &res, irp->AssociatedIrp.SystemBuffer, stack->Parameters.DeviceIoControl.InputBufferLength, &irp->IoStatus ); break; case IOCTL_SHARED_GPU_RESOURCE_GETKMT: - status = shared_resource_getkmt( *res, + status = shared_resource_getkmt( res, irp->AssociatedIrp.SystemBuffer, stack->Parameters.DeviceIoControl.OutputBufferLength, &irp->IoStatus ); break; case IOCTL_SHARED_GPU_RESOURCE_GET_UNIX_RESOURCE: - status = shared_resource_get_unix_resource( *res, + status = shared_resource_get_unix_resource( res, irp->AssociatedIrp.SystemBuffer, stack->Parameters.DeviceIoControl.OutputBufferLength, &irp->IoStatus ); break; case IOCTL_SHARED_GPU_RESOURCE_SET_METADATA: - status = shared_resource_set_metadata( *res, + status = shared_resource_set_metadata( res, irp->AssociatedIrp.SystemBuffer, stack->Parameters.DeviceIoControl.InputBufferLength, &irp->IoStatus ); break; case IOCTL_SHARED_GPU_RESOURCE_GET_METADATA: - status = shared_resource_get_metadata( *res, + status = shared_resource_get_metadata( res, irp->AssociatedIrp.SystemBuffer, stack->Parameters.DeviceIoControl.OutputBufferLength, &irp->IoStatus ); @@ -367,6 +367,9 @@ static NTSTATUS WINAPI dispatch_ioctl(DEVICE_OBJECT *device, IRP *irp) break; } + if (!status) + stack->FileObject->FsContext = (void *)(UINT_PTR)(res - resource_pool); + irp->IoStatus.u.Status = status; IoCompleteRequest( irp, IO_NO_INCREMENT ); return status; From a3e61430166667241882a0837f6bc69066d8592e Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 13 Jul 2022 13:14:04 -0400 Subject: [PATCH 0879/2542] sharedgpures.sys: Add support for associating additional NT objects with shared resources. This is then used to share a shared memory section for shared fences --- dlls/sharedgpures.sys/shared_resource.c | 91 +++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/dlls/sharedgpures.sys/shared_resource.c b/dlls/sharedgpures.sys/shared_resource.c index 8c3fa3764bd2..c6ab013ea0d9 100644 --- a/dlls/sharedgpures.sys/shared_resource.c +++ b/dlls/sharedgpures.sys/shared_resource.c @@ -25,6 +25,8 @@ struct shared_resource WCHAR *name; void *metadata; SIZE_T metadata_size; + void **object_pool; + unsigned int object_pool_count; }; static struct shared_resource *resource_pool; @@ -274,6 +276,70 @@ static NTSTATUS shared_resource_get_metadata(struct shared_resource *res, void * return STATUS_SUCCESS; } +#define IOCTL_SHARED_GPU_RESOURCE_SET_OBJECT CTL_CODE(FILE_DEVICE_VIDEO, 6, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +struct shared_resource_set_object +{ + unsigned int index; + obj_handle_t handle; +}; + +static NTSTATUS shared_resource_set_object(struct shared_resource *res, void *buff, SIZE_T insize, IO_STATUS_BLOCK *iosb) +{ + struct shared_resource_set_object *params = buff; + void *object; + + if (insize < sizeof(*params)) + return STATUS_INFO_LENGTH_MISMATCH; + + if (!(object = reference_client_handle(params->handle))) + return STATUS_INVALID_HANDLE; + + if (params->index >= res->object_pool_count) + { + void **expanded_pool = ExAllocatePoolWithTag(NonPagedPool, (params->index + 1) * sizeof(void *), 0); + + if (res->object_pool) + { + memcpy(expanded_pool, res->object_pool, res->object_pool_count * sizeof(void *)); + ExFreePoolWithTag(res->object_pool, 0); + } + + memset(&expanded_pool[res->object_pool_count], 0, (params->index + 1 - res->object_pool_count) * sizeof (void *)); + + res->object_pool = expanded_pool; + res->object_pool_count = params->index + 1; + } + + if (res->object_pool[params->index]) + ObDereferenceObject(res->object_pool[params->index]); + + res->object_pool[params->index] = object; + + iosb->Information = 0; + return STATUS_SUCCESS; +} + +#define IOCTL_SHARED_GPU_RESOURCE_GET_OBJECT CTL_CODE(FILE_DEVICE_VIDEO, 6, METHOD_BUFFERED, FILE_READ_ACCESS) + +static NTSTATUS shared_resource_get_object(struct shared_resource *res, void *buff, SIZE_T insize, SIZE_T outsize, IO_STATUS_BLOCK *iosb) +{ + unsigned int index; + + if (insize < sizeof(unsigned int) || outsize < sizeof(obj_handle_t)) + return STATUS_INFO_LENGTH_MISMATCH; + + index = *(unsigned int *)buff; + + if (index >= res->object_pool_count || !res->object_pool[index]) + return STATUS_INVALID_PARAMETER; + + *((obj_handle_t *)buff) = open_client_handle(res->object_pool[index]); + + iosb->Information = sizeof(obj_handle_t); + return STATUS_SUCCESS; +} + static NTSTATUS WINAPI dispatch_create(DEVICE_OBJECT *device, IRP *irp) { irp->IoStatus.u.Status = STATUS_SUCCESS; @@ -304,6 +370,18 @@ static NTSTATUS WINAPI dispatch_close(DEVICE_OBJECT *device, IRP *irp) ExFreePoolWithTag(res->metadata, 0); res->metadata = NULL; } + if (res->object_pool) + { + unsigned int i; + for (i = 0; i < res->object_pool_count; i++) + { + if (res->object_pool[i]) + ObDereferenceObject(res->object_pool[i]); + } + ExFreePoolWithTag(res->object_pool, 0); + res->object_pool = NULL; + res->object_pool_count = 0; + } } } @@ -361,6 +439,19 @@ static NTSTATUS WINAPI dispatch_ioctl(DEVICE_OBJECT *device, IRP *irp) stack->Parameters.DeviceIoControl.OutputBufferLength, &irp->IoStatus ); break; + case IOCTL_SHARED_GPU_RESOURCE_SET_OBJECT: + status = shared_resource_set_object( res, + irp->AssociatedIrp.SystemBuffer, + stack->Parameters.DeviceIoControl.InputBufferLength, + &irp->IoStatus ); + break; + case IOCTL_SHARED_GPU_RESOURCE_GET_OBJECT: + status = shared_resource_get_object( res, + irp->AssociatedIrp.SystemBuffer, + stack->Parameters.DeviceIoControl.InputBufferLength, + stack->Parameters.DeviceIoControl.OutputBufferLength, + &irp->IoStatus); + break; default: FIXME( "ioctl %#lx not supported\n", stack->Parameters.DeviceIoControl.IoControlCode ); status = STATUS_NOT_SUPPORTED; From d91601740ba23471eac9cf9be18944fe7cb27bad Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Thu, 11 Aug 2022 10:57:01 -0400 Subject: [PATCH 0880/2542] winevulkan: Allowing importing D3D11 Texture handles as Vulkan memory objects. --- dlls/winevulkan/vulkan.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 0ec6f0f2ec45..4939bc207a99 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -1530,7 +1530,9 @@ static inline void wine_vk_normalize_handle_types_host(VkExternalMemoryHandleTyp static const VkExternalMemoryHandleTypeFlagBits wine_vk_handle_over_fd_types = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT | - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT; + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT | + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT; static void wine_vk_get_physical_device_external_buffer_properties(struct wine_phys_dev *phys_dev, void (*p_vkGetPhysicalDeviceExternalBufferProperties)(VkPhysicalDevice, const VkPhysicalDeviceExternalBufferInfo *, VkExternalBufferProperties *), @@ -2072,12 +2074,14 @@ VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInf switch (handle_import_info->handleType) { case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT: + case VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT: if (handle_import_info->handle) NtDuplicateObject( NtCurrentProcess(), handle_import_info->handle, NtCurrentProcess(), &memory->handle, 0, 0, DUPLICATE_SAME_ACCESS ); else if (handle_import_info->name) memory->handle = open_shared_resource( 0, handle_import_info->name ); break; case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT: + case VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT: /* FIXME: the spec says that device memory imported from a KMT handle doesn't keep a reference to the underyling payload. This means that in cases where on windows an application leaks VkDeviceMemory objects, we leak the full payload. To fix this, we would need wine_dev_mem objects to store no reference to the payload, that means no host VkDeviceMemory @@ -2679,9 +2683,11 @@ VkResult wine_vkGetMemoryWin32HandleKHR(VkDevice device, const VkMemoryGetWin32H switch(handle_info->handleType) { case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT: + case VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT: return !NtDuplicateObject( NtCurrentProcess(), dev_mem->handle, NtCurrentProcess(), handle, dev_mem->access, dev_mem->inherit ? OBJ_INHERIT : 0, 0) ? VK_SUCCESS : VK_ERROR_OUT_OF_HOST_MEMORY; case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT: + case VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT: { if ((ret = get_shared_resource_kmt_handle(dev_mem->handle)) == INVALID_HANDLE_VALUE) return VK_ERROR_OUT_OF_HOST_MEMORY; From 1578ac66145a329ab161bb2e23dc465afed3ef1e Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Fri, 22 Apr 2022 11:53:02 -0400 Subject: [PATCH 0881/2542] winevulkan: Implement VK_KHR_external_semaphore_win32 for OPAQUE_WIN32 handleType. --- dlls/winevulkan/make_vulkan | 15 +++- dlls/winevulkan/vulkan.c | 173 ++++++++++++++++++++++++++++++++++-- 2 files changed, 178 insertions(+), 10 deletions(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index c6d6f7581be9..4b32f062b683 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -98,7 +98,6 @@ UNSUPPORTED_EXTENSIONS = [ "VK_EXT_full_screen_exclusive", "VK_GOOGLE_display_timing", "VK_KHR_external_fence_win32", - "VK_KHR_external_semaphore_win32", # Relates to external_semaphore and needs type conversions in bitflags. "VK_KHR_maintenance7", # Causes infinity recursion in struct convert code "VK_KHR_shared_presentable_image", # Needs WSI work. @@ -112,7 +111,6 @@ UNSUPPORTED_EXTENSIONS = [ "VK_EXT_physical_device_drm", "VK_GOOGLE_surfaceless_query", "VK_KHR_external_fence_fd", - "VK_KHR_external_semaphore_fd", "VK_SEC_amigo_profiling", # Angle specific. # Extensions which require callback handling @@ -174,7 +172,7 @@ FUNCTION_OVERRIDES = { "vkCreateDevice" : {"extra_param" : "client_ptr"}, "vkGetPhysicalDeviceExternalBufferProperties" : {"dispatch" : True}, "vkGetPhysicalDeviceExternalFenceProperties" : {"dispatch" : False}, - "vkGetPhysicalDeviceExternalSemaphoreProperties" : {"dispatch" : False}, + "vkGetPhysicalDeviceExternalSemaphoreProperties" : {"dispatch" : True}, # Device functions "vkCreateCommandPool" : {"extra_param" : "client_ptr"}, @@ -188,7 +186,12 @@ FUNCTION_OVERRIDES = { "vkGetPhysicalDeviceExternalBufferPropertiesKHR" : {"dispatch" : True}, # VK_KHR_external_semaphore_capabilities - "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR" : {"dispatch" : False}, + "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR" : {"dispatch" : True}, + + # VK_KHR_external_semaphore_win32 + "vkCreateSemaphore" : {"dispatch" : True, "extra_param" : "pCreateInfo"}, + "vkGetSemaphoreWin32HandleKHR" : {"dispatch" : True}, + "vkImportSemaphoreWin32HandleKHR" : {"dispatch" : True}, # VK_KHR_external_memory_win32 "vkGetMemoryWin32HandleKHR" : {"dispatch" : True}, @@ -227,12 +230,15 @@ MANUAL_UNIX_THUNKS = { "vkCreateDevice", "vkCreateImage", "vkCreateInstance", + "vkCreateSemaphore", "vkDestroyCommandPool", "vkDestroyDebugReportCallbackEXT", "vkDestroyDebugUtilsMessengerEXT", "vkDestroyDeferredOperationKHR", "vkDestroyDevice", "vkDestroyInstance", + "vkGetSemaphoreWin32HandleKHR", + "vkImportSemaphoreWin32HandleKHR", "vkEnumerateDeviceExtensionProperties", "vkEnumerateDeviceLayerProperties", "vkEnumerateInstanceExtensionProperties", @@ -301,6 +307,7 @@ STRUCT_CHAIN_CONVERSIONS = { "VkImageCreateInfo": [], "VkMemoryAllocateInfo": ["VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR", "VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR"], "VkPhysicalDeviceImageFormatInfo2": [], + "VkSemaphoreCreateInfo": ["VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR"], } # Some struct members are conditionally ignored and callers are free to leave them uninitialized. diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 4939bc207a99..e07c13a0aeb6 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -381,6 +381,14 @@ static VkResult wine_vk_physical_device_init(struct wine_phys_dev *object, VkPhy VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME); host_properties[i].specVersion = VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION; } + if (!strcmp(host_properties[i].extensionName, "VK_KHR_external_semaphore_fd")) + { + TRACE("Substituting VK_KHR_external_semaphore_fd for VK_KHR_external_semaphore_win32\n"); + + snprintf(host_properties[i].extensionName, sizeof(host_properties[i].extensionName), + VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME); + host_properties[i].specVersion = VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION; + } if (wine_vk_device_extension_supported(host_properties[i].extensionName)) { @@ -632,6 +640,12 @@ static VkResult wine_vk_device_convert_create_info(VkPhysicalDevice client_physi remove_extensions[remove_count++] = "VK_KHR_external_memory_win32"; } + if (find_extension(extensions, extensions_count, "VK_KHR_external_semaphore_win32")) + { + extra_extensions[extra_count++] = "VK_KHR_external_semaphore_fd"; + remove_extensions[remove_count++] = "VK_KHR_external_semaphore_win32"; + } + if (phys_dev->map_placed_align) { VkPhysicalDeviceMapMemoryPlacedFeaturesEXT *map_placed_features; @@ -1849,22 +1863,69 @@ VkResult wine_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR(VkPhysicalDevice cl +static inline void wine_vk_normalize_semaphore_handle_types_win(VkExternalSemaphoreHandleTypeFlags *types) +{ + *types &= + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT | + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT | + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT; +} + +static inline void wine_vk_normalize_semaphore_handle_types_host(VkExternalSemaphoreHandleTypeFlags *types) +{ + *types &= + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT | + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT; +} + +static void wine_vk_get_physical_device_external_semaphore_properties(struct wine_phys_dev *phys_dev, + void (*p_vkGetPhysicalDeviceExternalSemaphoreProperties)(VkPhysicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *, VkExternalSemaphoreProperties *), + const VkPhysicalDeviceExternalSemaphoreInfo *semaphore_info, VkExternalSemaphoreProperties *properties) +{ + VkPhysicalDeviceExternalSemaphoreInfo semaphore_info_dup = *semaphore_info; + + wine_vk_normalize_semaphore_handle_types_win(&semaphore_info_dup.handleType); + if (semaphore_info_dup.handleType == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT) + semaphore_info_dup.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + wine_vk_normalize_semaphore_handle_types_host(&semaphore_info_dup.handleType); + + if (semaphore_info->handleType && !semaphore_info_dup.handleType) + { + properties->exportFromImportedHandleTypes = 0; + properties->compatibleHandleTypes = 0; + properties->externalSemaphoreFeatures = 0; + return; + } + + p_vkGetPhysicalDeviceExternalSemaphoreProperties(phys_dev->obj.host.physical_device, &semaphore_info_dup, properties); + + if (properties->exportFromImportedHandleTypes & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) + properties->exportFromImportedHandleTypes |= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT; + wine_vk_normalize_semaphore_handle_types_win(&properties->exportFromImportedHandleTypes); + + if (properties->compatibleHandleTypes & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) + properties->compatibleHandleTypes |= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT; + wine_vk_normalize_semaphore_handle_types_win(&properties->compatibleHandleTypes); +} + void wine_vkGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice client_physical_device, const VkPhysicalDeviceExternalSemaphoreInfo *info, VkExternalSemaphoreProperties *properties) { - properties->exportFromImportedHandleTypes = 0; - properties->compatibleHandleTypes = 0; - properties->externalSemaphoreFeatures = 0; + struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(client_physical_device); + + TRACE("%p, %p, %p\n", phys_dev, info, properties); + wine_vk_get_physical_device_external_semaphore_properties(phys_dev, phys_dev->obj.instance->p_vkGetPhysicalDeviceExternalSemaphoreProperties, info, properties); } void wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice client_physical_device, const VkPhysicalDeviceExternalSemaphoreInfo *info, VkExternalSemaphoreProperties *properties) { - properties->exportFromImportedHandleTypes = 0; - properties->compatibleHandleTypes = 0; - properties->externalSemaphoreFeatures = 0; + struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(client_physical_device); + + TRACE("%p, %p, %p\n", phys_dev, info, properties); + wine_vk_get_physical_device_external_semaphore_properties(phys_dev, phys_dev->obj.instance->p_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, info, properties); } #define IOCTL_SHARED_GPU_RESOURCE_CREATE CTL_CODE(FILE_DEVICE_VIDEO, 0, METHOD_BUFFERED, FILE_WRITE_ACCESS) @@ -2630,6 +2691,10 @@ NTSTATUS vk_is_available_device_function(void *arg) struct vulkan_device *device = vulkan_device_from_handle(params->device); if (!strcmp(params->name, "vkGetMemoryWin32HandleKHR") || !strcmp(params->name, "vkGetMemoryWin32HandlePropertiesKHR")) params->name = "vkGetMemoryFdKHR"; + else if (!strcmp(params->name, "vkGetSemaphoreWin32HandleKHR")) + params->name = "vkGetSemaphoreFdKHR"; + else if (!strcmp(params->name, "vkImportSemaphoreWin32HandleKHR")) + params->name = "vkImportSemaphoreFdKHR"; return !!vk_funcs->p_vkGetDeviceProcAddr(device->host.device, params->name); } @@ -2663,6 +2728,10 @@ NTSTATUS vk_is_available_device_function32(void *arg) char *name = UlongToPtr(params->name); if (!strcmp(name, "vkGetMemoryWin32HandleKHR") || !strcmp(name, "vkGetMemoryWin32HandlePropertiesKHR")) return !!vk_funcs->p_vkGetDeviceProcAddr(device->host.device, "vkGetMemoryFdKHR"); + if (!strcmp(name, "vkGetSemaphoreWin32HandleKHR")) + return !!vk_funcs->p_vkGetDeviceProcAddr(device->host.device, "vkGetSemaphoreFdKHR"); + if (!strcmp(name, "vkImportSemaphoreWin32HandleKHR")) + return !!vk_funcs->p_vkGetDeviceProcAddr(device->host.device, "vkImportSemaphoreFdKHR"); return !!vk_funcs->p_vkGetDeviceProcAddr(device->host.device, UlongToPtr(params->name)); } @@ -2708,3 +2777,95 @@ VkResult wine_vkGetMemoryWin32HandlePropertiesKHR(VkDevice device, VkExternalMem handleType must not be one of the handle types defined as opaque */ return VK_ERROR_INVALID_EXTERNAL_HANDLE; } + + +VkResult wine_vkCreateSemaphore(VkDevice client_device, const VkSemaphoreCreateInfo *create_info, + const VkAllocationCallbacks *allocator, VkSemaphore *semaphore, void *win_create_info) +{ + struct vulkan_device *device = vulkan_device_from_handle(client_device); + VkExportSemaphoreCreateInfo *export_semaphore_info; + + TRACE("%p %p %p %p", device, create_info, allocator, semaphore); + + if ((export_semaphore_info = find_next_struct(create_info, VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO))) + { + if (export_semaphore_info->handleTypes & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT) + export_semaphore_info->handleTypes |= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + wine_vk_normalize_semaphore_handle_types_host(&export_semaphore_info->handleTypes); + } + + if (find_next_struct(win_create_info, VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR)) + FIXME("VkExportSemaphoreWin32HandleInfoKHR unhandled.\n"); + + return device->p_vkCreateSemaphore(device->host.device, create_info, NULL, semaphore); +} + +VkResult wine_vkGetSemaphoreWin32HandleKHR(VkDevice client_device, const VkSemaphoreGetWin32HandleInfoKHR *handle_info, + HANDLE *handle) +{ + struct vulkan_device *device = vulkan_device_from_handle(client_device); + VkSemaphoreGetFdInfoKHR fd_info; + VkResult res; + int fd; + + fd_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR; + fd_info.pNext = handle_info->pNext; + fd_info.semaphore = handle_info->semaphore; + fd_info.handleType = handle_info->handleType; + if (fd_info.handleType == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT) + fd_info.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + wine_vk_normalize_semaphore_handle_types_host(&fd_info.handleType); + + res = device->p_vkGetSemaphoreFdKHR(device->host.device, &fd_info, &fd); + + if (res != VK_SUCCESS) + return res; + + if (wine_server_fd_to_handle(fd, GENERIC_ALL, 0, handle) != STATUS_SUCCESS) + { + close(fd); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + + return VK_SUCCESS; +} + +VkResult wine_vkImportSemaphoreWin32HandleKHR(VkDevice client_device, + const VkImportSemaphoreWin32HandleInfoKHR *handle_info) +{ + struct vulkan_device *device = vulkan_device_from_handle(client_device); + VkImportSemaphoreFdInfoKHR fd_info; + VkResult res; + + fd_info.sType = VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR; + fd_info.pNext = handle_info->pNext; + fd_info.semaphore = handle_info->semaphore; + fd_info.flags = handle_info->flags; + fd_info.handleType = handle_info->handleType; + + if (fd_info.handleType == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT) + { + if (handle_info->name) + { + FIXME("Importing win32 semaphore by name not supported.\n"); + return VK_ERROR_INVALID_EXTERNAL_HANDLE; + } + + fd_info.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + if (wine_server_handle_to_fd(handle_info->handle, GENERIC_ALL, &fd_info.fd, NULL) != STATUS_SUCCESS) + return VK_ERROR_INVALID_EXTERNAL_HANDLE; + } + wine_vk_normalize_semaphore_handle_types_host(&fd_info.handleType); + + if (!fd_info.handleType) + { + FIXME("Importing win32 semaphore with handle type %#x not supported.\n", handle_info->handleType); + return VK_ERROR_INVALID_EXTERNAL_HANDLE; + } + + /* importing FDs transfers ownership, importing NT handles does not */ + if ((res = device->p_vkImportSemaphoreFdKHR(device->host.device, &fd_info)) != VK_SUCCESS) + close(fd_info.fd); + + return res; +} From a4be74766b31a05cf596abfe129aa1beeccb01cc Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 23 Dec 2022 17:49:37 -0600 Subject: [PATCH 0882/2542] winevulkan: Don't convert handles in "unwrapped" conversions. --- dlls/winevulkan/make_vulkan | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 4b32f062b683..12df5e2990b9 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -1234,7 +1234,8 @@ class VkHandle(object): def unwrap_handle(self, name, unwrap): if unwrap == Unwrap.HOST: return self.host_handle(name) - assert unwrap != Unwrap.NONE + if unwrap == Unwrap.NONE: + return name return None def is_wrapped(self): From d1e6ad1df74dc51da7d7807a036b4629e9ed0c8b Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Thu, 14 Jul 2022 15:36:52 -0400 Subject: [PATCH 0883/2542] winevulkan: Add initial support for D3D12-Fence compatible timeline semaphores. --- dlls/win32u/vulkan.c | 33 +- dlls/winevulkan/make_vulkan | 40 +- dlls/winevulkan/vulkan.c | 802 +++++++++++++++++++++++++++++-- dlls/winevulkan/vulkan_private.h | 21 + include/wine/vulkan_driver.h | 11 + 5 files changed, 859 insertions(+), 48 deletions(-) diff --git a/dlls/win32u/vulkan.c b/dlls/win32u/vulkan.c index 667fdfe5c966..692fcb136a66 100644 --- a/dlls/win32u/vulkan.c +++ b/dlls/win32u/vulkan.c @@ -1028,6 +1028,7 @@ static BOOL extents_equals( const VkExtent2D *extents, const RECT *rect ) static VkResult win32u_vkAcquireNextImage2KHR( VkDevice client_device, const VkAcquireNextImageInfoKHR *acquire_info, uint32_t *image_index ) { + struct vulkan_semaphore *semaphore = vulkan_semaphore_from_handle( acquire_info->semaphore ); struct swapchain *swapchain = swapchain_from_handle( acquire_info->swapchain ); struct vulkan_device *device = vulkan_device_from_handle( client_device ); VkAcquireNextImageInfoKHR acquire_info_host = *acquire_info; @@ -1036,6 +1037,7 @@ static VkResult win32u_vkAcquireNextImage2KHR( VkDevice client_device, const VkA VkResult res; acquire_info_host.swapchain = swapchain->obj.host.swapchain; + acquire_info_host.semaphore = semaphore ? semaphore->host.semaphore : 0; res = device->p_vkAcquireNextImage2KHR( device->host.device, &acquire_info_host, image_index ); @@ -1058,16 +1060,17 @@ static VkResult win32u_vkAcquireNextImage2KHR( VkDevice client_device, const VkA } static VkResult win32u_vkAcquireNextImageKHR( VkDevice client_device, VkSwapchainKHR client_swapchain, uint64_t timeout, - VkSemaphore semaphore, VkFence fence, uint32_t *image_index ) + VkSemaphore client_semaphore, VkFence fence, uint32_t *image_index ) { struct swapchain *swapchain = swapchain_from_handle( client_swapchain ); struct vulkan_device *device = vulkan_device_from_handle( client_device ); struct surface *surface = swapchain->surface; + struct vulkan_semaphore *semaphore = vulkan_semaphore_from_handle( client_semaphore ); RECT client_rect; VkResult res; res = device->p_vkAcquireNextImageKHR( device->host.device, swapchain->obj.host.swapchain, timeout, - semaphore, fence, image_index ); + semaphore ? semaphore->host.semaphore : 0, fence, image_index ); if (!res && (driver_funcs->p_vulkan_surface_enable_fshack( surface->hwnd, surface->driver_private ) != swapchain->fs_hack_enabled || (swapchain->fs_hack_enabled && swapchain->raw_monitor_dpi != NtUserGetWinMonitorDpi( surface->hwnd, MDT_RAW_DPI )))) @@ -1262,7 +1265,9 @@ static VkResult win32u_vkQueuePresentKHR( VkQueue client_queue, const VkPresentI VkSwapchainKHR swapchains_buffer[16], *swapchains = swapchains_buffer; VkPresentInfoKHR present_info_host = *present_info; struct vulkan_device *device = queue->device; + struct vulkan_semaphore *semaphore; VkCommandBuffer *blit_cmds = NULL; + VkSemaphore *semaphores = NULL; VkSubmitInfo submitInfo = {0}; VkSemaphore blit_sema; UINT i, n_hacks = 0; @@ -1271,9 +1276,30 @@ static VkResult win32u_vkQueuePresentKHR( VkQueue client_queue, const VkPresentI TRACE( "queue %p, present_info %p\n", queue, present_info ); + if (present_info->waitSemaphoreCount) + { + semaphores = malloc( present_info->waitSemaphoreCount * sizeof(*semaphores) ); + for (i = 0; i < present_info->waitSemaphoreCount; ++i) + { + semaphore = vulkan_semaphore_from_handle(present_info->pWaitSemaphores[i]); + + if (semaphore->d3d12_fence) + { + FIXME("Waiting on D3D12-Fence compatible timeline semaphore not supported.\n"); + free( semaphores ); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + semaphores[i] = semaphore->host.semaphore; + } + present_info_host.pWaitSemaphores = semaphores; + } + if (present_info->swapchainCount > ARRAY_SIZE(swapchains_buffer) && !(swapchains = malloc( present_info->swapchainCount * sizeof(*swapchains) ))) + { + free( semaphores ); return VK_ERROR_OUT_OF_HOST_MEMORY; + } for (i = 0; i < present_info->swapchainCount; i++) { @@ -1309,6 +1335,7 @@ static VkResult win32u_vkQueuePresentKHR( VkQueue client_queue, const VkPresentI if (!hack->cmd) { free( blit_cmds ); + free( semaphores ); return VK_ERROR_DEVICE_LOST; } @@ -1326,6 +1353,7 @@ static VkResult win32u_vkQueuePresentKHR( VkQueue client_queue, const VkPresentI 1, &hack->cmd ); hack->cmd = NULL; free( blit_cmds ); + free( semaphores ); return res; } } @@ -1407,6 +1435,7 @@ static VkResult win32u_vkQueuePresentKHR( VkQueue client_queue, const VkPresentI } if (swapchains != swapchains_buffer) free( swapchains ); + free( semaphores ); if (TRACE_ON( fps )) { diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 12df5e2990b9..53edd9646738 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -177,7 +177,14 @@ FUNCTION_OVERRIDES = { # Device functions "vkCreateCommandPool" : {"extra_param" : "client_ptr"}, "vkGetDeviceProcAddr" : {"dispatch" : False}, - "vkAllocateMemory" : {"extra_param" : "pAllocateInfo"}, + "vkAllocateMemory" : {"dispatch" : True}, + "vkGetSemaphoreCounterValue" : {"dispatch" : True}, + "vkSignalSemaphore" : {"dispatch" : True}, + "vkWaitSemaphores" : {"dispatch" : True}, + "vkQueueBindSparse" : {"dispatch" : True}, + "vkQueueSubmit" : {"dispatch" : True}, + "vkQueueSubmit2" : {"dispatch" : True}, + "vkDestroySemaphore" : {"dispatch" : True}, # VK_KHR_external_fence_capabilities "vkGetPhysicalDeviceExternalFencePropertiesKHR" : {"dispatch" : False}, @@ -189,13 +196,21 @@ FUNCTION_OVERRIDES = { "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR" : {"dispatch" : True}, # VK_KHR_external_semaphore_win32 - "vkCreateSemaphore" : {"dispatch" : True, "extra_param" : "pCreateInfo"}, + "vkCreateSemaphore" : {"dispatch" : True }, "vkGetSemaphoreWin32HandleKHR" : {"dispatch" : True}, "vkImportSemaphoreWin32HandleKHR" : {"dispatch" : True}, # VK_KHR_external_memory_win32 "vkGetMemoryWin32HandleKHR" : {"dispatch" : True}, "vkGetMemoryWin32HandlePropertiesKHR" : {"dispatch" : True}, + + # VK_KHR_timeline_semaphore + "vkGetSemaphoreCounterValueKHR" : {"dispatch" : True}, + "vkSignalSemaphoreKHR" : {"dispatch" : True}, + "vkWaitSemaphoresKHR" : {"dispatch" : True}, + + # VK_KHR_synchronization2 + "vkQueueSubmit2KHR" : {"dispatch" : True}, } # functions for which a user driver entry must be generated @@ -271,6 +286,17 @@ MANUAL_UNIX_THUNKS = { "vkMapMemory2KHR", "vkUnmapMemory", "vkUnmapMemory2KHR", + "vkGetSemaphoreCounterValue", + "vkSignalSemaphore", + "vkWaitSemaphores", + "vkQueueBindSparse", + "vkQueueSubmit", + "vkQueueSubmit2", + "vkDestroySemaphore", + "vkGetSemaphoreCounterValueKHR", + "vkSignalSemaphoreKHR", + "vkWaitSemaphoresKHR", + "vkQueueSubmit2KHR", } # loader functions which are entirely manually implemented @@ -305,9 +331,13 @@ STRUCT_CHAIN_CONVERSIONS = { # Structs which require pNext chain modification "VkBufferCreateInfo": [], "VkImageCreateInfo": [], - "VkMemoryAllocateInfo": ["VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR", "VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR"], + "VkMemoryAllocateInfo": [], "VkPhysicalDeviceImageFormatInfo2": [], - "VkSemaphoreCreateInfo": ["VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR"], + "VkPhysicalDeviceExternalSemaphoreInfo": [], + "VkSemaphoreCreateInfo": [], + "VkSubmitInfo": [], + "VkSubmitInfo2": [], + "VkBindSparseInfo" : [], } # Some struct members are conditionally ignored and callers are free to leave them uninitialized. @@ -1219,6 +1249,8 @@ class VkHandle(object): return "vulkan_instance_from_handle({0})->host.instance".format(name) if self.name == "VkDeviceMemory": return "wine_device_memory_from_handle({0})->host.device_memory".format(name) + if self.name == "VkSemaphore": + return "vulkan_semaphore_from_handle({0})->host.semaphore".format(name) if self.name == "VkPhysicalDevice": return "vulkan_physical_device_from_handle({0})->host.physical_device".format(name) if self.name == "VkQueue": diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index e07c13a0aeb6..7ea61349269f 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -24,6 +24,7 @@ #include "config.h" #include #include +#include #include "ntstatus.h" #define WIN32_NO_STATUS @@ -56,6 +57,12 @@ static struct wine_phys_dev *wine_phys_dev_from_handle(VkPhysicalDevice handle) return CONTAINING_RECORD(object, struct wine_phys_dev, obj); } +static struct wine_semaphore *wine_semaphore_from_handle(VkSemaphore handle) +{ + struct vulkan_semaphore *object = vulkan_semaphore_from_handle(handle); + return CONTAINING_RECORD(object, struct wine_semaphore, obj); +} + static void vulkan_object_init_ptr( struct vulkan_object *obj, UINT64 host_handle, struct vulkan_client_object *client ) { obj->host_handle = host_handle; @@ -92,6 +99,24 @@ static uint32_t wine_vk_count_struct_(void *s, VkStructureType t) const struct vulkan_funcs *vk_funcs; +#define wine_vk_find_unlink_struct(s, t) wine_vk_find_unlink_struct_((void *)s, VK_STRUCTURE_TYPE_##t) +static void *wine_vk_find_unlink_struct_(void *s, VkStructureType t) +{ + VkBaseInStructure *prev = s; + VkBaseInStructure *header; + + for (header = (VkBaseInStructure *)prev->pNext; header; prev = header, header = (VkBaseInStructure *)header->pNext) + { + if (header->sType == t) { + prev->pNext = header->pNext; + header->pNext = NULL; + return header; + } + } + + return NULL; +} + static int vulkan_object_compare(const void *key, const struct rb_entry *entry) { struct vulkan_object *object = RB_ENTRY_VALUE(entry, struct vulkan_object, entry); @@ -646,6 +671,9 @@ static VkResult wine_vk_device_convert_create_info(VkPhysicalDevice client_physi remove_extensions[remove_count++] = "VK_KHR_external_semaphore_win32"; } + if (!find_extension(extensions, extensions_count, "VK_KHR_timeline_semaphore")) + extra_extensions[extra_count++] = "VK_KHR_timeline_semaphore"; + if (phys_dev->map_placed_align) { VkPhysicalDeviceMapMemoryPlacedFeaturesEXT *map_placed_features; @@ -1883,11 +1911,37 @@ static void wine_vk_get_physical_device_external_semaphore_properties(struct win const VkPhysicalDeviceExternalSemaphoreInfo *semaphore_info, VkExternalSemaphoreProperties *properties) { VkPhysicalDeviceExternalSemaphoreInfo semaphore_info_dup = *semaphore_info; + VkSemaphoreTypeCreateInfo semaphore_type_info, *p_semaphore_type_info; + + switch(semaphore_info->handleType) + { + case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT: + semaphore_info_dup.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + break; + case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT: + { + if ((p_semaphore_type_info = find_next_struct(&semaphore_info_dup, VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO))) + { + p_semaphore_type_info->semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE; + p_semaphore_type_info->initialValue = 0; + } + else + { + semaphore_type_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; + semaphore_type_info.pNext = semaphore_info_dup.pNext; + semaphore_type_info.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE; + semaphore_type_info.initialValue = 0; + + semaphore_info_dup.pNext = &semaphore_type_info; + } - wine_vk_normalize_semaphore_handle_types_win(&semaphore_info_dup.handleType); - if (semaphore_info_dup.handleType == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT) - semaphore_info_dup.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; - wine_vk_normalize_semaphore_handle_types_host(&semaphore_info_dup.handleType); + semaphore_info_dup.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + break; + } + default: + semaphore_info_dup.handleType = 0; + break; + } if (semaphore_info->handleType && !semaphore_info_dup.handleType) { @@ -1900,11 +1954,11 @@ static void wine_vk_get_physical_device_external_semaphore_properties(struct win p_vkGetPhysicalDeviceExternalSemaphoreProperties(phys_dev->obj.host.physical_device, &semaphore_info_dup, properties); if (properties->exportFromImportedHandleTypes & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) - properties->exportFromImportedHandleTypes |= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT; + properties->exportFromImportedHandleTypes = semaphore_info->handleType; wine_vk_normalize_semaphore_handle_types_win(&properties->exportFromImportedHandleTypes); if (properties->compatibleHandleTypes & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) - properties->compatibleHandleTypes |= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT; + properties->compatibleHandleTypes = semaphore_info->handleType; wine_vk_normalize_semaphore_handle_types_win(&properties->compatibleHandleTypes); } @@ -2079,13 +2133,11 @@ static HANDLE get_shared_resource_kmt_handle(HANDLE shared_resource) } VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInfo *alloc_info, - const VkAllocationCallbacks *allocator, VkDeviceMemory *ret, - void *win_pAllocateInfo) + const VkAllocationCallbacks *allocator, VkDeviceMemory *ret) { struct vulkan_device *device = vulkan_device_from_handle(client_device); struct wine_phys_dev *physical_device = CONTAINING_RECORD(device->physical_device, struct wine_phys_dev, obj); struct vulkan_instance *instance = device->physical_device->instance; - const VkMemoryAllocateInfo *win_alloc_info = win_pAllocateInfo; struct wine_device_memory *memory; VkMemoryAllocateInfo info = *alloc_info; VkImportMemoryHostPointerInfoEXT host_pointer_info; @@ -2109,8 +2161,8 @@ VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInf fd_import_info.pNext = NULL; /* find and process handle import/export info and grab it */ - handle_import_info = find_next_struct(win_alloc_info, VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR); - handle_export_info = find_next_struct(win_alloc_info, VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR); + handle_import_info = wine_vk_find_unlink_struct(&info, IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR); + handle_export_info = wine_vk_find_unlink_struct(&info, EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR); if (handle_export_info && handle_export_info->pAttributes && handle_export_info->pAttributes->lpSecurityDescriptor) FIXME("Support for custom security descriptor not implemented.\n"); @@ -2778,72 +2830,312 @@ VkResult wine_vkGetMemoryWin32HandlePropertiesKHR(VkDevice device, VkExternalMem return VK_ERROR_INVALID_EXTERNAL_HANDLE; } +#define IOCTL_SHARED_GPU_RESOURCE_SET_OBJECT CTL_CODE(FILE_DEVICE_VIDEO, 6, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +static bool set_shared_resource_object(HANDLE shared_resource, unsigned int index, HANDLE handle) +{ + IO_STATUS_BLOCK iosb; + struct shared_resource_set_object + { + unsigned int index; + obj_handle_t handle; + } params; + + params.index = index; + params.handle = wine_server_obj_handle(handle); + + return NtDeviceIoControlFile(shared_resource, NULL, NULL, NULL, &iosb, IOCTL_SHARED_GPU_RESOURCE_SET_OBJECT, + ¶ms, sizeof(params), NULL, 0) == STATUS_SUCCESS; +} + +#define IOCTL_SHARED_GPU_RESOURCE_GET_OBJECT CTL_CODE(FILE_DEVICE_VIDEO, 6, METHOD_BUFFERED, FILE_READ_ACCESS) + +static HANDLE get_shared_resource_object(HANDLE shared_resource, unsigned int index) +{ + IO_STATUS_BLOCK iosb; + obj_handle_t handle; + + if (NtDeviceIoControlFile(shared_resource, NULL, NULL, NULL, &iosb, IOCTL_SHARED_GPU_RESOURCE_GET_OBJECT, + &index, sizeof(index), &handle, sizeof(handle))) + return NULL; + + return wine_server_ptr_handle(handle); +} + +static void d3d12_semaphore_lock(struct wine_semaphore *semaphore) +{ + assert( semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT ); + pthread_mutex_lock(&semaphore->d3d12_fence_shm->mutex); +} + +static void d3d12_semaphore_unlock(struct wine_semaphore *semaphore) +{ + assert( semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT ); + pthread_mutex_unlock(&semaphore->d3d12_fence_shm->mutex); +} VkResult wine_vkCreateSemaphore(VkDevice client_device, const VkSemaphoreCreateInfo *create_info, - const VkAllocationCallbacks *allocator, VkSemaphore *semaphore, void *win_create_info) + const VkAllocationCallbacks *allocator, VkSemaphore *semaphore) { struct vulkan_device *device = vulkan_device_from_handle(client_device); - VkExportSemaphoreCreateInfo *export_semaphore_info; - TRACE("%p %p %p %p", device, create_info, allocator, semaphore); + VkExportSemaphoreWin32HandleInfoKHR *export_handle_info = wine_vk_find_unlink_struct(create_info, EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR); + VkExportSemaphoreCreateInfo *export_semaphore_info, timeline_export_info; + VkSemaphoreCreateInfo create_info_dup = *create_info; + VkSemaphoreTypeCreateInfo *found_type_info, type_info; + VkSemaphoreGetFdInfoKHR fd_info; + pthread_mutexattr_t mutex_attr; + struct wine_semaphore *object; + OBJECT_ATTRIBUTES attr; + HANDLE section_handle; + LARGE_INTEGER li; + VkResult res; + SIZE_T size; + int fd; + + TRACE("(%p, %p, %p, %p)\n", device, create_info, allocator, semaphore); + + if (allocator) + FIXME("Support for allocation callbacks not implemented yet\n"); + + if (!(object = calloc(1, sizeof(*object)))) + return VK_ERROR_OUT_OF_HOST_MEMORY; + + object->handle = INVALID_HANDLE_VALUE; - if ((export_semaphore_info = find_next_struct(create_info, VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO))) + if ((export_semaphore_info = find_next_struct(&create_info_dup, VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO))) { + object->export_types = export_semaphore_info->handleTypes; if (export_semaphore_info->handleTypes & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT) export_semaphore_info->handleTypes |= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; wine_vk_normalize_semaphore_handle_types_host(&export_semaphore_info->handleTypes); } - if (find_next_struct(win_create_info, VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR)) - FIXME("VkExportSemaphoreWin32HandleInfoKHR unhandled.\n"); + if ((res = device->p_vkCreateSemaphore(device->host.device, &create_info_dup, NULL, &object->semaphore)) != VK_SUCCESS) + goto done; + + if (export_semaphore_info && export_semaphore_info->handleTypes == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) + { + fd_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR; + fd_info.pNext = NULL; + fd_info.semaphore = object->semaphore; + fd_info.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + + if ((res = device->p_vkGetSemaphoreFdKHR(device->host.device, &fd_info, &fd)) == VK_SUCCESS) + { + object->handle = create_gpu_resource(fd, export_handle_info ? export_handle_info->name : NULL); + close(fd); + } - return device->p_vkCreateSemaphore(device->host.device, create_info, NULL, semaphore); + if (object->handle == INVALID_HANDLE_VALUE) + { + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto done; + } + } + else if (object->export_types & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + /* compatibleHandleTypes doesn't include any other types */ + assert(object->export_types == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT); + object->handle_type = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT; + + timeline_export_info.sType = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO; + timeline_export_info.pNext = NULL; + timeline_export_info.handleTypes = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + + type_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; + type_info.pNext = &timeline_export_info; + type_info.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE; + type_info.initialValue = 0; + + create_info_dup.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; + create_info_dup.pNext = &type_info; + create_info_dup.flags = 0; + + if ((res = device->p_vkCreateSemaphore(device->host.device, &create_info_dup, NULL, &object->fence_timeline_semaphore)) != VK_SUCCESS) + goto done; + + fd_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR; + fd_info.pNext = NULL; + fd_info.semaphore = object->fence_timeline_semaphore; + fd_info.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + + if ((res = device->p_vkGetSemaphoreFdKHR(device->host.device, &fd_info, &fd)) == VK_SUCCESS) + { + object->handle = create_gpu_resource(fd, export_handle_info ? export_handle_info->name : NULL); + close(fd); + } + + if (object->handle == INVALID_HANDLE_VALUE) + { + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto done; + } + + /* Shared Fence Memory */ + InitializeObjectAttributes(&attr, NULL, 0, NULL, NULL); + size = li.QuadPart = sizeof(*object->d3d12_fence_shm); + if (NtCreateSection(§ion_handle, STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ | SECTION_MAP_WRITE, &attr, &li, PAGE_READWRITE, SEC_COMMIT, NULL)) + { + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto done; + } + + if (!set_shared_resource_object(object->handle, 0, section_handle)) + { + NtClose(section_handle); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto done; + } + + if (NtMapViewOfSection(section_handle, GetCurrentProcess(), (void**) &object->d3d12_fence_shm, 0, 0, NULL, &size, ViewShare, 0, PAGE_READWRITE)) + { + NtClose(section_handle); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto done; + } + + NtClose(section_handle); + + if ((found_type_info = find_next_struct(create_info, VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO))) + object->d3d12_fence_shm->virtual_value = found_type_info->initialValue; + + pthread_mutexattr_init(&mutex_attr); + pthread_mutexattr_setpshared(&mutex_attr, PTHREAD_PROCESS_SHARED); + if (pthread_mutex_init(&object->d3d12_fence_shm->mutex, &mutex_attr)) + { + pthread_mutexattr_destroy(&mutex_attr); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto done; + } + pthread_mutexattr_destroy(&mutex_attr); + + vulkan_object_init(&object->obj.obj, object->fence_timeline_semaphore); + vulkan_instance_insert_object(device->physical_device->instance, &object->obj.obj); + object->obj.d3d12_fence = TRUE; + } + if (object->fence_timeline_semaphore == VK_NULL_HANDLE) + { + vulkan_object_init(&object->obj.obj, object->semaphore); + vulkan_instance_insert_object(device->physical_device->instance, &object->obj.obj); + } + *semaphore = object->obj.client.handle; + + done: + + if (res != VK_SUCCESS) + { + if (object->d3d12_fence_shm) + { + pthread_mutex_destroy(&object->d3d12_fence_shm->mutex); + NtUnmapViewOfSection(GetCurrentProcess(), object->d3d12_fence_shm); + } + if (object->handle != INVALID_HANDLE_VALUE) + NtClose(object->handle); + if (object->semaphore != VK_NULL_HANDLE) + device->p_vkDestroySemaphore(device->host.device, object->semaphore, NULL); + if (object->fence_timeline_semaphore != VK_NULL_HANDLE) + device->p_vkDestroySemaphore(device->host.device, object->fence_timeline_semaphore, NULL); + free(object); + } + + return res; } VkResult wine_vkGetSemaphoreWin32HandleKHR(VkDevice client_device, const VkSemaphoreGetWin32HandleInfoKHR *handle_info, HANDLE *handle) +{ + struct wine_semaphore *semaphore = wine_semaphore_from_handle(handle_info->semaphore); + + if (!(semaphore->export_types & handle_info->handleType)) + return VK_ERROR_INVALID_EXTERNAL_HANDLE; + + if (NtDuplicateObject( NtCurrentProcess(), semaphore->handle, NtCurrentProcess(), handle, 0, 0, DUPLICATE_SAME_ACCESS )) + return VK_ERROR_INVALID_EXTERNAL_HANDLE; + + return VK_SUCCESS; +} + +void wine_vkDestroySemaphore(VkDevice client_device, VkSemaphore semaphore_handle, const VkAllocationCallbacks *allocator) { struct vulkan_device *device = vulkan_device_from_handle(client_device); - VkSemaphoreGetFdInfoKHR fd_info; - VkResult res; - int fd; + struct wine_semaphore *semaphore = wine_semaphore_from_handle(semaphore_handle); - fd_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR; - fd_info.pNext = handle_info->pNext; - fd_info.semaphore = handle_info->semaphore; - fd_info.handleType = handle_info->handleType; - if (fd_info.handleType == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT) - fd_info.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; - wine_vk_normalize_semaphore_handle_types_host(&fd_info.handleType); + TRACE("%p, %p, %p\n", device, semaphore, allocator); - res = device->p_vkGetSemaphoreFdKHR(device->host.device, &fd_info, &fd); + if (allocator) + FIXME("Support for allocation callbacks not implemented yet\n"); - if (res != VK_SUCCESS) - return res; + if (!semaphore) + return; - if (wine_server_fd_to_handle(fd, GENERIC_ALL, 0, handle) != STATUS_SUCCESS) - { - close(fd); - return VK_ERROR_OUT_OF_HOST_MEMORY; - } + if (semaphore->handle != INVALID_HANDLE_VALUE) + NtClose(semaphore->handle); - return VK_SUCCESS; + if (semaphore->d3d12_fence_shm) + NtUnmapViewOfSection(GetCurrentProcess(), semaphore->d3d12_fence_shm); + + vulkan_instance_remove_object(device->physical_device->instance, &semaphore->obj.obj); + device->p_vkDestroySemaphore(device->host.device, semaphore->semaphore, NULL); + + if (semaphore->fence_timeline_semaphore) + device->p_vkDestroySemaphore(device->host.device, semaphore->fence_timeline_semaphore, NULL); + + free(semaphore); } VkResult wine_vkImportSemaphoreWin32HandleKHR(VkDevice client_device, const VkImportSemaphoreWin32HandleInfoKHR *handle_info) { struct vulkan_device *device = vulkan_device_from_handle(client_device); + struct wine_semaphore *semaphore = wine_semaphore_from_handle(handle_info->semaphore); + struct wine_semaphore output_semaphore; + VkSemaphoreTypeCreateInfo type_info; VkImportSemaphoreFdInfoKHR fd_info; + VkSemaphoreCreateInfo create_info; + HANDLE d3d12_fence_shm; + NTSTATUS stat; VkResult res; + SIZE_T size; + + TRACE("(%p, %p). semaphore = %p handle = %p\n", device, handle_info, semaphore, handle_info->handle); + + if (handle_info->handleType == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT && !semaphore->fence_timeline_semaphore) + { + type_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; + type_info.pNext = NULL; + type_info.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE; + type_info.initialValue = 0; + + create_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; + create_info.pNext = &type_info; + create_info.flags = 0; + + if ((res = device->p_vkCreateSemaphore(device->host.device, &create_info, NULL, &semaphore->fence_timeline_semaphore)) != VK_SUCCESS) + { + ERR("Failed to create timeline semaphore backing D3D12 semaphore. vr %d.\n", res); + return res; + }; + + vulkan_instance_remove_object(device->physical_device->instance, &semaphore->obj.obj); + vulkan_object_init(&semaphore->obj.obj, semaphore->fence_timeline_semaphore); + vulkan_instance_insert_object(device->physical_device->instance, &semaphore->obj.obj); + semaphore->obj.d3d12_fence = TRUE; + } + + output_semaphore = *semaphore; + output_semaphore.handle = NULL; + output_semaphore.handle_type = handle_info->handleType; + output_semaphore.d3d12_fence_shm = NULL; fd_info.sType = VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR; fd_info.pNext = handle_info->pNext; - fd_info.semaphore = handle_info->semaphore; + fd_info.semaphore = output_semaphore.obj.host.semaphore; fd_info.flags = handle_info->flags; fd_info.handleType = handle_info->handleType; - if (fd_info.handleType == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT) + if (handle_info->handleType == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT || + handle_info->handleType == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) { if (handle_info->name) { @@ -2851,10 +3143,49 @@ VkResult wine_vkImportSemaphoreWin32HandleKHR(VkDevice client_device, return VK_ERROR_INVALID_EXTERNAL_HANDLE; } + if (NtDuplicateObject( NtCurrentProcess(), handle_info->handle, NtCurrentProcess(), &output_semaphore.handle, 0, 0, DUPLICATE_SAME_ACCESS )) + return VK_ERROR_INVALID_EXTERNAL_HANDLE; + fd_info.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; - if (wine_server_handle_to_fd(handle_info->handle, GENERIC_ALL, &fd_info.fd, NULL) != STATUS_SUCCESS) + if ((fd_info.fd = get_shared_resource_fd(output_semaphore.handle)) == -1) + { + WARN("Invalid handle %p.\n", handle_info->handle); + NtClose(output_semaphore.handle); return VK_ERROR_INVALID_EXTERNAL_HANDLE; + } + + if (handle_info->handleType == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + if (handle_info->flags & VK_SEMAPHORE_IMPORT_TEMPORARY_BIT) + { + FIXME("Temporarily importing d3d12 fences unsupported.\n"); + close(fd_info.fd); + NtClose(output_semaphore.handle); + return VK_ERROR_INVALID_EXTERNAL_HANDLE; + } + + if (!(d3d12_fence_shm = get_shared_resource_object(output_semaphore.handle, 0))) + { + ERR("Failed to get D3D12 semaphore memory.\n"); + close(fd_info.fd); + NtClose(output_semaphore.handle); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + + size = sizeof(*output_semaphore.d3d12_fence_shm); + if ((stat = NtMapViewOfSection(d3d12_fence_shm, GetCurrentProcess(), (void**) &output_semaphore.d3d12_fence_shm, 0, 0, NULL, &size, ViewShare, 0, PAGE_READWRITE))) + { + ERR("Failed to map D3D12 semaphore memory. stat %#x.\n", (int)stat); + close(fd_info.fd); + NtClose(d3d12_fence_shm); + NtClose(output_semaphore.handle); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + + NtClose(d3d12_fence_shm); + } } + wine_vk_normalize_semaphore_handle_types_host(&fd_info.handleType); if (!fd_info.handleType) @@ -2863,9 +3194,396 @@ VkResult wine_vkImportSemaphoreWin32HandleKHR(VkDevice client_device, return VK_ERROR_INVALID_EXTERNAL_HANDLE; } - /* importing FDs transfers ownership, importing NT handles does not */ - if ((res = device->p_vkImportSemaphoreFdKHR(device->host.device, &fd_info)) != VK_SUCCESS) + if ((res = device->p_vkImportSemaphoreFdKHR(device->host.device, &fd_info)) == VK_SUCCESS) + { + if (semaphore->handle) + NtClose(semaphore->handle); + if (semaphore->d3d12_fence_shm) + NtUnmapViewOfSection(GetCurrentProcess(), semaphore->d3d12_fence_shm); + + *semaphore = output_semaphore; + } + else + { + if (output_semaphore.handle) + NtClose(output_semaphore.handle); + if (output_semaphore.d3d12_fence_shm) + NtUnmapViewOfSection(GetCurrentProcess(), output_semaphore.d3d12_fence_shm); + + /* importing FDs transfers ownership, importing NT handles does not */ close(fd_info.fd); + } return res; } + +static VkResult vk_get_semaphore_counter_value(VkDevice device_handle, VkSemaphore semaphore_handle, uint64_t *value, bool khr) +{ + struct wine_semaphore *semaphore = wine_semaphore_from_handle(semaphore_handle); + struct vulkan_device *device = vulkan_device_from_handle(device_handle); + + if (khr) + return device->p_vkGetSemaphoreCounterValueKHR(device->host.device, semaphore->obj.host.semaphore, value); + else + return device->p_vkGetSemaphoreCounterValue(device->host.device, semaphore->obj.host.semaphore, value); +} + +static VkResult wine_vk_get_semaphore_counter_value(VkDevice device_handle, VkSemaphore semaphore_handle, uint64_t *value, bool khr) +{ + struct wine_semaphore *semaphore = wine_semaphore_from_handle(semaphore_handle); + + if (semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + d3d12_semaphore_lock(semaphore); + *value = semaphore->d3d12_fence_shm->virtual_value; + d3d12_semaphore_unlock(semaphore); + return VK_SUCCESS; + } + + return vk_get_semaphore_counter_value(device_handle, semaphore_handle, value, khr); +} + +VkResult wine_vkGetSemaphoreCounterValue(VkDevice device_handle, VkSemaphore semaphore_handle, uint64_t *value) +{ + return wine_vk_get_semaphore_counter_value(device_handle, semaphore_handle, value, false); +} + +VkResult wine_vkGetSemaphoreCounterValueKHR(VkDevice device_handle, VkSemaphore semaphore_handle, uint64_t *value) +{ + return wine_vk_get_semaphore_counter_value(device_handle, semaphore_handle, value, true); +} + +static VkResult vk_signal_semaphore(VkDevice device_handle, const VkSemaphoreSignalInfo *signal_info, bool khr) +{ + struct wine_semaphore *semaphore = wine_semaphore_from_handle(signal_info->semaphore); + struct vulkan_device *device = vulkan_device_from_handle(device_handle); + VkSemaphoreSignalInfo dup_signal_info = *signal_info; + + dup_signal_info.semaphore = semaphore->obj.host.semaphore; + if (khr) + return device->p_vkSignalSemaphoreKHR(device->host.device, &dup_signal_info); + else + return device->p_vkSignalSemaphore(device->host.device, &dup_signal_info); +} + +static NTSTATUS wine_vk_signal_semaphore(VkDevice device, const VkSemaphoreSignalInfo *signal_info, bool khr) +{ + struct wine_semaphore *semaphore = wine_semaphore_from_handle(signal_info->semaphore); + + TRACE("(%p, %p)\n", device, signal_info); + + if (semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + FIXME("Signalling D3D12-Fence compatible timeline semaphore not supported.\n"); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + + return vk_signal_semaphore(device, signal_info, khr); +} + +VkResult wine_vkSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo *signal_info) +{ + return wine_vk_signal_semaphore(device, signal_info, false); +} + +VkResult wine_vkSignalSemaphoreKHR(VkDevice device, const VkSemaphoreSignalInfo *signal_info) +{ + return wine_vk_signal_semaphore(device, signal_info, true); +} + +static VkSemaphore *unwrap_semaphore_array(const VkSemaphore *in, uint32_t count, struct conversion_context *ctx) +{ + VkSemaphore *out; + unsigned int i; + + if (!in || !count) return NULL; + + out = conversion_context_alloc(ctx, count * sizeof(*out)); + for (i = 0; i < count; ++i) + out[i] = in[i] ? wine_semaphore_from_handle(in[i])->obj.host.semaphore : VK_NULL_HANDLE; + + return out; +} + +static VkResult vk_wait_semaphores(struct vulkan_device *device, const VkSemaphoreWaitInfo *wait_info, uint64_t timeout, bool khr) +{ + VkSemaphoreWaitInfo wait_info_dup = *wait_info; + struct conversion_context ctx; + VkResult ret; + + init_conversion_context(&ctx); + wait_info_dup.pSemaphores = unwrap_semaphore_array(wait_info->pSemaphores, wait_info->semaphoreCount, &ctx); + if (khr) + ret = device->p_vkWaitSemaphoresKHR(device->host.device, &wait_info_dup, timeout); + else + ret = device->p_vkWaitSemaphores(device->host.device, &wait_info_dup, timeout); + free_conversion_context(&ctx); + return ret; +} + +static VkResult wine_vk_wait_semaphores(VkDevice device_handle, const VkSemaphoreWaitInfo *wait_info, uint64_t timeout, bool khr) +{ + unsigned int i; + + TRACE("(%p, %p, 0x%s)\n", device_handle, wait_info, wine_dbgstr_longlong(timeout)); + + for (i = 0; i < wait_info->semaphoreCount; i++) + { + struct wine_semaphore *semaphore = wine_semaphore_from_handle(wait_info->pSemaphores[i]); + + if (semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + FIXME("Waiting on D3D12-Fence compatible timeline semaphores not supported."); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + } + return vk_wait_semaphores(vulkan_device_from_handle(device_handle), wait_info, timeout, khr); +} + +VkResult wine_vkWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo *wait_info, uint64_t timeout) +{ + return wine_vk_wait_semaphores(device, wait_info, timeout, false); +} + +VkResult wine_vkWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfo *wait_info, uint64_t timeout) +{ + return wine_vk_wait_semaphores(device, wait_info, timeout, true); +} + +VkResult vk_queue_submit_unwrap(struct vulkan_queue *queue, uint32_t submit_count, const VkSubmitInfo *submits_orig, VkFence fence) +{ + struct conversion_context ctx; + VkSubmitInfo *submits; + unsigned int i, j; + VkResult ret; + + init_conversion_context(&ctx); + MEMDUP(&ctx, submits, submits_orig, submit_count); + for (i = 0; i < submit_count; ++i) + { + submits[i].pWaitSemaphores = unwrap_semaphore_array(submits[i].pWaitSemaphores, submits[i].waitSemaphoreCount, &ctx); + submits[i].pSignalSemaphores = unwrap_semaphore_array(submits[i].pSignalSemaphores, submits[i].signalSemaphoreCount, &ctx); + if (submits[i].pCommandBuffers && submits[i].commandBufferCount) + { + VkCommandBuffer *out; + + out = conversion_context_alloc(&ctx, submits[i].commandBufferCount * sizeof(*out)); + for (j = 0; j < submits[i].commandBufferCount; ++j) + out[j] = wine_cmd_buffer_from_handle(submits[i].pCommandBuffers[j])->host.command_buffer; + submits[i].pCommandBuffers = out; + } + } + ret = queue->device->p_vkQueueSubmit(queue->host.queue, submit_count, submits, fence); + free_conversion_context(&ctx); + return ret; +} + +VkResult wine_vkQueueSubmit(VkQueue queue_handle, uint32_t submit_count, const VkSubmitInfo *submits, VkFence fence) +{ + struct vulkan_queue *queue = vulkan_queue_from_handle(queue_handle); + unsigned int i, k; + + TRACE("(%p %u %p 0x%s)\n", queue_handle, submit_count, submits, wine_dbgstr_longlong(fence)); + + for (i = 0; i < submit_count; i++) + { + for (k = 0; k < submits[i].waitSemaphoreCount; k++) + { + if (wine_semaphore_from_handle(submits[i].pWaitSemaphores[k])->handle_type == + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + FIXME("Queue submissions with waits on D3D12-Fence compatible timeline semaphores not supported.\n"); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + } + + for (k = 0; k < submits[i].signalSemaphoreCount; k++) + { + if (wine_semaphore_from_handle(submits[i].pSignalSemaphores[k])->handle_type == + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + FIXME("Queue submissions with signalling D3D12-Fence compatible timeline semaphores not supported.\n"); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + } + } + return vk_queue_submit_unwrap(queue, submit_count, submits, fence); +} + +static void duplicate_array_for_unwrapping(struct conversion_context *ctx, void **ptr, unsigned int size) +{ + void *out; + + if (!*ptr || !size) + return; + + out = conversion_context_alloc(ctx, size); + memcpy(out, *ptr, size); + *ptr = out; +} + +VkResult vk_queue_submit_2_unwrap(struct vulkan_queue *queue, uint32_t submit_count, const VkSubmitInfo2 *submits_orig, + VkFence fence, bool khr) +{ + struct conversion_context ctx; + VkSubmitInfo2 *submits; + unsigned int i, j; + VkResult ret; + + init_conversion_context(&ctx); + MEMDUP(&ctx, submits, submits_orig, submit_count); + for (i = 0; i < submit_count; ++i) + { + duplicate_array_for_unwrapping(&ctx, (void **)&submits[i].pWaitSemaphoreInfos, + submits[i].waitSemaphoreInfoCount * sizeof(*submits[i].pWaitSemaphoreInfos)); + for (j = 0; j < submits[i].waitSemaphoreInfoCount; ++j) + if (submits[i].pWaitSemaphoreInfos[j].semaphore) + ((VkSemaphoreSubmitInfo *)submits[i].pWaitSemaphoreInfos)[j].semaphore + = wine_semaphore_from_handle(submits[i].pWaitSemaphoreInfos[j].semaphore)->obj.host.semaphore; + + duplicate_array_for_unwrapping(&ctx, (void **)&submits[i].pSignalSemaphoreInfos, + submits[i].signalSemaphoreInfoCount * sizeof(*submits[i].pSignalSemaphoreInfos)); + for (j = 0; j < submits[i].signalSemaphoreInfoCount; ++j) + if (submits[i].pSignalSemaphoreInfos[j].semaphore) + ((VkSemaphoreSubmitInfo *)submits[i].pSignalSemaphoreInfos)[j].semaphore + = wine_semaphore_from_handle(submits[i].pSignalSemaphoreInfos[j].semaphore)->obj.host.semaphore; + + if (submits[i].pCommandBufferInfos && submits[i].commandBufferInfoCount) + { + duplicate_array_for_unwrapping(&ctx, (void **)&submits[i].pCommandBufferInfos, + submits[i].commandBufferInfoCount * sizeof(*submits[i].pCommandBufferInfos)); + for (j = 0; j < submits[i].commandBufferInfoCount; ++j) + ((VkCommandBufferSubmitInfo *)submits[i].pCommandBufferInfos)[j].commandBuffer + = wine_cmd_buffer_from_handle(submits[i].pCommandBufferInfos[j].commandBuffer)->host.command_buffer; + } + } + if (khr) + ret = queue->device->p_vkQueueSubmit2KHR(queue->host.queue, submit_count, submits, fence); + else + ret = queue->device->p_vkQueueSubmit2(queue->host.queue, submit_count, submits, fence); + free_conversion_context(&ctx); + return ret; +} + +static VkResult vk_queue_submit_2(VkQueue queue_handle, uint32_t submit_count, const VkSubmitInfo2 *submits, VkFence fence, bool khr) +{ + struct vulkan_queue *queue = vulkan_queue_from_handle(queue_handle); + unsigned int i, k; + + TRACE("(%p, %u, %p, %s)\n", queue_handle, submit_count, submits, wine_dbgstr_longlong(fence)); + + for (i = 0; i < submit_count; i++) + { + for (k = 0; k < submits[i].waitSemaphoreInfoCount; k++) + { + if (wine_semaphore_from_handle(submits[i].pWaitSemaphoreInfos[k].semaphore)->handle_type == + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + FIXME("Queue submissions with waits on D3D12-Fence compatible timeline semaphores not supported.\n"); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + } + + for (k = 0; k < submits[i].signalSemaphoreInfoCount; k++) + { + if (wine_semaphore_from_handle(submits[i].pSignalSemaphoreInfos[k].semaphore)->handle_type == + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + FIXME("Queue submissions signalling D3D12-Fence compatible timeline semaphores not supported.\n"); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + } + } + + return vk_queue_submit_2_unwrap(queue, submit_count, submits, fence, khr); +} + +VkResult wine_vkQueueSubmit2(VkQueue queue, uint32_t submit_count, const VkSubmitInfo2 *submits, VkFence fence) +{ + return vk_queue_submit_2(queue, submit_count, submits, fence, false); +} + +VkResult wine_vkQueueSubmit2KHR(VkQueue queue, uint32_t submit_count, const VkSubmitInfo2 *submits, VkFence fence) +{ + return vk_queue_submit_2(queue, submit_count, submits, fence, true); +} + +VkResult wine_vkQueueBindSparse(VkQueue queue_handle, uint32_t bind_info_count, const VkBindSparseInfo *bind_info, VkFence fence) +{ + struct vulkan_queue *queue = vulkan_queue_from_handle(queue_handle); + struct wine_semaphore *semaphore; + struct conversion_context ctx; + VkBindSparseInfo *batch; + unsigned int i, j, k; + VkResult ret; + + TRACE("(%p, %u, %p, 0x%s)\n", queue, bind_info_count, bind_info, wine_dbgstr_longlong(fence)); + + for (i = 0; i < bind_info_count; i++) + { + batch = (VkBindSparseInfo *)&bind_info[i]; + + for (k = 0; k < batch->waitSemaphoreCount; k++) + { + semaphore = wine_semaphore_from_handle(batch->pWaitSemaphores[k]); + + if (semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + FIXME("Waiting on D3D12-Fence compatible timeline semaphore not supported.\n"); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + } + + for(k = 0; k < batch->signalSemaphoreCount; k++) + { + semaphore = wine_semaphore_from_handle(batch->pSignalSemaphores[k]); + + if (semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + FIXME("Signalling D3D12-Fence compatible timeline semaphore not supported.\n"); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + } + } + + init_conversion_context(&ctx); + for (i = 0; i < bind_info_count; ++i) + { + batch = (VkBindSparseInfo *)&bind_info[i]; + batch->pWaitSemaphores = unwrap_semaphore_array(batch->pWaitSemaphores, batch->waitSemaphoreCount, &ctx); + batch->pSignalSemaphores = unwrap_semaphore_array(batch->pSignalSemaphores, batch->signalSemaphoreCount, &ctx); + + duplicate_array_for_unwrapping(&ctx, (void **)&batch->pBufferBinds, batch->bufferBindCount * sizeof(*batch->pBufferBinds)); + for (j = 0; j < batch->bufferBindCount; ++j) + { + VkSparseBufferMemoryBindInfo *bind = (VkSparseBufferMemoryBindInfo *)&batch->pBufferBinds[j]; + duplicate_array_for_unwrapping(&ctx, (void **)&bind->pBinds, bind->bindCount * sizeof(*bind->pBinds)); + for (k = 0; k < bind->bindCount; ++k) + if (bind->pBinds[k].memory) + ((VkSparseMemoryBind *)bind->pBinds)[k].memory = wine_device_memory_from_handle(bind->pBinds[k].memory)->host.device_memory; + } + + duplicate_array_for_unwrapping(&ctx, (void **)&batch->pImageOpaqueBinds, batch->imageOpaqueBindCount * sizeof(*batch->pImageOpaqueBinds)); + for (j = 0; j < batch->imageOpaqueBindCount; ++j) + { + VkSparseImageOpaqueMemoryBindInfo *bind = (VkSparseImageOpaqueMemoryBindInfo *)&batch->pImageOpaqueBinds[j]; + duplicate_array_for_unwrapping(&ctx, (void **)&bind->pBinds, bind->bindCount * sizeof(*bind->pBinds)); + for (k = 0; k < bind->bindCount; ++k) + if (bind->pBinds[k].memory) + ((VkSparseMemoryBind *)bind->pBinds)[k].memory = wine_device_memory_from_handle(bind->pBinds[k].memory)->host.device_memory; + } + + duplicate_array_for_unwrapping(&ctx, (void **)&batch->pImageBinds, batch->imageBindCount * sizeof(*batch->pImageBinds)); + for (j = 0; j < batch->imageBindCount; ++j) + { + VkSparseImageMemoryBindInfo *bind = (VkSparseImageMemoryBindInfo *)&batch->pImageBinds[j]; + duplicate_array_for_unwrapping(&ctx, (void **)&bind->pBinds, bind->bindCount * sizeof(*bind->pBinds)); + for (k = 0; k < bind->bindCount; ++k) + if (bind->pBinds[k].memory) + ((VkSparseImageMemoryBind *)bind->pBinds)[k].memory = wine_device_memory_from_handle(bind->pBinds[k].memory)->host.device_memory; + } + } + ret = queue->device->p_vkQueueBindSparse(queue->host.queue, bind_info_count, bind_info, fence); + free_conversion_context(&ctx); + return ret; +} diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index 9bd2d4ebeea9..a0aa1818cf5d 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -170,6 +170,24 @@ static inline void free_conversion_context(struct conversion_context *pool) free(entry); } +struct wine_semaphore +{ + struct vulkan_semaphore obj; + VkSemaphore semaphore; + VkSemaphore fence_timeline_semaphore; + + VkExternalSemaphoreHandleTypeFlagBits export_types; + + /* mutable members */ + VkExternalSemaphoreHandleTypeFlagBits handle_type; + HANDLE handle; + struct + { + pthread_mutex_t mutex; + uint64_t virtual_value; + } *d3d12_fence_shm; +}; + static inline void *conversion_context_alloc(struct conversion_context *pool, size_t size) { if (pool->used + size <= sizeof(pool->buffer)) @@ -247,4 +265,7 @@ static inline void init_unicode_string( UNICODE_STRING *str, const WCHAR *data ) str->Buffer = (WCHAR *)data; } +#define MEMDUP(ctx, dst, src, count) dst = conversion_context_alloc((ctx), sizeof(*(dst)) * (count)); \ + memcpy((void *)(dst), (src), sizeof(*(dst)) * (count)); + #endif /* __WINE_VULKAN_PRIVATE_H */ diff --git a/include/wine/vulkan_driver.h b/include/wine/vulkan_driver.h index 919e02ecaa91..3af7eb25cef3 100644 --- a/include/wine/vulkan_driver.h +++ b/include/wine/vulkan_driver.h @@ -156,6 +156,17 @@ static inline struct vulkan_swapchain *vulkan_swapchain_from_handle( VkSwapchain return (struct vulkan_swapchain *)(UINT_PTR)handle; } +struct vulkan_semaphore +{ + VULKAN_OBJECT_HEADER( VkSemaphore, semaphore ); + BOOL d3d12_fence; +}; + +static inline struct vulkan_semaphore *vulkan_semaphore_from_handle( VkSemaphore handle ) +{ + return (struct vulkan_semaphore *)(UINT_PTR)handle; +} + struct vulkan_funcs { /* Vulkan global functions. These are the only calls at this point a graphics driver From a3af46bef93ee63fd12f18ebeb11f7e1fa42a547 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 27 Dec 2022 17:59:06 -0600 Subject: [PATCH 0884/2542] winevulkan: Only append VK_KHR_timeline_semaphore for Vk API version < 1.2. CW-Bug-Id: #22526 --- dlls/winevulkan/vulkan.c | 28 +++++++++++++++++++++++++++- include/wine/vulkan_driver.h | 2 ++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 7ea61349269f..f8af4de2d859 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -361,6 +361,7 @@ static VkResult wine_vk_physical_device_init(struct wine_phys_dev *object, VkPhy BOOL have_memory_placed = FALSE, have_map_memory2 = FALSE; uint32_t num_host_properties, num_properties = 0; VkExtensionProperties *host_properties = NULL; + VkPhysicalDeviceProperties physdev_properties; BOOL have_external_memory_host = FALSE; VkResult res; unsigned int i, j; @@ -370,6 +371,9 @@ static VkResult wine_vk_physical_device_init(struct wine_phys_dev *object, VkPhy instance->p_vkGetPhysicalDeviceMemoryProperties(host_physical_device, &object->memory_properties); + instance->p_vkGetPhysicalDeviceProperties(host_physical_device, &physdev_properties); + object->obj.api_version = physdev_properties.apiVersion; + res = instance->p_vkEnumerateDeviceExtensionProperties(host_physical_device, NULL, &num_host_properties, NULL); if (res != VK_SUCCESS) @@ -671,7 +675,8 @@ static VkResult wine_vk_device_convert_create_info(VkPhysicalDevice client_physi remove_extensions[remove_count++] = "VK_KHR_external_semaphore_win32"; } - if (!find_extension(extensions, extensions_count, "VK_KHR_timeline_semaphore")) + if ((phys_dev->obj.api_version < VK_API_VERSION_1_2 || phys_dev->obj.instance->api_version < VK_API_VERSION_1_2) + && !find_extension(extensions, extensions_count, "VK_KHR_timeline_semaphore")) extra_extensions[extra_count++] = "VK_KHR_timeline_semaphore"; if (phys_dev->map_placed_align) @@ -1190,6 +1195,8 @@ VkResult wine_vkCreateInstance(const VkInstanceCreateInfo *create_info, app_info->engineVersion); TRACE("API version %#x.\n", app_info->apiVersion); + instance->obj.api_version = app_info->apiVersion; + if (app_info->pEngineName && !strcmp(app_info->pEngineName, "idTech")) instance->quirks |= WINEVULKAN_QUIRK_GET_DEVICE_PROC_ADDR; } @@ -1920,6 +1927,25 @@ static void wine_vk_get_physical_device_external_semaphore_properties(struct win break; case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT: { + unsigned int i; + + if (phys_dev->obj.api_version < VK_API_VERSION_1_2 || + phys_dev->obj.instance->api_version < VK_API_VERSION_1_2) + { + for (i = 0; i < phys_dev->extension_count; i++) + { + if (!strcmp(phys_dev->extensions[i].extensionName, "VK_KHR_timeline_semaphore")) + break; + } + if (i == phys_dev->extension_count) + { + properties->exportFromImportedHandleTypes = 0; + properties->compatibleHandleTypes = 0; + properties->externalSemaphoreFeatures = 0; + return; + } + } + if ((p_semaphore_type_info = find_next_struct(&semaphore_info_dup, VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO))) { p_semaphore_type_info->semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE; diff --git a/include/wine/vulkan_driver.h b/include/wine/vulkan_driver.h index 3af7eb25cef3..fe989bbf8099 100644 --- a/include/wine/vulkan_driver.h +++ b/include/wine/vulkan_driver.h @@ -82,6 +82,7 @@ struct vulkan_instance #undef USE_VK_FUNC void (*p_insert_object)( struct vulkan_instance *instance, struct vulkan_object *obj ); void (*p_remove_object)( struct vulkan_instance *instance, struct vulkan_object *obj ); + uint32_t api_version; }; static inline struct vulkan_instance *vulkan_instance_from_handle( VkInstance handle ) @@ -94,6 +95,7 @@ struct vulkan_physical_device { VULKAN_OBJECT_HEADER( VkPhysicalDevice, physical_device ); struct vulkan_instance *instance; + uint32_t api_version; }; static inline struct vulkan_physical_device *vulkan_physical_device_from_handle( VkPhysicalDevice handle ) From 41c59aed472f6d4872ee66341e28c48c2564f48c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 20 Jan 2025 15:51:39 +0100 Subject: [PATCH 0885/2542] winevulkan: Force copying VkSubmitInfo[2] structures. Based on patches by Derek Lesho. CW-Bug-Id: #22526 --- dlls/winevulkan/make_vulkan | 48 ++++++++++++++++++++++---------- dlls/winevulkan/vulkan.c | 2 +- dlls/winevulkan/vulkan_private.h | 2 ++ 3 files changed, 36 insertions(+), 16 deletions(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 53edd9646738..a1e26f012944 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -182,7 +182,7 @@ FUNCTION_OVERRIDES = { "vkSignalSemaphore" : {"dispatch" : True}, "vkWaitSemaphores" : {"dispatch" : True}, "vkQueueBindSparse" : {"dispatch" : True}, - "vkQueueSubmit" : {"dispatch" : True}, + "vkQueueSubmit" : {"dispatch" : True, "extra_param" : "pSubmits"}, "vkQueueSubmit2" : {"dispatch" : True}, "vkDestroySemaphore" : {"dispatch" : True}, @@ -335,11 +335,16 @@ STRUCT_CHAIN_CONVERSIONS = { "VkPhysicalDeviceImageFormatInfo2": [], "VkPhysicalDeviceExternalSemaphoreInfo": [], "VkSemaphoreCreateInfo": [], - "VkSubmitInfo": [], + "VkSubmitInfo": ["VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR"], "VkSubmitInfo2": [], "VkBindSparseInfo" : [], } +STRUCT_COPY = { + "VkSubmitInfo", + "VkSubmitInfo2", +}; + # Some struct members are conditionally ignored and callers are free to leave them uninitialized. # We can't deduce that from XML, so we allow expressing it here. MEMBER_LENGTH_EXPRESSIONS = { @@ -1470,6 +1475,9 @@ class VkVariable(object): if struct.needs_conversion(conv, unwrap, Direction.OUTPUT, is_const): conversions.append(StructConversionFunction(struct, Direction.OUTPUT, conv, unwrap, is_const)) + if struct.name in STRUCT_COPY: + conversions.append(StructConversionFunction(struct, Direction.INPUT, False, unwrap, is_const, True)) + if self.is_static_array() or self.is_dynamic_array(): for conv in [False, True]: if self.needs_conversion(conv, unwrap, Direction.INPUT, parent_const): @@ -1592,14 +1600,14 @@ class VkMember(VkVariable): values=values, object_type=object_type, bit_width=bit_width, returnedonly=returnedonly, parent=parent, selection=selection, selector=selector) - def copy(self, input, output, direction, conv, unwrap): + def copy(self, input, output, direction, conv, unwrap, copy): """ Helper method for use by conversion logic to generate a C-code statement to copy this member. - `conv` indicates whether the statement is in a struct alignment conversion path. """ win_type = "win32" if conv else "win64" suffix = convert_suffix(direction, win_type, unwrap, self.is_wrapped()) - if self.needs_conversion(conv, unwrap, direction, False): + if self.needs_conversion(conv, unwrap, direction, False) and not copy: if self.is_dynamic_array(): # Array length is either a variable name (string) or an int. count = self.get_dyn_array_len(input, conv) @@ -1650,6 +1658,11 @@ class VkMember(VkVariable): for l in self.array_lens: bytes_count = "{0} * ".format(l) + bytes_count return "memcpy({0}{1}, {2}{1}, {3});\n".format(output, self.name, input, bytes_count) + elif self.is_dynamic_array() and copy: + if self.type == "void": + return "MEMDUP_VOID(ctx, {0}{1}, {2}{1}, {3});\n".format(output, self.name, input, self.get_dyn_array_len(input, conv)) + else: + return "MEMDUP(ctx, {0}{1}, {2}{1}, {3});\n".format(output, self.name, input, self.get_dyn_array_len(input, conv)) elif conv and direction == Direction.OUTPUT and self.is_pointer(): return "{0}{1} = PtrToUlong({2}{1});\n".format(output, self.name, input) elif conv and direction == Direction.INPUT and self.is_pointer(): @@ -2374,17 +2387,21 @@ class VkStruct(Sequence): class StructConversionFunction(object): - def __init__(self, struct, direction, conv, unwrap, const): + def __init__(self, struct, direction, conv, unwrap, const, copy=False): self.direction = direction self.operand = struct self.type = struct.name self.conv = conv self.unwrap = unwrap self.const = const + self.copy = copy - name = "convert_{0}_".format(self.type) - win_type = "win32" if self.conv else "win64" - name += convert_suffix(direction, win_type, unwrap, struct.is_wrapped()) + if copy: + name = "copy_{0}".format(self.type) + else: + name = "convert_{0}_".format(self.type) + win_type = "win32" if self.conv else "win64" + name += convert_suffix(direction, win_type, unwrap, struct.is_wrapped()) self.name = name def __eq__(self, other): @@ -2416,7 +2433,7 @@ class StructConversionFunction(object): body = "" - if not self.conv: + if not self.conv and not self.copy: body += "#ifdef _WIN64\n" needs_alloc = self.direction != Direction.OUTPUT and self.operand.needs_alloc(self.conv, self.unwrap) @@ -2426,8 +2443,11 @@ class StructConversionFunction(object): if self.direction == Direction.OUTPUT and self.const: win_type = "const " + win_type - if self.conv: + if self.copy: + body += "void {0}(".format(self.name) + else: body += "static inline void {0}(".format(self.name) + if self.conv: if self.direction == Direction.OUTPUT: params = ["const {0} *in".format(self.type), "{0} *out".format(win_type)] @@ -2444,8 +2464,6 @@ class StructConversionFunction(object): body += ")\n" else: - body += "static inline void {0}(".format(self.name) - params = ["const {0} *in".format(self.type), "{0} *out".format(self.type)] # Generate parameter list @@ -2488,7 +2506,7 @@ class StructConversionFunction(object): body += " || ".join("selector == {}".format(s) for s in m.selection) body += ")\n " - body += " " + m.copy("in->", "out->", self.direction, self.conv, self.unwrap) + body += " " + m.copy("in->", "out->", self.direction, self.conv, self.unwrap, self.copy) if needs_extensions: if self.conv and self.direction == Direction.INPUT: @@ -2547,7 +2565,7 @@ class StructConversionFunction(object): if m.name == "pNext": copy_body += ident + "out_ext->pNext = NULL;\n" continue - copy_body += ident + m.copy("in_ext->", "out_ext->", self.direction, self.conv, Unwrap.HOST) + copy_body += ident + m.copy("in_ext->", "out_ext->", self.direction, self.conv, Unwrap.HOST, self.copy) # Generate the definition of "in_ext" if we need it if "in_ext->" in copy_body: @@ -2582,7 +2600,7 @@ class StructConversionFunction(object): body += " FIXME(\"Unexpected pNext\\n\");\n" body += "}\n" - if not self.conv: + if not self.conv and not self.copy: body += "#endif /* _WIN64 */\n" body += "\n" diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index f8af4de2d859..c23c19edf1b3 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -3404,7 +3404,7 @@ VkResult vk_queue_submit_unwrap(struct vulkan_queue *queue, uint32_t submit_coun return ret; } -VkResult wine_vkQueueSubmit(VkQueue queue_handle, uint32_t submit_count, const VkSubmitInfo *submits, VkFence fence) +VkResult wine_vkQueueSubmit(VkQueue queue_handle, uint32_t submit_count, const VkSubmitInfo *submits, VkFence fence, void *submits_win_ptr) { struct vulkan_queue *queue = vulkan_queue_from_handle(queue_handle); unsigned int i, k; diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index a0aa1818cf5d..c36c52ec327b 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -267,5 +267,7 @@ static inline void init_unicode_string( UNICODE_STRING *str, const WCHAR *data ) #define MEMDUP(ctx, dst, src, count) dst = conversion_context_alloc((ctx), sizeof(*(dst)) * (count)); \ memcpy((void *)(dst), (src), sizeof(*(dst)) * (count)); +#define MEMDUP_VOID(ctx, dst, src, size) dst = conversion_context_alloc((ctx), size); \ + memcpy((void *)(dst), (src), size); #endif /* __WINE_VULKAN_PRIVATE_H */ From 3fea66f351255efe5b1d4afe0a99c9b52c5b987b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 31 Jul 2023 11:12:21 -0600 Subject: [PATCH 0886/2542] winevulkan: Support waiting for and signalling d3d12 shared fences. CW-Bug-Id: #22526 --- dlls/winevulkan/vulkan.c | 718 +++++++++++++++++++++++++------ dlls/winevulkan/vulkan_private.h | 23 +- include/wine/vulkan_driver.h | 17 + 3 files changed, 622 insertions(+), 136 deletions(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index c23c19edf1b3..974c1f98d6de 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -25,6 +25,13 @@ #include #include #include +#include +#include +#include +#include +#ifdef HAVE_SYS_SYSCALL_H +# include +#endif #include "ntstatus.h" #define WIN32_NO_STATUS @@ -32,6 +39,7 @@ #include "winnt.h" #include "winioctl.h" #include "wine/server.h" +#include "wine/list.h" #include "vulkan_private.h" #include "wine/vulkan_driver.h" @@ -41,6 +49,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(vulkan); +static int debug_level; + static PFN_vkCreateInstance p_vkCreateInstance; static PFN_vkEnumerateInstanceVersion p_vkEnumerateInstanceVersion; static PFN_vkEnumerateInstanceExtensionProperties p_vkEnumerateInstanceExtensionProperties; @@ -191,6 +201,38 @@ static void append_debug_utils_object(const VkDebugUtilsObjectNameInfoEXT *objec dst->object_name_len = append_string(object->pObjectName, strings, strings_len); } +static void signal_timeline_sem(struct vulkan_device *device, VkSemaphore sem, uint64_t *value) +{ + /* May be called from native thread. */ + struct VkSemaphoreSignalInfo info = { 0 }; + VkResult res; + + info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO; + info.semaphore = sem; + ++*value; + info.value = *value; + if (device->physical_device->api_version < VK_API_VERSION_1_2 || device->physical_device->instance->api_version < VK_API_VERSION_1_2) + res = device->p_vkSignalSemaphoreKHR(device->host.device, &info); + else + res = device->p_vkSignalSemaphore(device->host.device, &info); + if (res != VK_SUCCESS) + fprintf(stderr, "err:winevulkan:signal_timeline_sem vkSignalSemaphore failed, res=%d.\n", res); +} + +static VkResult wait_semaphores(struct vulkan_device *device, const VkSemaphoreWaitInfo *wait_info, uint64_t timeout) +{ + if (device->physical_device->api_version < VK_API_VERSION_1_2 || device->physical_device->instance->api_version < VK_API_VERSION_1_2) + return device->p_vkWaitSemaphoresKHR(device->host.device, wait_info, timeout); + return device->p_vkWaitSemaphores(device->host.device, wait_info, timeout); +} + +static VkResult get_semaphore_value(struct vulkan_device *device, VkSemaphore sem, uint64_t *value) +{ + if (device->physical_device->api_version < VK_API_VERSION_1_2 || device->physical_device->instance->api_version < VK_API_VERSION_1_2) + return device->p_vkGetSemaphoreCounterValueKHR(device->host.device, sem, value); + return device->p_vkGetSemaphoreCounterValue(device->host.device, sem, value); +} + static VkBool32 debug_utils_callback_conversion(VkDebugUtilsMessageSeverityFlagBitsEXT severity, VkDebugUtilsMessageTypeFlagsEXT message_types, const VkDebugUtilsMessengerCallbackDataEXT *callback_data, @@ -1035,6 +1077,10 @@ VkResult wine_vkCreateDevice(VkPhysicalDevice client_physical_device, const VkDe native_create_device_context = callback->context; } + pthread_mutex_init(&device->signaller_mutex, NULL); + list_init(&device->sem_poll_list); + list_init(&device->free_fence_ops_list); + init_conversion_context(&ctx); res = wine_vk_device_convert_create_info(client_physical_device, &ctx, create_info, &create_info_host); if (res == VK_SUCCESS) @@ -1073,6 +1119,7 @@ VkResult wine_vkCreateDevice(VkPhysicalDevice client_physical_device, const VkDe if (res != VK_SUCCESS) { WARN("Failed to create device, res=%d.\n", res); + pthread_mutex_destroy(&device->signaller_mutex); free(device); return res; } @@ -1216,6 +1263,7 @@ VkResult wine_vkCreateInstance(const VkInstanceCreateInfo *create_info, void wine_vkDestroyDevice(VkDevice client_device, const VkAllocationCallbacks *allocator) { + struct pending_d3d12_fence_op *op, *next; struct vulkan_device *device = vulkan_device_from_handle(client_device); struct vulkan_instance *instance = device->physical_device->instance; unsigned int i; @@ -1225,6 +1273,26 @@ void wine_vkDestroyDevice(VkDevice client_device, const VkAllocationCallbacks *a if (!device) return; + if (device->signaller_thread) + { + TRACE("Shutting down signaller thread.\n"); + pthread_mutex_lock(&device->signaller_mutex); + device->stop = 1; + signal_timeline_sem(device, device->sem_poll_update.sem, &device->sem_poll_update.value); + pthread_mutex_unlock(&device->signaller_mutex); + pthread_join(device->signaller_thread, NULL); + device->p_vkDestroySemaphore(device->host.device, device->sem_poll_update.sem, NULL); + pthread_cond_destroy(&device->sem_poll_updated_cond); + TRACE("Signaller thread shut down.\n"); + } + pthread_mutex_destroy(&device->signaller_mutex); + + LIST_FOR_EACH_ENTRY_SAFE(op, next, &device->free_fence_ops_list, struct pending_d3d12_fence_op, entry) + { + device->p_vkDestroySemaphore(device->host.device, op->local_sem.sem, NULL); + free(op); + } + device->p_vkDestroyDevice(device->host.device, NULL /* pAllocator */); for (i = 0; i < device->queue_count; i++) vulkan_instance_remove_object(instance, &device->queues[i].obj); @@ -2900,6 +2968,363 @@ static void d3d12_semaphore_unlock(struct wine_semaphore *semaphore) pthread_mutex_unlock(&semaphore->d3d12_fence_shm->mutex); } +static VkSemaphore create_timeline_semaphore(struct vulkan_device *device) +{ + VkSemaphoreTypeCreateInfo timeline_info = { 0 }; + VkSemaphoreCreateInfo create_info = { 0 }; + VkSemaphore sem = 0; + VkResult res; + + timeline_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; + timeline_info.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE; + create_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; + create_info.pNext = &timeline_info; + + res = device->p_vkCreateSemaphore(device->host.device, &create_info, NULL, &sem); + if (res != VK_SUCCESS) + ERR("vkCreateSemaphore failed, res=%d\n", res); + return sem; +} + +static void release_fence_op(struct vulkan_device *device, struct pending_d3d12_fence_op *op) +{ + list_remove(&op->entry); + vulkan_instance_remove_object(device->physical_device->instance, &op->semaphore->obj.obj); + vulkan_object_init(&op->semaphore->obj.obj, op->semaphore->semaphore); + vulkan_instance_insert_object(device->physical_device->instance, &op->semaphore->obj.obj); + op->semaphore = NULL; + list_add_head(&device->free_fence_ops_list, &op->entry); +} + +static int wait_info_realloc(VkSemaphoreWaitInfo *wait_info, uint32_t *wait_alloc_count) +{ + VkSemaphore *new_sem; + uint64_t *new_values; + + if (wait_info->semaphoreCount + 1 <= *wait_alloc_count) + return 1; + new_sem = realloc((void *)wait_info->pSemaphores, *wait_alloc_count * 2 * sizeof(*new_sem)); + if (!new_sem) + { + fprintf(stderr, "err:winevulkan:wait_info_realloc no memory.\n"); + return 0; + } + new_values = realloc((void *)wait_info->pValues, *wait_alloc_count * 2 * sizeof(*new_values)); + if (!new_values) + { + fprintf(stderr, "err:winevulkan:wait_info_realloc no memory.\n"); + return 0; + } + *wait_alloc_count *= 2; + wait_info->pSemaphores = new_sem; + wait_info->pValues = new_values; + return 1; +} + +static int add_sem_wait(VkSemaphoreWaitInfo *wait_info, uint32_t *wait_alloc_count, VkSemaphore sem, uint64_t value) +{ + if (!wait_info_realloc(wait_info, wait_alloc_count)) + return 0; + ((VkSemaphore *)wait_info->pSemaphores)[wait_info->semaphoreCount] = sem; + ((uint64_t *)wait_info->pValues)[wait_info->semaphoreCount] = value; + ++wait_info->semaphoreCount; + return 1; +} + +static int semaphore_process(struct vulkan_device *device, struct wine_semaphore *sem, + VkSemaphoreWaitInfo *wait_info, uint32_t *wait_alloc_count) +{ + /* Called from native thread. */ + struct pending_d3d12_fence_op *op, *op2; + uint64_t global_sem_wait_value; + int virtual_value_updated = 0; + uint64_t value, virtual_value; + VkResult res; + + /* Check local pending signal ops completion, update shared semaphore. */ + d3d12_semaphore_lock( sem ); + LIST_FOR_EACH_ENTRY_SAFE(op, op2, &sem->pending_signals, struct pending_d3d12_fence_op, entry) + { + if (op->virtual_value <= sem->d3d12_fence_shm->virtual_value) + goto signal_op_complete; + + res = get_semaphore_value(device, op->local_sem.sem, &value); + if (res != VK_SUCCESS) + { + fprintf(stderr, "err:winevulkan:semaphore_process vkGetSemaphoreCounterValue failed, res=%d.\n", res); + goto signal_op_complete; + } + if (value <= op->local_sem.value) + { + if (!add_sem_wait(wait_info, wait_alloc_count, op->local_sem.sem, op->local_sem.value + 1)) + { + d3d12_semaphore_unlock(sem); + return 0; + } + continue; + } + + sem->d3d12_fence_shm->virtual_value = op->virtual_value; + virtual_value_updated = 1; +signal_op_complete: + ++op->local_sem.value; + release_fence_op(device, op); + } + + if (virtual_value_updated) + signal_timeline_sem(device, sem->fence_timeline_semaphore, &sem->d3d12_fence_shm->physical_value); + global_sem_wait_value = sem->d3d12_fence_shm->physical_value + 1; + virtual_value = sem->d3d12_fence_shm->virtual_value; + d3d12_semaphore_unlock(sem); + + /* Complete satisfied local waits. */ + LIST_FOR_EACH_ENTRY_SAFE(op, op2, &sem->pending_waits, struct pending_d3d12_fence_op, entry) + { + if (op->virtual_value > virtual_value) + continue; + + signal_timeline_sem(device, op->local_sem.sem, &op->local_sem.value); + release_fence_op(device, op); + } + + /* Only poll shared semaphore if there are waits pending. */ + if (list_empty(&sem->pending_waits)) + return 1; + return add_sem_wait(wait_info, wait_alloc_count, sem->fence_timeline_semaphore, global_sem_wait_value); +} + +#define SIGNALLER_INITIAL_WAIT_COUNT 256 + +void *signaller_worker(void *arg) +{ +#ifdef HAVE_SYS_SYSCALL_H + int unix_tid = syscall( __NR_gettid ); +#else + int unix_tid = -1; +#endif + struct vulkan_device *device = arg; + struct wine_semaphore *sem; + VkSemaphoreWaitInfo wait_info = { 0 }; + uint32_t wait_alloc_count = 0; + VkResult res; + + if (debug_level) + fprintf(stderr, "[%d] msg:winevulkan:signaller_worker started.\n", unix_tid); + + wait_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO; + wait_info.flags = VK_SEMAPHORE_WAIT_ANY_BIT; + wait_alloc_count = SIGNALLER_INITIAL_WAIT_COUNT; + if (!(wait_info.pSemaphores = malloc(sizeof(*wait_info.pSemaphores) * wait_alloc_count))) + { + fprintf(stderr, "err:winevulkan:signaller_worker no memory.\n"); + return NULL; + } + if (!(wait_info.pValues = malloc(sizeof(*wait_info.pValues) * wait_alloc_count))) + { + fprintf(stderr, "err:winevulkan:signaller_worker no memory.\n"); + free((void *)wait_info.pSemaphores); + return NULL; + } + + for (;;) + { + pthread_mutex_lock(&device->signaller_mutex); + if (device->stop) + { + pthread_mutex_unlock(&device->signaller_mutex); + break; + } + wait_info.semaphoreCount = 1; + *(VkSemaphore *)wait_info.pSemaphores = device->sem_poll_update.sem; + *(uint64_t *)wait_info.pValues = device->sem_poll_update.value + 1; + LIST_FOR_EACH_ENTRY(sem, &device->sem_poll_list, struct wine_semaphore, poll_entry) + { + if (!semaphore_process(device, sem, &wait_info, &wait_alloc_count)) + { + pthread_mutex_unlock(&device->signaller_mutex); + break; + } + } + device->sem_poll_update_value = device->sem_poll_update.value; + pthread_cond_signal(&device->sem_poll_updated_cond); + pthread_mutex_unlock(&device->signaller_mutex); + while ((res = wait_semaphores(device, &wait_info, 3000000000ull)) == VK_TIMEOUT) + { + if (wait_info.semaphoreCount > 1) + fprintf(stderr, "err:winevulkan:signaller_worker wait timed out with non-empty poll list.\n"); + } + if (res != VK_SUCCESS) + { + fprintf(stderr, "err:winevulkan:signaller_worker error waiting for semaphores, vr %d.\n", res); + break; + } + } + + free((void *)wait_info.pSemaphores); + free((void *)wait_info.pValues); + if (debug_level) + fprintf(stderr, "[%d] msg:winevulkan:signaller_worker exiting.\n", unix_tid); + + return NULL; +} + +static void register_sem_poll(struct vulkan_device *device, struct wine_semaphore *semaphore) +{ + pthread_mutex_lock(&device->signaller_mutex); + if (!device->signaller_thread) + { + device->sem_poll_update.sem = create_timeline_semaphore(device); + device->sem_poll_update.value = 0; + pthread_cond_init(&device->sem_poll_updated_cond, NULL); + if (TRACE_ON(vulkan)) + debug_level = 4; + else if (WARN_ON(vulkan)) + debug_level = 3; + else if (FIXME_ON(vulkan)) + debug_level = 2; + else if (ERR_ON(vulkan)) + debug_level = 1; + else + debug_level = 0; + if (pthread_create(&device->signaller_thread, NULL, signaller_worker, device)) + ERR("Failed to create signaller_worker.\n"); + WARN("d3d12 fence used, created signaller worker.\n"); + } + assert(!semaphore->poll_entry.next); + list_add_head(&device->sem_poll_list, &semaphore->poll_entry); + signal_timeline_sem(device, device->sem_poll_update.sem, &device->sem_poll_update.value); + pthread_mutex_unlock(&device->signaller_mutex); +} + +static void update_sem_poll_wait_processed(struct vulkan_device *device) +{ + uint64_t update_value; + + signal_timeline_sem(device, device->sem_poll_update.sem, &device->sem_poll_update.value); + update_value = device->sem_poll_update.value; + while (device->sem_poll_update_value < update_value) + pthread_cond_wait(&device->sem_poll_updated_cond, &device->signaller_mutex); +} + +static void unregister_sem_poll(struct vulkan_device *device, struct wine_semaphore *semaphore) +{ + struct list *entry; + + pthread_mutex_lock(&device->signaller_mutex); + list_remove(&semaphore->poll_entry); + semaphore->poll_entry.next = semaphore->poll_entry.prev = NULL; + update_sem_poll_wait_processed(device); + pthread_mutex_unlock(&device->signaller_mutex); + + while ((entry = list_head(&semaphore->pending_waits))) + release_fence_op(device, CONTAINING_RECORD(entry, struct pending_d3d12_fence_op, entry)); + while ((entry = list_head(&semaphore->pending_signals))) + release_fence_op(device, CONTAINING_RECORD(entry, struct pending_d3d12_fence_op, entry)); +} + +static struct pending_d3d12_fence_op *get_free_fence_op(struct vulkan_device *device) +{ + struct pending_d3d12_fence_op *op; + struct list *entry; + + if ((entry = list_head(&device->free_fence_ops_list))) + { + list_remove(entry); + return CONTAINING_RECORD(entry, struct pending_d3d12_fence_op, entry); + } + + if (!(op = malloc(sizeof(*op)))) + { + ERR("No memory.\n"); + return NULL; + } + op->local_sem.sem = create_timeline_semaphore(device); + op->local_sem.value = 0; + ++device->allocated_fence_ops_count; + TRACE("Total allocated fence ops %u.\n", device->allocated_fence_ops_count); + return op; +} + +static void add_sem_wait_op(struct vulkan_device *device, struct wine_semaphore *semaphore, uint64_t virtual_value, + VkSemaphore *phys_semaphore, uint64_t *phys_wait_value) +{ + struct pending_d3d12_fence_op *op; + + pthread_mutex_lock(&device->signaller_mutex); + LIST_FOR_EACH_ENTRY(op, &semaphore->pending_waits, struct pending_d3d12_fence_op, entry) + { + if (op->virtual_value == virtual_value) + { + *phys_semaphore = op->local_sem.sem; + *phys_wait_value = op->local_sem.value + 1; + pthread_mutex_unlock(&device->signaller_mutex); + return; + } + } + if ((op = get_free_fence_op(device))) + { + op->virtual_value = virtual_value; + *phys_semaphore = op->local_sem.sem; + *phys_wait_value = op->local_sem.value + 1; + op->semaphore = semaphore; + list_add_tail(&semaphore->pending_waits, &op->entry); + vulkan_instance_remove_object(device->physical_device->instance, &semaphore->obj.obj); + vulkan_object_init(&semaphore->obj.obj, op->local_sem.sem); + vulkan_instance_insert_object(device->physical_device->instance, &semaphore->obj.obj); + + signal_timeline_sem(device, device->sem_poll_update.sem, &device->sem_poll_update.value); + TRACE("added wait op, semaphore %p, %s, temp sem %s, %s.\n", semaphore, wine_dbgstr_longlong(virtual_value), + wine_dbgstr_longlong(op->local_sem.sem), wine_dbgstr_longlong(op->local_sem.value)); + } + else + { + *phys_semaphore = 0; + *phys_wait_value = 0; + } + pthread_mutex_unlock(&device->signaller_mutex); +} + +static void add_sem_signal_op(struct vulkan_device *device, struct wine_semaphore *semaphore, uint64_t virtual_value, + VkSemaphore *phys_semaphore, uint64_t *phys_signal_value, BOOL signal_immediate) +{ + struct pending_d3d12_fence_op *op; + uint64_t value; + + pthread_mutex_lock(&device->signaller_mutex); + if ((op = get_free_fence_op(device))) + { + op->virtual_value = virtual_value; + *phys_semaphore = op->local_sem.sem; + *phys_signal_value = op->local_sem.value + 1; + op->semaphore = semaphore; + list_add_tail(&semaphore->pending_signals, &op->entry); + vulkan_instance_remove_object(device->physical_device->instance, &semaphore->obj.obj); + vulkan_object_init(&semaphore->obj.obj, op->local_sem.sem); + vulkan_instance_insert_object(device->physical_device->instance, &semaphore->obj.obj); + + if (signal_immediate) + { + value = op->local_sem.value; + signal_timeline_sem(device, op->local_sem.sem, &value); + update_sem_poll_wait_processed(device); + TRACE("signal op %p, semaphore %p, %s, temp sem %s, %s.\n", op, semaphore, wine_dbgstr_longlong(virtual_value), + wine_dbgstr_longlong(op->local_sem.sem), wine_dbgstr_longlong(op->local_sem.value)); + } + else + { + signal_timeline_sem(device, device->sem_poll_update.sem, &device->sem_poll_update.value); + TRACE("added signal op, semaphore %p, %s, temp sem %s, %s.\n", semaphore, wine_dbgstr_longlong(virtual_value), + wine_dbgstr_longlong(op->local_sem.sem), wine_dbgstr_longlong(op->local_sem.value)); + } + } + else + { + *phys_semaphore = 0; + *phys_signal_value = 0; + } + pthread_mutex_unlock(&device->signaller_mutex); +} + VkResult wine_vkCreateSemaphore(VkDevice client_device, const VkSemaphoreCreateInfo *create_info, const VkAllocationCallbacks *allocator, VkSemaphore *semaphore) { @@ -2927,6 +3352,9 @@ VkResult wine_vkCreateSemaphore(VkDevice client_device, const VkSemaphoreCreateI if (!(object = calloc(1, sizeof(*object)))) return VK_ERROR_OUT_OF_HOST_MEMORY; + list_init(&object->pending_signals); + list_init(&object->pending_waits); + object->handle = INVALID_HANDLE_VALUE; if ((export_semaphore_info = find_next_struct(&create_info_dup, VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO))) @@ -3064,6 +3492,12 @@ VkResult wine_vkCreateSemaphore(VkDevice client_device, const VkSemaphoreCreateI device->p_vkDestroySemaphore(device->host.device, object->fence_timeline_semaphore, NULL); free(object); } + else if (object->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + register_sem_poll(device, object); + if (res == VK_SUCCESS) + { + TRACE("-> %p (native %#llx, shared %#llx).\n", object, (long long)object->semaphore, (long long)object->fence_timeline_semaphore); + } return res; } @@ -3095,6 +3529,9 @@ void wine_vkDestroySemaphore(VkDevice client_device, VkSemaphore semaphore_handl if (!semaphore) return; + if (semaphore->poll_entry.next) + unregister_sem_poll(device, semaphore); + if (semaphore->handle != INVALID_HANDLE_VALUE) NtClose(semaphore->handle); @@ -3126,6 +3563,9 @@ VkResult wine_vkImportSemaphoreWin32HandleKHR(VkDevice client_device, TRACE("(%p, %p). semaphore = %p handle = %p\n", device, handle_info, semaphore, handle_info->handle); + if (semaphore->poll_entry.next) + unregister_sem_poll(device, semaphore); + if (handle_info->handleType == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT && !semaphore->fence_timeline_semaphore) { type_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; @@ -3228,6 +3668,9 @@ VkResult wine_vkImportSemaphoreWin32HandleKHR(VkDevice client_device, NtUnmapViewOfSection(GetCurrentProcess(), semaphore->d3d12_fence_shm); *semaphore = output_semaphore; + assert(!semaphore->poll_entry.next); + if (semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + register_sem_poll(device, semaphore); } else { @@ -3243,20 +3686,10 @@ VkResult wine_vkImportSemaphoreWin32HandleKHR(VkDevice client_device, return res; } -static VkResult vk_get_semaphore_counter_value(VkDevice device_handle, VkSemaphore semaphore_handle, uint64_t *value, bool khr) -{ - struct wine_semaphore *semaphore = wine_semaphore_from_handle(semaphore_handle); - struct vulkan_device *device = vulkan_device_from_handle(device_handle); - - if (khr) - return device->p_vkGetSemaphoreCounterValueKHR(device->host.device, semaphore->obj.host.semaphore, value); - else - return device->p_vkGetSemaphoreCounterValue(device->host.device, semaphore->obj.host.semaphore, value); -} - static VkResult wine_vk_get_semaphore_counter_value(VkDevice device_handle, VkSemaphore semaphore_handle, uint64_t *value, bool khr) { struct wine_semaphore *semaphore = wine_semaphore_from_handle(semaphore_handle); + struct vulkan_device *device = vulkan_device_from_handle(device_handle); if (semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) { @@ -3266,7 +3699,10 @@ static VkResult wine_vk_get_semaphore_counter_value(VkDevice device_handle, VkSe return VK_SUCCESS; } - return vk_get_semaphore_counter_value(device_handle, semaphore_handle, value, khr); + if (khr) + return device->p_vkGetSemaphoreCounterValueKHR(device->host.device, semaphore->obj.host.semaphore, value); + else + return device->p_vkGetSemaphoreCounterValue(device->host.device, semaphore->obj.host.semaphore, value); } VkResult wine_vkGetSemaphoreCounterValue(VkDevice device_handle, VkSemaphore semaphore_handle, uint64_t *value) @@ -3279,116 +3715,194 @@ VkResult wine_vkGetSemaphoreCounterValueKHR(VkDevice device_handle, VkSemaphore return wine_vk_get_semaphore_counter_value(device_handle, semaphore_handle, value, true); } -static VkResult vk_signal_semaphore(VkDevice device_handle, const VkSemaphoreSignalInfo *signal_info, bool khr) +static NTSTATUS wine_vk_signal_semaphore(VkDevice device_handle, const VkSemaphoreSignalInfo *signal_info, bool khr) { struct wine_semaphore *semaphore = wine_semaphore_from_handle(signal_info->semaphore); struct vulkan_device *device = vulkan_device_from_handle(device_handle); VkSemaphoreSignalInfo dup_signal_info = *signal_info; - dup_signal_info.semaphore = semaphore->obj.host.semaphore; + TRACE("(%p, %p)\n", device, signal_info); + + if (semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + add_sem_signal_op(device, semaphore, signal_info->value, &dup_signal_info.semaphore, &dup_signal_info.value, TRUE); + return VK_SUCCESS; + } + else + dup_signal_info.semaphore = semaphore->obj.host.semaphore; + if (khr) return device->p_vkSignalSemaphoreKHR(device->host.device, &dup_signal_info); else return device->p_vkSignalSemaphore(device->host.device, &dup_signal_info); } -static NTSTATUS wine_vk_signal_semaphore(VkDevice device, const VkSemaphoreSignalInfo *signal_info, bool khr) +VkResult wine_vkSignalSemaphore(VkDevice device_handle, const VkSemaphoreSignalInfo *signal_info) { - struct wine_semaphore *semaphore = wine_semaphore_from_handle(signal_info->semaphore); - - TRACE("(%p, %p)\n", device, signal_info); - - if (semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) - { - FIXME("Signalling D3D12-Fence compatible timeline semaphore not supported.\n"); - return VK_ERROR_OUT_OF_HOST_MEMORY; - } - - return vk_signal_semaphore(device, signal_info, khr); + return wine_vk_signal_semaphore(device_handle, signal_info, false); } -VkResult wine_vkSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo *signal_info) +VkResult wine_vkSignalSemaphoreKHR(VkDevice device_handle, const VkSemaphoreSignalInfo *signal_info) { - return wine_vk_signal_semaphore(device, signal_info, false); + return wine_vk_signal_semaphore(device_handle, signal_info, true); } -VkResult wine_vkSignalSemaphoreKHR(VkDevice device, const VkSemaphoreSignalInfo *signal_info) +static void unwrap_semaphore(struct vulkan_device *device, VkSemaphore *sem_handle, uint64_t *value, BOOL signal) { - return wine_vk_signal_semaphore(device, signal_info, true); + struct wine_semaphore *sem = wine_semaphore_from_handle(*sem_handle); + + if (!sem) + return; + + if (sem->handle_type != VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + *sem_handle = sem->obj.host.semaphore; + return; + } + if (signal) + add_sem_signal_op(device, sem, *value, sem_handle, value, FALSE); + else + add_sem_wait_op(device, sem, *value, sem_handle, value); } -static VkSemaphore *unwrap_semaphore_array(const VkSemaphore *in, uint32_t count, struct conversion_context *ctx) +static VkResult unwrap_semaphore_array(const VkSemaphore **sems, const uint64_t **values_out, + uint32_t count, struct conversion_context *ctx, BOOL signal, struct vulkan_device *device) { + const uint64_t *values = NULL; + const VkSemaphore *in; VkSemaphore *out; unsigned int i; - if (!in || !count) return NULL; + in = *sems; + *sems = NULL; + + if (!in || !count) + return VK_SUCCESS; out = conversion_context_alloc(ctx, count * sizeof(*out)); for (i = 0; i < count; ++i) - out[i] = in[i] ? wine_semaphore_from_handle(in[i])->obj.host.semaphore : VK_NULL_HANDLE; - - return out; + { + struct wine_semaphore *sem; + if (!in[i]) + { + out[i] = VK_NULL_HANDLE; + continue; + } + sem = wine_semaphore_from_handle(in[i]); + if (sem->handle_type != VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + out[i] = sem->obj.host.semaphore; + continue; + } + if (!values_out) + { + ERR("D3D12 fence without values specified.\n"); + return VK_ERROR_UNKNOWN; + } + if (!values) + { + values = *values_out; + *values_out = conversion_context_alloc(ctx, count * sizeof(*values_out)); + memcpy((void *)*values_out, values, count * sizeof(*values)); + } + if (signal) + add_sem_signal_op(device, sem, values[i], &out[i], (uint64_t *)&(*values_out)[i], FALSE); + else + add_sem_wait_op(device, sem, values[i], &out[i], (uint64_t *)&(*values_out)[i]); + } + *sems = out; + return VK_SUCCESS; } -static VkResult vk_wait_semaphores(struct vulkan_device *device, const VkSemaphoreWaitInfo *wait_info, uint64_t timeout, bool khr) +static VkResult wine_vk_wait_semaphores(VkDevice device_handle, const VkSemaphoreWaitInfo *wait_info, uint64_t timeout, bool khr) { + struct vulkan_device *device = vulkan_device_from_handle(device_handle); VkSemaphoreWaitInfo wait_info_dup = *wait_info; struct conversion_context ctx; VkResult ret; init_conversion_context(&ctx); - wait_info_dup.pSemaphores = unwrap_semaphore_array(wait_info->pSemaphores, wait_info->semaphoreCount, &ctx); + if ((ret = unwrap_semaphore_array(&wait_info_dup.pSemaphores, &wait_info_dup.pValues, + wait_info->semaphoreCount, &ctx, FALSE, device))) + goto done; + if (khr) ret = device->p_vkWaitSemaphoresKHR(device->host.device, &wait_info_dup, timeout); else ret = device->p_vkWaitSemaphores(device->host.device, &wait_info_dup, timeout); +done: free_conversion_context(&ctx); return ret; } -static VkResult wine_vk_wait_semaphores(VkDevice device_handle, const VkSemaphoreWaitInfo *wait_info, uint64_t timeout, bool khr) -{ - unsigned int i; - - TRACE("(%p, %p, 0x%s)\n", device_handle, wait_info, wine_dbgstr_longlong(timeout)); - - for (i = 0; i < wait_info->semaphoreCount; i++) - { - struct wine_semaphore *semaphore = wine_semaphore_from_handle(wait_info->pSemaphores[i]); - - if (semaphore->handle_type == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) - { - FIXME("Waiting on D3D12-Fence compatible timeline semaphores not supported."); - return VK_ERROR_OUT_OF_HOST_MEMORY; - } - } - return vk_wait_semaphores(vulkan_device_from_handle(device_handle), wait_info, timeout, khr); -} - VkResult wine_vkWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo *wait_info, uint64_t timeout) { + TRACE("%p %p %s.\n", device, wait_info, wine_dbgstr_longlong(timeout)); + return wine_vk_wait_semaphores(device, wait_info, timeout, false); } VkResult wine_vkWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfo *wait_info, uint64_t timeout) { + TRACE("%p %p %s.\n", device, wait_info, wine_dbgstr_longlong(timeout)); + return wine_vk_wait_semaphores(device, wait_info, timeout, true); } -VkResult vk_queue_submit_unwrap(struct vulkan_queue *queue, uint32_t submit_count, const VkSubmitInfo *submits_orig, VkFence fence) +struct struct_chain_def +{ + VkStructureType sType; + unsigned int size; +}; + +VkResult wine_vkQueueSubmit(VkQueue queue_handle, uint32_t submit_count, const VkSubmitInfo *submits_orig, VkFence fence, + void *submits_win_ptr) { + struct vulkan_queue *queue = vulkan_queue_from_handle(queue_handle); + struct vulkan_device *device = queue->device; + VkTimelineSemaphoreSubmitInfo *timeline_submit_info; + const VkSubmitInfo *submits_win = submits_win_ptr; + VkD3D12FenceSubmitInfoKHR *d3d12_submit_info; + const uint64_t **values; struct conversion_context ctx; VkSubmitInfo *submits; unsigned int i, j; VkResult ret; + TRACE("(%p %u %p 0x%s)\n", queue_handle, submit_count, submits_orig, wine_dbgstr_longlong(fence)); + init_conversion_context(&ctx); MEMDUP(&ctx, submits, submits_orig, submit_count); for (i = 0; i < submit_count; ++i) { - submits[i].pWaitSemaphores = unwrap_semaphore_array(submits[i].pWaitSemaphores, submits[i].waitSemaphoreCount, &ctx); - submits[i].pSignalSemaphores = unwrap_semaphore_array(submits[i].pSignalSemaphores, submits[i].signalSemaphoreCount, &ctx); + timeline_submit_info = find_next_struct(&submits[i], VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO); + d3d12_submit_info = find_next_struct(&submits_win[i], VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR); + if (d3d12_submit_info && timeline_submit_info) + WARN("Both TIMELINE_SEMAPHORE_SUBMIT_INFO and D3D12_FENCE_SUBMIT_INFO_KHR specified.\n"); + if (d3d12_submit_info && !timeline_submit_info) + { + timeline_submit_info = conversion_context_alloc(&ctx, sizeof(*timeline_submit_info)); + timeline_submit_info->sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO; + timeline_submit_info->pNext = submits[i].pNext; + timeline_submit_info->waitSemaphoreValueCount = d3d12_submit_info->waitSemaphoreValuesCount; + MEMDUP(&ctx, timeline_submit_info->pWaitSemaphoreValues, d3d12_submit_info->pWaitSemaphoreValues, d3d12_submit_info->waitSemaphoreValuesCount); + timeline_submit_info->signalSemaphoreValueCount = d3d12_submit_info->signalSemaphoreValuesCount; + MEMDUP(&ctx, timeline_submit_info->pSignalSemaphoreValues, d3d12_submit_info->pSignalSemaphoreValues, d3d12_submit_info->signalSemaphoreValuesCount); + submits[i].pNext = timeline_submit_info; + } + + if (timeline_submit_info) + values = &timeline_submit_info->pWaitSemaphoreValues; + else + values = NULL; + unwrap_semaphore_array(&submits[i].pWaitSemaphores, values, submits[i].waitSemaphoreCount, &ctx, FALSE, device); + + if (timeline_submit_info) + values = &timeline_submit_info->pSignalSemaphoreValues; + else + values = NULL; + unwrap_semaphore_array(&submits[i].pSignalSemaphores, values, submits[i].signalSemaphoreCount, &ctx, TRUE, device); + if (submits[i].pCommandBuffers && submits[i].commandBufferCount) { VkCommandBuffer *out; @@ -3404,38 +3918,6 @@ VkResult vk_queue_submit_unwrap(struct vulkan_queue *queue, uint32_t submit_coun return ret; } -VkResult wine_vkQueueSubmit(VkQueue queue_handle, uint32_t submit_count, const VkSubmitInfo *submits, VkFence fence, void *submits_win_ptr) -{ - struct vulkan_queue *queue = vulkan_queue_from_handle(queue_handle); - unsigned int i, k; - - TRACE("(%p %u %p 0x%s)\n", queue_handle, submit_count, submits, wine_dbgstr_longlong(fence)); - - for (i = 0; i < submit_count; i++) - { - for (k = 0; k < submits[i].waitSemaphoreCount; k++) - { - if (wine_semaphore_from_handle(submits[i].pWaitSemaphores[k])->handle_type == - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) - { - FIXME("Queue submissions with waits on D3D12-Fence compatible timeline semaphores not supported.\n"); - return VK_ERROR_OUT_OF_HOST_MEMORY; - } - } - - for (k = 0; k < submits[i].signalSemaphoreCount; k++) - { - if (wine_semaphore_from_handle(submits[i].pSignalSemaphores[k])->handle_type == - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) - { - FIXME("Queue submissions with signalling D3D12-Fence compatible timeline semaphores not supported.\n"); - return VK_ERROR_OUT_OF_HOST_MEMORY; - } - } - } - return vk_queue_submit_unwrap(queue, submit_count, submits, fence); -} - static void duplicate_array_for_unwrapping(struct conversion_context *ctx, void **ptr, unsigned int size) { void *out; @@ -3448,14 +3930,16 @@ static void duplicate_array_for_unwrapping(struct conversion_context *ctx, void *ptr = out; } -VkResult vk_queue_submit_2_unwrap(struct vulkan_queue *queue, uint32_t submit_count, const VkSubmitInfo2 *submits_orig, - VkFence fence, bool khr) +static VkResult vk_queue_submit_2(VkQueue queue_handle, uint32_t submit_count, const VkSubmitInfo2 *submits_orig, VkFence fence, bool khr) { + struct vulkan_queue *queue = vulkan_queue_from_handle(queue_handle); struct conversion_context ctx; VkSubmitInfo2 *submits; unsigned int i, j; VkResult ret; + TRACE("(%p, %u, %p, %s)\n", queue_handle, submit_count, submits_orig, wine_dbgstr_longlong(fence)); + init_conversion_context(&ctx); MEMDUP(&ctx, submits, submits_orig, submit_count); for (i = 0; i < submit_count; ++i) @@ -3463,16 +3947,14 @@ VkResult vk_queue_submit_2_unwrap(struct vulkan_queue *queue, uint32_t submit_co duplicate_array_for_unwrapping(&ctx, (void **)&submits[i].pWaitSemaphoreInfos, submits[i].waitSemaphoreInfoCount * sizeof(*submits[i].pWaitSemaphoreInfos)); for (j = 0; j < submits[i].waitSemaphoreInfoCount; ++j) - if (submits[i].pWaitSemaphoreInfos[j].semaphore) - ((VkSemaphoreSubmitInfo *)submits[i].pWaitSemaphoreInfos)[j].semaphore - = wine_semaphore_from_handle(submits[i].pWaitSemaphoreInfos[j].semaphore)->obj.host.semaphore; + unwrap_semaphore(queue->device, &((VkSemaphoreSubmitInfo *)submits[i].pWaitSemaphoreInfos)[j].semaphore, + &((VkSemaphoreSubmitInfo *)submits[i].pWaitSemaphoreInfos)[j].value, FALSE); duplicate_array_for_unwrapping(&ctx, (void **)&submits[i].pSignalSemaphoreInfos, submits[i].signalSemaphoreInfoCount * sizeof(*submits[i].pSignalSemaphoreInfos)); for (j = 0; j < submits[i].signalSemaphoreInfoCount; ++j) - if (submits[i].pSignalSemaphoreInfos[j].semaphore) - ((VkSemaphoreSubmitInfo *)submits[i].pSignalSemaphoreInfos)[j].semaphore - = wine_semaphore_from_handle(submits[i].pSignalSemaphoreInfos[j].semaphore)->obj.host.semaphore; + unwrap_semaphore(queue->device, &((VkSemaphoreSubmitInfo *)submits[i].pSignalSemaphoreInfos)[j].semaphore, + &((VkSemaphoreSubmitInfo *)submits[i].pSignalSemaphoreInfos)[j].value, TRUE); if (submits[i].pCommandBufferInfos && submits[i].commandBufferInfoCount) { @@ -3483,6 +3965,7 @@ VkResult vk_queue_submit_2_unwrap(struct vulkan_queue *queue, uint32_t submit_co = wine_cmd_buffer_from_handle(submits[i].pCommandBufferInfos[j].commandBuffer)->host.command_buffer; } } + if (khr) ret = queue->device->p_vkQueueSubmit2KHR(queue->host.queue, submit_count, submits, fence); else @@ -3491,39 +3974,6 @@ VkResult vk_queue_submit_2_unwrap(struct vulkan_queue *queue, uint32_t submit_co return ret; } -static VkResult vk_queue_submit_2(VkQueue queue_handle, uint32_t submit_count, const VkSubmitInfo2 *submits, VkFence fence, bool khr) -{ - struct vulkan_queue *queue = vulkan_queue_from_handle(queue_handle); - unsigned int i, k; - - TRACE("(%p, %u, %p, %s)\n", queue_handle, submit_count, submits, wine_dbgstr_longlong(fence)); - - for (i = 0; i < submit_count; i++) - { - for (k = 0; k < submits[i].waitSemaphoreInfoCount; k++) - { - if (wine_semaphore_from_handle(submits[i].pWaitSemaphoreInfos[k].semaphore)->handle_type == - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) - { - FIXME("Queue submissions with waits on D3D12-Fence compatible timeline semaphores not supported.\n"); - return VK_ERROR_OUT_OF_HOST_MEMORY; - } - } - - for (k = 0; k < submits[i].signalSemaphoreInfoCount; k++) - { - if (wine_semaphore_from_handle(submits[i].pSignalSemaphoreInfos[k].semaphore)->handle_type == - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) - { - FIXME("Queue submissions signalling D3D12-Fence compatible timeline semaphores not supported.\n"); - return VK_ERROR_OUT_OF_HOST_MEMORY; - } - } - } - - return vk_queue_submit_2_unwrap(queue, submit_count, submits, fence, khr); -} - VkResult wine_vkQueueSubmit2(VkQueue queue, uint32_t submit_count, const VkSubmitInfo2 *submits, VkFence fence) { return vk_queue_submit_2(queue, submit_count, submits, fence, false); @@ -3576,8 +4026,8 @@ VkResult wine_vkQueueBindSparse(VkQueue queue_handle, uint32_t bind_info_count, for (i = 0; i < bind_info_count; ++i) { batch = (VkBindSparseInfo *)&bind_info[i]; - batch->pWaitSemaphores = unwrap_semaphore_array(batch->pWaitSemaphores, batch->waitSemaphoreCount, &ctx); - batch->pSignalSemaphores = unwrap_semaphore_array(batch->pSignalSemaphores, batch->signalSemaphoreCount, &ctx); + unwrap_semaphore_array(&batch->pWaitSemaphores, NULL, batch->waitSemaphoreCount, &ctx, FALSE, queue->device); + unwrap_semaphore_array(&batch->pSignalSemaphores, NULL, batch->signalSemaphoreCount, &ctx, TRUE, queue->device); duplicate_array_for_unwrapping(&ctx, (void **)&batch->pBufferBinds, batch->bufferBindCount * sizeof(*batch->pBufferBinds)); for (j = 0; j < batch->bufferBindCount; ++j) diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index c36c52ec327b..6d0f5c7ccb56 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -21,6 +21,7 @@ #define __WINE_VULKAN_PRIVATE_H #include +#include #include "vulkan_loader.h" #include "vulkan_thunks.h" @@ -41,6 +42,19 @@ static inline struct wine_cmd_buffer *wine_cmd_buffer_from_handle(VkCommandBuffe return (struct wine_cmd_buffer *)(UINT_PTR)client->unix_handle; } +struct wine_semaphore; + +struct pending_d3d12_fence_op +{ + /* Vulkan native local semaphore. */ + struct local_timeline_semaphore local_sem; + + /* Operation values. */ + struct list entry; + uint64_t virtual_value; + struct wine_semaphore *semaphore; +}; + struct wine_debug_utils_messenger; struct wine_debug_report_callback @@ -174,18 +188,23 @@ struct wine_semaphore { struct vulkan_semaphore obj; VkSemaphore semaphore; - VkSemaphore fence_timeline_semaphore; VkExternalSemaphoreHandleTypeFlagBits export_types; /* mutable members */ VkExternalSemaphoreHandleTypeFlagBits handle_type; + struct list poll_entry; + struct list pending_waits; + struct list pending_signals; HANDLE handle; struct { + /* Shared mem access mutex. The non-shared parts access is guarded with device global signaller_mutex. */ pthread_mutex_t mutex; - uint64_t virtual_value; + uint64_t virtual_value, physical_value; } *d3d12_fence_shm; + /* The Vulkan shared semaphore is only waited or signaled in signaller_worker(). */ + VkSemaphore fence_timeline_semaphore; }; static inline void *conversion_context_alloc(struct conversion_context *pool, size_t size) diff --git a/include/wine/vulkan_driver.h b/include/wine/vulkan_driver.h index fe989bbf8099..3bb0c81cc00a 100644 --- a/include/wine/vulkan_driver.h +++ b/include/wine/vulkan_driver.h @@ -48,6 +48,7 @@ struct vulkan_client_object #include "wine/vulkan.h" #include "wine/rbtree.h" +#include "wine/list.h" /* Wine internal vulkan driver version, needs to be bumped upon vulkan_funcs changes. */ #define WINE_VULKAN_DRIVER_VERSION 35 @@ -104,6 +105,12 @@ static inline struct vulkan_physical_device *vulkan_physical_device_from_handle( return (struct vulkan_physical_device *)(UINT_PTR)client->unix_handle; } +struct local_timeline_semaphore +{ + VkSemaphore sem; + uint64_t value; +}; + struct vulkan_device { VULKAN_OBJECT_HEADER( VkDevice, device ); @@ -114,6 +121,16 @@ struct vulkan_device uint64_t queue_count; struct vulkan_queue *queues; VkQueueFamilyProperties *queue_props; + + pthread_t signaller_thread; + pthread_mutex_t signaller_mutex; + BOOL stop; + struct list free_fence_ops_list; + struct list sem_poll_list; + struct local_timeline_semaphore sem_poll_update; + pthread_cond_t sem_poll_updated_cond; + uint64_t sem_poll_update_value; /* set to sem_poll_update.value by signaller thread once update is processed. */ + unsigned int allocated_fence_ops_count; }; static inline struct vulkan_device *vulkan_device_from_handle( VkDevice handle ) From ee80d1767ac742422c8d271c4d0846db6ed7a868 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 7 Aug 2023 17:49:30 -0600 Subject: [PATCH 0887/2542] winevulkan: Support resetting shared fence value. CW-Bug-Id: #22526 --- dlls/winevulkan/vulkan.c | 54 ++++++++++++++++++++++++++------ dlls/winevulkan/vulkan_private.h | 10 ++++++ 2 files changed, 55 insertions(+), 9 deletions(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 974c1f98d6de..7f85e9d9608c 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -209,8 +209,8 @@ static void signal_timeline_sem(struct vulkan_device *device, VkSemaphore sem, u info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO; info.semaphore = sem; - ++*value; - info.value = *value; + info.value = *value + 1; + __atomic_store_n(value, info.value, __ATOMIC_RELEASE); if (device->physical_device->api_version < VK_API_VERSION_1_2 || device->physical_device->instance->api_version < VK_API_VERSION_1_2) res = device->p_vkSignalSemaphoreKHR(device->host.device, &info); else @@ -3040,14 +3040,13 @@ static int semaphore_process(struct vulkan_device *device, struct wine_semaphore int virtual_value_updated = 0; uint64_t value, virtual_value; VkResult res; + uint32_t i; /* Check local pending signal ops completion, update shared semaphore. */ d3d12_semaphore_lock( sem ); + virtual_value = sem->d3d12_fence_shm->virtual_value; LIST_FOR_EACH_ENTRY_SAFE(op, op2, &sem->pending_signals, struct pending_d3d12_fence_op, entry) { - if (op->virtual_value <= sem->d3d12_fence_shm->virtual_value) - goto signal_op_complete; - res = get_semaphore_value(device, op->local_sem.sem, &value); if (res != VK_SUCCESS) { @@ -3064,28 +3063,64 @@ static int semaphore_process(struct vulkan_device *device, struct wine_semaphore continue; } + virtual_value = max( sem->d3d12_fence_shm->virtual_value, op->virtual_value ); sem->d3d12_fence_shm->virtual_value = op->virtual_value; virtual_value_updated = 1; signal_op_complete: - ++op->local_sem.value; + op->local_sem.value = value; release_fence_op(device, op); } + if (sem->d3d12_fence_shm->virtual_value < virtual_value) + { + uint32_t idx = sem->d3d12_fence_shm->reset_backlog_count; + + if (debug_level >= 3) + fprintf(stderr, "warn:winevulkan:semaphore_process resetting semaphore %p virtual value.\n", sem); + if (idx == ARRAY_SIZE(sem->d3d12_fence_shm->reset_backlog)) + { + sem->d3d12_fence_shm->last_dropped_reset_physical = sem->d3d12_fence_shm->reset_backlog[0].physical_at_reset; + --idx; + memmove(&sem->d3d12_fence_shm->reset_backlog[0], &sem->d3d12_fence_shm->reset_backlog[1], + sizeof(*sem->d3d12_fence_shm->reset_backlog) * sem->d3d12_fence_shm->reset_backlog_count); + } + else + { + ++sem->d3d12_fence_shm->reset_backlog_count; + } + sem->d3d12_fence_shm->last_reset_physical = sem->d3d12_fence_shm->physical_value + 1; + sem->d3d12_fence_shm->reset_backlog[idx].physical_at_reset = sem->d3d12_fence_shm->last_reset_physical; + sem->d3d12_fence_shm->reset_backlog[idx].virtual_before_reset = virtual_value; + } if (virtual_value_updated) signal_timeline_sem(device, sem->fence_timeline_semaphore, &sem->d3d12_fence_shm->physical_value); global_sem_wait_value = sem->d3d12_fence_shm->physical_value + 1; - virtual_value = sem->d3d12_fence_shm->virtual_value; - d3d12_semaphore_unlock(sem); /* Complete satisfied local waits. */ LIST_FOR_EACH_ENTRY_SAFE(op, op2, &sem->pending_waits, struct pending_d3d12_fence_op, entry) { if (op->virtual_value > virtual_value) - continue; + { + if (op->shared_physical_value > sem->d3d12_fence_shm->last_reset_physical) + continue; + for (i = 0; i < sem->d3d12_fence_shm->reset_backlog_count; ++i) + { + if (sem->d3d12_fence_shm->reset_backlog[i].physical_at_reset >= op->shared_physical_value + && sem->d3d12_fence_shm->reset_backlog[i].virtual_before_reset >= op->virtual_value) + break; + } + if (i == sem->d3d12_fence_shm->reset_backlog_count) + { + if (sem->d3d12_fence_shm->last_dropped_reset_physical < op->shared_physical_value) + continue; + fprintf(stderr, "err:winevulkan:semaphore_process wait needs reset backlog beyond cut off.\n"); + } + } signal_timeline_sem(device, op->local_sem.sem, &op->local_sem.value); release_fence_op(device, op); } + d3d12_semaphore_unlock(sem); /* Only poll shared semaphore if there are waits pending. */ if (list_empty(&sem->pending_waits)) @@ -3264,6 +3299,7 @@ static void add_sem_wait_op(struct vulkan_device *device, struct wine_semaphore if ((op = get_free_fence_op(device))) { op->virtual_value = virtual_value; + op->shared_physical_value = __atomic_load_n(&semaphore->d3d12_fence_shm->physical_value, __ATOMIC_ACQUIRE) + 1; *phys_semaphore = op->local_sem.sem; *phys_wait_value = op->local_sem.value + 1; op->semaphore = semaphore; diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index 6d0f5c7ccb56..1acd7c5a1297 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -52,6 +52,7 @@ struct pending_d3d12_fence_op /* Operation values. */ struct list entry; uint64_t virtual_value; + uint64_t shared_physical_value; struct wine_semaphore *semaphore; }; @@ -202,6 +203,15 @@ struct wine_semaphore /* Shared mem access mutex. The non-shared parts access is guarded with device global signaller_mutex. */ pthread_mutex_t mutex; uint64_t virtual_value, physical_value; + uint64_t last_reset_physical; + uint64_t last_dropped_reset_physical; + struct + { + uint64_t physical_at_reset; + uint64_t virtual_before_reset; + } + reset_backlog[16]; + uint32_t reset_backlog_count; } *d3d12_fence_shm; /* The Vulkan shared semaphore is only waited or signaled in signaller_worker(). */ VkSemaphore fence_timeline_semaphore; From 8010fca5898d4b9bde97cebdcd990d99c6d4d3ed Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 4 Aug 2023 13:14:43 -0600 Subject: [PATCH 0888/2542] winevulkan: Also remap Win32 functions in vk_is_available_instance_function(). CW-Bug-Id: #22526 --- dlls/winevulkan/vulkan.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 7f85e9d9608c..e8bb97dd03ea 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -2816,12 +2816,23 @@ void wine_vkDestroyDeferredOperationKHR(VkDevice device_handle, free(object); } +static void substitute_function_name(const char **name) +{ + if (!strcmp(*name, "vkGetMemoryWin32HandleKHR") || !strcmp(*name, "vkGetMemoryWin32HandlePropertiesKHR")) + *name = "vkGetMemoryFdKHR"; + else if (!strcmp(*name, "vkGetSemaphoreWin32HandleKHR")) + *name = "vkGetSemaphoreFdKHR"; + else if (!strcmp(*name, "vkImportSemaphoreWin32HandleKHR")) + *name = "vkImportSemaphoreFdKHR"; +} + #ifdef _WIN64 NTSTATUS vk_is_available_instance_function(void *arg) { struct is_available_instance_function_params *params = arg; struct wine_instance *instance = wine_instance_from_handle(params->instance); + substitute_function_name(¶ms->name); if (!strcmp(params->name, "vkCreateWin32SurfaceKHR")) return instance->enable_win32_surface; @@ -2835,12 +2846,7 @@ NTSTATUS vk_is_available_device_function(void *arg) { struct is_available_device_function_params *params = arg; struct vulkan_device *device = vulkan_device_from_handle(params->device); - if (!strcmp(params->name, "vkGetMemoryWin32HandleKHR") || !strcmp(params->name, "vkGetMemoryWin32HandlePropertiesKHR")) - params->name = "vkGetMemoryFdKHR"; - else if (!strcmp(params->name, "vkGetSemaphoreWin32HandleKHR")) - params->name = "vkGetSemaphoreFdKHR"; - else if (!strcmp(params->name, "vkImportSemaphoreWin32HandleKHR")) - params->name = "vkImportSemaphoreFdKHR"; + substitute_function_name(¶ms->name); return !!vk_funcs->p_vkGetDeviceProcAddr(device->host.device, params->name); } @@ -2854,13 +2860,15 @@ NTSTATUS vk_is_available_instance_function32(void *arg) UINT32 name; } *params = arg; struct wine_instance *instance = wine_instance_from_handle(UlongToPtr(params->instance)); + const char *name = UlongToPtr(params->name); if (!strcmp(UlongToPtr(params->name), "vkCreateWin32SurfaceKHR")) return instance->enable_win32_surface; if (!strcmp(UlongToPtr(params->name), "vkGetPhysicalDeviceWin32PresentationSupportKHR")) return instance->enable_win32_surface; - return !!vk_funcs->p_vkGetInstanceProcAddr(instance->obj.host.instance, UlongToPtr(params->name)); + substitute_function_name(&name); + return !!vk_funcs->p_vkGetInstanceProcAddr(instance->obj.host.instance, name); } NTSTATUS vk_is_available_device_function32(void *arg) @@ -2871,14 +2879,9 @@ NTSTATUS vk_is_available_device_function32(void *arg) UINT32 name; } *params = arg; struct vulkan_device *device = vulkan_device_from_handle(UlongToPtr(params->device)); - char *name = UlongToPtr(params->name); - if (!strcmp(name, "vkGetMemoryWin32HandleKHR") || !strcmp(name, "vkGetMemoryWin32HandlePropertiesKHR")) - return !!vk_funcs->p_vkGetDeviceProcAddr(device->host.device, "vkGetMemoryFdKHR"); - if (!strcmp(name, "vkGetSemaphoreWin32HandleKHR")) - return !!vk_funcs->p_vkGetDeviceProcAddr(device->host.device, "vkGetSemaphoreFdKHR"); - if (!strcmp(name, "vkImportSemaphoreWin32HandleKHR")) - return !!vk_funcs->p_vkGetDeviceProcAddr(device->host.device, "vkImportSemaphoreFdKHR"); - return !!vk_funcs->p_vkGetDeviceProcAddr(device->host.device, UlongToPtr(params->name)); + const char *name = UlongToPtr(params->name); + substitute_function_name(&name); + return !!vk_funcs->p_vkGetDeviceProcAddr(device->host.device, name); } VkResult wine_vkGetMemoryWin32HandleKHR(VkDevice device, const VkMemoryGetWin32HandleInfoKHR *handle_info, HANDLE *handle) From 5862f278d2c7a59c0b6c491cbd97e79fe2449a1d Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 4 Aug 2023 14:30:26 -0600 Subject: [PATCH 0889/2542] winevulkan: Expose VK_KHR_win32_keyed_mutex extension. CW-Bug-Id: #22372 --- dlls/winevulkan/make_vulkan | 5 ++--- dlls/winevulkan/vulkan.c | 25 +++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index a1e26f012944..13fdf2db0dfa 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -101,7 +101,6 @@ UNSUPPORTED_EXTENSIONS = [ # Relates to external_semaphore and needs type conversions in bitflags. "VK_KHR_maintenance7", # Causes infinity recursion in struct convert code "VK_KHR_shared_presentable_image", # Needs WSI work. - "VK_KHR_win32_keyed_mutex", "VK_NV_external_memory_rdma", # Needs shared resources work. # Extensions for other platforms @@ -335,8 +334,8 @@ STRUCT_CHAIN_CONVERSIONS = { "VkPhysicalDeviceImageFormatInfo2": [], "VkPhysicalDeviceExternalSemaphoreInfo": [], "VkSemaphoreCreateInfo": [], - "VkSubmitInfo": ["VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR"], - "VkSubmitInfo2": [], + "VkSubmitInfo": ["VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR", "VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR"], + "VkSubmitInfo2": ["VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR"], "VkBindSparseInfo" : [], } diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index e8bb97dd03ea..181ce81f0f0f 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -404,7 +404,7 @@ static VkResult wine_vk_physical_device_init(struct wine_phys_dev *object, VkPhy uint32_t num_host_properties, num_properties = 0; VkExtensionProperties *host_properties = NULL; VkPhysicalDeviceProperties physdev_properties; - BOOL have_external_memory_host = FALSE; + BOOL have_external_memory_host = FALSE, have_external_memory_fd = FALSE, have_external_semaphore_fd = FALSE; VkResult res; unsigned int i, j; @@ -451,6 +451,7 @@ static VkResult wine_vk_physical_device_init(struct wine_phys_dev *object, VkPhy snprintf(host_properties[i].extensionName, sizeof(host_properties[i].extensionName), VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME); host_properties[i].specVersion = VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION; + have_external_memory_fd = TRUE; } if (!strcmp(host_properties[i].extensionName, "VK_KHR_external_semaphore_fd")) { @@ -459,6 +460,7 @@ static VkResult wine_vk_physical_device_init(struct wine_phys_dev *object, VkPhy snprintf(host_properties[i].extensionName, sizeof(host_properties[i].extensionName), VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME); host_properties[i].specVersion = VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION; + have_external_semaphore_fd = TRUE; } if (wine_vk_device_extension_supported(host_properties[i].extensionName)) @@ -478,7 +480,8 @@ static VkResult wine_vk_physical_device_init(struct wine_phys_dev *object, VkPhy have_map_memory2 = TRUE; } - TRACE("Host supported extensions %u, Wine supported extensions %u\n", num_host_properties, num_properties); + if (have_external_memory_fd && have_external_semaphore_fd) + ++num_properties; /* VK_KHR_win32_keyed_mutex */ if (!(object->extensions = calloc(num_properties, sizeof(*object->extensions)))) { @@ -494,7 +497,15 @@ static VkResult wine_vk_physical_device_init(struct wine_phys_dev *object, VkPhy j++; } } + if (have_external_memory_fd && have_external_semaphore_fd) + { + strcpy(object->extensions[j].extensionName, VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME); + object->extensions[j].specVersion = VK_KHR_WIN32_KEYED_MUTEX_SPEC_VERSION; + TRACE("Enabling extension '%s' for physical device %p\n", object->extensions[j].extensionName, object); + ++j; + } object->extension_count = num_properties; + TRACE("Host supported extensions %u, Wine supported extensions %u\n", num_host_properties, num_properties); if (zero_bits && have_memory_placed && have_map_memory2) { @@ -717,6 +728,16 @@ static VkResult wine_vk_device_convert_create_info(VkPhysicalDevice client_physi remove_extensions[remove_count++] = "VK_KHR_external_semaphore_win32"; } + if (find_extension(extensions, extensions_count, "VK_KHR_win32_keyed_mutex")) + { + if (!find_extension(extensions, extensions_count, "VK_KHR_external_memory_win32")) + extra_extensions[extra_count++] = "VK_KHR_external_memory_fd"; + if (!find_extension(extensions, extensions_count, "VK_KHR_external_semaphore_win32")) + extra_extensions[extra_count++] = "VK_KHR_external_semaphore_fd"; + remove_extensions[remove_count++] = "VK_KHR_win32_keyed_mutex"; + } + + if ((phys_dev->obj.api_version < VK_API_VERSION_1_2 || phys_dev->obj.instance->api_version < VK_API_VERSION_1_2) && !find_extension(extensions, extensions_count, "VK_KHR_timeline_semaphore")) extra_extensions[extra_count++] = "VK_KHR_timeline_semaphore"; From e357f58dd809d534b6bcca59ca53615a04061dd4 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 4 Aug 2023 17:52:14 -0600 Subject: [PATCH 0890/2542] winevulkan: Implement vkGetMemoryWin32HandlePropertiesKHR(). CW-Bug-Id: #22372 --- dlls/winevulkan/vulkan.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 181ce81f0f0f..89985f083717 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -2939,13 +2939,26 @@ VkResult wine_vkGetMemoryWin32HandleKHR(VkDevice device, const VkMemoryGetWin32H } } -VkResult wine_vkGetMemoryWin32HandlePropertiesKHR(VkDevice device, VkExternalMemoryHandleTypeFlagBits type, HANDLE handle, VkMemoryWin32HandlePropertiesKHR *properties) +VkResult wine_vkGetMemoryWin32HandlePropertiesKHR(VkDevice device_handle, VkExternalMemoryHandleTypeFlagBits type, HANDLE handle, VkMemoryWin32HandlePropertiesKHR *properties) { + struct vulkan_device *device = vulkan_device_from_handle(device_handle); + struct wine_phys_dev *physical_device = CONTAINING_RECORD(device->physical_device, struct wine_phys_dev, obj); + unsigned int i; + TRACE("%p %u %p %p\n", device, type, handle, properties); - /* VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-00666 - handleType must not be one of the handle types defined as opaque */ - return VK_ERROR_INVALID_EXTERNAL_HANDLE; + if (!(type & wine_vk_handle_over_fd_types)) + { + FIXME("type %#x.\n", type); + return VK_ERROR_INVALID_EXTERNAL_HANDLE; + } + + properties->memoryTypeBits = 0; + for (i = 0; i < physical_device->memory_properties.memoryTypeCount; ++i) + if (physical_device->memory_properties.memoryTypes[i].propertyFlags == VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) + properties->memoryTypeBits |= 1u << i; + + return VK_SUCCESS; } #define IOCTL_SHARED_GPU_RESOURCE_SET_OBJECT CTL_CODE(FILE_DEVICE_VIDEO, 6, METHOD_BUFFERED, FILE_WRITE_ACCESS) From 1ecb8ea9c4d8812431aa17c4f710c2f49bc71f3f Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 4 Aug 2023 19:13:05 -0600 Subject: [PATCH 0891/2542] winevulkan: Use resource allocated size when importing shared textures. CW-Bug-Id: #22372 --- dlls/sharedgpures.sys/shared_resource.c | 28 +++++++++++++ dlls/winevulkan/vulkan.c | 54 +++++++++++++++++++++++-- 2 files changed, 78 insertions(+), 4 deletions(-) diff --git a/dlls/sharedgpures.sys/shared_resource.c b/dlls/sharedgpures.sys/shared_resource.c index c6ab013ea0d9..ad836662af05 100644 --- a/dlls/sharedgpures.sys/shared_resource.c +++ b/dlls/sharedgpures.sys/shared_resource.c @@ -27,6 +27,7 @@ struct shared_resource SIZE_T metadata_size; void **object_pool; unsigned int object_pool_count; + UINT64 resource_size; }; static struct shared_resource *resource_pool; @@ -72,6 +73,7 @@ static void *reference_client_handle(obj_handle_t handle) struct shared_resource_create { + UINT64 resource_size; obj_handle_t unix_handle; WCHAR name[1]; }; @@ -125,6 +127,7 @@ static NTSTATUS shared_resource_create(struct shared_resource **res, void *buff, (*res)->ref_count = 1; (*res)->unix_resource = unix_resource; (*res)->name = name; + (*res)->resource_size = input->resource_size; iosb->Information = 0; return STATUS_SUCCESS; @@ -138,6 +141,11 @@ struct shared_resource_open WCHAR name[1]; }; +struct shared_resource_info +{ + UINT64 resource_size; +}; + static unsigned int kmt_to_index(obj_handle_t kmt) { if (!(kmt & 0x40000000) || (kmt - 2) % 4) @@ -340,6 +348,20 @@ static NTSTATUS shared_resource_get_object(struct shared_resource *res, void *bu return STATUS_SUCCESS; } +#define IOCTL_SHARED_GPU_RESOURCE_GET_INFO CTL_CODE(FILE_DEVICE_VIDEO, 7, METHOD_BUFFERED, FILE_READ_ACCESS) +static NTSTATUS shared_resource_get_info(struct shared_resource *res, void *buff, SIZE_T outsize, IO_STATUS_BLOCK *iosb) +{ + struct shared_resource_info *info = buff; + + if (sizeof(*info) > outsize) + return STATUS_BUFFER_TOO_SMALL; + + info->resource_size = res->resource_size; + iosb->Information = sizeof(*info); + return STATUS_SUCCESS; +} + + static NTSTATUS WINAPI dispatch_create(DEVICE_OBJECT *device, IRP *irp) { irp->IoStatus.u.Status = STATUS_SUCCESS; @@ -452,6 +474,12 @@ static NTSTATUS WINAPI dispatch_ioctl(DEVICE_OBJECT *device, IRP *irp) stack->Parameters.DeviceIoControl.OutputBufferLength, &irp->IoStatus); break; + case IOCTL_SHARED_GPU_RESOURCE_GET_INFO: + status = shared_resource_get_info( res, + irp->AssociatedIrp.SystemBuffer, + stack->Parameters.DeviceIoControl.OutputBufferLength, + &irp->IoStatus ); + break; default: FIXME( "ioctl %#lx not supported\n", stack->Parameters.DeviceIoControl.IoControlCode ); status = STATUS_NOT_SUPPORTED; diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 89985f083717..cafb8d151399 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -2101,11 +2101,12 @@ void wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice cli struct shared_resource_create { + UINT64 resource_size; obj_handle_t unix_handle; WCHAR name[1]; }; -static HANDLE create_gpu_resource(int fd, LPCWSTR name) +static HANDLE create_gpu_resource(int fd, LPCWSTR name, UINT64 resource_size) { static const WCHAR shared_gpu_resourceW[] = {'\\','?','?','\\','S','h','a','r','e','d','G','p','u','R','e','s','o','u','r','c','e',0}; HANDLE unix_resource = INVALID_HANDLE_VALUE; @@ -2141,6 +2142,7 @@ static HANDLE create_gpu_resource(int fd, LPCWSTR name) in_size = sizeof(*inbuff) + (name ? lstrlenW(name) * sizeof(WCHAR) : 0); inbuff = calloc(1, in_size); inbuff->unix_handle = wine_server_obj_handle(unix_resource); + inbuff->resource_size = resource_size; if (name) lstrcpyW(&inbuff->name[0], name); @@ -2168,6 +2170,11 @@ struct shared_resource_open WCHAR name[1]; }; +struct shared_resource_info +{ + UINT64 resource_size; +}; + static HANDLE open_shared_resource(HANDLE kmt_handle, LPCWSTR name) { static const WCHAR shared_gpu_resourceW[] = {'\\','?','?','\\','S','h','a','r','e','d','G','p','u','R','e','s','o','u','r','c','e',0}; @@ -2215,6 +2222,21 @@ static HANDLE open_shared_resource(HANDLE kmt_handle, LPCWSTR name) return shared_resource; } +#define IOCTL_SHARED_GPU_RESOURCE_GET_INFO CTL_CODE(FILE_DEVICE_VIDEO, 7, METHOD_BUFFERED, FILE_READ_ACCESS) + +static BOOL shared_resource_get_info(HANDLE handle, struct shared_resource_info *info) +{ + IO_STATUS_BLOCK iosb; + unsigned int status; + + status = NtDeviceIoControlFile(handle, NULL, NULL, NULL, &iosb, IOCTL_SHARED_GPU_RESOURCE_GET_INFO, + NULL, 0, info, sizeof(*info)); + if (status) + ERR("Failed to get shared resource info, status %#x.\n", status); + + return !status; +} + #define IOCTL_SHARED_GPU_RESOURCE_GET_UNIX_RESOURCE CTL_CODE(FILE_DEVICE_VIDEO, 3, METHOD_BUFFERED, FILE_READ_ACCESS) static int get_shared_resource_fd(HANDLE shared_resource) @@ -2294,11 +2316,15 @@ VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInf /* Vulkan consumes imported FDs, but not imported HANDLEs */ if (handle_import_info) { + struct shared_resource_info res_info; + fd_import_info.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR; fd_import_info.pNext = info.pNext; fd_import_info.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; info.pNext = &fd_import_info; + TRACE("import handle type %#x.\n", handle_import_info->handleType); + switch (handle_import_info->handleType) { case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT: @@ -2334,6 +2360,26 @@ VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInf result = VK_ERROR_INVALID_EXTERNAL_HANDLE; goto done; } + + /* From VkMemoryAllocateInfo spec: "if the parameters define an import operation and the external handle type is + * VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, + * or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, allocationSize is ignored.". Although test suggests + * that it is also true for opaque Win32 handles. */ + if (shared_resource_get_info(memory->handle, &res_info)) + { + if (res_info.resource_size) + { + TRACE("Shared resource size %llu.\n", (long long)res_info.resource_size); + if (info.allocationSize && info.allocationSize != res_info.resource_size) + FIXME("Shared resource allocationSize %llu, resource_size %llu.\n", + (long long)info.allocationSize, (long long)res_info.resource_size); + info.allocationSize = res_info.resource_size; + } + else + { + ERR("Zero shared resource size.\n"); + } + } } else if (physical_device->external_memory_align && (mem_flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) && !find_next_struct(alloc_info->pNext, VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT)) @@ -2414,7 +2460,7 @@ VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInf if (device->p_vkGetMemoryFdKHR(device->host.device, &get_fd_info, &fd) == VK_SUCCESS) { - memory->handle = create_gpu_resource(fd, handle_export_info ? handle_export_info->name : NULL); + memory->handle = create_gpu_resource(fd, handle_export_info ? handle_export_info->name : NULL, alloc_info->allocationSize); memory->access = handle_export_info ? handle_export_info->dwAccess : GENERIC_ALL; if (handle_export_info && handle_export_info->pAttributes) memory->inherit = handle_export_info->pAttributes->bInheritHandle; @@ -3450,7 +3496,7 @@ VkResult wine_vkCreateSemaphore(VkDevice client_device, const VkSemaphoreCreateI if ((res = device->p_vkGetSemaphoreFdKHR(device->host.device, &fd_info, &fd)) == VK_SUCCESS) { - object->handle = create_gpu_resource(fd, export_handle_info ? export_handle_info->name : NULL); + object->handle = create_gpu_resource(fd, export_handle_info ? export_handle_info->name : NULL, 0); close(fd); } @@ -3489,7 +3535,7 @@ VkResult wine_vkCreateSemaphore(VkDevice client_device, const VkSemaphoreCreateI if ((res = device->p_vkGetSemaphoreFdKHR(device->host.device, &fd_info, &fd)) == VK_SUCCESS) { - object->handle = create_gpu_resource(fd, export_handle_info ? export_handle_info->name : NULL); + object->handle = create_gpu_resource(fd, export_handle_info ? export_handle_info->name : NULL, 0); close(fd); } From 5d703324e0fcbb1a7ad19daa194e342135291e06 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 10 Aug 2023 20:09:33 -0600 Subject: [PATCH 0892/2542] winevulkan: Share keyed mutex data. CW-Bug-Id: #22372 --- dlls/winevulkan/vulkan.c | 196 ++++++++++++++++++++++++++++++- dlls/winevulkan/vulkan_private.h | 13 ++ include/wine/vulkan_driver.h | 2 + 3 files changed, 209 insertions(+), 2 deletions(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index cafb8d151399..f51a332faba5 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -685,7 +685,8 @@ static const char *find_extension(const char *const *extensions, uint32_t count, } static VkResult wine_vk_device_convert_create_info(VkPhysicalDevice client_physical_device, - struct conversion_context *ctx, const VkDeviceCreateInfo *src, VkDeviceCreateInfo *dst) + struct conversion_context *ctx, const VkDeviceCreateInfo *src, VkDeviceCreateInfo *dst, + struct vulkan_device *device) { static const char *wine_xr_extension_name = "VK_WINE_openxr_device_extensions"; struct wine_phys_dev *phys_dev = wine_phys_dev_from_handle(client_physical_device); @@ -735,6 +736,7 @@ static VkResult wine_vk_device_convert_create_info(VkPhysicalDevice client_physi if (!find_extension(extensions, extensions_count, "VK_KHR_external_semaphore_win32")) extra_extensions[extra_count++] = "VK_KHR_external_semaphore_fd"; remove_extensions[remove_count++] = "VK_KHR_win32_keyed_mutex"; + device->keyed_mutexes_enabled = TRUE; } @@ -1103,7 +1105,7 @@ VkResult wine_vkCreateDevice(VkPhysicalDevice client_physical_device, const VkDe list_init(&device->free_fence_ops_list); init_conversion_context(&ctx); - res = wine_vk_device_convert_create_info(client_physical_device, &ctx, create_info, &create_info_host); + res = wine_vk_device_convert_create_info(client_physical_device, &ctx, create_info, &create_info_host, device); if (res == VK_SUCCESS) { VkPhysicalDeviceFeatures features = {0}; @@ -2269,6 +2271,191 @@ static HANDLE get_shared_resource_kmt_handle(HANDLE shared_resource) return wine_server_ptr_handle(kmt_handle); } +static bool set_shared_resource_object(HANDLE shared_resource, unsigned int index, HANDLE handle); +static HANDLE get_shared_resource_object(HANDLE shared_resource, unsigned int index); + +static void destroy_keyed_mutex(struct vulkan_device *device, struct wine_device_memory *memory) +{ + if (memory->keyed_mutex_shm) + { + NtUnmapViewOfSection(GetCurrentProcess(), memory->keyed_mutex_shm); + memory->keyed_mutex_shm = NULL; + } + if (memory->keyed_mutex_sem) + { + device->p_vkDestroySemaphore(device->host.device, memory->keyed_mutex_sem, NULL); + memory->keyed_mutex_sem = VK_NULL_HANDLE; + } +} + +static void create_keyed_mutex(struct vulkan_device *device, struct wine_device_memory *memory) +{ + VkExportSemaphoreCreateInfo timeline_export_info; + VkSemaphoreTypeCreateInfo type_info; + VkSemaphoreCreateInfo create_info; + VkSemaphoreGetFdInfoKHR fd_info; + pthread_mutexattr_t mutex_attr; + OBJECT_ATTRIBUTES attr; + HANDLE section_handle; + LARGE_INTEGER li; + HANDLE handle; + SIZE_T size; + VkResult vr; + int fd; + + InitializeObjectAttributes(&attr, NULL, 0, NULL, NULL); + size = li.QuadPart = sizeof(*memory->keyed_mutex_shm); + if (NtCreateSection(§ion_handle, STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ | SECTION_MAP_WRITE, &attr, &li, PAGE_READWRITE, SEC_COMMIT, NULL)) + { + ERR("NtCreateSection failed.\n"); + return; + } + + if (!set_shared_resource_object(memory->handle, 0, section_handle)) + { + NtClose(section_handle); + ERR("set_shared_resource_object failed.\n"); + return; + } + + if (NtMapViewOfSection(section_handle, GetCurrentProcess(), (void**) &memory->keyed_mutex_shm, 0, 0, NULL, &size, ViewShare, 0, PAGE_READWRITE)) + { + NtClose(section_handle); + ERR("NtMapViewOfSection failed.\n"); + return; + } + + NtClose(section_handle); + + timeline_export_info.sType = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO; + timeline_export_info.pNext = NULL; + timeline_export_info.handleTypes = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + + type_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; + type_info.pNext = &timeline_export_info; + type_info.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE; + type_info.initialValue = 0; + + create_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; + create_info.pNext = &type_info; + create_info.flags = 0; + + if ((vr = device->p_vkCreateSemaphore(device->host.device, &create_info, NULL, &memory->keyed_mutex_sem)) != VK_SUCCESS) + { + ERR("Failed to create semaphore, vr %d.\n", vr); + goto error; + } + fd_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR; + fd_info.pNext = NULL; + fd_info.semaphore = memory->keyed_mutex_sem; + fd_info.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + + if ((vr = device->p_vkGetSemaphoreFdKHR(device->host.device, &fd_info, &fd)) != VK_SUCCESS) + { + ERR("Failed to export semaphore fd, vr %d.\n", vr); + goto error; + } + if (wine_server_fd_to_handle(fd, GENERIC_ALL, 0, &handle) != STATUS_SUCCESS) + { + ERR("wine_server_fd_to_handle failed.\n"); + close(fd); + goto error; + } + close(fd); + if (!set_shared_resource_object(memory->handle, 1, handle)) + { + ERR("set_shared_resource_object failed.\n"); + NtClose(handle); + goto error; + } + NtClose(handle); + + pthread_mutexattr_init(&mutex_attr); + pthread_mutexattr_setpshared(&mutex_attr, PTHREAD_PROCESS_SHARED); + if (pthread_mutex_init(&memory->keyed_mutex_shm->mutex, &mutex_attr)) + memory->keyed_mutex_shm->instance_id_counter = 1; + memory->keyed_mutex_instance_id = ++memory->keyed_mutex_shm->instance_id_counter; + TRACE("memory %p, created keyed mutex.\n", memory); + return; + +error: + destroy_keyed_mutex(device, memory); +} + +static void import_keyed_mutex(struct vulkan_device *device, struct wine_device_memory *memory) +{ + VkSemaphoreTypeCreateInfo type_info; + VkImportSemaphoreFdInfoKHR fd_info; + VkSemaphoreCreateInfo create_info; + HANDLE section_handle, sem_handle; + SIZE_T size; + + VkResult vr; + + if (!(section_handle = get_shared_resource_object(memory->handle, 0))) + { + TRACE("No section handle.\n"); + return; + } + if (!(sem_handle = get_shared_resource_object(memory->handle, 1))) + { + ERR("No smeaphore handle.\n"); + NtClose(section_handle); + return; + } + + size = sizeof(*memory->keyed_mutex_shm); + if (NtMapViewOfSection(section_handle, GetCurrentProcess(), (void**) &memory->keyed_mutex_shm, 0, 0, NULL, &size, ViewShare, 0, PAGE_READWRITE)) + { + ERR("NtMapViewOfSection failed.\n"); + goto error; + } + + type_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; + type_info.pNext = NULL; + type_info.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE; + type_info.initialValue = 0; + + create_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; + create_info.pNext = &type_info; + create_info.flags = 0; + + if ((vr = device->p_vkCreateSemaphore(device->host.device, &create_info, NULL, &memory->keyed_mutex_sem)) != VK_SUCCESS) + { + ERR("Failed to create semaphore, vr %d.\n", vr); + goto error; + } + + fd_info.sType = VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR; + fd_info.pNext = NULL; + fd_info.semaphore = memory->keyed_mutex_sem; + fd_info.flags = 0; + fd_info.handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + + if (wine_server_handle_to_fd(sem_handle, FILE_READ_DATA, &fd_info.fd, NULL)) + { + ERR("wine_server_handle_to_fd failed.\n"); + goto error; + } + + vr = device->p_vkImportSemaphoreFdKHR(device->host.device, &fd_info); + if (vr != VK_SUCCESS) + { + ERR("vkImportSemaphoreFdKHR failed, vr %d.\n", vr); + close(fd_info.fd); + goto error; + } + /* Not closing fd on successful import, the driver now owns it. */ + + memory->keyed_mutex_instance_id = InterlockedIncrement64((LONGLONG *)&memory->keyed_mutex_shm->instance_id_counter); + TRACE("memory %p, imported keyed mutex.\n", memory); + return; +error: + NtClose(section_handle); + NtClose(sem_handle); + destroy_keyed_mutex(device, memory); +} + VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInfo *alloc_info, const VkAllocationCallbacks *allocator, VkDeviceMemory *ret) { @@ -2380,6 +2567,8 @@ VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInf ERR("Zero shared resource size.\n"); } } + if (device->keyed_mutexes_enabled) + import_keyed_mutex(device, memory); } else if (physical_device->external_memory_align && (mem_flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) && !find_next_struct(alloc_info->pNext, VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT)) @@ -2467,6 +2656,8 @@ VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInf else memory->inherit = FALSE; close(fd); + if (device->keyed_mutexes_enabled) + create_keyed_mutex(device, memory); } if (memory->handle == INVALID_HANDLE_VALUE) @@ -2507,6 +2698,7 @@ void wine_vkFreeMemory(VkDevice client_device, VkDeviceMemory memory_handle, con return; memory = wine_device_memory_from_handle(memory_handle); + destroy_keyed_mutex(device, memory); if (memory->vm_map && !physical_device->external_memory_align) { const VkMemoryUnmapInfoKHR info = diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index 1acd7c5a1297..d01eb8f0914d 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -115,6 +115,16 @@ static inline struct wine_cmd_pool *wine_cmd_pool_from_handle(VkCommandPool hand return (struct wine_cmd_pool *)(UINT_PTR)client->unix_handle; } +struct keyed_mutex_shm +{ + pthread_mutex_t mutex; + uint64_t instance_id_counter; + uint64_t acquired_to_instance; + uint64_t key; + uint64_t timeline_value; + uint64_t timeline_queued_release; +}; + struct wine_device_memory { VULKAN_OBJECT_HEADER( VkDeviceMemory, device_memory ); @@ -124,6 +134,9 @@ struct wine_device_memory BOOL inherit; DWORD access; HANDLE handle; + struct keyed_mutex_shm *keyed_mutex_shm; + VkSemaphore keyed_mutex_sem; + uint64_t keyed_mutex_instance_id; }; static inline struct wine_device_memory *wine_device_memory_from_handle(VkDeviceMemory handle) diff --git a/include/wine/vulkan_driver.h b/include/wine/vulkan_driver.h index 3bb0c81cc00a..15d03383e12d 100644 --- a/include/wine/vulkan_driver.h +++ b/include/wine/vulkan_driver.h @@ -131,6 +131,8 @@ struct vulkan_device pthread_cond_t sem_poll_updated_cond; uint64_t sem_poll_update_value; /* set to sem_poll_update.value by signaller thread once update is processed. */ unsigned int allocated_fence_ops_count; + + BOOL keyed_mutexes_enabled; }; static inline struct vulkan_device *vulkan_device_from_handle( VkDevice handle ) From 66ff445cc8033cbd845aad360b18e37ad1b797f9 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 4 Aug 2023 20:46:30 -0600 Subject: [PATCH 0893/2542] winevulkan: Support keyed mutex waits and signals in submits. CW-Bug-Id: #22372 --- dlls/winevulkan/make_vulkan | 11 +- dlls/winevulkan/vulkan.c | 280 ++++++++++++++++++++++++++++++++++-- 2 files changed, 269 insertions(+), 22 deletions(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 13fdf2db0dfa..3c5280378268 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -181,7 +181,7 @@ FUNCTION_OVERRIDES = { "vkSignalSemaphore" : {"dispatch" : True}, "vkWaitSemaphores" : {"dispatch" : True}, "vkQueueBindSparse" : {"dispatch" : True}, - "vkQueueSubmit" : {"dispatch" : True, "extra_param" : "pSubmits"}, + "vkQueueSubmit" : {"dispatch" : True}, "vkQueueSubmit2" : {"dispatch" : True}, "vkDestroySemaphore" : {"dispatch" : True}, @@ -334,15 +334,12 @@ STRUCT_CHAIN_CONVERSIONS = { "VkPhysicalDeviceImageFormatInfo2": [], "VkPhysicalDeviceExternalSemaphoreInfo": [], "VkSemaphoreCreateInfo": [], - "VkSubmitInfo": ["VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR", "VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR"], - "VkSubmitInfo2": ["VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR"], + "VkSubmitInfo": [], + "VkSubmitInfo2": [], "VkBindSparseInfo" : [], } -STRUCT_COPY = { - "VkSubmitInfo", - "VkSubmitInfo2", -}; +STRUCT_COPY = {}; # Some struct members are conditionally ignored and callers are free to leave them uninitialized. # We can't deduce that from XML, so we allow expressing it here. diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index f51a332faba5..5e3cad1ab454 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -2456,6 +2456,111 @@ static void import_keyed_mutex(struct vulkan_device *device, struct wine_device_ destroy_keyed_mutex(device, memory); } +static VkResult acquire_keyed_mutex(struct vulkan_device *device, struct wine_device_memory *memory, uint64_t key, + uint32_t timeout_ms) +{ + ULONG end_wait, curr_tick, remaining_wait; + VkSemaphoreWaitInfo wait_info = { 0 }; + uint64_t timeline; + VkResult vr; + + if (!memory->keyed_mutex_shm) + return VK_ERROR_UNKNOWN; + + wait_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO; + wait_info.semaphoreCount = 1; + wait_info.pSemaphores = &memory->keyed_mutex_sem; + wait_info.pValues = &timeline; + + end_wait = NtGetTickCount() + timeout_ms; + + while (1) + { + pthread_mutex_lock(&memory->keyed_mutex_shm->mutex); + + if (memory->keyed_mutex_shm->acquired_to_instance) + { + if ((vr = get_semaphore_value(device, memory->keyed_mutex_sem, &timeline)) != VK_SUCCESS) + { + pthread_mutex_unlock(&memory->keyed_mutex_shm->mutex); + return VK_ERROR_UNKNOWN; + } + assert(timeline == memory->keyed_mutex_shm->timeline_value + || timeline == memory->keyed_mutex_shm->timeline_value + 1); + if (timeline == memory->keyed_mutex_shm->timeline_value + 1) + { + /* released from queue. */ + assert(memory->keyed_mutex_shm->timeline_queued_release == timeline); + memory->keyed_mutex_shm->timeline_queued_release = 0; + ++memory->keyed_mutex_shm->timeline_value; + memory->keyed_mutex_shm->acquired_to_instance = 0; + } + } + + if (memory->keyed_mutex_shm->acquired_to_instance == memory->keyed_mutex_instance_id + && !memory->keyed_mutex_shm->timeline_queued_release) + { + /* Already acquired to this device. */ + pthread_mutex_unlock(&memory->keyed_mutex_shm->mutex); + return VK_ERROR_UNKNOWN; + } + if (!memory->keyed_mutex_shm->acquired_to_instance && memory->keyed_mutex_shm->key == key) + { + /* Can acquire. */ + memory->keyed_mutex_shm->acquired_to_instance = memory->keyed_mutex_instance_id; + pthread_mutex_unlock(&memory->keyed_mutex_shm->mutex); + return VK_SUCCESS; + } + curr_tick = NtGetTickCount(); + if (!timeout_ms || curr_tick >= end_wait) + { + pthread_mutex_unlock(&memory->keyed_mutex_shm->mutex); + return VK_TIMEOUT; + } + remaining_wait = timeout_ms == INFINITE ? INFINITE : end_wait - curr_tick; + timeline = memory->keyed_mutex_shm->timeline_value + 1; + pthread_mutex_unlock(&memory->keyed_mutex_shm->mutex); + + vr = wait_semaphores(device, &wait_info, remaining_wait * 1000000ull); + if (vr != VK_SUCCESS && vr != VK_TIMEOUT) + { + ERR("vkWaitSemaphores failed, vr %d.\n", vr); + return VK_ERROR_UNKNOWN; + } + } +} + +static VkResult release_keyed_mutex(struct vulkan_device *device, struct wine_device_memory *memory, uint64_t key, + uint64_t *timeline_value) +{ + if (!memory->keyed_mutex_shm) + return VK_ERROR_UNKNOWN; + + pthread_mutex_lock(&memory->keyed_mutex_shm->mutex); + if (memory->keyed_mutex_shm->acquired_to_instance != memory->keyed_mutex_instance_id + || memory->keyed_mutex_shm->timeline_queued_release) + { + pthread_mutex_unlock(&memory->keyed_mutex_shm->mutex); + return VK_ERROR_UNKNOWN; + } + memory->keyed_mutex_shm->key = key; + if (timeline_value) + { + /* Return timeline value to signal from queue. */ + *timeline_value = memory->keyed_mutex_shm->timeline_value + 1; + memory->keyed_mutex_shm->timeline_queued_release = *timeline_value; + } + else + { + /* Release immediately. */ + memory->keyed_mutex_shm->acquired_to_instance = 0; + signal_timeline_sem(device, memory->keyed_mutex_sem, &memory->keyed_mutex_shm->timeline_value); + } + pthread_mutex_unlock(&memory->keyed_mutex_shm->mutex); + + return VK_SUCCESS; +} + VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInfo *alloc_info, const VkAllocationCallbacks *allocator, VkDeviceMemory *ret) { @@ -4166,17 +4271,125 @@ struct struct_chain_def unsigned int size; }; -VkResult wine_vkQueueSubmit(VkQueue queue_handle, uint32_t submit_count, const VkSubmitInfo *submits_orig, VkFence fence, - void *submits_win_ptr) +static VkResult process_keyed_mutexes(struct conversion_context *ctx, struct vulkan_device *device, + uint32_t submit_count, const void *submits_win, size_t submit_size, uint32_t **signal_counts, + VkSemaphoreSubmitInfo ***signal_infos) +{ + VkWin32KeyedMutexAcquireReleaseInfoKHR *keyed_mutex_info; + struct wine_device_memory *memory; + VkResult ret = VK_ERROR_UNKNOWN; + uint32_t i, j, signal_count = 0; + void *ptr; + + for (i = 0; i < submit_count; ++i) + { + ptr = (char *)submits_win + i * submit_size; + if (!(keyed_mutex_info = find_next_struct(ptr, VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR))) + continue; + for (j = 0; j < keyed_mutex_info->acquireCount; ++j) + { + memory = wine_device_memory_from_handle(keyed_mutex_info->pAcquireSyncs[j]); + if ((ret = acquire_keyed_mutex(device, memory, keyed_mutex_info->pAcquireKeys[j], + keyed_mutex_info->pAcquireTimeouts[j])) == VK_SUCCESS) + continue; + while (j) + { + --j; + memory = wine_device_memory_from_handle(keyed_mutex_info->pAcquireSyncs[j]); + release_keyed_mutex(device, memory, keyed_mutex_info->pAcquireKeys[j], NULL); + } + goto error; + } + /* Pre-check release error conditions. */ + for (j = 0; j < keyed_mutex_info->releaseCount; ++j) + { + memory = wine_device_memory_from_handle(keyed_mutex_info->pReleaseSyncs[j]); + if (!memory->keyed_mutex_shm) + goto error; + if (memory->keyed_mutex_shm->acquired_to_instance != memory->keyed_mutex_instance_id) + goto error; + } + signal_count += keyed_mutex_info->releaseCount; + } + + if (!signal_count) + { + *signal_counts = NULL; + return VK_SUCCESS; + } + *signal_counts = conversion_context_alloc(ctx, sizeof(**signal_counts) * submit_count); + *signal_infos = conversion_context_alloc(ctx, sizeof(**signal_infos) * submit_count); + for (i = 0; i < submit_count; ++i) + { + ptr = (char *)submits_win + i * submit_size; + if (!(keyed_mutex_info = wine_vk_find_unlink_struct(ptr, WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR))) + { + (*signal_counts)[i] = 0; + continue; + } + (*signal_counts)[i] = keyed_mutex_info->releaseCount; + (*signal_infos)[i] = conversion_context_alloc(ctx, sizeof(***signal_infos) * keyed_mutex_info->releaseCount); + for (j = 0; j < keyed_mutex_info->releaseCount; ++j) + { + memory = wine_device_memory_from_handle(keyed_mutex_info->pReleaseSyncs[j]); + (*signal_infos)[i][j].sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO; + (*signal_infos)[i][j].pNext = NULL; + (*signal_infos)[i][j].semaphore = memory->keyed_mutex_sem; + (*signal_infos)[i][j].stageMask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + (*signal_infos)[i][j].deviceIndex = 0; + ret = release_keyed_mutex(device, memory, keyed_mutex_info->pReleaseKeys[j], &(*signal_infos)[i][j].value); + if (ret != VK_SUCCESS) + { + /* This should only be possible if a racing submit queued release before us, currently not handled. */ + ERR("release_keyed_mutex failed, ret %d.\n", ret); + (*signal_infos)[i][j].value = 0; + } + } + } + + return VK_SUCCESS; + +error: + while (i) + { + --i; + ptr = (char *)submits_win + i * submit_size; + if (!(keyed_mutex_info = wine_vk_find_unlink_struct(ptr, WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR))) + continue; + for (j = 0; j < keyed_mutex_info->acquireCount; ++j) + { + memory = wine_device_memory_from_handle(keyed_mutex_info->pAcquireSyncs[j]); + release_keyed_mutex(device, memory, keyed_mutex_info->pAcquireKeys[j], NULL); + } + } + return ret; +} + +static void duplicate_array_for_unwrapping_copy_size(struct conversion_context *ctx, void **ptr, unsigned int size, + unsigned int copy_size) +{ + void *out; + + if (!size) + return; + + out = conversion_context_alloc(ctx, size); + if (*ptr) + memcpy(out, *ptr, copy_size); + *ptr = out; +} + +VkResult wine_vkQueueSubmit(VkQueue queue_handle, uint32_t submit_count, const VkSubmitInfo *submits_orig, VkFence fence) { struct vulkan_queue *queue = vulkan_queue_from_handle(queue_handle); struct vulkan_device *device = queue->device; - VkTimelineSemaphoreSubmitInfo *timeline_submit_info; - const VkSubmitInfo *submits_win = submits_win_ptr; + VkTimelineSemaphoreSubmitInfo *timeline_submit_info, ts_info_copy; VkD3D12FenceSubmitInfoKHR *d3d12_submit_info; const uint64_t **values; struct conversion_context ctx; VkSubmitInfo *submits; + VkSemaphoreSubmitInfo **km_infos; + uint32_t *km_counts; unsigned int i, j; VkResult ret; @@ -4184,10 +4397,13 @@ VkResult wine_vkQueueSubmit(VkQueue queue_handle, uint32_t submit_count, const V init_conversion_context(&ctx); MEMDUP(&ctx, submits, submits_orig, submit_count); + if ((ret = process_keyed_mutexes(&ctx, device, submit_count, submits, sizeof(*submits), &km_counts, &km_infos))) + return ret; + for (i = 0; i < submit_count; ++i) { timeline_submit_info = find_next_struct(&submits[i], VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO); - d3d12_submit_info = find_next_struct(&submits_win[i], VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR); + d3d12_submit_info = wine_vk_find_unlink_struct(&submits[i], D3D12_FENCE_SUBMIT_INFO_KHR); if (d3d12_submit_info && timeline_submit_info) WARN("Both TIMELINE_SEMAPHORE_SUBMIT_INFO and D3D12_FENCE_SUBMIT_INFO_KHR specified.\n"); if (d3d12_submit_info && !timeline_submit_info) @@ -4213,6 +4429,36 @@ VkResult wine_vkQueueSubmit(VkQueue queue_handle, uint32_t submit_count, const V else values = NULL; unwrap_semaphore_array(&submits[i].pSignalSemaphores, values, submits[i].signalSemaphoreCount, &ctx, TRUE, device); + if (km_counts && km_counts[i]) + { + if (timeline_submit_info) + { + ts_info_copy = *timeline_submit_info; + timeline_submit_info = &ts_info_copy; + duplicate_array_for_unwrapping_copy_size(&ctx, (void **)&timeline_submit_info->pSignalSemaphoreValues, + (timeline_submit_info->signalSemaphoreValueCount + km_counts[i]) * sizeof(*timeline_submit_info->pSignalSemaphoreValues), + timeline_submit_info->signalSemaphoreValueCount * sizeof(*timeline_submit_info->pSignalSemaphoreValues)); + } + else + { + timeline_submit_info = &ts_info_copy; + timeline_submit_info->sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO; + timeline_submit_info->pNext = submits[i].pNext; + timeline_submit_info->waitSemaphoreValueCount = 0; + timeline_submit_info->signalSemaphoreValueCount = 0; + timeline_submit_info->pSignalSemaphoreValues = conversion_context_alloc(&ctx, km_counts[i] * sizeof(*timeline_submit_info->pSignalSemaphoreValues)); + submits[i].pNext = timeline_submit_info; + } + duplicate_array_for_unwrapping_copy_size(&ctx, (void **)&submits[i].pSignalSemaphores, + (submits[i].signalSemaphoreCount + km_counts[i]) * sizeof(*submits[i].pSignalSemaphores), + submits[i].signalSemaphoreCount * sizeof(*submits[i].pSignalSemaphores)); + for (j = 0; j < km_counts[i]; ++j) + { + ((uint64_t *)timeline_submit_info->pSignalSemaphoreValues)[j + timeline_submit_info->signalSemaphoreValueCount++] + = km_infos[i][j].value; + ((VkSemaphore *)submits[i].pSignalSemaphores)[j + submits[i].signalSemaphoreCount++] = km_infos[i][j].semaphore; + } + } if (submits[i].pCommandBuffers && submits[i].commandBufferCount) { @@ -4231,20 +4477,17 @@ VkResult wine_vkQueueSubmit(VkQueue queue_handle, uint32_t submit_count, const V static void duplicate_array_for_unwrapping(struct conversion_context *ctx, void **ptr, unsigned int size) { - void *out; - - if (!*ptr || !size) - return; - - out = conversion_context_alloc(ctx, size); - memcpy(out, *ptr, size); - *ptr = out; + duplicate_array_for_unwrapping_copy_size(ctx, ptr, size, size); } -static VkResult vk_queue_submit_2(VkQueue queue_handle, uint32_t submit_count, const VkSubmitInfo2 *submits_orig, VkFence fence, bool khr) +static VkResult vk_queue_submit_2(VkQueue queue_handle, uint32_t submit_count, const VkSubmitInfo2 *submits_orig, + VkFence fence, bool khr) { struct vulkan_queue *queue = vulkan_queue_from_handle(queue_handle); + struct vulkan_device *device = queue->device; struct conversion_context ctx; + VkSemaphoreSubmitInfo **km_infos; + uint32_t *km_counts, count; VkSubmitInfo2 *submits; unsigned int i, j; VkResult ret; @@ -4253,6 +4496,8 @@ static VkResult vk_queue_submit_2(VkQueue queue_handle, uint32_t submit_count, c init_conversion_context(&ctx); MEMDUP(&ctx, submits, submits_orig, submit_count); + if ((ret = process_keyed_mutexes(&ctx, device, submit_count, submits, sizeof(*submits), &km_counts, &km_infos))) + return ret; for (i = 0; i < submit_count; ++i) { duplicate_array_for_unwrapping(&ctx, (void **)&submits[i].pWaitSemaphoreInfos, @@ -4261,11 +4506,16 @@ static VkResult vk_queue_submit_2(VkQueue queue_handle, uint32_t submit_count, c unwrap_semaphore(queue->device, &((VkSemaphoreSubmitInfo *)submits[i].pWaitSemaphoreInfos)[j].semaphore, &((VkSemaphoreSubmitInfo *)submits[i].pWaitSemaphoreInfos)[j].value, FALSE); - duplicate_array_for_unwrapping(&ctx, (void **)&submits[i].pSignalSemaphoreInfos, + count = submits[i].signalSemaphoreInfoCount + (km_counts ? km_counts[i] : 0); + duplicate_array_for_unwrapping_copy_size(&ctx, (void **)&submits[i].pSignalSemaphoreInfos, + count * sizeof(*submits[i].pSignalSemaphoreInfos), submits[i].signalSemaphoreInfoCount * sizeof(*submits[i].pSignalSemaphoreInfos)); for (j = 0; j < submits[i].signalSemaphoreInfoCount; ++j) unwrap_semaphore(queue->device, &((VkSemaphoreSubmitInfo *)submits[i].pSignalSemaphoreInfos)[j].semaphore, &((VkSemaphoreSubmitInfo *)submits[i].pSignalSemaphoreInfos)[j].value, TRUE); + for (; j < count; ++j) + ((VkSemaphoreSubmitInfo *)submits[i].pSignalSemaphoreInfos)[j] = km_infos[i][j - submits[i].signalSemaphoreInfoCount]; + submits[i].signalSemaphoreInfoCount = count; if (submits[i].pCommandBufferInfos && submits[i].commandBufferInfoCount) { From fb6f74b22d7479c9b3a6a420707b5d403d6ef614 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 10 Aug 2023 12:23:26 -0600 Subject: [PATCH 0894/2542] winevulkan: Export custom functions for acquiring and releasing keyed mutexes. CW-Bug-Id: #22372 --- dlls/winevulkan/make_vulkan | 11 +++++++++++ dlls/winevulkan/vk_custom.xml | 24 ++++++++++++++++++++++++ dlls/winevulkan/vulkan.c | 12 ++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 dlls/winevulkan/vk_custom.xml diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 3c5280378268..1451242833f0 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -210,6 +210,10 @@ FUNCTION_OVERRIDES = { # VK_KHR_synchronization2 "vkQueueSubmit2KHR" : {"dispatch" : True}, + + # Custom functions + "wine_vkAcquireKeyedMutex" : {"dispatch": True}, + "wine_vkReleaseKeyedMutex" : {"dispatch": True}, } # functions for which a user driver entry must be generated @@ -296,6 +300,9 @@ MANUAL_UNIX_THUNKS = { "vkSignalSemaphoreKHR", "vkWaitSemaphoresKHR", "vkQueueSubmit2KHR", + # Custom functions + "wine_vkAcquireKeyedMutex", + "wine_vkReleaseKeyedMutex", } # loader functions which are entirely manually implemented @@ -3356,6 +3363,10 @@ class VkRegistry(object): root.extend(video_root) + tree_custom = ET.parse("vk_custom.xml") + root_custom = tree_custom.getroot() + root.extend(root_custom) + self._parse_enums(root) self._parse_types(root) self._parse_commands(root) diff --git a/dlls/winevulkan/vk_custom.xml b/dlls/winevulkan/vk_custom.xml new file mode 100644 index 000000000000..a9fd68548c41 --- /dev/null +++ b/dlls/winevulkan/vk_custom.xml @@ -0,0 +1,24 @@ + + + + + VkResult wine_vkAcquireKeyedMutex + VkDevice device + VkDeviceMemory memory + uint64_t key + uint32_t timeout_ms + + + VkResult wine_vkReleaseKeyedMutex + VkDevice device + VkDeviceMemory memory + uint64_t key + + + + + + + + + diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 5e3cad1ab454..754cdd981c81 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -3188,6 +3188,8 @@ static void substitute_function_name(const char **name) *name = "vkGetSemaphoreFdKHR"; else if (!strcmp(*name, "vkImportSemaphoreWin32HandleKHR")) *name = "vkImportSemaphoreFdKHR"; + else if (!strcmp(*name, "wine_vkAcquireKeyedMutex") || !strcmp(*name, "wine_vkReleaseKeyedMutex")) + *name = "vkImportSemaphoreFdKHR"; } #ifdef _WIN64 @@ -4624,3 +4626,13 @@ VkResult wine_vkQueueBindSparse(VkQueue queue_handle, uint32_t bind_info_count, free_conversion_context(&ctx); return ret; } + +VkResult wine_wine_vkAcquireKeyedMutex(VkDevice device, VkDeviceMemory memory, uint64_t key, uint32_t timeout_ms) +{ + return acquire_keyed_mutex(vulkan_device_from_handle(device), wine_device_memory_from_handle(memory), key, timeout_ms); +} + +VkResult wine_wine_vkReleaseKeyedMutex(VkDevice device, VkDeviceMemory memory, uint64_t key) +{ + return release_keyed_mutex(vulkan_device_from_handle(device), wine_device_memory_from_handle(memory), key, NULL); +} From 7713129bb450e4f6cf5a2bcb4623b27bfb072e85 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 4 Nov 2021 11:00:56 -0400 Subject: [PATCH 0895/2542] HACK: user32: Handle OBJID_QUERYCLASSNAMEIDX for user32 edit control. Due to Wine's implementation of RealGetWindowClass being broken for subclassed controls, we'll need to respond to OBJID_QUERYCLASSNAMEIDX to know that we have an edit control. Signed-off-by: Connor McAdams CW-Bug-Id: #18351 --- dlls/user32/edit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index 9607cecc2232..e40743a419b6 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -5127,6 +5127,12 @@ LRESULT EditWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, B } break; + case WM_GETOBJECT: + if (lParam == (DWORD)OBJID_QUERYCLASSNAMEIDX) + result = 0x10004; + + break; + default: result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode); break; From df7f12307e35f3c5779ebe6d36285205eb05d687 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 13 Dec 2023 07:29:44 -0500 Subject: [PATCH 0896/2542] HACK: uiautomationcore: Use IAccessible2::get_windowHandle method to get HWND when possible. MSAA proxy providers require an HWND for creation, this is usually retrieved via WindowFromAccessibleObject. However, WindowFromAccessibleObject requires navigating up to the root IAccessible in CEF applications, which due to cross-process calls can end up taking over a second for focus change events to be delivered. Using the IA2 method here gets this down to around 350ms, which isn't great but is better than before. Native does not use the get_windowHandle method, but it likely uses hooks which would negate the cross-process call performance hit. --- dlls/uiautomationcore/uia_provider.c | 35 ++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/dlls/uiautomationcore/uia_provider.c b/dlls/uiautomationcore/uia_provider.c index 2e5f0e6c6ea1..ce4aa0b53aeb 100644 --- a/dlls/uiautomationcore/uia_provider.c +++ b/dlls/uiautomationcore/uia_provider.c @@ -1141,16 +1141,28 @@ static HRESULT msaa_acc_get_focus(struct msaa_provider *prov, struct msaa_provid if (V_VT(&v) == VT_DISPATCH) { + IAccessible2 *ia2 = NULL; + hr = IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IAccessible, (void **)&focus_acc); VariantClear(&v); if (FAILED(hr)) return hr; - hr = WindowFromAccessibleObject(focus_acc, &hwnd); - if (FAILED(hr) || !hwnd) + if ((ia2 = msaa_acc_get_ia2(focus_acc))) { - IAccessible_Release(focus_acc); - return hr; + hr = IAccessible2_get_windowHandle(ia2, &hwnd); + if (FAILED(hr)) + WARN("IA2 get_windowHandle failed with hr %#lx\n", hr); + IAccessible2_Release(ia2); + } + if (!hwnd) + { + hr = WindowFromAccessibleObject(focus_acc, &hwnd); + if (FAILED(hr) || !hwnd) + { + IAccessible_Release(focus_acc); + return hr; + } } } @@ -1463,9 +1475,18 @@ HRESULT create_msaa_provider(IAccessible *acc, LONG child_id, HWND hwnd, BOOL ro { HRESULT hr; - hr = WindowFromAccessibleObject(acc, &msaa_prov->hwnd); - if (FAILED(hr)) - WARN("WindowFromAccessibleObject failed with hr %#lx\n", hr); + if (msaa_prov->ia2) + { + hr = IAccessible2_get_windowHandle(msaa_prov->ia2, &msaa_prov->hwnd); + if (FAILED(hr)) + WARN("IA2 get_windowHandle failed with hr %#lx\n", hr); + } + if (!msaa_prov->hwnd) + { + hr = WindowFromAccessibleObject(acc, &msaa_prov->hwnd); + if (FAILED(hr)) + WARN("WindowFromAccessibleObject failed with hr %#lx\n", hr); + } } else msaa_prov->hwnd = hwnd; From 87598c279ba31e1dd8a6f38f44facdd5d65a00b7 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Tue, 3 Jan 2023 15:07:32 -0500 Subject: [PATCH 0897/2542] windows.media.speech: HACK: Don't invoke passed in async handler interface for Forza Horizon 5. Invoking the interface causes the code to go further and causes a segfault on an unimplemented interface. Avoid this by never triggering the async handler. CW-Bug-Id: #24571 --- dlls/windows.media.speech/async.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/windows.media.speech/async.c b/dlls/windows.media.speech/async.c index 2b2dc3943059..6f4c916af480 100644 --- a/dlls/windows.media.speech/async.c +++ b/dlls/windows.media.speech/async.c @@ -490,10 +490,19 @@ static HRESULT WINAPI async_inspectable_put_Completed( IAsyncOperation_IInspecta IAsyncOperationCompletedHandler_IInspectable *handler ) { struct async_inspectable *impl = impl_from_IAsyncOperation_IInspectable(iface); + const char *var = getenv("SteamAppId"); HRESULT hr = S_OK; TRACE("iface %p, handler %p.\n", iface, handler); + /* + * HACK: Forza Horizon 5 will segfault when trying to get an interface if + * we invoke the handler, so we should just return S_OK and let it hang + * indefinitely. + */ + if (var && !strcmp(var, "1551360")) + return S_OK; + EnterCriticalSection(&impl->cs); if (impl->status == Closed) hr = E_ILLEGAL_METHOD_CALL; From a031094a7768bb723562d9856b471592315656ff Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Tue, 20 Dec 2022 13:38:58 -0500 Subject: [PATCH 0898/2542] tabtip: Create tabtip.exe. TabTIP: Tablet text input panel. This program watches for editable text input fields gaining focus and runs an event handler when this occurs. Signed-off-by: Connor McAdams CW-Bug-Id: #18351 --- configure.ac | 1 + programs/tabtip/Makefile.in | 7 + programs/tabtip/tabtip.c | 446 ++++++++++++++++++++++++++++++++++++ 3 files changed, 454 insertions(+) create mode 100644 programs/tabtip/Makefile.in create mode 100644 programs/tabtip/tabtip.c diff --git a/configure.ac b/configure.ac index 0f61a2ce5d0d..8fd8f1ec9288 100644 --- a/configure.ac +++ b/configure.ac @@ -3568,6 +3568,7 @@ WINE_CONFIG_MAKEFILE(programs/start) WINE_CONFIG_MAKEFILE(programs/subst) WINE_CONFIG_MAKEFILE(programs/svchost) WINE_CONFIG_MAKEFILE(programs/systeminfo) +WINE_CONFIG_MAKEFILE(programs/tabtip) WINE_CONFIG_MAKEFILE(programs/taskkill) WINE_CONFIG_MAKEFILE(programs/tasklist) WINE_CONFIG_MAKEFILE(programs/tasklist/tests) diff --git a/programs/tabtip/Makefile.in b/programs/tabtip/Makefile.in new file mode 100644 index 000000000000..5070b74fc4cb --- /dev/null +++ b/programs/tabtip/Makefile.in @@ -0,0 +1,7 @@ +MODULE = tabtip.exe +IMPORTS = ole32 user32 uiautomationcore shell32 oleaut32 + +EXTRADLLFLAGS = -mconsole -municode + +SOURCES = \ + tabtip.c diff --git a/programs/tabtip/tabtip.c b/programs/tabtip/tabtip.c new file mode 100644 index 000000000000..f641ef34d208 --- /dev/null +++ b/programs/tabtip/tabtip.c @@ -0,0 +1,446 @@ +/* + * Copyright 2021 Connor McAdams + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "windows.h" +#define COBJMACROS +#include +#include "uiautomation.h" +#include "ole2.h" +#include "strsafe.h" +#include "oleacc.h" +#include "shellapi.h" +#include +#include + +#include "wine/debug.h" +#ifndef UNICODE +#define UNICODE +#endif + +WINE_DEFAULT_DEBUG_CHANNEL(tabtip); + +static BOOL keyboard_up; +static BOOL use_steam_osk; +static unsigned int steam_app_id; + +struct str_id_pair { + int id; + const char *str; +}; + +static const struct str_id_pair uia_control_type_id_strs[] = { + { UIA_ButtonControlTypeId, "UIA_ButtonControlTypeId", }, + { UIA_CalendarControlTypeId, "UIA_CalendarControlTypeId", }, + { UIA_CheckBoxControlTypeId, "UIA_CheckBoxControlTypeId", }, + { UIA_ComboBoxControlTypeId, "UIA_ComboBoxControlTypeId", }, + { UIA_EditControlTypeId, "UIA_EditControlTypeId", }, + { UIA_HyperlinkControlTypeId, "UIA_HyperlinkControlTypeId", }, + { UIA_ImageControlTypeId, "UIA_ImageControlTypeId", }, + { UIA_ListItemControlTypeId, "UIA_ListItemControlTypeId", }, + { UIA_ListControlTypeId, "UIA_ListControlTypeId", }, + { UIA_MenuControlTypeId, "UIA_MenuControlTypeId", }, + { UIA_MenuBarControlTypeId, "UIA_MenuBarControlTypeId", }, + { UIA_MenuItemControlTypeId, "UIA_MenuItemControlTypeId", }, + { UIA_ProgressBarControlTypeId, "UIA_ProgressBarControlTypeId", }, + { UIA_RadioButtonControlTypeId, "UIA_RadioButtonControlTypeId", }, + { UIA_ScrollBarControlTypeId, "UIA_ScrollBarControlTypeId", }, + { UIA_SliderControlTypeId, "UIA_SliderControlTypeId", }, + { UIA_SpinnerControlTypeId, "UIA_SpinnerControlTypeId", }, + { UIA_StatusBarControlTypeId, "UIA_StatusBarControlTypeId", }, + { UIA_TabControlTypeId, "UIA_TabControlTypeId", }, + { UIA_TabItemControlTypeId, "UIA_TabItemControlTypeId", }, + { UIA_TextControlTypeId, "UIA_TextControlTypeId", }, + { UIA_ToolBarControlTypeId, "UIA_ToolBarControlTypeId", }, + { UIA_ToolTipControlTypeId, "UIA_ToolTipControlTypeId", }, + { UIA_TreeControlTypeId, "UIA_TreeControlTypeId", }, + { UIA_TreeItemControlTypeId, "UIA_TreeItemControlTypeId", }, + { UIA_CustomControlTypeId, "UIA_CustomControlTypeId", }, + { UIA_GroupControlTypeId, "UIA_GroupControlTypeId", }, + { UIA_ThumbControlTypeId, "UIA_ThumbControlTypeId", }, + { UIA_DataGridControlTypeId, "UIA_DataGridControlTypeId", }, + { UIA_DataItemControlTypeId, "UIA_DataItemControlTypeId", }, + { UIA_DocumentControlTypeId, "UIA_DocumentControlTypeId", }, + { UIA_SplitButtonControlTypeId, "UIA_SplitButtonControlTypeId", }, + { UIA_WindowControlTypeId, "UIA_WindowControlTypeId", }, + { UIA_PaneControlTypeId, "UIA_PaneControlTypeId", }, + { UIA_HeaderControlTypeId, "UIA_HeaderControlTypeId", }, + { UIA_HeaderItemControlTypeId, "UIA_HeaderItemControlTypeId", }, + { UIA_TableControlTypeId, "UIA_TableControlTypeId", }, + { UIA_TitleBarControlTypeId, "UIA_TitleBarControlTypeId", }, + { UIA_SeparatorControlTypeId, "UIA_SeparatorControlTypeId", }, + { UIA_SemanticZoomControlTypeId, "UIA_SemanticZoomControlTypeId", }, + { UIA_AppBarControlTypeId, "UIA_AppBarControlTypeId", }, +}; + +static int __cdecl str_id_pair_compare(const void *a, const void *b) +{ + const int *id = a; + const struct str_id_pair *pair = b; + + return ((*id) > pair->id) - ((*id) < pair->id); +} + +#define get_str_for_id(id, id_pair) \ + get_str_from_id_pair( (id), (id_pair), (ARRAY_SIZE(id_pair)) ) +static const char *get_str_from_id_pair(int id, const struct str_id_pair *id_pair, int id_pair_size) +{ + const struct str_id_pair *pair; + + if ((pair = bsearch(&id, id_pair, id_pair_size, sizeof(*pair), str_id_pair_compare))) + return pair->str; + + return ""; +} + +static const WCHAR tabtip_window_class_name[] = L"IPTip_Main_Window"; +static LRESULT CALLBACK tabtip_win_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + return DefWindowProcW(hwnd, msg, wparam, lparam); +} + +#define MAX_LINK_BUF 4096 +struct osk_link_data { + WCHAR link_buf[MAX_LINK_BUF]; + WCHAR *link_buf_pos; + int args_count; +}; + +static void osk_link_init(struct osk_link_data *data, const WCHAR *link) +{ + data->link_buf_pos = data->link_buf; + data->link_buf_pos += wsprintfW(data->link_buf, L"%s", link); + data->args_count = 0; +} + +#define MAX_ARG_BUF 512 +static const WCHAR max_int_arg_str[] = L"=-0000000000"; +static const WCHAR separator_arg_start_str[] = L"?"; +static const WCHAR separator_arg_cont_str[] = L"&"; +static const int max_separator_str_len = max(ARRAY_SIZE(separator_arg_start_str), ARRAY_SIZE(separator_arg_cont_str)); +static void osk_link_add_int_arg(struct osk_link_data *data, const WCHAR *arg, int arg_val) +{ + const WCHAR *separator_str = !data->args_count ? separator_arg_start_str : separator_arg_cont_str; + WCHAR arg_buf[MAX_ARG_BUF] = { 0 }; + int arg_buf_len; + + if ((lstrlenW(arg) + ARRAY_SIZE(max_int_arg_str)) >= MAX_ARG_BUF) + { + ERR("Arg would overflow buffer, suggest upping argument buffer size.\n"); + return; + } + + arg_buf_len = wsprintfW(arg_buf, L"%s=%d", arg, arg_val); + if ((arg_buf_len + (MAX_LINK_BUF - (data->link_buf_pos - data->link_buf)) + max_separator_str_len) >= MAX_LINK_BUF) + { + ERR("Adding another arg would overflow buffer, suggest upping link buffer size.\n"); + return; + } + + data->link_buf_pos += wsprintfW(data->link_buf_pos, L"%s%s", separator_str, arg_buf); + data->args_count++; +} + +/* + * IUIAutomationFocusChangedEventHandler vtbl. + */ +static HRESULT WINAPI FocusChangedHandler_QueryInterface(IUIAutomationFocusChangedEventHandler *iface, + REFIID riid, void **ppv) +{ + *ppv = NULL; + if (IsEqualIID(riid, &IID_IUIAutomationFocusChangedEventHandler) || IsEqualIID(riid, &IID_IUnknown)) + *ppv = iface; + else + return E_NOINTERFACE; + + IUIAutomationFocusChangedEventHandler_AddRef(iface); + return S_OK; +} + +static ULONG WINAPI FocusChangedHandler_AddRef(IUIAutomationFocusChangedEventHandler* iface) +{ + return 2; +} + +static ULONG WINAPI FocusChangedHandler_Release(IUIAutomationFocusChangedEventHandler* iface) +{ + return 1; +} + +static HRESULT WINAPI FocusChangedHandler_HandleFocusChangedEvent(IUIAutomationFocusChangedEventHandler *iface, + IUIAutomationElement *sender) +{ + BOOL is_readonly, has_kbd_focus; + struct osk_link_data link_data = { 0 }; + RECT rect = { 0 }; + BSTR name = NULL; + int control_type; + HRESULT hr; + VARIANT v; + + WINE_TRACE("sender %p\n", sender); + + /* Should never happen, handle it anyways just in case. */ + if (!sender) + return S_OK; + + hr = IUIAutomationElement_get_CachedBoundingRectangle(sender, &rect); + if (FAILED(hr)) WINE_ERR("Failed to get cached bounding rect, hr %#lx\n", hr); + + hr = IUIAutomationElement_get_CachedControlType(sender, &control_type); + if (FAILED(hr)) WINE_ERR("Failed to get cached control type, hr %#lx\n", hr); + + hr = IUIAutomationElement_get_CachedName(sender, &name); + if (FAILED(hr)) WINE_ERR("Failed to get cached name, hr %#lx\n", hr); + + hr = IUIAutomationElement_get_CachedHasKeyboardFocus(sender, &has_kbd_focus); + if (FAILED(hr)) WINE_ERR("Failed to get cached has keyboard focus property, hr %#lx\n", hr); + + VariantInit(&v); + hr = IUIAutomationElement_GetCachedPropertyValueEx(sender, UIA_ValueIsReadOnlyPropertyId, TRUE, &v); + if (FAILED(hr)) WINE_ERR("Failed to get cached property value for UIA_ValueIsReadOnlyPropertyId, hr %#lx\n", hr); + is_readonly = ((V_VT(&v) == VT_BOOL) && (V_BOOL(&v) == VARIANT_TRUE)); + VariantClear(&v); + + if (use_steam_osk && (control_type == UIA_EditControlTypeId) && has_kbd_focus && !is_readonly) + { + osk_link_init(&link_data, L"steam://open/keyboard"); + /* Requested in CW-Bug-Id: #21613. */ + if (steam_app_id) osk_link_add_int_arg(&link_data, L"AppID", steam_app_id); + if (rect.left || rect.top || rect.right || rect.bottom) + { + osk_link_add_int_arg(&link_data, L"XPosition", rect.left); + osk_link_add_int_arg(&link_data, L"YPosition", rect.top); + osk_link_add_int_arg(&link_data, L"Width", (rect.right - rect.left)); + osk_link_add_int_arg(&link_data, L"Height", (rect.bottom - rect.top)); + osk_link_add_int_arg(&link_data, L"Mode", 0); + } + + WINE_TRACE("Keyboard up!\n"); + keyboard_up = TRUE; + } + else if (keyboard_up) + { + osk_link_init(&link_data, L"steam://close/keyboard"); + /* Requested in CW-Bug-Id: #21613. */ + if (steam_app_id) osk_link_add_int_arg(&link_data, L"AppID", steam_app_id); + + WINE_TRACE("Keyboard down!\n"); + keyboard_up = FALSE; + } + + if (use_steam_osk && link_data.link_buf_pos && (link_data.link_buf_pos != link_data.link_buf)) + ShellExecuteW(NULL, NULL, link_data.link_buf, NULL, NULL, SW_SHOWNOACTIVATE); + + WINE_TRACE("name %s, control_type %d (%s), rect %s, has_kbd_focus %d, is_readonly %d\n", wine_dbgstr_w(name), + control_type, get_str_for_id(control_type, uia_control_type_id_strs), wine_dbgstr_rect(&rect), + has_kbd_focus, is_readonly); + SysFreeString(name); + + return S_OK; +} + +static const IUIAutomationFocusChangedEventHandlerVtbl FocusChangedHandlerVtbl = { + FocusChangedHandler_QueryInterface, + FocusChangedHandler_AddRef, + FocusChangedHandler_Release, + FocusChangedHandler_HandleFocusChangedEvent, +}; + +static IUIAutomationFocusChangedEventHandler FocusChangedHandler = { &FocusChangedHandlerVtbl }; + +static const int uia_cache_props[] = { UIA_BoundingRectanglePropertyId, UIA_ControlTypePropertyId, UIA_NamePropertyId, + UIA_HasKeyboardFocusPropertyId, UIA_ValueIsReadOnlyPropertyId, }; +static HRESULT add_uia_event_handler(IUIAutomation **uia_iface) +{ + IUIAutomationCacheRequest *cache_req = NULL; + IUIAutomationCondition *true_cond = NULL; + HRESULT hr; + int i; + + hr = CoCreateInstance(&CLSID_CUIAutomation8, NULL, CLSCTX_INPROC_SERVER, &IID_IUIAutomation, (void **)uia_iface); + if (FAILED(hr)) + { + ERR("Failed to create IUIAutomation interface, hr %#lx\n", hr); + return hr; + } + + hr = IUIAutomation_CreateCacheRequest(*uia_iface, &cache_req); + if (FAILED(hr)) + goto exit; + + hr = IUIAutomation_CreateTrueCondition(*uia_iface, &true_cond); + if (FAILED(hr)) + goto exit; + + hr = IUIAutomationCacheRequest_put_TreeFilter(cache_req, true_cond); + if (FAILED(hr)) + goto exit; + + for (i = 0; i < ARRAY_SIZE(uia_cache_props); i++) + { + hr = IUIAutomationCacheRequest_AddProperty(cache_req, uia_cache_props[i]); + if (FAILED(hr)) + { + ERR("Failed to add prop_id %d to cache req, hr %#lx\n", uia_cache_props[i], hr); + goto exit; + } + } + + hr = IUIAutomation_AddFocusChangedEventHandler(*uia_iface, cache_req, &FocusChangedHandler); + if (FAILED(hr)) + ERR("Failed to add focus changed event handler, hr %#lx\n", hr); + +exit: + if (cache_req) + IUIAutomationCacheRequest_Release(cache_req); + if (true_cond) + IUIAutomationCondition_Release(true_cond); + + return hr; +} + +static const char *osk_disable_appids[] = { + /* + * Both games spawn a short lived window containing an edit control + * that is never visible to the user. In order to avoid this + * triggering the OSK to popup briefly, just disable OSK auto popup + * for these games. CW-Bug-Id: #21421. + */ + "1182900", /* A Plague Tale: Requiem */ + "752590", /* A Plague Tale: Innocence */ +}; + +static void tabtip_use_osk_check(void) +{ + const char *var = getenv("SteamDeck"); + + if (var && !strcmp(var, "1")) + use_steam_osk = TRUE; + else + use_steam_osk = FALSE; + + if ((var = getenv("SteamAppId"))) + { + int i; + + for (i = 0; i < ARRAY_SIZE(osk_disable_appids); i++) + { + if (!strcmp(var, osk_disable_appids[i])) + { + WINE_TRACE("Disabling OSK auto-popup for appid %s\n", var); + use_steam_osk = FALSE; + break; + } + } + steam_app_id = strtol(var, NULL, 10); + } + + WINE_TRACE("use_steam_osk=%d\n", use_steam_osk); +} + +int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow) +{ + HANDLE wine_exit_event, started_event; + IUIAutomation *uia_iface = NULL; + WNDCLASSW wc = { }; + int ret = 0; + HWND hwnd; + + keyboard_up = FALSE; + tabtip_use_osk_check(); + + wine_exit_event = started_event = NULL; + NtSetInformationProcess( GetCurrentProcess(), ProcessWineMakeProcessSystem, + &wine_exit_event, sizeof(HANDLE *) ); + started_event = CreateEventW(NULL, TRUE, FALSE, L"TABTIP_STARTED_EVENT"); + if (!wine_exit_event || !started_event) + { + ERR("Failed to create event handles!\n"); + ret = -1; + goto exit; + } + + if (FAILED(CoInitializeEx(NULL, COINIT_MULTITHREADED))) + { + ERR("CoInitialize failed!\n"); + ret = -1; + goto exit; + } + + SetEvent(started_event); + + if (FAILED(add_uia_event_handler(&uia_iface))) + { + ret = -1; + goto exit; + } + + wc.lpfnWndProc = tabtip_win_proc; + wc.hInstance = hInstance; + wc.lpszClassName = tabtip_window_class_name; + RegisterClassW(&wc); + + hwnd = CreateWindowExW(0, tabtip_window_class_name, + L"Input", WS_OVERLAPPEDWINDOW, 4, 4, 0, 0, NULL, + NULL, hInstance, NULL); + + if (!hwnd) + { + ERR("Failed to create hwnd!\n"); + UnregisterClassW(tabtip_window_class_name, hInstance); + ret = -1; + goto exit; + } + + while (MsgWaitForMultipleObjects(1, &wine_exit_event, FALSE, INFINITE, QS_ALLINPUT) != WAIT_OBJECT_0) + { + BOOL quit = FALSE; + MSG msg; + + while (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE)) + { + switch (msg.message) + { + case WM_QUIT: /* Unlikely to ever happen, but handle anyways. */ + quit = TRUE; + break; + + default: + TranslateMessage(&msg); + DispatchMessageW(&msg); + break; + } + } + + if (quit) + break; + } + +exit: + if (uia_iface) + { + IUIAutomation_RemoveAllEventHandlers(uia_iface); + IUIAutomation_Release(uia_iface); + } + + CoUninitialize(); + if (wine_exit_event) CloseHandle(wine_exit_event); + if (started_event) CloseHandle(started_event); + + return ret; +} From 3da66bfb44471fc8474c6ac8f1d76635ca86c867 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 13 Dec 2024 07:22:31 -0500 Subject: [PATCH 0899/2542] explorer: Start tabtip process before the main loop. CW-Bug-Id: #18351 CW-Bug-Id: #19584 --- programs/explorer/desktop.c | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index e0b57a4b37ff..bde0fd14ad28 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -1193,6 +1193,38 @@ static void set_shell_window( HWND hwnd ) SetShellWindow( hwnd ); } +static HANDLE start_tabtip_process(void) +{ + static const WCHAR tabtip_started_event[] = L"TABTIP_STARTED_EVENT"; + PROCESS_INFORMATION pi; + STARTUPINFOW si = { sizeof(si) }; + HANDLE wait_handles[2]; + + if (!CreateProcessW(L"C:\\windows\\system32\\tabtip.exe", NULL, + NULL, NULL, TRUE, DETACHED_PROCESS, NULL, NULL, &si, &pi)) + { + WINE_ERR("Couldn't start tabtip.exe: error %lu\n", GetLastError()); + return FALSE; + } + CloseHandle(pi.hThread); + + wait_handles[0] = CreateEventW(NULL, TRUE, FALSE, tabtip_started_event); + wait_handles[1] = pi.hProcess; + + /* wait for the event to become available or the process to exit */ + if ((WaitForMultipleObjects(2, wait_handles, FALSE, INFINITE)) == WAIT_OBJECT_0 + 1) + { + DWORD exit_code; + GetExitCodeProcess(pi.hProcess, &exit_code); + WINE_ERR("Unexpected termination of tabtip.exe - exit code %ld\n", exit_code); + CloseHandle(wait_handles[0]); + return pi.hProcess; + } + + CloseHandle(wait_handles[0]); + return pi.hProcess; +} + /* main desktop management function */ void manage_desktop( WCHAR *arg ) { @@ -1210,6 +1242,7 @@ void manage_desktop( WCHAR *arg ) HANDLE thread; DWORD id; NTSTATUS status; + HANDLE tabtip = NULL; /* get the rest of the command line (if any) */ while (*p && !is_whitespace(*p)) p++; @@ -1326,6 +1359,9 @@ void manage_desktop( WCHAR *arg ) /* run the desktop message loop */ if (hwnd) { + /* FIXME: hack, run tabtip.exe on startup. */ + tabtip = start_tabtip_process(); + TRACE( "desktop message loop starting on hwnd %p\n", hwnd ); while (GetMessageW( &msg, 0, 0, 0 )) DispatchMessageW( &msg ); TRACE( "desktop message loop exiting for hwnd %p\n", hwnd ); @@ -1333,6 +1369,13 @@ void manage_desktop( WCHAR *arg ) if (pShellDDEInit) pShellDDEInit( FALSE ); + if (tabtip) + { + TerminateProcess( tabtip, 0 ); + WaitForSingleObject( tabtip, INFINITE ); + CloseHandle( tabtip ); + } + ExitProcess( 0 ); } From 10b794158c5ec1b33102dadedd3806f76a5bffa4 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 13 Dec 2024 08:47:22 -0500 Subject: [PATCH 0900/2542] win32u: Send EVENT_OBJECT_FOCUS in even more cases. CW-Bug-Id: #18351 --- dlls/win32u/input.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 379023b5f3d3..f8d30d494c73 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -1853,7 +1853,7 @@ BOOL release_capture(void) * * Change the focus window, sending the WM_SETFOCUS and WM_KILLFOCUS messages */ -static HWND set_focus_window( HWND hwnd, BOOL force ) +static HWND set_focus_window( HWND hwnd, BOOL from_active, BOOL force ) { HWND previous = 0, ime_hwnd; BOOL ret; @@ -1871,6 +1871,8 @@ static HWND set_focus_window( HWND hwnd, BOOL force ) if (previous) { + if (!NtUserIsWindow(hwnd) && !from_active) + NtUserNotifyWinEvent( EVENT_OBJECT_FOCUS, previous, OBJID_CLIENT, CHILDID_SELF ); send_message( previous, WM_KILLFOCUS, (WPARAM)hwnd, 0 ); ime_hwnd = get_default_ime_window( previous ); @@ -1889,7 +1891,8 @@ static HWND set_focus_window( HWND hwnd, BOOL force ) send_message( ime_hwnd, WM_IME_INTERNAL, IME_INTERNAL_ACTIVATE, HandleToUlong(hwnd) ); - NtUserNotifyWinEvent( EVENT_OBJECT_FOCUS, hwnd, OBJID_CLIENT, 0 ); + if (!from_active) + NtUserNotifyWinEvent( EVENT_OBJECT_FOCUS, hwnd, OBJID_CLIENT, 0 ); send_message( hwnd, WM_SETFOCUS, (WPARAM)previous, 0 ); } @@ -2003,7 +2006,7 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new if (hwnd == info.hwndActive) { if (!info.hwndFocus || !hwnd || NtUserGetAncestor( info.hwndFocus, GA_ROOT ) != hwnd) - set_focus_window( hwnd, FALSE ); + set_focus_window( hwnd, TRUE, FALSE ); } } @@ -2098,7 +2101,7 @@ HWND WINAPI NtUserSetFocus( HWND hwnd ) } /* change focus and send messages */ - return set_focus_window( hwnd, hwnd != previous ); + return set_focus_window( hwnd, FALSE, hwnd != previous ); } /******************************************************************* From 9a42c1cd56fcf7b68675136c8897ed30a4d6c991 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 23 Oct 2024 06:45:37 -0400 Subject: [PATCH 0901/2542] d3dx9/tests: Add some more tests for saving surfaces as targa files. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/tests/surface.c | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 80343934cea7..e6a7d490ac3a 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -3852,6 +3852,11 @@ static void test_D3DXSaveSurfaceToFileInMemory(IDirect3DDevice9 *device) struct dds_header header; BYTE *data; } *dds; + struct + { + struct tga_header header; + BYTE *data; + } *tga; IDirect3DSurface9 *surface; IDirect3DTexture9 *texture; unsigned int i, x, y; @@ -3934,6 +3939,39 @@ static void test_D3DXSaveSurfaceToFileInMemory(IDirect3DDevice9 *device) &d3dfmt_a8r8g8b8_pf, DDSCAPS_TEXTURE | DDSCAPS_ALPHA, 0, FALSE); ID3DXBuffer_Release(buffer); + /* Test saved targa file headers. */ + hr = D3DXSaveSurfaceToFileInMemory(&buffer, D3DXIFF_TGA, surface, NULL, NULL); + todo_wine ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + tga = ID3DXBuffer_GetBufferPointer(buffer); + ok(ID3DXBuffer_GetBufferSize(buffer) == (sizeof(tga->header) + tga->header.id_length + (4 * 4 * 4)), "Unexpected buffer size %lu.\n", + ID3DXBuffer_GetBufferSize(buffer)); + ok(tga->header.image_type == IMAGETYPE_TRUECOLOR, "Got unexpected image type %u.\n", tga->header.image_type); + ok(tga->header.height == 4, "Got unexpected height %u.\n", tga->header.height); + ok(tga->header.width == 4, "Got unexpected width %u.\n", tga->header.width); + ok(tga->header.depth == 32, "Got unexpected depth %u.\n", tga->header.depth); + ok(tga->header.image_descriptor == (IMAGE_TOPTOBOTTOM | 0x8), "Got unexpected image descriptor %#x.\n", tga->header.image_descriptor); + ID3DXBuffer_Release(buffer); + } + + /* Size 0 rectangle. */ + SetRectEmpty(&rect); + hr = D3DXSaveSurfaceToFileInMemory(&buffer, D3DXIFF_TGA, surface, NULL, &rect); + todo_wine ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + tga = ID3DXBuffer_GetBufferPointer(buffer); + ok(ID3DXBuffer_GetBufferSize(buffer) == (sizeof(tga->header) + tga->header.id_length), "Unexpected buffer size %lu.\n", + ID3DXBuffer_GetBufferSize(buffer)); + ok(tga->header.image_type == IMAGETYPE_TRUECOLOR, "Got unexpected image type %u.\n", tga->header.image_type); + ok(!tga->header.height, "Got unexpected height %u.\n", tga->header.height); + ok(!tga->header.width, "Got unexpected width %u.\n", tga->header.width); + ok(tga->header.depth == 32, "Got unexpected depth %u.\n", tga->header.depth); + ok(tga->header.image_descriptor == (IMAGE_TOPTOBOTTOM | 0x8), "Got unexpected image descriptor %#x.\n", tga->header.image_descriptor); + ID3DXBuffer_Release(buffer); + } + IDirect3DSurface9_Release(surface); for (i = 0; i < ARRAY_SIZE(test_access_types); ++i) From 379be544930b028776dc388007fe1ab61a5ec5d0 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Tue, 29 Oct 2024 15:46:56 -0400 Subject: [PATCH 0902/2542] d3dx9/tests: Add a test for saving a surface as D3DXIFF_DIB. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/tests/surface.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index e6a7d490ac3a..31f09cb06004 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -3857,10 +3857,11 @@ static void test_D3DXSaveSurfaceToFileInMemory(IDirect3DDevice9 *device) struct tga_header header; BYTE *data; } *tga; + ID3DXBuffer *buffer, *buffer2; IDirect3DSurface9 *surface; IDirect3DTexture9 *texture; unsigned int i, x, y; - ID3DXBuffer *buffer; + D3DXIMAGE_INFO info; HRESULT hr; RECT rect; @@ -3972,6 +3973,26 @@ static void test_D3DXSaveSurfaceToFileInMemory(IDirect3DDevice9 *device) ID3DXBuffer_Release(buffer); } + /* Saving as D3DXIFF_DIB actually saves as a BMP. */ + hr = D3DXSaveSurfaceToFileInMemory(&buffer, D3DXIFF_DIB, surface, NULL, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + + hr = D3DXSaveSurfaceToFileInMemory(&buffer2, D3DXIFF_BMP, surface, NULL, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + + hr = D3DXGetImageInfoFromFileInMemory(ID3DXBuffer_GetBufferPointer(buffer), ID3DXBuffer_GetBufferSize(buffer), &info); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + todo_wine ok(info.ImageFileFormat == D3DXIFF_BMP, "Unexpected ImageFileFormat %d.\n", info.ImageFileFormat); + todo_wine ok(ID3DXBuffer_GetBufferSize(buffer) == ID3DXBuffer_GetBufferSize(buffer2), "Unexpected buffer size.\n"); + if (ID3DXBuffer_GetBufferSize(buffer) == ID3DXBuffer_GetBufferSize(buffer2)) + { + ok(!memcmp(ID3DXBuffer_GetBufferPointer(buffer), ID3DXBuffer_GetBufferPointer(buffer2), ID3DXBuffer_GetBufferSize(buffer)), + "Files do not match.\n"); + } + + ID3DXBuffer_Release(buffer); + ID3DXBuffer_Release(buffer2); + IDirect3DSurface9_Release(surface); for (i = 0; i < ARRAY_SIZE(test_access_types); ++i) From 253961db1e120f98243b2ab10bd9466be163a3fe Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Tue, 15 Oct 2024 09:26:11 -0400 Subject: [PATCH 0903/2542] d3dx9/tests: Add tests for saving surfaces to non-DDS files. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/tests/surface.c | 644 ++++++++++++++++++++++++++++++++++ 1 file changed, 644 insertions(+) diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 31f09cb06004..84306966b6d4 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -3826,6 +3826,649 @@ static void test_save_surface_to_dds(IDirect3DDevice9 *device) } } +static BOOL is_dxt_d3dformat(D3DFORMAT fmt) +{ + return (fmt & 0x00ffffff) == MAKEFOURCC('D','X','T',0); +} + +static void test_save_surface_iffs(IDirect3DDevice9 *device) +{ + static const D3DXIMAGE_FILEFORMAT test_iff[] = { D3DXIFF_BMP, D3DXIFF_JPG, D3DXIFF_TGA, D3DXIFF_PNG, + D3DXIFF_PPM, D3DXIFF_DIB, D3DXIFF_HDR, D3DXIFF_PFM }; + static const char *test_iff_str[] = { "D3DXIFF_BMP", "D3DXIFF_JPG", "D3DXIFF_TGA", "D3DXIFF_PNG", + "D3DXIFF_PPM", "D3DXIFF_DIB", "D3DXIFF_HDR", "D3DXIFF_PFM" }; + static const struct + { + D3DFORMAT format; + const PALETTEENTRY *palette; + struct + { + HRESULT hr; + D3DFORMAT format; + BOOL todo_hr; + BOOL todo_format; + } + iff_expected[8]; + uint8_t init_pixel_value; + } iff_tests[] = { + { D3DFMT_P8, test_palette, + { { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_A8P8, test_palette, + { { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_P8, NULL, + { { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_A8P8, NULL, + { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_A8P8, NULL, + { { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, 0xff + }, + { D3DFMT_R8G8B8, NULL, + { { D3D_OK, D3DFMT_R8G8B8, }, + { D3D_OK, D3DFMT_X8R8G8B8 }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + /* + * We don't match formats here because we encode our BMP headers + * differently. Native encodes with the same header as + * D3DFMT_X8R8G8B8, it just sets the values in the alpha channel. The + * format is distinguished by checking the image. We encode a bitmap + * V4 header with a dedicated alpha mask, so we'll always report + * D3DFMT_A8R8G8B8, regardless of whether or not any alpha channel + * values are non-zero. + */ + { D3DFMT_A8R8G8B8, NULL, + { { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + /* + * Same as decoding for BMP/DIB, if the alpha channel is set to a + * non-zero value on any pixel we get a different format. + */ + { D3DFMT_A8R8G8B8, NULL, + { { D3D_OK, D3DFMT_A8R8G8B8 }, + { D3D_OK, D3DFMT_X8R8G8B8 }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, 0xff + }, + { D3DFMT_X8R8G8B8, NULL, + { { D3D_OK, D3DFMT_X8R8G8B8, }, + { D3D_OK, D3DFMT_X8R8G8B8 }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + /* + * Unlike D3DFMT_A8R8G8B8, even if the alpha channel is all 0, + * D3DFMT_A8B8G8R8 doesn't get replaced with D3DFMT_X8B8G8R8 + * for BMP/DIB. + */ + { D3DFMT_A8B8G8R8, NULL, + { { D3D_OK, D3DFMT_A8B8G8R8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8B8G8R8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_X8B8G8R8, NULL, + { { D3D_OK, D3DFMT_X8B8G8R8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8B8G8R8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_R5G6B5, NULL, + { { D3D_OK, D3DFMT_R5G6B5, }, + { D3D_OK, D3DFMT_X8R8G8B8 }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R5G6B5, }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_X1R5G5B5, NULL, + { { D3D_OK, D3DFMT_X1R5G5B5, }, + { D3D_OK, D3DFMT_X8R8G8B8 }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X1R5G5B5, }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_A1R5G5B5, NULL, + { { D3D_OK, D3DFMT_A1R5G5B5, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A1R5G5B5, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_R3G3B2, NULL, + { { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_A8R3G3B2, NULL, + { { D3D_OK, D3DFMT_A8R3G3B2, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R3G3B2, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_A4R4G4B4, NULL, + { { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_X4R4G4B4, NULL, + { { D3D_OK, D3DFMT_X4R4G4B4, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X4R4G4B4, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_A2R10G10B10, NULL, + { { D3D_OK, D3DFMT_A2R10G10B10, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A2R10G10B10, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_A2B10G10R10, NULL, + { { D3D_OK, D3DFMT_A2B10G10R10, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A2B10G10R10, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_A16B16G16R16, NULL, + { { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16 }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_G16R16, NULL, + { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_A8, NULL, + { { D3D_OK, D3DFMT_A8R3G3B2, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R3G3B2, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_A8L8, NULL, + { { D3D_OK, D3DFMT_A8L8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8L8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_A4L4, NULL, + { { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + /* + * For BMP/DIB, this ends up as a paletted bitmap file where the + * palette consists of RGB values of 0x00->0xff. Essentially, the luma + * value acts as an index into this palette. Weird that there are L16 + * and A8L8 representations, but this is done in a unique way. + */ + { D3DFMT_L8, NULL, + { { D3D_OK, D3DFMT_P8, .todo_format = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_P8, .todo_format = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_L16, NULL, + { { D3D_OK, D3DFMT_L16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_L16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_DXT1, NULL, + { { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_DXT2, NULL, + { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_DXT2, NULL, + { { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, 0xff + }, + { D3DFMT_DXT3, NULL, + { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_DXT4, NULL, + { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_DXT5, NULL, + { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_R16F, NULL, + { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_G16R16F, NULL, + { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_A16B16G16R16F, NULL, + { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_R32F, NULL, + { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_G32R32F, NULL, + { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_A32B32G32R32F, NULL, + { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_Q8W8V8U8, NULL, + { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + }, + }, + { D3DFMT_V8U8, NULL, + { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + }, + }, + { D3DFMT_V16U16, NULL, + { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + }, + }, + { D3DFMT_X8L8V8U8, NULL, + { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + }, + }, + { D3DFMT_A2W10V10U10, NULL, + { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + }, + }, + { D3DFMT_Q16W16V16U16, NULL, + { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + }, + }, + { D3DFMT_R8G8_B8G8, NULL, + { { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_G8R8_G8B8, NULL, + { { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_UYVY, NULL, + { { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + { D3DFMT_YUY2, NULL, + { { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, + }, + }, + }; + IDirect3DSurface9 *surface; + ID3DXBuffer *buffer; + uint32_t i, j; + HRESULT hr; + + for (i = 0; i < ARRAY_SIZE(iff_tests); ++i) + { + D3DLOCKED_RECT lockrect; + + hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 4, 4, iff_tests[i].format, + D3DPOOL_SCRATCH, &surface, NULL); + if (FAILED(hr)) + { + skip("Couldn't create surface for format %#x.\n", iff_tests[i].format); + continue; + } + + hr = IDirect3DSurface9_LockRect(surface, &lockrect, NULL, 0); + if (SUCCEEDED(hr)) + { + const uint32_t tmp_height = is_dxt_d3dformat(iff_tests[i].format) ? 1 : 4; + + for (j = 0; j < tmp_height; ++j) + memset(((uint8_t *)lockrect.pBits) + (j * lockrect.Pitch), iff_tests[i].init_pixel_value, lockrect.Pitch); + IDirect3DSurface9_UnlockRect(surface); + } + + winetest_push_context("Test %u (%s)", i, debug_d3dformat(iff_tests[i].format)); + for (j = 0; j < ARRAY_SIZE(test_iff); ++j) + { + winetest_push_context("File format %u (%s)", j, test_iff_str[j]); + + buffer = NULL; + hr = D3DXSaveSurfaceToFileInMemory(&buffer, test_iff[j], surface, iff_tests[i].palette, NULL); + todo_wine_if(iff_tests[i].iff_expected[j].todo_hr) ok(hr == iff_tests[i].iff_expected[j].hr, "Unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + D3DXIMAGE_INFO info = { 0 }; + + hr = D3DXGetImageInfoFromFileInMemory(ID3DXBuffer_GetBufferPointer(buffer), ID3DXBuffer_GetBufferSize(buffer), &info); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + todo_wine_if(iff_tests[i].iff_expected[j].todo_format) ok(info.Format == iff_tests[i].iff_expected[j].format, + "Unexpected image format %u (%s), expected %u (%s).\n", info.Format, debug_d3dformat(info.Format), + iff_tests[i].iff_expected[j].format, debug_d3dformat(iff_tests[i].iff_expected[j].format)); + ID3DXBuffer_Release(buffer); + } + winetest_pop_context(); + } + + IDirect3DSurface9_Release(surface); + winetest_pop_context(); + } +} + static void test_D3DXSaveSurfaceToFileInMemory(IDirect3DDevice9 *device) { static const struct dds_pixel_format d3dfmt_a8r8g8b8_pf = { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, @@ -4017,6 +4660,7 @@ static void test_D3DXSaveSurfaceToFileInMemory(IDirect3DDevice9 *device) } test_save_surface_to_dds(device); + test_save_surface_iffs(device); } static void test_D3DXSaveSurfaceToFile(IDirect3DDevice9 *device) From 1a150957830af5037a6e75f6534dfea91e4df07f Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Tue, 29 Oct 2024 16:11:05 -0400 Subject: [PATCH 0904/2542] d3dx9: Add basic support for saving surfaces to targa files. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/surface.c | 146 ++++++++++++++++++++++++---------- dlls/d3dx9_36/tests/surface.c | 59 +++++++------- 2 files changed, 131 insertions(+), 74 deletions(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 9d2dc96a9791..3f56afd0c8b8 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -153,6 +153,34 @@ struct dds_header DWORD reserved2; }; +#define IMAGETYPE_COLORMAPPED 1 +#define IMAGETYPE_TRUECOLOR 2 +#define IMAGETYPE_GRAYSCALE 3 +#define IMAGETYPE_MASK 0x07 +#define IMAGETYPE_RLE 8 + +#define IMAGE_RIGHTTOLEFT 0x10 +#define IMAGE_TOPTOBOTTOM 0x20 + +#include "pshpack1.h" +struct tga_header +{ + uint8_t id_length; + uint8_t color_map_type; + uint8_t image_type; + uint16_t color_map_firstentry; + uint16_t color_map_length; + uint8_t color_map_entrysize; + uint16_t xorigin; + uint16_t yorigin; + uint16_t width; + uint16_t height; + uint8_t depth; + uint8_t image_descriptor; +}; +#include "poppack.h" + + HRESULT lock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, D3DLOCKED_RECT *lock, IDirect3DSurface9 **temp_surface, BOOL write) { @@ -465,6 +493,26 @@ static uint32_t d3dx_calculate_layer_pixels_size(enum d3dx_pixel_format_id forma return layer_size; } +static const enum d3dx_pixel_format_id tga_save_pixel_formats[] = +{ + D3DX_PIXEL_FORMAT_B8G8R8_UNORM, + D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM +}; + +static BOOL d3dx_pixel_format_id_array_contains(const enum d3dx_pixel_format_id *format_ids, uint32_t format_ids_size, + enum d3dx_pixel_format_id format) +{ + unsigned int i; + + for (i = 0; i < format_ids_size; ++i) + { + if (format_ids[i] == format) + return TRUE; + } + + return FALSE; +} + static HRESULT d3dx_init_dds_header(struct dds_header *header, D3DRESOURCETYPE resource_type, enum d3dx_pixel_format_id format, const struct volume *size, uint32_t mip_levels) { @@ -502,22 +550,40 @@ static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const HRESULT hr; *dst_buffer = NULL; + dst_format = src_fmt_desc->format; switch (file_format) { case D3DXIFF_DDS: - { - struct dds_header *header; - uint32_t header_size; - hr = dds_pixel_format_from_d3dx_pixel_format_id(NULL, dst_format); if (FAILED(hr)) return hr; + break; - dst_fmt_desc = get_d3dx_pixel_format_info(dst_format); - hr = d3dx_calculate_pixels_size(dst_format, src_pixels->size.width, src_pixels->size.height, &dst_row_pitch, - &dst_slice_pitch); - if (FAILED(hr)) - return hr; + case D3DXIFF_TGA: + if (!d3dx_pixel_format_id_array_contains(tga_save_pixel_formats, ARRAY_SIZE(tga_save_pixel_formats), dst_format)) + { + FIXME("Format replacement for TGA files is currently unimplemented.\n"); + return E_NOTIMPL; + } + break; + + default: + assert(0 && "Unexpected file format."); + return E_FAIL; + } + + dst_fmt_desc = get_d3dx_pixel_format_info(dst_format); + hr = d3dx_calculate_pixels_size(dst_format, src_pixels->size.width, src_pixels->size.height, &dst_row_pitch, + &dst_slice_pitch); + if (FAILED(hr)) + return hr; + + switch (file_format) + { + case D3DXIFF_DDS: + { + struct dds_header *header; + uint32_t header_size; header_size = is_index_format(dst_fmt_desc) ? sizeof(*header) + DDS_PALETTE_SIZE : sizeof(*header); hr = D3DXCreateBuffer(dst_slice_pitch + header_size, &buffer); @@ -535,9 +601,30 @@ static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const break; } + case D3DXIFF_TGA: + { + struct tga_header *header; + + hr = D3DXCreateBuffer(dst_slice_pitch + sizeof(*header), &buffer); + if (FAILED(hr)) + return hr; + + header = ID3DXBuffer_GetBufferPointer(buffer); + pixels = (uint8_t *)ID3DXBuffer_GetBufferPointer(buffer) + sizeof(*header); + + memset(header, 0, sizeof(*header)); + header->image_type = IMAGETYPE_TRUECOLOR; + header->width = src_pixels->size.width; + header->height = src_pixels->size.height; + header->image_descriptor = IMAGE_TOPTOBOTTOM; + header->depth = dst_fmt_desc->bytes_per_pixel * 8; + if (dst_fmt_desc->format == D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM) + header->image_descriptor |= 0x08; + break; + } + default: - assert(0 && "Unexpected file format."); - return E_FAIL; + break; } if (src_pixels->size.width != 0 && src_pixels->size.height != 0) @@ -559,8 +646,8 @@ static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const return hr; } -static HRESULT save_dds_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSurface9 *src_surface, - const PALETTEENTRY *src_palette, const RECT *src_rect) +static HRESULT save_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSurface9 *src_surface, + const PALETTEENTRY *src_palette, const RECT *src_rect, D3DXIMAGE_FILEFORMAT file_format) { const struct pixel_format_desc *src_fmt_desc; D3DSURFACE_DESC src_surface_desc; @@ -610,7 +697,7 @@ static HRESULT save_dds_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSur return hr; } - hr = d3dx_save_pixels_to_memory(&src_pixels, src_fmt_desc, D3DXIFF_DDS, &buffer); + hr = d3dx_save_pixels_to_memory(&src_pixels, src_fmt_desc, file_format, &buffer); if (FAILED(hr)) { unlock_surface(src_surface, NULL, temp_surface, FALSE); @@ -1085,33 +1172,6 @@ static enum d3dx_pixel_format_id d3dx_get_tga_format_for_bpp(uint8_t bpp) } } -#define IMAGETYPE_COLORMAPPED 1 -#define IMAGETYPE_TRUECOLOR 2 -#define IMAGETYPE_GRAYSCALE 3 -#define IMAGETYPE_MASK 0x07 -#define IMAGETYPE_RLE 8 - -#define IMAGE_RIGHTTOLEFT 0x10 -#define IMAGE_TOPTOBOTTOM 0x20 - -#include "pshpack1.h" -struct tga_header -{ - uint8_t id_length; - uint8_t color_map_type; - uint8_t image_type; - uint16_t color_map_firstentry; - uint16_t color_map_length; - uint8_t color_map_entrysize; - uint16_t xorigin; - uint16_t yorigin; - uint16_t width; - uint16_t height; - uint8_t depth; - uint8_t image_descriptor; -}; -#include "poppack.h" - static HRESULT d3dx_image_tga_rle_decode_row(const uint8_t **src, uint32_t src_bytes_left, uint32_t row_width, uint32_t bytes_per_pixel, uint8_t *dst_row) { @@ -2993,10 +3053,10 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE container_format = &GUID_ContainerFormatJpeg; break; case D3DXIFF_DDS: - return save_dds_surface_to_memory(dst_buffer, src_surface, src_palette, src_rect); + case D3DXIFF_TGA: + return save_surface_to_memory(dst_buffer, src_surface, src_palette, src_rect, file_format); case D3DXIFF_HDR: case D3DXIFF_PFM: - case D3DXIFF_TGA: case D3DXIFF_PPM: FIXME("File format %#x is not supported yet\n", file_format); return E_NOTIMPL; diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 84306966b6d4..fbcb963df3a3 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -3909,7 +3909,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_R8G8B8, NULL, { { D3D_OK, D3DFMT_R8G8B8, }, { D3D_OK, D3DFMT_X8R8G8B8 }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_R8G8B8, }, @@ -3929,7 +3929,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A8R8G8B8, NULL, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, @@ -3944,7 +3944,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A8R8G8B8, NULL, { { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, @@ -4585,36 +4585,32 @@ static void test_D3DXSaveSurfaceToFileInMemory(IDirect3DDevice9 *device) /* Test saved targa file headers. */ hr = D3DXSaveSurfaceToFileInMemory(&buffer, D3DXIFF_TGA, surface, NULL, NULL); - todo_wine ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); - if (SUCCEEDED(hr)) - { - tga = ID3DXBuffer_GetBufferPointer(buffer); - ok(ID3DXBuffer_GetBufferSize(buffer) == (sizeof(tga->header) + tga->header.id_length + (4 * 4 * 4)), "Unexpected buffer size %lu.\n", - ID3DXBuffer_GetBufferSize(buffer)); - ok(tga->header.image_type == IMAGETYPE_TRUECOLOR, "Got unexpected image type %u.\n", tga->header.image_type); - ok(tga->header.height == 4, "Got unexpected height %u.\n", tga->header.height); - ok(tga->header.width == 4, "Got unexpected width %u.\n", tga->header.width); - ok(tga->header.depth == 32, "Got unexpected depth %u.\n", tga->header.depth); - ok(tga->header.image_descriptor == (IMAGE_TOPTOBOTTOM | 0x8), "Got unexpected image descriptor %#x.\n", tga->header.image_descriptor); - ID3DXBuffer_Release(buffer); - } + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + + tga = ID3DXBuffer_GetBufferPointer(buffer); + ok(ID3DXBuffer_GetBufferSize(buffer) == (sizeof(tga->header) + tga->header.id_length + (4 * 4 * 4)), "Unexpected buffer size %lu.\n", + ID3DXBuffer_GetBufferSize(buffer)); + ok(tga->header.image_type == IMAGETYPE_TRUECOLOR, "Got unexpected image type %u.\n", tga->header.image_type); + ok(tga->header.height == 4, "Got unexpected height %u.\n", tga->header.height); + ok(tga->header.width == 4, "Got unexpected width %u.\n", tga->header.width); + ok(tga->header.depth == 32, "Got unexpected depth %u.\n", tga->header.depth); + ok(tga->header.image_descriptor == (IMAGE_TOPTOBOTTOM | 0x8), "Got unexpected image descriptor %#x.\n", tga->header.image_descriptor); + ID3DXBuffer_Release(buffer); /* Size 0 rectangle. */ SetRectEmpty(&rect); hr = D3DXSaveSurfaceToFileInMemory(&buffer, D3DXIFF_TGA, surface, NULL, &rect); - todo_wine ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); - if (SUCCEEDED(hr)) - { - tga = ID3DXBuffer_GetBufferPointer(buffer); - ok(ID3DXBuffer_GetBufferSize(buffer) == (sizeof(tga->header) + tga->header.id_length), "Unexpected buffer size %lu.\n", - ID3DXBuffer_GetBufferSize(buffer)); - ok(tga->header.image_type == IMAGETYPE_TRUECOLOR, "Got unexpected image type %u.\n", tga->header.image_type); - ok(!tga->header.height, "Got unexpected height %u.\n", tga->header.height); - ok(!tga->header.width, "Got unexpected width %u.\n", tga->header.width); - ok(tga->header.depth == 32, "Got unexpected depth %u.\n", tga->header.depth); - ok(tga->header.image_descriptor == (IMAGE_TOPTOBOTTOM | 0x8), "Got unexpected image descriptor %#x.\n", tga->header.image_descriptor); - ID3DXBuffer_Release(buffer); - } + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + + tga = ID3DXBuffer_GetBufferPointer(buffer); + ok(ID3DXBuffer_GetBufferSize(buffer) == (sizeof(tga->header) + tga->header.id_length), "Unexpected buffer size %lu.\n", + ID3DXBuffer_GetBufferSize(buffer)); + ok(tga->header.image_type == IMAGETYPE_TRUECOLOR, "Got unexpected image type %u.\n", tga->header.image_type); + ok(!tga->header.height, "Got unexpected height %u.\n", tga->header.height); + ok(!tga->header.width, "Got unexpected width %u.\n", tga->header.width); + ok(tga->header.depth == 32, "Got unexpected depth %u.\n", tga->header.depth); + ok(tga->header.image_descriptor == (IMAGE_TOPTOBOTTOM | 0x8), "Got unexpected image descriptor %#x.\n", tga->header.image_descriptor); + ID3DXBuffer_Release(buffer); /* Saving as D3DXIFF_DIB actually saves as a BMP. */ hr = D3DXSaveSurfaceToFileInMemory(&buffer, D3DXIFF_DIB, surface, NULL, NULL); @@ -4738,10 +4734,11 @@ static void test_D3DXSaveSurfaceToFile(IDirect3DDevice9 *device) { hr = D3DXSaveSurfaceToFileA("saved_surface.ppm", D3DXIFF_PPM, surface, NULL, NULL); ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); - hr = D3DXSaveSurfaceToFileA("saved_surface.tga", D3DXIFF_TGA, surface, NULL, NULL); - ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); } + hr = D3DXSaveSurfaceToFileA("saved_surface.tga", D3DXIFF_TGA, surface, NULL, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + hr = D3DXSaveSurfaceToFileA("saved_surface.dds", D3DXIFF_DDS, surface, NULL, NULL); ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); From 24460d434c4134de4668b361a48679e06add6880 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Mon, 9 Dec 2024 10:11:23 -0500 Subject: [PATCH 0905/2542] d3dx9: Add support for selecting a replacement pixel format to save surfaces to files. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/surface.c | 170 +++++++++++++++++++++++++++------- dlls/d3dx9_36/tests/surface.c | 78 ++++++++-------- 2 files changed, 176 insertions(+), 72 deletions(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 3f56afd0c8b8..367c3befb78a 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -513,6 +513,128 @@ static BOOL d3dx_pixel_format_id_array_contains(const enum d3dx_pixel_format_id return FALSE; } +static enum d3dx_pixel_format_id get_replacement_d3dx_pixel_format_id(enum d3dx_pixel_format_id format) +{ + switch (format) + { + case D3DX_PIXEL_FORMAT_P8_UINT: + case D3DX_PIXEL_FORMAT_P8_UINT_A8_UNORM: + case D3DX_PIXEL_FORMAT_DXT1_UNORM: + case D3DX_PIXEL_FORMAT_DXT2_UNORM: + case D3DX_PIXEL_FORMAT_DXT3_UNORM: + case D3DX_PIXEL_FORMAT_DXT4_UNORM: + case D3DX_PIXEL_FORMAT_DXT5_UNORM: + return D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM; + + default: + break; + } + + return format; +} + +static enum d3dx_pixel_format_id d3dx_get_closest_d3dx_pixel_format_id(const enum d3dx_pixel_format_id *format_ids, + uint32_t format_ids_size, enum d3dx_pixel_format_id format_id) +{ + const struct pixel_format_desc *fmt, *curfmt, *bestfmt = NULL; + int32_t bestscore = INT_MIN, i = 0, j; + int32_t rgb_channels, a_channel; + BOOL alpha_only, rgb_only; + + TRACE("Requested format is not directly supported, looking for the best alternative.\n"); + + fmt = get_d3dx_pixel_format_info(get_replacement_d3dx_pixel_format_id(format_id)); + alpha_only = rgb_only = FALSE; + if (fmt->a_type != CTYPE_EMPTY && fmt->rgb_type == CTYPE_EMPTY) + alpha_only = TRUE; + else if (fmt->a_type == CTYPE_EMPTY && fmt->rgb_type != CTYPE_EMPTY) + rgb_only = TRUE; + + if (fmt->rgb_type == CTYPE_LUMA) + rgb_channels = 3; + else + rgb_channels = !!fmt->bits[1] + !!fmt->bits[2] + !!fmt->bits[3]; + a_channel = !!fmt->bits[0]; + for (i = 0; i < format_ids_size; ++i) + { + int32_t cur_rgb_channels, cur_a_channel; + int32_t score; + + curfmt = get_d3dx_pixel_format_info(format_ids[i]); + if (!is_conversion_to_supported(curfmt)) + continue; + if (alpha_only && curfmt->a_type == CTYPE_EMPTY) + continue; + if (rgb_only && curfmt->rgb_type == CTYPE_EMPTY) + continue; + if (fmt->rgb_type == CTYPE_SNORM && curfmt->rgb_type != CTYPE_SNORM) + continue; + + cur_rgb_channels = !!curfmt->bits[1] + !!curfmt->bits[2] + !!curfmt->bits[3]; + cur_a_channel = !!curfmt->bits[0]; + /* This format can be used, let's evaluate it. + Weights chosen quite arbitrarily... */ + score = 512 * (format_types_match(curfmt, fmt)); + score -= 32 * abs(cur_a_channel - a_channel); + score -= 32 * abs(cur_rgb_channels - rgb_channels); + for (j = 0; j < 4; j++) + { + int diff = curfmt->bits[j] - fmt->bits[j]; + score -= (diff < 0 ? -diff * 8 : diff) * (j == 0 ? 1 : 2); + } + + if (score > bestscore) + { + bestscore = score; + bestfmt = curfmt; + } + } + + return (bestfmt) ? bestfmt->format : D3DX_PIXEL_FORMAT_COUNT; +} + +static HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pixel_format_desc *src_fmt_desc, + D3DXIMAGE_FILEFORMAT file_format, enum d3dx_pixel_format_id *save_fmt) +{ + HRESULT hr; + + switch (file_format) + { + case D3DXIFF_DDS: + hr = dds_pixel_format_from_d3dx_pixel_format_id(NULL, src_fmt_desc->format); + if (FAILED(hr)) + return hr; + *save_fmt = src_fmt_desc->format; + break; + + case D3DXIFF_TGA: + if (d3dx_pixel_format_id_array_contains(tga_save_pixel_formats, ARRAY_SIZE(tga_save_pixel_formats), + src_fmt_desc->format)) + { + *save_fmt = src_fmt_desc->format; + break; + } + + if (!is_conversion_from_supported(src_fmt_desc)) + { + FIXME("Cannot convert d3dx pixel format %d, can't save.\n", src_fmt_desc->format); + return E_NOTIMPL; + } + + *save_fmt = d3dx_get_closest_d3dx_pixel_format_id(tga_save_pixel_formats, ARRAY_SIZE(tga_save_pixel_formats), + src_fmt_desc->format); + if (*save_fmt == D3DX_PIXEL_FORMAT_COUNT) + return D3DERR_INVALIDCALL; + break; + + default: + assert(0 && "Unexpected file format."); + return E_FAIL; + } + + return D3D_OK; +} + static HRESULT d3dx_init_dds_header(struct dds_header *header, D3DRESOURCETYPE resource_type, enum d3dx_pixel_format_id format, const struct volume *size, uint32_t mip_levels) { @@ -539,10 +661,9 @@ static HRESULT d3dx_init_dds_header(struct dds_header *header, D3DRESOURCETYPE r } static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct pixel_format_desc *src_fmt_desc, - D3DXIMAGE_FILEFORMAT file_format, ID3DXBuffer **dst_buffer) + D3DXIMAGE_FILEFORMAT file_format, enum d3dx_pixel_format_id dst_format, ID3DXBuffer **dst_buffer) { - enum d3dx_pixel_format_id dst_format = src_fmt_desc->format; - const struct pixel_format_desc *dst_fmt_desc; + const struct pixel_format_desc *dst_fmt_desc = get_d3dx_pixel_format_info(dst_format); uint32_t dst_row_pitch, dst_slice_pitch; struct d3dx_pixels dst_pixels; ID3DXBuffer *buffer; @@ -550,29 +671,7 @@ static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const HRESULT hr; *dst_buffer = NULL; - dst_format = src_fmt_desc->format; - switch (file_format) - { - case D3DXIFF_DDS: - hr = dds_pixel_format_from_d3dx_pixel_format_id(NULL, dst_format); - if (FAILED(hr)) - return hr; - break; - - case D3DXIFF_TGA: - if (!d3dx_pixel_format_id_array_contains(tga_save_pixel_formats, ARRAY_SIZE(tga_save_pixel_formats), dst_format)) - { - FIXME("Format replacement for TGA files is currently unimplemented.\n"); - return E_NOTIMPL; - } - break; - - default: - assert(0 && "Unexpected file format."); - return E_FAIL; - } - - dst_fmt_desc = get_d3dx_pixel_format_info(dst_format); + pixels = NULL; hr = d3dx_calculate_pixels_size(dst_format, src_pixels->size.width, src_pixels->size.height, &dst_row_pitch, &dst_slice_pitch); if (FAILED(hr)) @@ -650,6 +749,7 @@ static HRESULT save_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSurface const PALETTEENTRY *src_palette, const RECT *src_rect, D3DXIMAGE_FILEFORMAT file_format) { const struct pixel_format_desc *src_fmt_desc; + enum d3dx_pixel_format_id dst_fmt; D3DSURFACE_DESC src_surface_desc; IDirect3DSurface9 *temp_surface; struct d3dx_pixels src_pixels; @@ -685,6 +785,10 @@ static HRESULT save_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSurface src_rect = &src_rect_temp; } + hr = d3dx_get_save_pixel_format_from_image_file_format(src_fmt_desc, file_format, &dst_fmt); + if (FAILED(hr)) + return hr; + hr = lock_surface(src_surface, NULL, &locked_rect, &temp_surface, FALSE); if (FAILED(hr)) return hr; @@ -697,7 +801,7 @@ static HRESULT save_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSurface return hr; } - hr = d3dx_save_pixels_to_memory(&src_pixels, src_fmt_desc, file_format, &buffer); + hr = d3dx_save_pixels_to_memory(&src_pixels, src_fmt_desc, file_format, dst_fmt, &buffer); if (FAILED(hr)) { unlock_surface(src_surface, NULL, temp_surface, FALSE); @@ -3034,12 +3138,6 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE if (!dst_buffer || !src_surface) return D3DERR_INVALIDCALL; IDirect3DSurface9_GetDesc(src_surface, &src_surface_desc); - if (file_format != D3DXIFF_DDS && (src_palette || is_index_format(get_format_info(src_surface_desc.Format)))) - { - FIXME("Saving surfaces with palettized pixel formats to non-DDS files is not implemented yet.\n"); - return D3DERR_INVALIDCALL; - } - switch (file_format) { case D3DXIFF_BMP: @@ -3064,6 +3162,12 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE return D3DERR_INVALIDCALL; } + if (src_palette || is_index_format(get_format_info(src_surface_desc.Format))) + { + FIXME("Saving surfaces with palettized pixel formats via WIC is not implemented yet.\n"); + return D3DERR_INVALIDCALL; + } + if (src_rect) { if (src_rect->left == src_rect->right || src_rect->top == src_rect->bottom) diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index fbcb963df3a3..1aef509b6502 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -3854,7 +3854,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_P8, test_palette, { { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, @@ -3865,7 +3865,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A8P8, test_palette, { { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, @@ -3955,7 +3955,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_X8R8G8B8, NULL, { { D3D_OK, D3DFMT_X8R8G8B8, }, { D3D_OK, D3DFMT_X8R8G8B8 }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, }, @@ -3971,7 +3971,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A8B8G8R8, NULL, { { D3D_OK, D3DFMT_A8B8G8R8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8B8G8R8, .todo_hr = TRUE }, @@ -3982,7 +3982,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_X8B8G8R8, NULL, { { D3D_OK, D3DFMT_X8B8G8R8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8B8G8R8, .todo_hr = TRUE }, @@ -3993,7 +3993,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_R5G6B5, NULL, { { D3D_OK, D3DFMT_R5G6B5, }, { D3D_OK, D3DFMT_X8R8G8B8 }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_R5G6B5, }, @@ -4004,7 +4004,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_X1R5G5B5, NULL, { { D3D_OK, D3DFMT_X1R5G5B5, }, { D3D_OK, D3DFMT_X8R8G8B8 }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X1R5G5B5, }, @@ -4015,7 +4015,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A1R5G5B5, NULL, { { D3D_OK, D3DFMT_A1R5G5B5, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A1R5G5B5, .todo_hr = TRUE }, @@ -4026,7 +4026,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_R3G3B2, NULL, { { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, @@ -4037,7 +4037,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A8R3G3B2, NULL, { { D3D_OK, D3DFMT_A8R3G3B2, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R3G3B2, .todo_hr = TRUE }, @@ -4048,7 +4048,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A4R4G4B4, NULL, { { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, @@ -4059,7 +4059,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_X4R4G4B4, NULL, { { D3D_OK, D3DFMT_X4R4G4B4, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X4R4G4B4, .todo_hr = TRUE }, @@ -4070,7 +4070,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A2R10G10B10, NULL, { { D3D_OK, D3DFMT_A2R10G10B10, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A2R10G10B10, .todo_hr = TRUE }, @@ -4081,7 +4081,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A2B10G10R10, NULL, { { D3D_OK, D3DFMT_A2B10G10R10, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A2B10G10R10, .todo_hr = TRUE }, @@ -4092,7 +4092,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A16B16G16R16, NULL, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, @@ -4103,7 +4103,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_G16R16, NULL, { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, @@ -4114,7 +4114,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A8, NULL, { { D3D_OK, D3DFMT_A8R3G3B2, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R3G3B2, .todo_hr = TRUE }, @@ -4125,7 +4125,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A8L8, NULL, { { D3D_OK, D3DFMT_A8L8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8L8, .todo_hr = TRUE }, @@ -4136,7 +4136,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A4L4, NULL, { { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, @@ -4153,7 +4153,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_L8, NULL, { { D3D_OK, D3DFMT_P8, .todo_format = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_P8, .todo_format = TRUE }, @@ -4164,7 +4164,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_L16, NULL, { { D3D_OK, D3DFMT_L16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_L16, .todo_hr = TRUE }, @@ -4175,7 +4175,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_DXT1, NULL, { { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, @@ -4186,7 +4186,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_DXT2, NULL, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4197,7 +4197,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_DXT2, NULL, { { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, @@ -4208,7 +4208,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_DXT3, NULL, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4219,7 +4219,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_DXT4, NULL, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4230,7 +4230,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_DXT5, NULL, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4241,7 +4241,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_R16F, NULL, { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, @@ -4252,7 +4252,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_G16R16F, NULL, { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, @@ -4263,7 +4263,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A16B16G16R16F, NULL, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4274,7 +4274,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_R32F, NULL, { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, @@ -4285,7 +4285,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_G32R32F, NULL, { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, @@ -4296,7 +4296,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A32B32G32R32F, NULL, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4307,7 +4307,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_Q8W8V8U8, NULL, { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4318,7 +4318,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_V8U8, NULL, { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4329,7 +4329,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_V16U16, NULL, { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4340,7 +4340,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_X8L8V8U8, NULL, { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4351,7 +4351,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_A2W10V10U10, NULL, { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4362,7 +4362,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DFMT_Q16W16V16U16, NULL, { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, From c21aaea00dddea3e44fdd73e15ab7db9a062565b Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Mon, 9 Dec 2024 10:38:53 -0500 Subject: [PATCH 0906/2542] d3dx9: Add support for saving PNG files in d3dx_save_pixels_to_memory(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/surface.c | 252 +++++++++++++++++++++++++++------- dlls/d3dx9_36/tests/surface.c | 74 +++++----- 2 files changed, 240 insertions(+), 86 deletions(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 367c3befb78a..c1bba6013134 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -65,9 +65,8 @@ static enum d3dx_pixel_format_id d3dx_pixel_format_id_from_wic_pixel_format(cons } -static const GUID *wic_guid_from_d3dformat(D3DFORMAT format) +static const GUID *wic_guid_from_d3dx_pixel_format_id(enum d3dx_pixel_format_id d3dx_pixel_format) { - enum d3dx_pixel_format_id d3dx_pixel_format = d3dx_pixel_format_id_from_d3dformat(format); unsigned int i; for (i = 0; i < ARRAY_SIZE(wic_pixel_formats); i++) @@ -79,6 +78,11 @@ static const GUID *wic_guid_from_d3dformat(D3DFORMAT format) return NULL; } +static const GUID *wic_guid_from_d3dformat(D3DFORMAT format) +{ + return wic_guid_from_d3dx_pixel_format_id(d3dx_pixel_format_id_from_d3dformat(format)); +} + #define DDS_PALETTE_SIZE (sizeof(PALETTEENTRY) * 256) /* dds_header.flags */ @@ -499,6 +503,13 @@ static const enum d3dx_pixel_format_id tga_save_pixel_formats[] = D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM }; +static const enum d3dx_pixel_format_id png_save_pixel_formats[] = +{ + D3DX_PIXEL_FORMAT_B8G8R8_UNORM, + D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM, + D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM +}; + static BOOL d3dx_pixel_format_id_array_contains(const enum d3dx_pixel_format_id *format_ids, uint32_t format_ids_size, enum d3dx_pixel_format_id format) { @@ -596,6 +607,8 @@ static enum d3dx_pixel_format_id d3dx_get_closest_d3dx_pixel_format_id(const enu static HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pixel_format_desc *src_fmt_desc, D3DXIMAGE_FILEFORMAT file_format, enum d3dx_pixel_format_id *save_fmt) { + const enum d3dx_pixel_format_id *save_fmts; + unsigned int save_fmts_count; HRESULT hr; switch (file_format) @@ -605,26 +618,16 @@ static HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pi if (FAILED(hr)) return hr; *save_fmt = src_fmt_desc->format; - break; + return D3D_OK; case D3DXIFF_TGA: - if (d3dx_pixel_format_id_array_contains(tga_save_pixel_formats, ARRAY_SIZE(tga_save_pixel_formats), - src_fmt_desc->format)) - { - *save_fmt = src_fmt_desc->format; - break; - } - - if (!is_conversion_from_supported(src_fmt_desc)) - { - FIXME("Cannot convert d3dx pixel format %d, can't save.\n", src_fmt_desc->format); - return E_NOTIMPL; - } + save_fmts = tga_save_pixel_formats; + save_fmts_count = ARRAY_SIZE(tga_save_pixel_formats); + break; - *save_fmt = d3dx_get_closest_d3dx_pixel_format_id(tga_save_pixel_formats, ARRAY_SIZE(tga_save_pixel_formats), - src_fmt_desc->format); - if (*save_fmt == D3DX_PIXEL_FORMAT_COUNT) - return D3DERR_INVALIDCALL; + case D3DXIFF_PNG: + save_fmts = png_save_pixel_formats; + save_fmts_count = ARRAY_SIZE(png_save_pixel_formats); break; default: @@ -632,7 +635,21 @@ static HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pi return E_FAIL; } - return D3D_OK; + if (d3dx_pixel_format_id_array_contains(save_fmts, save_fmts_count, src_fmt_desc->format)) + { + *save_fmt = src_fmt_desc->format; + return D3D_OK; + } + + if (!is_conversion_from_supported(src_fmt_desc)) + { + FIXME("Cannot convert d3dx pixel format %d, can't save.\n", src_fmt_desc->format); + return E_NOTIMPL; + } + + *save_fmt = d3dx_get_closest_d3dx_pixel_format_id(save_fmts, save_fmts_count, src_fmt_desc->format); + + return (*save_fmt == D3DX_PIXEL_FORMAT_COUNT) ? D3DERR_INVALIDCALL : D3D_OK; } static HRESULT d3dx_init_dds_header(struct dds_header *header, D3DRESOURCETYPE resource_type, @@ -660,18 +677,132 @@ static HRESULT d3dx_init_dds_header(struct dds_header *header, D3DRESOURCETYPE r return D3D_OK; } +static const GUID *wic_container_guid_from_d3dx_file_format(D3DXIMAGE_FILEFORMAT iff) +{ + switch (iff) + { + case D3DXIFF_BMP: return &GUID_ContainerFormatBmp; + case D3DXIFF_JPG: return &GUID_ContainerFormatJpeg; + case D3DXIFF_PNG: return &GUID_ContainerFormatPng; + default: + assert(0 && "Unexpected file format."); + return NULL; + } +} + +static HRESULT d3dx_pixels_save_wic(struct d3dx_pixels *pixels, const struct pixel_format_desc *fmt_desc, + D3DXIMAGE_FILEFORMAT image_file_format, IStream **wic_file, uint32_t *wic_file_size) +{ + const GUID *container_format = wic_container_guid_from_d3dx_file_format(image_file_format); + const GUID *pixel_format_guid = wic_guid_from_d3dx_pixel_format_id(fmt_desc->format); + IWICBitmapFrameEncode *wic_frame = NULL; + IPropertyBag2 *encoder_options = NULL; + IWICBitmapEncoder *wic_encoder = NULL; + WICPixelFormatGUID wic_pixel_format; + const LARGE_INTEGER seek = { 0 }; + IWICImagingFactory *wic_factory; + IStream *stream = NULL; + STATSTG stream_stats; + HRESULT hr; + + assert(container_format && pixel_format_guid); + hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &wic_factory); + if (FAILED(hr)) + return D3DERR_INVALIDCALL; + + hr = IWICImagingFactory_CreateEncoder(wic_factory, container_format, NULL, &wic_encoder); + IWICImagingFactory_Release(wic_factory); + if (FAILED(hr)) + return D3DERR_INVALIDCALL; + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapEncoder_Initialize(wic_encoder, stream, WICBitmapEncoderNoCache); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapEncoder_CreateNewFrame(wic_encoder, &wic_frame, &encoder_options); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapFrameEncode_Initialize(wic_frame, encoder_options); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapFrameEncode_SetSize(wic_frame, pixels->size.width, pixels->size.height); + if (FAILED(hr)) + goto exit; + + memcpy(&wic_pixel_format, pixel_format_guid, sizeof(*pixel_format_guid)); + hr = IWICBitmapFrameEncode_SetPixelFormat(wic_frame, &wic_pixel_format); + if (FAILED(hr)) + goto exit; + + if (!IsEqualGUID(pixel_format_guid, &wic_pixel_format)) + { + ERR("SetPixelFormat returned a different pixel format.\n"); + hr = E_FAIL; + goto exit; + } + + hr = IWICBitmapFrameEncode_WritePixels(wic_frame, pixels->size.height, pixels->row_pitch, pixels->slice_pitch, + (BYTE *)pixels->data); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapFrameEncode_Commit(wic_frame); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapEncoder_Commit(wic_encoder); + if (FAILED(hr)) + goto exit; + + hr = IStream_Seek(stream, seek, STREAM_SEEK_SET, NULL); + if (FAILED(hr)) + goto exit; + + hr = IStream_Stat(stream, &stream_stats, STATFLAG_NONAME); + if (FAILED(hr)) + goto exit; + + if (!stream_stats.cbSize.u.HighPart) + { + *wic_file = stream; + *wic_file_size = stream_stats.cbSize.u.LowPart; + } + else + { + hr = D3DXERR_INVALIDDATA; + } + +exit: + if (stream && (*wic_file != stream)) + IStream_Release(stream); + if (wic_frame) + IWICBitmapFrameEncode_Release(wic_frame); + if (encoder_options) + IPropertyBag2_Release(encoder_options); + if (wic_encoder) + IWICBitmapEncoder_Release(wic_encoder); + + return hr; +} + static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct pixel_format_desc *src_fmt_desc, D3DXIMAGE_FILEFORMAT file_format, enum d3dx_pixel_format_id dst_format, ID3DXBuffer **dst_buffer) { const struct pixel_format_desc *dst_fmt_desc = get_d3dx_pixel_format_info(dst_format); uint32_t dst_row_pitch, dst_slice_pitch; struct d3dx_pixels dst_pixels; + uint8_t *pixels, *tmp_buf; ID3DXBuffer *buffer; - uint8_t *pixels; HRESULT hr; - *dst_buffer = NULL; - pixels = NULL; + *dst_buffer = buffer = NULL; + pixels = tmp_buf = NULL; hr = d3dx_calculate_pixels_size(dst_format, src_pixels->size.width, src_pixels->size.height, &dst_row_pitch, &dst_slice_pitch); if (FAILED(hr)) @@ -722,6 +853,14 @@ static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const break; } + case D3DXIFF_PNG: + if (src_fmt_desc == dst_fmt_desc) + dst_pixels = *src_pixels; + else + pixels = tmp_buf = malloc(dst_slice_pitch); + break; + + default: break; } @@ -730,16 +869,50 @@ static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const { const RECT dst_rect = { 0, 0, src_pixels->size.width, src_pixels->size.height }; - set_d3dx_pixels(&dst_pixels, pixels, dst_row_pitch, dst_slice_pitch, src_pixels->palette, src_pixels->size.width, - src_pixels->size.height, src_pixels->size.depth, &dst_rect); + if (pixels) + { + set_d3dx_pixels(&dst_pixels, pixels, dst_row_pitch, dst_slice_pitch, src_pixels->palette, src_pixels->size.width, + src_pixels->size.height, src_pixels->size.depth, &dst_rect); + + hr = d3dx_load_pixels_from_pixels(&dst_pixels, dst_fmt_desc, src_pixels, src_fmt_desc, D3DX_FILTER_NONE, 0); + if (FAILED(hr)) + goto exit; + } + + /* WIC path, encode the image. */ + if (!buffer) + { + IStream *wic_file = NULL; + uint32_t buf_size = 0; + + hr = d3dx_pixels_save_wic(&dst_pixels, dst_fmt_desc, file_format, &wic_file, &buf_size); + if (FAILED(hr)) + goto exit; - hr = d3dx_load_pixels_from_pixels(&dst_pixels, dst_fmt_desc, src_pixels, src_fmt_desc, D3DX_FILTER_NONE, 0); + hr = D3DXCreateBuffer(buf_size, &buffer); + if (FAILED(hr)) + { + IStream_Release(wic_file); + goto exit; + } + + hr = IStream_Read(wic_file, ID3DXBuffer_GetBufferPointer(buffer), buf_size, NULL); + IStream_Release(wic_file); + if (FAILED(hr)) + goto exit; + } + } + /* Return an empty buffer for size 0 images via WIC. */ + else if (!buffer) + { + hr = D3DXCreateBuffer(64, &buffer); if (FAILED(hr)) goto exit; } *dst_buffer = buffer; exit: + free(tmp_buf); if (*dst_buffer != buffer) ID3DXBuffer_Release(buffer); return hr; @@ -1056,25 +1229,6 @@ static BOOL image_is_argb(IWICBitmapFrameDecode *frame, struct d3dx_image *image return FALSE; } -struct d3dx_wic_file_format -{ - const GUID *wic_container_guid; - D3DXIMAGE_FILEFORMAT d3dx_file_format; -}; - -static const GUID *d3dx_file_format_to_wic_container_guid(D3DXIMAGE_FILEFORMAT iff) -{ - switch (iff) - { - case D3DXIFF_BMP: return &GUID_ContainerFormatBmp; - case D3DXIFF_JPG: return &GUID_ContainerFormatJpeg; - case D3DXIFF_PNG: return &GUID_ContainerFormatPng; - default: - assert(0); /* Shouldn't happen. */ - return NULL; - } -} - static const char *debug_d3dx_image_file_format(D3DXIMAGE_FILEFORMAT format) { switch (format) @@ -1178,7 +1332,7 @@ static HRESULT d3dx_image_wic_frame_decode(struct d3dx_image *image, static HRESULT d3dx_initialize_image_from_wic(const void *src_data, uint32_t src_data_size, struct d3dx_image *image, D3DXIMAGE_FILEFORMAT d3dx_file_format, uint32_t flags) { - const GUID *container_format_guid = d3dx_file_format_to_wic_container_guid(d3dx_file_format); + const GUID *container_format_guid = wic_container_guid_from_d3dx_file_format(d3dx_file_format); IWICBitmapFrameDecode *bitmap_frame = NULL; IWICBitmapDecoder *bitmap_decoder = NULL; IWICImagingFactory *wic_factory; @@ -2644,6 +2798,8 @@ HRESULT d3dx_pixels_init(const void *data, uint32_t row_pitch, uint32_t slice_pi SetRect(&unaligned_rect, 0, 0, (right - left), (bottom - top)); } + if (!slice_pitch) + slice_pitch = row_pitch * (bottom - top); set_d3dx_pixels(pixels, ptr, row_pitch, slice_pitch, palette, (right - left), (bottom - top), (back - front), &unaligned_rect); @@ -3144,12 +3300,10 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE case D3DXIFF_DIB: container_format = &GUID_ContainerFormatBmp; break; - case D3DXIFF_PNG: - container_format = &GUID_ContainerFormatPng; - break; case D3DXIFF_JPG: container_format = &GUID_ContainerFormatJpeg; break; + case D3DXIFF_PNG: case D3DXIFF_DDS: case D3DXIFF_TGA: return save_surface_to_memory(dst_buffer, src_surface, src_palette, src_rect, file_format); diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 1aef509b6502..e02a898f0978 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -3855,7 +3855,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -3866,7 +3866,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -3972,7 +3972,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_A8B8G8R8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8B8G8R8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -3983,7 +3983,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_X8B8G8R8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_R8G8B8 }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8B8G8R8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -3994,7 +3994,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_R5G6B5, }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_R8G8B8 }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_R5G6B5, }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4005,7 +4005,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_X1R5G5B5, }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_R8G8B8 }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X1R5G5B5, }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4016,7 +4016,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_A1R5G5B5, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A1R5G5B5, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4027,7 +4027,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_R8G8B8 }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4038,7 +4038,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_A8R3G3B2, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R3G3B2, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4049,7 +4049,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4060,7 +4060,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_X4R4G4B4, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_R8G8B8 }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X4R4G4B4, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4071,7 +4071,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_A2R10G10B10, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A2R10G10B10, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4082,7 +4082,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_A2B10G10R10, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A2B10G10R10, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4104,7 +4104,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_R8G8B8 }, - { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4115,7 +4115,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_A8R3G3B2, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R3G3B2, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4126,7 +4126,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_A8L8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8L8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4137,7 +4137,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4154,7 +4154,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_P8, .todo_format = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, { D3D_OK, D3DFMT_R8G8B8 }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_P8, .todo_format = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4165,7 +4165,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_L16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_R8G8B8 }, - { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_L16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4176,7 +4176,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4187,7 +4187,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4198,7 +4198,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4209,7 +4209,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4220,7 +4220,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4231,7 +4231,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4242,7 +4242,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_R8G8B8 }, - { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4253,7 +4253,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_R8G8B8 }, - { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4264,7 +4264,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4275,7 +4275,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_R8G8B8 }, - { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4286,7 +4286,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_R8G8B8 }, - { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4297,7 +4297,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A8R8G8B8 }, - { D3D_OK, D3DFMT_A16B16G16R16, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, @@ -4308,7 +4308,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4319,7 +4319,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4330,7 +4330,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4341,7 +4341,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4352,7 +4352,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4363,7 +4363,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, From 6bf5d9dca1a7026fd0eb480c7e33b6918d2148af Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Mon, 9 Dec 2024 10:46:48 -0500 Subject: [PATCH 0907/2542] d3dx9: Add support for saving JPG files in d3dx_save_pixels_to_memory(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/surface.c | 13 ++++++- dlls/d3dx9_36/tests/surface.c | 70 +++++++++++++++++------------------ 2 files changed, 46 insertions(+), 37 deletions(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index c1bba6013134..127441ea41e1 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -510,6 +510,11 @@ static const enum d3dx_pixel_format_id png_save_pixel_formats[] = D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM }; +static const enum d3dx_pixel_format_id jpg_save_pixel_formats[] = +{ + D3DX_PIXEL_FORMAT_B8G8R8_UNORM, +}; + static BOOL d3dx_pixel_format_id_array_contains(const enum d3dx_pixel_format_id *format_ids, uint32_t format_ids_size, enum d3dx_pixel_format_id format) { @@ -630,6 +635,11 @@ static HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pi save_fmts_count = ARRAY_SIZE(png_save_pixel_formats); break; + case D3DXIFF_JPG: + save_fmts = jpg_save_pixel_formats; + save_fmts_count = ARRAY_SIZE(jpg_save_pixel_formats); + break; + default: assert(0 && "Unexpected file format."); return E_FAIL; @@ -854,6 +864,7 @@ static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const } case D3DXIFF_PNG: + case D3DXIFF_JPG: if (src_fmt_desc == dst_fmt_desc) dst_pixels = *src_pixels; else @@ -3301,8 +3312,6 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE container_format = &GUID_ContainerFormatBmp; break; case D3DXIFF_JPG: - container_format = &GUID_ContainerFormatJpeg; - break; case D3DXIFF_PNG: case D3DXIFF_DDS: case D3DXIFF_TGA: diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index e02a898f0978..68f82b917111 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -3853,7 +3853,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) } iff_tests[] = { { D3DFMT_P8, test_palette, { { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -3864,7 +3864,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_A8P8, test_palette, { { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -3970,7 +3970,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) */ { D3DFMT_A8B8G8R8, NULL, { { D3D_OK, D3DFMT_A8B8G8R8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -3981,7 +3981,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_X8B8G8R8, NULL, { { D3D_OK, D3DFMT_X8B8G8R8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4014,7 +4014,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_A1R5G5B5, NULL, { { D3D_OK, D3DFMT_A1R5G5B5, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4025,7 +4025,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_R3G3B2, NULL, { { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4036,7 +4036,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_A8R3G3B2, NULL, { { D3D_OK, D3DFMT_A8R3G3B2, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4047,7 +4047,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_A4R4G4B4, NULL, { { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4058,7 +4058,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_X4R4G4B4, NULL, { { D3D_OK, D3DFMT_X4R4G4B4, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4069,7 +4069,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_A2R10G10B10, NULL, { { D3D_OK, D3DFMT_A2R10G10B10, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4080,7 +4080,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_A2B10G10R10, NULL, { { D3D_OK, D3DFMT_A2B10G10R10, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4102,7 +4102,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_G16R16, NULL, { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4113,7 +4113,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_A8, NULL, { { D3D_OK, D3DFMT_A8R3G3B2, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4124,7 +4124,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_A8L8, NULL, { { D3D_OK, D3DFMT_A8L8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4135,7 +4135,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_A4L4, NULL, { { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4152,7 +4152,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) */ { D3DFMT_L8, NULL, { { D3D_OK, D3DFMT_P8, .todo_format = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4163,7 +4163,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_L16, NULL, { { D3D_OK, D3DFMT_L16, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4174,7 +4174,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_DXT1, NULL, { { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4185,7 +4185,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_DXT2, NULL, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4196,7 +4196,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_DXT2, NULL, { { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4207,7 +4207,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_DXT3, NULL, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4218,7 +4218,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_DXT4, NULL, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4229,7 +4229,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_DXT5, NULL, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4240,7 +4240,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_R16F, NULL, { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4251,7 +4251,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_G16R16F, NULL, { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4262,7 +4262,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_A16B16G16R16F, NULL, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4273,7 +4273,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_R32F, NULL, { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4284,7 +4284,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_G32R32F, NULL, { { D3D_OK, D3DFMT_G16R16, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4295,7 +4295,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_A32B32G32R32F, NULL, { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, @@ -4306,7 +4306,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_Q8W8V8U8, NULL, { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4317,7 +4317,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_V8U8, NULL, { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4328,7 +4328,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_V16U16, NULL, { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4339,7 +4339,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_X8L8V8U8, NULL, { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4350,7 +4350,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_A2W10V10U10, NULL, { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, @@ -4361,7 +4361,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, { D3DFMT_Q16W16V16U16, NULL, { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, From 0ebcfef9a86b575ceaa635705cb6d0f9b85d7e28 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Mon, 9 Dec 2024 10:57:36 -0500 Subject: [PATCH 0908/2542] d3dx9: Add support for saving BMP files in d3dx_save_pixels_to_memory(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/surface.c | 55 ++++++++++++++++++++++++++++++++++- dlls/d3dx9_36/tests/surface.c | 43 ++++++++++++--------------- 2 files changed, 73 insertions(+), 25 deletions(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 127441ea41e1..72c15fb14320 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -515,6 +515,38 @@ static const enum d3dx_pixel_format_id jpg_save_pixel_formats[] = D3DX_PIXEL_FORMAT_B8G8R8_UNORM, }; +static const enum d3dx_pixel_format_id bmp_save_pixel_formats[] = +{ + D3DX_PIXEL_FORMAT_B5G5R5X1_UNORM, + D3DX_PIXEL_FORMAT_B5G6R5_UNORM, + D3DX_PIXEL_FORMAT_B8G8R8_UNORM, + D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM, + D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM +}; + +static const enum d3dx_pixel_format_id unimplemented_bmp_save_pixel_formats[] = +{ + D3DX_PIXEL_FORMAT_P8_UINT, + D3DX_PIXEL_FORMAT_A8_UNORM, + D3DX_PIXEL_FORMAT_P8_UINT_A8_UNORM, + D3DX_PIXEL_FORMAT_L8A8_UNORM, + D3DX_PIXEL_FORMAT_L16_UNORM, + D3DX_PIXEL_FORMAT_B2G3R3_UNORM, + D3DX_PIXEL_FORMAT_R16_FLOAT, + D3DX_PIXEL_FORMAT_R16G16_FLOAT, + D3DX_PIXEL_FORMAT_R16G16_UNORM, + D3DX_PIXEL_FORMAT_R32_FLOAT, + D3DX_PIXEL_FORMAT_R32G32_FLOAT, + D3DX_PIXEL_FORMAT_B4G4R4X4_UNORM, + D3DX_PIXEL_FORMAT_B4G4R4A4_UNORM, + D3DX_PIXEL_FORMAT_B2G3R3A8_UNORM, + D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM, + D3DX_PIXEL_FORMAT_R8G8B8X8_UNORM, + D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM, + D3DX_PIXEL_FORMAT_B10G10R10A2_UNORM, + D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM, +}; + static BOOL d3dx_pixel_format_id_array_contains(const enum d3dx_pixel_format_id *format_ids, uint32_t format_ids_size, enum d3dx_pixel_format_id format) { @@ -609,6 +641,7 @@ static enum d3dx_pixel_format_id d3dx_get_closest_d3dx_pixel_format_id(const enu return (bestfmt) ? bestfmt->format : D3DX_PIXEL_FORMAT_COUNT; } +static const char *debug_d3dx_image_file_format(D3DXIMAGE_FILEFORMAT format); static HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pixel_format_desc *src_fmt_desc, D3DXIMAGE_FILEFORMAT file_format, enum d3dx_pixel_format_id *save_fmt) { @@ -640,6 +673,18 @@ static HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pi save_fmts_count = ARRAY_SIZE(jpg_save_pixel_formats); break; + case D3DXIFF_BMP: + if (d3dx_pixel_format_id_array_contains(unimplemented_bmp_save_pixel_formats, + ARRAY_SIZE(unimplemented_bmp_save_pixel_formats), src_fmt_desc->format)) + { + FIXME("Saving d3dformat %#x currently unimplemented for file type %s.\n", src_fmt_desc->format, + debug_d3dx_image_file_format(file_format)); + return E_NOTIMPL; + } + save_fmts = bmp_save_pixel_formats; + save_fmts_count = ARRAY_SIZE(bmp_save_pixel_formats); + break; + default: assert(0 && "Unexpected file format."); return E_FAIL; @@ -745,6 +790,13 @@ static HRESULT d3dx_pixels_save_wic(struct d3dx_pixels *pixels, const struct pix if (FAILED(hr)) goto exit; + /* + * Encode 32bpp BGRA format surfaces as 32bpp BGRX for BMP. + * This matches the behavior of native. + */ + if (IsEqualGUID(&GUID_ContainerFormatBmp, container_format) && (fmt_desc->format == D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM)) + pixel_format_guid = wic_guid_from_d3dx_pixel_format_id(D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM); + memcpy(&wic_pixel_format, pixel_format_guid, sizeof(*pixel_format_guid)); hr = IWICBitmapFrameEncode_SetPixelFormat(wic_frame, &wic_pixel_format); if (FAILED(hr)) @@ -863,6 +915,7 @@ static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const break; } + case D3DXIFF_BMP: case D3DXIFF_PNG: case D3DXIFF_JPG: if (src_fmt_desc == dst_fmt_desc) @@ -3307,10 +3360,10 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE IDirect3DSurface9_GetDesc(src_surface, &src_surface_desc); switch (file_format) { - case D3DXIFF_BMP: case D3DXIFF_DIB: container_format = &GUID_ContainerFormatBmp; break; + case D3DXIFF_BMP: case D3DXIFF_JPG: case D3DXIFF_PNG: case D3DXIFF_DDS: diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 68f82b917111..61bd3386c75b 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -3918,16 +3918,11 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, }, /* - * We don't match formats here because we encode our BMP headers - * differently. Native encodes with the same header as - * D3DFMT_X8R8G8B8, it just sets the values in the alpha channel. The - * format is distinguished by checking the image. We encode a bitmap - * V4 header with a dedicated alpha mask, so we'll always report - * D3DFMT_A8R8G8B8, regardless of whether or not any alpha channel - * values are non-zero. + * For BMP/DIB, these encode as D3DFMT_X8R8G8B8. If there's a single + * pixel with a non-zero alpha channel, it reports as D3DFMT_A8R8G8B8. */ { D3DFMT_A8R8G8B8, NULL, - { { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, + { { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, }, @@ -4090,7 +4085,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, }, { D3DFMT_A16B16G16R16, NULL, - { { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, + { { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16 }, @@ -4134,7 +4129,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, }, { D3DFMT_A4L4, NULL, - { { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, + { { D3D_OK, D3DFMT_A4R4G4B4, .todo_format = TRUE }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, @@ -4173,7 +4168,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, }, { D3DFMT_DXT1, NULL, - { { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, @@ -4184,7 +4179,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, }, { D3DFMT_DXT2, NULL, - { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, @@ -4195,7 +4190,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, }, { D3DFMT_DXT2, NULL, - { { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, @@ -4206,7 +4201,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, 0xff }, { D3DFMT_DXT3, NULL, - { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, @@ -4217,7 +4212,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, }, { D3DFMT_DXT4, NULL, - { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, @@ -4228,7 +4223,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, }, { D3DFMT_DXT5, NULL, - { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, @@ -4261,7 +4256,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, }, { D3DFMT_A16B16G16R16F, NULL, - { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16 }, @@ -4294,7 +4289,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, }, { D3DFMT_A32B32G32R32F, NULL, - { { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16 }, @@ -4305,7 +4300,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, }, { D3DFMT_Q8W8V8U8, NULL, - { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, @@ -4316,7 +4311,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, }, { D3DFMT_V8U8, NULL, - { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, @@ -4327,7 +4322,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, }, { D3DFMT_V16U16, NULL, - { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, @@ -4338,7 +4333,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, }, { D3DFMT_X8L8V8U8, NULL, - { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, @@ -4349,7 +4344,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, }, { D3DFMT_A2W10V10U10, NULL, - { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, @@ -4360,7 +4355,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) }, }, { D3DFMT_Q16W16V16U16, NULL, - { { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, From 9566b5306b4c175a6ba32eddad9edb8ad71e9fd8 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Mon, 9 Dec 2024 11:18:22 -0500 Subject: [PATCH 0909/2542] d3dx9: Add support for saving paletted pixel formats in d3dx_pixels_save_wic(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/surface.c | 40 +++++++++++++++++++++++++++++++---- dlls/d3dx9_36/tests/surface.c | 2 +- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 72c15fb14320..59761faa15f4 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -521,12 +521,12 @@ static const enum d3dx_pixel_format_id bmp_save_pixel_formats[] = D3DX_PIXEL_FORMAT_B5G6R5_UNORM, D3DX_PIXEL_FORMAT_B8G8R8_UNORM, D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM, - D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM + D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM, + D3DX_PIXEL_FORMAT_P8_UINT }; static const enum d3dx_pixel_format_id unimplemented_bmp_save_pixel_formats[] = { - D3DX_PIXEL_FORMAT_P8_UINT, D3DX_PIXEL_FORMAT_A8_UNORM, D3DX_PIXEL_FORMAT_P8_UINT_A8_UNORM, D3DX_PIXEL_FORMAT_L8A8_UNORM, @@ -756,6 +756,7 @@ static HRESULT d3dx_pixels_save_wic(struct d3dx_pixels *pixels, const struct pix WICPixelFormatGUID wic_pixel_format; const LARGE_INTEGER seek = { 0 }; IWICImagingFactory *wic_factory; + IWICPalette *wic_palette = NULL; IStream *stream = NULL; STATSTG stream_stats; HRESULT hr; @@ -766,9 +767,11 @@ static HRESULT d3dx_pixels_save_wic(struct d3dx_pixels *pixels, const struct pix return D3DERR_INVALIDCALL; hr = IWICImagingFactory_CreateEncoder(wic_factory, container_format, NULL, &wic_encoder); - IWICImagingFactory_Release(wic_factory); if (FAILED(hr)) - return D3DERR_INVALIDCALL; + { + hr = D3DERR_INVALIDCALL; + goto exit; + } hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); if (FAILED(hr)) @@ -790,6 +793,31 @@ static HRESULT d3dx_pixels_save_wic(struct d3dx_pixels *pixels, const struct pix if (FAILED(hr)) goto exit; + if (pixels->palette) + { + WICColor tmp_palette[256]; + unsigned int i; + + hr = IWICImagingFactory_CreatePalette(wic_factory, &wic_palette); + if (FAILED(hr)) + goto exit; + + for (i = 0; i < ARRAY_SIZE(tmp_palette); ++i) + { + const PALETTEENTRY *pe = &pixels->palette[i]; + + tmp_palette[i] = (pe->peFlags << 24) | (pe->peRed << 16) | (pe->peGreen << 8) | (pe->peBlue); + } + + hr = IWICPalette_InitializeCustom(wic_palette, tmp_palette, ARRAY_SIZE(tmp_palette)); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapFrameEncode_SetPalette(wic_frame, wic_palette); + if (FAILED(hr)) + goto exit; + } + /* * Encode 32bpp BGRA format surfaces as 32bpp BGRX for BMP. * This matches the behavior of native. @@ -841,10 +869,14 @@ static HRESULT d3dx_pixels_save_wic(struct d3dx_pixels *pixels, const struct pix } exit: + if (wic_factory) + IWICImagingFactory_Release(wic_factory); if (stream && (*wic_file != stream)) IStream_Release(stream); if (wic_frame) IWICBitmapFrameEncode_Release(wic_frame); + if (wic_palette) + IWICPalette_Release(wic_palette); if (encoder_options) IPropertyBag2_Release(encoder_options); if (wic_encoder) diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 61bd3386c75b..54e45f73f986 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -3852,7 +3852,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) uint8_t init_pixel_value; } iff_tests[] = { { D3DFMT_P8, test_palette, - { { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, + { { D3D_OK, D3DFMT_P8 }, { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, From 427ffda978609e3810c7548fc6877082e941ef04 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Mon, 9 Dec 2024 11:37:53 -0500 Subject: [PATCH 0910/2542] d3dx9: Add support for saving DIB files in d3dx_save_pixels_to_memory(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/surface.c | 297 ++++++---------------------------- dlls/d3dx9_36/tests/surface.c | 47 +++--- 2 files changed, 71 insertions(+), 273 deletions(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 59761faa15f4..5885018130d1 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -78,11 +78,6 @@ static const GUID *wic_guid_from_d3dx_pixel_format_id(enum d3dx_pixel_format_id return NULL; } -static const GUID *wic_guid_from_d3dformat(D3DFORMAT format) -{ - return wic_guid_from_d3dx_pixel_format_id(d3dx_pixel_format_id_from_d3dformat(format)); -} - #define DDS_PALETTE_SIZE (sizeof(PALETTEENTRY) * 256) /* dds_header.flags */ @@ -674,6 +669,7 @@ static HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pi break; case D3DXIFF_BMP: + case D3DXIFF_DIB: if (d3dx_pixel_format_id_array_contains(unimplemented_bmp_save_pixel_formats, ARRAY_SIZE(unimplemented_bmp_save_pixel_formats), src_fmt_desc->format)) { @@ -736,6 +732,7 @@ static const GUID *wic_container_guid_from_d3dx_file_format(D3DXIMAGE_FILEFORMAT { switch (iff) { + case D3DXIFF_DIB: case D3DXIFF_BMP: return &GUID_ContainerFormatBmp; case D3DXIFF_JPG: return &GUID_ContainerFormatJpeg; case D3DXIFF_PNG: return &GUID_ContainerFormatPng; @@ -947,6 +944,7 @@ static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const break; } + case D3DXIFF_DIB: case D3DXIFF_BMP: case D3DXIFF_PNG: case D3DXIFF_JPG: @@ -1014,80 +1012,6 @@ static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const return hr; } -static HRESULT save_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSurface9 *src_surface, - const PALETTEENTRY *src_palette, const RECT *src_rect, D3DXIMAGE_FILEFORMAT file_format) -{ - const struct pixel_format_desc *src_fmt_desc; - enum d3dx_pixel_format_id dst_fmt; - D3DSURFACE_DESC src_surface_desc; - IDirect3DSurface9 *temp_surface; - struct d3dx_pixels src_pixels; - D3DLOCKED_RECT locked_rect; - ID3DXBuffer *buffer; - RECT src_rect_temp; - HRESULT hr; - - IDirect3DSurface9_GetDesc(src_surface, &src_surface_desc); - src_fmt_desc = get_format_info(src_surface_desc.Format); - if (is_unknown_format(src_fmt_desc)) - return E_NOTIMPL; - - if (!src_palette && is_index_format(src_fmt_desc)) - { - FIXME("Default palette unimplemented.\n"); - return E_NOTIMPL; - } - - if (src_rect) - { - if (src_rect->left > src_rect->right || src_rect->right > src_surface_desc.Width - || src_rect->top > src_rect->bottom || src_rect->bottom > src_surface_desc.Height - || src_rect->left < 0 || src_rect->top < 0) - { - WARN("Invalid src_rect specified.\n"); - return D3DERR_INVALIDCALL; - } - } - else - { - SetRect(&src_rect_temp, 0, 0, src_surface_desc.Width, src_surface_desc.Height); - src_rect = &src_rect_temp; - } - - hr = d3dx_get_save_pixel_format_from_image_file_format(src_fmt_desc, file_format, &dst_fmt); - if (FAILED(hr)) - return hr; - - hr = lock_surface(src_surface, NULL, &locked_rect, &temp_surface, FALSE); - if (FAILED(hr)) - return hr; - - hr = d3dx_pixels_init(locked_rect.pBits, locked_rect.Pitch, 0, src_palette, src_fmt_desc->format, - src_rect->left, src_rect->top, src_rect->right, src_rect->bottom, 0, 1, &src_pixels); - if (FAILED(hr)) - { - unlock_surface(src_surface, NULL, temp_surface, FALSE); - return hr; - } - - hr = d3dx_save_pixels_to_memory(&src_pixels, src_fmt_desc, file_format, dst_fmt, &buffer); - if (FAILED(hr)) - { - unlock_surface(src_surface, NULL, temp_surface, FALSE); - return hr; - } - - hr = unlock_surface(src_surface, NULL, temp_surface, FALSE); - if (FAILED(hr)) - { - ID3DXBuffer_Release(buffer); - return hr; - } - - *dst_buffer = buffer; - return D3D_OK; -} - static const uint8_t bmp_file_signature[] = { 'B', 'M' }; static const uint8_t jpg_file_signature[] = { 0xff, 0xd8 }; static const uint8_t png_file_signature[] = { 0x89, 'P', 'N', 'G', 0x0d, 0x0a, 0x1a, 0x0a }; @@ -3365,214 +3289,91 @@ HRESULT WINAPI D3DXSaveSurfaceToFileW(const WCHAR *dst_filename, D3DXIMAGE_FILEF HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE_FILEFORMAT file_format, IDirect3DSurface9 *src_surface, const PALETTEENTRY *src_palette, const RECT *src_rect) { - IWICBitmapEncoder *encoder = NULL; - IWICBitmapFrameEncode *frame = NULL; - IPropertyBag2 *encoder_options = NULL; - IStream *stream = NULL; - HRESULT hr; - const GUID *container_format; - const GUID *pixel_format_guid; - WICPixelFormatGUID wic_pixel_format; - IWICImagingFactory *factory; - D3DFORMAT d3d_pixel_format; + const struct pixel_format_desc *src_fmt_desc; + enum d3dx_pixel_format_id dst_fmt; D3DSURFACE_DESC src_surface_desc; IDirect3DSurface9 *temp_surface; + struct d3dx_pixels src_pixels; D3DLOCKED_RECT locked_rect; - int width, height; - STATSTG stream_stats; - HGLOBAL stream_hglobal; ID3DXBuffer *buffer; - DWORD size; + RECT src_rect_temp; + HRESULT hr; TRACE("dst_buffer %p, file_format %#x, src_surface %p, src_palette %p, src_rect %s.\n", dst_buffer, file_format, src_surface, src_palette, wine_dbgstr_rect(src_rect)); - if (!dst_buffer || !src_surface) return D3DERR_INVALIDCALL; + if (!dst_buffer || !src_surface || file_format > D3DXIFF_PFM) + return D3DERR_INVALIDCALL; - IDirect3DSurface9_GetDesc(src_surface, &src_surface_desc); switch (file_format) { - case D3DXIFF_DIB: - container_format = &GUID_ContainerFormatBmp; - break; - case D3DXIFF_BMP: - case D3DXIFF_JPG: - case D3DXIFF_PNG: - case D3DXIFF_DDS: - case D3DXIFF_TGA: - return save_surface_to_memory(dst_buffer, src_surface, src_palette, src_rect, file_format); case D3DXIFF_HDR: case D3DXIFF_PFM: case D3DXIFF_PPM: - FIXME("File format %#x is not supported yet\n", file_format); + FIXME("File format %s is not supported yet.\n", debug_d3dx_image_file_format(file_format)); return E_NOTIMPL; + default: - return D3DERR_INVALIDCALL; + break; } - if (src_palette || is_index_format(get_format_info(src_surface_desc.Format))) + IDirect3DSurface9_GetDesc(src_surface, &src_surface_desc); + src_fmt_desc = get_format_info(src_surface_desc.Format); + if (is_unknown_format(src_fmt_desc)) + return E_NOTIMPL; + + if (!src_palette && is_index_format(src_fmt_desc)) { - FIXME("Saving surfaces with palettized pixel formats via WIC is not implemented yet.\n"); - return D3DERR_INVALIDCALL; + FIXME("Default palette unimplemented.\n"); + return E_NOTIMPL; } if (src_rect) { - if (src_rect->left == src_rect->right || src_rect->top == src_rect->bottom) + if (src_rect->left > src_rect->right || src_rect->right > src_surface_desc.Width + || src_rect->top > src_rect->bottom || src_rect->bottom > src_surface_desc.Height + || src_rect->left < 0 || src_rect->top < 0) { - WARN("Invalid rectangle with 0 area\n"); - return D3DXCreateBuffer(64, dst_buffer); - } - if (src_rect->left < 0 || src_rect->top < 0) - return D3DERR_INVALIDCALL; - if (src_rect->left > src_rect->right || src_rect->top > src_rect->bottom) - return D3DERR_INVALIDCALL; - if (src_rect->right > src_surface_desc.Width || src_rect->bottom > src_surface_desc.Height) + WARN("Invalid src_rect specified.\n"); return D3DERR_INVALIDCALL; - - width = src_rect->right - src_rect->left; - height = src_rect->bottom - src_rect->top; + } } else { - width = src_surface_desc.Width; - height = src_surface_desc.Height; + SetRect(&src_rect_temp, 0, 0, src_surface_desc.Width, src_surface_desc.Height); + src_rect = &src_rect_temp; } - hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory); - if (FAILED(hr)) goto cleanup_err; - - hr = IWICImagingFactory_CreateEncoder(factory, container_format, NULL, &encoder); - IWICImagingFactory_Release(factory); - if (FAILED(hr)) goto cleanup_err; - - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - if (FAILED(hr)) goto cleanup_err; - - hr = IWICBitmapEncoder_Initialize(encoder, stream, WICBitmapEncoderNoCache); - if (FAILED(hr)) goto cleanup_err; - - hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frame, &encoder_options); - if (FAILED(hr)) goto cleanup_err; - - hr = IWICBitmapFrameEncode_Initialize(frame, encoder_options); - if (FAILED(hr)) goto cleanup_err; - - hr = IWICBitmapFrameEncode_SetSize(frame, width, height); - if (FAILED(hr)) goto cleanup_err; + hr = d3dx_get_save_pixel_format_from_image_file_format(src_fmt_desc, file_format, &dst_fmt); + if (FAILED(hr)) + return hr; - pixel_format_guid = wic_guid_from_d3dformat(src_surface_desc.Format); - if (!pixel_format_guid) - { - FIXME("Pixel format %#x is not supported yet\n", src_surface_desc.Format); - hr = E_NOTIMPL; - goto cleanup; - } + hr = lock_surface(src_surface, NULL, &locked_rect, &temp_surface, FALSE); + if (FAILED(hr)) + return hr; - memcpy(&wic_pixel_format, pixel_format_guid, sizeof(GUID)); - hr = IWICBitmapFrameEncode_SetPixelFormat(frame, &wic_pixel_format); - d3d_pixel_format = d3dformat_from_d3dx_pixel_format_id(d3dx_pixel_format_id_from_wic_pixel_format(&wic_pixel_format)); - if (SUCCEEDED(hr) && d3d_pixel_format != D3DFMT_UNKNOWN) + hr = d3dx_pixels_init(locked_rect.pBits, locked_rect.Pitch, 0, src_palette, src_fmt_desc->format, + src_rect->left, src_rect->top, src_rect->right, src_rect->bottom, 0, 1, &src_pixels); + if (FAILED(hr)) { - TRACE("Using pixel format %s %#x\n", debugstr_guid(&wic_pixel_format), d3d_pixel_format); - if (src_surface_desc.Format == d3d_pixel_format) /* Simple copy */ - { - if (FAILED(hr = lock_surface(src_surface, src_rect, &locked_rect, &temp_surface, FALSE))) - goto cleanup; - - IWICBitmapFrameEncode_WritePixels(frame, height, - locked_rect.Pitch, height * locked_rect.Pitch, locked_rect.pBits); - unlock_surface(src_surface, src_rect, temp_surface, FALSE); - } - else /* Pixel format conversion */ - { - const struct pixel_format_desc *src_format_desc, *dst_format_desc; - struct volume size; - DWORD dst_pitch; - void *dst_data; - - src_format_desc = get_format_info(src_surface_desc.Format); - dst_format_desc = get_format_info(d3d_pixel_format); - if (!is_conversion_from_supported(src_format_desc) - || !is_conversion_to_supported(dst_format_desc)) - { - FIXME("Unsupported format conversion %#x -> %#x.\n", - src_surface_desc.Format, d3d_pixel_format); - hr = E_NOTIMPL; - goto cleanup; - } - - size.width = width; - size.height = height; - size.depth = 1; - dst_pitch = width * dst_format_desc->bytes_per_pixel; - dst_data = malloc(dst_pitch * height); - if (!dst_data) - { - hr = E_OUTOFMEMORY; - goto cleanup; - } - if (FAILED(hr = lock_surface(src_surface, src_rect, &locked_rect, &temp_surface, FALSE))) - { - free(dst_data); - goto cleanup; - } - convert_argb_pixels(locked_rect.pBits, locked_rect.Pitch, 0, &size, src_format_desc, - dst_data, dst_pitch, 0, &size, dst_format_desc, 0, NULL); - unlock_surface(src_surface, src_rect, temp_surface, FALSE); - - IWICBitmapFrameEncode_WritePixels(frame, height, dst_pitch, dst_pitch * height, dst_data); - free(dst_data); - } - - hr = IWICBitmapFrameEncode_Commit(frame); - if (SUCCEEDED(hr)) hr = IWICBitmapEncoder_Commit(encoder); + unlock_surface(src_surface, NULL, temp_surface, FALSE); + return hr; } - else WARN("Unsupported pixel format %#x\n", src_surface_desc.Format); - /* copy data from stream to ID3DXBuffer */ - hr = IStream_Stat(stream, &stream_stats, STATFLAG_NONAME); - if (FAILED(hr)) goto cleanup_err; - - if (stream_stats.cbSize.u.HighPart != 0) + hr = d3dx_save_pixels_to_memory(&src_pixels, src_fmt_desc, file_format, dst_fmt, &buffer); + if (FAILED(hr)) { - hr = D3DXERR_INVALIDDATA; - goto cleanup; + unlock_surface(src_surface, NULL, temp_surface, FALSE); + return hr; } - size = stream_stats.cbSize.u.LowPart; - - /* Remove BMP header for DIB */ - if (file_format == D3DXIFF_DIB) - size -= sizeof(BITMAPFILEHEADER); - - hr = D3DXCreateBuffer(size, &buffer); - if (FAILED(hr)) goto cleanup; - hr = GetHGlobalFromStream(stream, &stream_hglobal); - if (SUCCEEDED(hr)) + hr = unlock_surface(src_surface, NULL, temp_surface, FALSE); + if (FAILED(hr)) { - void *buffer_pointer = ID3DXBuffer_GetBufferPointer(buffer); - void *stream_data = GlobalLock(stream_hglobal); - /* Remove BMP header for DIB */ - if (file_format == D3DXIFF_DIB) - stream_data = (void*)((BYTE*)stream_data + sizeof(BITMAPFILEHEADER)); - memcpy(buffer_pointer, stream_data, size); - GlobalUnlock(stream_hglobal); - *dst_buffer = buffer; + ID3DXBuffer_Release(buffer); + return hr; } - else ID3DXBuffer_Release(buffer); - -cleanup_err: - if (FAILED(hr) && hr != E_OUTOFMEMORY) - hr = D3DERR_INVALIDCALL; - -cleanup: - if (stream) IStream_Release(stream); - if (frame) IWICBitmapFrameEncode_Release(frame); - if (encoder_options) IPropertyBag2_Release(encoder_options); - - if (encoder) IWICBitmapEncoder_Release(encoder); - - return hr; + *dst_buffer = buffer; + return D3D_OK; } diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 54e45f73f986..a896522881bc 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -3857,7 +3857,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_P8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_P8 }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, }, @@ -3927,7 +3927,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8, }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, }, @@ -4090,7 +4090,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_format = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, }, @@ -4134,7 +4134,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A4R4G4B4, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A4R4G4B4, .todo_format = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, }, @@ -4173,7 +4173,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, }, @@ -4184,7 +4184,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, }, @@ -4195,7 +4195,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_A8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, }, 0xff @@ -4206,7 +4206,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, }, @@ -4217,7 +4217,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, }, @@ -4228,7 +4228,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, }, @@ -4261,7 +4261,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, }, @@ -4294,7 +4294,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3D_OK, D3DFMT_A8R8G8B8 }, { D3D_OK, D3DFMT_A16B16G16R16 }, { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, - { D3D_OK, D3DFMT_X8R8G8B8, .todo_hr = TRUE }, + { D3D_OK, D3DFMT_X8R8G8B8 }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, { D3D_OK, D3DFMT_A32B32G32R32F, .todo_hr = TRUE }, }, @@ -4305,7 +4305,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, }, @@ -4316,7 +4316,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, }, @@ -4327,7 +4327,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, }, @@ -4338,7 +4338,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, }, @@ -4349,7 +4349,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, }, @@ -4360,7 +4360,7 @@ static void test_save_surface_iffs(IDirect3DDevice9 *device) { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, - { D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DERR_INVALIDCALL }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, { D3DERR_INVALIDCALL, .todo_hr = TRUE }, }, @@ -4616,13 +4616,10 @@ static void test_D3DXSaveSurfaceToFileInMemory(IDirect3DDevice9 *device) hr = D3DXGetImageInfoFromFileInMemory(ID3DXBuffer_GetBufferPointer(buffer), ID3DXBuffer_GetBufferSize(buffer), &info); ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); - todo_wine ok(info.ImageFileFormat == D3DXIFF_BMP, "Unexpected ImageFileFormat %d.\n", info.ImageFileFormat); - todo_wine ok(ID3DXBuffer_GetBufferSize(buffer) == ID3DXBuffer_GetBufferSize(buffer2), "Unexpected buffer size.\n"); - if (ID3DXBuffer_GetBufferSize(buffer) == ID3DXBuffer_GetBufferSize(buffer2)) - { - ok(!memcmp(ID3DXBuffer_GetBufferPointer(buffer), ID3DXBuffer_GetBufferPointer(buffer2), ID3DXBuffer_GetBufferSize(buffer)), - "Files do not match.\n"); - } + ok(info.ImageFileFormat == D3DXIFF_BMP, "Unexpected ImageFileFormat %d.\n", info.ImageFileFormat); + ok(ID3DXBuffer_GetBufferSize(buffer) == ID3DXBuffer_GetBufferSize(buffer2), "Unexpected buffer size.\n"); + ok(!memcmp(ID3DXBuffer_GetBufferPointer(buffer), ID3DXBuffer_GetBufferPointer(buffer2), ID3DXBuffer_GetBufferSize(buffer)), + "Files do not match.\n"); ID3DXBuffer_Release(buffer); ID3DXBuffer_Release(buffer2); From baff3a5599192c8ee7a992e9ac6ce60a7161adc8 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 30 Oct 2024 09:59:43 -0400 Subject: [PATCH 0911/2542] d3dx9: Add stubs for D3DXSaveVolumeToFile{A,W,InMemory}(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_24/d3dx9_24.spec | 6 +- dlls/d3dx9_25/d3dx9_25.spec | 6 +- dlls/d3dx9_26/d3dx9_26.spec | 6 +- dlls/d3dx9_27/d3dx9_27.spec | 6 +- dlls/d3dx9_28/d3dx9_28.spec | 6 +- dlls/d3dx9_29/d3dx9_29.spec | 6 +- dlls/d3dx9_30/d3dx9_30.spec | 6 +- dlls/d3dx9_31/d3dx9_31.spec | 6 +- dlls/d3dx9_32/d3dx9_32.spec | 6 +- dlls/d3dx9_33/d3dx9_33.spec | 6 +- dlls/d3dx9_34/d3dx9_34.spec | 6 +- dlls/d3dx9_35/d3dx9_35.spec | 6 +- dlls/d3dx9_36/d3dx9_36.spec | 6 +- dlls/d3dx9_36/tests/d3dx9_test_images.h | 151 ++++++++++++++ dlls/d3dx9_36/tests/surface.c | 132 ------------ dlls/d3dx9_36/tests/texture.c | 7 - dlls/d3dx9_36/tests/volume.c | 254 ++++++++++++++++++++++++ dlls/d3dx9_36/volume.c | 25 +++ dlls/d3dx9_37/d3dx9_37.spec | 6 +- dlls/d3dx9_38/d3dx9_38.spec | 6 +- dlls/d3dx9_39/d3dx9_39.spec | 6 +- dlls/d3dx9_40/d3dx9_40.spec | 6 +- dlls/d3dx9_41/d3dx9_41.spec | 6 +- dlls/d3dx9_42/d3dx9_42.spec | 6 +- dlls/d3dx9_43/d3dx9_43.spec | 6 +- include/d3dx9tex.h | 3 + 26 files changed, 493 insertions(+), 199 deletions(-) diff --git a/dlls/d3dx9_24/d3dx9_24.spec b/dlls/d3dx9_24/d3dx9_24.spec index 0d51a21afbe3..1e622efcc66f 100644 --- a/dlls/d3dx9_24/d3dx9_24.spec +++ b/dlls/d3dx9_24/d3dx9_24.spec @@ -274,9 +274,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_25/d3dx9_25.spec b/dlls/d3dx9_25/d3dx9_25.spec index 5ad6e3d6ab20..5d26995fb8cb 100644 --- a/dlls/d3dx9_25/d3dx9_25.spec +++ b/dlls/d3dx9_25/d3dx9_25.spec @@ -274,9 +274,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_26/d3dx9_26.spec b/dlls/d3dx9_26/d3dx9_26.spec index ee2208755c8b..82611296e18e 100644 --- a/dlls/d3dx9_26/d3dx9_26.spec +++ b/dlls/d3dx9_26/d3dx9_26.spec @@ -278,9 +278,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_27/d3dx9_27.spec b/dlls/d3dx9_27/d3dx9_27.spec index ee2208755c8b..82611296e18e 100644 --- a/dlls/d3dx9_27/d3dx9_27.spec +++ b/dlls/d3dx9_27/d3dx9_27.spec @@ -278,9 +278,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_28/d3dx9_28.spec b/dlls/d3dx9_28/d3dx9_28.spec index 3db50029c3a3..6ccc6cffb8cb 100644 --- a/dlls/d3dx9_28/d3dx9_28.spec +++ b/dlls/d3dx9_28/d3dx9_28.spec @@ -283,9 +283,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_29/d3dx9_29.spec b/dlls/d3dx9_29/d3dx9_29.spec index 3db50029c3a3..6ccc6cffb8cb 100644 --- a/dlls/d3dx9_29/d3dx9_29.spec +++ b/dlls/d3dx9_29/d3dx9_29.spec @@ -283,9 +283,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_30/d3dx9_30.spec b/dlls/d3dx9_30/d3dx9_30.spec index 3db50029c3a3..6ccc6cffb8cb 100644 --- a/dlls/d3dx9_30/d3dx9_30.spec +++ b/dlls/d3dx9_30/d3dx9_30.spec @@ -283,9 +283,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_31/d3dx9_31.spec b/dlls/d3dx9_31/d3dx9_31.spec index 17f380f6d055..a33330edf605 100644 --- a/dlls/d3dx9_31/d3dx9_31.spec +++ b/dlls/d3dx9_31/d3dx9_31.spec @@ -280,9 +280,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_32/d3dx9_32.spec b/dlls/d3dx9_32/d3dx9_32.spec index 1de72897d283..d01b94a3bf7e 100644 --- a/dlls/d3dx9_32/d3dx9_32.spec +++ b/dlls/d3dx9_32/d3dx9_32.spec @@ -285,9 +285,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_33/d3dx9_33.spec b/dlls/d3dx9_33/d3dx9_33.spec index 1de72897d283..d01b94a3bf7e 100644 --- a/dlls/d3dx9_33/d3dx9_33.spec +++ b/dlls/d3dx9_33/d3dx9_33.spec @@ -285,9 +285,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_34/d3dx9_34.spec b/dlls/d3dx9_34/d3dx9_34.spec index 1de72897d283..d01b94a3bf7e 100644 --- a/dlls/d3dx9_34/d3dx9_34.spec +++ b/dlls/d3dx9_34/d3dx9_34.spec @@ -285,9 +285,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_35/d3dx9_35.spec b/dlls/d3dx9_35/d3dx9_35.spec index 1de72897d283..d01b94a3bf7e 100644 --- a/dlls/d3dx9_35/d3dx9_35.spec +++ b/dlls/d3dx9_35/d3dx9_35.spec @@ -285,9 +285,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec index 5bf7f675ee98..d5e39385847a 100644 --- a/dlls/d3dx9_36/d3dx9_36.spec +++ b/dlls/d3dx9_36/d3dx9_36.spec @@ -287,9 +287,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_36/tests/d3dx9_test_images.h b/dlls/d3dx9_36/tests/d3dx9_test_images.h index 68d4152d5429..f79e9f688947 100644 --- a/dlls/d3dx9_36/tests/d3dx9_test_images.h +++ b/dlls/d3dx9_36/tests/d3dx9_test_images.h @@ -23,6 +23,55 @@ #define COBJMACROS #include "d3dx9tex.h" +/* + * MAKE_DDHRESULT is first defined in d3dx9.h, with the same definition as the + * one in ddraw.h. + */ +#ifdef MAKE_DDHRESULT +#undef MAKE_DDHRESULT +#endif +#include "ddraw.h" + +/* dds_pixel_format.flags */ +#define DDS_PF_ALPHA 0x00000001 +#define DDS_PF_ALPHA_ONLY 0x00000002 +#define DDS_PF_FOURCC 0x00000004 +#define DDS_PF_INDEXED 0x00000020 +#define DDS_PF_RGB 0x00000040 +#define DDS_PF_LUMINANCE 0x00020000 +#define DDS_PF_BUMPLUMINANCE 0x00040000 +#define DDS_PF_BUMPDUDV 0x00080000 + +struct dds_pixel_format +{ + DWORD size; + DWORD flags; + DWORD fourcc; + DWORD bpp; + DWORD rmask; + DWORD gmask; + DWORD bmask; + DWORD amask; +}; + +struct dds_header +{ + DWORD size; + DWORD flags; + DWORD height; + DWORD width; + DWORD pitch_or_linear_size; + DWORD depth; + DWORD miplevels; + DWORD reserved[11]; + struct dds_pixel_format pixel_format; + DWORD caps; + DWORD caps2; + DWORD caps3; + DWORD caps4; + DWORD reserved2; +}; + static const struct { uint32_t filter; @@ -806,6 +855,82 @@ static inline void check_image_info_(const char *file, uint32_t line, const D3DX image_file_format, info->ImageFileFormat); } +#define check_dds_pixel_format_struct(pixel_format, expected_pixel_format, wine_todo) \ + check_dds_pixel_format_struct_(__FILE__, __LINE__, pixel_format, expected_pixel_format, wine_todo) +static inline void check_dds_pixel_format_struct_(const char *file, uint32_t line, const struct dds_pixel_format *pixel_format, + const struct dds_pixel_format *expected_pixel_format, BOOL wine_todo) +{ + BOOL matched; + + matched = !memcmp(expected_pixel_format, pixel_format, sizeof(*pixel_format)); + todo_wine_if(wine_todo) ok_(file, line)(matched, "Got unexpected dds pixel format values.\n"); + if (matched) + return; + + todo_wine_if(wine_todo && pixel_format->flags != expected_pixel_format->flags) + ok_(file, line)(pixel_format->flags == expected_pixel_format->flags, "Unexpected DDS pixel format flags %#lx.\n", + pixel_format->flags); + todo_wine_if(wine_todo && pixel_format->fourcc != expected_pixel_format->fourcc) + ok_(file, line)(pixel_format->fourcc == expected_pixel_format->fourcc, "Unexpected DDS pixel format fourcc %#lx.\n", + pixel_format->fourcc); + todo_wine_if(wine_todo && pixel_format->bpp != expected_pixel_format->bpp) + ok_(file, line)(pixel_format->bpp == expected_pixel_format->bpp, "Unexpected DDS pixel format bpp %#lx.\n", + pixel_format->bpp); + todo_wine_if(wine_todo && pixel_format->rmask != expected_pixel_format->rmask) + ok_(file, line)(pixel_format->rmask == expected_pixel_format->rmask, "Unexpected DDS pixel format rmask %#lx.\n", + pixel_format->rmask); + todo_wine_if(wine_todo && pixel_format->gmask != expected_pixel_format->gmask) + ok_(file, line)(pixel_format->gmask == expected_pixel_format->gmask, "Unexpected DDS pixel format gmask %#lx.\n", + pixel_format->gmask); + todo_wine_if(wine_todo && pixel_format->bmask != expected_pixel_format->bmask) + ok_(file, line)(pixel_format->bmask == expected_pixel_format->bmask, "Unexpected DDS pixel format bmask %#lx.\n", + pixel_format->bmask); + todo_wine_if(wine_todo && pixel_format->amask != expected_pixel_format->amask) + ok_(file, line)(pixel_format->amask == expected_pixel_format->amask, "Unexpected DDS pixel format amask %#lx.\n", + pixel_format->amask); +} + +#define check_dds_header(header, flags, height, width, pitch, depth, mip_levels, pixel_format, caps, caps2, wine_todo) \ + check_dds_header_(__FILE__, __LINE__, header, flags, height, width, pitch, depth, mip_levels, pixel_format, \ + caps, caps2, wine_todo) +static inline void check_dds_header_(const char *file, uint32_t line, const struct dds_header *header, uint32_t flags, + uint32_t height, uint32_t width, uint32_t pitch, uint32_t depth, uint32_t mip_levels, + const struct dds_pixel_format *pixel_format, uint32_t caps, uint32_t caps2, BOOL wine_todo) +{ + const struct dds_header expected_header = { sizeof(*header), flags, height, width, pitch, depth, mip_levels, { 0 }, + *pixel_format, caps, caps2, 0, 0, 0 }; + BOOL matched; + + matched = !memcmp(&expected_header, header, sizeof(*header)); + todo_wine_if(wine_todo) ok_(file, line)(matched, "Got unexpected dds header values.\n"); + if (matched) + return; + + todo_wine_if(wine_todo && header->flags != flags) + ok_(file, line)(header->flags == flags, "Unexpected DDS header flags %#lx.\n", header->flags); + todo_wine_if(wine_todo && header->width != width) + ok_(file, line)(header->width == width, "Unexpected DDS header width %#lx.\n", header->width); + todo_wine_if(wine_todo && header->height != height) + ok_(file, line)(header->height == height, "Unexpected DDS header height %#lx.\n", header->height); + todo_wine_if(wine_todo && header->pitch_or_linear_size != pitch) + ok_(file, line)(header->pitch_or_linear_size == pitch, "Unexpected DDS header pitch %#lx.\n", + header->pitch_or_linear_size); + todo_wine_if(wine_todo && header->depth != depth) + ok_(file, line)(header->depth == depth, "Unexpected DDS header depth %#lx.\n", header->depth); + todo_wine_if(wine_todo && header->miplevels != mip_levels) + ok_(file, line)(header->miplevels == mip_levels, "Unexpected DDS header mip levels %#lx.\n", header->miplevels); + ok_(file, line)(!memcmp(header->reserved, expected_header.reserved, sizeof(header->reserved)), + "Unexpected values in DDS header reserved field."); + check_dds_pixel_format_struct(&header->pixel_format, pixel_format, FALSE); + todo_wine_if(wine_todo && header->caps != caps) + ok_(file, line)(header->caps == caps, "Unexpected DDS header caps %#lx.\n", header->caps); + todo_wine_if(wine_todo && header->caps2 != caps2) + ok_(file, line)(header->caps2 == caps2, "Unexpected DDS header caps2 %#lx.\n", header->caps2); + ok_(file, line)(!header->caps3, "Unexpected DDS header caps3 %#lx.\n", header->caps3); + ok_(file, line)(!header->caps4, "Unexpected DDS header caps4 %#lx.\n", header->caps4); + ok_(file, line)(!header->reserved2, "Unexpected DDS header reserved2 %#lx.\n", header->reserved2); +} + struct volume_readback { IDirect3DVolume9 *volume; @@ -897,6 +1022,32 @@ static inline void get_texture_volume_readback_(const char *file, uint32_t line, } } +static inline BOOL compare_uint(uint32_t x, uint32_t y, uint32_t max_diff) +{ + uint32_t diff = x > y ? x - y : y - x; + + return diff <= max_diff; +} + +static inline BOOL compare_color_4bpp(uint32_t c1, uint32_t c2, uint8_t max_diff) +{ + return compare_uint(c1 & 0xff, c2 & 0xff, max_diff) + && compare_uint((c1 >> 8) & 0xff, (c2 >> 8) & 0xff, max_diff) + && compare_uint((c1 >> 16) & 0xff, (c2 >> 16) & 0xff, max_diff) + && compare_uint((c1 >> 24) & 0xff, (c2 >> 24) & 0xff, max_diff); +} + +#define check_volume_readback_pixel_4bpp_diff(rb, x, y, z, color, max_diff, todo) \ + _check_volume_readback_pixel_4bpp_diff(__FILE__, __LINE__, rb, x, y, z, color, max_diff, todo) +static inline void _check_volume_readback_pixel_4bpp_diff(const char *file, uint32_t line, struct volume_readback *rb, + uint32_t x, uint32_t y, uint32_t z, uint32_t expected_color, uint32_t max_diff, BOOL todo) +{ + uint32_t color = get_volume_readback_color(rb, x, y, z); + + todo_wine_if(todo) ok_(file, line)(compare_color_4bpp(color, expected_color, max_diff), + "Got color 0x%08x, expected 0x%08x.\n", color, expected_color); +} + #define check_volume_readback_pixel_4bpp(rb, x, y, z, color, todo) \ _check_volume_readback_pixel_4bpp(__FILE__, __LINE__, rb, x, y, z, color, todo) static inline void _check_volume_readback_pixel_4bpp(const char *file, uint32_t line, struct volume_readback *rb, diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index a896522881bc..7212ae82601b 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -26,22 +26,6 @@ #include #include "d3dx9_test_images.h" -/* - * MAKE_DDHRESULT is first defined in d3dx9.h, with the same definition as the - * one in ddraw.h. - */ -#ifdef MAKE_DDHRESULT -#undef MAKE_DDHRESULT -#endif -#include "ddraw.h" - -static BOOL compare_uint(uint32_t x, uint32_t y, uint32_t max_diff) -{ - uint32_t diff = x > y ? x - y : y - x; - - return diff <= max_diff; -} - static BOOL compare_float(float f, float g, uint32_t ulps) { int32_t x = *(int32_t *)&f; @@ -149,46 +133,6 @@ static HRESULT create_file(const char *filename, const unsigned char *data, cons return D3DERR_INVALIDCALL; } -/* dds_pixel_format.flags */ -#define DDS_PF_ALPHA 0x00000001 -#define DDS_PF_ALPHA_ONLY 0x00000002 -#define DDS_PF_FOURCC 0x00000004 -#define DDS_PF_INDEXED 0x00000020 -#define DDS_PF_RGB 0x00000040 -#define DDS_PF_LUMINANCE 0x00020000 -#define DDS_PF_BUMPLUMINANCE 0x00040000 -#define DDS_PF_BUMPDUDV 0x00080000 - -struct dds_pixel_format -{ - DWORD size; - DWORD flags; - DWORD fourcc; - DWORD bpp; - DWORD rmask; - DWORD gmask; - DWORD bmask; - DWORD amask; -}; - -struct dds_header -{ - DWORD size; - DWORD flags; - DWORD height; - DWORD width; - DWORD pitch_or_linear_size; - DWORD depth; - DWORD miplevels; - DWORD reserved[11]; - struct dds_pixel_format pixel_format; - DWORD caps; - DWORD caps2; - DWORD caps3; - DWORD caps4; - DWORD reserved2; -}; - /* fills dds_header with reasonable default values */ static void fill_dds_header(struct dds_header *header) { @@ -3425,82 +3369,6 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device) if(testbitmap_ok) DeleteFileA("testbitmap.bmp"); } -#define check_dds_pixel_format_struct(pixel_format, expected_pixel_format, wine_todo) \ - check_dds_pixel_format_struct_(__FILE__, __LINE__, pixel_format, expected_pixel_format, wine_todo) -static void check_dds_pixel_format_struct_(const char *file, uint32_t line, const struct dds_pixel_format *pixel_format, - const struct dds_pixel_format *expected_pixel_format, BOOL wine_todo) -{ - BOOL matched; - - matched = !memcmp(expected_pixel_format, pixel_format, sizeof(*pixel_format)); - todo_wine_if(wine_todo) ok_(file, line)(matched, "Got unexpected dds pixel format values.\n"); - if (matched) - return; - - todo_wine_if(wine_todo && pixel_format->flags != expected_pixel_format->flags) - ok_(file, line)(pixel_format->flags == expected_pixel_format->flags, "Unexpected DDS pixel format flags %#lx.\n", - pixel_format->flags); - todo_wine_if(wine_todo && pixel_format->fourcc != expected_pixel_format->fourcc) - ok_(file, line)(pixel_format->fourcc == expected_pixel_format->fourcc, "Unexpected DDS pixel format fourcc %#lx.\n", - pixel_format->fourcc); - todo_wine_if(wine_todo && pixel_format->bpp != expected_pixel_format->bpp) - ok_(file, line)(pixel_format->bpp == expected_pixel_format->bpp, "Unexpected DDS pixel format bpp %#lx.\n", - pixel_format->bpp); - todo_wine_if(wine_todo && pixel_format->rmask != expected_pixel_format->rmask) - ok_(file, line)(pixel_format->rmask == expected_pixel_format->rmask, "Unexpected DDS pixel format rmask %#lx.\n", - pixel_format->rmask); - todo_wine_if(wine_todo && pixel_format->gmask != expected_pixel_format->gmask) - ok_(file, line)(pixel_format->gmask == expected_pixel_format->gmask, "Unexpected DDS pixel format gmask %#lx.\n", - pixel_format->gmask); - todo_wine_if(wine_todo && pixel_format->bmask != expected_pixel_format->bmask) - ok_(file, line)(pixel_format->bmask == expected_pixel_format->bmask, "Unexpected DDS pixel format bmask %#lx.\n", - pixel_format->bmask); - todo_wine_if(wine_todo && pixel_format->amask != expected_pixel_format->amask) - ok_(file, line)(pixel_format->amask == expected_pixel_format->amask, "Unexpected DDS pixel format amask %#lx.\n", - pixel_format->amask); -} - -#define check_dds_header(header, flags, height, width, pitch, depth, mip_levels, pixel_format, caps, caps2, wine_todo) \ - check_dds_header_(__FILE__, __LINE__, header, flags, height, width, pitch, depth, mip_levels, pixel_format, \ - caps, caps2, wine_todo) -static void check_dds_header_(const char *file, uint32_t line, const struct dds_header *header, uint32_t flags, - uint32_t height, uint32_t width, uint32_t pitch, uint32_t depth, uint32_t mip_levels, - const struct dds_pixel_format *pixel_format, uint32_t caps, uint32_t caps2, BOOL wine_todo) -{ - const struct dds_header expected_header = { sizeof(*header), flags, height, width, pitch, depth, mip_levels, { 0 }, - *pixel_format, caps, caps2, 0, 0, 0 }; - BOOL matched; - - matched = !memcmp(&expected_header, header, sizeof(*header)); - todo_wine_if(wine_todo) ok_(file, line)(matched, "Got unexpected dds header values.\n"); - if (matched) - return; - - todo_wine_if(wine_todo && header->flags != flags) - ok_(file, line)(header->flags == flags, "Unexpected DDS header flags %#lx.\n", header->flags); - todo_wine_if(wine_todo && header->width != width) - ok_(file, line)(header->width == width, "Unexpected DDS header width %#lx.\n", header->width); - todo_wine_if(wine_todo && header->height != height) - ok_(file, line)(header->height == height, "Unexpected DDS header height %#lx.\n", header->height); - todo_wine_if(wine_todo && header->pitch_or_linear_size != pitch) - ok_(file, line)(header->pitch_or_linear_size == pitch, "Unexpected DDS header pitch %#lx.\n", - header->pitch_or_linear_size); - todo_wine_if(wine_todo && header->depth != depth) - ok_(file, line)(header->depth == depth, "Unexpected DDS header depth %#lx.\n", header->depth); - todo_wine_if(wine_todo && header->miplevels != mip_levels) - ok_(file, line)(header->miplevels == mip_levels, "Unexpected DDS header mip levels %#lx.\n", header->miplevels); - ok_(file, line)(!memcmp(header->reserved, expected_header.reserved, sizeof(header->reserved)), - "Unexpected values in DDS header reserved field."); - check_dds_pixel_format_struct(&header->pixel_format, pixel_format, FALSE); - todo_wine_if(wine_todo && header->caps != caps) - ok_(file, line)(header->caps == caps, "Unexpected DDS header caps %#lx.\n", header->caps); - todo_wine_if(wine_todo && header->caps2 != caps2) - ok_(file, line)(header->caps2 == caps2, "Unexpected DDS header caps2 %#lx.\n", header->caps2); - ok_(file, line)(!header->caps3, "Unexpected DDS header caps3 %#lx.\n", header->caps3); - ok_(file, line)(!header->caps4, "Unexpected DDS header caps4 %#lx.\n", header->caps4); - ok_(file, line)(!header->reserved2, "Unexpected DDS header reserved2 %#lx.\n", header->reserved2); -} - #define DDS_FILE_HEADER_SIZE (sizeof(uint32_t) + sizeof(struct dds_header)) #define PALETTED_DDS_FILE_HEADER_SIZE (DDS_FILE_HEADER_SIZE + (sizeof(PALETTEENTRY) * 256)) static void test_save_surface_to_dds(IDirect3DDevice9 *device) diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index ce7f6d7056f1..ca0069feee3b 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -168,13 +168,6 @@ static inline void check_texture_mip_levels_(uint32_t line, IDirect3DBaseTexture mip_levels, expected_mip_levels); } -static BOOL compare_uint(unsigned int x, unsigned int y, unsigned int max_diff) -{ - unsigned int diff = x > y ? x - y : y - x; - - return diff <= max_diff; -} - static BOOL compare_color(DWORD c1, DWORD c2, BYTE max_diff) { return compare_uint(c1 & 0xff, c2 & 0xff, max_diff) diff --git a/dlls/d3dx9_36/tests/volume.c b/dlls/d3dx9_36/tests/volume.c index d7529eb486cd..1d0ca101e946 100644 --- a/dlls/d3dx9_36/tests/volume.c +++ b/dlls/d3dx9_36/tests/volume.c @@ -392,6 +392,259 @@ static void test_D3DXLoadVolumeFromFileInMemory(IDirect3DDevice9 *device) IDirect3DVolumeTexture9_Release(volume_texture); } +static void set_vec3(D3DXVECTOR3 *v, float x, float y, float z) +{ + v->x = x; + v->y = y; + v->z = z; +} + +static const D3DXVECTOR4 quadrant_color[] = { + { 1.0f, 0.0f, 0.0f, 1.0f }, { 0.0f, 1.0f, 0.0f, 1.0f }, { 0.0f, 0.0f, 1.0f, 1.0f }, { 1.0f, 1.0f, 1.0f, 1.0f }, + { 1.0f, 1.0f, 1.0f, 1.0f }, { 0.0f, 0.0f, 1.0f, 1.0f }, { 1.0f, 0.0f, 0.0f, 1.0f }, { 0.0f, 1.0f, 0.0f, 1.0f }, +}; + +static void WINAPI fill_func_volume(D3DXVECTOR4 *value, const D3DXVECTOR3 *texcoord, + const D3DXVECTOR3 *texelsize, void *data) +{ + D3DXVECTOR3 vec = *texcoord; + uint32_t idx; + + if (data) + { + *value = *(D3DXVECTOR4 *)data; + return; + } + + set_vec3(&vec, (vec.x / texelsize->x) - 0.5f, (vec.y / texelsize->y) - 0.5f, (vec.z / texelsize->z) - 0.5f); + if (vec.x < 8.0f) + idx = vec.y < 8.0f ? 0 : 2; + else + idx = vec.y < 8.0f ? 1 : 3; + idx += vec.z < 1.0f ? 0 : 4; + + *value = quadrant_color[idx]; +} + +static void test_d3dx_save_volume_to_file(IDirect3DDevice9 *device) +{ + static const struct + { + D3DXIMAGE_FILEFORMAT file_format; + const char *file_name_a; + const WCHAR *file_name_w; + D3DFORMAT save_format; + } save_files[] = { + { D3DXIFF_BMP, "saved_volume_a.bmp", L"saved_volume_w.bmp", D3DFMT_A8R8G8B8 }, + { D3DXIFF_JPG, "saved_volume_a.jpg", L"saved_volume_w.jpg", D3DFMT_X8R8G8B8 }, + { D3DXIFF_TGA, "saved_volume_a.tga", L"saved_volume_w.tga", D3DFMT_A8R8G8B8 }, + { D3DXIFF_PNG, "saved_volume_a.png", L"saved_volume_w.png", D3DFMT_A8R8G8B8 }, + { D3DXIFF_DIB, "saved_volume_a.dib", L"saved_volume_w.dib", D3DFMT_A8R8G8B8 }, + { D3DXIFF_DDS, "saved_volume_a.dds", L"saved_volume_w.dds", D3DFMT_A8R8G8B8 }, + }; + static const struct dds_pixel_format d3dfmt_a8r8g8b8_pf = { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, + 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }; + struct + { + DWORD magic; + struct dds_header header; + BYTE *data; + } *dds; + static const uint32_t front_expected[] = { 0xffff0000, 0xff00ff00, 0xff0000ff, 0xffffffff }; + static const uint32_t back_expected[] = { 0xffffffff, 0xff0000ff, 0xffff0000, 0xff00ff00 }; + static const uint32_t coords[][2] = { { 0, 0 }, { 15, 0 }, { 0, 15 }, { 15, 15 } }; + const D3DXVECTOR4 clear_val = { 0.0f, 0.0f, 0.0f, 0.0f }; + IDirect3DVolumeTexture9 *volume_texture; + struct volume_readback volume_rb; + ID3DXBuffer *buffer = NULL; + IDirect3DVolume9 *volume; + D3DXIMAGE_INFO info; + uint32_t i, j, k; + D3DBOX box; + HRESULT hr; + + hr = IDirect3DDevice9_CreateVolumeTexture(device, 16, 16, 2, 1, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, + &volume_texture, NULL); + if (FAILED(hr)) + { + skip("Failed to create volume texture.\n"); + return; + } + + hr = D3DXFillVolumeTexture(volume_texture, fill_func_volume, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + IDirect3DVolumeTexture9_GetVolumeLevel(volume_texture, 0, &volume); + + set_box(&box, 0, 0, 16, 16, 1, 2); + hr = D3DXSaveVolumeToFileInMemory(&buffer, D3DXIFF_DDS, volume, NULL, NULL); + todo_wine ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + dds = ID3DXBuffer_GetBufferPointer(buffer); + check_dds_header(&dds->header, DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_DEPTH | DDSD_PIXELFORMAT, 16, 16, 0, + 2, 0, &d3dfmt_a8r8g8b8_pf, DDSCAPS_TEXTURE | DDSCAPS_ALPHA, DDSCAPS2_VOLUME, FALSE); + ID3DXBuffer_Release(buffer); + } + + /* + * Box only has a depth of 1, saves like a regular surface. E.g no depth + * flags/fields set. + */ + set_box(&box, 0, 0, 16, 16, 1, 2); + hr = D3DXSaveVolumeToFileInMemory(&buffer, D3DXIFF_DDS, volume, NULL, &box); + todo_wine ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + dds = ID3DXBuffer_GetBufferPointer(buffer); + check_dds_header(&dds->header, DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT, 16, 16, 0, 0, 0, + &d3dfmt_a8r8g8b8_pf, DDSCAPS_TEXTURE | DDSCAPS_ALPHA, 0, FALSE); + ID3DXBuffer_Release(buffer); + } + + for (i = 0; i < ARRAY_SIZE(save_files); ++i) + { + winetest_push_context("Test %u", i); + + /* ASCII string. */ + for (j = 0; j < 2; ++j) + { + const uint32_t *expected_colors = !j ? front_expected : back_expected; + + hr = D3DXFillVolumeTexture(volume_texture, fill_func_volume, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + hr = D3DXSaveVolumeToFileA(save_files[i].file_name_a, save_files[i].file_format, volume, NULL, !j ? NULL : &box); + todo_wine ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + hr = D3DXFillVolumeTexture(volume_texture, fill_func_volume, (void *)&clear_val); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + memset(&info, 0, sizeof(info)); + hr = D3DXLoadVolumeFromFileA(volume, NULL, NULL, save_files[i].file_name_a, NULL, D3DX_FILTER_NONE, 0, &info); + todo_wine ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + get_texture_volume_readback(device, volume_texture, 0, &volume_rb); + if (save_files[i].file_format == D3DXIFF_DDS) + { + check_image_info(&info, 16, 16, !j ? 2 : 1, 1, save_files[i].save_format, !j ? D3DRTYPE_VOLUMETEXTURE : D3DRTYPE_TEXTURE, + D3DXIFF_DDS, TRUE); + for (k = 0; k < ARRAY_SIZE(coords); ++k) + check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 0, expected_colors[k], 4, FALSE); + for (k = 0; k < ARRAY_SIZE(coords); ++k) + check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 1, !j ? back_expected[k] : 0, 4, FALSE); + } + else + { + const D3DXIMAGE_FILEFORMAT iff = save_files[i].file_format == D3DXIFF_DIB ? D3DXIFF_BMP : save_files[i].file_format; + const uint8_t max_diff = iff == D3DXIFF_JPG ? 40 : 0; + + check_image_info(&info, 16, 16, 1, 1, save_files[i].save_format, D3DRTYPE_TEXTURE, iff, FALSE); + for (k = 0; k < ARRAY_SIZE(coords); ++k) + check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 0, expected_colors[k], max_diff, FALSE); + } + release_volume_readback(&volume_rb); + } + DeleteFileA(save_files[i].file_name_a); + } + + /* Wide string. */ + for (j = 0; j < 2; ++j) + { + const uint32_t *expected_colors = !j ? front_expected : back_expected; + + hr = D3DXFillVolumeTexture(volume_texture, fill_func_volume, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + hr = D3DXSaveVolumeToFileW(save_files[i].file_name_w, save_files[i].file_format, volume, NULL, !j ? NULL : &box); + todo_wine ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + hr = D3DXFillVolumeTexture(volume_texture, fill_func_volume, (void *)&clear_val); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + memset(&info, 0, sizeof(info)); + hr = D3DXLoadVolumeFromFileW(volume, NULL, NULL, save_files[i].file_name_w, NULL, D3DX_FILTER_NONE, 0, &info); + todo_wine ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + get_texture_volume_readback(device, volume_texture, 0, &volume_rb); + if (save_files[i].file_format == D3DXIFF_DDS) + { + check_image_info(&info, 16, 16, !j ? 2 : 1, 1, save_files[i].save_format, !j ? D3DRTYPE_VOLUMETEXTURE : D3DRTYPE_TEXTURE, + D3DXIFF_DDS, TRUE); + for (k = 0; k < ARRAY_SIZE(coords); ++k) + check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 0, expected_colors[k], 0, FALSE); + for (k = 0; k < ARRAY_SIZE(coords); ++k) + check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 1, !j ? back_expected[k] : 0, 0, FALSE); + } + else + { + const D3DXIMAGE_FILEFORMAT iff = save_files[i].file_format == D3DXIFF_DIB ? D3DXIFF_BMP : save_files[i].file_format; + const uint8_t max_diff = iff == D3DXIFF_JPG ? 40 : 0; + + check_image_info(&info, 16, 16, 1, 1, save_files[i].save_format, D3DRTYPE_TEXTURE, iff, FALSE); + for (k = 0; k < ARRAY_SIZE(coords); ++k) + check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 0, expected_colors[k], max_diff, FALSE); + } + release_volume_readback(&volume_rb); + } + + DeleteFileW(save_files[i].file_name_w); + } + + /* InMemory. */ + for (j = 0; j < 2; ++j) + { + const uint32_t *expected_colors = !j ? front_expected : back_expected; + ID3DXBuffer *buffer = NULL; + + hr = D3DXFillVolumeTexture(volume_texture, fill_func_volume, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + hr = D3DXSaveVolumeToFileInMemory(&buffer, save_files[i].file_format, volume, NULL, !j ? NULL : &box); + todo_wine ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + if (!buffer) + continue; + + hr = D3DXFillVolumeTexture(volume_texture, fill_func_volume, (void *)&clear_val); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + memset(&info, 0, sizeof(info)); + hr = D3DXLoadVolumeFromFileInMemory(volume, NULL, NULL, ID3DXBuffer_GetBufferPointer(buffer), + ID3DXBuffer_GetBufferSize(buffer), NULL, D3DX_FILTER_NONE, 0, &info); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + ID3DXBuffer_Release(buffer); + + get_texture_volume_readback(device, volume_texture, 0, &volume_rb); + if (save_files[i].file_format == D3DXIFF_DDS) + { + check_image_info(&info, 16, 16, !j ? 2 : 1, 1, save_files[i].save_format, !j ? D3DRTYPE_VOLUMETEXTURE : D3DRTYPE_TEXTURE, + D3DXIFF_DDS, FALSE); + for (k = 0; k < ARRAY_SIZE(coords); ++k) + check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 0, expected_colors[k], 4, FALSE); + for (k = 0; k < ARRAY_SIZE(coords); ++k) + check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 1, !j ? back_expected[k] : 0, 4, FALSE); + } + else + { + const D3DXIMAGE_FILEFORMAT iff = save_files[i].file_format == D3DXIFF_DIB ? D3DXIFF_BMP : save_files[i].file_format; + const uint8_t max_diff = iff == D3DXIFF_JPG ? 40 : 0; + + check_image_info(&info, 16, 16, 1, 1, save_files[i].save_format, D3DRTYPE_TEXTURE, iff, FALSE); + for (k = 0; k < ARRAY_SIZE(coords); ++k) + check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 0, expected_colors[k], max_diff, TRUE); + } + release_volume_readback(&volume_rb); + } + + winetest_pop_context(); + } + + IDirect3DVolume9_Release(volume); + IDirect3DVolumeTexture9_Release(volume_texture); +} + START_TEST(volume) { HWND wnd; @@ -428,6 +681,7 @@ START_TEST(volume) test_D3DXLoadVolumeFromMemory(device); test_D3DXLoadVolumeFromFileInMemory(device); + test_d3dx_save_volume_to_file(device); IDirect3DDevice9_Release(device); IDirect3D9_Release(d3d); diff --git a/dlls/d3dx9_36/volume.c b/dlls/d3dx9_36/volume.c index e3444a063c77..14f6bdbfc330 100644 --- a/dlls/d3dx9_36/volume.c +++ b/dlls/d3dx9_36/volume.c @@ -279,3 +279,28 @@ HRESULT WINAPI D3DXLoadVolumeFromVolume(IDirect3DVolume9 *dst_volume, const PALE IDirect3DVolume9_UnlockBox(src_volume); return hr; } + +HRESULT WINAPI D3DXSaveVolumeToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE_FILEFORMAT file_format, + IDirect3DVolume9 *src_volume, const PALETTEENTRY *src_palette, const D3DBOX *src_box) +{ + FIXME("dst_buffer %p, file_format %#x, src_volume %p, src_palette %p, src_box %p, stub.\n", + dst_buffer, file_format, src_volume, src_palette, src_box); + + return E_NOTIMPL; +} + +HRESULT WINAPI D3DXSaveVolumeToFileA(const char *dst_filename, D3DXIMAGE_FILEFORMAT file_format, + IDirect3DVolume9 *src_volume, const PALETTEENTRY *src_palette, const D3DBOX *src_box) +{ + FIXME("dst_filename %s, file_format %#x, src_volume %p, src_palette %p, src_box %p stub.\n", + wine_dbgstr_a(dst_filename), file_format, src_volume, src_palette, src_box); + return E_NOTIMPL; +} + +HRESULT WINAPI D3DXSaveVolumeToFileW(const WCHAR *dst_filename, D3DXIMAGE_FILEFORMAT file_format, + IDirect3DVolume9 *src_volume, const PALETTEENTRY *src_palette, const D3DBOX *src_box) +{ + FIXME("dst_filename %s, file_format %#x, src_volume %p, src_palette %p, src_box %p stub.\n", + wine_dbgstr_w(dst_filename), file_format, src_volume, src_palette, src_box); + return E_NOTIMPL; +} diff --git a/dlls/d3dx9_37/d3dx9_37.spec b/dlls/d3dx9_37/d3dx9_37.spec index 5bf7f675ee98..d5e39385847a 100644 --- a/dlls/d3dx9_37/d3dx9_37.spec +++ b/dlls/d3dx9_37/d3dx9_37.spec @@ -287,9 +287,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_38/d3dx9_38.spec b/dlls/d3dx9_38/d3dx9_38.spec index 5bf7f675ee98..d5e39385847a 100644 --- a/dlls/d3dx9_38/d3dx9_38.spec +++ b/dlls/d3dx9_38/d3dx9_38.spec @@ -287,9 +287,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_39/d3dx9_39.spec b/dlls/d3dx9_39/d3dx9_39.spec index 5bf7f675ee98..d5e39385847a 100644 --- a/dlls/d3dx9_39/d3dx9_39.spec +++ b/dlls/d3dx9_39/d3dx9_39.spec @@ -287,9 +287,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_40/d3dx9_40.spec b/dlls/d3dx9_40/d3dx9_40.spec index 5bf7f675ee98..d5e39385847a 100644 --- a/dlls/d3dx9_40/d3dx9_40.spec +++ b/dlls/d3dx9_40/d3dx9_40.spec @@ -287,9 +287,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_41/d3dx9_41.spec b/dlls/d3dx9_41/d3dx9_41.spec index 5bf7f675ee98..d5e39385847a 100644 --- a/dlls/d3dx9_41/d3dx9_41.spec +++ b/dlls/d3dx9_41/d3dx9_41.spec @@ -287,9 +287,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_42/d3dx9_42.spec b/dlls/d3dx9_42/d3dx9_42.spec index 69558e0b255c..47129bc6ed11 100644 --- a/dlls/d3dx9_42/d3dx9_42.spec +++ b/dlls/d3dx9_42/d3dx9_42.spec @@ -280,9 +280,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx9_43/d3dx9_43.spec b/dlls/d3dx9_43/d3dx9_43.spec index 69558e0b255c..47129bc6ed11 100644 --- a/dlls/d3dx9_43/d3dx9_43.spec +++ b/dlls/d3dx9_43/d3dx9_43.spec @@ -280,9 +280,9 @@ @ stdcall D3DXSaveTextureToFileA(str long ptr ptr) @ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) @ stdcall D3DXSaveTextureToFileW(wstr long ptr ptr) -@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileA(str long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) +@ stdcall D3DXSaveVolumeToFileW(wstr long ptr ptr ptr) @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) diff --git a/include/d3dx9tex.h b/include/d3dx9tex.h index 3883165c67e0..fa690107650c 100644 --- a/include/d3dx9tex.h +++ b/include/d3dx9tex.h @@ -181,6 +181,9 @@ HRESULT WINAPI D3DXLoadVolumeFromMemory(struct IDirect3DVolume9 *destvolume, D3DFORMAT srcformat, UINT srcrowpitch, UINT srcslicepitch, const PALETTEENTRY *srcpalette, const D3DBOX *srcbox, DWORD filter, D3DCOLOR colorkey); +HRESULT WINAPI D3DXSaveVolumeToFileInMemory(struct ID3DXBuffer **destbuffer, D3DXIMAGE_FILEFORMAT destformat, + struct IDirect3DVolume9 *srcvolume, const PALETTEENTRY *srcpalette, const D3DBOX *srcbox); + HRESULT WINAPI D3DXSaveVolumeToFileA(const char *destfile, D3DXIMAGE_FILEFORMAT destformat, struct IDirect3DVolume9 *srcvolume, const PALETTEENTRY *srcpalette, const D3DBOX *srcbox); HRESULT WINAPI D3DXSaveVolumeToFileW(const WCHAR *destfile, D3DXIMAGE_FILEFORMAT destformat, From a67f7bd9d115cb1389df34d904c0e656a89c0f85 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Mon, 9 Dec 2024 12:47:56 -0500 Subject: [PATCH 0912/2542] d3dx9: Implement D3DXSaveVolumeToFile{A,W,InMemory}(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/d3dx9_private.h | 5 ++ dlls/d3dx9_36/surface.c | 16 +++-- dlls/d3dx9_36/tests/volume.c | 123 +++++++++++++++---------------- dlls/d3dx9_36/volume.c | 132 ++++++++++++++++++++++++++++++++-- 4 files changed, 198 insertions(+), 78 deletions(-) diff --git a/dlls/d3dx9_36/d3dx9_private.h b/dlls/d3dx9_36/d3dx9_private.h index 6a9b3e12b7ba..668700c2b642 100644 --- a/dlls/d3dx9_36/d3dx9_private.h +++ b/dlls/d3dx9_36/d3dx9_private.h @@ -316,6 +316,10 @@ HRESULT lock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, D3DLO IDirect3DSurface9 **temp_surface, BOOL write); HRESULT unlock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, IDirect3DSurface9 *temp_surface, BOOL update); +HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pixel_format_desc *src_fmt_desc, + D3DXIMAGE_FILEFORMAT file_format, enum d3dx_pixel_format_id *save_fmt); +HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct pixel_format_desc *src_fmt_desc, + D3DXIMAGE_FILEFORMAT file_format, enum d3dx_pixel_format_id dst_format, ID3DXBuffer **dst_buffer); HRESULT d3dx_pixels_init(const void *data, uint32_t row_pitch, uint32_t slice_pitch, const PALETTEENTRY *palette, enum d3dx_pixel_format_id format, uint32_t left, uint32_t top, uint32_t right, uint32_t bottom, uint32_t front, uint32_t back, struct d3dx_pixels *pixels); @@ -329,6 +333,7 @@ unsigned short float_32_to_16(const float in); float float_16_to_32(const unsigned short in); /* debug helpers */ +const char *debug_d3dx_image_file_format(D3DXIMAGE_FILEFORMAT format); const char *debug_d3dxparameter_class(D3DXPARAMETER_CLASS c); const char *debug_d3dxparameter_type(D3DXPARAMETER_TYPE t); const char *debug_d3dxparameter_registerset(D3DXREGISTER_SET r); diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 5885018130d1..722e0d321d75 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -636,8 +636,7 @@ static enum d3dx_pixel_format_id d3dx_get_closest_d3dx_pixel_format_id(const enu return (bestfmt) ? bestfmt->format : D3DX_PIXEL_FORMAT_COUNT; } -static const char *debug_d3dx_image_file_format(D3DXIMAGE_FILEFORMAT format); -static HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pixel_format_desc *src_fmt_desc, +HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pixel_format_desc *src_fmt_desc, D3DXIMAGE_FILEFORMAT file_format, enum d3dx_pixel_format_id *save_fmt) { const enum d3dx_pixel_format_id *save_fmts; @@ -720,6 +719,12 @@ static HRESULT d3dx_init_dds_header(struct dds_header *header, D3DRESOURCETYPE r header->height = size->height; header->width = size->width; header->caps = DDS_CAPS_TEXTURE; + if (size->depth > 1) + { + header->flags |= DDS_DEPTH; + header->depth = size->depth; + header->caps2 |= DDS_CAPS2_VOLUME; + } if (header->pixel_format.flags & DDS_PF_ALPHA || header->pixel_format.flags & DDS_PF_ALPHA_ONLY) header->caps |= DDSCAPS_ALPHA; if (header->pixel_format.flags & DDS_PF_INDEXED) @@ -882,7 +887,7 @@ static HRESULT d3dx_pixels_save_wic(struct d3dx_pixels *pixels, const struct pix return hr; } -static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct pixel_format_desc *src_fmt_desc, +HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct pixel_format_desc *src_fmt_desc, D3DXIMAGE_FILEFORMAT file_format, enum d3dx_pixel_format_id dst_format, ID3DXBuffer **dst_buffer) { const struct pixel_format_desc *dst_fmt_desc = get_d3dx_pixel_format_info(dst_format); @@ -899,6 +904,7 @@ static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const if (FAILED(hr)) return hr; + src_pixels->size.depth = (file_format == D3DXIFF_DDS) ? src_pixels->size.depth : 1; switch (file_format) { case D3DXIFF_DDS: @@ -907,7 +913,7 @@ static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const uint32_t header_size; header_size = is_index_format(dst_fmt_desc) ? sizeof(*header) + DDS_PALETTE_SIZE : sizeof(*header); - hr = D3DXCreateBuffer(dst_slice_pitch + header_size, &buffer); + hr = D3DXCreateBuffer((dst_slice_pitch * src_pixels->size.depth) + header_size, &buffer); if (FAILED(hr)) return hr; @@ -1249,7 +1255,7 @@ static BOOL image_is_argb(IWICBitmapFrameDecode *frame, struct d3dx_image *image return FALSE; } -static const char *debug_d3dx_image_file_format(D3DXIMAGE_FILEFORMAT format) +const char *debug_d3dx_image_file_format(D3DXIMAGE_FILEFORMAT format) { switch (format) { diff --git a/dlls/d3dx9_36/tests/volume.c b/dlls/d3dx9_36/tests/volume.c index 1d0ca101e946..d96473f935a6 100644 --- a/dlls/d3dx9_36/tests/volume.c +++ b/dlls/d3dx9_36/tests/volume.c @@ -478,14 +478,12 @@ static void test_d3dx_save_volume_to_file(IDirect3DDevice9 *device) set_box(&box, 0, 0, 16, 16, 1, 2); hr = D3DXSaveVolumeToFileInMemory(&buffer, D3DXIFF_DDS, volume, NULL, NULL); - todo_wine ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); - if (SUCCEEDED(hr)) - { - dds = ID3DXBuffer_GetBufferPointer(buffer); - check_dds_header(&dds->header, DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_DEPTH | DDSD_PIXELFORMAT, 16, 16, 0, - 2, 0, &d3dfmt_a8r8g8b8_pf, DDSCAPS_TEXTURE | DDSCAPS_ALPHA, DDSCAPS2_VOLUME, FALSE); - ID3DXBuffer_Release(buffer); - } + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + dds = ID3DXBuffer_GetBufferPointer(buffer); + check_dds_header(&dds->header, DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_DEPTH | DDSD_PIXELFORMAT, 16, 16, 0, + 2, 0, &d3dfmt_a8r8g8b8_pf, DDSCAPS_TEXTURE | DDSCAPS_ALPHA, DDSCAPS2_VOLUME, FALSE); + ID3DXBuffer_Release(buffer); /* * Box only has a depth of 1, saves like a regular surface. E.g no depth @@ -493,14 +491,12 @@ static void test_d3dx_save_volume_to_file(IDirect3DDevice9 *device) */ set_box(&box, 0, 0, 16, 16, 1, 2); hr = D3DXSaveVolumeToFileInMemory(&buffer, D3DXIFF_DDS, volume, NULL, &box); - todo_wine ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); - if (SUCCEEDED(hr)) - { - dds = ID3DXBuffer_GetBufferPointer(buffer); - check_dds_header(&dds->header, DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT, 16, 16, 0, 0, 0, - &d3dfmt_a8r8g8b8_pf, DDSCAPS_TEXTURE | DDSCAPS_ALPHA, 0, FALSE); - ID3DXBuffer_Release(buffer); - } + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + dds = ID3DXBuffer_GetBufferPointer(buffer); + check_dds_header(&dds->header, DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT, 16, 16, 0, 0, 0, + &d3dfmt_a8r8g8b8_pf, DDSCAPS_TEXTURE | DDSCAPS_ALPHA, 0, FALSE); + ID3DXBuffer_Release(buffer); for (i = 0; i < ARRAY_SIZE(save_files); ++i) { @@ -515,37 +511,36 @@ static void test_d3dx_save_volume_to_file(IDirect3DDevice9 *device) ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); hr = D3DXSaveVolumeToFileA(save_files[i].file_name_a, save_files[i].file_format, volume, NULL, !j ? NULL : &box); - todo_wine ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); hr = D3DXFillVolumeTexture(volume_texture, fill_func_volume, (void *)&clear_val); ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); memset(&info, 0, sizeof(info)); hr = D3DXLoadVolumeFromFileA(volume, NULL, NULL, save_files[i].file_name_a, NULL, D3DX_FILTER_NONE, 0, &info); - todo_wine ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); - if (SUCCEEDED(hr)) + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + get_texture_volume_readback(device, volume_texture, 0, &volume_rb); + if (save_files[i].file_format == D3DXIFF_DDS) { - get_texture_volume_readback(device, volume_texture, 0, &volume_rb); - if (save_files[i].file_format == D3DXIFF_DDS) - { - check_image_info(&info, 16, 16, !j ? 2 : 1, 1, save_files[i].save_format, !j ? D3DRTYPE_VOLUMETEXTURE : D3DRTYPE_TEXTURE, - D3DXIFF_DDS, TRUE); - for (k = 0; k < ARRAY_SIZE(coords); ++k) - check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 0, expected_colors[k], 4, FALSE); - for (k = 0; k < ARRAY_SIZE(coords); ++k) - check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 1, !j ? back_expected[k] : 0, 4, FALSE); - } - else - { - const D3DXIMAGE_FILEFORMAT iff = save_files[i].file_format == D3DXIFF_DIB ? D3DXIFF_BMP : save_files[i].file_format; - const uint8_t max_diff = iff == D3DXIFF_JPG ? 40 : 0; - - check_image_info(&info, 16, 16, 1, 1, save_files[i].save_format, D3DRTYPE_TEXTURE, iff, FALSE); - for (k = 0; k < ARRAY_SIZE(coords); ++k) - check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 0, expected_colors[k], max_diff, FALSE); - } - release_volume_readback(&volume_rb); + check_image_info(&info, 16, 16, !j ? 2 : 1, 1, save_files[i].save_format, !j ? D3DRTYPE_VOLUMETEXTURE : D3DRTYPE_TEXTURE, + D3DXIFF_DDS, FALSE); + for (k = 0; k < ARRAY_SIZE(coords); ++k) + check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 0, expected_colors[k], 4, FALSE); + for (k = 0; k < ARRAY_SIZE(coords); ++k) + check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 1, !j ? back_expected[k] : 0, 4, FALSE); + } + else + { + const D3DXIMAGE_FILEFORMAT iff = save_files[i].file_format == D3DXIFF_DIB ? D3DXIFF_BMP : save_files[i].file_format; + const uint8_t max_diff = iff == D3DXIFF_JPG ? 40 : 0; + + check_image_info(&info, 16, 16, 1, 1, save_files[i].save_format, D3DRTYPE_TEXTURE, iff, FALSE); + for (k = 0; k < ARRAY_SIZE(coords); ++k) + check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 0, expected_colors[k], max_diff, FALSE); } + release_volume_readback(&volume_rb); + DeleteFileA(save_files[i].file_name_a); } @@ -558,37 +553,35 @@ static void test_d3dx_save_volume_to_file(IDirect3DDevice9 *device) ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); hr = D3DXSaveVolumeToFileW(save_files[i].file_name_w, save_files[i].file_format, volume, NULL, !j ? NULL : &box); - todo_wine ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); hr = D3DXFillVolumeTexture(volume_texture, fill_func_volume, (void *)&clear_val); ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); memset(&info, 0, sizeof(info)); hr = D3DXLoadVolumeFromFileW(volume, NULL, NULL, save_files[i].file_name_w, NULL, D3DX_FILTER_NONE, 0, &info); - todo_wine ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); - if (SUCCEEDED(hr)) + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + get_texture_volume_readback(device, volume_texture, 0, &volume_rb); + if (save_files[i].file_format == D3DXIFF_DDS) { - get_texture_volume_readback(device, volume_texture, 0, &volume_rb); - if (save_files[i].file_format == D3DXIFF_DDS) - { - check_image_info(&info, 16, 16, !j ? 2 : 1, 1, save_files[i].save_format, !j ? D3DRTYPE_VOLUMETEXTURE : D3DRTYPE_TEXTURE, - D3DXIFF_DDS, TRUE); - for (k = 0; k < ARRAY_SIZE(coords); ++k) - check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 0, expected_colors[k], 0, FALSE); - for (k = 0; k < ARRAY_SIZE(coords); ++k) - check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 1, !j ? back_expected[k] : 0, 0, FALSE); - } - else - { - const D3DXIMAGE_FILEFORMAT iff = save_files[i].file_format == D3DXIFF_DIB ? D3DXIFF_BMP : save_files[i].file_format; - const uint8_t max_diff = iff == D3DXIFF_JPG ? 40 : 0; - - check_image_info(&info, 16, 16, 1, 1, save_files[i].save_format, D3DRTYPE_TEXTURE, iff, FALSE); - for (k = 0; k < ARRAY_SIZE(coords); ++k) - check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 0, expected_colors[k], max_diff, FALSE); - } - release_volume_readback(&volume_rb); + check_image_info(&info, 16, 16, !j ? 2 : 1, 1, save_files[i].save_format, !j ? D3DRTYPE_VOLUMETEXTURE : D3DRTYPE_TEXTURE, + D3DXIFF_DDS, FALSE); + for (k = 0; k < ARRAY_SIZE(coords); ++k) + check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 0, expected_colors[k], 0, FALSE); + for (k = 0; k < ARRAY_SIZE(coords); ++k) + check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 1, !j ? back_expected[k] : 0, 0, FALSE); + } + else + { + const D3DXIMAGE_FILEFORMAT iff = save_files[i].file_format == D3DXIFF_DIB ? D3DXIFF_BMP : save_files[i].file_format; + const uint8_t max_diff = iff == D3DXIFF_JPG ? 40 : 0; + + check_image_info(&info, 16, 16, 1, 1, save_files[i].save_format, D3DRTYPE_TEXTURE, iff, FALSE); + for (k = 0; k < ARRAY_SIZE(coords); ++k) + check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 0, expected_colors[k], max_diff, FALSE); } + release_volume_readback(&volume_rb); DeleteFileW(save_files[i].file_name_w); } @@ -603,9 +596,7 @@ static void test_d3dx_save_volume_to_file(IDirect3DDevice9 *device) ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); hr = D3DXSaveVolumeToFileInMemory(&buffer, save_files[i].file_format, volume, NULL, !j ? NULL : &box); - todo_wine ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); - if (!buffer) - continue; + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); hr = D3DXFillVolumeTexture(volume_texture, fill_func_volume, (void *)&clear_val); ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); @@ -633,7 +624,7 @@ static void test_d3dx_save_volume_to_file(IDirect3DDevice9 *device) check_image_info(&info, 16, 16, 1, 1, save_files[i].save_format, D3DRTYPE_TEXTURE, iff, FALSE); for (k = 0; k < ARRAY_SIZE(coords); ++k) - check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 0, expected_colors[k], max_diff, TRUE); + check_volume_readback_pixel_4bpp_diff(&volume_rb, coords[k][0], coords[k][1], 0, expected_colors[k], max_diff, FALSE); } release_volume_readback(&volume_rb); } diff --git a/dlls/d3dx9_36/volume.c b/dlls/d3dx9_36/volume.c index 14f6bdbfc330..488e937d108a 100644 --- a/dlls/d3dx9_36/volume.c +++ b/dlls/d3dx9_36/volume.c @@ -283,24 +283,142 @@ HRESULT WINAPI D3DXLoadVolumeFromVolume(IDirect3DVolume9 *dst_volume, const PALE HRESULT WINAPI D3DXSaveVolumeToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE_FILEFORMAT file_format, IDirect3DVolume9 *src_volume, const PALETTEENTRY *src_palette, const D3DBOX *src_box) { - FIXME("dst_buffer %p, file_format %#x, src_volume %p, src_palette %p, src_box %p, stub.\n", + const struct pixel_format_desc *src_fmt_desc; + RECT src_rect_aligned, src_rect_unaligned; + D3DBOX src_box_aligned, src_box_tmp; + enum d3dx_pixel_format_id dst_fmt; + struct d3dx_pixels src_pixels; + D3DLOCKED_BOX locked_box; + ID3DXBuffer *buffer; + D3DVOLUME_DESC desc; + HRESULT hr; + + TRACE("dst_buffer %p, file_format %#x, src_volume %p, src_palette %p, src_box %p.\n", dst_buffer, file_format, src_volume, src_palette, src_box); - return E_NOTIMPL; + if (!dst_buffer || !src_volume || file_format > D3DXIFF_PFM) + return D3DERR_INVALIDCALL; + + *dst_buffer = NULL; + switch (file_format) + { + case D3DXIFF_HDR: + case D3DXIFF_PFM: + case D3DXIFF_PPM: + FIXME("File format %s is not supported yet.\n", debug_d3dx_image_file_format(file_format)); + return E_NOTIMPL; + + default: + break; + } + + IDirect3DVolume9_GetDesc(src_volume, &desc); + src_fmt_desc = get_format_info(desc.Format); + if (is_unknown_format(src_fmt_desc)) + return E_NOTIMPL; + + if (!src_palette && is_index_format(src_fmt_desc)) + { + FIXME("Default palette unimplemented.\n"); + return E_NOTIMPL; + } + + if (!src_box) + { + set_d3dbox(&src_box_tmp, 0, 0, desc.Width, desc.Height, 0, desc.Depth); + src_box = &src_box_tmp; + } + else + { + if (src_box->Left >= src_box->Right || src_box->Right > desc.Width + || src_box->Top >= src_box->Bottom || src_box->Bottom > desc.Height + || src_box->Front >= src_box->Back || src_box->Back > desc.Depth) + { + WARN("Invalid src_box specified.\n"); + return D3DERR_INVALIDCALL; + } + } + + hr = d3dx_get_save_pixel_format_from_image_file_format(src_fmt_desc, file_format, &dst_fmt); + if (FAILED(hr)) + return hr; + + get_aligned_rect(src_box->Left, src_box->Top, src_box->Right, src_box->Bottom, desc.Width, desc.Height, + src_fmt_desc, &src_rect_aligned); + set_d3dbox(&src_box_aligned, src_rect_aligned.left, src_rect_aligned.top, src_rect_aligned.right, + src_rect_aligned.bottom, src_box->Front, src_box->Back); + + hr = IDirect3DVolume9_LockBox(src_volume, &locked_box, &src_box_aligned, 0); + if (FAILED(hr)) + return hr; + + SetRect(&src_rect_unaligned, src_box->Left, src_box->Top, src_box->Right, src_box->Bottom); + OffsetRect(&src_rect_unaligned, -src_rect_aligned.left, -src_rect_aligned.top); + set_d3dx_pixels(&src_pixels, locked_box.pBits, locked_box.RowPitch, locked_box.SlicePitch, src_palette, + (src_box_aligned.Right - src_box_aligned.Left), (src_box_aligned.Bottom - src_box_aligned.Top), + (src_box_aligned.Back - src_box_aligned.Front), &src_rect_unaligned); + + hr = d3dx_save_pixels_to_memory(&src_pixels, src_fmt_desc, file_format, dst_fmt, &buffer); + if (FAILED(hr)) + { + IDirect3DVolume9_UnlockBox(src_volume); + return hr; + } + + IDirect3DVolume9_UnlockBox(src_volume); + *dst_buffer = buffer; + return D3D_OK; } HRESULT WINAPI D3DXSaveVolumeToFileA(const char *dst_filename, D3DXIMAGE_FILEFORMAT file_format, IDirect3DVolume9 *src_volume, const PALETTEENTRY *src_palette, const D3DBOX *src_box) { - FIXME("dst_filename %s, file_format %#x, src_volume %p, src_palette %p, src_box %p stub.\n", + ID3DXBuffer *buffer; + WCHAR *filename; + int32_t len; + HRESULT hr; + + TRACE("(%s, %#x, %p, %p, %p): relay\n", wine_dbgstr_a(dst_filename), file_format, src_volume, src_palette, src_box); - return E_NOTIMPL; + + if (!dst_filename) + return D3DERR_INVALIDCALL; + + len = MultiByteToWideChar(CP_ACP, 0, dst_filename, -1, NULL, 0); + filename = malloc(len * sizeof(WCHAR)); + if (!filename) + return E_OUTOFMEMORY; + MultiByteToWideChar(CP_ACP, 0, dst_filename, -1, filename, len); + + hr = D3DXSaveVolumeToFileInMemory(&buffer, file_format, src_volume, src_palette, src_box); + if (SUCCEEDED(hr)) + { + hr = write_buffer_to_file(filename, buffer); + ID3DXBuffer_Release(buffer); + } + + free(filename); + return hr; } HRESULT WINAPI D3DXSaveVolumeToFileW(const WCHAR *dst_filename, D3DXIMAGE_FILEFORMAT file_format, IDirect3DVolume9 *src_volume, const PALETTEENTRY *src_palette, const D3DBOX *src_box) { - FIXME("dst_filename %s, file_format %#x, src_volume %p, src_palette %p, src_box %p stub.\n", - wine_dbgstr_w(dst_filename), file_format, src_volume, src_palette, src_box); - return E_NOTIMPL; + ID3DXBuffer *buffer; + HRESULT hr; + + TRACE("(%s, %#x, %p, %p, %p): relay\n", + wine_dbgstr_w(dst_filename), file_format, src_volume, src_palette, src_box); + + if (!dst_filename) + return D3DERR_INVALIDCALL; + + hr = D3DXSaveVolumeToFileInMemory(&buffer, file_format, src_volume, src_palette, src_box); + if (SUCCEEDED(hr)) + { + hr = write_buffer_to_file(dst_filename, buffer); + ID3DXBuffer_Release(buffer); + } + + return hr; } From 2d56c1d0054649de24767ed182f7ecf9ba14d77d Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 30 Oct 2024 11:31:38 -0400 Subject: [PATCH 0913/2542] d3dx9: Use D3DXSaveVolumeToFileInMemory() inside of D3DXSaveTextureToFileInMemory(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/tests/texture.c | 2 +- dlls/d3dx9_36/texture.c | 31 ++++++++++++++++++++++--------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index ca0069feee3b..1c8ba0507b3b 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -3230,7 +3230,6 @@ static void test_D3DXSaveTextureToFileInMemory(IDirect3DDevice9 *device) return; } - todo_wine { hr = D3DXSaveTextureToFileInMemory(&buffer, D3DXIFF_BMP, (IDirect3DBaseTexture9 *)volume_texture, NULL); ok(hr == D3D_OK, "D3DXSaveTextureToFileInMemory returned %#lx, expected %#lx\n", hr, D3D_OK); if (SUCCEEDED(hr)) @@ -3249,6 +3248,7 @@ static void test_D3DXSaveTextureToFileInMemory(IDirect3DDevice9 *device) ID3DXBuffer_Release(buffer); } + todo_wine { hr = D3DXSaveTextureToFileInMemory(&buffer, D3DXIFF_DDS, (IDirect3DBaseTexture9 *)volume_texture, NULL); ok(hr == D3D_OK, "D3DXSaveTextureToFileInMemory returned %#lx, expected %#lx\n", hr, D3D_OK); if (SUCCEEDED(hr)) diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index 719a2787445b..4b4192dc8b68 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -1858,7 +1858,6 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE { HRESULT hr; D3DRESOURCETYPE type; - IDirect3DSurface9 *surface; TRACE("dst_buffer %p, file_format %u, src_texture %p, src_palette %p.\n", dst_buffer, file_format, src_texture, src_palette); @@ -1876,21 +1875,35 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE { case D3DRTYPE_TEXTURE: case D3DRTYPE_CUBETEXTURE: + { + IDirect3DSurface9 *surface; + hr = get_surface(type, src_texture, D3DCUBEMAP_FACE_POSITIVE_X, 0, &surface); + if (SUCCEEDED(hr)) + { + hr = D3DXSaveSurfaceToFileInMemory(dst_buffer, file_format, surface, src_palette, NULL); + IDirect3DSurface9_Release(surface); + } break; + } + case D3DRTYPE_VOLUMETEXTURE: - FIXME("Volume textures aren't supported yet\n"); - return E_NOTIMPL; + { + IDirect3DVolume9 *volume; + + hr = IDirect3DVolumeTexture9_GetVolumeLevel((IDirect3DVolumeTexture9 *)src_texture, 0, &volume); + if (SUCCEEDED(hr)) + { + hr = D3DXSaveVolumeToFileInMemory(dst_buffer, file_format, volume, src_palette, NULL); + IDirect3DVolume9_Release(volume); + } + break; + } + default: return D3DERR_INVALIDCALL; } - if (SUCCEEDED(hr)) - { - hr = D3DXSaveSurfaceToFileInMemory(dst_buffer, file_format, surface, src_palette, NULL); - IDirect3DSurface9_Release(surface); - } - return hr; } From 78316dfe497e4a727ab00c7a3452df083c1cabab Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Tue, 10 Dec 2024 08:26:46 -0500 Subject: [PATCH 0914/2542] d3dx9/tests: Add more tests for saving textures to DDS files. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/tests/d3dx9_test_images.h | 86 ++++++++++++ dlls/d3dx9_36/tests/surface.c | 83 ------------ dlls/d3dx9_36/tests/texture.c | 167 ++++++++++++++++++++++++ 3 files changed, 253 insertions(+), 83 deletions(-) diff --git a/dlls/d3dx9_36/tests/d3dx9_test_images.h b/dlls/d3dx9_36/tests/d3dx9_test_images.h index f79e9f688947..3ed5373c705d 100644 --- a/dlls/d3dx9_36/tests/d3dx9_test_images.h +++ b/dlls/d3dx9_36/tests/d3dx9_test_images.h @@ -72,6 +72,9 @@ struct dds_header DWORD reserved2; }; +#define DDS_FILE_HEADER_SIZE (sizeof(uint32_t) + sizeof(struct dds_header)) +#define PALETTED_DDS_FILE_HEADER_SIZE (DDS_FILE_HEADER_SIZE + (sizeof(PALETTEENTRY) * 256)) + static const struct { uint32_t filter; @@ -91,6 +94,89 @@ test_filter_values[] = { 0xff800001, D3DERR_INVALIDCALL }, }; +static const PALETTEENTRY test_palette[256] = +{ + {0x00,0x00,0x00,0x00}, {0x00,0x00,0x80,0x01}, {0x00,0x80,0x00,0x02}, {0x00,0x80,0x80,0x03}, + {0x80,0x00,0x00,0x04}, {0x80,0x00,0x80,0x05}, {0x80,0x80,0x00,0x06}, {0xc0,0xc0,0xc0,0x07}, + {0xc0,0xdc,0xc0,0x08}, {0xf0,0xca,0xa6,0x09}, {0x00,0x20,0x40,0x0a}, {0x00,0x20,0x60,0x0b}, + {0x00,0x20,0x80,0x0c}, {0x00,0x20,0xa0,0x0d}, {0x00,0x20,0xc0,0x0e}, {0x00,0x20,0xe0,0x0f}, + + {0x00,0x40,0x00,0x10}, {0x00,0x40,0x20,0x11}, {0x00,0x40,0x40,0x12}, {0x00,0x40,0x60,0x13}, + {0x00,0x40,0x80,0x14}, {0x00,0x40,0xa0,0x15}, {0x00,0x40,0xc0,0x16}, {0x00,0x40,0xe0,0x17}, + {0x00,0x60,0x00,0x18}, {0x00,0x60,0x20,0x19}, {0x00,0x60,0x40,0x1a}, {0x00,0x60,0x60,0x1b}, + {0x00,0x60,0x80,0x1c}, {0x00,0x60,0xa0,0x1d}, {0x00,0x60,0xc0,0x1e}, {0x00,0x60,0xe0,0x1f}, + + {0x00,0x80,0x00,0x20}, {0x00,0x80,0x20,0x21}, {0x00,0x80,0x40,0x22}, {0x00,0x80,0x60,0x23}, + {0x00,0x80,0x80,0x24}, {0x00,0x80,0xa0,0x25}, {0x00,0x80,0xc0,0x26}, {0x00,0x80,0xe0,0x27}, + {0x00,0xa0,0x00,0x28}, {0x00,0xa0,0x20,0x29}, {0x00,0xa0,0x40,0x2a}, {0x00,0xa0,0x60,0x2b}, + {0x00,0xa0,0x80,0x2c}, {0x00,0xa0,0xa0,0x2d}, {0x00,0xa0,0xc0,0x2e}, {0x00,0xa0,0xe0,0x2f}, + + {0x00,0xc0,0x00,0x30}, {0x00,0xc0,0x20,0x31}, {0x00,0xc0,0x40,0x32}, {0x00,0xc0,0x60,0x33}, + {0x00,0xc0,0x80,0x34}, {0x00,0xc0,0xa0,0x35}, {0x00,0xc0,0xc0,0x36}, {0x00,0xc0,0xe0,0x37}, + {0x00,0xe0,0x00,0x38}, {0x00,0xe0,0x20,0x39}, {0x00,0xe0,0x40,0x3a}, {0x00,0xe0,0x60,0x3b}, + {0x00,0xe0,0x80,0x3c}, {0x00,0xe0,0xa0,0x3d}, {0x00,0xe0,0xc0,0x3e}, {0x00,0xe0,0xe0,0x3f}, + + {0x40,0x00,0x00,0x40}, {0x40,0x00,0x20,0x41}, {0x40,0x00,0x40,0x42}, {0x40,0x00,0x60,0x43}, + {0x40,0x00,0x80,0x44}, {0x40,0x00,0xa0,0x45}, {0x40,0x00,0xc0,0x46}, {0x40,0x00,0xe0,0x47}, + {0x40,0x20,0x00,0x48}, {0x40,0x20,0x20,0x49}, {0x40,0x20,0x40,0x4a}, {0x40,0x20,0x60,0x4b}, + {0x40,0x20,0x80,0x4c}, {0x40,0x20,0xa0,0x4d}, {0x40,0x20,0xc0,0x4e}, {0x40,0x20,0xe0,0x4f}, + + {0x40,0x40,0x00,0x50}, {0x40,0x40,0x20,0x51}, {0x40,0x40,0x40,0x52}, {0x40,0x40,0x60,0x53}, + {0x40,0x40,0x80,0x54}, {0x40,0x40,0xa0,0x55}, {0x40,0x40,0xc0,0x56}, {0x40,0x40,0xe0,0x57}, + {0x40,0x60,0x00,0x58}, {0x40,0x60,0x20,0x59}, {0x40,0x60,0x40,0x5a}, {0x40,0x60,0x60,0x5b}, + {0x40,0x60,0x80,0x5c}, {0x40,0x60,0xa0,0x5d}, {0x40,0x60,0xc0,0x5e}, {0x40,0x60,0xe0,0x5f}, + + {0x40,0x80,0x00,0x60}, {0x40,0x80,0x20,0x61}, {0x40,0x80,0x40,0x62}, {0x40,0x80,0x60,0x63}, + {0x40,0x80,0x80,0x64}, {0x40,0x80,0xa0,0x65}, {0x40,0x80,0xc0,0x66}, {0x40,0x80,0xe0,0x67}, + {0x40,0xa0,0x00,0x68}, {0x40,0xa0,0x20,0x69}, {0x40,0xa0,0x40,0x6a}, {0x40,0xa0,0x60,0x6b}, + {0x40,0xa0,0x80,0x6c}, {0x40,0xa0,0xa0,0x6d}, {0x40,0xa0,0xc0,0x6e}, {0x40,0xa0,0xe0,0x6f}, + + {0x40,0xc0,0x00,0x70}, {0x40,0xc0,0x20,0x71}, {0x40,0xc0,0x40,0x72}, {0x40,0xc0,0x60,0x73}, + {0x40,0xc0,0x80,0x74}, {0x40,0xc0,0xa0,0x75}, {0x40,0xc0,0xc0,0x76}, {0x40,0xc0,0xe0,0x77}, + {0x40,0xe0,0x00,0x78}, {0x40,0xe0,0x20,0x79}, {0x40,0xe0,0x40,0x7a}, {0x40,0xe0,0x60,0x7b}, + {0x40,0xe0,0x80,0x7c}, {0x40,0xe0,0xa0,0x7d}, {0x40,0xe0,0xc0,0x7e}, {0x40,0xe0,0xe0,0x7f}, + + {0x80,0x00,0x00,0x80}, {0x80,0x00,0x20,0x81}, {0x80,0x00,0x40,0x82}, {0x80,0x00,0x60,0x83}, + {0x80,0x00,0x80,0x84}, {0x80,0x00,0xa0,0x85}, {0x80,0x00,0xc0,0x86}, {0x80,0x00,0xe0,0x87}, + {0x80,0x20,0x00,0x88}, {0x80,0x20,0x20,0x89}, {0x80,0x20,0x40,0x8a}, {0x80,0x20,0x60,0x8b}, + {0x80,0x20,0x80,0x8c}, {0x80,0x20,0xa0,0x8d}, {0x80,0x20,0xc0,0x8e}, {0x80,0x20,0xe0,0x8f}, + + {0x80,0x40,0x00,0x90}, {0x80,0x40,0x20,0x91}, {0x80,0x40,0x40,0x92}, {0x80,0x40,0x60,0x93}, + {0x80,0x40,0x80,0x94}, {0x80,0x40,0xa0,0x95}, {0x80,0x40,0xc0,0x96}, {0x80,0x40,0xe0,0x97}, + {0x80,0x60,0x00,0x98}, {0x80,0x60,0x20,0x99}, {0x80,0x60,0x40,0x9a}, {0x80,0x60,0x60,0x9b}, + {0x80,0x60,0x80,0x9c}, {0x80,0x60,0xa0,0x9d}, {0x80,0x60,0xc0,0x9e}, {0x80,0x60,0xe0,0x9f}, + + {0x80,0x80,0x00,0xa0}, {0x80,0x80,0x20,0xa1}, {0x80,0x80,0x40,0xa2}, {0x80,0x80,0x60,0xa3}, + {0x80,0x80,0x80,0xa4}, {0x80,0x80,0xa0,0xa5}, {0x80,0x80,0xc0,0xa6}, {0x80,0x80,0xe0,0xa7}, + {0x80,0xa0,0x00,0xa8}, {0x80,0xa0,0x20,0xa9}, {0x80,0xa0,0x40,0xaa}, {0x80,0xa0,0x60,0xab}, + {0x80,0xa0,0x80,0xac}, {0x80,0xa0,0xa0,0xad}, {0x80,0xa0,0xc0,0xae}, {0x80,0xa0,0xe0,0xaf}, + + {0x80,0xc0,0x00,0xb0}, {0x80,0xc0,0x20,0xb1}, {0x80,0xc0,0x40,0xb2}, {0x80,0xc0,0x60,0xb3}, + {0x80,0xc0,0x80,0xb4}, {0x80,0xc0,0xa0,0xb5}, {0x80,0xc0,0xc0,0xb6}, {0x80,0xc0,0xe0,0xb7}, + {0x80,0xe0,0x00,0xb8}, {0x80,0xe0,0x20,0xb9}, {0x80,0xe0,0x40,0xba}, {0x80,0xe0,0x60,0xbb}, + {0x80,0xe0,0x80,0xbc}, {0x80,0xe0,0xa0,0xbd}, {0x80,0xe0,0xc0,0xbe}, {0x80,0xe0,0xe0,0xbf}, + + {0xc0,0x00,0x00,0xc0}, {0xc0,0x00,0x20,0xc1}, {0xc0,0x00,0x40,0xc2}, {0xc0,0x00,0x60,0xc3}, + {0xc0,0x00,0x80,0xc4}, {0xc0,0x00,0xa0,0xc5}, {0xc0,0x00,0xc0,0xc6}, {0xc0,0x00,0xe0,0xc7}, + {0xc0,0x20,0x00,0xc8}, {0xc0,0x20,0x20,0xc9}, {0xc0,0x20,0x40,0xca}, {0xc0,0x20,0x60,0xcb}, + {0xc0,0x20,0x80,0xcc}, {0xc0,0x20,0xa0,0xcd}, {0xc0,0x20,0xc0,0xce}, {0xc0,0x20,0xe0,0xcf}, + + {0xc0,0x40,0x00,0xd0}, {0xc0,0x40,0x20,0xd1}, {0xc0,0x40,0x40,0xd2}, {0xc0,0x40,0x60,0xd3}, + {0xc0,0x40,0x80,0xd4}, {0xc0,0x40,0xa0,0xd5}, {0xc0,0x40,0xc0,0xd6}, {0xc0,0x40,0xe0,0xd7}, + {0xc0,0x60,0x00,0xd8}, {0xc0,0x60,0x20,0xd9}, {0xc0,0x60,0x40,0xda}, {0xc0,0x60,0x60,0xdb}, + {0xc0,0x60,0x80,0xdc}, {0xc0,0x60,0xa0,0xdd}, {0xc0,0x60,0xc0,0xde}, {0xc0,0x60,0xe0,0xdf}, + + {0xc0,0x80,0x00,0xe0}, {0xc0,0x80,0x20,0xe1}, {0xc0,0x80,0x40,0xe2}, {0xc0,0x80,0x60,0xe3}, + {0xc0,0x80,0x80,0xe4}, {0xc0,0x80,0xa0,0xe5}, {0xc0,0x80,0xc0,0xe6}, {0xc0,0x80,0xe0,0xe7}, + {0xc0,0xa0,0x00,0xe8}, {0xc0,0xa0,0x20,0xe9}, {0xc0,0xa0,0x40,0xea}, {0xc0,0xa0,0x60,0xeb}, + {0xc0,0xa0,0x80,0xec}, {0xc0,0xa0,0xa0,0xed}, {0xc0,0xa0,0xc0,0xee}, {0xc0,0xa0,0xe0,0xef}, + + {0xc0,0xc0,0x00,0xf0}, {0xc0,0xc0,0x20,0xf1}, {0xc0,0xc0,0x40,0xf2}, {0xc0,0xc0,0x60,0xf3}, + {0xc0,0xc0,0x80,0xf4}, {0xc0,0xc0,0xa0,0xf5}, {0xf0,0xfb,0xff,0xf6}, {0xa4,0xa0,0xa0,0xf7}, + {0x80,0x80,0x80,0xf8}, {0x00,0x00,0xff,0xf9}, {0x00,0xff,0x00,0xfa}, {0x00,0xff,0xff,0xfb}, + {0xff,0x00,0x00,0xfc}, {0xff,0x00,0xff,0xfd}, {0xff,0xff,0x00,0xfe}, {0xff,0xff,0xff,0xff}, +}; + /* 1x1 bmp (1 bpp) */ static const uint8_t bmp_1bpp[] = { diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 7212ae82601b..a8e101db1972 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -1060,89 +1060,6 @@ static inline void _check_readback_pixel_4bpp(unsigned int line, struct surface_ todo_wine_if(todo) ok_(__FILE__, line)(color == expected_color, "Got color 0x%08x, expected 0x%08x.\n", color, expected_color); } -static const PALETTEENTRY test_palette[256] = -{ - {0x00,0x00,0x00,0x00}, {0x00,0x00,0x80,0x01}, {0x00,0x80,0x00,0x02}, {0x00,0x80,0x80,0x03}, - {0x80,0x00,0x00,0x04}, {0x80,0x00,0x80,0x05}, {0x80,0x80,0x00,0x06}, {0xc0,0xc0,0xc0,0x07}, - {0xc0,0xdc,0xc0,0x08}, {0xf0,0xca,0xa6,0x09}, {0x00,0x20,0x40,0x0a}, {0x00,0x20,0x60,0x0b}, - {0x00,0x20,0x80,0x0c}, {0x00,0x20,0xa0,0x0d}, {0x00,0x20,0xc0,0x0e}, {0x00,0x20,0xe0,0x0f}, - - {0x00,0x40,0x00,0x10}, {0x00,0x40,0x20,0x11}, {0x00,0x40,0x40,0x12}, {0x00,0x40,0x60,0x13}, - {0x00,0x40,0x80,0x14}, {0x00,0x40,0xa0,0x15}, {0x00,0x40,0xc0,0x16}, {0x00,0x40,0xe0,0x17}, - {0x00,0x60,0x00,0x18}, {0x00,0x60,0x20,0x19}, {0x00,0x60,0x40,0x1a}, {0x00,0x60,0x60,0x1b}, - {0x00,0x60,0x80,0x1c}, {0x00,0x60,0xa0,0x1d}, {0x00,0x60,0xc0,0x1e}, {0x00,0x60,0xe0,0x1f}, - - {0x00,0x80,0x00,0x20}, {0x00,0x80,0x20,0x21}, {0x00,0x80,0x40,0x22}, {0x00,0x80,0x60,0x23}, - {0x00,0x80,0x80,0x24}, {0x00,0x80,0xa0,0x25}, {0x00,0x80,0xc0,0x26}, {0x00,0x80,0xe0,0x27}, - {0x00,0xa0,0x00,0x28}, {0x00,0xa0,0x20,0x29}, {0x00,0xa0,0x40,0x2a}, {0x00,0xa0,0x60,0x2b}, - {0x00,0xa0,0x80,0x2c}, {0x00,0xa0,0xa0,0x2d}, {0x00,0xa0,0xc0,0x2e}, {0x00,0xa0,0xe0,0x2f}, - - {0x00,0xc0,0x00,0x30}, {0x00,0xc0,0x20,0x31}, {0x00,0xc0,0x40,0x32}, {0x00,0xc0,0x60,0x33}, - {0x00,0xc0,0x80,0x34}, {0x00,0xc0,0xa0,0x35}, {0x00,0xc0,0xc0,0x36}, {0x00,0xc0,0xe0,0x37}, - {0x00,0xe0,0x00,0x38}, {0x00,0xe0,0x20,0x39}, {0x00,0xe0,0x40,0x3a}, {0x00,0xe0,0x60,0x3b}, - {0x00,0xe0,0x80,0x3c}, {0x00,0xe0,0xa0,0x3d}, {0x00,0xe0,0xc0,0x3e}, {0x00,0xe0,0xe0,0x3f}, - - {0x40,0x00,0x00,0x40}, {0x40,0x00,0x20,0x41}, {0x40,0x00,0x40,0x42}, {0x40,0x00,0x60,0x43}, - {0x40,0x00,0x80,0x44}, {0x40,0x00,0xa0,0x45}, {0x40,0x00,0xc0,0x46}, {0x40,0x00,0xe0,0x47}, - {0x40,0x20,0x00,0x48}, {0x40,0x20,0x20,0x49}, {0x40,0x20,0x40,0x4a}, {0x40,0x20,0x60,0x4b}, - {0x40,0x20,0x80,0x4c}, {0x40,0x20,0xa0,0x4d}, {0x40,0x20,0xc0,0x4e}, {0x40,0x20,0xe0,0x4f}, - - {0x40,0x40,0x00,0x50}, {0x40,0x40,0x20,0x51}, {0x40,0x40,0x40,0x52}, {0x40,0x40,0x60,0x53}, - {0x40,0x40,0x80,0x54}, {0x40,0x40,0xa0,0x55}, {0x40,0x40,0xc0,0x56}, {0x40,0x40,0xe0,0x57}, - {0x40,0x60,0x00,0x58}, {0x40,0x60,0x20,0x59}, {0x40,0x60,0x40,0x5a}, {0x40,0x60,0x60,0x5b}, - {0x40,0x60,0x80,0x5c}, {0x40,0x60,0xa0,0x5d}, {0x40,0x60,0xc0,0x5e}, {0x40,0x60,0xe0,0x5f}, - - {0x40,0x80,0x00,0x60}, {0x40,0x80,0x20,0x61}, {0x40,0x80,0x40,0x62}, {0x40,0x80,0x60,0x63}, - {0x40,0x80,0x80,0x64}, {0x40,0x80,0xa0,0x65}, {0x40,0x80,0xc0,0x66}, {0x40,0x80,0xe0,0x67}, - {0x40,0xa0,0x00,0x68}, {0x40,0xa0,0x20,0x69}, {0x40,0xa0,0x40,0x6a}, {0x40,0xa0,0x60,0x6b}, - {0x40,0xa0,0x80,0x6c}, {0x40,0xa0,0xa0,0x6d}, {0x40,0xa0,0xc0,0x6e}, {0x40,0xa0,0xe0,0x6f}, - - {0x40,0xc0,0x00,0x70}, {0x40,0xc0,0x20,0x71}, {0x40,0xc0,0x40,0x72}, {0x40,0xc0,0x60,0x73}, - {0x40,0xc0,0x80,0x74}, {0x40,0xc0,0xa0,0x75}, {0x40,0xc0,0xc0,0x76}, {0x40,0xc0,0xe0,0x77}, - {0x40,0xe0,0x00,0x78}, {0x40,0xe0,0x20,0x79}, {0x40,0xe0,0x40,0x7a}, {0x40,0xe0,0x60,0x7b}, - {0x40,0xe0,0x80,0x7c}, {0x40,0xe0,0xa0,0x7d}, {0x40,0xe0,0xc0,0x7e}, {0x40,0xe0,0xe0,0x7f}, - - {0x80,0x00,0x00,0x80}, {0x80,0x00,0x20,0x81}, {0x80,0x00,0x40,0x82}, {0x80,0x00,0x60,0x83}, - {0x80,0x00,0x80,0x84}, {0x80,0x00,0xa0,0x85}, {0x80,0x00,0xc0,0x86}, {0x80,0x00,0xe0,0x87}, - {0x80,0x20,0x00,0x88}, {0x80,0x20,0x20,0x89}, {0x80,0x20,0x40,0x8a}, {0x80,0x20,0x60,0x8b}, - {0x80,0x20,0x80,0x8c}, {0x80,0x20,0xa0,0x8d}, {0x80,0x20,0xc0,0x8e}, {0x80,0x20,0xe0,0x8f}, - - {0x80,0x40,0x00,0x90}, {0x80,0x40,0x20,0x91}, {0x80,0x40,0x40,0x92}, {0x80,0x40,0x60,0x93}, - {0x80,0x40,0x80,0x94}, {0x80,0x40,0xa0,0x95}, {0x80,0x40,0xc0,0x96}, {0x80,0x40,0xe0,0x97}, - {0x80,0x60,0x00,0x98}, {0x80,0x60,0x20,0x99}, {0x80,0x60,0x40,0x9a}, {0x80,0x60,0x60,0x9b}, - {0x80,0x60,0x80,0x9c}, {0x80,0x60,0xa0,0x9d}, {0x80,0x60,0xc0,0x9e}, {0x80,0x60,0xe0,0x9f}, - - {0x80,0x80,0x00,0xa0}, {0x80,0x80,0x20,0xa1}, {0x80,0x80,0x40,0xa2}, {0x80,0x80,0x60,0xa3}, - {0x80,0x80,0x80,0xa4}, {0x80,0x80,0xa0,0xa5}, {0x80,0x80,0xc0,0xa6}, {0x80,0x80,0xe0,0xa7}, - {0x80,0xa0,0x00,0xa8}, {0x80,0xa0,0x20,0xa9}, {0x80,0xa0,0x40,0xaa}, {0x80,0xa0,0x60,0xab}, - {0x80,0xa0,0x80,0xac}, {0x80,0xa0,0xa0,0xad}, {0x80,0xa0,0xc0,0xae}, {0x80,0xa0,0xe0,0xaf}, - - {0x80,0xc0,0x00,0xb0}, {0x80,0xc0,0x20,0xb1}, {0x80,0xc0,0x40,0xb2}, {0x80,0xc0,0x60,0xb3}, - {0x80,0xc0,0x80,0xb4}, {0x80,0xc0,0xa0,0xb5}, {0x80,0xc0,0xc0,0xb6}, {0x80,0xc0,0xe0,0xb7}, - {0x80,0xe0,0x00,0xb8}, {0x80,0xe0,0x20,0xb9}, {0x80,0xe0,0x40,0xba}, {0x80,0xe0,0x60,0xbb}, - {0x80,0xe0,0x80,0xbc}, {0x80,0xe0,0xa0,0xbd}, {0x80,0xe0,0xc0,0xbe}, {0x80,0xe0,0xe0,0xbf}, - - {0xc0,0x00,0x00,0xc0}, {0xc0,0x00,0x20,0xc1}, {0xc0,0x00,0x40,0xc2}, {0xc0,0x00,0x60,0xc3}, - {0xc0,0x00,0x80,0xc4}, {0xc0,0x00,0xa0,0xc5}, {0xc0,0x00,0xc0,0xc6}, {0xc0,0x00,0xe0,0xc7}, - {0xc0,0x20,0x00,0xc8}, {0xc0,0x20,0x20,0xc9}, {0xc0,0x20,0x40,0xca}, {0xc0,0x20,0x60,0xcb}, - {0xc0,0x20,0x80,0xcc}, {0xc0,0x20,0xa0,0xcd}, {0xc0,0x20,0xc0,0xce}, {0xc0,0x20,0xe0,0xcf}, - - {0xc0,0x40,0x00,0xd0}, {0xc0,0x40,0x20,0xd1}, {0xc0,0x40,0x40,0xd2}, {0xc0,0x40,0x60,0xd3}, - {0xc0,0x40,0x80,0xd4}, {0xc0,0x40,0xa0,0xd5}, {0xc0,0x40,0xc0,0xd6}, {0xc0,0x40,0xe0,0xd7}, - {0xc0,0x60,0x00,0xd8}, {0xc0,0x60,0x20,0xd9}, {0xc0,0x60,0x40,0xda}, {0xc0,0x60,0x60,0xdb}, - {0xc0,0x60,0x80,0xdc}, {0xc0,0x60,0xa0,0xdd}, {0xc0,0x60,0xc0,0xde}, {0xc0,0x60,0xe0,0xdf}, - - {0xc0,0x80,0x00,0xe0}, {0xc0,0x80,0x20,0xe1}, {0xc0,0x80,0x40,0xe2}, {0xc0,0x80,0x60,0xe3}, - {0xc0,0x80,0x80,0xe4}, {0xc0,0x80,0xa0,0xe5}, {0xc0,0x80,0xc0,0xe6}, {0xc0,0x80,0xe0,0xe7}, - {0xc0,0xa0,0x00,0xe8}, {0xc0,0xa0,0x20,0xe9}, {0xc0,0xa0,0x40,0xea}, {0xc0,0xa0,0x60,0xeb}, - {0xc0,0xa0,0x80,0xec}, {0xc0,0xa0,0xa0,0xed}, {0xc0,0xa0,0xc0,0xee}, {0xc0,0xa0,0xe0,0xef}, - - {0xc0,0xc0,0x00,0xf0}, {0xc0,0xc0,0x20,0xf1}, {0xc0,0xc0,0x40,0xf2}, {0xc0,0xc0,0x60,0xf3}, - {0xc0,0xc0,0x80,0xf4}, {0xc0,0xc0,0xa0,0xf5}, {0xf0,0xfb,0xff,0xf6}, {0xa4,0xa0,0xa0,0xf7}, - {0x80,0x80,0x80,0xf8}, {0x00,0x00,0xff,0xf9}, {0x00,0xff,0x00,0xfa}, {0x00,0xff,0xff,0xfb}, - {0xff,0x00,0x00,0xfc}, {0xff,0x00,0xff,0xfd}, {0xff,0xff,0x00,0xfe}, {0xff,0xff,0xff,0xff}, -}; - static const uint16_t v16u16_2_2[] = { 0x0000, 0x3000, 0x4000, 0x7fff, 0x8000, 0x8001, 0xc000, 0xffff, diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index 1c8ba0507b3b..ae3fb4c63aca 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -25,6 +25,7 @@ #include "d3dx9tex.h" #include "resources.h" #include +#include #include "d3dx9_test_images.h" static int has_2d_dxt1, has_2d_dxt3, has_2d_dxt5, has_cube_dxt5, has_3d_dxt3; @@ -3089,6 +3090,171 @@ static void WINAPI fill_cube_positive_x(D3DXVECTOR4 *out, const D3DXVECTOR3 *tex out->x = 1; } +static void test_save_texture_to_dds_file(IDirect3DDevice9 *device) +{ + static const struct + { + D3DRESOURCETYPE type; + D3DFORMAT format; + D3DPOOL pool; + uint32_t width; + uint32_t height; + uint32_t depth; + uint32_t mip_levels; + const PALETTEENTRY *palette; + + HRESULT expected_hr; + struct dds_pixel_format expected_pixel_format; + uint32_t expected_flags; + uint32_t expected_width; + uint32_t expected_height; + uint32_t expected_pitch; + uint32_t expected_depth; + uint32_t expected_mip_levels; + uint32_t expected_caps; + uint32_t expected_caps2; + uint32_t expected_buffer_size; + BOOL todo_hr; + BOOL todo_expected; + } dds_tests[] = + { + /* Paletted format tests. */ + { D3DRTYPE_TEXTURE, D3DFMT_P8, D3DPOOL_SCRATCH, 4, 4, 0, 3, test_palette, D3D_OK, + { 32, DDS_PF_INDEXED, 0, 8, 0, 0, 0, 0 }, + (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_MIPMAPCOUNT), 4, 4, 0, 0, 3, + (DDSCAPS_TEXTURE | DDSCAPS_PALETTE | DDSCAPS_MIPMAP | DDSCAPS_COMPLEX), 0, PALETTED_DDS_FILE_HEADER_SIZE + 21, + .todo_hr = TRUE + }, + { D3DRTYPE_CUBETEXTURE, D3DFMT_P8, D3DPOOL_SCRATCH, 4, 0, 0, 3, test_palette, D3D_OK, + { 32, DDS_PF_INDEXED, 0, 8, 0, 0, 0, 0 }, + (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_MIPMAPCOUNT), 4, 4, 0, 0, 3, + (DDSCAPS_TEXTURE | DDSCAPS_PALETTE | DDSCAPS_MIPMAP | DDSCAPS_COMPLEX), (DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_ALLFACES), + PALETTED_DDS_FILE_HEADER_SIZE + (126), .todo_hr = TRUE + }, + { D3DRTYPE_VOLUMETEXTURE, D3DFMT_P8, D3DPOOL_SCRATCH, 4, 4, 4, 3, test_palette, D3D_OK, + { 32, DDS_PF_INDEXED, 0, 8, 0, 0, 0, 0 }, + (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_MIPMAPCOUNT | DDSD_DEPTH), 4, 4, 0, 4, 3, + (DDSCAPS_TEXTURE | DDSCAPS_PALETTE | DDSCAPS_MIPMAP | DDSCAPS_COMPLEX), (DDSCAPS2_VOLUME), + PALETTED_DDS_FILE_HEADER_SIZE + 73, .todo_hr = TRUE + }, + /* D3DFMT_A8R8G8B8 textures with multiple levels. */ + { D3DRTYPE_TEXTURE, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, 4, 4, 0, 3, NULL, D3D_OK, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, + (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_MIPMAPCOUNT), 4, 4, 0, 0, 3, + (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP | DDSCAPS_COMPLEX | DDSCAPS_ALPHA), 0, DDS_FILE_HEADER_SIZE + 84, + .todo_hr = TRUE + }, + { D3DRTYPE_CUBETEXTURE, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, 4, 0, 0, 3, NULL, D3D_OK, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, + (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_MIPMAPCOUNT), 4, 4, 0, 0, 3, + (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP | DDSCAPS_ALPHA | DDSCAPS_COMPLEX), (DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_ALLFACES), + DDS_FILE_HEADER_SIZE + (504), .todo_hr = TRUE + }, + /* + * Volume texture with D3DPOOL default. Can't be mapped for read, + * can't be saved. + */ + { D3DRTYPE_VOLUMETEXTURE, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, 4, 4, 4, 3, NULL, D3DERR_INVALIDCALL, .todo_hr = TRUE }, + /* D3DPOOL_SYSTEMMEM can be saved. */ + { D3DRTYPE_VOLUMETEXTURE, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, 4, 4, 4, 3, NULL, D3D_OK, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, + (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_DEPTH | DDSD_MIPMAPCOUNT), 4, 4, 0, 4, 3, + (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP | DDSCAPS_ALPHA | DDSCAPS_COMPLEX ), (DDSCAPS2_VOLUME), DDS_FILE_HEADER_SIZE + 292, + .todo_hr = TRUE + }, + /* Single mip level, no mip flags. */ + { D3DRTYPE_TEXTURE, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, 4, 4, 0, 1, NULL, D3D_OK, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, + (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT), 4, 4, 0, 0, 0, + (DDSCAPS_TEXTURE | DDSCAPS_ALPHA), 0, DDS_FILE_HEADER_SIZE + 64, + .todo_hr = TRUE + }, + /* 8. */ + { D3DRTYPE_CUBETEXTURE, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, 4, 0, 0, 1, NULL, D3D_OK, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, + (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT), 4, 4, 0, 0, 0, + (DDSCAPS_TEXTURE | DDSCAPS_ALPHA | DDSCAPS_COMPLEX), (DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_ALLFACES), + DDS_FILE_HEADER_SIZE + (384), .todo_hr = TRUE + }, + { D3DRTYPE_VOLUMETEXTURE, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, 4, 4, 4, 1, NULL, D3D_OK, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, + (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_DEPTH), 4, 4, 0, 4, 0, + (DDSCAPS_TEXTURE | DDSCAPS_ALPHA), (DDSCAPS2_VOLUME), DDS_FILE_HEADER_SIZE + 256, + .todo_hr = TRUE + }, + /* Volume texture with a depth of 1. */ + { D3DRTYPE_VOLUMETEXTURE, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, 4, 4, 1, 1, NULL, D3D_OK, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, + (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT), 4, 4, 0, 0, 0, + (DDSCAPS_TEXTURE | DDSCAPS_ALPHA), 0, DDS_FILE_HEADER_SIZE + 64, + .todo_hr = TRUE + }, + }; + struct + { + DWORD magic; + struct dds_header header; + BYTE *data; + } *dds; + IDirect3DVolumeTexture9 *volume_texture; + IDirect3DCubeTexture9 *cube_texture; + IDirect3DBaseTexture9 *save_tex; + IDirect3DTexture9 *texture; + ID3DXBuffer *buffer; + unsigned int i; + HRESULT hr; + + for (i = 0; i < ARRAY_SIZE(dds_tests); ++i) + { + winetest_push_context("Test %u", i); + + switch (dds_tests[i].type) + { + case D3DRTYPE_TEXTURE: + hr = IDirect3DDevice9_CreateTexture(device, dds_tests[i].width, dds_tests[i].height, dds_tests[i].mip_levels, 0, + dds_tests[i].format, dds_tests[i].pool, &texture, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + save_tex = (IDirect3DBaseTexture9 *)texture; + break; + + case D3DRTYPE_CUBETEXTURE: + hr = IDirect3DDevice9_CreateCubeTexture(device, dds_tests[i].width, dds_tests[i].mip_levels, 0, + dds_tests[i].format, dds_tests[i].pool, &cube_texture, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + save_tex = (IDirect3DBaseTexture9 *)cube_texture; + break; + + case D3DRTYPE_VOLUMETEXTURE: + hr = IDirect3DDevice9_CreateVolumeTexture(device, dds_tests[i].width, dds_tests[i].height, dds_tests[i].depth, + dds_tests[i].mip_levels, 0, dds_tests[i].format, dds_tests[i].pool, &volume_texture, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + save_tex = (IDirect3DBaseTexture9 *)volume_texture; + break; + + default: + assert(0); + break; + } + + hr = D3DXSaveTextureToFileInMemory(&buffer, D3DXIFF_DDS, save_tex, dds_tests[i].palette); + todo_wine_if(dds_tests[i].todo_hr) ok(hr == dds_tests[i].expected_hr, "Unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + ok(ID3DXBuffer_GetBufferSize(buffer) == dds_tests[i].expected_buffer_size, "Unexpected buffer size %lu.\n", + ID3DXBuffer_GetBufferSize(buffer)); + + dds = ID3DXBuffer_GetBufferPointer(buffer); + check_dds_header(&dds->header, dds_tests[i].expected_flags, dds_tests[i].expected_height, dds_tests[i].expected_width, + dds_tests[i].expected_pitch, dds_tests[i].expected_depth, dds_tests[i].expected_mip_levels, + &dds_tests[i].expected_pixel_format, dds_tests[i].expected_caps, dds_tests[i].expected_caps2, dds_tests[i].todo_expected); + ID3DXBuffer_Release(buffer); + } + + IDirect3DBaseTexture9_Release(save_tex); + winetest_pop_context(); + } +} + static void test_D3DXSaveTextureToFileInMemory(IDirect3DDevice9 *device) { HRESULT hr; @@ -3269,6 +3435,7 @@ static void test_D3DXSaveTextureToFileInMemory(IDirect3DDevice9 *device) } IDirect3DVolumeTexture9_Release(volume_texture); + test_save_texture_to_dds_file(device); } static void test_texture_shader(void) From 10c13321ff48b699104de3f9b060aa96cee2a54d Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 31 Oct 2024 12:12:27 -0400 Subject: [PATCH 0915/2542] d3dx9: Add support for saving IDirect3DTexture9 textures to DDS files in D3DXSaveTextureToFileInMemory(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/d3dx9_private.h | 79 ++++++++++++++++++++ dlls/d3dx9_36/surface.c | 86 +++------------------- dlls/d3dx9_36/tests/texture.c | 29 +++----- dlls/d3dx9_36/texture.c | 132 ++++++++++++++++++++++++++++------ 4 files changed, 211 insertions(+), 115 deletions(-) diff --git a/dlls/d3dx9_36/d3dx9_private.h b/dlls/d3dx9_36/d3dx9_private.h index 668700c2b642..d94e14d54056 100644 --- a/dlls/d3dx9_36/d3dx9_private.h +++ b/dlls/d3dx9_36/d3dx9_private.h @@ -50,6 +50,81 @@ static inline HRESULT d3dx9_handle_load_filter(DWORD *filter) return d3dx9_validate_filter(*filter); } +#define DDS_PALETTE_SIZE (sizeof(PALETTEENTRY) * 256) + +/* dds_header.flags */ +#define DDS_CAPS 0x1 +#define DDS_HEIGHT 0x2 +#define DDS_WIDTH 0x4 +#define DDS_PITCH 0x8 +#define DDS_PIXELFORMAT 0x1000 +#define DDS_MIPMAPCOUNT 0x20000 +#define DDS_LINEARSIZE 0x80000 +#define DDS_DEPTH 0x800000 + +/* dds_header.caps */ +#define DDSCAPS_ALPHA 0x2 +#define DDS_CAPS_COMPLEX 0x8 +#define DDSCAPS_PALETTE 0x100 +#define DDS_CAPS_TEXTURE 0x1000 +#define DDS_CAPS_MIPMAP 0x400000 + +/* dds_header.caps2 */ +#define DDS_CAPS2_CUBEMAP 0x200 +#define DDS_CAPS2_CUBEMAP_POSITIVEX 0x400 +#define DDS_CAPS2_CUBEMAP_NEGATIVEX 0x800 +#define DDS_CAPS2_CUBEMAP_POSITIVEY 0x1000 +#define DDS_CAPS2_CUBEMAP_NEGATIVEY 0x2000 +#define DDS_CAPS2_CUBEMAP_POSITIVEZ 0x4000 +#define DDS_CAPS2_CUBEMAP_NEGATIVEZ 0x8000 +#define DDS_CAPS2_CUBEMAP_ALL_FACES ( DDS_CAPS2_CUBEMAP_POSITIVEX | DDS_CAPS2_CUBEMAP_NEGATIVEX \ + | DDS_CAPS2_CUBEMAP_POSITIVEY | DDS_CAPS2_CUBEMAP_NEGATIVEY \ + | DDS_CAPS2_CUBEMAP_POSITIVEZ | DDS_CAPS2_CUBEMAP_NEGATIVEZ ) +#define DDS_CAPS2_VOLUME 0x200000 + +/* dds_pixel_format.flags */ +#define DDS_PF_ALPHA 0x1 +#define DDS_PF_ALPHA_ONLY 0x2 +#define DDS_PF_FOURCC 0x4 +#define DDS_PF_INDEXED 0x20 +#define DDS_PF_RGB 0x40 +#define DDS_PF_YUV 0x200 +#define DDS_PF_LUMINANCE 0x20000 +#define DDS_PF_BUMPLUMINANCE 0x40000 +#define DDS_PF_BUMPDUDV 0x80000 + +struct dds_pixel_format +{ + DWORD size; + DWORD flags; + DWORD fourcc; + DWORD bpp; + DWORD rmask; + DWORD gmask; + DWORD bmask; + DWORD amask; +}; + +struct dds_header +{ + DWORD signature; + DWORD size; + DWORD flags; + DWORD height; + DWORD width; + DWORD pitch_or_linear_size; + DWORD depth; + DWORD miplevels; + DWORD reserved[11]; + struct dds_pixel_format pixel_format; + DWORD caps; + DWORD caps2; + DWORD caps3; + DWORD caps4; + DWORD reserved2; +}; + + struct vec4 { float x, y, z, w; @@ -316,8 +391,12 @@ HRESULT lock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, D3DLO IDirect3DSurface9 **temp_surface, BOOL write); HRESULT unlock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, IDirect3DSurface9 *temp_surface, BOOL update); +uint32_t d3dx_calculate_layer_pixels_size(enum d3dx_pixel_format_id format, uint32_t width, uint32_t height, uint32_t depth, + uint32_t mip_levels); HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pixel_format_desc *src_fmt_desc, D3DXIMAGE_FILEFORMAT file_format, enum d3dx_pixel_format_id *save_fmt); +HRESULT d3dx_init_dds_header(struct dds_header *header, D3DRESOURCETYPE resource_type, + enum d3dx_pixel_format_id format, const struct volume *size, uint32_t mip_levels); HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct pixel_format_desc *src_fmt_desc, D3DXIMAGE_FILEFORMAT file_format, enum d3dx_pixel_format_id dst_format, ID3DXBuffer **dst_buffer); HRESULT d3dx_pixels_init(const void *data, uint32_t row_pitch, uint32_t slice_pitch, diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 722e0d321d75..9bc23b390295 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -78,80 +78,6 @@ static const GUID *wic_guid_from_d3dx_pixel_format_id(enum d3dx_pixel_format_id return NULL; } -#define DDS_PALETTE_SIZE (sizeof(PALETTEENTRY) * 256) - -/* dds_header.flags */ -#define DDS_CAPS 0x1 -#define DDS_HEIGHT 0x2 -#define DDS_WIDTH 0x4 -#define DDS_PITCH 0x8 -#define DDS_PIXELFORMAT 0x1000 -#define DDS_MIPMAPCOUNT 0x20000 -#define DDS_LINEARSIZE 0x80000 -#define DDS_DEPTH 0x800000 - -/* dds_header.caps */ -#define DDSCAPS_ALPHA 0x2 -#define DDS_CAPS_COMPLEX 0x8 -#define DDSCAPS_PALETTE 0x100 -#define DDS_CAPS_TEXTURE 0x1000 -#define DDS_CAPS_MIPMAP 0x400000 - -/* dds_header.caps2 */ -#define DDS_CAPS2_CUBEMAP 0x200 -#define DDS_CAPS2_CUBEMAP_POSITIVEX 0x400 -#define DDS_CAPS2_CUBEMAP_NEGATIVEX 0x800 -#define DDS_CAPS2_CUBEMAP_POSITIVEY 0x1000 -#define DDS_CAPS2_CUBEMAP_NEGATIVEY 0x2000 -#define DDS_CAPS2_CUBEMAP_POSITIVEZ 0x4000 -#define DDS_CAPS2_CUBEMAP_NEGATIVEZ 0x8000 -#define DDS_CAPS2_CUBEMAP_ALL_FACES ( DDS_CAPS2_CUBEMAP_POSITIVEX | DDS_CAPS2_CUBEMAP_NEGATIVEX \ - | DDS_CAPS2_CUBEMAP_POSITIVEY | DDS_CAPS2_CUBEMAP_NEGATIVEY \ - | DDS_CAPS2_CUBEMAP_POSITIVEZ | DDS_CAPS2_CUBEMAP_NEGATIVEZ ) -#define DDS_CAPS2_VOLUME 0x200000 - -/* dds_pixel_format.flags */ -#define DDS_PF_ALPHA 0x1 -#define DDS_PF_ALPHA_ONLY 0x2 -#define DDS_PF_FOURCC 0x4 -#define DDS_PF_INDEXED 0x20 -#define DDS_PF_RGB 0x40 -#define DDS_PF_YUV 0x200 -#define DDS_PF_LUMINANCE 0x20000 -#define DDS_PF_BUMPLUMINANCE 0x40000 -#define DDS_PF_BUMPDUDV 0x80000 - -struct dds_pixel_format -{ - DWORD size; - DWORD flags; - DWORD fourcc; - DWORD bpp; - DWORD rmask; - DWORD gmask; - DWORD bmask; - DWORD amask; -}; - -struct dds_header -{ - DWORD signature; - DWORD size; - DWORD flags; - DWORD height; - DWORD width; - DWORD pitch_or_linear_size; - DWORD depth; - DWORD miplevels; - DWORD reserved[11]; - struct dds_pixel_format pixel_format; - DWORD caps; - DWORD caps2; - DWORD caps3; - DWORD caps4; - DWORD reserved2; -}; - #define IMAGETYPE_COLORMAPPED 1 #define IMAGETYPE_TRUECOLOR 2 #define IMAGETYPE_GRAYSCALE 3 @@ -474,7 +400,7 @@ static HRESULT d3dx_calculate_pixels_size(enum d3dx_pixel_format_id format, uint return D3D_OK; } -static uint32_t d3dx_calculate_layer_pixels_size(enum d3dx_pixel_format_id format, uint32_t width, uint32_t height, uint32_t depth, +uint32_t d3dx_calculate_layer_pixels_size(enum d3dx_pixel_format_id format, uint32_t width, uint32_t height, uint32_t depth, uint32_t mip_levels) { uint32_t layer_size, row_pitch, slice_pitch, i; @@ -702,7 +628,7 @@ HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pixel_for return (*save_fmt == D3DX_PIXEL_FORMAT_COUNT) ? D3DERR_INVALIDCALL : D3D_OK; } -static HRESULT d3dx_init_dds_header(struct dds_header *header, D3DRESOURCETYPE resource_type, +HRESULT d3dx_init_dds_header(struct dds_header *header, D3DRESOURCETYPE resource_type, enum d3dx_pixel_format_id format, const struct volume *size, uint32_t mip_levels) { HRESULT hr; @@ -725,6 +651,14 @@ static HRESULT d3dx_init_dds_header(struct dds_header *header, D3DRESOURCETYPE r header->depth = size->depth; header->caps2 |= DDS_CAPS2_VOLUME; } + + if (mip_levels > 1) + { + header->flags |= DDS_MIPMAPCOUNT; + header->caps |= (DDS_CAPS_MIPMAP | DDS_CAPS_COMPLEX); + header->miplevels = mip_levels; + } + if (header->pixel_format.flags & DDS_PF_ALPHA || header->pixel_format.flags & DDS_PF_ALPHA_ONLY) header->caps |= DDSCAPS_ALPHA; if (header->pixel_format.flags & DDS_PF_INDEXED) diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index ae3fb4c63aca..1d038f4f810c 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -3123,7 +3123,6 @@ static void test_save_texture_to_dds_file(IDirect3DDevice9 *device) { 32, DDS_PF_INDEXED, 0, 8, 0, 0, 0, 0 }, (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_MIPMAPCOUNT), 4, 4, 0, 0, 3, (DDSCAPS_TEXTURE | DDSCAPS_PALETTE | DDSCAPS_MIPMAP | DDSCAPS_COMPLEX), 0, PALETTED_DDS_FILE_HEADER_SIZE + 21, - .todo_hr = TRUE }, { D3DRTYPE_CUBETEXTURE, D3DFMT_P8, D3DPOOL_SCRATCH, 4, 0, 0, 3, test_palette, D3D_OK, { 32, DDS_PF_INDEXED, 0, 8, 0, 0, 0, 0 }, @@ -3142,7 +3141,6 @@ static void test_save_texture_to_dds_file(IDirect3DDevice9 *device) { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_MIPMAPCOUNT), 4, 4, 0, 0, 3, (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP | DDSCAPS_COMPLEX | DDSCAPS_ALPHA), 0, DDS_FILE_HEADER_SIZE + 84, - .todo_hr = TRUE }, { D3DRTYPE_CUBETEXTURE, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, 4, 0, 0, 3, NULL, D3D_OK, { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, @@ -3167,7 +3165,6 @@ static void test_save_texture_to_dds_file(IDirect3DDevice9 *device) { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT), 4, 4, 0, 0, 0, (DDSCAPS_TEXTURE | DDSCAPS_ALPHA), 0, DDS_FILE_HEADER_SIZE + 64, - .todo_hr = TRUE }, /* 8. */ { D3DRTYPE_CUBETEXTURE, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, 4, 0, 0, 1, NULL, D3D_OK, @@ -3295,24 +3292,20 @@ static void test_D3DXSaveTextureToFileInMemory(IDirect3DDevice9 *device) } } - todo_wine { hr = D3DXSaveTextureToFileInMemory(&buffer, D3DXIFF_DDS, (IDirect3DBaseTexture9 *)texture, NULL); ok(hr == D3D_OK, "D3DXSaveTextureToFileInMemory returned %#lx, expected %#lx\n", hr, D3D_OK); - if (SUCCEEDED(hr)) - { - buffer_pointer = ID3DXBuffer_GetBufferPointer(buffer); - buffer_size = ID3DXBuffer_GetBufferSize(buffer); - hr = D3DXGetImageInfoFromFileInMemory(buffer_pointer, buffer_size, &info); - ok(hr == D3D_OK, "D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n", hr, D3D_OK); - ok(info.Width == 256, "Got width %u, expected %u\n", info.Width, 256); - ok(info.Height == 256, "Got height %u, expected %u\n", info.Height, 256); - ok(info.MipLevels == 9, "Got miplevels %u, expected %u\n", info.MipLevels, 9); - ok(info.ResourceType == D3DRTYPE_TEXTURE, "Got resource type %#x, expected %#x\n", info.ResourceType, D3DRTYPE_TEXTURE); - ok(info.ImageFileFormat == D3DXIFF_DDS, "Got file format %#x, expected %#x\n", info.ImageFileFormat, D3DXIFF_DDS); - ID3DXBuffer_Release(buffer); - } - } + buffer_pointer = ID3DXBuffer_GetBufferPointer(buffer); + buffer_size = ID3DXBuffer_GetBufferSize(buffer); + hr = D3DXGetImageInfoFromFileInMemory(buffer_pointer, buffer_size, &info); + ok(hr == D3D_OK, "D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n", hr, D3D_OK); + + ok(info.Width == 256, "Got width %u, expected %u\n", info.Width, 256); + ok(info.Height == 256, "Got height %u, expected %u\n", info.Height, 256); + ok(info.MipLevels == 9, "Got miplevels %u, expected %u\n", info.MipLevels, 9); + ok(info.ResourceType == D3DRTYPE_TEXTURE, "Got resource type %#x, expected %#x\n", info.ResourceType, D3DRTYPE_TEXTURE); + ok(info.ImageFileFormat == D3DXIFF_DDS, "Got file format %#x, expected %#x\n", info.ImageFileFormat, D3DXIFF_DDS); + ID3DXBuffer_Release(buffer); IDirect3DTexture9_Release(texture); diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index 4b4192dc8b68..d6b59cd65559 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -1856,25 +1856,38 @@ HRESULT WINAPI D3DXSaveTextureToFileW(const WCHAR *dst_filename, D3DXIMAGE_FILEF HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE_FILEFORMAT file_format, IDirect3DBaseTexture9 *src_texture, const PALETTEENTRY *src_palette) { - HRESULT hr; + const struct pixel_format_desc *fmt_desc = NULL; + uint32_t mip_levels, file_size, i; + struct d3dx_image image = { 0 }; + ID3DXBuffer *buffer = NULL; D3DRESOURCETYPE type; + struct volume size; + HRESULT hr; TRACE("dst_buffer %p, file_format %u, src_texture %p, src_palette %p.\n", dst_buffer, file_format, src_texture, src_palette); - if (!dst_buffer || !src_texture) return D3DERR_INVALIDCALL; - - if (file_format == D3DXIFF_DDS) - { - FIXME("DDS file format isn't supported yet\n"); - return E_NOTIMPL; - } + if (!dst_buffer || !src_texture || file_format > D3DXIFF_PFM) + return D3DERR_INVALIDCALL; type = IDirect3DBaseTexture9_GetType(src_texture); - switch (type) + if (type < D3DRTYPE_TEXTURE || type > D3DRTYPE_CUBETEXTURE) + return D3DERR_INVALIDCALL; + + if (file_format != D3DXIFF_DDS) { - case D3DRTYPE_TEXTURE: - case D3DRTYPE_CUBETEXTURE: + if (type == D3DRTYPE_VOLUMETEXTURE) + { + IDirect3DVolume9 *volume; + + hr = IDirect3DVolumeTexture9_GetVolumeLevel((IDirect3DVolumeTexture9 *)src_texture, 0, &volume); + if (SUCCEEDED(hr)) + { + hr = D3DXSaveVolumeToFileInMemory(dst_buffer, file_format, volume, src_palette, NULL); + IDirect3DVolume9_Release(volume); + } + } + else { IDirect3DSurface9 *surface; @@ -1884,26 +1897,103 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE hr = D3DXSaveSurfaceToFileInMemory(dst_buffer, file_format, surface, src_palette, NULL); IDirect3DSurface9_Release(surface); } - break; } - case D3DRTYPE_VOLUMETEXTURE: + return hr; + } + + mip_levels = IDirect3DBaseTexture9_GetLevelCount(src_texture); + switch (type) + { + case D3DRTYPE_TEXTURE: { - IDirect3DVolume9 *volume; + IDirect3DTexture9 *texture = (IDirect3DTexture9 *)src_texture; + D3DSURFACE_DESC desc; - hr = IDirect3DVolumeTexture9_GetVolumeLevel((IDirect3DVolumeTexture9 *)src_texture, 0, &volume); - if (SUCCEEDED(hr)) - { - hr = D3DXSaveVolumeToFileInMemory(dst_buffer, file_format, volume, src_palette, NULL); - IDirect3DVolume9_Release(volume); - } + hr = IDirect3DTexture9_GetLevelDesc(texture, 0, &desc); + if (FAILED(hr)) + break; + + fmt_desc = get_format_info(desc.Format); + if (is_unknown_format(fmt_desc)) + return E_NOTIMPL; + + set_volume_struct(&size, desc.Width, desc.Height, 1); break; } default: - return D3DERR_INVALIDCALL; + return E_NOTIMPL; + } + + if (is_index_format(fmt_desc) && !src_palette) + return E_NOTIMPL; + + file_size = d3dx_calculate_layer_pixels_size(fmt_desc->format, size.width, size.height, size.depth, mip_levels); + file_size += is_index_format(fmt_desc) ? sizeof(struct dds_header) + DDS_PALETTE_SIZE : sizeof(struct dds_header); + + hr = D3DXCreateBuffer(file_size, &buffer); + if (FAILED(hr)) + return hr; + + hr = d3dx_init_dds_header((struct dds_header *)ID3DXBuffer_GetBufferPointer(buffer), type, fmt_desc->format, &size, + mip_levels); + if (FAILED(hr)) + goto exit; + + if (is_index_format(fmt_desc)) + memcpy((uint8_t *)ID3DXBuffer_GetBufferPointer(buffer) + sizeof(struct dds_header), src_palette, DDS_PALETTE_SIZE); + + hr = d3dx_image_init(ID3DXBuffer_GetBufferPointer(buffer), ID3DXBuffer_GetBufferSize(buffer), &image, 0, 0); + if (FAILED(hr)) + goto exit; + + /* So now, things are setup to do inverse of CreateTexture. */ + for (i = 0; i < mip_levels; ++i) + { + IDirect3DSurface9 *src_surface, *tmp_surface; + struct d3dx_pixels src_pixels, dst_pixels; + D3DSURFACE_DESC src_surface_desc; + D3DLOCKED_RECT src_locked_rect; + RECT src_rect; + + hr = d3dx_image_get_pixels(&image, 0, i, &dst_pixels); + if (FAILED(hr)) + break; + + hr = get_surface(type, src_texture, 0, i, &src_surface); + if (FAILED(hr)) + break; + + hr = lock_surface(src_surface, NULL, &src_locked_rect, &tmp_surface, FALSE); + if (FAILED(hr)) + break; + + IDirect3DTexture9_GetLevelDesc((IDirect3DTexture9 *)src_texture, i, &src_surface_desc); + SetRect(&src_rect, 0, 0, src_surface_desc.Width, src_surface_desc.Height); + set_d3dx_pixels(&src_pixels, src_locked_rect.pBits, src_locked_rect.Pitch, 0, src_palette, + src_surface_desc.Width, src_surface_desc.Height, 1, &src_rect); + + hr = d3dx_load_pixels_from_pixels(&dst_pixels, fmt_desc, &src_pixels, fmt_desc, D3DX_FILTER_NONE, 0); + if (FAILED(hr)) + { + unlock_surface(src_surface, NULL, tmp_surface, FALSE); + IDirect3DSurface9_Release(src_surface); + break; + } + + hr = unlock_surface(src_surface, NULL, tmp_surface, FALSE); + IDirect3DSurface9_Release(src_surface); + if (FAILED(hr)) + break; } + *dst_buffer = buffer; + +exit: + if (buffer && (buffer != *dst_buffer)) + ID3DXBuffer_Release(buffer); + return hr; } From 680cfecf41ec9fd6d16b844e68610551c22fabfe Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 31 Oct 2024 12:29:10 -0400 Subject: [PATCH 0916/2542] d3dx9: Add support for saving IDirect3DCubeTexture9 textures to DDS files in D3DXSaveTextureToFileInMemory(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/surface.c | 14 ++++-- dlls/d3dx9_36/tests/texture.c | 32 ++++++-------- dlls/d3dx9_36/texture.c | 82 ++++++++++++++++++++++------------- 3 files changed, 76 insertions(+), 52 deletions(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 9bc23b390295..8f1a79e2b299 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -645,6 +645,11 @@ HRESULT d3dx_init_dds_header(struct dds_header *header, D3DRESOURCETYPE resource header->height = size->height; header->width = size->width; header->caps = DDS_CAPS_TEXTURE; + if (header->pixel_format.flags & DDS_PF_ALPHA || header->pixel_format.flags & DDS_PF_ALPHA_ONLY) + header->caps |= DDSCAPS_ALPHA; + if (header->pixel_format.flags & DDS_PF_INDEXED) + header->caps |= DDSCAPS_PALETTE; + if (size->depth > 1) { header->flags |= DDS_DEPTH; @@ -659,10 +664,11 @@ HRESULT d3dx_init_dds_header(struct dds_header *header, D3DRESOURCETYPE resource header->miplevels = mip_levels; } - if (header->pixel_format.flags & DDS_PF_ALPHA || header->pixel_format.flags & DDS_PF_ALPHA_ONLY) - header->caps |= DDSCAPS_ALPHA; - if (header->pixel_format.flags & DDS_PF_INDEXED) - header->caps |= DDSCAPS_PALETTE; + if (resource_type == D3DRTYPE_CUBETEXTURE) + { + header->caps |= DDS_CAPS_COMPLEX; + header->caps2 |= (DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES); + } return D3D_OK; } diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index 1d038f4f810c..06d9c7335fc1 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -3128,7 +3128,7 @@ static void test_save_texture_to_dds_file(IDirect3DDevice9 *device) { 32, DDS_PF_INDEXED, 0, 8, 0, 0, 0, 0 }, (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_MIPMAPCOUNT), 4, 4, 0, 0, 3, (DDSCAPS_TEXTURE | DDSCAPS_PALETTE | DDSCAPS_MIPMAP | DDSCAPS_COMPLEX), (DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_ALLFACES), - PALETTED_DDS_FILE_HEADER_SIZE + (126), .todo_hr = TRUE + PALETTED_DDS_FILE_HEADER_SIZE + (126) }, { D3DRTYPE_VOLUMETEXTURE, D3DFMT_P8, D3DPOOL_SCRATCH, 4, 4, 4, 3, test_palette, D3D_OK, { 32, DDS_PF_INDEXED, 0, 8, 0, 0, 0, 0 }, @@ -3146,7 +3146,7 @@ static void test_save_texture_to_dds_file(IDirect3DDevice9 *device) { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_MIPMAPCOUNT), 4, 4, 0, 0, 3, (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP | DDSCAPS_ALPHA | DDSCAPS_COMPLEX), (DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_ALLFACES), - DDS_FILE_HEADER_SIZE + (504), .todo_hr = TRUE + DDS_FILE_HEADER_SIZE + (504) }, /* * Volume texture with D3DPOOL default. Can't be mapped for read, @@ -3171,7 +3171,7 @@ static void test_save_texture_to_dds_file(IDirect3DDevice9 *device) { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT), 4, 4, 0, 0, 0, (DDSCAPS_TEXTURE | DDSCAPS_ALPHA | DDSCAPS_COMPLEX), (DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_ALLFACES), - DDS_FILE_HEADER_SIZE + (384), .todo_hr = TRUE + DDS_FILE_HEADER_SIZE + (384) }, { D3DRTYPE_VOLUMETEXTURE, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, 4, 4, 4, 1, NULL, D3D_OK, { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, @@ -3360,24 +3360,20 @@ static void test_D3DXSaveTextureToFileInMemory(IDirect3DDevice9 *device) ID3DXBuffer_Release(buffer); } - todo_wine { hr = D3DXSaveTextureToFileInMemory(&buffer, D3DXIFF_DDS, (IDirect3DBaseTexture9 *)cube_texture, NULL); ok(hr == D3D_OK, "D3DXSaveTextureToFileInMemory returned %#lx, expected %#lx\n", hr, D3D_OK); - if (SUCCEEDED(hr)) - { - buffer_pointer = ID3DXBuffer_GetBufferPointer(buffer); - buffer_size = ID3DXBuffer_GetBufferSize(buffer); - hr = D3DXGetImageInfoFromFileInMemory(buffer_pointer, buffer_size, &info); - ok(hr == D3D_OK, "D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n", hr, D3D_OK); - ok(info.Width == 256, "Got width %u, expected %u\n", info.Width, 256); - ok(info.Height == 256, "Got height %u, expected %u\n", info.Height, 256); - ok(info.MipLevels == 9, "Got miplevels %u, expected %u\n", info.MipLevels, 9); - ok(info.ResourceType == D3DRTYPE_CUBETEXTURE, "Got resource type %#x, expected %#x\n", info.ResourceType, D3DRTYPE_CUBETEXTURE); - ok(info.ImageFileFormat == D3DXIFF_DDS, "Got file format %#x, expected %#x\n", info.ImageFileFormat, D3DXIFF_DDS); - ID3DXBuffer_Release(buffer); - } - } + buffer_pointer = ID3DXBuffer_GetBufferPointer(buffer); + buffer_size = ID3DXBuffer_GetBufferSize(buffer); + hr = D3DXGetImageInfoFromFileInMemory(buffer_pointer, buffer_size, &info); + ok(hr == D3D_OK, "D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n", hr, D3D_OK); + + ok(info.Width == 256, "Got width %u, expected %u\n", info.Width, 256); + ok(info.Height == 256, "Got height %u, expected %u\n", info.Height, 256); + ok(info.MipLevels == 9, "Got miplevels %u, expected %u\n", info.MipLevels, 9); + ok(info.ResourceType == D3DRTYPE_CUBETEXTURE, "Got resource type %#x, expected %#x\n", info.ResourceType, D3DRTYPE_CUBETEXTURE); + ok(info.ImageFileFormat == D3DXIFF_DDS, "Got file format %#x, expected %#x\n", info.ImageFileFormat, D3DXIFF_DDS); + ID3DXBuffer_Release(buffer); IDirect3DCubeTexture9_Release(cube_texture); diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index d6b59cd65559..10214f89910e 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -1857,7 +1857,7 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE IDirect3DBaseTexture9 *src_texture, const PALETTEENTRY *src_palette) { const struct pixel_format_desc *fmt_desc = NULL; - uint32_t mip_levels, file_size, i; + uint32_t mip_levels, file_size, i, j; struct d3dx_image image = { 0 }; ID3DXBuffer *buffer = NULL; D3DRESOURCETYPE type; @@ -1922,6 +1922,23 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE break; } + case D3DRTYPE_CUBETEXTURE: + { + IDirect3DCubeTexture9 *texture = (IDirect3DCubeTexture9 *)src_texture; + D3DSURFACE_DESC desc; + + hr = IDirect3DCubeTexture9_GetLevelDesc(texture, 0, &desc); + if (FAILED(hr)) + break; + + fmt_desc = get_format_info(desc.Format); + if (is_unknown_format(fmt_desc)) + return E_NOTIMPL; + + set_volume_struct(&size, desc.Width, desc.Height, 1); + break; + } + default: return E_NOTIMPL; } @@ -1930,6 +1947,8 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE return E_NOTIMPL; file_size = d3dx_calculate_layer_pixels_size(fmt_desc->format, size.width, size.height, size.depth, mip_levels); + if (type == D3DRTYPE_CUBETEXTURE) + file_size *= 6; file_size += is_index_format(fmt_desc) ? sizeof(struct dds_header) + DDS_PALETTE_SIZE : sizeof(struct dds_header); hr = D3DXCreateBuffer(file_size, &buffer); @@ -1949,43 +1968,46 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE goto exit; /* So now, things are setup to do inverse of CreateTexture. */ - for (i = 0; i < mip_levels; ++i) + for (j = 0; j < image.layer_count; ++j) { - IDirect3DSurface9 *src_surface, *tmp_surface; - struct d3dx_pixels src_pixels, dst_pixels; - D3DSURFACE_DESC src_surface_desc; - D3DLOCKED_RECT src_locked_rect; - RECT src_rect; + for (i = 0; i < mip_levels; ++i) + { + IDirect3DSurface9 *src_surface, *tmp_surface; + struct d3dx_pixels src_pixels, dst_pixels; + D3DSURFACE_DESC src_surface_desc; + D3DLOCKED_RECT src_locked_rect; + RECT src_rect; - hr = d3dx_image_get_pixels(&image, 0, i, &dst_pixels); - if (FAILED(hr)) - break; + hr = d3dx_image_get_pixels(&image, j, i, &dst_pixels); + if (FAILED(hr)) + break; - hr = get_surface(type, src_texture, 0, i, &src_surface); - if (FAILED(hr)) - break; + hr = get_surface(type, src_texture, j, i, &src_surface); + if (FAILED(hr)) + break; - hr = lock_surface(src_surface, NULL, &src_locked_rect, &tmp_surface, FALSE); - if (FAILED(hr)) - break; + hr = lock_surface(src_surface, NULL, &src_locked_rect, &tmp_surface, FALSE); + if (FAILED(hr)) + break; - IDirect3DTexture9_GetLevelDesc((IDirect3DTexture9 *)src_texture, i, &src_surface_desc); - SetRect(&src_rect, 0, 0, src_surface_desc.Width, src_surface_desc.Height); - set_d3dx_pixels(&src_pixels, src_locked_rect.pBits, src_locked_rect.Pitch, 0, src_palette, - src_surface_desc.Width, src_surface_desc.Height, 1, &src_rect); + IDirect3DSurface9_GetDesc(src_surface, &src_surface_desc); + SetRect(&src_rect, 0, 0, src_surface_desc.Width, src_surface_desc.Height); + set_d3dx_pixels(&src_pixels, src_locked_rect.pBits, src_locked_rect.Pitch, 0, src_palette, + src_surface_desc.Width, src_surface_desc.Height, 1, &src_rect); - hr = d3dx_load_pixels_from_pixels(&dst_pixels, fmt_desc, &src_pixels, fmt_desc, D3DX_FILTER_NONE, 0); - if (FAILED(hr)) - { - unlock_surface(src_surface, NULL, tmp_surface, FALSE); + hr = d3dx_load_pixels_from_pixels(&dst_pixels, fmt_desc, &src_pixels, fmt_desc, D3DX_FILTER_NONE, 0); + if (FAILED(hr)) + { + unlock_surface(src_surface, NULL, tmp_surface, FALSE); + IDirect3DSurface9_Release(src_surface); + break; + } + + hr = unlock_surface(src_surface, NULL, tmp_surface, FALSE); IDirect3DSurface9_Release(src_surface); - break; + if (FAILED(hr)) + break; } - - hr = unlock_surface(src_surface, NULL, tmp_surface, FALSE); - IDirect3DSurface9_Release(src_surface); - if (FAILED(hr)) - break; } *dst_buffer = buffer; From 1974795eb4b1ee5535651e09035c300e26d58e7a Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 31 Oct 2024 12:50:47 -0400 Subject: [PATCH 0917/2542] d3dx9: Add support for saving IDirect3DVolumeTexture9 textures to DDS files in D3DXSaveTextureToFileInMemory(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/tests/texture.c | 35 +++++-------- dlls/d3dx9_36/texture.c | 99 ++++++++++++++++++++++++++--------- 2 files changed, 89 insertions(+), 45 deletions(-) diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index 06d9c7335fc1..d107fea0f976 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -3134,7 +3134,7 @@ static void test_save_texture_to_dds_file(IDirect3DDevice9 *device) { 32, DDS_PF_INDEXED, 0, 8, 0, 0, 0, 0 }, (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_MIPMAPCOUNT | DDSD_DEPTH), 4, 4, 0, 4, 3, (DDSCAPS_TEXTURE | DDSCAPS_PALETTE | DDSCAPS_MIPMAP | DDSCAPS_COMPLEX), (DDSCAPS2_VOLUME), - PALETTED_DDS_FILE_HEADER_SIZE + 73, .todo_hr = TRUE + PALETTED_DDS_FILE_HEADER_SIZE + 73 }, /* D3DFMT_A8R8G8B8 textures with multiple levels. */ { D3DRTYPE_TEXTURE, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, 4, 4, 0, 3, NULL, D3D_OK, @@ -3152,13 +3152,12 @@ static void test_save_texture_to_dds_file(IDirect3DDevice9 *device) * Volume texture with D3DPOOL default. Can't be mapped for read, * can't be saved. */ - { D3DRTYPE_VOLUMETEXTURE, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, 4, 4, 4, 3, NULL, D3DERR_INVALIDCALL, .todo_hr = TRUE }, + { D3DRTYPE_VOLUMETEXTURE, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, 4, 4, 4, 3, NULL, D3DERR_INVALIDCALL }, /* D3DPOOL_SYSTEMMEM can be saved. */ { D3DRTYPE_VOLUMETEXTURE, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, 4, 4, 4, 3, NULL, D3D_OK, { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_DEPTH | DDSD_MIPMAPCOUNT), 4, 4, 0, 4, 3, (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP | DDSCAPS_ALPHA | DDSCAPS_COMPLEX ), (DDSCAPS2_VOLUME), DDS_FILE_HEADER_SIZE + 292, - .todo_hr = TRUE }, /* Single mip level, no mip flags. */ { D3DRTYPE_TEXTURE, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, 4, 4, 0, 1, NULL, D3D_OK, @@ -3177,14 +3176,12 @@ static void test_save_texture_to_dds_file(IDirect3DDevice9 *device) { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_DEPTH), 4, 4, 0, 4, 0, (DDSCAPS_TEXTURE | DDSCAPS_ALPHA), (DDSCAPS2_VOLUME), DDS_FILE_HEADER_SIZE + 256, - .todo_hr = TRUE }, /* Volume texture with a depth of 1. */ { D3DRTYPE_VOLUMETEXTURE, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, 4, 4, 1, 1, NULL, D3D_OK, { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT), 4, 4, 0, 0, 0, (DDSCAPS_TEXTURE | DDSCAPS_ALPHA), 0, DDS_FILE_HEADER_SIZE + 64, - .todo_hr = TRUE }, }; struct @@ -3403,25 +3400,21 @@ static void test_D3DXSaveTextureToFileInMemory(IDirect3DDevice9 *device) ID3DXBuffer_Release(buffer); } - todo_wine { hr = D3DXSaveTextureToFileInMemory(&buffer, D3DXIFF_DDS, (IDirect3DBaseTexture9 *)volume_texture, NULL); ok(hr == D3D_OK, "D3DXSaveTextureToFileInMemory returned %#lx, expected %#lx\n", hr, D3D_OK); - if (SUCCEEDED(hr)) - { - buffer_pointer = ID3DXBuffer_GetBufferPointer(buffer); - buffer_size = ID3DXBuffer_GetBufferSize(buffer); - hr = D3DXGetImageInfoFromFileInMemory(buffer_pointer, buffer_size, &info); - ok(hr == D3D_OK, "D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n", hr, D3D_OK); - ok(info.Width == 256, "Got width %u, expected %u\n", info.Width, 256); - ok(info.Height == 256, "Got height %u, expected %u\n", info.Height, 256); - ok(info.Depth == 256, "Got depth %u, expected %u\n", info.Depth, 256); - ok(info.MipLevels == 9, "Got miplevels %u, expected %u\n", info.MipLevels, 9); - ok(info.ResourceType == D3DRTYPE_VOLUMETEXTURE, "Got resource type %#x, expected %#x\n", info.ResourceType, D3DRTYPE_VOLUMETEXTURE); - ok(info.ImageFileFormat == D3DXIFF_DDS, "Got file format %#x, expected %#x\n", info.ImageFileFormat, D3DXIFF_DDS); - ID3DXBuffer_Release(buffer); - } - } + buffer_pointer = ID3DXBuffer_GetBufferPointer(buffer); + buffer_size = ID3DXBuffer_GetBufferSize(buffer); + hr = D3DXGetImageInfoFromFileInMemory(buffer_pointer, buffer_size, &info); + ok(hr == D3D_OK, "D3DXGetImageInfoFromFileInMemory returned %#lx, expected %#lx\n", hr, D3D_OK); + + ok(info.Width == 256, "Got width %u, expected %u\n", info.Width, 256); + ok(info.Height == 256, "Got height %u, expected %u\n", info.Height, 256); + ok(info.Depth == 256, "Got depth %u, expected %u\n", info.Depth, 256); + ok(info.MipLevels == 9, "Got miplevels %u, expected %u\n", info.MipLevels, 9); + ok(info.ResourceType == D3DRTYPE_VOLUMETEXTURE, "Got resource type %#x, expected %#x\n", info.ResourceType, D3DRTYPE_VOLUMETEXTURE); + ok(info.ImageFileFormat == D3DXIFF_DDS, "Got file format %#x, expected %#x\n", info.ImageFileFormat, D3DXIFF_DDS); + ID3DXBuffer_Release(buffer); IDirect3DVolumeTexture9_Release(volume_texture); test_save_texture_to_dds_file(device); diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index 10214f89910e..a31d2a411c3c 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -1939,8 +1939,26 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE break; } + case D3DRTYPE_VOLUMETEXTURE: + { + IDirect3DVolumeTexture9 *texture = (IDirect3DVolumeTexture9 *)src_texture; + D3DVOLUME_DESC desc; + + hr = IDirect3DVolumeTexture9_GetLevelDesc(texture, 0, &desc); + if (FAILED(hr)) + break; + + fmt_desc = get_format_info(desc.Format); + if (is_unknown_format(fmt_desc)) + return E_NOTIMPL; + + set_volume_struct(&size, desc.Width, desc.Height, desc.Depth); + break; + } + default: - return E_NOTIMPL; + assert(0); /* Should not happen. */ + return E_FAIL; } if (is_index_format(fmt_desc) && !src_palette) @@ -1968,43 +1986,76 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE goto exit; /* So now, things are setup to do inverse of CreateTexture. */ - for (j = 0; j < image.layer_count; ++j) + if (type != D3DRTYPE_VOLUMETEXTURE) { + for (j = 0; j < image.layer_count; ++j) + { + for (i = 0; i < mip_levels; ++i) + { + IDirect3DSurface9 *src_surface, *tmp_surface; + struct d3dx_pixels src_pixels, dst_pixels; + D3DSURFACE_DESC src_surface_desc; + D3DLOCKED_RECT src_locked_rect; + RECT src_rect; + + hr = d3dx_image_get_pixels(&image, j, i, &dst_pixels); + if (FAILED(hr)) + break; + + hr = get_surface(type, src_texture, j, i, &src_surface); + if (FAILED(hr)) + break; + + hr = lock_surface(src_surface, NULL, &src_locked_rect, &tmp_surface, FALSE); + if (FAILED(hr)) + break; + + IDirect3DSurface9_GetDesc(src_surface, &src_surface_desc); + SetRect(&src_rect, 0, 0, src_surface_desc.Width, src_surface_desc.Height); + set_d3dx_pixels(&src_pixels, src_locked_rect.pBits, src_locked_rect.Pitch, 0, src_palette, + src_surface_desc.Width, src_surface_desc.Height, 1, &src_rect); + + hr = d3dx_load_pixels_from_pixels(&dst_pixels, fmt_desc, &src_pixels, fmt_desc, D3DX_FILTER_NONE, 0); + if (FAILED(hr)) + { + unlock_surface(src_surface, NULL, tmp_surface, FALSE); + IDirect3DSurface9_Release(src_surface); + break; + } + + hr = unlock_surface(src_surface, NULL, tmp_surface, FALSE); + IDirect3DSurface9_Release(src_surface); + if (FAILED(hr)) + break; + } + } + } + else + { + IDirect3DVolumeTexture9 *volume_tex = (IDirect3DVolumeTexture9 *)src_texture; + for (i = 0; i < mip_levels; ++i) { - IDirect3DSurface9 *src_surface, *tmp_surface; struct d3dx_pixels src_pixels, dst_pixels; - D3DSURFACE_DESC src_surface_desc; - D3DLOCKED_RECT src_locked_rect; + D3DVOLUME_DESC src_volume_desc; + D3DLOCKED_BOX src_locked_box; RECT src_rect; - hr = d3dx_image_get_pixels(&image, j, i, &dst_pixels); - if (FAILED(hr)) - break; - - hr = get_surface(type, src_texture, j, i, &src_surface); + hr = d3dx_image_get_pixels(&image, 0, i, &dst_pixels); if (FAILED(hr)) break; - hr = lock_surface(src_surface, NULL, &src_locked_rect, &tmp_surface, FALSE); + hr = IDirect3DVolumeTexture9_LockBox(volume_tex, i, &src_locked_box, NULL, D3DLOCK_READONLY); if (FAILED(hr)) break; - IDirect3DSurface9_GetDesc(src_surface, &src_surface_desc); - SetRect(&src_rect, 0, 0, src_surface_desc.Width, src_surface_desc.Height); - set_d3dx_pixels(&src_pixels, src_locked_rect.pBits, src_locked_rect.Pitch, 0, src_palette, - src_surface_desc.Width, src_surface_desc.Height, 1, &src_rect); + IDirect3DVolumeTexture9_GetLevelDesc(volume_tex, i, &src_volume_desc); + SetRect(&src_rect, 0, 0, src_volume_desc.Width, src_volume_desc.Height); + set_d3dx_pixels(&src_pixels, src_locked_box.pBits, src_locked_box.RowPitch, src_locked_box.SlicePitch, + src_palette, src_volume_desc.Width, src_volume_desc.Height, src_volume_desc.Depth, &src_rect); hr = d3dx_load_pixels_from_pixels(&dst_pixels, fmt_desc, &src_pixels, fmt_desc, D3DX_FILTER_NONE, 0); - if (FAILED(hr)) - { - unlock_surface(src_surface, NULL, tmp_surface, FALSE); - IDirect3DSurface9_Release(src_surface); - break; - } - - hr = unlock_surface(src_surface, NULL, tmp_surface, FALSE); - IDirect3DSurface9_Release(src_surface); + IDirect3DVolumeTexture9_UnlockBox(volume_tex, i); if (FAILED(hr)) break; } From 00eed7141c8b70934858e530e3487e875ee8653e Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 1 Nov 2024 09:31:08 -0400 Subject: [PATCH 0918/2542] d3dx9: Properly handle DXT textures with premultiplied alpha. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/d3dx9_private.h | 24 +++++++------ dlls/d3dx9_36/surface.c | 63 +++++++++++++++++++++++++++++------ dlls/d3dx9_36/tests/surface.c | 12 +++++-- dlls/d3dx9_36/util.c | 4 +-- 4 files changed, 77 insertions(+), 26 deletions(-) diff --git a/dlls/d3dx9_36/d3dx9_private.h b/dlls/d3dx9_36/d3dx9_private.h index d94e14d54056..10c9670f1a89 100644 --- a/dlls/d3dx9_36/d3dx9_private.h +++ b/dlls/d3dx9_36/d3dx9_private.h @@ -124,6 +124,10 @@ struct dds_header DWORD reserved2; }; +/* These are custom Wine only filter flags. */ +#define D3DX_FILTER_PMA_IN 0x00800000 +#define D3DX_FILTER_PMA_OUT 0x01000000 +#define D3DX_FILTER_PMA 0x01800000 struct vec4 { @@ -233,6 +237,7 @@ enum format_flag FMT_FLAG_PACKED = 0x02, /* Internal only format, has no exact D3DFORMAT equivalent. */ FMT_FLAG_INTERNAL = 0x04, + FMT_FLAG_PM_ALPHA = 0x08, }; struct pixel_format_desc { @@ -350,6 +355,14 @@ static inline BOOL is_internal_format(const struct pixel_format_desc *format) return !!(format->flags & FMT_FLAG_INTERNAL); } +static inline BOOL filter_flags_match(uint32_t filter_flags) +{ + if (!!(filter_flags & D3DX_FILTER_PMA_IN) != !!((filter_flags & D3DX_FILTER_PMA_OUT))) + return FALSE; + + return TRUE; +} + static inline BOOL is_conversion_from_supported(const struct pixel_format_desc *format) { return !is_packed_format(format) && !is_unknown_format(format); @@ -375,17 +388,6 @@ void format_to_d3dx_color(const struct pixel_format_desc *format, const BYTE *sr struct d3dx_color *dst); void format_from_d3dx_color(const struct pixel_format_desc *format, const struct d3dx_color *src, BYTE *dst); -void copy_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, - BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, const struct volume *size, - const struct pixel_format_desc *format); -void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, - const struct volume *src_size, const struct pixel_format_desc *src_format, - BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, const struct volume *dst_size, - const struct pixel_format_desc *dst_format, D3DCOLOR color_key, const PALETTEENTRY *palette); -void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, - const struct volume *src_size, const struct pixel_format_desc *src_format, - BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, const struct volume *dst_size, - const struct pixel_format_desc *dst_format, D3DCOLOR color_key, const PALETTEENTRY *palette); HRESULT lock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, D3DLOCKED_RECT *lock, IDirect3DSurface9 **temp_surface, BOOL write); diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 8f1a79e2b299..00e4a42691cb 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -1434,6 +1434,10 @@ static HRESULT d3dx_image_tga_rle_decode_row(const uint8_t **src, uint32_t src_b return D3D_OK; } +static void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, const struct volume *src_size, + const struct pixel_format_desc *src_format, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, + const struct volume *dst_size, const struct pixel_format_desc *dst_format, D3DCOLOR color_key, + const PALETTEENTRY *palette, uint32_t filter_flags); static HRESULT d3dx_image_tga_decode(const void *src_data, uint32_t src_data_size, uint32_t src_header_size, struct d3dx_image *image) { @@ -1478,7 +1482,7 @@ static HRESULT d3dx_image_tga_decode(const void *src_data, uint32_t src_data_siz dst_desc = get_format_info(D3DFMT_A8B8G8R8); d3dx_calculate_pixels_size(dst_desc->format, 256, 1, &dst_row_pitch, &dst_slice_pitch); convert_argb_pixels(src_palette, src_row_pitch, src_slice_pitch, &image_map_size, src_desc, (BYTE *)palette, - dst_row_pitch, dst_slice_pitch, &image_map_size, dst_desc, 0, NULL); + dst_row_pitch, dst_slice_pitch, &image_map_size, dst_desc, 0, NULL, D3DX_FILTER_NONE); /* Initialize unused palette entries to 0xff. */ if (header->color_map_length < 256) @@ -2258,6 +2262,20 @@ static enum range get_range_for_component_type(enum component_type type) } } +static void premultiply_alpha(struct vec4 *vec) +{ + vec->x *= vec->w; + vec->y *= vec->w; + vec->z *= vec->w; +} + +static void undo_premultiplied_alpha(struct vec4 *vec) +{ + vec->x = (vec->w == 0.0f) ? 0.0f : vec->x / vec->w; + vec->y = (vec->w == 0.0f) ? 0.0f : vec->y / vec->w; + vec->z = (vec->w == 0.0f) ? 0.0f : vec->z / vec->w; +} + /* It doesn't work for components bigger than 32 bits (or somewhat smaller but unaligned). */ void format_to_d3dx_color(const struct pixel_format_desc *format, const BYTE *src, const PALETTEENTRY *palette, struct d3dx_color *dst) @@ -2430,7 +2448,7 @@ void format_from_d3dx_color(const struct pixel_format_desc *format, const struct * Works for any pixel format. * The source and the destination must be block-aligned. */ -void copy_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, +static void copy_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, const struct volume *size, const struct pixel_format_desc *format) { @@ -2461,13 +2479,14 @@ void copy_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, * any necessary format conversion and color keying. * Pixels outsize the source rect are blacked out. */ -void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, const struct volume *src_size, +static void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, const struct volume *src_size, const struct pixel_format_desc *src_format, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, const struct volume *dst_size, const struct pixel_format_desc *dst_format, D3DCOLOR color_key, - const PALETTEENTRY *palette) + const PALETTEENTRY *palette, uint32_t filter_flags) { struct argb_conversion_info conv_info, ck_conv_info; const struct pixel_format_desc *ck_format; + BOOL src_pma, dst_pma; DWORD channels[4]; UINT min_width, min_height, min_depth; UINT x, y, z; @@ -2480,6 +2499,8 @@ void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pit ZeroMemory(channels, sizeof(channels)); init_argb_conversion_info(src_format, dst_format, &conv_info); + src_pma = !!(filter_flags & D3DX_FILTER_PMA_IN); + dst_pma = !!(filter_flags & D3DX_FILTER_PMA_OUT); min_width = min(src_size->width, dst_size->width); min_height = min(src_size->height, dst_size->height); min_depth = min(src_size->depth, dst_size->depth); @@ -2500,7 +2521,7 @@ void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pit BYTE *dst_ptr = dst_slice_ptr + y * dst_row_pitch; for (x = 0; x < min_width; x++) { - if (format_types_match(src_format, dst_format) + if (filter_flags_match(filter_flags) && format_types_match(src_format, dst_format) && src_format->bytes_per_pixel <= 4 && dst_format->bytes_per_pixel <= 4) { DWORD val; @@ -2524,6 +2545,8 @@ void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pit struct d3dx_color color, tmp; format_to_d3dx_color(src_format, src_ptr, palette, &color); + if (src_pma && src_pma != dst_pma) + undo_premultiplied_alpha(&color.value); tmp = color; if (color_key) @@ -2536,6 +2559,8 @@ void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pit } color = tmp; + if (dst_pma && src_pma != dst_pma) + premultiply_alpha(&color.value); format_from_d3dx_color(dst_format, &color, dst_ptr); } @@ -2561,13 +2586,14 @@ void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pit * any necessary format conversion, color keying and stretching * using a point filter. */ -void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, const struct volume *src_size, +static void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, const struct volume *src_size, const struct pixel_format_desc *src_format, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, const struct volume *dst_size, const struct pixel_format_desc *dst_format, D3DCOLOR color_key, - const PALETTEENTRY *palette) + const PALETTEENTRY *palette, uint32_t filter_flags) { struct argb_conversion_info conv_info, ck_conv_info; const struct pixel_format_desc *ck_format; + BOOL src_pma, dst_pma; DWORD channels[4]; UINT x, y, z; @@ -2576,6 +2602,8 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic src, src_row_pitch, src_slice_pitch, src_size, src_format, dst, dst_row_pitch, dst_slice_pitch, dst_size, dst_format, color_key, palette); + src_pma = !!(filter_flags & D3DX_FILTER_PMA_IN); + dst_pma = !!(filter_flags & D3DX_FILTER_PMA_OUT); ZeroMemory(channels, sizeof(channels)); init_argb_conversion_info(src_format, dst_format, &conv_info); @@ -2600,7 +2628,7 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic { const BYTE *src_ptr = src_row_ptr + (x * src_size->width / dst_size->width) * src_format->bytes_per_pixel; - if (format_types_match(src_format, dst_format) + if (filter_flags_match(filter_flags) && format_types_match(src_format, dst_format) && src_format->bytes_per_pixel <= 4 && dst_format->bytes_per_pixel <= 4) { DWORD val; @@ -2624,6 +2652,8 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic struct d3dx_color color, tmp; format_to_d3dx_color(src_format, src_ptr, palette, &color); + if (src_pma && src_pma != dst_pma) + undo_premultiplied_alpha(&color.value); tmp = color; if (color_key) @@ -2636,6 +2666,8 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic } color = tmp; + if (dst_pma && src_pma != dst_pma) + premultiply_alpha(&color.value); format_from_d3dx_color(dst_format, &color, dst_ptr); } @@ -2786,12 +2818,22 @@ HRESULT d3dx_load_pixels_from_pixels(struct d3dx_pixels *dst_pixels, const struct pixel_format_desc *src_desc, uint32_t filter_flags, uint32_t color_key) { struct volume src_size, dst_size, dst_size_aligned; + BOOL src_pma, dst_pma; HRESULT hr = S_OK; TRACE("dst_pixels %s, dst_desc %p, src_pixels %s, src_desc %p, filter_flags %#x, color_key %#x.\n", debug_d3dx_pixels(dst_pixels), dst_desc, debug_d3dx_pixels(src_pixels), src_desc, filter_flags, color_key); + if (src_desc->flags & FMT_FLAG_PM_ALPHA) + filter_flags |= D3DX_FILTER_PMA_IN; + + if (dst_desc->flags & FMT_FLAG_PM_ALPHA) + filter_flags |= D3DX_FILTER_PMA_OUT; + + src_pma = !!(filter_flags & D3DX_FILTER_PMA_IN); + dst_pma = !!(filter_flags & D3DX_FILTER_PMA_OUT); + if (is_compressed_format(src_desc)) set_volume_struct(&src_size, (src_pixels->unaligned_rect.right - src_pixels->unaligned_rect.left), (src_pixels->unaligned_rect.bottom - src_pixels->unaligned_rect.top), src_pixels->size.depth); @@ -2810,6 +2852,7 @@ HRESULT d3dx_load_pixels_from_pixels(struct d3dx_pixels *dst_pixels, && (dst_size.width == src_size.width && !(dst_size.width % dst_desc->block_width)) && (dst_size.height == src_size.height && !(dst_size.height % dst_desc->block_height)) && (dst_size.depth == src_size.depth) + && (src_pma == dst_pma) && color_key == 0 && !(src_pixels->unaligned_rect.left & (src_desc->block_width - 1)) && !(src_pixels->unaligned_rect.top & (src_desc->block_height - 1)) @@ -2917,7 +2960,7 @@ HRESULT d3dx_load_pixels_from_pixels(struct d3dx_pixels *dst_pixels, { convert_argb_pixels(src_pixels->data, src_pixels->row_pitch, src_pixels->slice_pitch, &src_size, src_desc, (BYTE *)dst_pixels->data, dst_pixels->row_pitch, dst_pixels->slice_pitch, &dst_size, dst_desc, - color_key, src_pixels->palette); + color_key, src_pixels->palette, filter_flags); } else /* if ((filter & 0xf) == D3DX_FILTER_POINT) */ { @@ -2928,7 +2971,7 @@ HRESULT d3dx_load_pixels_from_pixels(struct d3dx_pixels *dst_pixels, * D3DX_FILTER_TRIANGLE and D3DX_FILTER_BOX are implemented. */ point_filter_argb_pixels(src_pixels->data, src_pixels->row_pitch, src_pixels->slice_pitch, &src_size, src_desc, (BYTE *)dst_pixels->data, dst_pixels->row_pitch, dst_pixels->slice_pitch, &dst_size, - dst_desc, color_key, src_pixels->palette); + dst_desc, color_key, src_pixels->palette, filter_flags); } exit: diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index a8e101db1972..ece8d323687d 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -1029,6 +1029,13 @@ static inline void _check_pixel_4bpp(unsigned int line, const D3DLOCKED_RECT *lo ok_(__FILE__, line)(color == expected_color, "Got color 0x%08lx, expected 0x%08lx\n", color, expected_color); } +#define check_pixel_4bpp_diff(lockrect, x, y, color, max_diff) _check_pixel_4bpp_diff(__LINE__, lockrect, x, y, color, max_diff) +static inline void _check_pixel_4bpp_diff(unsigned int line, const D3DLOCKED_RECT *lockrect, int x, int y, DWORD expected_color, uint8_t max_diff) +{ + DWORD color = ((DWORD*)lockrect->pBits)[x + y * lockrect->Pitch / 4]; + ok_(__FILE__, line)(compare_color_4bpp(color, expected_color, max_diff), "Got color 0x%08lx, expected 0x%08lx.\n", color, expected_color); +} + #define check_pixel_8bpp(lockrect, x, y, color) _check_pixel_8bpp(__LINE__, lockrect, x, y, color) static inline void _check_pixel_8bpp(unsigned int line, const D3DLOCKED_RECT *lockrect, int x, int y, uint64_t expected_color) { @@ -1348,7 +1355,7 @@ static void test_dxt_premultiplied_alpha(IDirect3DDevice9 *device) { const uint32_t expected_pixel = !(x & 0x01) ? 0xffffffff : 0x00000000; - check_readback_pixel_4bpp(&surface_rb, x, y, expected_pixel, !expected_pixel); + check_readback_pixel_4bpp(&surface_rb, x, y, expected_pixel, FALSE); } } release_surface_readback(&surface_rb); @@ -1376,9 +1383,8 @@ static void test_dxt_premultiplied_alpha(IDirect3DDevice9 *device) for (x = 0; x < 4; ++x) { const uint32_t expected_pixel = dxt_pma_decompressed_expected[(y * 4) + x]; - const BOOL todo = ((expected_pixel >> 24) & 0xff) != 0xff; - todo_wine_if(todo) check_pixel_4bpp(&lock_rect, x, y, expected_pixel); + check_pixel_4bpp_diff(&lock_rect, x, y, expected_pixel, 1); } } IDirect3DSurface9_UnlockRect(decomp_surf); diff --git a/dlls/d3dx9_36/util.c b/dlls/d3dx9_36/util.c index e6a11cdc1e4b..21b180aba49c 100644 --- a/dlls/d3dx9_36/util.c +++ b/dlls/d3dx9_36/util.c @@ -54,9 +54,9 @@ static const struct pixel_format_desc formats[] = {D3DX_PIXEL_FORMAT_L8_UNORM, { 0, 8, 0, 0}, { 0, 0, 0, 0}, 1, 1, 1, 1, CTYPE_EMPTY, CTYPE_LUMA, 0 }, {D3DX_PIXEL_FORMAT_L16_UNORM, { 0, 16, 0, 0}, { 0, 0, 0, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_LUMA, 0 }, {D3DX_PIXEL_FORMAT_DXT1_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 8, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT}, - {D3DX_PIXEL_FORMAT_DXT2_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT}, + {D3DX_PIXEL_FORMAT_DXT2_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT | FMT_FLAG_PM_ALPHA}, {D3DX_PIXEL_FORMAT_DXT3_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT}, - {D3DX_PIXEL_FORMAT_DXT4_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT}, + {D3DX_PIXEL_FORMAT_DXT4_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT | FMT_FLAG_PM_ALPHA}, {D3DX_PIXEL_FORMAT_DXT5_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT}, {D3DX_PIXEL_FORMAT_R16_FLOAT, { 0, 16, 0, 0}, { 0, 0, 0, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_FLOAT, 0 }, {D3DX_PIXEL_FORMAT_R16G16_FLOAT, { 0, 16, 16, 0}, { 0, 0, 16, 0}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_FLOAT, 0 }, From ece9a796c6c786be9049b84b126f748e0e61c35e Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 26 Jul 2024 10:29:02 -0400 Subject: [PATCH 0919/2542] d3dx9: Replace txc_fetch_dxtn with bcdec library. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_24/Makefile.in | 1 - dlls/d3dx9_25/Makefile.in | 1 - dlls/d3dx9_26/Makefile.in | 1 - dlls/d3dx9_27/Makefile.in | 1 - dlls/d3dx9_28/Makefile.in | 1 - dlls/d3dx9_29/Makefile.in | 1 - dlls/d3dx9_30/Makefile.in | 1 - dlls/d3dx9_31/Makefile.in | 1 - dlls/d3dx9_32/Makefile.in | 1 - dlls/d3dx9_33/Makefile.in | 1 - dlls/d3dx9_34/Makefile.in | 1 - dlls/d3dx9_35/Makefile.in | 1 - dlls/d3dx9_36/Makefile.in | 1 - dlls/d3dx9_36/bcdec.h | 1328 ++++++++++++++++++++++++++++++++ dlls/d3dx9_36/surface.c | 100 ++- dlls/d3dx9_36/txc_dxtn.h | 9 - dlls/d3dx9_36/txc_fetch_dxtn.c | 243 ------ dlls/d3dx9_37/Makefile.in | 1 - dlls/d3dx9_38/Makefile.in | 1 - dlls/d3dx9_39/Makefile.in | 1 - dlls/d3dx9_40/Makefile.in | 1 - dlls/d3dx9_41/Makefile.in | 1 - dlls/d3dx9_42/Makefile.in | 1 - dlls/d3dx9_43/Makefile.in | 1 - 24 files changed, 1414 insertions(+), 286 deletions(-) create mode 100644 dlls/d3dx9_36/bcdec.h delete mode 100644 dlls/d3dx9_36/txc_fetch_dxtn.c diff --git a/dlls/d3dx9_24/Makefile.in b/dlls/d3dx9_24/Makefile.in index d0fef3bebd08..fe179073bc18 100644 --- a/dlls/d3dx9_24/Makefile.in +++ b/dlls/d3dx9_24/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_25/Makefile.in b/dlls/d3dx9_25/Makefile.in index 869c11629047..fd69473a512c 100644 --- a/dlls/d3dx9_25/Makefile.in +++ b/dlls/d3dx9_25/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_26/Makefile.in b/dlls/d3dx9_26/Makefile.in index ae3f2e189537..7bec29003b2b 100644 --- a/dlls/d3dx9_26/Makefile.in +++ b/dlls/d3dx9_26/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_27/Makefile.in b/dlls/d3dx9_27/Makefile.in index 4f2993638f36..9c17602a0636 100644 --- a/dlls/d3dx9_27/Makefile.in +++ b/dlls/d3dx9_27/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_28/Makefile.in b/dlls/d3dx9_28/Makefile.in index 3c7ddb93c2e1..23b3525ebc10 100644 --- a/dlls/d3dx9_28/Makefile.in +++ b/dlls/d3dx9_28/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_29/Makefile.in b/dlls/d3dx9_29/Makefile.in index 75eb3e732430..128ed2472a29 100644 --- a/dlls/d3dx9_29/Makefile.in +++ b/dlls/d3dx9_29/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_30/Makefile.in b/dlls/d3dx9_30/Makefile.in index 9b8eb133611e..a83e0d33ce55 100644 --- a/dlls/d3dx9_30/Makefile.in +++ b/dlls/d3dx9_30/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_31/Makefile.in b/dlls/d3dx9_31/Makefile.in index 52d3a3d0986e..78abe46dd32f 100644 --- a/dlls/d3dx9_31/Makefile.in +++ b/dlls/d3dx9_31/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_32/Makefile.in b/dlls/d3dx9_32/Makefile.in index 70a1696de97e..5b25b0f2d0f3 100644 --- a/dlls/d3dx9_32/Makefile.in +++ b/dlls/d3dx9_32/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_33/Makefile.in b/dlls/d3dx9_33/Makefile.in index 2c01e9da3d96..b14887d18635 100644 --- a/dlls/d3dx9_33/Makefile.in +++ b/dlls/d3dx9_33/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_34/Makefile.in b/dlls/d3dx9_34/Makefile.in index 1e317f37226d..fd3a2b1d74f4 100644 --- a/dlls/d3dx9_34/Makefile.in +++ b/dlls/d3dx9_34/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_35/Makefile.in b/dlls/d3dx9_35/Makefile.in index 859cef9b1ce1..6bd60addc4e5 100644 --- a/dlls/d3dx9_35/Makefile.in +++ b/dlls/d3dx9_35/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_36/Makefile.in b/dlls/d3dx9_36/Makefile.in index 5370b3e7e7ac..d72bf520b183 100644 --- a/dlls/d3dx9_36/Makefile.in +++ b/dlls/d3dx9_36/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_36/bcdec.h b/dlls/d3dx9_36/bcdec.h new file mode 100644 index 000000000000..55f996620545 --- /dev/null +++ b/dlls/d3dx9_36/bcdec.h @@ -0,0 +1,1328 @@ +/* bcdec.h - v0.96 + provides functions to decompress blocks of BC compressed images + written by Sergii "iOrange" Kudlai in 2022 + + This library does not allocate memory and is trying to use as less stack as possible + + The library was never optimized specifically for speed but for the overall size + it has zero external dependencies and is not using any runtime functions + + Supported BC formats: + BC1 (also known as DXT1) + it's "binary alpha" variant BC1A (DXT1A) + BC2 (also known as DXT3) + BC3 (also known as DXT5) + BC4 (also known as ATI1N) + BC5 (also known as ATI2N) + BC6H (HDR format) + BC7 + + BC1/BC2/BC3/BC7 are expected to decompress into 4*4 RGBA blocks 8bit per component (32bit pixel) + BC4/BC5 are expected to decompress into 4*4 R/RG blocks 8bit per component (8bit and 16bit pixel) + BC6H is expected to decompress into 4*4 RGB blocks of either 32bit float or 16bit "half" per + component (96bit or 48bit pixel) + + For more info, issues and suggestions please visit https://github.com/iOrange/bcdec + + CREDITS: + Aras Pranckevicius (@aras-p) - BC1/BC3 decoders optimizations (up to 3x the speed) + - BC6H/BC7 bits pulling routines optimizations + - optimized BC6H by moving unquantize out of the loop + - Split BC6H decompression function into 'half' and + 'float' variants + + bugfixes: + @linkmauve + + LICENSE: See end of file for license information. +*/ + +#ifndef BCDEC_HEADER_INCLUDED +#define BCDEC_HEADER_INCLUDED + +/* if BCDEC_STATIC causes problems, try defining BCDECDEF to 'inline' or 'static inline' */ +#ifndef BCDECDEF +#ifdef BCDEC_STATIC +#define BCDECDEF static +#else +#ifdef __cplusplus +#define BCDECDEF extern "C" +#else +#define BCDECDEF extern +#endif +#endif +#endif + +/* Used information sources: + https://docs.microsoft.com/en-us/windows/win32/direct3d10/d3d10-graphics-programming-guide-resources-block-compression + https://docs.microsoft.com/en-us/windows/win32/direct3d11/bc6h-format + https://docs.microsoft.com/en-us/windows/win32/direct3d11/bc7-format + https://docs.microsoft.com/en-us/windows/win32/direct3d11/bc7-format-mode-reference + + ! WARNING ! Khronos's BPTC partitions tables contain mistakes, do not use them! + https://www.khronos.org/registry/DataFormat/specs/1.1/dataformat.1.1.html#BPTC + + ! Use tables from here instead ! + https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_texture_compression_bptc.txt + + Leaving it here as it's a nice read + https://fgiesen.wordpress.com/2021/10/04/gpu-bcn-decoding/ + + Fast half to float function from here + https://gist.github.com/rygorous/2144712 +*/ + +#define BCDEC_BC1_BLOCK_SIZE 8 +#define BCDEC_BC2_BLOCK_SIZE 16 +#define BCDEC_BC3_BLOCK_SIZE 16 +#define BCDEC_BC4_BLOCK_SIZE 8 +#define BCDEC_BC5_BLOCK_SIZE 16 +#define BCDEC_BC6H_BLOCK_SIZE 16 +#define BCDEC_BC7_BLOCK_SIZE 16 + +#define BCDEC_BC1_COMPRESSED_SIZE(w, h) ((((w)>>2)*((h)>>2))*BCDEC_BC1_BLOCK_SIZE) +#define BCDEC_BC2_COMPRESSED_SIZE(w, h) ((((w)>>2)*((h)>>2))*BCDEC_BC2_BLOCK_SIZE) +#define BCDEC_BC3_COMPRESSED_SIZE(w, h) ((((w)>>2)*((h)>>2))*BCDEC_BC3_BLOCK_SIZE) +#define BCDEC_BC4_COMPRESSED_SIZE(w, h) ((((w)>>2)*((h)>>2))*BCDEC_BC4_BLOCK_SIZE) +#define BCDEC_BC5_COMPRESSED_SIZE(w, h) ((((w)>>2)*((h)>>2))*BCDEC_BC5_BLOCK_SIZE) +#define BCDEC_BC6H_COMPRESSED_SIZE(w, h) ((((w)>>2)*((h)>>2))*BCDEC_BC6H_BLOCK_SIZE) +#define BCDEC_BC7_COMPRESSED_SIZE(w, h) ((((w)>>2)*((h)>>2))*BCDEC_BC7_BLOCK_SIZE) + +BCDECDEF void bcdec_bc1(const void* compressedBlock, void* decompressedBlock, int destinationPitch); +BCDECDEF void bcdec_bc2(const void* compressedBlock, void* decompressedBlock, int destinationPitch); +BCDECDEF void bcdec_bc3(const void* compressedBlock, void* decompressedBlock, int destinationPitch); +BCDECDEF void bcdec_bc4(const void* compressedBlock, void* decompressedBlock, int destinationPitch); +BCDECDEF void bcdec_bc5(const void* compressedBlock, void* decompressedBlock, int destinationPitch); +BCDECDEF void bcdec_bc6h_float(const void* compressedBlock, void* decompressedBlock, int destinationPitch, int isSigned); +BCDECDEF void bcdec_bc6h_half(const void* compressedBlock, void* decompressedBlock, int destinationPitch, int isSigned); +BCDECDEF void bcdec_bc7(const void* compressedBlock, void* decompressedBlock, int destinationPitch); + +#endif /* BCDEC_HEADER_INCLUDED */ + +#ifdef BCDEC_IMPLEMENTATION + +static void bcdec__color_block(const void* compressedBlock, void* decompressedBlock, int destinationPitch, int onlyOpaqueMode) { + unsigned short c0, c1; + unsigned int refColors[4]; /* 0xAABBGGRR */ + unsigned char* dstColors; + unsigned int colorIndices; + int i, j, idx; + unsigned int r0, g0, b0, r1, g1, b1, r, g, b; + + c0 = ((unsigned short*)compressedBlock)[0]; + c1 = ((unsigned short*)compressedBlock)[1]; + + /* Expand 565 ref colors to 888 */ + r0 = (((c0 >> 11) & 0x1F) * 527 + 23) >> 6; + g0 = (((c0 >> 5) & 0x3F) * 259 + 33) >> 6; + b0 = ((c0 & 0x1F) * 527 + 23) >> 6; + refColors[0] = 0xFF000000 | (b0 << 16) | (g0 << 8) | r0; + + r1 = (((c1 >> 11) & 0x1F) * 527 + 23) >> 6; + g1 = (((c1 >> 5) & 0x3F) * 259 + 33) >> 6; + b1 = ((c1 & 0x1F) * 527 + 23) >> 6; + refColors[1] = 0xFF000000 | (b1 << 16) | (g1 << 8) | r1; + + if (c0 > c1 || onlyOpaqueMode) { /* Standard BC1 mode (also BC3 color block uses ONLY this mode) */ + /* color_2 = 2/3*color_0 + 1/3*color_1 + color_3 = 1/3*color_0 + 2/3*color_1 */ + r = (2 * r0 + r1 + 1) / 3; + g = (2 * g0 + g1 + 1) / 3; + b = (2 * b0 + b1 + 1) / 3; + refColors[2] = 0xFF000000 | (b << 16) | (g << 8) | r; + + r = (r0 + 2 * r1 + 1) / 3; + g = (g0 + 2 * g1 + 1) / 3; + b = (b0 + 2 * b1 + 1) / 3; + refColors[3] = 0xFF000000 | (b << 16) | (g << 8) | r; + } else { /* Quite rare BC1A mode */ + /* color_2 = 1/2*color_0 + 1/2*color_1; + color_3 = 0; */ + r = (r0 + r1 + 1) >> 1; + g = (g0 + g1 + 1) >> 1; + b = (b0 + b1 + 1) >> 1; + refColors[2] = 0xFF000000 | (b << 16) | (g << 8) | r; + + refColors[3] = 0x00000000; + } + + colorIndices = ((unsigned int*)compressedBlock)[1]; + + /* Fill out the decompressed color block */ + dstColors = (unsigned char*)decompressedBlock; + for (i = 0; i < 4; ++i) { + for (j = 0; j < 4; ++j) { + idx = colorIndices & 0x03; + ((unsigned int*)dstColors)[j] = refColors[idx]; + colorIndices >>= 2; + } + + dstColors += destinationPitch; + } +} + +static void bcdec__sharp_alpha_block(const void* compressedBlock, void* decompressedBlock, int destinationPitch) { + unsigned short* alpha; + unsigned char* decompressed; + int i, j; + + alpha = (unsigned short*)compressedBlock; + decompressed = (unsigned char*)decompressedBlock; + + for (i = 0; i < 4; ++i) { + for (j = 0; j < 4; ++j) { + decompressed[j * 4] = ((alpha[i] >> (4 * j)) & 0x0F) * 17; + } + + decompressed += destinationPitch; + } +} + +static void bcdec__smooth_alpha_block(const void* compressedBlock, void* decompressedBlock, int destinationPitch, int pixelSize) { + unsigned char* decompressed; + unsigned char alpha[8]; + int i, j; + unsigned long long block, indices; + + block = *(unsigned long long*)compressedBlock; + decompressed = (unsigned char*)decompressedBlock; + + alpha[0] = block & 0xFF; + alpha[1] = (block >> 8) & 0xFF; + + if (alpha[0] > alpha[1]) { + /* 6 interpolated alpha values. */ + alpha[2] = (6 * alpha[0] + alpha[1] + 1) / 7; /* 6/7*alpha_0 + 1/7*alpha_1 */ + alpha[3] = (5 * alpha[0] + 2 * alpha[1] + 1) / 7; /* 5/7*alpha_0 + 2/7*alpha_1 */ + alpha[4] = (4 * alpha[0] + 3 * alpha[1] + 1) / 7; /* 4/7*alpha_0 + 3/7*alpha_1 */ + alpha[5] = (3 * alpha[0] + 4 * alpha[1] + 1) / 7; /* 3/7*alpha_0 + 4/7*alpha_1 */ + alpha[6] = (2 * alpha[0] + 5 * alpha[1] + 1) / 7; /* 2/7*alpha_0 + 5/7*alpha_1 */ + alpha[7] = ( alpha[0] + 6 * alpha[1] + 1) / 7; /* 1/7*alpha_0 + 6/7*alpha_1 */ + } + else { + /* 4 interpolated alpha values. */ + alpha[2] = (4 * alpha[0] + alpha[1] + 1) / 5; /* 4/5*alpha_0 + 1/5*alpha_1 */ + alpha[3] = (3 * alpha[0] + 2 * alpha[1] + 1) / 5; /* 3/5*alpha_0 + 2/5*alpha_1 */ + alpha[4] = (2 * alpha[0] + 3 * alpha[1] + 1) / 5; /* 2/5*alpha_0 + 3/5*alpha_1 */ + alpha[5] = ( alpha[0] + 4 * alpha[1] + 1) / 5; /* 1/5*alpha_0 + 4/5*alpha_1 */ + alpha[6] = 0x00; + alpha[7] = 0xFF; + } + + indices = block >> 16; + for (i = 0; i < 4; ++i) { + for (j = 0; j < 4; ++j) { + decompressed[j * pixelSize] = alpha[indices & 0x07]; + indices >>= 3; + } + + decompressed += destinationPitch; + } +} + +typedef struct bcdec__bitstream { + unsigned long long low; + unsigned long long high; +} bcdec__bitstream_t; + +static int bcdec__bitstream_read_bits(bcdec__bitstream_t* bstream, int numBits) { + unsigned int mask = (1 << numBits) - 1; + /* Read the low N bits */ + unsigned int bits = (bstream->low & mask); + + bstream->low >>= numBits; + /* Put the low N bits of "high" into the high 64-N bits of "low". */ + bstream->low |= (bstream->high & mask) << (sizeof(bstream->high) * 8 - numBits); + bstream->high >>= numBits; + + return bits; +} + +static int bcdec__bitstream_read_bit(bcdec__bitstream_t* bstream) { + return bcdec__bitstream_read_bits(bstream, 1); +} + +/* reversed bits pulling, used in BC6H decoding + why ?? just why ??? */ +static int bcdec__bitstream_read_bits_r(bcdec__bitstream_t* bstream, int numBits) { + int bits = bcdec__bitstream_read_bits(bstream, numBits); + /* Reverse the bits. */ + int result = 0; + while (numBits--) { + result <<= 1; + result |= (bits & 1); + bits >>= 1; + } + return result; +} + + + +BCDECDEF void bcdec_bc1(const void* compressedBlock, void* decompressedBlock, int destinationPitch) { + bcdec__color_block(compressedBlock, decompressedBlock, destinationPitch, 0); +} + +BCDECDEF void bcdec_bc2(const void* compressedBlock, void* decompressedBlock, int destinationPitch) { + bcdec__color_block(((char*)compressedBlock) + 8, decompressedBlock, destinationPitch, 1); + bcdec__sharp_alpha_block(compressedBlock, ((char*)decompressedBlock) + 3, destinationPitch); +} + +BCDECDEF void bcdec_bc3(const void* compressedBlock, void* decompressedBlock, int destinationPitch) { + bcdec__color_block(((char*)compressedBlock) + 8, decompressedBlock, destinationPitch, 1); + bcdec__smooth_alpha_block(compressedBlock, ((char*)decompressedBlock) + 3, destinationPitch, 4); +} + +BCDECDEF void bcdec_bc4(const void* compressedBlock, void* decompressedBlock, int destinationPitch) { + bcdec__smooth_alpha_block(compressedBlock, decompressedBlock, destinationPitch, 1); +} + +BCDECDEF void bcdec_bc5(const void* compressedBlock, void* decompressedBlock, int destinationPitch) { + bcdec__smooth_alpha_block(compressedBlock, decompressedBlock, destinationPitch, 2); + bcdec__smooth_alpha_block(((char*)compressedBlock) + 8, ((char*)decompressedBlock) + 1, destinationPitch, 2); +} + +/* http://graphics.stanford.edu/~seander/bithacks.html#VariableSignExtend */ +static int bcdec__extend_sign(int val, int bits) { + return (val << (32 - bits)) >> (32 - bits); +} + +static int bcdec__transform_inverse(int val, int a0, int bits, int isSigned) { + /* If the precision of A0 is "p" bits, then the transform algorithm is: + B0 = (B0 + A0) & ((1 << p) - 1) */ + val = (val + a0) & ((1 << bits) - 1); + if (isSigned) { + val = bcdec__extend_sign(val, bits); + } + return val; +} + +/* pretty much copy-paste from documentation */ +static int bcdec__unquantize(int val, int bits, int isSigned) { + int unq, s = 0; + + if (!isSigned) { + if (bits >= 15) { + unq = val; + } else if (!val) { + unq = 0; + } else if (val == ((1 << bits) - 1)) { + unq = 0xFFFF; + } else { + unq = ((val << 16) + 0x8000) >> bits; + } + } else { + if (bits >= 16) { + unq = val; + } else { + if (val < 0) { + s = 1; + val = -val; + } + + if (val == 0) { + unq = 0; + } else if (val >= ((1 << (bits - 1)) - 1)) { + unq = 0x7FFF; + } else { + unq = ((val << 15) + 0x4000) >> (bits - 1); + } + + if (s) { + unq = -unq; + } + } + } + return unq; +} + +static int bcdec__interpolate(int a, int b, int* weights, int index) { + return (a * (64 - weights[index]) + b * weights[index] + 32) >> 6; +} + +static unsigned short bcdec__finish_unquantize(int val, int isSigned) { + int s; + + if (!isSigned) { + return (unsigned short)((val * 31) >> 6); /* scale the magnitude by 31 / 64 */ + } else { + val = (val < 0) ? -(((-val) * 31) >> 5) : (val * 31) >> 5; /* scale the magnitude by 31 / 32 */ + s = 0; + if (val < 0) { + s = 0x8000; + val = -val; + } + return (unsigned short)(s | val); + } +} + +/* modified half_to_float_fast4 from https://gist.github.com/rygorous/2144712 */ +static float bcdec__half_to_float_quick(unsigned short half) { + typedef union { + unsigned int u; + float f; + } FP32; + + static const FP32 magic = { 113 << 23 }; + static const unsigned int shifted_exp = 0x7c00 << 13; /* exponent mask after shift */ + FP32 o; + unsigned int exp; + + o.u = (half & 0x7fff) << 13; /* exponent/mantissa bits */ + exp = shifted_exp & o.u; /* just the exponent */ + o.u += (127 - 15) << 23; /* exponent adjust */ + + /* handle exponent special cases */ + if (exp == shifted_exp) { /* Inf/NaN? */ + o.u += (128 - 16) << 23; /* extra exp adjust */ + } else if (exp == 0) { /* Zero/Denormal? */ + o.u += 1 << 23; /* extra exp adjust */ + o.f -= magic.f; /* renormalize */ + } + + o.u |= (half & 0x8000) << 16; /* sign bit */ + return o.f; +} + +BCDECDEF void bcdec_bc6h_half(const void* compressedBlock, void* decompressedBlock, int destinationPitch, int isSigned) { + static char actual_bits_count[4][14] = { + { 10, 7, 11, 11, 11, 9, 8, 8, 8, 6, 10, 11, 12, 16 }, /* W */ + { 5, 6, 5, 4, 4, 5, 6, 5, 5, 6, 10, 9, 8, 4 }, /* dR */ + { 5, 6, 4, 5, 4, 5, 5, 6, 5, 6, 10, 9, 8, 4 }, /* dG */ + { 5, 6, 4, 4, 5, 5, 5, 5, 6, 6, 10, 9, 8, 4 } /* dB */ + }; + + /* There are 32 possible partition sets for a two-region tile. + Each 4x4 block represents a single shape. + Here also every fix-up index has MSB bit set. */ + static unsigned char partition_sets[32][4][4] = { + { {128, 0, 1, 1}, {0, 0, 1, 1}, { 0, 0, 1, 1}, {0, 0, 1, 129} }, /* 0 */ + { {128, 0, 0, 1}, {0, 0, 0, 1}, { 0, 0, 0, 1}, {0, 0, 0, 129} }, /* 1 */ + { {128, 1, 1, 1}, {0, 1, 1, 1}, { 0, 1, 1, 1}, {0, 1, 1, 129} }, /* 2 */ + { {128, 0, 0, 1}, {0, 0, 1, 1}, { 0, 0, 1, 1}, {0, 1, 1, 129} }, /* 3 */ + { {128, 0, 0, 0}, {0, 0, 0, 1}, { 0, 0, 0, 1}, {0, 0, 1, 129} }, /* 4 */ + { {128, 0, 1, 1}, {0, 1, 1, 1}, { 0, 1, 1, 1}, {1, 1, 1, 129} }, /* 5 */ + { {128, 0, 0, 1}, {0, 0, 1, 1}, { 0, 1, 1, 1}, {1, 1, 1, 129} }, /* 6 */ + { {128, 0, 0, 0}, {0, 0, 0, 1}, { 0, 0, 1, 1}, {0, 1, 1, 129} }, /* 7 */ + { {128, 0, 0, 0}, {0, 0, 0, 0}, { 0, 0, 0, 1}, {0, 0, 1, 129} }, /* 8 */ + { {128, 0, 1, 1}, {0, 1, 1, 1}, { 1, 1, 1, 1}, {1, 1, 1, 129} }, /* 9 */ + { {128, 0, 0, 0}, {0, 0, 0, 1}, { 0, 1, 1, 1}, {1, 1, 1, 129} }, /* 10 */ + { {128, 0, 0, 0}, {0, 0, 0, 0}, { 0, 0, 0, 1}, {0, 1, 1, 129} }, /* 11 */ + { {128, 0, 0, 1}, {0, 1, 1, 1}, { 1, 1, 1, 1}, {1, 1, 1, 129} }, /* 12 */ + { {128, 0, 0, 0}, {0, 0, 0, 0}, { 1, 1, 1, 1}, {1, 1, 1, 129} }, /* 13 */ + { {128, 0, 0, 0}, {1, 1, 1, 1}, { 1, 1, 1, 1}, {1, 1, 1, 129} }, /* 14 */ + { {128, 0, 0, 0}, {0, 0, 0, 0}, { 0, 0, 0, 0}, {1, 1, 1, 129} }, /* 15 */ + { {128, 0, 0, 0}, {1, 0, 0, 0}, { 1, 1, 1, 0}, {1, 1, 1, 129} }, /* 16 */ + { {128, 1, 129, 1}, {0, 0, 0, 1}, { 0, 0, 0, 0}, {0, 0, 0, 0} }, /* 17 */ + { {128, 0, 0, 0}, {0, 0, 0, 0}, {129, 0, 0, 0}, {1, 1, 1, 0} }, /* 18 */ + { {128, 1, 129, 1}, {0, 0, 1, 1}, { 0, 0, 0, 1}, {0, 0, 0, 0} }, /* 19 */ + { {128, 0, 129, 1}, {0, 0, 0, 1}, { 0, 0, 0, 0}, {0, 0, 0, 0} }, /* 20 */ + { {128, 0, 0, 0}, {1, 0, 0, 0}, {129, 1, 0, 0}, {1, 1, 1, 0} }, /* 21 */ + { {128, 0, 0, 0}, {0, 0, 0, 0}, {129, 0, 0, 0}, {1, 1, 0, 0} }, /* 22 */ + { {128, 1, 1, 1}, {0, 0, 1, 1}, { 0, 0, 1, 1}, {0, 0, 0, 129} }, /* 23 */ + { {128, 0, 129, 1}, {0, 0, 0, 1}, { 0, 0, 0, 1}, {0, 0, 0, 0} }, /* 24 */ + { {128, 0, 0, 0}, {1, 0, 0, 0}, {129, 0, 0, 0}, {1, 1, 0, 0} }, /* 25 */ + { {128, 1, 129, 0}, {0, 1, 1, 0}, { 0, 1, 1, 0}, {0, 1, 1, 0} }, /* 26 */ + { {128, 0, 129, 1}, {0, 1, 1, 0}, { 0, 1, 1, 0}, {1, 1, 0, 0} }, /* 27 */ + { {128, 0, 0, 1}, {0, 1, 1, 1}, {129, 1, 1, 0}, {1, 0, 0, 0} }, /* 28 */ + { {128, 0, 0, 0}, {1, 1, 1, 1}, {129, 1, 1, 1}, {0, 0, 0, 0} }, /* 29 */ + { {128, 1, 129, 1}, {0, 0, 0, 1}, { 1, 0, 0, 0}, {1, 1, 1, 0} }, /* 30 */ + { {128, 0, 129, 1}, {1, 0, 0, 1}, { 1, 0, 0, 1}, {1, 1, 0, 0} } /* 31 */ + }; + + static int aWeight3[8] = { 0, 9, 18, 27, 37, 46, 55, 64 }; + static int aWeight4[16] = { 0, 4, 9, 13, 17, 21, 26, 30, 34, 38, 43, 47, 51, 55, 60, 64 }; + + bcdec__bitstream_t bstream; + int mode, partition, numPartitions, i, j, partitionSet, indexBits, index, ep_i, actualBits0Mode; + int r[4], g[4], b[4]; /* wxyz */ + unsigned short* decompressed; + int* weights; + + decompressed = (unsigned short*)decompressedBlock; + + bstream.low = ((unsigned long long*)compressedBlock)[0]; + bstream.high = ((unsigned long long*)compressedBlock)[1]; + + r[0] = r[1] = r[2] = r[3] = 0; + g[0] = g[1] = g[2] = g[3] = 0; + b[0] = b[1] = b[2] = b[3] = 0; + + mode = bcdec__bitstream_read_bits(&bstream, 2); + if (mode > 1) { + mode |= (bcdec__bitstream_read_bits(&bstream, 3) << 2); + } + + /* modes >= 11 (10 in my code) are using 0 one, others will read it from the bitstream */ + partition = 0; + + switch (mode) { + /* mode 1 */ + case 0b00: { + /* Partitition indices: 46 bits + Partition: 5 bits + Color Endpoints: 75 bits (10.555, 10.555, 10.555) */ + g[2] |= bcdec__bitstream_read_bit(&bstream) << 4; /* gy[4] */ + b[2] |= bcdec__bitstream_read_bit(&bstream) << 4; /* by[4] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 4; /* bz[4] */ + r[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* rw[9:0] */ + g[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* gw[9:0] */ + b[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* bw[9:0] */ + r[1] |= bcdec__bitstream_read_bits(&bstream, 5); /* rx[4:0] */ + g[3] |= bcdec__bitstream_read_bit(&bstream) << 4; /* gz[4] */ + g[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* gy[3:0] */ + g[1] |= bcdec__bitstream_read_bits(&bstream, 5); /* gx[4:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream); /* bz[0] */ + g[3] |= bcdec__bitstream_read_bits(&bstream, 4); /* gz[3:0] */ + b[1] |= bcdec__bitstream_read_bits(&bstream, 5); /* bx[4:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 1; /* bz[1] */ + b[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* by[3:0] */ + r[2] |= bcdec__bitstream_read_bits(&bstream, 5); /* ry[4:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 2; /* bz[2] */ + r[3] |= bcdec__bitstream_read_bits(&bstream, 5); /* rz[4:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 3; /* bz[3] */ + partition = bcdec__bitstream_read_bits(&bstream, 5); /* d[4:0] */ + mode = 0; + } break; + + /* mode 2 */ + case 0b01: { + /* Partitition indices: 46 bits + Partition: 5 bits + Color Endpoints: 75 bits (7666, 7666, 7666) */ + g[2] |= bcdec__bitstream_read_bit(&bstream) << 5; /* gy[5] */ + g[3] |= bcdec__bitstream_read_bit(&bstream) << 4; /* gz[4] */ + g[3] |= bcdec__bitstream_read_bit(&bstream) << 5; /* gz[5] */ + r[0] |= bcdec__bitstream_read_bits(&bstream, 7); /* rw[6:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream); /* bz[0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 1; /* bz[1] */ + b[2] |= bcdec__bitstream_read_bit(&bstream) << 4; /* by[4] */ + g[0] |= bcdec__bitstream_read_bits(&bstream, 7); /* gw[6:0] */ + b[2] |= bcdec__bitstream_read_bit(&bstream) << 5; /* by[5] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 2; /* bz[2] */ + g[2] |= bcdec__bitstream_read_bit(&bstream) << 4; /* gy[4] */ + b[0] |= bcdec__bitstream_read_bits(&bstream, 7); /* bw[6:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 3; /* bz[3] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 5; /* bz[5] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 4; /* bz[4] */ + r[1] |= bcdec__bitstream_read_bits(&bstream, 6); /* rx[5:0] */ + g[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* gy[3:0] */ + g[1] |= bcdec__bitstream_read_bits(&bstream, 6); /* gx[5:0] */ + g[3] |= bcdec__bitstream_read_bits(&bstream, 4); /* gz[3:0] */ + b[1] |= bcdec__bitstream_read_bits(&bstream, 6); /* bx[5:0] */ + b[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* by[3:0] */ + r[2] |= bcdec__bitstream_read_bits(&bstream, 6); /* ry[5:0] */ + r[3] |= bcdec__bitstream_read_bits(&bstream, 6); /* rz[5:0] */ + partition = bcdec__bitstream_read_bits(&bstream, 5); /* d[4:0] */ + mode = 1; + } break; + + /* mode 3 */ + case 0b00010: { + /* Partitition indices: 46 bits + Partition: 5 bits + Color Endpoints: 72 bits (11.555, 11.444, 11.444) */ + r[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* rw[9:0] */ + g[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* gw[9:0] */ + b[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* bw[9:0] */ + r[1] |= bcdec__bitstream_read_bits(&bstream, 5); /* rx[4:0] */ + r[0] |= bcdec__bitstream_read_bit(&bstream) << 10; /* rw[10] */ + g[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* gy[3:0] */ + g[1] |= bcdec__bitstream_read_bits(&bstream, 4); /* gx[3:0] */ + g[0] |= bcdec__bitstream_read_bit(&bstream) << 10; /* gw[10] */ + b[3] |= bcdec__bitstream_read_bit(&bstream); /* bz[0] */ + g[3] |= bcdec__bitstream_read_bits(&bstream, 4); /* gz[3:0] */ + b[1] |= bcdec__bitstream_read_bits(&bstream, 4); /* bx[3:0] */ + b[0] |= bcdec__bitstream_read_bit(&bstream) << 10; /* bw[10] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 1; /* bz[1] */ + b[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* by[3:0] */ + r[2] |= bcdec__bitstream_read_bits(&bstream, 5); /* ry[4:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 2; /* bz[2] */ + r[3] |= bcdec__bitstream_read_bits(&bstream, 5); /* rz[4:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 3; /* bz[3] */ + partition = bcdec__bitstream_read_bits(&bstream, 5); /* d[4:0] */ + mode = 2; + } break; + + /* mode 4 */ + case 0b00110: { + /* Partitition indices: 46 bits + Partition: 5 bits + Color Endpoints: 72 bits (11.444, 11.555, 11.444) */ + r[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* rw[9:0] */ + g[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* gw[9:0] */ + b[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* bw[9:0] */ + r[1] |= bcdec__bitstream_read_bits(&bstream, 4); /* rx[3:0] */ + r[0] |= bcdec__bitstream_read_bit(&bstream) << 10; /* rw[10] */ + g[3] |= bcdec__bitstream_read_bit(&bstream) << 4; /* gz[4] */ + g[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* gy[3:0] */ + g[1] |= bcdec__bitstream_read_bits(&bstream, 5); /* gx[4:0] */ + g[0] |= bcdec__bitstream_read_bit(&bstream) << 10; /* gw[10] */ + g[3] |= bcdec__bitstream_read_bits(&bstream, 4); /* gz[3:0] */ + b[1] |= bcdec__bitstream_read_bits(&bstream, 4); /* bx[3:0] */ + b[0] |= bcdec__bitstream_read_bit(&bstream) << 10; /* bw[10] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 1; /* bz[1] */ + b[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* by[3:0] */ + r[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* ry[3:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream); /* bz[0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 2; /* bz[2] */ + r[3] |= bcdec__bitstream_read_bits(&bstream, 4); /* rz[3:0] */ + g[2] |= bcdec__bitstream_read_bit(&bstream) << 4; /* gy[4] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 3; /* bz[3] */ + partition = bcdec__bitstream_read_bits(&bstream, 5); /* d[4:0] */ + mode = 3; + } break; + + /* mode 5 */ + case 0b01010: { + /* Partitition indices: 46 bits + Partition: 5 bits + Color Endpoints: 72 bits (11.444, 11.444, 11.555) */ + r[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* rw[9:0] */ + g[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* gw[9:0] */ + b[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* bw[9:0] */ + r[1] |= bcdec__bitstream_read_bits(&bstream, 4); /* rx[3:0] */ + r[0] |= bcdec__bitstream_read_bit(&bstream) << 10; /* rw[10] */ + b[2] |= bcdec__bitstream_read_bit(&bstream) << 4; /* by[4] */ + g[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* gy[3:0] */ + g[1] |= bcdec__bitstream_read_bits(&bstream, 4); /* gx[3:0] */ + g[0] |= bcdec__bitstream_read_bit(&bstream) << 10; /* gw[10] */ + b[3] |= bcdec__bitstream_read_bit(&bstream); /* bz[0] */ + g[3] |= bcdec__bitstream_read_bits(&bstream, 4); /* gz[3:0] */ + b[1] |= bcdec__bitstream_read_bits(&bstream, 5); /* bx[4:0] */ + b[0] |= bcdec__bitstream_read_bit(&bstream) << 10; /* bw[10] */ + b[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* by[3:0] */ + r[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* ry[3:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 1; /* bz[1] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 2; /* bz[2] */ + r[3] |= bcdec__bitstream_read_bits(&bstream, 4); /* rz[3:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 4; /* bz[4] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 3; /* bz[3] */ + partition = bcdec__bitstream_read_bits(&bstream, 5); /* d[4:0] */ + mode = 4; + } break; + + /* mode 6 */ + case 0b01110: { + /* Partitition indices: 46 bits + Partition: 5 bits + Color Endpoints: 72 bits (9555, 9555, 9555) */ + r[0] |= bcdec__bitstream_read_bits(&bstream, 9); /* rw[8:0] */ + b[2] |= bcdec__bitstream_read_bit(&bstream) << 4; /* by[4] */ + g[0] |= bcdec__bitstream_read_bits(&bstream, 9); /* gw[8:0] */ + g[2] |= bcdec__bitstream_read_bit(&bstream) << 4; /* gy[4] */ + b[0] |= bcdec__bitstream_read_bits(&bstream, 9); /* bw[8:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 4; /* bz[4] */ + r[1] |= bcdec__bitstream_read_bits(&bstream, 5); /* rx[4:0] */ + g[3] |= bcdec__bitstream_read_bit(&bstream) << 4; /* gz[4] */ + g[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* gy[3:0] */ + g[1] |= bcdec__bitstream_read_bits(&bstream, 5); /* gx[4:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream); /* bz[0] */ + g[3] |= bcdec__bitstream_read_bits(&bstream, 4); /* gx[3:0] */ + b[1] |= bcdec__bitstream_read_bits(&bstream, 5); /* bx[4:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 1; /* bz[1] */ + b[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* by[3:0] */ + r[2] |= bcdec__bitstream_read_bits(&bstream, 5); /* ry[4:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 2; /* bz[2] */ + r[3] |= bcdec__bitstream_read_bits(&bstream, 5); /* rz[4:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 3; /* bz[3] */ + partition = bcdec__bitstream_read_bits(&bstream, 5); /* d[4:0] */ + mode = 5; + } break; + + /* mode 7 */ + case 0b10010: { + /* Partitition indices: 46 bits + Partition: 5 bits + Color Endpoints: 72 bits (8666, 8555, 8555) */ + r[0] |= bcdec__bitstream_read_bits(&bstream, 8); /* rw[7:0] */ + g[3] |= bcdec__bitstream_read_bit(&bstream) << 4; /* gz[4] */ + b[2] |= bcdec__bitstream_read_bit(&bstream) << 4; /* by[4] */ + g[0] |= bcdec__bitstream_read_bits(&bstream, 8); /* gw[7:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 2; /* bz[2] */ + g[2] |= bcdec__bitstream_read_bit(&bstream) << 4; /* gy[4] */ + b[0] |= bcdec__bitstream_read_bits(&bstream, 8); /* bw[7:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 3; /* bz[3] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 4; /* bz[4] */ + r[1] |= bcdec__bitstream_read_bits(&bstream, 6); /* rx[5:0] */ + g[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* gy[3:0] */ + g[1] |= bcdec__bitstream_read_bits(&bstream, 5); /* gx[4:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream); /* bz[0] */ + g[3] |= bcdec__bitstream_read_bits(&bstream, 4); /* gz[3:0] */ + b[1] |= bcdec__bitstream_read_bits(&bstream, 5); /* bx[4:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 1; /* bz[1] */ + b[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* by[3:0] */ + r[2] |= bcdec__bitstream_read_bits(&bstream, 6); /* ry[5:0] */ + r[3] |= bcdec__bitstream_read_bits(&bstream, 6); /* rz[5:0] */ + partition = bcdec__bitstream_read_bits(&bstream, 5); /* d[4:0] */ + mode = 6; + } break; + + /* mode 8 */ + case 0b10110: { + /* Partitition indices: 46 bits + Partition: 5 bits + Color Endpoints: 72 bits (8555, 8666, 8555) */ + r[0] |= bcdec__bitstream_read_bits(&bstream, 8); /* rw[7:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream); /* bz[0] */ + b[2] |= bcdec__bitstream_read_bit(&bstream) << 4; /* by[4] */ + g[0] |= bcdec__bitstream_read_bits(&bstream, 8); /* gw[7:0] */ + g[2] |= bcdec__bitstream_read_bit(&bstream) << 5; /* gy[5] */ + g[2] |= bcdec__bitstream_read_bit(&bstream) << 4; /* gy[4] */ + b[0] |= bcdec__bitstream_read_bits(&bstream, 8); /* bw[7:0] */ + g[3] |= bcdec__bitstream_read_bit(&bstream) << 5; /* gz[5] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 4; /* bz[4] */ + r[1] |= bcdec__bitstream_read_bits(&bstream, 5); /* rx[4:0] */ + g[3] |= bcdec__bitstream_read_bit(&bstream) << 4; /* gz[4] */ + g[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* gy[3:0] */ + g[1] |= bcdec__bitstream_read_bits(&bstream, 6); /* gx[5:0] */ + g[3] |= bcdec__bitstream_read_bits(&bstream, 4); /* zx[3:0] */ + b[1] |= bcdec__bitstream_read_bits(&bstream, 5); /* bx[4:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 1; /* bz[1] */ + b[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* by[3:0] */ + r[2] |= bcdec__bitstream_read_bits(&bstream, 5); /* ry[4:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 2; /* bz[2] */ + r[3] |= bcdec__bitstream_read_bits(&bstream, 5); /* rz[4:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 3; /* bz[3] */ + partition = bcdec__bitstream_read_bits(&bstream, 5); /* d[4:0] */ + mode = 7; + } break; + + /* mode 9 */ + case 0b11010: { + /* Partitition indices: 46 bits + Partition: 5 bits + Color Endpoints: 72 bits (8555, 8555, 8666) */ + r[0] |= bcdec__bitstream_read_bits(&bstream, 8); /* rw[7:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 1; /* bz[1] */ + b[2] |= bcdec__bitstream_read_bit(&bstream) << 4; /* by[4] */ + g[0] |= bcdec__bitstream_read_bits(&bstream, 8); /* gw[7:0] */ + b[2] |= bcdec__bitstream_read_bit(&bstream) << 5; /* by[5] */ + g[2] |= bcdec__bitstream_read_bit(&bstream) << 4; /* gy[4] */ + b[0] |= bcdec__bitstream_read_bits(&bstream, 8); /* bw[7:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 5; /* bz[5] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 4; /* bz[4] */ + r[1] |= bcdec__bitstream_read_bits(&bstream, 5); /* bw[4:0] */ + g[3] |= bcdec__bitstream_read_bit(&bstream) << 4; /* gz[4] */ + g[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* gy[3:0] */ + g[1] |= bcdec__bitstream_read_bits(&bstream, 5); /* gx[4:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream); /* bz[0] */ + g[3] |= bcdec__bitstream_read_bits(&bstream, 4); /* gz[3:0] */ + b[1] |= bcdec__bitstream_read_bits(&bstream, 6); /* bx[5:0] */ + b[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* by[3:0] */ + r[2] |= bcdec__bitstream_read_bits(&bstream, 5); /* ry[4:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 2; /* bz[2] */ + r[3] |= bcdec__bitstream_read_bits(&bstream, 5); /* rz[4:0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 3; /* bz[3] */ + partition = bcdec__bitstream_read_bits(&bstream, 5); /* d[4:0] */ + mode = 8; + } break; + + /* mode 10 */ + case 0b11110: { + /* Partitition indices: 46 bits + Partition: 5 bits + Color Endpoints: 72 bits (6666, 6666, 6666) */ + r[0] |= bcdec__bitstream_read_bits(&bstream, 6); /* rw[5:0] */ + g[3] |= bcdec__bitstream_read_bit(&bstream) << 4; /* gz[4] */ + b[3] |= bcdec__bitstream_read_bit(&bstream); /* bz[0] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 1; /* bz[1] */ + b[2] |= bcdec__bitstream_read_bit(&bstream) << 4; /* by[4] */ + g[0] |= bcdec__bitstream_read_bits(&bstream, 6); /* gw[5:0] */ + g[2] |= bcdec__bitstream_read_bit(&bstream) << 5; /* gy[5] */ + b[2] |= bcdec__bitstream_read_bit(&bstream) << 5; /* by[5] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 2; /* bz[2] */ + g[2] |= bcdec__bitstream_read_bit(&bstream) << 4; /* gy[4] */ + b[0] |= bcdec__bitstream_read_bits(&bstream, 6); /* bw[5:0] */ + g[3] |= bcdec__bitstream_read_bit(&bstream) << 5; /* gz[5] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 3; /* bz[3] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 5; /* bz[5] */ + b[3] |= bcdec__bitstream_read_bit(&bstream) << 4; /* bz[4] */ + r[1] |= bcdec__bitstream_read_bits(&bstream, 6); /* rx[5:0] */ + g[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* gy[3:0] */ + g[1] |= bcdec__bitstream_read_bits(&bstream, 6); /* gx[5:0] */ + g[3] |= bcdec__bitstream_read_bits(&bstream, 4); /* gz[3:0] */ + b[1] |= bcdec__bitstream_read_bits(&bstream, 6); /* bx[5:0] */ + b[2] |= bcdec__bitstream_read_bits(&bstream, 4); /* by[3:0] */ + r[2] |= bcdec__bitstream_read_bits(&bstream, 6); /* ry[5:0] */ + r[3] |= bcdec__bitstream_read_bits(&bstream, 6); /* rz[5:0] */ + partition = bcdec__bitstream_read_bits(&bstream, 5); /* d[4:0] */ + mode = 9; + } break; + + /* mode 11 */ + case 0b00011: { + /* Partitition indices: 63 bits + Partition: 0 bits + Color Endpoints: 60 bits (10.10, 10.10, 10.10) */ + r[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* rw[9:0] */ + g[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* gw[9:0] */ + b[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* bw[9:0] */ + r[1] |= bcdec__bitstream_read_bits(&bstream, 10); /* rx[9:0] */ + g[1] |= bcdec__bitstream_read_bits(&bstream, 10); /* gx[9:0] */ + b[1] |= bcdec__bitstream_read_bits(&bstream, 10); /* bx[9:0] */ + mode = 10; + } break; + + /* mode 12 */ + case 0b00111: { + /* Partitition indices: 63 bits + Partition: 0 bits + Color Endpoints: 60 bits (11.9, 11.9, 11.9) */ + r[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* rw[9:0] */ + g[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* gw[9:0] */ + b[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* bw[9:0] */ + r[1] |= bcdec__bitstream_read_bits(&bstream, 9); /* rx[8:0] */ + r[0] |= bcdec__bitstream_read_bit(&bstream) << 10; /* rw[10] */ + g[1] |= bcdec__bitstream_read_bits(&bstream, 9); /* gx[8:0] */ + g[0] |= bcdec__bitstream_read_bit(&bstream) << 10; /* gw[10] */ + b[1] |= bcdec__bitstream_read_bits(&bstream, 9); /* bx[8:0] */ + b[0] |= bcdec__bitstream_read_bit(&bstream) << 10; /* bw[10] */ + mode = 11; + } break; + + /* mode 13 */ + case 0b01011: { + /* Partitition indices: 63 bits + Partition: 0 bits + Color Endpoints: 60 bits (12.8, 12.8, 12.8) */ + r[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* rw[9:0] */ + g[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* gw[9:0] */ + b[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* bw[9:0] */ + r[1] |= bcdec__bitstream_read_bits(&bstream, 8); /* rx[7:0] */ + r[0] |= bcdec__bitstream_read_bits_r(&bstream, 2) << 10;/* rx[10:11] */ + g[1] |= bcdec__bitstream_read_bits(&bstream, 8); /* gx[7:0] */ + g[0] |= bcdec__bitstream_read_bits_r(&bstream, 2) << 10;/* gx[10:11] */ + b[1] |= bcdec__bitstream_read_bits(&bstream, 8); /* bx[7:0] */ + b[0] |= bcdec__bitstream_read_bits_r(&bstream, 2) << 10;/* bx[10:11] */ + mode = 12; + } break; + + /* mode 14 */ + case 0b01111: { + /* Partitition indices: 63 bits + Partition: 0 bits + Color Endpoints: 60 bits (16.4, 16.4, 16.4) */ + r[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* rw[9:0] */ + g[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* gw[9:0] */ + b[0] |= bcdec__bitstream_read_bits(&bstream, 10); /* bw[9:0] */ + r[1] |= bcdec__bitstream_read_bits(&bstream, 4); /* rx[3:0] */ + r[0] |= bcdec__bitstream_read_bits_r(&bstream, 6) << 10;/* rw[10:15] */ + g[1] |= bcdec__bitstream_read_bits(&bstream, 4); /* gx[3:0] */ + g[0] |= bcdec__bitstream_read_bits_r(&bstream, 6) << 10;/* gw[10:15] */ + b[1] |= bcdec__bitstream_read_bits(&bstream, 4); /* bx[3:0] */ + b[0] |= bcdec__bitstream_read_bits_r(&bstream, 6) << 10;/* bw[10:15] */ + mode = 13; + } break; + + default: { + /* Modes 10011, 10111, 11011, and 11111 (not shown) are reserved. + Do not use these in your encoder. If the hardware is passed blocks + with one of these modes specified, the resulting decompressed block + must contain all zeroes in all channels except for the alpha channel. */ + for (i = 0; i < 4; ++i) { + for (j = 0; j < 4; ++j) { + decompressed[j * 3 + 0] = 0; + decompressed[j * 3 + 1] = 0; + decompressed[j * 3 + 2] = 0; + } + decompressed += destinationPitch; + } + + return; + } + } + + numPartitions = (mode >= 10) ? 0 : 1; + + actualBits0Mode = actual_bits_count[0][mode]; + if (isSigned) { + r[0] = bcdec__extend_sign(r[0], actualBits0Mode); + g[0] = bcdec__extend_sign(g[0], actualBits0Mode); + b[0] = bcdec__extend_sign(b[0], actualBits0Mode); + } + + /* Mode 11 (like Mode 10) does not use delta compression, + and instead stores both color endpoints explicitly. */ + if ((mode != 9 && mode != 10) || isSigned) { + for (i = 1; i < (numPartitions + 1) * 2; ++i) { + r[i] = bcdec__extend_sign(r[i], actual_bits_count[1][mode]); + g[i] = bcdec__extend_sign(g[i], actual_bits_count[2][mode]); + b[i] = bcdec__extend_sign(b[i], actual_bits_count[3][mode]); + } + } + + if (mode != 9 && mode != 10) { + for (i = 1; i < (numPartitions + 1) * 2; ++i) { + r[i] = bcdec__transform_inverse(r[i], r[0], actualBits0Mode, isSigned); + g[i] = bcdec__transform_inverse(g[i], g[0], actualBits0Mode, isSigned); + b[i] = bcdec__transform_inverse(b[i], b[0], actualBits0Mode, isSigned); + } + } + + for (i = 0; i < (numPartitions + 1) * 2; ++i) { + r[i] = bcdec__unquantize(r[i], actualBits0Mode, isSigned); + g[i] = bcdec__unquantize(g[i], actualBits0Mode, isSigned); + b[i] = bcdec__unquantize(b[i], actualBits0Mode, isSigned); + } + + weights = (mode >= 10) ? aWeight4 : aWeight3; + for (i = 0; i < 4; ++i) { + for (j = 0; j < 4; ++j) { + partitionSet = (mode >= 10) ? ((i|j) ? 0 : 128) : partition_sets[partition][i][j]; + + indexBits = (mode >= 10) ? 4 : 3; + /* fix-up index is specified with one less bit */ + /* The fix-up index for subset 0 is always index 0 */ + if (partitionSet & 0x80) { + indexBits--; + } + partitionSet &= 0x01; + + index = bcdec__bitstream_read_bits(&bstream, indexBits); + + ep_i = partitionSet * 2; + decompressed[j * 3 + 0] = bcdec__finish_unquantize( + bcdec__interpolate(r[ep_i], r[ep_i+1], weights, index), isSigned); + decompressed[j * 3 + 1] = bcdec__finish_unquantize( + bcdec__interpolate(g[ep_i], g[ep_i+1], weights, index), isSigned); + decompressed[j * 3 + 2] = bcdec__finish_unquantize( + bcdec__interpolate(b[ep_i], b[ep_i+1], weights, index), isSigned); + } + + decompressed += destinationPitch; + } +} + +BCDECDEF void bcdec_bc6h_float(const void* compressedBlock, void* decompressedBlock, int destinationPitch, int isSigned) { + unsigned short block[16*3]; + float* decompressed; + const unsigned short* b; + int i, j; + + bcdec_bc6h_half(compressedBlock, block, 4*3, isSigned); + b = block; + decompressed = (float*)decompressedBlock; + for (i = 0; i < 4; ++i) { + for (j = 0; j < 4; ++j) { + decompressed[j * 3 + 0] = bcdec__half_to_float_quick(*b++); + decompressed[j * 3 + 1] = bcdec__half_to_float_quick(*b++); + decompressed[j * 3 + 2] = bcdec__half_to_float_quick(*b++); + } + decompressed += destinationPitch; + } +} + +static void bcdec__swap_values(int* a, int* b) { + a[0] ^= b[0], b[0] ^= a[0], a[0] ^= b[0]; +} + +BCDECDEF void bcdec_bc7(const void* compressedBlock, void* decompressedBlock, int destinationPitch) { + static char actual_bits_count[2][8] = { + { 4, 6, 5, 7, 5, 7, 7, 5 }, /* RGBA */ + { 0, 0, 0, 0, 6, 8, 7, 5 }, /* Alpha */ + }; + + /* There are 64 possible partition sets for a two-region tile. + Each 4x4 block represents a single shape. + Here also every fix-up index has MSB bit set. */ + static unsigned char partition_sets[2][64][4][4] = { + { /* Partition table for 2-subset BPTC */ + { {128, 0, 1, 1}, {0, 0, 1, 1}, { 0, 0, 1, 1}, {0, 0, 1, 129} }, /* 0 */ + { {128, 0, 0, 1}, {0, 0, 0, 1}, { 0, 0, 0, 1}, {0, 0, 0, 129} }, /* 1 */ + { {128, 1, 1, 1}, {0, 1, 1, 1}, { 0, 1, 1, 1}, {0, 1, 1, 129} }, /* 2 */ + { {128, 0, 0, 1}, {0, 0, 1, 1}, { 0, 0, 1, 1}, {0, 1, 1, 129} }, /* 3 */ + { {128, 0, 0, 0}, {0, 0, 0, 1}, { 0, 0, 0, 1}, {0, 0, 1, 129} }, /* 4 */ + { {128, 0, 1, 1}, {0, 1, 1, 1}, { 0, 1, 1, 1}, {1, 1, 1, 129} }, /* 5 */ + { {128, 0, 0, 1}, {0, 0, 1, 1}, { 0, 1, 1, 1}, {1, 1, 1, 129} }, /* 6 */ + { {128, 0, 0, 0}, {0, 0, 0, 1}, { 0, 0, 1, 1}, {0, 1, 1, 129} }, /* 7 */ + { {128, 0, 0, 0}, {0, 0, 0, 0}, { 0, 0, 0, 1}, {0, 0, 1, 129} }, /* 8 */ + { {128, 0, 1, 1}, {0, 1, 1, 1}, { 1, 1, 1, 1}, {1, 1, 1, 129} }, /* 9 */ + { {128, 0, 0, 0}, {0, 0, 0, 1}, { 0, 1, 1, 1}, {1, 1, 1, 129} }, /* 10 */ + { {128, 0, 0, 0}, {0, 0, 0, 0}, { 0, 0, 0, 1}, {0, 1, 1, 129} }, /* 11 */ + { {128, 0, 0, 1}, {0, 1, 1, 1}, { 1, 1, 1, 1}, {1, 1, 1, 129} }, /* 12 */ + { {128, 0, 0, 0}, {0, 0, 0, 0}, { 1, 1, 1, 1}, {1, 1, 1, 129} }, /* 13 */ + { {128, 0, 0, 0}, {1, 1, 1, 1}, { 1, 1, 1, 1}, {1, 1, 1, 129} }, /* 14 */ + { {128, 0, 0, 0}, {0, 0, 0, 0}, { 0, 0, 0, 0}, {1, 1, 1, 129} }, /* 15 */ + { {128, 0, 0, 0}, {1, 0, 0, 0}, { 1, 1, 1, 0}, {1, 1, 1, 129} }, /* 16 */ + { {128, 1, 129, 1}, {0, 0, 0, 1}, { 0, 0, 0, 0}, {0, 0, 0, 0} }, /* 17 */ + { {128, 0, 0, 0}, {0, 0, 0, 0}, {129, 0, 0, 0}, {1, 1, 1, 0} }, /* 18 */ + { {128, 1, 129, 1}, {0, 0, 1, 1}, { 0, 0, 0, 1}, {0, 0, 0, 0} }, /* 19 */ + { {128, 0, 129, 1}, {0, 0, 0, 1}, { 0, 0, 0, 0}, {0, 0, 0, 0} }, /* 20 */ + { {128, 0, 0, 0}, {1, 0, 0, 0}, {129, 1, 0, 0}, {1, 1, 1, 0} }, /* 21 */ + { {128, 0, 0, 0}, {0, 0, 0, 0}, {129, 0, 0, 0}, {1, 1, 0, 0} }, /* 22 */ + { {128, 1, 1, 1}, {0, 0, 1, 1}, { 0, 0, 1, 1}, {0, 0, 0, 129} }, /* 23 */ + { {128, 0, 129, 1}, {0, 0, 0, 1}, { 0, 0, 0, 1}, {0, 0, 0, 0} }, /* 24 */ + { {128, 0, 0, 0}, {1, 0, 0, 0}, {129, 0, 0, 0}, {1, 1, 0, 0} }, /* 25 */ + { {128, 1, 129, 0}, {0, 1, 1, 0}, { 0, 1, 1, 0}, {0, 1, 1, 0} }, /* 26 */ + { {128, 0, 129, 1}, {0, 1, 1, 0}, { 0, 1, 1, 0}, {1, 1, 0, 0} }, /* 27 */ + { {128, 0, 0, 1}, {0, 1, 1, 1}, {129, 1, 1, 0}, {1, 0, 0, 0} }, /* 28 */ + { {128, 0, 0, 0}, {1, 1, 1, 1}, {129, 1, 1, 1}, {0, 0, 0, 0} }, /* 29 */ + { {128, 1, 129, 1}, {0, 0, 0, 1}, { 1, 0, 0, 0}, {1, 1, 1, 0} }, /* 30 */ + { {128, 0, 129, 1}, {1, 0, 0, 1}, { 1, 0, 0, 1}, {1, 1, 0, 0} }, /* 31 */ + { {128, 1, 0, 1}, {0, 1, 0, 1}, { 0, 1, 0, 1}, {0, 1, 0, 129} }, /* 32 */ + { {128, 0, 0, 0}, {1, 1, 1, 1}, { 0, 0, 0, 0}, {1, 1, 1, 129} }, /* 33 */ + { {128, 1, 0, 1}, {1, 0, 129, 0}, { 0, 1, 0, 1}, {1, 0, 1, 0} }, /* 34 */ + { {128, 0, 1, 1}, {0, 0, 1, 1}, {129, 1, 0, 0}, {1, 1, 0, 0} }, /* 35 */ + { {128, 0, 129, 1}, {1, 1, 0, 0}, { 0, 0, 1, 1}, {1, 1, 0, 0} }, /* 36 */ + { {128, 1, 0, 1}, {0, 1, 0, 1}, {129, 0, 1, 0}, {1, 0, 1, 0} }, /* 37 */ + { {128, 1, 1, 0}, {1, 0, 0, 1}, { 0, 1, 1, 0}, {1, 0, 0, 129} }, /* 38 */ + { {128, 1, 0, 1}, {1, 0, 1, 0}, { 1, 0, 1, 0}, {0, 1, 0, 129} }, /* 39 */ + { {128, 1, 129, 1}, {0, 0, 1, 1}, { 1, 1, 0, 0}, {1, 1, 1, 0} }, /* 40 */ + { {128, 0, 0, 1}, {0, 0, 1, 1}, {129, 1, 0, 0}, {1, 0, 0, 0} }, /* 41 */ + { {128, 0, 129, 1}, {0, 0, 1, 0}, { 0, 1, 0, 0}, {1, 1, 0, 0} }, /* 42 */ + { {128, 0, 129, 1}, {1, 0, 1, 1}, { 1, 1, 0, 1}, {1, 1, 0, 0} }, /* 43 */ + { {128, 1, 129, 0}, {1, 0, 0, 1}, { 1, 0, 0, 1}, {0, 1, 1, 0} }, /* 44 */ + { {128, 0, 1, 1}, {1, 1, 0, 0}, { 1, 1, 0, 0}, {0, 0, 1, 129} }, /* 45 */ + { {128, 1, 1, 0}, {0, 1, 1, 0}, { 1, 0, 0, 1}, {1, 0, 0, 129} }, /* 46 */ + { {128, 0, 0, 0}, {0, 1, 129, 0}, { 0, 1, 1, 0}, {0, 0, 0, 0} }, /* 47 */ + { {128, 1, 0, 0}, {1, 1, 129, 0}, { 0, 1, 0, 0}, {0, 0, 0, 0} }, /* 48 */ + { {128, 0, 129, 0}, {0, 1, 1, 1}, { 0, 0, 1, 0}, {0, 0, 0, 0} }, /* 49 */ + { {128, 0, 0, 0}, {0, 0, 129, 0}, { 0, 1, 1, 1}, {0, 0, 1, 0} }, /* 50 */ + { {128, 0, 0, 0}, {0, 1, 0, 0}, {129, 1, 1, 0}, {0, 1, 0, 0} }, /* 51 */ + { {128, 1, 1, 0}, {1, 1, 0, 0}, { 1, 0, 0, 1}, {0, 0, 1, 129} }, /* 52 */ + { {128, 0, 1, 1}, {0, 1, 1, 0}, { 1, 1, 0, 0}, {1, 0, 0, 129} }, /* 53 */ + { {128, 1, 129, 0}, {0, 0, 1, 1}, { 1, 0, 0, 1}, {1, 1, 0, 0} }, /* 54 */ + { {128, 0, 129, 1}, {1, 0, 0, 1}, { 1, 1, 0, 0}, {0, 1, 1, 0} }, /* 55 */ + { {128, 1, 1, 0}, {1, 1, 0, 0}, { 1, 1, 0, 0}, {1, 0, 0, 129} }, /* 56 */ + { {128, 1, 1, 0}, {0, 0, 1, 1}, { 0, 0, 1, 1}, {1, 0, 0, 129} }, /* 57 */ + { {128, 1, 1, 1}, {1, 1, 1, 0}, { 1, 0, 0, 0}, {0, 0, 0, 129} }, /* 58 */ + { {128, 0, 0, 1}, {1, 0, 0, 0}, { 1, 1, 1, 0}, {0, 1, 1, 129} }, /* 59 */ + { {128, 0, 0, 0}, {1, 1, 1, 1}, { 0, 0, 1, 1}, {0, 0, 1, 129} }, /* 60 */ + { {128, 0, 129, 1}, {0, 0, 1, 1}, { 1, 1, 1, 1}, {0, 0, 0, 0} }, /* 61 */ + { {128, 0, 129, 0}, {0, 0, 1, 0}, { 1, 1, 1, 0}, {1, 1, 1, 0} }, /* 62 */ + { {128, 1, 0, 0}, {0, 1, 0, 0}, { 0, 1, 1, 1}, {0, 1, 1, 129} } /* 63 */ + }, + { /* Partition table for 3-subset BPTC */ + { {128, 0, 1, 129}, {0, 0, 1, 1}, { 0, 2, 2, 1}, { 2, 2, 2, 130} }, /* 0 */ + { {128, 0, 0, 129}, {0, 0, 1, 1}, {130, 2, 1, 1}, { 2, 2, 2, 1} }, /* 1 */ + { {128, 0, 0, 0}, {2, 0, 0, 1}, {130, 2, 1, 1}, { 2, 2, 1, 129} }, /* 2 */ + { {128, 2, 2, 130}, {0, 0, 2, 2}, { 0, 0, 1, 1}, { 0, 1, 1, 129} }, /* 3 */ + { {128, 0, 0, 0}, {0, 0, 0, 0}, {129, 1, 2, 2}, { 1, 1, 2, 130} }, /* 4 */ + { {128, 0, 1, 129}, {0, 0, 1, 1}, { 0, 0, 2, 2}, { 0, 0, 2, 130} }, /* 5 */ + { {128, 0, 2, 130}, {0, 0, 2, 2}, { 1, 1, 1, 1}, { 1, 1, 1, 129} }, /* 6 */ + { {128, 0, 1, 1}, {0, 0, 1, 1}, {130, 2, 1, 1}, { 2, 2, 1, 129} }, /* 7 */ + { {128, 0, 0, 0}, {0, 0, 0, 0}, {129, 1, 1, 1}, { 2, 2, 2, 130} }, /* 8 */ + { {128, 0, 0, 0}, {1, 1, 1, 1}, {129, 1, 1, 1}, { 2, 2, 2, 130} }, /* 9 */ + { {128, 0, 0, 0}, {1, 1, 129, 1}, { 2, 2, 2, 2}, { 2, 2, 2, 130} }, /* 10 */ + { {128, 0, 1, 2}, {0, 0, 129, 2}, { 0, 0, 1, 2}, { 0, 0, 1, 130} }, /* 11 */ + { {128, 1, 1, 2}, {0, 1, 129, 2}, { 0, 1, 1, 2}, { 0, 1, 1, 130} }, /* 12 */ + { {128, 1, 2, 2}, {0, 129, 2, 2}, { 0, 1, 2, 2}, { 0, 1, 2, 130} }, /* 13 */ + { {128, 0, 1, 129}, {0, 1, 1, 2}, { 1, 1, 2, 2}, { 1, 2, 2, 130} }, /* 14 */ + { {128, 0, 1, 129}, {2, 0, 0, 1}, {130, 2, 0, 0}, { 2, 2, 2, 0} }, /* 15 */ + { {128, 0, 0, 129}, {0, 0, 1, 1}, { 0, 1, 1, 2}, { 1, 1, 2, 130} }, /* 16 */ + { {128, 1, 1, 129}, {0, 0, 1, 1}, {130, 0, 0, 1}, { 2, 2, 0, 0} }, /* 17 */ + { {128, 0, 0, 0}, {1, 1, 2, 2}, {129, 1, 2, 2}, { 1, 1, 2, 130} }, /* 18 */ + { {128, 0, 2, 130}, {0, 0, 2, 2}, { 0, 0, 2, 2}, { 1, 1, 1, 129} }, /* 19 */ + { {128, 1, 1, 129}, {0, 1, 1, 1}, { 0, 2, 2, 2}, { 0, 2, 2, 130} }, /* 20 */ + { {128, 0, 0, 129}, {0, 0, 0, 1}, {130, 2, 2, 1}, { 2, 2, 2, 1} }, /* 21 */ + { {128, 0, 0, 0}, {0, 0, 129, 1}, { 0, 1, 2, 2}, { 0, 1, 2, 130} }, /* 22 */ + { {128, 0, 0, 0}, {1, 1, 0, 0}, {130, 2, 129, 0}, { 2, 2, 1, 0} }, /* 23 */ + { {128, 1, 2, 130}, {0, 129, 2, 2}, { 0, 0, 1, 1}, { 0, 0, 0, 0} }, /* 24 */ + { {128, 0, 1, 2}, {0, 0, 1, 2}, {129, 1, 2, 2}, { 2, 2, 2, 130} }, /* 25 */ + { {128, 1, 1, 0}, {1, 2, 130, 1}, {129, 2, 2, 1}, { 0, 1, 1, 0} }, /* 26 */ + { {128, 0, 0, 0}, {0, 1, 129, 0}, { 1, 2, 130, 1}, { 1, 2, 2, 1} }, /* 27 */ + { {128, 0, 2, 2}, {1, 1, 0, 2}, {129, 1, 0, 2}, { 0, 0, 2, 130} }, /* 28 */ + { {128, 1, 1, 0}, {0, 129, 1, 0}, { 2, 0, 0, 2}, { 2, 2, 2, 130} }, /* 29 */ + { {128, 0, 1, 1}, {0, 1, 2, 2}, { 0, 1, 130, 2}, { 0, 0, 1, 129} }, /* 30 */ + { {128, 0, 0, 0}, {2, 0, 0, 0}, {130, 2, 1, 1}, { 2, 2, 2, 129} }, /* 31 */ + { {128, 0, 0, 0}, {0, 0, 0, 2}, {129, 1, 2, 2}, { 1, 2, 2, 130} }, /* 32 */ + { {128, 2, 2, 130}, {0, 0, 2, 2}, { 0, 0, 1, 2}, { 0, 0, 1, 129} }, /* 33 */ + { {128, 0, 1, 129}, {0, 0, 1, 2}, { 0, 0, 2, 2}, { 0, 2, 2, 130} }, /* 34 */ + { {128, 1, 2, 0}, {0, 129, 2, 0}, { 0, 1, 130, 0}, { 0, 1, 2, 0} }, /* 35 */ + { {128, 0, 0, 0}, {1, 1, 129, 1}, { 2, 2, 130, 2}, { 0, 0, 0, 0} }, /* 36 */ + { {128, 1, 2, 0}, {1, 2, 0, 1}, {130, 0, 129, 2}, { 0, 1, 2, 0} }, /* 37 */ + { {128, 1, 2, 0}, {2, 0, 1, 2}, {129, 130, 0, 1}, { 0, 1, 2, 0} }, /* 38 */ + { {128, 0, 1, 1}, {2, 2, 0, 0}, { 1, 1, 130, 2}, { 0, 0, 1, 129} }, /* 39 */ + { {128, 0, 1, 1}, {1, 1, 130, 2}, { 2, 2, 0, 0}, { 0, 0, 1, 129} }, /* 40 */ + { {128, 1, 0, 129}, {0, 1, 0, 1}, { 2, 2, 2, 2}, { 2, 2, 2, 130} }, /* 41 */ + { {128, 0, 0, 0}, {0, 0, 0, 0}, {130, 1, 2, 1}, { 2, 1, 2, 129} }, /* 42 */ + { {128, 0, 2, 2}, {1, 129, 2, 2}, { 0, 0, 2, 2}, { 1, 1, 2, 130} }, /* 43 */ + { {128, 0, 2, 130}, {0, 0, 1, 1}, { 0, 0, 2, 2}, { 0, 0, 1, 129} }, /* 44 */ + { {128, 2, 2, 0}, {1, 2, 130, 1}, { 0, 2, 2, 0}, { 1, 2, 2, 129} }, /* 45 */ + { {128, 1, 0, 1}, {2, 2, 130, 2}, { 2, 2, 2, 2}, { 0, 1, 0, 129} }, /* 46 */ + { {128, 0, 0, 0}, {2, 1, 2, 1}, {130, 1, 2, 1}, { 2, 1, 2, 129} }, /* 47 */ + { {128, 1, 0, 129}, {0, 1, 0, 1}, { 0, 1, 0, 1}, { 2, 2, 2, 130} }, /* 48 */ + { {128, 2, 2, 130}, {0, 1, 1, 1}, { 0, 2, 2, 2}, { 0, 1, 1, 129} }, /* 49 */ + { {128, 0, 0, 2}, {1, 129, 1, 2}, { 0, 0, 0, 2}, { 1, 1, 1, 130} }, /* 50 */ + { {128, 0, 0, 0}, {2, 129, 1, 2}, { 2, 1, 1, 2}, { 2, 1, 1, 130} }, /* 51 */ + { {128, 2, 2, 2}, {0, 129, 1, 1}, { 0, 1, 1, 1}, { 0, 2, 2, 130} }, /* 52 */ + { {128, 0, 0, 2}, {1, 1, 1, 2}, {129, 1, 1, 2}, { 0, 0, 0, 130} }, /* 53 */ + { {128, 1, 1, 0}, {0, 129, 1, 0}, { 0, 1, 1, 0}, { 2, 2, 2, 130} }, /* 54 */ + { {128, 0, 0, 0}, {0, 0, 0, 0}, { 2, 1, 129, 2}, { 2, 1, 1, 130} }, /* 55 */ + { {128, 1, 1, 0}, {0, 129, 1, 0}, { 2, 2, 2, 2}, { 2, 2, 2, 130} }, /* 56 */ + { {128, 0, 2, 2}, {0, 0, 1, 1}, { 0, 0, 129, 1}, { 0, 0, 2, 130} }, /* 57 */ + { {128, 0, 2, 2}, {1, 1, 2, 2}, {129, 1, 2, 2}, { 0, 0, 2, 130} }, /* 58 */ + { {128, 0, 0, 0}, {0, 0, 0, 0}, { 0, 0, 0, 0}, { 2, 129, 1, 130} }, /* 59 */ + { {128, 0, 0, 130}, {0, 0, 0, 1}, { 0, 0, 0, 2}, { 0, 0, 0, 129} }, /* 60 */ + { {128, 2, 2, 2}, {1, 2, 2, 2}, { 0, 2, 2, 2}, {129, 2, 2, 130} }, /* 61 */ + { {128, 1, 0, 129}, {2, 2, 2, 2}, { 2, 2, 2, 2}, { 2, 2, 2, 130} }, /* 62 */ + { {128, 1, 1, 129}, {2, 0, 1, 1}, {130, 2, 0, 1}, { 2, 2, 2, 0} } /* 63 */ + } + }; + + static int aWeight2[] = { 0, 21, 43, 64 }; + static int aWeight3[] = { 0, 9, 18, 27, 37, 46, 55, 64 }; + static int aWeight4[] = { 0, 4, 9, 13, 17, 21, 26, 30, 34, 38, 43, 47, 51, 55, 60, 64 }; + + static unsigned char sModeHasPBits = 0b11001011; + + bcdec__bitstream_t bstream; + int mode, partition, numPartitions, numEndpoints, i, j, k, rotation, partitionSet; + int indexSelectionBit, indexBits, indexBits2, index, index2; + int endpoints[6][4]; + char indices[4][4]; + int r, g, b, a; + int* weights, * weights2; + unsigned char* decompressed; + + decompressed = (unsigned char*)decompressedBlock; + + bstream.low = ((unsigned long long*)compressedBlock)[0]; + bstream.high = ((unsigned long long*)compressedBlock)[1]; + + for (mode = 0; mode < 8 && (0 == bcdec__bitstream_read_bit(&bstream)); ++mode); + + /* unexpected mode, clear the block (transparent black) */ + if (mode >= 8) { + for (i = 0; i < 4; ++i) { + for (j = 0; j < 4; ++j) { + decompressed[j * 4 + 0] = 0; + decompressed[j * 4 + 1] = 0; + decompressed[j * 4 + 2] = 0; + decompressed[j * 4 + 3] = 0; + } + decompressed += destinationPitch; + } + + return; + } + + partition = 0; + numPartitions = 1; + rotation = 0; + indexSelectionBit = 0; + + if (mode == 0 || mode == 1 || mode == 2 || mode == 3 || mode == 7) { + numPartitions = (mode == 0 || mode == 2) ? 3 : 2; + partition = bcdec__bitstream_read_bits(&bstream, (mode == 0) ? 4 : 6); + } + + numEndpoints = numPartitions * 2; + + if (mode == 4 || mode == 5) { + rotation = bcdec__bitstream_read_bits(&bstream, 2); + + if (mode == 4) { + indexSelectionBit = bcdec__bitstream_read_bit(&bstream); + } + } + + /* Extract endpoints */ + /* RGB */ + for (i = 0; i < 3; ++i) { + for (j = 0; j < numEndpoints; ++j) { + endpoints[j][i] = bcdec__bitstream_read_bits(&bstream, actual_bits_count[0][mode]); + } + } + /* Alpha (if any) */ + if (actual_bits_count[1][mode] > 0) { + for (j = 0; j < numEndpoints; ++j) { + endpoints[j][3] = bcdec__bitstream_read_bits(&bstream, actual_bits_count[1][mode]); + } + } + + /* Fully decode endpoints */ + /* First handle modes that have P-bits */ + if (mode == 0 || mode == 1 || mode == 3 || mode == 6 || mode == 7) { + for (i = 0; i < numEndpoints; ++i) { + /* component-wise left-shift */ + for (j = 0; j < 4; ++j) { + endpoints[i][j] <<= 1; + } + } + + /* if P-bit is shared */ + if (mode == 1) { + i = bcdec__bitstream_read_bit(&bstream); + j = bcdec__bitstream_read_bit(&bstream); + + /* rgb component-wise insert pbits */ + for (k = 0; k < 3; ++k) { + endpoints[0][k] |= i; + endpoints[1][k] |= i; + endpoints[2][k] |= j; + endpoints[3][k] |= j; + } + } else if (sModeHasPBits & (1 << mode)) { + /* unique P-bit per endpoint */ + for (i = 0; i < numEndpoints; ++i) { + j = bcdec__bitstream_read_bit(&bstream); + for (k = 0; k < 4; ++k) { + endpoints[i][k] |= j; + } + } + } + } + + for (i = 0; i < numEndpoints; ++i) { + /* get color components precision including pbit */ + j = actual_bits_count[0][mode] + ((sModeHasPBits >> mode) & 1); + + for (k = 0; k < 3; ++k) { + /* left shift endpoint components so that their MSB lies in bit 7 */ + endpoints[i][k] = endpoints[i][k] << (8 - j); + /* Replicate each component's MSB into the LSBs revealed by the left-shift operation above */ + endpoints[i][k] = endpoints[i][k] | (endpoints[i][k] >> j); + } + + /* get alpha component precision including pbit */ + j = actual_bits_count[1][mode] + ((sModeHasPBits >> mode) & 1); + + /* left shift endpoint components so that their MSB lies in bit 7 */ + endpoints[i][3] = endpoints[i][3] << (8 - j); + /* Replicate each component's MSB into the LSBs revealed by the left-shift operation above */ + endpoints[i][3] = endpoints[i][3] | (endpoints[i][3] >> j); + } + + /* If this mode does not explicitly define the alpha component */ + /* set alpha equal to 1.0 */ + if (!actual_bits_count[1][mode]) { + for (j = 0; j < numEndpoints; ++j) { + endpoints[j][3] = 0xFF; + } + } + + /* Determine weights tables */ + indexBits = (mode == 0 || mode == 1) ? 3 : ((mode == 6) ? 4 : 2); + indexBits2 = (mode == 4) ? 3 : ((mode == 5) ? 2 : 0); + weights = (indexBits == 2) ? aWeight2 : ((indexBits == 3) ? aWeight3 : aWeight4); + weights2 = (indexBits2 == 2) ? aWeight2 : aWeight3; + + /* Quite inconvenient that indices aren't interleaved so we have to make 2 passes here */ + /* Pass #1: collecting color indices */ + for (i = 0; i < 4; ++i) { + for (j = 0; j < 4; ++j) { + partitionSet = (numPartitions == 1) ? ((i | j) ? 0 : 128) : partition_sets[numPartitions - 2][partition][i][j]; + + indexBits = (mode == 0 || mode == 1) ? 3 : ((mode == 6) ? 4 : 2); + /* fix-up index is specified with one less bit */ + /* The fix-up index for subset 0 is always index 0 */ + if (partitionSet & 0x80) { + indexBits--; + } + + indices[i][j] = bcdec__bitstream_read_bits(&bstream, indexBits); + } + } + + /* Pass #2: reading alpha indices (if any) and interpolating & rotating */ + for (i = 0; i < 4; ++i) { + for (j = 0; j < 4; ++j) { + partitionSet = (numPartitions == 1) ? ((i|j) ? 0 : 128) : partition_sets[numPartitions - 2][partition][i][j]; + partitionSet &= 0x03; + + index = indices[i][j]; + + if (!indexBits2) { + r = bcdec__interpolate(endpoints[partitionSet * 2][0], endpoints[partitionSet * 2 + 1][0], weights, index); + g = bcdec__interpolate(endpoints[partitionSet * 2][1], endpoints[partitionSet * 2 + 1][1], weights, index); + b = bcdec__interpolate(endpoints[partitionSet * 2][2], endpoints[partitionSet * 2 + 1][2], weights, index); + a = bcdec__interpolate(endpoints[partitionSet * 2][3], endpoints[partitionSet * 2 + 1][3], weights, index); + } else { + index2 = bcdec__bitstream_read_bits(&bstream, (i|j) ? indexBits2 : (indexBits2 - 1)); + /* The index value for interpolating color comes from the secondary index bits for the texel + if the mode has an index selection bit and its value is one, and from the primary index bits otherwise. + The alpha index comes from the secondary index bits if the block has a secondary index and + the block either doesn’t have an index selection bit or that bit is zero, and from the primary index bits otherwise. */ + if (!indexSelectionBit) { + r = bcdec__interpolate(endpoints[partitionSet * 2][0], endpoints[partitionSet * 2 + 1][0], weights, index); + g = bcdec__interpolate(endpoints[partitionSet * 2][1], endpoints[partitionSet * 2 + 1][1], weights, index); + b = bcdec__interpolate(endpoints[partitionSet * 2][2], endpoints[partitionSet * 2 + 1][2], weights, index); + a = bcdec__interpolate(endpoints[partitionSet * 2][3], endpoints[partitionSet * 2 + 1][3], weights2, index2); + } else { + r = bcdec__interpolate(endpoints[partitionSet * 2][0], endpoints[partitionSet * 2 + 1][0], weights2, index2); + g = bcdec__interpolate(endpoints[partitionSet * 2][1], endpoints[partitionSet * 2 + 1][1], weights2, index2); + b = bcdec__interpolate(endpoints[partitionSet * 2][2], endpoints[partitionSet * 2 + 1][2], weights2, index2); + a = bcdec__interpolate(endpoints[partitionSet * 2][3], endpoints[partitionSet * 2 + 1][3], weights, index); + } + } + + switch (rotation) { + case 1: { /* 01 – Block format is Scalar(R) Vector(AGB) - swap A and R */ + bcdec__swap_values(&a, &r); + } break; + case 2: { /* 10 – Block format is Scalar(G) Vector(RAB) - swap A and G */ + bcdec__swap_values(&a, &g); + } break; + case 3: { /* 11 - Block format is Scalar(B) Vector(RGA) - swap A and B */ + bcdec__swap_values(&a, &b); + } break; + } + + decompressed[j * 4 + 0] = r; + decompressed[j * 4 + 1] = g; + decompressed[j * 4 + 2] = b; + decompressed[j * 4 + 3] = a; + } + + decompressed += destinationPitch; + } +} + +#endif /* BCDEC_IMPLEMENTATION */ + +/* LICENSE: + +This software is available under 2 licenses -- choose whichever you prefer. + +------------------------------------------------------------------------------ +ALTERNATIVE A - MIT License + +Copyright (c) 2022 Sergii Kudlai + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +------------------------------------------------------------------------------ +ALTERNATIVE B - The Unlicense + +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to + +*/ diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 00e4a42691cb..b6497f2036fc 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -25,6 +25,8 @@ #include "ole2.h" #include "wincodec.h" +#define BCDEC_IMPLEMENTATION +#include "bcdec.h" #include "txc_dxtn.h" #include @@ -2677,32 +2679,105 @@ static void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT s } } +struct d3dx_bcn_decompression_context +{ + void (*decompress_bcn_block)(const void *, void *, int); + const struct pixel_format_desc *compressed_format_desc; + struct d3dx_pixels *compressed_pixels; + + const struct pixel_format_desc *decompressed_format_desc; + uint8_t cur_block_decompressed[192]; + uint32_t cur_block_row_pitch; + int32_t cur_block_x; + int32_t cur_block_y; + int32_t cur_block_z; +}; + +static void d3dx_init_bcn_decompression_context(struct d3dx_bcn_decompression_context *context, + struct d3dx_pixels *pixels, const struct pixel_format_desc *desc, const struct pixel_format_desc *dst_desc) +{ + memset(context, 0, sizeof(*context)); + switch (desc->format) + { + case D3DX_PIXEL_FORMAT_DXT1_UNORM: + context->decompress_bcn_block = bcdec_bc1; + break; + + case D3DX_PIXEL_FORMAT_DXT2_UNORM: + case D3DX_PIXEL_FORMAT_DXT3_UNORM: + context->decompress_bcn_block = bcdec_bc2; + break; + + case D3DX_PIXEL_FORMAT_DXT4_UNORM: + case D3DX_PIXEL_FORMAT_DXT5_UNORM: + context->decompress_bcn_block = bcdec_bc3; + break; + + default: + assert(0); + break; + } + + context->compressed_format_desc = desc; + context->compressed_pixels = pixels; + + context->decompressed_format_desc = dst_desc; + context->cur_block_row_pitch = dst_desc->bytes_per_pixel * desc->block_width; + context->cur_block_x = context->cur_block_y = context->cur_block_z = -1; +} + +static void d3dx_fetch_bcn_texel(struct d3dx_bcn_decompression_context *context, int32_t x, int32_t y, int32_t z, void *texel) +{ + const struct pixel_format_desc *decomp_fmt_desc = context->decompressed_format_desc; + const struct pixel_format_desc *comp_fmt_desc = context->compressed_format_desc; + const int32_t y_aligned = (y & ~(comp_fmt_desc->block_height - 1)); + const int32_t x_aligned = (x & ~(comp_fmt_desc->block_width - 1)); + uint32_t pixel_offset; + + if (z != context->cur_block_z || (x_aligned != context->cur_block_x) || (y_aligned != context->cur_block_y)) + { + const BYTE *block_ptr = context->compressed_pixels->data; + + block_ptr += z * context->compressed_pixels->slice_pitch; + block_ptr += (y / comp_fmt_desc->block_height) * context->compressed_pixels->row_pitch; + block_ptr += (x / comp_fmt_desc->block_width) * comp_fmt_desc->block_byte_count; + context->decompress_bcn_block(block_ptr, context->cur_block_decompressed, context->cur_block_row_pitch); + context->cur_block_x = (x & (comp_fmt_desc->block_width)); + context->cur_block_y = (y & (comp_fmt_desc->block_height)); + context->cur_block_z = z; + } + + pixel_offset = (y & (comp_fmt_desc->block_height - 1)) * context->cur_block_row_pitch; + pixel_offset += (x & (comp_fmt_desc->block_width - 1)) * decomp_fmt_desc->bytes_per_pixel; + memcpy(texel, context->cur_block_decompressed + pixel_offset, decomp_fmt_desc->bytes_per_pixel); +} + static HRESULT d3dx_pixels_decompress(struct d3dx_pixels *pixels, const struct pixel_format_desc *desc, BOOL is_dst, void **out_memory, uint32_t *out_row_pitch, uint32_t *out_slice_pitch, const struct pixel_format_desc **out_desc) { - void (*fetch_dxt_texel)(int srcRowStride, const BYTE *pixdata, int i, int j, void *texel); - uint32_t x, y, z, tmp_pitch, uncompressed_slice_pitch, uncompressed_row_pitch; + uint32_t x, y, z, uncompressed_slice_pitch, uncompressed_row_pitch; const struct pixel_format_desc *uncompressed_desc = NULL; + struct d3dx_bcn_decompression_context context; const struct volume *size = &pixels->size; BYTE *uncompressed_mem; switch (desc->format) { case D3DX_PIXEL_FORMAT_DXT1_UNORM: - uncompressed_desc = get_format_info(D3DFMT_A8B8G8R8); - fetch_dxt_texel = fetch_2d_texel_rgba_dxt1; + uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); break; + case D3DX_PIXEL_FORMAT_DXT2_UNORM: case D3DX_PIXEL_FORMAT_DXT3_UNORM: - uncompressed_desc = get_format_info(D3DFMT_A8B8G8R8); - fetch_dxt_texel = fetch_2d_texel_rgba_dxt3; + uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); break; + case D3DX_PIXEL_FORMAT_DXT4_UNORM: case D3DX_PIXEL_FORMAT_DXT5_UNORM: - uncompressed_desc = get_format_info(D3DFMT_A8B8G8R8); - fetch_dxt_texel = fetch_2d_texel_rgba_dxt5; + uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); break; + default: FIXME("Unexpected compressed texture format %u.\n", desc->format); return E_NOTIMPL; @@ -2732,11 +2807,9 @@ static HRESULT d3dx_pixels_decompress(struct d3dx_pixels *pixels, const struct p } TRACE("Decompressing pixels.\n"); - tmp_pitch = pixels->row_pitch * desc->block_width / desc->block_byte_count; + d3dx_init_bcn_decompression_context(&context, pixels, desc, uncompressed_desc); for (z = 0; z < size->depth; ++z) { - const BYTE *slice_data = ((BYTE *)pixels->data) + (pixels->slice_pitch * z); - for (y = 0; y < size->height; ++y) { BYTE *ptr = &uncompressed_mem[(z * uncompressed_slice_pitch) + (y * uncompressed_row_pitch)]; @@ -2745,10 +2818,9 @@ static HRESULT d3dx_pixels_decompress(struct d3dx_pixels *pixels, const struct p const POINT pt = { x, y }; if (!is_dst) - fetch_dxt_texel(tmp_pitch, slice_data, x + pixels->unaligned_rect.left, - y + pixels->unaligned_rect.top, ptr); + d3dx_fetch_bcn_texel(&context, x + pixels->unaligned_rect.left, y + pixels->unaligned_rect.top, z, ptr); else if (!PtInRect(&pixels->unaligned_rect, pt)) - fetch_dxt_texel(tmp_pitch, slice_data, x, y, ptr); + d3dx_fetch_bcn_texel(&context, x, y, z, ptr); ptr += uncompressed_desc->bytes_per_pixel; } } diff --git a/dlls/d3dx9_36/txc_dxtn.h b/dlls/d3dx9_36/txc_dxtn.h index 3c1e3d46c289..9bd59037a4b8 100644 --- a/dlls/d3dx9_36/txc_dxtn.h +++ b/dlls/d3dx9_36/txc_dxtn.h @@ -36,15 +36,6 @@ typedef GLubyte GLchan; #define BCOMP 2 #define ACOMP 3 -void fetch_2d_texel_rgb_dxt1(GLint srcRowStride, const GLubyte *pixdata, - GLint i, GLint j, GLvoid *texel); -void fetch_2d_texel_rgba_dxt1(GLint srcRowStride, const GLubyte *pixdata, - GLint i, GLint j, GLvoid *texel); -void fetch_2d_texel_rgba_dxt3(GLint srcRowStride, const GLubyte *pixdata, - GLint i, GLint j, GLvoid *texel); -void fetch_2d_texel_rgba_dxt5(GLint srcRowStride, const GLubyte *pixdata, - GLint i, GLint j, GLvoid *texel); - void tx_compress_dxtn(GLint srccomps, GLint width, GLint height, const GLubyte *srcPixData, GLenum destformat, GLubyte *dest, GLint dstRowStride); diff --git a/dlls/d3dx9_36/txc_fetch_dxtn.c b/dlls/d3dx9_36/txc_fetch_dxtn.c deleted file mode 100644 index 7f0db56a155d..000000000000 --- a/dlls/d3dx9_36/txc_fetch_dxtn.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * libtxc_dxtn - * Version: 1.0 - * - * Copyright (C) 2004 Roland Scheidegger All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#include -#include "txc_dxtn.h" - -#define EXP5TO8R(packedcol) \ - ((((packedcol) >> 8) & 0xf8) | (((packedcol) >> 13) & 0x7)) - -#define EXP6TO8G(packedcol) \ - ((((packedcol) >> 3) & 0xfc) | (((packedcol) >> 9) & 0x3)) - -#define EXP5TO8B(packedcol) \ - ((((packedcol) << 3) & 0xf8) | (((packedcol) >> 2) & 0x7)) - -#define EXP4TO8(col) \ - ((col) | ((col) << 4)) - -/* inefficient. To be efficient, it would be necessary to decode 16 pixels at once */ - -static void dxt135_decode_imageblock ( const GLubyte *img_block_src, - GLint i, GLint j, GLuint dxt_type, GLvoid *texel ) { - GLchan *rgba = (GLchan *) texel; - const GLushort color0 = img_block_src[0] | (img_block_src[1] << 8); - const GLushort color1 = img_block_src[2] | (img_block_src[3] << 8); - const GLuint bits = img_block_src[4] | (img_block_src[5] << 8) | - (img_block_src[6] << 16) | (img_block_src[7] << 24); - /* What about big/little endian? */ - GLubyte bit_pos = 2 * (j * 4 + i) ; - GLubyte code = (GLubyte) ((bits >> bit_pos) & 3); - - rgba[ACOMP] = CHAN_MAX; - switch (code) { - case 0: - rgba[RCOMP] = UBYTE_TO_CHAN( EXP5TO8R(color0) ); - rgba[GCOMP] = UBYTE_TO_CHAN( EXP6TO8G(color0) ); - rgba[BCOMP] = UBYTE_TO_CHAN( EXP5TO8B(color0) ); - break; - case 1: - rgba[RCOMP] = UBYTE_TO_CHAN( EXP5TO8R(color1) ); - rgba[GCOMP] = UBYTE_TO_CHAN( EXP6TO8G(color1) ); - rgba[BCOMP] = UBYTE_TO_CHAN( EXP5TO8B(color1) ); - break; - case 2: - if ((dxt_type > 1) || (color0 > color1)) { - rgba[RCOMP] = UBYTE_TO_CHAN( ((EXP5TO8R(color0) * 2 + EXP5TO8R(color1)) / 3) ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((EXP6TO8G(color0) * 2 + EXP6TO8G(color1)) / 3) ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((EXP5TO8B(color0) * 2 + EXP5TO8B(color1)) / 3) ); - } - else { - rgba[RCOMP] = UBYTE_TO_CHAN( ((EXP5TO8R(color0) + EXP5TO8R(color1)) / 2) ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((EXP6TO8G(color0) + EXP6TO8G(color1)) / 2) ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((EXP5TO8B(color0) + EXP5TO8B(color1)) / 2) ); - } - break; - case 3: - if ((dxt_type > 1) || (color0 > color1)) { - rgba[RCOMP] = UBYTE_TO_CHAN( ((EXP5TO8R(color0) + EXP5TO8R(color1) * 2) / 3) ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((EXP6TO8G(color0) + EXP6TO8G(color1) * 2) / 3) ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((EXP5TO8B(color0) + EXP5TO8B(color1) * 2) / 3) ); - } - else { - rgba[RCOMP] = 0; - rgba[GCOMP] = 0; - rgba[BCOMP] = 0; - if (dxt_type == 1) rgba[ACOMP] = UBYTE_TO_CHAN(0); - } - break; - default: - /* CANNOT happen (I hope) */ - break; - } -} - - -void fetch_2d_texel_rgb_dxt1(GLint srcRowStride, const GLubyte *pixdata, - GLint i, GLint j, GLvoid *texel) -{ - /* Extract the (i,j) pixel from pixdata and return it - * in texel[RCOMP], texel[GCOMP], texel[BCOMP], texel[ACOMP]. - */ - - const GLubyte *blksrc = (pixdata + ((srcRowStride + 3) / 4 * (j / 4) + (i / 4)) * 8); - dxt135_decode_imageblock(blksrc, (i&3), (j&3), 0, texel); -} - - -void fetch_2d_texel_rgba_dxt1(GLint srcRowStride, const GLubyte *pixdata, - GLint i, GLint j, GLvoid *texel) -{ - /* Extract the (i,j) pixel from pixdata and return it - * in texel[RCOMP], texel[GCOMP], texel[BCOMP], texel[ACOMP]. - */ - - const GLubyte *blksrc = (pixdata + ((srcRowStride + 3) / 4 * (j / 4) + (i / 4)) * 8); - dxt135_decode_imageblock(blksrc, (i&3), (j&3), 1, texel); -} - -void fetch_2d_texel_rgba_dxt3(GLint srcRowStride, const GLubyte *pixdata, - GLint i, GLint j, GLvoid *texel) { - - /* Extract the (i,j) pixel from pixdata and return it - * in texel[RCOMP], texel[GCOMP], texel[BCOMP], texel[ACOMP]. - */ - - GLchan *rgba = (GLchan *) texel; - const GLubyte *blksrc = (pixdata + ((srcRowStride + 3) / 4 * (j / 4) + (i / 4)) * 16); -#if 0 - /* Simple 32bit version. */ -/* that's pretty brain-dead for a single pixel, isn't it? */ - const GLubyte bit_pos = 4 * ((j&3) * 4 + (i&3)); - const GLuint alpha_low = blksrc[0] | (blksrc[1] << 8) | (blksrc[2] << 16) | (blksrc[3] << 24); - const GLuint alpha_high = blksrc[4] | (blksrc[5] << 8) | (blksrc[6] << 16) | (blksrc[7] << 24); - - dxt135_decode_imageblock(blksrc + 8, (i&3), (j&3), 2, texel); - if (bit_pos < 32) - rgba[ACOMP] = UBYTE_TO_CHAN( (GLubyte)(EXP4TO8((alpha_low >> bit_pos) & 15)) ); - else - rgba[ACOMP] = UBYTE_TO_CHAN( (GLubyte)(EXP4TO8((alpha_high >> (bit_pos - 32)) & 15)) ); -#endif -#if 1 -/* TODO test this! */ - const GLubyte anibble = (blksrc[((j&3) * 4 + (i&3)) / 2] >> (4 * (i&1))) & 0xf; - dxt135_decode_imageblock(blksrc + 8, (i&3), (j&3), 2, texel); - rgba[ACOMP] = UBYTE_TO_CHAN( (GLubyte)(EXP4TO8(anibble)) ); -#endif - -} - -void fetch_2d_texel_rgba_dxt5(GLint srcRowStride, const GLubyte *pixdata, - GLint i, GLint j, GLvoid *texel) { - - /* Extract the (i,j) pixel from pixdata and return it - * in texel[RCOMP], texel[GCOMP], texel[BCOMP], texel[ACOMP]. - */ - - GLchan *rgba = (GLchan *) texel; - const GLubyte *blksrc = (pixdata + ((srcRowStride + 3) / 4 * (j / 4) + (i / 4)) * 16); - const GLubyte alpha0 = blksrc[0]; - const GLubyte alpha1 = blksrc[1]; -#if 0 - const GLubyte bit_pos = 3 * ((j&3) * 4 + (i&3)); - /* simple 32bit version */ - const GLuint bits_low = blksrc[2] | (blksrc[3] << 8) | (blksrc[4] << 16) | (blksrc[5] << 24); - const GLuint bits_high = blksrc[6] | (blksrc[7] << 8); - GLubyte code; - - if (bit_pos < 30) - code = (GLubyte) ((bits_low >> bit_pos) & 7); - else if (bit_pos == 30) - code = (GLubyte) ((bits_low >> 30) & 3) | ((bits_high << 2) & 4); - else - code = (GLubyte) ((bits_high >> (bit_pos - 32)) & 7); -#endif -#if 1 -/* TODO test this! */ - const GLubyte bit_pos = ((j&3) * 4 + (i&3)) * 3; - const GLubyte acodelow = blksrc[2 + bit_pos / 8]; - const GLubyte acodehigh = blksrc[3 + bit_pos / 8]; - const GLubyte code = (acodelow >> (bit_pos & 0x7) | - (acodehigh << (8 - (bit_pos & 0x7)))) & 0x7; -#endif - dxt135_decode_imageblock(blksrc + 8, (i&3), (j&3), 2, texel); -#if 0 - if (alpha0 > alpha1) { - switch (code) { - case 0: - rgba[ACOMP] = UBYTE_TO_CHAN( alpha0 ); - break; - case 1: - rgba[ACOMP] = UBYTE_TO_CHAN( alpha1 ); - break; - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - rgba[ACOMP] = UBYTE_TO_CHAN( ((alpha0 * (8 - code) + (alpha1 * (code - 1))) / 7) ); - break; - } - } - else { - switch (code) { - case 0: - rgba[ACOMP] = UBYTE_TO_CHAN( alpha0 ); - break; - case 1: - rgba[ACOMP] = UBYTE_TO_CHAN( alpha1 ); - break; - case 2: - case 3: - case 4: - case 5: - rgba[ACOMP] = UBYTE_TO_CHAN( ((alpha0 * (6 - code) + (alpha1 * (code - 1))) / 5) ); - break; - case 6: - rgba[ACOMP] = 0; - break; - case 7: - rgba[ACOMP] = CHAN_MAX; - break; - } - } -#endif -/* not sure. Which version is faster? */ -#if 1 -/* TODO test this */ - if (code == 0) - rgba[ACOMP] = UBYTE_TO_CHAN( alpha0 ); - else if (code == 1) - rgba[ACOMP] = UBYTE_TO_CHAN( alpha1 ); - else if (alpha0 > alpha1) - rgba[ACOMP] = UBYTE_TO_CHAN( ((alpha0 * (8 - code) + (alpha1 * (code - 1))) / 7) ); - else if (code < 6) - rgba[ACOMP] = UBYTE_TO_CHAN( ((alpha0 * (6 - code) + (alpha1 * (code - 1))) / 5) ); - else if (code == 6) - rgba[ACOMP] = 0; - else - rgba[ACOMP] = CHAN_MAX; -#endif -} diff --git a/dlls/d3dx9_37/Makefile.in b/dlls/d3dx9_37/Makefile.in index 150f1ceb215c..63cc79ac0b0e 100644 --- a/dlls/d3dx9_37/Makefile.in +++ b/dlls/d3dx9_37/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_38/Makefile.in b/dlls/d3dx9_38/Makefile.in index 5706fe9b2032..07c3ffc46577 100644 --- a/dlls/d3dx9_38/Makefile.in +++ b/dlls/d3dx9_38/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_39/Makefile.in b/dlls/d3dx9_39/Makefile.in index 9e8f8f6199ea..19895c164eca 100644 --- a/dlls/d3dx9_39/Makefile.in +++ b/dlls/d3dx9_39/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_40/Makefile.in b/dlls/d3dx9_40/Makefile.in index fe10a5d3dcb4..ec0e7ae4fd3f 100644 --- a/dlls/d3dx9_40/Makefile.in +++ b/dlls/d3dx9_40/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_41/Makefile.in b/dlls/d3dx9_41/Makefile.in index bc02a280d339..a3642bf39edf 100644 --- a/dlls/d3dx9_41/Makefile.in +++ b/dlls/d3dx9_41/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_42/Makefile.in b/dlls/d3dx9_42/Makefile.in index 5efa6cc00cd0..fc67605b38cb 100644 --- a/dlls/d3dx9_42/Makefile.in +++ b/dlls/d3dx9_42/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_43/Makefile.in b/dlls/d3dx9_43/Makefile.in index 1d6618598761..2faf2c7aaad0 100644 --- a/dlls/d3dx9_43/Makefile.in +++ b/dlls/d3dx9_43/Makefile.in @@ -24,7 +24,6 @@ SOURCES = \ surface.c \ texture.c \ txc_compress_dxtn.c \ - txc_fetch_dxtn.c \ util.c \ version.rc \ volume.c \ From 953194d97dc56ab3f5f395d3b818fbc260adaf65 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 26 Jul 2024 11:15:17 -0400 Subject: [PATCH 0920/2542] d3dx9: Replace txc_compress_dxtn with stb_dxt for texture compression. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_24/Makefile.in | 1 - dlls/d3dx9_25/Makefile.in | 1 - dlls/d3dx9_26/Makefile.in | 1 - dlls/d3dx9_27/Makefile.in | 1 - dlls/d3dx9_28/Makefile.in | 1 - dlls/d3dx9_29/Makefile.in | 1 - dlls/d3dx9_30/Makefile.in | 1 - dlls/d3dx9_31/Makefile.in | 1 - dlls/d3dx9_32/Makefile.in | 1 - dlls/d3dx9_33/Makefile.in | 1 - dlls/d3dx9_34/Makefile.in | 1 - dlls/d3dx9_35/Makefile.in | 1 - dlls/d3dx9_36/Makefile.in | 1 - dlls/d3dx9_36/stb_dxt.h | 719 +++++++++++++++++++++++++ dlls/d3dx9_36/surface.c | 163 ++++-- dlls/d3dx9_36/txc_compress_dxtn.c | 841 ------------------------------ dlls/d3dx9_36/txc_dxtn.h | 43 -- dlls/d3dx9_37/Makefile.in | 1 - dlls/d3dx9_38/Makefile.in | 1 - dlls/d3dx9_39/Makefile.in | 1 - dlls/d3dx9_40/Makefile.in | 1 - dlls/d3dx9_41/Makefile.in | 1 - dlls/d3dx9_42/Makefile.in | 1 - dlls/d3dx9_43/Makefile.in | 1 - 24 files changed, 853 insertions(+), 933 deletions(-) create mode 100644 dlls/d3dx9_36/stb_dxt.h delete mode 100644 dlls/d3dx9_36/txc_compress_dxtn.c delete mode 100644 dlls/d3dx9_36/txc_dxtn.h diff --git a/dlls/d3dx9_24/Makefile.in b/dlls/d3dx9_24/Makefile.in index fe179073bc18..8721e84b086e 100644 --- a/dlls/d3dx9_24/Makefile.in +++ b/dlls/d3dx9_24/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_25/Makefile.in b/dlls/d3dx9_25/Makefile.in index fd69473a512c..24ab7dd8a59f 100644 --- a/dlls/d3dx9_25/Makefile.in +++ b/dlls/d3dx9_25/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_26/Makefile.in b/dlls/d3dx9_26/Makefile.in index 7bec29003b2b..849716fba8b2 100644 --- a/dlls/d3dx9_26/Makefile.in +++ b/dlls/d3dx9_26/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_27/Makefile.in b/dlls/d3dx9_27/Makefile.in index 9c17602a0636..5788af37647d 100644 --- a/dlls/d3dx9_27/Makefile.in +++ b/dlls/d3dx9_27/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_28/Makefile.in b/dlls/d3dx9_28/Makefile.in index 23b3525ebc10..6d87622a0504 100644 --- a/dlls/d3dx9_28/Makefile.in +++ b/dlls/d3dx9_28/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_29/Makefile.in b/dlls/d3dx9_29/Makefile.in index 128ed2472a29..701cfb9f12f4 100644 --- a/dlls/d3dx9_29/Makefile.in +++ b/dlls/d3dx9_29/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_30/Makefile.in b/dlls/d3dx9_30/Makefile.in index a83e0d33ce55..01cd40d50dff 100644 --- a/dlls/d3dx9_30/Makefile.in +++ b/dlls/d3dx9_30/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_31/Makefile.in b/dlls/d3dx9_31/Makefile.in index 78abe46dd32f..f912e9e53d5d 100644 --- a/dlls/d3dx9_31/Makefile.in +++ b/dlls/d3dx9_31/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_32/Makefile.in b/dlls/d3dx9_32/Makefile.in index 5b25b0f2d0f3..9a4cce0924c6 100644 --- a/dlls/d3dx9_32/Makefile.in +++ b/dlls/d3dx9_32/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_33/Makefile.in b/dlls/d3dx9_33/Makefile.in index b14887d18635..0882c1892d88 100644 --- a/dlls/d3dx9_33/Makefile.in +++ b/dlls/d3dx9_33/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_34/Makefile.in b/dlls/d3dx9_34/Makefile.in index fd3a2b1d74f4..a7716466b5d4 100644 --- a/dlls/d3dx9_34/Makefile.in +++ b/dlls/d3dx9_34/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_35/Makefile.in b/dlls/d3dx9_35/Makefile.in index 6bd60addc4e5..a1209bbafec6 100644 --- a/dlls/d3dx9_35/Makefile.in +++ b/dlls/d3dx9_35/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_36/Makefile.in b/dlls/d3dx9_36/Makefile.in index d72bf520b183..bda2b68d60e1 100644 --- a/dlls/d3dx9_36/Makefile.in +++ b/dlls/d3dx9_36/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_36/stb_dxt.h b/dlls/d3dx9_36/stb_dxt.h new file mode 100644 index 000000000000..6150a87f08d9 --- /dev/null +++ b/dlls/d3dx9_36/stb_dxt.h @@ -0,0 +1,719 @@ +// stb_dxt.h - v1.12 - DXT1/DXT5 compressor - public domain +// original by fabian "ryg" giesen - ported to C by stb +// use '#define STB_DXT_IMPLEMENTATION' before including to create the implementation +// +// USAGE: +// call stb_compress_dxt_block() for every block (you must pad) +// source should be a 4x4 block of RGBA data in row-major order; +// Alpha channel is not stored if you specify alpha=0 (but you +// must supply some constant alpha in the alpha channel). +// You can turn on dithering and "high quality" using mode. +// +// version history: +// v1.12 - (ryg) fix bug in single-color table generator +// v1.11 - (ryg) avoid racy global init, better single-color tables, remove dither +// v1.10 - (i.c) various small quality improvements +// v1.09 - (stb) update documentation re: surprising alpha channel requirement +// v1.08 - (stb) fix bug in dxt-with-alpha block +// v1.07 - (stb) bc4; allow not using libc; add STB_DXT_STATIC +// v1.06 - (stb) fix to known-broken 1.05 +// v1.05 - (stb) support bc5/3dc (Arvids Kokins), use extern "C" in C++ (Pavel Krajcevski) +// v1.04 - (ryg) default to no rounding bias for lerped colors (as per S3TC/DX10 spec); +// single color match fix (allow for inexact color interpolation); +// optimal DXT5 index finder; "high quality" mode that runs multiple refinement steps. +// v1.03 - (stb) endianness support +// v1.02 - (stb) fix alpha encoding bug +// v1.01 - (stb) fix bug converting to RGB that messed up quality, thanks ryg & cbloom +// v1.00 - (stb) first release +// +// contributors: +// Rich Geldreich (more accurate index selection) +// Kevin Schmidt (#defines for "freestanding" compilation) +// github:ppiastucki (BC4 support) +// Ignacio Castano - improve DXT endpoint quantization +// Alan Hickman - static table initialization +// +// LICENSE +// +// See end of file for license information. + +#ifndef STB_INCLUDE_STB_DXT_H +#define STB_INCLUDE_STB_DXT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef STB_DXT_STATIC +#define STBDDEF static +#else +#define STBDDEF extern +#endif + +// compression mode (bitflags) +#define STB_DXT_NORMAL 0 +#define STB_DXT_DITHER 1 // use dithering. was always dubious, now deprecated. does nothing! +#define STB_DXT_HIGHQUAL 2 // high quality mode, does two refinement steps instead of 1. ~30-40% slower. + +STBDDEF void stb_compress_dxt_block(unsigned char *dest, const unsigned char *src_rgba_four_bytes_per_pixel, int alpha, int mode); +STBDDEF void stb_compress_bc4_block(unsigned char *dest, const unsigned char *src_r_one_byte_per_pixel); +STBDDEF void stb_compress_bc5_block(unsigned char *dest, const unsigned char *src_rg_two_byte_per_pixel); + +#define STB_COMPRESS_DXT_BLOCK + +#ifdef __cplusplus +} +#endif +#endif // STB_INCLUDE_STB_DXT_H + +#ifdef STB_DXT_IMPLEMENTATION + +// configuration options for DXT encoder. set them in the project/makefile or just define +// them at the top. + +// STB_DXT_USE_ROUNDING_BIAS +// use a rounding bias during color interpolation. this is closer to what "ideal" +// interpolation would do but doesn't match the S3TC/DX10 spec. old versions (pre-1.03) +// implicitly had this turned on. +// +// in case you're targeting a specific type of hardware (e.g. console programmers): +// NVidia and Intel GPUs (as of 2010) as well as DX9 ref use DXT decoders that are closer +// to STB_DXT_USE_ROUNDING_BIAS. AMD/ATI, S3 and DX10 ref are closer to rounding with no bias. +// you also see "(a*5 + b*3) / 8" on some old GPU designs. +// #define STB_DXT_USE_ROUNDING_BIAS + +#include + +#if !defined(STBD_FABS) +#include +#endif + +#ifndef STBD_FABS +#define STBD_FABS(x) fabs(x) +#endif + +static const unsigned char stb__OMatch5[256][2] = { + { 0, 0 }, { 0, 0 }, { 0, 1 }, { 0, 1 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 1 }, + { 1, 1 }, { 1, 1 }, { 1, 2 }, { 0, 4 }, { 2, 1 }, { 2, 1 }, { 2, 1 }, { 2, 2 }, + { 2, 2 }, { 2, 2 }, { 2, 3 }, { 1, 5 }, { 3, 2 }, { 3, 2 }, { 4, 0 }, { 3, 3 }, + { 3, 3 }, { 3, 3 }, { 3, 4 }, { 3, 4 }, { 3, 4 }, { 3, 5 }, { 4, 3 }, { 4, 3 }, + { 5, 2 }, { 4, 4 }, { 4, 4 }, { 4, 5 }, { 4, 5 }, { 5, 4 }, { 5, 4 }, { 5, 4 }, + { 6, 3 }, { 5, 5 }, { 5, 5 }, { 5, 6 }, { 4, 8 }, { 6, 5 }, { 6, 5 }, { 6, 5 }, + { 6, 6 }, { 6, 6 }, { 6, 6 }, { 6, 7 }, { 5, 9 }, { 7, 6 }, { 7, 6 }, { 8, 4 }, + { 7, 7 }, { 7, 7 }, { 7, 7 }, { 7, 8 }, { 7, 8 }, { 7, 8 }, { 7, 9 }, { 8, 7 }, + { 8, 7 }, { 9, 6 }, { 8, 8 }, { 8, 8 }, { 8, 9 }, { 8, 9 }, { 9, 8 }, { 9, 8 }, + { 9, 8 }, { 10, 7 }, { 9, 9 }, { 9, 9 }, { 9, 10 }, { 8, 12 }, { 10, 9 }, { 10, 9 }, + { 10, 9 }, { 10, 10 }, { 10, 10 }, { 10, 10 }, { 10, 11 }, { 9, 13 }, { 11, 10 }, { 11, 10 }, + { 12, 8 }, { 11, 11 }, { 11, 11 }, { 11, 11 }, { 11, 12 }, { 11, 12 }, { 11, 12 }, { 11, 13 }, + { 12, 11 }, { 12, 11 }, { 13, 10 }, { 12, 12 }, { 12, 12 }, { 12, 13 }, { 12, 13 }, { 13, 12 }, + { 13, 12 }, { 13, 12 }, { 14, 11 }, { 13, 13 }, { 13, 13 }, { 13, 14 }, { 12, 16 }, { 14, 13 }, + { 14, 13 }, { 14, 13 }, { 14, 14 }, { 14, 14 }, { 14, 14 }, { 14, 15 }, { 13, 17 }, { 15, 14 }, + { 15, 14 }, { 16, 12 }, { 15, 15 }, { 15, 15 }, { 15, 15 }, { 15, 16 }, { 15, 16 }, { 15, 16 }, + { 15, 17 }, { 16, 15 }, { 16, 15 }, { 17, 14 }, { 16, 16 }, { 16, 16 }, { 16, 17 }, { 16, 17 }, + { 17, 16 }, { 17, 16 }, { 17, 16 }, { 18, 15 }, { 17, 17 }, { 17, 17 }, { 17, 18 }, { 16, 20 }, + { 18, 17 }, { 18, 17 }, { 18, 17 }, { 18, 18 }, { 18, 18 }, { 18, 18 }, { 18, 19 }, { 17, 21 }, + { 19, 18 }, { 19, 18 }, { 20, 16 }, { 19, 19 }, { 19, 19 }, { 19, 19 }, { 19, 20 }, { 19, 20 }, + { 19, 20 }, { 19, 21 }, { 20, 19 }, { 20, 19 }, { 21, 18 }, { 20, 20 }, { 20, 20 }, { 20, 21 }, + { 20, 21 }, { 21, 20 }, { 21, 20 }, { 21, 20 }, { 22, 19 }, { 21, 21 }, { 21, 21 }, { 21, 22 }, + { 20, 24 }, { 22, 21 }, { 22, 21 }, { 22, 21 }, { 22, 22 }, { 22, 22 }, { 22, 22 }, { 22, 23 }, + { 21, 25 }, { 23, 22 }, { 23, 22 }, { 24, 20 }, { 23, 23 }, { 23, 23 }, { 23, 23 }, { 23, 24 }, + { 23, 24 }, { 23, 24 }, { 23, 25 }, { 24, 23 }, { 24, 23 }, { 25, 22 }, { 24, 24 }, { 24, 24 }, + { 24, 25 }, { 24, 25 }, { 25, 24 }, { 25, 24 }, { 25, 24 }, { 26, 23 }, { 25, 25 }, { 25, 25 }, + { 25, 26 }, { 24, 28 }, { 26, 25 }, { 26, 25 }, { 26, 25 }, { 26, 26 }, { 26, 26 }, { 26, 26 }, + { 26, 27 }, { 25, 29 }, { 27, 26 }, { 27, 26 }, { 28, 24 }, { 27, 27 }, { 27, 27 }, { 27, 27 }, + { 27, 28 }, { 27, 28 }, { 27, 28 }, { 27, 29 }, { 28, 27 }, { 28, 27 }, { 29, 26 }, { 28, 28 }, + { 28, 28 }, { 28, 29 }, { 28, 29 }, { 29, 28 }, { 29, 28 }, { 29, 28 }, { 30, 27 }, { 29, 29 }, + { 29, 29 }, { 29, 30 }, { 29, 30 }, { 30, 29 }, { 30, 29 }, { 30, 29 }, { 30, 30 }, { 30, 30 }, + { 30, 30 }, { 30, 31 }, { 30, 31 }, { 31, 30 }, { 31, 30 }, { 31, 30 }, { 31, 31 }, { 31, 31 }, +}; +static const unsigned char stb__OMatch6[256][2] = { + { 0, 0 }, { 0, 1 }, { 1, 0 }, { 1, 1 }, { 1, 1 }, { 1, 2 }, { 2, 1 }, { 2, 2 }, + { 2, 2 }, { 2, 3 }, { 3, 2 }, { 3, 3 }, { 3, 3 }, { 3, 4 }, { 4, 3 }, { 4, 4 }, + { 4, 4 }, { 4, 5 }, { 5, 4 }, { 5, 5 }, { 5, 5 }, { 5, 6 }, { 6, 5 }, { 6, 6 }, + { 6, 6 }, { 6, 7 }, { 7, 6 }, { 7, 7 }, { 7, 7 }, { 7, 8 }, { 8, 7 }, { 8, 8 }, + { 8, 8 }, { 8, 9 }, { 9, 8 }, { 9, 9 }, { 9, 9 }, { 9, 10 }, { 10, 9 }, { 10, 10 }, + { 10, 10 }, { 10, 11 }, { 11, 10 }, { 8, 16 }, { 11, 11 }, { 11, 12 }, { 12, 11 }, { 9, 17 }, + { 12, 12 }, { 12, 13 }, { 13, 12 }, { 11, 16 }, { 13, 13 }, { 13, 14 }, { 14, 13 }, { 12, 17 }, + { 14, 14 }, { 14, 15 }, { 15, 14 }, { 14, 16 }, { 15, 15 }, { 15, 16 }, { 16, 14 }, { 16, 15 }, + { 17, 14 }, { 16, 16 }, { 16, 17 }, { 17, 16 }, { 18, 15 }, { 17, 17 }, { 17, 18 }, { 18, 17 }, + { 20, 14 }, { 18, 18 }, { 18, 19 }, { 19, 18 }, { 21, 15 }, { 19, 19 }, { 19, 20 }, { 20, 19 }, + { 20, 20 }, { 20, 20 }, { 20, 21 }, { 21, 20 }, { 21, 21 }, { 21, 21 }, { 21, 22 }, { 22, 21 }, + { 22, 22 }, { 22, 22 }, { 22, 23 }, { 23, 22 }, { 23, 23 }, { 23, 23 }, { 23, 24 }, { 24, 23 }, + { 24, 24 }, { 24, 24 }, { 24, 25 }, { 25, 24 }, { 25, 25 }, { 25, 25 }, { 25, 26 }, { 26, 25 }, + { 26, 26 }, { 26, 26 }, { 26, 27 }, { 27, 26 }, { 24, 32 }, { 27, 27 }, { 27, 28 }, { 28, 27 }, + { 25, 33 }, { 28, 28 }, { 28, 29 }, { 29, 28 }, { 27, 32 }, { 29, 29 }, { 29, 30 }, { 30, 29 }, + { 28, 33 }, { 30, 30 }, { 30, 31 }, { 31, 30 }, { 30, 32 }, { 31, 31 }, { 31, 32 }, { 32, 30 }, + { 32, 31 }, { 33, 30 }, { 32, 32 }, { 32, 33 }, { 33, 32 }, { 34, 31 }, { 33, 33 }, { 33, 34 }, + { 34, 33 }, { 36, 30 }, { 34, 34 }, { 34, 35 }, { 35, 34 }, { 37, 31 }, { 35, 35 }, { 35, 36 }, + { 36, 35 }, { 36, 36 }, { 36, 36 }, { 36, 37 }, { 37, 36 }, { 37, 37 }, { 37, 37 }, { 37, 38 }, + { 38, 37 }, { 38, 38 }, { 38, 38 }, { 38, 39 }, { 39, 38 }, { 39, 39 }, { 39, 39 }, { 39, 40 }, + { 40, 39 }, { 40, 40 }, { 40, 40 }, { 40, 41 }, { 41, 40 }, { 41, 41 }, { 41, 41 }, { 41, 42 }, + { 42, 41 }, { 42, 42 }, { 42, 42 }, { 42, 43 }, { 43, 42 }, { 40, 48 }, { 43, 43 }, { 43, 44 }, + { 44, 43 }, { 41, 49 }, { 44, 44 }, { 44, 45 }, { 45, 44 }, { 43, 48 }, { 45, 45 }, { 45, 46 }, + { 46, 45 }, { 44, 49 }, { 46, 46 }, { 46, 47 }, { 47, 46 }, { 46, 48 }, { 47, 47 }, { 47, 48 }, + { 48, 46 }, { 48, 47 }, { 49, 46 }, { 48, 48 }, { 48, 49 }, { 49, 48 }, { 50, 47 }, { 49, 49 }, + { 49, 50 }, { 50, 49 }, { 52, 46 }, { 50, 50 }, { 50, 51 }, { 51, 50 }, { 53, 47 }, { 51, 51 }, + { 51, 52 }, { 52, 51 }, { 52, 52 }, { 52, 52 }, { 52, 53 }, { 53, 52 }, { 53, 53 }, { 53, 53 }, + { 53, 54 }, { 54, 53 }, { 54, 54 }, { 54, 54 }, { 54, 55 }, { 55, 54 }, { 55, 55 }, { 55, 55 }, + { 55, 56 }, { 56, 55 }, { 56, 56 }, { 56, 56 }, { 56, 57 }, { 57, 56 }, { 57, 57 }, { 57, 57 }, + { 57, 58 }, { 58, 57 }, { 58, 58 }, { 58, 58 }, { 58, 59 }, { 59, 58 }, { 59, 59 }, { 59, 59 }, + { 59, 60 }, { 60, 59 }, { 60, 60 }, { 60, 60 }, { 60, 61 }, { 61, 60 }, { 61, 61 }, { 61, 61 }, + { 61, 62 }, { 62, 61 }, { 62, 62 }, { 62, 62 }, { 62, 63 }, { 63, 62 }, { 63, 63 }, { 63, 63 }, +}; + +static int stb__Mul8Bit(int a, int b) +{ + int t = a*b + 128; + return (t + (t >> 8)) >> 8; +} + +static void stb__From16Bit(unsigned char *out, unsigned short v) +{ + int rv = (v & 0xf800) >> 11; + int gv = (v & 0x07e0) >> 5; + int bv = (v & 0x001f) >> 0; + + // expand to 8 bits via bit replication + out[0] = (rv * 33) >> 2; + out[1] = (gv * 65) >> 4; + out[2] = (bv * 33) >> 2; + out[3] = 0; +} + +static unsigned short stb__As16Bit(int r, int g, int b) +{ + return (unsigned short)((stb__Mul8Bit(r,31) << 11) + (stb__Mul8Bit(g,63) << 5) + stb__Mul8Bit(b,31)); +} + +// linear interpolation at 1/3 point between a and b, using desired rounding type +static int stb__Lerp13(int a, int b) +{ +#ifdef STB_DXT_USE_ROUNDING_BIAS + // with rounding bias + return a + stb__Mul8Bit(b-a, 0x55); +#else + // without rounding bias + // replace "/ 3" by "* 0xaaab) >> 17" if your compiler sucks or you really need every ounce of speed. + return (2*a + b) / 3; +#endif +} + +// lerp RGB color +static void stb__Lerp13RGB(unsigned char *out, unsigned char *p1, unsigned char *p2) +{ + out[0] = (unsigned char)stb__Lerp13(p1[0], p2[0]); + out[1] = (unsigned char)stb__Lerp13(p1[1], p2[1]); + out[2] = (unsigned char)stb__Lerp13(p1[2], p2[2]); +} + +/****************************************************************************/ + +static void stb__EvalColors(unsigned char *color,unsigned short c0,unsigned short c1) +{ + stb__From16Bit(color+ 0, c0); + stb__From16Bit(color+ 4, c1); + stb__Lerp13RGB(color+ 8, color+0, color+4); + stb__Lerp13RGB(color+12, color+4, color+0); +} + +// The color matching function +static unsigned int stb__MatchColorsBlock(unsigned char *block, unsigned char *color) +{ + unsigned int mask = 0; + int dirr = color[0*4+0] - color[1*4+0]; + int dirg = color[0*4+1] - color[1*4+1]; + int dirb = color[0*4+2] - color[1*4+2]; + int dots[16]; + int stops[4]; + int i; + int c0Point, halfPoint, c3Point; + + for(i=0;i<16;i++) + dots[i] = block[i*4+0]*dirr + block[i*4+1]*dirg + block[i*4+2]*dirb; + + for(i=0;i<4;i++) + stops[i] = color[i*4+0]*dirr + color[i*4+1]*dirg + color[i*4+2]*dirb; + + // think of the colors as arranged on a line; project point onto that line, then choose + // next color out of available ones. we compute the crossover points for "best color in top + // half"/"best in bottom half" and then the same inside that subinterval. + // + // relying on this 1d approximation isn't always optimal in terms of euclidean distance, + // but it's very close and a lot faster. + // http://cbloomrants.blogspot.com/2008/12/12-08-08-dxtc-summary.html + + c0Point = (stops[1] + stops[3]); + halfPoint = (stops[3] + stops[2]); + c3Point = (stops[2] + stops[0]); + + for (i=15;i>=0;i--) { + int dot = dots[i]*2; + mask <<= 2; + + if(dot < halfPoint) + mask |= (dot < c0Point) ? 1 : 3; + else + mask |= (dot < c3Point) ? 2 : 0; + } + + return mask; +} + +// The color optimization function. (Clever code, part 1) +static void stb__OptimizeColorsBlock(unsigned char *block, unsigned short *pmax16, unsigned short *pmin16) +{ + int mind,maxd; + unsigned char *minp, *maxp; + double magn; + int v_r,v_g,v_b; + static const int nIterPower = 4; + float covf[6],vfr,vfg,vfb; + + // determine color distribution + int cov[6]; + int mu[3],min[3],max[3]; + int ch,i,iter; + + for(ch=0;ch<3;ch++) + { + const unsigned char *bp = ((const unsigned char *) block) + ch; + int muv,minv,maxv; + + muv = minv = maxv = bp[0]; + for(i=4;i<64;i+=4) + { + muv += bp[i]; + if (bp[i] < minv) minv = bp[i]; + else if (bp[i] > maxv) maxv = bp[i]; + } + + mu[ch] = (muv + 8) >> 4; + min[ch] = minv; + max[ch] = maxv; + } + + // determine covariance matrix + for (i=0;i<6;i++) + cov[i] = 0; + + for (i=0;i<16;i++) + { + int r = block[i*4+0] - mu[0]; + int g = block[i*4+1] - mu[1]; + int b = block[i*4+2] - mu[2]; + + cov[0] += r*r; + cov[1] += r*g; + cov[2] += r*b; + cov[3] += g*g; + cov[4] += g*b; + cov[5] += b*b; + } + + // convert covariance matrix to float, find principal axis via power iter + for(i=0;i<6;i++) + covf[i] = cov[i] / 255.0f; + + vfr = (float) (max[0] - min[0]); + vfg = (float) (max[1] - min[1]); + vfb = (float) (max[2] - min[2]); + + for(iter=0;iter magn) magn = STBD_FABS(vfg); + if (STBD_FABS(vfb) > magn) magn = STBD_FABS(vfb); + + if(magn < 4.0f) { // too small, default to luminance + v_r = 299; // JPEG YCbCr luma coefs, scaled by 1000. + v_g = 587; + v_b = 114; + } else { + magn = 512.0 / magn; + v_r = (int) (vfr * magn); + v_g = (int) (vfg * magn); + v_b = (int) (vfb * magn); + } + + minp = maxp = block; + mind = maxd = block[0]*v_r + block[1]*v_g + block[2]*v_b; + // Pick colors at extreme points + for(i=1;i<16;i++) + { + int dot = block[i*4+0]*v_r + block[i*4+1]*v_g + block[i*4+2]*v_b; + + if (dot < mind) { + mind = dot; + minp = block+i*4; + } + + if (dot > maxd) { + maxd = dot; + maxp = block+i*4; + } + } + + *pmax16 = stb__As16Bit(maxp[0],maxp[1],maxp[2]); + *pmin16 = stb__As16Bit(minp[0],minp[1],minp[2]); +} + +static const float stb__midpoints5[32] = { + 0.015686f, 0.047059f, 0.078431f, 0.111765f, 0.145098f, 0.176471f, 0.207843f, 0.241176f, 0.274510f, 0.305882f, 0.337255f, 0.370588f, 0.403922f, 0.435294f, 0.466667f, 0.5f, + 0.533333f, 0.564706f, 0.596078f, 0.629412f, 0.662745f, 0.694118f, 0.725490f, 0.758824f, 0.792157f, 0.823529f, 0.854902f, 0.888235f, 0.921569f, 0.952941f, 0.984314f, 1.0f +}; + +static const float stb__midpoints6[64] = { + 0.007843f, 0.023529f, 0.039216f, 0.054902f, 0.070588f, 0.086275f, 0.101961f, 0.117647f, 0.133333f, 0.149020f, 0.164706f, 0.180392f, 0.196078f, 0.211765f, 0.227451f, 0.245098f, + 0.262745f, 0.278431f, 0.294118f, 0.309804f, 0.325490f, 0.341176f, 0.356863f, 0.372549f, 0.388235f, 0.403922f, 0.419608f, 0.435294f, 0.450980f, 0.466667f, 0.482353f, 0.500000f, + 0.517647f, 0.533333f, 0.549020f, 0.564706f, 0.580392f, 0.596078f, 0.611765f, 0.627451f, 0.643137f, 0.658824f, 0.674510f, 0.690196f, 0.705882f, 0.721569f, 0.737255f, 0.754902f, + 0.772549f, 0.788235f, 0.803922f, 0.819608f, 0.835294f, 0.850980f, 0.866667f, 0.882353f, 0.898039f, 0.913725f, 0.929412f, 0.945098f, 0.960784f, 0.976471f, 0.992157f, 1.0f +}; + +static unsigned short stb__Quantize5(float x) +{ + unsigned short q; + x = x < 0 ? 0 : x > 1 ? 1 : x; // saturate + q = (unsigned short)(x * 31); + q += (x > stb__midpoints5[q]); + return q; +} + +static unsigned short stb__Quantize6(float x) +{ + unsigned short q; + x = x < 0 ? 0 : x > 1 ? 1 : x; // saturate + q = (unsigned short)(x * 63); + q += (x > stb__midpoints6[q]); + return q; +} + +// The refinement function. (Clever code, part 2) +// Tries to optimize colors to suit block contents better. +// (By solving a least squares system via normal equations+Cramer's rule) +static int stb__RefineBlock(unsigned char *block, unsigned short *pmax16, unsigned short *pmin16, unsigned int mask) +{ + static const int w1Tab[4] = { 3,0,2,1 }; + static const int prods[4] = { 0x090000,0x000900,0x040102,0x010402 }; + // ^some magic to save a lot of multiplies in the accumulating loop... + // (precomputed products of weights for least squares system, accumulated inside one 32-bit register) + + float f; + unsigned short oldMin, oldMax, min16, max16; + int i, akku = 0, xx,xy,yy; + int At1_r,At1_g,At1_b; + int At2_r,At2_g,At2_b; + unsigned int cm = mask; + + oldMin = *pmin16; + oldMax = *pmax16; + + if((mask ^ (mask<<2)) < 4) // all pixels have the same index? + { + // yes, linear system would be singular; solve using optimal + // single-color match on average color + int r = 8, g = 8, b = 8; + for (i=0;i<16;++i) { + r += block[i*4+0]; + g += block[i*4+1]; + b += block[i*4+2]; + } + + r >>= 4; g >>= 4; b >>= 4; + + max16 = (stb__OMatch5[r][0]<<11) | (stb__OMatch6[g][0]<<5) | stb__OMatch5[b][0]; + min16 = (stb__OMatch5[r][1]<<11) | (stb__OMatch6[g][1]<<5) | stb__OMatch5[b][1]; + } else { + At1_r = At1_g = At1_b = 0; + At2_r = At2_g = At2_b = 0; + for (i=0;i<16;++i,cm>>=2) { + int step = cm&3; + int w1 = w1Tab[step]; + int r = block[i*4+0]; + int g = block[i*4+1]; + int b = block[i*4+2]; + + akku += prods[step]; + At1_r += w1*r; + At1_g += w1*g; + At1_b += w1*b; + At2_r += r; + At2_g += g; + At2_b += b; + } + + At2_r = 3*At2_r - At1_r; + At2_g = 3*At2_g - At1_g; + At2_b = 3*At2_b - At1_b; + + // extract solutions and decide solvability + xx = akku >> 16; + yy = (akku >> 8) & 0xff; + xy = (akku >> 0) & 0xff; + + f = 3.0f / 255.0f / (xx*yy - xy*xy); + + max16 = stb__Quantize5((At1_r*yy - At2_r * xy) * f) << 11; + max16 |= stb__Quantize6((At1_g*yy - At2_g * xy) * f) << 5; + max16 |= stb__Quantize5((At1_b*yy - At2_b * xy) * f) << 0; + + min16 = stb__Quantize5((At2_r*xx - At1_r * xy) * f) << 11; + min16 |= stb__Quantize6((At2_g*xx - At1_g * xy) * f) << 5; + min16 |= stb__Quantize5((At2_b*xx - At1_b * xy) * f) << 0; + } + + *pmin16 = min16; + *pmax16 = max16; + return oldMin != min16 || oldMax != max16; +} + +// Color block compression +static void stb__CompressColorBlock(unsigned char *dest, unsigned char *block, int mode) +{ + unsigned int mask; + int i; + int refinecount; + unsigned short max16, min16; + unsigned char color[4*4]; + + refinecount = (mode & STB_DXT_HIGHQUAL) ? 2 : 1; + + // check if block is constant + for (i=1;i<16;i++) + if (((unsigned int *) block)[i] != ((unsigned int *) block)[0]) + break; + + if(i == 16) { // constant color + int r = block[0], g = block[1], b = block[2]; + mask = 0xaaaaaaaa; + max16 = (stb__OMatch5[r][0]<<11) | (stb__OMatch6[g][0]<<5) | stb__OMatch5[b][0]; + min16 = (stb__OMatch5[r][1]<<11) | (stb__OMatch6[g][1]<<5) | stb__OMatch5[b][1]; + } else { + // first step: PCA+map along principal axis + stb__OptimizeColorsBlock(block,&max16,&min16); + if (max16 != min16) { + stb__EvalColors(color,max16,min16); + mask = stb__MatchColorsBlock(block,color); + } else + mask = 0; + + // third step: refine (multiple times if requested) + for (i=0;i> 8); + dest[2] = (unsigned char) (min16); + dest[3] = (unsigned char) (min16 >> 8); + dest[4] = (unsigned char) (mask); + dest[5] = (unsigned char) (mask >> 8); + dest[6] = (unsigned char) (mask >> 16); + dest[7] = (unsigned char) (mask >> 24); +} + +// Alpha block compression (this is easy for a change) +static void stb__CompressAlphaBlock(unsigned char *dest,unsigned char *src, int stride) +{ + int i,dist,bias,dist4,dist2,bits,mask; + + // find min/max color + int mn,mx; + mn = mx = src[0]; + + for (i=1;i<16;i++) + { + if (src[i*stride] < mn) mn = src[i*stride]; + else if (src[i*stride] > mx) mx = src[i*stride]; + } + + // encode them + dest[0] = (unsigned char)mx; + dest[1] = (unsigned char)mn; + dest += 2; + + // determine bias and emit color indices + // given the choice of mx/mn, these indices are optimal: + // http://fgiesen.wordpress.com/2009/12/15/dxt5-alpha-block-index-determination/ + dist = mx-mn; + dist4 = dist*4; + dist2 = dist*2; + bias = (dist < 8) ? (dist - 1) : (dist/2 + 2); + bias -= mn * 7; + bits = 0,mask=0; + + for (i=0;i<16;i++) { + int a = src[i*stride]*7 + bias; + int ind,t; + + // select index. this is a "linear scale" lerp factor between 0 (val=min) and 7 (val=max). + t = (a >= dist4) ? -1 : 0; ind = t & 4; a -= dist4 & t; + t = (a >= dist2) ? -1 : 0; ind += t & 2; a -= dist2 & t; + ind += (a >= dist); + + // turn linear scale into DXT index (0/1 are extremal pts) + ind = -ind & 7; + ind ^= (2 > ind); + + // write index + mask |= ind << bits; + if((bits += 3) >= 8) { + *dest++ = (unsigned char)mask; + mask >>= 8; + bits -= 8; + } + } +} + +void stb_compress_dxt_block(unsigned char *dest, const unsigned char *src, int alpha, int mode) +{ + unsigned char data[16][4]; + if (alpha) { + int i; + stb__CompressAlphaBlock(dest,(unsigned char*) src+3, 4); + dest += 8; + // make a new copy of the data in which alpha is opaque, + // because code uses a fast test for color constancy + memcpy(data, src, 4*16); + for (i=0; i < 16; ++i) + data[i][3] = 255; + src = &data[0][0]; + } + + stb__CompressColorBlock(dest,(unsigned char*) src,mode); +} + +void stb_compress_bc4_block(unsigned char *dest, const unsigned char *src) +{ + stb__CompressAlphaBlock(dest,(unsigned char*) src, 1); +} + +void stb_compress_bc5_block(unsigned char *dest, const unsigned char *src) +{ + stb__CompressAlphaBlock(dest,(unsigned char*) src,2); + stb__CompressAlphaBlock(dest + 8,(unsigned char*) src+1,2); +} +#endif // STB_DXT_IMPLEMENTATION + +// Compile with STB_DXT_IMPLEMENTATION and STB_DXT_GENERATE_TABLES +// defined to generate the tables above. +#ifdef STB_DXT_GENERATE_TABLES +#include + +int main() +{ + int i, j; + const char *omatch_names[] = { "stb__OMatch5", "stb__OMatch6" }; + int dequant_mults[2] = { 33*4, 65 }; // .4 fixed-point dequant multipliers + + // optimal endpoint tables + for (i = 0; i < 2; ++i) { + int dequant = dequant_mults[i]; + int size = i ? 64 : 32; + printf("static const unsigned char %s[256][2] = {\n", omatch_names[i]); + for (int j = 0; j < 256; ++j) { + int mn, mx; + int best_mn = 0, best_mx = 0; + int best_err = 256 * 100; + for (mn=0;mn> 4; + int maxe = (mx * dequant) >> 4; + int err = abs(stb__Lerp13(maxe, mine) - j) * 100; + + // DX10 spec says that interpolation must be within 3% of "correct" result, + // add this as error term. Normally we'd expect a random distribution of + // +-1.5% error, but nowhere in the spec does it say that the error has to be + // unbiased - better safe than sorry. + err += abs(maxe - mine) * 3; + + if(err < best_err) { + best_mn = mn; + best_mx = mx; + best_err = err; + } + } + } + if ((j % 8) == 0) printf(" "); // 2 spaces, third is done below + printf(" { %2d, %2d },", best_mx, best_mn); + if ((j % 8) == 7) printf("\n"); + } + printf("};\n"); + } + + return 0; +} +#endif + +/* +------------------------------------------------------------------------------ +This software is available under 2 licenses -- choose whichever you prefer. +------------------------------------------------------------------------------ +ALTERNATIVE A - MIT License +Copyright (c) 2017 Sean Barrett +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +------------------------------------------------------------------------------ +ALTERNATIVE B - Public Domain (www.unlicense.org) +This is free and unencumbered software released into the public domain. +Anyone is free to copy, modify, publish, use, compile, sell, or distribute this +software, either in source code form or as a compiled binary, for any purpose, +commercial or non-commercial, and by any means. +In jurisdictions that recognize copyright laws, the author or authors of this +software dedicate any and all copyright interest in the software to the public +domain. We make this dedication for the benefit of the public at large and to +the detriment of our heirs and successors. We intend this dedication to be an +overt act of relinquishment in perpetuity of all present and future rights to +this software under copyright law. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +------------------------------------------------------------------------------ +*/ diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index b6497f2036fc..ace3f3d03eec 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -27,7 +27,8 @@ #define BCDEC_IMPLEMENTATION #include "bcdec.h" -#include "txc_dxtn.h" +#define STB_DXT_IMPLEMENTATION +#include "stb_dxt.h" #include WINE_DEFAULT_DEBUG_CHANNEL(d3dx); @@ -2835,6 +2836,132 @@ static HRESULT d3dx_pixels_decompress(struct d3dx_pixels *pixels, const struct p return S_OK; } +static void d3dx_init_bcn_block_buffer(const void *src_data, uint32_t src_row_pitch, uint8_t src_width, uint8_t src_height, + const struct pixel_format_desc *src_desc, uint8_t *block_buf) +{ + uint8_t x, y; + + for (y = 0; y < 4; ++y) + { + const uint8_t *src_row = ((const uint8_t *)src_data) + ((y % src_height) * src_row_pitch); + + for (x = 0; x < 4; ++x) + { + uint8_t *dst_pixel = &block_buf[(y * 4 * src_desc->bytes_per_pixel) + (x * src_desc->bytes_per_pixel)]; + const uint8_t *src_pixel = src_row + (((x % src_width)) * src_desc->bytes_per_pixel); + + memcpy(dst_pixel, src_pixel, src_desc->bytes_per_pixel); + } + } +} + +static void d3dx_compress_bc1_block(const void *src_data, uint32_t src_row_pitch, uint8_t src_width, uint8_t src_height, + void *dst_data) +{ + const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); + uint8_t tmp_buf[4 * 4 * 4]; + + d3dx_init_bcn_block_buffer(src_data, src_row_pitch, src_width, src_height, fmt_desc, tmp_buf); + + stb_compress_dxt_block(dst_data, (const uint8_t *)tmp_buf, FALSE, 0); +} + +static void d3dx_compress_bc2_block(const void *src_data, uint32_t src_row_pitch, uint8_t src_width, uint8_t src_height, + void *dst_data) +{ + const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); + uint8_t *dst_data_offset = dst_data; + uint8_t tmp_buf[4 * 4 * 4], y; + + d3dx_init_bcn_block_buffer(src_data, src_row_pitch, src_width, src_height, fmt_desc, tmp_buf); + for (y = 0; y < 4; ++y) + { + uint8_t *tmp_row = &tmp_buf[y * 4 * fmt_desc->bytes_per_pixel]; + + dst_data_offset[0] = (tmp_row[7] & 0xf0); + dst_data_offset[0] |= (tmp_row[3] >> 4); + dst_data_offset[1] = (tmp_row[15] & 0xf0); + dst_data_offset[1] |= (tmp_row[11] >> 4); + + /* + * Set all alpha values to 0xff so they aren't considered during + * compression. + */ + tmp_row[3] = tmp_row[7] = tmp_row[11] = tmp_row[15] = 0xff; + dst_data_offset += 2; + } + + stb_compress_dxt_block(dst_data_offset, (const unsigned char *)tmp_buf, FALSE, 0); +} + +static void d3dx_compress_bc3_block(const void *src_data, uint32_t src_row_pitch, uint8_t src_width, uint8_t src_height, + void *dst_data) +{ + const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); + uint8_t tmp_buf[4 * 4 * 4]; + + d3dx_init_bcn_block_buffer(src_data, src_row_pitch, src_width, src_height, fmt_desc, tmp_buf); + + stb_compress_dxt_block(dst_data, (const uint8_t *)tmp_buf, TRUE, 0); +} + +static HRESULT d3dx_pixels_compress(struct d3dx_pixels *src_pixels, + const struct pixel_format_desc *src_desc, struct d3dx_pixels *dst_pixels, + const struct pixel_format_desc *dst_desc) +{ + void (*compress_bcn_block)(const void *, uint32_t, uint8_t, uint8_t, void *) = NULL; + uint32_t x, y, z; + + /* Pick a compression function. */ + switch (dst_desc->format) + { + case D3DX_PIXEL_FORMAT_DXT1_UNORM: + compress_bcn_block = d3dx_compress_bc1_block; + break; + + case D3DX_PIXEL_FORMAT_DXT2_UNORM: + case D3DX_PIXEL_FORMAT_DXT3_UNORM: + compress_bcn_block = d3dx_compress_bc2_block; + break; + + case D3DX_PIXEL_FORMAT_DXT4_UNORM: + case D3DX_PIXEL_FORMAT_DXT5_UNORM: + compress_bcn_block = d3dx_compress_bc3_block; + break; + + default: + FIXME("Unexpected compressed texture format %u.\n", dst_desc->format); + return E_NOTIMPL; + } + + assert(compress_bcn_block); + + TRACE("Compressing pixels.\n"); + for (z = 0; z < src_pixels->size.depth; ++z) + { + const BYTE *src_slice = ((const BYTE *)src_pixels->data) + (z * src_pixels->slice_pitch); + BYTE *dst_slice = ((BYTE *)dst_pixels->data) + (z * dst_pixels->slice_pitch); + + for (y = 0; y < src_pixels->size.height; y += dst_desc->block_height) + { + BYTE *dst_ptr = &dst_slice[(y / dst_desc->block_height) * dst_pixels->row_pitch]; + uint8_t tmp_src_height = min(dst_desc->block_height, src_pixels->size.height - y); + const BYTE *src_ptr = &src_slice[y * src_pixels->row_pitch]; + + for (x = 0; x < src_pixels->size.width; x += dst_desc->block_width) + { + uint8_t tmp_src_width = min(dst_desc->block_width, src_pixels->size.width - x); + + compress_bcn_block(src_ptr, src_pixels->row_pitch, tmp_src_width, tmp_src_height, dst_ptr); + src_ptr += (src_desc->bytes_per_pixel * dst_desc->block_width); + dst_ptr += dst_desc->block_byte_count; + } + } + } + + return S_OK; +} + HRESULT d3dx_pixels_init(const void *data, uint32_t row_pitch, uint32_t slice_pitch, const PALETTEENTRY *palette, enum d3dx_pixel_format_id format, uint32_t left, uint32_t top, uint32_t right, uint32_t bottom, uint32_t front, uint32_t back, struct d3dx_pixels *pixels) @@ -2994,35 +3121,13 @@ HRESULT d3dx_load_pixels_from_pixels(struct d3dx_pixels *dst_pixels, color_key); if (SUCCEEDED(hr)) { - GLenum gl_format = 0; - uint32_t i; - - TRACE("Compressing DXTn surface.\n"); - switch (dst_desc->format) - { - case D3DX_PIXEL_FORMAT_DXT1_UNORM: - gl_format = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; - break; - case D3DX_PIXEL_FORMAT_DXT2_UNORM: - case D3DX_PIXEL_FORMAT_DXT3_UNORM: - gl_format = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; - break; - case D3DX_PIXEL_FORMAT_DXT4_UNORM: - case D3DX_PIXEL_FORMAT_DXT5_UNORM: - gl_format = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; - break; - default: - ERR("Unexpected destination compressed format %u.\n", dst_desc->format); - } - - for (i = 0; i < dst_size_aligned.depth; ++i) - { - BYTE *uncompressed_mem_slice = (BYTE *)uncompressed_mem + (i * uncompressed_slice_pitch); - BYTE *dst_memory_slice = ((BYTE *)dst_pixels->data) + (i * dst_pixels->slice_pitch); + d3dx_pixels_init(uncompressed_mem, uncompressed_row_pitch, uncompressed_slice_pitch, NULL, + uncompressed_desc->format, 0, 0, dst_size_aligned.width, dst_size_aligned.height, 0, + dst_pixels->size.depth, &uncompressed_pixels); - tx_compress_dxtn(4, dst_size_aligned.width, dst_size_aligned.height, uncompressed_mem_slice, gl_format, - dst_memory_slice, dst_pixels->row_pitch); - } + hr = d3dx_pixels_compress(&uncompressed_pixels, uncompressed_desc, dst_pixels, dst_desc); + if (FAILED(hr)) + WARN("Failed to compress pixels, hr %#lx.\n", hr); } free(uncompressed_mem); goto exit; diff --git a/dlls/d3dx9_36/txc_compress_dxtn.c b/dlls/d3dx9_36/txc_compress_dxtn.c deleted file mode 100644 index 7f10de8076b1..000000000000 --- a/dlls/d3dx9_36/txc_compress_dxtn.c +++ /dev/null @@ -1,841 +0,0 @@ -/* - * libtxc_dxtn - * Version: 1.0 - * - * Copyright (C) 2004 Roland Scheidegger All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#include -#include -#include "txc_dxtn.h" - -/* weights used for error function, basically weights (unsquared 2/4/1) according to rgb->luminance conversion - not sure if this really reflects visual perception */ -#define REDWEIGHT 4 -#define GREENWEIGHT 16 -#define BLUEWEIGHT 1 - -#define ALPHACUT 127 - -static void fancybasecolorsearch( GLubyte *blkaddr, GLubyte srccolors[4][4][4], GLubyte *bestcolor[2], - GLint numxpixels, GLint numypixels, GLint type, GLboolean haveAlpha) -{ - /* use same luminance-weighted distance metric to determine encoding as for finding the base colors */ - - /* TODO could also try to find a better encoding for the 3-color-encoding type, this really should be done - if it's rgba_dxt1 and we have alpha in the block, currently even values which will be mapped to black - due to their alpha value will influence the result */ - GLint i, j, colors, z; - GLuint pixerror, pixerrorred, pixerrorgreen, pixerrorblue, pixerrorbest; - GLint colordist, blockerrlin[2][3]; - GLubyte nrcolor[2]; - GLint pixerrorcolorbest[3]; - GLubyte enc = 0; - GLubyte cv[4][4]; - GLubyte testcolor[2][3]; - -/* fprintf(stderr, "color begin 0 r/g/b %d/%d/%d, 1 r/g/b %d/%d/%d\n", - bestcolor[0][0], bestcolor[0][1], bestcolor[0][2], bestcolor[1][0], bestcolor[1][1], bestcolor[1][2]);*/ - if (((bestcolor[0][0] & 0xf8) << 8 | (bestcolor[0][1] & 0xfc) << 3 | bestcolor[0][2] >> 3) < - ((bestcolor[1][0] & 0xf8) << 8 | (bestcolor[1][1] & 0xfc) << 3 | bestcolor[1][2] >> 3)) { - testcolor[0][0] = bestcolor[0][0]; - testcolor[0][1] = bestcolor[0][1]; - testcolor[0][2] = bestcolor[0][2]; - testcolor[1][0] = bestcolor[1][0]; - testcolor[1][1] = bestcolor[1][1]; - testcolor[1][2] = bestcolor[1][2]; - } - else { - testcolor[1][0] = bestcolor[0][0]; - testcolor[1][1] = bestcolor[0][1]; - testcolor[1][2] = bestcolor[0][2]; - testcolor[0][0] = bestcolor[1][0]; - testcolor[0][1] = bestcolor[1][1]; - testcolor[0][2] = bestcolor[1][2]; - } - - for (i = 0; i < 3; i ++) { - cv[0][i] = testcolor[0][i]; - cv[1][i] = testcolor[1][i]; - cv[2][i] = (testcolor[0][i] * 2 + testcolor[1][i]) / 3; - cv[3][i] = (testcolor[0][i] + testcolor[1][i] * 2) / 3; - } - - blockerrlin[0][0] = 0; - blockerrlin[0][1] = 0; - blockerrlin[0][2] = 0; - blockerrlin[1][0] = 0; - blockerrlin[1][1] = 0; - blockerrlin[1][2] = 0; - - nrcolor[0] = 0; - nrcolor[1] = 0; - - for (j = 0; j < numypixels; j++) { - for (i = 0; i < numxpixels; i++) { - pixerrorbest = 0xffffffff; - for (colors = 0; colors < 4; colors++) { - colordist = srccolors[j][i][0] - (cv[colors][0]); - pixerror = colordist * colordist * REDWEIGHT; - pixerrorred = colordist; - colordist = srccolors[j][i][1] - (cv[colors][1]); - pixerror += colordist * colordist * GREENWEIGHT; - pixerrorgreen = colordist; - colordist = srccolors[j][i][2] - (cv[colors][2]); - pixerror += colordist * colordist * BLUEWEIGHT; - pixerrorblue = colordist; - if (pixerror < pixerrorbest) { - enc = colors; - pixerrorbest = pixerror; - pixerrorcolorbest[0] = pixerrorred; - pixerrorcolorbest[1] = pixerrorgreen; - pixerrorcolorbest[2] = pixerrorblue; - } - } - if (enc == 0) { - for (z = 0; z < 3; z++) { - blockerrlin[0][z] += 3 * pixerrorcolorbest[z]; - } - nrcolor[0] += 3; - } - else if (enc == 2) { - for (z = 0; z < 3; z++) { - blockerrlin[0][z] += 2 * pixerrorcolorbest[z]; - } - nrcolor[0] += 2; - for (z = 0; z < 3; z++) { - blockerrlin[1][z] += 1 * pixerrorcolorbest[z]; - } - nrcolor[1] += 1; - } - else if (enc == 3) { - for (z = 0; z < 3; z++) { - blockerrlin[0][z] += 1 * pixerrorcolorbest[z]; - } - nrcolor[0] += 1; - for (z = 0; z < 3; z++) { - blockerrlin[1][z] += 2 * pixerrorcolorbest[z]; - } - nrcolor[1] += 2; - } - else if (enc == 1) { - for (z = 0; z < 3; z++) { - blockerrlin[1][z] += 3 * pixerrorcolorbest[z]; - } - nrcolor[1] += 3; - } - } - } - if (nrcolor[0] == 0) nrcolor[0] = 1; - if (nrcolor[1] == 0) nrcolor[1] = 1; - for (j = 0; j < 2; j++) { - for (i = 0; i < 3; i++) { - GLint newvalue = testcolor[j][i] + blockerrlin[j][i] / nrcolor[j]; - if (newvalue <= 0) - testcolor[j][i] = 0; - else if (newvalue >= 255) - testcolor[j][i] = 255; - else testcolor[j][i] = newvalue; - } - } - - if ((abs(testcolor[0][0] - testcolor[1][0]) < 8) && - (abs(testcolor[0][1] - testcolor[1][1]) < 4) && - (abs(testcolor[0][2] - testcolor[1][2]) < 8)) { - /* both colors are so close they might get encoded as the same 16bit values */ - GLubyte coldiffred, coldiffgreen, coldiffblue, coldiffmax, factor, ind0, ind1; - - coldiffred = abs(testcolor[0][0] - testcolor[1][0]); - coldiffgreen = 2 * abs(testcolor[0][1] - testcolor[1][1]); - coldiffblue = abs(testcolor[0][2] - testcolor[1][2]); - coldiffmax = coldiffred; - if (coldiffmax < coldiffgreen) coldiffmax = coldiffgreen; - if (coldiffmax < coldiffblue) coldiffmax = coldiffblue; - if (coldiffmax > 0) { - if (coldiffmax > 4) factor = 2; - else if (coldiffmax > 2) factor = 3; - else factor = 4; - /* Won't do much if the color value is near 255... */ - /* argh so many ifs */ - if (testcolor[1][1] >= testcolor[0][1]) { - ind1 = 1; ind0 = 0; - } - else { - ind1 = 0; ind0 = 1; - } - if ((testcolor[ind1][1] + factor * coldiffgreen) <= 255) - testcolor[ind1][1] += factor * coldiffgreen; - else testcolor[ind1][1] = 255; - if ((testcolor[ind1][0] - testcolor[ind0][1]) > 0) { - if ((testcolor[ind1][0] + factor * coldiffred) <= 255) - testcolor[ind1][0] += factor * coldiffred; - else testcolor[ind1][0] = 255; - } - else { - if ((testcolor[ind0][0] + factor * coldiffred) <= 255) - testcolor[ind0][0] += factor * coldiffred; - else testcolor[ind0][0] = 255; - } - if ((testcolor[ind1][2] - testcolor[ind0][2]) > 0) { - if ((testcolor[ind1][2] + factor * coldiffblue) <= 255) - testcolor[ind1][2] += factor * coldiffblue; - else testcolor[ind1][2] = 255; - } - else { - if ((testcolor[ind0][2] + factor * coldiffblue) <= 255) - testcolor[ind0][2] += factor * coldiffblue; - else testcolor[ind0][2] = 255; - } - } - } - - if (((testcolor[0][0] & 0xf8) << 8 | (testcolor[0][1] & 0xfc) << 3 | testcolor[0][2] >> 3) < - ((testcolor[1][0] & 0xf8) << 8 | (testcolor[1][1] & 0xfc) << 3 | testcolor[1][2]) >> 3) { - for (i = 0; i < 3; i++) { - bestcolor[0][i] = testcolor[0][i]; - bestcolor[1][i] = testcolor[1][i]; - } - } - else { - for (i = 0; i < 3; i++) { - bestcolor[0][i] = testcolor[1][i]; - bestcolor[1][i] = testcolor[0][i]; - } - } - -/* fprintf(stderr, "color end 0 r/g/b %d/%d/%d, 1 r/g/b %d/%d/%d\n", - bestcolor[0][0], bestcolor[0][1], bestcolor[0][2], bestcolor[1][0], bestcolor[1][1], bestcolor[1][2]);*/ -} - - - -static void storedxtencodedblock( GLubyte *blkaddr, GLubyte srccolors[4][4][4], GLubyte *bestcolor[2], - GLint numxpixels, GLint numypixels, GLuint type, GLboolean haveAlpha) -{ - /* use same luminance-weighted distance metric to determine encoding as for finding the base colors */ - - GLint i, j, colors; - GLuint testerror, testerror2, pixerror, pixerrorbest; - GLint colordist; - GLushort color0, color1, tempcolor; - GLuint bits = 0, bits2 = 0; - GLubyte *colorptr; - GLubyte enc = 0; - GLubyte cv[4][4]; - - bestcolor[0][0] = bestcolor[0][0] & 0xf8; - bestcolor[0][1] = bestcolor[0][1] & 0xfc; - bestcolor[0][2] = bestcolor[0][2] & 0xf8; - bestcolor[1][0] = bestcolor[1][0] & 0xf8; - bestcolor[1][1] = bestcolor[1][1] & 0xfc; - bestcolor[1][2] = bestcolor[1][2] & 0xf8; - - color0 = bestcolor[0][0] << 8 | bestcolor[0][1] << 3 | bestcolor[0][2] >> 3; - color1 = bestcolor[1][0] << 8 | bestcolor[1][1] << 3 | bestcolor[1][2] >> 3; - if (color0 < color1) { - tempcolor = color0; color0 = color1; color1 = tempcolor; - colorptr = bestcolor[0]; bestcolor[0] = bestcolor[1]; bestcolor[1] = colorptr; - } - - - for (i = 0; i < 3; i++) { - cv[0][i] = bestcolor[0][i]; - cv[1][i] = bestcolor[1][i]; - cv[2][i] = (bestcolor[0][i] * 2 + bestcolor[1][i]) / 3; - cv[3][i] = (bestcolor[0][i] + bestcolor[1][i] * 2) / 3; - } - - testerror = 0; - for (j = 0; j < numypixels; j++) { - for (i = 0; i < numxpixels; i++) { - pixerrorbest = 0xffffffff; - for (colors = 0; colors < 4; colors++) { - colordist = srccolors[j][i][0] - cv[colors][0]; - pixerror = colordist * colordist * REDWEIGHT; - colordist = srccolors[j][i][1] - cv[colors][1]; - pixerror += colordist * colordist * GREENWEIGHT; - colordist = srccolors[j][i][2] - cv[colors][2]; - pixerror += colordist * colordist * BLUEWEIGHT; - if (pixerror < pixerrorbest) { - pixerrorbest = pixerror; - enc = colors; - } - } - testerror += pixerrorbest; - bits |= enc << (2 * (j * 4 + i)); - } - } - /* some hw might disagree but actually decoding should always use 4-color encoding - for non-dxt1 formats */ - if (type == GL_COMPRESSED_RGB_S3TC_DXT1_EXT || type == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) { - for (i = 0; i < 3; i++) { - cv[2][i] = (bestcolor[0][i] + bestcolor[1][i]) / 2; - /* this isn't used. Looks like the black color constant can only be used - with RGB_DXT1 if I read the spec correctly (note though that the radeon gpu disagrees, - it will decode 3 to black even with DXT3/5), and due to how the color searching works - it won't get used even then */ - cv[3][i] = 0; - } - testerror2 = 0; - for (j = 0; j < numypixels; j++) { - for (i = 0; i < numxpixels; i++) { - pixerrorbest = 0xffffffff; - if ((type == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) && (srccolors[j][i][3] <= ALPHACUT)) { - enc = 3; - pixerrorbest = 0; /* don't calculate error */ - } - else { - /* we're calculating the same what we have done already for colors 0-1 above... */ - for (colors = 0; colors < 3; colors++) { - colordist = srccolors[j][i][0] - cv[colors][0]; - pixerror = colordist * colordist * REDWEIGHT; - colordist = srccolors[j][i][1] - cv[colors][1]; - pixerror += colordist * colordist * GREENWEIGHT; - colordist = srccolors[j][i][2] - cv[colors][2]; - pixerror += colordist * colordist * BLUEWEIGHT; - if (pixerror < pixerrorbest) { - pixerrorbest = pixerror; - /* need to exchange colors later */ - if (colors > 1) enc = colors; - else enc = colors ^ 1; - } - } - } - testerror2 += pixerrorbest; - bits2 |= enc << (2 * (j * 4 + i)); - } - } - } else { - testerror2 = 0xffffffff; - } - - /* finally we're finished, write back colors and bits */ - if ((testerror > testerror2) || (haveAlpha)) { - *blkaddr++ = color1 & 0xff; - *blkaddr++ = color1 >> 8; - *blkaddr++ = color0 & 0xff; - *blkaddr++ = color0 >> 8; - *blkaddr++ = bits2 & 0xff; - *blkaddr++ = ( bits2 >> 8) & 0xff; - *blkaddr++ = ( bits2 >> 16) & 0xff; - *blkaddr = bits2 >> 24; - } - else { - *blkaddr++ = color0 & 0xff; - *blkaddr++ = color0 >> 8; - *blkaddr++ = color1 & 0xff; - *blkaddr++ = color1 >> 8; - *blkaddr++ = bits & 0xff; - *blkaddr++ = ( bits >> 8) & 0xff; - *blkaddr++ = ( bits >> 16) & 0xff; - *blkaddr = bits >> 24; - } -} - -static void encodedxtcolorblockfaster( GLubyte *blkaddr, GLubyte srccolors[4][4][4], - GLint numxpixels, GLint numypixels, GLuint type ) -{ -/* simplistic approach. We need two base colors, simply use the "highest" and the "lowest" color - present in the picture as base colors */ - - /* define lowest and highest color as shortest and longest vector to 0/0/0, though the - vectors are weighted similar to their importance in rgb-luminance conversion - doesn't work too well though... - This seems to be a rather difficult problem */ - - GLubyte *bestcolor[2]; - GLubyte basecolors[2][3]; - GLubyte i, j; - GLuint lowcv, highcv, testcv; - GLboolean haveAlpha = GL_FALSE; - - lowcv = highcv = srccolors[0][0][0] * srccolors[0][0][0] * REDWEIGHT + - srccolors[0][0][1] * srccolors[0][0][1] * GREENWEIGHT + - srccolors[0][0][2] * srccolors[0][0][2] * BLUEWEIGHT; - bestcolor[0] = bestcolor[1] = srccolors[0][0]; - for (j = 0; j < numypixels; j++) { - for (i = 0; i < numxpixels; i++) { - /* don't use this as a base color if the pixel will get black/transparent anyway */ - if ((type != GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) || (srccolors[j][i][3] > ALPHACUT)) { - testcv = srccolors[j][i][0] * srccolors[j][i][0] * REDWEIGHT + - srccolors[j][i][1] * srccolors[j][i][1] * GREENWEIGHT + - srccolors[j][i][2] * srccolors[j][i][2] * BLUEWEIGHT; - if (testcv > highcv) { - highcv = testcv; - bestcolor[1] = srccolors[j][i]; - } - else if (testcv < lowcv) { - lowcv = testcv; - bestcolor[0] = srccolors[j][i]; - } - } - else haveAlpha = GL_TRUE; - } - } - /* make sure the original color values won't get touched... */ - for (j = 0; j < 2; j++) { - for (i = 0; i < 3; i++) { - basecolors[j][i] = bestcolor[j][i]; - } - } - bestcolor[0] = basecolors[0]; - bestcolor[1] = basecolors[1]; - - /* try to find better base colors */ - fancybasecolorsearch(blkaddr, srccolors, bestcolor, numxpixels, numypixels, type, haveAlpha); - /* find the best encoding for these colors, and store the result */ - storedxtencodedblock(blkaddr, srccolors, bestcolor, numxpixels, numypixels, type, haveAlpha); -} - -static void writedxt5encodedalphablock( GLubyte *blkaddr, GLubyte alphabase1, GLubyte alphabase2, - GLubyte alphaenc[16]) -{ - *blkaddr++ = alphabase1; - *blkaddr++ = alphabase2; - *blkaddr++ = alphaenc[0] | (alphaenc[1] << 3) | ((alphaenc[2] & 3) << 6); - *blkaddr++ = (alphaenc[2] >> 2) | (alphaenc[3] << 1) | (alphaenc[4] << 4) | ((alphaenc[5] & 1) << 7); - *blkaddr++ = (alphaenc[5] >> 1) | (alphaenc[6] << 2) | (alphaenc[7] << 5); - *blkaddr++ = alphaenc[8] | (alphaenc[9] << 3) | ((alphaenc[10] & 3) << 6); - *blkaddr++ = (alphaenc[10] >> 2) | (alphaenc[11] << 1) | (alphaenc[12] << 4) | ((alphaenc[13] & 1) << 7); - *blkaddr++ = (alphaenc[13] >> 1) | (alphaenc[14] << 2) | (alphaenc[15] << 5); -} - -static void encodedxt5alpha(GLubyte *blkaddr, GLubyte srccolors[4][4][4], - GLint numxpixels, GLint numypixels) -{ - GLubyte alphabase[2], alphause[2]; - GLshort alphatest[2]; - GLuint alphablockerror1, alphablockerror2, alphablockerror3; - GLubyte i, j, aindex, acutValues[7]; - GLubyte alphaenc1[16], alphaenc2[16], alphaenc3[16]; - GLboolean alphaabsmin = GL_FALSE; - GLboolean alphaabsmax = GL_FALSE; - GLshort alphadist; - - /* find lowest and highest alpha value in block, alphabase[0] lowest, alphabase[1] highest */ - alphabase[0] = 0xff; alphabase[1] = 0x0; - for (j = 0; j < numypixels; j++) { - for (i = 0; i < numxpixels; i++) { - if (srccolors[j][i][3] == 0) - alphaabsmin = GL_TRUE; - else if (srccolors[j][i][3] == 255) - alphaabsmax = GL_TRUE; - else { - if (srccolors[j][i][3] > alphabase[1]) - alphabase[1] = srccolors[j][i][3]; - if (srccolors[j][i][3] < alphabase[0]) - alphabase[0] = srccolors[j][i][3]; - } - } - } - - - if ((alphabase[0] > alphabase[1]) && !(alphaabsmin && alphaabsmax)) { /* one color, either max or min */ - /* shortcut here since it is a very common case (and also avoids later problems) */ - /* || (alphabase[0] == alphabase[1] && !alphaabsmin && !alphaabsmax) */ - /* could also test for alpha0 == alpha1 (and not min/max), but probably not common, so don't bother */ - - *blkaddr++ = srccolors[0][0][3]; - blkaddr++; - *blkaddr++ = 0; - *blkaddr++ = 0; - *blkaddr++ = 0; - *blkaddr++ = 0; - *blkaddr++ = 0; - *blkaddr++ = 0; -/* fprintf(stderr, "enc0 used\n");*/ - return; - } - - /* find best encoding for alpha0 > alpha1 */ - /* it's possible this encoding is better even if both alphaabsmin and alphaabsmax are true */ - alphablockerror1 = 0x0; - alphablockerror2 = 0xffffffff; - alphablockerror3 = 0xffffffff; - if (alphaabsmin) alphause[0] = 0; - else alphause[0] = alphabase[0]; - if (alphaabsmax) alphause[1] = 255; - else alphause[1] = alphabase[1]; - /* calculate the 7 cut values, just the middle between 2 of the computed alpha values */ - for (aindex = 0; aindex < 7; aindex++) { - /* don't forget here is always rounded down */ - acutValues[aindex] = (alphause[0] * (2*aindex + 1) + alphause[1] * (14 - (2*aindex + 1))) / 14; - } - - for (j = 0; j < numypixels; j++) { - for (i = 0; i < numxpixels; i++) { - /* maybe it's overkill to have the most complicated calculation just for the error - calculation which we only need to figure out if encoding1 or encoding2 is better... */ - if (srccolors[j][i][3] > acutValues[0]) { - alphaenc1[4*j + i] = 0; - alphadist = srccolors[j][i][3] - alphause[1]; - } - else if (srccolors[j][i][3] > acutValues[1]) { - alphaenc1[4*j + i] = 2; - alphadist = srccolors[j][i][3] - (alphause[1] * 6 + alphause[0] * 1) / 7; - } - else if (srccolors[j][i][3] > acutValues[2]) { - alphaenc1[4*j + i] = 3; - alphadist = srccolors[j][i][3] - (alphause[1] * 5 + alphause[0] * 2) / 7; - } - else if (srccolors[j][i][3] > acutValues[3]) { - alphaenc1[4*j + i] = 4; - alphadist = srccolors[j][i][3] - (alphause[1] * 4 + alphause[0] * 3) / 7; - } - else if (srccolors[j][i][3] > acutValues[4]) { - alphaenc1[4*j + i] = 5; - alphadist = srccolors[j][i][3] - (alphause[1] * 3 + alphause[0] * 4) / 7; - } - else if (srccolors[j][i][3] > acutValues[5]) { - alphaenc1[4*j + i] = 6; - alphadist = srccolors[j][i][3] - (alphause[1] * 2 + alphause[0] * 5) / 7; - } - else if (srccolors[j][i][3] > acutValues[6]) { - alphaenc1[4*j + i] = 7; - alphadist = srccolors[j][i][3] - (alphause[1] * 1 + alphause[0] * 6) / 7; - } - else { - alphaenc1[4*j + i] = 1; - alphadist = srccolors[j][i][3] - alphause[0]; - } - alphablockerror1 += alphadist * alphadist; - } - } -/* for (i = 0; i < 16; i++) { - fprintf(stderr, "%d ", alphaenc1[i]); - } - fprintf(stderr, "cutVals "); - for (i = 0; i < 8; i++) { - fprintf(stderr, "%d ", acutValues[i]); - } - fprintf(stderr, "srcVals "); - for (j = 0; j < numypixels; j++) - for (i = 0; i < numxpixels; i++) { - fprintf(stderr, "%d ", srccolors[j][i][3]); - } - - fprintf(stderr, "\n"); - }*/ - /* it's not very likely this encoding is better if both alphaabsmin and alphaabsmax - are false but try it anyway */ - if (alphablockerror1 >= 32) { - - /* don't bother if encoding is already very good, this condition should also imply - we have valid alphabase colors which we absolutely need (alphabase[0] <= alphabase[1]) */ - alphablockerror2 = 0; - for (aindex = 0; aindex < 5; aindex++) { - /* don't forget here is always rounded down */ - acutValues[aindex] = (alphabase[0] * (10 - (2*aindex + 1)) + alphabase[1] * (2*aindex + 1)) / 10; - } - for (j = 0; j < numypixels; j++) { - for (i = 0; i < numxpixels; i++) { - /* maybe it's overkill to have the most complicated calculation just for the error - calculation which we only need to figure out if encoding1 or encoding2 is better... */ - if (srccolors[j][i][3] == 0) { - alphaenc2[4*j + i] = 6; - alphadist = 0; - } - else if (srccolors[j][i][3] == 255) { - alphaenc2[4*j + i] = 7; - alphadist = 0; - } - else if (srccolors[j][i][3] <= acutValues[0]) { - alphaenc2[4*j + i] = 0; - alphadist = srccolors[j][i][3] - alphabase[0]; - } - else if (srccolors[j][i][3] <= acutValues[1]) { - alphaenc2[4*j + i] = 2; - alphadist = srccolors[j][i][3] - (alphabase[0] * 4 + alphabase[1] * 1) / 5; - } - else if (srccolors[j][i][3] <= acutValues[2]) { - alphaenc2[4*j + i] = 3; - alphadist = srccolors[j][i][3] - (alphabase[0] * 3 + alphabase[1] * 2) / 5; - } - else if (srccolors[j][i][3] <= acutValues[3]) { - alphaenc2[4*j + i] = 4; - alphadist = srccolors[j][i][3] - (alphabase[0] * 2 + alphabase[1] * 3) / 5; - } - else if (srccolors[j][i][3] <= acutValues[4]) { - alphaenc2[4*j + i] = 5; - alphadist = srccolors[j][i][3] - (alphabase[0] * 1 + alphabase[1] * 4) / 5; - } - else { - alphaenc2[4*j + i] = 1; - alphadist = srccolors[j][i][3] - alphabase[1]; - } - alphablockerror2 += alphadist * alphadist; - } - } - - - /* skip this if the error is already very small - this encoding is MUCH better on average than #2 though, but expensive! */ - if ((alphablockerror2 > 96) && (alphablockerror1 > 96)) { - GLshort blockerrlin1 = 0; - GLshort blockerrlin2 = 0; - GLubyte nralphainrangelow = 0; - GLubyte nralphainrangehigh = 0; - alphatest[0] = 0xff; - alphatest[1] = 0x0; - /* if we have large range it's likely there are values close to 0/255, try to map them to 0/255 */ - for (j = 0; j < numypixels; j++) { - for (i = 0; i < numxpixels; i++) { - if ((srccolors[j][i][3] > alphatest[1]) && (srccolors[j][i][3] < (255 -(alphabase[1] - alphabase[0]) / 28))) - alphatest[1] = srccolors[j][i][3]; - if ((srccolors[j][i][3] < alphatest[0]) && (srccolors[j][i][3] > (alphabase[1] - alphabase[0]) / 28)) - alphatest[0] = srccolors[j][i][3]; - } - } - /* shouldn't happen too often, don't really care about those degenerated cases */ - if (alphatest[1] <= alphatest[0]) { - alphatest[0] = 1; - alphatest[1] = 254; -/* fprintf(stderr, "only 1 or 0 colors for encoding!\n");*/ - } - for (aindex = 0; aindex < 5; aindex++) { - /* don't forget here is always rounded down */ - acutValues[aindex] = (alphatest[0] * (10 - (2*aindex + 1)) + alphatest[1] * (2*aindex + 1)) / 10; - } - - /* find the "average" difference between the alpha values and the next encoded value. - This is then used to calculate new base values. - Should there be some weighting, i.e. those values closer to alphatest[x] have more weight, - since they will see more improvement, and also because the values in the middle are somewhat - likely to get no improvement at all (because the base values might move in different directions)? - OTOH it would mean the values in the middle are even less likely to get an improvement - */ - for (j = 0; j < numypixels; j++) { - for (i = 0; i < numxpixels; i++) { - if (srccolors[j][i][3] <= alphatest[0] / 2) { - } - else if (srccolors[j][i][3] > ((255 + alphatest[1]) / 2)) { - } - else if (srccolors[j][i][3] <= acutValues[0]) { - blockerrlin1 += (srccolors[j][i][3] - alphatest[0]); - nralphainrangelow += 1; - } - else if (srccolors[j][i][3] <= acutValues[1]) { - blockerrlin1 += (srccolors[j][i][3] - (alphatest[0] * 4 + alphatest[1] * 1) / 5); - blockerrlin2 += (srccolors[j][i][3] - (alphatest[0] * 4 + alphatest[1] * 1) / 5); - nralphainrangelow += 1; - nralphainrangehigh += 1; - } - else if (srccolors[j][i][3] <= acutValues[2]) { - blockerrlin1 += (srccolors[j][i][3] - (alphatest[0] * 3 + alphatest[1] * 2) / 5); - blockerrlin2 += (srccolors[j][i][3] - (alphatest[0] * 3 + alphatest[1] * 2) / 5); - nralphainrangelow += 1; - nralphainrangehigh += 1; - } - else if (srccolors[j][i][3] <= acutValues[3]) { - blockerrlin1 += (srccolors[j][i][3] - (alphatest[0] * 2 + alphatest[1] * 3) / 5); - blockerrlin2 += (srccolors[j][i][3] - (alphatest[0] * 2 + alphatest[1] * 3) / 5); - nralphainrangelow += 1; - nralphainrangehigh += 1; - } - else if (srccolors[j][i][3] <= acutValues[4]) { - blockerrlin1 += (srccolors[j][i][3] - (alphatest[0] * 1 + alphatest[1] * 4) / 5); - blockerrlin2 += (srccolors[j][i][3] - (alphatest[0] * 1 + alphatest[1] * 4) / 5); - nralphainrangelow += 1; - nralphainrangehigh += 1; - } - else { - blockerrlin2 += (srccolors[j][i][3] - alphatest[1]); - nralphainrangehigh += 1; - } - } - } - /* shouldn't happen often, needed to avoid div by zero */ - if (nralphainrangelow == 0) nralphainrangelow = 1; - if (nralphainrangehigh == 0) nralphainrangehigh = 1; - alphatest[0] = alphatest[0] + (blockerrlin1 / nralphainrangelow); -/* fprintf(stderr, "block err lin low %d, nr %d\n", blockerrlin1, nralphainrangelow); - fprintf(stderr, "block err lin high %d, nr %d\n", blockerrlin2, nralphainrangehigh);*/ - /* again shouldn't really happen often... */ - if (alphatest[0] < 0) { - alphatest[0] = 0; -/* fprintf(stderr, "adj alpha base val to 0\n");*/ - } - alphatest[1] = alphatest[1] + (blockerrlin2 / nralphainrangehigh); - if (alphatest[1] > 255) { - alphatest[1] = 255; -/* fprintf(stderr, "adj alpha base val to 255\n");*/ - } - - alphablockerror3 = 0; - for (aindex = 0; aindex < 5; aindex++) { - /* don't forget here is always rounded down */ - acutValues[aindex] = (alphatest[0] * (10 - (2*aindex + 1)) + alphatest[1] * (2*aindex + 1)) / 10; - } - for (j = 0; j < numypixels; j++) { - for (i = 0; i < numxpixels; i++) { - /* maybe it's overkill to have the most complicated calculation just for the error - calculation which we only need to figure out if encoding1 or encoding2 is better... */ - if (srccolors[j][i][3] <= alphatest[0] / 2) { - alphaenc3[4*j + i] = 6; - alphadist = srccolors[j][i][3]; - } - else if (srccolors[j][i][3] > ((255 + alphatest[1]) / 2)) { - alphaenc3[4*j + i] = 7; - alphadist = 255 - srccolors[j][i][3]; - } - else if (srccolors[j][i][3] <= acutValues[0]) { - alphaenc3[4*j + i] = 0; - alphadist = srccolors[j][i][3] - alphatest[0]; - } - else if (srccolors[j][i][3] <= acutValues[1]) { - alphaenc3[4*j + i] = 2; - alphadist = srccolors[j][i][3] - (alphatest[0] * 4 + alphatest[1] * 1) / 5; - } - else if (srccolors[j][i][3] <= acutValues[2]) { - alphaenc3[4*j + i] = 3; - alphadist = srccolors[j][i][3] - (alphatest[0] * 3 + alphatest[1] * 2) / 5; - } - else if (srccolors[j][i][3] <= acutValues[3]) { - alphaenc3[4*j + i] = 4; - alphadist = srccolors[j][i][3] - (alphatest[0] * 2 + alphatest[1] * 3) / 5; - } - else if (srccolors[j][i][3] <= acutValues[4]) { - alphaenc3[4*j + i] = 5; - alphadist = srccolors[j][i][3] - (alphatest[0] * 1 + alphatest[1] * 4) / 5; - } - else { - alphaenc3[4*j + i] = 1; - alphadist = srccolors[j][i][3] - alphatest[1]; - } - alphablockerror3 += alphadist * alphadist; - } - } - } - } - /* write the alpha values and encoding back. */ - if ((alphablockerror1 <= alphablockerror2) && (alphablockerror1 <= alphablockerror3)) { -/* if (alphablockerror1 > 96) fprintf(stderr, "enc1 used, error %d\n", alphablockerror1);*/ - writedxt5encodedalphablock( blkaddr, alphause[1], alphause[0], alphaenc1 ); - } - else if (alphablockerror2 <= alphablockerror3) { -/* if (alphablockerror2 > 96) fprintf(stderr, "enc2 used, error %d\n", alphablockerror2);*/ - writedxt5encodedalphablock( blkaddr, alphabase[0], alphabase[1], alphaenc2 ); - } - else { -/* fprintf(stderr, "enc3 used, error %d\n", alphablockerror3);*/ - writedxt5encodedalphablock( blkaddr, (GLubyte)alphatest[0], (GLubyte)alphatest[1], alphaenc3 ); - } -} - -static void extractsrccolors( GLubyte srcpixels[4][4][4], const GLchan *srcaddr, - GLint srcRowStride, GLint numxpixels, GLint numypixels, GLint comps) -{ - GLubyte i, j, c; - const GLchan *curaddr; - for (j = 0; j < numypixels; j++) { - curaddr = srcaddr + j * srcRowStride * comps; - for (i = 0; i < numxpixels; i++) { - for (c = 0; c < comps; c++) { - srcpixels[j][i][c] = *curaddr++ / (CHAN_MAX / 255); - } - } - } -} - - -void tx_compress_dxtn(GLint srccomps, GLint width, GLint height, const GLubyte *srcPixData, - GLenum destFormat, GLubyte *dest, GLint dstRowStride) -{ - GLubyte *blkaddr = dest; - GLubyte srcpixels[4][4][4]; - const GLchan *srcaddr = srcPixData; - GLint numxpixels, numypixels; - GLint i, j; - GLint dstRowDiff; - - switch (destFormat) { - case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - /* hmm we used to get called without dstRowStride... */ - dstRowDiff = dstRowStride >= (width * 2) ? dstRowStride - (((width + 3) & ~3) * 2) : 0; -/* fprintf(stderr, "dxt1 tex width %d tex height %d dstRowStride %d\n", - width, height, dstRowStride); */ - for (j = 0; j < height; j += 4) { - if (height > j + 3) numypixels = 4; - else numypixels = height - j; - srcaddr = srcPixData + j * width * srccomps; - for (i = 0; i < width; i += 4) { - if (width > i + 3) numxpixels = 4; - else numxpixels = width - i; - extractsrccolors(srcpixels, srcaddr, width, numxpixels, numypixels, srccomps); - encodedxtcolorblockfaster(blkaddr, srcpixels, numxpixels, numypixels, destFormat); - srcaddr += srccomps * numxpixels; - blkaddr += 8; - } - blkaddr += dstRowDiff; - } - break; - case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - dstRowDiff = dstRowStride >= (width * 4) ? dstRowStride - (((width + 3) & ~3) * 4) : 0; -/* fprintf(stderr, "dxt3 tex width %d tex height %d dstRowStride %d\n", - width, height, dstRowStride); */ - for (j = 0; j < height; j += 4) { - if (height > j + 3) numypixels = 4; - else numypixels = height - j; - srcaddr = srcPixData + j * width * srccomps; - for (i = 0; i < width; i += 4) { - if (width > i + 3) numxpixels = 4; - else numxpixels = width - i; - extractsrccolors(srcpixels, srcaddr, width, numxpixels, numypixels, srccomps); - *blkaddr++ = (srcpixels[0][0][3] >> 4) | (srcpixels[0][1][3] & 0xf0); - *blkaddr++ = (srcpixels[0][2][3] >> 4) | (srcpixels[0][3][3] & 0xf0); - *blkaddr++ = (srcpixels[1][0][3] >> 4) | (srcpixels[1][1][3] & 0xf0); - *blkaddr++ = (srcpixels[1][2][3] >> 4) | (srcpixels[1][3][3] & 0xf0); - *blkaddr++ = (srcpixels[2][0][3] >> 4) | (srcpixels[2][1][3] & 0xf0); - *blkaddr++ = (srcpixels[2][2][3] >> 4) | (srcpixels[2][3][3] & 0xf0); - *blkaddr++ = (srcpixels[3][0][3] >> 4) | (srcpixels[3][1][3] & 0xf0); - *blkaddr++ = (srcpixels[3][2][3] >> 4) | (srcpixels[3][3][3] & 0xf0); - encodedxtcolorblockfaster(blkaddr, srcpixels, numxpixels, numypixels, destFormat); - srcaddr += srccomps * numxpixels; - blkaddr += 8; - } - blkaddr += dstRowDiff; - } - break; - case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - dstRowDiff = dstRowStride >= (width * 4) ? dstRowStride - (((width + 3) & ~3) * 4) : 0; -/* fprintf(stderr, "dxt5 tex width %d tex height %d dstRowStride %d\n", - width, height, dstRowStride); */ - for (j = 0; j < height; j += 4) { - if (height > j + 3) numypixels = 4; - else numypixels = height - j; - srcaddr = srcPixData + j * width * srccomps; - for (i = 0; i < width; i += 4) { - if (width > i + 3) numxpixels = 4; - else numxpixels = width - i; - extractsrccolors(srcpixels, srcaddr, width, numxpixels, numypixels, srccomps); - encodedxt5alpha(blkaddr, srcpixels, numxpixels, numypixels); - encodedxtcolorblockfaster(blkaddr + 8, srcpixels, numxpixels, numypixels, destFormat); - srcaddr += srccomps * numxpixels; - blkaddr += 16; - } - blkaddr += dstRowDiff; - } - break; - default: - /* fprintf(stderr, "libdxtn: Bad dstFormat %d in tx_compress_dxtn\n", destFormat); */ - return; - } -} diff --git a/dlls/d3dx9_36/txc_dxtn.h b/dlls/d3dx9_36/txc_dxtn.h deleted file mode 100644 index 9bd59037a4b8..000000000000 --- a/dlls/d3dx9_36/txc_dxtn.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * libtxc_dxtn - * Version: 1.0 - * - * Copyright (C) 2004 Roland Scheidegger All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#ifndef _TXC_DXTN_H -#define _TXC_DXTN_H - -#include "winternl.h" -#include "wine/wgl.h" - -typedef GLubyte GLchan; -#define UBYTE_TO_CHAN(b) (b) -#define CHAN_MAX 255 -#define RCOMP 0 -#define GCOMP 1 -#define BCOMP 2 -#define ACOMP 3 - -void tx_compress_dxtn(GLint srccomps, GLint width, GLint height, - const GLubyte *srcPixData, GLenum destformat, - GLubyte *dest, GLint dstRowStride); - -#endif /* _TXC_DXTN_H */ diff --git a/dlls/d3dx9_37/Makefile.in b/dlls/d3dx9_37/Makefile.in index 63cc79ac0b0e..29b47679786d 100644 --- a/dlls/d3dx9_37/Makefile.in +++ b/dlls/d3dx9_37/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_38/Makefile.in b/dlls/d3dx9_38/Makefile.in index 07c3ffc46577..c56b10dd4d4d 100644 --- a/dlls/d3dx9_38/Makefile.in +++ b/dlls/d3dx9_38/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_39/Makefile.in b/dlls/d3dx9_39/Makefile.in index 19895c164eca..87895b310811 100644 --- a/dlls/d3dx9_39/Makefile.in +++ b/dlls/d3dx9_39/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_40/Makefile.in b/dlls/d3dx9_40/Makefile.in index ec0e7ae4fd3f..5e4fc8849ac5 100644 --- a/dlls/d3dx9_40/Makefile.in +++ b/dlls/d3dx9_40/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_41/Makefile.in b/dlls/d3dx9_41/Makefile.in index a3642bf39edf..542a7c75381c 100644 --- a/dlls/d3dx9_41/Makefile.in +++ b/dlls/d3dx9_41/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_42/Makefile.in b/dlls/d3dx9_42/Makefile.in index fc67605b38cb..8b73b6a0abcd 100644 --- a/dlls/d3dx9_42/Makefile.in +++ b/dlls/d3dx9_42/Makefile.in @@ -22,7 +22,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ diff --git a/dlls/d3dx9_43/Makefile.in b/dlls/d3dx9_43/Makefile.in index 2faf2c7aaad0..52ec11b1e871 100644 --- a/dlls/d3dx9_43/Makefile.in +++ b/dlls/d3dx9_43/Makefile.in @@ -23,7 +23,6 @@ SOURCES = \ sprite.c \ surface.c \ texture.c \ - txc_compress_dxtn.c \ util.c \ version.rc \ volume.c \ From 44a2e7e2b33efb22a988adb32976b46adee22f3b Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 8 Aug 2024 07:30:25 -0400 Subject: [PATCH 0921/2542] d3dx9: Add an optimization to stb_dxt. This optimzation helps us to more closely match the output of native d3dx's DXT compression, which helps with d3dx10 tests. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/stb_dxt.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/d3dx9_36/stb_dxt.h b/dlls/d3dx9_36/stb_dxt.h index 6150a87f08d9..c80a5e1bb5f5 100644 --- a/dlls/d3dx9_36/stb_dxt.h +++ b/dlls/d3dx9_36/stb_dxt.h @@ -563,6 +563,16 @@ static void stb__CompressAlphaBlock(unsigned char *dest,unsigned char *src, int dest[1] = (unsigned char)mn; dest += 2; + /* + * Wine specific optimization to more closely match Windows behavior: If + * max is equal to minimum, just set all bits to 0 (which means the value + * is the value of max in this case). + */ + if (mx == mn) { + memset(dest, 0, 6); + return; + } + // determine bias and emit color indices // given the choice of mx/mn, these indices are optimal: // http://fgiesen.wordpress.com/2009/12/15/dxt5-alpha-block-index-determination/ From 161b895631b449356c1c6370a5adda62eabed638 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 1 Nov 2024 12:12:04 -0400 Subject: [PATCH 0922/2542] d3dx9: Replace D3DFORMAT constants with enum d3dx_pixel_format_id constants. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/surface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index ace3f3d03eec..cf95aa671fac 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -1482,7 +1482,7 @@ static HRESULT d3dx_image_tga_decode(const void *src_data, uint32_t src_data_siz if (FAILED(hr)) goto exit; - dst_desc = get_format_info(D3DFMT_A8B8G8R8); + dst_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); d3dx_calculate_pixels_size(dst_desc->format, 256, 1, &dst_row_pitch, &dst_slice_pitch); convert_argb_pixels(src_palette, src_row_pitch, src_slice_pitch, &image_map_size, src_desc, (BYTE *)palette, dst_row_pitch, dst_slice_pitch, &image_map_size, dst_desc, 0, NULL, D3DX_FILTER_NONE); @@ -2511,7 +2511,7 @@ static void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_sl if (color_key) { /* Color keys are always represented in D3DFMT_A8R8G8B8 format. */ - ck_format = get_format_info(D3DFMT_A8R8G8B8); + ck_format = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM); init_argb_conversion_info(src_format, ck_format, &ck_conv_info); } @@ -2613,7 +2613,7 @@ static void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT s if (color_key) { /* Color keys are always represented in D3DFMT_A8R8G8B8 format. */ - ck_format = get_format_info(D3DFMT_A8R8G8B8); + ck_format = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM); init_argb_conversion_info(src_format, ck_format, &ck_conv_info); } From e6b6308e12e2f393852628eabc0f06a98b9b096b Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 1 Nov 2024 13:20:23 -0400 Subject: [PATCH 0923/2542] d3dx9: Introduce d3dx_resource_type enumeration. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/d3dx9_private.h | 13 +++++++++++-- dlls/d3dx9_36/surface.c | 25 ++++++++++++++++--------- dlls/d3dx9_36/texture.c | 4 ++-- dlls/d3dx9_36/util.c | 13 +++++++++++++ 4 files changed, 42 insertions(+), 13 deletions(-) diff --git a/dlls/d3dx9_36/d3dx9_private.h b/dlls/d3dx9_36/d3dx9_private.h index 10c9670f1a89..30d303f7a2bf 100644 --- a/dlls/d3dx9_36/d3dx9_private.h +++ b/dlls/d3dx9_36/d3dx9_private.h @@ -169,6 +169,14 @@ static inline void set_volume_struct(struct volume *volume, uint32_t width, uint volume->depth = depth; } +enum d3dx_resource_type +{ + D3DX_RESOURCE_TYPE_TEXTURE_2D, + D3DX_RESOURCE_TYPE_TEXTURE_3D, + D3DX_RESOURCE_TYPE_CUBE_TEXTURE, + D3DX_RESOURCE_TYPE_COUNT, +}; + /* These values act as indexes into the pixel_format_desc table. */ enum d3dx_pixel_format_id { @@ -279,7 +287,7 @@ static inline void set_d3dx_pixels(struct d3dx_pixels *pixels, const void *data, #define D3DX_IMAGE_INFO_ONLY 1 struct d3dx_image { - D3DRESOURCETYPE resource_type; + enum d3dx_resource_type resource_type; enum d3dx_pixel_format_id format; struct volume size; @@ -380,6 +388,7 @@ HRESULT write_buffer_to_file(const WCHAR *filename, ID3DXBuffer *buffer); D3DFORMAT d3dformat_from_d3dx_pixel_format_id(enum d3dx_pixel_format_id format); enum d3dx_pixel_format_id d3dx_pixel_format_id_from_d3dformat(D3DFORMAT format); +enum d3dx_resource_type d3dx_resource_type_from_d3dresourcetype(D3DRESOURCETYPE type); const struct pixel_format_desc *get_d3dx_pixel_format_info(enum d3dx_pixel_format_id format); const struct pixel_format_desc *get_format_info(D3DFORMAT format); const struct pixel_format_desc *get_format_info_idx(int idx); @@ -397,7 +406,7 @@ uint32_t d3dx_calculate_layer_pixels_size(enum d3dx_pixel_format_id format, uint uint32_t mip_levels); HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pixel_format_desc *src_fmt_desc, D3DXIMAGE_FILEFORMAT file_format, enum d3dx_pixel_format_id *save_fmt); -HRESULT d3dx_init_dds_header(struct dds_header *header, D3DRESOURCETYPE resource_type, +HRESULT d3dx_init_dds_header(struct dds_header *header, enum d3dx_resource_type resource_type, enum d3dx_pixel_format_id format, const struct volume *size, uint32_t mip_levels); HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct pixel_format_desc *src_fmt_desc, D3DXIMAGE_FILEFORMAT file_format, enum d3dx_pixel_format_id dst_format, ID3DXBuffer **dst_buffer); diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index cf95aa671fac..73ba5921c89a 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -631,7 +631,7 @@ HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pixel_for return (*save_fmt == D3DX_PIXEL_FORMAT_COUNT) ? D3DERR_INVALIDCALL : D3D_OK; } -HRESULT d3dx_init_dds_header(struct dds_header *header, D3DRESOURCETYPE resource_type, +HRESULT d3dx_init_dds_header(struct dds_header *header, enum d3dx_resource_type resource_type, enum d3dx_pixel_format_id format, const struct volume *size, uint32_t mip_levels) { HRESULT hr; @@ -667,7 +667,7 @@ HRESULT d3dx_init_dds_header(struct dds_header *header, D3DRESOURCETYPE resource header->miplevels = mip_levels; } - if (resource_type == D3DRTYPE_CUBETEXTURE) + if (resource_type == D3DX_RESOURCE_TYPE_CUBE_TEXTURE) { header->caps |= DDS_CAPS_COMPLEX; header->caps2 |= (DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES); @@ -862,7 +862,7 @@ HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct header = ID3DXBuffer_GetBufferPointer(buffer); pixels = (uint8_t *)ID3DXBuffer_GetBufferPointer(buffer) + header_size; - hr = d3dx_init_dds_header(header, D3DRTYPE_TEXTURE, dst_format, &src_pixels->size, 1); + hr = d3dx_init_dds_header(header, D3DX_RESOURCE_TYPE_TEXTURE_2D, dst_format, &src_pixels->size, 1); if (FAILED(hr)) goto exit; if (is_index_format(dst_fmt_desc)) @@ -1042,7 +1042,7 @@ static HRESULT d3dx_initialize_image_from_dds(const void *src_data, uint32_t src if (header->flags & DDS_DEPTH) { image->size.depth = max(header->depth, 1); - image->resource_type = D3DRTYPE_VOLUMETEXTURE; + image->resource_type = D3DX_RESOURCE_TYPE_TEXTURE_3D; } else if (header->caps2 & DDS_CAPS2_CUBEMAP) { @@ -1053,10 +1053,12 @@ static HRESULT d3dx_initialize_image_from_dds(const void *src_data, uint32_t src } image->layer_count = 6; - image->resource_type = D3DRTYPE_CUBETEXTURE; + image->resource_type = D3DX_RESOURCE_TYPE_CUBE_TEXTURE; } else - image->resource_type = D3DRTYPE_TEXTURE; + { + image->resource_type = D3DX_RESOURCE_TYPE_TEXTURE_2D; + } image->layer_pitch = d3dx_calculate_layer_pixels_size(image->format, image->size.width, image->size.height, image->size.depth, image->mip_levels); @@ -1371,7 +1373,7 @@ static HRESULT d3dx_initialize_image_from_wic(const void *src_data, uint32_t src image->size.depth = 1; image->mip_levels = 1; image->layer_count = 1; - image->resource_type = D3DRTYPE_TEXTURE; + image->resource_type = D3DX_RESOURCE_TYPE_TEXTURE_2D; exit: if (bitmap_frame) @@ -1611,7 +1613,7 @@ static HRESULT d3dx_initialize_image_from_tga(const void *src_data, uint32_t src set_volume_struct(&image->size, header->width, header->height, 1); image->mip_levels = 1; image->layer_count = 1; - image->resource_type = D3DRTYPE_TEXTURE; + image->resource_type = D3DX_RESOURCE_TYPE_TEXTURE_2D; image->image_file_format = D3DXIFF_TGA; if (!(flags & D3DX_IMAGE_INFO_ONLY)) @@ -1753,7 +1755,12 @@ void d3dximage_info_from_d3dx_image(D3DXIMAGE_INFO *info, struct d3dx_image *ima info->Format = d3dformat_from_d3dx_pixel_format_id(image->format); break; } - info->ResourceType = image->resource_type; + if (image->resource_type == D3DX_RESOURCE_TYPE_TEXTURE_3D) + info->ResourceType = D3DRTYPE_VOLUMETEXTURE; + else if (image->resource_type == D3DX_RESOURCE_TYPE_CUBE_TEXTURE) + info->ResourceType = D3DRTYPE_CUBETEXTURE; + else + info->ResourceType = D3DRTYPE_TEXTURE; } /************************************************************ diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index a31d2a411c3c..6a8013d09e7f 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -1973,8 +1973,8 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE if (FAILED(hr)) return hr; - hr = d3dx_init_dds_header((struct dds_header *)ID3DXBuffer_GetBufferPointer(buffer), type, fmt_desc->format, &size, - mip_levels); + hr = d3dx_init_dds_header((struct dds_header *)ID3DXBuffer_GetBufferPointer(buffer), + d3dx_resource_type_from_d3dresourcetype(type), fmt_desc->format, &size, mip_levels); if (FAILED(hr)) goto exit; diff --git a/dlls/d3dx9_36/util.c b/dlls/d3dx9_36/util.c index 21b180aba49c..490f39a0d585 100644 --- a/dlls/d3dx9_36/util.c +++ b/dlls/d3dx9_36/util.c @@ -189,6 +189,19 @@ enum d3dx_pixel_format_id d3dx_pixel_format_id_from_d3dformat(D3DFORMAT format) } } +enum d3dx_resource_type d3dx_resource_type_from_d3dresourcetype(D3DRESOURCETYPE type) +{ + switch (type) + { + case D3DRTYPE_TEXTURE: return D3DX_RESOURCE_TYPE_TEXTURE_2D; + case D3DRTYPE_VOLUMETEXTURE: return D3DX_RESOURCE_TYPE_TEXTURE_3D; + case D3DRTYPE_CUBETEXTURE: return D3DX_RESOURCE_TYPE_CUBE_TEXTURE; + default: + FIXME("No d3dx_resource_type for D3DRESOURCETYPE %d.\n", type); + return D3DX_RESOURCE_TYPE_COUNT; + } +} + /************************************************************ * map_view_of_file * From 7210aaf9fcbc531dc365bd8d73c0088ae42fe56c Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Tue, 10 Dec 2024 10:40:07 -0500 Subject: [PATCH 0924/2542] d3dx9: Introduce d3dx_image_file_format enumeration. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/d3dx9_private.h | 20 ++++++- dlls/d3dx9_36/surface.c | 107 +++++++++++++++++----------------- dlls/d3dx9_36/volume.c | 5 +- 3 files changed, 74 insertions(+), 58 deletions(-) diff --git a/dlls/d3dx9_36/d3dx9_private.h b/dlls/d3dx9_36/d3dx9_private.h index 30d303f7a2bf..a582188af2fb 100644 --- a/dlls/d3dx9_36/d3dx9_private.h +++ b/dlls/d3dx9_36/d3dx9_private.h @@ -169,6 +169,20 @@ static inline void set_volume_struct(struct volume *volume, uint32_t width, uint volume->depth = depth; } +enum d3dx_image_file_format +{ + D3DX_IMAGE_FILE_FORMAT_BMP = 0, + D3DX_IMAGE_FILE_FORMAT_JPG = 1, + D3DX_IMAGE_FILE_FORMAT_TGA = 2, + D3DX_IMAGE_FILE_FORMAT_PNG = 3, + D3DX_IMAGE_FILE_FORMAT_DDS = 4, + D3DX_IMAGE_FILE_FORMAT_PPM = 5, + D3DX_IMAGE_FILE_FORMAT_DIB = 6, + D3DX_IMAGE_FILE_FORMAT_HDR = 7, + D3DX_IMAGE_FILE_FORMAT_PFM = 8, + D3DX_IMAGE_FILE_FORMAT_FORCE_DWORD = 0x7fffffff +}; + enum d3dx_resource_type { D3DX_RESOURCE_TYPE_TEXTURE_2D, @@ -306,7 +320,7 @@ struct d3dx_image void *image_buf; PALETTEENTRY *image_palette; - D3DXIMAGE_FILEFORMAT image_file_format; + enum d3dx_image_file_format image_file_format; }; HRESULT d3dx_image_init(const void *src_data, uint32_t src_data_size, struct d3dx_image *image, @@ -409,7 +423,7 @@ HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pixel_for HRESULT d3dx_init_dds_header(struct dds_header *header, enum d3dx_resource_type resource_type, enum d3dx_pixel_format_id format, const struct volume *size, uint32_t mip_levels); HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct pixel_format_desc *src_fmt_desc, - D3DXIMAGE_FILEFORMAT file_format, enum d3dx_pixel_format_id dst_format, ID3DXBuffer **dst_buffer); + enum d3dx_image_file_format file_format, enum d3dx_pixel_format_id dst_format, ID3DXBuffer **dst_buffer); HRESULT d3dx_pixels_init(const void *data, uint32_t row_pitch, uint32_t slice_pitch, const PALETTEENTRY *palette, enum d3dx_pixel_format_id format, uint32_t left, uint32_t top, uint32_t right, uint32_t bottom, uint32_t front, uint32_t back, struct d3dx_pixels *pixels); @@ -423,7 +437,7 @@ unsigned short float_32_to_16(const float in); float float_16_to_32(const unsigned short in); /* debug helpers */ -const char *debug_d3dx_image_file_format(D3DXIMAGE_FILEFORMAT format); +const char *debug_d3dx_image_file_format(enum d3dx_image_file_format format); const char *debug_d3dxparameter_class(D3DXPARAMETER_CLASS c); const char *debug_d3dxparameter_type(D3DXPARAMETER_TYPE t); const char *debug_d3dxparameter_registerset(D3DXREGISTER_SET r); diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 73ba5921c89a..723ed8ad8cff 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -602,7 +602,7 @@ HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pixel_for ARRAY_SIZE(unimplemented_bmp_save_pixel_formats), src_fmt_desc->format)) { FIXME("Saving d3dformat %#x currently unimplemented for file type %s.\n", src_fmt_desc->format, - debug_d3dx_image_file_format(file_format)); + debug_d3dx_image_file_format((enum d3dx_image_file_format)file_format)); return E_NOTIMPL; } save_fmts = bmp_save_pixel_formats; @@ -676,14 +676,14 @@ HRESULT d3dx_init_dds_header(struct dds_header *header, enum d3dx_resource_type return D3D_OK; } -static const GUID *wic_container_guid_from_d3dx_file_format(D3DXIMAGE_FILEFORMAT iff) +static const GUID *wic_container_guid_from_d3dx_file_format(enum d3dx_image_file_format iff) { switch (iff) { - case D3DXIFF_DIB: - case D3DXIFF_BMP: return &GUID_ContainerFormatBmp; - case D3DXIFF_JPG: return &GUID_ContainerFormatJpeg; - case D3DXIFF_PNG: return &GUID_ContainerFormatPng; + case D3DX_IMAGE_FILE_FORMAT_DIB: + case D3DX_IMAGE_FILE_FORMAT_BMP: return &GUID_ContainerFormatBmp; + case D3DX_IMAGE_FILE_FORMAT_JPG: return &GUID_ContainerFormatJpeg; + case D3DX_IMAGE_FILE_FORMAT_PNG: return &GUID_ContainerFormatPng; default: assert(0 && "Unexpected file format."); return NULL; @@ -691,7 +691,7 @@ static const GUID *wic_container_guid_from_d3dx_file_format(D3DXIMAGE_FILEFORMAT } static HRESULT d3dx_pixels_save_wic(struct d3dx_pixels *pixels, const struct pixel_format_desc *fmt_desc, - D3DXIMAGE_FILEFORMAT image_file_format, IStream **wic_file, uint32_t *wic_file_size) + enum d3dx_image_file_format image_file_format, IStream **wic_file, uint32_t *wic_file_size) { const GUID *container_format = wic_container_guid_from_d3dx_file_format(image_file_format); const GUID *pixel_format_guid = wic_guid_from_d3dx_pixel_format_id(fmt_desc->format); @@ -831,7 +831,7 @@ static HRESULT d3dx_pixels_save_wic(struct d3dx_pixels *pixels, const struct pix } HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct pixel_format_desc *src_fmt_desc, - D3DXIMAGE_FILEFORMAT file_format, enum d3dx_pixel_format_id dst_format, ID3DXBuffer **dst_buffer) + enum d3dx_image_file_format file_format, enum d3dx_pixel_format_id dst_format, ID3DXBuffer **dst_buffer) { const struct pixel_format_desc *dst_fmt_desc = get_d3dx_pixel_format_info(dst_format); uint32_t dst_row_pitch, dst_slice_pitch; @@ -847,10 +847,10 @@ HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct if (FAILED(hr)) return hr; - src_pixels->size.depth = (file_format == D3DXIFF_DDS) ? src_pixels->size.depth : 1; + src_pixels->size.depth = (file_format == D3DX_IMAGE_FILE_FORMAT_DDS) ? src_pixels->size.depth : 1; switch (file_format) { - case D3DXIFF_DDS: + case D3DX_IMAGE_FILE_FORMAT_DDS: { struct dds_header *header; uint32_t header_size; @@ -871,7 +871,7 @@ HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct break; } - case D3DXIFF_TGA: + case D3DX_IMAGE_FILE_FORMAT_TGA: { struct tga_header *header; @@ -893,10 +893,10 @@ HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct break; } - case D3DXIFF_DIB: - case D3DXIFF_BMP: - case D3DXIFF_PNG: - case D3DXIFF_JPG: + case D3DX_IMAGE_FILE_FORMAT_DIB: + case D3DX_IMAGE_FILE_FORMAT_BMP: + case D3DX_IMAGE_FILE_FORMAT_PNG: + case D3DX_IMAGE_FILE_FORMAT_JPG: if (src_fmt_desc == dst_fmt_desc) dst_pixels = *src_pixels; else @@ -979,24 +979,24 @@ struct d3dx_file_format_signature { const uint8_t *file_signature; uint32_t file_signature_len; - D3DXIMAGE_FILEFORMAT image_file_format; + enum d3dx_image_file_format image_file_format; }; static const struct d3dx_file_format_signature file_format_signatures[] = { - { bmp_file_signature, sizeof(bmp_file_signature), D3DXIFF_BMP }, - { jpg_file_signature, sizeof(jpg_file_signature), D3DXIFF_JPG }, - { png_file_signature, sizeof(png_file_signature), D3DXIFF_PNG }, - { dds_file_signature, sizeof(dds_file_signature), D3DXIFF_DDS }, - { ppm_plain_file_signature, sizeof(ppm_plain_file_signature), D3DXIFF_PPM }, - { ppm_raw_file_signature, sizeof(ppm_raw_file_signature), D3DXIFF_PPM }, - { hdr_file_signature, sizeof(hdr_file_signature), D3DXIFF_HDR }, - { pfm_color_file_signature, sizeof(pfm_color_file_signature), D3DXIFF_PFM }, - { pfm_gray_file_signature, sizeof(pfm_gray_file_signature), D3DXIFF_PFM }, + { bmp_file_signature, sizeof(bmp_file_signature), D3DX_IMAGE_FILE_FORMAT_BMP }, + { jpg_file_signature, sizeof(jpg_file_signature), D3DX_IMAGE_FILE_FORMAT_JPG }, + { png_file_signature, sizeof(png_file_signature), D3DX_IMAGE_FILE_FORMAT_PNG }, + { dds_file_signature, sizeof(dds_file_signature), D3DX_IMAGE_FILE_FORMAT_DDS }, + { ppm_plain_file_signature, sizeof(ppm_plain_file_signature), D3DX_IMAGE_FILE_FORMAT_PPM }, + { ppm_raw_file_signature, sizeof(ppm_raw_file_signature), D3DX_IMAGE_FILE_FORMAT_PPM }, + { hdr_file_signature, sizeof(hdr_file_signature), D3DX_IMAGE_FILE_FORMAT_HDR }, + { pfm_color_file_signature, sizeof(pfm_color_file_signature), D3DX_IMAGE_FILE_FORMAT_PFM }, + { pfm_gray_file_signature, sizeof(pfm_gray_file_signature), D3DX_IMAGE_FILE_FORMAT_PFM }, }; static BOOL d3dx_get_image_file_format_from_file_signature(const void *src_data, uint32_t src_data_size, - D3DXIMAGE_FILEFORMAT *out_iff) + enum d3dx_image_file_format *out_iff) { unsigned int i; @@ -1073,7 +1073,7 @@ static HRESULT d3dx_initialize_image_from_dds(const void *src_data, uint32_t src image->palette = (is_indexed_fmt) ? (PALETTEENTRY *)(((uint8_t *)src_data) + sizeof(*header)) : NULL; image->pixels = ((BYTE *)src_data) + header_size; - image->image_file_format = D3DXIFF_DDS; + image->image_file_format = D3DX_IMAGE_FILE_FORMAT_DDS; if (starting_mip_level && (image->mip_levels > 1)) { uint32_t i, row_pitch, slice_pitch, initial_mip_levels; @@ -1173,7 +1173,7 @@ static BOOL image_is_argb(IWICBitmapFrameDecode *frame, struct d3dx_image *image BYTE *buffer; HRESULT hr; - if (image->format != D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM || image->image_file_format != D3DXIFF_BMP) + if (image->format != D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM || image->image_file_format != D3DX_IMAGE_FILE_FORMAT_BMP) return FALSE; size = image->size.width * image->size.height * 4; @@ -1200,20 +1200,20 @@ static BOOL image_is_argb(IWICBitmapFrameDecode *frame, struct d3dx_image *image return FALSE; } -const char *debug_d3dx_image_file_format(D3DXIMAGE_FILEFORMAT format) +const char *debug_d3dx_image_file_format(enum d3dx_image_file_format format) { switch (format) { #define FMT_TO_STR(format) case format: return #format - FMT_TO_STR(D3DXIFF_BMP); - FMT_TO_STR(D3DXIFF_JPG); - FMT_TO_STR(D3DXIFF_TGA); - FMT_TO_STR(D3DXIFF_PNG); - FMT_TO_STR(D3DXIFF_DDS); - FMT_TO_STR(D3DXIFF_PPM); - FMT_TO_STR(D3DXIFF_DIB); - FMT_TO_STR(D3DXIFF_HDR); - FMT_TO_STR(D3DXIFF_PFM); + FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_BMP); + FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_JPG); + FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_TGA); + FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_PNG); + FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_DDS); + FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_PPM); + FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_DIB); + FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_HDR); + FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_PFM); #undef FMT_TO_STR default: return "unrecognized"; @@ -1301,7 +1301,7 @@ static HRESULT d3dx_image_wic_frame_decode(struct d3dx_image *image, } static HRESULT d3dx_initialize_image_from_wic(const void *src_data, uint32_t src_data_size, - struct d3dx_image *image, D3DXIMAGE_FILEFORMAT d3dx_file_format, uint32_t flags) + struct d3dx_image *image, enum d3dx_image_file_format d3dx_file_format, uint32_t flags) { const GUID *container_format_guid = wic_container_guid_from_d3dx_file_format(d3dx_file_format); IWICBitmapFrameDecode *bitmap_frame = NULL; @@ -1614,7 +1614,7 @@ static HRESULT d3dx_initialize_image_from_tga(const void *src_data, uint32_t src image->mip_levels = 1; image->layer_count = 1; image->resource_type = D3DX_RESOURCE_TYPE_TEXTURE_2D; - image->image_file_format = D3DXIFF_TGA; + image->image_file_format = D3DX_IMAGE_FILE_FORMAT_TGA; if (!(flags & D3DX_IMAGE_INFO_ONLY)) return d3dx_image_tga_decode(src_data, src_data_size, expected_header_size, image); @@ -1625,7 +1625,7 @@ static HRESULT d3dx_initialize_image_from_tga(const void *src_data, uint32_t src HRESULT d3dx_image_init(const void *src_data, uint32_t src_data_size, struct d3dx_image *image, uint32_t starting_mip_level, uint32_t flags) { - D3DXIMAGE_FILEFORMAT iff = D3DXIFF_FORCE_DWORD; + enum d3dx_image_file_format iff = D3DX_IMAGE_FILE_FORMAT_FORCE_DWORD; HRESULT hr; if (!src_data || !src_data_size || !image) @@ -1642,7 +1642,7 @@ HRESULT d3dx_image_init(const void *src_data, uint32_t src_data_size, struct d3d hr = d3dx_image_init(src_image, src_image_size, image, starting_mip_level, flags); free((void *)src_image); if (SUCCEEDED(hr)) - image->image_file_format = D3DXIFF_DIB; + image->image_file_format = D3DX_IMAGE_FILE_FORMAT_DIB; return hr; } @@ -1652,24 +1652,24 @@ HRESULT d3dx_image_init(const void *src_data, uint32_t src_data_size, struct d3d switch (iff) { - case D3DXIFF_BMP: - case D3DXIFF_JPG: - case D3DXIFF_PNG: + case D3DX_IMAGE_FILE_FORMAT_BMP: + case D3DX_IMAGE_FILE_FORMAT_JPG: + case D3DX_IMAGE_FILE_FORMAT_PNG: hr = d3dx_initialize_image_from_wic(src_data, src_data_size, image, iff, flags); break; - case D3DXIFF_DDS: + case D3DX_IMAGE_FILE_FORMAT_DDS: hr = d3dx_initialize_image_from_dds(src_data, src_data_size, image, starting_mip_level); break; - case D3DXIFF_PPM: - case D3DXIFF_HDR: - case D3DXIFF_PFM: + case D3DX_IMAGE_FILE_FORMAT_PPM: + case D3DX_IMAGE_FILE_FORMAT_HDR: + case D3DX_IMAGE_FILE_FORMAT_PFM: WARN("Unsupported file format %s.\n", debug_d3dx_image_file_format(iff)); hr = E_NOTIMPL; break; - case D3DXIFF_FORCE_DWORD: + case D3DX_IMAGE_FILE_FORMAT_FORCE_DWORD: ERR("Unrecognized file format.\n"); hr = D3DXERR_INVALIDDATA; break; @@ -1733,7 +1733,7 @@ HRESULT d3dx_image_get_pixels(struct d3dx_image *image, uint32_t layer, uint32_t void d3dximage_info_from_d3dx_image(D3DXIMAGE_INFO *info, struct d3dx_image *image) { - info->ImageFileFormat = image->image_file_format; + info->ImageFileFormat = (D3DXIMAGE_FILEFORMAT)image->image_file_format; info->Width = image->size.width; info->Height = image->size.height; info->Depth = image->size.depth; @@ -3483,7 +3483,8 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE case D3DXIFF_HDR: case D3DXIFF_PFM: case D3DXIFF_PPM: - FIXME("File format %s is not supported yet.\n", debug_d3dx_image_file_format(file_format)); + FIXME("File format %s is not supported yet.\n", + debug_d3dx_image_file_format((enum d3dx_image_file_format)file_format)); return E_NOTIMPL; default: @@ -3533,7 +3534,7 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE return hr; } - hr = d3dx_save_pixels_to_memory(&src_pixels, src_fmt_desc, file_format, dst_fmt, &buffer); + hr = d3dx_save_pixels_to_memory(&src_pixels, src_fmt_desc, (enum d3dx_image_file_format)file_format, dst_fmt, &buffer); if (FAILED(hr)) { unlock_surface(src_surface, NULL, temp_surface, FALSE); diff --git a/dlls/d3dx9_36/volume.c b/dlls/d3dx9_36/volume.c index 488e937d108a..f5922b856abd 100644 --- a/dlls/d3dx9_36/volume.c +++ b/dlls/d3dx9_36/volume.c @@ -305,7 +305,8 @@ HRESULT WINAPI D3DXSaveVolumeToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE_ case D3DXIFF_HDR: case D3DXIFF_PFM: case D3DXIFF_PPM: - FIXME("File format %s is not supported yet.\n", debug_d3dx_image_file_format(file_format)); + FIXME("File format %s is not supported yet.\n", + debug_d3dx_image_file_format((enum d3dx_image_file_format)file_format)); return E_NOTIMPL; default: @@ -358,7 +359,7 @@ HRESULT WINAPI D3DXSaveVolumeToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE_ (src_box_aligned.Right - src_box_aligned.Left), (src_box_aligned.Bottom - src_box_aligned.Top), (src_box_aligned.Back - src_box_aligned.Front), &src_rect_unaligned); - hr = d3dx_save_pixels_to_memory(&src_pixels, src_fmt_desc, file_format, dst_fmt, &buffer); + hr = d3dx_save_pixels_to_memory(&src_pixels, src_fmt_desc, (enum d3dx_image_file_format)file_format, dst_fmt, &buffer); if (FAILED(hr)) { IDirect3DVolume9_UnlockBox(src_volume); From 8204c3078676497dc0a15fb999953e80d1b68d73 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Tue, 10 Dec 2024 11:35:47 -0500 Subject: [PATCH 0925/2542] d3dx9: Move functions intended for code sharing into a separate source file. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_24/Makefile.in | 3 +- dlls/d3dx9_25/Makefile.in | 3 +- dlls/d3dx9_26/Makefile.in | 3 +- dlls/d3dx9_27/Makefile.in | 3 +- dlls/d3dx9_28/Makefile.in | 3 +- dlls/d3dx9_29/Makefile.in | 3 +- dlls/d3dx9_30/Makefile.in | 3 +- dlls/d3dx9_31/Makefile.in | 3 +- dlls/d3dx9_32/Makefile.in | 3 +- dlls/d3dx9_33/Makefile.in | 3 +- dlls/d3dx9_34/Makefile.in | 3 +- dlls/d3dx9_35/Makefile.in | 3 +- dlls/d3dx9_36/Makefile.in | 3 +- dlls/d3dx9_36/d3dx9_private.h | 366 +--- dlls/d3dx9_36/d3dx_helpers.c | 2620 ++++++++++++++++++++++++++++ dlls/d3dx9_36/d3dx_helpers.h | 408 +++++ dlls/d3dx9_36/math.c | 105 -- dlls/d3dx9_36/surface.c | 3053 ++++----------------------------- dlls/d3dx9_36/util.c | 67 +- dlls/d3dx9_37/Makefile.in | 3 +- dlls/d3dx9_38/Makefile.in | 3 +- dlls/d3dx9_39/Makefile.in | 3 +- dlls/d3dx9_40/Makefile.in | 3 +- dlls/d3dx9_41/Makefile.in | 3 +- dlls/d3dx9_42/Makefile.in | 3 +- dlls/d3dx9_43/Makefile.in | 3 +- 26 files changed, 3381 insertions(+), 3298 deletions(-) create mode 100644 dlls/d3dx9_36/d3dx_helpers.c create mode 100644 dlls/d3dx9_36/d3dx_helpers.h diff --git a/dlls/d3dx9_24/Makefile.in b/dlls/d3dx9_24/Makefile.in index 8721e84b086e..e31a7b5d9062 100644 --- a/dlls/d3dx9_24/Makefile.in +++ b/dlls/d3dx9_24/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=24 +EXTRADEFS = -DD3DX_SDK_VERSION=24 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_24.dll IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 PARENTSRC = ../d3dx9_36 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_25/Makefile.in b/dlls/d3dx9_25/Makefile.in index 24ab7dd8a59f..9f44734e01d4 100644 --- a/dlls/d3dx9_25/Makefile.in +++ b/dlls/d3dx9_25/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=25 +EXTRADEFS = -DD3DX_SDK_VERSION=25 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_25.dll IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 PARENTSRC = ../d3dx9_36 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_26/Makefile.in b/dlls/d3dx9_26/Makefile.in index 849716fba8b2..f2c40f300c0f 100644 --- a/dlls/d3dx9_26/Makefile.in +++ b/dlls/d3dx9_26/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=26 +EXTRADEFS = -DD3DX_SDK_VERSION=26 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_26.dll IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 PARENTSRC = ../d3dx9_36 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_27/Makefile.in b/dlls/d3dx9_27/Makefile.in index 5788af37647d..d81e5d72fd98 100644 --- a/dlls/d3dx9_27/Makefile.in +++ b/dlls/d3dx9_27/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=27 +EXTRADEFS = -DD3DX_SDK_VERSION=27 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_27.dll IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 PARENTSRC = ../d3dx9_36 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_28/Makefile.in b/dlls/d3dx9_28/Makefile.in index 6d87622a0504..76cba4e34991 100644 --- a/dlls/d3dx9_28/Makefile.in +++ b/dlls/d3dx9_28/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=28 +EXTRADEFS = -DD3DX_SDK_VERSION=28 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_28.dll IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 PARENTSRC = ../d3dx9_36 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_29/Makefile.in b/dlls/d3dx9_29/Makefile.in index 701cfb9f12f4..6640a0a362b0 100644 --- a/dlls/d3dx9_29/Makefile.in +++ b/dlls/d3dx9_29/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=29 +EXTRADEFS = -DD3DX_SDK_VERSION=29 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_29.dll IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 PARENTSRC = ../d3dx9_36 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_30/Makefile.in b/dlls/d3dx9_30/Makefile.in index 01cd40d50dff..b7f660826b94 100644 --- a/dlls/d3dx9_30/Makefile.in +++ b/dlls/d3dx9_30/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=30 +EXTRADEFS = -DD3DX_SDK_VERSION=30 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_30.dll IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 PARENTSRC = ../d3dx9_36 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_31/Makefile.in b/dlls/d3dx9_31/Makefile.in index f912e9e53d5d..0330f434f210 100644 --- a/dlls/d3dx9_31/Makefile.in +++ b/dlls/d3dx9_31/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=31 +EXTRADEFS = -DD3DX_SDK_VERSION=31 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_31.dll IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 PARENTSRC = ../d3dx9_36 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_32/Makefile.in b/dlls/d3dx9_32/Makefile.in index 9a4cce0924c6..eac9ef320e62 100644 --- a/dlls/d3dx9_32/Makefile.in +++ b/dlls/d3dx9_32/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=32 +EXTRADEFS = -DD3DX_SDK_VERSION=32 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_32.dll IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 PARENTSRC = ../d3dx9_36 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_33/Makefile.in b/dlls/d3dx9_33/Makefile.in index 0882c1892d88..192edee7153c 100644 --- a/dlls/d3dx9_33/Makefile.in +++ b/dlls/d3dx9_33/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=33 +EXTRADEFS = -DD3DX_SDK_VERSION=33 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_33.dll IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 PARENTSRC = ../d3dx9_36 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_34/Makefile.in b/dlls/d3dx9_34/Makefile.in index a7716466b5d4..fa562330ddf2 100644 --- a/dlls/d3dx9_34/Makefile.in +++ b/dlls/d3dx9_34/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=34 +EXTRADEFS = -DD3DX_SDK_VERSION=34 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_34.dll IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 PARENTSRC = ../d3dx9_36 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_35/Makefile.in b/dlls/d3dx9_35/Makefile.in index a1209bbafec6..84e025f662d8 100644 --- a/dlls/d3dx9_35/Makefile.in +++ b/dlls/d3dx9_35/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=35 +EXTRADEFS = -DD3DX_SDK_VERSION=35 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_35.dll IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 PARENTSRC = ../d3dx9_36 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_36/Makefile.in b/dlls/d3dx9_36/Makefile.in index bda2b68d60e1..c9450144edf3 100644 --- a/dlls/d3dx9_36/Makefile.in +++ b/dlls/d3dx9_36/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=36 +EXTRADEFS = -DD3DX_SDK_VERSION=36 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_36.dll IMPORTLIB = d3dx9 IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_36/d3dx9_private.h b/dlls/d3dx9_36/d3dx9_private.h index a582188af2fb..fdc247f7aa16 100644 --- a/dlls/d3dx9_36/d3dx9_private.h +++ b/dlls/d3dx9_36/d3dx9_private.h @@ -25,9 +25,7 @@ #include #include "wine/debug.h" #include "wine/rbtree.h" - -#define COBJMACROS -#include "d3dx9.h" +#include "d3dx_helpers.h" #define ULONG64_MAX (~(ULONG64)0) @@ -50,286 +48,6 @@ static inline HRESULT d3dx9_handle_load_filter(DWORD *filter) return d3dx9_validate_filter(*filter); } -#define DDS_PALETTE_SIZE (sizeof(PALETTEENTRY) * 256) - -/* dds_header.flags */ -#define DDS_CAPS 0x1 -#define DDS_HEIGHT 0x2 -#define DDS_WIDTH 0x4 -#define DDS_PITCH 0x8 -#define DDS_PIXELFORMAT 0x1000 -#define DDS_MIPMAPCOUNT 0x20000 -#define DDS_LINEARSIZE 0x80000 -#define DDS_DEPTH 0x800000 - -/* dds_header.caps */ -#define DDSCAPS_ALPHA 0x2 -#define DDS_CAPS_COMPLEX 0x8 -#define DDSCAPS_PALETTE 0x100 -#define DDS_CAPS_TEXTURE 0x1000 -#define DDS_CAPS_MIPMAP 0x400000 - -/* dds_header.caps2 */ -#define DDS_CAPS2_CUBEMAP 0x200 -#define DDS_CAPS2_CUBEMAP_POSITIVEX 0x400 -#define DDS_CAPS2_CUBEMAP_NEGATIVEX 0x800 -#define DDS_CAPS2_CUBEMAP_POSITIVEY 0x1000 -#define DDS_CAPS2_CUBEMAP_NEGATIVEY 0x2000 -#define DDS_CAPS2_CUBEMAP_POSITIVEZ 0x4000 -#define DDS_CAPS2_CUBEMAP_NEGATIVEZ 0x8000 -#define DDS_CAPS2_CUBEMAP_ALL_FACES ( DDS_CAPS2_CUBEMAP_POSITIVEX | DDS_CAPS2_CUBEMAP_NEGATIVEX \ - | DDS_CAPS2_CUBEMAP_POSITIVEY | DDS_CAPS2_CUBEMAP_NEGATIVEY \ - | DDS_CAPS2_CUBEMAP_POSITIVEZ | DDS_CAPS2_CUBEMAP_NEGATIVEZ ) -#define DDS_CAPS2_VOLUME 0x200000 - -/* dds_pixel_format.flags */ -#define DDS_PF_ALPHA 0x1 -#define DDS_PF_ALPHA_ONLY 0x2 -#define DDS_PF_FOURCC 0x4 -#define DDS_PF_INDEXED 0x20 -#define DDS_PF_RGB 0x40 -#define DDS_PF_YUV 0x200 -#define DDS_PF_LUMINANCE 0x20000 -#define DDS_PF_BUMPLUMINANCE 0x40000 -#define DDS_PF_BUMPDUDV 0x80000 - -struct dds_pixel_format -{ - DWORD size; - DWORD flags; - DWORD fourcc; - DWORD bpp; - DWORD rmask; - DWORD gmask; - DWORD bmask; - DWORD amask; -}; - -struct dds_header -{ - DWORD signature; - DWORD size; - DWORD flags; - DWORD height; - DWORD width; - DWORD pitch_or_linear_size; - DWORD depth; - DWORD miplevels; - DWORD reserved[11]; - struct dds_pixel_format pixel_format; - DWORD caps; - DWORD caps2; - DWORD caps3; - DWORD caps4; - DWORD reserved2; -}; - -/* These are custom Wine only filter flags. */ -#define D3DX_FILTER_PMA_IN 0x00800000 -#define D3DX_FILTER_PMA_OUT 0x01000000 -#define D3DX_FILTER_PMA 0x01800000 - -struct vec4 -{ - float x, y, z, w; -}; - -enum range { - RANGE_FULL = 0, - RANGE_UNORM = 1, - RANGE_SNORM = 2, -}; - -struct d3dx_color -{ - struct vec4 value; - enum range rgb_range; - enum range a_range; -}; - -static inline void set_d3dx_color(struct d3dx_color *color, const struct vec4 *value, enum range rgb_range, - enum range a_range) -{ - color->value = *value; - color->rgb_range = rgb_range; - color->a_range = a_range; -} - -struct volume -{ - UINT width; - UINT height; - UINT depth; -}; - -static inline void set_volume_struct(struct volume *volume, uint32_t width, uint32_t height, uint32_t depth) -{ - volume->width = width; - volume->height = height; - volume->depth = depth; -} - -enum d3dx_image_file_format -{ - D3DX_IMAGE_FILE_FORMAT_BMP = 0, - D3DX_IMAGE_FILE_FORMAT_JPG = 1, - D3DX_IMAGE_FILE_FORMAT_TGA = 2, - D3DX_IMAGE_FILE_FORMAT_PNG = 3, - D3DX_IMAGE_FILE_FORMAT_DDS = 4, - D3DX_IMAGE_FILE_FORMAT_PPM = 5, - D3DX_IMAGE_FILE_FORMAT_DIB = 6, - D3DX_IMAGE_FILE_FORMAT_HDR = 7, - D3DX_IMAGE_FILE_FORMAT_PFM = 8, - D3DX_IMAGE_FILE_FORMAT_FORCE_DWORD = 0x7fffffff -}; - -enum d3dx_resource_type -{ - D3DX_RESOURCE_TYPE_TEXTURE_2D, - D3DX_RESOURCE_TYPE_TEXTURE_3D, - D3DX_RESOURCE_TYPE_CUBE_TEXTURE, - D3DX_RESOURCE_TYPE_COUNT, -}; - -/* These values act as indexes into the pixel_format_desc table. */ -enum d3dx_pixel_format_id -{ - D3DX_PIXEL_FORMAT_B8G8R8_UNORM, - D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM, - D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM, - D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM, - D3DX_PIXEL_FORMAT_R8G8B8X8_UNORM, - D3DX_PIXEL_FORMAT_B5G6R5_UNORM, - D3DX_PIXEL_FORMAT_B5G5R5X1_UNORM, - D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM, - D3DX_PIXEL_FORMAT_B2G3R3_UNORM, - D3DX_PIXEL_FORMAT_B2G3R3A8_UNORM, - D3DX_PIXEL_FORMAT_B4G4R4A4_UNORM, - D3DX_PIXEL_FORMAT_B4G4R4X4_UNORM, - D3DX_PIXEL_FORMAT_B10G10R10A2_UNORM, - D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM, - D3DX_PIXEL_FORMAT_R16G16B16_UNORM, - D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM, - D3DX_PIXEL_FORMAT_R16G16_UNORM, - D3DX_PIXEL_FORMAT_A8_UNORM, - D3DX_PIXEL_FORMAT_L8A8_UNORM, - D3DX_PIXEL_FORMAT_L4A4_UNORM, - D3DX_PIXEL_FORMAT_L8_UNORM, - D3DX_PIXEL_FORMAT_L16_UNORM, - D3DX_PIXEL_FORMAT_DXT1_UNORM, - D3DX_PIXEL_FORMAT_DXT2_UNORM, - D3DX_PIXEL_FORMAT_DXT3_UNORM, - D3DX_PIXEL_FORMAT_DXT4_UNORM, - D3DX_PIXEL_FORMAT_DXT5_UNORM, - D3DX_PIXEL_FORMAT_R16_FLOAT, - D3DX_PIXEL_FORMAT_R16G16_FLOAT, - D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT, - D3DX_PIXEL_FORMAT_R32_FLOAT, - D3DX_PIXEL_FORMAT_R32G32_FLOAT, - D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT, - D3DX_PIXEL_FORMAT_P8_UINT, - D3DX_PIXEL_FORMAT_P8_UINT_A8_UNORM, - D3DX_PIXEL_FORMAT_U8V8W8Q8_SNORM, - D3DX_PIXEL_FORMAT_U16V16W16Q16_SNORM, - D3DX_PIXEL_FORMAT_U8V8_SNORM, - D3DX_PIXEL_FORMAT_U16V16_SNORM, - D3DX_PIXEL_FORMAT_U8V8_SNORM_L8X8_UNORM, - D3DX_PIXEL_FORMAT_U10V10W10_SNORM_A2_UNORM, - D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM, - D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM, - D3DX_PIXEL_FORMAT_UYVY, - D3DX_PIXEL_FORMAT_YUY2, - D3DX_PIXEL_FORMAT_COUNT, -}; - -/* for internal use */ -enum component_type -{ - CTYPE_EMPTY, - CTYPE_UNORM, - CTYPE_SNORM, - CTYPE_FLOAT, - CTYPE_LUMA, - CTYPE_INDEX, -}; - -enum format_flag -{ - FMT_FLAG_DXT = 0x01, - FMT_FLAG_PACKED = 0x02, - /* Internal only format, has no exact D3DFORMAT equivalent. */ - FMT_FLAG_INTERNAL = 0x04, - FMT_FLAG_PM_ALPHA = 0x08, -}; - -struct pixel_format_desc { - enum d3dx_pixel_format_id format; - BYTE bits[4]; - BYTE shift[4]; - UINT bytes_per_pixel; - UINT block_width; - UINT block_height; - UINT block_byte_count; - enum component_type a_type; - enum component_type rgb_type; - uint32_t flags; -}; - -struct d3dx_pixels -{ - const void *data; - uint32_t row_pitch; - uint32_t slice_pitch; - const PALETTEENTRY *palette; - - struct volume size; - RECT unaligned_rect; -}; - -static inline void set_d3dx_pixels(struct d3dx_pixels *pixels, const void *data, uint32_t row_pitch, - uint32_t slice_pitch, const PALETTEENTRY *palette, uint32_t width, uint32_t height, uint32_t depth, - const RECT *unaligned_rect) -{ - pixels->data = data; - pixels->row_pitch = row_pitch; - pixels->slice_pitch = slice_pitch; - pixels->palette = palette; - set_volume_struct(&pixels->size, width, height, depth); - pixels->unaligned_rect = *unaligned_rect; -} - -#define D3DX_IMAGE_INFO_ONLY 1 -struct d3dx_image -{ - enum d3dx_resource_type resource_type; - enum d3dx_pixel_format_id format; - - struct volume size; - uint32_t mip_levels; - uint32_t layer_count; - - BYTE *pixels; - PALETTEENTRY *palette; - uint32_t layer_pitch; - - /* - * image_buf and image_palette are pointers to allocated memory used to store - * image data. If they are non-NULL, they need to be freed when no longer - * in use. - */ - void *image_buf; - PALETTEENTRY *image_palette; - - enum d3dx_image_file_format image_file_format; -}; - -HRESULT d3dx_image_init(const void *src_data, uint32_t src_data_size, struct d3dx_image *image, - uint32_t starting_mip_level, uint32_t flags); -void d3dx_image_cleanup(struct d3dx_image *image); -HRESULT d3dx_image_get_pixels(struct d3dx_image *image, uint32_t layer, uint32_t mip_level, - struct d3dx_pixels *pixels); -void d3dximage_info_from_d3dx_image(D3DXIMAGE_INFO *info, struct d3dx_image *image); - struct d3dx_include_from_file { ID3DXInclude ID3DXInclude_iface; @@ -338,63 +56,6 @@ struct d3dx_include_from_file extern CRITICAL_SECTION from_file_mutex; extern const struct ID3DXIncludeVtbl d3dx_include_from_file_vtbl; -static inline BOOL is_unknown_format(const struct pixel_format_desc *format) -{ - return (format->format == D3DX_PIXEL_FORMAT_COUNT); -} - -static inline BOOL is_index_format(const struct pixel_format_desc *format) -{ - return (format->a_type == CTYPE_INDEX || format->rgb_type == CTYPE_INDEX); -} - -static inline BOOL is_compressed_format(const struct pixel_format_desc *format) -{ - return !!(format->flags & FMT_FLAG_DXT); -} - -static inline BOOL is_packed_format(const struct pixel_format_desc *format) -{ - return !!(format->flags & FMT_FLAG_PACKED); -} - -static inline BOOL format_types_match(const struct pixel_format_desc *src, const struct pixel_format_desc *dst) -{ - if ((src->a_type && dst->a_type) && (src->a_type != dst->a_type)) - return FALSE; - - if ((src->rgb_type && dst->rgb_type) && (src->rgb_type != dst->rgb_type)) - return FALSE; - - if (src->flags != dst->flags) - return FALSE; - - return (src->rgb_type == dst->rgb_type || src->a_type == dst->a_type); -} - -static inline BOOL is_internal_format(const struct pixel_format_desc *format) -{ - return !!(format->flags & FMT_FLAG_INTERNAL); -} - -static inline BOOL filter_flags_match(uint32_t filter_flags) -{ - if (!!(filter_flags & D3DX_FILTER_PMA_IN) != !!((filter_flags & D3DX_FILTER_PMA_OUT))) - return FALSE; - - return TRUE; -} - -static inline BOOL is_conversion_from_supported(const struct pixel_format_desc *format) -{ - return !is_packed_format(format) && !is_unknown_format(format); -} - -static inline BOOL is_conversion_to_supported(const struct pixel_format_desc *format) -{ - return !is_index_format(format) && !is_packed_format(format) && !is_unknown_format(format); -} - HRESULT map_view_of_file(const WCHAR *filename, void **buffer, DWORD *length); HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, void **buffer, DWORD *length); @@ -403,41 +64,18 @@ HRESULT write_buffer_to_file(const WCHAR *filename, ID3DXBuffer *buffer); D3DFORMAT d3dformat_from_d3dx_pixel_format_id(enum d3dx_pixel_format_id format); enum d3dx_pixel_format_id d3dx_pixel_format_id_from_d3dformat(D3DFORMAT format); enum d3dx_resource_type d3dx_resource_type_from_d3dresourcetype(D3DRESOURCETYPE type); -const struct pixel_format_desc *get_d3dx_pixel_format_info(enum d3dx_pixel_format_id format); const struct pixel_format_desc *get_format_info(D3DFORMAT format); const struct pixel_format_desc *get_format_info_idx(int idx); -void format_to_d3dx_color(const struct pixel_format_desc *format, const BYTE *src, const PALETTEENTRY *palette, - struct d3dx_color *dst); -void format_from_d3dx_color(const struct pixel_format_desc *format, const struct d3dx_color *src, BYTE *dst); - - HRESULT lock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, D3DLOCKED_RECT *lock, IDirect3DSurface9 **temp_surface, BOOL write); HRESULT unlock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, IDirect3DSurface9 *temp_surface, BOOL update); -uint32_t d3dx_calculate_layer_pixels_size(enum d3dx_pixel_format_id format, uint32_t width, uint32_t height, uint32_t depth, - uint32_t mip_levels); HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pixel_format_desc *src_fmt_desc, D3DXIMAGE_FILEFORMAT file_format, enum d3dx_pixel_format_id *save_fmt); -HRESULT d3dx_init_dds_header(struct dds_header *header, enum d3dx_resource_type resource_type, - enum d3dx_pixel_format_id format, const struct volume *size, uint32_t mip_levels); -HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct pixel_format_desc *src_fmt_desc, - enum d3dx_image_file_format file_format, enum d3dx_pixel_format_id dst_format, ID3DXBuffer **dst_buffer); -HRESULT d3dx_pixels_init(const void *data, uint32_t row_pitch, uint32_t slice_pitch, - const PALETTEENTRY *palette, enum d3dx_pixel_format_id format, uint32_t left, uint32_t top, uint32_t right, - uint32_t bottom, uint32_t front, uint32_t back, struct d3dx_pixels *pixels); -HRESULT d3dx_load_pixels_from_pixels(struct d3dx_pixels *dst_pixels, - const struct pixel_format_desc *dst_desc, struct d3dx_pixels *src_pixels, - const struct pixel_format_desc *src_desc, uint32_t filter_flags, uint32_t color_key); -void get_aligned_rect(uint32_t left, uint32_t top, uint32_t right, uint32_t bottom, uint32_t width, uint32_t height, - const struct pixel_format_desc *fmt_desc, RECT *aligned_rect); - -unsigned short float_32_to_16(const float in); -float float_16_to_32(const unsigned short in); +void d3dximage_info_from_d3dx_image(D3DXIMAGE_INFO *info, struct d3dx_image *image); /* debug helpers */ -const char *debug_d3dx_image_file_format(enum d3dx_image_file_format format); const char *debug_d3dxparameter_class(D3DXPARAMETER_CLASS c); const char *debug_d3dxparameter_type(D3DXPARAMETER_TYPE t); const char *debug_d3dxparameter_registerset(D3DXREGISTER_SET r); diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c new file mode 100644 index 000000000000..4624868d181a --- /dev/null +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -0,0 +1,2620 @@ +/* + * Copyright 2024 Connor McAdams for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#include "wine/debug.h" +#include "d3dx_helpers.h" + +#include "initguid.h" +#include "ole2.h" +#include "wincodec.h" + +#define BCDEC_IMPLEMENTATION +#include "bcdec.h" +#define STB_DXT_IMPLEMENTATION +#include "stb_dxt.h" +#include + +WINE_DEFAULT_DEBUG_CHANNEL(d3dx); + +HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT, IWICImagingFactory**); + +/************************************************************ + * pixel format table providing info about number of bytes per pixel, + * number of bits per channel and format type. + * + * Call get_format_info to request information about a specific format. + */ +static const struct pixel_format_desc formats[] = +{ + /* format bpc shifts bpp blocks alpha type rgb type flags */ + {D3DX_PIXEL_FORMAT_B8G8R8_UNORM, { 0, 8, 8, 8}, { 0, 16, 8, 0}, 3, 1, 1, 3, CTYPE_EMPTY, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM, { 8, 8, 8, 8}, {24, 16, 8, 0}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM, { 0, 8, 8, 8}, { 0, 16, 8, 0}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM, { 8, 8, 8, 8}, {24, 0, 8, 16}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_R8G8B8X8_UNORM, { 0, 8, 8, 8}, { 0, 0, 8, 16}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_B5G6R5_UNORM, { 0, 5, 6, 5}, { 0, 11, 5, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_B5G5R5X1_UNORM, { 0, 5, 5, 5}, { 0, 10, 5, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM, { 1, 5, 5, 5}, {15, 10, 5, 0}, 2, 1, 1, 2, CTYPE_UNORM, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_B2G3R3_UNORM, { 0, 3, 3, 2}, { 0, 5, 2, 0}, 1, 1, 1, 1, CTYPE_EMPTY, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_B2G3R3A8_UNORM, { 8, 3, 3, 2}, { 8, 5, 2, 0}, 2, 1, 1, 2, CTYPE_UNORM, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_B4G4R4A4_UNORM, { 4, 4, 4, 4}, {12, 8, 4, 0}, 2, 1, 1, 2, CTYPE_UNORM, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_B4G4R4X4_UNORM, { 0, 4, 4, 4}, { 0, 8, 4, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_B10G10R10A2_UNORM, { 2, 10, 10, 10}, {30, 20, 10, 0}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM, { 2, 10, 10, 10}, {30, 0, 10, 20}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_R16G16B16_UNORM, { 0, 16, 16, 16}, { 0, 0, 16, 32}, 6, 1, 1, 6, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_INTERNAL}, + {D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM, {16, 16, 16, 16}, {48, 0, 16, 32}, 8, 1, 1, 8, CTYPE_UNORM, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_R16G16_UNORM, { 0, 16, 16, 0}, { 0, 0, 16, 0}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_A8_UNORM, { 8, 0, 0, 0}, { 0, 0, 0, 0}, 1, 1, 1, 1, CTYPE_UNORM, CTYPE_EMPTY, 0 }, + {D3DX_PIXEL_FORMAT_L8A8_UNORM, { 8, 8, 0, 0}, { 8, 0, 0, 0}, 2, 1, 1, 2, CTYPE_UNORM, CTYPE_LUMA, 0 }, + {D3DX_PIXEL_FORMAT_L4A4_UNORM, { 4, 4, 0, 0}, { 4, 0, 0, 0}, 1, 1, 1, 1, CTYPE_UNORM, CTYPE_LUMA, 0 }, + {D3DX_PIXEL_FORMAT_L8_UNORM, { 0, 8, 0, 0}, { 0, 0, 0, 0}, 1, 1, 1, 1, CTYPE_EMPTY, CTYPE_LUMA, 0 }, + {D3DX_PIXEL_FORMAT_L16_UNORM, { 0, 16, 0, 0}, { 0, 0, 0, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_LUMA, 0 }, + {D3DX_PIXEL_FORMAT_DXT1_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 8, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT}, + {D3DX_PIXEL_FORMAT_DXT2_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT | FMT_FLAG_PM_ALPHA}, + {D3DX_PIXEL_FORMAT_DXT3_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT}, + {D3DX_PIXEL_FORMAT_DXT4_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT | FMT_FLAG_PM_ALPHA}, + {D3DX_PIXEL_FORMAT_DXT5_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT}, + {D3DX_PIXEL_FORMAT_R16_FLOAT, { 0, 16, 0, 0}, { 0, 0, 0, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_FLOAT, 0 }, + {D3DX_PIXEL_FORMAT_R16G16_FLOAT, { 0, 16, 16, 0}, { 0, 0, 16, 0}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_FLOAT, 0 }, + {D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT, {16, 16, 16, 16}, {48, 0, 16, 32}, 8, 1, 1, 8, CTYPE_FLOAT, CTYPE_FLOAT, 0 }, + {D3DX_PIXEL_FORMAT_R32_FLOAT, { 0, 32, 0, 0}, { 0, 0, 0, 0}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_FLOAT, 0 }, + {D3DX_PIXEL_FORMAT_R32G32_FLOAT, { 0, 32, 32, 0}, { 0, 0, 32, 0}, 8, 1, 1, 8, CTYPE_EMPTY, CTYPE_FLOAT, 0 }, + {D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT, {32, 32, 32, 32}, {96, 0, 32, 64}, 16, 1, 1, 16, CTYPE_FLOAT, CTYPE_FLOAT, 0 }, + {D3DX_PIXEL_FORMAT_P8_UINT, { 8, 8, 8, 8}, { 0, 0, 0, 0}, 1, 1, 1, 1, CTYPE_INDEX, CTYPE_INDEX, 0 }, + {D3DX_PIXEL_FORMAT_P8_UINT_A8_UNORM, { 8, 8, 8, 8}, { 8, 0, 0, 0}, 2, 1, 1, 2, CTYPE_UNORM, CTYPE_INDEX, 0 }, + {D3DX_PIXEL_FORMAT_U8V8W8Q8_SNORM, { 8, 8, 8, 8}, {24, 0, 8, 16}, 4, 1, 1, 4, CTYPE_SNORM, CTYPE_SNORM, 0 }, + {D3DX_PIXEL_FORMAT_U16V16W16Q16_SNORM, {16, 16, 16, 16}, {48, 0, 16, 32}, 8, 1, 1, 8, CTYPE_SNORM, CTYPE_SNORM, 0 }, + {D3DX_PIXEL_FORMAT_U8V8_SNORM, { 0, 8, 8, 0}, { 0, 0, 8, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_SNORM, 0 }, + {D3DX_PIXEL_FORMAT_U16V16_SNORM, { 0, 16, 16, 0}, { 0, 0, 16, 0}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_SNORM, 0 }, + {D3DX_PIXEL_FORMAT_U8V8_SNORM_L8X8_UNORM, { 8, 8, 8, 0}, {16, 0, 8, 0}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_SNORM, 0 }, + {D3DX_PIXEL_FORMAT_U10V10W10_SNORM_A2_UNORM, { 2, 10, 10, 10}, {30, 0, 10, 20}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_SNORM, 0 }, + {D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 2, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_PACKED}, + {D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 2, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_PACKED}, + {D3DX_PIXEL_FORMAT_UYVY, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 2, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_PACKED}, + {D3DX_PIXEL_FORMAT_YUY2, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 2, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_PACKED}, + /* marks last element */ + {D3DX_PIXEL_FORMAT_COUNT, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 0, 1, 1, 0, CTYPE_EMPTY, CTYPE_EMPTY, 0 }, +}; + +const struct pixel_format_desc *get_d3dx_pixel_format_info(enum d3dx_pixel_format_id format) +{ + return &formats[min(format, D3DX_PIXEL_FORMAT_COUNT)]; +} + +static const struct +{ + const GUID *wic_guid; + enum d3dx_pixel_format_id d3dx_pixel_format; +} wic_pixel_formats[] = +{ + { &GUID_WICPixelFormat8bppIndexed, D3DX_PIXEL_FORMAT_P8_UINT }, + { &GUID_WICPixelFormat1bppIndexed, D3DX_PIXEL_FORMAT_P8_UINT }, + { &GUID_WICPixelFormat4bppIndexed, D3DX_PIXEL_FORMAT_P8_UINT }, + { &GUID_WICPixelFormat8bppGray, D3DX_PIXEL_FORMAT_L8_UNORM }, + { &GUID_WICPixelFormat16bppBGR555, D3DX_PIXEL_FORMAT_B5G5R5X1_UNORM }, + { &GUID_WICPixelFormat16bppBGR565, D3DX_PIXEL_FORMAT_B5G6R5_UNORM }, + { &GUID_WICPixelFormat24bppBGR, D3DX_PIXEL_FORMAT_B8G8R8_UNORM }, + { &GUID_WICPixelFormat32bppBGR, D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM }, + { &GUID_WICPixelFormat32bppBGRA, D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM }, + { &GUID_WICPixelFormat48bppRGB, D3DX_PIXEL_FORMAT_R16G16B16_UNORM }, + { &GUID_WICPixelFormat64bppRGBA, D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM }, +}; + +static enum d3dx_pixel_format_id d3dx_pixel_format_id_from_wic_pixel_format(const GUID *guid) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(wic_pixel_formats); i++) + { + if (IsEqualGUID(wic_pixel_formats[i].wic_guid, guid)) + return wic_pixel_formats[i].d3dx_pixel_format; + } + + return D3DX_PIXEL_FORMAT_COUNT; + +} + +static const GUID *wic_guid_from_d3dx_pixel_format_id(enum d3dx_pixel_format_id d3dx_pixel_format) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(wic_pixel_formats); i++) + { + if (wic_pixel_formats[i].d3dx_pixel_format == d3dx_pixel_format) + return wic_pixel_formats[i].wic_guid; + } + + return NULL; +} + +#define IMAGETYPE_COLORMAPPED 1 +#define IMAGETYPE_TRUECOLOR 2 +#define IMAGETYPE_GRAYSCALE 3 +#define IMAGETYPE_MASK 0x07 +#define IMAGETYPE_RLE 8 + +#define IMAGE_RIGHTTOLEFT 0x10 +#define IMAGE_TOPTOBOTTOM 0x20 + +#include "pshpack1.h" +struct tga_header +{ + uint8_t id_length; + uint8_t color_map_type; + uint8_t image_type; + uint16_t color_map_firstentry; + uint16_t color_map_length; + uint8_t color_map_entrysize; + uint16_t xorigin; + uint16_t yorigin; + uint16_t width; + uint16_t height; + uint8_t depth; + uint8_t image_descriptor; +}; +#include "poppack.h" + +static const struct +{ + struct dds_pixel_format dds_pixel_format; + enum d3dx_pixel_format_id d3dx_pixel_format; +} dds_pixel_formats[] = +{ + /* DDS_PF_FOURCC. */ + { { 32, DDS_PF_FOURCC, MAKEFOURCC('U','Y','V','Y') }, D3DX_PIXEL_FORMAT_UYVY }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('Y','U','Y','2') }, D3DX_PIXEL_FORMAT_YUY2 }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('R','G','B','G') }, D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('G','R','G','B') }, D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1') }, D3DX_PIXEL_FORMAT_DXT1_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','2') }, D3DX_PIXEL_FORMAT_DXT2_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','3') }, D3DX_PIXEL_FORMAT_DXT3_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','4') }, D3DX_PIXEL_FORMAT_DXT4_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','5') }, D3DX_PIXEL_FORMAT_DXT5_UNORM }, + /* These aren't actually fourcc values, they're just D3DFMT values. */ + { { 32, DDS_PF_FOURCC, 0x24 }, D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM }, + { { 32, DDS_PF_FOURCC, 0x6e }, D3DX_PIXEL_FORMAT_U16V16W16Q16_SNORM }, + { { 32, DDS_PF_FOURCC, 0x6f }, D3DX_PIXEL_FORMAT_R16_FLOAT }, + { { 32, DDS_PF_FOURCC, 0x70 }, D3DX_PIXEL_FORMAT_R16G16_FLOAT }, + { { 32, DDS_PF_FOURCC, 0x71 }, D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT }, + { { 32, DDS_PF_FOURCC, 0x72 }, D3DX_PIXEL_FORMAT_R32_FLOAT }, + { { 32, DDS_PF_FOURCC, 0x73 }, D3DX_PIXEL_FORMAT_R32G32_FLOAT }, + { { 32, DDS_PF_FOURCC, 0x74 }, D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT }, + /* DDS_PF_RGB. */ + { { 32, DDS_PF_RGB, 0, 8, 0xe0, 0x1c, 0x03, 0x00 }, D3DX_PIXEL_FORMAT_B2G3R3_UNORM }, + { { 32, DDS_PF_RGB, 0, 16, 0xf800, 0x07e0, 0x001f, 0x0000 }, D3DX_PIXEL_FORMAT_B5G6R5_UNORM }, + { { 32, DDS_PF_RGB, 0, 16, 0x7c00, 0x03e0, 0x001f, 0x0000 }, D3DX_PIXEL_FORMAT_B5G5R5X1_UNORM }, + { { 32, DDS_PF_RGB, 0, 16, 0x0f00, 0x00f0, 0x000f, 0x0000 }, D3DX_PIXEL_FORMAT_B4G4R4X4_UNORM }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, D3DX_PIXEL_FORMAT_B8G8R8_UNORM }, + { { 32, DDS_PF_RGB, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 }, D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM }, + { { 32, DDS_PF_RGB, 0, 32, 0x0000ffff, 0xffff0000, 0x00000000, 0x00000000 }, D3DX_PIXEL_FORMAT_R16G16_UNORM }, + { { 32, DDS_PF_RGB, 0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000 }, D3DX_PIXEL_FORMAT_R8G8B8X8_UNORM }, + { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 16, 0x00e0, 0x001c, 0x0003, 0xff00 }, D3DX_PIXEL_FORMAT_B2G3R3A8_UNORM }, + { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 16, 0x7c00, 0x03e0, 0x001f, 0x8000 }, D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM }, + { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 16, 0x0f00, 0x00f0, 0x000f, 0xf000 }, D3DX_PIXEL_FORMAT_B4G4R4A4_UNORM }, + { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM }, + { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 }, D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM }, + { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x3ff00000, 0x000ffc00, 0x000003ff, 0xc0000000 }, D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM }, + { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x000003ff, 0x000ffc00, 0x3ff00000, 0xc0000000 }, D3DX_PIXEL_FORMAT_B10G10R10A2_UNORM }, + /* DDS_PF_INDEXED. */ + { { 32, DDS_PF_INDEXED, 0, 8 }, D3DX_PIXEL_FORMAT_P8_UINT }, + { { 32, DDS_PF_INDEXED | DDS_PF_ALPHA, 0, 16, 0, 0, 0, 0xff00, }, D3DX_PIXEL_FORMAT_P8_UINT_A8_UNORM }, + /* DDS_PF_LUMINANCE. */ + { { 32, DDS_PF_LUMINANCE, 0, 8, 0x00ff }, D3DX_PIXEL_FORMAT_L8_UNORM }, + { { 32, DDS_PF_LUMINANCE, 0, 16, 0xffff }, D3DX_PIXEL_FORMAT_L16_UNORM }, + { { 32, DDS_PF_LUMINANCE | DDS_PF_ALPHA, 0, 8, 0x000f, 0, 0, 0x00f0 }, D3DX_PIXEL_FORMAT_L4A4_UNORM }, + { { 32, DDS_PF_LUMINANCE | DDS_PF_ALPHA, 0, 16, 0x00ff, 0, 0, 0xff00 }, D3DX_PIXEL_FORMAT_L8A8_UNORM }, + /* Exceptional case, A8L8 can also have 8bpp. */ + { { 32, DDS_PF_LUMINANCE | DDS_PF_ALPHA, 0, 8, 0x00ff, 0, 0, 0xff00 }, D3DX_PIXEL_FORMAT_L8A8_UNORM }, + /* DDS_PF_ALPHA_ONLY. */ + { { 32, DDS_PF_ALPHA_ONLY, 0, 8, 0, 0, 0, 0xff }, D3DX_PIXEL_FORMAT_A8_UNORM }, + /* DDS_PF_BUMPDUDV. */ + { { 32, DDS_PF_BUMPDUDV, 0, 16, 0x000000ff, 0x0000ff00, 0x00000000, 0x00000000 }, D3DX_PIXEL_FORMAT_U8V8_SNORM }, + { { 32, DDS_PF_BUMPDUDV, 0, 32, 0x0000ffff, 0xffff0000, 0x00000000, 0x00000000 }, D3DX_PIXEL_FORMAT_U16V16_SNORM }, + { { 32, DDS_PF_BUMPDUDV, 0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 }, D3DX_PIXEL_FORMAT_U8V8W8Q8_SNORM }, + { { 32, DDS_PF_BUMPDUDV | DDS_PF_ALPHA, 0, 32, 0x3ff00000, 0x000ffc00, 0x000003ff, 0xc0000000 }, D3DX_PIXEL_FORMAT_U10V10W10_SNORM_A2_UNORM }, + /* DDS_PF_BUMPLUMINANCE. */ + { { 32, DDS_PF_BUMPLUMINANCE, 0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000 }, D3DX_PIXEL_FORMAT_U8V8_SNORM_L8X8_UNORM }, +}; + +static BOOL dds_pixel_format_compare(const struct dds_pixel_format *pf_a, const struct dds_pixel_format *pf_b, + BOOL check_rmask, BOOL check_gmask, BOOL check_bmask, BOOL check_amask) +{ + return pf_a->bpp == pf_b->bpp && !((check_rmask && pf_a->rmask != pf_b->rmask) + || (check_gmask && pf_a->gmask != pf_b->gmask) || (check_bmask && pf_a->bmask != pf_b->bmask) + || (check_amask && pf_a->amask != pf_b->amask)); +} + +static enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dds_pixel_format(const struct dds_pixel_format *pixel_format) +{ + uint32_t i; + + TRACE("pixel_format: size %lu, flags %#lx, fourcc %#lx, bpp %lu.\n", pixel_format->size, + pixel_format->flags, pixel_format->fourcc, pixel_format->bpp); + TRACE("rmask %#lx, gmask %#lx, bmask %#lx, amask %#lx.\n", pixel_format->rmask, pixel_format->gmask, + pixel_format->bmask, pixel_format->amask); + + for (i = 0; i < ARRAY_SIZE(dds_pixel_formats); ++i) + { + const struct dds_pixel_format *dds_pf = &dds_pixel_formats[i].dds_pixel_format; + + if (pixel_format->flags != dds_pf->flags) + continue; + + switch (pixel_format->flags & ~DDS_PF_ALPHA) + { + case DDS_PF_ALPHA_ONLY: + if (dds_pixel_format_compare(pixel_format, dds_pf, FALSE, FALSE, FALSE, TRUE)) + return dds_pixel_formats[i].d3dx_pixel_format; + break; + + case DDS_PF_FOURCC: + if (pixel_format->fourcc == dds_pf->fourcc) + return dds_pixel_formats[i].d3dx_pixel_format; + break; + + case DDS_PF_INDEXED: + if (dds_pixel_format_compare(pixel_format, dds_pf, FALSE, FALSE, FALSE, pixel_format->flags & DDS_PF_ALPHA)) + return dds_pixel_formats[i].d3dx_pixel_format; + break; + + case DDS_PF_RGB: + if (dds_pixel_format_compare(pixel_format, dds_pf, TRUE, TRUE, TRUE, pixel_format->flags & DDS_PF_ALPHA)) + return dds_pixel_formats[i].d3dx_pixel_format; + break; + + case DDS_PF_LUMINANCE: + if (dds_pixel_format_compare(pixel_format, dds_pf, TRUE, FALSE, FALSE, pixel_format->flags & DDS_PF_ALPHA)) + return dds_pixel_formats[i].d3dx_pixel_format; + break; + + case DDS_PF_BUMPLUMINANCE: + if (dds_pixel_format_compare(pixel_format, dds_pf, TRUE, TRUE, TRUE, FALSE)) + return dds_pixel_formats[i].d3dx_pixel_format; + break; + + case DDS_PF_BUMPDUDV: + if (dds_pixel_format_compare(pixel_format, dds_pf, TRUE, TRUE, TRUE, TRUE)) + return dds_pixel_formats[i].d3dx_pixel_format; + break; + + default: + assert(0); /* Should not happen. */ + break; + } + } + + WARN("Unknown pixel format (flags %#lx, fourcc %#lx, bpp %lu, r %#lx, g %#lx, b %#lx, a %#lx).\n", + pixel_format->flags, pixel_format->fourcc, pixel_format->bpp, + pixel_format->rmask, pixel_format->gmask, pixel_format->bmask, pixel_format->amask); + return D3DX_PIXEL_FORMAT_COUNT; +} + +HRESULT dds_pixel_format_from_d3dx_pixel_format_id(struct dds_pixel_format *pixel_format, + enum d3dx_pixel_format_id d3dx_pixel_format) +{ + const struct dds_pixel_format *pf = NULL; + uint32_t i; + + for (i = 0; i < ARRAY_SIZE(dds_pixel_formats); ++i) + { + if (dds_pixel_formats[i].d3dx_pixel_format == d3dx_pixel_format) + { + pf = &dds_pixel_formats[i].dds_pixel_format; + break; + } + } + + if (!pf) + { + WARN("Unhandled format %#x.\n", d3dx_pixel_format); + return E_NOTIMPL; + } + + if (pixel_format) + *pixel_format = *pf; + + return S_OK; +} + +static void d3dx_get_next_mip_level_size(struct volume *size) +{ + size->width = max(size->width / 2, 1); + size->height = max(size->height / 2, 1); + size->depth = max(size->depth / 2, 1); +} + +static const char *debug_volume(const struct volume *volume) +{ + if (!volume) + return "(null)"; + return wine_dbg_sprintf("(%ux%ux%u)", volume->width, volume->height, volume->depth); +} + +static HRESULT d3dx_calculate_pixels_size(enum d3dx_pixel_format_id format, uint32_t width, uint32_t height, + uint32_t *pitch, uint32_t *size) +{ + const struct pixel_format_desc *format_desc = get_d3dx_pixel_format_info(format); + + if (is_unknown_format(format_desc)) + return E_NOTIMPL; + + if (format_desc->block_width != 1 || format_desc->block_height != 1) + { + *pitch = format_desc->block_byte_count + * max(1, (width + format_desc->block_width - 1) / format_desc->block_width); + *size = *pitch + * max(1, (height + format_desc->block_height - 1) / format_desc->block_height); + } + else + { + *pitch = width * format_desc->bytes_per_pixel; + *size = *pitch * height; + } + + return S_OK; +} + +uint32_t d3dx_calculate_layer_pixels_size(enum d3dx_pixel_format_id format, uint32_t width, uint32_t height, uint32_t depth, + uint32_t mip_levels) +{ + uint32_t layer_size, row_pitch, slice_pitch, i; + struct volume dims = { width, height, depth }; + + layer_size = 0; + for (i = 0; i < mip_levels; ++i) + { + if (FAILED(d3dx_calculate_pixels_size(format, dims.width, dims.height, &row_pitch, &slice_pitch))) + return 0; + layer_size += slice_pitch * dims.depth; + d3dx_get_next_mip_level_size(&dims); + } + + return layer_size; +} + +HRESULT d3dx_init_dds_header(struct dds_header *header, enum d3dx_resource_type resource_type, + enum d3dx_pixel_format_id format, const struct volume *size, uint32_t mip_levels) +{ + HRESULT hr; + + memset(header, 0, sizeof(*header)); + header->signature = MAKEFOURCC('D','D','S',' '); + /* The signature is not really part of the DDS header. */ + header->size = sizeof(*header) - FIELD_OFFSET(struct dds_header, size); + hr = dds_pixel_format_from_d3dx_pixel_format_id(&header->pixel_format, format); + if (FAILED(hr)) + return hr; + + header->flags = DDS_CAPS | DDS_HEIGHT | DDS_WIDTH | DDS_PIXELFORMAT; + header->height = size->height; + header->width = size->width; + header->caps = DDS_CAPS_TEXTURE; + if (header->pixel_format.flags & DDS_PF_ALPHA || header->pixel_format.flags & DDS_PF_ALPHA_ONLY) + header->caps |= DDSCAPS_ALPHA; + if (header->pixel_format.flags & DDS_PF_INDEXED) + header->caps |= DDSCAPS_PALETTE; + + if (size->depth > 1) + { + header->flags |= DDS_DEPTH; + header->depth = size->depth; + header->caps2 |= DDS_CAPS2_VOLUME; + } + + if (mip_levels > 1) + { + header->flags |= DDS_MIPMAPCOUNT; + header->caps |= (DDS_CAPS_MIPMAP | DDS_CAPS_COMPLEX); + header->miplevels = mip_levels; + } + + if (resource_type == D3DX_RESOURCE_TYPE_CUBE_TEXTURE) + { + header->caps |= DDS_CAPS_COMPLEX; + header->caps2 |= (DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES); + } + + return S_OK; +} + +static const GUID *wic_container_guid_from_d3dx_file_format(enum d3dx_image_file_format iff) +{ + switch (iff) + { + case D3DX_IMAGE_FILE_FORMAT_DIB: + case D3DX_IMAGE_FILE_FORMAT_BMP: return &GUID_ContainerFormatBmp; + case D3DX_IMAGE_FILE_FORMAT_JPG: return &GUID_ContainerFormatJpeg; + case D3DX_IMAGE_FILE_FORMAT_PNG: return &GUID_ContainerFormatPng; + default: + assert(0 && "Unexpected file format."); + return NULL; + } +} + +static HRESULT d3dx_pixels_save_wic(struct d3dx_pixels *pixels, const struct pixel_format_desc *fmt_desc, + enum d3dx_image_file_format image_file_format, IStream **wic_file, uint32_t *wic_file_size) +{ + const GUID *container_format = wic_container_guid_from_d3dx_file_format(image_file_format); + const GUID *pixel_format_guid = wic_guid_from_d3dx_pixel_format_id(fmt_desc->format); + IWICBitmapFrameEncode *wic_frame = NULL; + IPropertyBag2 *encoder_options = NULL; + IWICBitmapEncoder *wic_encoder = NULL; + WICPixelFormatGUID wic_pixel_format; + const LARGE_INTEGER seek = { 0 }; + IWICImagingFactory *wic_factory; + IWICPalette *wic_palette = NULL; + IStream *stream = NULL; + STATSTG stream_stats; + HRESULT hr; + + assert(container_format && pixel_format_guid); + hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &wic_factory); + if (FAILED(hr)) + return D3DERR_INVALIDCALL; + + hr = IWICImagingFactory_CreateEncoder(wic_factory, container_format, NULL, &wic_encoder); + if (FAILED(hr)) + { + hr = D3DERR_INVALIDCALL; + goto exit; + } + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapEncoder_Initialize(wic_encoder, stream, WICBitmapEncoderNoCache); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapEncoder_CreateNewFrame(wic_encoder, &wic_frame, &encoder_options); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapFrameEncode_Initialize(wic_frame, encoder_options); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapFrameEncode_SetSize(wic_frame, pixels->size.width, pixels->size.height); + if (FAILED(hr)) + goto exit; + + if (pixels->palette) + { + WICColor tmp_palette[256]; + unsigned int i; + + hr = IWICImagingFactory_CreatePalette(wic_factory, &wic_palette); + if (FAILED(hr)) + goto exit; + + for (i = 0; i < ARRAY_SIZE(tmp_palette); ++i) + { + const PALETTEENTRY *pe = &pixels->palette[i]; + + tmp_palette[i] = (pe->peFlags << 24) | (pe->peRed << 16) | (pe->peGreen << 8) | (pe->peBlue); + } + + hr = IWICPalette_InitializeCustom(wic_palette, tmp_palette, ARRAY_SIZE(tmp_palette)); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapFrameEncode_SetPalette(wic_frame, wic_palette); + if (FAILED(hr)) + goto exit; + } + + /* + * Encode 32bpp BGRA format surfaces as 32bpp BGRX for BMP. + * This matches the behavior of native. + */ + if (IsEqualGUID(&GUID_ContainerFormatBmp, container_format) && (fmt_desc->format == D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM)) + pixel_format_guid = wic_guid_from_d3dx_pixel_format_id(D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM); + + memcpy(&wic_pixel_format, pixel_format_guid, sizeof(*pixel_format_guid)); + hr = IWICBitmapFrameEncode_SetPixelFormat(wic_frame, &wic_pixel_format); + if (FAILED(hr)) + goto exit; + + if (!IsEqualGUID(pixel_format_guid, &wic_pixel_format)) + { + ERR("SetPixelFormat returned a different pixel format.\n"); + hr = E_FAIL; + goto exit; + } + + hr = IWICBitmapFrameEncode_WritePixels(wic_frame, pixels->size.height, pixels->row_pitch, pixels->slice_pitch, + (BYTE *)pixels->data); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapFrameEncode_Commit(wic_frame); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapEncoder_Commit(wic_encoder); + if (FAILED(hr)) + goto exit; + + hr = IStream_Seek(stream, seek, STREAM_SEEK_SET, NULL); + if (FAILED(hr)) + goto exit; + + hr = IStream_Stat(stream, &stream_stats, STATFLAG_NONAME); + if (FAILED(hr)) + goto exit; + + if (!stream_stats.cbSize.u.HighPart) + { + *wic_file = stream; + *wic_file_size = stream_stats.cbSize.u.LowPart; + } + else + { + hr = D3DX_ERROR_INVALID_DATA; + } + +exit: + if (wic_factory) + IWICImagingFactory_Release(wic_factory); + if (stream && (*wic_file != stream)) + IStream_Release(stream); + if (wic_frame) + IWICBitmapFrameEncode_Release(wic_frame); + if (wic_palette) + IWICPalette_Release(wic_palette); + if (encoder_options) + IPropertyBag2_Release(encoder_options); + if (wic_encoder) + IWICBitmapEncoder_Release(wic_encoder); + + return hr; +} + +HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct pixel_format_desc *src_fmt_desc, + enum d3dx_image_file_format file_format, enum d3dx_pixel_format_id dst_format, ID3DXBlob **dst_blob) +{ + const struct pixel_format_desc *dst_fmt_desc = get_d3dx_pixel_format_info(dst_format); + uint32_t dst_row_pitch, dst_slice_pitch; + struct d3dx_pixels dst_pixels; + uint8_t *pixels, *tmp_buf; + ID3DXBlob *blob; + HRESULT hr; + + *dst_blob = blob = NULL; + pixels = tmp_buf = NULL; + hr = d3dx_calculate_pixels_size(dst_format, src_pixels->size.width, src_pixels->size.height, &dst_row_pitch, + &dst_slice_pitch); + if (FAILED(hr)) + return hr; + + src_pixels->size.depth = (file_format == D3DX_IMAGE_FILE_FORMAT_DDS) ? src_pixels->size.depth : 1; + switch (file_format) + { + case D3DX_IMAGE_FILE_FORMAT_DDS: + { + struct dds_header *header; + uint32_t header_size; + + header_size = is_index_format(dst_fmt_desc) ? sizeof(*header) + DDS_PALETTE_SIZE : sizeof(*header); + hr = d3dx_create_blob((dst_slice_pitch * src_pixels->size.depth) + header_size, &blob); + if (FAILED(hr)) + return hr; + + header = d3dx_blob_get_buffer_pointer(blob); + pixels = (uint8_t *)d3dx_blob_get_buffer_pointer(blob) + header_size; + hr = d3dx_init_dds_header(header, D3DX_RESOURCE_TYPE_TEXTURE_2D, dst_format, &src_pixels->size, 1); + if (FAILED(hr)) + goto exit; + if (is_index_format(dst_fmt_desc)) + memcpy((uint8_t *)d3dx_blob_get_buffer_pointer(blob) + sizeof(*header), src_pixels->palette, + DDS_PALETTE_SIZE); + break; + } + + case D3DX_IMAGE_FILE_FORMAT_TGA: + { + struct tga_header *header; + + hr = d3dx_create_blob(dst_slice_pitch + sizeof(*header), &blob); + if (FAILED(hr)) + return hr; + + header = d3dx_blob_get_buffer_pointer(blob); + pixels = (uint8_t *)d3dx_blob_get_buffer_pointer(blob) + sizeof(*header); + + memset(header, 0, sizeof(*header)); + header->image_type = IMAGETYPE_TRUECOLOR; + header->width = src_pixels->size.width; + header->height = src_pixels->size.height; + header->image_descriptor = IMAGE_TOPTOBOTTOM; + header->depth = dst_fmt_desc->bytes_per_pixel * 8; + if (dst_fmt_desc->format == D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM) + header->image_descriptor |= 0x08; + break; + } + + case D3DX_IMAGE_FILE_FORMAT_DIB: + case D3DX_IMAGE_FILE_FORMAT_BMP: + case D3DX_IMAGE_FILE_FORMAT_PNG: + case D3DX_IMAGE_FILE_FORMAT_JPG: + if (src_fmt_desc == dst_fmt_desc) + dst_pixels = *src_pixels; + else + pixels = tmp_buf = malloc(dst_slice_pitch); + break; + + default: + break; + } + + if (src_pixels->size.width != 0 && src_pixels->size.height != 0) + { + const RECT dst_rect = { 0, 0, src_pixels->size.width, src_pixels->size.height }; + + if (pixels) + { + set_d3dx_pixels(&dst_pixels, pixels, dst_row_pitch, dst_slice_pitch, src_pixels->palette, src_pixels->size.width, + src_pixels->size.height, src_pixels->size.depth, &dst_rect); + + hr = d3dx_load_pixels_from_pixels(&dst_pixels, dst_fmt_desc, src_pixels, src_fmt_desc, D3DX_FILTER_NONE, 0); + if (FAILED(hr)) + goto exit; + } + + /* WIC path, encode the image. */ + if (!blob) + { + IStream *wic_file = NULL; + uint32_t buf_size = 0; + + hr = d3dx_pixels_save_wic(&dst_pixels, dst_fmt_desc, file_format, &wic_file, &buf_size); + if (FAILED(hr)) + goto exit; + + hr = d3dx_create_blob(buf_size, &blob); + if (FAILED(hr)) + { + IStream_Release(wic_file); + goto exit; + } + + hr = IStream_Read(wic_file, d3dx_blob_get_buffer_pointer(blob), buf_size, NULL); + IStream_Release(wic_file); + if (FAILED(hr)) + goto exit; + } + } + /* Return an empty buffer for size 0 images via WIC. */ + else if (!blob) + { + hr = d3dx_create_blob(64, &blob); + if (FAILED(hr)) + goto exit; + } + + *dst_blob = blob; +exit: + free(tmp_buf); + if (*dst_blob != blob) + d3dx_blob_release(blob); + return hr; +} + +static const uint8_t bmp_file_signature[] = { 'B', 'M' }; +static const uint8_t jpg_file_signature[] = { 0xff, 0xd8 }; +static const uint8_t png_file_signature[] = { 0x89, 'P', 'N', 'G', 0x0d, 0x0a, 0x1a, 0x0a }; +static const uint8_t dds_file_signature[] = { 'D', 'D', 'S', ' ' }; +static const uint8_t ppm_plain_file_signature[] = { 'P', '3' }; +static const uint8_t ppm_raw_file_signature[] = { 'P', '6' }; +static const uint8_t hdr_file_signature[] = { '#', '?', 'R', 'A', 'D', 'I', 'A', 'N', 'C', 'E', '\n' }; +static const uint8_t pfm_color_file_signature[] = { 'P', 'F' }; +static const uint8_t pfm_gray_file_signature[] = { 'P', 'f' }; + +/* + * If none of these match, the file is either DIB, TGA, or something we don't + * support. + */ +struct d3dx_file_format_signature +{ + const uint8_t *file_signature; + uint32_t file_signature_len; + enum d3dx_image_file_format image_file_format; +}; + +static const struct d3dx_file_format_signature file_format_signatures[] = +{ + { bmp_file_signature, sizeof(bmp_file_signature), D3DX_IMAGE_FILE_FORMAT_BMP }, + { jpg_file_signature, sizeof(jpg_file_signature), D3DX_IMAGE_FILE_FORMAT_JPG }, + { png_file_signature, sizeof(png_file_signature), D3DX_IMAGE_FILE_FORMAT_PNG }, + { dds_file_signature, sizeof(dds_file_signature), D3DX_IMAGE_FILE_FORMAT_DDS }, + { ppm_plain_file_signature, sizeof(ppm_plain_file_signature), D3DX_IMAGE_FILE_FORMAT_PPM }, + { ppm_raw_file_signature, sizeof(ppm_raw_file_signature), D3DX_IMAGE_FILE_FORMAT_PPM }, + { hdr_file_signature, sizeof(hdr_file_signature), D3DX_IMAGE_FILE_FORMAT_HDR }, + { pfm_color_file_signature, sizeof(pfm_color_file_signature), D3DX_IMAGE_FILE_FORMAT_PFM }, + { pfm_gray_file_signature, sizeof(pfm_gray_file_signature), D3DX_IMAGE_FILE_FORMAT_PFM }, +}; + +static BOOL d3dx_get_image_file_format_from_file_signature(const void *src_data, uint32_t src_data_size, + enum d3dx_image_file_format *out_iff) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(file_format_signatures); ++i) + { + const struct d3dx_file_format_signature *signature = &file_format_signatures[i]; + + if ((src_data_size >= signature->file_signature_len) + && !memcmp(src_data, signature->file_signature, signature->file_signature_len)) + { + *out_iff = signature->image_file_format; + return TRUE; + } + } + + return FALSE; +} + +static HRESULT d3dx_initialize_image_from_dds(const void *src_data, uint32_t src_data_size, + struct d3dx_image *image, uint32_t starting_mip_level) +{ + uint32_t expected_src_data_size, header_size; + const struct dds_header *header = src_data; + BOOL is_indexed_fmt; + HRESULT hr; + + if (src_data_size < sizeof(*header) || header->pixel_format.size != sizeof(header->pixel_format)) + return D3DX_ERROR_INVALID_DATA; + + TRACE("File type is DDS.\n"); + is_indexed_fmt = !!(header->pixel_format.flags & DDS_PF_INDEXED); + header_size = is_indexed_fmt ? sizeof(*header) + DDS_PALETTE_SIZE : sizeof(*header); + + set_volume_struct(&image->size, header->width, header->height, 1); + image->mip_levels = header->miplevels ? header->miplevels : 1; + image->format = d3dx_pixel_format_id_from_dds_pixel_format(&header->pixel_format); + image->layer_count = 1; + + if (image->format == D3DX_PIXEL_FORMAT_COUNT) + return D3DX_ERROR_INVALID_DATA; + + TRACE("Pixel format is %#x.\n", image->format); + if (header->flags & DDS_DEPTH) + { + image->size.depth = max(header->depth, 1); + image->resource_type = D3DX_RESOURCE_TYPE_TEXTURE_3D; + } + else if (header->caps2 & DDS_CAPS2_CUBEMAP) + { + if ((header->caps2 & DDS_CAPS2_CUBEMAP_ALL_FACES) != DDS_CAPS2_CUBEMAP_ALL_FACES) + { + WARN("Tried to load a partial cubemap DDS file.\n"); + return D3DX_ERROR_INVALID_DATA; + } + + image->layer_count = 6; + image->resource_type = D3DX_RESOURCE_TYPE_CUBE_TEXTURE; + } + else + { + image->resource_type = D3DX_RESOURCE_TYPE_TEXTURE_2D; + } + + image->layer_pitch = d3dx_calculate_layer_pixels_size(image->format, image->size.width, image->size.height, + image->size.depth, image->mip_levels); + if (!image->layer_pitch) + return D3DX_ERROR_INVALID_DATA; + expected_src_data_size = (image->layer_pitch * image->layer_count) + header_size; + if (src_data_size < expected_src_data_size) + { + WARN("File is too short %u, expected at least %u bytes.\n", src_data_size, expected_src_data_size); + return D3DX_ERROR_INVALID_DATA; + } + + image->palette = (is_indexed_fmt) ? (PALETTEENTRY *)(((uint8_t *)src_data) + sizeof(*header)) : NULL; + image->pixels = ((BYTE *)src_data) + header_size; + image->image_file_format = D3DX_IMAGE_FILE_FORMAT_DDS; + if (starting_mip_level && (image->mip_levels > 1)) + { + uint32_t i, row_pitch, slice_pitch, initial_mip_levels; + const struct volume initial_size = image->size; + + initial_mip_levels = image->mip_levels; + for (i = 0; i < starting_mip_level; i++) + { + hr = d3dx_calculate_pixels_size(image->format, image->size.width, image->size.height, &row_pitch, &slice_pitch); + if (FAILED(hr)) + return hr; + + image->pixels += slice_pitch * image->size.depth; + d3dx_get_next_mip_level_size(&image->size); + if (--image->mip_levels == 1) + break; + } + + TRACE("Requested starting mip level %u, actual starting mip level is %u (of %u total in image).\n", + starting_mip_level, (initial_mip_levels - image->mip_levels), initial_mip_levels); + TRACE("Original dimensions %s, new dimensions %s.\n", debug_volume(&initial_size), debug_volume(&image->size)); + } + + return S_OK; +} + +static BOOL convert_dib_to_bmp(const void **data, unsigned int *size) +{ + ULONG header_size; + ULONG count = 0; + ULONG offset; + BITMAPFILEHEADER *header; + BYTE *new_data; + UINT new_size; + + if ((*size < 4) || (*size < (header_size = *(ULONG*)*data))) + return FALSE; + + if ((header_size == sizeof(BITMAPINFOHEADER)) || + (header_size == sizeof(BITMAPV4HEADER)) || + (header_size == sizeof(BITMAPV5HEADER)) || + (header_size == 64 /* sizeof(BITMAPCOREHEADER2) */)) + { + /* All structures begin with the same memory layout as BITMAPINFOHEADER */ + BITMAPINFOHEADER *info_header = (BITMAPINFOHEADER*)*data; + count = info_header->biClrUsed; + + if (!count && info_header->biBitCount <= 8) + count = 1 << info_header->biBitCount; + + offset = sizeof(BITMAPFILEHEADER) + header_size + sizeof(RGBQUAD) * count; + + /* For BITMAPINFOHEADER with BI_BITFIELDS compression, there are 3 additional color masks after header */ + if ((info_header->biSize == sizeof(BITMAPINFOHEADER)) && (info_header->biCompression == BI_BITFIELDS)) + offset += 3 * sizeof(DWORD); + } + else if (header_size == sizeof(BITMAPCOREHEADER)) + { + BITMAPCOREHEADER *core_header = (BITMAPCOREHEADER*)*data; + + if (core_header->bcBitCount <= 8) + count = 1 << core_header->bcBitCount; + + offset = sizeof(BITMAPFILEHEADER) + header_size + sizeof(RGBTRIPLE) * count; + } + else + { + return FALSE; + } + + TRACE("Converting DIB file to BMP\n"); + + new_size = *size + sizeof(BITMAPFILEHEADER); + new_data = malloc(new_size); + CopyMemory(new_data + sizeof(BITMAPFILEHEADER), *data, *size); + + /* Add BMP header */ + header = (BITMAPFILEHEADER*)new_data; + header->bfType = 0x4d42; /* BM */ + header->bfSize = new_size; + header->bfReserved1 = 0; + header->bfReserved2 = 0; + header->bfOffBits = offset; + + /* Update input data */ + *data = new_data; + *size = new_size; + + return TRUE; +} + +/* windowscodecs always returns xRGB, but we should return ARGB if and only if + * at least one pixel has a non-zero alpha component. */ +static BOOL image_is_argb(IWICBitmapFrameDecode *frame, struct d3dx_image *image) +{ + unsigned int size, i; + BYTE *buffer; + HRESULT hr; + + if (image->format != D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM || image->image_file_format != D3DX_IMAGE_FILE_FORMAT_BMP) + return FALSE; + + size = image->size.width * image->size.height * 4; + if (!(buffer = malloc(size))) + return FALSE; + + if (FAILED(hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, image->size.width * 4, size, buffer))) + { + ERR("Failed to copy pixels, hr %#lx.\n", hr); + free(buffer); + return FALSE; + } + + for (i = 0; i < image->size.width * image->size.height; ++i) + { + if (buffer[i * 4 + 3]) + { + free(buffer); + return TRUE; + } + } + + free(buffer); + return FALSE; +} + +const char *debug_d3dx_image_file_format(enum d3dx_image_file_format format) +{ + switch (format) + { +#define FMT_TO_STR(format) case format: return #format + FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_BMP); + FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_JPG); + FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_TGA); + FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_PNG); + FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_DDS); + FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_PPM); + FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_DIB); + FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_HDR); + FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_PFM); +#undef FMT_TO_STR + default: + return "unrecognized"; + } +} + +static HRESULT d3dx_image_wic_frame_decode(struct d3dx_image *image, + IWICImagingFactory *wic_factory, IWICBitmapFrameDecode *bitmap_frame) +{ + const struct pixel_format_desc *fmt_desc; + uint32_t row_pitch, slice_pitch; + IWICPalette *wic_palette = NULL; + PALETTEENTRY *palette = NULL; + WICColor *colors = NULL; + BYTE *buffer = NULL; + HRESULT hr; + + fmt_desc = get_d3dx_pixel_format_info(image->format); + hr = d3dx_calculate_pixels_size(image->format, image->size.width, image->size.height, &row_pitch, &slice_pitch); + if (FAILED(hr)) + return hr; + + /* Allocate a buffer for our image. */ + if (!(buffer = malloc(slice_pitch))) + return E_OUTOFMEMORY; + + hr = IWICBitmapFrameDecode_CopyPixels(bitmap_frame, NULL, row_pitch, slice_pitch, buffer); + if (FAILED(hr)) + { + free(buffer); + return hr; + } + + if (is_index_format(fmt_desc)) + { + uint32_t nb_colors, i; + + hr = IWICImagingFactory_CreatePalette(wic_factory, &wic_palette); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapFrameDecode_CopyPalette(bitmap_frame, wic_palette); + if (FAILED(hr)) + goto exit; + + hr = IWICPalette_GetColorCount(wic_palette, &nb_colors); + if (FAILED(hr)) + goto exit; + + colors = malloc(nb_colors * sizeof(colors[0])); + palette = malloc(nb_colors * sizeof(palette[0])); + if (!colors || !palette) + { + hr = E_OUTOFMEMORY; + goto exit; + } + + hr = IWICPalette_GetColors(wic_palette, nb_colors, colors, &nb_colors); + if (FAILED(hr)) + goto exit; + + /* Convert colors from WICColor (ARGB) to PALETTEENTRY (ABGR) */ + for (i = 0; i < nb_colors; i++) + { + palette[i].peRed = (colors[i] >> 16) & 0xff; + palette[i].peGreen = (colors[i] >> 8) & 0xff; + palette[i].peBlue = colors[i] & 0xff; + palette[i].peFlags = (colors[i] >> 24) & 0xff; /* peFlags is the alpha component in DX8 and higher */ + } + } + + image->image_buf = image->pixels = buffer; + image->image_palette = image->palette = palette; + +exit: + free(colors); + if (image->image_buf != buffer) + free(buffer); + if (image->image_palette != palette) + free(palette); + if (wic_palette) + IWICPalette_Release(wic_palette); + + return hr; +} + +static HRESULT d3dx_initialize_image_from_wic(const void *src_data, uint32_t src_data_size, + struct d3dx_image *image, enum d3dx_image_file_format d3dx_file_format, uint32_t flags) +{ + const GUID *container_format_guid = wic_container_guid_from_d3dx_file_format(d3dx_file_format); + IWICBitmapFrameDecode *bitmap_frame = NULL; + IWICBitmapDecoder *bitmap_decoder = NULL; + IWICImagingFactory *wic_factory; + WICPixelFormatGUID pixel_format; + IWICStream *wic_stream = NULL; + uint32_t frame_count = 0; + HRESULT hr; + + hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &wic_factory); + if (FAILED(hr)) + return hr; + + hr = IWICImagingFactory_CreateDecoder(wic_factory, container_format_guid, NULL, &bitmap_decoder); + if (FAILED(hr)) + goto exit; + + hr = IWICImagingFactory_CreateStream(wic_factory, &wic_stream); + if (FAILED(hr)) + goto exit; + + hr = IWICStream_InitializeFromMemory(wic_stream, (BYTE *)src_data, src_data_size); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapDecoder_Initialize(bitmap_decoder, (IStream *)wic_stream, 0); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapDecoder_GetFrameCount(bitmap_decoder, &frame_count); + if (FAILED(hr) || (SUCCEEDED(hr) && !frame_count)) + { + hr = D3DX_ERROR_INVALID_DATA; + goto exit; + } + + image->image_file_format = d3dx_file_format; + hr = IWICBitmapDecoder_GetFrame(bitmap_decoder, 0, &bitmap_frame); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapFrameDecode_GetSize(bitmap_frame, &image->size.width, &image->size.height); + if (FAILED(hr)) + goto exit; + + hr = IWICBitmapFrameDecode_GetPixelFormat(bitmap_frame, &pixel_format); + if (FAILED(hr)) + goto exit; + + image->format = d3dx_pixel_format_id_from_wic_pixel_format(&pixel_format); + if (image->format == D3DX_PIXEL_FORMAT_COUNT) + { + WARN("Unsupported pixel format %s.\n", debugstr_guid(&pixel_format)); + hr = D3DX_ERROR_INVALID_DATA; + goto exit; + } + + if (image_is_argb(bitmap_frame, image)) + image->format = D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM; + + if (!(flags & D3DX_IMAGE_INFO_ONLY)) + { + hr = d3dx_image_wic_frame_decode(image, wic_factory, bitmap_frame); + if (FAILED(hr)) + goto exit; + } + + image->size.depth = 1; + image->mip_levels = 1; + image->layer_count = 1; + image->resource_type = D3DX_RESOURCE_TYPE_TEXTURE_2D; + +exit: + if (bitmap_frame) + IWICBitmapFrameDecode_Release(bitmap_frame); + if (bitmap_decoder) + IWICBitmapDecoder_Release(bitmap_decoder); + if (wic_stream) + IWICStream_Release(wic_stream); + IWICImagingFactory_Release(wic_factory); + + return hr; +} + +static enum d3dx_pixel_format_id d3dx_get_tga_format_for_bpp(uint8_t bpp) +{ + switch (bpp) + { + case 15: return D3DX_PIXEL_FORMAT_B5G5R5X1_UNORM; + case 16: return D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM; + case 24: return D3DX_PIXEL_FORMAT_B8G8R8_UNORM; + case 32: return D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM; + default: + WARN("Unhandled bpp %u for targa.\n", bpp); + return D3DX_PIXEL_FORMAT_COUNT; + } +} + +static HRESULT d3dx_image_tga_rle_decode_row(const uint8_t **src, uint32_t src_bytes_left, uint32_t row_width, + uint32_t bytes_per_pixel, uint8_t *dst_row) +{ + const uint8_t *src_ptr = *src; + uint32_t pixel_count = 0; + + while (pixel_count != row_width) + { + uint32_t rle_count = (src_ptr[0] & 0x7f) + 1; + uint32_t rle_packet_size = 1; + + rle_packet_size += (src_ptr[0] & 0x80) ? bytes_per_pixel : (bytes_per_pixel * rle_count); + if ((rle_packet_size > src_bytes_left) || (pixel_count + rle_count) > row_width) + return D3DX_ERROR_INVALID_DATA; + + if (src_ptr[0] & 0x80) + { + uint32_t i; + + for (i = 0; i < rle_count; ++i) + memcpy(&dst_row[(pixel_count + i) * bytes_per_pixel], src_ptr + 1, bytes_per_pixel); + } + else + { + memcpy(&dst_row[pixel_count * bytes_per_pixel], src_ptr + 1, rle_packet_size - 1); + } + + src_ptr += rle_packet_size; + src_bytes_left -= rle_packet_size; + pixel_count += rle_count; + if (!src_bytes_left && pixel_count != row_width) + return D3DX_ERROR_INVALID_DATA; + } + + *src = src_ptr; + return S_OK; +} + +static void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, const struct volume *src_size, + const struct pixel_format_desc *src_format, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, + const struct volume *dst_size, const struct pixel_format_desc *dst_format, DWORD color_key, + const PALETTEENTRY *palette, uint32_t filter_flags); +static HRESULT d3dx_image_tga_decode(const void *src_data, uint32_t src_data_size, uint32_t src_header_size, + struct d3dx_image *image) +{ + const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(image->format); + const struct tga_header *header = (const struct tga_header *)src_data; + const BOOL right_to_left = !!(header->image_descriptor & IMAGE_RIGHTTOLEFT); + const BOOL bottom_to_top = !(header->image_descriptor & IMAGE_TOPTOBOTTOM); + const BOOL is_rle = !!(header->image_type & IMAGETYPE_RLE); + uint8_t *img_buf = NULL, *src_row = NULL; + uint32_t row_pitch, slice_pitch, i; + PALETTEENTRY *palette = NULL; + const uint8_t *src_pos; + HRESULT hr; + + hr = d3dx_calculate_pixels_size(image->format, image->size.width, image->size.height, &row_pitch, &slice_pitch); + if (FAILED(hr)) + return hr; + + /* File is too small. */ + if (!is_rle && (src_header_size + slice_pitch) > src_data_size) + return D3DX_ERROR_INVALID_DATA; + + if (image->format == D3DX_PIXEL_FORMAT_P8_UINT) + { + const uint8_t *src_palette = ((const uint8_t *)src_data) + sizeof(*header) + header->id_length; + const struct volume image_map_size = { header->color_map_length, 1, 1 }; + uint32_t src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; + const struct pixel_format_desc *src_desc, *dst_desc; + + if (!(palette = malloc(sizeof(*palette) * 256))) + return E_OUTOFMEMORY; + + /* + * Convert from a TGA colormap to PALETTEENTRY. TGA is BGRA, + * PALETTEENTRY is RGBA. + */ + src_desc = get_d3dx_pixel_format_info(d3dx_get_tga_format_for_bpp(header->color_map_entrysize)); + hr = d3dx_calculate_pixels_size(src_desc->format, header->color_map_length, 1, &src_row_pitch, &src_slice_pitch); + if (FAILED(hr)) + goto exit; + + dst_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); + d3dx_calculate_pixels_size(dst_desc->format, 256, 1, &dst_row_pitch, &dst_slice_pitch); + convert_argb_pixels(src_palette, src_row_pitch, src_slice_pitch, &image_map_size, src_desc, (BYTE *)palette, + dst_row_pitch, dst_slice_pitch, &image_map_size, dst_desc, 0, NULL, D3DX_FILTER_NONE); + + /* Initialize unused palette entries to 0xff. */ + if (header->color_map_length < 256) + memset(&palette[header->color_map_length], 0xff, sizeof(*palette) * (256 - header->color_map_length)); + } + + if (!is_rle && !bottom_to_top && !right_to_left) + { + image->pixels = (uint8_t *)src_data + src_header_size; + image->image_palette = image->palette = palette; + return S_OK; + } + + if (!(img_buf = malloc(slice_pitch))) + { + hr = E_OUTOFMEMORY; + goto exit; + } + + /* Allocate an extra row to use as a temporary buffer. */ + if (is_rle) + { + if (!(src_row = malloc(row_pitch))) + { + hr = E_OUTOFMEMORY; + goto exit; + } + } + + src_pos = (const uint8_t *)src_data + src_header_size; + for (i = 0; i < image->size.height; ++i) + { + const uint32_t dst_row_idx = bottom_to_top ? (image->size.height - i - 1) : i; + uint8_t *dst_row = img_buf + (dst_row_idx * row_pitch); + + if (is_rle) + { + hr = d3dx_image_tga_rle_decode_row(&src_pos, src_data_size - (src_pos - (const uint8_t *)src_data), + image->size.width, fmt_desc->bytes_per_pixel, src_row); + if (FAILED(hr)) + goto exit; + } + else + { + src_row = (uint8_t *)src_pos; + src_pos += row_pitch; + } + + if (right_to_left) + { + const uint8_t *src_pixel = &src_row[((image->size.width - 1)) * fmt_desc->bytes_per_pixel]; + uint8_t *dst_pixel = dst_row; + uint32_t j; + + for (j = 0; j < image->size.width; ++j) + { + memcpy(dst_pixel, src_pixel, fmt_desc->bytes_per_pixel); + src_pixel -= fmt_desc->bytes_per_pixel; + dst_pixel += fmt_desc->bytes_per_pixel; + } + } + else + { + memcpy(dst_row, src_row, row_pitch); + } + } + + image->image_buf = image->pixels = img_buf; + image->image_palette = image->palette = palette; + +exit: + if (is_rle) + free(src_row); + if (img_buf && (image->image_buf != img_buf)) + free(img_buf); + if (palette && (image->image_palette != palette)) + free(palette); + + return hr; +} + +static HRESULT d3dx_initialize_image_from_tga(const void *src_data, uint32_t src_data_size, struct d3dx_image *image, + uint32_t flags) +{ + const struct tga_header *header = (const struct tga_header *)src_data; + uint32_t expected_header_size = sizeof(*header); + + if (src_data_size < sizeof(*header)) + return D3DX_ERROR_INVALID_DATA; + + expected_header_size += header->id_length; + expected_header_size += header->color_map_length * ((header->color_map_entrysize + 7) / CHAR_BIT); + if (src_data_size < expected_header_size) + return D3DX_ERROR_INVALID_DATA; + + if (header->color_map_type && ((header->color_map_type > 1) || (!header->color_map_length) + || (d3dx_get_tga_format_for_bpp(header->color_map_entrysize) == D3DX_PIXEL_FORMAT_COUNT))) + return D3DX_ERROR_INVALID_DATA; + + switch (header->image_type & IMAGETYPE_MASK) + { + case IMAGETYPE_COLORMAPPED: + if (header->depth != 8 || !header->color_map_type) + return D3DX_ERROR_INVALID_DATA; + image->format = D3DX_PIXEL_FORMAT_P8_UINT; + break; + + case IMAGETYPE_TRUECOLOR: + if ((image->format = d3dx_get_tga_format_for_bpp(header->depth)) == D3DX_PIXEL_FORMAT_COUNT) + return D3DX_ERROR_INVALID_DATA; + break; + + case IMAGETYPE_GRAYSCALE: + if (header->depth != 8) + return D3DX_ERROR_INVALID_DATA; + image->format = D3DX_PIXEL_FORMAT_L8_UNORM; + break; + + default: + return D3DX_ERROR_INVALID_DATA; + } + + set_volume_struct(&image->size, header->width, header->height, 1); + image->mip_levels = 1; + image->layer_count = 1; + image->resource_type = D3DX_RESOURCE_TYPE_TEXTURE_2D; + image->image_file_format = D3DX_IMAGE_FILE_FORMAT_TGA; + + if (!(flags & D3DX_IMAGE_INFO_ONLY)) + return d3dx_image_tga_decode(src_data, src_data_size, expected_header_size, image); + + return S_OK; +} + +HRESULT d3dx_image_init(const void *src_data, uint32_t src_data_size, struct d3dx_image *image, + uint32_t starting_mip_level, uint32_t flags) +{ + enum d3dx_image_file_format iff = D3DX_IMAGE_FILE_FORMAT_FORCE_DWORD; + HRESULT hr; + + if (!src_data || !src_data_size || !image) + return D3DERR_INVALIDCALL; + + memset(image, 0, sizeof(*image)); + if (!d3dx_get_image_file_format_from_file_signature(src_data, src_data_size, &iff)) + { + uint32_t src_image_size = src_data_size; + const void *src_image = src_data; + + if (convert_dib_to_bmp(&src_image, &src_image_size)) + { + hr = d3dx_image_init(src_image, src_image_size, image, starting_mip_level, flags); + free((void *)src_image); + if (SUCCEEDED(hr)) + image->image_file_format = D3DX_IMAGE_FILE_FORMAT_DIB; + return hr; + } + + /* Last resort, try TGA. */ + return d3dx_initialize_image_from_tga(src_data, src_data_size, image, flags); + } + + switch (iff) + { + case D3DX_IMAGE_FILE_FORMAT_BMP: + case D3DX_IMAGE_FILE_FORMAT_JPG: + case D3DX_IMAGE_FILE_FORMAT_PNG: + hr = d3dx_initialize_image_from_wic(src_data, src_data_size, image, iff, flags); + break; + + case D3DX_IMAGE_FILE_FORMAT_DDS: + hr = d3dx_initialize_image_from_dds(src_data, src_data_size, image, starting_mip_level); + break; + + case D3DX_IMAGE_FILE_FORMAT_PPM: + case D3DX_IMAGE_FILE_FORMAT_HDR: + case D3DX_IMAGE_FILE_FORMAT_PFM: + WARN("Unsupported file format %s.\n", debug_d3dx_image_file_format(iff)); + hr = E_NOTIMPL; + break; + + case D3DX_IMAGE_FILE_FORMAT_FORCE_DWORD: + ERR("Unrecognized file format.\n"); + hr = D3DX_ERROR_INVALID_DATA; + break; + + default: + assert(0); + return E_FAIL; + } + + return hr; +} + +void d3dx_image_cleanup(struct d3dx_image *image) +{ + free(image->image_buf); + free(image->image_palette); +} + +HRESULT d3dx_image_get_pixels(struct d3dx_image *image, uint32_t layer, uint32_t mip_level, + struct d3dx_pixels *pixels) +{ + struct volume mip_level_size = image->size; + const BYTE *pixels_ptr = image->pixels; + uint32_t row_pitch, slice_pitch, i; + RECT unaligned_rect; + HRESULT hr = S_OK; + + if (mip_level >= image->mip_levels) + { + ERR("Tried to retrieve mip level %u, but image only has %u mip levels.\n", mip_level, image->mip_levels); + return E_FAIL; + } + + if (layer >= image->layer_count) + { + ERR("Tried to retrieve layer %u, but image only has %u layers.\n", layer, image->layer_count); + return E_FAIL; + } + + slice_pitch = row_pitch = 0; + for (i = 0; i < image->mip_levels; i++) + { + hr = d3dx_calculate_pixels_size(image->format, mip_level_size.width, mip_level_size.height, &row_pitch, &slice_pitch); + if (FAILED(hr)) + return hr; + + if (i == mip_level) + break; + + pixels_ptr += slice_pitch * mip_level_size.depth; + d3dx_get_next_mip_level_size(&mip_level_size); + } + + pixels_ptr += (layer * image->layer_pitch); + SetRect(&unaligned_rect, 0, 0, mip_level_size.width, mip_level_size.height); + set_d3dx_pixels(pixels, pixels_ptr, row_pitch, slice_pitch, image->palette, mip_level_size.width, + mip_level_size.height, mip_level_size.depth, &unaligned_rect); + + return S_OK; +} + +unsigned short float_32_to_16(const float in) +{ + int exp = 0, origexp; + float tmp = fabsf(in); + int sign = (copysignf(1, in) < 0); + unsigned int mantissa; + unsigned short ret; + + /* Deal with special numbers */ + if (isinf(in)) return (sign ? 0xffff : 0x7fff); + if (isnan(in)) return (sign ? 0xffff : 0x7fff); + if (in == 0.0f) return (sign ? 0x8000 : 0x0000); + + if (tmp < (float)(1u << 10)) + { + do + { + tmp *= 2.0f; + exp--; + } while (tmp < (float)(1u << 10)); + } + else if (tmp >= (float)(1u << 11)) + { + do + { + tmp /= 2.0f; + exp++; + } while (tmp >= (float)(1u << 11)); + } + + exp += 10; /* Normalize the mantissa */ + exp += 15; /* Exponent is encoded with excess 15 */ + + origexp = exp; + + mantissa = (unsigned int) tmp; + if ((tmp - mantissa == 0.5f && mantissa % 2 == 1) || /* round half to even */ + (tmp - mantissa > 0.5f)) + { + mantissa++; /* round to nearest, away from zero */ + } + if (mantissa == 2048) + { + mantissa = 1024; + exp++; + } + + if (exp > 31) + { + /* too big */ + ret = 0x7fff; /* INF */ + } + else if (exp <= 0) + { + unsigned int rounding = 0; + + /* Denormalized half float */ + + /* return 0x0000 (=0.0) for numbers too small to represent in half floats */ + if (exp < -11) + return (sign ? 0x8000 : 0x0000); + + exp = origexp; + + /* the 13 extra bits from single precision are used for rounding */ + mantissa = (unsigned int)(tmp * (1u << 13)); + mantissa >>= 1 - exp; /* denormalize */ + + mantissa -= ~(mantissa >> 13) & 1; /* round half to even */ + /* remove 13 least significant bits to get half float precision */ + mantissa >>= 12; + rounding = mantissa & 1; + mantissa >>= 1; + + ret = mantissa + rounding; + } + else + { + ret = (exp << 10) | (mantissa & 0x3ff); + } + + ret |= ((sign ? 1 : 0) << 15); /* Add the sign */ + return ret; +} + +/* Native d3dx9's D3DXFloat16to32Array lacks support for NaN and Inf. Specifically, e = 16 is treated as a + * regular number - e.g., 0x7fff is converted to 131008.0 and 0xffff to -131008.0. */ +float float_16_to_32(const unsigned short in) +{ + const unsigned short s = (in & 0x8000); + const unsigned short e = (in & 0x7C00) >> 10; + const unsigned short m = in & 0x3FF; + const float sgn = (s ? -1.0f : 1.0f); + + if (e == 0) + { + if (m == 0) return sgn * 0.0f; /* +0.0 or -0.0 */ + else return sgn * powf(2, -14.0f) * (m / 1024.0f); + } + else + { + return sgn * powf(2, e - 15.0f) * (1.0f + (m / 1024.0f)); + } +} + +struct argb_conversion_info +{ + const struct pixel_format_desc *srcformat; + const struct pixel_format_desc *destformat; + DWORD srcshift[4], destshift[4]; + DWORD srcmask[4], destmask[4]; + BOOL process_channel[4]; + DWORD channelmask; +}; + +static void init_argb_conversion_info(const struct pixel_format_desc *srcformat, const struct pixel_format_desc *destformat, struct argb_conversion_info *info) +{ + UINT i; + ZeroMemory(info->process_channel, 4 * sizeof(BOOL)); + info->channelmask = 0; + + info->srcformat = srcformat; + info->destformat = destformat; + + for(i = 0;i < 4;i++) { + /* srcshift is used to extract the _relevant_ components */ + info->srcshift[i] = srcformat->shift[i] + max( srcformat->bits[i] - destformat->bits[i], 0); + + /* destshift is used to move the components to the correct position */ + info->destshift[i] = destformat->shift[i] + max(destformat->bits[i] - srcformat->bits[i], 0); + + info->srcmask[i] = ((1 << srcformat->bits[i]) - 1) << srcformat->shift[i]; + info->destmask[i] = ((1 << destformat->bits[i]) - 1) << destformat->shift[i]; + + /* channelmask specifies bits which aren't used in the source format but in the destination one */ + if(destformat->bits[i]) { + if(srcformat->bits[i]) info->process_channel[i] = TRUE; + else info->channelmask |= info->destmask[i]; + } + } +} + +/************************************************************ + * get_relevant_argb_components + * + * Extracts the relevant components from the source color and + * drops the less significant bits if they aren't used by the destination format. + */ +static void get_relevant_argb_components(const struct argb_conversion_info *info, const BYTE *col, DWORD *out) +{ + unsigned int i, j; + unsigned int component, mask; + + for (i = 0; i < 4; ++i) + { + if (!info->process_channel[i]) + continue; + + component = 0; + mask = info->srcmask[i]; + for (j = 0; j < 4 && mask; ++j) + { + if (info->srcshift[i] < j * 8) + component |= (col[j] & mask) << (j * 8 - info->srcshift[i]); + else + component |= (col[j] & mask) >> (info->srcshift[i] - j * 8); + mask >>= 8; + } + out[i] = component; + } +} + +static float d3dx_clamp(float value, float min_value, float max_value) +{ + if (isnan(value)) + return max_value; + return value < min_value ? min_value : value > max_value ? max_value : value; +} + +/************************************************************ + * make_argb_color + * + * Recombines the output of get_relevant_argb_components and converts + * it to the destination format. + */ +static DWORD make_argb_color(const struct argb_conversion_info *info, const DWORD *in) +{ + UINT i; + DWORD val = 0; + + for(i = 0;i < 4;i++) { + if(info->process_channel[i]) { + /* necessary to make sure that e.g. an X4R4G4B4 white maps to an R8G8B8 white instead of 0xf0f0f0 */ + signed int shift; + for(shift = info->destshift[i]; shift > info->destformat->shift[i]; shift -= info->srcformat->bits[i]) val |= in[i] << shift; + val |= (in[i] >> (info->destformat->shift[i] - shift)) << info->destformat->shift[i]; + } + } + val |= info->channelmask; /* new channels are set to their maximal value */ + return val; +} + +static enum range get_range_for_component_type(enum component_type type) +{ + switch (type) + { + case CTYPE_SNORM: + return RANGE_SNORM; + + case CTYPE_LUMA: + case CTYPE_INDEX: + case CTYPE_UNORM: + return RANGE_UNORM; + + case CTYPE_EMPTY: + case CTYPE_FLOAT: + return RANGE_FULL; + + default: + assert(0); + return RANGE_FULL; + } +} + +static void premultiply_alpha(struct vec4 *vec) +{ + vec->x *= vec->w; + vec->y *= vec->w; + vec->z *= vec->w; +} + +static void undo_premultiplied_alpha(struct vec4 *vec) +{ + vec->x = (vec->w == 0.0f) ? 0.0f : vec->x / vec->w; + vec->y = (vec->w == 0.0f) ? 0.0f : vec->y / vec->w; + vec->z = (vec->w == 0.0f) ? 0.0f : vec->z / vec->w; +} + +/* It doesn't work for components bigger than 32 bits (or somewhat smaller but unaligned). */ +void format_to_d3dx_color(const struct pixel_format_desc *format, const BYTE *src, const PALETTEENTRY *palette, + struct d3dx_color *dst) +{ + DWORD mask, tmp; + unsigned int c; + + dst->rgb_range = get_range_for_component_type(format->rgb_type); + dst->a_range = get_range_for_component_type(format->a_type); + for (c = 0; c < 4; ++c) + { + const enum component_type dst_ctype = !c ? format->a_type : format->rgb_type; + static const unsigned int component_offsets[4] = {3, 0, 1, 2}; + float *dst_component = &dst->value.x + component_offsets[c]; + + if (format->bits[c]) + { + mask = ~0u >> (32 - format->bits[c]); + + memcpy(&tmp, src + format->shift[c] / 8, + min(sizeof(DWORD), (format->shift[c] % 8 + format->bits[c] + 7) / 8)); + tmp = (tmp >> (format->shift[c] % 8)) & mask; + + switch (dst_ctype) + { + case CTYPE_FLOAT: + if (format->bits[c] == 16) + *dst_component = float_16_to_32(tmp); + else + *dst_component = *(float *)&tmp; + break; + + case CTYPE_INDEX: + *dst_component = (&palette[tmp].peRed)[component_offsets[c]] / 255.0f; + break; + + case CTYPE_LUMA: + case CTYPE_UNORM: + *dst_component = (float)tmp / mask; + break; + + case CTYPE_SNORM: + { + const uint32_t sign_bit = (1u << (format->bits[c] - 1)); + uint32_t tmp_extended = (tmp & sign_bit) ? (tmp | ~(sign_bit - 1)) : tmp; + + /* + * In order to clamp to an even range, we need to ignore + * the maximum negative value. + */ + if (tmp == sign_bit) + tmp_extended |= 1; + + *dst_component = (float)(((int32_t)tmp_extended)) / (sign_bit - 1); + break; + } + + default: + break; + } + } + else if (dst_ctype == CTYPE_LUMA) + { + assert(format->bits[1]); + *dst_component = dst->value.x; + } + else + { + *dst_component = 1.0f; + } + } +} + +/* It doesn't work for components bigger than 32 bits. */ +void format_from_d3dx_color(const struct pixel_format_desc *format, const struct d3dx_color *src, BYTE *dst) +{ + DWORD v, mask32; + unsigned int c, i; + + memset(dst, 0, format->bytes_per_pixel); + + for (c = 0; c < 4; ++c) + { + const enum component_type dst_ctype = !c ? format->a_type : format->rgb_type; + static const unsigned int component_offsets[4] = {3, 0, 1, 2}; + const float src_component = *(&src->value.x + component_offsets[c]); + const enum range src_range = !c ? src->a_range : src->rgb_range; + + if (!format->bits[c]) + continue; + + mask32 = ~0u >> (32 - format->bits[c]); + + switch (dst_ctype) + { + case CTYPE_FLOAT: + if (format->bits[c] == 16) + v = float_32_to_16(src_component); + else + v = *(DWORD *)&src_component; + break; + + case CTYPE_LUMA: + { + float val = src->value.x * 0.2125f + src->value.y * 0.7154f + src->value.z * 0.0721f; + + if (src_range == RANGE_SNORM) + val = (val + 1.0f) / 2.0f; + + v = d3dx_clamp(val, 0.0f, 1.0f) * ((1u << format->bits[c]) - 1) + 0.5f; + break; + } + + case CTYPE_UNORM: + { + float val = src_component; + + if (src_range == RANGE_SNORM) + val = (val + 1.0f) / 2.0f; + + v = d3dx_clamp(val, 0.0f, 1.0f) * ((1u << format->bits[c]) - 1) + 0.5f; + break; + } + + case CTYPE_SNORM: + { + const uint32_t max_value = (1u << (format->bits[c] - 1)) - 1; + float val = src_component; + + if (src_range == RANGE_UNORM) + val = (val * 2.0f) - 1.0f; + + v = d3dx_clamp(val, -1.0f, 1.0f) * max_value + 0.5f; + break; + } + + /* We shouldn't be trying to output to CTYPE_INDEX. */ + case CTYPE_INDEX: + assert(0); + break; + + default: + v = 0; + break; + } + + for (i = format->shift[c] / 8 * 8; i < format->shift[c] + format->bits[c]; i += 8) + { + BYTE mask, byte; + + if (format->shift[c] > i) + { + mask = mask32 << (format->shift[c] - i); + byte = (v << (format->shift[c] - i)) & mask; + } + else + { + mask = mask32 >> (i - format->shift[c]); + byte = (v >> (i - format->shift[c])) & mask; + } + dst[i / 8] |= byte; + } + } +} + +/************************************************************ + * copy_pixels + * + * Copies the source buffer to the destination buffer. + * Works for any pixel format. + * The source and the destination must be block-aligned. + */ +static void copy_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, + BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, const struct volume *size, + const struct pixel_format_desc *format) +{ + UINT row, slice; + BYTE *dst_addr; + const BYTE *src_addr; + UINT row_block_count = (size->width + format->block_width - 1) / format->block_width; + UINT row_count = (size->height + format->block_height - 1) / format->block_height; + + for (slice = 0; slice < size->depth; slice++) + { + src_addr = src + slice * src_slice_pitch; + dst_addr = dst + slice * dst_slice_pitch; + + for (row = 0; row < row_count; row++) + { + memcpy(dst_addr, src_addr, row_block_count * format->block_byte_count); + src_addr += src_row_pitch; + dst_addr += dst_row_pitch; + } + } +} + +/************************************************************ + * convert_argb_pixels + * + * Copies the source buffer to the destination buffer, performing + * any necessary format conversion and color keying. + * Pixels outsize the source rect are blacked out. + */ +static void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, const struct volume *src_size, + const struct pixel_format_desc *src_format, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, + const struct volume *dst_size, const struct pixel_format_desc *dst_format, DWORD color_key, + const PALETTEENTRY *palette, uint32_t filter_flags) +{ + struct argb_conversion_info conv_info, ck_conv_info; + const struct pixel_format_desc *ck_format; + BOOL src_pma, dst_pma; + DWORD channels[4]; + UINT min_width, min_height, min_depth; + UINT x, y, z; + + TRACE("src %p, src_row_pitch %u, src_slice_pitch %u, src_size %p, src_format %p, dst %p, " + "dst_row_pitch %u, dst_slice_pitch %u, dst_size %p, dst_format %p, color_key 0x%08lx, palette %p.\n", + src, src_row_pitch, src_slice_pitch, src_size, src_format, dst, dst_row_pitch, dst_slice_pitch, dst_size, + dst_format, color_key, palette); + + ZeroMemory(channels, sizeof(channels)); + init_argb_conversion_info(src_format, dst_format, &conv_info); + + src_pma = !!(filter_flags & D3DX_FILTER_PMA_IN); + dst_pma = !!(filter_flags & D3DX_FILTER_PMA_OUT); + min_width = min(src_size->width, dst_size->width); + min_height = min(src_size->height, dst_size->height); + min_depth = min(src_size->depth, dst_size->depth); + + if (color_key) + { + /* Color keys are always represented in D3DFMT_A8R8G8B8 format. */ + ck_format = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM); + init_argb_conversion_info(src_format, ck_format, &ck_conv_info); + } + + for (z = 0; z < min_depth; z++) { + const BYTE *src_slice_ptr = src + z * src_slice_pitch; + BYTE *dst_slice_ptr = dst + z * dst_slice_pitch; + + for (y = 0; y < min_height; y++) { + const BYTE *src_ptr = src_slice_ptr + y * src_row_pitch; + BYTE *dst_ptr = dst_slice_ptr + y * dst_row_pitch; + + for (x = 0; x < min_width; x++) { + if (filter_flags_match(filter_flags) && format_types_match(src_format, dst_format) + && src_format->bytes_per_pixel <= 4 && dst_format->bytes_per_pixel <= 4) + { + DWORD val; + + get_relevant_argb_components(&conv_info, src_ptr, channels); + val = make_argb_color(&conv_info, channels); + + if (color_key) + { + DWORD ck_pixel; + + get_relevant_argb_components(&ck_conv_info, src_ptr, channels); + ck_pixel = make_argb_color(&ck_conv_info, channels); + if (ck_pixel == color_key) + val &= ~conv_info.destmask[0]; + } + memcpy(dst_ptr, &val, dst_format->bytes_per_pixel); + } + else + { + struct d3dx_color color, tmp; + + format_to_d3dx_color(src_format, src_ptr, palette, &color); + if (src_pma && src_pma != dst_pma) + undo_premultiplied_alpha(&color.value); + tmp = color; + + if (color_key) + { + DWORD ck_pixel; + + format_from_d3dx_color(ck_format, &tmp, (BYTE *)&ck_pixel); + if (ck_pixel == color_key) + tmp.value.w = 0.0f; + } + + color = tmp; + if (dst_pma && src_pma != dst_pma) + premultiply_alpha(&color.value); + format_from_d3dx_color(dst_format, &color, dst_ptr); + } + + src_ptr += src_format->bytes_per_pixel; + dst_ptr += dst_format->bytes_per_pixel; + } + + if (src_size->width < dst_size->width) /* black out remaining pixels */ + memset(dst_ptr, 0, dst_format->bytes_per_pixel * (dst_size->width - src_size->width)); + } + + if (src_size->height < dst_size->height) /* black out remaining pixels */ + memset(dst + src_size->height * dst_row_pitch, 0, dst_row_pitch * (dst_size->height - src_size->height)); + } + if (src_size->depth < dst_size->depth) /* black out remaining pixels */ + memset(dst + src_size->depth * dst_slice_pitch, 0, dst_slice_pitch * (dst_size->depth - src_size->depth)); +} + +/************************************************************ + * point_filter_argb_pixels + * + * Copies the source buffer to the destination buffer, performing + * any necessary format conversion, color keying and stretching + * using a point filter. + */ +static void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, const struct volume *src_size, + const struct pixel_format_desc *src_format, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, + const struct volume *dst_size, const struct pixel_format_desc *dst_format, DWORD color_key, + const PALETTEENTRY *palette, uint32_t filter_flags) +{ + struct argb_conversion_info conv_info, ck_conv_info; + const struct pixel_format_desc *ck_format; + BOOL src_pma, dst_pma; + DWORD channels[4]; + UINT x, y, z; + + TRACE("src %p, src_row_pitch %u, src_slice_pitch %u, src_size %p, src_format %p, dst %p, " + "dst_row_pitch %u, dst_slice_pitch %u, dst_size %p, dst_format %p, color_key 0x%08lx, palette %p.\n", + src, src_row_pitch, src_slice_pitch, src_size, src_format, dst, dst_row_pitch, dst_slice_pitch, dst_size, + dst_format, color_key, palette); + + src_pma = !!(filter_flags & D3DX_FILTER_PMA_IN); + dst_pma = !!(filter_flags & D3DX_FILTER_PMA_OUT); + ZeroMemory(channels, sizeof(channels)); + init_argb_conversion_info(src_format, dst_format, &conv_info); + + if (color_key) + { + /* Color keys are always represented in D3DFMT_A8R8G8B8 format. */ + ck_format = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM); + init_argb_conversion_info(src_format, ck_format, &ck_conv_info); + } + + for (z = 0; z < dst_size->depth; z++) + { + BYTE *dst_slice_ptr = dst + z * dst_slice_pitch; + const BYTE *src_slice_ptr = src + src_slice_pitch * (z * src_size->depth / dst_size->depth); + + for (y = 0; y < dst_size->height; y++) + { + BYTE *dst_ptr = dst_slice_ptr + y * dst_row_pitch; + const BYTE *src_row_ptr = src_slice_ptr + src_row_pitch * (y * src_size->height / dst_size->height); + + for (x = 0; x < dst_size->width; x++) + { + const BYTE *src_ptr = src_row_ptr + (x * src_size->width / dst_size->width) * src_format->bytes_per_pixel; + + if (filter_flags_match(filter_flags) && format_types_match(src_format, dst_format) + && src_format->bytes_per_pixel <= 4 && dst_format->bytes_per_pixel <= 4) + { + DWORD val; + + get_relevant_argb_components(&conv_info, src_ptr, channels); + val = make_argb_color(&conv_info, channels); + + if (color_key) + { + DWORD ck_pixel; + + get_relevant_argb_components(&ck_conv_info, src_ptr, channels); + ck_pixel = make_argb_color(&ck_conv_info, channels); + if (ck_pixel == color_key) + val &= ~conv_info.destmask[0]; + } + memcpy(dst_ptr, &val, dst_format->bytes_per_pixel); + } + else + { + struct d3dx_color color, tmp; + + format_to_d3dx_color(src_format, src_ptr, palette, &color); + if (src_pma && src_pma != dst_pma) + undo_premultiplied_alpha(&color.value); + tmp = color; + + if (color_key) + { + DWORD ck_pixel; + + format_from_d3dx_color(ck_format, &tmp, (BYTE *)&ck_pixel); + if (ck_pixel == color_key) + tmp.value.w = 0.0f; + } + + color = tmp; + if (dst_pma && src_pma != dst_pma) + premultiply_alpha(&color.value); + format_from_d3dx_color(dst_format, &color, dst_ptr); + } + + dst_ptr += dst_format->bytes_per_pixel; + } + } + } +} + +struct d3dx_bcn_decompression_context +{ + void (*decompress_bcn_block)(const void *, void *, int); + const struct pixel_format_desc *compressed_format_desc; + struct d3dx_pixels *compressed_pixels; + + const struct pixel_format_desc *decompressed_format_desc; + uint8_t cur_block_decompressed[192]; + uint32_t cur_block_row_pitch; + int32_t cur_block_x; + int32_t cur_block_y; + int32_t cur_block_z; +}; + +static void d3dx_init_bcn_decompression_context(struct d3dx_bcn_decompression_context *context, + struct d3dx_pixels *pixels, const struct pixel_format_desc *desc, const struct pixel_format_desc *dst_desc) +{ + memset(context, 0, sizeof(*context)); + switch (desc->format) + { + case D3DX_PIXEL_FORMAT_DXT1_UNORM: + context->decompress_bcn_block = bcdec_bc1; + break; + + case D3DX_PIXEL_FORMAT_DXT2_UNORM: + case D3DX_PIXEL_FORMAT_DXT3_UNORM: + context->decompress_bcn_block = bcdec_bc2; + break; + + case D3DX_PIXEL_FORMAT_DXT4_UNORM: + case D3DX_PIXEL_FORMAT_DXT5_UNORM: + context->decompress_bcn_block = bcdec_bc3; + break; + + default: + assert(0); + break; + } + + context->compressed_format_desc = desc; + context->compressed_pixels = pixels; + + context->decompressed_format_desc = dst_desc; + context->cur_block_row_pitch = dst_desc->bytes_per_pixel * desc->block_width; + context->cur_block_x = context->cur_block_y = context->cur_block_z = -1; +} + +static void d3dx_fetch_bcn_texel(struct d3dx_bcn_decompression_context *context, int32_t x, int32_t y, int32_t z, void *texel) +{ + const struct pixel_format_desc *decomp_fmt_desc = context->decompressed_format_desc; + const struct pixel_format_desc *comp_fmt_desc = context->compressed_format_desc; + const int32_t y_aligned = (y & ~(comp_fmt_desc->block_height - 1)); + const int32_t x_aligned = (x & ~(comp_fmt_desc->block_width - 1)); + uint32_t pixel_offset; + + if (z != context->cur_block_z || (x_aligned != context->cur_block_x) || (y_aligned != context->cur_block_y)) + { + const BYTE *block_ptr = context->compressed_pixels->data; + + block_ptr += z * context->compressed_pixels->slice_pitch; + block_ptr += (y / comp_fmt_desc->block_height) * context->compressed_pixels->row_pitch; + block_ptr += (x / comp_fmt_desc->block_width) * comp_fmt_desc->block_byte_count; + context->decompress_bcn_block(block_ptr, context->cur_block_decompressed, context->cur_block_row_pitch); + context->cur_block_x = (x & (comp_fmt_desc->block_width)); + context->cur_block_y = (y & (comp_fmt_desc->block_height)); + context->cur_block_z = z; + } + + pixel_offset = (y & (comp_fmt_desc->block_height - 1)) * context->cur_block_row_pitch; + pixel_offset += (x & (comp_fmt_desc->block_width - 1)) * decomp_fmt_desc->bytes_per_pixel; + memcpy(texel, context->cur_block_decompressed + pixel_offset, decomp_fmt_desc->bytes_per_pixel); +} + +static HRESULT d3dx_pixels_decompress(struct d3dx_pixels *pixels, const struct pixel_format_desc *desc, + BOOL is_dst, void **out_memory, uint32_t *out_row_pitch, uint32_t *out_slice_pitch, + const struct pixel_format_desc **out_desc) +{ + uint32_t x, y, z, uncompressed_slice_pitch, uncompressed_row_pitch; + const struct pixel_format_desc *uncompressed_desc = NULL; + struct d3dx_bcn_decompression_context context; + const struct volume *size = &pixels->size; + BYTE *uncompressed_mem; + + switch (desc->format) + { + case D3DX_PIXEL_FORMAT_DXT1_UNORM: + uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); + break; + + case D3DX_PIXEL_FORMAT_DXT2_UNORM: + case D3DX_PIXEL_FORMAT_DXT3_UNORM: + uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); + break; + + case D3DX_PIXEL_FORMAT_DXT4_UNORM: + case D3DX_PIXEL_FORMAT_DXT5_UNORM: + uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); + break; + + default: + FIXME("Unexpected compressed texture format %u.\n", desc->format); + return E_NOTIMPL; + } + + uncompressed_row_pitch = size->width * uncompressed_desc->bytes_per_pixel; + uncompressed_slice_pitch = uncompressed_row_pitch * size->height; + if (!(uncompressed_mem = malloc(size->depth * uncompressed_slice_pitch))) + return E_OUTOFMEMORY; + + /* + * For compressed destination pixels, width/height will represent + * the entire set of compressed blocks our destination rectangle touches. + * If we're only updating a sub-area of any blocks, we need to decompress + * the pixels outside of the sub-area. + */ + if (is_dst) + { + const RECT aligned_rect = { 0, 0, size->width, size->height }; + + /* + * If our destination covers the entire set of blocks, no + * decompression needs to be done, just return the allocated memory. + */ + if (EqualRect(&aligned_rect, &pixels->unaligned_rect)) + goto exit; + } + + TRACE("Decompressing pixels.\n"); + d3dx_init_bcn_decompression_context(&context, pixels, desc, uncompressed_desc); + for (z = 0; z < size->depth; ++z) + { + for (y = 0; y < size->height; ++y) + { + BYTE *ptr = &uncompressed_mem[(z * uncompressed_slice_pitch) + (y * uncompressed_row_pitch)]; + for (x = 0; x < size->width; ++x) + { + const POINT pt = { x, y }; + + if (!is_dst) + d3dx_fetch_bcn_texel(&context, x + pixels->unaligned_rect.left, y + pixels->unaligned_rect.top, z, ptr); + else if (!PtInRect(&pixels->unaligned_rect, pt)) + d3dx_fetch_bcn_texel(&context, x, y, z, ptr); + ptr += uncompressed_desc->bytes_per_pixel; + } + } + } + +exit: + *out_memory = uncompressed_mem; + *out_row_pitch = uncompressed_row_pitch; + *out_slice_pitch = uncompressed_slice_pitch; + *out_desc = uncompressed_desc; + + return S_OK; +} + +static void d3dx_init_bcn_block_buffer(const void *src_data, uint32_t src_row_pitch, uint8_t src_width, uint8_t src_height, + const struct pixel_format_desc *src_desc, uint8_t *block_buf) +{ + uint8_t x, y; + + for (y = 0; y < 4; ++y) + { + const uint8_t *src_row = ((const uint8_t *)src_data) + ((y % src_height) * src_row_pitch); + + for (x = 0; x < 4; ++x) + { + uint8_t *dst_pixel = &block_buf[(y * 4 * src_desc->bytes_per_pixel) + (x * src_desc->bytes_per_pixel)]; + const uint8_t *src_pixel = src_row + (((x % src_width)) * src_desc->bytes_per_pixel); + + memcpy(dst_pixel, src_pixel, src_desc->bytes_per_pixel); + } + } +} + +static void d3dx_compress_bc1_block(const void *src_data, uint32_t src_row_pitch, uint8_t src_width, uint8_t src_height, + void *dst_data) +{ + const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); + uint8_t tmp_buf[4 * 4 * 4]; + + d3dx_init_bcn_block_buffer(src_data, src_row_pitch, src_width, src_height, fmt_desc, tmp_buf); + + stb_compress_dxt_block(dst_data, (const uint8_t *)tmp_buf, FALSE, 0); +} + +static void d3dx_compress_bc2_block(const void *src_data, uint32_t src_row_pitch, uint8_t src_width, uint8_t src_height, + void *dst_data) +{ + const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); + uint8_t *dst_data_offset = dst_data; + uint8_t tmp_buf[4 * 4 * 4], y; + + d3dx_init_bcn_block_buffer(src_data, src_row_pitch, src_width, src_height, fmt_desc, tmp_buf); + for (y = 0; y < 4; ++y) + { + uint8_t *tmp_row = &tmp_buf[y * 4 * fmt_desc->bytes_per_pixel]; + + dst_data_offset[0] = (tmp_row[7] & 0xf0); + dst_data_offset[0] |= (tmp_row[3] >> 4); + dst_data_offset[1] = (tmp_row[15] & 0xf0); + dst_data_offset[1] |= (tmp_row[11] >> 4); + + /* + * Set all alpha values to 0xff so they aren't considered during + * compression. + */ + tmp_row[3] = tmp_row[7] = tmp_row[11] = tmp_row[15] = 0xff; + dst_data_offset += 2; + } + + stb_compress_dxt_block(dst_data_offset, (const unsigned char *)tmp_buf, FALSE, 0); +} + +static void d3dx_compress_bc3_block(const void *src_data, uint32_t src_row_pitch, uint8_t src_width, uint8_t src_height, + void *dst_data) +{ + const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); + uint8_t tmp_buf[4 * 4 * 4]; + + d3dx_init_bcn_block_buffer(src_data, src_row_pitch, src_width, src_height, fmt_desc, tmp_buf); + + stb_compress_dxt_block(dst_data, (const uint8_t *)tmp_buf, TRUE, 0); +} + +static HRESULT d3dx_pixels_compress(struct d3dx_pixels *src_pixels, + const struct pixel_format_desc *src_desc, struct d3dx_pixels *dst_pixels, + const struct pixel_format_desc *dst_desc) +{ + void (*compress_bcn_block)(const void *, uint32_t, uint8_t, uint8_t, void *) = NULL; + uint32_t x, y, z; + + /* Pick a compression function. */ + switch (dst_desc->format) + { + case D3DX_PIXEL_FORMAT_DXT1_UNORM: + compress_bcn_block = d3dx_compress_bc1_block; + break; + + case D3DX_PIXEL_FORMAT_DXT2_UNORM: + case D3DX_PIXEL_FORMAT_DXT3_UNORM: + compress_bcn_block = d3dx_compress_bc2_block; + break; + + case D3DX_PIXEL_FORMAT_DXT4_UNORM: + case D3DX_PIXEL_FORMAT_DXT5_UNORM: + compress_bcn_block = d3dx_compress_bc3_block; + break; + + default: + FIXME("Unexpected compressed texture format %u.\n", dst_desc->format); + return E_NOTIMPL; + } + + assert(compress_bcn_block); + + TRACE("Compressing pixels.\n"); + for (z = 0; z < src_pixels->size.depth; ++z) + { + const BYTE *src_slice = ((const BYTE *)src_pixels->data) + (z * src_pixels->slice_pitch); + BYTE *dst_slice = ((BYTE *)dst_pixels->data) + (z * dst_pixels->slice_pitch); + + for (y = 0; y < src_pixels->size.height; y += dst_desc->block_height) + { + BYTE *dst_ptr = &dst_slice[(y / dst_desc->block_height) * dst_pixels->row_pitch]; + uint8_t tmp_src_height = min(dst_desc->block_height, src_pixels->size.height - y); + const BYTE *src_ptr = &src_slice[y * src_pixels->row_pitch]; + + for (x = 0; x < src_pixels->size.width; x += dst_desc->block_width) + { + uint8_t tmp_src_width = min(dst_desc->block_width, src_pixels->size.width - x); + + compress_bcn_block(src_ptr, src_pixels->row_pitch, tmp_src_width, tmp_src_height, dst_ptr); + src_ptr += (src_desc->bytes_per_pixel * dst_desc->block_width); + dst_ptr += dst_desc->block_byte_count; + } + } + } + + return S_OK; +} + +HRESULT d3dx_pixels_init(const void *data, uint32_t row_pitch, uint32_t slice_pitch, + const PALETTEENTRY *palette, enum d3dx_pixel_format_id format, uint32_t left, uint32_t top, uint32_t right, + uint32_t bottom, uint32_t front, uint32_t back, struct d3dx_pixels *pixels) +{ + const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(format); + const BYTE *ptr = data; + RECT unaligned_rect; + + memset(pixels, 0, sizeof(*pixels)); + if (is_unknown_format(fmt_desc)) + { + FIXME("Unsupported format %#x.\n", format); + return E_NOTIMPL; + } + + ptr += front * slice_pitch; + ptr += (top / fmt_desc->block_height) * row_pitch; + ptr += (left / fmt_desc->block_width) * fmt_desc->block_byte_count; + + if (is_compressed_format(fmt_desc)) + { + uint32_t left_aligned, top_aligned; + + top_aligned = top & ~(fmt_desc->block_height - 1); + left_aligned = left & ~(fmt_desc->block_width - 1); + SetRect(&unaligned_rect, left, top, right, bottom); + OffsetRect(&unaligned_rect, -left_aligned, -top_aligned); + } + else + { + SetRect(&unaligned_rect, 0, 0, (right - left), (bottom - top)); + } + + if (!slice_pitch) + slice_pitch = row_pitch * (bottom - top); + set_d3dx_pixels(pixels, ptr, row_pitch, slice_pitch, palette, (right - left), (bottom - top), (back - front), + &unaligned_rect); + + return S_OK; +} + +static const char *debug_d3dx_pixels(struct d3dx_pixels *pixels) +{ + if (!pixels) + return "(null)"; + return wine_dbg_sprintf("(data %p, row_pitch %d, slice_pitch %d, palette %p, width %d, height %d, depth %d, " + "unaligned_rect %s)", pixels->data, pixels->row_pitch, pixels->slice_pitch, pixels->palette, + pixels->size.width, pixels->size.height, pixels->size.depth, wine_dbgstr_rect(&pixels->unaligned_rect)); +} + +HRESULT d3dx_load_pixels_from_pixels(struct d3dx_pixels *dst_pixels, + const struct pixel_format_desc *dst_desc, struct d3dx_pixels *src_pixels, + const struct pixel_format_desc *src_desc, uint32_t filter_flags, uint32_t color_key) +{ + struct volume src_size, dst_size, dst_size_aligned; + BOOL src_pma, dst_pma; + HRESULT hr = S_OK; + + TRACE("dst_pixels %s, dst_desc %p, src_pixels %s, src_desc %p, filter_flags %#x, color_key %#x.\n", + debug_d3dx_pixels(dst_pixels), dst_desc, debug_d3dx_pixels(src_pixels), src_desc, + filter_flags, color_key); + + if (src_desc->flags & FMT_FLAG_PM_ALPHA) + filter_flags |= D3DX_FILTER_PMA_IN; + + if (dst_desc->flags & FMT_FLAG_PM_ALPHA) + filter_flags |= D3DX_FILTER_PMA_OUT; + + src_pma = !!(filter_flags & D3DX_FILTER_PMA_IN); + dst_pma = !!(filter_flags & D3DX_FILTER_PMA_OUT); + + if (is_compressed_format(src_desc)) + set_volume_struct(&src_size, (src_pixels->unaligned_rect.right - src_pixels->unaligned_rect.left), + (src_pixels->unaligned_rect.bottom - src_pixels->unaligned_rect.top), src_pixels->size.depth); + else + src_size = src_pixels->size; + + dst_size_aligned = dst_pixels->size; + if (is_compressed_format(dst_desc)) + set_volume_struct(&dst_size, (dst_pixels->unaligned_rect.right - dst_pixels->unaligned_rect.left), + (dst_pixels->unaligned_rect.bottom - dst_pixels->unaligned_rect.top), dst_pixels->size.depth); + else + dst_size = dst_size_aligned; + + /* Everything matches, simply copy the pixels. */ + if (src_desc->format == dst_desc->format + && (dst_size.width == src_size.width && !(dst_size.width % dst_desc->block_width)) + && (dst_size.height == src_size.height && !(dst_size.height % dst_desc->block_height)) + && (dst_size.depth == src_size.depth) + && (src_pma == dst_pma) + && color_key == 0 + && !(src_pixels->unaligned_rect.left & (src_desc->block_width - 1)) + && !(src_pixels->unaligned_rect.top & (src_desc->block_height - 1)) + && !(dst_pixels->unaligned_rect.left & (dst_desc->block_width - 1)) + && !(dst_pixels->unaligned_rect.top & (dst_desc->block_height - 1))) + { + TRACE("Simple copy.\n"); + copy_pixels(src_pixels->data, src_pixels->row_pitch, src_pixels->slice_pitch, (void *)dst_pixels->data, + dst_pixels->row_pitch, dst_pixels->slice_pitch, &src_size, src_desc); + return S_OK; + } + + /* Stretching or format conversion. */ + if (!is_conversion_from_supported(src_desc) + || !is_conversion_to_supported(dst_desc)) + { + FIXME("Unsupported format conversion %#x -> %#x.\n", src_desc->format, dst_desc->format); + return E_NOTIMPL; + } + + /* + * If the source is a compressed image, we need to decompress it first + * before doing any modifications. + */ + if (is_compressed_format(src_desc)) + { + uint32_t uncompressed_row_pitch, uncompressed_slice_pitch; + const struct pixel_format_desc *uncompressed_desc; + void *uncompressed_mem = NULL; + + hr = d3dx_pixels_decompress(src_pixels, src_desc, FALSE, &uncompressed_mem, &uncompressed_row_pitch, + &uncompressed_slice_pitch, &uncompressed_desc); + if (SUCCEEDED(hr)) + { + struct d3dx_pixels uncompressed_pixels; + + d3dx_pixels_init(uncompressed_mem, uncompressed_row_pitch, uncompressed_slice_pitch, NULL, + uncompressed_desc->format, 0, 0, src_pixels->size.width, src_pixels->size.height, + 0, src_pixels->size.depth, &uncompressed_pixels); + + hr = d3dx_load_pixels_from_pixels(dst_pixels, dst_desc, &uncompressed_pixels, uncompressed_desc, + filter_flags, color_key); + } + free(uncompressed_mem); + goto exit; + } + + /* Same as the above, need to decompress the destination prior to modifying. */ + if (is_compressed_format(dst_desc)) + { + uint32_t uncompressed_row_pitch, uncompressed_slice_pitch; + const struct pixel_format_desc *uncompressed_desc; + struct d3dx_pixels uncompressed_pixels; + void *uncompressed_mem = NULL; + + hr = d3dx_pixels_decompress(dst_pixels, dst_desc, TRUE, &uncompressed_mem, &uncompressed_row_pitch, + &uncompressed_slice_pitch, &uncompressed_desc); + if (FAILED(hr)) + goto exit; + + d3dx_pixels_init(uncompressed_mem, uncompressed_row_pitch, uncompressed_slice_pitch, NULL, + uncompressed_desc->format, dst_pixels->unaligned_rect.left, dst_pixels->unaligned_rect.top, + dst_pixels->unaligned_rect.right, dst_pixels->unaligned_rect.bottom, 0, dst_pixels->size.depth, + &uncompressed_pixels); + + hr = d3dx_load_pixels_from_pixels(&uncompressed_pixels, uncompressed_desc, src_pixels, src_desc, filter_flags, + color_key); + if (SUCCEEDED(hr)) + { + d3dx_pixels_init(uncompressed_mem, uncompressed_row_pitch, uncompressed_slice_pitch, NULL, + uncompressed_desc->format, 0, 0, dst_size_aligned.width, dst_size_aligned.height, 0, + dst_pixels->size.depth, &uncompressed_pixels); + + hr = d3dx_pixels_compress(&uncompressed_pixels, uncompressed_desc, dst_pixels, dst_desc); + if (FAILED(hr)) + WARN("Failed to compress pixels, hr %#lx.\n", hr); + } + free(uncompressed_mem); + goto exit; + } + + if ((filter_flags & 0xf) == D3DX_FILTER_NONE) + { + convert_argb_pixels(src_pixels->data, src_pixels->row_pitch, src_pixels->slice_pitch, &src_size, src_desc, + (BYTE *)dst_pixels->data, dst_pixels->row_pitch, dst_pixels->slice_pitch, &dst_size, dst_desc, + color_key, src_pixels->palette, filter_flags); + } + else /* if ((filter & 0xf) == D3DX_FILTER_POINT) */ + { + if ((filter_flags & 0xf) != D3DX_FILTER_POINT) + FIXME("Unhandled filter %#x.\n", filter_flags); + + /* Always apply a point filter until D3DX_FILTER_LINEAR, + * D3DX_FILTER_TRIANGLE and D3DX_FILTER_BOX are implemented. */ + point_filter_argb_pixels(src_pixels->data, src_pixels->row_pitch, src_pixels->slice_pitch, &src_size, + src_desc, (BYTE *)dst_pixels->data, dst_pixels->row_pitch, dst_pixels->slice_pitch, &dst_size, + dst_desc, color_key, src_pixels->palette, filter_flags); + } + +exit: + if (FAILED(hr)) + WARN("Failed to load pixels, hr %#lx.\n", hr); + return hr; +} + +void get_aligned_rect(uint32_t left, uint32_t top, uint32_t right, uint32_t bottom, uint32_t width, uint32_t height, + const struct pixel_format_desc *fmt_desc, RECT *aligned_rect) +{ + SetRect(aligned_rect, left, top, right, bottom); + if (aligned_rect->left & (fmt_desc->block_width - 1)) + aligned_rect->left = aligned_rect->left & ~(fmt_desc->block_width - 1); + if (aligned_rect->top & (fmt_desc->block_height - 1)) + aligned_rect->top = aligned_rect->top & ~(fmt_desc->block_height - 1); + if (aligned_rect->right & (fmt_desc->block_width - 1) && aligned_rect->right != width) + aligned_rect->right = min((aligned_rect->right + fmt_desc->block_width - 1) + & ~(fmt_desc->block_width - 1), width); + if (aligned_rect->bottom & (fmt_desc->block_height - 1) && aligned_rect->bottom != height) + aligned_rect->bottom = min((aligned_rect->bottom + fmt_desc->block_height - 1) + & ~(fmt_desc->block_height - 1), height); +} diff --git a/dlls/d3dx9_36/d3dx_helpers.h b/dlls/d3dx9_36/d3dx_helpers.h new file mode 100644 index 000000000000..4d508a6a8dac --- /dev/null +++ b/dlls/d3dx9_36/d3dx_helpers.h @@ -0,0 +1,408 @@ +/* + * Copyright 2024 Connor McAdams for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#ifndef __WINE_D3DX_HELPERS_H +#define __WINE_D3DX_HELPERS_H + +#include +#include "windef.h" /* For RECT. */ +#include "wingdi.h" /* For PALETTEENTRY. */ + +#if D3DX_D3D_VERSION == 9 +#define COBJMACROS +#include "d3dx9.h" + +#define D3DX_ERROR_INVALID_DATA D3DXERR_INVALIDDATA; + +#define ID3DXBlob ID3DXBuffer +#define d3dx_create_blob(size, blob) D3DXCreateBuffer(size, blob) +#define d3dx_blob_get_buffer_pointer(blob) ID3DXBuffer_GetBufferPointer(blob) +#define d3dx_blob_release(blob) ID3DXBuffer_Release(blob) +#endif /* D3DX_D3D_VERSION == 9 */ + +#ifndef MAKEFOURCC +#define MAKEFOURCC(ch0, ch1, ch2, ch3) \ + ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ + ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 )) +#endif + +#define DDS_PALETTE_SIZE (sizeof(PALETTEENTRY) * 256) + +/* dds_header.flags */ +#define DDS_CAPS 0x1 +#define DDS_HEIGHT 0x2 +#define DDS_WIDTH 0x4 +#define DDS_PITCH 0x8 +#define DDS_PIXELFORMAT 0x1000 +#define DDS_MIPMAPCOUNT 0x20000 +#define DDS_LINEARSIZE 0x80000 +#define DDS_DEPTH 0x800000 + +/* dds_header.caps */ +#define DDSCAPS_ALPHA 0x2 +#define DDS_CAPS_COMPLEX 0x8 +#define DDSCAPS_PALETTE 0x100 +#define DDS_CAPS_TEXTURE 0x1000 +#define DDS_CAPS_MIPMAP 0x400000 + +/* dds_header.caps2 */ +#define DDS_CAPS2_CUBEMAP 0x200 +#define DDS_CAPS2_CUBEMAP_POSITIVEX 0x400 +#define DDS_CAPS2_CUBEMAP_NEGATIVEX 0x800 +#define DDS_CAPS2_CUBEMAP_POSITIVEY 0x1000 +#define DDS_CAPS2_CUBEMAP_NEGATIVEY 0x2000 +#define DDS_CAPS2_CUBEMAP_POSITIVEZ 0x4000 +#define DDS_CAPS2_CUBEMAP_NEGATIVEZ 0x8000 +#define DDS_CAPS2_CUBEMAP_ALL_FACES ( DDS_CAPS2_CUBEMAP_POSITIVEX | DDS_CAPS2_CUBEMAP_NEGATIVEX \ + | DDS_CAPS2_CUBEMAP_POSITIVEY | DDS_CAPS2_CUBEMAP_NEGATIVEY \ + | DDS_CAPS2_CUBEMAP_POSITIVEZ | DDS_CAPS2_CUBEMAP_NEGATIVEZ ) +#define DDS_CAPS2_VOLUME 0x200000 + +/* dds_pixel_format.flags */ +#define DDS_PF_ALPHA 0x1 +#define DDS_PF_ALPHA_ONLY 0x2 +#define DDS_PF_FOURCC 0x4 +#define DDS_PF_INDEXED 0x20 +#define DDS_PF_RGB 0x40 +#define DDS_PF_YUV 0x200 +#define DDS_PF_LUMINANCE 0x20000 +#define DDS_PF_BUMPLUMINANCE 0x40000 +#define DDS_PF_BUMPDUDV 0x80000 + +struct dds_pixel_format +{ + DWORD size; + DWORD flags; + DWORD fourcc; + DWORD bpp; + DWORD rmask; + DWORD gmask; + DWORD bmask; + DWORD amask; +}; + +struct dds_header +{ + DWORD signature; + DWORD size; + DWORD flags; + DWORD height; + DWORD width; + DWORD pitch_or_linear_size; + DWORD depth; + DWORD miplevels; + DWORD reserved[11]; + struct dds_pixel_format pixel_format; + DWORD caps; + DWORD caps2; + DWORD caps3; + DWORD caps4; + DWORD reserved2; +}; + +/* These are custom Wine only filter flags. */ +#define D3DX_FILTER_PMA_IN 0x00800000 +#define D3DX_FILTER_PMA_OUT 0x01000000 +#define D3DX_FILTER_PMA 0x01800000 + +struct vec4 +{ + float x, y, z, w; +}; + +enum range { + RANGE_FULL = 0, + RANGE_UNORM = 1, + RANGE_SNORM = 2, +}; + +struct d3dx_color +{ + struct vec4 value; + enum range rgb_range; + enum range a_range; +}; + +static inline void set_d3dx_color(struct d3dx_color *color, const struct vec4 *value, enum range rgb_range, + enum range a_range) +{ + color->value = *value; + color->rgb_range = rgb_range; + color->a_range = a_range; +} + +struct volume +{ + UINT width; + UINT height; + UINT depth; +}; + +static inline void set_volume_struct(struct volume *volume, uint32_t width, uint32_t height, uint32_t depth) +{ + volume->width = width; + volume->height = height; + volume->depth = depth; +} + +enum d3dx_image_file_format +{ + D3DX_IMAGE_FILE_FORMAT_BMP = 0, + D3DX_IMAGE_FILE_FORMAT_JPG = 1, + D3DX_IMAGE_FILE_FORMAT_TGA = 2, + D3DX_IMAGE_FILE_FORMAT_PNG = 3, + D3DX_IMAGE_FILE_FORMAT_DDS = 4, + D3DX_IMAGE_FILE_FORMAT_PPM = 5, + D3DX_IMAGE_FILE_FORMAT_DIB = 6, + D3DX_IMAGE_FILE_FORMAT_HDR = 7, + D3DX_IMAGE_FILE_FORMAT_PFM = 8, + D3DX_IMAGE_FILE_FORMAT_FORCE_DWORD = 0x7fffffff +}; + +enum d3dx_resource_type +{ + D3DX_RESOURCE_TYPE_TEXTURE_2D, + D3DX_RESOURCE_TYPE_TEXTURE_3D, + D3DX_RESOURCE_TYPE_CUBE_TEXTURE, + D3DX_RESOURCE_TYPE_COUNT, +}; + +/* These values act as indexes into the pixel_format_desc table. */ +enum d3dx_pixel_format_id +{ + D3DX_PIXEL_FORMAT_B8G8R8_UNORM, + D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM, + D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM, + D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM, + D3DX_PIXEL_FORMAT_R8G8B8X8_UNORM, + D3DX_PIXEL_FORMAT_B5G6R5_UNORM, + D3DX_PIXEL_FORMAT_B5G5R5X1_UNORM, + D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM, + D3DX_PIXEL_FORMAT_B2G3R3_UNORM, + D3DX_PIXEL_FORMAT_B2G3R3A8_UNORM, + D3DX_PIXEL_FORMAT_B4G4R4A4_UNORM, + D3DX_PIXEL_FORMAT_B4G4R4X4_UNORM, + D3DX_PIXEL_FORMAT_B10G10R10A2_UNORM, + D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM, + D3DX_PIXEL_FORMAT_R16G16B16_UNORM, + D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM, + D3DX_PIXEL_FORMAT_R16G16_UNORM, + D3DX_PIXEL_FORMAT_A8_UNORM, + D3DX_PIXEL_FORMAT_L8A8_UNORM, + D3DX_PIXEL_FORMAT_L4A4_UNORM, + D3DX_PIXEL_FORMAT_L8_UNORM, + D3DX_PIXEL_FORMAT_L16_UNORM, + D3DX_PIXEL_FORMAT_DXT1_UNORM, + D3DX_PIXEL_FORMAT_DXT2_UNORM, + D3DX_PIXEL_FORMAT_DXT3_UNORM, + D3DX_PIXEL_FORMAT_DXT4_UNORM, + D3DX_PIXEL_FORMAT_DXT5_UNORM, + D3DX_PIXEL_FORMAT_R16_FLOAT, + D3DX_PIXEL_FORMAT_R16G16_FLOAT, + D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT, + D3DX_PIXEL_FORMAT_R32_FLOAT, + D3DX_PIXEL_FORMAT_R32G32_FLOAT, + D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT, + D3DX_PIXEL_FORMAT_P8_UINT, + D3DX_PIXEL_FORMAT_P8_UINT_A8_UNORM, + D3DX_PIXEL_FORMAT_U8V8W8Q8_SNORM, + D3DX_PIXEL_FORMAT_U16V16W16Q16_SNORM, + D3DX_PIXEL_FORMAT_U8V8_SNORM, + D3DX_PIXEL_FORMAT_U16V16_SNORM, + D3DX_PIXEL_FORMAT_U8V8_SNORM_L8X8_UNORM, + D3DX_PIXEL_FORMAT_U10V10W10_SNORM_A2_UNORM, + D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM, + D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM, + D3DX_PIXEL_FORMAT_UYVY, + D3DX_PIXEL_FORMAT_YUY2, + D3DX_PIXEL_FORMAT_COUNT, +}; + +/* for internal use */ +enum component_type +{ + CTYPE_EMPTY, + CTYPE_UNORM, + CTYPE_SNORM, + CTYPE_FLOAT, + CTYPE_LUMA, + CTYPE_INDEX, +}; + +enum format_flag +{ + FMT_FLAG_DXT = 0x01, + FMT_FLAG_PACKED = 0x02, + /* Internal only format, has no exact D3DFORMAT equivalent. */ + FMT_FLAG_INTERNAL = 0x04, + FMT_FLAG_PM_ALPHA = 0x08, +}; + +struct pixel_format_desc { + enum d3dx_pixel_format_id format; + BYTE bits[4]; + BYTE shift[4]; + UINT bytes_per_pixel; + UINT block_width; + UINT block_height; + UINT block_byte_count; + enum component_type a_type; + enum component_type rgb_type; + uint32_t flags; +}; + +struct d3dx_pixels +{ + const void *data; + uint32_t row_pitch; + uint32_t slice_pitch; + const PALETTEENTRY *palette; + + struct volume size; + RECT unaligned_rect; +}; + +static inline void set_d3dx_pixels(struct d3dx_pixels *pixels, const void *data, uint32_t row_pitch, + uint32_t slice_pitch, const PALETTEENTRY *palette, uint32_t width, uint32_t height, uint32_t depth, + const RECT *unaligned_rect) +{ + pixels->data = data; + pixels->row_pitch = row_pitch; + pixels->slice_pitch = slice_pitch; + pixels->palette = palette; + set_volume_struct(&pixels->size, width, height, depth); + pixels->unaligned_rect = *unaligned_rect; +} + +#define D3DX_IMAGE_INFO_ONLY 1 +struct d3dx_image +{ + enum d3dx_resource_type resource_type; + enum d3dx_pixel_format_id format; + + struct volume size; + uint32_t mip_levels; + uint32_t layer_count; + + BYTE *pixels; + PALETTEENTRY *palette; + uint32_t layer_pitch; + + /* + * image_buf and image_palette are pointers to allocated memory used to store + * image data. If they are non-NULL, they need to be freed when no longer + * in use. + */ + void *image_buf; + PALETTEENTRY *image_palette; + + enum d3dx_image_file_format image_file_format; +}; + +HRESULT d3dx_image_init(const void *src_data, uint32_t src_data_size, struct d3dx_image *image, + uint32_t starting_mip_level, uint32_t flags); +void d3dx_image_cleanup(struct d3dx_image *image); +HRESULT d3dx_image_get_pixels(struct d3dx_image *image, uint32_t layer, uint32_t mip_level, + struct d3dx_pixels *pixels); + +static inline BOOL is_unknown_format(const struct pixel_format_desc *format) +{ + return (format->format == D3DX_PIXEL_FORMAT_COUNT); +} + +static inline BOOL is_index_format(const struct pixel_format_desc *format) +{ + return (format->a_type == CTYPE_INDEX || format->rgb_type == CTYPE_INDEX); +} + +static inline BOOL is_compressed_format(const struct pixel_format_desc *format) +{ + return !!(format->flags & FMT_FLAG_DXT); +} + +static inline BOOL is_packed_format(const struct pixel_format_desc *format) +{ + return !!(format->flags & FMT_FLAG_PACKED); +} + +static inline BOOL format_types_match(const struct pixel_format_desc *src, const struct pixel_format_desc *dst) +{ + if ((src->a_type && dst->a_type) && (src->a_type != dst->a_type)) + return FALSE; + + if ((src->rgb_type && dst->rgb_type) && (src->rgb_type != dst->rgb_type)) + return FALSE; + + if (src->flags != dst->flags) + return FALSE; + + return (src->rgb_type == dst->rgb_type || src->a_type == dst->a_type); +} + +static inline BOOL is_internal_format(const struct pixel_format_desc *format) +{ + return !!(format->flags & FMT_FLAG_INTERNAL); +} + +static inline BOOL filter_flags_match(uint32_t filter_flags) +{ + if (!!(filter_flags & D3DX_FILTER_PMA_IN) != !!((filter_flags & D3DX_FILTER_PMA_OUT))) + return FALSE; + + return TRUE; +} + +static inline BOOL is_conversion_from_supported(const struct pixel_format_desc *format) +{ + return !is_packed_format(format) && !is_unknown_format(format); +} + +static inline BOOL is_conversion_to_supported(const struct pixel_format_desc *format) +{ + return !is_index_format(format) && !is_packed_format(format) && !is_unknown_format(format); +} + +const struct pixel_format_desc *get_d3dx_pixel_format_info(enum d3dx_pixel_format_id format); +HRESULT dds_pixel_format_from_d3dx_pixel_format_id(struct dds_pixel_format *pixel_format, + enum d3dx_pixel_format_id d3dx_pixel_format); + +void format_to_d3dx_color(const struct pixel_format_desc *format, const BYTE *src, const PALETTEENTRY *palette, + struct d3dx_color *dst); +void format_from_d3dx_color(const struct pixel_format_desc *format, const struct d3dx_color *src, BYTE *dst); + +uint32_t d3dx_calculate_layer_pixels_size(enum d3dx_pixel_format_id format, uint32_t width, uint32_t height, uint32_t depth, + uint32_t mip_levels); +HRESULT d3dx_init_dds_header(struct dds_header *header, enum d3dx_resource_type resource_type, + enum d3dx_pixel_format_id format, const struct volume *size, uint32_t mip_levels); +HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct pixel_format_desc *src_fmt_desc, + enum d3dx_image_file_format file_format, enum d3dx_pixel_format_id dst_format, ID3DXBlob **dst_blob); +HRESULT d3dx_pixels_init(const void *data, uint32_t row_pitch, uint32_t slice_pitch, + const PALETTEENTRY *palette, enum d3dx_pixel_format_id format, uint32_t left, uint32_t top, uint32_t right, + uint32_t bottom, uint32_t front, uint32_t back, struct d3dx_pixels *pixels); +HRESULT d3dx_load_pixels_from_pixels(struct d3dx_pixels *dst_pixels, + const struct pixel_format_desc *dst_desc, struct d3dx_pixels *src_pixels, + const struct pixel_format_desc *src_desc, uint32_t filter_flags, uint32_t color_key); +void get_aligned_rect(uint32_t left, uint32_t top, uint32_t right, uint32_t bottom, uint32_t width, uint32_t height, + const struct pixel_format_desc *fmt_desc, RECT *aligned_rect); + +unsigned short float_32_to_16(const float in); +float float_16_to_32(const unsigned short in); +/* debug helpers */ +const char *debug_d3dx_image_file_format(enum d3dx_image_file_format format); +#endif /* __WINE_D3DX_HELPERS_H */ diff --git a/dlls/d3dx9_36/math.c b/dlls/d3dx9_36/math.c index 92eb8f68f142..ac384213e294 100644 --- a/dlls/d3dx9_36/math.c +++ b/dlls/d3dx9_36/math.c @@ -2099,91 +2099,6 @@ D3DXVECTOR4* WINAPI D3DXVec4TransformArray(D3DXVECTOR4* out, UINT outstride, con return out; } -unsigned short float_32_to_16(const float in) -{ - int exp = 0, origexp; - float tmp = fabsf(in); - int sign = (copysignf(1, in) < 0); - unsigned int mantissa; - unsigned short ret; - - /* Deal with special numbers */ - if (isinf(in)) return (sign ? 0xffff : 0x7fff); - if (isnan(in)) return (sign ? 0xffff : 0x7fff); - if (in == 0.0f) return (sign ? 0x8000 : 0x0000); - - if (tmp < (float)(1u << 10)) - { - do - { - tmp *= 2.0f; - exp--; - } while (tmp < (float)(1u << 10)); - } - else if (tmp >= (float)(1u << 11)) - { - do - { - tmp /= 2.0f; - exp++; - } while (tmp >= (float)(1u << 11)); - } - - exp += 10; /* Normalize the mantissa */ - exp += 15; /* Exponent is encoded with excess 15 */ - - origexp = exp; - - mantissa = (unsigned int) tmp; - if ((tmp - mantissa == 0.5f && mantissa % 2 == 1) || /* round half to even */ - (tmp - mantissa > 0.5f)) - { - mantissa++; /* round to nearest, away from zero */ - } - if (mantissa == 2048) - { - mantissa = 1024; - exp++; - } - - if (exp > 31) - { - /* too big */ - ret = 0x7fff; /* INF */ - } - else if (exp <= 0) - { - unsigned int rounding = 0; - - /* Denormalized half float */ - - /* return 0x0000 (=0.0) for numbers too small to represent in half floats */ - if (exp < -11) - return (sign ? 0x8000 : 0x0000); - - exp = origexp; - - /* the 13 extra bits from single precision are used for rounding */ - mantissa = (unsigned int)(tmp * (1u << 13)); - mantissa >>= 1 - exp; /* denormalize */ - - mantissa -= ~(mantissa >> 13) & 1; /* round half to even */ - /* remove 13 least significant bits to get half float precision */ - mantissa >>= 12; - rounding = mantissa & 1; - mantissa >>= 1; - - ret = mantissa + rounding; - } - else - { - ret = (exp << 10) | (mantissa & 0x3ff); - } - - ret |= ((sign ? 1 : 0) << 15); /* Add the sign */ - return ret; -} - D3DXFLOAT16 *WINAPI D3DXFloat32To16Array(D3DXFLOAT16 *pout, const FLOAT *pin, UINT n) { unsigned int i; @@ -2198,26 +2113,6 @@ D3DXFLOAT16 *WINAPI D3DXFloat32To16Array(D3DXFLOAT16 *pout, const FLOAT *pin, UI return pout; } -/* Native d3dx9's D3DXFloat16to32Array lacks support for NaN and Inf. Specifically, e = 16 is treated as a - * regular number - e.g., 0x7fff is converted to 131008.0 and 0xffff to -131008.0. */ -float float_16_to_32(const unsigned short in) -{ - const unsigned short s = (in & 0x8000); - const unsigned short e = (in & 0x7C00) >> 10; - const unsigned short m = in & 0x3FF; - const float sgn = (s ? -1.0f : 1.0f); - - if (e == 0) - { - if (m == 0) return sgn * 0.0f; /* +0.0 or -0.0 */ - else return sgn * powf(2, -14.0f) * (m / 1024.0f); - } - else - { - return sgn * powf(2, e - 15.0f) * (1.0f + (m / 1024.0f)); - } -} - FLOAT *WINAPI D3DXFloat16To32Array(FLOAT *pout, const D3DXFLOAT16 *pin, UINT n) { unsigned int i; diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 723ed8ad8cff..7e0116411bd9 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -18,97 +18,11 @@ * */ - #include "d3dx9_private.h" - -#include "initguid.h" -#include "ole2.h" -#include "wincodec.h" - -#define BCDEC_IMPLEMENTATION -#include "bcdec.h" -#define STB_DXT_IMPLEMENTATION -#include "stb_dxt.h" #include WINE_DEFAULT_DEBUG_CHANNEL(d3dx); -HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT, IWICImagingFactory**); - -static const struct -{ - const GUID *wic_guid; - enum d3dx_pixel_format_id d3dx_pixel_format; -} wic_pixel_formats[] = -{ - { &GUID_WICPixelFormat8bppIndexed, D3DX_PIXEL_FORMAT_P8_UINT }, - { &GUID_WICPixelFormat1bppIndexed, D3DX_PIXEL_FORMAT_P8_UINT }, - { &GUID_WICPixelFormat4bppIndexed, D3DX_PIXEL_FORMAT_P8_UINT }, - { &GUID_WICPixelFormat8bppGray, D3DX_PIXEL_FORMAT_L8_UNORM }, - { &GUID_WICPixelFormat16bppBGR555, D3DX_PIXEL_FORMAT_B5G5R5X1_UNORM }, - { &GUID_WICPixelFormat16bppBGR565, D3DX_PIXEL_FORMAT_B5G6R5_UNORM }, - { &GUID_WICPixelFormat24bppBGR, D3DX_PIXEL_FORMAT_B8G8R8_UNORM }, - { &GUID_WICPixelFormat32bppBGR, D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM }, - { &GUID_WICPixelFormat32bppBGRA, D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM }, - { &GUID_WICPixelFormat48bppRGB, D3DX_PIXEL_FORMAT_R16G16B16_UNORM }, - { &GUID_WICPixelFormat64bppRGBA, D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM }, -}; - -static enum d3dx_pixel_format_id d3dx_pixel_format_id_from_wic_pixel_format(const GUID *guid) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(wic_pixel_formats); i++) - { - if (IsEqualGUID(wic_pixel_formats[i].wic_guid, guid)) - return wic_pixel_formats[i].d3dx_pixel_format; - } - - return D3DX_PIXEL_FORMAT_COUNT; - -} - -static const GUID *wic_guid_from_d3dx_pixel_format_id(enum d3dx_pixel_format_id d3dx_pixel_format) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(wic_pixel_formats); i++) - { - if (wic_pixel_formats[i].d3dx_pixel_format == d3dx_pixel_format) - return wic_pixel_formats[i].wic_guid; - } - - return NULL; -} - -#define IMAGETYPE_COLORMAPPED 1 -#define IMAGETYPE_TRUECOLOR 2 -#define IMAGETYPE_GRAYSCALE 3 -#define IMAGETYPE_MASK 0x07 -#define IMAGETYPE_RLE 8 - -#define IMAGE_RIGHTTOLEFT 0x10 -#define IMAGE_TOPTOBOTTOM 0x20 - -#include "pshpack1.h" -struct tga_header -{ - uint8_t id_length; - uint8_t color_map_type; - uint8_t image_type; - uint16_t color_map_firstentry; - uint16_t color_map_length; - uint8_t color_map_entrysize; - uint16_t xorigin; - uint16_t yorigin; - uint16_t width; - uint16_t height; - uint8_t depth; - uint8_t image_descriptor; -}; -#include "poppack.h" - - HRESULT lock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, D3DLOCKED_RECT *lock, IDirect3DSurface9 **temp_surface, BOOL write) { @@ -203,224 +117,6 @@ HRESULT unlock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, return hr; } -static const struct -{ - struct dds_pixel_format dds_pixel_format; - enum d3dx_pixel_format_id d3dx_pixel_format; -} dds_pixel_formats[] = -{ - /* DDS_PF_FOURCC. */ - { { 32, DDS_PF_FOURCC, MAKEFOURCC('U','Y','V','Y') }, D3DX_PIXEL_FORMAT_UYVY }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('Y','U','Y','2') }, D3DX_PIXEL_FORMAT_YUY2 }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('R','G','B','G') }, D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('G','R','G','B') }, D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1') }, D3DX_PIXEL_FORMAT_DXT1_UNORM }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','2') }, D3DX_PIXEL_FORMAT_DXT2_UNORM }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','3') }, D3DX_PIXEL_FORMAT_DXT3_UNORM }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','4') }, D3DX_PIXEL_FORMAT_DXT4_UNORM }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','5') }, D3DX_PIXEL_FORMAT_DXT5_UNORM }, - /* These aren't actually fourcc values, they're just D3DFMT values. */ - { { 32, DDS_PF_FOURCC, 0x24 }, D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM }, - { { 32, DDS_PF_FOURCC, 0x6e }, D3DX_PIXEL_FORMAT_U16V16W16Q16_SNORM }, - { { 32, DDS_PF_FOURCC, 0x6f }, D3DX_PIXEL_FORMAT_R16_FLOAT }, - { { 32, DDS_PF_FOURCC, 0x70 }, D3DX_PIXEL_FORMAT_R16G16_FLOAT }, - { { 32, DDS_PF_FOURCC, 0x71 }, D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT }, - { { 32, DDS_PF_FOURCC, 0x72 }, D3DX_PIXEL_FORMAT_R32_FLOAT }, - { { 32, DDS_PF_FOURCC, 0x73 }, D3DX_PIXEL_FORMAT_R32G32_FLOAT }, - { { 32, DDS_PF_FOURCC, 0x74 }, D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT }, - /* DDS_PF_RGB. */ - { { 32, DDS_PF_RGB, 0, 8, 0xe0, 0x1c, 0x03, 0x00 }, D3DX_PIXEL_FORMAT_B2G3R3_UNORM }, - { { 32, DDS_PF_RGB, 0, 16, 0xf800, 0x07e0, 0x001f, 0x0000 }, D3DX_PIXEL_FORMAT_B5G6R5_UNORM }, - { { 32, DDS_PF_RGB, 0, 16, 0x7c00, 0x03e0, 0x001f, 0x0000 }, D3DX_PIXEL_FORMAT_B5G5R5X1_UNORM }, - { { 32, DDS_PF_RGB, 0, 16, 0x0f00, 0x00f0, 0x000f, 0x0000 }, D3DX_PIXEL_FORMAT_B4G4R4X4_UNORM }, - { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, D3DX_PIXEL_FORMAT_B8G8R8_UNORM }, - { { 32, DDS_PF_RGB, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 }, D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM }, - { { 32, DDS_PF_RGB, 0, 32, 0x0000ffff, 0xffff0000, 0x00000000, 0x00000000 }, D3DX_PIXEL_FORMAT_R16G16_UNORM }, - { { 32, DDS_PF_RGB, 0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000 }, D3DX_PIXEL_FORMAT_R8G8B8X8_UNORM }, - { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 16, 0x00e0, 0x001c, 0x0003, 0xff00 }, D3DX_PIXEL_FORMAT_B2G3R3A8_UNORM }, - { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 16, 0x7c00, 0x03e0, 0x001f, 0x8000 }, D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM }, - { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 16, 0x0f00, 0x00f0, 0x000f, 0xf000 }, D3DX_PIXEL_FORMAT_B4G4R4A4_UNORM }, - { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM }, - { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 }, D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM }, - { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x3ff00000, 0x000ffc00, 0x000003ff, 0xc0000000 }, D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM }, - { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x000003ff, 0x000ffc00, 0x3ff00000, 0xc0000000 }, D3DX_PIXEL_FORMAT_B10G10R10A2_UNORM }, - /* DDS_PF_INDEXED. */ - { { 32, DDS_PF_INDEXED, 0, 8 }, D3DX_PIXEL_FORMAT_P8_UINT }, - { { 32, DDS_PF_INDEXED | DDS_PF_ALPHA, 0, 16, 0, 0, 0, 0xff00, }, D3DX_PIXEL_FORMAT_P8_UINT_A8_UNORM }, - /* DDS_PF_LUMINANCE. */ - { { 32, DDS_PF_LUMINANCE, 0, 8, 0x00ff }, D3DX_PIXEL_FORMAT_L8_UNORM }, - { { 32, DDS_PF_LUMINANCE, 0, 16, 0xffff }, D3DX_PIXEL_FORMAT_L16_UNORM }, - { { 32, DDS_PF_LUMINANCE | DDS_PF_ALPHA, 0, 8, 0x000f, 0, 0, 0x00f0 }, D3DX_PIXEL_FORMAT_L4A4_UNORM }, - { { 32, DDS_PF_LUMINANCE | DDS_PF_ALPHA, 0, 16, 0x00ff, 0, 0, 0xff00 }, D3DX_PIXEL_FORMAT_L8A8_UNORM }, - /* Exceptional case, A8L8 can also have 8bpp. */ - { { 32, DDS_PF_LUMINANCE | DDS_PF_ALPHA, 0, 8, 0x00ff, 0, 0, 0xff00 }, D3DX_PIXEL_FORMAT_L8A8_UNORM }, - /* DDS_PF_ALPHA_ONLY. */ - { { 32, DDS_PF_ALPHA_ONLY, 0, 8, 0, 0, 0, 0xff }, D3DX_PIXEL_FORMAT_A8_UNORM }, - /* DDS_PF_BUMPDUDV. */ - { { 32, DDS_PF_BUMPDUDV, 0, 16, 0x000000ff, 0x0000ff00, 0x00000000, 0x00000000 }, D3DX_PIXEL_FORMAT_U8V8_SNORM }, - { { 32, DDS_PF_BUMPDUDV, 0, 32, 0x0000ffff, 0xffff0000, 0x00000000, 0x00000000 }, D3DX_PIXEL_FORMAT_U16V16_SNORM }, - { { 32, DDS_PF_BUMPDUDV, 0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 }, D3DX_PIXEL_FORMAT_U8V8W8Q8_SNORM }, - { { 32, DDS_PF_BUMPDUDV | DDS_PF_ALPHA, 0, 32, 0x3ff00000, 0x000ffc00, 0x000003ff, 0xc0000000 }, D3DX_PIXEL_FORMAT_U10V10W10_SNORM_A2_UNORM }, - /* DDS_PF_BUMPLUMINANCE. */ - { { 32, DDS_PF_BUMPLUMINANCE, 0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000 }, D3DX_PIXEL_FORMAT_U8V8_SNORM_L8X8_UNORM }, -}; - -static BOOL dds_pixel_format_compare(const struct dds_pixel_format *pf_a, const struct dds_pixel_format *pf_b, - BOOL check_rmask, BOOL check_gmask, BOOL check_bmask, BOOL check_amask) -{ - return pf_a->bpp == pf_b->bpp && !((check_rmask && pf_a->rmask != pf_b->rmask) - || (check_gmask && pf_a->gmask != pf_b->gmask) || (check_bmask && pf_a->bmask != pf_b->bmask) - || (check_amask && pf_a->amask != pf_b->amask)); -} - -static enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dds_pixel_format(const struct dds_pixel_format *pixel_format) -{ - uint32_t i; - - TRACE("pixel_format: size %lu, flags %#lx, fourcc %#lx, bpp %lu.\n", pixel_format->size, - pixel_format->flags, pixel_format->fourcc, pixel_format->bpp); - TRACE("rmask %#lx, gmask %#lx, bmask %#lx, amask %#lx.\n", pixel_format->rmask, pixel_format->gmask, - pixel_format->bmask, pixel_format->amask); - - for (i = 0; i < ARRAY_SIZE(dds_pixel_formats); ++i) - { - const struct dds_pixel_format *dds_pf = &dds_pixel_formats[i].dds_pixel_format; - - if (pixel_format->flags != dds_pf->flags) - continue; - - switch (pixel_format->flags & ~DDS_PF_ALPHA) - { - case DDS_PF_ALPHA_ONLY: - if (dds_pixel_format_compare(pixel_format, dds_pf, FALSE, FALSE, FALSE, TRUE)) - return dds_pixel_formats[i].d3dx_pixel_format; - break; - - case DDS_PF_FOURCC: - if (pixel_format->fourcc == dds_pf->fourcc) - return dds_pixel_formats[i].d3dx_pixel_format; - break; - - case DDS_PF_INDEXED: - if (dds_pixel_format_compare(pixel_format, dds_pf, FALSE, FALSE, FALSE, pixel_format->flags & DDS_PF_ALPHA)) - return dds_pixel_formats[i].d3dx_pixel_format; - break; - - case DDS_PF_RGB: - if (dds_pixel_format_compare(pixel_format, dds_pf, TRUE, TRUE, TRUE, pixel_format->flags & DDS_PF_ALPHA)) - return dds_pixel_formats[i].d3dx_pixel_format; - break; - - case DDS_PF_LUMINANCE: - if (dds_pixel_format_compare(pixel_format, dds_pf, TRUE, FALSE, FALSE, pixel_format->flags & DDS_PF_ALPHA)) - return dds_pixel_formats[i].d3dx_pixel_format; - break; - - case DDS_PF_BUMPLUMINANCE: - if (dds_pixel_format_compare(pixel_format, dds_pf, TRUE, TRUE, TRUE, FALSE)) - return dds_pixel_formats[i].d3dx_pixel_format; - break; - - case DDS_PF_BUMPDUDV: - if (dds_pixel_format_compare(pixel_format, dds_pf, TRUE, TRUE, TRUE, TRUE)) - return dds_pixel_formats[i].d3dx_pixel_format; - break; - - default: - assert(0); /* Should not happen. */ - break; - } - } - - WARN("Unknown pixel format (flags %#lx, fourcc %#lx, bpp %lu, r %#lx, g %#lx, b %#lx, a %#lx).\n", - pixel_format->flags, pixel_format->fourcc, pixel_format->bpp, - pixel_format->rmask, pixel_format->gmask, pixel_format->bmask, pixel_format->amask); - return D3DX_PIXEL_FORMAT_COUNT; -} - -static HRESULT dds_pixel_format_from_d3dx_pixel_format_id(struct dds_pixel_format *pixel_format, - enum d3dx_pixel_format_id d3dx_pixel_format) -{ - const struct dds_pixel_format *pf = NULL; - uint32_t i; - - for (i = 0; i < ARRAY_SIZE(dds_pixel_formats); ++i) - { - if (dds_pixel_formats[i].d3dx_pixel_format == d3dx_pixel_format) - { - pf = &dds_pixel_formats[i].dds_pixel_format; - break; - } - } - - if (!pf) - { - WARN("Unhandled format %#x.\n", d3dx_pixel_format); - return E_NOTIMPL; - } - - if (pixel_format) - *pixel_format = *pf; - - return D3D_OK; -} - -static void d3dx_get_next_mip_level_size(struct volume *size) -{ - size->width = max(size->width / 2, 1); - size->height = max(size->height / 2, 1); - size->depth = max(size->depth / 2, 1); -} - -static const char *debug_volume(const struct volume *volume) -{ - if (!volume) - return "(null)"; - return wine_dbg_sprintf("(%ux%ux%u)", volume->width, volume->height, volume->depth); -} - -static HRESULT d3dx_calculate_pixels_size(enum d3dx_pixel_format_id format, uint32_t width, uint32_t height, - uint32_t *pitch, uint32_t *size) -{ - const struct pixel_format_desc *format_desc = get_d3dx_pixel_format_info(format); - - if (is_unknown_format(format_desc)) - return E_NOTIMPL; - - if (format_desc->block_width != 1 || format_desc->block_height != 1) - { - *pitch = format_desc->block_byte_count - * max(1, (width + format_desc->block_width - 1) / format_desc->block_width); - *size = *pitch - * max(1, (height + format_desc->block_height - 1) / format_desc->block_height); - } - else - { - *pitch = width * format_desc->bytes_per_pixel; - *size = *pitch * height; - } - - return D3D_OK; -} - -uint32_t d3dx_calculate_layer_pixels_size(enum d3dx_pixel_format_id format, uint32_t width, uint32_t height, uint32_t depth, - uint32_t mip_levels) -{ - uint32_t layer_size, row_pitch, slice_pitch, i; - struct volume dims = { width, height, depth }; - - layer_size = 0; - for (i = 0; i < mip_levels; ++i) - { - if (FAILED(d3dx_calculate_pixels_size(format, dims.width, dims.height, &row_pitch, &slice_pitch))) - return 0; - layer_size += slice_pitch * dims.depth; - d3dx_get_next_mip_level_size(&dims); - } - - return layer_size; -} - static const enum d3dx_pixel_format_id tga_save_pixel_formats[] = { D3DX_PIXEL_FORMAT_B8G8R8_UNORM, @@ -631,2553 +327,422 @@ HRESULT d3dx_get_save_pixel_format_from_image_file_format(const struct pixel_for return (*save_fmt == D3DX_PIXEL_FORMAT_COUNT) ? D3DERR_INVALIDCALL : D3D_OK; } -HRESULT d3dx_init_dds_header(struct dds_header *header, enum d3dx_resource_type resource_type, - enum d3dx_pixel_format_id format, const struct volume *size, uint32_t mip_levels) +void d3dximage_info_from_d3dx_image(D3DXIMAGE_INFO *info, struct d3dx_image *image) { - HRESULT hr; - - memset(header, 0, sizeof(*header)); - header->signature = MAKEFOURCC('D','D','S',' '); - /* The signature is not really part of the DDS header. */ - header->size = sizeof(*header) - FIELD_OFFSET(struct dds_header, size); - hr = dds_pixel_format_from_d3dx_pixel_format_id(&header->pixel_format, format); - if (FAILED(hr)) - return hr; - - header->flags = DDS_CAPS | DDS_HEIGHT | DDS_WIDTH | DDS_PIXELFORMAT; - header->height = size->height; - header->width = size->width; - header->caps = DDS_CAPS_TEXTURE; - if (header->pixel_format.flags & DDS_PF_ALPHA || header->pixel_format.flags & DDS_PF_ALPHA_ONLY) - header->caps |= DDSCAPS_ALPHA; - if (header->pixel_format.flags & DDS_PF_INDEXED) - header->caps |= DDSCAPS_PALETTE; - - if (size->depth > 1) - { - header->flags |= DDS_DEPTH; - header->depth = size->depth; - header->caps2 |= DDS_CAPS2_VOLUME; - } - - if (mip_levels > 1) - { - header->flags |= DDS_MIPMAPCOUNT; - header->caps |= (DDS_CAPS_MIPMAP | DDS_CAPS_COMPLEX); - header->miplevels = mip_levels; - } - - if (resource_type == D3DX_RESOURCE_TYPE_CUBE_TEXTURE) + info->ImageFileFormat = (D3DXIMAGE_FILEFORMAT)image->image_file_format; + info->Width = image->size.width; + info->Height = image->size.height; + info->Depth = image->size.depth; + info->MipLevels = image->mip_levels; + switch (image->format) { - header->caps |= DDS_CAPS_COMPLEX; - header->caps2 |= (DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES); - } + case D3DX_PIXEL_FORMAT_R16G16B16_UNORM: + info->Format = D3DFMT_A16B16G16R16; + break; - return D3D_OK; -} + case D3DX_PIXEL_FORMAT_B8G8R8_UNORM: + if (info->ImageFileFormat == D3DXIFF_PNG || info->ImageFileFormat == D3DXIFF_JPG) + info->Format = D3DFMT_X8R8G8B8; + else + info->Format = d3dformat_from_d3dx_pixel_format_id(image->format); + break; -static const GUID *wic_container_guid_from_d3dx_file_format(enum d3dx_image_file_format iff) -{ - switch (iff) - { - case D3DX_IMAGE_FILE_FORMAT_DIB: - case D3DX_IMAGE_FILE_FORMAT_BMP: return &GUID_ContainerFormatBmp; - case D3DX_IMAGE_FILE_FORMAT_JPG: return &GUID_ContainerFormatJpeg; - case D3DX_IMAGE_FILE_FORMAT_PNG: return &GUID_ContainerFormatPng; default: - assert(0 && "Unexpected file format."); - return NULL; + info->Format = d3dformat_from_d3dx_pixel_format_id(image->format); + break; } + if (image->resource_type == D3DX_RESOURCE_TYPE_TEXTURE_3D) + info->ResourceType = D3DRTYPE_VOLUMETEXTURE; + else if (image->resource_type == D3DX_RESOURCE_TYPE_CUBE_TEXTURE) + info->ResourceType = D3DRTYPE_CUBETEXTURE; + else + info->ResourceType = D3DRTYPE_TEXTURE; } -static HRESULT d3dx_pixels_save_wic(struct d3dx_pixels *pixels, const struct pixel_format_desc *fmt_desc, - enum d3dx_image_file_format image_file_format, IStream **wic_file, uint32_t *wic_file_size) +/************************************************************ + * D3DXGetImageInfoFromFileInMemory + * + * Fills a D3DXIMAGE_INFO structure with info about an image + * + * PARAMS + * data [I] pointer to the image file data + * datasize [I] size of the passed data + * info [O] pointer to the destination structure + * + * RETURNS + * Success: D3D_OK, if info is not NULL and data and datasize make up a valid image file or + * if info is NULL and data and datasize are not NULL + * Failure: D3DXERR_INVALIDDATA, if data is no valid image file and datasize and info are not NULL + * D3DERR_INVALIDCALL, if data is NULL or + * if datasize is 0 + * + * NOTES + * datasize may be bigger than the actual file size + * + */ +HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(const void *data, UINT datasize, D3DXIMAGE_INFO *info) { - const GUID *container_format = wic_container_guid_from_d3dx_file_format(image_file_format); - const GUID *pixel_format_guid = wic_guid_from_d3dx_pixel_format_id(fmt_desc->format); - IWICBitmapFrameEncode *wic_frame = NULL; - IPropertyBag2 *encoder_options = NULL; - IWICBitmapEncoder *wic_encoder = NULL; - WICPixelFormatGUID wic_pixel_format; - const LARGE_INTEGER seek = { 0 }; - IWICImagingFactory *wic_factory; - IWICPalette *wic_palette = NULL; - IStream *stream = NULL; - STATSTG stream_stats; + struct d3dx_image image; HRESULT hr; - assert(container_format && pixel_format_guid); - hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &wic_factory); - if (FAILED(hr)) + TRACE("(%p, %d, %p)\n", data, datasize, info); + + if (!data || !datasize) return D3DERR_INVALIDCALL; - hr = IWICImagingFactory_CreateEncoder(wic_factory, container_format, NULL, &wic_encoder); - if (FAILED(hr)) - { - hr = D3DERR_INVALIDCALL; - goto exit; - } + if (!info) + return D3D_OK; - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - if (FAILED(hr)) - goto exit; + hr = d3dx_image_init(data, datasize, &image, 0, D3DX_IMAGE_INFO_ONLY); + if (FAILED(hr)) { + TRACE("Invalid or unsupported image file\n"); + return D3DXERR_INVALIDDATA; + } - hr = IWICBitmapEncoder_Initialize(wic_encoder, stream, WICBitmapEncoderNoCache); - if (FAILED(hr)) - goto exit; + d3dximage_info_from_d3dx_image(info, &image); + return D3D_OK; +} - hr = IWICBitmapEncoder_CreateNewFrame(wic_encoder, &wic_frame, &encoder_options); - if (FAILED(hr)) - goto exit; +/************************************************************ + * D3DXGetImageInfoFromFile + * + * RETURNS + * Success: D3D_OK, if we successfully load a valid image file or + * if we successfully load a file which is no valid image and info is NULL + * Failure: D3DXERR_INVALIDDATA, if we fail to load file or + * if file is not a valid image file and info is not NULL + * D3DERR_INVALIDCALL, if file is NULL + * + */ +HRESULT WINAPI D3DXGetImageInfoFromFileA(const char *file, D3DXIMAGE_INFO *info) +{ + WCHAR *widename; + HRESULT hr; + int strlength; - hr = IWICBitmapFrameEncode_Initialize(wic_frame, encoder_options); - if (FAILED(hr)) - goto exit; + TRACE("file %s, info %p.\n", debugstr_a(file), info); - hr = IWICBitmapFrameEncode_SetSize(wic_frame, pixels->size.width, pixels->size.height); - if (FAILED(hr)) - goto exit; + if( !file ) return D3DERR_INVALIDCALL; - if (pixels->palette) - { - WICColor tmp_palette[256]; - unsigned int i; + strlength = MultiByteToWideChar(CP_ACP, 0, file, -1, NULL, 0); + widename = malloc(strlength * sizeof(*widename)); + MultiByteToWideChar(CP_ACP, 0, file, -1, widename, strlength); - hr = IWICImagingFactory_CreatePalette(wic_factory, &wic_palette); - if (FAILED(hr)) - goto exit; + hr = D3DXGetImageInfoFromFileW(widename, info); + free(widename); - for (i = 0; i < ARRAY_SIZE(tmp_palette); ++i) - { - const PALETTEENTRY *pe = &pixels->palette[i]; + return hr; +} - tmp_palette[i] = (pe->peFlags << 24) | (pe->peRed << 16) | (pe->peGreen << 8) | (pe->peBlue); - } +HRESULT WINAPI D3DXGetImageInfoFromFileW(const WCHAR *file, D3DXIMAGE_INFO *info) +{ + void *buffer; + HRESULT hr; + DWORD size; - hr = IWICPalette_InitializeCustom(wic_palette, tmp_palette, ARRAY_SIZE(tmp_palette)); - if (FAILED(hr)) - goto exit; + TRACE("file %s, info %p.\n", debugstr_w(file), info); - hr = IWICBitmapFrameEncode_SetPalette(wic_frame, wic_palette); - if (FAILED(hr)) - goto exit; - } + if (!file) + return D3DERR_INVALIDCALL; - /* - * Encode 32bpp BGRA format surfaces as 32bpp BGRX for BMP. - * This matches the behavior of native. - */ - if (IsEqualGUID(&GUID_ContainerFormatBmp, container_format) && (fmt_desc->format == D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM)) - pixel_format_guid = wic_guid_from_d3dx_pixel_format_id(D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM); + if (FAILED(map_view_of_file(file, &buffer, &size))) + return D3DXERR_INVALIDDATA; - memcpy(&wic_pixel_format, pixel_format_guid, sizeof(*pixel_format_guid)); - hr = IWICBitmapFrameEncode_SetPixelFormat(wic_frame, &wic_pixel_format); - if (FAILED(hr)) - goto exit; + hr = D3DXGetImageInfoFromFileInMemory(buffer, size, info); + UnmapViewOfFile(buffer); - if (!IsEqualGUID(pixel_format_guid, &wic_pixel_format)) - { - ERR("SetPixelFormat returned a different pixel format.\n"); - hr = E_FAIL; - goto exit; - } + return hr; +} - hr = IWICBitmapFrameEncode_WritePixels(wic_frame, pixels->size.height, pixels->row_pitch, pixels->slice_pitch, - (BYTE *)pixels->data); - if (FAILED(hr)) - goto exit; +/************************************************************ + * D3DXGetImageInfoFromResource + * + * RETURNS + * Success: D3D_OK, if resource is a valid image file + * Failure: D3DXERR_INVALIDDATA, if resource is no valid image file or NULL or + * if we fail to load resource + * + */ +HRESULT WINAPI D3DXGetImageInfoFromResourceA(HMODULE module, const char *resource, D3DXIMAGE_INFO *info) +{ + HRSRC resinfo; + void *buffer; + DWORD size; - hr = IWICBitmapFrameEncode_Commit(wic_frame); - if (FAILED(hr)) - goto exit; + TRACE("module %p, resource %s, info %p.\n", module, debugstr_a(resource), info); - hr = IWICBitmapEncoder_Commit(wic_encoder); - if (FAILED(hr)) - goto exit; - - hr = IStream_Seek(stream, seek, STREAM_SEEK_SET, NULL); - if (FAILED(hr)) - goto exit; - - hr = IStream_Stat(stream, &stream_stats, STATFLAG_NONAME); - if (FAILED(hr)) - goto exit; - - if (!stream_stats.cbSize.u.HighPart) - { - *wic_file = stream; - *wic_file_size = stream_stats.cbSize.u.LowPart; - } - else - { - hr = D3DXERR_INVALIDDATA; - } - -exit: - if (wic_factory) - IWICImagingFactory_Release(wic_factory); - if (stream && (*wic_file != stream)) - IStream_Release(stream); - if (wic_frame) - IWICBitmapFrameEncode_Release(wic_frame); - if (wic_palette) - IWICPalette_Release(wic_palette); - if (encoder_options) - IPropertyBag2_Release(encoder_options); - if (wic_encoder) - IWICBitmapEncoder_Release(wic_encoder); - - return hr; -} - -HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct pixel_format_desc *src_fmt_desc, - enum d3dx_image_file_format file_format, enum d3dx_pixel_format_id dst_format, ID3DXBuffer **dst_buffer) -{ - const struct pixel_format_desc *dst_fmt_desc = get_d3dx_pixel_format_info(dst_format); - uint32_t dst_row_pitch, dst_slice_pitch; - struct d3dx_pixels dst_pixels; - uint8_t *pixels, *tmp_buf; - ID3DXBuffer *buffer; - HRESULT hr; - - *dst_buffer = buffer = NULL; - pixels = tmp_buf = NULL; - hr = d3dx_calculate_pixels_size(dst_format, src_pixels->size.width, src_pixels->size.height, &dst_row_pitch, - &dst_slice_pitch); - if (FAILED(hr)) - return hr; - - src_pixels->size.depth = (file_format == D3DX_IMAGE_FILE_FORMAT_DDS) ? src_pixels->size.depth : 1; - switch (file_format) - { - case D3DX_IMAGE_FILE_FORMAT_DDS: - { - struct dds_header *header; - uint32_t header_size; - - header_size = is_index_format(dst_fmt_desc) ? sizeof(*header) + DDS_PALETTE_SIZE : sizeof(*header); - hr = D3DXCreateBuffer((dst_slice_pitch * src_pixels->size.depth) + header_size, &buffer); - if (FAILED(hr)) - return hr; - - header = ID3DXBuffer_GetBufferPointer(buffer); - pixels = (uint8_t *)ID3DXBuffer_GetBufferPointer(buffer) + header_size; - hr = d3dx_init_dds_header(header, D3DX_RESOURCE_TYPE_TEXTURE_2D, dst_format, &src_pixels->size, 1); - if (FAILED(hr)) - goto exit; - if (is_index_format(dst_fmt_desc)) - memcpy((uint8_t *)ID3DXBuffer_GetBufferPointer(buffer) + sizeof(*header), src_pixels->palette, - DDS_PALETTE_SIZE); - break; - } - - case D3DX_IMAGE_FILE_FORMAT_TGA: - { - struct tga_header *header; - - hr = D3DXCreateBuffer(dst_slice_pitch + sizeof(*header), &buffer); - if (FAILED(hr)) - return hr; - - header = ID3DXBuffer_GetBufferPointer(buffer); - pixels = (uint8_t *)ID3DXBuffer_GetBufferPointer(buffer) + sizeof(*header); - - memset(header, 0, sizeof(*header)); - header->image_type = IMAGETYPE_TRUECOLOR; - header->width = src_pixels->size.width; - header->height = src_pixels->size.height; - header->image_descriptor = IMAGE_TOPTOBOTTOM; - header->depth = dst_fmt_desc->bytes_per_pixel * 8; - if (dst_fmt_desc->format == D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM) - header->image_descriptor |= 0x08; - break; - } - - case D3DX_IMAGE_FILE_FORMAT_DIB: - case D3DX_IMAGE_FILE_FORMAT_BMP: - case D3DX_IMAGE_FILE_FORMAT_PNG: - case D3DX_IMAGE_FILE_FORMAT_JPG: - if (src_fmt_desc == dst_fmt_desc) - dst_pixels = *src_pixels; - else - pixels = tmp_buf = malloc(dst_slice_pitch); - break; - - - default: - break; - } - - if (src_pixels->size.width != 0 && src_pixels->size.height != 0) - { - const RECT dst_rect = { 0, 0, src_pixels->size.width, src_pixels->size.height }; - - if (pixels) - { - set_d3dx_pixels(&dst_pixels, pixels, dst_row_pitch, dst_slice_pitch, src_pixels->palette, src_pixels->size.width, - src_pixels->size.height, src_pixels->size.depth, &dst_rect); - - hr = d3dx_load_pixels_from_pixels(&dst_pixels, dst_fmt_desc, src_pixels, src_fmt_desc, D3DX_FILTER_NONE, 0); - if (FAILED(hr)) - goto exit; - } - - /* WIC path, encode the image. */ - if (!buffer) - { - IStream *wic_file = NULL; - uint32_t buf_size = 0; - - hr = d3dx_pixels_save_wic(&dst_pixels, dst_fmt_desc, file_format, &wic_file, &buf_size); - if (FAILED(hr)) - goto exit; - - hr = D3DXCreateBuffer(buf_size, &buffer); - if (FAILED(hr)) - { - IStream_Release(wic_file); - goto exit; - } - - hr = IStream_Read(wic_file, ID3DXBuffer_GetBufferPointer(buffer), buf_size, NULL); - IStream_Release(wic_file); - if (FAILED(hr)) - goto exit; - } - } - /* Return an empty buffer for size 0 images via WIC. */ - else if (!buffer) - { - hr = D3DXCreateBuffer(64, &buffer); - if (FAILED(hr)) - goto exit; - } - - *dst_buffer = buffer; -exit: - free(tmp_buf); - if (*dst_buffer != buffer) - ID3DXBuffer_Release(buffer); - return hr; -} - -static const uint8_t bmp_file_signature[] = { 'B', 'M' }; -static const uint8_t jpg_file_signature[] = { 0xff, 0xd8 }; -static const uint8_t png_file_signature[] = { 0x89, 'P', 'N', 'G', 0x0d, 0x0a, 0x1a, 0x0a }; -static const uint8_t dds_file_signature[] = { 'D', 'D', 'S', ' ' }; -static const uint8_t ppm_plain_file_signature[] = { 'P', '3' }; -static const uint8_t ppm_raw_file_signature[] = { 'P', '6' }; -static const uint8_t hdr_file_signature[] = { '#', '?', 'R', 'A', 'D', 'I', 'A', 'N', 'C', 'E', '\n' }; -static const uint8_t pfm_color_file_signature[] = { 'P', 'F' }; -static const uint8_t pfm_gray_file_signature[] = { 'P', 'f' }; - -/* - * If none of these match, the file is either DIB, TGA, or something we don't - * support. - */ -struct d3dx_file_format_signature -{ - const uint8_t *file_signature; - uint32_t file_signature_len; - enum d3dx_image_file_format image_file_format; -}; - -static const struct d3dx_file_format_signature file_format_signatures[] = -{ - { bmp_file_signature, sizeof(bmp_file_signature), D3DX_IMAGE_FILE_FORMAT_BMP }, - { jpg_file_signature, sizeof(jpg_file_signature), D3DX_IMAGE_FILE_FORMAT_JPG }, - { png_file_signature, sizeof(png_file_signature), D3DX_IMAGE_FILE_FORMAT_PNG }, - { dds_file_signature, sizeof(dds_file_signature), D3DX_IMAGE_FILE_FORMAT_DDS }, - { ppm_plain_file_signature, sizeof(ppm_plain_file_signature), D3DX_IMAGE_FILE_FORMAT_PPM }, - { ppm_raw_file_signature, sizeof(ppm_raw_file_signature), D3DX_IMAGE_FILE_FORMAT_PPM }, - { hdr_file_signature, sizeof(hdr_file_signature), D3DX_IMAGE_FILE_FORMAT_HDR }, - { pfm_color_file_signature, sizeof(pfm_color_file_signature), D3DX_IMAGE_FILE_FORMAT_PFM }, - { pfm_gray_file_signature, sizeof(pfm_gray_file_signature), D3DX_IMAGE_FILE_FORMAT_PFM }, -}; - -static BOOL d3dx_get_image_file_format_from_file_signature(const void *src_data, uint32_t src_data_size, - enum d3dx_image_file_format *out_iff) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(file_format_signatures); ++i) - { - const struct d3dx_file_format_signature *signature = &file_format_signatures[i]; - - if ((src_data_size >= signature->file_signature_len) - && !memcmp(src_data, signature->file_signature, signature->file_signature_len)) - { - *out_iff = signature->image_file_format; - return TRUE; - } - } - - return FALSE; -} - -static HRESULT d3dx_initialize_image_from_dds(const void *src_data, uint32_t src_data_size, - struct d3dx_image *image, uint32_t starting_mip_level) -{ - uint32_t expected_src_data_size, header_size; - const struct dds_header *header = src_data; - BOOL is_indexed_fmt; - HRESULT hr; - - if (src_data_size < sizeof(*header) || header->pixel_format.size != sizeof(header->pixel_format)) - return D3DXERR_INVALIDDATA; - - TRACE("File type is DDS.\n"); - is_indexed_fmt = !!(header->pixel_format.flags & DDS_PF_INDEXED); - header_size = is_indexed_fmt ? sizeof(*header) + DDS_PALETTE_SIZE : sizeof(*header); - - set_volume_struct(&image->size, header->width, header->height, 1); - image->mip_levels = header->miplevels ? header->miplevels : 1; - image->format = d3dx_pixel_format_id_from_dds_pixel_format(&header->pixel_format); - image->layer_count = 1; - - if (image->format == D3DX_PIXEL_FORMAT_COUNT) - return D3DXERR_INVALIDDATA; - - TRACE("Pixel format is %#x.\n", image->format); - if (header->flags & DDS_DEPTH) - { - image->size.depth = max(header->depth, 1); - image->resource_type = D3DX_RESOURCE_TYPE_TEXTURE_3D; - } - else if (header->caps2 & DDS_CAPS2_CUBEMAP) - { - if ((header->caps2 & DDS_CAPS2_CUBEMAP_ALL_FACES) != DDS_CAPS2_CUBEMAP_ALL_FACES) - { - WARN("Tried to load a partial cubemap DDS file.\n"); - return D3DXERR_INVALIDDATA; - } - - image->layer_count = 6; - image->resource_type = D3DX_RESOURCE_TYPE_CUBE_TEXTURE; - } - else - { - image->resource_type = D3DX_RESOURCE_TYPE_TEXTURE_2D; - } - - image->layer_pitch = d3dx_calculate_layer_pixels_size(image->format, image->size.width, image->size.height, - image->size.depth, image->mip_levels); - if (!image->layer_pitch) - return D3DXERR_INVALIDDATA; - expected_src_data_size = (image->layer_pitch * image->layer_count) + header_size; - if (src_data_size < expected_src_data_size) - { - WARN("File is too short %u, expected at least %u bytes.\n", src_data_size, expected_src_data_size); - return D3DXERR_INVALIDDATA; - } - - image->palette = (is_indexed_fmt) ? (PALETTEENTRY *)(((uint8_t *)src_data) + sizeof(*header)) : NULL; - image->pixels = ((BYTE *)src_data) + header_size; - image->image_file_format = D3DX_IMAGE_FILE_FORMAT_DDS; - if (starting_mip_level && (image->mip_levels > 1)) - { - uint32_t i, row_pitch, slice_pitch, initial_mip_levels; - const struct volume initial_size = image->size; - - initial_mip_levels = image->mip_levels; - for (i = 0; i < starting_mip_level; i++) - { - hr = d3dx_calculate_pixels_size(image->format, image->size.width, image->size.height, &row_pitch, &slice_pitch); - if (FAILED(hr)) - return hr; - - image->pixels += slice_pitch * image->size.depth; - d3dx_get_next_mip_level_size(&image->size); - if (--image->mip_levels == 1) - break; - } - - TRACE("Requested starting mip level %u, actual starting mip level is %u (of %u total in image).\n", - starting_mip_level, (initial_mip_levels - image->mip_levels), initial_mip_levels); - TRACE("Original dimensions %s, new dimensions %s.\n", debug_volume(&initial_size), debug_volume(&image->size)); - } - - return D3D_OK; -} - -static BOOL convert_dib_to_bmp(const void **data, unsigned int *size) -{ - ULONG header_size; - ULONG count = 0; - ULONG offset; - BITMAPFILEHEADER *header; - BYTE *new_data; - UINT new_size; - - if ((*size < 4) || (*size < (header_size = *(ULONG*)*data))) - return FALSE; - - if ((header_size == sizeof(BITMAPINFOHEADER)) || - (header_size == sizeof(BITMAPV4HEADER)) || - (header_size == sizeof(BITMAPV5HEADER)) || - (header_size == 64 /* sizeof(BITMAPCOREHEADER2) */)) - { - /* All structures begin with the same memory layout as BITMAPINFOHEADER */ - BITMAPINFOHEADER *info_header = (BITMAPINFOHEADER*)*data; - count = info_header->biClrUsed; - - if (!count && info_header->biBitCount <= 8) - count = 1 << info_header->biBitCount; - - offset = sizeof(BITMAPFILEHEADER) + header_size + sizeof(RGBQUAD) * count; - - /* For BITMAPINFOHEADER with BI_BITFIELDS compression, there are 3 additional color masks after header */ - if ((info_header->biSize == sizeof(BITMAPINFOHEADER)) && (info_header->biCompression == BI_BITFIELDS)) - offset += 3 * sizeof(DWORD); - } - else if (header_size == sizeof(BITMAPCOREHEADER)) - { - BITMAPCOREHEADER *core_header = (BITMAPCOREHEADER*)*data; - - if (core_header->bcBitCount <= 8) - count = 1 << core_header->bcBitCount; - - offset = sizeof(BITMAPFILEHEADER) + header_size + sizeof(RGBTRIPLE) * count; - } - else - { - return FALSE; - } - - TRACE("Converting DIB file to BMP\n"); - - new_size = *size + sizeof(BITMAPFILEHEADER); - new_data = malloc(new_size); - CopyMemory(new_data + sizeof(BITMAPFILEHEADER), *data, *size); - - /* Add BMP header */ - header = (BITMAPFILEHEADER*)new_data; - header->bfType = 0x4d42; /* BM */ - header->bfSize = new_size; - header->bfReserved1 = 0; - header->bfReserved2 = 0; - header->bfOffBits = offset; - - /* Update input data */ - *data = new_data; - *size = new_size; - - return TRUE; -} - -/* windowscodecs always returns xRGB, but we should return ARGB if and only if - * at least one pixel has a non-zero alpha component. */ -static BOOL image_is_argb(IWICBitmapFrameDecode *frame, struct d3dx_image *image) -{ - unsigned int size, i; - BYTE *buffer; - HRESULT hr; - - if (image->format != D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM || image->image_file_format != D3DX_IMAGE_FILE_FORMAT_BMP) - return FALSE; - - size = image->size.width * image->size.height * 4; - if (!(buffer = malloc(size))) - return FALSE; - - if (FAILED(hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, image->size.width * 4, size, buffer))) - { - ERR("Failed to copy pixels, hr %#lx.\n", hr); - free(buffer); - return FALSE; - } - - for (i = 0; i < image->size.width * image->size.height; ++i) - { - if (buffer[i * 4 + 3]) - { - free(buffer); - return TRUE; - } - } - - free(buffer); - return FALSE; -} - -const char *debug_d3dx_image_file_format(enum d3dx_image_file_format format) -{ - switch (format) - { -#define FMT_TO_STR(format) case format: return #format - FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_BMP); - FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_JPG); - FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_TGA); - FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_PNG); - FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_DDS); - FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_PPM); - FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_DIB); - FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_HDR); - FMT_TO_STR(D3DX_IMAGE_FILE_FORMAT_PFM); -#undef FMT_TO_STR - default: - return "unrecognized"; - } -} - -static HRESULT d3dx_image_wic_frame_decode(struct d3dx_image *image, - IWICImagingFactory *wic_factory, IWICBitmapFrameDecode *bitmap_frame) -{ - const struct pixel_format_desc *fmt_desc; - uint32_t row_pitch, slice_pitch; - IWICPalette *wic_palette = NULL; - PALETTEENTRY *palette = NULL; - WICColor *colors = NULL; - BYTE *buffer = NULL; - HRESULT hr; - - fmt_desc = get_d3dx_pixel_format_info(image->format); - hr = d3dx_calculate_pixels_size(image->format, image->size.width, image->size.height, &row_pitch, &slice_pitch); - if (FAILED(hr)) - return hr; - - /* Allocate a buffer for our image. */ - if (!(buffer = malloc(slice_pitch))) - return E_OUTOFMEMORY; - - hr = IWICBitmapFrameDecode_CopyPixels(bitmap_frame, NULL, row_pitch, slice_pitch, buffer); - if (FAILED(hr)) - { - free(buffer); - return hr; - } - - if (is_index_format(fmt_desc)) - { - uint32_t nb_colors, i; - - hr = IWICImagingFactory_CreatePalette(wic_factory, &wic_palette); - if (FAILED(hr)) - goto exit; - - hr = IWICBitmapFrameDecode_CopyPalette(bitmap_frame, wic_palette); - if (FAILED(hr)) - goto exit; - - hr = IWICPalette_GetColorCount(wic_palette, &nb_colors); - if (FAILED(hr)) - goto exit; - - colors = malloc(nb_colors * sizeof(colors[0])); - palette = malloc(nb_colors * sizeof(palette[0])); - if (!colors || !palette) - { - hr = E_OUTOFMEMORY; - goto exit; - } - - hr = IWICPalette_GetColors(wic_palette, nb_colors, colors, &nb_colors); - if (FAILED(hr)) - goto exit; - - /* Convert colors from WICColor (ARGB) to PALETTEENTRY (ABGR) */ - for (i = 0; i < nb_colors; i++) - { - palette[i].peRed = (colors[i] >> 16) & 0xff; - palette[i].peGreen = (colors[i] >> 8) & 0xff; - palette[i].peBlue = colors[i] & 0xff; - palette[i].peFlags = (colors[i] >> 24) & 0xff; /* peFlags is the alpha component in DX8 and higher */ - } - } - - image->image_buf = image->pixels = buffer; - image->image_palette = image->palette = palette; - -exit: - free(colors); - if (image->image_buf != buffer) - free(buffer); - if (image->image_palette != palette) - free(palette); - if (wic_palette) - IWICPalette_Release(wic_palette); - - return hr; -} - -static HRESULT d3dx_initialize_image_from_wic(const void *src_data, uint32_t src_data_size, - struct d3dx_image *image, enum d3dx_image_file_format d3dx_file_format, uint32_t flags) -{ - const GUID *container_format_guid = wic_container_guid_from_d3dx_file_format(d3dx_file_format); - IWICBitmapFrameDecode *bitmap_frame = NULL; - IWICBitmapDecoder *bitmap_decoder = NULL; - IWICImagingFactory *wic_factory; - WICPixelFormatGUID pixel_format; - IWICStream *wic_stream = NULL; - uint32_t frame_count = 0; - HRESULT hr; - - hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &wic_factory); - if (FAILED(hr)) - return hr; - - hr = IWICImagingFactory_CreateDecoder(wic_factory, container_format_guid, NULL, &bitmap_decoder); - if (FAILED(hr)) - goto exit; - - hr = IWICImagingFactory_CreateStream(wic_factory, &wic_stream); - if (FAILED(hr)) - goto exit; - - hr = IWICStream_InitializeFromMemory(wic_stream, (BYTE *)src_data, src_data_size); - if (FAILED(hr)) - goto exit; - - hr = IWICBitmapDecoder_Initialize(bitmap_decoder, (IStream *)wic_stream, 0); - if (FAILED(hr)) - goto exit; - - hr = IWICBitmapDecoder_GetFrameCount(bitmap_decoder, &frame_count); - if (FAILED(hr) || (SUCCEEDED(hr) && !frame_count)) - { - hr = D3DXERR_INVALIDDATA; - goto exit; - } - - image->image_file_format = d3dx_file_format; - hr = IWICBitmapDecoder_GetFrame(bitmap_decoder, 0, &bitmap_frame); - if (FAILED(hr)) - goto exit; - - hr = IWICBitmapFrameDecode_GetSize(bitmap_frame, &image->size.width, &image->size.height); - if (FAILED(hr)) - goto exit; - - hr = IWICBitmapFrameDecode_GetPixelFormat(bitmap_frame, &pixel_format); - if (FAILED(hr)) - goto exit; - - image->format = d3dx_pixel_format_id_from_wic_pixel_format(&pixel_format); - if (image->format == D3DX_PIXEL_FORMAT_COUNT) - { - WARN("Unsupported pixel format %s.\n", debugstr_guid(&pixel_format)); - hr = D3DXERR_INVALIDDATA; - goto exit; - } - - if (image_is_argb(bitmap_frame, image)) - image->format = D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM; - - if (!(flags & D3DX_IMAGE_INFO_ONLY)) - { - hr = d3dx_image_wic_frame_decode(image, wic_factory, bitmap_frame); - if (FAILED(hr)) - goto exit; - } - - image->size.depth = 1; - image->mip_levels = 1; - image->layer_count = 1; - image->resource_type = D3DX_RESOURCE_TYPE_TEXTURE_2D; - -exit: - if (bitmap_frame) - IWICBitmapFrameDecode_Release(bitmap_frame); - if (bitmap_decoder) - IWICBitmapDecoder_Release(bitmap_decoder); - if (wic_stream) - IWICStream_Release(wic_stream); - IWICImagingFactory_Release(wic_factory); - - return hr; -} - -static enum d3dx_pixel_format_id d3dx_get_tga_format_for_bpp(uint8_t bpp) -{ - switch (bpp) - { - case 15: return D3DX_PIXEL_FORMAT_B5G5R5X1_UNORM; - case 16: return D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM; - case 24: return D3DX_PIXEL_FORMAT_B8G8R8_UNORM; - case 32: return D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM; - default: - WARN("Unhandled bpp %u for targa.\n", bpp); - return D3DX_PIXEL_FORMAT_COUNT; - } -} - -static HRESULT d3dx_image_tga_rle_decode_row(const uint8_t **src, uint32_t src_bytes_left, uint32_t row_width, - uint32_t bytes_per_pixel, uint8_t *dst_row) -{ - const uint8_t *src_ptr = *src; - uint32_t pixel_count = 0; - - while (pixel_count != row_width) - { - uint32_t rle_count = (src_ptr[0] & 0x7f) + 1; - uint32_t rle_packet_size = 1; - - rle_packet_size += (src_ptr[0] & 0x80) ? bytes_per_pixel : (bytes_per_pixel * rle_count); - if ((rle_packet_size > src_bytes_left) || (pixel_count + rle_count) > row_width) - return D3DXERR_INVALIDDATA; - - if (src_ptr[0] & 0x80) - { - uint32_t i; - - for (i = 0; i < rle_count; ++i) - memcpy(&dst_row[(pixel_count + i) * bytes_per_pixel], src_ptr + 1, bytes_per_pixel); - } - else - { - memcpy(&dst_row[pixel_count * bytes_per_pixel], src_ptr + 1, rle_packet_size - 1); - } - - src_ptr += rle_packet_size; - src_bytes_left -= rle_packet_size; - pixel_count += rle_count; - if (!src_bytes_left && pixel_count != row_width) - return D3DXERR_INVALIDDATA; - } - - *src = src_ptr; - return D3D_OK; -} - -static void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, const struct volume *src_size, - const struct pixel_format_desc *src_format, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, - const struct volume *dst_size, const struct pixel_format_desc *dst_format, D3DCOLOR color_key, - const PALETTEENTRY *palette, uint32_t filter_flags); -static HRESULT d3dx_image_tga_decode(const void *src_data, uint32_t src_data_size, uint32_t src_header_size, - struct d3dx_image *image) -{ - const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(image->format); - const struct tga_header *header = (const struct tga_header *)src_data; - const BOOL right_to_left = !!(header->image_descriptor & IMAGE_RIGHTTOLEFT); - const BOOL bottom_to_top = !(header->image_descriptor & IMAGE_TOPTOBOTTOM); - const BOOL is_rle = !!(header->image_type & IMAGETYPE_RLE); - uint8_t *img_buf = NULL, *src_row = NULL; - uint32_t row_pitch, slice_pitch, i; - PALETTEENTRY *palette = NULL; - const uint8_t *src_pos; - HRESULT hr; - - hr = d3dx_calculate_pixels_size(image->format, image->size.width, image->size.height, &row_pitch, &slice_pitch); - if (FAILED(hr)) - return hr; - - /* File is too small. */ - if (!is_rle && (src_header_size + slice_pitch) > src_data_size) - return D3DXERR_INVALIDDATA; - - if (image->format == D3DX_PIXEL_FORMAT_P8_UINT) - { - const uint8_t *src_palette = ((const uint8_t *)src_data) + sizeof(*header) + header->id_length; - const struct volume image_map_size = { header->color_map_length, 1, 1 }; - uint32_t src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; - const struct pixel_format_desc *src_desc, *dst_desc; - - if (!(palette = malloc(sizeof(*palette) * 256))) - return E_OUTOFMEMORY; - - /* - * Convert from a TGA colormap to PALETTEENTRY. TGA is BGRA, - * PALETTEENTRY is RGBA. - */ - src_desc = get_d3dx_pixel_format_info(d3dx_get_tga_format_for_bpp(header->color_map_entrysize)); - hr = d3dx_calculate_pixels_size(src_desc->format, header->color_map_length, 1, &src_row_pitch, &src_slice_pitch); - if (FAILED(hr)) - goto exit; - - dst_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); - d3dx_calculate_pixels_size(dst_desc->format, 256, 1, &dst_row_pitch, &dst_slice_pitch); - convert_argb_pixels(src_palette, src_row_pitch, src_slice_pitch, &image_map_size, src_desc, (BYTE *)palette, - dst_row_pitch, dst_slice_pitch, &image_map_size, dst_desc, 0, NULL, D3DX_FILTER_NONE); - - /* Initialize unused palette entries to 0xff. */ - if (header->color_map_length < 256) - memset(&palette[header->color_map_length], 0xff, sizeof(*palette) * (256 - header->color_map_length)); - } - - if (!is_rle && !bottom_to_top && !right_to_left) - { - image->pixels = (uint8_t *)src_data + src_header_size; - image->image_palette = image->palette = palette; - return D3D_OK; - } - - if (!(img_buf = malloc(slice_pitch))) - { - hr = E_OUTOFMEMORY; - goto exit; - } - - /* Allocate an extra row to use as a temporary buffer. */ - if (is_rle) - { - if (!(src_row = malloc(row_pitch))) - { - hr = E_OUTOFMEMORY; - goto exit; - } - } - - src_pos = (const uint8_t *)src_data + src_header_size; - for (i = 0; i < image->size.height; ++i) - { - const uint32_t dst_row_idx = bottom_to_top ? (image->size.height - i - 1) : i; - uint8_t *dst_row = img_buf + (dst_row_idx * row_pitch); - - if (is_rle) - { - hr = d3dx_image_tga_rle_decode_row(&src_pos, src_data_size - (src_pos - (const uint8_t *)src_data), - image->size.width, fmt_desc->bytes_per_pixel, src_row); - if (FAILED(hr)) - goto exit; - } - else - { - src_row = (uint8_t *)src_pos; - src_pos += row_pitch; - } - - if (right_to_left) - { - const uint8_t *src_pixel = &src_row[((image->size.width - 1)) * fmt_desc->bytes_per_pixel]; - uint8_t *dst_pixel = dst_row; - uint32_t j; - - for (j = 0; j < image->size.width; ++j) - { - memcpy(dst_pixel, src_pixel, fmt_desc->bytes_per_pixel); - src_pixel -= fmt_desc->bytes_per_pixel; - dst_pixel += fmt_desc->bytes_per_pixel; - } - } - else - { - memcpy(dst_row, src_row, row_pitch); - } - } - - image->image_buf = image->pixels = img_buf; - image->image_palette = image->palette = palette; - -exit: - if (is_rle) - free(src_row); - if (img_buf && (image->image_buf != img_buf)) - free(img_buf); - if (palette && (image->image_palette != palette)) - free(palette); - - return hr; -} - -static HRESULT d3dx_initialize_image_from_tga(const void *src_data, uint32_t src_data_size, struct d3dx_image *image, - uint32_t flags) -{ - const struct tga_header *header = (const struct tga_header *)src_data; - uint32_t expected_header_size = sizeof(*header); - - if (src_data_size < sizeof(*header)) - return D3DXERR_INVALIDDATA; - - expected_header_size += header->id_length; - expected_header_size += header->color_map_length * ((header->color_map_entrysize + 7) / CHAR_BIT); - if (src_data_size < expected_header_size) - return D3DXERR_INVALIDDATA; - - if (header->color_map_type && ((header->color_map_type > 1) || (!header->color_map_length) - || (d3dx_get_tga_format_for_bpp(header->color_map_entrysize) == D3DX_PIXEL_FORMAT_COUNT))) - return D3DXERR_INVALIDDATA; - - switch (header->image_type & IMAGETYPE_MASK) - { - case IMAGETYPE_COLORMAPPED: - if (header->depth != 8 || !header->color_map_type) - return D3DXERR_INVALIDDATA; - image->format = D3DX_PIXEL_FORMAT_P8_UINT; - break; - - case IMAGETYPE_TRUECOLOR: - if ((image->format = d3dx_get_tga_format_for_bpp(header->depth)) == D3DX_PIXEL_FORMAT_COUNT) - return D3DXERR_INVALIDDATA; - break; - - case IMAGETYPE_GRAYSCALE: - if (header->depth != 8) - return D3DXERR_INVALIDDATA; - image->format = D3DX_PIXEL_FORMAT_L8_UNORM; - break; - - default: - return D3DXERR_INVALIDDATA; - } - - set_volume_struct(&image->size, header->width, header->height, 1); - image->mip_levels = 1; - image->layer_count = 1; - image->resource_type = D3DX_RESOURCE_TYPE_TEXTURE_2D; - image->image_file_format = D3DX_IMAGE_FILE_FORMAT_TGA; - - if (!(flags & D3DX_IMAGE_INFO_ONLY)) - return d3dx_image_tga_decode(src_data, src_data_size, expected_header_size, image); - - return D3D_OK; -} - -HRESULT d3dx_image_init(const void *src_data, uint32_t src_data_size, struct d3dx_image *image, - uint32_t starting_mip_level, uint32_t flags) -{ - enum d3dx_image_file_format iff = D3DX_IMAGE_FILE_FORMAT_FORCE_DWORD; - HRESULT hr; - - if (!src_data || !src_data_size || !image) - return D3DERR_INVALIDCALL; - - memset(image, 0, sizeof(*image)); - if (!d3dx_get_image_file_format_from_file_signature(src_data, src_data_size, &iff)) - { - uint32_t src_image_size = src_data_size; - const void *src_image = src_data; - - if (convert_dib_to_bmp(&src_image, &src_image_size)) - { - hr = d3dx_image_init(src_image, src_image_size, image, starting_mip_level, flags); - free((void *)src_image); - if (SUCCEEDED(hr)) - image->image_file_format = D3DX_IMAGE_FILE_FORMAT_DIB; - return hr; - } - - /* Last resort, try TGA. */ - return d3dx_initialize_image_from_tga(src_data, src_data_size, image, flags); - } - - switch (iff) - { - case D3DX_IMAGE_FILE_FORMAT_BMP: - case D3DX_IMAGE_FILE_FORMAT_JPG: - case D3DX_IMAGE_FILE_FORMAT_PNG: - hr = d3dx_initialize_image_from_wic(src_data, src_data_size, image, iff, flags); - break; - - case D3DX_IMAGE_FILE_FORMAT_DDS: - hr = d3dx_initialize_image_from_dds(src_data, src_data_size, image, starting_mip_level); - break; - - case D3DX_IMAGE_FILE_FORMAT_PPM: - case D3DX_IMAGE_FILE_FORMAT_HDR: - case D3DX_IMAGE_FILE_FORMAT_PFM: - WARN("Unsupported file format %s.\n", debug_d3dx_image_file_format(iff)); - hr = E_NOTIMPL; - break; - - case D3DX_IMAGE_FILE_FORMAT_FORCE_DWORD: - ERR("Unrecognized file format.\n"); - hr = D3DXERR_INVALIDDATA; - break; - - default: - assert(0); - return E_FAIL; - } - - return hr; -} - -void d3dx_image_cleanup(struct d3dx_image *image) -{ - free(image->image_buf); - free(image->image_palette); -} - -HRESULT d3dx_image_get_pixels(struct d3dx_image *image, uint32_t layer, uint32_t mip_level, - struct d3dx_pixels *pixels) -{ - struct volume mip_level_size = image->size; - const BYTE *pixels_ptr = image->pixels; - uint32_t row_pitch, slice_pitch, i; - RECT unaligned_rect; - HRESULT hr = S_OK; - - if (mip_level >= image->mip_levels) - { - ERR("Tried to retrieve mip level %u, but image only has %u mip levels.\n", mip_level, image->mip_levels); - return E_FAIL; - } - - if (layer >= image->layer_count) - { - ERR("Tried to retrieve layer %u, but image only has %u layers.\n", layer, image->layer_count); - return E_FAIL; - } - - slice_pitch = row_pitch = 0; - for (i = 0; i < image->mip_levels; i++) - { - hr = d3dx_calculate_pixels_size(image->format, mip_level_size.width, mip_level_size.height, &row_pitch, &slice_pitch); - if (FAILED(hr)) - return hr; - - if (i == mip_level) - break; - - pixels_ptr += slice_pitch * mip_level_size.depth; - d3dx_get_next_mip_level_size(&mip_level_size); - } - - pixels_ptr += (layer * image->layer_pitch); - SetRect(&unaligned_rect, 0, 0, mip_level_size.width, mip_level_size.height); - set_d3dx_pixels(pixels, pixels_ptr, row_pitch, slice_pitch, image->palette, mip_level_size.width, - mip_level_size.height, mip_level_size.depth, &unaligned_rect); - - return D3D_OK; -} - -void d3dximage_info_from_d3dx_image(D3DXIMAGE_INFO *info, struct d3dx_image *image) -{ - info->ImageFileFormat = (D3DXIMAGE_FILEFORMAT)image->image_file_format; - info->Width = image->size.width; - info->Height = image->size.height; - info->Depth = image->size.depth; - info->MipLevels = image->mip_levels; - switch (image->format) - { - case D3DX_PIXEL_FORMAT_R16G16B16_UNORM: - info->Format = D3DFMT_A16B16G16R16; - break; - - case D3DX_PIXEL_FORMAT_B8G8R8_UNORM: - if (info->ImageFileFormat == D3DXIFF_PNG || info->ImageFileFormat == D3DXIFF_JPG) - info->Format = D3DFMT_X8R8G8B8; - else - info->Format = d3dformat_from_d3dx_pixel_format_id(image->format); - break; - - default: - info->Format = d3dformat_from_d3dx_pixel_format_id(image->format); - break; - } - if (image->resource_type == D3DX_RESOURCE_TYPE_TEXTURE_3D) - info->ResourceType = D3DRTYPE_VOLUMETEXTURE; - else if (image->resource_type == D3DX_RESOURCE_TYPE_CUBE_TEXTURE) - info->ResourceType = D3DRTYPE_CUBETEXTURE; - else - info->ResourceType = D3DRTYPE_TEXTURE; -} - -/************************************************************ - * D3DXGetImageInfoFromFileInMemory - * - * Fills a D3DXIMAGE_INFO structure with info about an image - * - * PARAMS - * data [I] pointer to the image file data - * datasize [I] size of the passed data - * info [O] pointer to the destination structure - * - * RETURNS - * Success: D3D_OK, if info is not NULL and data and datasize make up a valid image file or - * if info is NULL and data and datasize are not NULL - * Failure: D3DXERR_INVALIDDATA, if data is no valid image file and datasize and info are not NULL - * D3DERR_INVALIDCALL, if data is NULL or - * if datasize is 0 - * - * NOTES - * datasize may be bigger than the actual file size - * - */ -HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(const void *data, UINT datasize, D3DXIMAGE_INFO *info) -{ - struct d3dx_image image; - HRESULT hr; - - TRACE("(%p, %d, %p)\n", data, datasize, info); - - if (!data || !datasize) - return D3DERR_INVALIDCALL; - - if (!info) - return D3D_OK; - - hr = d3dx_image_init(data, datasize, &image, 0, D3DX_IMAGE_INFO_ONLY); - if (FAILED(hr)) { - TRACE("Invalid or unsupported image file\n"); - return D3DXERR_INVALIDDATA; - } - - d3dximage_info_from_d3dx_image(info, &image); - return D3D_OK; -} - -/************************************************************ - * D3DXGetImageInfoFromFile - * - * RETURNS - * Success: D3D_OK, if we successfully load a valid image file or - * if we successfully load a file which is no valid image and info is NULL - * Failure: D3DXERR_INVALIDDATA, if we fail to load file or - * if file is not a valid image file and info is not NULL - * D3DERR_INVALIDCALL, if file is NULL - * - */ -HRESULT WINAPI D3DXGetImageInfoFromFileA(const char *file, D3DXIMAGE_INFO *info) -{ - WCHAR *widename; - HRESULT hr; - int strlength; - - TRACE("file %s, info %p.\n", debugstr_a(file), info); - - if( !file ) return D3DERR_INVALIDCALL; - - strlength = MultiByteToWideChar(CP_ACP, 0, file, -1, NULL, 0); - widename = malloc(strlength * sizeof(*widename)); - MultiByteToWideChar(CP_ACP, 0, file, -1, widename, strlength); - - hr = D3DXGetImageInfoFromFileW(widename, info); - free(widename); - - return hr; -} - -HRESULT WINAPI D3DXGetImageInfoFromFileW(const WCHAR *file, D3DXIMAGE_INFO *info) -{ - void *buffer; - HRESULT hr; - DWORD size; - - TRACE("file %s, info %p.\n", debugstr_w(file), info); - - if (!file) - return D3DERR_INVALIDCALL; - - if (FAILED(map_view_of_file(file, &buffer, &size))) - return D3DXERR_INVALIDDATA; - - hr = D3DXGetImageInfoFromFileInMemory(buffer, size, info); - UnmapViewOfFile(buffer); - - return hr; -} - -/************************************************************ - * D3DXGetImageInfoFromResource - * - * RETURNS - * Success: D3D_OK, if resource is a valid image file - * Failure: D3DXERR_INVALIDDATA, if resource is no valid image file or NULL or - * if we fail to load resource - * - */ -HRESULT WINAPI D3DXGetImageInfoFromResourceA(HMODULE module, const char *resource, D3DXIMAGE_INFO *info) -{ - HRSRC resinfo; - void *buffer; - DWORD size; - - TRACE("module %p, resource %s, info %p.\n", module, debugstr_a(resource), info); - - if (!(resinfo = FindResourceA(module, resource, (const char *)RT_RCDATA)) - /* Try loading the resource as bitmap data (which is in DIB format D3DXIFF_DIB) */ - && !(resinfo = FindResourceA(module, resource, (const char *)RT_BITMAP))) - return D3DXERR_INVALIDDATA; - - if (FAILED(load_resource_into_memory(module, resinfo, &buffer, &size))) - return D3DXERR_INVALIDDATA; - - return D3DXGetImageInfoFromFileInMemory(buffer, size, info); -} - -HRESULT WINAPI D3DXGetImageInfoFromResourceW(HMODULE module, const WCHAR *resource, D3DXIMAGE_INFO *info) -{ - HRSRC resinfo; - void *buffer; - DWORD size; - - TRACE("module %p, resource %s, info %p.\n", module, debugstr_w(resource), info); - - if (!(resinfo = FindResourceW(module, resource, (const WCHAR *)RT_RCDATA)) - /* Try loading the resource as bitmap data (which is in DIB format D3DXIFF_DIB) */ - && !(resinfo = FindResourceW(module, resource, (const WCHAR *)RT_BITMAP))) - return D3DXERR_INVALIDDATA; - - if (FAILED(load_resource_into_memory(module, resinfo, &buffer, &size))) - return D3DXERR_INVALIDDATA; - - return D3DXGetImageInfoFromFileInMemory(buffer, size, info); -} - -static HRESULT d3dx_load_surface_from_memory(IDirect3DSurface9 *dst_surface, - const PALETTEENTRY *dst_palette, const RECT *dst_rect, const void *src_memory, - enum d3dx_pixel_format_id src_format, uint32_t src_pitch, const PALETTEENTRY *src_palette, const RECT *src_rect, - DWORD filter, D3DCOLOR color_key) -{ - const struct pixel_format_desc *src_desc, *dst_desc; - struct d3dx_pixels src_pixels, dst_pixels; - RECT dst_rect_tmp, dst_rect_aligned; - IDirect3DSurface9 *surface; - D3DLOCKED_RECT lock_rect; - D3DSURFACE_DESC desc; - HRESULT hr; - - IDirect3DSurface9_GetDesc(dst_surface, &desc); - if (desc.MultiSampleType != D3DMULTISAMPLE_NONE) - { - TRACE("Multisampled destination surface, doing nothing.\n"); - return D3D_OK; - } - - dst_desc = get_format_info(desc.Format); - if (!dst_rect) - { - SetRect(&dst_rect_tmp, 0, 0, desc.Width, desc.Height); - dst_rect = &dst_rect_tmp; - } - else - { - if (dst_rect->left > dst_rect->right || dst_rect->right > desc.Width - || dst_rect->top > dst_rect->bottom || dst_rect->bottom > desc.Height - || dst_rect->left < 0 || dst_rect->top < 0) - { - WARN("Invalid dst_rect specified.\n"); - return D3DERR_INVALIDCALL; - } - if (dst_rect->left == dst_rect->right || dst_rect->top == dst_rect->bottom) - { - WARN("Empty dst_rect specified.\n"); - return D3D_OK; - } - } - - src_desc = get_d3dx_pixel_format_info(src_format); - hr = d3dx_pixels_init(src_memory, src_pitch, 0, src_palette, src_desc->format, - src_rect->left, src_rect->top, src_rect->right, src_rect->bottom, 0, 1, &src_pixels); - if (FAILED(hr)) - return hr; - - get_aligned_rect(dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, desc.Width, desc.Height, - dst_desc, &dst_rect_aligned); - if (FAILED(hr = lock_surface(dst_surface, &dst_rect_aligned, &lock_rect, &surface, TRUE))) - return hr; - - set_d3dx_pixels(&dst_pixels, lock_rect.pBits, lock_rect.Pitch, 0, dst_palette, - (dst_rect_aligned.right - dst_rect_aligned.left), (dst_rect_aligned.bottom - dst_rect_aligned.top), 1, - dst_rect); - OffsetRect(&dst_pixels.unaligned_rect, -dst_rect_aligned.left, -dst_rect_aligned.top); - - if (FAILED(hr = d3dx_load_pixels_from_pixels(&dst_pixels, dst_desc, &src_pixels, src_desc, filter, color_key))) - { - unlock_surface(dst_surface, &dst_rect_aligned, surface, FALSE); - return hr; - } - - return unlock_surface(dst_surface, &dst_rect_aligned, surface, TRUE); -} - -/************************************************************ - * D3DXLoadSurfaceFromFileInMemory - * - * Loads data from a given buffer into a surface and fills a given - * D3DXIMAGE_INFO structure with info about the source data. - * - * PARAMS - * pDestSurface [I] pointer to the surface - * pDestPalette [I] palette to use - * pDestRect [I] to be filled area of the surface - * pSrcData [I] pointer to the source data - * SrcDataSize [I] size of the source data in bytes - * pSrcRect [I] area of the source data to load - * dwFilter [I] filter to apply on stretching - * Colorkey [I] colorkey - * pSrcInfo [O] pointer to a D3DXIMAGE_INFO structure - * - * RETURNS - * Success: D3D_OK - * Failure: D3DERR_INVALIDCALL, if pDestSurface, pSrcData or SrcDataSize is NULL - * D3DXERR_INVALIDDATA, if pSrcData is no valid image file - * - */ -HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface, - const PALETTEENTRY *pDestPalette, const RECT *pDestRect, const void *pSrcData, UINT SrcDataSize, - const RECT *pSrcRect, DWORD dwFilter, D3DCOLOR Colorkey, D3DXIMAGE_INFO *pSrcInfo) -{ - struct d3dx_pixels pixels = { 0 }; - struct d3dx_image image; - D3DXIMAGE_INFO img_info; - RECT src_rect; - HRESULT hr; - - TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_data %p, src_data_size %u, " - "src_rect %s, filter %#lx, color_key 0x%08lx, src_info %p.\n", - pDestSurface, pDestPalette, wine_dbgstr_rect(pDestRect), pSrcData, SrcDataSize, - wine_dbgstr_rect(pSrcRect), dwFilter, Colorkey, pSrcInfo); - - if (!pDestSurface || !pSrcData || !SrcDataSize) - return D3DERR_INVALIDCALL; - - if (FAILED(hr = d3dx9_handle_load_filter(&dwFilter))) - return hr; - - hr = d3dx_image_init(pSrcData, SrcDataSize, &image, 0, 0); - if (FAILED(hr)) - return D3DXERR_INVALIDDATA; - - d3dximage_info_from_d3dx_image(&img_info, &image); - if (pSrcRect) - src_rect = *pSrcRect; - else - SetRect(&src_rect, 0, 0, img_info.Width, img_info.Height); - - hr = d3dx_image_get_pixels(&image, 0, 0, &pixels); - if (FAILED(hr)) - goto exit; - - hr = d3dx_load_surface_from_memory(pDestSurface, pDestPalette, pDestRect, pixels.data, image.format, pixels.row_pitch, - pixels.palette, &src_rect, dwFilter, Colorkey); - if (SUCCEEDED(hr) && pSrcInfo) - *pSrcInfo = img_info; - -exit: - d3dx_image_cleanup(&image); - return FAILED(hr) ? D3DXERR_INVALIDDATA : D3D_OK; -} - -HRESULT WINAPI D3DXLoadSurfaceFromFileA(IDirect3DSurface9 *dst_surface, - const PALETTEENTRY *dst_palette, const RECT *dst_rect, const char *src_file, - const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info) -{ - WCHAR *src_file_w; - HRESULT hr; - int strlength; - - TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_file %s, " - "src_rect %s, filter %#lx, color_key 0x%08lx, src_info %p.\n", - dst_surface, dst_palette, wine_dbgstr_rect(dst_rect), debugstr_a(src_file), - wine_dbgstr_rect(src_rect), filter, color_key, src_info); - - if (!src_file || !dst_surface) - return D3DERR_INVALIDCALL; - - strlength = MultiByteToWideChar(CP_ACP, 0, src_file, -1, NULL, 0); - src_file_w = malloc(strlength * sizeof(*src_file_w)); - MultiByteToWideChar(CP_ACP, 0, src_file, -1, src_file_w, strlength); - - hr = D3DXLoadSurfaceFromFileW(dst_surface, dst_palette, dst_rect, - src_file_w, src_rect, filter, color_key, src_info); - free(src_file_w); - - return hr; -} - -HRESULT WINAPI D3DXLoadSurfaceFromFileW(IDirect3DSurface9 *dst_surface, - const PALETTEENTRY *dst_palette, const RECT *dst_rect, const WCHAR *src_file, - const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info) -{ - DWORD data_size; - void *data; - HRESULT hr; - - TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_file %s, " - "src_rect %s, filter %#lx, color_key 0x%08lx, src_info %p.\n", - dst_surface, dst_palette, wine_dbgstr_rect(dst_rect), debugstr_w(src_file), - wine_dbgstr_rect(src_rect), filter, color_key, src_info); - - if (!src_file || !dst_surface) - return D3DERR_INVALIDCALL; - - if (FAILED(map_view_of_file(src_file, &data, &data_size))) - return D3DXERR_INVALIDDATA; - - hr = D3DXLoadSurfaceFromFileInMemory(dst_surface, dst_palette, dst_rect, - data, data_size, src_rect, filter, color_key, src_info); - UnmapViewOfFile(data); - - return hr; -} - -HRESULT WINAPI D3DXLoadSurfaceFromResourceA(IDirect3DSurface9 *dst_surface, - const PALETTEENTRY *dst_palette, const RECT *dst_rect, HMODULE src_module, const char *resource, - const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info) -{ - DWORD data_size; - HRSRC resinfo; - void *data; - - TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_module %p, resource %s, " - "src_rect %s, filter %#lx, color_key 0x%08lx, src_info %p.\n", - dst_surface, dst_palette, wine_dbgstr_rect(dst_rect), src_module, debugstr_a(resource), - wine_dbgstr_rect(src_rect), filter, color_key, src_info); - - if (!dst_surface) - return D3DERR_INVALIDCALL; - - if (!(resinfo = FindResourceA(src_module, resource, (const char *)RT_RCDATA)) + if (!(resinfo = FindResourceA(module, resource, (const char *)RT_RCDATA)) /* Try loading the resource as bitmap data (which is in DIB format D3DXIFF_DIB) */ - && !(resinfo = FindResourceA(src_module, resource, (const char *)RT_BITMAP))) + && !(resinfo = FindResourceA(module, resource, (const char *)RT_BITMAP))) return D3DXERR_INVALIDDATA; - if (FAILED(load_resource_into_memory(src_module, resinfo, &data, &data_size))) + if (FAILED(load_resource_into_memory(module, resinfo, &buffer, &size))) return D3DXERR_INVALIDDATA; - return D3DXLoadSurfaceFromFileInMemory(dst_surface, dst_palette, dst_rect, - data, data_size, src_rect, filter, color_key, src_info); + return D3DXGetImageInfoFromFileInMemory(buffer, size, info); } -HRESULT WINAPI D3DXLoadSurfaceFromResourceW(IDirect3DSurface9 *dst_surface, - const PALETTEENTRY *dst_palette, const RECT *dst_rect, HMODULE src_module, const WCHAR *resource, - const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info) +HRESULT WINAPI D3DXGetImageInfoFromResourceW(HMODULE module, const WCHAR *resource, D3DXIMAGE_INFO *info) { - DWORD data_size; HRSRC resinfo; - void *data; - - TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_module %p, resource %s, " - "src_rect %s, filter %#lx, color_key 0x%08lx, src_info %p.\n", - dst_surface, dst_palette, wine_dbgstr_rect(dst_rect), src_module, debugstr_w(resource), - wine_dbgstr_rect(src_rect), filter, color_key, src_info); + void *buffer; + DWORD size; - if (!dst_surface) - return D3DERR_INVALIDCALL; + TRACE("module %p, resource %s, info %p.\n", module, debugstr_w(resource), info); - if (!(resinfo = FindResourceW(src_module, resource, (const WCHAR *)RT_RCDATA)) + if (!(resinfo = FindResourceW(module, resource, (const WCHAR *)RT_RCDATA)) /* Try loading the resource as bitmap data (which is in DIB format D3DXIFF_DIB) */ - && !(resinfo = FindResourceW(src_module, resource, (const WCHAR *)RT_BITMAP))) + && !(resinfo = FindResourceW(module, resource, (const WCHAR *)RT_BITMAP))) return D3DXERR_INVALIDDATA; - if (FAILED(load_resource_into_memory(src_module, resinfo, &data, &data_size))) + if (FAILED(load_resource_into_memory(module, resinfo, &buffer, &size))) return D3DXERR_INVALIDDATA; - return D3DXLoadSurfaceFromFileInMemory(dst_surface, dst_palette, dst_rect, - data, data_size, src_rect, filter, color_key, src_info); -} - - -/************************************************************ - * helper functions for D3DXLoadSurfaceFromMemory - */ -struct argb_conversion_info -{ - const struct pixel_format_desc *srcformat; - const struct pixel_format_desc *destformat; - DWORD srcshift[4], destshift[4]; - DWORD srcmask[4], destmask[4]; - BOOL process_channel[4]; - DWORD channelmask; -}; - -static void init_argb_conversion_info(const struct pixel_format_desc *srcformat, const struct pixel_format_desc *destformat, struct argb_conversion_info *info) -{ - UINT i; - ZeroMemory(info->process_channel, 4 * sizeof(BOOL)); - info->channelmask = 0; - - info->srcformat = srcformat; - info->destformat = destformat; - - for(i = 0;i < 4;i++) { - /* srcshift is used to extract the _relevant_ components */ - info->srcshift[i] = srcformat->shift[i] + max( srcformat->bits[i] - destformat->bits[i], 0); - - /* destshift is used to move the components to the correct position */ - info->destshift[i] = destformat->shift[i] + max(destformat->bits[i] - srcformat->bits[i], 0); - - info->srcmask[i] = ((1 << srcformat->bits[i]) - 1) << srcformat->shift[i]; - info->destmask[i] = ((1 << destformat->bits[i]) - 1) << destformat->shift[i]; - - /* channelmask specifies bits which aren't used in the source format but in the destination one */ - if(destformat->bits[i]) { - if(srcformat->bits[i]) info->process_channel[i] = TRUE; - else info->channelmask |= info->destmask[i]; - } - } -} - -/************************************************************ - * get_relevant_argb_components - * - * Extracts the relevant components from the source color and - * drops the less significant bits if they aren't used by the destination format. - */ -static void get_relevant_argb_components(const struct argb_conversion_info *info, const BYTE *col, DWORD *out) -{ - unsigned int i, j; - unsigned int component, mask; - - for (i = 0; i < 4; ++i) - { - if (!info->process_channel[i]) - continue; - - component = 0; - mask = info->srcmask[i]; - for (j = 0; j < 4 && mask; ++j) - { - if (info->srcshift[i] < j * 8) - component |= (col[j] & mask) << (j * 8 - info->srcshift[i]); - else - component |= (col[j] & mask) >> (info->srcshift[i] - j * 8); - mask >>= 8; - } - out[i] = component; - } -} - -static float d3dx_clamp(float value, float min_value, float max_value) -{ - if (isnan(value)) - return max_value; - return value < min_value ? min_value : value > max_value ? max_value : value; -} - -/************************************************************ - * make_argb_color - * - * Recombines the output of get_relevant_argb_components and converts - * it to the destination format. - */ -static DWORD make_argb_color(const struct argb_conversion_info *info, const DWORD *in) -{ - UINT i; - DWORD val = 0; - - for(i = 0;i < 4;i++) { - if(info->process_channel[i]) { - /* necessary to make sure that e.g. an X4R4G4B4 white maps to an R8G8B8 white instead of 0xf0f0f0 */ - signed int shift; - for(shift = info->destshift[i]; shift > info->destformat->shift[i]; shift -= info->srcformat->bits[i]) val |= in[i] << shift; - val |= (in[i] >> (info->destformat->shift[i] - shift)) << info->destformat->shift[i]; - } - } - val |= info->channelmask; /* new channels are set to their maximal value */ - return val; -} - -static enum range get_range_for_component_type(enum component_type type) -{ - switch (type) - { - case CTYPE_SNORM: - return RANGE_SNORM; - - case CTYPE_LUMA: - case CTYPE_INDEX: - case CTYPE_UNORM: - return RANGE_UNORM; - - case CTYPE_EMPTY: - case CTYPE_FLOAT: - return RANGE_FULL; - - default: - assert(0); - return RANGE_FULL; - } -} - -static void premultiply_alpha(struct vec4 *vec) -{ - vec->x *= vec->w; - vec->y *= vec->w; - vec->z *= vec->w; -} - -static void undo_premultiplied_alpha(struct vec4 *vec) -{ - vec->x = (vec->w == 0.0f) ? 0.0f : vec->x / vec->w; - vec->y = (vec->w == 0.0f) ? 0.0f : vec->y / vec->w; - vec->z = (vec->w == 0.0f) ? 0.0f : vec->z / vec->w; -} - -/* It doesn't work for components bigger than 32 bits (or somewhat smaller but unaligned). */ -void format_to_d3dx_color(const struct pixel_format_desc *format, const BYTE *src, const PALETTEENTRY *palette, - struct d3dx_color *dst) -{ - DWORD mask, tmp; - unsigned int c; - - dst->rgb_range = get_range_for_component_type(format->rgb_type); - dst->a_range = get_range_for_component_type(format->a_type); - for (c = 0; c < 4; ++c) - { - const enum component_type dst_ctype = !c ? format->a_type : format->rgb_type; - static const unsigned int component_offsets[4] = {3, 0, 1, 2}; - float *dst_component = &dst->value.x + component_offsets[c]; - - if (format->bits[c]) - { - mask = ~0u >> (32 - format->bits[c]); - - memcpy(&tmp, src + format->shift[c] / 8, - min(sizeof(DWORD), (format->shift[c] % 8 + format->bits[c] + 7) / 8)); - tmp = (tmp >> (format->shift[c] % 8)) & mask; - - switch (dst_ctype) - { - case CTYPE_FLOAT: - if (format->bits[c] == 16) - *dst_component = float_16_to_32(tmp); - else - *dst_component = *(float *)&tmp; - break; - - case CTYPE_INDEX: - *dst_component = (&palette[tmp].peRed)[component_offsets[c]] / 255.0f; - break; - - case CTYPE_LUMA: - case CTYPE_UNORM: - *dst_component = (float)tmp / mask; - break; - - case CTYPE_SNORM: - { - const uint32_t sign_bit = (1u << (format->bits[c] - 1)); - uint32_t tmp_extended = (tmp & sign_bit) ? (tmp | ~(sign_bit - 1)) : tmp; - - /* - * In order to clamp to an even range, we need to ignore - * the maximum negative value. - */ - if (tmp == sign_bit) - tmp_extended |= 1; - - *dst_component = (float)(((int32_t)tmp_extended)) / (sign_bit - 1); - break; - } - - default: - break; - } - } - else if (dst_ctype == CTYPE_LUMA) - { - assert(format->bits[1]); - *dst_component = dst->value.x; - } - else - { - *dst_component = 1.0f; - } - } -} - -/* It doesn't work for components bigger than 32 bits. */ -void format_from_d3dx_color(const struct pixel_format_desc *format, const struct d3dx_color *src, BYTE *dst) -{ - DWORD v, mask32; - unsigned int c, i; - - memset(dst, 0, format->bytes_per_pixel); - - for (c = 0; c < 4; ++c) - { - const enum component_type dst_ctype = !c ? format->a_type : format->rgb_type; - static const unsigned int component_offsets[4] = {3, 0, 1, 2}; - const float src_component = *(&src->value.x + component_offsets[c]); - const enum range src_range = !c ? src->a_range : src->rgb_range; - - if (!format->bits[c]) - continue; - - mask32 = ~0u >> (32 - format->bits[c]); - - switch (dst_ctype) - { - case CTYPE_FLOAT: - if (format->bits[c] == 16) - v = float_32_to_16(src_component); - else - v = *(DWORD *)&src_component; - break; - - case CTYPE_LUMA: - { - float val = src->value.x * 0.2125f + src->value.y * 0.7154f + src->value.z * 0.0721f; - - if (src_range == RANGE_SNORM) - val = (val + 1.0f) / 2.0f; - - v = d3dx_clamp(val, 0.0f, 1.0f) * ((1u << format->bits[c]) - 1) + 0.5f; - break; - } - - case CTYPE_UNORM: - { - float val = src_component; - - if (src_range == RANGE_SNORM) - val = (val + 1.0f) / 2.0f; - - v = d3dx_clamp(val, 0.0f, 1.0f) * ((1u << format->bits[c]) - 1) + 0.5f; - break; - } - - case CTYPE_SNORM: - { - const uint32_t max_value = (1u << (format->bits[c] - 1)) - 1; - float val = src_component; - - if (src_range == RANGE_UNORM) - val = (val * 2.0f) - 1.0f; - - v = d3dx_clamp(val, -1.0f, 1.0f) * max_value + 0.5f; - break; - } - - /* We shouldn't be trying to output to CTYPE_INDEX. */ - case CTYPE_INDEX: - assert(0); - break; - - default: - v = 0; - break; - } - - for (i = format->shift[c] / 8 * 8; i < format->shift[c] + format->bits[c]; i += 8) - { - BYTE mask, byte; - - if (format->shift[c] > i) - { - mask = mask32 << (format->shift[c] - i); - byte = (v << (format->shift[c] - i)) & mask; - } - else - { - mask = mask32 >> (i - format->shift[c]); - byte = (v >> (i - format->shift[c])) & mask; - } - dst[i / 8] |= byte; - } - } -} - -/************************************************************ - * copy_pixels - * - * Copies the source buffer to the destination buffer. - * Works for any pixel format. - * The source and the destination must be block-aligned. - */ -static void copy_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, - BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, const struct volume *size, - const struct pixel_format_desc *format) -{ - UINT row, slice; - BYTE *dst_addr; - const BYTE *src_addr; - UINT row_block_count = (size->width + format->block_width - 1) / format->block_width; - UINT row_count = (size->height + format->block_height - 1) / format->block_height; - - for (slice = 0; slice < size->depth; slice++) - { - src_addr = src + slice * src_slice_pitch; - dst_addr = dst + slice * dst_slice_pitch; - - for (row = 0; row < row_count; row++) - { - memcpy(dst_addr, src_addr, row_block_count * format->block_byte_count); - src_addr += src_row_pitch; - dst_addr += dst_row_pitch; - } - } -} - -/************************************************************ - * convert_argb_pixels - * - * Copies the source buffer to the destination buffer, performing - * any necessary format conversion and color keying. - * Pixels outsize the source rect are blacked out. - */ -static void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, const struct volume *src_size, - const struct pixel_format_desc *src_format, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, - const struct volume *dst_size, const struct pixel_format_desc *dst_format, D3DCOLOR color_key, - const PALETTEENTRY *palette, uint32_t filter_flags) -{ - struct argb_conversion_info conv_info, ck_conv_info; - const struct pixel_format_desc *ck_format; - BOOL src_pma, dst_pma; - DWORD channels[4]; - UINT min_width, min_height, min_depth; - UINT x, y, z; - - TRACE("src %p, src_row_pitch %u, src_slice_pitch %u, src_size %p, src_format %p, dst %p, " - "dst_row_pitch %u, dst_slice_pitch %u, dst_size %p, dst_format %p, color_key 0x%08lx, palette %p.\n", - src, src_row_pitch, src_slice_pitch, src_size, src_format, dst, dst_row_pitch, dst_slice_pitch, dst_size, - dst_format, color_key, palette); - - ZeroMemory(channels, sizeof(channels)); - init_argb_conversion_info(src_format, dst_format, &conv_info); - - src_pma = !!(filter_flags & D3DX_FILTER_PMA_IN); - dst_pma = !!(filter_flags & D3DX_FILTER_PMA_OUT); - min_width = min(src_size->width, dst_size->width); - min_height = min(src_size->height, dst_size->height); - min_depth = min(src_size->depth, dst_size->depth); - - if (color_key) - { - /* Color keys are always represented in D3DFMT_A8R8G8B8 format. */ - ck_format = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM); - init_argb_conversion_info(src_format, ck_format, &ck_conv_info); - } - - for (z = 0; z < min_depth; z++) { - const BYTE *src_slice_ptr = src + z * src_slice_pitch; - BYTE *dst_slice_ptr = dst + z * dst_slice_pitch; - - for (y = 0; y < min_height; y++) { - const BYTE *src_ptr = src_slice_ptr + y * src_row_pitch; - BYTE *dst_ptr = dst_slice_ptr + y * dst_row_pitch; - - for (x = 0; x < min_width; x++) { - if (filter_flags_match(filter_flags) && format_types_match(src_format, dst_format) - && src_format->bytes_per_pixel <= 4 && dst_format->bytes_per_pixel <= 4) - { - DWORD val; - - get_relevant_argb_components(&conv_info, src_ptr, channels); - val = make_argb_color(&conv_info, channels); - - if (color_key) - { - DWORD ck_pixel; - - get_relevant_argb_components(&ck_conv_info, src_ptr, channels); - ck_pixel = make_argb_color(&ck_conv_info, channels); - if (ck_pixel == color_key) - val &= ~conv_info.destmask[0]; - } - memcpy(dst_ptr, &val, dst_format->bytes_per_pixel); - } - else - { - struct d3dx_color color, tmp; - - format_to_d3dx_color(src_format, src_ptr, palette, &color); - if (src_pma && src_pma != dst_pma) - undo_premultiplied_alpha(&color.value); - tmp = color; - - if (color_key) - { - DWORD ck_pixel; - - format_from_d3dx_color(ck_format, &tmp, (BYTE *)&ck_pixel); - if (ck_pixel == color_key) - tmp.value.w = 0.0f; - } - - color = tmp; - if (dst_pma && src_pma != dst_pma) - premultiply_alpha(&color.value); - format_from_d3dx_color(dst_format, &color, dst_ptr); - } - - src_ptr += src_format->bytes_per_pixel; - dst_ptr += dst_format->bytes_per_pixel; - } - - if (src_size->width < dst_size->width) /* black out remaining pixels */ - memset(dst_ptr, 0, dst_format->bytes_per_pixel * (dst_size->width - src_size->width)); - } - - if (src_size->height < dst_size->height) /* black out remaining pixels */ - memset(dst + src_size->height * dst_row_pitch, 0, dst_row_pitch * (dst_size->height - src_size->height)); - } - if (src_size->depth < dst_size->depth) /* black out remaining pixels */ - memset(dst + src_size->depth * dst_slice_pitch, 0, dst_slice_pitch * (dst_size->depth - src_size->depth)); -} - -/************************************************************ - * point_filter_argb_pixels - * - * Copies the source buffer to the destination buffer, performing - * any necessary format conversion, color keying and stretching - * using a point filter. - */ -static void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, const struct volume *src_size, - const struct pixel_format_desc *src_format, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, - const struct volume *dst_size, const struct pixel_format_desc *dst_format, D3DCOLOR color_key, - const PALETTEENTRY *palette, uint32_t filter_flags) -{ - struct argb_conversion_info conv_info, ck_conv_info; - const struct pixel_format_desc *ck_format; - BOOL src_pma, dst_pma; - DWORD channels[4]; - UINT x, y, z; - - TRACE("src %p, src_row_pitch %u, src_slice_pitch %u, src_size %p, src_format %p, dst %p, " - "dst_row_pitch %u, dst_slice_pitch %u, dst_size %p, dst_format %p, color_key 0x%08lx, palette %p.\n", - src, src_row_pitch, src_slice_pitch, src_size, src_format, dst, dst_row_pitch, dst_slice_pitch, dst_size, - dst_format, color_key, palette); - - src_pma = !!(filter_flags & D3DX_FILTER_PMA_IN); - dst_pma = !!(filter_flags & D3DX_FILTER_PMA_OUT); - ZeroMemory(channels, sizeof(channels)); - init_argb_conversion_info(src_format, dst_format, &conv_info); - - if (color_key) - { - /* Color keys are always represented in D3DFMT_A8R8G8B8 format. */ - ck_format = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM); - init_argb_conversion_info(src_format, ck_format, &ck_conv_info); - } - - for (z = 0; z < dst_size->depth; z++) - { - BYTE *dst_slice_ptr = dst + z * dst_slice_pitch; - const BYTE *src_slice_ptr = src + src_slice_pitch * (z * src_size->depth / dst_size->depth); - - for (y = 0; y < dst_size->height; y++) - { - BYTE *dst_ptr = dst_slice_ptr + y * dst_row_pitch; - const BYTE *src_row_ptr = src_slice_ptr + src_row_pitch * (y * src_size->height / dst_size->height); - - for (x = 0; x < dst_size->width; x++) - { - const BYTE *src_ptr = src_row_ptr + (x * src_size->width / dst_size->width) * src_format->bytes_per_pixel; - - if (filter_flags_match(filter_flags) && format_types_match(src_format, dst_format) - && src_format->bytes_per_pixel <= 4 && dst_format->bytes_per_pixel <= 4) - { - DWORD val; - - get_relevant_argb_components(&conv_info, src_ptr, channels); - val = make_argb_color(&conv_info, channels); - - if (color_key) - { - DWORD ck_pixel; - - get_relevant_argb_components(&ck_conv_info, src_ptr, channels); - ck_pixel = make_argb_color(&ck_conv_info, channels); - if (ck_pixel == color_key) - val &= ~conv_info.destmask[0]; - } - memcpy(dst_ptr, &val, dst_format->bytes_per_pixel); - } - else - { - struct d3dx_color color, tmp; - - format_to_d3dx_color(src_format, src_ptr, palette, &color); - if (src_pma && src_pma != dst_pma) - undo_premultiplied_alpha(&color.value); - tmp = color; - - if (color_key) - { - DWORD ck_pixel; - - format_from_d3dx_color(ck_format, &tmp, (BYTE *)&ck_pixel); - if (ck_pixel == color_key) - tmp.value.w = 0.0f; - } - - color = tmp; - if (dst_pma && src_pma != dst_pma) - premultiply_alpha(&color.value); - format_from_d3dx_color(dst_format, &color, dst_ptr); - } - - dst_ptr += dst_format->bytes_per_pixel; - } - } - } -} - -struct d3dx_bcn_decompression_context -{ - void (*decompress_bcn_block)(const void *, void *, int); - const struct pixel_format_desc *compressed_format_desc; - struct d3dx_pixels *compressed_pixels; - - const struct pixel_format_desc *decompressed_format_desc; - uint8_t cur_block_decompressed[192]; - uint32_t cur_block_row_pitch; - int32_t cur_block_x; - int32_t cur_block_y; - int32_t cur_block_z; -}; - -static void d3dx_init_bcn_decompression_context(struct d3dx_bcn_decompression_context *context, - struct d3dx_pixels *pixels, const struct pixel_format_desc *desc, const struct pixel_format_desc *dst_desc) -{ - memset(context, 0, sizeof(*context)); - switch (desc->format) - { - case D3DX_PIXEL_FORMAT_DXT1_UNORM: - context->decompress_bcn_block = bcdec_bc1; - break; - - case D3DX_PIXEL_FORMAT_DXT2_UNORM: - case D3DX_PIXEL_FORMAT_DXT3_UNORM: - context->decompress_bcn_block = bcdec_bc2; - break; - - case D3DX_PIXEL_FORMAT_DXT4_UNORM: - case D3DX_PIXEL_FORMAT_DXT5_UNORM: - context->decompress_bcn_block = bcdec_bc3; - break; - - default: - assert(0); - break; - } - - context->compressed_format_desc = desc; - context->compressed_pixels = pixels; - - context->decompressed_format_desc = dst_desc; - context->cur_block_row_pitch = dst_desc->bytes_per_pixel * desc->block_width; - context->cur_block_x = context->cur_block_y = context->cur_block_z = -1; -} - -static void d3dx_fetch_bcn_texel(struct d3dx_bcn_decompression_context *context, int32_t x, int32_t y, int32_t z, void *texel) -{ - const struct pixel_format_desc *decomp_fmt_desc = context->decompressed_format_desc; - const struct pixel_format_desc *comp_fmt_desc = context->compressed_format_desc; - const int32_t y_aligned = (y & ~(comp_fmt_desc->block_height - 1)); - const int32_t x_aligned = (x & ~(comp_fmt_desc->block_width - 1)); - uint32_t pixel_offset; - - if (z != context->cur_block_z || (x_aligned != context->cur_block_x) || (y_aligned != context->cur_block_y)) - { - const BYTE *block_ptr = context->compressed_pixels->data; - - block_ptr += z * context->compressed_pixels->slice_pitch; - block_ptr += (y / comp_fmt_desc->block_height) * context->compressed_pixels->row_pitch; - block_ptr += (x / comp_fmt_desc->block_width) * comp_fmt_desc->block_byte_count; - context->decompress_bcn_block(block_ptr, context->cur_block_decompressed, context->cur_block_row_pitch); - context->cur_block_x = (x & (comp_fmt_desc->block_width)); - context->cur_block_y = (y & (comp_fmt_desc->block_height)); - context->cur_block_z = z; - } - - pixel_offset = (y & (comp_fmt_desc->block_height - 1)) * context->cur_block_row_pitch; - pixel_offset += (x & (comp_fmt_desc->block_width - 1)) * decomp_fmt_desc->bytes_per_pixel; - memcpy(texel, context->cur_block_decompressed + pixel_offset, decomp_fmt_desc->bytes_per_pixel); + return D3DXGetImageInfoFromFileInMemory(buffer, size, info); } -static HRESULT d3dx_pixels_decompress(struct d3dx_pixels *pixels, const struct pixel_format_desc *desc, - BOOL is_dst, void **out_memory, uint32_t *out_row_pitch, uint32_t *out_slice_pitch, - const struct pixel_format_desc **out_desc) +static HRESULT d3dx_load_surface_from_memory(IDirect3DSurface9 *dst_surface, + const PALETTEENTRY *dst_palette, const RECT *dst_rect, const void *src_memory, + enum d3dx_pixel_format_id src_format, uint32_t src_pitch, const PALETTEENTRY *src_palette, const RECT *src_rect, + DWORD filter, D3DCOLOR color_key) { - uint32_t x, y, z, uncompressed_slice_pitch, uncompressed_row_pitch; - const struct pixel_format_desc *uncompressed_desc = NULL; - struct d3dx_bcn_decompression_context context; - const struct volume *size = &pixels->size; - BYTE *uncompressed_mem; + const struct pixel_format_desc *src_desc, *dst_desc; + struct d3dx_pixels src_pixels, dst_pixels; + RECT dst_rect_tmp, dst_rect_aligned; + IDirect3DSurface9 *surface; + D3DLOCKED_RECT lock_rect; + D3DSURFACE_DESC desc; + HRESULT hr; - switch (desc->format) + IDirect3DSurface9_GetDesc(dst_surface, &desc); + if (desc.MultiSampleType != D3DMULTISAMPLE_NONE) { - case D3DX_PIXEL_FORMAT_DXT1_UNORM: - uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); - break; - - case D3DX_PIXEL_FORMAT_DXT2_UNORM: - case D3DX_PIXEL_FORMAT_DXT3_UNORM: - uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); - break; - - case D3DX_PIXEL_FORMAT_DXT4_UNORM: - case D3DX_PIXEL_FORMAT_DXT5_UNORM: - uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); - break; - - default: - FIXME("Unexpected compressed texture format %u.\n", desc->format); - return E_NOTIMPL; + TRACE("Multisampled destination surface, doing nothing.\n"); + return D3D_OK; } - uncompressed_row_pitch = size->width * uncompressed_desc->bytes_per_pixel; - uncompressed_slice_pitch = uncompressed_row_pitch * size->height; - if (!(uncompressed_mem = malloc(size->depth * uncompressed_slice_pitch))) - return E_OUTOFMEMORY; - - /* - * For compressed destination pixels, width/height will represent - * the entire set of compressed blocks our destination rectangle touches. - * If we're only updating a sub-area of any blocks, we need to decompress - * the pixels outside of the sub-area. - */ - if (is_dst) + dst_desc = get_format_info(desc.Format); + if (!dst_rect) { - const RECT aligned_rect = { 0, 0, size->width, size->height }; - - /* - * If our destination covers the entire set of blocks, no - * decompression needs to be done, just return the allocated memory. - */ - if (EqualRect(&aligned_rect, &pixels->unaligned_rect)) - goto exit; + SetRect(&dst_rect_tmp, 0, 0, desc.Width, desc.Height); + dst_rect = &dst_rect_tmp; } - - TRACE("Decompressing pixels.\n"); - d3dx_init_bcn_decompression_context(&context, pixels, desc, uncompressed_desc); - for (z = 0; z < size->depth; ++z) + else { - for (y = 0; y < size->height; ++y) + if (dst_rect->left > dst_rect->right || dst_rect->right > desc.Width + || dst_rect->top > dst_rect->bottom || dst_rect->bottom > desc.Height + || dst_rect->left < 0 || dst_rect->top < 0) { - BYTE *ptr = &uncompressed_mem[(z * uncompressed_slice_pitch) + (y * uncompressed_row_pitch)]; - for (x = 0; x < size->width; ++x) - { - const POINT pt = { x, y }; - - if (!is_dst) - d3dx_fetch_bcn_texel(&context, x + pixels->unaligned_rect.left, y + pixels->unaligned_rect.top, z, ptr); - else if (!PtInRect(&pixels->unaligned_rect, pt)) - d3dx_fetch_bcn_texel(&context, x, y, z, ptr); - ptr += uncompressed_desc->bytes_per_pixel; - } + WARN("Invalid dst_rect specified.\n"); + return D3DERR_INVALIDCALL; } - } - -exit: - *out_memory = uncompressed_mem; - *out_row_pitch = uncompressed_row_pitch; - *out_slice_pitch = uncompressed_slice_pitch; - *out_desc = uncompressed_desc; - - return S_OK; -} - -static void d3dx_init_bcn_block_buffer(const void *src_data, uint32_t src_row_pitch, uint8_t src_width, uint8_t src_height, - const struct pixel_format_desc *src_desc, uint8_t *block_buf) -{ - uint8_t x, y; - - for (y = 0; y < 4; ++y) - { - const uint8_t *src_row = ((const uint8_t *)src_data) + ((y % src_height) * src_row_pitch); - - for (x = 0; x < 4; ++x) + if (dst_rect->left == dst_rect->right || dst_rect->top == dst_rect->bottom) { - uint8_t *dst_pixel = &block_buf[(y * 4 * src_desc->bytes_per_pixel) + (x * src_desc->bytes_per_pixel)]; - const uint8_t *src_pixel = src_row + (((x % src_width)) * src_desc->bytes_per_pixel); - - memcpy(dst_pixel, src_pixel, src_desc->bytes_per_pixel); + WARN("Empty dst_rect specified.\n"); + return D3D_OK; } } -} - -static void d3dx_compress_bc1_block(const void *src_data, uint32_t src_row_pitch, uint8_t src_width, uint8_t src_height, - void *dst_data) -{ - const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); - uint8_t tmp_buf[4 * 4 * 4]; - d3dx_init_bcn_block_buffer(src_data, src_row_pitch, src_width, src_height, fmt_desc, tmp_buf); + src_desc = get_d3dx_pixel_format_info(src_format); + hr = d3dx_pixels_init(src_memory, src_pitch, 0, src_palette, src_desc->format, + src_rect->left, src_rect->top, src_rect->right, src_rect->bottom, 0, 1, &src_pixels); + if (FAILED(hr)) + return hr; - stb_compress_dxt_block(dst_data, (const uint8_t *)tmp_buf, FALSE, 0); -} + get_aligned_rect(dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, desc.Width, desc.Height, + dst_desc, &dst_rect_aligned); + if (FAILED(hr = lock_surface(dst_surface, &dst_rect_aligned, &lock_rect, &surface, TRUE))) + return hr; -static void d3dx_compress_bc2_block(const void *src_data, uint32_t src_row_pitch, uint8_t src_width, uint8_t src_height, - void *dst_data) -{ - const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); - uint8_t *dst_data_offset = dst_data; - uint8_t tmp_buf[4 * 4 * 4], y; + set_d3dx_pixels(&dst_pixels, lock_rect.pBits, lock_rect.Pitch, 0, dst_palette, + (dst_rect_aligned.right - dst_rect_aligned.left), (dst_rect_aligned.bottom - dst_rect_aligned.top), 1, + dst_rect); + OffsetRect(&dst_pixels.unaligned_rect, -dst_rect_aligned.left, -dst_rect_aligned.top); - d3dx_init_bcn_block_buffer(src_data, src_row_pitch, src_width, src_height, fmt_desc, tmp_buf); - for (y = 0; y < 4; ++y) + if (FAILED(hr = d3dx_load_pixels_from_pixels(&dst_pixels, dst_desc, &src_pixels, src_desc, filter, color_key))) { - uint8_t *tmp_row = &tmp_buf[y * 4 * fmt_desc->bytes_per_pixel]; - - dst_data_offset[0] = (tmp_row[7] & 0xf0); - dst_data_offset[0] |= (tmp_row[3] >> 4); - dst_data_offset[1] = (tmp_row[15] & 0xf0); - dst_data_offset[1] |= (tmp_row[11] >> 4); - - /* - * Set all alpha values to 0xff so they aren't considered during - * compression. - */ - tmp_row[3] = tmp_row[7] = tmp_row[11] = tmp_row[15] = 0xff; - dst_data_offset += 2; + unlock_surface(dst_surface, &dst_rect_aligned, surface, FALSE); + return hr; } - stb_compress_dxt_block(dst_data_offset, (const unsigned char *)tmp_buf, FALSE, 0); -} - -static void d3dx_compress_bc3_block(const void *src_data, uint32_t src_row_pitch, uint8_t src_width, uint8_t src_height, - void *dst_data) -{ - const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); - uint8_t tmp_buf[4 * 4 * 4]; - - d3dx_init_bcn_block_buffer(src_data, src_row_pitch, src_width, src_height, fmt_desc, tmp_buf); - - stb_compress_dxt_block(dst_data, (const uint8_t *)tmp_buf, TRUE, 0); + return unlock_surface(dst_surface, &dst_rect_aligned, surface, TRUE); } -static HRESULT d3dx_pixels_compress(struct d3dx_pixels *src_pixels, - const struct pixel_format_desc *src_desc, struct d3dx_pixels *dst_pixels, - const struct pixel_format_desc *dst_desc) +/************************************************************ + * D3DXLoadSurfaceFromFileInMemory + * + * Loads data from a given buffer into a surface and fills a given + * D3DXIMAGE_INFO structure with info about the source data. + * + * PARAMS + * pDestSurface [I] pointer to the surface + * pDestPalette [I] palette to use + * pDestRect [I] to be filled area of the surface + * pSrcData [I] pointer to the source data + * SrcDataSize [I] size of the source data in bytes + * pSrcRect [I] area of the source data to load + * dwFilter [I] filter to apply on stretching + * Colorkey [I] colorkey + * pSrcInfo [O] pointer to a D3DXIMAGE_INFO structure + * + * RETURNS + * Success: D3D_OK + * Failure: D3DERR_INVALIDCALL, if pDestSurface, pSrcData or SrcDataSize is NULL + * D3DXERR_INVALIDDATA, if pSrcData is no valid image file + * + */ +HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface, + const PALETTEENTRY *pDestPalette, const RECT *pDestRect, const void *pSrcData, UINT SrcDataSize, + const RECT *pSrcRect, DWORD dwFilter, D3DCOLOR Colorkey, D3DXIMAGE_INFO *pSrcInfo) { - void (*compress_bcn_block)(const void *, uint32_t, uint8_t, uint8_t, void *) = NULL; - uint32_t x, y, z; - - /* Pick a compression function. */ - switch (dst_desc->format) - { - case D3DX_PIXEL_FORMAT_DXT1_UNORM: - compress_bcn_block = d3dx_compress_bc1_block; - break; - - case D3DX_PIXEL_FORMAT_DXT2_UNORM: - case D3DX_PIXEL_FORMAT_DXT3_UNORM: - compress_bcn_block = d3dx_compress_bc2_block; - break; + struct d3dx_pixels pixels = { 0 }; + struct d3dx_image image; + D3DXIMAGE_INFO img_info; + RECT src_rect; + HRESULT hr; - case D3DX_PIXEL_FORMAT_DXT4_UNORM: - case D3DX_PIXEL_FORMAT_DXT5_UNORM: - compress_bcn_block = d3dx_compress_bc3_block; - break; + TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_data %p, src_data_size %u, " + "src_rect %s, filter %#lx, color_key 0x%08lx, src_info %p.\n", + pDestSurface, pDestPalette, wine_dbgstr_rect(pDestRect), pSrcData, SrcDataSize, + wine_dbgstr_rect(pSrcRect), dwFilter, Colorkey, pSrcInfo); - default: - FIXME("Unexpected compressed texture format %u.\n", dst_desc->format); - return E_NOTIMPL; - } + if (!pDestSurface || !pSrcData || !SrcDataSize) + return D3DERR_INVALIDCALL; - assert(compress_bcn_block); + if (FAILED(hr = d3dx9_handle_load_filter(&dwFilter))) + return hr; - TRACE("Compressing pixels.\n"); - for (z = 0; z < src_pixels->size.depth; ++z) - { - const BYTE *src_slice = ((const BYTE *)src_pixels->data) + (z * src_pixels->slice_pitch); - BYTE *dst_slice = ((BYTE *)dst_pixels->data) + (z * dst_pixels->slice_pitch); + hr = d3dx_image_init(pSrcData, SrcDataSize, &image, 0, 0); + if (FAILED(hr)) + return D3DXERR_INVALIDDATA; - for (y = 0; y < src_pixels->size.height; y += dst_desc->block_height) - { - BYTE *dst_ptr = &dst_slice[(y / dst_desc->block_height) * dst_pixels->row_pitch]; - uint8_t tmp_src_height = min(dst_desc->block_height, src_pixels->size.height - y); - const BYTE *src_ptr = &src_slice[y * src_pixels->row_pitch]; + d3dximage_info_from_d3dx_image(&img_info, &image); + if (pSrcRect) + src_rect = *pSrcRect; + else + SetRect(&src_rect, 0, 0, img_info.Width, img_info.Height); - for (x = 0; x < src_pixels->size.width; x += dst_desc->block_width) - { - uint8_t tmp_src_width = min(dst_desc->block_width, src_pixels->size.width - x); + hr = d3dx_image_get_pixels(&image, 0, 0, &pixels); + if (FAILED(hr)) + goto exit; - compress_bcn_block(src_ptr, src_pixels->row_pitch, tmp_src_width, tmp_src_height, dst_ptr); - src_ptr += (src_desc->bytes_per_pixel * dst_desc->block_width); - dst_ptr += dst_desc->block_byte_count; - } - } - } + hr = d3dx_load_surface_from_memory(pDestSurface, pDestPalette, pDestRect, pixels.data, image.format, pixels.row_pitch, + pixels.palette, &src_rect, dwFilter, Colorkey); + if (SUCCEEDED(hr) && pSrcInfo) + *pSrcInfo = img_info; - return S_OK; +exit: + d3dx_image_cleanup(&image); + return FAILED(hr) ? D3DXERR_INVALIDDATA : D3D_OK; } -HRESULT d3dx_pixels_init(const void *data, uint32_t row_pitch, uint32_t slice_pitch, - const PALETTEENTRY *palette, enum d3dx_pixel_format_id format, uint32_t left, uint32_t top, uint32_t right, - uint32_t bottom, uint32_t front, uint32_t back, struct d3dx_pixels *pixels) +HRESULT WINAPI D3DXLoadSurfaceFromFileA(IDirect3DSurface9 *dst_surface, + const PALETTEENTRY *dst_palette, const RECT *dst_rect, const char *src_file, + const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info) { - const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(format); - const BYTE *ptr = data; - RECT unaligned_rect; - - memset(pixels, 0, sizeof(*pixels)); - if (is_unknown_format(fmt_desc)) - { - FIXME("Unsupported format %#x.\n", format); - return E_NOTIMPL; - } - - ptr += front * slice_pitch; - ptr += (top / fmt_desc->block_height) * row_pitch; - ptr += (left / fmt_desc->block_width) * fmt_desc->block_byte_count; + WCHAR *src_file_w; + HRESULT hr; + int strlength; - if (is_compressed_format(fmt_desc)) - { - uint32_t left_aligned, top_aligned; + TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_file %s, " + "src_rect %s, filter %#lx, color_key 0x%08lx, src_info %p.\n", + dst_surface, dst_palette, wine_dbgstr_rect(dst_rect), debugstr_a(src_file), + wine_dbgstr_rect(src_rect), filter, color_key, src_info); - top_aligned = top & ~(fmt_desc->block_height - 1); - left_aligned = left & ~(fmt_desc->block_width - 1); - SetRect(&unaligned_rect, left, top, right, bottom); - OffsetRect(&unaligned_rect, -left_aligned, -top_aligned); - } - else - { - SetRect(&unaligned_rect, 0, 0, (right - left), (bottom - top)); - } + if (!src_file || !dst_surface) + return D3DERR_INVALIDCALL; - if (!slice_pitch) - slice_pitch = row_pitch * (bottom - top); - set_d3dx_pixels(pixels, ptr, row_pitch, slice_pitch, palette, (right - left), (bottom - top), (back - front), - &unaligned_rect); + strlength = MultiByteToWideChar(CP_ACP, 0, src_file, -1, NULL, 0); + src_file_w = malloc(strlength * sizeof(*src_file_w)); + MultiByteToWideChar(CP_ACP, 0, src_file, -1, src_file_w, strlength); - return S_OK; -} + hr = D3DXLoadSurfaceFromFileW(dst_surface, dst_palette, dst_rect, + src_file_w, src_rect, filter, color_key, src_info); + free(src_file_w); -static const char *debug_d3dx_pixels(struct d3dx_pixels *pixels) -{ - if (!pixels) - return "(null)"; - return wine_dbg_sprintf("(data %p, row_pitch %d, slice_pitch %d, palette %p, width %d, height %d, depth %d, " - "unaligned_rect %s)", pixels->data, pixels->row_pitch, pixels->slice_pitch, pixels->palette, - pixels->size.width, pixels->size.height, pixels->size.depth, wine_dbgstr_rect(&pixels->unaligned_rect)); + return hr; } -HRESULT d3dx_load_pixels_from_pixels(struct d3dx_pixels *dst_pixels, - const struct pixel_format_desc *dst_desc, struct d3dx_pixels *src_pixels, - const struct pixel_format_desc *src_desc, uint32_t filter_flags, uint32_t color_key) +HRESULT WINAPI D3DXLoadSurfaceFromFileW(IDirect3DSurface9 *dst_surface, + const PALETTEENTRY *dst_palette, const RECT *dst_rect, const WCHAR *src_file, + const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info) { - struct volume src_size, dst_size, dst_size_aligned; - BOOL src_pma, dst_pma; - HRESULT hr = S_OK; - - TRACE("dst_pixels %s, dst_desc %p, src_pixels %s, src_desc %p, filter_flags %#x, color_key %#x.\n", - debug_d3dx_pixels(dst_pixels), dst_desc, debug_d3dx_pixels(src_pixels), src_desc, - filter_flags, color_key); - - if (src_desc->flags & FMT_FLAG_PM_ALPHA) - filter_flags |= D3DX_FILTER_PMA_IN; + DWORD data_size; + void *data; + HRESULT hr; - if (dst_desc->flags & FMT_FLAG_PM_ALPHA) - filter_flags |= D3DX_FILTER_PMA_OUT; + TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_file %s, " + "src_rect %s, filter %#lx, color_key 0x%08lx, src_info %p.\n", + dst_surface, dst_palette, wine_dbgstr_rect(dst_rect), debugstr_w(src_file), + wine_dbgstr_rect(src_rect), filter, color_key, src_info); - src_pma = !!(filter_flags & D3DX_FILTER_PMA_IN); - dst_pma = !!(filter_flags & D3DX_FILTER_PMA_OUT); + if (!src_file || !dst_surface) + return D3DERR_INVALIDCALL; - if (is_compressed_format(src_desc)) - set_volume_struct(&src_size, (src_pixels->unaligned_rect.right - src_pixels->unaligned_rect.left), - (src_pixels->unaligned_rect.bottom - src_pixels->unaligned_rect.top), src_pixels->size.depth); - else - src_size = src_pixels->size; + if (FAILED(map_view_of_file(src_file, &data, &data_size))) + return D3DXERR_INVALIDDATA; - dst_size_aligned = dst_pixels->size; - if (is_compressed_format(dst_desc)) - set_volume_struct(&dst_size, (dst_pixels->unaligned_rect.right - dst_pixels->unaligned_rect.left), - (dst_pixels->unaligned_rect.bottom - dst_pixels->unaligned_rect.top), dst_pixels->size.depth); - else - dst_size = dst_size_aligned; - - /* Everything matches, simply copy the pixels. */ - if (src_desc->format == dst_desc->format - && (dst_size.width == src_size.width && !(dst_size.width % dst_desc->block_width)) - && (dst_size.height == src_size.height && !(dst_size.height % dst_desc->block_height)) - && (dst_size.depth == src_size.depth) - && (src_pma == dst_pma) - && color_key == 0 - && !(src_pixels->unaligned_rect.left & (src_desc->block_width - 1)) - && !(src_pixels->unaligned_rect.top & (src_desc->block_height - 1)) - && !(dst_pixels->unaligned_rect.left & (dst_desc->block_width - 1)) - && !(dst_pixels->unaligned_rect.top & (dst_desc->block_height - 1))) - { - TRACE("Simple copy.\n"); - copy_pixels(src_pixels->data, src_pixels->row_pitch, src_pixels->slice_pitch, (void *)dst_pixels->data, - dst_pixels->row_pitch, dst_pixels->slice_pitch, &src_size, src_desc); - return S_OK; - } + hr = D3DXLoadSurfaceFromFileInMemory(dst_surface, dst_palette, dst_rect, + data, data_size, src_rect, filter, color_key, src_info); + UnmapViewOfFile(data); - /* Stretching or format conversion. */ - if (!is_conversion_from_supported(src_desc) - || !is_conversion_to_supported(dst_desc)) - { - FIXME("Unsupported format conversion %#x -> %#x.\n", src_desc->format, dst_desc->format); - return E_NOTIMPL; - } + return hr; +} - /* - * If the source is a compressed image, we need to decompress it first - * before doing any modifications. - */ - if (is_compressed_format(src_desc)) - { - uint32_t uncompressed_row_pitch, uncompressed_slice_pitch; - const struct pixel_format_desc *uncompressed_desc; - void *uncompressed_mem = NULL; +HRESULT WINAPI D3DXLoadSurfaceFromResourceA(IDirect3DSurface9 *dst_surface, + const PALETTEENTRY *dst_palette, const RECT *dst_rect, HMODULE src_module, const char *resource, + const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info) +{ + DWORD data_size; + HRSRC resinfo; + void *data; - hr = d3dx_pixels_decompress(src_pixels, src_desc, FALSE, &uncompressed_mem, &uncompressed_row_pitch, - &uncompressed_slice_pitch, &uncompressed_desc); - if (SUCCEEDED(hr)) - { - struct d3dx_pixels uncompressed_pixels; + TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_module %p, resource %s, " + "src_rect %s, filter %#lx, color_key 0x%08lx, src_info %p.\n", + dst_surface, dst_palette, wine_dbgstr_rect(dst_rect), src_module, debugstr_a(resource), + wine_dbgstr_rect(src_rect), filter, color_key, src_info); - d3dx_pixels_init(uncompressed_mem, uncompressed_row_pitch, uncompressed_slice_pitch, NULL, - uncompressed_desc->format, 0, 0, src_pixels->size.width, src_pixels->size.height, - 0, src_pixels->size.depth, &uncompressed_pixels); + if (!dst_surface) + return D3DERR_INVALIDCALL; - hr = d3dx_load_pixels_from_pixels(dst_pixels, dst_desc, &uncompressed_pixels, uncompressed_desc, - filter_flags, color_key); - } - free(uncompressed_mem); - goto exit; - } + if (!(resinfo = FindResourceA(src_module, resource, (const char *)RT_RCDATA)) + /* Try loading the resource as bitmap data (which is in DIB format D3DXIFF_DIB) */ + && !(resinfo = FindResourceA(src_module, resource, (const char *)RT_BITMAP))) + return D3DXERR_INVALIDDATA; - /* Same as the above, need to decompress the destination prior to modifying. */ - if (is_compressed_format(dst_desc)) - { - uint32_t uncompressed_row_pitch, uncompressed_slice_pitch; - const struct pixel_format_desc *uncompressed_desc; - struct d3dx_pixels uncompressed_pixels; - void *uncompressed_mem = NULL; + if (FAILED(load_resource_into_memory(src_module, resinfo, &data, &data_size))) + return D3DXERR_INVALIDDATA; - hr = d3dx_pixels_decompress(dst_pixels, dst_desc, TRUE, &uncompressed_mem, &uncompressed_row_pitch, - &uncompressed_slice_pitch, &uncompressed_desc); - if (FAILED(hr)) - goto exit; + return D3DXLoadSurfaceFromFileInMemory(dst_surface, dst_palette, dst_rect, + data, data_size, src_rect, filter, color_key, src_info); +} - d3dx_pixels_init(uncompressed_mem, uncompressed_row_pitch, uncompressed_slice_pitch, NULL, - uncompressed_desc->format, dst_pixels->unaligned_rect.left, dst_pixels->unaligned_rect.top, - dst_pixels->unaligned_rect.right, dst_pixels->unaligned_rect.bottom, 0, dst_pixels->size.depth, - &uncompressed_pixels); +HRESULT WINAPI D3DXLoadSurfaceFromResourceW(IDirect3DSurface9 *dst_surface, + const PALETTEENTRY *dst_palette, const RECT *dst_rect, HMODULE src_module, const WCHAR *resource, + const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info) +{ + DWORD data_size; + HRSRC resinfo; + void *data; - hr = d3dx_load_pixels_from_pixels(&uncompressed_pixels, uncompressed_desc, src_pixels, src_desc, filter_flags, - color_key); - if (SUCCEEDED(hr)) - { - d3dx_pixels_init(uncompressed_mem, uncompressed_row_pitch, uncompressed_slice_pitch, NULL, - uncompressed_desc->format, 0, 0, dst_size_aligned.width, dst_size_aligned.height, 0, - dst_pixels->size.depth, &uncompressed_pixels); + TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_module %p, resource %s, " + "src_rect %s, filter %#lx, color_key 0x%08lx, src_info %p.\n", + dst_surface, dst_palette, wine_dbgstr_rect(dst_rect), src_module, debugstr_w(resource), + wine_dbgstr_rect(src_rect), filter, color_key, src_info); - hr = d3dx_pixels_compress(&uncompressed_pixels, uncompressed_desc, dst_pixels, dst_desc); - if (FAILED(hr)) - WARN("Failed to compress pixels, hr %#lx.\n", hr); - } - free(uncompressed_mem); - goto exit; - } + if (!dst_surface) + return D3DERR_INVALIDCALL; - if ((filter_flags & 0xf) == D3DX_FILTER_NONE) - { - convert_argb_pixels(src_pixels->data, src_pixels->row_pitch, src_pixels->slice_pitch, &src_size, src_desc, - (BYTE *)dst_pixels->data, dst_pixels->row_pitch, dst_pixels->slice_pitch, &dst_size, dst_desc, - color_key, src_pixels->palette, filter_flags); - } - else /* if ((filter & 0xf) == D3DX_FILTER_POINT) */ - { - if ((filter_flags & 0xf) != D3DX_FILTER_POINT) - FIXME("Unhandled filter %#x.\n", filter_flags); - - /* Always apply a point filter until D3DX_FILTER_LINEAR, - * D3DX_FILTER_TRIANGLE and D3DX_FILTER_BOX are implemented. */ - point_filter_argb_pixels(src_pixels->data, src_pixels->row_pitch, src_pixels->slice_pitch, &src_size, - src_desc, (BYTE *)dst_pixels->data, dst_pixels->row_pitch, dst_pixels->slice_pitch, &dst_size, - dst_desc, color_key, src_pixels->palette, filter_flags); - } + if (!(resinfo = FindResourceW(src_module, resource, (const WCHAR *)RT_RCDATA)) + /* Try loading the resource as bitmap data (which is in DIB format D3DXIFF_DIB) */ + && !(resinfo = FindResourceW(src_module, resource, (const WCHAR *)RT_BITMAP))) + return D3DXERR_INVALIDDATA; -exit: - if (FAILED(hr)) - WARN("Failed to load pixels, hr %#lx.\n", hr); - return hr; -} + if (FAILED(load_resource_into_memory(src_module, resinfo, &data, &data_size))) + return D3DXERR_INVALIDDATA; -void get_aligned_rect(uint32_t left, uint32_t top, uint32_t right, uint32_t bottom, uint32_t width, uint32_t height, - const struct pixel_format_desc *fmt_desc, RECT *aligned_rect) -{ - SetRect(aligned_rect, left, top, right, bottom); - if (aligned_rect->left & (fmt_desc->block_width - 1)) - aligned_rect->left = aligned_rect->left & ~(fmt_desc->block_width - 1); - if (aligned_rect->top & (fmt_desc->block_height - 1)) - aligned_rect->top = aligned_rect->top & ~(fmt_desc->block_height - 1); - if (aligned_rect->right & (fmt_desc->block_width - 1) && aligned_rect->right != width) - aligned_rect->right = min((aligned_rect->right + fmt_desc->block_width - 1) - & ~(fmt_desc->block_width - 1), width); - if (aligned_rect->bottom & (fmt_desc->block_height - 1) && aligned_rect->bottom != height) - aligned_rect->bottom = min((aligned_rect->bottom + fmt_desc->block_height - 1) - & ~(fmt_desc->block_height - 1), height); + return D3DXLoadSurfaceFromFileInMemory(dst_surface, dst_palette, dst_rect, + data, data_size, src_rect, filter, color_key, src_info); } /************************************************************ diff --git a/dlls/d3dx9_36/util.c b/dlls/d3dx9_36/util.c index 490f39a0d585..55d69e78478d 100644 --- a/dlls/d3dx9_36/util.c +++ b/dlls/d3dx9_36/util.c @@ -22,64 +22,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx); -/************************************************************ - * pixel format table providing info about number of bytes per pixel, - * number of bits per channel and format type. - * - * Call get_format_info to request information about a specific format. - */ -static const struct pixel_format_desc formats[] = -{ - /* format bpc shifts bpp blocks alpha type rgb type flags */ - {D3DX_PIXEL_FORMAT_B8G8R8_UNORM, { 0, 8, 8, 8}, { 0, 16, 8, 0}, 3, 1, 1, 3, CTYPE_EMPTY, CTYPE_UNORM, 0 }, - {D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM, { 8, 8, 8, 8}, {24, 16, 8, 0}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_UNORM, 0 }, - {D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM, { 0, 8, 8, 8}, { 0, 16, 8, 0}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, 0 }, - {D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM, { 8, 8, 8, 8}, {24, 0, 8, 16}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_UNORM, 0 }, - {D3DX_PIXEL_FORMAT_R8G8B8X8_UNORM, { 0, 8, 8, 8}, { 0, 0, 8, 16}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, 0 }, - {D3DX_PIXEL_FORMAT_B5G6R5_UNORM, { 0, 5, 6, 5}, { 0, 11, 5, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_UNORM, 0 }, - {D3DX_PIXEL_FORMAT_B5G5R5X1_UNORM, { 0, 5, 5, 5}, { 0, 10, 5, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_UNORM, 0 }, - {D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM, { 1, 5, 5, 5}, {15, 10, 5, 0}, 2, 1, 1, 2, CTYPE_UNORM, CTYPE_UNORM, 0 }, - {D3DX_PIXEL_FORMAT_B2G3R3_UNORM, { 0, 3, 3, 2}, { 0, 5, 2, 0}, 1, 1, 1, 1, CTYPE_EMPTY, CTYPE_UNORM, 0 }, - {D3DX_PIXEL_FORMAT_B2G3R3A8_UNORM, { 8, 3, 3, 2}, { 8, 5, 2, 0}, 2, 1, 1, 2, CTYPE_UNORM, CTYPE_UNORM, 0 }, - {D3DX_PIXEL_FORMAT_B4G4R4A4_UNORM, { 4, 4, 4, 4}, {12, 8, 4, 0}, 2, 1, 1, 2, CTYPE_UNORM, CTYPE_UNORM, 0 }, - {D3DX_PIXEL_FORMAT_B4G4R4X4_UNORM, { 0, 4, 4, 4}, { 0, 8, 4, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_UNORM, 0 }, - {D3DX_PIXEL_FORMAT_B10G10R10A2_UNORM, { 2, 10, 10, 10}, {30, 20, 10, 0}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_UNORM, 0 }, - {D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM, { 2, 10, 10, 10}, {30, 0, 10, 20}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_UNORM, 0 }, - {D3DX_PIXEL_FORMAT_R16G16B16_UNORM, { 0, 16, 16, 16}, { 0, 0, 16, 32}, 6, 1, 1, 6, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_INTERNAL}, - {D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM, {16, 16, 16, 16}, {48, 0, 16, 32}, 8, 1, 1, 8, CTYPE_UNORM, CTYPE_UNORM, 0 }, - {D3DX_PIXEL_FORMAT_R16G16_UNORM, { 0, 16, 16, 0}, { 0, 0, 16, 0}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, 0 }, - {D3DX_PIXEL_FORMAT_A8_UNORM, { 8, 0, 0, 0}, { 0, 0, 0, 0}, 1, 1, 1, 1, CTYPE_UNORM, CTYPE_EMPTY, 0 }, - {D3DX_PIXEL_FORMAT_L8A8_UNORM, { 8, 8, 0, 0}, { 8, 0, 0, 0}, 2, 1, 1, 2, CTYPE_UNORM, CTYPE_LUMA, 0 }, - {D3DX_PIXEL_FORMAT_L4A4_UNORM, { 4, 4, 0, 0}, { 4, 0, 0, 0}, 1, 1, 1, 1, CTYPE_UNORM, CTYPE_LUMA, 0 }, - {D3DX_PIXEL_FORMAT_L8_UNORM, { 0, 8, 0, 0}, { 0, 0, 0, 0}, 1, 1, 1, 1, CTYPE_EMPTY, CTYPE_LUMA, 0 }, - {D3DX_PIXEL_FORMAT_L16_UNORM, { 0, 16, 0, 0}, { 0, 0, 0, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_LUMA, 0 }, - {D3DX_PIXEL_FORMAT_DXT1_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 8, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT}, - {D3DX_PIXEL_FORMAT_DXT2_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT | FMT_FLAG_PM_ALPHA}, - {D3DX_PIXEL_FORMAT_DXT3_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT}, - {D3DX_PIXEL_FORMAT_DXT4_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT | FMT_FLAG_PM_ALPHA}, - {D3DX_PIXEL_FORMAT_DXT5_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT}, - {D3DX_PIXEL_FORMAT_R16_FLOAT, { 0, 16, 0, 0}, { 0, 0, 0, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_FLOAT, 0 }, - {D3DX_PIXEL_FORMAT_R16G16_FLOAT, { 0, 16, 16, 0}, { 0, 0, 16, 0}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_FLOAT, 0 }, - {D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT, {16, 16, 16, 16}, {48, 0, 16, 32}, 8, 1, 1, 8, CTYPE_FLOAT, CTYPE_FLOAT, 0 }, - {D3DX_PIXEL_FORMAT_R32_FLOAT, { 0, 32, 0, 0}, { 0, 0, 0, 0}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_FLOAT, 0 }, - {D3DX_PIXEL_FORMAT_R32G32_FLOAT, { 0, 32, 32, 0}, { 0, 0, 32, 0}, 8, 1, 1, 8, CTYPE_EMPTY, CTYPE_FLOAT, 0 }, - {D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT, {32, 32, 32, 32}, {96, 0, 32, 64}, 16, 1, 1, 16, CTYPE_FLOAT, CTYPE_FLOAT, 0 }, - {D3DX_PIXEL_FORMAT_P8_UINT, { 8, 8, 8, 8}, { 0, 0, 0, 0}, 1, 1, 1, 1, CTYPE_INDEX, CTYPE_INDEX, 0 }, - {D3DX_PIXEL_FORMAT_P8_UINT_A8_UNORM, { 8, 8, 8, 8}, { 8, 0, 0, 0}, 2, 1, 1, 2, CTYPE_UNORM, CTYPE_INDEX, 0 }, - {D3DX_PIXEL_FORMAT_U8V8W8Q8_SNORM, { 8, 8, 8, 8}, {24, 0, 8, 16}, 4, 1, 1, 4, CTYPE_SNORM, CTYPE_SNORM, 0 }, - {D3DX_PIXEL_FORMAT_U16V16W16Q16_SNORM, {16, 16, 16, 16}, {48, 0, 16, 32}, 8, 1, 1, 8, CTYPE_SNORM, CTYPE_SNORM, 0 }, - {D3DX_PIXEL_FORMAT_U8V8_SNORM, { 0, 8, 8, 0}, { 0, 0, 8, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_SNORM, 0 }, - {D3DX_PIXEL_FORMAT_U16V16_SNORM, { 0, 16, 16, 0}, { 0, 0, 16, 0}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_SNORM, 0 }, - {D3DX_PIXEL_FORMAT_U8V8_SNORM_L8X8_UNORM, { 8, 8, 8, 0}, {16, 0, 8, 0}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_SNORM, 0 }, - {D3DX_PIXEL_FORMAT_U10V10W10_SNORM_A2_UNORM, { 2, 10, 10, 10}, {30, 0, 10, 20}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_SNORM, 0 }, - {D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 2, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_PACKED}, - {D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 2, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_PACKED}, - {D3DX_PIXEL_FORMAT_UYVY, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 2, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_PACKED}, - {D3DX_PIXEL_FORMAT_YUY2, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 2, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_PACKED}, - /* marks last element */ - {D3DX_PIXEL_FORMAT_COUNT, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 0, 1, 1, 0, CTYPE_EMPTY, CTYPE_EMPTY, 0 }, -}; - D3DFORMAT d3dformat_from_d3dx_pixel_format_id(enum d3dx_pixel_format_id format) { switch (format) @@ -307,11 +249,6 @@ HRESULT write_buffer_to_file(const WCHAR *dst_filename, ID3DXBuffer *buffer) return hr; } -const struct pixel_format_desc *get_d3dx_pixel_format_info(enum d3dx_pixel_format_id format) -{ - return &formats[min(format, D3DX_PIXEL_FORMAT_COUNT)]; -} - /************************************************************ * get_format_info * @@ -324,7 +261,7 @@ const struct pixel_format_desc *get_d3dx_pixel_format_info(enum d3dx_pixel_forma */ const struct pixel_format_desc *get_format_info(D3DFORMAT format) { - const struct pixel_format_desc *fmt_desc = &formats[d3dx_pixel_format_id_from_d3dformat(format)]; + const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(d3dx_pixel_format_id_from_d3dformat(format)); if (is_unknown_format(fmt_desc)) FIXME("Unknown format %s.\n", debugstr_fourcc(format)); @@ -333,7 +270,7 @@ const struct pixel_format_desc *get_format_info(D3DFORMAT format) const struct pixel_format_desc *get_format_info_idx(int idx) { - return idx < D3DX_PIXEL_FORMAT_COUNT ? &formats[idx] : NULL; + return idx < D3DX_PIXEL_FORMAT_COUNT ? get_d3dx_pixel_format_info(idx) : NULL; } #define WINE_D3DX_TO_STR(x) case x: return #x diff --git a/dlls/d3dx9_37/Makefile.in b/dlls/d3dx9_37/Makefile.in index 29b47679786d..d4224c70b869 100644 --- a/dlls/d3dx9_37/Makefile.in +++ b/dlls/d3dx9_37/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=37 +EXTRADEFS = -DD3DX_SDK_VERSION=37 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_37.dll IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 PARENTSRC = ../d3dx9_36 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_38/Makefile.in b/dlls/d3dx9_38/Makefile.in index c56b10dd4d4d..9084249990ae 100644 --- a/dlls/d3dx9_38/Makefile.in +++ b/dlls/d3dx9_38/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=38 +EXTRADEFS = -DD3DX_SDK_VERSION=38 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_38.dll IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 PARENTSRC = ../d3dx9_36 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_39/Makefile.in b/dlls/d3dx9_39/Makefile.in index 87895b310811..894362b326bd 100644 --- a/dlls/d3dx9_39/Makefile.in +++ b/dlls/d3dx9_39/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=39 +EXTRADEFS = -DD3DX_SDK_VERSION=39 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_39.dll IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 PARENTSRC = ../d3dx9_36 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_40/Makefile.in b/dlls/d3dx9_40/Makefile.in index 5e4fc8849ac5..4629f689be10 100644 --- a/dlls/d3dx9_40/Makefile.in +++ b/dlls/d3dx9_40/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=40 +EXTRADEFS = -DD3DX_SDK_VERSION=40 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_40.dll IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 PARENTSRC = ../d3dx9_36 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_41/Makefile.in b/dlls/d3dx9_41/Makefile.in index 542a7c75381c..894b584a4014 100644 --- a/dlls/d3dx9_41/Makefile.in +++ b/dlls/d3dx9_41/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=41 +EXTRADEFS = -DD3DX_SDK_VERSION=41 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_41.dll IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 PARENTSRC = ../d3dx9_36 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_42/Makefile.in b/dlls/d3dx9_42/Makefile.in index 8b73b6a0abcd..61c92735f008 100644 --- a/dlls/d3dx9_42/Makefile.in +++ b/dlls/d3dx9_42/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=42 +EXTRADEFS = -DD3DX_SDK_VERSION=42 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_42.dll IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 PARENTSRC = ../d3dx9_36 @@ -9,6 +9,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ diff --git a/dlls/d3dx9_43/Makefile.in b/dlls/d3dx9_43/Makefile.in index 52ec11b1e871..f84d3843a4d2 100644 --- a/dlls/d3dx9_43/Makefile.in +++ b/dlls/d3dx9_43/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DD3DX_SDK_VERSION=43 +EXTRADEFS = -DD3DX_SDK_VERSION=43 -DD3DX_D3D_VERSION=9 MODULE = d3dx9_43.dll IMPORTLIB = d3dx9_43 IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 @@ -10,6 +10,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ animation.c \ core.c \ + d3dx_helpers.c \ effect.c \ font.c \ line.c \ From a8f63cecaa637415c4e23615e25cc28e0558bb55 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Tue, 5 Nov 2024 11:46:52 -0500 Subject: [PATCH 0926/2542] d3dx10: Use shared d3dx code in get_image_info when possible. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/Makefile.in | 5 +- dlls/d3dx10_43/dxhelpers.h | 2 + dlls/d3dx10_43/texture.c | 133 +++++++++++++++++++++++++++++++++++ dlls/d3dx9_36/d3dx_helpers.h | 29 ++++++++ 4 files changed, 168 insertions(+), 1 deletion(-) diff --git a/dlls/d3dx10_43/Makefile.in b/dlls/d3dx10_43/Makefile.in index 3d755499749d..8a0e6d182627 100644 --- a/dlls/d3dx10_43/Makefile.in +++ b/dlls/d3dx10_43/Makefile.in @@ -1,6 +1,8 @@ +EXTRADEFS = -DD3DX_D3D_VERSION=10 MODULE = d3dx10_43.dll IMPORTLIB = d3dx10 -IMPORTS = d3d10_1 d3dcompiler dxguid uuid gdi32 +IMPORTS = d3d10_1 d3dcompiler dxguid uuid gdi32 ole32 +PARENTSRC = ../d3dx9_36 DELAYIMPORTS = windowscodecs EXTRADLLFLAGS = -Wb,--prefer-native @@ -8,6 +10,7 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ async.c \ compiler.c \ + d3dx_helpers.c \ d3dx10_43_main.c \ font.c \ mesh.c \ diff --git a/dlls/d3dx10_43/dxhelpers.h b/dlls/d3dx10_43/dxhelpers.h index 50d509973cda..49f56d63a234 100644 --- a/dlls/d3dx10_43/dxhelpers.h +++ b/dlls/d3dx10_43/dxhelpers.h @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "../d3dx9_36/d3dx_helpers.h" + extern HRESULT load_file(const WCHAR *path, void **data, DWORD *size); extern HRESULT load_resourceA(HMODULE module, const char *resource, void **data, DWORD *size); diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index b925a07dd088..7d172264155b 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -29,6 +29,76 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx); HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT sdk_version, IWICImagingFactory **imaging_factory); +/* + * These are mappings from legacy DDS header formats to DXGI formats. Some + * don't map to a DXGI_FORMAT at all, and some only map to the default format. + */ +static DXGI_FORMAT dxgi_format_from_legacy_dds_d3dx_pixel_format_id(enum d3dx_pixel_format_id format) +{ + switch (format) + { + /* + * Some of these formats do have DXGI_FORMAT equivalents, but get + * mapped to DXGI_FORMAT_R8G8B8A8_UNORM instead. + */ + case D3DX_PIXEL_FORMAT_P8_UINT: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_P8_UINT_A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_R8G8B8X8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B8G8R8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B5G6R5_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B5G5R5X1_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B2G3R3_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B2G3R3A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B4G4R4A4_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B4G4R4X4_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_L8A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_L4A4_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_L8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + + /* B10G10R10A2 doesn't exist in DXGI, both map to R10G10B10A2. */ + case D3DX_PIXEL_FORMAT_B10G10R10A2_UNORM: + case D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM: return DXGI_FORMAT_R10G10B10A2_UNORM; + + case D3DX_PIXEL_FORMAT_U16V16W16Q16_SNORM: return DXGI_FORMAT_R16G16B16A16_SNORM; + case D3DX_PIXEL_FORMAT_L16_UNORM: return DXGI_FORMAT_R16G16B16A16_UNORM; + case D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM: return DXGI_FORMAT_R16G16B16A16_UNORM; + case D3DX_PIXEL_FORMAT_R16G16_UNORM: return DXGI_FORMAT_R16G16_UNORM; + case D3DX_PIXEL_FORMAT_A8_UNORM: return DXGI_FORMAT_A8_UNORM; + case D3DX_PIXEL_FORMAT_R16_FLOAT: return DXGI_FORMAT_R16_FLOAT; + case D3DX_PIXEL_FORMAT_R16G16_FLOAT: return DXGI_FORMAT_R16G16_FLOAT; + case D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT: return DXGI_FORMAT_R16G16B16A16_FLOAT; + case D3DX_PIXEL_FORMAT_R32_FLOAT: return DXGI_FORMAT_R32_FLOAT; + case D3DX_PIXEL_FORMAT_R32G32_FLOAT: return DXGI_FORMAT_R32G32_FLOAT; + case D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT: return DXGI_FORMAT_R32G32B32A32_FLOAT; + case D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM: return DXGI_FORMAT_G8R8_G8B8_UNORM; + case D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM: return DXGI_FORMAT_R8G8_B8G8_UNORM; + + case D3DX_PIXEL_FORMAT_DXT1_UNORM: return DXGI_FORMAT_BC1_UNORM; + case D3DX_PIXEL_FORMAT_DXT2_UNORM: return DXGI_FORMAT_BC2_UNORM; + case D3DX_PIXEL_FORMAT_DXT3_UNORM: return DXGI_FORMAT_BC2_UNORM; + case D3DX_PIXEL_FORMAT_DXT4_UNORM: return DXGI_FORMAT_BC3_UNORM; + case D3DX_PIXEL_FORMAT_DXT5_UNORM: return DXGI_FORMAT_BC3_UNORM; + + /* These formats are known and explicitly unsupported on d3dx10+. */ + case D3DX_PIXEL_FORMAT_U8V8W8Q8_SNORM: + case D3DX_PIXEL_FORMAT_U8V8_SNORM: + case D3DX_PIXEL_FORMAT_U16V16_SNORM: + case D3DX_PIXEL_FORMAT_U8V8_SNORM_L8X8_UNORM: + case D3DX_PIXEL_FORMAT_U10V10W10_SNORM_A2_UNORM: + case D3DX_PIXEL_FORMAT_UYVY: + case D3DX_PIXEL_FORMAT_YUY2: + return DXGI_FORMAT_UNKNOWN; + + default: + FIXME("Unknown d3dx_pixel_format_id %#x.\n", format); + return DXGI_FORMAT_UNKNOWN; + } +} + static const struct { const GUID *wic_container_guid; @@ -423,6 +493,55 @@ HRESULT WINAPI D3DX10GetImageInfoFromResourceW(HMODULE module, const WCHAR *reso return hr; } +static HRESULT d3dx10_image_info_from_d3dx_image(D3DX10_IMAGE_INFO *info, struct d3dx_image *image) +{ + DXGI_FORMAT format = dxgi_format_from_legacy_dds_d3dx_pixel_format_id(image->format); + HRESULT hr = S_OK; + + memset(info, 0, sizeof(*info)); + if (format == DXGI_FORMAT_UNKNOWN) + { + WARN("Tried to load DDS file with unsupported format %#x.\n", image->format); + return E_FAIL; + } + + info->ImageFileFormat = (D3DX10_IMAGE_FILE_FORMAT)image->image_file_format; + if (info->ImageFileFormat == D3DX10_IFF_FORCE_DWORD) + { + ERR("Unsupported d3dx image file.\n"); + return E_FAIL; + } + + info->Width = image->size.width; + info->Height = image->size.height; + info->Depth = image->size.depth; + info->ArraySize = image->layer_count; + info->MipLevels = image->mip_levels; + info->Format = format; + switch (image->resource_type) + { + case D3DX_RESOURCE_TYPE_TEXTURE_2D: + info->ResourceDimension = D3D10_RESOURCE_DIMENSION_TEXTURE2D; + break; + + case D3DX_RESOURCE_TYPE_CUBE_TEXTURE: + info->ResourceDimension = D3D10_RESOURCE_DIMENSION_TEXTURE2D; + info->MiscFlags |= D3D10_RESOURCE_MISC_TEXTURECUBE; + break; + + case D3DX_RESOURCE_TYPE_TEXTURE_3D: + info->ResourceDimension = D3D10_RESOURCE_DIMENSION_TEXTURE3D; + break; + + default: + ERR("Unhandled resource type %d.\n", image->resource_type); + hr = E_FAIL; + break; + } + + return hr; +} + HRESULT get_image_info(const void *data, SIZE_T size, D3DX10_IMAGE_INFO *img_info) { IWICBitmapFrameDecode *frame = NULL; @@ -432,9 +551,23 @@ HRESULT get_image_info(const void *data, SIZE_T size, D3DX10_IMAGE_INFO *img_inf WICDdsParameters dds_params; IWICStream *stream = NULL; unsigned int frame_count; + struct d3dx_image image; GUID container_format; HRESULT hr; + if (!data || !size) + return E_FAIL; + + if (SUCCEEDED(d3dx_image_init(data, size, &image, 0, D3DX_IMAGE_INFO_ONLY)) + && image.image_file_format == D3DX_IMAGE_FILE_FORMAT_DDS) + { + if (SUCCEEDED(d3dx10_image_info_from_d3dx_image(img_info, &image))) + { + TRACE("Successfully retrieved image info from shared code.\n"); + return S_OK; + } + } + WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory); IWICImagingFactory_CreateStream(factory, &stream); hr = IWICStream_InitializeFromMemory(stream, (BYTE *)data, size); diff --git a/dlls/d3dx9_36/d3dx_helpers.h b/dlls/d3dx9_36/d3dx_helpers.h index 4d508a6a8dac..4535a9c20a2f 100644 --- a/dlls/d3dx9_36/d3dx_helpers.h +++ b/dlls/d3dx9_36/d3dx_helpers.h @@ -36,6 +36,35 @@ #define d3dx_blob_release(blob) ID3DXBuffer_Release(blob) #endif /* D3DX_D3D_VERSION == 9 */ +#if D3DX_D3D_VERSION == 10 +#define COBJMACROS +#include "d3dx10.h" + +#define D3DERR_INVALIDCALL 0x8876086c +#define D3DX_ERROR_INVALID_DATA D3DX10_ERR_INVALID_DATA + +#define D3DX_FILTER_NONE D3DX10_FILTER_NONE +#define D3DX_FILTER_POINT D3DX10_FILTER_POINT +#define D3DX_FILTER_LINEAR D3DX10_FILTER_LINEAR +#define D3DX_FILTER_TRIANGLE D3DX10_FILTER_TRIANGLE +#define D3DX_FILTER_BOX D3DX10_FILTER_BOX +#define D3DX_FILTER_MIRROR_U D3DX10_FILTER_MIRROR_U +#define D3DX_FILTER_MIRROR_V D3DX10_FILTER_MIRROR_V +#define D3DX_FILTER_MIRROR_W D3DX10_FILTER_MIRROR_W +#define D3DX_FILTER_MIRROR D3DX10_FILTER_MIRROR +#define D3DX_FILTER_DITHER D3DX10_FILTER_DITHER +#define D3DX_FILTER_DITHER_DIFFUSION D3DX10_FILTER_DITHER_DIFFUSION +#define D3DX_FILTER_SRGB_IN D3DX10_FILTER_SRGB_IN +#define D3DX_FILTER_SRGB_OUT D3DX10_FILTER_SRGB_OUT +#define D3DX_FILTER_SRGB D3DX10_FILTER_SRGB + +#define ID3DXBlob ID3D10Blob +#define d3dx_create_blob(size, blob) D3D10CreateBlob(size, blob) +#define d3dx_blob_get_buffer_pointer(blob) ID3D10Blob_GetBufferPointer(blob) +#define d3dx_blob_release(blob) ID3D10Blob_Release(blob) + +#endif /* D3DX_D3D_VERSION == 10 */ + #ifndef MAKEFOURCC #define MAKEFOURCC(ch0, ch1, ch2, ch3) \ ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ From 932b960191f24c30361629c593c99c2ae8eaaee5 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 18 Jul 2024 11:30:41 -0400 Subject: [PATCH 0927/2542] d3dx10/tests: Add more DDS file DXGI format mapping tests. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 168 ++++++++++++++++++++++++++++++++++ 1 file changed, 168 insertions(+) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index f7f2e2e32f8f..6ecdad89adc9 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -21,6 +21,7 @@ #include "d3d10_1.h" #include "d3dx10.h" #include "wine/test.h" +#include #define D3DERR_INVALIDCALL 0x8876086c @@ -47,6 +48,7 @@ #define DDS_PF_ALPHA 0x00000001 #define DDS_PF_ALPHA_ONLY 0x00000002 #define DDS_PF_FOURCC 0x00000004 +#define DDS_PF_INDEXED 0x00000020 #define DDS_PF_RGB 0x00000040 #define DDS_PF_LUMINANCE 0x00020000 #define DDS_PF_BUMPLUMINANCE 0x00040000 @@ -82,6 +84,15 @@ struct dds_header DWORD reserved2; }; +struct dds_header_dxt10 +{ + uint32_t dxgi_format; + uint32_t resource_dimension; + uint32_t misc_flag; + uint32_t array_size; + uint32_t misc_flags2; +}; + static void fill_dds_header(struct dds_header *header) { memset(header, 0, sizeof(*header)); @@ -102,6 +113,35 @@ static void fill_dds_header(struct dds_header *header) header->caps = DDS_CAPS_TEXTURE; } +static void set_dxt10_dds_header(struct dds_header *header, uint32_t append_flags, uint32_t width, uint32_t height, + uint32_t depth, uint32_t mip_levels, uint32_t pitch, uint32_t caps, uint32_t caps2) +{ + memset(header, 0, sizeof(*header)); + + header->size = sizeof(*header); + header->flags = DDS_CAPS | DDS_PIXELFORMAT | append_flags; + header->height = height; + header->width = width; + header->depth = depth; + header->miplevels = mip_levels; + header->pitch_or_linear_size = pitch; + header->pixel_format.size = sizeof(header->pixel_format); + header->pixel_format.flags = DDS_PF_FOURCC; + header->pixel_format.fourcc = MAKEFOURCC('D','X','1','0'); + header->caps = caps; + header->caps2 = caps2; +} + +static void set_dds_header_dxt10(struct dds_header_dxt10 *dxt10, DXGI_FORMAT format, uint32_t resource_dimension, + uint32_t misc_flag, uint32_t array_size, uint32_t misc_flags2) +{ + dxt10->dxgi_format = format; + dxt10->resource_dimension = resource_dimension; + dxt10->misc_flag = misc_flag; + dxt10->array_size = array_size; + dxt10->misc_flags2 = misc_flags2; +} + /* 1x1 1bpp bmp image */ static const BYTE test_bmp_1bpp[] = { @@ -2771,6 +2811,7 @@ static void check_dds_pixel_format_(unsigned int line, DWORD flags, DWORD fourcc { DWORD magic; struct dds_header header; + PALETTEENTRY palette[256]; BYTE data[256]; } dds; @@ -2794,6 +2835,87 @@ static void check_dds_pixel_format_(unsigned int line, DWORD flags, DWORD fourcc } } +#define check_dds_pixel_format_unsupported(flags, fourcc, bpp, rmask, gmask, bmask, amask, expected_hr) \ + check_dds_pixel_format_unsupported_(__LINE__, flags, fourcc, bpp, rmask, gmask, bmask, amask, expected_hr) +static void check_dds_pixel_format_unsupported_(unsigned int line, DWORD flags, DWORD fourcc, DWORD bpp, + DWORD rmask, DWORD gmask, DWORD bmask, DWORD amask, HRESULT expected_hr) +{ + D3DX10_IMAGE_INFO info; + HRESULT hr; + struct + { + DWORD magic; + struct dds_header header; + PALETTEENTRY palette[256]; + BYTE data[256]; + } dds; + + dds.magic = MAKEFOURCC('D','D','S',' '); + fill_dds_header(&dds.header); + dds.header.pixel_format.flags = flags; + dds.header.pixel_format.fourcc = fourcc; + dds.header.pixel_format.bpp = bpp; + dds.header.pixel_format.rmask = rmask; + dds.header.pixel_format.gmask = gmask; + dds.header.pixel_format.bmask = bmask; + dds.header.pixel_format.amask = amask; + memset(dds.data, 0, sizeof(dds.data)); + + hr = D3DX10GetImageInfoFromMemory(&dds, sizeof(dds), NULL, &info, NULL); + ok_(__FILE__, line)(hr == expected_hr, "Got unexpected hr %#lx, expected %#lx.\n", hr, expected_hr); +} + +#define check_dds_dxt10_format(format, expected_format, wine_todo) \ + check_dds_dxt10_format_(__LINE__, format, expected_format, wine_todo) +static void check_dds_dxt10_format_(uint32_t line, DXGI_FORMAT format, DXGI_FORMAT expected_format, BOOL wine_todo) +{ + const uint32_t stride = (4 * get_bpp_from_format(format) + 7) / 8; + D3DX10_IMAGE_INFO info; + HRESULT hr; + struct + { + DWORD magic; + struct dds_header header; + struct dds_header_dxt10 dxt10; + BYTE data[256]; + } dds; + + dds.magic = MAKEFOURCC('D','D','S',' '); + set_dxt10_dds_header(&dds.header, 0, 4, 4, 1, 1, stride, 0, 0); + set_dds_header_dxt10(&dds.dxt10, format, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0); + + hr = D3DX10GetImageInfoFromMemory(&dds, sizeof(dds), NULL, &info, NULL); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx for DXGI format %#x.\n", hr, format); + if (SUCCEEDED(hr)) + { + todo_wine_if(wine_todo) ok_(__FILE__, line)(info.Format == expected_format, "Unexpected format %#x, expected %#x.\n", + info.Format, expected_format); + } +} + +#define check_dds_dxt10_format_unsupported(format, expected_hr) \ + check_dds_dxt10_format_unsupported_(__LINE__, format, expected_hr) +static void check_dds_dxt10_format_unsupported_(uint32_t line, DXGI_FORMAT format, HRESULT expected_hr) +{ + const uint32_t stride = (4 * get_bpp_from_format(format) + 7) / 8; + D3DX10_IMAGE_INFO info; + HRESULT hr; + struct + { + DWORD magic; + struct dds_header header; + struct dds_header_dxt10 dxt10; + BYTE data[256]; + } dds; + + dds.magic = MAKEFOURCC('D','D','S',' '); + set_dxt10_dds_header(&dds.header, 0, 4, 4, 1, 1, stride, 0, 0); + set_dds_header_dxt10(&dds.dxt10, format, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0); + + hr = D3DX10GetImageInfoFromMemory(&dds, sizeof(dds), NULL, &info, NULL); + ok_(__FILE__, line)(hr == expected_hr, "Got unexpected hr %#lx for DXGI format %#x.\n", hr, format); +} + static void test_get_image_info(void) { static const WCHAR test_resource_name[] = L"resource.data"; @@ -2936,6 +3058,52 @@ static void test_get_image_info(void) check_dds_pixel_format(DDS_PF_LUMINANCE, 0, 16, 0xffff, 0, 0, 0, DXGI_FORMAT_R16G16B16A16_UNORM); check_dds_pixel_format(DDS_PF_LUMINANCE | DDS_PF_ALPHA, 0, 16, 0x00ff, 0, 0, 0xff00, DXGI_FORMAT_R8G8B8A8_UNORM); check_dds_pixel_format(DDS_PF_LUMINANCE | DDS_PF_ALPHA, 0, 8, 0x0f, 0, 0, 0xf0, DXGI_FORMAT_R8G8B8A8_UNORM); + check_dds_pixel_format(DDS_PF_INDEXED, 0, 8, 0, 0, 0, 0, DXGI_FORMAT_R8G8B8A8_UNORM); + check_dds_pixel_format(DDS_PF_INDEXED | DDS_PF_ALPHA, 0, 16, 0, 0, 0, 0xff00, DXGI_FORMAT_R8G8B8A8_UNORM); + check_dds_pixel_format(DDS_PF_FOURCC, 0x24, 0, 0, 0, 0, 0, DXGI_FORMAT_R16G16B16A16_UNORM); /* D3DFMT_A16B16G16R16 */ + check_dds_pixel_format(DDS_PF_FOURCC, 0x6e, 0, 0, 0, 0, 0, DXGI_FORMAT_R16G16B16A16_SNORM); /* D3DFMT_Q16W16V16U16 */ + check_dds_pixel_format(DDS_PF_FOURCC, 0x6f, 0, 0, 0, 0, 0, DXGI_FORMAT_R16_FLOAT); /* D3DFMT_R16F */ + check_dds_pixel_format(DDS_PF_FOURCC, 0x70, 0, 0, 0, 0, 0, DXGI_FORMAT_R16G16_FLOAT); /* D3DFMT_G16R16F */ + check_dds_pixel_format(DDS_PF_FOURCC, 0x71, 0, 0, 0, 0, 0, DXGI_FORMAT_R16G16B16A16_FLOAT); /* D3DFMT_A16B16G16R16F */ + check_dds_pixel_format(DDS_PF_FOURCC, 0x72, 0, 0, 0, 0, 0, DXGI_FORMAT_R32_FLOAT); /* D3DFMT_R32F */ + check_dds_pixel_format(DDS_PF_FOURCC, 0x73, 0, 0, 0, 0, 0, DXGI_FORMAT_R32G32_FLOAT); /* D3DFMT_G32R32F */ + check_dds_pixel_format(DDS_PF_FOURCC, 0x74, 0, 0, 0, 0, 0, DXGI_FORMAT_R32G32B32A32_FLOAT); /* D3DFMT_A32B32G32R32F */ + + /* Test for DDS pixel formats that are valid on d3dx9, but not d3dx10. */ + todo_wine check_dds_pixel_format_unsupported(DDS_PF_FOURCC, MAKEFOURCC('U','Y','V','Y'), 0, 0, 0, 0, 0, E_FAIL); + todo_wine check_dds_pixel_format_unsupported(DDS_PF_FOURCC, MAKEFOURCC('Y','U','Y','2'), 0, 0, 0, 0, 0, E_FAIL); + /* Bumpmap formats aren't supported. */ + todo_wine check_dds_pixel_format_unsupported(DDS_PF_BUMPDUDV, 0, 16, 0x00ff, 0xff00, 0, 0, E_FAIL); + todo_wine check_dds_pixel_format_unsupported(DDS_PF_BUMPDUDV, 0, 32, 0x0000ffff, 0xffff0000, 0, 0, E_FAIL); + todo_wine check_dds_pixel_format_unsupported(DDS_PF_BUMPDUDV, 0, 32, 0xff, 0xff00, 0x00ff0000, 0xff000000, E_FAIL); + todo_wine check_dds_pixel_format_unsupported(DDS_PF_BUMPLUMINANCE, 0, 32, 0x0000ff, 0x00ff00, 0xff0000, 0, E_FAIL); + + /* Newer fourCC formats. */ + check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('B','C','4','U'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC4_UNORM); + check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('B','C','5','U'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC5_UNORM); + check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('B','C','4','S'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC4_SNORM); + check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('B','C','5','S'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC5_SNORM); + /* ATI1 is unsupported, but ATI2 is supported. */ + todo_wine check_dds_pixel_format_unsupported(DDS_PF_FOURCC, MAKEFOURCC('A','T','I','1'), 0, 0, 0, 0, 0, E_FAIL); + check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('A','T','I','2'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC5_UNORM); + + todo_wine check_dds_dxt10_format_unsupported(DXGI_FORMAT_B5G6R5_UNORM, E_FAIL); + todo_wine check_dds_dxt10_format_unsupported(DXGI_FORMAT_B5G5R5A1_UNORM, E_FAIL); + /* Formats that are newer than d3d10. */ + todo_wine check_dds_dxt10_format_unsupported(DXGI_FORMAT_BC6H_UF16, E_FAIL); + todo_wine check_dds_dxt10_format_unsupported(DXGI_FORMAT_BC6H_SF16, E_FAIL); + todo_wine check_dds_dxt10_format_unsupported(DXGI_FORMAT_BC7_UNORM, E_FAIL); + todo_wine check_dds_dxt10_format_unsupported(DXGI_FORMAT_B4G4R4A4_UNORM, E_FAIL); + + /* + * These formats should map 1:1 from the DXT10 header, unlike legacy DDS + * file equivalents. + */ + check_dds_dxt10_format(DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM, TRUE); + check_dds_dxt10_format(DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM, TRUE); + check_dds_dxt10_format(DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R8G8_UNORM, TRUE); + check_dds_dxt10_format(DXGI_FORMAT_B8G8R8X8_UNORM, DXGI_FORMAT_B8G8R8X8_UNORM, TRUE); + check_dds_dxt10_format(DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM, TRUE); /* D3DX10GetImageInfoFromResource tests */ From 3aecd346b4af247c9791a08be09c99592a45550e Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 6 Nov 2024 11:23:34 -0500 Subject: [PATCH 0928/2542] d3dx10/tests: Add more DDS file header handling tests. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 313 ++++++++++++++++++++++++++++++++++ 1 file changed, 313 insertions(+) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 6ecdad89adc9..75180d8b5366 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -39,11 +39,26 @@ #define DDS_PIXELFORMAT 0x00001000 #define DDS_MIPMAPCOUNT 0x00020000 #define DDS_LINEARSIZE 0x00080000 +#define DDS_DEPTH 0x00800000 /* dds_header.caps */ #define DDSCAPS_ALPHA 0x00000002 +#define DDS_CAPS_COMPLEX 0x00000008 #define DDS_CAPS_TEXTURE 0x00001000 +/* dds_header.caps2 */ +#define DDS_CAPS2_VOLUME 0x00200000 +#define DDS_CAPS2_CUBEMAP 0x00000200 +#define DDS_CAPS2_CUBEMAP_POSITIVEX 0x00000400 +#define DDS_CAPS2_CUBEMAP_NEGATIVEX 0x00000800 +#define DDS_CAPS2_CUBEMAP_POSITIVEY 0x00001000 +#define DDS_CAPS2_CUBEMAP_NEGATIVEY 0x00002000 +#define DDS_CAPS2_CUBEMAP_POSITIVEZ 0x00004000 +#define DDS_CAPS2_CUBEMAP_NEGATIVEZ 0x00008000 +#define DDS_CAPS2_CUBEMAP_ALL_FACES ( DDS_CAPS2_CUBEMAP_POSITIVEX | DDS_CAPS2_CUBEMAP_NEGATIVEX \ + | DDS_CAPS2_CUBEMAP_POSITIVEY | DDS_CAPS2_CUBEMAP_NEGATIVEY \ + | DDS_CAPS2_CUBEMAP_POSITIVEZ | DDS_CAPS2_CUBEMAP_NEGATIVEZ ) + /* dds_pixel_format.flags */ #define DDS_PF_ALPHA 0x00000001 #define DDS_PF_ALPHA_ONLY 0x00000002 @@ -84,6 +99,7 @@ struct dds_header DWORD reserved2; }; +#define DDS_RESOURCE_MISC_TEXTURECUBE 0x04 struct dds_header_dxt10 { uint32_t dxgi_format; @@ -1316,6 +1332,47 @@ static void check_image_info(D3DX10_IMAGE_INFO *image_info, const struct test_im image_info->ImageFileFormat, image->expected_info.ImageFileFormat); } +#define check_image_info_values(info, width, height, depth, array_size, mip_levels, misc_flags, format, resource_dimension, \ + image_file_format, wine_todo) \ + check_image_info_values_(__LINE__, info, width, height, depth, array_size, mip_levels, misc_flags, format, resource_dimension, \ + image_file_format, wine_todo) +static inline void check_image_info_values_(uint32_t line, const D3DX10_IMAGE_INFO *info, uint32_t width, + uint32_t height, uint32_t depth, uint32_t array_size, uint32_t mip_levels, uint32_t misc_flags, + DXGI_FORMAT format, D3D10_RESOURCE_DIMENSION resource_dimension, D3DX10_IMAGE_FILE_FORMAT image_file_format, + BOOL wine_todo) +{ + const D3DX10_IMAGE_INFO expected_info = { width, height, depth, array_size, mip_levels, misc_flags, format, + resource_dimension, image_file_format }; + BOOL matched; + + matched = !memcmp(&expected_info, info, sizeof(*info)); + todo_wine_if(wine_todo) ok_(__FILE__, line)(matched, "Got unexpected image info values.\n"); + if (matched) + return; + + todo_wine_if(wine_todo && info->Width != width) + ok_(__FILE__, line)(info->Width == width, "Expected width %u, got %u.\n", width, info->Width); + todo_wine_if(wine_todo && info->Height != height) + ok_(__FILE__, line)(info->Height == height, "Expected height %u, got %u.\n", height, info->Height); + todo_wine_if(wine_todo && info->Depth != depth) + ok_(__FILE__, line)(info->Depth == depth, "Expected depth %u, got %u.\n", depth, info->Depth); + todo_wine_if(wine_todo && info->ArraySize != array_size) + ok_(__FILE__, line)(info->ArraySize == array_size, "Expected array_size %u, got %u.\n", array_size, + info->ArraySize); + todo_wine_if(wine_todo && info->MipLevels != mip_levels) + ok_(__FILE__, line)(info->MipLevels == mip_levels, "Expected mip_levels %u, got %u.\n", mip_levels, + info->MipLevels); + todo_wine_if(wine_todo && info->MiscFlags != misc_flags) + ok_(__FILE__, line)(info->MiscFlags == misc_flags, "Expected misc_flags %u, got %u.\n", misc_flags, + info->MiscFlags); + ok_(__FILE__, line)(info->Format == format, "Expected texture format %d, got %d.\n", format, info->Format); + todo_wine_if(wine_todo && info->ResourceDimension != resource_dimension) + ok_(__FILE__, line)(info->ResourceDimension == resource_dimension, "Expected resource_dimension %d, got %d.\n", + resource_dimension, info->ResourceDimension); + ok_(__FILE__, line)(info->ImageFileFormat == image_file_format, "Expected image_file_format %d, got %d.\n", + image_file_format, info->ImageFileFormat); +} + static ID3D10Texture2D *get_texture2d_readback(ID3D10Texture2D *texture) { D3D10_TEXTURE2D_DESC desc; @@ -2916,6 +2973,259 @@ static void check_dds_dxt10_format_unsupported_(uint32_t line, DXGI_FORMAT forma ok_(__FILE__, line)(hr == expected_hr, "Got unexpected hr %#lx for DXGI format %#x.\n", hr, format); } +static void test_legacy_dds_header_image_info(void) +{ + struct expected + { + HRESULT hr; + uint32_t width; + uint32_t height; + uint32_t depth; + uint32_t array_size; + uint32_t mip_levels; + uint32_t misc_flags; + DXGI_FORMAT format; + D3D10_RESOURCE_DIMENSION resource_dimension; + }; + static const struct + { + uint32_t flags; + uint32_t width; + uint32_t height; + uint32_t depth; + uint32_t row_pitch; + uint32_t mip_levels; + uint32_t caps; + uint32_t caps2; + struct expected expected; + uint32_t pixel_data_size; + BOOL todo_hr; + } tests[] = + { + /* + * Only DDS header size is validated on d3dx10, unlike d3dx9 where image pixel size + * is as well. + */ + { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT), 4, 4, 1, (4 * 4), 3, 0, 0, + { S_OK, 4, 4, 1, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, }, 0, .todo_hr = TRUE }, + /* Depth value set to 4, but no caps bits are set. Depth is ignored. */ + { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT), 4, 4, 4, (4 * 4), 3, 0, 0, + { S_OK, 4, 4, 1, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, }, 292 }, + /* The volume texture caps2 field is ignored. */ + { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT), 4, 4, 4, (4 * 4), 3, + (DDS_CAPS_TEXTURE | DDS_CAPS_COMPLEX), DDS_CAPS2_VOLUME, + { S_OK, 4, 4, 1, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, }, 292 }, + /* + * The DDS_DEPTH flag is the only thing checked to determine if a DDS + * file represents a 3D texture. + */ + { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT | DDS_DEPTH), 4, 4, 4, (4 * 4), 3, + 0, 0, + { S_OK, 4, 4, 4, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, }, 292 }, + /* Even if the depth field is set to 0, it's still a 3D texture. */ + { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT | DDS_DEPTH), 4, 4, 0, (4 * 4), 3, + 0, 0, + { S_OK, 4, 4, 1, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, }, 292 }, + /* The DDS_DEPTH flag overrides cubemap caps. */ + { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT | DDS_DEPTH), 4, 4, 4, (4 * 4), 3, + (DDS_CAPS_TEXTURE | DDS_CAPS_COMPLEX), (DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES), + { S_OK, 4, 4, 4, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, }, 292 }, + /* Cubemap where width field does not equal height. */ + { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT), 4, 5, 1, (4 * 4), 1, + (DDS_CAPS_TEXTURE | DDS_CAPS_COMPLEX), (DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES), + { S_OK, 4, 5, 1, 6, 1, D3D10_RESOURCE_MISC_TEXTURECUBE, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, }, (80 * 6) }, + /* Partial cubemaps are not supported. */ + { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT), 4, 4, 1, (4 * 4), 1, + (DDS_CAPS_TEXTURE | DDS_CAPS_COMPLEX), (DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_POSITIVEX), + { E_FAIL, }, (64 * 6), .todo_hr = TRUE }, + }; + D3DX10_IMAGE_INFO info; + unsigned int i; + struct + { + DWORD magic; + struct dds_header header; + } dds; + HRESULT hr; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + const uint32_t file_size = sizeof(dds) + tests[i].pixel_data_size; + + winetest_push_context("Test %u", i); + + dds.magic = MAKEFOURCC('D','D','S',' '); + fill_dds_header(&dds.header); + dds.header.flags = tests[i].flags; + dds.header.width = tests[i].width; + dds.header.height = tests[i].height; + dds.header.depth = tests[i].depth; + dds.header.pitch_or_linear_size = tests[i].row_pitch; + dds.header.miplevels = tests[i].mip_levels; + dds.header.caps = tests[i].caps; + dds.header.caps2 = tests[i].caps2; + + memset(&info, 0, sizeof(info)); + hr = D3DX10GetImageInfoFromMemory(&dds, file_size, NULL, &info, NULL); + todo_wine_if(tests[i].todo_hr) ok(hr == tests[i].expected.hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr) && SUCCEEDED(tests[i].expected.hr)) + check_image_info_values(&info, tests[i].expected.width, tests[i].expected.height, + tests[i].expected.depth, tests[i].expected.array_size, tests[i].expected.mip_levels, + tests[i].expected.misc_flags, tests[i].expected.format, + tests[i].expected.resource_dimension, D3DX10_IFF_DDS, FALSE); + + winetest_pop_context(); + } + + /* + * Image size (e.g, the size of the pixels) isn't validated, but header + * size is. + */ + dds.magic = MAKEFOURCC('D','D','S',' '); + fill_dds_header(&dds.header); + + hr = D3DX10GetImageInfoFromMemory(&dds, sizeof(dds) - 1, NULL, &info, NULL); + ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); + + hr = D3DX10GetImageInfoFromMemory(&dds, sizeof(dds), NULL, &info, NULL); + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); +} + +static void test_dxt10_dds_header_image_info(void) +{ + struct expected + { + HRESULT hr; + uint32_t width; + uint32_t height; + uint32_t depth; + uint32_t array_size; + uint32_t mip_levels; + uint32_t misc_flags; + DXGI_FORMAT format; + D3D10_RESOURCE_DIMENSION resource_dimension; + }; + static const struct + { + uint32_t append_flags; + uint32_t width; + uint32_t height; + uint32_t depth; + uint32_t row_pitch; + uint32_t mip_levels; + uint32_t caps; + uint32_t caps2; + struct dds_header_dxt10 dxt10; + struct expected expected; + uint32_t pixel_data_size; + BOOL todo_hr; + BOOL todo_info; + } dxt10_tests[] = + { + /* File size validation isn't done on d3dx10. */ + { 0, 4, 4, 0, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0, }, + { S_OK, 4, 4, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, }, 0, .todo_hr = TRUE }, + /* + * Setting the misc_flags2 field to anything other than 0 results in + * E_FAIL. + */ + { 0, 4, 4, 0, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 1, }, + { E_FAIL }, (4 * 4 * 4), .todo_hr = TRUE }, + /* + * The misc_flags field isn't passed through directly, only the + * cube texture flag is (if it's set). + */ + { 0, 4, 4, 0, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0xfffffffb, 1, 0, }, + { S_OK, 4, 4, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, }, (4 * 4 * 4) }, + /* Resource dimension field of the header isn't validated. */ + { 0, 4, 4, 0, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, 500, 0, 1, 0, }, + { S_OK, 4, 4, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, 500, }, (4 * 4 * 4), .todo_info = TRUE }, + /* Depth value of 2, but D3D10_RESOURCE_DIMENSION_TEXTURE2D. */ + { DDS_DEPTH, 4, 4, 2, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0, }, + { S_OK, 4, 4, 2, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, }, (4 * 4 * 4 * 2) }, + /* Depth field value is ignored if DDS_DEPTH isn't set. */ + { 0, 4, 4, 2, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0, }, + { S_OK, 4, 4, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, }, (4 * 4 * 4 * 2), .todo_info = TRUE }, + /* + * 3D texture with an array size larger than 1. Technically there's no + * such thing as a 3D texture array, but it succeeds. + */ + { DDS_DEPTH, 4, 4, 2, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 2, 0, }, + { S_OK, 4, 4, 2, 2, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, }, (4 * 4 * 4 * 2 * 2) }, + /* Cubemap caps are ignored for DXT10 files. */ + { 0, 4, 4, 1, (4 * 4), 1, 0, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0, }, + { S_OK, 4, 4, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D }, (4 * 4 * 4 * 6) }, + /* Array size value is multiplied by 6 for cubemap files. */ + { 0, 4, 4, 1, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 2, 0, }, + { S_OK, 4, 4, 1, 12, 1, D3D10_RESOURCE_MISC_TEXTURECUBE, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D }, (4 * 4 * 4 * 12) }, + /* Resource dimension is validated for cube textures. */ + { 0, 4, 4, 1, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, DDS_RESOURCE_MISC_TEXTURECUBE, 2, 0, }, + { E_FAIL }, (4 * 4 * 4 * 12), .todo_hr = TRUE }, + /* 1D Texture cube, invalid. */ + { 0, 4, 4, 1, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, DDS_RESOURCE_MISC_TEXTURECUBE, 2, 0, }, + { E_FAIL }, (4 * 4 * 4 * 12), .todo_hr = TRUE }, + }; + D3DX10_IMAGE_INFO info; + unsigned int i; + struct + { + DWORD magic; + struct dds_header header; + struct dds_header_dxt10 dxt10; + } dds; + HRESULT hr; + + for (i = 0; i < ARRAY_SIZE(dxt10_tests); ++i) + { + const uint32_t file_size = sizeof(dds) + dxt10_tests[i].pixel_data_size; + + winetest_push_context("Test %u", i); + + dds.magic = MAKEFOURCC('D','D','S',' '); + set_dxt10_dds_header(&dds.header, dxt10_tests[i].append_flags, dxt10_tests[i].width, dxt10_tests[i].height, + dxt10_tests[i].depth, dxt10_tests[i].mip_levels, dxt10_tests[i].row_pitch, dxt10_tests[i].caps, + dxt10_tests[i].caps2); + dds.dxt10 = dxt10_tests[i].dxt10; + + memset(&info, 0, sizeof(info)); + hr = D3DX10GetImageInfoFromMemory(&dds, file_size, NULL, &info, NULL); + todo_wine_if(dxt10_tests[i].todo_hr) ok(hr == dxt10_tests[i].expected.hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr) && SUCCEEDED(dxt10_tests[i].expected.hr)) + check_image_info_values(&info, dxt10_tests[i].expected.width, dxt10_tests[i].expected.height, + dxt10_tests[i].expected.depth, dxt10_tests[i].expected.array_size, dxt10_tests[i].expected.mip_levels, + dxt10_tests[i].expected.misc_flags, dxt10_tests[i].expected.format, + dxt10_tests[i].expected.resource_dimension, D3DX10_IFF_DDS, dxt10_tests[i].todo_info); + + winetest_pop_context(); + } + + /* + * Image size (e.g, the size of the pixels) isn't validated, but header + * size is. + */ + dds.magic = MAKEFOURCC('D','D','S',' '); + set_dxt10_dds_header(&dds.header, dxt10_tests[0].append_flags, dxt10_tests[0].width, dxt10_tests[0].height, + dxt10_tests[0].depth, dxt10_tests[0].mip_levels, dxt10_tests[0].row_pitch, dxt10_tests[0].caps, dxt10_tests[0].caps2); + dds.dxt10 = dxt10_tests[0].dxt10; + + hr = D3DX10GetImageInfoFromMemory(&dds, sizeof(dds) - 1, NULL, &info, NULL); + ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); + + hr = D3DX10GetImageInfoFromMemory(&dds, sizeof(dds), NULL, &info, NULL); + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); +} + static void test_get_image_info(void) { static const WCHAR test_resource_name[] = L"resource.data"; @@ -3105,6 +3415,9 @@ static void test_get_image_info(void) check_dds_dxt10_format(DXGI_FORMAT_B8G8R8X8_UNORM, DXGI_FORMAT_B8G8R8X8_UNORM, TRUE); check_dds_dxt10_format(DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM, TRUE); + test_legacy_dds_header_image_info(); + test_dxt10_dds_header_image_info(); + /* D3DX10GetImageInfoFromResource tests */ hr2 = 0xdeadbeef; From 96a5621accc12dee3e81bbaf683412f30884e81c Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 7 Nov 2024 11:01:07 -0500 Subject: [PATCH 0929/2542] d3dx10: Add support for parsing DXT10 DDS headers to shared code. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 6 +- dlls/d3dx10_43/texture.c | 61 +++++++++++++- dlls/d3dx9_36/d3dx_helpers.c | 144 +++++++++++++++++++++++++++++----- dlls/d3dx9_36/d3dx_helpers.h | 15 ++++ 4 files changed, 198 insertions(+), 28 deletions(-) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 75180d8b5366..138c2e2189a9 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -3151,7 +3151,7 @@ static void test_dxt10_dds_header_image_info(void) /* Depth field value is ignored if DDS_DEPTH isn't set. */ { 0, 4, 4, 2, (4 * 4), 1, 0, 0, { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0, }, - { S_OK, 4, 4, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, }, (4 * 4 * 4 * 2), .todo_info = TRUE }, + { S_OK, 4, 4, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, }, (4 * 4 * 4 * 2) }, /* * 3D texture with an array size larger than 1. Technically there's no * such thing as a 3D texture array, but it succeeds. @@ -3412,8 +3412,8 @@ static void test_get_image_info(void) check_dds_dxt10_format(DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM, TRUE); check_dds_dxt10_format(DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM, TRUE); check_dds_dxt10_format(DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R8G8_UNORM, TRUE); - check_dds_dxt10_format(DXGI_FORMAT_B8G8R8X8_UNORM, DXGI_FORMAT_B8G8R8X8_UNORM, TRUE); - check_dds_dxt10_format(DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM, TRUE); + check_dds_dxt10_format(DXGI_FORMAT_B8G8R8X8_UNORM, DXGI_FORMAT_B8G8R8X8_UNORM, FALSE); + check_dds_dxt10_format(DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM, FALSE); test_legacy_dds_header_image_info(); test_dxt10_dds_header_image_info(); diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 7d172264155b..db73df8fb26c 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -99,6 +99,48 @@ static DXGI_FORMAT dxgi_format_from_legacy_dds_d3dx_pixel_format_id(enum d3dx_pi } } +static DXGI_FORMAT dxgi_format_from_d3dx_pixel_format_id(enum d3dx_pixel_format_id format) +{ + switch (format) + { + case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM: return DXGI_FORMAT_B8G8R8A8_UNORM; + case D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM: return DXGI_FORMAT_B8G8R8X8_UNORM; + case D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM: return DXGI_FORMAT_R10G10B10A2_UNORM; + case D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM: return DXGI_FORMAT_R16G16B16A16_UNORM; + case D3DX_PIXEL_FORMAT_R16G16_UNORM: return DXGI_FORMAT_R16G16_UNORM; + case D3DX_PIXEL_FORMAT_A8_UNORM: return DXGI_FORMAT_A8_UNORM; + case D3DX_PIXEL_FORMAT_R16_FLOAT: return DXGI_FORMAT_R16_FLOAT; + case D3DX_PIXEL_FORMAT_R16G16_FLOAT: return DXGI_FORMAT_R16G16_FLOAT; + case D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT: return DXGI_FORMAT_R16G16B16A16_FLOAT; + case D3DX_PIXEL_FORMAT_R32_FLOAT: return DXGI_FORMAT_R32_FLOAT; + case D3DX_PIXEL_FORMAT_R32G32_FLOAT: return DXGI_FORMAT_R32G32_FLOAT; + case D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT: return DXGI_FORMAT_R32G32B32A32_FLOAT; + case D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM: return DXGI_FORMAT_G8R8_G8B8_UNORM; + case D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM: return DXGI_FORMAT_R8G8_B8G8_UNORM; + case D3DX_PIXEL_FORMAT_BC1_UNORM: return DXGI_FORMAT_BC1_UNORM; + case D3DX_PIXEL_FORMAT_BC2_UNORM: return DXGI_FORMAT_BC2_UNORM; + case D3DX_PIXEL_FORMAT_BC3_UNORM: return DXGI_FORMAT_BC3_UNORM; + case D3DX_PIXEL_FORMAT_R16G16B16A16_SNORM: return DXGI_FORMAT_R16G16B16A16_SNORM; + case D3DX_PIXEL_FORMAT_R8G8B8A8_SNORM: return DXGI_FORMAT_R8G8B8A8_SNORM; + case D3DX_PIXEL_FORMAT_R8G8_SNORM: return DXGI_FORMAT_R8G8_SNORM; + case D3DX_PIXEL_FORMAT_R16G16_SNORM: return DXGI_FORMAT_R16G16_SNORM; + + /* + * These have DXGI_FORMAT equivalents, but are explicitly unsupported on + * d3dx10. + */ + case D3DX_PIXEL_FORMAT_B5G6R5_UNORM: + case D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM: + case D3DX_PIXEL_FORMAT_B4G4R4A4_UNORM: + return DXGI_FORMAT_UNKNOWN; + + default: + FIXME("Unhandled d3dx_pixel_format_id %#x.\n", format); + return DXGI_FORMAT_UNKNOWN; + } +} + static const struct { const GUID *wic_container_guid; @@ -495,17 +537,27 @@ HRESULT WINAPI D3DX10GetImageInfoFromResourceW(HMODULE module, const WCHAR *reso static HRESULT d3dx10_image_info_from_d3dx_image(D3DX10_IMAGE_INFO *info, struct d3dx_image *image) { - DXGI_FORMAT format = dxgi_format_from_legacy_dds_d3dx_pixel_format_id(image->format); + DXGI_FORMAT format; HRESULT hr = S_OK; memset(info, 0, sizeof(*info)); + if (image->image_file_format == D3DX_IMAGE_FILE_FORMAT_DDS_DXT10) + { + format = dxgi_format_from_d3dx_pixel_format_id(image->format); + info->ImageFileFormat = D3DX10_IFF_DDS; + } + else + { + format = dxgi_format_from_legacy_dds_d3dx_pixel_format_id(image->format); + info->ImageFileFormat = (D3DX10_IMAGE_FILE_FORMAT)image->image_file_format; + } + if (format == DXGI_FORMAT_UNKNOWN) { WARN("Tried to load DDS file with unsupported format %#x.\n", image->format); return E_FAIL; } - info->ImageFileFormat = (D3DX10_IMAGE_FILE_FORMAT)image->image_file_format; if (info->ImageFileFormat == D3DX10_IFF_FORCE_DWORD) { ERR("Unsupported d3dx image file.\n"); @@ -558,8 +610,9 @@ HRESULT get_image_info(const void *data, SIZE_T size, D3DX10_IMAGE_INFO *img_inf if (!data || !size) return E_FAIL; - if (SUCCEEDED(d3dx_image_init(data, size, &image, 0, D3DX_IMAGE_INFO_ONLY)) - && image.image_file_format == D3DX_IMAGE_FILE_FORMAT_DDS) + if (SUCCEEDED(d3dx_image_init(data, size, &image, 0, D3DX_IMAGE_INFO_ONLY | D3DX_IMAGE_SUPPORT_DXT10)) + && (image.image_file_format == D3DX_IMAGE_FILE_FORMAT_DDS + || (image.image_file_format == D3DX_IMAGE_FILE_FORMAT_DDS_DXT10))) { if (SUCCEEDED(d3dx10_image_info_from_d3dx_image(img_info, &image))) { diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index 4624868d181a..367d3cf0b4b8 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -332,6 +332,42 @@ HRESULT dds_pixel_format_from_d3dx_pixel_format_id(struct dds_pixel_format *pixe return S_OK; } +static enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dxgi_format(DXGI_FORMAT format) +{ + switch (format) + { + case DXGI_FORMAT_R8G8B8A8_UNORM: return D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM; + case DXGI_FORMAT_B8G8R8A8_UNORM: return D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM; + case DXGI_FORMAT_B8G8R8X8_UNORM: return D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM; + case DXGI_FORMAT_B5G6R5_UNORM: return D3DX_PIXEL_FORMAT_B5G6R5_UNORM; + case DXGI_FORMAT_B5G5R5A1_UNORM: return D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM; + case DXGI_FORMAT_B4G4R4A4_UNORM: return D3DX_PIXEL_FORMAT_B4G4R4A4_UNORM; + case DXGI_FORMAT_R10G10B10A2_UNORM: return D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM; + case DXGI_FORMAT_R16G16B16A16_UNORM: return D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM; + case DXGI_FORMAT_R16G16_UNORM: return D3DX_PIXEL_FORMAT_R16G16_UNORM; + case DXGI_FORMAT_A8_UNORM: return D3DX_PIXEL_FORMAT_A8_UNORM; + case DXGI_FORMAT_R16_FLOAT: return D3DX_PIXEL_FORMAT_R16_FLOAT; + case DXGI_FORMAT_R16G16_FLOAT: return D3DX_PIXEL_FORMAT_R16G16_FLOAT; + case DXGI_FORMAT_R16G16B16A16_FLOAT: return D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT; + case DXGI_FORMAT_R32_FLOAT: return D3DX_PIXEL_FORMAT_R32_FLOAT; + case DXGI_FORMAT_R32G32_FLOAT: return D3DX_PIXEL_FORMAT_R32G32_FLOAT; + case DXGI_FORMAT_R32G32B32A32_FLOAT: return D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT; + case DXGI_FORMAT_G8R8_G8B8_UNORM: return D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM; + case DXGI_FORMAT_R8G8_B8G8_UNORM: return D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM; + case DXGI_FORMAT_BC1_UNORM: return D3DX_PIXEL_FORMAT_BC1_UNORM; + case DXGI_FORMAT_BC2_UNORM: return D3DX_PIXEL_FORMAT_BC2_UNORM; + case DXGI_FORMAT_BC3_UNORM: return D3DX_PIXEL_FORMAT_BC3_UNORM; + case DXGI_FORMAT_R8G8B8A8_SNORM: return D3DX_PIXEL_FORMAT_R8G8B8A8_SNORM; + case DXGI_FORMAT_R8G8_SNORM: return D3DX_PIXEL_FORMAT_R8G8_SNORM; + case DXGI_FORMAT_R16G16_SNORM: return D3DX_PIXEL_FORMAT_R16G16_SNORM; + case DXGI_FORMAT_R16G16B16A16_SNORM: return D3DX_PIXEL_FORMAT_R16G16B16A16_SNORM; + + default: + FIXME("Unhandled DXGI format %#x.\n", format); + return D3DX_PIXEL_FORMAT_COUNT; + } +} + static void d3dx_get_next_mip_level_size(struct volume *size) { size->width = max(size->width / 2, 1); @@ -771,8 +807,44 @@ static BOOL d3dx_get_image_file_format_from_file_signature(const void *src_data, return FALSE; } +/* These defines match D3D10/D3D11 values. */ +#define DDS_RESOURCE_MISC_TEXTURECUBE 0x04 +#define DDS_RESOURCE_DIMENSION_TEXTURE1D 2 +#define DDS_RESOURCE_DIMENSION_TEXTURE2D 3 +#define DDS_RESOURCE_DIMENSION_TEXTURE3D 4 +struct dds_header_dxt10 +{ + uint32_t dxgi_format; + uint32_t resource_dimension; + uint32_t misc_flags; + uint32_t array_size; + uint32_t misc_flags2; +}; + +static enum d3dx_resource_type dxt10_resource_dimension_to_d3dx_resource_type(uint32_t resource_dimension) +{ + switch (resource_dimension) + { + case DDS_RESOURCE_DIMENSION_TEXTURE1D: return D3DX_RESOURCE_TYPE_TEXTURE_1D; + case DDS_RESOURCE_DIMENSION_TEXTURE2D: return D3DX_RESOURCE_TYPE_TEXTURE_2D; + case DDS_RESOURCE_DIMENSION_TEXTURE3D: return D3DX_RESOURCE_TYPE_TEXTURE_3D; + + default: + break; + } + + FIXME("Unhandled DXT10 resource dimension value %u.\n", resource_dimension); + return D3DX_RESOURCE_TYPE_UNKNOWN; +} + +static BOOL has_extended_header(const struct dds_header *header) +{ + return (header->pixel_format.flags & DDS_PF_FOURCC) && + (header->pixel_format.fourcc == MAKEFOURCC('D', 'X', '1', '0')); +} + static HRESULT d3dx_initialize_image_from_dds(const void *src_data, uint32_t src_data_size, - struct d3dx_image *image, uint32_t starting_mip_level) + struct d3dx_image *image, uint32_t starting_mip_level, uint32_t flags) { uint32_t expected_src_data_size, header_size; const struct dds_header *header = src_data; @@ -782,40 +854,71 @@ static HRESULT d3dx_initialize_image_from_dds(const void *src_data, uint32_t src if (src_data_size < sizeof(*header) || header->pixel_format.size != sizeof(header->pixel_format)) return D3DX_ERROR_INVALID_DATA; - TRACE("File type is DDS.\n"); is_indexed_fmt = !!(header->pixel_format.flags & DDS_PF_INDEXED); header_size = is_indexed_fmt ? sizeof(*header) + DDS_PALETTE_SIZE : sizeof(*header); set_volume_struct(&image->size, header->width, header->height, 1); image->mip_levels = header->miplevels ? header->miplevels : 1; - image->format = d3dx_pixel_format_id_from_dds_pixel_format(&header->pixel_format); - image->layer_count = 1; + if (has_extended_header(header) && (flags & D3DX_IMAGE_SUPPORT_DXT10)) + { + const struct dds_header_dxt10 *dxt10 = (const struct dds_header_dxt10 *)((uint8_t *)src_data + header_size); - if (image->format == D3DX_PIXEL_FORMAT_COUNT) - return D3DX_ERROR_INVALID_DATA; + header_size += sizeof(*dxt10); + if (src_data_size < header_size) + return D3DX_ERROR_INVALID_DATA; - TRACE("Pixel format is %#x.\n", image->format); - if (header->flags & DDS_DEPTH) - { - image->size.depth = max(header->depth, 1); - image->resource_type = D3DX_RESOURCE_TYPE_TEXTURE_3D; - } - else if (header->caps2 & DDS_CAPS2_CUBEMAP) - { - if ((header->caps2 & DDS_CAPS2_CUBEMAP_ALL_FACES) != DDS_CAPS2_CUBEMAP_ALL_FACES) + TRACE("File type is DXT10 DDS.\n"); + if ((image->format = d3dx_pixel_format_id_from_dxgi_format(dxt10->dxgi_format)) == D3DX_PIXEL_FORMAT_COUNT) + return D3DX_ERROR_INVALID_DATA; + + if (dxt10->misc_flags2) { - WARN("Tried to load a partial cubemap DDS file.\n"); + ERR("Invalid misc_flags2 field %#x.\n", dxt10->misc_flags2); return D3DX_ERROR_INVALID_DATA; } - image->layer_count = 6; - image->resource_type = D3DX_RESOURCE_TYPE_CUBE_TEXTURE; + image->image_file_format = D3DX_IMAGE_FILE_FORMAT_DDS_DXT10; + image->size.depth = (header->flags & DDS_DEPTH) ? max(header->depth, 1) : 1; + image->layer_count = max(1, dxt10->array_size); + image->resource_type = dxt10_resource_dimension_to_d3dx_resource_type(dxt10->resource_dimension); + if (dxt10->misc_flags & DDS_RESOURCE_MISC_TEXTURECUBE) + { + if (image->resource_type != D3DX_RESOURCE_TYPE_TEXTURE_2D) + return D3DX_ERROR_INVALID_DATA; + image->resource_type = D3DX_RESOURCE_TYPE_CUBE_TEXTURE; + image->layer_count *= 6; + } } else { - image->resource_type = D3DX_RESOURCE_TYPE_TEXTURE_2D; + TRACE("File type is DDS.\n"); + + if ((image->format = d3dx_pixel_format_id_from_dds_pixel_format(&header->pixel_format)) == D3DX_PIXEL_FORMAT_COUNT) + return D3DX_ERROR_INVALID_DATA; + + image->image_file_format = D3DX_IMAGE_FILE_FORMAT_DDS; + image->layer_count = 1; + if (header->flags & DDS_DEPTH) + { + image->size.depth = max(header->depth, 1); + image->resource_type = D3DX_RESOURCE_TYPE_TEXTURE_3D; + } + else if (header->caps2 & DDS_CAPS2_CUBEMAP) + { + if ((header->caps2 & DDS_CAPS2_CUBEMAP_ALL_FACES) != DDS_CAPS2_CUBEMAP_ALL_FACES) + { + WARN("Tried to load a partial cubemap DDS file.\n"); + return D3DX_ERROR_INVALID_DATA; + } + + image->layer_count = 6; + image->resource_type = D3DX_RESOURCE_TYPE_CUBE_TEXTURE; + } + else + image->resource_type = D3DX_RESOURCE_TYPE_TEXTURE_2D; } + TRACE("Pixel format is %#x.\n", image->format); image->layer_pitch = d3dx_calculate_layer_pixels_size(image->format, image->size.width, image->size.height, image->size.depth, image->mip_levels); if (!image->layer_pitch) @@ -829,7 +932,6 @@ static HRESULT d3dx_initialize_image_from_dds(const void *src_data, uint32_t src image->palette = (is_indexed_fmt) ? (PALETTEENTRY *)(((uint8_t *)src_data) + sizeof(*header)) : NULL; image->pixels = ((BYTE *)src_data) + header_size; - image->image_file_format = D3DX_IMAGE_FILE_FORMAT_DDS; if (starting_mip_level && (image->mip_levels > 1)) { uint32_t i, row_pitch, slice_pitch, initial_mip_levels; @@ -1415,7 +1517,7 @@ HRESULT d3dx_image_init(const void *src_data, uint32_t src_data_size, struct d3d break; case D3DX_IMAGE_FILE_FORMAT_DDS: - hr = d3dx_initialize_image_from_dds(src_data, src_data_size, image, starting_mip_level); + hr = d3dx_initialize_image_from_dds(src_data, src_data_size, image, starting_mip_level, flags); break; case D3DX_IMAGE_FILE_FORMAT_PPM: diff --git a/dlls/d3dx9_36/d3dx_helpers.h b/dlls/d3dx9_36/d3dx_helpers.h index 4535a9c20a2f..4e74f69a6725 100644 --- a/dlls/d3dx9_36/d3dx_helpers.h +++ b/dlls/d3dx9_36/d3dx_helpers.h @@ -201,11 +201,15 @@ enum d3dx_image_file_format D3DX_IMAGE_FILE_FORMAT_DIB = 6, D3DX_IMAGE_FILE_FORMAT_HDR = 7, D3DX_IMAGE_FILE_FORMAT_PFM = 8, + /* This is a Wine only file format value. */ + D3DX_IMAGE_FILE_FORMAT_DDS_DXT10 = 100, D3DX_IMAGE_FILE_FORMAT_FORCE_DWORD = 0x7fffffff }; enum d3dx_resource_type { + D3DX_RESOURCE_TYPE_UNKNOWN, + D3DX_RESOURCE_TYPE_TEXTURE_1D, D3DX_RESOURCE_TYPE_TEXTURE_2D, D3DX_RESOURCE_TYPE_TEXTURE_3D, D3DX_RESOURCE_TYPE_CUBE_TEXTURE, @@ -263,6 +267,16 @@ enum d3dx_pixel_format_id D3DX_PIXEL_FORMAT_COUNT, }; +/* These are aliases. */ +#define D3DX_PIXEL_FORMAT_R16G16B16A16_SNORM D3DX_PIXEL_FORMAT_U16V16W16Q16_SNORM +#define D3DX_PIXEL_FORMAT_R16G16_SNORM D3DX_PIXEL_FORMAT_U16V16_SNORM +#define D3DX_PIXEL_FORMAT_R8G8B8A8_SNORM D3DX_PIXEL_FORMAT_U8V8W8Q8_SNORM +#define D3DX_PIXEL_FORMAT_R8G8_SNORM D3DX_PIXEL_FORMAT_U8V8_SNORM +#define D3DX_PIXEL_FORMAT_BC1_UNORM D3DX_PIXEL_FORMAT_DXT1_UNORM +#define D3DX_PIXEL_FORMAT_BC2_UNORM D3DX_PIXEL_FORMAT_DXT3_UNORM +#define D3DX_PIXEL_FORMAT_BC3_UNORM D3DX_PIXEL_FORMAT_DXT5_UNORM + + /* for internal use */ enum component_type { @@ -320,6 +334,7 @@ static inline void set_d3dx_pixels(struct d3dx_pixels *pixels, const void *data, } #define D3DX_IMAGE_INFO_ONLY 1 +#define D3DX_IMAGE_SUPPORT_DXT10 2 struct d3dx_image { enum d3dx_resource_type resource_type; From f5500e62842abc34704ec9687b4df21dae9280b1 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 7 Nov 2024 11:06:47 -0500 Subject: [PATCH 0930/2542] d3dx10: Only validate header size for DDS files in d3dx10. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 8 ++++---- dlls/d3dx9_36/d3dx_helpers.c | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 138c2e2189a9..5f86c02ca4c4 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -3007,7 +3007,7 @@ static void test_legacy_dds_header_image_info(void) * is as well. */ { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT), 4, 4, 1, (4 * 4), 3, 0, 0, - { S_OK, 4, 4, 1, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, }, 0, .todo_hr = TRUE }, + { S_OK, 4, 4, 1, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, }, 0 }, /* Depth value set to 4, but no caps bits are set. Depth is ignored. */ { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT), 4, 4, 4, (4 * 4), 3, 0, 0, { S_OK, 4, 4, 1, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, }, 292 }, @@ -3088,7 +3088,7 @@ static void test_legacy_dds_header_image_info(void) ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); hr = D3DX10GetImageInfoFromMemory(&dds, sizeof(dds), NULL, &info, NULL); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); } static void test_dxt10_dds_header_image_info(void) @@ -3125,7 +3125,7 @@ static void test_dxt10_dds_header_image_info(void) /* File size validation isn't done on d3dx10. */ { 0, 4, 4, 0, (4 * 4), 1, 0, 0, { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0, }, - { S_OK, 4, 4, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, }, 0, .todo_hr = TRUE }, + { S_OK, 4, 4, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, }, 0 }, /* * Setting the misc_flags2 field to anything other than 0 results in * E_FAIL. @@ -3223,7 +3223,7 @@ static void test_dxt10_dds_header_image_info(void) ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); hr = D3DX10GetImageInfoFromMemory(&dds, sizeof(dds), NULL, &info, NULL); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); } static void test_get_image_info(void) diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index 367d3cf0b4b8..54fb7a476d4a 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -927,7 +927,9 @@ static HRESULT d3dx_initialize_image_from_dds(const void *src_data, uint32_t src if (src_data_size < expected_src_data_size) { WARN("File is too short %u, expected at least %u bytes.\n", src_data_size, expected_src_data_size); - return D3DX_ERROR_INVALID_DATA; + /* d3dx10/d3dx11 do not validate the size of the pixels. */ + if (!(flags & D3DX_IMAGE_SUPPORT_DXT10)) + return D3DX_ERROR_INVALID_DATA; } image->palette = (is_indexed_fmt) ? (PALETTEENTRY *)(((uint8_t *)src_data) + sizeof(*header)) : NULL; From 4cdcb6f726d3a66b8b6150796d44474dfe7b9d33 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 7 Nov 2024 13:00:52 -0500 Subject: [PATCH 0931/2542] d3dx10: Exclusively use shared code for parsing DDS files in get_image_info(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 48 ++++++++-------- dlls/d3dx10_43/texture.c | 103 ++++++++-------------------------- dlls/d3dx9_36/d3dx_helpers.c | 22 ++++++++ dlls/d3dx9_36/d3dx_helpers.h | 18 ++++++ dlls/d3dx9_36/util.c | 6 +- 5 files changed, 90 insertions(+), 107 deletions(-) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 5f86c02ca4c4..27eab7c88d8a 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -2999,7 +2999,6 @@ static void test_legacy_dds_header_image_info(void) uint32_t caps2; struct expected expected; uint32_t pixel_data_size; - BOOL todo_hr; } tests[] = { /* @@ -3037,7 +3036,7 @@ static void test_legacy_dds_header_image_info(void) /* Partial cubemaps are not supported. */ { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT), 4, 4, 1, (4 * 4), 1, (DDS_CAPS_TEXTURE | DDS_CAPS_COMPLEX), (DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_POSITIVEX), - { E_FAIL, }, (64 * 6), .todo_hr = TRUE }, + { E_FAIL, }, (64 * 6) }, }; D3DX10_IMAGE_INFO info; unsigned int i; @@ -3067,7 +3066,7 @@ static void test_legacy_dds_header_image_info(void) memset(&info, 0, sizeof(info)); hr = D3DX10GetImageInfoFromMemory(&dds, file_size, NULL, &info, NULL); - todo_wine_if(tests[i].todo_hr) ok(hr == tests[i].expected.hr, "Got unexpected hr %#lx.\n", hr); + ok(hr == tests[i].expected.hr, "Got unexpected hr %#lx.\n", hr); if (SUCCEEDED(hr) && SUCCEEDED(tests[i].expected.hr)) check_image_info_values(&info, tests[i].expected.width, tests[i].expected.height, tests[i].expected.depth, tests[i].expected.array_size, tests[i].expected.mip_levels, @@ -3119,7 +3118,6 @@ static void test_dxt10_dds_header_image_info(void) struct expected expected; uint32_t pixel_data_size; BOOL todo_hr; - BOOL todo_info; } dxt10_tests[] = { /* File size validation isn't done on d3dx10. */ @@ -3132,7 +3130,7 @@ static void test_dxt10_dds_header_image_info(void) */ { 0, 4, 4, 0, (4 * 4), 1, 0, 0, { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 1, }, - { E_FAIL }, (4 * 4 * 4), .todo_hr = TRUE }, + { E_FAIL }, (4 * 4 * 4) }, /* * The misc_flags field isn't passed through directly, only the * cube texture flag is (if it's set). @@ -3143,7 +3141,7 @@ static void test_dxt10_dds_header_image_info(void) /* Resource dimension field of the header isn't validated. */ { 0, 4, 4, 0, (4 * 4), 1, 0, 0, { DXGI_FORMAT_R8G8B8A8_UNORM, 500, 0, 1, 0, }, - { S_OK, 4, 4, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, 500, }, (4 * 4 * 4), .todo_info = TRUE }, + { S_OK, 4, 4, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, 500, }, (4 * 4 * 4), .todo_hr = TRUE }, /* Depth value of 2, but D3D10_RESOURCE_DIMENSION_TEXTURE2D. */ { DDS_DEPTH, 4, 4, 2, (4 * 4), 1, 0, 0, { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0, }, @@ -3170,11 +3168,11 @@ static void test_dxt10_dds_header_image_info(void) /* Resource dimension is validated for cube textures. */ { 0, 4, 4, 1, (4 * 4), 1, 0, 0, { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, DDS_RESOURCE_MISC_TEXTURECUBE, 2, 0, }, - { E_FAIL }, (4 * 4 * 4 * 12), .todo_hr = TRUE }, + { E_FAIL }, (4 * 4 * 4 * 12) }, /* 1D Texture cube, invalid. */ { 0, 4, 4, 1, (4 * 4), 1, 0, 0, { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, DDS_RESOURCE_MISC_TEXTURECUBE, 2, 0, }, - { E_FAIL }, (4 * 4 * 4 * 12), .todo_hr = TRUE }, + { E_FAIL }, (4 * 4 * 4 * 12) }, }; D3DX10_IMAGE_INFO info; unsigned int i; @@ -3205,7 +3203,7 @@ static void test_dxt10_dds_header_image_info(void) check_image_info_values(&info, dxt10_tests[i].expected.width, dxt10_tests[i].expected.height, dxt10_tests[i].expected.depth, dxt10_tests[i].expected.array_size, dxt10_tests[i].expected.mip_levels, dxt10_tests[i].expected.misc_flags, dxt10_tests[i].expected.format, - dxt10_tests[i].expected.resource_dimension, D3DX10_IFF_DDS, dxt10_tests[i].todo_info); + dxt10_tests[i].expected.resource_dimension, D3DX10_IFF_DDS, FALSE); winetest_pop_context(); } @@ -3380,13 +3378,13 @@ static void test_get_image_info(void) check_dds_pixel_format(DDS_PF_FOURCC, 0x74, 0, 0, 0, 0, 0, DXGI_FORMAT_R32G32B32A32_FLOAT); /* D3DFMT_A32B32G32R32F */ /* Test for DDS pixel formats that are valid on d3dx9, but not d3dx10. */ - todo_wine check_dds_pixel_format_unsupported(DDS_PF_FOURCC, MAKEFOURCC('U','Y','V','Y'), 0, 0, 0, 0, 0, E_FAIL); - todo_wine check_dds_pixel_format_unsupported(DDS_PF_FOURCC, MAKEFOURCC('Y','U','Y','2'), 0, 0, 0, 0, 0, E_FAIL); + check_dds_pixel_format_unsupported(DDS_PF_FOURCC, MAKEFOURCC('U','Y','V','Y'), 0, 0, 0, 0, 0, E_FAIL); + check_dds_pixel_format_unsupported(DDS_PF_FOURCC, MAKEFOURCC('Y','U','Y','2'), 0, 0, 0, 0, 0, E_FAIL); /* Bumpmap formats aren't supported. */ - todo_wine check_dds_pixel_format_unsupported(DDS_PF_BUMPDUDV, 0, 16, 0x00ff, 0xff00, 0, 0, E_FAIL); - todo_wine check_dds_pixel_format_unsupported(DDS_PF_BUMPDUDV, 0, 32, 0x0000ffff, 0xffff0000, 0, 0, E_FAIL); - todo_wine check_dds_pixel_format_unsupported(DDS_PF_BUMPDUDV, 0, 32, 0xff, 0xff00, 0x00ff0000, 0xff000000, E_FAIL); - todo_wine check_dds_pixel_format_unsupported(DDS_PF_BUMPLUMINANCE, 0, 32, 0x0000ff, 0x00ff00, 0xff0000, 0, E_FAIL); + check_dds_pixel_format_unsupported(DDS_PF_BUMPDUDV, 0, 16, 0x00ff, 0xff00, 0, 0, E_FAIL); + check_dds_pixel_format_unsupported(DDS_PF_BUMPDUDV, 0, 32, 0x0000ffff, 0xffff0000, 0, 0, E_FAIL); + check_dds_pixel_format_unsupported(DDS_PF_BUMPDUDV, 0, 32, 0xff, 0xff00, 0x00ff0000, 0xff000000, E_FAIL); + check_dds_pixel_format_unsupported(DDS_PF_BUMPLUMINANCE, 0, 32, 0x0000ff, 0x00ff00, 0xff0000, 0, E_FAIL); /* Newer fourCC formats. */ check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('B','C','4','U'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC4_UNORM); @@ -3394,24 +3392,24 @@ static void test_get_image_info(void) check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('B','C','4','S'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC4_SNORM); check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('B','C','5','S'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC5_SNORM); /* ATI1 is unsupported, but ATI2 is supported. */ - todo_wine check_dds_pixel_format_unsupported(DDS_PF_FOURCC, MAKEFOURCC('A','T','I','1'), 0, 0, 0, 0, 0, E_FAIL); + check_dds_pixel_format_unsupported(DDS_PF_FOURCC, MAKEFOURCC('A','T','I','1'), 0, 0, 0, 0, 0, E_FAIL); check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('A','T','I','2'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC5_UNORM); - todo_wine check_dds_dxt10_format_unsupported(DXGI_FORMAT_B5G6R5_UNORM, E_FAIL); - todo_wine check_dds_dxt10_format_unsupported(DXGI_FORMAT_B5G5R5A1_UNORM, E_FAIL); + check_dds_dxt10_format_unsupported(DXGI_FORMAT_B5G6R5_UNORM, E_FAIL); + check_dds_dxt10_format_unsupported(DXGI_FORMAT_B5G5R5A1_UNORM, E_FAIL); /* Formats that are newer than d3d10. */ - todo_wine check_dds_dxt10_format_unsupported(DXGI_FORMAT_BC6H_UF16, E_FAIL); - todo_wine check_dds_dxt10_format_unsupported(DXGI_FORMAT_BC6H_SF16, E_FAIL); - todo_wine check_dds_dxt10_format_unsupported(DXGI_FORMAT_BC7_UNORM, E_FAIL); - todo_wine check_dds_dxt10_format_unsupported(DXGI_FORMAT_B4G4R4A4_UNORM, E_FAIL); + check_dds_dxt10_format_unsupported(DXGI_FORMAT_BC6H_UF16, E_FAIL); + check_dds_dxt10_format_unsupported(DXGI_FORMAT_BC6H_SF16, E_FAIL); + check_dds_dxt10_format_unsupported(DXGI_FORMAT_BC7_UNORM, E_FAIL); + check_dds_dxt10_format_unsupported(DXGI_FORMAT_B4G4R4A4_UNORM, E_FAIL); /* * These formats should map 1:1 from the DXT10 header, unlike legacy DDS * file equivalents. */ - check_dds_dxt10_format(DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM, TRUE); - check_dds_dxt10_format(DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM, TRUE); - check_dds_dxt10_format(DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R8G8_UNORM, TRUE); + check_dds_dxt10_format(DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM, FALSE); + check_dds_dxt10_format(DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM, FALSE); + check_dds_dxt10_format(DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R8G8_UNORM, FALSE); check_dds_dxt10_format(DXGI_FORMAT_B8G8R8X8_UNORM, DXGI_FORMAT_B8G8R8X8_UNORM, FALSE); check_dds_dxt10_format(DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM, FALSE); diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index db73df8fb26c..34289415f43d 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -82,6 +82,10 @@ static DXGI_FORMAT dxgi_format_from_legacy_dds_d3dx_pixel_format_id(enum d3dx_pi case D3DX_PIXEL_FORMAT_DXT3_UNORM: return DXGI_FORMAT_BC2_UNORM; case D3DX_PIXEL_FORMAT_DXT4_UNORM: return DXGI_FORMAT_BC3_UNORM; case D3DX_PIXEL_FORMAT_DXT5_UNORM: return DXGI_FORMAT_BC3_UNORM; + case D3DX_PIXEL_FORMAT_BC4_UNORM: return DXGI_FORMAT_BC4_UNORM; + case D3DX_PIXEL_FORMAT_BC4_SNORM: return DXGI_FORMAT_BC4_SNORM; + case D3DX_PIXEL_FORMAT_BC5_UNORM: return DXGI_FORMAT_BC5_UNORM; + case D3DX_PIXEL_FORMAT_BC5_SNORM: return DXGI_FORMAT_BC5_SNORM; /* These formats are known and explicitly unsupported on d3dx10+. */ case D3DX_PIXEL_FORMAT_U8V8W8Q8_SNORM: @@ -108,6 +112,9 @@ static DXGI_FORMAT dxgi_format_from_d3dx_pixel_format_id(enum d3dx_pixel_format_ case D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM: return DXGI_FORMAT_B8G8R8X8_UNORM; case D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM: return DXGI_FORMAT_R10G10B10A2_UNORM; case D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM: return DXGI_FORMAT_R16G16B16A16_UNORM; + case D3DX_PIXEL_FORMAT_R8_UNORM: return DXGI_FORMAT_R8_UNORM; + case D3DX_PIXEL_FORMAT_R8G8_UNORM: return DXGI_FORMAT_R8G8_UNORM; + case D3DX_PIXEL_FORMAT_R16_UNORM: return DXGI_FORMAT_R16_UNORM; case D3DX_PIXEL_FORMAT_R16G16_UNORM: return DXGI_FORMAT_R16G16_UNORM; case D3DX_PIXEL_FORMAT_A8_UNORM: return DXGI_FORMAT_A8_UNORM; case D3DX_PIXEL_FORMAT_R16_FLOAT: return DXGI_FORMAT_R16_FLOAT; @@ -115,12 +122,17 @@ static DXGI_FORMAT dxgi_format_from_d3dx_pixel_format_id(enum d3dx_pixel_format_ case D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT: return DXGI_FORMAT_R16G16B16A16_FLOAT; case D3DX_PIXEL_FORMAT_R32_FLOAT: return DXGI_FORMAT_R32_FLOAT; case D3DX_PIXEL_FORMAT_R32G32_FLOAT: return DXGI_FORMAT_R32G32_FLOAT; + case D3DX_PIXEL_FORMAT_R32G32B32_FLOAT: return DXGI_FORMAT_R32G32B32_FLOAT; case D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT: return DXGI_FORMAT_R32G32B32A32_FLOAT; case D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM: return DXGI_FORMAT_G8R8_G8B8_UNORM; case D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM: return DXGI_FORMAT_R8G8_B8G8_UNORM; case D3DX_PIXEL_FORMAT_BC1_UNORM: return DXGI_FORMAT_BC1_UNORM; case D3DX_PIXEL_FORMAT_BC2_UNORM: return DXGI_FORMAT_BC2_UNORM; case D3DX_PIXEL_FORMAT_BC3_UNORM: return DXGI_FORMAT_BC3_UNORM; + case D3DX_PIXEL_FORMAT_BC4_UNORM: return DXGI_FORMAT_BC4_UNORM; + case D3DX_PIXEL_FORMAT_BC4_SNORM: return DXGI_FORMAT_BC4_SNORM; + case D3DX_PIXEL_FORMAT_BC5_UNORM: return DXGI_FORMAT_BC5_UNORM; + case D3DX_PIXEL_FORMAT_BC5_SNORM: return DXGI_FORMAT_BC5_SNORM; case D3DX_PIXEL_FORMAT_R16G16B16A16_SNORM: return DXGI_FORMAT_R16G16B16A16_SNORM; case D3DX_PIXEL_FORMAT_R8G8B8A8_SNORM: return DXGI_FORMAT_R8G8B8A8_SNORM; case D3DX_PIXEL_FORMAT_R8G8_SNORM: return DXGI_FORMAT_R8G8_SNORM; @@ -208,22 +220,6 @@ static const GUID *dxgi_format_to_wic_guid(DXGI_FORMAT format) return NULL; } -static D3D10_RESOURCE_DIMENSION wic_dimension_to_d3dx10_dimension(WICDdsDimension wic_dimension) -{ - switch (wic_dimension) - { - case WICDdsTexture1D: - return D3D10_RESOURCE_DIMENSION_TEXTURE1D; - case WICDdsTexture2D: - case WICDdsTextureCube: - return D3D10_RESOURCE_DIMENSION_TEXTURE2D; - case WICDdsTexture3D: - return D3D10_RESOURCE_DIMENSION_TEXTURE3D; - default: - return D3D10_RESOURCE_DIMENSION_UNKNOWN; - } -} - static unsigned int get_bpp_from_format(DXGI_FORMAT format) { switch (format) @@ -358,36 +354,6 @@ static unsigned int get_bpp_from_format(DXGI_FORMAT format) } } -static DXGI_FORMAT get_d3dx10_dds_format(DXGI_FORMAT format) -{ - static const struct - { - DXGI_FORMAT src; - DXGI_FORMAT dst; - } - format_map[] = - { - {DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R8G8B8A8_UNORM}, - {DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM}, - {DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM}, - {DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM}, - {DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM}, - {DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM}, - {DXGI_FORMAT_B8G8R8X8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM}, - {DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM}, - {DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16G16B16A16_UNORM}, - }; - - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(format_map); ++i) - { - if (format == format_map[i].src) - return format_map[i].dst; - } - return format; -} - HRESULT WINAPI D3DX10GetImageInfoFromFileA(const char *src_file, ID3DX10ThreadPump *pump, D3DX10_IMAGE_INFO *info, HRESULT *result) { @@ -598,9 +564,7 @@ HRESULT get_image_info(const void *data, SIZE_T size, D3DX10_IMAGE_INFO *img_inf { IWICBitmapFrameDecode *frame = NULL; IWICImagingFactory *factory = NULL; - IWICDdsDecoder *dds_decoder = NULL; IWICBitmapDecoder *decoder = NULL; - WICDdsParameters dds_params; IWICStream *stream = NULL; unsigned int frame_count; struct d3dx_image image; @@ -614,11 +578,7 @@ HRESULT get_image_info(const void *data, SIZE_T size, D3DX10_IMAGE_INFO *img_inf && (image.image_file_format == D3DX_IMAGE_FILE_FORMAT_DDS || (image.image_file_format == D3DX_IMAGE_FILE_FORMAT_DDS_DXT10))) { - if (SUCCEEDED(d3dx10_image_info_from_d3dx_image(img_info, &image))) - { - TRACE("Successfully retrieved image info from shared code.\n"); - return S_OK; - } + return d3dx10_image_info_from_d3dx_image(img_info, &image); } WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory); @@ -656,37 +616,18 @@ HRESULT get_image_info(const void *data, SIZE_T size, D3DX10_IMAGE_INFO *img_inf if (img_info->ImageFileFormat == D3DX10_IFF_DDS) { - hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICDdsDecoder, (void **)&dds_decoder); - if (FAILED(hr)) - goto end; - hr = IWICDdsDecoder_GetParameters(dds_decoder, &dds_params); - if (FAILED(hr)) - goto end; - img_info->ArraySize = dds_params.ArraySize; - img_info->Depth = dds_params.Depth; - img_info->MipLevels = dds_params.MipLevels; - img_info->ResourceDimension = wic_dimension_to_d3dx10_dimension(dds_params.Dimension); - img_info->Format = get_d3dx10_dds_format(dds_params.DxgiFormat); - img_info->MiscFlags = 0; - if (dds_params.Dimension == WICDdsTextureCube) - { - img_info->MiscFlags = D3D10_RESOURCE_MISC_TEXTURECUBE; - img_info->ArraySize *= 6; - } - } - else - { - img_info->ArraySize = 1; - img_info->Depth = 1; - img_info->MipLevels = 1; - img_info->ResourceDimension = D3D10_RESOURCE_DIMENSION_TEXTURE2D; - img_info->Format = DXGI_FORMAT_R8G8B8A8_UNORM; - img_info->MiscFlags = 0; + hr = E_FAIL; + goto end; } + img_info->ArraySize = 1; + img_info->Depth = 1; + img_info->MipLevels = 1; + img_info->ResourceDimension = D3D10_RESOURCE_DIMENSION_TEXTURE2D; + img_info->Format = DXGI_FORMAT_R8G8B8A8_UNORM; + img_info->MiscFlags = 0; + end: - if (dds_decoder) - IWICDdsDecoder_Release(dds_decoder); if (frame) IWICBitmapFrameDecode_Release(frame); if (decoder) diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index 54fb7a476d4a..2d1c2092b821 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -59,6 +59,9 @@ static const struct pixel_format_desc formats[] = {D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM, { 2, 10, 10, 10}, {30, 0, 10, 20}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_UNORM, 0 }, {D3DX_PIXEL_FORMAT_R16G16B16_UNORM, { 0, 16, 16, 16}, { 0, 0, 16, 32}, 6, 1, 1, 6, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_INTERNAL}, {D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM, {16, 16, 16, 16}, {48, 0, 16, 32}, 8, 1, 1, 8, CTYPE_UNORM, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_R8_UNORM, { 0, 8, 0, 0}, { 0, 0, 0, 0}, 1, 1, 1, 1, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_DXGI}, + {D3DX_PIXEL_FORMAT_R8G8_UNORM, { 0, 8, 8, 0}, { 0, 0, 8, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_DXGI}, + {D3DX_PIXEL_FORMAT_R16_UNORM, { 0, 16, 0, 0}, { 0, 0, 0, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_DXGI}, {D3DX_PIXEL_FORMAT_R16G16_UNORM, { 0, 16, 16, 0}, { 0, 0, 16, 0}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, 0 }, {D3DX_PIXEL_FORMAT_A8_UNORM, { 8, 0, 0, 0}, { 0, 0, 0, 0}, 1, 1, 1, 1, CTYPE_UNORM, CTYPE_EMPTY, 0 }, {D3DX_PIXEL_FORMAT_L8A8_UNORM, { 8, 8, 0, 0}, { 8, 0, 0, 0}, 2, 1, 1, 2, CTYPE_UNORM, CTYPE_LUMA, 0 }, @@ -70,11 +73,16 @@ static const struct pixel_format_desc formats[] = {D3DX_PIXEL_FORMAT_DXT3_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT}, {D3DX_PIXEL_FORMAT_DXT4_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT | FMT_FLAG_PM_ALPHA}, {D3DX_PIXEL_FORMAT_DXT5_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT}, + {D3DX_PIXEL_FORMAT_BC4_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 8, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_DXT | FMT_FLAG_DXGI}, + {D3DX_PIXEL_FORMAT_BC4_SNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 8, CTYPE_EMPTY, CTYPE_SNORM, FMT_FLAG_DXT | FMT_FLAG_DXGI}, + {D3DX_PIXEL_FORMAT_BC5_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_DXT | FMT_FLAG_DXGI}, + {D3DX_PIXEL_FORMAT_BC5_SNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_EMPTY, CTYPE_SNORM, FMT_FLAG_DXT | FMT_FLAG_DXGI}, {D3DX_PIXEL_FORMAT_R16_FLOAT, { 0, 16, 0, 0}, { 0, 0, 0, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_FLOAT, 0 }, {D3DX_PIXEL_FORMAT_R16G16_FLOAT, { 0, 16, 16, 0}, { 0, 0, 16, 0}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_FLOAT, 0 }, {D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT, {16, 16, 16, 16}, {48, 0, 16, 32}, 8, 1, 1, 8, CTYPE_FLOAT, CTYPE_FLOAT, 0 }, {D3DX_PIXEL_FORMAT_R32_FLOAT, { 0, 32, 0, 0}, { 0, 0, 0, 0}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_FLOAT, 0 }, {D3DX_PIXEL_FORMAT_R32G32_FLOAT, { 0, 32, 32, 0}, { 0, 0, 32, 0}, 8, 1, 1, 8, CTYPE_EMPTY, CTYPE_FLOAT, 0 }, + {D3DX_PIXEL_FORMAT_R32G32B32_FLOAT, { 0, 32, 32, 32}, { 0, 0, 32, 64}, 12, 1, 1, 12, CTYPE_EMPTY, CTYPE_FLOAT, FMT_FLAG_DXGI}, {D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT, {32, 32, 32, 32}, {96, 0, 32, 64}, 16, 1, 1, 16, CTYPE_FLOAT, CTYPE_FLOAT, 0 }, {D3DX_PIXEL_FORMAT_P8_UINT, { 8, 8, 8, 8}, { 0, 0, 0, 0}, 1, 1, 1, 1, CTYPE_INDEX, CTYPE_INDEX, 0 }, {D3DX_PIXEL_FORMAT_P8_UINT_A8_UNORM, { 8, 8, 8, 8}, { 8, 0, 0, 0}, 2, 1, 1, 2, CTYPE_UNORM, CTYPE_INDEX, 0 }, @@ -186,6 +194,12 @@ static const struct { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','3') }, D3DX_PIXEL_FORMAT_DXT3_UNORM }, { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','4') }, D3DX_PIXEL_FORMAT_DXT4_UNORM }, { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','5') }, D3DX_PIXEL_FORMAT_DXT5_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','U') }, D3DX_PIXEL_FORMAT_BC4_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','S') }, D3DX_PIXEL_FORMAT_BC4_SNORM }, + /* ATI2 is treated identically to BC5U in d3dx10+. */ + { { 32, DDS_PF_FOURCC, MAKEFOURCC('A','T','I','2') }, D3DX_PIXEL_FORMAT_BC5_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','5','U') }, D3DX_PIXEL_FORMAT_BC5_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','5','S') }, D3DX_PIXEL_FORMAT_BC5_SNORM }, /* These aren't actually fourcc values, they're just D3DFMT values. */ { { 32, DDS_PF_FOURCC, 0x24 }, D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM }, { { 32, DDS_PF_FOURCC, 0x6e }, D3DX_PIXEL_FORMAT_U16V16W16Q16_SNORM }, @@ -344,6 +358,9 @@ static enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dxgi_format(DXGI_FORM case DXGI_FORMAT_B4G4R4A4_UNORM: return D3DX_PIXEL_FORMAT_B4G4R4A4_UNORM; case DXGI_FORMAT_R10G10B10A2_UNORM: return D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM; case DXGI_FORMAT_R16G16B16A16_UNORM: return D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM; + case DXGI_FORMAT_R8_UNORM: return D3DX_PIXEL_FORMAT_R8_UNORM; + case DXGI_FORMAT_R8G8_UNORM: return D3DX_PIXEL_FORMAT_R8G8_UNORM; + case DXGI_FORMAT_R16_UNORM: return D3DX_PIXEL_FORMAT_R16_UNORM; case DXGI_FORMAT_R16G16_UNORM: return D3DX_PIXEL_FORMAT_R16G16_UNORM; case DXGI_FORMAT_A8_UNORM: return D3DX_PIXEL_FORMAT_A8_UNORM; case DXGI_FORMAT_R16_FLOAT: return D3DX_PIXEL_FORMAT_R16_FLOAT; @@ -351,12 +368,17 @@ static enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dxgi_format(DXGI_FORM case DXGI_FORMAT_R16G16B16A16_FLOAT: return D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT; case DXGI_FORMAT_R32_FLOAT: return D3DX_PIXEL_FORMAT_R32_FLOAT; case DXGI_FORMAT_R32G32_FLOAT: return D3DX_PIXEL_FORMAT_R32G32_FLOAT; + case DXGI_FORMAT_R32G32B32_FLOAT: return D3DX_PIXEL_FORMAT_R32G32B32_FLOAT; case DXGI_FORMAT_R32G32B32A32_FLOAT: return D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT; case DXGI_FORMAT_G8R8_G8B8_UNORM: return D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM; case DXGI_FORMAT_R8G8_B8G8_UNORM: return D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM; case DXGI_FORMAT_BC1_UNORM: return D3DX_PIXEL_FORMAT_BC1_UNORM; case DXGI_FORMAT_BC2_UNORM: return D3DX_PIXEL_FORMAT_BC2_UNORM; case DXGI_FORMAT_BC3_UNORM: return D3DX_PIXEL_FORMAT_BC3_UNORM; + case DXGI_FORMAT_BC4_UNORM: return D3DX_PIXEL_FORMAT_BC4_UNORM; + case DXGI_FORMAT_BC4_SNORM: return D3DX_PIXEL_FORMAT_BC4_SNORM; + case DXGI_FORMAT_BC5_UNORM: return D3DX_PIXEL_FORMAT_BC5_UNORM; + case DXGI_FORMAT_BC5_SNORM: return D3DX_PIXEL_FORMAT_BC5_SNORM; case DXGI_FORMAT_R8G8B8A8_SNORM: return D3DX_PIXEL_FORMAT_R8G8B8A8_SNORM; case DXGI_FORMAT_R8G8_SNORM: return D3DX_PIXEL_FORMAT_R8G8_SNORM; case DXGI_FORMAT_R16G16_SNORM: return D3DX_PIXEL_FORMAT_R16G16_SNORM; diff --git a/dlls/d3dx9_36/d3dx_helpers.h b/dlls/d3dx9_36/d3dx_helpers.h index 4e74f69a6725..cf343bd11d2e 100644 --- a/dlls/d3dx9_36/d3dx_helpers.h +++ b/dlls/d3dx9_36/d3dx_helpers.h @@ -235,6 +235,9 @@ enum d3dx_pixel_format_id D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM, D3DX_PIXEL_FORMAT_R16G16B16_UNORM, D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM, + D3DX_PIXEL_FORMAT_R8_UNORM, + D3DX_PIXEL_FORMAT_R8G8_UNORM, + D3DX_PIXEL_FORMAT_R16_UNORM, D3DX_PIXEL_FORMAT_R16G16_UNORM, D3DX_PIXEL_FORMAT_A8_UNORM, D3DX_PIXEL_FORMAT_L8A8_UNORM, @@ -246,11 +249,16 @@ enum d3dx_pixel_format_id D3DX_PIXEL_FORMAT_DXT3_UNORM, D3DX_PIXEL_FORMAT_DXT4_UNORM, D3DX_PIXEL_FORMAT_DXT5_UNORM, + D3DX_PIXEL_FORMAT_BC4_UNORM, + D3DX_PIXEL_FORMAT_BC4_SNORM, + D3DX_PIXEL_FORMAT_BC5_UNORM, + D3DX_PIXEL_FORMAT_BC5_SNORM, D3DX_PIXEL_FORMAT_R16_FLOAT, D3DX_PIXEL_FORMAT_R16G16_FLOAT, D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT, D3DX_PIXEL_FORMAT_R32_FLOAT, D3DX_PIXEL_FORMAT_R32G32_FLOAT, + D3DX_PIXEL_FORMAT_R32G32B32_FLOAT, D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT, D3DX_PIXEL_FORMAT_P8_UINT, D3DX_PIXEL_FORMAT_P8_UINT_A8_UNORM, @@ -295,6 +303,11 @@ enum format_flag /* Internal only format, has no exact D3DFORMAT equivalent. */ FMT_FLAG_INTERNAL = 0x04, FMT_FLAG_PM_ALPHA = 0x08, + /* + * For formats that only have a DXGI_FORMAT mapping, no D3DFORMAT + * equivalent. + */ + FMT_FLAG_DXGI = 0x10, }; struct pixel_format_desc { @@ -404,6 +417,11 @@ static inline BOOL is_internal_format(const struct pixel_format_desc *format) return !!(format->flags & FMT_FLAG_INTERNAL); } +static inline BOOL is_dxgi_format(const struct pixel_format_desc *format) +{ + return !!(format->flags & FMT_FLAG_DXGI); +} + static inline BOOL filter_flags_match(uint32_t filter_flags) { if (!!(filter_flags & D3DX_FILTER_PMA_IN) != !!((filter_flags & D3DX_FILTER_PMA_OUT))) diff --git a/dlls/d3dx9_36/util.c b/dlls/d3dx9_36/util.c index 55d69e78478d..6e55c02ac126 100644 --- a/dlls/d3dx9_36/util.c +++ b/dlls/d3dx9_36/util.c @@ -71,9 +71,13 @@ D3DFORMAT d3dformat_from_d3dx_pixel_format_id(enum d3dx_pixel_format_id format) case D3DX_PIXEL_FORMAT_UYVY: return D3DFMT_UYVY; case D3DX_PIXEL_FORMAT_YUY2: return D3DFMT_YUY2; default: - if (!is_internal_format(get_d3dx_pixel_format_info(format))) + { + const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(format); + + if (!is_internal_format(fmt_desc) && !is_dxgi_format(fmt_desc)) FIXME("Unknown d3dx_pixel_format_id %u.\n", format); return D3DFMT_UNKNOWN; + } } } From dfb272ba8e08bd473c13412c5e36bc35eb0b90e3 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 7 Nov 2024 13:44:55 -0500 Subject: [PATCH 0932/2542] d3dx10: Exclusively use shared code for parsing image files in get_image_info(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 2 +- dlls/d3dx10_43/texture.c | 106 +++------------------------------- dlls/d3dx9_36/d3dx_helpers.c | 49 +++++++++++++++- dlls/d3dx9_36/d3dx_helpers.h | 4 ++ 4 files changed, 60 insertions(+), 101 deletions(-) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 27eab7c88d8a..c7634f85dce6 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -3272,7 +3272,7 @@ static void test_get_image_info(void) /* 2 bpp is not a valid bit count. */ hr2 = 0xdeadbeef; hr = D3DX10GetImageInfoFromMemory(test_bmp_2bpp, sizeof(test_bmp_2bpp), NULL, &image_info, &hr2); - todo_wine ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); for (i = 0; i < ARRAY_SIZE(test_image); ++i) diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 34289415f43d..a0bb23f6dc84 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -153,22 +153,6 @@ static DXGI_FORMAT dxgi_format_from_d3dx_pixel_format_id(enum d3dx_pixel_format_ } } -static const struct -{ - const GUID *wic_container_guid; - D3DX10_IMAGE_FILE_FORMAT d3dx_file_format; -} -file_formats[] = -{ - { &GUID_ContainerFormatBmp, D3DX10_IFF_BMP }, - { &GUID_ContainerFormatJpeg, D3DX10_IFF_JPG }, - { &GUID_ContainerFormatPng, D3DX10_IFF_PNG }, - { &GUID_ContainerFormatDds, D3DX10_IFF_DDS }, - { &GUID_ContainerFormatTiff, D3DX10_IFF_TIFF }, - { &GUID_ContainerFormatGif, D3DX10_IFF_GIF }, - { &GUID_ContainerFormatWmp, D3DX10_IFF_WMP }, -}; - static const struct { const GUID *wic_guid; @@ -195,18 +179,6 @@ wic_pixel_formats[] = { &GUID_WICPixelFormat128bppRGBAFloat, DXGI_FORMAT_R32G32B32A32_FLOAT } }; -static D3DX10_IMAGE_FILE_FORMAT wic_container_guid_to_file_format(GUID *container_format) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(file_formats); ++i) - { - if (IsEqualGUID(file_formats[i].wic_container_guid, container_format)) - return file_formats[i].d3dx_file_format; - } - return D3DX10_IFF_FORCE_DWORD; -} - static const GUID *dxgi_format_to_wic_guid(DXGI_FORMAT format) { unsigned int i; @@ -514,13 +486,16 @@ static HRESULT d3dx10_image_info_from_d3dx_image(D3DX10_IMAGE_INFO *info, struct } else { - format = dxgi_format_from_legacy_dds_d3dx_pixel_format_id(image->format); + if (image->image_file_format == D3DX_IMAGE_FILE_FORMAT_DDS) + format = dxgi_format_from_legacy_dds_d3dx_pixel_format_id(image->format); + else + format = DXGI_FORMAT_R8G8B8A8_UNORM; info->ImageFileFormat = (D3DX10_IMAGE_FILE_FORMAT)image->image_file_format; } if (format == DXGI_FORMAT_UNKNOWN) { - WARN("Tried to load DDS file with unsupported format %#x.\n", image->format); + WARN("Tried to load file with unsupported d3dx_pixel_format_id %#x.\n", image->format); return E_FAIL; } @@ -562,80 +537,15 @@ static HRESULT d3dx10_image_info_from_d3dx_image(D3DX10_IMAGE_INFO *info, struct HRESULT get_image_info(const void *data, SIZE_T size, D3DX10_IMAGE_INFO *img_info) { - IWICBitmapFrameDecode *frame = NULL; - IWICImagingFactory *factory = NULL; - IWICBitmapDecoder *decoder = NULL; - IWICStream *stream = NULL; - unsigned int frame_count; struct d3dx_image image; - GUID container_format; HRESULT hr; if (!data || !size) return E_FAIL; - if (SUCCEEDED(d3dx_image_init(data, size, &image, 0, D3DX_IMAGE_INFO_ONLY | D3DX_IMAGE_SUPPORT_DXT10)) - && (image.image_file_format == D3DX_IMAGE_FILE_FORMAT_DDS - || (image.image_file_format == D3DX_IMAGE_FILE_FORMAT_DDS_DXT10))) - { - return d3dx10_image_info_from_d3dx_image(img_info, &image); - } - - WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory); - IWICImagingFactory_CreateStream(factory, &stream); - hr = IWICStream_InitializeFromMemory(stream, (BYTE *)data, size); - if (FAILED(hr)) - { - WARN("Failed to initialize stream.\n"); - goto end; - } - hr = IWICImagingFactory_CreateDecoderFromStream(factory, (IStream *)stream, NULL, 0, &decoder); - if (FAILED(hr)) - goto end; - - hr = IWICBitmapDecoder_GetContainerFormat(decoder, &container_format); - if (FAILED(hr)) - goto end; - img_info->ImageFileFormat = wic_container_guid_to_file_format(&container_format); - if (img_info->ImageFileFormat == D3DX10_IFF_FORCE_DWORD) - { - hr = E_FAIL; - WARN("Unsupported image file format %s.\n", debugstr_guid(&container_format)); - goto end; - } - - hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count); - if (FAILED(hr) || !frame_count) - goto end; - hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); - if (FAILED(hr)) - goto end; - hr = IWICBitmapFrameDecode_GetSize(frame, &img_info->Width, &img_info->Height); - if (FAILED(hr)) - goto end; - - if (img_info->ImageFileFormat == D3DX10_IFF_DDS) - { - hr = E_FAIL; - goto end; - } - - img_info->ArraySize = 1; - img_info->Depth = 1; - img_info->MipLevels = 1; - img_info->ResourceDimension = D3D10_RESOURCE_DIMENSION_TEXTURE2D; - img_info->Format = DXGI_FORMAT_R8G8B8A8_UNORM; - img_info->MiscFlags = 0; - -end: - if (frame) - IWICBitmapFrameDecode_Release(frame); - if (decoder) - IWICBitmapDecoder_Release(decoder); - if (stream) - IWICStream_Release(stream); - if (factory) - IWICImagingFactory_Release(factory); + hr = d3dx_image_init(data, size, &image, 0, D3DX_IMAGE_INFO_ONLY | D3DX_IMAGE_SUPPORT_DXT10); + if (SUCCEEDED(hr)) + hr = d3dx10_image_info_from_d3dx_image(img_info, &image); if (hr != S_OK) { diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index 2d1c2092b821..e5a58a40455a 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -499,6 +499,9 @@ static const GUID *wic_container_guid_from_d3dx_file_format(enum d3dx_image_file case D3DX_IMAGE_FILE_FORMAT_BMP: return &GUID_ContainerFormatBmp; case D3DX_IMAGE_FILE_FORMAT_JPG: return &GUID_ContainerFormatJpeg; case D3DX_IMAGE_FILE_FORMAT_PNG: return &GUID_ContainerFormatPng; + case D3DX_IMAGE_FILE_FORMAT_TIFF: return &GUID_ContainerFormatTiff; + case D3DX_IMAGE_FILE_FORMAT_GIF: return &GUID_ContainerFormatGif; + case D3DX_IMAGE_FILE_FORMAT_WMP: return &GUID_ContainerFormatWmp; default: assert(0 && "Unexpected file format."); return NULL; @@ -784,6 +787,12 @@ static const uint8_t ppm_raw_file_signature[] = { 'P', '6' }; static const uint8_t hdr_file_signature[] = { '#', '?', 'R', 'A', 'D', 'I', 'A', 'N', 'C', 'E', '\n' }; static const uint8_t pfm_color_file_signature[] = { 'P', 'F' }; static const uint8_t pfm_gray_file_signature[] = { 'P', 'f' }; +static const uint8_t tiff_le_file_signature[] = { 'I', 'I', 0x2a, 0x00 }; +static const uint8_t tiff_be_file_signature[] = { 'M', 'M', 0x00, 0x2a }; +static const uint8_t gif_87a_file_signature[] = { 'G', 'I', 'F', '8', '7', 'a' }; +static const uint8_t gif_89a_file_signature[] = { 'G', 'I', 'F', '8', '9', 'a' }; +static const uint8_t wmp_v0_file_signature[] = { 'I', 'I', 0xbc, 0x00 }; +static const uint8_t wmp_v1_file_signature[] = { 'I', 'I', 0xbc, 0x01 }; /* * If none of these match, the file is either DIB, TGA, or something we don't @@ -807,6 +816,12 @@ static const struct d3dx_file_format_signature file_format_signatures[] = { hdr_file_signature, sizeof(hdr_file_signature), D3DX_IMAGE_FILE_FORMAT_HDR }, { pfm_color_file_signature, sizeof(pfm_color_file_signature), D3DX_IMAGE_FILE_FORMAT_PFM }, { pfm_gray_file_signature, sizeof(pfm_gray_file_signature), D3DX_IMAGE_FILE_FORMAT_PFM }, + { tiff_le_file_signature, sizeof(tiff_le_file_signature), D3DX_IMAGE_FILE_FORMAT_TIFF }, + { tiff_be_file_signature, sizeof(tiff_be_file_signature), D3DX_IMAGE_FILE_FORMAT_TIFF }, + { gif_87a_file_signature, sizeof(gif_87a_file_signature), D3DX_IMAGE_FILE_FORMAT_GIF }, + { gif_89a_file_signature, sizeof(gif_89a_file_signature), D3DX_IMAGE_FILE_FORMAT_GIF }, + { wmp_v0_file_signature, sizeof(wmp_v0_file_signature), D3DX_IMAGE_FILE_FORMAT_WMP }, + { wmp_v1_file_signature, sizeof(wmp_v1_file_signature), D3DX_IMAGE_FILE_FORMAT_WMP }, }; static BOOL d3dx_get_image_file_format_from_file_signature(const void *src_data, uint32_t src_data_size, @@ -1508,6 +1523,7 @@ HRESULT d3dx_image_init(const void *src_data, uint32_t src_data_size, struct d3d uint32_t starting_mip_level, uint32_t flags) { enum d3dx_image_file_format iff = D3DX_IMAGE_FILE_FORMAT_FORCE_DWORD; + const BOOL is_d3dx9 = !(flags & D3DX_IMAGE_SUPPORT_DXT10); HRESULT hr; if (!src_data || !src_data_size || !image) @@ -1519,6 +1535,13 @@ HRESULT d3dx_image_init(const void *src_data, uint32_t src_data_size, struct d3d uint32_t src_image_size = src_data_size; const void *src_image = src_data; + /* + * All file formats supported by d3dx10/d3dx11 are detectable by + * file signature. + */ + if (!is_d3dx9) + return E_FAIL; + if (convert_dib_to_bmp(&src_image, &src_image_size)) { hr = d3dx_image_init(src_image, src_image_size, image, starting_mip_level, flags); @@ -1540,6 +1563,20 @@ HRESULT d3dx_image_init(const void *src_data, uint32_t src_data_size, struct d3d hr = d3dx_initialize_image_from_wic(src_data, src_data_size, image, iff, flags); break; + case D3DX_IMAGE_FILE_FORMAT_TIFF: + case D3DX_IMAGE_FILE_FORMAT_GIF: + case D3DX_IMAGE_FILE_FORMAT_WMP: + if (is_d3dx9) + { + WARN("Tried to load file format %s on d3dx9.\n", debug_d3dx_image_file_format(iff)); + hr = D3DX_ERROR_INVALID_DATA; + } + else + { + hr = d3dx_initialize_image_from_wic(src_data, src_data_size, image, iff, flags); + } + break; + case D3DX_IMAGE_FILE_FORMAT_DDS: hr = d3dx_initialize_image_from_dds(src_data, src_data_size, image, starting_mip_level, flags); break; @@ -1547,8 +1584,16 @@ HRESULT d3dx_image_init(const void *src_data, uint32_t src_data_size, struct d3d case D3DX_IMAGE_FILE_FORMAT_PPM: case D3DX_IMAGE_FILE_FORMAT_HDR: case D3DX_IMAGE_FILE_FORMAT_PFM: - WARN("Unsupported file format %s.\n", debug_d3dx_image_file_format(iff)); - hr = E_NOTIMPL; + if (is_d3dx9) + { + FIXME("Support for file format %s is currently unimplemented.\n", debug_d3dx_image_file_format(iff)); + hr = E_NOTIMPL; + } + else + { + WARN("Tried to load file format %s on d3dx%d.\n", debug_d3dx_image_file_format(iff), D3DX_D3D_VERSION); + hr = E_FAIL; + } break; case D3DX_IMAGE_FILE_FORMAT_FORCE_DWORD: diff --git a/dlls/d3dx9_36/d3dx_helpers.h b/dlls/d3dx9_36/d3dx_helpers.h index cf343bd11d2e..6724cf5b1242 100644 --- a/dlls/d3dx9_36/d3dx_helpers.h +++ b/dlls/d3dx9_36/d3dx_helpers.h @@ -201,6 +201,10 @@ enum d3dx_image_file_format D3DX_IMAGE_FILE_FORMAT_DIB = 6, D3DX_IMAGE_FILE_FORMAT_HDR = 7, D3DX_IMAGE_FILE_FORMAT_PFM = 8, + /* TIFF/GIF/WMP are only available on d3dx10/d3dx11. */ + D3DX_IMAGE_FILE_FORMAT_TIFF = 10, + D3DX_IMAGE_FILE_FORMAT_GIF = 11, + D3DX_IMAGE_FILE_FORMAT_WMP = 12, /* This is a Wine only file format value. */ D3DX_IMAGE_FILE_FORMAT_DDS_DXT10 = 100, D3DX_IMAGE_FILE_FORMAT_FORCE_DWORD = 0x7fffffff From 4537e63b8abfc7e04c5ffeb07cfb0981b2c0e75d Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 7 Nov 2024 14:36:58 -0500 Subject: [PATCH 0933/2542] d3dx10: Use shared code in load_texture_data() when possible. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 2 +- dlls/d3dx10_43/texture.c | 159 +++++++++++++++++++++++++++++++--- dlls/d3dx9_36/d3dx9_private.h | 11 +-- dlls/d3dx9_36/d3dx_helpers.c | 6 +- dlls/d3dx9_36/d3dx_helpers.h | 23 +++++ dlls/d3dx9_36/texture.c | 4 +- 6 files changed, 179 insertions(+), 26 deletions(-) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index c7634f85dce6..3c39f69c2f31 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -1579,7 +1579,7 @@ static void check_texture2d_data(ID3D10Texture2D *texture, const struct test_ima { line_match = !memcmp(expected_data + stride * i, (BYTE *)map.pData + map.RowPitch * i, stride); - todo_wine_if(is_block_compressed(image->expected_info.Format) + todo_wine_if(is_block_compressed(image->expected_info.Format) && image->data != test_dds_dxt5 && (image->expected_info.Width % 4 != 0 || image->expected_info.Height % 4 != 0)) ok_(__FILE__, line)(line_match, "Data mismatch for line %u, array slice %u.\n", i, array_slice); if (!line_match) diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index a0bb23f6dc84..25209476b374 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -856,6 +856,123 @@ static HRESULT convert_image(IWICImagingFactory *factory, IWICBitmapFrameDecode return hr; } +static HRESULT d3dx_load_texture_data(struct d3dx_image *image, D3DX10_IMAGE_LOAD_INFO *load_info, + const D3DX10_IMAGE_INFO *img_info, D3D10_SUBRESOURCE_DATA **resource_data) +{ + const struct pixel_format_desc *fmt_desc, *src_desc; + D3DX10_IMAGE_LOAD_INFO tmp_load_info = *load_info; + uint32_t i, j, pixels_size, pixels_offset; + uint8_t *res_data = NULL, *pixels_buffer; + HRESULT hr = S_OK; + + if (img_info->ImageFileFormat == D3DX10_IFF_BMP) + return E_NOTIMPL; + + if (FAILED(hr = d3dx_handle_filter(&tmp_load_info.Filter))) + { + ERR("Invalid filter argument %#x.\n", tmp_load_info.Filter); + return hr; + } + + if (tmp_load_info.Format == D3DX10_DEFAULT || tmp_load_info.Format == DXGI_FORMAT_FROM_FILE) + tmp_load_info.Format = img_info->Format; + fmt_desc = get_d3dx_pixel_format_info(d3dx_pixel_format_id_from_dxgi_format(tmp_load_info.Format)); + if (fmt_desc->format == D3DX_PIXEL_FORMAT_COUNT) + { + FIXME("Unknown DXGI format supplied, %#x.\n", tmp_load_info.Format); + return E_NOTIMPL; + } + + /* Potentially round up width/height to align with block size. */ + if (!tmp_load_info.Width || tmp_load_info.Width == D3DX10_FROM_FILE || tmp_load_info.Width == D3DX10_DEFAULT) + tmp_load_info.Width = (img_info->Width + fmt_desc->block_width - 1) & ~(fmt_desc->block_width - 1); + if (!tmp_load_info.Height || tmp_load_info.Height == D3DX10_FROM_FILE || tmp_load_info.Height == D3DX10_DEFAULT) + tmp_load_info.Height = (img_info->Height + fmt_desc->block_height - 1) & ~(fmt_desc->block_height - 1); + + if (!tmp_load_info.Depth || tmp_load_info.Depth == D3DX10_FROM_FILE || tmp_load_info.Depth == D3DX10_DEFAULT) + tmp_load_info.Depth = img_info->Depth; + if ((tmp_load_info.Depth > 1) && (img_info->ResourceDimension != D3D10_RESOURCE_DIMENSION_TEXTURE3D)) + return E_FAIL; + + if (load_info->MipLevels != D3DX10_DEFAULT) + FIXME("load_info->MipLevels argument ignored.\n"); + tmp_load_info.MipLevels = img_info->MipLevels; + + pixels_size = d3dx_calculate_layer_pixels_size(fmt_desc->format, tmp_load_info.Width, tmp_load_info.Height, + tmp_load_info.Depth, tmp_load_info.MipLevels) * img_info->ArraySize; + pixels_offset = (sizeof(**resource_data) * tmp_load_info.MipLevels * img_info->ArraySize); + if (!(res_data = malloc(pixels_size + pixels_offset))) + return E_FAIL; + + pixels_buffer = res_data + pixels_offset; + *resource_data = (D3D10_SUBRESOURCE_DATA *)res_data; + + src_desc = get_d3dx_pixel_format_info(image->format); + for (i = 0; i < img_info->ArraySize; ++i) + { + struct volume dst_size = { tmp_load_info.Width, tmp_load_info.Height, tmp_load_info.Depth }; + + for (j = 0; j < tmp_load_info.MipLevels; ++j) + { + const RECT unaligned_rect = { 0, 0, dst_size.width, dst_size.height }; + struct d3dx_pixels src_pixels, dst_pixels; + uint32_t dst_row_pitch, dst_slice_pitch; + + hr = d3dx_image_get_pixels(image, i, j, &src_pixels); + if (FAILED(hr)) + break; + + hr = d3dx_calculate_pixels_size(fmt_desc->format, dst_size.width, dst_size.height, &dst_row_pitch, + &dst_slice_pitch); + if (FAILED(hr)) + break; + + set_d3dx_pixels(&dst_pixels, pixels_buffer, dst_row_pitch, dst_slice_pitch, NULL, dst_size.width, + dst_size.height, dst_size.depth, &unaligned_rect); + + hr = d3dx_load_pixels_from_pixels(&dst_pixels, fmt_desc, &src_pixels, src_desc, tmp_load_info.Filter, 0); + if (FAILED(hr)) + break; + + (*resource_data)[i * tmp_load_info.MipLevels + j].pSysMem = pixels_buffer; + (*resource_data)[i * tmp_load_info.MipLevels + j].SysMemPitch = dst_row_pitch; + (*resource_data)[i * tmp_load_info.MipLevels + j].SysMemSlicePitch = dst_slice_pitch; + + pixels_buffer += dst_slice_pitch * dst_size.depth; + d3dx_get_next_mip_level_size(&dst_size); + } + } + + if (FAILED(hr)) + { + *resource_data = NULL; + free(res_data); + return hr; + } + + if (load_info->FirstMipLevel != D3DX10_DEFAULT && load_info->FirstMipLevel) + FIXME("load_info->FirstMipLevel is ignored.\n"); + if (load_info->Usage != D3DX10_DEFAULT) + FIXME("load_info->Usage is ignored.\n"); + if (load_info->BindFlags != D3DX10_DEFAULT) + FIXME("load_info->BindFlags is ignored.\n"); + if (load_info->CpuAccessFlags != D3DX10_DEFAULT) + FIXME("load_info->CpuAccessFlags is ignored.\n"); + if (load_info->MiscFlags != D3DX10_DEFAULT) + FIXME("load_info->MiscFlags is ignored.\n"); + if (load_info->MipFilter != D3DX10_DEFAULT) + FIXME("load_info->MipFilter is ignored.\n"); + if (load_info->pSrcInfo) + FIXME("load_info->pSrcInfo is ignored.\n"); + *load_info = tmp_load_info; + load_info->Usage = D3D10_USAGE_DEFAULT; + load_info->BindFlags = D3D10_BIND_SHADER_RESOURCE; + load_info->CpuAccessFlags = 0; + load_info->MiscFlags = img_info->MiscFlags; + + return S_OK; +} + HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO *load_info, D3D10_SUBRESOURCE_DATA **resource_data) { @@ -868,9 +985,40 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO BYTE *res_data = NULL, *buffer; D3DX10_IMAGE_INFO img_info; IWICStream *stream = NULL; + struct d3dx_image image; const GUID *dst_format; HRESULT hr; + if (!data || !size) + return E_FAIL; + + hr = d3dx_image_init(data, size, &image, 0, D3DX_IMAGE_SUPPORT_DXT10); + if (FAILED(hr)) + return E_FAIL; + + hr = d3dx10_image_info_from_d3dx_image(&img_info, &image); + if (FAILED(hr)) + { + WARN("Invalid or unsupported image file, hr %#lx.\n", hr); + hr = E_FAIL; + goto end; + } + + if ((!(img_info.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE) || img_info.ArraySize != 6) + && img_info.ArraySize != 1) + { + FIXME("img_info.ArraySize = %u not supported.\n", img_info.ArraySize); + hr = E_NOTIMPL; + goto end; + } + + if (SUCCEEDED(hr = d3dx_load_texture_data(&image, load_info, &img_info, resource_data))) + { + TRACE("Successfully used shared code to load texture data.\n"); + res_data = NULL; + goto end; + } + if (load_info->Width != D3DX10_DEFAULT) FIXME("load_info->Width is ignored.\n"); if (load_info->Height != D3DX10_DEFAULT) @@ -898,16 +1046,6 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO if (load_info->pSrcInfo) FIXME("load_info->pSrcInfo is ignored.\n"); - if (FAILED(D3DX10GetImageInfoFromMemory(data, size, NULL, &img_info, NULL))) - return E_FAIL; - if ((!(img_info.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE) || img_info.ArraySize != 6) - && img_info.ArraySize != 1) - { - FIXME("img_info.ArraySize = %u not supported.\n", img_info.ArraySize); - return E_NOTIMPL; - } - - if (FAILED(hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory))) goto end; if (FAILED(hr = IWICImagingFactory_CreateStream(factory, &stream))) @@ -1045,6 +1183,7 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO hr = S_OK; end: + d3dx_image_cleanup(&image); if (dds_decoder) IWICDdsDecoder_Release(dds_decoder); if (dds_frame) diff --git a/dlls/d3dx9_36/d3dx9_private.h b/dlls/d3dx9_36/d3dx9_private.h index fdc247f7aa16..98d01999e36d 100644 --- a/dlls/d3dx9_36/d3dx9_private.h +++ b/dlls/d3dx9_36/d3dx9_private.h @@ -31,21 +31,12 @@ #define FOURCC_TX_1 0x54580100 -#define D3DX9_FILTER_INVALID_BITS 0xff80fff8 -static inline HRESULT d3dx9_validate_filter(uint32_t filter) -{ - if ((filter & D3DX9_FILTER_INVALID_BITS) || !(filter & 0x7) || ((filter & 0x7) > D3DX_FILTER_BOX)) - return D3DERR_INVALIDCALL; - - return D3D_OK; -} - static inline HRESULT d3dx9_handle_load_filter(DWORD *filter) { if (*filter == D3DX_DEFAULT) *filter = D3DX_FILTER_TRIANGLE | D3DX_FILTER_DITHER; - return d3dx9_validate_filter(*filter); + return d3dx_validate_filter(*filter); } struct d3dx_include_from_file diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index e5a58a40455a..9350c4167976 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -346,7 +346,7 @@ HRESULT dds_pixel_format_from_d3dx_pixel_format_id(struct dds_pixel_format *pixe return S_OK; } -static enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dxgi_format(DXGI_FORMAT format) +enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dxgi_format(DXGI_FORMAT format) { switch (format) { @@ -390,7 +390,7 @@ static enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dxgi_format(DXGI_FORM } } -static void d3dx_get_next_mip_level_size(struct volume *size) +void d3dx_get_next_mip_level_size(struct volume *size) { size->width = max(size->width / 2, 1); size->height = max(size->height / 2, 1); @@ -404,7 +404,7 @@ static const char *debug_volume(const struct volume *volume) return wine_dbg_sprintf("(%ux%ux%u)", volume->width, volume->height, volume->depth); } -static HRESULT d3dx_calculate_pixels_size(enum d3dx_pixel_format_id format, uint32_t width, uint32_t height, +HRESULT d3dx_calculate_pixels_size(enum d3dx_pixel_format_id format, uint32_t width, uint32_t height, uint32_t *pitch, uint32_t *size) { const struct pixel_format_desc *format_desc = get_d3dx_pixel_format_info(format); diff --git a/dlls/d3dx9_36/d3dx_helpers.h b/dlls/d3dx9_36/d3dx_helpers.h index 6724cf5b1242..8ae5c65f30da 100644 --- a/dlls/d3dx9_36/d3dx_helpers.h +++ b/dlls/d3dx9_36/d3dx_helpers.h @@ -43,6 +43,8 @@ #define D3DERR_INVALIDCALL 0x8876086c #define D3DX_ERROR_INVALID_DATA D3DX10_ERR_INVALID_DATA +#define D3DX_DEFAULT D3DX10_DEFAULT + #define D3DX_FILTER_NONE D3DX10_FILTER_NONE #define D3DX_FILTER_POINT D3DX10_FILTER_POINT #define D3DX_FILTER_LINEAR D3DX10_FILTER_LINEAR @@ -63,8 +65,26 @@ #define d3dx_blob_get_buffer_pointer(blob) ID3D10Blob_GetBufferPointer(blob) #define d3dx_blob_release(blob) ID3D10Blob_Release(blob) +enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dxgi_format(DXGI_FORMAT format); #endif /* D3DX_D3D_VERSION == 10 */ +#define D3DX_FILTER_INVALID_BITS 0xff80fff8 +static inline HRESULT d3dx_validate_filter(uint32_t filter) +{ + if ((filter & D3DX_FILTER_INVALID_BITS) || !(filter & 0x7) || ((filter & 0x7) > D3DX_FILTER_BOX)) + return D3DERR_INVALIDCALL; + + return S_OK; +} + +static inline HRESULT d3dx_handle_filter(UINT *filter) +{ + if (*filter == D3DX_DEFAULT) + *filter = D3DX_FILTER_TRIANGLE | D3DX_FILTER_DITHER; + + return d3dx_validate_filter(*filter); +} + #ifndef MAKEFOURCC #define MAKEFOURCC(ch0, ch1, ch2, ch3) \ ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ @@ -452,6 +472,9 @@ void format_to_d3dx_color(const struct pixel_format_desc *format, const BYTE *sr struct d3dx_color *dst); void format_from_d3dx_color(const struct pixel_format_desc *format, const struct d3dx_color *src, BYTE *dst); +void d3dx_get_next_mip_level_size(struct volume *size); +HRESULT d3dx_calculate_pixels_size(enum d3dx_pixel_format_id format, uint32_t width, uint32_t height, + uint32_t *pitch, uint32_t *size); uint32_t d3dx_calculate_layer_pixels_size(enum d3dx_pixel_format_id format, uint32_t width, uint32_t height, uint32_t depth, uint32_t mip_levels); HRESULT d3dx_init_dds_header(struct dds_header *header, enum d3dx_resource_type resource_type, diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index 6a8013d09e7f..a6abc571d196 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -59,7 +59,7 @@ HRESULT WINAPI D3DXFilterTexture(IDirect3DBaseTexture9 *texture, if (!texture) return D3DERR_INVALIDCALL; - if (filter != D3DX_DEFAULT && FAILED(hr = d3dx9_validate_filter(filter))) + if (filter != D3DX_DEFAULT && FAILED(hr = d3dx_validate_filter(filter))) return hr; if (srclevel == D3DX_DEFAULT) @@ -567,7 +567,7 @@ static D3DFORMAT get_alpha_replacement_format(D3DFORMAT format) static uint32_t d3dx9_get_mip_filter_value(uint32_t mip_filter, uint32_t *skip_levels) { - uint32_t filter = (mip_filter == D3DX_DEFAULT) ? D3DX_FILTER_BOX : mip_filter & ~D3DX9_FILTER_INVALID_BITS; + uint32_t filter = (mip_filter == D3DX_DEFAULT) ? D3DX_FILTER_BOX : mip_filter & ~D3DX_FILTER_INVALID_BITS; *skip_levels = mip_filter != D3DX_DEFAULT ? mip_filter >> D3DX_SKIP_DDS_MIP_LEVELS_SHIFT : 0; *skip_levels &= D3DX_SKIP_DDS_MIP_LEVELS_MASK; From b195279b4f6c14b88faa1c10a5e37df12b0bd0da Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 8 Nov 2024 10:19:33 -0500 Subject: [PATCH 0934/2542] d3dx9/tests: Add tests for D3DX_FILTER_SRGB flags. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/tests/surface.c | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index ece8d323687d..6beece3d78a0 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -2555,6 +2555,50 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device) hr = IDirect3DSurface9_UnlockRect(surf); ok(hr == D3D_OK, "Failed to unlock surface, hr %#lx.\n", hr); + /* Test SRGB filter flags. */ + SetRect(&rect, 0, 0, 2, 2); + hr = D3DXLoadSurfaceFromMemory(surf, NULL, NULL, pixdata_a8r8g8b8, D3DFMT_A8R8G8B8, 8, NULL, &rect, + D3DX_FILTER_NONE | D3DX_FILTER_SRGB_IN, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + /* SRGB in, no SRGB out. */ + hr = IDirect3DSurface9_LockRect(surf, &lockrect, NULL, D3DLOCK_READONLY); + ok(hr == D3D_OK, "Failed to lock surface, hr %#lx.\n", hr); + todo_wine check_pixel_4bpp_diff(&lockrect, 0, 0, 0x00010306, 2); + todo_wine check_pixel_4bpp_diff(&lockrect, 1, 0, 0x40141e2a, 2); + todo_wine check_pixel_4bpp_diff(&lockrect, 0, 1, 0x80495b71, 2); + todo_wine check_pixel_4bpp_diff(&lockrect, 1, 1, 0xc0a3c0ff, 2); + hr = IDirect3DSurface9_UnlockRect(surf); + ok(hr == D3D_OK, "Failed to unlock surface, hr %#lx.\n", hr); + + hr = D3DXLoadSurfaceFromMemory(surf, NULL, NULL, pixdata_a8r8g8b8, D3DFMT_A8R8G8B8, 8, NULL, &rect, + D3DX_FILTER_NONE | D3DX_FILTER_SRGB_OUT, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + /* No SRGB in, SRGB out. */ + hr = IDirect3DSurface9_LockRect(surf, &lockrect, NULL, D3DLOCK_READONLY); + ok(hr == D3D_OK, "Failed to lock surface, hr %#lx.\n", hr); + todo_wine check_pixel_4bpp_diff(&lockrect, 0, 0, 0x00486377, 2); + todo_wine check_pixel_4bpp_diff(&lockrect, 1, 0, 0x4097a4af, 2); + todo_wine check_pixel_4bpp_diff(&lockrect, 0, 1, 0x80c5ced7, 2); + todo_wine check_pixel_4bpp_diff(&lockrect, 1, 1, 0xc0e8f0ff, 2); + hr = IDirect3DSurface9_UnlockRect(surf); + ok(hr == D3D_OK, "Failed to unlock surface, hr %#lx.\n", hr); + + hr = D3DXLoadSurfaceFromMemory(surf, NULL, NULL, pixdata_a8r8g8b8, D3DFMT_A8R8G8B8, 8, NULL, &rect, + D3DX_FILTER_NONE | D3DX_FILTER_SRGB_IN | D3DX_FILTER_SRGB_OUT, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + /* SRGB in, SRGB out, no changes. */ + hr = IDirect3DSurface9_LockRect(surf, &lockrect, NULL, D3DLOCK_READONLY); + ok(hr == D3D_OK, "Failed to lock surface, hr %#lx.\n", hr); + check_pixel_4bpp_diff(&lockrect, 0, 0, pixdata_a8r8g8b8[0], 0); + check_pixel_4bpp_diff(&lockrect, 1, 0, pixdata_a8r8g8b8[1], 0); + check_pixel_4bpp_diff(&lockrect, 0, 1, pixdata_a8r8g8b8[2], 0); + check_pixel_4bpp_diff(&lockrect, 1, 1, pixdata_a8r8g8b8[3], 0); + hr = IDirect3DSurface9_UnlockRect(surf); + ok(hr == D3D_OK, "Failed to unlock surface, hr %#lx.\n", hr); + check_release((IUnknown*)surf, 0); } From c7f407e9911ab4c29c1f88ef2909673c5fa69c30 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 8 Nov 2024 10:21:18 -0500 Subject: [PATCH 0935/2542] d3dx9: Handle D3DX_FILTER_SRGB flags. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/d3dx_helpers.c | 35 ++++++++++++++++++++++++++++++++--- dlls/d3dx9_36/d3dx_helpers.h | 2 ++ dlls/d3dx9_36/tests/surface.c | 16 ++++++++-------- 3 files changed, 42 insertions(+), 11 deletions(-) diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index 9350c4167976..af00a6fbee16 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -1896,6 +1896,20 @@ static void undo_premultiplied_alpha(struct vec4 *vec) vec->z = (vec->w == 0.0f) ? 0.0f : vec->z / vec->w; } +static void vec4_to_sRGB(struct vec4 *vec) +{ + vec->x = (vec->x <= 0.0031308f) ? (12.92f * vec->x) : (1.055f * powf(vec->x, 1.0f / 2.4f) - 0.055f); + vec->y = (vec->y <= 0.0031308f) ? (12.92f * vec->y) : (1.055f * powf(vec->y, 1.0f / 2.4f) - 0.055f); + vec->z = (vec->z <= 0.0031308f) ? (12.92f * vec->z) : (1.055f * powf(vec->z, 1.0f / 2.4f) - 0.055f); +} + +static void vec4_from_sRGB(struct vec4 *vec) +{ + vec->x = (vec->x <= 0.04045f) ? vec->x / 12.92f : powf((vec->x + 0.055f) / 1.055f, 2.4f); + vec->y = (vec->y <= 0.04045f) ? vec->y / 12.92f : powf((vec->y + 0.055f) / 1.055f, 2.4f); + vec->z = (vec->z <= 0.04045f) ? vec->z / 12.92f : powf((vec->z + 0.055f) / 1.055f, 2.4f); +} + /* It doesn't work for components bigger than 32 bits (or somewhat smaller but unaligned). */ void format_to_d3dx_color(const struct pixel_format_desc *format, const BYTE *src, const PALETTEENTRY *palette, struct d3dx_color *dst) @@ -2106,7 +2120,7 @@ static void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_sl { struct argb_conversion_info conv_info, ck_conv_info; const struct pixel_format_desc *ck_format; - BOOL src_pma, dst_pma; + BOOL src_pma, dst_pma, src_srgb, dst_srgb; DWORD channels[4]; UINT min_width, min_height, min_depth; UINT x, y, z; @@ -2121,6 +2135,8 @@ static void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_sl src_pma = !!(filter_flags & D3DX_FILTER_PMA_IN); dst_pma = !!(filter_flags & D3DX_FILTER_PMA_OUT); + src_srgb = !!(filter_flags & D3DX_FILTER_SRGB_IN); + dst_srgb = !!(filter_flags & D3DX_FILTER_SRGB_OUT); min_width = min(src_size->width, dst_size->width); min_height = min(src_size->height, dst_size->height); min_depth = min(src_size->depth, dst_size->depth); @@ -2167,6 +2183,8 @@ static void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_sl format_to_d3dx_color(src_format, src_ptr, palette, &color); if (src_pma && src_pma != dst_pma) undo_premultiplied_alpha(&color.value); + if (src_srgb && src_srgb != dst_srgb) + vec4_from_sRGB(&color.value); tmp = color; if (color_key) @@ -2179,6 +2197,8 @@ static void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_sl } color = tmp; + if (dst_srgb && src_srgb != dst_srgb) + vec4_to_sRGB(&color.value); if (dst_pma && src_pma != dst_pma) premultiply_alpha(&color.value); format_from_d3dx_color(dst_format, &color, dst_ptr); @@ -2213,7 +2233,7 @@ static void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT s { struct argb_conversion_info conv_info, ck_conv_info; const struct pixel_format_desc *ck_format; - BOOL src_pma, dst_pma; + BOOL src_pma, dst_pma, src_srgb, dst_srgb; DWORD channels[4]; UINT x, y, z; @@ -2222,6 +2242,8 @@ static void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT s src, src_row_pitch, src_slice_pitch, src_size, src_format, dst, dst_row_pitch, dst_slice_pitch, dst_size, dst_format, color_key, palette); + src_srgb = !!(filter_flags & D3DX_FILTER_SRGB_IN); + dst_srgb = !!(filter_flags & D3DX_FILTER_SRGB_OUT); src_pma = !!(filter_flags & D3DX_FILTER_PMA_IN); dst_pma = !!(filter_flags & D3DX_FILTER_PMA_OUT); ZeroMemory(channels, sizeof(channels)); @@ -2274,6 +2296,8 @@ static void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT s format_to_d3dx_color(src_format, src_ptr, palette, &color); if (src_pma && src_pma != dst_pma) undo_premultiplied_alpha(&color.value); + if (src_srgb && src_srgb != dst_srgb) + vec4_from_sRGB(&color.value); tmp = color; if (color_key) @@ -2286,6 +2310,8 @@ static void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT s } color = tmp; + if (dst_srgb && src_srgb != dst_srgb) + vec4_to_sRGB(&color.value); if (dst_pma && src_pma != dst_pma) premultiply_alpha(&color.value); format_from_d3dx_color(dst_format, &color, dst_ptr); @@ -2634,7 +2660,7 @@ HRESULT d3dx_load_pixels_from_pixels(struct d3dx_pixels *dst_pixels, const struct pixel_format_desc *src_desc, uint32_t filter_flags, uint32_t color_key) { struct volume src_size, dst_size, dst_size_aligned; - BOOL src_pma, dst_pma; + BOOL src_pma, dst_pma, src_srgb, dst_srgb; HRESULT hr = S_OK; TRACE("dst_pixels %s, dst_desc %p, src_pixels %s, src_desc %p, filter_flags %#x, color_key %#x.\n", @@ -2647,6 +2673,8 @@ HRESULT d3dx_load_pixels_from_pixels(struct d3dx_pixels *dst_pixels, if (dst_desc->flags & FMT_FLAG_PM_ALPHA) filter_flags |= D3DX_FILTER_PMA_OUT; + src_srgb = !!(filter_flags & D3DX_FILTER_SRGB_IN); + dst_srgb = !!(filter_flags & D3DX_FILTER_SRGB_OUT); src_pma = !!(filter_flags & D3DX_FILTER_PMA_IN); dst_pma = !!(filter_flags & D3DX_FILTER_PMA_OUT); @@ -2669,6 +2697,7 @@ HRESULT d3dx_load_pixels_from_pixels(struct d3dx_pixels *dst_pixels, && (dst_size.height == src_size.height && !(dst_size.height % dst_desc->block_height)) && (dst_size.depth == src_size.depth) && (src_pma == dst_pma) + && (src_srgb == dst_srgb) && color_key == 0 && !(src_pixels->unaligned_rect.left & (src_desc->block_width - 1)) && !(src_pixels->unaligned_rect.top & (src_desc->block_height - 1)) diff --git a/dlls/d3dx9_36/d3dx_helpers.h b/dlls/d3dx9_36/d3dx_helpers.h index 8ae5c65f30da..bfa2fafcaf1b 100644 --- a/dlls/d3dx9_36/d3dx_helpers.h +++ b/dlls/d3dx9_36/d3dx_helpers.h @@ -450,6 +450,8 @@ static inline BOOL filter_flags_match(uint32_t filter_flags) { if (!!(filter_flags & D3DX_FILTER_PMA_IN) != !!((filter_flags & D3DX_FILTER_PMA_OUT))) return FALSE; + if (!!(filter_flags & D3DX_FILTER_SRGB_IN) != !!((filter_flags & D3DX_FILTER_SRGB_OUT))) + return FALSE; return TRUE; } diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 6beece3d78a0..7ce268ceeafb 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -2564,10 +2564,10 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device) /* SRGB in, no SRGB out. */ hr = IDirect3DSurface9_LockRect(surf, &lockrect, NULL, D3DLOCK_READONLY); ok(hr == D3D_OK, "Failed to lock surface, hr %#lx.\n", hr); - todo_wine check_pixel_4bpp_diff(&lockrect, 0, 0, 0x00010306, 2); - todo_wine check_pixel_4bpp_diff(&lockrect, 1, 0, 0x40141e2a, 2); - todo_wine check_pixel_4bpp_diff(&lockrect, 0, 1, 0x80495b71, 2); - todo_wine check_pixel_4bpp_diff(&lockrect, 1, 1, 0xc0a3c0ff, 2); + check_pixel_4bpp_diff(&lockrect, 0, 0, 0x00010306, 2); + check_pixel_4bpp_diff(&lockrect, 1, 0, 0x40141e2a, 2); + check_pixel_4bpp_diff(&lockrect, 0, 1, 0x80495b71, 2); + check_pixel_4bpp_diff(&lockrect, 1, 1, 0xc0a3c0ff, 2); hr = IDirect3DSurface9_UnlockRect(surf); ok(hr == D3D_OK, "Failed to unlock surface, hr %#lx.\n", hr); @@ -2578,10 +2578,10 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device) /* No SRGB in, SRGB out. */ hr = IDirect3DSurface9_LockRect(surf, &lockrect, NULL, D3DLOCK_READONLY); ok(hr == D3D_OK, "Failed to lock surface, hr %#lx.\n", hr); - todo_wine check_pixel_4bpp_diff(&lockrect, 0, 0, 0x00486377, 2); - todo_wine check_pixel_4bpp_diff(&lockrect, 1, 0, 0x4097a4af, 2); - todo_wine check_pixel_4bpp_diff(&lockrect, 0, 1, 0x80c5ced7, 2); - todo_wine check_pixel_4bpp_diff(&lockrect, 1, 1, 0xc0e8f0ff, 2); + check_pixel_4bpp_diff(&lockrect, 0, 0, 0x00486377, 2); + check_pixel_4bpp_diff(&lockrect, 1, 0, 0x4097a4af, 2); + check_pixel_4bpp_diff(&lockrect, 0, 1, 0x80c5ced7, 2); + check_pixel_4bpp_diff(&lockrect, 1, 1, 0xc0e8f0ff, 2); hr = IDirect3DSurface9_UnlockRect(surf); ok(hr == D3D_OK, "Failed to unlock surface, hr %#lx.\n", hr); From 26f0f87578b83ceafc0e7132081eb2cd19d86b7a Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 8 Nov 2024 10:28:01 -0500 Subject: [PATCH 0936/2542] d3dx: Add support for decompressing BC4 and BC5 formats. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/texture.c | 1 + dlls/d3dx9_36/d3dx_helpers.c | 28 ++++++++++++++++++++++++++++ dlls/d3dx9_36/d3dx_helpers.h | 1 + 3 files changed, 30 insertions(+) diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 25209476b374..facf69391ae8 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -113,6 +113,7 @@ static DXGI_FORMAT dxgi_format_from_d3dx_pixel_format_id(enum d3dx_pixel_format_ case D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM: return DXGI_FORMAT_R10G10B10A2_UNORM; case D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM: return DXGI_FORMAT_R16G16B16A16_UNORM; case D3DX_PIXEL_FORMAT_R8_UNORM: return DXGI_FORMAT_R8_UNORM; + case D3DX_PIXEL_FORMAT_R8_SNORM: return DXGI_FORMAT_R8_SNORM; case D3DX_PIXEL_FORMAT_R8G8_UNORM: return DXGI_FORMAT_R8G8_UNORM; case D3DX_PIXEL_FORMAT_R16_UNORM: return DXGI_FORMAT_R16_UNORM; case D3DX_PIXEL_FORMAT_R16G16_UNORM: return DXGI_FORMAT_R16G16_UNORM; diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index af00a6fbee16..051286fa7d61 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -60,6 +60,7 @@ static const struct pixel_format_desc formats[] = {D3DX_PIXEL_FORMAT_R16G16B16_UNORM, { 0, 16, 16, 16}, { 0, 0, 16, 32}, 6, 1, 1, 6, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_INTERNAL}, {D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM, {16, 16, 16, 16}, {48, 0, 16, 32}, 8, 1, 1, 8, CTYPE_UNORM, CTYPE_UNORM, 0 }, {D3DX_PIXEL_FORMAT_R8_UNORM, { 0, 8, 0, 0}, { 0, 0, 0, 0}, 1, 1, 1, 1, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_DXGI}, + {D3DX_PIXEL_FORMAT_R8_SNORM, { 0, 8, 0, 0}, { 0, 0, 0, 0}, 1, 1, 1, 1, CTYPE_EMPTY, CTYPE_SNORM, FMT_FLAG_DXGI}, {D3DX_PIXEL_FORMAT_R8G8_UNORM, { 0, 8, 8, 0}, { 0, 0, 8, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_DXGI}, {D3DX_PIXEL_FORMAT_R16_UNORM, { 0, 16, 0, 0}, { 0, 0, 0, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_DXGI}, {D3DX_PIXEL_FORMAT_R16G16_UNORM, { 0, 16, 16, 0}, { 0, 0, 16, 0}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, 0 }, @@ -359,6 +360,7 @@ enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dxgi_format(DXGI_FORMAT form case DXGI_FORMAT_R10G10B10A2_UNORM: return D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM; case DXGI_FORMAT_R16G16B16A16_UNORM: return D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM; case DXGI_FORMAT_R8_UNORM: return D3DX_PIXEL_FORMAT_R8_UNORM; + case DXGI_FORMAT_R8_SNORM: return D3DX_PIXEL_FORMAT_R8_SNORM; case DXGI_FORMAT_R8G8_UNORM: return D3DX_PIXEL_FORMAT_R8G8_UNORM; case DXGI_FORMAT_R16_UNORM: return D3DX_PIXEL_FORMAT_R16_UNORM; case DXGI_FORMAT_R16G16_UNORM: return D3DX_PIXEL_FORMAT_R16G16_UNORM; @@ -2357,6 +2359,16 @@ static void d3dx_init_bcn_decompression_context(struct d3dx_bcn_decompression_co context->decompress_bcn_block = bcdec_bc3; break; + case D3DX_PIXEL_FORMAT_BC4_UNORM: + case D3DX_PIXEL_FORMAT_BC4_SNORM: + context->decompress_bcn_block = bcdec_bc4; + break; + + case D3DX_PIXEL_FORMAT_BC5_UNORM: + case D3DX_PIXEL_FORMAT_BC5_SNORM: + context->decompress_bcn_block = bcdec_bc5; + break; + default: assert(0); break; @@ -2422,6 +2434,22 @@ static HRESULT d3dx_pixels_decompress(struct d3dx_pixels *pixels, const struct p uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); break; + case D3DX_PIXEL_FORMAT_BC4_UNORM: + uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8_UNORM); + break; + + case D3DX_PIXEL_FORMAT_BC4_SNORM: + uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8_SNORM); + break; + + case D3DX_PIXEL_FORMAT_BC5_UNORM: + uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8_UNORM); + break; + + case D3DX_PIXEL_FORMAT_BC5_SNORM: + uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8_SNORM); + break; + default: FIXME("Unexpected compressed texture format %u.\n", desc->format); return E_NOTIMPL; diff --git a/dlls/d3dx9_36/d3dx_helpers.h b/dlls/d3dx9_36/d3dx_helpers.h index bfa2fafcaf1b..a415a32d87d9 100644 --- a/dlls/d3dx9_36/d3dx_helpers.h +++ b/dlls/d3dx9_36/d3dx_helpers.h @@ -260,6 +260,7 @@ enum d3dx_pixel_format_id D3DX_PIXEL_FORMAT_R16G16B16_UNORM, D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM, D3DX_PIXEL_FORMAT_R8_UNORM, + D3DX_PIXEL_FORMAT_R8_SNORM, D3DX_PIXEL_FORMAT_R8G8_UNORM, D3DX_PIXEL_FORMAT_R16_UNORM, D3DX_PIXEL_FORMAT_R16G16_UNORM, From bed2c4536bf34573318fcfc5a23888c89466099b Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 8 Nov 2024 10:31:54 -0500 Subject: [PATCH 0937/2542] d3dx: Add support for compressing BC4 and BC5 formats. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/d3dx_helpers.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index 051286fa7d61..a2854b2161cc 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -2576,6 +2576,28 @@ static void d3dx_compress_bc3_block(const void *src_data, uint32_t src_row_pitch stb_compress_dxt_block(dst_data, (const uint8_t *)tmp_buf, TRUE, 0); } +static void d3dx_compress_bc4_block(const void *src_data, uint32_t src_row_pitch, uint8_t src_width, uint8_t src_height, + void *dst_data) +{ + const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8_UNORM); + uint8_t tmp_buf[4 * 4]; + + d3dx_init_bcn_block_buffer(src_data, src_row_pitch, src_width, src_height, fmt_desc, tmp_buf); + + stb_compress_bc4_block(dst_data, (const unsigned char *)tmp_buf); +} + +static void d3dx_compress_bc5_block(const void *src_data, uint32_t src_row_pitch, uint8_t src_width, uint8_t src_height, + void *dst_data) +{ + const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8_UNORM); + uint8_t tmp_buf[4 * 4 * 2]; + + d3dx_init_bcn_block_buffer(src_data, src_row_pitch, src_width, src_height, fmt_desc, tmp_buf); + + stb_compress_bc5_block(dst_data, (const unsigned char *)tmp_buf); +} + static HRESULT d3dx_pixels_compress(struct d3dx_pixels *src_pixels, const struct pixel_format_desc *src_desc, struct d3dx_pixels *dst_pixels, const struct pixel_format_desc *dst_desc) @@ -2600,6 +2622,16 @@ static HRESULT d3dx_pixels_compress(struct d3dx_pixels *src_pixels, compress_bcn_block = d3dx_compress_bc3_block; break; + case D3DX_PIXEL_FORMAT_BC4_UNORM: + case D3DX_PIXEL_FORMAT_BC4_SNORM: + compress_bcn_block = d3dx_compress_bc4_block; + break; + + case D3DX_PIXEL_FORMAT_BC5_UNORM: + case D3DX_PIXEL_FORMAT_BC5_SNORM: + compress_bcn_block = d3dx_compress_bc5_block; + break; + default: FIXME("Unexpected compressed texture format %u.\n", dst_desc->format); return E_NOTIMPL; From d2fd2144ff976655d610d24a0cef00b13bf113e4 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 8 Aug 2024 09:06:03 -0400 Subject: [PATCH 0938/2542] d3dx10: Exclusively use shared code to load DDS files in load_texture_data(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/texture.c | 170 ++++++--------------------------------- 1 file changed, 26 insertions(+), 144 deletions(-) diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index facf69391ae8..d02218e3052b 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -788,32 +788,6 @@ void init_load_info(const D3DX10_IMAGE_LOAD_INFO *load_info, D3DX10_IMAGE_LOAD_I out->pSrcInfo = NULL; } -static HRESULT dds_get_frame_info(IWICDdsFrameDecode *frame, const D3DX10_IMAGE_INFO *img_info, - WICDdsFormatInfo *format_info, unsigned int *stride, unsigned int *frame_size) -{ - unsigned int width, height; - HRESULT hr; - - if (FAILED(hr = IWICDdsFrameDecode_GetFormatInfo(frame, format_info))) - return hr; - if (FAILED(hr = IWICDdsFrameDecode_GetSizeInBlocks(frame, &width, &height))) - return hr; - - if (img_info->Format == format_info->DxgiFormat) - { - *stride = width * format_info->BytesPerBlock; - *frame_size = *stride * height; - } - else - { - width *= format_info->BlockWidth; - height *= format_info->BlockHeight; - *stride = (width * get_bpp_from_format(img_info->Format) + 7) / 8; - *frame_size = *stride * height; - } - return S_OK; -} - static HRESULT convert_image(IWICImagingFactory *factory, IWICBitmapFrameDecode *frame, const GUID *dst_format, unsigned int stride, unsigned int frame_size, BYTE *buffer) { @@ -977,12 +951,10 @@ static HRESULT d3dx_load_texture_data(struct d3dx_image *image, D3DX10_IMAGE_LOA HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO *load_info, D3D10_SUBRESOURCE_DATA **resource_data) { - unsigned int stride, frame_size, i, j; - IWICDdsFrameDecode *dds_frame = NULL; IWICBitmapFrameDecode *frame = NULL; IWICImagingFactory *factory = NULL; - IWICDdsDecoder *dds_decoder = NULL; IWICBitmapDecoder *decoder = NULL; + unsigned int stride, frame_size; BYTE *res_data = NULL, *buffer; D3DX10_IMAGE_INFO img_info; IWICStream *stream = NULL; @@ -1019,6 +991,10 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO res_data = NULL; goto end; } + else if (img_info.ImageFileFormat == D3DX10_IFF_DDS) + { + goto end; + } if (load_info->Width != D3DX10_DEFAULT) FIXME("load_info->Width is ignored.\n"); @@ -1055,122 +1031,32 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO goto end; if (FAILED(hr = IWICImagingFactory_CreateDecoderFromStream(factory, (IStream *)stream, NULL, 0, &decoder))) goto end; + if (FAILED(hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame))) + goto end; - if (img_info.ImageFileFormat == D3DX10_IFF_DDS) - { - WICDdsFormatInfo format_info; - size_t size = 0; - - if (FAILED(hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICDdsDecoder, (void **)&dds_decoder))) - goto end; - - for (i = 0; i < img_info.ArraySize; ++i) - { - for (j = 0; j < img_info.MipLevels; ++j) - { - if (FAILED(hr = IWICDdsDecoder_GetFrame(dds_decoder, i, j, 0, &frame))) - goto end; - if (FAILED(hr = IWICBitmapFrameDecode_QueryInterface(frame, - &IID_IWICDdsFrameDecode, (void **)&dds_frame))) - goto end; - if (FAILED(hr = dds_get_frame_info(dds_frame, &img_info, &format_info, &stride, &frame_size))) - goto end; - - if (!i && !j) - { - img_info.Width = (img_info.Width + format_info.BlockWidth - 1) & ~(format_info.BlockWidth - 1); - img_info.Height = (img_info.Height + format_info.BlockHeight - 1) & ~(format_info.BlockHeight - 1); - } - - size += sizeof(**resource_data) + frame_size; - - IWICDdsFrameDecode_Release(dds_frame); - dds_frame = NULL; - IWICBitmapFrameDecode_Release(frame); - frame = NULL; - } - } + stride = (img_info.Width * get_bpp_from_format(img_info.Format) + 7) / 8; + frame_size = stride * img_info.Height; - if (!(res_data = malloc(size))) - { - hr = E_FAIL; - goto end; - } - *resource_data = (D3D10_SUBRESOURCE_DATA *)res_data; - - size = 0; - for (i = 0; i < img_info.ArraySize; ++i) - { - for (j = 0; j < img_info.MipLevels; ++j) - { - if (FAILED(hr = IWICDdsDecoder_GetFrame(dds_decoder, i, j, 0, &frame))) - goto end; - if (FAILED(hr = IWICBitmapFrameDecode_QueryInterface(frame, - &IID_IWICDdsFrameDecode, (void **)&dds_frame))) - goto end; - if (FAILED(hr = dds_get_frame_info(dds_frame, &img_info, &format_info, &stride, &frame_size))) - goto end; - - buffer = res_data + sizeof(**resource_data) * img_info.ArraySize * img_info.MipLevels + size; - size += frame_size; - - if (img_info.Format == format_info.DxgiFormat) - { - if (FAILED(hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, stride, frame_size, buffer))) - goto end; - } - else - { - if (!(dst_format = dxgi_format_to_wic_guid(img_info.Format))) - { - hr = E_FAIL; - FIXME("Unsupported DXGI format %#x.\n", img_info.Format); - goto end; - } - if (FAILED(hr = convert_image(factory, frame, dst_format, stride, frame_size, buffer))) - goto end; - } - - IWICDdsFrameDecode_Release(dds_frame); - dds_frame = NULL; - IWICBitmapFrameDecode_Release(frame); - frame = NULL; - - (*resource_data)[i * img_info.MipLevels + j].pSysMem = buffer; - (*resource_data)[i * img_info.MipLevels + j].SysMemPitch = stride; - (*resource_data)[i * img_info.MipLevels + j].SysMemSlicePitch = frame_size; - } - } - } - else + if (!(res_data = malloc(sizeof(**resource_data) + frame_size))) { - if (FAILED(hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame))) - goto end; - - stride = (img_info.Width * get_bpp_from_format(img_info.Format) + 7) / 8; - frame_size = stride * img_info.Height; - - if (!(res_data = malloc(sizeof(**resource_data) + frame_size))) - { - hr = E_FAIL; - goto end; - } - buffer = res_data + sizeof(**resource_data); - - if (!(dst_format = dxgi_format_to_wic_guid(img_info.Format))) - { - hr = E_FAIL; - FIXME("Unsupported DXGI format %#x.\n", img_info.Format); - goto end; - } - if (FAILED(hr = convert_image(factory, frame, dst_format, stride, frame_size, buffer))) - goto end; + hr = E_FAIL; + goto end; + } + buffer = res_data + sizeof(**resource_data); - *resource_data = (D3D10_SUBRESOURCE_DATA *)res_data; - (*resource_data)->pSysMem = buffer; - (*resource_data)->SysMemPitch = stride; - (*resource_data)->SysMemSlicePitch = frame_size; + if (!(dst_format = dxgi_format_to_wic_guid(img_info.Format))) + { + hr = E_FAIL; + FIXME("Unsupported DXGI format %#x.\n", img_info.Format); + goto end; } + if (FAILED(hr = convert_image(factory, frame, dst_format, stride, frame_size, buffer))) + goto end; + + *resource_data = (D3D10_SUBRESOURCE_DATA *)res_data; + (*resource_data)->pSysMem = buffer; + (*resource_data)->SysMemPitch = stride; + (*resource_data)->SysMemSlicePitch = frame_size; load_info->Width = img_info.Width; load_info->Height = img_info.Height; @@ -1185,10 +1071,6 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO end: d3dx_image_cleanup(&image); - if (dds_decoder) - IWICDdsDecoder_Release(dds_decoder); - if (dds_frame) - IWICDdsFrameDecode_Release(dds_frame); free(res_data); if (frame) IWICBitmapFrameDecode_Release(frame); From a074f86bbacc01189eea91f4204cdd04d134b813 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 8 Aug 2024 09:54:44 -0400 Subject: [PATCH 0939/2542] d3dx10: Exclusively use shared code in load_texture_data(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/texture.c | 450 +++++------------------------------ dlls/d3dx9_36/d3dx_helpers.c | 3 +- 2 files changed, 65 insertions(+), 388 deletions(-) diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index d02218e3052b..eecb6f90a982 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -22,13 +22,10 @@ #include "d3d10_1.h" #include "d3dx10.h" -#include "wincodec.h" #include "dxhelpers.h" WINE_DEFAULT_DEBUG_CHANNEL(d3dx); -HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT sdk_version, IWICImagingFactory **imaging_factory); - /* * These are mappings from legacy DDS header formats to DXGI formats. Some * don't map to a DXGI_FORMAT at all, and some only map to the default format. @@ -154,179 +151,6 @@ static DXGI_FORMAT dxgi_format_from_d3dx_pixel_format_id(enum d3dx_pixel_format_ } } -static const struct -{ - const GUID *wic_guid; - DXGI_FORMAT dxgi_format; -} -wic_pixel_formats[] = -{ - { &GUID_WICPixelFormatBlackWhite, DXGI_FORMAT_R1_UNORM }, - { &GUID_WICPixelFormat8bppAlpha, DXGI_FORMAT_A8_UNORM }, - { &GUID_WICPixelFormat8bppGray, DXGI_FORMAT_R8_UNORM }, - { &GUID_WICPixelFormat16bppGray, DXGI_FORMAT_R16_UNORM }, - { &GUID_WICPixelFormat16bppGrayHalf, DXGI_FORMAT_R16_FLOAT }, - { &GUID_WICPixelFormat32bppGrayFloat, DXGI_FORMAT_R32_FLOAT }, - { &GUID_WICPixelFormat16bppBGR565, DXGI_FORMAT_B5G6R5_UNORM }, - { &GUID_WICPixelFormat16bppBGRA5551, DXGI_FORMAT_B5G5R5A1_UNORM }, - { &GUID_WICPixelFormat32bppBGR, DXGI_FORMAT_B8G8R8X8_UNORM }, - { &GUID_WICPixelFormat32bppBGRA, DXGI_FORMAT_B8G8R8A8_UNORM }, - { &GUID_WICPixelFormat32bppRGBA, DXGI_FORMAT_R8G8B8A8_UNORM }, - { &GUID_WICPixelFormat32bppRGBA1010102, DXGI_FORMAT_R10G10B10A2_UNORM }, - { &GUID_WICPixelFormat32bppRGBA1010102XR, DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM }, - { &GUID_WICPixelFormat64bppRGBA, DXGI_FORMAT_R16G16B16A16_UNORM }, - { &GUID_WICPixelFormat64bppRGBAHalf, DXGI_FORMAT_R16G16B16A16_FLOAT }, - { &GUID_WICPixelFormat96bppRGBFloat, DXGI_FORMAT_R32G32B32_FLOAT }, - { &GUID_WICPixelFormat128bppRGBAFloat, DXGI_FORMAT_R32G32B32A32_FLOAT } -}; - -static const GUID *dxgi_format_to_wic_guid(DXGI_FORMAT format) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(wic_pixel_formats); ++i) - { - if (wic_pixel_formats[i].dxgi_format == format) - return wic_pixel_formats[i].wic_guid; - } - - return NULL; -} - -static unsigned int get_bpp_from_format(DXGI_FORMAT format) -{ - switch (format) - { - case DXGI_FORMAT_R32G32B32A32_TYPELESS: - case DXGI_FORMAT_R32G32B32A32_FLOAT: - case DXGI_FORMAT_R32G32B32A32_UINT: - case DXGI_FORMAT_R32G32B32A32_SINT: - return 128; - case DXGI_FORMAT_R32G32B32_TYPELESS: - case DXGI_FORMAT_R32G32B32_FLOAT: - case DXGI_FORMAT_R32G32B32_UINT: - case DXGI_FORMAT_R32G32B32_SINT: - return 96; - case DXGI_FORMAT_R16G16B16A16_TYPELESS: - case DXGI_FORMAT_R16G16B16A16_FLOAT: - case DXGI_FORMAT_R16G16B16A16_UNORM: - case DXGI_FORMAT_R16G16B16A16_UINT: - case DXGI_FORMAT_R16G16B16A16_SNORM: - case DXGI_FORMAT_R16G16B16A16_SINT: - case DXGI_FORMAT_R32G32_TYPELESS: - case DXGI_FORMAT_R32G32_FLOAT: - case DXGI_FORMAT_R32G32_UINT: - case DXGI_FORMAT_R32G32_SINT: - case DXGI_FORMAT_R32G8X24_TYPELESS: - case DXGI_FORMAT_D32_FLOAT_S8X24_UINT: - case DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS: - case DXGI_FORMAT_X32_TYPELESS_G8X24_UINT: - case DXGI_FORMAT_Y416: - case DXGI_FORMAT_Y210: - case DXGI_FORMAT_Y216: - return 64; - case DXGI_FORMAT_R10G10B10A2_TYPELESS: - case DXGI_FORMAT_R10G10B10A2_UNORM: - case DXGI_FORMAT_R10G10B10A2_UINT: - case DXGI_FORMAT_R11G11B10_FLOAT: - case DXGI_FORMAT_R8G8B8A8_TYPELESS: - case DXGI_FORMAT_R8G8B8A8_UNORM: - case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: - case DXGI_FORMAT_R8G8B8A8_UINT: - case DXGI_FORMAT_R8G8B8A8_SNORM: - case DXGI_FORMAT_R8G8B8A8_SINT: - case DXGI_FORMAT_R16G16_TYPELESS: - case DXGI_FORMAT_R16G16_FLOAT: - case DXGI_FORMAT_R16G16_UNORM: - case DXGI_FORMAT_R16G16_UINT: - case DXGI_FORMAT_R16G16_SNORM: - case DXGI_FORMAT_R16G16_SINT: - case DXGI_FORMAT_R32_TYPELESS: - case DXGI_FORMAT_D32_FLOAT: - case DXGI_FORMAT_R32_FLOAT: - case DXGI_FORMAT_R32_UINT: - case DXGI_FORMAT_R32_SINT: - case DXGI_FORMAT_R24G8_TYPELESS: - case DXGI_FORMAT_D24_UNORM_S8_UINT: - case DXGI_FORMAT_R24_UNORM_X8_TYPELESS: - case DXGI_FORMAT_X24_TYPELESS_G8_UINT: - case DXGI_FORMAT_R9G9B9E5_SHAREDEXP: - case DXGI_FORMAT_R8G8_B8G8_UNORM: - case DXGI_FORMAT_G8R8_G8B8_UNORM: - case DXGI_FORMAT_B8G8R8A8_UNORM: - case DXGI_FORMAT_B8G8R8X8_UNORM: - case DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM: - case DXGI_FORMAT_B8G8R8A8_TYPELESS: - case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB: - case DXGI_FORMAT_B8G8R8X8_TYPELESS: - case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB: - case DXGI_FORMAT_AYUV: - case DXGI_FORMAT_Y410: - case DXGI_FORMAT_YUY2: - return 32; - case DXGI_FORMAT_P010: - case DXGI_FORMAT_P016: - return 24; - case DXGI_FORMAT_R8G8_TYPELESS: - case DXGI_FORMAT_R8G8_UNORM: - case DXGI_FORMAT_R8G8_UINT: - case DXGI_FORMAT_R8G8_SNORM: - case DXGI_FORMAT_R8G8_SINT: - case DXGI_FORMAT_R16_TYPELESS: - case DXGI_FORMAT_R16_FLOAT: - case DXGI_FORMAT_D16_UNORM: - case DXGI_FORMAT_R16_UNORM: - case DXGI_FORMAT_R16_UINT: - case DXGI_FORMAT_R16_SNORM: - case DXGI_FORMAT_R16_SINT: - case DXGI_FORMAT_B5G6R5_UNORM: - case DXGI_FORMAT_B5G5R5A1_UNORM: - case DXGI_FORMAT_A8P8: - case DXGI_FORMAT_B4G4R4A4_UNORM: - return 16; - case DXGI_FORMAT_NV12: - case DXGI_FORMAT_420_OPAQUE: - case DXGI_FORMAT_NV11: - return 12; - case DXGI_FORMAT_R8_TYPELESS: - case DXGI_FORMAT_R8_UNORM: - case DXGI_FORMAT_R8_UINT: - case DXGI_FORMAT_R8_SNORM: - case DXGI_FORMAT_R8_SINT: - case DXGI_FORMAT_A8_UNORM: - case DXGI_FORMAT_AI44: - case DXGI_FORMAT_IA44: - case DXGI_FORMAT_P8: - case DXGI_FORMAT_BC2_TYPELESS: - case DXGI_FORMAT_BC2_UNORM: - case DXGI_FORMAT_BC2_UNORM_SRGB: - case DXGI_FORMAT_BC3_TYPELESS: - case DXGI_FORMAT_BC3_UNORM: - case DXGI_FORMAT_BC3_UNORM_SRGB: - case DXGI_FORMAT_BC5_TYPELESS: - case DXGI_FORMAT_BC5_UNORM: - case DXGI_FORMAT_BC5_SNORM: - case DXGI_FORMAT_BC6H_TYPELESS: - case DXGI_FORMAT_BC6H_UF16: - case DXGI_FORMAT_BC6H_SF16: - case DXGI_FORMAT_BC7_TYPELESS: - case DXGI_FORMAT_BC7_UNORM: - case DXGI_FORMAT_BC7_UNORM_SRGB: - return 8; - case DXGI_FORMAT_BC1_TYPELESS: - case DXGI_FORMAT_BC1_UNORM: - case DXGI_FORMAT_BC1_UNORM_SRGB: - case DXGI_FORMAT_BC4_TYPELESS: - case DXGI_FORMAT_BC4_UNORM: - case DXGI_FORMAT_BC4_SNORM: - return 4; - case DXGI_FORMAT_R1_UNORM: - return 1; - default: - return 0; - } -} - HRESULT WINAPI D3DX10GetImageInfoFromFileA(const char *src_file, ID3DX10ThreadPump *pump, D3DX10_IMAGE_INFO *info, HRESULT *result) { @@ -788,112 +612,97 @@ void init_load_info(const D3DX10_IMAGE_LOAD_INFO *load_info, D3DX10_IMAGE_LOAD_I out->pSrcInfo = NULL; } -static HRESULT convert_image(IWICImagingFactory *factory, IWICBitmapFrameDecode *frame, - const GUID *dst_format, unsigned int stride, unsigned int frame_size, BYTE *buffer) +HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO *load_info, + D3D10_SUBRESOURCE_DATA **resource_data) { - IWICFormatConverter *converter; - BOOL can_convert; - GUID src_format; - HRESULT hr; - - if (FAILED(hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &src_format))) - return hr; + const struct pixel_format_desc *fmt_desc, *src_desc; + uint32_t i, j, pixels_size, pixels_offset; + uint8_t *res_data = NULL, *pixels_buffer; + D3DX10_IMAGE_INFO img_info; + struct d3dx_image image; + HRESULT hr = S_OK; - if (IsEqualGUID(&src_format, dst_format)) - { - if (FAILED(hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, stride, frame_size, buffer))) - return hr; - return S_OK; - } + if (!data || !size) + return E_FAIL; - if (FAILED(hr = IWICImagingFactory_CreateFormatConverter(factory, &converter))) - return hr; - if (FAILED(hr = IWICFormatConverter_CanConvert(converter, &src_format, dst_format, &can_convert))) - { - IWICFormatConverter_Release(converter); - return hr; - } - if (!can_convert) - { - WARN("Format converting %s to %s is not supported by WIC.\n", - debugstr_guid(&src_format), debugstr_guid(dst_format)); - IWICFormatConverter_Release(converter); - return E_NOTIMPL; - } - if (FAILED(hr = IWICFormatConverter_Initialize(converter, (IWICBitmapSource *)frame, dst_format, - WICBitmapDitherTypeErrorDiffusion, 0, 0, WICBitmapPaletteTypeCustom))) + if (FAILED(hr = d3dx_handle_filter(&load_info->Filter))) { - IWICFormatConverter_Release(converter); + ERR("Invalid filter argument %#x.\n", load_info->Filter); return hr; } - hr = IWICFormatConverter_CopyPixels(converter, NULL, stride, frame_size, buffer); - IWICFormatConverter_Release(converter); - return hr; -} -static HRESULT d3dx_load_texture_data(struct d3dx_image *image, D3DX10_IMAGE_LOAD_INFO *load_info, - const D3DX10_IMAGE_INFO *img_info, D3D10_SUBRESOURCE_DATA **resource_data) -{ - const struct pixel_format_desc *fmt_desc, *src_desc; - D3DX10_IMAGE_LOAD_INFO tmp_load_info = *load_info; - uint32_t i, j, pixels_size, pixels_offset; - uint8_t *res_data = NULL, *pixels_buffer; - HRESULT hr = S_OK; + hr = d3dx_image_init(data, size, &image, 0, D3DX_IMAGE_SUPPORT_DXT10); + if (FAILED(hr)) + return E_FAIL; - if (img_info->ImageFileFormat == D3DX10_IFF_BMP) - return E_NOTIMPL; + hr = d3dx10_image_info_from_d3dx_image(&img_info, &image); + if (FAILED(hr)) + { + WARN("Invalid or unsupported image file, hr %#lx.\n", hr); + hr = E_FAIL; + goto end; + } - if (FAILED(hr = d3dx_handle_filter(&tmp_load_info.Filter))) + if ((!(img_info.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE) || img_info.ArraySize != 6) + && img_info.ArraySize != 1) { - ERR("Invalid filter argument %#x.\n", tmp_load_info.Filter); - return hr; + FIXME("img_info.ArraySize = %u not supported.\n", img_info.ArraySize); + hr = E_NOTIMPL; + goto end; } - if (tmp_load_info.Format == D3DX10_DEFAULT || tmp_load_info.Format == DXGI_FORMAT_FROM_FILE) - tmp_load_info.Format = img_info->Format; - fmt_desc = get_d3dx_pixel_format_info(d3dx_pixel_format_id_from_dxgi_format(tmp_load_info.Format)); + if (load_info->Format == D3DX10_DEFAULT || load_info->Format == DXGI_FORMAT_FROM_FILE) + load_info->Format = img_info.Format; + fmt_desc = get_d3dx_pixel_format_info(d3dx_pixel_format_id_from_dxgi_format(load_info->Format)); if (fmt_desc->format == D3DX_PIXEL_FORMAT_COUNT) { - FIXME("Unknown DXGI format supplied, %#x.\n", tmp_load_info.Format); - return E_NOTIMPL; + FIXME("Unknown DXGI format supplied, %#x.\n", load_info->Format); + hr = E_NOTIMPL; + goto end; } /* Potentially round up width/height to align with block size. */ - if (!tmp_load_info.Width || tmp_load_info.Width == D3DX10_FROM_FILE || tmp_load_info.Width == D3DX10_DEFAULT) - tmp_load_info.Width = (img_info->Width + fmt_desc->block_width - 1) & ~(fmt_desc->block_width - 1); - if (!tmp_load_info.Height || tmp_load_info.Height == D3DX10_FROM_FILE || tmp_load_info.Height == D3DX10_DEFAULT) - tmp_load_info.Height = (img_info->Height + fmt_desc->block_height - 1) & ~(fmt_desc->block_height - 1); - - if (!tmp_load_info.Depth || tmp_load_info.Depth == D3DX10_FROM_FILE || tmp_load_info.Depth == D3DX10_DEFAULT) - tmp_load_info.Depth = img_info->Depth; - if ((tmp_load_info.Depth > 1) && (img_info->ResourceDimension != D3D10_RESOURCE_DIMENSION_TEXTURE3D)) - return E_FAIL; + if (!load_info->Width || load_info->Width == D3DX10_FROM_FILE || load_info->Width == D3DX10_DEFAULT) + load_info->Width = (img_info.Width + fmt_desc->block_width - 1) & ~(fmt_desc->block_width - 1); + if (!load_info->Height || load_info->Height == D3DX10_FROM_FILE || load_info->Height == D3DX10_DEFAULT) + load_info->Height = (img_info.Height + fmt_desc->block_height - 1) & ~(fmt_desc->block_height - 1); + + if (!load_info->Depth || load_info->Depth == D3DX10_FROM_FILE || load_info->Depth == D3DX10_DEFAULT) + load_info->Depth = img_info.Depth; + if ((load_info->Depth > 1) && (img_info.ResourceDimension != D3D10_RESOURCE_DIMENSION_TEXTURE3D)) + { + hr = E_FAIL; + goto end; + } if (load_info->MipLevels != D3DX10_DEFAULT) FIXME("load_info->MipLevels argument ignored.\n"); - tmp_load_info.MipLevels = img_info->MipLevels; + load_info->MipLevels = img_info.MipLevels; - pixels_size = d3dx_calculate_layer_pixels_size(fmt_desc->format, tmp_load_info.Width, tmp_load_info.Height, - tmp_load_info.Depth, tmp_load_info.MipLevels) * img_info->ArraySize; - pixels_offset = (sizeof(**resource_data) * tmp_load_info.MipLevels * img_info->ArraySize); + pixels_size = d3dx_calculate_layer_pixels_size(fmt_desc->format, load_info->Width, load_info->Height, + load_info->Depth, load_info->MipLevels) * img_info.ArraySize; + pixels_offset = (sizeof(**resource_data) * load_info->MipLevels * img_info.ArraySize); if (!(res_data = malloc(pixels_size + pixels_offset))) - return E_FAIL; + { + hr = E_FAIL; + goto end; + } pixels_buffer = res_data + pixels_offset; *resource_data = (D3D10_SUBRESOURCE_DATA *)res_data; - src_desc = get_d3dx_pixel_format_info(image->format); - for (i = 0; i < img_info->ArraySize; ++i) + src_desc = get_d3dx_pixel_format_info(image.format); + for (i = 0; i < img_info.ArraySize; ++i) { - struct volume dst_size = { tmp_load_info.Width, tmp_load_info.Height, tmp_load_info.Depth }; + struct volume dst_size = { load_info->Width, load_info->Height, load_info->Depth }; - for (j = 0; j < tmp_load_info.MipLevels; ++j) + for (j = 0; j < load_info->MipLevels; ++j) { const RECT unaligned_rect = { 0, 0, dst_size.width, dst_size.height }; struct d3dx_pixels src_pixels, dst_pixels; uint32_t dst_row_pitch, dst_slice_pitch; - hr = d3dx_image_get_pixels(image, i, j, &src_pixels); + hr = d3dx_image_get_pixels(&image, i, j, &src_pixels); if (FAILED(hr)) break; @@ -905,13 +714,13 @@ static HRESULT d3dx_load_texture_data(struct d3dx_image *image, D3DX10_IMAGE_LOA set_d3dx_pixels(&dst_pixels, pixels_buffer, dst_row_pitch, dst_slice_pitch, NULL, dst_size.width, dst_size.height, dst_size.depth, &unaligned_rect); - hr = d3dx_load_pixels_from_pixels(&dst_pixels, fmt_desc, &src_pixels, src_desc, tmp_load_info.Filter, 0); + hr = d3dx_load_pixels_from_pixels(&dst_pixels, fmt_desc, &src_pixels, src_desc, load_info->Filter, 0); if (FAILED(hr)) break; - (*resource_data)[i * tmp_load_info.MipLevels + j].pSysMem = pixels_buffer; - (*resource_data)[i * tmp_load_info.MipLevels + j].SysMemPitch = dst_row_pitch; - (*resource_data)[i * tmp_load_info.MipLevels + j].SysMemSlicePitch = dst_slice_pitch; + (*resource_data)[i * load_info->MipLevels + j].pSysMem = pixels_buffer; + (*resource_data)[i * load_info->MipLevels + j].SysMemPitch = dst_row_pitch; + (*resource_data)[i * load_info->MipLevels + j].SysMemSlicePitch = dst_slice_pitch; pixels_buffer += dst_slice_pitch * dst_size.depth; d3dx_get_next_mip_level_size(&dst_size); @@ -921,8 +730,7 @@ static HRESULT d3dx_load_texture_data(struct d3dx_image *image, D3DX10_IMAGE_LOA if (FAILED(hr)) { *resource_data = NULL; - free(res_data); - return hr; + goto end; } if (load_info->FirstMipLevel != D3DX10_DEFAULT && load_info->FirstMipLevel) @@ -939,147 +747,15 @@ static HRESULT d3dx_load_texture_data(struct d3dx_image *image, D3DX10_IMAGE_LOA FIXME("load_info->MipFilter is ignored.\n"); if (load_info->pSrcInfo) FIXME("load_info->pSrcInfo is ignored.\n"); - *load_info = tmp_load_info; load_info->Usage = D3D10_USAGE_DEFAULT; load_info->BindFlags = D3D10_BIND_SHADER_RESOURCE; load_info->CpuAccessFlags = 0; - load_info->MiscFlags = img_info->MiscFlags; - - return S_OK; -} - -HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO *load_info, - D3D10_SUBRESOURCE_DATA **resource_data) -{ - IWICBitmapFrameDecode *frame = NULL; - IWICImagingFactory *factory = NULL; - IWICBitmapDecoder *decoder = NULL; - unsigned int stride, frame_size; - BYTE *res_data = NULL, *buffer; - D3DX10_IMAGE_INFO img_info; - IWICStream *stream = NULL; - struct d3dx_image image; - const GUID *dst_format; - HRESULT hr; - - if (!data || !size) - return E_FAIL; - - hr = d3dx_image_init(data, size, &image, 0, D3DX_IMAGE_SUPPORT_DXT10); - if (FAILED(hr)) - return E_FAIL; - - hr = d3dx10_image_info_from_d3dx_image(&img_info, &image); - if (FAILED(hr)) - { - WARN("Invalid or unsupported image file, hr %#lx.\n", hr); - hr = E_FAIL; - goto end; - } - - if ((!(img_info.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE) || img_info.ArraySize != 6) - && img_info.ArraySize != 1) - { - FIXME("img_info.ArraySize = %u not supported.\n", img_info.ArraySize); - hr = E_NOTIMPL; - goto end; - } - - if (SUCCEEDED(hr = d3dx_load_texture_data(&image, load_info, &img_info, resource_data))) - { - TRACE("Successfully used shared code to load texture data.\n"); - res_data = NULL; - goto end; - } - else if (img_info.ImageFileFormat == D3DX10_IFF_DDS) - { - goto end; - } - - if (load_info->Width != D3DX10_DEFAULT) - FIXME("load_info->Width is ignored.\n"); - if (load_info->Height != D3DX10_DEFAULT) - FIXME("load_info->Height is ignored.\n"); - if (load_info->Depth != D3DX10_DEFAULT) - FIXME("load_info->Depth is ignored.\n"); - if (load_info->FirstMipLevel != D3DX10_DEFAULT) - FIXME("load_info->FirstMipLevel is ignored.\n"); - if (load_info->MipLevels != D3DX10_DEFAULT) - FIXME("load_info->MipLevels is ignored.\n"); - if (load_info->Usage != D3DX10_DEFAULT) - FIXME("load_info->Usage is ignored.\n"); - if (load_info->BindFlags != D3DX10_DEFAULT) - FIXME("load_info->BindFlags is ignored.\n"); - if (load_info->CpuAccessFlags != D3DX10_DEFAULT) - FIXME("load_info->CpuAccessFlags is ignored.\n"); - if (load_info->MiscFlags != D3DX10_DEFAULT) - FIXME("load_info->MiscFlags is ignored.\n"); - if (load_info->Format != D3DX10_DEFAULT) - FIXME("load_info->Format is ignored.\n"); - if (load_info->Filter != D3DX10_DEFAULT) - FIXME("load_info->Filter is ignored.\n"); - if (load_info->MipFilter != D3DX10_DEFAULT) - FIXME("load_info->MipFilter is ignored.\n"); - if (load_info->pSrcInfo) - FIXME("load_info->pSrcInfo is ignored.\n"); - - if (FAILED(hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory))) - goto end; - if (FAILED(hr = IWICImagingFactory_CreateStream(factory, &stream))) - goto end; - if (FAILED(hr = IWICStream_InitializeFromMemory(stream, (BYTE *)data, size))) - goto end; - if (FAILED(hr = IWICImagingFactory_CreateDecoderFromStream(factory, (IStream *)stream, NULL, 0, &decoder))) - goto end; - if (FAILED(hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame))) - goto end; - - stride = (img_info.Width * get_bpp_from_format(img_info.Format) + 7) / 8; - frame_size = stride * img_info.Height; - - if (!(res_data = malloc(sizeof(**resource_data) + frame_size))) - { - hr = E_FAIL; - goto end; - } - buffer = res_data + sizeof(**resource_data); - - if (!(dst_format = dxgi_format_to_wic_guid(img_info.Format))) - { - hr = E_FAIL; - FIXME("Unsupported DXGI format %#x.\n", img_info.Format); - goto end; - } - if (FAILED(hr = convert_image(factory, frame, dst_format, stride, frame_size, buffer))) - goto end; - - *resource_data = (D3D10_SUBRESOURCE_DATA *)res_data; - (*resource_data)->pSysMem = buffer; - (*resource_data)->SysMemPitch = stride; - (*resource_data)->SysMemSlicePitch = frame_size; - - load_info->Width = img_info.Width; - load_info->Height = img_info.Height; - load_info->MipLevels = img_info.MipLevels; - load_info->Format = img_info.Format; - load_info->Usage = D3D10_USAGE_DEFAULT; - load_info->BindFlags = D3D10_BIND_SHADER_RESOURCE; load_info->MiscFlags = img_info.MiscFlags; - res_data = NULL; - hr = S_OK; end: d3dx_image_cleanup(&image); free(res_data); - if (frame) - IWICBitmapFrameDecode_Release(frame); - if (decoder) - IWICBitmapDecoder_Release(decoder); - if (stream) - IWICStream_Release(stream); - if (factory) - IWICImagingFactory_Release(factory); return hr; } diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index a2854b2161cc..a09f1ff9763f 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -1259,7 +1259,8 @@ static HRESULT d3dx_initialize_image_from_wic(const void *src_data, uint32_t src goto exit; } - if (image_is_argb(bitmap_frame, image)) + /* D3DX10/D3DX11 ignore alpha channels in bitmaps. */ + if (!(flags & D3DX_IMAGE_SUPPORT_DXT10) && image_is_argb(bitmap_frame, image)) image->format = D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM; if (!(flags & D3DX_IMAGE_INFO_ONLY)) From 765bd1dd32c62f86d070e04a57b34e4b0377fc70 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 8 Nov 2024 10:50:31 -0500 Subject: [PATCH 0940/2542] d3dx10: Add support for generating mipmaps to load_texture_data(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 1 - dlls/d3dx10_43/texture.c | 148 +++++++++++++++++++++++++--------- dlls/d3dx9_36/d3dx_helpers.c | 22 +++++ dlls/d3dx9_36/d3dx_helpers.h | 2 + 4 files changed, 133 insertions(+), 40 deletions(-) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 3c39f69c2f31..a061c434043d 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -1468,7 +1468,6 @@ static void check_resource_info(ID3D10Resource *resource, const struct test_imag ok_(__FILE__, line)(desc_2d.Height == expected_height, "Got unexpected Height %u, expected %u.\n", desc_2d.Height, expected_height); - todo_wine_if(expected_mip_levels != image->expected_info.MipLevels) ok_(__FILE__, line)(desc_2d.MipLevels == expected_mip_levels, "Got unexpected MipLevels %u, expected %u.\n", desc_2d.MipLevels, expected_mip_levels); diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index eecb6f90a982..5ec7bfcc9386 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -612,15 +612,67 @@ void init_load_info(const D3DX10_IMAGE_LOAD_INFO *load_info, D3DX10_IMAGE_LOAD_I out->pSrcInfo = NULL; } +static HRESULT d3dx_create_subresource_data_for_texture(uint32_t width, uint32_t height, uint32_t depth, + uint32_t mip_levels, uint32_t layer_count, const struct pixel_format_desc *fmt_desc, + D3D10_SUBRESOURCE_DATA **out_sub_rsrc_data, uint8_t **pixel_data) +{ + uint8_t *sub_rsrc_data = NULL, *pixels_ptr; + uint32_t i, j, pixels_size, pixels_offset; + D3D10_SUBRESOURCE_DATA *sub_rsrcs = NULL; + HRESULT hr = S_OK; + + *pixel_data = NULL; + *out_sub_rsrc_data = NULL; + + pixels_offset = (sizeof(*sub_rsrcs) * mip_levels * layer_count); + pixels_size = d3dx_calculate_layer_pixels_size(fmt_desc->format, width, height, depth, mip_levels) * layer_count; + if (!(sub_rsrc_data = malloc(pixels_size + pixels_offset))) + return E_FAIL; + + sub_rsrcs = (D3D10_SUBRESOURCE_DATA *)sub_rsrc_data; + pixels_ptr = sub_rsrc_data + pixels_offset; + for (i = 0; i < layer_count; ++i) + { + struct volume size = { width, height, depth }; + + for (j = 0; j < mip_levels; ++j) + { + uint32_t row_pitch, slice_pitch; + + hr = d3dx_calculate_pixels_size(fmt_desc->format, size.width, size.height, &row_pitch, &slice_pitch); + if (FAILED(hr)) + break; + + sub_rsrcs[i * mip_levels + j].pSysMem = pixels_ptr; + sub_rsrcs[i * mip_levels + j].SysMemPitch = row_pitch; + sub_rsrcs[i * mip_levels + j].SysMemSlicePitch = slice_pitch; + + pixels_ptr += slice_pitch * size.depth; + d3dx_get_next_mip_level_size(&size); + } + } + + if (SUCCEEDED(hr)) + { + *pixel_data = sub_rsrc_data + pixels_offset; + *out_sub_rsrc_data = sub_rsrcs; + sub_rsrc_data = NULL; + } + + free(sub_rsrc_data); + return hr; +} + HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO *load_info, D3D10_SUBRESOURCE_DATA **resource_data) { const struct pixel_format_desc *fmt_desc, *src_desc; - uint32_t i, j, pixels_size, pixels_offset; - uint8_t *res_data = NULL, *pixels_buffer; + uint32_t i, j, loaded_mip_levels, max_mip_levels; + D3D10_SUBRESOURCE_DATA *sub_rsrcs = NULL; D3DX10_IMAGE_INFO img_info; struct d3dx_image image; - HRESULT hr = S_OK; + uint8_t *pixels_ptr; + HRESULT hr; if (!data || !size) return E_FAIL; @@ -675,62 +727,81 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO goto end; } - if (load_info->MipLevels != D3DX10_DEFAULT) - FIXME("load_info->MipLevels argument ignored.\n"); - load_info->MipLevels = img_info.MipLevels; + max_mip_levels = d3dx_get_max_mip_levels_for_size(load_info->Width, load_info->Height, load_info->Depth); + if (!load_info->MipLevels || load_info->MipLevels == D3DX10_DEFAULT || load_info->MipLevels == D3DX10_FROM_FILE) + load_info->MipLevels = (load_info->MipLevels == D3DX10_FROM_FILE) ? img_info.MipLevels : max_mip_levels; + load_info->MipLevels = min(max_mip_levels, load_info->MipLevels); - pixels_size = d3dx_calculate_layer_pixels_size(fmt_desc->format, load_info->Width, load_info->Height, - load_info->Depth, load_info->MipLevels) * img_info.ArraySize; - pixels_offset = (sizeof(**resource_data) * load_info->MipLevels * img_info.ArraySize); - if (!(res_data = malloc(pixels_size + pixels_offset))) - { - hr = E_FAIL; + hr = d3dx_create_subresource_data_for_texture(load_info->Width, load_info->Height, load_info->Depth, + load_info->MipLevels, img_info.ArraySize, fmt_desc, &sub_rsrcs, &pixels_ptr); + if (FAILED(hr)) goto end; - } - - pixels_buffer = res_data + pixels_offset; - *resource_data = (D3D10_SUBRESOURCE_DATA *)res_data; src_desc = get_d3dx_pixel_format_info(image.format); + loaded_mip_levels = min(img_info.MipLevels, load_info->MipLevels); for (i = 0; i < img_info.ArraySize; ++i) { struct volume dst_size = { load_info->Width, load_info->Height, load_info->Depth }; - for (j = 0; j < load_info->MipLevels; ++j) + for (j = 0; j < loaded_mip_levels; ++j) { + D3D10_SUBRESOURCE_DATA *sub_rsrc = &sub_rsrcs[i * load_info->MipLevels + j]; const RECT unaligned_rect = { 0, 0, dst_size.width, dst_size.height }; struct d3dx_pixels src_pixels, dst_pixels; - uint32_t dst_row_pitch, dst_slice_pitch; hr = d3dx_image_get_pixels(&image, i, j, &src_pixels); if (FAILED(hr)) - break; + goto end; - hr = d3dx_calculate_pixels_size(fmt_desc->format, dst_size.width, dst_size.height, &dst_row_pitch, - &dst_slice_pitch); - if (FAILED(hr)) - break; - - set_d3dx_pixels(&dst_pixels, pixels_buffer, dst_row_pitch, dst_slice_pitch, NULL, dst_size.width, - dst_size.height, dst_size.depth, &unaligned_rect); + set_d3dx_pixels(&dst_pixels, sub_rsrc->pSysMem, sub_rsrc->SysMemPitch, sub_rsrc->SysMemSlicePitch, NULL, + dst_size.width, dst_size.height, dst_size.depth, &unaligned_rect); hr = d3dx_load_pixels_from_pixels(&dst_pixels, fmt_desc, &src_pixels, src_desc, load_info->Filter, 0); if (FAILED(hr)) - break; - - (*resource_data)[i * load_info->MipLevels + j].pSysMem = pixels_buffer; - (*resource_data)[i * load_info->MipLevels + j].SysMemPitch = dst_row_pitch; - (*resource_data)[i * load_info->MipLevels + j].SysMemSlicePitch = dst_slice_pitch; + goto end; - pixels_buffer += dst_slice_pitch * dst_size.depth; d3dx_get_next_mip_level_size(&dst_size); } } - if (FAILED(hr)) + if (loaded_mip_levels < load_info->MipLevels) { - *resource_data = NULL; - goto end; + struct volume base_level_size = { load_info->Width, load_info->Height, load_info->Depth }; + + if (FAILED(hr = d3dx_handle_filter(&load_info->MipFilter))) + { + ERR("Invalid mip filter argument %#x.\n", load_info->MipFilter); + goto end; + } + + d3dx_get_mip_level_size(&base_level_size, loaded_mip_levels - 1); + for (i = 0; i < img_info.ArraySize; ++i) + { + struct volume src_size, dst_size; + + src_size = dst_size = base_level_size; + for (j = (loaded_mip_levels - 1); j < (load_info->MipLevels - 1); ++j) + { + D3D10_SUBRESOURCE_DATA *dst_data = &sub_rsrcs[i * load_info->MipLevels + j + 1]; + D3D10_SUBRESOURCE_DATA *src_data = &sub_rsrcs[i * load_info->MipLevels + j]; + const RECT src_unaligned_rect = { 0, 0, src_size.width, src_size.height }; + struct d3dx_pixels src_pixels, dst_pixels; + RECT dst_unaligned_rect; + + d3dx_get_next_mip_level_size(&dst_size); + SetRect(&dst_unaligned_rect, 0, 0, dst_size.width, dst_size.height); + set_d3dx_pixels(&dst_pixels, dst_data->pSysMem, dst_data->SysMemPitch, dst_data->SysMemSlicePitch, NULL, + dst_size.width, dst_size.height, dst_size.depth, &dst_unaligned_rect); + set_d3dx_pixels(&src_pixels, src_data->pSysMem, src_data->SysMemPitch, src_data->SysMemSlicePitch, NULL, + src_size.width, src_size.height, src_size.depth, &src_unaligned_rect); + + hr = d3dx_load_pixels_from_pixels(&dst_pixels, fmt_desc, &src_pixels, fmt_desc, load_info->MipFilter, 0); + if (FAILED(hr)) + goto end; + + src_size = dst_size; + } + } } if (load_info->FirstMipLevel != D3DX10_DEFAULT && load_info->FirstMipLevel) @@ -743,19 +814,18 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO FIXME("load_info->CpuAccessFlags is ignored.\n"); if (load_info->MiscFlags != D3DX10_DEFAULT) FIXME("load_info->MiscFlags is ignored.\n"); - if (load_info->MipFilter != D3DX10_DEFAULT) - FIXME("load_info->MipFilter is ignored.\n"); if (load_info->pSrcInfo) FIXME("load_info->pSrcInfo is ignored.\n"); load_info->Usage = D3D10_USAGE_DEFAULT; load_info->BindFlags = D3D10_BIND_SHADER_RESOURCE; load_info->CpuAccessFlags = 0; load_info->MiscFlags = img_info.MiscFlags; - res_data = NULL; + *resource_data = sub_rsrcs; + sub_rsrcs = NULL; end: d3dx_image_cleanup(&image); - free(res_data); + free(sub_rsrcs); return hr; } diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index a09f1ff9763f..52d749529774 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -399,6 +399,28 @@ void d3dx_get_next_mip_level_size(struct volume *size) size->depth = max(size->depth / 2, 1); } +void d3dx_get_mip_level_size(struct volume *size, uint32_t level) +{ + uint32_t i; + + for (i = 0; i < level; ++i) + d3dx_get_next_mip_level_size(size); +} + +uint32_t d3dx_get_max_mip_levels_for_size(uint32_t width, uint32_t height, uint32_t depth) +{ + struct volume tmp = { width, height, depth }; + uint32_t mip_levels = 1; + + while (!(tmp.width == 1 && tmp.height == 1 && tmp.depth == 1)) + { + d3dx_get_next_mip_level_size(&tmp); + mip_levels++; + } + + return mip_levels; +} + static const char *debug_volume(const struct volume *volume) { if (!volume) diff --git a/dlls/d3dx9_36/d3dx_helpers.h b/dlls/d3dx9_36/d3dx_helpers.h index a415a32d87d9..adf167de85dd 100644 --- a/dlls/d3dx9_36/d3dx_helpers.h +++ b/dlls/d3dx9_36/d3dx_helpers.h @@ -476,6 +476,8 @@ void format_to_d3dx_color(const struct pixel_format_desc *format, const BYTE *sr void format_from_d3dx_color(const struct pixel_format_desc *format, const struct d3dx_color *src, BYTE *dst); void d3dx_get_next_mip_level_size(struct volume *size); +void d3dx_get_mip_level_size(struct volume *size, uint32_t level); +uint32_t d3dx_get_max_mip_levels_for_size(uint32_t width, uint32_t height, uint32_t depth); HRESULT d3dx_calculate_pixels_size(enum d3dx_pixel_format_id format, uint32_t width, uint32_t height, uint32_t *pitch, uint32_t *size); uint32_t d3dx_calculate_layer_pixels_size(enum d3dx_pixel_format_id format, uint32_t width, uint32_t height, uint32_t depth, From 5194170618c6c0f7a80951627c28095c81be3ebc Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 9 Aug 2024 12:52:04 -0400 Subject: [PATCH 0941/2542] d3dx10: Create 3D textures for images representing 3D textures. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/async.c | 3 ++ dlls/d3dx10_43/tests/d3dx10.c | 26 ++++++++++--- dlls/d3dx10_43/texture.c | 71 ++++++++++++++++++++++++++--------- 3 files changed, 78 insertions(+), 22 deletions(-) diff --git a/dlls/d3dx10_43/async.c b/dlls/d3dx10_43/async.c index 626278868040..3e4e23488dbd 100644 --- a/dlls/d3dx10_43/async.c +++ b/dlls/d3dx10_43/async.c @@ -322,6 +322,7 @@ struct texture_processor { ID3DX10DataProcessor ID3DX10DataProcessor_iface; ID3D10Device *device; + D3DX10_IMAGE_INFO img_info; D3DX10_IMAGE_LOAD_INFO load_info; D3D10_SUBRESOURCE_DATA *resource_data; }; @@ -595,6 +596,8 @@ HRESULT WINAPI D3DX10CreateAsyncTextureProcessor(ID3D10Device *device, object->device = device; ID3D10Device_AddRef(device); init_load_info(load_info, &object->load_info); + if (!object->load_info.pSrcInfo) + object->load_info.pSrcInfo = &object->img_info; *processor = &object->ID3DX10DataProcessor_iface; return S_OK; diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index a061c434043d..1e63e38bf18b 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -20,6 +20,7 @@ #include "initguid.h" #include "d3d10_1.h" #include "d3dx10.h" +#include "wine/wined3d.h" #include "wine/test.h" #include @@ -69,6 +70,8 @@ #define DDS_PF_BUMPLUMINANCE 0x00040000 #define DDS_PF_BUMPDUDV 0x00080000 +static bool wined3d_opengl; + struct dds_pixel_format { DWORD size; @@ -1451,10 +1454,9 @@ static void check_resource_info(ID3D10Resource *resource, const struct test_imag } ID3D10Resource_GetType(resource, &resource_dimension); - todo_wine_if (image->expected_info.ResourceDimension == D3D10_RESOURCE_DIMENSION_TEXTURE3D) - ok(resource_dimension == image->expected_info.ResourceDimension, - "Got unexpected ResourceDimension %u, expected %u.\n", - resource_dimension, image->expected_info.ResourceDimension); + ok(resource_dimension == image->expected_info.ResourceDimension, + "Got unexpected ResourceDimension %u, expected %u.\n", + resource_dimension, image->expected_info.ResourceDimension); switch (resource_dimension) { @@ -1646,7 +1648,10 @@ static void check_resource_data(ID3D10Resource *resource, const struct test_imag if (SUCCEEDED(ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture3D, (void **)&texture3d))) { - check_texture3d_data(texture3d, image, line); + if (wined3d_opengl && is_block_compressed(image->expected_info.Format)) + skip("Skipping compressed format 3D texture readback test.\n"); + else + check_texture3d_data(texture3d, image, line); ID3D10Texture3D_Release(texture3d); } else if (SUCCEEDED(ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture2D, (void **)&texture2d))) @@ -5115,6 +5120,17 @@ static void test_preprocess_shader(void) START_TEST(d3dx10) { + HMODULE wined3d; + + if ((wined3d = GetModuleHandleA("wined3d.dll"))) + { + enum wined3d_renderer (CDECL *p_wined3d_get_renderer)(void); + + if ((p_wined3d_get_renderer = (void *)GetProcAddress(wined3d, "wined3d_get_renderer")) + && p_wined3d_get_renderer() == WINED3D_RENDERER_OPENGL) + wined3d_opengl = true; + } + test_D3DX10UnsetAllDeviceObjects(); test_D3DX10CreateAsyncMemoryLoader(); test_D3DX10CreateAsyncFileLoader(); diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 5ec7bfcc9386..49a9ec78acd1 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -422,9 +422,12 @@ static HRESULT create_texture(ID3D10Device *device, const void *data, SIZE_T siz { D3D10_SUBRESOURCE_DATA *resource_data; D3DX10_IMAGE_LOAD_INFO load_info_copy; + D3DX10_IMAGE_INFO img_info; HRESULT hr; init_load_info(load_info, &load_info_copy); + if (load_info_copy.pSrcInfo == NULL) + load_info_copy.pSrcInfo = &img_info; if (FAILED((hr = load_texture_data(data, size, &load_info_copy, &resource_data)))) return hr; @@ -815,7 +818,7 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO if (load_info->MiscFlags != D3DX10_DEFAULT) FIXME("load_info->MiscFlags is ignored.\n"); if (load_info->pSrcInfo) - FIXME("load_info->pSrcInfo is ignored.\n"); + *load_info->pSrcInfo = img_info; load_info->Usage = D3D10_USAGE_DEFAULT; load_info->BindFlags = D3D10_BIND_SHADER_RESOURCE; load_info->CpuAccessFlags = 0; @@ -832,25 +835,59 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO HRESULT create_d3d_texture(ID3D10Device *device, D3DX10_IMAGE_LOAD_INFO *load_info, D3D10_SUBRESOURCE_DATA *resource_data, ID3D10Resource **texture) { - D3D10_TEXTURE2D_DESC texture_2d_desc; - ID3D10Texture2D *texture_2d; HRESULT hr; - memset(&texture_2d_desc, 0, sizeof(texture_2d_desc)); - texture_2d_desc.Width = load_info->Width; - texture_2d_desc.Height = load_info->Height; - texture_2d_desc.MipLevels = load_info->MipLevels; - texture_2d_desc.ArraySize = load_info->MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE ? 6 : 1; - texture_2d_desc.Format = load_info->Format; - texture_2d_desc.SampleDesc.Count = 1; - texture_2d_desc.Usage = load_info->Usage; - texture_2d_desc.BindFlags = load_info->BindFlags; - texture_2d_desc.MiscFlags = load_info->MiscFlags; - - if (FAILED(hr = ID3D10Device_CreateTexture2D(device, &texture_2d_desc, resource_data, &texture_2d))) - return hr; + *texture = NULL; + switch (load_info->pSrcInfo->ResourceDimension) + { + case D3D10_RESOURCE_DIMENSION_TEXTURE2D: + { + D3D10_TEXTURE2D_DESC texture_2d_desc = { 0 }; + ID3D10Texture2D *texture_2d; + + texture_2d_desc.Width = load_info->Width; + texture_2d_desc.Height = load_info->Height; + texture_2d_desc.MipLevels = load_info->MipLevels; + texture_2d_desc.ArraySize = load_info->pSrcInfo->ArraySize; + texture_2d_desc.Format = load_info->Format; + texture_2d_desc.SampleDesc.Count = 1; + texture_2d_desc.Usage = load_info->Usage; + texture_2d_desc.BindFlags = load_info->BindFlags; + texture_2d_desc.CPUAccessFlags = load_info->CpuAccessFlags; + texture_2d_desc.MiscFlags = load_info->MiscFlags; + + if (FAILED(hr = ID3D10Device_CreateTexture2D(device, &texture_2d_desc, resource_data, &texture_2d))) + return hr; + *texture = (ID3D10Resource *)texture_2d; + break; + } + + case D3D10_RESOURCE_DIMENSION_TEXTURE3D: + { + D3D10_TEXTURE3D_DESC texture_3d_desc = { 0 }; + ID3D10Texture3D *texture_3d; + + texture_3d_desc.Width = load_info->Width; + texture_3d_desc.Height = load_info->Height; + texture_3d_desc.Depth = load_info->Depth; + texture_3d_desc.MipLevels = load_info->MipLevels; + texture_3d_desc.Format = load_info->Format; + texture_3d_desc.Usage = load_info->Usage; + texture_3d_desc.BindFlags = load_info->BindFlags; + texture_3d_desc.CPUAccessFlags = load_info->CpuAccessFlags; + texture_3d_desc.MiscFlags = load_info->MiscFlags; + + if (FAILED(hr = ID3D10Device_CreateTexture3D(device, &texture_3d_desc, resource_data, &texture_3d))) + return hr; + *texture = (ID3D10Resource *)texture_3d; + break; + } + + default: + FIXME("Unhandled resource dimension %d.\n", load_info->pSrcInfo->ResourceDimension); + return E_NOTIMPL; + } - *texture = (ID3D10Resource *)texture_2d; return S_OK; } From 12ce6e9b4dc09477de38d1e40aa97bcb0209a9df Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 14 Aug 2024 10:12:24 -0400 Subject: [PATCH 0942/2542] d3dx10/tests: Add tests for the D3DX10_IMAGE_LOAD_INFO structure argument. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 725 +++++++++++++++++++++++++++++++++- 1 file changed, 720 insertions(+), 5 deletions(-) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 1e63e38bf18b..3baf1faa6203 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -735,6 +735,68 @@ static const BYTE test_dds_volume_data[] = 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x87, 0x0f, 0x78, 0x05, 0x05, 0x50, 0x50, }; +/* + * 4x4x4 24-bit volume dds, 3 mipmaps. Level 0 is red, level 1 is green, level 2 is + * blue. + */ +static const uint8_t dds_volume_24bit_4_4_4[] = +{ + 0x44,0x44,0x53,0x20,0x7c,0x00,0x00,0x00,0x0f,0x10,0x82,0x00,0x04,0x00,0x00,0x00, + 0x04,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x03,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00, + 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x40,0x00, + 0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, + 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, + 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, + 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0xff,0x00,0x00 +}; + +/* + * 8x8 24-bit dds, 4 mipmaps. Level 0 is red, level 1 is green, level 2 is + * blue, and level 3 is black. + */ +static const uint8_t dds_24bit_8_8[] = +{ + 0x44,0x44,0x53,0x20,0x7c,0x00,0x00,0x00,0x07,0x10,0x0a,0x00,0x08,0x00,0x00,0x00, + 0x08,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00, + 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x40,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, + 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, + 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, + 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, + 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00 +}; + /* 1x1 wmp image */ static const BYTE test_wmp[] = { @@ -925,6 +987,154 @@ test_image[] = }, }; +static const struct test_image_load_info +{ + const uint8_t *data; + uint32_t size; + D3DX10_IMAGE_LOAD_INFO load_info; + HRESULT expected_hr; + + D3D10_RESOURCE_DIMENSION expected_type; + union + { + D3D10_TEXTURE2D_DESC desc_2d; + D3D10_TEXTURE3D_DESC desc_3d; + } expected_resource_desc; + D3DX10_IMAGE_INFO expected_info; + BOOL todo_resource_desc; +} +test_image_load_info[] = +{ + /* + * FirstMipLevel set to 1 - Does not match D3DX_SKIP_DDS_MIP_LEVELS + * behavior from d3dx9, image info values represent mip level 0, and + * texture values are pulled from this. The texture data is loaded + * starting from the specified mip level, however. + */ + { + dds_volume_24bit_4_4_4, sizeof(dds_volume_24bit_4_4_4), + { D3DX10_FROM_FILE, D3DX10_DEFAULT, 0, 1, D3DX10_DEFAULT, (D3D10_USAGE)D3DX10_DEFAULT, + D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT }, + S_OK, D3D10_RESOURCE_DIMENSION_TEXTURE3D, + { .desc_3d = { 4, 4, 4, 3, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 } }, + { 4, 4, 4, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, D3DX10_IFF_DDS }, + }, + /* + * Autogen mips misc flag specified. In the case of a cube texture image, + * the autogen mips flag is OR'd against D3D10_RESOURCE_MISC_TEXTURECUBE, + * even if it isn't specified. + */ + { + test_dds_cube, sizeof(test_dds_cube), + { D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, (D3D10_USAGE)D3DX10_DEFAULT, + (D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET), D3DX10_DEFAULT, D3D10_RESOURCE_MISC_GENERATE_MIPS, + DXGI_FORMAT_R8G8B8A8_UNORM, D3DX10_DEFAULT, D3DX10_DEFAULT }, + S_OK, D3D10_RESOURCE_DIMENSION_TEXTURE2D, + { .desc_2d = { 4, 4, 3, 6, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, + (D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET), 0, + (D3D10_RESOURCE_MISC_GENERATE_MIPS | D3D10_RESOURCE_MISC_TEXTURECUBE) } }, + { 4, 4, 1, 6, 3, DDS_RESOURCE_MISC_TEXTURECUBE, DXGI_FORMAT_BC1_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, + D3DX10_IFF_DDS }, .todo_resource_desc = TRUE, + }, + /* + * Even with the autogen mips misc flag specified, the mip levels argument + * of load info is respected. + */ + { + test_dds_cube, sizeof(test_dds_cube), + { D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, 2, (D3D10_USAGE)D3DX10_DEFAULT, + (D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET), D3DX10_DEFAULT, D3D10_RESOURCE_MISC_GENERATE_MIPS, + DXGI_FORMAT_R8G8B8A8_UNORM, D3DX10_DEFAULT, D3DX10_DEFAULT }, + S_OK, D3D10_RESOURCE_DIMENSION_TEXTURE2D, + { .desc_2d = { 4, 4, 2, 6, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, + (D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET), 0, + (D3D10_RESOURCE_MISC_GENERATE_MIPS | D3D10_RESOURCE_MISC_TEXTURECUBE) } }, + { 4, 4, 1, 6, 3, DDS_RESOURCE_MISC_TEXTURECUBE, DXGI_FORMAT_BC1_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, + D3DX10_IFF_DDS }, .todo_resource_desc = TRUE, + }, +}; + +static const struct test_invalid_image_load_info +{ + const uint8_t *data; + uint32_t size; + D3DX10_IMAGE_LOAD_INFO load_info; + HRESULT expected_hr; + HRESULT expected_process_hr; + HRESULT expected_create_device_object_hr; + BOOL todo_hr; + BOOL todo_process_hr; + BOOL todo_create_device_object_hr; +} +test_invalid_image_load_info[] = +{ + /* + * A depth value that isn't D3DX10_FROM_FILE/D3DX10_DEFAULT/0 on a 2D + * texture results in failure. + */ + { + test_dds_32bpp, sizeof(test_dds_32bpp), + { D3DX10_DEFAULT, D3DX10_DEFAULT, 2, D3DX10_DEFAULT, D3DX10_DEFAULT, (D3D10_USAGE)D3DX10_DEFAULT, + D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT }, + E_FAIL, E_FAIL, + }, + /* Invalid filter value. */ + { + test_dds_32bpp, sizeof(test_dds_32bpp), + { D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, (D3D10_USAGE)D3DX10_DEFAULT, + D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, 7, D3DX10_DEFAULT }, + D3DERR_INVALIDCALL, D3DERR_INVALIDCALL, + }, + /* Invalid mipfilter value, only checked if mips are generated. */ + { + test_dds_32bpp, sizeof(test_dds_32bpp), + { D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, (D3D10_USAGE)D3DX10_DEFAULT, + D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, 7 }, + S_OK, S_OK, S_OK + }, + /* Invalid mipfilter value. */ + { + test_dds_32bpp, sizeof(test_dds_32bpp), + { 2, 2, D3DX10_DEFAULT, D3DX10_DEFAULT, 2, (D3D10_USAGE)D3DX10_DEFAULT, + D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, 7 }, + D3DERR_INVALIDCALL, D3DERR_INVALIDCALL, + }, + /* + * Usage/BindFlags/CpuAccessFlags are validated in the call to + * CreateDeviceObject(). + */ + { + test_dds_32bpp, sizeof(test_dds_32bpp), + { D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3D10_CPU_ACCESS_READ, D3D10_USAGE_DYNAMIC, + D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT }, + E_INVALIDARG, S_OK, E_INVALIDARG, .todo_hr = TRUE, .todo_create_device_object_hr = TRUE, + }, + { + test_dds_32bpp, sizeof(test_dds_32bpp), + { D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3D10_USAGE_DEFAULT, + D3D10_BIND_DEPTH_STENCIL, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT }, + E_INVALIDARG, S_OK, E_INVALIDARG, .todo_hr = TRUE, .todo_create_device_object_hr = TRUE, + }, + /* + * D3D10_RESOURCE_MISC_GENERATE_MIPS requires binding as a shader resource + * and a render target. + */ + { + test_dds_32bpp, sizeof(test_dds_32bpp), + { D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3D10_USAGE_DEFAULT, + D3DX10_DEFAULT, D3DX10_DEFAULT, D3D10_RESOURCE_MISC_GENERATE_MIPS, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT }, + E_INVALIDARG, S_OK, E_INVALIDARG, .todo_hr = TRUE, .todo_create_device_object_hr = TRUE, + }, + /* Can't set the cube texture flag if the image isn't a cube texture. */ + { + test_dds_32bpp, sizeof(test_dds_32bpp), + { D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3D10_USAGE_DEFAULT, + D3DX10_DEFAULT, D3DX10_DEFAULT, D3D10_RESOURCE_MISC_TEXTURECUBE, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT }, + E_INVALIDARG, S_OK, E_INVALIDARG, .todo_hr = TRUE, .todo_create_device_object_hr = TRUE, + }, +}; + + static WCHAR temp_dir[MAX_PATH]; static DXGI_FORMAT block_compressed_formats[] = @@ -1376,7 +1586,97 @@ static inline void check_image_info_values_(uint32_t line, const D3DX10_IMAGE_IN image_file_format, info->ImageFileFormat); } -static ID3D10Texture2D *get_texture2d_readback(ID3D10Texture2D *texture) +#define check_texture2d_desc_values(desc, width, height, mip_levels, array_size, format, sample_count, sample_quality, \ + usage, bind_flags, cpu_access_flags, misc_flags, wine_todo) \ + check_texture2d_desc_values_(__LINE__, desc, width, height, mip_levels, array_size, format, sample_count, sample_quality, \ + usage, bind_flags, cpu_access_flags, misc_flags, wine_todo) +static inline void check_texture2d_desc_values_(uint32_t line, const D3D10_TEXTURE2D_DESC *desc, uint32_t width, + uint32_t height, uint32_t mip_levels, uint32_t array_size, DXGI_FORMAT format, uint32_t sample_count, + uint32_t sample_quality, D3D10_USAGE usage, uint32_t bind_flags, uint32_t cpu_access_flags, uint32_t misc_flags, + BOOL wine_todo) +{ + const D3D10_TEXTURE2D_DESC expected_desc = { width, height, mip_levels, array_size, format, { sample_count, sample_quality }, + usage, bind_flags, cpu_access_flags, misc_flags }; + BOOL matched; + + matched = !memcmp(&expected_desc, desc, sizeof(*desc)); + todo_wine_if(wine_todo) ok_(__FILE__, line)(matched, "Got unexpected 2D texture desc values.\n"); + if (matched) + return; + + todo_wine_if(wine_todo && desc->Width != width) + ok_(__FILE__, line)(desc->Width == width, "Expected width %u, got %u.\n", width, desc->Width); + todo_wine_if(wine_todo && desc->Height != height) + ok_(__FILE__, line)(desc->Height == height, "Expected height %u, got %u.\n", height, desc->Height); + todo_wine_if(wine_todo && desc->ArraySize != array_size) + ok_(__FILE__, line)(desc->ArraySize == array_size, "Expected array_size %u, got %u.\n", array_size, + desc->ArraySize); + todo_wine_if(wine_todo && desc->MipLevels != mip_levels) + ok_(__FILE__, line)(desc->MipLevels == mip_levels, "Expected mip_levels %u, got %u.\n", mip_levels, + desc->MipLevels); + ok_(__FILE__, line)(desc->Format == format, "Expected texture format %#x, got %#x.\n", format, desc->Format); + todo_wine_if(wine_todo && desc->SampleDesc.Count != sample_count) + ok_(__FILE__, line)(desc->SampleDesc.Count == sample_count, "Expected sample_count %u, got %u.\n", sample_count, + desc->SampleDesc.Count); + todo_wine_if(wine_todo && desc->SampleDesc.Quality != sample_quality) + ok_(__FILE__, line)(desc->SampleDesc.Quality == sample_quality, "Expected sample_quality %u, got %u.\n", sample_quality, + desc->SampleDesc.Quality); + todo_wine_if(wine_todo && desc->Usage != usage) + ok_(__FILE__, line)(desc->Usage == usage, "Expected usage %u, got %u.\n", usage, + desc->Usage); + todo_wine_if(wine_todo && desc->BindFlags != bind_flags) + ok_(__FILE__, line)(desc->BindFlags == bind_flags, "Expected bind_flags %#x, got %#x.\n", bind_flags, + desc->BindFlags); + todo_wine_if(wine_todo && desc->CPUAccessFlags != cpu_access_flags) + ok_(__FILE__, line)(desc->CPUAccessFlags == cpu_access_flags, "Expected cpu_access_flags %#x, got %#x.\n", + cpu_access_flags, desc->CPUAccessFlags); + todo_wine_if(wine_todo && desc->MiscFlags != misc_flags) + ok_(__FILE__, line)(desc->MiscFlags == misc_flags, "Expected misc_flags %#x, got %#x.\n", misc_flags, + desc->MiscFlags); +} + +#define check_texture3d_desc_values(desc, width, height, depth, mip_levels, format, usage, bind_flags, cpu_access_flags, \ + misc_flags, wine_todo) \ + check_texture3d_desc_values_(__LINE__, desc, width, height, depth, mip_levels, format, usage, bind_flags, \ + cpu_access_flags, misc_flags, wine_todo) +static inline void check_texture3d_desc_values_(uint32_t line, const D3D10_TEXTURE3D_DESC *desc, uint32_t width, + uint32_t height, uint32_t depth, uint32_t mip_levels, DXGI_FORMAT format, D3D10_USAGE usage, uint32_t bind_flags, + uint32_t cpu_access_flags, uint32_t misc_flags, BOOL wine_todo) +{ + const D3D10_TEXTURE3D_DESC expected_desc = { width, height, depth, mip_levels, format, usage, bind_flags, + cpu_access_flags, misc_flags }; + BOOL matched; + + matched = !memcmp(&expected_desc, desc, sizeof(*desc)); + todo_wine_if(wine_todo) ok_(__FILE__, line)(matched, "Got unexpected 3D texture desc values.\n"); + if (matched) + return; + + todo_wine_if(wine_todo && desc->Width != width) + ok_(__FILE__, line)(desc->Width == width, "Expected width %u, got %u.\n", width, desc->Width); + todo_wine_if(wine_todo && desc->Height != height) + ok_(__FILE__, line)(desc->Height == height, "Expected height %u, got %u.\n", height, desc->Height); + todo_wine_if(wine_todo && desc->Depth != depth) + ok_(__FILE__, line)(desc->Depth == depth, "Expected depth %u, got %u.\n", depth, desc->Depth); + todo_wine_if(wine_todo && desc->MipLevels != mip_levels) + ok_(__FILE__, line)(desc->MipLevels == mip_levels, "Expected mip_levels %u, got %u.\n", mip_levels, + desc->MipLevels); + ok_(__FILE__, line)(desc->Format == format, "Expected texture format %#x, got %#x.\n", format, desc->Format); + todo_wine_if(wine_todo && desc->Usage != usage) + ok_(__FILE__, line)(desc->Usage == usage, "Expected usage %u, got %u.\n", usage, + desc->Usage); + todo_wine_if(wine_todo && desc->BindFlags != bind_flags) + ok_(__FILE__, line)(desc->BindFlags == bind_flags, "Expected bind_flags %#x, got %#x.\n", bind_flags, + desc->BindFlags); + todo_wine_if(wine_todo && desc->CPUAccessFlags != cpu_access_flags) + ok_(__FILE__, line)(desc->CPUAccessFlags == cpu_access_flags, "Expected cpu_access_flags %#x, got %#x.\n", + cpu_access_flags, desc->CPUAccessFlags); + todo_wine_if(wine_todo && desc->MiscFlags != misc_flags) + ok_(__FILE__, line)(desc->MiscFlags == misc_flags, "Expected misc_flags %#x, got %#x.\n", misc_flags, + desc->MiscFlags); +} + +static ID3D10Texture2D *get_texture2d_readback_iface(ID3D10Texture2D *texture) { D3D10_TEXTURE2D_DESC desc; ID3D10Texture2D *readback; @@ -1402,7 +1702,7 @@ static ID3D10Texture2D *get_texture2d_readback(ID3D10Texture2D *texture) return readback; } -static ID3D10Texture3D *get_texture3d_readback(ID3D10Texture3D *texture) +static ID3D10Texture3D *get_texture3d_readback_iface(ID3D10Texture3D *texture) { D3D10_TEXTURE3D_DESC desc; ID3D10Texture3D *readback; @@ -1428,6 +1728,60 @@ static ID3D10Texture3D *get_texture3d_readback(ID3D10Texture3D *texture) return readback; } +#define check_test_image_load_info_resource(resource, image_load_info) \ + check_test_image_load_info_resource_(__LINE__, resource, image_load_info) +static void check_test_image_load_info_resource_(uint32_t line, ID3D10Resource *resource, + const struct test_image_load_info *image_load_info) +{ + D3D10_RESOURCE_DIMENSION resource_dimension; + HRESULT hr; + + ID3D10Resource_GetType(resource, &resource_dimension); + ok(resource_dimension == image_load_info->expected_type, "Got unexpected ResourceDimension %u, expected %u.\n", + resource_dimension, image_load_info->expected_type); + + switch (resource_dimension) + { + case D3D10_RESOURCE_DIMENSION_TEXTURE2D: + { + const D3D10_TEXTURE2D_DESC *expected_desc_2d = &image_load_info->expected_resource_desc.desc_2d; + D3D10_TEXTURE2D_DESC desc_2d; + ID3D10Texture2D *tex_2d; + + hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture2D, (void **)&tex_2d); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ID3D10Texture2D_GetDesc(tex_2d, &desc_2d); + check_texture2d_desc_values_(line, &desc_2d, expected_desc_2d->Width, expected_desc_2d->Height, + expected_desc_2d->MipLevels, expected_desc_2d->ArraySize, expected_desc_2d->Format, + expected_desc_2d->SampleDesc.Count, expected_desc_2d->SampleDesc.Quality, expected_desc_2d->Usage, + expected_desc_2d->BindFlags, expected_desc_2d->CPUAccessFlags, expected_desc_2d->MiscFlags, + image_load_info->todo_resource_desc); + ID3D10Texture2D_Release(tex_2d); + break; + } + + case D3D10_RESOURCE_DIMENSION_TEXTURE3D: + { + const D3D10_TEXTURE3D_DESC *expected_desc_3d = &image_load_info->expected_resource_desc.desc_3d; + D3D10_TEXTURE3D_DESC desc_3d; + ID3D10Texture3D *tex_3d; + + hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture3D, (void **)&tex_3d); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ID3D10Texture3D_GetDesc(tex_3d, &desc_3d); + check_texture3d_desc_values_(line, &desc_3d, expected_desc_3d->Width, expected_desc_3d->Height, + expected_desc_3d->Depth, expected_desc_3d->MipLevels, expected_desc_3d->Format, expected_desc_3d->Usage, + expected_desc_3d->BindFlags, expected_desc_3d->CPUAccessFlags, expected_desc_3d->MiscFlags, + image_load_info->todo_resource_desc); + ID3D10Texture3D_Release(tex_3d); + break; + } + + default: + break; + } +} + static void check_resource_info(ID3D10Resource *resource, const struct test_image *image, unsigned int line) { unsigned int expected_mip_levels, expected_width, expected_height, max_dimension; @@ -1550,7 +1904,7 @@ static void check_texture2d_data(ID3D10Texture2D *texture, const struct test_ima BOOL line_match; HRESULT hr; - readback = get_texture2d_readback(texture); + readback = get_texture2d_readback_iface(texture); ok_(__FILE__, line)(readback != NULL, "Failed to get texture readback.\n"); if (!readback) return; @@ -1604,7 +1958,7 @@ static void check_texture3d_data(ID3D10Texture3D *texture, const struct test_ima BOOL line_match; HRESULT hr; - readback = get_texture3d_readback(texture); + readback = get_texture3d_readback_iface(texture); ok_(__FILE__, line)(readback != NULL, "Failed to get texture readback.\n"); if (!readback) return; @@ -1665,6 +2019,172 @@ static void check_resource_data(ID3D10Resource *resource, const struct test_imag } } +/* + * Taken from the d3d10core tests. If there's a missing resource type or + * texture format checking function, check to see if it exists there first. + */ +struct resource_readback +{ + D3D10_RESOURCE_DIMENSION dimension; + ID3D10Resource *resource; + D3D10_MAPPED_TEXTURE3D map_desc; + uint32_t width, height, depth, sub_resource_idx; +}; + +static void get_texture_readback(ID3D10Texture2D *texture, uint32_t sub_resource_idx, + struct resource_readback *rb) +{ + D3D10_TEXTURE2D_DESC texture_desc; + D3D10_MAPPED_TEXTURE2D map_desc; + uint32_t miplevel; + ID3D10Device *device; + HRESULT hr; + + memset(rb, 0, sizeof(*rb)); + rb->dimension = D3D10_RESOURCE_DIMENSION_TEXTURE2D; + + ID3D10Texture2D_GetDevice(texture, &device); + + ID3D10Texture2D_GetDesc(texture, &texture_desc); + texture_desc.Usage = D3D10_USAGE_STAGING; + texture_desc.BindFlags = 0; + texture_desc.CPUAccessFlags = D3D10_CPU_ACCESS_READ; + texture_desc.MiscFlags = 0; + if (FAILED(hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, (ID3D10Texture2D **)&rb->resource))) + { + trace("Failed to create texture, hr %#lx.\n", hr); + ID3D10Device_Release(device); + return; + } + + miplevel = sub_resource_idx % texture_desc.MipLevels; + rb->width = max(1, texture_desc.Width >> miplevel); + rb->height = max(1, texture_desc.Height >> miplevel); + rb->depth = 1; + rb->sub_resource_idx = sub_resource_idx; + + ID3D10Device_CopyResource(device, rb->resource, (ID3D10Resource *)texture); + if (FAILED(hr = ID3D10Texture2D_Map((ID3D10Texture2D *)rb->resource, sub_resource_idx, + D3D10_MAP_READ, 0, &map_desc))) + { + trace("Failed to map sub-resource %u, hr %#lx.\n", sub_resource_idx, hr); + ID3D10Resource_Release(rb->resource); + rb->resource = NULL; + } + rb->map_desc.pData = map_desc.pData; + rb->map_desc.RowPitch = map_desc.RowPitch; + rb->map_desc.DepthPitch = 0; + + ID3D10Device_Release(device); +} + +static void *get_readback_data(struct resource_readback *rb, uint32_t x, uint32_t y, unsigned byte_width) +{ + return (uint8_t *)rb->map_desc.pData + y * rb->map_desc.RowPitch + x * byte_width; +} + +static uint32_t get_readback_u32(struct resource_readback *rb, uint32_t x, uint32_t y) +{ + return *(uint32_t *)get_readback_data(rb, x, y, sizeof(uint32_t)); +} + +static uint32_t get_readback_color(struct resource_readback *rb, uint32_t x, uint32_t y) +{ + return get_readback_u32(rb, x, y); +} + +static void release_resource_readback(struct resource_readback *rb) +{ + switch (rb->dimension) + { + case D3D10_RESOURCE_DIMENSION_BUFFER: + ID3D10Buffer_Unmap((ID3D10Buffer *)rb->resource); + break; + case D3D10_RESOURCE_DIMENSION_TEXTURE1D: + ID3D10Texture1D_Unmap((ID3D10Texture1D *)rb->resource, rb->sub_resource_idx); + break; + case D3D10_RESOURCE_DIMENSION_TEXTURE2D: + ID3D10Texture2D_Unmap((ID3D10Texture2D *)rb->resource, rb->sub_resource_idx); + break; + case D3D10_RESOURCE_DIMENSION_TEXTURE3D: + ID3D10Texture3D_Unmap((ID3D10Texture3D *)rb->resource, rb->sub_resource_idx); + break; + default: + trace("Unhandled resource dimension %#x.\n", rb->dimension); + break; + } + ID3D10Resource_Release(rb->resource); +} + +static BOOL compare_color(uint32_t c1, uint32_t c2, uint8_t max_diff) +{ + return compare_uint(c1 & 0xff, c2 & 0xff, max_diff) + && compare_uint((c1 >> 8) & 0xff, (c2 >> 8) & 0xff, max_diff) + && compare_uint((c1 >> 16) & 0xff, (c2 >> 16) & 0xff, max_diff) + && compare_uint((c1 >> 24) & 0xff, (c2 >> 24) & 0xff, max_diff); +} + +#define check_readback_data_color(a, b, c, d) check_readback_data_color_(__LINE__, a, b, c, d) +static void check_readback_data_color_(uint32_t line, struct resource_readback *rb, + const RECT *rect, uint32_t expected_color, uint8_t max_diff) +{ + unsigned int x = 0, y = 0, color = 0; + BOOL all_match = FALSE; + RECT default_rect; + + if (!rect) + { + SetRect(&default_rect, 0, 0, rb->width, rb->height); + rect = &default_rect; + } + + for (y = rect->top; y < rect->bottom; ++y) + { + for (x = rect->left; x < rect->right; ++x) + { + color = get_readback_color(rb, x, y); + if (!compare_color(color, expected_color, max_diff)) + goto done; + } + } + all_match = TRUE; + +done: + ok_(__FILE__, line)(all_match, + "Got 0x%08x, expected 0x%08x at (%u, %u), sub-resource %u.\n", + color, expected_color, x, y, rb->sub_resource_idx); +} + +#define check_texture_sub_resource_color(a, b, c, d, e) check_texture_sub_resource_color_(__LINE__, a, b, c, d, e) +static void check_texture_sub_resource_color_(uint32_t line, ID3D10Texture2D *texture, + uint32_t sub_resource_idx, const RECT *rect, uint32_t expected_color, uint8_t max_diff) +{ + struct resource_readback rb; + + get_texture_readback(texture, sub_resource_idx, &rb); + check_readback_data_color_(line, &rb, rect, expected_color, max_diff); + release_resource_readback(&rb); +} + +static void set_d3dx10_image_load_info(D3DX10_IMAGE_LOAD_INFO *info, uint32_t width, uint32_t height, uint32_t depth, + uint32_t first_mip_level, uint32_t mip_levels, D3D10_USAGE usage, uint32_t bind_flags, uint32_t cpu_access_flags, + uint32_t misc_flags, DXGI_FORMAT format, uint32_t filter, uint32_t mip_filter, D3DX10_IMAGE_INFO *src_info) +{ + info->Width = width; + info->Height = height; + info->Depth = depth; + info->FirstMipLevel = first_mip_level; + info->MipLevels = mip_levels; + info->Usage = usage; + info->BindFlags = bind_flags; + info->CpuAccessFlags = cpu_access_flags; + info->MiscFlags = misc_flags; + info->Format = format; + info->Filter = filter; + info->MipFilter = mip_filter; + info->pSrcInfo = src_info; +} + static void test_D3DX10UnsetAllDeviceObjects(void) { static const D3D10_INPUT_ELEMENT_DESC layout_desc[] = @@ -2485,6 +3005,35 @@ static void test_D3DX10CreateAsyncTextureProcessor(void) winetest_pop_context(); } + for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) + { + const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; + D3DX10_IMAGE_LOAD_INFO load_info = test_load_info->load_info; + + winetest_push_context("Test %u", i); + + hr = D3DX10CreateAsyncTextureProcessor(device, &load_info, &dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = ID3DX10DataProcessor_Process(dp, (void *)test_load_info->data, test_load_info->size); + todo_wine_if(test_load_info->todo_process_hr) + ok(hr == test_load_info->expected_process_hr, "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + resource = NULL; + hr = ID3DX10DataProcessor_CreateDeviceObject(dp, (void **)&resource); + todo_wine_if(test_load_info->todo_create_device_object_hr) + ok(hr == test_load_info->expected_create_device_object_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D10Resource_Release(resource); + } + + hr = ID3DX10DataProcessor_Destroy(dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + winetest_pop_context(); + } + CoUninitialize(); ok(!ID3D10Device_Release(device), "Unexpected refcount.\n"); @@ -3476,14 +4025,19 @@ static void test_get_image_info(void) static void test_create_texture(void) { + static const uint32_t dds_24bit_8_8_mip_level_expected[] = { 0xff0000ff, 0xff00ff00, 0xffff0000, 0xff000000 }; static const WCHAR test_resource_name[] = L"resource.data"; static const WCHAR test_filename[] = L"image.data"; + D3D10_TEXTURE2D_DESC tex_2d_desc; + D3DX10_IMAGE_LOAD_INFO load_info; + D3DX10_IMAGE_INFO img_info; ID3D10Resource *resource; + ID3D10Texture2D *tex_2d; HMODULE resource_module; ID3D10Device *device; WCHAR path[MAX_PATH]; + uint32_t i, mip_level; HRESULT hr, hr2; - unsigned int i; device = create_device(); if (!device) @@ -3550,6 +4104,114 @@ static void test_create_texture(void) winetest_pop_context(); } + for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) + { + const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; + + winetest_push_context("Test %u", i); + + hr2 = 0xdeadbeef; + load_info = test_load_info->load_info; + hr = D3DX10CreateTextureFromMemory(device, test_load_info->data, test_load_info->size, &load_info, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D10Resource_Release(resource); + + winetest_pop_context(); + } + + for (i = 0; i < ARRAY_SIZE(test_image_load_info); ++i) + { + const struct test_image_load_info *test_load_info = &test_image_load_info[i]; + + winetest_push_context("Test %u", i); + + load_info = test_load_info->load_info; + load_info.pSrcInfo = &img_info; + + resource = NULL; + hr2 = 0xdeadbeef; + hr = D3DX10CreateTextureFromMemory(device, test_load_info->data, test_load_info->size, &load_info, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + check_test_image_load_info_resource(resource, test_load_info); + ID3D10Resource_Release(resource); + } + + winetest_pop_context(); + } + + /* Check behavior of the FirstMipLevel argument. */ + for (i = 0; i < 2; ++i) + { + winetest_push_context("FirstMipLevel %u", i); + memset(&img_info, 0, sizeof(img_info)); + set_d3dx10_image_load_info(&load_info, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, i, D3DX10_FROM_FILE, + D3D10_USAGE_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, + D3DX10_DEFAULT, &img_info); + + resource = NULL; + hr2 = 0xdeadbeef; + hr = D3DX10CreateTextureFromMemory(device, dds_24bit_8_8, sizeof(dds_24bit_8_8), &load_info, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, + D3DX10_IFF_DDS, FALSE); + + hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture2D, (void **)&tex_2d); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + ID3D10Texture2D_GetDesc(tex_2d, &tex_2d_desc); + check_texture2d_desc_values(&tex_2d_desc, 8, 8, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, 0, FALSE); + for (mip_level = 0; mip_level < 4; ++mip_level) + { + winetest_push_context("MipLevel %u", mip_level); + todo_wine_if(i && mip_level != 3) check_texture_sub_resource_color(tex_2d, mip_level, NULL, + dds_24bit_8_8_mip_level_expected[min(3, mip_level + i)], 0); + winetest_pop_context(); + } + + ID3D10Texture2D_Release(tex_2d); + ID3D10Resource_Release(resource); + winetest_pop_context(); + } + + /* + * If FirstMipLevel is set to a value that is larger than the total number + * of mip levels in the image, it falls back to 0. + */ + memset(&img_info, 0, sizeof(img_info)); + set_d3dx10_image_load_info(&load_info, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, 5, D3DX10_FROM_FILE, + D3D10_USAGE_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, + D3DX10_DEFAULT, &img_info); + + resource = NULL; + hr2 = 0xdeadbeef; + hr = D3DX10CreateTextureFromMemory(device, dds_24bit_8_8, sizeof(dds_24bit_8_8), &load_info, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, + D3DX10_IFF_DDS, FALSE); + + hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture2D, (void **)&tex_2d); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ID3D10Texture2D_GetDesc(tex_2d, &tex_2d_desc); + check_texture2d_desc_values(&tex_2d_desc, 8, 8, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, 0, FALSE); + for (mip_level = 0; mip_level < 4; ++mip_level) + { + winetest_push_context("MipLevel %u", mip_level); + check_texture_sub_resource_color(tex_2d, mip_level, NULL, dds_24bit_8_8_mip_level_expected[mip_level], 0); + winetest_pop_context(); + } + + ID3D10Texture2D_Release(tex_2d); + ID3D10Resource_Release(resource); + hr2 = 0xdeadbeef; add_work_item_count = 0; hr = D3DX10CreateTextureFromMemory(device, test_image[0].data, test_image[0].size, @@ -3613,6 +4275,31 @@ static void test_create_texture(void) winetest_pop_context(); } + for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) + { + const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; + + winetest_push_context("Test %u", i); + create_file(test_filename, test_image[i].data, test_image[i].size, path); + load_info = test_load_info->load_info; + + hr2 = 0xdeadbeef; + hr = D3DX10CreateTextureFromFileW(device, path, &load_info, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D10Resource_Release(resource); + + hr = D3DX10CreateTextureFromFileA(device, get_str_a(path), &load_info, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D10Resource_Release(resource); + + delete_file(test_filename); + winetest_pop_context(); + } + /* D3DX10CreateTextureFromResource tests */ hr2 = 0xdeadbeef; @@ -3672,6 +4359,34 @@ static void test_create_texture(void) winetest_pop_context(); } + for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) + { + const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; + + winetest_push_context("Test %u", i); + resource_module = create_resource_module(test_resource_name, test_load_info->data, test_load_info->size); + load_info = test_load_info->load_info; + + hr2 = 0xdeadbeef; + hr = D3DX10CreateTextureFromResourceW(device, resource_module, + test_resource_name, &load_info, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D10Resource_Release(resource); + + hr2 = 0xdeadbeef; + hr = D3DX10CreateTextureFromResourceA(device, resource_module, + get_str_a(test_resource_name), &load_info, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D10Resource_Release(resource); + + delete_resource_module(test_resource_name, resource_module); + winetest_pop_context(); + } + CoUninitialize(); ok(!ID3D10Device_Release(device), "Unexpected refcount.\n"); From fee4626c099b8fc221df6a8a002bc0f22c977939 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 9 Aug 2024 12:29:20 -0400 Subject: [PATCH 0943/2542] d3dx10: Handle FirstMipLevel argument in load_texture_data(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 2 +- dlls/d3dx10_43/texture.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 3baf1faa6203..da1c0d48d2e0 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -4170,7 +4170,7 @@ static void test_create_texture(void) for (mip_level = 0; mip_level < 4; ++mip_level) { winetest_push_context("MipLevel %u", mip_level); - todo_wine_if(i && mip_level != 3) check_texture_sub_resource_color(tex_2d, mip_level, NULL, + check_texture_sub_resource_color(tex_2d, mip_level, NULL, dds_24bit_8_8_mip_level_expected[min(3, mip_level + i)], 0); winetest_pop_context(); } diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 49a9ec78acd1..8d21501dd495 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -706,6 +706,8 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO goto end; } + if (load_info->FirstMipLevel == D3DX10_DEFAULT || (load_info->FirstMipLevel >= img_info.MipLevels)) + load_info->FirstMipLevel = 0; if (load_info->Format == D3DX10_DEFAULT || load_info->Format == DXGI_FORMAT_FROM_FILE) load_info->Format = img_info.Format; fmt_desc = get_d3dx_pixel_format_info(d3dx_pixel_format_id_from_dxgi_format(load_info->Format)); @@ -741,7 +743,7 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO goto end; src_desc = get_d3dx_pixel_format_info(image.format); - loaded_mip_levels = min(img_info.MipLevels, load_info->MipLevels); + loaded_mip_levels = min((img_info.MipLevels - load_info->FirstMipLevel), load_info->MipLevels); for (i = 0; i < img_info.ArraySize; ++i) { struct volume dst_size = { load_info->Width, load_info->Height, load_info->Depth }; @@ -752,7 +754,7 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO const RECT unaligned_rect = { 0, 0, dst_size.width, dst_size.height }; struct d3dx_pixels src_pixels, dst_pixels; - hr = d3dx_image_get_pixels(&image, i, j, &src_pixels); + hr = d3dx_image_get_pixels(&image, i, j + load_info->FirstMipLevel, &src_pixels); if (FAILED(hr)) goto end; @@ -807,8 +809,6 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO } } - if (load_info->FirstMipLevel != D3DX10_DEFAULT && load_info->FirstMipLevel) - FIXME("load_info->FirstMipLevel is ignored.\n"); if (load_info->Usage != D3DX10_DEFAULT) FIXME("load_info->Usage is ignored.\n"); if (load_info->BindFlags != D3DX10_DEFAULT) From a329e12b1dc375e9416f4406060bc8ded38a5fc8 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 14 Aug 2024 10:29:59 -0400 Subject: [PATCH 0944/2542] d3dx10: Pass D3DX10_IMAGE_LOAD_INFO texture creation arguments through in load_texture_data(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 12 ++++++------ dlls/d3dx10_43/texture.c | 17 +++++------------ 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index da1c0d48d2e0..faf2154e4632 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -1034,7 +1034,7 @@ test_image_load_info[] = (D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET), 0, (D3D10_RESOURCE_MISC_GENERATE_MIPS | D3D10_RESOURCE_MISC_TEXTURECUBE) } }, { 4, 4, 1, 6, 3, DDS_RESOURCE_MISC_TEXTURECUBE, DXGI_FORMAT_BC1_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, - D3DX10_IFF_DDS }, .todo_resource_desc = TRUE, + D3DX10_IFF_DDS }, }, /* * Even with the autogen mips misc flag specified, the mip levels argument @@ -1050,7 +1050,7 @@ test_image_load_info[] = (D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET), 0, (D3D10_RESOURCE_MISC_GENERATE_MIPS | D3D10_RESOURCE_MISC_TEXTURECUBE) } }, { 4, 4, 1, 6, 3, DDS_RESOURCE_MISC_TEXTURECUBE, DXGI_FORMAT_BC1_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, - D3DX10_IFF_DDS }, .todo_resource_desc = TRUE, + D3DX10_IFF_DDS }, }, }; @@ -1107,13 +1107,13 @@ test_invalid_image_load_info[] = test_dds_32bpp, sizeof(test_dds_32bpp), { D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3D10_CPU_ACCESS_READ, D3D10_USAGE_DYNAMIC, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT }, - E_INVALIDARG, S_OK, E_INVALIDARG, .todo_hr = TRUE, .todo_create_device_object_hr = TRUE, + E_INVALIDARG, S_OK, E_INVALIDARG, }, { test_dds_32bpp, sizeof(test_dds_32bpp), { D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3D10_USAGE_DEFAULT, D3D10_BIND_DEPTH_STENCIL, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT }, - E_INVALIDARG, S_OK, E_INVALIDARG, .todo_hr = TRUE, .todo_create_device_object_hr = TRUE, + E_INVALIDARG, S_OK, E_INVALIDARG, }, /* * D3D10_RESOURCE_MISC_GENERATE_MIPS requires binding as a shader resource @@ -1123,14 +1123,14 @@ test_invalid_image_load_info[] = test_dds_32bpp, sizeof(test_dds_32bpp), { D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3D10_USAGE_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3D10_RESOURCE_MISC_GENERATE_MIPS, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT }, - E_INVALIDARG, S_OK, E_INVALIDARG, .todo_hr = TRUE, .todo_create_device_object_hr = TRUE, + E_INVALIDARG, S_OK, E_INVALIDARG, }, /* Can't set the cube texture flag if the image isn't a cube texture. */ { test_dds_32bpp, sizeof(test_dds_32bpp), { D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3D10_USAGE_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3D10_RESOURCE_MISC_TEXTURECUBE, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT }, - E_INVALIDARG, S_OK, E_INVALIDARG, .todo_hr = TRUE, .todo_create_device_object_hr = TRUE, + E_INVALIDARG, S_OK, E_INVALIDARG }, }; diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 8d21501dd495..67315942a29b 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -809,20 +809,13 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO } } - if (load_info->Usage != D3DX10_DEFAULT) - FIXME("load_info->Usage is ignored.\n"); - if (load_info->BindFlags != D3DX10_DEFAULT) - FIXME("load_info->BindFlags is ignored.\n"); - if (load_info->CpuAccessFlags != D3DX10_DEFAULT) - FIXME("load_info->CpuAccessFlags is ignored.\n"); - if (load_info->MiscFlags != D3DX10_DEFAULT) - FIXME("load_info->MiscFlags is ignored.\n"); if (load_info->pSrcInfo) *load_info->pSrcInfo = img_info; - load_info->Usage = D3D10_USAGE_DEFAULT; - load_info->BindFlags = D3D10_BIND_SHADER_RESOURCE; - load_info->CpuAccessFlags = 0; - load_info->MiscFlags = img_info.MiscFlags; + load_info->Usage = (load_info->Usage == D3DX10_DEFAULT) ? D3D10_USAGE_DEFAULT : load_info->Usage; + load_info->BindFlags = (load_info->BindFlags == D3DX10_DEFAULT) ? D3D10_BIND_SHADER_RESOURCE : load_info->BindFlags; + load_info->CpuAccessFlags = (load_info->CpuAccessFlags == D3DX10_DEFAULT) ? 0 : load_info->CpuAccessFlags; + load_info->MiscFlags = (load_info->MiscFlags == D3DX10_DEFAULT) ? 0 : load_info->MiscFlags; + load_info->MiscFlags |= img_info.MiscFlags; *resource_data = sub_rsrcs; sub_rsrcs = NULL; From aaf4aadd6c7401444fd152d5bfecb98a83390ce0 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 14 Aug 2024 11:17:59 -0400 Subject: [PATCH 0945/2542] d3dx10/tests: Add tests for D3DX10LoadTextureFromTexture(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 911 ++++++++++++++++++++++++++++++++++ 1 file changed, 911 insertions(+) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index faf2154e4632..53e00a52b20a 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -1159,6 +1159,22 @@ static BOOL is_block_compressed(DXGI_FORMAT format) return FALSE; } +static BOOL dxgi_format_is_8bpp_rgba(DXGI_FORMAT format) +{ + switch (format) + { + case DXGI_FORMAT_R8G8B8A8_TYPELESS: + case DXGI_FORMAT_R8G8B8A8_UNORM: + case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: + case DXGI_FORMAT_R8G8B8A8_UINT: + case DXGI_FORMAT_R8G8B8A8_SNORM: + case DXGI_FORMAT_R8G8B8A8_SINT: + return TRUE; + default: + return FALSE; + } +} + static unsigned int get_bpp_from_format(DXGI_FORMAT format) { switch (format) @@ -5833,6 +5849,900 @@ static void test_preprocess_shader(void) ID3D10Blob_Release(preprocessed); } +/* + * 4x4 RGBA cubemap with faces in the following order: blue, green, red, + * green/blue, red/blue, red/green. + */ +static const uint8_t rgba_4_4_cubemap[] = +{ + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff, + 0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff, + 0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff, + 0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff, + 0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff, + 0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff, + 0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff, + 0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff, + 0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff, + 0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff, + 0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff, + 0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff, + 0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff, + 0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, + 0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, + 0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, + 0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, +}; + +/* + * 8x8 (BC1-BC3) image data, four 4x4 blocks: + * +-----+-----+ + * |Blue |Green| + * | | | + * +-----+-----+ + * |Red |Black| + * | | | + * +-----+-----+ + */ +static const uint8_t bc1_8_8[] = +{ + 0x1f,0x00,0x1f,0x00,0xaa,0xaa,0xaa,0xaa,0xe0,0x07,0xe0,0x07,0xaa,0xaa,0xaa,0xaa, + 0x00,0xf8,0x00,0xf8,0xaa,0xaa,0xaa,0xaa,0x00,0x00,0x00,0x00,0xaa,0xaa,0xaa,0xaa, +}; + +static const uint8_t bc2_8_8[] = +{ + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x1f,0x00,0xaa,0xaa,0xaa,0xaa, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x07,0xe0,0x07,0xaa,0xaa,0xaa,0xaa, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0xf8,0x00,0xf8,0xaa,0xaa,0xaa,0xaa, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xaa,0xaa,0xaa,0xaa, +}; + +static const uint8_t bc3_8_8[] = +{ + 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x00,0x1f,0x00,0x00,0x00,0x00,0x00, + 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x07,0xe0,0x07,0x00,0x00,0x00,0x00, + 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x00,0xf8,0x00,0x00,0x00,0x00, + 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +}; + +static const uint8_t bc1_to_bc3_8_8_decompressed[] = +{ + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff, + 0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff, + 0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff, + 0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff, + 0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff, + 0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff, + 0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff, + 0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff, + 0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff, + 0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff, + 0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff, + 0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff, +}; + +static const uint8_t bc4_unorm_8_8[] = +{ + 0xff,0xff,0x49,0x92,0x24,0x49,0x92,0x24,0x80,0x80,0x49,0x92,0x24,0x49,0x92,0x24, + 0x00,0x00,0x49,0x92,0x24,0x49,0x92,0x24,0x40,0x40,0x49,0x92,0x24,0x49,0x92,0x24, +}; + +static const uint8_t r8_unorm_8_8_decompressed[] = +{ + 0xff,0xff,0xff,0xff,0x80,0x80,0x80,0x80,0xff,0xff,0xff,0xff,0x80,0x80,0x80,0x80, + 0xff,0xff,0xff,0xff,0x80,0x80,0x80,0x80,0xff,0xff,0xff,0xff,0x80,0x80,0x80,0x80, + 0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40, + 0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40, +}; + +static const uint8_t bc5_unorm_8_8[] = +{ + 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xdf,0xdf,0x00,0x00,0x00,0x00,0x00,0x00, + 0xbf,0xbf,0x00,0x00,0x00,0x00,0x00,0x00,0x9f,0x9f,0x00,0x00,0x00,0x00,0x00,0x00, + 0x7f,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x5f,0x00,0x00,0x00,0x00,0x00,0x00, + 0x3f,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x1f,0x00,0x00,0x00,0x00,0x00,0x00, +}; + +static const uint8_t r8g8_unorm_8_8_decompressed[] = +{ + 0xff,0xdf,0xff,0xdf,0xff,0xdf,0xff,0xdf,0xbf,0x9f,0xbf,0x9f,0xbf,0x9f,0xbf,0x9f, + 0xff,0xdf,0xff,0xdf,0xff,0xdf,0xff,0xdf,0xbf,0x9f,0xbf,0x9f,0xbf,0x9f,0xbf,0x9f, + 0xff,0xdf,0xff,0xdf,0xff,0xdf,0xff,0xdf,0xbf,0x9f,0xbf,0x9f,0xbf,0x9f,0xbf,0x9f, + 0xff,0xdf,0xff,0xdf,0xff,0xdf,0xff,0xdf,0xbf,0x9f,0xbf,0x9f,0xbf,0x9f,0xbf,0x9f, + 0x7f,0x5f,0x7f,0x5f,0x7f,0x5f,0x7f,0x5f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f, + 0x7f,0x5f,0x7f,0x5f,0x7f,0x5f,0x7f,0x5f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f, + 0x7f,0x5f,0x7f,0x5f,0x7f,0x5f,0x7f,0x5f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f, + 0x7f,0x5f,0x7f,0x5f,0x7f,0x5f,0x7f,0x5f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f, +}; + +/* + * DXGI_FORMAT_BC{4,5}_SNORM compression/decompression is bugged in + * native D3DX10/D3DX11. When decompressing, it seems to read the decompressed + * 8-bit channel values as signed normalized integers, but then clamps them to the + * unsigned normalized integer range. That means 0x00-0x7f present unique values, + * but anything from 0x80-0xff just gives the equivalent of 0x00. When this gets + * converted to an SNORM format such as DXGI_FORMAT_R8_SNORM, it gets mapped + * to the SNORM range, where 0x00 is -1.0f, and 0x7f is 1.0f. So effectively, + * it ends up with half of the range. + */ +static const uint8_t bc4_snorm_8_8[] = +{ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00, + 0x7f,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x5f,0x00,0x00,0x00,0x00,0x00,0x00, +}; + +static const uint8_t r8_snorm_8_8_decompressed[] = +{ + 0x81,0x81,0x81,0x81,0xc1,0xc1,0xc1,0xc1,0x81,0x81,0x81,0x81,0xc1,0xc1,0xc1,0xc1, + 0x81,0x81,0x81,0x81,0xc1,0xc1,0xc1,0xc1,0x81,0x81,0x81,0x81,0xc1,0xc1,0xc1,0xc1, + 0x7F,0x7F,0x7F,0x7F,0x3F,0x3F,0x3F,0x3F,0x7F,0x7F,0x7F,0x7F,0x3F,0x3F,0x3F,0x3F, + 0x7F,0x7F,0x7F,0x7F,0x3F,0x3F,0x3F,0x3F,0x7F,0x7F,0x7F,0x7F,0x3F,0x3F,0x3F,0x3F, +}; + +static const uint8_t bc5_snorm_8_8[] = +{ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00, + 0x1f,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x2f,0x2f,0x00,0x00,0x00,0x00,0x00,0x00, + 0x3e,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x4e,0x4e,0x00,0x00,0x00,0x00,0x00,0x00, + 0x5d,0x5d,0x00,0x00,0x00,0x00,0x00,0x00,0x6d,0x6d,0x00,0x00,0x00,0x00,0x00,0x00, +}; + +static const uint8_t r8g8_snorm_8_8_decompressed[] = +{ + 0x81,0xa1,0x81,0xa1,0x81,0xa1,0x81,0xa1,0xbf,0xdf,0xbf,0xdf,0xbf,0xdf,0xbf,0xdf, + 0x81,0xa1,0x81,0xa1,0x81,0xa1,0x81,0xa1,0xbf,0xdf,0xbf,0xdf,0xbf,0xdf,0xbf,0xdf, + 0x81,0xa1,0x81,0xa1,0x81,0xa1,0x81,0xa1,0xbf,0xdf,0xbf,0xdf,0xbf,0xdf,0xbf,0xdf, + 0x81,0xa1,0x81,0xa1,0x81,0xa1,0x81,0xa1,0xbf,0xdf,0xbf,0xdf,0xbf,0xdf,0xbf,0xdf, + 0xfd,0x1d,0xfd,0x1d,0xfd,0x1d,0xfd,0x1d,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b, + 0xfd,0x1d,0xfd,0x1d,0xfd,0x1d,0xfd,0x1d,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b, + 0xfd,0x1d,0xfd,0x1d,0xfd,0x1d,0xfd,0x1d,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b, + 0xfd,0x1d,0xfd,0x1d,0xfd,0x1d,0xfd,0x1d,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b, +}; + +static const uint8_t rgba_unorm_4_4[] = +{ + 0x10,0x20,0x30,0x40,0x50,0x60,0x70,0x80,0x90,0xa0,0xb0,0xc0,0xd0,0xe0,0xf0,0xff, + 0x14,0x24,0x34,0x44,0x54,0x64,0x74,0x84,0x94,0xa4,0xb4,0xc4,0xd4,0xe4,0xf4,0xff, + 0x18,0x28,0x38,0x48,0x58,0x68,0x78,0x88,0x98,0xa8,0xb8,0xc8,0xd8,0xe8,0xf8,0xff, + 0x1c,0x2c,0x3c,0x4c,0x5c,0x6c,0x7c,0x8c,0x9c,0xac,0xbc,0xcc,0xdc,0xec,0xfc,0xff, +}; + +static const uint8_t rgba_snorm_4_4[] = +{ + 0x91,0xa1,0xb1,0xc1,0xd1,0xe1,0xf1,0x00,0x10,0x20,0x30,0x40,0x50,0x60,0x70,0x7f, + 0x95,0xa5,0xb5,0xc5,0xd5,0xe5,0xf5,0x04,0x14,0x24,0x34,0x44,0x54,0x64,0x74,0x7f, + 0x99,0xa9,0xb9,0xc9,0xd9,0xe9,0xf9,0x08,0x18,0x28,0x38,0x48,0x58,0x68,0x78,0x7f, + 0x9d,0xad,0xbd,0xcd,0xdd,0xed,0xfd,0x0c,0x1c,0x2c,0x3c,0x4c,0x5c,0x6c,0x7c,0x7f, +}; + +/* Conversion to/from uint/sint. */ +static const uint8_t rgba_uint_4_4[] = +{ + 0x00,0x04,0x08,0x0c,0x10,0x14,0x18,0x1c,0x20,0x24,0x28,0x2c,0x30,0x34,0x38,0x3c, + 0x40,0x44,0x48,0x4c,0x50,0x54,0x58,0x5c,0x60,0x64,0x68,0x6c,0x70,0x74,0x78,0x7c, + 0x80,0x84,0x88,0x8c,0x90,0x94,0x98,0x9c,0xa0,0xa4,0xa8,0xac,0xb0,0xb4,0xb8,0xbc, + 0xc0,0xc4,0xc8,0xcc,0xd0,0xd4,0xd8,0xdc,0xe0,0xe4,0xe8,0xec,0xf0,0xf4,0xf8,0xfc, +}; + +static const uint8_t rgba_uint_to_sint_4_4[] = +{ + 0x00,0x04,0x08,0x0c,0x10,0x14,0x18,0x1c,0x20,0x24,0x28,0x2c,0x30,0x34,0x38,0x3c, + 0x40,0x44,0x48,0x4c,0x50,0x54,0x58,0x5c,0x60,0x64,0x68,0x6c,0x70,0x74,0x78,0x7c, + 0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f, + 0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f, +}; + +static const uint8_t rgba_sint_4_4[] = +{ + 0x80,0x84,0x88,0x8c,0x90,0x94,0x98,0x9c,0xa0,0xa4,0xa8,0xac,0xb0,0xb4,0xb8,0xbc, + 0xc0,0xc4,0xc8,0xcc,0xd0,0xd4,0xd8,0xdc,0xe0,0xe4,0xe8,0xec,0xf0,0xf4,0xf8,0xfc, + 0x00,0x04,0x08,0x0c,0x10,0x14,0x18,0x1c,0x20,0x24,0x28,0x2c,0x30,0x34,0x38,0x3c, + 0x40,0x44,0x48,0x4c,0x50,0x54,0x58,0x5c,0x60,0x64,0x68,0x6c,0x70,0x74,0x78,0x7c, +}; + +static const uint8_t rgba_sint_to_uint_4_4[] = +{ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x04,0x08,0x0c,0x10,0x14,0x18,0x1c,0x20,0x24,0x28,0x2c,0x30,0x34,0x38,0x3c, + 0x40,0x44,0x48,0x4c,0x50,0x54,0x58,0x5c,0x60,0x64,0x68,0x6c,0x70,0x74,0x78,0x7c, +}; + +/* Conversion to/from SRGB. */ +static const uint8_t rgba_unorm_srgb_4_4[] = +{ + 0x10,0x20,0x30,0x40,0x50,0x60,0x70,0x80,0x90,0xa0,0xb0,0xc0,0xd0,0xe0,0xf0,0xff, + 0x14,0x24,0x34,0x44,0x54,0x64,0x74,0x84,0x94,0xa4,0xb4,0xc4,0xd4,0xe4,0xf4,0xff, + 0x18,0x28,0x38,0x48,0x58,0x68,0x78,0x88,0x98,0xa8,0xb8,0xc8,0xd8,0xe8,0xf8,0xff, + 0x1c,0x2c,0x3c,0x4c,0x5c,0x6c,0x7c,0x8c,0x9c,0xac,0xbc,0xcc,0xdc,0xec,0xfc,0xff, +}; + +static const uint8_t rgba_unorm_srgb_to_unorm_non_srgb_4_4[] = +{ + 0x01,0x03,0x06,0x40,0x14,0x1e,0x2a,0x80,0x49,0x5b,0x71,0xc0,0xa3,0xc0,0xdf,0xff, + 0x01,0x03,0x08,0x44,0x16,0x21,0x2d,0x84,0x4d,0x61,0x77,0xc4,0xaa,0xc7,0xe7,0xff, + 0x01,0x04,0x09,0x48,0x19,0x23,0x31,0x88,0x52,0x66,0x7c,0xc8,0xb1,0xcf,0xf0,0xff, + 0x02,0x05,0x0b,0x4c,0x1b,0x27,0x34,0x8c,0x57,0x6b,0x82,0xcc,0xb8,0xd7,0xf8,0xff, +}; + +static const uint8_t rgba_unorm_non_srgb_4_4[] = +{ + 0x00,0x20,0x50,0x40,0x50,0x60,0x70,0x80,0x90,0xa0,0xb0,0xc0,0xd0,0xe0,0xf0,0xff, + 0x00,0x24,0x54,0x44,0x54,0x64,0x74,0x84,0x94,0xa4,0xb4,0xc4,0xd4,0xe4,0xf4,0xff, + 0x00,0x28,0x58,0x48,0x58,0x68,0x78,0x88,0x98,0xa8,0xb8,0xc8,0xd8,0xe8,0xf8,0xff, + 0x00,0x2c,0x5c,0x4c,0x5c,0x6c,0x7c,0x8c,0x9c,0xac,0xbc,0xcc,0xdc,0xec,0xfc,0xff, +}; + +static const uint8_t rgba_unorm_non_srgb_to_unorm_srgb_4_4[] = +{ + 0x00,0x63,0x97,0x40,0x97,0xa4,0xaf,0x80,0xc5,0xce,0xd7,0xc0,0xe8,0xf0,0xf8,0xff, + 0x00,0x69,0x9a,0x44,0x9a,0xa7,0xb2,0x84,0xc7,0xd1,0xda,0xc4,0xea,0xf2,0xfa,0xff, + 0x00,0x6e,0x9d,0x48,0x9d,0xaa,0xb5,0x88,0xca,0xd3,0xdc,0xc8,0xec,0xf4,0xfc,0xff, + 0x00,0x73,0xa0,0x4c,0xa0,0xad,0xb8,0x8c,0xcc,0xd5,0xde,0xcc,0xee,0xf6,0xfe,0xff, +}; + +static const struct test_texture_format_conversion +{ + D3D10_TEXTURE2D_DESC src_desc; + const uint8_t *src_data; + + DXGI_FORMAT dst_format; + const uint8_t *expected_dst_data; + + uint8_t max_diff; + BOOL todo_hr; + BOOL todo_data; +} +test_texture_format_conversion[] = +{ + { + { 8, 8, 1, 1, DXGI_FORMAT_BC1_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, + bc1_8_8, DXGI_FORMAT_R8G8B8A8_UNORM, bc1_to_bc3_8_8_decompressed + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_BC2_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, + bc2_8_8, DXGI_FORMAT_R8G8B8A8_UNORM, bc1_to_bc3_8_8_decompressed + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_BC3_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, + bc3_8_8, DXGI_FORMAT_R8G8B8A8_UNORM, bc1_to_bc3_8_8_decompressed + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_BC4_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, + bc4_unorm_8_8, DXGI_FORMAT_R8_UNORM, r8_unorm_8_8_decompressed + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_BC4_SNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, + bc4_snorm_8_8, DXGI_FORMAT_R8_SNORM, r8_snorm_8_8_decompressed, .todo_data = TRUE + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_BC5_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, + bc5_unorm_8_8, DXGI_FORMAT_R8G8_UNORM, r8g8_unorm_8_8_decompressed + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_BC5_SNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, + bc5_snorm_8_8, DXGI_FORMAT_R8G8_SNORM, r8g8_snorm_8_8_decompressed, .todo_data = TRUE + }, + { + { 4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, + /* + * Wine's UNORM->SNORM conversion doesn't always match Window's, + * worst case is a difference of +/- 1. + */ + rgba_unorm_4_4, DXGI_FORMAT_R8G8B8A8_SNORM, rgba_snorm_4_4, .max_diff = 1 + }, + { + { 4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_UINT, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, + rgba_uint_4_4, DXGI_FORMAT_R8G8B8A8_SINT, rgba_uint_to_sint_4_4, .todo_hr = TRUE + }, + { + { 4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_SINT, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, + rgba_sint_4_4, DXGI_FORMAT_R8G8B8A8_UINT, rgba_sint_to_uint_4_4, .todo_hr = TRUE + }, + { + { 4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, + rgba_unorm_srgb_4_4, DXGI_FORMAT_R8G8B8A8_UNORM, rgba_unorm_srgb_to_unorm_non_srgb_4_4, .todo_hr = TRUE + }, + { + { 4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, + rgba_unorm_non_srgb_4_4, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, rgba_unorm_non_srgb_to_unorm_srgb_4_4, .todo_hr = TRUE + }, +}; + +static const struct test_texture_compression +{ + D3D10_TEXTURE2D_DESC src_desc; + DXGI_FORMAT compressed_format; + const BYTE *src_data; +} +test_texture_compression[] = +{ + { + { 8, 8, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, + DXGI_FORMAT_BC1_UNORM, bc1_to_bc3_8_8_decompressed + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, + DXGI_FORMAT_BC2_UNORM, bc1_to_bc3_8_8_decompressed + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, + DXGI_FORMAT_BC3_UNORM, bc1_to_bc3_8_8_decompressed + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_R8_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, + DXGI_FORMAT_BC4_UNORM, r8_unorm_8_8_decompressed + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_R8G8_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, + DXGI_FORMAT_BC5_UNORM, r8g8_unorm_8_8_decompressed + }, +}; + +#define check_texture_data_level(tex_pixels, tex_row_pitch, tex_slice_pitch, width, height, depth, format, exp_pixels, max_diff, wine_todo) \ + check_texture_data_level_(tex_pixels, tex_row_pitch, tex_slice_pitch, width, height, depth, format, exp_pixels, max_diff, wine_todo, __LINE__) +static void check_texture_data_level_(const uint8_t *tex_pixels, uint32_t tex_row_pitch, uint32_t tex_slice_pitch, uint32_t width, + uint32_t height, uint32_t depth, DXGI_FORMAT format, const uint8_t *exp_pixels, uint8_t max_diff, BOOL wine_todo, uint32_t line) +{ + uint32_t line_height, exp_row_pitch, exp_slice_pitch, i, j, k; + BOOL line_match = FALSE; + + line_height = 1; + exp_row_pitch = (width * get_bpp_from_format(format) + 7) / 8; + exp_slice_pitch = exp_row_pitch * height; + if (is_block_compressed(format)) + { + exp_row_pitch *= 4; + line_height = 4; + } + + for (i = 0; i < depth; ++i) + { + const uint8_t *exp_slice = exp_pixels + (i * (exp_slice_pitch)); + const uint8_t *pixel_slice = tex_pixels + (i * tex_slice_pitch); + + for (j = 0; j < height; j += line_height) + { + if (dxgi_format_is_8bpp_rgba(format)) + { + for (k = 0; k < width; ++k) + { + const uint32_t exp_pixel = ((const uint32_t *)(exp_slice + j * exp_row_pitch))[k]; + const uint32_t tex_pixel = ((const uint32_t *)(pixel_slice + j * tex_row_pitch))[k]; + const BOOL pixel_match = compare_color(tex_pixel, exp_pixel, max_diff); + + todo_wine_if(wine_todo) ok_(__FILE__, line)(pixel_match, "Data mismatch for pixel (%ux%ux%u).\n", k, j, i); + line_match = pixel_match; + if (!pixel_match) + break; + } + } + else + { + line_match = !memcmp(exp_slice + exp_row_pitch * (j / line_height), + pixel_slice + tex_row_pitch * (j / line_height), exp_row_pitch); + todo_wine_if(wine_todo) ok_(__FILE__, line)(line_match, "Data mismatch for line %u, slice %u.\n", j, i); + } + if (!line_match) + break; + } + } +} + +static void set_d3dx10_texture_load_info(D3DX10_TEXTURE_LOAD_INFO *load_info, D3D10_BOX *src_box, D3D10_BOX *dst_box, + uint32_t src_first_mip, uint32_t dst_first_mip, uint32_t num_mips, uint32_t src_first_element, + uint32_t dst_first_element, uint32_t num_elems, uint32_t filter, uint32_t mip_filter) +{ + load_info->pSrcBox = src_box; + load_info->pDstBox = dst_box; + load_info->SrcFirstMip = src_first_mip; + load_info->DstFirstMip = dst_first_mip; + load_info->NumMips = num_mips; + load_info->SrcFirstElement = src_first_element; + load_info->DstFirstElement = dst_first_element; + load_info->NumElements = num_elems; + load_info->Filter = filter; + load_info->MipFilter = mip_filter; +} + +static void set_d3d10_2d_texture_desc(D3D10_TEXTURE2D_DESC *desc, uint32_t width, uint32_t height, uint32_t mip_levels, + uint32_t array_size, DXGI_FORMAT format, uint32_t sample_count, uint32_t sample_quality, uint32_t usage, + uint32_t bind_flags, uint32_t cpu_access_flags, uint32_t misc_flags) +{ + desc->Width = width; + desc->Height = height; + desc->MipLevels = mip_levels; + desc->ArraySize = array_size; + desc->Format = format; + desc->SampleDesc.Count = sample_count; + desc->SampleDesc.Quality = sample_quality; + desc->Usage = usage; + desc->BindFlags = bind_flags; + desc->CPUAccessFlags = cpu_access_flags; + desc->MiscFlags = misc_flags; +} + +static void init_subresource_data(D3D10_SUBRESOURCE_DATA *subresources, const void *data, uint32_t width, uint32_t height, + uint32_t depth, uint32_t mip_levels, uint32_t array_size, DXGI_FORMAT format) +{ + const uint8_t *pixel_ptr = data; + uint32_t i, j; + + for (i = 0; i < array_size; ++i) + { + uint32_t tmp_width, tmp_height, tmp_depth; + + tmp_width = width; + tmp_height = height; + tmp_depth = depth; + for (j = 0; j < mip_levels; ++j) + { + D3D10_SUBRESOURCE_DATA *subresource = &subresources[(i * mip_levels) + j]; + + subresource->pSysMem = pixel_ptr; + subresource->SysMemPitch = (tmp_width * get_bpp_from_format(format) + 7) / 8; + subresource->SysMemSlicePitch = subresource->SysMemPitch * tmp_height; + if (is_block_compressed(format)) + subresource->SysMemPitch *= 4; + pixel_ptr += (subresource->SysMemSlicePitch * tmp_depth); + + tmp_width = max(tmp_width / 2, 1); + tmp_height = max(tmp_height / 2, 1); + tmp_depth = max(tmp_depth / 2, 1); + } + } +} + +static uint8_t *init_buffer_color(uint8_t *buf, uint32_t color, uint32_t width, uint32_t height, uint32_t depth) +{ + uint32_t i, total_pixels = width * height * depth; + uint32_t *color_buf = (uint32_t *)buf; + + for (i = 0; i < total_pixels; ++i) + color_buf[i] = color; + return buf + (total_pixels * 4); +} + +static void set_texture_sub_resource_color(ID3D10Device *device, ID3D10Resource *rsrc, uint32_t idx, uint32_t color, + uint32_t width, uint32_t height, uint32_t depth) +{ + uint8_t tmp_buf[1024]; + + init_buffer_color(tmp_buf, color, width, height, depth); + ID3D10Device_UpdateSubresource(device, rsrc, idx, NULL, (const void *)tmp_buf, width * sizeof(color), + width * height * sizeof(color)); +} + +static void test_D3DX10LoadTextureFromTexture(void) +{ + static const uint32_t test_cubemap_face_colors[] = { 0xffff0000, 0xff00ff00, 0xff0000ff, 0xffffff00, 0xffff00ff, 0xff00ffff }; + static const uint32_t test_tex_2d_array_colors[] = { 0xff0000ff, 0xff00ff00, 0xffff0000, 0xff000000 }; + D3D10_SUBRESOURCE_DATA sub_resource_data[6] = { 0 }; + D3DX10_TEXTURE_LOAD_INFO load_info; + ID3D10Texture2D *tex_2d, *tex2_2d; + D3D10_TEXTURE2D_DESC tex_2d_desc; + uint8_t tmp_buf[1024], *tmp_ptr; + ID3D10Device *device; + RECT tmp_rect; + uint32_t i; + HRESULT hr; + + if (!strcmp(winetest_platform, "wine")) + { + skip("Skipping D3DX10LoadTextureFromTexture() tests.\n"); + return; + } + + device = create_device(); + if (!device) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + CoInitialize(NULL); + + /* + * Tests that still need to be written: + * -pSrcBox/pDstBox, how they behave WRT mip levels, too large, too small. + * -3D texture test. + */ + + /* 8x8 2D texture array with 2 elements and 2 mip levels. */ + tmp_ptr = tmp_buf; + for (i = 0; i < ARRAY_SIZE(test_tex_2d_array_colors); ++i) + tmp_ptr = init_buffer_color(tmp_ptr, test_tex_2d_array_colors[i], !(i & 0x1) ? 8 : 4, !(i & 0x1) ? 8 : 4, 1); + + set_d3d10_2d_texture_desc(&tex_2d_desc, 8, 8, 2, 2, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, 0); + init_subresource_data(sub_resource_data, (const void *)tmp_buf, tex_2d_desc.Width, tex_2d_desc.Height, 1, + tex_2d_desc.MipLevels, tex_2d_desc.ArraySize, tex_2d_desc.Format); + hr = ID3D10Device_CreateTexture2D(device, &tex_2d_desc, sub_resource_data, &tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < ARRAY_SIZE(test_tex_2d_array_colors); ++i) + check_texture_sub_resource_color(tex_2d, i, NULL, test_tex_2d_array_colors[i], 0); + + /* 8x8 2D texture with 4 mip levels. */ + memset(tmp_buf, 0xff, sizeof(tmp_buf)); + set_d3d10_2d_texture_desc(&tex_2d_desc, 8, 8, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, 0); + init_subresource_data(sub_resource_data, (const void *)tmp_buf, tex_2d_desc.Width, tex_2d_desc.Height, 1, + tex_2d_desc.MipLevels, tex_2d_desc.ArraySize, tex_2d_desc.Format); + hr = ID3D10Device_CreateTexture2D(device, &tex_2d_desc, sub_resource_data, &tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < 4; ++i) + check_texture_sub_resource_color(tex2_2d, i, NULL, 0xffffffff, 0); + + /* + * If a NULL load info argument is supplied, the default D3DX10_TEXTURE_LOAD_INFO + * values are used. The first 2 mip levels from tex_2d are loaded, and + * the last 2 mip levels of tex2_2d are generated from mip level 1. + */ + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex_2d, NULL, (ID3D10Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < 4; ++i) + check_texture_sub_resource_color(tex2_2d, i, NULL, test_tex_2d_array_colors[min(i, 1)], 0); + + /* Invalid Filter argument. */ + set_d3dx10_texture_load_info(&load_info, NULL, NULL, 0, 0, 0, 0, 0, 0, 9, D3DX10_DEFAULT); + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex_2d, &load_info, (ID3D10Resource *)tex2_2d); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); + + /* Filter argument of 0 is invalid. */ + set_d3dx10_texture_load_info(&load_info, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, D3DX10_DEFAULT); + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex_2d, &load_info, (ID3D10Resource *)tex2_2d); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); + + /* Invalid MipFilter argument. */ + set_d3dx10_texture_load_info(&load_info, NULL, NULL, 0, 0, 0, 0, 0, 0, D3DX10_DEFAULT, 9); + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex_2d, &load_info, (ID3D10Resource *)tex2_2d); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); + + /* MipFilter argument is only validated if mip levels are generated. */ + set_d3dx10_texture_load_info(&load_info, NULL, NULL, 0, 0, 2, 0, 0, 0, D3DX10_DEFAULT, 9); + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex_2d, &load_info, (ID3D10Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + /* + * Cannot use the same source/destination texture with matching first mip + * level and array element. + */ + set_d3dx10_texture_load_info(&load_info, NULL, NULL, 0, 0, 0, 0, 0, 0, D3DX10_DEFAULT, D3DX10_DEFAULT); + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex_2d, &load_info, (ID3D10Resource *)tex_2d); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); + + /* Same first mip level, different first element. */ + set_d3dx10_texture_load_info(&load_info, NULL, NULL, 0, 0, 0, 0, 1, 0, D3DX10_DEFAULT, D3DX10_DEFAULT); + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex_2d, &load_info, (ID3D10Resource *)tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < 2; ++i) + check_texture_sub_resource_color(tex_2d, 2 + i, NULL, test_tex_2d_array_colors[i], 0); + + /* Restore values. */ + for (i = 0; i < ARRAY_SIZE(test_tex_2d_array_colors); ++i) + { + set_texture_sub_resource_color(device, (ID3D10Resource *)tex_2d, i, test_tex_2d_array_colors[i], !(i & 0x1) ? 8 : 4, + !(i & 0x1) ? 8 : 4, 1); + check_texture_sub_resource_color(tex_2d, i, NULL, test_tex_2d_array_colors[i], 0); + } + + /* Same first array element, but different FirstMips. */ + set_d3dx10_texture_load_info(&load_info, NULL, NULL, 0, 1, 0, 0, 0, 0, D3DX10_DEFAULT, D3DX10_DEFAULT); + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex_2d, &load_info, (ID3D10Resource *)tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < 4; ++i) + check_texture_sub_resource_color(tex_2d, i, NULL, test_tex_2d_array_colors[(i < 2) ? 0 : 2], 0); + + for (i = 0; i < ARRAY_SIZE(test_tex_2d_array_colors); ++i) + { + set_texture_sub_resource_color(device, (ID3D10Resource *)tex_2d, i, test_tex_2d_array_colors[i], !(i & 0x1) ? 8 : 4, + !(i & 0x1) ? 8 : 4, 1); + check_texture_sub_resource_color(tex_2d, i, NULL, test_tex_2d_array_colors[i], 0); + } + + /* + * If SrcFirstElement/DstFirstElement are greater than the total number of + * elements, element 0 is used. + */ + set_d3dx10_texture_load_info(&load_info, NULL, NULL, 0, 0, 2, 2, 0, 0, D3DX10_DEFAULT, D3DX10_DEFAULT); + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex_2d, &load_info, (ID3D10Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < 2; ++i) + check_texture_sub_resource_color(tex2_2d, i, NULL, test_tex_2d_array_colors[i], 0); + + set_d3dx10_texture_load_info(&load_info, NULL, NULL, 0, 0, 2, 1, 0, 0, D3DX10_DEFAULT, D3DX10_DEFAULT); + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex_2d, &load_info, (ID3D10Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < 2; ++i) + check_texture_sub_resource_color(tex2_2d, i, NULL, test_tex_2d_array_colors[2 + i], 0); + + for (i = 0; i < 4; ++i) + { + set_texture_sub_resource_color(device, (ID3D10Resource *)tex2_2d, i, 0xff000000 | (0xff << (8 * i)), 8 >> i, 8 >> i, 1); + check_texture_sub_resource_color(tex2_2d, i, NULL, 0xff000000 | (0xff << (8 * i)), 0); + } + + /* DstFirstElement value tests. */ + set_d3dx10_texture_load_info(&load_info, NULL, NULL, 0, 0, 2, 0, 2, 0, D3DX10_DEFAULT, D3DX10_DEFAULT); + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex2_2d, &load_info, (ID3D10Resource *)tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < 2; ++i) + check_texture_sub_resource_color(tex_2d, i, NULL, 0xff000000 | (0xff << (8 * i)), 0); + for (i = 0; i < 2; ++i) + check_texture_sub_resource_color(tex_2d, 2 + i, NULL, test_tex_2d_array_colors[2 + i], 0); + + set_d3dx10_texture_load_info(&load_info, NULL, NULL, 0, 0, 2, 0, 1, 0, D3DX10_DEFAULT, D3DX10_DEFAULT); + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex2_2d, &load_info, (ID3D10Resource *)tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < 4; ++i) + check_texture_sub_resource_color(tex_2d, i, NULL, !(i & 0x01) ? 0xff0000ff : 0xff00ff00, 0); + + for (i = 0; i < 4; ++i) + { + set_texture_sub_resource_color(device, (ID3D10Resource *)tex_2d, i, test_tex_2d_array_colors[i], !(i & 0x1) ? 8 : 4, + !(i & 0x1) ? 8 : 4, 1); + check_texture_sub_resource_color(tex_2d, i, NULL, test_tex_2d_array_colors[i], 0); + + set_texture_sub_resource_color(device, (ID3D10Resource *)tex2_2d, i, 0xff000000 | (0xff << (8 * i)), 8 >> i, 8 >> i, 1); + check_texture_sub_resource_color(tex2_2d, i, NULL, 0xff000000 | (0xff << (8 * i)), 0); + } + + /* + * If SrcFirstMip is greater than the total number of mip levels, the + * final mip level is used, E.g, if SrcFirstMip is set to 3, but the + * texture only has 2 mip levels, mip level 2 is used. + */ + set_d3dx10_texture_load_info(&load_info, NULL, NULL, 2, 0, 1, 0, 0, 0, D3DX10_DEFAULT, D3DX10_DEFAULT); + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex_2d, &load_info, (ID3D10Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_texture_sub_resource_color(tex2_2d, 0, NULL, test_tex_2d_array_colors[1], 0); + + set_d3dx10_texture_load_info(&load_info, NULL, NULL, 0, 0, 1, 0, 0, 0, D3DX10_DEFAULT, D3DX10_DEFAULT); + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex_2d, &load_info, (ID3D10Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_texture_sub_resource_color(tex2_2d, 0, NULL, test_tex_2d_array_colors[0], 0); + + set_d3dx10_texture_load_info(&load_info, NULL, NULL, 1, 0, 1, 0, 0, 0, D3DX10_DEFAULT, D3DX10_DEFAULT); + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex_2d, &load_info, (ID3D10Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_texture_sub_resource_color(tex2_2d, 0, NULL, test_tex_2d_array_colors[1], 0); + + /* + * If DstFirstMip is greater than the total number of mips, nothing is + * loaded. + */ + set_d3dx10_texture_load_info(&load_info, NULL, NULL, 0, 5, 1, 0, 0, 0, D3DX10_DEFAULT, D3DX10_DEFAULT); + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex_2d, &load_info, (ID3D10Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_texture_sub_resource_color(tex2_2d, 0, NULL, test_tex_2d_array_colors[1], 0); + check_texture_sub_resource_color(tex2_2d, 3, NULL, 0xff000000, 0); + + set_d3dx10_texture_load_info(&load_info, NULL, NULL, 0, 3, 1, 0, 0, 0, D3DX10_DEFAULT, D3DX10_DEFAULT); + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex_2d, &load_info, (ID3D10Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_texture_sub_resource_color(tex2_2d, 3, NULL, test_tex_2d_array_colors[0], 0); + + ID3D10Texture2D_Release(tex2_2d); + ID3D10Texture2D_Release(tex_2d); + + for (i = 0; i < ARRAY_SIZE(test_texture_format_conversion); ++i) + { + const struct test_texture_format_conversion *test = &test_texture_format_conversion[i]; + const D3D10_TEXTURE2D_DESC *src_desc = &test->src_desc; + D3D10_TEXTURE2D_DESC tmp_desc = test->src_desc; + ID3D10Texture2D *src_texture, *dst_texture; + D3D10_MAPPED_TEXTURE2D map = { 0 }; + + winetest_push_context("Texture format conversion test %u", i); + src_texture = dst_texture = NULL; + + init_subresource_data(sub_resource_data, test->src_data, src_desc->Width, src_desc->Height, 1, + src_desc->MipLevels, src_desc->ArraySize, src_desc->Format); + hr = ID3D10Device_CreateTexture2D(device, src_desc, sub_resource_data, &src_texture); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_texture; + + tmp_desc.Format = test->dst_format; + tmp_desc.Usage = D3D10_USAGE_STAGING; + tmp_desc.BindFlags = 0; + tmp_desc.CPUAccessFlags = D3D10_CPU_ACCESS_READ; + hr = ID3D10Device_CreateTexture2D(device, &tmp_desc, NULL, &dst_texture); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_texture; + + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)src_texture, NULL, (ID3D10Resource *)dst_texture); + todo_wine_if(test->todo_hr) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_texture; + + hr = ID3D10Texture2D_Map(dst_texture, 0, D3D10_MAP_READ, 0, &map); + ok(hr == S_OK, "Failed to map destination texture, hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_texture; + + check_texture_data_level(map.pData, map.RowPitch, 0, tmp_desc.Width, tmp_desc.Height, 1, test->dst_format, + test->expected_dst_data, test->max_diff, test->todo_data); +cleanup_next_texture: + if (src_texture) + ID3D10Texture2D_Release(src_texture); + if (map.pData) + ID3D10Texture2D_Unmap(dst_texture, 0); + if (dst_texture) + ID3D10Texture2D_Release(dst_texture); + winetest_pop_context(); + } + + /* + * Texture compression tests. Rather than checking against compressed values + * (which we're unlikely to match due to differences in compression + * algorithms), we'll: + * Load our uncompressed source texture into a compressed destination texture. + * Load our compressed destination texture into a new decompressed destination texture. + * Check that the data in the new decompressed texture matches the + * original data. + */ + for (i = 0; i < ARRAY_SIZE(test_texture_compression); ++i) + { + const struct test_texture_compression *test = &test_texture_compression[i]; + const D3D10_TEXTURE2D_DESC *src_desc = &test->src_desc; + ID3D10Texture2D *src_texture, *dst_texture; + D3D10_TEXTURE2D_DESC tmp_desc = *src_desc; + D3D10_MAPPED_TEXTURE2D map = { 0 }; + + winetest_push_context("Texture compression test %u", i); + src_texture = dst_texture = NULL; + + /* Create the uncompressed source texture. */ + init_subresource_data(sub_resource_data, (const void *)test->src_data, src_desc->Width, src_desc->Height, 1, + src_desc->MipLevels, src_desc->ArraySize, src_desc->Format); + hr = ID3D10Device_CreateTexture2D(device, src_desc, sub_resource_data, &src_texture); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_compressed_texture; + + /* Create the compressed destination texture. */ + tmp_desc.Format = test->compressed_format; + hr = ID3D10Device_CreateTexture2D(device, &tmp_desc, NULL, &dst_texture); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_compressed_texture; + + /* Load the uncompressed source into the compressed destination. */ + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)src_texture, NULL, (ID3D10Resource *)dst_texture); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_compressed_texture; + + ID3D10Texture2D_Release(src_texture); + src_texture = dst_texture; + + /* Now create the uncompressed destination texture to decompress into. */ + tmp_desc = *src_desc; + tmp_desc.Usage = D3D10_USAGE_STAGING; + tmp_desc.BindFlags = 0; + tmp_desc.CPUAccessFlags = D3D10_CPU_ACCESS_READ; + memset(tmp_buf, 0, sizeof(tmp_buf)); + init_subresource_data(sub_resource_data, (const void *)tmp_buf, src_desc->Width, src_desc->Height, 1, + src_desc->MipLevels, src_desc->ArraySize, src_desc->Format); + hr = ID3D10Device_CreateTexture2D(device, &tmp_desc, sub_resource_data, &dst_texture); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_compressed_texture; + + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)src_texture, NULL, (ID3D10Resource *)dst_texture); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_compressed_texture; + + hr = ID3D10Texture2D_Map(dst_texture, 0, D3D10_MAP_READ, 0, &map); + ok(hr == S_OK, "Failed to map destination texture, hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_compressed_texture; + + check_texture_data_level(map.pData, map.RowPitch, 0, tmp_desc.Width, tmp_desc.Height, 1, tmp_desc.Format, + test->src_data, 0, FALSE); +cleanup_next_compressed_texture: + if (src_texture) + ID3D10Texture2D_Release(src_texture); + if (map.pData) + ID3D10Texture2D_Unmap(dst_texture, 0); + if (dst_texture) + ID3D10Texture2D_Release(dst_texture); + winetest_pop_context(); + } + + /* + * Use D3DX10LoadTextureFromTexture to generate mip levels. Some games + * (Total War: Shogun 2) do this instead of using D3DX10FilterTexture. + */ + set_d3dx10_texture_load_info(&load_info, NULL, NULL, 0, 1, 2, 0, 0, 1, D3DX10_FILTER_POINT, D3DX10_FILTER_NONE); + set_d3d10_2d_texture_desc(&tex_2d_desc, 8, 8, 3, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, 0); + + memset(tmp_buf, 0, sizeof(tmp_buf)); + memcpy(tmp_buf, bc1_to_bc3_8_8_decompressed, sizeof(bc1_to_bc3_8_8_decompressed)); + init_subresource_data(sub_resource_data, (const void *)tmp_buf, tex_2d_desc.Width, tex_2d_desc.Height, 1, + tex_2d_desc.MipLevels, tex_2d_desc.ArraySize, tex_2d_desc.Format); + + hr = ID3D10Device_CreateTexture2D(device, &tex_2d_desc, sub_resource_data, &tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_texture_sub_resource_color(tex_2d, 1, NULL, 0x00000000, 0); + check_texture_sub_resource_color(tex_2d, 2, NULL, 0x00000000, 0); + + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex_2d, &load_info, (ID3D10Resource *)tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + SetRect(&tmp_rect, 0, 0, 2, 2); + check_texture_sub_resource_color(tex_2d, 1, &tmp_rect, 0xffff0000, 0); + SetRect(&tmp_rect, 2, 0, 4, 2); + check_texture_sub_resource_color(tex_2d, 1, &tmp_rect, 0xff00ff00, 0); + SetRect(&tmp_rect, 0, 2, 2, 4); + check_texture_sub_resource_color(tex_2d, 1, &tmp_rect, 0xff0000ff, 0); + SetRect(&tmp_rect, 2, 2, 4, 4); + check_texture_sub_resource_color(tex_2d, 1, &tmp_rect, 0xff000000, 0); + + SetRect(&tmp_rect, 0, 0, 1, 1); + check_texture_sub_resource_color(tex_2d, 2, &tmp_rect, 0xffff0000, 0); + SetRect(&tmp_rect, 1, 0, 2, 1); + check_texture_sub_resource_color(tex_2d, 2, &tmp_rect, 0xff00ff00, 0); + SetRect(&tmp_rect, 0, 1, 1, 2); + check_texture_sub_resource_color(tex_2d, 2, &tmp_rect, 0xff0000ff, 0); + SetRect(&tmp_rect, 1, 1, 2, 2); + check_texture_sub_resource_color(tex_2d, 2, &tmp_rect, 0xff000000, 0); + + ID3D10Texture2D_Release(tex_2d); + + /* Cubemap. */ + set_d3d10_2d_texture_desc(&tex_2d_desc, 4, 4, 1, 6, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, D3D10_RESOURCE_MISC_TEXTURECUBE); + init_subresource_data(sub_resource_data, (const void *)rgba_4_4_cubemap, tex_2d_desc.Width, tex_2d_desc.Height, 1, + tex_2d_desc.MipLevels, tex_2d_desc.ArraySize, tex_2d_desc.Format); + + hr = ID3D10Device_CreateTexture2D(device, &tex_2d_desc, sub_resource_data, &tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < 6; ++i) + check_texture_sub_resource_color(tex_2d, i, NULL, test_cubemap_face_colors[i], 0); + + /* Load individual faces of a cubemap texture into a non-cubemap texture. */ + set_d3d10_2d_texture_desc(&tex_2d_desc, 4, 4, 3, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, 0); + hr = ID3D10Device_CreateTexture2D(device, &tex_2d_desc, NULL, &tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + for (i = 0; i < 6; ++i) + { + /* On top of loading individual faces, we'll also generate mips. */ + set_d3dx10_texture_load_info(&load_info, NULL, NULL, 0, 0, 0, i, 0, 1, D3DX10_FILTER_POINT, D3DX10_FILTER_POINT); + hr = D3DX10LoadTextureFromTexture((ID3D10Resource *)tex_2d, &load_info, (ID3D10Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + check_texture_sub_resource_color(tex2_2d, 0, NULL, test_cubemap_face_colors[i], 0); + check_texture_sub_resource_color(tex2_2d, 1, NULL, test_cubemap_face_colors[i], 0); + check_texture_sub_resource_color(tex2_2d, 2, NULL, test_cubemap_face_colors[i], 0); + } + + ID3D10Texture2D_Release(tex2_2d); + ID3D10Texture2D_Release(tex_2d); + + CoUninitialize(); + + ok(!ID3D10Device_Release(device), "Unexpected refcount.\n"); +} + START_TEST(d3dx10) { HMODULE wined3d; @@ -5853,6 +6763,7 @@ START_TEST(d3dx10) test_D3DX10CreateAsyncTextureInfoProcessor(); test_D3DX10CreateAsyncTextureProcessor(); test_D3DX10CreateThreadPump(); + test_D3DX10LoadTextureFromTexture(); test_get_image_info(); test_create_texture(); test_font(); From c56c31cf08be45e5e70418acadd8da47e6aa8d11 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 8 Nov 2024 11:51:13 -0500 Subject: [PATCH 0946/2542] d3dx10: Implement D3DX10LoadTextureFromTexture(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/d3dx10_43_main.c | 8 - dlls/d3dx10_43/tests/d3dx10.c | 6 - dlls/d3dx10_43/texture.c | 397 ++++++++++++++++++++++++++++++++ 3 files changed, 397 insertions(+), 14 deletions(-) diff --git a/dlls/d3dx10_43/d3dx10_43_main.c b/dlls/d3dx10_43/d3dx10_43_main.c index ec7407508d30..ba6de566576c 100644 --- a/dlls/d3dx10_43/d3dx10_43_main.c +++ b/dlls/d3dx10_43/d3dx10_43_main.c @@ -168,11 +168,3 @@ D3DX_CPU_OPTIMIZATION WINAPI D3DXCpuOptimizations(BOOL enable) return D3DX_NOT_OPTIMIZED; } - -HRESULT WINAPI D3DX10LoadTextureFromTexture(ID3D10Resource *src_texture, D3DX10_TEXTURE_LOAD_INFO *load_info, - ID3D10Resource *dst_texture) -{ - FIXME("src_texture %p, load_info %p, dst_texture %p stub!\n", src_texture, load_info, dst_texture); - - return E_NOTIMPL; -} diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 53e00a52b20a..4c2904543215 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -6339,12 +6339,6 @@ static void test_D3DX10LoadTextureFromTexture(void) uint32_t i; HRESULT hr; - if (!strcmp(winetest_platform, "wine")) - { - skip("Skipping D3DX10LoadTextureFromTexture() tests.\n"); - return; - } - device = create_device(); if (!device) { diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 67315942a29b..97153be02f57 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -922,3 +922,400 @@ HRESULT WINAPI D3DX10CreateTextureFromMemory(ID3D10Device *device, const void *s *hresult = hr; return hr; } + +struct d3d10_texture_resource +{ + D3D10_RESOURCE_DIMENSION texture_dimension; + union + { + ID3D10Resource *tex_rsrc; + ID3D10Texture2D *tex_2d; + ID3D10Texture3D *tex_3d; + } iface; + struct volume size; + uint32_t mip_levels; + uint32_t layer_count; +}; + +struct d3d10_texture +{ + ID3D10Device *device; + struct d3d10_texture_resource texture; + struct d3d10_texture_resource staging_texture; + + const struct pixel_format_desc *fmt_desc; + D3D10_MAP map_flags; + D3D10_BOX texture_box; + + uint32_t first_layer; + uint32_t first_mip_level; +}; + +static void set_d3d10_box(D3D10_BOX *box, uint32_t left, uint32_t top, uint32_t right, uint32_t bottom, uint32_t front, + uint32_t back) +{ + box->left = left; + box->top = top; + box->right = right; + box->bottom = bottom; + box->front = front; + box->back = back; +} + +static const char *debug_d3d10_box(const struct D3D10_BOX *box) +{ + if (!box) + return "(null)"; + return wine_dbg_sprintf("(%ux%ux%u)-(%ux%ux%u)", box->left, box->top, box->front, box->right, box->bottom, box->back); +} + +static void d3d10_box_get_mip_level(D3D10_BOX *box, uint32_t level) +{ + uint32_t i; + + for (i = 0; i < level; ++i) + { + set_d3d10_box(box, (box->left ? (box->left / 2) : 0), (box->top ? (box->top / 2) : 0), + max(box->right / 2, 1), max(box->bottom / 2, 1), + (box->front ? (box->front / 2) : 0), max(box->back / 2, 1)); + } +} + +static HRESULT d3dx_d3d10_texture_init(ID3D10Resource *tex_rsrc, uint32_t first_layer, uint32_t first_mip_level, + D3D10_MAP map_flags, D3D10_BOX *tex_box, struct d3d10_texture *texture) +{ + struct d3d10_texture_resource *staging_tex_rsrc = &texture->staging_texture; + struct d3d10_texture_resource *src_tex_rsrc = &texture->texture; + HRESULT hr; + + ID3D10Resource_GetDevice(tex_rsrc, &texture->device); + if (!texture->device) + { + ERR("Failed to get device from texture resource.\n"); + return E_FAIL; + } + + texture->map_flags = map_flags; + ID3D10Resource_GetType(tex_rsrc, &src_tex_rsrc->texture_dimension); + switch (src_tex_rsrc->texture_dimension) + { + case D3D10_RESOURCE_DIMENSION_TEXTURE2D: + { + D3D10_TEXTURE2D_DESC desc; + + hr = ID3D10Resource_QueryInterface(tex_rsrc, &IID_ID3D10Texture2D, (void **)&src_tex_rsrc->iface.tex_2d); + if (FAILED(hr)) + return hr; + + ID3D10Texture2D_GetDesc(src_tex_rsrc->iface.tex_2d, &desc); + if (map_flags != D3D10_MAP_READ && (first_mip_level >= desc.MipLevels)) + return S_FALSE; + + texture->fmt_desc = get_d3dx_pixel_format_info(d3dx_pixel_format_id_from_dxgi_format(desc.Format)); + if (texture->fmt_desc->format == D3DX_PIXEL_FORMAT_COUNT) + { + FIXME("Unknown DXGI format supplied, %#x.\n", desc.Format); + return E_NOTIMPL; + } + + set_volume_struct(&src_tex_rsrc->size, desc.Width, desc.Height, 1); + src_tex_rsrc->mip_levels = desc.MipLevels; + src_tex_rsrc->layer_count = desc.ArraySize; + + texture->first_mip_level = min((desc.MipLevels - 1), first_mip_level); + texture->first_layer = first_layer >= desc.ArraySize ? 0 : first_layer; + + staging_tex_rsrc->texture_dimension = src_tex_rsrc->texture_dimension; + staging_tex_rsrc->size = src_tex_rsrc->size; + d3dx_get_mip_level_size(&staging_tex_rsrc->size, texture->first_mip_level); + staging_tex_rsrc->mip_levels = src_tex_rsrc->mip_levels - texture->first_mip_level; + staging_tex_rsrc->layer_count = 1; + + /* Create the staging texture. */ + desc.Usage = D3D10_USAGE_STAGING; + desc.BindFlags = desc.MiscFlags = 0; + desc.CPUAccessFlags = D3D10_CPU_ACCESS_READ; + if (map_flags != D3D10_MAP_READ) + desc.CPUAccessFlags |= D3D10_CPU_ACCESS_WRITE; + desc.ArraySize = 1; + desc.MipLevels = staging_tex_rsrc->mip_levels; + desc.Width = staging_tex_rsrc->size.width; + desc.Height = staging_tex_rsrc->size.height; + + hr = ID3D10Device_CreateTexture2D(texture->device, &desc, NULL, &staging_tex_rsrc->iface.tex_2d); + if (FAILED(hr)) + return hr; + break; + } + + case D3D10_RESOURCE_DIMENSION_TEXTURE3D: + { + D3D10_TEXTURE3D_DESC desc; + + hr = ID3D10Resource_QueryInterface(tex_rsrc, &IID_ID3D10Texture3D, (void **)&src_tex_rsrc->iface.tex_3d); + if (FAILED(hr)) + return hr; + + ID3D10Texture3D_GetDesc(src_tex_rsrc->iface.tex_3d, &desc); + if (map_flags != D3D10_MAP_READ && (first_mip_level >= desc.MipLevels)) + return S_FALSE; + + texture->fmt_desc = get_d3dx_pixel_format_info(d3dx_pixel_format_id_from_dxgi_format(desc.Format)); + if (texture->fmt_desc->format == D3DX_PIXEL_FORMAT_COUNT) + { + FIXME("Unknown DXGI format supplied, %#x.\n", desc.Format); + return E_NOTIMPL; + } + + set_volume_struct(&src_tex_rsrc->size, desc.Width, desc.Height, desc.Depth); + src_tex_rsrc->mip_levels = desc.MipLevels; + src_tex_rsrc->layer_count = 1; + + texture->first_mip_level = min((desc.MipLevels - 1), first_mip_level); + if (first_layer) + WARN("Specified a non zero FirstElement argument on a 3D texture.\n"); + texture->first_layer = 0; + + staging_tex_rsrc->texture_dimension = src_tex_rsrc->texture_dimension; + staging_tex_rsrc->size = src_tex_rsrc->size; + d3dx_get_mip_level_size(&staging_tex_rsrc->size, texture->first_mip_level); + staging_tex_rsrc->mip_levels = src_tex_rsrc->mip_levels - texture->first_mip_level; + staging_tex_rsrc->layer_count = 1; + + /* Create the staging texture. */ + desc.Usage = D3D10_USAGE_STAGING; + desc.BindFlags = desc.MiscFlags = 0; + desc.CPUAccessFlags = D3D10_CPU_ACCESS_READ; + if (map_flags != D3D10_MAP_READ) + desc.CPUAccessFlags |= D3D10_CPU_ACCESS_WRITE; + desc.MipLevels = staging_tex_rsrc->mip_levels; + desc.Width = staging_tex_rsrc->size.width; + desc.Height = staging_tex_rsrc->size.height; + desc.Depth = staging_tex_rsrc->size.depth; + + hr = ID3D10Device_CreateTexture3D(texture->device, &desc, NULL, &staging_tex_rsrc->iface.tex_3d); + if (FAILED(hr)) + return hr; + break; + } + + default: + FIXME("Unhandled resource dimension %u.\n", src_tex_rsrc->texture_dimension); + return E_NOTIMPL; + } + + if (tex_box) + texture->texture_box = *tex_box; + else + set_d3d10_box(&texture->texture_box, 0, 0, staging_tex_rsrc->size.width, staging_tex_rsrc->size.height, 0, + staging_tex_rsrc->size.depth); + + return S_OK; +} + +static void d3dx_d3d10_texture_release(struct d3d10_texture *texture) +{ + if (texture->device) + ID3D10Device_Release(texture->device); + if (texture->texture.iface.tex_rsrc) + ID3D10Resource_Release(texture->texture.iface.tex_rsrc); + if (texture->staging_texture.iface.tex_rsrc) + ID3D10Resource_Release(texture->staging_texture.iface.tex_rsrc); +} + +static HRESULT d3dx_d3d10_texture_map(struct d3d10_texture *texture, uint32_t layer, uint32_t mip_level, + struct d3dx_pixels *pixels) +{ + struct d3d10_texture_resource *staging_tex_rsrc = &texture->staging_texture; + struct d3d10_texture_resource *src_tex_rsrc = &texture->texture; + uint32_t row_pitch, slice_pitch, sub_rsrc_idx; + D3D10_BOX tmp_box = texture->texture_box; + const void *data = NULL; + HRESULT hr; + + d3d10_box_get_mip_level(&tmp_box, mip_level); + sub_rsrc_idx = (src_tex_rsrc->mip_levels * (texture->first_layer + layer)) + (mip_level + texture->first_mip_level); + ID3D10Device_CopySubresourceRegion(texture->device, staging_tex_rsrc->iface.tex_rsrc, mip_level, 0, 0, 0, + src_tex_rsrc->iface.tex_rsrc, sub_rsrc_idx, NULL); + switch (src_tex_rsrc->texture_dimension) + { + case D3D10_RESOURCE_DIMENSION_TEXTURE2D: + { + D3D10_MAPPED_TEXTURE2D map = { 0 }; + + hr = ID3D10Texture2D_Map(staging_tex_rsrc->iface.tex_2d, mip_level, texture->map_flags, 0, &map); + if (FAILED(hr)) + break; + data = map.pData; + row_pitch = map.RowPitch; + slice_pitch = 0; + break; + } + + case D3D10_RESOURCE_DIMENSION_TEXTURE3D: + { + D3D10_MAPPED_TEXTURE3D map = { 0 }; + + hr = ID3D10Texture3D_Map(staging_tex_rsrc->iface.tex_3d, mip_level, texture->map_flags, 0, &map); + if (FAILED(hr)) + break; + data = map.pData; + row_pitch = map.RowPitch; + slice_pitch = map.DepthPitch; + break; + } + + default: + break; + } + + if (!data) + return E_FAIL; + + TRACE("Mapping layer %u, mip level %u, box %s.\n", texture->first_layer + layer, texture->first_mip_level + mip_level, + debug_d3d10_box(&tmp_box)); + return d3dx_pixels_init(data, row_pitch, slice_pitch, NULL, texture->fmt_desc->format, tmp_box.left, tmp_box.top, + tmp_box.right, tmp_box.bottom, tmp_box.front, tmp_box.back, pixels); +} + +static void d3dx_d3d10_texture_unmap(struct d3d10_texture *texture, uint32_t layer, uint32_t mip_level) +{ + struct d3d10_texture_resource *staging_tex_rsrc = &texture->staging_texture; + struct d3d10_texture_resource *src_tex_rsrc = &texture->texture; + uint32_t sub_rsrc_idx; + + switch (src_tex_rsrc->texture_dimension) + { + case D3D10_RESOURCE_DIMENSION_TEXTURE2D: + { + ID3D10Texture2D_Unmap(staging_tex_rsrc->iface.tex_2d, mip_level); + break; + } + + case D3D10_RESOURCE_DIMENSION_TEXTURE3D: + { + ID3D10Texture3D_Unmap(staging_tex_rsrc->iface.tex_3d, mip_level); + break; + } + + default: + break; + } + + if (texture->map_flags == D3D10_MAP_READ) + return; + + sub_rsrc_idx = (src_tex_rsrc->mip_levels * (texture->first_layer + layer)) + (mip_level + texture->first_mip_level); + ID3D10Device_CopySubresourceRegion(texture->device, src_tex_rsrc->iface.tex_rsrc, sub_rsrc_idx, 0, 0, 0, + staging_tex_rsrc->iface.tex_rsrc, mip_level, NULL); +} + +static const D3DX10_TEXTURE_LOAD_INFO default_load_info = { NULL, NULL, 0, 0, D3DX10_DEFAULT, 0, 0, D3DX10_DEFAULT, + D3DX10_DEFAULT, D3DX10_DEFAULT }; +HRESULT WINAPI D3DX10LoadTextureFromTexture(ID3D10Resource *src_texture, D3DX10_TEXTURE_LOAD_INFO *load_info, + ID3D10Resource *dst_texture) +{ + D3DX10_TEXTURE_LOAD_INFO info = (load_info) ? *load_info : default_load_info; + struct d3d10_texture src_tex = { 0 }; + struct d3d10_texture dst_tex = { 0 }; + uint32_t i, j, loaded_mip_levels; + HRESULT hr; + + TRACE("src_texture %p, load_info %p, dst_texture %p.\n", src_texture, load_info, dst_texture); + + if (!src_texture || !dst_texture) + return E_INVALIDARG; + + if (!info.Filter || FAILED(hr = d3dx_handle_filter(&info.Filter))) + { + ERR("Invalid filter argument %#x.\n", info.Filter); + return D3DERR_INVALIDCALL; + } + + hr = d3dx_d3d10_texture_init(src_texture, info.SrcFirstElement, info.SrcFirstMip, D3D10_MAP_READ, info.pSrcBox, &src_tex); + if (FAILED(hr)) + goto end; + + hr = d3dx_d3d10_texture_init(dst_texture, info.DstFirstElement, info.DstFirstMip, D3D10_MAP_READ_WRITE, info.pDstBox, &dst_tex); + if (hr == S_FALSE || FAILED(hr)) + goto end; + + if ((src_texture == dst_texture) && ((src_tex.first_layer == dst_tex.first_layer) && + (src_tex.first_mip_level == dst_tex.first_mip_level))) + { + hr = D3DERR_INVALIDCALL; + goto end; + } + + if (!info.NumMips || info.NumMips == D3DX10_DEFAULT) + info.NumMips = dst_tex.staging_texture.mip_levels; + info.NumMips = min(info.NumMips, dst_tex.staging_texture.mip_levels); + if (!info.NumElements || info.NumElements == D3DX10_DEFAULT) + info.NumElements = min(src_tex.texture.layer_count, dst_tex.texture.layer_count); + info.NumElements = min(info.NumElements, min(src_tex.texture.layer_count, dst_tex.texture.layer_count)); + loaded_mip_levels = min(info.NumMips, src_tex.staging_texture.mip_levels); + for (i = 0; i < info.NumElements; ++i) + { + for (j = 0; j < loaded_mip_levels; ++j) + { + struct d3dx_pixels src_pixels, dst_pixels; + + hr = d3dx_d3d10_texture_map(&src_tex, i, j, &src_pixels); + if (FAILED(hr)) + goto end; + + hr = d3dx_d3d10_texture_map(&dst_tex, i, j, &dst_pixels); + if (FAILED(hr)) + { + d3dx_d3d10_texture_unmap(&src_tex, i, j); + goto end; + } + + hr = d3dx_load_pixels_from_pixels(&dst_pixels, dst_tex.fmt_desc, &src_pixels, src_tex.fmt_desc, info.Filter, 0); + d3dx_d3d10_texture_unmap(&src_tex, i, j); + d3dx_d3d10_texture_unmap(&dst_tex, i, j); + if (FAILED(hr)) + { + WARN("Failed with hr %#lx.\n", hr); + goto end; + } + } + } + + if (loaded_mip_levels < info.NumMips) + { + if (!info.MipFilter || FAILED(hr = d3dx_handle_filter(&info.MipFilter))) + { + ERR("Invalid mip filter argument %#x.\n", info.MipFilter); + hr = D3DERR_INVALIDCALL; + goto end; + } + + for (i = 0; i < info.NumElements; ++i) + { + for (j = loaded_mip_levels; j < info.NumMips; ++j) + { + struct d3dx_pixels src_pixels, dst_pixels; + + hr = d3dx_d3d10_texture_map(&dst_tex, i, j - 1, &src_pixels); + if (FAILED(hr)) + break; + + hr = d3dx_d3d10_texture_map(&dst_tex, i, j, &dst_pixels); + if (SUCCEEDED(hr)) + { + hr = d3dx_load_pixels_from_pixels(&dst_pixels, dst_tex.fmt_desc, &src_pixels, dst_tex.fmt_desc, info.MipFilter, 0); + d3dx_d3d10_texture_unmap(&dst_tex, i, j); + } + d3dx_d3d10_texture_unmap(&dst_tex, i, j - 1); + if (FAILED(hr)) + goto end; + } + } + } + +end: + d3dx_d3d10_texture_release(&src_tex); + d3dx_d3d10_texture_release(&dst_tex); + return SUCCEEDED(hr) ? S_OK : hr; +} From 9967ed61721ba43cf39522bbc2198622cc00c760 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 8 Nov 2024 12:13:21 -0500 Subject: [PATCH 0947/2542] d3dx10: Add support for sRGB formats. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 4 ++-- dlls/d3dx10_43/texture.c | 4 ++++ dlls/d3dx9_36/d3dx_helpers.c | 31 +++++++++++++++++++++++++++++++ dlls/d3dx9_36/d3dx_helpers.h | 5 +++++ 4 files changed, 42 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 4c2904543215..ea94246ea025 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -6153,11 +6153,11 @@ test_texture_format_conversion[] = }, { { 4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, - rgba_unorm_srgb_4_4, DXGI_FORMAT_R8G8B8A8_UNORM, rgba_unorm_srgb_to_unorm_non_srgb_4_4, .todo_hr = TRUE + rgba_unorm_srgb_4_4, DXGI_FORMAT_R8G8B8A8_UNORM, rgba_unorm_srgb_to_unorm_non_srgb_4_4, .max_diff = 3 }, { { 4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 }, - rgba_unorm_non_srgb_4_4, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, rgba_unorm_non_srgb_to_unorm_srgb_4_4, .todo_hr = TRUE + rgba_unorm_non_srgb_4_4, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, rgba_unorm_non_srgb_to_unorm_srgb_4_4, .max_diff = 2 }, }; diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 97153be02f57..81b470dffd30 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -105,6 +105,7 @@ static DXGI_FORMAT dxgi_format_from_d3dx_pixel_format_id(enum d3dx_pixel_format_ switch (format) { case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB: return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB; case D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM: return DXGI_FORMAT_B8G8R8A8_UNORM; case D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM: return DXGI_FORMAT_B8G8R8X8_UNORM; case D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM: return DXGI_FORMAT_R10G10B10A2_UNORM; @@ -125,8 +126,11 @@ static DXGI_FORMAT dxgi_format_from_d3dx_pixel_format_id(enum d3dx_pixel_format_ case D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM: return DXGI_FORMAT_G8R8_G8B8_UNORM; case D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM: return DXGI_FORMAT_R8G8_B8G8_UNORM; case D3DX_PIXEL_FORMAT_BC1_UNORM: return DXGI_FORMAT_BC1_UNORM; + case D3DX_PIXEL_FORMAT_BC1_UNORM_SRGB: return DXGI_FORMAT_BC1_UNORM_SRGB; case D3DX_PIXEL_FORMAT_BC2_UNORM: return DXGI_FORMAT_BC2_UNORM; + case D3DX_PIXEL_FORMAT_BC2_UNORM_SRGB: return DXGI_FORMAT_BC2_UNORM_SRGB; case D3DX_PIXEL_FORMAT_BC3_UNORM: return DXGI_FORMAT_BC3_UNORM; + case D3DX_PIXEL_FORMAT_BC3_UNORM_SRGB: return DXGI_FORMAT_BC3_UNORM_SRGB; case D3DX_PIXEL_FORMAT_BC4_UNORM: return DXGI_FORMAT_BC4_UNORM; case D3DX_PIXEL_FORMAT_BC4_SNORM: return DXGI_FORMAT_BC4_SNORM; case D3DX_PIXEL_FORMAT_BC5_UNORM: return DXGI_FORMAT_BC5_UNORM; diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index 52d749529774..4b5155c74ec4 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -34,6 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx); HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT, IWICImagingFactory**); +#define FMT_FLAGS_BCN_SRGB (FMT_FLAG_DXT | FMT_FLAG_DXGI | FMT_FLAG_SRGB) /************************************************************ * pixel format table providing info about number of bytes per pixel, * number of bits per channel and format type. @@ -47,6 +48,7 @@ static const struct pixel_format_desc formats[] = {D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM, { 8, 8, 8, 8}, {24, 16, 8, 0}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_UNORM, 0 }, {D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM, { 0, 8, 8, 8}, { 0, 16, 8, 0}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, 0 }, {D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM, { 8, 8, 8, 8}, {24, 0, 8, 16}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB, { 8, 8, 8, 8}, {24, 0, 8, 16}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXGI | FMT_FLAG_SRGB}, {D3DX_PIXEL_FORMAT_R8G8B8X8_UNORM, { 0, 8, 8, 8}, { 0, 0, 8, 16}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, 0 }, {D3DX_PIXEL_FORMAT_B5G6R5_UNORM, { 0, 5, 6, 5}, { 0, 11, 5, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_UNORM, 0 }, {D3DX_PIXEL_FORMAT_B5G5R5X1_UNORM, { 0, 5, 5, 5}, { 0, 10, 5, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_UNORM, 0 }, @@ -70,10 +72,13 @@ static const struct pixel_format_desc formats[] = {D3DX_PIXEL_FORMAT_L8_UNORM, { 0, 8, 0, 0}, { 0, 0, 0, 0}, 1, 1, 1, 1, CTYPE_EMPTY, CTYPE_LUMA, 0 }, {D3DX_PIXEL_FORMAT_L16_UNORM, { 0, 16, 0, 0}, { 0, 0, 0, 0}, 2, 1, 1, 2, CTYPE_EMPTY, CTYPE_LUMA, 0 }, {D3DX_PIXEL_FORMAT_DXT1_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 8, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT}, + {D3DX_PIXEL_FORMAT_BC1_UNORM_SRGB, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 8, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAGS_BCN_SRGB}, {D3DX_PIXEL_FORMAT_DXT2_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT | FMT_FLAG_PM_ALPHA}, {D3DX_PIXEL_FORMAT_DXT3_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT}, + {D3DX_PIXEL_FORMAT_BC2_UNORM_SRGB, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAGS_BCN_SRGB}, {D3DX_PIXEL_FORMAT_DXT4_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT | FMT_FLAG_PM_ALPHA}, {D3DX_PIXEL_FORMAT_DXT5_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXT}, + {D3DX_PIXEL_FORMAT_BC3_UNORM_SRGB, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAGS_BCN_SRGB}, {D3DX_PIXEL_FORMAT_BC4_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 8, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_DXT | FMT_FLAG_DXGI}, {D3DX_PIXEL_FORMAT_BC4_SNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 8, CTYPE_EMPTY, CTYPE_SNORM, FMT_FLAG_DXT | FMT_FLAG_DXGI}, {D3DX_PIXEL_FORMAT_BC5_UNORM, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, CTYPE_EMPTY, CTYPE_UNORM, FMT_FLAG_DXT | FMT_FLAG_DXGI}, @@ -352,6 +357,7 @@ enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dxgi_format(DXGI_FORMAT form switch (format) { case DXGI_FORMAT_R8G8B8A8_UNORM: return D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM; + case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: return D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB; case DXGI_FORMAT_B8G8R8A8_UNORM: return D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM; case DXGI_FORMAT_B8G8R8X8_UNORM: return D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM; case DXGI_FORMAT_B5G6R5_UNORM: return D3DX_PIXEL_FORMAT_B5G6R5_UNORM; @@ -375,8 +381,11 @@ enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dxgi_format(DXGI_FORMAT form case DXGI_FORMAT_G8R8_G8B8_UNORM: return D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM; case DXGI_FORMAT_R8G8_B8G8_UNORM: return D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM; case DXGI_FORMAT_BC1_UNORM: return D3DX_PIXEL_FORMAT_BC1_UNORM; + case DXGI_FORMAT_BC1_UNORM_SRGB: return D3DX_PIXEL_FORMAT_BC1_UNORM_SRGB; case DXGI_FORMAT_BC2_UNORM: return D3DX_PIXEL_FORMAT_BC2_UNORM; + case DXGI_FORMAT_BC2_UNORM_SRGB: return D3DX_PIXEL_FORMAT_BC2_UNORM_SRGB; case DXGI_FORMAT_BC3_UNORM: return D3DX_PIXEL_FORMAT_BC3_UNORM; + case DXGI_FORMAT_BC3_UNORM_SRGB: return D3DX_PIXEL_FORMAT_BC3_UNORM_SRGB; case DXGI_FORMAT_BC4_UNORM: return D3DX_PIXEL_FORMAT_BC4_UNORM; case DXGI_FORMAT_BC4_SNORM: return D3DX_PIXEL_FORMAT_BC4_SNORM; case DXGI_FORMAT_BC5_UNORM: return D3DX_PIXEL_FORMAT_BC5_UNORM; @@ -2369,16 +2378,19 @@ static void d3dx_init_bcn_decompression_context(struct d3dx_bcn_decompression_co switch (desc->format) { case D3DX_PIXEL_FORMAT_DXT1_UNORM: + case D3DX_PIXEL_FORMAT_BC1_UNORM_SRGB: context->decompress_bcn_block = bcdec_bc1; break; case D3DX_PIXEL_FORMAT_DXT2_UNORM: case D3DX_PIXEL_FORMAT_DXT3_UNORM: + case D3DX_PIXEL_FORMAT_BC2_UNORM_SRGB: context->decompress_bcn_block = bcdec_bc2; break; case D3DX_PIXEL_FORMAT_DXT4_UNORM: case D3DX_PIXEL_FORMAT_DXT5_UNORM: + case D3DX_PIXEL_FORMAT_BC3_UNORM_SRGB: context->decompress_bcn_block = bcdec_bc3; break; @@ -2447,16 +2459,28 @@ static HRESULT d3dx_pixels_decompress(struct d3dx_pixels *pixels, const struct p uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); break; + case D3DX_PIXEL_FORMAT_BC1_UNORM_SRGB: + uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB); + break; + case D3DX_PIXEL_FORMAT_DXT2_UNORM: case D3DX_PIXEL_FORMAT_DXT3_UNORM: uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); break; + case D3DX_PIXEL_FORMAT_BC2_UNORM_SRGB: + uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB); + break; + case D3DX_PIXEL_FORMAT_DXT4_UNORM: case D3DX_PIXEL_FORMAT_DXT5_UNORM: uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM); break; + case D3DX_PIXEL_FORMAT_BC3_UNORM_SRGB: + uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB); + break; + case D3DX_PIXEL_FORMAT_BC4_UNORM: uncompressed_desc = get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_R8_UNORM); break; @@ -2632,16 +2656,19 @@ static HRESULT d3dx_pixels_compress(struct d3dx_pixels *src_pixels, switch (dst_desc->format) { case D3DX_PIXEL_FORMAT_DXT1_UNORM: + case D3DX_PIXEL_FORMAT_BC1_UNORM_SRGB: compress_bcn_block = d3dx_compress_bc1_block; break; case D3DX_PIXEL_FORMAT_DXT2_UNORM: case D3DX_PIXEL_FORMAT_DXT3_UNORM: + case D3DX_PIXEL_FORMAT_BC2_UNORM_SRGB: compress_bcn_block = d3dx_compress_bc2_block; break; case D3DX_PIXEL_FORMAT_DXT4_UNORM: case D3DX_PIXEL_FORMAT_DXT5_UNORM: + case D3DX_PIXEL_FORMAT_BC3_UNORM_SRGB: compress_bcn_block = d3dx_compress_bc3_block; break; @@ -2750,9 +2777,13 @@ HRESULT d3dx_load_pixels_from_pixels(struct d3dx_pixels *dst_pixels, debug_d3dx_pixels(dst_pixels), dst_desc, debug_d3dx_pixels(src_pixels), src_desc, filter_flags, color_key); + if (src_desc->flags & FMT_FLAG_SRGB) + filter_flags |= D3DX_FILTER_SRGB_IN; if (src_desc->flags & FMT_FLAG_PM_ALPHA) filter_flags |= D3DX_FILTER_PMA_IN; + if (dst_desc->flags & FMT_FLAG_SRGB) + filter_flags |= D3DX_FILTER_SRGB_OUT; if (dst_desc->flags & FMT_FLAG_PM_ALPHA) filter_flags |= D3DX_FILTER_PMA_OUT; diff --git a/dlls/d3dx9_36/d3dx_helpers.h b/dlls/d3dx9_36/d3dx_helpers.h index adf167de85dd..21010ebbf533 100644 --- a/dlls/d3dx9_36/d3dx_helpers.h +++ b/dlls/d3dx9_36/d3dx_helpers.h @@ -247,6 +247,7 @@ enum d3dx_pixel_format_id D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM, D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM, D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM, + D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB, D3DX_PIXEL_FORMAT_R8G8B8X8_UNORM, D3DX_PIXEL_FORMAT_B5G6R5_UNORM, D3DX_PIXEL_FORMAT_B5G5R5X1_UNORM, @@ -270,10 +271,13 @@ enum d3dx_pixel_format_id D3DX_PIXEL_FORMAT_L8_UNORM, D3DX_PIXEL_FORMAT_L16_UNORM, D3DX_PIXEL_FORMAT_DXT1_UNORM, + D3DX_PIXEL_FORMAT_BC1_UNORM_SRGB, D3DX_PIXEL_FORMAT_DXT2_UNORM, D3DX_PIXEL_FORMAT_DXT3_UNORM, + D3DX_PIXEL_FORMAT_BC2_UNORM_SRGB, D3DX_PIXEL_FORMAT_DXT4_UNORM, D3DX_PIXEL_FORMAT_DXT5_UNORM, + D3DX_PIXEL_FORMAT_BC3_UNORM_SRGB, D3DX_PIXEL_FORMAT_BC4_UNORM, D3DX_PIXEL_FORMAT_BC4_SNORM, D3DX_PIXEL_FORMAT_BC5_UNORM, @@ -333,6 +337,7 @@ enum format_flag * equivalent. */ FMT_FLAG_DXGI = 0x10, + FMT_FLAG_SRGB = 0x20, }; struct pixel_format_desc { From 9df14f3710371eab2cf88e4a59e7d552bdc304ee Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Tue, 27 Aug 2024 09:12:57 -0400 Subject: [PATCH 0948/2542] d3dx10: Implement D3DX10FilterTexture(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/d3dx10_43_main.c | 7 --- dlls/d3dx10_43/tests/d3dx10.c | 77 +++++++++++++++++++++++++++++++++ dlls/d3dx10_43/texture.c | 58 +++++++++++++++++++++++++ 3 files changed, 135 insertions(+), 7 deletions(-) diff --git a/dlls/d3dx10_43/d3dx10_43_main.c b/dlls/d3dx10_43/d3dx10_43_main.c index ba6de566576c..9e44714fc6dd 100644 --- a/dlls/d3dx10_43/d3dx10_43_main.c +++ b/dlls/d3dx10_43/d3dx10_43_main.c @@ -148,13 +148,6 @@ HRESULT WINAPI D3DX10CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D10_DRIVE D3D10_1_SDK_VERSION, desc, swapchain, (ID3D10Device1 **)device); } -HRESULT WINAPI D3DX10FilterTexture(ID3D10Resource *texture, UINT src_level, UINT filter) -{ - FIXME("texture %p, src_level %u, filter %#x stub!\n", texture, src_level, filter); - - return E_NOTIMPL; -} - HRESULT WINAPI D3DX10GetFeatureLevel1(ID3D10Device *device, ID3D10Device1 **device1) { TRACE("device %p, device1 %p.\n", device, device1); diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index ea94246ea025..e8ee1f359ec3 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -6737,6 +6737,82 @@ static void test_D3DX10LoadTextureFromTexture(void) ok(!ID3D10Device_Release(device), "Unexpected refcount.\n"); } +static void test_D3DX10FilterTexture(void) +{ + D3D10_SUBRESOURCE_DATA sub_resource_data[4] = { 0 }; + D3D10_TEXTURE2D_DESC tex_2d_desc; + ID3D10Texture2D *tex_2d; + uint8_t tmp_buf[1024]; + ID3D10Device *device; + RECT tmp_rect; + HRESULT hr; + + device = create_device(); + if (!device) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + CoInitialize(NULL); + + set_d3d10_2d_texture_desc(&tex_2d_desc, 8, 8, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, 0); + memset(tmp_buf, 0, sizeof(tmp_buf)); + memcpy(tmp_buf, bc1_to_bc3_8_8_decompressed, sizeof(bc1_to_bc3_8_8_decompressed)); + init_subresource_data(sub_resource_data, (const void *)tmp_buf, tex_2d_desc.Width, tex_2d_desc.Height, 1, + tex_2d_desc.MipLevels, tex_2d_desc.ArraySize, tex_2d_desc.Format); + + hr = ID3D10Device_CreateTexture2D(device, &tex_2d_desc, sub_resource_data, &tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_texture_sub_resource_color(tex_2d, 1, NULL, 0x00000000, 0); + check_texture_sub_resource_color(tex_2d, 2, NULL, 0x00000000, 0); + check_texture_sub_resource_color(tex_2d, 3, NULL, 0x00000000, 0); + + /* Invalid filter arguments. */ + hr = D3DX10FilterTexture((ID3D10Resource *)tex_2d, 0, 0); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); + + hr = D3DX10FilterTexture((ID3D10Resource *)tex_2d, 0, 9); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); + + /* + * Filter argument isn't validated if src_level argument is greater than + * total mip levels. + */ + hr = D3DX10FilterTexture((ID3D10Resource *)tex_2d, 5, 9); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = D3DX10FilterTexture((ID3D10Resource *)tex_2d, 0, D3DX10_FILTER_POINT); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + SetRect(&tmp_rect, 0, 0, 2, 2); + check_texture_sub_resource_color(tex_2d, 1, &tmp_rect, 0xffff0000, 0); + SetRect(&tmp_rect, 2, 0, 4, 2); + check_texture_sub_resource_color(tex_2d, 1, &tmp_rect, 0xff00ff00, 0); + SetRect(&tmp_rect, 0, 2, 2, 4); + check_texture_sub_resource_color(tex_2d, 1, &tmp_rect, 0xff0000ff, 0); + SetRect(&tmp_rect, 2, 2, 4, 4); + check_texture_sub_resource_color(tex_2d, 1, &tmp_rect, 0xff000000, 0); + + SetRect(&tmp_rect, 0, 0, 1, 1); + check_texture_sub_resource_color(tex_2d, 2, &tmp_rect, 0xffff0000, 0); + SetRect(&tmp_rect, 1, 0, 2, 1); + check_texture_sub_resource_color(tex_2d, 2, &tmp_rect, 0xff00ff00, 0); + SetRect(&tmp_rect, 0, 1, 1, 2); + check_texture_sub_resource_color(tex_2d, 2, &tmp_rect, 0xff0000ff, 0); + SetRect(&tmp_rect, 1, 1, 2, 2); + check_texture_sub_resource_color(tex_2d, 2, &tmp_rect, 0xff000000, 0); + + check_texture_sub_resource_color(tex_2d, 3, NULL, 0xffff0000, 0); + + ID3D10Texture2D_Release(tex_2d); + + CoUninitialize(); + + ok(!ID3D10Device_Release(device), "Unexpected refcount.\n"); +} + START_TEST(d3dx10) { HMODULE wined3d; @@ -6758,6 +6834,7 @@ START_TEST(d3dx10) test_D3DX10CreateAsyncTextureProcessor(); test_D3DX10CreateThreadPump(); test_D3DX10LoadTextureFromTexture(); + test_D3DX10FilterTexture(); test_get_image_info(); test_create_texture(); test_font(); diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 81b470dffd30..9d0b4f7385b1 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -985,6 +985,52 @@ static void d3d10_box_get_mip_level(D3D10_BOX *box, uint32_t level) } } +static uint32_t d3d10_get_resource_mip_levels(ID3D10Resource *rsrc) +{ + D3D10_RESOURCE_DIMENSION rsrc_dim; + uint32_t mip_levels = 0; + HRESULT hr; + + ID3D10Resource_GetType(rsrc, &rsrc_dim); + switch (rsrc_dim) + { + case D3D10_RESOURCE_DIMENSION_TEXTURE2D: + { + D3D10_TEXTURE2D_DESC desc; + ID3D10Texture2D *tex_2d; + + hr = ID3D10Resource_QueryInterface(rsrc, &IID_ID3D10Texture2D, (void **)&tex_2d); + if (FAILED(hr)) + break; + + ID3D10Texture2D_GetDesc(tex_2d, &desc); + ID3D10Texture2D_Release(tex_2d); + mip_levels = desc.MipLevels; + break; + } + + case D3D10_RESOURCE_DIMENSION_TEXTURE3D: + { + D3D10_TEXTURE3D_DESC desc; + ID3D10Texture3D *tex_3d; + + hr = ID3D10Resource_QueryInterface(rsrc, &IID_ID3D10Texture3D, (void **)&tex_3d); + if (FAILED(hr)) + break; + + ID3D10Texture3D_GetDesc(tex_3d, &desc); + ID3D10Texture3D_Release(tex_3d); + mip_levels = desc.MipLevels; + break; + } + + default: + break; + } + + return mip_levels; +} + static HRESULT d3dx_d3d10_texture_init(ID3D10Resource *tex_rsrc, uint32_t first_layer, uint32_t first_mip_level, D3D10_MAP map_flags, D3D10_BOX *tex_box, struct d3d10_texture *texture) { @@ -1323,3 +1369,15 @@ HRESULT WINAPI D3DX10LoadTextureFromTexture(ID3D10Resource *src_texture, D3DX10_ d3dx_d3d10_texture_release(&dst_tex); return SUCCEEDED(hr) ? S_OK : hr; } + +HRESULT WINAPI D3DX10FilterTexture(ID3D10Resource *texture, UINT src_level, UINT filter) +{ + D3DX10_TEXTURE_LOAD_INFO load_info = { NULL, NULL, src_level, src_level + 1, 0, 0, 0, 0, filter, filter }; + + TRACE("texture %p, src_level %u, filter %#x.\n", texture, src_level, filter); + + if (d3d10_get_resource_mip_levels(texture) <= src_level) + return S_OK; + + return D3DX10LoadTextureFromTexture(texture, &load_info, texture); +} From 57c5ce0d076c04ac522bf739fbee2f78933a9f18 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Tue, 27 Aug 2024 12:20:56 -0400 Subject: [PATCH 0949/2542] d3dx10: Add D3DX10CreateAsyncShaderResourceViewProcessor() stub. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/async.c | 8 + dlls/d3dx10_43/d3dx10_43.spec | 2 +- dlls/d3dx10_43/tests/d3dx10.c | 266 ++++++++++++++++++++++++++++++---- include/d3dx10async.h | 2 + 4 files changed, 246 insertions(+), 32 deletions(-) diff --git a/dlls/d3dx10_43/async.c b/dlls/d3dx10_43/async.c index 3e4e23488dbd..c4c20d049d6a 100644 --- a/dlls/d3dx10_43/async.c +++ b/dlls/d3dx10_43/async.c @@ -603,6 +603,14 @@ HRESULT WINAPI D3DX10CreateAsyncTextureProcessor(ID3D10Device *device, return S_OK; } +HRESULT WINAPI D3DX10CreateAsyncShaderResourceViewProcessor(ID3D10Device *device, + D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10DataProcessor **processor) +{ + FIXME("device %p, load_info %p, processor %p stub.\n", device, load_info, processor); + + return E_NOTIMPL; +} + struct work_item { struct list entry; diff --git a/dlls/d3dx10_43/d3dx10_43.spec b/dlls/d3dx10_43/d3dx10_43.spec index 2359c7c6f02b..37a971985745 100644 --- a/dlls/d3dx10_43/d3dx10_43.spec +++ b/dlls/d3dx10_43/d3dx10_43.spec @@ -15,7 +15,7 @@ @ stdcall D3DX10CreateAsyncResourceLoaderA(long str ptr) @ stdcall D3DX10CreateAsyncResourceLoaderW(long wstr ptr) @ stub D3DX10CreateAsyncShaderPreprocessProcessor(str ptr ptr ptr ptr ptr) -@ stub D3DX10CreateAsyncShaderResourceViewProcessor(ptr ptr ptr) +@ stdcall D3DX10CreateAsyncShaderResourceViewProcessor(ptr ptr ptr) @ stdcall D3DX10CreateAsyncTextureInfoProcessor(ptr ptr) @ stdcall D3DX10CreateAsyncTextureProcessor(ptr ptr ptr) @ stdcall D3DX10CreateDevice(ptr long long long ptr) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index e8ee1f359ec3..889e86e3fb3d 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -858,132 +858,164 @@ static const struct test_image unsigned int size; const BYTE *expected_data; D3DX10_IMAGE_INFO expected_info; + D3D10_SRV_DIMENSION expected_srv_dimension; } test_image[] = { { test_bmp_1bpp, sizeof(test_bmp_1bpp), test_bmp_1bpp_data, - {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP} + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_bmp_4bpp, sizeof(test_bmp_4bpp), test_bmp_4bpp_data, - {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP} + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_bmp_8bpp, sizeof(test_bmp_8bpp), test_bmp_8bpp_data, - {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP} + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_bmp_16bpp, sizeof(test_bmp_16bpp), test_bmp_16bpp_data, - {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP} + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_bmp_24bpp, sizeof(test_bmp_24bpp), test_bmp_24bpp_data, - {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP} + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_bmp_32bpp_xrgb, sizeof(test_bmp_32bpp_xrgb), test_bmp_32bpp_xrgb_data, - {2, 2, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP} + {2, 2, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_bmp_32bpp_argb, sizeof(test_bmp_32bpp_argb), test_bmp_32bpp_argb_data, - {2, 2, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP} + {2, 2, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_png_8bpp_gray, sizeof(test_png_8bpp_gray), test_png_8bpp_gray_data, - {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_PNG} + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_PNG}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_jpg, sizeof(test_jpg), test_jpg_data, - {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_JPG} + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_JPG}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_gif, sizeof(test_gif), test_gif_data, - {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_GIF} + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_GIF}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_tiff, sizeof(test_tiff), test_tiff_data, - {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_TIFF} + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_TIFF}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_dds_alpha, sizeof(test_dds_alpha), test_dds_alpha_data, - {1, 1, 1, 1, 1, 0, DXGI_FORMAT_A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_dds_luminance, sizeof(test_dds_luminance), test_dds_luminance_data, - {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_dds_16bpp, sizeof(test_dds_16bpp), test_dds_16bpp_data, - {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_dds_24bpp, sizeof(test_dds_24bpp), test_dds_24bpp_data, - {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_dds_32bpp, sizeof(test_dds_32bpp), test_dds_32bpp_data, - {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_dds_64bpp, sizeof(test_dds_64bpp), test_dds_64bpp_data, - {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R16G16B16A16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R16G16B16A16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_dds_96bpp, sizeof(test_dds_96bpp), test_dds_96bpp_data, - {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R32G32B32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R32G32B32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_dds_128bpp, sizeof(test_dds_128bpp), test_dds_128bpp_data, - {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R32G32B32A32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R32G32B32A32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_dds_dxt1, sizeof(test_dds_dxt1), test_dds_dxt1_data, - {4, 4, 1, 1, 1, 0, DXGI_FORMAT_BC1_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + {4, 4, 1, 1, 1, 0, DXGI_FORMAT_BC1_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_dds_dxt1_4x8, sizeof(test_dds_dxt1_4x8), test_dds_dxt1_4x8_data, - {4, 8, 1, 1, 4, 0, DXGI_FORMAT_BC1_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + {4, 8, 1, 1, 4, 0, DXGI_FORMAT_BC1_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_dds_dxt2, sizeof(test_dds_dxt2), test_dds_dxt2_data, - {4, 4, 1, 1, 3, 0, DXGI_FORMAT_BC2_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + {4, 4, 1, 1, 3, 0, DXGI_FORMAT_BC2_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_dds_dxt3, sizeof(test_dds_dxt3), test_dds_dxt3_data, - {1, 3, 1, 1, 2, 0, DXGI_FORMAT_BC2_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + {1, 3, 1, 1, 2, 0, DXGI_FORMAT_BC2_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_dds_dxt4, sizeof(test_dds_dxt4), test_dds_dxt4_data, - {4, 4, 1, 1, 3, 0, DXGI_FORMAT_BC3_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + {4, 4, 1, 1, 3, 0, DXGI_FORMAT_BC3_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_dds_dxt5, sizeof(test_dds_dxt5), test_dds_dxt5_data, - {4, 2, 1, 1, 1, 0, DXGI_FORMAT_BC3_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + {4, 2, 1, 1, 1, 0, DXGI_FORMAT_BC3_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_dds_dxt5_8x8, sizeof(test_dds_dxt5_8x8), test_dds_dxt5_8x8_data, - {8, 8, 1, 1, 4, 0, DXGI_FORMAT_BC3_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + {8, 8, 1, 1, 4, 0, DXGI_FORMAT_BC3_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_dds_bc4, sizeof(test_dds_bc4), test_dds_bc4_data, - {4, 4, 1, 1, 3, 0, DXGI_FORMAT_BC4_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + {4, 4, 1, 1, 3, 0, DXGI_FORMAT_BC4_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_dds_bc5, sizeof(test_dds_bc5), test_dds_bc5_data, - {6, 3, 1, 1, 3, 0, DXGI_FORMAT_BC5_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + {6, 3, 1, 1, 3, 0, DXGI_FORMAT_BC5_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURE2D }, { test_dds_cube, sizeof(test_dds_cube), test_dds_cube_data, - {4, 4, 1, 6, 3, 0x4, DXGI_FORMAT_BC1_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + {4, 4, 1, 6, 3, 0x4, DXGI_FORMAT_BC1_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURECUBE }, { test_dds_volume, sizeof(test_dds_volume), test_dds_volume_data, - {4, 4, 2, 1, 3, 0, DXGI_FORMAT_BC2_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, D3DX10_IFF_DDS} + {4, 4, 2, 1, 3, 0, DXGI_FORMAT_BC2_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, D3DX10_IFF_DDS}, + D3D10_SRV_DIMENSION_TEXTURE3D }, { test_wmp, sizeof(test_wmp), test_wmp_data, - {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_WMP} + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_WMP}, + D3D10_SRV_DIMENSION_TEXTURE2D }, }; @@ -2035,6 +2067,80 @@ static void check_resource_data(ID3D10Resource *resource, const struct test_imag } } +static void check_shader_resource_view_info(ID3D10ShaderResourceView *srv, const struct test_image *image, uint32_t line) +{ + uint32_t expected_mip_levels, expected_width, expected_height, max_dimension; + D3D10_SHADER_RESOURCE_VIEW_DESC srv_desc; + ID3D10Resource *resource; + + expected_width = image->expected_info.Width; + expected_height = image->expected_info.Height; + if (is_block_compressed(image->expected_info.Format)) + { + expected_width = (expected_width + 3) & ~3; + expected_height = (expected_height + 3) & ~3; + } + expected_mip_levels = 0; + max_dimension = max(max(expected_width, expected_height), image->expected_info.Depth); + while (max_dimension) + { + ++expected_mip_levels; + max_dimension >>= 1; + } + + ID3D10ShaderResourceView_GetDesc(srv, &srv_desc); + ok_(__FILE__, line)(srv_desc.Format == image->expected_info.Format, "Got unexpected Format %u, expected %u.\n", + srv_desc.Format, image->expected_info.Format); + ok_(__FILE__, line)(srv_desc.ViewDimension == image->expected_srv_dimension, "Got unexpected ViewDimension %u, expected %u.\n", + srv_desc.ViewDimension, image->expected_srv_dimension); + if (srv_desc.ViewDimension != image->expected_srv_dimension) + return; + + ID3D10ShaderResourceView_GetResource(srv, &resource); + check_resource_info(resource, image, line); + check_resource_data(resource, image, line); + ID3D10Resource_Release(resource); + + switch (srv_desc.ViewDimension) + { + case D3D10_SRV_DIMENSION_TEXTURE2D: + ok_(__FILE__, line)(!srv_desc.Texture2D.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", + srv_desc.Texture2D.MostDetailedMip); + ok_(__FILE__, line)(srv_desc.Texture2D.MipLevels == expected_mip_levels, "Unexpected MipLevels %u.\n", + srv_desc.Texture2D.MipLevels); + break; + + case D3D10_SRV_DIMENSION_TEXTURE2DARRAY: + ok_(__FILE__, line)(!srv_desc.Texture2DArray.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", + srv_desc.Texture2DArray.MostDetailedMip); + ok_(__FILE__, line)(srv_desc.Texture2DArray.MipLevels == expected_mip_levels, "Unexpected MipLevels %u.\n", + srv_desc.Texture2DArray.MipLevels); + ok_(__FILE__, line)(!srv_desc.Texture2DArray.FirstArraySlice, "Unexpected FirstArraySlice %u.\n", + srv_desc.Texture2DArray.FirstArraySlice); + ok_(__FILE__, line)(srv_desc.Texture2DArray.ArraySize == image->expected_info.ArraySize, "Unexpected ArraySize %u.\n", + srv_desc.Texture2DArray.ArraySize); + break; + + case D3D10_SRV_DIMENSION_TEXTURECUBE: + ok_(__FILE__, line)(!srv_desc.TextureCube.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", + srv_desc.TextureCube.MostDetailedMip); + ok_(__FILE__, line)(srv_desc.TextureCube.MipLevels == expected_mip_levels, "Unexpected MipLevels %u.\n", + srv_desc.TextureCube.MipLevels); + break; + + case D3D10_SRV_DIMENSION_TEXTURE3D: + ok_(__FILE__, line)(!srv_desc.Texture3D.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", + srv_desc.Texture3D.MostDetailedMip); + ok_(__FILE__, line)(srv_desc.Texture3D.MipLevels == expected_mip_levels, "Unexpected MipLevels %u.\n", + srv_desc.Texture3D.MipLevels); + break; + + default: + ok_(__FILE__, line)(0, "Unexpected ViewDimension %u.\n", srv_desc.ViewDimension); + break; + } +} + /* * Taken from the d3d10core tests. If there's a missing resource type or * texture format checking function, check to see if it exists there first. @@ -3055,6 +3161,103 @@ static void test_D3DX10CreateAsyncTextureProcessor(void) ok(!ID3D10Device_Release(device), "Unexpected refcount.\n"); } +static void test_D3DX10CreateAsyncShaderResourceViewProcessor(void) +{ + ID3D10ShaderResourceView *resource_view; + ID3DX10DataProcessor *dp; + ID3D10Device *device; + HRESULT hr; + int i; + + if (!strcmp(winetest_platform, "wine")) + { + skip("Skipping D3DX10CreateAsyncShaderResourceViewProcessor() tests.\n"); + return; + } + + device = create_device(); + if (!device) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + CoInitialize(NULL); + + hr = D3DX10CreateAsyncShaderResourceViewProcessor(device, NULL, NULL); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); + + hr = D3DX10CreateAsyncShaderResourceViewProcessor(NULL, NULL, &dp); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); + + hr = D3DX10CreateAsyncShaderResourceViewProcessor(device, NULL, &dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX10DataProcessor_Process(dp, (void *)test_image[0].data, 0); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX10DataProcessor_Process(dp, NULL, test_image[0].size); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX10DataProcessor_Destroy(dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + for (i = 0; i < ARRAY_SIZE(test_image); ++i) + { + winetest_push_context("Test %u", i); + + hr = D3DX10CreateAsyncShaderResourceViewProcessor(device, NULL, &dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = ID3DX10DataProcessor_Process(dp, (void *)test_image[i].data, test_image[i].size); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + hr = ID3DX10DataProcessor_CreateDeviceObject(dp, (void **)&resource_view); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + check_shader_resource_view_info(resource_view, test_image + i, __LINE__); + ID3D10ShaderResourceView_Release(resource_view); + } + + hr = ID3DX10DataProcessor_Destroy(dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + winetest_pop_context(); + } + + for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) + { + const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; + D3DX10_IMAGE_LOAD_INFO load_info = test_load_info->load_info; + + winetest_push_context("Test %u", i); + + hr = D3DX10CreateAsyncShaderResourceViewProcessor(device, &load_info, &dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = ID3DX10DataProcessor_Process(dp, (void *)test_load_info->data, test_load_info->size); + todo_wine_if(test_load_info->todo_process_hr) + ok(hr == test_load_info->expected_process_hr, "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + resource_view = NULL; + hr = ID3DX10DataProcessor_CreateDeviceObject(dp, (void **)&resource_view); + todo_wine_if(test_load_info->todo_create_device_object_hr) + ok(hr == test_load_info->expected_create_device_object_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D10ShaderResourceView_Release(resource_view); + } + + hr = ID3DX10DataProcessor_Destroy(dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + winetest_pop_context(); + } + + CoUninitialize(); + + ok(!ID3D10Device_Release(device), "Unexpected refcount.\n"); +} + static DWORD main_tid; static DWORD io_tid; @@ -6832,6 +7035,7 @@ START_TEST(d3dx10) test_D3DX10CreateAsyncResourceLoader(); test_D3DX10CreateAsyncTextureInfoProcessor(); test_D3DX10CreateAsyncTextureProcessor(); + test_D3DX10CreateAsyncShaderResourceViewProcessor(); test_D3DX10CreateThreadPump(); test_D3DX10LoadTextureFromTexture(); test_D3DX10FilterTexture(); diff --git a/include/d3dx10async.h b/include/d3dx10async.h index 931458f48136..bfab25b45616 100644 --- a/include/d3dx10async.h +++ b/include/d3dx10async.h @@ -79,5 +79,7 @@ HRESULT WINAPI D3DX10CreateAsyncResourceLoaderW(HMODULE module, const WCHAR *res HRESULT WINAPI D3DX10CreateAsyncTextureProcessor(ID3D10Device *device, D3DX10_IMAGE_LOAD_INFO *info, ID3DX10DataProcessor **processor); HRESULT WINAPI D3DX10CreateAsyncTextureInfoProcessor(D3DX10_IMAGE_INFO *info, ID3DX10DataProcessor **processor); +HRESULT WINAPI D3DX10CreateAsyncShaderResourceViewProcessor(ID3D10Device *device, + D3DX10_IMAGE_LOAD_INFO *info, ID3DX10DataProcessor **processor); #endif From dce8dd2d7bc1869aa630b2db2b05713e4624ab27 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Tue, 27 Aug 2024 12:40:01 -0400 Subject: [PATCH 0950/2542] d3dx10: Implement D3DX10CreateAsyncShaderResourceViewProcessor(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/async.c | 79 ++++++++++++++++++++++++++++++++++- dlls/d3dx10_43/tests/d3dx10.c | 8 +--- 2 files changed, 78 insertions(+), 9 deletions(-) diff --git a/dlls/d3dx10_43/async.c b/dlls/d3dx10_43/async.c index c4c20d049d6a..db00df59a0d7 100644 --- a/dlls/d3dx10_43/async.c +++ b/dlls/d3dx10_43/async.c @@ -379,6 +379,63 @@ static ID3DX10DataProcessorVtbl texture_processor_vtbl = texture_processor_Destroy }; +struct srv_processor +{ + ID3DX10DataProcessor ID3DX10DataProcessor_iface; + ID3DX10DataProcessor *texture_processor; +}; + +static inline struct srv_processor *srv_processor_from_ID3DX10DataProcessor(ID3DX10DataProcessor *iface) +{ + return CONTAINING_RECORD(iface, struct srv_processor, ID3DX10DataProcessor_iface); +} + +static HRESULT WINAPI srv_processor_Process(ID3DX10DataProcessor *iface, void *data, SIZE_T size) +{ + struct srv_processor *processor = srv_processor_from_ID3DX10DataProcessor(iface); + + TRACE("iface %p, data %p, size %Iu.\n", iface, data, size); + + return ID3DX10DataProcessor_Process(processor->texture_processor, data, size); +} + +static HRESULT WINAPI srv_processor_CreateDeviceObject(ID3DX10DataProcessor *iface, void **object) +{ + struct srv_processor *processor = srv_processor_from_ID3DX10DataProcessor(iface); + struct texture_processor *tex_processor = texture_processor_from_ID3DX10DataProcessor(processor->texture_processor); + ID3D10Resource *texture_resource; + HRESULT hr; + + TRACE("iface %p, object %p.\n", iface, object); + + hr = ID3DX10DataProcessor_CreateDeviceObject(processor->texture_processor, (void **)&texture_resource); + if (FAILED(hr)) + return hr; + + hr = ID3D10Device_CreateShaderResourceView(tex_processor->device, texture_resource, NULL, + (ID3D10ShaderResourceView **)object); + ID3D10Resource_Release(texture_resource); + return hr; +} + +static HRESULT WINAPI srv_processor_Destroy(ID3DX10DataProcessor *iface) +{ + struct srv_processor *processor = srv_processor_from_ID3DX10DataProcessor(iface); + + TRACE("iface %p.\n", iface); + + ID3DX10DataProcessor_Destroy(processor->texture_processor); + free(processor); + return S_OK; +} + +static ID3DX10DataProcessorVtbl srv_processor_vtbl = +{ + srv_processor_Process, + srv_processor_CreateDeviceObject, + srv_processor_Destroy +}; + HRESULT WINAPI D3DX10CompileFromMemory(const char *data, SIZE_T data_size, const char *filename, const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *entry_point, const char *target, UINT sflags, UINT eflags, ID3DX10ThreadPump *pump, ID3D10Blob **shader, @@ -606,9 +663,27 @@ HRESULT WINAPI D3DX10CreateAsyncTextureProcessor(ID3D10Device *device, HRESULT WINAPI D3DX10CreateAsyncShaderResourceViewProcessor(ID3D10Device *device, D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10DataProcessor **processor) { - FIXME("device %p, load_info %p, processor %p stub.\n", device, load_info, processor); + struct srv_processor *object; + HRESULT hr; - return E_NOTIMPL; + TRACE("device %p, load_info %p, processor %p.\n", device, load_info, processor); + + if (!device || !processor) + return E_INVALIDARG; + + object = calloc(1, sizeof(*object)); + if (!object) + return E_OUTOFMEMORY; + + hr = D3DX10CreateAsyncTextureProcessor(device, load_info, &object->texture_processor); + if (FAILED(hr)) + { + free(object); + return hr; + } + object->ID3DX10DataProcessor_iface.lpVtbl = &srv_processor_vtbl; + *processor = &object->ID3DX10DataProcessor_iface; + return S_OK; } struct work_item diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 889e86e3fb3d..38d365a3a88c 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -3167,13 +3167,7 @@ static void test_D3DX10CreateAsyncShaderResourceViewProcessor(void) ID3DX10DataProcessor *dp; ID3D10Device *device; HRESULT hr; - int i; - - if (!strcmp(winetest_platform, "wine")) - { - skip("Skipping D3DX10CreateAsyncShaderResourceViewProcessor() tests.\n"); - return; - } + uint32_t i; device = create_device(); if (!device) From 5b6c205705a263380d83590768bfc9a48bd3d746 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 28 Aug 2024 08:16:58 -0400 Subject: [PATCH 0951/2542] d3dx10: Implement D3DX10CreateShaderResourceViewFrom{File,Memory,Resource}(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/d3dx10_43.spec | 10 +- dlls/d3dx10_43/tests/d3dx10.c | 453 +++++++++++++++++++++++++++++++++- dlls/d3dx10_43/texture.c | 222 +++++++++++++++++ include/d3dx10tex.h | 14 ++ 4 files changed, 691 insertions(+), 8 deletions(-) diff --git a/dlls/d3dx10_43/d3dx10_43.spec b/dlls/d3dx10_43/d3dx10_43.spec index 37a971985745..68e6c64cdf5a 100644 --- a/dlls/d3dx10_43/d3dx10_43.spec +++ b/dlls/d3dx10_43/d3dx10_43.spec @@ -35,11 +35,11 @@ @ stdcall D3DX10CreateFontIndirectW(ptr ptr ptr) @ stdcall D3DX10CreateFontW(ptr long long long long long long long long long wstr ptr) @ stdcall D3DX10CreateMesh(ptr ptr long str long long long ptr) -@ stub D3DX10CreateShaderResourceViewFromFileA(ptr str ptr ptr ptr ptr) -@ stub D3DX10CreateShaderResourceViewFromFileW(ptr wstr ptr ptr ptr ptr) -@ stub D3DX10CreateShaderResourceViewFromMemory(ptr ptr long ptr ptr ptr ptr) -@ stub D3DX10CreateShaderResourceViewFromResourceA(ptr long str ptr ptr ptr ptr) -@ stub D3DX10CreateShaderResourceViewFromResourceW(ptr long wstr ptr ptr ptr ptr) +@ stdcall D3DX10CreateShaderResourceViewFromFileA(ptr str ptr ptr ptr ptr) +@ stdcall D3DX10CreateShaderResourceViewFromFileW(ptr wstr ptr ptr ptr ptr) +@ stdcall D3DX10CreateShaderResourceViewFromMemory(ptr ptr long ptr ptr ptr ptr) +@ stdcall D3DX10CreateShaderResourceViewFromResourceA(ptr long str ptr ptr ptr ptr) +@ stdcall D3DX10CreateShaderResourceViewFromResourceW(ptr long wstr ptr ptr ptr ptr) @ stub D3DX10CreateSkinInfo(ptr) @ stdcall D3DX10CreateSprite(ptr long ptr) @ stdcall D3DX10CreateTextureFromFileA(ptr str ptr ptr ptr ptr) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 38d365a3a88c..a0cd0da242d2 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -1026,6 +1026,7 @@ static const struct test_image_load_info D3DX10_IMAGE_LOAD_INFO load_info; HRESULT expected_hr; + D3D10_SRV_DIMENSION expected_srv_dimension; D3D10_RESOURCE_DIMENSION expected_type; union { @@ -1047,7 +1048,7 @@ test_image_load_info[] = dds_volume_24bit_4_4_4, sizeof(dds_volume_24bit_4_4_4), { D3DX10_FROM_FILE, D3DX10_DEFAULT, 0, 1, D3DX10_DEFAULT, (D3D10_USAGE)D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT }, - S_OK, D3D10_RESOURCE_DIMENSION_TEXTURE3D, + S_OK, D3D10_SRV_DIMENSION_TEXTURE3D, D3D10_RESOURCE_DIMENSION_TEXTURE3D, { .desc_3d = { 4, 4, 4, 3, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 } }, { 4, 4, 4, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, D3DX10_IFF_DDS }, }, @@ -1061,7 +1062,7 @@ test_image_load_info[] = { D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, (D3D10_USAGE)D3DX10_DEFAULT, (D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET), D3DX10_DEFAULT, D3D10_RESOURCE_MISC_GENERATE_MIPS, DXGI_FORMAT_R8G8B8A8_UNORM, D3DX10_DEFAULT, D3DX10_DEFAULT }, - S_OK, D3D10_RESOURCE_DIMENSION_TEXTURE2D, + S_OK, D3D10_SRV_DIMENSION_TEXTURECUBE, D3D10_RESOURCE_DIMENSION_TEXTURE2D, { .desc_2d = { 4, 4, 3, 6, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, (D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET), 0, (D3D10_RESOURCE_MISC_GENERATE_MIPS | D3D10_RESOURCE_MISC_TEXTURECUBE) } }, @@ -1077,7 +1078,7 @@ test_image_load_info[] = { D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, 2, (D3D10_USAGE)D3DX10_DEFAULT, (D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET), D3DX10_DEFAULT, D3D10_RESOURCE_MISC_GENERATE_MIPS, DXGI_FORMAT_R8G8B8A8_UNORM, D3DX10_DEFAULT, D3DX10_DEFAULT }, - S_OK, D3D10_RESOURCE_DIMENSION_TEXTURE2D, + S_OK, D3D10_SRV_DIMENSION_TEXTURECUBE, D3D10_RESOURCE_DIMENSION_TEXTURE2D, { .desc_2d = { 4, 4, 2, 6, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, (D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET), 0, (D3D10_RESOURCE_MISC_GENERATE_MIPS | D3D10_RESOURCE_MISC_TEXTURECUBE) } }, @@ -1830,6 +1831,71 @@ static void check_test_image_load_info_resource_(uint32_t line, ID3D10Resource * } } +#define check_test_image_load_info_srv(srv, image_load_info) \ + check_test_image_load_info_srv_(__LINE__, srv, image_load_info) +static void check_test_image_load_info_srv_(uint32_t line, ID3D10ShaderResourceView *srv, + const struct test_image_load_info *image_load_info) +{ + D3D10_SHADER_RESOURCE_VIEW_DESC srv_desc; + ID3D10Resource *resource; + + ID3D10ShaderResourceView_GetDesc(srv, &srv_desc); + ok_(__FILE__, line)(srv_desc.ViewDimension == image_load_info->expected_srv_dimension, "Got unexpected ViewDimension %u, expected %u.\n", + srv_desc.ViewDimension, image_load_info->expected_srv_dimension); + if (srv_desc.ViewDimension != image_load_info->expected_srv_dimension) + return; + + ID3D10ShaderResourceView_GetResource(srv, &resource); + check_test_image_load_info_resource_(line, resource, image_load_info); + ID3D10Resource_Release(resource); + switch (srv_desc.ViewDimension) + { + case D3D10_SRV_DIMENSION_TEXTURE2D: + ok_(__FILE__, line)(srv_desc.Format == image_load_info->expected_resource_desc.desc_2d.Format, + "Got unexpected Format %u, expected %u.\n", srv_desc.Format, image_load_info->expected_resource_desc.desc_2d.Format); + ok_(__FILE__, line)(!srv_desc.Texture2D.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", + srv_desc.Texture2D.MostDetailedMip); + ok_(__FILE__, line)(srv_desc.Texture2D.MipLevels == image_load_info->expected_resource_desc.desc_2d.MipLevels, + "Unexpected MipLevels %u.\n", srv_desc.Texture2D.MipLevels); + break; + + case D3D10_SRV_DIMENSION_TEXTURE2DARRAY: + ok_(__FILE__, line)(srv_desc.Format == image_load_info->expected_resource_desc.desc_2d.Format, + "Got unexpected Format %u, expected %u.\n", srv_desc.Format, image_load_info->expected_resource_desc.desc_2d.Format); + ok_(__FILE__, line)(!srv_desc.Texture2DArray.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", + srv_desc.Texture2DArray.MostDetailedMip); + ok_(__FILE__, line)(srv_desc.Texture2DArray.MipLevels == image_load_info->expected_resource_desc.desc_2d.MipLevels, + "Unexpected MipLevels %u.\n", srv_desc.Texture2DArray.MipLevels); + ok_(__FILE__, line)(!srv_desc.Texture2DArray.FirstArraySlice, "Unexpected FirstArraySlice %u.\n", + srv_desc.Texture2DArray.FirstArraySlice); + ok_(__FILE__, line)(srv_desc.Texture2DArray.ArraySize == image_load_info->expected_resource_desc.desc_2d.ArraySize, + "Unexpected ArraySize %u.\n", srv_desc.Texture2DArray.ArraySize); + break; + + case D3D10_SRV_DIMENSION_TEXTURECUBE: + ok_(__FILE__, line)(srv_desc.Format == image_load_info->expected_resource_desc.desc_2d.Format, + "Got unexpected Format %u, expected %u.\n", srv_desc.Format, image_load_info->expected_resource_desc.desc_2d.Format); + ok_(__FILE__, line)(!srv_desc.TextureCube.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", + srv_desc.TextureCube.MostDetailedMip); + ok_(__FILE__, line)(srv_desc.TextureCube.MipLevels == image_load_info->expected_resource_desc.desc_2d.MipLevels, + "Unexpected MipLevels %u.\n", srv_desc.TextureCube.MipLevels); + break; + + case D3D10_SRV_DIMENSION_TEXTURE3D: + ok_(__FILE__, line)(srv_desc.Format == image_load_info->expected_resource_desc.desc_3d.Format, + "Got unexpected Format %u, expected %u.\n", srv_desc.Format, image_load_info->expected_resource_desc.desc_3d.Format); + ok_(__FILE__, line)(!srv_desc.Texture3D.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", + srv_desc.Texture3D.MostDetailedMip); + ok_(__FILE__, line)(srv_desc.Texture3D.MipLevels == image_load_info->expected_resource_desc.desc_3d.MipLevels, + "Unexpected MipLevels %u.\n", srv_desc.Texture3D.MipLevels); + break; + + default: + ok_(__FILE__, line)(0, "Unexpected ViewDimension %u.\n", srv_desc.ViewDimension); + break; + } +} + static void check_resource_info(ID3D10Resource *resource, const struct test_image *image, unsigned int line) { unsigned int expected_mip_levels, expected_width, expected_height, max_dimension; @@ -4605,6 +4671,386 @@ static void test_create_texture(void) ok(!ID3D10Device_Release(device), "Unexpected refcount.\n"); } +static void test_create_shader_resource_view(void) +{ + static const uint32_t dds_24bit_8_8_mip_level_expected[] = { 0xff0000ff, 0xff00ff00, 0xffff0000, 0xff000000 }; + static const WCHAR test_resource_name[] = L"resource.data"; + static const WCHAR test_filename[] = L"image.data"; + D3D10_SHADER_RESOURCE_VIEW_DESC srv_desc; + D3D10_TEXTURE2D_DESC tex_2d_desc; + D3DX10_IMAGE_LOAD_INFO load_info; + ID3D10ShaderResourceView *srv; + D3DX10_IMAGE_INFO img_info; + ID3D10Resource *resource; + ID3D10Texture2D *tex_2d; + HMODULE resource_module; + ID3D10Device *device; + WCHAR path[MAX_PATH]; + uint32_t i, mip_level; + HRESULT hr, hr2; + + device = create_device(); + if (!device) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + CoInitialize(NULL); + + /* D3DX10CreateShaderResourceViewFromMemory tests. */ + srv = (ID3D10ShaderResourceView *)0xdeadbeef; + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromMemory(NULL, test_bmp_1bpp, sizeof(test_bmp_1bpp), NULL, NULL, &srv, &hr2); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + ok(srv == (ID3D10ShaderResourceView *)0xdeadbeef, "Got unexpected srv %p.\n", srv); + + srv = (ID3D10ShaderResourceView *)0xdeadbeef; + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromMemory(device, NULL, 0, NULL, NULL, &srv, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + ok(srv == (ID3D10ShaderResourceView *)0xdeadbeef, "Got unexpected srv %p.\n", srv); + + srv = (ID3D10ShaderResourceView *)0xdeadbeef; + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromMemory(device, NULL, sizeof(test_bmp_1bpp), NULL, NULL, &srv, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + ok(srv == (ID3D10ShaderResourceView *)0xdeadbeef, "Got unexpected srv %p.\n", srv); + + srv = (ID3D10ShaderResourceView *)0xdeadbeef; + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromMemory(device, test_bmp_1bpp, 0, NULL, NULL, &srv, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(srv == (ID3D10ShaderResourceView *)0xdeadbeef, "Got unexpected srv %p.\n", srv); + + srv = (ID3D10ShaderResourceView *)0xdeadbeef; + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromMemory(device, test_bmp_1bpp, sizeof(test_bmp_1bpp) - 1, NULL, NULL, &srv, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(srv == (ID3D10ShaderResourceView *)0xdeadbeef, "Got unexpected srv %p.\n", srv); + + for (i = 0; i < ARRAY_SIZE(test_image); ++i) + { + winetest_push_context("Test %u", i); + + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromMemory(device, test_image[i].data, test_image[i].size, NULL, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + check_shader_resource_view_info(srv, test_image + i, __LINE__); + ID3D10ShaderResourceView_Release(srv); + } + + winetest_pop_context(); + } + + for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) + { + const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; + + winetest_push_context("Test %u", i); + + hr2 = 0xdeadbeef; + load_info = test_load_info->load_info; + hr = D3DX10CreateShaderResourceViewFromMemory(device, test_load_info->data, test_load_info->size, &load_info, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D10ShaderResourceView_Release(srv); + + winetest_pop_context(); + } + + for (i = 0; i < ARRAY_SIZE(test_image_load_info); ++i) + { + const struct test_image_load_info *test_load_info = &test_image_load_info[i]; + + winetest_push_context("Test %u", i); + + load_info = test_load_info->load_info; + load_info.pSrcInfo = &img_info; + + srv = NULL; + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromMemory(device, test_load_info->data, test_load_info->size, &load_info, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + check_test_image_load_info_srv(srv, test_load_info); + ID3D10ShaderResourceView_Release(srv); + } + + winetest_pop_context(); + } + + /* Check behavior of the FirstMipLevel argument. */ + for (i = 0; i < 2; ++i) + { + winetest_push_context("FirstMipLevel %u", i); + memset(&img_info, 0, sizeof(img_info)); + set_d3dx10_image_load_info(&load_info, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, i, D3DX10_FROM_FILE, + D3D10_USAGE_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, + D3DX10_DEFAULT, &img_info); + + srv = NULL; + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromMemory(device, dds_24bit_8_8, sizeof(dds_24bit_8_8), &load_info, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, + D3DX10_IFF_DDS, FALSE); + + ID3D10ShaderResourceView_GetDesc(srv, &srv_desc); + ok(srv_desc.ViewDimension == D3D10_SRV_DIMENSION_TEXTURE2D, "Got unexpected ViewDimension %u.\n", srv_desc.ViewDimension); + ok(srv_desc.Format == img_info.Format, "Got unexpected Format %#x.\n", srv_desc.Format); + ok(!srv_desc.Texture2D.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", srv_desc.Texture2D.MostDetailedMip); + ok(srv_desc.Texture2D.MipLevels == img_info.MipLevels, "Unexpected MipLevels %u.\n", srv_desc.Texture2D.MipLevels); + + ID3D10ShaderResourceView_GetResource(srv, &resource); + hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture2D, (void **)&tex_2d); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + ID3D10Texture2D_GetDesc(tex_2d, &tex_2d_desc); + check_texture2d_desc_values(&tex_2d_desc, 8, 8, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, 0, FALSE); + for (mip_level = 0; mip_level < 4; ++mip_level) + { + winetest_push_context("MipLevel %u", mip_level); + check_texture_sub_resource_color(tex_2d, mip_level, NULL, + dds_24bit_8_8_mip_level_expected[min(3, mip_level + i)], 0); + winetest_pop_context(); + } + + ID3D10Texture2D_Release(tex_2d); + ID3D10Resource_Release(resource); + ID3D10ShaderResourceView_Release(srv); + winetest_pop_context(); + } + + /* + * If FirstMipLevel is set to a value that is larger than the total number + * of mip levels in the image, it falls back to 0. + */ + memset(&img_info, 0, sizeof(img_info)); + set_d3dx10_image_load_info(&load_info, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, 5, D3DX10_FROM_FILE, + D3D10_USAGE_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, + D3DX10_DEFAULT, &img_info); + + resource = NULL; + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromMemory(device, dds_24bit_8_8, sizeof(dds_24bit_8_8), &load_info, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, + D3DX10_IFF_DDS, FALSE); + + ID3D10ShaderResourceView_GetDesc(srv, &srv_desc); + ok(srv_desc.ViewDimension == D3D10_SRV_DIMENSION_TEXTURE2D, "Got unexpected ViewDimension %u.\n", srv_desc.ViewDimension); + ok(srv_desc.Format == img_info.Format, "Got unexpected Format %#x.\n", srv_desc.Format); + ok(!srv_desc.Texture2D.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", srv_desc.Texture2D.MostDetailedMip); + ok(srv_desc.Texture2D.MipLevels == img_info.MipLevels, "Unexpected MipLevels %u.\n", srv_desc.Texture2D.MipLevels); + + ID3D10ShaderResourceView_GetResource(srv, &resource); + hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture2D, (void **)&tex_2d); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ID3D10Texture2D_GetDesc(tex_2d, &tex_2d_desc); + check_texture2d_desc_values(&tex_2d_desc, 8, 8, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, 0, FALSE); + for (mip_level = 0; mip_level < 4; ++mip_level) + { + winetest_push_context("MipLevel %u", mip_level); + check_texture_sub_resource_color(tex_2d, mip_level, NULL, dds_24bit_8_8_mip_level_expected[mip_level], 0); + winetest_pop_context(); + } + + ID3D10Texture2D_Release(tex_2d); + ID3D10Resource_Release(resource); + ID3D10ShaderResourceView_Release(srv); + + hr2 = 0xdeadbeef; + add_work_item_count = 0; + hr = D3DX10CreateShaderResourceViewFromMemory(device, test_image[0].data, test_image[0].size, + NULL, &thread_pump, &srv, &hr2); + ok(add_work_item_count == 1, "Got unexpected add_work_item_count %u.\n", add_work_item_count); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + check_shader_resource_view_info(srv, test_image, __LINE__); + ID3D10ShaderResourceView_Release(srv); + + /* D3DX10CreateShaderResourceViewFromFile tests */ + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromFileW(device, NULL, NULL, NULL, &srv, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromFileW(device, L"deadbeef", NULL, NULL, &srv, &hr2); + ok(hr == D3D10_ERROR_FILE_NOT_FOUND, "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromFileA(device, NULL, NULL, NULL, &srv, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromFileA(device, "deadbeef", NULL, NULL, &srv, &hr2); + ok(hr == D3D10_ERROR_FILE_NOT_FOUND, "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + + for (i = 0; i < ARRAY_SIZE(test_image); ++i) + { + winetest_push_context("Test %u", i); + create_file(test_filename, test_image[i].data, test_image[i].size, path); + + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromFileW(device, path, NULL, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + check_shader_resource_view_info(srv, test_image + i, __LINE__); + ID3D10ShaderResourceView_Release(srv); + } + + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromFileA(device, get_str_a(path), NULL, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + check_shader_resource_view_info(srv, test_image + i, __LINE__); + ID3D10ShaderResourceView_Release(srv); + } + + delete_file(test_filename); + winetest_pop_context(); + } + + for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) + { + const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; + + winetest_push_context("Test %u", i); + create_file(test_filename, test_image[i].data, test_image[i].size, path); + load_info = test_load_info->load_info; + + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromFileW(device, path, &load_info, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D10ShaderResourceView_Release(srv); + + hr = D3DX10CreateShaderResourceViewFromFileA(device, get_str_a(path), &load_info, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D10ShaderResourceView_Release(srv); + + delete_file(test_filename); + winetest_pop_context(); + } + + /* D3DX10CreateShaderResourceViewFromResource tests */ + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromResourceW(device, NULL, NULL, NULL, NULL, &srv, &hr2); + ok(hr == D3DX10_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromResourceW(device, NULL, L"deadbeef", NULL, NULL, &srv, &hr2); + ok(hr == D3DX10_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromResourceA(device, NULL, NULL, NULL, NULL, &srv, &hr2); + ok(hr == D3DX10_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromResourceA(device, NULL, "deadbeef", NULL, NULL, &srv, &hr2); + ok(hr == D3DX10_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + + for (i = 0; i < ARRAY_SIZE(test_image); ++i) + { + winetest_push_context("Test %u", i); + resource_module = create_resource_module(test_resource_name, test_image[i].data, test_image[i].size); + + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromResourceW(device, resource_module, L"deadbeef", NULL, NULL, &srv, &hr2); + ok(hr == D3DX10_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromResourceW(device, resource_module, + test_resource_name, NULL, NULL, &srv, &hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + if (hr == S_OK) + { + check_shader_resource_view_info(srv, test_image + i, __LINE__); + ID3D10ShaderResourceView_Release(srv); + } + + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromResourceA(device, resource_module, + get_str_a(test_resource_name), NULL, NULL, &srv, &hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + if (hr == S_OK) + { + check_shader_resource_view_info(srv, test_image + i, __LINE__); + ID3D10ShaderResourceView_Release(srv); + } + + delete_resource_module(test_resource_name, resource_module); + winetest_pop_context(); + } + + for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) + { + const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; + + winetest_push_context("Test %u", i); + resource_module = create_resource_module(test_resource_name, test_load_info->data, test_load_info->size); + load_info = test_load_info->load_info; + + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromResourceW(device, resource_module, + test_resource_name, &load_info, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D10ShaderResourceView_Release(srv); + + hr2 = 0xdeadbeef; + hr = D3DX10CreateShaderResourceViewFromResourceA(device, resource_module, + get_str_a(test_resource_name), &load_info, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D10ShaderResourceView_Release(srv); + + delete_resource_module(test_resource_name, resource_module); + winetest_pop_context(); + } + + CoUninitialize(); + + ok(!ID3D10Device_Release(device), "Unexpected refcount.\n"); +} + + + #define check_rect(rect, left, top, right, bottom) _check_rect(__LINE__, rect, left, top, right, bottom) static inline void _check_rect(unsigned int line, const RECT *rect, int left, int top, int right, int bottom) { @@ -7035,6 +7481,7 @@ START_TEST(d3dx10) test_D3DX10FilterTexture(); test_get_image_info(); test_create_texture(); + test_create_shader_resource_view(); test_font(); test_sprite(); test_create_effect_from_memory(); diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 9d0b4f7385b1..fb380ae4198f 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -927,6 +927,228 @@ HRESULT WINAPI D3DX10CreateTextureFromMemory(ID3D10Device *device, const void *s return hr; } +/* + * D3DX10CreateShaderResourceView variants. + */ +HRESULT WINAPI D3DX10CreateShaderResourceViewFromFileA(ID3D10Device *device, const char *src_file, + D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10ShaderResourceView **srv, HRESULT *hresult) +{ + WCHAR *buffer; + int str_len; + HRESULT hr; + + TRACE("device %p, src_file %s, load_info %p, pump %p, srv %p, hresult %p.\n", + device, debugstr_a(src_file), load_info, pump, srv, hresult); + + if (!device) + return E_INVALIDARG; + if (!src_file) + return E_FAIL; + + if (!(str_len = MultiByteToWideChar(CP_ACP, 0, src_file, -1, NULL, 0))) + return HRESULT_FROM_WIN32(GetLastError()); + + if (!(buffer = malloc(str_len * sizeof(*buffer)))) + return E_OUTOFMEMORY; + + MultiByteToWideChar(CP_ACP, 0, src_file, -1, buffer, str_len); + hr = D3DX10CreateShaderResourceViewFromFileW(device, buffer, load_info, pump, srv, hresult); + + free(buffer); + + return hr; +} + +HRESULT WINAPI D3DX10CreateShaderResourceViewFromFileW(ID3D10Device *device, const WCHAR *src_file, + D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10ShaderResourceView **srv, HRESULT *hresult) +{ + ID3D10Resource *texture; + void *buffer = NULL; + DWORD size = 0; + HRESULT hr; + + TRACE("device %p, src_file %s, load_info %p, pump %p, srv %p, hresult %p.\n", + device, debugstr_w(src_file), load_info, pump, srv, hresult); + + if (!device) + return E_INVALIDARG; + if (!src_file) + return E_FAIL; + + if (pump) + { + ID3DX10DataProcessor *processor; + ID3DX10DataLoader *loader; + + if (FAILED((hr = D3DX10CreateAsyncFileLoaderW(src_file, &loader)))) + return hr; + if (FAILED((hr = D3DX10CreateAsyncShaderResourceViewProcessor(device, load_info, &processor)))) + { + ID3DX10DataLoader_Destroy(loader); + return hr; + } + if (FAILED((hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, hresult, (void **)srv)))) + { + ID3DX10DataLoader_Destroy(loader); + ID3DX10DataProcessor_Destroy(processor); + } + return hr; + } + + if (SUCCEEDED((hr = load_file(src_file, &buffer, &size)))) + { + hr = create_texture(device, buffer, size, load_info, &texture); + if (SUCCEEDED(hr)) + { + hr = ID3D10Device_CreateShaderResourceView(device, texture, NULL, srv); + ID3D10Resource_Release(texture); + } + free(buffer); + } + if (hresult) + *hresult = hr; + return hr; +} + +HRESULT WINAPI D3DX10CreateShaderResourceViewFromResourceA(ID3D10Device *device, HMODULE module, const char *resource, + D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10ShaderResourceView **srv, HRESULT *hresult) +{ + ID3D10Resource *texture; + void *buffer; + DWORD size; + HRESULT hr; + + TRACE("device %p, module %p, resource %s, load_info %p, pump %p, srv %p, hresult %p.\n", + device, module, debugstr_a(resource), load_info, pump, srv, hresult); + + if (!device) + return E_INVALIDARG; + + if (pump) + { + ID3DX10DataProcessor *processor; + ID3DX10DataLoader *loader; + + if (FAILED((hr = D3DX10CreateAsyncResourceLoaderA(module, resource, &loader)))) + return hr; + if (FAILED((hr = D3DX10CreateAsyncShaderResourceViewProcessor(device, load_info, &processor)))) + { + ID3DX10DataLoader_Destroy(loader); + return hr; + } + if (FAILED((hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, hresult, (void **)srv)))) + { + ID3DX10DataLoader_Destroy(loader); + ID3DX10DataProcessor_Destroy(processor); + } + return hr; + } + + if (FAILED((hr = load_resourceA(module, resource, &buffer, &size)))) + return hr; + hr = create_texture(device, buffer, size, load_info, &texture); + if (SUCCEEDED(hr)) + { + hr = ID3D10Device_CreateShaderResourceView(device, texture, NULL, srv); + ID3D10Resource_Release(texture); + } + if (hresult) + *hresult = hr; + return hr; +} + +HRESULT WINAPI D3DX10CreateShaderResourceViewFromResourceW(ID3D10Device *device, HMODULE module, const WCHAR *resource, + D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10ShaderResourceView **srv, HRESULT *hresult) +{ + ID3D10Resource *texture; + void *buffer; + DWORD size; + HRESULT hr; + + TRACE("device %p, module %p, resource %s, load_info %p, pump %p, srv %p, hresult %p.\n", + device, module, debugstr_w(resource), load_info, pump, srv, hresult); + + if (!device) + return E_INVALIDARG; + + if (pump) + { + ID3DX10DataProcessor *processor; + ID3DX10DataLoader *loader; + + if (FAILED((hr = D3DX10CreateAsyncResourceLoaderW(module, resource, &loader)))) + return hr; + if (FAILED((hr = D3DX10CreateAsyncShaderResourceViewProcessor(device, load_info, &processor)))) + { + ID3DX10DataLoader_Destroy(loader); + return hr; + } + if (FAILED((hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, hresult, (void **)srv)))) + { + ID3DX10DataLoader_Destroy(loader); + ID3DX10DataProcessor_Destroy(processor); + } + return hr; + } + + if (FAILED((hr = load_resourceW(module, resource, &buffer, &size)))) + return hr; + hr = create_texture(device, buffer, size, load_info, &texture); + if (SUCCEEDED(hr)) + { + hr = ID3D10Device_CreateShaderResourceView(device, texture, NULL, srv); + ID3D10Resource_Release(texture); + } + if (hresult) + *hresult = hr; + return hr; +} + +HRESULT WINAPI D3DX10CreateShaderResourceViewFromMemory(ID3D10Device *device, const void *src_data, SIZE_T src_data_size, + D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10ShaderResourceView **srv, HRESULT *hresult) +{ + ID3D10Resource *texture; + HRESULT hr; + + TRACE("device %p, src_data %p, src_data_size %Iu, load_info %p, pump %p, srv %p, hresult %p.\n", + device, src_data, src_data_size, load_info, pump, srv, hresult); + + if (!device) + return E_INVALIDARG; + if (!src_data) + return E_FAIL; + + if (pump) + { + ID3DX10DataProcessor *processor; + ID3DX10DataLoader *loader; + + if (FAILED((hr = D3DX10CreateAsyncMemoryLoader(src_data, src_data_size, &loader)))) + return hr; + if (FAILED((hr = D3DX10CreateAsyncShaderResourceViewProcessor(device, load_info, &processor)))) + { + ID3DX10DataLoader_Destroy(loader); + return hr; + } + if (FAILED((hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, hresult, (void **)srv)))) + { + ID3DX10DataLoader_Destroy(loader); + ID3DX10DataProcessor_Destroy(processor); + } + return hr; + } + + hr = create_texture(device, src_data, src_data_size, load_info, &texture); + if (SUCCEEDED(hr)) + { + hr = ID3D10Device_CreateShaderResourceView(device, texture, NULL, srv); + ID3D10Resource_Release(texture); + } + if (hresult) + *hresult = hr; + return hr; +} + struct d3d10_texture_resource { D3D10_RESOURCE_DIMENSION texture_dimension; diff --git a/include/d3dx10tex.h b/include/d3dx10tex.h index 33e41e577b4e..6083965512e8 100644 --- a/include/d3dx10tex.h +++ b/include/d3dx10tex.h @@ -139,6 +139,8 @@ extern "C" { HRESULT WINAPI D3DX10CreateTextureFromMemory(ID3D10Device *device, const void *src_data, SIZE_T src_data_size, D3DX10_IMAGE_LOAD_INFO *loadinfo, ID3DX10ThreadPump *pump, ID3D10Resource **texture, HRESULT *hresult); +HRESULT WINAPI D3DX10CreateShaderResourceViewFromMemory(ID3D10Device *device, const void *src_data, SIZE_T src_data_size, + D3DX10_IMAGE_LOAD_INFO *loadinfo, ID3DX10ThreadPump *pump, ID3D10ShaderResourceView **srv, HRESULT *hresult); HRESULT WINAPI D3DX10FilterTexture(ID3D10Resource *texture, UINT src_level, UINT filter); HRESULT WINAPI D3DX10GetImageInfoFromFileA(const char *src_file, ID3DX10ThreadPump *pump, D3DX10_IMAGE_INFO *info, @@ -168,6 +170,18 @@ HRESULT WINAPI D3DX10CreateTextureFromResourceW(ID3D10Device *device, HMODULE mo D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10Resource **texture, HRESULT *hresult); #define D3DX10CreateTextureFromResource WINELIB_NAME_AW(D3DX10CreateTextureFromResource) +HRESULT WINAPI D3DX10CreateShaderResourceViewFromFileA(ID3D10Device *device, const char *src_file, + D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10ShaderResourceView **srv, HRESULT *hresult); +HRESULT WINAPI D3DX10CreateShaderResourceViewFromFileW(ID3D10Device *device, const WCHAR *src_file, + D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10ShaderResourceView **srv, HRESULT *hresult); +#define D3DX10CreateShaderResourceViewFromFile WINELIB_NAME_AW(D3DX10CreateShaderResourceViewFromFile) + +HRESULT WINAPI D3DX10CreateShaderResourceViewFromResourceA(ID3D10Device *device, HMODULE module, const char *resource, + D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10ShaderResourceView **srv, HRESULT *hresult); +HRESULT WINAPI D3DX10CreateShaderResourceViewFromResourceW(ID3D10Device *device, HMODULE module, const WCHAR *resource, + D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10ShaderResourceView **srv, HRESULT *hresult); +#define D3DX10CreateShaderResourceViewFromResource WINELIB_NAME_AW(D3DX10CreateShaderResourceViewFromResource) + HRESULT WINAPI D3DX10LoadTextureFromTexture(ID3D10Resource *src_texture, D3DX10_TEXTURE_LOAD_INFO *load_info, ID3D10Resource *dst_texture); From b613302c4e3604acedfde106461caa9284d6631b Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Mon, 11 Nov 2024 06:13:21 -0500 Subject: [PATCH 0952/2542] d3dx10: Add stubs for D3DX10SaveTextureTo{Memory,File}(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/d3dx10_43.spec | 6 +- dlls/d3dx10_43/tests/d3dx10.c | 1591 +++++++++++++++++++++++++++++++++ dlls/d3dx10_43/texture.c | 22 + include/d3dx10tex.h | 7 + 4 files changed, 1623 insertions(+), 3 deletions(-) diff --git a/dlls/d3dx10_43/d3dx10_43.spec b/dlls/d3dx10_43/d3dx10_43.spec index 68e6c64cdf5a..fb753183f9ce 100644 --- a/dlls/d3dx10_43/d3dx10_43.spec +++ b/dlls/d3dx10_43/d3dx10_43.spec @@ -61,9 +61,9 @@ @ stub D3DX10PreprocessShaderFromResourceA(long str str ptr ptr ptr ptr ptr) @ stub D3DX10PreprocessShaderFromResourceW(long wstr wstr ptr ptr ptr ptr ptr) @ stub D3DX10SHProjectCubeMap(long ptr ptr ptr ptr) -@ stub D3DX10SaveTextureToFileA(ptr ptr str) -@ stub D3DX10SaveTextureToFileW(ptr ptr wstr) -@ stub D3DX10SaveTextureToMemory(ptr ptr ptr long) +@ stdcall D3DX10SaveTextureToFileA(ptr ptr str) +@ stdcall D3DX10SaveTextureToFileW(ptr ptr wstr) +@ stdcall D3DX10SaveTextureToMemory(ptr ptr ptr long) @ stdcall D3DX10UnsetAllDeviceObjects(ptr) @ stdcall D3DXBoxBoundProbe(ptr ptr ptr ptr) d3dx9_36.D3DXBoxBoundProbe @ stdcall D3DXColorAdjustContrast(ptr ptr float) d3dx9_36.D3DXColorAdjustContrast diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index a0cd0da242d2..61e0c5553be4 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -46,6 +46,7 @@ #define DDSCAPS_ALPHA 0x00000002 #define DDS_CAPS_COMPLEX 0x00000008 #define DDS_CAPS_TEXTURE 0x00001000 +#define DDSCAPS_MIPMAP 0x00400000 /* dds_header.caps2 */ #define DDS_CAPS2_VOLUME 0x00200000 @@ -7456,6 +7457,1595 @@ static void test_D3DX10FilterTexture(void) ok(!ID3D10Device_Release(device), "Unexpected refcount.\n"); } +static HRESULT d3d10_create_texture_1d(ID3D10Device *device, uint32_t width, uint32_t mip_levels, uint32_t array_size, + DXGI_FORMAT format, D3D10_USAGE usage, uint32_t bind_flags, uint32_t cpu_access_flags, uint32_t misc_flags, + ID3D10Texture1D **tex) +{ + const D3D10_TEXTURE1D_DESC desc = { width, mip_levels, array_size, format, usage, bind_flags, cpu_access_flags, + misc_flags }; + + return ID3D10Device_CreateTexture1D(device, &desc, NULL, tex); +} + +static HRESULT d3d10_create_texture_2d(ID3D10Device *device, uint32_t width, uint32_t height, uint32_t mip_levels, + uint32_t array_size, DXGI_FORMAT format, uint32_t sample_count, uint32_t sample_quality, D3D10_USAGE usage, + uint32_t bind_flags, uint32_t cpu_access_flags, uint32_t misc_flags, ID3D10Texture2D **tex) +{ + const D3D10_TEXTURE2D_DESC desc = { width, height, mip_levels, array_size, format, { sample_count, sample_quality }, + usage, bind_flags, cpu_access_flags, misc_flags }; + + return ID3D10Device_CreateTexture2D(device, &desc, NULL, tex); +} + +static HRESULT d3d10_create_texture_3d(ID3D10Device *device, uint32_t width, uint32_t height, uint32_t depth, + uint32_t mip_levels, DXGI_FORMAT format, D3D10_USAGE usage, uint32_t bind_flags, uint32_t cpu_access_flags, + uint32_t misc_flags, ID3D10Texture3D **tex) +{ + const D3D10_TEXTURE3D_DESC desc = { width, height, depth, mip_levels, format, usage, bind_flags, cpu_access_flags, + misc_flags }; + + return ID3D10Device_CreateTexture3D(device, &desc, NULL, tex); +} + +enum texture_type +{ + TEXTURE_2D, + TEXTURE_2D_ARRAY, + TEXTURE_3D, + TEXTURE_CUBE, + TEXTURE_1D, + TEXTURE_1D_ARRAY, + TEXTURE_TYPE_COUNT, +}; + +static void test_save_texture_to_dds(ID3D10Device *device) +{ + struct dds_expected + { + struct dds_header header; + struct dds_header_dxt10 dxt10; + BOOL todo; + }; + static const struct + { + DXGI_FORMAT format; + struct dds_expected dds_expected[TEXTURE_TYPE_COUNT]; + } save_tests[] = + { + { DXGI_FORMAT_R8G8B8A8_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0xff, 0xff00, 0xff0000, 0xff000000 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0xff, 0xff00, 0xff0000, 0xff000000 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0xff, 0xff00, 0xff0000, 0xff000000 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R10G10B10A2_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x3ff00000, 0xffc00, 0x3ff, 0xc0000000 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R10G10B10A2_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x3ff00000, 0xffc00, 0x3ff, 0xc0000000 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x3ff00000, 0xffc00, 0x3ff, 0xc0000000 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R10G10B10A2_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R10G10B10A2_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R16G16B16A16_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x24, 64, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16B16A16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 64, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x24, 64, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x24, 64, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16B16A16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16B16A16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R16G16_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_RGB, 0, 32, 0xffff, 0xffff0000, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_RGB, 0, 32, 0xffff, 0xffff0000, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_RGB, 0, 32, 0xffff, 0xffff0000, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_A8_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, + { 32, DDS_PF_ALPHA_ONLY, 0, 8, 0, 0, 0, 0xff }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 8, 8, 4, { 0 }, + { 32, DDS_PF_ALPHA_ONLY, 0, 8, 0, 0, 0, 0xff }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, + { 32, DDS_PF_ALPHA_ONLY, 0, 8, 0, 0, 0, 0xff }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 8, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 8, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + /* 5. */ + { DXGI_FORMAT_R16_FLOAT, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x6f, 16, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x6f, 16, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x6f, 16, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R16G16_FLOAT, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x70, 32, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x70, 32, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x70, 32, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R16G16B16A16_FLOAT, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x71, 64, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16B16A16_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 64, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x71, 64, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x71, 64, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16B16A16_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16B16A16_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R32_FLOAT, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x72, 32, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x72, 32, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x72, 32, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R32G32_FLOAT, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x73, 64, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 64, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x73, 64, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x73, 64, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + /* 10. */ + { DXGI_FORMAT_R32G32B32A32_FLOAT, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 128, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x74, 128, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 128, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32B32A32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 128, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x74, 128, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 128, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x74, 128, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 128, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32B32A32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 128, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32B32A32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_G8R8_G8B8_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('G','R','G','B'), 16, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_G8R8_G8B8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('G','R','G','B'), 16, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('G','R','G','B'), 16, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_G8R8_G8B8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_G8R8_G8B8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R8G8_B8G8_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('R','G','B','G'), 16, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_B8G8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('R','G','B','G'), 16, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('R','G','B','G'), 16, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_B8G8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_B8G8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_BC1_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 4, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC1_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 4, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 4, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_BC2_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','3'), 4, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC2_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','3'), 4, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','3'), 4, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + } + }, + /* 15. */ + { DXGI_FORMAT_BC3_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','5'), 8, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC3_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','5'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','5'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_BC4_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','U'), 8, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC4_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','U'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','U'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_BC4_SNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','S'), 8, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC4_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','S'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','S'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_BC5_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('A','T','I','2'), 8, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC5_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('A','T','I','2'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('A','T','I','2'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_BC5_SNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','5','S'), 8, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC5_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','5','S'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','5','S'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + } + }, + /* 20. */ + { DXGI_FORMAT_R16G16B16A16_SNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x6e, 64, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16B16A16_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 64, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x6e, 64, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x6e, 64, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16B16A16_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16B16A16_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R8_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 8, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_R8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_R8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 8, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 8, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R8_SNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 8, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_R8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_R8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 8, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 8, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + /* 25. */ + { DXGI_FORMAT_R8G8_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_R8G8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_R8G8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R16_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_R16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_R16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R32G32B32_FLOAT, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 96, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32B32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 96, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32B32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 96, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_R32G32B32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 96, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_R32G32B32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 96, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32B32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 96, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32B32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_BC1_UNORM_SRGB, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC1_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC1_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_BC1_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_BC1_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_BC2_UNORM_SRGB, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC2_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC2_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_BC2_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_BC2_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + .todo = TRUE + }, + } + }, + /* 30. */ + { DXGI_FORMAT_BC3_UNORM_SRGB, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC3_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC3_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_BC3_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_BC3_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R8G8B8A8_SNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_R8G8B8A8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_R8G8B8A8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R8G8_SNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_R8G8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_R8G8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R16G16_SNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_R16G16_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_R16G16_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + }; + D3DX10_IMAGE_INFO img_info; + ID3D10Resource *tex; + ID3D10Blob *buffer; + unsigned int i, j; + HRESULT hr; + struct + { + DWORD magic; + struct dds_header header; + struct dds_header_dxt10 dxt10; + } *dds; + + for (i = 0; i < ARRAY_SIZE(save_tests); ++i) + { + if (!strcmp(winetest_platform, "wine") && (save_tests[i].format == DXGI_FORMAT_G8R8_G8B8_UNORM + || save_tests[i].format == DXGI_FORMAT_R8G8_B8G8_UNORM)) + { + skip("Skipping unsupported texture format on Wine.\n"); + continue; + } + + winetest_push_context("Test %u", i); + for (j = 0; j < TEXTURE_TYPE_COUNT; ++j) + { + const struct dds_expected *dds_expected = &save_tests[i].dds_expected[j]; + + /* Cannot create a block compressed 1D texture. */ + if (is_block_compressed(save_tests[i].format) && (j >= TEXTURE_1D)) + continue; + + switch (j) + { + case TEXTURE_1D: + hr = d3d10_create_texture_1d(device, 8, 4, 1, save_tests[i].format, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, 0, (ID3D10Texture1D **)&tex); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + break; + + case TEXTURE_1D_ARRAY: + hr = d3d10_create_texture_1d(device, 8, 4, 2, save_tests[i].format, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, 0, (ID3D10Texture1D **)&tex); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + break; + + case TEXTURE_2D: + hr = d3d10_create_texture_2d(device, 8, 8, 4, 1, save_tests[i].format, 1, 0, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, 0, (ID3D10Texture2D **)&tex); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + break; + + case TEXTURE_2D_ARRAY: + hr = d3d10_create_texture_2d(device, 8, 8, 4, 2, save_tests[i].format, 1, 0, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, 0, (ID3D10Texture2D **)&tex); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + break; + + case TEXTURE_3D: + hr = d3d10_create_texture_3d(device, 8, 8, 8, 4, save_tests[i].format, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, 0, (ID3D10Texture3D **)&tex); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + break; + + case TEXTURE_CUBE: + hr = d3d10_create_texture_2d(device, 8, 8, 4, 6, save_tests[i].format, 1, 0, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, D3D10_RESOURCE_MISC_TEXTURECUBE, (ID3D10Texture2D **)&tex); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + break; + } + + if (FAILED(hr)) + continue; + + winetest_push_context("Texture type %u", j); + hr = D3DX10SaveTextureToMemory(tex, D3DX10_IFF_DDS, &buffer, 0); + todo_wine_if(dds_expected->todo) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + dds = ID3D10Blob_GetBufferPointer(buffer); + + hr = D3DX10GetImageInfoFromMemory(ID3D10Blob_GetBufferPointer(buffer), ID3D10Blob_GetBufferSize(buffer), NULL, + &img_info, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(!memcmp(&dds_expected->header, &dds->header, sizeof(dds->header)), "Header mismatch.\n"); + if (dds->header.pixel_format.fourcc == MAKEFOURCC('D','X','1','0')) + ok(!memcmp(&dds_expected->dxt10, &dds->dxt10, sizeof(dds->dxt10)), "DXT10 header mismatch.\n"); + switch (j) + { + case TEXTURE_1D: + check_image_info_values(&img_info, 8, 1, 1, 1, 4, 0, save_tests[i].format, + D3D10_RESOURCE_DIMENSION_TEXTURE1D, D3DX10_IFF_DDS, FALSE); + break; + + case TEXTURE_1D_ARRAY: + check_image_info_values(&img_info, 8, 1, 1, 2, 4, 0, save_tests[i].format, + D3D10_RESOURCE_DIMENSION_TEXTURE1D, D3DX10_IFF_DDS, FALSE); + break; + + case TEXTURE_2D: + check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, save_tests[i].format, + D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS, FALSE); + break; + + case TEXTURE_2D_ARRAY: + check_image_info_values(&img_info, 8, 8, 1, 2, 4, 0, save_tests[i].format, + D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS, FALSE); + break; + + case TEXTURE_3D: + check_image_info_values(&img_info, 8, 8, 8, 1, 4, 0, save_tests[i].format, + D3D10_RESOURCE_DIMENSION_TEXTURE3D, D3DX10_IFF_DDS, FALSE); + break; + + case TEXTURE_CUBE: + check_image_info_values(&img_info, 8, 8, 1, 6, 4, D3D10_RESOURCE_MISC_TEXTURECUBE, + save_tests[i].format, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS, FALSE); + break; + } + + ID3D10Blob_Release(buffer); + } + ID3D10Resource_Release(tex); + winetest_pop_context(); + } + winetest_pop_context(); + } +} + +static void test_save_texture(void) +{ + D3D10_SUBRESOURCE_DATA sub_resource_data[4] = { 0 }; + D3D10_TEXTURE2D_DESC tex_2d_desc; + D3DX10_IMAGE_INFO img_info; + ID3D10Texture2D *tex_2d; + uint8_t tmp_buf[1024]; + ID3D10Device *device; + ID3D10Blob *buffer; + HRESULT hr; + + device = create_device(); + if (!device) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + CoInitialize(NULL); + + test_save_texture_to_dds(device); + + set_d3d10_2d_texture_desc(&tex_2d_desc, 8, 8, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, 0); + memset(tmp_buf, 0, sizeof(tmp_buf)); + memcpy(tmp_buf, bc1_to_bc3_8_8_decompressed, sizeof(bc1_to_bc3_8_8_decompressed)); + init_subresource_data(sub_resource_data, (const void *)tmp_buf, tex_2d_desc.Width, tex_2d_desc.Height, 1, + tex_2d_desc.MipLevels, tex_2d_desc.ArraySize, tex_2d_desc.Format); + + hr = ID3D10Device_CreateTexture2D(device, &tex_2d_desc, sub_resource_data, &tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = D3DX10SaveTextureToMemory((ID3D10Resource *)tex_2d, D3DX10_IFF_DDS, &buffer, 0); + todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + hr = D3DX10GetImageInfoFromMemory(ID3D10Blob_GetBufferPointer(buffer), ID3D10Blob_GetBufferSize(buffer), NULL, + &img_info, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, + D3DX10_IFF_DDS, FALSE); + + ID3D10Blob_Release(buffer); + } + + ID3D10Texture2D_Release(tex_2d); + + CoUninitialize(); + + ok(!ID3D10Device_Release(device), "Unexpected refcount.\n"); +} + START_TEST(d3dx10) { HMODULE wined3d; @@ -7482,6 +9072,7 @@ START_TEST(d3dx10) test_get_image_info(); test_create_texture(); test_create_shader_resource_view(); + test_save_texture(); test_font(); test_sprite(); test_create_effect_from_memory(); diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index fb380ae4198f..047904bede4d 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -1603,3 +1603,25 @@ HRESULT WINAPI D3DX10FilterTexture(ID3D10Resource *texture, UINT src_level, UINT return D3DX10LoadTextureFromTexture(texture, &load_info, texture); } + +HRESULT WINAPI D3DX10SaveTextureToFileW(ID3D10Resource *texture, D3DX10_IMAGE_FILE_FORMAT format, const WCHAR *filename) +{ + FIXME("texture %p, format %u, filename %s stub!\n", texture, format, debugstr_w(filename)); + + return E_NOTIMPL; +} + +HRESULT WINAPI D3DX10SaveTextureToFileA(ID3D10Resource *texture, D3DX10_IMAGE_FILE_FORMAT format, const char *filename) +{ + FIXME("texture %p, format %u, filename %s stub!\n", texture, format, debugstr_a(filename)); + + return E_NOTIMPL; +} + +HRESULT WINAPI D3DX10SaveTextureToMemory(ID3D10Resource *texture, D3DX10_IMAGE_FILE_FORMAT format, ID3D10Blob **buffer, + UINT flags) +{ + FIXME("texture %p, format %u, buffer %p, flags %#x stub!\n", texture, format, buffer, flags); + + return E_NOTIMPL; +} diff --git a/include/d3dx10tex.h b/include/d3dx10tex.h index 6083965512e8..d62032b61a82 100644 --- a/include/d3dx10tex.h +++ b/include/d3dx10tex.h @@ -185,6 +185,13 @@ HRESULT WINAPI D3DX10CreateShaderResourceViewFromResourceW(ID3D10Device *device, HRESULT WINAPI D3DX10LoadTextureFromTexture(ID3D10Resource *src_texture, D3DX10_TEXTURE_LOAD_INFO *load_info, ID3D10Resource *dst_texture); +HRESULT WINAPI D3DX10SaveTextureToFileA(ID3D10Resource *texture, D3DX10_IMAGE_FILE_FORMAT format, const char *filename); +HRESULT WINAPI D3DX10SaveTextureToFileW(ID3D10Resource *texture, D3DX10_IMAGE_FILE_FORMAT format, const WCHAR *filename); +#define D3DX10SaveTextureToFile WINELIB_NAME_AW(D3DX10SaveTextureToFile) + +HRESULT WINAPI D3DX10SaveTextureToMemory(ID3D10Resource *texture, D3DX10_IMAGE_FILE_FORMAT format, ID3D10Blob **buffer, + UINT flags); + #ifdef __cplusplus } #endif From 31e0f951c12a44c2e43b8e47e3d5460e39bae5f6 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 15 Nov 2024 09:16:47 -0500 Subject: [PATCH 0953/2542] d3dx10: Add partial support for saving to DDS files in D3DX10SaveTextureToMemory(). Add support for saving DDS files with non-DXT10 DDS headers. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 74 ++--------------- dlls/d3dx10_43/texture.c | 100 ++++++++++++++++++++++- dlls/d3dx9_36/d3dx_helpers.c | 145 +++++++++++++++++++++++++--------- dlls/d3dx9_36/d3dx_helpers.h | 5 +- dlls/d3dx9_36/texture.c | 18 +---- 5 files changed, 218 insertions(+), 124 deletions(-) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 61e0c5553be4..ce6d3cdd573c 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -7517,7 +7517,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0xff, 0xff00, 0xff0000, 0xff000000 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7531,14 +7530,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0xff, 0xff00, 0xff0000, 0xff000000 }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7561,7 +7558,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x3ff00000, 0xffc00, 0x3ff, 0xc0000000 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7575,14 +7571,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x3ff00000, 0xffc00, 0x3ff, 0xc0000000 }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7605,7 +7599,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_FOURCC, 0x24, 64, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7619,14 +7612,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, 0x24, 64, 0, 0, 0, 0 }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7649,7 +7640,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_RGB, 0, 32, 0xffff, 0xffff0000, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7663,14 +7653,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_RGB, 0, 32, 0xffff, 0xffff0000, 0, 0 }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7693,7 +7681,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_ALPHA_ONLY, 0, 8, 0, 0, 0, 0xff }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7707,14 +7694,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, { 32, DDS_PF_ALPHA_ONLY, 0, 8, 0, 0, 0, 0xff }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 8, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7738,7 +7723,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_FOURCC, 0x6f, 16, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7752,14 +7736,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, 0x6f, 16, 0, 0, 0, 0 }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7782,7 +7764,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_FOURCC, 0x70, 32, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7796,14 +7777,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, 0x70, 32, 0, 0, 0, 0 }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7826,7 +7805,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_FOURCC, 0x71, 64, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7840,14 +7818,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, 0x71, 64, 0, 0, 0, 0 }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7870,7 +7846,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_FOURCC, 0x72, 32, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7884,14 +7859,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, 0x72, 32, 0, 0, 0, 0 }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7914,7 +7887,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_FOURCC, 0x73, 64, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7928,14 +7900,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, 0x73, 64, 0, 0, 0, 0 }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7959,7 +7929,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_FOURCC, 0x74, 128, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 128, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -7973,14 +7942,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 128, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, 0x74, 128, 0, 0, 0, 0 }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 128, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8091,7 +8058,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 4, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8105,14 +8071,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 4, 0, 0, 0, 0 }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, } }, @@ -8121,7 +8085,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','3'), 4, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8135,14 +8098,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','3'), 4, 0, 0, 0, 0 }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, } }, @@ -8152,7 +8113,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','5'), 8, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8166,14 +8126,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','5'), 8, 0, 0, 0, 0 }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, } }, @@ -8182,7 +8140,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','U'), 8, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8196,14 +8153,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','U'), 8, 0, 0, 0, 0 }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, } }, @@ -8212,7 +8167,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','S'), 8, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8226,14 +8180,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','S'), 8, 0, 0, 0, 0 }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, } }, @@ -8242,7 +8194,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_FOURCC, MAKEFOURCC('A','T','I','2'), 8, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8256,14 +8207,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('A','T','I','2'), 8, 0, 0, 0, 0 }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, } }, @@ -8272,7 +8221,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','5','S'), 8, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8286,14 +8234,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','5','S'), 8, 0, 0, 0, 0 }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, } }, @@ -8303,7 +8249,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) { 32, DDS_PF_FOURCC, 0x6e, 64, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8317,14 +8262,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_VOLUME, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, 0x6e, 64, 0, 0, 0, 0 }, DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -9027,17 +8970,14 @@ static void test_save_texture(void) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = D3DX10SaveTextureToMemory((ID3D10Resource *)tex_2d, D3DX10_IFF_DDS, &buffer, 0); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - if (SUCCEEDED(hr)) - { - hr = D3DX10GetImageInfoFromMemory(ID3D10Blob_GetBufferPointer(buffer), ID3D10Blob_GetBufferSize(buffer), NULL, - &img_info, NULL); - ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, - D3DX10_IFF_DDS, FALSE); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - ID3D10Blob_Release(buffer); - } + hr = D3DX10GetImageInfoFromMemory(ID3D10Blob_GetBufferPointer(buffer), ID3D10Blob_GetBufferSize(buffer), NULL, + &img_info, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, + D3DX10_IFF_DDS, FALSE); + ID3D10Blob_Release(buffer); ID3D10Texture2D_Release(tex_2d); diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 047904bede4d..1dfb8989567f 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -1172,6 +1172,7 @@ struct d3d10_texture const struct pixel_format_desc *fmt_desc; D3D10_MAP map_flags; D3D10_BOX texture_box; + BOOL is_cubemap; uint32_t first_layer; uint32_t first_mip_level; @@ -1296,6 +1297,7 @@ static HRESULT d3dx_d3d10_texture_init(ID3D10Resource *tex_rsrc, uint32_t first_ texture->first_mip_level = min((desc.MipLevels - 1), first_mip_level); texture->first_layer = first_layer >= desc.ArraySize ? 0 : first_layer; + texture->is_cubemap = !!(desc.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE); staging_tex_rsrc->texture_dimension = src_tex_rsrc->texture_dimension; staging_tex_rsrc->size = src_tex_rsrc->size; @@ -1621,7 +1623,101 @@ HRESULT WINAPI D3DX10SaveTextureToFileA(ID3D10Resource *texture, D3DX10_IMAGE_FI HRESULT WINAPI D3DX10SaveTextureToMemory(ID3D10Resource *texture, D3DX10_IMAGE_FILE_FORMAT format, ID3D10Blob **buffer, UINT flags) { - FIXME("texture %p, format %u, buffer %p, flags %#x stub!\n", texture, format, buffer, flags); + const struct pixel_format_desc *fmt_desc = NULL; + struct d3d10_texture src_tex = { 0 }; + enum d3dx_resource_type d3dx_rtype; + D3D10_RESOURCE_DIMENSION rsrc_dim; + struct d3dx_image image = { 0 }; + ID3D10Blob *out_buffer; + unsigned int i, j; + HRESULT hr; - return E_NOTIMPL; + TRACE("texture %p, format %u, buffer %p, flags %#x.\n", texture, format, buffer, flags); + + if (!texture || !buffer) + return E_INVALIDARG; + + out_buffer = *buffer = NULL; + if (format != D3DX10_IFF_DDS) + { + FIXME("Saving to file format %u is currently unimplemented.\n", format); + return E_NOTIMPL; + } + + ID3D10Resource_GetType(texture, &rsrc_dim); + switch (rsrc_dim) + { + case D3D10_RESOURCE_DIMENSION_TEXTURE2D: + d3dx_rtype = D3DX_RESOURCE_TYPE_TEXTURE_2D; + break; + + case D3D10_RESOURCE_DIMENSION_TEXTURE3D: + d3dx_rtype = D3DX_RESOURCE_TYPE_TEXTURE_3D; + break; + + default: + FIXME("Currently only 2D and 3D texture saving is supported.\n"); + return E_NOTIMPL; + } + + hr = d3dx_d3d10_texture_init(texture, 0, 0, D3D10_MAP_READ, NULL, &src_tex); + if (FAILED(hr)) + return hr; + + if ((src_tex.texture.layer_count > 1 && !src_tex.is_cubemap) || (src_tex.is_cubemap && src_tex.texture.layer_count > 6)) + { + FIXME("Texture arrays are currently unimplemented.\n"); + hr = E_NOTIMPL; + goto exit; + } + + if (src_tex.is_cubemap) + d3dx_rtype = D3DX_RESOURCE_TYPE_CUBE_TEXTURE; + + hr = d3dx_create_dds_file_blob(src_tex.fmt_desc->format, NULL, d3dx_rtype, &src_tex.texture.size, + src_tex.texture.mip_levels, src_tex.texture.layer_count, TRUE, &out_buffer); + if (FAILED(hr)) + { + FIXME("Failed to create dds file with hr %#lx.\n", hr); + goto exit; + } + + hr = d3dx_image_init(ID3D10Blob_GetBufferPointer(out_buffer), ID3D10Blob_GetBufferSize(out_buffer), &image, 0, + D3DX_IMAGE_SUPPORT_DXT10); + if (FAILED(hr)) + goto exit; + + fmt_desc = get_d3dx_pixel_format_info(image.format); + for (i = 0; i < image.layer_count; ++i) + { + for (j = 0; j < image.mip_levels; ++j) + { + struct d3dx_pixels src_pixels, dst_pixels; + + hr = d3dx_image_get_pixels(&image, i, j, &dst_pixels); + if (FAILED(hr)) + goto exit; + + hr = d3dx_d3d10_texture_map(&src_tex, i, j, &src_pixels); + if (FAILED(hr)) + goto exit; + + hr = d3dx_load_pixels_from_pixels(&dst_pixels, fmt_desc, &src_pixels, src_tex.fmt_desc, D3DX_FILTER_NONE, 0); + d3dx_d3d10_texture_unmap(&src_tex, i, j); + if (FAILED(hr)) + { + WARN("Failed with hr %#lx.\n", hr); + goto exit; + } + } + } + + if (SUCCEEDED(hr)) + *buffer = out_buffer; + +exit: + if (out_buffer && *buffer != out_buffer) + ID3D10Blob_Release(out_buffer); + d3dx_d3d10_texture_release(&src_tex); + return SUCCEEDED(hr) ? S_OK : hr; } diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index 4b5155c74ec4..b06582039744 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -193,28 +193,28 @@ static const struct /* DDS_PF_FOURCC. */ { { 32, DDS_PF_FOURCC, MAKEFOURCC('U','Y','V','Y') }, D3DX_PIXEL_FORMAT_UYVY }, { { 32, DDS_PF_FOURCC, MAKEFOURCC('Y','U','Y','2') }, D3DX_PIXEL_FORMAT_YUY2 }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('R','G','B','G') }, D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('G','R','G','B') }, D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1') }, D3DX_PIXEL_FORMAT_DXT1_UNORM }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','2') }, D3DX_PIXEL_FORMAT_DXT2_UNORM }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','3') }, D3DX_PIXEL_FORMAT_DXT3_UNORM }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','4') }, D3DX_PIXEL_FORMAT_DXT4_UNORM }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','5') }, D3DX_PIXEL_FORMAT_DXT5_UNORM }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','U') }, D3DX_PIXEL_FORMAT_BC4_UNORM }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','S') }, D3DX_PIXEL_FORMAT_BC4_SNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('R','G','B','G'), 16 }, D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('G','R','G','B'), 16 }, D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 4 }, D3DX_PIXEL_FORMAT_DXT1_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','2') }, D3DX_PIXEL_FORMAT_DXT2_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','3'), 4 }, D3DX_PIXEL_FORMAT_DXT3_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','4') }, D3DX_PIXEL_FORMAT_DXT4_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','5'), 8 }, D3DX_PIXEL_FORMAT_DXT5_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','U'), 8 }, D3DX_PIXEL_FORMAT_BC4_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','S'), 8 }, D3DX_PIXEL_FORMAT_BC4_SNORM }, /* ATI2 is treated identically to BC5U in d3dx10+. */ - { { 32, DDS_PF_FOURCC, MAKEFOURCC('A','T','I','2') }, D3DX_PIXEL_FORMAT_BC5_UNORM }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','5','U') }, D3DX_PIXEL_FORMAT_BC5_UNORM }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','5','S') }, D3DX_PIXEL_FORMAT_BC5_SNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('A','T','I','2'), 8 }, D3DX_PIXEL_FORMAT_BC5_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','5','U'), 8 }, D3DX_PIXEL_FORMAT_BC5_UNORM }, + { { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','5','S'), 8 }, D3DX_PIXEL_FORMAT_BC5_SNORM }, /* These aren't actually fourcc values, they're just D3DFMT values. */ - { { 32, DDS_PF_FOURCC, 0x24 }, D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM }, - { { 32, DDS_PF_FOURCC, 0x6e }, D3DX_PIXEL_FORMAT_U16V16W16Q16_SNORM }, - { { 32, DDS_PF_FOURCC, 0x6f }, D3DX_PIXEL_FORMAT_R16_FLOAT }, - { { 32, DDS_PF_FOURCC, 0x70 }, D3DX_PIXEL_FORMAT_R16G16_FLOAT }, - { { 32, DDS_PF_FOURCC, 0x71 }, D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT }, - { { 32, DDS_PF_FOURCC, 0x72 }, D3DX_PIXEL_FORMAT_R32_FLOAT }, - { { 32, DDS_PF_FOURCC, 0x73 }, D3DX_PIXEL_FORMAT_R32G32_FLOAT }, - { { 32, DDS_PF_FOURCC, 0x74 }, D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT }, + { { 32, DDS_PF_FOURCC, 0x24, 64 }, D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM }, + { { 32, DDS_PF_FOURCC, 0x6e, 64 }, D3DX_PIXEL_FORMAT_U16V16W16Q16_SNORM }, + { { 32, DDS_PF_FOURCC, 0x6f, 16 }, D3DX_PIXEL_FORMAT_R16_FLOAT }, + { { 32, DDS_PF_FOURCC, 0x70, 32 }, D3DX_PIXEL_FORMAT_R16G16_FLOAT }, + { { 32, DDS_PF_FOURCC, 0x71, 64 }, D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT }, + { { 32, DDS_PF_FOURCC, 0x72, 32 }, D3DX_PIXEL_FORMAT_R32_FLOAT }, + { { 32, DDS_PF_FOURCC, 0x73, 64 }, D3DX_PIXEL_FORMAT_R32G32_FLOAT }, + { { 32, DDS_PF_FOURCC, 0x74, 128 }, D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT }, /* DDS_PF_RGB. */ { { 32, DDS_PF_RGB, 0, 8, 0xe0, 0x1c, 0x03, 0x00 }, D3DX_PIXEL_FORMAT_B2G3R3_UNORM }, { { 32, DDS_PF_RGB, 0, 16, 0xf800, 0x07e0, 0x001f, 0x0000 }, D3DX_PIXEL_FORMAT_B5G6R5_UNORM }, @@ -479,8 +479,8 @@ uint32_t d3dx_calculate_layer_pixels_size(enum d3dx_pixel_format_id format, uint return layer_size; } -HRESULT d3dx_init_dds_header(struct dds_header *header, enum d3dx_resource_type resource_type, - enum d3dx_pixel_format_id format, const struct volume *size, uint32_t mip_levels) +static HRESULT d3dx_init_dds_header(struct dds_header *header, enum d3dx_resource_type resource_type, + enum d3dx_pixel_format_id format, const struct volume *size, uint32_t mip_levels, BOOL support_dxt10) { HRESULT hr; @@ -488,32 +488,21 @@ HRESULT d3dx_init_dds_header(struct dds_header *header, enum d3dx_resource_type header->signature = MAKEFOURCC('D','D','S',' '); /* The signature is not really part of the DDS header. */ header->size = sizeof(*header) - FIELD_OFFSET(struct dds_header, size); - hr = dds_pixel_format_from_d3dx_pixel_format_id(&header->pixel_format, format); - if (FAILED(hr)) - return hr; - - header->flags = DDS_CAPS | DDS_HEIGHT | DDS_WIDTH | DDS_PIXELFORMAT; + header->flags = DDS_HEIGHT | DDS_WIDTH; header->height = size->height; header->width = size->width; + header->depth = (size->depth > 1) ? size->depth : 0; + header->miplevels = (mip_levels > 1) ? mip_levels : 0; header->caps = DDS_CAPS_TEXTURE; - if (header->pixel_format.flags & DDS_PF_ALPHA || header->pixel_format.flags & DDS_PF_ALPHA_ONLY) - header->caps |= DDSCAPS_ALPHA; - if (header->pixel_format.flags & DDS_PF_INDEXED) - header->caps |= DDSCAPS_PALETTE; if (size->depth > 1) { header->flags |= DDS_DEPTH; - header->depth = size->depth; header->caps2 |= DDS_CAPS2_VOLUME; } if (mip_levels > 1) - { - header->flags |= DDS_MIPMAPCOUNT; - header->caps |= (DDS_CAPS_MIPMAP | DDS_CAPS_COMPLEX); - header->miplevels = mip_levels; - } + header->caps |= DDS_CAPS_MIPMAP; if (resource_type == D3DX_RESOURCE_TYPE_CUBE_TEXTURE) { @@ -521,9 +510,89 @@ HRESULT d3dx_init_dds_header(struct dds_header *header, enum d3dx_resource_type header->caps2 |= (DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES); } + if (support_dxt10) + { + uint32_t row_pitch, slice_pitch; + struct dds_pixel_format pf; + + hr = dds_pixel_format_from_d3dx_pixel_format_id(&pf, format); + if (FAILED(hr)) + return hr; + + if (pf.flags == DDS_PF_BUMPDUDV || pf.flags == DDS_PF_BUMPLUMINANCE) + return E_NOTIMPL; + + header->pixel_format = pf; + hr = d3dx_calculate_pixels_size(format, size->width, size->height, &row_pitch, &slice_pitch); + if (FAILED(hr)) + return hr; + + /* Always sets mip levels and row pitch in header. */ + header->pitch_or_linear_size = row_pitch; + header->miplevels = mip_levels; + if (header->caps2) + header->caps |= DDS_CAPS_COMPLEX; + } + else + { + hr = dds_pixel_format_from_d3dx_pixel_format_id(&header->pixel_format, format); + if (FAILED(hr)) + return hr; + + /* d3dx10+ sets the bpp field for fourCC pixel formats, d3dx9 does not. */ + if (header->pixel_format.flags == DDS_PF_FOURCC) + header->pixel_format.bpp = 0; + + header->flags |= DDS_CAPS | DDS_PIXELFORMAT; + if (header->pixel_format.flags & DDS_PF_ALPHA || header->pixel_format.flags & DDS_PF_ALPHA_ONLY) + header->caps |= DDSCAPS_ALPHA; + if (header->pixel_format.flags & DDS_PF_INDEXED) + header->caps |= DDSCAPS_PALETTE; + if (mip_levels > 1) + { + header->flags |= DDS_MIPMAPCOUNT; + header->caps |= DDS_CAPS_COMPLEX; + } + } + return S_OK; } +HRESULT d3dx_create_dds_file_blob(enum d3dx_pixel_format_id format, const PALETTEENTRY *palette, + enum d3dx_resource_type resource_type, const struct volume *size, uint32_t mip_levels, uint32_t layers, + BOOL support_dxt10, ID3DXBlob **out_blob) +{ + const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(format); + uint32_t header_size, pixels_size; + struct dds_header header; + uint8_t *buf_ptr; + ID3DXBlob *blob; + HRESULT hr; + + *out_blob = blob = NULL; + hr = d3dx_init_dds_header(&header, resource_type, format, size, mip_levels, support_dxt10); + if (FAILED(hr)) + return hr; + + pixels_size = d3dx_calculate_layer_pixels_size(format, size->width, size->height, size->depth, mip_levels) * layers; + header_size = sizeof(header); + if (is_index_format(fmt_desc)) + header_size += DDS_PALETTE_SIZE; + + hr = d3dx_create_blob(header_size + pixels_size, &blob); + if (FAILED(hr)) + return hr; + + buf_ptr = d3dx_blob_get_buffer_pointer(blob); + memcpy(buf_ptr, &header, sizeof(header)); + if (is_index_format(fmt_desc)) + memcpy(buf_ptr + sizeof(header), palette, DDS_PALETTE_SIZE); + + *out_blob = blob; + + return hr; +} + static const GUID *wic_container_guid_from_d3dx_file_format(enum d3dx_image_file_format iff) { switch (iff) @@ -713,7 +782,7 @@ HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct header = d3dx_blob_get_buffer_pointer(blob); pixels = (uint8_t *)d3dx_blob_get_buffer_pointer(blob) + header_size; - hr = d3dx_init_dds_header(header, D3DX_RESOURCE_TYPE_TEXTURE_2D, dst_format, &src_pixels->size, 1); + hr = d3dx_init_dds_header(header, D3DX_RESOURCE_TYPE_TEXTURE_2D, dst_format, &src_pixels->size, 1, FALSE); if (FAILED(hr)) goto exit; if (is_index_format(dst_fmt_desc)) diff --git a/dlls/d3dx9_36/d3dx_helpers.h b/dlls/d3dx9_36/d3dx_helpers.h index 21010ebbf533..798cbccfc410 100644 --- a/dlls/d3dx9_36/d3dx_helpers.h +++ b/dlls/d3dx9_36/d3dx_helpers.h @@ -487,8 +487,9 @@ HRESULT d3dx_calculate_pixels_size(enum d3dx_pixel_format_id format, uint32_t wi uint32_t *pitch, uint32_t *size); uint32_t d3dx_calculate_layer_pixels_size(enum d3dx_pixel_format_id format, uint32_t width, uint32_t height, uint32_t depth, uint32_t mip_levels); -HRESULT d3dx_init_dds_header(struct dds_header *header, enum d3dx_resource_type resource_type, - enum d3dx_pixel_format_id format, const struct volume *size, uint32_t mip_levels); +HRESULT d3dx_create_dds_file_blob(enum d3dx_pixel_format_id format, const PALETTEENTRY *palette, + enum d3dx_resource_type resource_type, const struct volume *size, uint32_t mip_levels, uint32_t layers, + BOOL support_dxt10, ID3DXBlob **out_blob); HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct pixel_format_desc *src_fmt_desc, enum d3dx_image_file_format file_format, enum d3dx_pixel_format_id dst_format, ID3DXBlob **dst_blob); HRESULT d3dx_pixels_init(const void *data, uint32_t row_pitch, uint32_t slice_pitch, diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index a6abc571d196..e0ec927a779f 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -1857,9 +1857,9 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE IDirect3DBaseTexture9 *src_texture, const PALETTEENTRY *src_palette) { const struct pixel_format_desc *fmt_desc = NULL; - uint32_t mip_levels, file_size, i, j; struct d3dx_image image = { 0 }; ID3DXBuffer *buffer = NULL; + uint32_t mip_levels, i, j; D3DRESOURCETYPE type; struct volume size; HRESULT hr; @@ -1964,23 +1964,11 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE if (is_index_format(fmt_desc) && !src_palette) return E_NOTIMPL; - file_size = d3dx_calculate_layer_pixels_size(fmt_desc->format, size.width, size.height, size.depth, mip_levels); - if (type == D3DRTYPE_CUBETEXTURE) - file_size *= 6; - file_size += is_index_format(fmt_desc) ? sizeof(struct dds_header) + DDS_PALETTE_SIZE : sizeof(struct dds_header); - - hr = D3DXCreateBuffer(file_size, &buffer); - if (FAILED(hr)) - return hr; - - hr = d3dx_init_dds_header((struct dds_header *)ID3DXBuffer_GetBufferPointer(buffer), - d3dx_resource_type_from_d3dresourcetype(type), fmt_desc->format, &size, mip_levels); + hr = d3dx_create_dds_file_blob(fmt_desc->format, src_palette, d3dx_resource_type_from_d3dresourcetype(type), + &size, mip_levels, type == D3DRTYPE_CUBETEXTURE ? 6 : 1, FALSE, &buffer); if (FAILED(hr)) goto exit; - if (is_index_format(fmt_desc)) - memcpy((uint8_t *)ID3DXBuffer_GetBufferPointer(buffer) + sizeof(struct dds_header), src_palette, DDS_PALETTE_SIZE); - hr = d3dx_image_init(ID3DXBuffer_GetBufferPointer(buffer), ID3DXBuffer_GetBufferSize(buffer), &image, 0, 0); if (FAILED(hr)) goto exit; From 28bd357f1ac438e13bf17bdeed9bb8529720121c Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 15 Nov 2024 10:07:32 -0500 Subject: [PATCH 0954/2542] d3dx10: Add support for saving DXT10 DDS files in D3DX10SaveTextureToMemory(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 67 --------------- dlls/d3dx10_43/texture.c | 7 -- dlls/d3dx9_36/d3dx_helpers.c | 150 ++++++++++++++++++++++++++++------ 3 files changed, 123 insertions(+), 101 deletions(-) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index ce6d3cdd573c..33798b6c2e9e 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -7523,7 +7523,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0xff, 0xff00, 0xff0000, 0xff000000 }, @@ -7564,7 +7563,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R10G10B10A2_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x3ff00000, 0xffc00, 0x3ff, 0xc0000000 }, @@ -7605,7 +7603,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R16G16B16A16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 64, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, 0x24, 64, 0, 0, 0, 0 }, @@ -7646,7 +7643,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R16G16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, { 32, DDS_PF_RGB, 0, 32, 0xffff, 0xffff0000, 0, 0 }, @@ -7687,7 +7683,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 8, 8, 4, { 0 }, { 32, DDS_PF_ALPHA_ONLY, 0, 8, 0, 0, 0, 0xff }, @@ -7729,7 +7724,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R16_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, 0x6f, 16, 0, 0, 0, 0 }, @@ -7770,7 +7764,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R16G16_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, 0x70, 32, 0, 0, 0, 0 }, @@ -7811,7 +7804,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R16G16B16A16_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 64, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, 0x71, 64, 0, 0, 0, 0 }, @@ -7852,7 +7844,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, 0x72, 32, 0, 0, 0, 0 }, @@ -7893,7 +7884,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R32G32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 64, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, 0x73, 64, 0, 0, 0, 0 }, @@ -7935,7 +7925,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R32G32B32A32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 128, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, 0x74, 128, 0, 0, 0, 0 }, @@ -8064,7 +8053,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_BC1_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 4, 0, 0, 0, 0 }, @@ -8091,7 +8079,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_BC2_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','3'), 4, 0, 0, 0, 0 }, @@ -8119,7 +8106,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_BC3_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','5'), 8, 0, 0, 0, 0 }, @@ -8146,7 +8132,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_BC4_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','U'), 8, 0, 0, 0, 0 }, @@ -8173,7 +8158,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_BC4_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','S'), 8, 0, 0, 0, 0 }, @@ -8200,7 +8184,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_BC5_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('A','T','I','2'), 8, 0, 0, 0, 0 }, @@ -8227,7 +8210,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_BC5_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','5','S'), 8, 0, 0, 0, 0 }, @@ -8255,7 +8237,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R16G16B16A16_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 64, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, 0x6e, 64, 0, 0, 0, 0 }, @@ -8291,14 +8272,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8306,7 +8285,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_VOLUME, 0, 0 }, { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8314,7 +8292,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8338,14 +8315,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 8, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8353,7 +8328,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_VOLUME, 0, 0 }, { DXGI_FORMAT_R8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8361,7 +8335,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, { DXGI_FORMAT_R8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 8, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8385,14 +8358,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 8, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8400,7 +8371,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_VOLUME, 0, 0 }, { DXGI_FORMAT_R8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8408,7 +8378,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, { DXGI_FORMAT_R8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 8, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8433,14 +8402,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R8G8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R8G8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8448,7 +8415,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_VOLUME, 0, 0 }, { DXGI_FORMAT_R8G8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8456,7 +8422,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, { DXGI_FORMAT_R8G8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8480,14 +8445,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8495,7 +8458,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_VOLUME, 0, 0 }, { DXGI_FORMAT_R16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8503,7 +8465,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, { DXGI_FORMAT_R16_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8527,14 +8488,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R32G32B32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 96, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R32G32B32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 96, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8542,7 +8501,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_VOLUME, 0, 0 }, { DXGI_FORMAT_R32G32B32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 96, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8550,7 +8508,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, { DXGI_FORMAT_R32G32B32_FLOAT, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 96, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8574,14 +8531,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_BC1_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_BC1_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8589,7 +8544,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_VOLUME, 0, 0 }, { DXGI_FORMAT_BC1_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8597,7 +8551,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, { DXGI_FORMAT_BC1_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, - .todo = TRUE }, } }, @@ -8607,14 +8560,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_BC2_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_BC2_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8622,7 +8573,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_VOLUME, 0, 0 }, { DXGI_FORMAT_BC2_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8630,7 +8580,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, { DXGI_FORMAT_BC2_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, - .todo = TRUE }, } }, @@ -8641,14 +8590,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_BC3_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_BC3_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8656,7 +8603,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_VOLUME, 0, 0 }, { DXGI_FORMAT_BC3_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8664,7 +8610,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, { DXGI_FORMAT_BC3_UNORM_SRGB, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, - .todo = TRUE }, } }, @@ -8674,14 +8619,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R8G8B8A8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R8G8B8A8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8689,7 +8632,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_VOLUME, 0, 0 }, { DXGI_FORMAT_R8G8B8A8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8697,7 +8639,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, { DXGI_FORMAT_R8G8B8A8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8721,14 +8662,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R8G8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R8G8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8736,7 +8675,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_VOLUME, 0, 0 }, { DXGI_FORMAT_R8G8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8744,7 +8682,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, { DXGI_FORMAT_R8G8_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8768,14 +8705,12 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R16G16_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, }, { DXGI_FORMAT_R16G16_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8783,7 +8718,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_VOLUME, 0, 0 }, { DXGI_FORMAT_R16G16_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, @@ -8791,7 +8725,6 @@ static void test_save_texture_to_dds(ID3D10Device *device) DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 }, { DXGI_FORMAT_R16G16_SNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, - .todo = TRUE }, { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 1dfb8989567f..39fde97fc87a 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -1664,13 +1664,6 @@ HRESULT WINAPI D3DX10SaveTextureToMemory(ID3D10Resource *texture, D3DX10_IMAGE_F if (FAILED(hr)) return hr; - if ((src_tex.texture.layer_count > 1 && !src_tex.is_cubemap) || (src_tex.is_cubemap && src_tex.texture.layer_count > 6)) - { - FIXME("Texture arrays are currently unimplemented.\n"); - hr = E_NOTIMPL; - goto exit; - } - if (src_tex.is_cubemap) d3dx_rtype = D3DX_RESOURCE_TYPE_CUBE_TEXTURE; diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index b06582039744..dd6866d4fde3 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -401,6 +401,55 @@ enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dxgi_format(DXGI_FORMAT form } } +static DXGI_FORMAT dxgi_format_from_d3dx_pixel_format_id(enum d3dx_pixel_format_id format) +{ + switch (format) + { + case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB: return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB; + case D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM: return DXGI_FORMAT_B8G8R8A8_UNORM; + case D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM: return DXGI_FORMAT_B8G8R8X8_UNORM; + case D3DX_PIXEL_FORMAT_B5G6R5_UNORM: return DXGI_FORMAT_B5G6R5_UNORM; + case D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM: return DXGI_FORMAT_B5G5R5A1_UNORM; + case D3DX_PIXEL_FORMAT_B4G4R4A4_UNORM: return DXGI_FORMAT_B4G4R4A4_UNORM; + case D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM: return DXGI_FORMAT_R10G10B10A2_UNORM; + case D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM: return DXGI_FORMAT_R16G16B16A16_UNORM; + case D3DX_PIXEL_FORMAT_R8_UNORM: return DXGI_FORMAT_R8_UNORM; + case D3DX_PIXEL_FORMAT_R8_SNORM: return DXGI_FORMAT_R8_SNORM; + case D3DX_PIXEL_FORMAT_R8G8_UNORM: return DXGI_FORMAT_R8G8_UNORM; + case D3DX_PIXEL_FORMAT_R16_UNORM: return DXGI_FORMAT_R16_UNORM; + case D3DX_PIXEL_FORMAT_R16G16_UNORM: return DXGI_FORMAT_R16G16_UNORM; + case D3DX_PIXEL_FORMAT_A8_UNORM: return DXGI_FORMAT_A8_UNORM; + case D3DX_PIXEL_FORMAT_R16_FLOAT: return DXGI_FORMAT_R16_FLOAT; + case D3DX_PIXEL_FORMAT_R16G16_FLOAT: return DXGI_FORMAT_R16G16_FLOAT; + case D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT: return DXGI_FORMAT_R16G16B16A16_FLOAT; + case D3DX_PIXEL_FORMAT_R32_FLOAT: return DXGI_FORMAT_R32_FLOAT; + case D3DX_PIXEL_FORMAT_R32G32_FLOAT: return DXGI_FORMAT_R32G32_FLOAT; + case D3DX_PIXEL_FORMAT_R32G32B32_FLOAT: return DXGI_FORMAT_R32G32B32_FLOAT; + case D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT: return DXGI_FORMAT_R32G32B32A32_FLOAT; + case D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM: return DXGI_FORMAT_G8R8_G8B8_UNORM; + case D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM: return DXGI_FORMAT_R8G8_B8G8_UNORM; + case D3DX_PIXEL_FORMAT_BC1_UNORM: return DXGI_FORMAT_BC1_UNORM; + case D3DX_PIXEL_FORMAT_BC1_UNORM_SRGB: return DXGI_FORMAT_BC1_UNORM_SRGB; + case D3DX_PIXEL_FORMAT_BC2_UNORM: return DXGI_FORMAT_BC2_UNORM; + case D3DX_PIXEL_FORMAT_BC2_UNORM_SRGB: return DXGI_FORMAT_BC2_UNORM_SRGB; + case D3DX_PIXEL_FORMAT_BC3_UNORM: return DXGI_FORMAT_BC3_UNORM; + case D3DX_PIXEL_FORMAT_BC3_UNORM_SRGB: return DXGI_FORMAT_BC3_UNORM_SRGB; + case D3DX_PIXEL_FORMAT_BC4_UNORM: return DXGI_FORMAT_BC4_UNORM; + case D3DX_PIXEL_FORMAT_BC4_SNORM: return DXGI_FORMAT_BC4_SNORM; + case D3DX_PIXEL_FORMAT_BC5_UNORM: return DXGI_FORMAT_BC5_UNORM; + case D3DX_PIXEL_FORMAT_BC5_SNORM: return DXGI_FORMAT_BC5_SNORM; + case D3DX_PIXEL_FORMAT_R8G8B8A8_SNORM: return DXGI_FORMAT_R8G8B8A8_SNORM; + case D3DX_PIXEL_FORMAT_R8G8_SNORM: return DXGI_FORMAT_R8G8_SNORM; + case D3DX_PIXEL_FORMAT_R16G16_SNORM: return DXGI_FORMAT_R16G16_SNORM; + case D3DX_PIXEL_FORMAT_R16G16B16A16_SNORM: return DXGI_FORMAT_R16G16B16A16_SNORM; + + default: + FIXME("Unhandled format %#x.\n", format); + return DXGI_FORMAT_UNKNOWN; + } +} + void d3dx_get_next_mip_level_size(struct volume *size) { size->width = max(size->width / 2, 1); @@ -479,8 +528,58 @@ uint32_t d3dx_calculate_layer_pixels_size(enum d3dx_pixel_format_id format, uint return layer_size; } +/* These defines match D3D10/D3D11 values. */ +#define DDS_RESOURCE_MISC_TEXTURECUBE 0x04 +#define DDS_RESOURCE_DIMENSION_UNKNOWN 0 +#define DDS_RESOURCE_DIMENSION_TEXTURE1D 2 +#define DDS_RESOURCE_DIMENSION_TEXTURE2D 3 +#define DDS_RESOURCE_DIMENSION_TEXTURE3D 4 +struct dds_header_dxt10 +{ + uint32_t dxgi_format; + uint32_t resource_dimension; + uint32_t misc_flags; + uint32_t array_size; + uint32_t misc_flags2; +}; + +static void set_dds_header_dxt10(struct dds_header_dxt10 *dxt10, uint32_t dxgi_format, uint32_t resource_dimension, + uint32_t misc_flags, uint32_t array_size, uint32_t misc_flags2) +{ + dxt10->dxgi_format = dxgi_format; + dxt10->resource_dimension = resource_dimension; + dxt10->misc_flags = misc_flags; + dxt10->array_size = array_size; + dxt10->misc_flags2 = misc_flags2; +} + +static uint32_t dxt10_resource_dimension_from_d3dx_resource_type(enum d3dx_resource_type resource_type) +{ + switch (resource_type) + { + case D3DX_RESOURCE_TYPE_TEXTURE_1D: return DDS_RESOURCE_DIMENSION_TEXTURE1D; + case D3DX_RESOURCE_TYPE_TEXTURE_2D: return DDS_RESOURCE_DIMENSION_TEXTURE2D; + case D3DX_RESOURCE_TYPE_TEXTURE_3D: return DDS_RESOURCE_DIMENSION_TEXTURE3D; + case D3DX_RESOURCE_TYPE_CUBE_TEXTURE: return DDS_RESOURCE_DIMENSION_TEXTURE2D; + + default: + break; + } + + FIXME("Unhandled d3dx resource type %u.\n", resource_type); + return DDS_RESOURCE_DIMENSION_UNKNOWN; +} + +static BOOL has_extended_header(const struct dds_header *header) +{ + return (header->pixel_format.flags & DDS_PF_FOURCC) && + (header->pixel_format.fourcc == MAKEFOURCC('D', 'X', '1', '0')); +} + +static const struct dds_pixel_format dxt10_pf = { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0') }; static HRESULT d3dx_init_dds_header(struct dds_header *header, enum d3dx_resource_type resource_type, - enum d3dx_pixel_format_id format, const struct volume *size, uint32_t mip_levels, BOOL support_dxt10) + enum d3dx_pixel_format_id format, const struct volume *size, uint32_t mip_levels, uint32_t layer_count, + BOOL support_dxt10) { HRESULT hr; @@ -516,11 +615,15 @@ static HRESULT d3dx_init_dds_header(struct dds_header *header, enum d3dx_resourc struct dds_pixel_format pf; hr = dds_pixel_format_from_d3dx_pixel_format_id(&pf, format); - if (FAILED(hr)) - return hr; + if (FAILED(hr) || pf.flags == DDS_PF_BUMPDUDV || pf.flags == DDS_PF_BUMPLUMINANCE + || (resource_type != D3DX_RESOURCE_TYPE_CUBE_TEXTURE && layer_count > 1) + || (resource_type == D3DX_RESOURCE_TYPE_CUBE_TEXTURE && layer_count > 6)) + { + if (dxgi_format_from_d3dx_pixel_format_id(format) == DXGI_FORMAT_UNKNOWN) + return E_NOTIMPL; - if (pf.flags == DDS_PF_BUMPDUDV || pf.flags == DDS_PF_BUMPLUMINANCE) - return E_NOTIMPL; + pf = dxt10_pf; + } header->pixel_format = pf; hr = d3dx_calculate_pixels_size(format, size->width, size->height, &row_pitch, &slice_pitch); @@ -564,13 +667,14 @@ HRESULT d3dx_create_dds_file_blob(enum d3dx_pixel_format_id format, const PALETT { const struct pixel_format_desc *fmt_desc = get_d3dx_pixel_format_info(format); uint32_t header_size, pixels_size; + struct dds_header_dxt10 dxt10; struct dds_header header; uint8_t *buf_ptr; ID3DXBlob *blob; HRESULT hr; *out_blob = blob = NULL; - hr = d3dx_init_dds_header(&header, resource_type, format, size, mip_levels, support_dxt10); + hr = d3dx_init_dds_header(&header, resource_type, format, size, mip_levels, layers, support_dxt10); if (FAILED(hr)) return hr; @@ -578,6 +682,16 @@ HRESULT d3dx_create_dds_file_blob(enum d3dx_pixel_format_id format, const PALETT header_size = sizeof(header); if (is_index_format(fmt_desc)) header_size += DDS_PALETTE_SIZE; + if (has_extended_header(&header)) + { + const BOOL is_cubemap = resource_type == D3DX_RESOURCE_TYPE_CUBE_TEXTURE; + + set_dds_header_dxt10(&dxt10, dxgi_format_from_d3dx_pixel_format_id(format), + dxt10_resource_dimension_from_d3dx_resource_type(resource_type), + is_cubemap ? DDS_RESOURCE_MISC_TEXTURECUBE : 0, + is_cubemap ? layers / 6 : layers, 0); + header_size += sizeof(dxt10); + } hr = d3dx_create_blob(header_size + pixels_size, &blob); if (FAILED(hr)) @@ -587,6 +701,8 @@ HRESULT d3dx_create_dds_file_blob(enum d3dx_pixel_format_id format, const PALETT memcpy(buf_ptr, &header, sizeof(header)); if (is_index_format(fmt_desc)) memcpy(buf_ptr + sizeof(header), palette, DDS_PALETTE_SIZE); + else if (has_extended_header(&header)) + memcpy(buf_ptr + sizeof(header), &dxt10, sizeof(dxt10)); *out_blob = blob; @@ -782,7 +898,7 @@ HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct header = d3dx_blob_get_buffer_pointer(blob); pixels = (uint8_t *)d3dx_blob_get_buffer_pointer(blob) + header_size; - hr = d3dx_init_dds_header(header, D3DX_RESOURCE_TYPE_TEXTURE_2D, dst_format, &src_pixels->size, 1, FALSE); + hr = d3dx_init_dds_header(header, D3DX_RESOURCE_TYPE_TEXTURE_2D, dst_format, &src_pixels->size, 1, 1, FALSE); if (FAILED(hr)) goto exit; if (is_index_format(dst_fmt_desc)) @@ -946,20 +1062,6 @@ static BOOL d3dx_get_image_file_format_from_file_signature(const void *src_data, return FALSE; } -/* These defines match D3D10/D3D11 values. */ -#define DDS_RESOURCE_MISC_TEXTURECUBE 0x04 -#define DDS_RESOURCE_DIMENSION_TEXTURE1D 2 -#define DDS_RESOURCE_DIMENSION_TEXTURE2D 3 -#define DDS_RESOURCE_DIMENSION_TEXTURE3D 4 -struct dds_header_dxt10 -{ - uint32_t dxgi_format; - uint32_t resource_dimension; - uint32_t misc_flags; - uint32_t array_size; - uint32_t misc_flags2; -}; - static enum d3dx_resource_type dxt10_resource_dimension_to_d3dx_resource_type(uint32_t resource_dimension) { switch (resource_dimension) @@ -976,12 +1078,6 @@ static enum d3dx_resource_type dxt10_resource_dimension_to_d3dx_resource_type(ui return D3DX_RESOURCE_TYPE_UNKNOWN; } -static BOOL has_extended_header(const struct dds_header *header) -{ - return (header->pixel_format.flags & DDS_PF_FOURCC) && - (header->pixel_format.fourcc == MAKEFOURCC('D', 'X', '1', '0')); -} - static HRESULT d3dx_initialize_image_from_dds(const void *src_data, uint32_t src_data_size, struct d3dx_image *image, uint32_t starting_mip_level, uint32_t flags) { From 9f66076e0bd3ce237de1109aa27ee2128262449b Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Mon, 9 Dec 2024 07:55:42 -0500 Subject: [PATCH 0955/2542] d3dx10/tests: Add tests for saving textures to non-DDS file formats. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 177 ++++++++++++++++++++++++++++++++++ 1 file changed, 177 insertions(+) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 33798b6c2e9e..ce0ca6725f8e 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -18,6 +18,7 @@ #define COBJMACROS #include "initguid.h" +#include "wincodec.h" #include "d3d10_1.h" #include "d3dx10.h" #include "wine/wined3d.h" @@ -8870,6 +8871,181 @@ static void test_save_texture_to_dds(ID3D10Device *device) } } +static void check_image_wic_pixel_format(IWICImagingFactory *factory, const void *data, unsigned int size, + const GUID *expected_fmt, BOOL todo) +{ + IWICBitmapFrameDecode *frame = NULL; + IWICBitmapDecoder *decoder = NULL; + IWICStream *stream = NULL; + HRESULT hr; + GUID fmt; + + hr = IWICImagingFactory_CreateStream(factory, &stream); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IWICStream_InitializeFromMemory(stream, (BYTE *)data, size); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IWICImagingFactory_CreateDecoderFromStream(factory, (IStream *)stream, NULL, 0, &decoder); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &fmt); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine_if(todo) ok(IsEqualGUID(expected_fmt, &fmt), "Unexpected WIC format %s.\n", debugstr_guid(&fmt)); + + IWICBitmapFrameDecode_Release(frame); + IWICBitmapDecoder_Release(decoder); + IWICStream_Release(stream); +} + +static void test_save_texture_to_iffs(ID3D10Device *device) +{ + static const enum D3DX10_IMAGE_FILE_FORMAT test_iffs[] = { D3DX10_IFF_BMP, D3DX10_IFF_JPG, D3DX10_IFF_PNG, + D3DX10_IFF_TIFF, D3DX10_IFF_GIF, D3DX10_IFF_WMP }; + static const char *test_iff_str[] = { "D3DX10_IFF_BMP", "D3DX10_IFF_JPG", "D3DX10_IFF_PNG", + "D3DX10_IFF_TIFF", "D3DX10_IFF_GIF", "D3DX10_IFF_WMP" }; + struct wic_expected + { + const GUID *fmt; + BOOL todo; + }; + static const struct + { + DXGI_FORMAT format; + BOOL supported; + struct wic_expected wic_expected[ARRAY_SIZE(test_iffs)]; + } save_tests[] = + { + { DXGI_FORMAT_R8G8B8A8_UNORM, TRUE, + { { &GUID_WICPixelFormat32bppBGR, FALSE }, + { &GUID_WICPixelFormat24bppBGR, FALSE }, + { &GUID_WICPixelFormat32bppBGRA, FALSE }, + { &GUID_WICPixelFormat32bppBGRA, FALSE }, + { NULL }, + { &GUID_WICPixelFormat32bppBGRA, FALSE }, + }, + }, + { DXGI_FORMAT_R16G16B16A16_FLOAT, TRUE, + { { &GUID_WICPixelFormat64bppRGBAFixedPoint, TRUE }, + { &GUID_WICPixelFormat24bppBGR, FALSE }, + { &GUID_WICPixelFormat64bppRGBA, FALSE }, + { &GUID_WICPixelFormat64bppRGBA, FALSE }, + { NULL }, + { &GUID_WICPixelFormat64bppRGBAHalf, FALSE }, + }, + }, + { DXGI_FORMAT_R32G32B32A32_FLOAT, TRUE, + { { &GUID_WICPixelFormat64bppRGBAFixedPoint, TRUE }, + { &GUID_WICPixelFormat24bppBGR, FALSE }, + { &GUID_WICPixelFormat64bppRGBA, FALSE }, + { &GUID_WICPixelFormat64bppRGBA, FALSE }, + { NULL }, + { &GUID_WICPixelFormat128bppRGBAFloat, FALSE }, + }, + }, + { DXGI_FORMAT_R16_UNORM, TRUE, + { { &GUID_WICPixelFormat64bppRGBAFixedPoint, TRUE }, + { &GUID_WICPixelFormat8bppGray, FALSE }, + { &GUID_WICPixelFormat16bppGray, FALSE }, + { &GUID_WICPixelFormat16bppGray, FALSE }, + { NULL }, + { &GUID_WICPixelFormat16bppGrayFixedPoint, FALSE }, + }, + }, + { DXGI_FORMAT_R10G10B10A2_UNORM, FALSE }, + { DXGI_FORMAT_R16G16B16A16_UNORM, FALSE }, + { DXGI_FORMAT_R16G16_UNORM, FALSE }, + { DXGI_FORMAT_A8_UNORM, FALSE }, + { DXGI_FORMAT_R16_FLOAT, FALSE }, + { DXGI_FORMAT_R16G16_FLOAT, FALSE }, + { DXGI_FORMAT_R32_FLOAT, FALSE }, + { DXGI_FORMAT_R32G32_FLOAT, FALSE }, + { DXGI_FORMAT_G8R8_G8B8_UNORM, FALSE }, + { DXGI_FORMAT_R8G8_B8G8_UNORM, FALSE }, + { DXGI_FORMAT_BC1_UNORM, FALSE }, + { DXGI_FORMAT_BC2_UNORM, FALSE }, + { DXGI_FORMAT_BC3_UNORM, FALSE }, + { DXGI_FORMAT_BC4_UNORM, FALSE }, + { DXGI_FORMAT_BC4_SNORM, FALSE }, + { DXGI_FORMAT_BC5_UNORM, FALSE }, + { DXGI_FORMAT_BC5_SNORM, FALSE }, + { DXGI_FORMAT_R16G16B16A16_SNORM, FALSE }, + { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, FALSE }, + { DXGI_FORMAT_R8_UNORM, FALSE }, + { DXGI_FORMAT_R8_SNORM, FALSE }, + { DXGI_FORMAT_R8G8_UNORM, FALSE }, + { DXGI_FORMAT_R32G32B32_FLOAT, FALSE }, + { DXGI_FORMAT_BC1_UNORM_SRGB, FALSE }, + { DXGI_FORMAT_BC2_UNORM_SRGB, FALSE }, + { DXGI_FORMAT_BC3_UNORM_SRGB, FALSE }, + { DXGI_FORMAT_R8G8B8A8_SNORM, FALSE }, + { DXGI_FORMAT_R8G8_SNORM, FALSE }, + { DXGI_FORMAT_R16G16_SNORM, FALSE }, + }; + IWICImagingFactory *factory = NULL; + D3DX10_IMAGE_INFO img_info; + ID3D10Resource *tex; + ID3D10Blob *buffer; + unsigned int i, j; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, + &IID_IWICImagingFactory, (void **)&factory); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + for (i = 0; i < ARRAY_SIZE(save_tests); ++i) + { + if (!strcmp(winetest_platform, "wine") && (save_tests[i].format == DXGI_FORMAT_G8R8_G8B8_UNORM + || save_tests[i].format == DXGI_FORMAT_R8G8_B8G8_UNORM)) + { + skip("Skipping unsupported format on Wine.\n"); + continue; + } + + hr = d3d10_create_texture_2d(device, 8, 8, 4, 1, save_tests[i].format, 1, 0, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, 0, (ID3D10Texture2D **)&tex); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + continue; + + winetest_push_context("Test %u", i); + for (j = 0; j < ARRAY_SIZE(test_iffs); ++j) + { + const HRESULT expected_hr = save_tests[i].supported ? S_OK : E_FAIL; + + winetest_push_context("Image format %s", test_iff_str[j]); + hr = D3DX10SaveTextureToMemory(tex, test_iffs[j], &buffer, 0); + + /* GIF saving is never supported, regardless of texture format. */ + if (test_iffs[j] == D3DX10_IFF_GIF) + todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + else + todo_wine ok(hr == expected_hr, "Unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + check_image_wic_pixel_format(factory, ID3D10Blob_GetBufferPointer(buffer), ID3D10Blob_GetBufferSize(buffer), + save_tests[i].wic_expected[j].fmt, save_tests[i].wic_expected[j].todo); + + hr = D3DX10GetImageInfoFromMemory(ID3D10Blob_GetBufferPointer(buffer), ID3D10Blob_GetBufferSize(buffer), NULL, + &img_info, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + check_image_info_values(&img_info, 8, 8, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, + D3D10_RESOURCE_DIMENSION_TEXTURE2D, test_iffs[j], FALSE); + ID3D10Blob_Release(buffer); + } + winetest_pop_context(); + } + + ID3D10Resource_Release(tex); + winetest_pop_context(); + } + IWICImagingFactory_Release(factory); +} + static void test_save_texture(void) { D3D10_SUBRESOURCE_DATA sub_resource_data[4] = { 0 }; @@ -8891,6 +9067,7 @@ static void test_save_texture(void) CoInitialize(NULL); test_save_texture_to_dds(device); + test_save_texture_to_iffs(device); set_d3d10_2d_texture_desc(&tex_2d_desc, 8, 8, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0); From 16ce8c7b003a5da30cb86887d78964c752aeafff Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Mon, 9 Dec 2024 08:14:10 -0500 Subject: [PATCH 0956/2542] windowscodecs: Add support for encoding 16bpp grayscale TIFF images. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/windowscodecs/libtiff.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/windowscodecs/libtiff.c b/dlls/windowscodecs/libtiff.c index 16701a258f93..b53428e325cd 100644 --- a/dlls/windowscodecs/libtiff.c +++ b/dlls/windowscodecs/libtiff.c @@ -1115,6 +1115,7 @@ static const struct tiff_encode_format formats[] = { {&GUID_WICPixelFormatBlackWhite, 1, 1, 1, 1, 0, 0, 0}, {&GUID_WICPixelFormat4bppGray, 1, 4, 1, 4, 0, 0, 0}, {&GUID_WICPixelFormat8bppGray, 1, 8, 1, 8, 0, 0, 0}, + {&GUID_WICPixelFormat16bppGray, 1, 16, 1, 16, 0, 0, 0}, {&GUID_WICPixelFormat32bppBGRA, 2, 8, 4, 32, 1, 2, 1}, {&GUID_WICPixelFormat32bppPBGRA, 2, 8, 4, 32, 1, 1, 1}, {&GUID_WICPixelFormat48bppRGB, 2, 16, 3, 48, 0, 0, 0}, From 1add76f5a5babfef2e11fa7c73fa72681369366e Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Tue, 10 Dec 2024 13:04:04 -0500 Subject: [PATCH 0957/2542] d3dx10: Add support for saving textures to non-DDS file formats. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 4 +- dlls/d3dx10_43/texture.c | 109 +++++++++++++++++++++++++++++++++- dlls/d3dx9_36/d3dx_helpers.c | 2 + 3 files changed, 111 insertions(+), 4 deletions(-) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index ce0ca6725f8e..4a95d3c3cb78 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -9021,9 +9021,9 @@ static void test_save_texture_to_iffs(ID3D10Device *device) /* GIF saving is never supported, regardless of texture format. */ if (test_iffs[j] == D3DX10_IFF_GIF) - todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); else - todo_wine ok(hr == expected_hr, "Unexpected hr %#lx.\n", hr); + todo_wine_if(test_iffs[j] == D3DX10_IFF_WMP) ok(hr == expected_hr, "Unexpected hr %#lx.\n", hr); if (SUCCEEDED(hr)) { check_image_wic_pixel_format(factory, ID3D10Blob_GetBufferPointer(buffer), ID3D10Blob_GetBufferSize(buffer), diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 39fde97fc87a..144dfe5e1f30 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -17,6 +17,7 @@ */ #include "wine/debug.h" +#include "assert.h" #define COBJMACROS @@ -1620,6 +1621,83 @@ HRESULT WINAPI D3DX10SaveTextureToFileA(ID3D10Resource *texture, D3DX10_IMAGE_FI return E_NOTIMPL; } +static HRESULT d3dx10_get_save_format_for_file_format(D3DX10_IMAGE_FILE_FORMAT iff, enum d3dx_pixel_format_id src_fmt, + enum d3dx_pixel_format_id *save_fmt) +{ + *save_fmt = D3DX_PIXEL_FORMAT_COUNT; + switch (iff) + { + case D3DX10_IFF_JPG: + switch (src_fmt) + { + case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM: + case D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT: + case D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT: + *save_fmt = D3DX_PIXEL_FORMAT_B8G8R8_UNORM; + break; + + case D3DX_PIXEL_FORMAT_R16_UNORM: + *save_fmt = D3DX_PIXEL_FORMAT_L8_UNORM; + break; + + default: + return E_FAIL; + } + break; + + case D3DX10_IFF_PNG: + case D3DX10_IFF_TIFF: + switch (src_fmt) + { + case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM: + *save_fmt = D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM; + break; + + case D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT: + case D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT: + *save_fmt = D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM; + break; + + case D3DX_PIXEL_FORMAT_R16_UNORM: + *save_fmt = D3DX_PIXEL_FORMAT_L16_UNORM; + break; + + default: + return E_FAIL; + } + break; + + case D3DX10_IFF_BMP: + switch (src_fmt) + { + case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM: + *save_fmt = D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM; + break; + + case D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT: + case D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT: + case D3DX_PIXEL_FORMAT_R16_UNORM: + FIXME("Encoding of BMP files to WICPixelFormat64bppRGBAFixedPoint unimplemented, using default instead.\n"); + *save_fmt = D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM; + break; + + default: + return E_FAIL; + } + break; + + case D3DX10_IFF_WMP: + FIXME("Saving to WMP is currently unimplemented.\n"); + return E_NOTIMPL; + + default: + assert(0); + break; + } + + return S_OK; +} + HRESULT WINAPI D3DX10SaveTextureToMemory(ID3D10Resource *texture, D3DX10_IMAGE_FILE_FORMAT format, ID3D10Blob **buffer, UINT flags) { @@ -1634,11 +1712,11 @@ HRESULT WINAPI D3DX10SaveTextureToMemory(ID3D10Resource *texture, D3DX10_IMAGE_F TRACE("texture %p, format %u, buffer %p, flags %#x.\n", texture, format, buffer, flags); - if (!texture || !buffer) + if (!texture || !buffer || format == D3DX10_IFF_GIF) return E_INVALIDARG; out_buffer = *buffer = NULL; - if (format != D3DX10_IFF_DDS) + if (format == D3DX10_IFF_WMP) { FIXME("Saving to file format %u is currently unimplemented.\n", format); return E_NOTIMPL; @@ -1660,10 +1738,37 @@ HRESULT WINAPI D3DX10SaveTextureToMemory(ID3D10Resource *texture, D3DX10_IMAGE_F return E_NOTIMPL; } + if (format != D3DX10_IFF_DDS && rsrc_dim != D3D10_RESOURCE_DIMENSION_TEXTURE2D) + return E_INVALIDARG; + hr = d3dx_d3d10_texture_init(texture, 0, 0, D3D10_MAP_READ, NULL, &src_tex); if (FAILED(hr)) return hr; + if (format != D3DX10_IFF_DDS) + { + enum d3dx_pixel_format_id dst_format; + struct d3dx_pixels src_pixels; + + hr = d3dx10_get_save_format_for_file_format(format, src_tex.fmt_desc->format, &dst_format); + if (FAILED(hr)) + goto exit; + + hr = d3dx_d3d10_texture_map(&src_tex, 0, 0, &src_pixels); + if (FAILED(hr)) + goto exit; + + hr = d3dx_save_pixels_to_memory(&src_pixels, src_tex.fmt_desc, (enum d3dx_image_file_format)format, dst_format, + &out_buffer); + d3dx_d3d10_texture_unmap(&src_tex, 0, 0); + if (SUCCEEDED(hr)) + *buffer = out_buffer; + else + WARN("Failed with hr %#lx.\n", hr); + + goto exit; + } + if (src_tex.is_cubemap) d3dx_rtype = D3DX_RESOURCE_TYPE_CUBE_TEXTURE; diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index dd6866d4fde3..b2727ae7d8fc 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -121,6 +121,7 @@ static const struct { &GUID_WICPixelFormat1bppIndexed, D3DX_PIXEL_FORMAT_P8_UINT }, { &GUID_WICPixelFormat4bppIndexed, D3DX_PIXEL_FORMAT_P8_UINT }, { &GUID_WICPixelFormat8bppGray, D3DX_PIXEL_FORMAT_L8_UNORM }, + { &GUID_WICPixelFormat16bppGray, D3DX_PIXEL_FORMAT_L16_UNORM }, { &GUID_WICPixelFormat16bppBGR555, D3DX_PIXEL_FORMAT_B5G5R5X1_UNORM }, { &GUID_WICPixelFormat16bppBGR565, D3DX_PIXEL_FORMAT_B5G6R5_UNORM }, { &GUID_WICPixelFormat24bppBGR, D3DX_PIXEL_FORMAT_B8G8R8_UNORM }, @@ -929,6 +930,7 @@ HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const struct break; } + case D3DX_IMAGE_FILE_FORMAT_TIFF: case D3DX_IMAGE_FILE_FORMAT_DIB: case D3DX_IMAGE_FILE_FORMAT_BMP: case D3DX_IMAGE_FILE_FORMAT_PNG: From 2369ffb23e1ac8cd59aee8f821db6b82af0ae7f7 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Tue, 21 May 2024 10:26:13 -0400 Subject: [PATCH 0958/2542] d3dx11_42: Don't share source with d3dx11_43. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx11_42/Makefile.in | 7 ++-- dlls/d3dx11_42/d3dx11_42.spec | 40 ++++++++++----------- dlls/d3dx11_42/d3dx11_42_main.c | 34 ++++++++++++++++++ dlls/d3dx11_43/Makefile.in | 2 +- dlls/d3dx11_43/{main.c => d3dx11_43_main.c} | 0 5 files changed, 57 insertions(+), 26 deletions(-) create mode 100644 dlls/d3dx11_42/d3dx11_42_main.c rename dlls/d3dx11_43/{main.c => d3dx11_43_main.c} (100%) diff --git a/dlls/d3dx11_42/Makefile.in b/dlls/d3dx11_42/Makefile.in index 985fc1c59c27..c833ce178184 100644 --- a/dlls/d3dx11_42/Makefile.in +++ b/dlls/d3dx11_42/Makefile.in @@ -1,13 +1,10 @@ EXTRADEFS = -DD3DX11_SDK_VERSION=42 MODULE = d3dx11_42.dll IMPORTLIB = d3dx11_42 -IMPORTS = d3dcompiler -PARENTSRC = ../d3dx11_43 +IMPORTS = d3dcompiler d3dx11 EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ - async.c \ - main.c \ - texture.c \ + d3dx11_42_main.c \ version.rc diff --git a/dlls/d3dx11_42/d3dx11_42.spec b/dlls/d3dx11_42/d3dx11_42.spec index 2d93b8d760ab..2d125ea119f9 100644 --- a/dlls/d3dx11_42/d3dx11_42.spec +++ b/dlls/d3dx11_42/d3dx11_42.spec @@ -1,44 +1,44 @@ @ stdcall D3DX11CheckVersion(long long) -@ stdcall D3DX11CompileFromFileA(str ptr ptr str str long long ptr ptr ptr ptr) -@ stdcall D3DX11CompileFromFileW(wstr ptr ptr str str long long ptr ptr ptr ptr) -@ stdcall D3DX11CompileFromMemory(ptr long str ptr ptr str str long long ptr ptr ptr ptr) +@ stdcall -import D3DX11CompileFromFileA(str ptr ptr str str long long ptr ptr ptr ptr) +@ stdcall -import D3DX11CompileFromFileW(wstr ptr ptr str str long long ptr ptr ptr ptr) +@ stdcall -import D3DX11CompileFromMemory(ptr long str ptr ptr str str long long ptr ptr ptr ptr) @ stub D3DX11CompileFromResourceA @ stub D3DX11CompileFromResourceW @ stub D3DX11ComputeNormalMap @ stub D3DX11CreateAsyncCompilerProcessor -@ stdcall D3DX11CreateAsyncFileLoaderA(str ptr) -@ stdcall D3DX11CreateAsyncFileLoaderW(wstr ptr) -@ stdcall D3DX11CreateAsyncMemoryLoader(ptr long ptr) -@ stdcall D3DX11CreateAsyncResourceLoaderA(long str ptr) -@ stdcall D3DX11CreateAsyncResourceLoaderW(long wstr ptr) +@ stdcall -import D3DX11CreateAsyncFileLoaderA(str ptr) +@ stdcall -import D3DX11CreateAsyncFileLoaderW(wstr ptr) +@ stdcall -import D3DX11CreateAsyncMemoryLoader(ptr long ptr) +@ stdcall -import D3DX11CreateAsyncResourceLoaderA(long str ptr) +@ stdcall -import D3DX11CreateAsyncResourceLoaderW(long wstr ptr) @ stub D3DX11CreateAsyncShaderPreprocessProcessor @ stub D3DX11CreateAsyncShaderResourceViewProcessor @ stub D3DX11CreateAsyncTextureInfoProcessor @ stub D3DX11CreateAsyncTextureProcessor @ stub D3DX11CreateShaderResourceViewFromFileA @ stub D3DX11CreateShaderResourceViewFromFileW -@ stdcall D3DX11CreateShaderResourceViewFromMemory(ptr ptr long ptr ptr ptr ptr) +@ stdcall -import D3DX11CreateShaderResourceViewFromMemory(ptr ptr long ptr ptr ptr ptr) @ stub D3DX11CreateShaderResourceViewFromResourceA @ stub D3DX11CreateShaderResourceViewFromResourceW -@ stdcall D3DX11CreateTextureFromFileA(ptr str ptr ptr ptr ptr) -@ stdcall D3DX11CreateTextureFromFileW(ptr wstr ptr ptr ptr ptr) -@ stdcall D3DX11CreateTextureFromMemory(ptr ptr long ptr ptr ptr ptr) +@ stdcall -import D3DX11CreateTextureFromFileA(ptr str ptr ptr ptr ptr) +@ stdcall -import D3DX11CreateTextureFromFileW(ptr wstr ptr ptr ptr ptr) +@ stdcall -import D3DX11CreateTextureFromMemory(ptr ptr long ptr ptr ptr ptr) @ stub D3DX11CreateTextureFromResourceA @ stub D3DX11CreateTextureFromResourceW @ stub D3DX11CreateThreadPump -@ stdcall D3DX11FilterTexture(ptr ptr long long) -@ stdcall D3DX11GetImageInfoFromFileA(str ptr ptr ptr) -@ stdcall D3DX11GetImageInfoFromFileW(wstr ptr ptr ptr) -@ stdcall D3DX11GetImageInfoFromMemory(ptr long ptr ptr ptr) +@ stdcall -import D3DX11FilterTexture(ptr ptr long long) +@ stdcall -import D3DX11GetImageInfoFromFileA(str ptr ptr ptr) +@ stdcall -import D3DX11GetImageInfoFromFileW(wstr ptr ptr ptr) +@ stdcall -import D3DX11GetImageInfoFromMemory(ptr long ptr ptr ptr) @ stub D3DX11GetImageInfoFromResourceA @ stub D3DX11GetImageInfoFromResourceW -@ stdcall D3DX11LoadTextureFromTexture(ptr ptr ptr ptr) +@ stdcall -import D3DX11LoadTextureFromTexture(ptr ptr ptr ptr) @ stub D3DX11PreprocessShaderFromFileA @ stub D3DX11PreprocessShaderFromFileW @ stub D3DX11PreprocessShaderFromMemory @ stub D3DX11PreprocessShaderFromResourceA @ stub D3DX11PreprocessShaderFromResourceW @ stub D3DX11SHProjectCubeMap -@ stdcall D3DX11SaveTextureToFileA(ptr ptr long str) -@ stdcall D3DX11SaveTextureToFileW(ptr ptr long wstr) -@ stdcall D3DX11SaveTextureToMemory(ptr ptr long ptr long) +@ stdcall -import D3DX11SaveTextureToFileA(ptr ptr long str) +@ stdcall -import D3DX11SaveTextureToFileW(ptr ptr long wstr) +@ stdcall -import D3DX11SaveTextureToMemory(ptr ptr long ptr long) diff --git a/dlls/d3dx11_42/d3dx11_42_main.c b/dlls/d3dx11_42/d3dx11_42_main.c new file mode 100644 index 000000000000..2ac4f8837992 --- /dev/null +++ b/dlls/d3dx11_42/d3dx11_42_main.c @@ -0,0 +1,34 @@ +/* + * Copyright 2024 Connor McAdams for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#include "d3dx11.h" +#include "d3dx11core.h" +#include "d3dx11tex.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(d3dx); + +BOOL WINAPI D3DX11CheckVersion(UINT d3d_sdk_ver, UINT d3dx_sdk_ver) +{ + TRACE("d3d_sdk_ver %u, d3dx_sdk_ver %u.\n", d3d_sdk_ver, d3dx_sdk_ver); + + return d3d_sdk_ver == D3D11_SDK_VERSION && d3dx_sdk_ver == D3DX11_SDK_VERSION; +} + diff --git a/dlls/d3dx11_43/Makefile.in b/dlls/d3dx11_43/Makefile.in index 762987a89adc..a44fafb1541a 100644 --- a/dlls/d3dx11_43/Makefile.in +++ b/dlls/d3dx11_43/Makefile.in @@ -7,6 +7,6 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ async.c \ - main.c \ + d3dx11_43_main.c \ texture.c \ version.rc diff --git a/dlls/d3dx11_43/main.c b/dlls/d3dx11_43/d3dx11_43_main.c similarity index 100% rename from dlls/d3dx11_43/main.c rename to dlls/d3dx11_43/d3dx11_43_main.c From 41991613f258ee79aa1eac16e92fe26bccb8677b Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 28 Aug 2024 09:21:11 -0400 Subject: [PATCH 0959/2542] d3dx11/tests: Add a helper function for checking image info structure values. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx11_43/tests/d3dx11.c | 210 ++++++++++++++-------------------- 1 file changed, 84 insertions(+), 126 deletions(-) diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index 16c0f0bc03e1..e2fe0b72bc35 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -21,6 +21,7 @@ #include "d3d11.h" #include "d3dx11.h" #include "wine/test.h" +#include #ifndef MAKEFOURCC #define MAKEFOURCC(ch0, ch1, ch2, ch3) \ @@ -249,6 +250,47 @@ static const unsigned char noimage[4] = 0x11,0x22,0x33,0x44 }; +#define check_image_info_values(info, width, height, depth, array_size, mip_levels, misc_flags, format, resource_dimension, \ + image_file_format, wine_todo) \ + check_image_info_values_(__LINE__, info, width, height, depth, array_size, mip_levels, misc_flags, format, resource_dimension, \ + image_file_format, wine_todo) +static inline void check_image_info_values_(uint32_t line, const D3DX11_IMAGE_INFO *info, uint32_t width, + uint32_t height, uint32_t depth, uint32_t array_size, uint32_t mip_levels, uint32_t misc_flags, + DXGI_FORMAT format, D3D11_RESOURCE_DIMENSION resource_dimension, D3DX11_IMAGE_FILE_FORMAT image_file_format, + BOOL wine_todo) +{ + const D3DX11_IMAGE_INFO expected_info = { width, height, depth, array_size, mip_levels, misc_flags, format, + resource_dimension, image_file_format }; + BOOL matched; + + matched = !memcmp(&expected_info, info, sizeof(*info)); + todo_wine_if(wine_todo) ok_(__FILE__, line)(matched, "Got unexpected image info values.\n"); + if (matched) + return; + + todo_wine_if(wine_todo && info->Width != width) + ok_(__FILE__, line)(info->Width == width, "Expected width %u, got %u.\n", width, info->Width); + todo_wine_if(wine_todo && info->Height != height) + ok_(__FILE__, line)(info->Height == height, "Expected height %u, got %u.\n", height, info->Height); + todo_wine_if(wine_todo && info->Depth != depth) + ok_(__FILE__, line)(info->Depth == depth, "Expected depth %u, got %u.\n", depth, info->Depth); + todo_wine_if(wine_todo && info->ArraySize != array_size) + ok_(__FILE__, line)(info->ArraySize == array_size, "Expected array_size %u, got %u.\n", array_size, + info->ArraySize); + todo_wine_if(wine_todo && info->MipLevels != mip_levels) + ok_(__FILE__, line)(info->MipLevels == mip_levels, "Expected mip_levels %u, got %u.\n", mip_levels, + info->MipLevels); + todo_wine_if(wine_todo && info->MiscFlags != misc_flags) + ok_(__FILE__, line)(info->MiscFlags == misc_flags, "Expected misc_flags %u, got %u.\n", misc_flags, + info->MiscFlags); + ok_(__FILE__, line)(info->Format == format, "Expected texture format %d, got %d.\n", format, info->Format); + todo_wine_if(wine_todo && info->ResourceDimension != resource_dimension) + ok_(__FILE__, line)(info->ResourceDimension == resource_dimension, "Expected resource_dimension %d, got %d.\n", + resource_dimension, info->ResourceDimension); + ok_(__FILE__, line)(info->ImageFileFormat == image_file_format, "Expected image_file_format %d, got %d.\n", + image_file_format, info->ImageFileFormat); +} + static WCHAR temp_dir[MAX_PATH]; static BOOL create_file(const WCHAR *filename, const char *data, unsigned int size, WCHAR *out_path) @@ -780,183 +822,99 @@ static void test_D3DX11GetImageInfoFromMemory(void) ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); /* test BMP support */ + memset(&info, 0, sizeof(info)); hr = D3DX11GetImageInfoFromMemory(bmp_1bpp, sizeof(bmp_1bpp), NULL, &info, NULL); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - ok(info.Width == 1, "Unexpected width %u.\n", info.Width); - ok(info.Height == 1, "Unexpected height %u.\n", info.Height); - ok(info.Depth == 1, "Unexpected depth %u.\n", info.Depth); - ok(info.ArraySize == 1, "Unexpected array size %u.\n", info.ArraySize); - ok(info.MipLevels == 1, "Unexpected miplevels %u\n", info.MipLevels); - ok(info.MiscFlags == 0, "Unexpected misc flags %#x\n", info.MiscFlags); - ok(info.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Unexpected format %#x.\n", info.Format); - ok(info.ResourceDimension == D3D11_RESOURCE_DIMENSION_TEXTURE2D, "Unexpected resource type %#x.\n", info.ResourceDimension); - ok(info.ImageFileFormat == D3DX11_IFF_BMP, "Unexpected image file format %#x.\n", info.ImageFileFormat); + check_image_info_values(&info, 1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_BMP, FALSE); hr = D3DX11GetImageInfoFromMemory(bmp_2bpp, sizeof(bmp_2bpp), NULL, &info, NULL); ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + memset(&info, 0, sizeof(info)); hr = D3DX11GetImageInfoFromMemory(bmp_4bpp, sizeof(bmp_4bpp), NULL, &info, NULL); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - ok(info.Width == 1, "Unexpected width %u.\n", info.Width); - ok(info.Height == 1, "Unexpected height %u.\n", info.Height); - ok(info.Depth == 1, "Unexpected depth %u.\n", info.Depth); - ok(info.ArraySize == 1, "Unexpected array size %u.\n", info.ArraySize); - ok(info.MipLevels == 1, "Unexpected miplevels %u\n", info.MipLevels); - ok(info.MiscFlags == 0, "Unexpected misc flags %#x\n", info.MiscFlags); - ok(info.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Unexpected format %#x.\n", info.Format); - ok(info.ResourceDimension == D3D11_RESOURCE_DIMENSION_TEXTURE2D, "Unexpected resource type %#x.\n", info.ResourceDimension); - ok(info.ImageFileFormat == D3DX11_IFF_BMP, "Unexpected image file format %#x.\n", info.ImageFileFormat); + check_image_info_values(&info, 1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_BMP, FALSE); + memset(&info, 0, sizeof(info)); hr = D3DX11GetImageInfoFromMemory(bmp_8bpp, sizeof(bmp_8bpp), NULL, &info, NULL); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - ok(info.Width == 1, "Unexpected width %u.\n", info.Width); - ok(info.Height == 1, "Unexpected height %u.\n", info.Height); - ok(info.Depth == 1, "Unexpected depth %u.\n", info.Depth); - ok(info.ArraySize == 1, "Unexpected array size %u.\n", info.ArraySize); - ok(info.MipLevels == 1, "Unexpected miplevels %u\n", info.MipLevels); - ok(info.MiscFlags == 0, "Unexpected misc flags %#x\n", info.MiscFlags); - ok(info.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Unexpected format %#x.\n", info.Format); - ok(info.ResourceDimension == D3D11_RESOURCE_DIMENSION_TEXTURE2D, "Unexpected resource type %#x.\n", info.ResourceDimension); - ok(info.ImageFileFormat == D3DX11_IFF_BMP, "Unexpected image file format %#x.\n", info.ImageFileFormat); + check_image_info_values(&info, 1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_BMP, FALSE); + memset(&info, 0, sizeof(info)); hr = D3DX11GetImageInfoFromMemory(bmp_32bpp_xrgb, sizeof(bmp_32bpp_xrgb), NULL, &info, NULL); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - ok(info.Width == 2, "Unexpected width %u.\n", info.Width); - ok(info.Height == 2, "Unexpected height %u.\n", info.Height); - ok(info.Depth == 1, "Unexpected depth %u.\n", info.Depth); - ok(info.ArraySize == 1, "Unexpected array size %u.\n", info.ArraySize); - ok(info.MipLevels == 1, "Unexpected miplevels %u\n", info.MipLevels); - ok(info.MiscFlags == 0, "Unexpected misc flags %#x\n", info.MiscFlags); - ok(info.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Unexpected format %#x.\n", info.Format); - ok(info.ResourceDimension == D3D11_RESOURCE_DIMENSION_TEXTURE2D, "Unexpected resource type %#x.\n", info.ResourceDimension); - ok(info.ImageFileFormat == D3DX11_IFF_BMP, "Unexpected image file format %#x.\n", info.ImageFileFormat); + check_image_info_values(&info, 2, 2, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_BMP, FALSE); + memset(&info, 0, sizeof(info)); hr = D3DX11GetImageInfoFromMemory(bmp_32bpp_argb, sizeof(bmp_32bpp_argb), NULL, &info, NULL); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - ok(info.Width == 2, "Unexpected width %u.\n", info.Width); - ok(info.Height == 2, "Unexpected height %u.\n", info.Height); - ok(info.Depth == 1, "Unexpected depth %u.\n", info.Depth); - ok(info.ArraySize == 1, "Unexpected array size %u.\n", info.ArraySize); - ok(info.MipLevels == 1, "Unexpected miplevels %u\n", info.MipLevels); - ok(info.MiscFlags == 0, "Unexpected misc flags %#x\n", info.MiscFlags); - ok(info.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Unexpected format %#x.\n", info.Format); - ok(info.ResourceDimension == D3D11_RESOURCE_DIMENSION_TEXTURE2D, "Unexpected resource type %#x.\n", info.ResourceDimension); - ok(info.ImageFileFormat == D3DX11_IFF_BMP, "Unexpected image file format %#x.\n", info.ImageFileFormat); + check_image_info_values(&info, 2, 2, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_BMP, FALSE); /* Grayscale PNG */ + memset(&info, 0, sizeof(info)); hr = D3DX11GetImageInfoFromMemory(png_grayscale, sizeof(png_grayscale), NULL, &info, NULL); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - ok(info.Width == 1, "Unexpected width %u.\n", info.Width); - ok(info.Height == 1, "Unexpected height %u.\n", info.Height); - ok(info.Depth == 1, "Unexpected depth %u.\n", info.Depth); - ok(info.ArraySize == 1, "Unexpected array size %u.\n", info.ArraySize); - ok(info.MipLevels == 1, "Unexpected miplevels %u\n", info.MipLevels); - ok(info.MiscFlags == 0, "Unexpected misc flags %#x\n", info.MiscFlags); - ok(info.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Unexpected format %#x.\n", info.Format); - ok(info.ResourceDimension == D3D11_RESOURCE_DIMENSION_TEXTURE2D, "Unexpected resource type %#x.\n", info.ResourceDimension); - ok(info.ImageFileFormat == D3DX11_IFF_PNG, "Unexpected image file format %#x.\n", info.ImageFileFormat); + check_image_info_values(&info, 1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_PNG, FALSE); /* test DDS support */ + memset(&info, 0, sizeof(info)); hr = D3DX11GetImageInfoFromMemory(dds_24bit, sizeof(dds_24bit), NULL, &info, NULL); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - ok(info.Width == 2, "Unexpected width %u.\n", info.Width); - ok(info.Height == 2, "Unexpected height %u.\n", info.Height); - ok(info.Depth == 1, "Unexpected depth %u.\n", info.Depth); - ok(info.ArraySize == 1, "Unexpected array size %u.\n", info.ArraySize); - ok(info.MipLevels == 2, "Unexpected miplevels %u\n", info.MipLevels); - ok(info.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Unexpected format %#x.\n", info.Format); - ok(info.ResourceDimension == D3D11_RESOURCE_DIMENSION_TEXTURE2D, "Unexpected resource type %#x.\n", info.ResourceDimension); - ok(info.ImageFileFormat == D3DX11_IFF_DDS, "Unexpected image file format %#x.\n", info.ImageFileFormat); + check_image_info_values(&info, 2, 2, 1, 1, 2, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_DDS, FALSE); + memset(&info, 0, sizeof(info)); hr = D3DX11GetImageInfoFromMemory(dds_24bit, sizeof(dds_24bit) - 1, NULL, &info, NULL); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - ok(info.Width == 2, "Unexpected width %u.\n", info.Width); - ok(info.Height == 2, "Unexpected height %u.\n", info.Height); - ok(info.Depth == 1, "Unexpected depth %u.\n", info.Depth); - ok(info.ArraySize == 1, "Unexpected array size %u.\n", info.ArraySize); - ok(info.MipLevels == 2, "Unexpected miplevels %u\n", info.MipLevels); - ok(info.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Unexpected format %#x.\n", info.Format); - ok(info.ResourceDimension == D3D11_RESOURCE_DIMENSION_TEXTURE2D, "Unexpected resource type %#x.\n", info.ResourceDimension); - ok(info.ImageFileFormat == D3DX11_IFF_DDS, "Unexpected image file format %#x.\n", info.ImageFileFormat); + check_image_info_values(&info, 2, 2, 1, 1, 2, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_DDS, FALSE); + memset(&info, 0, sizeof(info)); hr = D3DX11GetImageInfoFromMemory(dds_16bit, sizeof(dds_16bit), NULL, &info, NULL); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - ok(info.Width == 2, "Unexpected width %u.\n", info.Width); - ok(info.Height == 2, "Unexpected height %u.\n", info.Height); - ok(info.Depth == 1, "Unexpected depth %u.\n", info.Depth); - ok(info.ArraySize == 1, "Unexpected array size %u.\n", info.ArraySize); - ok(info.MipLevels == 1, "Unexpected miplevels %u\n", info.MipLevels); - ok(info.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Unexpected format %#x.\n", info.Format); - ok(info.ResourceDimension == D3D11_RESOURCE_DIMENSION_TEXTURE2D, "Unexpected resource type %#x.\n", info.ResourceDimension); - ok(info.ImageFileFormat == D3DX11_IFF_DDS, "Unexpected image file format %#x.\n", info.ImageFileFormat); + check_image_info_values(&info, 2, 2, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_DDS, FALSE); memset(&info, 0, sizeof(info)); hr = D3DX11GetImageInfoFromMemory(dds_16bit, sizeof(dds_16bit) - 1, NULL, &info, NULL); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - ok(info.Width == 2, "Unexpected width %u.\n", info.Width); - ok(info.Height == 2, "Unexpected height %u.\n", info.Height); - ok(info.Depth == 1, "Unexpected depth %u.\n", info.Depth); - ok(info.ArraySize == 1, "Unexpected array size %u.\n", info.ArraySize); - ok(info.MipLevels == 1, "Unexpected miplevels %u\n", info.MipLevels); - ok(info.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Unexpected format %#x.\n", info.Format); - ok(info.ResourceDimension == D3D11_RESOURCE_DIMENSION_TEXTURE2D, "Unexpected resource type %#x.\n", info.ResourceDimension); - ok(info.ImageFileFormat == D3DX11_IFF_DDS, "Unexpected image file format %#x.\n", info.ImageFileFormat); + check_image_info_values(&info, 2, 2, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_DDS, FALSE); memset(&info, 0, sizeof(info)); hr = D3DX11GetImageInfoFromMemory(dds_8bit, sizeof(dds_8bit), NULL, &info, NULL); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - ok(info.Width == 16, "Unexpected width %u.\n", info.Width); - ok(info.Height == 4, "Unexpected height %u.\n", info.Height); - ok(info.Depth == 1, "Unexpected depth %u.\n", info.Depth); - ok(info.ArraySize == 1, "Unexpected array size %u.\n", info.ArraySize); - ok(info.MipLevels == 1, "Unexpected miplevels %u\n", info.MipLevels); - ok(info.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Unexpected format %#x.\n", info.Format); - ok(info.ResourceDimension == D3D11_RESOURCE_DIMENSION_TEXTURE2D, "Unexpected resource type %#x.\n", info.ResourceDimension); - ok(info.ImageFileFormat == D3DX11_IFF_DDS, "Unexpected image file format %#x.\n", info.ImageFileFormat); + check_image_info_values(&info, 16, 4, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_DDS, FALSE); + memset(&info, 0, sizeof(info)); hr = D3DX11GetImageInfoFromMemory(dds_cube_map, sizeof(dds_cube_map), NULL, &info, NULL); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - ok(info.Width == 4, "Unexpected width %u.\n", info.Width); - ok(info.Height == 4, "Unexpected height %u.\n", info.Height); - ok(info.Depth == 1, "Unexpected depth %u.\n", info.Depth); - ok(info.ArraySize == 6, "Unexpected array size %u.\n", info.ArraySize); - ok(info.MipLevels == 1, "Unexpected miplevels %u\n", info.MipLevels); - ok(info.Format == DXGI_FORMAT_BC3_UNORM, "Unexpected format %#x.\n", info.Format); - ok(info.ResourceDimension == D3D11_RESOURCE_DIMENSION_TEXTURE2D, "Unexpected resource type %#x.\n", info.ResourceDimension); - ok(info.ImageFileFormat == D3DX11_IFF_DDS, "Unexpected image file format %#x.\n", info.ImageFileFormat); + check_image_info_values(&info, 4, 4, 1, 6, 1, D3D11_RESOURCE_MISC_TEXTURECUBE, DXGI_FORMAT_BC3_UNORM, + D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS, FALSE); + memset(&info, 0, sizeof(info)); hr = D3DX11GetImageInfoFromMemory(dds_cube_map, sizeof(dds_cube_map) - 1, NULL, &info, NULL); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - ok(info.Width == 4, "Unexpected width %u.\n", info.Width); - ok(info.Height == 4, "Unexpected height %u.\n", info.Height); - ok(info.Depth == 1, "Unexpected depth %u.\n", info.Depth); - ok(info.ArraySize == 6, "Unexpected array size %u.\n", info.ArraySize); - ok(info.MipLevels == 1, "Unexpected miplevels %u\n", info.MipLevels); - ok(info.Format == DXGI_FORMAT_BC3_UNORM, "Unexpected format %#x.\n", info.Format); - ok(info.ResourceDimension == D3D11_RESOURCE_DIMENSION_TEXTURE2D, "Unexpected resource type %#x.\n", info.ResourceDimension); - ok(info.ImageFileFormat == D3DX11_IFF_DDS, "Unexpected image file format %#x.\n", info.ImageFileFormat); + check_image_info_values(&info, 4, 4, 1, 6, 1, D3D11_RESOURCE_MISC_TEXTURECUBE, DXGI_FORMAT_BC3_UNORM, + D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS, FALSE); + memset(&info, 0, sizeof(info)); hr = D3DX11GetImageInfoFromMemory(dds_volume_map, sizeof(dds_volume_map), NULL, &info, NULL); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - ok(info.Width == 4, "Unexpected width %u.\n", info.Width); - ok(info.Height == 4, "Unexpected height %u.\n", info.Height); - ok(info.Depth == 2, "Unexpected depth %u.\n", info.Depth); - ok(info.ArraySize == 1, "Unexpected array size %u.\n", info.ArraySize); - ok(info.MipLevels == 3, "Unexpected miplevels %u\n", info.MipLevels); - ok(info.Format == DXGI_FORMAT_BC2_UNORM, "Unexpected format %#x.\n", info.Format); - ok(info.ResourceDimension == D3D11_RESOURCE_DIMENSION_TEXTURE3D, "Unexpected resource type %#x.\n", info.ResourceDimension); - ok(info.ImageFileFormat == D3DX11_IFF_DDS, "Unexpected image file format %#x.\n", info.ImageFileFormat); + check_image_info_values(&info, 4, 4, 2, 1, 3, 0, DXGI_FORMAT_BC2_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, + D3DX11_IFF_DDS, FALSE); hr = D3DX11GetImageInfoFromMemory(dds_volume_map, sizeof(dds_volume_map) - 1, NULL, &info, NULL); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - ok(info.Width == 4, "Unexpected width %u.\n", info.Width); - ok(info.Height == 4, "Unexpected height %u.\n", info.Height); - ok(info.Depth == 2, "Unexpected depth %u.\n", info.Depth); - ok(info.ArraySize == 1, "Unexpected array size %u.\n", info.ArraySize); - ok(info.MipLevels == 3, "Unexpected miplevels %u\n", info.MipLevels); - ok(info.Format == DXGI_FORMAT_BC2_UNORM, "Unexpected format %#x.\n", info.Format); - ok(info.ResourceDimension == D3D11_RESOURCE_DIMENSION_TEXTURE3D, "Unexpected resource type %#x.\n", info.ResourceDimension); - ok(info.ImageFileFormat == D3DX11_IFF_DDS, "Unexpected image file format %#x.\n", info.ImageFileFormat); + check_image_info_values(&info, 4, 4, 2, 1, 3, 0, DXGI_FORMAT_BC2_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, + D3DX11_IFF_DDS, FALSE); check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC1_UNORM); check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('D','X','T','2'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC2_UNORM); From ab24b8058e8fd488b713a9b363a117d72f46c14f Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 28 Aug 2024 09:59:20 -0400 Subject: [PATCH 0960/2542] d3dx11/tests: Import more image info tests from d3dx10. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx11_43/tests/d3dx11.c | 537 ++++++++++++++++++++++++++++++++++ 1 file changed, 537 insertions(+) diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index e2fe0b72bc35..6f67530ab3a0 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -29,6 +29,140 @@ ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 )) #endif +static uint32_t get_bpp_from_format(DXGI_FORMAT format) +{ + switch (format) + { + case DXGI_FORMAT_R32G32B32A32_TYPELESS: + case DXGI_FORMAT_R32G32B32A32_FLOAT: + case DXGI_FORMAT_R32G32B32A32_UINT: + case DXGI_FORMAT_R32G32B32A32_SINT: + return 128; + case DXGI_FORMAT_R32G32B32_TYPELESS: + case DXGI_FORMAT_R32G32B32_FLOAT: + case DXGI_FORMAT_R32G32B32_UINT: + case DXGI_FORMAT_R32G32B32_SINT: + return 96; + case DXGI_FORMAT_R16G16B16A16_TYPELESS: + case DXGI_FORMAT_R16G16B16A16_FLOAT: + case DXGI_FORMAT_R16G16B16A16_UNORM: + case DXGI_FORMAT_R16G16B16A16_UINT: + case DXGI_FORMAT_R16G16B16A16_SNORM: + case DXGI_FORMAT_R16G16B16A16_SINT: + case DXGI_FORMAT_R32G32_TYPELESS: + case DXGI_FORMAT_R32G32_FLOAT: + case DXGI_FORMAT_R32G32_UINT: + case DXGI_FORMAT_R32G32_SINT: + case DXGI_FORMAT_R32G8X24_TYPELESS: + case DXGI_FORMAT_D32_FLOAT_S8X24_UINT: + case DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS: + case DXGI_FORMAT_X32_TYPELESS_G8X24_UINT: + case DXGI_FORMAT_Y416: + case DXGI_FORMAT_Y210: + case DXGI_FORMAT_Y216: + return 64; + case DXGI_FORMAT_R10G10B10A2_TYPELESS: + case DXGI_FORMAT_R10G10B10A2_UNORM: + case DXGI_FORMAT_R10G10B10A2_UINT: + case DXGI_FORMAT_R11G11B10_FLOAT: + case DXGI_FORMAT_R8G8B8A8_TYPELESS: + case DXGI_FORMAT_R8G8B8A8_UNORM: + case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: + case DXGI_FORMAT_R8G8B8A8_UINT: + case DXGI_FORMAT_R8G8B8A8_SNORM: + case DXGI_FORMAT_R8G8B8A8_SINT: + case DXGI_FORMAT_R16G16_TYPELESS: + case DXGI_FORMAT_R16G16_FLOAT: + case DXGI_FORMAT_R16G16_UNORM: + case DXGI_FORMAT_R16G16_UINT: + case DXGI_FORMAT_R16G16_SNORM: + case DXGI_FORMAT_R16G16_SINT: + case DXGI_FORMAT_R32_TYPELESS: + case DXGI_FORMAT_D32_FLOAT: + case DXGI_FORMAT_R32_FLOAT: + case DXGI_FORMAT_R32_UINT: + case DXGI_FORMAT_R32_SINT: + case DXGI_FORMAT_R24G8_TYPELESS: + case DXGI_FORMAT_D24_UNORM_S8_UINT: + case DXGI_FORMAT_R24_UNORM_X8_TYPELESS: + case DXGI_FORMAT_X24_TYPELESS_G8_UINT: + case DXGI_FORMAT_R9G9B9E5_SHAREDEXP: + case DXGI_FORMAT_R8G8_B8G8_UNORM: + case DXGI_FORMAT_G8R8_G8B8_UNORM: + case DXGI_FORMAT_B8G8R8A8_UNORM: + case DXGI_FORMAT_B8G8R8X8_UNORM: + case DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM: + case DXGI_FORMAT_B8G8R8A8_TYPELESS: + case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB: + case DXGI_FORMAT_B8G8R8X8_TYPELESS: + case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB: + case DXGI_FORMAT_AYUV: + case DXGI_FORMAT_Y410: + case DXGI_FORMAT_YUY2: + return 32; + case DXGI_FORMAT_P010: + case DXGI_FORMAT_P016: + return 24; + case DXGI_FORMAT_R8G8_TYPELESS: + case DXGI_FORMAT_R8G8_UNORM: + case DXGI_FORMAT_R8G8_UINT: + case DXGI_FORMAT_R8G8_SNORM: + case DXGI_FORMAT_R8G8_SINT: + case DXGI_FORMAT_R16_TYPELESS: + case DXGI_FORMAT_R16_FLOAT: + case DXGI_FORMAT_D16_UNORM: + case DXGI_FORMAT_R16_UNORM: + case DXGI_FORMAT_R16_UINT: + case DXGI_FORMAT_R16_SNORM: + case DXGI_FORMAT_R16_SINT: + case DXGI_FORMAT_B5G6R5_UNORM: + case DXGI_FORMAT_B5G5R5A1_UNORM: + case DXGI_FORMAT_A8P8: + case DXGI_FORMAT_B4G4R4A4_UNORM: + return 16; + case DXGI_FORMAT_NV12: + case DXGI_FORMAT_420_OPAQUE: + case DXGI_FORMAT_NV11: + return 12; + case DXGI_FORMAT_R8_TYPELESS: + case DXGI_FORMAT_R8_UNORM: + case DXGI_FORMAT_R8_UINT: + case DXGI_FORMAT_R8_SNORM: + case DXGI_FORMAT_R8_SINT: + case DXGI_FORMAT_A8_UNORM: + case DXGI_FORMAT_AI44: + case DXGI_FORMAT_IA44: + case DXGI_FORMAT_P8: + case DXGI_FORMAT_BC2_TYPELESS: + case DXGI_FORMAT_BC2_UNORM: + case DXGI_FORMAT_BC2_UNORM_SRGB: + case DXGI_FORMAT_BC3_TYPELESS: + case DXGI_FORMAT_BC3_UNORM: + case DXGI_FORMAT_BC3_UNORM_SRGB: + case DXGI_FORMAT_BC5_TYPELESS: + case DXGI_FORMAT_BC5_UNORM: + case DXGI_FORMAT_BC5_SNORM: + case DXGI_FORMAT_BC6H_TYPELESS: + case DXGI_FORMAT_BC6H_UF16: + case DXGI_FORMAT_BC6H_SF16: + case DXGI_FORMAT_BC7_TYPELESS: + case DXGI_FORMAT_BC7_UNORM: + case DXGI_FORMAT_BC7_UNORM_SRGB: + return 8; + case DXGI_FORMAT_BC1_TYPELESS: + case DXGI_FORMAT_BC1_UNORM: + case DXGI_FORMAT_BC1_UNORM_SRGB: + case DXGI_FORMAT_BC4_TYPELESS: + case DXGI_FORMAT_BC4_UNORM: + case DXGI_FORMAT_BC4_SNORM: + return 4; + case DXGI_FORMAT_R1_UNORM: + return 1; + default: + return 0; + } +} + /* 1x1 bmp (1 bpp) */ static const unsigned char bmp_1bpp[] = { @@ -669,15 +803,31 @@ static void test_D3DX11CompileFromFile(void) #define DDS_PIXELFORMAT 0x00001000 #define DDS_MIPMAPCOUNT 0x00020000 #define DDS_LINEARSIZE 0x00080000 +#define DDS_DEPTH 0x00800000 /* dds_header.caps */ #define DDSCAPS_ALPHA 0x00000002 +#define DDS_CAPS_COMPLEX 0x00000008 #define DDS_CAPS_TEXTURE 0x00001000 +/* dds_header.caps2 */ +#define DDS_CAPS2_VOLUME 0x00200000 +#define DDS_CAPS2_CUBEMAP 0x00000200 +#define DDS_CAPS2_CUBEMAP_POSITIVEX 0x00000400 +#define DDS_CAPS2_CUBEMAP_NEGATIVEX 0x00000800 +#define DDS_CAPS2_CUBEMAP_POSITIVEY 0x00001000 +#define DDS_CAPS2_CUBEMAP_NEGATIVEY 0x00002000 +#define DDS_CAPS2_CUBEMAP_POSITIVEZ 0x00004000 +#define DDS_CAPS2_CUBEMAP_NEGATIVEZ 0x00008000 +#define DDS_CAPS2_CUBEMAP_ALL_FACES ( DDS_CAPS2_CUBEMAP_POSITIVEX | DDS_CAPS2_CUBEMAP_NEGATIVEX \ + | DDS_CAPS2_CUBEMAP_POSITIVEY | DDS_CAPS2_CUBEMAP_NEGATIVEY \ + | DDS_CAPS2_CUBEMAP_POSITIVEZ | DDS_CAPS2_CUBEMAP_NEGATIVEZ ) + /* dds_pixel_format.flags */ #define DDS_PF_ALPHA 0x00000001 #define DDS_PF_ALPHA_ONLY 0x00000002 #define DDS_PF_FOURCC 0x00000004 +#define DDS_PF_INDEXED 0x00000020 #define DDS_PF_RGB 0x00000040 #define DDS_PF_LUMINANCE 0x00020000 #define DDS_PF_BUMPLUMINANCE 0x00040000 @@ -713,6 +863,16 @@ struct dds_header DWORD reserved2; }; +#define DDS_RESOURCE_MISC_TEXTURECUBE 0x04 +struct dds_header_dxt10 +{ + DWORD dxgi_format; + DWORD resource_dimension; + DWORD misc_flag; + DWORD array_size; + DWORD misc_flags2; +}; + /* fills dds_header with reasonable default values */ static void fill_dds_header(struct dds_header *header) { @@ -734,6 +894,35 @@ static void fill_dds_header(struct dds_header *header) header->caps = DDS_CAPS_TEXTURE; } +static void set_dxt10_dds_header(struct dds_header *header, uint32_t append_flags, uint32_t width, uint32_t height, + uint32_t depth, uint32_t mip_levels, uint32_t pitch, uint32_t caps, uint32_t caps2) +{ + memset(header, 0, sizeof(*header)); + + header->size = sizeof(*header); + header->flags = DDS_CAPS | DDS_PIXELFORMAT | append_flags; + header->height = height; + header->width = width; + header->depth = depth; + header->miplevels = mip_levels; + header->pitch_or_linear_size = pitch; + header->pixel_format.size = sizeof(header->pixel_format); + header->pixel_format.flags = DDS_PF_FOURCC; + header->pixel_format.fourcc = MAKEFOURCC('D','X','1','0'); + header->caps = caps; + header->caps2 = caps2; +} + +static void set_dds_header_dxt10(struct dds_header_dxt10 *dxt10, DXGI_FORMAT format, uint32_t resource_dimension, + uint32_t misc_flag, uint32_t array_size, uint32_t misc_flags2) +{ + dxt10->dxgi_format = format; + dxt10->resource_dimension = resource_dimension; + dxt10->misc_flag = misc_flag; + dxt10->array_size = array_size; + dxt10->misc_flags2 = misc_flags2; +} + #define check_dds_pixel_format(flags, fourcc, bpp, rmask, gmask, bmask, amask, format) \ check_dds_pixel_format_(__LINE__, flags, fourcc, bpp, rmask, gmask, bmask, amask, format) static void check_dds_pixel_format_(unsigned int line, DWORD flags, DWORD fourcc, DWORD bpp, @@ -745,6 +934,7 @@ static void check_dds_pixel_format_(unsigned int line, DWORD flags, DWORD fourcc { DWORD magic; struct dds_header header; + PALETTEENTRY palette[256]; BYTE data[256]; } dds; @@ -768,6 +958,308 @@ static void check_dds_pixel_format_(unsigned int line, DWORD flags, DWORD fourcc } } +#define check_dds_pixel_format_unsupported(flags, fourcc, bpp, rmask, gmask, bmask, amask, expected_hr) \ + check_dds_pixel_format_unsupported_(__LINE__, flags, fourcc, bpp, rmask, gmask, bmask, amask, expected_hr) +static void check_dds_pixel_format_unsupported_(unsigned int line, DWORD flags, DWORD fourcc, DWORD bpp, + DWORD rmask, DWORD gmask, DWORD bmask, DWORD amask, HRESULT expected_hr) +{ + D3DX11_IMAGE_INFO info; + HRESULT hr; + struct + { + DWORD magic; + struct dds_header header; + PALETTEENTRY palette[256]; + BYTE data[256]; + } dds; + + dds.magic = MAKEFOURCC('D','D','S',' '); + fill_dds_header(&dds.header); + dds.header.pixel_format.flags = flags; + dds.header.pixel_format.fourcc = fourcc; + dds.header.pixel_format.bpp = bpp; + dds.header.pixel_format.rmask = rmask; + dds.header.pixel_format.gmask = gmask; + dds.header.pixel_format.bmask = bmask; + dds.header.pixel_format.amask = amask; + memset(dds.data, 0, sizeof(dds.data)); + + hr = D3DX11GetImageInfoFromMemory(&dds, sizeof(dds), NULL, &info, NULL); + ok_(__FILE__, line)(hr == expected_hr, "Got unexpected hr %#lx, expected %#lx.\n", hr, expected_hr); +} + +#define check_dds_dx10_format(format, expected_format, wine_todo) \ + check_dds_dx10_format_(__LINE__, format, expected_format, wine_todo) +static void check_dds_dx10_format_(uint32_t line, DXGI_FORMAT format, DXGI_FORMAT expected_format, BOOL wine_todo) +{ + const uint32_t stride = (4 * get_bpp_from_format(format) + 7) / 8; + D3DX11_IMAGE_INFO info; + HRESULT hr; + struct + { + DWORD magic; + struct dds_header header; + struct dds_header_dxt10 dxt10; + BYTE data[256]; + } dds; + + dds.magic = MAKEFOURCC('D','D','S',' '); + set_dxt10_dds_header(&dds.header, 0, 4, 4, 1, 1, stride, 0, 0); + set_dds_header_dxt10(&dds.dxt10, format, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0); + + hr = D3DX11GetImageInfoFromMemory(&dds, sizeof(dds), NULL, &info, NULL); + ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#lx for DXGI format %#x.\n", hr, format); + if (SUCCEEDED(hr)) + { + todo_wine_if(wine_todo) ok_(__FILE__, line)(info.Format == expected_format, "Unexpected format %#x, expected %#x.\n", + info.Format, expected_format); + } +} + +#define check_dds_dx10_format_unsupported(format, expected_hr) \ + check_dds_dx10_format_unsupported_(__LINE__, format, expected_hr) +static void check_dds_dx10_format_unsupported_(uint32_t line, DXGI_FORMAT format, HRESULT expected_hr) +{ + const uint32_t stride = (4 * get_bpp_from_format(format) + 7) / 8; + D3DX11_IMAGE_INFO info; + HRESULT hr; + struct + { + DWORD magic; + struct dds_header header; + struct dds_header_dxt10 dxt10; + BYTE data[256]; + } dds; + + dds.magic = MAKEFOURCC('D','D','S',' '); + set_dxt10_dds_header(&dds.header, 0, 4, 4, 1, 1, stride, 0, 0); + set_dds_header_dxt10(&dds.dxt10, format, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0); + + hr = D3DX11GetImageInfoFromMemory(&dds, sizeof(dds), NULL, &info, NULL); + ok_(__FILE__, line)(hr == expected_hr, "Got unexpected hr %#lx for DXGI format %#x.\n", hr, format); +} + +static void test_dds_header_image_info(void) +{ + struct expected + { + HRESULT hr; + uint32_t width; + uint32_t height; + uint32_t depth; + uint32_t array_size; + uint32_t mip_levels; + uint32_t misc_flags; + DXGI_FORMAT format; + D3D11_RESOURCE_DIMENSION resource_dimension; + }; + static const struct + { + uint32_t flags; + uint32_t width; + uint32_t height; + uint32_t depth; + uint32_t row_pitch; + uint32_t mip_levels; + uint32_t caps; + uint32_t caps2; + struct expected expected; + uint32_t pixel_data_size; + BOOL todo_hr; + BOOL todo_info; + } tests[] = { + /* File size validation isn't done on d3dx10. */ + { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT), 4, 4, 1, (4 * 4), 3, 0, 0, + { S_OK, 4, 4, 1, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, }, 0, }, + /* Depth value set to 4, but no caps bits are set. Depth is ignored. */ + { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT), 4, 4, 4, (4 * 4), 3, 0, 0, + { S_OK, 4, 4, 1, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, }, 292 }, + /* The volume texture caps2 field is ignored. */ + { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT), 4, 4, 4, (4 * 4), 3, + (DDS_CAPS_TEXTURE | DDS_CAPS_COMPLEX), DDS_CAPS2_VOLUME, + { S_OK, 4, 4, 1, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, }, 292 }, + /* + * The DDS_DEPTH flag is the only thing checked to determine if a DDS + * file represents a 3D texture. + */ + { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT | DDS_DEPTH), 4, 4, 4, (4 * 4), 3, + 0, 0, + { S_OK, 4, 4, 4, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, }, 292 }, + /* Even if the depth field is set to 0, it's still a 3D texture. */ + { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT | DDS_DEPTH), 4, 4, 0, (4 * 4), 3, + 0, 0, + { S_OK, 4, 4, 1, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, }, 292 }, + /* The DDS_DEPTH flag overrides cubemap caps. */ + { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT | DDS_DEPTH), 4, 4, 4, (4 * 4), 3, + (DDS_CAPS_TEXTURE | DDS_CAPS_COMPLEX), (DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES), + { S_OK, 4, 4, 4, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, }, 292 }, + /* Cubemap where width field does not equal height. */ + { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT), 4, 5, 1, (4 * 4), 1, + (DDS_CAPS_TEXTURE | DDS_CAPS_COMPLEX), (DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES), + { S_OK, 4, 5, 1, 6, 1, D3D11_RESOURCE_MISC_TEXTURECUBE, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, }, (80 * 6) }, + /* Partial cubemaps are not supported. */ + { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT), 4, 4, 1, (4 * 4), 1, + (DDS_CAPS_TEXTURE | DDS_CAPS_COMPLEX), (DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_POSITIVEX), + { E_FAIL, }, (64 * 6), }, + }; + static const struct + { + uint32_t append_flags; + uint32_t width; + uint32_t height; + uint32_t depth; + uint32_t row_pitch; + uint32_t mip_levels; + uint32_t caps; + uint32_t caps2; + struct dds_header_dxt10 dxt10; + struct expected expected; + uint32_t pixel_data_size; + BOOL todo_hr; + BOOL todo_info; + } dxt10_tests[] = { + /* File size validation isn't done on d3dx10. */ + { 0, 4, 4, 0, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0, }, + { S_OK, 4, 4, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, }, 0, }, + /* + * Setting the misc_flags2 field to anything other than 0 results in + * E_FAIL. + */ + { 0, 4, 4, 0, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 1, }, + { E_FAIL }, (4 * 4 * 4), }, + /* + * The misc_flags field isn't passed through directly, only the + * cube texture flag is (if it's set). + */ + { 0, 4, 4, 0, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0xfffffffb, 1, 0, }, + { S_OK, 4, 4, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, }, (4 * 4 * 4) }, + /* Resource dimension field of the header isn't validated. */ + { 0, 4, 4, 0, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, 500, 0, 1, 0, }, + { S_OK, 4, 4, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, 500, }, (4 * 4 * 4), .todo_hr = TRUE }, + /* Depth value of 2, but D3D11_RESOURCE_DIMENSION_TEXTURE2D. */ + { DDS_DEPTH, 4, 4, 2, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0, }, + { S_OK, 4, 4, 2, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, }, (4 * 4 * 4 * 2) }, + /* Depth field value is ignored if DDS_DEPTH isn't set. */ + { 0, 4, 4, 2, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0, }, + { S_OK, 4, 4, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, }, (4 * 4 * 4 * 2), }, + /* + * 3D texture with an array size larger than 1. Technically there's no + * such thing as a 3D texture array, but it succeeds. + */ + { DDS_DEPTH, 4, 4, 2, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, 0, 2, 0, }, + { S_OK, 4, 4, 2, 2, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, }, (4 * 4 * 4 * 2 * 2) }, + /* Cubemap caps are ignored for DXT10 files. */ + { 0, 4, 4, 1, (4 * 4), 1, 0, DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0, }, + { S_OK, 4, 4, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D }, (4 * 4 * 4 * 6) }, + /* Array size value is multiplied by 6 for cubemap files. */ + { 0, 4, 4, 1, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 2, 0, }, + { S_OK, 4, 4, 1, 12, 1, D3D11_RESOURCE_MISC_TEXTURECUBE, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D }, (4 * 4 * 4 * 12) }, + /* Resource dimension is validated for cube textures. */ + { 0, 4, 4, 1, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, DDS_RESOURCE_MISC_TEXTURECUBE, 2, 0, }, + { E_FAIL }, (4 * 4 * 4 * 12), }, + /* 1D Texture cube, invalid. */ + { 0, 4, 4, 1, (4 * 4), 1, 0, 0, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, DDS_RESOURCE_MISC_TEXTURECUBE, 2, 0, }, + { E_FAIL }, (4 * 4 * 4 * 12), }, + }; + D3DX11_IMAGE_INFO info; + uint32_t i, file_size; + struct + { + DWORD magic; + struct dds_header header; + struct dds_header_dxt10 dxt10; + } dds; + HRESULT hr; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + winetest_push_context("Test %u", i); + file_size = sizeof(dds.magic) + sizeof(dds.header) + tests[i].pixel_data_size; + + dds.magic = MAKEFOURCC('D','D','S',' '); + fill_dds_header(&dds.header); + dds.header.flags = tests[i].flags; + dds.header.width = tests[i].width; + dds.header.height = tests[i].height; + dds.header.depth = tests[i].depth; + dds.header.pitch_or_linear_size = tests[i].row_pitch; + dds.header.miplevels = tests[i].mip_levels; + dds.header.caps = tests[i].caps; + dds.header.caps2 = tests[i].caps2; + + memset(&info, 0, sizeof(info)); + hr = D3DX11GetImageInfoFromMemory(&dds, file_size, NULL, &info, NULL); + todo_wine_if(tests[i].todo_hr) ok(hr == tests[i].expected.hr, "Got unexpected hr %#lx, expected %#lx.\n", + hr, tests[i].expected.hr); + if (SUCCEEDED(hr) && SUCCEEDED(tests[i].expected.hr)) + check_image_info_values(&info, tests[i].expected.width, tests[i].expected.height, + tests[i].expected.depth, tests[i].expected.array_size, tests[i].expected.mip_levels, + tests[i].expected.misc_flags, tests[i].expected.format, + tests[i].expected.resource_dimension, D3DX11_IFF_DDS, tests[i].todo_info); + + winetest_pop_context(); + } + + for (i = 0; i < ARRAY_SIZE(dxt10_tests); ++i) + { + winetest_push_context("Test %u", i); + file_size = sizeof(dds) + dxt10_tests[i].pixel_data_size; + + dds.magic = MAKEFOURCC('D','D','S',' '); + set_dxt10_dds_header(&dds.header, dxt10_tests[i].append_flags, dxt10_tests[i].width, dxt10_tests[i].height, + dxt10_tests[i].depth, dxt10_tests[i].mip_levels, dxt10_tests[i].row_pitch, dxt10_tests[i].caps, dxt10_tests[i].caps2); + dds.dxt10 = dxt10_tests[i].dxt10; + + memset(&info, 0, sizeof(info)); + hr = D3DX11GetImageInfoFromMemory(&dds, file_size, NULL, &info, NULL); + todo_wine_if(dxt10_tests[i].todo_hr) ok(hr == dxt10_tests[i].expected.hr, "Got unexpected hr %#lx, expected %#lx.\n", + hr, dxt10_tests[i].expected.hr); + if (SUCCEEDED(hr) && SUCCEEDED(dxt10_tests[i].expected.hr)) + check_image_info_values(&info, dxt10_tests[i].expected.width, dxt10_tests[i].expected.height, + dxt10_tests[i].expected.depth, dxt10_tests[i].expected.array_size, dxt10_tests[i].expected.mip_levels, + dxt10_tests[i].expected.misc_flags, dxt10_tests[i].expected.format, + dxt10_tests[i].expected.resource_dimension, D3DX11_IFF_DDS, dxt10_tests[i].todo_info); + + winetest_pop_context(); + } + + /* + * Image size (e.g, the size of the pixels) isn't validated, but header + * size is. + */ + dds.magic = MAKEFOURCC('D','D','S',' '); + set_dxt10_dds_header(&dds.header, dxt10_tests[0].append_flags, dxt10_tests[0].width, dxt10_tests[0].height, + dxt10_tests[0].depth, dxt10_tests[0].mip_levels, dxt10_tests[0].row_pitch, dxt10_tests[0].caps, dxt10_tests[0].caps2); + dds.dxt10 = dxt10_tests[0].dxt10; + + hr = D3DX11GetImageInfoFromMemory(&dds, sizeof(dds) - 1, NULL, &info, NULL); + ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); + + hr = D3DX11GetImageInfoFromMemory(&dds, sizeof(dds), NULL, &info, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + /* Non DXT10 header. */ + dds.magic = MAKEFOURCC('D','D','S',' '); + fill_dds_header(&dds.header); + + hr = D3DX11GetImageInfoFromMemory(&dds, sizeof(dds) - sizeof(dds.dxt10) - 1, NULL, &info, NULL); + ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); + + hr = D3DX11GetImageInfoFromMemory(&dds, sizeof(dds) - sizeof(dds.dxt10), NULL, &info, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); +} + static void test_D3DX11GetImageInfoFromMemory(void) { D3DX11_IMAGE_INFO info; @@ -942,6 +1434,51 @@ static void test_D3DX11GetImageInfoFromMemory(void) check_dds_pixel_format(DDS_PF_LUMINANCE, 0, 16, 0xffff, 0, 0, 0, DXGI_FORMAT_R16G16B16A16_UNORM); check_dds_pixel_format(DDS_PF_LUMINANCE | DDS_PF_ALPHA, 0, 16, 0x00ff, 0, 0, 0xff00, DXGI_FORMAT_R8G8B8A8_UNORM); check_dds_pixel_format(DDS_PF_LUMINANCE | DDS_PF_ALPHA, 0, 8, 0x0f, 0, 0, 0xf0, DXGI_FORMAT_R8G8B8A8_UNORM); + check_dds_pixel_format(DDS_PF_INDEXED, 0, 8, 0, 0, 0, 0, DXGI_FORMAT_R8G8B8A8_UNORM); + check_dds_pixel_format(DDS_PF_INDEXED | DDS_PF_ALPHA, 0, 16, 0, 0, 0, 0xff00, DXGI_FORMAT_R8G8B8A8_UNORM); + check_dds_pixel_format(DDS_PF_FOURCC, 0x24, 0, 0, 0, 0, 0, DXGI_FORMAT_R16G16B16A16_UNORM); /* D3DFMT_A16B16G16R16 */ + check_dds_pixel_format(DDS_PF_FOURCC, 0x6e, 0, 0, 0, 0, 0, DXGI_FORMAT_R16G16B16A16_SNORM); /* D3DFMT_Q16W16V16U16 */ + check_dds_pixel_format(DDS_PF_FOURCC, 0x6f, 0, 0, 0, 0, 0, DXGI_FORMAT_R16_FLOAT); /* D3DFMT_R16F */ + check_dds_pixel_format(DDS_PF_FOURCC, 0x70, 0, 0, 0, 0, 0, DXGI_FORMAT_R16G16_FLOAT); /* D3DFMT_G16R16F */ + check_dds_pixel_format(DDS_PF_FOURCC, 0x71, 0, 0, 0, 0, 0, DXGI_FORMAT_R16G16B16A16_FLOAT); /* D3DFMT_A16B16G16R16F */ + check_dds_pixel_format(DDS_PF_FOURCC, 0x72, 0, 0, 0, 0, 0, DXGI_FORMAT_R32_FLOAT); /* D3DFMT_R32F */ + check_dds_pixel_format(DDS_PF_FOURCC, 0x73, 0, 0, 0, 0, 0, DXGI_FORMAT_R32G32_FLOAT); /* D3DFMT_G32R32F */ + check_dds_pixel_format(DDS_PF_FOURCC, 0x74, 0, 0, 0, 0, 0, DXGI_FORMAT_R32G32B32A32_FLOAT); /* D3DFMT_A32B32G32R32F */ + + /* Test for DDS pixel formats that are valid on d3dx9, but not d3dx10. */ + check_dds_pixel_format_unsupported(DDS_PF_FOURCC, MAKEFOURCC('U','Y','V','Y'), 0, 0, 0, 0, 0, E_FAIL); + check_dds_pixel_format_unsupported(DDS_PF_FOURCC, MAKEFOURCC('Y','U','Y','2'), 0, 0, 0, 0, 0, E_FAIL); + /* Bumpmap formats aren't supported. */ + check_dds_pixel_format_unsupported(DDS_PF_BUMPDUDV, 0, 16, 0x00ff, 0xff00, 0, 0, E_FAIL); + check_dds_pixel_format_unsupported(DDS_PF_BUMPDUDV, 0, 32, 0x0000ffff, 0xffff0000, 0, 0, E_FAIL); + check_dds_pixel_format_unsupported(DDS_PF_BUMPDUDV, 0, 32, 0xff, 0xff00, 0x00ff0000, 0xff000000, E_FAIL); + check_dds_pixel_format_unsupported(DDS_PF_BUMPLUMINANCE, 0, 32, 0x0000ff, 0x00ff00, 0xff0000, 0, E_FAIL); + + /* Newer fourCC formats. */ + check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('B','C','4','U'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC4_UNORM); + check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('B','C','5','U'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC5_UNORM); + check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('B','C','4','S'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC4_SNORM); + check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('B','C','5','S'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC5_SNORM); + + check_dds_dx10_format_unsupported(DXGI_FORMAT_B5G6R5_UNORM, E_FAIL); + check_dds_dx10_format_unsupported(DXGI_FORMAT_B5G5R5A1_UNORM, E_FAIL); + check_dds_dx10_format_unsupported(DXGI_FORMAT_B4G4R4A4_UNORM, E_FAIL); + + /* + * These formats should map 1:1 from the DXT10 header, unlike legacy DDS + * file equivalents. + */ + check_dds_dx10_format(DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM, FALSE); + check_dds_dx10_format(DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM, FALSE); + check_dds_dx10_format(DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R8G8_UNORM, FALSE); + check_dds_dx10_format(DXGI_FORMAT_B8G8R8X8_UNORM, DXGI_FORMAT_B8G8R8X8_UNORM, FALSE); + check_dds_dx10_format(DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM, FALSE); + /* Formats unsupported on d3dx10, but now supported on d3dx11. */ + check_dds_dx10_format(DXGI_FORMAT_BC6H_UF16, DXGI_FORMAT_BC6H_UF16, FALSE); + check_dds_dx10_format(DXGI_FORMAT_BC6H_SF16, DXGI_FORMAT_BC6H_SF16, FALSE); + check_dds_dx10_format(DXGI_FORMAT_BC7_UNORM, DXGI_FORMAT_BC7_UNORM, FALSE); + + test_dds_header_image_info(); } START_TEST(d3dx11) From 53a2dfb990544f86322a7c6fb36859d11a90922e Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 11 Dec 2024 10:14:26 -0500 Subject: [PATCH 0961/2542] d3dx11: Implement D3DX11GetImageInfoFromMemory() using shared code. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/texture.c | 131 +------------------------------- dlls/d3dx11_43/Makefile.in | 7 +- dlls/d3dx11_43/d3dx11_43_main.c | 9 --- dlls/d3dx11_43/dxhelpers.h | 21 +++++ dlls/d3dx11_43/tests/d3dx11.c | 14 +--- dlls/d3dx11_43/texture.c | 109 ++++++++++++++++++++++++++ dlls/d3dx9_36/d3dx_helpers.c | 129 +++++++++++++++++++++++++++++++ dlls/d3dx9_36/d3dx_helpers.h | 37 +++++++++ 8 files changed, 306 insertions(+), 151 deletions(-) create mode 100644 dlls/d3dx11_43/dxhelpers.h diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 144dfe5e1f30..818af3ff1ba9 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -27,135 +27,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx); -/* - * These are mappings from legacy DDS header formats to DXGI formats. Some - * don't map to a DXGI_FORMAT at all, and some only map to the default format. - */ -static DXGI_FORMAT dxgi_format_from_legacy_dds_d3dx_pixel_format_id(enum d3dx_pixel_format_id format) -{ - switch (format) - { - /* - * Some of these formats do have DXGI_FORMAT equivalents, but get - * mapped to DXGI_FORMAT_R8G8B8A8_UNORM instead. - */ - case D3DX_PIXEL_FORMAT_P8_UINT: return DXGI_FORMAT_R8G8B8A8_UNORM; - case D3DX_PIXEL_FORMAT_P8_UINT_A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; - case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; - case D3DX_PIXEL_FORMAT_R8G8B8X8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; - case D3DX_PIXEL_FORMAT_B8G8R8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; - case D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; - case D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; - case D3DX_PIXEL_FORMAT_B5G6R5_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; - case D3DX_PIXEL_FORMAT_B5G5R5X1_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; - case D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; - case D3DX_PIXEL_FORMAT_B2G3R3_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; - case D3DX_PIXEL_FORMAT_B2G3R3A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; - case D3DX_PIXEL_FORMAT_B4G4R4A4_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; - case D3DX_PIXEL_FORMAT_B4G4R4X4_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; - case D3DX_PIXEL_FORMAT_L8A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; - case D3DX_PIXEL_FORMAT_L4A4_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; - case D3DX_PIXEL_FORMAT_L8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; - - /* B10G10R10A2 doesn't exist in DXGI, both map to R10G10B10A2. */ - case D3DX_PIXEL_FORMAT_B10G10R10A2_UNORM: - case D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM: return DXGI_FORMAT_R10G10B10A2_UNORM; - - case D3DX_PIXEL_FORMAT_U16V16W16Q16_SNORM: return DXGI_FORMAT_R16G16B16A16_SNORM; - case D3DX_PIXEL_FORMAT_L16_UNORM: return DXGI_FORMAT_R16G16B16A16_UNORM; - case D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM: return DXGI_FORMAT_R16G16B16A16_UNORM; - case D3DX_PIXEL_FORMAT_R16G16_UNORM: return DXGI_FORMAT_R16G16_UNORM; - case D3DX_PIXEL_FORMAT_A8_UNORM: return DXGI_FORMAT_A8_UNORM; - case D3DX_PIXEL_FORMAT_R16_FLOAT: return DXGI_FORMAT_R16_FLOAT; - case D3DX_PIXEL_FORMAT_R16G16_FLOAT: return DXGI_FORMAT_R16G16_FLOAT; - case D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT: return DXGI_FORMAT_R16G16B16A16_FLOAT; - case D3DX_PIXEL_FORMAT_R32_FLOAT: return DXGI_FORMAT_R32_FLOAT; - case D3DX_PIXEL_FORMAT_R32G32_FLOAT: return DXGI_FORMAT_R32G32_FLOAT; - case D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT: return DXGI_FORMAT_R32G32B32A32_FLOAT; - case D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM: return DXGI_FORMAT_G8R8_G8B8_UNORM; - case D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM: return DXGI_FORMAT_R8G8_B8G8_UNORM; - - case D3DX_PIXEL_FORMAT_DXT1_UNORM: return DXGI_FORMAT_BC1_UNORM; - case D3DX_PIXEL_FORMAT_DXT2_UNORM: return DXGI_FORMAT_BC2_UNORM; - case D3DX_PIXEL_FORMAT_DXT3_UNORM: return DXGI_FORMAT_BC2_UNORM; - case D3DX_PIXEL_FORMAT_DXT4_UNORM: return DXGI_FORMAT_BC3_UNORM; - case D3DX_PIXEL_FORMAT_DXT5_UNORM: return DXGI_FORMAT_BC3_UNORM; - case D3DX_PIXEL_FORMAT_BC4_UNORM: return DXGI_FORMAT_BC4_UNORM; - case D3DX_PIXEL_FORMAT_BC4_SNORM: return DXGI_FORMAT_BC4_SNORM; - case D3DX_PIXEL_FORMAT_BC5_UNORM: return DXGI_FORMAT_BC5_UNORM; - case D3DX_PIXEL_FORMAT_BC5_SNORM: return DXGI_FORMAT_BC5_SNORM; - - /* These formats are known and explicitly unsupported on d3dx10+. */ - case D3DX_PIXEL_FORMAT_U8V8W8Q8_SNORM: - case D3DX_PIXEL_FORMAT_U8V8_SNORM: - case D3DX_PIXEL_FORMAT_U16V16_SNORM: - case D3DX_PIXEL_FORMAT_U8V8_SNORM_L8X8_UNORM: - case D3DX_PIXEL_FORMAT_U10V10W10_SNORM_A2_UNORM: - case D3DX_PIXEL_FORMAT_UYVY: - case D3DX_PIXEL_FORMAT_YUY2: - return DXGI_FORMAT_UNKNOWN; - - default: - FIXME("Unknown d3dx_pixel_format_id %#x.\n", format); - return DXGI_FORMAT_UNKNOWN; - } -} - -static DXGI_FORMAT dxgi_format_from_d3dx_pixel_format_id(enum d3dx_pixel_format_id format) -{ - switch (format) - { - case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; - case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB: return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB; - case D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM: return DXGI_FORMAT_B8G8R8A8_UNORM; - case D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM: return DXGI_FORMAT_B8G8R8X8_UNORM; - case D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM: return DXGI_FORMAT_R10G10B10A2_UNORM; - case D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM: return DXGI_FORMAT_R16G16B16A16_UNORM; - case D3DX_PIXEL_FORMAT_R8_UNORM: return DXGI_FORMAT_R8_UNORM; - case D3DX_PIXEL_FORMAT_R8_SNORM: return DXGI_FORMAT_R8_SNORM; - case D3DX_PIXEL_FORMAT_R8G8_UNORM: return DXGI_FORMAT_R8G8_UNORM; - case D3DX_PIXEL_FORMAT_R16_UNORM: return DXGI_FORMAT_R16_UNORM; - case D3DX_PIXEL_FORMAT_R16G16_UNORM: return DXGI_FORMAT_R16G16_UNORM; - case D3DX_PIXEL_FORMAT_A8_UNORM: return DXGI_FORMAT_A8_UNORM; - case D3DX_PIXEL_FORMAT_R16_FLOAT: return DXGI_FORMAT_R16_FLOAT; - case D3DX_PIXEL_FORMAT_R16G16_FLOAT: return DXGI_FORMAT_R16G16_FLOAT; - case D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT: return DXGI_FORMAT_R16G16B16A16_FLOAT; - case D3DX_PIXEL_FORMAT_R32_FLOAT: return DXGI_FORMAT_R32_FLOAT; - case D3DX_PIXEL_FORMAT_R32G32_FLOAT: return DXGI_FORMAT_R32G32_FLOAT; - case D3DX_PIXEL_FORMAT_R32G32B32_FLOAT: return DXGI_FORMAT_R32G32B32_FLOAT; - case D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT: return DXGI_FORMAT_R32G32B32A32_FLOAT; - case D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM: return DXGI_FORMAT_G8R8_G8B8_UNORM; - case D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM: return DXGI_FORMAT_R8G8_B8G8_UNORM; - case D3DX_PIXEL_FORMAT_BC1_UNORM: return DXGI_FORMAT_BC1_UNORM; - case D3DX_PIXEL_FORMAT_BC1_UNORM_SRGB: return DXGI_FORMAT_BC1_UNORM_SRGB; - case D3DX_PIXEL_FORMAT_BC2_UNORM: return DXGI_FORMAT_BC2_UNORM; - case D3DX_PIXEL_FORMAT_BC2_UNORM_SRGB: return DXGI_FORMAT_BC2_UNORM_SRGB; - case D3DX_PIXEL_FORMAT_BC3_UNORM: return DXGI_FORMAT_BC3_UNORM; - case D3DX_PIXEL_FORMAT_BC3_UNORM_SRGB: return DXGI_FORMAT_BC3_UNORM_SRGB; - case D3DX_PIXEL_FORMAT_BC4_UNORM: return DXGI_FORMAT_BC4_UNORM; - case D3DX_PIXEL_FORMAT_BC4_SNORM: return DXGI_FORMAT_BC4_SNORM; - case D3DX_PIXEL_FORMAT_BC5_UNORM: return DXGI_FORMAT_BC5_UNORM; - case D3DX_PIXEL_FORMAT_BC5_SNORM: return DXGI_FORMAT_BC5_SNORM; - case D3DX_PIXEL_FORMAT_R16G16B16A16_SNORM: return DXGI_FORMAT_R16G16B16A16_SNORM; - case D3DX_PIXEL_FORMAT_R8G8B8A8_SNORM: return DXGI_FORMAT_R8G8B8A8_SNORM; - case D3DX_PIXEL_FORMAT_R8G8_SNORM: return DXGI_FORMAT_R8G8_SNORM; - case D3DX_PIXEL_FORMAT_R16G16_SNORM: return DXGI_FORMAT_R16G16_SNORM; - - /* - * These have DXGI_FORMAT equivalents, but are explicitly unsupported on - * d3dx10. - */ - case D3DX_PIXEL_FORMAT_B5G6R5_UNORM: - case D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM: - case D3DX_PIXEL_FORMAT_B4G4R4A4_UNORM: - return DXGI_FORMAT_UNKNOWN; - - default: - FIXME("Unhandled d3dx_pixel_format_id %#x.\n", format); - return DXGI_FORMAT_UNKNOWN; - } -} - HRESULT WINAPI D3DX10GetImageInfoFromFileA(const char *src_file, ID3DX10ThreadPump *pump, D3DX10_IMAGE_INFO *info, HRESULT *result) { @@ -311,7 +182,7 @@ static HRESULT d3dx10_image_info_from_d3dx_image(D3DX10_IMAGE_INFO *info, struct memset(info, 0, sizeof(*info)); if (image->image_file_format == D3DX_IMAGE_FILE_FORMAT_DDS_DXT10) { - format = dxgi_format_from_d3dx_pixel_format_id(image->format); + format = dxgi_format_from_dxt10_dds_d3dx_pixel_format_id(image->format); info->ImageFileFormat = D3DX10_IFF_DDS; } else diff --git a/dlls/d3dx11_43/Makefile.in b/dlls/d3dx11_43/Makefile.in index a44fafb1541a..be0a311305e3 100644 --- a/dlls/d3dx11_43/Makefile.in +++ b/dlls/d3dx11_43/Makefile.in @@ -1,12 +1,15 @@ -EXTRADEFS = -DD3DX11_SDK_VERSION=43 +EXTRADEFS = -DD3DX11_SDK_VERSION=43 -DD3DX_D3D_VERSION=11 MODULE = d3dx11_43.dll IMPORTLIB = d3dx11 -IMPORTS = d3dcompiler +IMPORTS = d3dcompiler ole32 +PARENTSRC = ../d3dx9_36 +DELAYIMPORTS = windowscodecs EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ async.c \ + d3dx_helpers.c \ d3dx11_43_main.c \ texture.c \ version.rc diff --git a/dlls/d3dx11_43/d3dx11_43_main.c b/dlls/d3dx11_43/d3dx11_43_main.c index 5dad027864fe..00c1db35e42c 100644 --- a/dlls/d3dx11_43/d3dx11_43_main.c +++ b/dlls/d3dx11_43/d3dx11_43_main.c @@ -66,12 +66,3 @@ HRESULT WINAPI D3DX11GetImageInfoFromFileW(const WCHAR *filename, ID3DX11ThreadP return E_NOTIMPL; } - -HRESULT WINAPI D3DX11GetImageInfoFromMemory(const void *src_data, SIZE_T src_data_size, ID3DX11ThreadPump *pump, - D3DX11_IMAGE_INFO *img_info, HRESULT *hresult) -{ - FIXME("src_data %p, src_data_size %Iu, pump %p, img_info %p, hresult %p stub!\n", - src_data, src_data_size, pump, img_info, hresult); - - return E_NOTIMPL; -} diff --git a/dlls/d3dx11_43/dxhelpers.h b/dlls/d3dx11_43/dxhelpers.h new file mode 100644 index 000000000000..bcdcc99ed5a5 --- /dev/null +++ b/dlls/d3dx11_43/dxhelpers.h @@ -0,0 +1,21 @@ +/* + * Copyright 2024 Connor McAdams for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "../d3dx9_36/d3dx_helpers.h" + +HRESULT get_image_info(const void *data, SIZE_T size, D3DX11_IMAGE_INFO *img_info); diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index 6f67530ab3a0..5bfa2b0c74c3 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -1265,12 +1265,6 @@ static void test_D3DX11GetImageInfoFromMemory(void) D3DX11_IMAGE_INFO info; HRESULT hr; - if (!strcmp(winetest_platform, "wine")) - { - skip("Skipping D3DX11GetImageInfoFromMemory() tests.\n"); - return; - } - hr = D3DX11GetImageInfoFromMemory(bmp_1bpp, sizeof(bmp_1bpp), NULL, &info, NULL); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); @@ -1284,7 +1278,7 @@ static void test_D3DX11GetImageInfoFromMemory(void) ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); hr = D3DX11GetImageInfoFromMemory(bmp_1bpp, sizeof(bmp_1bpp) - 1, NULL, &info, NULL); - ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + todo_wine ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); hr = D3DX11GetImageInfoFromMemory(bmp_1bpp + 1, sizeof(bmp_1bpp) - 1, NULL, &info, NULL); ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); @@ -1474,9 +1468,9 @@ static void test_D3DX11GetImageInfoFromMemory(void) check_dds_dx10_format(DXGI_FORMAT_B8G8R8X8_UNORM, DXGI_FORMAT_B8G8R8X8_UNORM, FALSE); check_dds_dx10_format(DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM, FALSE); /* Formats unsupported on d3dx10, but now supported on d3dx11. */ - check_dds_dx10_format(DXGI_FORMAT_BC6H_UF16, DXGI_FORMAT_BC6H_UF16, FALSE); - check_dds_dx10_format(DXGI_FORMAT_BC6H_SF16, DXGI_FORMAT_BC6H_SF16, FALSE); - check_dds_dx10_format(DXGI_FORMAT_BC7_UNORM, DXGI_FORMAT_BC7_UNORM, FALSE); + todo_wine check_dds_dx10_format(DXGI_FORMAT_BC6H_UF16, DXGI_FORMAT_BC6H_UF16, FALSE); + todo_wine check_dds_dx10_format(DXGI_FORMAT_BC6H_SF16, DXGI_FORMAT_BC6H_SF16, FALSE); + todo_wine check_dds_dx10_format(DXGI_FORMAT_BC7_UNORM, DXGI_FORMAT_BC7_UNORM, FALSE); test_dds_header_image_info(); } diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c index fe7ab8549d05..c793136d9d64 100644 --- a/dlls/d3dx11_43/texture.c +++ b/dlls/d3dx11_43/texture.c @@ -16,9 +16,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define COBJMACROS #include "d3dx11.h" #include "d3dcompiler.h" +#include "dxhelpers.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(d3dx); @@ -98,3 +100,110 @@ HRESULT WINAPI D3DX11LoadTextureFromTexture(ID3D11DeviceContext *context, ID3D11 return E_NOTIMPL; } + +static HRESULT d3dx11_image_info_from_d3dx_image(D3DX11_IMAGE_INFO *info, struct d3dx_image *image) +{ + DXGI_FORMAT format; + HRESULT hr = S_OK; + + memset(info, 0, sizeof(*info)); + if (image->image_file_format == D3DX_IMAGE_FILE_FORMAT_DDS_DXT10) + { + format = dxgi_format_from_dxt10_dds_d3dx_pixel_format_id(image->format); + info->ImageFileFormat = D3DX11_IFF_DDS; + } + else + { + if (image->image_file_format == D3DX_IMAGE_FILE_FORMAT_DDS) + format = dxgi_format_from_legacy_dds_d3dx_pixel_format_id(image->format); + else + format = DXGI_FORMAT_R8G8B8A8_UNORM; + info->ImageFileFormat = (D3DX11_IMAGE_FILE_FORMAT)image->image_file_format; + } + + if (format == DXGI_FORMAT_UNKNOWN) + { + WARN("Tried to load DDS file with unsupported format %#x.\n", image->format); + return E_FAIL; + } + + if (info->ImageFileFormat == D3DX11_IFF_FORCE_DWORD) + { + ERR("Unsupported d3dx image file.\n"); + return E_FAIL; + } + + info->Width = image->size.width; + info->Height = image->size.height; + info->Depth = image->size.depth; + info->ArraySize = image->layer_count; + info->MipLevels = image->mip_levels; + info->Format = format; + switch (image->resource_type) + { + case D3DX_RESOURCE_TYPE_TEXTURE_1D: + info->ResourceDimension = D3D11_RESOURCE_DIMENSION_TEXTURE1D; + break; + + case D3DX_RESOURCE_TYPE_TEXTURE_2D: + info->ResourceDimension = D3D11_RESOURCE_DIMENSION_TEXTURE2D; + break; + + case D3DX_RESOURCE_TYPE_CUBE_TEXTURE: + info->ResourceDimension = D3D11_RESOURCE_DIMENSION_TEXTURE2D; + info->MiscFlags |= D3D11_RESOURCE_MISC_TEXTURECUBE; + break; + + case D3DX_RESOURCE_TYPE_TEXTURE_3D: + info->ResourceDimension = D3D11_RESOURCE_DIMENSION_TEXTURE3D; + break; + + default: + ERR("Unhandled resource type %d.\n", image->resource_type); + hr = E_FAIL; + break; + } + + return hr; +} + +HRESULT get_image_info(const void *data, SIZE_T size, D3DX11_IMAGE_INFO *img_info) +{ + struct d3dx_image image; + HRESULT hr; + + if (!data || !size) + return E_FAIL; + + hr = d3dx_image_init(data, size, &image, 0, D3DX_IMAGE_INFO_ONLY | D3DX_IMAGE_SUPPORT_DXT10); + if (SUCCEEDED(hr)) + hr = d3dx11_image_info_from_d3dx_image(img_info, &image); + + if (FAILED(hr)) + { + WARN("Invalid or unsupported image file, hr %#lx.\n", hr); + return E_FAIL; + } + + return S_OK; +} + +HRESULT WINAPI D3DX11GetImageInfoFromMemory(const void *src_data, SIZE_T src_data_size, ID3DX11ThreadPump *pump, + D3DX11_IMAGE_INFO *img_info, HRESULT *hresult) +{ + HRESULT hr; + + TRACE("src_data %p, src_data_size %Iu, pump %p, img_info %p, hresult %p.\n", + src_data, src_data_size, pump, img_info, hresult); + + if (!src_data) + return E_FAIL; + + if (pump) + FIXME("Thread pump is not supported yet.\n"); + + hr = get_image_info(src_data, src_data_size, img_info); + if (hresult) + *hresult = hr; + return hr; +} diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index b2727ae7d8fc..45e6977e9d3b 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -451,6 +451,135 @@ static DXGI_FORMAT dxgi_format_from_d3dx_pixel_format_id(enum d3dx_pixel_format_ } } +/* + * These are mappings from legacy DDS header formats to DXGI formats. Some + * don't map to a DXGI_FORMAT at all, and some only map to the default format. + */ +DXGI_FORMAT dxgi_format_from_legacy_dds_d3dx_pixel_format_id(enum d3dx_pixel_format_id format) +{ + switch (format) + { + /* + * Some of these formats do have DXGI_FORMAT equivalents, but get + * mapped to DXGI_FORMAT_R8G8B8A8_UNORM instead. + */ + case D3DX_PIXEL_FORMAT_P8_UINT: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_P8_UINT_A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_R8G8B8X8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B8G8R8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B5G6R5_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B5G5R5X1_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B2G3R3_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B2G3R3A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B4G4R4A4_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_B4G4R4X4_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_L8A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_L4A4_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_L8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + + /* B10G10R10A2 doesn't exist in DXGI, both map to R10G10B10A2. */ + case D3DX_PIXEL_FORMAT_B10G10R10A2_UNORM: + case D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM: return DXGI_FORMAT_R10G10B10A2_UNORM; + + case D3DX_PIXEL_FORMAT_U16V16W16Q16_SNORM: return DXGI_FORMAT_R16G16B16A16_SNORM; + case D3DX_PIXEL_FORMAT_L16_UNORM: return DXGI_FORMAT_R16G16B16A16_UNORM; + case D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM: return DXGI_FORMAT_R16G16B16A16_UNORM; + case D3DX_PIXEL_FORMAT_R16G16_UNORM: return DXGI_FORMAT_R16G16_UNORM; + case D3DX_PIXEL_FORMAT_A8_UNORM: return DXGI_FORMAT_A8_UNORM; + case D3DX_PIXEL_FORMAT_R16_FLOAT: return DXGI_FORMAT_R16_FLOAT; + case D3DX_PIXEL_FORMAT_R16G16_FLOAT: return DXGI_FORMAT_R16G16_FLOAT; + case D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT: return DXGI_FORMAT_R16G16B16A16_FLOAT; + case D3DX_PIXEL_FORMAT_R32_FLOAT: return DXGI_FORMAT_R32_FLOAT; + case D3DX_PIXEL_FORMAT_R32G32_FLOAT: return DXGI_FORMAT_R32G32_FLOAT; + case D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT: return DXGI_FORMAT_R32G32B32A32_FLOAT; + case D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM: return DXGI_FORMAT_G8R8_G8B8_UNORM; + case D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM: return DXGI_FORMAT_R8G8_B8G8_UNORM; + + case D3DX_PIXEL_FORMAT_DXT1_UNORM: return DXGI_FORMAT_BC1_UNORM; + case D3DX_PIXEL_FORMAT_DXT2_UNORM: return DXGI_FORMAT_BC2_UNORM; + case D3DX_PIXEL_FORMAT_DXT3_UNORM: return DXGI_FORMAT_BC2_UNORM; + case D3DX_PIXEL_FORMAT_DXT4_UNORM: return DXGI_FORMAT_BC3_UNORM; + case D3DX_PIXEL_FORMAT_DXT5_UNORM: return DXGI_FORMAT_BC3_UNORM; + case D3DX_PIXEL_FORMAT_BC4_UNORM: return DXGI_FORMAT_BC4_UNORM; + case D3DX_PIXEL_FORMAT_BC4_SNORM: return DXGI_FORMAT_BC4_SNORM; + case D3DX_PIXEL_FORMAT_BC5_UNORM: return DXGI_FORMAT_BC5_UNORM; + case D3DX_PIXEL_FORMAT_BC5_SNORM: return DXGI_FORMAT_BC5_SNORM; + + /* These formats are known and explicitly unsupported on d3dx10+. */ + case D3DX_PIXEL_FORMAT_U8V8W8Q8_SNORM: + case D3DX_PIXEL_FORMAT_U8V8_SNORM: + case D3DX_PIXEL_FORMAT_U16V16_SNORM: + case D3DX_PIXEL_FORMAT_U8V8_SNORM_L8X8_UNORM: + case D3DX_PIXEL_FORMAT_U10V10W10_SNORM_A2_UNORM: + case D3DX_PIXEL_FORMAT_UYVY: + case D3DX_PIXEL_FORMAT_YUY2: + return DXGI_FORMAT_UNKNOWN; + + default: + FIXME("Unknown d3dx_pixel_format_id %#x.\n", format); + return DXGI_FORMAT_UNKNOWN; + } +} + +DXGI_FORMAT dxgi_format_from_dxt10_dds_d3dx_pixel_format_id(enum d3dx_pixel_format_id format) +{ + switch (format) + { + case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; + case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB: return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB; + case D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM: return DXGI_FORMAT_B8G8R8A8_UNORM; + case D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM: return DXGI_FORMAT_B8G8R8X8_UNORM; + case D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM: return DXGI_FORMAT_R10G10B10A2_UNORM; + case D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM: return DXGI_FORMAT_R16G16B16A16_UNORM; + case D3DX_PIXEL_FORMAT_R8_UNORM: return DXGI_FORMAT_R8_UNORM; + case D3DX_PIXEL_FORMAT_R8_SNORM: return DXGI_FORMAT_R8_SNORM; + case D3DX_PIXEL_FORMAT_R8G8_UNORM: return DXGI_FORMAT_R8G8_UNORM; + case D3DX_PIXEL_FORMAT_R16_UNORM: return DXGI_FORMAT_R16_UNORM; + case D3DX_PIXEL_FORMAT_R16G16_UNORM: return DXGI_FORMAT_R16G16_UNORM; + case D3DX_PIXEL_FORMAT_A8_UNORM: return DXGI_FORMAT_A8_UNORM; + case D3DX_PIXEL_FORMAT_R16_FLOAT: return DXGI_FORMAT_R16_FLOAT; + case D3DX_PIXEL_FORMAT_R16G16_FLOAT: return DXGI_FORMAT_R16G16_FLOAT; + case D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT: return DXGI_FORMAT_R16G16B16A16_FLOAT; + case D3DX_PIXEL_FORMAT_R32_FLOAT: return DXGI_FORMAT_R32_FLOAT; + case D3DX_PIXEL_FORMAT_R32G32_FLOAT: return DXGI_FORMAT_R32G32_FLOAT; + case D3DX_PIXEL_FORMAT_R32G32B32_FLOAT: return DXGI_FORMAT_R32G32B32_FLOAT; + case D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT: return DXGI_FORMAT_R32G32B32A32_FLOAT; + case D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM: return DXGI_FORMAT_G8R8_G8B8_UNORM; + case D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM: return DXGI_FORMAT_R8G8_B8G8_UNORM; + case D3DX_PIXEL_FORMAT_BC1_UNORM: return DXGI_FORMAT_BC1_UNORM; + case D3DX_PIXEL_FORMAT_BC1_UNORM_SRGB: return DXGI_FORMAT_BC1_UNORM_SRGB; + case D3DX_PIXEL_FORMAT_BC2_UNORM: return DXGI_FORMAT_BC2_UNORM; + case D3DX_PIXEL_FORMAT_BC2_UNORM_SRGB: return DXGI_FORMAT_BC2_UNORM_SRGB; + case D3DX_PIXEL_FORMAT_BC3_UNORM: return DXGI_FORMAT_BC3_UNORM; + case D3DX_PIXEL_FORMAT_BC3_UNORM_SRGB: return DXGI_FORMAT_BC3_UNORM_SRGB; + case D3DX_PIXEL_FORMAT_BC4_UNORM: return DXGI_FORMAT_BC4_UNORM; + case D3DX_PIXEL_FORMAT_BC4_SNORM: return DXGI_FORMAT_BC4_SNORM; + case D3DX_PIXEL_FORMAT_BC5_UNORM: return DXGI_FORMAT_BC5_UNORM; + case D3DX_PIXEL_FORMAT_BC5_SNORM: return DXGI_FORMAT_BC5_SNORM; + case D3DX_PIXEL_FORMAT_R16G16B16A16_SNORM: return DXGI_FORMAT_R16G16B16A16_SNORM; + case D3DX_PIXEL_FORMAT_R8G8B8A8_SNORM: return DXGI_FORMAT_R8G8B8A8_SNORM; + case D3DX_PIXEL_FORMAT_R8G8_SNORM: return DXGI_FORMAT_R8G8_SNORM; + case D3DX_PIXEL_FORMAT_R16G16_SNORM: return DXGI_FORMAT_R16G16_SNORM; + + /* + * These have DXGI_FORMAT equivalents, but are explicitly unsupported on + * d3dx10/d3dx11. + */ + case D3DX_PIXEL_FORMAT_B5G6R5_UNORM: + case D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM: + case D3DX_PIXEL_FORMAT_B4G4R4A4_UNORM: + return DXGI_FORMAT_UNKNOWN; + + default: + FIXME("Unhandled d3dx_pixel_format_id %#x.\n", format); + return DXGI_FORMAT_UNKNOWN; + } +} + void d3dx_get_next_mip_level_size(struct volume *size) { size->width = max(size->width / 2, 1); diff --git a/dlls/d3dx9_36/d3dx_helpers.h b/dlls/d3dx9_36/d3dx_helpers.h index 798cbccfc410..68c2244d315a 100644 --- a/dlls/d3dx9_36/d3dx_helpers.h +++ b/dlls/d3dx9_36/d3dx_helpers.h @@ -66,8 +66,45 @@ #define d3dx_blob_release(blob) ID3D10Blob_Release(blob) enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dxgi_format(DXGI_FORMAT format); +DXGI_FORMAT dxgi_format_from_legacy_dds_d3dx_pixel_format_id(enum d3dx_pixel_format_id format); +DXGI_FORMAT dxgi_format_from_dxt10_dds_d3dx_pixel_format_id(enum d3dx_pixel_format_id format); #endif /* D3DX_D3D_VERSION == 10 */ +#if D3DX_D3D_VERSION == 11 +#define COBJMACROS +#include "d3dx11.h" +#include "d3dcompiler.h" + +#define D3DERR_INVALIDCALL 0x8876086c +#define D3DX_ERROR_INVALID_DATA D3DX11_ERR_INVALID_DATA + +#define D3DX_DEFAULT D3DX11_DEFAULT + +#define D3DX_FILTER_NONE D3DX11_FILTER_NONE +#define D3DX_FILTER_POINT D3DX11_FILTER_POINT +#define D3DX_FILTER_LINEAR D3DX11_FILTER_LINEAR +#define D3DX_FILTER_TRIANGLE D3DX11_FILTER_TRIANGLE +#define D3DX_FILTER_BOX D3DX11_FILTER_BOX +#define D3DX_FILTER_MIRROR_U D3DX11_FILTER_MIRROR_U +#define D3DX_FILTER_MIRROR_V D3DX11_FILTER_MIRROR_V +#define D3DX_FILTER_MIRROR_W D3DX11_FILTER_MIRROR_W +#define D3DX_FILTER_MIRROR D3DX11_FILTER_MIRROR +#define D3DX_FILTER_DITHER D3DX11_FILTER_DITHER +#define D3DX_FILTER_DITHER_DIFFUSION D3DX11_FILTER_DITHER_DIFFUSION +#define D3DX_FILTER_SRGB_IN D3DX11_FILTER_SRGB_IN +#define D3DX_FILTER_SRGB_OUT D3DX11_FILTER_SRGB_OUT +#define D3DX_FILTER_SRGB D3DX11_FILTER_SRGB + +#define ID3DXBlob ID3D10Blob +#define d3dx_create_blob(size, blob) D3DCreateBlob(size, blob) +#define d3dx_blob_get_buffer_pointer(blob) ID3D10Blob_GetBufferPointer(blob) +#define d3dx_blob_release(blob) ID3D10Blob_Release(blob) + +enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dxgi_format(DXGI_FORMAT format); +DXGI_FORMAT dxgi_format_from_legacy_dds_d3dx_pixel_format_id(enum d3dx_pixel_format_id format); +DXGI_FORMAT dxgi_format_from_dxt10_dds_d3dx_pixel_format_id(enum d3dx_pixel_format_id format); +#endif /* D3DX_D3D_VERSION == 11 */ + #define D3DX_FILTER_INVALID_BITS 0xff80fff8 static inline HRESULT d3dx_validate_filter(uint32_t filter) { From 1306a108658f3c44ef78256fd27daf2b62a8c3e7 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 28 Aug 2024 11:41:42 -0400 Subject: [PATCH 0962/2542] d3dx11: Implement D3DX11CreateAsyncTextureInfoProcessor(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx11_42/d3dx11_42.spec | 2 +- dlls/d3dx11_42/tests/Makefile.in | 2 +- dlls/d3dx11_43/async.c | 64 +++ dlls/d3dx11_43/d3dx11_43.spec | 2 +- dlls/d3dx11_43/tests/Makefile.in | 2 +- dlls/d3dx11_43/tests/d3dx11.c | 848 +++++++++++++++++++++++++++++++ include/d3dx11.h | 2 +- include/d3dx11async.h | 2 + 8 files changed, 919 insertions(+), 5 deletions(-) diff --git a/dlls/d3dx11_42/d3dx11_42.spec b/dlls/d3dx11_42/d3dx11_42.spec index 2d125ea119f9..53d0407db6e6 100644 --- a/dlls/d3dx11_42/d3dx11_42.spec +++ b/dlls/d3dx11_42/d3dx11_42.spec @@ -13,7 +13,7 @@ @ stdcall -import D3DX11CreateAsyncResourceLoaderW(long wstr ptr) @ stub D3DX11CreateAsyncShaderPreprocessProcessor @ stub D3DX11CreateAsyncShaderResourceViewProcessor -@ stub D3DX11CreateAsyncTextureInfoProcessor +@ stdcall -import D3DX11CreateAsyncTextureInfoProcessor(ptr ptr) @ stub D3DX11CreateAsyncTextureProcessor @ stub D3DX11CreateShaderResourceViewFromFileA @ stub D3DX11CreateShaderResourceViewFromFileW diff --git a/dlls/d3dx11_42/tests/Makefile.in b/dlls/d3dx11_42/tests/Makefile.in index f18be76d9d5d..277099fb873b 100644 --- a/dlls/d3dx11_42/tests/Makefile.in +++ b/dlls/d3dx11_42/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = d3dx11_42.dll -IMPORTS = d3dx11_42 +IMPORTS = d3dx11_42 ole32 gdi32 PARENTSRC = ../../d3dx11_43/tests SOURCES = \ diff --git a/dlls/d3dx11_43/async.c b/dlls/d3dx11_43/async.c index 074a8529e4ef..ab730a696894 100644 --- a/dlls/d3dx11_43/async.c +++ b/dlls/d3dx11_43/async.c @@ -16,8 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define COBJMACROS #include "d3dx11.h" #include "d3dcompiler.h" +#include "dxhelpers.h" #include "wine/debug.h" @@ -214,6 +216,48 @@ static const ID3DX11DataLoaderVtbl resourcedataloadervtbl = resourcedataloader_Destroy }; +struct texture_info_processor +{ + ID3DX11DataProcessor ID3DX11DataProcessor_iface; + D3DX11_IMAGE_INFO *info; +}; + +static inline struct texture_info_processor *impl_from_ID3DX11DataProcessor(ID3DX11DataProcessor *iface) +{ + return CONTAINING_RECORD(iface, struct texture_info_processor, ID3DX11DataProcessor_iface); +} + +static HRESULT WINAPI texture_info_processor_Process(ID3DX11DataProcessor *iface, void *data, SIZE_T size) +{ + struct texture_info_processor *processor = impl_from_ID3DX11DataProcessor(iface); + + TRACE("iface %p, data %p, size %Iu.\n", iface, data, size); + return get_image_info(data, size, processor->info); +} + +static HRESULT WINAPI texture_info_processor_CreateDeviceObject(ID3DX11DataProcessor *iface, void **object) +{ + TRACE("iface %p, object %p.\n", iface, object); + return S_OK; +} + +static HRESULT WINAPI texture_info_processor_Destroy(ID3DX11DataProcessor *iface) +{ + struct texture_info_processor *processor = impl_from_ID3DX11DataProcessor(iface); + + TRACE("iface %p.\n", iface); + + free(processor); + return S_OK; +} + +static ID3DX11DataProcessorVtbl texture_info_processor_vtbl = +{ + texture_info_processor_Process, + texture_info_processor_CreateDeviceObject, + texture_info_processor_Destroy +}; + HRESULT WINAPI D3DX11CompileFromMemory(const char *data, SIZE_T data_size, const char *filename, const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *entry_point, const char *target, UINT sflags, UINT eflags, ID3DX11ThreadPump *pump, ID3D10Blob **shader, @@ -409,3 +453,23 @@ HRESULT WINAPI D3DX11CreateAsyncResourceLoaderW(HMODULE module, const WCHAR *res return S_OK; } + +HRESULT WINAPI D3DX11CreateAsyncTextureInfoProcessor(D3DX11_IMAGE_INFO *info, ID3DX11DataProcessor **processor) +{ + struct texture_info_processor *object; + + TRACE("info %p, processor %p.\n", info, processor); + + if (!processor) + return E_INVALIDARG; + + object = malloc(sizeof(*object)); + if (!object) + return E_OUTOFMEMORY; + + object->ID3DX11DataProcessor_iface.lpVtbl = &texture_info_processor_vtbl; + object->info = info; + + *processor = &object->ID3DX11DataProcessor_iface; + return S_OK; +} diff --git a/dlls/d3dx11_43/d3dx11_43.spec b/dlls/d3dx11_43/d3dx11_43.spec index 2d93b8d760ab..85116a8b2033 100644 --- a/dlls/d3dx11_43/d3dx11_43.spec +++ b/dlls/d3dx11_43/d3dx11_43.spec @@ -13,7 +13,7 @@ @ stdcall D3DX11CreateAsyncResourceLoaderW(long wstr ptr) @ stub D3DX11CreateAsyncShaderPreprocessProcessor @ stub D3DX11CreateAsyncShaderResourceViewProcessor -@ stub D3DX11CreateAsyncTextureInfoProcessor +@ stdcall D3DX11CreateAsyncTextureInfoProcessor(ptr ptr) @ stub D3DX11CreateAsyncTextureProcessor @ stub D3DX11CreateShaderResourceViewFromFileA @ stub D3DX11CreateShaderResourceViewFromFileW diff --git a/dlls/d3dx11_43/tests/Makefile.in b/dlls/d3dx11_43/tests/Makefile.in index 3283e251bdd0..4225e0896551 100644 --- a/dlls/d3dx11_43/tests/Makefile.in +++ b/dlls/d3dx11_43/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = d3dx11_43.dll -IMPORTS = d3dx11 +IMPORTS = d3dx11 ole32 gdi32 SOURCES = \ d3dx11.c diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index 5bfa2b0c74c3..89cecd2177e8 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -384,6 +384,795 @@ static const unsigned char noimage[4] = 0x11,0x22,0x33,0x44 }; +/* 1x1 1bpp bmp image */ +static const BYTE test_bmp_1bpp[] = +{ + 0x42, 0x4d, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x28, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf1, 0xf2, 0xf3, 0x80, 0xf4, 0xf5, 0xf6, 0x81, 0x00, 0x00, + 0x00, 0x00 +}; +static const BYTE test_bmp_1bpp_data[] = +{ + 0xf3, 0xf2, 0xf1, 0xff +}; + +/* 1x1 4bpp bmp image */ +static const BYTE test_bmp_4bpp[] = +{ + 0x42, 0x4d, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x28, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf1, 0xf2, 0xf3, 0x80, 0xf4, 0xf5, 0xf6, 0x81, 0x00, 0x00, + 0x00, 0x00 +}; +static const BYTE test_bmp_4bpp_data[] = +{ + 0xf3, 0xf2, 0xf1, 0xff +}; + +/* 1x1 8bpp bmp image */ +static const BYTE test_bmp_8bpp[] = +{ + 0x42, 0x4d, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x28, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf1, 0xf2, 0xf3, 0x80, 0xf4, 0xf5, 0xf6, 0x81, 0x00, 0x00, + 0x00, 0x00 +}; +static const BYTE test_bmp_8bpp_data[] = +{ + 0xf3, 0xf2, 0xf1, 0xff +}; + +/* 1x1 16bpp bmp image */ +static const BYTE test_bmp_16bpp[] = +{ + 0x42, 0x4d, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x42, 0x00, 0x00, 0x00, 0x00 +}; +static const BYTE test_bmp_16bpp_data[] = +{ + 0x84, 0x84, 0x73, 0xff +}; + +/* 1x1 24bpp bmp image */ +static const BYTE test_bmp_24bpp[] = +{ + 0x42, 0x4d, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x84, 0x84, 0x00, 0x00, 0x00 +}; +static const BYTE test_bmp_24bpp_data[] = +{ + 0x84, 0x84, 0x73, 0xff +}; + +/* 2x2 32bpp XRGB bmp image */ +static const BYTE test_bmp_32bpp_xrgb[] = +{ + 0x42, 0x4d, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xb0, 0xc0, 0x00, 0xa1, 0xb1, 0xc1, 0x00, 0xa2, 0xb2, + 0xc2, 0x00, 0xa3, 0xb3, 0xc3, 0x00 +}; +static const BYTE test_bmp_32bpp_xrgb_data[] = +{ + 0xc2, 0xb2, 0xa2, 0xff, 0xc3, 0xb3, 0xa3, 0xff, 0xc0, 0xb0, 0xa0, 0xff, 0xc1, 0xb1, 0xa1, 0xff + +}; + +/* 2x2 32bpp ARGB bmp image */ +static const BYTE test_bmp_32bpp_argb[] = +{ + 0x42, 0x4d, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xb0, 0xc0, 0x00, 0xa1, 0xb1, 0xc1, 0x00, 0xa2, 0xb2, + 0xc2, 0x00, 0xa3, 0xb3, 0xc3, 0x01 +}; +static const BYTE test_bmp_32bpp_argb_data[] = +{ + 0xc2, 0xb2, 0xa2, 0xff, 0xc3, 0xb3, 0xa3, 0xff, 0xc0, 0xb0, 0xa0, 0xff, 0xc1, 0xb1, 0xa1, 0xff + +}; + +/* 1x1 8bpp gray png image */ +static const BYTE test_png_8bpp_gray[] = +{ + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x7e, 0x9b, + 0x55, 0x00, 0x00, 0x00, 0x0a, 0x49, 0x44, 0x41, 0x54, 0x08, 0xd7, 0x63, 0xf8, 0x0f, 0x00, 0x01, + 0x01, 0x01, 0x00, 0x1b, 0xb6, 0xee, 0x56, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, + 0x42, 0x60, 0x82 +}; +static const BYTE test_png_8bpp_gray_data[] = +{ + 0xff, 0xff, 0xff, 0xff +}; + +/* 1x1 jpg image */ +static const BYTE test_jpg[] = +{ + 0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x01, 0x2c, + 0x01, 0x2c, 0x00, 0x00, 0xff, 0xdb, 0x00, 0x43, 0x00, 0x05, 0x03, 0x04, 0x04, 0x04, 0x03, 0x05, + 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x06, 0x07, 0x0c, 0x08, 0x07, 0x07, 0x07, 0x07, 0x0f, 0x0b, + 0x0b, 0x09, 0x0c, 0x11, 0x0f, 0x12, 0x12, 0x11, 0x0f, 0x11, 0x11, 0x13, 0x16, 0x1c, 0x17, 0x13, + 0x14, 0x1a, 0x15, 0x11, 0x11, 0x18, 0x21, 0x18, 0x1a, 0x1d, 0x1d, 0x1f, 0x1f, 0x1f, 0x13, 0x17, + 0x22, 0x24, 0x22, 0x1e, 0x24, 0x1c, 0x1e, 0x1f, 0x1e, 0xff, 0xdb, 0x00, 0x43, 0x01, 0x05, 0x05, + 0x05, 0x07, 0x06, 0x07, 0x0e, 0x08, 0x08, 0x0e, 0x1e, 0x14, 0x11, 0x14, 0x1e, 0x1e, 0x1e, 0x1e, + 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, + 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, + 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0xff, 0xc0, + 0x00, 0x11, 0x08, 0x00, 0x01, 0x00, 0x01, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, + 0x01, 0xff, 0xc4, 0x00, 0x15, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xff, 0xc4, 0x00, 0x14, 0x10, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc4, + 0x00, 0x14, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xc4, 0x00, 0x14, 0x11, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01, + 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00, 0xb2, 0xc0, 0x07, 0xff, 0xd9 +}; +static const BYTE test_jpg_data[] = +{ + 0xff, 0xff, 0xff, 0xff +}; + +/* 1x1 gif image */ +static const BYTE test_gif[] = +{ + 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x01, 0x00, 0x01, 0x00, 0x80, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x02, 0x44, + 0x01, 0x00, 0x3b +}; +static const BYTE test_gif_data[] = +{ + 0xff, 0xff, 0xff, 0xff +}; + +/* 1x1 tiff image */ +static const BYTE test_tiff[] = +{ + 0x49, 0x49, 0x2a, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xfe, 0x00, + 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x02, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x03, 0x01, + 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x01, 0x03, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0d, 0x01, 0x02, 0x00, 0x1b, 0x00, 0x00, 0x00, 0xd8, 0x00, + 0x00, 0x00, 0x11, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x12, 0x01, + 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x15, 0x01, 0x03, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x16, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x40, 0x00, + 0x00, 0x00, 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1a, 0x01, + 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x1b, 0x01, 0x05, 0x00, 0x01, 0x00, + 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x1c, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x28, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x2f, 0x68, 0x6f, 0x6d, 0x65, 0x2f, 0x6d, 0x65, + 0x68, 0x2f, 0x44, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x74, + 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, + 0x00, 0x00, 0x00, 0x01 +}; +static const BYTE test_tiff_data[] = +{ + 0x00, 0x00, 0x00, 0xff +}; + +/* 1x1 alpha dds image */ +static const BYTE test_dds_alpha[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff +}; +static const BYTE test_dds_alpha_data[] = +{ + 0xff +}; + +/* 1x1 luminance dds image */ +static const BYTE test_dds_luminance[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x82 +}; +static const BYTE test_dds_luminance_data[] = +{ + 0x82, 0x82, 0x82, 0xff +}; + +/* 1x1 16bpp dds image */ +static const BYTE test_dds_16bpp[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, + 0xe0, 0x03, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0e, 0x42 +}; +static const BYTE test_dds_16bpp_data[] = +{ + 0x84, 0x84, 0x73, 0xff +}; + +/* 1x1 24bpp dds image */ +static const BYTE test_dds_24bpp[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, + 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x70, 0x81, 0x83 +}; +static const BYTE test_dds_24bpp_data[] = +{ + 0x83, 0x81, 0x70, 0xff +}; + +/* 1x1 32bpp dds image */ +static const BYTE test_dds_32bpp[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, + 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x70, 0x81, 0x83, 0xff +}; +static const BYTE test_dds_32bpp_data[] = +{ + 0x83, 0x81, 0x70, 0xff +}; + +/* 1x1 64bpp dds image */ +static const BYTE test_dds_64bpp[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x0f, 0x10, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x83, 0x83, 0x81, 0x81, 0x70, 0x70, 0xff, 0xff +}; +static const BYTE test_dds_64bpp_data[] = +{ + 0x83, 0x83, 0x81, 0x81, 0x70, 0x70, 0xff, 0xff +}; + +/* 1x1 96bpp dds image */ +static const BYTE test_dds_96bpp[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x0f, 0x10, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x31, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x84, 0x83, 0x03, 0x3f, 0x82, 0x81, 0x01, 0x3f, 0xe2, 0xe0, 0xe0, 0x3e +}; +static const BYTE test_dds_96bpp_data[] = +{ + 0x84, 0x83, 0x03, 0x3f, 0x82, 0x81, 0x01, 0x3f, 0xe2, 0xe0, 0xe0, 0x3e +}; + +/* 1x1 128bpp dds image */ +static const BYTE test_dds_128bpp[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x0f, 0x10, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x84, 0x83, 0x03, 0x3f, 0x82, 0x81, 0x01, 0x3f, 0xe2, 0xe0, 0xe0, 0x3e, 0x00, 0x00, 0x80, 0x3f +}; +static const BYTE test_dds_128bpp_data[] = +{ + 0x84, 0x83, 0x03, 0x3f, 0x82, 0x81, 0x01, 0x3f, 0xe2, 0xe0, 0xe0, 0x3e, 0x00, 0x00, 0x80, 0x3f + +}; + +/* 4x4 DXT1 dds image */ +static const BYTE test_dds_dxt1[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2a, 0x31, 0xf5, 0xbc, 0xe3, 0x6e, 0x2a, 0x3a +}; +static const BYTE test_dds_dxt1_data[] = +{ + 0x2a, 0x31, 0xf5, 0xbc, 0xe3, 0x6e, 0x2a, 0x3a +}; + +/* 4x8 DXT1 dds image */ +static const BYTE test_dds_dxt1_4x8[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0a, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x92, 0xce, 0x09, 0x7a, 0x5d, 0xdd, 0xa7, 0x26, 0x55, 0xde, 0xaf, 0x52, 0xbc, 0xf8, 0x6c, 0x44, + 0x53, 0xbd, 0x8b, 0x72, 0x55, 0x33, 0x88, 0xaa, 0xb2, 0x9c, 0x6c, 0x93, 0x55, 0x00, 0x55, 0x00, + 0x0f, 0x9c, 0x0f, 0x9c, 0x00, 0x00, 0x00, 0x00, +}; +static const BYTE test_dds_dxt1_4x8_data[] = +{ + 0x92, 0xce, 0x09, 0x7a, 0x5d, 0xdd, 0xa7, 0x26, 0x55, 0xde, 0xaf, 0x52, 0xbc, 0xf8, 0x6c, 0x44, +}; + +/* 4x4 DXT2 dds image */ +static const BYTE test_dds_dxt2[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xde, 0xc4, 0x10, 0x2f, 0xbf, 0xff, 0x7b, + 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x53, 0x00, 0x00, 0x52, 0x52, 0x55, 0x55, + 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0x59, 0x00, 0x00, 0x54, 0x55, 0x55, 0x55 +}; +static const BYTE test_dds_dxt2_data[] = +{ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xde, 0xc4, 0x10, 0x2f, 0xbf, 0xff, 0x7b + +}; + +/* 1x3 DXT3 dds image */ +static const BYTE test_dds_dxt3[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0a, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x92, 0x38, 0x84, 0x00, 0xff, 0x55, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x53, 0x8b, 0x53, 0x8b, 0x00, 0x00, 0x00, 0x00 +}; +static const BYTE test_dds_dxt3_data[] = +{ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x4e, 0x92, 0xd6, 0x83, 0x00, 0xaa, 0x55, 0x55 + +}; + +/* 4x4 DXT4 dds image */ +static const BYTE test_dds_dxt4[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xde, 0xc4, 0x10, 0x2f, 0xbf, 0xff, 0x7b, + 0xff, 0x00, 0x40, 0x02, 0x24, 0x49, 0x92, 0x24, 0x57, 0x53, 0x00, 0x00, 0x52, 0x52, 0x55, 0x55, + 0xff, 0x00, 0x48, 0x92, 0x24, 0x49, 0x92, 0x24, 0xce, 0x59, 0x00, 0x00, 0x54, 0x55, 0x55, 0x55 +}; +static const BYTE test_dds_dxt4_data[] = +{ + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xde, 0xc4, 0x10, 0x2f, 0xbf, 0xff, 0x7b + +}; + +/* 4x2 DXT5 dds image */ +static const BYTE test_dds_dxt5[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x87, 0x0f, 0x78, 0x05, 0x05, 0x50, 0x50 +}; +static const BYTE test_dds_dxt5_data[] = +{ + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x87, 0x0f, 0x78, 0x05, 0x05, 0x05, 0x05 + +}; + +/* 8x8 DXT5 dds image */ +static const BYTE test_dds_dxt5_8x8[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0a, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x8a, 0x72, 0x39, 0x5e, 0x5e, 0xfa, 0xa8, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0xd7, 0xd5, 0x4a, 0x2d, 0x2d, 0xad, 0xfd, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x9a, 0x73, 0x83, 0xa0, 0xf0, 0x78, 0x78, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x5b, 0x06, 0x19, 0x00, 0xe8, 0x78, 0x58, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, 0xbe, 0x8c, 0x49, 0x35, 0xb5, 0xff, 0x7f, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x84, 0xab, 0x59, 0x11, 0xff, 0x11, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x6a, 0xf0, 0x6a, 0x00, 0x00, 0x00, 0x00, +}; +static const BYTE test_dds_dxt5_8x8_data[] = +{ + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x8a, 0x72, 0x39, 0x5e, 0x5e, 0xfa, 0xa8, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0xd7, 0xd5, 0x4a, 0x2d, 0x2d, 0xad, 0xfd, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x9a, 0x73, 0x83, 0xa0, 0xf0, 0x78, 0x78, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x5b, 0x06, 0x19, 0x00, 0xe8, 0x78, 0x58, +}; + +/* 4x4 BC4 dds image */ +static const BYTE test_dds_bc4[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0a, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x42, 0x43, 0x34, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xd9, 0x15, 0xbc, 0x41, 0x5b, 0xa3, 0x3d, 0x3a, 0x8f, 0x3d, 0x45, 0x81, 0x20, 0x45, 0x81, 0x20, + 0x6f, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; +static const BYTE test_dds_bc4_data[] = +{ + 0xd9, 0x15, 0xbc, 0x41, 0x5b, 0xa3, 0x3d, 0x3a +}; + +/* 6x3 BC5 dds image */ +static const BYTE test_dds_bc5[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0a, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x42, 0x43, 0x35, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x9f, 0x28, 0x73, 0xac, 0xd5, 0x80, 0xaa, 0xd5, 0x70, 0x2c, 0x4e, 0xd6, 0x76, 0x1d, 0xd6, 0x76, + 0xd5, 0x0f, 0xc3, 0x50, 0x96, 0xcf, 0x53, 0x96, 0xdf, 0x16, 0xc3, 0x50, 0x96, 0xcf, 0x53, 0x96, + 0x83, 0x55, 0x08, 0x83, 0x30, 0x08, 0x83, 0x30, 0x79, 0x46, 0x31, 0x1c, 0xc3, 0x31, 0x1c, 0xc3, + 0x6d, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; +static const BYTE test_dds_bc5_data[] = +{ + 0x95, 0x35, 0xe2, 0xa3, 0xf5, 0xd2, 0x28, 0x68, 0x65, 0x32, 0x7c, 0x4e, 0xdb, 0xe4, 0x56, 0x0a, + 0xb9, 0x33, 0xaf, 0xf0, 0x52, 0xbe, 0xed, 0x27, 0xb4, 0x2e, 0xa6, 0x60, 0x4e, 0xb6, 0x5d, 0x3f + +}; + +/* 4x4 DXT1 cube map */ +static const BYTE test_dds_cube[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0a, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00, + 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, + 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00, 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, + 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00, + 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, + 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00, 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, + 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00, + 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, + 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00, 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, + 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00 +}; +static const BYTE test_dds_cube_data[] = +{ + 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, + 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, + 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, + 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, + 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, + 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7 +}; + +/* 4x4x2 DXT3 volume dds, 2 mipmaps */ +static const BYTE test_dds_volume[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x8a, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00, + 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x87, 0x0f, 0x78, 0x05, 0x05, 0x50, 0x50, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x87, 0x0f, 0x78, 0x05, 0x05, 0x50, 0x50, + 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x7e, 0xcf, 0x79, 0x01, 0x54, 0x5c, 0x5c, + 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x84, 0xef, 0x7b, 0xaa, 0xab, 0xab, 0xab +}; +static const BYTE test_dds_volume_data[] = +{ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x87, 0x0f, 0x78, 0x05, 0x05, 0x50, 0x50, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x87, 0x0f, 0x78, 0x05, 0x05, 0x50, 0x50, +}; + +/* 1x1 wmp image */ +static const BYTE test_wmp[] = +{ + 0x49, 0x49, 0xbc, 0x01, 0x20, 0x00, 0x00, 0x00, 0x24, 0xc3, 0xdd, 0x6f, 0x03, 0x4e, 0xfe, 0x4b, + 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x01, 0xbc, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0xbc, + 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbc, 0x04, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x81, 0xbc, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x82, 0xbc, 0x0b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x25, 0x06, 0xc0, 0x42, 0x83, 0xbc, + 0x0b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x25, 0x06, 0xc0, 0x42, 0xc0, 0xbc, 0x04, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0xc1, 0xbc, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x92, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x4d, 0x50, 0x48, 0x4f, 0x54, 0x4f, 0x00, 0x11, 0x45, + 0xc0, 0x71, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0xc0, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x25, 0xff, 0xff, 0x00, 0x00, 0x01, + 0x01, 0xc8, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x10, 0x10, 0xa6, 0x18, 0x8c, 0x21, + 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x4e, 0x0f, 0x3a, 0x4c, 0x94, 0x9d, 0xba, 0x79, 0xe7, 0x38, + 0x4c, 0xcf, 0x14, 0xc3, 0x43, 0x91, 0x88, 0xfb, 0xdc, 0xe0, 0x7c, 0x34, 0x70, 0x9b, 0x28, 0xa9, + 0x18, 0x74, 0x62, 0x87, 0x8e, 0xe4, 0x68, 0x5f, 0xb9, 0xcc, 0x0e, 0xe1, 0x8c, 0x76, 0x3a, 0x9b, + 0x82, 0x76, 0x71, 0x13, 0xde, 0x50, 0xd4, 0x2d, 0xc2, 0xda, 0x1e, 0x3b, 0xa6, 0xa1, 0x62, 0x7b, + 0xca, 0x1a, 0x85, 0x4b, 0x6e, 0x74, 0xec, 0x60 +}; +static const BYTE test_wmp_data[] = +{ + 0xff, 0xff, 0xff, 0xff +}; + +static const struct test_image +{ + const BYTE *data; + unsigned int size; + const BYTE *expected_data; + D3DX11_IMAGE_INFO expected_info; + D3D11_SRV_DIMENSION expected_srv_dimension; +} +test_image[] = +{ + { + test_bmp_1bpp, sizeof(test_bmp_1bpp), test_bmp_1bpp_data, + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_bmp_4bpp, sizeof(test_bmp_4bpp), test_bmp_4bpp_data, + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_bmp_8bpp, sizeof(test_bmp_8bpp), test_bmp_8bpp_data, + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_bmp_16bpp, sizeof(test_bmp_16bpp), test_bmp_16bpp_data, + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_bmp_24bpp, sizeof(test_bmp_24bpp), test_bmp_24bpp_data, + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_bmp_32bpp_xrgb, sizeof(test_bmp_32bpp_xrgb), test_bmp_32bpp_xrgb_data, + {2, 2, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_bmp_32bpp_argb, sizeof(test_bmp_32bpp_argb), test_bmp_32bpp_argb_data, + {2, 2, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_BMP}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_png_8bpp_gray, sizeof(test_png_8bpp_gray), test_png_8bpp_gray_data, + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_PNG}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_jpg, sizeof(test_jpg), test_jpg_data, + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_JPG}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_gif, sizeof(test_gif), test_gif_data, + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_GIF}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_tiff, sizeof(test_tiff), test_tiff_data, + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_TIFF}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_dds_alpha, sizeof(test_dds_alpha), test_dds_alpha_data, + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_dds_luminance, sizeof(test_dds_luminance), test_dds_luminance_data, + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_dds_16bpp, sizeof(test_dds_16bpp), test_dds_16bpp_data, + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_dds_24bpp, sizeof(test_dds_24bpp), test_dds_24bpp_data, + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_dds_32bpp, sizeof(test_dds_32bpp), test_dds_32bpp_data, + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_dds_64bpp, sizeof(test_dds_64bpp), test_dds_64bpp_data, + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R16G16B16A16_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_dds_96bpp, sizeof(test_dds_96bpp), test_dds_96bpp_data, + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R32G32B32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_dds_128bpp, sizeof(test_dds_128bpp), test_dds_128bpp_data, + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R32G32B32A32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_dds_dxt1, sizeof(test_dds_dxt1), test_dds_dxt1_data, + {4, 4, 1, 1, 1, 0, DXGI_FORMAT_BC1_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_dds_dxt1_4x8, sizeof(test_dds_dxt1_4x8), test_dds_dxt1_4x8_data, + {4, 8, 1, 1, 4, 0, DXGI_FORMAT_BC1_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_dds_dxt2, sizeof(test_dds_dxt2), test_dds_dxt2_data, + {4, 4, 1, 1, 3, 0, DXGI_FORMAT_BC2_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_dds_dxt3, sizeof(test_dds_dxt3), test_dds_dxt3_data, + {1, 3, 1, 1, 2, 0, DXGI_FORMAT_BC2_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_dds_dxt4, sizeof(test_dds_dxt4), test_dds_dxt4_data, + {4, 4, 1, 1, 3, 0, DXGI_FORMAT_BC3_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_dds_dxt5, sizeof(test_dds_dxt5), test_dds_dxt5_data, + {4, 2, 1, 1, 1, 0, DXGI_FORMAT_BC3_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_dds_dxt5_8x8, sizeof(test_dds_dxt5_8x8), test_dds_dxt5_8x8_data, + {8, 8, 1, 1, 4, 0, DXGI_FORMAT_BC3_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_dds_bc4, sizeof(test_dds_bc4), test_dds_bc4_data, + {4, 4, 1, 1, 3, 0, DXGI_FORMAT_BC4_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_dds_bc5, sizeof(test_dds_bc5), test_dds_bc5_data, + {6, 3, 1, 1, 3, 0, DXGI_FORMAT_BC5_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, + { + test_dds_cube, sizeof(test_dds_cube), test_dds_cube_data, + {4, 4, 1, 6, 3, 0x4, DXGI_FORMAT_BC1_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURECUBE + }, + { + test_dds_volume, sizeof(test_dds_volume), test_dds_volume_data, + {4, 4, 2, 1, 3, 0, DXGI_FORMAT_BC2_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, D3DX11_IFF_DDS}, + D3D11_SRV_DIMENSION_TEXTURE3D + }, + { + test_wmp, sizeof(test_wmp), test_wmp_data, + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_WMP}, + D3D11_SRV_DIMENSION_TEXTURE2D + }, +}; + +static void check_image_info(D3DX11_IMAGE_INFO *image_info, const struct test_image *image, unsigned int line) +{ + ok_(__FILE__, line)(image_info->Width == image->expected_info.Width, + "Got unexpected Width %u, expected %u.\n", + image_info->Width, image->expected_info.Width); + ok_(__FILE__, line)(image_info->Height == image->expected_info.Height, + "Got unexpected Height %u, expected %u.\n", + image_info->Height, image->expected_info.Height); + ok_(__FILE__, line)(image_info->Depth == image->expected_info.Depth, + "Got unexpected Depth %u, expected %u.\n", + image_info->Depth, image->expected_info.Depth); + ok_(__FILE__, line)(image_info->ArraySize == image->expected_info.ArraySize, + "Got unexpected ArraySize %u, expected %u.\n", + image_info->ArraySize, image->expected_info.ArraySize); + ok_(__FILE__, line)(image_info->MipLevels == image->expected_info.MipLevels, + "Got unexpected MipLevels %u, expected %u.\n", + image_info->MipLevels, image->expected_info.MipLevels); + ok_(__FILE__, line)(image_info->MiscFlags == image->expected_info.MiscFlags, + "Got unexpected MiscFlags %#x, expected %#x.\n", + image_info->MiscFlags, image->expected_info.MiscFlags); + ok_(__FILE__, line)(image_info->Format == image->expected_info.Format, + "Got unexpected Format %#x, expected %#x.\n", + image_info->Format, image->expected_info.Format); + ok_(__FILE__, line)(image_info->ResourceDimension == image->expected_info.ResourceDimension, + "Got unexpected ResourceDimension %u, expected %u.\n", + image_info->ResourceDimension, image->expected_info.ResourceDimension); + ok_(__FILE__, line)(image_info->ImageFileFormat == image->expected_info.ImageFileFormat, + "Got unexpected ImageFileFormat %u, expected %u.\n", + image_info->ImageFileFormat, image->expected_info.ImageFileFormat); +} + #define check_image_info_values(info, width, height, depth, array_size, mip_levels, misc_flags, format, resource_dimension, \ image_file_format, wine_todo) \ check_image_info_values_(__LINE__, info, width, height, depth, array_size, mip_levels, misc_flags, format, resource_dimension, \ @@ -663,6 +1452,64 @@ static void test_D3DX11CreateAsyncResourceLoader(void) ok(hr == D3DX11_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); } +static void test_D3DX11CreateAsyncTextureInfoProcessor(void) +{ + ID3DX11DataProcessor *dp; + D3DX11_IMAGE_INFO info; + HRESULT hr; + int i; + + CoInitialize(NULL); + + hr = D3DX11CreateAsyncTextureInfoProcessor(NULL, NULL); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); + + hr = D3DX11CreateAsyncTextureInfoProcessor(&info, NULL); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); + + hr = D3DX11CreateAsyncTextureInfoProcessor(NULL, &dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + if (0) + { + /* Crashes on native. */ + hr = ID3DX11DataProcessor_Process(dp, (void *)test_image[0].data, test_image[0].size); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + } + + hr = ID3DX11DataProcessor_Destroy(dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = D3DX11CreateAsyncTextureInfoProcessor(&info, &dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = ID3DX11DataProcessor_Process(dp, (void *)test_image[0].data, 0); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11DataProcessor_Process(dp, NULL, test_image[0].size); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + + for (i = 0; i < ARRAY_SIZE(test_image); ++i) + { + winetest_push_context("Test %u", i); + + hr = ID3DX11DataProcessor_Process(dp, (void *)test_image[i].data, test_image[i].size); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + check_image_info(&info, test_image + i, __LINE__); + + winetest_pop_context(); + } + + hr = ID3DX11DataProcessor_CreateDeviceObject(dp, NULL); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = ID3DX11DataProcessor_Destroy(dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + CoUninitialize(); +} + static HRESULT WINAPI test_d3dinclude_open(ID3DInclude *iface, D3D_INCLUDE_TYPE include_type, const char *filename, const void *parent_data, const void **data, UINT *bytes) { @@ -1480,6 +2327,7 @@ START_TEST(d3dx11) test_D3DX11CreateAsyncMemoryLoader(); test_D3DX11CreateAsyncFileLoader(); test_D3DX11CreateAsyncResourceLoader(); + test_D3DX11CreateAsyncTextureInfoProcessor(); test_D3DX11CompileFromFile(); test_D3DX11GetImageInfoFromMemory(); } diff --git a/include/d3dx11.h b/include/d3dx11.h index e1557857ffa5..7514328f4ce1 100644 --- a/include/d3dx11.h +++ b/include/d3dx11.h @@ -28,8 +28,8 @@ #include "d3d11.h" #include "d3dx11core.h" -#include "d3dx11async.h" #include "d3dx11tex.h" +#include "d3dx11async.h" #define _FACDD 0x876 #define MAKE_DDHRESULT(code) MAKE_HRESULT(SEVERITY_ERROR, _FACDD, code) diff --git a/include/d3dx11async.h b/include/d3dx11async.h index 2d85e4aa46f3..86f65ecb8878 100644 --- a/include/d3dx11async.h +++ b/include/d3dx11async.h @@ -44,6 +44,8 @@ HRESULT WINAPI D3DX11CompileFromFileW(const WCHAR *filename, const D3D10_SHADER_ ID3D10Include *include, const char *entry_point, const char *target, UINT sflags, UINT eflags, ID3DX11ThreadPump *pump, ID3D10Blob **shader, ID3D10Blob **error_messages, HRESULT *hresult); +HRESULT WINAPI D3DX11CreateAsyncTextureInfoProcessor(D3DX11_IMAGE_INFO *info, ID3DX11DataProcessor **processor); + #ifdef __cplusplus } #endif From dbfbe3526d3c35df65ba4ece638cf69264308bbf Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 28 Aug 2024 12:04:56 -0400 Subject: [PATCH 0963/2542] d3dx11: Add support for the thread pump argument in D3DX11GetImageInfoFromMemory(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx11_43/tests/d3dx11.c | 119 +++++++++++++++++++++++++++++++++- dlls/d3dx11_43/texture.c | 19 +++++- 2 files changed, 136 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index 89cecd2177e8..2b32b682af4b 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -163,6 +163,95 @@ static uint32_t get_bpp_from_format(DXGI_FORMAT format) } } +static HRESULT WINAPI D3DX11ThreadPump_QueryInterface(ID3DX11ThreadPump *iface, REFIID riid, void **out) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static ULONG WINAPI D3DX11ThreadPump_AddRef(ID3DX11ThreadPump *iface) +{ + return 2; +} + +static ULONG WINAPI D3DX11ThreadPump_Release(ID3DX11ThreadPump *iface) +{ + return 1; +} + +static int add_work_item_count = 1; + +static HRESULT WINAPI D3DX11ThreadPump_AddWorkItem(ID3DX11ThreadPump *iface, ID3DX11DataLoader *loader, + ID3DX11DataProcessor *processor, HRESULT *result, void **object) +{ + SIZE_T size; + void *data; + HRESULT hr; + + ok(!add_work_item_count++, "unexpected call\n"); + + hr = ID3DX11DataLoader_Load(loader); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11DataLoader_Decompress(loader, &data, &size); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11DataProcessor_Process(processor, data, size); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11DataProcessor_CreateDeviceObject(processor, object); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11DataProcessor_Destroy(processor); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11DataLoader_Destroy(loader); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + if (result) *result = S_OK; + return S_OK; +} + +static UINT WINAPI D3DX11ThreadPump_GetWorkItemCount(ID3DX11ThreadPump *iface) +{ + ok(0, "unexpected call\n"); + return 0; +} + +static HRESULT WINAPI D3DX11ThreadPump_WaitForAllItems(ID3DX11ThreadPump *iface) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI D3DX11ThreadPump_ProcessDeviceWorkItems(ID3DX11ThreadPump *iface, UINT count) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI D3DX11ThreadPump_PurgeAllItems(ID3DX11ThreadPump *iface) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI D3DX11ThreadPump_GetQueueStatus(ID3DX11ThreadPump *iface, UINT *queue, + UINT *processqueue, UINT *devicequeue) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static ID3DX11ThreadPumpVtbl D3DX11ThreadPumpVtbl = +{ + D3DX11ThreadPump_QueryInterface, + D3DX11ThreadPump_AddRef, + D3DX11ThreadPump_Release, + D3DX11ThreadPump_AddWorkItem, + D3DX11ThreadPump_GetWorkItemCount, + D3DX11ThreadPump_WaitForAllItems, + D3DX11ThreadPump_ProcessDeviceWorkItems, + D3DX11ThreadPump_PurgeAllItems, + D3DX11ThreadPump_GetQueueStatus +}; +static ID3DX11ThreadPump thread_pump = { &D3DX11ThreadPumpVtbl }; + /* 1x1 bmp (1 bpp) */ static const unsigned char bmp_1bpp[] = { @@ -2110,7 +2199,10 @@ static void test_dds_header_image_info(void) static void test_D3DX11GetImageInfoFromMemory(void) { D3DX11_IMAGE_INFO info; - HRESULT hr; + HRESULT hr, hr2; + uint32_t i; + + CoInitialize(NULL); hr = D3DX11GetImageInfoFromMemory(bmp_1bpp, sizeof(bmp_1bpp), NULL, &info, NULL); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); @@ -2249,6 +2341,29 @@ static void test_D3DX11GetImageInfoFromMemory(void) check_image_info_values(&info, 4, 4, 2, 1, 3, 0, DXGI_FORMAT_BC2_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, D3DX11_IFF_DDS, FALSE); + for (i = 0; i < ARRAY_SIZE(test_image); ++i) + { + winetest_push_context("Test %u", i); + + hr2 = 0xdeadbeef; + hr = D3DX11GetImageInfoFromMemory(test_image[i].data, test_image[i].size, NULL, &info, &hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + if (hr == S_OK) + check_image_info(&info, test_image + i, __LINE__); + + winetest_pop_context(); + } + + hr2 = 0xdeadbeef; + add_work_item_count = 0; + hr = D3DX11GetImageInfoFromMemory(test_image[0].data, test_image[0].size, &thread_pump, &info, &hr2); + ok(add_work_item_count == 1, "Got unexpected add_work_item_count %u.\n", add_work_item_count); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + check_image_info(&info, test_image, __LINE__); + check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC1_UNORM); check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('D','X','T','2'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC2_UNORM); check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('D','X','T','3'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC2_UNORM); @@ -2320,6 +2435,8 @@ static void test_D3DX11GetImageInfoFromMemory(void) todo_wine check_dds_dx10_format(DXGI_FORMAT_BC7_UNORM, DXGI_FORMAT_BC7_UNORM, FALSE); test_dds_header_image_info(); + + CoUninitialize(); } START_TEST(d3dx11) diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c index c793136d9d64..dda3393541d1 100644 --- a/dlls/d3dx11_43/texture.c +++ b/dlls/d3dx11_43/texture.c @@ -200,7 +200,24 @@ HRESULT WINAPI D3DX11GetImageInfoFromMemory(const void *src_data, SIZE_T src_dat return E_FAIL; if (pump) - FIXME("Thread pump is not supported yet.\n"); + { + ID3DX11DataProcessor *processor; + ID3DX11DataLoader *loader; + + if (FAILED((hr = D3DX11CreateAsyncMemoryLoader(src_data, src_data_size, &loader)))) + return hr; + if (FAILED((hr = D3DX11CreateAsyncTextureInfoProcessor(img_info, &processor)))) + { + ID3DX11DataLoader_Destroy(loader); + return hr; + } + if (FAILED((hr = ID3DX11ThreadPump_AddWorkItem(pump, loader, processor, hresult, NULL)))) + { + ID3DX11DataLoader_Destroy(loader); + ID3DX11DataProcessor_Destroy(processor); + } + return hr; + } hr = get_image_info(src_data, src_data_size, img_info); if (hresult) From c2613ac35ac1d9c4ad339ebb6d1935e73af819c8 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 28 Aug 2024 12:46:36 -0400 Subject: [PATCH 0964/2542] d3dx11: Implement D3DX11GetImageInfoFromFile{A,W}(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/async.c | 30 -------------- dlls/d3dx10_43/dxhelpers.h | 1 - dlls/d3dx11_43/async.c | 30 +++----------- dlls/d3dx11_43/d3dx11_43_main.c | 22 ---------- dlls/d3dx11_43/tests/d3dx11.c | 58 +++++++++++++++++++++++++-- dlls/d3dx11_43/texture.c | 71 +++++++++++++++++++++++++++++++++ dlls/d3dx9_36/d3dx_helpers.c | 31 ++++++++++++++ dlls/d3dx9_36/d3dx_helpers.h | 7 ++++ 8 files changed, 169 insertions(+), 81 deletions(-) diff --git a/dlls/d3dx10_43/async.c b/dlls/d3dx10_43/async.c index db00df59a0d7..8f78043045ec 100644 --- a/dlls/d3dx10_43/async.c +++ b/dlls/d3dx10_43/async.c @@ -88,36 +88,6 @@ static const ID3DX10DataLoaderVtbl memorydataloadervtbl = memorydataloader_Destroy }; -HRESULT load_file(const WCHAR *path, void **data, DWORD *size) -{ - DWORD read_len; - HANDLE file; - BOOL ret; - - file = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (file == INVALID_HANDLE_VALUE) - return D3D10_ERROR_FILE_NOT_FOUND; - - *size = GetFileSize(file, NULL); - *data = malloc(*size); - if (!*data) - { - CloseHandle(file); - return E_OUTOFMEMORY; - } - - ret = ReadFile(file, *data, *size, &read_len, NULL); - CloseHandle(file); - if (!ret || read_len != *size) - { - WARN("Failed to read file contents.\n"); - free(*data); - return E_FAIL; - } - return S_OK; -} - static HRESULT WINAPI filedataloader_Load(ID3DX10DataLoader *iface) { struct asyncdataloader *loader = impl_from_ID3DX10DataLoader(iface); diff --git a/dlls/d3dx10_43/dxhelpers.h b/dlls/d3dx10_43/dxhelpers.h index 49f56d63a234..17d0f9f8a255 100644 --- a/dlls/d3dx10_43/dxhelpers.h +++ b/dlls/d3dx10_43/dxhelpers.h @@ -18,7 +18,6 @@ #include "../d3dx9_36/d3dx_helpers.h" -extern HRESULT load_file(const WCHAR *path, void **data, DWORD *size); extern HRESULT load_resourceA(HMODULE module, const char *resource, void **data, DWORD *size); extern HRESULT load_resourceW(HMODULE module, const WCHAR *resource, diff --git a/dlls/d3dx11_43/async.c b/dlls/d3dx11_43/async.c index ab730a696894..b72368d5416c 100644 --- a/dlls/d3dx11_43/async.c +++ b/dlls/d3dx11_43/async.c @@ -42,7 +42,7 @@ struct asyncdataloader } resource; } u; void *data; - SIZE_T size; + DWORD size; }; static inline struct asyncdataloader *impl_from_ID3DX11DataLoader(ID3DX11DataLoader *iface) @@ -88,35 +88,15 @@ static const ID3DX11DataLoaderVtbl memorydataloadervtbl = static HRESULT WINAPI filedataloader_Load(ID3DX11DataLoader *iface) { struct asyncdataloader *loader = impl_from_ID3DX11DataLoader(iface); - DWORD size, read_len; - HANDLE file; void *data; - BOOL ret; + DWORD size; + HRESULT hr; TRACE("iface %p.\n", iface); /* Always buffer file contents, even if Load() was already called. */ - file = CreateFileW(loader->u.file.path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (file == INVALID_HANDLE_VALUE) - return D3D11_ERROR_FILE_NOT_FOUND; - - size = GetFileSize(file, NULL); - data = malloc(size); - if (!data) - { - CloseHandle(file); - return E_OUTOFMEMORY; - } - - ret = ReadFile(file, data, size, &read_len, NULL); - CloseHandle(file); - if (!ret) - { - ERR("Failed to read file contents.\n"); - free(data); - return E_FAIL; - } + if (FAILED((hr = load_file(loader->u.file.path, &data, &size)))) + return hr; free(loader->data); loader->data = data; diff --git a/dlls/d3dx11_43/d3dx11_43_main.c b/dlls/d3dx11_43/d3dx11_43_main.c index 00c1db35e42c..6e90891e7ce5 100644 --- a/dlls/d3dx11_43/d3dx11_43_main.c +++ b/dlls/d3dx11_43/d3dx11_43_main.c @@ -44,25 +44,3 @@ HRESULT WINAPI D3DX11FilterTexture(ID3D11DeviceContext *context, ID3D11Resource return E_NOTIMPL; } - -HRESULT WINAPI D3DX11GetImageInfoFromFileA(const char *filename, ID3DX11ThreadPump *pump, D3DX11_IMAGE_INFO *img_info, - HRESULT *hresult) -{ - FIXME("filename %s, pump %p, img_info %p, hresult %p stub!\n", debugstr_a(filename), pump, img_info, hresult); - - if (!filename) - return E_FAIL; - - return E_NOTIMPL; -} - -HRESULT WINAPI D3DX11GetImageInfoFromFileW(const WCHAR *filename, ID3DX11ThreadPump *pump, D3DX11_IMAGE_INFO *img_info, - HRESULT *hresult) -{ - FIXME("filename %s, pump %p, img_info %p, hresult %p stub!\n", debugstr_w(filename), pump, img_info, hresult); - - if (!filename) - return E_FAIL; - - return E_NOTIMPL; -} diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index 2b32b682af4b..78418247a780 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -1305,7 +1305,15 @@ static inline void check_image_info_values_(uint32_t line, const D3DX11_IMAGE_IN static WCHAR temp_dir[MAX_PATH]; -static BOOL create_file(const WCHAR *filename, const char *data, unsigned int size, WCHAR *out_path) +static char *get_str_a(const WCHAR *wstr) +{ + static char buffer[MAX_PATH]; + + WideCharToMultiByte(CP_ACP, 0, wstr, -1, buffer, sizeof(buffer), NULL, NULL); + return buffer; +} + +static BOOL create_file(const WCHAR *filename, const void *data, unsigned int size, WCHAR *out_path) { WCHAR path[MAX_PATH]; DWORD written; @@ -2196,9 +2204,11 @@ static void test_dds_header_image_info(void) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); } -static void test_D3DX11GetImageInfoFromMemory(void) +static void test_get_image_info(void) { + static const WCHAR test_filename[] = L"image.data"; D3DX11_IMAGE_INFO info; + WCHAR path[MAX_PATH]; HRESULT hr, hr2; uint32_t i; @@ -2364,6 +2374,48 @@ static void test_D3DX11GetImageInfoFromMemory(void) ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); check_image_info(&info, test_image, __LINE__); + hr2 = 0xdeadbeef; + hr = D3DX11GetImageInfoFromFileW(NULL, NULL, &info, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX11GetImageInfoFromFileW(L"deadbeaf", NULL, &info, &hr2); + ok(hr == D3D11_ERROR_FILE_NOT_FOUND, "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX11GetImageInfoFromFileA(NULL, NULL, &info, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX11GetImageInfoFromFileA("deadbeaf", NULL, &info, &hr2); + ok(hr == D3D11_ERROR_FILE_NOT_FOUND, "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + + for (i = 0; i < ARRAY_SIZE(test_image); ++i) + { + winetest_push_context("Test %u", i); + create_file(test_filename, test_image[i].data, test_image[i].size, path); + + hr2 = 0xdeadbeef; + hr = D3DX11GetImageInfoFromFileW(path, NULL, &info, &hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + if (hr == S_OK) + check_image_info(&info, test_image + i, __LINE__); + + hr2 = 0xdeadbeef; + hr = D3DX11GetImageInfoFromFileA(get_str_a(path), NULL, &info, &hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + if (hr == S_OK) + check_image_info(&info, test_image + i, __LINE__); + + delete_file(test_filename); + winetest_pop_context(); + } + check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC1_UNORM); check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('D','X','T','2'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC2_UNORM); check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('D','X','T','3'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC2_UNORM); @@ -2446,5 +2498,5 @@ START_TEST(d3dx11) test_D3DX11CreateAsyncResourceLoader(); test_D3DX11CreateAsyncTextureInfoProcessor(); test_D3DX11CompileFromFile(); - test_D3DX11GetImageInfoFromMemory(); + test_get_image_info(); } diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c index dda3393541d1..9e8acbf45d5c 100644 --- a/dlls/d3dx11_43/texture.c +++ b/dlls/d3dx11_43/texture.c @@ -101,6 +101,77 @@ HRESULT WINAPI D3DX11LoadTextureFromTexture(ID3D11DeviceContext *context, ID3D11 return E_NOTIMPL; } +HRESULT WINAPI D3DX11GetImageInfoFromFileA(const char *src_file, ID3DX11ThreadPump *pump, D3DX11_IMAGE_INFO *info, + HRESULT *result) +{ + WCHAR *buffer; + int str_len; + HRESULT hr; + + TRACE("src_file %s, pump %p, info %p, result %p.\n", debugstr_a(src_file), pump, info, result); + + if (!src_file) + return E_FAIL; + + str_len = MultiByteToWideChar(CP_ACP, 0, src_file, -1, NULL, 0); + if (!str_len) + return HRESULT_FROM_WIN32(GetLastError()); + + buffer = malloc(str_len * sizeof(*buffer)); + if (!buffer) + return E_OUTOFMEMORY; + + MultiByteToWideChar(CP_ACP, 0, src_file, -1, buffer, str_len); + hr = D3DX11GetImageInfoFromFileW(buffer, pump, info, result); + + free(buffer); + + return hr; +} + +HRESULT WINAPI D3DX11GetImageInfoFromFileW(const WCHAR *src_file, ID3DX11ThreadPump *pump, D3DX11_IMAGE_INFO *info, + HRESULT *result) +{ + void *buffer = NULL; + DWORD size = 0; + HRESULT hr; + + TRACE("src_file %s, pump %p, info %p, result %p.\n", debugstr_w(src_file), pump, info, result); + + if (!src_file) + return E_FAIL; + + if (pump) + { + ID3DX11DataProcessor *processor; + ID3DX11DataLoader *loader; + + if (FAILED((hr = D3DX11CreateAsyncFileLoaderW(src_file, &loader)))) + return hr; + if (FAILED((hr = D3DX11CreateAsyncTextureInfoProcessor(info, &processor)))) + { + ID3DX11DataLoader_Destroy(loader); + return hr; + } + hr = ID3DX11ThreadPump_AddWorkItem(pump, loader, processor, result, NULL); + if (FAILED(hr)) + { + ID3DX11DataLoader_Destroy(loader); + ID3DX11DataProcessor_Destroy(processor); + } + return hr; + } + + if (SUCCEEDED((hr = load_file(src_file, &buffer, &size)))) + { + hr = get_image_info(buffer, size, info); + free(buffer); + } + if (result) + *result = hr; + return hr; +} + static HRESULT d3dx11_image_info_from_d3dx_image(D3DX11_IMAGE_INFO *info, struct d3dx_image *image) { DXGI_FORMAT format; diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index 45e6977e9d3b..148fe43e7962 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -3228,3 +3228,34 @@ void get_aligned_rect(uint32_t left, uint32_t top, uint32_t right, uint32_t bott aligned_rect->bottom = min((aligned_rect->bottom + fmt_desc->block_height - 1) & ~(fmt_desc->block_height - 1), height); } + +/* File/resource loading functions shared amongst d3dx10/d3dx11. */ +HRESULT load_file(const WCHAR *path, void **data, DWORD *size) +{ + DWORD read_len; + HANDLE file; + BOOL ret; + + file = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (file == INVALID_HANDLE_VALUE) + return D3DX_HELPER_ERR_FILE_NOT_FOUND; + + *size = GetFileSize(file, NULL); + *data = malloc(*size); + if (!*data) + { + CloseHandle(file); + return E_OUTOFMEMORY; + } + + ret = ReadFile(file, *data, *size, &read_len, NULL); + CloseHandle(file); + if (!ret || read_len != *size) + { + WARN("Failed to read file contents.\n"); + free(*data); + return E_FAIL; + } + return S_OK; +} diff --git a/dlls/d3dx9_36/d3dx_helpers.h b/dlls/d3dx9_36/d3dx_helpers.h index 68c2244d315a..698943543288 100644 --- a/dlls/d3dx9_36/d3dx_helpers.h +++ b/dlls/d3dx9_36/d3dx_helpers.h @@ -29,6 +29,7 @@ #include "d3dx9.h" #define D3DX_ERROR_INVALID_DATA D3DXERR_INVALIDDATA; +#define D3DX_HELPER_ERR_FILE_NOT_FOUND ERROR_FILE_NOT_FOUND #define ID3DXBlob ID3DXBuffer #define d3dx_create_blob(size, blob) D3DXCreateBuffer(size, blob) @@ -43,6 +44,8 @@ #define D3DERR_INVALIDCALL 0x8876086c #define D3DX_ERROR_INVALID_DATA D3DX10_ERR_INVALID_DATA +#define D3DX_HELPER_ERR_FILE_NOT_FOUND D3D10_ERROR_FILE_NOT_FOUND + #define D3DX_DEFAULT D3DX10_DEFAULT #define D3DX_FILTER_NONE D3DX10_FILTER_NONE @@ -78,6 +81,8 @@ DXGI_FORMAT dxgi_format_from_dxt10_dds_d3dx_pixel_format_id(enum d3dx_pixel_form #define D3DERR_INVALIDCALL 0x8876086c #define D3DX_ERROR_INVALID_DATA D3DX11_ERR_INVALID_DATA +#define D3DX_HELPER_ERR_FILE_NOT_FOUND D3D11_ERROR_FILE_NOT_FOUND + #define D3DX_DEFAULT D3DX11_DEFAULT #define D3DX_FILTER_NONE D3DX11_FILTER_NONE @@ -542,4 +547,6 @@ unsigned short float_32_to_16(const float in); float float_16_to_32(const unsigned short in); /* debug helpers */ const char *debug_d3dx_image_file_format(enum d3dx_image_file_format format); + +HRESULT load_file(const WCHAR *path, void **data, DWORD *size); #endif /* __WINE_D3DX_HELPERS_H */ From 657708e823a2be5f4506ee2be93011378dbc341a Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 29 Aug 2024 05:58:45 -0400 Subject: [PATCH 0965/2542] d3dx11: Implement D3DX11GetImageInfoFromResource{A,W}(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/async.c | 57 ---------------------- dlls/d3dx10_43/dxhelpers.h | 5 -- dlls/d3dx11_42/d3dx11_42.spec | 4 +- dlls/d3dx11_43/async.c | 26 ++++------ dlls/d3dx11_43/d3dx11_43.spec | 4 +- dlls/d3dx11_43/tests/d3dx11.c | 89 +++++++++++++++++++++++++++++++++++ dlls/d3dx11_43/texture.c | 76 ++++++++++++++++++++++++++++++ dlls/d3dx9_36/d3dx_helpers.c | 57 ++++++++++++++++++++++ dlls/d3dx9_36/d3dx_helpers.h | 5 ++ include/d3dx11tex.h | 4 ++ 10 files changed, 243 insertions(+), 84 deletions(-) diff --git a/dlls/d3dx10_43/async.c b/dlls/d3dx10_43/async.c index 8f78043045ec..4c5c7a654371 100644 --- a/dlls/d3dx10_43/async.c +++ b/dlls/d3dx10_43/async.c @@ -143,63 +143,6 @@ static const ID3DX10DataLoaderVtbl filedataloadervtbl = filedataloader_Destroy }; -static HRESULT load_resource_initA(HMODULE module, const char *resource, HRSRC *rsrc) -{ - if (!(*rsrc = FindResourceA(module, resource, (const char *)RT_RCDATA))) - *rsrc = FindResourceA(module, resource, (const char *)RT_BITMAP); - if (!*rsrc) - { - WARN("Failed to find resource.\n"); - return D3DX10_ERR_INVALID_DATA; - } - return S_OK; -} - -static HRESULT load_resource_initW(HMODULE module, const WCHAR *resource, HRSRC *rsrc) -{ - if (!(*rsrc = FindResourceW(module, resource, (const WCHAR *)RT_RCDATA))) - *rsrc = FindResourceW(module, resource, (const WCHAR *)RT_BITMAP); - if (!*rsrc) - { - WARN("Failed to find resource.\n"); - return D3DX10_ERR_INVALID_DATA; - } - return S_OK; -} - -static HRESULT load_resource(HMODULE module, HRSRC rsrc, void **data, DWORD *size) -{ - HGLOBAL hglobal; - - if (!(*size = SizeofResource(module, rsrc))) - return D3DX10_ERR_INVALID_DATA; - if (!(hglobal = LoadResource(module, rsrc))) - return D3DX10_ERR_INVALID_DATA; - if (!(*data = LockResource(hglobal))) - return D3DX10_ERR_INVALID_DATA; - return S_OK; -} - -HRESULT load_resourceA(HMODULE module, const char *resource, void **data, DWORD *size) -{ - HRESULT hr; - HRSRC rsrc; - - if (FAILED((hr = load_resource_initA(module, resource, &rsrc)))) - return hr; - return load_resource(module, rsrc, data, size); -} - -HRESULT load_resourceW(HMODULE module, const WCHAR *resource, void **data, DWORD *size) -{ - HRESULT hr; - HRSRC rsrc; - - if ((FAILED(hr = load_resource_initW(module, resource, &rsrc)))) - return hr; - return load_resource(module, rsrc, data, size); -} - static HRESULT WINAPI resourcedataloader_Load(ID3DX10DataLoader *iface) { struct asyncdataloader *loader = impl_from_ID3DX10DataLoader(iface); diff --git a/dlls/d3dx10_43/dxhelpers.h b/dlls/d3dx10_43/dxhelpers.h index 17d0f9f8a255..ae44c836482e 100644 --- a/dlls/d3dx10_43/dxhelpers.h +++ b/dlls/d3dx10_43/dxhelpers.h @@ -18,11 +18,6 @@ #include "../d3dx9_36/d3dx_helpers.h" -extern HRESULT load_resourceA(HMODULE module, const char *resource, - void **data, DWORD *size); -extern HRESULT load_resourceW(HMODULE module, const WCHAR *resource, - void **data, DWORD *size); - extern HRESULT get_image_info(const void *data, SIZE_T size, D3DX10_IMAGE_INFO *img_info); extern void init_load_info(const D3DX10_IMAGE_LOAD_INFO *load_info, diff --git a/dlls/d3dx11_42/d3dx11_42.spec b/dlls/d3dx11_42/d3dx11_42.spec index 53d0407db6e6..48652ce52e7b 100644 --- a/dlls/d3dx11_42/d3dx11_42.spec +++ b/dlls/d3dx11_42/d3dx11_42.spec @@ -30,8 +30,8 @@ @ stdcall -import D3DX11GetImageInfoFromFileA(str ptr ptr ptr) @ stdcall -import D3DX11GetImageInfoFromFileW(wstr ptr ptr ptr) @ stdcall -import D3DX11GetImageInfoFromMemory(ptr long ptr ptr ptr) -@ stub D3DX11GetImageInfoFromResourceA -@ stub D3DX11GetImageInfoFromResourceW +@ stdcall -import D3DX11GetImageInfoFromResourceA(long str ptr ptr ptr) +@ stdcall -import D3DX11GetImageInfoFromResourceW(long wstr ptr ptr ptr) @ stdcall -import D3DX11LoadTextureFromTexture(ptr ptr ptr ptr) @ stub D3DX11PreprocessShaderFromFileA @ stub D3DX11PreprocessShaderFromFileW diff --git a/dlls/d3dx11_43/async.c b/dlls/d3dx11_43/async.c index b72368d5416c..19e087a435eb 100644 --- a/dlls/d3dx11_43/async.c +++ b/dlls/d3dx11_43/async.c @@ -143,24 +143,14 @@ static const ID3DX11DataLoaderVtbl filedataloadervtbl = static HRESULT WINAPI resourcedataloader_Load(ID3DX11DataLoader *iface) { struct asyncdataloader *loader = impl_from_ID3DX11DataLoader(iface); - HGLOBAL hglobal; TRACE("iface %p.\n", iface); if (loader->data) return S_OK; - hglobal = LoadResource(loader->u.resource.module, loader->u.resource.rsrc); - if (!hglobal) - { - ERR("Failed to load resource.\n"); - return E_FAIL; - } - - loader->data = LockResource(hglobal); - loader->size = SizeofResource(loader->u.resource.module, loader->u.resource.rsrc); - - return S_OK; + return load_resource(loader->u.resource.module, loader->u.resource.rsrc, + &loader->data, &loader->size); } static HRESULT WINAPI resourcedataloader_Decompress(ID3DX11DataLoader *iface, void **data, SIZE_T *size) @@ -374,6 +364,7 @@ HRESULT WINAPI D3DX11CreateAsyncResourceLoaderA(HMODULE module, const char *reso { struct asyncdataloader *object; HRSRC rsrc; + HRESULT hr; TRACE("module %p, resource %s, loader %p.\n", module, debugstr_a(resource), loader); @@ -384,11 +375,10 @@ HRESULT WINAPI D3DX11CreateAsyncResourceLoaderA(HMODULE module, const char *reso if (!object) return E_OUTOFMEMORY; - if (!(rsrc = FindResourceA(module, resource, (const char *)RT_RCDATA))) + if (FAILED((hr = load_resource_initA(module, resource, &rsrc)))) { - WARN("Failed to find resource.\n"); free(object); - return D3DX11_ERR_INVALID_DATA; + return hr; } object->ID3DX11DataLoader_iface.lpVtbl = &resourcedataloadervtbl; @@ -406,6 +396,7 @@ HRESULT WINAPI D3DX11CreateAsyncResourceLoaderW(HMODULE module, const WCHAR *res { struct asyncdataloader *object; HRSRC rsrc; + HRESULT hr; TRACE("module %p, resource %s, loader %p.\n", module, debugstr_w(resource), loader); @@ -416,11 +407,10 @@ HRESULT WINAPI D3DX11CreateAsyncResourceLoaderW(HMODULE module, const WCHAR *res if (!object) return E_OUTOFMEMORY; - if (!(rsrc = FindResourceW(module, resource, (const WCHAR *)RT_RCDATA))) + if (FAILED((hr = load_resource_initW(module, resource, &rsrc)))) { - WARN("Failed to find resource.\n"); free(object); - return D3DX11_ERR_INVALID_DATA; + return hr; } object->ID3DX11DataLoader_iface.lpVtbl = &resourcedataloadervtbl; diff --git a/dlls/d3dx11_43/d3dx11_43.spec b/dlls/d3dx11_43/d3dx11_43.spec index 85116a8b2033..c199b7c0a89c 100644 --- a/dlls/d3dx11_43/d3dx11_43.spec +++ b/dlls/d3dx11_43/d3dx11_43.spec @@ -30,8 +30,8 @@ @ stdcall D3DX11GetImageInfoFromFileA(str ptr ptr ptr) @ stdcall D3DX11GetImageInfoFromFileW(wstr ptr ptr ptr) @ stdcall D3DX11GetImageInfoFromMemory(ptr long ptr ptr ptr) -@ stub D3DX11GetImageInfoFromResourceA -@ stub D3DX11GetImageInfoFromResourceW +@ stdcall D3DX11GetImageInfoFromResourceA(long str ptr ptr ptr) +@ stdcall D3DX11GetImageInfoFromResourceW(long wstr ptr ptr ptr) @ stdcall D3DX11LoadTextureFromTexture(ptr ptr ptr ptr) @ stub D3DX11PreprocessShaderFromFileA @ stub D3DX11PreprocessShaderFromFileW diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index 78418247a780..c78e7434276b 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -1350,6 +1350,43 @@ static void delete_file(const WCHAR *filename) DeleteFileW(path); } +static HMODULE create_resource_module(const WCHAR *filename, const void *data, unsigned int size) +{ + WCHAR resource_module_path[MAX_PATH], current_module_path[MAX_PATH]; + HANDLE resource; + HMODULE module; + BOOL ret; + + if (!temp_dir[0]) + GetTempPathW(ARRAY_SIZE(temp_dir), temp_dir); + lstrcpyW(resource_module_path, temp_dir); + lstrcatW(resource_module_path, filename); + + GetModuleFileNameW(NULL, current_module_path, ARRAY_SIZE(current_module_path)); + ret = CopyFileW(current_module_path, resource_module_path, FALSE); + ok(ret, "CopyFileW failed, error %lu.\n", GetLastError()); + SetFileAttributesW(resource_module_path, FILE_ATTRIBUTE_NORMAL); + + resource = BeginUpdateResourceW(resource_module_path, TRUE); + UpdateResourceW(resource, (LPCWSTR)RT_RCDATA, filename, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), (void *)data, size); + EndUpdateResourceW(resource, FALSE); + + module = LoadLibraryExW(resource_module_path, NULL, LOAD_LIBRARY_AS_DATAFILE); + + return module; +} + +static void delete_resource_module(const WCHAR *filename, HMODULE module) +{ + WCHAR path[MAX_PATH]; + + FreeLibrary(module); + + lstrcpyW(path, temp_dir); + lstrcatW(path, filename); + DeleteFileW(path); +} + static BOOL create_directory(const WCHAR *dir) { WCHAR path[MAX_PATH]; @@ -2206,7 +2243,9 @@ static void test_dds_header_image_info(void) static void test_get_image_info(void) { + static const WCHAR test_resource_name[] = L"resource.data"; static const WCHAR test_filename[] = L"image.data"; + HMODULE resource_module; D3DX11_IMAGE_INFO info; WCHAR path[MAX_PATH]; HRESULT hr, hr2; @@ -2416,6 +2455,56 @@ static void test_get_image_info(void) winetest_pop_context(); } + /* D3DX11GetImageInfoFromResource tests */ + hr2 = 0xdeadbeef; + hr = D3DX11GetImageInfoFromResourceW(NULL, NULL, NULL, &info, &hr2); + ok(hr == D3DX11_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX11GetImageInfoFromResourceW(NULL, L"deadbeaf", NULL, &info, &hr2); + ok(hr == D3DX11_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX11GetImageInfoFromResourceA(NULL, NULL, NULL, &info, &hr2); + ok(hr == D3DX11_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX11GetImageInfoFromResourceA(NULL, "deadbeaf", NULL, &info, &hr2); + ok(hr == D3DX11_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + + for (i = 0; i < ARRAY_SIZE(test_image); ++i) + { + winetest_push_context("Test %u", i); + resource_module = create_resource_module(test_resource_name, test_image[i].data, test_image[i].size); + + hr2 = 0xdeadbeef; + hr = D3DX11GetImageInfoFromResourceW(resource_module, L"deadbeef", NULL, &info, &hr2); + ok(hr == D3DX11_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + + hr2 = 0xdeadbeef; + hr = D3DX11GetImageInfoFromResourceW(resource_module, test_resource_name, NULL, &info, &hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP) + || broken(hr == D3DX11_ERR_INVALID_DATA) /* Vista */, + "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + if (hr == S_OK) + check_image_info(&info, test_image + i, __LINE__); + + hr2 = 0xdeadbeef; + hr = D3DX11GetImageInfoFromResourceA(resource_module, get_str_a(test_resource_name), NULL, &info, &hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP) + || broken(hr == D3DX11_ERR_INVALID_DATA) /* Vista */, + "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + if (hr == S_OK) + check_image_info(&info, test_image + i, __LINE__); + + delete_resource_module(test_resource_name, resource_module); + winetest_pop_context(); + } + check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC1_UNORM); check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('D','X','T','2'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC2_UNORM); check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('D','X','T','3'), 0, 0, 0, 0, 0, DXGI_FORMAT_BC2_UNORM); diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c index 9e8acbf45d5c..4a49bc0c4509 100644 --- a/dlls/d3dx11_43/texture.c +++ b/dlls/d3dx11_43/texture.c @@ -172,6 +172,82 @@ HRESULT WINAPI D3DX11GetImageInfoFromFileW(const WCHAR *src_file, ID3DX11ThreadP return hr; } +HRESULT WINAPI D3DX11GetImageInfoFromResourceA(HMODULE module, const char *resource, ID3DX11ThreadPump *pump, + D3DX11_IMAGE_INFO *info, HRESULT *result) +{ + void *buffer; + HRESULT hr; + DWORD size; + + TRACE("module %p, resource %s, pump %p, info %p, result %p.\n", + module, debugstr_a(resource), pump, info, result); + + if (pump) + { + ID3DX11DataProcessor *processor; + ID3DX11DataLoader *loader; + + if (FAILED((hr = D3DX11CreateAsyncResourceLoaderA(module, resource, &loader)))) + return hr; + if (FAILED((hr = D3DX11CreateAsyncTextureInfoProcessor(info, &processor)))) + { + ID3DX11DataLoader_Destroy(loader); + return hr; + } + if (FAILED((hr = ID3DX11ThreadPump_AddWorkItem(pump, loader, processor, result, NULL)))) + { + ID3DX11DataLoader_Destroy(loader); + ID3DX11DataProcessor_Destroy(processor); + } + return hr; + } + + if (FAILED((hr = load_resourceA(module, resource, &buffer, &size)))) + return hr; + hr = get_image_info(buffer, size, info); + if (result) + *result = hr; + return hr; +} + +HRESULT WINAPI D3DX11GetImageInfoFromResourceW(HMODULE module, const WCHAR *resource, ID3DX11ThreadPump *pump, + D3DX11_IMAGE_INFO *info, HRESULT *result) +{ + void *buffer; + HRESULT hr; + DWORD size; + + TRACE("module %p, resource %s, pump %p, info %p, result %p.\n", + module, debugstr_w(resource), pump, info, result); + + if (pump) + { + ID3DX11DataProcessor *processor; + ID3DX11DataLoader *loader; + + if (FAILED((hr = D3DX11CreateAsyncResourceLoaderW(module, resource, &loader)))) + return hr; + if (FAILED((hr = D3DX11CreateAsyncTextureInfoProcessor(info, &processor)))) + { + ID3DX11DataLoader_Destroy(loader); + return hr; + } + if (FAILED((hr = ID3DX11ThreadPump_AddWorkItem(pump, loader, processor, result, NULL)))) + { + ID3DX11DataLoader_Destroy(loader); + ID3DX11DataProcessor_Destroy(processor); + } + return hr; + } + + if (FAILED((hr = load_resourceW(module, resource, &buffer, &size)))) + return hr; + hr = get_image_info(buffer, size, info); + if (result) + *result = hr; + return hr; +} + static HRESULT d3dx11_image_info_from_d3dx_image(D3DX11_IMAGE_INFO *info, struct d3dx_image *image) { DXGI_FORMAT format; diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index 148fe43e7962..6f5782dc8cea 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -3259,3 +3259,60 @@ HRESULT load_file(const WCHAR *path, void **data, DWORD *size) } return S_OK; } + +HRESULT load_resource_initA(HMODULE module, const char *resource, HRSRC *rsrc) +{ + if (!(*rsrc = FindResourceA(module, resource, (const char *)RT_RCDATA))) + *rsrc = FindResourceA(module, resource, (const char *)RT_BITMAP); + if (!*rsrc) + { + WARN("Failed to find resource.\n"); + return D3DX_ERROR_INVALID_DATA; + } + return S_OK; +} + +HRESULT load_resource_initW(HMODULE module, const WCHAR *resource, HRSRC *rsrc) +{ + if (!(*rsrc = FindResourceW(module, resource, (const WCHAR *)RT_RCDATA))) + *rsrc = FindResourceW(module, resource, (const WCHAR *)RT_BITMAP); + if (!*rsrc) + { + WARN("Failed to find resource.\n"); + return D3DX_ERROR_INVALID_DATA; + } + return S_OK; +} + +HRESULT load_resource(HMODULE module, HRSRC rsrc, void **data, DWORD *size) +{ + HGLOBAL hglobal; + + if (!(*size = SizeofResource(module, rsrc))) + return D3DX_ERROR_INVALID_DATA; + if (!(hglobal = LoadResource(module, rsrc))) + return D3DX_ERROR_INVALID_DATA; + if (!(*data = LockResource(hglobal))) + return D3DX_ERROR_INVALID_DATA; + return S_OK; +} + +HRESULT load_resourceA(HMODULE module, const char *resource, void **data, DWORD *size) +{ + HRESULT hr; + HRSRC rsrc; + + if (FAILED((hr = load_resource_initA(module, resource, &rsrc)))) + return hr; + return load_resource(module, rsrc, data, size); +} + +HRESULT load_resourceW(HMODULE module, const WCHAR *resource, void **data, DWORD *size) +{ + HRESULT hr; + HRSRC rsrc; + + if ((FAILED(hr = load_resource_initW(module, resource, &rsrc)))) + return hr; + return load_resource(module, rsrc, data, size); +} diff --git a/dlls/d3dx9_36/d3dx_helpers.h b/dlls/d3dx9_36/d3dx_helpers.h index 698943543288..428237aee88e 100644 --- a/dlls/d3dx9_36/d3dx_helpers.h +++ b/dlls/d3dx9_36/d3dx_helpers.h @@ -549,4 +549,9 @@ float float_16_to_32(const unsigned short in); const char *debug_d3dx_image_file_format(enum d3dx_image_file_format format); HRESULT load_file(const WCHAR *path, void **data, DWORD *size); +HRESULT load_resource(HMODULE module, HRSRC rsrc, void **data, DWORD *size); +HRESULT load_resourceW(HMODULE module, const WCHAR *resource, void **data, DWORD *size); +HRESULT load_resourceA(HMODULE module, const char *resource, void **data, DWORD *size); +HRESULT load_resource_initA(HMODULE module, const char *resource, HRSRC *rsrc); +HRESULT load_resource_initW(HMODULE module, const WCHAR *resource, HRSRC *rsrc); #endif /* __WINE_D3DX_HELPERS_H */ diff --git a/include/d3dx11tex.h b/include/d3dx11tex.h index fae5ee9c67a0..631a8060f6bf 100644 --- a/include/d3dx11tex.h +++ b/include/d3dx11tex.h @@ -153,6 +153,10 @@ HRESULT WINAPI D3DX11GetImageInfoFromFileA(const char *filename, ID3DX11ThreadPu HRESULT *hresult); HRESULT WINAPI D3DX11GetImageInfoFromFileW(const WCHAR *filename, ID3DX11ThreadPump *pump, D3DX11_IMAGE_INFO *img_info, HRESULT *hresult); +HRESULT WINAPI D3DX11GetImageInfoFromResourceA(HMODULE module, const char *resource, ID3DX11ThreadPump *pump, + D3DX11_IMAGE_INFO *info, HRESULT *result); +HRESULT WINAPI D3DX11GetImageInfoFromResourceW(HMODULE module, const WCHAR *resource, ID3DX11ThreadPump *pump, + D3DX11_IMAGE_INFO *info, HRESULT *result); HRESULT WINAPI D3DX11GetImageInfoFromMemory(const void *src_data, SIZE_T src_data_size, ID3DX11ThreadPump *pump, D3DX11_IMAGE_INFO *img_info, HRESULT *hresult); HRESULT WINAPI D3DX11LoadTextureFromTexture(ID3D11DeviceContext *context, ID3D11Resource *src_texture, From 1d85508cef573adcd9cbdb846e6d0967847ec459 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 29 Aug 2024 07:44:29 -0400 Subject: [PATCH 0966/2542] d3dx11: Implement D3DX11CreateTextureFromMemory(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx11_43/tests/d3dx11.c | 1037 ++++++++++++++++++++++++++++++++- dlls/d3dx11_43/texture.c | 343 ++++++++++- 2 files changed, 1369 insertions(+), 11 deletions(-) diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index c78e7434276b..efffbec9bd9d 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -20,15 +20,43 @@ #include "initguid.h" #include "d3d11.h" #include "d3dx11.h" +#include "wine/wined3d.h" #include "wine/test.h" #include +#define D3DERR_INVALIDCALL 0x8876086c +#define DDS_RESOURCE_MISC_TEXTURECUBE 0x04 + +static bool wined3d_opengl; + #ifndef MAKEFOURCC #define MAKEFOURCC(ch0, ch1, ch2, ch3) \ ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 )) #endif +static DXGI_FORMAT block_compressed_formats[] = +{ + DXGI_FORMAT_BC1_TYPELESS, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM_SRGB, + DXGI_FORMAT_BC2_TYPELESS, DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_BC2_UNORM_SRGB, + DXGI_FORMAT_BC3_TYPELESS, DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_BC3_UNORM_SRGB, + DXGI_FORMAT_BC4_TYPELESS, DXGI_FORMAT_BC4_UNORM, DXGI_FORMAT_BC4_SNORM, + DXGI_FORMAT_BC5_TYPELESS, DXGI_FORMAT_BC5_UNORM, DXGI_FORMAT_BC5_SNORM, + DXGI_FORMAT_BC6H_TYPELESS, DXGI_FORMAT_BC6H_UF16, DXGI_FORMAT_BC6H_SF16, + DXGI_FORMAT_BC7_TYPELESS, DXGI_FORMAT_BC7_UNORM, DXGI_FORMAT_BC7_UNORM_SRGB +}; + +static BOOL is_block_compressed(DXGI_FORMAT format) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(block_compressed_formats); ++i) + if (format == block_compressed_formats[i]) + return TRUE; + + return FALSE; +} + static uint32_t get_bpp_from_format(DXGI_FORMAT format) { switch (format) @@ -252,6 +280,13 @@ static ID3DX11ThreadPumpVtbl D3DX11ThreadPumpVtbl = }; static ID3DX11ThreadPump thread_pump = { &D3DX11ThreadPumpVtbl }; +static BOOL compare_uint(unsigned int x, unsigned int y, unsigned int max_diff) +{ + unsigned int diff = x > y ? x - y : y - x; + + return diff <= max_diff; +} + /* 1x1 bmp (1 bpp) */ static const unsigned char bmp_1bpp[] = { @@ -1037,6 +1072,68 @@ static const BYTE test_dds_volume_data[] = 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x87, 0x0f, 0x78, 0x05, 0x05, 0x50, 0x50, }; +/* + * 4x4x4 24-bit volume dds, 3 mipmaps. Level 0 is red, level 1 is green, level 2 is + * blue. + */ +static const uint8_t dds_volume_24bit_4_4_4[] = +{ + 0x44,0x44,0x53,0x20,0x7c,0x00,0x00,0x00,0x0f,0x10,0x82,0x00,0x04,0x00,0x00,0x00, + 0x04,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x03,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00, + 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x40,0x00, + 0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, + 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, + 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, + 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0xff,0x00,0x00 +}; + +/* + * 8x8 24-bit dds, 4 mipmaps. Level 0 is red, level 1 is green, level 2 is + * blue, and level 3 is black. + */ +static const uint8_t dds_24bit_8_8[] = +{ + 0x44,0x44,0x53,0x20,0x7c,0x00,0x00,0x00,0x07,0x10,0x0a,0x00,0x08,0x00,0x00,0x00, + 0x08,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00, + 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x40,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, + 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, + 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, + 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, + 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, + 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, + 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00 +}; + /* 1x1 wmp image */ static const BYTE test_wmp[] = { @@ -1231,6 +1328,154 @@ test_image[] = }, }; +static const struct test_image_load_info +{ + const uint8_t *data; + uint32_t size; + D3DX11_IMAGE_LOAD_INFO load_info; + HRESULT expected_hr; + + D3D11_SRV_DIMENSION expected_srv_dimension; + D3D11_RESOURCE_DIMENSION expected_type; + union + { + D3D11_TEXTURE2D_DESC desc_2d; + D3D11_TEXTURE3D_DESC desc_3d; + } expected_resource_desc; + D3DX11_IMAGE_INFO expected_info; + BOOL todo_resource_desc; +} +test_image_load_info[] = +{ + /* + * FirstMipLevel set to 1 - Does not match D3DX_SKIP_DDS_MIP_LEVELS + * behavior from d3dx9, image info values represent mip level 0, and + * texture values are pulled from this. The texture data is loaded + * starting from the specified mip level, however. + */ + { + dds_volume_24bit_4_4_4, sizeof(dds_volume_24bit_4_4_4), + { D3DX11_FROM_FILE, D3DX11_DEFAULT, 0, 1, D3DX11_DEFAULT, (D3D11_USAGE)D3DX11_DEFAULT, + D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT }, + S_OK, D3D11_SRV_DIMENSION_TEXTURE3D, D3D11_RESOURCE_DIMENSION_TEXTURE3D, + { .desc_3d = { 4, 4, 4, 3, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0 } }, + { 4, 4, 4, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, D3DX11_IFF_DDS }, + }, + /* + * Autogen mips misc flag specified. In the case of a cube texture image, + * the autogen mips flag is OR'd against D3D11_RESOURCE_MISC_TEXTURECUBE, + * even if it isn't specified. + */ + { + test_dds_cube, sizeof(test_dds_cube), + { D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, (D3D11_USAGE)D3DX11_DEFAULT, + (D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET), D3DX11_DEFAULT, D3D11_RESOURCE_MISC_GENERATE_MIPS, + DXGI_FORMAT_R8G8B8A8_UNORM, D3DX11_DEFAULT, D3DX11_DEFAULT }, + S_OK, D3D11_SRV_DIMENSION_TEXTURECUBE, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + { .desc_2d = { 4, 4, 3, 6, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D11_USAGE_DEFAULT, + (D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET), 0, + (D3D11_RESOURCE_MISC_GENERATE_MIPS | D3D11_RESOURCE_MISC_TEXTURECUBE) } }, + { 4, 4, 1, 6, 3, DDS_RESOURCE_MISC_TEXTURECUBE, DXGI_FORMAT_BC1_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_DDS }, + }, + /* + * Even with the autogen mips misc flag specified, the mip levels argument + * of load info is respected. + */ + { + test_dds_cube, sizeof(test_dds_cube), + { D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, 2, (D3D11_USAGE)D3DX11_DEFAULT, + (D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET), D3DX11_DEFAULT, D3D11_RESOURCE_MISC_GENERATE_MIPS, + DXGI_FORMAT_R8G8B8A8_UNORM, D3DX11_DEFAULT, D3DX11_DEFAULT }, + S_OK, D3D11_SRV_DIMENSION_TEXTURECUBE, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + { .desc_2d = { 4, 4, 2, 6, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D11_USAGE_DEFAULT, + (D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET), 0, + (D3D11_RESOURCE_MISC_GENERATE_MIPS | D3D11_RESOURCE_MISC_TEXTURECUBE) } }, + { 4, 4, 1, 6, 3, DDS_RESOURCE_MISC_TEXTURECUBE, DXGI_FORMAT_BC1_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_DDS }, + }, +}; + +static const struct test_invalid_image_load_info +{ + const uint8_t *data; + uint32_t size; + D3DX11_IMAGE_LOAD_INFO load_info; + HRESULT expected_hr; + HRESULT expected_process_hr; + HRESULT expected_create_device_object_hr; + BOOL todo_hr; + BOOL todo_process_hr; + BOOL todo_create_device_object_hr; +} +test_invalid_image_load_info[] = +{ + /* + * A depth value that isn't D3DX11_FROM_FILE/D3DX11_DEFAULT/0 on a 2D + * texture results in failure. + */ + { + test_dds_32bpp, sizeof(test_dds_32bpp), + { D3DX11_DEFAULT, D3DX11_DEFAULT, 2, D3DX11_DEFAULT, D3DX11_DEFAULT, (D3D11_USAGE)D3DX11_DEFAULT, + D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT }, + E_FAIL, E_FAIL, + }, + /* Invalid filter value. */ + { + test_dds_32bpp, sizeof(test_dds_32bpp), + { D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, (D3D11_USAGE)D3DX11_DEFAULT, + D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, 7, D3DX11_DEFAULT }, + D3DERR_INVALIDCALL, D3DERR_INVALIDCALL, + }, + /* Invalid mipfilter value, only checked if mips are generated. */ + { + test_dds_32bpp, sizeof(test_dds_32bpp), + { D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, (D3D11_USAGE)D3DX11_DEFAULT, + D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, 7 }, + S_OK, S_OK, S_OK + }, + /* Invalid mipfilter value. */ + { + test_dds_32bpp, sizeof(test_dds_32bpp), + { 2, 2, D3DX11_DEFAULT, D3DX11_DEFAULT, 2, (D3D11_USAGE)D3DX11_DEFAULT, + D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, 7 }, + D3DERR_INVALIDCALL, D3DERR_INVALIDCALL, + }, + /* + * Usage/BindFlags/CpuAccessFlags are validated in the call to + * CreateDeviceObject(). + */ + { + test_dds_32bpp, sizeof(test_dds_32bpp), + { D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3D11_CPU_ACCESS_READ, D3D11_USAGE_DYNAMIC, + D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT }, + E_INVALIDARG, S_OK, E_INVALIDARG, + }, + { + test_dds_32bpp, sizeof(test_dds_32bpp), + { D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3D11_USAGE_DEFAULT, + D3D11_BIND_DEPTH_STENCIL, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT }, + E_INVALIDARG, S_OK, E_INVALIDARG, + }, + /* + * D3D11_RESOURCE_MISC_GENERATE_MIPS requires binding as a shader resource + * and a render target. + */ + { + test_dds_32bpp, sizeof(test_dds_32bpp), + { D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3D11_USAGE_DEFAULT, + D3DX11_DEFAULT, D3DX11_DEFAULT, D3D11_RESOURCE_MISC_GENERATE_MIPS, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT }, + E_INVALIDARG, S_OK, E_INVALIDARG, + }, + /* Can't set the cube texture flag if the image isn't a cube texture. */ + { + test_dds_32bpp, sizeof(test_dds_32bpp), + { D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3D11_USAGE_DEFAULT, + D3DX11_DEFAULT, D3DX11_DEFAULT, D3D11_RESOURCE_MISC_TEXTURECUBE, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT }, + E_INVALIDARG, S_OK, E_INVALIDARG + }, +}; + static void check_image_info(D3DX11_IMAGE_INFO *image_info, const struct test_image *image, unsigned int line) { ok_(__FILE__, line)(image_info->Width == image->expected_info.Width, @@ -1303,6 +1548,568 @@ static inline void check_image_info_values_(uint32_t line, const D3DX11_IMAGE_IN image_file_format, info->ImageFileFormat); } +#define check_texture2d_desc_values(desc, width, height, mip_levels, array_size, format, sample_count, sample_quality, \ + usage, bind_flags, cpu_access_flags, misc_flags, wine_todo) \ + check_texture2d_desc_values_(__LINE__, desc, width, height, mip_levels, array_size, format, sample_count, sample_quality, \ + usage, bind_flags, cpu_access_flags, misc_flags, wine_todo) +static inline void check_texture2d_desc_values_(uint32_t line, const D3D11_TEXTURE2D_DESC *desc, uint32_t width, + uint32_t height, uint32_t mip_levels, uint32_t array_size, DXGI_FORMAT format, uint32_t sample_count, + uint32_t sample_quality, D3D11_USAGE usage, uint32_t bind_flags, uint32_t cpu_access_flags, uint32_t misc_flags, + BOOL wine_todo) +{ + const D3D11_TEXTURE2D_DESC expected_desc = { width, height, mip_levels, array_size, format, { sample_count, sample_quality }, + usage, bind_flags, cpu_access_flags, misc_flags }; + BOOL matched; + + matched = !memcmp(&expected_desc, desc, sizeof(*desc)); + todo_wine_if(wine_todo) ok_(__FILE__, line)(matched, "Got unexpected 2D texture desc values.\n"); + if (matched) + return; + + todo_wine_if(wine_todo && desc->Width != width) + ok_(__FILE__, line)(desc->Width == width, "Expected width %u, got %u.\n", width, desc->Width); + todo_wine_if(wine_todo && desc->Height != height) + ok_(__FILE__, line)(desc->Height == height, "Expected height %u, got %u.\n", height, desc->Height); + todo_wine_if(wine_todo && desc->ArraySize != array_size) + ok_(__FILE__, line)(desc->ArraySize == array_size, "Expected array_size %u, got %u.\n", array_size, + desc->ArraySize); + todo_wine_if(wine_todo && desc->MipLevels != mip_levels) + ok_(__FILE__, line)(desc->MipLevels == mip_levels, "Expected mip_levels %u, got %u.\n", mip_levels, + desc->MipLevels); + ok_(__FILE__, line)(desc->Format == format, "Expected texture format %#x, got %#x.\n", format, desc->Format); + todo_wine_if(wine_todo && desc->SampleDesc.Count != sample_count) + ok_(__FILE__, line)(desc->SampleDesc.Count == sample_count, "Expected sample_count %u, got %u.\n", sample_count, + desc->SampleDesc.Count); + todo_wine_if(wine_todo && desc->SampleDesc.Quality != sample_quality) + ok_(__FILE__, line)(desc->SampleDesc.Quality == sample_quality, "Expected sample_quality %u, got %u.\n", sample_quality, + desc->SampleDesc.Quality); + todo_wine_if(wine_todo && desc->Usage != usage) + ok_(__FILE__, line)(desc->Usage == usage, "Expected usage %u, got %u.\n", usage, + desc->Usage); + todo_wine_if(wine_todo && desc->BindFlags != bind_flags) + ok_(__FILE__, line)(desc->BindFlags == bind_flags, "Expected bind_flags %#x, got %#x.\n", bind_flags, + desc->BindFlags); + todo_wine_if(wine_todo && desc->CPUAccessFlags != cpu_access_flags) + ok_(__FILE__, line)(desc->CPUAccessFlags == cpu_access_flags, "Expected cpu_access_flags %#x, got %#x.\n", + cpu_access_flags, desc->CPUAccessFlags); + todo_wine_if(wine_todo && desc->MiscFlags != misc_flags) + ok_(__FILE__, line)(desc->MiscFlags == misc_flags, "Expected misc_flags %#x, got %#x.\n", misc_flags, + desc->MiscFlags); +} + +#define check_texture3d_desc_values(desc, width, height, depth, mip_levels, format, usage, bind_flags, cpu_access_flags, \ + misc_flags, wine_todo) \ + check_texture3d_desc_values_(__LINE__, desc, width, height, depth, mip_levels, format, usage, bind_flags, \ + cpu_access_flags, misc_flags, wine_todo) +static inline void check_texture3d_desc_values_(uint32_t line, const D3D11_TEXTURE3D_DESC *desc, uint32_t width, + uint32_t height, uint32_t depth, uint32_t mip_levels, DXGI_FORMAT format, D3D11_USAGE usage, uint32_t bind_flags, + uint32_t cpu_access_flags, uint32_t misc_flags, BOOL wine_todo) +{ + const D3D11_TEXTURE3D_DESC expected_desc = { width, height, depth, mip_levels, format, usage, bind_flags, + cpu_access_flags, misc_flags }; + BOOL matched; + + matched = !memcmp(&expected_desc, desc, sizeof(*desc)); + todo_wine_if(wine_todo) ok_(__FILE__, line)(matched, "Got unexpected 3D texture desc values.\n"); + if (matched) + return; + + todo_wine_if(wine_todo && desc->Width != width) + ok_(__FILE__, line)(desc->Width == width, "Expected width %u, got %u.\n", width, desc->Width); + todo_wine_if(wine_todo && desc->Height != height) + ok_(__FILE__, line)(desc->Height == height, "Expected height %u, got %u.\n", height, desc->Height); + todo_wine_if(wine_todo && desc->Depth != depth) + ok_(__FILE__, line)(desc->Depth == depth, "Expected depth %u, got %u.\n", depth, desc->Depth); + todo_wine_if(wine_todo && desc->MipLevels != mip_levels) + ok_(__FILE__, line)(desc->MipLevels == mip_levels, "Expected mip_levels %u, got %u.\n", mip_levels, + desc->MipLevels); + ok_(__FILE__, line)(desc->Format == format, "Expected texture format %#x, got %#x.\n", format, desc->Format); + todo_wine_if(wine_todo && desc->Usage != usage) + ok_(__FILE__, line)(desc->Usage == usage, "Expected usage %u, got %u.\n", usage, + desc->Usage); + todo_wine_if(wine_todo && desc->BindFlags != bind_flags) + ok_(__FILE__, line)(desc->BindFlags == bind_flags, "Expected bind_flags %#x, got %#x.\n", bind_flags, + desc->BindFlags); + todo_wine_if(wine_todo && desc->CPUAccessFlags != cpu_access_flags) + ok_(__FILE__, line)(desc->CPUAccessFlags == cpu_access_flags, "Expected cpu_access_flags %#x, got %#x.\n", + cpu_access_flags, desc->CPUAccessFlags); + todo_wine_if(wine_todo && desc->MiscFlags != misc_flags) + ok_(__FILE__, line)(desc->MiscFlags == misc_flags, "Expected misc_flags %#x, got %#x.\n", misc_flags, + desc->MiscFlags); +} + +/* + * Taken from the d3d11 tests. If there's a missing resource type or + * texture format checking function, check to see if it exists there first. + */ +struct resource_readback +{ + ID3D11Resource *resource; + D3D11_MAPPED_SUBRESOURCE map_desc; + ID3D11DeviceContext *immediate_context; + uint32_t width, height, depth, sub_resource_idx; +}; + +static void init_resource_readback(ID3D11Resource *resource, ID3D11Resource *readback_resource, + uint32_t width, uint32_t height, uint32_t depth, uint32_t sub_resource_idx, + ID3D11Device *device, struct resource_readback *rb) +{ + HRESULT hr; + + rb->resource = readback_resource; + rb->width = width; + rb->height = height; + rb->depth = depth; + rb->sub_resource_idx = sub_resource_idx; + + ID3D11Device_GetImmediateContext(device, &rb->immediate_context); + + ID3D11DeviceContext_CopyResource(rb->immediate_context, rb->resource, resource); + if (FAILED(hr = ID3D11DeviceContext_Map(rb->immediate_context, + rb->resource, sub_resource_idx, D3D11_MAP_READ, 0, &rb->map_desc))) + { + trace("Failed to map resource, hr %#lx.\n", hr); + ID3D11Resource_Release(rb->resource); + rb->resource = NULL; + ID3D11DeviceContext_Release(rb->immediate_context); + rb->immediate_context = NULL; + } +} + +static void get_texture_readback(ID3D11Texture2D *texture, uint32_t sub_resource_idx, + struct resource_readback *rb) +{ + D3D11_TEXTURE2D_DESC texture_desc; + ID3D11Resource *rb_texture; + uint32_t miplevel; + ID3D11Device *device; + HRESULT hr; + + memset(rb, 0, sizeof(*rb)); + + ID3D11Texture2D_GetDevice(texture, &device); + + ID3D11Texture2D_GetDesc(texture, &texture_desc); + texture_desc.Usage = D3D11_USAGE_STAGING; + texture_desc.BindFlags = 0; + texture_desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; + texture_desc.MiscFlags = 0; + if (FAILED(hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, (ID3D11Texture2D **)&rb_texture))) + { + trace("Failed to create texture, hr %#lx.\n", hr); + ID3D11Device_Release(device); + return; + } + + miplevel = sub_resource_idx % texture_desc.MipLevels; + init_resource_readback((ID3D11Resource *)texture, rb_texture, + max(1, texture_desc.Width >> miplevel), + max(1, texture_desc.Height >> miplevel), + 1, sub_resource_idx, device, rb); + + ID3D11Device_Release(device); +} + +static void get_texture3d_readback(ID3D11Texture3D *texture, unsigned int sub_resource_idx, + struct resource_readback *rb) +{ + D3D11_TEXTURE3D_DESC texture_desc; + ID3D11Resource *rb_texture; + unsigned int miplevel; + ID3D11Device *device; + HRESULT hr; + + memset(rb, 0, sizeof(*rb)); + + ID3D11Texture3D_GetDevice(texture, &device); + + ID3D11Texture3D_GetDesc(texture, &texture_desc); + texture_desc.Usage = D3D11_USAGE_STAGING; + texture_desc.BindFlags = 0; + texture_desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; + texture_desc.MiscFlags = 0; + if (FAILED(hr = ID3D11Device_CreateTexture3D(device, &texture_desc, NULL, (ID3D11Texture3D **)&rb_texture))) + { + trace("Failed to create texture, hr %#lx.\n", hr); + ID3D11Device_Release(device); + return; + } + + miplevel = sub_resource_idx % texture_desc.MipLevels; + init_resource_readback((ID3D11Resource *)texture, rb_texture, + max(1, texture_desc.Width >> miplevel), + max(1, texture_desc.Height >> miplevel), + max(1, texture_desc.Depth >> miplevel), + sub_resource_idx, device, rb); + + ID3D11Device_Release(device); +} + +static void *get_readback_data(struct resource_readback *rb, + uint32_t x, uint32_t y, uint32_t z, unsigned byte_width) +{ + return (uint8_t *)rb->map_desc.pData + z * rb->map_desc.DepthPitch + y * rb->map_desc.RowPitch + x * byte_width; +} + +static uint32_t get_readback_u32(struct resource_readback *rb, uint32_t x, uint32_t y, uint32_t z) +{ + return *(uint32_t *)get_readback_data(rb, x, y, z, sizeof(uint32_t)); +} + +static uint32_t get_readback_color(struct resource_readback *rb, uint32_t x, uint32_t y, uint32_t z) +{ + return get_readback_u32(rb, x, y, z); +} + +static void release_resource_readback(struct resource_readback *rb) +{ + ID3D11DeviceContext_Unmap(rb->immediate_context, rb->resource, rb->sub_resource_idx); + ID3D11Resource_Release(rb->resource); + ID3D11DeviceContext_Release(rb->immediate_context); +} + +static BOOL compare_color(uint32_t c1, uint32_t c2, uint8_t max_diff) +{ + return compare_uint(c1 & 0xff, c2 & 0xff, max_diff) + && compare_uint((c1 >> 8) & 0xff, (c2 >> 8) & 0xff, max_diff) + && compare_uint((c1 >> 16) & 0xff, (c2 >> 16) & 0xff, max_diff) + && compare_uint((c1 >> 24) & 0xff, (c2 >> 24) & 0xff, max_diff); +} + +#define check_readback_data_color(a, b, c, d) check_readback_data_color_(__LINE__, a, b, c, d) +static void check_readback_data_color_(uint32_t line, struct resource_readback *rb, + const RECT *rect, uint32_t expected_color, uint8_t max_diff) +{ + uint32_t x = 0, y = 0, z = 0, color = 0; + BOOL all_match = FALSE; + RECT default_rect; + + if (!rect) + { + SetRect(&default_rect, 0, 0, rb->width, rb->height); + rect = &default_rect; + } + + for (z = 0; z < rb->depth; ++z) + { + for (y = rect->top; y < rect->bottom; ++y) + { + for (x = rect->left; x < rect->right; ++x) + { + color = get_readback_color(rb, x, y, z); + if (!compare_color(color, expected_color, max_diff)) + goto done; + } + } + } + all_match = TRUE; + +done: + ok_(__FILE__, line)(all_match, + "Got 0x%08x, expected 0x%08x at (%u, %u, %u), sub-resource %u.\n", + color, expected_color, x, y, z, rb->sub_resource_idx); +} + +#define check_texture_sub_resource_color(a, b, c, d, e) check_texture_sub_resource_color_(__LINE__, a, b, c, d, e) +static void check_texture_sub_resource_color_(uint32_t line, ID3D11Texture2D *texture, + uint32_t sub_resource_idx, const RECT *rect, uint32_t expected_color, uint8_t max_diff) +{ + struct resource_readback rb; + + get_texture_readback(texture, sub_resource_idx, &rb); + check_readback_data_color_(line, &rb, rect, expected_color, max_diff); + release_resource_readback(&rb); +} + +static void set_d3dx11_image_load_info(D3DX11_IMAGE_LOAD_INFO *info, uint32_t width, uint32_t height, uint32_t depth, + uint32_t first_mip_level, uint32_t mip_levels, D3D11_USAGE usage, uint32_t bind_flags, uint32_t cpu_access_flags, + uint32_t misc_flags, DXGI_FORMAT format, uint32_t filter, uint32_t mip_filter, D3DX11_IMAGE_INFO *src_info) +{ + info->Width = width; + info->Height = height; + info->Depth = depth; + info->FirstMipLevel = first_mip_level; + info->MipLevels = mip_levels; + info->Usage = usage; + info->BindFlags = bind_flags; + info->CpuAccessFlags = cpu_access_flags; + info->MiscFlags = misc_flags; + info->Format = format; + info->Filter = filter; + info->MipFilter = mip_filter; + info->pSrcInfo = src_info; +} + +#define check_test_image_load_info_resource(resource, image_load_info) \ + check_test_image_load_info_resource_(__LINE__, resource, image_load_info) +static void check_test_image_load_info_resource_(uint32_t line, ID3D11Resource *resource, + const struct test_image_load_info *image_load_info) +{ + D3D11_RESOURCE_DIMENSION resource_dimension; + HRESULT hr; + + ID3D11Resource_GetType(resource, &resource_dimension); + ok(resource_dimension == image_load_info->expected_type, "Got unexpected ResourceDimension %u, expected %u.\n", + resource_dimension, image_load_info->expected_type); + + switch (resource_dimension) + { + case D3D11_RESOURCE_DIMENSION_TEXTURE2D: + { + const D3D11_TEXTURE2D_DESC *expected_desc_2d = &image_load_info->expected_resource_desc.desc_2d; + D3D11_TEXTURE2D_DESC desc_2d; + ID3D11Texture2D *tex_2d; + + hr = ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture2D, (void **)&tex_2d); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ID3D11Texture2D_GetDesc(tex_2d, &desc_2d); + check_texture2d_desc_values_(line, &desc_2d, expected_desc_2d->Width, expected_desc_2d->Height, + expected_desc_2d->MipLevels, expected_desc_2d->ArraySize, expected_desc_2d->Format, + expected_desc_2d->SampleDesc.Count, expected_desc_2d->SampleDesc.Quality, expected_desc_2d->Usage, + expected_desc_2d->BindFlags, expected_desc_2d->CPUAccessFlags, expected_desc_2d->MiscFlags, + image_load_info->todo_resource_desc); + ID3D11Texture2D_Release(tex_2d); + break; + } + + case D3D11_RESOURCE_DIMENSION_TEXTURE3D: + { + const D3D11_TEXTURE3D_DESC *expected_desc_3d = &image_load_info->expected_resource_desc.desc_3d; + D3D11_TEXTURE3D_DESC desc_3d; + ID3D11Texture3D *tex_3d; + + hr = ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture3D, (void **)&tex_3d); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ID3D11Texture3D_GetDesc(tex_3d, &desc_3d); + check_texture3d_desc_values_(line, &desc_3d, expected_desc_3d->Width, expected_desc_3d->Height, + expected_desc_3d->Depth, expected_desc_3d->MipLevels, expected_desc_3d->Format, expected_desc_3d->Usage, + expected_desc_3d->BindFlags, expected_desc_3d->CPUAccessFlags, expected_desc_3d->MiscFlags, + image_load_info->todo_resource_desc); + ID3D11Texture3D_Release(tex_3d); + break; + } + + default: + break; + } +} + +static void check_resource_info(ID3D11Resource *resource, const struct test_image *image, uint32_t line) +{ + unsigned int expected_mip_levels, expected_width, expected_height, max_dimension; + D3D11_RESOURCE_DIMENSION resource_dimension; + D3D11_TEXTURE2D_DESC desc_2d; + D3D11_TEXTURE3D_DESC desc_3d; + ID3D11Texture2D *texture_2d; + ID3D11Texture3D *texture_3d; + HRESULT hr; + + expected_width = image->expected_info.Width; + expected_height = image->expected_info.Height; + if (is_block_compressed(image->expected_info.Format)) + { + expected_width = (expected_width + 3) & ~3; + expected_height = (expected_height + 3) & ~3; + } + expected_mip_levels = 0; + max_dimension = max(expected_width, expected_height); + while (max_dimension) + { + ++expected_mip_levels; + max_dimension >>= 1; + } + + ID3D11Resource_GetType(resource, &resource_dimension); + ok(resource_dimension == image->expected_info.ResourceDimension, + "Got unexpected ResourceDimension %u, expected %u.\n", + resource_dimension, image->expected_info.ResourceDimension); + + switch (resource_dimension) + { + case D3D11_RESOURCE_DIMENSION_TEXTURE2D: + hr = ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture2D, (void **)&texture_2d); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ID3D11Texture2D_GetDesc(texture_2d, &desc_2d); + ok_(__FILE__, line)(desc_2d.Width == expected_width, + "Got unexpected Width %u, expected %u.\n", + desc_2d.Width, expected_width); + ok_(__FILE__, line)(desc_2d.Height == expected_height, + "Got unexpected Height %u, expected %u.\n", + desc_2d.Height, expected_height); + ok_(__FILE__, line)(desc_2d.MipLevels == expected_mip_levels, + "Got unexpected MipLevels %u, expected %u.\n", + desc_2d.MipLevels, expected_mip_levels); + ok_(__FILE__, line)(desc_2d.ArraySize == image->expected_info.ArraySize, + "Got unexpected ArraySize %u, expected %u.\n", + desc_2d.ArraySize, image->expected_info.ArraySize); + ok_(__FILE__, line)(desc_2d.Format == image->expected_info.Format, + "Got unexpected Format %u, expected %u.\n", + desc_2d.Format, image->expected_info.Format); + ok_(__FILE__, line)(desc_2d.SampleDesc.Count == 1, + "Got unexpected SampleDesc.Count %u, expected %u\n", + desc_2d.SampleDesc.Count, 1); + ok_(__FILE__, line)(desc_2d.SampleDesc.Quality == 0, + "Got unexpected SampleDesc.Quality %u, expected %u\n", + desc_2d.SampleDesc.Quality, 0); + ok_(__FILE__, line)(desc_2d.Usage == D3D11_USAGE_DEFAULT, + "Got unexpected Usage %u, expected %u\n", + desc_2d.Usage, D3D11_USAGE_DEFAULT); + ok_(__FILE__, line)(desc_2d.BindFlags == D3D11_BIND_SHADER_RESOURCE, + "Got unexpected BindFlags %#x, expected %#x\n", + desc_2d.BindFlags, D3D11_BIND_SHADER_RESOURCE); + ok_(__FILE__, line)(desc_2d.CPUAccessFlags == 0, + "Got unexpected CPUAccessFlags %#x, expected %#x\n", + desc_2d.CPUAccessFlags, 0); + ok_(__FILE__, line)(desc_2d.MiscFlags == image->expected_info.MiscFlags, + "Got unexpected MiscFlags %#x, expected %#x.\n", + desc_2d.MiscFlags, image->expected_info.MiscFlags); + + ID3D11Texture2D_Release(texture_2d); + break; + + case D3D11_RESOURCE_DIMENSION_TEXTURE3D: + hr = ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture3D, (void **)&texture_3d); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ID3D11Texture3D_GetDesc(texture_3d, &desc_3d); + ok_(__FILE__, line)(desc_3d.Width == expected_width, + "Got unexpected Width %u, expected %u.\n", + desc_3d.Width, expected_width); + ok_(__FILE__, line)(desc_3d.Height == expected_height, + "Got unexpected Height %u, expected %u.\n", + desc_3d.Height, expected_height); + ok_(__FILE__, line)(desc_3d.Depth == image->expected_info.Depth, + "Got unexpected Depth %u, expected %u.\n", + desc_3d.Depth, image->expected_info.Depth); + ok_(__FILE__, line)(desc_3d.MipLevels == expected_mip_levels, + "Got unexpected MipLevels %u, expected %u.\n", + desc_3d.MipLevels, expected_mip_levels); + ok_(__FILE__, line)(desc_3d.Format == image->expected_info.Format, + "Got unexpected Format %u, expected %u.\n", + desc_3d.Format, image->expected_info.Format); + ok_(__FILE__, line)(desc_3d.Usage == D3D11_USAGE_DEFAULT, + "Got unexpected Usage %u, expected %u\n", + desc_3d.Usage, D3D11_USAGE_DEFAULT); + ok_(__FILE__, line)(desc_3d.BindFlags == D3D11_BIND_SHADER_RESOURCE, + "Got unexpected BindFlags %#x, expected %#x\n", + desc_3d.BindFlags, D3D11_BIND_SHADER_RESOURCE); + ok_(__FILE__, line)(desc_3d.CPUAccessFlags == 0, + "Got unexpected CPUAccessFlags %#x, expected %#x\n", + desc_3d.CPUAccessFlags, 0); + ok_(__FILE__, line)(desc_3d.MiscFlags == image->expected_info.MiscFlags, + "Got unexpected MiscFlags %#x, expected %#x.\n", + desc_3d.MiscFlags, image->expected_info.MiscFlags); + ID3D11Texture3D_Release(texture_3d); + break; + + default: + break; + } +} + +static void check_texture2d_data(ID3D11Texture2D *texture, const struct test_image *image, unsigned int line) +{ + unsigned int width, height, stride, i, array_slice; + struct resource_readback rb; + D3D11_TEXTURE2D_DESC desc; + const BYTE *expected_data; + BOOL line_match; + + ID3D11Texture2D_GetDesc(texture, &desc); + width = desc.Width; + height = desc.Height; + stride = (width * get_bpp_from_format(desc.Format) + 7) / 8; + if (is_block_compressed(desc.Format)) + { + stride *= 4; + height /= 4; + } + + expected_data = image->expected_data; + for (array_slice = 0; array_slice < desc.ArraySize; ++array_slice) + { + get_texture_readback(texture, array_slice * desc.MipLevels, &rb); + for (i = 0; i < height; ++i) + { + const uint8_t *rb_data = get_readback_data(&rb, 0, i, 0, 0); + + line_match = !memcmp(expected_data + stride * i, rb_data, stride); + todo_wine_if(is_block_compressed(image->expected_info.Format) && image->data != test_dds_dxt5 + && (image->expected_info.Width % 4 != 0 || image->expected_info.Height % 4 != 0)) + ok_(__FILE__, line)(line_match, "Data mismatch for line %u, array slice %u.\n", i, array_slice); + if (!line_match) + break; + } + expected_data += stride * height; + release_resource_readback(&rb); + } +} + +static void check_texture3d_data(ID3D11Texture3D *texture, const struct test_image *image, unsigned int line) +{ + unsigned int width, height, depth, stride, i, j; + struct resource_readback rb; + D3D11_TEXTURE3D_DESC desc; + const BYTE *expected_data; + BOOL line_match; + + ID3D11Texture3D_GetDesc(texture, &desc); + width = desc.Width; + height = desc.Height; + depth = desc.Depth; + stride = (width * get_bpp_from_format(desc.Format) + 7) / 8; + if (is_block_compressed(desc.Format)) + { + stride *= 4; + height /= 4; + } + + expected_data = image->expected_data; + get_texture3d_readback(texture, 0, &rb); + for (j = 0; j < depth; ++j) + { + const BYTE *expected_data_slice = expected_data + ((stride * height) * j); + + for (i = 0; i < height; ++i) + { + const uint8_t *rb_data = get_readback_data(&rb, 0, i, j, 0); + + line_match = !memcmp(expected_data_slice + stride * i, rb_data, stride); + ok_(__FILE__, line)(line_match, "Data mismatch for line %u.\n", i); + if (!line_match) + { + for (unsigned int k = 0; k < stride; ++k) + trace("%02x\n", *((BYTE *)get_readback_data(&rb, k, i, j, 1))); + break; + } + } + } + release_resource_readback(&rb); +} + +static void check_resource_data(ID3D11Resource *resource, const struct test_image *image, unsigned int line) +{ + ID3D11Texture3D *texture3d; + ID3D11Texture2D *texture2d; + + if (SUCCEEDED(ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture3D, (void **)&texture3d))) + { + if (wined3d_opengl && is_block_compressed(image->expected_info.Format)) + skip("Skipping compressed format 3D texture readback test.\n"); + else + check_texture3d_data(texture3d, image, line); + ID3D11Texture3D_Release(texture3d); + } + else if (SUCCEEDED(ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture2D, (void **)&texture2d))) + { + check_texture2d_data(texture2d, image, line); + ID3D11Texture2D_Release(texture2d); + } + else + { + ok(0, "Failed to get 2D or 3D texture interface.\n"); + } +} + static WCHAR temp_dir[MAX_PATH]; static char *get_str_a(const WCHAR *wstr) @@ -1405,6 +2212,34 @@ static void delete_directory(const WCHAR *dir) RemoveDirectoryW(path); } +static ID3D11Device *create_device(void) +{ + HRESULT (WINAPI *pD3D11CreateDevice)(IDXGIAdapter *, D3D_DRIVER_TYPE, HMODULE, UINT, const D3D_FEATURE_LEVEL *, + UINT, UINT, ID3D11Device **, D3D_FEATURE_LEVEL *, ID3D11DeviceContext **); + HMODULE d3d11_mod = LoadLibraryA("d3d11.dll"); + ID3D11Device *device; + + + if (!d3d11_mod) + { + win_skip("d3d11.dll not present\n"); + return NULL; + } + + pD3D11CreateDevice = (void *)GetProcAddress(d3d11_mod, "D3D11CreateDevice"); + if (SUCCEEDED(pD3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, + NULL, 0, D3D11_SDK_VERSION, &device, NULL, NULL))) + return device; + if (SUCCEEDED(pD3D11CreateDevice(NULL, D3D_DRIVER_TYPE_WARP, NULL, 0, + NULL, 0, D3D11_SDK_VERSION, &device, NULL, NULL))) + return device; + if (SUCCEEDED(pD3D11CreateDevice(NULL, D3D_DRIVER_TYPE_REFERENCE, NULL, 0, + NULL, 0, D3D11_SDK_VERSION, &device, NULL, NULL))) + return device; + + return NULL; +} + static void test_D3DX11CreateAsyncMemoryLoader(void) { ID3DX11DataLoader *loader; @@ -1844,7 +2679,6 @@ struct dds_header DWORD reserved2; }; -#define DDS_RESOURCE_MISC_TEXTURECUBE 0x04 struct dds_header_dxt10 { DWORD dxgi_format; @@ -2580,12 +3414,213 @@ static void test_get_image_info(void) CoUninitialize(); } +static void test_create_texture(void) +{ + static const uint32_t dds_24bit_8_8_mip_level_expected[] = { 0xff0000ff, 0xff00ff00, 0xffff0000, 0xff000000 }; + D3D11_TEXTURE2D_DESC tex_2d_desc; + D3DX11_IMAGE_LOAD_INFO load_info; + D3DX11_IMAGE_INFO img_info; + ID3D11Resource *resource; + ID3D11Texture2D *tex_2d; + ID3D11Device *device; + uint32_t i, mip_level; + HRESULT hr, hr2; + + device = create_device(); + if (!device) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + CoInitialize(NULL); + + /* D3DX11CreateTextureFromMemory tests */ + resource = (ID3D11Resource *)0xdeadbeef; + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromMemory(NULL, test_bmp_1bpp, sizeof(test_bmp_1bpp), NULL, NULL, &resource, &hr2); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + ok(resource == (ID3D11Resource *)0xdeadbeef, "Got unexpected resource %p.\n", resource); + + resource = (ID3D11Resource *)0xdeadbeef; + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromMemory(device, NULL, 0, NULL, NULL, &resource, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + ok(resource == (ID3D11Resource *)0xdeadbeef, "Got unexpected resource %p.\n", resource); + + resource = (ID3D11Resource *)0xdeadbeef; + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromMemory(device, NULL, sizeof(test_bmp_1bpp), NULL, NULL, &resource, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + ok(resource == (ID3D11Resource *)0xdeadbeef, "Got unexpected resource %p.\n", resource); + + resource = (ID3D11Resource *)0xdeadbeef; + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromMemory(device, test_bmp_1bpp, 0, NULL, NULL, &resource, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(resource == (ID3D11Resource *)0xdeadbeef, "Got unexpected resource %p.\n", resource); + + resource = (ID3D11Resource *)0xdeadbeef; + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromMemory(device, test_bmp_1bpp, sizeof(test_bmp_1bpp) - 1, NULL, NULL, &resource, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(resource == (ID3D11Resource *)0xdeadbeef, "Got unexpected resource %p.\n", resource); + + for (i = 0; i < ARRAY_SIZE(test_image); ++i) + { + winetest_push_context("Test %u", i); + + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromMemory(device, test_image[i].data, test_image[i].size, NULL, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + check_resource_info(resource, test_image + i, __LINE__); + check_resource_data(resource, test_image + i, __LINE__); + ID3D11Resource_Release(resource); + } + + winetest_pop_context(); + } + + for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) + { + const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; + + winetest_push_context("Test %u", i); + + hr2 = 0xdeadbeef; + load_info = test_load_info->load_info; + hr = D3DX11CreateTextureFromMemory(device, test_load_info->data, test_load_info->size, &load_info, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D11Resource_Release(resource); + + winetest_pop_context(); + } + + for (i = 0; i < ARRAY_SIZE(test_image_load_info); ++i) + { + const struct test_image_load_info *test_load_info = &test_image_load_info[i]; + + winetest_push_context("Test %u", i); + + load_info = test_load_info->load_info; + load_info.pSrcInfo = &img_info; + + resource = NULL; + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromMemory(device, test_load_info->data, test_load_info->size, &load_info, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + check_test_image_load_info_resource(resource, test_load_info); + ID3D11Resource_Release(resource); + } + + winetest_pop_context(); + } + + /* Check behavior of the FirstMipLevel argument. */ + for (i = 0; i < 2; ++i) + { + winetest_push_context("FirstMipLevel %u", i); + memset(&img_info, 0, sizeof(img_info)); + set_d3dx11_image_load_info(&load_info, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, i, D3DX11_FROM_FILE, + D3D11_USAGE_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, + D3DX11_DEFAULT, &img_info); + + resource = NULL; + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromMemory(device, dds_24bit_8_8, sizeof(dds_24bit_8_8), &load_info, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_DDS, FALSE); + + hr = ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture2D, (void **)&tex_2d); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + ID3D11Texture2D_GetDesc(tex_2d, &tex_2d_desc); + check_texture2d_desc_values(&tex_2d_desc, 8, 8, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D11_USAGE_DEFAULT, + D3D11_BIND_SHADER_RESOURCE, 0, 0, FALSE); + for (mip_level = 0; mip_level < 4; ++mip_level) + { + winetest_push_context("MipLevel %u", mip_level); + check_texture_sub_resource_color(tex_2d, mip_level, NULL, + dds_24bit_8_8_mip_level_expected[min(3, mip_level + i)], 0); + winetest_pop_context(); + } + + ID3D11Texture2D_Release(tex_2d); + ID3D11Resource_Release(resource); + winetest_pop_context(); + } + + /* + * If FirstMipLevel is set to a value that is larger than the total number + * of mip levels in the image, it falls back to 0. + */ + memset(&img_info, 0, sizeof(img_info)); + set_d3dx11_image_load_info(&load_info, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, 5, D3DX11_FROM_FILE, + D3D11_USAGE_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, + D3DX11_DEFAULT, &img_info); + + resource = NULL; + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromMemory(device, dds_24bit_8_8, sizeof(dds_24bit_8_8), &load_info, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_DDS, FALSE); + + hr = ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture2D, (void **)&tex_2d); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ID3D11Texture2D_GetDesc(tex_2d, &tex_2d_desc); + check_texture2d_desc_values(&tex_2d_desc, 8, 8, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D11_USAGE_DEFAULT, + D3D11_BIND_SHADER_RESOURCE, 0, 0, FALSE); + for (mip_level = 0; mip_level < 4; ++mip_level) + { + winetest_push_context("MipLevel %u", mip_level); + check_texture_sub_resource_color(tex_2d, mip_level, NULL, dds_24bit_8_8_mip_level_expected[mip_level], 0); + winetest_pop_context(); + } + + ID3D11Texture2D_Release(tex_2d); + ID3D11Resource_Release(resource); + + CoUninitialize(); + + ok(!ID3D11Device_Release(device), "Unexpected refcount.\n"); +} + START_TEST(d3dx11) { + HMODULE wined3d; + + if ((wined3d = GetModuleHandleA("wined3d.dll"))) + { + enum wined3d_renderer (CDECL *p_wined3d_get_renderer)(void); + + if ((p_wined3d_get_renderer = (void *)GetProcAddress(wined3d, "wined3d_get_renderer")) + && p_wined3d_get_renderer() == WINED3D_RENDERER_OPENGL) + wined3d_opengl = true; + } + test_D3DX11CreateAsyncMemoryLoader(); test_D3DX11CreateAsyncFileLoader(); test_D3DX11CreateAsyncResourceLoader(); test_D3DX11CreateAsyncTextureInfoProcessor(); test_D3DX11CompileFromFile(); test_get_image_info(); + test_create_texture(); } diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c index 4a49bc0c4509..eb05ac24be87 100644 --- a/dlls/d3dx11_43/texture.c +++ b/dlls/d3dx11_43/texture.c @@ -55,16 +55,6 @@ HRESULT WINAPI D3DX11CreateTextureFromFileW(ID3D11Device *device, const WCHAR *f return E_NOTIMPL; } -HRESULT WINAPI D3DX11CreateTextureFromMemory(ID3D11Device *device, const void *data, - SIZE_T data_size, D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, - ID3D11Resource **texture, HRESULT *hresult) -{ - FIXME("device %p, data %p, data_size %Iu, load_info %p, pump %p, texture %p, hresult %p stub.\n", - device, data, data_size, load_info, pump, texture, hresult); - - return E_NOTIMPL; -} - HRESULT WINAPI D3DX11SaveTextureToFileW(ID3D11DeviceContext *context, ID3D11Resource *texture, D3DX11_IMAGE_FILE_FORMAT format, const WCHAR *filename) { @@ -371,3 +361,336 @@ HRESULT WINAPI D3DX11GetImageInfoFromMemory(const void *src_data, SIZE_T src_dat *hresult = hr; return hr; } + +static void init_load_info(const D3DX11_IMAGE_LOAD_INFO *load_info, D3DX11_IMAGE_LOAD_INFO *out) +{ + if (load_info) + { + *out = *load_info; + return; + } + + out->Width = D3DX11_DEFAULT; + out->Height = D3DX11_DEFAULT; + out->Depth = D3DX11_DEFAULT; + out->FirstMipLevel = D3DX11_DEFAULT; + out->MipLevels = D3DX11_DEFAULT; + out->Usage = D3DX11_DEFAULT; + out->BindFlags = D3DX11_DEFAULT; + out->CpuAccessFlags = D3DX11_DEFAULT; + out->MiscFlags = D3DX11_DEFAULT; + out->Format = D3DX11_DEFAULT; + out->Filter = D3DX11_DEFAULT; + out->MipFilter = D3DX11_DEFAULT; + out->pSrcInfo = NULL; +} + +static HRESULT d3dx_create_subresource_data_for_texture(uint32_t width, uint32_t height, uint32_t depth, + uint32_t mip_levels, uint32_t layer_count, const struct pixel_format_desc *fmt_desc, + D3D11_SUBRESOURCE_DATA **out_sub_rsrc_data, uint8_t **pixel_data) +{ + uint8_t *sub_rsrc_data = NULL, *pixels_ptr; + uint32_t i, j, pixels_size, pixels_offset; + D3D11_SUBRESOURCE_DATA *sub_rsrcs = NULL; + HRESULT hr = S_OK; + + *pixel_data = NULL; + *out_sub_rsrc_data = NULL; + + pixels_offset = (sizeof(*sub_rsrcs) * mip_levels * layer_count); + pixels_size = d3dx_calculate_layer_pixels_size(fmt_desc->format, width, height, depth, mip_levels) * layer_count; + if (!(sub_rsrc_data = malloc(pixels_size + pixels_offset))) + return E_FAIL; + + sub_rsrcs = (D3D11_SUBRESOURCE_DATA *)sub_rsrc_data; + pixels_ptr = sub_rsrc_data + pixels_offset; + for (i = 0; i < layer_count; ++i) + { + struct volume size = { width, height, depth }; + + for (j = 0; j < mip_levels; ++j) + { + uint32_t row_pitch, slice_pitch; + + hr = d3dx_calculate_pixels_size(fmt_desc->format, size.width, size.height, &row_pitch, &slice_pitch); + if (FAILED(hr)) + break; + + sub_rsrcs[i * mip_levels + j].pSysMem = pixels_ptr; + sub_rsrcs[i * mip_levels + j].SysMemPitch = row_pitch; + sub_rsrcs[i * mip_levels + j].SysMemSlicePitch = slice_pitch; + + pixels_ptr += slice_pitch * size.depth; + d3dx_get_next_mip_level_size(&size); + } + } + + if (SUCCEEDED(hr)) + { + *pixel_data = sub_rsrc_data + pixels_offset; + *out_sub_rsrc_data = sub_rsrcs; + sub_rsrc_data = NULL; + } + + free(sub_rsrc_data); + return hr; +} + +static HRESULT load_texture_data(const void *data, SIZE_T size, D3DX11_IMAGE_LOAD_INFO *load_info, + D3D11_SUBRESOURCE_DATA **resource_data) +{ + const struct pixel_format_desc *fmt_desc, *src_desc; + uint32_t i, j, loaded_mip_levels, max_mip_levels; + D3D11_SUBRESOURCE_DATA *sub_rsrcs = NULL; + D3DX11_IMAGE_INFO img_info; + struct d3dx_image image; + uint8_t *pixels_ptr; + HRESULT hr; + + if (!data || !size) + return E_FAIL; + + if (FAILED(hr = d3dx_handle_filter(&load_info->Filter))) + { + ERR("Invalid filter argument %#x.\n", load_info->Filter); + return hr; + } + + hr = d3dx_image_init(data, size, &image, 0, D3DX_IMAGE_SUPPORT_DXT10); + if (FAILED(hr)) + return E_FAIL; + + hr = d3dx11_image_info_from_d3dx_image(&img_info, &image); + if (FAILED(hr)) + { + WARN("Invalid or unsupported image file, hr %#lx.\n", hr); + hr = E_FAIL; + goto end; + } + + if ((!(img_info.MiscFlags & D3D11_RESOURCE_MISC_TEXTURECUBE) || img_info.ArraySize != 6) + && img_info.ArraySize != 1) + { + FIXME("img_info.ArraySize = %u not supported.\n", img_info.ArraySize); + hr = E_NOTIMPL; + goto end; + } + + if (load_info->FirstMipLevel == D3DX11_DEFAULT || (load_info->FirstMipLevel >= img_info.MipLevels)) + load_info->FirstMipLevel = 0; + if (load_info->Format == D3DX11_DEFAULT || load_info->Format == DXGI_FORMAT_FROM_FILE) + load_info->Format = img_info.Format; + fmt_desc = get_d3dx_pixel_format_info(d3dx_pixel_format_id_from_dxgi_format(load_info->Format)); + if (fmt_desc->format == D3DX_PIXEL_FORMAT_COUNT) + { + FIXME("Unknown DXGI format supplied, %#x.\n", load_info->Format); + hr = E_NOTIMPL; + goto end; + } + + /* Potentially round up width/height to align with block size. */ + if (!load_info->Width || load_info->Width == D3DX11_FROM_FILE || load_info->Width == D3DX11_DEFAULT) + load_info->Width = (img_info.Width + fmt_desc->block_width - 1) & ~(fmt_desc->block_width - 1); + if (!load_info->Height || load_info->Height == D3DX11_FROM_FILE || load_info->Height == D3DX11_DEFAULT) + load_info->Height = (img_info.Height + fmt_desc->block_height - 1) & ~(fmt_desc->block_height - 1); + + if (!load_info->Depth || load_info->Depth == D3DX11_FROM_FILE || load_info->Depth == D3DX11_DEFAULT) + load_info->Depth = img_info.Depth; + if ((load_info->Depth > 1) && (img_info.ResourceDimension != D3D11_RESOURCE_DIMENSION_TEXTURE3D)) + { + hr = E_FAIL; + goto end; + } + + max_mip_levels = d3dx_get_max_mip_levels_for_size(load_info->Width, load_info->Height, load_info->Depth); + if (!load_info->MipLevels || load_info->MipLevels == D3DX11_DEFAULT || load_info->MipLevels == D3DX11_FROM_FILE) + load_info->MipLevels = (load_info->MipLevels == D3DX11_FROM_FILE) ? img_info.MipLevels : max_mip_levels; + load_info->MipLevels = min(max_mip_levels, load_info->MipLevels); + + hr = d3dx_create_subresource_data_for_texture(load_info->Width, load_info->Height, load_info->Depth, + load_info->MipLevels, img_info.ArraySize, fmt_desc, &sub_rsrcs, &pixels_ptr); + if (FAILED(hr)) + goto end; + + src_desc = get_d3dx_pixel_format_info(image.format); + loaded_mip_levels = min((img_info.MipLevels - load_info->FirstMipLevel), load_info->MipLevels); + for (i = 0; i < img_info.ArraySize; ++i) + { + struct volume dst_size = { load_info->Width, load_info->Height, load_info->Depth }; + + for (j = 0; j < loaded_mip_levels; ++j) + { + D3D11_SUBRESOURCE_DATA *sub_rsrc = &sub_rsrcs[i * load_info->MipLevels + j]; + const RECT unaligned_rect = { 0, 0, dst_size.width, dst_size.height }; + struct d3dx_pixels src_pixels, dst_pixels; + + hr = d3dx_image_get_pixels(&image, i, j + load_info->FirstMipLevel, &src_pixels); + if (FAILED(hr)) + goto end; + + set_d3dx_pixels(&dst_pixels, sub_rsrc->pSysMem, sub_rsrc->SysMemPitch, sub_rsrc->SysMemSlicePitch, NULL, + dst_size.width, dst_size.height, dst_size.depth, &unaligned_rect); + + hr = d3dx_load_pixels_from_pixels(&dst_pixels, fmt_desc, &src_pixels, src_desc, load_info->Filter, 0); + if (FAILED(hr)) + goto end; + + d3dx_get_next_mip_level_size(&dst_size); + } + } + + if (loaded_mip_levels < load_info->MipLevels) + { + struct volume base_level_size = { load_info->Width, load_info->Height, load_info->Depth }; + + if (FAILED(hr = d3dx_handle_filter(&load_info->MipFilter))) + { + ERR("Invalid mip filter argument %#x.\n", load_info->MipFilter); + goto end; + } + + d3dx_get_mip_level_size(&base_level_size, loaded_mip_levels - 1); + for (i = 0; i < img_info.ArraySize; ++i) + { + struct volume src_size, dst_size; + + src_size = dst_size = base_level_size; + for (j = (loaded_mip_levels - 1); j < (load_info->MipLevels - 1); ++j) + { + D3D11_SUBRESOURCE_DATA *dst_data = &sub_rsrcs[i * load_info->MipLevels + j + 1]; + D3D11_SUBRESOURCE_DATA *src_data = &sub_rsrcs[i * load_info->MipLevels + j]; + const RECT src_unaligned_rect = { 0, 0, src_size.width, src_size.height }; + struct d3dx_pixels src_pixels, dst_pixels; + RECT dst_unaligned_rect; + + d3dx_get_next_mip_level_size(&dst_size); + SetRect(&dst_unaligned_rect, 0, 0, dst_size.width, dst_size.height); + set_d3dx_pixels(&dst_pixels, dst_data->pSysMem, dst_data->SysMemPitch, dst_data->SysMemSlicePitch, NULL, + dst_size.width, dst_size.height, dst_size.depth, &dst_unaligned_rect); + set_d3dx_pixels(&src_pixels, src_data->pSysMem, src_data->SysMemPitch, src_data->SysMemSlicePitch, NULL, + src_size.width, src_size.height, src_size.depth, &src_unaligned_rect); + + hr = d3dx_load_pixels_from_pixels(&dst_pixels, fmt_desc, &src_pixels, fmt_desc, load_info->MipFilter, 0); + if (FAILED(hr)) + goto end; + + src_size = dst_size; + } + } + } + + if (load_info->pSrcInfo) + *load_info->pSrcInfo = img_info; + load_info->Usage = (load_info->Usage == D3DX11_DEFAULT) ? D3D11_USAGE_DEFAULT : load_info->Usage; + load_info->BindFlags = (load_info->BindFlags == D3DX11_DEFAULT) ? D3D11_BIND_SHADER_RESOURCE : load_info->BindFlags; + load_info->CpuAccessFlags = (load_info->CpuAccessFlags == D3DX11_DEFAULT) ? 0 : load_info->CpuAccessFlags; + load_info->MiscFlags = (load_info->MiscFlags == D3DX11_DEFAULT) ? 0 : load_info->MiscFlags; + load_info->MiscFlags |= img_info.MiscFlags; + *resource_data = sub_rsrcs; + sub_rsrcs = NULL; + +end: + d3dx_image_cleanup(&image); + free(sub_rsrcs); + return hr; +} + +static HRESULT create_d3d_texture(ID3D11Device *device, D3DX11_IMAGE_LOAD_INFO *load_info, + D3D11_SUBRESOURCE_DATA *resource_data, ID3D11Resource **texture) +{ + HRESULT hr; + + *texture = NULL; + switch (load_info->pSrcInfo->ResourceDimension) + { + case D3D11_RESOURCE_DIMENSION_TEXTURE2D: + { + D3D11_TEXTURE2D_DESC texture_2d_desc = { 0 }; + ID3D11Texture2D *texture_2d; + + texture_2d_desc.Width = load_info->Width; + texture_2d_desc.Height = load_info->Height; + texture_2d_desc.MipLevels = load_info->MipLevels; + texture_2d_desc.ArraySize = load_info->pSrcInfo->ArraySize; + texture_2d_desc.Format = load_info->Format; + texture_2d_desc.SampleDesc.Count = 1; + texture_2d_desc.Usage = load_info->Usage; + texture_2d_desc.BindFlags = load_info->BindFlags; + texture_2d_desc.CPUAccessFlags = load_info->CpuAccessFlags; + texture_2d_desc.MiscFlags = load_info->MiscFlags; + + if (FAILED(hr = ID3D11Device_CreateTexture2D(device, &texture_2d_desc, resource_data, &texture_2d))) + return hr; + *texture = (ID3D11Resource *)texture_2d; + break; + } + + case D3D11_RESOURCE_DIMENSION_TEXTURE3D: + { + D3D11_TEXTURE3D_DESC texture_3d_desc = { 0 }; + ID3D11Texture3D *texture_3d; + + texture_3d_desc.Width = load_info->Width; + texture_3d_desc.Height = load_info->Height; + texture_3d_desc.Depth = load_info->Depth; + texture_3d_desc.MipLevels = load_info->MipLevels; + texture_3d_desc.Format = load_info->Format; + texture_3d_desc.Usage = load_info->Usage; + texture_3d_desc.BindFlags = load_info->BindFlags; + texture_3d_desc.CPUAccessFlags = load_info->CpuAccessFlags; + texture_3d_desc.MiscFlags = load_info->MiscFlags; + + if (FAILED(hr = ID3D11Device_CreateTexture3D(device, &texture_3d_desc, resource_data, &texture_3d))) + return hr; + *texture = (ID3D11Resource *)texture_3d; + break; + } + + default: + FIXME("Unhandled resource dimension %d.\n", load_info->pSrcInfo->ResourceDimension); + return E_NOTIMPL; + } + + return S_OK; +} + +static HRESULT create_texture(ID3D11Device *device, const void *data, SIZE_T size, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3D11Resource **texture) +{ + D3D11_SUBRESOURCE_DATA *resource_data; + D3DX11_IMAGE_LOAD_INFO load_info_copy; + D3DX11_IMAGE_INFO img_info; + HRESULT hr; + + init_load_info(load_info, &load_info_copy); + if (load_info_copy.pSrcInfo == NULL) + load_info_copy.pSrcInfo = &img_info; + + if (FAILED((hr = load_texture_data(data, size, &load_info_copy, &resource_data)))) + return hr; + hr = create_d3d_texture(device, &load_info_copy, resource_data, texture); + free(resource_data); + return hr; +} + +HRESULT WINAPI D3DX11CreateTextureFromMemory(ID3D11Device *device, const void *src_data, SIZE_T src_data_size, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11Resource **texture, HRESULT *hresult) +{ + HRESULT hr; + + TRACE("device %p, src_data %p, src_data_size %Iu, load_info %p, pump %p, texture %p, hresult %p.\n", + device, src_data, src_data_size, load_info, pump, texture, hresult); + + if (!device) + return E_INVALIDARG; + if (!src_data) + return E_FAIL; + + if (pump) + FIXME("Thread pump is not supported yet.\n"); + + hr = create_texture(device, src_data, src_data_size, load_info, texture); + if (hresult) + *hresult = hr; + return hr; +} From c2d80514d2b04a30d6da6d4866984aba78ebef53 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 29 Aug 2024 07:55:19 -0400 Subject: [PATCH 0967/2542] d3dx11: Implement D3DX11CreateAsyncTextureProcessor(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx11_42/d3dx11_42.spec | 2 +- dlls/d3dx11_43/async.c | 86 ++++++++++++++++++++++++++++++++ dlls/d3dx11_43/d3dx11_43.spec | 2 +- dlls/d3dx11_43/dxhelpers.h | 8 +++ dlls/d3dx11_43/tests/d3dx11.c | 92 +++++++++++++++++++++++++++++++++++ dlls/d3dx11_43/texture.c | 6 +-- include/d3dx11async.h | 2 + 7 files changed, 193 insertions(+), 5 deletions(-) diff --git a/dlls/d3dx11_42/d3dx11_42.spec b/dlls/d3dx11_42/d3dx11_42.spec index 48652ce52e7b..415ece1f2a92 100644 --- a/dlls/d3dx11_42/d3dx11_42.spec +++ b/dlls/d3dx11_42/d3dx11_42.spec @@ -14,7 +14,7 @@ @ stub D3DX11CreateAsyncShaderPreprocessProcessor @ stub D3DX11CreateAsyncShaderResourceViewProcessor @ stdcall -import D3DX11CreateAsyncTextureInfoProcessor(ptr ptr) -@ stub D3DX11CreateAsyncTextureProcessor +@ stdcall -import D3DX11CreateAsyncTextureProcessor(ptr ptr ptr) @ stub D3DX11CreateShaderResourceViewFromFileA @ stub D3DX11CreateShaderResourceViewFromFileW @ stdcall -import D3DX11CreateShaderResourceViewFromMemory(ptr ptr long ptr ptr ptr ptr) diff --git a/dlls/d3dx11_43/async.c b/dlls/d3dx11_43/async.c index 19e087a435eb..b05b793e333a 100644 --- a/dlls/d3dx11_43/async.c +++ b/dlls/d3dx11_43/async.c @@ -228,6 +228,67 @@ static ID3DX11DataProcessorVtbl texture_info_processor_vtbl = texture_info_processor_Destroy }; +struct texture_processor +{ + ID3DX11DataProcessor ID3DX11DataProcessor_iface; + ID3D11Device *device; + D3DX11_IMAGE_INFO img_info; + D3DX11_IMAGE_LOAD_INFO load_info; + D3D11_SUBRESOURCE_DATA *resource_data; +}; + +static inline struct texture_processor *texture_processor_from_ID3DX11DataProcessor(ID3DX11DataProcessor *iface) +{ + return CONTAINING_RECORD(iface, struct texture_processor, ID3DX11DataProcessor_iface); +} + +static HRESULT WINAPI texture_processor_Process(ID3DX11DataProcessor *iface, void *data, SIZE_T size) +{ + struct texture_processor *processor = texture_processor_from_ID3DX11DataProcessor(iface); + + TRACE("iface %p, data %p, size %Iu.\n", iface, data, size); + + if (processor->resource_data) + { + WARN("Called multiple times.\n"); + free(processor->resource_data); + processor->resource_data = NULL; + } + return load_texture_data(data, size, &processor->load_info, &processor->resource_data); +} + +static HRESULT WINAPI texture_processor_CreateDeviceObject(ID3DX11DataProcessor *iface, void **object) +{ + struct texture_processor *processor = texture_processor_from_ID3DX11DataProcessor(iface); + + TRACE("iface %p, object %p.\n", iface, object); + + if (!processor->resource_data) + return E_FAIL; + + return create_d3d_texture(processor->device, &processor->load_info, + processor->resource_data, (ID3D11Resource **)object); +} + +static HRESULT WINAPI texture_processor_Destroy(ID3DX11DataProcessor *iface) +{ + struct texture_processor *processor = texture_processor_from_ID3DX11DataProcessor(iface); + + TRACE("iface %p.\n", iface); + + ID3D11Device_Release(processor->device); + free(processor->resource_data); + free(processor); + return S_OK; +} + +static ID3DX11DataProcessorVtbl texture_processor_vtbl = +{ + texture_processor_Process, + texture_processor_CreateDeviceObject, + texture_processor_Destroy +}; + HRESULT WINAPI D3DX11CompileFromMemory(const char *data, SIZE_T data_size, const char *filename, const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *entry_point, const char *target, UINT sflags, UINT eflags, ID3DX11ThreadPump *pump, ID3D10Blob **shader, @@ -443,3 +504,28 @@ HRESULT WINAPI D3DX11CreateAsyncTextureInfoProcessor(D3DX11_IMAGE_INFO *info, ID *processor = &object->ID3DX11DataProcessor_iface; return S_OK; } + +HRESULT WINAPI D3DX11CreateAsyncTextureProcessor(ID3D11Device *device, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11DataProcessor **processor) +{ + struct texture_processor *object; + + TRACE("device %p, load_info %p, processor %p.\n", device, load_info, processor); + + if (!device || !processor) + return E_INVALIDARG; + + object = calloc(1, sizeof(*object)); + if (!object) + return E_OUTOFMEMORY; + + object->ID3DX11DataProcessor_iface.lpVtbl = &texture_processor_vtbl; + object->device = device; + ID3D11Device_AddRef(device); + init_load_info(load_info, &object->load_info); + if (!object->load_info.pSrcInfo) + object->load_info.pSrcInfo = &object->img_info; + + *processor = &object->ID3DX11DataProcessor_iface; + return S_OK; +} diff --git a/dlls/d3dx11_43/d3dx11_43.spec b/dlls/d3dx11_43/d3dx11_43.spec index c199b7c0a89c..dc972641eade 100644 --- a/dlls/d3dx11_43/d3dx11_43.spec +++ b/dlls/d3dx11_43/d3dx11_43.spec @@ -14,7 +14,7 @@ @ stub D3DX11CreateAsyncShaderPreprocessProcessor @ stub D3DX11CreateAsyncShaderResourceViewProcessor @ stdcall D3DX11CreateAsyncTextureInfoProcessor(ptr ptr) -@ stub D3DX11CreateAsyncTextureProcessor +@ stdcall D3DX11CreateAsyncTextureProcessor(ptr ptr ptr) @ stub D3DX11CreateShaderResourceViewFromFileA @ stub D3DX11CreateShaderResourceViewFromFileW @ stdcall D3DX11CreateShaderResourceViewFromMemory(ptr ptr long ptr ptr ptr ptr) diff --git a/dlls/d3dx11_43/dxhelpers.h b/dlls/d3dx11_43/dxhelpers.h index bcdcc99ed5a5..498b30a590cc 100644 --- a/dlls/d3dx11_43/dxhelpers.h +++ b/dlls/d3dx11_43/dxhelpers.h @@ -19,3 +19,11 @@ #include "../d3dx9_36/d3dx_helpers.h" HRESULT get_image_info(const void *data, SIZE_T size, D3DX11_IMAGE_INFO *img_info); + +void init_load_info(const D3DX11_IMAGE_LOAD_INFO *load_info, + D3DX11_IMAGE_LOAD_INFO *out); +/* Returns array of D3D11_SUBRESOURCE_DATA structures followed by textures data. */ +HRESULT load_texture_data(const void *data, SIZE_T size, D3DX11_IMAGE_LOAD_INFO *load_info, + D3D11_SUBRESOURCE_DATA **resource_data); +HRESULT create_d3d_texture(ID3D11Device *device, D3DX11_IMAGE_LOAD_INFO *load_info, + D3D11_SUBRESOURCE_DATA *resource_data, ID3D11Resource **texture); diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index efffbec9bd9d..2d51eb64ff18 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -2479,6 +2479,97 @@ static void test_D3DX11CreateAsyncTextureInfoProcessor(void) CoUninitialize(); } +static void test_D3DX11CreateAsyncTextureProcessor(void) +{ + ID3DX11DataProcessor *dp; + ID3D11Resource *resource; + ID3D11Device *device; + HRESULT hr; + int i; + + device = create_device(); + if (!device) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + CoInitialize(NULL); + + hr = D3DX11CreateAsyncTextureProcessor(device, NULL, NULL); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); + + hr = D3DX11CreateAsyncTextureProcessor(NULL, NULL, &dp); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); + + hr = D3DX11CreateAsyncTextureProcessor(device, NULL, &dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11DataProcessor_Process(dp, (void *)test_image[0].data, 0); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11DataProcessor_Process(dp, NULL, test_image[0].size); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11DataProcessor_Destroy(dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + for (i = 0; i < ARRAY_SIZE(test_image); ++i) + { + winetest_push_context("Test %u", i); + + hr = D3DX11CreateAsyncTextureProcessor(device, NULL, &dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = ID3DX11DataProcessor_Process(dp, (void *)test_image[i].data, test_image[i].size); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + hr = ID3DX11DataProcessor_CreateDeviceObject(dp, (void **)&resource); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + check_resource_info(resource, test_image + i, __LINE__); + check_resource_data(resource, test_image + i, __LINE__); + ID3D11Resource_Release(resource); + } + + hr = ID3DX11DataProcessor_Destroy(dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + winetest_pop_context(); + } + + for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) + { + const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; + D3DX11_IMAGE_LOAD_INFO load_info = test_load_info->load_info; + + winetest_push_context("Test %u", i); + + hr = D3DX11CreateAsyncTextureProcessor(device, &load_info, &dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = ID3DX11DataProcessor_Process(dp, (void *)test_load_info->data, test_load_info->size); + todo_wine_if(test_load_info->todo_process_hr) + ok(hr == test_load_info->expected_process_hr, "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + resource = NULL; + hr = ID3DX11DataProcessor_CreateDeviceObject(dp, (void **)&resource); + todo_wine_if(test_load_info->todo_create_device_object_hr) + ok(hr == test_load_info->expected_create_device_object_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D11Resource_Release(resource); + } + + hr = ID3DX11DataProcessor_Destroy(dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + winetest_pop_context(); + } + + CoUninitialize(); + + ok(!ID3D11Device_Release(device), "Unexpected refcount.\n"); +} + static HRESULT WINAPI test_d3dinclude_open(ID3DInclude *iface, D3D_INCLUDE_TYPE include_type, const char *filename, const void *parent_data, const void **data, UINT *bytes) { @@ -3620,6 +3711,7 @@ START_TEST(d3dx11) test_D3DX11CreateAsyncFileLoader(); test_D3DX11CreateAsyncResourceLoader(); test_D3DX11CreateAsyncTextureInfoProcessor(); + test_D3DX11CreateAsyncTextureProcessor(); test_D3DX11CompileFromFile(); test_get_image_info(); test_create_texture(); diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c index eb05ac24be87..064964af4a75 100644 --- a/dlls/d3dx11_43/texture.c +++ b/dlls/d3dx11_43/texture.c @@ -362,7 +362,7 @@ HRESULT WINAPI D3DX11GetImageInfoFromMemory(const void *src_data, SIZE_T src_dat return hr; } -static void init_load_info(const D3DX11_IMAGE_LOAD_INFO *load_info, D3DX11_IMAGE_LOAD_INFO *out) +void init_load_info(const D3DX11_IMAGE_LOAD_INFO *load_info, D3DX11_IMAGE_LOAD_INFO *out) { if (load_info) { @@ -436,7 +436,7 @@ static HRESULT d3dx_create_subresource_data_for_texture(uint32_t width, uint32_t return hr; } -static HRESULT load_texture_data(const void *data, SIZE_T size, D3DX11_IMAGE_LOAD_INFO *load_info, +HRESULT load_texture_data(const void *data, SIZE_T size, D3DX11_IMAGE_LOAD_INFO *load_info, D3D11_SUBRESOURCE_DATA **resource_data) { const struct pixel_format_desc *fmt_desc, *src_desc; @@ -595,7 +595,7 @@ static HRESULT load_texture_data(const void *data, SIZE_T size, D3DX11_IMAGE_LOA return hr; } -static HRESULT create_d3d_texture(ID3D11Device *device, D3DX11_IMAGE_LOAD_INFO *load_info, +HRESULT create_d3d_texture(ID3D11Device *device, D3DX11_IMAGE_LOAD_INFO *load_info, D3D11_SUBRESOURCE_DATA *resource_data, ID3D11Resource **texture) { HRESULT hr; diff --git a/include/d3dx11async.h b/include/d3dx11async.h index 86f65ecb8878..ce0fd008e291 100644 --- a/include/d3dx11async.h +++ b/include/d3dx11async.h @@ -44,6 +44,8 @@ HRESULT WINAPI D3DX11CompileFromFileW(const WCHAR *filename, const D3D10_SHADER_ ID3D10Include *include, const char *entry_point, const char *target, UINT sflags, UINT eflags, ID3DX11ThreadPump *pump, ID3D10Blob **shader, ID3D10Blob **error_messages, HRESULT *hresult); +HRESULT WINAPI D3DX11CreateAsyncTextureProcessor(ID3D11Device *device, D3DX11_IMAGE_LOAD_INFO *info, + ID3DX11DataProcessor **processor); HRESULT WINAPI D3DX11CreateAsyncTextureInfoProcessor(D3DX11_IMAGE_INFO *info, ID3DX11DataProcessor **processor); #ifdef __cplusplus From efa421fb669764926b749ee0b4ae0f3b9f55232d Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 29 Aug 2024 08:00:10 -0400 Subject: [PATCH 0968/2542] d3dx11: Add support for the thread pump argument in D3DX11CreateTextureFromMemory(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx11_43/tests/d3dx11.c | 11 +++++++++++ dlls/d3dx11_43/texture.c | 19 ++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index 2d51eb64ff18..de465ac4bb2c 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -3689,6 +3689,17 @@ static void test_create_texture(void) ID3D11Texture2D_Release(tex_2d); ID3D11Resource_Release(resource); + hr2 = 0xdeadbeef; + add_work_item_count = 0; + hr = D3DX11CreateTextureFromMemory(device, test_image[0].data, test_image[0].size, + NULL, &thread_pump, &resource, &hr2); + ok(add_work_item_count == 1, "Got unexpected add_work_item_count %u.\n", add_work_item_count); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + check_resource_info(resource, test_image, __LINE__); + check_resource_data(resource, test_image, __LINE__); + ID3D11Resource_Release(resource); + CoUninitialize(); ok(!ID3D11Device_Release(device), "Unexpected refcount.\n"); diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c index 064964af4a75..d5058ab8d512 100644 --- a/dlls/d3dx11_43/texture.c +++ b/dlls/d3dx11_43/texture.c @@ -687,7 +687,24 @@ HRESULT WINAPI D3DX11CreateTextureFromMemory(ID3D11Device *device, const void *s return E_FAIL; if (pump) - FIXME("Thread pump is not supported yet.\n"); + { + ID3DX11DataProcessor *processor; + ID3DX11DataLoader *loader; + + if (FAILED((hr = D3DX11CreateAsyncMemoryLoader(src_data, src_data_size, &loader)))) + return hr; + if (FAILED((hr = D3DX11CreateAsyncTextureProcessor(device, load_info, &processor)))) + { + ID3DX11DataLoader_Destroy(loader); + return hr; + } + if (FAILED((hr = ID3DX11ThreadPump_AddWorkItem(pump, loader, processor, hresult, (void **)texture)))) + { + ID3DX11DataLoader_Destroy(loader); + ID3DX11DataProcessor_Destroy(processor); + } + return hr; + } hr = create_texture(device, src_data, src_data_size, load_info, texture); if (hresult) From 111dcc4c75ca8790967f5a9c404d23c6d10e7781 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 29 Aug 2024 08:05:56 -0400 Subject: [PATCH 0969/2542] d3dx11: Implement D3DX11CreateTextureFromFile{A,W}(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx11_43/tests/d3dx11.c | 78 ++++++++++++++++++++++++++++ dlls/d3dx11_43/texture.c | 96 +++++++++++++++++++++++++++-------- 2 files changed, 154 insertions(+), 20 deletions(-) diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index de465ac4bb2c..129bc55a4bf6 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -3508,6 +3508,7 @@ static void test_get_image_info(void) static void test_create_texture(void) { static const uint32_t dds_24bit_8_8_mip_level_expected[] = { 0xff0000ff, 0xff00ff00, 0xffff0000, 0xff000000 }; + static const WCHAR test_filename[] = L"image.data"; D3D11_TEXTURE2D_DESC tex_2d_desc; D3DX11_IMAGE_LOAD_INFO load_info; D3DX11_IMAGE_INFO img_info; @@ -3515,6 +3516,7 @@ static void test_create_texture(void) ID3D11Texture2D *tex_2d; ID3D11Device *device; uint32_t i, mip_level; + WCHAR path[MAX_PATH]; HRESULT hr, hr2; device = create_device(); @@ -3700,6 +3702,82 @@ static void test_create_texture(void) check_resource_data(resource, test_image, __LINE__); ID3D11Resource_Release(resource); + /* D3DX11CreateTextureFromFile tests */ + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromFileW(device, NULL, NULL, NULL, &resource, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromFileW(device, L"deadbeef", NULL, NULL, &resource, &hr2); + ok(hr == D3D11_ERROR_FILE_NOT_FOUND, "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromFileA(device, NULL, NULL, NULL, &resource, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromFileA(device, "deadbeef", NULL, NULL, &resource, &hr2); + ok(hr == D3D11_ERROR_FILE_NOT_FOUND, "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + + for (i = 0; i < ARRAY_SIZE(test_image); ++i) + { + winetest_push_context("Test %u", i); + create_file(test_filename, test_image[i].data, test_image[i].size, path); + + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromFileW(device, path, NULL, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + check_resource_info(resource, test_image + i, __LINE__); + check_resource_data(resource, test_image + i, __LINE__); + ID3D11Resource_Release(resource); + } + + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromFileA(device, get_str_a(path), NULL, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + check_resource_info(resource, test_image + i, __LINE__); + check_resource_data(resource, test_image + i, __LINE__); + ID3D11Resource_Release(resource); + } + + delete_file(test_filename); + winetest_pop_context(); + } + + for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) + { + const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; + + winetest_push_context("Test %u", i); + create_file(test_filename, test_image[i].data, test_image[i].size, path); + load_info = test_load_info->load_info; + + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromFileW(device, path, &load_info, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D11Resource_Release(resource); + + hr = D3DX11CreateTextureFromFileA(device, get_str_a(path), &load_info, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D11Resource_Release(resource); + + delete_file(test_filename); + winetest_pop_context(); + } + CoUninitialize(); ok(!ID3D11Device_Release(device), "Unexpected refcount.\n"); diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c index d5058ab8d512..3893feefcc26 100644 --- a/dlls/d3dx11_43/texture.c +++ b/dlls/d3dx11_43/texture.c @@ -35,26 +35,6 @@ HRESULT WINAPI D3DX11CreateShaderResourceViewFromMemory(ID3D11Device *device, co return E_NOTIMPL; } -HRESULT WINAPI D3DX11CreateTextureFromFileA(ID3D11Device *device, const char *filename, - D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11Resource **texture, - HRESULT *hresult) -{ - FIXME("device %p, filename %s, load_info %p, pump %p, texture %p, hresult %p stub.\n", - device, debugstr_a(filename), load_info, pump, texture, hresult); - - return E_NOTIMPL; -} - -HRESULT WINAPI D3DX11CreateTextureFromFileW(ID3D11Device *device, const WCHAR *filename, - D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11Resource **texture, - HRESULT *hresult) -{ - FIXME("device %p, filename %s, load_info %p, pump %p, texture %p, hresult %p stub.\n", - device, debugstr_w(filename), load_info, pump, texture, hresult); - - return E_NOTIMPL; -} - HRESULT WINAPI D3DX11SaveTextureToFileW(ID3D11DeviceContext *context, ID3D11Resource *texture, D3DX11_IMAGE_FILE_FORMAT format, const WCHAR *filename) { @@ -711,3 +691,79 @@ HRESULT WINAPI D3DX11CreateTextureFromMemory(ID3D11Device *device, const void *s *hresult = hr; return hr; } + +HRESULT WINAPI D3DX11CreateTextureFromFileA(ID3D11Device *device, const char *src_file, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11Resource **texture, + HRESULT *hresult) +{ + int32_t str_len; + WCHAR *buffer; + HRESULT hr; + + TRACE("device %p, src_file %s, load_info %p, pump %p, texture %p, hresult %p.\n", + device, debugstr_a(src_file), load_info, pump, texture, hresult); + + if (!device) + return E_INVALIDARG; + if (!src_file) + return E_FAIL; + + if (!(str_len = MultiByteToWideChar(CP_ACP, 0, src_file, -1, NULL, 0))) + return HRESULT_FROM_WIN32(GetLastError()); + + if (!(buffer = malloc(str_len * sizeof(*buffer)))) + return E_OUTOFMEMORY; + + MultiByteToWideChar(CP_ACP, 0, src_file, -1, buffer, str_len); + hr = D3DX11CreateTextureFromFileW(device, buffer, load_info, pump, texture, hresult); + + free(buffer); + + return hr; +} + +HRESULT WINAPI D3DX11CreateTextureFromFileW(ID3D11Device *device, const WCHAR *src_file, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11Resource **texture, + HRESULT *hresult) +{ + void *buffer = NULL; + DWORD size = 0; + HRESULT hr; + + TRACE("device %p, src_file %s, load_info %p, pump %p, texture %p, hresult %p.\n", + device, debugstr_w(src_file), load_info, pump, texture, hresult); + + if (!device) + return E_INVALIDARG; + if (!src_file) + return E_FAIL; + + if (pump) + { + ID3DX11DataProcessor *processor; + ID3DX11DataLoader *loader; + + if (FAILED((hr = D3DX11CreateAsyncFileLoaderW(src_file, &loader)))) + return hr; + if (FAILED((hr = D3DX11CreateAsyncTextureProcessor(device, load_info, &processor)))) + { + ID3DX11DataLoader_Destroy(loader); + return hr; + } + if (FAILED((hr = ID3DX11ThreadPump_AddWorkItem(pump, loader, processor, hresult, (void **)texture)))) + { + ID3DX11DataLoader_Destroy(loader); + ID3DX11DataProcessor_Destroy(processor); + } + return hr; + } + + if (SUCCEEDED((hr = load_file(src_file, &buffer, &size)))) + { + hr = create_texture(device, buffer, size, load_info, texture); + free(buffer); + } + if (hresult) + *hresult = hr; + return hr; +} From d397c846c8a7158bb720c78750bc8053ef56e656 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 29 Aug 2024 08:13:52 -0400 Subject: [PATCH 0970/2542] d3dx11: Implement D3DX11CreateTextureFromResource{A,W}(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx11_42/d3dx11_42.spec | 4 +- dlls/d3dx11_43/d3dx11_43.spec | 4 +- dlls/d3dx11_43/tests/d3dx11.c | 88 +++++++++++++++++++++++++++++++++++ dlls/d3dx11_43/texture.c | 82 ++++++++++++++++++++++++++++++++ include/d3dx11tex.h | 4 ++ 5 files changed, 178 insertions(+), 4 deletions(-) diff --git a/dlls/d3dx11_42/d3dx11_42.spec b/dlls/d3dx11_42/d3dx11_42.spec index 415ece1f2a92..685499833ef4 100644 --- a/dlls/d3dx11_42/d3dx11_42.spec +++ b/dlls/d3dx11_42/d3dx11_42.spec @@ -23,8 +23,8 @@ @ stdcall -import D3DX11CreateTextureFromFileA(ptr str ptr ptr ptr ptr) @ stdcall -import D3DX11CreateTextureFromFileW(ptr wstr ptr ptr ptr ptr) @ stdcall -import D3DX11CreateTextureFromMemory(ptr ptr long ptr ptr ptr ptr) -@ stub D3DX11CreateTextureFromResourceA -@ stub D3DX11CreateTextureFromResourceW +@ stdcall -import D3DX11CreateTextureFromResourceA(ptr long str ptr ptr ptr ptr) +@ stdcall -import D3DX11CreateTextureFromResourceW(ptr long wstr ptr ptr ptr ptr) @ stub D3DX11CreateThreadPump @ stdcall -import D3DX11FilterTexture(ptr ptr long long) @ stdcall -import D3DX11GetImageInfoFromFileA(str ptr ptr ptr) diff --git a/dlls/d3dx11_43/d3dx11_43.spec b/dlls/d3dx11_43/d3dx11_43.spec index dc972641eade..50348a29608c 100644 --- a/dlls/d3dx11_43/d3dx11_43.spec +++ b/dlls/d3dx11_43/d3dx11_43.spec @@ -23,8 +23,8 @@ @ stdcall D3DX11CreateTextureFromFileA(ptr str ptr ptr ptr ptr) @ stdcall D3DX11CreateTextureFromFileW(ptr wstr ptr ptr ptr ptr) @ stdcall D3DX11CreateTextureFromMemory(ptr ptr long ptr ptr ptr ptr) -@ stub D3DX11CreateTextureFromResourceA -@ stub D3DX11CreateTextureFromResourceW +@ stdcall D3DX11CreateTextureFromResourceA(ptr long str ptr ptr ptr ptr) +@ stdcall D3DX11CreateTextureFromResourceW(ptr long wstr ptr ptr ptr ptr) @ stub D3DX11CreateThreadPump @ stdcall D3DX11FilterTexture(ptr ptr long long) @ stdcall D3DX11GetImageInfoFromFileA(str ptr ptr ptr) diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index 129bc55a4bf6..0fab0ad2e81e 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -3508,12 +3508,14 @@ static void test_get_image_info(void) static void test_create_texture(void) { static const uint32_t dds_24bit_8_8_mip_level_expected[] = { 0xff0000ff, 0xff00ff00, 0xffff0000, 0xff000000 }; + static const WCHAR test_resource_name[] = L"resource.data"; static const WCHAR test_filename[] = L"image.data"; D3D11_TEXTURE2D_DESC tex_2d_desc; D3DX11_IMAGE_LOAD_INFO load_info; D3DX11_IMAGE_INFO img_info; ID3D11Resource *resource; ID3D11Texture2D *tex_2d; + HMODULE resource_module; ID3D11Device *device; uint32_t i, mip_level; WCHAR path[MAX_PATH]; @@ -3778,6 +3780,92 @@ static void test_create_texture(void) winetest_pop_context(); } + /* D3DX11CreateTextureFromResource tests */ + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromResourceW(device, NULL, NULL, NULL, NULL, &resource, &hr2); + ok(hr == D3DX11_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromResourceW(device, NULL, L"deadbeef", NULL, NULL, &resource, &hr2); + ok(hr == D3DX11_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromResourceA(device, NULL, NULL, NULL, NULL, &resource, &hr2); + ok(hr == D3DX11_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromResourceA(device, NULL, "deadbeef", NULL, NULL, &resource, &hr2); + ok(hr == D3DX11_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + + for (i = 0; i < ARRAY_SIZE(test_image); ++i) + { + winetest_push_context("Test %u", i); + resource_module = create_resource_module(test_resource_name, test_image[i].data, test_image[i].size); + + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromResourceW(device, resource_module, L"deadbeef", NULL, NULL, &resource, &hr2); + ok(hr == D3DX11_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromResourceW(device, resource_module, + test_resource_name, NULL, NULL, &resource, &hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + if (hr == S_OK) + { + check_resource_info(resource, test_image + i, __LINE__); + check_resource_data(resource, test_image + i, __LINE__); + ID3D11Resource_Release(resource); + } + + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromResourceA(device, resource_module, + get_str_a(test_resource_name), NULL, NULL, &resource, &hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + if (hr == S_OK) + { + check_resource_info(resource, test_image + i, __LINE__); + check_resource_data(resource, test_image + i, __LINE__); + ID3D11Resource_Release(resource); + } + + delete_resource_module(test_resource_name, resource_module); + winetest_pop_context(); + } + + for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) + { + const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; + + winetest_push_context("Test %u", i); + resource_module = create_resource_module(test_resource_name, test_load_info->data, test_load_info->size); + load_info = test_load_info->load_info; + + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromResourceW(device, resource_module, + test_resource_name, &load_info, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D11Resource_Release(resource); + + hr2 = 0xdeadbeef; + hr = D3DX11CreateTextureFromResourceA(device, resource_module, + get_str_a(test_resource_name), &load_info, NULL, &resource, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D11Resource_Release(resource); + + delete_resource_module(test_resource_name, resource_module); + winetest_pop_context(); + } + CoUninitialize(); ok(!ID3D11Device_Release(device), "Unexpected refcount.\n"); diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c index 3893feefcc26..91875b0e098c 100644 --- a/dlls/d3dx11_43/texture.c +++ b/dlls/d3dx11_43/texture.c @@ -767,3 +767,85 @@ HRESULT WINAPI D3DX11CreateTextureFromFileW(ID3D11Device *device, const WCHAR *s *hresult = hr; return hr; } + +HRESULT WINAPI D3DX11CreateTextureFromResourceA(ID3D11Device *device, HMODULE module, const char *resource, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11Resource **texture, HRESULT *hresult) +{ + void *buffer; + DWORD size; + HRESULT hr; + + TRACE("device %p, module %p, resource %s, load_info %p, pump %p, texture %p, hresult %p.\n", + device, module, debugstr_a(resource), load_info, pump, texture, hresult); + + if (!device) + return E_INVALIDARG; + + if (pump) + { + ID3DX11DataProcessor *processor; + ID3DX11DataLoader *loader; + + if (FAILED((hr = D3DX11CreateAsyncResourceLoaderA(module, resource, &loader)))) + return hr; + if (FAILED((hr = D3DX11CreateAsyncTextureProcessor(device, load_info, &processor)))) + { + ID3DX11DataLoader_Destroy(loader); + return hr; + } + if (FAILED((hr = ID3DX11ThreadPump_AddWorkItem(pump, loader, processor, hresult, (void **)texture)))) + { + ID3DX11DataLoader_Destroy(loader); + ID3DX11DataProcessor_Destroy(processor); + } + return hr; + } + + if (FAILED((hr = load_resourceA(module, resource, &buffer, &size)))) + return hr; + hr = create_texture(device, buffer, size, load_info, texture); + if (hresult) + *hresult = hr; + return hr; +} + +HRESULT WINAPI D3DX11CreateTextureFromResourceW(ID3D11Device *device, HMODULE module, const WCHAR *resource, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11Resource **texture, HRESULT *hresult) +{ + void *buffer; + DWORD size; + HRESULT hr; + + TRACE("device %p, module %p, resource %s, load_info %p, pump %p, texture %p, hresult %p.\n", + device, module, debugstr_w(resource), load_info, pump, texture, hresult); + + if (!device) + return E_INVALIDARG; + + if (pump) + { + ID3DX11DataProcessor *processor; + ID3DX11DataLoader *loader; + + if (FAILED((hr = D3DX11CreateAsyncResourceLoaderW(module, resource, &loader)))) + return hr; + if (FAILED((hr = D3DX11CreateAsyncTextureProcessor(device, load_info, &processor)))) + { + ID3DX11DataLoader_Destroy(loader); + return hr; + } + if (FAILED((hr = ID3DX11ThreadPump_AddWorkItem(pump, loader, processor, hresult, (void **)texture)))) + { + ID3DX11DataLoader_Destroy(loader); + ID3DX11DataProcessor_Destroy(processor); + } + return hr; + } + + if (FAILED((hr = load_resourceW(module, resource, &buffer, &size)))) + return hr; + hr = create_texture(device, buffer, size, load_info, texture); + if (hresult) + *hresult = hr; + return hr; +} diff --git a/include/d3dx11tex.h b/include/d3dx11tex.h index 631a8060f6bf..386945fd70d3 100644 --- a/include/d3dx11tex.h +++ b/include/d3dx11tex.h @@ -146,6 +146,10 @@ HRESULT WINAPI D3DX11CreateTextureFromFileA(ID3D11Device *device, const char *fi HRESULT WINAPI D3DX11CreateTextureFromFileW(ID3D11Device *device, const WCHAR *filename, D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11Resource **texture, HRESULT *hresult); +HRESULT WINAPI D3DX11CreateTextureFromResourceA(ID3D11Device *device, HMODULE module, const char *resource, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11Resource **texture, HRESULT *hresult); +HRESULT WINAPI D3DX11CreateTextureFromResourceW(ID3D11Device *device, HMODULE module, const WCHAR *resource, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11Resource **texture, HRESULT *hresult); HRESULT WINAPI D3DX11CreateTextureFromMemory(ID3D11Device *device, const void *src_data, SIZE_T src_data_size, D3DX11_IMAGE_LOAD_INFO *loadinfo, ID3DX11ThreadPump *pump, ID3D11Resource **texture, HRESULT *hresult); HRESULT WINAPI D3DX11FilterTexture(ID3D11DeviceContext *context, ID3D11Resource *texture, UINT src_level, UINT filter); From 2b55eaf8ad3d7f662b7e2f13c0159d9119643f50 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 29 Aug 2024 08:32:55 -0400 Subject: [PATCH 0971/2542] d3dx11: Implement D3DX11CreateAsyncShaderResourceViewProcessor(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx11_42/d3dx11_42.spec | 2 +- dlls/d3dx11_43/async.c | 83 +++++++++++++++++ dlls/d3dx11_43/d3dx11_43.spec | 2 +- dlls/d3dx11_43/tests/d3dx11.c | 166 ++++++++++++++++++++++++++++++++++ include/d3dx11async.h | 2 + 5 files changed, 253 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx11_42/d3dx11_42.spec b/dlls/d3dx11_42/d3dx11_42.spec index 685499833ef4..2a96424e40ce 100644 --- a/dlls/d3dx11_42/d3dx11_42.spec +++ b/dlls/d3dx11_42/d3dx11_42.spec @@ -12,7 +12,7 @@ @ stdcall -import D3DX11CreateAsyncResourceLoaderA(long str ptr) @ stdcall -import D3DX11CreateAsyncResourceLoaderW(long wstr ptr) @ stub D3DX11CreateAsyncShaderPreprocessProcessor -@ stub D3DX11CreateAsyncShaderResourceViewProcessor +@ stdcall -import D3DX11CreateAsyncShaderResourceViewProcessor(ptr ptr ptr) @ stdcall -import D3DX11CreateAsyncTextureInfoProcessor(ptr ptr) @ stdcall -import D3DX11CreateAsyncTextureProcessor(ptr ptr ptr) @ stub D3DX11CreateShaderResourceViewFromFileA diff --git a/dlls/d3dx11_43/async.c b/dlls/d3dx11_43/async.c index b05b793e333a..bb27ccd73188 100644 --- a/dlls/d3dx11_43/async.c +++ b/dlls/d3dx11_43/async.c @@ -289,6 +289,63 @@ static ID3DX11DataProcessorVtbl texture_processor_vtbl = texture_processor_Destroy }; +struct srv_processor +{ + ID3DX11DataProcessor ID3DX11DataProcessor_iface; + ID3DX11DataProcessor *texture_processor; +}; + +static inline struct srv_processor *srv_processor_from_ID3DX11DataProcessor(ID3DX11DataProcessor *iface) +{ + return CONTAINING_RECORD(iface, struct srv_processor, ID3DX11DataProcessor_iface); +} + +static HRESULT WINAPI srv_processor_Process(ID3DX11DataProcessor *iface, void *data, SIZE_T size) +{ + struct srv_processor *processor = srv_processor_from_ID3DX11DataProcessor(iface); + + TRACE("iface %p, data %p, size %Iu.\n", iface, data, size); + + return ID3DX11DataProcessor_Process(processor->texture_processor, data, size); +} + +static HRESULT WINAPI srv_processor_CreateDeviceObject(ID3DX11DataProcessor *iface, void **object) +{ + struct srv_processor *processor = srv_processor_from_ID3DX11DataProcessor(iface); + struct texture_processor *tex_processor = texture_processor_from_ID3DX11DataProcessor(processor->texture_processor); + ID3D11Resource *texture_resource; + HRESULT hr; + + TRACE("iface %p, object %p.\n", iface, object); + + hr = ID3DX11DataProcessor_CreateDeviceObject(processor->texture_processor, (void **)&texture_resource); + if (FAILED(hr)) + return hr; + + hr = ID3D11Device_CreateShaderResourceView(tex_processor->device, texture_resource, NULL, + (ID3D11ShaderResourceView **)object); + ID3D11Resource_Release(texture_resource); + return hr; +} + +static HRESULT WINAPI srv_processor_Destroy(ID3DX11DataProcessor *iface) +{ + struct srv_processor *processor = srv_processor_from_ID3DX11DataProcessor(iface); + + TRACE("iface %p.\n", iface); + + ID3DX11DataProcessor_Destroy(processor->texture_processor); + free(processor); + return S_OK; +} + +static ID3DX11DataProcessorVtbl srv_processor_vtbl = +{ + srv_processor_Process, + srv_processor_CreateDeviceObject, + srv_processor_Destroy +}; + HRESULT WINAPI D3DX11CompileFromMemory(const char *data, SIZE_T data_size, const char *filename, const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *entry_point, const char *target, UINT sflags, UINT eflags, ID3DX11ThreadPump *pump, ID3D10Blob **shader, @@ -529,3 +586,29 @@ HRESULT WINAPI D3DX11CreateAsyncTextureProcessor(ID3D11Device *device, *processor = &object->ID3DX11DataProcessor_iface; return S_OK; } + +HRESULT WINAPI D3DX11CreateAsyncShaderResourceViewProcessor(ID3D11Device *device, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11DataProcessor **processor) +{ + struct srv_processor *object; + HRESULT hr; + + TRACE("device %p, load_info %p, processor %p.\n", device, load_info, processor); + + if (!device || !processor) + return E_INVALIDARG; + + object = calloc(1, sizeof(*object)); + if (!object) + return E_OUTOFMEMORY; + + hr = D3DX11CreateAsyncTextureProcessor(device, load_info, &object->texture_processor); + if (FAILED(hr)) + { + free(object); + return hr; + } + object->ID3DX11DataProcessor_iface.lpVtbl = &srv_processor_vtbl; + *processor = &object->ID3DX11DataProcessor_iface; + return S_OK; +} diff --git a/dlls/d3dx11_43/d3dx11_43.spec b/dlls/d3dx11_43/d3dx11_43.spec index 50348a29608c..9381bff8dfb3 100644 --- a/dlls/d3dx11_43/d3dx11_43.spec +++ b/dlls/d3dx11_43/d3dx11_43.spec @@ -12,7 +12,7 @@ @ stdcall D3DX11CreateAsyncResourceLoaderA(long str ptr) @ stdcall D3DX11CreateAsyncResourceLoaderW(long wstr ptr) @ stub D3DX11CreateAsyncShaderPreprocessProcessor -@ stub D3DX11CreateAsyncShaderResourceViewProcessor +@ stdcall D3DX11CreateAsyncShaderResourceViewProcessor(ptr ptr ptr) @ stdcall D3DX11CreateAsyncTextureInfoProcessor(ptr ptr) @ stdcall D3DX11CreateAsyncTextureProcessor(ptr ptr ptr) @ stub D3DX11CreateShaderResourceViewFromFileA diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index 0fab0ad2e81e..c82a1af9fcf9 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -2110,6 +2110,80 @@ static void check_resource_data(ID3D11Resource *resource, const struct test_imag } } +static void check_shader_resource_view_info(ID3D11ShaderResourceView *srv, const struct test_image *image, uint32_t line) +{ + uint32_t expected_mip_levels, expected_width, expected_height, max_dimension; + D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc; + ID3D11Resource *resource; + + expected_width = image->expected_info.Width; + expected_height = image->expected_info.Height; + if (is_block_compressed(image->expected_info.Format)) + { + expected_width = (expected_width + 3) & ~3; + expected_height = (expected_height + 3) & ~3; + } + expected_mip_levels = 0; + max_dimension = max(max(expected_width, expected_height), image->expected_info.Depth); + while (max_dimension) + { + ++expected_mip_levels; + max_dimension >>= 1; + } + + ID3D11ShaderResourceView_GetDesc(srv, &srv_desc); + ok_(__FILE__, line)(srv_desc.Format == image->expected_info.Format, "Got unexpected Format %u, expected %u.\n", + srv_desc.Format, image->expected_info.Format); + ok_(__FILE__, line)(srv_desc.ViewDimension == image->expected_srv_dimension, "Got unexpected ViewDimension %u, expected %u.\n", + srv_desc.ViewDimension, image->expected_srv_dimension); + if (srv_desc.ViewDimension != image->expected_srv_dimension) + return; + + ID3D11ShaderResourceView_GetResource(srv, &resource); + check_resource_info(resource, image, line); + check_resource_data(resource, image, line); + ID3D11Resource_Release(resource); + + switch (srv_desc.ViewDimension) + { + case D3D11_SRV_DIMENSION_TEXTURE2D: + ok_(__FILE__, line)(!srv_desc.Texture2D.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", + srv_desc.Texture2D.MostDetailedMip); + ok_(__FILE__, line)(srv_desc.Texture2D.MipLevels == expected_mip_levels, "Unexpected MipLevels %u.\n", + srv_desc.Texture2D.MipLevels); + break; + + case D3D11_SRV_DIMENSION_TEXTURE2DARRAY: + ok_(__FILE__, line)(!srv_desc.Texture2DArray.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", + srv_desc.Texture2DArray.MostDetailedMip); + ok_(__FILE__, line)(srv_desc.Texture2DArray.MipLevels == expected_mip_levels, "Unexpected MipLevels %u.\n", + srv_desc.Texture2DArray.MipLevels); + ok_(__FILE__, line)(!srv_desc.Texture2DArray.FirstArraySlice, "Unexpected FirstArraySlice %u.\n", + srv_desc.Texture2DArray.FirstArraySlice); + ok_(__FILE__, line)(srv_desc.Texture2DArray.ArraySize == image->expected_info.ArraySize, "Unexpected ArraySize %u.\n", + srv_desc.Texture2DArray.ArraySize); + break; + + case D3D11_SRV_DIMENSION_TEXTURECUBE: + ok_(__FILE__, line)(!srv_desc.TextureCube.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", + srv_desc.TextureCube.MostDetailedMip); + ok_(__FILE__, line)(srv_desc.TextureCube.MipLevels == expected_mip_levels, "Unexpected MipLevels %u.\n", + srv_desc.TextureCube.MipLevels); + break; + + case D3D11_SRV_DIMENSION_TEXTURE3D: + ok_(__FILE__, line)(!srv_desc.Texture3D.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", + srv_desc.Texture3D.MostDetailedMip); + ok_(__FILE__, line)(srv_desc.Texture3D.MipLevels == expected_mip_levels, "Unexpected MipLevels %u.\n", + srv_desc.Texture3D.MipLevels); + break; + + default: + ok_(__FILE__, line)(0, "Unexpected ViewDimension %u.\n", srv_desc.ViewDimension); + break; + } +} + static WCHAR temp_dir[MAX_PATH]; static char *get_str_a(const WCHAR *wstr) @@ -2570,6 +2644,97 @@ static void test_D3DX11CreateAsyncTextureProcessor(void) ok(!ID3D11Device_Release(device), "Unexpected refcount.\n"); } +static void test_D3DX11CreateAsyncShaderResourceViewProcessor(void) +{ + ID3D11ShaderResourceView *resource_view; + ID3DX11DataProcessor *dp; + ID3D11Device *device; + HRESULT hr; + uint32_t i; + + device = create_device(); + if (!device) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + CoInitialize(NULL); + + hr = D3DX11CreateAsyncShaderResourceViewProcessor(device, NULL, NULL); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); + + hr = D3DX11CreateAsyncShaderResourceViewProcessor(NULL, NULL, &dp); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); + + hr = D3DX11CreateAsyncShaderResourceViewProcessor(device, NULL, &dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11DataProcessor_Process(dp, (void *)test_image[0].data, 0); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11DataProcessor_Process(dp, NULL, test_image[0].size); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11DataProcessor_Destroy(dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + for (i = 0; i < ARRAY_SIZE(test_image); ++i) + { + winetest_push_context("Test %u", i); + + hr = D3DX11CreateAsyncShaderResourceViewProcessor(device, NULL, &dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = ID3DX11DataProcessor_Process(dp, (void *)test_image[i].data, test_image[i].size); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + hr = ID3DX11DataProcessor_CreateDeviceObject(dp, (void **)&resource_view); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + check_shader_resource_view_info(resource_view, test_image + i, __LINE__); + ID3D11ShaderResourceView_Release(resource_view); + } + + hr = ID3DX11DataProcessor_Destroy(dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + winetest_pop_context(); + } + + for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) + { + const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; + D3DX11_IMAGE_LOAD_INFO load_info = test_load_info->load_info; + + winetest_push_context("Test %u", i); + + hr = D3DX11CreateAsyncShaderResourceViewProcessor(device, &load_info, &dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = ID3DX11DataProcessor_Process(dp, (void *)test_load_info->data, test_load_info->size); + todo_wine_if(test_load_info->todo_process_hr) + ok(hr == test_load_info->expected_process_hr, "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + resource_view = NULL; + hr = ID3DX11DataProcessor_CreateDeviceObject(dp, (void **)&resource_view); + todo_wine_if(test_load_info->todo_create_device_object_hr) + ok(hr == test_load_info->expected_create_device_object_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D11ShaderResourceView_Release(resource_view); + } + + hr = ID3DX11DataProcessor_Destroy(dp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + winetest_pop_context(); + } + + CoUninitialize(); + + ok(!ID3D11Device_Release(device), "Unexpected refcount.\n"); +} + static HRESULT WINAPI test_d3dinclude_open(ID3DInclude *iface, D3D_INCLUDE_TYPE include_type, const char *filename, const void *parent_data, const void **data, UINT *bytes) { @@ -3889,6 +4054,7 @@ START_TEST(d3dx11) test_D3DX11CreateAsyncResourceLoader(); test_D3DX11CreateAsyncTextureInfoProcessor(); test_D3DX11CreateAsyncTextureProcessor(); + test_D3DX11CreateAsyncShaderResourceViewProcessor(); test_D3DX11CompileFromFile(); test_get_image_info(); test_create_texture(); diff --git a/include/d3dx11async.h b/include/d3dx11async.h index ce0fd008e291..e373b600a8bf 100644 --- a/include/d3dx11async.h +++ b/include/d3dx11async.h @@ -47,6 +47,8 @@ HRESULT WINAPI D3DX11CompileFromFileW(const WCHAR *filename, const D3D10_SHADER_ HRESULT WINAPI D3DX11CreateAsyncTextureProcessor(ID3D11Device *device, D3DX11_IMAGE_LOAD_INFO *info, ID3DX11DataProcessor **processor); HRESULT WINAPI D3DX11CreateAsyncTextureInfoProcessor(D3DX11_IMAGE_INFO *info, ID3DX11DataProcessor **processor); +HRESULT WINAPI D3DX11CreateAsyncShaderResourceViewProcessor(ID3D11Device *device, D3DX11_IMAGE_LOAD_INFO *info, + ID3DX11DataProcessor **processor); #ifdef __cplusplus } From 49240b1a8b50aa1772b10c2e23a4d2346abaa854 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 29 Aug 2024 08:56:33 -0400 Subject: [PATCH 0972/2542] d3dx11: Implement D3DX11CreateShaderResourceViewFrom{File,Memory,Resource}(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx11_42/d3dx11_42.spec | 8 +- dlls/d3dx11_43/d3dx11_43.spec | 8 +- dlls/d3dx11_43/tests/d3dx11.c | 444 ++++++++++++++++++++++++++++++++++ dlls/d3dx11_43/texture.c | 232 +++++++++++++++++- include/d3dx11tex.h | 9 + 5 files changed, 683 insertions(+), 18 deletions(-) diff --git a/dlls/d3dx11_42/d3dx11_42.spec b/dlls/d3dx11_42/d3dx11_42.spec index 2a96424e40ce..0fa9cb37d515 100644 --- a/dlls/d3dx11_42/d3dx11_42.spec +++ b/dlls/d3dx11_42/d3dx11_42.spec @@ -15,11 +15,11 @@ @ stdcall -import D3DX11CreateAsyncShaderResourceViewProcessor(ptr ptr ptr) @ stdcall -import D3DX11CreateAsyncTextureInfoProcessor(ptr ptr) @ stdcall -import D3DX11CreateAsyncTextureProcessor(ptr ptr ptr) -@ stub D3DX11CreateShaderResourceViewFromFileA -@ stub D3DX11CreateShaderResourceViewFromFileW +@ stdcall -import D3DX11CreateShaderResourceViewFromFileA(ptr str ptr ptr ptr ptr) +@ stdcall -import D3DX11CreateShaderResourceViewFromFileW(ptr wstr ptr ptr ptr ptr) @ stdcall -import D3DX11CreateShaderResourceViewFromMemory(ptr ptr long ptr ptr ptr ptr) -@ stub D3DX11CreateShaderResourceViewFromResourceA -@ stub D3DX11CreateShaderResourceViewFromResourceW +@ stdcall -import D3DX11CreateShaderResourceViewFromResourceA(ptr long str ptr ptr ptr ptr) +@ stdcall -import D3DX11CreateShaderResourceViewFromResourceW(ptr long wstr ptr ptr ptr ptr) @ stdcall -import D3DX11CreateTextureFromFileA(ptr str ptr ptr ptr ptr) @ stdcall -import D3DX11CreateTextureFromFileW(ptr wstr ptr ptr ptr ptr) @ stdcall -import D3DX11CreateTextureFromMemory(ptr ptr long ptr ptr ptr ptr) diff --git a/dlls/d3dx11_43/d3dx11_43.spec b/dlls/d3dx11_43/d3dx11_43.spec index 9381bff8dfb3..4c3b311a8d61 100644 --- a/dlls/d3dx11_43/d3dx11_43.spec +++ b/dlls/d3dx11_43/d3dx11_43.spec @@ -15,11 +15,11 @@ @ stdcall D3DX11CreateAsyncShaderResourceViewProcessor(ptr ptr ptr) @ stdcall D3DX11CreateAsyncTextureInfoProcessor(ptr ptr) @ stdcall D3DX11CreateAsyncTextureProcessor(ptr ptr ptr) -@ stub D3DX11CreateShaderResourceViewFromFileA -@ stub D3DX11CreateShaderResourceViewFromFileW +@ stdcall D3DX11CreateShaderResourceViewFromFileA(ptr str ptr ptr ptr ptr) +@ stdcall D3DX11CreateShaderResourceViewFromFileW(ptr wstr ptr ptr ptr ptr) @ stdcall D3DX11CreateShaderResourceViewFromMemory(ptr ptr long ptr ptr ptr ptr) -@ stub D3DX11CreateShaderResourceViewFromResourceA -@ stub D3DX11CreateShaderResourceViewFromResourceW +@ stdcall D3DX11CreateShaderResourceViewFromResourceA(ptr long str ptr ptr ptr ptr) +@ stdcall D3DX11CreateShaderResourceViewFromResourceW(ptr long wstr ptr ptr ptr ptr) @ stdcall D3DX11CreateTextureFromFileA(ptr str ptr ptr ptr ptr) @ stdcall D3DX11CreateTextureFromFileW(ptr wstr ptr ptr ptr ptr) @ stdcall D3DX11CreateTextureFromMemory(ptr ptr long ptr ptr ptr ptr) diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index c82a1af9fcf9..bcde6e71bfce 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -1894,6 +1894,71 @@ static void check_test_image_load_info_resource_(uint32_t line, ID3D11Resource * } } +#define check_test_image_load_info_srv(srv, image_load_info) \ + check_test_image_load_info_srv_(__LINE__, srv, image_load_info) +static void check_test_image_load_info_srv_(uint32_t line, ID3D11ShaderResourceView *srv, + const struct test_image_load_info *image_load_info) +{ + D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc; + ID3D11Resource *resource; + + ID3D11ShaderResourceView_GetDesc(srv, &srv_desc); + ok_(__FILE__, line)(srv_desc.ViewDimension == image_load_info->expected_srv_dimension, "Got unexpected ViewDimension %u, expected %u.\n", + srv_desc.ViewDimension, image_load_info->expected_srv_dimension); + if (srv_desc.ViewDimension != image_load_info->expected_srv_dimension) + return; + + ID3D11ShaderResourceView_GetResource(srv, &resource); + check_test_image_load_info_resource_(line, resource, image_load_info); + ID3D11Resource_Release(resource); + switch (srv_desc.ViewDimension) + { + case D3D11_SRV_DIMENSION_TEXTURE2D: + ok_(__FILE__, line)(srv_desc.Format == image_load_info->expected_resource_desc.desc_2d.Format, + "Got unexpected Format %u, expected %u.\n", srv_desc.Format, image_load_info->expected_resource_desc.desc_2d.Format); + ok_(__FILE__, line)(!srv_desc.Texture2D.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", + srv_desc.Texture2D.MostDetailedMip); + ok_(__FILE__, line)(srv_desc.Texture2D.MipLevels == image_load_info->expected_resource_desc.desc_2d.MipLevels, + "Unexpected MipLevels %u.\n", srv_desc.Texture2D.MipLevels); + break; + + case D3D11_SRV_DIMENSION_TEXTURE2DARRAY: + ok_(__FILE__, line)(srv_desc.Format == image_load_info->expected_resource_desc.desc_2d.Format, + "Got unexpected Format %u, expected %u.\n", srv_desc.Format, image_load_info->expected_resource_desc.desc_2d.Format); + ok_(__FILE__, line)(!srv_desc.Texture2DArray.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", + srv_desc.Texture2DArray.MostDetailedMip); + ok_(__FILE__, line)(srv_desc.Texture2DArray.MipLevels == image_load_info->expected_resource_desc.desc_2d.MipLevels, + "Unexpected MipLevels %u.\n", srv_desc.Texture2DArray.MipLevels); + ok_(__FILE__, line)(!srv_desc.Texture2DArray.FirstArraySlice, "Unexpected FirstArraySlice %u.\n", + srv_desc.Texture2DArray.FirstArraySlice); + ok_(__FILE__, line)(srv_desc.Texture2DArray.ArraySize == image_load_info->expected_resource_desc.desc_2d.ArraySize, + "Unexpected ArraySize %u.\n", srv_desc.Texture2DArray.ArraySize); + break; + + case D3D11_SRV_DIMENSION_TEXTURECUBE: + ok_(__FILE__, line)(srv_desc.Format == image_load_info->expected_resource_desc.desc_2d.Format, + "Got unexpected Format %u, expected %u.\n", srv_desc.Format, image_load_info->expected_resource_desc.desc_2d.Format); + ok_(__FILE__, line)(!srv_desc.TextureCube.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", + srv_desc.TextureCube.MostDetailedMip); + ok_(__FILE__, line)(srv_desc.TextureCube.MipLevels == image_load_info->expected_resource_desc.desc_2d.MipLevels, + "Unexpected MipLevels %u.\n", srv_desc.TextureCube.MipLevels); + break; + + case D3D11_SRV_DIMENSION_TEXTURE3D: + ok_(__FILE__, line)(srv_desc.Format == image_load_info->expected_resource_desc.desc_3d.Format, + "Got unexpected Format %u, expected %u.\n", srv_desc.Format, image_load_info->expected_resource_desc.desc_3d.Format); + ok_(__FILE__, line)(!srv_desc.Texture3D.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", + srv_desc.Texture3D.MostDetailedMip); + ok_(__FILE__, line)(srv_desc.Texture3D.MipLevels == image_load_info->expected_resource_desc.desc_3d.MipLevels, + "Unexpected MipLevels %u.\n", srv_desc.Texture3D.MipLevels); + break; + + default: + ok_(__FILE__, line)(0, "Unexpected ViewDimension %u.\n", srv_desc.ViewDimension); + break; + } +} + static void check_resource_info(ID3D11Resource *resource, const struct test_image *image, uint32_t line) { unsigned int expected_mip_levels, expected_width, expected_height, max_dimension; @@ -4036,6 +4101,384 @@ static void test_create_texture(void) ok(!ID3D11Device_Release(device), "Unexpected refcount.\n"); } +static void test_create_shader_resource_view(void) +{ + static const uint32_t dds_24bit_8_8_mip_level_expected[] = { 0xff0000ff, 0xff00ff00, 0xffff0000, 0xff000000 }; + static const WCHAR test_resource_name[] = L"resource.data"; + static const WCHAR test_filename[] = L"image.data"; + D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc; + D3D11_TEXTURE2D_DESC tex_2d_desc; + D3DX11_IMAGE_LOAD_INFO load_info; + ID3D11ShaderResourceView *srv; + D3DX11_IMAGE_INFO img_info; + ID3D11Resource *resource; + ID3D11Texture2D *tex_2d; + HMODULE resource_module; + ID3D11Device *device; + WCHAR path[MAX_PATH]; + uint32_t i, mip_level; + HRESULT hr, hr2; + + device = create_device(); + if (!device) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + CoInitialize(NULL); + + /* D3DX11CreateShaderResourceViewFromMemory tests. */ + srv = (ID3D11ShaderResourceView *)0xdeadbeef; + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromMemory(NULL, test_bmp_1bpp, sizeof(test_bmp_1bpp), NULL, NULL, &srv, &hr2); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + ok(srv == (ID3D11ShaderResourceView *)0xdeadbeef, "Got unexpected srv %p.\n", srv); + + srv = (ID3D11ShaderResourceView *)0xdeadbeef; + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromMemory(device, NULL, 0, NULL, NULL, &srv, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + ok(srv == (ID3D11ShaderResourceView *)0xdeadbeef, "Got unexpected srv %p.\n", srv); + + srv = (ID3D11ShaderResourceView *)0xdeadbeef; + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromMemory(device, NULL, sizeof(test_bmp_1bpp), NULL, NULL, &srv, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + ok(srv == (ID3D11ShaderResourceView *)0xdeadbeef, "Got unexpected srv %p.\n", srv); + + srv = (ID3D11ShaderResourceView *)0xdeadbeef; + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromMemory(device, test_bmp_1bpp, 0, NULL, NULL, &srv, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(srv == (ID3D11ShaderResourceView *)0xdeadbeef, "Got unexpected srv %p.\n", srv); + + srv = (ID3D11ShaderResourceView *)0xdeadbeef; + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromMemory(device, test_bmp_1bpp, sizeof(test_bmp_1bpp) - 1, NULL, NULL, &srv, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(srv == (ID3D11ShaderResourceView *)0xdeadbeef, "Got unexpected srv %p.\n", srv); + + for (i = 0; i < ARRAY_SIZE(test_image); ++i) + { + winetest_push_context("Test %u", i); + + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromMemory(device, test_image[i].data, test_image[i].size, NULL, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + check_shader_resource_view_info(srv, test_image + i, __LINE__); + ID3D11ShaderResourceView_Release(srv); + } + + winetest_pop_context(); + } + + for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) + { + const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; + + winetest_push_context("Test %u", i); + + hr2 = 0xdeadbeef; + load_info = test_load_info->load_info; + hr = D3DX11CreateShaderResourceViewFromMemory(device, test_load_info->data, test_load_info->size, &load_info, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D11ShaderResourceView_Release(srv); + + winetest_pop_context(); + } + + for (i = 0; i < ARRAY_SIZE(test_image_load_info); ++i) + { + const struct test_image_load_info *test_load_info = &test_image_load_info[i]; + + winetest_push_context("Test %u", i); + + load_info = test_load_info->load_info; + load_info.pSrcInfo = &img_info; + + srv = NULL; + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromMemory(device, test_load_info->data, test_load_info->size, &load_info, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + check_test_image_load_info_srv(srv, test_load_info); + ID3D11ShaderResourceView_Release(srv); + } + + winetest_pop_context(); + } + + /* Check behavior of the FirstMipLevel argument. */ + for (i = 0; i < 2; ++i) + { + winetest_push_context("FirstMipLevel %u", i); + memset(&img_info, 0, sizeof(img_info)); + set_d3dx11_image_load_info(&load_info, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, i, D3DX11_FROM_FILE, + D3D11_USAGE_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, + D3DX11_DEFAULT, &img_info); + + srv = NULL; + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromMemory(device, dds_24bit_8_8, sizeof(dds_24bit_8_8), &load_info, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_DDS, FALSE); + + ID3D11ShaderResourceView_GetDesc(srv, &srv_desc); + ok(srv_desc.ViewDimension == D3D11_SRV_DIMENSION_TEXTURE2D, "Got unexpected ViewDimension %u.\n", srv_desc.ViewDimension); + ok(srv_desc.Format == img_info.Format, "Got unexpected Format %#x.\n", srv_desc.Format); + ok(!srv_desc.Texture2D.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", srv_desc.Texture2D.MostDetailedMip); + ok(srv_desc.Texture2D.MipLevels == img_info.MipLevels, "Unexpected MipLevels %u.\n", srv_desc.Texture2D.MipLevels); + + ID3D11ShaderResourceView_GetResource(srv, &resource); + hr = ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture2D, (void **)&tex_2d); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + ID3D11Texture2D_GetDesc(tex_2d, &tex_2d_desc); + check_texture2d_desc_values(&tex_2d_desc, 8, 8, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D11_USAGE_DEFAULT, + D3D11_BIND_SHADER_RESOURCE, 0, 0, FALSE); + for (mip_level = 0; mip_level < 4; ++mip_level) + { + winetest_push_context("MipLevel %u", mip_level); + check_texture_sub_resource_color(tex_2d, mip_level, NULL, + dds_24bit_8_8_mip_level_expected[min(3, mip_level + i)], 0); + winetest_pop_context(); + } + + ID3D11Texture2D_Release(tex_2d); + ID3D11Resource_Release(resource); + ID3D11ShaderResourceView_Release(srv); + winetest_pop_context(); + } + + /* + * If FirstMipLevel is set to a value that is larger than the total number + * of mip levels in the image, it falls back to 0. + */ + memset(&img_info, 0, sizeof(img_info)); + set_d3dx11_image_load_info(&load_info, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, 5, D3DX11_FROM_FILE, + D3D11_USAGE_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, D3DX11_DEFAULT, + D3DX11_DEFAULT, &img_info); + + resource = NULL; + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromMemory(device, dds_24bit_8_8, sizeof(dds_24bit_8_8), &load_info, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_DDS, FALSE); + + ID3D11ShaderResourceView_GetDesc(srv, &srv_desc); + ok(srv_desc.ViewDimension == D3D11_SRV_DIMENSION_TEXTURE2D, "Got unexpected ViewDimension %u.\n", srv_desc.ViewDimension); + ok(srv_desc.Format == img_info.Format, "Got unexpected Format %#x.\n", srv_desc.Format); + ok(!srv_desc.Texture2D.MostDetailedMip, "Unexpected MostDetailedMip %u.\n", srv_desc.Texture2D.MostDetailedMip); + ok(srv_desc.Texture2D.MipLevels == img_info.MipLevels, "Unexpected MipLevels %u.\n", srv_desc.Texture2D.MipLevels); + + ID3D11ShaderResourceView_GetResource(srv, &resource); + hr = ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture2D, (void **)&tex_2d); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ID3D11Texture2D_GetDesc(tex_2d, &tex_2d_desc); + check_texture2d_desc_values(&tex_2d_desc, 8, 8, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D11_USAGE_DEFAULT, + D3D11_BIND_SHADER_RESOURCE, 0, 0, FALSE); + for (mip_level = 0; mip_level < 4; ++mip_level) + { + winetest_push_context("MipLevel %u", mip_level); + check_texture_sub_resource_color(tex_2d, mip_level, NULL, dds_24bit_8_8_mip_level_expected[mip_level], 0); + winetest_pop_context(); + } + + ID3D11Texture2D_Release(tex_2d); + ID3D11Resource_Release(resource); + ID3D11ShaderResourceView_Release(srv); + + hr2 = 0xdeadbeef; + add_work_item_count = 0; + hr = D3DX11CreateShaderResourceViewFromMemory(device, test_image[0].data, test_image[0].size, + NULL, &thread_pump, &srv, &hr2); + ok(add_work_item_count == 1, "Got unexpected add_work_item_count %u.\n", add_work_item_count); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + check_shader_resource_view_info(srv, test_image, __LINE__); + ID3D11ShaderResourceView_Release(srv); + + /* D3DX11CreateShaderResourceViewFromFile tests */ + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromFileW(device, NULL, NULL, NULL, &srv, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromFileW(device, L"deadbeef", NULL, NULL, &srv, &hr2); + ok(hr == D3D11_ERROR_FILE_NOT_FOUND, "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromFileA(device, NULL, NULL, NULL, &srv, &hr2); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromFileA(device, "deadbeef", NULL, NULL, &srv, &hr2); + ok(hr == D3D11_ERROR_FILE_NOT_FOUND, "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + + for (i = 0; i < ARRAY_SIZE(test_image); ++i) + { + winetest_push_context("Test %u", i); + create_file(test_filename, test_image[i].data, test_image[i].size, path); + + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromFileW(device, path, NULL, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + check_shader_resource_view_info(srv, test_image + i, __LINE__); + ID3D11ShaderResourceView_Release(srv); + } + + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromFileA(device, get_str_a(path), NULL, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + if (hr == S_OK) + { + check_shader_resource_view_info(srv, test_image + i, __LINE__); + ID3D11ShaderResourceView_Release(srv); + } + + delete_file(test_filename); + winetest_pop_context(); + } + + for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) + { + const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; + + winetest_push_context("Test %u", i); + create_file(test_filename, test_image[i].data, test_image[i].size, path); + load_info = test_load_info->load_info; + + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromFileW(device, path, &load_info, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D11ShaderResourceView_Release(srv); + + hr = D3DX11CreateShaderResourceViewFromFileA(device, get_str_a(path), &load_info, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D11ShaderResourceView_Release(srv); + + delete_file(test_filename); + winetest_pop_context(); + } + + /* D3DX11CreateShaderResourceViewFromResource tests */ + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromResourceW(device, NULL, NULL, NULL, NULL, &srv, &hr2); + ok(hr == D3DX11_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromResourceW(device, NULL, L"deadbeef", NULL, NULL, &srv, &hr2); + ok(hr == D3DX11_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromResourceA(device, NULL, NULL, NULL, NULL, &srv, &hr2); + ok(hr == D3DX11_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromResourceA(device, NULL, "deadbeef", NULL, NULL, &srv, &hr2); + ok(hr == D3DX11_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + + for (i = 0; i < ARRAY_SIZE(test_image); ++i) + { + winetest_push_context("Test %u", i); + resource_module = create_resource_module(test_resource_name, test_image[i].data, test_image[i].size); + + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromResourceW(device, resource_module, L"deadbeef", NULL, NULL, &srv, &hr2); + ok(hr == D3DX11_ERR_INVALID_DATA, "Got unexpected hr %#lx.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#lx.\n", hr2); + + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromResourceW(device, resource_module, + test_resource_name, NULL, NULL, &srv, &hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + if (hr == S_OK) + { + check_shader_resource_view_info(srv, test_image + i, __LINE__); + ID3D11ShaderResourceView_Release(srv); + } + + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromResourceA(device, resource_module, + get_str_a(test_resource_name), NULL, NULL, &srv, &hr2); + ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), + "Got unexpected hr %#lx.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + if (hr == S_OK) + { + check_shader_resource_view_info(srv, test_image + i, __LINE__); + ID3D11ShaderResourceView_Release(srv); + } + + delete_resource_module(test_resource_name, resource_module); + winetest_pop_context(); + } + + for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) + { + const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; + + winetest_push_context("Test %u", i); + resource_module = create_resource_module(test_resource_name, test_load_info->data, test_load_info->size); + load_info = test_load_info->load_info; + + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromResourceW(device, resource_module, + test_resource_name, &load_info, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D11ShaderResourceView_Release(srv); + + hr2 = 0xdeadbeef; + hr = D3DX11CreateShaderResourceViewFromResourceA(device, resource_module, + get_str_a(test_resource_name), &load_info, NULL, &srv, &hr2); + ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); + todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID3D11ShaderResourceView_Release(srv); + + delete_resource_module(test_resource_name, resource_module); + winetest_pop_context(); + } + + CoUninitialize(); + + ok(!ID3D11Device_Release(device), "Unexpected refcount.\n"); +} + START_TEST(d3dx11) { HMODULE wined3d; @@ -4058,4 +4501,5 @@ START_TEST(d3dx11) test_D3DX11CompileFromFile(); test_get_image_info(); test_create_texture(); + test_create_shader_resource_view(); } diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c index 91875b0e098c..da9e5c117e00 100644 --- a/dlls/d3dx11_43/texture.c +++ b/dlls/d3dx11_43/texture.c @@ -25,16 +25,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx); -HRESULT WINAPI D3DX11CreateShaderResourceViewFromMemory(ID3D11Device *device, const void *data, - SIZE_T data_size, D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, - ID3D11ShaderResourceView **view, HRESULT *hresult) -{ - FIXME("device %p, data %p, data_size %Iu, load_info %p, pump %p, view %p, hresult %p stub!\n", - device, data, data_size, load_info, pump, view, hresult); - - return E_NOTIMPL; -} - HRESULT WINAPI D3DX11SaveTextureToFileW(ID3D11DeviceContext *context, ID3D11Resource *texture, D3DX11_IMAGE_FILE_FORMAT format, const WCHAR *filename) { @@ -849,3 +839,225 @@ HRESULT WINAPI D3DX11CreateTextureFromResourceW(ID3D11Device *device, HMODULE mo *hresult = hr; return hr; } + +/* + * D3DX11CreateShaderResourceView variants. + */ +HRESULT WINAPI D3DX11CreateShaderResourceViewFromFileA(ID3D11Device *device, const char *src_file, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11ShaderResourceView **srv, HRESULT *hresult) +{ + WCHAR *buffer; + int str_len; + HRESULT hr; + + TRACE("device %p, src_file %s, load_info %p, pump %p, srv %p, hresult %p.\n", + device, debugstr_a(src_file), load_info, pump, srv, hresult); + + if (!device) + return E_INVALIDARG; + if (!src_file) + return E_FAIL; + + if (!(str_len = MultiByteToWideChar(CP_ACP, 0, src_file, -1, NULL, 0))) + return HRESULT_FROM_WIN32(GetLastError()); + + if (!(buffer = malloc(str_len * sizeof(*buffer)))) + return E_OUTOFMEMORY; + + MultiByteToWideChar(CP_ACP, 0, src_file, -1, buffer, str_len); + hr = D3DX11CreateShaderResourceViewFromFileW(device, buffer, load_info, pump, srv, hresult); + + free(buffer); + + return hr; +} + +HRESULT WINAPI D3DX11CreateShaderResourceViewFromFileW(ID3D11Device *device, const WCHAR *src_file, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11ShaderResourceView **srv, HRESULT *hresult) +{ + ID3D11Resource *texture; + void *buffer = NULL; + DWORD size = 0; + HRESULT hr; + + TRACE("device %p, src_file %s, load_info %p, pump %p, srv %p, hresult %p.\n", + device, debugstr_w(src_file), load_info, pump, srv, hresult); + + if (!device) + return E_INVALIDARG; + if (!src_file) + return E_FAIL; + + if (pump) + { + ID3DX11DataProcessor *processor; + ID3DX11DataLoader *loader; + + if (FAILED((hr = D3DX11CreateAsyncFileLoaderW(src_file, &loader)))) + return hr; + if (FAILED((hr = D3DX11CreateAsyncShaderResourceViewProcessor(device, load_info, &processor)))) + { + ID3DX11DataLoader_Destroy(loader); + return hr; + } + if (FAILED((hr = ID3DX11ThreadPump_AddWorkItem(pump, loader, processor, hresult, (void **)srv)))) + { + ID3DX11DataLoader_Destroy(loader); + ID3DX11DataProcessor_Destroy(processor); + } + return hr; + } + + if (SUCCEEDED((hr = load_file(src_file, &buffer, &size)))) + { + hr = create_texture(device, buffer, size, load_info, &texture); + if (SUCCEEDED(hr)) + { + hr = ID3D11Device_CreateShaderResourceView(device, texture, NULL, srv); + ID3D11Resource_Release(texture); + } + free(buffer); + } + if (hresult) + *hresult = hr; + return hr; +} + +HRESULT WINAPI D3DX11CreateShaderResourceViewFromResourceA(ID3D11Device *device, HMODULE module, const char *resource, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11ShaderResourceView **srv, HRESULT *hresult) +{ + ID3D11Resource *texture; + void *buffer; + DWORD size; + HRESULT hr; + + TRACE("device %p, module %p, resource %s, load_info %p, pump %p, srv %p, hresult %p.\n", + device, module, debugstr_a(resource), load_info, pump, srv, hresult); + + if (!device) + return E_INVALIDARG; + + if (pump) + { + ID3DX11DataProcessor *processor; + ID3DX11DataLoader *loader; + + if (FAILED((hr = D3DX11CreateAsyncResourceLoaderA(module, resource, &loader)))) + return hr; + if (FAILED((hr = D3DX11CreateAsyncShaderResourceViewProcessor(device, load_info, &processor)))) + { + ID3DX11DataLoader_Destroy(loader); + return hr; + } + if (FAILED((hr = ID3DX11ThreadPump_AddWorkItem(pump, loader, processor, hresult, (void **)srv)))) + { + ID3DX11DataLoader_Destroy(loader); + ID3DX11DataProcessor_Destroy(processor); + } + return hr; + } + + if (FAILED((hr = load_resourceA(module, resource, &buffer, &size)))) + return hr; + hr = create_texture(device, buffer, size, load_info, &texture); + if (SUCCEEDED(hr)) + { + hr = ID3D11Device_CreateShaderResourceView(device, texture, NULL, srv); + ID3D11Resource_Release(texture); + } + if (hresult) + *hresult = hr; + return hr; +} + +HRESULT WINAPI D3DX11CreateShaderResourceViewFromResourceW(ID3D11Device *device, HMODULE module, const WCHAR *resource, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11ShaderResourceView **srv, HRESULT *hresult) +{ + ID3D11Resource *texture; + void *buffer; + DWORD size; + HRESULT hr; + + TRACE("device %p, module %p, resource %s, load_info %p, pump %p, srv %p, hresult %p.\n", + device, module, debugstr_w(resource), load_info, pump, srv, hresult); + + if (!device) + return E_INVALIDARG; + + if (pump) + { + ID3DX11DataProcessor *processor; + ID3DX11DataLoader *loader; + + if (FAILED((hr = D3DX11CreateAsyncResourceLoaderW(module, resource, &loader)))) + return hr; + if (FAILED((hr = D3DX11CreateAsyncShaderResourceViewProcessor(device, load_info, &processor)))) + { + ID3DX11DataLoader_Destroy(loader); + return hr; + } + if (FAILED((hr = ID3DX11ThreadPump_AddWorkItem(pump, loader, processor, hresult, (void **)srv)))) + { + ID3DX11DataLoader_Destroy(loader); + ID3DX11DataProcessor_Destroy(processor); + } + return hr; + } + + if (FAILED((hr = load_resourceW(module, resource, &buffer, &size)))) + return hr; + hr = create_texture(device, buffer, size, load_info, &texture); + if (SUCCEEDED(hr)) + { + hr = ID3D11Device_CreateShaderResourceView(device, texture, NULL, srv); + ID3D11Resource_Release(texture); + } + if (hresult) + *hresult = hr; + return hr; +} + +HRESULT WINAPI D3DX11CreateShaderResourceViewFromMemory(ID3D11Device *device, const void *src_data, SIZE_T src_data_size, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11ShaderResourceView **srv, HRESULT *hresult) +{ + ID3D11Resource *texture; + HRESULT hr; + + TRACE("device %p, src_data %p, src_data_size %Iu, load_info %p, pump %p, srv %p, hresult %p.\n", + device, src_data, src_data_size, load_info, pump, srv, hresult); + + if (!device) + return E_INVALIDARG; + if (!src_data) + return E_FAIL; + + if (pump) + { + ID3DX11DataProcessor *processor; + ID3DX11DataLoader *loader; + + if (FAILED((hr = D3DX11CreateAsyncMemoryLoader(src_data, src_data_size, &loader)))) + return hr; + if (FAILED((hr = D3DX11CreateAsyncShaderResourceViewProcessor(device, load_info, &processor)))) + { + ID3DX11DataLoader_Destroy(loader); + return hr; + } + if (FAILED((hr = ID3DX11ThreadPump_AddWorkItem(pump, loader, processor, hresult, (void **)srv)))) + { + ID3DX11DataLoader_Destroy(loader); + ID3DX11DataProcessor_Destroy(processor); + } + return hr; + } + + hr = create_texture(device, src_data, src_data_size, load_info, &texture); + if (SUCCEEDED(hr)) + { + hr = ID3D11Device_CreateShaderResourceView(device, texture, NULL, srv); + ID3D11Resource_Release(texture); + } + if (hresult) + *hresult = hr; + return hr; +} diff --git a/include/d3dx11tex.h b/include/d3dx11tex.h index 386945fd70d3..267a61c2bdd6 100644 --- a/include/d3dx11tex.h +++ b/include/d3dx11tex.h @@ -140,6 +140,15 @@ extern "C" { HRESULT WINAPI D3DX11CreateShaderResourceViewFromMemory(ID3D11Device *device, const void *data, SIZE_T data_size, D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11ShaderResourceView **view, HRESULT *hresult); +HRESULT WINAPI D3DX11CreateShaderResourceViewFromFileA(ID3D11Device *device, const char *src_file, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11ShaderResourceView **srv, HRESULT *hresult); +HRESULT WINAPI D3DX11CreateShaderResourceViewFromFileW(ID3D11Device *device, const WCHAR *src_file, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11ShaderResourceView **srv, HRESULT *hresult); +HRESULT WINAPI D3DX11CreateShaderResourceViewFromResourceA(ID3D11Device *device, HMODULE module, const char *resource, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11ShaderResourceView **srv, HRESULT *hresult); +HRESULT WINAPI D3DX11CreateShaderResourceViewFromResourceW(ID3D11Device *device, HMODULE module, const WCHAR *resource, + D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11ShaderResourceView **srv, HRESULT *hresult); + HRESULT WINAPI D3DX11CreateTextureFromFileA(ID3D11Device *device, const char *filename, D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, ID3D11Resource **texture, HRESULT *hresult); From dc4026ba9862e8291030bdfbb8899cf96d8c7fc2 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 29 Aug 2024 09:52:34 -0400 Subject: [PATCH 0973/2542] d3dx11: Implement D3DX11LoadTextureFromTexture(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx11_43/tests/d3dx11.c | 912 ++++++++++++++++++++++++++++++++++ dlls/d3dx11_43/texture.c | 371 +++++++++++++- 2 files changed, 1274 insertions(+), 9 deletions(-) diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index bcde6e71bfce..91715666f056 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -57,6 +57,22 @@ static BOOL is_block_compressed(DXGI_FORMAT format) return FALSE; } +static BOOL dxgi_format_is_8bpp_rgba(DXGI_FORMAT format) +{ + switch (format) + { + case DXGI_FORMAT_R8G8B8A8_TYPELESS: + case DXGI_FORMAT_R8G8B8A8_UNORM: + case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: + case DXGI_FORMAT_R8G8B8A8_UINT: + case DXGI_FORMAT_R8G8B8A8_SNORM: + case DXGI_FORMAT_R8G8B8A8_SINT: + return TRUE; + default: + return FALSE; + } +} + static uint32_t get_bpp_from_format(DXGI_FORMAT format) { switch (format) @@ -4479,6 +4495,901 @@ static void test_create_shader_resource_view(void) ok(!ID3D11Device_Release(device), "Unexpected refcount.\n"); } +/* + * 4x4 RGBA cubemap with faces in the following order: blue, green, red, + * green/blue, red/blue, red/green. + */ +static const uint8_t rgba_4_4_cubemap[] = +{ + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff, + 0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff, + 0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff, + 0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff, + 0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff, + 0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff, + 0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff, + 0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff, + 0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff, + 0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff, + 0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff, + 0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff, + 0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff, + 0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, + 0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, + 0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, + 0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, +}; + +/* + * 8x8 (BC1-BC3) image data, four 4x4 blocks: + * +-----+-----+ + * |Blue |Green| + * | | | + * +-----+-----+ + * |Red |Black| + * | | | + * +-----+-----+ + */ +static const uint8_t bc1_8_8[] = +{ + 0x1f,0x00,0x1f,0x00,0xaa,0xaa,0xaa,0xaa,0xe0,0x07,0xe0,0x07,0xaa,0xaa,0xaa,0xaa, + 0x00,0xf8,0x00,0xf8,0xaa,0xaa,0xaa,0xaa,0x00,0x00,0x00,0x00,0xaa,0xaa,0xaa,0xaa, +}; + +static const uint8_t bc2_8_8[] = +{ + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x1f,0x00,0xaa,0xaa,0xaa,0xaa, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x07,0xe0,0x07,0xaa,0xaa,0xaa,0xaa, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0xf8,0x00,0xf8,0xaa,0xaa,0xaa,0xaa, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xaa,0xaa,0xaa,0xaa, +}; + +static const uint8_t bc3_8_8[] = +{ + 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x00,0x1f,0x00,0x00,0x00,0x00,0x00, + 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x07,0xe0,0x07,0x00,0x00,0x00,0x00, + 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x00,0xf8,0x00,0x00,0x00,0x00, + 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +}; + +static const uint8_t bc1_to_bc3_8_8_decompressed[] = +{ + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff, + 0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff, + 0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff, + 0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff, + 0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff, + 0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff, + 0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff, + 0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff, + 0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff, + 0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff, + 0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff, + 0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff, +}; + +static const uint8_t bc4_unorm_8_8[] = +{ + 0xff,0xff,0x49,0x92,0x24,0x49,0x92,0x24,0x80,0x80,0x49,0x92,0x24,0x49,0x92,0x24, + 0x00,0x00,0x49,0x92,0x24,0x49,0x92,0x24,0x40,0x40,0x49,0x92,0x24,0x49,0x92,0x24, +}; + +static const uint8_t r8_unorm_8_8_decompressed[] = +{ + 0xff,0xff,0xff,0xff,0x80,0x80,0x80,0x80,0xff,0xff,0xff,0xff,0x80,0x80,0x80,0x80, + 0xff,0xff,0xff,0xff,0x80,0x80,0x80,0x80,0xff,0xff,0xff,0xff,0x80,0x80,0x80,0x80, + 0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40, + 0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40, +}; + +static const uint8_t bc5_unorm_8_8[] = +{ + 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xdf,0xdf,0x00,0x00,0x00,0x00,0x00,0x00, + 0xbf,0xbf,0x00,0x00,0x00,0x00,0x00,0x00,0x9f,0x9f,0x00,0x00,0x00,0x00,0x00,0x00, + 0x7f,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x5f,0x00,0x00,0x00,0x00,0x00,0x00, + 0x3f,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x1f,0x00,0x00,0x00,0x00,0x00,0x00, +}; + +static const uint8_t r8g8_unorm_8_8_decompressed[] = +{ + 0xff,0xdf,0xff,0xdf,0xff,0xdf,0xff,0xdf,0xbf,0x9f,0xbf,0x9f,0xbf,0x9f,0xbf,0x9f, + 0xff,0xdf,0xff,0xdf,0xff,0xdf,0xff,0xdf,0xbf,0x9f,0xbf,0x9f,0xbf,0x9f,0xbf,0x9f, + 0xff,0xdf,0xff,0xdf,0xff,0xdf,0xff,0xdf,0xbf,0x9f,0xbf,0x9f,0xbf,0x9f,0xbf,0x9f, + 0xff,0xdf,0xff,0xdf,0xff,0xdf,0xff,0xdf,0xbf,0x9f,0xbf,0x9f,0xbf,0x9f,0xbf,0x9f, + 0x7f,0x5f,0x7f,0x5f,0x7f,0x5f,0x7f,0x5f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f, + 0x7f,0x5f,0x7f,0x5f,0x7f,0x5f,0x7f,0x5f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f, + 0x7f,0x5f,0x7f,0x5f,0x7f,0x5f,0x7f,0x5f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f, + 0x7f,0x5f,0x7f,0x5f,0x7f,0x5f,0x7f,0x5f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f, +}; + +/* + * DXGI_FORMAT_BC{4,5}_SNORM compression/decompression is bugged in + * native D3DX10/D3DX11. When decompressing, it seems to read the decompressed + * 8-bit channel values as signed normalized integers, but then clamps them to the + * unsigned normalized integer range. That means 0x00-0x7f present unique values, + * but anything from 0x80-0xff just gives the equivalent of 0x00. When this gets + * converted to an SNORM format such as DXGI_FORMAT_R8_SNORM, it gets mapped + * to the SNORM range, where 0x00 is -1.0f, and 0x7f is 1.0f. So effectively, + * it ends up with half of the range. + */ +static const uint8_t bc4_snorm_8_8[] = +{ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00, + 0x7f,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x5f,0x00,0x00,0x00,0x00,0x00,0x00, +}; + +static const uint8_t r8_snorm_8_8_decompressed[] = +{ + 0x81,0x81,0x81,0x81,0xc1,0xc1,0xc1,0xc1,0x81,0x81,0x81,0x81,0xc1,0xc1,0xc1,0xc1, + 0x81,0x81,0x81,0x81,0xc1,0xc1,0xc1,0xc1,0x81,0x81,0x81,0x81,0xc1,0xc1,0xc1,0xc1, + 0x7F,0x7F,0x7F,0x7F,0x3F,0x3F,0x3F,0x3F,0x7F,0x7F,0x7F,0x7F,0x3F,0x3F,0x3F,0x3F, + 0x7F,0x7F,0x7F,0x7F,0x3F,0x3F,0x3F,0x3F,0x7F,0x7F,0x7F,0x7F,0x3F,0x3F,0x3F,0x3F, +}; + +static const uint8_t bc5_snorm_8_8[] = +{ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00, + 0x1f,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x2f,0x2f,0x00,0x00,0x00,0x00,0x00,0x00, + 0x3e,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x4e,0x4e,0x00,0x00,0x00,0x00,0x00,0x00, + 0x5d,0x5d,0x00,0x00,0x00,0x00,0x00,0x00,0x6d,0x6d,0x00,0x00,0x00,0x00,0x00,0x00, +}; + +static const uint8_t r8g8_snorm_8_8_decompressed[] = +{ + 0x81,0xa1,0x81,0xa1,0x81,0xa1,0x81,0xa1,0xbf,0xdf,0xbf,0xdf,0xbf,0xdf,0xbf,0xdf, + 0x81,0xa1,0x81,0xa1,0x81,0xa1,0x81,0xa1,0xbf,0xdf,0xbf,0xdf,0xbf,0xdf,0xbf,0xdf, + 0x81,0xa1,0x81,0xa1,0x81,0xa1,0x81,0xa1,0xbf,0xdf,0xbf,0xdf,0xbf,0xdf,0xbf,0xdf, + 0x81,0xa1,0x81,0xa1,0x81,0xa1,0x81,0xa1,0xbf,0xdf,0xbf,0xdf,0xbf,0xdf,0xbf,0xdf, + 0xfd,0x1d,0xfd,0x1d,0xfd,0x1d,0xfd,0x1d,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b, + 0xfd,0x1d,0xfd,0x1d,0xfd,0x1d,0xfd,0x1d,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b, + 0xfd,0x1d,0xfd,0x1d,0xfd,0x1d,0xfd,0x1d,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b, + 0xfd,0x1d,0xfd,0x1d,0xfd,0x1d,0xfd,0x1d,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b, +}; + +static const uint8_t rgba_unorm_4_4[] = +{ + 0x10,0x20,0x30,0x40,0x50,0x60,0x70,0x80,0x90,0xa0,0xb0,0xc0,0xd0,0xe0,0xf0,0xff, + 0x14,0x24,0x34,0x44,0x54,0x64,0x74,0x84,0x94,0xa4,0xb4,0xc4,0xd4,0xe4,0xf4,0xff, + 0x18,0x28,0x38,0x48,0x58,0x68,0x78,0x88,0x98,0xa8,0xb8,0xc8,0xd8,0xe8,0xf8,0xff, + 0x1c,0x2c,0x3c,0x4c,0x5c,0x6c,0x7c,0x8c,0x9c,0xac,0xbc,0xcc,0xdc,0xec,0xfc,0xff, +}; + +static const uint8_t rgba_snorm_4_4[] = +{ + 0x91,0xa1,0xb1,0xc1,0xd1,0xe1,0xf1,0x00,0x10,0x20,0x30,0x40,0x50,0x60,0x70,0x7f, + 0x95,0xa5,0xb5,0xc5,0xd5,0xe5,0xf5,0x04,0x14,0x24,0x34,0x44,0x54,0x64,0x74,0x7f, + 0x99,0xa9,0xb9,0xc9,0xd9,0xe9,0xf9,0x08,0x18,0x28,0x38,0x48,0x58,0x68,0x78,0x7f, + 0x9d,0xad,0xbd,0xcd,0xdd,0xed,0xfd,0x0c,0x1c,0x2c,0x3c,0x4c,0x5c,0x6c,0x7c,0x7f, +}; + +/* Conversion to/from uint/sint. */ +static const uint8_t rgba_uint_4_4[] = +{ + 0x00,0x04,0x08,0x0c,0x10,0x14,0x18,0x1c,0x20,0x24,0x28,0x2c,0x30,0x34,0x38,0x3c, + 0x40,0x44,0x48,0x4c,0x50,0x54,0x58,0x5c,0x60,0x64,0x68,0x6c,0x70,0x74,0x78,0x7c, + 0x80,0x84,0x88,0x8c,0x90,0x94,0x98,0x9c,0xa0,0xa4,0xa8,0xac,0xb0,0xb4,0xb8,0xbc, + 0xc0,0xc4,0xc8,0xcc,0xd0,0xd4,0xd8,0xdc,0xe0,0xe4,0xe8,0xec,0xf0,0xf4,0xf8,0xfc, +}; + +static const uint8_t rgba_uint_to_sint_4_4[] = +{ + 0x00,0x04,0x08,0x0c,0x10,0x14,0x18,0x1c,0x20,0x24,0x28,0x2c,0x30,0x34,0x38,0x3c, + 0x40,0x44,0x48,0x4c,0x50,0x54,0x58,0x5c,0x60,0x64,0x68,0x6c,0x70,0x74,0x78,0x7c, + 0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f, + 0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f, +}; + +static const uint8_t rgba_sint_4_4[] = +{ + 0x80,0x84,0x88,0x8c,0x90,0x94,0x98,0x9c,0xa0,0xa4,0xa8,0xac,0xb0,0xb4,0xb8,0xbc, + 0xc0,0xc4,0xc8,0xcc,0xd0,0xd4,0xd8,0xdc,0xe0,0xe4,0xe8,0xec,0xf0,0xf4,0xf8,0xfc, + 0x00,0x04,0x08,0x0c,0x10,0x14,0x18,0x1c,0x20,0x24,0x28,0x2c,0x30,0x34,0x38,0x3c, + 0x40,0x44,0x48,0x4c,0x50,0x54,0x58,0x5c,0x60,0x64,0x68,0x6c,0x70,0x74,0x78,0x7c, +}; + +static const uint8_t rgba_sint_to_uint_4_4[] = +{ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x04,0x08,0x0c,0x10,0x14,0x18,0x1c,0x20,0x24,0x28,0x2c,0x30,0x34,0x38,0x3c, + 0x40,0x44,0x48,0x4c,0x50,0x54,0x58,0x5c,0x60,0x64,0x68,0x6c,0x70,0x74,0x78,0x7c, +}; + +/* Conversion to/from SRGB. */ +static const uint8_t rgba_unorm_srgb_4_4[] = +{ + 0x10,0x20,0x30,0x40,0x50,0x60,0x70,0x80,0x90,0xa0,0xb0,0xc0,0xd0,0xe0,0xf0,0xff, + 0x14,0x24,0x34,0x44,0x54,0x64,0x74,0x84,0x94,0xa4,0xb4,0xc4,0xd4,0xe4,0xf4,0xff, + 0x18,0x28,0x38,0x48,0x58,0x68,0x78,0x88,0x98,0xa8,0xb8,0xc8,0xd8,0xe8,0xf8,0xff, + 0x1c,0x2c,0x3c,0x4c,0x5c,0x6c,0x7c,0x8c,0x9c,0xac,0xbc,0xcc,0xdc,0xec,0xfc,0xff, +}; + +static const uint8_t rgba_unorm_srgb_to_unorm_non_srgb_4_4[] = +{ + 0x01,0x03,0x06,0x40,0x14,0x1e,0x2a,0x80,0x49,0x5b,0x71,0xc0,0xa3,0xc0,0xdf,0xff, + 0x01,0x03,0x08,0x44,0x16,0x21,0x2d,0x84,0x4d,0x61,0x77,0xc4,0xaa,0xc7,0xe7,0xff, + 0x01,0x04,0x09,0x48,0x19,0x23,0x31,0x88,0x52,0x66,0x7c,0xc8,0xb1,0xcf,0xf0,0xff, + 0x02,0x05,0x0b,0x4c,0x1b,0x27,0x34,0x8c,0x57,0x6b,0x82,0xcc,0xb8,0xd7,0xf8,0xff, +}; + +static const uint8_t rgba_unorm_non_srgb_4_4[] = +{ + 0x00,0x20,0x50,0x40,0x50,0x60,0x70,0x80,0x90,0xa0,0xb0,0xc0,0xd0,0xe0,0xf0,0xff, + 0x00,0x24,0x54,0x44,0x54,0x64,0x74,0x84,0x94,0xa4,0xb4,0xc4,0xd4,0xe4,0xf4,0xff, + 0x00,0x28,0x58,0x48,0x58,0x68,0x78,0x88,0x98,0xa8,0xb8,0xc8,0xd8,0xe8,0xf8,0xff, + 0x00,0x2c,0x5c,0x4c,0x5c,0x6c,0x7c,0x8c,0x9c,0xac,0xbc,0xcc,0xdc,0xec,0xfc,0xff, +}; + +static const uint8_t rgba_unorm_non_srgb_to_unorm_srgb_4_4[] = +{ + 0x00,0x63,0x97,0x40,0x97,0xa4,0xaf,0x80,0xc5,0xce,0xd7,0xc0,0xe8,0xf0,0xf8,0xff, + 0x00,0x69,0x9a,0x44,0x9a,0xa7,0xb2,0x84,0xc7,0xd1,0xda,0xc4,0xea,0xf2,0xfa,0xff, + 0x00,0x6e,0x9d,0x48,0x9d,0xaa,0xb5,0x88,0xca,0xd3,0xdc,0xc8,0xec,0xf4,0xfc,0xff, + 0x00,0x73,0xa0,0x4c,0xa0,0xad,0xb8,0x8c,0xcc,0xd5,0xde,0xcc,0xee,0xf6,0xfe,0xff, +}; + +static const struct test_texture_format_conversion +{ + D3D11_TEXTURE2D_DESC src_desc; + const uint8_t *src_data; + + DXGI_FORMAT dst_format; + const uint8_t *expected_dst_data; + + uint8_t max_diff; + BOOL todo_hr; + BOOL todo_data; +} +test_texture_format_conversion[] = +{ + { + { 8, 8, 1, 1, DXGI_FORMAT_BC1_UNORM, { 1, 0 }, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0 }, + bc1_8_8, DXGI_FORMAT_R8G8B8A8_UNORM, bc1_to_bc3_8_8_decompressed + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_BC2_UNORM, { 1, 0 }, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0 }, + bc2_8_8, DXGI_FORMAT_R8G8B8A8_UNORM, bc1_to_bc3_8_8_decompressed + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_BC3_UNORM, { 1, 0 }, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0 }, + bc3_8_8, DXGI_FORMAT_R8G8B8A8_UNORM, bc1_to_bc3_8_8_decompressed + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_BC4_UNORM, { 1, 0 }, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0 }, + bc4_unorm_8_8, DXGI_FORMAT_R8_UNORM, r8_unorm_8_8_decompressed + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_BC4_SNORM, { 1, 0 }, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0 }, + bc4_snorm_8_8, DXGI_FORMAT_R8_SNORM, r8_snorm_8_8_decompressed, .todo_data = TRUE + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_BC5_UNORM, { 1, 0 }, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0 }, + bc5_unorm_8_8, DXGI_FORMAT_R8G8_UNORM, r8g8_unorm_8_8_decompressed + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_BC5_SNORM, { 1, 0 }, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0 }, + bc5_snorm_8_8, DXGI_FORMAT_R8G8_SNORM, r8g8_snorm_8_8_decompressed, .todo_data = TRUE + }, + { + { 4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0 }, + /* + * Wine's UNORM->SNORM conversion doesn't always match Window's, + * worst case is a difference of +/- 1. + */ + rgba_unorm_4_4, DXGI_FORMAT_R8G8B8A8_SNORM, rgba_snorm_4_4, .max_diff = 1 + }, + { + { 4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_UINT, { 1, 0 }, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0 }, + rgba_uint_4_4, DXGI_FORMAT_R8G8B8A8_SINT, rgba_uint_to_sint_4_4, .todo_hr = TRUE + }, + { + { 4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_SINT, { 1, 0 }, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0 }, + rgba_sint_4_4, DXGI_FORMAT_R8G8B8A8_UINT, rgba_sint_to_uint_4_4, .todo_hr = TRUE + }, + { + { 4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, { 1, 0 }, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0 }, + rgba_unorm_srgb_4_4, DXGI_FORMAT_R8G8B8A8_UNORM, rgba_unorm_srgb_to_unorm_non_srgb_4_4, .max_diff = 3 + }, + { + { 4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0 }, + rgba_unorm_non_srgb_4_4, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, rgba_unorm_non_srgb_to_unorm_srgb_4_4, .max_diff = 2 + }, +}; + +static const struct test_texture_compression +{ + D3D11_TEXTURE2D_DESC src_desc; + DXGI_FORMAT compressed_format; + const BYTE *src_data; +} +test_texture_compression[] = +{ + { + { 8, 8, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0 }, + DXGI_FORMAT_BC1_UNORM, bc1_to_bc3_8_8_decompressed + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0 }, + DXGI_FORMAT_BC2_UNORM, bc1_to_bc3_8_8_decompressed + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0 }, + DXGI_FORMAT_BC3_UNORM, bc1_to_bc3_8_8_decompressed + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_R8_UNORM, { 1, 0 }, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0 }, + DXGI_FORMAT_BC4_UNORM, r8_unorm_8_8_decompressed + }, + { + { 8, 8, 1, 1, DXGI_FORMAT_R8G8_UNORM, { 1, 0 }, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0 }, + DXGI_FORMAT_BC5_UNORM, r8g8_unorm_8_8_decompressed + }, +}; + +#define check_texture_data_level(tex_pixels, tex_row_pitch, tex_slice_pitch, width, height, depth, format, exp_pixels, max_diff, wine_todo) \ + check_texture_data_level_(tex_pixels, tex_row_pitch, tex_slice_pitch, width, height, depth, format, exp_pixels, max_diff, wine_todo, __LINE__) +static void check_texture_data_level_(const uint8_t *tex_pixels, uint32_t tex_row_pitch, uint32_t tex_slice_pitch, uint32_t width, + uint32_t height, uint32_t depth, DXGI_FORMAT format, const uint8_t *exp_pixels, uint8_t max_diff, BOOL wine_todo, uint32_t line) +{ + uint32_t line_height, exp_row_pitch, exp_slice_pitch, i, j, k; + BOOL line_match = FALSE; + + line_height = 1; + exp_row_pitch = (width * get_bpp_from_format(format) + 7) / 8; + exp_slice_pitch = exp_row_pitch * height; + if (is_block_compressed(format)) + { + exp_row_pitch *= 4; + line_height = 4; + } + + for (i = 0; i < depth; ++i) + { + const uint8_t *exp_slice = exp_pixels + (i * (exp_slice_pitch)); + const uint8_t *pixel_slice = tex_pixels + (i * tex_slice_pitch); + + for (j = 0; j < height; j += line_height) + { + if (dxgi_format_is_8bpp_rgba(format)) + { + for (k = 0; k < width; ++k) + { + const uint32_t exp_pixel = ((const uint32_t *)(exp_slice + j * exp_row_pitch))[k]; + const uint32_t tex_pixel = ((const uint32_t *)(pixel_slice + j * tex_row_pitch))[k]; + const BOOL pixel_match = compare_color(tex_pixel, exp_pixel, max_diff); + + todo_wine_if(wine_todo) ok_(__FILE__, line)(pixel_match, "Data mismatch for pixel (%ux%ux%u).\n", k, j, i); + line_match = pixel_match; + if (!pixel_match) + break; + } + } + else + { + line_match = !memcmp(exp_slice + exp_row_pitch * (j / line_height), + pixel_slice + tex_row_pitch * (j / line_height), exp_row_pitch); + todo_wine_if(wine_todo) ok_(__FILE__, line)(line_match, "Data mismatch for line %u, slice %u.\n", j, i); + } + if (!line_match) + break; + } + } +} + +static void set_d3dx11_texture_load_info(D3DX11_TEXTURE_LOAD_INFO *load_info, D3D11_BOX *src_box, D3D11_BOX *dst_box, + uint32_t src_first_mip, uint32_t dst_first_mip, uint32_t num_mips, uint32_t src_first_element, + uint32_t dst_first_element, uint32_t num_elems, uint32_t filter, uint32_t mip_filter) +{ + load_info->pSrcBox = src_box; + load_info->pDstBox = dst_box; + load_info->SrcFirstMip = src_first_mip; + load_info->DstFirstMip = dst_first_mip; + load_info->NumMips = num_mips; + load_info->SrcFirstElement = src_first_element; + load_info->DstFirstElement = dst_first_element; + load_info->NumElements = num_elems; + load_info->Filter = filter; + load_info->MipFilter = mip_filter; +} + +static void set_d3d11_2d_texture_desc(D3D11_TEXTURE2D_DESC *desc, uint32_t width, uint32_t height, uint32_t mip_levels, + uint32_t array_size, DXGI_FORMAT format, uint32_t sample_count, uint32_t sample_quality, uint32_t usage, + uint32_t bind_flags, uint32_t cpu_access_flags, uint32_t misc_flags) +{ + desc->Width = width; + desc->Height = height; + desc->MipLevels = mip_levels; + desc->ArraySize = array_size; + desc->Format = format; + desc->SampleDesc.Count = sample_count; + desc->SampleDesc.Quality = sample_quality; + desc->Usage = usage; + desc->BindFlags = bind_flags; + desc->CPUAccessFlags = cpu_access_flags; + desc->MiscFlags = misc_flags; +} + +static void init_subresource_data(D3D11_SUBRESOURCE_DATA *subresources, const void *data, uint32_t width, uint32_t height, + uint32_t depth, uint32_t mip_levels, uint32_t array_size, DXGI_FORMAT format) +{ + const uint8_t *pixel_ptr = data; + uint32_t i, j; + + for (i = 0; i < array_size; ++i) + { + uint32_t tmp_width, tmp_height, tmp_depth; + + tmp_width = width; + tmp_height = height; + tmp_depth = depth; + for (j = 0; j < mip_levels; ++j) + { + D3D11_SUBRESOURCE_DATA *subresource = &subresources[(i * mip_levels) + j]; + + subresource->pSysMem = pixel_ptr; + subresource->SysMemPitch = (tmp_width * get_bpp_from_format(format) + 7) / 8; + subresource->SysMemSlicePitch = subresource->SysMemPitch * tmp_height; + if (is_block_compressed(format)) + subresource->SysMemPitch *= 4; + pixel_ptr += (subresource->SysMemSlicePitch * tmp_depth); + + tmp_width = max(tmp_width / 2, 1); + tmp_height = max(tmp_height / 2, 1); + tmp_depth = max(tmp_depth / 2, 1); + } + } +} + +static uint8_t *init_buffer_color(uint8_t *buf, uint32_t color, uint32_t width, uint32_t height, uint32_t depth) +{ + uint32_t i, total_pixels = width * height * depth; + uint32_t *color_buf = (uint32_t *)buf; + + for (i = 0; i < total_pixels; ++i) + color_buf[i] = color; + return buf + (total_pixels * 4); +} + +static void set_texture_sub_resource_color(ID3D11DeviceContext *context, ID3D11Resource *rsrc, uint32_t idx, uint32_t color, + uint32_t width, uint32_t height, uint32_t depth) +{ + uint8_t tmp_buf[1024]; + + init_buffer_color(tmp_buf, color, width, height, depth); + ID3D11DeviceContext_UpdateSubresource(context, rsrc, idx, NULL, (const void *)tmp_buf, width * sizeof(color), + width * height * sizeof(color)); +} + +static void test_D3DX11LoadTextureFromTexture(void) +{ + static const uint32_t test_cubemap_face_colors[] = { 0xffff0000, 0xff00ff00, 0xff0000ff, 0xffffff00, 0xffff00ff, 0xff00ffff }; + static const uint32_t test_tex_2d_array_colors[] = { 0xff0000ff, 0xff00ff00, 0xffff0000, 0xff000000 }; + D3D11_SUBRESOURCE_DATA sub_resource_data[6] = { 0 }; + D3DX11_TEXTURE_LOAD_INFO load_info; + ID3D11Texture2D *tex_2d, *tex2_2d; + D3D11_TEXTURE2D_DESC tex_2d_desc; + uint8_t tmp_buf[1024], *tmp_ptr; + ID3D11DeviceContext *context; + ID3D11Device *device; + RECT tmp_rect; + uint32_t i; + HRESULT hr; + + device = create_device(); + if (!device) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + CoInitialize(NULL); + ID3D11Device_GetImmediateContext(device, &context); + + /* + * Tests that still need to be written: + * -pSrcBox/pDstBox, how they behave WRT mip levels, too large, too small. + * -3D texture test. + */ + + /* 8x8 2D texture array with 2 elements and 2 mip levels. */ + tmp_ptr = tmp_buf; + for (i = 0; i < ARRAY_SIZE(test_tex_2d_array_colors); ++i) + tmp_ptr = init_buffer_color(tmp_ptr, test_tex_2d_array_colors[i], !(i & 0x1) ? 8 : 4, !(i & 0x1) ? 8 : 4, 1); + + set_d3d11_2d_texture_desc(&tex_2d_desc, 8, 8, 2, 2, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D11_USAGE_DEFAULT, + D3D11_BIND_SHADER_RESOURCE, 0, 0); + init_subresource_data(sub_resource_data, (const void *)tmp_buf, tex_2d_desc.Width, tex_2d_desc.Height, 1, + tex_2d_desc.MipLevels, tex_2d_desc.ArraySize, tex_2d_desc.Format); + hr = ID3D11Device_CreateTexture2D(device, &tex_2d_desc, sub_resource_data, &tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < ARRAY_SIZE(test_tex_2d_array_colors); ++i) + check_texture_sub_resource_color(tex_2d, i, NULL, test_tex_2d_array_colors[i], 0); + + /* 8x8 2D texture with 4 mip levels. */ + memset(tmp_buf, 0xff, sizeof(tmp_buf)); + set_d3d11_2d_texture_desc(&tex_2d_desc, 8, 8, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D11_USAGE_DEFAULT, + D3D11_BIND_SHADER_RESOURCE, 0, 0); + init_subresource_data(sub_resource_data, (const void *)tmp_buf, tex_2d_desc.Width, tex_2d_desc.Height, 1, + tex_2d_desc.MipLevels, tex_2d_desc.ArraySize, tex_2d_desc.Format); + hr = ID3D11Device_CreateTexture2D(device, &tex_2d_desc, sub_resource_data, &tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < 4; ++i) + check_texture_sub_resource_color(tex2_2d, i, NULL, 0xffffffff, 0); + + /* + * If a NULL load info argument is supplied, the default D3DX11_TEXTURE_LOAD_INFO + * values are used. The first 2 mip levels from tex_2d are loaded, and + * the last 2 mip levels of tex2_2d are generated from mip level 1. + */ + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex_2d, NULL, (ID3D11Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < 4; ++i) + check_texture_sub_resource_color(tex2_2d, i, NULL, test_tex_2d_array_colors[min(i, 1)], 0); + + /* NULL device context. */ + hr = D3DX11LoadTextureFromTexture(NULL, (ID3D11Resource *)tex_2d, NULL, (ID3D11Resource *)tex2_2d); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); + + /* Invalid Filter argument. */ + set_d3dx11_texture_load_info(&load_info, NULL, NULL, 0, 0, 0, 0, 0, 0, 9, D3DX11_DEFAULT); + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex_2d, &load_info, (ID3D11Resource *)tex2_2d); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); + + /* Filter argument of 0 is invalid. */ + set_d3dx11_texture_load_info(&load_info, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, D3DX11_DEFAULT); + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex_2d, &load_info, (ID3D11Resource *)tex2_2d); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); + + /* Invalid MipFilter argument. */ + set_d3dx11_texture_load_info(&load_info, NULL, NULL, 0, 0, 0, 0, 0, 0, D3DX11_DEFAULT, 9); + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex_2d, &load_info, (ID3D11Resource *)tex2_2d); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); + + /* MipFilter argument is only validated if mip levels are generated. */ + set_d3dx11_texture_load_info(&load_info, NULL, NULL, 0, 0, 2, 0, 0, 0, D3DX11_DEFAULT, 9); + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex_2d, &load_info, (ID3D11Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + /* + * Cannot use the same source/destination texture with matching first mip + * level and array element. + */ + set_d3dx11_texture_load_info(&load_info, NULL, NULL, 0, 0, 0, 0, 0, 0, D3DX11_DEFAULT, D3DX11_DEFAULT); + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex_2d, &load_info, (ID3D11Resource *)tex_2d); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); + + /* Same first mip level, different first element. */ + set_d3dx11_texture_load_info(&load_info, NULL, NULL, 0, 0, 0, 0, 1, 0, D3DX11_DEFAULT, D3DX11_DEFAULT); + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex_2d, &load_info, (ID3D11Resource *)tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < 2; ++i) + check_texture_sub_resource_color(tex_2d, 2 + i, NULL, test_tex_2d_array_colors[i], 0); + + /* Restore values. */ + for (i = 0; i < ARRAY_SIZE(test_tex_2d_array_colors); ++i) + { + set_texture_sub_resource_color(context, (ID3D11Resource *)tex_2d, i, test_tex_2d_array_colors[i], !(i & 0x1) ? 8 : 4, + !(i & 0x1) ? 8 : 4, 1); + check_texture_sub_resource_color(tex_2d, i, NULL, test_tex_2d_array_colors[i], 0); + } + + /* Same first array element, but different FirstMips. */ + set_d3dx11_texture_load_info(&load_info, NULL, NULL, 0, 1, 0, 0, 0, 0, D3DX11_DEFAULT, D3DX11_DEFAULT); + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex_2d, &load_info, (ID3D11Resource *)tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < 4; ++i) + check_texture_sub_resource_color(tex_2d, i, NULL, test_tex_2d_array_colors[(i < 2) ? 0 : 2], 0); + + for (i = 0; i < ARRAY_SIZE(test_tex_2d_array_colors); ++i) + { + set_texture_sub_resource_color(context, (ID3D11Resource *)tex_2d, i, test_tex_2d_array_colors[i], !(i & 0x1) ? 8 : 4, + !(i & 0x1) ? 8 : 4, 1); + check_texture_sub_resource_color(tex_2d, i, NULL, test_tex_2d_array_colors[i], 0); + } + + /* + * If SrcFirstElement/DstFirstElement are greater than the total number of + * elements, element 0 is used. + */ + set_d3dx11_texture_load_info(&load_info, NULL, NULL, 0, 0, 2, 2, 0, 0, D3DX11_DEFAULT, D3DX11_DEFAULT); + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex_2d, &load_info, (ID3D11Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < 2; ++i) + check_texture_sub_resource_color(tex2_2d, i, NULL, test_tex_2d_array_colors[i], 0); + + set_d3dx11_texture_load_info(&load_info, NULL, NULL, 0, 0, 2, 1, 0, 0, D3DX11_DEFAULT, D3DX11_DEFAULT); + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex_2d, &load_info, (ID3D11Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < 2; ++i) + check_texture_sub_resource_color(tex2_2d, i, NULL, test_tex_2d_array_colors[2 + i], 0); + + for (i = 0; i < 4; ++i) + { + set_texture_sub_resource_color(context, (ID3D11Resource *)tex2_2d, i, 0xff000000 | (0xff << (8 * i)), 8 >> i, 8 >> i, 1); + check_texture_sub_resource_color(tex2_2d, i, NULL, 0xff000000 | (0xff << (8 * i)), 0); + } + + /* DstFirstElement value tests. */ + set_d3dx11_texture_load_info(&load_info, NULL, NULL, 0, 0, 2, 0, 2, 0, D3DX11_DEFAULT, D3DX11_DEFAULT); + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex2_2d, &load_info, (ID3D11Resource *)tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < 2; ++i) + check_texture_sub_resource_color(tex_2d, i, NULL, 0xff000000 | (0xff << (8 * i)), 0); + for (i = 0; i < 2; ++i) + check_texture_sub_resource_color(tex_2d, 2 + i, NULL, test_tex_2d_array_colors[2 + i], 0); + + set_d3dx11_texture_load_info(&load_info, NULL, NULL, 0, 0, 2, 0, 1, 0, D3DX11_DEFAULT, D3DX11_DEFAULT); + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex2_2d, &load_info, (ID3D11Resource *)tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < 4; ++i) + check_texture_sub_resource_color(tex_2d, i, NULL, !(i & 0x01) ? 0xff0000ff : 0xff00ff00, 0); + + for (i = 0; i < 4; ++i) + { + set_texture_sub_resource_color(context, (ID3D11Resource *)tex_2d, i, test_tex_2d_array_colors[i], !(i & 0x1) ? 8 : 4, + !(i & 0x1) ? 8 : 4, 1); + check_texture_sub_resource_color(tex_2d, i, NULL, test_tex_2d_array_colors[i], 0); + + set_texture_sub_resource_color(context, (ID3D11Resource *)tex2_2d, i, 0xff000000 | (0xff << (8 * i)), 8 >> i, 8 >> i, 1); + check_texture_sub_resource_color(tex2_2d, i, NULL, 0xff000000 | (0xff << (8 * i)), 0); + } + + /* + * If SrcFirstMip is greater than the total number of mip levels, the + * final mip level is used, E.g, if SrcFirstMip is set to 3, but the + * texture only has 2 mip levels, mip level 2 is used. + */ + set_d3dx11_texture_load_info(&load_info, NULL, NULL, 2, 0, 1, 0, 0, 0, D3DX11_DEFAULT, D3DX11_DEFAULT); + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex_2d, &load_info, (ID3D11Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_texture_sub_resource_color(tex2_2d, 0, NULL, test_tex_2d_array_colors[1], 0); + + set_d3dx11_texture_load_info(&load_info, NULL, NULL, 0, 0, 1, 0, 0, 0, D3DX11_DEFAULT, D3DX11_DEFAULT); + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex_2d, &load_info, (ID3D11Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_texture_sub_resource_color(tex2_2d, 0, NULL, test_tex_2d_array_colors[0], 0); + + set_d3dx11_texture_load_info(&load_info, NULL, NULL, 1, 0, 1, 0, 0, 0, D3DX11_DEFAULT, D3DX11_DEFAULT); + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex_2d, &load_info, (ID3D11Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_texture_sub_resource_color(tex2_2d, 0, NULL, test_tex_2d_array_colors[1], 0); + + /* + * If DstFirstMip is greater than the total number of mips, nothing is + * loaded. + */ + set_d3dx11_texture_load_info(&load_info, NULL, NULL, 0, 5, 1, 0, 0, 0, D3DX11_DEFAULT, D3DX11_DEFAULT); + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex_2d, &load_info, (ID3D11Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_texture_sub_resource_color(tex2_2d, 0, NULL, test_tex_2d_array_colors[1], 0); + check_texture_sub_resource_color(tex2_2d, 3, NULL, 0xff000000, 0); + + set_d3dx11_texture_load_info(&load_info, NULL, NULL, 0, 3, 1, 0, 0, 0, D3DX11_DEFAULT, D3DX11_DEFAULT); + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex_2d, &load_info, (ID3D11Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_texture_sub_resource_color(tex2_2d, 3, NULL, test_tex_2d_array_colors[0], 0); + + ID3D11Texture2D_Release(tex2_2d); + ID3D11Texture2D_Release(tex_2d); + + for (i = 0; i < ARRAY_SIZE(test_texture_format_conversion); ++i) + { + const struct test_texture_format_conversion *test = &test_texture_format_conversion[i]; + const D3D11_TEXTURE2D_DESC *src_desc = &test->src_desc; + D3D11_TEXTURE2D_DESC tmp_desc = test->src_desc; + ID3D11Texture2D *src_texture, *dst_texture; + D3D11_MAPPED_SUBRESOURCE map = { 0 }; + + winetest_push_context("Texture format conversion test %u", i); + src_texture = dst_texture = NULL; + + init_subresource_data(sub_resource_data, test->src_data, src_desc->Width, src_desc->Height, 1, + src_desc->MipLevels, src_desc->ArraySize, src_desc->Format); + hr = ID3D11Device_CreateTexture2D(device, src_desc, sub_resource_data, &src_texture); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_texture; + + tmp_desc.Format = test->dst_format; + tmp_desc.Usage = D3D11_USAGE_STAGING; + tmp_desc.BindFlags = 0; + tmp_desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; + hr = ID3D11Device_CreateTexture2D(device, &tmp_desc, NULL, &dst_texture); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_texture; + + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)src_texture, NULL, (ID3D11Resource *)dst_texture); + todo_wine_if(test->todo_hr) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_texture; + + hr = ID3D11DeviceContext_Map(context, (ID3D11Resource *)dst_texture, 0, D3D11_MAP_READ, 0, &map); + ok(hr == S_OK, "Failed to map destination texture, hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_texture; + + check_texture_data_level(map.pData, map.RowPitch, 0, tmp_desc.Width, tmp_desc.Height, 1, test->dst_format, + test->expected_dst_data, test->max_diff, test->todo_data); +cleanup_next_texture: + if (src_texture) + ID3D11Texture2D_Release(src_texture); + if (map.pData) + ID3D11DeviceContext_Unmap(context, (ID3D11Resource *)dst_texture, 0); + if (dst_texture) + ID3D11Texture2D_Release(dst_texture); + winetest_pop_context(); + } + + /* + * Texture compression tests. Rather than checking against compressed values + * (which we're unlikely to match due to differences in compression + * algorithms), we'll: + * Load our uncompressed source texture into a compressed destination texture. + * Load our compressed destination texture into a new decompressed destination texture. + * Check that the data in the new decompressed texture matches the + * original data. + */ + for (i = 0; i < ARRAY_SIZE(test_texture_compression); ++i) + { + const struct test_texture_compression *test = &test_texture_compression[i]; + const D3D11_TEXTURE2D_DESC *src_desc = &test->src_desc; + ID3D11Texture2D *src_texture, *dst_texture; + D3D11_TEXTURE2D_DESC tmp_desc = *src_desc; + D3D11_MAPPED_SUBRESOURCE map = { 0 }; + + winetest_push_context("Texture compression test %u", i); + src_texture = dst_texture = NULL; + + /* Create the uncompressed source texture. */ + init_subresource_data(sub_resource_data, (const void *)test->src_data, src_desc->Width, src_desc->Height, 1, + src_desc->MipLevels, src_desc->ArraySize, src_desc->Format); + hr = ID3D11Device_CreateTexture2D(device, src_desc, sub_resource_data, &src_texture); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_compressed_texture; + + /* Create the compressed destination texture. */ + tmp_desc.Format = test->compressed_format; + hr = ID3D11Device_CreateTexture2D(device, &tmp_desc, NULL, &dst_texture); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_compressed_texture; + + /* Load the uncompressed source into the compressed destination. */ + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)src_texture, NULL, (ID3D11Resource *)dst_texture); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_compressed_texture; + + ID3D11Texture2D_Release(src_texture); + src_texture = dst_texture; + + /* Now create the uncompressed destination texture to decompress into. */ + tmp_desc = *src_desc; + tmp_desc.Usage = D3D11_USAGE_STAGING; + tmp_desc.BindFlags = 0; + tmp_desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; + memset(tmp_buf, 0, sizeof(tmp_buf)); + init_subresource_data(sub_resource_data, (const void *)tmp_buf, src_desc->Width, src_desc->Height, 1, + src_desc->MipLevels, src_desc->ArraySize, src_desc->Format); + hr = ID3D11Device_CreateTexture2D(device, &tmp_desc, sub_resource_data, &dst_texture); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_compressed_texture; + + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)src_texture, NULL, (ID3D11Resource *)dst_texture); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_compressed_texture; + + hr = ID3D11DeviceContext_Map(context, (ID3D11Resource *)dst_texture, 0, D3D11_MAP_READ, 0, &map); + ok(hr == S_OK, "Failed to map destination texture, hr %#lx.\n", hr); + if (FAILED(hr)) + goto cleanup_next_compressed_texture; + + check_texture_data_level(map.pData, map.RowPitch, 0, tmp_desc.Width, tmp_desc.Height, 1, tmp_desc.Format, + test->src_data, 0, FALSE); +cleanup_next_compressed_texture: + if (src_texture) + ID3D11Texture2D_Release(src_texture); + if (map.pData) + ID3D11DeviceContext_Unmap(context, (ID3D11Resource *)dst_texture, 0); + if (dst_texture) + ID3D11Texture2D_Release(dst_texture); + winetest_pop_context(); + } + + /* + * Use D3DX11LoadTextureFromTexture to generate mip levels. Some games + * (Total War: Shogun 2) do this instead of using D3DX11FilterTexture. + */ + set_d3dx11_texture_load_info(&load_info, NULL, NULL, 0, 1, 2, 0, 0, 1, D3DX11_FILTER_POINT, D3DX11_FILTER_NONE); + set_d3d11_2d_texture_desc(&tex_2d_desc, 8, 8, 3, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D11_USAGE_DEFAULT, + D3D11_BIND_SHADER_RESOURCE, 0, 0); + + memset(tmp_buf, 0, sizeof(tmp_buf)); + memcpy(tmp_buf, bc1_to_bc3_8_8_decompressed, sizeof(bc1_to_bc3_8_8_decompressed)); + init_subresource_data(sub_resource_data, (const void *)tmp_buf, tex_2d_desc.Width, tex_2d_desc.Height, 1, + tex_2d_desc.MipLevels, tex_2d_desc.ArraySize, tex_2d_desc.Format); + + hr = ID3D11Device_CreateTexture2D(device, &tex_2d_desc, sub_resource_data, &tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_texture_sub_resource_color(tex_2d, 1, NULL, 0x00000000, 0); + check_texture_sub_resource_color(tex_2d, 2, NULL, 0x00000000, 0); + + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex_2d, &load_info, (ID3D11Resource *)tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + SetRect(&tmp_rect, 0, 0, 2, 2); + check_texture_sub_resource_color(tex_2d, 1, &tmp_rect, 0xffff0000, 0); + SetRect(&tmp_rect, 2, 0, 4, 2); + check_texture_sub_resource_color(tex_2d, 1, &tmp_rect, 0xff00ff00, 0); + SetRect(&tmp_rect, 0, 2, 2, 4); + check_texture_sub_resource_color(tex_2d, 1, &tmp_rect, 0xff0000ff, 0); + SetRect(&tmp_rect, 2, 2, 4, 4); + check_texture_sub_resource_color(tex_2d, 1, &tmp_rect, 0xff000000, 0); + + SetRect(&tmp_rect, 0, 0, 1, 1); + check_texture_sub_resource_color(tex_2d, 2, &tmp_rect, 0xffff0000, 0); + SetRect(&tmp_rect, 1, 0, 2, 1); + check_texture_sub_resource_color(tex_2d, 2, &tmp_rect, 0xff00ff00, 0); + SetRect(&tmp_rect, 0, 1, 1, 2); + check_texture_sub_resource_color(tex_2d, 2, &tmp_rect, 0xff0000ff, 0); + SetRect(&tmp_rect, 1, 1, 2, 2); + check_texture_sub_resource_color(tex_2d, 2, &tmp_rect, 0xff000000, 0); + + ID3D11Texture2D_Release(tex_2d); + + /* Cubemap. */ + set_d3d11_2d_texture_desc(&tex_2d_desc, 4, 4, 1, 6, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D11_USAGE_DEFAULT, + D3D11_BIND_SHADER_RESOURCE, 0, D3D11_RESOURCE_MISC_TEXTURECUBE); + init_subresource_data(sub_resource_data, (const void *)rgba_4_4_cubemap, tex_2d_desc.Width, tex_2d_desc.Height, 1, + tex_2d_desc.MipLevels, tex_2d_desc.ArraySize, tex_2d_desc.Format); + + hr = ID3D11Device_CreateTexture2D(device, &tex_2d_desc, sub_resource_data, &tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + for (i = 0; i < 6; ++i) + check_texture_sub_resource_color(tex_2d, i, NULL, test_cubemap_face_colors[i], 0); + + /* Load individual faces of a cubemap texture into a non-cubemap texture. */ + set_d3d11_2d_texture_desc(&tex_2d_desc, 4, 4, 3, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D11_USAGE_DEFAULT, + D3D11_BIND_SHADER_RESOURCE, 0, 0); + hr = ID3D11Device_CreateTexture2D(device, &tex_2d_desc, NULL, &tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + for (i = 0; i < 6; ++i) + { + /* On top of loading individual faces, we'll also generate mips. */ + set_d3dx11_texture_load_info(&load_info, NULL, NULL, 0, 0, 0, i, 0, 1, D3DX11_FILTER_POINT, D3DX11_FILTER_POINT); + hr = D3DX11LoadTextureFromTexture(context, (ID3D11Resource *)tex_2d, &load_info, (ID3D11Resource *)tex2_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + check_texture_sub_resource_color(tex2_2d, 0, NULL, test_cubemap_face_colors[i], 0); + check_texture_sub_resource_color(tex2_2d, 1, NULL, test_cubemap_face_colors[i], 0); + check_texture_sub_resource_color(tex2_2d, 2, NULL, test_cubemap_face_colors[i], 0); + } + + ID3D11Texture2D_Release(tex2_2d); + ID3D11Texture2D_Release(tex_2d); + + CoUninitialize(); + + ID3D11DeviceContext_Release(context); + ok(!ID3D11Device_Release(device), "Unexpected refcount.\n"); +} + START_TEST(d3dx11) { HMODULE wined3d; @@ -4499,6 +5410,7 @@ START_TEST(d3dx11) test_D3DX11CreateAsyncTextureProcessor(); test_D3DX11CreateAsyncShaderResourceViewProcessor(); test_D3DX11CompileFromFile(); + test_D3DX11LoadTextureFromTexture(); test_get_image_info(); test_create_texture(); test_create_shader_resource_view(); diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c index da9e5c117e00..2f179257b53b 100644 --- a/dlls/d3dx11_43/texture.c +++ b/dlls/d3dx11_43/texture.c @@ -17,6 +17,9 @@ */ #define COBJMACROS + +#include "initguid.h" +#include "d3d11.h" #include "d3dx11.h" #include "d3dcompiler.h" @@ -52,15 +55,6 @@ HRESULT WINAPI D3DX11SaveTextureToMemory(ID3D11DeviceContext *context, ID3D11Res return E_NOTIMPL; } -HRESULT WINAPI D3DX11LoadTextureFromTexture(ID3D11DeviceContext *context, ID3D11Resource *src_texture, - D3DX11_TEXTURE_LOAD_INFO *info, ID3D11Resource *dst_texture) -{ - FIXME("context %p, src_texture %p, info %p, dst_texture %p stub!\n", - context, src_texture, info, dst_texture); - - return E_NOTIMPL; -} - HRESULT WINAPI D3DX11GetImageInfoFromFileA(const char *src_file, ID3DX11ThreadPump *pump, D3DX11_IMAGE_INFO *info, HRESULT *result) { @@ -1061,3 +1055,362 @@ HRESULT WINAPI D3DX11CreateShaderResourceViewFromMemory(ID3D11Device *device, co *hresult = hr; return hr; } + +/* + * D3DX11LoadTextureFromTexture implementation. + */ +struct d3d11_texture_resource { + D3D11_RESOURCE_DIMENSION texture_dimension; + union + { + ID3D11Resource *tex_rsrc; + ID3D11Texture2D *tex_2d; + ID3D11Texture3D *tex_3d; + } iface; + struct volume size; + uint32_t mip_levels; + uint32_t layer_count; +}; + +struct d3d11_texture { + ID3D11Device *device; + ID3D11DeviceContext *device_context; + struct d3d11_texture_resource texture; + struct d3d11_texture_resource staging_texture; + + const struct pixel_format_desc *fmt_desc; + D3D11_MAP map_flags; + D3D11_BOX texture_box; + + uint32_t first_layer; + uint32_t first_mip_level; +}; + +static void set_d3d11_box(D3D11_BOX *box, uint32_t left, uint32_t top, uint32_t right, uint32_t bottom, uint32_t front, + uint32_t back) +{ + box->left = left; + box->top = top; + box->right = right; + box->bottom = bottom; + box->front = front; + box->back = back; +} + +static const char *debug_d3d11_box(const struct D3D11_BOX *box) +{ + if (!box) + return "(null)"; + return wine_dbg_sprintf("(%ux%ux%u)-(%ux%ux%u)", box->left, box->top, box->front, box->right, box->bottom, box->back); +} + +static void d3d11_box_get_mip_level(D3D11_BOX *box, uint32_t level) +{ + uint32_t i; + + for (i = 0; i < level; ++i) + { + set_d3d11_box(box, (box->left ? (box->left / 2) : 0), (box->top ? (box->top / 2) : 0), + max(box->right / 2, 1), max(box->bottom / 2, 1), + (box->front ? (box->front / 2) : 0), max(box->back / 2, 1)); + } +} + +static HRESULT d3dx_d3d11_texture_init(ID3D11DeviceContext *context, ID3D11Resource *tex_rsrc, uint32_t first_layer, + uint32_t first_mip_level, D3D11_MAP map_flags, D3D11_BOX *tex_box, struct d3d11_texture *texture) +{ + struct d3d11_texture_resource *staging_tex_rsrc = &texture->staging_texture; + struct d3d11_texture_resource *src_tex_rsrc = &texture->texture; + HRESULT hr; + + ID3D11Resource_GetDevice(tex_rsrc, &texture->device); + if (!texture->device) + { + ERR("Failed to get device from texture resource.\n"); + return E_FAIL; + } + + texture->map_flags = map_flags; + ID3D11Resource_GetType(tex_rsrc, &src_tex_rsrc->texture_dimension); + switch (src_tex_rsrc->texture_dimension) + { + case D3D11_RESOURCE_DIMENSION_TEXTURE2D: + { + D3D11_TEXTURE2D_DESC desc; + + hr = ID3D11Resource_QueryInterface(tex_rsrc, &IID_ID3D11Texture2D, (void **)&src_tex_rsrc->iface.tex_2d); + if (FAILED(hr)) + return hr; + + ID3D11Texture2D_GetDesc(src_tex_rsrc->iface.tex_2d, &desc); + if (map_flags != D3D11_MAP_READ && (first_mip_level >= desc.MipLevels)) + return S_FALSE; + + texture->fmt_desc = get_d3dx_pixel_format_info(d3dx_pixel_format_id_from_dxgi_format(desc.Format)); + if (texture->fmt_desc->format == D3DX_PIXEL_FORMAT_COUNT) + { + FIXME("Unknown DXGI format supplied, %#x.\n", desc.Format); + return E_NOTIMPL; + } + + set_volume_struct(&src_tex_rsrc->size, desc.Width, desc.Height, 1); + src_tex_rsrc->mip_levels = desc.MipLevels; + src_tex_rsrc->layer_count = desc.ArraySize; + + texture->first_mip_level = min((desc.MipLevels - 1), first_mip_level); + texture->first_layer = first_layer >= desc.ArraySize ? 0 : first_layer; + + staging_tex_rsrc->texture_dimension = src_tex_rsrc->texture_dimension; + staging_tex_rsrc->size = src_tex_rsrc->size; + d3dx_get_mip_level_size(&staging_tex_rsrc->size, texture->first_mip_level); + staging_tex_rsrc->mip_levels = src_tex_rsrc->mip_levels - texture->first_mip_level; + staging_tex_rsrc->layer_count = 1; + + /* Create the staging texture. */ + desc.Usage = D3D11_USAGE_STAGING; + desc.BindFlags = desc.MiscFlags = 0; + desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; + if (map_flags != D3D11_MAP_READ) + desc.CPUAccessFlags |= D3D11_CPU_ACCESS_WRITE; + desc.ArraySize = 1; + desc.MipLevels = staging_tex_rsrc->mip_levels; + desc.Width = staging_tex_rsrc->size.width; + desc.Height = staging_tex_rsrc->size.height; + + hr = ID3D11Device_CreateTexture2D(texture->device, &desc, NULL, &staging_tex_rsrc->iface.tex_2d); + if (FAILED(hr)) + return hr; + break; + } + + case D3D11_RESOURCE_DIMENSION_TEXTURE3D: + { + D3D11_TEXTURE3D_DESC desc; + + hr = ID3D11Resource_QueryInterface(tex_rsrc, &IID_ID3D11Texture3D, (void **)&src_tex_rsrc->iface.tex_3d); + if (FAILED(hr)) + return hr; + + ID3D11Texture3D_GetDesc(src_tex_rsrc->iface.tex_3d, &desc); + if (map_flags != D3D11_MAP_READ && (first_mip_level >= desc.MipLevels)) + return S_FALSE; + + texture->fmt_desc = get_d3dx_pixel_format_info(d3dx_pixel_format_id_from_dxgi_format(desc.Format)); + if (texture->fmt_desc->format == D3DX_PIXEL_FORMAT_COUNT) + { + FIXME("Unknown DXGI format supplied, %#x.\n", desc.Format); + return E_NOTIMPL; + } + + set_volume_struct(&src_tex_rsrc->size, desc.Width, desc.Height, desc.Depth); + src_tex_rsrc->mip_levels = desc.MipLevels; + src_tex_rsrc->layer_count = 1; + + texture->first_mip_level = min((desc.MipLevels - 1), first_mip_level); + if (first_layer) + WARN("Specified a non zero FirstElement argument on a 3D texture.\n"); + texture->first_layer = 0; + + staging_tex_rsrc->texture_dimension = src_tex_rsrc->texture_dimension; + staging_tex_rsrc->size = src_tex_rsrc->size; + d3dx_get_mip_level_size(&staging_tex_rsrc->size, texture->first_mip_level); + staging_tex_rsrc->mip_levels = src_tex_rsrc->mip_levels - texture->first_mip_level; + staging_tex_rsrc->layer_count = 1; + + /* Create the staging texture. */ + desc.Usage = D3D11_USAGE_STAGING; + desc.BindFlags = desc.MiscFlags = 0; + desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; + if (map_flags != D3D11_MAP_READ) + desc.CPUAccessFlags |= D3D11_CPU_ACCESS_WRITE; + desc.MipLevels = staging_tex_rsrc->mip_levels; + desc.Width = staging_tex_rsrc->size.width; + desc.Height = staging_tex_rsrc->size.height; + desc.Depth = staging_tex_rsrc->size.depth; + + hr = ID3D11Device_CreateTexture3D(texture->device, &desc, NULL, &staging_tex_rsrc->iface.tex_3d); + if (FAILED(hr)) + return hr; + break; + } + + default: + FIXME("Unhandled resource dimension %u.\n", src_tex_rsrc->texture_dimension); + return E_NOTIMPL; + } + + if (tex_box) + texture->texture_box = *tex_box; + else + set_d3d11_box(&texture->texture_box, 0, 0, staging_tex_rsrc->size.width, staging_tex_rsrc->size.height, 0, + staging_tex_rsrc->size.depth); + texture->device_context = context; + ID3D11DeviceContext_AddRef(context); + + return S_OK; +} + +static void d3dx_d3d11_texture_release(struct d3d11_texture *texture) +{ + if (texture->device) + ID3D11Device_Release(texture->device); + if (texture->device_context) + ID3D11DeviceContext_Release(texture->device_context); + if (texture->texture.iface.tex_rsrc) + ID3D11Resource_Release(texture->texture.iface.tex_rsrc); + if (texture->staging_texture.iface.tex_rsrc) + ID3D11Resource_Release(texture->staging_texture.iface.tex_rsrc); +} + +static HRESULT d3dx_d3d11_texture_map(struct d3d11_texture *texture, uint32_t layer, uint32_t mip_level, + struct d3dx_pixels *pixels) +{ + struct d3d11_texture_resource *staging_tex_rsrc = &texture->staging_texture; + struct d3d11_texture_resource *src_tex_rsrc = &texture->texture; + D3D11_BOX tmp_box = texture->texture_box; + D3D11_MAPPED_SUBRESOURCE map = { 0 }; + uint32_t sub_rsrc_idx; + HRESULT hr; + + d3d11_box_get_mip_level(&tmp_box, mip_level); + sub_rsrc_idx = (src_tex_rsrc->mip_levels * (texture->first_layer + layer)) + (mip_level + texture->first_mip_level); + ID3D11DeviceContext_CopySubresourceRegion(texture->device_context, staging_tex_rsrc->iface.tex_rsrc, mip_level, 0, 0, 0, + src_tex_rsrc->iface.tex_rsrc, sub_rsrc_idx, NULL); + hr = ID3D11DeviceContext_Map(texture->device_context, staging_tex_rsrc->iface.tex_rsrc, mip_level, + texture->map_flags, 0, &map); + if (FAILED(hr)) + return hr; + + TRACE("Mapping layer %u, mip level %u, box %s.\n", texture->first_layer + layer, texture->first_mip_level + mip_level, + debug_d3d11_box(&tmp_box)); + return d3dx_pixels_init(map.pData, map.RowPitch, map.DepthPitch, NULL, texture->fmt_desc->format, tmp_box.left, tmp_box.top, + tmp_box.right, tmp_box.bottom, tmp_box.front, tmp_box.back, pixels); +} + +static void d3dx_d3d11_texture_unmap(struct d3d11_texture *texture, uint32_t layer, uint32_t mip_level) +{ + struct d3d11_texture_resource *staging_tex_rsrc = &texture->staging_texture; + struct d3d11_texture_resource *src_tex_rsrc = &texture->texture; + uint32_t sub_rsrc_idx; + + ID3D11DeviceContext_Unmap(texture->device_context, staging_tex_rsrc->iface.tex_rsrc, mip_level); + if (texture->map_flags == D3D11_MAP_READ) + return; + + sub_rsrc_idx = (src_tex_rsrc->mip_levels * (texture->first_layer + layer)) + (mip_level + texture->first_mip_level); + ID3D11DeviceContext_CopySubresourceRegion(texture->device_context, src_tex_rsrc->iface.tex_rsrc, sub_rsrc_idx, 0, 0, 0, + staging_tex_rsrc->iface.tex_rsrc, mip_level, NULL); +} + +static const D3DX11_TEXTURE_LOAD_INFO default_load_info = { NULL, NULL, 0, 0, D3DX11_DEFAULT, 0, 0, D3DX11_DEFAULT, + D3DX11_DEFAULT, D3DX11_DEFAULT }; +HRESULT WINAPI D3DX11LoadTextureFromTexture(ID3D11DeviceContext *context, ID3D11Resource *src_texture, + D3DX11_TEXTURE_LOAD_INFO *load_info, ID3D11Resource *dst_texture) +{ + D3DX11_TEXTURE_LOAD_INFO info = (load_info) ? *load_info : default_load_info; + struct d3d11_texture src_tex = { 0 }; + struct d3d11_texture dst_tex = { 0 }; + uint32_t i, j, loaded_mip_levels; + HRESULT hr; + + TRACE("context %p, src_texture %p, load_info %p, dst_texture %p.\n", context, src_texture, load_info, dst_texture); + + if (!src_texture || !dst_texture) + return E_INVALIDARG; + + if (!context) + return D3DERR_INVALIDCALL; + + if (!info.Filter || FAILED(hr = d3dx_handle_filter(&info.Filter))) + { + FIXME("Invalid filter argument.\n"); + return D3DERR_INVALIDCALL; + } + + hr = d3dx_d3d11_texture_init(context, src_texture, info.SrcFirstElement, info.SrcFirstMip, D3D11_MAP_READ, info.pSrcBox, &src_tex); + if (FAILED(hr)) + goto end; + + hr = d3dx_d3d11_texture_init(context, dst_texture, info.DstFirstElement, info.DstFirstMip, D3D11_MAP_READ_WRITE, info.pDstBox, &dst_tex); + if (hr == S_FALSE || FAILED(hr)) + goto end; + + if ((src_texture == dst_texture) && ((src_tex.first_layer == dst_tex.first_layer) && + (src_tex.first_mip_level == dst_tex.first_mip_level))) + { + hr = D3DERR_INVALIDCALL; + goto end; + } + + if (!info.NumMips || info.NumMips == D3DX11_DEFAULT) + info.NumMips = dst_tex.staging_texture.mip_levels; + info.NumMips = min(info.NumMips, dst_tex.staging_texture.mip_levels); + if (!info.NumElements || info.NumElements == D3DX11_DEFAULT) + info.NumElements = min(src_tex.texture.layer_count, dst_tex.texture.layer_count); + info.NumElements = min(info.NumElements, min(src_tex.texture.layer_count, dst_tex.texture.layer_count)); + loaded_mip_levels = min(info.NumMips, src_tex.staging_texture.mip_levels); + for (i = 0; i < info.NumElements; ++i) + { + for (j = 0; j < loaded_mip_levels; ++j) + { + struct d3dx_pixels src_pixels, dst_pixels; + + hr = d3dx_d3d11_texture_map(&src_tex, i, j, &src_pixels); + if (FAILED(hr)) + goto end; + + hr = d3dx_d3d11_texture_map(&dst_tex, i, j, &dst_pixels); + if (FAILED(hr)) + { + d3dx_d3d11_texture_unmap(&src_tex, i, j); + goto end; + } + + hr = d3dx_load_pixels_from_pixels(&dst_pixels, dst_tex.fmt_desc, &src_pixels, src_tex.fmt_desc, info.Filter, 0); + d3dx_d3d11_texture_unmap(&src_tex, i, j); + d3dx_d3d11_texture_unmap(&dst_tex, i, j); + if (FAILED(hr)) + { + WARN("Failed with hr %#lx.\n", hr); + goto end; + } + } + } + + if (loaded_mip_levels < info.NumMips) + { + if (!info.MipFilter || FAILED(hr = d3dx_handle_filter(&info.MipFilter))) + { + FIXME("Invalid mip filter argument.\n"); + hr = D3DERR_INVALIDCALL; + goto end; + } + + for (i = 0; i < info.NumElements; ++i) + { + for (j = loaded_mip_levels; j < info.NumMips; ++j) + { + struct d3dx_pixels src_pixels, dst_pixels; + + hr = d3dx_d3d11_texture_map(&dst_tex, i, j - 1, &src_pixels); + if (FAILED(hr)) + break; + + hr = d3dx_d3d11_texture_map(&dst_tex, i, j, &dst_pixels); + if (SUCCEEDED(hr)) + { + hr = d3dx_load_pixels_from_pixels(&dst_pixels, dst_tex.fmt_desc, &src_pixels, dst_tex.fmt_desc, info.MipFilter, 0); + d3dx_d3d11_texture_unmap(&dst_tex, i, j); + } + d3dx_d3d11_texture_unmap(&dst_tex, i, j - 1); + if (FAILED(hr)) + goto end; + } + } + } + +end: + d3dx_d3d11_texture_release(&src_tex); + d3dx_d3d11_texture_release(&dst_tex); + return SUCCEEDED(hr) ? S_OK : hr; +} From e4f0684f2f2fab380b85d37c278c225ecdaf85bc Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Thu, 29 Aug 2024 10:05:13 -0400 Subject: [PATCH 0974/2542] d3dx11: Implement D3DX11FilterTexture(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx11_43/d3dx11_43_main.c | 11 ----- dlls/d3dx11_43/tests/d3dx11.c | 84 +++++++++++++++++++++++++++++++++ dlls/d3dx11_43/texture.c | 61 ++++++++++++++++++++++++ 3 files changed, 145 insertions(+), 11 deletions(-) diff --git a/dlls/d3dx11_43/d3dx11_43_main.c b/dlls/d3dx11_43/d3dx11_43_main.c index 6e90891e7ce5..c327b5c54404 100644 --- a/dlls/d3dx11_43/d3dx11_43_main.c +++ b/dlls/d3dx11_43/d3dx11_43_main.c @@ -29,18 +29,7 @@ #include "d3dx11core.h" #include "d3dx11tex.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(d3dx); - BOOL WINAPI D3DX11CheckVersion(UINT d3d_sdk_ver, UINT d3dx_sdk_ver) { return d3d_sdk_ver == D3D11_SDK_VERSION && d3dx_sdk_ver == D3DX11_SDK_VERSION; } - -HRESULT WINAPI D3DX11FilterTexture(ID3D11DeviceContext *context, ID3D11Resource *texture, UINT src_level, UINT filter) -{ - FIXME("context %p, texture %p, src_level %u, filter %#x stub!\n", context, texture, src_level, filter); - - return E_NOTIMPL; -} diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index 91715666f056..be13fd6ce76d 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -5390,6 +5390,89 @@ static void test_D3DX11LoadTextureFromTexture(void) ok(!ID3D11Device_Release(device), "Unexpected refcount.\n"); } +static void test_D3DX11FilterTexture(void) +{ + D3D11_SUBRESOURCE_DATA sub_resource_data[4] = { 0 }; + D3D11_TEXTURE2D_DESC tex_2d_desc; + ID3D11DeviceContext *context; + ID3D11Texture2D *tex_2d; + uint8_t tmp_buf[1024]; + ID3D11Device *device; + RECT tmp_rect; + HRESULT hr; + + device = create_device(); + if (!device) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + CoInitialize(NULL); + + ID3D11Device_GetImmediateContext(device, &context); + set_d3d11_2d_texture_desc(&tex_2d_desc, 8, 8, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D11_USAGE_DEFAULT, + D3D11_BIND_SHADER_RESOURCE, 0, 0); + memset(tmp_buf, 0, sizeof(tmp_buf)); + memcpy(tmp_buf, bc1_to_bc3_8_8_decompressed, sizeof(bc1_to_bc3_8_8_decompressed)); + init_subresource_data(sub_resource_data, (const void *)tmp_buf, tex_2d_desc.Width, tex_2d_desc.Height, 1, + tex_2d_desc.MipLevels, tex_2d_desc.ArraySize, tex_2d_desc.Format); + + hr = ID3D11Device_CreateTexture2D(device, &tex_2d_desc, sub_resource_data, &tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_texture_sub_resource_color(tex_2d, 1, NULL, 0x00000000, 0); + check_texture_sub_resource_color(tex_2d, 2, NULL, 0x00000000, 0); + check_texture_sub_resource_color(tex_2d, 3, NULL, 0x00000000, 0); + + /* Invalid filter arguments. */ + hr = D3DX11FilterTexture(context, (ID3D11Resource *)tex_2d, 0, 0); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); + + hr = D3DX11FilterTexture(context, (ID3D11Resource *)tex_2d, 0, 9); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); + + /* + * Filter argument isn't validated if src_level argument is greater than + * total mip levels. + */ + hr = D3DX11FilterTexture(context, (ID3D11Resource *)tex_2d, 5, 9); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + /* NULL device context. */ + hr = D3DX11FilterTexture(NULL, (ID3D11Resource *)tex_2d, 5, 9); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); + + hr = D3DX11FilterTexture(context, (ID3D11Resource *)tex_2d, 0, D3DX11_FILTER_POINT); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + SetRect(&tmp_rect, 0, 0, 2, 2); + check_texture_sub_resource_color(tex_2d, 1, &tmp_rect, 0xffff0000, 0); + SetRect(&tmp_rect, 2, 0, 4, 2); + check_texture_sub_resource_color(tex_2d, 1, &tmp_rect, 0xff00ff00, 0); + SetRect(&tmp_rect, 0, 2, 2, 4); + check_texture_sub_resource_color(tex_2d, 1, &tmp_rect, 0xff0000ff, 0); + SetRect(&tmp_rect, 2, 2, 4, 4); + check_texture_sub_resource_color(tex_2d, 1, &tmp_rect, 0xff000000, 0); + + SetRect(&tmp_rect, 0, 0, 1, 1); + check_texture_sub_resource_color(tex_2d, 2, &tmp_rect, 0xffff0000, 0); + SetRect(&tmp_rect, 1, 0, 2, 1); + check_texture_sub_resource_color(tex_2d, 2, &tmp_rect, 0xff00ff00, 0); + SetRect(&tmp_rect, 0, 1, 1, 2); + check_texture_sub_resource_color(tex_2d, 2, &tmp_rect, 0xff0000ff, 0); + SetRect(&tmp_rect, 1, 1, 2, 2); + check_texture_sub_resource_color(tex_2d, 2, &tmp_rect, 0xff000000, 0); + + check_texture_sub_resource_color(tex_2d, 3, NULL, 0xffff0000, 0); + + ID3D11Texture2D_Release(tex_2d); + + CoUninitialize(); + + ID3D11DeviceContext_Release(context); + ok(!ID3D11Device_Release(device), "Unexpected refcount.\n"); +} + START_TEST(d3dx11) { HMODULE wined3d; @@ -5411,6 +5494,7 @@ START_TEST(d3dx11) test_D3DX11CreateAsyncShaderResourceViewProcessor(); test_D3DX11CompileFromFile(); test_D3DX11LoadTextureFromTexture(); + test_D3DX11FilterTexture(); test_get_image_info(); test_create_texture(); test_create_shader_resource_view(); diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c index 2f179257b53b..5946a5d496e9 100644 --- a/dlls/d3dx11_43/texture.c +++ b/dlls/d3dx11_43/texture.c @@ -1414,3 +1414,64 @@ HRESULT WINAPI D3DX11LoadTextureFromTexture(ID3D11DeviceContext *context, ID3D11 d3dx_d3d11_texture_release(&dst_tex); return SUCCEEDED(hr) ? S_OK : hr; } + +static uint32_t d3d11_get_resource_mip_levels(ID3D11Resource *rsrc) +{ + D3D11_RESOURCE_DIMENSION rsrc_dim; + uint32_t mip_levels = 0; + HRESULT hr; + + ID3D11Resource_GetType(rsrc, &rsrc_dim); + switch (rsrc_dim) + { + case D3D11_RESOURCE_DIMENSION_TEXTURE2D: + { + D3D11_TEXTURE2D_DESC desc; + ID3D11Texture2D *tex_2d; + + hr = ID3D11Resource_QueryInterface(rsrc, &IID_ID3D11Texture2D, (void **)&tex_2d); + if (FAILED(hr)) + break; + + ID3D11Texture2D_GetDesc(tex_2d, &desc); + ID3D11Texture2D_Release(tex_2d); + mip_levels = desc.MipLevels; + break; + } + + case D3D11_RESOURCE_DIMENSION_TEXTURE3D: + { + D3D11_TEXTURE3D_DESC desc; + ID3D11Texture3D *tex_3d; + + hr = ID3D11Resource_QueryInterface(rsrc, &IID_ID3D11Texture3D, (void **)&tex_3d); + if (FAILED(hr)) + break; + + ID3D11Texture3D_GetDesc(tex_3d, &desc); + ID3D11Texture3D_Release(tex_3d); + mip_levels = desc.MipLevels; + break; + } + + default: + break; + } + + return mip_levels; +} + +HRESULT WINAPI D3DX11FilterTexture(ID3D11DeviceContext *context, ID3D11Resource *texture, UINT src_level, UINT filter) +{ + D3DX11_TEXTURE_LOAD_INFO load_info = { NULL, NULL, src_level, src_level + 1, 0, 0, 0, 0, filter, filter }; + + TRACE("context %p, texture %p, src_level %u, filter %#x.\n", context, texture, src_level, filter); + + if (!context) + return D3DERR_INVALIDCALL; + + if (d3d11_get_resource_mip_levels(texture) <= src_level) + return S_OK; + + return D3DX11LoadTextureFromTexture(context, texture, &load_info, texture); +} From 4fef6546e51fd34bf6f736a6b44070f4e8c80291 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 11 Dec 2024 11:49:29 -0500 Subject: [PATCH 0975/2542] d3dx{10,11}: Add support for DXGI_FORMAT_B8G8R8A8_UNORM_SRGB. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 1 + dlls/d3dx11_43/tests/d3dx11.c | 1 + dlls/d3dx9_36/d3dx_helpers.c | 4 ++++ dlls/d3dx9_36/d3dx_helpers.h | 1 + 4 files changed, 7 insertions(+) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 4a95d3c3cb78..0c301bf51986 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -4246,6 +4246,7 @@ static void test_get_image_info(void) check_dds_dxt10_format(DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R8G8_UNORM, FALSE); check_dds_dxt10_format(DXGI_FORMAT_B8G8R8X8_UNORM, DXGI_FORMAT_B8G8R8X8_UNORM, FALSE); check_dds_dxt10_format(DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM, FALSE); + check_dds_dxt10_format(DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, FALSE); test_legacy_dds_header_image_info(); test_dxt10_dds_header_image_info(); diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index be13fd6ce76d..3f5cda8fbf83 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -3741,6 +3741,7 @@ static void test_get_image_info(void) check_dds_dx10_format(DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R8G8_UNORM, FALSE); check_dds_dx10_format(DXGI_FORMAT_B8G8R8X8_UNORM, DXGI_FORMAT_B8G8R8X8_UNORM, FALSE); check_dds_dx10_format(DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM, FALSE); + check_dds_dx10_format(DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, FALSE); /* Formats unsupported on d3dx10, but now supported on d3dx11. */ todo_wine check_dds_dx10_format(DXGI_FORMAT_BC6H_UF16, DXGI_FORMAT_BC6H_UF16, FALSE); todo_wine check_dds_dx10_format(DXGI_FORMAT_BC6H_SF16, DXGI_FORMAT_BC6H_SF16, FALSE); diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index 6f5782dc8cea..87e25fdcbb09 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -46,6 +46,7 @@ static const struct pixel_format_desc formats[] = /* format bpc shifts bpp blocks alpha type rgb type flags */ {D3DX_PIXEL_FORMAT_B8G8R8_UNORM, { 0, 8, 8, 8}, { 0, 16, 8, 0}, 3, 1, 1, 3, CTYPE_EMPTY, CTYPE_UNORM, 0 }, {D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM, { 8, 8, 8, 8}, {24, 16, 8, 0}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_UNORM, 0 }, + {D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM_SRGB, { 8, 8, 8, 8}, {24, 16, 8, 0}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXGI | FMT_FLAG_SRGB}, {D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM, { 0, 8, 8, 8}, { 0, 16, 8, 0}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_UNORM, 0 }, {D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM, { 8, 8, 8, 8}, {24, 0, 8, 16}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_UNORM, 0 }, {D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB, { 8, 8, 8, 8}, {24, 0, 8, 16}, 4, 1, 1, 4, CTYPE_UNORM, CTYPE_UNORM, FMT_FLAG_DXGI | FMT_FLAG_SRGB}, @@ -360,6 +361,7 @@ enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dxgi_format(DXGI_FORMAT form case DXGI_FORMAT_R8G8B8A8_UNORM: return D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM; case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: return D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB; case DXGI_FORMAT_B8G8R8A8_UNORM: return D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM; + case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB: return D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM_SRGB; case DXGI_FORMAT_B8G8R8X8_UNORM: return D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM; case DXGI_FORMAT_B5G6R5_UNORM: return D3DX_PIXEL_FORMAT_B5G6R5_UNORM; case DXGI_FORMAT_B5G5R5A1_UNORM: return D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM; @@ -409,6 +411,7 @@ static DXGI_FORMAT dxgi_format_from_d3dx_pixel_format_id(enum d3dx_pixel_format_ case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB: return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB; case D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM: return DXGI_FORMAT_B8G8R8A8_UNORM; + case D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM_SRGB: return DXGI_FORMAT_B8G8R8A8_UNORM_SRGB; case D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM: return DXGI_FORMAT_B8G8R8X8_UNORM; case D3DX_PIXEL_FORMAT_B5G6R5_UNORM: return DXGI_FORMAT_B5G6R5_UNORM; case D3DX_PIXEL_FORMAT_B5G5R5A1_UNORM: return DXGI_FORMAT_B5G5R5A1_UNORM; @@ -532,6 +535,7 @@ DXGI_FORMAT dxgi_format_from_dxt10_dds_d3dx_pixel_format_id(enum d3dx_pixel_form case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB: return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB; case D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM: return DXGI_FORMAT_B8G8R8A8_UNORM; + case D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM_SRGB: return DXGI_FORMAT_B8G8R8A8_UNORM_SRGB; case D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM: return DXGI_FORMAT_B8G8R8X8_UNORM; case D3DX_PIXEL_FORMAT_R10G10B10A2_UNORM: return DXGI_FORMAT_R10G10B10A2_UNORM; case D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM: return DXGI_FORMAT_R16G16B16A16_UNORM; diff --git a/dlls/d3dx9_36/d3dx_helpers.h b/dlls/d3dx9_36/d3dx_helpers.h index 428237aee88e..e118d50e45bb 100644 --- a/dlls/d3dx9_36/d3dx_helpers.h +++ b/dlls/d3dx9_36/d3dx_helpers.h @@ -287,6 +287,7 @@ enum d3dx_pixel_format_id { D3DX_PIXEL_FORMAT_B8G8R8_UNORM, D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM, + D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM_SRGB, D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM, D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM, D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB, From 81fa1b96c216b42daa635403d85882f545ec633f Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 11 Dec 2024 11:57:21 -0500 Subject: [PATCH 0976/2542] d3dx{10,11}: Add support for DXGI_FORMAT_R11G11B10_FLOAT. Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx9_36/d3dx_helpers.c | 99 +++++++++++++++++++++++++++++++++++- dlls/d3dx9_36/d3dx_helpers.h | 1 + 2 files changed, 98 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index 87e25fdcbb09..75a4d21ba6f3 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -89,6 +89,7 @@ static const struct pixel_format_desc formats[] = {D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT, {16, 16, 16, 16}, {48, 0, 16, 32}, 8, 1, 1, 8, CTYPE_FLOAT, CTYPE_FLOAT, 0 }, {D3DX_PIXEL_FORMAT_R32_FLOAT, { 0, 32, 0, 0}, { 0, 0, 0, 0}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_FLOAT, 0 }, {D3DX_PIXEL_FORMAT_R32G32_FLOAT, { 0, 32, 32, 0}, { 0, 0, 32, 0}, 8, 1, 1, 8, CTYPE_EMPTY, CTYPE_FLOAT, 0 }, + {D3DX_PIXEL_FORMAT_R11G11B10_FLOAT, { 0, 11, 11, 10}, { 0, 0, 11, 22}, 4, 1, 1, 4, CTYPE_EMPTY, CTYPE_FLOAT, FMT_FLAG_DXGI}, {D3DX_PIXEL_FORMAT_R32G32B32_FLOAT, { 0, 32, 32, 32}, { 0, 0, 32, 64}, 12, 1, 1, 12, CTYPE_EMPTY, CTYPE_FLOAT, FMT_FLAG_DXGI}, {D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT, {32, 32, 32, 32}, {96, 0, 32, 64}, 16, 1, 1, 16, CTYPE_FLOAT, CTYPE_FLOAT, 0 }, {D3DX_PIXEL_FORMAT_P8_UINT, { 8, 8, 8, 8}, { 0, 0, 0, 0}, 1, 1, 1, 1, CTYPE_INDEX, CTYPE_INDEX, 0 }, @@ -380,6 +381,7 @@ enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dxgi_format(DXGI_FORMAT form case DXGI_FORMAT_R32_FLOAT: return D3DX_PIXEL_FORMAT_R32_FLOAT; case DXGI_FORMAT_R32G32_FLOAT: return D3DX_PIXEL_FORMAT_R32G32_FLOAT; case DXGI_FORMAT_R32G32B32_FLOAT: return D3DX_PIXEL_FORMAT_R32G32B32_FLOAT; + case DXGI_FORMAT_R11G11B10_FLOAT: return D3DX_PIXEL_FORMAT_R11G11B10_FLOAT; case DXGI_FORMAT_R32G32B32A32_FLOAT: return D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT; case DXGI_FORMAT_G8R8_G8B8_UNORM: return D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM; case DXGI_FORMAT_R8G8_B8G8_UNORM: return D3DX_PIXEL_FORMAT_R8G8_B8G8_UNORM; @@ -429,6 +431,7 @@ static DXGI_FORMAT dxgi_format_from_d3dx_pixel_format_id(enum d3dx_pixel_format_ case D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT: return DXGI_FORMAT_R16G16B16A16_FLOAT; case D3DX_PIXEL_FORMAT_R32_FLOAT: return DXGI_FORMAT_R32_FLOAT; case D3DX_PIXEL_FORMAT_R32G32_FLOAT: return DXGI_FORMAT_R32G32_FLOAT; + case D3DX_PIXEL_FORMAT_R11G11B10_FLOAT: return DXGI_FORMAT_R11G11B10_FLOAT; case D3DX_PIXEL_FORMAT_R32G32B32_FLOAT: return DXGI_FORMAT_R32G32B32_FLOAT; case D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT: return DXGI_FORMAT_R32G32B32A32_FLOAT; case D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM: return DXGI_FORMAT_G8R8_G8B8_UNORM; @@ -550,6 +553,7 @@ DXGI_FORMAT dxgi_format_from_dxt10_dds_d3dx_pixel_format_id(enum d3dx_pixel_form case D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT: return DXGI_FORMAT_R16G16B16A16_FLOAT; case D3DX_PIXEL_FORMAT_R32_FLOAT: return DXGI_FORMAT_R32_FLOAT; case D3DX_PIXEL_FORMAT_R32G32_FLOAT: return DXGI_FORMAT_R32G32_FLOAT; + case D3DX_PIXEL_FORMAT_R11G11B10_FLOAT: return DXGI_FORMAT_R11G11B10_FLOAT; case D3DX_PIXEL_FORMAT_R32G32B32_FLOAT: return DXGI_FORMAT_R32G32B32_FLOAT; case D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT: return DXGI_FORMAT_R32G32B32A32_FLOAT; case D3DX_PIXEL_FORMAT_G8R8_G8B8_UNORM: return DXGI_FORMAT_G8R8_G8B8_UNORM; @@ -2097,6 +2101,93 @@ float float_16_to_32(const unsigned short in) } } +static float partial_float_to_32(const uint16_t in, const uint8_t bits) +{ + static const uint16_t exponent_mask[2] = { 0x03e0, 0x07c0 }; + static const uint16_t mantissa_mask[2] = { 0x1f, 0x3f }; + static const uint8_t exponent_shift[2] = { 5, 6 }; + const uint8_t const_idx = (bits == 10) ? 0 : 1; + const uint16_t e = (in & exponent_mask[const_idx]) >> exponent_shift[const_idx]; + const uint16_t m = in & mantissa_mask[const_idx]; + uint32_t exponent, mantissa; + uint32_t float_bits = 0; + + if (!e && !m) + return 0.0f; + + if (e == 0x1f) + return m ? NAN : INFINITY; + + mantissa = m; + exponent = e; + + /* The value is denormalized. */ + if (!exponent) + { + /* Normalize the value in the resulting float. */ + exponent = 1; + while (!(mantissa & exponent_mask[const_idx])) + { + exponent--; + mantissa <<= 1; + } + + mantissa &= mantissa_mask[const_idx]; + } + + float_bits = ((exponent + 112) << 23) | (mantissa << (23 - exponent_shift[const_idx])); + return *((float *)&float_bits); +} + +static uint16_t float_32_to_partial_float(const float in, const uint8_t bits) +{ + const uint32_t in_exponent = ((*((const uint32_t *)&in)) & 0x7f800000) >> 23; + const uint32_t in_mantissa = ((*((const uint32_t *)&in)) & 0x007fffff); + static const float largest_float[2] = { 64512.0f, 65024.0f }; + static const uint16_t partial_max_val[2] = { 0x3df, 0x7bf }; + static const uint16_t partial_inf[2] = { 0x3e0, 0x7c0 }; + static const uint16_t partial_nan[2] = { 0x3ff, 0x7ff }; + static const uint8_t mantissa_shift[2] = { 18, 17 }; + static const uint8_t exp_shift[2] = { 5, 6 }; + const uint8_t const_idx = (bits == 11); + const BOOL sign = signbit(in); + uint8_t out_exponent = 0; + uint8_t out_mantissa = 0; + uint16_t res = 0; + + if (isnan(in)) + return partial_nan[const_idx]; + else if (!sign && isinf(in)) + return partial_inf[const_idx]; + else if (sign) + return 0x000; + else if (in >= largest_float[const_idx]) + return partial_max_val[const_idx]; + + /* + * Exponent of 0x71 is 2^-14, which is the smallest exponent for float10/11. + * If the exponent of our float is smaller than this, we need to + * denormalize the float. + */ + if (in_exponent < 0x71) + { + /* The number is too small to represent, just return 0. */ + if (((0x71 - in_exponent) + mantissa_shift[const_idx]) >= 24) + return 0x000; + + out_mantissa = (((0x800000 | in_mantissa) >> (0x71 - in_exponent)) >> mantissa_shift[const_idx]); + out_exponent = 0x00; + } + else + { + out_exponent = in_exponent - 0x70; + out_mantissa = in_mantissa >> mantissa_shift[const_idx]; + } + + res = (out_exponent << exp_shift[const_idx]) | out_mantissa; + return res; +} + struct argb_conversion_info { const struct pixel_format_desc *srcformat; @@ -2270,7 +2361,9 @@ void format_to_d3dx_color(const struct pixel_format_desc *format, const BYTE *sr switch (dst_ctype) { case CTYPE_FLOAT: - if (format->bits[c] == 16) + if (format->bits[c] == 10 || format->bits[c] == 11) + *dst_component = partial_float_to_32(((tmp >> format->shift[c] % 8) & mask), format->bits[c]); + else if (format->bits[c] == 16) *dst_component = float_16_to_32(tmp); else *dst_component = *(float *)&tmp; @@ -2340,7 +2433,9 @@ void format_from_d3dx_color(const struct pixel_format_desc *format, const struct switch (dst_ctype) { case CTYPE_FLOAT: - if (format->bits[c] == 16) + if (format->bits[c] == 10 || format->bits[c] == 11) + v = float_32_to_partial_float(src_component, format->bits[c]); + else if (format->bits[c] == 16) v = float_32_to_16(src_component); else v = *(DWORD *)&src_component; diff --git a/dlls/d3dx9_36/d3dx_helpers.h b/dlls/d3dx9_36/d3dx_helpers.h index e118d50e45bb..5b9fda662c97 100644 --- a/dlls/d3dx9_36/d3dx_helpers.h +++ b/dlls/d3dx9_36/d3dx_helpers.h @@ -330,6 +330,7 @@ enum d3dx_pixel_format_id D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT, D3DX_PIXEL_FORMAT_R32_FLOAT, D3DX_PIXEL_FORMAT_R32G32_FLOAT, + D3DX_PIXEL_FORMAT_R11G11B10_FLOAT, D3DX_PIXEL_FORMAT_R32G32B32_FLOAT, D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT, D3DX_PIXEL_FORMAT_P8_UINT, From f69fbe116ea23f6f2feab8497265821fee037ef4 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Mon, 9 Sep 2024 10:06:22 -0400 Subject: [PATCH 0977/2542] d3dx11: Implement D3DX11CreateThreadPump(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx11_42/d3dx11_42.spec | 2 +- dlls/d3dx11_43/async.c | 482 ++++++++++++++++++++++++++++++++++ dlls/d3dx11_43/d3dx11_43.spec | 2 +- dlls/d3dx11_43/tests/d3dx11.c | 372 ++++++++++++++++++++++++++ include/d3dx11core.idl | 2 + 5 files changed, 858 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx11_42/d3dx11_42.spec b/dlls/d3dx11_42/d3dx11_42.spec index 0fa9cb37d515..c7bc2e30778b 100644 --- a/dlls/d3dx11_42/d3dx11_42.spec +++ b/dlls/d3dx11_42/d3dx11_42.spec @@ -25,7 +25,7 @@ @ stdcall -import D3DX11CreateTextureFromMemory(ptr ptr long ptr ptr ptr ptr) @ stdcall -import D3DX11CreateTextureFromResourceA(ptr long str ptr ptr ptr ptr) @ stdcall -import D3DX11CreateTextureFromResourceW(ptr long wstr ptr ptr ptr ptr) -@ stub D3DX11CreateThreadPump +@ stdcall -import D3DX11CreateThreadPump(long long ptr) @ stdcall -import D3DX11FilterTexture(ptr ptr long long) @ stdcall -import D3DX11GetImageInfoFromFileA(str ptr ptr ptr) @ stdcall -import D3DX11GetImageInfoFromFileW(wstr ptr ptr ptr) diff --git a/dlls/d3dx11_43/async.c b/dlls/d3dx11_43/async.c index bb27ccd73188..776a5c806922 100644 --- a/dlls/d3dx11_43/async.c +++ b/dlls/d3dx11_43/async.c @@ -20,8 +20,10 @@ #include "d3dx11.h" #include "d3dcompiler.h" #include "dxhelpers.h" +#include "winternl.h" #include "wine/debug.h" +#include "wine/list.h" WINE_DEFAULT_DEBUG_CHANNEL(d3dx); @@ -612,3 +614,483 @@ HRESULT WINAPI D3DX11CreateAsyncShaderResourceViewProcessor(ID3D11Device *device *processor = &object->ID3DX11DataProcessor_iface; return S_OK; } + +struct work_item +{ + struct list entry; + + ID3DX11DataLoader *loader; + ID3DX11DataProcessor *processor; + HRESULT *result; + void **object; +}; + +static inline void work_item_free(struct work_item *work_item, BOOL cancel) +{ + ID3DX11DataLoader_Destroy(work_item->loader); + ID3DX11DataProcessor_Destroy(work_item->processor); + if (cancel && work_item->result) + *work_item->result = S_FALSE; + free(work_item); +} + +#define THREAD_PUMP_EXITING UINT_MAX +struct thread_pump +{ + ID3DX11ThreadPump ID3DX11ThreadPump_iface; + LONG refcount; + + LONG processing_count; + + SRWLOCK io_lock; + CONDITION_VARIABLE io_cv; + unsigned int io_count; + struct list io_queue; + + SRWLOCK proc_lock; + CONDITION_VARIABLE proc_cv; + unsigned int proc_count; + struct list proc_queue; + + SRWLOCK device_lock; + unsigned int device_count; + struct list device_queue; + + unsigned int thread_count; + HANDLE threads[1]; +}; + +static inline struct thread_pump *impl_from_ID3DX11ThreadPump(ID3DX11ThreadPump *iface) +{ + return CONTAINING_RECORD(iface, struct thread_pump, ID3DX11ThreadPump_iface); +} + +static HRESULT WINAPI thread_pump_QueryInterface(ID3DX11ThreadPump *iface, REFIID riid, void **out) +{ + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_ID3DX11ThreadPump) + || IsEqualGUID(riid, &IID_IUnknown)) + { + ID3DX11ThreadPump_AddRef(iface); + *out = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI thread_pump_AddRef(ID3DX11ThreadPump *iface) +{ + struct thread_pump *thread_pump = impl_from_ID3DX11ThreadPump(iface); + ULONG refcount = InterlockedIncrement(&thread_pump->refcount); + + TRACE("%p increasing refcount to %lu.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI thread_pump_Release(ID3DX11ThreadPump *iface) +{ + struct thread_pump *thread_pump = impl_from_ID3DX11ThreadPump(iface); + ULONG refcount = InterlockedDecrement(&thread_pump->refcount); + struct work_item *item, *next; + struct list list; + unsigned int i; + + TRACE("%p decreasing refcount to %lu.\n", iface, refcount); + + if (!refcount) + { + AcquireSRWLockExclusive(&thread_pump->io_lock); + thread_pump->io_count = THREAD_PUMP_EXITING; + ReleaseSRWLockExclusive(&thread_pump->io_lock); + WakeAllConditionVariable(&thread_pump->io_cv); + + AcquireSRWLockExclusive(&thread_pump->proc_lock); + thread_pump->proc_count = THREAD_PUMP_EXITING; + ReleaseSRWLockExclusive(&thread_pump->proc_lock); + WakeAllConditionVariable(&thread_pump->proc_cv); + + AcquireSRWLockExclusive(&thread_pump->device_lock); + thread_pump->device_count = THREAD_PUMP_EXITING; + ReleaseSRWLockExclusive(&thread_pump->device_lock); + + for (i = 0; i < thread_pump->thread_count; ++i) + { + if (!thread_pump->threads[i]) + continue; + + WaitForSingleObject(thread_pump->threads[i], INFINITE); + CloseHandle(thread_pump->threads[i]); + } + + list_init(&list); + list_move_tail(&list, &thread_pump->io_queue); + list_move_tail(&list, &thread_pump->proc_queue); + list_move_tail(&list, &thread_pump->device_queue); + LIST_FOR_EACH_ENTRY_SAFE(item, next, &list, struct work_item, entry) + { + list_remove(&item->entry); + work_item_free(item, TRUE); + } + + free(thread_pump); + } + + return refcount; +} + +static HRESULT WINAPI thread_pump_AddWorkItem(ID3DX11ThreadPump *iface, ID3DX11DataLoader *loader, + ID3DX11DataProcessor *processor, HRESULT *result, void **object) +{ + struct thread_pump *thread_pump = impl_from_ID3DX11ThreadPump(iface); + struct work_item *work_item; + + TRACE("iface %p, loader %p, processor %p, result %p, object %p.\n", + iface, loader, processor, result, object); + + work_item = malloc(sizeof(*work_item)); + if (!work_item) + return E_OUTOFMEMORY; + + work_item->loader = loader; + work_item->processor = processor; + work_item->result = result; + work_item->object = object; + + if (object) + *object = NULL; + + InterlockedIncrement(&thread_pump->processing_count); + AcquireSRWLockExclusive(&thread_pump->io_lock); + ++thread_pump->io_count; + list_add_tail(&thread_pump->io_queue, &work_item->entry); + ReleaseSRWLockExclusive(&thread_pump->io_lock); + WakeConditionVariable(&thread_pump->io_cv); + return S_OK; +} + +static UINT WINAPI thread_pump_GetWorkItemCount(ID3DX11ThreadPump *iface) +{ + struct thread_pump *thread_pump = impl_from_ID3DX11ThreadPump(iface); + UINT ret; + + TRACE("iface %p.\n", iface); + + AcquireSRWLockExclusive(&thread_pump->device_lock); + ret = thread_pump->processing_count + thread_pump->device_count; + ReleaseSRWLockExclusive(&thread_pump->device_lock); + return ret; +} + +static HRESULT WINAPI thread_pump_WaitForAllItems(ID3DX11ThreadPump *iface) +{ + struct thread_pump *thread_pump = impl_from_ID3DX11ThreadPump(iface); + HRESULT hr; + LONG v; + + TRACE("iface %p.\n", iface); + + for (;;) + { + if (FAILED((hr = ID3DX11ThreadPump_ProcessDeviceWorkItems(iface, UINT_MAX)))) + return hr; + + AcquireSRWLockExclusive(&thread_pump->device_lock); + if (thread_pump->device_count) + { + ReleaseSRWLockExclusive(&thread_pump->device_lock); + continue; + } + v = thread_pump->processing_count; + ReleaseSRWLockExclusive(&thread_pump->device_lock); + if (!v) + break; + + RtlWaitOnAddress(&thread_pump->processing_count, &v, sizeof(v), NULL); + } + + return S_OK; +} + +static HRESULT WINAPI thread_pump_ProcessDeviceWorkItems(ID3DX11ThreadPump *iface, UINT count) +{ + struct thread_pump *thread_pump = impl_from_ID3DX11ThreadPump(iface); + struct work_item *work_item; + HRESULT hr; + UINT i; + + TRACE("iface %p, count %u.\n", iface, count); + + for (i = 0; i < count; ++i) + { + AcquireSRWLockExclusive(&thread_pump->device_lock); + if (!thread_pump->device_count) + { + ReleaseSRWLockExclusive(&thread_pump->device_lock); + break; + } + + --thread_pump->device_count; + work_item = LIST_ENTRY(list_head(&thread_pump->device_queue), struct work_item, entry); + list_remove(&work_item->entry); + ReleaseSRWLockExclusive(&thread_pump->device_lock); + + hr = ID3DX11DataProcessor_CreateDeviceObject(work_item->processor, work_item->object); + if (work_item->result) + *work_item->result = hr; + work_item_free(work_item, FALSE); + } + + return S_OK; +} + +static void purge_list(struct list *list, LONG *count) +{ + struct work_item *work_item; + + while (!list_empty(list)) + { + work_item = LIST_ENTRY(list_head(list), struct work_item, entry); + list_remove(&work_item->entry); + work_item_free(work_item, TRUE); + + if (count && !InterlockedDecrement(count)) + RtlWakeAddressAll(count); + } +} + +static HRESULT WINAPI thread_pump_PurgeAllItems(ID3DX11ThreadPump *iface) +{ + struct thread_pump *thread_pump = impl_from_ID3DX11ThreadPump(iface); + LONG v; + + TRACE("iface %p.\n", iface); + + for (;;) + { + AcquireSRWLockExclusive(&thread_pump->io_lock); + purge_list(&thread_pump->io_queue, &thread_pump->processing_count); + thread_pump->io_count = 0; + ReleaseSRWLockExclusive(&thread_pump->io_lock); + + AcquireSRWLockExclusive(&thread_pump->proc_lock); + purge_list(&thread_pump->proc_queue, &thread_pump->processing_count); + thread_pump->proc_count = 0; + ReleaseSRWLockExclusive(&thread_pump->proc_lock); + + AcquireSRWLockExclusive(&thread_pump->device_lock); + purge_list(&thread_pump->device_queue, NULL); + thread_pump->device_count = 0; + v = thread_pump->processing_count; + ReleaseSRWLockExclusive(&thread_pump->device_lock); + if (!v) + break; + + RtlWaitOnAddress(&thread_pump->processing_count, &v, sizeof(v), NULL); + } + + return S_OK; +} + +static HRESULT WINAPI thread_pump_GetQueueStatus(ID3DX11ThreadPump *iface, + UINT *io_queue, UINT *process_queue, UINT *device_queue) +{ + struct thread_pump *thread_pump = impl_from_ID3DX11ThreadPump(iface); + + TRACE("iface %p, io_queue %p, process_queue %p, device_queue %p.\n", + iface, io_queue, process_queue, device_queue); + + *io_queue = thread_pump->io_count; + *process_queue = thread_pump->proc_count; + *device_queue = thread_pump->device_count; + return S_OK; +} + +static const ID3DX11ThreadPumpVtbl thread_pump_vtbl = +{ + thread_pump_QueryInterface, + thread_pump_AddRef, + thread_pump_Release, + thread_pump_AddWorkItem, + thread_pump_GetWorkItemCount, + thread_pump_WaitForAllItems, + thread_pump_ProcessDeviceWorkItems, + thread_pump_PurgeAllItems, + thread_pump_GetQueueStatus +}; + +static DWORD WINAPI io_thread(void *arg) +{ + struct thread_pump *thread_pump = arg; + struct work_item *work_item; + HRESULT hr; + + TRACE("%p thread started.\n", thread_pump); + + for (;;) + { + AcquireSRWLockExclusive(&thread_pump->io_lock); + + while (!thread_pump->io_count) + SleepConditionVariableSRW(&thread_pump->io_cv, &thread_pump->io_lock, INFINITE, 0); + + if (thread_pump->io_count == THREAD_PUMP_EXITING) + { + ReleaseSRWLockExclusive(&thread_pump->io_lock); + return 0; + } + + --thread_pump->io_count; + work_item = LIST_ENTRY(list_head(&thread_pump->io_queue), struct work_item, entry); + list_remove(&work_item->entry); + ReleaseSRWLockExclusive(&thread_pump->io_lock); + + if (FAILED(hr = ID3DX11DataLoader_Load(work_item->loader))) + { + if (work_item->result) + *work_item->result = hr; + work_item_free(work_item, FALSE); + if (!InterlockedDecrement(&thread_pump->processing_count)) + RtlWakeAddressAll(&thread_pump->processing_count); + continue; + } + + AcquireSRWLockExclusive(&thread_pump->proc_lock); + if (thread_pump->proc_count == THREAD_PUMP_EXITING) + { + ReleaseSRWLockExclusive(&thread_pump->proc_lock); + work_item_free(work_item, TRUE); + return 0; + } + + list_add_tail(&thread_pump->proc_queue, &work_item->entry); + ++thread_pump->proc_count; + ReleaseSRWLockExclusive(&thread_pump->proc_lock); + WakeConditionVariable(&thread_pump->proc_cv); + } + return 0; +} + +static DWORD WINAPI proc_thread(void *arg) +{ + struct thread_pump *thread_pump = arg; + struct work_item *work_item; + SIZE_T size; + void *data; + HRESULT hr; + + TRACE("%p thread started.\n", thread_pump); + + for (;;) + { + AcquireSRWLockExclusive(&thread_pump->proc_lock); + + while (!thread_pump->proc_count) + SleepConditionVariableSRW(&thread_pump->proc_cv, &thread_pump->proc_lock, INFINITE, 0); + + if (thread_pump->proc_count == THREAD_PUMP_EXITING) + { + ReleaseSRWLockExclusive(&thread_pump->proc_lock); + return 0; + } + + --thread_pump->proc_count; + work_item = LIST_ENTRY(list_head(&thread_pump->proc_queue), struct work_item, entry); + list_remove(&work_item->entry); + ReleaseSRWLockExclusive(&thread_pump->proc_lock); + + if (FAILED(hr = ID3DX11DataLoader_Decompress(work_item->loader, &data, &size))) + { + if (work_item->result) + *work_item->result = hr; + work_item_free(work_item, FALSE); + if (!InterlockedDecrement(&thread_pump->processing_count)) + RtlWakeAddressAll(&thread_pump->processing_count); + continue; + } + + if (thread_pump->device_count == THREAD_PUMP_EXITING) + { + work_item_free(work_item, TRUE); + return 0; + } + + if (FAILED(hr = ID3DX11DataProcessor_Process(work_item->processor, data, size))) + { + if (work_item->result) + *work_item->result = hr; + work_item_free(work_item, FALSE); + if (!InterlockedDecrement(&thread_pump->processing_count)) + RtlWakeAddressAll(&thread_pump->processing_count); + continue; + } + + AcquireSRWLockExclusive(&thread_pump->device_lock); + if (thread_pump->device_count == THREAD_PUMP_EXITING) + { + ReleaseSRWLockExclusive(&thread_pump->device_lock); + work_item_free(work_item, TRUE); + return 0; + } + + list_add_tail(&thread_pump->device_queue, &work_item->entry); + ++thread_pump->device_count; + InterlockedDecrement(&thread_pump->processing_count); + RtlWakeAddressAll(&thread_pump->processing_count); + ReleaseSRWLockExclusive(&thread_pump->device_lock); + } + return 0; +} + +HRESULT WINAPI D3DX11CreateThreadPump(UINT io_threads, UINT proc_threads, ID3DX11ThreadPump **pump) +{ + struct thread_pump *object; + unsigned int i; + + TRACE("io_threads %u, proc_threads %u, pump %p.\n", io_threads, proc_threads, pump); + + if (io_threads >= 1024 || proc_threads >= 1024) + return E_FAIL; + + if (!io_threads) + io_threads = 1; + if (!proc_threads) + { + SYSTEM_INFO info; + + GetSystemInfo(&info); + proc_threads = info.dwNumberOfProcessors; + } + + if (!(object = calloc(1, FIELD_OFFSET(struct thread_pump, threads[io_threads + proc_threads])))) + return E_OUTOFMEMORY; + + object->ID3DX11ThreadPump_iface.lpVtbl = &thread_pump_vtbl; + object->refcount = 1; + InitializeSRWLock(&object->io_lock); + InitializeConditionVariable(&object->io_cv); + list_init(&object->io_queue); + InitializeSRWLock(&object->proc_lock); + InitializeConditionVariable(&object->proc_cv); + list_init(&object->proc_queue); + InitializeSRWLock(&object->device_lock); + list_init(&object->device_queue); + object->thread_count = io_threads + proc_threads; + + for (i = 0; i < object->thread_count; ++i) + { + object->threads[i] = CreateThread(NULL, 0, i < io_threads ? io_thread : proc_thread, object, 0, NULL); + if (!object->threads[i]) + { + ID3DX11ThreadPump_Release(&object->ID3DX11ThreadPump_iface); + return E_FAIL; + } + } + + *pump = &object->ID3DX11ThreadPump_iface; + return S_OK; +} diff --git a/dlls/d3dx11_43/d3dx11_43.spec b/dlls/d3dx11_43/d3dx11_43.spec index 4c3b311a8d61..5212532e0e4f 100644 --- a/dlls/d3dx11_43/d3dx11_43.spec +++ b/dlls/d3dx11_43/d3dx11_43.spec @@ -25,7 +25,7 @@ @ stdcall D3DX11CreateTextureFromMemory(ptr ptr long ptr ptr ptr ptr) @ stdcall D3DX11CreateTextureFromResourceA(ptr long str ptr ptr ptr ptr) @ stdcall D3DX11CreateTextureFromResourceW(ptr long wstr ptr ptr ptr ptr) -@ stub D3DX11CreateThreadPump +@ stdcall D3DX11CreateThreadPump(long long ptr) @ stdcall D3DX11FilterTexture(ptr ptr long long) @ stdcall D3DX11GetImageInfoFromFileA(str ptr ptr ptr) @ stdcall D3DX11GetImageInfoFromFileW(wstr ptr ptr ptr) diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index 3f5cda8fbf83..dc743bd0f75f 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -2948,6 +2948,377 @@ static void test_D3DX11CompileFromFile(void) delete_directory(L"include"); } +static DWORD main_tid; +static DWORD io_tid; + +struct data_object +{ + ID3DX11DataLoader ID3DX11DataLoader_iface; + ID3DX11DataProcessor ID3DX11DataProcessor_iface; + + HANDLE load_started; + HANDLE load_done; + HANDLE decompress_done; + HRESULT load_ret; + + DWORD process_tid; +}; + +static struct data_object *data_object_from_ID3DX11DataLoader(ID3DX11DataLoader *iface) +{ + return CONTAINING_RECORD(iface, struct data_object, ID3DX11DataLoader_iface); +} + +static LONG data_loader_load_count; +static WINAPI HRESULT data_loader_Load(ID3DX11DataLoader *iface) +{ + struct data_object *data_object = data_object_from_ID3DX11DataLoader(iface); + DWORD ret; + + ok(InterlockedDecrement(&data_loader_load_count) >= 0, "Got unexpected call.\n"); + + if (!io_tid) + io_tid = GetCurrentThreadId(); + ok(io_tid != main_tid, "Load called in main thread.\n"); + ok(io_tid == GetCurrentThreadId(), "Load called in wrong thread.\n"); + + SetEvent(data_object->load_started); + ret = WaitForSingleObject(data_object->load_done, INFINITE); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %#lx.\n", ret); + return data_object->load_ret; +} + +static LONG data_loader_decompress_count; +static WINAPI HRESULT data_loader_Decompress(ID3DX11DataLoader *iface, void **data, SIZE_T *bytes) +{ + struct data_object *data_object = data_object_from_ID3DX11DataLoader(iface); + DWORD ret; + + ok(InterlockedDecrement(&data_loader_decompress_count) >= 0, "Got unexpected call.\n"); + ok(!!data, "Got unexpected data %p.\n", data); + ok(!!bytes, "Got unexpected bytes %p.\n", bytes); + + data_object->process_tid = GetCurrentThreadId(); + ok(data_object->process_tid != main_tid, "Decompress called in main thread.\n"); + ok(data_object->process_tid != io_tid, "Decompress called in IO thread.\n"); + + *data = (void *)0xdeadbeef; + *bytes = 0xdead; + ret = WaitForSingleObject(data_object->decompress_done, INFINITE); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %#lx.\n", ret); + return S_OK; +} + +static LONG data_loader_destroy_count; +static WINAPI HRESULT data_loader_Destroy(ID3DX11DataLoader *iface) +{ + ok(InterlockedDecrement(&data_loader_destroy_count) >= 0, "Got unexpected call.\n"); + return S_OK; +} + +static ID3DX11DataLoaderVtbl D3DX11DataLoaderVtbl = +{ + data_loader_Load, + data_loader_Decompress, + data_loader_Destroy +}; + +static struct data_object* data_object_from_ID3DX11DataProcessor(ID3DX11DataProcessor *iface) +{ + return CONTAINING_RECORD(iface, struct data_object, ID3DX11DataProcessor_iface); +} + +static LONG data_processor_process_count; +static HRESULT WINAPI data_processor_Process(ID3DX11DataProcessor *iface, void *data, SIZE_T bytes) +{ + struct data_object *data_object = data_object_from_ID3DX11DataProcessor(iface); + + ok(InterlockedDecrement(&data_processor_process_count) >= 0, "Got unexpected call.\n"); + ok(data_object->process_tid == GetCurrentThreadId(), "Process called in unexpected thread.\n"); + + ok(data == (void *)0xdeadbeef, "Got unexpected data %p.\n", data); + ok(bytes == 0xdead, "Got unexpected bytes %Iu.\n", bytes); + return S_OK; +} + +static LONG data_processor_create_count; +static HRESULT WINAPI data_processor_CreateDeviceObject(ID3DX11DataProcessor *iface, void **object) +{ + ok(InterlockedDecrement(&data_processor_create_count) >= 0, "Got unexpected call.\n"); + ok(main_tid == GetCurrentThreadId(), "CreateDeviceObject not called in main thread.\n"); + + *object = (void *)0xdeadf00d; + return S_OK; +} + +static LONG data_processor_destroy_count; +static HRESULT WINAPI data_processor_Destroy(ID3DX11DataProcessor *iface) +{ + struct data_object *data_object = data_object_from_ID3DX11DataProcessor(iface); + + ok(InterlockedDecrement(&data_processor_destroy_count) >= 0, "Got unexpected call.\n"); + + CloseHandle(data_object->load_started); + CloseHandle(data_object->load_done); + CloseHandle(data_object->decompress_done); + free(data_object); + return S_OK; +} + +static ID3DX11DataProcessorVtbl D3DX11DataProcessorVtbl = +{ + data_processor_Process, + data_processor_CreateDeviceObject, + data_processor_Destroy +}; + +static struct data_object *create_data_object(HRESULT load_ret) +{ + struct data_object *data_object = malloc(sizeof(*data_object)); + + data_object->ID3DX11DataLoader_iface.lpVtbl = &D3DX11DataLoaderVtbl; + data_object->ID3DX11DataProcessor_iface.lpVtbl = &D3DX11DataProcessorVtbl; + + data_object->load_started = CreateEventW(NULL, FALSE, FALSE, NULL); + ok(!!data_object->load_started, "CreateEvent failed, error %lu.\n", GetLastError()); + data_object->load_done = CreateEventW(NULL, FALSE, FALSE, NULL); + ok(!!data_object->load_done, "CreateEvent failed, error %lu.\n", GetLastError()); + data_object->decompress_done = CreateEventW(NULL, FALSE, FALSE, NULL); + ok(!!data_object->decompress_done, "CreateEvent failed, error %lu.\n", GetLastError()); + data_object->load_ret = load_ret; + + return data_object; +} + +static void test_D3DX11CreateThreadPump(void) +{ + UINT io_count, process_count, device_count, count; + struct data_object *data_object[2]; + ID3DX11DataProcessor *processor; + D3DX11_IMAGE_INFO image_info; + ID3DX11DataLoader *loader; + HRESULT hr, work_item_hr; + ID3D11Resource *resource; + ID3DX11ThreadPump *pump; + ID3D11Device *device; + SYSTEM_INFO info; + void *object; + DWORD ret; + int i; + + main_tid = GetCurrentThreadId(); + + hr = D3DX11CreateThreadPump(1024, 0, &pump); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + hr = D3DX11CreateThreadPump(0, 1024, &pump); + ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); + + GetSystemInfo(&info); + if (info.dwNumberOfProcessors > 1) + hr = D3DX11CreateThreadPump(0, 0, &pump); + else + hr = D3DX11CreateThreadPump(0, 2, &pump); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + count = ID3DX11ThreadPump_GetWorkItemCount(pump); + ok(!count, "GetWorkItemCount returned %u.\n", count); + hr = ID3DX11ThreadPump_GetQueueStatus(pump, &io_count, &process_count, &device_count); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(!io_count, "Got unexpected io_count %u.\n", io_count); + ok(!process_count, "Got unexpected process_count %u.\n", process_count); + ok(!device_count, "Got unexpected device_count %u.\n", device_count); + + data_object[0] = create_data_object(E_NOTIMPL); + data_object[1] = create_data_object(S_OK); + + data_loader_load_count = 1; + hr = ID3DX11ThreadPump_AddWorkItem(pump, &data_object[0]->ID3DX11DataLoader_iface, + &data_object[0]->ID3DX11DataProcessor_iface, &work_item_hr, NULL); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ret = WaitForSingleObject(data_object[0]->load_started, INFINITE); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %#lx.\n", ret); + ok(!data_loader_load_count, "Got unexpected data_loader_load_count %ld.\n", + data_loader_load_count); + count = ID3DX11ThreadPump_GetWorkItemCount(pump); + ok(count == 1, "GetWorkItemCount returned %u.\n", count); + hr = ID3DX11ThreadPump_GetQueueStatus(pump, &io_count, &process_count, &device_count); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(!io_count, "Got unexpected io_count %u.\n", io_count); + ok(!process_count, "Got unexpected process_count %u.\n", process_count); + ok(!device_count, "Got unexpected device_count %u.\n", device_count); + + hr = ID3DX11ThreadPump_AddWorkItem(pump, &data_object[1]->ID3DX11DataLoader_iface, + &data_object[1]->ID3DX11DataProcessor_iface, NULL, &object); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ret = WaitForSingleObject(data_object[0]->load_started, 50); + ok(ret == WAIT_TIMEOUT, "WaitForSingleObject returned %#lx.\n", ret); + count = ID3DX11ThreadPump_GetWorkItemCount(pump); + ok(count == 2, "GetWorkItemCount returned %u.\n", count); + hr = ID3DX11ThreadPump_GetQueueStatus(pump, &io_count, &process_count, &device_count); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(io_count == 1, "Got unexpected io_count %u.\n", io_count); + ok(!process_count, "Got unexpected process_count %u.\n", process_count); + ok(!device_count, "Got unexpected device_count %u.\n", device_count); + + data_loader_load_count = 1; + data_loader_destroy_count = 1; + data_processor_destroy_count = 1; + SetEvent(data_object[0]->load_done); + ret = WaitForSingleObject(data_object[1]->load_started, INFINITE); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %#lx.\n", ret); + ok(work_item_hr == E_NOTIMPL, "Got unexpected work_item_hr %#lx.\n", work_item_hr); + ok(!data_loader_destroy_count, "Got unexpected data_loader_destroy_count %ld.\n", + data_loader_destroy_count); + ok(!data_processor_destroy_count, "Got unexpected data_processor_destroy_count %ld.\n", + data_processor_destroy_count); + ok(!data_loader_load_count, "Got unexpected data_loader_load_count %ld.\n", + data_loader_load_count); + + data_loader_decompress_count = 1; + data_processor_process_count = 1; + SetEvent(data_object[1]->load_done); + SetEvent(data_object[1]->decompress_done); + + data_processor_create_count = 1; + data_loader_destroy_count = 1; + data_processor_destroy_count = 1; + hr = ID3DX11ThreadPump_WaitForAllItems(pump); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(object == (void *)0xdeadf00d, "Got unexpected object %p.\n", object); + ok(!data_loader_decompress_count, "Got unexpected data_loader_decompress_count %ld.\n", + data_loader_decompress_count); + ok(!data_processor_process_count, "Got unexpected data_processor_process_count %ld.\n", + data_processor_process_count); + ok(!data_processor_create_count, "Got unexpected data_processor_create_count %ld.\n", + data_processor_create_count); + ok(!data_loader_destroy_count, "Got unexpected data_loader_destroy_count %ld.\n", + data_loader_destroy_count); + ok(!data_processor_destroy_count, "Got unexpected data_processor_destroy_count %ld.\n", + data_processor_destroy_count); + + data_object[0] = create_data_object(S_OK); + data_object[1] = create_data_object(S_OK); + SetEvent(data_object[0]->load_done); + SetEvent(data_object[1]->load_done); + SetEvent(data_object[1]->decompress_done); + + data_loader_load_count = 2; + data_loader_decompress_count = 2; + data_processor_process_count = 1; + hr = ID3DX11ThreadPump_AddWorkItem(pump, &data_object[0]->ID3DX11DataLoader_iface, + &data_object[0]->ID3DX11DataProcessor_iface, NULL, &object); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11ThreadPump_AddWorkItem(pump, &data_object[1]->ID3DX11DataLoader_iface, + &data_object[1]->ID3DX11DataProcessor_iface, NULL, &object); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + for (;;) + { + hr = ID3DX11ThreadPump_GetQueueStatus(pump, &io_count, &process_count, &device_count); + if (hr != S_OK || device_count) + break; + Sleep(1); + } + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(!io_count, "Got unexpected io_count %u.\n", io_count); + ok(!process_count, "Got unexpected process_count %u.\n", process_count); + ok(device_count == 1, "Got unexpected device_count %u.\n", device_count); + ok(!data_loader_load_count, "Got unexpected data_loader_load_count %ld.\n", + data_loader_load_count); + ok(!data_loader_decompress_count, "Got unexpected data_loader_decompress_count %ld.\n", + data_loader_decompress_count); + ok(!data_processor_process_count, "Got unexpected data_processor_process_count %ld.\n", + data_processor_process_count); + + hr = ID3DX11ThreadPump_ProcessDeviceWorkItems(pump, 0); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11ThreadPump_GetQueueStatus(pump, &io_count, &process_count, &device_count); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(!io_count, "Got unexpected io_count %u.\n", io_count); + ok(!process_count, "Got unexpected process_count %u.\n", process_count); + ok(device_count == 1, "Got unexpected device_count %u.\n", device_count); + + data_processor_create_count = 1; + data_loader_destroy_count = 1; + data_processor_destroy_count = 1; + hr = ID3DX11ThreadPump_ProcessDeviceWorkItems(pump, 1); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11ThreadPump_GetQueueStatus(pump, &io_count, &process_count, &device_count); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(!io_count, "Got unexpected io_count %u.\n", io_count); + ok(!process_count, "Got unexpected process_count %u.\n", process_count); + ok(!device_count, "Got unexpected device_count %u.\n", device_count); + ok(!data_processor_create_count, "Got unexpected data_processor_create_count %ld.\n", + data_processor_create_count); + ok(!data_loader_destroy_count, "Got unexpected data_loader_destroy_count %ld.\n", + data_loader_destroy_count); + ok(!data_processor_destroy_count, "Got unexpected data_processor_destroy_count %ld.\n", + data_processor_destroy_count); + + data_processor_process_count = 1; + data_loader_destroy_count = 1; + data_processor_destroy_count = 1; + SetEvent(data_object[0]->decompress_done); + hr = ID3DX11ThreadPump_PurgeAllItems(pump); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + data_processor_process_count = 0; + ok(!data_loader_destroy_count, "Got unexpected data_loader_destroy_count %ld.\n", + data_loader_destroy_count); + ok(!data_processor_destroy_count, "Got unexpected data_processor_destroy_count %ld.\n", + data_processor_destroy_count); + + device = create_device(); + if (!device) + { + skip("Failed to create device, skipping tests.\n"); + ID3DX11ThreadPump_Release(pump); + return; + } + + for (i = 0; i < ARRAY_SIZE(test_image); ++i) + { + winetest_push_context("Test %u", i); + + hr = D3DX11CreateAsyncMemoryLoader(test_image[i].data, test_image[i].size, &loader); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = D3DX11CreateAsyncTextureInfoProcessor(&image_info, &processor); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11ThreadPump_AddWorkItem(pump, loader, processor, &work_item_hr, NULL); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11ThreadPump_WaitForAllItems(pump); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(work_item_hr == S_OK || (work_item_hr == E_FAIL + && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), + "Got unexpected hr %#lx.\n", work_item_hr); + if (work_item_hr == S_OK) + check_image_info(&image_info, test_image + i, __LINE__); + + hr = D3DX11CreateAsyncMemoryLoader(test_image[i].data, test_image[i].size, &loader); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = D3DX11CreateAsyncTextureProcessor(device, NULL, &processor); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11ThreadPump_AddWorkItem(pump, loader, processor, &work_item_hr, (void **)&resource); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID3DX11ThreadPump_WaitForAllItems(pump); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(work_item_hr == S_OK || (work_item_hr == E_FAIL + && test_image[i].expected_info.ImageFileFormat == D3DX11_IFF_WMP), + "Got unexpected hr %#lx.\n", work_item_hr); + if (work_item_hr == S_OK) + { + check_resource_info(resource, test_image + i, __LINE__); + check_resource_data(resource, test_image + i, __LINE__); + ID3D11Resource_Release(resource); + } + + winetest_pop_context(); + } + + ok(!ID3D11Device_Release(device), "Got unexpected refcount.\n"); + + ret = ID3DX11ThreadPump_Release(pump); + ok(!ret, "Got unexpected refcount %lu.\n", ret); +} + /* dds_header.flags */ #define DDS_CAPS 0x00000001 #define DDS_HEIGHT 0x00000002 @@ -5496,6 +5867,7 @@ START_TEST(d3dx11) test_D3DX11CompileFromFile(); test_D3DX11LoadTextureFromTexture(); test_D3DX11FilterTexture(); + test_D3DX11CreateThreadPump(); test_get_image_info(); test_create_texture(); test_create_shader_resource_view(); diff --git a/include/d3dx11core.idl b/include/d3dx11core.idl index f619e3b1b029..3b1339069eed 100644 --- a/include/d3dx11core.idl +++ b/include/d3dx11core.idl @@ -63,3 +63,5 @@ interface ID3DX11ThreadPump : IUnknown HRESULT PurgeAllItems(); HRESULT GetQueueStatus([in] UINT *io_queue, [in] UINT *process_queue, [in] UINT *device_queue); } + +cpp_quote("HRESULT WINAPI D3DX11CreateThreadPump(UINT io_threads, UINT proc_threads, ID3DX11ThreadPump **pump);") From f273d8c7519b0e2e700c7d83b094fb59cc4947d6 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 11 Dec 2024 12:33:06 -0500 Subject: [PATCH 0978/2542] d3dx11: Implement D3DX11SaveTextureToMemory(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx11_43/tests/d3dx11.c | 1665 +++++++++++++++++++++++++++++++++ dlls/d3dx11_43/texture.c | 217 ++++- 2 files changed, 1873 insertions(+), 9 deletions(-) diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index dc743bd0f75f..7caf6b8c8076 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -18,6 +18,7 @@ #define COBJMACROS #include "initguid.h" +#include "wincodec.h" #include "d3d11.h" #include "d3dx11.h" #include "wine/wined3d.h" @@ -3333,6 +3334,7 @@ static void test_D3DX11CreateThreadPump(void) #define DDSCAPS_ALPHA 0x00000002 #define DDS_CAPS_COMPLEX 0x00000008 #define DDS_CAPS_TEXTURE 0x00001000 +#define DDSCAPS_MIPMAP 0x00400000 /* dds_header.caps2 */ #define DDS_CAPS2_VOLUME 0x00200000 @@ -5845,6 +5847,1668 @@ static void test_D3DX11FilterTexture(void) ok(!ID3D11Device_Release(device), "Unexpected refcount.\n"); } +static HRESULT d3d11_create_texture_1d(ID3D11Device *device, uint32_t width, uint32_t mip_levels, uint32_t array_size, + DXGI_FORMAT format, D3D11_USAGE usage, uint32_t bind_flags, uint32_t cpu_access_flags, uint32_t misc_flags, + ID3D11Texture1D **tex) +{ + const D3D11_TEXTURE1D_DESC desc = { width, mip_levels, array_size, format, usage, bind_flags, cpu_access_flags, + misc_flags }; + + return ID3D11Device_CreateTexture1D(device, &desc, NULL, tex); +} + +static HRESULT d3d11_create_texture_2d(ID3D11Device *device, uint32_t width, uint32_t height, uint32_t mip_levels, + uint32_t array_size, DXGI_FORMAT format, uint32_t sample_count, uint32_t sample_quality, D3D11_USAGE usage, + uint32_t bind_flags, uint32_t cpu_access_flags, uint32_t misc_flags, ID3D11Texture2D **tex) +{ + const D3D11_TEXTURE2D_DESC desc = { width, height, mip_levels, array_size, format, { sample_count, sample_quality }, + usage, bind_flags, cpu_access_flags, misc_flags }; + + return ID3D11Device_CreateTexture2D(device, &desc, NULL, tex); +} + +static HRESULT d3d11_create_texture_3d(ID3D11Device *device, uint32_t width, uint32_t height, uint32_t depth, + uint32_t mip_levels, DXGI_FORMAT format, D3D11_USAGE usage, uint32_t bind_flags, uint32_t cpu_access_flags, + uint32_t misc_flags, ID3D11Texture3D **tex) +{ + const D3D11_TEXTURE3D_DESC desc = { width, height, depth, mip_levels, format, usage, bind_flags, cpu_access_flags, + misc_flags }; + + return ID3D11Device_CreateTexture3D(device, &desc, NULL, tex); +} + +enum texture_type +{ + TEXTURE_2D, + TEXTURE_2D_ARRAY, + TEXTURE_3D, + TEXTURE_CUBE, + TEXTURE_1D, + TEXTURE_1D_ARRAY, + TEXTURE_TYPE_COUNT, +}; + +static void test_save_texture_to_dds(ID3D11Device *device) +{ + struct dds_expected + { + struct dds_header header; + struct dds_header_dxt10 dxt10; + BOOL todo; + }; + static const struct + { + DXGI_FORMAT format; + struct dds_expected dds_expected[TEXTURE_TYPE_COUNT]; + } save_tests[] = + { + { DXGI_FORMAT_R8G8B8A8_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0xff, 0xff00, 0xff0000, 0xff000000 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0xff, 0xff00, 0xff0000, 0xff000000 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0xff, 0xff00, 0xff0000, 0xff000000 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R10G10B10A2_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x3ff00000, 0xffc00, 0x3ff, 0xc0000000 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R10G10B10A2_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x3ff00000, 0xffc00, 0x3ff, 0xc0000000 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x3ff00000, 0xffc00, 0x3ff, 0xc0000000 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R10G10B10A2_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R10G10B10A2_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R16G16B16A16_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x24, 64, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16B16A16_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 64, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x24, 64, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x24, 64, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16B16A16_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16B16A16_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R16G16_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_RGB, 0, 32, 0xffff, 0xffff0000, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_RGB, 0, 32, 0xffff, 0xffff0000, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_RGB, 0, 32, 0xffff, 0xffff0000, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_A8_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, + { 32, DDS_PF_ALPHA_ONLY, 0, 8, 0, 0, 0, 0xff }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 8, 8, 4, { 0 }, + { 32, DDS_PF_ALPHA_ONLY, 0, 8, 0, 0, 0, 0xff }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, + { 32, DDS_PF_ALPHA_ONLY, 0, 8, 0, 0, 0, 0xff }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 8, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 8, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + /* 5. */ + { DXGI_FORMAT_R16_FLOAT, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x6f, 16, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x6f, 16, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x6f, 16, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R16G16_FLOAT, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x70, 32, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x70, 32, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x70, 32, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R16G16B16A16_FLOAT, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x71, 64, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16B16A16_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 64, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x71, 64, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x71, 64, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16B16A16_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16B16A16_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R32_FLOAT, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x72, 32, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x72, 32, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x72, 32, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R32G32_FLOAT, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x73, 64, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 64, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x73, 64, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x73, 64, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + /* 10. */ + { DXGI_FORMAT_R32G32B32A32_FLOAT, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 128, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x74, 128, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 128, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32B32A32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 128, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x74, 128, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 128, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x74, 128, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 128, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32B32A32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 128, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32B32A32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_G8R8_G8B8_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('G','R','G','B'), 16, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_G8R8_G8B8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('G','R','G','B'), 16, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('G','R','G','B'), 16, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_G8R8_G8B8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_G8R8_G8B8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R8G8_B8G8_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('R','G','B','G'), 16, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_B8G8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('R','G','B','G'), 16, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('R','G','B','G'), 16, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_B8G8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_B8G8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_BC1_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 4, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC1_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 4, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 4, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + } + }, + { DXGI_FORMAT_BC2_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','3'), 4, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC2_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','3'), 4, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','3'), 4, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + } + }, + /* 15. */ + { DXGI_FORMAT_BC3_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','5'), 8, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC3_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','5'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','5'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + } + }, + { DXGI_FORMAT_BC4_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','U'), 8, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC4_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','U'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','U'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + } + }, + { DXGI_FORMAT_BC4_SNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','S'), 8, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC4_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','S'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','4','S'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + } + }, + { DXGI_FORMAT_BC5_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('A','T','I','2'), 8, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC5_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('A','T','I','2'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('A','T','I','2'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + } + }, + { DXGI_FORMAT_BC5_SNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','5','S'), 8, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC5_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','5','S'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('B','C','5','S'), 8, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + } + }, + /* 20. */ + { DXGI_FORMAT_R16G16B16A16_SNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x6e, 64, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16B16A16_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 64, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x6e, 64, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 64, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, 0x6e, 64, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16B16A16_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 64, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16B16A16_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D11_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D11_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R8_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 8, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_R8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_R8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 8, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 8, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R8_SNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 8, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_R8_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 8, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_R8_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 8, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 8, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + /* 25. */ + { DXGI_FORMAT_R8G8_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_R8G8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_R8G8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R16_UNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_R16_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_R16_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R32G32B32_FLOAT, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 96, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32B32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 96, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32B32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 96, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_R32G32B32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 96, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_R32G32B32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 96, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32B32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 96, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R32G32B32_FLOAT, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_BC1_UNORM_SRGB, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC1_UNORM_SRGB, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC1_UNORM_SRGB, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_BC1_UNORM_SRGB, D3D11_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_BC1_UNORM_SRGB, D3D11_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + }, + } + }, + { DXGI_FORMAT_BC2_UNORM_SRGB, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC2_UNORM_SRGB, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC2_UNORM_SRGB, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_BC2_UNORM_SRGB, D3D11_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_BC2_UNORM_SRGB, D3D11_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + }, + } + }, + /* 30. */ + { DXGI_FORMAT_BC3_UNORM_SRGB, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC3_UNORM_SRGB, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_BC3_UNORM_SRGB, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_BC3_UNORM_SRGB, D3D11_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_BC3_UNORM_SRGB, D3D11_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + }, + } + }, + { DXGI_FORMAT_R8G8B8A8_SNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_R8G8B8A8_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_R8G8B8A8_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8B8A8_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R8G8_SNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 16, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_R8G8_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 16, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_R8G8_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 16, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R8G8_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + { DXGI_FORMAT_R16G16_SNORM, + { { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 2, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH | DDS_DEPTH, 8, 8, 32, 8, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_VOLUME, 0, 0 + }, + { DXGI_FORMAT_R16G16_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 8, 8, 32, 0, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_COMPLEX | DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + DDS_CAPS2_CUBEMAP | DDS_CAPS2_CUBEMAP_ALL_FACES, 0, 0 + }, + { DXGI_FORMAT_R16G16_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, DDS_RESOURCE_MISC_TEXTURECUBE, 1, 0 }, + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 1, 0 }, + .todo = TRUE + }, + { { 124, DDS_HEIGHT | DDS_WIDTH, 1, 8, 32, 1, 4, { 0 }, + { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 }, + DDS_CAPS_TEXTURE | DDSCAPS_MIPMAP, + }, + { DXGI_FORMAT_R16G16_SNORM, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, 2, 0 }, + .todo = TRUE + }, + } + }, + }; + ID3D11DeviceContext *context; + D3DX11_IMAGE_INFO img_info; + ID3D11Resource *tex; + ID3D10Blob *buffer; + unsigned int i, j; + HRESULT hr; + struct + { + DWORD magic; + struct dds_header header; + struct dds_header_dxt10 dxt10; + } *dds; + + ID3D11Device_GetImmediateContext(device, &context); + for (i = 0; i < ARRAY_SIZE(save_tests); ++i) + { + if (!strcmp(winetest_platform, "wine") && (save_tests[i].format == DXGI_FORMAT_G8R8_G8B8_UNORM + || save_tests[i].format == DXGI_FORMAT_R8G8_B8G8_UNORM)) + { + skip("Skipping unsupported texture format on Wine.\n"); + continue; + } + + winetest_push_context("Test %u", i); + for (j = 0; j < TEXTURE_TYPE_COUNT; ++j) + { + const struct dds_expected *dds_expected = &save_tests[i].dds_expected[j]; + + /* Cannot create a block compressed 1D texture. */ + if (is_block_compressed(save_tests[i].format) && (j >= TEXTURE_1D)) + continue; + + switch (j) + { + case TEXTURE_1D: + hr = d3d11_create_texture_1d(device, 8, 4, 1, save_tests[i].format, D3D11_USAGE_DEFAULT, + D3D11_BIND_SHADER_RESOURCE, 0, 0, (ID3D11Texture1D **)&tex); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + break; + + case TEXTURE_1D_ARRAY: + hr = d3d11_create_texture_1d(device, 8, 4, 2, save_tests[i].format, D3D11_USAGE_DEFAULT, + D3D11_BIND_SHADER_RESOURCE, 0, 0, (ID3D11Texture1D **)&tex); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + break; + + case TEXTURE_2D: + hr = d3d11_create_texture_2d(device, 8, 8, 4, 1, save_tests[i].format, 1, 0, D3D11_USAGE_DEFAULT, + D3D11_BIND_SHADER_RESOURCE, 0, 0, (ID3D11Texture2D **)&tex); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + break; + + case TEXTURE_2D_ARRAY: + hr = d3d11_create_texture_2d(device, 8, 8, 4, 2, save_tests[i].format, 1, 0, D3D11_USAGE_DEFAULT, + D3D11_BIND_SHADER_RESOURCE, 0, 0, (ID3D11Texture2D **)&tex); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + break; + + case TEXTURE_3D: + hr = d3d11_create_texture_3d(device, 8, 8, 8, 4, save_tests[i].format, D3D11_USAGE_DEFAULT, + D3D11_BIND_SHADER_RESOURCE, 0, 0, (ID3D11Texture3D **)&tex); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + break; + + case TEXTURE_CUBE: + hr = d3d11_create_texture_2d(device, 8, 8, 4, 6, save_tests[i].format, 1, 0, D3D11_USAGE_DEFAULT, + D3D11_BIND_SHADER_RESOURCE, 0, D3D11_RESOURCE_MISC_TEXTURECUBE, (ID3D11Texture2D **)&tex); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + break; + } + + if (FAILED(hr)) + continue; + + winetest_push_context("Texture type %u", j); + hr = D3DX11SaveTextureToMemory(context, tex, D3DX11_IFF_DDS, &buffer, 0); + todo_wine_if(dds_expected->todo) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + dds = ID3D10Blob_GetBufferPointer(buffer); + + hr = D3DX11GetImageInfoFromMemory(ID3D10Blob_GetBufferPointer(buffer), ID3D10Blob_GetBufferSize(buffer), NULL, + &img_info, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(!memcmp(&dds_expected->header, &dds->header, sizeof(dds->header)), "Header mismatch.\n"); + if (dds->header.pixel_format.fourcc == MAKEFOURCC('D','X','1','0')) + ok(!memcmp(&dds_expected->dxt10, &dds->dxt10, sizeof(dds->dxt10)), "DXT10 header mismatch.\n"); + switch (j) + { + case TEXTURE_1D: + check_image_info_values(&img_info, 8, 1, 1, 1, 4, 0, save_tests[i].format, + D3D11_RESOURCE_DIMENSION_TEXTURE1D, D3DX11_IFF_DDS, FALSE); + break; + + case TEXTURE_1D_ARRAY: + check_image_info_values(&img_info, 8, 1, 1, 2, 4, 0, save_tests[i].format, + D3D11_RESOURCE_DIMENSION_TEXTURE1D, D3DX11_IFF_DDS, FALSE); + break; + + case TEXTURE_2D: + check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, save_tests[i].format, + D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS, FALSE); + break; + + case TEXTURE_2D_ARRAY: + check_image_info_values(&img_info, 8, 8, 1, 2, 4, 0, save_tests[i].format, + D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS, FALSE); + break; + + case TEXTURE_3D: + check_image_info_values(&img_info, 8, 8, 8, 1, 4, 0, save_tests[i].format, + D3D11_RESOURCE_DIMENSION_TEXTURE3D, D3DX11_IFF_DDS, FALSE); + break; + + case TEXTURE_CUBE: + check_image_info_values(&img_info, 8, 8, 1, 6, 4, D3D11_RESOURCE_MISC_TEXTURECUBE, + save_tests[i].format, D3D11_RESOURCE_DIMENSION_TEXTURE2D, D3DX11_IFF_DDS, FALSE); + break; + } + + ID3D10Blob_Release(buffer); + } + ID3D11Resource_Release(tex); + winetest_pop_context(); + } + winetest_pop_context(); + } + ID3D11DeviceContext_Release(context); +} + +static void check_image_wic_pixel_format(IWICImagingFactory *factory, const void *data, unsigned int size, + const GUID *expected_fmt, BOOL todo) +{ + IWICBitmapFrameDecode *frame = NULL; + IWICBitmapDecoder *decoder = NULL; + IWICStream *stream = NULL; + HRESULT hr; + GUID fmt; + + hr = IWICImagingFactory_CreateStream(factory, &stream); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IWICStream_InitializeFromMemory(stream, (BYTE *)data, size); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IWICImagingFactory_CreateDecoderFromStream(factory, (IStream *)stream, NULL, 0, &decoder); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &fmt); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine_if(todo) ok(IsEqualGUID(expected_fmt, &fmt), "Unexpected WIC format %s.\n", debugstr_guid(&fmt)); + + IWICBitmapFrameDecode_Release(frame); + IWICBitmapDecoder_Release(decoder); + IWICStream_Release(stream); +} + +static void test_save_texture_to_iffs(ID3D11Device *device) +{ + static const enum D3DX11_IMAGE_FILE_FORMAT test_iffs[] = { D3DX11_IFF_BMP, D3DX11_IFF_JPG, D3DX11_IFF_PNG, + D3DX11_IFF_TIFF, D3DX11_IFF_GIF, D3DX11_IFF_WMP }; + static const char *test_iff_str[] = { "D3DX11_IFF_BMP", "D3DX11_IFF_JPG", "D3DX11_IFF_PNG", + "D3DX11_IFF_TIFF", "D3DX11_IFF_GIF", "D3DX11_IFF_WMP" }; + struct wic_expected + { + const GUID *fmt; + BOOL todo; + }; + static const struct + { + DXGI_FORMAT format; + BOOL supported; + struct wic_expected wic_expected[ARRAY_SIZE(test_iffs)]; + } save_tests[] = + { + { DXGI_FORMAT_R8G8B8A8_UNORM, TRUE, + { { &GUID_WICPixelFormat32bppBGR, FALSE }, + { &GUID_WICPixelFormat24bppBGR, FALSE }, + { &GUID_WICPixelFormat32bppBGRA, FALSE }, + { &GUID_WICPixelFormat32bppBGRA, FALSE }, + { NULL }, + { &GUID_WICPixelFormat32bppBGRA, FALSE }, + }, + }, + { DXGI_FORMAT_R16G16B16A16_FLOAT, TRUE, + { { &GUID_WICPixelFormat64bppRGBAFixedPoint, TRUE }, + { &GUID_WICPixelFormat24bppBGR, FALSE }, + { &GUID_WICPixelFormat64bppRGBA, FALSE }, + { &GUID_WICPixelFormat64bppRGBA, FALSE }, + { NULL }, + { &GUID_WICPixelFormat64bppRGBAHalf, FALSE }, + }, + }, + { DXGI_FORMAT_R32G32B32A32_FLOAT, TRUE, + { { &GUID_WICPixelFormat64bppRGBAFixedPoint, TRUE }, + { &GUID_WICPixelFormat24bppBGR, FALSE }, + { &GUID_WICPixelFormat64bppRGBA, FALSE }, + { &GUID_WICPixelFormat64bppRGBA, FALSE }, + { NULL }, + { &GUID_WICPixelFormat128bppRGBAFloat, FALSE }, + }, + }, + { DXGI_FORMAT_R16_UNORM, TRUE, + { { &GUID_WICPixelFormat64bppRGBAFixedPoint, TRUE }, + { &GUID_WICPixelFormat8bppGray, FALSE }, + { &GUID_WICPixelFormat16bppGray, FALSE }, + { &GUID_WICPixelFormat16bppGray, FALSE }, + { NULL }, + { &GUID_WICPixelFormat16bppGrayFixedPoint, FALSE }, + }, + }, + { DXGI_FORMAT_R10G10B10A2_UNORM, FALSE }, + /* 5. */ + { DXGI_FORMAT_R16G16B16A16_UNORM, FALSE }, + { DXGI_FORMAT_R16G16_UNORM, FALSE }, + { DXGI_FORMAT_A8_UNORM, FALSE }, + { DXGI_FORMAT_R16_FLOAT, FALSE }, + { DXGI_FORMAT_R16G16_FLOAT, FALSE }, + /* 10. */ + { DXGI_FORMAT_R32_FLOAT, FALSE }, + { DXGI_FORMAT_R32G32_FLOAT, FALSE }, + { DXGI_FORMAT_G8R8_G8B8_UNORM, FALSE }, + { DXGI_FORMAT_R8G8_B8G8_UNORM, FALSE }, + { DXGI_FORMAT_BC1_UNORM, FALSE }, + /* 15. */ + { DXGI_FORMAT_BC2_UNORM, FALSE }, + { DXGI_FORMAT_BC3_UNORM, FALSE }, + { DXGI_FORMAT_BC4_UNORM, FALSE }, + { DXGI_FORMAT_BC4_SNORM, FALSE }, + { DXGI_FORMAT_BC5_UNORM, FALSE }, + /* 20. */ + { DXGI_FORMAT_BC5_SNORM, FALSE }, + { DXGI_FORMAT_R16G16B16A16_SNORM, FALSE }, + /* Supported on d3dx11, but not d3dx10. */ + { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, TRUE, + { { &GUID_WICPixelFormat32bppBGR, FALSE }, + { &GUID_WICPixelFormat24bppBGR, FALSE }, + { &GUID_WICPixelFormat32bppBGRA, FALSE }, + { &GUID_WICPixelFormat32bppBGRA, FALSE }, + { NULL }, + { &GUID_WICPixelFormat32bppBGRA, FALSE }, + }, + }, + { DXGI_FORMAT_R8_UNORM, FALSE }, + { DXGI_FORMAT_R8_SNORM, FALSE }, + /* 25. */ + { DXGI_FORMAT_R8G8_UNORM, FALSE }, + { DXGI_FORMAT_R32G32B32_FLOAT, FALSE }, + { DXGI_FORMAT_BC1_UNORM_SRGB, FALSE }, + { DXGI_FORMAT_BC2_UNORM_SRGB, FALSE }, + { DXGI_FORMAT_BC3_UNORM_SRGB, FALSE }, + /* 30. */ + { DXGI_FORMAT_R8G8B8A8_SNORM, FALSE }, + { DXGI_FORMAT_R8G8_SNORM, FALSE }, + { DXGI_FORMAT_R16G16_SNORM, FALSE }, + }; + IWICImagingFactory *factory = NULL; + ID3D11DeviceContext *context; + D3DX11_IMAGE_INFO img_info; + ID3D11Resource *tex; + ID3D10Blob *buffer; + unsigned int i, j; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, + &IID_IWICImagingFactory, (void **)&factory); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + ID3D11Device_GetImmediateContext(device, &context); + for (i = 0; i < ARRAY_SIZE(save_tests); ++i) + { + if (!strcmp(winetest_platform, "wine") && (save_tests[i].format == DXGI_FORMAT_G8R8_G8B8_UNORM + || save_tests[i].format == DXGI_FORMAT_R8G8_B8G8_UNORM)) + { + skip("Skipping unsupported format on Wine.\n"); + continue; + } + + hr = d3d11_create_texture_2d(device, 8, 8, 4, 1, save_tests[i].format, 1, 0, D3D11_USAGE_DEFAULT, + D3D11_BIND_SHADER_RESOURCE, 0, 0, (ID3D11Texture2D **)&tex); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + if (FAILED(hr)) + continue; + + winetest_push_context("Test %u", i); + for (j = 0; j < ARRAY_SIZE(test_iffs); ++j) + { + const HRESULT expected_hr = save_tests[i].supported ? S_OK : E_FAIL; + + winetest_push_context("Image format %s", test_iff_str[j]); + hr = D3DX11SaveTextureToMemory(context, tex, test_iffs[j], &buffer, 0); + + /* GIF saving is never supported, regardless of texture format. */ + if (test_iffs[j] == D3DX11_IFF_GIF) + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + else + todo_wine_if(test_iffs[j] == D3DX11_IFF_WMP) ok(hr == expected_hr, "Unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + check_image_wic_pixel_format(factory, ID3D10Blob_GetBufferPointer(buffer), ID3D10Blob_GetBufferSize(buffer), + save_tests[i].wic_expected[j].fmt, save_tests[i].wic_expected[j].todo); + + hr = D3DX11GetImageInfoFromMemory(ID3D10Blob_GetBufferPointer(buffer), ID3D10Blob_GetBufferSize(buffer), NULL, + &img_info, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + check_image_info_values(&img_info, 8, 8, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, + D3D11_RESOURCE_DIMENSION_TEXTURE2D, test_iffs[j], FALSE); + ID3D10Blob_Release(buffer); + } + winetest_pop_context(); + } + + ID3D11Resource_Release(tex); + winetest_pop_context(); + } + IWICImagingFactory_Release(factory); + ID3D11DeviceContext_Release(context); +} + +static void test_save_texture(void) +{ + D3D11_SUBRESOURCE_DATA sub_resource_data[4] = { 0 }; + D3D11_TEXTURE2D_DESC tex_2d_desc; + ID3D11DeviceContext *context; + D3DX11_IMAGE_INFO img_info; + ID3D11Texture2D *tex_2d; + uint8_t tmp_buf[1024]; + ID3D11Device *device; + ID3D10Blob *buffer; + HRESULT hr; + + device = create_device(); + if (!device) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + CoInitialize(NULL); + + test_save_texture_to_dds(device); + test_save_texture_to_iffs(device); + + set_d3d11_2d_texture_desc(&tex_2d_desc, 8, 8, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D11_USAGE_DEFAULT, + D3D11_BIND_SHADER_RESOURCE, 0, 0); + memset(tmp_buf, 0, sizeof(tmp_buf)); + memcpy(tmp_buf, bc1_to_bc3_8_8_decompressed, sizeof(bc1_to_bc3_8_8_decompressed)); + init_subresource_data(sub_resource_data, (const void *)tmp_buf, tex_2d_desc.Width, tex_2d_desc.Height, 1, + tex_2d_desc.MipLevels, tex_2d_desc.ArraySize, tex_2d_desc.Format); + + hr = ID3D11Device_CreateTexture2D(device, &tex_2d_desc, sub_resource_data, &tex_2d); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + ID3D11Device_GetImmediateContext(device, &context); + hr = D3DX11SaveTextureToMemory(context, (ID3D11Resource *)tex_2d, D3DX11_IFF_DDS, &buffer, 0); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = D3DX11GetImageInfoFromMemory(ID3D10Blob_GetBufferPointer(buffer), ID3D10Blob_GetBufferSize(buffer), NULL, + &img_info, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_DDS, FALSE); + ID3D10Blob_Release(buffer); + + ID3D11Texture2D_Release(tex_2d); + + CoUninitialize(); + + ID3D11DeviceContext_Release(context); + ok(!ID3D11Device_Release(device), "Unexpected refcount.\n"); +} + START_TEST(d3dx11) { HMODULE wined3d; @@ -5871,4 +7535,5 @@ START_TEST(d3dx11) test_get_image_info(); test_create_texture(); test_create_shader_resource_view(); + test_save_texture(); } diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c index 5946a5d496e9..5e6ccce7a165 100644 --- a/dlls/d3dx11_43/texture.c +++ b/dlls/d3dx11_43/texture.c @@ -25,6 +25,7 @@ #include "dxhelpers.h" #include "wine/debug.h" +#include "assert.h" WINE_DEFAULT_DEBUG_CHANNEL(d3dx); @@ -46,15 +47,6 @@ HRESULT WINAPI D3DX11SaveTextureToFileA(ID3D11DeviceContext *context, ID3D11Reso return E_NOTIMPL; } -HRESULT WINAPI D3DX11SaveTextureToMemory(ID3D11DeviceContext *context, ID3D11Resource *texture, - D3DX11_IMAGE_FILE_FORMAT format, ID3D10Blob **buffer, UINT flags) -{ - FIXME("context %p, texture %p, format %u, buffer %p, flags %#x stub!\n", - context, texture, format, buffer, flags); - - return E_NOTIMPL; -} - HRESULT WINAPI D3DX11GetImageInfoFromFileA(const char *src_file, ID3DX11ThreadPump *pump, D3DX11_IMAGE_INFO *info, HRESULT *result) { @@ -1081,6 +1073,7 @@ struct d3d11_texture { const struct pixel_format_desc *fmt_desc; D3D11_MAP map_flags; D3D11_BOX texture_box; + BOOL is_cubemap; uint32_t first_layer; uint32_t first_mip_level; @@ -1159,6 +1152,7 @@ static HRESULT d3dx_d3d11_texture_init(ID3D11DeviceContext *context, ID3D11Resou texture->first_mip_level = min((desc.MipLevels - 1), first_mip_level); texture->first_layer = first_layer >= desc.ArraySize ? 0 : first_layer; + texture->is_cubemap = !!(desc.MiscFlags & D3D11_RESOURCE_MISC_TEXTURECUBE); staging_tex_rsrc->texture_dimension = src_tex_rsrc->texture_dimension; staging_tex_rsrc->size = src_tex_rsrc->size; @@ -1475,3 +1469,208 @@ HRESULT WINAPI D3DX11FilterTexture(ID3D11DeviceContext *context, ID3D11Resource return D3DX11LoadTextureFromTexture(context, texture, &load_info, texture); } + +static HRESULT d3dx11_get_save_format_for_file_format(D3DX11_IMAGE_FILE_FORMAT iff, enum d3dx_pixel_format_id src_fmt, + enum d3dx_pixel_format_id *save_fmt) +{ + *save_fmt = D3DX_PIXEL_FORMAT_COUNT; + switch (iff) + { + case D3DX11_IFF_JPG: + switch (src_fmt) + { + case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM: + case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB: + case D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT: + case D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT: + *save_fmt = D3DX_PIXEL_FORMAT_B8G8R8_UNORM; + break; + + case D3DX_PIXEL_FORMAT_R16_UNORM: + *save_fmt = D3DX_PIXEL_FORMAT_L8_UNORM; + break; + + default: + return E_FAIL; + } + break; + + case D3DX11_IFF_PNG: + case D3DX11_IFF_TIFF: + switch (src_fmt) + { + case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM: + case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB: + *save_fmt = D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM; + break; + + case D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT: + case D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT: + *save_fmt = D3DX_PIXEL_FORMAT_R16G16B16A16_UNORM; + break; + + case D3DX_PIXEL_FORMAT_R16_UNORM: + *save_fmt = D3DX_PIXEL_FORMAT_L16_UNORM; + break; + + default: + return E_FAIL; + } + break; + + case D3DX11_IFF_BMP: + switch (src_fmt) + { + case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM: + case D3DX_PIXEL_FORMAT_R8G8B8A8_UNORM_SRGB: + *save_fmt = D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM; + break; + + case D3DX_PIXEL_FORMAT_R16G16B16A16_FLOAT: + case D3DX_PIXEL_FORMAT_R32G32B32A32_FLOAT: + case D3DX_PIXEL_FORMAT_R16_UNORM: + FIXME("Encoding of BMP files to WICPixelFormat64bppRGBAFixedPoint unimplemented, using default instead.\n"); + *save_fmt = D3DX_PIXEL_FORMAT_B8G8R8X8_UNORM; + break; + + default: + return E_FAIL; + } + break; + + case D3DX11_IFF_WMP: + FIXME("Saving to WMP is currently unimplemented.\n"); + return E_NOTIMPL; + + default: + assert(0); + break; + } + + return S_OK; +} + +HRESULT WINAPI D3DX11SaveTextureToMemory(ID3D11DeviceContext *context, ID3D11Resource *texture, + D3DX11_IMAGE_FILE_FORMAT format, ID3D10Blob **buffer, UINT flags) +{ + const struct pixel_format_desc *fmt_desc = NULL; + struct d3d11_texture src_tex = { 0 }; + enum d3dx_resource_type d3dx_rtype; + D3D11_RESOURCE_DIMENSION rsrc_dim; + struct d3dx_image image = { 0 }; + ID3D10Blob *out_buffer; + unsigned int i, j; + HRESULT hr; + + TRACE("texture %p, format %u, buffer %p, flags %#x.\n", texture, format, buffer, flags); + + if (!texture || !buffer || format == D3DX11_IFF_GIF) + return E_INVALIDARG; + + if (!context) + return D3DERR_INVALIDCALL; + + out_buffer = *buffer = NULL; + if (format == D3DX11_IFF_WMP) + { + FIXME("Saving to file format %u is currently unimplemented.\n", format); + return E_NOTIMPL; + } + + ID3D11Resource_GetType(texture, &rsrc_dim); + switch (rsrc_dim) + { + case D3D11_RESOURCE_DIMENSION_TEXTURE2D: + d3dx_rtype = D3DX_RESOURCE_TYPE_TEXTURE_2D; + break; + + case D3D11_RESOURCE_DIMENSION_TEXTURE3D: + d3dx_rtype = D3DX_RESOURCE_TYPE_TEXTURE_3D; + break; + + default: + FIXME("Currently only 2D and 3D texture saving is supported.\n"); + return E_NOTIMPL; + } + + if (format != D3DX11_IFF_DDS && rsrc_dim != D3D11_RESOURCE_DIMENSION_TEXTURE2D) + return E_INVALIDARG; + + hr = d3dx_d3d11_texture_init(context, texture, 0, 0, D3D11_MAP_READ, NULL, &src_tex); + if (FAILED(hr)) + return hr; + + if (format != D3DX11_IFF_DDS) + { + enum d3dx_pixel_format_id dst_format; + struct d3dx_pixels src_pixels; + + hr = d3dx11_get_save_format_for_file_format(format, src_tex.fmt_desc->format, &dst_format); + if (FAILED(hr)) + goto exit; + + hr = d3dx_d3d11_texture_map(&src_tex, 0, 0, &src_pixels); + if (FAILED(hr)) + goto exit; + + hr = d3dx_save_pixels_to_memory(&src_pixels, src_tex.fmt_desc, (enum d3dx_image_file_format)format, dst_format, + &out_buffer); + d3dx_d3d11_texture_unmap(&src_tex, 0, 0); + if (SUCCEEDED(hr)) + *buffer = out_buffer; + else + WARN("Failed with hr %#lx.\n", hr); + + goto exit; + } + + if (src_tex.is_cubemap) + d3dx_rtype = D3DX_RESOURCE_TYPE_CUBE_TEXTURE; + + hr = d3dx_create_dds_file_blob(src_tex.fmt_desc->format, NULL, d3dx_rtype, &src_tex.texture.size, + src_tex.texture.mip_levels, src_tex.texture.layer_count, TRUE, &out_buffer); + if (FAILED(hr)) + { + FIXME("Failed to create dds file with hr %#lx.\n", hr); + goto exit; + } + + hr = d3dx_image_init(ID3D10Blob_GetBufferPointer(out_buffer), ID3D10Blob_GetBufferSize(out_buffer), &image, 0, + D3DX_IMAGE_SUPPORT_DXT10); + if (FAILED(hr)) + goto exit; + + fmt_desc = get_d3dx_pixel_format_info(image.format); + for (i = 0; i < image.layer_count; ++i) + { + for (j = 0; j < image.mip_levels; ++j) + { + struct d3dx_pixels src_pixels, dst_pixels; + + hr = d3dx_image_get_pixels(&image, i, j, &dst_pixels); + if (FAILED(hr)) + goto exit; + + hr = d3dx_d3d11_texture_map(&src_tex, i, j, &src_pixels); + if (FAILED(hr)) + goto exit; + + hr = d3dx_load_pixels_from_pixels(&dst_pixels, fmt_desc, &src_pixels, src_tex.fmt_desc, D3DX_FILTER_NONE, 0); + d3dx_d3d11_texture_unmap(&src_tex, i, j); + if (FAILED(hr)) + { + WARN("Failed with hr %#lx.\n", hr); + goto exit; + } + } + } + + if (SUCCEEDED(hr)) + *buffer = out_buffer; + +exit: + if (out_buffer && *buffer != out_buffer) + ID3D10Blob_Release(out_buffer); + d3dx_d3d11_texture_release(&src_tex); + return SUCCEEDED(hr) ? S_OK : hr; +} From 1d8aa3c754b070ef73dc076136e6444b390578cf Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 11 Dec 2024 12:53:55 -0500 Subject: [PATCH 0979/2542] d3dx11: Implement D3DX11SaveTextureToFile{A,W}(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx11_43/tests/d3dx11.c | 18 +++++++++++++++ dlls/d3dx11_43/texture.c | 41 ++++++++++++++++++++++++++++++----- dlls/d3dx9_36/d3dx9_private.h | 2 -- dlls/d3dx9_36/d3dx_helpers.c | 20 +++++++++++++++++ dlls/d3dx9_36/d3dx_helpers.h | 4 ++++ dlls/d3dx9_36/util.c | 20 ----------------- 6 files changed, 77 insertions(+), 28 deletions(-) diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index 7caf6b8c8076..faca88f52fc5 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -7501,6 +7501,24 @@ static void test_save_texture(void) D3DX11_IFF_DDS, FALSE); ID3D10Blob_Release(buffer); + hr = D3DX11SaveTextureToFileA(context, (ID3D11Resource *)tex_2d, D3DX11_IFF_DDS, "test_a.dds"); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = D3DX11GetImageInfoFromFileA("test_a.dds", NULL, &img_info, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_DDS, FALSE); + DeleteFileA("test_a.dds"); + + hr = D3DX11SaveTextureToFileW(context, (ID3D11Resource *)tex_2d, D3DX11_IFF_DDS, L"test_w.dds"); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = D3DX11GetImageInfoFromFileW(L"test_w.dds", NULL, &img_info, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_RESOURCE_DIMENSION_TEXTURE2D, + D3DX11_IFF_DDS, FALSE); + DeleteFileW(L"test_w.dds"); + ID3D11Texture2D_Release(tex_2d); CoUninitialize(); diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c index 5e6ccce7a165..ad8984483524 100644 --- a/dlls/d3dx11_43/texture.c +++ b/dlls/d3dx11_43/texture.c @@ -32,19 +32,48 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx); HRESULT WINAPI D3DX11SaveTextureToFileW(ID3D11DeviceContext *context, ID3D11Resource *texture, D3DX11_IMAGE_FILE_FORMAT format, const WCHAR *filename) { - FIXME("context %p, texture %p, format %u, filename %s stub!\n", - context, texture, format, debugstr_w(filename)); + ID3D10Blob *buffer; + HRESULT hr; + + TRACE("context %p, texture %p, format %u, filename %s.\n", context, texture, format, debugstr_w(filename)); + + if (!filename) + return E_FAIL; + + hr = D3DX11SaveTextureToMemory(context, texture, format, &buffer, 0); + if (SUCCEEDED(hr)) + { + hr = write_buffer_to_file(filename, buffer); + ID3D10Blob_Release(buffer); + } - return E_NOTIMPL; + return hr; } HRESULT WINAPI D3DX11SaveTextureToFileA(ID3D11DeviceContext *context, ID3D11Resource *texture, D3DX11_IMAGE_FILE_FORMAT format, const char *filename) { - FIXME("context %p, texture %p, format %u, filename %s stub!\n", - context, texture, format, debugstr_a(filename)); + WCHAR *buffer; + int str_len; + HRESULT hr; - return E_NOTIMPL; + TRACE("context %p, texture %p, format %u, filename %s.\n", context, texture, format, debugstr_a(filename)); + + if (!filename) + return E_FAIL; + + str_len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0); + if (!str_len) + return HRESULT_FROM_WIN32(GetLastError()); + + buffer = malloc(str_len * sizeof(*buffer)); + if (!buffer) + return E_OUTOFMEMORY; + + MultiByteToWideChar(CP_ACP, 0, filename, -1, buffer, str_len); + hr = D3DX11SaveTextureToFileW(context, texture, format, buffer); + free(buffer); + return hr; } HRESULT WINAPI D3DX11GetImageInfoFromFileA(const char *src_file, ID3DX11ThreadPump *pump, D3DX11_IMAGE_INFO *info, diff --git a/dlls/d3dx9_36/d3dx9_private.h b/dlls/d3dx9_36/d3dx9_private.h index 98d01999e36d..6fae64aff717 100644 --- a/dlls/d3dx9_36/d3dx9_private.h +++ b/dlls/d3dx9_36/d3dx9_private.h @@ -50,8 +50,6 @@ extern const struct ID3DXIncludeVtbl d3dx_include_from_file_vtbl; HRESULT map_view_of_file(const WCHAR *filename, void **buffer, DWORD *length); HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, void **buffer, DWORD *length); -HRESULT write_buffer_to_file(const WCHAR *filename, ID3DXBuffer *buffer); - D3DFORMAT d3dformat_from_d3dx_pixel_format_id(enum d3dx_pixel_format_id format); enum d3dx_pixel_format_id d3dx_pixel_format_id_from_d3dformat(D3DFORMAT format); enum d3dx_resource_type d3dx_resource_type_from_d3dresourcetype(D3DRESOURCETYPE type); diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index 75a4d21ba6f3..36781c79e39d 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -3328,6 +3328,26 @@ void get_aligned_rect(uint32_t left, uint32_t top, uint32_t right, uint32_t bott & ~(fmt_desc->block_height - 1), height); } +HRESULT write_buffer_to_file(const WCHAR *dst_filename, ID3DXBlob *buffer) +{ + HRESULT hr = S_OK; + void *buffer_pointer; + DWORD buffer_size; + DWORD bytes_written; + HANDLE file = CreateFileW(dst_filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if (file == INVALID_HANDLE_VALUE) + return HRESULT_FROM_WIN32(GetLastError()); + + buffer_pointer = d3dx_blob_get_buffer_pointer(buffer); + buffer_size = d3dx_blob_get_buffer_size(buffer); + + if (!WriteFile(file, buffer_pointer, buffer_size, &bytes_written, NULL)) + hr = HRESULT_FROM_WIN32(GetLastError()); + + CloseHandle(file); + return hr; +} + /* File/resource loading functions shared amongst d3dx10/d3dx11. */ HRESULT load_file(const WCHAR *path, void **data, DWORD *size) { diff --git a/dlls/d3dx9_36/d3dx_helpers.h b/dlls/d3dx9_36/d3dx_helpers.h index 5b9fda662c97..1f64c8d3c561 100644 --- a/dlls/d3dx9_36/d3dx_helpers.h +++ b/dlls/d3dx9_36/d3dx_helpers.h @@ -34,6 +34,7 @@ #define ID3DXBlob ID3DXBuffer #define d3dx_create_blob(size, blob) D3DXCreateBuffer(size, blob) #define d3dx_blob_get_buffer_pointer(blob) ID3DXBuffer_GetBufferPointer(blob) +#define d3dx_blob_get_buffer_size(blob) ID3DXBuffer_GetBufferSize(blob) #define d3dx_blob_release(blob) ID3DXBuffer_Release(blob) #endif /* D3DX_D3D_VERSION == 9 */ @@ -66,6 +67,7 @@ #define ID3DXBlob ID3D10Blob #define d3dx_create_blob(size, blob) D3D10CreateBlob(size, blob) #define d3dx_blob_get_buffer_pointer(blob) ID3D10Blob_GetBufferPointer(blob) +#define d3dx_blob_get_buffer_size(blob) ID3D10Blob_GetBufferSize(blob) #define d3dx_blob_release(blob) ID3D10Blob_Release(blob) enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dxgi_format(DXGI_FORMAT format); @@ -103,6 +105,7 @@ DXGI_FORMAT dxgi_format_from_dxt10_dds_d3dx_pixel_format_id(enum d3dx_pixel_form #define ID3DXBlob ID3D10Blob #define d3dx_create_blob(size, blob) D3DCreateBlob(size, blob) #define d3dx_blob_get_buffer_pointer(blob) ID3D10Blob_GetBufferPointer(blob) +#define d3dx_blob_get_buffer_size(blob) ID3D10Blob_GetBufferSize(blob) #define d3dx_blob_release(blob) ID3D10Blob_Release(blob) enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dxgi_format(DXGI_FORMAT format); @@ -550,6 +553,7 @@ float float_16_to_32(const unsigned short in); /* debug helpers */ const char *debug_d3dx_image_file_format(enum d3dx_image_file_format format); +HRESULT write_buffer_to_file(const WCHAR *filename, ID3DXBlob *buffer); HRESULT load_file(const WCHAR *path, void **data, DWORD *size); HRESULT load_resource(HMODULE module, HRSRC rsrc, void **data, DWORD *size); HRESULT load_resourceW(HMODULE module, const WCHAR *resource, void **data, DWORD *size); diff --git a/dlls/d3dx9_36/util.c b/dlls/d3dx9_36/util.c index 6e55c02ac126..b68421ff002b 100644 --- a/dlls/d3dx9_36/util.c +++ b/dlls/d3dx9_36/util.c @@ -233,26 +233,6 @@ HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, void **buffer, return S_OK; } -HRESULT write_buffer_to_file(const WCHAR *dst_filename, ID3DXBuffer *buffer) -{ - HRESULT hr = S_OK; - void *buffer_pointer; - DWORD buffer_size; - DWORD bytes_written; - HANDLE file = CreateFileW(dst_filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if (file == INVALID_HANDLE_VALUE) - return HRESULT_FROM_WIN32(GetLastError()); - - buffer_pointer = ID3DXBuffer_GetBufferPointer(buffer); - buffer_size = ID3DXBuffer_GetBufferSize(buffer); - - if (!WriteFile(file, buffer_pointer, buffer_size, &bytes_written, NULL)) - hr = HRESULT_FROM_WIN32(GetLastError()); - - CloseHandle(file); - return hr; -} - /************************************************************ * get_format_info * From a484282fca14407f86ce4637753572c8397ad8b3 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 11 Dec 2024 13:00:03 -0500 Subject: [PATCH 0980/2542] d3dx10: Implement D3DX10SaveTextureToFile{A,W}(). Signed-off-by: Connor McAdams CW-Bug-Id: #20442 CW-Bug-Id: #23084 CW-Bug-Id: #23301 --- dlls/d3dx10_43/tests/d3dx10.c | 18 ++++++++++++++++ dlls/d3dx10_43/texture.c | 39 +++++++++++++++++++++++++++++++---- 2 files changed, 53 insertions(+), 4 deletions(-) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 0c301bf51986..52eebc355736 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -9090,6 +9090,24 @@ static void test_save_texture(void) D3DX10_IFF_DDS, FALSE); ID3D10Blob_Release(buffer); + hr = D3DX10SaveTextureToFileA((ID3D10Resource *)tex_2d, D3DX10_IFF_DDS, "test_a.dds"); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = D3DX10GetImageInfoFromFileA("test_a.dds", NULL, &img_info, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, + D3DX10_IFF_DDS, FALSE); + DeleteFileA("test_a.dds"); + + hr = D3DX10SaveTextureToFileW((ID3D10Resource *)tex_2d, D3DX10_IFF_DDS, L"test_w.dds"); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = D3DX10GetImageInfoFromFileW(L"test_w.dds", NULL, &img_info, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, + D3DX10_IFF_DDS, FALSE); + DeleteFileW(L"test_w.dds"); + ID3D10Texture2D_Release(tex_2d); CoUninitialize(); diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 818af3ff1ba9..0ae7c0a654b0 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -1480,16 +1480,47 @@ HRESULT WINAPI D3DX10FilterTexture(ID3D10Resource *texture, UINT src_level, UINT HRESULT WINAPI D3DX10SaveTextureToFileW(ID3D10Resource *texture, D3DX10_IMAGE_FILE_FORMAT format, const WCHAR *filename) { - FIXME("texture %p, format %u, filename %s stub!\n", texture, format, debugstr_w(filename)); + ID3D10Blob *buffer; + HRESULT hr; + + TRACE("texture %p, format %u, filename %s stub!\n", texture, format, debugstr_w(filename)); + + if (!filename) + return E_FAIL; + + hr = D3DX10SaveTextureToMemory(texture, format, &buffer, 0); + if (SUCCEEDED(hr)) + { + hr = write_buffer_to_file(filename, buffer); + ID3D10Blob_Release(buffer); + } - return E_NOTIMPL; + return hr; } HRESULT WINAPI D3DX10SaveTextureToFileA(ID3D10Resource *texture, D3DX10_IMAGE_FILE_FORMAT format, const char *filename) { - FIXME("texture %p, format %u, filename %s stub!\n", texture, format, debugstr_a(filename)); + WCHAR *buffer; + int str_len; + HRESULT hr; - return E_NOTIMPL; + TRACE("texture %p, format %u, filename %s.\n", texture, format, debugstr_a(filename)); + + if (!filename) + return E_FAIL; + + str_len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0); + if (!str_len) + return HRESULT_FROM_WIN32(GetLastError()); + + buffer = malloc(str_len * sizeof(*buffer)); + if (!buffer) + return E_OUTOFMEMORY; + + MultiByteToWideChar(CP_ACP, 0, filename, -1, buffer, str_len); + hr = D3DX10SaveTextureToFileW(texture, format, buffer); + free(buffer); + return hr; } static HRESULT d3dx10_get_save_format_for_file_format(D3DX10_IMAGE_FILE_FORMAT iff, enum d3dx_pixel_format_id src_fmt, From 36551f7afe231892133baf2aa010f2f8ef8fc7bb Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Fri, 13 Dec 2024 10:29:29 -0500 Subject: [PATCH 0981/2542] d3dx: Ignore DDS_PF_ALPHA when matching DDS_PF_FOURCC DDS files. Prevents a hang in Just Cause 2. Signed-off-by: Connor McAdams --- dlls/d3dx9_36/d3dx_helpers.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index 36781c79e39d..8db599541a20 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -276,7 +276,9 @@ static enum d3dx_pixel_format_id d3dx_pixel_format_id_from_dds_pixel_format(cons { const struct dds_pixel_format *dds_pf = &dds_pixel_formats[i].dds_pixel_format; - if (pixel_format->flags != dds_pf->flags) + if (pixel_format->flags != dds_pf->flags + /* Alpha flag might also be set alongside fourCC. */ + && ((pixel_format->flags & DDS_PF_FOURCC) != dds_pf->flags)) continue; switch (pixel_format->flags & ~DDS_PF_ALPHA) From 7e2ca02bc17b3f7b124dd31d5f43f5c2af6ae666 Mon Sep 17 00:00:00 2001 From: Charlotte Pabst Date: Wed, 13 Nov 2024 02:32:36 +0100 Subject: [PATCH 0982/2542] mshtml: HACK: Always set document compatibility mode to IE11 in FFXIV Online. CW-Bug-Id: #24432 --- dlls/mshtml/mutation.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c index 6cc969cf634c..a135ea080fbf 100644 --- a/dlls/mshtml/mutation.c +++ b/dlls/mshtml/mutation.c @@ -438,6 +438,7 @@ compat_mode_t lock_document_mode(HTMLDocumentNode *doc) static void set_document_mode(HTMLDocumentNode *doc, compat_mode_t document_mode, BOOL emulate_mode, BOOL lock) { compat_mode_t max_compat_mode; + const char *sgi; if(doc->document_mode_locked) { WARN("attempting to set document mode %d on locked document %p\n", document_mode, doc); @@ -455,6 +456,9 @@ static void set_document_mode(HTMLDocumentNode *doc, compat_mode_t document_mode document_mode = max_compat_mode; } + if ((sgi = getenv("SteamGameId")) && (!strcmp(sgi, "39210"))) + document_mode = COMPAT_MODE_IE11; + doc->document_mode = document_mode; doc->emulate_mode = emulate_mode; if(lock) From 6dd88f2f1e0bbbd9bef08442d3b06acc95534687 Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Sat, 25 Feb 2023 13:15:16 -0600 Subject: [PATCH 0983/2542] explorer: Add an environment variable setting to start Xalia. --- programs/explorer/desktop.c | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index bde0fd14ad28..f4edba3f7fa5 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -1225,6 +1225,46 @@ static HANDLE start_tabtip_process(void) return pi.hProcess; } +static void start_xalia_process(void) +{ + PROCESS_INFORMATION pi; + STARTUPINFOW si = { sizeof(si) }; + WCHAR use_envvar[2]; + LPWSTR path; + LPCWSTR path_suffix = L"/../xalia/xalia.exe"; + DWORD ret, buffersize; + + /* check if xalia is enabled */ + ret = GetEnvironmentVariableW(L"PROTON_USE_XALIA", use_envvar, ARRAY_SIZE(use_envvar)); + if (!ret || (ret <= ARRAY_SIZE(use_envvar) && lstrcmpW(use_envvar, L"0") == 0)) + return; + + /* locate xalia.exe */ + ret = GetEnvironmentVariableW(L"WINEDATADIR", NULL, 0); + if (ret == 0) + return; + + buffersize = ret + lstrlenW(path_suffix); + path = HeapAlloc(GetProcessHeap(), 0, buffersize * sizeof(*path)); + + GetEnvironmentVariableW(L"WINEDATADIR", path, ret); + if (!memcmp(path, L"\\??\\", 8)) path[1] = '\\'; /* change \??\ into \\?\ */ + lstrcatW(path, path_suffix); + + /* setup environment */ + SetEnvironmentVariableW(L"XALIA_WINE_SYSTEM_PROCESS", L"1"); + + if (!CreateProcessW(path, NULL, + NULL, NULL, TRUE, DETACHED_PROCESS, NULL, NULL, &si, &pi)) + { + WINE_ERR("Couldn't start xalia.exe: error %lu\n", GetLastError()); + return; + } + CloseHandle(pi.hThread); + CloseHandle(pi.hProcess); + return; +} + /* main desktop management function */ void manage_desktop( WCHAR *arg ) { @@ -1362,6 +1402,8 @@ void manage_desktop( WCHAR *arg ) /* FIXME: hack, run tabtip.exe on startup. */ tabtip = start_tabtip_process(); + start_xalia_process(); + TRACE( "desktop message loop starting on hwnd %p\n", hwnd ); while (GetMessageW( &msg, 0, 0, 0 )) DispatchMessageW( &msg ); TRACE( "desktop message loop exiting for hwnd %p\n", hwnd ); From aa4b0b84bc583c7157c1f25884d80c1b48aafaf2 Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Wed, 8 Mar 2023 15:19:51 -0600 Subject: [PATCH 0984/2542] winex11.drv: Mark Xalia overlay window as a gamescope overlay. --- dlls/winex11.drv/window.c | 25 +++++++++++++++++++++++++ dlls/winex11.drv/x11drv.h | 1 + dlls/winex11.drv/x11drv_main.c | 1 + 3 files changed, 27 insertions(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index d54b2650dc51..e4aee44f4695 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2145,6 +2145,29 @@ Window create_client_window( HWND hwnd, RECT client_rect, const XVisualInfo *vis } +void set_gamescope_overlay_prop( Display *display, Window window, HWND hwnd ) +{ + static const WCHAR class_name[] = {'X','a','l','i','a','O','v','e','r','l','a','y','B','o','x',0}; + WCHAR class_name_buf[16]; + UNICODE_STRING class_name_str; + INT ret; + + class_name_str.Buffer = class_name_buf; + class_name_str.MaximumLength = sizeof(class_name_buf); + + ret = NtUserGetClassName( hwnd, FALSE, &class_name_str ); + + if (ret && !wcscmp( class_name_buf, class_name )) { + DWORD one = 1; + + TRACE( "setting GAMESCOPE_XALIA_OVERLAY on window %lx, hwnd %p\n", window, hwnd ); + + XChangeProperty( display, window, x11drv_atom(GAMESCOPE_XALIA_OVERLAY), XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)&one, sizeof(one) / 4 ); + } +} + + /********************************************************************** * create_whole_window * @@ -2199,6 +2222,8 @@ static void create_whole_window( struct x11drv_win_data *data ) XSaveContext( data->display, data->whole_window, winContext, (char *)data->hwnd ); NtUserSetProp( data->hwnd, whole_window_prop, (HANDLE)data->whole_window ); + set_gamescope_overlay_prop( data->display, data->whole_window, data->hwnd ); + /* set the window text */ if (!NtUserInternalGetWindowText( data->hwnd, text, ARRAY_SIZE( text ))) text[0] = 0; sync_window_text( data->display, data->whole_window, text ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 15f5e1efab58..5d81c32bbbb1 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -564,6 +564,7 @@ enum x11drv_atoms XATOM_text_uri_list, XATOM_GAMESCOPE_FOCUSED_APP, XATOM_GAMESCOPE_DISPLAY_EDID_PATH, + XATOM_GAMESCOPE_XALIA_OVERLAY, NB_XATOMS }; diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 5203092a6726..c6183a8c1d2d 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -201,6 +201,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "text/uri-list", "GAMESCOPE_FOCUSED_APP", "GAMESCOPE_DISPLAY_EDID_PATH", + "GAMESCOPE_XALIA_OVERLAY", }; /*********************************************************************** From 3192fb8542dc2fdf5ca6fb876a42b39525951068 Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Sat, 19 Aug 2023 14:35:34 -0500 Subject: [PATCH 0985/2542] win32u: Implement cross-process GetScrollBarInfo. --- dlls/win32u/message.c | 11 +++++++++++ dlls/win32u/scroll.c | 5 ++++- dlls/win32u/win32u_private.h | 1 + include/ntuser.h | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index c4ec26c1ccd0..ab7817644dc6 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -727,6 +727,7 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa if (!get_buffer_space( buffer, sizeof(SCROLLINFO), buffer_size )) return FALSE; break; case SBM_GETSCROLLBARINFO: + case WM_WINE_GETSCROLLBARINFO: if (!get_buffer_space( buffer, sizeof(SCROLLBARINFO), buffer_size )) return FALSE; break; case EM_GETSEL: @@ -1125,6 +1126,7 @@ static size_t pack_message( HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara push_data( data, (SCROLLINFO *)lparam, sizeof(SCROLLINFO) ); return sizeof(SCROLLINFO); case SBM_GETSCROLLBARINFO: + case WM_WINE_GETSCROLLBARINFO: { const SCROLLBARINFO *info = (const SCROLLBARINFO *)lparam; size_t size = min( info->cbSize, sizeof(SCROLLBARINFO) ); @@ -1361,6 +1363,10 @@ static void pack_reply( HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, case SBM_GETSCROLLINFO: push_data( data, (SCROLLINFO *)lparam, sizeof(SCROLLINFO) ); break; + case SBM_GETSCROLLBARINFO: + case WM_WINE_GETSCROLLBARINFO: + push_data( data, (SCROLLBARINFO *)lparam, sizeof(SCROLLBARINFO) ); + break; case EM_GETRECT: case LB_GETITEMRECT: case CB_GETDROPPEDCONTROLRECT: @@ -1502,6 +1508,7 @@ static void unpack_reply( HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, memcpy( (SCROLLINFO *)lparam, buffer, min( sizeof(SCROLLINFO), size )); break; case SBM_GETSCROLLBARINFO: + case WM_WINE_GETSCROLLBARINFO: memcpy( (SCROLLBARINFO *)lparam, buffer, min( sizeof(SCROLLBARINFO), size )); break; case EM_GETRECT: @@ -1706,6 +1713,7 @@ size_t user_message_size( HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, size = sizeof(SCROLLINFO); break; case SBM_GETSCROLLBARINFO: + case WM_WINE_GETSCROLLBARINFO: size = sizeof(SCROLLBARINFO); break; case EM_GETSEL: @@ -1948,6 +1956,7 @@ static void copy_user_result( void *buffer, size_t size, LRESULT result, UINT me copy_size = sizeof(SCROLLINFO); break; case SBM_GETSCROLLBARINFO: + case WM_WINE_GETSCROLLBARINFO: copy_size = sizeof(SCROLLBARINFO); break; case EM_GETSEL: @@ -2151,6 +2160,8 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR case WM_WINE_UPDATEWINDOWSTATE: update_window_state( hwnd ); return 0; + case WM_WINE_GETSCROLLBARINFO: + return get_scroll_bar_info( hwnd, (LONG)wparam, (SCROLLBARINFO *)lparam ); default: if (msg >= WM_WINE_FIRST_DRIVER_MSG && msg <= WM_WINE_LAST_DRIVER_MSG) return user_driver->pWindowMessage( hwnd, msg, wparam, lparam ); diff --git a/dlls/win32u/scroll.c b/dlls/win32u/scroll.c index fce07980dcff..570b81ca9a3a 100644 --- a/dlls/win32u/scroll.c +++ b/dlls/win32u/scroll.c @@ -1047,7 +1047,7 @@ static int set_scroll_info( HWND hwnd, int bar, const SCROLLINFO *info, BOOL red return ret; /* Return current position */ } -static BOOL get_scroll_bar_info( HWND hwnd, LONG id, SCROLLBARINFO *info ) +BOOL get_scroll_bar_info( HWND hwnd, LONG id, SCROLLBARINFO *info ) { struct scroll_info *scroll; int bar, dummy; @@ -1066,6 +1066,9 @@ static BOOL get_scroll_bar_info( HWND hwnd, LONG id, SCROLLBARINFO *info ) /* handle invalid data structure */ if (info->cbSize != sizeof(*info)) return FALSE; + if (bar != SB_CTL && !is_current_thread_window( hwnd )) + return send_message( hwnd, WM_WINE_GETSCROLLBARINFO, (WPARAM)id, (LPARAM)info ); + get_scroll_bar_rect( hwnd, bar, &info->rcScrollBar, &dummy, &info->dxyLineButton, &info->xyThumbTop ); /* rcScrollBar needs to be in screen coordinates */ diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index af9f675c5001..bec42179931b 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -155,6 +155,7 @@ extern BOOL process_rawinput_message( MSG *msg, UINT hw_id, const struct hardwar /* scroll.c */ extern void draw_nc_scrollbar( HWND hwnd, HDC hdc, BOOL draw_horizontal, BOOL draw_vertical ); +extern BOOL get_scroll_bar_info( HWND hwnd, LONG id, SCROLLBARINFO *info ); extern BOOL get_scroll_info( HWND hwnd, INT bar, SCROLLINFO *info ); extern void handle_scroll_event( HWND hwnd, INT bar, UINT msg, POINT pt ); extern LRESULT scroll_bar_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, diff --git a/include/ntuser.h b/include/ntuser.h index dec3e3502402..cdda35ede11d 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -614,6 +614,7 @@ enum wine_internal_message WM_WINE_IME_NOTIFY, WM_WINE_WINDOW_STATE_CHANGED, WM_WINE_UPDATEWINDOWSTATE, + WM_WINE_GETSCROLLBARINFO, WM_WINE_FIRST_DRIVER_MSG = 0x80001000, /* range of messages reserved for the USER driver */ WM_WINE_CLIPCURSOR = 0x80001ff0, /* internal driver notification messages */ WM_WINE_SETCURSOR, From 89cc0cc0d3b59885496af4d316680d0c340147d7 Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Sat, 19 Aug 2023 15:06:50 -0500 Subject: [PATCH 0986/2542] win32u: Implement cross-process GetScrollInfo. --- dlls/win32u/message.c | 8 ++++++++ dlls/win32u/scroll.c | 8 +++++++- include/ntuser.h | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index ab7817644dc6..dd9f05fcdcac 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -724,6 +724,7 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa minsize = sizeof(SCROLLINFO); break; case SBM_GETSCROLLINFO: + case WM_WINE_GETSCROLLINFO: if (!get_buffer_space( buffer, sizeof(SCROLLINFO), buffer_size )) return FALSE; break; case SBM_GETSCROLLBARINFO: @@ -1123,6 +1124,7 @@ static size_t pack_message( HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara push_data( data, (SCROLLINFO *)lparam, sizeof(SCROLLINFO) ); return 0; case SBM_GETSCROLLINFO: + case WM_WINE_GETSCROLLINFO: push_data( data, (SCROLLINFO *)lparam, sizeof(SCROLLINFO) ); return sizeof(SCROLLINFO); case SBM_GETSCROLLBARINFO: @@ -1361,6 +1363,7 @@ static void pack_reply( HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, break; } case SBM_GETSCROLLINFO: + case WM_WINE_GETSCROLLINFO: push_data( data, (SCROLLINFO *)lparam, sizeof(SCROLLINFO) ); break; case SBM_GETSCROLLBARINFO: @@ -1505,6 +1508,7 @@ static void unpack_reply( HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, } break; case SBM_GETSCROLLINFO: + case WM_WINE_GETSCROLLINFO: memcpy( (SCROLLINFO *)lparam, buffer, min( sizeof(SCROLLINFO), size )); break; case SBM_GETSCROLLBARINFO: @@ -1710,6 +1714,7 @@ size_t user_message_size( HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, break; case SBM_SETSCROLLINFO: case SBM_GETSCROLLINFO: + case WM_WINE_GETSCROLLINFO: size = sizeof(SCROLLINFO); break; case SBM_GETSCROLLBARINFO: @@ -1953,6 +1958,7 @@ static void copy_user_result( void *buffer, size_t size, LRESULT result, UINT me break; case SBM_SETSCROLLINFO: case SBM_GETSCROLLINFO: + case WM_WINE_GETSCROLLINFO: copy_size = sizeof(SCROLLINFO); break; case SBM_GETSCROLLBARINFO: @@ -2162,6 +2168,8 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR return 0; case WM_WINE_GETSCROLLBARINFO: return get_scroll_bar_info( hwnd, (LONG)wparam, (SCROLLBARINFO *)lparam ); + case WM_WINE_GETSCROLLINFO: + return get_scroll_info( hwnd, (int)wparam, (SCROLLINFO *)lparam ); default: if (msg >= WM_WINE_FIRST_DRIVER_MSG && msg <= WM_WINE_LAST_DRIVER_MSG) return user_driver->pWindowMessage( hwnd, msg, wparam, lparam ); diff --git a/dlls/win32u/scroll.c b/dlls/win32u/scroll.c index 570b81ca9a3a..48958edc204a 100644 --- a/dlls/win32u/scroll.c +++ b/dlls/win32u/scroll.c @@ -873,7 +873,13 @@ BOOL get_scroll_info( HWND hwnd, int bar, SCROLLINFO *info ) struct scroll_info *scroll; /* handle invalid data structure */ - if (!validate_scroll_info( info ) || !(scroll = get_scroll_info_ptr( hwnd, bar, FALSE ))) + if (!validate_scroll_info( info )) + return FALSE; + + if (bar != SB_CTL && !is_current_thread_window( hwnd )) + return send_message( hwnd, WM_WINE_GETSCROLLINFO, (WPARAM)bar, (LPARAM)info ); + + if (!(scroll = get_scroll_info_ptr( hwnd, bar, FALSE ))) return FALSE; /* fill in the desired scroll info structure */ diff --git a/include/ntuser.h b/include/ntuser.h index cdda35ede11d..a0bd75b37b3b 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -615,6 +615,7 @@ enum wine_internal_message WM_WINE_WINDOW_STATE_CHANGED, WM_WINE_UPDATEWINDOWSTATE, WM_WINE_GETSCROLLBARINFO, + WM_WINE_GETSCROLLINFO, WM_WINE_FIRST_DRIVER_MSG = 0x80001000, /* range of messages reserved for the USER driver */ WM_WINE_CLIPCURSOR = 0x80001ff0, /* internal driver notification messages */ WM_WINE_SETCURSOR, From fd3e1ca3d6a5527ab38dff0504be210be84a29db Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Fri, 15 Mar 2024 16:30:57 +0000 Subject: [PATCH 0987/2542] win32u: Implement winevents for scrollbars. --- dlls/win32u/scroll.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/win32u/scroll.c b/dlls/win32u/scroll.c index 48958edc204a..84b935997435 100644 --- a/dlls/win32u/scroll.c +++ b/dlls/win32u/scroll.c @@ -168,6 +168,16 @@ static BOOL show_scroll_bar( HWND hwnd, int bar, BOOL show_horz, BOOL show_vert /* frame has been changed, let the window redraw itself */ NtUserSetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED ); + + if ((set_bits & WS_HSCROLL) && !(old_style & WS_HSCROLL)) + NtUserNotifyWinEvent( EVENT_OBJECT_SHOW, hwnd, OBJID_HSCROLL, 0 ); + if ((set_bits & WS_VSCROLL) && !(old_style & WS_VSCROLL)) + NtUserNotifyWinEvent( EVENT_OBJECT_SHOW, hwnd, OBJID_VSCROLL, 0 ); + if ((clear_bits & WS_HSCROLL) && (old_style & WS_HSCROLL)) + NtUserNotifyWinEvent( EVENT_OBJECT_HIDE, hwnd, OBJID_HSCROLL, 0 ); + if ((clear_bits & WS_VSCROLL) && (old_style & WS_VSCROLL)) + NtUserNotifyWinEvent( EVENT_OBJECT_HIDE, hwnd, OBJID_VSCROLL, 0 ); + return TRUE; } return FALSE; /* no frame changes */ From b28812cf2b70b55e2daa2d023c4f79fc43b2c3d2 Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Fri, 24 May 2024 18:20:18 +0000 Subject: [PATCH 0988/2542] win32u: Send EVENT_SYSTEM_FOREGROUND in another case. CW-Bug-Id: #23779 EVENT_SYSTEM_FOREGROUND is sent by set_active_window, but in some cases the active window is set before the foreground window, meaning the foreground window hasn't changed yet at the time of the event. This is most likely wrong, as it leads to duplicate EVENT_SYSTEM_FOREGROUND events, but solving it correctly is a thorny problem that will require tests. --- dlls/win32u/input.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index f8d30d494c73..680d40c74316 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2137,7 +2137,10 @@ BOOL set_foreground_window( HWND hwnd, BOOL mouse ) /* already active, set_active_window will do no nothing */ if (!send_msg_new && hwnd == get_active_window()) + { send_message( hwnd, WM_NCACTIVATE, TRUE, (LPARAM)hwnd ); + NtUserNotifyWinEvent( EVENT_SYSTEM_FOREGROUND, hwnd, 0, 0 ); + } if (send_msg_new) /* new window belongs to other thread */ NtUserPostMessage( hwnd, WM_WINE_SETACTIVEWINDOW, (WPARAM)hwnd, 0 ); From 856ad46c96c60b409dc84dfa311fff54807d539e Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Wed, 31 Jul 2024 18:32:18 +0000 Subject: [PATCH 0989/2542] user32: Handle WM_GETOBJECT in buttons. This is a hack. We should implement RealGetWindowClass instead. --- dlls/user32/button.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/user32/button.c b/dlls/user32/button.c index ab6787899cb1..a5c509bbd2d8 100644 --- a/dlls/user32/button.c +++ b/dlls/user32/button.c @@ -374,6 +374,11 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, case WM_GETFONT: return (LRESULT)get_button_font( hWnd ); + case WM_GETOBJECT: + if ((LONG)lParam == OBJID_QUERYCLASSNAMEIDX) + return 0x10002; + break; + case WM_SETFOCUS: TRACE("WM_SETFOCUS %p\n",hWnd); set_button_state( hWnd, get_button_state(hWnd) | BST_FOCUS ); From 92d82a8306e266ba678bd91877c349cd489a6fc7 Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Wed, 31 Jul 2024 18:44:54 +0000 Subject: [PATCH 0990/2542] win32u: Implement EVENT_OBJECT_NAMECHANGE. --- dlls/win32u/defwnd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index 06b81254fc8f..552360e1dcf7 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -2652,6 +2652,8 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, case WM_SETTEXT: result = set_window_text( hwnd, (void *)lparam, ansi ); + if (result) + NtUserNotifyWinEvent( EVENT_OBJECT_NAMECHANGE, hwnd, OBJID_WINDOW, 0 ); if (result && (get_window_long( hwnd, GWL_STYLE ) & WS_CAPTION) == WS_CAPTION) handle_nc_paint( hwnd , (HRGN)1 ); /* repaint caption */ break; From e3dfb1c6dd7d9ab2a52574bb6be7cf089c25b11c Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Sat, 28 Sep 2024 17:34:29 +0000 Subject: [PATCH 0991/2542] user32: Respond to OBJID_QUERYCLASSNAMEIDX in combo boxes. This is a hack. We should implement RealGetWindowClass instead. CW-Bug-Id: #24314 --- dlls/user32/combo.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/user32/combo.c b/dlls/user32/combo.c index 6afd841f82a8..25b6888de0e4 100644 --- a/dlls/user32/combo.c +++ b/dlls/user32/combo.c @@ -1897,6 +1897,11 @@ LRESULT ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM lPar return SendMessageW(lphc->owner, message, wParam, lParam); break; + case WM_GETOBJECT: + if ((LONG)lParam == OBJID_QUERYCLASSNAMEIDX) + return 0x10005; + break; + /* Combo messages */ case CB_ADDSTRING: From 1eddf2ee3575f1fc8a906ebd7d7d890e4e318634 Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Sat, 28 Sep 2024 17:42:26 +0000 Subject: [PATCH 0992/2542] comctl32: Handle OBJID_QUERYCLASSNAMEIDX in trackbars. CW-Bug-Id: #24314 --- dlls/comctl32/trackbar.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c index f2cb2a07a8df..936f88c9fbe7 100644 --- a/dlls/comctl32/trackbar.c +++ b/dlls/comctl32/trackbar.c @@ -2012,6 +2012,11 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_GETDLGCODE: return DLGC_WANTARROWS; + case WM_GETOBJECT: + if ((LONG)lParam == OBJID_QUERYCLASSNAMEIDX) + return 0x10012; + return 0; + case WM_KEYDOWN: return TRACKBAR_KeyDown (infoPtr, (INT)wParam); From dc3f28561a698874f48b20214b466895efb1f9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 22 Nov 2022 11:08:22 +0100 Subject: [PATCH 0993/2542] HACK: proton: ntdll: Export a function to set a Unix environment variable --- dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/signal_arm64ec.c | 1 + dlls/ntdll/unix/env.c | 10 ++++++++++ dlls/wow64/system.c | 12 ++++++++++++ include/winternl.h | 1 + 5 files changed, 25 insertions(+) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 7c1be53a94d3..a8aa3a7e9949 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1745,6 +1745,7 @@ @ extern -private __wine_unix_call_dispatcher @ extern -private -arch=arm64ec __wine_unix_call_dispatcher_arm64ec @ extern -private __wine_unixlib_handle +@ stdcall -syscall __wine_set_unix_env(ptr ptr) # Debugging @ stdcall -norelay __wine_dbg_write(ptr long) diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index c2df7d722dff..5ff836ee2dcc 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -583,6 +583,7 @@ DEFINE_SYSCALL(wine_nt_to_unix_file_name, (const OBJECT_ATTRIBUTES *attr, char * DEFINE_SYSCALL(wine_unix_to_nt_file_name, (const char *name, WCHAR *buffer, ULONG *size)) DEFINE_SYSCALL_(BOOL, __wine_needs_override_large_address_aware, (void)) DEFINE_SYSCALL_(unsigned int, __wine_dbg_ftrace, (char *str, unsigned int str_size, unsigned int ctx)) +DEFINE_SYSCALL(__wine_set_unix_env, (const char *var, const char *val)) NTSTATUS SYSCALL_API NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG_PTR zero_bits, SIZE_T *size_ptr, ULONG type, ULONG protect ) diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index 683c636103ee..6419220e4017 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -2515,3 +2515,13 @@ void WINAPI RtlSetLastWin32Error( DWORD err ) #endif teb->LastErrorValue = err; } + + +/********************************************************************** + * __wine_set_unix_env (ntdll.so) + */ +NTSTATUS WINAPI __wine_set_unix_env( const char *var, const char *val ) +{ + setenv(var, val, 1); + return 0; +} diff --git a/dlls/wow64/system.c b/dlls/wow64/system.c index 2f466d869dd5..7e08e4a08a08 100644 --- a/dlls/wow64/system.c +++ b/dlls/wow64/system.c @@ -861,3 +861,15 @@ NTSTATUS WINAPI wow64___wine_needs_override_large_address_aware( UINT * args ) { return __wine_needs_override_large_address_aware(); } + + +/********************************************************************** + * wow64___wine_set_unix_env + */ +NTSTATUS WINAPI wow64___wine_set_unix_env( UINT *args ) +{ + const char *var = get_ptr( &args ); + const char *val = get_ptr( &args ); + + return __wine_set_unix_env( var, val ); +} diff --git a/include/winternl.h b/include/winternl.h index f9f6fb8915b2..862464a6acfb 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -5270,6 +5270,7 @@ NTSYSAPI NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PC /* Wine internal functions */ +NTSYSAPI NTSTATUS WINAPI __wine_set_unix_env( const char *var, const char *val ); NTSYSAPI NTSTATUS WINAPI wine_nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char *nameA, ULONG *size, UINT disposition ); NTSYSAPI NTSTATUS WINAPI wine_unix_to_nt_file_name( const char *name, WCHAR *buffer, ULONG *size ); From 20ccda2439b876ed5e8edcec9be744dfe849cde9 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Wed, 1 Apr 2020 11:47:05 -0500 Subject: [PATCH 0994/2542] winebrowser: Restore original LD_LIBRARY_PATH before calling to system --- dlls/ntdll/unix/env.c | 3 ++- programs/winebrowser/main.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index 6419220e4017..cef5a5b679f6 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -2522,6 +2522,7 @@ void WINAPI RtlSetLastWin32Error( DWORD err ) */ NTSTATUS WINAPI __wine_set_unix_env( const char *var, const char *val ) { - setenv(var, val, 1); + if (!val) unsetenv(var); + else setenv(var, val, 1); return 0; } diff --git a/programs/winebrowser/main.c b/programs/winebrowser/main.c index 24416070152c..738930e39a66 100644 --- a/programs/winebrowser/main.c +++ b/programs/winebrowser/main.c @@ -63,6 +63,17 @@ static char *strdup_unixcp( const WCHAR *str ) return ret; } +static void restore_system_environment(void) +{ + const char* orig_ld_path = getenv("ORIG_LD_LIBRARY_PATH"); + + if (orig_ld_path) + { + __wine_set_unix_env("LD_LIBRARY_PATH", orig_ld_path); + __wine_set_unix_env("ORIG_LD_LIBRARY_PATH", NULL); + } +} + /* try to launch a unix app from a comma separated string of app names */ static int launch_app( const WCHAR *candidates, const WCHAR *argv1 ) { @@ -72,6 +83,11 @@ static int launch_app( const WCHAR *candidates, const WCHAR *argv1 ) if (!(cmdline = strdup_unixcp( argv1 ))) return 1; + /* PROTON HACK: Restore ORIG_LD_LIBRARY_PATH to LD_LIBRARY_PATH. + * System programs may not work correctly with our libraries, in + * particular gio on Ubuntu 19.04 is broken by our libgio. */ + restore_system_environment(); + while (*candidates) { WCHAR **args = CommandLineToArgvW( candidates, &count ); From 9c95e5f53bc88844b40415f07625e7871f56a566 Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Fri, 13 Dec 2024 20:05:57 +0000 Subject: [PATCH 0995/2542] winex11.drv: Do not shape layered windows in Gamescope. The use of xshape doesn't work and actively breaks rendering in Gamescope. --- dlls/winex11.drv/bitblt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 267a42bd4c7b..cecea52ee5aa 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1836,6 +1836,10 @@ static BOOL x11drv_surface_flush( struct window_surface *window_surface, const R if (shape_changed) { + /* HACK: Do not shape layered windows on gamescope */ + if (shape_bits && alpha_mask != 0 && X11DRV_HasWindowManager( "steamcompmgr" )) + shape_bits = 0; + #ifdef HAVE_LIBXSHAPE if (!shape_bits) XShapeCombineMask( gdi_display, surface->window, ShapeBounding, 0, 0, None, ShapeSet ); From 26dee91b96d2be07b3aed043cf062dfdf0e2faa6 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 4 Dec 2024 11:00:05 -0600 Subject: [PATCH 0996/2542] kernelbase: HACK: Force disable direct composition for Willful. CW-Bug-Id: #24547 --- dlls/kernelbase/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 7f49909b417f..692d859a28d9 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -592,6 +592,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd ) } options[] = { + {L"Willful.exe", L" --disable_direct_composition=1"}, {L"Banyu Lintar Angin - Little Storm -.exe", L" --disable_direct_composition=1"}, {L"Super\\Super.exe", L" --disable_direct_composition=1"}, {L"A Raven Monologue.exe", L" --use-angle=d3d9"}, From 2831807064d6d6b00344b70eecab0b13dd438056 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Sat, 21 May 2022 20:01:08 -0500 Subject: [PATCH 0997/2542] winex11.drv: Implement other process window Vulkan rendering. CW-Bug-Id: #20680 --- dlls/winex11.drv/vulkan.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 57dd7f9c645c..02bdd3ee7fea 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -70,6 +70,7 @@ struct x11drv_vulkan_surface BOOL offscreen; HDC hdc_src; HDC hdc_dst; + BOOL other_process; }; static void vulkan_surface_destroy( HWND hwnd, struct x11drv_vulkan_surface *surface ) @@ -108,6 +109,7 @@ static VkResult X11DRV_vulkan_surface_create( HWND hwnd, VkInstance instance, Vk }; struct x11drv_vulkan_surface *surface; BOOL enable_fshack = enable_fullscreen_hack( hwnd, FALSE ); + DWORD hwnd_pid, hwnd_thread_id; TRACE( "%p %p %p %p\n", hwnd, instance, handle, private ); @@ -118,7 +120,33 @@ static VkResult X11DRV_vulkan_surface_create( HWND hwnd, VkInstance instance, Vk } surface->rect = get_client_rect( hwnd, enable_fshack ); - if (!(surface->window = create_client_window( hwnd, surface->rect, &default_visual, default_colormap ))) + hwnd_thread_id = NtUserGetWindowThread(hwnd, &hwnd_pid); + if (hwnd_thread_id && hwnd_pid != GetCurrentProcessId()) + { + XSetWindowAttributes attr; + RECT rect = surface->rect; + unsigned int width, height; + + WARN("Other process window %p.\n", hwnd); + + width = max( rect.right - rect.left, 1 ); + height = max( rect.bottom - rect.top, 1 ); + attr.colormap = default_colormap; + attr.bit_gravity = NorthWestGravity; + attr.win_gravity = NorthWestGravity; + attr.backing_store = NotUseful; + attr.border_pixel = 0; + surface->window = XCreateWindow( gdi_display, get_dummy_parent(), 0, 0, width, height, 0, default_visual.depth, InputOutput, + default_visual.visual, CWBitGravity | CWWinGravity | CWBackingStore | CWColormap | CWBorderPixel, &attr ); + if (surface->window) + { + XMapWindow( gdi_display, surface->window ); + XSync( gdi_display, False ); + surface->other_process = TRUE; + } + } + + if (!surface->window && !(surface->window = create_client_window( hwnd, surface->rect, &default_visual, default_colormap ))) { ERR("Failed to allocate client window for hwnd=%p\n", hwnd); free( surface ); @@ -183,6 +211,7 @@ static void vulkan_surface_update_offscreen( HWND hwnd, struct x11drv_vulkan_sur BOOL offscreen = needs_offscreen_rendering( hwnd, FALSE, FALSE ); struct x11drv_win_data *data; + if (surface->other_process) offscreen = TRUE; if (offscreen == surface->offscreen) return; surface->offscreen = offscreen; From 17ab5d3423bf9174d102f2c3660db34f421323c4 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 22 Jun 2022 13:20:15 -0500 Subject: [PATCH 0998/2542] winex11.drv: Add WINE_DISABLE_VULKAN_OPWR option. CW-Bug-Id: #20680 --- dlls/winex11.drv/vulkan.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 02bdd3ee7fea..c4630a484f67 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -27,6 +27,7 @@ #include "config.h" #include +#include #include #include @@ -100,6 +101,18 @@ static RECT get_client_rect( HWND hwnd, BOOL raw ) return rect; } +static BOOL disable_opwr(void) +{ + static int disable = -1; + + if (disable == -1) + { + const char *e = getenv( "WINE_DISABLE_VULKAN_OPWR" ); + disable = e && atoi( e ); + } + return disable; +} + static VkResult X11DRV_vulkan_surface_create( HWND hwnd, VkInstance instance, VkSurfaceKHR *handle, void **private ) { VkXlibSurfaceCreateInfoKHR info = @@ -129,6 +142,13 @@ static VkResult X11DRV_vulkan_surface_create( HWND hwnd, VkInstance instance, Vk WARN("Other process window %p.\n", hwnd); + if (disable_opwr() && hwnd != NtUserGetDesktopWindow()) + { + ERR( "HACK: Failing surface creation for other process window %p.\n", hwnd ); + free( surface ); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + width = max( rect.right - rect.left, 1 ); height = max( rect.bottom - rect.top, 1 ); attr.colormap = default_colormap; From f258a47db8e32fad8e7782ae55ae526e0e4db569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 1 Dec 2023 21:24:03 +0100 Subject: [PATCH 0999/2542] vrclient: winevulkan: Add struct unwrappers for vrclient. --- dlls/winevulkan/vulkan.c | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 754cdd981c81..78c9a29bf958 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -962,6 +962,7 @@ static VkResult wine_vk_instance_init_physical_devices(struct wine_instance *obj res = wine_vk_physical_device_init(phys_dev, host_physical_devices[i], &client_instance->phys_devs[i], instance); if (res != VK_SUCCESS) goto err; + TRACE("added host_physical_devices[i] %p.\n", host_physical_devices[i]); } object->phys_dev_count = phys_dev_count; @@ -4636,3 +4637,49 @@ VkResult wine_wine_vkReleaseKeyedMutex(VkDevice device, VkDeviceMemory memory, u { return release_keyed_mutex(vulkan_device_from_handle(device), wine_device_memory_from_handle(memory), key, NULL); } + +DECLSPEC_EXPORT VkDevice __wine_get_native_VkDevice(VkDevice handle) +{ + struct vulkan_device *device = vulkan_device_from_handle(handle); + + return device->host.device; +} + +DECLSPEC_EXPORT VkInstance __wine_get_native_VkInstance(VkInstance handle) +{ + struct vulkan_instance *instance = vulkan_instance_from_handle(handle); + + return instance->host.instance; +} + +DECLSPEC_EXPORT VkPhysicalDevice __wine_get_native_VkPhysicalDevice(VkPhysicalDevice handle) +{ + struct vulkan_physical_device *phys_dev; + + if (!handle) return NULL; + + phys_dev = vulkan_physical_device_from_handle(handle); + return phys_dev->host.physical_device; +} + +DECLSPEC_EXPORT VkQueue __wine_get_native_VkQueue(VkQueue handle) +{ + struct vulkan_queue *queue = vulkan_queue_from_handle(handle); + + return queue->host.queue; +} + +DECLSPEC_EXPORT VkPhysicalDevice __wine_get_wrapped_VkPhysicalDevice(VkInstance handle, VkPhysicalDevice native_phys_dev) +{ + struct wine_instance *instance = wine_instance_from_handle(handle); + unsigned int i; + + for (i = 0; i < instance->phys_dev_count; ++i) + { + if (instance->phys_devs[i].obj.host.physical_device == native_phys_dev) + return instance->phys_devs[i].obj.client.physical_device; + } + + ERR("Unknown native physical device: %p, instance %p, handle %p\n", native_phys_dev, instance, handle); + return NULL; +} From afb5af3630f4e7dd0a32fdc6e1f457485a5f481e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 18 Dec 2024 22:43:23 +0100 Subject: [PATCH 1000/2542] winegstreamer/media-converter: Initialize read_size to 0 for errors and EOD cases. --- dlls/winegstreamer/media-converter/fossilize.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/winegstreamer/media-converter/fossilize.c b/dlls/winegstreamer/media-converter/fossilize.c index 5f531f0ff383..420f201ef578 100644 --- a/dlls/winegstreamer/media-converter/fossilize.c +++ b/dlls/winegstreamer/media-converter/fossilize.c @@ -552,6 +552,7 @@ int fozdb_read_entry_data(struct fozdb *db, uint32_t tag, struct fozdb_hash *has GST_DEBUG("db %p, file_name %s, tag %u, hash %s, offset %#"PRIx64", buffer %p, size %zu, read_size %p, with_crc %d.", db, db->file_name, tag, format_hash(hash), offset, buffer, size, read_size, with_crc); + *read_size = 0; if (tag >= db->num_tags) return CONV_ERROR_INVALID_TAG; if (!(ptr = rb_get(&db->entries, &key))) From 2fda90d75a9487c0d499abb7d38fb845274adbf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 18 Dec 2024 16:58:13 +0100 Subject: [PATCH 1001/2542] ntdll: Implement a new NtQueryInformationProcess ProcessWineUnixDebuggerPid class. CW-Bug-Id: #24510 --- dlls/ntdll/unix/process.c | 38 ++++++++++++++++++++++++++++++++++++++ dlls/wow64/process.c | 3 +++ include/winternl.h | 1 + 3 files changed, 42 insertions(+) diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c index a11dcc40cec7..9479378a7531 100644 --- a/dlls/ntdll/unix/process.c +++ b/dlls/ntdll/unix/process.c @@ -1047,6 +1047,11 @@ void fill_vm_counters( VM_COUNTERS_EX *pvmi, int unix_pid ) #endif } +int get_unix_debugger_pid(void) +{ + return 0; +} + #elif defined(linux) void fill_vm_counters( VM_COUNTERS_EX *pvmi, int unix_pid ) @@ -1082,6 +1087,23 @@ void fill_vm_counters( VM_COUNTERS_EX *pvmi, int unix_pid ) fclose(f); } +int get_unix_debugger_pid(void) +{ + int unix_pid = 0; + char line[256]; + FILE *file; + + if (!(file = fopen( "/proc/self/status", "r" ))) return 0; + while (fgets( line, sizeof(line), file )) + { + if (sscanf( line, "TracerPid: %d", &unix_pid )) break; + unix_pid = 0; + } + fclose( file ); + + return unix_pid; +} + #elif defined(HAVE_LIBPROCSTAT) void fill_vm_counters( VM_COUNTERS_EX *pvmi, int unix_pid ) @@ -1106,6 +1128,11 @@ void fill_vm_counters( VM_COUNTERS_EX *pvmi, int unix_pid ) } } +int get_unix_debugger_pid(void) +{ + return 0; +} + #else void fill_vm_counters( VM_COUNTERS_EX *pvmi, int unix_pid ) @@ -1113,6 +1140,11 @@ void fill_vm_counters( VM_COUNTERS_EX *pvmi, int unix_pid ) /* FIXME : real data */ } +int get_unix_debugger_pid(void) +{ + return 0; +} + #endif #define UNIMPLEMENTED_INFO_CLASS(c) \ @@ -1589,6 +1621,12 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class else ret = STATUS_INVALID_PARAMETER; break; + case ProcessWineUnixDebuggerPid: + if (handle == NtCurrentProcess()) ret = STATUS_INVALID_PARAMETER; + else if (size != sizeof(int)) ret = STATUS_INFO_LENGTH_MISMATCH; + else *(int *)info = get_unix_debugger_pid(); + break; + case ProcessQuotaLimits: { QUOTA_LIMITS qlimits; diff --git a/dlls/wow64/process.c b/dlls/wow64/process.c index 97a1f30179e2..414a46ea0850 100644 --- a/dlls/wow64/process.c +++ b/dlls/wow64/process.c @@ -661,6 +661,9 @@ NTSTATUS WINAPI wow64_NtQueryInformationProcess( UINT *args ) case ProcessWineLdtCopy: return STATUS_NOT_IMPLEMENTED; + case ProcessWineUnixDebuggerPid: + return NtQueryInformationProcess( handle, class, ptr, len, retlen ); + default: FIXME( "unsupported class %u\n", class ); return STATUS_INVALID_INFO_CLASS; diff --git a/include/winternl.h b/include/winternl.h index 862464a6acfb..935e030e1c51 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -1898,6 +1898,7 @@ typedef enum _PROCESSINFOCLASS { ProcessWineMakeProcessSystem = 1000, ProcessWineLdtCopy, ProcessWineGrantAdminToken, + ProcessWineUnixDebuggerPid = 1100, #endif } PROCESSINFOCLASS; From 444a8374d2d33165f0a49f307760d4aa98bbe86c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 18 Dec 2024 23:07:37 +0100 Subject: [PATCH 1002/2542] win32u: Don't use a surface to paint the client area of Vulkan windows. --- dlls/win32u/dce.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index e64108091651..055f8684d960 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -865,8 +865,12 @@ static void update_visible_region( struct dce *dce ) win = get_win_ptr( top_win ); if (win && win != WND_DESKTOP && win != WND_OTHER_PROCESS) { - surface = win->surface; - if (surface) window_surface_add_ref( surface ); + /* don't use a surface to paint the client area of Vulkan windows */ + if (list_empty( &win->vulkan_surfaces ) || (flags & DCX_WINDOW)) + { + surface = win->surface; + if (surface) window_surface_add_ref( surface ); + } release_win_ptr( win ); } } From 096ca6c08a4bc157dbe0ed764ff31e84bb4bf9f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 18 Dec 2024 16:18:39 +0100 Subject: [PATCH 1003/2542] win32u: Update vulkan surfaces when updating the window state. --- dlls/win32u/ntuser_private.h | 1 + dlls/win32u/vulkan.c | 16 ++++++++++++++++ dlls/win32u/window.c | 1 + 3 files changed, 18 insertions(+) diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h index b24da51a4b31..34e423d0e32b 100644 --- a/dlls/win32u/ntuser_private.h +++ b/dlls/win32u/ntuser_private.h @@ -238,6 +238,7 @@ extern PFN_vkGetDeviceProcAddr p_vkGetDeviceProcAddr; extern PFN_vkGetInstanceProcAddr p_vkGetInstanceProcAddr; extern BOOL vulkan_init(void); +extern void vulkan_update_surfaces( HWND hwnd ); extern void vulkan_detach_surfaces( struct list *surfaces ); /* window.c */ diff --git a/dlls/win32u/vulkan.c b/dlls/win32u/vulkan.c index 692fcb136a66..04ddab6f1639 100644 --- a/dlls/win32u/vulkan.c +++ b/dlls/win32u/vulkan.c @@ -1641,6 +1641,22 @@ static void vulkan_init_once(void) vulkan_funcs.p_vkGetDeviceProcAddr = p_vkGetDeviceProcAddr; } +void vulkan_update_surfaces( HWND hwnd ) +{ + struct surface *surface; + struct rb_entry *ptr; + + pthread_mutex_lock( &window_surfaces_lock ); + + if ((ptr = rb_get( &window_surfaces, hwnd ))) + { + surface = RB_ENTRY_VALUE( ptr, struct surface, window_entry ); + driver_funcs->p_vulkan_surface_update( surface->hwnd, surface->driver_private ); + } + + pthread_mutex_unlock( &window_surfaces_lock ); +} + void vulkan_detach_surfaces( struct list *surfaces ) { struct surface *surface, *next; diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 6e6e758f9a97..68a68ca2b747 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -4613,6 +4613,7 @@ void update_window_state( HWND hwnd ) if (surface) window_surface_release( surface ); set_thread_dpi_awareness_context( context ); + vulkan_update_surfaces( hwnd ); } /*********************************************************************** From 59dee24adb1383d4f689bd7c47ae7fd1a5032a25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 18 Dec 2024 16:26:04 +0100 Subject: [PATCH 1004/2542] win32u: Update toplevel window state when children change. --- dlls/win32u/window.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 68a68ca2b747..e9d3ee75b4b0 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -392,7 +392,7 @@ HWND WINAPI NtUserSetParent( HWND hwnd, HWND parent ) RECT window_rect = {0}, old_screen_rect = {0}, new_screen_rect = {0}; UINT context; WINDOWPOS winpos; - HWND full_handle; + HWND full_handle, new_toplevel, old_toplevel; HWND old_parent = 0; BOOL was_visible; WND *win; @@ -463,6 +463,14 @@ HWND WINAPI NtUserSetParent( HWND hwnd, HWND parent ) user_driver->pSetParent( full_handle, parent, old_parent ); + new_toplevel = NtUserGetAncestor( parent, GA_ROOT ); + old_toplevel = NtUserGetAncestor( old_parent, GA_ROOT ); + if (new_toplevel != old_toplevel) + { + update_window_state( new_toplevel ); + update_window_state( old_toplevel ); + } + winpos.hwnd = hwnd; winpos.hwndInsertAfter = HWND_TOP; winpos.x = window_rect.left; @@ -4598,6 +4606,7 @@ void update_window_state( HWND hwnd ) struct window_surface *surface; struct window_rects new_rects; + if (!hwnd || hwnd == get_desktop_window()) return; if (!is_current_thread_window( hwnd )) { NtUserPostMessage( hwnd, WM_WINE_UPDATEWINDOWSTATE, 0, 0 ); @@ -5100,10 +5109,12 @@ LRESULT destroy_window( HWND hwnd ) struct window_surface *surface; HMENU menu = 0, sys_menu; WND *win; - HWND *children; + HWND toplevel, *children; TRACE( "%p\n", hwnd ); + toplevel = NtUserGetAncestor( hwnd, GA_ROOT ); + unregister_imm_window( hwnd ); /* free child windows */ @@ -5132,6 +5143,8 @@ LRESULT destroy_window( HWND hwnd ) send_message( hwnd, WM_NCDESTROY, 0, 0 ); + if (toplevel != hwnd) update_window_state( toplevel ); + /* FIXME: do we need to fake QS_MOUSEMOVE wakebit? */ /* free resources associated with the window */ @@ -5485,7 +5498,7 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, struct window_surface *surface; struct window_rects new_rects; CBT_CREATEWNDW cbtc; - HWND hwnd, owner = 0; + HWND hwnd, toplevel, owner = 0; CREATESTRUCTW cs; INT sw = SW_SHOW; RECT surface_rect; @@ -5789,6 +5802,10 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, TRACE( "created window %p\n", hwnd ); set_thread_dpi_awareness_context( context ); + + toplevel = NtUserGetAncestor( hwnd, GA_ROOT ); + if (toplevel != hwnd) update_window_state( toplevel ); + return hwnd; failed: From 58d236ff1d2147a17e9a437686afc52cf62e05d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 18 Dec 2024 21:32:37 +0100 Subject: [PATCH 1005/2542] winex11: Use offscreen for client surfaces of visible offscreen windows. --- dlls/winex11.drv/init.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index f61834274d8d..25ddbd2095e2 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -221,6 +221,10 @@ BOOL needs_offscreen_rendering( HWND hwnd, BOOL known_child, BOOL check_gamma ) { static int no_child_clipping_cached = -1; + UINT style = NtUserGetWindowLongW( hwnd, GWL_STYLE ); + struct x11drv_win_data *data; + BOOL needs_offscreen; + if (no_child_clipping_cached == -1) { const char *sgi = getenv( "SteamGameId" ); @@ -229,6 +233,14 @@ BOOL needs_offscreen_rendering( HWND hwnd, BOOL known_child, BOOL check_gamma ) if (no_child_clipping_cached) FIXME( "HACK: disabling child GL window clipping.\n" ); } + if (!(data = get_win_data( hwnd ))) needs_offscreen = TRUE; /* window is in a different process */ + else + { + needs_offscreen = (style & WS_VISIBLE) && !(style & WS_MINIMIZE) && !is_window_rect_mapped( &data->rects.visible ); + release_win_data( data ); + } + if (needs_offscreen) return needs_offscreen; + if (NtUserGetDpiForWindow( hwnd ) != NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) && !enable_fullscreen_hack( hwnd, check_gamma )) return TRUE; /* needs DPI scaling */ From 540a5ef6b33e87435fee85361c602e674a03a7cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 19 Dec 2024 09:52:00 +0100 Subject: [PATCH 1006/2542] winex11: Introduce a new get_onscreen_drawable helper. --- dlls/winex11.drv/opengl.c | 13 +------------ dlls/winex11.drv/vulkan.c | 13 +------------ dlls/winex11.drv/window.c | 21 +++++++++++++++++++++ dlls/winex11.drv/x11drv.h | 1 + 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 990f5c13c6c5..5e1749edb83e 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -3197,7 +3197,6 @@ static BOOL glxdrv_wglShareLists(struct wgl_context *org, struct wgl_context *de static void present_gl_drawable( HWND hwnd, HDC hdc, struct gl_drawable *gl, BOOL flush, BOOL gl_finish ) { HWND toplevel = NtUserGetAncestor( hwnd, GA_ROOT ); - struct x11drv_win_data *data; Drawable window, drawable; RECT rect_dst, rect; HRGN region; @@ -3210,22 +3209,12 @@ static void present_gl_drawable( HWND hwnd, HDC hdc, struct gl_drawable *gl, BOO default: drawable = 0; break; } if (!drawable) return; - window = get_dc_drawable( hdc, &rect ); + window = get_onscreen_drawable( hwnd, toplevel, &rect_dst ); region = get_dc_monitor_region( hwnd, hdc ); if (gl_finish) pglFinish(); if (flush) XFlush( gdi_display ); - NtUserGetClientRect( hwnd, &rect_dst, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); - NtUserMapWindowPoints( hwnd, toplevel, (POINT *)&rect_dst, 2, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); - - if ((data = get_win_data( toplevel ))) - { - OffsetRect( &rect_dst, data->rects.client.left - data->rects.visible.left, - data->rects.client.top - data->rects.visible.top ); - release_win_data( data ); - } - if (get_dc_drawable( gl->hdc_dst, &rect ) != window || !EqualRect( &rect, &rect_dst )) set_dc_drawable( gl->hdc_dst, window, &rect_dst, IncludeInferiors ); if (region) NtGdiExtSelectClipRgn( gl->hdc_dst, region, RGN_COPY ); diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index c4630a484f67..f9be9c6f677f 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -285,7 +285,6 @@ static void X11DRV_vulkan_surface_presented( HWND hwnd, void *private, VkResult { struct x11drv_vulkan_surface *surface = private; HWND toplevel = NtUserGetAncestor( hwnd, GA_ROOT ); - struct x11drv_win_data *data; RECT rect_dst, rect; Drawable window; HRGN region; @@ -296,19 +295,9 @@ static void X11DRV_vulkan_surface_presented( HWND hwnd, void *private, VkResult if (!surface->offscreen) return; if (!(hdc = NtUserGetDCEx( hwnd, 0, DCX_CACHE | DCX_USESTYLE ))) return; - window = X11DRV_get_whole_window( toplevel ); + window = get_onscreen_drawable( hwnd, toplevel, &rect_dst ); region = get_dc_monitor_region( hwnd, hdc ); - NtUserGetClientRect( hwnd, &rect_dst, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); - NtUserMapWindowPoints( hwnd, toplevel, (POINT *)&rect_dst, 2, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); - - if ((data = get_win_data( toplevel ))) - { - OffsetRect( &rect_dst, data->rects.client.left - data->rects.visible.left, - data->rects.client.top - data->rects.visible.top ); - release_win_data( data ); - } - if (get_dc_drawable( surface->hdc_dst, &rect ) != window || !EqualRect( &rect, &rect_dst )) set_dc_drawable( surface->hdc_dst, window, &rect_dst, IncludeInferiors ); if (region) NtGdiExtSelectClipRgn( surface->hdc_dst, region, RGN_COPY ); diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index e4aee44f4695..a8ba00fa6ceb 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2774,6 +2774,27 @@ Window X11DRV_get_whole_window( HWND hwnd ) return ret; } +/* return the onscreen X drawable to be used when reading / writing pixels */ +Window get_onscreen_drawable( HWND hwnd, HWND toplevel, RECT *rect ) +{ + struct x11drv_win_data *data; + Window window; + + NtUserGetClientRect( hwnd, rect, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); + NtUserMapWindowPoints( hwnd, toplevel, (POINT *)rect, 2, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); + + if ((data = get_win_data( toplevel ))) + { + OffsetRect( rect, data->rects.client.left - data->rects.visible.left, + data->rects.client.top - data->rects.visible.top ); + window = data->whole_window; + release_win_data( data ); + return window; + } + + /* FIXME: apply visible / window rects offset */ + return X11DRV_get_whole_window( toplevel ); +} /*********************************************************************** * X11DRV_GetDC (X11DRV.@) diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 5d81c32bbbb1..b151480fe715 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -358,6 +358,7 @@ struct x11drv_escape_get_drawable extern BOOL enable_fullscreen_hack( HWND hwnd, BOOL check_gamma ); extern BOOL needs_offscreen_rendering( HWND hwnd, BOOL known_child, BOOL check_gamma ); +extern Window get_onscreen_drawable( HWND hwnd, HWND toplevel, RECT *rect ); extern void set_dc_drawable( HDC hdc, Drawable drawable, const RECT *rect, int mode ); extern Drawable get_dc_drawable( HDC hdc, RECT *rect ); extern HRGN get_dc_monitor_region( HWND hwnd, HDC hdc ); From 8978d225672017e61c879053b705559753ef4ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 19 Dec 2024 10:11:41 +0100 Subject: [PATCH 1007/2542] winex11: Avoid releasing invalid window data in X11DRV_GetDC. --- dlls/winex11.drv/window.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index a8ba00fa6ceb..89e9a9e8b29c 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2803,6 +2803,7 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, const RECT *top_rect, DWORD flags ) { struct x11drv_escape_set_drawable escape; + struct x11drv_win_data *data; escape.code = X11DRV_SET_DRAWABLE; escape.mode = IncludeInferiors; @@ -2813,14 +2814,11 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, escape.dc_rect.right = win_rect->right - top_rect->left; escape.dc_rect.bottom = win_rect->bottom - top_rect->top; - if (top == hwnd) + if ((data = get_win_data( top ))) { - struct x11drv_win_data *data = get_win_data( hwnd ); - - escape.drawable = data ? data->whole_window : X11DRV_get_whole_window( hwnd ); - + escape.drawable = data->whole_window; /* special case: when repainting the root window, clip out top-level windows */ - if (data && data->whole_window == root_window) escape.mode = ClipByChildren; + if (top == hwnd && escape.drawable == root_window) escape.mode = ClipByChildren; release_win_data( data ); } else From de39b38a308fe7920104a9cc24a0d5a289b065de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 19 Dec 2024 10:16:27 +0100 Subject: [PATCH 1008/2542] winex11: Create DCs with the onscreen client window when possible. --- dlls/winex11.drv/window.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 89e9a9e8b29c..c6e628154dcd 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2816,7 +2816,17 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, if ((data = get_win_data( top ))) { - escape.drawable = data->whole_window; + if (!(escape.drawable = data->client_window) || (flags & DCX_WINDOW)) + { + if (data->client_window) WARN( "window %p/%lx has an onscreen client window\n", data->hwnd, data->whole_window ); + escape.drawable = data->whole_window; + } + else + { + OffsetRect( &escape.dc_rect, data->rects.client.left - data->rects.window.left, + data->rects.client.top - data->rects.window.top ); + } + /* special case: when repainting the root window, clip out top-level windows */ if (top == hwnd && escape.drawable == root_window) escape.mode = ClipByChildren; release_win_data( data ); From b5b9298a91b0ab9ffcaf599be84dafba4889c229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 19 Dec 2024 10:18:19 +0100 Subject: [PATCH 1009/2542] winex11: Present to the client window if there's any. --- dlls/winex11.drv/window.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index c6e628154dcd..a9bfeabda164 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2785,9 +2785,12 @@ Window get_onscreen_drawable( HWND hwnd, HWND toplevel, RECT *rect ) if ((data = get_win_data( toplevel ))) { - OffsetRect( rect, data->rects.client.left - data->rects.visible.left, - data->rects.client.top - data->rects.visible.top ); - window = data->whole_window; + if (!(window = data->client_window)) + { + OffsetRect( rect, data->rects.client.left - data->rects.visible.left, + data->rects.client.top - data->rects.visible.top ); + window = data->whole_window; + } release_win_data( data ); return window; } From 5247c862adea4d53673fd25132e37f2d232f6ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 18 Dec 2024 17:40:59 +0100 Subject: [PATCH 1010/2542] winex11: Keep track of offscreen client windows. --- dlls/winex11.drv/window.c | 6 +++++- dlls/winex11.drv/x11drv.h | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index a9bfeabda164..28a09ed05ef1 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2040,6 +2040,7 @@ void detach_client_window( struct x11drv_win_data *data, Window client_window ) } data->client_window = 0; + data->offscreen_client = client_window; } @@ -2063,6 +2064,7 @@ void attach_client_window( struct x11drv_win_data *data, Window client_window ) set_wine_allow_flip( client_window, 1 ); data->client_window = client_window; + data->offscreen_client = 0; } @@ -2077,6 +2079,7 @@ void destroy_client_window( HWND hwnd, Window client_window ) if ((data = get_win_data( hwnd ))) { + if (data->offscreen_client == client_window) data->offscreen_client = 0; if (data->client_window == client_window) { if (data->whole_window) client_window_events_disable( data, client_window ); @@ -2131,6 +2134,7 @@ Window create_client_window( HWND hwnd, RECT client_rect, const XVisualInfo *vis CWBackingStore | CWColormap | CWBorderPixel, &attr ); if (data->client_window) { + data->offscreen_client = 0; set_wine_allow_flip( data->client_window, 1 ); XMapWindow( gdi_display, data->client_window ); if (data->whole_window) @@ -2819,7 +2823,7 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, if ((data = get_win_data( top ))) { - if (!(escape.drawable = data->client_window) || (flags & DCX_WINDOW)) + if ((!(escape.drawable = data->client_window) && !(escape.drawable = data->offscreen_client)) || (flags & DCX_WINDOW)) { if (data->client_window) WARN( "window %p/%lx has an onscreen client window\n", data->hwnd, data->whole_window ); escape.drawable = data->whole_window; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index b151480fe715..8e6473838fcc 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -642,7 +642,8 @@ struct x11drv_win_data Colormap whole_colormap; /* colormap if non-default visual */ HWND hwnd; /* hwnd that this private data belongs to */ Window whole_window; /* X window for the complete window */ - Window client_window; /* X window for the client area */ + Window client_window; /* X window for the onscreen client area */ + Window offscreen_client; /* X window for the offscreen client area */ struct window_rects rects; /* window rects in monitor DPI, relative to parent client area */ struct host_window *parent; /* the host window parent, frame or embedder, NULL if root_window */ XIC xic; /* X input context */ From 3b0cc0807a6c6884aed282f31a27397391865456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 19 Dec 2024 10:41:01 +0100 Subject: [PATCH 1011/2542] winex11: Use a property for other processes client windows. --- dlls/winex11.drv/window.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 28a09ed05ef1..5ee4c4763e0d 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -101,6 +101,8 @@ static XContext host_window_context = 0; static const WCHAR whole_window_prop[] = {'_','_','w','i','n','e','_','x','1','1','_','w','h','o','l','e','_','w','i','n','d','o','w',0}; +static const WCHAR client_window_prop[] = + {'_','_','w','i','n','e','_','x','1','1','_','c','l','i','e','n','t','_','w','i','n','d','o','w',0}; static const WCHAR clip_window_prop[] = {'_','_','w','i','n','e','_','x','1','1','_','c','l','i','p','_','w','i','n','d','o','w',0}; static const WCHAR focus_time_prop[] = @@ -2041,6 +2043,7 @@ void detach_client_window( struct x11drv_win_data *data, Window client_window ) data->client_window = 0; data->offscreen_client = client_window; + NtUserRemoveProp( data->hwnd, client_window_prop ); } @@ -2065,6 +2068,7 @@ void attach_client_window( struct x11drv_win_data *data, Window client_window ) data->client_window = client_window; data->offscreen_client = 0; + NtUserSetProp( data->hwnd, client_window_prop, (HANDLE)data->client_window ); } @@ -2084,6 +2088,7 @@ void destroy_client_window( HWND hwnd, Window client_window ) { if (data->whole_window) client_window_events_disable( data, client_window ); data->client_window = 0; + NtUserRemoveProp( hwnd, client_window_prop ); } release_win_data( data ); } @@ -2135,6 +2140,7 @@ Window create_client_window( HWND hwnd, RECT client_rect, const XVisualInfo *vis if (data->client_window) { data->offscreen_client = 0; + NtUserSetProp( data->hwnd, client_window_prop, (HANDLE)data->client_window ); set_wine_allow_flip( data->client_window, 1 ); XMapWindow( gdi_display, data->client_window ); if (data->whole_window) @@ -2799,6 +2805,7 @@ Window get_onscreen_drawable( HWND hwnd, HWND toplevel, RECT *rect ) return window; } + if ((window = (Window)NtUserGetProp( toplevel, client_window_prop ))) return window; /* FIXME: apply visible / window rects offset */ return X11DRV_get_whole_window( toplevel ); } @@ -2838,10 +2845,15 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, if (top == hwnd && escape.drawable == root_window) escape.mode = ClipByChildren; release_win_data( data ); } - else + else if (!(escape.drawable = (Window)NtUserGetProp( top, client_window_prop )) || (flags & DCX_WINDOW)) { + if (escape.drawable) WARN( "window %p has a client window\n", top ); escape.drawable = X11DRV_get_whole_window( top ); } + else + { + /* FIXME: apply visible / client rects offset */ + } if (!escape.drawable) return; /* don't create a GC for foreign windows */ NtGdiExtEscape( hdc, NULL, 0, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL ); From 77e7ee0edbbde594ef33e304d247d82741b91c53 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Wed, 28 Feb 2024 16:04:41 +0100 Subject: [PATCH 1012/2542] wmvcore: Start and stop read & delivery threads on OP_START/OP_STOP. Otherwise, it keeps pushing samples after calling OnStatus(WMT_STOPPED), which doesn't seem right. (Leading to potential crash). CW-Bug-Id: #22313 --- dlls/wmvcore/async_reader.c | 73 ++++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 22 deletions(-) diff --git a/dlls/wmvcore/async_reader.c b/dlls/wmvcore/async_reader.c index f3e8f670a991..f6efabb88a3e 100644 --- a/dlls/wmvcore/async_reader.c +++ b/dlls/wmvcore/async_reader.c @@ -82,6 +82,8 @@ struct stream HANDLE deliver_thread; struct list deliver_samples; CONDITION_VARIABLE deliver_cv; + + bool running; }; struct async_reader @@ -346,7 +348,7 @@ static DWORD WINAPI stream_deliver_thread(void *arg) EnterCriticalSection(&reader->callback_cs); - while (reader->running) + while (reader->running && stream->running) { if (list_empty(&stream->deliver_samples)) { @@ -380,7 +382,7 @@ static DWORD WINAPI stream_read_thread(void *arg) EnterCriticalSection(&reader->callback_cs); - while (reader->running) + while (reader->running && stream->running) { if (!stream->read_requested) { @@ -450,6 +452,8 @@ static void stream_flush_samples(struct stream *stream) static void stream_close(struct stream *stream) { + if (!stream->running) return; + stream->running = false; if (stream->read_thread) { WakeConditionVariable(&stream->read_cv); @@ -484,13 +488,44 @@ static HRESULT stream_open(struct stream *stream, struct async_reader *reader, W if (!(stream->deliver_thread = CreateThread(NULL, 0, stream_deliver_thread, stream, 0, NULL))) { + LeaveCriticalSection(&reader->callback_cs); stream_close(stream); + EnterCriticalSection(&reader->callback_cs); return E_OUTOFMEMORY; } + stream->running = true; return S_OK; } +static void async_reader_close_all_streams(struct async_reader *reader) +{ + int i; + + if (!reader->streams) return; + for (i = 0; i < reader->stream_count; i++) + { + struct stream *stream = reader->streams + i; + stream_close(stream); + } +} + +static HRESULT async_reader_open_all_streams(struct async_reader *reader) +{ + HRESULT hr; + int i; + + for (i = 0; i < reader->stream_count; ++i) + { + struct stream *stream = reader->streams + i; + + if (FAILED(hr = stream_open(stream, reader, i + 1))) + return hr; + stream_request_read(stream); + } + return S_OK; +} + static HRESULT async_reader_get_next_sample(struct async_reader *reader, struct stream **out_stream, struct sample **out_sample) { @@ -601,7 +636,6 @@ static DWORD WINAPI async_reader_callback_thread(void *arg) struct async_reader *reader = arg; struct list *entry; HRESULT hr = S_OK; - DWORD i; IWMReaderCallback_OnStatus(reader->callback, WMT_OPENED, S_OK, WMT_TYPE_DWORD, (BYTE *)&zero, reader->context); @@ -629,11 +663,15 @@ static DWORD WINAPI async_reader_callback_thread(void *arg) { reader->clock_start = get_current_time(reader); - for (i = 0; i < reader->stream_count; ++i) + if (FAILED(hr = async_reader_open_all_streams(reader))) { - struct stream *stream = reader->streams + i; - stream_flush_samples(stream); - stream_request_read(stream); + WARN("Unable to open all required streams, aborting\n"); + LeaveCriticalSection(&reader->callback_cs); + async_reader_close_all_streams(reader); + IWMReaderCallback_OnStatus(reader->callback, WMT_CLOSED, hr, + WMT_TYPE_DWORD, (BYTE *)&zero, reader->context); + EnterCriticalSection(&reader->callback_cs); + reader->running = false; } } @@ -646,8 +684,12 @@ static DWORD WINAPI async_reader_callback_thread(void *arg) case ASYNC_OP_STOP: if (SUCCEEDED(hr)) + { reader->clock_start = 0; - + LeaveCriticalSection(&reader->callback_cs); + async_reader_close_all_streams(reader); + EnterCriticalSection(&reader->callback_cs); + } LeaveCriticalSection(&reader->callback_cs); IWMReaderCallback_OnStatus(reader->callback, WMT_STOPPED, hr, WMT_TYPE_DWORD, (BYTE *)&zero, reader->context); @@ -684,7 +726,6 @@ static DWORD WINAPI async_reader_callback_thread(void *arg) static void async_reader_close(struct async_reader *reader) { struct async_op *op, *next; - int i; if (reader->callback_thread) { @@ -699,11 +740,7 @@ static void async_reader_close(struct async_reader *reader) free(op); } - for (i = 0; reader->streams && i < reader->stream_count; ++i) - { - struct stream *stream = reader->streams + i; - stream_close(stream); - } + async_reader_close_all_streams(reader); free(reader->streams); reader->streams = NULL; reader->stream_count = 0; @@ -725,7 +762,6 @@ static void async_reader_close(struct async_reader *reader) static HRESULT async_reader_open(struct async_reader *reader, IWMReaderCallback *callback, void *context) { HRESULT hr = E_OUTOFMEMORY; - DWORD i; IWMReaderCallback_AddRef((reader->callback = callback)); reader->context = context; @@ -751,13 +787,6 @@ static HRESULT async_reader_open(struct async_reader *reader, IWMReaderCallback reader->running = true; - for (i = 0; i < reader->stream_count; ++i) - { - struct stream *stream = reader->streams + i; - if (FAILED(hr = stream_open(stream, reader, i + 1))) - goto error; - } - if (!(reader->callback_thread = CreateThread(NULL, 0, async_reader_callback_thread, reader, 0, NULL))) goto error; From e179f62c1c5ecf44075c27a1d8d72be7235d8bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 19 Dec 2024 20:08:52 +0100 Subject: [PATCH 1013/2542] win32u: Map driver DC coordinates to raw monitor DPI. --- dlls/win32u/clipping.c | 24 +++++++++++++++++++----- dlls/win32u/dc.c | 4 ++++ dlls/win32u/dce.c | 29 +++++++++++++++++++++++------ dlls/win32u/dibdrv/dc.c | 8 ++++---- dlls/win32u/driver.c | 2 +- dlls/win32u/mapping.c | 2 ++ dlls/win32u/ntgdi_private.h | 6 ++++-- dlls/winex11.drv/graphics.c | 6 +++--- dlls/winex11.drv/x11drv.h | 2 +- dlls/winex11.drv/xrender.c | 6 +++--- include/wine/gdi_driver.h | 2 +- 11 files changed, 65 insertions(+), 26 deletions(-) diff --git a/dlls/win32u/clipping.c b/dlls/win32u/clipping.c index 610c2b430e3e..1b2f2d881d0d 100644 --- a/dlls/win32u/clipping.c +++ b/dlls/win32u/clipping.c @@ -73,7 +73,11 @@ BOOL clip_device_rect( DC *dc, RECT *dst, const RECT *src ) { RECT clip; - if (get_dc_device_rect( dc, &clip )) return intersect_rect( dst, src, &clip ); + if (get_dc_device_rect( dc, &clip )) + { + clip = map_dpi_rect( clip, dc->dpi_from, dc->dpi_to ); + return intersect_rect( dst, src, &clip ); + } *dst = *src; return TRUE; } @@ -88,7 +92,11 @@ BOOL clip_visrect( DC *dc, RECT *dst, const RECT *src ) RECT clip; if (!clip_device_rect( dc, dst, src )) return FALSE; - if (NtGdiGetRgnBox( get_dc_region(dc), &clip )) return intersect_rect( dst, dst, &clip ); + if (NtGdiGetRgnBox( get_dc_region(dc), &clip )) + { + clip = map_dpi_rect( clip, dc->dpi_from, dc->dpi_to ); + return intersect_rect( dst, dst, &clip ); + } return TRUE; } @@ -100,7 +108,7 @@ BOOL clip_visrect( DC *dc, RECT *dst, const RECT *src ) void update_dc_clipping( DC * dc ) { PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetDeviceClipping ); - HRGN regions[3]; + HRGN regions[3], region, monitor_region; int count = 0; if (dc->hVisRgn) regions[count++] = dc->hVisRgn; @@ -118,7 +126,10 @@ void update_dc_clipping( DC * dc ) if (dc->region) NtGdiDeleteObjectApp( dc->region ); dc->region = 0; } - physdev->funcs->pSetDeviceClipping( physdev, get_dc_region( dc )); + region = get_dc_region( dc ); + monitor_region = map_dpi_region( region, dc->dpi_from, dc->dpi_to ); + physdev->funcs->pSetDeviceClipping( physdev, region, monitor_region ); + if (monitor_region) NtGdiDeleteObjectApp( monitor_region ); } /*********************************************************************** @@ -204,7 +215,7 @@ INT WINAPI NtGdiExtSelectClipRgn( HDC hdc, HRGN rgn, INT mode ) * set_visible_region */ void set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect, const RECT *device_rect, - struct window_surface *surface ) + struct window_surface *surface, UINT dpi_from, UINT dpi_to ) { DC * dc; @@ -221,6 +232,9 @@ void set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect, const RECT *d dc->attr->vis_rect = *vis_rect; dc->device_rect = *device_rect; dc->hVisRgn = hrgn; + dc->dpi_from = dpi_from; + dc->dpi_to = dpi_to; + dibdrv_set_window_surface( dc, surface ); DC_UpdateXforms( dc ); update_dc_clipping( dc ); diff --git a/dlls/win32u/dc.c b/dlls/win32u/dc.c index 2dee4d6a7339..bb2b7abbda9a 100644 --- a/dlls/win32u/dc.c +++ b/dlls/win32u/dc.c @@ -154,6 +154,8 @@ static void free_dc_attr( DC_ATTR *dc_attr ) */ static void set_initial_dc_state( DC *dc ) { + if (dc->dce && dc->dpi_from && dc->dpi_to) dc->dirty = 1; + dc->attr->wnd_org.x = 0; dc->attr->wnd_org.y = 0; dc->attr->wnd_ext.cx = 1; @@ -195,6 +197,8 @@ static void set_initial_dc_state( DC *dc ) dc->xformWorld2Vport = dc->xformWorld2Wnd; dc->xformVport2World = dc->xformWorld2Wnd; dc->vport2WorldValid = TRUE; + dc->dpi_from = 0; + dc->dpi_to = 0; reset_bounds( &dc->bounds ); } diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index 055f8684d960..6aa65170d514 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -817,6 +817,7 @@ static void update_visible_region( struct dce *dce ) DWORD paint_flags = 0; size_t size = 256; RECT win_rect, top_rect; + UINT raw_dpi; WND *win; /* don't clip siblings if using parent clip region */ @@ -854,8 +855,6 @@ static void update_visible_region( struct dce *dce ) if (status || !vis_rgn) return; - user_driver->pGetDC( dce->hdc, dce->hwnd, top_win, &win_rect, &top_rect, flags ); - if (dce->clip_rgn) NtGdiCombineRgn( vis_rgn, vis_rgn, dce->clip_rgn, (flags & DCX_INTERSECTRGN) ? RGN_AND : RGN_DIFF ); @@ -875,9 +874,27 @@ static void update_visible_region( struct dce *dce ) } } - if (!surface) SetRectEmpty( &top_rect ); - set_visible_region( dce->hdc, vis_rgn, &win_rect, &top_rect, surface ); - if (surface) window_surface_release( surface ); + if (surface) + { + user_driver->pGetDC( dce->hdc, dce->hwnd, top_win, &win_rect, &top_rect, flags ); + set_visible_region( dce->hdc, vis_rgn, &win_rect, &top_rect, surface, 0, 0 ); + window_surface_release( surface ); + } + else + { + RECT window_rect, toplevel_rect; + UINT dpi; + + get_win_monitor_dpi( top_win, &raw_dpi ); + dpi = get_dpi_for_window( top_win ); + + window_rect = map_rect_virt_to_raw( win_rect, dpi ); + toplevel_rect = map_rect_virt_to_raw( top_rect, dpi ); + user_driver->pGetDC( dce->hdc, dce->hwnd, top_win, &window_rect, &toplevel_rect, flags ); + + SetRectEmpty( &top_rect ); + set_visible_region( dce->hdc, vis_rgn, &win_rect, &top_rect, NULL, dpi, raw_dpi ); + } } /*********************************************************************** @@ -887,7 +904,7 @@ static void release_dce( struct dce *dce ) { if (!dce->hwnd) return; /* already released */ - set_visible_region( dce->hdc, 0, &dummy_surface.rect, &dummy_surface.rect, &dummy_surface ); + set_visible_region( dce->hdc, 0, &dummy_surface.rect, &dummy_surface.rect, &dummy_surface, 0, 0 ); user_driver->pReleaseDC( dce->hwnd, dce->hdc ); if (dce->clip_rgn) NtGdiDeleteObjectApp( dce->clip_rgn ); diff --git a/dlls/win32u/dibdrv/dc.c b/dlls/win32u/dibdrv/dc.c index 60cd41142b27..c78a22132cdd 100644 --- a/dlls/win32u/dibdrv/dc.c +++ b/dlls/win32u/dibdrv/dc.c @@ -378,7 +378,7 @@ static HBITMAP dibdrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap ) /*********************************************************************** * dibdrv_SetDeviceClipping */ -static void dibdrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn ) +static void dibdrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn, HRGN monitor_rgn ) { dibdrv_physdev *pdev = get_dibdrv_pdev(dev); TRACE("(%p, %p)\n", dev, rgn); @@ -1166,15 +1166,15 @@ static INT windrv_SetDIBitsToDevice( PHYSDEV dev, INT x_dst, INT y_dst, DWORD cx return ret; } -static void windrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn ) +static void windrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn, HRGN monitor_rgn ) { dev = GET_NEXT_PHYSDEV( dev, pSetDeviceClipping ); - dev->funcs->pSetDeviceClipping( dev, rgn ); + dev->funcs->pSetDeviceClipping( dev, rgn, monitor_rgn ); /* also forward to the graphics driver for the OpenGL case */ if (dev->funcs == &dib_driver) { dev = GET_NEXT_PHYSDEV( dev, pSetDeviceClipping ); - dev->funcs->pSetDeviceClipping( dev, rgn ); + dev->funcs->pSetDeviceClipping( dev, rgn, monitor_rgn ); } } diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index 88fedbd000c0..74e004d7ffa4 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -487,7 +487,7 @@ static COLORREF nulldrv_SetDCPenColor( PHYSDEV dev, COLORREF color ) return color; } -static void nulldrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn ) +static void nulldrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn, HRGN monitor_rgn ) { } diff --git a/dlls/win32u/mapping.c b/dlls/win32u/mapping.c index 65f276e853f6..f31e6c7b8078 100644 --- a/dlls/win32u/mapping.c +++ b/dlls/win32u/mapping.c @@ -190,6 +190,7 @@ BOOL dp_to_lp( DC *dc, POINT *points, INT count ) { double x = points->x; double y = points->y; + *points = map_dpi_point( *points, dc->dpi_to, dc->dpi_from ); points->x = GDI_ROUND( x * dc->xformVport2World.eM11 + y * dc->xformVport2World.eM21 + dc->xformVport2World.eDx ); @@ -274,6 +275,7 @@ void lp_to_dp( DC *dc, POINT *points, INT count ) points->y = GDI_ROUND( x * dc->xformWorld2Vport.eM12 + y * dc->xformWorld2Vport.eM22 + dc->xformWorld2Vport.eDy ); + *points = map_dpi_point( *points, dc->dpi_from, dc->dpi_to ); points++; } } diff --git a/dlls/win32u/ntgdi_private.h b/dlls/win32u/ntgdi_private.h index 41d3c1140cad..46dbdb95c3f2 100644 --- a/dlls/win32u/ntgdi_private.h +++ b/dlls/win32u/ntgdi_private.h @@ -89,6 +89,8 @@ typedef struct tagDC XFORM xformVport2World; /* Inverse of the above transformation */ BOOL vport2WorldValid; /* Is xformVport2World valid? */ RECT bounds; /* Current bounding rect */ + UINT dpi_from; + UINT dpi_to; } DC; /* dce flags */ @@ -162,8 +164,8 @@ extern void free_brush_pattern( struct brush_pattern *pattern ); /* clipping.c */ extern BOOL clip_device_rect( DC *dc, RECT *dst, const RECT *src ); extern BOOL clip_visrect( DC *dc, RECT *dst, const RECT *src ); -extern void set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect, - const RECT *device_rect, struct window_surface *surface ); +extern void set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect, const RECT *device_rect, + struct window_surface *surface, UINT dpi_from, UINT dpi_to ); extern void update_dc_clipping( DC * dc ); /* Return the total DC region (if any) */ diff --git a/dlls/winex11.drv/graphics.c b/dlls/winex11.drv/graphics.c index d2d32e53de98..24ddecfb5d33 100644 --- a/dlls/winex11.drv/graphics.c +++ b/dlls/winex11.drv/graphics.c @@ -296,12 +296,12 @@ void restore_clipping_region( X11DRV_PDEVICE *dev ) /*********************************************************************** * X11DRV_SetDeviceClipping */ -void X11DRV_SetDeviceClipping( PHYSDEV dev, HRGN rgn ) +void X11DRV_SetDeviceClipping( PHYSDEV dev, HRGN rgn, HRGN monitor_rgn ) { X11DRV_PDEVICE *physDev = get_x11drv_dev( dev ); - physDev->region = rgn; - update_x11_clipping( physDev, rgn ); + physDev->region = monitor_rgn; + update_x11_clipping( physDev, monitor_rgn ); } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 8e6473838fcc..1f72cee07464 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -190,7 +190,7 @@ extern HBRUSH X11DRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush, const struct brush extern HPEN X11DRV_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern *pattern ); extern COLORREF X11DRV_SetDCBrushColor( PHYSDEV dev, COLORREF crColor ); extern COLORREF X11DRV_SetDCPenColor( PHYSDEV dev, COLORREF crColor ); -extern void X11DRV_SetDeviceClipping( PHYSDEV dev, HRGN rgn ); +extern void X11DRV_SetDeviceClipping( PHYSDEV dev, HRGN rgn, HRGN monitor_rgn ); extern BOOL X11DRV_SetDeviceGammaRamp( PHYSDEV dev, LPVOID ramp ); extern BOOL fs_hack_set_gamma_ramp( PHYSDEV dev, LPVOID ramp ); extern COLORREF X11DRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ); diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index bac3e6fac4b0..f28a4ff70530 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -997,15 +997,15 @@ static INT xrenderdrv_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID /*********************************************************************** * xrenderdrv_SetDeviceClipping */ -static void xrenderdrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn ) +static void xrenderdrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn, HRGN monitor_rgn ) { struct xrender_physdev *physdev = get_xrender_dev( dev ); - physdev->region = rgn; + physdev->region = monitor_rgn; physdev->update_clip = TRUE; dev = GET_NEXT_PHYSDEV( dev, pSetDeviceClipping ); - dev->funcs->pSetDeviceClipping( dev, rgn ); + dev->funcs->pSetDeviceClipping( dev, rgn, monitor_rgn ); } diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index 8d935560e8b0..d1e4e9e39038 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -202,7 +202,7 @@ struct gdi_dc_funcs COLORREF (*pSetDCBrushColor)(PHYSDEV, COLORREF); COLORREF (*pSetDCPenColor)(PHYSDEV, COLORREF); INT (*pSetDIBitsToDevice)(PHYSDEV,INT,INT,DWORD,DWORD,INT,INT,UINT,UINT,LPCVOID,BITMAPINFO*,UINT); - VOID (*pSetDeviceClipping)(PHYSDEV,HRGN); + VOID (*pSetDeviceClipping)(PHYSDEV,HRGN,HRGN); BOOL (*pSetDeviceGammaRamp)(PHYSDEV,LPVOID); COLORREF (*pSetPixel)(PHYSDEV,INT,INT,COLORREF); COLORREF (*pSetTextColor)(PHYSDEV,COLORREF); From d765389a6723a26906772d18e624584d379f3eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 24 Dec 2024 10:08:24 +0100 Subject: [PATCH 1014/2542] HACK: winegstreamer: Expose AV1 decoding support. --- dlls/winegstreamer/video_decoder.c | 1 + dlls/winegstreamer/wg_media_type.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/dlls/winegstreamer/video_decoder.c b/dlls/winegstreamer/video_decoder.c index 5d928d2c03c2..a6d5d7d8c620 100644 --- a/dlls/winegstreamer/video_decoder.c +++ b/dlls/winegstreamer/video_decoder.c @@ -1709,6 +1709,7 @@ static const GUID *const wmv_decoder_input_types[] = &MEDIASUBTYPE_WMV3, &MEDIASUBTYPE_VC1S, &MFVideoFormat_theora, + &MFVideoFormat_AV1, }; static const GUID *const wmv_decoder_output_types[] = { diff --git a/dlls/winegstreamer/wg_media_type.c b/dlls/winegstreamer/wg_media_type.c index 09a539f1c7a0..085a69e7d322 100644 --- a/dlls/winegstreamer/wg_media_type.c +++ b/dlls/winegstreamer/wg_media_type.c @@ -369,6 +369,14 @@ static void init_caps_from_video_theora(GstCaps *caps, const MFVIDEOFORMAT *form gst_structure_set_name(gst_caps_get_structure(caps, 0), "video/x-theora"); } +static void init_caps_from_video_av1(GstCaps *caps, const MFVIDEOFORMAT *format, UINT format_size) +{ + init_caps_codec_data(caps, format + 1, format_size - sizeof(*format)); + + gst_structure_remove_field(gst_caps_get_structure(caps, 0), "format"); + gst_structure_set_name(gst_caps_get_structure(caps, 0), "video/x-av1"); +} + static void init_caps_from_video_subtype(GstCaps *caps, const GUID *subtype, const void *format, UINT format_size) { if (IsEqualGUID(subtype, &MFVideoFormat_CVID)) @@ -391,6 +399,8 @@ static void init_caps_from_video_subtype(GstCaps *caps, const GUID *subtype, con return init_caps_from_video_mpeg(caps, format, format_size); if (IsEqualGUID(subtype, &MFVideoFormat_theora)) return init_caps_from_video_theora(caps, format, format_size); + if (IsEqualGUID(subtype, &MFVideoFormat_AV1)) + return init_caps_from_video_av1(caps, format, format_size); GST_FIXME("Unsupported subtype " WG_GUID_FORMAT, WG_GUID_ARGS(*subtype)); } From 418d771afd0bcb3565e9957af84feb8b5b3dc8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 24 Dec 2024 10:08:24 +0100 Subject: [PATCH 1015/2542] HACK: wmvdecod: Expose AV1 decoding support. --- dlls/wmvdecod/wmvdecod.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/wmvdecod/wmvdecod.c b/dlls/wmvdecod/wmvdecod.c index aba1750d1bd4..94ad04219bce 100644 --- a/dlls/wmvdecod/wmvdecod.c +++ b/dlls/wmvdecod/wmvdecod.c @@ -67,6 +67,7 @@ HRESULT WINAPI DllRegisterServer(void) {MFMediaType_Video, MFVideoFormat_WVC1}, {MFMediaType_Video, MEDIASUBTYPE_VC1S}, {MFMediaType_Video, MFVideoFormat_theora}, + {MFMediaType_Video, MFVideoFormat_AV1}, }; MFT_REGISTER_TYPE_INFO wmv_decoder_mft_outputs[] = { @@ -107,6 +108,7 @@ HRESULT WINAPI DllRegisterServer(void) {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_WVP2}, {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_VC1S}, {.type = MEDIATYPE_Video, .subtype = MFVideoFormat_theora}, + {.type = MEDIATYPE_Video, .subtype = MFVideoFormat_AV1}, }; HRESULT hr; From 15f2f5f480faf291898666b23da5d97133e196cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 24 Dec 2024 10:48:22 +0100 Subject: [PATCH 1016/2542] mf/sar: Only allow the output audio media subtype as input. --- dlls/mf/sar.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/mf/sar.c b/dlls/mf/sar.c index 970063497b18..96459ad57ea1 100644 --- a/dlls/mf/sar.c +++ b/dlls/mf/sar.c @@ -1522,6 +1522,7 @@ static HRESULT check_media_type(IMFMediaType *type, IMFMediaType *current) { static const GUID *required_attrs[] = { + &MF_MT_SUBTYPE, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &MF_MT_AUDIO_NUM_CHANNELS, &MF_MT_AUDIO_BITS_PER_SAMPLE, From b7a47b1ef52fe9b113fc771e7dddfc78b57880de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 24 Dec 2024 10:11:38 +0100 Subject: [PATCH 1017/2542] HACK: winegstreamer: Expose Opus decoding support. --- dlls/winegstreamer/audio_decoder.c | 2 ++ dlls/winegstreamer/wg_media_type.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/dlls/winegstreamer/audio_decoder.c b/dlls/winegstreamer/audio_decoder.c index a675ef84f35e..a2b0dbeb6413 100644 --- a/dlls/winegstreamer/audio_decoder.c +++ b/dlls/winegstreamer/audio_decoder.c @@ -669,6 +669,8 @@ static WAVEFORMATEXTENSIBLE audio_decoder_input_types[] = {.Format = {.wFormatTag = WAVE_FORMAT_EXTENSIBLE, .nChannels = 6, .nSamplesPerSec = 48000, .nAvgBytesPerSec = 1152000, \ .nBlockAlign = 24, .wBitsPerSample = 32, .cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)}, \ .SubFormat = {0x8d2fd10b,0x5841,0x4a6b,{0x89,0x05,0x58,0x8f,0xec,0x1a,0xde,0xd9}}}, + {.Format = {.wFormatTag = WAVE_FORMAT_OPUS, .nChannels = 6, .nSamplesPerSec = 48000, .nAvgBytesPerSec = 1152000, + .nBlockAlign = 24, .wBitsPerSample = 32, .cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)}}, }; HRESULT audio_decoder_create(REFIID riid, void **ret) diff --git a/dlls/winegstreamer/wg_media_type.c b/dlls/winegstreamer/wg_media_type.c index 085a69e7d322..7038a9ed0e1d 100644 --- a/dlls/winegstreamer/wg_media_type.c +++ b/dlls/winegstreamer/wg_media_type.c @@ -180,6 +180,18 @@ static void init_caps_from_wave_format_vorbis(GstCaps *caps, const WAVEFORMATEX gst_caps_set_simple(caps, "bitrate", G_TYPE_INT, format->nAvgBytesPerSec * 8, NULL); } +static void init_caps_from_wave_format_opus(GstCaps *caps, const WAVEFORMATEX *format, UINT32 format_size) +{ + init_caps_codec_data(caps, format + 1, format->cbSize); + + gst_structure_remove_field(gst_caps_get_structure(caps, 0), "format"); + gst_structure_set_name(gst_caps_get_structure(caps, 0), "audio/x-opus"); + gst_caps_set_simple(caps, "channel-mapping-family", G_TYPE_INT, 0, NULL); + gst_caps_set_simple(caps, "block_align", G_TYPE_INT, format->nBlockAlign, NULL); + gst_caps_set_simple(caps, "depth", G_TYPE_INT, format->wBitsPerSample, NULL); + gst_caps_set_simple(caps, "bitrate", G_TYPE_INT, format->nAvgBytesPerSec * 8, NULL); +} + static void init_caps_from_wave_format(GstCaps *caps, const GUID *subtype, const void *format, UINT32 format_size) { @@ -201,6 +213,8 @@ static void init_caps_from_wave_format(GstCaps *caps, const GUID *subtype, return init_caps_from_wave_format_wma3(caps, format, format_size, 4); if (IsEqualGUID(subtype, &MFAudioFormat_Vorbis)) return init_caps_from_wave_format_vorbis(caps, format, format_size); + if (IsEqualGUID(subtype, &MFAudioFormat_Opus)) + return init_caps_from_wave_format_opus(caps, format, format_size); GST_FIXME("Unsupported subtype " WG_GUID_FORMAT, WG_GUID_ARGS(*subtype)); } From 188024baccb8c10a3a535af812fe588e711b9afe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 24 Dec 2024 10:11:38 +0100 Subject: [PATCH 1018/2542] HACK: msauddecmft: Expose Opus decoding support. --- dlls/msauddecmft/msauddecmft.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/msauddecmft/msauddecmft.c b/dlls/msauddecmft/msauddecmft.c index dd6f91fe5b64..672389564a27 100644 --- a/dlls/msauddecmft/msauddecmft.c +++ b/dlls/msauddecmft/msauddecmft.c @@ -124,6 +124,7 @@ HRESULT WINAPI DllRegisterServer(void) MFT_REGISTER_TYPE_INFO audio_decoder_mft_inputs[] = { {MFMediaType_Audio, MFAudioFormat_Vorbis}, + {MFMediaType_Audio, MFAudioFormat_Opus}, }; MFT_REGISTER_TYPE_INFO audio_decoder_mft_outputs[] = { From a093fb081654cdda45dab1ceefed52c341357771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 24 Dec 2024 10:11:38 +0100 Subject: [PATCH 1019/2542] HACK: winedmo: Convert Opus codec data to WAVEFORMATEX. --- dlls/winedmo/unix_media_type.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/winedmo/unix_media_type.c b/dlls/winedmo/unix_media_type.c index 3c492699326c..3753002744f4 100644 --- a/dlls/winedmo/unix_media_type.c +++ b/dlls/winedmo/unix_media_type.c @@ -184,6 +184,8 @@ static NTSTATUS audio_format_from_codec_params( const AVCodecParameters *params, #endif format_tag = wave_format_tag_from_codec_id( params->codec_id ); + if (params->codec_id == AV_CODEC_ID_OPUS) format_tag = WAVE_FORMAT_OPUS; + if (format_tag == WAVE_FORMAT_EXTENSIBLE || format_tag >> 16 || (channels > 2 && channel_mask != 0) || params->codec_id == AV_CODEC_ID_VORBIS) { From fed10bb4f9c7124f7d0479906ecf3de501e10b0e Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Tue, 10 Dec 2024 00:19:53 +1000 Subject: [PATCH 1020/2542] mf: Propagate errors from session_collect_nodes() to the caller of session_set_current_topology(). --- dlls/mf/session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/mf/session.c b/dlls/mf/session.c index d2cfc4db9959..9d6514df8a5f 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -2014,7 +2014,8 @@ static HRESULT session_set_current_topology(struct media_session *session, IMFTo session->source_shutdown_handled = FALSE; - session_collect_nodes(session); + if (FAILED(hr = session_collect_nodes(session))) + return hr; LIST_FOR_EACH_ENTRY(node, &session->presentation.nodes, struct topo_node, entry) { From cda3fe890881966e63da5de442f85083ffa40f81 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Tue, 10 Dec 2024 00:23:16 +1000 Subject: [PATCH 1021/2542] mf: Do not set the topo status if a source has been shut down. The status must remain MF_TOPOSTATUS_INVALID because the topology is invalid and must be handled as such in session_start(). --- dlls/mf/session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 9d6514df8a5f..5fc4bdabc121 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -521,7 +521,7 @@ static void session_set_topo_status(struct media_session *session, HRESULT statu IMFMediaEvent *event; PROPVARIANT param; - if (topo_status == MF_TOPOSTATUS_INVALID) + if (topo_status == MF_TOPOSTATUS_INVALID || status == MF_E_SHUTDOWN) return; if (list_empty(&session->topologies)) From b4d616a1b1982c8223d0404c4d0d6360e9226a0f Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Tue, 10 Dec 2024 00:30:14 +1000 Subject: [PATCH 1022/2542] mf/tests: Add a test for source shutdown after setting the topology. --- dlls/mf/tests/mf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 73526802b635..faf82f676db7 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -6453,6 +6453,7 @@ static void test_media_session_source_shutdown(void) HRESULT hr; enum { + TEST_TOPOLOGY, TEST_START, TEST_RESTART, TEST_PAUSE, @@ -6465,7 +6466,7 @@ static void test_media_session_source_shutdown(void) /* These tests don't cover asynchronous shutdown, which is difficult to consistently test. */ - for (shutdown_point = TEST_START; shutdown_point <= TEST_CLOSE; ++shutdown_point) + for (shutdown_point = TEST_TOPOLOGY; shutdown_point <= TEST_CLOSE; ++shutdown_point) { winetest_push_context("Test %d", shutdown_point); @@ -6489,6 +6490,8 @@ static void test_media_session_source_shutdown(void) hr = MFCreateMediaSession(NULL, &session); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); topology = create_test_topology(source, sink_activate, &duration); + if (shutdown_point == TEST_TOPOLOGY) + IMFMediaSource_Shutdown(source); hr = IMFMediaSession_SetTopology(session, 0, topology); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IMFTopology_Release(topology); @@ -6501,7 +6504,7 @@ static void test_media_session_source_shutdown(void) IMFMediaSource_Shutdown(source); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = wait_media_event(session, callback, MESessionStarted, 5000, &propvar); - ok(hr == (shutdown_point == TEST_START ? MF_E_INVALIDREQUEST : S_OK), "Unexpected hr %#lx.\n", hr); + ok(hr == (shutdown_point <= TEST_START ? MF_E_INVALIDREQUEST : S_OK), "Unexpected hr %#lx.\n", hr); switch (shutdown_point) { From e7edc76a7f3b10dee5263cf60c89089d3e3d7062 Mon Sep 17 00:00:00 2001 From: Timo Gurr Date: Fri, 17 Feb 2023 14:29:25 +0100 Subject: [PATCH 1023/2542] wine.inf: HACK: Disable SpeechSynthesisWrapper.dll for Pentiment. The game crashes when utilizing it and works without it, like seen already on the Steam Deck with its specific depot. https://steamdb.info/depot/1205522/ https://github.com/ValveSoftware/Proton/issues/6415#issuecomment-1379357568 Link: https://github.com/ValveSoftware/Proton/pull/6479 Link: https://github.com/ValveSoftware/wine/pull/176 --- loader/wine.inf.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index ad151a27ea8a..e9fe6f5648a3 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2936,3 +2936,5 @@ HKCU,Software\Wine\AppDefaults\RDR2.exe\DllOverrides,"vulkan-1",,"native" HKLM,Software\Khronos\OpenXR\1,"ActiveRuntime",,"C:\openxr\wineopenxr64.json" HKLM,Software\Wow6432Node\lucasarts entertainment company llc\Star Wars: Episode I Racer\v1.0,"Display Height",0x10001,480 HKLM,Software\Wow6432Node\lucasarts entertainment company llc\Star Wars: Episode I Racer\v1.0,"Display Width",0x10001,640 +;;Other app-specific overrides +HKCU,Software\Wine\AppDefaults\Pentiment.exe\DllOverrides,"SpeechSynthesisWrapper",,"disabled" From 316cfae111899d3a2945a76abd24dc84cc236d59 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Tue, 6 Jun 2023 11:30:37 +0300 Subject: [PATCH 1024/2542] wine.inf: HACK: Disable SpeechSynthWrapper.dll for Grounded. The game crashes when utilizing it and works without it, like seen already on the Steam Deck with its specific depot. CW-Bug-Id: #20918 --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index e9fe6f5648a3..e9c841b073cd 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2938,3 +2938,4 @@ HKLM,Software\Wow6432Node\lucasarts entertainment company llc\Star Wars: Episode HKLM,Software\Wow6432Node\lucasarts entertainment company llc\Star Wars: Episode I Racer\v1.0,"Display Width",0x10001,640 ;;Other app-specific overrides HKCU,Software\Wine\AppDefaults\Pentiment.exe\DllOverrides,"SpeechSynthesisWrapper",,"disabled" +HKCU,Software\Wine\AppDefaults\Maine-Win64-Shipping.exe\DllOverrides,"SpeechSynthWrapper",0x2,"disabled" From 75f1e7d903d65aedfcf791ca6cd5aa35d610ed65 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Fri, 3 Jan 2025 14:57:18 +0200 Subject: [PATCH 1025/2542] winevulkan: Make device memory wrapper available in callbacks. With VK_EXT_device_address_binding_report we can get debug_util callbacks used to track memory bindings. Since it's the host's implementation that starts the callback we have to be sure that we have a way of converting it to the client side's variant before it's added to the handle map - i.e. we don't know the host handle at that time yet. Link: https://gitlab.winehq.org/wine/wine/-/merge_requests/5658 --- dlls/winevulkan/vulkan.c | 34 +++++++++++++++++++++++++++++++- dlls/winevulkan/vulkan_private.h | 2 ++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 78c9a29bf958..5ada61c09bb6 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -233,6 +233,25 @@ static VkResult get_semaphore_value(struct vulkan_device *device, VkSemaphore se return device->p_vkGetSemaphoreCounterValue(device->host.device, sem, value); } + +static void set_transient_client_handle(struct wine_instance *instance, uint64_t client_handle) +{ + uint64_t *handle = pthread_getspecific(instance->transient_object_handle); + if (!handle) + { + handle = malloc(sizeof(uint64_t)); + pthread_setspecific(instance->transient_object_handle, handle); + } + *handle = client_handle; +} + +static uint64_t get_transient_handle(struct wine_instance *instance) +{ + uint64_t *handle = pthread_getspecific(instance->transient_object_handle); + return handle && *handle; +} + + static VkBool32 debug_utils_callback_conversion(VkDebugUtilsMessageSeverityFlagBitsEXT severity, VkDebugUtilsMessageTypeFlagsEXT message_types, const VkDebugUtilsMessengerCallbackDataEXT *callback_data, @@ -243,6 +262,8 @@ static VkBool32 debug_utils_callback_conversion(VkDebugUtilsMessageSeverityFlagB struct wine_debug_utils_messenger *object; struct debug_utils_object dummy_object, *objects; struct debug_utils_label dummy_label, *labels; + VkInstance instance; + struct wine_instance *wine_instance; UINT size, strings_len; char *ptr, *strings; ULONG ret_len; @@ -252,13 +273,16 @@ static VkBool32 debug_utils_callback_conversion(VkDebugUtilsMessageSeverityFlagB TRACE("%i, %u, %p, %p\n", severity, message_types, callback_data, user_data); object = user_data; + instance = object->instance->host.instance; - if (!object->instance->host.instance) + if (!instance) { /* instance wasn't yet created, this is a message from the host loader */ return VK_FALSE; } + wine_instance = CONTAINING_RECORD(object->instance, struct wine_instance, obj); + if ((address = callback_data->pNext)) { if (address->sType != VK_STRUCTURE_TYPE_DEVICE_ADDRESS_BINDING_CALLBACK_DATA_EXT) address = NULL; @@ -315,6 +339,8 @@ static VkBool32 debug_utils_callback_conversion(VkDebugUtilsMessageSeverityFlagB if (wine_vk_is_type_wrapped(objects[i].object_type)) { objects[i].object_handle = client_handle_from_host(object->instance, objects[i].object_handle); + if (!objects[i].object_handle) + objects[i].object_handle = get_transient_handle(wine_instance); if (!objects[i].object_handle) { WARN("handle conversion failed 0x%s\n", wine_dbgstr_longlong(callback_data->pObjects[i].objectHandle)); @@ -1272,6 +1298,8 @@ VkResult wine_vkCreateInstance(const VkInstanceCreateInfo *create_info, instance->quirks |= WINEVULKAN_QUIRK_GET_DEVICE_PROC_ADDR; } + pthread_key_create(&instance->transient_object_handle, free); + TRACE("Created instance %p, host_instance %p.\n", instance, instance->obj.host.instance); for (i = 0; i < instance->phys_dev_count; i++) @@ -1343,6 +1371,8 @@ void wine_vkDestroyInstance(VkInstance client_instance, const VkAllocationCallba } vulkan_instance_remove_object(&instance->obj, &instance->obj.obj); + pthread_key_delete(instance->transient_object_handle); + if (instance->objects.compare) pthread_rwlock_destroy(&instance->objects_lock); free(instance->utils_messengers); free(instance); @@ -2568,6 +2598,7 @@ VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInf struct vulkan_device *device = vulkan_device_from_handle(client_device); struct wine_phys_dev *physical_device = CONTAINING_RECORD(device->physical_device, struct wine_phys_dev, obj); struct vulkan_instance *instance = device->physical_device->instance; + struct wine_instance *wine_instance = CONTAINING_RECORD(instance, struct wine_instance, obj); struct wine_device_memory *memory; VkMemoryAllocateInfo info = *alloc_info; VkImportMemoryHostPointerInfoEXT host_pointer_info; @@ -2745,6 +2776,7 @@ VkResult wine_vkAllocateMemory(VkDevice client_device, const VkMemoryAllocateInf } } + set_transient_client_handle(wine_instance, (uintptr_t)memory); result = device->p_vkAllocateMemory(device->host.device, &info, NULL, &host_device_memory); if (result == VK_SUCCESS && memory->handle == INVALID_HANDLE_VALUE && export_info && export_info->handleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) { diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index d01eb8f0914d..9544a4785e22 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -97,6 +97,8 @@ struct wine_instance struct rb_tree objects; pthread_rwlock_t objects_lock; + pthread_key_t transient_object_handle; + /* We cache devices as we need to wrap them as they are dispatchable objects. */ uint32_t phys_dev_count; struct wine_phys_dev phys_devs[]; From 52965925bb9424ac11b591e9aa8d3a7a1a662a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 6 Jan 2025 15:13:15 +0100 Subject: [PATCH 1026/2542] winex11: Always activate windows if they can be, without sending WM_MOUSEACTIVATE. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48121 --- dlls/winex11.drv/event.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 8c4a4459b569..1a0621016bc1 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -808,16 +808,8 @@ static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event ) if (can_activate_window(hwnd)) { - /* simulate a mouse click on the menu to find out - * whether the window wants to be activated */ - LRESULT ma = send_message( hwnd, WM_MOUSEACTIVATE, - (WPARAM)NtUserGetAncestor( hwnd, GA_ROOT ), - MAKELONG( HTMENU, WM_LBUTTONDOWN ) ); - if (ma != MA_NOACTIVATEANDEAT && ma != MA_NOACTIVATE) - { - set_focus( event->display, hwnd, event_time ); - return; - } + set_focus( event->display, hwnd, event_time ); + return; } else if (hwnd == NtUserGetDesktopWindow()) { From 5551c3f8da54f409b49a383676ab09c663aeeb5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 7 Jan 2025 13:31:34 +0100 Subject: [PATCH 1027/2542] winebus: Generate unique serial numbers when adding devices. CW-Bug-Id: #24644 --- dlls/winebus.sys/main.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c index f287533702f2..e0e95b86e131 100644 --- a/dlls/winebus.sys/main.c +++ b/dlls/winebus.sys/main.c @@ -287,6 +287,18 @@ static void remove_pending_irps(DEVICE_OBJECT *device) } } +static void make_unique_serial(struct device_extension *device) +{ + struct device_extension *ext; + + LIST_FOR_EACH_ENTRY(ext, &device_list, struct device_extension, entry) + if (!wcscmp(device->desc.serialnumber, ext->desc.serialnumber)) break; + if (&ext->entry == &device_list && *device->desc.serialnumber) return; + + swprintf(device->desc.serialnumber, ARRAY_SIZE(device->desc.serialnumber), L"%04x%08x%04x%04x", + device->index, device->desc.input, device->desc.pid, device->desc.vid); +} + static DEVICE_OBJECT *bus_create_hid_device(struct device_desc *desc, UINT64 unix_device) { struct device_extension *ext; @@ -331,6 +343,10 @@ static DEVICE_OBJECT *bus_create_hid_device(struct device_desc *desc, UINT64 uni InitializeCriticalSectionEx(&ext->cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO); ext->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": cs"); + /* Overcooked! All You Can Eat only adds controllers with unique serial numbers + * Prefer keeping serial numbers unique over keeping them consistent across runs */ + make_unique_serial(ext); + /* add to list of pnp devices */ if (before) list_add_before(before, &ext->entry); From b7f8b7996800882d069991bd3d64fa1d2c6a19b8 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Wed, 8 Jan 2025 13:37:52 +1100 Subject: [PATCH 1028/2542] mfmediaengine: Use D3D resource when scaling. The D3D resource is currently only used when no scaling is required. This patch allows the D3D resource to be used on the scaling path (when availble). This addressess a performance regression in MSFS as a result of the Wine merge. CW-Bug-Id: #22403 --- dlls/mfmediaengine/main.c | 69 +++++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 24 deletions(-) diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c index 8457ba0853db..5b6c762ca487 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c @@ -2389,11 +2389,39 @@ static void media_engine_adjust_destination_for_ratio(const struct media_engine } } +static HRESULT get_d3d11_resource_from_sample(IMFSample *sample, ID3D11Texture2D **resource, UINT *subresource) +{ + IMFDXGIBuffer *dxgi_buffer; + IMFMediaBuffer *buffer; + HRESULT hr; + + *resource = NULL; + *subresource = 0; + + if (FAILED(hr = IMFSample_GetBufferByIndex(sample, 0, &buffer))) + return hr; + + if (SUCCEEDED(hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMFDXGIBuffer, (void **)&dxgi_buffer))) + { + IMFDXGIBuffer_GetSubresourceIndex(dxgi_buffer, subresource); + hr = IMFDXGIBuffer_GetResource(dxgi_buffer, &IID_ID3D11Texture2D, (void **)resource); + IMFDXGIBuffer_Release(dxgi_buffer); + } + + IMFMediaBuffer_Release(buffer); + return hr; +} + static void media_engine_update_d3d11_frame_surface(ID3D11DeviceContext *context, struct media_engine *engine) { D3D11_TEXTURE2D_DESC surface_desc; + D3D11_TEXTURE2D_DESC src_desc; IMFMediaBuffer *media_buffer; + ID3D11Texture2D *src_texture; + ID3D11Device *device; IMFSample *sample; + UINT subresource; + HRESULT hr; if (!video_frame_sink_get_sample(engine->presentation.frame_sink, &sample)) return; @@ -2411,7 +2439,23 @@ static void media_engine_update_d3d11_frame_surface(ID3D11DeviceContext *context surface_desc.Width = 0; } - if (SUCCEEDED(IMFSample_ConvertToContiguousBuffer(sample, &media_buffer))) + if (SUCCEEDED(hr = get_d3d11_resource_from_sample(sample, &src_texture, &subresource))) + { + + ID3D11Texture2D_GetDesc(src_texture, &src_desc); + + if (SUCCEEDED(hr = media_engine_lock_d3d_device(engine, &device))) + { + ID3D11Device_GetImmediateContext(device, &context); + ID3D11DeviceContext_CopyResource(context, (ID3D11Resource *)engine->video_frame.d3d11.source, (ID3D11Resource *)src_texture); + ID3D11DeviceContext_Release(context); + media_engine_unlock_d3d_device(engine, device); + } + + ID3D11Texture2D_Release(src_texture); + } + + if (FAILED(hr) && SUCCEEDED(IMFSample_ConvertToContiguousBuffer(sample, &media_buffer))) { BYTE *buffer; DWORD buffer_size; @@ -2431,29 +2475,6 @@ static void media_engine_update_d3d11_frame_surface(ID3D11DeviceContext *context IMFSample_Release(sample); } -static HRESULT get_d3d11_resource_from_sample(IMFSample *sample, ID3D11Texture2D **resource, UINT *subresource) -{ - IMFDXGIBuffer *dxgi_buffer; - IMFMediaBuffer *buffer; - HRESULT hr; - - *resource = NULL; - *subresource = 0; - - if (FAILED(hr = IMFSample_GetBufferByIndex(sample, 0, &buffer))) - return hr; - - if (SUCCEEDED(hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMFDXGIBuffer, (void **)&dxgi_buffer))) - { - IMFDXGIBuffer_GetSubresourceIndex(dxgi_buffer, subresource); - hr = IMFDXGIBuffer_GetResource(dxgi_buffer, &IID_ID3D11Texture2D, (void **)resource); - IMFDXGIBuffer_Release(dxgi_buffer); - } - - IMFMediaBuffer_Release(buffer); - return hr; -} - static HRESULT media_engine_transfer_d3d11(struct media_engine *engine, ID3D11Texture2D *dst_texture, const MFVideoNormalizedRect *src_rect, const RECT *dst_rect, const MFARGB *color) { From bb383ff990b9dd7789160bedc765026dc6c5a9a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 8 Jan 2025 12:04:07 +0100 Subject: [PATCH 1029/2542] HACK: winedmo: Avoid setting negative sample times. Otherwise it ends up being translated to a very high positive time in the audio decoder, as GStreamer time seems to always be positive, and it makes Halo Infinite campain intro video play run very quickly, or stutter if we cannot keep up. This is probably a hack and needs to be better checked to confirm how these samples should be reported. CW-Bug-Id: #24641 --- dlls/winedmo/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winedmo/main.c b/dlls/winedmo/main.c index 849c1e675cb7..633225749053 100644 --- a/dlls/winedmo/main.c +++ b/dlls/winedmo/main.c @@ -144,7 +144,7 @@ static void buffer_unlock( DMO_OUTPUT_DATA_BUFFER *buffer, struct sample *sample if (SUCCEEDED(hr = IMediaBuffer_QueryInterface( buffer->pBuffer, &IID_IMFSample, (void **)&object ))) { if (sample->dts != INT64_MIN) IMFSample_SetUINT64( object, &MFSampleExtension_DecodeTimestamp, sample->dts ); - if (sample->pts != INT64_MIN) IMFSample_SetSampleTime( object, sample->pts ); + if (sample->pts != INT64_MIN) IMFSample_SetSampleTime( object, sample->pts < 0 ? 0 : sample->pts ); if (sample->duration != INT64_MIN) IMFSample_SetSampleDuration( object, sample->duration ); if (sample->flags & SAMPLE_FLAG_SYNC_POINT) IMFSample_SetUINT32( object, &MFSampleExtension_CleanPoint, 1 ); IMFSample_Release( object ); From ec9ee9b43fd6b4a8d990e9613dec4d9ae3bc3061 Mon Sep 17 00:00:00 2001 From: Shaun Ren Date: Tue, 5 Mar 2024 23:50:48 -0500 Subject: [PATCH 1030/2542] protontts: Implement basic TTS functionality using Piper. CW-Bug-Id: #18723 CW-Bug-Id: #20918 CW-Bug-Id: #21959 CW-Bug-Id: #22520 CW-Bug-Id: #22894 --- configure.ac | 14 + dlls/protontts/Makefile.in | 11 + dlls/protontts/main.c | 130 ++++++++ dlls/protontts/protontts.spec | 4 + dlls/protontts/protontts_classes.idl | 32 ++ dlls/protontts/protontts_private.h | 93 ++++++ dlls/protontts/tts.c | 453 +++++++++++++++++++++++++++ dlls/protontts/unixlib.c | 391 +++++++++++++++++++++++ 8 files changed, 1128 insertions(+) create mode 100644 dlls/protontts/Makefile.in create mode 100644 dlls/protontts/main.c create mode 100644 dlls/protontts/protontts.spec create mode 100644 dlls/protontts/protontts_classes.idl create mode 100644 dlls/protontts/protontts_private.h create mode 100644 dlls/protontts/tts.c create mode 100644 dlls/protontts/unixlib.c diff --git a/configure.ac b/configure.ac index 8fd8f1ec9288..8a3af53d503a 100644 --- a/configure.ac +++ b/configure.ac @@ -53,6 +53,7 @@ AC_ARG_WITH(oss, AS_HELP_STRING([--without-oss],[do not use the OSS sound AC_ARG_WITH(pcap, AS_HELP_STRING([--without-pcap],[do not use the Packet Capture library]), [if test "x$withval" = "xno"; then ac_cv_header_pcap_pcap_h=no; fi]) AC_ARG_WITH(pcsclite, AS_HELP_STRING([--without-pcsclite],[do not use PCSC lite])) +AC_ARG_WITH(piper, AS_HELP_STRING([--without-piper],[do not use the Piper TTS library])) AC_ARG_WITH(pthread, AS_HELP_STRING([--without-pthread],[do not use the pthread library])) AC_ARG_WITH(pulse, AS_HELP_STRING([--without-pulse],[do not use PulseAudio sound support])) AC_ARG_WITH(sane, AS_HELP_STRING([--without-sane],[do not use SANE (scanner support)])) @@ -1918,6 +1919,18 @@ fi WINE_NOTICE_WITH(gcrypt,[test "x$ac_cv_lib_soname_gcrypt" = "x"], [libgcrypt ${notice_platform}development files not found, GCRYPT won't be supported.]) +dnl **** Check for libpiper **** +if test "x$with_piper" != "xno" +then + WINE_PACKAGE_FLAGS(PIPER,[piper],[-lpiper],,, + [AC_CHECK_HEADER(piper/piper_c.h, + [AC_CHECK_LIB(piper,piperInitialize,[:],[PIPER_LIBS=""],[$PIPER_LIBS])], + [PIPER_LIBS=""])]) +fi +WINE_NOTICE_WITH(piper,[test "$ac_cv_lib_piper_piperInitialize" != "yes"], + [libpiper ${notice_platform}development files not found, protontts won't be supported.], + [enable_protontts]) + dnl **** Check for gcc specific options **** if test "x${GCC}" = "xyes" @@ -3055,6 +3068,7 @@ WINE_CONFIG_MAKEFILE(dlls/prntvpt/tests) WINE_CONFIG_MAKEFILE(dlls/profapi) WINE_CONFIG_MAKEFILE(dlls/propsys) WINE_CONFIG_MAKEFILE(dlls/propsys/tests) +WINE_CONFIG_MAKEFILE(dlls/protontts) WINE_CONFIG_MAKEFILE(dlls/psapi) WINE_CONFIG_MAKEFILE(dlls/psapi/tests) WINE_CONFIG_MAKEFILE(dlls/pstorec) diff --git a/dlls/protontts/Makefile.in b/dlls/protontts/Makefile.in new file mode 100644 index 000000000000..b4705778a47c --- /dev/null +++ b/dlls/protontts/Makefile.in @@ -0,0 +1,11 @@ +MODULE = protontts.dll +UNIXLIB = protontts.so +IMPORTS = ole32 +UNIX_CFLAGS = $(PIPER_CFLAGS) +UNIX_LIBS = $(PIPER_LIBS) $(PTHREAD_LIBS) + +SOURCES = \ + main.c \ + tts.c \ + protontts_classes.idl \ + unixlib.c diff --git a/dlls/protontts/main.c b/dlls/protontts/main.c new file mode 100644 index 000000000000..a9dad946400d --- /dev/null +++ b/dlls/protontts/main.c @@ -0,0 +1,130 @@ +/* protontts main file. + * + * Copyright 2023 Shaun Ren for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "initguid.h" +#include "objbase.h" +#include "sapiddk.h" + +#include "wine/debug.h" + +#include "protontts_classes.h" +#include "protontts_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(protontts); + +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) +{ + if (reason == DLL_PROCESS_ATTACH) + { + DisableThreadLibraryCalls(instance); + __wine_init_unix_call(); + WINE_UNIX_CALL(unix_process_attach, NULL); + } + else if (reason == DLL_PROCESS_DETACH) + { + free_tts(); + } + + return TRUE; +} + +struct class_factory +{ + IClassFactory IClassFactory_iface; + HRESULT (*create_instance)(REFIID iid, void **out); +}; + +static inline struct class_factory *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, struct class_factory, IClassFactory_iface); +} + +static HRESULT WINAPI class_factory_QueryInterface(IClassFactory *iface, REFIID iid, void **out) +{ + TRACE("(%p, %s, %p).\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IClassFactory)) + { + *out = iface; + IClassFactory_AddRef(iface); + return S_OK; + } + + WARN("%s not implemented.\n", debugstr_guid(iid)); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI class_factory_AddRef(IClassFactory *iface) +{ + return 2; +} + +static ULONG WINAPI class_factory_Release(IClassFactory *iface) +{ + return 1; +} + +static HRESULT WINAPI class_factory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID iid, void **obj) +{ + struct class_factory *This = impl_from_IClassFactory(iface); + + TRACE("(%p, %p, %s, %p).\n", iface, outer, debugstr_guid(iid), obj); + + *obj = NULL; + if (outer) return CLASS_E_NOAGGREGATION; + return This->create_instance(iid, obj); +} + +static HRESULT WINAPI class_factory_LockServer(IClassFactory *iface, BOOL lock) +{ + FIXME("(%d): stub.\n", lock); + return S_OK; +} + +static const IClassFactoryVtbl class_factory_vtbl = +{ + class_factory_QueryInterface, + class_factory_AddRef, + class_factory_Release, + class_factory_CreateInstance, + class_factory_LockServer, +}; + +static struct class_factory ttsengine_cf = {{&class_factory_vtbl}, ttsengine_create}; + +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **obj) +{ + IClassFactory *cf; + + TRACE("(%s, %s, %p).\n", debugstr_guid(clsid), debugstr_guid(iid), obj); + + if (IsEqualCLSID(clsid, &CLSID_TTSEngineCom)) + cf = &ttsengine_cf.IClassFactory_iface; + else + return CLASS_E_CLASSNOTAVAILABLE; + + return IClassFactory_QueryInterface(cf, iid, obj); +} diff --git a/dlls/protontts/protontts.spec b/dlls/protontts/protontts.spec new file mode 100644 index 000000000000..b16365d0c9fc --- /dev/null +++ b/dlls/protontts/protontts.spec @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff --git a/dlls/protontts/protontts_classes.idl b/dlls/protontts/protontts_classes.idl new file mode 100644 index 000000000000..28f25943199d --- /dev/null +++ b/dlls/protontts/protontts_classes.idl @@ -0,0 +1,32 @@ +/* + * protontts classes. + * + * Copyright 2023 Shaun Ren for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep register + +[ + uuid(52808ae1-d977-4cd8-92d2-feacb92fe276), + helpstring("Proton TTS Engine Class"), + threading(both) +] +coclass TTSEngineCom +{ + interface ISpTTSEngine; + interface ISpObjectWithToken; +}; diff --git a/dlls/protontts/protontts_private.h b/dlls/protontts/protontts_private.h new file mode 100644 index 000000000000..36539af7d905 --- /dev/null +++ b/dlls/protontts/protontts_private.h @@ -0,0 +1,93 @@ +/* + * protontts private header file. + * + * Copyright 2023 Shaun Ren for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __PROTONTTS_PRIVATE_H +#define __PROTONTTS_PRIVATE_H + +#include +#include +#include "windef.h" +#include "winternl.h" + +#include "wine/unixlib.h" + +void free_tts(void); +HRESULT ttsengine_create(REFIID iid, void **obj); + +typedef UINT64 tts_t; +typedef UINT64 tts_voice_t; + +struct tts_voice_load_params +{ + tts_t tts; + const char *model_path; + INT64 speaker_id; + tts_voice_t voice; +}; + +struct tts_voice_get_config_params +{ + tts_voice_t voice; + float length_scale; + INT32 sample_rate; + INT32 sample_width; + INT32 channels; +}; + +struct tts_voice_set_config_params +{ + tts_voice_t voice; + const float *length_scale; +}; + +struct tts_voice_synthesize_params +{ + tts_voice_t voice; + const char *text; + UINT32 size; + HANDLE abort_event; +}; + +struct tts_voice_audio_lock_params +{ + tts_voice_t voice; + void *buf; + UINT32 size; + UINT8 done; +}; + +enum unix_funcs +{ + unix_process_attach, + + unix_tts_create, + unix_tts_destroy, + + unix_tts_voice_load, + unix_tts_voice_destroy, + unix_tts_voice_get_config, + unix_tts_voice_set_config, + unix_tts_voice_synthesize, + + unix_tts_voice_audio_lock, + unix_tts_voice_audio_release, +}; + +#endif /* __PROTONTTS_PRIVATE_H */ diff --git a/dlls/protontts/tts.c b/dlls/protontts/tts.c new file mode 100644 index 000000000000..f0f19d6ba210 --- /dev/null +++ b/dlls/protontts/tts.c @@ -0,0 +1,453 @@ +/* + * protontts SAPI engine implementation. + * + * Copyright 2023 Shaun Ren for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "objbase.h" + +#include "sapiddk.h" +#include "sperror.h" + +#include "wine/debug.h" + +#include "protontts_private.h" + +#include "initguid.h" + +WINE_DEFAULT_DEBUG_CHANNEL(protontts); + +DEFINE_GUID(SPDFID_WaveFormatEx, 0xc31adbae,0x527f,0x4ff5,0xa2,0x30,0xf6,0x2b,0xb6,0x1f,0xf7,0x0c); + +struct ttsengine +{ + ISpTTSEngine ISpTTSEngine_iface; + ISpObjectWithToken ISpObjectWithToken_iface; + LONG ref; + + ISpObjectToken *token; + INT64 speaker_id; + float base_length_scale; + tts_voice_t voice; +}; + +static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT; +static tts_t tts = 0; + +static inline struct ttsengine *impl_from_ISpTTSEngine(ISpTTSEngine *iface) +{ + return CONTAINING_RECORD(iface, struct ttsengine, ISpTTSEngine_iface); +} + +static inline struct ttsengine *impl_from_ISpObjectWithToken(ISpObjectWithToken *iface) +{ + return CONTAINING_RECORD(iface, struct ttsengine, ISpObjectWithToken_iface); +} + +static BOOL WINAPI init_tts(INIT_ONCE *once, void *param, void **ctx) +{ + WINE_UNIX_CALL(unix_tts_create, &tts); + return tts != 0; +} + +void free_tts(void) +{ + if (tts) WINE_UNIX_CALL(unix_tts_destroy, &tts); +} + +static tts_voice_t tts_voice_load(tts_t tts, const char *model_path, INT64 speaker_id) +{ + struct tts_voice_load_params params = + { + .tts = tts, + .model_path = model_path, + .speaker_id = speaker_id, + .voice = 0, + }; + + WINE_UNIX_CALL(unix_tts_voice_load, ¶ms); + return params.voice; +} + +static void tts_voice_set_length_scale(tts_voice_t voice, float length_scale) +{ + struct tts_voice_set_config_params params = + { + .voice = voice, + .length_scale = &length_scale, + }; + + WINE_UNIX_CALL(unix_tts_voice_set_config, ¶ms); +} + +static void tts_voice_audio_lock(tts_voice_t voice, void **buf, UINT32 *size, bool *done) +{ + struct tts_voice_audio_lock_params params = + { + .voice = voice, + }; + + WINE_UNIX_CALL(unix_tts_voice_audio_lock, ¶ms); + *buf = params.buf; + *size = params.size; + *done = params.done; + + TRACE("buf = %p, size = %u, done = %d.\n", params.buf, params.size, params.done); +} + +static HRESULT WINAPI ttsengine_QueryInterface(ISpTTSEngine *iface, REFIID iid, void **obj) +{ + struct ttsengine *This = impl_from_ISpTTSEngine(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(iid), obj); + + if (IsEqualIID(iid, &IID_IUnknown) || + IsEqualIID(iid, &IID_ISpTTSEngine)) + { + *obj = &This->ISpTTSEngine_iface; + } + else if (IsEqualIID(iid, &IID_ISpObjectWithToken)) + *obj = &This->ISpObjectWithToken_iface; + else + { + *obj = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*obj); + return S_OK; +} + +static ULONG WINAPI ttsengine_AddRef(ISpTTSEngine *iface) +{ + struct ttsengine *This = impl_from_ISpTTSEngine(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%lu\n", This, ref); + + return ref; +} + +static ULONG WINAPI ttsengine_Release(ISpTTSEngine *iface) +{ + struct ttsengine *This = impl_from_ISpTTSEngine(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%lu\n", This, ref); + + if (!ref) + { + if (This->token) ISpObjectToken_Release(This->token); + if (This->voice) WINE_UNIX_CALL(unix_tts_voice_destroy, &This->voice); + + free(This); + } + + return ref; +} + +static DWORD CALLBACK synthesize_thread_proc(void *params) +{ + SetThreadDescription(GetCurrentThread(), L"protontts_synthesize"); + return WINE_UNIX_CALL(unix_tts_voice_synthesize, params); +} + +static HRESULT WINAPI ttsengine_Speak(ISpTTSEngine *iface, DWORD flags, REFGUID fmtid, + const WAVEFORMATEX *wfx, const SPVTEXTFRAG *frag_list, + ISpTTSEngineSite *site) +{ + struct ttsengine *This = impl_from_ISpTTSEngine(iface); + HANDLE abort_event; + HANDLE thread = NULL; + char *text = NULL; + HRESULT hr = S_OK; + + TRACE("(%p, %#lx, %s, %p, %p, %p).\n", iface, flags, debugstr_guid(fmtid), wfx, frag_list, site); + + if (!This->voice) + return SPERR_UNINITIALIZED; + + if (!(abort_event = CreateEventW(NULL, FALSE, FALSE, NULL))) + return HRESULT_FROM_WIN32(GetLastError()); + + tts_voice_set_length_scale(This->voice, This->base_length_scale); + for (; frag_list; frag_list = frag_list->pNext) + { + struct tts_voice_synthesize_params params; + bool done; + + if (ISpTTSEngineSite_GetActions(site) & SPVES_ABORT) + return S_OK; + + params.size = WideCharToMultiByte(CP_UTF8, 0, frag_list->pTextStart, frag_list->ulTextLen, NULL, 0, NULL, NULL) + 1; + if (!(text = malloc(params.size))) + { + hr = E_OUTOFMEMORY; + goto done; + } + WideCharToMultiByte(CP_UTF8, 0, frag_list->pTextStart, frag_list->ulTextLen, text, params.size, NULL, NULL); + text[params.size - 1] = '\0'; + + params.voice = This->voice; + params.text = text; + params.abort_event = abort_event; + + if (!(thread = CreateThread(NULL, 0, synthesize_thread_proc, ¶ms, 0, NULL))) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + goto done; + } + + for (done = false; !done;) + { + void *buf; + UINT32 size; + + Sleep(50); + + if (ISpTTSEngineSite_GetActions(site) & SPVES_ABORT) + { + SetEvent(abort_event); + goto done; + } + + tts_voice_audio_lock(This->voice, &buf, &size, &done); + if (buf) + hr = ISpTTSEngineSite_Write(site, buf, size, NULL); + WINE_UNIX_CALL(unix_tts_voice_audio_release, &This->voice); + + if (FAILED(hr)) + { + SetEvent(abort_event); + goto done; + } + } + + CloseHandle(thread); + thread = NULL; + } + +done: + if (thread) + { + WaitForSingleObject(thread, INFINITE); + CloseHandle(thread); + } + CloseHandle(abort_event); + free(text); + + return hr; +} + +static HRESULT WINAPI ttsengine_GetOutputFormat(ISpTTSEngine *iface, const GUID *fmtid, + const WAVEFORMATEX *wfx, GUID *out_fmtid, + WAVEFORMATEX **out_wfx) +{ + struct ttsengine *This = impl_from_ISpTTSEngine(iface); + struct tts_voice_get_config_params params = + { + .voice = This->voice, + }; + + TRACE("(%p, %s, %p, %p, %p).\n", iface, debugstr_guid(fmtid), wfx, out_fmtid, out_wfx); + + if (!This->voice) + return SPERR_UNINITIALIZED; + + *out_fmtid = SPDFID_WaveFormatEx; + if (!(*out_wfx = CoTaskMemAlloc(sizeof(WAVEFORMATEX)))) + return E_OUTOFMEMORY; + + WINE_UNIX_CALL(unix_tts_voice_get_config, ¶ms); + + (*out_wfx)->wFormatTag = WAVE_FORMAT_PCM; + (*out_wfx)->nChannels = params.channels; + (*out_wfx)->nSamplesPerSec = params.sample_rate; + (*out_wfx)->wBitsPerSample = params.sample_width * 8; + (*out_wfx)->nBlockAlign = params.sample_width * params.channels; + (*out_wfx)->nAvgBytesPerSec = params.sample_rate * params.sample_width * params.channels; + (*out_wfx)->cbSize = 0; + + return S_OK; +} + +static ISpTTSEngineVtbl ttsengine_vtbl = +{ + ttsengine_QueryInterface, + ttsengine_AddRef, + ttsengine_Release, + ttsengine_Speak, + ttsengine_GetOutputFormat, +}; + +static HRESULT WINAPI objwithtoken_QueryInterface(ISpObjectWithToken *iface, REFIID iid, void **obj) +{ + struct ttsengine *This = impl_from_ISpObjectWithToken(iface); + + TRACE("(%p, %s, %p).\n", iface, debugstr_guid(iid), obj); + + return ISpTTSEngine_QueryInterface(&This->ISpTTSEngine_iface, iid, obj); +} + +static ULONG WINAPI objwithtoken_AddRef(ISpObjectWithToken *iface) +{ + struct ttsengine *This = impl_from_ISpObjectWithToken(iface); + + TRACE("(%p).\n", iface); + + return ISpTTSEngine_AddRef(&This->ISpTTSEngine_iface); +} + +static ULONG WINAPI objwithtoken_Release(ISpObjectWithToken *iface) +{ + struct ttsengine *This = impl_from_ISpObjectWithToken(iface); + + TRACE("(%p).\n", iface); + + return ISpTTSEngine_Release(&This->ISpTTSEngine_iface); +} + +static HRESULT WINAPI objwithtoken_SetObjectToken(ISpObjectWithToken *iface, ISpObjectToken *token) +{ + struct ttsengine *This = impl_from_ISpObjectWithToken(iface); + char *model_path = NULL; + size_t model_path_size; + WCHAR *value; + int ret; + HRESULT hr = S_OK; + + TRACE("(%p, %p).\n", iface, token); + + if (!token) + return E_INVALIDARG; + if (This->token) + return SPERR_ALREADY_INITIALIZED; + + if (FAILED(hr = ISpObjectToken_GetStringValue(token, L"ModelPath", &value))) + return hr; + + model_path_size = WideCharToMultiByte(CP_UTF8, 0, value, -1, NULL, 0, NULL, NULL); + if (!(model_path = malloc(model_path_size))) + { + CoTaskMemFree(value); + return E_OUTOFMEMORY; + } + WideCharToMultiByte(CP_UTF8, 0, value, -1, model_path, model_path_size, NULL, NULL); + + CoTaskMemFree(value); + + hr = ISpObjectToken_GetStringValue(token, L"SpeakerID", &value); + if (FAILED(hr) && hr != SPERR_NOT_FOUND) + goto done; + else if (SUCCEEDED(hr)) + { + ret = swscanf(value, L"%I64d", &This->speaker_id); + CoTaskMemFree(value); + if (ret != 1) + { + hr = E_INVALIDARG; + goto done; + } + } + + hr = ISpObjectToken_GetStringValue(token, L"LengthScale", &value); + if (FAILED(hr) && hr != SPERR_NOT_FOUND) + goto done; + else if (SUCCEEDED(hr)) + { + ret = swscanf(value, L"%f", &This->base_length_scale); + CoTaskMemFree(value); + if (ret != 1) + { + hr = E_INVALIDARG; + goto done; + } + } + + This->voice = tts_voice_load(tts, model_path, This->speaker_id); + if (!This->voice) + { + hr = E_FAIL; + goto done; + } + + ISpObjectToken_AddRef(token); + This->token = token; + +done: + free(model_path); + return hr; +} + +static HRESULT WINAPI objwithtoken_GetObjectToken(ISpObjectWithToken *iface, ISpObjectToken **token) +{ + struct ttsengine *This = impl_from_ISpObjectWithToken(iface); + + TRACE("(%p, %p).\n", iface, token); + + if (!token) + return E_POINTER; + + *token = This->token; + if (*token) + { + ISpObjectToken_AddRef(*token); + return S_OK; + } + else + return S_FALSE; +} + +static const ISpObjectWithTokenVtbl objwithtoken_vtbl = +{ + objwithtoken_QueryInterface, + objwithtoken_AddRef, + objwithtoken_Release, + objwithtoken_SetObjectToken, + objwithtoken_GetObjectToken +}; + +HRESULT ttsengine_create(REFIID iid, void **obj) +{ + struct ttsengine *This; + HRESULT hr; + + if (!InitOnceExecuteOnce(&init_once, init_tts, NULL, NULL) || !tts) + return E_FAIL; + + if (!(This = malloc(sizeof(*This)))) + return E_OUTOFMEMORY; + + This->ISpTTSEngine_iface.lpVtbl = &ttsengine_vtbl; + This->ISpObjectWithToken_iface.lpVtbl = &objwithtoken_vtbl; + This->ref = 1; + + This->token = NULL; + This->speaker_id = 0; + This->base_length_scale = 1.0f; + This->voice = 0; + + hr = ISpTTSEngine_QueryInterface(&This->ISpTTSEngine_iface, iid, obj); + ISpTTSEngine_Release(&This->ISpTTSEngine_iface); + return hr; +} diff --git a/dlls/protontts/unixlib.c b/dlls/protontts/unixlib.c new file mode 100644 index 000000000000..74c9df4bf58a --- /dev/null +++ b/dlls/protontts/unixlib.c @@ -0,0 +1,391 @@ +/* + * protontts unixlib. + * + * Copyright 2023 Shaun Ren for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include +#include +#include +#include + +#include + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "winternl.h" + +#include "wine/debug.h" + +#include "protontts_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(protontts); + +struct tts_audio_buf +{ + pthread_mutex_t mutex; + pthread_cond_t empty_cond; + void *buf; + UINT32 size; + bool done; +}; + +struct tts_voice +{ + Piper *piper; + PiperVoice *voice; + + struct tts_audio_buf audio; +}; + +static ULONG_PTR zero_bits = 0; + +static inline Piper *get_piper(tts_t tts) +{ + return (Piper *)(ULONG_PTR)tts; +} + +static inline struct tts_voice *get_voice(tts_voice_t voice) +{ + return (struct tts_voice *)(ULONG_PTR)voice; +} + +static NTSTATUS process_attach(void *args) +{ +#ifdef _WIN64 + if (NtCurrentTeb()->WowTebOffset) + { + SYSTEM_BASIC_INFORMATION info; + + NtQuerySystemInformation(SystemEmulationBasicInformation, &info, sizeof(info), NULL); + zero_bits = (ULONG_PTR)info.HighestUserAddress | 0x7fffffff; + } +#endif + return STATUS_SUCCESS; +} + +static NTSTATUS tts_create(void *args) +{ + Piper *piper = piperInitialize(NULL); + + *(tts_t *)args = (tts_t)(ULONG_PTR)piper; + return piper ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; +} + +static NTSTATUS tts_destroy(void *args) +{ + Piper *piper = get_piper(*(tts_t *)args); + + piperTerminate(piper); + return STATUS_SUCCESS; +} + +static NTSTATUS tts_voice_load(void *args) +{ + struct tts_voice_load_params *params = args; + const char *voice_files_dir = getenv("PROTON_VOICE_FILES"); + char *model_path; + struct tts_voice *voice; + + TRACE("(%p).\n", args); + + if (!voice_files_dir) + { + ERR("Proton voice files not found.\n"); + return STATUS_UNSUCCESSFUL; + } + if (!(model_path = malloc(strlen(voice_files_dir) + 1 + strlen(params->model_path) + 1))) + return STATUS_NO_MEMORY; + sprintf(model_path, "%s/%s", voice_files_dir, params->model_path); + + if (!(voice = calloc(1, sizeof(*voice)))) + { + free(model_path); + return STATUS_NO_MEMORY; + } + + voice->piper = get_piper(params->tts); + voice->voice = piperLoadVoice(voice->piper, model_path, NULL, params->speaker_id, FALSE); + free(model_path); + if (!voice->voice) + { + free(voice); + return STATUS_UNSUCCESSFUL; + } + + pthread_mutex_init(&voice->audio.mutex, NULL); + pthread_cond_init(&voice->audio.empty_cond, NULL); + + params->voice = (tts_voice_t)(ULONG_PTR)voice; + + TRACE("OK.\n"); + return STATUS_SUCCESS; +} + +static NTSTATUS tts_voice_destroy(void *args) +{ + struct tts_voice *voice = get_voice(*(tts_voice_t *)args); + + piperFreeVoice(voice->voice); + + pthread_mutex_destroy(&voice->audio.mutex); + pthread_cond_destroy(&voice->audio.empty_cond); + + free(voice); + + return STATUS_SUCCESS; +} + +static NTSTATUS tts_voice_get_config(void *args) +{ + struct tts_voice_get_config_params *params = args; + struct tts_voice *voice = get_voice(params->voice); + PiperSynthesisConfig config; + + piperGetVoiceSynthesisConfig(voice->voice, &config); + + params->length_scale = config.lengthScale; + params->sample_rate = config.sampleRate; + params->sample_width = config.sampleWidth; + params->channels = config.channels; + + return STATUS_SUCCESS; +} + +static NTSTATUS tts_voice_set_config(void *args) +{ + struct tts_voice_set_config_params *params = args; + struct tts_voice *voice = get_voice(params->voice); + + piperSetVoiceSynthesisConfig(voice->voice, NULL, params->length_scale, NULL, NULL, NULL); + + return STATUS_SUCCESS; +} + +struct tts_to_audio_cb_params +{ + struct tts_audio_buf *audio; + HANDLE abort_event; +}; + +static bool tts_to_audio_cb(const int16_t *data, size_t length, void *user_data) +{ + struct tts_to_audio_cb_params *params = user_data; + const UINT32 size = sizeof(*data) * length; + SIZE_T region_size = size; + LARGE_INTEGER timeout = { .QuadPart = 0 }; + + TRACE("(%p, %lu, %p).\n", data, length, user_data); + + pthread_mutex_lock(¶ms->audio->mutex); + + while (params->audio->buf) + pthread_cond_wait(¶ms->audio->empty_cond, ¶ms->audio->mutex); + + if (NtAllocateVirtualMemory(NtCurrentProcess(), ¶ms->audio->buf, zero_bits, ®ion_size, MEM_COMMIT, PAGE_READWRITE)) + { + pthread_mutex_unlock(¶ms->audio->mutex); + ERR("failed to allocate audio buffer\n"); + return false; + } + memcpy(params->audio->buf, data, size); + params->audio->size = size; + + pthread_mutex_unlock(¶ms->audio->mutex); + + return NtWaitForSingleObject(params->abort_event, FALSE, &timeout) == STATUS_TIMEOUT; +} + +static NTSTATUS tts_voice_synthesize(void *args) +{ + struct tts_voice_synthesize_params *params = args; + struct tts_voice *voice = get_voice(params->voice); + struct tts_to_audio_cb_params cb_params = + { + .audio = &voice->audio, + .abort_event = params->abort_event, + }; + PiperSynthesisResult result; + bool success; + + TRACE("(%p).\n", args); + + voice->audio.done = false; + success = piperTextToAudio(voice->piper, voice->voice, params->text, &result, &cb_params, tts_to_audio_cb); + voice->audio.done = true; + + return success ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; +} + +static NTSTATUS tts_voice_audio_lock(void *args) +{ + struct tts_voice_audio_lock_params *params = args; + struct tts_voice *voice = get_voice(params->voice); + + TRACE("(%p).\n", args); + + pthread_mutex_lock(&voice->audio.mutex); + + params->buf = voice->audio.buf; + params->size = voice->audio.size; + params->done = voice->audio.done; + + return STATUS_SUCCESS; +} + +static NTSTATUS tts_voice_audio_release(void *args) +{ + struct tts_voice *voice = get_voice(*(tts_voice_t *)args); + SIZE_T size = 0; + + TRACE("(%p).\n", args); + + if (voice->audio.buf) + NtFreeVirtualMemory(NtCurrentProcess(), &voice->audio.buf, &size, MEM_RELEASE); + voice->audio.buf = NULL; + voice->audio.size = 0; + + pthread_cond_signal(&voice->audio.empty_cond); + pthread_mutex_unlock(&voice->audio.mutex); + + return STATUS_SUCCESS; +} + +const unixlib_entry_t __wine_unix_call_funcs[] = +{ + process_attach, + + tts_create, + tts_destroy, + + tts_voice_load, + tts_voice_destroy, + tts_voice_get_config, + tts_voice_set_config, + tts_voice_synthesize, + + tts_voice_audio_lock, + tts_voice_audio_release, +}; + +#ifdef _WIN64 + +typedef ULONG PTR32; + +static NTSTATUS wow64_tts_voice_load(void *args) +{ + struct + { + tts_t tts; + PTR32 model_path; + INT64 speaker_id; + tts_voice_t voice; + } *params32 = args; + struct tts_voice_load_params params = + { + .tts = params32->tts, + .model_path = ULongToPtr(params32->model_path), + .speaker_id = params32->speaker_id, + }; + NTSTATUS ret; + + ret = tts_voice_load(¶ms); + params32->voice = params.voice; + return ret; +} + +static NTSTATUS wow64_tts_voice_set_config(void *args) +{ + struct + { + tts_voice_t voice; + PTR32 length_scale; + } *params32 = args; + struct tts_voice_set_config_params params = + { + .voice = params32->voice, + .length_scale = ULongToPtr(params32->length_scale), + }; + + return tts_voice_set_config(¶ms); +} + + +static NTSTATUS wow64_tts_voice_synthesize(void *args) +{ + struct + { + tts_voice_t voice; + PTR32 text; + UINT32 size; + PTR32 abort_event; + } *params32 = args; + struct tts_voice_synthesize_params params = + { + .voice = params32->voice, + .text = ULongToPtr(params32->text), + .size = params32->size, + .abort_event = ULongToHandle(params32->abort_event), + }; + + return tts_voice_synthesize(¶ms); +} + +static NTSTATUS wow64_tts_voice_audio_lock(void *args) +{ + struct + { + tts_voice_t voice; + PTR32 buf; + UINT32 size; + UINT8 done; + } *params32 = args; + struct tts_voice_audio_lock_params params = + { + .voice = params32->voice, + }; + NTSTATUS ret; + + ret = tts_voice_audio_lock(¶ms); + params32->buf = PtrToUlong(params.buf); + params32->size = params.size; + params32->done = params.done; + return ret; +} + +const unixlib_entry_t __wine_unix_call_wow64_funcs[] = +{ + process_attach, + + tts_create, + tts_destroy, + + wow64_tts_voice_load, + tts_voice_destroy, + tts_voice_get_config, + wow64_tts_voice_set_config, + wow64_tts_voice_synthesize, + + wow64_tts_voice_audio_lock, + tts_voice_audio_release, +}; + +#endif /* _WIN64 */ From 0abb115d9b74d8ae9c4756c1678566648cca96be Mon Sep 17 00:00:00 2001 From: Shaun Ren Date: Wed, 6 Mar 2024 18:17:28 -0500 Subject: [PATCH 1031/2542] sapi: Remove Wine Default Voice via sapi.rgs. --- dlls/sapi/sapi.rgs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dlls/sapi/sapi.rgs b/dlls/sapi/sapi.rgs index cba07ab6184f..4ae2b96f3cd4 100644 --- a/dlls/sapi/sapi.rgs +++ b/dlls/sapi/sapi.rgs @@ -32,10 +32,7 @@ HKLM { NoRemove Tokens { - NoRemove 'Wine Default Voice' - { - NoRemove Attributes - } + Delete 'Wine Default Voice' } } } From ec22e469bc397a0419aa8117b11d83452a5f3e0c Mon Sep 17 00:00:00 2001 From: Shaun Ren Date: Tue, 12 Mar 2024 20:40:31 -0400 Subject: [PATCH 1032/2542] wine.inf: Add protontts registry entries. CW-Bug-Id: #18723 CW-Bug-Id: #20918 CW-Bug-Id: #21959 CW-Bug-Id: #22520 CW-Bug-Id: #22894 --- loader/wine.inf.in | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index e9c841b073cd..d7108dc61849 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -132,6 +132,7 @@ AddReg=\ VersionInfo,\ LicenseInformation,\ NVIDIANGX, \ + TTS, \ ProtonOverrides [DefaultInstall.ntarm64] @@ -2872,6 +2873,46 @@ HKLM,Software\Wow6432Node\Valve\Steam,"InstallPath",,"%16422%\Steam" [NVIDIANGX] HKLM,Software\NVIDIA Corporation\Global\NGXCore,"FullPath",,"C:\Windows\System32" +[TTS] +HKLM,Software\Microsoft\Speech\Voices,"DefaultDefaultTokenId",,"HKEY_LOCAL_MACHINE\Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_3" +HKLM,Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_3,,,"Proton Voice - English (United States) - libritts-r 3" +HKLM,Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_3,"409",,"Proton Voice - English (United States) - libritts-r 3" +HKLM,Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_3,"CLSID",,"{52808AE1-D977-4CD8-92D2-FEACB92FE276}" +HKLM,Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_3,"LengthScale",,"1.4" +HKLM,Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_3,"ModelPath",,"en_US-libritts_r-medium.onnx" +HKLM,Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_3,"SpeakerID",,"3" +HKLM,Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_3\Attributes,"Language",,"409" +HKLM,Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_3\Attributes,"Gender",,"Male" +HKLM,Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_3\Attributes,"Vendor",,"Wine" +HKLM,Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_14,,,"Proton Voice - English (United States) - libritts-r 14" +HKLM,Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_14,"409",,"Proton Voice - English (United States) - libritts-r 14" +HKLM,Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_14,"CLSID",,"{52808AE1-D977-4CD8-92D2-FEACB92FE276}" +HKLM,Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_14,"LengthScale",,"1.4" +HKLM,Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_14,"ModelPath",,"en_US-libritts_r-medium.onnx" +HKLM,Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_14,"SpeakerID",,"14" +HKLM,Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_14\Attributes,"Language",,"409" +HKLM,Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_14\Attributes,"Gender",,"Female" +HKLM,Software\Microsoft\Speech\Voices\Tokens\ProtonTTS_libritts-r_14\Attributes,"Vendor",,"Wine" +HKLM,Software\Microsoft\Speech_OneCore\Voices,"DefaultDefaultTokenId",,"HKEY_LOCAL_MACHINE\Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_3" +HKLM,Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_3,,,"Proton Voice - English (United States) - libritts-r 3" +HKLM,Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_3,"409",,"Proton Voice - English (United States) - libritts-r 3" +HKLM,Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_3,"CLSID",,"{52808AE1-D977-4CD8-92D2-FEACB92FE276}" +HKLM,Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_3,"LengthScale",,"1.4" +HKLM,Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_3,"ModelPath",,"en_US-libritts_r-medium.onnx" +HKLM,Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_3,"SpeakerID",,"3" +HKLM,Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_3\Attributes,"Language",,"409" +HKLM,Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_3\Attributes,"Gender",,"Male" +HKLM,Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_3\Attributes,"Vendor",,"Wine" +HKLM,Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_14,,,"Proton Voice - English (United States) - libritts-r 14" +HKLM,Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_14,"409",,"Proton Voice - English (United States) - libritts-r 14" +HKLM,Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_14,"CLSID",,"{52808AE1-D977-4CD8-92D2-FEACB92FE276}" +HKLM,Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_14,"LengthScale",,"1.4" +HKLM,Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_14,"ModelPath",,"en_US-libritts_r-medium.onnx" +HKLM,Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_14,"SpeakerID",,"14" +HKLM,Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_14\Attributes,"Language",,"409" +HKLM,Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_14\Attributes,"Gender",,"Female" +HKLM,Software\Microsoft\Speech_OneCore\Voices\Tokens\ProtonTTS_libritts-r_14\Attributes,"Vendor",,"Wine" + [ProtonOverrides] ;;Likely want *80 and *90 too, but those require removing Wine's manifest files. HKCU,Software\Wine\DllOverrides,"atl100",0x2,"native,builtin" From 891512eae383023fd66067bea8923aff482b4476 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Thu, 19 Dec 2024 13:08:29 +0200 Subject: [PATCH 1033/2542] protontts: Create tts-used tag for Steam. --- dlls/protontts/unixlib.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/dlls/protontts/unixlib.c b/dlls/protontts/unixlib.c index 74c9df4bf58a..1b0fa7a98368 100644 --- a/dlls/protontts/unixlib.c +++ b/dlls/protontts/unixlib.c @@ -26,6 +26,9 @@ #include #include #include +#include +#include +#include #include @@ -39,6 +42,35 @@ WINE_DEFAULT_DEBUG_CHANNEL(protontts); +static inline void touch_tts_used_tag(void) +{ + const char *e; + + + if ((e = getenv("STEAM_COMPAT_TRANSCODED_MEDIA_PATH"))) + { + char buffer[PATH_MAX]; + int fd; + + snprintf(buffer, sizeof(buffer), "%s/tts-used", e); + + fd = open(buffer, O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); + if (fd == -1) + { + ERR("Failed to open/create \"%s/tts-used\"", e); + return; + } + + futimens(fd, NULL); + + close(fd); + } + else + { + ERR("STEAM_COMPAT_TRANSCODED_MEDIA_PATH not set, cannot create tts-used file"); + } +} + struct tts_audio_buf { pthread_mutex_t mutex; @@ -79,6 +111,7 @@ static NTSTATUS process_attach(void *args) zero_bits = (ULONG_PTR)info.HighestUserAddress | 0x7fffffff; } #endif + touch_tts_used_tag(); return STATUS_SUCCESS; } From 8a917d0f6fd4c53ab6865a462612317304fd6aaa Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 9 Feb 2024 11:33:41 -0600 Subject: [PATCH 1034/2542] win32u: Send message with timeout in send_erase(). CW-Bug-Id: #23394 --- dlls/win32u/dce.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index 6aa65170d514..45ca912fb98a 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -1632,7 +1632,10 @@ static BOOL send_erase( HWND hwnd, UINT flags, HRGN client_rgn, { /* don't erase if the clip box is empty */ if (type != NULLREGION) - need_erase = !send_message( hwnd, WM_ERASEBKGND, (WPARAM)hdc, 0 ); + { + need_erase = !send_message_timeout( hwnd, WM_ERASEBKGND, (WPARAM)hdc, 0, SMTO_ABORTIFHUNG, 1000, FALSE ); + if (need_erase && RtlGetLastWin32Error() == ERROR_TIMEOUT) ERR( "timeout.\n" ); + } } if (!hdc_ret) release_dc( hwnd, hdc, TRUE ); } From 8fd72ad30c30ac06a092fba5190cd597f919f63d Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 7 Jan 2025 16:56:55 -0600 Subject: [PATCH 1035/2542] crypt32: Use correct tag for OCSP basic response extensions. CW-Bug-Id: #24626 --- dlls/crypt32/decode.c | 2 +- dlls/crypt32/tests/encode.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c index cfdeef5380aa..44877a6e9d6b 100644 --- a/dlls/crypt32/decode.c +++ b/dlls/crypt32/decode.c @@ -6722,7 +6722,7 @@ static BOOL WINAPI CRYPT_AsnDecodeOCSPBasicResponse(DWORD dwCertEncodingType, { ASN_SEQUENCEOF, offsetof(OCSP_BASIC_RESPONSE_INFO, cResponseEntry), CRYPT_AsnDecodeOCSPBasicResponseEntriesArray, MEMBERSIZE(OCSP_BASIC_RESPONSE_INFO, cResponseEntry, cExtension), TRUE, TRUE, offsetof(OCSP_BASIC_RESPONSE_INFO, rgResponseEntry) }, - { ASN_CONTEXT | ASN_CONSTRUCTOR, offsetof(OCSP_BASIC_RESPONSE_INFO, cExtension), + { ASN_CONTEXT | ASN_CONSTRUCTOR | 1, offsetof(OCSP_BASIC_RESPONSE_INFO, cExtension), CRYPT_AsnDecodeCertExtensions, FINALMEMBERSIZE(OCSP_BASIC_RESPONSE_INFO, cExtension), TRUE, TRUE, offsetof(OCSP_BASIC_RESPONSE_INFO, rgExtension), 0 }, }; diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c index b5db9cf7d0d3..c6c461999e6e 100644 --- a/dlls/crypt32/tests/encode.c +++ b/dlls/crypt32/tests/encode.c @@ -8847,6 +8847,7 @@ static const BYTE ocsp_basic_signed_response_with_cert[] = static void test_decodeOCSPBasicSignedResponseInfo(DWORD dwEncoding) { OCSP_BASIC_SIGNED_RESPONSE_INFO *info; + OCSP_BASIC_RESPONSE_INFO *b; DWORD size; BOOL ret; @@ -8875,12 +8876,25 @@ static void test_decodeOCSPBasicSignedResponseInfo(DWORD dwEncoding) ok(!info->SignatureInfo.cCertEncoded, "got %lu\n", info->SignatureInfo.cCertEncoded); ok(!info->SignatureInfo.rgCertEncoded, "got %p\n", info->SignatureInfo.rgCertEncoded); + + + ret = CryptDecodeObjectEx(dwEncoding, OCSP_BASIC_RESPONSE, info->ToBeSigned.pbData, info->ToBeSigned.cbData, + CRYPT_DECODE_ALLOC_FLAG, NULL, &b, &size); + ok(ret, "got %08lx\n", GetLastError()); + ok(!b->cExtension, "got %lu.\n", b->cExtension); + LocalFree(b); LocalFree(info); size = 0; ret = CryptDecodeObjectEx(dwEncoding, OCSP_BASIC_SIGNED_RESPONSE, ocsp_basic_signed_response_with_cert, sizeof(ocsp_basic_signed_response_with_cert), CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size); ok(ret, "got %08lx\n", GetLastError()); + + ret = CryptDecodeObjectEx(dwEncoding, OCSP_BASIC_RESPONSE, info->ToBeSigned.pbData, info->ToBeSigned.cbData, + CRYPT_DECODE_ALLOC_FLAG, NULL, &b, &size); + ok(ret, "got %08lx\n", GetLastError()); + ok(b->cExtension == 1, "got %lu.\n", b->cExtension); + LocalFree(b); LocalFree(info); } From db9835f56906330c45fd5864042bb6d90c8c720b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 7 Jan 2025 15:54:00 -0600 Subject: [PATCH 1036/2542] crypt32: Use correct tag for OCSP single response extensions. CW-Bug-Id: #24626 --- dlls/crypt32/decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c index 44877a6e9d6b..2deacc1cb151 100644 --- a/dlls/crypt32/decode.c +++ b/dlls/crypt32/decode.c @@ -6507,7 +6507,7 @@ static BOOL CRYPT_AsnDecodeOCSPBasicResponseEntry(const BYTE *pbEncoded, DWORD c { ASN_CONTEXT | ASN_CONSTRUCTOR, offsetof(OCSP_BASIC_RESPONSE_ENTRY, NextUpdate), CRYPT_AsnDecodeOCSPNextUpdate, sizeof(FILETIME), TRUE, FALSE, 0, 0 }, - { ASN_CONTEXT | ASN_CONSTRUCTOR /* FIXME */, offsetof(OCSP_BASIC_RESPONSE_ENTRY, cExtension), + { ASN_CONTEXT | ASN_CONSTRUCTOR | 1 /* FIXME */, offsetof(OCSP_BASIC_RESPONSE_ENTRY, cExtension), CRYPT_AsnDecodeCertExtensions, FINALMEMBERSIZE(OCSP_BASIC_RESPONSE_ENTRY, cExtension), TRUE, TRUE, offsetof(OCSP_BASIC_RESPONSE_ENTRY, rgExtension), 0 }, }; From 5976427c367a0850f6d5be90b1d49ec48326e8b3 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 7 Jan 2025 15:58:07 -0600 Subject: [PATCH 1037/2542] cryptnet: Retry OCSP request with POST if GET failed. CW-Bug-Id: #24626 --- dlls/cryptnet/cryptnet_main.c | 72 ++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 19 deletions(-) diff --git a/dlls/cryptnet/cryptnet_main.c b/dlls/cryptnet/cryptnet_main.c index 1068dd268685..ed4add512e61 100644 --- a/dlls/cryptnet/cryptnet_main.c +++ b/dlls/cryptnet/cryptnet_main.c @@ -2028,11 +2028,12 @@ static DWORD handle_ocsp_response(const CERT_INFO *cert, const CERT_INFO *issuer static DWORD verify_cert_revocation_with_ocsp(const CERT_CONTEXT *cert, const WCHAR *base_url, const CERT_REVOCATION_PARA *revpara, FILETIME *next_update) { - HINTERNET ses, con, req = NULL; + HINTERNET ses = NULL, con = NULL, req = NULL; BYTE *request_data = NULL, *response_data = NULL; - DWORD size, flags, status, request_len, response_len, count, ret = CRYPT_E_REVOCATION_OFFLINE; + DWORD size, status, request_len, response_len, count, ret = CRYPT_E_REVOCATION_OFFLINE; + DWORD flags = INTERNET_FLAG_KEEP_CONNECTION; URL_COMPONENTSW comp; - WCHAR *url; + WCHAR *url = NULL; if (!revpara || !revpara->pIssuerCert) { @@ -2043,8 +2044,11 @@ static DWORD verify_cert_revocation_with_ocsp(const CERT_CONTEXT *cert, const WC return CRYPT_E_REVOCATION_OFFLINE; url = build_request_url(base_url, request_data, request_len); - LocalFree(request_data); - if (!url) return CRYPT_E_REVOCATION_OFFLINE; + if (!url) + { + ret = CRYPT_E_REVOCATION_OFFLINE; + goto done; + } memset(&comp, 0, sizeof(comp)); comp.dwStructSize = sizeof(comp); @@ -2052,31 +2056,33 @@ static DWORD verify_cert_revocation_with_ocsp(const CERT_CONTEXT *cert, const WC comp.dwUrlPathLength = ~0u; if (!InternetCrackUrlW(url, 0, 0, &comp)) { - free(url); - return CRYPT_E_REVOCATION_OFFLINE; + ret = CRYPT_E_REVOCATION_OFFLINE; + goto done; } switch (comp.nScheme) { case INTERNET_SCHEME_HTTP: - flags = 0; break; case INTERNET_SCHEME_HTTPS: - flags = INTERNET_FLAG_SECURE; + flags |= INTERNET_FLAG_SECURE; break; default: FIXME("scheme %u not supported\n", comp.nScheme); - free(url); - return ERROR_NOT_SUPPORTED; + ret = ERROR_NOT_SUPPORTED; + goto done; } - if (!(ses = InternetOpenW(L"CryptoAPI", 0, NULL, NULL, 0))) return GetLastError(); + if (!(ses = InternetOpenW(L"CryptoAPI", 0, NULL, NULL, 0))) + { + ret = GetLastError(); + goto done; + } comp.lpszHostName[comp.dwHostNameLength] = 0; if (!(con = InternetConnectW(ses, comp.lpszHostName, comp.nPort, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0))) { - free(url); - InternetCloseHandle(ses); - return GetLastError(); + ret = GetLastError(); + goto done; } comp.lpszHostName[comp.dwHostNameLength] = '/'; if (!(req = HttpOpenRequestW(con, NULL, comp.lpszUrlPath, NULL, NULL, NULL, flags, 0)) || @@ -2084,13 +2090,40 @@ static DWORD verify_cert_revocation_with_ocsp(const CERT_CONTEXT *cert, const WC size = sizeof(status); if (!HttpQueryInfoW(req, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &status, &size, NULL)) goto done; - if (status != HTTP_STATUS_OK) + if (status == HTTP_STATUS_OK) { - WARN("request status %lu\n", status); - goto done; + size = sizeof(response_len); + if (!HttpQueryInfoW(req, HTTP_QUERY_FLAG_NUMBER | HTTP_QUERY_CONTENT_LENGTH, &response_len, &size, 0) || + !response_len || !(response_data = malloc(response_len)) || + !InternetReadFile(req, response_data, response_len, &count) || count != response_len) goto done; + + ret = handle_ocsp_response(cert->pCertInfo, revpara->pIssuerCert->pCertInfo, response_data, response_len, + next_update); } + if (ret == ERROR_SUCCESS || ret == CRYPT_E_REVOKED) goto done; - size = sizeof(response_len); + WARN("GET OCSP request failed, status %lu, ret %#lx, retrying with POST.\n", status, ret); + InternetCloseHandle(req); + req = NULL; + free(response_data); + response_data = NULL; + memset(&comp, 0, sizeof(comp)); + comp.dwStructSize = sizeof(comp); + comp.dwHostNameLength = ~0u; + comp.dwUrlPathLength = ~0u; + if (!InternetCrackUrlW(base_url, 0, 0, &comp)) + { + ret = CRYPT_E_REVOCATION_OFFLINE; + goto done; + } + flags &= ~INTERNET_FLAG_KEEP_CONNECTION; + if (!(req = HttpOpenRequestW(con, L"POST", comp.lpszUrlPath, NULL, NULL, NULL, flags, 0)) || + !HttpSendRequestW(req, L"Content-Type: application/ocsp-request\0", -1, request_data, request_len)) goto done; + if (status != HTTP_STATUS_OK) + { + WARN("request status %lu.\n", status); + goto done; + } if (!HttpQueryInfoW(req, HTTP_QUERY_FLAG_NUMBER | HTTP_QUERY_CONTENT_LENGTH, &response_len, &size, 0) || !response_len || !(response_data = malloc(response_len)) || !InternetReadFile(req, response_data, response_len, &count) || count != response_len) goto done; @@ -2099,6 +2132,7 @@ static DWORD verify_cert_revocation_with_ocsp(const CERT_CONTEXT *cert, const WC next_update); done: + LocalFree(request_data); free(url); free(response_data); InternetCloseHandle(req); From 47477e575ad107b8d0bd17b55312c443f3098978 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 6 Jan 2025 15:28:02 -0600 Subject: [PATCH 1038/2542] cryptnet: Do not perform OCSP requests with CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION flag. CW-Bug-Id: #24626 --- dlls/cryptnet/cryptnet_main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/cryptnet/cryptnet_main.c b/dlls/cryptnet/cryptnet_main.c index ed4add512e61..1200416af583 100644 --- a/dlls/cryptnet/cryptnet_main.c +++ b/dlls/cryptnet/cryptnet_main.c @@ -2161,7 +2161,15 @@ static DWORD verify_cert_revocation_from_aia_ext(const CRYPT_DATA_BLOB *value, c { const WCHAR *url = aia->rgAccDescr[i].AccessLocation.pwszURL; TRACE("OCSP URL = %s\n", debugstr_w(url)); - error = verify_cert_revocation_with_ocsp(cert, url, pRevPara, next_update); + if (dwFlags & CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION) + { + TRACE("Cache only revocation, returning CRYPT_E_REVOCATION_OFFLINE.\n"); + error = CRYPT_E_REVOCATION_OFFLINE; + } + else + { + error = verify_cert_revocation_with_ocsp(cert, url, pRevPara, next_update); + } } else { From c76b0cbae0a9181e461758f66fa194b35c3a008e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 8 Jan 2025 19:25:41 -0600 Subject: [PATCH 1039/2542] crypt32/tests: Add more tests for VerifyCertChainPolicy(). CW-Bug-Id: #24626 --- dlls/crypt32/tests/chain.c | 132 +++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) diff --git a/dlls/crypt32/tests/chain.c b/dlls/crypt32/tests/chain.c index 9717b184c147..2a4ae5169031 100644 --- a/dlls/crypt32/tests/chain.c +++ b/dlls/crypt32/tests/chain.c @@ -5376,10 +5376,142 @@ static void testVerifyCertChainPolicy(void) check_msroot_policy(); } +static void test_VerifyCertChainPolicy_flags(void) +{ + static const struct + { + DWORD trust_status; + unsigned int index; + DWORD policy_flags; + DWORD ssl_policy_flags; + DWORD expected_error; + BOOL wine_todo; + } + tests[] = + { + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, 0, 0, CRYPT_E_REVOCATION_OFFLINE, TRUE }, + /* CERT_TRUST_REVOCATION_STATUS_UNKNOWN is only checked on the end certificate. */ + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 1, 0, 0, ERROR_SUCCESS, TRUE }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 2, 0, 0, ERROR_SUCCESS, TRUE }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG, 0, 0, TRUE }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG, 0, CRYPT_E_REVOCATION_OFFLINE, TRUE }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG, 0, CRYPT_E_REVOCATION_OFFLINE, TRUE }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG, 0, CRYPT_E_REVOCATION_OFFLINE, TRUE }, + /* CERT_TRUST_IS_OFFLINE_REVOCATION is ignored. */ + { CERT_TRUST_IS_OFFLINE_REVOCATION, 0, 0, 0, ERROR_SUCCESS, TRUE }, + { CERT_TRUST_IS_OFFLINE_REVOCATION, 1, 0, 0, ERROR_SUCCESS, TRUE }, + { CERT_TRUST_IS_OFFLINE_REVOCATION, 2, 0, 0, ERROR_SUCCESS, TRUE }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 0, 0, 0, CRYPT_E_REVOCATION_OFFLINE, TRUE }, + /* CERT_TRUST_REVOCATION_STATUS_UNKNOWN is only checked on the end certificate. */ + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 1, 0, 0, ERROR_SUCCESS }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 2, 0, 0, ERROR_SUCCESS }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 0, CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG, 0, 0 }, + + { CERT_TRUST_IS_REVOKED, 0, 0, 0, CRYPT_E_REVOKED, TRUE }, + { CERT_TRUST_IS_REVOKED, 1, 0, 0, CRYPT_E_REVOKED, TRUE }, + { CERT_TRUST_IS_REVOKED, 2, 0, 0, CRYPT_E_REVOKED, TRUE }, + + { CERT_TRUST_IS_NOT_VALID_FOR_USAGE, 0, 0, 0, CERT_E_WRONG_USAGE }, + { CERT_TRUST_IS_NOT_VALID_FOR_USAGE, 1, 0, 0, CERT_E_WRONG_USAGE }, + { CERT_TRUST_IS_NOT_VALID_FOR_USAGE, 2, 0, 0, CERT_E_WRONG_USAGE }, + { CERT_TRUST_IS_NOT_VALID_FOR_USAGE, 0, 0, SECURITY_FLAG_IGNORE_WRONG_USAGE, ERROR_SUCCESS }, + { CERT_TRUST_IS_NOT_VALID_FOR_USAGE, 0, CERT_CHAIN_POLICY_IGNORE_WRONG_USAGE_FLAG, 0, ERROR_SUCCESS, TRUE }, + + { CERT_TRUST_IS_SELF_SIGNED, 0, 0, 0, TRUST_E_CERT_SIGNATURE }, + { CERT_TRUST_IS_SELF_SIGNED, 1, 0, 0, TRUST_E_CERT_SIGNATURE }, + { CERT_TRUST_IS_SELF_SIGNED, 2, 0, 0, TRUST_E_CERT_SIGNATURE }, + { CERT_TRUST_IS_SELF_SIGNED, 2, 0, SECURITY_FLAG_IGNORE_UNKNOWN_CA, TRUST_E_CERT_SIGNATURE }, + { CERT_TRUST_IS_SELF_SIGNED, 2, CERT_CHAIN_POLICY_ALLOW_UNKNOWN_CA_FLAG, 0, TRUST_E_CERT_SIGNATURE }, + }; + + BOOL ret; + PCCERT_CONTEXT cert; + CERT_CHAIN_PARA para = { 0 }; + PCCERT_CHAIN_CONTEXT chain; + FILETIME fileTime; + HCERTSTORE store; + static char one_two_three[] = "1.2.3"; + LPSTR oids[1]; + SSL_EXTRA_CERT_CHAIN_POLICY_PARA ssl_para; + CERT_CHAIN_POLICY_PARA policy_para; + CERT_CHAIN_POLICY_STATUS status; + CERT_REVOCATION_INFO rev_info[3]; + unsigned int i; + + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); + CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, geotrust_global_ca, + sizeof(geotrust_global_ca), CERT_STORE_ADD_ALWAYS, NULL); + CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, google_internet_authority, + sizeof(google_internet_authority), CERT_STORE_ADD_ALWAYS, NULL); + cert = CertCreateCertificateContext(X509_ASN_ENCODING, google_com, sizeof(google_com)); + SystemTimeToFileTime(&oct2009, &fileTime); + memset(¶, 0, sizeof(para)); + para.cbSize = sizeof(para); + oids[0] = one_two_three; + para.RequestedUsage.dwType = USAGE_MATCH_TYPE_AND; + para.RequestedUsage.Usage.rgpszUsageIdentifier = oids; + para.RequestedUsage.Usage.cUsageIdentifier = 1; + ret = CertGetCertificateChain(NULL, cert, &fileTime, store, ¶, CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY, NULL, &chain); + ok(ret, "got error %#lx.\n", GetLastError()); + ok(chain->cChain == 1, "got %lu.\n", chain->cChain); + ok(chain->rgpChain[0]->cElement == 3, "got %lu.\n", chain->rgpChain[0]->cElement); + + memset(&policy_para, 0, sizeof(policy_para)); + policy_para.cbSize = sizeof(policy_para); + memset(&ssl_para, 0, sizeof(ssl_para)); + ssl_para.cbSize = sizeof(ssl_para); + ssl_para.dwAuthType = AUTHTYPE_SERVER; + ssl_para.pwszServerName = (WCHAR *)L"www.google.com"; + policy_para.pvExtraPolicyPara = &ssl_para; + status.cbSize = sizeof(status); + + for (i = 0; i < chain->rgpChain[0]->cElement; ++i) + { + chain->rgpChain[0]->rgpElement[i]->TrustStatus.dwErrorStatus = 0; + memset(&rev_info[i], 0, sizeof(rev_info[i])); + rev_info[i].cbSize = sizeof(rev_info); + chain->rgpChain[0]->rgpElement[i]->pRevocationInfo = &rev_info[i]; + } + + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + winetest_push_context("test %u", i); + *(DWORD *)&chain->TrustStatus.dwErrorStatus = tests[i].trust_status; + chain->rgpChain[0]->TrustStatus.dwErrorStatus = chain->TrustStatus.dwErrorStatus; + chain->rgpChain[0]->rgpElement[tests[i].index]->TrustStatus.dwErrorStatus = chain->TrustStatus.dwErrorStatus; + policy_para.dwFlags = tests[i].policy_flags; + ssl_para.cbSize = sizeof(ssl_para); + ssl_para.fdwChecks = tests[i].ssl_policy_flags; + policy_para.pvExtraPolicyPara = &ssl_para; + ret = CertVerifyCertificateChainPolicy(CERT_CHAIN_POLICY_SSL, chain, &policy_para, &status); + ok(ret, "got error %#lx.\n", GetLastError()); + todo_wine_if(tests[i].wine_todo) ok(status.dwError == tests[i].expected_error, "got %#lx, expected %#lx.\n", status.dwError, tests[i].expected_error); + if (status.dwError) + { + ok(!status.lChainIndex, "got %ld.\n", status.lChainIndex); + ok(status.lElementIndex == tests[i].index, "got %ld.\n", status.lElementIndex); + } + else + { + ok(status.lChainIndex == -1, "got %ld.\n", status.lChainIndex); + ok(status.lElementIndex == -1, "got %ld.\n", status.lElementIndex); + } + chain->rgpChain[0]->rgpElement[tests[i].index]->TrustStatus.dwErrorStatus = 0; + winetest_pop_context(); + } + for (i = 0; i < chain->rgpChain[0]->cElement; ++i) + chain->rgpChain[0]->rgpElement[i]->pRevocationInfo = NULL; + + CertFreeCertificateChain(chain); + CertFreeCertificateContext(cert); + CertCloseStore(store, 0); +} + START_TEST(chain) { testCreateCertChainEngine(); testVerifyCertChainPolicy(); testGetCertChain(); test_CERT_CHAIN_PARA_cbSize(); + test_VerifyCertChainPolicy_flags(); } From ff47dedbde3dcc0e7f69094165e24ce864668299 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 8 Jan 2025 19:23:03 -0600 Subject: [PATCH 1040/2542] crypt32: Fix some error codes in verify_ssl_policy(). CW-Bug-Id: #24626 --- dlls/crypt32/chain.c | 4 ++-- dlls/crypt32/tests/chain.c | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/crypt32/chain.c b/dlls/crypt32/chain.c index 5e4288eda374..b7072a2f8b4c 100644 --- a/dlls/crypt32/chain.c +++ b/dlls/crypt32/chain.c @@ -3513,7 +3513,7 @@ static BOOL WINAPI verify_ssl_policy(LPCSTR szPolicyOID, else if (pChainContext->TrustStatus.dwErrorStatus & CERT_TRUST_IS_REVOKED && !(checks & SECURITY_FLAG_IGNORE_REVOCATION)) { - pPolicyStatus->dwError = CERT_E_REVOKED; + pPolicyStatus->dwError = CRYPT_E_REVOKED; find_element_with_error(pChainContext, CERT_TRUST_IS_REVOKED, &pPolicyStatus->lChainIndex, &pPolicyStatus->lElementIndex); @@ -3522,7 +3522,7 @@ static BOOL WINAPI verify_ssl_policy(LPCSTR szPolicyOID, CERT_TRUST_IS_OFFLINE_REVOCATION && !(checks & SECURITY_FLAG_IGNORE_REVOCATION)) { - pPolicyStatus->dwError = CERT_E_REVOCATION_FAILURE; + pPolicyStatus->dwError = CRYPT_E_REVOCATION_OFFLINE; find_element_with_error(pChainContext, CERT_TRUST_IS_OFFLINE_REVOCATION, &pPolicyStatus->lChainIndex, &pPolicyStatus->lElementIndex); diff --git a/dlls/crypt32/tests/chain.c b/dlls/crypt32/tests/chain.c index 2a4ae5169031..9d3a22d5555e 100644 --- a/dlls/crypt32/tests/chain.c +++ b/dlls/crypt32/tests/chain.c @@ -5389,14 +5389,14 @@ static void test_VerifyCertChainPolicy_flags(void) } tests[] = { - { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, 0, 0, CRYPT_E_REVOCATION_OFFLINE, TRUE }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, 0, 0, CRYPT_E_REVOCATION_OFFLINE }, /* CERT_TRUST_REVOCATION_STATUS_UNKNOWN is only checked on the end certificate. */ { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 1, 0, 0, ERROR_SUCCESS, TRUE }, { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 2, 0, 0, ERROR_SUCCESS, TRUE }, { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG, 0, 0, TRUE }, - { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG, 0, CRYPT_E_REVOCATION_OFFLINE, TRUE }, - { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG, 0, CRYPT_E_REVOCATION_OFFLINE, TRUE }, - { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG, 0, CRYPT_E_REVOCATION_OFFLINE, TRUE }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG, 0, CRYPT_E_REVOCATION_OFFLINE }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG, 0, CRYPT_E_REVOCATION_OFFLINE }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG, 0, CRYPT_E_REVOCATION_OFFLINE }, /* CERT_TRUST_IS_OFFLINE_REVOCATION is ignored. */ { CERT_TRUST_IS_OFFLINE_REVOCATION, 0, 0, 0, ERROR_SUCCESS, TRUE }, { CERT_TRUST_IS_OFFLINE_REVOCATION, 1, 0, 0, ERROR_SUCCESS, TRUE }, @@ -5407,9 +5407,9 @@ static void test_VerifyCertChainPolicy_flags(void) { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 2, 0, 0, ERROR_SUCCESS }, { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 0, CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG, 0, 0 }, - { CERT_TRUST_IS_REVOKED, 0, 0, 0, CRYPT_E_REVOKED, TRUE }, - { CERT_TRUST_IS_REVOKED, 1, 0, 0, CRYPT_E_REVOKED, TRUE }, - { CERT_TRUST_IS_REVOKED, 2, 0, 0, CRYPT_E_REVOKED, TRUE }, + { CERT_TRUST_IS_REVOKED, 0, 0, 0, CRYPT_E_REVOKED }, + { CERT_TRUST_IS_REVOKED, 1, 0, 0, CRYPT_E_REVOKED }, + { CERT_TRUST_IS_REVOKED, 2, 0, 0, CRYPT_E_REVOKED }, { CERT_TRUST_IS_NOT_VALID_FOR_USAGE, 0, 0, 0, CERT_E_WRONG_USAGE }, { CERT_TRUST_IS_NOT_VALID_FOR_USAGE, 1, 0, 0, CERT_E_WRONG_USAGE }, From 8bab5e42764067e11a1099191386e0a1c995b1c1 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 8 Jan 2025 19:32:06 -0600 Subject: [PATCH 1041/2542] crypt32: Check CERT_TRUST_REVOCATION_STATUS_UNKNOWN instead of CERT_TRUST_IS_OFFLINE_REVOCATION in verify_ssl_policy(). CW-Bug-Id: #24626 --- dlls/crypt32/chain.c | 8 +++----- dlls/crypt32/tests/chain.c | 14 +++++++------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/dlls/crypt32/chain.c b/dlls/crypt32/chain.c index b7072a2f8b4c..fb2f391ff6e4 100644 --- a/dlls/crypt32/chain.c +++ b/dlls/crypt32/chain.c @@ -2707,6 +2707,7 @@ static void CRYPT_VerifyChainRevocation(PCERT_CHAIN_CONTEXT chain, switch (revocationStatus.dwError) { + case CRYPT_E_REVOCATION_OFFLINE: case CRYPT_E_NO_REVOCATION_CHECK: case CRYPT_E_NO_REVOCATION_DLL: case CRYPT_E_NOT_IN_REVOCATION_DATABASE: @@ -2716,9 +2717,6 @@ static void CRYPT_VerifyChainRevocation(PCERT_CHAIN_CONTEXT chain, error = CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION; break; - case CRYPT_E_REVOCATION_OFFLINE: - error = CERT_TRUST_IS_OFFLINE_REVOCATION; - break; case CRYPT_E_REVOKED: error = CERT_TRUST_IS_REVOKED; break; @@ -3519,12 +3517,12 @@ static BOOL WINAPI verify_ssl_policy(LPCSTR szPolicyOID, &pPolicyStatus->lElementIndex); } else if (pChainContext->TrustStatus.dwErrorStatus & - CERT_TRUST_IS_OFFLINE_REVOCATION && + CERT_TRUST_REVOCATION_STATUS_UNKNOWN && !(checks & SECURITY_FLAG_IGNORE_REVOCATION)) { pPolicyStatus->dwError = CRYPT_E_REVOCATION_OFFLINE; find_element_with_error(pChainContext, - CERT_TRUST_IS_OFFLINE_REVOCATION, &pPolicyStatus->lChainIndex, + CERT_TRUST_REVOCATION_STATUS_UNKNOWN, &pPolicyStatus->lChainIndex, &pPolicyStatus->lElementIndex); } else if (pChainContext->TrustStatus.dwErrorStatus & diff --git a/dlls/crypt32/tests/chain.c b/dlls/crypt32/tests/chain.c index 9d3a22d5555e..9c1623e206c7 100644 --- a/dlls/crypt32/tests/chain.c +++ b/dlls/crypt32/tests/chain.c @@ -5398,14 +5398,14 @@ static void test_VerifyCertChainPolicy_flags(void) { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG, 0, CRYPT_E_REVOCATION_OFFLINE }, { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG, 0, CRYPT_E_REVOCATION_OFFLINE }, /* CERT_TRUST_IS_OFFLINE_REVOCATION is ignored. */ - { CERT_TRUST_IS_OFFLINE_REVOCATION, 0, 0, 0, ERROR_SUCCESS, TRUE }, - { CERT_TRUST_IS_OFFLINE_REVOCATION, 1, 0, 0, ERROR_SUCCESS, TRUE }, - { CERT_TRUST_IS_OFFLINE_REVOCATION, 2, 0, 0, ERROR_SUCCESS, TRUE }, - { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 0, 0, 0, CRYPT_E_REVOCATION_OFFLINE, TRUE }, + { CERT_TRUST_IS_OFFLINE_REVOCATION, 0, 0, 0, ERROR_SUCCESS }, + { CERT_TRUST_IS_OFFLINE_REVOCATION, 1, 0, 0, ERROR_SUCCESS }, + { CERT_TRUST_IS_OFFLINE_REVOCATION, 2, 0, 0, ERROR_SUCCESS }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 0, 0, 0, CRYPT_E_REVOCATION_OFFLINE }, /* CERT_TRUST_REVOCATION_STATUS_UNKNOWN is only checked on the end certificate. */ - { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 1, 0, 0, ERROR_SUCCESS }, - { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 2, 0, 0, ERROR_SUCCESS }, - { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 0, CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG, 0, 0 }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 1, 0, 0, ERROR_SUCCESS, TRUE }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 2, 0, 0, ERROR_SUCCESS, TRUE }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 0, CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG, 0, 0, TRUE }, { CERT_TRUST_IS_REVOKED, 0, 0, 0, CRYPT_E_REVOKED }, { CERT_TRUST_IS_REVOKED, 1, 0, 0, CRYPT_E_REVOKED }, From 7a35a47f1bd042da061bc363b7ac4982e1cb5919 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 8 Jan 2025 19:34:37 -0600 Subject: [PATCH 1042/2542] crypt32: Favour CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG in verify_ssl_policy(). Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56559 CW-Bug-Id: #24626 --- dlls/crypt32/chain.c | 2 +- dlls/crypt32/tests/chain.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/crypt32/chain.c b/dlls/crypt32/chain.c index fb2f391ff6e4..61f9e66f30c0 100644 --- a/dlls/crypt32/chain.c +++ b/dlls/crypt32/chain.c @@ -3518,7 +3518,7 @@ static BOOL WINAPI verify_ssl_policy(LPCSTR szPolicyOID, } else if (pChainContext->TrustStatus.dwErrorStatus & CERT_TRUST_REVOCATION_STATUS_UNKNOWN && - !(checks & SECURITY_FLAG_IGNORE_REVOCATION)) + !(checks & SECURITY_FLAG_IGNORE_REVOCATION) && !(baseChecks & CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG)) { pPolicyStatus->dwError = CRYPT_E_REVOCATION_OFFLINE; find_element_with_error(pChainContext, diff --git a/dlls/crypt32/tests/chain.c b/dlls/crypt32/tests/chain.c index 9c1623e206c7..06d9f7d730e9 100644 --- a/dlls/crypt32/tests/chain.c +++ b/dlls/crypt32/tests/chain.c @@ -5393,7 +5393,7 @@ static void test_VerifyCertChainPolicy_flags(void) /* CERT_TRUST_REVOCATION_STATUS_UNKNOWN is only checked on the end certificate. */ { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 1, 0, 0, ERROR_SUCCESS, TRUE }, { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 2, 0, 0, ERROR_SUCCESS, TRUE }, - { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG, 0, 0, TRUE }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG, 0, 0 }, { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG, 0, CRYPT_E_REVOCATION_OFFLINE }, { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG, 0, CRYPT_E_REVOCATION_OFFLINE }, { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG, 0, CRYPT_E_REVOCATION_OFFLINE }, @@ -5405,7 +5405,7 @@ static void test_VerifyCertChainPolicy_flags(void) /* CERT_TRUST_REVOCATION_STATUS_UNKNOWN is only checked on the end certificate. */ { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 1, 0, 0, ERROR_SUCCESS, TRUE }, { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 2, 0, 0, ERROR_SUCCESS, TRUE }, - { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 0, CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG, 0, 0, TRUE }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 0, CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG, 0, 0 }, { CERT_TRUST_IS_REVOKED, 0, 0, 0, CRYPT_E_REVOKED }, { CERT_TRUST_IS_REVOKED, 1, 0, 0, CRYPT_E_REVOKED }, From 1662dca3b8d941055df1ef736d9aae311ae049ac Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 8 Jan 2025 19:45:30 -0600 Subject: [PATCH 1043/2542] crypt32: Only mind end certificate when checking revocation status in verify_ssl_policy(). CW-Bug-Id: #24626 --- dlls/crypt32/chain.c | 25 +++++++++++++++++++++---- dlls/crypt32/tests/chain.c | 8 ++++---- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/dlls/crypt32/chain.c b/dlls/crypt32/chain.c index 61f9e66f30c0..e8dc15ff7e93 100644 --- a/dlls/crypt32/chain.c +++ b/dlls/crypt32/chain.c @@ -2989,6 +2989,24 @@ static void find_element_with_error(PCCERT_CHAIN_CONTEXT chain, DWORD error, } } +static BOOL find_chain_first_element_with_error(PCCERT_CHAIN_CONTEXT chain, DWORD error, LONG *chain_idx, + LONG *element_idx) +{ + unsigned int i; + + for (i = 0; i < chain->cChain; i++) + { + if (!chain->rgpChain[i]->cElement) continue; + if (chain->rgpChain[i]->rgpElement[0]->TrustStatus.dwErrorStatus & error) + { + *chain_idx = i; + *element_idx = 0; + return TRUE; + } + } + return FALSE; +} + static BOOL WINAPI verify_base_policy(LPCSTR szPolicyOID, PCCERT_CHAIN_CONTEXT pChainContext, PCERT_CHAIN_POLICY_PARA pPolicyPara, PCERT_CHAIN_POLICY_STATUS pPolicyStatus) @@ -3518,12 +3536,11 @@ static BOOL WINAPI verify_ssl_policy(LPCSTR szPolicyOID, } else if (pChainContext->TrustStatus.dwErrorStatus & CERT_TRUST_REVOCATION_STATUS_UNKNOWN && - !(checks & SECURITY_FLAG_IGNORE_REVOCATION) && !(baseChecks & CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG)) + !(checks & SECURITY_FLAG_IGNORE_REVOCATION) && !(baseChecks & CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG) + && find_chain_first_element_with_error(pChainContext, CERT_TRUST_REVOCATION_STATUS_UNKNOWN, + &pPolicyStatus->lChainIndex, &pPolicyStatus->lElementIndex)) { pPolicyStatus->dwError = CRYPT_E_REVOCATION_OFFLINE; - find_element_with_error(pChainContext, - CERT_TRUST_REVOCATION_STATUS_UNKNOWN, &pPolicyStatus->lChainIndex, - &pPolicyStatus->lElementIndex); } else if (pChainContext->TrustStatus.dwErrorStatus & CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT) diff --git a/dlls/crypt32/tests/chain.c b/dlls/crypt32/tests/chain.c index 06d9f7d730e9..268e03155d7f 100644 --- a/dlls/crypt32/tests/chain.c +++ b/dlls/crypt32/tests/chain.c @@ -5391,8 +5391,8 @@ static void test_VerifyCertChainPolicy_flags(void) { { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, 0, 0, CRYPT_E_REVOCATION_OFFLINE }, /* CERT_TRUST_REVOCATION_STATUS_UNKNOWN is only checked on the end certificate. */ - { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 1, 0, 0, ERROR_SUCCESS, TRUE }, - { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 2, 0, 0, ERROR_SUCCESS, TRUE }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 1, 0, 0, ERROR_SUCCESS }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 2, 0, 0, ERROR_SUCCESS }, { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG, 0, 0 }, { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG, 0, CRYPT_E_REVOCATION_OFFLINE }, { CERT_TRUST_REVOCATION_STATUS_UNKNOWN | CERT_TRUST_IS_OFFLINE_REVOCATION, 0, CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG, 0, CRYPT_E_REVOCATION_OFFLINE }, @@ -5403,8 +5403,8 @@ static void test_VerifyCertChainPolicy_flags(void) { CERT_TRUST_IS_OFFLINE_REVOCATION, 2, 0, 0, ERROR_SUCCESS }, { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 0, 0, 0, CRYPT_E_REVOCATION_OFFLINE }, /* CERT_TRUST_REVOCATION_STATUS_UNKNOWN is only checked on the end certificate. */ - { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 1, 0, 0, ERROR_SUCCESS, TRUE }, - { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 2, 0, 0, ERROR_SUCCESS, TRUE }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 1, 0, 0, ERROR_SUCCESS }, + { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 2, 0, 0, ERROR_SUCCESS }, { CERT_TRUST_REVOCATION_STATUS_UNKNOWN, 0, CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG, 0, 0 }, { CERT_TRUST_IS_REVOKED, 0, 0, 0, CRYPT_E_REVOKED }, From 4e80b384a642eae06c728d9a70ef453dd8bec213 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 8 Jan 2025 19:52:03 -0600 Subject: [PATCH 1044/2542] crypt32: Favour CERT_CHAIN_POLICY_IGNORE_WRONG_USAGE_FLAG in verify_ssl_policy(). CW-Bug-Id: #24626 --- dlls/crypt32/chain.c | 2 +- dlls/crypt32/tests/chain.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/crypt32/chain.c b/dlls/crypt32/chain.c index e8dc15ff7e93..fa74ade13d64 100644 --- a/dlls/crypt32/chain.c +++ b/dlls/crypt32/chain.c @@ -3519,7 +3519,7 @@ static BOOL WINAPI verify_ssl_policy(LPCSTR szPolicyOID, } else if (pChainContext->TrustStatus.dwErrorStatus & CERT_TRUST_IS_NOT_VALID_FOR_USAGE && - !(checks & SECURITY_FLAG_IGNORE_WRONG_USAGE)) + !(checks & SECURITY_FLAG_IGNORE_WRONG_USAGE) && !(baseChecks & CERT_CHAIN_POLICY_IGNORE_WRONG_USAGE_FLAG)) { pPolicyStatus->dwError = CERT_E_WRONG_USAGE; find_element_with_error(pChainContext, diff --git a/dlls/crypt32/tests/chain.c b/dlls/crypt32/tests/chain.c index 268e03155d7f..5522ab4f01ba 100644 --- a/dlls/crypt32/tests/chain.c +++ b/dlls/crypt32/tests/chain.c @@ -5385,7 +5385,6 @@ static void test_VerifyCertChainPolicy_flags(void) DWORD policy_flags; DWORD ssl_policy_flags; DWORD expected_error; - BOOL wine_todo; } tests[] = { @@ -5415,7 +5414,7 @@ static void test_VerifyCertChainPolicy_flags(void) { CERT_TRUST_IS_NOT_VALID_FOR_USAGE, 1, 0, 0, CERT_E_WRONG_USAGE }, { CERT_TRUST_IS_NOT_VALID_FOR_USAGE, 2, 0, 0, CERT_E_WRONG_USAGE }, { CERT_TRUST_IS_NOT_VALID_FOR_USAGE, 0, 0, SECURITY_FLAG_IGNORE_WRONG_USAGE, ERROR_SUCCESS }, - { CERT_TRUST_IS_NOT_VALID_FOR_USAGE, 0, CERT_CHAIN_POLICY_IGNORE_WRONG_USAGE_FLAG, 0, ERROR_SUCCESS, TRUE }, + { CERT_TRUST_IS_NOT_VALID_FOR_USAGE, 0, CERT_CHAIN_POLICY_IGNORE_WRONG_USAGE_FLAG, 0, ERROR_SUCCESS }, { CERT_TRUST_IS_SELF_SIGNED, 0, 0, 0, TRUST_E_CERT_SIGNATURE }, { CERT_TRUST_IS_SELF_SIGNED, 1, 0, 0, TRUST_E_CERT_SIGNATURE }, @@ -5485,7 +5484,7 @@ static void test_VerifyCertChainPolicy_flags(void) policy_para.pvExtraPolicyPara = &ssl_para; ret = CertVerifyCertificateChainPolicy(CERT_CHAIN_POLICY_SSL, chain, &policy_para, &status); ok(ret, "got error %#lx.\n", GetLastError()); - todo_wine_if(tests[i].wine_todo) ok(status.dwError == tests[i].expected_error, "got %#lx, expected %#lx.\n", status.dwError, tests[i].expected_error); + ok(status.dwError == tests[i].expected_error, "got %#lx, expected %#lx.\n", status.dwError, tests[i].expected_error); if (status.dwError) { ok(!status.lChainIndex, "got %ld.\n", status.lChainIndex); From 1ed6df4074826403dd02c54570842f65fad4c61a Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 16 Dec 2024 16:27:15 -0600 Subject: [PATCH 1045/2542] wine.inf: Add UBR field to CurrentVersion. CW-Bug-Id: #24585 (cherry picked from commit 4b426217e7eae17388b44027dd21a747e395b203) --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index d7108dc61849..2591f320ba29 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2653,6 +2653,7 @@ HKLM,%CurrentVersionNT%,"CurrentMinorVersionNumber",0x10003,0 HKLM,%CurrentVersionNT%,"CurrentBuild",2,"19043" HKLM,%CurrentVersionNT%,"CurrentBuildNumber",2,"19043" HKLM,%CurrentVersionNT%,"CurrentType",2,"Multiprocessor Free" +HKLM,%CurrentVersionNT%,"UBR",0x10001,0x000005ba HKLM,%CurrentVersionNT%,"DigitalProductId",2,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ From 9773725c2c06da042842df4efd6dc6f78dcdeb8f Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 16 Dec 2024 16:33:21 -0600 Subject: [PATCH 1046/2542] wbemprox: Bump driver date. CW-Bug-Id: #24585 (cherry picked from commit 1bfc824eca5a8f76461710585d73cfa2bde9e1e9) --- dlls/wbemprox/builtin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 770b49f21449..fd63c8c5b8a0 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -4242,7 +4242,7 @@ static enum fill_status fill_videocontroller( struct table *table, const struct rec->current_verticalres = vres; rec->description = wcsdup( name ); rec->device_id = L"VideoController1"; - rec->driverdate = L"20230831000000.000000-000"; + rec->driverdate = L"20250831000000.000000-000"; rec->driverversion = L"31.0.21902.5"; rec->installeddriver = get_videocontroller_installeddriver( desc.VendorId ); rec->name = wcsdup( name ); From 063a29bc8ba05a97152b2f9a97ad7ab12007e1e7 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Fri, 10 Jan 2025 16:16:42 +1000 Subject: [PATCH 1047/2542] winedmo: Handle PCM audio big-endian formats. CW-Bug-Id: #24614 --- dlls/winedmo/Makefile.in | 1 + .../libavcodec/pcm_byte_order_reverse_bsf.c | 157 ++++++++++++++++++ dlls/winedmo/unix_demuxer.c | 24 +++ dlls/winedmo/unix_media_type.c | 2 + dlls/winedmo/unix_private.h | 5 + 5 files changed, 189 insertions(+) create mode 100644 dlls/winedmo/libavcodec/pcm_byte_order_reverse_bsf.c diff --git a/dlls/winedmo/Makefile.in b/dlls/winedmo/Makefile.in index 1cf228ffacd6..bee5d80f2423 100644 --- a/dlls/winedmo/Makefile.in +++ b/dlls/winedmo/Makefile.in @@ -12,6 +12,7 @@ SOURCES = \ media-converter/fossilize.c \ media-converter/murmur3.c \ media-converter/lib.c \ + libavcodec/pcm_byte_order_reverse_bsf.c \ unix_demuxer.c \ unix_demuxer_mediaconv.c \ unix_media_type.c \ diff --git a/dlls/winedmo/libavcodec/pcm_byte_order_reverse_bsf.c b/dlls/winedmo/libavcodec/pcm_byte_order_reverse_bsf.c new file mode 100644 index 000000000000..2237b1eaa849 --- /dev/null +++ b/dlls/winedmo/libavcodec/pcm_byte_order_reverse_bsf.c @@ -0,0 +1,157 @@ +/* + * PCM byte order reverse byte stream format filter + * Copyright (c) 2025 Conor McCarthy for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "config.h" +#include "unix_private.h" + +#ifdef HAVE_FFMPEG + +#define IS_EMPTY(pkt) (!(pkt)->data && !(pkt)->side_data_elems) + +struct AVBSFInternal { + AVPacket *buffer_pkt; + int eof; +}; + +/* From FFmpeg */ +int ff_bsf_get_packet(AVBSFContext *ctx, AVPacket **pkt) +{ + AVBSFInternal *bsfi = ctx->internal; + AVPacket *tmp_pkt; + + if (bsfi->eof) + return AVERROR_EOF; + + if (IS_EMPTY(bsfi->buffer_pkt)) + return AVERROR(EAGAIN); + + tmp_pkt = av_packet_alloc(); + if (!tmp_pkt) + return AVERROR(ENOMEM); + + *pkt = bsfi->buffer_pkt; + bsfi->buffer_pkt = tmp_pkt; + + return 0; +} + +static enum AVCodecID reverse_codec_id(enum AVCodecID codec_id) +{ + switch (codec_id) + { + case AV_CODEC_ID_PCM_S16BE: return AV_CODEC_ID_PCM_S16LE; + case AV_CODEC_ID_PCM_S24BE: return AV_CODEC_ID_PCM_S24LE; + case AV_CODEC_ID_PCM_S32BE: return AV_CODEC_ID_PCM_S32LE; + case AV_CODEC_ID_PCM_S64BE: return AV_CODEC_ID_PCM_S64LE; + case AV_CODEC_ID_PCM_F32BE: return AV_CODEC_ID_PCM_F32LE; + case AV_CODEC_ID_PCM_F64BE: return AV_CODEC_ID_PCM_F64LE; + case AV_CODEC_ID_PCM_S16LE: return AV_CODEC_ID_PCM_S16BE; + case AV_CODEC_ID_PCM_S24LE: return AV_CODEC_ID_PCM_S24BE; + case AV_CODEC_ID_PCM_S32LE: return AV_CODEC_ID_PCM_S32BE; + case AV_CODEC_ID_PCM_S64LE: return AV_CODEC_ID_PCM_S64BE; + case AV_CODEC_ID_PCM_F32LE: return AV_CODEC_ID_PCM_F32BE; + case AV_CODEC_ID_PCM_F64LE: return AV_CODEC_ID_PCM_F64BE; + default: return codec_id; + } +} + +static int init(AVBSFContext *ctx) +{ + if (ctx->par_in->channels <= 0 || ctx->par_in->sample_rate <= 0) + return AVERROR(EINVAL); + if (ctx->par_in->bits_per_coded_sample % 8u) + return AVERROR(EINVAL); + + ctx->par_out->codec_id = reverse_codec_id(ctx->par_in->codec_id); + + return 0; +} + +static int byte_order_reverse_filter(AVBSFContext *ctx, AVPacket *pkt) +{ + unsigned int bytes_per_sample; + const uint8_t *buf_end; + const uint8_t *buf; + unsigned int i; + AVPacket *in; + uint8_t *out; + int ret; + + ret = ff_bsf_get_packet(ctx, &in); + if (ret < 0) + return ret; + + buf = in->data; + buf_end = in->data + in->size; + + ret = av_new_packet(pkt, in->size); + if (ret < 0) + return ret; + out = pkt->data; + + ret = av_packet_copy_props(pkt, in); + if (ret < 0) + goto fail; + + bytes_per_sample = ctx->par_in->bits_per_coded_sample / 8u; + + while (buf < buf_end) + { + for (i = 0; i < bytes_per_sample; ++i) + out[i] = buf[bytes_per_sample - i - 1]; + buf += bytes_per_sample; + out += bytes_per_sample; + } + +fail: + if (ret < 0) + av_packet_unref(pkt); + av_packet_free(&in); + return ret; +} + +static const enum AVCodecID codec_ids[] = { + AV_CODEC_ID_PCM_S8, + AV_CODEC_ID_PCM_S16LE, + AV_CODEC_ID_PCM_S16BE, + AV_CODEC_ID_PCM_S24LE, + AV_CODEC_ID_PCM_S24BE, + AV_CODEC_ID_PCM_S32LE, + AV_CODEC_ID_PCM_S32BE, + AV_CODEC_ID_PCM_S64LE, + AV_CODEC_ID_PCM_S64BE, + AV_CODEC_ID_PCM_F32LE, + AV_CODEC_ID_PCM_F32BE, + AV_CODEC_ID_PCM_F64LE, + AV_CODEC_ID_PCM_F64BE, + AV_CODEC_ID_NONE, +}; + +const AVBitStreamFilter ff_pcm_byte_order_reverse_bsf = { + .name = "pcm_byte_order_reverse", + .filter = byte_order_reverse_filter, + .init = init, + .codec_ids = codec_ids, +}; + +#endif /* HAVE_FFMPEG */ diff --git a/dlls/winedmo/unix_demuxer.c b/dlls/winedmo/unix_demuxer.c index 13759cf7fb5f..8b247932decd 100644 --- a/dlls/winedmo/unix_demuxer.c +++ b/dlls/winedmo/unix_demuxer.c @@ -104,6 +104,22 @@ NTSTATUS demuxer_check( void *arg ) return STATUS_SUCCESS; } +static BOOL codec_is_big_endian_pcm(enum AVCodecID codec_id) +{ + switch (codec_id) + { + case AV_CODEC_ID_PCM_S16BE: + case AV_CODEC_ID_PCM_S24BE: + case AV_CODEC_ID_PCM_S32BE: + case AV_CODEC_ID_PCM_S64BE: + case AV_CODEC_ID_PCM_F32BE: + case AV_CODEC_ID_PCM_F64BE: + return TRUE; + default: + return FALSE; + } +} + static NTSTATUS demuxer_create_streams( struct demuxer *demuxer ) { UINT i; @@ -126,6 +142,14 @@ static NTSTATUS demuxer_create_streams( struct demuxer *demuxer ) continue; } } + else if (codec_is_big_endian_pcm(par->codec_id)) + { + /* WAVEFORMATEX does not contain endianness info, so this needs to be converted here. */ + if (av_bsf_alloc( &ff_pcm_byte_order_reverse_bsf, &stream->filter ) < 0) return STATUS_UNSUCCESSFUL; + avcodec_parameters_copy( stream->filter->par_in, par ); + av_bsf_init( stream->filter ); + continue; + } av_bsf_get_null_filter( &stream->filter ); avcodec_parameters_copy( stream->filter->par_in, demuxer->ctx->streams[i]->codecpar ); diff --git a/dlls/winedmo/unix_media_type.c b/dlls/winedmo/unix_media_type.c index 3753002744f4..e29cbdd2ec16 100644 --- a/dlls/winedmo/unix_media_type.c +++ b/dlls/winedmo/unix_media_type.c @@ -185,6 +185,8 @@ static NTSTATUS audio_format_from_codec_params( const AVCodecParameters *params, format_tag = wave_format_tag_from_codec_id( params->codec_id ); if (params->codec_id == AV_CODEC_ID_OPUS) format_tag = WAVE_FORMAT_OPUS; + /* Big-endian PCM in native Windows is given the usual WAVE_FORMAT_PCM tag. */ + else if (params->codec_id == AV_CODEC_ID_PCM_S16BE) format_tag = WAVE_FORMAT_PCM; if (format_tag == WAVE_FORMAT_EXTENSIBLE || format_tag >> 16 || (channels > 2 && channel_mask != 0) || params->codec_id == AV_CODEC_ID_VORBIS) diff --git a/dlls/winedmo/unix_private.h b/dlls/winedmo/unix_private.h index 53391118f530..8974afd5f72f 100644 --- a/dlls/winedmo/unix_private.h +++ b/dlls/winedmo/unix_private.h @@ -44,6 +44,11 @@ extern void mediaconv_demuxer_init(void); extern void mediaconv_demuxer_exit(void); extern int mediaconv_demuxer_open( AVFormatContext **ctx, struct stream_context *context ); +/* libavcodec/pcm_byte_order_reverse.c */ +#ifdef HAVE_FFMPEG +extern const AVBitStreamFilter ff_pcm_byte_order_reverse_bsf; +#endif + /* unixlib.c */ extern int64_t unix_seek_callback( void *opaque, int64_t offset, int whence ); extern int unix_read_callback( void *opaque, uint8_t *buffer, int size ); From e23ea6a092134804ae31d65cd26d8f5ad4e42389 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Mon, 13 Jan 2025 15:37:24 +1000 Subject: [PATCH 1048/2542] winedmo: Detect the MIME type for ogg. --- dlls/winedmo/unix_demuxer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/winedmo/unix_demuxer.c b/dlls/winedmo/unix_demuxer.c index 8b247932decd..e02a439ed2d0 100644 --- a/dlls/winedmo/unix_demuxer.c +++ b/dlls/winedmo/unix_demuxer.c @@ -211,6 +211,11 @@ NTSTATUS demuxer_create( void *arg ) else if (!strcmp( ext, ".wmv" )) strcpy( params->mime_type, "video/x-ms-wmv" ); else strcpy( params->mime_type, "video/x-ms-asf" ); } + else if (strstr( format->name, "ogg" )) + { + if (!strcmp( ext, ".oga" ) || !strcmp( ext, ".opus" )) strcpy( params->mime_type, "audio/ogg" ); + else strcpy( params->mime_type, "video/ogg" ); + } else { FIXME( "Unknown MIME type for format %s, url %s\n", debugstr_a(format->name), debugstr_a(params->url) ); From 59ae8cb1568d7cdde40a133a5bbb89eeb459fb6e Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Mon, 13 Jan 2025 15:37:56 +1000 Subject: [PATCH 1049/2542] winegstreamer: Do not unref the buffer in push_vorbis_headers(). gst_value_get_buffer() does not return a reference to the buffer. --- dlls/winegstreamer/wg_transform.c | 1 - 1 file changed, 1 deletion(-) diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index 18a6599f7b9e..78cca8c2d4d2 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -534,7 +534,6 @@ static void push_vorbis_headers(struct wg_transform *transform) failed: gst_buffer_unmap(codec_data, &info); - gst_buffer_unref(codec_data); } From 513d6479aff3bdceb2110f29c3217486f66de887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 3 Jan 2025 10:35:41 +0100 Subject: [PATCH 1050/2542] winebus: Ignore unsupported hidraw touchscreen devices. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57601 (cherry picked from commit 28c806ae9c78d4c0675f5e2aab3becf4073621b8) CW-Bug-ID: #24661 --- dlls/winebus.sys/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c index e0e95b86e131..19fe986a6742 100644 --- a/dlls/winebus.sys/main.c +++ b/dlls/winebus.sys/main.c @@ -462,6 +462,12 @@ static BOOL is_hidraw_enabled(WORD vid, WORD pid, const USAGE_AND_PAGE *usages, if (check_bus_option(L"DisableHidraw", FALSE)) return FALSE; + if (usages->UsagePage == HID_USAGE_PAGE_DIGITIZER) + { + WARN("Ignoring unsupported %04X:%04X hidraw touchscreen\n", vid, pid); + return FALSE; + } + if (!RtlQueryEnvironmentVariable(NULL, L"PROTON_DISABLE_HIDRAW", 20, value, ARRAY_SIZE(value) - 1, &len)) { value[len] = 0; From dbf857a2d56e6ecca524bb96efc00f2893f28253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 14 Jan 2025 11:44:00 +0100 Subject: [PATCH 1051/2542] HACK: mfplat: Use the MP4 bytestream handler as a fallback. Instead of falling back directly to GStreamer media source, giving a chance to winedmo. This fixes Twisted Sails video playback, as it plays a MP4 file with a ".resource" extension, no MIME type, and doesn't set the MF_RESOLUTION_CONTENT_DOES_NOT_HAVE_TO_MATCH_EXTENSION_OR_MIME_TYPE flag on resolver creation. This is a hack as it probably is something wrong with the resolver creation, which should likely find the MP4 bytestream handler on its own, even if that flag isn't set, but it will also make sure the MF pipelines are used all the time as default, similar to Proton 9 NMS. CW-Bug-Id: #24673 --- dlls/mfplat/main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 8e15abc4de0f..839f54a9cb45 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -43,6 +43,7 @@ #include "strsafe.h" #undef INITGUID #include "evr.h" +#include "wine/mfinternal.h" /* mfd3d12 guids are not included in mfuuid */ #define INITGUID #undef EXTERN_GUID @@ -6292,10 +6293,9 @@ static HRESULT resolver_get_bytestream_url_hint(IMFByteStream *stream, WCHAR con return S_OK; } -static HRESULT resolver_create_gstreamer_handler(IMFByteStreamHandler **handler) +static HRESULT resolver_create_default_handler(IMFByteStreamHandler **handler) { - static const GUID CLSID_GStreamerByteStreamHandler = {0x317df618, 0x5e5a, 0x468a, {0x9f, 0x15, 0xd8, 0x27, 0xa9, 0xa0, 0x81, 0x62}}; - return CoCreateInstance(&CLSID_GStreamerByteStreamHandler, NULL, CLSCTX_INPROC_SERVER, &IID_IMFByteStreamHandler, (void **)handler); + return CoCreateInstance(&CLSID_MPEG4ByteStreamHandlerPlugin, NULL, CLSCTX_INPROC_SERVER, &IID_IMFByteStreamHandler, (void **)handler); } static HRESULT resolver_get_bytestream_handler(IMFByteStream *stream, const WCHAR *url, DWORD flags, @@ -6331,12 +6331,14 @@ static HRESULT resolver_get_bytestream_handler(IMFByteStream *stream, const WCHA this handler for all possible types. */ + TRACE( "url_ext %s mimeW %s\n", debugstr_w(url_ext), debugstr_w(mimeW) ); + if (url_ext || mimeW) { hr = resolver_create_bytestream_handler(stream, flags, mimeW, url_ext, handler); if (FAILED(hr)) - hr = resolver_create_gstreamer_handler(handler); + hr = resolver_create_default_handler(handler); } CoTaskMemFree(mimeW); @@ -6354,7 +6356,7 @@ static HRESULT resolver_get_bytestream_handler(IMFByteStream *stream, const WCHA hr = resolver_create_bytestream_handler(stream, flags, NULL, url_ext, handler); if (FAILED(hr)) - hr = resolver_create_gstreamer_handler(handler); + hr = resolver_create_default_handler(handler); return hr; } From d90c49e19e2ae4bcaec3f687d979bf7900f13df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 14 Jan 2025 14:36:24 +0100 Subject: [PATCH 1052/2542] winedmo: Parse stream names from MP4 moov/trak/udta/name tags. FFmpeg doesn't parse them as stream titles. There is an "export_all" demuxer option that can be used to export every other unknown tag as metadata, but it currently fills the demuxer metadata and not individual streams, and this causes each title to overwrite the preceding one. CW-Bug-Id: #24671 --- dlls/winedmo/unix_demuxer.c | 74 ++++++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/dlls/winedmo/unix_demuxer.c b/dlls/winedmo/unix_demuxer.c index e02a439ed2d0..199a271b474f 100644 --- a/dlls/winedmo/unix_demuxer.c +++ b/dlls/winedmo/unix_demuxer.c @@ -159,6 +159,76 @@ static NTSTATUS demuxer_create_streams( struct demuxer *demuxer ) return STATUS_SUCCESS; } +static int next_mov_atom( struct stream_context *context, UINT32 *type, UINT64 *size ) +{ + struct + { + UINT32 size; + UINT32 type; + } atom; + int ret; + + if ((ret = unix_read_callback( context, (uint8_t *)&atom, sizeof(atom) )) < 0) return ret; + if (!(*size = RtlUlongByteSwap( atom.size )) || (*size > 1 && *size < sizeof(atom))) return -1; + if (*size == 1 && (ret = unix_read_callback( context, (uint8_t *)size, sizeof(*size) )) < 0) return ret; + *size -= sizeof(atom); + *type = atom.type; + return 0; +} + +static void parse_stream_names( struct demuxer *demuxer, UINT32 root, UINT64 size, int index ) +{ + struct stream_context *context = demuxer->ctx->pb->opaque; + UINT64 end = context->position + size; + UINT32 atom; + char *name; + + TRACE( "demuxer %p, root %s\n", demuxer, debugstr_fourcc(root) ); + + while (context->position < end && !next_mov_atom( context, &atom, &size )) + { +#define CASE(l,h) (((UINT64)(h) << 32) | (l)) + switch (CASE(root, atom)) + { + case CASE(MAKEFOURCC('r','o','o','t'), MAKEFOURCC('m','o','o','v')): + parse_stream_names( demuxer, atom, size, 0 ); + break; + case CASE(MAKEFOURCC('m','o','o','v'), MAKEFOURCC('t','r','a','k')): + parse_stream_names( demuxer, atom, size, index++ ); + break; + case CASE(MAKEFOURCC('t','r','a','k'), MAKEFOURCC('u','d','t','a')): + parse_stream_names( demuxer, atom, size, index ); + break; + case CASE(MAKEFOURCC('u','d','t','a'), MAKEFOURCC('n','a','m','e')): + if ((name = calloc( 1, size + 1 ))) + { + unix_read_callback( context, (uint8_t *)name, size ); + TRACE( "found name %s for stream %u\n", debugstr_a(name), index ); + av_dict_set( &demuxer->ctx->streams[index]->metadata, "name", name, 0 ); + free( name ); + break; + } + /* fallthrough */ + default: + unix_seek_callback( context, size, SEEK_CUR ); + break; +#undef CASE + } + } +} + +static void parse_mp4_streams_metadata( struct demuxer *demuxer ) +{ + struct stream_context *context = demuxer->ctx->pb->opaque; + int64_t pos = context->position; + + if (context->length == -1) return; + + unix_seek_callback( context, 0, SEEK_SET ); + parse_stream_names( demuxer, MAKEFOURCC('r','o','o','t'), context->length, 0 ); + unix_seek_callback( context, pos, SEEK_SET ); +} + NTSTATUS demuxer_create( void *arg ) { struct demuxer_create_params *params = arg; @@ -222,6 +292,7 @@ NTSTATUS demuxer_create( void *arg ) strcpy( params->mime_type, "video/x-application" ); } + if (strstr( format->name, "mp4" )) parse_mp4_streams_metadata( demuxer ); return STATUS_SUCCESS; failed: @@ -392,7 +463,8 @@ NTSTATUS demuxer_stream_name( void *arg ) TRACE( "demuxer %p, stream %u\n", demuxer, params->stream ); - if (!(tag = av_dict_get( stream->metadata, "title", NULL, AV_DICT_IGNORE_SUFFIX ))) + if (!(tag = av_dict_get( stream->metadata, "title", NULL, AV_DICT_IGNORE_SUFFIX )) && + !(tag = av_dict_get( stream->metadata, "name", NULL, AV_DICT_IGNORE_SUFFIX ))) return STATUS_NOT_FOUND; lstrcpynA( params->buffer, tag->value, ARRAY_SIZE( params->buffer ) ); From eb03cacc9dc09b76c0c9c3bf8d2b3a54217ac1e4 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 9 Jan 2025 19:25:14 -0600 Subject: [PATCH 1053/2542] include: Add ID list filter constants. CW-Bug-Id: #24649 --- include/cfgmgr32.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/cfgmgr32.h b/include/cfgmgr32.h index 0893e42b399d..b22a5ed585b9 100644 --- a/include/cfgmgr32.h +++ b/include/cfgmgr32.h @@ -183,6 +183,19 @@ typedef DWORD CONFIGRET; #define CM_REMOVAL_POLICY_EXPECT_ORDERLY_REMOVAL 2 #define CM_REMOVAL_POLICY_EXPECT_SURPRISE_REMOVAL 3 +#define CM_GETIDLIST_FILTER_NONE 0x00000000 +#define CM_GETIDLIST_FILTER_ENUMERATOR 0x00000001 +#define CM_GETIDLIST_FILTER_SERVICE 0x00000002 +#define CM_GETIDLIST_FILTER_EJECTRELATIONS 0x00000004 +#define CM_GETIDLIST_FILTER_REMOVALRELATIONS 0x00000008 +#define CM_GETIDLIST_FILTER_POWERRELATIONS 0x00000010 +#define CM_GETIDLIST_FILTER_BUSRELATIONS 0x00000020 +#define CM_GETIDLIST_DONOTGENERATE 0x10000040 +#define CM_GETIDLIST_FILTER_TRANSPORTRELATIONS 0x00000080 +#define CM_GETIDLIST_FILTER_PRESENT 0x00000100 +#define CM_GETIDLIST_FILTER_CLASS 0x00000200 +#define CM_GETIDLIST_FILTER_BITS 0x100003FF + typedef DWORD DEVINST, *PDEVINST; typedef DWORD DEVNODE, *PDEVNODE; typedef HANDLE HMACHINE, *PHMACHINE; From 4949e7d55b489d7e80acc984289512ea37d5e1c5 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 9 Jan 2025 21:21:19 -0600 Subject: [PATCH 1054/2542] setupapi: Implement CM_Get_Device_ID_List[_Size]{A|W}(). CW-Bug-Id: #24649 --- dlls/cfgmgr32/tests/Makefile.in | 2 +- dlls/cfgmgr32/tests/cfgmgr32.c | 122 ++++++++++++++++++++++- dlls/setupapi/devinst.c | 169 ++++++++++++++++++++++++++++++++ dlls/setupapi/stubs.c | 44 --------- include/cfgmgr32.h | 3 + 5 files changed, 294 insertions(+), 46 deletions(-) diff --git a/dlls/cfgmgr32/tests/Makefile.in b/dlls/cfgmgr32/tests/Makefile.in index 8b836ba3b766..03b5e5f8fb01 100644 --- a/dlls/cfgmgr32/tests/Makefile.in +++ b/dlls/cfgmgr32/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = cfgmgr32.dll -IMPORTS = cfgmgr32 +IMPORTS = cfgmgr32 ole32 uuid SOURCES = \ cfgmgr32.c diff --git a/dlls/cfgmgr32/tests/cfgmgr32.c b/dlls/cfgmgr32/tests/cfgmgr32.c index 22344c45afcc..94b2cff46d08 100644 --- a/dlls/cfgmgr32/tests/cfgmgr32.c +++ b/dlls/cfgmgr32/tests/cfgmgr32.c @@ -17,8 +17,16 @@ */ #include "wine/test.h" -#include "winreg.h" +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "objbase.h" +#include "devguid.h" +#include "initguid.h" +#include "devpkey.h" +#include "setupapi.h" #include "cfgmgr32.h" +#include "ntddvdeo.h" static void test_CM_MapCrToWin32Err(void) { @@ -106,7 +114,119 @@ static void test_CM_MapCrToWin32Err(void) } } +static void test_CM_Get_Device_ID_List(void) +{ + WCHAR wguid_str[64], *wbuf, *wp; + char guid_str[64], *buf, *p; + unsigned int count; + CONFIGRET ret; + ULONG len; + + StringFromGUID2(&GUID_DEVCLASS_DISPLAY, wguid_str, ARRAY_SIZE(wguid_str)); + wp = wguid_str; + p = guid_str; + while ((*p++ = *wp++)) + ; + + ret = CM_Get_Device_ID_List_SizeW(NULL, wguid_str, CM_GETIDLIST_FILTER_CLASS); + ok(ret == CR_INVALID_POINTER, "got %#lx.\n", ret); + len = 0xdeadbeef; + ret = CM_Get_Device_ID_List_SizeW(&len, NULL, CM_GETIDLIST_FILTER_CLASS); + ok(ret == CR_INVALID_POINTER, "got %#lx.\n", ret); + ok(!len, "got %#lx.\n", len); + len = 0xdeadbeef; + ret = CM_Get_Device_ID_List_SizeW(&len, L"q", CM_GETIDLIST_FILTER_CLASS); + ok(ret == CR_INVALID_DATA, "got %#lx.\n", ret); + ok(!len, "got %#lx.\n", len); + + ret = CM_Get_Device_ID_List_SizeA(NULL, guid_str, CM_GETIDLIST_FILTER_CLASS); + ok(ret == CR_INVALID_POINTER, "got %#lx.\n", ret); + len = 0xdeadbeef; + ret = CM_Get_Device_ID_List_SizeA(&len, NULL, CM_GETIDLIST_FILTER_CLASS); + ok(ret == CR_INVALID_POINTER, "got %#lx.\n", ret); + ok(!len, "got %#lx.\n", len); + len = 0xdeadbeef; + ret = CM_Get_Device_ID_List_SizeA(&len, "q", CM_GETIDLIST_FILTER_CLASS); + ok(ret == CR_INVALID_DATA, "got %#lx.\n", ret); + ok(!len, "got %#lx.\n", len); + + len = 0xdeadbeef; + ret = CM_Get_Device_ID_List_SizeW(&len, NULL, 0); + ok(!ret, "got %#lx.\n", ret); + ok(len > 2, "got %#lx.\n", len); + + wbuf = malloc(len * sizeof(*wbuf)); + buf = malloc(len); + + ret = CM_Get_Device_ID_ListW(NULL, wbuf, len, 0); + ok(!ret, "got %#lx.\n", ret); + + len = 0xdeadbeef; + ret = CM_Get_Device_ID_List_SizeW(&len, wguid_str, CM_GETIDLIST_FILTER_CLASS); + ok(!ret, "got %#lx.\n", ret); + ok(len > 2, "got %lu.\n", len); + memset(wbuf, 0xcc, len * sizeof(*wbuf)); + ret = CM_Get_Device_ID_ListW(wguid_str, wbuf, 0, CM_GETIDLIST_FILTER_CLASS); + ok(ret == CR_INVALID_POINTER, "got %#lx.\n", ret); + ok(wbuf[0] == 0xcccc, "got %#x.\n", wbuf[0]); + memset(wbuf, 0xcc, len * sizeof(*wbuf)); + ret = CM_Get_Device_ID_ListW(wguid_str, wbuf, 1, CM_GETIDLIST_FILTER_CLASS); + ok(ret == CR_BUFFER_SMALL, "got %#lx.\n", ret); + ok(!wbuf[0], "got %#x.\n", wbuf[0]); + + len = 0xdeadbeef; + ret = CM_Get_Device_ID_List_SizeA(&len, guid_str, CM_GETIDLIST_FILTER_CLASS); + ok(!ret, "got %#lx.\n", ret); + ok(len > 2, "got %lu.\n", len); + memset(buf, 0x7c, len); + ret = CM_Get_Device_ID_ListA(guid_str, buf, 0, CM_GETIDLIST_FILTER_CLASS); + ok(ret == CR_INVALID_POINTER, "got %#lx.\n", ret); + ok(buf[0] == 0x7c, "got %#x.\n", buf[0]); + memset(buf, 0x7c, len); + ret = CM_Get_Device_ID_ListA(guid_str, buf, 1, CM_GETIDLIST_FILTER_CLASS); + ok(ret == CR_BUFFER_SMALL, "got %#lx.\n", ret); + ok(buf[0] == 0x7c, "got %#x.\n", buf[0]); + + memset(wbuf, 0xcc, len * sizeof(*wbuf)); + ret = CM_Get_Device_ID_ListW(wguid_str, wbuf, len, CM_GETIDLIST_FILTER_CLASS); + ok(!ret, "got %#lx.\n", ret); + count = 0; + wp = wbuf; + while (*wp) + { + ++count; + ok(!wcsncmp(wp, L"PCI\\", 4), "got %s.\n", debugstr_w(wp)); + wp += wcslen(wp) + 1; + } + ok(count, "got 0.\n"); + + memset(buf, 0xcc, len * sizeof(*buf)); + ret = CM_Get_Device_ID_ListA(guid_str, buf, len, CM_GETIDLIST_FILTER_CLASS); + ok(!ret, "got %#lx.\n", ret); + count = 0; + p = buf; + while (*p) + { + ++count; + ok(!strncmp(p, "PCI\\", 4), "got %s.\n", debugstr_a(p)); + p += strlen(p) + 1; + } + ok(count, "got 0.\n"); + + StringFromGUID2(&GUID_DISPLAY_DEVICE_ARRIVAL, wguid_str, ARRAY_SIZE(wguid_str)); + len = 0xdeadbeef; + ret = CM_Get_Device_ID_List_SizeW(&len, wguid_str, CM_GETIDLIST_FILTER_CLASS); + ok(!ret, "got %#lx.\n", ret); + ok(len == 1, "got %lu.\n", len); + memset(wbuf, 0xcc, len * sizeof(*wbuf)); + ret = CM_Get_Device_ID_ListW(wguid_str, wbuf, len, CM_GETIDLIST_FILTER_CLASS); + ok(!ret, "got %#lx.\n", ret); + free(wbuf); + free(buf); +} + START_TEST(cfgmgr32) { test_CM_MapCrToWin32Err(); + test_CM_Get_Device_ID_List(); } diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 0ad66db4a2dc..b04e62ae1ee8 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -38,6 +38,7 @@ #include "shlwapi.h" #include "wine/debug.h" #include "wine/list.h" +#include "objbase.h" #include "cfgmgr32.h" #include "winioctl.h" #include "rpc.h" @@ -4390,6 +4391,174 @@ CONFIGRET WINAPI CM_Get_Device_ID_Size(ULONG *len, DEVINST devnode, ULONG flags) return CR_SUCCESS; } +static CONFIGRET get_device_id_list(const WCHAR *filter, WCHAR *buffer, ULONG *len, ULONG flags) +{ + const ULONG supported_flags = CM_GETIDLIST_FILTER_NONE | CM_GETIDLIST_FILTER_CLASS | CM_GETIDLIST_FILTER_PRESENT; + SP_DEVINFO_DATA device = { sizeof(device) }; + CONFIGRET ret = CR_SUCCESS; + GUID guid, *pguid = NULL; + unsigned int i, id_len; + ULONG query_flags = 0; + HDEVINFO set; + WCHAR id[64]; + ULONG needed; + WCHAR *p; + + if (!len || (buffer && !*len)) + return CR_INVALID_POINTER; + + needed = 1; + + if (buffer) + *buffer = 0; + if (flags & ~supported_flags) + { + FIXME("Flags %#lx are not supported.\n", flags); + *len = needed; + return CR_SUCCESS; + } + + if (!buffer) + *len = 0; + + if (flags & CM_GETIDLIST_FILTER_CLASS) + { + if (!filter) + return CR_INVALID_POINTER; + if (IIDFromString((WCHAR *)filter, &guid)) + return CR_INVALID_DATA; + pguid = &guid; + } + + if (!buffer) + *len = needed; + + if (!pguid) + query_flags |= DIGCF_ALLCLASSES; + if (flags & CM_GETIDLIST_FILTER_PRESENT) + query_flags |= DIGCF_PRESENT; + + set = SetupDiGetClassDevsW(pguid, NULL, NULL, query_flags); + if (set == INVALID_HANDLE_VALUE) + return CR_SUCCESS; + + p = buffer; + for (i = 0; SetupDiEnumDeviceInfo(set, i, &device); ++i) + { + ret = SetupDiGetDeviceInstanceIdW(set, &device, id, sizeof(id), NULL); + if (!ret) continue; + id_len = wcslen(id) + 1; + needed += id_len; + if (buffer) + { + if (needed > *len) + { + SetupDiDestroyDeviceInfoList(set); + *buffer = 0; + return CR_BUFFER_SMALL; + } + memcpy(p, id, sizeof(*p) * id_len); + p += id_len; + } + } + SetupDiDestroyDeviceInfoList(set); + *len = needed; + if (buffer) + *p = 0; + return CR_SUCCESS; +} + +/*********************************************************************** + * CM_Get_Device_ID_ListW (SETUPAPI.@) + */ +CONFIGRET WINAPI CM_Get_Device_ID_ListW(const WCHAR *filter, WCHAR *buffer, ULONG len, ULONG flags) +{ + TRACE("%s %p %ld %#lx.\n", debugstr_w(filter), buffer, len, flags); + + if (!buffer) + return CR_INVALID_POINTER; + + return get_device_id_list(filter, buffer, &len, flags); +} + +/*********************************************************************** + * CM_Get_Device_ID_List_SizeW (SETUPAPI.@) + */ +CONFIGRET WINAPI CM_Get_Device_ID_List_SizeW(ULONG *len, const WCHAR *filter, ULONG flags) +{ + TRACE("%p %s %#lx.\n", len, debugstr_w(filter), flags); + + return get_device_id_list(filter, NULL, len, flags); +} + +/*********************************************************************** + * CM_Get_Device_ID_ListA (SETUPAPI.@) + */ +CONFIGRET WINAPI CM_Get_Device_ID_ListA(const char *filter, char *buffer, ULONG len, ULONG flags ) +{ + WCHAR *wbuffer, *wfilter = NULL, *p; + CONFIGRET ret; + + TRACE("%s %p %ld %#lx.\n", debugstr_a(filter), buffer, len, flags); + + if (!buffer || !len) + return CR_INVALID_POINTER; + + if (!(wbuffer = malloc(len * sizeof(*wbuffer)))) + return CR_OUT_OF_MEMORY; + + if (filter) + { + if (!(wfilter = malloc((strlen(filter) + 1) * sizeof(*wfilter)))) + { + free(wbuffer); + return CR_OUT_OF_MEMORY; + } + + p = wfilter; + while ((*p++ = *filter++)) + ; + } + + if (!(ret = CM_Get_Device_ID_ListW(wfilter, wbuffer, len, flags))) + { + p = wbuffer; + while (*p) + { + while ((*buffer++ = *p++)) + ; + } + *buffer = 0; + } + free(wfilter); + free(wbuffer); + return ret; +} + +/*********************************************************************** + * CM_Get_Device_ID_List_SizeA (SETUPAPI.@) + */ +CONFIGRET WINAPI CM_Get_Device_ID_List_SizeA(ULONG *len, const char *filter, ULONG flags) +{ + WCHAR *wfilter = NULL, *p; + CONFIGRET ret; + + TRACE("%p %s %#lx.\n", len, debugstr_a(filter), flags); + + if (filter) + { + if (!(wfilter = malloc(strlen(filter) * sizeof(*wfilter)))) + return CR_OUT_OF_MEMORY; + + p = wfilter; + while ((*p++ = *filter++)) + ; + } + ret = CM_Get_Device_ID_List_SizeW(len, wfilter, flags); + free(wfilter); + return ret; +} + /*********************************************************************** * SetupDiGetINFClassA (SETUPAPI.@) */ diff --git a/dlls/setupapi/stubs.c b/dlls/setupapi/stubs.c index 75185de047c8..419168d0f1e2 100644 --- a/dlls/setupapi/stubs.c +++ b/dlls/setupapi/stubs.c @@ -130,50 +130,6 @@ DWORD WINAPI CM_Get_Device_ID_ExW( return CR_SUCCESS; } -/*********************************************************************** - * CM_Get_Device_ID_ListA (SETUPAPI.@) - */ -CONFIGRET WINAPI CM_Get_Device_ID_ListA( - PCSTR pszFilter, PCHAR Buffer, ULONG BufferLen, ULONG ulFlags ) -{ - FIXME("%s %p %ld 0x%08lx: stub\n", debugstr_a(pszFilter), Buffer, BufferLen, ulFlags); - - if (BufferLen >= 2) Buffer[0] = Buffer[1] = 0; - return CR_SUCCESS; -} - -/*********************************************************************** - * CM_Get_Device_ID_ListW (SETUPAPI.@) - */ -CONFIGRET WINAPI CM_Get_Device_ID_ListW( - PCWSTR pszFilter, PWCHAR Buffer, ULONG BufferLen, ULONG ulFlags ) -{ - FIXME("%s %p %ld 0x%08lx: stub\n", debugstr_w(pszFilter), Buffer, BufferLen, ulFlags); - - if (BufferLen >= 2) Buffer[0] = Buffer[1] = 0; - return CR_SUCCESS; -} - -/*********************************************************************** - * CM_Get_Device_ID_List_SizeA (SETUPAPI.@) - */ -CONFIGRET WINAPI CM_Get_Device_ID_List_SizeA( PULONG pulLen, PCSTR pszFilter, ULONG ulFlags ) -{ - FIXME("%p %s 0x%08lx: stub\n", pulLen, debugstr_a(pszFilter), ulFlags); - - return CR_SUCCESS; -} - -/*********************************************************************** - * CM_Get_Device_ID_List_SizeW (SETUPAPI.@) - */ -CONFIGRET WINAPI CM_Get_Device_ID_List_SizeW( PULONG pulLen, PCWSTR pszFilter, ULONG ulFlags ) -{ - FIXME("%p %s 0x%08lx: stub\n", pulLen, debugstr_w(pszFilter), ulFlags); - - return CR_SUCCESS; -} - /*********************************************************************** * CM_Get_Parent (SETUPAPI.@) */ diff --git a/include/cfgmgr32.h b/include/cfgmgr32.h index b22a5ed585b9..1c09e7bf5951 100644 --- a/include/cfgmgr32.h +++ b/include/cfgmgr32.h @@ -302,6 +302,9 @@ CMAPI CONFIGRET WINAPI CM_Get_Device_ID_ExW(DEVINST,PWSTR,ULONG,ULONG,HMACHINE); CMAPI CONFIGRET WINAPI CM_Get_Device_ID_ListA(PCSTR,PCHAR,ULONG,ULONG); CMAPI CONFIGRET WINAPI CM_Get_Device_ID_ListW(PCWSTR,PWCHAR,ULONG,ULONG); #define CM_Get_Device_ID_List WINELIB_NAME_AW(CM_Get_Device_ID_List) +CMAPI CONFIGRET WINAPI CM_Get_Device_ID_List_SizeW(PULONG,PCWSTR,ULONG); +CMAPI CONFIGRET WINAPI CM_Get_Device_ID_List_SizeA(PULONG,PCSTR,ULONG); +#define CM_Get_Device_ID_List_Size WINELIB_NAME_AW(CM_Get_Device_ID_List_Size) CMAPI CONFIGRET WINAPI CM_Get_Device_ID_List_ExA(PCSTR,PCHAR,ULONG,ULONG,HMACHINE); CMAPI CONFIGRET WINAPI CM_Get_Device_ID_List_ExW(PCWSTR,PWCHAR,ULONG,ULONG,HMACHINE); #define CM_Get_Device_ID_List_Ex WINELIB_NAME_AW(CM_Get_Device_ID_List_Ex) From fe6d5563d7f8bc3bd8a604b88d950608e6e5698f Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 10 Jan 2025 14:21:33 -0600 Subject: [PATCH 1055/2542] setupapi: Make device instance handlers persistent. CW-Bug-Id: #24649 --- dlls/cfgmgr32/tests/Makefile.in | 2 +- dlls/cfgmgr32/tests/cfgmgr32.c | 44 +++++++++++-- dlls/setupapi/devinst.c | 106 ++++++++++++++++++-------------- include/cfgmgr32.h | 2 + 4 files changed, 102 insertions(+), 52 deletions(-) diff --git a/dlls/cfgmgr32/tests/Makefile.in b/dlls/cfgmgr32/tests/Makefile.in index 03b5e5f8fb01..64a01ccf4923 100644 --- a/dlls/cfgmgr32/tests/Makefile.in +++ b/dlls/cfgmgr32/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = cfgmgr32.dll -IMPORTS = cfgmgr32 ole32 uuid +IMPORTS = cfgmgr32 setupapi ole32 uuid SOURCES = \ cfgmgr32.c diff --git a/dlls/cfgmgr32/tests/cfgmgr32.c b/dlls/cfgmgr32/tests/cfgmgr32.c index 94b2cff46d08..ac84f1eadb2c 100644 --- a/dlls/cfgmgr32/tests/cfgmgr32.c +++ b/dlls/cfgmgr32/tests/cfgmgr32.c @@ -114,12 +114,22 @@ static void test_CM_MapCrToWin32Err(void) } } +DEFINE_DEVPROPKEY(DEVPROPKEY_GPU_LUID, 0x60b193cb, 0x5276, 0x4d0f, 0x96, 0xfc, 0xf1, 0x73, 0xab, 0xad, 0x3e, 0xc6, 2); + static void test_CM_Get_Device_ID_List(void) { - WCHAR wguid_str[64], *wbuf, *wp; + struct + { + WCHAR id[128]; + DEVINST inst; + } + instances[128]; + SP_DEVINFO_DATA device = { sizeof(device) }; + unsigned int i, count, expected_count; + WCHAR wguid_str[64], id[128], *wbuf, *wp; char guid_str[64], *buf, *p; - unsigned int count; CONFIGRET ret; + HDEVINFO set; ULONG len; StringFromGUID2(&GUID_DEVCLASS_DISPLAY, wguid_str, ARRAY_SIZE(wguid_str)); @@ -187,6 +197,32 @@ static void test_CM_Get_Device_ID_List(void) ok(ret == CR_BUFFER_SMALL, "got %#lx.\n", ret); ok(buf[0] == 0x7c, "got %#x.\n", buf[0]); + set = SetupDiGetClassDevsW(&GUID_DEVCLASS_DISPLAY, NULL, NULL, 0); + ok(set != &GUID_DEVCLASS_DISPLAY, "got error %#lx.\n", GetLastError()); + for (i = 0; SetupDiEnumDeviceInfo(set, i, &device); ++i) + { + ok(i < ARRAY_SIZE(instances), "got %u.\n", i); + ret = SetupDiGetDeviceInstanceIdW(set, &device, instances[i].id, sizeof(instances[i].id), NULL); + ok(ret, "got error %#lx.\n", GetLastError()); + instances[i].inst = device.DevInst; + } + SetupDiDestroyDeviceInfoList(set); + expected_count = i; + for (i = 0; i < expected_count; ++i) + { + DEVPROPTYPE type; + ULONG size; + + *id = 0; + ret = CM_Get_Device_IDW(instances[i].inst, id, ARRAY_SIZE(id), 0); + ok(!ret, "got %#lx.\n", ret); + ok(!wcscmp(id, instances[i].id), "got %s, expected %s.\n", debugstr_w(id), debugstr_w(instances[i].id)); + size = len; + ret = CM_Get_DevNode_PropertyW(instances[i].inst, &DEVPROPKEY_GPU_LUID, &type, wbuf, &size, 0); + ok(!ret, "got %#lx.\n", ret); + ok(type == DEVPROP_TYPE_UINT64, "got %#lx.\n", type); + } + memset(wbuf, 0xcc, len * sizeof(*wbuf)); ret = CM_Get_Device_ID_ListW(wguid_str, wbuf, len, CM_GETIDLIST_FILTER_CLASS); ok(!ret, "got %#lx.\n", ret); @@ -198,7 +234,7 @@ static void test_CM_Get_Device_ID_List(void) ok(!wcsncmp(wp, L"PCI\\", 4), "got %s.\n", debugstr_w(wp)); wp += wcslen(wp) + 1; } - ok(count, "got 0.\n"); + ok(count == expected_count, "got %u, expected %u.\n", count, expected_count); memset(buf, 0xcc, len * sizeof(*buf)); ret = CM_Get_Device_ID_ListA(guid_str, buf, len, CM_GETIDLIST_FILTER_CLASS); @@ -211,7 +247,7 @@ static void test_CM_Get_Device_ID_List(void) ok(!strncmp(p, "PCI\\", 4), "got %s.\n", debugstr_a(p)); p += strlen(p) + 1; } - ok(count, "got 0.\n"); + ok(count == expected_count, "got %u, expected %u.\n", count, expected_count); StringFromGUID2(&GUID_DISPLAY_DEVICE_ARRIVAL, wguid_str, ARRAY_SIZE(wguid_str)); len = 0xdeadbeef; diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index b04e62ae1ee8..a66020c83797 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -288,50 +288,45 @@ static inline void copy_device_iface_data(SP_DEVICE_INTERFACE_DATA *data, data->Reserved = (ULONG_PTR)iface; } -static struct device **devnode_table; -static unsigned int devnode_table_size; +static WCHAR **devinst_table; +static unsigned int devinst_table_size; -static DEVINST alloc_devnode(struct device *device) +static DEVINST get_devinst_for_device_id(const WCHAR *id) { unsigned int i; - for (i = 0; i < devnode_table_size; ++i) + for (i = 0; i < devinst_table_size; ++i) { - if (!devnode_table[i]) + if (!devinst_table[i]) break; + if (!wcsicmp(devinst_table[i], id)) + return i; } + return i; +} - if (i == devnode_table_size) +static DEVINST alloc_devinst_for_device_id(const WCHAR *id) +{ + DEVINST ret; + + ret = get_devinst_for_device_id(id); + if (ret == devinst_table_size) { - if (devnode_table) + if (devinst_table) { - devnode_table = realloc(devnode_table, devnode_table_size * 2 * sizeof(*devnode_table)); - memset(devnode_table + devnode_table_size, 0, devnode_table_size * sizeof(*devnode_table)); - devnode_table_size *= 2; + devinst_table = realloc(devinst_table, devinst_table_size * 2 * sizeof(*devinst_table)); + memset(devinst_table + devinst_table_size, 0, devinst_table_size * sizeof(*devinst_table)); + devinst_table_size *= 2; } else { - devnode_table_size = 256; - devnode_table = calloc(devnode_table_size, sizeof(*devnode_table)); + devinst_table_size = 256; + devinst_table = calloc(devinst_table_size, sizeof(*devinst_table)); } } - - devnode_table[i] = device; - return i; -} - -static void free_devnode(DEVINST devnode) -{ - devnode_table[devnode] = NULL; -} - -static struct device *get_devnode_device(DEVINST devnode) -{ - if (devnode < devnode_table_size) - return devnode_table[devnode]; - - WARN("device node %lu not found\n", devnode); - return NULL; + if (!devinst_table[ret]) + devinst_table[ret] = wcsdup(id); + return ret; } static void SETUPDI_GuidToString(const GUID *guid, LPWSTR guidStr) @@ -885,7 +880,6 @@ static void delete_device(struct device *device) { delete_device_iface(iface); } - free_devnode(device->devnode); list_remove(&device->entry); free(device); } @@ -931,7 +925,7 @@ static struct device *create_device(struct DeviceInfoSet *set, device->phantom = phantom; list_init(&device->interfaces); device->class = *class; - device->devnode = alloc_devnode(device); + device->devnode = alloc_devinst_for_device_id(device->instanceId); device->removed = FALSE; list_add_tail(&set->devices, &device->entry); device->params.cbSize = sizeof(SP_DEVINSTALL_PARAMS_W); @@ -953,6 +947,28 @@ static struct device *create_device(struct DeviceInfoSet *set, return device; } +static struct device *get_devnode_device(DEVINST devnode, HDEVINFO *set) +{ + SP_DEVINFO_DATA data = { sizeof(data) }; + + *set = NULL; + if (devnode >= devinst_table_size || !devinst_table[devnode]) + { + WARN("device node %lu not found\n", devnode); + return NULL; + } + + *set = SetupDiCreateDeviceInfoListExW(NULL, NULL, NULL, NULL); + if (*set == INVALID_HANDLE_VALUE) return NULL; + if (!SetupDiOpenDeviceInfoW(*set, devinst_table[devnode], NULL, 0, &data)) + { + SetupDiDestroyDeviceInfoList(*set); + *set = NULL; + return NULL; + } + return get_device(*set, &data); +} + /*********************************************************************** * SetupDiBuildClassInfoList (SETUPAPI.@) * @@ -4346,14 +4362,12 @@ BOOL WINAPI SetupDiDeleteDevRegKey(HDEVINFO devinfo, SP_DEVINFO_DATA *device_dat */ CONFIGRET WINAPI CM_Get_Device_IDA(DEVINST devnode, char *buffer, ULONG len, ULONG flags) { - struct device *device = get_devnode_device(devnode); - TRACE("%lu, %p, %lu, %#lx\n", devnode, buffer, len, flags); - if (!device) + if (devnode >= devinst_table_size || !devinst_table[devnode]) return CR_NO_SUCH_DEVINST; - WideCharToMultiByte(CP_ACP, 0, device->instanceId, -1, buffer, len, 0, 0); + WideCharToMultiByte(CP_ACP, 0, devinst_table[devnode], -1, buffer, len, 0, 0); TRACE("Returning %s\n", debugstr_a(buffer)); return CR_SUCCESS; } @@ -4363,14 +4377,12 @@ CONFIGRET WINAPI CM_Get_Device_IDA(DEVINST devnode, char *buffer, ULONG len, ULO */ CONFIGRET WINAPI CM_Get_Device_IDW(DEVINST devnode, WCHAR *buffer, ULONG len, ULONG flags) { - struct device *device = get_devnode_device(devnode); - TRACE("%lu, %p, %lu, %#lx\n", devnode, buffer, len, flags); - if (!device) + if (devnode >= devinst_table_size || !devinst_table[devnode]) return CR_NO_SUCH_DEVINST; - lstrcpynW(buffer, device->instanceId, len); + lstrcpynW(buffer, devinst_table[devnode], len); TRACE("Returning %s\n", debugstr_w(buffer)); return CR_SUCCESS; } @@ -4380,14 +4392,12 @@ CONFIGRET WINAPI CM_Get_Device_IDW(DEVINST devnode, WCHAR *buffer, ULONG len, UL */ CONFIGRET WINAPI CM_Get_Device_ID_Size(ULONG *len, DEVINST devnode, ULONG flags) { - struct device *device = get_devnode_device(devnode); - TRACE("%p, %lu, %#lx\n", len, devnode, flags); - if (!device) + if (devnode >= devinst_table_size || !devinst_table[devnode]) return CR_NO_SUCH_DEVINST; - *len = lstrlenW(device->instanceId); + *len = lstrlenW(devinst_table[devnode]); return CR_SUCCESS; } @@ -4917,7 +4927,8 @@ BOOL WINAPI SetupDiGetDevicePropertyW(HDEVINFO devinfo, PSP_DEVINFO_DATA device_ CONFIGRET WINAPI CM_Get_DevNode_Property_ExW(DEVINST devnode, const DEVPROPKEY *prop_key, DEVPROPTYPE *prop_type, BYTE *prop_buff, ULONG *prop_buff_size, ULONG flags, HMACHINE machine) { - struct device *device = get_devnode_device(devnode); + HDEVINFO set; + struct device *device; LSTATUS ls; TRACE("%lu, %p, %p, %p, %p, %#lx, %p\n", devnode, prop_key, prop_type, prop_buff, prop_buff_size, @@ -4926,13 +4937,14 @@ CONFIGRET WINAPI CM_Get_DevNode_Property_ExW(DEVINST devnode, const DEVPROPKEY * if (machine) return CR_MACHINE_UNAVAILABLE; - if (!device) - return CR_NO_SUCH_DEVINST; - if (!prop_buff_size) return CR_INVALID_POINTER; + if (!(device = get_devnode_device(devnode, &set))) + return CR_NO_SUCH_DEVINST; + ls = get_device_property(device, prop_key, prop_type, prop_buff, *prop_buff_size, prop_buff_size, flags); + SetupDiDestroyDeviceInfoList(set); switch (ls) { case NO_ERROR: diff --git a/include/cfgmgr32.h b/include/cfgmgr32.h index 1c09e7bf5951..7a9fb5e02bf8 100644 --- a/include/cfgmgr32.h +++ b/include/cfgmgr32.h @@ -311,6 +311,8 @@ CMAPI CONFIGRET WINAPI CM_Get_Device_ID_List_ExW(PCWSTR,PWCHAR,ULONG,ULONG,HMACH CMAPI CONFIGRET WINAPI CM_Get_Device_ID_Size(PULONG,DEVINST,ULONG); CMAPI CONFIGRET WINAPI CM_Get_Device_ID_Size_Ex(PULONG,DEVINST,ULONG,HMACHINE); CMAPI CONFIGRET WINAPI CM_Get_Device_Interface_PropertyW(LPCWSTR,const DEVPROPKEY*,DEVPROPTYPE*,PBYTE,PULONG,ULONG); +CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST,const DEVPROPKEY *,DEVPROPTYPE *type,PVOID,PULONG,ULONG); +CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyExW(DEVINST,const DEVPROPKEY *,DEVPROPTYPE *type,PVOID,PULONG,ULONG,HMACHINE); CMAPI CONFIGRET WINAPI CM_Get_DevNode_Status(PULONG,PULONG,DEVINST,ULONG); CMAPI CONFIGRET WINAPI CM_Get_DevNode_Status_Ex(PULONG,PULONG,DEVINST,ULONG,HMACHINE); CMAPI CONFIGRET WINAPI CM_Get_Sibling(PDEVINST,DEVINST,ULONG); From affb5aff9a41c013502eecc2cb7d7d85842aa739 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 10 Jan 2025 16:30:20 -0600 Subject: [PATCH 1056/2542] setupapi: Implement CM_Locate_DevNode[_Ex]{A|W}(). CW-Bug-Id: #24649 --- dlls/cfgmgr32/tests/cfgmgr32.c | 29 +++++++++++- dlls/setupapi/devinst.c | 83 ++++++++++++++++++++++++++++++++++ dlls/setupapi/stubs.c | 40 ---------------- include/cfgmgr32.h | 2 + 4 files changed, 113 insertions(+), 41 deletions(-) diff --git a/dlls/cfgmgr32/tests/cfgmgr32.c b/dlls/cfgmgr32/tests/cfgmgr32.c index ac84f1eadb2c..2ec8cd4808d4 100644 --- a/dlls/cfgmgr32/tests/cfgmgr32.c +++ b/dlls/cfgmgr32/tests/cfgmgr32.c @@ -127,7 +127,8 @@ static void test_CM_Get_Device_ID_List(void) SP_DEVINFO_DATA device = { sizeof(device) }; unsigned int i, count, expected_count; WCHAR wguid_str[64], id[128], *wbuf, *wp; - char guid_str[64], *buf, *p; + char guid_str[64], id_a[128], *buf, *p; + DEVINST devinst; CONFIGRET ret; HDEVINFO set; ULONG len; @@ -208,6 +209,19 @@ static void test_CM_Get_Device_ID_List(void) } SetupDiDestroyDeviceInfoList(set); expected_count = i; + ok(expected_count, "got 0.\n"); + + wcscpy(id, L"q"); + devinst = 0xdeadbeef; + ret = CM_Locate_DevNodeW(&devinst, id, 0); + todo_wine_if(ret == CR_NO_SUCH_DEVNODE) ok(ret == CR_INVALID_DEVICE_ID, "got %#lx.\n", ret); + ok(!devinst, "got %#lx.\n", devinst); + + wcscpy(id, instances[0].id); + id[0] = 'Q'; + ret = CM_Locate_DevNodeW(&devinst, id, 0); + ok(ret == CR_NO_SUCH_DEVNODE, "got %#lx.\n", ret); + for (i = 0; i < expected_count; ++i) { DEVPROPTYPE type; @@ -221,6 +235,19 @@ static void test_CM_Get_Device_ID_List(void) ret = CM_Get_DevNode_PropertyW(instances[i].inst, &DEVPROPKEY_GPU_LUID, &type, wbuf, &size, 0); ok(!ret, "got %#lx.\n", ret); ok(type == DEVPROP_TYPE_UINT64, "got %#lx.\n", type); + + devinst = 0xdeadbeef; + ret = CM_Locate_DevNodeW(&devinst, instances[i].id, 0); + ok(!ret, "got %#lx.\n", ret); + ok(devinst == instances[i].inst, "got %#lx, expected %#lx.\n", devinst, instances[i].inst); + p = id_a; + wp = instances[i].id; + while((*p++ = *wp++)) + ; + devinst = 0xdeadbeef; + ret = CM_Locate_DevNodeA(&devinst, id_a, 0); + ok(!ret, "got %#lx.\n", ret); + ok(devinst == instances[i].inst, "got %#lx, expected %#lx.\n", devinst, instances[i].inst); } memset(wbuf, 0xcc, len * sizeof(*wbuf)); diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index a66020c83797..a457dd40541c 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -4401,6 +4401,89 @@ CONFIGRET WINAPI CM_Get_Device_ID_Size(ULONG *len, DEVINST devnode, ULONG flags) return CR_SUCCESS; } +/*********************************************************************** + * CM_Locate_DevNodeA (SETUPAPI.@) + */ +CONFIGRET WINAPI CM_Locate_DevNodeA(DEVINST *devinst, DEVINSTID_A device_id, ULONG flags) +{ + TRACE("%p %s %#lx.\n", devinst, debugstr_a(device_id), flags); + + return CM_Locate_DevNode_ExA(devinst, device_id, flags, NULL); +} + +/*********************************************************************** + * CM_Locate_DevNodeW (SETUPAPI.@) + */ +CONFIGRET WINAPI CM_Locate_DevNodeW(DEVINST *devinst, DEVINSTID_W device_id, ULONG flags) +{ + TRACE("%p %s %#lx.\n", devinst, debugstr_w(device_id), flags); + + return CM_Locate_DevNode_ExW(devinst, device_id, flags, NULL); +} + +/*********************************************************************** + * CM_Locate_DevNode_ExA (SETUPAPI.@) + */ +CONFIGRET WINAPI CM_Locate_DevNode_ExA(DEVINST *devinst, DEVINSTID_A device_id, ULONG flags, HMACHINE machine) +{ + CONFIGRET ret; + DEVINSTID_W device_idw; + WCHAR *p; + + TRACE("%p %s %#lx %p.\n", devinst, debugstr_a(device_id), flags, machine); + + if (!device_id) + { + FIXME("NULL device_id unsupported.\n"); + return CR_CALL_NOT_IMPLEMENTED; + } + + if (!(device_idw = malloc((strlen(device_id) + 1) * sizeof(*device_idw)))) + return CR_OUT_OF_MEMORY; + + p = device_idw; + while ((*p++ = *device_id++)) + ; + + ret = CM_Locate_DevNode_ExW(devinst, device_idw, flags, NULL); + free(device_idw); + return ret; +} + +/*********************************************************************** + * CM_Locate_DevNode_ExW (SETUPAPI.@) + */ +CONFIGRET WINAPI CM_Locate_DevNode_ExW(DEVINST *devinst, DEVINSTID_W device_id, ULONG flags, HMACHINE machine) +{ + DEVINST ret; + + TRACE("%p %s %#lx %p.\n", devinst, debugstr_w(device_id), flags, machine); + + if (!devinst) + return CR_INVALID_POINTER; + + *devinst = 0; + + if (machine) + FIXME("machine %p not supported.\n", machine); + if (flags) + FIXME("flags %#lx are not supported.\n", flags); + + if (!device_id) + { + FIXME("NULL device_id unsupported.\n"); + return CR_CALL_NOT_IMPLEMENTED; + } + + if ((ret = get_devinst_for_device_id(device_id)) < devinst_table_size && devinst_table[ret]) + { + *devinst = ret; + return CR_SUCCESS; + } + + return CR_NO_SUCH_DEVNODE; +} + static CONFIGRET get_device_id_list(const WCHAR *filter, WCHAR *buffer, ULONG *len, ULONG flags) { const ULONG supported_flags = CM_GETIDLIST_FILTER_NONE | CM_GETIDLIST_FILTER_CLASS | CM_GETIDLIST_FILTER_PRESENT; diff --git a/dlls/setupapi/stubs.c b/dlls/setupapi/stubs.c index 419168d0f1e2..0766b1364bf4 100644 --- a/dlls/setupapi/stubs.c +++ b/dlls/setupapi/stubs.c @@ -267,46 +267,6 @@ BOOL WINAPI SetupDiGetClassImageIndex(PSP_CLASSIMAGELIST_DATA ClassImageListData return FALSE; } -/*********************************************************************** - * CM_Locate_DevNodeA (SETUPAPI.@) - */ -CONFIGRET WINAPI CM_Locate_DevNodeA(PDEVINST pdnDevInst, DEVINSTID_A pDeviceID, ULONG ulFlags) -{ - FIXME("%p %s 0x%08lx: stub\n", pdnDevInst, debugstr_a(pDeviceID), ulFlags); - - return CR_FAILURE; -} - -/*********************************************************************** - * CM_Locate_DevNodeW (SETUPAPI.@) - */ -CONFIGRET WINAPI CM_Locate_DevNodeW(PDEVINST pdnDevInst, DEVINSTID_W pDeviceID, ULONG ulFlags) -{ - FIXME("%p %s 0x%08lx: stub\n", pdnDevInst, debugstr_w(pDeviceID), ulFlags); - - return CR_FAILURE; -} - -/*********************************************************************** - * CM_Locate_DevNode_ExA (SETUPAPI.@) - */ -CONFIGRET WINAPI CM_Locate_DevNode_ExA(PDEVINST pdnDevInst, DEVINSTID_A pDeviceID, ULONG ulFlags, HMACHINE hMachine) -{ - FIXME("%p %s 0x%08lx %p: stub\n", pdnDevInst, debugstr_a(pDeviceID), ulFlags, hMachine); - - return CR_FAILURE; -} - -/*********************************************************************** - * CM_Locate_DevNode_ExW (SETUPAPI.@) - */ -CONFIGRET WINAPI CM_Locate_DevNode_ExW(PDEVINST pdnDevInst, DEVINSTID_W pDeviceID, ULONG ulFlags, HMACHINE hMachine) -{ - FIXME("%p %s 0x%08lx %p: stub\n", pdnDevInst, debugstr_w(pDeviceID), ulFlags, hMachine); - - return CR_FAILURE; -} - /*********************************************************************** * CM_Get_Device_Interface_List_SizeA (SETUPAPI.@) */ diff --git a/include/cfgmgr32.h b/include/cfgmgr32.h index 7a9fb5e02bf8..6bb01ec67fc3 100644 --- a/include/cfgmgr32.h +++ b/include/cfgmgr32.h @@ -319,7 +319,9 @@ CMAPI CONFIGRET WINAPI CM_Get_Sibling(PDEVINST,DEVINST,ULONG); CMAPI CONFIGRET WINAPI CM_Get_Sibling_Ex(PDEVINST pdnDevInst, DEVINST DevInst, ULONG ulFlags, HMACHINE hMachine); CMAPI WORD WINAPI CM_Get_Version(void); CMAPI CONFIGRET WINAPI CM_Locate_DevNodeA(PDEVINST,DEVINSTID_A,ULONG); +CMAPI CONFIGRET WINAPI CM_Locate_DevNode_ExA(PDEVINST,DEVINSTID_A,ULONG,HMACHINE); CMAPI CONFIGRET WINAPI CM_Locate_DevNodeW(PDEVINST,DEVINSTID_W,ULONG); +CMAPI CONFIGRET WINAPI CM_Locate_DevNode_ExW(PDEVINST,DEVINSTID_W,ULONG,HMACHINE); #define CM_Locate_DevNode WINELIB_NAME_AW(CM_Locate_DevNode) CMAPI DWORD WINAPI CM_MapCrToWin32Err(CONFIGRET,DWORD); CMAPI CONFIGRET WINAPI CM_Open_DevNode_Key(DEVINST dnDevInst, REGSAM access, ULONG ulHardwareProfile, From 329a6ab8c6fa59b4f2942f06f5a8e121656d4856 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Thu, 16 Jan 2025 12:29:24 +1000 Subject: [PATCH 1057/2542] mfsrcsnk: Release object queue objects on destruction. --- dlls/mfsrcsnk/media_source.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/mfsrcsnk/media_source.c b/dlls/mfsrcsnk/media_source.c index 4187d64b69bc..287850313aa7 100644 --- a/dlls/mfsrcsnk/media_source.c +++ b/dlls/mfsrcsnk/media_source.c @@ -80,7 +80,7 @@ struct object_entry static void object_entry_destroy(struct object_entry *entry) { - if (entry->object) IUnknown_AddRef( entry->object ); + if (entry->object) IUnknown_Release( entry->object ); free(entry); } From 05cc8e2cd5c4cc6becd11baf979530cfbdf5650d Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Thu, 16 Jan 2025 12:31:16 +1000 Subject: [PATCH 1058/2542] mfsrcsnk: Release the async request popped sample after sending it. --- dlls/mfsrcsnk/media_source.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/mfsrcsnk/media_source.c b/dlls/mfsrcsnk/media_source.c index 287850313aa7..138cb29b7052 100644 --- a/dlls/mfsrcsnk/media_source.c +++ b/dlls/mfsrcsnk/media_source.c @@ -814,7 +814,10 @@ static HRESULT media_stream_async_request(struct media_stream *stream, IMFAsyncR if (source->state == SOURCE_SHUTDOWN) hr = MF_E_SHUTDOWN; else if (source->state == SOURCE_RUNNING && SUCCEEDED(hr = object_queue_pop(&stream->samples, (IUnknown **)&sample))) + { media_stream_send_sample(stream, sample, token); + IMFSample_Release(sample); + } else if (SUCCEEDED(hr = object_queue_push(&stream->tokens, token)) && source->state == SOURCE_RUNNING) queue_media_source_read(source); From af528051ee3a6066f3e19637cdb7c0037a1be74e Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Thu, 16 Jan 2025 20:13:21 +0000 Subject: [PATCH 1059/2542] include: Use inline assembly for TEB access with clang. Avoids typ conflicts when WINE_NO_LONG_TYPES is defined. --- include/winnt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/winnt.h b/include/winnt.h index 52a48e4249b2..6c0afa341afb 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -2452,7 +2452,7 @@ NTSYSAPI struct _TEB * WINAPI NtCurrentTeb(void) __attribute__((pure)); # else NTSYSAPI struct _TEB * WINAPI NtCurrentTeb(void); # endif -#elif defined(__i386__) && defined(__GNUC__) +#elif defined(__i386__) && (defined(__GNUC__) || defined(__clang__)) static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void) { struct _TEB *teb; From 92f3a1071bf467c6a282cf09d314dbb86d6de342 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Tue, 23 Jul 2024 17:54:39 +1000 Subject: [PATCH 1060/2542] winegstreamer: Fallback to provided sample duration and time. If a frame rate has not been provided, use the sample duration and time provided by wg_transform. This can fix framerate issues when MF_MT_FRAME_RATE is not available. CW-Bug-Id: #23810 CW-Bug-Id: #24708 --- dlls/winegstreamer/video_decoder.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/dlls/winegstreamer/video_decoder.c b/dlls/winegstreamer/video_decoder.c index a6d5d7d8c620..3a2deafe6853 100644 --- a/dlls/winegstreamer/video_decoder.c +++ b/dlls/winegstreamer/video_decoder.c @@ -938,17 +938,35 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, if (SUCCEEDED(hr = wg_transform_read_mf(decoder->wg_transform, sample, sample_size, &samples->dwStatus))) { + BOOL frame_rate_given = FALSE; + LONGLONG time; wg_sample_queue_flush(decoder->wg_sample_queue, false); if (FAILED(IMFMediaType_GetUINT64(decoder->input_type, &MF_MT_FRAME_RATE, &frame_rate))) frame_rate = (UINT64)30000 << 32 | 1001; + else + frame_rate_given = TRUE; - duration = (UINT64)10000000 * (UINT32)frame_rate / (frame_rate >> 32); - if (FAILED(IMFSample_SetSampleTime(sample, decoder->sample_time))) - WARN("Failed to set sample time\n"); - if (FAILED(IMFSample_SetSampleDuration(sample, duration))) - WARN("Failed to set sample duration\n"); - decoder->sample_time += duration; + if (frame_rate_given || FAILED(IMFSample_GetSampleDuration(sample, &duration))) + { + if (!frame_rate_given) + WARN("Failed to get sample duration\n"); + duration = (UINT64)10000000 * (UINT32)frame_rate / (frame_rate >> 32); + if (FAILED(IMFSample_SetSampleDuration(sample, duration))) + WARN("Failed to set sample duration\n"); + } + if (frame_rate_given || FAILED(IMFSample_GetSampleTime(sample, &time))) + { + if (!frame_rate_given) + WARN("Failed to get sample time\n"); + if(FAILED(IMFSample_SetSampleTime(sample, decoder->sample_time))) + WARN("Failed to set sample time\n"); + decoder->sample_time += duration; + } + else + { + decoder->sample_time = time + duration; + } } if (hr == MF_E_TRANSFORM_STREAM_CHANGE) From e1a3a0604bbfeacd8936b0d0b4ab74f1aff5371c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 20 Jan 2025 15:41:46 +0100 Subject: [PATCH 1061/2542] winex11: Only erase the desktop window pixels on expose events. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57665 --- dlls/winex11.drv/event.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 1a0621016bc1..c84c23b60486 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1028,7 +1028,7 @@ static BOOL X11DRV_Expose( HWND hwnd, XEvent *xev ) RECT rect, abs_rect; POINT pos; struct x11drv_win_data *data; - UINT flags = RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_ALLCHILDREN; + UINT flags = RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN; TRACE( "win %p (%lx) %d,%d %dx%d\n", hwnd, event->window, event->x, event->y, event->width, event->height ); @@ -1068,6 +1068,7 @@ static BOOL X11DRV_Expose( HWND hwnd, XEvent *xev ) release_win_data( data ); + if (hwnd == NtUserGetDesktopWindow()) flags |= RDW_ERASE; NtUserExposeWindowSurface( hwnd, flags, &rect, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); return TRUE; } From e71f0b3bf5d76e88d599947400156dd08b08facf Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 17 Jan 2025 14:43:39 -0600 Subject: [PATCH 1062/2542] win32u: Generate mouse events in the server when releasing capture. --- dlls/user32/tests/win.c | 4 ++++ dlls/win32u/input.c | 9 --------- server/queue.c | 2 ++ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 160d85f2190a..8da4e11b6359 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -13331,7 +13331,11 @@ static void test_ReleaseCapture(void) ok(wm_mousemove_count < 10, "Got too many WM_MOUSEMOVE.\n"); /* Test that ReleaseCapture() should send a WM_MOUSEMOVE if a window is captured */ + wm_mousemove_count = 0; SetCapture(hwnd); + flush_events(TRUE); + ok(!wm_mousemove_count, "Got no WM_MOUSEMOVE.\n"); + wm_mousemove_count = 0; ret = ReleaseCapture(); ok(ret, "ReleaseCapture failed, error %#lx.\n", GetLastError()); diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 680d40c74316..c679aa5de577 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -1836,15 +1836,6 @@ BOOL release_capture(void) BOOL ret; ret = set_capture_window( 0, 0, &previous ); - - /* Somebody may have missed some mouse movements */ - if (ret && previous) - { - INPUT input = { .type = INPUT_MOUSE }; - input.mi.dwFlags = MOUSEEVENTF_MOVE; - NtUserSendInput( 1, &input, sizeof(input) ); - } - return ret; } diff --git a/server/queue.c b/server/queue.c index 4689a0ba4c9b..4972535d7b0e 100644 --- a/server/queue.c +++ b/server/queue.c @@ -3981,6 +3981,8 @@ DECL_HANDLER(set_capture_window) reply->full_handle = shared->capture; } SHARED_WRITE_END; + if (reply->previous && !req->handle && !req->flags) + update_cursor_pos(input->desktop); } } From 5805ad0e8902d3fa119dda42982204816675c504 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 16 Jan 2025 20:07:36 -0600 Subject: [PATCH 1063/2542] server: Don't send WM_MOUSEMOVE for zero movement in queue_mouse_message(). --- dlls/user32/tests/input.c | 1 + server/queue.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 9196e67c15b0..eb548ea0924c 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -4131,6 +4131,7 @@ static void test_SendInput_mouse_messages(void) mouse_event( MOUSEEVENTF_MOVE, 0, 0, 0, 0 ); /* recent Windows versions don't call the hooks with no movement */ + ok(!current_sequence_len || broken(current_sequence_len) /* before Win10 1709 */, "got %ld.\n", current_sequence_len); if (current_sequence_len) { ok_seq( mouse_move ); diff --git a/server/queue.c b/server/queue.c index 4972535d7b0e..a90e9ce22f06 100644 --- a/server/queue.c +++ b/server/queue.c @@ -2303,15 +2303,14 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons { x = input->mouse.x; y = input->mouse.y; - if (flags & ~(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE) && - x == desktop_shm->cursor.x && y == desktop_shm->cursor.y) - flags &= ~MOUSEEVENTF_MOVE; } else { x = desktop_shm->cursor.x + input->mouse.x; y = desktop_shm->cursor.y + input->mouse.y; } + if (x == desktop_shm->cursor.x && y == desktop_shm->cursor.y) + flags &= ~MOUSEEVENTF_MOVE; } else { From 5ff0d9c8bd93c1f5dbd80b994b52e6912d215fc3 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Fri, 17 Jan 2025 14:29:47 +1000 Subject: [PATCH 1064/2542] HACK: mfreadwrite: Flag ENDOFSTREAM for all source streams for Darksiders Warmastered Edition. CW-Bug-Id: #24656 --- dlls/mfreadwrite/reader.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c index 79425be0bbbe..f98c98b91d81 100644 --- a/dlls/mfreadwrite/reader.c +++ b/dlls/mfreadwrite/reader.c @@ -175,6 +175,9 @@ struct source_reader CONDITION_VARIABLE sample_event; CONDITION_VARIABLE state_event; CONDITION_VARIABLE stop_event; + + BOOL flag_eos_for_all_streams; + DWORD next_stream_eos_index; }; static inline struct source_reader *impl_from_IMFSourceReaderEx(IMFSourceReaderEx *iface) @@ -1344,9 +1347,11 @@ static HRESULT source_reader_get_next_selected_stream(struct source_reader *read } /* If all selected streams reached EOS, use first selected. */ - if (first_selected != ~0u) + if (first_selected != ~0u && min_ts == MAXLONGLONG) { - if (min_ts == MAXLONGLONG) + if (reader->flag_eos_for_all_streams) + *stream_index = reader->next_stream_eos_index++ % reader->stream_count; + else *stream_index = first_selected; } @@ -2644,6 +2649,8 @@ static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttri unsigned int i; HRESULT hr; + const char *sgi; + object = calloc(1, sizeof(*object)); if (!object) return E_OUTOFMEMORY; @@ -2765,6 +2772,16 @@ static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttri } } + if (object->stream_count > 1 && (sgi = getenv("SteamGameId")) && strcmp(sgi, "462780") == 0) + { + /* Darksiders Warmastered Edition ends media sampling only when MF_SOURCE_READERF_ENDOFSTREAM + * is returned for all streams. If audio and video end simultaneously then ENDOFSTREAM is + * flagged only for stream 0, therefore the game depends on a slight time difference which + * usually does not occur for the fourth splash video. */ + WARN("HACK: enabled flagging ENDOFSTREAM for all streams.\n"); + object->flag_eos_for_all_streams = TRUE; + } + if (FAILED(hr = MFLockSharedWorkQueue(L"", 0, NULL, &object->queue))) WARN("Failed to acquired shared queue, hr %#lx.\n", hr); From 835c1236a4c8d49d4235085e3f25a1019f05df89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sat, 11 Jan 2025 10:43:59 +0100 Subject: [PATCH 1065/2542] include: Fix __readfsdword declaration for clang. --- include/winnt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/winnt.h b/include/winnt.h index 6c0afa341afb..a361582045a3 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -2460,7 +2460,7 @@ static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void) return teb; } #elif defined(__i386__) && defined(_MSC_VER) -DWORD __readfsdword(DWORD); +unsigned long __readfsdword(unsigned long); #pragma intrinsic(__readfsdword) static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void) { From ad74d21f587a52c8eb20235900d3f3bd93a04263 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 21 Jan 2025 19:02:42 -0600 Subject: [PATCH 1066/2542] winex11.drv: HACK: Don't call XIconifyWindow() on Gamescope for Idle Spiral. CW-Bug-Id: #22953 CW-Bug-Id: #24712 Link: https://github.com/ValveSoftware/gamescope/pull/1730 Link: https://github.com/ValveSoftware/gamescope/pull/1731 --- dlls/winex11.drv/window.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 5ee4c4763e0d..eaedd2d8e03a 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1485,6 +1485,22 @@ static void set_xembed_flags( struct x11drv_win_data *data, unsigned long flags x11drv_atom(_XEMBED_INFO), 32, PropModeReplace, (unsigned char*)info, 2 ); } +static int skip_iconify(void) +{ + static int cached = -1; + const char *env; + + if (cached == -1) + { + cached = (env = getenv( "SteamGameId" )) && (0 + || !strcmp( env, "1827980" ) + ); + if (cached) FIXME( "HACK: skip_iconify.\n" ); + } + + return cached; +} + static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state, UINT swp_flags ) { UINT old_state = data->pending_state.wm_state; @@ -1532,6 +1548,16 @@ static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state, U TRACE( "window %p/%lx, requesting WM_STATE %#x -> %#x serial %lu, foreground %p\n", data->hwnd, data->whole_window, old_state, new_state, data->wm_state_serial, NtUserGetForegroundWindow() ); + if (new_state == IconicState && X11DRV_HasWindowManager( "steamcompmgr" ) && skip_iconify()) + { + /* Gamescope will restore window when attempting to iconify it. Do not call XIconifyWindow() and + * pretend that window is already minimized for the games which depend on some windows to be minimized. */ + WARN( "hwnd %p, skipping iconify.\n", data->hwnd ); + data->current_state.wm_state = data->pending_state.wm_state; + data->wm_state_serial = 0; + return; + } + switch (MAKELONG(old_state, new_state)) { case MAKELONG(WithdrawnState, IconicState): From 201b3e063ab29feb5236ae559ff4722a484a8bbf Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 21 Jan 2025 19:06:06 -0600 Subject: [PATCH 1067/2542] winex11.drv: HACK: Enable skip_iconify for Imperiums: Greek Wars. CW-Bug-Id: #24712 --- dlls/winex11.drv/window.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index eaedd2d8e03a..d8dbd1bd02d7 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1494,6 +1494,7 @@ static int skip_iconify(void) { cached = (env = getenv( "SteamGameId" )) && (0 || !strcmp( env, "1827980" ) + || !strcmp( env, "1183470" ) ); if (cached) FIXME( "HACK: skip_iconify.\n" ); } From 536b96d2e36e15e17c0f4ec29cbddf7fc9e13e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sat, 11 Jan 2025 10:43:59 +0100 Subject: [PATCH 1068/2542] winevulkan: Use aligned types for 64bit atomics. --- dlls/winevulkan/vulkan.c | 4 ++-- dlls/winevulkan/vulkan_private.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 5ada61c09bb6..47f598d51772 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -201,7 +201,7 @@ static void append_debug_utils_object(const VkDebugUtilsObjectNameInfoEXT *objec dst->object_name_len = append_string(object->pObjectName, strings, strings_len); } -static void signal_timeline_sem(struct vulkan_device *device, VkSemaphore sem, uint64_t *value) +static void signal_timeline_sem(struct vulkan_device *device, VkSemaphore sem, UINT64 *value) { /* May be called from native thread. */ struct VkSemaphoreSignalInfo info = { 0 }; @@ -3739,7 +3739,7 @@ static void add_sem_signal_op(struct vulkan_device *device, struct wine_semaphor VkSemaphore *phys_semaphore, uint64_t *phys_signal_value, BOOL signal_immediate) { struct pending_d3d12_fence_op *op; - uint64_t value; + UINT64 value; pthread_mutex_lock(&device->signaller_mutex); if ((op = get_free_fence_op(device))) diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index 9544a4785e22..9a6a4680af54 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -123,7 +123,7 @@ struct keyed_mutex_shm uint64_t instance_id_counter; uint64_t acquired_to_instance; uint64_t key; - uint64_t timeline_value; + UINT64 timeline_value; uint64_t timeline_queued_release; }; @@ -217,7 +217,7 @@ struct wine_semaphore { /* Shared mem access mutex. The non-shared parts access is guarded with device global signaller_mutex. */ pthread_mutex_t mutex; - uint64_t virtual_value, physical_value; + UINT64 virtual_value, physical_value; uint64_t last_reset_physical; uint64_t last_dropped_reset_physical; struct From 3337c5ecd87ee3a17434c4951d0306eb0d3b2ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sat, 11 Jan 2025 10:43:59 +0100 Subject: [PATCH 1069/2542] ntdll: Use aligned 64bit types for fsync atomics. --- dlls/ntdll/unix/fsync.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c index c3da44e4f268..ebd71ea3b7c4 100644 --- a/dlls/ntdll/unix/fsync.c +++ b/dlls/ntdll/unix/fsync.c @@ -299,7 +299,7 @@ static void add_to_list( HANDLE handle, enum fsync_type type, unsigned int shm_i cache.type = type; cache.shm_idx = shm_idx; - __atomic_store_n( (uint64_t *)&fsync_list[entry][idx], *(uint64_t *)&cache, __ATOMIC_SEQ_CST ); + __atomic_store_n( (UINT64 *)&fsync_list[entry][idx], *(UINT64 *)&cache, __ATOMIC_SEQ_CST ); } static void grab_object( struct fsync *obj ) @@ -362,7 +362,7 @@ static BOOL get_cached_object( HANDLE handle, struct fsync *obj ) if (entry >= FSYNC_LIST_ENTRIES || !fsync_list[entry]) return FALSE; again: - *(uint64_t *)&cache = __atomic_load_n( (uint64_t *)&fsync_list[entry][idx], __ATOMIC_SEQ_CST ); + *(UINT64 *)&cache = __atomic_load_n( (UINT64 *)&fsync_list[entry][idx], __ATOMIC_SEQ_CST ); if (!cache.type || !cache.shm_idx) return FALSE; @@ -370,7 +370,7 @@ static BOOL get_cached_object( HANDLE handle, struct fsync *obj ) obj->shm = get_shm( cache.shm_idx ); grab_object( obj ); if (((int *)obj->shm)[2] < 2 || - *(uint64_t *)&cache != __atomic_load_n( (uint64_t *)&fsync_list[entry][idx], __ATOMIC_SEQ_CST )) + *(UINT64 *)&cache != __atomic_load_n( (UINT64 *)&fsync_list[entry][idx], __ATOMIC_SEQ_CST )) { /* This check does not strictly guarantee that we avoid the potential race but is supposed to greatly * reduce the probability of that. */ @@ -469,8 +469,8 @@ NTSTATUS fsync_close( HANDLE handle ) cache.type = 0; cache.shm_idx = 0; - *(uint64_t *)&cache = __atomic_exchange_n( (uint64_t *)&fsync_list[entry][idx], - *(uint64_t *)&cache, __ATOMIC_SEQ_CST ); + *(UINT64 *)&cache = __atomic_exchange_n( (UINT64 *)&fsync_list[entry][idx], + *(UINT64 *)&cache, __ATOMIC_SEQ_CST ); if (cache.type) return STATUS_SUCCESS; } From 8ad85737935176374fb66719afb262a222077be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 20 Jan 2025 22:27:19 +0100 Subject: [PATCH 1070/2542] HACK: winebus: Create dedicated threads to write evdev haptics output reports. Some controllers block on ioctl and write calls, and this may propagate up to the frontend through various blocking calls, including when the frontend API is using async I/O because of how Wine implements async I/O for device objects. This makes sure we fix it once and for all for the Steam Input virtual controller at least. CW-Bug-Id: #24594 --- dlls/winebus.sys/bus_udev.c | 114 ++++++++++++++++++++++-------------- 1 file changed, 70 insertions(+), 44 deletions(-) diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index 935a66b39fc8..332e79e3ae5d 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -189,7 +189,11 @@ struct lnxev_device BYTE hat_map[8]; BYTE button_map[KEY_MAX]; - int haptic_effect_id; + int haptics_state; + pthread_cond_t haptics_cond; + pthread_t haptics_thread; + struct ff_effect haptics; + int effect_ids[256]; LONG effect_flags; }; @@ -965,7 +969,7 @@ static NTSTATUS build_report_descriptor(struct unix_device *iface, struct udev_d if (!hid_device_end_input_report(iface)) return STATUS_NO_MEMORY; - impl->haptic_effect_id = -1; + impl->haptics.id = -1; for (i = 0; i < ARRAY_SIZE(impl->effect_ids); ++i) impl->effect_ids[i] = -1; if (test_bit(ffbits, FF_RUMBLE) && !hid_device_add_haptics(iface)) @@ -1064,11 +1068,54 @@ static void lnxev_device_destroy(struct unix_device *iface) udev_device_unref(impl->base.udev_device); } +static void *lnxev_device_haptics_thread(void *args) +{ + struct lnxev_device *impl = lnxev_impl_from_unix_device(args); + + pthread_mutex_lock(&udev_cs); + + for (;;) + { + struct ff_effect effect; + + while (impl->haptics_state == 1) pthread_cond_wait(&impl->haptics_cond, &udev_cs); + if (!impl->haptics_state) break; + + effect = impl->haptics; + impl->haptics_state = 1; + pthread_mutex_unlock(&udev_cs); + + if (effect.type && (effect.id == -1 || ioctl(impl->base.device_fd, EVIOCSFF, &effect) == -1)) + { + effect.id = -1; + ioctl(impl->base.device_fd, EVIOCSFF, &effect); + } + + if (effect.id != -1) + { + struct input_event event = {.type = EV_FF, .code = effect.id, .value = !!effect.type}; + write(impl->base.device_fd, &event, sizeof(event)); + } + + pthread_mutex_lock(&udev_cs); + impl->haptics.id = effect.id; + } + + pthread_mutex_unlock(&udev_cs); + return NULL; +} + static NTSTATUS lnxev_device_start(struct unix_device *iface) { + struct lnxev_device *impl = lnxev_impl_from_unix_device(iface); + pthread_mutex_lock(&udev_cs); start_polling_device(iface); + impl->haptics_state = 1; pthread_mutex_unlock(&udev_cs); + + pthread_cond_init(&impl->haptics_cond, NULL); + pthread_create(&impl->haptics_thread, NULL, lnxev_device_haptics_thread, iface); return STATUS_SUCCESS; } @@ -1079,7 +1126,12 @@ static void lnxev_device_stop(struct unix_device *iface) pthread_mutex_lock(&udev_cs); stop_polling_device(iface); list_remove(&impl->base.unix_device.entry); + impl->haptics_state = 0; pthread_mutex_unlock(&udev_cs); + pthread_cond_signal(&impl->haptics_cond); + + pthread_join(impl->haptics_thread, NULL); + pthread_cond_destroy(&impl->haptics_cond); } static void lnxev_device_read_report(struct unix_device *iface) @@ -1103,39 +1155,18 @@ static NTSTATUS lnxev_device_haptics_start(struct unix_device *iface, UINT durat USHORT left_intensity, USHORT right_intensity) { struct lnxev_device *impl = lnxev_impl_from_unix_device(iface); - struct ff_effect effect = - { - .id = impl->haptic_effect_id, - .type = FF_RUMBLE, - }; - struct input_event event; TRACE("iface %p, duration_ms %u, rumble_intensity %u, buzz_intensity %u, left_intensity %u, right_intensity %u.\n", iface, duration_ms, rumble_intensity, buzz_intensity, left_intensity, right_intensity); - effect.replay.length = duration_ms; - effect.u.rumble.strong_magnitude = rumble_intensity; - effect.u.rumble.weak_magnitude = buzz_intensity; - - if (effect.id == -1 || ioctl(impl->base.device_fd, EVIOCSFF, &effect) == -1) - { - effect.id = -1; - if (ioctl(impl->base.device_fd, EVIOCSFF, &effect) == 1) - { - WARN("couldn't re-allocate rumble effect for haptics: %d %s\n", errno, strerror(errno)); - return STATUS_UNSUCCESSFUL; - } - impl->haptic_effect_id = effect.id; - } - - event.type = EV_FF; - event.code = effect.id; - event.value = 1; - if (write(impl->base.device_fd, &event, sizeof(event)) == -1) - { - WARN("couldn't start haptics rumble effect: %d %s\n", errno, strerror(errno)); - return STATUS_UNSUCCESSFUL; - } + pthread_mutex_lock(&udev_cs); + impl->haptics.type = FF_RUMBLE; + impl->haptics.replay.length = duration_ms; + impl->haptics.u.rumble.strong_magnitude = rumble_intensity; + impl->haptics.u.rumble.weak_magnitude = buzz_intensity; + impl->haptics_state = 2; + pthread_mutex_unlock(&udev_cs); + pthread_cond_signal(&impl->haptics_cond); return STATUS_SUCCESS; } @@ -1143,22 +1174,17 @@ static NTSTATUS lnxev_device_haptics_start(struct unix_device *iface, UINT durat static NTSTATUS lnxev_device_haptics_stop(struct unix_device *iface) { struct lnxev_device *impl = lnxev_impl_from_unix_device(iface); - struct ff_effect effect = - { - .id = impl->haptic_effect_id, - .type = FF_RUMBLE, - }; - struct input_event event; TRACE("iface %p.\n", iface); - if (effect.id == -1) return STATUS_SUCCESS; - - event.type = EV_FF; - event.code = effect.id; - event.value = 0; - if (write(impl->base.device_fd, &event, sizeof(event)) == -1) - WARN("couldn't stop haptics rumble effect: %d %s\n", errno, strerror(errno)); + pthread_mutex_lock(&udev_cs); + impl->haptics.type = 0; + impl->haptics.replay.length = 0; + impl->haptics.u.rumble.strong_magnitude = 0; + impl->haptics.u.rumble.weak_magnitude = 0; + impl->haptics_state = 2; + pthread_mutex_unlock(&udev_cs); + pthread_cond_signal(&impl->haptics_cond); return STATUS_SUCCESS; } From 8458d2b5bc4aafa31db334ecdc8e87d2a72bca53 Mon Sep 17 00:00:00 2001 From: Santino Mazza Date: Thu, 23 Jan 2025 13:57:25 -0300 Subject: [PATCH 1071/2542] HACK: win32u: Expose the host lowres screen sizes as well. Cw-Bug-Id: #24756 --- dlls/win32u/sysparams.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 96919c17f9fc..5b7b916046cc 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1633,6 +1633,8 @@ static SIZE *get_screen_sizes( const DEVMODEW *maximum, const DEVMODEW *modes, U { static SIZE lowres_sizes[] = { + /* 4:3 */ + { 640, 480}, /* 16:9 */ { 960, 540}, }; @@ -1670,6 +1672,7 @@ static SIZE *get_screen_sizes( const DEVMODEW *maximum, const DEVMODEW *modes, U UINT max_width = devmode_get( maximum, DM_PELSWIDTH ), max_height = devmode_get( maximum, DM_PELSHEIGHT ); SIZE *sizes, max_size = {.cx = max( max_width, max_height ), .cy = min( max_width, max_height )}; const DEVMODEW *mode; + BOOL enable_lowres; UINT i, count; const char *env; @@ -1685,7 +1688,7 @@ static SIZE *get_screen_sizes( const DEVMODEW *maximum, const DEVMODEW *modes, U } /* Titan Souls renders incorrectly if we report modes smaller than 800x600 */ - if (!(env = getenv( "SteamAppId" )) || strcmp( env, "297130" )) + if ((enable_lowres = !(env = getenv( "SteamAppId" )) || strcmp( env, "297130" ))) { memcpy( sizes + count, lowres_sizes, ARRAY_SIZE(lowres_sizes) * sizeof(*sizes) ); count += ARRAY_SIZE(lowres_sizes); @@ -1695,8 +1698,8 @@ static SIZE *get_screen_sizes( const DEVMODEW *maximum, const DEVMODEW *modes, U { UINT width = devmode_get( mode, DM_PELSWIDTH ), height = devmode_get( mode, DM_PELSHEIGHT ); SIZE size = {.cx = max( width, height ), .cy = min( width, height )}; - if (!size.cx || size.cx < 800 || size.cx > max_size.cx) continue; - if (!size.cy || size.cy < 600 || size.cy > max_size.cy) continue; + if (!size.cx || (size.cx < 800 && !enable_lowres) || size.cx > max_size.cx) continue; + if (!size.cy || (size.cy < 600 && !enable_lowres) || size.cy > max_size.cy) continue; count += add_screen_size( sizes, count, size ); } From dd081cb8f908e567c70f12cbbce9739d4bae566b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 16 Jan 2025 11:00:53 -0600 Subject: [PATCH 1072/2542] crypt32: Factor out CRYPT_RegDeleteFromReg(). (cherry picked from commit de87c2d974fa2849421960ca954c9cc44acfa23d) CW-Bug-Id: #24696 --- dlls/crypt32/regstore.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/dlls/crypt32/regstore.c b/dlls/crypt32/regstore.c index 8567604c39b7..962bd6a03821 100644 --- a/dlls/crypt32/regstore.c +++ b/dlls/crypt32/regstore.c @@ -237,6 +237,15 @@ BOOL CRYPT_SerializeContextsToReg(HKEY key, DWORD flags, return ret; } +static void CRYPT_RegDeleteFromReg(HKEY key, const BYTE *sha1_hash) +{ + WCHAR hash[20 * 2 + 1]; + + CRYPT_HashToStr(sha1_hash, hash); + TRACE("Removing %s\n", debugstr_w(hash)); + RegDeleteKeyW(key, hash); +} + static BOOL CRYPT_RegWriteToReg(WINE_REGSTOREINFO *store) { static const WCHAR * const subKeys[] = { L"Certificates", L"CRLs", L"CTLs" }; @@ -258,22 +267,12 @@ static BOOL CRYPT_RegWriteToReg(WINE_REGSTOREINFO *store) if (listToDelete[i]) { WINE_HASH_TO_DELETE *toDelete, *next; - WCHAR asciiHash[20 * 2 + 1]; EnterCriticalSection(&store->cs); LIST_FOR_EACH_ENTRY_SAFE(toDelete, next, listToDelete[i], WINE_HASH_TO_DELETE, entry) { - LONG rc; - - CRYPT_HashToStr(toDelete->hash, asciiHash); - TRACE("Removing %s\n", debugstr_w(asciiHash)); - rc = RegDeleteKeyW(key, asciiHash); - if (rc != ERROR_SUCCESS && rc != ERROR_FILE_NOT_FOUND) - { - SetLastError(rc); - ret = FALSE; - } + CRYPT_RegDeleteFromReg(key, toDelete->hash); list_remove(&toDelete->entry); CryptMemFree(toDelete); } From 9450ca4c8e82313efd4ba3fdaaf850c728d55049 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 16 Jan 2025 11:23:00 -0600 Subject: [PATCH 1073/2542] crypt32: Factor out CRYPT_SerializeContextToReg(). (cherry picked from commit b3646bed4848e4248e818276edf02e7b1a1e7f28) CW-Bug-Id: #24696 --- dlls/crypt32/regstore.c | 56 ++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/dlls/crypt32/regstore.c b/dlls/crypt32/regstore.c index 962bd6a03821..43ffa106c76f 100644 --- a/dlls/crypt32/regstore.c +++ b/dlls/crypt32/regstore.c @@ -197,6 +197,35 @@ static BOOL CRYPT_WriteSerializedToReg(HKEY key, DWORD flags, const BYTE *hash, return ret; } +static BOOL CRYPT_SerializeContextToReg(HKEY key, DWORD flags, const WINE_CONTEXT_INTERFACE *context_iface, + const void *context) +{ + BYTE hash[20]; + DWORD hash_size = sizeof(hash); + DWORD size = 0; + BYTE *buf; + BOOL ret; + + if (!context_iface->getProp(context, CERT_HASH_PROP_ID, hash, &hash_size)) + return FALSE; + + context_iface->serialize(context, 0, NULL, &size); + if (!size) + return FALSE; + + if (!(buf = CryptMemAlloc(size))) + return FALSE; + + if (!(context_iface->serialize(context, 0, buf, &size))) + { + CryptMemFree(buf); + return FALSE; + } + ret = CRYPT_WriteSerializedToReg(key, flags, hash, buf, size); + CryptMemFree(buf); + return ret; +} + BOOL CRYPT_SerializeContextsToReg(HKEY key, DWORD flags, const WINE_CONTEXT_INTERFACE *contextInterface, HCERTSTORE memStore) { @@ -205,32 +234,7 @@ BOOL CRYPT_SerializeContextsToReg(HKEY key, DWORD flags, do { context = contextInterface->enumContextsInStore(memStore, context); - if (context) - { - BYTE hash[20]; - DWORD hashSize = sizeof(hash); - - ret = contextInterface->getProp(context, CERT_HASH_PROP_ID, hash, - &hashSize); - if (ret) - { - DWORD size = 0; - LPBYTE buf = NULL; - - ret = contextInterface->serialize(context, 0, NULL, &size); - if (size) - buf = CryptMemAlloc(size); - if (buf) - { - ret = contextInterface->serialize(context, 0, buf, &size); - if (ret) - ret = CRYPT_WriteSerializedToReg(key, flags, hash, buf, size); - } - CryptMemFree(buf); - } - } - else - ret = TRUE; + ret = !context || CRYPT_SerializeContextToReg(key, flags, contextInterface, context); } while (ret && context != NULL); if (context) Context_Release(context_from_ptr(context)); From ba30ad5be1f2b9ff670a11e9bfb417eeb0ccff0e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 16 Jan 2025 13:04:19 -0600 Subject: [PATCH 1074/2542] crypt32: Don't output the whole chains from check_and_store_certs(). The other certificates in constructed chain are either in 'cached' set and will be persisted anyway, or come from CA / My / Trust stores and should not be duplicated to the ROOT store. (cherry picked from commit fc23f21c0b49457d6ccb9ed2a1b287c9ffa7b8bf) CW-Bug-Id: #24696 --- dlls/crypt32/rootstore.c | 98 ++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 59 deletions(-) diff --git a/dlls/crypt32/rootstore.c b/dlls/crypt32/rootstore.c index cfddcc143ace..6d049af2edf2 100644 --- a/dlls/crypt32/rootstore.c +++ b/dlls/crypt32/rootstore.c @@ -98,74 +98,54 @@ static const char *get_cert_common_name(PCCERT_CONTEXT cert) return name; } -static void check_and_store_certs(HCERTSTORE cached, HCERTSTORE new, HCERTSTORE to) +static void check_and_store_certs( HCERTSTORE cached, HCERTSTORE new, HCERTSTORE to ) { DWORD root_count = 0; - CERT_CHAIN_ENGINE_CONFIG chainEngineConfig = - { sizeof(chainEngineConfig), 0 }; + CERT_CHAIN_ENGINE_CONFIG chainEngineConfig = { sizeof(chainEngineConfig), 0 }; HCERTCHAINENGINE engine; + PCCERT_CONTEXT cert = NULL; TRACE("\n"); - CertDuplicateStore(to); - engine = CRYPT_CreateChainEngine(to, CERT_SYSTEM_STORE_CURRENT_USER, &chainEngineConfig); - if (engine) + CertDuplicateStore( to ); + if (!(engine = CRYPT_CreateChainEngine( to, CERT_SYSTEM_STORE_CURRENT_USER, &chainEngineConfig ))) + return; + + while ((cert = CertEnumCertificatesInStore( new, cert ))) { - PCCERT_CONTEXT cert = NULL; + const DWORD allowed_errors = CERT_TRUST_IS_UNTRUSTED_ROOT | CERT_TRUST_IS_NOT_VALID_FOR_USAGE + | CERT_TRUST_INVALID_BASIC_CONSTRAINTS | CERT_TRUST_IS_NOT_TIME_VALID; + CERT_CHAIN_PARA chainPara = { sizeof(chainPara), { 0 } }; + PCCERT_CHAIN_CONTEXT chain; + BOOL ret; + + ret = CertGetCertificateChain( engine, cert, NULL, cached, &chainPara, CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL, NULL, &chain ); + if (!ret) + { + TRACE( "rejecting %s: chain creation failed.\n", get_cert_common_name( cert )); + continue; + } - do { - cert = CertEnumCertificatesInStore(new, cert); - if (cert) - { - CERT_CHAIN_PARA chainPara = { sizeof(chainPara), { 0 } }; - PCCERT_CHAIN_CONTEXT chain; - BOOL ret; - - ret = CertGetCertificateChain(engine, cert, NULL, cached, - &chainPara, CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL, NULL, &chain); - if (!ret) - TRACE("rejecting %s: %s\n", get_cert_common_name(cert), - "chain creation failed"); - else - { - DWORD allowedErrors = CERT_TRUST_IS_UNTRUSTED_ROOT | - CERT_TRUST_IS_NOT_VALID_FOR_USAGE | - CERT_TRUST_INVALID_BASIC_CONSTRAINTS | - CERT_TRUST_IS_NOT_TIME_VALID; - - /* The certificate chain verification only allows certain - * invalid CA certs if they're installed locally: CA - * certs missing the key usage extension, and CA certs - * missing the basic constraints extension. Of course - * there's a chicken and egg problem: we have to accept - * them here in order for them to be accepted later. - * Expired, locally installed certs are also allowed here, - * because we don't know (yet) what date will be checked - * for an item signed by one of these certs. - * Thus, accept certs with any of the allowed errors. - */ - if (chain->TrustStatus.dwErrorStatus & ~allowedErrors) - TRACE("rejecting %s: %s\n", get_cert_common_name(cert), - trust_status_to_str(chain->TrustStatus.dwErrorStatus & - ~CERT_TRUST_IS_UNTRUSTED_ROOT)); - else - { - DWORD i, j; - - for (i = 0; i < chain->cChain; i++) - for (j = 0; j < chain->rgpChain[i]->cElement; j++) - if (CertAddCertificateContextToStore(to, - chain->rgpChain[i]->rgpElement[j]->pCertContext, - CERT_STORE_ADD_NEW, NULL)) - root_count++; - } - CertFreeCertificateChain(chain); - } - } - } while (cert); - CertFreeCertificateChainEngine(engine); + /* The certificate chain verification only allows certain + * invalid CA certs if they're installed locally: CA + * certs missing the key usage extension, and CA certs + * missing the basic constraints extension. Of course + * there's a chicken and egg problem: we have to accept + * them here in order for them to be accepted later. + * Expired, locally installed certs are also allowed here, + * because we don't know (yet) what date will be checked + * for an item signed by one of these certs. + * Thus, accept certs with any of the allowed errors. + */ + if (chain->TrustStatus.dwErrorStatus & ~allowed_errors) + TRACE( "rejecting %s: %s\n", get_cert_common_name(cert), + trust_status_to_str( chain->TrustStatus.dwErrorStatus & ~CERT_TRUST_IS_UNTRUSTED_ROOT )); + else if (CertAddCertificateContextToStore( to, cert, CERT_STORE_ADD_NEW, NULL )) + root_count++; + CertFreeCertificateChain(chain); } - TRACE("Added %ld root certificates\n", root_count); + CertFreeCertificateChainEngine( engine ); + TRACE( "Added %ld root certificates\n", root_count ); } static const BYTE authenticode[] = { From 548d59198d4310aa27fe1b8e0e9eb1c02c38f8d5 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 16 Jan 2025 12:52:08 -0600 Subject: [PATCH 1075/2542] crypt32: Do not use temporary store for updating root certificates. (cherry picked from commit afaf6e08c7fcb980a350a87d73e06704559c5bb9) CW-Bug-Id: #24696 --- dlls/crypt32/crypt32_private.h | 5 +- dlls/crypt32/regstore.c | 6 +- dlls/crypt32/rootstore.c | 145 ++++++++++++++------------------- 3 files changed, 69 insertions(+), 87 deletions(-) diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h index 827594d84891..1f0ec39d2001 100644 --- a/dlls/crypt32/crypt32_private.h +++ b/dlls/crypt32/crypt32_private.h @@ -349,10 +349,11 @@ WINECRYPT_CERTSTORE *CRYPT_FileNameOpenStoreW(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara); void CRYPT_ImportSystemRootCertsToReg(void); -BOOL CRYPT_SerializeContextsToReg(HKEY key, DWORD flags, const WINE_CONTEXT_INTERFACE *contextInterface, - HCERTSTORE memStore); +BOOL CRYPT_SerializeContextToReg(HKEY key, DWORD flags, const WINE_CONTEXT_INTERFACE *context_iface, + const void *context); void CRYPT_RegReadSerializedFromReg(HKEY key, DWORD contextType, HCERTSTORE store, DWORD disposition); +void CRYPT_RegDeleteFromReg(HKEY key, const BYTE *sha1_hash); DWORD CRYPT_IsCertificateSelfSigned(const CERT_CONTEXT *cert); diff --git a/dlls/crypt32/regstore.c b/dlls/crypt32/regstore.c index 43ffa106c76f..fbc2909dd2c4 100644 --- a/dlls/crypt32/regstore.c +++ b/dlls/crypt32/regstore.c @@ -197,7 +197,7 @@ static BOOL CRYPT_WriteSerializedToReg(HKEY key, DWORD flags, const BYTE *hash, return ret; } -static BOOL CRYPT_SerializeContextToReg(HKEY key, DWORD flags, const WINE_CONTEXT_INTERFACE *context_iface, +BOOL CRYPT_SerializeContextToReg(HKEY key, DWORD flags, const WINE_CONTEXT_INTERFACE *context_iface, const void *context) { BYTE hash[20]; @@ -226,7 +226,7 @@ static BOOL CRYPT_SerializeContextToReg(HKEY key, DWORD flags, const WINE_CONTEX return ret; } -BOOL CRYPT_SerializeContextsToReg(HKEY key, DWORD flags, +static BOOL CRYPT_SerializeContextsToReg(HKEY key, DWORD flags, const WINE_CONTEXT_INTERFACE *contextInterface, HCERTSTORE memStore) { const void *context = NULL; @@ -241,7 +241,7 @@ BOOL CRYPT_SerializeContextsToReg(HKEY key, DWORD flags, return ret; } -static void CRYPT_RegDeleteFromReg(HKEY key, const BYTE *sha1_hash) +void CRYPT_RegDeleteFromReg(HKEY key, const BYTE *sha1_hash) { WCHAR hash[20 * 2 + 1]; diff --git a/dlls/crypt32/rootstore.c b/dlls/crypt32/rootstore.c index 6d049af2edf2..bf4804783e2a 100644 --- a/dlls/crypt32/rootstore.c +++ b/dlls/crypt32/rootstore.c @@ -58,6 +58,7 @@ static const char *trust_status_to_str(DWORD status) { CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT, "excluded name constraint" }, { CERT_TRUST_IS_OFFLINE_REVOCATION, "revocation server offline" }, { CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY, "no issuance policy" }, + { CERT_TRUST_IS_PARTIAL_CHAIN, "partial chain" }, }; static char buf[1024]; int i, pos = 0; @@ -98,7 +99,7 @@ static const char *get_cert_common_name(PCCERT_CONTEXT cert) return name; } -static void check_and_store_certs( HCERTSTORE cached, HCERTSTORE new, HCERTSTORE to ) +static void check_and_store_certs( HCERTSTORE cached, HKEY key ) { DWORD root_count = 0; CERT_CHAIN_ENGINE_CONFIG chainEngineConfig = { sizeof(chainEngineConfig), 0 }; @@ -107,19 +108,29 @@ static void check_and_store_certs( HCERTSTORE cached, HCERTSTORE new, HCERTSTORE TRACE("\n"); - CertDuplicateStore( to ); - if (!(engine = CRYPT_CreateChainEngine( to, CERT_SYSTEM_STORE_CURRENT_USER, &chainEngineConfig ))) + if (!(engine = CRYPT_CreateChainEngine( cached, CERT_SYSTEM_STORE_CURRENT_USER, &chainEngineConfig ))) return; - while ((cert = CertEnumCertificatesInStore( new, cert ))) + while ((cert = CertEnumCertificatesInStore( cached, cert ))) { const DWORD allowed_errors = CERT_TRUST_IS_UNTRUSTED_ROOT | CERT_TRUST_IS_NOT_VALID_FOR_USAGE | CERT_TRUST_INVALID_BASIC_CONSTRAINTS | CERT_TRUST_IS_NOT_TIME_VALID; CERT_CHAIN_PARA chainPara = { sizeof(chainPara), { 0 } }; PCCERT_CHAIN_CONTEXT chain; + DWORD size; + int is_new; BOOL ret; - ret = CertGetCertificateChain( engine, cert, NULL, cached, &chainPara, CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL, NULL, &chain ); + size = sizeof(is_new); + if (!CertGetCertificateContextProperty( cert, CERT_FIRST_USER_PROP_ID, &is_new, &size )) + { + ERR( "CERT_FIRST_USER_PROP_ID property absent for cert %p.\n", cert ); + continue; + } + if (!is_new) + continue; + + ret = CertGetCertificateChain( engine, cert, NULL, NULL, &chainPara, CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL, NULL, &chain ); if (!ret) { TRACE( "rejecting %s: chain creation failed.\n", get_cert_common_name( cert )); @@ -140,8 +151,13 @@ static void check_and_store_certs( HCERTSTORE cached, HCERTSTORE new, HCERTSTORE if (chain->TrustStatus.dwErrorStatus & ~allowed_errors) TRACE( "rejecting %s: %s\n", get_cert_common_name(cert), trust_status_to_str( chain->TrustStatus.dwErrorStatus & ~CERT_TRUST_IS_UNTRUSTED_ROOT )); - else if (CertAddCertificateContextToStore( to, cert, CERT_STORE_ADD_NEW, NULL )) + else + { + /* Clear custom property so it is not serialized and seen by apps. */ + CertSetCertificateContextProperty( cert, CERT_FIRST_USER_PROP_ID, 0, NULL ); + CRYPT_SerializeContextToReg( key, 0, pCertInterface, cert ); root_count++; + } CertFreeCertificateChain(chain); } CertFreeCertificateChainEngine( engine ); @@ -575,26 +591,32 @@ static const struct CONST_BLOB { { rootcertauthority2011, sizeof(rootcertauthority2011) }, }; -static void add_ms_root_certs(HCERTSTORE to, HCERTSTORE cached) +static void add_ms_root_certs(HKEY key, HCERTSTORE cached) { PCCERT_CONTEXT cert, existing; DWORD i; + int is_new; + const CRYPT_DATA_BLOB exists_blob = { sizeof(is_new), (BYTE *)&is_new }; TRACE("\n"); for (i = 0; i < ARRAY_SIZE(msRootCerts); i++) { - if (!CertAddEncodedCertificateToStore(to, X509_ASN_ENCODING, - msRootCerts[i].pb, msRootCerts[i].cb, CERT_STORE_ADD_NEW, &cert)) + if (!(cert = CertCreateCertificateContext(X509_ASN_ENCODING, msRootCerts[i].pb, msRootCerts[i].cb))) { WARN("adding root cert %ld failed: %08lx\n", i, GetLastError()); continue; } if ((existing = CertFindCertificateInStore(cached, X509_ASN_ENCODING, 0, CERT_FIND_EXISTING, cert, NULL))) { - CertDeleteCertificateFromStore(existing); + is_new = 0; + CertSetCertificateContextProperty(existing, CERT_FIRST_USER_PROP_ID, 0, &exists_blob); CertFreeCertificateContext(existing); } + else + { + CRYPT_SerializeContextToReg(key, 0, pCertInterface, cert); + } CertFreeCertificateContext(cert); } } @@ -604,9 +626,8 @@ static void add_ms_root_certs(HCERTSTORE to, HCERTSTORE cached) * adding redundant certificates, e.g. when both a certificate bundle and * individual certificates exist in the same directory. */ -static void read_trusted_roots_from_known_locations(HCERTSTORE store, HCERTSTORE cached, BOOL *delete) +static void sync_trusted_roots_from_known_locations( HKEY key, HCERTSTORE cached ) { - HCERTSTORE new; DWORD needed, size; struct enum_root_certs_params params = { NULL, 2048, &needed }; HCRYPTPROV prov; @@ -614,17 +635,11 @@ static void read_trusted_roots_from_known_locations(HCERTSTORE store, HCERTSTORE BYTE hashval[20]; DWORD hashlen; CRYPT_HASH_BLOB hash_blob = { sizeof(hashval), hashval }; - CRYPT_DATA_BLOB exists_blob = { 0, NULL }; + int is_new; + CRYPT_DATA_BLOB exists_blob = { sizeof(is_new), (BYTE *)&is_new }; PCCERT_CONTEXT cert, existing; - unsigned int existing_count = 0, new_count = 0; - unsigned int cached_count = 0; - - new = CertOpenStore( CERT_STORE_PROV_MEMORY, X509_ASN_ENCODING, 0, CERT_STORE_CREATE_NEW_FLAG, NULL ); - if (!new) return; - - existing = NULL; - while ((existing = CertEnumCertificatesInStore( cached, existing ))) - ++cached_count; + unsigned int existing_count = 0, new_count = 0, deleted_count = 0; + BYTE sha1_hash[20]; CryptAcquireContextW( &prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT ); params.buffer = CryptMemAlloc( params.size ); @@ -649,6 +664,7 @@ static void read_trusted_roots_from_known_locations(HCERTSTORE store, HCERTSTORE * is found among host imports. */ if (!CertGetCertificateContextProperty( existing, CERT_FIRST_USER_PROP_ID, NULL, &size )) { + is_new = 0; if (!CertSetCertificateContextProperty( existing, CERT_FIRST_USER_PROP_ID, 0, &exists_blob )) ERR( "Failed to set property.\n" ); ++existing_count; @@ -656,9 +672,9 @@ static void read_trusted_roots_from_known_locations(HCERTSTORE store, HCERTSTORE CertFreeCertificateContext( existing ); continue; } - CertAddEncodedCertificateToStore( new, X509_ASN_ENCODING, params.buffer, needed, CERT_STORE_ADD_ALWAYS, &cert ); - /* Add to cached so we can catch duplicates and check_and_store_certs() has the full chains. */ - CertAddCertificateContextToStore( cached, cert, CERT_STORE_ADD_ALWAYS, NULL ); + + CertAddEncodedCertificateToStore( cached, X509_ASN_ENCODING, params.buffer, needed, CERT_STORE_ADD_ALWAYS, &cert ); + is_new = 1; if (!CertSetCertificateContextProperty( cert, CERT_FIRST_USER_PROP_ID, 0, &exists_blob )) ERR("Failed to set property.\n"); CertFreeCertificateContext( cert ); @@ -667,61 +683,35 @@ static void read_trusted_roots_from_known_locations(HCERTSTORE store, HCERTSTORE CryptMemFree( params.buffer ); CryptReleaseContext( prov, 0 ); - if (existing_count < cached_count) + cert = NULL; + while ((cert = CertEnumCertificatesInStore( cached, cert ))) { - /* Some certs were removed on host. Clean up the cache and add all the certificates so cert chains - * get revalidated. The certs present on host are now in 'cached' store and are marked with - * CERT_FIRST_USER_PROP_ID property. */ - TRACE( "Some keys were removed, reimporting, cached %u, existing %u, new %u.\n", - cached_count, existing_count, new_count ); - *delete = TRUE; - existing_count = 0; - existing = NULL; - while ((existing = CertEnumCertificatesInStore( cached, existing ))) - { - if (!CertGetCertificateContextProperty( existing, CERT_FIRST_USER_PROP_ID, NULL, &size )) - continue; - CertAddCertificateContextToStore( new, existing, CERT_STORE_ADD_NEW, NULL ); - ++new_count; - } - } - if (new_count) - { - /* Clear custom property so it is not serialized and seen by apps. */ + if (CertGetCertificateContextProperty( cert, CERT_FIRST_USER_PROP_ID, NULL, &size )) + continue; + + size = sizeof(sha1_hash); + CertGetCertificateContextProperty( cert, CERT_HASH_PROP_ID, sha1_hash, &size ); + ++deleted_count; + CRYPT_RegDeleteFromReg( key, sha1_hash ); + /* Delete from cached so deleted certs do not participate in chain verification. */ + CertDeleteCertificateFromStore( cert ); + /* Restart enumeration as it is broken by deleting cert from store. */ + CertFreeCertificateContext( cert ); cert = NULL; - while ((cert = CertEnumCertificatesInStore( new, cert ))) - CertSetCertificateContextProperty( cert, CERT_FIRST_USER_PROP_ID, 0, NULL ); - check_and_store_certs( cached, new, store ); } - CertCloseStore( new, 0 ); - TRACE( "existing %u, new %u.\n", existing_count, new_count ); -} - -static HCERTSTORE create_root_store(HCERTSTORE cached, BOOL *delete) -{ - HCERTSTORE memStore = CertOpenStore(CERT_STORE_PROV_MEMORY, - X509_ASN_ENCODING, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); - - - *delete = FALSE; - if (memStore) - { - add_ms_root_certs(memStore, cached); - read_trusted_roots_from_known_locations(memStore, cached, delete); - } + if (new_count) + check_and_store_certs( cached, key ); - TRACE("returning %p\n", memStore); - return memStore; + TRACE( "existing %u, deleted %u, new %u.\n", existing_count, deleted_count, new_count ); } void CRYPT_ImportSystemRootCertsToReg(void) { - HCERTSTORE store = NULL, reg = NULL; + HCERTSTORE cached = NULL; HKEY key = NULL; LONG rc; HANDLE hsem; - BOOL delete; static BOOL root_certs_imported = FALSE; @@ -746,27 +736,18 @@ void CRYPT_ImportSystemRootCertsToReg(void) if (rc) goto done; - if (!(reg = CertOpenStore(CERT_STORE_PROV_MEMORY, X509_ASN_ENCODING, 0, CERT_STORE_CREATE_NEW_FLAG, NULL))) + if (!(cached = CertOpenStore(CERT_STORE_PROV_MEMORY, X509_ASN_ENCODING, 0, CERT_STORE_CREATE_NEW_FLAG, NULL))) { ERR("Failed to create memory store.\n"); goto done; } - CRYPT_RegReadSerializedFromReg(key, CERT_STORE_CERTIFICATE_CONTEXT_FLAG, reg, CERT_STORE_ADD_ALWAYS); - - if (!(store = create_root_store(reg, &delete))) - { - ERR("Failed to create root store\n"); - goto done; - } - if (delete && RegDeleteTreeW(key, NULL)) - ERR("Error deleting key.\n"); - if (!CRYPT_SerializeContextsToReg(key, 0, pCertInterface, store)) - ERR("Failed to import system certs into registry, %08lx\n", GetLastError()); + CRYPT_RegReadSerializedFromReg(key, CERT_STORE_CERTIFICATE_CONTEXT_FLAG, cached, CERT_STORE_ADD_ALWAYS); + add_ms_root_certs(key, cached); + sync_trusted_roots_from_known_locations(key, cached); done: RegCloseKey(key); - CertCloseStore(store, 0); - CertCloseStore(reg, 0); + CertCloseStore(cached, 0); root_certs_imported = TRUE; ReleaseSemaphore(hsem, 1, NULL); CloseHandle(hsem); From 541497e3e06f764743bd94be7eacceb1d94bb80c Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 16 Jan 2025 16:47:57 -0600 Subject: [PATCH 1076/2542] crypt32: Do not delete root certs which were not imported from host in sync_trusted_roots_from_known_locations(). (cherry picked from commit b929b1e63b2321eb82ca3cd8a007807a0106e76c) CW-Bug-Id: #24696 --- dlls/crypt32/crypt32_private.h | 1 + dlls/crypt32/regstore.c | 2 +- dlls/crypt32/rootstore.c | 58 +++++++++++++++++++++++++++++++--- 3 files changed, 56 insertions(+), 5 deletions(-) diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h index 1f0ec39d2001..a5aeae631688 100644 --- a/dlls/crypt32/crypt32_private.h +++ b/dlls/crypt32/crypt32_private.h @@ -354,6 +354,7 @@ BOOL CRYPT_SerializeContextToReg(HKEY key, DWORD flags, const WINE_CONTEXT_INTER void CRYPT_RegReadSerializedFromReg(HKEY key, DWORD contextType, HCERTSTORE store, DWORD disposition); void CRYPT_RegDeleteFromReg(HKEY key, const BYTE *sha1_hash); +void CRYPT_HashToStr(const BYTE *hash, LPWSTR asciiHash); DWORD CRYPT_IsCertificateSelfSigned(const CERT_CONTEXT *cert); diff --git a/dlls/crypt32/regstore.c b/dlls/crypt32/regstore.c index fbc2909dd2c4..218a7ea32697 100644 --- a/dlls/crypt32/regstore.c +++ b/dlls/crypt32/regstore.c @@ -45,7 +45,7 @@ typedef struct _WINE_REGSTOREINFO struct list ctlsToDelete; } WINE_REGSTOREINFO; -static void CRYPT_HashToStr(const BYTE *hash, LPWSTR asciiHash) +void CRYPT_HashToStr(const BYTE *hash, LPWSTR asciiHash) { DWORD i; diff --git a/dlls/crypt32/rootstore.c b/dlls/crypt32/rootstore.c index bf4804783e2a..4c215d449432 100644 --- a/dlls/crypt32/rootstore.c +++ b/dlls/crypt32/rootstore.c @@ -99,7 +99,26 @@ static const char *get_cert_common_name(PCCERT_CONTEXT cert) return name; } -static void check_and_store_certs( HCERTSTORE cached, HKEY key ) +static void get_cert_context_hash( const CERT_CONTEXT *cert, BYTE *sha1_hash, WCHAR *hash_str ) +{ + DWORD size; + + size = 20; + CertGetCertificateContextProperty( cert, CERT_HASH_PROP_ID, sha1_hash, &size ); + CRYPT_HashToStr( sha1_hash, hash_str ); +} + +static void mark_cert_imported( HKEY import_key, const CERT_CONTEXT *cert ) +{ + WCHAR hash_str[20 * 2 + 1]; + BYTE sha1_hash[20]; + DWORD value = 1; + + get_cert_context_hash( cert, sha1_hash, hash_str ); + RegSetValueExW( import_key, hash_str, 0, REG_DWORD, (BYTE *)&value, sizeof(value) ); +} + +static void check_and_store_certs( HCERTSTORE cached, HKEY key, HKEY import_key ) { DWORD root_count = 0; CERT_CHAIN_ENGINE_CONFIG chainEngineConfig = { sizeof(chainEngineConfig), 0 }; @@ -155,6 +174,7 @@ static void check_and_store_certs( HCERTSTORE cached, HKEY key ) { /* Clear custom property so it is not serialized and seen by apps. */ CertSetCertificateContextProperty( cert, CERT_FIRST_USER_PROP_ID, 0, NULL ); + mark_cert_imported( import_key, cert ); CRYPT_SerializeContextToReg( key, 0, pCertInterface, cert ); root_count++; } @@ -640,6 +660,29 @@ static void sync_trusted_roots_from_known_locations( HKEY key, HCERTSTORE cached PCCERT_CONTEXT cert, existing; unsigned int existing_count = 0, new_count = 0, deleted_count = 0; BYTE sha1_hash[20]; + HKEY import_key; + WCHAR hash_str[20 * 2 + 1]; + DWORD value; + + if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"Software\\Wine\\HostImportedCertificates", 0, KEY_ALL_ACCESS, &import_key )) + { + if (RegCreateKeyExW( HKEY_LOCAL_MACHINE, L"Software\\Wine\\HostImportedCertificates_tmp", 0, NULL, 0, + KEY_ALL_ACCESS, NULL, &import_key, NULL )) + return; + + /* If the key is absent existing certificates were added by an older Wine version, mark all cached certificates + * as imported (as it was previously assumed) so they can be deleted when are deleted on host. */ + cert = NULL; + while ((cert = CertEnumCertificatesInStore( cached, cert ))) + mark_cert_imported( import_key, cert ); + + if ((value = RegRenameKey( import_key, NULL, L"HostImportedCertificates" ))) + { + ERR( "Error renaming key %#lx.\n", value ); + RegCloseKey( import_key ); + return; + } + } CryptAcquireContextW( &prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT ); params.buffer = CryptMemAlloc( params.size ); @@ -689,10 +732,16 @@ static void sync_trusted_roots_from_known_locations( HKEY key, HCERTSTORE cached if (CertGetCertificateContextProperty( cert, CERT_FIRST_USER_PROP_ID, NULL, &size )) continue; - size = sizeof(sha1_hash); - CertGetCertificateContextProperty( cert, CERT_HASH_PROP_ID, sha1_hash, &size ); + get_cert_context_hash( cert, sha1_hash, hash_str ); + size = sizeof(value); + if (RegQueryValueExW( import_key, hash_str, NULL, NULL, (BYTE *)&value, &size )) + { + TRACE( "key %s is not imported, not deleting.\n", debugstr_w(hash_str) ); + continue; + } ++deleted_count; CRYPT_RegDeleteFromReg( key, sha1_hash ); + RegDeleteValueW( import_key, hash_str ); /* Delete from cached so deleted certs do not participate in chain verification. */ CertDeleteCertificateFromStore( cert ); /* Restart enumeration as it is broken by deleting cert from store. */ @@ -701,8 +750,9 @@ static void sync_trusted_roots_from_known_locations( HKEY key, HCERTSTORE cached } if (new_count) - check_and_store_certs( cached, key ); + check_and_store_certs( cached, key, import_key ); + RegCloseKey( import_key ); TRACE( "existing %u, deleted %u, new %u.\n", existing_count, deleted_count, new_count ); } From 17d4c57ba373ce05d7c0bf5ba6e61c35eafc9356 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 16 Jan 2025 10:59:30 -0600 Subject: [PATCH 1077/2542] wine.inf: Add Explorer\FileExts registry key. CW-Bug-Id: #24696 --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 2591f320ba29..415c5e458f2b 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -390,6 +390,7 @@ HKLM,System\CurrentControlSet\Control\Class\{745a17a0-74d3-11d0-b6fe-00a0c90f57d [CurrentVersion] HKCU,%CurrentVersion%\Explorer\Advanced,,16 +HKCU,%CurrentVersion%\Explorer\FileExts,,16 HKCU,%CurrentVersion%\Run,,16 HKCU,%CurrentVersionNT%\Winlogon,,16 HKLM,%CurrentVersion%,"CommonFilesDir",,"%16427%" From 126ca6c42915ad871ca399bce5102bb536114e89 Mon Sep 17 00:00:00 2001 From: Charlotte Pabst Date: Wed, 22 Jan 2025 23:42:24 +0100 Subject: [PATCH 1078/2542] fshack: winex11: Add back WINE_DISABLE_FULLSCREEN_HACK. --- dlls/winex11.drv/opengl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 5e1749edb83e..ff7b7fa5dc48 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1818,6 +1818,13 @@ static GLXContext create_glxcontext(Display *display, struct wgl_context *contex BOOL enable_fullscreen_hack( HWND hwnd, BOOL check_gamma ) { + static int disable_fshack = -1; + if (disable_fshack == -1) { + const char *env = getenv("WINE_DISABLE_FULLSCREEN_HACK"); + disable_fshack = env && atoi(env); + } + + if (disable_fshack) return FALSE; if (NtUserGetDpiForWindow( hwnd ) != NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI )) return TRUE; /* needs DPI scaling */ return check_gamma && ReadNoFence( &gamma_serial ); } From ef11cac2d0d6fc8ec7aa5519ad617929e793fa8f Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Fri, 17 Jan 2025 18:03:20 +1100 Subject: [PATCH 1079/2542] mf: HACK: VRChat (438100) Drop late audio packets. VRChat requires audio packets that are late to be dropped prior to being passed to an MFT. CW-Bug-Id: #24665 --- dlls/mf/session.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 5fc4bdabc121..62efa0d75f90 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -3724,13 +3724,32 @@ static HRESULT transform_node_push_sample(const struct media_session *session, s struct transform_stream *stream = &topo_node->u.transform.inputs[input]; UINT id = transform_node_get_stream_id(topo_node, FALSE, input); IMFTransform *transform = topo_node->object.transform; + MFTIME pts, clocktime; + IMFMediaType *type; + GUID major_type; + const char *sgi; HRESULT hr; if (sample) { - hr = IMFTransform_ProcessInput(transform, id, sample, 0); - if (hr == MF_E_NOTACCEPTING) - hr = transform_stream_push_sample(stream, sample); + /* HACK: VRChat (438100) requires audio packets that are late to be dropped prior to being passed to an MFT */ + if((sgi = getenv("SteamGameId")) && !strcmp(sgi, "438100") && + SUCCEEDED(IMFTransform_GetOutputCurrentType(transform, id, &type)) && + SUCCEEDED(IMFMediaType_GetMajorType(type, &major_type)) && + IsEqualGUID(&major_type, &MFMediaType_Audio) && + SUCCEEDED(IMFSample_GetSampleTime(sample, &pts)) && pts != MINLONGLONG && + SUCCEEDED(IMFPresentationClock_GetTime(session->clock, &clocktime)) && + clocktime > pts) + { + hr = S_OK; + FIXME("dropping audio sample clocktime %I64d pts %I64d jitter: %I64d\n", clocktime, pts, clocktime - pts); + } + else + { + hr = IMFTransform_ProcessInput(transform, id, sample, 0); + if (hr == MF_E_NOTACCEPTING) + hr = transform_stream_push_sample(stream, sample); + } } else { From fcb6691d44c7e8f2e12c83316d0c617258ab831a Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Tue, 9 Jan 2024 11:31:50 +0000 Subject: [PATCH 1080/2542] HACK: winegstreamer: Implement URI media source with uridecodebin. This overrides Urlmon based scheme handlers. The urlmon scheme handlers only support playback of the media after it has been fully downloaded from the internet, and has no streaming support. This is undesirable for games like VRChat. Link: https://github.com/ValveSoftware/wine/pull/142 CW-Bug-Id: #20485 CW-Bug-Id: #23217 --- dlls/mf/mf.rgs | 8 - dlls/winegstreamer/gst_private.h | 1 + dlls/winegstreamer/media_source.c | 262 +++++++++++++++++++ dlls/winegstreamer/mfplat.c | 3 + dlls/winegstreamer/wg_parser.c | 14 +- dlls/winegstreamer/winegstreamer.rgs | 28 ++ dlls/winegstreamer/winegstreamer_classes.idl | 7 + 7 files changed, 312 insertions(+), 11 deletions(-) diff --git a/dlls/mf/mf.rgs b/dlls/mf/mf.rgs index f06576baccb6..f127df763212 100644 --- a/dlls/mf/mf.rgs +++ b/dlls/mf/mf.rgs @@ -12,14 +12,6 @@ HKLM { val '{477ec299-1421-4bdd-971f-7ccb933f21ad}' = s 'File Scheme Handler' } - 'http:' - { - val '{9ec4b4f9-3029-45ad-947b-344de2a249e2}' = s 'Urlmon Scheme Handler' - } - 'https:' - { - val '{9ec4b4f9-3029-45ad-947b-344de2a249e2}' = s 'Urlmon Scheme Handler' - } } } } diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index aa76b4d73241..f935ca79f58a 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -187,6 +187,7 @@ HRESULT audio_decoder_create(REFIID riid, void **ret); HRESULT aac_decoder_create(REFIID riid, void **ret); HRESULT h264_decoder_create(REFIID riid, void **ret); HRESULT video_processor_create(REFIID riid, void **ret); +HRESULT gstreamer_scheme_handler_create(REFIID riid, void **ret); HRESULT h264_encoder_create(REFIID riid, void **ret); diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index 850752564205..0bb2c6b40001 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -2170,3 +2170,265 @@ HRESULT gstreamer_byte_stream_handler_create(REFIID riid, void **obj) return hr; } + +struct scheme_handler +{ + IMFSchemeHandler IMFSchemeHandler_iface; + IMFAsyncCallback IMFAsyncCallback_iface; + LONG refcount; + struct list results; + CRITICAL_SECTION cs; +}; + +static struct scheme_handler *impl_from_IMFSchemeHandler(IMFSchemeHandler *iface) +{ + return CONTAINING_RECORD(iface, struct scheme_handler, IMFSchemeHandler_iface); +} + +static struct scheme_handler *scheme_handler_from_IMFAsyncCallback(IMFAsyncCallback *iface) +{ + return CONTAINING_RECORD(iface, struct scheme_handler, IMFAsyncCallback_iface); +} + +static struct result_entry *scheme_handler_find_result_entry(struct scheme_handler *handler, IMFAsyncResult *result) +{ + struct result_entry *entry; + + EnterCriticalSection(&handler->cs); + LIST_FOR_EACH_ENTRY(entry, &handler->results, struct result_entry, entry) + { + if (result == entry->result) + { + list_remove(&entry->entry); + LeaveCriticalSection(&handler->cs); + return entry; + } + } + LeaveCriticalSection(&handler->cs); + + return NULL; +} + + +static HRESULT WINAPI scheme_handler_QueryIntace(IMFSchemeHandler *iface, REFIID riid, void **obj) +{ + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj); + + if (IsEqualIID(riid, &IID_IMFSchemeHandler) || + IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IMFSchemeHandler_AddRef(iface); + return S_OK; + } + + WARN("Unsupported %s.\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI scheme_handler_AddRef(IMFSchemeHandler *iface) +{ + struct scheme_handler *handler = impl_from_IMFSchemeHandler(iface); + ULONG refcount = InterlockedIncrement(&handler->refcount); + + TRACE("%p, refcount %lu.\n", handler, refcount); + + return refcount; +} + +static ULONG WINAPI scheme_handler_Release(IMFSchemeHandler *iface) +{ + struct scheme_handler *handler = impl_from_IMFSchemeHandler(iface); + ULONG refcount = InterlockedDecrement(&handler->refcount); + struct result_entry *result, *next; + + TRACE("%p, refcount %lu.\n", iface, refcount); + + if (!refcount) + { + LIST_FOR_EACH_ENTRY_SAFE(result, next, &handler->results, struct result_entry, entry) + result_entry_destroy(result); + DeleteCriticalSection(&handler->cs); + free(handler); + } + + return refcount; +} + +static HRESULT WINAPI scheme_handler_BeginCreateObject(IMFSchemeHandler *iface, const WCHAR *url, DWORD flags, + IPropertyStore *props, IUnknown **cancel_cookie, IMFAsyncCallback *callback, IUnknown *state) +{ + struct scheme_handler *handler = impl_from_IMFSchemeHandler(iface); + IMFByteStream *bytestream; + IMFAsyncResult *result; + IUnknown *context; + IStream *stream; + HRESULT hr; + + TRACE("%p, %s, %#lx, %p, %p, %p, %p.\n", iface, debugstr_w(url), flags, props, cancel_cookie, callback, state); + + if (cancel_cookie) + *cancel_cookie = NULL; + + if (FAILED(hr = CreateStreamOnHGlobal(0, TRUE, &stream))) + return hr; + + hr = MFCreateMFByteStreamOnStream(stream, &bytestream); + IStream_Release(stream); + if (FAILED(hr)) + return hr; + + if (FAILED(hr = MFCreateAsyncResult(NULL, callback, state, &result))) + return hr; + if (FAILED(hr = object_context_create(flags, bytestream, url, -1, result, &context))) + { + IMFAsyncResult_Release(result); + return hr; + } + + hr = MFPutWorkItem(MFASYNC_CALLBACK_QUEUE_IO, &handler->IMFAsyncCallback_iface, context); + IUnknown_Release(context); + IMFAsyncResult_Release(result); + + return hr; +} + +static HRESULT WINAPI scheme_handler_EndCreateObject(IMFSchemeHandler *iface, IMFAsyncResult *result, + MF_OBJECT_TYPE *obj_type, IUnknown **object) +{ + struct scheme_handler *handler = impl_from_IMFSchemeHandler(iface); + struct result_entry *entry; + HRESULT hr; + + TRACE("%p, %p, %p, %p.\n", iface, result, obj_type, object); + + if (!(entry = scheme_handler_find_result_entry(handler, result))) + { + *obj_type = MF_OBJECT_INVALID; + *object = NULL; + return MF_E_UNEXPECTED; + } + + hr = IMFAsyncResult_GetStatus(entry->result); + *obj_type = MF_OBJECT_MEDIASOURCE; + *object = entry->object; + IUnknown_AddRef(*object); + result_entry_destroy(entry); + + return hr; +} + +static HRESULT WINAPI scheme_handler_CancelObjectCreation(IMFSchemeHandler *iface, IUnknown *cancel_cookie) +{ + /* Cancellation is not supported. */ + TRACE("%p, %p.\n", iface, cancel_cookie); + return MF_E_UNEXPECTED; +} + +static const IMFSchemeHandlerVtbl scheme_handler_vtbl = +{ + scheme_handler_QueryIntace, + scheme_handler_AddRef, + scheme_handler_Release, + scheme_handler_BeginCreateObject, + scheme_handler_EndCreateObject, + scheme_handler_CancelObjectCreation, +}; + +static HRESULT WINAPI scheme_handler_callback_QueryInterface(IMFAsyncCallback *iface, REFIID riid, void **obj) +{ + if (IsEqualIID(riid, &IID_IMFAsyncCallback) || + IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IMFAsyncCallback_AddRef(iface); + return S_OK; + } + + WARN("Unsupported %s.\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI scheme_handler_callback_AddRef(IMFAsyncCallback *iface) +{ + struct scheme_handler *handler = scheme_handler_from_IMFAsyncCallback(iface); + return IMFSchemeHandler_AddRef(&handler->IMFSchemeHandler_iface); +} + +static ULONG WINAPI scheme_handler_callback_Release(IMFAsyncCallback *iface) +{ + struct scheme_handler *handler = scheme_handler_from_IMFAsyncCallback(iface); + return IMFSchemeHandler_Release(&handler->IMFSchemeHandler_iface); +} + +static HRESULT WINAPI scheme_handler_callback_GetParameters(IMFAsyncCallback *iface, DWORD *flags, DWORD *queue) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI scheme_handler_callback_Invoke(IMFAsyncCallback *iface, IMFAsyncResult *result) +{ + struct scheme_handler *handler = scheme_handler_from_IMFAsyncCallback(iface); + IUnknown *object, *state = IMFAsyncResult_GetStateNoAddRef(result); + struct object_context *context; + struct result_entry *entry; + HRESULT hr; + + if (!state || !(context = impl_from_IUnknown(state))) + return E_INVALIDARG; + + if (FAILED(hr = media_source_create(context, (IMFMediaSource **)&object))) + WARN("Failed to create media source, hr %#lx\n", hr); + else + { + if (FAILED(hr = result_entry_create(context->result, MF_OBJECT_MEDIASOURCE, object, &entry))) + WARN("Failed to create handler result, hr %#lx\n", hr); + else + { + EnterCriticalSection(&handler->cs); + list_add_tail(&handler->results, &entry->entry); + LeaveCriticalSection(&handler->cs); + } + + IUnknown_Release(object); + } + + IMFAsyncResult_SetStatus(context->result, hr); + MFInvokeCallback(context->result); + + return S_OK; +} + +static const IMFAsyncCallbackVtbl scheme_handler_callback_vtbl = +{ + scheme_handler_callback_QueryInterface, + scheme_handler_callback_AddRef, + scheme_handler_callback_Release, + scheme_handler_callback_GetParameters, + scheme_handler_callback_Invoke, +}; + +HRESULT gstreamer_scheme_handler_create(REFIID riid, void **obj) +{ + struct scheme_handler *handler; + HRESULT hr; + + TRACE("%s, %p.\n", debugstr_guid(riid), obj); + + if (!(handler = calloc(1, sizeof(*handler)))) + return E_OUTOFMEMORY; + + list_init(&handler->results); + InitializeCriticalSection(&handler->cs); + + handler->IMFSchemeHandler_iface.lpVtbl = &scheme_handler_vtbl; + handler->IMFAsyncCallback_iface.lpVtbl = &scheme_handler_callback_vtbl; + handler->refcount = 1; + + hr = IMFSchemeHandler_QueryInterface(&handler->IMFSchemeHandler_iface, riid, obj); + IMFSchemeHandler_Release(&handler->IMFSchemeHandler_iface); + + return hr; +} diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index 6cde52069bcd..89bc213213d3 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -129,6 +129,8 @@ static const GUID CLSID_wg_aac_decoder = {0xe7889a8a,0x2083,0x4844,{0x83,0x70,0x static const GUID CLSID_wg_h264_decoder = {0x1f1e273d,0x12c0,0x4b3a,{0x8e,0x9b,0x19,0x33,0xc2,0x49,0x8a,0xea}}; static const GUID CLSID_wg_h264_encoder = {0x6c34de69,0x4670,0x46cd,{0x8c,0xb4,0x1f,0x2f,0xa1,0xdf,0xfb,0x65}}; +static const GUID CLSID_GStreamerSchemePlugin = {0x587eeb6a,0x7336,0x4ebd,{0xa4,0xf2,0x91,0xc9,0x48,0xde,0x62,0x2c}}; + static const struct class_object { const GUID *clsid; @@ -139,6 +141,7 @@ class_objects[] = { &CLSID_wg_video_processor, &video_processor_create }, { &CLSID_GStreamerAudioDecoder, &audio_decoder_create }, { &CLSID_GStreamerByteStreamHandler, &gstreamer_byte_stream_handler_create }, + { &CLSID_GStreamerSchemePlugin, &gstreamer_scheme_handler_create }, { &CLSID_wg_aac_decoder, &aac_decoder_create }, { &CLSID_wg_h264_decoder, &h264_decoder_create }, { &CLSID_wg_h264_encoder, &h264_encoder_create }, diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 7ac9079120a1..9bf7b5ecd289 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -2014,14 +2014,22 @@ static NTSTATUS wg_parser_disconnect(void *args) static BOOL decodebin_parser_init_gst(struct wg_parser *parser) { GstElement *element; + const char *type; - if (!(element = create_element("decodebin", "base"))) + type = parser->uri && (!strncmp(parser->uri, "http://", 7) || !strncmp(parser->uri, "https://", 8) || + !strncmp(parser->uri, "rtsp://", 7)) ? "uridecodebin" : "decodebin"; + if (!(element = create_element(type, "base"))) return FALSE; + GST_INFO("creating %s element for uri \"%s\"", type, parser->uri ? parser->uri : "(null)"); gst_bin_add(GST_BIN(parser->container), element); parser->decodebin = element; - g_object_set(element, "max-size-bytes", G_MAXUINT, NULL); + if (!strcmp(type, "decodebin")) + g_object_set(element, "max-size-bytes", G_MAXUINT, NULL); + else + g_object_set(element, "uri", parser->uri, NULL); + g_signal_connect(element, "pad-added", G_CALLBACK(pad_added_cb), parser); g_signal_connect(element, "pad-removed", G_CALLBACK(pad_removed_cb), parser); g_signal_connect(element, "autoplug-continue", G_CALLBACK(autoplug_continue_cb), parser); @@ -2034,7 +2042,7 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) parser->no_more_pads = false; pthread_mutex_unlock(&parser->mutex); - if (!link_src_to_element(parser->my_src, element)) + if (!strcmp(type, "decodebin") && !link_src_to_element(parser->my_src, element)) return FALSE; return TRUE; diff --git a/dlls/winegstreamer/winegstreamer.rgs b/dlls/winegstreamer/winegstreamer.rgs index 923ba673f8c9..c50d3a05747c 100644 --- a/dlls/winegstreamer/winegstreamer.rgs +++ b/dlls/winegstreamer/winegstreamer.rgs @@ -12,3 +12,31 @@ HKCR } } } + +HKLM +{ + NoRemove 'Software' + { + NoRemove 'Microsoft' + { + NoRemove 'Windows Media Foundation' + { + NoRemove 'SchemeHandlers' + { + 'http:' + { + val '{587eeb6a-7336-4ebd-a4f2-91c948de622c}' = s 'GStreamer Scheme Handler' + } + 'https:' + { + val '{587eeb6a-7336-4ebd-a4f2-91c948de622c}' = s 'GStreamer Scheme Handler' + } + 'rtsp:' + { + val '{587eeb6a-7336-4ebd-a4f2-91c948de622c}' = s 'GStreamer Scheme Handler' + } + } + } + } + } +} diff --git a/dlls/winegstreamer/winegstreamer_classes.idl b/dlls/winegstreamer/winegstreamer_classes.idl index d435ea68232a..ec16e14a6bb4 100644 --- a/dlls/winegstreamer/winegstreamer_classes.idl +++ b/dlls/winegstreamer/winegstreamer_classes.idl @@ -77,6 +77,13 @@ coclass wg_video_processor {} ] coclass GStreamerByteStreamHandler {} +[ + helpstring("GStreamer scheme handler"), + threading(both), + uuid(587eeb6a-7336-4ebd-a4f2-91c948de622c) +] +coclass GStreamerSchemePlugin { } + [ threading(both), uuid(480b1517-c8e9-4eae-b006-e6300718d85d) From c3a92d6718d9787de02bea20ca3c9aab638f5ec9 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 28 Jan 2025 14:29:45 -0600 Subject: [PATCH 1081/2542] winex11.drv: Only remap X window on Mutter in window_set_mwm_hints(). CW-Bug-Id: #24782 --- dlls/winex11.drv/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index d8dbd1bd02d7..3ffda2768583 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -920,7 +920,7 @@ static void window_set_mwm_hints( struct x11drv_win_data *data, const MwmHints * * the Mutter generated sequence, while achieving the same thing and getting WM_TAKE_FOCUS event when the * window is mapped again. */ - if (data->managed && data->pending_state.wm_state == NormalState && + if (X11DRV_HasWindowManager( "Mutter" ) && data->managed && data->pending_state.wm_state == NormalState && !old_hints->decorations != !new_hints->decorations) { if (data->wm_state_serial) return; /* another WM_STATE update is pending, wait for it to complete */ From c92b4def56798f12fdd85a3e4a653c1ba02f03d8 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 28 Jan 2025 11:45:53 -0600 Subject: [PATCH 1082/2542] win32u: Nullify surface hwnd when detaching Vulkan surface. CW-Bug-Id: #24752 --- dlls/win32u/vulkan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/win32u/vulkan.c b/dlls/win32u/vulkan.c index 04ddab6f1639..d15c57c7a7ba 100644 --- a/dlls/win32u/vulkan.c +++ b/dlls/win32u/vulkan.c @@ -1666,6 +1666,7 @@ void vulkan_detach_surfaces( struct list *surfaces ) driver_funcs->p_vulkan_surface_detach( surface->hwnd, surface->driver_private ); list_remove( &surface->entry ); list_init( &surface->entry ); + surface->hwnd = NULL; } } From 9742e32b52d784a15345ac5feab166e2ec3c66e9 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 28 Jan 2025 11:47:16 -0600 Subject: [PATCH 1083/2542] win32u: Check for NULL hwnd before calling vulkan_surface_presented() driver callback. CW-Bug-Id: #24752 --- dlls/win32u/vulkan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/vulkan.c b/dlls/win32u/vulkan.c index d15c57c7a7ba..3d3d25a73d7d 100644 --- a/dlls/win32u/vulkan.c +++ b/dlls/win32u/vulkan.c @@ -1414,7 +1414,8 @@ static VkResult win32u_vkQueuePresentKHR( VkQueue client_queue, const VkPresentI struct surface *surface = swapchain->surface; RECT client_rect; - driver_funcs->p_vulkan_surface_presented( surface->hwnd, surface->driver_private, swapchain_res ); + if (surface->hwnd) + driver_funcs->p_vulkan_surface_presented( surface->hwnd, surface->driver_private, swapchain_res ); if (swapchain_res < VK_SUCCESS) continue; if (!NtUserGetClientRect( surface->hwnd, &client_rect, NtUserGetDpiForWindow( surface->hwnd ) )) From 0cf8dd265539876692646c238a78f2c0dc1c736c Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 27 Jan 2025 15:15:25 -0600 Subject: [PATCH 1084/2542] win32u: Don't invalidate existing Vulkan surface when a new one is created for window. CW-Bug-Id: #24752 --- dlls/win32u/vulkan.c | 52 ++++---------------------------------------- 1 file changed, 4 insertions(+), 48 deletions(-) diff --git a/dlls/win32u/vulkan.c b/dlls/win32u/vulkan.c index 3d3d25a73d7d..a2d9626c9bca 100644 --- a/dlls/win32u/vulkan.c +++ b/dlls/win32u/vulkan.c @@ -120,45 +120,6 @@ static struct swapchain *swapchain_from_handle( VkSwapchainKHR handle ) return CONTAINING_RECORD( obj, struct swapchain, obj ); } -static int window_surface_compare( const void *key, const struct rb_entry *entry ) -{ - const struct surface *surface = RB_ENTRY_VALUE( entry, struct surface, window_entry ); - HWND key_hwnd = (HWND)key; - - if (key_hwnd < surface->hwnd) return -1; - if (key_hwnd > surface->hwnd) return 1; - return 0; -} - -static pthread_mutex_t window_surfaces_lock = PTHREAD_MUTEX_INITIALIZER; -static struct rb_tree window_surfaces = {.compare = window_surface_compare}; - -static void window_surfaces_insert( struct surface *surface ) -{ - struct surface *previous; - struct rb_entry *ptr; - - pthread_mutex_lock( &window_surfaces_lock ); - - if (!(ptr = rb_get( &window_surfaces, surface->hwnd ))) - rb_put( &window_surfaces, surface->hwnd, &surface->window_entry ); - else - { - previous = RB_ENTRY_VALUE( ptr, struct surface, window_entry ); - rb_replace( &window_surfaces, &previous->window_entry, &surface->window_entry ); - previous->hwnd = 0; /* make sure previous surface becomes invalid */ - } - - pthread_mutex_unlock( &window_surfaces_lock ); -} - -static void window_surfaces_remove( struct surface *surface ) -{ - pthread_mutex_lock( &window_surfaces_lock ); - if (surface->hwnd) rb_remove( &window_surfaces, &surface->window_entry ); - pthread_mutex_unlock( &window_surfaces_lock ); -} - static VkResult win32u_vkCreateWin32SurfaceKHR( VkInstance client_instance, const VkWin32SurfaceCreateInfoKHR *create_info, const VkAllocationCallbacks *allocator, VkSurfaceKHR *ret ) { @@ -206,7 +167,6 @@ static VkResult win32u_vkCreateWin32SurfaceKHR( VkInstance client_instance, cons instance->p_insert_object( instance, &surface->obj.obj ); if (dummy) NtUserDestroyWindow( dummy ); - window_surfaces_insert( surface ); *ret = surface->obj.client.surface; return VK_SUCCESS; @@ -234,7 +194,6 @@ static void win32u_vkDestroySurfaceKHR( VkInstance client_instance, VkSurfaceKHR driver_funcs->p_vulkan_surface_destroy( surface->hwnd, surface->driver_private ); instance->p_remove_object( instance, &surface->obj.obj ); - window_surfaces_remove( surface ); free( surface ); } @@ -1645,17 +1604,14 @@ static void vulkan_init_once(void) void vulkan_update_surfaces( HWND hwnd ) { struct surface *surface; - struct rb_entry *ptr; + WND *win; - pthread_mutex_lock( &window_surfaces_lock ); + if (!(win = get_win_ptr( hwnd )) || win == WND_DESKTOP || win == WND_OTHER_PROCESS) return; - if ((ptr = rb_get( &window_surfaces, hwnd ))) - { - surface = RB_ENTRY_VALUE( ptr, struct surface, window_entry ); + LIST_FOR_EACH_ENTRY( surface, &win->vulkan_surfaces, struct surface, entry ) driver_funcs->p_vulkan_surface_update( surface->hwnd, surface->driver_private ); - } - pthread_mutex_unlock( &window_surfaces_lock ); + release_win_ptr( win ); } void vulkan_detach_surfaces( struct list *surfaces ) From fca35b023fae5b7b0a38d76dba20124423e2ce02 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 27 Jan 2025 15:16:00 -0600 Subject: [PATCH 1085/2542] winex11.drv: Attach currently active Vulkan onscreen surface in vulkan_surface_update_offscreen(). CW-Bug-Id: #24752 --- dlls/winex11.drv/vulkan.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index f9be9c6f677f..79945588ade9 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -232,7 +232,15 @@ static void vulkan_surface_update_offscreen( HWND hwnd, struct x11drv_vulkan_sur struct x11drv_win_data *data; if (surface->other_process) offscreen = TRUE; - if (offscreen == surface->offscreen) return; + if (offscreen == surface->offscreen) + { + if (!offscreen && (data = get_win_data( hwnd ))) + { + attach_client_window( data, surface->window ); + release_win_data( data ); + } + return; + } surface->offscreen = offscreen; if (!surface->offscreen) From 422fd053cd277b0cb0d718601a7ec92c611b60cd Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 28 Jan 2025 18:16:35 -0600 Subject: [PATCH 1086/2542] winex11.drv: Update window shape before putting surface image. CW-Bug-Id: #24775 --- dlls/winex11.drv/bitblt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index cecea52ee5aa..df84bcbc4c37 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1829,11 +1829,6 @@ static BOOL x11drv_surface_flush( struct window_surface *window_surface, const R ptr[x] |= alpha_bits; } - if (!put_shm_image( ximage, &surface->image->shminfo, surface->window, surface->gc, rect, dirty )) - XPutImage( gdi_display, surface->window, surface->gc, ximage, dirty->left, - dirty->top, rect->left + dirty->left, rect->top + dirty->top, - dirty->right - dirty->left, dirty->bottom - dirty->top ); - if (shape_changed) { /* HACK: Do not shape layered windows on gamescope */ @@ -1857,6 +1852,11 @@ static BOOL x11drv_surface_flush( struct window_surface *window_surface, const R #endif /* HAVE_LIBXSHAPE */ } + if (!put_shm_image( ximage, &surface->image->shminfo, surface->window, surface->gc, rect, dirty )) + XPutImage( gdi_display, surface->window, surface->gc, ximage, dirty->left, + dirty->top, rect->left + dirty->left, rect->top + dirty->top, + dirty->right - dirty->left, dirty->bottom - dirty->top ); + XFlush( gdi_display ); return TRUE; From 13315afc0eb8ea23c51f18489b10e139cd21877b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 29 Jan 2025 12:21:13 +0100 Subject: [PATCH 1087/2542] HACK: winegstreamer/quartz_parser: Allow conversions between raw formats in the parser. This should instead be done with PE-side color conversion in the DShow pipeline, but dshow pipelines are not yet ready for that. CW-Bug-Id: #24739 --- dlls/winegstreamer/quartz_parser.c | 54 ++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index c1dc0d7951f3..5eb2cae8d151 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -1654,11 +1654,8 @@ static HRESULT decodebin_parser_source_query_accept(struct parser_source *pin, c return amt_to_wg_format(mt, &format) ? S_OK : S_FALSE; } -static HRESULT decodebin_parser_source_get_media_type(struct parser_source *pin, - unsigned int index, AM_MEDIA_TYPE *mt) +static HRESULT get_raw_media_type(struct wg_format *format, unsigned int index, AM_MEDIA_TYPE *mt) { - struct wg_format format; - static const enum wg_video_format video_formats[] = { /* Try to prefer YUV formats over RGB ones. Most decoders output in the @@ -1678,31 +1675,29 @@ static HRESULT decodebin_parser_source_get_media_type(struct parser_source *pin, WG_VIDEO_FORMAT_RGB15, }; - wg_parser_stream_get_current_format(pin->wg_stream, &format); - memset(mt, 0, sizeof(AM_MEDIA_TYPE)); - if (amt_from_wg_format(mt, &format, false)) + if (amt_from_wg_format(mt, format, false)) { if (!index--) return S_OK; FreeMediaType(mt); } - if (format.major_type == WG_MAJOR_TYPE_VIDEO && index < ARRAY_SIZE(video_formats)) + if (format->major_type == WG_MAJOR_TYPE_VIDEO && index < ARRAY_SIZE(video_formats)) { - format.u.video.format = video_formats[index]; + format->u.video.format = video_formats[index]; /* Downstream filters probably expect RGB video to be bottom-up. */ - if (format.u.video.height > 0 && wg_video_format_is_rgb(video_formats[index])) - format.u.video.height = -format.u.video.height; - if (!amt_from_wg_format(mt, &format, false)) + if (format->u.video.height > 0 && wg_video_format_is_rgb(video_formats[index])) + format->u.video.height = -format->u.video.height; + if (!amt_from_wg_format(mt, format, false)) return E_OUTOFMEMORY; return S_OK; } - else if (format.major_type == WG_MAJOR_TYPE_AUDIO && !index) + else if (format->major_type == WG_MAJOR_TYPE_AUDIO && !index) { - format.u.audio.format = WG_AUDIO_FORMAT_S16LE; - if (!amt_from_wg_format(mt, &format, false)) + format->u.audio.format = WG_AUDIO_FORMAT_S16LE; + if (!amt_from_wg_format(mt, format, false)) return E_OUTOFMEMORY; return S_OK; } @@ -1710,6 +1705,17 @@ static HRESULT decodebin_parser_source_get_media_type(struct parser_source *pin, return VFW_S_NO_MORE_ITEMS; } +static HRESULT decodebin_parser_source_get_media_type(struct parser_source *pin, + unsigned int index, AM_MEDIA_TYPE *mt) +{ + struct wg_format format; + + TRACE("pin %p, index %d, mt %p.\n", pin, (int)index, mt); + + wg_parser_stream_get_current_format(pin->wg_stream, &format); + return get_raw_media_type(&format, index, mt); +} + static HRESULT parser_create(BOOL output_compressed, struct parser **parser) { struct parser *object; @@ -2286,6 +2292,8 @@ static HRESULT wave_parser_source_query_accept(struct parser_source *pin, const HRESULT hr; wg_parser_stream_get_current_format(pin->wg_stream, &format); + if (format.major_type == WG_MAJOR_TYPE_VIDEO || format.major_type == WG_MAJOR_TYPE_AUDIO) + return amt_to_wg_format(mt, &format) ? S_OK : S_FALSE; if (!amt_from_wg_format(&pad_mt, &format, false)) return E_OUTOFMEMORY; hr = compare_media_types(mt, &pad_mt) ? S_OK : S_FALSE; @@ -2298,9 +2306,11 @@ static HRESULT wave_parser_source_get_media_type(struct parser_source *pin, { struct wg_format format; + wg_parser_stream_get_current_format(pin->wg_stream, &format); + if (format.major_type == WG_MAJOR_TYPE_VIDEO || format.major_type == WG_MAJOR_TYPE_AUDIO) + return get_raw_media_type(&format, index, mt); if (index > 0) return VFW_S_NO_MORE_ITEMS; - wg_parser_stream_get_current_format(pin->wg_stream, &format); if (!amt_from_wg_format(mt, &format, false)) return E_OUTOFMEMORY; return S_OK; @@ -2367,6 +2377,8 @@ static HRESULT avi_splitter_source_query_accept(struct parser_source *pin, const HRESULT hr; wg_parser_stream_get_current_format(pin->wg_stream, &format); + if (format.major_type == WG_MAJOR_TYPE_VIDEO || format.major_type == WG_MAJOR_TYPE_AUDIO) + return amt_to_wg_format(mt, &format) ? S_OK : S_FALSE; if (!amt_from_wg_format(&pad_mt, &format, false)) return E_OUTOFMEMORY; hr = compare_media_types(mt, &pad_mt) ? S_OK : S_FALSE; @@ -2379,9 +2391,11 @@ static HRESULT avi_splitter_source_get_media_type(struct parser_source *pin, { struct wg_format format; + wg_parser_stream_get_current_format(pin->wg_stream, &format); + if (format.major_type == WG_MAJOR_TYPE_VIDEO || format.major_type == WG_MAJOR_TYPE_AUDIO) + return get_raw_media_type(&format, index, mt); if (index > 0) return VFW_S_NO_MORE_ITEMS; - wg_parser_stream_get_current_format(pin->wg_stream, &format); if (!amt_from_wg_format(mt, &format, false)) return E_OUTOFMEMORY; return S_OK; @@ -2506,6 +2520,8 @@ static HRESULT mpeg_splitter_source_query_accept(struct parser_source *pin, cons HRESULT hr; wg_parser_stream_get_current_format(pin->wg_stream, &format); + if (format.major_type == WG_MAJOR_TYPE_VIDEO || format.major_type == WG_MAJOR_TYPE_AUDIO) + return amt_to_wg_format(mt, &format) ? S_OK : S_FALSE; if (!amt_from_wg_format(&pad_mt, &format, false)) return E_OUTOFMEMORY; hr = compare_media_types(mt, &pad_mt) ? S_OK : S_FALSE; @@ -2518,9 +2534,11 @@ static HRESULT mpeg_splitter_source_get_media_type(struct parser_source *pin, { struct wg_format format; + wg_parser_stream_get_current_format(pin->wg_stream, &format); + if (format.major_type == WG_MAJOR_TYPE_VIDEO || format.major_type == WG_MAJOR_TYPE_AUDIO) + return get_raw_media_type(&format, index, mt); if (index > 0) return VFW_S_NO_MORE_ITEMS; - wg_parser_stream_get_current_format(pin->wg_stream, &format); if (!amt_from_wg_format(mt, &format, false)) return E_OUTOFMEMORY; return S_OK; From c1ee57e3d787485733ced1b16faef88de8616120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 27 Jan 2025 15:31:41 +0100 Subject: [PATCH 1088/2542] winegstreamer/media-converter: Try mediaconv even if compressed output is requested. CW-Bug-Id: #24739 --- dlls/winegstreamer/wg_parser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 9bf7b5ecd289..c4156dc891d1 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -1581,7 +1581,7 @@ static GstBusSyncReply bus_handler_cb(GstBus *bus, GstMessage *msg, gpointer use if (gst_structure_has_name(structure, "missing-plugin")) { pthread_mutex_lock(&parser->mutex); - if (!parser->use_mediaconv && !parser->output_compressed) + if (!parser->use_mediaconv) { GST_WARNING("Autoplugged element failed to initialise, trying again with protonvideoconvert."); parser->error = true; @@ -1818,7 +1818,7 @@ static NTSTATUS wg_parser_connect(void *args) if (ret == GST_STATE_CHANGE_FAILURE) { - if (!parser->use_mediaconv && !parser->output_compressed) + if (!parser->use_mediaconv) { GST_WARNING("Failed to play media, trying again with protonvideoconvert."); use_mediaconv = true; @@ -1834,7 +1834,7 @@ static NTSTATUS wg_parser_connect(void *args) pthread_cond_wait(&parser->init_cond, &parser->mutex); if (parser->error) { - if (!parser->use_mediaconv && !parser->output_compressed) + if (!parser->use_mediaconv) use_mediaconv = true; pthread_mutex_unlock(&parser->mutex); goto out; From 67633822442396fe8239c389e175fe2cc217ba17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 29 Jan 2025 16:22:29 +0100 Subject: [PATCH 1089/2542] winegstreamer/video_decoder: Support VP9 format decoding. CW-Bug-Id: #24789 --- dlls/winegstreamer/video_decoder.c | 1 + dlls/winegstreamer/wg_media_type.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/dlls/winegstreamer/video_decoder.c b/dlls/winegstreamer/video_decoder.c index 3a2deafe6853..3d51c2f6300c 100644 --- a/dlls/winegstreamer/video_decoder.c +++ b/dlls/winegstreamer/video_decoder.c @@ -1728,6 +1728,7 @@ static const GUID *const wmv_decoder_input_types[] = &MEDIASUBTYPE_VC1S, &MFVideoFormat_theora, &MFVideoFormat_AV1, + &MFVideoFormat_VP90, }; static const GUID *const wmv_decoder_output_types[] = { diff --git a/dlls/winegstreamer/wg_media_type.c b/dlls/winegstreamer/wg_media_type.c index 7038a9ed0e1d..eeb5b19bcb43 100644 --- a/dlls/winegstreamer/wg_media_type.c +++ b/dlls/winegstreamer/wg_media_type.c @@ -391,6 +391,14 @@ static void init_caps_from_video_av1(GstCaps *caps, const MFVIDEOFORMAT *format, gst_structure_set_name(gst_caps_get_structure(caps, 0), "video/x-av1"); } +static void init_caps_from_video_vp9(GstCaps *caps, const MFVIDEOFORMAT *format, UINT format_size) +{ + init_caps_codec_data(caps, format + 1, format_size - sizeof(*format)); + + gst_structure_remove_field(gst_caps_get_structure(caps, 0), "format"); + gst_structure_set_name(gst_caps_get_structure(caps, 0), "video/x-vp9"); +} + static void init_caps_from_video_subtype(GstCaps *caps, const GUID *subtype, const void *format, UINT format_size) { if (IsEqualGUID(subtype, &MFVideoFormat_CVID)) @@ -415,6 +423,8 @@ static void init_caps_from_video_subtype(GstCaps *caps, const GUID *subtype, con return init_caps_from_video_theora(caps, format, format_size); if (IsEqualGUID(subtype, &MFVideoFormat_AV1)) return init_caps_from_video_av1(caps, format, format_size); + if (IsEqualGUID(subtype, &MFVideoFormat_VP90)) + return init_caps_from_video_vp9(caps, format, format_size); GST_FIXME("Unsupported subtype " WG_GUID_FORMAT, WG_GUID_ARGS(*subtype)); } From 967ba17c000f0952b226459dda7242fa0e0faf3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 29 Jan 2025 16:22:59 +0100 Subject: [PATCH 1090/2542] HACK: wmvdecod: Advertize VP9 format decoding support. CW-Bug-Id: #24789 --- dlls/wmvdecod/wmvdecod.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/wmvdecod/wmvdecod.c b/dlls/wmvdecod/wmvdecod.c index 94ad04219bce..6932c89c6d61 100644 --- a/dlls/wmvdecod/wmvdecod.c +++ b/dlls/wmvdecod/wmvdecod.c @@ -68,6 +68,7 @@ HRESULT WINAPI DllRegisterServer(void) {MFMediaType_Video, MEDIASUBTYPE_VC1S}, {MFMediaType_Video, MFVideoFormat_theora}, {MFMediaType_Video, MFVideoFormat_AV1}, + {MFMediaType_Video, MFVideoFormat_VP90}, }; MFT_REGISTER_TYPE_INFO wmv_decoder_mft_outputs[] = { @@ -109,6 +110,7 @@ HRESULT WINAPI DllRegisterServer(void) {.type = MEDIATYPE_Video, .subtype = MEDIASUBTYPE_VC1S}, {.type = MEDIATYPE_Video, .subtype = MFVideoFormat_theora}, {.type = MEDIATYPE_Video, .subtype = MFVideoFormat_AV1}, + {.type = MEDIATYPE_Video, .subtype = MFVideoFormat_VP90}, }; HRESULT hr; From ed80e7f8d55f0930fe0e925dff046dfa1bd1cfbe Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 29 Nov 2023 17:02:43 -0600 Subject: [PATCH 1091/2542] ntdll: HACK: Try to load steamoverlay.so manually if LD_PRELOAD was lost. CW-Bug-Id: #23064 --- dlls/ntdll/unix/loader.c | 5 +++++ dlls/ntdll/unix/virtual.c | 31 ++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 62504277d84e..1b1fdaee9a51 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -631,6 +631,8 @@ NTSTATUS exec_wineloader( char **argv, int socketfd, const struct pe_image_info if (pe_info->wine_fakedll) res_start = res_end = 0; if (pe_info->image_flags & IMAGE_FLAGS_ComPlusNativeReady) machine = native_machine; + unsetenv( "WINE_LD_PRELOAD" ); + /* HACK: Unset LD_PRELOAD before executing explorer.exe to disable buggy gameoverlayrenderer.so */ if (ld_preload && argv[2] && !strcmp( argv[2], "C:\\windows\\system32\\explorer.exe" ) && argv[3] && !strcmp( argv[3], "/desktop" )) @@ -659,8 +661,11 @@ NTSTATUS exec_wineloader( char **argv, int socketfd, const struct pe_image_info while (*next); putenv( env ); + ld_preload = NULL; } + if (ld_preload) setenv( "WINE_LD_PRELOAD", ld_preload, 1 ); + signal( SIGPIPE, SIG_DFL ); snprintf( socket_env, sizeof(socket_env), "WINESERVERSOCKET=%u", socketfd ); diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index cbfe3fc16c47..3f9b8c89eda1 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -1014,6 +1014,30 @@ void *get_builtin_so_handle( void *module ) return ret; } +static void load_steam_overlay(const char *unix_lib_path) +{ + const char *preload, *p; + char path[PATH_MAX]; + unsigned int len; + void *handle; + + if (!strstr(unix_lib_path, "winex11.so")) return; + if (getenv("LD_PRELOAD") || !(preload = getenv("WINE_LD_PRELOAD"))) return; + + p = preload; + while (*(preload = p)) + { + p = strchrnul( preload, ':' ); + len = p - preload; + if (*p) ++p; + if (len + 1 > sizeof(path)) continue; + memcpy( path, preload, len ); + path[len] = 0; + if (!strstr( path, "gameoverlayrenderer.so" )) continue; + handle = dlopen( path, RTLD_NOW | RTLD_GLOBAL ); + FIXME( "HACK: tried to load %s, handle %p.\n", debugstr_a(path), handle ); + } +} /*********************************************************************** * get_builtin_unix_funcs @@ -1031,6 +1055,7 @@ static NTSTATUS get_builtin_unix_funcs( void *module, BOOL wow, const void **fun if (builtin->module != module) continue; if (builtin->unix_path && !builtin->unix_handle) { + load_steam_overlay(builtin->unix_path); builtin->unix_handle = dlopen( builtin->unix_path, RTLD_NOW ); if (!builtin->unix_handle) WARN_(module)( "failed to load %s: %s\n", debugstr_a(builtin->unix_path), dlerror() ); @@ -1062,7 +1087,11 @@ NTSTATUS load_builtin_unixlib( void *module, const char *name ) if (builtin->module != module) continue; if (!builtin->unix_path) builtin->unix_path = strdup( name ); else status = STATUS_IMAGE_ALREADY_LOADED; - if (!builtin->unix_handle) builtin->unix_handle = dlopen( builtin->unix_path, RTLD_NOW ); + if (!builtin->unix_handle) + { + load_steam_overlay(builtin->unix_path); + builtin->unix_handle = dlopen( builtin->unix_path, RTLD_NOW ); + } break; } server_leave_uninterrupted_section( &virtual_mutex, &sigset ); From f8bc156d55a03ef96c6c2a8e53e4ee98cdb28272 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 3 Feb 2025 16:51:05 -0600 Subject: [PATCH 1092/2542] win32u, winex11.drv: Avoid onscreen GL rendering for ULW windows. CW-Bug-Id: #19216 --- dlls/win32u/dce.c | 14 ++++++++++++++ dlls/win32u/window.c | 4 ++-- dlls/winex11.drv/init.c | 8 ++++++++ dlls/winex11.drv/opengl.c | 14 ++++++++++++++ include/wine/gdi_driver.h | 1 + 5 files changed, 39 insertions(+), 2 deletions(-) diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index 45ca912fb98a..e116cdc5c06c 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -570,6 +570,20 @@ W32KAPI void window_surface_release( struct window_surface *surface ) } } +W32KAPI struct window_surface *window_surface_get( HWND hwnd ) +{ + struct window_surface *surface = NULL; + WND *win = get_win_ptr( hwnd ); + + if (win && win != WND_DESKTOP && win != WND_OTHER_PROCESS) + { + if ((surface = win->surface)) + window_surface_add_ref( surface ); + release_win_ptr( win ); + } + return surface; +} + W32KAPI void window_surface_lock( struct window_surface *surface ) { if (surface == &dummy_surface) return; diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index e9d3ee75b4b0..591b3b144119 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -2123,8 +2123,8 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru } if (new_surface) req->paint_flags |= SET_WINPOS_PAINT_SURFACE; if (is_layered) req->paint_flags |= SET_WINPOS_LAYERED_WINDOW; - if (win->pixel_format || win->internal_pixel_format) - req->paint_flags |= SET_WINPOS_PIXEL_FORMAT; + else if (win->pixel_format || win->internal_pixel_format) + req->paint_flags |= SET_WINPOS_PIXEL_FORMAT; if ((ret = !wine_server_call( req ))) { diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 25ddbd2095e2..45c405a51059 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -220,6 +220,7 @@ static BOOL needs_client_window_clipping( HWND hwnd ) BOOL needs_offscreen_rendering( HWND hwnd, BOOL known_child, BOOL check_gamma ) { static int no_child_clipping_cached = -1; + struct window_surface *surface; UINT style = NtUserGetWindowLongW( hwnd, GWL_STYLE ); struct x11drv_win_data *data; @@ -239,6 +240,13 @@ BOOL needs_offscreen_rendering( HWND hwnd, BOOL known_child, BOOL check_gamma ) needs_offscreen = (style & WS_VISIBLE) && !(style & WS_MINIMIZE) && !is_window_rect_mapped( &data->rects.visible ); release_win_data( data ); } + if (!needs_offscreen && (surface = window_surface_get( hwnd ))) + { + TRACE("hwnd %p, surface %p, surface->alpha_mask %#x.\n", hwnd, surface, surface->alpha_mask); + /* 3d drawing to ULW window never gets onscreen directly, only though UpdateLayeredWindow(). */ + needs_offscreen = !!surface->alpha_mask; + window_surface_release( surface ); + } if (needs_offscreen) return needs_offscreen; if (NtUserGetDpiForWindow( hwnd ) != NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index ff7b7fa5dc48..4df0255548f4 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -3204,6 +3204,7 @@ static BOOL glxdrv_wglShareLists(struct wgl_context *org, struct wgl_context *de static void present_gl_drawable( HWND hwnd, HDC hdc, struct gl_drawable *gl, BOOL flush, BOOL gl_finish ) { HWND toplevel = NtUserGetAncestor( hwnd, GA_ROOT ); + struct window_surface *surface; Drawable window, drawable; RECT rect_dst, rect; HRGN region; @@ -3215,6 +3216,19 @@ static void present_gl_drawable( HWND hwnd, HDC hdc, struct gl_drawable *gl, BOO case DC_GL_CHILD_WIN: drawable = gl->window; break; default: drawable = 0; break; } + + if (hwnd && (surface = window_surface_get( hwnd ))) + { + TRACE("surface %p, alpha_mask %#x.\n", surface, surface->alpha_mask); + if (surface->alpha_mask) + { + /* GL drawing to ULW window never gets onscreen directly, only though UpdateLayeredWindow(). */ + window_surface_release( surface ); + if (!drawable) sync_gl_drawable( hwnd, FALSE ); + return; + } + } + if (!drawable) return; window = get_onscreen_drawable( hwnd, toplevel, &rect_dst ); region = get_dc_monitor_region( hwnd, hdc ); diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index d1e4e9e39038..c018ab4c8a0b 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -290,6 +290,7 @@ W32KAPI void window_surface_flush( struct window_surface *surface ); W32KAPI void window_surface_set_clip( struct window_surface *surface, HRGN clip_region ); W32KAPI void window_surface_set_shape( struct window_surface *surface, HRGN shape_region ); W32KAPI void window_surface_set_layered( struct window_surface *surface, COLORREF color_key, UINT alpha_bits, UINT alpha_mask ); +W32KAPI struct window_surface *window_surface_get( HWND hwnd ); /* display manager interface, used to initialize display device registry data */ From 9495688ea3f421e04ee48ca984dadfe220127f9d Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 3 Feb 2025 16:36:49 -0600 Subject: [PATCH 1093/2542] winex11.drv: Present GL image to surface if non-ULW surface exists. CW-Bug-Id: #24788 --- dlls/winex11.drv/opengl.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 4df0255548f4..28d2858d71d3 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1887,7 +1887,11 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct glx_pixel visual->class == DirectColor) ? AllocAll : AllocNone ); gl->window = create_client_window( hwnd, gl->rect, visual, gl->colormap ); if (gl->window) + { gl->drawable = pglXCreateWindow( gdi_display, gl->format->fbconfig, gl->window, NULL ); + gl->hdc_src = NtGdiOpenDCW( &device_str, NULL, NULL, 0, TRUE, NULL, NULL, NULL ); + set_dc_drawable( gl->hdc_src, gl->window, &gl->rect, IncludeInferiors ); + } gl->fs_hack = enable_fshack; TRACE( "%p created client %lx drawable %lx\n", hwnd, gl->window, gl->drawable ); if (gl->fs_hack) WARN( "Window %p has the fullscreen hack enabled\n", hwnd ); @@ -3219,6 +3223,8 @@ static void present_gl_drawable( HWND hwnd, HDC hdc, struct gl_drawable *gl, BOO if (hwnd && (surface = window_surface_get( hwnd ))) { + HDC hdc_dst; + TRACE("surface %p, alpha_mask %#x.\n", surface, surface->alpha_mask); if (surface->alpha_mask) { @@ -3227,6 +3233,16 @@ static void present_gl_drawable( HWND hwnd, HDC hdc, struct gl_drawable *gl, BOO if (!drawable) sync_gl_drawable( hwnd, FALSE ); return; } + WARN( "surface is present on non-ULW window.\n" ); + hdc_dst = NtUserGetDCEx( hwnd, 0, DCX_CACHE | DCX_USESTYLE ); + region = get_dc_monitor_region( hwnd, hdc ); + if (region) NtGdiExtSelectClipRgn( hdc_dst, region, RGN_COPY ); + NtGdiStretchBlt( hdc_dst, 0, 0, gl->rect.right - gl->rect.left, gl->rect.bottom - gl->rect.top, + gl->hdc_src, 0, 0, gl->rect.right, gl->rect.bottom, SRCCOPY, 0 ); + NtUserReleaseDC( hwnd, hdc_dst ); + if (region) NtGdiDeleteObjectApp( region ); + window_surface_release( surface ); + return; } if (!drawable) return; From 75f781b28c70e4bebcc23a37164c0b04ae690eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 4 Feb 2025 17:11:57 +0100 Subject: [PATCH 1094/2542] HACK: win32u: Ignore host monitor work rectangles. Similar to what Proton 9 fullscreen hack was doing. CW-Bug-Id: #24774 --- dlls/win32u/sysparams.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 5b7b916046cc..74b15619866d 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1996,6 +1996,13 @@ static void monitor_get_info( struct monitor *monitor, MONITORINFO *info, UINT d info->rcWork = map_dpi_rect( monitor->rc_work, monitor_get_dpi( monitor, MDT_DEFAULT, &x, &y ), dpi ); info->dwFlags = is_monitor_primary( monitor ) ? MONITORINFOF_PRIMARY : 0; + /* HACK: Ignore host work area when emulating modeset, it needs to be DPI mapped but it also + * regresses Imperiums: Greek Wars fullscreen mode. The game uses maximized windows, which should + * be restricted to the work area too but somehow Windows decides to make them fullscreen instead. + * We were not passing the host work area in older Proton versions, lets do that for now. + */ + if (emulate_modeset || user_driver->pHasWindowManager( "steamcompmgr" )) info->rcWork = info->rcMonitor; + if (info->cbSize >= sizeof(MONITORINFOEXW)) { char buffer[CCHDEVICENAME]; From 92b9c779a2df4a245456b302518fe4065fe173db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 5 Feb 2025 13:49:15 +0100 Subject: [PATCH 1095/2542] HACK: winex11: Avoid requesting NET_WM_STATE_FULLSCREEN with gamescope. CW-Bug-Id: #24718 --- dlls/winex11.drv/window.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 3ffda2768583..f4b35337c163 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1233,6 +1233,12 @@ static void window_set_net_wm_state( struct x11drv_win_data *data, UINT new_stat static const UINT fullscreen_mask = (1 << NET_WM_STATE_MAXIMIZED) | (1 << NET_WM_STATE_FULLSCREEN); UINT i, count, old_state = data->pending_state.net_wm_state, net_wm_bypass_compositor = 0; + /* Gamescope advertises _NET_WM_STATE_FULLSCREEN support but it then breaks its modeset emulation: + * Instead of upscaling the windows, it will make them cover the entire screen, increasing their + * pixel size even if the display mode is supposed to be at a lower resolution. + */ + if (X11DRV_HasWindowManager( "steamcompmgr" )) new_state &= ~(1 << NET_WM_STATE_FULLSCREEN); + new_state &= x11drv_thread_data()->net_wm_state_mask; data->desired_state.net_wm_state = new_state; if (!data->whole_window) return; /* no window, nothing to update */ From 6046e7bb5ab20fa775b1d50b8a634a7a5eeaa584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 5 Feb 2025 13:52:09 +0100 Subject: [PATCH 1096/2542] HACK: winex11: Don't expect WM_STATE property change with gamescope. Link: https://github.com/ValveSoftware/gamescope/pull/1730 Link: https://github.com/ValveSoftware/gamescope/pull/1731 --- dlls/winex11.drv/window.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index f4b35337c163..6fe9ea85a137 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1587,6 +1587,12 @@ static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state, U /* override redirect windows won't receive WM_STATE property changes */ if (!data->managed) data->wm_state_serial = 0; + /* Gamescope has broken ICCCM support, and never sets the WM_STATE property. + * Still, it changes it to NormalState on IconifyWindow, or when giving focus to a window so we will + * mostly only lack response for transitions to Withdrawn and shouldn't wait for it. + */ + if (X11DRV_HasWindowManager( "steamcompmgr" ) && new_state == WithdrawnState) data->wm_state_serial = 0; + XFlush( data->display ); } From 611ef3e0db2b25464e1b995758aa5faa27cb94df Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 5 Feb 2025 11:49:57 -0600 Subject: [PATCH 1097/2542] ntdll: Zero terminate return string for NtQueryInformationProcess( ProcessImageFileName[Win32] ). CW-Bug-Id: #24833 --- dlls/ntdll/tests/info.c | 6 ++++++ dlls/ntdll/unix/process.c | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index 94dbecf0123a..7ee6d8c22c18 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -2384,8 +2384,11 @@ static void test_query_process_image_file_name(void) ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx\n", status); buffer = malloc(ReturnLength); + memset( buffer, 0xcc, ReturnLength ); status = NtQueryInformationProcess( GetCurrentProcess(), ProcessImageFileName, buffer, ReturnLength, &ReturnLength); ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08lx\n", status); + ok( buffer->MaximumLength == buffer->Length + sizeof(WCHAR), "got %u, %u.\n", buffer->Length, buffer->MaximumLength ); + ok ( !buffer->Buffer[buffer->Length / sizeof(WCHAR)], "got %#x.\n", buffer->Buffer[buffer->Length / sizeof(WCHAR)] ); todo_wine ok(!memcmp(buffer->Buffer, deviceW, sizeof(deviceW)), "Expected image name to begin with \\Device\\, got %s\n", @@ -2407,8 +2410,11 @@ static void test_query_process_image_file_name(void) ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx\n", status); buffer = malloc(ReturnLength); + memset( buffer, 0xcc, ReturnLength ); status = NtQueryInformationProcess( GetCurrentProcess(), ProcessImageFileNameWin32, buffer, ReturnLength, &ReturnLength); ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08lx\n", status); + ok( buffer->MaximumLength == buffer->Length + sizeof(WCHAR), "got %u, %u.\n", buffer->Length, buffer->MaximumLength ); + ok ( !buffer->Buffer[buffer->Length / sizeof(WCHAR)], "got %#x.\n", buffer->Buffer[buffer->Length / sizeof(WCHAR)] ); ok(memcmp(buffer->Buffer, deviceW, sizeof(deviceW)), "Expected image name not to begin with \\Device\\, got %s\n", wine_dbgstr_wn(buffer->Buffer, buffer->Length / sizeof(WCHAR))); diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c index 9479378a7531..a49573420273 100644 --- a/dlls/ntdll/unix/process.c +++ b/dlls/ntdll/unix/process.c @@ -1500,19 +1500,22 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class case ProcessImageFileNameWin32: SERVER_START_REQ( get_process_image_name ) { + const unsigned int min_size = sizeof(UNICODE_STRING) + sizeof(WCHAR); UNICODE_STRING *str = info; req->handle = wine_server_obj_handle( handle ); req->win32 = (class == ProcessImageFileNameWin32); wine_server_set_reply( req, str ? str + 1 : NULL, - size > sizeof(UNICODE_STRING) ? size - sizeof(UNICODE_STRING) : 0 ); + size > min_size ? size - min_size : 0 ); ret = wine_server_call( req ); if (ret == STATUS_BUFFER_TOO_SMALL) ret = STATUS_INFO_LENGTH_MISMATCH; - len = sizeof(UNICODE_STRING) + reply->len; + len = min_size + reply->len; if (ret == STATUS_SUCCESS) { - str->MaximumLength = str->Length = reply->len; + str->Length = reply->len; + str->MaximumLength = str->Length + sizeof(WCHAR); str->Buffer = (PWSTR)(str + 1); + str->Buffer[str->Length / sizeof(WCHAR)] = 0; } } SERVER_END_REQ; From ad6500ce69eaaca41691d42a4901e99544647c75 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 19 Dec 2024 14:26:43 -0600 Subject: [PATCH 1098/2542] ieframe: HACK: Pump window messages in async_doc_navigate() for Marvel Rivals. CW-Bug-Id: #24590 --- dlls/ieframe/navigate.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/dlls/ieframe/navigate.c b/dlls/ieframe/navigate.c index 48cd59979396..ad175537ccef 100644 --- a/dlls/ieframe/navigate.c +++ b/dlls/ieframe/navigate.c @@ -851,6 +851,31 @@ static void doc_navigate_proc(DocHost *This, task_header_t *t) } } +static void hack_pump_messages(void) +{ + static int enabled = -1; + MSG msg; + + if (enabled == -1) + { + const char *sgi = getenv("SteamGameId"); + + enabled = sgi && !strcmp(sgi, "2767030"); + if (enabled) + ERR("HACK: injecting PeekMessage loop in async_doc_navigate.\n"); + } + + if (!enabled) + return; + + while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) + { + TRACE("dispatching.\n"); + DispatchMessageW(&msg); + } + TRACE("no more messages.\n"); +} + static HRESULT async_doc_navigate(DocHost *This, LPCWSTR url, LPCWSTR headers, PBYTE post_data, ULONG post_data_size, BOOL async_notif) { @@ -899,6 +924,7 @@ static HRESULT async_doc_navigate(DocHost *This, LPCWSTR url, LPCWSTR headers, P task->async_notif = async_notif; abort_dochost_tasks(This, doc_navigate_proc); + hack_pump_messages(); push_dochost_task(This, &task->header, doc_navigate_proc, doc_navigate_task_destr, FALSE); return S_OK; } From 9491b1cb5004b7807428755d7b6d2e8d9775e812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 6 Feb 2025 16:37:23 +0100 Subject: [PATCH 1099/2542] HACK: winex11: Don't ignore FocusIn events with gamescope. It doesn't implement WM_TAKE_FOCUS, and forcefully sets focus instead. CW-Bug-Id: #24831 --- dlls/winex11.drv/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index c84c23b60486..aa211eb816c3 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -921,7 +921,7 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev ) xim_set_focus( hwnd, TRUE ); - if (use_take_focus) return TRUE; + if (use_take_focus && !X11DRV_HasWindowManager( "steamcompmgr" )) return TRUE; if (!can_activate_window(hwnd)) { From 845a960d64af3989655cdcc5d1bedc19d422e1cc Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 6 Feb 2025 14:58:46 -0600 Subject: [PATCH 1100/2542] win32u: Update Vulkan surfaces in apply_window_pos(). CW-Bug-Id: #24738 --- dlls/win32u/window.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 591b3b144119..a8402d24f860 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -2220,6 +2220,7 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru get_driver_window_surface( new_surface, raw_dpi ) ); update_children_window_state( hwnd ); + vulkan_update_surfaces( hwnd ); } return ret; From 6f5787c4a3ceab5218225c0ecc6b86d54c7fbc2d Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Thu, 6 Feb 2025 10:39:15 +0200 Subject: [PATCH 1101/2542] jscript: Fix JSON.stringify for arrays longer than 10. We've been passing `ARRAY_SIZE()` (equal to 16 in this case) as a radix to _itow(). This has caused us trying to get "a" instead of "10", etc. which resulted in unexpected nulls being interspersed in long arrays as well as the arrays being cut short. (cherry picked from commit f8f119f565581923e23cb8a18e2ed8a213df59f8) --- dlls/jscript/json.c | 2 +- dlls/jscript/tests/api.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/jscript/json.c b/dlls/jscript/json.c index 9018687aba26..093bd5bf386e 100644 --- a/dlls/jscript/json.c +++ b/dlls/jscript/json.c @@ -707,7 +707,7 @@ static HRESULT stringify_array(stringify_ctx_t *ctx, jsdisp_t *obj) } } - _itow(i, name, ARRAY_SIZE(name)); + _itow_s(i, name, ARRAY_SIZE(name), 10); hres = stringify(ctx, obj, name); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 255418a6744a..aea7cac63dc3 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -1965,7 +1965,8 @@ ok(isNaN(tmp), "Math.tan(-Infinity) is not NaN"); "{\n \"prop1\": true,\n \"prop2\": {\n \"prop\": \"string\"\n }\n}"], [[{ },undefined," "], "{}"], [[[,2,undefined,3,{ },]],"[null,2,null,3,{},null]"], - [[[,2,undefined,3,{prop:0},],undefined," "],"[\n null,\n 2,\n null,\n 3,\n {\n \"prop\": 0\n },\n null\n]"] + [[[,2,undefined,3,{prop:0},],undefined," "],"[\n null,\n 2,\n null,\n 3,\n {\n \"prop\": 0\n },\n null\n]"], + [[[0,0,0,0,0,0,0,0,0,0,0,0]], "[0,0,0,0,0,0,0,0,0,0,0,0]"] ]; var i, s, v, t; From 9280df164d88530b4089df64072825532ce4865b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 21 Jan 2025 12:55:46 -0600 Subject: [PATCH 1102/2542] ntdll: Add NtConvertBetweenAuxiliaryCounterAndPerformanceCounter() function. (cherry picked from commit 2d1cd1b0607305acec55f688e173e3fec4cdb390) CW-Bug-Id: #24736 --- dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/signal_arm64ec.c | 1 + dlls/ntdll/tests/time.c | 36 ++++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/sync.c | 12 ++++++++++++ dlls/wow64/sync.c | 14 ++++++++++++++ include/winternl.h | 1 + 6 files changed, 65 insertions(+) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index a8aa3a7e9949..4ac3ce4dc363 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -170,6 +170,7 @@ @ stdcall -syscall NtConnectPort(ptr ptr ptr ptr ptr ptr ptr ptr) @ stdcall -syscall NtContinue(ptr long) @ stdcall -syscall NtContinueEx(ptr ptr) +@ stdcall -syscall NtConvertBetweenAuxiliaryCounterAndPerformanceCounter(long ptr ptr ptr) @ stdcall -syscall NtCreateDebugObject(ptr long ptr long) @ stdcall -syscall NtCreateDirectoryObject(ptr long ptr) @ stdcall -syscall NtCreateEvent(ptr long ptr long long) diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index 5ff836ee2dcc..13d92bee67a7 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -370,6 +370,7 @@ DEFINE_SYSCALL(NtCompleteConnectPort, (HANDLE handle)) DEFINE_SYSCALL(NtConnectPort, (HANDLE *handle, UNICODE_STRING *name, SECURITY_QUALITY_OF_SERVICE *qos, LPC_SECTION_WRITE *write, LPC_SECTION_READ *read, ULONG *max_len, void *info, ULONG *info_len)) DEFINE_WRAPPED_SYSCALL(NtContinue, (ARM64_NT_CONTEXT *context, BOOLEAN alertable)) DEFINE_WRAPPED_SYSCALL(NtContinueEx, (ARM64_NT_CONTEXT *context, KCONTINUE_ARGUMENT *args)) +DEFINE_SYSCALL(NtConvertBetweenAuxiliaryCounterAndPerformanceCounter, (ULONG flag, ULONGLONG *from, ULONGLONG *to, ULONGLONG *error)) DEFINE_SYSCALL(NtCreateDebugObject, (HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBUTES *attr, ULONG flags)) DEFINE_SYSCALL(NtCreateDirectoryObject, (HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBUTES *attr)) DEFINE_SYSCALL(NtCreateEvent, (HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN state)) diff --git a/dlls/ntdll/tests/time.c b/dlls/ntdll/tests/time.c index f2ea90ab4ed8..c843f7642825 100644 --- a/dlls/ntdll/tests/time.c +++ b/dlls/ntdll/tests/time.c @@ -45,6 +45,8 @@ static BOOL (WINAPI *pRtlQueryUnbiasedInterruptTime)( ULONGLONG *time ); static BOOL (WINAPI *pRtlQueryPerformanceCounter)(LARGE_INTEGER*); static BOOL (WINAPI *pRtlQueryPerformanceFrequency)(LARGE_INTEGER*); +static NTSTATUS (WINAPI *pNtConvertBetweenAuxiliaryCounterAndPerformanceCounter)(ULONG, ULONGLONG *, ULONGLONG *, ULONGLONG *); + static const int MonthLengths[2][12] = { { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, @@ -479,6 +481,37 @@ static void test_user_shared_data_time(void) t1, timeofday.TimeZoneBias.QuadPart); } +static void test_NtConvertBetweenAuxiliaryCounterAndPerformanceCounter(void) +{ + ULONGLONG qpc, error, value; + NTSTATUS status; + + if (!pNtConvertBetweenAuxiliaryCounterAndPerformanceCounter) + { + win_skip("NtConvertBetweenAuxiliaryCounterAndPerformanceCounter not found.\n"); + return; + } + + status = pNtConvertBetweenAuxiliaryCounterAndPerformanceCounter(0, NULL, NULL, NULL); + ok(status == STATUS_ACCESS_VIOLATION, "got %#lx.\n", status); + qpc = error = value = 0xdeadbeef; + status = pNtConvertBetweenAuxiliaryCounterAndPerformanceCounter(0, &value, &qpc, NULL); + ok(status == STATUS_NOT_SUPPORTED, "got %#lx.\n", status); + ok(value == 0xdeadbeef, "got %#I64x.\n", value); + ok(qpc == 0xdeadbeef, "got %#I64x.\n", qpc); + ok(error == 0xdeadbeef, "got %#I64x.\n", error); + status = pNtConvertBetweenAuxiliaryCounterAndPerformanceCounter(1, &value, &qpc, &error); + ok(status == STATUS_NOT_SUPPORTED, "got %#lx.\n", status); + ok(value == 0xdeadbeef, "got %#I64x.\n", value); + ok(qpc == 0xdeadbeef, "got %#I64x.\n", qpc); + ok(error == 0xdeadbeef, "got %#I64x.\n", error); + status = pNtConvertBetweenAuxiliaryCounterAndPerformanceCounter(2, &value, &qpc, &error); + ok(status == STATUS_NOT_SUPPORTED, "got %#lx.\n", status); + ok(value == 0xdeadbeef, "got %#I64x.\n", value); + ok(qpc == 0xdeadbeef, "got %#I64x.\n", qpc); + ok(error == 0xdeadbeef, "got %#I64x.\n", error); +} + START_TEST(time) { HMODULE mod = GetModuleHandleA("ntdll.dll"); @@ -493,6 +526,8 @@ START_TEST(time) pRtlQueryUnbiasedInterruptTime = (void *)GetProcAddress(mod, "RtlQueryUnbiasedInterruptTime"); pRtlQueryPerformanceCounter = (void *)GetProcAddress(mod, "RtlQueryPerformanceCounter"); pRtlQueryPerformanceFrequency = (void *)GetProcAddress(mod, "RtlQueryPerformanceFrequency"); + pNtConvertBetweenAuxiliaryCounterAndPerformanceCounter = + (void *)GetProcAddress(mod, "NtConvertBetweenAuxiliaryCounterAndPerformanceCounter"); if (pRtlTimeToTimeFields && pRtlTimeFieldsToTime) test_pRtlTimeToTimeFields(); @@ -505,4 +540,5 @@ START_TEST(time) test_RtlQueryPerformanceCounter(); #endif test_TimerResolution(); + test_NtConvertBetweenAuxiliaryCounterAndPerformanceCounter(); } diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 5e7e458958f0..47fd5b24c467 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -2973,3 +2973,15 @@ NTSTATUS WINAPI NtRollbackTransaction( HANDLE transaction, BOOLEAN wait ) return STATUS_ACCESS_VIOLATION; } + +/*********************************************************************** + * NtConvertBetweenAuxiliaryCounterAndPerformanceCounter (NTDLL.@) + */ +NTSTATUS WINAPI NtConvertBetweenAuxiliaryCounterAndPerformanceCounter( ULONG flag, ULONGLONG *from, ULONGLONG *to, ULONGLONG *error ) +{ + FIXME( "%#x, %p, %p, %p.\n", (int)flag, from, to, error ); + + if (!from) return STATUS_ACCESS_VIOLATION; + + return STATUS_NOT_SUPPORTED; +} diff --git a/dlls/wow64/sync.c b/dlls/wow64/sync.c index 54dca19dc1a3..9076f5dd871a 100644 --- a/dlls/wow64/sync.c +++ b/dlls/wow64/sync.c @@ -1804,3 +1804,17 @@ NTSTATUS WINAPI wow64_NtRollbackTransaction( UINT *args ) return NtRollbackTransaction( handle, wait ); } + + +/********************************************************************** + * wow64_NtConvertBetweenAuxiliaryCounterAndPerformanceCounter + */ +NTSTATUS WINAPI wow64_NtConvertBetweenAuxiliaryCounterAndPerformanceCounter( UINT *args ) +{ + ULONG flags = get_ulong( &args ); + ULONGLONG *from = get_ptr( &args ); + ULONGLONG *to = get_ptr( &args ); + ULONGLONG *error = get_ptr( &args ); + + return NtConvertBetweenAuxiliaryCounterAndPerformanceCounter( flags, from, to, error ); +} diff --git a/include/winternl.h b/include/winternl.h index 935e030e1c51..be01f3b31d08 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -4533,6 +4533,7 @@ NTSYSAPI NTSTATUS WINAPI NtCompleteConnectPort(HANDLE); NTSYSAPI NTSTATUS WINAPI NtConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PLPC_SECTION_READ,PULONG,PVOID,PULONG); NTSYSAPI NTSTATUS WINAPI NtContinue(PCONTEXT,BOOLEAN); NTSYSAPI NTSTATUS WINAPI NtContinueEx(CONTEXT*,KCONTINUE_ARGUMENT*); +NTSYSAPI NTSTATUS WINAPI NtConvertBetweenAuxiliaryCounterAndPerformanceCounter(ULONG,ULONGLONG*,ULONGLONG*,ULONGLONG*); NTSYSAPI NTSTATUS WINAPI NtCreateDebugObject(HANDLE*,ACCESS_MASK,OBJECT_ATTRIBUTES*,ULONG); NTSYSAPI NTSTATUS WINAPI NtCreateDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES); NTSYSAPI NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,EVENT_TYPE,BOOLEAN); From dede8a0ba6b2dab71849aecda5eb49e43ed04de3 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 21 Jan 2025 13:11:25 -0600 Subject: [PATCH 1103/2542] kernelbase: Add ConvertAuxiliaryCounterToPerformanceCounter() / ConvertPerformanceCounterToAuxiliaryCounter(). (cherry picked from commit d48e8e6a77a285024abed960b6c1ad00e3e7126c) CW-Bug-Id: #24736 --- dlls/kernelbase/kernelbase.spec | 2 ++ dlls/kernelbase/sync.c | 32 ++++++++++++++++++++++++++++++++ dlls/ntdll/tests/time.c | 18 ++++++++++++++++++ 3 files changed, 52 insertions(+) diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index 1e22dda5d7df..2d4d117bb37a 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -162,8 +162,10 @@ @ stdcall CompareStringW(long long wstr long wstr long) @ stdcall ConnectNamedPipe(long ptr) @ stdcall ContinueDebugEvent(long long long) +@ stdcall ConvertAuxiliaryCounterToPerformanceCounter(int64 ptr ptr) @ stdcall ConvertDefaultLocale(long) @ stdcall ConvertFiberToThread() +@ stdcall ConvertPerformanceCounterToAuxiliaryCounter(int64 ptr ptr) @ stdcall ConvertThreadToFiber(ptr) @ stdcall ConvertThreadToFiberEx(ptr long) @ stdcall ConvertToAutoInheritPrivateObjectSecurity(ptr ptr ptr ptr long ptr) diff --git a/dlls/kernelbase/sync.c b/dlls/kernelbase/sync.c index 2fffd3ead795..4c7efc359f22 100644 --- a/dlls/kernelbase/sync.c +++ b/dlls/kernelbase/sync.c @@ -271,6 +271,38 @@ BOOL WINAPI QueryIdleProcessorCycleTimeEx( USHORT group_id, ULONG *size, ULONG64 } +/*********************************************************************** + * ConvertAuxiliaryCounterToPerformanceCounter (kernelbase.@) + */ +HRESULT WINAPI ConvertAuxiliaryCounterToPerformanceCounter( ULONGLONG from, ULONGLONG *to, ULONGLONG *error ) +{ + NTSTATUS status; + + TRACE( "%#I64x, %p, %p.\n", from, to, error ); + + if ((status = NtConvertBetweenAuxiliaryCounterAndPerformanceCounter( 0, &from, to, error )) == STATUS_NOT_SUPPORTED) + return E_NOTIMPL; + + return HRESULT_FROM_NT(status); +} + + +/*********************************************************************** + * ConvertAuxiliaryCounterToPerformanceCounter (kernelbase.@) + */ +HRESULT WINAPI ConvertPerformanceCounterToAuxiliaryCounter( ULONGLONG from, ULONGLONG *to, ULONGLONG *error ) +{ + NTSTATUS status; + + TRACE( "%#I64x, %p, %p.\n", from, to, error ); + + if ((status = NtConvertBetweenAuxiliaryCounterAndPerformanceCounter( 1, &from, to, error )) == STATUS_NOT_SUPPORTED) + return E_NOTIMPL; + + return HRESULT_FROM_NT(status); +} + + /*********************************************************************** * Waits ***********************************************************************/ diff --git a/dlls/ntdll/tests/time.c b/dlls/ntdll/tests/time.c index c843f7642825..bb0079b08235 100644 --- a/dlls/ntdll/tests/time.c +++ b/dlls/ntdll/tests/time.c @@ -46,6 +46,8 @@ static BOOL (WINAPI *pRtlQueryPerformanceCounter)(LARGE_INTEGER*); static BOOL (WINAPI *pRtlQueryPerformanceFrequency)(LARGE_INTEGER*); static NTSTATUS (WINAPI *pNtConvertBetweenAuxiliaryCounterAndPerformanceCounter)(ULONG, ULONGLONG *, ULONGLONG *, ULONGLONG *); +static HRESULT (WINAPI *pConvertAuxiliaryCounterToPerformanceCounter)(ULONGLONG, ULONGLONG *, ULONGLONG *); +static HRESULT (WINAPI *pConvertPerformanceCounterToAuxiliaryCounter)(ULONGLONG, ULONGLONG *, ULONGLONG *); static const int MonthLengths[2][12] = { @@ -485,6 +487,7 @@ static void test_NtConvertBetweenAuxiliaryCounterAndPerformanceCounter(void) { ULONGLONG qpc, error, value; NTSTATUS status; + HRESULT hr; if (!pNtConvertBetweenAuxiliaryCounterAndPerformanceCounter) { @@ -510,11 +513,23 @@ static void test_NtConvertBetweenAuxiliaryCounterAndPerformanceCounter(void) ok(value == 0xdeadbeef, "got %#I64x.\n", value); ok(qpc == 0xdeadbeef, "got %#I64x.\n", qpc); ok(error == 0xdeadbeef, "got %#I64x.\n", error); + + hr = pConvertAuxiliaryCounterToPerformanceCounter(1, &qpc, &error); + ok(hr == E_NOTIMPL, "got %#lx.\n", hr); + ok(value == 0xdeadbeef, "got %#I64x.\n", value); + ok(qpc == 0xdeadbeef, "got %#I64x.\n", qpc); + ok(error == 0xdeadbeef, "got %#I64x.\n", error); + QueryPerformanceCounter((LARGE_INTEGER *)&qpc); + hr = pConvertPerformanceCounterToAuxiliaryCounter(qpc, &value, &error); + ok(hr == E_NOTIMPL, "got %#lx.\n", hr); + ok(value == 0xdeadbeef, "got %#I64x.\n", value); + ok(error == 0xdeadbeef, "got %#I64x.\n", error); } START_TEST(time) { HMODULE mod = GetModuleHandleA("ntdll.dll"); + HMODULE hkernelbase = GetModuleHandleA("kernelbase.dll"); pRtlTimeToTimeFields = (void *)GetProcAddress(mod,"RtlTimeToTimeFields"); pRtlTimeFieldsToTime = (void *)GetProcAddress(mod,"RtlTimeFieldsToTime"); pNtQueryPerformanceCounter = (void *)GetProcAddress(mod, "NtQueryPerformanceCounter"); @@ -529,6 +544,9 @@ START_TEST(time) pNtConvertBetweenAuxiliaryCounterAndPerformanceCounter = (void *)GetProcAddress(mod, "NtConvertBetweenAuxiliaryCounterAndPerformanceCounter"); + pConvertAuxiliaryCounterToPerformanceCounter = (void *)GetProcAddress(hkernelbase, "ConvertAuxiliaryCounterToPerformanceCounter"); + pConvertPerformanceCounterToAuxiliaryCounter = (void *)GetProcAddress(hkernelbase, "ConvertPerformanceCounterToAuxiliaryCounter"); + if (pRtlTimeToTimeFields && pRtlTimeFieldsToTime) test_pRtlTimeToTimeFields(); else From a717a6f82caef6287793b210e3e06a1cd082f397 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 28 Jan 2025 12:40:12 +0100 Subject: [PATCH 1104/2542] win32u: Implement NtUserDestroyCaret(). (cherry picked from commit ff0a5c7e75362745cfbdd1be8a26224358888bed) CW-Bug-Id: #24755 --- dlls/user32/edit.c | 4 ++-- dlls/user32/input.c | 9 --------- dlls/user32/user32.spec | 2 +- dlls/win32u/input.c | 4 ++-- dlls/win32u/main.c | 5 +++++ dlls/win32u/scroll.c | 2 +- dlls/win32u/sysparams.c | 3 --- dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 1 - dlls/win32u/window.c | 2 +- dlls/wow64win/user.c | 5 +++++ include/ntuser.h | 7 +------ 12 files changed, 19 insertions(+), 27 deletions(-) diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index e40743a419b6..92489152f3a9 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -3572,7 +3572,7 @@ static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key) static LRESULT EDIT_WM_KillFocus(EDITSTATE *es) { es->flags &= ~EF_FOCUSED; - DestroyCaret(); + NtUserDestroyCaret(); if(!(es->style & ES_NOHIDESEL)) EDIT_InvalidateText(es, es->selection_start, es->selection_end); if (!notify_parent(es, EN_KILLFOCUS)) return 0; @@ -3892,7 +3892,7 @@ static void EDIT_WM_SetFont(EDITSTATE *es, HFONT font, BOOL redraw) if (redraw) EDIT_UpdateText(es, NULL, TRUE); if (es->flags & EF_FOCUSED) { - DestroyCaret(); + NtUserDestroyCaret(); NtUserCreateCaret( es->hwndSelf, 0, 1, es->line_height ); EDIT_SetCaretPos(es, es->selection_end, es->flags & EF_AFTER_WRAP); diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 5f9ee0daac13..af5a1eb659c0 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -123,15 +123,6 @@ HWND WINAPI GetCapture(void) } -/***************************************************************** - * DestroyCaret (USER32.@) - */ -BOOL WINAPI DestroyCaret(void) -{ - return NtUserDestroyCaret(); -} - - /***************************************************************** * SetCaretPos (USER32.@) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 72f0de352395..3a240f5911c3 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -393,7 +393,7 @@ @ stdcall DeleteMenu(long long long) NtUserDeleteMenu @ stdcall DeregisterShellHookWindow(long) @ stdcall DestroyAcceleratorTable(long) NtUserDestroyAcceleratorTable -@ stdcall DestroyCaret() +@ stdcall DestroyCaret() NtUserDestroyCaret @ stdcall DestroyCursor(long) # @ stub DestroyDCompositionHwndTarget @ stdcall DestroyIcon(long) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index c679aa5de577..e036ff1be561 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2276,9 +2276,9 @@ BOOL WINAPI NtUserCreateCaret( HWND hwnd, HBITMAP bitmap, int width, int height } /******************************************************************* - * destroy_caret + * NtUserDestroyCaret (win32u.@) */ -BOOL destroy_caret(void) +BOOL WINAPI NtUserDestroyCaret(void) { int old_state = 0; int hidden = 0; diff --git a/dlls/win32u/main.c b/dlls/win32u/main.c index af210469a21e..c65d57fde685 100644 --- a/dlls/win32u/main.c +++ b/dlls/win32u/main.c @@ -1283,6 +1283,11 @@ BOOL SYSCALL_API NtUserDestroyAcceleratorTable( HACCEL handle ) SYSCALL_FUNC( NtUserDestroyAcceleratorTable ); } +BOOL SYSCALL_API NtUserDestroyCaret(void) +{ + SYSCALL_FUNC( NtUserDestroyCaret ); +} + BOOL SYSCALL_API NtUserDestroyCursor( HCURSOR cursor, ULONG arg ) { SYSCALL_FUNC( NtUserDestroyCursor ); diff --git a/dlls/win32u/scroll.c b/dlls/win32u/scroll.c index 84b935997435..4e6dce2c987f 100644 --- a/dlls/win32u/scroll.c +++ b/dlls/win32u/scroll.c @@ -1366,7 +1366,7 @@ LRESULT scroll_bar_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpara } NtUserHideCaret( hwnd ); NtUserInvalidateRect( hwnd, &rect, 0 ); - destroy_caret(); + NtUserDestroyCaret(); } return 0; diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 74b15619866d..9c4a658a5c7b 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -7104,9 +7104,6 @@ ULONG_PTR WINAPI NtUserCallNoParam( ULONG code ) { switch(code) { - case NtUserCallNoParam_DestroyCaret: - return destroy_caret(); - case NtUserCallNoParam_GetDesktopWindow: return HandleToUlong( get_desktop_window() ); diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index a5a20a78381e..50e6f0e43c2e 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -893,7 +893,7 @@ @ stdcall -syscall NtUserDestroyAcceleratorTable(long) @ stub NtUserDestroyActivationGroup @ stub NtUserDestroyActivationObject -@ stub NtUserDestroyCaret +@ stdcall -syscall NtUserDestroyCaret() @ stdcall -syscall NtUserDestroyCursor(long long) @ stub NtUserDestroyDCompositionHwndTarget @ stdcall -syscall NtUserDestroyInputContext(long) diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index bec42179931b..ae843828c065 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -91,7 +91,6 @@ extern void unregister_imm_window( HWND hwnd ); extern BOOL enable_mouse_in_pointer; extern BOOL grab_pointer; extern BOOL grab_fullscreen; -extern BOOL destroy_caret(void); extern HWND get_active_window(void); extern HWND get_capture(void); extern BOOL get_cursor_pos( POINT *pt ); diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index a8402d24f860..d7126984bb1f 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -5042,7 +5042,7 @@ static void send_destroy_message( HWND hwnd, BOOL winevent ) info.cbSize = sizeof(info); if (NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info )) { - if (hwnd == info.hwndCaret) destroy_caret(); + if (hwnd == info.hwndCaret) NtUserDestroyCaret(); if (hwnd == info.hwndActive) activate_other_window( hwnd ); } diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index b79b314217aa..9aa74a006837 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -2016,6 +2016,11 @@ NTSTATUS WINAPI wow64_NtUserDestroyAcceleratorTable( UINT *args ) return NtUserDestroyAcceleratorTable( handle ); } +NTSTATUS WINAPI wow64_NtUserDestroyCaret( UINT *args ) +{ + return NtUserDestroyCaret(); +} + NTSTATUS WINAPI wow64_NtUserDestroyCursor( UINT *args ) { HCURSOR cursor = get_handle( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index a0bd75b37b3b..61def8b78b45 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -747,6 +747,7 @@ W32KAPI HDWP WINAPI NtUserDeferWindowPosAndBand( HDWP hdwp, HWND hwnd, HWND a INT cx, INT cy, UINT flags, UINT unk1, UINT unk2 ); W32KAPI BOOL WINAPI NtUserDeleteMenu( HMENU menu, UINT id, UINT flags ); W32KAPI BOOL WINAPI NtUserDestroyAcceleratorTable( HACCEL handle ); +W32KAPI BOOL WINAPI NtUserDestroyCaret(void); W32KAPI BOOL WINAPI NtUserDestroyCursor( HCURSOR cursor, ULONG arg ); W32KAPI BOOL WINAPI NtUserDestroyInputContext( HIMC handle ); W32KAPI BOOL WINAPI NtUserDestroyMenu( HMENU menu ); @@ -982,7 +983,6 @@ W32KAPI HWND WINAPI NtUserWindowFromPoint( LONG x, LONG y ); /* NtUserCallNoParam codes, not compatible with Windows */ enum { - NtUserCallNoParam_DestroyCaret, NtUserCallNoParam_GetDesktopWindow, NtUserCallNoParam_GetDialogBaseUnits, NtUserCallNoParam_GetInputState, @@ -998,11 +998,6 @@ enum NtUserThreadDetach, }; -static inline BOOL NtUserDestroyCaret(void) -{ - return NtUserCallNoParam( NtUserCallNoParam_DestroyCaret ); -} - static inline HWND NtUserGetDesktopWindow(void) { return UlongToHandle( NtUserCallNoParam( NtUserCallNoParam_GetDesktopWindow )); From 50348bd18a87ef4aef1aebb5a0c8bd6fa7859fff Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 28 Jan 2025 11:59:52 +0100 Subject: [PATCH 1105/2542] win32u: Implement NtUserReleaseCapture(). (cherry picked from commit 44413a46c4bbccd83ae9ad0baa467d9876d685fa) CW-Bug-Id: #24755 --- dlls/user32/button.c | 8 ++++---- dlls/user32/combo.c | 8 ++++---- dlls/user32/edit.c | 2 +- dlls/user32/input.c | 9 --------- dlls/user32/listbox.c | 4 ++-- dlls/user32/user32.spec | 2 +- dlls/win32u/defwnd.c | 8 ++++---- dlls/win32u/input.c | 8 +++----- dlls/win32u/main.c | 5 +++++ dlls/win32u/scroll.c | 6 +++--- dlls/win32u/sysparams.c | 3 --- dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 1 - dlls/win32u/window.c | 4 ++-- dlls/wow64win/user.c | 5 +++++ include/ntuser.h | 7 +------ 16 files changed, 36 insertions(+), 46 deletions(-) diff --git a/dlls/user32/button.c b/dlls/user32/button.c index a5c509bbd2d8..11249be39916 100644 --- a/dlls/user32/button.c +++ b/dlls/user32/button.c @@ -272,7 +272,7 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, set_button_state( hWnd, state ); if (!(state & BST_PUSHED)) { - ReleaseCapture(); + NtUserReleaseCapture(); break; } SendMessageW( hWnd, BM_SETSTATE, FALSE, 0 ); @@ -293,12 +293,12 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, (state & BST_INDETERMINATE) ? 0 : ((state & 3) + 1), 0 ); break; } - ReleaseCapture(); + NtUserReleaseCapture(); BUTTON_NOTIFY_PARENT(hWnd, BN_CLICKED); } else { - ReleaseCapture(); + NtUserReleaseCapture(); } break; @@ -400,7 +400,7 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, paint_button( hWnd, btn_type, ODA_FOCUS ); if ((state & BUTTON_BTNPRESSED) && GetCapture() == hWnd) - ReleaseCapture(); + NtUserReleaseCapture(); if (style & BS_NOTIFY) BUTTON_NOTIFY_PARENT(hWnd, BN_KILLFOCUS); diff --git a/dlls/user32/combo.c b/dlls/user32/combo.c index 25b6888de0e4..a5a81c84a27d 100644 --- a/dlls/user32/combo.c +++ b/dlls/user32/combo.c @@ -1013,7 +1013,7 @@ static void CBRollUp( LPHEADCOMBO lphc, BOOL ok, BOOL bButton ) if(GetCapture() == lphc->hWndLBox) { - ReleaseCapture(); + NtUserReleaseCapture(); } if( CB_GETTYPE(lphc) == CBS_DROPDOWN ) @@ -1574,7 +1574,7 @@ static void COMBO_LButtonDown( LPHEADCOMBO lphc, LPARAM lParam ) if( lphc->wState & CBF_CAPTURE ) { lphc->wState &= ~CBF_CAPTURE; - ReleaseCapture(); + NtUserReleaseCapture(); } } else @@ -1610,7 +1610,7 @@ static void COMBO_LButtonUp( LPHEADCOMBO lphc ) lphc->wState &= ~CBF_NOLBSELECT; } } - ReleaseCapture(); + NtUserReleaseCapture(); NtUserSetCapture(lphc->hWndLBox); } @@ -1653,7 +1653,7 @@ static void COMBO_MouseMove( LPHEADCOMBO lphc, WPARAM wParam, LPARAM lParam ) if( PtInRect(&lbRect, pt) ) { lphc->wState &= ~CBF_CAPTURE; - ReleaseCapture(); + NtUserReleaseCapture(); if( CB_GETTYPE(lphc) == CBS_DROPDOWN ) CBUpdateLBox( lphc, TRUE ); /* hand over pointer tracking */ diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index 92489152f3a9..763c61e1c737 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -3643,7 +3643,7 @@ static LRESULT EDIT_WM_LButtonDown(EDITSTATE *es, DWORD keys, INT x, INT y) static LRESULT EDIT_WM_LButtonUp(EDITSTATE *es) { if (es->bCaptureState) { - if (GetCapture() == es->hwndSelf) ReleaseCapture(); + if (GetCapture() == es->hwndSelf) NtUserReleaseCapture(); } es->bCaptureState = FALSE; return 0; diff --git a/dlls/user32/input.c b/dlls/user32/input.c index af5a1eb659c0..5dd52f0e7a26 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -103,15 +103,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetCursorPos( POINT *pt ) } -/********************************************************************** - * ReleaseCapture (USER32.@) - */ -BOOL WINAPI DECLSPEC_HOTPATCH ReleaseCapture(void) -{ - return NtUserReleaseCapture(); -} - - /********************************************************************** * GetCapture (USER32.@) */ diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 467a8c8a10b3..9d6ad8a3c754 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -2233,7 +2233,7 @@ static LRESULT LISTBOX_HandleLButtonDownCombo( LB_DESCR *descr, UINT msg, DWORD /* Check the Non-Client Area */ screenMousePos = mousePos; hWndOldCapture = GetCapture(); - ReleaseCapture(); + NtUserReleaseCapture(); GetWindowRect(descr->self, &screenRect); ClientToScreen(descr->self, &screenMousePos); @@ -2290,7 +2290,7 @@ static LRESULT LISTBOX_HandleLButtonUp( LB_DESCR *descr ) if (descr->captured) { descr->captured = FALSE; - if (GetCapture() == descr->self) ReleaseCapture(); + if (GetCapture() == descr->self) NtUserReleaseCapture(); if ((descr->style & LBS_NOTIFY) && descr->nb_items) SEND_NOTIFICATION( descr, LBN_SELCHANGE ); } diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 3a240f5911c3..a5a290d5d285 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -982,7 +982,7 @@ @ stdcall RegisterUserApiHook(ptr ptr) @ stdcall RegisterWindowMessageA(str) @ stdcall RegisterWindowMessageW(wstr) -@ stdcall ReleaseCapture() +@ stdcall ReleaseCapture() NtUserReleaseCapture @ stdcall ReleaseDC(long long) NtUserReleaseDC # @ stub ReleaseDwmHitTestWaiters @ stdcall RemoveClipboardFormatListener(long) NtUserRemoveClipboardFormatListener diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index 552360e1dcf7..a1873f1bc8c8 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -2159,7 +2159,7 @@ static void track_min_max_box( HWND hwnd, WORD wparam ) if (pressed) paint_button( hwnd, hdc, FALSE, FALSE ); - release_capture(); + NtUserReleaseCapture(); NtUserReleaseDC( hwnd, hdc ); /* If the minimize or maximize items of the sysmenu are not there @@ -2207,7 +2207,7 @@ static void track_close_button( HWND hwnd, WPARAM wparam, LPARAM lparam ) if (pressed) draw_close_button( hwnd, hdc, FALSE, FALSE ); - release_capture(); + NtUserReleaseCapture(); NtUserReleaseDC( hwnd, hdc ); if (pressed) send_message( hwnd, WM_SYSCOMMAND, SC_CLOSE, lparam ); } @@ -2303,7 +2303,7 @@ static LRESULT handle_nc_rbutton_down( HWND hwnd, WPARAM wparam, LPARAM lparam ) break; } } - release_capture(); + NtUserReleaseCapture(); if (hittest == HTCAPTION || hittest == HTSYSMENU) send_message( hwnd, WM_CONTEXTMENU, (WPARAM)hwnd, MAKELPARAM( msg.pt.x, msg.pt.y )); break; @@ -2647,7 +2647,7 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, case WM_CANCELMODE: menu_sys_key = 0; end_menu( hwnd ); - if (get_capture() == hwnd) release_capture(); + if (get_capture() == hwnd) NtUserReleaseCapture(); break; case WM_SETTEXT: diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index e036ff1be561..d8bb353ef60a 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -1828,15 +1828,13 @@ HWND WINAPI NtUserSetCapture( HWND hwnd ) } /********************************************************************** - * release_capture + * NtUserReleaseCapture (win32u.@) */ -BOOL release_capture(void) +BOOL WINAPI NtUserReleaseCapture(void) { HWND previous = NULL; - BOOL ret; - ret = set_capture_window( 0, 0, &previous ); - return ret; + return set_capture_window( 0, 0, &previous ); } /***************************************************************** diff --git a/dlls/win32u/main.c b/dlls/win32u/main.c index c65d57fde685..67509646e300 100644 --- a/dlls/win32u/main.c +++ b/dlls/win32u/main.c @@ -1937,6 +1937,11 @@ BOOL SYSCALL_API NtUserRegisterTouchPadCapable( BOOL capable ) SYSCALL_FUNC( NtUserRegisterTouchPadCapable ); } +BOOL SYSCALL_API NtUserReleaseCapture(void) +{ + SYSCALL_FUNC( NtUserReleaseCapture ); +} + INT SYSCALL_API NtUserReleaseDC( HWND hwnd, HDC hdc ) { SYSCALL_FUNC( NtUserReleaseDC ); diff --git a/dlls/win32u/scroll.c b/dlls/win32u/scroll.c index 4e6dce2c987f..51026badbc03 100644 --- a/dlls/win32u/scroll.c +++ b/dlls/win32u/scroll.c @@ -594,7 +594,7 @@ void handle_scroll_event( HWND hwnd, int bar, UINT msg, POINT pt ) prev_pt = pt; break; case WM_LBUTTONUP: - release_capture(); + NtUserReleaseCapture(); g_tracking_info.hit_test = hittest = SCROLL_NOWHERE; if (hwnd == get_focus()) NtUserShowCaret( hwnd ); break; @@ -681,7 +681,7 @@ void handle_scroll_event( HWND hwnd, int bar, UINT msg, POINT pt ) case WM_LBUTTONUP: hittest = SCROLL_NOWHERE; - release_capture(); + NtUserReleaseCapture(); /* if scrollbar has focus, show back caret */ if (hwnd == get_focus()) NtUserShowCaret( hwnd ); break; @@ -859,7 +859,7 @@ void track_scroll_bar( HWND hwnd, int scrollbar, POINT pt ) } if (!is_window( hwnd )) { - release_capture(); + NtUserReleaseCapture(); break; } } while (msg.message != WM_LBUTTONUP && get_capture() == hwnd); diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 9c4a658a5c7b..3150a183dbe1 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -7128,9 +7128,6 @@ ULONG_PTR WINAPI NtUserCallNoParam( ULONG code ) case NtUserCallNoParam_GetTaskmanWindow: return HandleToUlong( get_taskman_window() ); - case NtUserCallNoParam_ReleaseCapture: - return release_capture(); - case NtUserCallNoParam_DisplayModeChanged: display_mode_changed( FALSE ); return TRUE; diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 50e6f0e43c2e..ad19f6983d45 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1287,7 +1287,7 @@ @ stub NtUserRegisterUserHungAppHandlers @ stub NtUserRegisterWindowArrangementCallout @ stub NtUserRegisterWindowMessage -@ stub NtUserReleaseCapture +@ stdcall -syscall NtUserReleaseCapture() @ stdcall -syscall NtUserReleaseDC(long long) @ stub NtUserReleaseDwmHitTestWaiters @ stub NtUserRemoteConnect diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index ae843828c065..04405ffc14e2 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -98,7 +98,6 @@ extern HWND get_focus(void); extern DWORD get_input_state(void); extern DWORD get_last_input_time(void); extern BOOL get_async_keyboard_state( BYTE state[256] ); -extern BOOL release_capture(void); extern BOOL set_capture_window( HWND hwnd, UINT gui_flags, HWND *prev_ret ); extern BOOL set_caret_blink_time( unsigned int time ); extern BOOL set_caret_pos( int x, int y ); diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index d7126984bb1f..f8e7b4e895b7 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -6108,7 +6108,7 @@ BOOL WINAPI NtUserDragDetect( HWND hwnd, int x, int y ) { if (msg.message == WM_LBUTTONUP) { - release_capture(); + NtUserReleaseCapture(); return FALSE; } if (msg.message == WM_MOUSEMOVE) @@ -6118,7 +6118,7 @@ BOOL WINAPI NtUserDragDetect( HWND hwnd, int x, int y ) tmp.y = (short)HIWORD( msg.lParam ); if (!PtInRect( &rect, tmp )) { - release_capture(); + NtUserReleaseCapture(); return TRUE; } } diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 9aa74a006837..c9fe6160271b 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -3949,6 +3949,11 @@ NTSTATUS WINAPI wow64_NtUserRegisterTouchPadCapable( UINT *args ) return NtUserRegisterTouchPadCapable( capable ); } +NTSTATUS WINAPI wow64_NtUserReleaseCapture( UINT *args ) +{ + return NtUserReleaseCapture(); +} + NTSTATUS WINAPI wow64_NtUserReleaseDC( UINT *args ) { HWND hwnd = get_handle( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index 61def8b78b45..6d765677c951 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -895,6 +895,7 @@ W32KAPI ATOM WINAPI NtUserRegisterClassExWOW( const WNDCLASSEXW *wc, UNICODE_ W32KAPI BOOL WINAPI NtUserRegisterHotKey( HWND hwnd, INT id, UINT modifiers, UINT vk ); W32KAPI BOOL WINAPI NtUserRegisterRawInputDevices( const RAWINPUTDEVICE *devices, UINT device_count, UINT size ); W32KAPI BOOL WINAPI NtUserRegisterTouchPadCapable( BOOL capable ); +W32KAPI BOOL WINAPI NtUserReleaseCapture(void); W32KAPI INT WINAPI NtUserReleaseDC( HWND hwnd, HDC hdc ); W32KAPI BOOL WINAPI NtUserRemoveClipboardFormatListener( HWND hwnd ); W32KAPI BOOL WINAPI NtUserRemoveMenu( HMENU menu, UINT id, UINT flags ); @@ -991,7 +992,6 @@ enum NtUserCallNoParam_GetProgmanWindow, NtUserCallNoParam_GetShellWindow, NtUserCallNoParam_GetTaskmanWindow, - NtUserCallNoParam_ReleaseCapture, NtUserCallNoParam_DisplayModeChanged, /* temporary exports */ NtUserExitingThread, @@ -1038,11 +1038,6 @@ static inline HWND NtUserGetTaskmanWindow(void) return UlongToHandle( NtUserCallNoParam( NtUserCallNoParam_GetTaskmanWindow )); } -static inline BOOL NtUserReleaseCapture(void) -{ - return NtUserCallNoParam( NtUserCallNoParam_ReleaseCapture ); -} - /* NtUserCallOneParam codes, not compatible with Windows */ enum { From 937fb6681d4cafacd5c559f1d0362b8d7aebc743 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 28 Jan 2025 11:56:56 +0100 Subject: [PATCH 1106/2542] win32u: Implement NtUserGetThreadState(). (cherry picked from commit 30a6982e17b7a9a82cbc49b19d9fcab1b1a69ae7) CW-Bug-Id: #24755 --- dlls/user32/input.c | 14 ++++------- dlls/user32/message.c | 4 ++-- dlls/win32u/input.c | 52 +++++++++++++++++++++++++++++++++++++++++ dlls/win32u/main.c | 5 ++++ dlls/win32u/sysparams.c | 3 --- dlls/win32u/win32u.spec | 2 +- dlls/wow64win/user.c | 7 ++++++ include/ntuser.h | 23 +++++++++++++----- 8 files changed, 88 insertions(+), 22 deletions(-) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 5dd52f0e7a26..db59f21f89b1 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -108,9 +108,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetCursorPos( POINT *pt ) */ HWND WINAPI GetCapture(void) { - GUITHREADINFO info; - info.cbSize = sizeof(info); - return NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ) ? info.hwndCapture : 0; + return (HWND)NtUserGetThreadState( UserThreadStateCaptureWindow ); } @@ -137,7 +135,7 @@ BOOL WINAPI SetCaretBlinkTime( unsigned int time ) */ BOOL WINAPI GetInputState(void) { - return NtUserGetInputState(); + return NtUserGetThreadState( UserThreadStateInputState ); } @@ -776,9 +774,7 @@ BOOL WINAPI SetForegroundWindow( HWND hwnd ) */ HWND WINAPI GetActiveWindow(void) { - GUITHREADINFO info; - info.cbSize = sizeof(info); - return NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ) ? info.hwndActive : 0; + return (HWND)NtUserGetThreadState( UserThreadStateActiveWindow ); } @@ -787,9 +783,7 @@ HWND WINAPI GetActiveWindow(void) */ HWND WINAPI GetFocus(void) { - GUITHREADINFO info; - info.cbSize = sizeof(info); - return NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ) ? info.hwndFocus : 0; + return (HWND)NtUserGetThreadState( UserThreadStateFocusWindow ); } diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 73b41820adc1..925cbe902d28 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -970,7 +970,7 @@ DWORD WINAPI GetMessagePos(void) */ LONG WINAPI GetMessageTime(void) { - return NtUserGetThreadInfo()->message_time; + return NtUserGetThreadState( UserThreadStateMessageTime ); } @@ -980,7 +980,7 @@ LONG WINAPI GetMessageTime(void) */ LPARAM WINAPI GetMessageExtraInfo(void) { - return NtUserGetThreadInfo()->message_extra; + return NtUserGetThreadState( UserThreadStateExtraInfo ); } diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index d8bb353ef60a..850b94c8517d 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -872,6 +872,58 @@ DWORD WINAPI NtUserGetQueueStatus( UINT flags ) return ret; } +/******************************************************************* + * NtUserGetThreadInfo (win32u.@) + */ +ULONG_PTR WINAPI NtUserGetThreadState( USERTHREADSTATECLASS cls ) +{ + GUITHREADINFO info; + + switch (cls) + { + case UserThreadStateFocusWindow: + info.cbSize = sizeof(info); + NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ); + return (ULONG_PTR)info.hwndFocus; + + case UserThreadStateActiveWindow: + info.cbSize = sizeof(info); + NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ); + return (ULONG_PTR)info.hwndActive; + + case UserThreadStateCaptureWindow: + info.cbSize = sizeof(info); + NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ); + return (ULONG_PTR)info.hwndCapture; + + case UserThreadStateDefaultImeWindow: + return (ULONG_PTR)get_default_ime_window( 0 ); + + case UserThreadStateDefaultInputContext: + return NtUserGetThreadInfo()->default_imc; + + case UserThreadStateInputState: + return get_input_state(); + + case UserThreadStateCursor: + return (ULONG_PTR)NtUserGetCursor(); + + case UserThreadStateExtraInfo: + return NtUserGetThreadInfo()->message_extra; + + case UserThreadStateInSendMessage: + return NtUserGetThreadInfo()->receive_flags; + + case UserThreadStateMessageTime: + return NtUserGetThreadInfo()->message_time; + + case UserThreadStateIsForeground: + default: + WARN( "unsupported class %u\n", cls ); + return 0; + } +} + /*********************************************************************** * get_input_state */ diff --git a/dlls/win32u/main.c b/dlls/win32u/main.c index 67509646e300..d2dfb23928fa 100644 --- a/dlls/win32u/main.c +++ b/dlls/win32u/main.c @@ -1699,6 +1699,11 @@ HDESK SYSCALL_API NtUserGetThreadDesktop( DWORD thread ) SYSCALL_FUNC( NtUserGetThreadDesktop ); } +ULONG_PTR SYSCALL_API NtUserGetThreadState( USERTHREADSTATECLASS cls ) +{ + SYSCALL_FUNC( NtUserGetThreadState ); +} + BOOL SYSCALL_API NtUserGetTitleBarInfo( HWND hwnd, TITLEBARINFO *info ) { SYSCALL_FUNC( NtUserGetTitleBarInfo ); diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 3150a183dbe1..2cfc97e3a6b9 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -7110,9 +7110,6 @@ ULONG_PTR WINAPI NtUserCallNoParam( ULONG code ) case NtUserCallNoParam_GetDialogBaseUnits: return get_dialog_base_units(); - case NtUserCallNoParam_GetInputState: - return get_input_state(); - case NtUserCallNoParam_GetLastInputTime: return get_last_input_time(); diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index ad19f6983d45..b5e24cc4903a 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1101,7 +1101,7 @@ @ stdcall -syscall NtUserGetSystemDpiForProcess(long) @ stdcall -syscall NtUserGetSystemMenu(long long) @ stdcall -syscall NtUserGetThreadDesktop(long) -@ stub NtUserGetThreadState +@ stdcall -syscall NtUserGetThreadState(long) @ stdcall -syscall NtUserGetTitleBarInfo(long ptr) @ stub NtUserGetTopLevelWindow @ stdcall -syscall NtUserGetTouchInputInfo(ptr long ptr long) diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index c9fe6160271b..d14ff53df495 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -3105,6 +3105,13 @@ NTSTATUS WINAPI wow64_NtUserGetThreadDesktop( UINT *args ) return HandleToUlong( NtUserGetThreadDesktop( thread )); } +NTSTATUS WINAPI wow64_NtUserGetThreadState( UINT *args ) +{ + USERTHREADSTATECLASS cls = get_ulong( &args ); + + return NtUserGetThreadState( cls ); +} + NTSTATUS WINAPI wow64_NtUserGetTitleBarInfo( UINT *args ) { HWND hwnd = get_handle( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index 6d765677c951..44207cb344a4 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -702,6 +702,22 @@ typedef enum _WINDOWINFOCLASS WindowDefaultInputContext, } WINDOWINFOCLASS; +/* NtUserGetThreadState info classes */ +typedef enum _USERTHREADSTATECLASS +{ + UserThreadStateFocusWindow, + UserThreadStateActiveWindow, + UserThreadStateCaptureWindow, + UserThreadStateDefaultImeWindow, + UserThreadStateDefaultInputContext, + UserThreadStateInputState, + UserThreadStateCursor, + UserThreadStateExtraInfo, + UserThreadStateInSendMessage, + UserThreadStateMessageTime, + UserThreadStateIsForeground +} USERTHREADSTATECLASS; + W32KAPI HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags ); W32KAPI BOOL WINAPI NtUserAddClipboardFormatListener( HWND hwnd ); W32KAPI UINT WINAPI NtUserAssociateInputContext( HWND hwnd, HIMC ctx, ULONG flags ); @@ -841,6 +857,7 @@ W32KAPI BOOL WINAPI NtUserGetScrollBarInfo( HWND hwnd, LONG id, SCROLLBARINFO W32KAPI ULONG WINAPI NtUserGetSystemDpiForProcess( HANDLE process ); W32KAPI HMENU WINAPI NtUserGetSystemMenu( HWND hwnd, BOOL revert ); W32KAPI HDESK WINAPI NtUserGetThreadDesktop( DWORD thread ); +W32KAPI ULONG_PTR WINAPI NtUserGetThreadState( USERTHREADSTATECLASS cls ); W32KAPI BOOL WINAPI NtUserGetTitleBarInfo( HWND hwnd, TITLEBARINFO *info ); W32KAPI BOOL WINAPI NtUserGetTouchInputInfo( HTOUCHINPUT handle, UINT count, TOUCHINPUT *ptr, int size ); W32KAPI INT WINAPI NtUserGetUpdateRgn( HWND hwnd, HRGN hrgn, BOOL erase ); @@ -986,7 +1003,6 @@ enum { NtUserCallNoParam_GetDesktopWindow, NtUserCallNoParam_GetDialogBaseUnits, - NtUserCallNoParam_GetInputState, NtUserCallNoParam_GetLastInputTime, NtUserCallNoParam_GetProcessDefaultLayout, NtUserCallNoParam_GetProgmanWindow, @@ -1008,11 +1024,6 @@ static inline DWORD NtUserGetDialogBaseUnits(void) return NtUserCallNoParam( NtUserCallNoParam_GetDialogBaseUnits ); }; -static inline BOOL NtUserGetInputState(void) -{ - return NtUserCallNoParam( NtUserCallNoParam_GetInputState ); -} - static inline DWORD NtUserGetLastInputTime(void) { return NtUserCallNoParam( NtUserCallNoParam_GetLastInputTime ); From f27e6960d5931ba3ae3f9a82f2f7944341c47069 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 28 Jan 2025 12:54:20 +0100 Subject: [PATCH 1107/2542] win32u: Implement NtUserCreateMenu() and NtUserCreatePopupMenu(). (cherry picked from commit 98f36c85f9cad21e4b99b2d574a64219430814fe) CW-Bug-Id: #24755 --- dlls/user32/menu.c | 26 ++++---------------------- dlls/user32/user32.spec | 4 ++-- dlls/win32u/main.c | 10 ++++++++++ dlls/win32u/menu.c | 20 ++++++++++++++++++-- dlls/win32u/sysparams.c | 3 --- dlls/win32u/win32u.spec | 4 ++-- dlls/win32u/win32u_private.h | 1 - dlls/wow64win/user.c | 10 ++++++++++ include/ntuser.h | 8 ++------ 9 files changed, 48 insertions(+), 38 deletions(-) diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c index 0dba838967ad..420c097e084c 100644 --- a/dlls/user32/menu.c +++ b/dlls/user32/menu.c @@ -99,7 +99,7 @@ static LPCSTR MENU_ParseResource( LPCSTR res, HMENU hMenu ) res += (lstrlenW(str) + 1) * sizeof(WCHAR); if (flags & MF_POPUP) { - HMENU hSubMenu = CreatePopupMenu(); + HMENU hSubMenu = NtUserCreatePopupMenu(); if (!hSubMenu) return NULL; if (!(res = MENU_ParseResource( res, hSubMenu ))) return NULL; AppendMenuW( hMenu, flags, (UINT_PTR)hSubMenu, str ); @@ -148,7 +148,7 @@ static LPCSTR MENUEX_ParseResource( LPCSTR res, HMENU hMenu) if (resinfo & 1) { /* Pop-up? */ /* DWORD helpid = GET_DWORD(res); FIXME: use this. */ res += sizeof(DWORD); - mii.hSubMenu = CreatePopupMenu(); + mii.hSubMenu = NtUserCreatePopupMenu(); if (!mii.hSubMenu) return NULL; if (!(res = MENUEX_ParseResource(res, mii.hSubMenu))) { @@ -493,15 +493,6 @@ BOOL WINAPI ModifyMenuA( HMENU hMenu, UINT pos, UINT flags, } -/********************************************************************** - * CreatePopupMenu (USER32.@) - */ -HMENU WINAPI CreatePopupMenu(void) -{ - return NtUserCreateMenu( TRUE ); -} - - /********************************************************************** * GetMenuCheckMarkDimensions (USER.417) * GetMenuCheckMarkDimensions (USER32.@) @@ -533,15 +524,6 @@ BOOL WINAPI SetMenuItemBitmaps( HMENU menu, UINT pos, UINT flags, HBITMAP unchec } -/********************************************************************** - * CreateMenu (USER32.@) - */ -HMENU WINAPI CreateMenu(void) -{ - return NtUserCreateMenu( FALSE ); -} - - /********************************************************************** * GetMenu (USER32.@) */ @@ -611,7 +593,7 @@ HMENU WINAPI LoadMenuIndirectW( LPCVOID template ) case 0: /* standard format is version of 0 */ offset = GET_WORD(p); p += sizeof(WORD) + offset; - if (!(hMenu = CreateMenu())) return 0; + if (!(hMenu = NtUserCreateMenu())) return 0; if (!MENU_ParseResource( p, hMenu )) { NtUserDestroyMenu( hMenu ); @@ -621,7 +603,7 @@ HMENU WINAPI LoadMenuIndirectW( LPCVOID template ) case 1: /* extended format is version of 1 */ offset = GET_WORD(p); p += sizeof(WORD) + offset; - if (!(hMenu = CreateMenu())) return 0; + if (!(hMenu = NtUserCreateMenu())) return 0; if (!MENUEX_ParseResource( p, hMenu)) { NtUserDestroyMenu( hMenu ); diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index a5a290d5d285..8a9643873e13 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -333,8 +333,8 @@ @ stdcall CreateIconIndirect(ptr) @ stdcall CreateMDIWindowA(str str long long long long long long long long) @ stdcall CreateMDIWindowW(wstr wstr long long long long long long long long) -@ stdcall CreateMenu() -@ stdcall CreatePopupMenu() +@ stdcall CreateMenu() NtUserCreateMenu +@ stdcall CreatePopupMenu() NtUserCreatePopupMenu @ stdcall CreateSyntheticPointerDevice(long long long) # @ stub CreateSystemThreads @ stdcall CreateWindowExA(long str str long long long long long long long long ptr) diff --git a/dlls/win32u/main.c b/dlls/win32u/main.c index d2dfb23928fa..3bd167b87d12 100644 --- a/dlls/win32u/main.c +++ b/dlls/win32u/main.c @@ -1251,6 +1251,16 @@ HIMC SYSCALL_API NtUserCreateInputContext( UINT_PTR client_ptr ) SYSCALL_FUNC( NtUserCreateInputContext ); } +HMENU SYSCALL_API NtUserCreateMenu(void) +{ + SYSCALL_FUNC( NtUserCreateMenu ); +} + +HMENU SYSCALL_API NtUserCreatePopupMenu(void) +{ + SYSCALL_FUNC( NtUserCreatePopupMenu ); +} + HWND SYSCALL_API NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, UNICODE_STRING *version, UNICODE_STRING *window_name, DWORD style, INT x, INT y, INT cx, INT cy, diff --git a/dlls/win32u/menu.c b/dlls/win32u/menu.c index f232585940d6..b7f45c016c45 100644 --- a/dlls/win32u/menu.c +++ b/dlls/win32u/menu.c @@ -596,7 +596,7 @@ HMENU get_menu( HWND hwnd ) } /* see CreateMenu and CreatePopupMenu */ -HMENU create_menu( BOOL is_popup ) +static HMENU create_menu( BOOL is_popup ) { struct menu *menu; HMENU handle; @@ -612,6 +612,22 @@ HMENU create_menu( BOOL is_popup ) return handle; } +/********************************************************************** + * NtUserCreateMenu (win32u.@) + */ +HMENU WINAPI NtUserCreateMenu(void) +{ + return create_menu( FALSE ); +} + +/********************************************************************** + * NtUserCreatePopupMenu (win32u.@) + */ +HMENU WINAPI NtUserCreatePopupMenu(void) +{ + return create_menu( TRUE ); +} + /********************************************************************** * NtUserDestroyMenu (win32u.@) */ @@ -1489,7 +1505,7 @@ static HMENU get_sys_menu( HWND hwnd, HMENU popup_menu ) HMENU handle; TRACE("loading system menu, hwnd %p, popup_menu %p\n", hwnd, popup_menu); - if (!(handle = create_menu( FALSE ))) + if (!(handle = NtUserCreateMenu())) { ERR("failed to load system menu!\n"); return 0; diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 2cfc97e3a6b9..ad255f15a239 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -7157,9 +7157,6 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code ) case NtUserCallOneParam_CreateCursorIcon: return HandleToUlong( alloc_cursoricon_handle( arg )); - case NtUserCallOneParam_CreateMenu: - return HandleToUlong( create_menu( arg ) ); - case NtUserCallOneParam_EnableDC: return set_dce_flags( UlongToHandle(arg), DCHF_ENABLEDC ); diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index b5e24cc4903a..102b99a57c17 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -869,9 +869,9 @@ @ stub NtUserCreateEmptyCursorObject @ stdcall -syscall NtUserCreateInputContext(ptr) @ stub NtUserCreateLocalMemHandle -@ stub NtUserCreateMenu +@ stdcall -syscall NtUserCreateMenu() @ stub NtUserCreatePalmRejectionDelayZone -@ stub NtUserCreatePopupMenu +@ stdcall -syscall NtUserCreatePopupMenu() @ stub NtUserCreateSyntheticPointerDevice2 @ stub NtUserCreateSystemThreads @ stdcall -syscall NtUserCreateWindowEx(long ptr ptr ptr long long long long long long long long ptr long long long long) diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 04405ffc14e2..5af8c291532e 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -114,7 +114,6 @@ extern BOOL register_touch_window( HWND hwnd, UINT flags ); extern BOOL unregister_touch_window( HWND hwnd ); /* menu.c */ -extern HMENU create_menu( BOOL is_popup ); extern BOOL draw_menu_bar( HWND hwnd ); extern UINT draw_nc_menu_bar( HDC hdc, RECT *rect, HWND hwnd ); extern void end_menu( HWND hwnd ); diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index d14ff53df495..eb7b4eeff43b 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -1935,6 +1935,16 @@ NTSTATUS WINAPI wow64_NtUserCreateInputContext( UINT *args ) return HandleToUlong( NtUserCreateInputContext( client_ptr )); } +NTSTATUS WINAPI wow64_NtUserCreateMenu( UINT *args ) +{ + return HandleToUlong( NtUserCreateMenu() ); +} + +NTSTATUS WINAPI wow64_NtUserCreatePopupMenu( UINT *args ) +{ + return HandleToUlong( NtUserCreatePopupMenu() ); +} + NTSTATUS WINAPI wow64_NtUserCreateWindowEx( UINT *args ) { DWORD ex_style = get_ulong( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index 44207cb344a4..f1c5eff96122 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -752,6 +752,8 @@ W32KAPI HDESK WINAPI NtUserCreateDesktopEx( OBJECT_ATTRIBUTES *attr, UNICODE_S DEVMODEW *devmode, DWORD flags, ACCESS_MASK access, ULONG heap_size ); W32KAPI HIMC WINAPI NtUserCreateInputContext( UINT_PTR client_ptr ); +W32KAPI HMENU WINAPI NtUserCreateMenu(void); +W32KAPI HMENU WINAPI NtUserCreatePopupMenu(void); W32KAPI HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, UNICODE_STRING *version, UNICODE_STRING *window_name, DWORD style, INT x, INT y, INT cx, INT cy, @@ -1054,7 +1056,6 @@ enum { NtUserCallOneParam_BeginDeferWindowPos, NtUserCallOneParam_CreateCursorIcon, - NtUserCallOneParam_CreateMenu, NtUserCallOneParam_EnableDC, NtUserCallOneParam_EnableThunkLock, NtUserCallOneParam_EnumClipboardFormats, @@ -1093,11 +1094,6 @@ static inline HICON NtUserCreateCursorIcon( BOOL is_icon ) return UlongToHandle( NtUserCallOneParam( is_icon, NtUserCallOneParam_CreateCursorIcon )); } -static inline HMENU NtUserCreateMenu( BOOL is_popup ) -{ - return UlongToHandle( NtUserCallOneParam( is_popup, NtUserCallOneParam_CreateMenu )); -} - static inline WORD NtUserEnableDC( HDC hdc ) { return NtUserCallOneParam( HandleToUlong(hdc), NtUserCallOneParam_EnableDC ); From abed1ae65d58bae7709805c10b76200477d3dc74 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 28 Jan 2025 12:34:14 +0100 Subject: [PATCH 1108/2542] win32u: Implement NtUserEnumClipboardFormats(). (cherry picked from commit a2fb1a14805b94bec345e23f7bff5e5f43e4c98c) CW-Bug-Id: #24755 --- dlls/user32/clipboard.c | 9 --------- dlls/user32/user32.spec | 2 +- dlls/win32u/clipboard.c | 6 ++++-- dlls/win32u/main.c | 5 +++++ dlls/win32u/sysparams.c | 3 --- dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 1 - dlls/wow64win/user.c | 7 +++++++ include/ntuser.h | 7 +------ 9 files changed, 19 insertions(+), 23 deletions(-) diff --git a/dlls/user32/clipboard.c b/dlls/user32/clipboard.c index 55d410c34ea4..62889c381cf5 100644 --- a/dlls/user32/clipboard.c +++ b/dlls/user32/clipboard.c @@ -588,15 +588,6 @@ HANDLE WINAPI SetClipboardData( UINT format, HANDLE data ) } -/************************************************************************** - * EnumClipboardFormats (USER32.@) - */ -UINT WINAPI EnumClipboardFormats( UINT format ) -{ - return NtUserEnumClipboardFormats( format ); -} - - /************************************************************************** * GetClipboardData (USER32.@) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 8a9643873e13..0bc10c9da220 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -466,7 +466,7 @@ @ stub EndTask # @ stub EnterReaderModeHelper @ stdcall EnumChildWindows(long ptr long) -@ stdcall EnumClipboardFormats(long) +@ stdcall EnumClipboardFormats(long) NtUserEnumClipboardFormats @ stdcall EnumDesktopWindows(long ptr ptr) @ stdcall EnumDesktopsA(ptr ptr long) @ stdcall EnumDesktopsW(ptr ptr long) diff --git a/dlls/win32u/clipboard.c b/dlls/win32u/clipboard.c index ee75a239efc7..6f3e39690d2a 100644 --- a/dlls/win32u/clipboard.c +++ b/dlls/win32u/clipboard.c @@ -487,8 +487,10 @@ DWORD WINAPI NtUserGetClipboardSequenceNumber(void) return seqno; } -/* see EnumClipboardFormats */ -UINT enum_clipboard_formats( UINT format ) +/************************************************************************** + * NtUserEnumClipboardFormats (win32u.@) + */ +UINT WINAPI NtUserEnumClipboardFormats( UINT format ) { UINT ret = 0; diff --git a/dlls/win32u/main.c b/dlls/win32u/main.c index 3bd167b87d12..cd2fd5a22cc8 100644 --- a/dlls/win32u/main.c +++ b/dlls/win32u/main.c @@ -1400,6 +1400,11 @@ BOOL SYSCALL_API NtUserEndPaint( HWND hwnd, const PAINTSTRUCT *ps ) SYSCALL_FUNC( NtUserEndPaint ); } +UINT SYSCALL_API NtUserEnumClipboardFormats( UINT format ) +{ + SYSCALL_FUNC( NtUserEnumClipboardFormats ); +} + NTSTATUS SYSCALL_API NtUserEnumDisplayDevices( UNICODE_STRING *device, DWORD index, DISPLAY_DEVICEW *info, DWORD flags ) { diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index ad255f15a239..92bfd86c167a 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -7164,9 +7164,6 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code ) thunk_lock_callback = arg; return 0; - case NtUserCallOneParam_EnumClipboardFormats: - return enum_clipboard_formats( arg ); - case NtUserCallOneParam_GetClipCursor: return get_clip_cursor( (RECT *)arg, get_thread_dpi(), MDT_DEFAULT ); diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 102b99a57c17..32a3c3d97688 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -957,7 +957,7 @@ @ stdcall -syscall NtUserEndMenu() @ stdcall -syscall NtUserEndPaint(long ptr) @ stub NtUserEnsureDpiDepSysMetCacheForPlateau -@ stub NtUserEnumClipboardFormats +@ stdcall -syscall NtUserEnumClipboardFormats(long) @ stdcall -syscall NtUserEnumDisplayDevices(ptr long ptr long) @ stdcall -syscall NtUserEnumDisplayMonitors(long ptr ptr long) @ stdcall -syscall NtUserEnumDisplaySettings(ptr long ptr long) diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 5af8c291532e..fcac555c8f8b 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -34,7 +34,6 @@ /* clipboard.c */ -extern UINT enum_clipboard_formats( UINT format ); extern void release_clipboard_owner( HWND hwnd ); /* cursoricon.c */ diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index eb7b4eeff43b..ed9246142bb3 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -2191,6 +2191,13 @@ NTSTATUS WINAPI wow64_NtUserEndPaint( UINT *args ) return NtUserEndPaint( hwnd, paintstruct_32to64( &ps, ps32 )); } +NTSTATUS WINAPI wow64_NtUserEnumClipboardFormats( UINT *args ) +{ + UINT format = get_ulong( &args ); + + return NtUserEnumClipboardFormats( format ); +} + NTSTATUS WINAPI wow64_NtUserEnumDisplayDevices( UINT *args ) { UNICODE_STRING32 *device32 = get_ptr( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index f1c5eff96122..57636fd3752c 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -788,6 +788,7 @@ W32KAPI BOOL WINAPI NtUserEnableScrollBar( HWND hwnd, UINT bar, UINT flags ); W32KAPI BOOL WINAPI NtUserEndDeferWindowPosEx( HDWP hdwp, BOOL async ); W32KAPI BOOL WINAPI NtUserEndMenu(void); W32KAPI BOOL WINAPI NtUserEndPaint( HWND hwnd, const PAINTSTRUCT *ps ); +W32KAPI UINT WINAPI NtUserEnumClipboardFormats( UINT format ); W32KAPI NTSTATUS WINAPI NtUserEnumDisplayDevices( UNICODE_STRING *device, DWORD index, DISPLAY_DEVICEW *info, DWORD flags ); W32KAPI BOOL WINAPI NtUserEnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC proc, LPARAM lp ); @@ -1058,7 +1059,6 @@ enum NtUserCallOneParam_CreateCursorIcon, NtUserCallOneParam_EnableDC, NtUserCallOneParam_EnableThunkLock, - NtUserCallOneParam_EnumClipboardFormats, NtUserCallOneParam_GetClipCursor, NtUserCallOneParam_GetCursorPos, NtUserCallOneParam_GetIconParam, @@ -1111,11 +1111,6 @@ static inline void NtUserEnableThunkLock( ntuser_callback thunk_lock_callback ) NtUserCallOneParam( (UINT_PTR)thunk_lock_callback, NtUserCallOneParam_EnableThunkLock ); } -static inline UINT NtUserEnumClipboardFormats( UINT format ) -{ - return NtUserCallOneParam( format, NtUserCallOneParam_EnumClipboardFormats ); -} - static inline BOOL NtUserGetClipCursor( RECT *rect ) { return NtUserCallOneParam( (UINT_PTR)rect, NtUserCallOneParam_GetClipCursor ); From dd00739fbab80db6d717b5e271770898dd23be88 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 28 Jan 2025 12:15:29 +0100 Subject: [PATCH 1109/2542] win32u: Implement NtUserMessageBeep(). (cherry picked from commit 01c751630f4125e65281a95a2b4f1753a9fbb184) CW-Bug-Id: #24755 --- dlls/user32/message.c | 9 --------- dlls/user32/user32.spec | 2 +- dlls/win32u/defwnd.c | 4 ++-- dlls/win32u/main.c | 5 +++++ dlls/win32u/menu.c | 4 ++-- dlls/win32u/sysparams.c | 8 ++++---- dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 1 - dlls/wow64win/user.c | 7 +++++++ include/ntuser.h | 7 +------ 10 files changed, 23 insertions(+), 26 deletions(-) diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 925cbe902d28..34fd2c8a2c8d 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -1233,15 +1233,6 @@ BOOL WINAPI SetMessageQueue( INT size ) } -/*********************************************************************** - * MessageBeep (USER32.@) - */ -BOOL WINAPI MessageBeep( UINT i ) -{ - return NtUserMessageBeep( i ); -} - - /****************************************************************** * SetTimer (USER32.@) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 0bc10c9da220..8dc5729caadb 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -861,7 +861,7 @@ @ stdcall MenuItemFromPoint(long long int64) @ stub MenuWindowProcA @ stub MenuWindowProcW -@ stdcall MessageBeep(long) +@ stdcall MessageBeep(long) NtUserMessageBeep @ stdcall MessageBoxA(long str str long) @ stdcall MessageBoxExA(long str str long long) @ stdcall MessageBoxExW(long wstr wstr long long) diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index a1873f1bc8c8..b48385e42884 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -449,7 +449,7 @@ static LRESULT handle_set_cursor( HWND hwnd, WPARAM wparam, LPARAM lparam ) WORD msg = HIWORD( lparam ); if (msg == WM_LBUTTONDOWN || msg == WM_MBUTTONDOWN || msg == WM_RBUTTONDOWN || msg == WM_XBUTTONDOWN) - message_beep( 0 ); + NtUserMessageBeep( 0 ); } break; @@ -2841,7 +2841,7 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, send_message( hwnd, WM_SYSCOMMAND, SC_KEYMENU, wch ); } else if (wparam != '\x1b') /* Ctrl-Esc */ - message_beep(0); + NtUserMessageBeep(0); break; case WM_KEYF1: diff --git a/dlls/win32u/main.c b/dlls/win32u/main.c index cd2fd5a22cc8..80d5abecce25 100644 --- a/dlls/win32u/main.c +++ b/dlls/win32u/main.c @@ -1836,6 +1836,11 @@ INT SYSCALL_API NtUserMenuItemFromPoint( HWND hwnd, HMENU handle, int x, int y ) SYSCALL_FUNC( NtUserMenuItemFromPoint ); } +BOOL SYSCALL_API NtUserMessageBeep( UINT type ) +{ + SYSCALL_FUNC( NtUserMessageBeep ); +} + LRESULT SYSCALL_API NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, void *result_info, DWORD type, BOOL ansi ) { diff --git a/dlls/win32u/menu.c b/dlls/win32u/menu.c index b7f45c016c45..7d76ca250c1e 100644 --- a/dlls/win32u/menu.c +++ b/dlls/win32u/menu.c @@ -4302,7 +4302,7 @@ static BOOL track_menu( HMENU hmenu, UINT flags, int x, int y, HWND hwnd, const pos = find_item_by_key( mt.hOwnerWnd, mt.hCurrentMenu, LOWORD( msg.wParam ), FALSE ); if (pos == -2) exit_menu = TRUE; - else if (pos == -1) message_beep( 0 ); + else if (pos == -1) NtUserMessageBeep( 0 ); else { select_item( mt.hOwnerWnd, mt.hCurrentMenu, pos, TRUE, 0 ); @@ -4467,7 +4467,7 @@ void track_keyboard_menu_bar( HWND hwnd, UINT wparam, WCHAR ch ) item = find_item_by_key( hwnd, menu, ch, wparam & HTSYSMENU ); if (item >= -2) { - if (item == -1) message_beep( 0 ); + if (item == -1) NtUserMessageBeep( 0 ); /* schedule end of menu tracking */ flags |= TF_ENDMENU; goto track_menu; diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 92bfd86c167a..a422dfc8f355 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -7054,7 +7054,10 @@ ULONG WINAPI NtUserGetProcessDpiAwarenessContext( HANDLE process ) return context; } -BOOL message_beep( UINT i ) +/*********************************************************************** + * NtUserMessageBeep (win32u.@) + */ +BOOL WINAPI NtUserMessageBeep( UINT type ) { BOOL active = TRUE; NtUserSystemParametersInfo( SPI_GETBEEP, 0, &active, FALSE ); @@ -7195,9 +7198,6 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code ) case NtUserCallOneParam_GetSystemMetrics: return get_system_metrics( arg ); - case NtUserCallOneParam_MessageBeep: - return message_beep( arg ); - case NtUserCallOneParam_PostQuitMessage: return post_quit_message( arg ); diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 32a3c3d97688..dae954c2a58c 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1203,7 +1203,7 @@ @ stdcall -syscall NtUserMapVirtualKeyEx(long long long) @ stub NtUserMarkWindowForRawMouse @ stdcall -syscall NtUserMenuItemFromPoint(long long long long) -@ stub NtUserMessageBeep +@ stdcall -syscall NtUserMessageBeep(long) @ stdcall -syscall NtUserMessageCall(long long long long long long long) @ stub NtUserMinInitialize @ stub NtUserMinMaximize diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index fcac555c8f8b..415bf3f9f96b 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -186,7 +186,6 @@ extern POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to ); extern RECT map_dpi_rect( RECT rect, UINT dpi_from, UINT dpi_to ); extern HRGN map_dpi_region( HRGN region, UINT dpi_from, UINT dpi_to ); extern struct window_rects map_dpi_window_rects( struct window_rects rects, UINT dpi_from, UINT dpi_to ); -extern BOOL message_beep( UINT i ); extern RECT map_rect_raw_to_virt( RECT rect, UINT dpi_to ); extern RECT map_rect_virt_to_raw( RECT rect, UINT dpi_from ); extern struct window_rects map_window_rects_virt_to_raw( struct window_rects rects, UINT dpi_from ); diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index ed9246142bb3..adb64e265912 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -3322,6 +3322,13 @@ NTSTATUS WINAPI wow64_NtUserMenuItemFromPoint( UINT *args ) return NtUserMenuItemFromPoint( hwnd, handle, x, y ); } +NTSTATUS WINAPI wow64_NtUserMessageBeep( UINT *args ) +{ + UINT type = get_ulong( &args ); + + return NtUserMessageBeep( type ); +} + static LRESULT message_call_32to64( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, void *result_info, DWORD type, BOOL ansi ) { diff --git a/include/ntuser.h b/include/ntuser.h index 57636fd3752c..5e92924190e9 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -886,6 +886,7 @@ W32KAPI BOOL WINAPI NtUserLockWindowUpdate( HWND hwnd ); W32KAPI BOOL WINAPI NtUserLogicalToPerMonitorDPIPhysicalPoint( HWND hwnd, POINT *pt ); W32KAPI UINT WINAPI NtUserMapVirtualKeyEx( UINT code, UINT type, HKL layout ); W32KAPI INT WINAPI NtUserMenuItemFromPoint( HWND hwnd, HMENU handle, int x, int y ); +W32KAPI BOOL WINAPI NtUserMessageBeep( UINT type ); W32KAPI LRESULT WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, void *result_info, DWORD type, BOOL ansi ); W32KAPI BOOL WINAPI NtUserMoveWindow( HWND hwnd, INT x, INT y, INT cx, INT cy, BOOL repaint ); @@ -1069,7 +1070,6 @@ enum NtUserCallOneParam_GetSysColorPen, NtUserCallOneParam_GetSystemMetrics, NtUserCallOneParam_GetVirtualScreenRect, - NtUserCallOneParam_MessageBeep, NtUserCallOneParam_PostQuitMessage, NtUserCallOneParam_RealizePalette, NtUserCallOneParam_ReplyMessage, @@ -1163,11 +1163,6 @@ static inline INT NtUserGetSystemMetrics( INT index ) return NtUserCallOneParam( index, NtUserCallOneParam_GetSystemMetrics ); } -static inline BOOL NtUserMessageBeep( UINT i ) -{ - return NtUserCallOneParam( i, NtUserCallOneParam_MessageBeep ); -} - static inline void NtUserPostQuitMessage( INT exit_code ) { NtUserCallOneParam( exit_code, NtUserCallOneParam_PostQuitMessage ); From 4a2a031ac4a9f079fb6633f9fd4e807f8037a503 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 28 Jan 2025 12:07:06 +0100 Subject: [PATCH 1110/2542] win32u: Implement NtUserPostQuitMessage(). (cherry picked from commit 28890e60ccbf0edec90bc5513188745530db8f2c) CW-Bug-Id: #24755 --- dlls/user32/dialog.c | 2 +- dlls/user32/message.c | 23 ----------------------- dlls/user32/user32.spec | 2 +- dlls/win32u/main.c | 5 +++++ dlls/win32u/message.c | 4 ++-- dlls/win32u/sysparams.c | 3 --- dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 1 - dlls/wow64win/user.c | 7 +++++++ include/ntuser.h | 7 +------ 10 files changed, 18 insertions(+), 38 deletions(-) diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c index a23ef26b10a2..219a4326441c 100644 --- a/dlls/user32/dialog.c +++ b/dlls/user32/dialog.c @@ -807,7 +807,7 @@ INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ) if (msg.message == WM_QUIT) { - PostQuitMessage( msg.wParam ); + NtUserPostQuitMessage( msg.wParam ); if (!IsWindow( hwnd )) return 0; break; } diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 34fd2c8a2c8d..493fb7bec307 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -713,29 +713,6 @@ BOOL WINAPI PostThreadMessageA( DWORD thread, UINT msg, WPARAM wparam, LPARAM lp } -/*********************************************************************** - * PostQuitMessage (USER32.@) - * - * Posts a quit message to the current thread's message queue. - * - * PARAMS - * exit_code [I] Exit code to return from message loop. - * - * RETURNS - * Nothing. - * - * NOTES - * This function is not the same as calling: - *|PostThreadMessage(GetCurrentThreadId(), WM_QUIT, exit_code, 0); - * It instead sets a flag in the message queue that signals it to generate - * a WM_QUIT message when there are no other pending sent or posted messages - * in the queue. - */ -void WINAPI PostQuitMessage( INT exit_code ) -{ - NtUserPostQuitMessage( exit_code ); -} - /*********************************************************************** * PeekMessageW (USER32.@) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 8dc5729caadb..b6b3450e5581 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -906,7 +906,7 @@ @ stub PlaySoundEvent @ stdcall PostMessageA(long long long long) @ stdcall PostMessageW(long long long long) -@ stdcall PostQuitMessage(long) +@ stdcall PostQuitMessage(long) NtUserPostQuitMessage @ stdcall PostThreadMessageA(long long long long) @ stdcall PostThreadMessageW(long long long long) NtUserPostThreadMessage @ stdcall PrintWindow(long long long) NtUserPrintWindow diff --git a/dlls/win32u/main.c b/dlls/win32u/main.c index 80d5abecce25..d33eaa95dc7b 100644 --- a/dlls/win32u/main.c +++ b/dlls/win32u/main.c @@ -1903,6 +1903,11 @@ BOOL SYSCALL_API NtUserPostMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM l SYSCALL_FUNC( NtUserPostMessage ); } +BOOL SYSCALL_API NtUserPostQuitMessage( INT exit_code ) +{ + SYSCALL_FUNC( NtUserPostQuitMessage ); +} + BOOL SYSCALL_API NtUserPostThreadMessage( DWORD thread, UINT msg, WPARAM wparam, LPARAM lparam ) { SYSCALL_FUNC( NtUserPostThreadMessage ); diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index dd9f05fcdcac..6af644f99925 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -3791,9 +3791,9 @@ NTSTATUS send_hardware_message( HWND hwnd, UINT flags, const INPUT *input, LPARA } /*********************************************************************** - * post_quit_message + * NtUserPostQuitMessage (win32u.@) */ -BOOL post_quit_message( int exit_code ) +BOOL WINAPI NtUserPostQuitMessage( INT exit_code ) { SERVER_START_REQ( post_quit_message ) { diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index a422dfc8f355..b55c596d342b 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -7198,9 +7198,6 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code ) case NtUserCallOneParam_GetSystemMetrics: return get_system_metrics( arg ); - case NtUserCallOneParam_PostQuitMessage: - return post_quit_message( arg ); - case NtUserCallOneParam_ReplyMessage: return reply_message_result( arg ); diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index dae954c2a58c..da106d18d0c9 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1232,7 +1232,7 @@ @ stub NtUserPlayEventSound @ stub NtUserPostKeyboardInputMessage @ stdcall -syscall NtUserPostMessage(long long long long) -@ stub NtUserPostQuitMessage +@ stdcall -syscall NtUserPostQuitMessage(long) @ stdcall -syscall NtUserPostThreadMessage(long long long long) @ stub NtUserPrepareForLogoff @ stdcall -syscall NtUserPrintWindow(long long long) diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 415bf3f9f96b..b1fe3771b2fa 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -132,7 +132,6 @@ extern void track_mouse_menu_bar( HWND hwnd, INT ht, int x, int y ); /* message.c */ extern BOOL kill_system_timer( HWND hwnd, UINT_PTR id ); extern BOOL reply_message_result( LRESULT result ); -extern BOOL post_quit_message( int exit_code ); extern NTSTATUS send_hardware_message( HWND hwnd, UINT flags, const INPUT *input, LPARAM lparam ); extern LRESULT send_internal_message_timeout( DWORD dest_pid, DWORD dest_tid, UINT msg, WPARAM wparam, LPARAM lparam, UINT flags, UINT timeout, diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index adb64e265912..cd37c2ee2d9c 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -3874,6 +3874,13 @@ NTSTATUS WINAPI wow64_NtUserPostMessage( UINT *args ) return NtUserPostMessage( hwnd, msg, wparam, lparam ); } +NTSTATUS WINAPI wow64_NtUserPostQuitMessage( UINT *args ) +{ + INT exit_code = get_ulong( &args ); + + return NtUserPostQuitMessage( exit_code ); +} + NTSTATUS WINAPI wow64_NtUserPostThreadMessage( UINT *args ) { DWORD thread = get_ulong( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index 5e92924190e9..06a291f3e6fd 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -901,6 +901,7 @@ W32KAPI HDESK WINAPI NtUserOpenInputDesktop( DWORD flags, BOOL inherit, ACCESS W32KAPI BOOL WINAPI NtUserPeekMessage( MSG *msg_out, HWND hwnd, UINT first, UINT last, UINT flags ); W32KAPI BOOL WINAPI NtUserPerMonitorDPIPhysicalToLogicalPoint( HWND hwnd, POINT *pt ); W32KAPI BOOL WINAPI NtUserPostMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ); +W32KAPI BOOL WINAPI NtUserPostQuitMessage( INT exit_code ); W32KAPI BOOL WINAPI NtUserPostThreadMessage( DWORD thread, UINT msg, WPARAM wparam, LPARAM lparam ); W32KAPI BOOL WINAPI NtUserPrintWindow( HWND hwnd, HDC hdc, UINT flags ); W32KAPI LONG WINAPI NtUserQueryDisplayConfig( UINT32 flags, UINT32 *paths_count, DISPLAYCONFIG_PATH_INFO *paths, @@ -1070,7 +1071,6 @@ enum NtUserCallOneParam_GetSysColorPen, NtUserCallOneParam_GetSystemMetrics, NtUserCallOneParam_GetVirtualScreenRect, - NtUserCallOneParam_PostQuitMessage, NtUserCallOneParam_RealizePalette, NtUserCallOneParam_ReplyMessage, NtUserCallOneParam_SetCaretBlinkTime, @@ -1163,11 +1163,6 @@ static inline INT NtUserGetSystemMetrics( INT index ) return NtUserCallOneParam( index, NtUserCallOneParam_GetSystemMetrics ); } -static inline void NtUserPostQuitMessage( INT exit_code ) -{ - NtUserCallOneParam( exit_code, NtUserCallOneParam_PostQuitMessage ); -} - static inline UINT NtUserRealizePalette( HDC hdc ) { return NtUserCallOneParam( HandleToUlong(hdc), NtUserCallOneParam_RealizePalette ); From 2b5a7c61ac13d8dd0d9e54a1fe63f6973144246c Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 22 Jan 2025 17:24:10 -0600 Subject: [PATCH 1111/2542] win32u: Implement NtUserGetCurrentInputMessageSource(). (cherry picked from commit 8affaf9074af70aa9e7a8fa6c24a2862d2c3016c) CW-Bug-Id: #24755 --- dlls/user32/message.c | 10 ---------- dlls/user32/user32.spec | 2 +- dlls/win32u/main.c | 5 +++++ dlls/win32u/message.c | 16 ++++++++++++++++ dlls/win32u/win32u.spec | 2 +- dlls/wow64win/user.c | 7 +++++++ include/ntuser.h | 1 + 7 files changed, 31 insertions(+), 12 deletions(-) diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 493fb7bec307..1d63e6c13bca 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -973,16 +973,6 @@ LPARAM WINAPI SetMessageExtraInfo(LPARAM lParam) } -/*********************************************************************** - * GetCurrentInputMessageSource (USER32.@) - */ -BOOL WINAPI GetCurrentInputMessageSource( INPUT_MESSAGE_SOURCE *source ) -{ - *source = NtUserGetThreadInfo()->msg_source; - return TRUE; -} - - /*********************************************************************** * MsgWaitForMultipleObjects (USER32.@) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index b6b3450e5581..3a50f8efa356 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -537,7 +537,7 @@ @ stdcall GetClipboardSequenceNumber() NtUserGetClipboardSequenceNumber @ stdcall GetClipboardViewer() NtUserGetClipboardViewer @ stdcall GetComboBoxInfo(long ptr) -@ stdcall GetCurrentInputMessageSource(ptr) +@ stdcall GetCurrentInputMessageSource(ptr) NtUserGetCurrentInputMessageSource @ stdcall GetCursor() NtUserGetCursor @ stdcall GetCursorFrameInfo(long long long ptr ptr) @ stdcall GetCursorInfo(ptr) NtUserGetCursorInfo diff --git a/dlls/win32u/main.c b/dlls/win32u/main.c index d33eaa95dc7b..4e81760c9d2b 100644 --- a/dlls/win32u/main.c +++ b/dlls/win32u/main.c @@ -1503,6 +1503,11 @@ HWND SYSCALL_API NtUserGetClipboardViewer(void) SYSCALL_FUNC( NtUserGetClipboardViewer ); } +BOOL SYSCALL_API NtUserGetCurrentInputMessageSource( INPUT_MESSAGE_SOURCE *source ) +{ + SYSCALL_FUNC( NtUserGetCurrentInputMessageSource ); +} + HCURSOR SYSCALL_API NtUserGetCursor(void) { SYSCALL_FUNC( NtUserGetCursor ); diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 6af644f99925..b83a664999b0 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -4656,3 +4656,19 @@ BOOL WINAPI NtUserTranslateMessage( const MSG *msg, UINT flags ) } return TRUE; } + +/*********************************************************************** + * NtUserGetCurrentInputMessageSource (win32u.@) + */ +BOOL WINAPI NtUserGetCurrentInputMessageSource( INPUT_MESSAGE_SOURCE *source ) +{ + TRACE( "source %p.\n", source ); + + if (!source) + { + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); + return FALSE; + } + *source = NtUserGetThreadInfo()->msg_source; + return TRUE; +} diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index da106d18d0c9..417d5e017c1a 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -997,7 +997,7 @@ @ stub NtUserGetControlBrush @ stub NtUserGetControlColor @ stub NtUserGetCurrentDpiInfoForWindow -@ stub NtUserGetCurrentInputMessageSource +@ stdcall -syscall NtUserGetCurrentInputMessageSource(ptr) @ stdcall -syscall NtUserGetCursor() @ stdcall -syscall NtUserGetCursorFrameInfo(long long ptr ptr) @ stdcall -syscall NtUserGetCursorInfo(ptr) diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index cd37c2ee2d9c..b75c29623989 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -2438,6 +2438,13 @@ NTSTATUS WINAPI wow64_NtUserGetClipboardViewer( UINT *args ) return HandleToUlong( NtUserGetClipboardViewer() ); } +NTSTATUS WINAPI wow64_NtUserGetCurrentInputMessageSource( UINT *args ) +{ + INPUT_MESSAGE_SOURCE *source = get_ptr( &args ); + + return NtUserGetCurrentInputMessageSource( source ); +} + NTSTATUS WINAPI wow64_NtUserGetCursor( UINT *args ) { return HandleToUlong( NtUserGetCursor() ); diff --git a/include/ntuser.h b/include/ntuser.h index 06a291f3e6fd..3ac58cad5766 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -813,6 +813,7 @@ W32KAPI INT WINAPI NtUserGetClipboardFormatName( UINT format, WCHAR *buffer, W32KAPI HWND WINAPI NtUserGetClipboardOwner(void); W32KAPI DWORD WINAPI NtUserGetClipboardSequenceNumber(void); W32KAPI HWND WINAPI NtUserGetClipboardViewer(void); +W32KAPI BOOL WINAPI NtUserGetCurrentInputMessageSource( INPUT_MESSAGE_SOURCE *source ); W32KAPI HCURSOR WINAPI NtUserGetCursor(void); W32KAPI HCURSOR WINAPI NtUserGetCursorFrameInfo( HCURSOR hCursor, DWORD istep, DWORD *rate_jiffies, DWORD *num_steps ); From b57f7a3f02fa3f9ea276bd51ef64b127fb1122af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aida=20Jonikien=C4=97?= Date: Thu, 19 Sep 2024 12:27:58 +0300 Subject: [PATCH 1112/2542] dinput8: Prefer the native DLL. Many mod/ASI loaders hijack this DLL to do their work so accommodate this fairly common case by preferring their library. CW-Bug-Id: #24533 --- dlls/dinput8/Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/dinput8/Makefile.in b/dlls/dinput8/Makefile.in index f3f5fdc4fd84..ac5b89747f78 100644 --- a/dlls/dinput8/Makefile.in +++ b/dlls/dinput8/Makefile.in @@ -2,6 +2,7 @@ MODULE = dinput8.dll IMPORTLIB = dinput8 IMPORTS = dinput8 dxguid uuid comctl32 ole32 user32 advapi32 hid setupapi EXTRADEFS = -DDIRECTINPUT_VERSION=0x0800 +EXTRADLLFLAGS = -Wb,--prefer-native PARENTSRC = ../dinput SOURCES = \ From 5f823f3a04c11188aa959310a1651c6238f0395f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 10 Feb 2025 18:32:14 +0100 Subject: [PATCH 1113/2542] winedmo: Seek to keyframes, using avformat_seek_file. CW-Bug-Id: #24850 --- dlls/winedmo/unix_demuxer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winedmo/unix_demuxer.c b/dlls/winedmo/unix_demuxer.c index 199a271b474f..808e3410d751 100644 --- a/dlls/winedmo/unix_demuxer.c +++ b/dlls/winedmo/unix_demuxer.c @@ -421,7 +421,7 @@ NTSTATUS demuxer_seek( void *arg ) TRACE( "demuxer %p, timestamp 0x%s\n", demuxer, wine_dbgstr_longlong( params->timestamp ) ); - if ((ret = av_seek_frame( demuxer->ctx, -1, timestamp, AVSEEK_FLAG_ANY )) < 0) + if ((ret = avformat_seek_file( demuxer->ctx, -1, 0, timestamp, timestamp, 0 )) < 0) { ERR( "Failed to seek demuxer %p, error %s.\n", demuxer, debugstr_averr(ret) ); return STATUS_UNSUCCESSFUL; From 510248b9ee6dfaba0324a0af9efb1fc908ba46a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 10 Feb 2025 21:21:48 +0100 Subject: [PATCH 1114/2542] mfreadwrite/reader: Fixup MFVideoFormat_IYUV format to NV12 when enumerating decoders. CW-Bug-Id: #24770 --- dlls/mfreadwrite/reader.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c index f98c98b91d81..e7e92647ca3d 100644 --- a/dlls/mfreadwrite/reader.c +++ b/dlls/mfreadwrite/reader.c @@ -1956,6 +1956,15 @@ static HRESULT source_reader_create_transform(struct source_reader *reader, BOOL out_type.guidSubtype = MFVideoFormat_RGB32; } + if (IsEqualGUID(&out_type.guidMajorType, &MFMediaType_Video) && IsEqualGUID(&out_type.guidSubtype, &MFVideoFormat_IYUV) + && IsEqualGUID(&category, &MFT_CATEGORY_VIDEO_DECODER)) + { + /* The WMV video decoder isn't registered for MFVideoFormat_IYUV, but selecting it as an output format still succeeds, + * the host decoders usually support IYUV as well, so fixup the subtype for MFTEnumEx. + */ + WARN("Fixing up MFVideoFormat_IYUV subtype for the video processor\n"); + out_type.guidSubtype = MFVideoFormat_NV12; + } count = 0; if (SUCCEEDED(hr = MFTEnumEx(category, 0, &in_type, allow_processor ? NULL : &out_type, &activates, &count))) From 00a5662b0a9de3eb8cd1a6a9e528cc6d12d9b8b6 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 10 Feb 2025 15:44:05 -0600 Subject: [PATCH 1115/2542] Revert "winex11: Use a property for other processes client windows." This reverts commit d5102e2a510faf94279c91494d588c4ce5eacf25. CW-Bug-Id: #24836 --- dlls/winex11.drv/window.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 6fe9ea85a137..db5d1feba730 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -101,8 +101,6 @@ static XContext host_window_context = 0; static const WCHAR whole_window_prop[] = {'_','_','w','i','n','e','_','x','1','1','_','w','h','o','l','e','_','w','i','n','d','o','w',0}; -static const WCHAR client_window_prop[] = - {'_','_','w','i','n','e','_','x','1','1','_','c','l','i','e','n','t','_','w','i','n','d','o','w',0}; static const WCHAR clip_window_prop[] = {'_','_','w','i','n','e','_','x','1','1','_','c','l','i','p','_','w','i','n','d','o','w',0}; static const WCHAR focus_time_prop[] = @@ -2082,7 +2080,6 @@ void detach_client_window( struct x11drv_win_data *data, Window client_window ) data->client_window = 0; data->offscreen_client = client_window; - NtUserRemoveProp( data->hwnd, client_window_prop ); } @@ -2107,7 +2104,6 @@ void attach_client_window( struct x11drv_win_data *data, Window client_window ) data->client_window = client_window; data->offscreen_client = 0; - NtUserSetProp( data->hwnd, client_window_prop, (HANDLE)data->client_window ); } @@ -2127,7 +2123,6 @@ void destroy_client_window( HWND hwnd, Window client_window ) { if (data->whole_window) client_window_events_disable( data, client_window ); data->client_window = 0; - NtUserRemoveProp( hwnd, client_window_prop ); } release_win_data( data ); } @@ -2179,7 +2174,6 @@ Window create_client_window( HWND hwnd, RECT client_rect, const XVisualInfo *vis if (data->client_window) { data->offscreen_client = 0; - NtUserSetProp( data->hwnd, client_window_prop, (HANDLE)data->client_window ); set_wine_allow_flip( data->client_window, 1 ); XMapWindow( gdi_display, data->client_window ); if (data->whole_window) @@ -2844,7 +2838,6 @@ Window get_onscreen_drawable( HWND hwnd, HWND toplevel, RECT *rect ) return window; } - if ((window = (Window)NtUserGetProp( toplevel, client_window_prop ))) return window; /* FIXME: apply visible / window rects offset */ return X11DRV_get_whole_window( toplevel ); } @@ -2884,14 +2877,9 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, if (top == hwnd && escape.drawable == root_window) escape.mode = ClipByChildren; release_win_data( data ); } - else if (!(escape.drawable = (Window)NtUserGetProp( top, client_window_prop )) || (flags & DCX_WINDOW)) - { - if (escape.drawable) WARN( "window %p has a client window\n", top ); - escape.drawable = X11DRV_get_whole_window( top ); - } else { - /* FIXME: apply visible / client rects offset */ + escape.drawable = X11DRV_get_whole_window( top ); } if (!escape.drawable) return; /* don't create a GC for foreign windows */ From 14fc91b5135d77b24a98c6724f338f7051e90e38 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 10 Feb 2025 15:44:25 -0600 Subject: [PATCH 1116/2542] Revert "winex11: Keep track of offscreen client windows." This reverts commit 035b662e0b5d3200b034d7b4a97a795aec206d90. CW-Bug-Id: #24836 --- dlls/winex11.drv/window.c | 6 +----- dlls/winex11.drv/x11drv.h | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index db5d1feba730..b79982aff41a 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2079,7 +2079,6 @@ void detach_client_window( struct x11drv_win_data *data, Window client_window ) } data->client_window = 0; - data->offscreen_client = client_window; } @@ -2103,7 +2102,6 @@ void attach_client_window( struct x11drv_win_data *data, Window client_window ) set_wine_allow_flip( client_window, 1 ); data->client_window = client_window; - data->offscreen_client = 0; } @@ -2118,7 +2116,6 @@ void destroy_client_window( HWND hwnd, Window client_window ) if ((data = get_win_data( hwnd ))) { - if (data->offscreen_client == client_window) data->offscreen_client = 0; if (data->client_window == client_window) { if (data->whole_window) client_window_events_disable( data, client_window ); @@ -2173,7 +2170,6 @@ Window create_client_window( HWND hwnd, RECT client_rect, const XVisualInfo *vis CWBackingStore | CWColormap | CWBorderPixel, &attr ); if (data->client_window) { - data->offscreen_client = 0; set_wine_allow_flip( data->client_window, 1 ); XMapWindow( gdi_display, data->client_window ); if (data->whole_window) @@ -2862,7 +2858,7 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, if ((data = get_win_data( top ))) { - if ((!(escape.drawable = data->client_window) && !(escape.drawable = data->offscreen_client)) || (flags & DCX_WINDOW)) + if (!(escape.drawable = data->client_window) || (flags & DCX_WINDOW)) { if (data->client_window) WARN( "window %p/%lx has an onscreen client window\n", data->hwnd, data->whole_window ); escape.drawable = data->whole_window; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 1f72cee07464..10688ba2d706 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -642,8 +642,7 @@ struct x11drv_win_data Colormap whole_colormap; /* colormap if non-default visual */ HWND hwnd; /* hwnd that this private data belongs to */ Window whole_window; /* X window for the complete window */ - Window client_window; /* X window for the onscreen client area */ - Window offscreen_client; /* X window for the offscreen client area */ + Window client_window; /* X window for the client area */ struct window_rects rects; /* window rects in monitor DPI, relative to parent client area */ struct host_window *parent; /* the host window parent, frame or embedder, NULL if root_window */ XIC xic; /* X input context */ From 2fce057d16e53aae8d375ca93e22c18757ef28c1 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 10 Feb 2025 15:44:26 -0600 Subject: [PATCH 1117/2542] Revert "winex11: Present to the client window if there's any." This reverts commit 0ef83b6a99d368738319b3082ee8567854e0cb68. CW-Bug-Id: #24836 --- dlls/winex11.drv/window.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index b79982aff41a..fac464e01867 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2824,12 +2824,9 @@ Window get_onscreen_drawable( HWND hwnd, HWND toplevel, RECT *rect ) if ((data = get_win_data( toplevel ))) { - if (!(window = data->client_window)) - { - OffsetRect( rect, data->rects.client.left - data->rects.visible.left, - data->rects.client.top - data->rects.visible.top ); - window = data->whole_window; - } + OffsetRect( rect, data->rects.client.left - data->rects.visible.left, + data->rects.client.top - data->rects.visible.top ); + window = data->whole_window; release_win_data( data ); return window; } From 583a3a81f081f7e59db811f7390e54b429560fa5 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 10 Feb 2025 15:44:28 -0600 Subject: [PATCH 1118/2542] Revert "winex11: Create DCs with the onscreen client window when possible." This reverts commit 4258d61b6fdf36ee8100d4999e2f5d260d76dde1. CW-Bug-Id: #24836 --- dlls/winex11.drv/window.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index fac464e01867..7bcf0371f799 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2855,17 +2855,7 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, if ((data = get_win_data( top ))) { - if (!(escape.drawable = data->client_window) || (flags & DCX_WINDOW)) - { - if (data->client_window) WARN( "window %p/%lx has an onscreen client window\n", data->hwnd, data->whole_window ); - escape.drawable = data->whole_window; - } - else - { - OffsetRect( &escape.dc_rect, data->rects.client.left - data->rects.window.left, - data->rects.client.top - data->rects.window.top ); - } - + escape.drawable = data->whole_window; /* special case: when repainting the root window, clip out top-level windows */ if (top == hwnd && escape.drawable == root_window) escape.mode = ClipByChildren; release_win_data( data ); From 7f4bf7b1038d72d31b06858efd0354af083a357a Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 10 Feb 2025 15:44:29 -0600 Subject: [PATCH 1119/2542] Revert "winex11: Avoid releasing invalid window data in X11DRV_GetDC." This reverts commit 1e8d5471801b2b6a6435e5ecdf1e8e6bddfdf63f. CW-Bug-Id: #24836 --- dlls/winex11.drv/window.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 7bcf0371f799..afa64ffebf9a 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2842,7 +2842,6 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, const RECT *top_rect, DWORD flags ) { struct x11drv_escape_set_drawable escape; - struct x11drv_win_data *data; escape.code = X11DRV_SET_DRAWABLE; escape.mode = IncludeInferiors; @@ -2853,11 +2852,14 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, escape.dc_rect.right = win_rect->right - top_rect->left; escape.dc_rect.bottom = win_rect->bottom - top_rect->top; - if ((data = get_win_data( top ))) + if (top == hwnd) { - escape.drawable = data->whole_window; + struct x11drv_win_data *data = get_win_data( hwnd ); + + escape.drawable = data ? data->whole_window : X11DRV_get_whole_window( hwnd ); + /* special case: when repainting the root window, clip out top-level windows */ - if (top == hwnd && escape.drawable == root_window) escape.mode = ClipByChildren; + if (data && data->whole_window == root_window) escape.mode = ClipByChildren; release_win_data( data ); } else From 459d4b9fd32e5fc0ddf96aa5da80a9841e71ba89 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 10 Feb 2025 15:45:03 -0600 Subject: [PATCH 1120/2542] Revert "winex11: Introduce a new get_onscreen_drawable helper." This reverts commit 7bf1ebd27b087878db58058c6041fe80cf4fb60d. CW-Bug-Id: #24836 --- dlls/winex11.drv/opengl.c | 13 ++++++++++++- dlls/winex11.drv/vulkan.c | 13 ++++++++++++- dlls/winex11.drv/window.c | 21 --------------------- dlls/winex11.drv/x11drv.h | 1 - 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 28d2858d71d3..8f5ea639ac27 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -3209,6 +3209,7 @@ static void present_gl_drawable( HWND hwnd, HDC hdc, struct gl_drawable *gl, BOO { HWND toplevel = NtUserGetAncestor( hwnd, GA_ROOT ); struct window_surface *surface; + struct x11drv_win_data *data; Drawable window, drawable; RECT rect_dst, rect; HRGN region; @@ -3246,12 +3247,22 @@ static void present_gl_drawable( HWND hwnd, HDC hdc, struct gl_drawable *gl, BOO } if (!drawable) return; - window = get_onscreen_drawable( hwnd, toplevel, &rect_dst ); + window = get_dc_drawable( hdc, &rect ); region = get_dc_monitor_region( hwnd, hdc ); if (gl_finish) pglFinish(); if (flush) XFlush( gdi_display ); + NtUserGetClientRect( hwnd, &rect_dst, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); + NtUserMapWindowPoints( hwnd, toplevel, (POINT *)&rect_dst, 2, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); + + if ((data = get_win_data( toplevel ))) + { + OffsetRect( &rect_dst, data->rects.client.left - data->rects.visible.left, + data->rects.client.top - data->rects.visible.top ); + release_win_data( data ); + } + if (get_dc_drawable( gl->hdc_dst, &rect ) != window || !EqualRect( &rect, &rect_dst )) set_dc_drawable( gl->hdc_dst, window, &rect_dst, IncludeInferiors ); if (region) NtGdiExtSelectClipRgn( gl->hdc_dst, region, RGN_COPY ); diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 79945588ade9..6ec9961f62b5 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -293,6 +293,7 @@ static void X11DRV_vulkan_surface_presented( HWND hwnd, void *private, VkResult { struct x11drv_vulkan_surface *surface = private; HWND toplevel = NtUserGetAncestor( hwnd, GA_ROOT ); + struct x11drv_win_data *data; RECT rect_dst, rect; Drawable window; HRGN region; @@ -303,9 +304,19 @@ static void X11DRV_vulkan_surface_presented( HWND hwnd, void *private, VkResult if (!surface->offscreen) return; if (!(hdc = NtUserGetDCEx( hwnd, 0, DCX_CACHE | DCX_USESTYLE ))) return; - window = get_onscreen_drawable( hwnd, toplevel, &rect_dst ); + window = X11DRV_get_whole_window( toplevel ); region = get_dc_monitor_region( hwnd, hdc ); + NtUserGetClientRect( hwnd, &rect_dst, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); + NtUserMapWindowPoints( hwnd, toplevel, (POINT *)&rect_dst, 2, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); + + if ((data = get_win_data( toplevel ))) + { + OffsetRect( &rect_dst, data->rects.client.left - data->rects.visible.left, + data->rects.client.top - data->rects.visible.top ); + release_win_data( data ); + } + if (get_dc_drawable( surface->hdc_dst, &rect ) != window || !EqualRect( &rect, &rect_dst )) set_dc_drawable( surface->hdc_dst, window, &rect_dst, IncludeInferiors ); if (region) NtGdiExtSelectClipRgn( surface->hdc_dst, region, RGN_COPY ); diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index afa64ffebf9a..7d4f09866576 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2813,27 +2813,6 @@ Window X11DRV_get_whole_window( HWND hwnd ) return ret; } -/* return the onscreen X drawable to be used when reading / writing pixels */ -Window get_onscreen_drawable( HWND hwnd, HWND toplevel, RECT *rect ) -{ - struct x11drv_win_data *data; - Window window; - - NtUserGetClientRect( hwnd, rect, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); - NtUserMapWindowPoints( hwnd, toplevel, (POINT *)rect, 2, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); - - if ((data = get_win_data( toplevel ))) - { - OffsetRect( rect, data->rects.client.left - data->rects.visible.left, - data->rects.client.top - data->rects.visible.top ); - window = data->whole_window; - release_win_data( data ); - return window; - } - - /* FIXME: apply visible / window rects offset */ - return X11DRV_get_whole_window( toplevel ); -} /*********************************************************************** * X11DRV_GetDC (X11DRV.@) diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 10688ba2d706..dec1c6584530 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -358,7 +358,6 @@ struct x11drv_escape_get_drawable extern BOOL enable_fullscreen_hack( HWND hwnd, BOOL check_gamma ); extern BOOL needs_offscreen_rendering( HWND hwnd, BOOL known_child, BOOL check_gamma ); -extern Window get_onscreen_drawable( HWND hwnd, HWND toplevel, RECT *rect ); extern void set_dc_drawable( HDC hdc, Drawable drawable, const RECT *rect, int mode ); extern Drawable get_dc_drawable( HDC hdc, RECT *rect ); extern HRGN get_dc_monitor_region( HWND hwnd, HDC hdc ); From 0e0b31ffc491297b1b79dd7bf2546c33d64236db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 4 Feb 2025 11:53:47 +0100 Subject: [PATCH 1121/2542] winex11.drv: Use get_win_data directly in X11DRV_GetDC. (cherry picked from commit a863d97843b07ce38a057b5bf39986b51b45c5f6) CW-Bug-Id: #24795 --- dlls/winex11.drv/window.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 7d4f09866576..80812ba96d7c 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2821,6 +2821,7 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, const RECT *top_rect, DWORD flags ) { struct x11drv_escape_set_drawable escape; + struct x11drv_win_data *data; escape.code = X11DRV_SET_DRAWABLE; escape.mode = IncludeInferiors; @@ -2831,14 +2832,11 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, escape.dc_rect.right = win_rect->right - top_rect->left; escape.dc_rect.bottom = win_rect->bottom - top_rect->top; - if (top == hwnd) + if ((data = get_win_data( top ))) { - struct x11drv_win_data *data = get_win_data( hwnd ); - - escape.drawable = data ? data->whole_window : X11DRV_get_whole_window( hwnd ); - + escape.drawable = data->whole_window; /* special case: when repainting the root window, clip out top-level windows */ - if (data && data->whole_window == root_window) escape.mode = ClipByChildren; + if (top == hwnd && data->whole_window == root_window) escape.mode = ClipByChildren; release_win_data( data ); } else From 070103d8b7bd93d9156be041cbb65419420766c6 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 29 Jan 2025 19:36:07 -0600 Subject: [PATCH 1122/2542] winex11.drv: Pass visual to is_wxrformat_compatible_with_visual. (cherry picked from commit 7835ec1e34596c33a1e91758d37db494d6949d0d) CW-Bug-Id: #24795 --- dlls/winex11.drv/xrender.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index f28a4ff70530..e381c3c26d56 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -250,12 +250,12 @@ static BOOL get_xrender_template(const WineXRenderFormatTemplate *fmt, XRenderPi return TRUE; } -static BOOL is_wxrformat_compatible_with_default_visual(const WineXRenderFormatTemplate *fmt) +static BOOL is_wxrformat_compatible_with_visual( const WineXRenderFormatTemplate *fmt, const XVisualInfo *visual ) { - if(fmt->depth != default_visual.depth) return FALSE; - if( (fmt->redMask << fmt->red) != default_visual.red_mask) return FALSE; - if( (fmt->greenMask << fmt->green) != default_visual.green_mask) return FALSE; - if( (fmt->blueMask << fmt->blue) != default_visual.blue_mask) return FALSE; + if (fmt->depth != visual->depth) return FALSE; + if ((fmt->redMask << fmt->red) != visual->red_mask) return FALSE; + if ((fmt->greenMask << fmt->green) != visual->green_mask) return FALSE; + if ((fmt->blueMask << fmt->blue) != visual->blue_mask) return FALSE; /* We never select a default ARGB visual */ if(fmt->alphaMask) return FALSE; @@ -278,7 +278,7 @@ static int load_xrender_formats(void) TRACE( "Loaded root pict_format with id=%#lx\n", pict_formats[i]->id ); continue; } - if(is_wxrformat_compatible_with_default_visual(&wxr_formats_template[i])) + if (is_wxrformat_compatible_with_visual( &wxr_formats_template[i], &default_visual )) { pict_formats[i] = pXRenderFindVisualFormat(gdi_display, default_visual.visual); if (!pict_formats[i]) From 886cae67fabc7b7395cb2aa40314b8a0c4ada21e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 29 Jan 2025 19:36:07 -0600 Subject: [PATCH 1123/2542] winex11.drv: Choose alpha-enabled xrender format for argb drawables. (cherry picked from commit 14f7bc1b360988023275bcf97210bb2af196258f) CW-Bug-Id: #24795 --- dlls/winex11.drv/opengl.c | 1 + dlls/winex11.drv/window.c | 2 ++ dlls/winex11.drv/x11drv.h | 1 + dlls/winex11.drv/xrender.c | 23 ++++++++++++++++++++--- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 8f5ea639ac27..69e2ae6ba859 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -3734,6 +3734,7 @@ static HDC X11DRV_wglGetPbufferDCARB( struct wgl_pbuffer *object ) escape.drawable = object->gl->drawable; escape.mode = IncludeInferiors; SetRect( &escape.dc_rect, 0, 0, object->width, object->height ); + escape.visual = default_visual; NtGdiExtEscape( hdc, NULL, 0, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL ); TRACE( "(%p)->(%p)\n", object, hdc ); diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 80812ba96d7c..ec47adf75407 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2835,6 +2835,7 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, if ((data = get_win_data( top ))) { escape.drawable = data->whole_window; + escape.visual = data->vis; /* special case: when repainting the root window, clip out top-level windows */ if (top == hwnd && data->whole_window == root_window) escape.mode = ClipByChildren; release_win_data( data ); @@ -2842,6 +2843,7 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, else { escape.drawable = X11DRV_get_whole_window( top ); + escape.visual = default_visual; /* FIXME: use the right visual for other process window */ } if (!escape.drawable) return; /* don't create a GC for foreign windows */ diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index dec1c6584530..d3218a18948e 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -347,6 +347,7 @@ struct x11drv_escape_set_drawable Drawable drawable; /* X drawable */ int mode; /* ClipByChildren or IncludeInferiors */ RECT dc_rect; /* DC rectangle relative to drawable */ + XVisualInfo visual; /* X visual used by drawable, may be unspecified if no change is needed */ }; struct x11drv_escape_get_drawable diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index e381c3c26d56..bd8796bd3c4d 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -257,8 +257,8 @@ static BOOL is_wxrformat_compatible_with_visual( const WineXRenderFormatTemplate if ((fmt->greenMask << fmt->green) != visual->green_mask) return FALSE; if ((fmt->blueMask << fmt->blue) != visual->blue_mask) return FALSE; - /* We never select a default ARGB visual */ - if(fmt->alphaMask) return FALSE; + /* Non-default visual is only used when alpha is required. */ + if (fmt->alphaMask && visual->visualid == default_visual.visualid) return FALSE; return TRUE; } @@ -985,8 +985,25 @@ static INT xrenderdrv_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID BOOL ret = dev->funcs->pExtEscape( dev, escape, in_count, in_data, out_count, out_data ); if (ret) { + const struct x11drv_escape_set_drawable *set = in_data; + enum wxr_format format = physdev->format; + unsigned int i; + + if (set->visual.visual) + { + for (i = 0; i < WXR_NB_FORMATS; ++i) + { + if (!pict_formats[i]) continue; + if (is_wxrformat_compatible_with_visual( &wxr_formats_template[i], &set->visual )) + { + format = i; + break; + } + } + if (i == WXR_NB_FORMATS) WARN( "Format not found for drawable visual.\n" ); + } free_xrender_picture( physdev ); - set_physdev_format( physdev, default_format ); + set_physdev_format( physdev, format ); } return ret; } From a523f978627a445cc868be635b9dcc2b3cdd2b3d Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 7 Feb 2025 13:36:25 -0600 Subject: [PATCH 1124/2542] Revert "win32u: Don't use a surface to paint the client area of Vulkan windows." This reverts commit 277a4372713246de8e6f72cff11d5a6d4651f045. CW-Bug-Id: #24836 --- dlls/win32u/dce.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index e116cdc5c06c..f715fcbb15b1 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -878,12 +878,8 @@ static void update_visible_region( struct dce *dce ) win = get_win_ptr( top_win ); if (win && win != WND_DESKTOP && win != WND_OTHER_PROCESS) { - /* don't use a surface to paint the client area of Vulkan windows */ - if (list_empty( &win->vulkan_surfaces ) || (flags & DCX_WINDOW)) - { - surface = win->surface; - if (surface) window_surface_add_ref( surface ); - } + surface = win->surface; + if (surface) window_surface_add_ref( surface ); release_win_ptr( win ); } } From 71c8830ee2d44b9e8aa35174c705938b5545ad3c Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 7 Feb 2025 19:39:31 -0600 Subject: [PATCH 1125/2542] winex11.drv: Handle emulated mode offset within X window. CW-Bug-Id: #24836 CW-Bug-Id: #24915 --- dlls/winex11.drv/bitblt.c | 65 ++++++++++++++++++++++++++++++--------- dlls/winex11.drv/window.c | 8 +++++ dlls/winex11.drv/x11drv.h | 1 + 3 files changed, 60 insertions(+), 14 deletions(-) diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index df84bcbc4c37..dd9ddb27afb6 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1589,6 +1589,10 @@ struct x11drv_window_surface GC gc; struct x11drv_image *image; BOOL byteswap; + int x_offset; + int y_offset; + RECT *clip_rects; + unsigned int clip_rect_count; }; static struct x11drv_window_surface *get_x11_surface( struct window_surface *surface ) @@ -1748,20 +1752,20 @@ static struct x11drv_image *x11drv_image_create( const BITMAPINFO *info, const X return NULL; } -static XRectangle *xrectangles_from_rects( const RECT *rects, UINT count ) +static XRectangle *xrectangles_from_rects( const RECT *rects, UINT count, int x_offset, int y_offset ) { XRectangle *xrects; if (!(xrects = malloc( count * sizeof(*xrects) ))) return NULL; while (count--) { - if (rects[count].left > SHRT_MAX) continue; - if (rects[count].top > SHRT_MAX) continue; - if (rects[count].right < SHRT_MIN) continue; - if (rects[count].bottom < SHRT_MIN) continue; - xrects[count].x = max( min( rects[count].left, SHRT_MAX), SHRT_MIN); - xrects[count].y = max( min( rects[count].top, SHRT_MAX), SHRT_MIN); - xrects[count].width = max( min( rects[count].right, SHRT_MAX ) - xrects[count].x, 0); - xrects[count].height = max( min( rects[count].bottom, SHRT_MAX ) - xrects[count].y, 0); + if (rects[count].left + x_offset > SHRT_MAX) continue; + if (rects[count].top + y_offset > SHRT_MAX) continue; + if (rects[count].right + x_offset < SHRT_MIN) continue; + if (rects[count].bottom + y_offset < SHRT_MIN) continue; + xrects[count].x = max( min( rects[count].left + x_offset, SHRT_MAX), SHRT_MIN); + xrects[count].y = max( min( rects[count].top + y_offset, SHRT_MAX), SHRT_MIN); + xrects[count].width = max( min( rects[count].right + x_offset, SHRT_MAX ) - xrects[count].x, 0); + xrects[count].height = max( min( rects[count].bottom + y_offset, SHRT_MAX ) - xrects[count].y, 0); } return xrects; } @@ -1776,10 +1780,17 @@ static void x11drv_surface_set_clip( struct window_surface *window_surface, cons TRACE( "surface %p, rects %p, count %u\n", surface, rects, count ); + free( surface->clip_rects ); + surface->clip_rects = NULL; + surface->clip_rect_count = 0; + if (!count) XSetClipMask( gdi_display, surface->gc, None ); - else if ((xrects = xrectangles_from_rects( rects, count ))) + else if ((xrects = xrectangles_from_rects( rects, count, surface->x_offset, surface->y_offset ))) { + surface->clip_rect_count = count; + surface->clip_rects = malloc( count * sizeof(*surface->clip_rects) ); + memcpy( surface->clip_rects, rects, count * sizeof(*surface->clip_rects) ); XSetClipRectangles( gdi_display, surface->gc, 0, 0, xrects, count, YXBanded ); free( xrects ); } @@ -1788,7 +1799,7 @@ static void x11drv_surface_set_clip( struct window_surface *window_surface, cons /*********************************************************************** * x11drv_surface_flush */ -static BOOL x11drv_surface_flush( struct window_surface *window_surface, const RECT *rect, const RECT *dirty, +static BOOL x11drv_surface_flush( struct window_surface *window_surface, const RECT *surface_rect, const RECT *dirty, const BITMAPINFO *color_info, const void *color_bits, BOOL shape_changed, const BITMAPINFO *shape_info, const void *shape_bits ) { @@ -1797,6 +1808,9 @@ static BOOL x11drv_surface_flush( struct window_surface *window_surface, const R XImage *ximage = surface->image->ximage; const unsigned char *src = color_bits; unsigned char *dst = (unsigned char *)ximage->data; + RECT rect = *surface_rect; + + OffsetRect( &rect, surface->x_offset, surface->y_offset ); if (alpha_bits == -1) { @@ -1846,15 +1860,15 @@ static BOOL x11drv_surface_flush( struct window_surface *window_surface, const R vis.depth = 1; shape = create_pixmap_from_image( 0, &vis, shape_info, &bits, DIB_RGB_COLORS ); - XShapeCombineMask( gdi_display, surface->window, ShapeBounding, 0, 0, shape, ShapeSet ); + XShapeCombineMask( gdi_display, surface->window, ShapeBounding, surface->x_offset, surface->y_offset, shape, ShapeSet ); XFreePixmap( gdi_display, shape ); } #endif /* HAVE_LIBXSHAPE */ } - if (!put_shm_image( ximage, &surface->image->shminfo, surface->window, surface->gc, rect, dirty )) + if (!put_shm_image( ximage, &surface->image->shminfo, surface->window, surface->gc, &rect, dirty )) XPutImage( gdi_display, surface->window, surface->gc, ximage, dirty->left, - dirty->top, rect->left + dirty->left, rect->top + dirty->top, + dirty->top, rect.left + dirty->left, rect.top + dirty->top, dirty->right - dirty->left, dirty->bottom - dirty->top ); XFlush( gdi_display ); @@ -1870,6 +1884,7 @@ static void x11drv_surface_destroy( struct window_surface *window_surface ) struct x11drv_window_surface *surface = get_x11_surface( window_surface ); TRACE( "freeing %p\n", surface ); + free( surface->clip_rects ); if (surface->gc) XFreeGC( gdi_display, surface->gc ); if (surface->image) x11drv_image_destroy( surface->image ); } @@ -1998,8 +2013,30 @@ BOOL X11DRV_CreateWindowSurface( HWND hwnd, BOOL layered, const RECT *surface_re *surface = create_surface( data->hwnd, data->whole_window, &data->vis, surface_rect, layered ? data->use_alpha : FALSE ); + set_surface_window_rects( *surface, &data->rects ); done: release_win_data( data ); return TRUE; } + +void set_surface_window_rects( struct window_surface *window_surface, const struct window_rects *rects ) +{ + if (window_surface && window_surface->funcs == &x11drv_surface_funcs) + { + struct x11drv_window_surface *surface = get_x11_surface( window_surface ); + XRectangle *xrects; + + window_surface_lock( window_surface ); + surface->x_offset = max( rects->window.left - rects->visible.left, 0 ); + surface->y_offset = max( rects->window.top - rects->visible.top, 0 ); + window_surface_unlock( window_surface ); + + if (surface->clip_rects && (xrects = xrectangles_from_rects( surface->clip_rects, surface->clip_rect_count, + surface->x_offset, surface->y_offset ))) + { + XSetClipRectangles( gdi_display, surface->gc, 0, 0, xrects, surface->clip_rect_count, YXBanded ); + free( xrects ); + } + } +} diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index ec47adf75407..76cc596f92da 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2822,6 +2822,7 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, { struct x11drv_escape_set_drawable escape; struct x11drv_win_data *data; + int emulated_mode_offset; escape.code = X11DRV_SET_DRAWABLE; escape.mode = IncludeInferiors; @@ -2836,6 +2837,12 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, { escape.drawable = data->whole_window; escape.visual = data->vis; + + if ((emulated_mode_offset = data->rects.window.left - data->rects.visible.left) > 0) + OffsetRect( &escape.dc_rect, emulated_mode_offset, 0 ); + if ((emulated_mode_offset = data->rects.window.top - data->rects.visible.top) > 0) + OffsetRect( &escape.dc_rect, 0, emulated_mode_offset ); + /* special case: when repainting the root window, clip out top-level windows */ if (top == hwnd && data->whole_window == root_window) escape.mode = ClipByChildren; release_win_data( data ); @@ -3067,6 +3074,7 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UIN BOOL was_fullscreen; sync_gl_drawable( hwnd, FALSE ); + set_surface_window_rects( surface, new_rects ); if (!(data = get_win_data( hwnd ))) return; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index d3218a18948e..6728bdcf983b 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -679,6 +679,7 @@ extern void set_window_parent( struct x11drv_win_data *data, Window parent ); extern Window X11DRV_get_whole_window( HWND hwnd ); extern Window get_dummy_parent(void); +extern void set_surface_window_rects( struct window_surface *window_surface, const struct window_rects *rects ); extern void sync_gl_drawable( HWND hwnd, BOOL known_child ); extern void set_gl_drawable_parent( HWND hwnd, HWND parent ); extern void destroy_gl_drawable( HWND hwnd ); From c78d1a4744a04b9924d20cf2a1ff5871f28f898b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 10 Feb 2025 15:22:37 -0600 Subject: [PATCH 1126/2542] win32u: Update Vulkan surfaces before querying formats. CW-Bug-Id: #24836 CW-Bug-Id: #23169 CW-Bug-Id: #19945 --- dlls/win32u/vulkan.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/win32u/vulkan.c b/dlls/win32u/vulkan.c index a2d9626c9bca..0be3ec9a2da6 100644 --- a/dlls/win32u/vulkan.c +++ b/dlls/win32u/vulkan.c @@ -290,6 +290,7 @@ static VkResult win32u_vkGetPhysicalDeviceSurfaceFormatsKHR( VkPhysicalDevice cl struct surface *surface = surface_from_handle( client_surface ); struct vulkan_instance *instance = physical_device->instance; + if (surface->hwnd) vulkan_update_surfaces( surface->hwnd ); return instance->p_vkGetPhysicalDeviceSurfaceFormatsKHR( physical_device->host.physical_device, surface->obj.host.surface, format_count, formats ); } @@ -303,6 +304,8 @@ static VkResult win32u_vkGetPhysicalDeviceSurfaceFormats2KHR( VkPhysicalDevice c struct vulkan_instance *instance = physical_device->instance; VkResult res; + if (surface->hwnd) vulkan_update_surfaces( surface->hwnd ); + if (!instance->p_vkGetPhysicalDeviceSurfaceFormats2KHR) { VkSurfaceFormatKHR *surface_formats; From cf74e5a6768ea79216050daa9cd27f3fff3ff71b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 10 Feb 2025 15:13:53 -0600 Subject: [PATCH 1127/2542] win32u, winex11.drv: Present offscreen Vulkan surface to window surface for Disgaea 5 Complete. CW-Bug-Id: #24836 CW-Bug-Id: #23169 CW-Bug-Id: #19945 --- dlls/win32u/window.c | 16 ++++++++++++++++ dlls/winex11.drv/vulkan.c | 29 ++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index f8e7b4e895b7..0a88e4d83f90 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1922,6 +1922,21 @@ static RECT get_visible_rect( HWND hwnd, BOOL shaped, UINT style, UINT ex_style, return visible_rect; } +static int force_present_to_surface(void) +{ + static int cached = -1; + + if (cached == -1) + { + const char *sgi = getenv( "SteamGameId" ); + + cached = sgi && + ( + !strcmp(sgi, "803600") + ); + } + return cached; +} static BOOL get_surface_rect( const RECT *visible_rect, RECT *surface_rect ) { @@ -1932,6 +1947,7 @@ static BOOL get_surface_rect( const RECT *visible_rect, RECT *surface_rect ) /* crop surfaces which are larger than the virtual screen rect, some applications create huge windows */ if ((surface_rect->right - surface_rect->left > virtual_rect.right - virtual_rect.left || surface_rect->bottom - surface_rect->top > virtual_rect.bottom - virtual_rect.top) && + !force_present_to_surface() && !intersect_rect( surface_rect, surface_rect, &virtual_rect )) return FALSE; OffsetRect( surface_rect, -visible_rect->left, -visible_rect->top ); diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 6ec9961f62b5..21b34593742e 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -289,10 +289,27 @@ static void X11DRV_vulkan_surface_update( HWND hwnd, void *private ) vulkan_surface_update_offscreen( hwnd, surface ); } +static int force_present_to_surface(void) +{ + static int cached = -1; + + if (cached == -1) + { + const char *sgi = getenv( "SteamGameId" ); + + cached = sgi && + ( + !strcmp(sgi, "803600") + ); + } + return cached; +} + static void X11DRV_vulkan_surface_presented( HWND hwnd, void *private, VkResult result ) { struct x11drv_vulkan_surface *surface = private; HWND toplevel = NtUserGetAncestor( hwnd, GA_ROOT ); + struct window_surface *win_surface; struct x11drv_win_data *data; RECT rect_dst, rect; Drawable window; @@ -304,9 +321,19 @@ static void X11DRV_vulkan_surface_presented( HWND hwnd, void *private, VkResult if (!surface->offscreen) return; if (!(hdc = NtUserGetDCEx( hwnd, 0, DCX_CACHE | DCX_USESTYLE ))) return; + + if (force_present_to_surface() && (win_surface = window_surface_get( hwnd ))) + { + TRACE("blitting to surface win_surface %p.\n", win_surface); + NtGdiStretchBlt( hdc, 0, 0, surface->rect.right - surface->rect.left, surface->rect.bottom - surface->rect.top, + surface->hdc_src, 0, 0, surface->rect.right, surface->rect.bottom, SRCCOPY, 0 ); + NtUserReleaseDC( hwnd, hdc ); + window_surface_release( win_surface ); + return; + } + window = X11DRV_get_whole_window( toplevel ); region = get_dc_monitor_region( hwnd, hdc ); - NtUserGetClientRect( hwnd, &rect_dst, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); NtUserMapWindowPoints( hwnd, toplevel, (POINT *)&rect_dst, 2, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); From 851aed2665380500e97032a5eccd7d65b491e4df Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 10 Feb 2025 18:09:30 -0600 Subject: [PATCH 1128/2542] amd_ags_x64: Support some version(s) before 3.1.1. CW-Bug-Id: #24871 --- dlls/amd_ags_x64/amd_ags_x64.spec | 1 + dlls/amd_ags_x64/amd_ags_x64_main.c | 44 +++++++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/dlls/amd_ags_x64/amd_ags_x64.spec b/dlls/amd_ags_x64/amd_ags_x64.spec index 252d9aaf116c..97ecca3c79a6 100644 --- a/dlls/amd_ags_x64/amd_ags_x64.spec +++ b/dlls/amd_ags_x64/amd_ags_x64.spec @@ -54,6 +54,7 @@ @ stdcall agsDriverExtensionsDX12_PushMarker(ptr ptr ptr) @ stdcall agsDriverExtensionsDX12_SetMarker(ptr ptr ptr) @ stdcall agsGetCrossfireGPUCount(ptr ptr) +@ stdcall agsGetDriverVersionInfo(ptr ptr) @ stdcall agsGetVersionNumber() @ stdcall agsInit(ptr ptr ptr) @ stdcall agsInitialize(long ptr ptr ptr) diff --git a/dlls/amd_ags_x64/amd_ags_x64_main.c b/dlls/amd_ags_x64/amd_ags_x64_main.c index 387a13b41734..ade9371aad1e 100644 --- a/dlls/amd_ags_x64/amd_ags_x64_main.c +++ b/dlls/amd_ags_x64/amd_ags_x64_main.c @@ -78,7 +78,7 @@ static const struct } amd_ags_info[AMD_AGS_VERSION_COUNT] = { - {AGS_MAKE_VERSION(3, 1, 0), AGS_MAKE_VERSION(4, 0, 3), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, + {AGS_MAKE_VERSION(3, 0, 0), AGS_MAKE_VERSION(4, 0, 3), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, {AGS_MAKE_VERSION(5, 0, 0), AGS_MAKE_VERSION(5, 0, 6), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, {AGS_MAKE_VERSION(5, 1, 1), AGS_MAKE_VERSION(5, 1, 1), sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511), 0}, {AGS_MAKE_VERSION(5, 2, 0), AGS_MAKE_VERSION(5, 2, 1), sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520), 0}, @@ -375,6 +375,14 @@ static enum amd_ags_version guess_version_from_exports(HMODULE hnative, int *ags * - CoD: Modern Warfare Remastered (2017) ships dll without version info which is version 5.0.1 * (not tagged in AGSSDK history), compatible with 5.0.5. */ + if (GetProcAddress(hnative, "agsGetDriverVersionInfo")) + { + /* agsGetDriverVersionInfo existed somewhere before 3.1.1, there is no SDK history in github before 3.1.1. */ + TRACE("agsGetDriverVersionInfo found.\n"); + *ags_version = AGS_MAKE_VERSION(3, 0, 0); + return AMD_AGS_VERSION_4_0_3; + } + if (GetProcAddress(hnative, "agsDriverExtensions_SetCrossfireMode")) { /* agsDriverExtensions_SetCrossfireMode was deprecated in 3.2.0 */ @@ -861,7 +869,12 @@ AGSReturnCode WINAPI agsInit(AGSContext **context, const AGSConfiguration *confi return ret; } - if (object->public_version <= AGS_MAKE_VERSION(3, 1, 1)) + if (object->public_version <= AGS_MAKE_VERSION(3, 0, 0)) + { + WARN("Detected pre-historic AGS version.\n"); + goto done; + } + else if (object->public_version <= AGS_MAKE_VERSION(3, 1, 1)) { /* Unfortunately it doesn't look sanely possible to distinguish 3.1.1 and 3.1.0 versions, while in * 3.1.0 radeonSoftwareVersion was present, removed in 3.1.1 and brought back in 3.2.2. */ @@ -1238,6 +1251,26 @@ AGSReturnCode WINAPI agsGetCrossfireGPUCount(AGSContext *context, int *gpu_count return AGS_SUCCESS; } +struct AGSDriverVersionInfo +{ + char strDriverVersion[256]; + char strCatalystVersion[256]; + char strCatalystWebLink[256]; +}; + +AGSReturnCode WINAPI agsGetDriverVersionInfo(AGSContext *context, struct AGSDriverVersionInfo *ver) +{ + TRACE("context %p, ver %p.\n", context, ver); + + if (!context || !ver) + return AGS_INVALID_ARGS; + + strcpy(ver->strDriverVersion, driver_version); + *ver->strCatalystVersion = 0; + *ver->strCatalystWebLink = 0; + return AGS_SUCCESS; +} + static void get_dx11_extensions_supported(ID3D11Device *device, AGSDX11ExtensionsSupported_600 *extensions) { ID3D11VkExtDevice *ext_device; @@ -1427,7 +1460,12 @@ AGSReturnCode WINAPI agsDriverExtensionsDX11_Init( AGSContext *context, ID3D11De ID3D11Device_GetImmediateContext(device, &context->d3d11_context); } get_dx11_extensions_supported(device, &context->extensions); - *extensionsSupported = *(unsigned int *)&context->extensions; + if (context->public_version <= AGS_MAKE_VERSION(3, 0, 0)) + *extensionsSupported = context->extensions.quadList | (context->extensions.uavOverlap << 1) + | (context->extensions.depthBoundsTest << 2) | (context->extensions.multiDrawIndirect << 3); + else + *extensionsSupported = *(unsigned int *)&context->extensions; + TRACE("-> %#x.\n", *extensionsSupported); } return AGS_SUCCESS; From 3c12bb26d0a811aa9f943011b5bef8fb93a60cf5 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Tue, 11 Feb 2025 18:28:56 +0800 Subject: [PATCH 1129/2542] winex11.drv: Call XIconifyWindow() after XMapWindow() with a minimized window. Mutter always unminimizes a window when handling map requests. So a window could be in normal state as far as Mutter concerns while Wine mistakenly considers it still minimized. Fix Disgaea PC black screen after Alt+Tab in fullscreen mode. Fix Mass Effect Legendary Edition (1328670) starts minimized. CW-Bug-Id: #18364 CW-Bug-Id: #24768 --- dlls/winex11.drv/window.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 76cc596f92da..75438b2beed1 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1496,7 +1496,8 @@ static int skip_iconify(void) if (cached == -1) { - cached = (env = getenv( "SteamGameId" )) && (0 + cached = X11DRV_HasWindowManager( "steamcompmgr" ) && + (env = getenv( "SteamGameId" )) && (0 || !strcmp( env, "1827980" ) || !strcmp( env, "1183470" ) ); @@ -1553,7 +1554,7 @@ static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state, U TRACE( "window %p/%lx, requesting WM_STATE %#x -> %#x serial %lu, foreground %p\n", data->hwnd, data->whole_window, old_state, new_state, data->wm_state_serial, NtUserGetForegroundWindow() ); - if (new_state == IconicState && X11DRV_HasWindowManager( "steamcompmgr" ) && skip_iconify()) + if (new_state == IconicState && skip_iconify()) { /* Gamescope will restore window when attempting to iconify it. Do not call XIconifyWindow() and * pretend that window is already minimized for the games which depend on some windows to be minimized. */ @@ -1569,7 +1570,18 @@ static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state, U case MAKELONG(WithdrawnState, NormalState): case MAKELONG(IconicState, NormalState): if (data->embedded) set_xembed_flags( data, XEMBED_MAPPED ); - else XMapWindow( data->display, data->whole_window ); + else + { + /* whole_window could be both iconic and mapped. Since XMapWindow() doesn't do + * anything if the window is already mapped, we need to unmap it first */ + if (old_state == IconicState) + XUnmapWindow( data->display, data->whole_window ); + XMapWindow( data->display, data->whole_window ); + /* Mutter always unminimizes windows when handling map requests. Restore iconic state + * except for some games on Gamescope */ + if (new_state == IconicState && !skip_iconify()) + XIconifyWindow( data->display, data->whole_window, data->vis.screen ); + } break; case MAKELONG(NormalState, WithdrawnState): case MAKELONG(IconicState, WithdrawnState): From 2d1c2a5f5a59bde1cdb982c2f3051c0b10bab501 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Thu, 22 Aug 2024 12:17:21 +0800 Subject: [PATCH 1130/2542] winex11.drv: Delete unused parameters for X11DRV_init_desktop(). CW-Bug-Id: #24163 --- dlls/winex11.drv/desktop.c | 4 ++-- dlls/winex11.drv/window.c | 2 +- dlls/winex11.drv/x11drv.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index 39e904dc7ee1..743720804f8d 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -51,7 +51,7 @@ BOOL is_virtual_desktop(void) * * Setup the desktop when not using the root window. */ -void X11DRV_init_desktop( Window win, unsigned int width, unsigned int height ) +void X11DRV_init_desktop( Window win ) { host_primary_rect = get_host_primary_monitor_rect(); root_window = win; @@ -91,7 +91,7 @@ BOOL X11DRV_CreateDesktop( const WCHAR *name, UINT width, UINT height ) x11drv_xinput2_enable( display, win ); XFlush( display ); - X11DRV_init_desktop( win, width, height ); + X11DRV_init_desktop( win ); return TRUE; } diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 75438b2beed1..df389acded9d 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2525,7 +2525,7 @@ void X11DRV_SetDesktopWindow( HWND hwnd ) else { Window win = (Window)NtUserGetProp( hwnd, whole_window_prop ); - if (win && win != root_window) X11DRV_init_desktop( win, width, height ); + if (win && win != root_window) X11DRV_init_desktop( win ); } } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 6728bdcf983b..183a8174c73c 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -802,7 +802,7 @@ struct x11drv_settings_handler extern void X11DRV_Settings_SetHandler(const struct x11drv_settings_handler *handler); -extern void X11DRV_init_desktop( Window win, unsigned int width, unsigned int height ); +extern void X11DRV_init_desktop( Window win ); extern BOOL is_virtual_desktop(void); extern BOOL is_desktop_fullscreen(void); extern BOOL is_detached_mode(const DEVMODEW *); From f718615c07192def6e6134de44c661d3d66f6c3a Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Thu, 22 Aug 2024 15:16:25 +0800 Subject: [PATCH 1131/2542] winex11.drv: Properly check if the desktop window is fullscreen on multi-monitor systems. If there are two monitors and the primary monitor is on the right side and virtual desktop resolution happens to be the same as the primary monitor, then the X11 desktop window will not have window frames and show as a fullscreen window before this patch. is_desktop_fullscreen() should check against the monitor that it is on to decide whether to use fullscreen mode instead of always checking against the primary monitor. CW-Bug-Id: #24163 --- dlls/winex11.drv/desktop.c | 23 ++++++++++---- dlls/winex11.drv/display.c | 61 ++++++++++++++++++++++++++++++++++++++ dlls/winex11.drv/x11drv.h | 1 + 3 files changed, 80 insertions(+), 5 deletions(-) diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index 743720804f8d..d9d306ef645a 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -35,7 +35,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(x11drv); -static RECT host_primary_rect; +static RECT *host_monitor_rects; +static int host_monitor_rect_count; #define _NET_WM_STATE_REMOVE 0 #define _NET_WM_STATE_ADD 1 @@ -53,7 +54,9 @@ BOOL is_virtual_desktop(void) */ void X11DRV_init_desktop( Window win ) { - host_primary_rect = get_host_primary_monitor_rect(); + if (host_monitor_rects) free( host_monitor_rects ); + if (!get_host_monitor_rects( &host_monitor_rects, &host_monitor_rect_count )) + ERR("Failed to get host monitor rectangle.\n"); root_window = win; managed_mode = FALSE; /* no managed windows in desktop mode */ } @@ -97,7 +100,17 @@ BOOL X11DRV_CreateDesktop( const WCHAR *name, UINT width, UINT height ) BOOL is_desktop_fullscreen(void) { - RECT primary_rect = NtUserGetPrimaryMonitorRect(); - return (primary_rect.right - primary_rect.left == host_primary_rect.right - host_primary_rect.left && - primary_rect.bottom - primary_rect.top == host_primary_rect.bottom - host_primary_rect.top); + Display *display = thread_display(); + unsigned int width, height, border, depth; + int x, y, i; + Window root; + RECT rect; + + XGetGeometry( display, root_window, &root, &x, &y, &width, &height, &border, &depth ); + SetRect( &rect, x, y, x + width, y + height ); + + for (i = 0; i < host_monitor_rect_count; i++) + if (EqualRect( &host_monitor_rects[i], &rect) ) return TRUE; + + return FALSE; } diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index 357e434ac5e9..18d75a670144 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -323,6 +323,67 @@ RECT get_host_primary_monitor_rect(void) return rect; } +/* Get an array of host monitor rectangles in X11 root coordinates. Free the array when it's done */ +BOOL get_host_monitor_rects( RECT **ret_rects, int *ret_count ) +{ + int gpu_count, adapter_count, monitor_count, rect_count = 0; + int gpu_idx, adapter_idx, monitor_idx, rect_idx; + struct x11drv_gpu *gpus = NULL; + struct x11drv_adapter *adapters = NULL; + struct gdi_monitor *monitors = NULL; + RECT *rects = NULL, *new_rects; + POINT left_top = {INT_MAX, INT_MAX}; + + if (!host_handler.get_gpus( &gpus, &gpu_count, FALSE )) goto failed; + + for (gpu_idx = 0; gpu_idx < gpu_count; gpu_idx++) + { + if (!host_handler.get_adapters( gpus[gpu_idx].id, &adapters, &adapter_count )) goto failed; + + for (adapter_idx = 0; adapter_idx < adapter_count; adapter_idx++) + { + if (!host_handler.get_monitors( adapters[adapter_idx].id, &monitors, &monitor_count )) goto failed; + + new_rects = realloc( rects, (rect_count + monitor_count) * sizeof(*rects) ); + if (!new_rects) goto failed; + rects = new_rects; + + for (monitor_idx = 0; monitor_idx < monitor_count; monitor_idx++) + { + rects[rect_count++] = monitors[monitor_idx].rc_monitor; + left_top.x = min( left_top.x, monitors[monitor_idx].rc_monitor.left ); + left_top.y = min( left_top.y, monitors[monitor_idx].rc_monitor.top ); + } + + host_handler.free_monitors( monitors, monitor_count ); + monitors = NULL; + } + + host_handler.free_adapters( adapters ); + adapters = NULL; + } + + host_handler.free_gpus( gpus, gpu_count ); + gpus = NULL; + + /* Convert from win32 virtual screen coordinates to X11 root coordinates */ + for (rect_idx = 0; rect_idx < rect_count; rect_idx++) + OffsetRect( &rects[rect_idx], -left_top.x, -left_top.y ); + + *ret_rects = rects; + *ret_count = rect_count; + return TRUE; + +failed: + if (monitors) host_handler.free_monitors( monitors, monitor_count ); + if (adapters) host_handler.free_adapters( adapters ); + if (gpus) host_handler.free_gpus( gpus, gpu_count ); + free( rects ); + *ret_rects = NULL; + *ret_count = 0; + return FALSE; +} + RECT get_work_area(const RECT *monitor_rect) { Atom type; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 183a8174c73c..ad1999bd8ca7 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -742,6 +742,7 @@ extern int X11DRV_check_error(void); extern POINT virtual_screen_to_root( INT x, INT y ); extern POINT root_to_virtual_screen( INT x, INT y ); extern RECT get_host_primary_monitor_rect(void); +extern BOOL get_host_monitor_rects( RECT **ret_rects, int *ret_count ); extern RECT get_work_area( const RECT *monitor_rect ); extern BOOL xinerama_get_fullscreen_monitors( const RECT *rect, long *indices ); extern void xinerama_init( unsigned int width, unsigned int height ); From 34d0742bd991609c0078cbb081fa656e1cf859e7 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Tue, 11 Feb 2025 22:44:40 +0800 Subject: [PATCH 1132/2542] Revert "winex11.drv: Call XIconifyWindow() after XMapWindow() with a minimized window." This reverts commit e72f0e6f71ec3b5bab860c1c8ce36654fcb365c0 from MR539. --- dlls/winex11.drv/window.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index df389acded9d..ce65a5540b1f 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1496,8 +1496,7 @@ static int skip_iconify(void) if (cached == -1) { - cached = X11DRV_HasWindowManager( "steamcompmgr" ) && - (env = getenv( "SteamGameId" )) && (0 + cached = (env = getenv( "SteamGameId" )) && (0 || !strcmp( env, "1827980" ) || !strcmp( env, "1183470" ) ); @@ -1554,7 +1553,7 @@ static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state, U TRACE( "window %p/%lx, requesting WM_STATE %#x -> %#x serial %lu, foreground %p\n", data->hwnd, data->whole_window, old_state, new_state, data->wm_state_serial, NtUserGetForegroundWindow() ); - if (new_state == IconicState && skip_iconify()) + if (new_state == IconicState && X11DRV_HasWindowManager( "steamcompmgr" ) && skip_iconify()) { /* Gamescope will restore window when attempting to iconify it. Do not call XIconifyWindow() and * pretend that window is already minimized for the games which depend on some windows to be minimized. */ @@ -1570,18 +1569,7 @@ static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state, U case MAKELONG(WithdrawnState, NormalState): case MAKELONG(IconicState, NormalState): if (data->embedded) set_xembed_flags( data, XEMBED_MAPPED ); - else - { - /* whole_window could be both iconic and mapped. Since XMapWindow() doesn't do - * anything if the window is already mapped, we need to unmap it first */ - if (old_state == IconicState) - XUnmapWindow( data->display, data->whole_window ); - XMapWindow( data->display, data->whole_window ); - /* Mutter always unminimizes windows when handling map requests. Restore iconic state - * except for some games on Gamescope */ - if (new_state == IconicState && !skip_iconify()) - XIconifyWindow( data->display, data->whole_window, data->vis.screen ); - } + else XMapWindow( data->display, data->whole_window ); break; case MAKELONG(NormalState, WithdrawnState): case MAKELONG(IconicState, WithdrawnState): From 77d917345570d168081c473b72f94228f73d5ffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 11 Feb 2025 15:24:46 +0100 Subject: [PATCH 1133/2542] winex11: Delay changing window config if win32 side is still minimized. Some games react to focus change before we have a chance to apply window state updates to the win32 side. In that case update ignore the window config change until a later time as they will still have their minimized size. CW-Bug-Id: #18364 --- dlls/winex11.drv/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index ce65a5540b1f..6c3655874d08 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1878,7 +1878,7 @@ static void sync_window_position( struct x11drv_win_data *data, UINT swp_flags, RECT new_rect, window_rect; BOOL above = FALSE; - if (data->managed && data->desired_state.wm_state == IconicState) return; + if (data->managed && ((style & WS_MINIMIZE) || data->desired_state.wm_state == IconicState)) return; if (!(swp_flags & SWP_NOZORDER) || (swp_flags & SWP_SHOWWINDOW)) { From d8b214935067af33916a7f119f0d8a125ce6d493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 11 Feb 2025 11:26:05 +0100 Subject: [PATCH 1134/2542] winex11: Avoid blitting empty GL/VK rects. CW-Bug-Id: #24773 --- dlls/winex11.drv/opengl.c | 6 ++++-- dlls/winex11.drv/vulkan.c | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 69e2ae6ba859..c18f62364733 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -3247,14 +3247,13 @@ static void present_gl_drawable( HWND hwnd, HDC hdc, struct gl_drawable *gl, BOO } if (!drawable) return; - window = get_dc_drawable( hdc, &rect ); - region = get_dc_monitor_region( hwnd, hdc ); if (gl_finish) pglFinish(); if (flush) XFlush( gdi_display ); NtUserGetClientRect( hwnd, &rect_dst, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); NtUserMapWindowPoints( hwnd, toplevel, (POINT *)&rect_dst, 2, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); + if (IsRectEmpty( &rect_dst ) || IsRectEmpty( &gl->rect )) return; if ((data = get_win_data( toplevel ))) { @@ -3263,6 +3262,9 @@ static void present_gl_drawable( HWND hwnd, HDC hdc, struct gl_drawable *gl, BOO release_win_data( data ); } + window = get_dc_drawable( hdc, &rect ); + region = get_dc_monitor_region( hwnd, hdc ); + if (get_dc_drawable( gl->hdc_dst, &rect ) != window || !EqualRect( &rect, &rect_dst )) set_dc_drawable( gl->hdc_dst, window, &rect_dst, IncludeInferiors ); if (region) NtGdiExtSelectClipRgn( gl->hdc_dst, region, RGN_COPY ); diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 21b34593742e..bd5768f37052 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -320,11 +320,11 @@ static void X11DRV_vulkan_surface_presented( HWND hwnd, void *private, VkResult vulkan_surface_update_offscreen( hwnd, surface ); if (!surface->offscreen) return; - if (!(hdc = NtUserGetDCEx( hwnd, 0, DCX_CACHE | DCX_USESTYLE ))) return; if (force_present_to_surface() && (win_surface = window_surface_get( hwnd ))) { TRACE("blitting to surface win_surface %p.\n", win_surface); + if (!(hdc = NtUserGetDCEx( hwnd, 0, DCX_CACHE | DCX_USESTYLE ))) return; NtGdiStretchBlt( hdc, 0, 0, surface->rect.right - surface->rect.left, surface->rect.bottom - surface->rect.top, surface->hdc_src, 0, 0, surface->rect.right, surface->rect.bottom, SRCCOPY, 0 ); NtUserReleaseDC( hwnd, hdc ); @@ -332,10 +332,9 @@ static void X11DRV_vulkan_surface_presented( HWND hwnd, void *private, VkResult return; } - window = X11DRV_get_whole_window( toplevel ); - region = get_dc_monitor_region( hwnd, hdc ); NtUserGetClientRect( hwnd, &rect_dst, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); NtUserMapWindowPoints( hwnd, toplevel, (POINT *)&rect_dst, 2, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); + if (IsRectEmpty( &rect_dst ) || IsRectEmpty( &surface->rect )) return; if ((data = get_win_data( toplevel ))) { @@ -344,6 +343,10 @@ static void X11DRV_vulkan_surface_presented( HWND hwnd, void *private, VkResult release_win_data( data ); } + if (!(hdc = NtUserGetDCEx( hwnd, 0, DCX_CACHE | DCX_USESTYLE ))) return; + window = X11DRV_get_whole_window( toplevel ); + region = get_dc_monitor_region( hwnd, hdc ); + if (get_dc_drawable( surface->hdc_dst, &rect ) != window || !EqualRect( &rect, &rect_dst )) set_dc_drawable( surface->hdc_dst, window, &rect_dst, IncludeInferiors ); if (region) NtGdiExtSelectClipRgn( surface->hdc_dst, region, RGN_COPY ); From 2688d5388f97acf086807877b0c9e42c8e8bc658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 7 Feb 2025 10:56:23 +0100 Subject: [PATCH 1135/2542] winex11: Use sync_window_position in WM_WINE_DESKTOP_RESIZED. CW-Bug-Id: #24781 --- dlls/winex11.drv/window.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 6c3655874d08..c498d413a6cf 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -3383,6 +3383,8 @@ LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) { struct x11drv_win_data *data; + TRACE( "window msg %x hwnd %p wp %lx lp %lx\n", msg, hwnd, (long)wp, lp ); + switch(msg) { case WM_X11DRV_UPDATE_CLIPBOARD: @@ -3397,9 +3399,7 @@ LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) case WM_WINE_DESKTOP_RESIZED: if ((data = get_win_data( hwnd ))) { - /* update the full screen state */ - update_net_wm_states( data ); - window_set_config( data, &data->rects.visible, FALSE, 0 ); + sync_window_position( data, SWP_NOACTIVATE, &data->rects ); release_win_data( data ); } return 0; From d44b88dc283a40d3d3be0fd7a5f6a01eec78f856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 6 Feb 2025 17:29:47 +0100 Subject: [PATCH 1136/2542] winex11: Add more _NET_WM_USER_TIME traces. CW-Bug-Id: #24817 --- dlls/winex11.drv/keyboard.c | 7 ++++++- dlls/winex11.drv/mouse.c | 8 +++++++- dlls/winex11.drv/window.c | 28 +++++++++++++++++----------- dlls/winex11.drv/x11drv.h | 2 +- 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index 3d23b2561fef..23eb20f6ad7a 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -1335,12 +1335,17 @@ BOOL X11DRV_KeyEvent( HWND hwnd, XEvent *xev ) int ascii_chars; XIC xic = X11DRV_get_ic( hwnd ); DWORD event_time = EVENT_x11_time_to_win32_time(event->time); + struct x11drv_win_data *data; Status status = 0; TRACE_(key)("type %d, window %lx, state 0x%04x, keycode %u\n", event->type, event->window, event->state, event->keycode); - if (hwnd && event->type == KeyPress) update_user_time( event->display, event->window, event->time, FALSE ); + if (event->type == KeyPress && (data = get_win_data( hwnd ))) + { + update_user_time( data, event->time, FALSE ); + release_win_data( data ); + } /* Clients should pass only KeyPress events to XmbLookupString */ if (xic && event->type == KeyPress) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 9e62efe91ec8..8ccce7d6ff31 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -1601,6 +1601,7 @@ BOOL X11DRV_ButtonPress( HWND hwnd, XEvent *xev ) { XButtonEvent *event = &xev->xbutton; int buttonNum = event->button - 1; + struct x11drv_win_data *data; INPUT input; if (buttonNum >= NB_BUTTONS) return FALSE; @@ -1614,7 +1615,12 @@ BOOL X11DRV_ButtonPress( HWND hwnd, XEvent *xev ) input.mi.time = EVENT_x11_time_to_win32_time( event->time ); input.mi.dwExtraInfo = 0; - if (hwnd) update_user_time( event->display, event->window, event->time, FALSE ); + if ((data = get_win_data( hwnd ))) + { + update_user_time( data, event->time, FALSE ); + release_win_data( data ); + } + map_event_coords( hwnd, event->window, event->root, event->x_root, event->y_root, &input ); send_mouse_input( hwnd, event->window, event->state, &input ); return TRUE; diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index c498d413a6cf..72327d32f1f8 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -256,7 +256,7 @@ void host_window_set_parent( struct host_window *win, Window parent ) /*********************************************************************** * http://standards.freedesktop.org/startup-notification-spec */ -static void remove_startup_notification(Display *display, Window window) +static void remove_startup_notification( struct x11drv_win_data *data ) { static LONG startup_notification_removed = 0; char message[1024]; @@ -272,7 +272,9 @@ static void remove_startup_notification(Display *display, Window window) if (!(id = getenv( "DESKTOP_STARTUP_ID" )) || !id[0]) return; - if ((src = strstr( id, "_TIME" ))) update_user_time( display, window, atol( src + 5 ), FALSE ); + TRACE( "Using DESKTOP_STARTUP_ID %s\n", debugstr_a(id) ); + + if ((src = strstr( id, "_TIME" ))) update_user_time( data, atol( src + 5 ), FALSE ); pos = snprintf(message, sizeof(message), "remove: ID="); message[pos++] = '"'; @@ -288,8 +290,8 @@ static void remove_startup_notification(Display *display, Window window) xevent.xclient.type = ClientMessage; xevent.xclient.message_type = x11drv_atom(_NET_STARTUP_INFO_BEGIN); - xevent.xclient.display = display; - xevent.xclient.window = window; + xevent.xclient.display = data->display; + xevent.xclient.window = data->whole_window; xevent.xclient.format = 8; src = message; @@ -305,7 +307,7 @@ static void remove_startup_notification(Display *display, Window window) src += msglen; srclen -= msglen; - XSendEvent( display, DefaultRootWindow( display ), False, PropertyChangeMask, &xevent ); + XSendEvent( data->display, DefaultRootWindow( data->display ), False, PropertyChangeMask, &xevent ); xevent.xclient.message_type = x11drv_atom(_NET_STARTUP_INFO); } } @@ -1162,11 +1164,15 @@ Window init_clip_window(void) /*********************************************************************** * update_user_time */ -void update_user_time( Display *display, Window window, Time time, BOOL force ) +void update_user_time( struct x11drv_win_data *data, Time time, BOOL force ) { if (!force && (time == -1 || time == 0)) time = 1; - if (time == -1) XDeleteProperty( display, window, x11drv_atom(_NET_WM_USER_TIME) ); - else XChangeProperty( display, window, x11drv_atom(_NET_WM_USER_TIME), XA_CARDINAL, + + TRACE( "window %p/%lx, requesting _NET_WM_USER_TIME %ld serial %lu\n", data->hwnd, data->whole_window, + time, NextRequest( data->display ) ); + + if (time == -1) XDeleteProperty( data->display, data->whole_window, x11drv_atom(_NET_WM_USER_TIME) ); + else XChangeProperty( data->display, data->whole_window, x11drv_atom(_NET_WM_USER_TIME), XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&time, 1 ); } @@ -1521,7 +1527,7 @@ static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state, U { case MAKELONG(WithdrawnState, IconicState): case MAKELONG(WithdrawnState, NormalState): - remove_startup_notification( data->display, data->whole_window ); + remove_startup_notification( data ); set_wm_hints( data, swp_flags ); update_net_wm_states( data ); sync_window_style( data ); @@ -1537,8 +1543,8 @@ static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state, U { /* try forcing activation if the window is supposed to be foreground or if it is fullscreen */ if (data->hwnd == foreground || data->is_fullscreen) swp_flags = 0; - if (swp_flags & SWP_NOACTIVATE) update_user_time( data->display, data->whole_window, 0, TRUE ); - else update_user_time( data->display, data->whole_window, -1, TRUE ); + if (swp_flags & SWP_NOACTIVATE) update_user_time( data, 0, TRUE ); + else update_user_time( data, -1, TRUE ); } else if (data->has_focus && data->hwnd != foreground) { diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index ad1999bd8ca7..1ef0bea49b05 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -697,7 +697,7 @@ extern void net_supported_init( struct x11drv_thread_data *data ); extern void net_supporting_wm_check_init( struct x11drv_thread_data *data ); extern Window init_clip_window(void); -extern void update_user_time( Display *display, Window window, Time time, BOOL force ); +extern void update_user_time( struct x11drv_win_data *data, Time time, BOOL force ); extern UINT get_window_net_wm_state( Display *display, Window window ); extern void make_window_embedded( struct x11drv_win_data *data ); extern Window create_client_window( HWND hwnd, RECT client_rect, const XVisualInfo *visual, Colormap colormap ); From 4bea63c952433bea35bbe387858f39c5afe5aaba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 11 Feb 2025 10:42:01 +0100 Subject: [PATCH 1137/2542] winex11: Only update _NET_WM_USER_TIME when needed. CW-Bug-Id: #24817 --- dlls/winex11.drv/window.c | 3 +++ dlls/winex11.drv/x11drv.h | 1 + 2 files changed, 4 insertions(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 72327d32f1f8..52a188295645 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -368,6 +368,7 @@ static struct x11drv_win_data *alloc_win_data( Display *display, HWND hwnd ) data->display = display; data->vis = default_visual; data->hwnd = hwnd; + data->user_time = -1; pthread_mutex_lock( &win_data_mutex ); XSaveContext( gdi_display, (XID)hwnd, win_data_context, (char *)data ); } @@ -1167,6 +1168,8 @@ Window init_clip_window(void) void update_user_time( struct x11drv_win_data *data, Time time, BOOL force ) { if (!force && (time == -1 || time == 0)) time = 1; + if (!data->user_time == !time) return; + data->user_time = time; TRACE( "window %p/%lx, requesting _NET_WM_USER_TIME %ld serial %lu\n", data->hwnd, data->whole_window, time, NextRequest( data->display ) ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 1ef0bea49b05..dedbc97a1c5c 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -663,6 +663,7 @@ struct x11drv_win_data Pixmap icon_mask; unsigned long *icon_bits; unsigned int icon_size; + Time user_time; struct window_state desired_state; /* window state tracking the desired / win32 state */ struct window_state pending_state; /* window state tracking the pending / requested state */ From 73211b1d8135cf69d55ba426c39d0139c010fd61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 11 Feb 2025 18:38:17 +0100 Subject: [PATCH 1138/2542] HACK: winex11: Force taking focus when we are expecting it. CW-Bug-Id: #24817 --- dlls/winex11.drv/event.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index aa211eb816c3..0206e51a8780 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -806,6 +806,11 @@ static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event ) NtUserIsWindowEnabled( hwnd ), NtUserIsWindowVisible( hwnd ), (int)NtUserGetWindowLongW( hwnd, GWL_STYLE ), get_focus(), get_active_window(), last_focus ); + /* Sometimes, when windows are quickly unmapped then mapped, we are being offered focus but still won't + * receive it because of some time resolution rules. Instead of relying on it, force receiving focus by + * setting the XSetInputFocus time to CurrentTime when we are expecting to be foreground. */ + if (hwnd == foreground) event_time = CurrentTime; + if (can_activate_window(hwnd)) { set_focus( event->display, hwnd, event_time ); From 32a122939b97cf850f42a9e538f2827a0aec9e9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 12 Feb 2025 12:26:30 +0100 Subject: [PATCH 1139/2542] HACK: winex11: Always allow resizing with gamescope instead of maximized/fullscreen. CW-Bug-Id: #24862 --- dlls/winex11.drv/window.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 52a188295645..7b972c73b95d 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1244,7 +1244,7 @@ static void window_set_net_wm_state( struct x11drv_win_data *data, UINT new_stat * Instead of upscaling the windows, it will make them cover the entire screen, increasing their * pixel size even if the display mode is supposed to be at a lower resolution. */ - if (X11DRV_HasWindowManager( "steamcompmgr" )) new_state &= ~(1 << NET_WM_STATE_FULLSCREEN); + if (X11DRV_HasWindowManager( "steamcompmgr" )) new_state &= ~fullscreen_mask; new_state &= x11drv_thread_data()->net_wm_state_mask; data->desired_state.net_wm_state = new_state; @@ -1352,6 +1352,9 @@ static void window_set_config( struct x11drv_win_data *data, const RECT *new_rec window_set_net_wm_state( data, net_wm_state & ~fullscreen_mask ); } + /* Gamescope has broken _NET_WM_STATE_FULLSCREEN / _NET_WM_STATE_MAXIMIZED support, always allow resizing instead */ + if (X11DRV_HasWindowManager( "steamcompmgr" )) style &= ~WS_MAXIMIZE; + /* resizing a managed maximized window is not allowed */ if ((old_rect->right - old_rect->left != new_rect->right - new_rect->left || old_rect->bottom - old_rect->top != new_rect->bottom - new_rect->top) && @@ -1384,8 +1387,8 @@ static void window_set_config( struct x11drv_win_data *data, const RECT *new_rec data->pending_state.rect = *new_rect; data->configure_serial = NextRequest( data->display ); - TRACE( "window %p/%lx, requesting config %s above %u, serial %lu\n", data->hwnd, data->whole_window, - wine_dbgstr_rect(new_rect), above, data->configure_serial ); + TRACE( "window %p/%lx, requesting config %s above %u mask %#x, serial %lu\n", data->hwnd, data->whole_window, + wine_dbgstr_rect(new_rect), above, mask, data->configure_serial ); XReconfigureWMWindow( data->display, data->whole_window, data->vis.screen, mask, &changes ); if (net_wm_state != -1) window_set_net_wm_state( data, net_wm_state ); From 4ed8f112c20dc99ac1fdffd6fb72de27366835bd Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Fri, 14 Feb 2025 15:28:24 +1100 Subject: [PATCH 1140/2542] winedmo: Explicitly set 'Data1' value for VP9 GUID. FFmpeg was providing 'vp09', but we expect 'VP90'. (cherry picked from commit 0b5202efdbffa88a9d636e45e94be87db965a470) CW-Bug-Id: #24869 --- dlls/winedmo/unix_media_type.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/winedmo/unix_media_type.c b/dlls/winedmo/unix_media_type.c index e29cbdd2ec16..edde85172b66 100644 --- a/dlls/winedmo/unix_media_type.c +++ b/dlls/winedmo/unix_media_type.c @@ -247,6 +247,7 @@ static void mf_video_format_init( const AVCodecParameters *params, MFVIDEOFORMAT format->guidFormat = MFVideoFormat_Base; if (params->codec_id == AV_CODEC_ID_MPEG1VIDEO) format->guidFormat = MEDIASUBTYPE_MPEG1Payload; else if (params->codec_id == AV_CODEC_ID_H264) format->guidFormat.Data1 = MFVideoFormat_H264.Data1; + else if (params->codec_id == AV_CODEC_ID_VP9) format->guidFormat.Data1 = MFVideoFormat_VP90.Data1; else if (params->codec_tag) format->guidFormat.Data1 = params->codec_tag; else format->guidFormat.Data1 = video_format_tag_from_codec_id( params->codec_id ); } From c3493e618fb037a1654f045fec6a349533349538 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Fri, 14 Feb 2025 10:19:47 +0800 Subject: [PATCH 1141/2542] user32/tests: Test minimizing a normal window and then making it normal. --- dlls/user32/tests/win.c | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 8da4e11b6359..bfe89539ba4f 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -7453,6 +7453,11 @@ static void test_ShowWindow(void) LPARAM ret; MONITORINFO mon_info; unsigned int i; + HDC screen_dc, mem_dc; + WNDCLASSA cls = {0}; + HBITMAP mem_bitmap; + COLORREF color; + HBRUSH brush; DWORD test_style[] = { @@ -7777,6 +7782,50 @@ static void test_ShowWindow(void) flush_events(TRUE); } + + /* Test minimizing a normal window and then making it normal */ + brush = CreateSolidBrush(RGB(0xff, 0, 0xff)); + + cls.lpfnWndProc = DefWindowProcA; + cls.hInstance = GetModuleHandleA(0); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); + cls.hbrBackground = brush; + cls.lpszClassName = "TestShowWindowClass"; + ok(RegisterClassA(&cls), "RegisterClass failed\n"); + + hwnd = CreateWindowExA(WS_EX_TOPMOST, cls.lpszClassName, NULL, WS_POPUP | WS_VISIBLE, + 100, 100, 100, 100, 0, 0, 0, NULL); + flush_events(TRUE); + + ret = ShowWindow(hwnd, SW_SHOWMINIMIZED); + ok(ret, "unexpected ret: %Iu\n", ret); + flush_events(TRUE); + + ret = ShowWindow(hwnd, SW_SHOWNORMAL); + ok(ret, "unexpected ret: %Iu\n", ret); + flush_events(TRUE); + + /* Wait until window manager animation finishes */ + Sleep(500); + + /* Test if window is really in normal state by testing the color on the screen because win32 + * states such as WS_MINIMIZE may not reflect the actual x11 window state */ + screen_dc = GetDC(GetDesktopWindow()); + mem_dc = CreateCompatibleDC(screen_dc); + mem_bitmap = CreateCompatibleBitmap(screen_dc, 200, 200); + SelectObject(mem_dc, mem_bitmap); + BitBlt(mem_dc, 0, 0, 200, 200, screen_dc, 0, 0, SRCCOPY); + + color = GetPixel(mem_dc, 150, 150); + todo_wine_if(color != RGB(0xff, 0, 0xff)) /* fails on Mutter */ + ok(color == RGB(0xff, 0, 0xff), "Got unexpected color %#lx.\n", color); + + DeleteObject(mem_bitmap); + DeleteDC(mem_dc); + ReleaseDC(GetDesktopWindow(), screen_dc); + DestroyWindow(hwnd); + DeleteObject(brush); + UnregisterClassA(cls.lpszClassName, cls.hInstance); } static void test_ShowWindow_owned(HWND hwndMain) From 28ec2ff2aac04f450971ccc756110fa391080d55 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Thu, 13 Feb 2025 18:56:43 +0800 Subject: [PATCH 1142/2542] winex11.drv: Go though WithdrawnState when transitioning from IconicState to NormalState on Mutter. When transitioning a window from IconicState to NormalState and the window is managed, go through WithdrawnState. This is needed because Mutter doesn't unmap windows when making windows iconic/minimized as Mutter needs to support live preview for minimized windows. So on Mutter, a window can be both iconic and mapped. If the window is mapped, then XMapWindow() will have no effect according to the XMapWindow() documentation. Thus we have to transition to WithdrawnState first, then to NormalState. Other window managers such as KWin don't need this because they unmap windows when making them iconic. Fix Mass Effect Legendary Edition (1328670) starts minimized. (cherry picked from commit 4c07e5568e5c70a7899839ab85dee68d705935e3) CW-Bug-Id: #24768 --- dlls/user32/tests/win.c | 1 - dlls/winex11.drv/window.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index bfe89539ba4f..02a6793f3521 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -7817,7 +7817,6 @@ static void test_ShowWindow(void) BitBlt(mem_dc, 0, 0, 200, 200, screen_dc, 0, 0, SRCCOPY); color = GetPixel(mem_dc, 150, 150); - todo_wine_if(color != RGB(0xff, 0, 0xff)) /* fails on Mutter */ ok(color == RGB(0xff, 0, 0xff), "Got unexpected color %#lx.\n", color); DeleteObject(mem_bitmap); diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 7b972c73b95d..85dbce46e2b4 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1529,6 +1529,22 @@ static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state, U if (data->wm_state_serial) return; /* another WM_STATE update is pending, wait for it to complete */ if (old_state == new_state) return; /* states are the same, nothing to update */ + /* When transitioning a window from IconicState to NormalState and the window is managed, go + * through WithdrawnState. This is needed because Mutter doesn't unmap windows when making + * windows iconic/minimized as Mutter needs to support live preview for minimized windows. So on + * Mutter, a window can be both iconic and mapped. If the window is mapped, then XMapWindow() + * will have no effect according to the XMapWindow() documentation. Thus we have to transition + * to WithdrawnState first, then to NormalState. Other window managers such as KWin don't need + * this because they unmap windows when making them iconic */ + if (X11DRV_HasWindowManager( "Mutter" ) && data->managed + && MAKELONG(old_state, new_state) == MAKELONG(IconicState, NormalState)) + { + WARN( "window %p/%lx is iconic, remapping to workaround Mutter issues.\n", data->hwnd, data->whole_window ); + window_set_wm_state( data, WithdrawnState, 0 ); + window_set_wm_state( data, NormalState, swp_flags ); + return; + } + switch (MAKELONG(old_state, new_state)) { case MAKELONG(WithdrawnState, IconicState): From 483fb8e9bae87ddd6edeca491047532719463dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 14 Feb 2025 15:19:25 +0100 Subject: [PATCH 1143/2542] HACK: winegstreamer/wm_reader: Return the stream format when faking compressed output. CW-Bug-Id: #24875 CW-Bug-Id: #24876 CW-Bug-Id: #24884 --- dlls/winegstreamer/wm_reader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 0e634265f771..d60a160380e3 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -555,7 +555,7 @@ static HRESULT WINAPI stream_props_GetMediaType(IWMMediaProps *iface, WM_MEDIA_T TRACE("iface %p, mt %p, size %p.\n", iface, mt, size); wg_parser_stream_get_codec_format(config->stream->wg_stream, &codec_format); - format = (codec_format.major_type != WG_MAJOR_TYPE_UNKNOWN) ? &codec_format : &config->stream->format; + format = (codec_format.major_type != WG_MAJOR_TYPE_UNKNOWN && config->stream->demux_compressed) ? &codec_format : &config->stream->format; if (!amt_from_wg_format(&stream_mt, format, true)) return E_OUTOFMEMORY; From 84f7deda2a99aeb42e83b01f3e367123e57ed76d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 14 Feb 2025 15:20:18 +0100 Subject: [PATCH 1144/2542] HACK: winegstreamer/wm_reader: Fake RGB32 output for more games. CW-Bug-Id: #24875 CW-Bug-Id: #24876 CW-Bug-Id: #24884 --- dlls/winegstreamer/wm_reader.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index d60a160380e3..6973f519ceff 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -1544,8 +1544,13 @@ static HRESULT init_stream(struct wm_reader *reader) const char *id = getenv("SteamGameId"); - if (id && !strcmp(id, "1113000")) + if (id && (0 + || !strcmp(id, "1113000") + || !strcmp(id, "638160") + )) + { stream->format.u.video.format = WG_VIDEO_FORMAT_BGRx; + } } } wg_parser_stream_enable(stream->wg_stream, &stream->format); From 86da007820cbcb882531f06efcb119b19d779c2d Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 11 Feb 2025 18:13:52 -0600 Subject: [PATCH 1145/2542] user32/tests: Test system generated WM_MOUSEMOVE with raw input. (cherry picked from commit 060eebb8910d1f9c6bf13de3e361dc1a312d1281) CW-Bug-Id: #24796 --- dlls/user32/tests/input.c | 138 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index eb548ea0924c..cc6d02b36dcb 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -620,6 +620,17 @@ static void empty_message_queue(void) } } +static void pump_messages(void) +{ + MSG msg; + + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) + { + TranslateMessage(&msg); + DispatchMessageA(&msg); + } +} + struct send_input_keyboard_test { WORD scan; @@ -6144,6 +6155,130 @@ static void test_keyboard_layout(void) } } +static void test_system_messages_with_rawinput_nolegacy(void) +{ + RAWINPUTDEVICE raw_devices[1]; + INPUT inp; + HWND hwnd; + MSG msg; + + hwnd = CreateWindowA( "static", "test", WS_VISIBLE | WS_POPUP, 0, 0, 200, 200, NULL, NULL, NULL, NULL ); + ok_ne( NULL, hwnd, HWND, "%p" ); + SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)rawinput_wndproc); + pump_messages(); + SetCursorPos( 50, 50 ); + empty_message_queue(); + pump_messages(); + + /* Sanity check, receiving system generated WM_MOUSEMOVE. */ + rawinput_test_received_legacy = FALSE; + SetCursorPos( 51, 51 ); + empty_message_queue(); + ok( rawinput_test_received_legacy, "Expected WM_MOUSEMOVE.\n" ); + + /* SetCursorPos is called before raw input setup, WM_MOUSEMOVE is not delievered after. */ + rawinput_test_received_legacy = FALSE; + SetCursorPos( 50, 50 ); + raw_devices[0].usUsagePage = HID_USAGE_PAGE_GENERIC; + raw_devices[0].usUsage = HID_USAGE_GENERIC_MOUSE; + raw_devices[0].dwFlags = RIDEV_NOLEGACY; + raw_devices[0].hwndTarget = hwnd; + ok_ret( 1, RegisterRawInputDevices( raw_devices, ARRAY_SIZE( raw_devices ), sizeof(RAWINPUTDEVICE) ) ); + empty_message_queue(); + pump_messages(); + todo_wine ok( !rawinput_test_received_legacy, "Did not expect WM_MOUSEMOVE.\n" ); + + raw_devices[0].dwFlags = RIDEV_REMOVE; + raw_devices[0].hwndTarget = NULL; + ok_ret( 1, RegisterRawInputDevices( raw_devices, ARRAY_SIZE( raw_devices ), sizeof(RAWINPUTDEVICE) ) ); + pump_messages(); + + /* However, if PeekMessage( ..., PM_NOREMOVE ) got it before setting up raw input that will be delievered. */ + rawinput_test_received_legacy = FALSE; + SetCursorPos( 52, 52 ); + MsgWaitForMultipleObjects(0, NULL, FALSE, 300, QS_ALLINPUT); + ok_ret( 1, PeekMessageA( &msg, NULL, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_NOREMOVE ) ); + raw_devices[0].usUsagePage = HID_USAGE_PAGE_GENERIC; + raw_devices[0].usUsage = HID_USAGE_GENERIC_MOUSE; + raw_devices[0].dwFlags = RIDEV_NOLEGACY; + raw_devices[0].hwndTarget = hwnd; + ok_ret( 1, RegisterRawInputDevices( raw_devices, ARRAY_SIZE( raw_devices ), sizeof(RAWINPUTDEVICE) ) ); + empty_message_queue(); + flaky_wine ok( rawinput_test_received_legacy, "Expected WM_MOUSEMOVE.\n" ); + + raw_devices[0].dwFlags = RIDEV_REMOVE; + raw_devices[0].hwndTarget = NULL; + ok_ret( 1, RegisterRawInputDevices( raw_devices, ARRAY_SIZE( raw_devices ), sizeof(RAWINPUTDEVICE) ) ); + pump_messages(); + + /* Moving window generates WM_MOUSEMOVE without raw input. */ + rawinput_test_received_legacy = FALSE; + MoveWindow( hwnd, 1, 1, 200, 200, FALSE ); + empty_message_queue(); + ok( rawinput_test_received_legacy, "Expected WM_MOUSEMOVE.\n" ); + + /* Window moved before raw input setup, WM_MOUSEMOVE is not delievered after. */ + rawinput_test_received_legacy = FALSE; + MoveWindow( hwnd, 0, 0, 200, 200, FALSE ); + raw_devices[0].dwFlags = RIDEV_NOLEGACY; + raw_devices[0].hwndTarget = hwnd; + ok_ret( 1, RegisterRawInputDevices( raw_devices, ARRAY_SIZE( raw_devices ), sizeof(RAWINPUTDEVICE) ) ); + empty_message_queue(); + pump_messages(); + todo_wine ok( !rawinput_test_received_legacy, "Did not expect WM_MOUSEMOVE.\n" ); + + memset(&inp, 0, sizeof(inp)); + inp.type = INPUT_MOUSE; + inp.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_MOVE_NOCOALESCE; + inp.mi.dx = 10; + inp.mi.dy = 10; + + /* WM_MOUSEMOVE is not delivered with raw input. */ + rawinput_test_received_legacy = FALSE; + ok_ret( 1, SendInput( 1, &inp, sizeof(inp) ) ); + empty_message_queue(); + pump_messages(); + ok( !rawinput_test_received_legacy, "Did not expect WM_MOUSEMOVE.\n" ); + + raw_devices[0].dwFlags = RIDEV_REMOVE; + raw_devices[0].hwndTarget = NULL; + ok_ret( 1, RegisterRawInputDevices( raw_devices, ARRAY_SIZE( raw_devices ), sizeof(RAWINPUTDEVICE) ) ); + pump_messages(); + + /* Input sent before rawinput setup, WM_MOUSEMOVE is most of the time delivered after with MOUSEEVENTF_MOVE_NOCOALESCE. */ + ok_ret( 1, SendInput( 1, &inp, sizeof(inp) ) ); + rawinput_test_received_legacy = FALSE; + raw_devices[0].dwFlags = RIDEV_NOLEGACY; + raw_devices[0].hwndTarget = hwnd; + ok_ret( 1, RegisterRawInputDevices( raw_devices, ARRAY_SIZE( raw_devices ), sizeof(RAWINPUTDEVICE) ) ); + MsgWaitForMultipleObjects(0, NULL, FALSE, 300, QS_ALLINPUT); + pump_messages(); + flaky todo_wine ok( rawinput_test_received_legacy, "Expected WM_MOUSEMOVE.\n" ); + + raw_devices[0].dwFlags = RIDEV_REMOVE; + raw_devices[0].hwndTarget = NULL; + ok_ret( 1, RegisterRawInputDevices( raw_devices, ARRAY_SIZE( raw_devices ), sizeof(RAWINPUTDEVICE) ) ); + pump_messages(); + + /* Input sent before rawinput setup, WM_MOUSEMOVE is not delivered after without MOUSEEVENTF_MOVE_NOCOALESCE. */ + inp.mi.dwFlags = MOUSEEVENTF_MOVE; + ok_ret( 1, SendInput( 1, &inp, sizeof(inp) ) ); + rawinput_test_received_legacy = FALSE; + raw_devices[0].dwFlags = RIDEV_NOLEGACY; + raw_devices[0].hwndTarget = hwnd; + ok_ret( 1, RegisterRawInputDevices( raw_devices, ARRAY_SIZE( raw_devices ), sizeof(RAWINPUTDEVICE) ) ); + empty_message_queue(); + pump_messages(); + ok( !rawinput_test_received_legacy, "Did not expect WM_MOUSEMOVE.\n" ); + + raw_devices[0].dwFlags = RIDEV_REMOVE; + raw_devices[0].hwndTarget = NULL; + ok_ret( 1, RegisterRawInputDevices( raw_devices, ARRAY_SIZE( raw_devices ), sizeof(RAWINPUTDEVICE) ) ); + + DestroyWindow( hwnd ); + pump_messages(); +} + START_TEST(input) { char **argv; @@ -6168,6 +6303,8 @@ START_TEST(input) return test_ClipCursor_desktop( argv ); if (argc >= 3 && !strcmp( argv[2], "test_input_desktop" )) return test_input_desktop( argv ); + if (argc >= 3 && !strcmp( argv[2], "test_system_messages_with_rawinput_nolegacy" )) + return test_system_messages_with_rawinput_nolegacy(); run_in_desktop( argv, "test_input_desktop", 1 ); test_keynames(); @@ -6218,4 +6355,5 @@ START_TEST(input) } test_ClipCursor( argv ); + run_in_desktop( argv, "test_system_messages_with_rawinput_nolegacy", 1 ); } From 1d60f366abab903b93743903d6fbd8e76209d748 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 11 Feb 2025 18:28:36 -0600 Subject: [PATCH 1146/2542] server: Ignore WM_MOUSEMOVE with raw input / RIDEV_NOLEGACY. (cherry picked from commit 70b301679149d850a7b64b35f628253d2338dbeb) CW-Bug-Id: #24796 --- dlls/user32/tests/input.c | 6 +++--- server/queue.c | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index cc6d02b36dcb..26f7d08e4227 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -6186,7 +6186,7 @@ static void test_system_messages_with_rawinput_nolegacy(void) ok_ret( 1, RegisterRawInputDevices( raw_devices, ARRAY_SIZE( raw_devices ), sizeof(RAWINPUTDEVICE) ) ); empty_message_queue(); pump_messages(); - todo_wine ok( !rawinput_test_received_legacy, "Did not expect WM_MOUSEMOVE.\n" ); + ok( !rawinput_test_received_legacy, "Did not expect WM_MOUSEMOVE.\n" ); raw_devices[0].dwFlags = RIDEV_REMOVE; raw_devices[0].hwndTarget = NULL; @@ -6204,7 +6204,7 @@ static void test_system_messages_with_rawinput_nolegacy(void) raw_devices[0].hwndTarget = hwnd; ok_ret( 1, RegisterRawInputDevices( raw_devices, ARRAY_SIZE( raw_devices ), sizeof(RAWINPUTDEVICE) ) ); empty_message_queue(); - flaky_wine ok( rawinput_test_received_legacy, "Expected WM_MOUSEMOVE.\n" ); + todo_wine ok( rawinput_test_received_legacy, "Expected WM_MOUSEMOVE.\n" ); raw_devices[0].dwFlags = RIDEV_REMOVE; raw_devices[0].hwndTarget = NULL; @@ -6225,7 +6225,7 @@ static void test_system_messages_with_rawinput_nolegacy(void) ok_ret( 1, RegisterRawInputDevices( raw_devices, ARRAY_SIZE( raw_devices ), sizeof(RAWINPUTDEVICE) ) ); empty_message_queue(); pump_messages(); - todo_wine ok( !rawinput_test_received_legacy, "Did not expect WM_MOUSEMOVE.\n" ); + ok( !rawinput_test_received_legacy, "Did not expect WM_MOUSEMOVE.\n" ); memset(&inp, 0, sizeof(inp)); inp.type = INPUT_MOUSE; diff --git a/server/queue.c b/server/queue.c index a90e9ce22f06..ee03fc9e94e6 100644 --- a/server/queue.c +++ b/server/queue.c @@ -2761,11 +2761,15 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user struct get_message_reply *reply ) { struct thread_input *input = thread->queue->input; + const struct rawinput_device *device; struct thread *win_thread; struct list *ptr; user_handle_t win; int clear_bits, got_one = 0; unsigned int msg_code; + int no_legacy; + + no_legacy = (device = thread->process->rawinput_mouse) && (device->flags & RIDEV_NOLEGACY); ptr = list_head( &input->msg_list ); if (hw_id) @@ -2791,6 +2795,12 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user struct hardware_msg_data *data = msg->data; ptr = list_next( &input->msg_list, ptr ); + if (no_legacy && msg->msg == WM_MOUSEMOVE && msg->type == MSG_HARDWARE) + { + list_remove( &msg->entry ); + free_message( msg ); + continue; + } win = find_hardware_message_window( input->desktop, input, msg, &msg_code, &win_thread ); if (!win || !win_thread) { From 44e0aa093a5c5c8f3074fcf36aba1be44428ecbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 14 Feb 2025 19:04:34 +0100 Subject: [PATCH 1147/2542] mfsrcsnk: Ignore streams with unsupported media types. CW-Bug-Id: #24803 --- dlls/mfsrcsnk/media_source.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dlls/mfsrcsnk/media_source.c b/dlls/mfsrcsnk/media_source.c index 138cb29b7052..a5ec3beba811 100644 --- a/dlls/mfsrcsnk/media_source.c +++ b/dlls/mfsrcsnk/media_source.c @@ -1497,10 +1497,12 @@ static void media_source_init_stream_map(struct media_source *source, UINT strea if (wcscmp(source->mime_type, L"video/mp4")) { - for (i = stream_count - 1; i >= 0; i--) + for (i = 0; i < stream_count; i++) { - TRACE("mapping source %p stream %u to demuxer stream %u\n", source, i, i); - source->stream_map[i] = i; + if (FAILED(get_stream_media_type(source->winedmo_demuxer, i, &major, NULL))) + continue; + TRACE("mapping source %p stream %u to demuxer stream %u\n", source, n, i); + source->stream_map[n++] = i; } return; } @@ -1592,11 +1594,11 @@ static void media_source_init_descriptors(struct media_source *source) NTSTATUS status; GUID major; - if (FAILED(status = winedmo_demuxer_stream_lang(source->winedmo_demuxer, source->stream_map[i], buffer, ARRAY_SIZE(buffer))) + if ((status = winedmo_demuxer_stream_lang(source->winedmo_demuxer, source->stream_map[i], buffer, ARRAY_SIZE(buffer))) || (!wcscmp(source->mime_type, L"video/mp4") && FAILED(normalize_mp4_language_code(source, buffer))) || FAILED(IMFStreamDescriptor_SetString(stream->descriptor, &MF_SD_LANGUAGE, buffer))) WARN("Failed to set stream descriptor language, status %#lx\n", status); - if (FAILED(status = winedmo_demuxer_stream_name(source->winedmo_demuxer, source->stream_map[i], buffer, ARRAY_SIZE(buffer))) + if ((status = winedmo_demuxer_stream_name(source->winedmo_demuxer, source->stream_map[i], buffer, ARRAY_SIZE(buffer))) || FAILED(IMFStreamDescriptor_SetString(stream->descriptor, &MF_SD_STREAM_NAME, buffer))) WARN("Failed to set stream descriptor name, status %#lx\n", status); @@ -1734,7 +1736,7 @@ static HRESULT media_source_async_create(struct media_source *source, IMFAsyncRe GUID major; if (FAILED(hr = get_stream_media_type(source->winedmo_demuxer, source->stream_map[i], &major, &media_type))) - goto done; + continue; if (SUCCEEDED(hr = stream_descriptor_create(i + 1, media_type, &descriptor))) { if (SUCCEEDED(hr = media_stream_create(&source->IMFMediaSource_iface, descriptor, &source->streams[i]))) From 02b407cc86421387244f38464b21faf4573bf6b3 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 14 Feb 2025 14:37:16 -0600 Subject: [PATCH 1148/2542] win32u: Avoid calling Vulkan driver functions with user_lock held. CW-Bug-Id: #24883 --- dlls/win32u/vulkan.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/dlls/win32u/vulkan.c b/dlls/win32u/vulkan.c index 0be3ec9a2da6..4cb3997f6482 100644 --- a/dlls/win32u/vulkan.c +++ b/dlls/win32u/vulkan.c @@ -47,6 +47,8 @@ WINE_DECLARE_DEBUG_CHANNEL(fps); static const struct vulkan_driver_funcs *driver_funcs; +static pthread_mutex_t surface_list_lock = PTHREAD_MUTEX_INITIALIZER; + struct surface { struct vulkan_surface obj; @@ -54,7 +56,7 @@ struct surface HWND hwnd; struct list entry; - struct rb_entry window_entry; + struct list temp_entry; }; static struct surface *surface_from_handle( VkSurfaceKHR handle ) @@ -154,6 +156,7 @@ static VkResult win32u_vkCreateWin32SurfaceKHR( VkInstance client_instance, cons return res; } + pthread_mutex_lock( &surface_list_lock ); if (!(win = get_win_ptr( surface->hwnd )) || win == WND_DESKTOP || win == WND_OTHER_PROCESS) list_init( &surface->entry ); else @@ -161,6 +164,7 @@ static VkResult win32u_vkCreateWin32SurfaceKHR( VkInstance client_instance, cons list_add_tail( &win->vulkan_surfaces, &surface->entry ); release_win_ptr( win ); } + pthread_mutex_unlock( &surface_list_lock ); vulkan_object_init( &surface->obj.obj, host_surface ); surface->obj.instance = instance; @@ -184,11 +188,13 @@ static void win32u_vkDestroySurfaceKHR( VkInstance client_instance, VkSurfaceKHR TRACE( "instance %p, handle 0x%s, allocator %p\n", instance, wine_dbgstr_longlong( client_surface ), allocator ); if (allocator) FIXME( "Support for allocation callbacks not implemented yet\n" ); + pthread_mutex_lock( &surface_list_lock ); if ((win = get_win_ptr( surface->hwnd )) && win != WND_DESKTOP && win != WND_OTHER_PROCESS) { list_remove( &surface->entry ); release_win_ptr( win ); } + pthread_mutex_unlock( &surface_list_lock ); instance->p_vkDestroySurfaceKHR( instance->host.instance, surface->obj.host.surface, NULL /* allocator */ ); driver_funcs->p_vulkan_surface_destroy( surface->hwnd, surface->driver_private ); @@ -1607,20 +1613,34 @@ static void vulkan_init_once(void) void vulkan_update_surfaces( HWND hwnd ) { struct surface *surface; + struct list temp_list; WND *win; - if (!(win = get_win_ptr( hwnd )) || win == WND_DESKTOP || win == WND_OTHER_PROCESS) return; + list_init( &temp_list ); + pthread_mutex_lock( &surface_list_lock ); + if (!(win = get_win_ptr( hwnd )) || win == WND_DESKTOP || win == WND_OTHER_PROCESS) + { + pthread_mutex_unlock( &surface_list_lock ); + return; + } LIST_FOR_EACH_ENTRY( surface, &win->vulkan_surfaces, struct surface, entry ) + { + list_add_tail( &temp_list, &surface->temp_entry ); + } + release_win_ptr( win ); + + LIST_FOR_EACH_ENTRY( surface, &temp_list, struct surface, temp_entry ) driver_funcs->p_vulkan_surface_update( surface->hwnd, surface->driver_private ); - release_win_ptr( win ); + pthread_mutex_unlock( &surface_list_lock ); } void vulkan_detach_surfaces( struct list *surfaces ) { struct surface *surface, *next; + pthread_mutex_lock( &surface_list_lock ); LIST_FOR_EACH_ENTRY_SAFE( surface, next, surfaces, struct surface, entry ) { driver_funcs->p_vulkan_surface_detach( surface->hwnd, surface->driver_private ); @@ -1628,6 +1648,7 @@ void vulkan_detach_surfaces( struct list *surfaces ) list_init( &surface->entry ); surface->hwnd = NULL; } + pthread_mutex_unlock( &surface_list_lock ); } #else /* SONAME_LIBVULKAN */ From 3179028be01df6c898d3b5a87c14ce8b0c54538d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 17 Feb 2025 13:21:00 +0100 Subject: [PATCH 1149/2542] winex11: Use window-relative coordinates for mouse input. CW-Bug-Id: #24818 --- dlls/winex11.drv/mouse.c | 1 - 1 file changed, 1 deletion(-) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 8ccce7d6ff31..47ac3d6e079e 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -598,7 +598,6 @@ static void map_event_coords( HWND hwnd, Window window, Window event_root, int x x_root, y_root, input ); if (window == root_window) pt = root_to_virtual_screen( pt.x, pt.y ); - else if (event_root == root_window) pt = root_to_virtual_screen( x_root, y_root ); else if (!hwnd) { thread_data = x11drv_thread_data(); From 579897fd65df95dcd94b56b293f9642b9a8005db Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Mon, 17 Feb 2025 13:22:47 -0500 Subject: [PATCH 1150/2542] Revert "HACK: proton: winex11.drv: Track GAMESCOPE_FOCUSED_APP property changes." This reverts commit 395c2ac3e02fd0ea48b0b4068ae6782f508225fb. --- dlls/winex11.drv/event.c | 33 --------------------------------- dlls/winex11.drv/x11drv.h | 1 - dlls/winex11.drv/x11drv_main.c | 1 - 3 files changed, 35 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 0206e51a8780..bcd7df00a8e1 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1367,37 +1367,6 @@ static void handle_net_supporting_wm_check_notify( XPropertyEvent *event ) if (event->state == PropertyNewValue) net_supporting_wm_check_init( data ); } -static int handle_gamescope_focused_app_error( Display *dpy, XErrorEvent *event, void *arg ) -{ - WARN( "Failed to read GAMESCOPE_FOCUSED_APP property, ignoring.\n" ); - return 1; -} - -static void handle_gamescope_focused_app( XPropertyEvent *event ) -{ - static const char *sgi = NULL; - - unsigned long count, remaining, *property; - int format, app_id, focused_app_id; - Atom type; - - if (!sgi && !(sgi = getenv( "SteamGameId" ))) return; - app_id = atoi( sgi ); - - X11DRV_expect_error( event->display, handle_gamescope_focused_app_error, NULL ); - XGetWindowProperty( event->display, DefaultRootWindow( event->display ), x11drv_atom( GAMESCOPE_FOCUSED_APP ), - 0, ~0UL, False, XA_CARDINAL, &type, &format, &count, &remaining, (unsigned char **)&property ); - if (X11DRV_check_error()) focused_app_id = app_id; - else - { - if (!property) focused_app_id = app_id; - else focused_app_id = *property; - XFree( property ); - } - - TRACE( "Got app id %u, focused app %u\n", app_id, focused_app_id ); -} - /*********************************************************************** * X11DRV_PropertyNotify */ @@ -1405,8 +1374,6 @@ static BOOL X11DRV_PropertyNotify( HWND hwnd, XEvent *xev ) { XPropertyEvent *event = &xev->xproperty; - if (event->atom == x11drv_atom(GAMESCOPE_FOCUSED_APP)) handle_gamescope_focused_app( event ); - if (!hwnd) return FALSE; if (event->atom == x11drv_atom(WM_STATE)) handle_wm_state_notify( hwnd, event ); if (event->atom == x11drv_atom(_XEMBED_INFO)) handle_xembed_info_notify( hwnd, event ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index dedbc97a1c5c..a94354bbb13f 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -563,7 +563,6 @@ enum x11drv_atoms XATOM_text_rtf, XATOM_text_richtext, XATOM_text_uri_list, - XATOM_GAMESCOPE_FOCUSED_APP, XATOM_GAMESCOPE_DISPLAY_EDID_PATH, XATOM_GAMESCOPE_XALIA_OVERLAY, NB_XATOMS diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index c6183a8c1d2d..31ab814a72a8 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -199,7 +199,6 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "text/rtf", "text/richtext", "text/uri-list", - "GAMESCOPE_FOCUSED_APP", "GAMESCOPE_DISPLAY_EDID_PATH", "GAMESCOPE_XALIA_OVERLAY", }; From d7e14e701e07df7fc108478b2a5e947407c7fa7f Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 17 Feb 2025 11:04:40 -0600 Subject: [PATCH 1151/2542] winex11.drv: Sort Vulkan physical devices in get_gpu_properties_from_vulkan(). CW-Bug-Id: #24895 --- dlls/winex11.drv/xrandr.c | 61 ++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 17 deletions(-) diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index 4fe479c974a1..3248700be03a 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -813,13 +813,32 @@ static BOOL is_crtc_primary( RECT primary, const XRRCrtcInfo *crtc ) crtc->y + crtc->height == primary.bottom; } +struct vk_physdev_info +{ + VkPhysicalDevice physdev; + VkPhysicalDeviceProperties2 properties2; + VkPhysicalDeviceIDProperties id; +}; + +static int compare_vulkan_physical_devices( const void *v1, const void *v2 ) +{ + static const int device_type_rank[6] = { 100, 1, 0, 2, 3, 200 }; + const struct vk_physdev_info *d1 = v1, *d2 = v2; + int rank1, rank2; + + rank1 = device_type_rank[ min( d1->properties2.properties.deviceType, ARRAY_SIZE(device_type_rank) - 1) ]; + rank2 = device_type_rank[ min( d2->properties2.properties.deviceType, ARRAY_SIZE(device_type_rank) - 1) ]; + if (rank1 != rank2) return rank1 - rank2; + + return memcmp( &d1->id.deviceUUID, &d2->id.deviceUUID, sizeof(d1->id.deviceUUID) ); +} + static BOOL get_gpu_properties_from_vulkan( struct x11drv_gpu *gpu, const XRRProviderInfo *provider_info, struct x11drv_gpu *prev_gpus, int prev_gpu_count ) { uint32_t device_count, device_idx, output_idx, i; VkPhysicalDevice *vk_physical_devices = NULL; - VkPhysicalDeviceProperties2 properties2; - VkPhysicalDeviceIDProperties id; + struct vk_physdev_info *devs = NULL; VkDisplayKHR vk_display; BOOL ret = FALSE; VkResult vr; @@ -843,43 +862,50 @@ static BOOL get_gpu_properties_from_vulkan( struct x11drv_gpu *gpu, const XRRPro goto done; } + if (!(devs = calloc( device_count, sizeof(*devs) ))) + goto done; + + for (device_idx = 0; device_idx < device_count; ++device_idx) + { + devs[device_idx].physdev = vk_physical_devices[device_idx]; + devs[device_idx].id.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES; + devs[device_idx].properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2; + devs[device_idx].properties2.pNext = &devs[device_idx].id; + p_vkGetPhysicalDeviceProperties2KHR( vk_physical_devices[device_idx], &devs[device_idx].properties2 ); + } + qsort( devs, device_count, sizeof(*devs), compare_vulkan_physical_devices ); + TRACE("provider name %s.\n", debugstr_a(provider_info->name)); for (device_idx = 0; device_idx < device_count; ++device_idx) { for (output_idx = 0; output_idx < provider_info->noutputs; ++output_idx) { - vr = p_vkGetRandROutputDisplayEXT( vk_physical_devices[device_idx], gdi_display, + vr = p_vkGetRandROutputDisplayEXT( devs[device_idx].physdev, gdi_display, provider_info->outputs[output_idx], &vk_display ); if (vr != VK_SUCCESS || vk_display == VK_NULL_HANDLE) continue; - memset( &id, 0, sizeof(id) ); - id.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES; - properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2; - properties2.pNext = &id; - - p_vkGetPhysicalDeviceProperties2KHR( vk_physical_devices[device_idx], &properties2 ); for (i = 0; i < prev_gpu_count; ++i) { - if (!memcmp( &prev_gpus[i].vulkan_uuid, &id.deviceUUID, sizeof(id.deviceUUID) )) + if (!memcmp( &prev_gpus[i].vulkan_uuid, &devs[device_idx].id.deviceUUID, sizeof(devs[device_idx].id.deviceUUID) )) { - WARN( "device UUID %#x:%#x already assigned to GPU %u.\n", *((uint32_t *)id.deviceUUID + 1), - *(uint32_t *)id.deviceUUID, i ); + WARN( "device UUID %#x:%#x already assigned to GPU %u.\n", *((uint32_t *)devs[device_idx].id.deviceUUID + 1), + *(uint32_t *)devs[device_idx].id.deviceUUID, i ); break; } } if (i < prev_gpu_count) continue; - memcpy( &gpu->vulkan_uuid, id.deviceUUID, sizeof(id.deviceUUID) ); + memcpy( &gpu->vulkan_uuid, devs[device_idx].id.deviceUUID, sizeof(devs[device_idx].id.deviceUUID) ); /* Ignore Khronos vendor IDs */ - if (properties2.properties.vendorID < 0x10000) + if (devs[device_idx].properties2.properties.vendorID < 0x10000) { - gpu->pci_id.vendor = properties2.properties.vendorID; - gpu->pci_id.device = properties2.properties.deviceID; + gpu->pci_id.vendor = devs[device_idx].properties2.properties.vendorID; + gpu->pci_id.device = devs[device_idx].properties2.properties.deviceID; } - gpu->name = strdup( properties2.properties.deviceName ); + gpu->name = strdup( devs[device_idx].properties2.properties.deviceName ); ret = TRUE; goto done; @@ -887,6 +913,7 @@ static BOOL get_gpu_properties_from_vulkan( struct x11drv_gpu *gpu, const XRRPro } done: + free( devs ); free( vk_physical_devices ); return ret; } From 3cb3ea77284d626774b472b373c368035b15ed1b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 17 Feb 2025 11:18:49 -0600 Subject: [PATCH 1152/2542] win32u: Sort Vulkan physical devices in get_vulkan_gpus(). CW-Bug-Id: #24895 --- dlls/win32u/d3dkmt.c | 56 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/dlls/win32u/d3dkmt.c b/dlls/win32u/d3dkmt.c index 6d4cab058ffa..9d47a585408c 100644 --- a/dlls/win32u/d3dkmt.c +++ b/dlls/win32u/d3dkmt.c @@ -612,38 +612,70 @@ NTSTATUS WINAPI NtGdiDdDDICheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDPNE return STATUS_SUCCESS; } +struct vk_physdev_info +{ + VkPhysicalDeviceProperties2 properties2; + VkPhysicalDeviceIDProperties id; + VkPhysicalDeviceMemoryProperties mem_properties; +}; + +static int compare_vulkan_physical_devices( const void *v1, const void *v2 ) +{ + static const int device_type_rank[6] = { 100, 1, 0, 2, 3, 200 }; + const struct vk_physdev_info *d1 = v1, *d2 = v2; + int rank1, rank2; + + rank1 = device_type_rank[ min( d1->properties2.properties.deviceType, ARRAY_SIZE(device_type_rank) - 1) ]; + rank2 = device_type_rank[ min( d2->properties2.properties.deviceType, ARRAY_SIZE(device_type_rank) - 1) ]; + if (rank1 != rank2) return rank1 - rank2; + + return memcmp( &d1->id.deviceUUID, &d2->id.deviceUUID, sizeof(d1->id.deviceUUID) ); +} + BOOL get_vulkan_gpus( struct list *gpus ) { + struct vk_physdev_info *devinfo; VkPhysicalDevice *devices; UINT i, j, count; if (!d3dkmt_use_vulkan()) return FALSE; if (!(count = get_vulkan_physical_devices( &devices ))) return FALSE; + if (!(devinfo = calloc( count, sizeof(*devinfo) ))) + { + free( devices ); + return FALSE; + } + for (i = 0; i < count; ++i) + { + devinfo[i].id.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES; + devinfo[i].properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2; + devinfo[i].properties2.pNext = &devinfo[i].id; + pvkGetPhysicalDeviceProperties2KHR( devices[i], &devinfo[i].properties2 ); + pvkGetPhysicalDeviceMemoryProperties( devices[i], &devinfo[i].mem_properties ); + } + qsort( devinfo, count, sizeof(*devinfo), compare_vulkan_physical_devices ); + for (i = 0; i < count; ++i) { - VkPhysicalDeviceIDProperties id = {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES}; - VkPhysicalDeviceProperties2 properties2 = {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, .pNext = &id}; - VkPhysicalDeviceMemoryProperties mem_properties; struct vulkan_gpu *gpu; if (!(gpu = calloc( 1, sizeof(*gpu) ))) break; - pvkGetPhysicalDeviceProperties2KHR( devices[i], &properties2 ); - memcpy( &gpu->uuid, id.deviceUUID, sizeof(gpu->uuid) ); - gpu->name = strdup( properties2.properties.deviceName ); - gpu->pci_id.vendor = properties2.properties.vendorID; - gpu->pci_id.device = properties2.properties.deviceID; + memcpy( &gpu->uuid, devinfo[i].id.deviceUUID, sizeof(gpu->uuid) ); + gpu->name = strdup( devinfo[i].properties2.properties.deviceName ); + gpu->pci_id.vendor = devinfo[i].properties2.properties.vendorID; + gpu->pci_id.device = devinfo[i].properties2.properties.deviceID; - pvkGetPhysicalDeviceMemoryProperties( devices[i], &mem_properties ); - for (j = 0; j < mem_properties.memoryHeapCount; j++) + for (j = 0; j < devinfo[i].mem_properties.memoryHeapCount; j++) { - if (mem_properties.memoryHeaps[j].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) - gpu->memory += mem_properties.memoryHeaps[j].size; + if (devinfo[i].mem_properties.memoryHeaps[j].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) + gpu->memory += devinfo[i].mem_properties.memoryHeaps[j].size; } list_add_tail( gpus, &gpu->entry ); } + free( devinfo ); free( devices ); return TRUE; } From b29ed5cf083c854d23ebf7b42a3cbf2ec08787b9 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Tue, 18 Feb 2025 17:19:16 +1100 Subject: [PATCH 1153/2542] mfreadwrite: HACK: Force use of Processor when requesting RGB32. The WMV video decoder doesn't supply MFVideoFormat_RGB32 directly on Windows. It will output NV12 and a processor converts this to MFVideoFormat_RGB32. This also ensures the image is the correct way up. CW-Bug-Id: #24869 --- dlls/mfreadwrite/reader.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c index e7e92647ca3d..8055f52305c9 100644 --- a/dlls/mfreadwrite/reader.c +++ b/dlls/mfreadwrite/reader.c @@ -1907,6 +1907,7 @@ static HRESULT source_reader_create_transform(struct source_reader *reader, BOOL GUID category; IMFTransform *transform; UINT i, count; + BOOL force_processor = FALSE; HRESULT hr; if (FAILED(hr = IMFMediaType_GetMajorType(input_type, &in_type.guidMajorType)) @@ -1946,6 +1947,16 @@ static HRESULT source_reader_create_transform(struct source_reader *reader, BOOL entry->min_buffer_size = max(entry->min_buffer_size, bytes_per_second); } + if (IsEqualGUID(&in_type.guidMajorType, &MFMediaType_Video) && IsEqualGUID(&in_type.guidSubtype, &MFVideoFormat_VP90) + && IsEqualGUID(&out_type.guidSubtype, &MFVideoFormat_RGB32) && allow_processor + && IsEqualGUID(&category, &MFT_CATEGORY_VIDEO_DECODER)) + { + /* The WMV video decoder doesn't supply MFVideoFormat_RGB32 directly on Windows. It will output NV12 and a processor converts + * this to MFVideoFormat_RGB32. This also ensures the image is the correct way up. + */ + force_processor = TRUE; + } + if (IsEqualGUID(&out_type.guidMajorType, &MFMediaType_Video) && IsEqualGUID(&out_type.guidSubtype, &MFVideoFormat_ABGR32) && IsEqualGUID(&category, &MFT_CATEGORY_VIDEO_PROCESSOR)) { @@ -1965,7 +1976,6 @@ static HRESULT source_reader_create_transform(struct source_reader *reader, BOOL WARN("Fixing up MFVideoFormat_IYUV subtype for the video processor\n"); out_type.guidSubtype = MFVideoFormat_NV12; } - count = 0; if (SUCCEEDED(hr = MFTEnumEx(category, 0, &in_type, allow_processor ? NULL : &out_type, &activates, &count))) { @@ -2008,8 +2018,8 @@ static HRESULT source_reader_create_transform(struct source_reader *reader, BOOL && SUCCEEDED(hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type))) { if (SUCCEEDED(hr = update_media_type_from_upstream(output_type, media_type)) - && FAILED(hr = IMFTransform_SetOutputType(transform, 0, output_type, 0)) - && FAILED(hr = set_matching_transform_output_type(transform, output_type)) && allow_processor + && (force_processor || (FAILED(hr = IMFTransform_SetOutputType(transform, 0, output_type, 0)) + && FAILED(hr = set_matching_transform_output_type(transform, output_type)) && allow_processor)) && SUCCEEDED(hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type))) { struct transform_entry *converter; From c616a8499191c2fe1a268acf2f4de1e7f440f0dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 18 Feb 2025 09:28:19 +0100 Subject: [PATCH 1154/2542] HACK: winegstreamer: Set GST_GL_WINDOW environment variable. CW-Bug-Id: #24900 --- dlls/winegstreamer/unixlib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/winegstreamer/unixlib.c b/dlls/winegstreamer/unixlib.c index a82ebd6461bd..95d732da6314 100644 --- a/dlls/winegstreamer/unixlib.c +++ b/dlls/winegstreamer/unixlib.c @@ -278,6 +278,7 @@ NTSTATUS wg_init_gstreamer(void *arg) if (params->err_on) setenv("GST_DEBUG", "1", FALSE); setenv("GST_DEBUG_NO_COLOR", "1", FALSE); + setenv("GST_GL_WINDOW", "x11", 1); /* GStreamer installs a temporary SEGV handler when it loads plugins * to initialize its registry calling exit(-1) when any fault is caught. From f67089c10513e976fc2c1d1586f456dfa62933cb Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Wed, 19 Feb 2025 18:58:06 +1100 Subject: [PATCH 1155/2542] Revert "mfreadwrite: HACK: Force use of Processor when requesting RGB32." This reverts commit ff2db8bae620edcc621c4f6d486a619a72593051. --- dlls/mfreadwrite/reader.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c index 8055f52305c9..e7e92647ca3d 100644 --- a/dlls/mfreadwrite/reader.c +++ b/dlls/mfreadwrite/reader.c @@ -1907,7 +1907,6 @@ static HRESULT source_reader_create_transform(struct source_reader *reader, BOOL GUID category; IMFTransform *transform; UINT i, count; - BOOL force_processor = FALSE; HRESULT hr; if (FAILED(hr = IMFMediaType_GetMajorType(input_type, &in_type.guidMajorType)) @@ -1947,16 +1946,6 @@ static HRESULT source_reader_create_transform(struct source_reader *reader, BOOL entry->min_buffer_size = max(entry->min_buffer_size, bytes_per_second); } - if (IsEqualGUID(&in_type.guidMajorType, &MFMediaType_Video) && IsEqualGUID(&in_type.guidSubtype, &MFVideoFormat_VP90) - && IsEqualGUID(&out_type.guidSubtype, &MFVideoFormat_RGB32) && allow_processor - && IsEqualGUID(&category, &MFT_CATEGORY_VIDEO_DECODER)) - { - /* The WMV video decoder doesn't supply MFVideoFormat_RGB32 directly on Windows. It will output NV12 and a processor converts - * this to MFVideoFormat_RGB32. This also ensures the image is the correct way up. - */ - force_processor = TRUE; - } - if (IsEqualGUID(&out_type.guidMajorType, &MFMediaType_Video) && IsEqualGUID(&out_type.guidSubtype, &MFVideoFormat_ABGR32) && IsEqualGUID(&category, &MFT_CATEGORY_VIDEO_PROCESSOR)) { @@ -1976,6 +1965,7 @@ static HRESULT source_reader_create_transform(struct source_reader *reader, BOOL WARN("Fixing up MFVideoFormat_IYUV subtype for the video processor\n"); out_type.guidSubtype = MFVideoFormat_NV12; } + count = 0; if (SUCCEEDED(hr = MFTEnumEx(category, 0, &in_type, allow_processor ? NULL : &out_type, &activates, &count))) { @@ -2018,8 +2008,8 @@ static HRESULT source_reader_create_transform(struct source_reader *reader, BOOL && SUCCEEDED(hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type))) { if (SUCCEEDED(hr = update_media_type_from_upstream(output_type, media_type)) - && (force_processor || (FAILED(hr = IMFTransform_SetOutputType(transform, 0, output_type, 0)) - && FAILED(hr = set_matching_transform_output_type(transform, output_type)) && allow_processor)) + && FAILED(hr = IMFTransform_SetOutputType(transform, 0, output_type, 0)) + && FAILED(hr = set_matching_transform_output_type(transform, output_type)) && allow_processor && SUCCEEDED(hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type))) { struct transform_entry *converter; From 8e6d1d48e9e209365dd74dc0758eda78cc7e6aeb Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Wed, 19 Feb 2025 14:14:27 +1100 Subject: [PATCH 1156/2542] mf/tests: Add tests using a new WMV decoder MFT. The Microsoft WMV decoder has a bug/feature where orientation of the first output type determines the orientation for all subsequent RGB output types. If the transform is created new, then the orientation is determined by the value of the MF_MT_DEFAULT_STRIDE. (cherry picked from commit b0b0061fe871bdb43b13e5e216f9a1b16daeddd9) CW-Bug-Id: #24869 --- dlls/mf/tests/transform.c | 75 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 2 deletions(-) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index e828f719ffd2..07f967dd801f 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -6290,6 +6290,13 @@ static void test_wmv_decoder(void) .todo_time = TRUE, .todo_duration = TRUE, }; const struct sample_desc output_sample_desc_rgb = + { + .attributes = output_sample_attributes, + .sample_time = 0, .sample_duration = 333333, + .buffer_count = 1, .buffers = &output_buffer_desc_rgb, + .todo_duration = TRUE, + }; + const struct sample_desc output_sample_desc_rgb_todo_time = { .attributes = output_sample_attributes, .sample_time = 0, .sample_duration = 333333, @@ -6306,6 +6313,7 @@ static void test_wmv_decoder(void) const struct sample_desc *output_sample_desc; const WCHAR *result_bitmap; ULONG delta; + BOOL new_transform; BOOL todo; } transform_tests[] = @@ -6338,7 +6346,7 @@ static void test_wmv_decoder(void) .expect_output_type_desc = expect_output_type_desc_rgb, .expect_input_info = &expect_input_info_rgb, .expect_output_info = &expect_output_info_rgb, - .output_sample_desc = &output_sample_desc_rgb, + .output_sample_desc = &output_sample_desc_rgb_todo_time, .result_bitmap = L"rgb32frame-flip.bmp", .delta = 5, }, @@ -6349,7 +6357,7 @@ static void test_wmv_decoder(void) .expect_output_type_desc = expect_output_type_desc_rgb_negative_stride, .expect_input_info = &expect_input_info_rgb, .expect_output_info = &expect_output_info_rgb, - .output_sample_desc = &output_sample_desc_rgb, + .output_sample_desc = &output_sample_desc_rgb_todo_time, .result_bitmap = L"rgb32frame-flip.bmp", .delta = 5, }, @@ -6360,11 +6368,60 @@ static void test_wmv_decoder(void) .expect_output_type_desc = expect_output_type_desc_rgb, .expect_input_info = &expect_input_info_rgb, .expect_output_info = &expect_output_info_rgb, + .output_sample_desc = &output_sample_desc_rgb_todo_time, + .result_bitmap = L"rgb32frame-flip.bmp", + .delta = 5, + }, + + { + /* WMV1 -> RGB (w/ new transform) */ + .output_type_desc = output_type_desc_rgb, + .expect_output_type_desc = expect_output_type_desc_rgb, + .expect_input_info = &expect_input_info_rgb, + .expect_output_info = &expect_output_info_rgb, + .output_sample_desc = &output_sample_desc_rgb, + .result_bitmap = L"rgb32frame.bmp", + .delta = 5, + .new_transform = TRUE, + .todo = TRUE, + }, + + { + /* WMV1 -> RGB (negative stride, but reusing MFT w/ positive stride) */ + .output_type_desc = output_type_desc_rgb_negative_stride, + .expect_output_type_desc = expect_output_type_desc_rgb_negative_stride, + .expect_input_info = &expect_input_info_rgb, + .expect_output_info = &expect_output_info_rgb, + .output_sample_desc = &output_sample_desc_rgb_todo_time, + .result_bitmap = L"rgb32frame.bmp", + .delta = 5, + .todo = TRUE, + }, + + { + /* WMV1 -> RGB (negative stride w/ new transform) */ + .output_type_desc = output_type_desc_rgb_negative_stride, + .expect_output_type_desc = expect_output_type_desc_rgb_negative_stride, + .expect_input_info = &expect_input_info_rgb, + .expect_output_info = &expect_output_info_rgb, .output_sample_desc = &output_sample_desc_rgb, .result_bitmap = L"rgb32frame-flip.bmp", .delta = 5, + .new_transform = TRUE, }, + { + /* WMV1 -> RGB (positive stride w/ new transform) */ + .output_type_desc = output_type_desc_rgb_positive_stride, + .expect_output_type_desc = expect_output_type_desc_rgb, + .expect_input_info = &expect_input_info_rgb, + .expect_output_info = &expect_output_info_rgb, + .output_sample_desc = &output_sample_desc_rgb, + .result_bitmap = L"rgb32frame.bmp", + .delta = 5, + .new_transform = TRUE, + .todo = TRUE, + }, }; MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Video, MFVideoFormat_NV12}; @@ -6470,10 +6527,23 @@ static void test_wmv_decoder(void) ok(hr == MF_E_NO_MORE_TYPES, "GetOutputAvailableType returned %#lx\n", hr); ok(i == ARRAY_SIZE(expect_available_outputs), "%lu input media types\n", i); + check_mft_set_output_type(transform, output_type_desc_rgb, S_OK); + for (j = 0; j < ARRAY_SIZE(transform_tests); j++) { winetest_push_context("transform #%lu", j); + if (transform_tests[j].new_transform) + { + ret = IMFTransform_Release(transform); + ok(ret == 0, "Release returned %lu\n", ret); + + if (FAILED(hr = CoCreateInstance(class_id, NULL, CLSCTX_INPROC_SERVER, + &IID_IMFTransform, (void **)&transform))) + goto failed; + check_mft_set_input_type(transform, input_type_desc, S_OK); + } + check_mft_set_output_type_required(transform, transform_tests[j].output_type_desc); check_mft_set_output_type(transform, transform_tests[j].output_type_desc, S_OK); check_mft_get_output_current_type_(__LINE__, transform, transform_tests[j].expect_output_type_desc, FALSE, TRUE); @@ -6535,6 +6605,7 @@ static void test_wmv_decoder(void) ret = check_mf_sample_collection(output_samples, transform_tests[j].output_sample_desc, transform_tests[j].result_bitmap); + todo_wine_if(transform_tests[j].todo) ok(ret <= transform_tests[j].delta, "got %lu%% diff\n", ret); IMFCollection_Release(output_samples); From a2ce69ead8fe039a80bb9cda249e3315a90ca6fd Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Wed, 19 Feb 2025 16:44:55 +1100 Subject: [PATCH 1157/2542] winegstreamer: Store and use previous WMV stride value. (cherry picked from commit def913feb45e634637ca7d4b5f24c5a2a2abe037) CW-Bug-Id: #24869 --- dlls/mf/tests/transform.c | 3 -- dlls/winegstreamer/video_decoder.c | 63 +++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 5 deletions(-) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 07f967dd801f..b8a78e949d00 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -6383,7 +6383,6 @@ static void test_wmv_decoder(void) .result_bitmap = L"rgb32frame.bmp", .delta = 5, .new_transform = TRUE, - .todo = TRUE, }, { @@ -6395,7 +6394,6 @@ static void test_wmv_decoder(void) .output_sample_desc = &output_sample_desc_rgb_todo_time, .result_bitmap = L"rgb32frame.bmp", .delta = 5, - .todo = TRUE, }, { @@ -6420,7 +6418,6 @@ static void test_wmv_decoder(void) .result_bitmap = L"rgb32frame.bmp", .delta = 5, .new_transform = TRUE, - .todo = TRUE, }, }; diff --git a/dlls/winegstreamer/video_decoder.c b/dlls/winegstreamer/video_decoder.c index 3d51c2f6300c..dfea084fbc7b 100644 --- a/dlls/winegstreamer/video_decoder.c +++ b/dlls/winegstreamer/video_decoder.c @@ -110,6 +110,8 @@ struct video_decoder DMO_MEDIA_TYPE dmo_input_type; DMO_MEDIA_TYPE dmo_output_type; + + INT32 previous_stride; }; static inline struct video_decoder *impl_from_IUnknown(IUnknown *iface) @@ -238,8 +240,41 @@ static struct video_decoder *impl_from_IMFTransform(IMFTransform *iface) return CONTAINING_RECORD(iface, struct video_decoder, IMFTransform_iface); } -static HRESULT normalize_stride(IMFMediaType *media_type, IMFMediaType **ret) +static HRESULT set_previous_stride(struct video_decoder *decoder) +{ + INT32 requested_stride; + LONG default_stride; + UINT64 ratio; + UINT32 width; + GUID subtype; + HRESULT hr; + + if (FAILED(hr = IMFMediaType_GetGUID(decoder->output_type, &MF_MT_SUBTYPE, &subtype))) + return hr; + + if (FAILED(IMFMediaType_GetUINT64(decoder->output_type, &MF_MT_FRAME_SIZE, &ratio))) + ratio = (UINT64)1920 << 32 | 1080; + + width = ratio >> 32; + + if (FAILED(hr = MFGetStrideForBitmapInfoHeader(subtype.Data1, width, &default_stride))) + return hr; + + if (FAILED(IMFMediaType_GetUINT32(decoder->output_type, &MF_MT_DEFAULT_STRIDE, (UINT32*)&requested_stride))) + requested_stride = 0; + + if (default_stride > 0 || requested_stride < 0) + decoder->previous_stride = -abs(default_stride); + else + decoder->previous_stride = abs(default_stride); + + return S_OK; +} + +static HRESULT normalize_stride(struct video_decoder *decoder, IMFMediaType **ret) { + IMFMediaType *media_type = decoder->output_type; + INT32 default_stride, requested_stride; DMO_MEDIA_TYPE amt; HRESULT hr; @@ -249,6 +284,27 @@ static HRESULT normalize_stride(IMFMediaType *media_type, IMFMediaType **ret) vih->bmiHeader.biHeight = abs(vih->bmiHeader.biHeight); hr = MFCreateMediaTypeFromRepresentation(AM_MEDIA_TYPE_REPRESENTATION, &amt, ret); FreeMediaType(&amt); + + /* Stride must always be positive for YUV formats. Otherwise: + * 1. if this is the first time an output type has been specified, it must either: + * a. match the sign of the requested MF_MT_DEFAULT_STRIDE value; or + * b. default to positive; or + * 2. If an output type was previously specified and input sent it must: + * a. be negative if it was previously a YUV format; or + * b. match the sign of the previously requested MF_MT_DEFAULT_STRIDE attribute + * (defaulting to positive if it had not been provided) + */ + + if (SUCCEEDED(hr = IMFMediaType_GetUINT32(*ret, &MF_MT_DEFAULT_STRIDE, (UINT32*)&default_stride))) + { + if (FAILED(IMFMediaType_GetUINT32(media_type, &MF_MT_DEFAULT_STRIDE, (UINT32*)&requested_stride))) + requested_stride = 0; + + /* default stride less than 0 means an RGB format */ + if (default_stride < 0 && (decoder->previous_stride > 0 + || (!decoder->previous_stride && requested_stride >= 0))) + hr = IMFMediaType_SetUINT32(*ret, &MF_MT_DEFAULT_STRIDE, abs(default_stride)); + } } return hr; @@ -692,7 +748,7 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF output_type = decoder->output_type; IMFMediaType_AddRef(output_type); } - else if (FAILED(hr = normalize_stride(decoder->output_type, &output_type))) + else if (FAILED(hr = normalize_stride(decoder, &output_type))) { IMFMediaType_Release(decoder->output_type); decoder->output_type = NULL; @@ -824,6 +880,9 @@ static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFS if (decoder->sample_time == -1 && FAILED(IMFSample_GetSampleTime(sample, (LONGLONG *)&decoder->sample_time))) decoder->sample_time = 0; + if (!decoder->previous_stride) + set_previous_stride(decoder); + return wg_transform_push_mf(decoder->wg_transform, sample, decoder->wg_sample_queue); } From 63d24077a61e4052af36df69ad1344942179700e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 20 Feb 2025 16:17:41 +0100 Subject: [PATCH 1158/2542] winegstreamer/wma_decoder: Return S_FALSE when more input is needed. CW-Bug-Id: #21303 CW-Bug-Id: #21304 CW-Bug-Id: #23630 CW-Bug-Id: #24374 CW-Bug-Id: #24857 --- dlls/winegstreamer/wma_decoder.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c index ccde829e9889..cdf879d11194 100644 --- a/dlls/winegstreamer/wma_decoder.c +++ b/dlls/winegstreamer/wma_decoder.c @@ -976,6 +976,8 @@ static HRESULT WINAPI media_object_ProcessOutput(IMediaObject *iface, DWORD flag wg_sample_queue_flush(decoder->wg_sample_queue, false); } + if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT) + return S_FALSE; return hr; } From 5f8be66743d0b095d4ad4df76e3b9130edfa3065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 20 Feb 2025 16:17:41 +0100 Subject: [PATCH 1159/2542] winegstreamer/video_decoder: Return S_FALSE when more input is needed. CW-Bug-Id: #21303 CW-Bug-Id: #21304 CW-Bug-Id: #23630 CW-Bug-Id: #24374 CW-Bug-Id: #24857 --- dlls/winegstreamer/video_decoder.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/winegstreamer/video_decoder.c b/dlls/winegstreamer/video_decoder.c index dfea084fbc7b..90a367c667b2 100644 --- a/dlls/winegstreamer/video_decoder.c +++ b/dlls/winegstreamer/video_decoder.c @@ -1469,6 +1469,8 @@ static HRESULT WINAPI media_object_ProcessOutput(IMediaObject *iface, DWORD flag if (SUCCEEDED(hr)) wg_sample_queue_flush(decoder->wg_sample_queue, false); + if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT) + return S_FALSE; return hr; } From 428869a6954079d92f992b8bd3fd50e1b945bdbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 20 Feb 2025 15:05:51 +0100 Subject: [PATCH 1160/2542] qasf: Return S_OK from process_output when needs more input. CW-Bug-Id: #21303 CW-Bug-Id: #21304 CW-Bug-Id: #23630 CW-Bug-Id: #24374 CW-Bug-Id: #24857 --- dlls/qasf/dmowrapper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/qasf/dmowrapper.c b/dlls/qasf/dmowrapper.c index 0af8dccd35d6..887fa9115956 100644 --- a/dlls/qasf/dmowrapper.c +++ b/dlls/qasf/dmowrapper.c @@ -296,6 +296,8 @@ static HRESULT process_output(struct dmo_wrapper *filter, IMediaObject *dmo) release_output_samples(filter); } while (1); + if (hr == S_FALSE) + return S_OK; return hr; } From 283e68121a5521dfa5709427c73f831f2ecfe45c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 20 Feb 2025 14:45:13 +0100 Subject: [PATCH 1161/2542] HACK: winegstreamer/wm_reader: Disable OpenGL pipeline for KiriKiri games. CW-Bug-Id: #21303 CW-Bug-Id: #21304 CW-Bug-Id: #23630 CW-Bug-Id: #24374 CW-Bug-Id: #24857 --- dlls/winegstreamer/wm_reader.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 6973f519ceff..a7c312576ead 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -1470,14 +1470,27 @@ static void destroy_stream(struct wm_reader *reader) static HRESULT init_stream(struct wm_reader *reader) { + BOOL enable_opengl = sizeof(void *) == 4; wg_parser_t wg_parser; HRESULT hr; WORD i; +{ + const char *sgi = getenv("SteamGameId"); + if (sgi && (0 + || !strcmp(sgi, "802870") + || !strcmp(sgi, "1083650") + || !strcmp(sgi, "1097880") + || !strcmp(sgi, "1230140") + || !strcmp(sgi, "2515070") + )) + enable_opengl = FALSE; +} + /* 32-bit GStreamer ORC cannot efficiently convert I420 to RGBA, use OpenGL converter * in that case but keep the usual codepath otherwise. */ - if (!(wg_parser = wg_parser_create(FALSE, sizeof(void *) == 4))) + if (!(wg_parser = wg_parser_create(FALSE, enable_opengl))) return E_OUTOFMEMORY; reader->wg_parser = wg_parser; @@ -1583,10 +1596,23 @@ static HRESULT init_stream(struct wm_reader *reader) static HRESULT reinit_stream(struct wm_reader *reader, bool read_compressed) { + BOOL enable_opengl = sizeof(void *) == 4 && !read_compressed; wg_parser_t wg_parser; HRESULT hr; WORD i; +{ + const char *sgi = getenv("SteamGameId"); + if (sgi && (0 + || !strcmp(sgi, "802870") + || !strcmp(sgi, "1083650") + || !strcmp(sgi, "1097880") + || !strcmp(sgi, "1230140") + || !strcmp(sgi, "2515070") + )) + enable_opengl = FALSE; +} + wg_parser_disconnect(reader->wg_parser); EnterCriticalSection(&reader->shutdown_cs); @@ -1600,7 +1626,7 @@ static HRESULT reinit_stream(struct wm_reader *reader, bool read_compressed) wg_parser_destroy(reader->wg_parser); reader->wg_parser = 0; - if (!(wg_parser = wg_parser_create(read_compressed, sizeof(void *) == 4 && !read_compressed))) + if (!(wg_parser = wg_parser_create(read_compressed, enable_opengl))) return E_OUTOFMEMORY; reader->wg_parser = wg_parser; From 07c1d94d9a4fa212e01a867d81cc41dde84242eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 20 Feb 2025 14:45:13 +0100 Subject: [PATCH 1162/2542] HACK: winegstreamer/wm_reader: Read compressed samples for KiriKiri games. CW-Bug-Id: #21303 CW-Bug-Id: #21304 CW-Bug-Id: #23630 CW-Bug-Id: #24374 CW-Bug-Id: #24857 --- dlls/winegstreamer/wm_reader.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index a7c312576ead..4c2e276499b0 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -2548,7 +2548,15 @@ static HRESULT WINAPI reader_SetReadStreamSamples(IWMSyncReader2 *iface, WORD st { const char *sgi = getenv("SteamGameId"); - if (sgi && !strcmp(sgi, "638160")) compressed = FALSE; + if (sgi && (0 + || !strcmp(sgi, "638160") + || !strcmp(sgi, "802870") + || !strcmp(sgi, "1083650") + || !strcmp(sgi, "1097880") + || !strcmp(sgi, "1230140") + || !strcmp(sgi, "2515070") + )) + compressed = FALSE; } if (stream->demux_compressed != compressed) From 828e2bc9f443ea8a397a3db3f2d05ee79cbb4cd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 20 Feb 2025 14:45:13 +0100 Subject: [PATCH 1163/2542] HACK: winegstreamer/wm_reader: Fake compressed output formats for KiriKiri games. CW-Bug-Id: #21303 CW-Bug-Id: #21304 CW-Bug-Id: #23630 CW-Bug-Id: #24374 CW-Bug-Id: #24857 --- dlls/winegstreamer/wm_reader.c | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 4c2e276499b0..9145f59f474a 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -556,6 +556,45 @@ static HRESULT WINAPI stream_props_GetMediaType(IWMMediaProps *iface, WM_MEDIA_T wg_parser_stream_get_codec_format(config->stream->wg_stream, &codec_format); format = (codec_format.major_type != WG_MAJOR_TYPE_UNKNOWN && config->stream->demux_compressed) ? &codec_format : &config->stream->format; + +{ + const char *sgi = getenv("SteamGameId"); + if (format->major_type == WG_MAJOR_TYPE_VIDEO && sgi && (0 + || !strcmp(sgi, "802870") + || !strcmp(sgi, "1083650") + || !strcmp(sgi, "1097880") + || !strcmp(sgi, "1230140") + )) + { + codec_format = config->stream->format; + codec_format.major_type = WG_MAJOR_TYPE_VIDEO_WMV; + codec_format.u.video.format = WG_VIDEO_FORMAT_WMV3; + codec_format.u.video.height = abs(codec_format.u.video.height); + format = &codec_format; + } + if (format->major_type == WG_MAJOR_TYPE_VIDEO && sgi && (0 + || !strcmp(sgi, "2515070") + )) + { + codec_format = config->stream->format; + codec_format.major_type = WG_MAJOR_TYPE_VIDEO_WMV; + codec_format.u.video.format = WG_VIDEO_FORMAT_WVC1; + codec_format.u.video.height = abs(codec_format.u.video.height); + format = &codec_format; + } + if (format->major_type == WG_MAJOR_TYPE_AUDIO && sgi && (0 + || !strcmp(sgi, "802870") + || !strcmp(sgi, "1230140") + || !strcmp(sgi, "2515070") + )) + { + codec_format = config->stream->format; + codec_format.major_type = WG_MAJOR_TYPE_AUDIO_WMA; + codec_format.u.audio.version = 2; + format = &codec_format; + } +} + if (!amt_from_wg_format(&stream_mt, format, true)) return E_OUTOFMEMORY; From d81e4c61f7363479aaa335aa0c3fa2163079d84e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 20 Feb 2025 15:09:01 +0100 Subject: [PATCH 1164/2542] HACK: winegstreamer/video_decoder: Fake decoder input format for KiriKiri games. CW-Bug-Id: #21303 CW-Bug-Id: #21304 CW-Bug-Id: #23630 CW-Bug-Id: #24374 CW-Bug-Id: #24857 --- dlls/winegstreamer/video_decoder.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dlls/winegstreamer/video_decoder.c b/dlls/winegstreamer/video_decoder.c index 90a367c667b2..879e4d391a01 100644 --- a/dlls/winegstreamer/video_decoder.c +++ b/dlls/winegstreamer/video_decoder.c @@ -1261,6 +1261,22 @@ static HRESULT WINAPI media_object_SetInputType(IMediaObject *iface, DWORD index decoder->wg_transform = 0; } +{ + const char *sgi = getenv("SteamGameId"); + if (sgi && (0 + || !strcmp(sgi, "802870") + || !strcmp(sgi, "1083650") + || !strcmp(sgi, "1097880") + || !strcmp(sgi, "1230140") + || !strcmp(sgi, "2515070") + )) + { + VIDEOINFOHEADER *vih = (VIDEOINFOHEADER *)decoder->dmo_input_type.pbFormat; + decoder->dmo_input_type.subtype = MFVideoFormat_RGB24; + vih->bmiHeader.biCompression = BI_RGB; + } +} + return S_OK; } From b34d1eb260123c817e2a89b4223f50122d8047d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 20 Feb 2025 16:18:19 +0100 Subject: [PATCH 1165/2542] HACK: winegstreamer/wma_decoder: Fake decoder input format for KiriKiri games. CW-Bug-Id: #21303 CW-Bug-Id: #21304 CW-Bug-Id: #23630 CW-Bug-Id: #24374 CW-Bug-Id: #24857 --- dlls/winegstreamer/wma_decoder.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c index cdf879d11194..e7f073cd83e0 100644 --- a/dlls/winegstreamer/wma_decoder.c +++ b/dlls/winegstreamer/wma_decoder.c @@ -762,6 +762,21 @@ static HRESULT WINAPI media_object_SetInputType(IMediaObject *iface, DWORD index decoder->wg_transform = 0; } +{ + const char *sgi = getenv("SteamGameId"); + if (sgi && (0 + || !strcmp(sgi, "802870") + || !strcmp(sgi, "1230140") + || !strcmp(sgi, "2515070") + )) + { + WAVEFORMATEX *wfx = (WAVEFORMATEX *)decoder->input_type.pbFormat; + decoder->input_type.subtype = MFAudioFormat_PCM; + wfx->wFormatTag = WAVE_FORMAT_PCM; + wfx->wBitsPerSample = 16; + } +} + return S_OK; } From 5ca8e671b6b2d0ac8bb4431ee614d5df6d95efa7 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Thu, 20 Feb 2025 17:18:49 +0800 Subject: [PATCH 1166/2542] imm32/tests: Test that the IME UI window shouldn't be above normal windows at creation. (cherry picked from commit 487a336e584915cfaa78aff8ae3898d6570688c4) --- dlls/imm32/tests/imm32.c | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c index db73463ef497..7cec65f9b271 100644 --- a/dlls/imm32/tests/imm32.c +++ b/dlls/imm32/tests/imm32.c @@ -8037,8 +8037,58 @@ static void test_nihongo_no(void) ime_call_count = 0; } +static BOOL CALLBACK enum_first_current_thread_window_proc( HWND hwnd, LPARAM lparam ) +{ + if (GetWindowThreadProcessId( hwnd, NULL ) == GetCurrentThreadId()) + { + *(HWND *)lparam = hwnd; + return FALSE; + } + return TRUE; +} + +static void test_ime_ui_window_child( void ) +{ + HWND hwnd, result_hwnd = 0; + + /* Unity expects the first window in the current thread to be its game window, not Wine IME */ + hwnd = CreateWindowW( L"static", L"", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, 100, 100, NULL, NULL, NULL, NULL ); + ok_ne( 0, hwnd, HWND, "%p" ); + EnumWindows( enum_first_current_thread_window_proc, (LPARAM)&result_hwnd ); + todo_wine + ok_eq( result_hwnd, hwnd, HWND, "%p" ); + DestroyWindow( hwnd ); +} + +static void test_ime_ui_window( const char *argv0 ) +{ + PROCESS_INFORMATION info; + STARTUPINFOA startup; + char cmd[MAX_PATH]; + + /* Run in a new process to avoid interference from windows in the current process */ + sprintf( cmd, "%s imm32 test_ime_ui_window_child", argv0 ); + memset( &startup, 0, sizeof(startup) ); + startup.cb = sizeof(startup); + CreateProcessA( NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info ); + + wait_child_process( info.hProcess ); + CloseHandle( info.hProcess ); + CloseHandle( info.hThread ); +} + START_TEST(imm32) { + char **argv; + int argc; + + argc = winetest_get_mainargs( &argv ); + if (argc == 3 && !strcmp( argv[2], "test_ime_ui_window_child" )) + { + test_ime_ui_window_child(); + return; + } + default_hkl = GetKeyboardLayout( 0 ); test_class.hInstance = GetModuleHandleW( NULL ); @@ -8050,6 +8100,7 @@ START_TEST(imm32) return; } + test_ime_ui_window( argv[0] ); test_com_initialization(); test_ImmEnumInputContext(); From 5cd52e745dd730dd114e0cdb221129a39cd6f4a9 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Thu, 20 Feb 2025 17:18:49 +0800 Subject: [PATCH 1167/2542] imm32: Move the IME UI window to the bottom at creation. Tidy Cauldron (2708320), a Unity game, uses EnumWindows() to find the first window in the current thread and maximizes the window when changing to windowed mode. However, before this patch, the IME UI window and the DXGI fallback device window are on top of the game window at creation and thus they could get maximized instead. This causes the game window to lose focus and freeze. (cherry picked from commit 1ac9ae87617b6c70dca0c995d1b6aec1eb54ede7) --- dlls/imm32/imm.c | 1 + dlls/imm32/tests/imm32.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index dbf8db63e114..5639c2ae11c6 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -948,6 +948,7 @@ static HWND get_ime_ui_window(void) { imc->ui_hwnd = CreateWindowExW( WS_EX_TOOLWINDOW, ime->ui_class, NULL, WS_POPUP, 0, 0, 1, 1, ImmGetDefaultIMEWnd( 0 ), 0, ime->module, 0 ); + SetWindowPos( imc->ui_hwnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE ); SetWindowLongPtrW( imc->ui_hwnd, IMMGWL_IMC, (LONG_PTR)NtUserGetWindowInputContext( GetFocus() ) ); } return imc->ui_hwnd; diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c index 7cec65f9b271..5b4e194c367f 100644 --- a/dlls/imm32/tests/imm32.c +++ b/dlls/imm32/tests/imm32.c @@ -8055,7 +8055,6 @@ static void test_ime_ui_window_child( void ) hwnd = CreateWindowW( L"static", L"", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, 100, 100, NULL, NULL, NULL, NULL ); ok_ne( 0, hwnd, HWND, "%p" ); EnumWindows( enum_first_current_thread_window_proc, (LPARAM)&result_hwnd ); - todo_wine ok_eq( result_hwnd, hwnd, HWND, "%p" ); DestroyWindow( hwnd ); } From a4993360db88e5e3fa4783c42f563d86ea5681f6 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Thu, 20 Feb 2025 17:18:49 +0800 Subject: [PATCH 1168/2542] d3d11/tests: Test that the fallback device window shouldn't be above normal windows at creation. (cherry picked from commit 903188625307e5fb74946f1acd7463d767e4fe1e) --- dlls/d3d11/tests/d3d11.c | 84 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 83 insertions(+), 1 deletion(-) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 9c5b35faafa6..87627b44e0f9 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -2046,6 +2046,66 @@ static void draw_color_quad_(unsigned int line, struct d3d11_test_context *conte draw_quad_vs_(line, context, vs_code, vs_code_size); } +static BOOL CALLBACK enum_first_current_thread_window_proc(HWND hwnd, LPARAM lparam) +{ + if (GetWindowThreadProcessId(hwnd, NULL) == GetCurrentThreadId()) + { + *(HWND *)lparam = hwnd; + return FALSE; + } + return TRUE; +} + +static void test_create_device_child(void) +{ + DXGI_SWAP_CHAIN_DESC swapchain_desc; + HWND hwnd, result_hwnd; + ID3D11Device *device; + HRESULT hr; + + /* Unity expects the first window in the current thread to be its game window, not DXGI device window */ + hwnd = CreateWindowW(L"static", L"", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, 100, 100, NULL, NULL, NULL, NULL); + + /* Create a device without a device window in windowed mode */ + swapchain_desc.BufferDesc.Width = 800; + swapchain_desc.BufferDesc.Height = 600; + swapchain_desc.BufferDesc.RefreshRate.Numerator = 60; + swapchain_desc.BufferDesc.RefreshRate.Denominator = 60; + swapchain_desc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + swapchain_desc.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED; + swapchain_desc.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED; + swapchain_desc.SampleDesc.Count = 1; + swapchain_desc.SampleDesc.Quality = 0; + swapchain_desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; + swapchain_desc.BufferCount = 1; + swapchain_desc.OutputWindow = NULL; + swapchain_desc.Windowed = TRUE; + swapchain_desc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; + swapchain_desc.Flags = 0; + hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, + &swapchain_desc, NULL, &device, NULL, NULL); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + EnumWindows(enum_first_current_thread_window_proc, (LPARAM)&result_hwnd); + todo_wine + ok(result_hwnd == hwnd, "Got unexpected window %p.\n", result_hwnd); + + ID3D11Device_Release(device); + + /* Create a device without a device window in fullscreen mode */ + swapchain_desc.Windowed = FALSE; + hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, + &swapchain_desc, NULL, &device, NULL, NULL); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + EnumWindows(enum_first_current_thread_window_proc, (LPARAM)&result_hwnd); + todo_wine + ok(result_hwnd == hwnd, "Got unexpected window %p.\n", result_hwnd); + + ID3D11Device_Release(device); + DestroyWindow(hwnd); +} + static void test_create_device(void) { static const D3D_FEATURE_LEVEL default_feature_levels[] = @@ -2060,8 +2120,11 @@ static void test_create_device(void) D3D_FEATURE_LEVEL feature_level, supported_feature_level; DXGI_SWAP_CHAIN_DESC swapchain_desc, obtained_desc; ID3D11DeviceContext *immediate_context; + char **argv, cmd[MAX_PATH]; IDXGISwapChain *swapchain; + PROCESS_INFORMATION info; ID3D11Device *device; + STARTUPINFOA startup; ULONG refcount; HWND window; HRESULT hr; @@ -2268,6 +2331,19 @@ static void test_create_device(void) ok(!immediate_context, "Got unexpected immediate context pointer %p.\n", immediate_context); DestroyWindow(window); + + /* Test that creating a swapchain without a device window shouldn't create a fallback device + * window that's on top of normal windows at creation. Run the tests in a new process to avoid + * interference from windows in the current process */ + winetest_get_mainargs(&argv); + sprintf(cmd, "%s d3d11 test_create_device_child", argv[0]); + memset(&startup, 0, sizeof(startup)); + startup.cb = sizeof(startup); + ok(CreateProcessA(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info), "CreateProcess failed.\n"); + + wait_child_process(info.hProcess); + CloseHandle(info.hProcess); + CloseHandle(info.hThread); } static void test_device_interfaces(const D3D_FEATURE_LEVEL feature_level) @@ -36588,6 +36664,13 @@ START_TEST(d3d11) HMODULE wined3d; char **argv; + argc = winetest_get_mainargs(&argv); + if (argc == 3 && !strcmp(argv[2], "test_create_device_child")) + { + test_create_device_child(); + return; + } + if ((wined3d = GetModuleHandleA("wined3d.dll"))) { enum wined3d_renderer (CDECL *p_wined3d_get_renderer)(void); @@ -36604,7 +36687,6 @@ START_TEST(d3d11) if (sizeof(void *) == 4 && !strcmp(winetest_platform, "wine")) use_mt = FALSE; - argc = winetest_get_mainargs(&argv); for (i = 2; i < argc; ++i) { if (!strcmp(argv[i], "--validate")) From 30c90ced948b5da0b0aa8911174cff44f1bc7503 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Thu, 20 Feb 2025 17:18:49 +0800 Subject: [PATCH 1169/2542] dxgi: Move the fallback device window to the bottom at creation. Tidy Cauldron (2708320), a Unity game, uses EnumWindows() to find the first window in the current thread and maximizes the window when changing to windowed mode. However, before this patch, the IME UI window and the DXGI fallback device window are on top of the game window at creation and thus they could get maximized instead. This causes the game window to lose focus and freeze. (cherry picked from commit 900fb8793986ae6ed1a8dd4700ab906cb8c3b94e) --- dlls/d3d11/tests/d3d11.c | 2 -- dlls/dxgi/factory.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 87627b44e0f9..b88a01814151 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -2087,7 +2087,6 @@ static void test_create_device_child(void) ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); EnumWindows(enum_first_current_thread_window_proc, (LPARAM)&result_hwnd); - todo_wine ok(result_hwnd == hwnd, "Got unexpected window %p.\n", result_hwnd); ID3D11Device_Release(device); @@ -2099,7 +2098,6 @@ static void test_create_device_child(void) ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); EnumWindows(enum_first_current_thread_window_proc, (LPARAM)&result_hwnd); - todo_wine ok(result_hwnd == hwnd, "Got unexpected window %p.\n", result_hwnd); ID3D11Device_Release(device); diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index 32d54f033eb1..ebdb42a3806e 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -617,6 +617,7 @@ HWND dxgi_factory_get_device_window(struct dxgi_factory *factory) ERR("Failed to create a window.\n"); return NULL; } + SetWindowPos(factory->device_window, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); TRACE("Created device window %p for factory %p.\n", factory->device_window, factory); } From cb867d85bb8b5e20da9906d877a466768d2c7588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 21 Feb 2025 09:40:50 +0100 Subject: [PATCH 1170/2542] Revert "winex11: Avoid creating windows with override-redirect flag set." This reverts commit 3e62dfa6505dd0b9be327d36c5dab9cc45d885a6. --- dlls/winex11.drv/window.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 85dbce46e2b4..43d09fc74257 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2251,6 +2251,12 @@ static void create_whole_window( struct x11drv_win_data *data ) HRGN win_rgn; POINT pos; + if (!data->managed && is_window_managed( data->hwnd, SWP_NOACTIVATE, &data->rects.window )) + { + TRACE( "making win %p/%lx managed\n", data->hwnd, data->whole_window ); + data->managed = TRUE; + } + if ((win_rgn = NtGdiCreateRectRgn( 0, 0, 0, 0 )) && NtUserGetWindowRgnEx( data->hwnd, win_rgn, 0 ) == ERROR) { @@ -2262,7 +2268,6 @@ static void create_whole_window( struct x11drv_win_data *data ) if (data->vis.visualid != default_visual.visualid) data->whole_colormap = XCreateColormap( data->display, root_window, data->vis.visual, AllocNone ); - data->managed = TRUE; mask = get_window_attributes( data, &attr ); if (!(cx = data->rects.visible.right - data->rects.visible.left)) cx = 1; @@ -2281,7 +2286,6 @@ static void create_whole_window( struct x11drv_win_data *data ) data->pending_state.rect = data->current_state.rect; data->desired_state.rect = data->current_state.rect; - if (!is_window_managed( data->hwnd, SWP_NOACTIVATE, &data->rects.window )) data->managed = FALSE; x11drv_xinput2_enable( data->display, data->whole_window ); set_initial_wm_hints( data->display, data->whole_window ); set_wm_hints( data, 0 ); From 50fda2b3d56438ebd25072bd614b05ec4c1cfa09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 19 Feb 2025 13:38:44 +0100 Subject: [PATCH 1171/2542] winex11: Initialize window managed flag in create_whole_window. --- dlls/winex11.drv/window.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 43d09fc74257..98f70d253142 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2251,12 +2251,6 @@ static void create_whole_window( struct x11drv_win_data *data ) HRGN win_rgn; POINT pos; - if (!data->managed && is_window_managed( data->hwnd, SWP_NOACTIVATE, &data->rects.window )) - { - TRACE( "making win %p/%lx managed\n", data->hwnd, data->whole_window ); - data->managed = TRUE; - } - if ((win_rgn = NtGdiCreateRectRgn( 0, 0, 0, 0 )) && NtUserGetWindowRgnEx( data->hwnd, win_rgn, 0 ) == ERROR) { @@ -2268,6 +2262,7 @@ static void create_whole_window( struct x11drv_win_data *data ) if (data->vis.visualid != default_visual.visualid) data->whole_colormap = XCreateColormap( data->display, root_window, data->vis.visual, AllocNone ); + data->managed = is_window_managed( data->hwnd, SWP_NOACTIVATE, &data->rects.window ); mask = get_window_attributes( data, &attr ); if (!(cx = data->rects.visible.right - data->rects.visible.left)) cx = 1; From 737612e20862fcc6c3d0550e4fd09d3576e07023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 21 Feb 2025 11:24:45 +0100 Subject: [PATCH 1172/2542] winex11: Request managed/embedded in a new window_set_managed helper. --- dlls/winex11.drv/window.c | 51 +++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 98f70d253142..939fe33860b6 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -476,7 +476,6 @@ static unsigned long get_mwm_decorations( struct x11drv_win_data *data, DWORD st */ static int get_window_attributes( struct x11drv_win_data *data, XSetWindowAttributes *attr ) { - attr->override_redirect = !data->managed; attr->colormap = data->whole_colormap ? data->whole_colormap : default_colormap; attr->save_under = ((NtUserGetClassLongW( data->hwnd, GCL_STYLE ) & CS_SAVEBITS) != 0); attr->bit_gravity = NorthWestGravity; @@ -488,7 +487,7 @@ static int get_window_attributes( struct x11drv_win_data *data, XSetWindowAttrib KeyPressMask | KeyReleaseMask | FocusChangeMask | KeymapStateMask | StructureNotifyMask | PropertyChangeMask); - return (CWOverrideRedirect | CWSaveUnder | CWColormap | CWBorderPixel | CWBackPixel | + return (CWSaveUnder | CWColormap | CWBorderPixel | CWBackPixel | CWEventMask | CWBitGravity | CWBackingStore); } @@ -1622,6 +1621,31 @@ static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state, U XFlush( data->display ); } +static void window_set_managed( struct x11drv_win_data *data, BOOL new_managed, BOOL new_embedded ) +{ + UINT wm_state = data->desired_state.wm_state, swp_flags = data->desired_state.swp_flags; + XSetWindowAttributes attr = {.override_redirect = !new_managed}; + BOOL old_managed = data->managed, old_embedded = data->embedded; + + if (!data->whole_window) return; /* no window, nothing to update */ + if (old_managed == new_managed && old_embedded == new_embedded) return; /* states are the same, nothing to update */ + if (!new_managed) + { + ERR( "Changing window to unmanaged is not supported\n" ); + return; + } + + window_set_wm_state( data, WithdrawnState, 0 ); /* no WM_STATE is pending, requested immediately */ + + data->managed = new_managed; + data->embedded = new_embedded; + TRACE( "window %p/%lx, requesting override-redirect %u -> %u serial %lu\n", data->hwnd, data->whole_window, + !old_managed, !new_managed, NextRequest( data->display ) ); + XChangeWindowAttributes( data->display, data->whole_window, CWOverrideRedirect, &attr ); + + window_set_wm_state( data, wm_state, swp_flags ); /* queue another WM_STATE request with the desired state */ +} + /*********************************************************************** * map_window @@ -1886,11 +1910,7 @@ BOOL window_should_take_focus( HWND hwnd, Time time ) */ void make_window_embedded( struct x11drv_win_data *data ) { - /* the window cannot be mapped before being embedded */ - window_set_wm_state( data, WithdrawnState, 0 ); - data->embedded = TRUE; - data->managed = TRUE; - window_set_wm_state( data, NormalState, SWP_NOACTIVATE ); + window_set_managed( data, TRUE, TRUE ); } @@ -2263,7 +2283,8 @@ static void create_whole_window( struct x11drv_win_data *data ) data->whole_colormap = XCreateColormap( data->display, root_window, data->vis.visual, AllocNone ); data->managed = is_window_managed( data->hwnd, SWP_NOACTIVATE, &data->rects.window ); - mask = get_window_attributes( data, &attr ); + mask = get_window_attributes( data, &attr ) | CWOverrideRedirect; + attr.override_redirect = !data->managed; if (!(cx = data->rects.visible.right - data->rects.visible.left)) cx = 1; else if (cx > 65535) cx = 65535; @@ -2336,6 +2357,8 @@ static void destroy_whole_window( struct x11drv_win_data *data, BOOL already_des if (data->whole_colormap) XFreeColormap( data->display, data->whole_colormap ); data->whole_window = data->client_window = 0; data->whole_colormap = 0; + data->managed = FALSE; + data->embedded = FALSE; memset( &data->desired_state, 0, sizeof(data->desired_state) ); memset( &data->pending_state, 0, sizeof(data->pending_state) ); @@ -2488,7 +2511,7 @@ static BOOL create_desktop_win_data( Window win, HWND hwnd ) if (!(data = alloc_win_data( display, hwnd ))) return FALSE; data->whole_window = win; - data->managed = TRUE; + window_set_managed( data, TRUE, FALSE ); NtUserSetProp( data->hwnd, whole_window_prop, (HANDLE)win ); set_initial_wm_hints( display, win ); if (is_desktop_fullscreen()) window_set_net_wm_state( data, fullscreen_mask ); @@ -2988,7 +3011,6 @@ void X11DRV_SetParent( HWND hwnd, HWND parent, HWND old_parent ) { /* destroy the old X windows */ destroy_whole_window( data, FALSE ); - data->managed = FALSE; } } else /* new top level window */ @@ -3022,14 +3044,7 @@ BOOL X11DRV_WindowPosChanging( HWND hwnd, UINT swp_flags, BOOL shaped, const str data->shaped = shaped; /* check if we need to switch the window to managed */ - if (!data->managed && data->whole_window && is_window_managed( hwnd, swp_flags, &rects->window )) - { - TRACE( "making win %p/%lx managed\n", hwnd, data->whole_window ); - release_win_data( data ); - unmap_window( hwnd ); - if (!(data = get_win_data( hwnd ))) return FALSE; /* use default surface */ - data->managed = TRUE; - } + if (is_window_managed( hwnd, swp_flags, &rects->window )) window_set_managed( data, TRUE, data->embedded ); ret = !!data->whole_window; /* use default surface if we don't have a window */ release_win_data( data ); From edfe62cd4ae60b93db19b30389a10851244bfec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 21 Feb 2025 11:00:12 +0100 Subject: [PATCH 1173/2542] winex11: Check managed window changes in WindowPosChanged. --- dlls/winex11.drv/window.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 939fe33860b6..c48de2f0abd0 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -3043,9 +3043,6 @@ BOOL X11DRV_WindowPosChanging( HWND hwnd, UINT swp_flags, BOOL shaped, const str if (!data && !(data = X11DRV_create_win_data( hwnd, rects ))) return FALSE; /* use default surface */ data->shaped = shaped; - /* check if we need to switch the window to managed */ - if (is_window_managed( hwnd, swp_flags, &rects->window )) window_set_managed( data, TRUE, data->embedded ); - ret = !!data->whole_window; /* use default surface if we don't have a window */ release_win_data( data ); @@ -3119,6 +3116,7 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UIN set_surface_window_rects( surface, new_rects ); if (!(data = get_win_data( hwnd ))) return; + if (is_window_managed( hwnd, swp_flags, &new_rects->window )) window_set_managed( data, TRUE, data->embedded ); old_style = new_style & ~(WS_VISIBLE | WS_MINIMIZE | WS_MAXIMIZE); if (data->desired_state.wm_state != WithdrawnState) old_style |= WS_VISIBLE; From adc7bab279f856eb8aaad80886c5a779b7fa784a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 21 Feb 2025 11:00:32 +0100 Subject: [PATCH 1174/2542] winex11: Pass fullscreen flag to is_window_managed. Instead of checking for monitor rect. --- dlls/winex11.drv/window.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index c48de2f0abd0..a22870b9fc3c 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -381,7 +381,7 @@ static struct x11drv_win_data *alloc_win_data( Display *display, HWND hwnd ) * * Check if a given window should be managed */ -static BOOL is_window_managed( HWND hwnd, UINT swp_flags, const RECT *window_rect ) +static BOOL is_window_managed( HWND hwnd, UINT swp_flags, BOOL fullscreen ) { DWORD style, ex_style; @@ -399,18 +399,10 @@ static BOOL is_window_managed( HWND hwnd, UINT swp_flags, const RECT *window_rec if (style & WS_THICKFRAME) return TRUE; if (style & WS_POPUP) { - HMONITOR hmon; - MONITORINFO mi; - /* popup with sysmenu == caption are managed */ if (style & WS_SYSMENU) return TRUE; /* full-screen popup windows are managed */ - hmon = NtUserMonitorFromWindow( hwnd, MONITOR_DEFAULTTOPRIMARY ); - mi.cbSize = sizeof( mi ); - NtUserGetMonitorInfo( hmon, &mi ); - if (window_rect->left <= mi.rcWork.left && window_rect->right >= mi.rcWork.right && - window_rect->top <= mi.rcWork.top && window_rect->bottom >= mi.rcWork.bottom) - return TRUE; + if (fullscreen) return TRUE; } /* application windows are managed */ ex_style = NtUserGetWindowLongW( hwnd, GWL_EXSTYLE ); @@ -2282,7 +2274,7 @@ static void create_whole_window( struct x11drv_win_data *data ) if (data->vis.visualid != default_visual.visualid) data->whole_colormap = XCreateColormap( data->display, root_window, data->vis.visual, AllocNone ); - data->managed = is_window_managed( data->hwnd, SWP_NOACTIVATE, &data->rects.window ); + data->managed = is_window_managed( data->hwnd, SWP_NOACTIVATE, FALSE ); mask = get_window_attributes( data, &attr ) | CWOverrideRedirect; attr.override_redirect = !data->managed; @@ -3116,7 +3108,7 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, HWND owner_hint, UIN set_surface_window_rects( surface, new_rects ); if (!(data = get_win_data( hwnd ))) return; - if (is_window_managed( hwnd, swp_flags, &new_rects->window )) window_set_managed( data, TRUE, data->embedded ); + if (is_window_managed( hwnd, swp_flags, fullscreen )) window_set_managed( data, TRUE, data->embedded ); old_style = new_style & ~(WS_VISIBLE | WS_MINIMIZE | WS_MAXIMIZE); if (data->desired_state.wm_state != WithdrawnState) old_style |= WS_VISIBLE; From bd97024d2e68affe99cd151ec21477ffa137f3a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 19 Feb 2025 13:42:22 +0100 Subject: [PATCH 1175/2542] winewayland: Pass fullscreen flag to is_window_managed. --- dlls/winewayland.drv/window.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/dlls/winewayland.drv/window.c b/dlls/winewayland.drv/window.c index 67718936b534..e80bebdc042b 100644 --- a/dlls/winewayland.drv/window.c +++ b/dlls/winewayland.drv/window.c @@ -362,7 +362,7 @@ static inline HWND get_active_window(void) * * Check if a given window should be managed */ -static BOOL is_window_managed(HWND hwnd, UINT swp_flags, const RECT *window_rect) +static BOOL is_window_managed(HWND hwnd, UINT swp_flags, BOOL fullscreen) { DWORD style, ex_style; @@ -378,18 +378,10 @@ static BOOL is_window_managed(HWND hwnd, UINT swp_flags, const RECT *window_rect if (style & WS_THICKFRAME) return TRUE; if (style & WS_POPUP) { - HMONITOR hmon; - MONITORINFO mi; - /* popup with sysmenu == caption are managed */ if (style & WS_SYSMENU) return TRUE; /* full-screen popup windows are managed */ - hmon = NtUserMonitorFromWindow(hwnd, MONITOR_DEFAULTTOPRIMARY); - mi.cbSize = sizeof(mi); - NtUserGetMonitorInfo(hmon, &mi); - if (window_rect->left <= mi.rcWork.left && window_rect->right >= mi.rcWork.right && - window_rect->top <= mi.rcWork.top && window_rect->bottom >= mi.rcWork.bottom) - return TRUE; + if (fullscreen) return TRUE; } /* application windows are managed */ ex_style = NtUserGetWindowLongW(hwnd, GWL_EXSTYLE); @@ -448,7 +440,7 @@ void WAYLAND_WindowPosChanged(HWND hwnd, HWND insert_after, HWND owner_hint, UIN /* Get the managed state with win_data unlocked, as is_window_managed * may need to query win_data information about other HWNDs and thus * acquire the lock itself internally. */ - if (!(managed = is_window_managed(hwnd, swp_flags, &new_rects->window)) && surface) toplevel = owner_hint; + if (!(managed = is_window_managed(hwnd, swp_flags, fullscreen)) && surface) toplevel = owner_hint; if (!(data = wayland_win_data_get(hwnd))) return; toplevel_data = toplevel && toplevel != hwnd ? wayland_win_data_get_nolock(toplevel) : NULL; From 1d38ad95b8902c73cd117f906362c52f0441b1c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 21 Feb 2025 11:01:22 +0100 Subject: [PATCH 1176/2542] winex11: Avoid creating windows with override-redirect flag set. This confuses mutter and it manifests with spurious IconicState WM_STATE change when it decides to try managing the window, but it also makes it randomly lose focus or even fail to map the window back on screen. Adding the flag after the window has been created fixes the issue. --- dlls/winex11.drv/window.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index a22870b9fc3c..89eee3d8c7df 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2274,7 +2274,7 @@ static void create_whole_window( struct x11drv_win_data *data ) if (data->vis.visualid != default_visual.visualid) data->whole_colormap = XCreateColormap( data->display, root_window, data->vis.visual, AllocNone ); - data->managed = is_window_managed( data->hwnd, SWP_NOACTIVATE, FALSE ); + data->managed = managed_mode; mask = get_window_attributes( data, &attr ) | CWOverrideRedirect; attr.override_redirect = !data->managed; @@ -2294,6 +2294,8 @@ static void create_whole_window( struct x11drv_win_data *data ) data->pending_state.rect = data->current_state.rect; data->desired_state.rect = data->current_state.rect; + /* Set override-redirect attribute only after window creation, Mutter gets confused otherwise */ + window_set_managed( data, is_window_managed( data->hwnd, SWP_NOACTIVATE, FALSE ), FALSE ); x11drv_xinput2_enable( data->display, data->whole_window ); set_initial_wm_hints( data->display, data->whole_window ); set_wm_hints( data, 0 ); From f3ae8e06086db6280f0fbdfe1a9dffa452aff00c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 21 Feb 2025 12:35:35 +0100 Subject: [PATCH 1177/2542] winex11: Introduce a new handle_state_change helper. (fixup) --- dlls/winex11.drv/window.c | 40 +++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 89eee3d8c7df..c76bf25e10ad 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1779,26 +1779,26 @@ BOOL X11DRV_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, return *state_cmd || *config_cmd; } -static BOOL handle_state_change( struct x11drv_win_data *data, unsigned long serial, unsigned long *expect_serial, UINT size, - const void *value, void *desired, void *pending, void *current, const char *expected, - const char *received, const char *reason ) +static BOOL handle_state_change( unsigned long serial, unsigned long *expect_serial, UINT size, const void *value, + void *desired, void *pending, void *current, const char *expected, + const char *prefix, const char *received, const char *reason ) { if (serial < *expect_serial) reason = "old "; else if (!*expect_serial && !memcmp( current, value, size )) reason = "no-op "; if (reason) { - WARN( "Ignoring window %p/%lx %s%s%s\n", data->hwnd, data->whole_window, reason, received, expected ); + WARN( "Ignoring %s%s%s%s\n", prefix, reason, received, expected ); return FALSE; } if (!*expect_serial) reason = "unexpected "; else if (memcmp( pending, value, size )) reason = "mismatch "; - if (!reason) TRACE( "window %p/%lx, %s%s\n", data->hwnd, data->whole_window, received, expected ); + if (!reason) TRACE( "%s%s%s\n", prefix, received, expected ); else { - WARN( "window %p/%lx, %s%s%s\n", data->hwnd, data->whole_window, reason, received, expected ); + WARN( "%s%s%s%s\n", prefix, reason, received, expected ); /* avoid requesting the same state again */ memcpy( desired, value, size ); memcpy( pending, value, size ); @@ -1813,13 +1813,14 @@ void window_wm_state_notify( struct x11drv_win_data *data, unsigned long serial, { UINT *desired = &data->desired_state.wm_state, *pending = &data->pending_state.wm_state, *current = &data->current_state.wm_state; unsigned long *expect_serial = &data->wm_state_serial; - const char *reason = NULL, *expected, *received; + const char *reason = NULL, *expected, *received, *prefix; + prefix = wine_dbg_sprintf( "window %p/%lx ", data->hwnd, data->whole_window ); received = wine_dbg_sprintf( "WM_STATE %#x/%lu", value, serial ); expected = *expect_serial ? wine_dbg_sprintf( ", expected %#x/%lu", *pending, *expect_serial ) : ""; - if (!handle_state_change( data, serial, expect_serial, sizeof(value), &value, - desired, pending, current, expected, received, reason )) + if (!handle_state_change( serial, expect_serial, sizeof(value), &value, desired, pending, + current, expected, prefix, received, reason )) return; /* send any pending changes from the desired state */ @@ -1836,13 +1837,14 @@ void window_net_wm_state_notify( struct x11drv_win_data *data, unsigned long ser { UINT *desired = &data->desired_state.net_wm_state, *pending = &data->pending_state.net_wm_state, *current = &data->current_state.net_wm_state; unsigned long *expect_serial = &data->net_wm_state_serial; - const char *expected, *received; + const char *expected, *received, *prefix; + prefix = wine_dbg_sprintf( "window %p/%lx ", data->hwnd, data->whole_window ); received = wine_dbg_sprintf( "_NET_WM_STATE %#x/%lu", value, serial ); expected = *expect_serial ? wine_dbg_sprintf( ", expected %#x/%lu", *pending, *expect_serial ) : ""; - if (!handle_state_change( data, serial, expect_serial, sizeof(value), &value, - desired, pending, current, expected, received, NULL )) + if (!handle_state_change( serial, expect_serial, sizeof(value), &value, desired, pending, + current, expected, prefix, received, NULL )) return; /* send any pending changes from the desired state */ @@ -1856,26 +1858,28 @@ void window_mwm_hints_notify( struct x11drv_win_data *data, unsigned long serial { MwmHints *desired = &data->desired_state.mwm_hints, *pending = &data->pending_state.mwm_hints, *current = &data->current_state.mwm_hints; unsigned long *expect_serial = &data->mwm_hints_serial; - const char *expected, *received; + const char *expected, *received, *prefix; + prefix = wine_dbg_sprintf( "window %p/%lx ", data->hwnd, data->whole_window ); received = wine_dbg_sprintf( "_MOTIF_WM_HINTS %s/%lu", debugstr_mwm_hints(value), serial ); expected = *expect_serial ? wine_dbg_sprintf( ", expected %s/%lu", debugstr_mwm_hints(pending), *expect_serial ) : ""; - handle_state_change( data, serial, expect_serial, sizeof(*value), value, - desired, pending, current, expected, received, NULL ); + handle_state_change( serial, expect_serial, sizeof(*value), value, desired, pending, + current, expected, prefix, received, NULL ); } void window_configure_notify( struct x11drv_win_data *data, unsigned long serial, const RECT *value ) { RECT *desired = &data->desired_state.rect, *pending = &data->pending_state.rect, *current = &data->current_state.rect; unsigned long *expect_serial = &data->configure_serial; - const char *expected, *received; + const char *expected, *received, *prefix; + prefix = wine_dbg_sprintf( "window %p/%lx ", data->hwnd, data->whole_window ); received = wine_dbg_sprintf( "config %s/%lu", wine_dbgstr_rect(value), serial ); expected = *expect_serial ? wine_dbg_sprintf( ", expected %s/%lu", wine_dbgstr_rect(pending), *expect_serial ) : ""; - handle_state_change( data, serial, expect_serial, sizeof(*value), value, - desired, pending, current, expected, received, NULL ); + handle_state_change( serial, expect_serial, sizeof(*value), value, desired, pending, + current, expected, prefix, received, NULL ); } BOOL window_has_pending_wm_state( HWND hwnd, UINT state ) From bf859d1250f6548de12a5a5d8712fe7308599029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 21 Feb 2025 12:36:23 +0100 Subject: [PATCH 1178/2542] winex11: Ignore transient state changes in other processes. (fixup) --- dlls/winex11.drv/window.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index c76bf25e10ad..6278394bab83 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1158,6 +1158,9 @@ Window init_clip_window(void) */ void update_user_time( struct x11drv_win_data *data, Time time, BOOL force ) { + if (force) NtUserSetProp( data->hwnd, focus_time_prop, (HANDLE)time ); + else if (!time) time = 1; /* time == 0 has reserved semantics */ + if (!force && (time == -1 || time == 0)) time = 1; if (!data->user_time == !time) return; data->user_time = time; @@ -1898,7 +1901,7 @@ BOOL window_has_pending_wm_state( HWND hwnd, UINT state ) BOOL window_should_take_focus( HWND hwnd, Time time ) { Time focus_time = (UINT_PTR)NtUserGetProp( hwnd, focus_time_prop ); - return !focus_time || (int)(focus_time - time) < 0; + return !focus_time || time > focus_time; } /*********************************************************************** From b42353c057572e126ef657ee48f78162ef2c0ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 21 Feb 2025 12:37:12 +0100 Subject: [PATCH 1179/2542] winex11: Set _NET_WM_USER_TIME to 0 to implement SWP_NOACTIVATE. (fixup) --- dlls/winex11.drv/window.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 6278394bab83..623e97a05abf 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1161,14 +1161,12 @@ void update_user_time( struct x11drv_win_data *data, Time time, BOOL force ) if (force) NtUserSetProp( data->hwnd, focus_time_prop, (HANDLE)time ); else if (!time) time = 1; /* time == 0 has reserved semantics */ - if (!force && (time == -1 || time == 0)) time = 1; - if (!data->user_time == !time) return; + if (force ? !data->user_time == !time : data->user_time == time) return; data->user_time = time; TRACE( "window %p/%lx, requesting _NET_WM_USER_TIME %ld serial %lu\n", data->hwnd, data->whole_window, - time, NextRequest( data->display ) ); - - if (time == -1) XDeleteProperty( data->display, data->whole_window, x11drv_atom(_NET_WM_USER_TIME) ); + data->user_time, NextRequest( data->display ) ); + if (force && time) XDeleteProperty( data->display, data->whole_window, x11drv_atom(_NET_WM_USER_TIME) ); else XChangeProperty( data->display, data->whole_window, x11drv_atom(_NET_WM_USER_TIME), XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&time, 1 ); } From a3161477c6b54a32dd7a1abc2ddcdf1914719012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 21 Feb 2025 09:36:18 +0100 Subject: [PATCH 1180/2542] win32u: Drop now unnecessary WM_WINE_DESKTOP_RESIZED internal message. CW-Bug-Id: #24781 --- dlls/win32u/defwnd.c | 3 +-- dlls/winemac.drv/display.c | 1 + dlls/winemac.drv/window.c | 4 ---- dlls/winex11.drv/window.c | 7 ------- include/ntuser.h | 1 - 5 files changed, 2 insertions(+), 14 deletions(-) diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index b48385e42884..4ce055c1f201 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -3123,8 +3123,7 @@ LRESULT desktop_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, update_children_window_state( hwnd ); - return send_message_timeout( HWND_BROADCAST, WM_WINE_DESKTOP_RESIZED, old_rect.left, - old_rect.top, SMTO_ABORTIFHUNG, 2000, FALSE ); + return 0; } default: if (msg >= WM_USER && hwnd == get_desktop_window()) diff --git a/dlls/winemac.drv/display.c b/dlls/winemac.drv/display.c index 5aad67f1809a..712cea38d1b7 100644 --- a/dlls/winemac.drv/display.c +++ b/dlls/winemac.drv/display.c @@ -809,6 +809,7 @@ LONG macdrv_ChangeDisplaySettings(LPDEVMODEW displays, LPCWSTR primary_name, HWN free_display_mode_descriptor(desc); CFRelease(display_modes); macdrv_free_displays(macdrv_displays); + macdrv_reset_device_metrics(); return ret; } diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index 115820ec3763..051266782646 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -1662,10 +1662,6 @@ LRESULT macdrv_WindowMessage(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) release_win_data(data); } return 0; - case WM_WINE_DESKTOP_RESIZED: - macdrv_reset_device_metrics(); - macdrv_reassert_window_position(hwnd); - return 0; case WM_MACDRV_ACTIVATE_ON_FOLLOWING_FOCUS: activate_on_following_focus(); TRACE("WM_MACDRV_ACTIVATE_ON_FOLLOWING_FOCUS time %u\n", activate_on_focus_time); diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 623e97a05abf..0a28b094541f 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -3435,13 +3435,6 @@ LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) release_win_data( data ); } return 0; - case WM_WINE_DESKTOP_RESIZED: - if ((data = get_win_data( hwnd ))) - { - sync_window_position( data, SWP_NOACTIVATE, &data->rects ); - release_win_data( data ); - } - return 0; case WM_X11DRV_DELETE_TAB: taskbar_delete_tab( hwnd ); return 0; diff --git a/include/ntuser.h b/include/ntuser.h index 3ac58cad5766..9bd04a647dd9 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -619,7 +619,6 @@ enum wine_internal_message WM_WINE_FIRST_DRIVER_MSG = 0x80001000, /* range of messages reserved for the USER driver */ WM_WINE_CLIPCURSOR = 0x80001ff0, /* internal driver notification messages */ WM_WINE_SETCURSOR, - WM_WINE_DESKTOP_RESIZED, WM_WINE_LAST_DRIVER_MSG = 0x80001fff }; From 07dc65a59b19c4c74dfd043949c96153058590c3 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Mon, 24 Feb 2025 16:15:20 +0800 Subject: [PATCH 1181/2542] winex11.drv: Allow MWM_FUNC_MAXIMIZE when WS_MAXIMIZE is present. Mutter refuses to maximize a window when MWM_FUNC_MAXIMIZE is not present. However, ShowWindow(SW_MAXIMIZE) on Windows can maximize the window even without WS_MAXIMIZEBOX. Fix Tidy Cauldron (2708320), a Unity game, unable to maximize in some cases. (cherry picked from commit 884bf5fc31b08a3cf0d762d12fc9834acb5b9556) CW-Bug-Id: #24654 --- dlls/winex11.drv/window.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 0a28b094541f..cc7c8cfc6f6e 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -962,6 +962,9 @@ static void set_mwm_hints( struct x11drv_win_data *data, UINT style, UINT ex_sty /* The window can be programmatically minimized even without a minimize box button. Allow the WM to restore it. */ if (style & WS_MINIMIZE) mwm_hints.functions |= MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE; + /* The window can be programmatically maximized even without + a maximize box button. Allow the WM to maximize it. */ + if (style & WS_MAXIMIZE) mwm_hints.functions |= MWM_FUNC_MAXIMIZE; } } From 97c0bda80a35936f034ca6c206fd5447837f31a0 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Mon, 24 Feb 2025 16:15:20 +0800 Subject: [PATCH 1182/2542] HACK: winex11.drv: Make Tidy Cauldron game window resizable on KWin. CW-Bug-Id: #24654 --- dlls/winex11.drv/window.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index cc7c8cfc6f6e..c15c8518aaeb 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -422,6 +422,23 @@ static BOOL is_window_managed( HWND hwnd, UINT swp_flags, BOOL fullscreen ) static inline BOOL is_window_resizable( struct x11drv_win_data *data, DWORD style ) { if (style & WS_THICKFRAME) return TRUE; + /* CW bug 24654: Tidy Cauldron (2708320) doesn't specify WS_THICKFRAME for its game window. And + * KWin refuses to both maximize and restore from maximization if a window is not resizable. + * Please see the isMaximizable() check at kwin-5.27.11/src/x11window.cpp#X11Window::maximize(). + * Removing the resizable check on KWin introduces other bugs. See a previous MR that tried to + * do it at https://invent.kde.org/plasma/kwin/-/merge_requests/3248 */ + if (X11DRV_HasWindowManager( "KWin" )) + { + static const WCHAR UnityWndClassW[] = {'U','n','i','t','y','W','n','d','C','l','a','s','s',0}; + WCHAR class_name[80]; + UNICODE_STRING name = { .Buffer = class_name, .MaximumLength = sizeof(class_name) }; + const char *sgi; + + NtUserGetClassName( data->hwnd, FALSE, &name ); + if ((sgi = getenv( "SteamGameId" )) && !strcmp( sgi, "2708320" ) + && !wcscmp( class_name, UnityWndClassW )) + return TRUE; + } /* Metacity needs the window to be resizable to make it fullscreen */ return data->is_fullscreen; } From 99538d1ca85f77a8789514ceaf9969b3f0d300c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 24 Feb 2025 11:09:55 +0100 Subject: [PATCH 1183/2542] HACK: winex11: Reset focus before mapping a window which will be focused. CW-Bug-Id: #24817 --- dlls/winex11.drv/window.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index c15c8518aaeb..4b41e5eeb9d6 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1578,7 +1578,17 @@ static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state, U /* try forcing activation if the window is supposed to be foreground or if it is fullscreen */ if (data->hwnd == foreground || data->is_fullscreen) swp_flags = 0; if (swp_flags & SWP_NOACTIVATE) update_user_time( data, 0, TRUE ); - else update_user_time( data, -1, TRUE ); + else + { + /* Some older Mutter versions get confused when mapping a window while another has focus + * and if there's another window with _NET_WM_STATE_ABOVE. It then decides that the newly + * mapped window doesn't deserve to be raised or focused, even if the topmost window isn't + * the one with focus and even if it only slightly overlaps it. Reset focus before mapping + * the window to force it to be focused instead. + */ + if (X11DRV_HasWindowManager( "Mutter" )) XSetInputFocus( data->display, None, RevertToNone, CurrentTime ); + update_user_time( data, -1, TRUE ); + } } else if (data->has_focus && data->hwnd != foreground) { From ca4001625d222c680df83f0bd33572788851d5d0 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Thu, 20 Feb 2025 23:55:30 +1000 Subject: [PATCH 1184/2542] ntdll/tests: Test NtQueryVolumeInformationFile() with FileFsFullSizeInformationEx. (cherry picked from commit 37c5fa3db38f2156e1465e2b80334971409d227a) --- dlls/ntdll/tests/file.c | 71 +++++++++++++++++++++++++++++++++++++++++ include/winioctl.h | 17 ++++++++++ 2 files changed, 88 insertions(+) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 74513ea44bc9..0230f68ed028 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -1375,13 +1375,16 @@ static void test_file_io_completion(void) static void test_file_full_size_information(void) { IO_STATUS_BLOCK io; + FILE_FS_FULL_SIZE_INFORMATION_EX ffsie; FILE_FS_FULL_SIZE_INFORMATION ffsi; FILE_FS_SIZE_INFORMATION fsi; + ULONGLONG expected; HANDLE h; NTSTATUS res; if(!(h = create_temp_file(0))) return ; + memset(&ffsie,0,sizeof(ffsie)); memset(&ffsi,0,sizeof(ffsi)); memset(&fsi,0,sizeof(fsi)); @@ -1421,6 +1424,74 @@ static void test_file_full_size_information(void) ok(ffsi.BytesPerSector == 512, "[ffsi] BytesPerSector expected 512, got %ld\n",ffsi.BytesPerSector); ok(ffsi.SectorsPerAllocationUnit == 8, "[ffsi] SectorsPerAllocationUnit expected 8, got %ld\n",ffsi.SectorsPerAllocationUnit); + /* FileFsFullSizeInformationEx is supported on Windows 10 build 1809 and later */ + res = pNtQueryVolumeInformationFile(h, &io, &ffsie, sizeof ffsie, FileFsFullSizeInformationEx); + ok(res == STATUS_INVALID_PARAMETER || res == STATUS_SUCCESS, "cannot get attributes, res %lx\n", res); + + if (res == STATUS_NOT_IMPLEMENTED || res == STATUS_INVALID_PARAMETER) + { + skip( "FileFsFullSizeInformationEx not supported.\n" ); + CloseHandle( h ); + return; + } + + expected = ffsie.ActualAvailableAllocationUnits + ffsie.ActualPoolUnavailableAllocationUnits + + ffsie.UsedAllocationUnits + ffsie.TotalReservedAllocationUnits; + ok(ffsie.ActualTotalAllocationUnits == expected, + "[ffsie] ActualTotalAllocationUnits expected 0x%s, got 0x%s\n", wine_dbgstr_longlong(expected), + wine_dbgstr_longlong(ffsie.ActualTotalAllocationUnits)); + expected = ffsie.ActualTotalAllocationUnits - ffsie.UsedAllocationUnits - ffsie.TotalReservedAllocationUnits; + ok(ffsie.ActualAvailableAllocationUnits == expected, + "[ffsie] ActualAvailableAllocationUnits expected 0x%s, got 0x%s\n", + wine_dbgstr_longlong(expected), wine_dbgstr_longlong(ffsie.ActualAvailableAllocationUnits)); + ok(ffsie.ActualPoolUnavailableAllocationUnits == 0, + "[ffsie] ActualPoolUnavailableAllocationUnits expected zero, got 0x%s\n", + wine_dbgstr_longlong(ffsie.ActualPoolUnavailableAllocationUnits)); + expected = ffsie.CallerAvailableAllocationUnits + ffsie.CallerPoolUnavailableAllocationUnits + + ffsie.UsedAllocationUnits + ffsie.TotalReservedAllocationUnits; + ok(ffsie.CallerTotalAllocationUnits == expected, + "[ffsie] CallerTotalAllocationUnits expected 0x%s, got 0x%s\n", wine_dbgstr_longlong(expected), + wine_dbgstr_longlong(ffsie.CallerTotalAllocationUnits)); + ok((LONGLONG)ffsie.CallerAvailableAllocationUnits > 0, + "[ffsie] CallerAvailableAllocationUnits expected positive, got 0x%s\n", + wine_dbgstr_longlong(ffsie.CallerAvailableAllocationUnits)); + ok(ffsie.CallerPoolUnavailableAllocationUnits == 0, + "[ffsie] CallerPoolUnavailableAllocationUnits expected zero, got 0x%s\n", + wine_dbgstr_longlong(ffsie.CallerPoolUnavailableAllocationUnits)); + ok((LONGLONG)ffsie.UsedAllocationUnits > 0, "[ffsie] UsedAllocationUnits expected positive, got 0x%s\n", + wine_dbgstr_longlong(ffsie.UsedAllocationUnits)); + ok((LONGLONG)ffsie.TotalReservedAllocationUnits >= 0, + "[ffsie] TotalReservedAllocationUnits expected >= 0, got 0x%s\n", + wine_dbgstr_longlong(ffsie.TotalReservedAllocationUnits)); + ok(ffsie.VolumeStorageReserveAllocationUnits <= ffsie.TotalReservedAllocationUnits, + "[ffsie] VolumeStorageReserveAllocationUnits expected <= 0x%s, got 0x%s\n", + wine_dbgstr_longlong(ffsie.TotalReservedAllocationUnits), + wine_dbgstr_longlong(ffsie.VolumeStorageReserveAllocationUnits)); + ok(ffsie.AvailableCommittedAllocationUnits == 0 + /* in win10 can be (0 - UsedAllocationUnits - TotalReservedAllocationUnits) */ + || broken((LONGLONG)ffsie.AvailableCommittedAllocationUnits < 0), + "[ffsie] AvailableCommittedAllocationUnits expected zero, got 0x%s\n", + wine_dbgstr_longlong(ffsie.AvailableCommittedAllocationUnits)); + ok(ffsie.PoolAvailableAllocationUnits == 0, + "[ffsie] PoolAvailableAllocationUnits expected zero, got 0x%s\n", + wine_dbgstr_longlong(ffsie.PoolAvailableAllocationUnits)); + ok(ffsie.ActualTotalAllocationUnits == ffsi.TotalAllocationUnits.QuadPart, + "[ffsie] TotalAllocationUnits error ffsi:0x%s, ffsie:0x%s\n", + wine_dbgstr_longlong(ffsi.TotalAllocationUnits.QuadPart), + wine_dbgstr_longlong(ffsie.ActualTotalAllocationUnits)); + ok(ffsie.CallerAvailableAllocationUnits == ffsi.CallerAvailableAllocationUnits.QuadPart, + "[ffsie] CallerAvailableAllocationUnits error ffsi:0x%s, ffsie:0x%s\n", + wine_dbgstr_longlong(ffsi.CallerAvailableAllocationUnits.QuadPart), + wine_dbgstr_longlong(ffsie.CallerAvailableAllocationUnits)); + ok(ffsie.ActualAvailableAllocationUnits == ffsi.ActualAvailableAllocationUnits.QuadPart, + "[ffsie] ActualAvailableAllocationUnits error ffsi:0x%s, ffsie:0x%s\n", + wine_dbgstr_longlong(ffsi.ActualAvailableAllocationUnits.QuadPart), + wine_dbgstr_longlong(ffsie.ActualAvailableAllocationUnits)); + + /* Assume file system is NTFS */ + ok(ffsie.BytesPerSector == 512, "[ffsie] BytesPerSector expected 512, got %ld\n",ffsie.BytesPerSector); + ok(ffsie.SectorsPerAllocationUnit == 8, "[ffsie] SectorsPerAllocationUnit expected 8, got %ld\n",ffsie.SectorsPerAllocationUnit); + CloseHandle( h ); } diff --git a/include/winioctl.h b/include/winioctl.h index ae04c37a4622..08fb307a321e 100644 --- a/include/winioctl.h +++ b/include/winioctl.h @@ -652,6 +652,23 @@ typedef struct _FILE_FS_FULL_SIZE_INFORMATION { ULONG BytesPerSector; } FILE_FS_FULL_SIZE_INFORMATION, *PFILE_FS_FULL_SIZE_INFORMATION; +/* FileFsFullSizeInformationEx = 14 */ +typedef struct _FILE_FS_FULL_SIZE_INFORMATION_EX { + ULONGLONG ActualTotalAllocationUnits; + ULONGLONG ActualAvailableAllocationUnits; + ULONGLONG ActualPoolUnavailableAllocationUnits; + ULONGLONG CallerTotalAllocationUnits; + ULONGLONG CallerAvailableAllocationUnits; + ULONGLONG CallerPoolUnavailableAllocationUnits; + ULONGLONG UsedAllocationUnits; + ULONGLONG TotalReservedAllocationUnits; + ULONGLONG VolumeStorageReserveAllocationUnits; + ULONGLONG AvailableCommittedAllocationUnits; + ULONGLONG PoolAvailableAllocationUnits; + ULONG SectorsPerAllocationUnit; + ULONG BytesPerSector; +} FILE_FS_FULL_SIZE_INFORMATION_EX, *PFILE_FS_FULL_SIZE_INFORMATION_EX; + typedef struct _FILE_PIPE_WAIT_FOR_BUFFER { LARGE_INTEGER Timeout; ULONG NameLength; From 2ab0cad0964efc8a5ec8dda5edf32ca5709ae8b5 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Fri, 21 Feb 2025 00:00:35 +1000 Subject: [PATCH 1185/2542] kernel32/tests: Test GetDiskSpaceInformationA(). (cherry picked from commit 8b9f56098b80701b65d46867d626dac335b6bef4) --- dlls/kernel32/tests/volume.c | 93 ++++++++++++++++++++++++++++++++++++ include/winbase.h | 17 +++++++ 2 files changed, 110 insertions(+) diff --git a/dlls/kernel32/tests/volume.c b/dlls/kernel32/tests/volume.c index 24a9a2e7124a..0819a50b2c04 100644 --- a/dlls/kernel32/tests/volume.c +++ b/dlls/kernel32/tests/volume.c @@ -60,6 +60,7 @@ static BOOL (WINAPI *pGetVolumePathNamesForVolumeNameA)(LPCSTR, LPSTR, DWORD, LP static BOOL (WINAPI *pGetVolumePathNamesForVolumeNameW)(LPCWSTR, LPWSTR, DWORD, LPDWORD); static BOOL (WINAPI *pCreateSymbolicLinkA)(const char *, const char *, DWORD); static BOOL (WINAPI *pGetVolumeInformationByHandleW)(HANDLE, WCHAR *, DWORD, DWORD *, DWORD *, DWORD *, WCHAR *, DWORD); +static HRESULT (WINAPI *pGetDiskSpaceInformationA)(LPCSTR, DISK_SPACE_INFORMATION *); /* ############################### */ @@ -1736,6 +1737,96 @@ static void test_mountmgr_query_points(void) free(output); } +#define check_disk_space_information(a) check_disk_space_information_(__LINE__, a) +static void check_disk_space_information_(unsigned int line, const DISK_SPACE_INFORMATION *info) +{ + ULONGLONG expected; + + expected = info->ActualAvailableAllocationUnits + info->ActualPoolUnavailableAllocationUnits + + info->UsedAllocationUnits + info->TotalReservedAllocationUnits; + ok_(__FILE__,line)(info->ActualTotalAllocationUnits == expected, + "ActualTotalAllocationUnits expected 0x%s, got 0x%s\n", wine_dbgstr_longlong(expected), + wine_dbgstr_longlong(info->ActualTotalAllocationUnits)); + expected = info->ActualTotalAllocationUnits - info->UsedAllocationUnits - info->TotalReservedAllocationUnits; + ok_(__FILE__,line)(info->ActualAvailableAllocationUnits == expected, + "ActualAvailableAllocationUnits expected 0x%s, got 0x%s\n", + wine_dbgstr_longlong(expected), wine_dbgstr_longlong(info->ActualAvailableAllocationUnits)); + ok_(__FILE__,line)(info->ActualPoolUnavailableAllocationUnits == 0, + "ActualPoolUnavailableAllocationUnits expected zero, got 0x%s\n", + wine_dbgstr_longlong(info->ActualPoolUnavailableAllocationUnits)); + expected = info->CallerAvailableAllocationUnits + info->CallerPoolUnavailableAllocationUnits + + info->UsedAllocationUnits + info->TotalReservedAllocationUnits; + ok_(__FILE__,line)(info->CallerTotalAllocationUnits == expected, + "CallerTotalAllocationUnits expected 0x%s, got 0x%s\n", wine_dbgstr_longlong(expected), + wine_dbgstr_longlong(info->CallerTotalAllocationUnits)); + ok_(__FILE__,line)((LONGLONG)info->CallerAvailableAllocationUnits > 0, + "CallerAvailableAllocationUnits expected positive, got 0x%s\n", + wine_dbgstr_longlong(info->CallerAvailableAllocationUnits)); + ok_(__FILE__,line)(info->CallerPoolUnavailableAllocationUnits == 0, + "CallerPoolUnavailableAllocationUnits expected zero, got 0x%s\n", + wine_dbgstr_longlong(info->CallerPoolUnavailableAllocationUnits)); + ok_(__FILE__,line)((LONGLONG)info->UsedAllocationUnits > 0, "UsedAllocationUnits expected positive, got 0x%s\n", + wine_dbgstr_longlong(info->UsedAllocationUnits)); + ok_(__FILE__,line)((LONGLONG)info->TotalReservedAllocationUnits >= 0, + "TotalReservedAllocationUnits expected >= 0, got 0x%s\n", + wine_dbgstr_longlong(info->TotalReservedAllocationUnits)); + ok_(__FILE__,line)(info->VolumeStorageReserveAllocationUnits <= info->TotalReservedAllocationUnits, + "VolumeStorageReserveAllocationUnits expected <= 0x%s, got 0x%s\n", + wine_dbgstr_longlong(info->TotalReservedAllocationUnits), + wine_dbgstr_longlong(info->VolumeStorageReserveAllocationUnits)); + ok_(__FILE__,line)(info->AvailableCommittedAllocationUnits == 0 + /* in win10 can be (0 - UsedAllocationUnits - TotalReservedAllocationUnits) */ + || broken((LONGLONG)info->AvailableCommittedAllocationUnits < 0), + "AvailableCommittedAllocationUnits expected zero, got 0x%s\n", + wine_dbgstr_longlong(info->AvailableCommittedAllocationUnits)); + ok_(__FILE__,line)(info->PoolAvailableAllocationUnits == 0, + "PoolAvailableAllocationUnits expected zero, got 0x%s\n", + wine_dbgstr_longlong(info->PoolAvailableAllocationUnits)); + + /* Assume file system is NTFS */ + ok_(__FILE__,line)(info->BytesPerSector == 512, "BytesPerSector expected 512, got %ld\n",info->BytesPerSector); + ok_(__FILE__,line)(info->SectorsPerAllocationUnit == 8, "SectorsPerAllocationUnit expected 8, got %ld\n",info->SectorsPerAllocationUnit); +} + +static void test_GetDiskSpaceInformationA(void) +{ + DISK_SPACE_INFORMATION info; + HRESULT hr; + + /* GetDiskSpaceInformation() is supported on Windows 10 build 1809 and later */ + if (!pGetDiskSpaceInformationA) + { + skip("GetDiskSpaceInformationA is not present.\n"); + return; + } + + memset(&info,0,sizeof(info)); + + hr = pGetDiskSpaceInformationA("Q:\\", &info); + todo_wine + ok(hr == HRESULT_FROM_NT(ERROR_BAD_NET_RESP | ERROR_SEVERITY_WARNING | ERROR_SEVERITY_INFORMATIONAL), + "unexpected 0x%08lx\n", hr); + + hr = pGetDiskSpaceInformationA("", &info); + ok(hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), "unexpected 0x%08lx\n", hr); + + hr = pGetDiskSpaceInformationA(NULL, NULL); + ok(hr == HRESULT_FROM_NT(ERROR_INVALID_DATA | ERROR_SEVERITY_WARNING | ERROR_SEVERITY_INFORMATIONAL), + "unexpected 0x%08lx\n", hr); + + hr = pGetDiskSpaceInformationA(NULL, &info); + ok(hr == S_OK, "failed 0x%08lx\n", hr); + check_disk_space_information(&info); + + hr = pGetDiskSpaceInformationA("C:\\", &info); + ok(hr == S_OK, "failed 0x%08lx\n", hr); + check_disk_space_information(&info); + + hr = pGetDiskSpaceInformationA("\\\\?\\C:\\", &info); + ok(hr == S_OK, "failed 0x%08lx\n", hr); + check_disk_space_information(&info); +} + START_TEST(volume) { hdll = GetModuleHandleA("kernel32.dll"); @@ -1748,6 +1839,7 @@ START_TEST(volume) pGetVolumePathNamesForVolumeNameW = (void *) GetProcAddress(hdll, "GetVolumePathNamesForVolumeNameW"); pCreateSymbolicLinkA = (void *) GetProcAddress(hdll, "CreateSymbolicLinkA"); pGetVolumeInformationByHandleW = (void *) GetProcAddress(hdll, "GetVolumeInformationByHandleW"); + pGetDiskSpaceInformationA = (void *) GetProcAddress(hdll, "GetDiskSpaceInformationA"); test_query_dos_deviceA(); test_dos_devices(); @@ -1768,4 +1860,5 @@ START_TEST(volume) test_mounted_folder(); test_GetVolumeInformationByHandle(); test_mountmgr_query_points(); + test_GetDiskSpaceInformationA(); } diff --git a/include/winbase.h b/include/winbase.h index 40142b73b02a..7fabfb63a53e 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -1803,6 +1803,23 @@ typedef enum _PROCESS_INFORMATION_CLASS ProcessInformationClassMax } PROCESS_INFORMATION_CLASS; +typedef struct DISK_SPACE_INFORMATION +{ + ULONGLONG ActualTotalAllocationUnits; + ULONGLONG ActualAvailableAllocationUnits; + ULONGLONG ActualPoolUnavailableAllocationUnits; + ULONGLONG CallerTotalAllocationUnits; + ULONGLONG CallerAvailableAllocationUnits; + ULONGLONG CallerPoolUnavailableAllocationUnits; + ULONGLONG UsedAllocationUnits; + ULONGLONG TotalReservedAllocationUnits; + ULONGLONG VolumeStorageReserveAllocationUnits; + ULONGLONG AvailableCommittedAllocationUnits; + ULONGLONG PoolAvailableAllocationUnits; + DWORD SectorsPerAllocationUnit; + DWORD BytesPerSector; +} DISK_SPACE_INFORMATION; + WINBASEAPI BOOL WINAPI ActivateActCtx(HANDLE,ULONG_PTR *); WINADVAPI BOOL WINAPI AddAccessAllowedAce(PACL,DWORD,DWORD,PSID); WINADVAPI BOOL WINAPI AddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID); From 13219c5435053198777e9b0ff471f6d6ec551006 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Fri, 21 Feb 2025 00:04:35 +1000 Subject: [PATCH 1186/2542] ntdll: Handle FileFsFullSizeInformationEx in NtQueryVolumeInformationFile(). (cherry picked from commit f15bd29ce8d9ff88447213d7692c5d92f36ed85d) --- dlls/ntdll/tests/file.c | 2 +- dlls/ntdll/unix/file.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 0230f68ed028..dbb62578d606 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -1430,7 +1430,7 @@ static void test_file_full_size_information(void) if (res == STATUS_NOT_IMPLEMENTED || res == STATUS_INVALID_PARAMETER) { - skip( "FileFsFullSizeInformationEx not supported.\n" ); + win_skip( "FileFsFullSizeInformationEx not supported.\n" ); CloseHandle( h ); return; } diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 4015451e3b89..b3db4a975dd3 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -2145,6 +2145,31 @@ static NTSTATUS get_full_size_info(int fd, FILE_FS_FULL_SIZE_INFORMATION *info) return STATUS_SUCCESS; } +static NTSTATUS get_full_size_info_ex(int fd, FILE_FS_FULL_SIZE_INFORMATION_EX *info) +{ + FILE_FS_FULL_SIZE_INFORMATION full_info; + NTSTATUS status; + + if ((status = get_full_size_info(fd, &full_info)) != STATUS_SUCCESS) + return status; + + info->ActualTotalAllocationUnits = full_info.TotalAllocationUnits.QuadPart; + info->ActualAvailableAllocationUnits = full_info.ActualAvailableAllocationUnits.QuadPart; + info->ActualPoolUnavailableAllocationUnits = 0; + info->CallerAvailableAllocationUnits = full_info.CallerAvailableAllocationUnits.QuadPart; + info->CallerPoolUnavailableAllocationUnits = 0; + info->UsedAllocationUnits = info->ActualTotalAllocationUnits - info->ActualAvailableAllocationUnits; + info->CallerTotalAllocationUnits = info->CallerAvailableAllocationUnits + info->UsedAllocationUnits; + info->TotalReservedAllocationUnits = 0; + info->VolumeStorageReserveAllocationUnits = 0; + info->AvailableCommittedAllocationUnits = 0; + info->PoolAvailableAllocationUnits = 0; + info->SectorsPerAllocationUnit = full_info.SectorsPerAllocationUnit; + info->BytesPerSector = full_info.BytesPerSector; + + return STATUS_SUCCESS; +} + static NTSTATUS server_get_file_info( HANDLE handle, IO_STATUS_BLOCK *io, void *buffer, ULONG length, FILE_INFORMATION_CLASS info_class ) @@ -7597,6 +7622,17 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, IO_STATUS_BLOCK *io } break; + case FileFsFullSizeInformationEx: + if (length < sizeof(FILE_FS_FULL_SIZE_INFORMATION_EX)) + status = STATUS_BUFFER_TOO_SMALL; + else + { + FILE_FS_FULL_SIZE_INFORMATION_EX *info = buffer; + if ((status = get_full_size_info_ex(fd, info)) == STATUS_SUCCESS) + io->Information = sizeof(*info); + } + break; + case FileFsObjectIdInformation: FIXME( "%p: object id info not supported\n", handle ); status = STATUS_NOT_IMPLEMENTED; From ca48968bb67e9d00300c3eed250c0b9ff8c6d41c Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Fri, 21 Feb 2025 00:07:35 +1000 Subject: [PATCH 1187/2542] kernelbase: Implement GetDiskSpaceInformationA/W(). (cherry picked from commit 844dea5c2d8a66e50bbe8bfb579705c12dd15cfd) CW-Bug-Id: #24797 --- dlls/kernel32/kernel32.spec | 2 ++ dlls/kernel32/tests/volume.c | 2 +- dlls/kernelbase/kernelbase.spec | 2 ++ dlls/kernelbase/volume.c | 37 +++++++++++++++++++++++++++++++++ include/winbase.h | 3 +++ 5 files changed, 45 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index e757cbd9d3d8..e21041ae9eef 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -659,6 +659,8 @@ @ stdcall -import GetDiskFreeSpaceExA (str ptr ptr ptr) @ stdcall -import GetDiskFreeSpaceExW (wstr ptr ptr ptr) @ stdcall -import GetDiskFreeSpaceW(wstr ptr ptr ptr ptr) +@ stdcall -import GetDiskSpaceInformationA(str ptr) +@ stdcall -import GetDiskSpaceInformationW(wstr ptr) @ stdcall GetDllDirectoryA(long ptr) @ stdcall GetDllDirectoryW(long ptr) @ stdcall -import GetDriveTypeA(str) diff --git a/dlls/kernel32/tests/volume.c b/dlls/kernel32/tests/volume.c index 0819a50b2c04..a227c4251d5d 100644 --- a/dlls/kernel32/tests/volume.c +++ b/dlls/kernel32/tests/volume.c @@ -1796,7 +1796,7 @@ static void test_GetDiskSpaceInformationA(void) /* GetDiskSpaceInformation() is supported on Windows 10 build 1809 and later */ if (!pGetDiskSpaceInformationA) { - skip("GetDiskSpaceInformationA is not present.\n"); + win_skip("GetDiskSpaceInformationA is not present.\n"); return; } diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index 2d4d117bb37a..d6b11b49f4c4 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -515,6 +515,8 @@ @ stdcall GetDiskFreeSpaceExA(str ptr ptr ptr) @ stdcall GetDiskFreeSpaceExW(wstr ptr ptr ptr) @ stdcall GetDiskFreeSpaceW(wstr ptr ptr ptr ptr) +@ stdcall GetDiskSpaceInformationA(str ptr) +@ stdcall GetDiskSpaceInformationW(wstr ptr) @ stdcall GetDriveTypeA(str) @ stdcall GetDriveTypeW(wstr) # @ stub GetDurationFormatEx diff --git a/dlls/kernelbase/volume.c b/dlls/kernelbase/volume.c index d48952285256..b7025ce91c1d 100644 --- a/dlls/kernelbase/volume.c +++ b/dlls/kernelbase/volume.c @@ -736,6 +736,43 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetDiskFreeSpaceA( LPCSTR root, LPDWORD cluster_se } +/*********************************************************************** + * GetDiskSpaceInformationW (kernelbase.@) + */ +HRESULT WINAPI GetDiskSpaceInformationW( LPCWSTR root, DISK_SPACE_INFORMATION *info ) +{ + IO_STATUS_BLOCK io; + NTSTATUS status; + HANDLE handle; + + TRACE( "%s,%p\n", debugstr_w(root), info ); + + if (!info) + return HRESULT_FROM_NT( ERROR_INVALID_DATA | ERROR_SEVERITY_WARNING | ERROR_SEVERITY_INFORMATIONAL ); + + if (!open_device_root( root, &handle )) return HRESULT_FROM_WIN32( ERROR_PATH_NOT_FOUND ); + + status = NtQueryVolumeInformationFile( handle, &io, (FILE_FS_FULL_SIZE_INFORMATION_EX *)info, sizeof(*info), + FileFsFullSizeInformationEx ); + NtClose( handle ); + if (!set_ntstatus( status )) return status; + + return S_OK; +} + + +/*********************************************************************** + * GetDiskSpaceInformationA (kernelbase.@) + */ +HRESULT WINAPI GetDiskSpaceInformationA( LPCSTR root, DISK_SPACE_INFORMATION *info ) +{ + WCHAR *rootW = NULL; + + if (root && !(rootW = file_name_AtoW( root, FALSE ))) return FALSE; + return GetDiskSpaceInformationW( rootW, info ); +} + + static BOOL is_dos_path( const UNICODE_STRING *path ) { static const WCHAR global_prefix[4] = {'\\','?','?','\\'}; diff --git a/include/winbase.h b/include/winbase.h index 7fabfb63a53e..172a921c3b20 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -2201,6 +2201,9 @@ WINBASEAPI BOOL WINAPI GetDiskFreeSpaceW(LPCWSTR,LPDWORD,LPDWORD,LPDWORD, WINBASEAPI BOOL WINAPI GetDiskFreeSpaceExA(LPCSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER); WINBASEAPI BOOL WINAPI GetDiskFreeSpaceExW(LPCWSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER); #define GetDiskFreeSpaceEx WINELIB_NAME_AW(GetDiskFreeSpaceEx) +WINBASEAPI HRESULT WINAPI GetDiskSpaceInformationA(LPCSTR,DISK_SPACE_INFORMATION*); +WINBASEAPI HRESULT WINAPI GetDiskSpaceInformationW(LPCWSTR,DISK_SPACE_INFORMATION*); +#define GetDiskSpaceInformation WINELIB_NAME_AW(GetDiskSpaceInformation) WINBASEAPI DWORD WINAPI GetDllDirectoryA(DWORD,LPSTR); WINBASEAPI DWORD WINAPI GetDllDirectoryW(DWORD,LPWSTR); #define GetDllDirectory WINELIB_NAME_AW(GetDllDirectory) From bff0fad4bc58d5dfb23f767c95a9a4255047914c Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Thu, 23 Jan 2025 16:07:53 +1000 Subject: [PATCH 1188/2542] mfplat/tests: Test putting work on an undefined queue id. (cherry picked from commit b6f04d9eed4a03b25fb9bf746e1395c0db3b4e33) --- dlls/mfplat/tests/mfplat.c | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index ac21a7283e83..fd70099a84ce 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -13193,6 +13193,52 @@ static void test_2dbuffer_copy(void) ID3D11Device_Release(device); } +static void test_undefined_queue_id(void) +{ + struct test_callback *callback; + IMFAsyncResult *result; + HRESULT hr; + DWORD res; + + hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + + callback = create_test_callback(&test_async_callback_result_vtbl); + + hr = MFPutWorkItem(MFASYNC_CALLBACK_QUEUE_UNDEFINED, &callback->IMFAsyncCallback_iface, NULL); + todo_wine + ok(hr == S_OK, "got %#lx\n", hr); + res = wait_async_callback_result(&callback->IMFAsyncCallback_iface, 100, &result); + todo_wine + ok(res == 0, "got %#lx\n", res); + if (result) + IMFAsyncResult_Release(result); + + hr = MFPutWorkItem(MFASYNC_CALLBACK_QUEUE_PRIVATE_MASK, &callback->IMFAsyncCallback_iface, NULL); + todo_wine + ok(hr == S_OK, "got %#lx\n", hr); + res = wait_async_callback_result(&callback->IMFAsyncCallback_iface, 100, &result); + todo_wine + ok(res == 0, "got %#lx\n", res); + if (result) + IMFAsyncResult_Release(result); + + hr = MFPutWorkItem(MFASYNC_CALLBACK_QUEUE_PRIVATE_MASK & (MFASYNC_CALLBACK_QUEUE_PRIVATE_MASK - 1), + &callback->IMFAsyncCallback_iface, NULL); + todo_wine + ok(hr == S_OK, "got %#lx\n", hr); + res = wait_async_callback_result(&callback->IMFAsyncCallback_iface, 100, &result); + todo_wine + ok(res == 0, "got %#lx\n", res); + if (result) + IMFAsyncResult_Release(result); + + IMFAsyncCallback_Release(&callback->IMFAsyncCallback_iface); + + hr = MFShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); +} + START_TEST(mfplat) { char **argv; @@ -13287,6 +13333,7 @@ START_TEST(mfplat) test_MFInitMediaTypeFromAMMediaType(); test_MFCreatePathFromURL(); test_2dbuffer_copy(); + test_undefined_queue_id(); CoUninitialize(); } From 28a27296855cd67f1867e0670efd637a25182d28 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Fri, 24 Jan 2025 11:00:51 +1000 Subject: [PATCH 1189/2542] rtworkq/tests: Test putting work on an undefined queue id. (cherry picked from commit c641a9a2daef7240169c8ee7c52a6a7665d61cdf) --- dlls/rtworkq/tests/rtworkq.c | 162 +++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) diff --git a/dlls/rtworkq/tests/rtworkq.c b/dlls/rtworkq/tests/rtworkq.c index 2ff74d57b841..7d3073346216 100644 --- a/dlls/rtworkq/tests/rtworkq.c +++ b/dlls/rtworkq/tests/rtworkq.c @@ -19,12 +19,123 @@ #include #include +#define COBJMACROS + #include "windef.h" #include "winbase.h" +#include "initguid.h" #include "rtworkq.h" #include "wine/test.h" +/* Should be kept in sync with corresponding MFASYNC_CALLBACK_ constants. */ +enum rtwq_callback_queue_id +{ + RTWQ_CALLBACK_QUEUE_UNDEFINED = 0x00000000, + RTWQ_CALLBACK_QUEUE_STANDARD = 0x00000001, + RTWQ_CALLBACK_QUEUE_RT = 0x00000002, + RTWQ_CALLBACK_QUEUE_IO = 0x00000003, + RTWQ_CALLBACK_QUEUE_TIMER = 0x00000004, + RTWQ_CALLBACK_QUEUE_MULTITHREADED = 0x00000005, + RTWQ_CALLBACK_QUEUE_LONG_FUNCTION = 0x00000007, + RTWQ_CALLBACK_QUEUE_PRIVATE_MASK = 0xffff0000, + RTWQ_CALLBACK_QUEUE_ALL = 0xffffffff, +}; + +struct test_callback +{ + IRtwqAsyncCallback IRtwqAsyncCallback_iface; + LONG refcount; + HANDLE event; + IRtwqAsyncResult *result; +}; + +static struct test_callback *impl_from_IRtwqAsyncCallback(IRtwqAsyncCallback *iface) +{ + return CONTAINING_RECORD(iface, struct test_callback, IRtwqAsyncCallback_iface); +} + +static HRESULT WINAPI testcallback_QueryInterface(IRtwqAsyncCallback *iface, REFIID riid, void **obj) +{ + if (IsEqualIID(riid, &IID_IRtwqAsyncCallback) || + IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IRtwqAsyncCallback_AddRef(iface); + return S_OK; + } + + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI testcallback_AddRef(IRtwqAsyncCallback *iface) +{ + struct test_callback *callback = impl_from_IRtwqAsyncCallback(iface); + return InterlockedIncrement(&callback->refcount); +} + +static ULONG WINAPI testcallback_Release(IRtwqAsyncCallback *iface) +{ + struct test_callback *callback = impl_from_IRtwqAsyncCallback(iface); + ULONG refcount = InterlockedDecrement(&callback->refcount); + + if (!refcount) + { + CloseHandle(callback->event); + free(callback); + } + + return refcount; +} + +static HRESULT WINAPI testcallback_GetParameters(IRtwqAsyncCallback *iface, DWORD *flags, DWORD *queue) +{ + ok(flags != NULL && queue != NULL, "Unexpected arguments.\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI testcallback_Invoke(IRtwqAsyncCallback *iface, IRtwqAsyncResult *result) +{ + struct test_callback *callback = impl_from_IRtwqAsyncCallback(iface); + + callback->result = result; + SetEvent(callback->event); + + return S_OK; +} + +static const IRtwqAsyncCallbackVtbl testcallbackvtbl = +{ + testcallback_QueryInterface, + testcallback_AddRef, + testcallback_Release, + testcallback_GetParameters, + testcallback_Invoke, +}; + +static struct test_callback * create_test_callback(void) +{ + struct test_callback *callback = calloc(1, sizeof(*callback)); + + callback->IRtwqAsyncCallback_iface.lpVtbl = &testcallbackvtbl; + callback->refcount = 1; + callback->event = CreateEventA(NULL, FALSE, FALSE, NULL); + + return callback; +} + +static DWORD wait_async_callback_result(IRtwqAsyncCallback *iface, DWORD timeout, IRtwqAsyncResult **result) +{ + struct test_callback *callback = impl_from_IRtwqAsyncCallback(iface); + DWORD res = WaitForSingleObject(callback->event, timeout); + + *result = callback->result; + callback->result = NULL; + + return res; +} + static void test_platform_init(void) { APTTYPEQUALIFIER qualifier; @@ -101,7 +212,58 @@ static void test_platform_init(void) ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); } +static void test_undefined_queue_id(void) +{ + IRtwqAsyncResult *result, *callback_result; + struct test_callback *test_callback; + HRESULT hr; + DWORD res; + + hr = RtwqStartup(); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + + test_callback = create_test_callback(); + + hr = RtwqCreateAsyncResult(NULL, &test_callback->IRtwqAsyncCallback_iface, NULL, &result); + ok(hr == S_OK, "got %#lx\n", hr); + + hr = RtwqPutWorkItem(RTWQ_CALLBACK_QUEUE_UNDEFINED, 0, result); + todo_wine + ok(hr == S_OK, "got %#lx\n", hr); + res = wait_async_callback_result(&test_callback->IRtwqAsyncCallback_iface, 100, &callback_result); + todo_wine + ok(res == 0, "got %#lx\n", res); + todo_wine + ok(callback_result == result, "Expected result %p, got %p.\n", result, callback_result); + + hr = RtwqPutWorkItem(RTWQ_CALLBACK_QUEUE_PRIVATE_MASK, 0, result); + todo_wine + ok(hr == S_OK, "got %#lx\n", hr); + res = wait_async_callback_result(&test_callback->IRtwqAsyncCallback_iface, 100, &callback_result); + todo_wine + ok(res == 0, "got %#lx\n", res); + todo_wine + ok(callback_result == result, "Expected result %p, got %p.\n", result, callback_result); + + hr = RtwqPutWorkItem(RTWQ_CALLBACK_QUEUE_PRIVATE_MASK & (RTWQ_CALLBACK_QUEUE_PRIVATE_MASK - 1), 0, result); + todo_wine + ok(hr == S_OK, "got %#lx\n", hr); + res = wait_async_callback_result(&test_callback->IRtwqAsyncCallback_iface, 100, &callback_result); + todo_wine + ok(res == 0, "got %#lx\n", res); + todo_wine + ok(callback_result == result, "Expected result %p, got %p.\n", result, callback_result); + + IRtwqAsyncResult_Release(result); + + IRtwqAsyncCallback_Release(&test_callback->IRtwqAsyncCallback_iface); + + hr = RtwqShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); +} + START_TEST(rtworkq) { test_platform_init(); + test_undefined_queue_id(); } From 8e26f13808dac3ec7b4ad1474fa24f8ba82b197e Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Tue, 18 Feb 2025 14:02:50 +1000 Subject: [PATCH 1190/2542] rtworkq: Support putting work on RTWQ_CALLBACK_QUEUE_UNDEFINED. (cherry picked from commit 1b1840238e1cc510d0f01398abd26c25969c9f70) --- dlls/mfplat/tests/mfplat.c | 5 +---- dlls/rtworkq/queue.c | 4 ++++ dlls/rtworkq/tests/rtworkq.c | 3 --- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index fd70099a84ce..322d19d68f63 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -13206,13 +13206,10 @@ static void test_undefined_queue_id(void) callback = create_test_callback(&test_async_callback_result_vtbl); hr = MFPutWorkItem(MFASYNC_CALLBACK_QUEUE_UNDEFINED, &callback->IMFAsyncCallback_iface, NULL); - todo_wine ok(hr == S_OK, "got %#lx\n", hr); res = wait_async_callback_result(&callback->IMFAsyncCallback_iface, 100, &result); - todo_wine ok(res == 0, "got %#lx\n", res); - if (result) - IMFAsyncResult_Release(result); + IMFAsyncResult_Release(result); hr = MFPutWorkItem(MFASYNC_CALLBACK_QUEUE_PRIVATE_MASK, &callback->IMFAsyncCallback_iface, NULL); todo_wine diff --git a/dlls/rtworkq/queue.c b/dlls/rtworkq/queue.c index 9046a70b3591..8b9bb6312022 100644 --- a/dlls/rtworkq/queue.c +++ b/dlls/rtworkq/queue.c @@ -298,6 +298,10 @@ static struct queue *get_system_queue(DWORD queue_id) { switch (queue_id) { + case RTWQ_CALLBACK_QUEUE_UNDEFINED: + /* Works in native Windows. Undocumented, but seems to use standard. */ + queue_id = RTWQ_CALLBACK_QUEUE_STANDARD; + /* fall through */ case RTWQ_CALLBACK_QUEUE_STANDARD: case RTWQ_CALLBACK_QUEUE_RT: case RTWQ_CALLBACK_QUEUE_IO: diff --git a/dlls/rtworkq/tests/rtworkq.c b/dlls/rtworkq/tests/rtworkq.c index 7d3073346216..57e00b8afcd4 100644 --- a/dlls/rtworkq/tests/rtworkq.c +++ b/dlls/rtworkq/tests/rtworkq.c @@ -228,12 +228,9 @@ static void test_undefined_queue_id(void) ok(hr == S_OK, "got %#lx\n", hr); hr = RtwqPutWorkItem(RTWQ_CALLBACK_QUEUE_UNDEFINED, 0, result); - todo_wine ok(hr == S_OK, "got %#lx\n", hr); res = wait_async_callback_result(&test_callback->IRtwqAsyncCallback_iface, 100, &callback_result); - todo_wine ok(res == 0, "got %#lx\n", res); - todo_wine ok(callback_result == result, "Expected result %p, got %p.\n", result, callback_result); hr = RtwqPutWorkItem(RTWQ_CALLBACK_QUEUE_PRIVATE_MASK, 0, result); From 9aa139f88798873bd433c0971619d5f5b6a23844 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Tue, 18 Feb 2025 14:05:59 +1000 Subject: [PATCH 1191/2542] rtworkq: Support putting work on any id in RTWQ_CALLBACK_QUEUE_PRIVATE_MASK. (cherry picked from commit b7fa3068ba31cbbf7452f3afdb28abad33f3c08e) --- dlls/mfplat/tests/mfplat.c | 10 ++-------- dlls/rtworkq/queue.c | 6 ++++-- dlls/rtworkq/tests/rtworkq.c | 6 ------ 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 322d19d68f63..faf91b76c59d 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -13212,23 +13212,17 @@ static void test_undefined_queue_id(void) IMFAsyncResult_Release(result); hr = MFPutWorkItem(MFASYNC_CALLBACK_QUEUE_PRIVATE_MASK, &callback->IMFAsyncCallback_iface, NULL); - todo_wine ok(hr == S_OK, "got %#lx\n", hr); res = wait_async_callback_result(&callback->IMFAsyncCallback_iface, 100, &result); - todo_wine ok(res == 0, "got %#lx\n", res); - if (result) - IMFAsyncResult_Release(result); + IMFAsyncResult_Release(result); hr = MFPutWorkItem(MFASYNC_CALLBACK_QUEUE_PRIVATE_MASK & (MFASYNC_CALLBACK_QUEUE_PRIVATE_MASK - 1), &callback->IMFAsyncCallback_iface, NULL); - todo_wine ok(hr == S_OK, "got %#lx\n", hr); res = wait_async_callback_result(&callback->IMFAsyncCallback_iface, 100, &result); - todo_wine ok(res == 0, "got %#lx\n", res); - if (result) - IMFAsyncResult_Release(result); + IMFAsyncResult_Release(result); IMFAsyncCallback_Release(&callback->IMFAsyncCallback_iface); diff --git a/dlls/rtworkq/queue.c b/dlls/rtworkq/queue.c index 8b9bb6312022..29ea3c884f27 100644 --- a/dlls/rtworkq/queue.c +++ b/dlls/rtworkq/queue.c @@ -298,6 +298,10 @@ static struct queue *get_system_queue(DWORD queue_id) { switch (queue_id) { + default: + if (!(RTWQ_CALLBACK_QUEUE_PRIVATE_MASK & queue_id)) + return NULL; + /* fall through */ case RTWQ_CALLBACK_QUEUE_UNDEFINED: /* Works in native Windows. Undocumented, but seems to use standard. */ queue_id = RTWQ_CALLBACK_QUEUE_STANDARD; @@ -309,8 +313,6 @@ static struct queue *get_system_queue(DWORD queue_id) case RTWQ_CALLBACK_QUEUE_MULTITHREADED: case RTWQ_CALLBACK_QUEUE_LONG_FUNCTION: return &system_queues[queue_id - 1]; - default: - return NULL; } } diff --git a/dlls/rtworkq/tests/rtworkq.c b/dlls/rtworkq/tests/rtworkq.c index 57e00b8afcd4..d075989ad2b9 100644 --- a/dlls/rtworkq/tests/rtworkq.c +++ b/dlls/rtworkq/tests/rtworkq.c @@ -234,21 +234,15 @@ static void test_undefined_queue_id(void) ok(callback_result == result, "Expected result %p, got %p.\n", result, callback_result); hr = RtwqPutWorkItem(RTWQ_CALLBACK_QUEUE_PRIVATE_MASK, 0, result); - todo_wine ok(hr == S_OK, "got %#lx\n", hr); res = wait_async_callback_result(&test_callback->IRtwqAsyncCallback_iface, 100, &callback_result); - todo_wine ok(res == 0, "got %#lx\n", res); - todo_wine ok(callback_result == result, "Expected result %p, got %p.\n", result, callback_result); hr = RtwqPutWorkItem(RTWQ_CALLBACK_QUEUE_PRIVATE_MASK & (RTWQ_CALLBACK_QUEUE_PRIVATE_MASK - 1), 0, result); - todo_wine ok(hr == S_OK, "got %#lx\n", hr); res = wait_async_callback_result(&test_callback->IRtwqAsyncCallback_iface, 100, &callback_result); - todo_wine ok(res == 0, "got %#lx\n", res); - todo_wine ok(callback_result == result, "Expected result %p, got %p.\n", result, callback_result); IRtwqAsyncResult_Release(result); From 4013aca8624fc544120451103834da1a3ca33945 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Thu, 30 Jan 2025 15:26:04 +1000 Subject: [PATCH 1192/2542] mfplat/tests: Introduce a helper to check the platform lock count. (cherry picked from commit ece6eb3e5780aa4fc11ddd187beb06a4effd5b47) --- dlls/mfplat/tests/mfplat.c | 53 ++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index faf91b76c59d..b9a9cfe3192b 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -219,6 +219,39 @@ static void check_attributes_(const char *file, int line, IMFAttributes *attribu } } +#define check_platform_lock_count(a) check_platform_lock_count_(__LINE__, a) +static void check_platform_lock_count_(unsigned int line, unsigned int expected) +{ + int i, count = 0; + BOOL unexpected; + DWORD queue; + HRESULT hr; + + for (;;) + { + if (FAILED(hr = MFAllocateWorkQueue(&queue))) + { + unexpected = hr != MF_E_SHUTDOWN; + break; + } + MFUnlockWorkQueue(queue); + + hr = MFUnlockPlatform(); + if ((unexpected = FAILED(hr))) + break; + + ++count; + } + + for (i = 0; i < count; ++i) + MFLockPlatform(); + + if (unexpected) + count = -1; + + ok_(__FILE__, line)(count == expected, "Unexpected lock count %d.\n", count); +} + struct d3d9_surface_readback { IDirect3DSurface9 *surface, *readback_surface; @@ -3834,10 +3867,7 @@ static void test_startup(void) hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); - hr = MFAllocateWorkQueue(&queue); - ok(hr == S_OK, "Failed to allocate a queue, hr %#lx.\n", hr); - hr = MFUnlockWorkQueue(queue); - ok(hr == S_OK, "Failed to unlock the queue, hr %#lx.\n", hr); + check_platform_lock_count(1); hr = MFShutdown(); ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); @@ -3852,10 +3882,7 @@ static void test_startup(void) hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); - hr = MFAllocateWorkQueue(&queue); - ok(hr == S_OK, "Failed to allocate a queue, hr %#lx.\n", hr); - hr = MFUnlockWorkQueue(queue); - ok(hr == S_OK, "Failed to unlock the queue, hr %#lx.\n", hr); + check_platform_lock_count(1); hr = MFShutdown(); ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); @@ -3864,10 +3891,7 @@ static void test_startup(void) hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); - hr = MFAllocateWorkQueue(&queue); - ok(hr == S_OK, "Failed to allocate a queue, hr %#lx.\n", hr); - hr = MFUnlockWorkQueue(queue); - ok(hr == S_OK, "Failed to unlock the queue, hr %#lx.\n", hr); + check_platform_lock_count(1); /* Unlocking implies shutdown. */ hr = MFUnlockPlatform(); @@ -3879,10 +3903,7 @@ static void test_startup(void) hr = MFLockPlatform(); ok(hr == S_OK, "Failed to lock, %#lx.\n", hr); - hr = MFAllocateWorkQueue(&queue); - ok(hr == S_OK, "Failed to allocate a queue, hr %#lx.\n", hr); - hr = MFUnlockWorkQueue(queue); - ok(hr == S_OK, "Failed to unlock the queue, hr %#lx.\n", hr); + check_platform_lock_count(1); hr = MFShutdown(); ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); From 89232395e76623ada14c0ae2b0c9519ce117c91a Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Thu, 30 Jan 2025 15:36:33 +1000 Subject: [PATCH 1193/2542] mfplat/tests: Test mixing of MF platform functions with their Rtwq equivalents. (cherry picked from commit e26fdf4f9151bde42500c2d3615aaa622476c05d) --- dlls/mfplat/tests/mfplat.c | 76 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index b9a9cfe3192b..a50942c3534c 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -42,6 +42,7 @@ #include "evr.h" #include "mfmediaengine.h" #include "codecapi.h" +#include "rtworkq.h" #include "wine/test.h" @@ -542,6 +543,11 @@ static HRESULT (WINAPI *pMFLockDXGIDeviceManager)(UINT *token, IMFDXGIDeviceMana static HRESULT (WINAPI *pMFUnlockDXGIDeviceManager)(void); static HRESULT (WINAPI *pMFInitVideoFormat_RGB)(MFVIDEOFORMAT *format, DWORD width, DWORD height, DWORD d3dformat); +static HRESULT (WINAPI *pRtwqStartup)(void); +static HRESULT (WINAPI *pRtwqShutdown)(void); +static HRESULT (WINAPI *pRtwqLockPlatform)(void); +static HRESULT (WINAPI *pRtwqUnlockPlatform)(void); + static HWND create_window(void) { RECT r = {0, 0, 640, 480}; @@ -1752,6 +1758,14 @@ static void init_functions(void) mod = GetModuleHandleA("ole32.dll"); X(CoGetApartmentType); + + if ((mod = LoadLibraryA("rtworkq.dll"))) + { + X(RtwqStartup); + X(RtwqShutdown); + X(RtwqUnlockPlatform); + X(RtwqLockPlatform); + } #undef X is_win8_plus = pMFPutWaitingWorkItem != NULL; @@ -3858,6 +3872,8 @@ static void test_MFCreateAsyncResult(void) static void test_startup(void) { + struct test_callback *callback; + IMFAsyncResult *result; DWORD queue; HRESULT hr; @@ -3907,6 +3923,66 @@ static void test_startup(void) hr = MFShutdown(); ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + + if (!pRtwqStartup) + { + win_skip("RtwqStartup() not found.\n"); + return; + } + + /* Rtwq equivalence */ + + hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + + hr = pRtwqStartup(); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + hr = pRtwqShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + check_platform_lock_count(1); + + /* Matching MFStartup() with RtwqShutdown() causes shutdown. */ + hr = pRtwqShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + + hr = MFAllocateWorkQueue(&queue); + ok(hr == MF_E_SHUTDOWN, "Failed to allocate a queue, hr %#lx.\n", hr); + + hr = MFShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + + /* RtwqStartup() enables MF functions */ + hr = pRtwqStartup(); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + + check_platform_lock_count(1); + + callback = create_test_callback(NULL); + + /* MF platform lock is the Rtwq lock */ + hr = pRtwqUnlockPlatform(); + ok(hr == S_OK, "Failed to unlock platform, hr %#lx.\n", hr); + + hr = MFAllocateWorkQueue(&queue); + ok(hr == MF_E_SHUTDOWN, "Failed to allocate a queue, hr %#lx.\n", hr); + + hr = MFCreateAsyncResult(NULL, &callback->IMFAsyncCallback_iface, NULL, &result); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + check_platform_lock_count(1); + + hr = pRtwqLockPlatform(); + ok(hr == S_OK, "Failed to lock platform, hr %#lx.\n", hr); + check_platform_lock_count(2); + + IMFAsyncResult_Release(result); + + hr = pRtwqShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + + hr = MFAllocateWorkQueue(&queue); + ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); + + IMFAsyncCallback_Release(&callback->IMFAsyncCallback_iface); } static void test_allocate_queue(void) From c6070b0fee7ca4b88d4faa5dfdf7cc8166c5bb89 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Thu, 30 Jan 2025 15:43:37 +1000 Subject: [PATCH 1194/2542] mfplat/tests: Test platform startup and lock counts. (cherry picked from commit 521fd2d623aff61ce2f839048cb5e760737ab201) --- dlls/mfplat/tests/mfplat.c | 194 +++++++++++++++++++++++++++++++++++++ 1 file changed, 194 insertions(+) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index a50942c3534c..5f8f8989e852 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -3985,6 +3985,199 @@ static void test_startup(void) IMFAsyncCallback_Release(&callback->IMFAsyncCallback_iface); } +void test_startup_counts(void) +{ + IMFAsyncResult *result, *result2, *callback_result; + struct test_callback *callback; + MFWORKITEM_KEY key, key2; + DWORD res, queue; + LONG refcount; + HRESULT hr; + + hr = MFLockPlatform(); + ok(hr == S_OK, "Failed to lock, %#lx.\n", hr); + hr = MFAllocateWorkQueue(&queue); + todo_wine + ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); + hr = MFUnlockPlatform(); + ok(hr == S_OK, "Failed to unlock, %#lx.\n", hr); + + callback = create_test_callback(&test_async_callback_result_vtbl); + + /* Create async results without startup. */ + hr = MFCreateAsyncResult(NULL, &callback->IMFAsyncCallback_iface, NULL, &result); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + hr = MFCreateAsyncResult(NULL, &callback->IMFAsyncCallback_iface, NULL, &result2); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + IMFAsyncResult_Release(result); + IMFAsyncResult_Release(result2); + + hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + /* Before startup the platform lock count does not track the maximum AsyncResult count. */ + check_platform_lock_count(1); + + hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + /* Startup only locks once. */ + todo_wine + check_platform_lock_count(1); + hr = MFShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + + hr = MFCreateAsyncResult(NULL, &callback->IMFAsyncCallback_iface, NULL, &result); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + /* Platform locked by the AsyncResult object. */ + check_platform_lock_count(2); + + hr = MFCreateAsyncResult(NULL, &callback->IMFAsyncCallback_iface, NULL, &result2); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + check_platform_lock_count(3); + + IMFAsyncResult_Release(result); + IMFAsyncResult_Release(result2); + /* Platform lock count for AsyncResult objects does not decrease + * unless the platform is in shutdown state. */ + todo_wine + check_platform_lock_count(3); + + hr = MFCreateAsyncResult(NULL, &callback->IMFAsyncCallback_iface, NULL, &result); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + /* Platform lock count tracks the maximum AsyncResult count plus one for startup. */ + todo_wine + check_platform_lock_count(3); + IMFAsyncResult_Release(result); + + hr = MFPutWorkItem(MFASYNC_CALLBACK_QUEUE_STANDARD, &callback->IMFAsyncCallback_iface, NULL); + ok(hr == S_OK, "got %#lx\n", hr); + res = wait_async_callback_result(&callback->IMFAsyncCallback_iface, 100, &callback_result); + ok(res == 0, "got %#lx\n", res); + refcount = IMFAsyncResult_Release(callback_result); + /* Release of an internal lock occurs in a worker thread. */ + flaky_wine + ok(!refcount, "Unexpected refcount %ld.\n", refcount); + todo_wine + check_platform_lock_count(3); + + hr = MFLockPlatform(); + ok(hr == S_OK, "Failed to lock, %#lx.\n", hr); + hr = MFLockPlatform(); + ok(hr == S_OK, "Failed to lock, %#lx.\n", hr); + todo_wine + check_platform_lock_count(5); + + hr = MFShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + + /* Platform is in shutdown state if either the lock count or the startup count is <= 0. */ + hr = MFAllocateWorkQueue(&queue); + todo_wine + ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); + + /* Platform can be unlocked after shutdown. */ + hr = MFUnlockPlatform(); + ok(hr == S_OK, "Failed to unlock, %#lx.\n", hr); + + hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + + /* Platform locks for AsyncResult objects were released on shutdown, but the explicit lock was not. */ + check_platform_lock_count(2); + hr = MFUnlockPlatform(); + ok(hr == S_OK, "Failed to unlock, %#lx.\n", hr); + check_platform_lock_count(1); + + hr = MFUnlockPlatform(); + ok(hr == S_OK, "Failed to unlock, %#lx.\n", hr); + /* Zero lock count. */ + hr = MFAllocateWorkQueue(&queue); + ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); + hr = MFUnlockPlatform(); + ok(hr == S_OK, "Failed to unlock, %#lx.\n", hr); + /* Negative lock count. */ + hr = MFAllocateWorkQueue(&queue); + ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); + hr = MFLockPlatform(); + ok(hr == S_OK, "Failed to lock, %#lx.\n", hr); + hr = MFLockPlatform(); + ok(hr == S_OK, "Failed to lock, %#lx.\n", hr); + check_platform_lock_count(1); + + hr = MFCreateAsyncResult(NULL, &callback->IMFAsyncCallback_iface, NULL, &result); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + check_platform_lock_count(2); + + hr = MFShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + + /* Release an AsyncResult object after shutdown. Lock count tracks the AsyncResult count. + * It's not possible to show if unlock occurs immedately or on the next startup. */ + IMFAsyncResult_Release(result); + hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + check_platform_lock_count(1); + + hr = MFCreateAsyncResult(NULL, &callback->IMFAsyncCallback_iface, NULL, &result); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + hr = MFShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + check_platform_lock_count(2); + /* Release an AsyncResult object after shutdown and startup */ + IMFAsyncResult_Release(result); + todo_wine + check_platform_lock_count(2); + + hr = MFScheduleWorkItem(&callback->IMFAsyncCallback_iface, NULL, -5000, &key); + ok(hr == S_OK, "Failed to schedule item, hr %#lx.\n", hr); + /* The AsyncResult created for the item locks the platform */ + check_platform_lock_count(2); + + hr = MFScheduleWorkItem(&callback->IMFAsyncCallback_iface, NULL, -5000, &key2); + ok(hr == S_OK, "Failed to schedule item, hr %#lx.\n", hr); + check_platform_lock_count(3); + + /* Platform locks for scheduled items are not released */ + hr = MFCancelWorkItem(key); + ok(hr == S_OK, "Failed to cancel item, hr %#lx.\n", hr); + hr = MFCancelWorkItem(key2); + ok(hr == S_OK, "Failed to cancel item, hr %#lx.\n", hr); + todo_wine + check_platform_lock_count(3); + + hr = MFScheduleWorkItem(&callback->IMFAsyncCallback_iface, NULL, -5000, &key); + ok(hr == S_OK, "Failed to schedule item, hr %#lx.\n", hr); + todo_wine + check_platform_lock_count(3); + + hr = MFShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + + hr = MFAllocateWorkQueue(&queue); + todo_wine + ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); + + hr = MFCancelWorkItem(key); + todo_wine + ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); + + res = wait_async_callback_result(&callback->IMFAsyncCallback_iface, 0, &result); + ok(res == WAIT_TIMEOUT, "got res %#lx\n", res); + + hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + + /* Shutdown while a scheduled item is pending leaks the internal AsyncResult. */ + todo_wine + check_platform_lock_count(2); + + hr = MFShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + + IMFAsyncCallback_Release(&callback->IMFAsyncCallback_iface); +} + static void test_allocate_queue(void) { DWORD queue, queue2; @@ -13350,6 +13543,7 @@ START_TEST(mfplat) CoInitialize(NULL); test_startup(); + test_startup_counts(); test_register(); test_media_type(); test_MFCreateMediaEvent(); From bc2212e03edb0bff2444d37e0d9bc24c88e6e5a1 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Thu, 30 Jan 2025 15:44:45 +1000 Subject: [PATCH 1195/2542] rtworkq/tests: Test work queue. (cherry picked from commit 63318365a9a57fd375fb3c7c0e5ef5c2057822ff) --- dlls/rtworkq/tests/rtworkq.c | 226 +++++++++++++++++++++++++++++++++++ 1 file changed, 226 insertions(+) diff --git a/dlls/rtworkq/tests/rtworkq.c b/dlls/rtworkq/tests/rtworkq.c index d075989ad2b9..2c8d5f3c297b 100644 --- a/dlls/rtworkq/tests/rtworkq.c +++ b/dlls/rtworkq/tests/rtworkq.c @@ -42,6 +42,39 @@ enum rtwq_callback_queue_id RTWQ_CALLBACK_QUEUE_ALL = 0xffffffff, }; +#define check_platform_lock_count(a) check_platform_lock_count_(__LINE__, a) +static void check_platform_lock_count_(unsigned int line, unsigned int expected) +{ + int i, count = 0; + BOOL unexpected; + DWORD queue; + HRESULT hr; + + for (;;) + { + if (FAILED(hr = RtwqAllocateWorkQueue(RTWQ_STANDARD_WORKQUEUE, &queue))) + { + unexpected = hr != RTWQ_E_SHUTDOWN; + break; + } + RtwqUnlockWorkQueue(queue); + + hr = RtwqUnlockPlatform(); + if ((unexpected = FAILED(hr))) + break; + + ++count; + } + + for (i = 0; i < count; ++i) + RtwqLockPlatform(); + + if (unexpected) + count = -1; + + ok_(__FILE__, line)(count == expected, "Unexpected lock count %d.\n", count); +} + struct test_callback { IRtwqAsyncCallback IRtwqAsyncCallback_iface; @@ -253,8 +286,201 @@ static void test_undefined_queue_id(void) ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); } +static void test_work_queue(void) +{ + IRtwqAsyncResult *result, *result2, *callback_result; + struct test_callback *test_callback; + RTWQWORKITEM_KEY key, key2; + DWORD res, queue; + LONG refcount; + HRESULT hr; + + hr = RtwqLockPlatform(); + ok(hr == S_OK, "Failed to lock, %#lx.\n", hr); + hr = RtwqAllocateWorkQueue(RTWQ_STANDARD_WORKQUEUE, &queue); + todo_wine + ok(hr == RTWQ_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); + hr = RtwqUnlockPlatform(); + ok(hr == S_OK, "Failed to unlock, %#lx.\n", hr); + + test_callback = create_test_callback(); + + /* Create async results without startup. */ + hr = RtwqCreateAsyncResult(NULL, &test_callback->IRtwqAsyncCallback_iface, NULL, &result); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + hr = RtwqCreateAsyncResult(NULL, &test_callback->IRtwqAsyncCallback_iface, NULL, &result2); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + IRtwqAsyncResult_Release(result); + IRtwqAsyncResult_Release(result2); + + hr = RtwqStartup(); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + /* Before startup the platform lock count does not track the maximum AsyncResult count. */ + check_platform_lock_count(1); + + hr = RtwqStartup(); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + /* Startup only locks once. */ + todo_wine + check_platform_lock_count(1); + hr = RtwqShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + + hr = RtwqCreateAsyncResult(NULL, &test_callback->IRtwqAsyncCallback_iface, NULL, &result); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + /* Platform locked by the AsyncResult object. */ + check_platform_lock_count(2); + + hr = RtwqCreateAsyncResult(NULL, &test_callback->IRtwqAsyncCallback_iface, NULL, &result2); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + check_platform_lock_count(3); + + IRtwqAsyncResult_Release(result); + IRtwqAsyncResult_Release(result2); + /* Platform lock count for AsyncResult objects does not decrease + * unless the platform is in shutdown state. */ + todo_wine + check_platform_lock_count(3); + + hr = RtwqCreateAsyncResult(NULL, &test_callback->IRtwqAsyncCallback_iface, NULL, &result); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + /* Platform lock count tracks the maximum AsyncResult count plus one for startup. */ + todo_wine + check_platform_lock_count(3); + + hr = RtwqPutWorkItem(RTWQ_CALLBACK_QUEUE_STANDARD, 0, result); + ok(hr == S_OK, "got %#lx\n", hr); + res = wait_async_callback_result(&test_callback->IRtwqAsyncCallback_iface, 100, &callback_result); + ok(res == 0, "got %#lx\n", res); + /* TODO: Wine often has a release call pending in another thread at this point. */ + refcount = IRtwqAsyncResult_Release(result); + flaky_wine + todo_wine + ok(!refcount, "Unexpected refcount %ld.\n", refcount); + todo_wine + check_platform_lock_count(3); + + hr = RtwqLockPlatform(); + ok(hr == S_OK, "Failed to lock, %#lx.\n", hr); + hr = RtwqLockPlatform(); + ok(hr == S_OK, "Failed to lock, %#lx.\n", hr); + todo_wine + check_platform_lock_count(5); + + hr = RtwqShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + + /* Platform is in shutdown state if either the lock count or the startup count is <= 0. */ + hr = RtwqAllocateWorkQueue(RTWQ_STANDARD_WORKQUEUE, &queue); + todo_wine + ok(hr == RTWQ_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); + + /* Platform can be unlocked after shutdown. */ + hr = RtwqUnlockPlatform(); + ok(hr == S_OK, "Failed to unlock, %#lx.\n", hr); + + hr = RtwqStartup(); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + + /* Platform locks for AsyncResult objects were released on shutdown, but the explicit lock was not. */ + check_platform_lock_count(2); + hr = RtwqUnlockPlatform(); + ok(hr == S_OK, "Failed to unlock, %#lx.\n", hr); + check_platform_lock_count(1); + + hr = RtwqUnlockPlatform(); + ok(hr == S_OK, "Failed to unlock, %#lx.\n", hr); + /* Zero lock count. */ + hr = RtwqAllocateWorkQueue(RTWQ_STANDARD_WORKQUEUE, &queue); + ok(hr == RTWQ_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); + hr = RtwqUnlockPlatform(); + ok(hr == S_OK, "Failed to unlock, %#lx.\n", hr); + /* Negative lock count. */ + hr = RtwqAllocateWorkQueue(RTWQ_STANDARD_WORKQUEUE, &queue); + ok(hr == RTWQ_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); + hr = RtwqLockPlatform(); + ok(hr == S_OK, "Failed to lock, %#lx.\n", hr); + hr = RtwqLockPlatform(); + ok(hr == S_OK, "Failed to lock, %#lx.\n", hr); + check_platform_lock_count(1); + + hr = RtwqCreateAsyncResult(NULL, &test_callback->IRtwqAsyncCallback_iface, NULL, &result); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + check_platform_lock_count(2); + + hr = RtwqShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + + /* Release an AsyncResult object after shutdown. Platform lock count tracks the AsyncResult + * count. It's not possible to show if unlock occurs immedately or on the next startup. */ + IRtwqAsyncResult_Release(result); + hr = RtwqStartup(); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + check_platform_lock_count(1); + + hr = RtwqCreateAsyncResult(NULL, &test_callback->IRtwqAsyncCallback_iface, NULL, &result); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + hr = RtwqShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + hr = RtwqStartup(); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + check_platform_lock_count(2); + /* Release an AsyncResult object after shutdown and startup. */ + IRtwqAsyncResult_Release(result); + todo_wine + check_platform_lock_count(2); + + hr = RtwqCreateAsyncResult(NULL, &test_callback->IRtwqAsyncCallback_iface, NULL, &result); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + hr = RtwqScheduleWorkItem(result, -5000, &key); + ok(hr == S_OK, "Failed to schedule item, hr %#lx.\n", hr); + check_platform_lock_count(2); + + hr = RtwqCreateAsyncResult(NULL, &test_callback->IRtwqAsyncCallback_iface, NULL, &result2); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + hr = RtwqScheduleWorkItem(result2, -5000, &key2); + ok(hr == S_OK, "Failed to schedule item, hr %#lx.\n", hr); + check_platform_lock_count(3); + + hr = RtwqCancelWorkItem(key); + ok(hr == S_OK, "Failed to cancel item, hr %#lx.\n", hr); + hr = RtwqCancelWorkItem(key2); + ok(hr == S_OK, "Failed to cancel item, hr %#lx.\n", hr); + IRtwqAsyncResult_Release(result); + IRtwqAsyncResult_Release(result2); + todo_wine + check_platform_lock_count(3); + + hr = RtwqCreateAsyncResult(NULL, &test_callback->IRtwqAsyncCallback_iface, NULL, &result); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + hr = RtwqScheduleWorkItem(result, -5000, &key); + ok(hr == S_OK, "Failed to schedule item, hr %#lx.\n", hr); + todo_wine + check_platform_lock_count(3); + + hr = RtwqShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + /* Shutdown while a scheduled item is pending leaks the AsyncResult. */ + refcount = IRtwqAsyncResult_Release(result); + ok(refcount == 1, "Unexpected refcount %ld.\n", refcount); + IRtwqAsyncResult_Release(result); + + hr = RtwqAllocateWorkQueue(RTWQ_STANDARD_WORKQUEUE, &queue); + ok(hr == RTWQ_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); + + hr = RtwqCancelWorkItem(key); + todo_wine + ok(hr == RTWQ_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); + + res = wait_async_callback_result(&test_callback->IRtwqAsyncCallback_iface, 0, &callback_result); + ok(res == WAIT_TIMEOUT, "got res %#lx\n", res); + + IRtwqAsyncCallback_Release(&test_callback->IRtwqAsyncCallback_iface); +} + START_TEST(rtworkq) { test_platform_init(); test_undefined_queue_id(); + test_work_queue(); } From 5708e2967da8c07a56cb109ed19b165d4d1022b4 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Thu, 30 Jan 2025 16:26:11 +1000 Subject: [PATCH 1196/2542] rtworkq: Introduce a platform startup count. (cherry picked from commit bbd5a832e1b982b09118f81fc42c108df02f8c53) --- dlls/mfplat/tests/mfplat.c | 6 ------ dlls/rtworkq/queue.c | 11 +++++++---- dlls/rtworkq/tests/rtworkq.c | 4 ---- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 5f8f8989e852..1a7bb1ed1dd0 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -3997,7 +3997,6 @@ void test_startup_counts(void) hr = MFLockPlatform(); ok(hr == S_OK, "Failed to lock, %#lx.\n", hr); hr = MFAllocateWorkQueue(&queue); - todo_wine ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); hr = MFUnlockPlatform(); ok(hr == S_OK, "Failed to unlock, %#lx.\n", hr); @@ -4020,7 +4019,6 @@ void test_startup_counts(void) hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); /* Startup only locks once. */ - todo_wine check_platform_lock_count(1); hr = MFShutdown(); ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); @@ -4071,7 +4069,6 @@ void test_startup_counts(void) /* Platform is in shutdown state if either the lock count or the startup count is <= 0. */ hr = MFAllocateWorkQueue(&queue); - todo_wine ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); /* Platform can be unlocked after shutdown. */ @@ -4155,11 +4152,9 @@ void test_startup_counts(void) ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); hr = MFAllocateWorkQueue(&queue); - todo_wine ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); hr = MFCancelWorkItem(key); - todo_wine ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); res = wait_async_callback_result(&callback->IMFAsyncCallback_iface, 0, &result); @@ -4169,7 +4164,6 @@ void test_startup_counts(void) ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); /* Shutdown while a scheduled item is pending leaks the internal AsyncResult. */ - todo_wine check_platform_lock_count(2); hr = MFShutdown(); diff --git a/dlls/rtworkq/queue.c b/dlls/rtworkq/queue.c index 29ea3c884f27..2250f66bbb95 100644 --- a/dlls/rtworkq/queue.c +++ b/dlls/rtworkq/queue.c @@ -66,6 +66,7 @@ static CRITICAL_SECTION_DEBUG queues_critsect_debug = }; static CRITICAL_SECTION queues_section = { &queues_critsect_debug, -1, 0, 0, 0, 0 }; +static LONG startup_count; static LONG platform_lock; static CO_MTA_USAGE_COOKIE mta_cookie; @@ -960,7 +961,7 @@ static HRESULT alloc_user_queue(const struct queue_desc *desc, DWORD *queue_id) *queue_id = RTWQ_CALLBACK_QUEUE_UNDEFINED; - if (platform_lock <= 0) + if (startup_count <= 0 || platform_lock <= 0) return RTWQ_E_SHUTDOWN; if (!(queue = calloc(1, sizeof(*queue)))) @@ -1212,8 +1213,9 @@ static void init_system_queues(void) HRESULT WINAPI RtwqStartup(void) { - if (InterlockedIncrement(&platform_lock) == 1) + if (InterlockedIncrement(&startup_count) == 1) { + RtwqLockPlatform(); init_system_queues(); } @@ -1240,12 +1242,13 @@ static void shutdown_system_queues(void) HRESULT WINAPI RtwqShutdown(void) { - if (platform_lock <= 0) + if (startup_count <= 0) return S_OK; - if (InterlockedExchangeAdd(&platform_lock, -1) == 1) + if (InterlockedExchangeAdd(&startup_count, -1) == 1) { shutdown_system_queues(); + RtwqUnlockPlatform(); } return S_OK; diff --git a/dlls/rtworkq/tests/rtworkq.c b/dlls/rtworkq/tests/rtworkq.c index 2c8d5f3c297b..8d89a5047a40 100644 --- a/dlls/rtworkq/tests/rtworkq.c +++ b/dlls/rtworkq/tests/rtworkq.c @@ -298,7 +298,6 @@ static void test_work_queue(void) hr = RtwqLockPlatform(); ok(hr == S_OK, "Failed to lock, %#lx.\n", hr); hr = RtwqAllocateWorkQueue(RTWQ_STANDARD_WORKQUEUE, &queue); - todo_wine ok(hr == RTWQ_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); hr = RtwqUnlockPlatform(); ok(hr == S_OK, "Failed to unlock, %#lx.\n", hr); @@ -321,7 +320,6 @@ static void test_work_queue(void) hr = RtwqStartup(); ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); /* Startup only locks once. */ - todo_wine check_platform_lock_count(1); hr = RtwqShutdown(); ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); @@ -372,7 +370,6 @@ static void test_work_queue(void) /* Platform is in shutdown state if either the lock count or the startup count is <= 0. */ hr = RtwqAllocateWorkQueue(RTWQ_STANDARD_WORKQUEUE, &queue); - todo_wine ok(hr == RTWQ_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); /* Platform can be unlocked after shutdown. */ @@ -469,7 +466,6 @@ static void test_work_queue(void) ok(hr == RTWQ_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); hr = RtwqCancelWorkItem(key); - todo_wine ok(hr == RTWQ_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr); res = wait_async_callback_result(&test_callback->IRtwqAsyncCallback_iface, 0, &callback_result); From f6553add2a6da093f054c74f22cf18ba6042dbfe Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Thu, 30 Jan 2025 16:34:04 +1000 Subject: [PATCH 1197/2542] rtworkq: Introduce an async result object cache. Caching while the platform is started is consistent with platform lock count behaviour observed in Windows. (cherry picked from commit d2fc980bf3f2e860670cc0828b81ed47b75a996f) --- dlls/mfplat/tests/mfplat.c | 7 --- dlls/rtworkq/queue.c | 88 +++++++++++++++++++++++++++++++++--- dlls/rtworkq/tests/rtworkq.c | 8 ---- 3 files changed, 82 insertions(+), 21 deletions(-) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 1a7bb1ed1dd0..b1aa7e2d2841 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -4036,13 +4036,11 @@ void test_startup_counts(void) IMFAsyncResult_Release(result2); /* Platform lock count for AsyncResult objects does not decrease * unless the platform is in shutdown state. */ - todo_wine check_platform_lock_count(3); hr = MFCreateAsyncResult(NULL, &callback->IMFAsyncCallback_iface, NULL, &result); ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); /* Platform lock count tracks the maximum AsyncResult count plus one for startup. */ - todo_wine check_platform_lock_count(3); IMFAsyncResult_Release(result); @@ -4054,14 +4052,12 @@ void test_startup_counts(void) /* Release of an internal lock occurs in a worker thread. */ flaky_wine ok(!refcount, "Unexpected refcount %ld.\n", refcount); - todo_wine check_platform_lock_count(3); hr = MFLockPlatform(); ok(hr == S_OK, "Failed to lock, %#lx.\n", hr); hr = MFLockPlatform(); ok(hr == S_OK, "Failed to lock, %#lx.\n", hr); - todo_wine check_platform_lock_count(5); hr = MFShutdown(); @@ -4123,7 +4119,6 @@ void test_startup_counts(void) check_platform_lock_count(2); /* Release an AsyncResult object after shutdown and startup */ IMFAsyncResult_Release(result); - todo_wine check_platform_lock_count(2); hr = MFScheduleWorkItem(&callback->IMFAsyncCallback_iface, NULL, -5000, &key); @@ -4140,12 +4135,10 @@ void test_startup_counts(void) ok(hr == S_OK, "Failed to cancel item, hr %#lx.\n", hr); hr = MFCancelWorkItem(key2); ok(hr == S_OK, "Failed to cancel item, hr %#lx.\n", hr); - todo_wine check_platform_lock_count(3); hr = MFScheduleWorkItem(&callback->IMFAsyncCallback_iface, NULL, -5000, &key); ok(hr == S_OK, "Failed to schedule item, hr %#lx.\n", hr); - todo_wine check_platform_lock_count(3); hr = MFShutdown(); diff --git a/dlls/rtworkq/queue.c b/dlls/rtworkq/queue.c index 2250f66bbb95..174cd509e4da 100644 --- a/dlls/rtworkq/queue.c +++ b/dlls/rtworkq/queue.c @@ -66,6 +66,16 @@ static CRITICAL_SECTION_DEBUG queues_critsect_debug = }; static CRITICAL_SECTION queues_section = { &queues_critsect_debug, -1, 0, 0, 0, 0 }; +static CRITICAL_SECTION async_result_cache_section; +static CRITICAL_SECTION_DEBUG async_result_cache_critsect_debug = +{ + 0, 0, &async_result_cache_section, + { &async_result_cache_critsect_debug.ProcessLocksList, &async_result_cache_critsect_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": async_result_cache_section") } +}; +static CRITICAL_SECTION async_result_cache_section = { &async_result_cache_critsect_debug, -1, 0, 0, 0, 0 }; +struct list async_result_cache = LIST_INIT(async_result_cache); + static LONG startup_count; static LONG platform_lock; static CO_MTA_USAGE_COOKIE mta_cookie; @@ -1002,6 +1012,7 @@ struct async_result LONG refcount; IUnknown *object; IUnknown *state; + struct list entry; }; static struct async_result *impl_from_IRtwqAsyncResult(IRtwqAsyncResult *iface) @@ -1009,6 +1020,68 @@ static struct async_result *impl_from_IRtwqAsyncResult(IRtwqAsyncResult *iface) return CONTAINING_RECORD(iface, struct async_result, result.AsyncResult); } +static void free_async_result(struct async_result *result) +{ + free(result); + RtwqUnlockPlatform(); +} + +/* Async result cache. The main reason for caching is to match the behaviour in Windows. + * The platform is locked for each async result created and not unlocked until shutdown. + * This is consistent with caching of async results, which is probably done to avoid + * frequent heap allocations. It's unclear how much is gained from that here, but there + * is probably some benefit. Robustness against use-after-free is not likely to be a + * major reason because Windows seems to pop the most recently released object for the + * next allocation, as is done here, instead of popping from the tail. */ + +static BOOL async_result_cache_push(struct async_result *result) +{ + BOOL pushed; + + EnterCriticalSection(&async_result_cache_section); + if ((pushed = startup_count > 0)) + list_add_head(&async_result_cache, &result->entry); + LeaveCriticalSection(&async_result_cache_section); + + return pushed; +} + +static struct async_result *async_result_cache_pop(void) +{ + struct async_result *result; + struct list *head; + + EnterCriticalSection(&async_result_cache_section); + + if ((head = list_head(&async_result_cache))) + list_remove(head); + + LeaveCriticalSection(&async_result_cache_section); + + if (!head) + return NULL; + + result = LIST_ENTRY(head, struct async_result, entry); + memset(&result->result, 0, sizeof(result->result)); + + return result; +} + +static void async_result_cache_clear(void) +{ + struct async_result *cur, *cur2; + + EnterCriticalSection(&async_result_cache_section); + + LIST_FOR_EACH_ENTRY_SAFE(cur, cur2, &async_result_cache, struct async_result, entry) + { + list_remove(&cur->entry); + free_async_result(cur); + } + + LeaveCriticalSection(&async_result_cache_section); +} + static HRESULT WINAPI async_result_QueryInterface(IRtwqAsyncResult *iface, REFIID riid, void **obj) { TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj); @@ -1053,9 +1126,9 @@ static ULONG WINAPI async_result_Release(IRtwqAsyncResult *iface) IUnknown_Release(result->state); if (result->result.hEvent) CloseHandle(result->result.hEvent); - free(result); - RtwqUnlockPlatform(); + if (!async_result_cache_push(result)) + free_async_result(result); } return refcount; @@ -1139,10 +1212,12 @@ static HRESULT create_async_result(IUnknown *object, IRtwqAsyncCallback *callbac if (!out) return E_INVALIDARG; - if (!(result = calloc(1, sizeof(*result)))) - return E_OUTOFMEMORY; - - RtwqLockPlatform(); + if (!(result = async_result_cache_pop())) + { + if (!(result = calloc(1, sizeof(*result)))) + return E_OUTOFMEMORY; + RtwqLockPlatform(); + } result->result.AsyncResult.lpVtbl = &async_result_vtbl; result->refcount = 1; @@ -1248,6 +1323,7 @@ HRESULT WINAPI RtwqShutdown(void) if (InterlockedExchangeAdd(&startup_count, -1) == 1) { shutdown_system_queues(); + async_result_cache_clear(); RtwqUnlockPlatform(); } diff --git a/dlls/rtworkq/tests/rtworkq.c b/dlls/rtworkq/tests/rtworkq.c index 8d89a5047a40..a91a4d978be8 100644 --- a/dlls/rtworkq/tests/rtworkq.c +++ b/dlls/rtworkq/tests/rtworkq.c @@ -337,13 +337,11 @@ static void test_work_queue(void) IRtwqAsyncResult_Release(result2); /* Platform lock count for AsyncResult objects does not decrease * unless the platform is in shutdown state. */ - todo_wine check_platform_lock_count(3); hr = RtwqCreateAsyncResult(NULL, &test_callback->IRtwqAsyncCallback_iface, NULL, &result); ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); /* Platform lock count tracks the maximum AsyncResult count plus one for startup. */ - todo_wine check_platform_lock_count(3); hr = RtwqPutWorkItem(RTWQ_CALLBACK_QUEUE_STANDARD, 0, result); @@ -353,16 +351,13 @@ static void test_work_queue(void) /* TODO: Wine often has a release call pending in another thread at this point. */ refcount = IRtwqAsyncResult_Release(result); flaky_wine - todo_wine ok(!refcount, "Unexpected refcount %ld.\n", refcount); - todo_wine check_platform_lock_count(3); hr = RtwqLockPlatform(); ok(hr == S_OK, "Failed to lock, %#lx.\n", hr); hr = RtwqLockPlatform(); ok(hr == S_OK, "Failed to lock, %#lx.\n", hr); - todo_wine check_platform_lock_count(5); hr = RtwqShutdown(); @@ -424,7 +419,6 @@ static void test_work_queue(void) check_platform_lock_count(2); /* Release an AsyncResult object after shutdown and startup. */ IRtwqAsyncResult_Release(result); - todo_wine check_platform_lock_count(2); hr = RtwqCreateAsyncResult(NULL, &test_callback->IRtwqAsyncCallback_iface, NULL, &result); @@ -445,14 +439,12 @@ static void test_work_queue(void) ok(hr == S_OK, "Failed to cancel item, hr %#lx.\n", hr); IRtwqAsyncResult_Release(result); IRtwqAsyncResult_Release(result2); - todo_wine check_platform_lock_count(3); hr = RtwqCreateAsyncResult(NULL, &test_callback->IRtwqAsyncCallback_iface, NULL, &result); ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); hr = RtwqScheduleWorkItem(result, -5000, &key); ok(hr == S_OK, "Failed to schedule item, hr %#lx.\n", hr); - todo_wine check_platform_lock_count(3); hr = RtwqShutdown(); From bb560c5f31e59e191d43bccb8de38109a6cc72c5 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Fri, 31 Jan 2025 16:29:58 +1000 Subject: [PATCH 1198/2542] mfplat: Free the inner cookie passed to resolver_create_cancel_object(). (cherry picked from commit fd309f6627f2917ded807c6d999152a8f39f3852) --- dlls/mfplat/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 839f54a9cb45..a5fd332b0dec 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -6675,7 +6675,10 @@ static HRESULT WINAPI source_resolver_BeginCreateObjectFromURL(IMFSourceResolver (IMFAsyncCallback *)&resolver->url_callback, (IUnknown *)result); if (SUCCEEDED(hr) && inner_cookie) + { resolver_create_cancel_object((IUnknown *)handler, OBJECT_FROM_URL, inner_cookie, cancel_cookie); + IUnknown_Release(inner_cookie); + } IRtwqAsyncResult_Release(result); @@ -6721,7 +6724,10 @@ static HRESULT WINAPI source_resolver_BeginCreateObjectFromByteStream(IMFSourceR /* Cancel object wraps underlying handler cancel cookie with context necessary to call CancelObjectCreate(). */ if (SUCCEEDED(hr) && inner_cookie) + { resolver_create_cancel_object((IUnknown *)handler, OBJECT_FROM_BYTESTREAM, inner_cookie, cancel_cookie); + IUnknown_Release(inner_cookie); + } IRtwqAsyncResult_Release(result); From 292089492d08dbe4536ec9031855ac5e314f27de Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Thu, 30 Jan 2025 15:17:18 +1000 Subject: [PATCH 1199/2542] mfplat/tests: Release callback2 in test_event_queue(). (cherry picked from commit 78269fb7109c4c276828eb225a373459bac78b45) --- dlls/mfplat/tests/mfplat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index b1aa7e2d2841..54edc75f82bd 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -4668,6 +4668,7 @@ static void test_event_queue(void) ok(ret == 1 || broken(ret == 2) /* Vista */, "Unexpected refcount %ld, expected 1.\n", ret); IMFAsyncCallback_Release(&callback->IMFAsyncCallback_iface); + IMFAsyncCallback_Release(&callback2->IMFAsyncCallback_iface); hr = MFShutdown(); ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); From 0e0c246589faba1df6f39be55d401d1316a5b4c9 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Fri, 31 Jan 2025 15:30:47 +1000 Subject: [PATCH 1200/2542] mfplat/tests: Check for async result release after canceling work and shutting down. (cherry picked from commit 4728ae13ae6290b0495b311cb0fbd18fb321fb8e) --- dlls/mfplat/tests/mfplat.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 54edc75f82bd..6f85f8d5041b 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -4412,8 +4412,6 @@ static void test_scheduled_items(void) hr = MFCancelWorkItem(key2); ok(hr == S_OK, "Failed to cancel item, hr %#lx.\n", hr); - IMFAsyncResult_Release(result); - hr = MFScheduleWorkItem(&callback->IMFAsyncCallback_iface, NULL, -5000, &key); ok(hr == S_OK, "Failed to schedule item, hr %#lx.\n", hr); @@ -4423,6 +4421,13 @@ static void test_scheduled_items(void) hr = MFShutdown(); ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + Sleep(20); + /* A callback invocation with RTWQ_E_OPERATION_CANCELLED may have been pending + * when MFShutdown() was called. Release depends upon its execution. */ + refcount = IMFAsyncResult_Release(result); + flaky_wine + ok(refcount == 0, "Unexpected refcount %lu.\n", refcount); + IMFAsyncCallback_Release(&callback->IMFAsyncCallback_iface); } From d2d57c2f09166d60b9b8dbcfb3b8f9afaca281aa Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Wed, 19 Feb 2025 12:35:53 +1000 Subject: [PATCH 1201/2542] rtworkq/tests: Test scheduled items. (cherry picked from commit 8bed49cd8aa9dd577825800a88cab65855d9fd9b) --- dlls/rtworkq/tests/rtworkq.c | 59 ++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/dlls/rtworkq/tests/rtworkq.c b/dlls/rtworkq/tests/rtworkq.c index a91a4d978be8..e68bccb780ad 100644 --- a/dlls/rtworkq/tests/rtworkq.c +++ b/dlls/rtworkq/tests/rtworkq.c @@ -466,9 +466,68 @@ static void test_work_queue(void) IRtwqAsyncCallback_Release(&test_callback->IRtwqAsyncCallback_iface); } +static void test_scheduled_items(void) +{ + struct test_callback *test_callback; + RTWQWORKITEM_KEY key, key2; + IRtwqAsyncResult *result; + ULONG refcount; + HRESULT hr; + + test_callback = create_test_callback(); + + hr = RtwqStartup(); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + + hr = RtwqCreateAsyncResult(NULL, &test_callback->IRtwqAsyncCallback_iface, NULL, &result); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + hr = RtwqScheduleWorkItem(result, -5000, &key); + ok(hr == S_OK, "Failed to schedule item, hr %#lx.\n", hr); + IRtwqAsyncResult_Release(result); + + hr = RtwqCancelWorkItem(key); + ok(hr == S_OK, "Failed to cancel item, hr %#lx.\n", hr); + + refcount = IRtwqAsyncCallback_Release(&test_callback->IRtwqAsyncCallback_iface); + ok(refcount == 0, "Unexpected refcount %lu.\n", refcount); + + hr = RtwqCancelWorkItem(key); + ok(hr == RTWQ_E_NOT_FOUND || broken(hr == S_OK) /* < win10 */, "Unexpected hr %#lx.\n", hr); + + test_callback = create_test_callback(); + + hr = RtwqCreateAsyncResult(NULL, &test_callback->IRtwqAsyncCallback_iface, NULL, &result); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + + hr = RtwqPutWaitingWorkItem(NULL, 0, result, &key); + ok(hr == S_OK, "Failed to add waiting item, hr %#lx.\n", hr); + + hr = RtwqPutWaitingWorkItem(NULL, 0, result, &key2); + ok(hr == S_OK, "Failed to add waiting item, hr %#lx.\n", hr); + + hr = RtwqCancelWorkItem(key); + ok(hr == S_OK, "Failed to cancel item, hr %#lx.\n", hr); + + hr = RtwqCancelWorkItem(key2); + ok(hr == S_OK, "Failed to cancel item, hr %#lx.\n", hr); + + hr = RtwqShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + + Sleep(20); + /* One or two callback invocations with RTWQ_E_OPERATION_CANCELLED may have been + * pending when RtwqShutdown() was called. Release depends upon their execution. */ + refcount = IRtwqAsyncResult_Release(result); + flaky_wine + ok(refcount == 0, "Unexpected refcount %lu.\n", refcount); + + IRtwqAsyncCallback_Release(&test_callback->IRtwqAsyncCallback_iface); +} + START_TEST(rtworkq) { test_platform_init(); test_undefined_queue_id(); test_work_queue(); + test_scheduled_items(); } From 62dd0aa4afa9487b1929a162d023995ccdc83271 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Fri, 31 Jan 2025 16:29:15 +1000 Subject: [PATCH 1202/2542] rtworkq/tests: Test queue shutdown with pending items. (cherry picked from commit 01e6016b3d16bb45bd3843e1b0e165758d850cd2) --- dlls/rtworkq/tests/rtworkq.c | 85 ++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/dlls/rtworkq/tests/rtworkq.c b/dlls/rtworkq/tests/rtworkq.c index e68bccb780ad..05c441885866 100644 --- a/dlls/rtworkq/tests/rtworkq.c +++ b/dlls/rtworkq/tests/rtworkq.c @@ -80,6 +80,7 @@ struct test_callback IRtwqAsyncCallback IRtwqAsyncCallback_iface; LONG refcount; HANDLE event; + UINT sleep_ms; IRtwqAsyncResult *result; }; @@ -132,6 +133,9 @@ static HRESULT WINAPI testcallback_Invoke(IRtwqAsyncCallback *iface, IRtwqAsyncR { struct test_callback *callback = impl_from_IRtwqAsyncCallback(iface); + if (callback->sleep_ms) + Sleep(callback->sleep_ms); + callback->result = result; SetEvent(callback->event); @@ -524,10 +528,91 @@ static void test_scheduled_items(void) IRtwqAsyncCallback_Release(&test_callback->IRtwqAsyncCallback_iface); } +static void test_queue_shutdown(void) +{ + IRtwqAsyncResult *result, *result2, *callback_result; + struct test_callback *test_callback, *test_callback2; + DWORD res, queue; + LONG refcount; + HRESULT hr; + + hr = RtwqStartup(); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + + test_callback = create_test_callback(); + test_callback2 = create_test_callback(); + test_callback->sleep_ms = 10; + test_callback2->sleep_ms = 10; + + hr = RtwqCreateAsyncResult(NULL, &test_callback->IRtwqAsyncCallback_iface, NULL, &result); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + hr = RtwqCreateAsyncResult(NULL, &test_callback2->IRtwqAsyncCallback_iface, NULL, &result2); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + hr = RtwqPutWorkItem(RTWQ_CALLBACK_QUEUE_STANDARD, 0, result); + ok(hr == S_OK, "got %#lx\n", hr); + hr = RtwqPutWorkItem(RTWQ_CALLBACK_QUEUE_STANDARD, 0, result2); + ok(hr == S_OK, "got %#lx\n", hr); + + /* At least the second item will be delayed until after shutdown. Execution still occurs after shutdown. */ + hr = RtwqShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + + res = wait_async_callback_result(&test_callback->IRtwqAsyncCallback_iface, 100, &callback_result); + flaky_wine + ok(res == 0, "got %#lx\n", res); + res = wait_async_callback_result(&test_callback2->IRtwqAsyncCallback_iface, 100, &callback_result); + todo_wine + ok(res == 0, "got %#lx\n", res); + + refcount = IRtwqAsyncResult_Release(result); + flaky_wine + ok(!refcount, "Unexpected refcount %ld.\n", refcount); + refcount = IRtwqAsyncResult_Release(result2); + todo_wine + ok(!refcount, "Unexpected refcount %ld.\n", refcount); + + hr = RtwqStartup(); + ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr); + + hr = RtwqAllocateWorkQueue(RTWQ_STANDARD_WORKQUEUE, &queue); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = RtwqCreateAsyncResult(NULL, &test_callback->IRtwqAsyncCallback_iface, NULL, &result); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + hr = RtwqCreateAsyncResult(NULL, &test_callback2->IRtwqAsyncCallback_iface, NULL, &result2); + ok(hr == S_OK, "Failed to create result, hr %#lx.\n", hr); + hr = RtwqPutWorkItem(queue, 0, result); + ok(hr == S_OK, "got %#lx\n", hr); + hr = RtwqPutWorkItem(queue, 0, result2); + ok(hr == S_OK, "got %#lx\n", hr); + + /* Execution still occurs after unlock. */ + RtwqUnlockWorkQueue(queue); + + res = wait_async_callback_result(&test_callback->IRtwqAsyncCallback_iface, 100, &callback_result); + flaky_wine + ok(res == 0, "got %#lx\n", res); + res = wait_async_callback_result(&test_callback2->IRtwqAsyncCallback_iface, 100, &callback_result); + todo_wine + ok(res == 0, "got %#lx\n", res); + + refcount = IRtwqAsyncResult_Release(result); + flaky_wine + ok(!refcount, "Unexpected refcount %ld.\n", refcount); + /* An internal reference to result2 may still be held here even in Windows. */ + IRtwqAsyncResult_Release(result2); + + hr = RtwqShutdown(); + ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); + + IRtwqAsyncCallback_Release(&test_callback->IRtwqAsyncCallback_iface); + IRtwqAsyncCallback_Release(&test_callback2->IRtwqAsyncCallback_iface); +} + START_TEST(rtworkq) { test_platform_init(); test_undefined_queue_id(); test_work_queue(); test_scheduled_items(); + test_queue_shutdown(); } From cdd3ac4f8722ce3ad896874b79693812e176db47 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Tue, 19 Nov 2024 16:50:33 +1000 Subject: [PATCH 1203/2542] rtworkq: Do not cancel pending callbacks when closing a thread pool. (cherry picked from commit 0fb4e21597a120270208f1f2c9c695fd9729cbd9) --- dlls/mfplat/tests/mfplat.c | 1 - dlls/rtworkq/queue.c | 2 +- dlls/rtworkq/tests/rtworkq.c | 8 -------- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 6f85f8d5041b..fe495a961cd2 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -4425,7 +4425,6 @@ static void test_scheduled_items(void) /* A callback invocation with RTWQ_E_OPERATION_CANCELLED may have been pending * when MFShutdown() was called. Release depends upon its execution. */ refcount = IMFAsyncResult_Release(result); - flaky_wine ok(refcount == 0, "Unexpected refcount %lu.\n", refcount); IMFAsyncCallback_Release(&callback->IMFAsyncCallback_iface); diff --git a/dlls/rtworkq/queue.c b/dlls/rtworkq/queue.c index 174cd509e4da..031da94ca43a 100644 --- a/dlls/rtworkq/queue.c +++ b/dlls/rtworkq/queue.c @@ -371,7 +371,7 @@ static BOOL pool_queue_shutdown(struct queue *queue) if (!queue->pool) return FALSE; - CloseThreadpoolCleanupGroupMembers(queue->envs[0].CleanupGroup, TRUE, NULL); + CloseThreadpoolCleanupGroupMembers(queue->envs[0].CleanupGroup, FALSE, NULL); CloseThreadpool(queue->pool); queue->pool = NULL; diff --git a/dlls/rtworkq/tests/rtworkq.c b/dlls/rtworkq/tests/rtworkq.c index 05c441885866..e6930083e8ff 100644 --- a/dlls/rtworkq/tests/rtworkq.c +++ b/dlls/rtworkq/tests/rtworkq.c @@ -522,7 +522,6 @@ static void test_scheduled_items(void) /* One or two callback invocations with RTWQ_E_OPERATION_CANCELLED may have been * pending when RtwqShutdown() was called. Release depends upon their execution. */ refcount = IRtwqAsyncResult_Release(result); - flaky_wine ok(refcount == 0, "Unexpected refcount %lu.\n", refcount); IRtwqAsyncCallback_Release(&test_callback->IRtwqAsyncCallback_iface); @@ -558,17 +557,13 @@ static void test_queue_shutdown(void) ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr); res = wait_async_callback_result(&test_callback->IRtwqAsyncCallback_iface, 100, &callback_result); - flaky_wine ok(res == 0, "got %#lx\n", res); res = wait_async_callback_result(&test_callback2->IRtwqAsyncCallback_iface, 100, &callback_result); - todo_wine ok(res == 0, "got %#lx\n", res); refcount = IRtwqAsyncResult_Release(result); - flaky_wine ok(!refcount, "Unexpected refcount %ld.\n", refcount); refcount = IRtwqAsyncResult_Release(result2); - todo_wine ok(!refcount, "Unexpected refcount %ld.\n", refcount); hr = RtwqStartup(); @@ -589,14 +584,11 @@ static void test_queue_shutdown(void) RtwqUnlockWorkQueue(queue); res = wait_async_callback_result(&test_callback->IRtwqAsyncCallback_iface, 100, &callback_result); - flaky_wine ok(res == 0, "got %#lx\n", res); res = wait_async_callback_result(&test_callback2->IRtwqAsyncCallback_iface, 100, &callback_result); - todo_wine ok(res == 0, "got %#lx\n", res); refcount = IRtwqAsyncResult_Release(result); - flaky_wine ok(!refcount, "Unexpected refcount %ld.\n", refcount); /* An internal reference to result2 may still be held here even in Windows. */ IRtwqAsyncResult_Release(result2); From 63ab2c1db13c591f097c17c4552e110679fbc935 Mon Sep 17 00:00:00 2001 From: Charlotte Pabst Date: Fri, 21 Feb 2025 18:18:12 +0100 Subject: [PATCH 1204/2542] winex11.drv: Weaken filter_event conditions for some events. (cherry picked from commit dec96acdc75dc5b64c75b9edbed147aae140ffed) --- dlls/winex11.drv/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index bcd7df00a8e1..1a85d872b8c1 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -309,7 +309,7 @@ static Bool filter_event( Display *display, XEvent *event, char *arg ) case ConfigureNotify: case PropertyNotify: case ClientMessage: - return (mask & QS_POSTMESSAGE) != 0; + return (mask & (QS_POSTMESSAGE | QS_SENDMESSAGE)) != 0; #ifdef GenericEvent case GenericEvent: #ifdef HAVE_X11_EXTENSIONS_XINPUT2_H From 6b486dad9c16dd7cdfb625ba11201eaaeedbc0aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 11 Feb 2025 11:15:16 +0100 Subject: [PATCH 1205/2542] winex11: Track _NET_ACTIVE_WINDOW property changes. CW-Bug-Id: #24817 CW-Bug-Id: #24919 --- dlls/winex11.drv/event.c | 41 ++++++++++++++++++++++++++++++++++ dlls/winex11.drv/window.c | 23 ++++++++++++++++--- dlls/winex11.drv/x11drv.h | 10 ++++++++- dlls/winex11.drv/x11drv_main.c | 1 + 4 files changed, 71 insertions(+), 4 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 1a85d872b8c1..8dd964cc2b1a 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1286,6 +1286,25 @@ static void get_window_mwm_hints( Display *display, Window window, MwmHints *hin } } +static Window get_net_active_window( Display *display, char **name ) +{ + unsigned long count, remaining; + Window window = None, *value; + int format; + Atom type; + + if (!XGetWindowProperty( display, DefaultRootWindow( display ), x11drv_atom(_NET_ACTIVE_WINDOW), 0, + 65536 / sizeof(Window), False, XA_WINDOW, &type, &format, &count, + &remaining, (unsigned char **)&value )) + { + if (type == XA_WINDOW && format == 32) window = *value; + XFree( value ); + } + + if (window) get_window_name( display, window, name ); + return window; +} + /*********************************************************************** * handle_wm_state_notify * @@ -1367,6 +1386,27 @@ static void handle_net_supporting_wm_check_notify( XPropertyEvent *event ) if (event->state == PropertyNewValue) net_supporting_wm_check_init( data ); } +static void handle_net_active_window( HWND hwnd, XPropertyEvent *event ) +{ + struct x11drv_thread_data *data = x11drv_thread_data(); + Window window = None; + HWND foreground; + + if (data->active_window) + { + XFree( data->active_window ); + data->active_window = NULL; + } + + if (event->state == PropertyNewValue) window = get_net_active_window( event->display, &data->active_window ); + net_active_window_notify( event->serial, window, event->time ); + + if (data->active_window) TRACE( "_NET_ACTIVE_WINDOW changed to %s\n", debugstr_a(data->active_window) ); + + if (!(foreground = NtUserGetForegroundWindow())) foreground = NtUserGetDesktopWindow(); + NtUserPostMessage( foreground, WM_WINE_WINDOW_STATE_CHANGED, 0, 0 ); +} + /*********************************************************************** * X11DRV_PropertyNotify */ @@ -1381,6 +1421,7 @@ static BOOL X11DRV_PropertyNotify( HWND hwnd, XEvent *xev ) if (event->atom == x11drv_atom(_MOTIF_WM_HINTS)) handle_mwm_hints_notify( hwnd, event ); if (event->atom == x11drv_atom(_NET_SUPPORTED)) handle_net_supported_notify( event ); if (event->atom == x11drv_atom(_NET_SUPPORTING_WM_CHECK)) handle_net_supporting_wm_check_notify( event ); + if (event->atom == x11drv_atom(_NET_ACTIVE_WINDOW)) handle_net_active_window( hwnd, event ); return TRUE; } diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 4b41e5eeb9d6..60e58a44e7e9 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1913,6 +1913,19 @@ void window_configure_notify( struct x11drv_win_data *data, unsigned long serial current, expected, prefix, received, NULL ); } +void net_active_window_notify( unsigned long serial, Window value, Time time ) +{ + struct x11drv_thread_data *data = x11drv_thread_data(); + Window *desired = &data->desired_net_active_window, *pending = &data->pending_net_active_window, *current = &data->current_net_active_window; + unsigned long *expect_serial = &data->net_active_window_serial; + const char *expected, *received; + + received = wine_dbg_sprintf( "_NET_ACTIVE_WINDOW %lx serial %lu time %lu", value, serial, time ); + expected = *expect_serial ? wine_dbg_sprintf( ", expected %lx serial %lu", *pending, *expect_serial ) : ""; + handle_state_change( serial, expect_serial, sizeof(value), &value, desired, pending, + current, expected, "", received, NULL ); +} + BOOL window_has_pending_wm_state( HWND hwnd, UINT state ) { struct x11drv_win_data *data; @@ -3652,7 +3665,7 @@ static Window get_net_supporting_wm_check( Display *display, Window window ) } -static BOOL get_window_net_wm_name( Display *display, Window window, char **name ) +BOOL get_window_net_wm_name( Display *display, Window window, char **name ) { unsigned long count, remaining; int format, ret; @@ -3678,6 +3691,11 @@ static BOOL get_window_wm_name( Display *display, Window window, char **name ) return !X11DRV_check_error() && !ret && *name; } +BOOL get_window_name( Display *display, Window window, char **name ) +{ + return get_window_net_wm_name( display, window, name ) || get_window_wm_name( display, window, name ); +} + void net_supporting_wm_check_init( struct x11drv_thread_data *data ) { Window window = None, other; @@ -3687,8 +3705,7 @@ void net_supporting_wm_check_init( struct x11drv_thread_data *data ) X11DRV_expect_error( data->display, host_window_error, NULL ); other = get_net_supporting_wm_check( data->display, window ); if (X11DRV_check_error() || window != other) WARN( "Invalid _NET_SUPPORTING_WM_CHECK window\n" ); - else if (get_window_net_wm_name( data->display, window, &data->window_manager ) || - get_window_wm_name( data->display, window, &data->window_manager )) + else if (get_window_name( data->display, window, &data->window_manager )) { char const *sgi = getenv( "SteamGameId" ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index a94354bbb13f..6de88b81538e 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -403,12 +403,18 @@ struct x11drv_thread_data int net_supported_count; /* number of _NET_SUPPORTED atoms */ UINT net_wm_state_mask; /* mask of supported _NET_WM_STATE *bits */ char *window_manager; /* name of the supporting window manager */ + char *active_window; /* name of the current active window */ #ifdef HAVE_X11_EXTENSIONS_XINPUT2_H XIValuatorClassInfo x_valuator; XIValuatorClassInfo y_valuator; int xinput2_pointer; /* XInput2 master pointer device id */ int xinput2_rawinput; /* XInput2 rawinput-only thread */ #endif /* HAVE_X11_EXTENSIONS_XINPUT2_H */ + + Window desired_net_active_window; /* active window tracking the desired / win32 state */ + Window pending_net_active_window; /* active window tracking the pending / requested state */ + Window current_net_active_window; /* active window tracking the current X11 state */ + unsigned long net_active_window_serial; /* serial of last pending _NET_ACTIVE_WINDOW request */ }; extern struct x11drv_thread_data *x11drv_init_thread_data(void); @@ -495,6 +501,7 @@ enum x11drv_atoms XATOM__ICC_PROFILE, XATOM__KDE_NET_WM_STATE_SKIP_SWITCHER, XATOM__MOTIF_WM_HINTS, + XATOM__NET_ACTIVE_WINDOW, XATOM__NET_STARTUP_INFO_BEGIN, XATOM__NET_STARTUP_INFO, XATOM__NET_SUPPORTED, @@ -691,8 +698,9 @@ extern void window_wm_state_notify( struct x11drv_win_data *data, unsigned long extern void window_net_wm_state_notify( struct x11drv_win_data *data, unsigned long serial, UINT value ); extern void window_mwm_hints_notify( struct x11drv_win_data *data, unsigned long serial, const MwmHints *hints ); extern void window_configure_notify( struct x11drv_win_data *data, unsigned long serial, const RECT *rect ); -extern BOOL get_window_state_updates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, RECT *rect ); +extern BOOL get_window_name( Display *display, Window window, char **name ); +extern void net_active_window_notify( unsigned long serial, Window window, Time time ); extern void net_supported_init( struct x11drv_thread_data *data ); extern void net_supporting_wm_check_init( struct x11drv_thread_data *data ); diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 31ab814a72a8..a551611c3508 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -131,6 +131,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "_ICC_PROFILE", "_KDE_NET_WM_STATE_SKIP_SWITCHER", "_MOTIF_WM_HINTS", + "_NET_ACTIVE_WINDOW", "_NET_STARTUP_INFO_BEGIN", "_NET_STARTUP_INFO", "_NET_SUPPORTED", From d2149f51a57e7b437ee91bab02f6a5a115c160ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 18 Feb 2025 12:31:37 +0100 Subject: [PATCH 1206/2542] winex11: Expose a _WINE_HWND property on toplevel windows. CW-Bug-Id: #24817 CW-Bug-Id: #24919 --- dlls/winex11.drv/window.c | 30 ++++++++++++++++++++++++++++-- dlls/winex11.drv/x11drv.h | 1 + dlls/winex11.drv/x11drv_main.c | 1 + 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 60e58a44e7e9..03e929358043 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -312,6 +312,28 @@ static void remove_startup_notification( struct x11drv_win_data *data ) } } +static HWND hwnd_from_window( Display *display, Window window ) +{ + unsigned long count, remaining; + unsigned long *xhwnd; + HWND hwnd = (HWND)-1; + int format; + Atom type; + + if (!window) return 0; + if (!XFindContext( display, window, winContext, (char **)&hwnd )) return hwnd; + + X11DRV_expect_error( display, host_window_error, NULL ); + if (!XGetWindowProperty( display, window, x11drv_atom(_WINE_HWND), 0, 65536, False, XA_CARDINAL, + &type, &format, &count, &remaining, (unsigned char **)&xhwnd )) + { + if (type == XA_CARDINAL && format == 32) hwnd = ULongToHandle(*xhwnd); + XFree( xhwnd ); + } + if (X11DRV_check_error()) return (HWND)-1; + return hwnd; +} + static BOOL is_managed( HWND hwnd ) { struct x11drv_win_data *data = get_win_data( hwnd ); @@ -1917,11 +1939,12 @@ void net_active_window_notify( unsigned long serial, Window value, Time time ) { struct x11drv_thread_data *data = x11drv_thread_data(); Window *desired = &data->desired_net_active_window, *pending = &data->pending_net_active_window, *current = &data->current_net_active_window; + HWND hwnd = hwnd_from_window( data->display, value ), expect_hwnd = hwnd_from_window( data->display, *pending ); unsigned long *expect_serial = &data->net_active_window_serial; const char *expected, *received; - received = wine_dbg_sprintf( "_NET_ACTIVE_WINDOW %lx serial %lu time %lu", value, serial, time ); - expected = *expect_serial ? wine_dbg_sprintf( ", expected %lx serial %lu", *pending, *expect_serial ) : ""; + received = wine_dbg_sprintf( "_NET_ACTIVE_WINDOW %p/%lx serial %lu time %lu", hwnd, value, serial, time ); + expected = *expect_serial ? wine_dbg_sprintf( ", expected %p/%lx serial %lu", expect_hwnd, *pending, *expect_serial ) : ""; handle_state_change( serial, expect_serial, sizeof(value), &value, desired, pending, current, expected, "", received, NULL ); } @@ -2302,6 +2325,7 @@ void set_gamescope_overlay_prop( Display *display, Window window, HWND hwnd ) */ static void create_whole_window( struct x11drv_win_data *data ) { + unsigned long xhwnd = (UINT_PTR)data->hwnd; int cx, cy, mask; XSetWindowAttributes attr; WCHAR text[1024]; @@ -2336,6 +2360,8 @@ static void create_whole_window( struct x11drv_win_data *data ) cx, cy, 0, data->vis.depth, InputOutput, data->vis.visual, mask, &attr ); if (!data->whole_window) goto done; + XChangeProperty( data->display, data->whole_window, x11drv_atom(_WINE_HWND), XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)&xhwnd, 1 ); set_wine_allow_flip( data->whole_window, 0 ); SetRect( &data->current_state.rect, pos.x, pos.y, pos.x + cx, pos.y + cy ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 6de88b81538e..8b17ba57e9fd 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -533,6 +533,7 @@ enum x11drv_atoms XATOM__NET_WM_WINDOW_TYPE_UTILITY, XATOM__NET_WORKAREA, XATOM__GTK_WORKAREAS_D0, + XATOM__WINE_HWND, XATOM__XEMBED, XATOM__XEMBED_INFO, XATOM__WINE_ALLOW_FLIP, diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index a551611c3508..decdf6317393 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -163,6 +163,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "_NET_WM_WINDOW_TYPE_UTILITY", "_NET_WORKAREA", "_GTK_WORKAREAS_D0", + "_WINE_HWND", "_XEMBED", "_XEMBED_INFO", "_WINE_ALLOW_FLIP", From 4b06102ed7424eaa96a0d9918364ae776ffbc8cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 18 Feb 2025 19:00:12 +0100 Subject: [PATCH 1207/2542] winex11: Refactor X11DRV_GetWindowStateUpdates control flow. CW-Bug-Id: #24817 CW-Bug-Id: #24919 --- dlls/winex11.drv/window.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 03e929358043..2bd3687eb932 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1820,16 +1820,20 @@ BOOL X11DRV_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, { struct x11drv_win_data *data; - if (!(data = get_win_data( hwnd ))) return FALSE; - - *state_cmd = window_update_client_state( data ); - *config_cmd = window_update_client_config( data ); - *rect = window_rect_from_visible( &data->rects, data->current_state.rect ); + *state_cmd = *config_cmd = 0; - release_win_data( data ); + if ((data = get_win_data( hwnd ))) + { + *state_cmd = window_update_client_state( data ); + *config_cmd = window_update_client_config( data ); + *rect = window_rect_from_visible( &data->rects, data->current_state.rect ); + release_win_data( data ); + } - TRACE( "hwnd %p, returning state_cmd %#x, config_cmd %#x, rect %s\n", hwnd, *state_cmd, *config_cmd, wine_dbgstr_rect(rect) ); - return *state_cmd || *config_cmd; + if (!*state_cmd && !*config_cmd) return FALSE; + TRACE( "hwnd %p, returning state_cmd %#x, config_cmd %#x, rect %s\n", + hwnd, *state_cmd, *config_cmd, wine_dbgstr_rect(rect) ); + return TRUE; } static BOOL handle_state_change( unsigned long serial, unsigned long *expect_serial, UINT size, const void *value, From 8fcdd2317f21d83c489e75aace7bd7c7d494f907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 19 Feb 2025 10:54:08 +0100 Subject: [PATCH 1208/2542] win32u: Return foreground window changes from GetWindowStateUpdates. CW-Bug-Id: #24817 CW-Bug-Id: #24919 --- dlls/win32u/driver.c | 2 +- dlls/win32u/message.c | 7 +++++-- dlls/winex11.drv/window.c | 9 +++++---- dlls/winex11.drv/x11drv.h | 2 +- include/wine/gdi_driver.h | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index 74e004d7ffa4..d891b54b7743 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -886,7 +886,7 @@ static BOOL nulldrv_GetWindowStyleMasks( HWND hwnd, UINT style, UINT ex_style, U return FALSE; } -static BOOL nulldrv_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, RECT *rect ) +static BOOL nulldrv_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, RECT *rect, HWND *foreground ) { return FALSE; } diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index b83a664999b0..b1de89fb2545 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2145,15 +2145,18 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR { UINT state_cmd, config_cmd; RECT window_rect; + HWND foreground; - if (!user_driver->pGetWindowStateUpdates( hwnd, &state_cmd, &config_cmd, &window_rect )) return 0; + if (!user_driver->pGetWindowStateUpdates( hwnd, &state_cmd, &config_cmd, &window_rect, &foreground )) return 0; + if (foreground) NtUserSetForegroundWindow( foreground ); if (state_cmd) { if (LOWORD(state_cmd) == SC_RESTORE && HIWORD(state_cmd)) NtUserSetForegroundWindow( hwnd ); send_message( hwnd, WM_SYSCOMMAND, LOWORD(state_cmd), 0 ); /* state change might have changed the window config already, check again */ - user_driver->pGetWindowStateUpdates( hwnd, &state_cmd, &config_cmd, &window_rect ); + user_driver->pGetWindowStateUpdates( hwnd, &state_cmd, &config_cmd, &window_rect, &foreground ); + if (foreground) NtUserSetForegroundWindow( foreground ); if (state_cmd) WARN( "window %p state needs another update, ignoring\n", hwnd ); } if (config_cmd) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 2bd3687eb932..524bc46ef780 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1816,11 +1816,12 @@ static UINT window_update_client_config( struct x11drv_win_data *data ) /*********************************************************************** * GetWindowStateUpdates (X11DRV.@) */ -BOOL X11DRV_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, RECT *rect ) +BOOL X11DRV_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, RECT *rect, HWND *foreground ) { struct x11drv_win_data *data; *state_cmd = *config_cmd = 0; + *foreground = 0; if ((data = get_win_data( hwnd ))) { @@ -1830,9 +1831,9 @@ BOOL X11DRV_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, release_win_data( data ); } - if (!*state_cmd && !*config_cmd) return FALSE; - TRACE( "hwnd %p, returning state_cmd %#x, config_cmd %#x, rect %s\n", - hwnd, *state_cmd, *config_cmd, wine_dbgstr_rect(rect) ); + if (!*state_cmd && !*config_cmd && !*foreground) return FALSE; + TRACE( "hwnd %p, returning state_cmd %#x, config_cmd %#x, rect %s, foreground %p\n", + hwnd, *state_cmd, *config_cmd, wine_dbgstr_rect(rect), *foreground ); return TRUE; } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 8b17ba57e9fd..deafc1d43446 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -246,7 +246,7 @@ extern void X11DRV_UpdateLayeredWindow( HWND hwnd, UINT flags ); extern LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ); extern BOOL X11DRV_WindowPosChanging( HWND hwnd, UINT swp_flags, BOOL shaped, const struct window_rects *rects ); extern BOOL X11DRV_GetWindowStyleMasks( HWND hwnd, UINT style, UINT ex_style, UINT *style_mask, UINT *ex_style_mask ); -extern BOOL X11DRV_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, RECT *rect ); +extern BOOL X11DRV_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, RECT *rect, HWND *foreground ); extern BOOL X11DRV_CreateWindowSurface( HWND hwnd, BOOL layered, const RECT *surface_rect, struct window_surface **surface ); extern void X11DRV_MoveWindowBits( HWND hwnd, const struct window_rects *old_rects, const struct window_rects *new_rects, const RECT *valid_rects ); diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index c018ab4c8a0b..df572adc0de5 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -387,7 +387,7 @@ struct user_driver_funcs LRESULT (*pWindowMessage)(HWND,UINT,WPARAM,LPARAM); BOOL (*pWindowPosChanging)(HWND,UINT,BOOL,const struct window_rects *); BOOL (*pGetWindowStyleMasks)(HWND,UINT,UINT,UINT*,UINT*); - BOOL (*pGetWindowStateUpdates)(HWND,UINT*,UINT*,RECT*); + BOOL (*pGetWindowStateUpdates)(HWND,UINT*,UINT*,RECT*,HWND*); BOOL (*pCreateWindowSurface)(HWND,BOOL,const RECT *,struct window_surface**); void (*pMoveWindowBits)(HWND,const struct window_rects *,const struct window_rects *,const RECT *); void (*pWindowPosChanged)(HWND,HWND,HWND,UINT,BOOL,const struct window_rects*,struct window_surface*); From d870c9152306acf33600c73d87a0a98ca2580529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 18 Feb 2025 12:31:37 +0100 Subject: [PATCH 1209/2542] win32u: Call ActivateWindow callback when foreground window changes. Repurposing the SetFocus callback. CW-Bug-Id: #24817 CW-Bug-Id: #24919 --- dlls/win32u/driver.c | 6 +++--- dlls/win32u/input.c | 10 ++++++---- dlls/winemac.drv/gdi.c | 2 +- dlls/winemac.drv/macdrv.h | 2 +- dlls/winemac.drv/window.c | 6 +++--- dlls/winex11.drv/event.c | 17 +++-------------- dlls/winex11.drv/init.c | 2 +- dlls/winex11.drv/x11drv.h | 2 +- include/wine/gdi_driver.h | 2 +- 9 files changed, 20 insertions(+), 29 deletions(-) diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index d891b54b7743..231b223a4637 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -829,7 +829,7 @@ static void nulldrv_SetDesktopWindow( HWND hwnd ) { } -static void nulldrv_SetFocus( HWND hwnd ) +static void nulldrv_ActivateWindow( HWND hwnd, HWND previous ) { } @@ -1291,7 +1291,7 @@ static const struct user_driver_funcs lazy_load_driver = nulldrv_ScrollDC, nulldrv_SetCapture, loaderdrv_SetDesktopWindow, - nulldrv_SetFocus, + nulldrv_ActivateWindow, loaderdrv_SetLayeredWindowAttributes, nulldrv_SetParent, loaderdrv_SetWindowRgn, @@ -1389,7 +1389,7 @@ void __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version SET_USER_FUNC(ScrollDC); SET_USER_FUNC(SetCapture); SET_USER_FUNC(SetDesktopWindow); - SET_USER_FUNC(SetFocus); + SET_USER_FUNC(ActivateWindow); SET_USER_FUNC(SetLayeredWindowAttributes); SET_USER_FUNC(SetParent); SET_USER_FUNC(SetWindowRgn); diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 850b94c8517d..754295e90dad 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -1925,8 +1925,6 @@ static HWND set_focus_window( HWND hwnd, BOOL from_active, BOOL force ) } if (is_window(hwnd)) { - user_driver->pSetFocus(hwnd); - ime_hwnd = get_default_ime_window( hwnd ); if (ime_hwnd) send_message( ime_hwnd, WM_IME_INTERNAL, IME_INTERNAL_ACTIVATE, @@ -2053,8 +2051,12 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new done: win_set_flags( hwnd, 0, WIN_IS_ACTIVATING ); - if (hwnd) clip_fullscreen_window( hwnd, FALSE ); - return ret; + if (ret && hwnd) + { + if (hwnd == NtUserGetForegroundWindow()) user_driver->pActivateWindow( hwnd, previous ); + clip_fullscreen_window( hwnd, FALSE ); + } + return TRUE; } /********************************************************************** diff --git a/dlls/winemac.drv/gdi.c b/dlls/winemac.drv/gdi.c index 4921fc2f1708..d58e0fd280f8 100644 --- a/dlls/winemac.drv/gdi.c +++ b/dlls/winemac.drv/gdi.c @@ -286,7 +286,7 @@ static const struct user_driver_funcs macdrv_funcs = .pSetCursor = macdrv_SetCursor, .pSetCursorPos = macdrv_SetCursorPos, .pSetDesktopWindow = macdrv_SetDesktopWindow, - .pSetFocus = macdrv_SetFocus, + .pActivateWindow = macdrv_ActivateWindow, .pSetLayeredWindowAttributes = macdrv_SetLayeredWindowAttributes, .pSetParent = macdrv_SetParent, .pSetWindowRgn = macdrv_SetWindowRgn, diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 4457a7e186c9..b6eeb4ecb8e3 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -136,7 +136,7 @@ extern void macdrv_CleanupIcons(HWND hwnd); extern LRESULT macdrv_DesktopWindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); extern void macdrv_DestroyWindow(HWND hwnd); extern void macdrv_SetDesktopWindow(HWND hwnd); -extern void macdrv_SetFocus(HWND hwnd); +extern void macdrv_ActivateWindow(HWND hwnd, HWND previous); extern void macdrv_SetLayeredWindowAttributes(HWND hwnd, COLORREF key, BYTE alpha, DWORD flags); extern void macdrv_SetParent(HWND hwnd, HWND parent, HWND old_parent); diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index 051266782646..4126d38c1140 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -1388,11 +1388,11 @@ void macdrv_DestroyWindow(HWND hwnd) /***************************************************************** - * SetFocus (MACDRV.@) + * ActivateWindow (MACDRV.@) * - * Set the Mac focus. + * Set the Mac active window. */ -void macdrv_SetFocus(HWND hwnd) +void macdrv_ActivateWindow(HWND hwnd, HWND previous) { struct macdrv_thread_data *thread_data = macdrv_thread_data(); diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 8dd964cc2b1a..2aabd3f5f000 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1428,25 +1428,14 @@ static BOOL X11DRV_PropertyNotify( HWND hwnd, XEvent *xev ) /***************************************************************** - * SetFocus (X11DRV.@) + * ActivateWindow (X11DRV.@) * * Set the X focus. */ -void X11DRV_SetFocus( HWND hwnd ) +void X11DRV_ActivateWindow( HWND hwnd, HWND previous ) { struct x11drv_win_data *data; - - HWND parent; - - for (;;) - { - if (!(data = get_win_data( hwnd ))) return; - if (data->embedded) break; - parent = NtUserGetAncestor( hwnd, GA_PARENT ); - if (!parent || parent == NtUserGetDesktopWindow()) break; - release_win_data( data ); - hwnd = parent; - } + if (!(data = get_win_data( hwnd ))) return; if (!data->managed || data->embedder) set_input_focus( data ); release_win_data( data ); } diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 45c405a51059..891b5526cef5 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -487,7 +487,7 @@ static const struct user_driver_funcs x11drv_funcs = .pScrollDC = X11DRV_ScrollDC, .pSetCapture = X11DRV_SetCapture, .pSetDesktopWindow = X11DRV_SetDesktopWindow, - .pSetFocus = X11DRV_SetFocus, + .pActivateWindow = X11DRV_ActivateWindow, .pSetLayeredWindowAttributes = X11DRV_SetLayeredWindowAttributes, .pSetParent = X11DRV_SetParent, .pSetWindowIcon = X11DRV_SetWindowIcon, diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index deafc1d43446..d055524fa838 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -734,7 +734,7 @@ extern XContext winContext; extern XContext cursor_context; extern BOOL is_current_process_focused(void); -extern void X11DRV_SetFocus( HWND hwnd ); +extern void X11DRV_ActivateWindow( HWND hwnd, HWND previous ); extern void set_window_cursor( Window window, HCURSOR handle ); extern void reapply_cursor_clipping(void); extern void ungrab_clipping_window(void); diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index df572adc0de5..3b3c6a068369 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -374,7 +374,7 @@ struct user_driver_funcs BOOL (*pScrollDC)(HDC,INT,INT,HRGN); void (*pSetCapture)(HWND,UINT); void (*pSetDesktopWindow)(HWND); - void (*pSetFocus)(HWND); + void (*pActivateWindow)(HWND,HWND); void (*pSetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD); void (*pSetParent)(HWND,HWND,HWND); void (*pSetWindowRgn)(HWND,HRGN,BOOL); From 5e7118ec0bdf7300646e8afc4d0a98d197ff3916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 19 Feb 2025 10:54:08 +0100 Subject: [PATCH 1210/2542] winex11: Use _NET_ACTIVE_WINDOW to request/track foreground window. When supported, instead of tracking window focus only. CW-Bug-Id: #24817 CW-Bug-Id: #24919 --- dlls/winex11.drv/event.c | 29 ++++++++++++++---------- dlls/winex11.drv/window.c | 46 ++++++++++++++++++++++++++++++++++++++- dlls/winex11.drv/x11drv.h | 2 ++ 3 files changed, 64 insertions(+), 13 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 2aabd3f5f000..e2d96e4df469 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -686,25 +686,27 @@ static void set_input_focus( struct x11drv_win_data *data ) /********************************************************************** * set_focus */ -static void set_focus( Display *display, HWND hwnd, Time time ) +static void set_focus( Display *display, HWND focus, Time time ) { - HWND focus; Window win; GUITHREADINFO threadinfo; wait_grab_pointer( display ); - TRACE( "setting foreground window to %p\n", hwnd ); - NtUserSetForegroundWindow( hwnd ); + TRACE( "setting foreground window to %p\n", focus ); - threadinfo.cbSize = sizeof(threadinfo); - NtUserGetGUIThreadInfo( 0, &threadinfo ); - focus = threadinfo.hwndFocus; - if (!focus) focus = threadinfo.hwndActive; - if (focus) focus = NtUserGetAncestor( focus, GA_ROOT ); - win = X11DRV_get_whole_window(focus); + if (!is_netwm_supported( x11drv_atom(_NET_ACTIVE_WINDOW) )) + { + NtUserSetForegroundWindow( focus ); + + threadinfo.cbSize = sizeof(threadinfo); + NtUserGetGUIThreadInfo( 0, &threadinfo ); + focus = threadinfo.hwndFocus; + if (!focus) focus = threadinfo.hwndActive; + if (focus) focus = NtUserGetAncestor( focus, GA_ROOT ); + } - if (win) + if ((win = X11DRV_get_whole_window( focus ))) { TRACE( "setting focus to %p (%lx) time=%ld\n", focus, win, time ); XSetInputFocus( display, win, RevertToParent, time ); @@ -963,7 +965,7 @@ static void focus_out( Display *display , HWND hwnd ) /* don't reset the foreground window, if the window which is getting the focus is a Wine window */ - if (!is_current_process_focused()) + if (!is_netwm_supported( x11drv_atom(_NET_ACTIVE_WINDOW) ) && !is_current_process_focused()) { /* Abey : 6-Oct-99. Check again if the focus out window is the Foreground window, because in most cases the messages sent @@ -1435,6 +1437,9 @@ static BOOL X11DRV_PropertyNotify( HWND hwnd, XEvent *xev ) void X11DRV_ActivateWindow( HWND hwnd, HWND previous ) { struct x11drv_win_data *data; + + set_net_active_window( hwnd, previous ); + if (!(data = get_win_data( hwnd ))) return; if (!data->managed || data->embedder) set_input_focus( data ); release_win_data( data ); diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 524bc46ef780..1f68c73fe747 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1818,11 +1818,23 @@ static UINT window_update_client_config( struct x11drv_win_data *data ) */ BOOL X11DRV_GetWindowStateUpdates( HWND hwnd, UINT *state_cmd, UINT *config_cmd, RECT *rect, HWND *foreground ) { + struct x11drv_thread_data *thread_data = x11drv_thread_data(); struct x11drv_win_data *data; + HWND old_foreground; + Window window; *state_cmd = *config_cmd = 0; *foreground = 0; + if (!(old_foreground = NtUserGetForegroundWindow())) old_foreground = NtUserGetDesktopWindow(); + if (NtUserGetWindowThread( old_foreground, NULL ) == GetCurrentThreadId() && !window_has_pending_wm_state( old_foreground, NormalState ) && + !thread_data->net_active_window_serial && (window = thread_data->current_net_active_window)) + { + *foreground = hwnd_from_window( thread_data->display, window ); + if (*foreground == (HWND)-1) *foreground = NtUserGetDesktopWindow(); + if (*foreground == old_foreground) *foreground = 0; + } + if ((data = get_win_data( hwnd ))) { *state_cmd = window_update_client_state( data ); @@ -1954,6 +1966,38 @@ void net_active_window_notify( unsigned long serial, Window value, Time time ) current, expected, "", received, NULL ); } +void set_net_active_window( HWND hwnd, HWND previous ) +{ + struct x11drv_thread_data *data = x11drv_thread_data(); + Window window; + XEvent xev; + + if (!is_netwm_supported( x11drv_atom(_NET_ACTIVE_WINDOW) )) return; + if (window_has_pending_wm_state( hwnd, -1 )) return; + if (!(window = X11DRV_get_whole_window( hwnd ))) return; + if (data->pending_net_active_window == window) return; + + xev.xclient.type = ClientMessage; + xev.xclient.window = window; + xev.xclient.message_type = x11drv_atom(_NET_ACTIVE_WINDOW); + xev.xclient.serial = 0; + xev.xclient.display = data->display; + xev.xclient.send_event = True; + xev.xclient.format = 32; + xev.xclient.data.l[0] = 2; /* source: pager */ + xev.xclient.data.l[1] = 0; /* timestamp */ + xev.xclient.data.l[2] = X11DRV_get_whole_window( previous ); /* current active */ + xev.xclient.data.l[3] = 0; + xev.xclient.data.l[4] = 0; + + data->pending_net_active_window = window; + data->net_active_window_serial = NextRequest( data->display ); + TRACE( "requesting _NET_ACTIVE_WINDOW %p/%lx serial %lu\n", hwnd, window, data->net_active_window_serial ); + XSendEvent( data->display, DefaultRootWindow( data->display ), False, + SubstructureRedirectMask | SubstructureNotifyMask, &xev ); + XFlush( data->display ); +} + BOOL window_has_pending_wm_state( HWND hwnd, UINT state ) { struct x11drv_win_data *data; @@ -3525,7 +3569,7 @@ LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) /*********************************************************************** * is_netwm_supported */ -static BOOL is_netwm_supported( Atom atom ) +BOOL is_netwm_supported( Atom atom ) { struct x11drv_thread_data *data = x11drv_thread_data(); BOOL supported; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index d055524fa838..b3d719ee4484 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -701,9 +701,11 @@ extern void window_mwm_hints_notify( struct x11drv_win_data *data, unsigned long extern void window_configure_notify( struct x11drv_win_data *data, unsigned long serial, const RECT *rect ); extern BOOL get_window_name( Display *display, Window window, char **name ); +extern void set_net_active_window( HWND hwnd, HWND previous ); extern void net_active_window_notify( unsigned long serial, Window window, Time time ); extern void net_supported_init( struct x11drv_thread_data *data ); extern void net_supporting_wm_check_init( struct x11drv_thread_data *data ); +extern BOOL is_netwm_supported( Atom atom ); extern Window init_clip_window(void); extern void update_user_time( struct x11drv_win_data *data, Time time, BOOL force ); From a36456add55571a461efabe3ef9078f839dae123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 21 Feb 2025 12:36:23 +0100 Subject: [PATCH 1211/2542] Revert "winex11: Give focus to the expected window when unampping with focus." This reverts commit 50fbd24a8f21fb693b20ae6a216e7298bff439d2. CW-Bug-Id: #24817 CW-Bug-Id: #24919 --- dlls/winex11.drv/event.c | 10 ++-------- dlls/winex11.drv/window.c | 6 ------ dlls/winex11.drv/x11drv.h | 1 - 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index e2d96e4df469..0cf958775f24 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -884,13 +884,10 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev ) { HWND foreground = NtUserGetForegroundWindow(); XFocusChangeEvent *event = &xev->xfocus; - struct x11drv_win_data *data; BOOL was_grabbed; if (event->detail == NotifyPointer) return FALSE; - if (!(data = get_win_data( hwnd ))) return FALSE; - data->has_focus = 1; - release_win_data( data ); + if (!hwnd) return FALSE; if (window_has_pending_wm_state( hwnd, -1 )) { @@ -988,7 +985,6 @@ static BOOL X11DRV_FocusOut( HWND hwnd, XEvent *xev ) { HWND foreground = NtUserGetForegroundWindow(); XFocusChangeEvent *event = &xev->xfocus; - struct x11drv_win_data *data; if (event->detail == NotifyPointer) { @@ -1001,9 +997,7 @@ static BOOL X11DRV_FocusOut( HWND hwnd, XEvent *xev ) } return TRUE; } - if (!(data = get_win_data( hwnd ))) return FALSE; - data->has_focus = 0; - release_win_data( data ); + if (!hwnd) return FALSE; if (window_has_pending_wm_state( hwnd, NormalState )) /* ignore FocusOut only if the window is being shown */ { diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 1f68c73fe747..a79eca57f11c 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1612,12 +1612,6 @@ static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state, U update_user_time( data, -1, TRUE ); } } - else if (data->has_focus && data->hwnd != foreground) - { - Window window = X11DRV_get_whole_window( foreground ); - WARN( "Inconsistent input focus, activating window %p/%lx\n", foreground, window ); - XSetInputFocus( data->display, window, RevertToParent, CurrentTime ); - } data->pending_state.wm_state = new_state; data->pending_state.swp_flags = swp_flags; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index b3d719ee4484..c9f3cca0716c 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -664,7 +664,6 @@ struct x11drv_win_data UINT is_fullscreen : 1; /* is the window visible rect fullscreen */ UINT is_offscreen : 1; /* has been moved offscreen by the window manager */ UINT parent_invalid : 1; /* is the parent host window possibly invalid */ - UINT has_focus : 1; /* does window have X input focus */ Window embedder; /* window id of embedder */ Pixmap icon_pixmap; Pixmap icon_mask; From b89afbfcd66cfa8bf3f7de6469f2a8bd8dd9cc04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 25 Feb 2025 20:41:34 +0100 Subject: [PATCH 1212/2542] HACK: winex11: Try harder to take focus away from Steam. CW-Bug-Id: #24817 CW-Bug-Id: #24919 --- dlls/winex11.drv/event.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 0cf958775f24..dce9a076fb9a 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -793,7 +793,8 @@ static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event ) } else if (protocol == x11drv_atom(WM_TAKE_FOCUS)) { - HWND last_focus = x11drv_thread_data()->last_focus, foreground = NtUserGetForegroundWindow(); + struct x11drv_thread_data *data = x11drv_thread_data(); + HWND last_focus = data->last_focus, foreground = NtUserGetForegroundWindow(); if (window_has_pending_wm_state( hwnd, -1 ) || (hwnd != foreground && !window_should_take_focus( foreground, event_time ))) { @@ -808,10 +809,11 @@ static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event ) NtUserIsWindowEnabled( hwnd ), NtUserIsWindowVisible( hwnd ), (int)NtUserGetWindowLongW( hwnd, GWL_STYLE ), get_focus(), get_active_window(), last_focus ); - /* Sometimes, when windows are quickly unmapped then mapped, we are being offered focus but still won't - * receive it because of some time resolution rules. Instead of relying on it, force receiving focus by - * setting the XSetInputFocus time to CurrentTime when we are expecting to be foreground. */ - if (hwnd == foreground) event_time = CurrentTime; + /* Steam sometimes calls XSetInputFocus with CurrentTime when it gets focused out, and the game gets + * focused in, this effectively sometimes steals focus away from us. Although there's no guarantee to + * win the race as it entirely depends on the request timings, using CurrentTime makes it more likely. + */ + if (data->active_window && !strcmp( data->active_window, "Steam" )) event_time = CurrentTime; if (can_activate_window(hwnd)) { From 34a6ab65e9ed656a4a30880051ae19202acec3c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 26 Feb 2025 21:22:51 +0100 Subject: [PATCH 1213/2542] winex11: Clear the padding around the window with display mode emulation. CW-Bug-Id: #24939 --- dlls/winex11.drv/event.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index dce9a076fb9a..20e83a66e52e 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1028,7 +1028,7 @@ static BOOL X11DRV_FocusOut( HWND hwnd, XEvent *xev ) static BOOL X11DRV_Expose( HWND hwnd, XEvent *xev ) { XExposeEvent *event = &xev->xexpose; - RECT rect, abs_rect; + RECT rect, visible, abs_rect; POINT pos; struct x11drv_win_data *data; UINT flags = RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN; @@ -1045,6 +1045,23 @@ static BOOL X11DRV_Expose( HWND hwnd, XEvent *xev ) if (!(data = get_win_data( hwnd ))) return FALSE; + /* clear any padding outside of the window rect that can exist for display mode emulation */ + visible = data->rects.visible; + OffsetRect( &visible, -data->rects.visible.left, -data->rects.visible.top ); + + rect = data->rects.window; + OffsetRect( &rect, -data->rects.visible.left, -data->rects.visible.top ); + intersect_rect( &rect, &rect, &visible ); + + if (rect.left > 0 || rect.top > 0 || rect.right < visible.right || rect.bottom < visible.bottom) + { + UINT width = visible.right - rect.right, height = visible.bottom - rect.bottom; + if (visible.right && rect.top) XClearArea( data->display, data->whole_window, 0, 0, visible.right, rect.top, 0 ); + if (rect.left && visible.bottom) XClearArea( data->display, data->whole_window, 0, 0, rect.left, visible.bottom, 0 ); + if (width && visible.bottom) XClearArea( data->display, data->whole_window, rect.right, 0, width, visible.bottom, 0 ); + if (height && visible.right) XClearArea( data->display, data->whole_window, 0, rect.bottom, visible.right, height, 0 ); + } + rect.left = pos.x; rect.top = pos.y; rect.right = pos.x + event->width; From 00b4ad2b294d364e96fe5763bbf11a28c2a3aad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 26 Feb 2025 21:24:30 +0100 Subject: [PATCH 1214/2542] HACK: winex11: Disable host window decorations with Mutter. Mutter is utterly broken when changing decorations. It's better not to have decorations at all and use Windows frames for the very few cases they would still be visible. CW-Bug-Id: #24939 --- dlls/winex11.drv/window.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index a79eca57f11c..8d7d10793238 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -472,6 +472,8 @@ static unsigned long get_mwm_decorations_for_style( DWORD style, DWORD ex_style { unsigned long ret = 0; + if (X11DRV_HasWindowManager( "Mutter" )) return 0; + if (ex_style & WS_EX_TOOLWINDOW) return 0; if (ex_style & WS_EX_LAYERED) return 0; From 2ffb8918a4c3c696228d9a42d91c989fa364cccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 26 Feb 2025 21:27:22 +0100 Subject: [PATCH 1215/2542] HACK: winex11: Remove now unnecessary Mutter workaround. It breaks more things than it fixes, by triggering spurious and uncontrollable focus changes. After the previous change this is now unnecessary as host decorations aren't requested anymore. --- dlls/winex11.drv/window.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 8d7d10793238..ed91f0489023 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -939,30 +939,6 @@ static void window_set_mwm_hints( struct x11drv_win_data *data, const MwmHints * if (!data->whole_window) return; /* no window, nothing to update */ if (!memcmp( old_hints, new_hints, sizeof(*new_hints) )) return; /* hints are the same, nothing to update */ - /* When removing decorations, Mutter sends UnmapNotify, FocusOut, ReparentNotify, MapNotify, WM_TAKE_FOCUS - * event sequence. We won't receive any WM_STATE property changes and cannot use it to detect when it's done, - * so explicitly request the Unmap / Map sequence ourselves, so we can follow the WM_STATE property changes. - * - * When adding decorations to a window in NormalState, Mutter first iconifies the window, then restores it - * after the same sequence. It however sometimes fails to restore focus to the window. - * - * In both cases, we will receive _MOTIF_WM_HINT PropertyNotify change right away and will then be unable to - * handle the non-atomic event sequence that follows. - * - * Instead, explicitly request an unmap / map sequence ourselves and track the corresponding events, overriding - * the Mutter generated sequence, while achieving the same thing and getting WM_TAKE_FOCUS event when the - * window is mapped again. - */ - if (X11DRV_HasWindowManager( "Mutter" ) && data->managed && data->pending_state.wm_state == NormalState && - !old_hints->decorations != !new_hints->decorations) - { - if (data->wm_state_serial) return; /* another WM_STATE update is pending, wait for it to complete */ - WARN( "window %p/%lx adds/removes decorations, remapping\n", data->hwnd, data->whole_window ); - NtUserSetProp( data->hwnd, focus_time_prop, (HANDLE)-1 ); - window_set_wm_state( data, WithdrawnState, FALSE ); - window_set_wm_state( data, NormalState, swp_flags ); - } - data->pending_state.mwm_hints = *new_hints; data->mwm_hints_serial = NextRequest( data->display ); TRACE( "window %p/%lx, requesting _MOTIF_WM_HINTS %s serial %lu\n", data->hwnd, data->whole_window, From fe2e39c86e327df14270d2ccd81a2b8e09c49b95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 26 Feb 2025 18:59:55 +0100 Subject: [PATCH 1216/2542] winex11: Request window activation after the foreground window has been mapped. --- dlls/winex11.drv/event.c | 3 +++ dlls/winex11.drv/window.c | 1 + 2 files changed, 4 insertions(+) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 20e83a66e52e..7ae5d1e56b09 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1329,12 +1329,15 @@ static void handle_wm_state_notify( HWND hwnd, XPropertyEvent *event ) { struct x11drv_win_data *data; UINT value = 0; + BOOL activate; if (!(data = get_win_data( hwnd ))) return; if (event->state == PropertyNewValue) value = get_window_wm_state( event->display, event->window ); window_wm_state_notify( data, event->serial, value, event->time ); + activate = value == NormalState && !data->wm_state_serial && !(data->current_state.swp_flags & SWP_NOACTIVATE); release_win_data( data ); + if (hwnd == NtUserGetForegroundWindow() && activate) set_net_active_window( hwnd, 0 ); NtUserPostMessage( hwnd, WM_WINE_WINDOW_STATE_CHANGED, 0, 0 ); } diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index ed91f0489023..9cb742923108 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1864,6 +1864,7 @@ void window_wm_state_notify( struct x11drv_win_data *data, unsigned long serial, if (!handle_state_change( serial, expect_serial, sizeof(value), &value, desired, pending, current, expected, prefix, received, reason )) return; + data->current_state.swp_flags = data->pending_state.swp_flags; /* send any pending changes from the desired state */ window_set_wm_state( data, data->desired_state.wm_state, data->desired_state.swp_flags ); From cbfaa307af0861e7f6468bfa7cb503d12981d007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 27 Feb 2025 17:01:25 +0100 Subject: [PATCH 1217/2542] HACK: win32u: Don't even try changing display mode with gamescope. It sometimes fails with modes that we generate from the virtual mode list but aren't actually exposed by XRandR. This operation is no-op with gamescope anyway, so no point even trying. CW-Bug-Id: #24941 --- dlls/win32u/sysparams.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index b55c596d342b..bc8f06f42f9b 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -4049,6 +4049,8 @@ static LONG apply_display_settings( struct source *target, const DEVMODEW *devmo /* use the default implementation in virtual desktop mode */ if (is_virtual_desktop() || emulate_modeset) ret = DISP_CHANGE_SUCCESSFUL; + /* HACK: Gamescope doesn't really changes the display mode, no point even trying as it sometimes fails with emulated mode list */ + else if (user_driver->pHasWindowManager( "steamcompmgr" )) ret = DISP_CHANGE_SUCCESSFUL; else ret = user_driver->pChangeDisplaySettings( displays, primary_name, hwnd, flags, lparam ); if (ret != DISP_CHANGE_SUCCESSFUL) WARN( "Failed to change display settings, ret %d\n", ret ); From 70103795f3b833d3e3cf2e0d8304368c65223079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 28 Feb 2025 09:34:21 +0100 Subject: [PATCH 1218/2542] winex11: Avoid X error with XOpenDevice when mouse is unplugged. CW-Bug-Id: #24949 --- dlls/winex11.drv/mouse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 47ac3d6e079e..8e6ebbd81d37 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -269,7 +269,7 @@ static void update_device_mapping( Display *display, int deviceid ) struct mouse_button_mapping *tmp; XDevice *device; - if (!(device = pXOpenDevice( display, deviceid ))) + if (!deviceid || !(device = pXOpenDevice( display, deviceid ))) { WARN( "Unable to open cursor device %d\n", deviceid ); return; @@ -1724,6 +1724,8 @@ static BOOL X11DRV_DeviceChanged( XGenericEventCookie *xev ) struct x11drv_thread_data *data = x11drv_thread_data(); if (event->deviceid != data->xinput2_pointer) return FALSE; + if (event->reason != XISlaveSwitch) return FALSE; + update_relative_valuators( event->classes, event->num_classes ); update_device_mapping( event->display, event->sourceid ); From f2b13fcc466e51f89ef0643473def95e2abeb64d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 28 Feb 2025 11:01:29 +0100 Subject: [PATCH 1219/2542] win32u: Mind monitor pixel density when looking for intersecting area. CW-Bug-Id: #24946 --- dlls/win32u/sysparams.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index bc8f06f42f9b..8ca85509d96f 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -2540,14 +2540,17 @@ static struct monitor *get_monitor_from_rect( RECT rect, UINT flags, UINT dpi, M LIST_FOR_EACH_ENTRY(monitor, &monitors, struct monitor, entry) { RECT intersect, monitor_rect; + UINT density, raw_dpi, x, y; if (!is_monitor_active( monitor ) || monitor->is_clone) continue; + raw_dpi = monitor_get_dpi( monitor, MDT_RAW_DPI, &x, &y ); + density = raw_dpi * raw_dpi / 96 / 96; monitor_rect = monitor_get_rect( monitor, dpi, type ); if (intersect_rect( &intersect, &monitor_rect, &rect )) { /* check for larger intersecting area */ - UINT area = (intersect.right - intersect.left) * (intersect.bottom - intersect.top); + UINT area = (intersect.right - intersect.left) * (intersect.bottom - intersect.top) * density; if (area > max_area) { max_area = area; From 0cfa912d61608b8d3c6fa787fc6d3ec60ba2451e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 26 Nov 2024 20:46:05 -0600 Subject: [PATCH 1220/2542] ddraw: HACK: Blit to fullscreen window instead of desktop window in ddraw_surface_update_frontbuffer(). CW-Bug-Id: #24494 CW-Bug-Id: #23872 --- dlls/ddraw/surface.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 545c76738cd1..01eb85ae4877 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -64,6 +64,7 @@ HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, struct wined3d_texture *dst_texture, *wined3d_texture; struct ddraw *ddraw = surface->ddraw; HDC surface_dc, screen_dc; + HWND dest_window = NULL; int x, y, w, h; HRESULT hr; BOOL ret; @@ -156,7 +157,9 @@ HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, if (surface->palette) wined3d_palette_apply_to_dc(surface->palette->wined3d_palette, surface_dc); - if (!(screen_dc = GetDC(NULL))) + if (ddraw->cooperative_level & DDSCL_EXCLUSIVE && ddraw->dest_window) + dest_window = ddraw->dest_window; + if (!(screen_dc = GetDCEx(dest_window, NULL, DCX_WINDOW | DCX_CACHE))) { wined3d_texture_release_dc(wined3d_texture, surface->sub_resource_idx, surface_dc); ERR("Failed to get screen DC.\n"); @@ -170,7 +173,7 @@ HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, ret = BitBlt(screen_dc, x, y, w, h, surface_dc, x, y, SRCCOPY); - ReleaseDC(NULL, screen_dc); + ReleaseDC(dest_window, screen_dc); wined3d_texture_release_dc(wined3d_texture, surface->sub_resource_idx, surface_dc); if (!ret) @@ -4646,7 +4649,6 @@ static HRESULT WINAPI ddraw_surface7_SetClipper(IDirectDrawSurface7 *iface, ddraw_set_swapchain_window(This->ddraw, This->ddraw->dest_window); } } - wined3d_mutex_unlock(); return DD_OK; From 3256984ad17f34f47b09546e8f81319345364675 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 28 Feb 2025 16:56:17 -0600 Subject: [PATCH 1221/2542] usre32: Return PT_TOUCH from GetPointerType() for non-mouse pointer. CW-Bug-Id: #24947 --- dlls/user32/misc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/user32/misc.c b/dlls/user32/misc.c index 6333fcb48b4e..3b3cde91a8a2 100644 --- a/dlls/user32/misc.c +++ b/dlls/user32/misc.c @@ -520,7 +520,8 @@ BOOL WINAPI GetPointerType(UINT32 id, POINTER_INPUT_TYPE *type) return FALSE; } - *type = PT_MOUSE; + if (id == 1) *type = PT_MOUSE; + else *type = PT_TOUCH; return TRUE; } From 04eb3b269711c2e47bccd408b5e7a6013e347c45 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 28 Feb 2025 10:16:22 -0600 Subject: [PATCH 1222/2542] winex11.drv: Use raw touch events. CW-Bug-Id: #24947 --- dlls/win32u/message.c | 6 +++++ dlls/winex11.drv/display.c | 8 ++++++ dlls/winex11.drv/mouse.c | 53 +++++++++++++++++++++++--------------- dlls/winex11.drv/x11drv.h | 1 + 4 files changed, 47 insertions(+), 21 deletions(-) diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index b1de89fb2545..9331e928aa22 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2369,6 +2369,12 @@ static void send_parent_notify( HWND hwnd, WORD event, WORD idChild, POINT pt ) */ static BOOL process_pointer_message( MSG *msg, UINT hw_id, const struct hardware_msg_data *msg_data ) { + RECT rect; + + SetRect( &rect, LOWORD(msg->lParam), HIWORD(msg->lParam), LOWORD(msg->lParam), HIWORD(msg->lParam) ); + rect = map_rect_raw_to_virt( rect, get_thread_dpi() ); + msg->lParam = MAKELPARAM(rect.left, rect.top); + msg->pt = point_phys_to_win_dpi( msg->hwnd, msg->pt ); return TRUE; } diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index 18d75a670144..8b373acffb68 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -33,6 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(x11drv); static struct x11drv_display_device_handler host_handler; static struct x11drv_settings_handler settings_handler; +RECT gamescope_screen_rect; #define NEXT_DEVMODEW(mode) ((DEVMODEW *)((char *)((mode) + 1) + (mode)->dmDriverExtra)) @@ -514,6 +515,13 @@ UINT X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage if (!settings_handler.get_id( devname, is_primary, &settings_id )) break; settings_handler.get_current_mode( settings_id, ¤t_mode ); + if (!gpu && X11DRV_HasWindowManager( "steamcompmgr" )) + { + gamescope_screen_rect.left = gamescope_screen_rect.top = 0; + gamescope_screen_rect.right = current_mode.dmPelsWidth; + gamescope_screen_rect.bottom = current_mode.dmPelsHeight; + } + if (settings_handler.get_modes( settings_id, EDS_ROTATEDMODE, &modes, &mode_count, FALSE )) { device_manager->add_modes( ¤t_mode, mode_count, modes, param ); diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 8e6ebbd81d37..bfffd51a0766 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -365,14 +365,12 @@ void x11drv_xinput2_enable( Display *display, Window window ) { XISetMask( mask_bits, XI_RawButtonPress ); XISetMask( mask_bits, XI_RawButtonRelease ); + + XISetMask( mask_bits, XI_RawTouchBegin ); + XISetMask( mask_bits, XI_RawTouchUpdate ); + XISetMask( mask_bits, XI_RawTouchEnd ); } } - else - { - XISetMask( mask_bits, XI_TouchBegin ); - XISetMask( mask_bits, XI_TouchUpdate ); - XISetMask( mask_bits, XI_TouchEnd ); - } pXISelectEvents( display, window, &mask, 1 ); } @@ -1787,6 +1785,18 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input, BOOL send_raw { input->mi.dx = round( x->value ); input->mi.dy = round( y->value ); + if (gamescope_screen_rect.bottom) + { + RECT virtual = NtUserGetVirtualScreenRect( MDT_RAW_DPI ); + + input->mi.dx = input->mi.dx * (gamescope_screen_rect.right - gamescope_screen_rect.left) + / (virtual.right - virtual.left); + input->mi.dx = min( input->mi.dx, 65535 ); + + input->mi.dy = input->mi.dy * (gamescope_screen_rect.bottom - gamescope_screen_rect.top) + / (virtual.bottom - virtual.top); + input->mi.dy = min( input->mi.dy, 65535 ); + } TRACE( "event %f,%f value %f,%f absolute input %d,%d\n", x_value, y_value, x->value, y->value, (int)input->mi.dx, (int)input->mi.dy ); } @@ -1891,32 +1901,33 @@ static BOOL X11DRV_RawButtonEvent( XGenericEventCookie *cookie ) return TRUE; } -static BOOL X11DRV_TouchEvent( HWND hwnd, XGenericEventCookie *xev ) +static BOOL X11DRV_RawTouchEvent( HWND hwnd, XGenericEventCookie *xev ) { - RECT virtual = NtUserGetVirtualScreenRect( MDT_RAW_DPI ); + struct x11drv_thread_data *thread_data = x11drv_thread_data(); INPUT input = {.type = INPUT_HARDWARE}; - XIDeviceEvent *event = xev->data; + XIRawEvent *event = xev->data; int flags = 0; POINT pos; - input.mi.dx = event->event_x; - input.mi.dy = event->event_y; - map_event_coords( hwnd, event->event, event->root, event->root_x, event->root_y, &input ); - pos.x = input.mi.dx * 65535 / (virtual.right - virtual.left); - pos.y = input.mi.dy * 65535 / (virtual.bottom - virtual.top); + if (!thread_data->xinput2_rawinput) return FALSE; + + if (!map_raw_event_coords( event, &input, FALSE )) return FALSE; + if (!(input.mi.dwFlags & MOUSEEVENTF_ABSOLUTE)) return FALSE; + pos.x = input.mi.dx; + pos.y = input.mi.dy; switch (event->evtype) { - case XI_TouchBegin: + case XI_RawTouchBegin: input.hi.uMsg = WM_POINTERDOWN; flags |= POINTER_MESSAGE_FLAG_NEW; TRACE("XI_TouchBegin detail %u pos %dx%d, flags %#x\n", event->detail, (int)pos.x, (int)pos.y, flags); break; - case XI_TouchEnd: + case XI_RawTouchEnd: input.hi.uMsg = WM_POINTERUP; TRACE("XI_TouchEnd detail %u pos %dx%d, flags %#x\n", event->detail, (int)pos.x, (int)pos.y, flags); break; - case XI_TouchUpdate: + case XI_RawTouchUpdate: input.hi.uMsg = WM_POINTERUPDATE; TRACE("XI_TouchUpdate detail %u pos %dx%d, flags %#x\n", event->detail, (int)pos.x, (int)pos.y, flags); break; @@ -2007,10 +2018,10 @@ BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *xev ) ret = X11DRV_RawButtonEvent( event ); break; - case XI_TouchBegin: - case XI_TouchUpdate: - case XI_TouchEnd: - ret = X11DRV_TouchEvent( hwnd, event ); + case XI_RawTouchBegin: + case XI_RawTouchUpdate: + case XI_RawTouchEnd: + ret = X11DRV_RawTouchEvent( hwnd, event ); break; default: diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index c9f3cca0716c..5e8bfc126025 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -760,6 +760,7 @@ extern void init_recursive_mutex( pthread_mutex_t *mutex ); #define DEPTH_COUNT 3 extern const unsigned int *depths; +extern RECT gamescope_screen_rect; /* Use a distinct type for the settings id, to avoid mixups other types of ids */ typedef struct { ULONG_PTR id; } x11drv_settings_id; From 09786a9c5ff2b55df1b3d19d48916677235c0394 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Thu, 27 Feb 2025 20:09:37 +0100 Subject: [PATCH 1223/2542] rtworkq: Fix private queue id mask check. (cherry picked from commit c14fc001b4f9daf86122c86252858118e760ac60) --- dlls/rtworkq/queue.c | 9 ++++----- dlls/rtworkq/tests/rtworkq.c | 7 +++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dlls/rtworkq/queue.c b/dlls/rtworkq/queue.c index 031da94ca43a..144feb98c55c 100644 --- a/dlls/rtworkq/queue.c +++ b/dlls/rtworkq/queue.c @@ -307,14 +307,13 @@ static struct queue system_queues[SYS_QUEUE_COUNT]; static struct queue *get_system_queue(DWORD queue_id) { + if (RTWQ_CALLBACK_QUEUE_PRIVATE_MASK & queue_id) + return NULL; + switch (queue_id) { default: - if (!(RTWQ_CALLBACK_QUEUE_PRIVATE_MASK & queue_id)) - return NULL; - /* fall through */ - case RTWQ_CALLBACK_QUEUE_UNDEFINED: - /* Works in native Windows. Undocumented, but seems to use standard. */ + /* Use standard queue for undefined system queue id's. */ queue_id = RTWQ_CALLBACK_QUEUE_STANDARD; /* fall through */ case RTWQ_CALLBACK_QUEUE_STANDARD: diff --git a/dlls/rtworkq/tests/rtworkq.c b/dlls/rtworkq/tests/rtworkq.c index e6930083e8ff..7655275d7214 100644 --- a/dlls/rtworkq/tests/rtworkq.c +++ b/dlls/rtworkq/tests/rtworkq.c @@ -270,18 +270,21 @@ static void test_undefined_queue_id(void) ok(res == 0, "got %#lx\n", res); ok(callback_result == result, "Expected result %p, got %p.\n", result, callback_result); - hr = RtwqPutWorkItem(RTWQ_CALLBACK_QUEUE_PRIVATE_MASK, 0, result); + hr = RtwqPutWorkItem(0xffff, 0, result); ok(hr == S_OK, "got %#lx\n", hr); res = wait_async_callback_result(&test_callback->IRtwqAsyncCallback_iface, 100, &callback_result); ok(res == 0, "got %#lx\n", res); ok(callback_result == result, "Expected result %p, got %p.\n", result, callback_result); - hr = RtwqPutWorkItem(RTWQ_CALLBACK_QUEUE_PRIVATE_MASK & (RTWQ_CALLBACK_QUEUE_PRIVATE_MASK - 1), 0, result); + hr = RtwqPutWorkItem(0x4000, 0, result); ok(hr == S_OK, "got %#lx\n", hr); res = wait_async_callback_result(&test_callback->IRtwqAsyncCallback_iface, 100, &callback_result); ok(res == 0, "got %#lx\n", res); ok(callback_result == result, "Expected result %p, got %p.\n", result, callback_result); + hr = RtwqPutWorkItem(0x10000, 0, result); + ok(hr == RTWQ_E_INVALID_WORKQUEUE, "got %#lx\n", hr); + IRtwqAsyncResult_Release(result); IRtwqAsyncCallback_Release(&test_callback->IRtwqAsyncCallback_iface); From a89d6678b948aa50834c9038f2257074987425d9 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Thu, 20 Feb 2025 15:45:07 +0200 Subject: [PATCH 1224/2542] krnl386: Silence a warning in GetSystemDirectory16(). With GCC 14.2 on Debian 11: $ i686-w64-mingw32-gcc --version i686-w64-mingw32-gcc (GCC) 14.2.0 Copyright (C) 2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The following error happens: In file included from ~/src/wine/dlls/krnl386.exe16/file.c:33: In function 'lstrcpyA', inlined from 'GetSystemDirectory16' at ~/src/wine/dlls/krnl386.exe16/file.c:648:9, inlined from 'get_search_path' at ~/src/wine/dlls/krnl386.exe16/file.c:192:12: ~/src/wine/include/winbase.h:2939:12: error: argument 1 null where non-null expected [-Werror=nonnull] 2939 | return strcpy( dst, src ); | ^~~~~~~~~~~~~~~~~~ In file included from ~/src/wine/dlls/krnl386.exe16/file.c:28: ~/src/wine/include/msvcrt/string.h: In function 'get_search_path': ~/src/wine/include/msvcrt/string.h:53:26: note: in a call to function 'strcpy' declared 'nonnull' 53 | _ACRTIMP char* __cdecl strcpy(char*,const char*); | ^~~~~~ In function 'lstrcatA', inlined from 'GetSystemDirectory16' at ~/src/wine/dlls/krnl386.exe16/file.c:649:9, inlined from 'get_search_path' at ~/src/wine/dlls/krnl386.exe16/file.c:192:12: ~/src/wine/include/winbase.h:2952:12: error: argument 1 null where non-null expected [-Werror=nonnull] 2952 | return strcat( dst, src ); | ^~~~~~~~~~~~~~~~~~ ~/src/wine/include/winbase.h:2952:12: note: in a call to built-in function '__builtin_strlen' (built using --with-mingw and --enable-werror to turn it into an error) The warning doesn't really matter as get_search_path() calls GetSystemDirectory16(NULL, 0) to get the size for allocation. `if (count >= len)` in the latter saves us from ever atempting to strcpy() onto NULL, but the compiler is not smart enough to figure out that len will be greater than 0. This change mimics kernel32's GetSystemDirectoryW(). (cherry picked from commit ac3e150f283bdaffaa15827b02f9fbfeb2855270) --- dlls/krnl386.exe16/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/krnl386.exe16/file.c b/dlls/krnl386.exe16/file.c index 5eab05598835..01cf4ac657aa 100644 --- a/dlls/krnl386.exe16/file.c +++ b/dlls/krnl386.exe16/file.c @@ -643,7 +643,7 @@ UINT16 WINAPI GetSystemDirectory16( LPSTR path, UINT16 count ) UINT16 len; len = GetWindowsDirectory16(windir, sizeof(windir) - sizeof(system16) + 1) + sizeof(system16); - if (count >= len) + if (path && count >= len) { lstrcpyA(path, windir); lstrcatA(path, system16); From d77871750e6465ee51ff5acfe64223670ec79cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 28 Feb 2025 10:16:07 +0100 Subject: [PATCH 1225/2542] win32u: Don't create a window surface if the window has a pixel format. If the GL surface is offscreen, winex11 enable_direct_drawing will not catch it and will create a window surface nonetheless. Things are being moved to win32u, so it's probably better to do the check here. We still allow window surfaces to exist with VK for now, so only enable this for GL client surfaces. CW-Bug-Id: #24946 CW-Bug-Id: #24955 --- dlls/win32u/window.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 0a88e4d83f90..b88046316e9e 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1516,13 +1516,13 @@ int win32u_get_window_pixel_format( HWND hwnd ) return ret; } -static int window_has_client_surface( HWND hwnd ) +static int window_has_client_surface( HWND hwnd, BOOL opengl_only ) { WND *win = get_win_ptr( hwnd ); BOOL ret; if (!win || win == WND_DESKTOP || win == WND_OTHER_PROCESS) return FALSE; - ret = win->pixel_format || win->internal_pixel_format || !list_empty(&win->vulkan_surfaces); + ret = win->pixel_format || win->internal_pixel_format || (!list_empty(&win->vulkan_surfaces) && !opengl_only); release_win_ptr( win ); return ret; @@ -1992,7 +1992,7 @@ static BOOL get_default_window_surface( HWND hwnd, const RECT *surface_rect, str static struct window_surface *get_window_surface( HWND hwnd, UINT swp_flags, BOOL create_layered, struct window_rects *rects, RECT *surface_rect ) { - BOOL shaped, needs_surface, create_opaque, is_layered, is_child; + BOOL shaped, needs_surface, create_opaque, is_layered, is_child, is_opengl; HWND parent = NtUserGetAncestor( hwnd, GA_PARENT ); struct window_surface *new_surface; struct window_rects monitor_rects; @@ -2003,6 +2003,7 @@ static struct window_surface *get_window_surface( HWND hwnd, UINT swp_flags, BOO style = NtUserGetWindowLongW( hwnd, GWL_STYLE ); ex_style = NtUserGetWindowLongW( hwnd, GWL_EXSTYLE ); is_child = parent && parent != NtUserGetDesktopWindow(); + is_opengl = window_has_client_surface( hwnd, TRUE ); if (is_child) get_win_monitor_dpi( parent, &raw_dpi ); else monitor_dpi_from_rect( rects->window, get_thread_dpi(), &raw_dpi ); @@ -2037,7 +2038,12 @@ static struct window_surface *get_window_surface( HWND hwnd, UINT swp_flags, BOO if (IsRectEmpty( surface_rect )) needs_surface = FALSE; else if (create_layered || is_layered) needs_surface = TRUE; - if (needs_surface) + if (is_opengl && !is_layered && !create_layered) + { + if (new_surface) window_surface_release( new_surface ); + new_surface = NULL; + } + else if (needs_surface) create_window_surface( hwnd, create_layered, surface_rect, raw_dpi, &new_surface ); else if (new_surface && new_surface != &dummy_surface) { @@ -2069,7 +2075,7 @@ static void update_children_window_state( HWND hwnd ) for (i = 0; children[i]; i++) { - if (!window_has_client_surface( children[i] )) continue; + if (!window_has_client_surface( children[i], FALSE )) continue; update_window_state( children[i] ); } From 00bab7fce4903810f9c6cbae62a6da7d6d1aca1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 4 Mar 2025 10:51:39 +0100 Subject: [PATCH 1226/2542] HACK: win32u: Avoid moving fullscreen windows to arbitrary positions. Only allow them to be moved to their monitor top-left corner. CW-Bug-Id: #24943 --- dlls/win32u/window.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index b88046316e9e..00c61ecc9b91 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -3448,6 +3448,26 @@ static BOOL calc_winpos( WINDOWPOS *winpos, struct window_rects *old_rects, stru winpos->x = -32000; winpos->y = -32000; } + else + { + const char *sgi = getenv( "SteamGameId" ); + + /* CW-Bug-Id: #24943 Space Engineers (244850) has issues with fullscreen focus loss with + * non-native aspect ratio */ + if (sgi && !strcmp( sgi, "244850" ) + && !(win->dwStyle & WS_MINIMIZE) && win->parent == get_desktop_window() + && is_window_rect_full_screen( &old_rects->visible, get_thread_dpi() )) + { + RECT rect = {winpos->x, winpos->y, + winpos->x + new_rects->window.right - new_rects->window.left, + winpos->y + new_rects->window.bottom - new_rects->window.top}; + MONITORINFO info = monitor_info_from_rect( rect, get_thread_dpi() ); + WARN( "Forcing fullscreen window %p origin from %s to %s\n", winpos->hwnd, + wine_dbgstr_rect(&rect), wine_dbgstr_rect(&info.rcMonitor) ); + winpos->x = info.rcMonitor.left; + winpos->y = info.rcMonitor.top; + } + } new_rects->window.left = winpos->x; new_rects->window.top = winpos->y; new_rects->window.right += winpos->x - old_rects->window.left; From 3d3981a7cbed299ee42b8b87022216ed164391f1 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Tue, 4 Mar 2025 21:53:13 +0800 Subject: [PATCH 1227/2542] win32u: Remove an unused parameter. The first parameter `current` for get_virtual_modes() is usused. It was introduced by 1ffe5b35. (cherry picked from commit a689a6dabb351ddf9d9f2d1e35fe95eb7e1464b6) CW-Bug-Id: #24948 --- dlls/win32u/sysparams.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 8ca85509d96f..712db1d17372 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1720,7 +1720,7 @@ static UINT add_virtual_mode( DEVMODEW *modes, UINT count, const DEVMODEW *mode, return 2; } -static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *initial, const DEVMODEW *maximum, +static DEVMODEW *get_virtual_modes( const DEVMODEW *initial, const DEVMODEW *maximum, const DEVMODEW *host_modes, UINT host_modes_count, UINT32 *modes_count ) { UINT depths[] = {8, 16, initial->dmBitsPerPel}, freqs[] = {60, -1}, sizes_count, i, j, f, count = 0; @@ -1811,7 +1811,7 @@ static void add_modes( const DEVMODEW *current, UINT host_modes_count, const DEV else if (emulate_modelist) { physical = *current; - if ((virtual_modes = get_virtual_modes( current, &physical, &physical, host_modes, host_modes_count, &virtual_count ))) + if ((virtual_modes = get_virtual_modes( &physical, &physical, host_modes, host_modes_count, &virtual_count ))) { modes_count = virtual_count; modes = virtual_modes; @@ -1843,7 +1843,7 @@ static void add_modes( const DEVMODEW *current, UINT host_modes_count, const DEV if (!read_source_mode( source->key, ENUM_CURRENT_SETTINGS, &virtual )) virtual = physical; - if ((virtual_modes = get_virtual_modes( &virtual, current, &physical, host_modes, host_modes_count, &virtual_count ))) + if ((virtual_modes = get_virtual_modes( current, &physical, host_modes, host_modes_count, &virtual_count ))) { modes_count = virtual_count; modes = virtual_modes; @@ -2367,7 +2367,7 @@ static BOOL add_virtual_source( struct device_manager_ctx *ctx ) add_monitor( &monitor, ctx ); /* Expose the virtual source display modes as physical modes, to avoid DPI scaling */ - if (!(modes = get_virtual_modes( ¤t, &initial, &maximum, NULL, 0, &modes_count ))) return STATUS_NO_MEMORY; + if (!(modes = get_virtual_modes( &initial, &maximum, NULL, 0, &modes_count ))) return STATUS_NO_MEMORY; add_modes( ¤t, modes_count, modes, ctx ); free( modes ); From cf2868b5a7adefa1f70817eaedb351fdb2df8883 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Tue, 4 Mar 2025 21:53:13 +0800 Subject: [PATCH 1228/2542] win32u: Don't use the current mode in the registry if it's a detached mode. Fix The Witcher 3 (292030) shows a black screen after the screen is turned off and then on. This is due to a detached mode is written as the current mode in the registry and then the detached mode gets used as the current mode when adding fake modes when handling subsequent display change events. (cherry picked from commit 47210da284de1b001772650e6fd5489715fc0a4a) CW-Bug-Id: #24948 --- dlls/win32u/sysparams.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 712db1d17372..ab583c21f414 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -468,6 +468,15 @@ static UINT devmode_get( const DEVMODEW *mode, UINT field ) return 0; } +static BOOL is_detached_mode( const DEVMODEW *mode ) +{ + return mode->dmFields & DM_POSITION && + mode->dmFields & DM_PELSWIDTH && + mode->dmFields & DM_PELSHEIGHT && + mode->dmPelsWidth == 0 && + mode->dmPelsHeight == 0; +} + static BOOL write_source_mode( HKEY hkey, UINT index, const DEVMODEW *mode ) { WCHAR bufferW[MAX_PATH] = {0}; @@ -1818,7 +1827,8 @@ static void add_modes( const DEVMODEW *current, UINT host_modes_count, const DEV } /* HACK: Gamescope doesn't really changes the display mode, pretend it changed to what was requested */ - if (user_driver->pHasWindowManager( "steamcompmgr" ) && read_source_mode( source->key, ENUM_CURRENT_SETTINGS, &virtual )) + if (user_driver->pHasWindowManager( "steamcompmgr" ) && read_source_mode( source->key, ENUM_CURRENT_SETTINGS, &virtual ) + && !is_detached_mode( &virtual )) { WARN( "Faking current mode to %s\n", debugstr_devmodew(&virtual) ); current = &virtual; @@ -1840,7 +1850,7 @@ static void add_modes( const DEVMODEW *current, UINT host_modes_count, const DEV } else { - if (!read_source_mode( source->key, ENUM_CURRENT_SETTINGS, &virtual )) + if (!read_source_mode( source->key, ENUM_CURRENT_SETTINGS, &virtual ) || is_detached_mode( &virtual )) virtual = physical; if ((virtual_modes = get_virtual_modes( current, &physical, host_modes, host_modes_count, &virtual_count ))) @@ -1894,15 +1904,6 @@ static void release_display_manager_ctx( struct device_manager_ctx *ctx ) } } -static BOOL is_detached_mode( const DEVMODEW *mode ) -{ - return mode->dmFields & DM_POSITION && - mode->dmFields & DM_PELSWIDTH && - mode->dmFields & DM_PELSHEIGHT && - mode->dmPelsWidth == 0 && - mode->dmPelsHeight == 0; -} - static BOOL is_monitor_active( struct monitor *monitor ) { DEVMODEW current_mode = {.dmSize = sizeof(DEVMODEW)}; From 32dd468e1eff918ee293f0868a0ef9a1883b2452 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Wed, 5 Mar 2025 15:42:44 +0800 Subject: [PATCH 1229/2542] win32u: Use the normal window rectangle to find monitor when a window is minimized. Fix Wolfenstein 2: The New Colossus (612880) black screen after focus lost with the primary monitor on the right. This is caused by using the window rectangle at (-32000,-32000) to find the monitor when the window is minimized in get_win_monitor_dpi(). The incorrect monitor raw DPI then causes enable_fullscreen_hack() to return FALSE, which in turn causes win32u_vkAcquireNextImageKHR() to return VK_ERROR_OUT_OF_DATE_KHR. And the game can't handle the error in this case. (cherry picked from commit fddbab9b73059f0e59bebe78101b7b503907d2e0) CW-Bug-Id: #24965 --- dlls/win32u/sysparams.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index ab583c21f414..6a8a429394bd 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -2760,7 +2760,7 @@ UINT get_win_monitor_dpi( HWND hwnd, UINT *raw_dpi ) } else { - rect = win->rects.window; + rect = is_iconic( hwnd ) ? win->normal_rect : win->rects.window; release_win_ptr( win ); } From 0795b5d9c7275558efeb43622e8134decf26982b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 5 Mar 2025 10:24:24 +0100 Subject: [PATCH 1230/2542] HACK: win32u: Remove 1280x768 which wasn't present before. CW-Bug-Id: #24970 --- dlls/win32u/sysparams.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 6a8a429394bd..d156dd46dacf 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1675,8 +1675,6 @@ static SIZE *get_screen_sizes( const DEVMODEW *maximum, const DEVMODEW *modes, U {3840, 1600}, /* 5:4 */ {1280, 1024}, - /* 5:3 */ - {1280, 768}, }; UINT max_width = devmode_get( maximum, DM_PELSWIDTH ), max_height = devmode_get( maximum, DM_PELSHEIGHT ); SIZE *sizes, max_size = {.cx = max( max_width, max_height ), .cy = min( max_width, max_height )}; From 454cbf7d918bfe73a06aee702c142fd35a6c1ad0 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Thu, 30 Jan 2025 15:46:09 +0000 Subject: [PATCH 1231/2542] dmime: Handle IStream EOF correctly in MIDI parser. Read returns E_FAIL when the EOF is encountered, which was treated as a failure. (cherry picked from commit e5c5e2784dfbbb3d69e0e53eea00e313313578ee) --- dlls/dmime/midi.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dlls/dmime/midi.c b/dlls/dmime/midi.c index 57b6a3adf90a..2b01e85c18cf 100644 --- a/dlls/dmime/midi.c +++ b/dlls/dmime/midi.c @@ -332,15 +332,20 @@ static HRESULT midi_parser_parse(struct midi_parser *parser, IDirectMusicSegment for (i = 0;; i++) { - BYTE magic[4] = {0}, last_status = 0; + BYTE magic[4], last_status = 0; DWORD length_be; ULONG length; ULONG read = 0; struct midi_event event = {0}; TRACE("Start parsing track %u\n", i); - if ((hr = IStream_Read(parser->stream, magic, sizeof(magic), &read)) != S_OK) break; - if (read < sizeof(magic)) break; + hr = IStream_Read(parser->stream, magic, sizeof(magic), &read); + if (read < sizeof(magic)) + { + if (hr == E_FAIL) hr = S_OK; + break; + } + if (FAILED(hr)) break; if (memcmp(magic, "MTrk", 4) != 0) break; if ((hr = IStream_Read(parser->stream, &length_be, sizeof(length_be), &read)) != S_OK) From 036c3f3d5292ec01f37b834b6b1573b08cacaa82 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Thu, 30 Jan 2025 15:49:52 +0000 Subject: [PATCH 1232/2542] dmime: Connect default collection to MIDI bandtrack. (cherry picked from commit 7d3785175d84a031759657a31d48c6487780f5fb) --- dlls/dmime/midi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/dmime/midi.c b/dlls/dmime/midi.c index 2b01e85c18cf..57fd5b078ad1 100644 --- a/dlls/dmime/midi.c +++ b/dlls/dmime/midi.c @@ -327,8 +327,19 @@ static HRESULT midi_parser_parse(struct midi_parser *parser, IDirectMusicSegment MUSIC_TIME music_length = 0; DMUS_IO_SEQ_ITEM *seq_items = NULL; struct midi_seqtrack_item *item; + DMUS_OBJECTDESC default_desc = + { + .dwSize = sizeof(DMUS_OBJECTDESC), + .dwValidData = DMUS_OBJ_OBJECT | DMUS_OBJ_CLASS, + .guidClass = CLSID_DirectMusicCollection, + .guidObject = GUID_DefaultGMCollection, + }; + IDirectMusicObject *collection = NULL; TRACE("(%p, %p): semi-stub\n", parser, segment); + if (FAILED(hr = stream_get_object(parser->stream, &default_desc, &IID_IDirectMusicCollection, + (void **)&collection))) + WARN("Failed to load default collection from loader, hr %#lx\n", hr); for (i = 0;; i++) { @@ -404,6 +415,7 @@ static HRESULT midi_parser_parse(struct midi_parser *parser, IDirectMusicSegment qsort(seq_items, parser->seqtrack_items_count, sizeof(DMUS_IO_SEQ_ITEM), midi_seqtrack_item_compare); music_length = (ULONGLONG)music_length * DMUS_PPQ / parser->division + 1; + if (collection) IDirectMusicTrack_SetParam(parser->bandtrack, &GUID_ConnectToDLSCollection, 0, collection); if (SUCCEEDED(hr)) hr = IDirectMusicSegment8_SetLength(segment, music_length); if (SUCCEEDED(hr)) hr = IDirectMusicSegment8_InsertTrack(segment, parser->bandtrack, 0xffff); if (SUCCEEDED(hr)) hr = IDirectMusicSegment8_InsertTrack(segment, parser->chordtrack, 0xffff); From b0ddd7dbbe7ced0fde4f2ce4ac8fa9744923385e Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Fri, 7 Feb 2025 21:38:16 +0000 Subject: [PATCH 1233/2542] winegstreamer: Avoid large buffer pushes in wg_transform. This is done by inserting a special "stepper" element behind the parser (if there is one). This element will keep the incoming buffers in a internal queue and not push them downstream immediately. Instead, it gives us control over when we push and how much is pushed. (cherry picked from commit 299cea5d860045fd8174f743b35516172504cd17) --- dlls/winegstreamer/unix_private.h | 8 ++ dlls/winegstreamer/unixlib.c | 3 + dlls/winegstreamer/wg_transform.c | 184 +++++++++++++++++++++++++++++- 3 files changed, 190 insertions(+), 5 deletions(-) diff --git a/dlls/winegstreamer/unix_private.h b/dlls/winegstreamer/unix_private.h index d8fe72b570d4..3b5e0bd96bac 100644 --- a/dlls/winegstreamer/unix_private.h +++ b/dlls/winegstreamer/unix_private.h @@ -46,6 +46,12 @@ extern GList *find_element_factories(GstElementFactoryListType type, GstRank min GstCaps *element_sink_caps, GstCaps *element_src_caps); extern GstElement *find_element(GstElementFactoryListType type, GstCaps *element_sink_caps, GstCaps *element_src_caps); +/* + * Append `element` to `container`, updates the pointer to the first and last elements in the + * pipeline. Returns whether the operation succeeded. + * + * This takes the ownership of `element` whether it succeeded or not. + */ extern bool append_element(GstElement *container, GstElement *element, GstElement **first, GstElement **last); extern bool link_src_to_sink(GstPad *src_pad, GstPad *sink_pad); extern bool link_src_to_element(GstPad *src_pad, GstElement *element); @@ -148,4 +154,6 @@ static inline void touch_h264_used_tag(void) } } +GST_ELEMENT_REGISTER_DECLARE(winegstreamerstepper); + #endif /* __WINE_WINEGSTREAMER_UNIX_PRIVATE_H */ diff --git a/dlls/winegstreamer/unixlib.c b/dlls/winegstreamer/unixlib.c index 95d732da6314..0d1b3b6f65ac 100644 --- a/dlls/winegstreamer/unixlib.c +++ b/dlls/winegstreamer/unixlib.c @@ -350,6 +350,9 @@ NTSTATUS wg_init_gstreamer(void *arg) return STATUS_UNSUCCESSFUL; } + if (!GST_ELEMENT_REGISTER(winegstreamerstepper, NULL)) + GST_ERROR("Failed to register the stepper element"); + return STATUS_SUCCESS; } diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index 78cca8c2d4d2..7c9204de41b4 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -42,11 +42,40 @@ #define GST_SAMPLE_FLAG_WG_CAPS_CHANGED (GST_MINI_OBJECT_FLAG_LAST << 0) +/* This GstElement takes buffers and events from its sink pad, instead of pushing them + * out the src pad, it keeps them in a internal queue until the step function + * is called manually. + */ +typedef struct _WgStepper +{ + GstElement element; + GstPad *src, *sink; + GstAtomicQueue *fifo; +} WgStepper; + +typedef struct _WgStepperClass +{ + GstElementClass parent_class; +} WgStepperClass; + +#define GST_TYPE_WG_STEPPER (wg_stepper_get_type()) +#define WG_STEPPER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_WG_STEPPER, WgStepper)) +#define GST_WG_STEPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_WG_STEPPER,WgStepperClass)) +#define GST_IS_WG_STEPPER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_WG_STEPPER)) +#define GST_IS_WG_STEPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_WG_STEPPER)) + +G_DEFINE_TYPE (WgStepper, wg_stepper, GST_TYPE_ELEMENT); +GST_ELEMENT_REGISTER_DEFINE(winegstreamerstepper, "winegstreamerstepper", GST_RANK_NONE, GST_TYPE_WG_STEPPER); + +static bool wg_stepper_step(WgStepper *stepper); +static void wg_stepper_flush(WgStepper *stepper); + struct wg_transform { struct wg_transform_attrs attrs; GstElement *container; + WgStepper *stepper; GstAllocator *allocator; GstPad *my_src, *my_sink; GstSegment segment; @@ -563,7 +592,18 @@ static bool transform_create_decoder_elements(struct wg_transform *transform, if ((element = find_element(GST_ELEMENT_FACTORY_TYPE_PARSER, transform->input_caps, parsed_caps)) && !append_element(transform->container, element, first, last)) goto done; - else if (!element) + + if (element) + { + /* We try to intercept buffers produced by the parser, so if we push a large buffer into the + * parser, it won't push everything into the decoder all in one go. + */ + if ((element = create_element("winegstreamerstepper", NULL)) && + append_element(transform->container, element, first, last)) + /* element is owned by the container */ + transform->stepper = WG_STEPPER(element); + } + else { gst_caps_unref(parsed_caps); parsed_caps = gst_caps_ref(transform->input_caps); @@ -1098,7 +1138,8 @@ static NTSTATUS read_transform_output(struct wg_sample *sample, GstBuffer *buffe static NTSTATUS complete_drain(struct wg_transform *transform) { - if (transform->draining && gst_atomic_queue_length(transform->input_queue) == 0) + bool stepper_empty = transform->stepper == NULL || gst_atomic_queue_length(transform->stepper->fifo) == 0; + if (transform->draining && gst_atomic_queue_length(transform->input_queue) == 0 && stepper_empty) { GstEvent *event; transform->draining = false; @@ -1125,14 +1166,23 @@ static NTSTATUS complete_drain(struct wg_transform *transform) static bool get_transform_output(struct wg_transform *transform, struct wg_sample *sample) { - GstBuffer *input_buffer; GstFlowReturn ret; wg_allocator_provide_sample(transform->allocator, sample); - while (!(transform->output_sample = gst_atomic_queue_pop(transform->output_queue)) - && (input_buffer = gst_atomic_queue_pop(transform->input_queue))) + while (!(transform->output_sample = gst_atomic_queue_pop(transform->output_queue))) { + GstBuffer *input_buffer; + if (transform->stepper && wg_stepper_step(transform->stepper)) + { + /* If we pushed anything from the stepper, we don't need to dequeue more buffers. */ + complete_drain(transform); + continue; + } + + if (!(input_buffer = gst_atomic_queue_pop(transform->input_queue))) + break; + if ((ret = gst_pad_push(transform->my_src, input_buffer))) GST_WARNING("Failed to push transform input, error %d", ret); @@ -1272,6 +1322,9 @@ NTSTATUS wg_transform_flush(void *args) while ((input_buffer = gst_atomic_queue_pop(transform->input_queue))) gst_buffer_unref(input_buffer); + if (transform->stepper) + wg_stepper_flush(transform->stepper); + if ((status = wg_transform_drain(args))) return status; @@ -1311,3 +1364,124 @@ NTSTATUS wg_transform_notify_qos(void *args) return S_OK; } + +/* Move events and at most one buffer from the internal fifo queue to the output src pad. + * Returns true if anything is moved, or false if the fifo is empty. + */ +static bool wg_stepper_step(WgStepper *stepper) +{ + bool pushed = false; + gpointer ptr; + while ((ptr = gst_atomic_queue_pop(stepper->fifo))) + { + if (GST_IS_BUFFER(ptr)) + { + GST_TRACE("Forwarding buffer %"GST_PTR_FORMAT" from fifo", ptr); + gst_pad_push(stepper->src, GST_BUFFER(ptr)); + pushed = true; + break; + } + + if (GST_IS_EVENT(ptr)) + { + GST_TRACE("Processing event %"GST_PTR_FORMAT" from fifo", ptr); + gst_pad_event_default(stepper->sink, GST_OBJECT(stepper), GST_EVENT(ptr)); + pushed = true; + } + } + return pushed; +} + +static void wg_stepper_flush(WgStepper *stepper) +{ + gpointer ptr; + GST_TRACE("Discarding all objects in the fifo"); + while ((ptr = gst_atomic_queue_pop(stepper->fifo))) + { + if (GST_IS_EVENT(ptr)) + gst_event_unref(ptr); + else if (GST_IS_BUFFER(ptr)) + gst_buffer_unref(ptr); + } +} + +static GstStateChangeReturn wg_stepper_change_state(GstElement *element, GstStateChange transition) +{ + WgStepper *this = WG_STEPPER(element); + if (transition == GST_STATE_CHANGE_READY_TO_NULL) + wg_stepper_flush(this); + return GST_STATE_CHANGE_SUCCESS; +} + +static void wg_stepper_class_init(WgStepperClass *klass) +{ + gst_element_class_set_metadata(GST_ELEMENT_CLASS(klass), "winegstreamer buffer stepper", "Connector", + "Hold incoming buffer for manual pushing", "Yuxuan Shui "); + klass->parent_class.change_state = wg_stepper_change_state; +} + +static GstFlowReturn wg_stepper_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *buf) +{ + WgStepper *this = WG_STEPPER(parent); + GST_TRACE("Pushing buffer %"GST_PTR_FORMAT" into fifo", buf); + gst_atomic_queue_push(this->fifo, buf); + return GST_FLOW_OK; +} + +static gboolean wg_stepper_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +{ + WgStepper *this = WG_STEPPER(parent); + if (gst_atomic_queue_length(this->fifo) == 0) + { + GST_TRACE("Processing event %"GST_PTR_FORMAT" immediately", event); + gst_pad_event_default(pad, parent, event); + } + else + { + GST_TRACE("Pushing event %"GST_PTR_FORMAT" into fifo", event); + gst_atomic_queue_push(this->fifo, event); + } + return true; +} + +static gboolean wg_stepper_src_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) +{ + WgStepper *this = WG_STEPPER(parent); + GstPad *peer = gst_pad_get_peer(this->sink); + if (!peer) return gst_pad_query_default(pad, parent, query); + GST_TRACE("Forwarding query %"GST_PTR_FORMAT" to upstream", query); + return gst_pad_query(peer, query); +} + +static void wg_stepper_init(WgStepper *stepper) +{ + static GstStaticPadTemplate sink_factory = + GST_STATIC_PAD_TEMPLATE ( + "sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("ANY") + ); + static GstStaticPadTemplate src_factory = + GST_STATIC_PAD_TEMPLATE( + "src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS("ANY") + ); + stepper->sink = gst_pad_new_from_static_template(&sink_factory, "sink"); + gst_element_add_pad(GST_ELEMENT(stepper), stepper->sink); + gst_pad_set_chain_function(stepper->sink, wg_stepper_chain_cb); + gst_pad_set_event_function(stepper->sink, wg_stepper_event_cb); + GST_PAD_SET_PROXY_CAPS(stepper->sink); + gst_pad_set_active(stepper->sink, true); + + stepper->src = gst_pad_new_from_static_template(&src_factory, "src"); + gst_element_add_pad(GST_ELEMENT(stepper), stepper->src); + gst_pad_set_query_function(stepper->src, wg_stepper_src_query_cb); + gst_pad_set_active(stepper->src, true); + + stepper->fifo = gst_atomic_queue_new(4); + + GST_DEBUG("Created new stepper element %"GST_PTR_FORMAT, stepper); +} From ae8d07283e7ba881437c37a120ba657718de5d84 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Mon, 24 Feb 2025 14:38:56 +1100 Subject: [PATCH 1234/2542] mp3dmod/tests: Add tests for selecting an invalid stream. (cherry picked from commit 9f0883c6a0eb37c61743561f42de8f22258e73cd) CW-Bug-Id: #24502 --- dlls/mp3dmod/tests/mp3dmod.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/dlls/mp3dmod/tests/mp3dmod.c b/dlls/mp3dmod/tests/mp3dmod.c index 7d213fcd18a0..dd1d6171f553 100644 --- a/dlls/mp3dmod/tests/mp3dmod.c +++ b/dlls/mp3dmod/tests/mp3dmod.c @@ -171,7 +171,11 @@ static void test_convert(void) for (i = 0; i < 5; i++) memcpy(inbuf.data + 96 * i, mp3hdr, 4); inbuf.len = 96 * 5; + hr = IMediaObject_ProcessInput(dmo, 1, &inbuf.IMediaBuffer_iface, 0, 0, 0); + todo_wine + ok(hr == DMO_E_INVALIDSTREAMINDEX, "got %#lx\n", hr); hr = IMediaObject_ProcessInput(dmo, 0, &inbuf.IMediaBuffer_iface, 0, 0, 0); + todo_wine ok(hr == S_OK, "got %#lx\n", hr); ok(inbuf.refcount == 2, "Got refcount %ld.\n", inbuf.refcount); @@ -425,6 +429,13 @@ static void test_stream_info(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); ok(!flags, "Got flags %#lx.\n", flags); + hr = IMediaObject_GetInputSizeInfo(dmo, 1, &size, &lookahead, &alignment); + todo_wine + ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); + hr = IMediaObject_GetOutputSizeInfo(dmo, 1, &size, &alignment); + todo_wine + ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); + hr = IMediaObject_GetInputSizeInfo(dmo, 0, &size, &lookahead, &alignment); ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#lx.\n", hr); hr = IMediaObject_GetOutputSizeInfo(dmo, 0, &size, &alignment); @@ -524,6 +535,9 @@ static void test_media_types(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); memset(&mt, 0xcc, sizeof(DMO_MEDIA_TYPE)); + hr = IMediaObject_GetInputType(dmo, 1, 0, &mt); + todo_wine + ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); hr = IMediaObject_GetInputType(dmo, 0, 0, &mt); ok(hr == S_OK, "Got hr %#lx.\n", hr); ok(IsEqualGUID(&mt.majortype, &MEDIATYPE_Audio), "Got major type %s.\n", wine_dbgstr_guid(&mt.majortype)); @@ -541,9 +555,19 @@ static void test_media_types(void) ok(hr == DMO_E_NO_MORE_ITEMS, "Got hr %#lx.\n", hr); memset(&mt, 0xcc, sizeof(DMO_MEDIA_TYPE)); + hr = IMediaObject_GetOutputType(dmo, 1, 0, &mt); + todo_wine + ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); hr = IMediaObject_GetOutputType(dmo, 0, 0, &mt); ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#lx.\n", hr); + hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); + todo_wine + ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#lx.\n", hr); + + hr = IMediaObject_SetInputType(dmo, 1, &input_mt, DMO_SET_TYPEF_TEST_ONLY); + todo_wine + ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); hr = IMediaObject_SetInputType(dmo, 0, &input_mt, DMO_SET_TYPEF_TEST_ONLY); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -634,6 +658,10 @@ static void test_media_types(void) hr = IMediaObject_GetOutputType(dmo, 0, 2, &mt); ok(hr == DMO_E_NO_MORE_ITEMS, "Got hr %#lx.\n", hr); + hr = IMediaObject_SetOutputType(dmo, 1, &output_mt, DMO_SET_TYPEF_TEST_ONLY); + todo_wine + ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); + hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); ok(hr == S_OK, "Got hr %#lx.\n", hr); From 8ce57c9f2db8b9c103caaa386af0b59f41064a96 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Mon, 24 Feb 2025 14:54:12 +1100 Subject: [PATCH 1235/2542] mp3dmod: Check for invalid stream. (cherry picked from commit 5b12f945b2f8e8729e1900a2bd51d4878d197548) CW-Bug-Id: #24502 --- dlls/mp3dmod/mp3dmod.c | 24 ++++++++++++++++++++++++ dlls/mp3dmod/tests/mp3dmod.c | 9 --------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index 842be5889dab..830e94353e9c 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -171,6 +171,9 @@ static HRESULT WINAPI MediaObject_GetInputType(IMediaObject *iface, DWORD index, { TRACE("iface %p, index %lu, type_index %lu, type %p.\n", iface, index, type_index, type); + if (index) + return DMO_E_INVALIDSTREAMINDEX; + if (type_index) return DMO_E_NO_MORE_ITEMS; @@ -192,6 +195,9 @@ static HRESULT WINAPI MediaObject_GetOutputType(IMediaObject *iface, DWORD index TRACE("iface %p, index %lu, type_index %lu, type %p.\n", iface, index, type_index, type); + if (index) + return DMO_E_INVALIDSTREAMINDEX; + if (!dmo->intype_set) return DMO_E_TYPE_NOT_SET; @@ -225,6 +231,9 @@ static HRESULT WINAPI MediaObject_SetInputType(IMediaObject *iface, DWORD index, TRACE("iface %p, index %lu, type %p, flags %#lx.\n", iface, index, type, flags); + if (index) + return DMO_E_INVALIDSTREAMINDEX; + if (flags & DMO_SET_TYPEF_CLEAR) { if (dmo->intype_set) @@ -258,6 +267,12 @@ static HRESULT WINAPI MediaObject_SetOutputType(IMediaObject *iface, DWORD index TRACE("(%p)->(%ld, %p, %#lx)\n", iface, index, type, flags); + if (index) + return DMO_E_INVALIDSTREAMINDEX; + + if (!This->intype_set) + return DMO_E_TYPE_NOT_SET; + if (flags & DMO_SET_TYPEF_CLEAR) { MoFreeMediaType(&This->outtype); @@ -317,6 +332,9 @@ static HRESULT WINAPI MediaObject_GetInputSizeInfo(IMediaObject *iface, TRACE("iface %p, index %lu, size %p, lookahead %p, alignment %p.\n", iface, index, size, lookahead, alignment); + if (index) + return DMO_E_INVALIDSTREAMINDEX; + if (!dmo->intype_set || !dmo->outtype_set) return DMO_E_TYPE_NOT_SET; @@ -331,6 +349,9 @@ static HRESULT WINAPI MediaObject_GetOutputSizeInfo(IMediaObject *iface, DWORD i TRACE("iface %p, index %lu, size %p, alignment %p.\n", iface, index, size, alignment); + if (index) + return DMO_E_INVALIDSTREAMINDEX; + if (!dmo->intype_set || !dmo->outtype_set) return DMO_E_TYPE_NOT_SET; @@ -411,6 +432,9 @@ static HRESULT WINAPI MediaObject_ProcessInput(IMediaObject *iface, DWORD index, TRACE("(%p)->(%ld, %p, %#lx, %s, %s)\n", iface, index, buffer, flags, wine_dbgstr_longlong(timestamp), wine_dbgstr_longlong(timelength)); + if (index) + return DMO_E_INVALIDSTREAMINDEX; + if (This->buffer) { ERR("Already have a buffer.\n"); diff --git a/dlls/mp3dmod/tests/mp3dmod.c b/dlls/mp3dmod/tests/mp3dmod.c index dd1d6171f553..ee59631f0443 100644 --- a/dlls/mp3dmod/tests/mp3dmod.c +++ b/dlls/mp3dmod/tests/mp3dmod.c @@ -172,10 +172,8 @@ static void test_convert(void) memcpy(inbuf.data + 96 * i, mp3hdr, 4); inbuf.len = 96 * 5; hr = IMediaObject_ProcessInput(dmo, 1, &inbuf.IMediaBuffer_iface, 0, 0, 0); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "got %#lx\n", hr); hr = IMediaObject_ProcessInput(dmo, 0, &inbuf.IMediaBuffer_iface, 0, 0, 0); - todo_wine ok(hr == S_OK, "got %#lx\n", hr); ok(inbuf.refcount == 2, "Got refcount %ld.\n", inbuf.refcount); @@ -430,10 +428,8 @@ static void test_stream_info(void) ok(!flags, "Got flags %#lx.\n", flags); hr = IMediaObject_GetInputSizeInfo(dmo, 1, &size, &lookahead, &alignment); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); hr = IMediaObject_GetOutputSizeInfo(dmo, 1, &size, &alignment); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); hr = IMediaObject_GetInputSizeInfo(dmo, 0, &size, &lookahead, &alignment); @@ -536,7 +532,6 @@ static void test_media_types(void) memset(&mt, 0xcc, sizeof(DMO_MEDIA_TYPE)); hr = IMediaObject_GetInputType(dmo, 1, 0, &mt); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); hr = IMediaObject_GetInputType(dmo, 0, 0, &mt); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -556,17 +551,14 @@ static void test_media_types(void) memset(&mt, 0xcc, sizeof(DMO_MEDIA_TYPE)); hr = IMediaObject_GetOutputType(dmo, 1, 0, &mt); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); hr = IMediaObject_GetOutputType(dmo, 0, 0, &mt); ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#lx.\n", hr); hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); - todo_wine ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#lx.\n", hr); hr = IMediaObject_SetInputType(dmo, 1, &input_mt, DMO_SET_TYPEF_TEST_ONLY); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); hr = IMediaObject_SetInputType(dmo, 0, &input_mt, DMO_SET_TYPEF_TEST_ONLY); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -659,7 +651,6 @@ static void test_media_types(void) ok(hr == DMO_E_NO_MORE_ITEMS, "Got hr %#lx.\n", hr); hr = IMediaObject_SetOutputType(dmo, 1, &output_mt, DMO_SET_TYPEF_TEST_ONLY); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); From 814d3c1c2e8b0829e0e5191d5a15c189e83cfd01 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Mon, 24 Feb 2025 17:33:51 +1100 Subject: [PATCH 1236/2542] mp3dmod/tests: Add tests for GetInputCurrentType. (cherry picked from commit 13eafd852d57338de11419bd7290ab02243ebfd9) CW-Bug-Id: #24502 --- dlls/mp3dmod/tests/mp3dmod.c | 75 ++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/dlls/mp3dmod/tests/mp3dmod.c b/dlls/mp3dmod/tests/mp3dmod.c index ee59631f0443..f7ecf6943bcb 100644 --- a/dlls/mp3dmod/tests/mp3dmod.c +++ b/dlls/mp3dmod/tests/mp3dmod.c @@ -40,6 +40,49 @@ static REFERENCE_TIME samplelen(DWORD samples, int rate) return (REFERENCE_TIME) 10000000 * samples / rate; } +#define check_member_(line, val, exp, fmt, member) \ + ok_ (__FILE__, line)((val).member == (exp).member, "Got " #member " " fmt ", expected " fmt ".\n", (val).member, (exp).member) +#define check_member(val, exp, fmt, member) check_member_(__LINE__, val, exp, fmt, member) + +#define check_wave_format(a, b) check_wave_format_(__LINE__, a, b) +static void check_wave_format_(int line, WAVEFORMATEX *info, const WAVEFORMATEX *expected) +{ + check_member_(line, *info, *expected, "%#x", wFormatTag); + check_member_(line, *info, *expected, "%u", nChannels); + check_member_(line, *info, *expected, "%lu", nSamplesPerSec); + check_member_(line, *info, *expected, "%lu", nAvgBytesPerSec); + check_member_(line, *info, *expected, "%u", nBlockAlign); + check_member_(line, *info, *expected, "%u", wBitsPerSample); + check_member_(line, *info, *expected, "%u", cbSize); +} + +#define check_dmo_media_type(a, b) check_dmo_media_type_(__LINE__, a, b) +static void check_dmo_media_type_(int line, DMO_MEDIA_TYPE *media_type, const DMO_MEDIA_TYPE *expected) +{ + ok_(__FILE__, line)(IsEqualGUID(&media_type->majortype, &expected->majortype), + "Got unexpected majortype %s, expected %s.\n", + debugstr_guid(&media_type->majortype), debugstr_guid(&expected->majortype)); + ok_(__FILE__, line)(IsEqualGUID(&media_type->subtype, &expected->subtype), + "Got unexpected subtype %s, expected %s.\n", + debugstr_guid(&media_type->subtype), debugstr_guid(&expected->subtype)); + ok_(__FILE__, line)(IsEqualGUID(&media_type->formattype, &expected->formattype), + "Got unexpected formattype %s.\n", + debugstr_guid(&media_type->formattype)); + ok_(__FILE__, line)(media_type->pUnk == NULL, "Got unexpected pUnk %p.\n", media_type->pUnk); + check_member_(line, *media_type, *expected, "%lu", cbFormat); + + if (expected->pbFormat) + { + ok_(__FILE__, line)(!!media_type->pbFormat, "Got NULL pbFormat.\n"); + if (!media_type->pbFormat) + return; + + if (IsEqualGUID(&media_type->formattype, &FORMAT_WaveFormatEx) + && IsEqualGUID(&expected->formattype, &FORMAT_WaveFormatEx)) + check_wave_format((WAVEFORMATEX *)media_type->pbFormat, (WAVEFORMATEX *)expected->pbFormat); + } +} + struct test_buffer { IMediaBuffer IMediaBuffer_iface; @@ -558,11 +601,23 @@ static void test_media_types(void) hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#lx.\n", hr); + hr = IMediaObject_GetInputCurrentType(dmo, 1, &mt); + todo_wine + ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); + + hr = IMediaObject_GetInputCurrentType(dmo, 0, &mt); + todo_wine + ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#lx.\n", hr); + hr = IMediaObject_SetInputType(dmo, 1, &input_mt, DMO_SET_TYPEF_TEST_ONLY); ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); hr = IMediaObject_SetInputType(dmo, 0, &input_mt, DMO_SET_TYPEF_TEST_ONLY); ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IMediaObject_GetInputCurrentType(dmo, 0, &mt); + todo_wine + ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#lx.\n", hr); + input_mt.majortype = GUID_NULL; hr = IMediaObject_SetInputType(dmo, 0, &input_mt, DMO_SET_TYPEF_TEST_ONLY); ok(hr == DMO_E_TYPE_NOT_ACCEPTED, "Got hr %#lx.\n", hr); @@ -590,6 +645,16 @@ static void test_media_types(void) hr = IMediaObject_SetInputType(dmo, 0, &input_mt, 0); ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IMediaObject_GetInputCurrentType(dmo, 0, &mt); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + if (hr == S_OK) + { + check_dmo_media_type(&mt, &input_mt); + MoFreeMediaType(&mt); + } + for (i = 0; i < 4; ++i) { memset(&mt, 0xcc, sizeof(DMO_MEDIA_TYPE)); @@ -622,6 +687,16 @@ static void test_media_types(void) hr = IMediaObject_SetInputType(dmo, 0, &input_mt, 0); ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IMediaObject_GetInputCurrentType(dmo, 0, &mt); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + if (hr == S_OK) + { + check_dmo_media_type(&mt, &input_mt); + MoFreeMediaType(&mt); + } + for (i = 0; i < 2; ++i) { memset(&mt, 0xcc, sizeof(DMO_MEDIA_TYPE)); From a1830bc4b12ca5bedc0290759c66527c8efbdf4c Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Mon, 24 Feb 2025 17:38:55 +1100 Subject: [PATCH 1237/2542] mp3dmod/tests: Add tests for GetOutputCurrentType. (cherry picked from commit daac091bf811773231cc445b021e2781b5c32579) CW-Bug-Id: #24502 --- dlls/mp3dmod/tests/mp3dmod.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/dlls/mp3dmod/tests/mp3dmod.c b/dlls/mp3dmod/tests/mp3dmod.c index f7ecf6943bcb..8b82e9509aff 100644 --- a/dlls/mp3dmod/tests/mp3dmod.c +++ b/dlls/mp3dmod/tests/mp3dmod.c @@ -728,9 +728,21 @@ static void test_media_types(void) hr = IMediaObject_SetOutputType(dmo, 1, &output_mt, DMO_SET_TYPEF_TEST_ONLY); ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); + hr = IMediaObject_GetOutputCurrentType(dmo, 1, &mt); + todo_wine + ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); + + hr = IMediaObject_GetOutputCurrentType(dmo, 0, &mt); + todo_wine + ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#lx.\n", hr); + hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IMediaObject_GetOutputCurrentType(dmo, 0, &mt); + todo_wine + ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#lx.\n", hr); + output_mt.formattype = GUID_NULL; hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); ok(hr == DMO_E_TYPE_NOT_ACCEPTED, "Got hr %#lx.\n", hr); @@ -739,6 +751,19 @@ static void test_media_types(void) ok(hr == DMO_E_TYPE_NOT_ACCEPTED, "Got hr %#lx.\n", hr); output_mt.formattype = FORMAT_WaveFormatEx; + hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, 0); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IMediaObject_GetOutputCurrentType(dmo, 0, &mt); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + if (hr == S_OK) + { + check_dmo_media_type(&mt, &output_mt); + MoFreeMediaType(&mt); + } + IMediaObject_Release(dmo); } From d95c195a21b0223bdd046185754d162e556418ed Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Mon, 24 Feb 2025 17:50:15 +1100 Subject: [PATCH 1238/2542] mp3dmod: Implement GetInputCurrentType. (cherry picked from commit 8da51968d120e7717e8d16d437a910fae2d06e13) CW-Bug-Id: #24502 --- dlls/mp3dmod/mp3dmod.c | 13 +++++++++++-- dlls/mp3dmod/tests/mp3dmod.c | 19 ++++--------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index 830e94353e9c..4cdb92ce0b04 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -313,9 +313,18 @@ static HRESULT WINAPI MediaObject_SetOutputType(IMediaObject *iface, DWORD index static HRESULT WINAPI MediaObject_GetInputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *type) { - FIXME("(%p)->(%ld, %p) stub!\n", iface, index, type); + struct mp3_decoder *dmo = impl_from_IMediaObject(iface); + TRACE("(%p)->(%ld, %p)\n", iface, index, type); - return E_NOTIMPL; + if (index) + return DMO_E_INVALIDSTREAMINDEX; + + if (!dmo->intype_set) + return DMO_E_TYPE_NOT_SET; + + MoCopyMediaType(type, &dmo->intype); + + return S_OK; } static HRESULT WINAPI MediaObject_GetOutputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *type) diff --git a/dlls/mp3dmod/tests/mp3dmod.c b/dlls/mp3dmod/tests/mp3dmod.c index 8b82e9509aff..75ad52c4f216 100644 --- a/dlls/mp3dmod/tests/mp3dmod.c +++ b/dlls/mp3dmod/tests/mp3dmod.c @@ -602,11 +602,9 @@ static void test_media_types(void) ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 1, &mt); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 0, &mt); - todo_wine ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#lx.\n", hr); hr = IMediaObject_SetInputType(dmo, 1, &input_mt, DMO_SET_TYPEF_TEST_ONLY); @@ -615,7 +613,6 @@ static void test_media_types(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 0, &mt); - todo_wine ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#lx.\n", hr); input_mt.majortype = GUID_NULL; @@ -646,14 +643,10 @@ static void test_media_types(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 0, &mt); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr == S_OK) - { - check_dmo_media_type(&mt, &input_mt); - MoFreeMediaType(&mt); - } + check_dmo_media_type(&mt, &input_mt); + MoFreeMediaType(&mt); for (i = 0; i < 4; ++i) { @@ -688,14 +681,10 @@ static void test_media_types(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IMediaObject_GetInputCurrentType(dmo, 0, &mt); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr == S_OK) - { - check_dmo_media_type(&mt, &input_mt); - MoFreeMediaType(&mt); - } + check_dmo_media_type(&mt, &input_mt); + MoFreeMediaType(&mt); for (i = 0; i < 2; ++i) { From 043d84743d117818852266e06b7b1d70459d648d Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Mon, 24 Feb 2025 17:50:54 +1100 Subject: [PATCH 1239/2542] mp3dmod: Implement GetOutputCurrentType. (cherry picked from commit ce0903437654a8df96249f765bc6c40b48755be0) CW-Bug-Id: #24502 --- dlls/mp3dmod/mp3dmod.c | 13 +++++++++++-- dlls/mp3dmod/tests/mp3dmod.c | 11 ++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index 4cdb92ce0b04..93a2a1a4d8f2 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -329,9 +329,18 @@ static HRESULT WINAPI MediaObject_GetInputCurrentType(IMediaObject *iface, DWORD static HRESULT WINAPI MediaObject_GetOutputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *type) { - FIXME("(%p)->(%ld, %p) stub!\n", iface, index, type); + struct mp3_decoder *dmo = impl_from_IMediaObject(iface); + TRACE("(%p)->(%ld, %p)\n", iface, index, type); - return E_NOTIMPL; + if (index) + return DMO_E_INVALIDSTREAMINDEX; + + if (!dmo->outtype_set) + return DMO_E_TYPE_NOT_SET; + + MoCopyMediaType(type, &dmo->outtype); + + return S_OK; } static HRESULT WINAPI MediaObject_GetInputSizeInfo(IMediaObject *iface, diff --git a/dlls/mp3dmod/tests/mp3dmod.c b/dlls/mp3dmod/tests/mp3dmod.c index 75ad52c4f216..107533e63169 100644 --- a/dlls/mp3dmod/tests/mp3dmod.c +++ b/dlls/mp3dmod/tests/mp3dmod.c @@ -718,18 +718,15 @@ static void test_media_types(void) ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 1, &mt); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, &mt); - todo_wine ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#lx.\n", hr); hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, &mt); - todo_wine ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#lx.\n", hr); output_mt.formattype = GUID_NULL; @@ -744,14 +741,10 @@ static void test_media_types(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IMediaObject_GetOutputCurrentType(dmo, 0, &mt); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr == S_OK) - { - check_dmo_media_type(&mt, &output_mt); - MoFreeMediaType(&mt); - } + check_dmo_media_type(&mt, &output_mt); + MoFreeMediaType(&mt); IMediaObject_Release(dmo); } From 2c0fca66c7887a4b52d9a42404073c62b0693695 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Mon, 24 Feb 2025 17:56:58 +1100 Subject: [PATCH 1240/2542] mp3dmod: Fix leak of previous outtype. (cherry picked from commit 4c06d354b8093a8979316186474213bbc1c68904) CW-Bug-Id: #24502 --- dlls/mp3dmod/mp3dmod.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index 93a2a1a4d8f2..55a5b2f59336 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -304,6 +304,8 @@ static HRESULT WINAPI MediaObject_SetOutputType(IMediaObject *iface, DWORD index format->nChannels, format->nSamplesPerSec, format->wBitsPerSample); return DMO_E_TYPE_NOT_ACCEPTED; } + if (This->outtype_set) + MoFreeMediaType(&This->outtype); MoCopyMediaType(&This->outtype, type); This->outtype_set = TRUE; } From 33a7ca88ab67845ee1fe2159b71d794ddc6e4d54 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Tue, 25 Feb 2025 09:43:10 +1100 Subject: [PATCH 1241/2542] mfplat/tests: Add additional MFCreateWaveFormatExFromMFMediaType tests. Test additional subtypes without MF_MT_USER_DATA. (cherry picked from commit 8a761e0a321418274d15dbfb02681c3c08c58981) CW-Bug-Id: #24502 --- dlls/mfplat/tests/mfplat.c | 40 +++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index fe495a961cd2..3425c4e35f96 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -5930,11 +5930,17 @@ static void test_MFCreateWaveFormatExFromMFMediaType(void) { const GUID *subtype; WORD format_tag; + UINT32 size; + WORD size_field; + BOOL todo; + BOOL todo_size; } wave_fmt_tests[] = { - { &MFAudioFormat_PCM, WAVE_FORMAT_PCM, }, - { &MFAudioFormat_Float, WAVE_FORMAT_IEEE_FLOAT, }, + { &MFAudioFormat_PCM, WAVE_FORMAT_PCM, sizeof(WAVEFORMATEX), 0, }, + { &MFAudioFormat_Float, WAVE_FORMAT_IEEE_FLOAT, sizeof(WAVEFORMATEX), 0, }, + { &MFAudioFormat_MP3, WAVE_FORMAT_MPEGLAYER3, sizeof(WAVEFORMATEX), 0, TRUE, }, + { &DUMMY_GUID3, WAVE_FORMAT_EXTENSIBLE, sizeof(WAVEFORMATEXTENSIBLE), 22, TRUE, TRUE, }, }; WAVEFORMATEXTENSIBLE *format_ext; IMFMediaType *mediatype; @@ -5962,27 +5968,35 @@ static void test_MFCreateWaveFormatExFromMFMediaType(void) for (i = 0; i < ARRAY_SIZE(wave_fmt_tests); ++i) { + winetest_push_context("test %d", i); hr = IMFMediaType_SetGUID(mediatype, &MF_MT_SUBTYPE, wave_fmt_tests[i].subtype); ok(hr == S_OK, "Failed to set attribute, hr %#lx.\n", hr); hr = MFCreateWaveFormatExFromMFMediaType(mediatype, &format, &size, MFWaveFormatExConvertFlag_Normal); + todo_wine_if(wave_fmt_tests[i].todo) ok(hr == S_OK, "Failed to create format, hr %#lx.\n", hr); ok(format != NULL, "Expected format structure.\n"); - ok(size == sizeof(*format), "Unexpected size %u.\n", size); + todo_wine_if(wave_fmt_tests[i].todo_size) + ok(size == wave_fmt_tests[i].size, "Unexpected size %u.\n", size); + todo_wine_if(wave_fmt_tests[i].todo) ok(format->wFormatTag == wave_fmt_tests[i].format_tag, "Expected tag %u, got %u.\n", wave_fmt_tests[i].format_tag, format->wFormatTag); ok(format->nChannels == 0, "Unexpected number of channels, %u.\n", format->nChannels); ok(format->nSamplesPerSec == 0, "Unexpected sample rate, %lu.\n", format->nSamplesPerSec); ok(format->nAvgBytesPerSec == 0, "Unexpected average data rate rate, %lu.\n", format->nAvgBytesPerSec); ok(format->nBlockAlign == 0, "Unexpected alignment, %u.\n", format->nBlockAlign); ok(format->wBitsPerSample == 0, "Unexpected sample size, %u.\n", format->wBitsPerSample); - ok(format->cbSize == 0, "Unexpected size field, %u.\n", format->cbSize); + todo_wine_if(wave_fmt_tests[i].todo_size) + ok(format->cbSize == wave_fmt_tests[i].size_field, "Unexpected size field, %u.\n", format->cbSize); CoTaskMemFree(format); hr = MFCreateWaveFormatExFromMFMediaType(mediatype, (WAVEFORMATEX **)&format_ext, &size, MFWaveFormatExConvertFlag_ForceExtensible); + todo_wine_if(wave_fmt_tests[i].todo) ok(hr == S_OK, "Failed to create format, hr %#lx.\n", hr); ok(format_ext != NULL, "Expected format structure.\n"); + todo_wine_if(wave_fmt_tests[i].todo) ok(size == sizeof(*format_ext), "Unexpected size %u.\n", size); + todo_wine_if(wave_fmt_tests[i].todo) ok(format_ext->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE, "Unexpected tag.\n"); ok(format_ext->Format.nChannels == 0, "Unexpected number of channels, %u.\n", format_ext->Format.nChannels); ok(format_ext->Format.nSamplesPerSec == 0, "Unexpected sample rate, %lu.\n", format_ext->Format.nSamplesPerSec); @@ -5990,14 +6004,18 @@ static void test_MFCreateWaveFormatExFromMFMediaType(void) format_ext->Format.nAvgBytesPerSec); ok(format_ext->Format.nBlockAlign == 0, "Unexpected alignment, %u.\n", format_ext->Format.nBlockAlign); ok(format_ext->Format.wBitsPerSample == 0, "Unexpected sample size, %u.\n", format_ext->Format.wBitsPerSample); + todo_wine_if(wave_fmt_tests[i].todo) ok(format_ext->Format.cbSize == sizeof(*format_ext) - sizeof(format_ext->Format), "Unexpected size field, %u.\n", format_ext->Format.cbSize); CoTaskMemFree(format_ext); hr = MFCreateWaveFormatExFromMFMediaType(mediatype, &format, &size, MFWaveFormatExConvertFlag_ForceExtensible + 1); + todo_wine_if(wave_fmt_tests[i].todo) ok(hr == S_OK, "Failed to create format, hr %#lx.\n", hr); - ok(size == sizeof(*format), "Unexpected size %u.\n", size); + todo_wine_if(wave_fmt_tests[i].todo_size) + ok(size == wave_fmt_tests[i].size, "Unexpected size %u.\n", size); CoTaskMemFree(format); + winetest_pop_context(); } IMFMediaType_Release(mediatype); @@ -8485,6 +8503,18 @@ static void test_MFInitAMMediaTypeFromMFMediaType(void) ok(IsEqualGUID(&am_type.formattype, &FORMAT_MPEG2Video), "got %s.\n", debugstr_guid(&am_type.formattype)); ok(am_type.cbFormat == sizeof(MPEG2VIDEOINFO), "got %lu\n", am_type.cbFormat); CoTaskMemFree(am_type.pbFormat); + IMFMediaType_DeleteAllItems(media_type); + + /* test audio with NULL mapping */ + hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFAudioFormat_MP3); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_NUM_CHANNELS, 2); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = MFInitAMMediaTypeFromMFMediaType(media_type, GUID_NULL, &am_type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + IMFMediaType_DeleteAllItems(media_type); /* test WAVEFORMATEX mapping */ From eed88218bd6c2932357e0e832e9865fbec24e7fb Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Tue, 25 Feb 2025 09:44:59 +1100 Subject: [PATCH 1242/2542] mfplat: Allow MF_MT_USER_DATA to be missing for all subtypes. (cherry picked from commit e1230199378b4e307c28599c4cc7d07e45c8ee81) CW-Bug-Id: #24502 --- dlls/mfplat/mediatype.c | 4 ---- dlls/mfplat/tests/mfplat.c | 17 ++--------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index 916ab77408d3..ed68a3e4ff3b 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -3005,11 +3005,7 @@ HRESULT WINAPI MFCreateWaveFormatExFromMFMediaType(IMFMediaType *mediatype, WAVE return E_INVALIDARG; if (FAILED(hr = IMFMediaType_GetBlobSize(mediatype, &MF_MT_USER_DATA, &user_size))) - { - if (!IsEqualGUID(&subtype, &MFAudioFormat_PCM) && !IsEqualGUID(&subtype, &MFAudioFormat_Float)) - return hr; user_size = 0; - } if (media_type_get_uint32(mediatype, &MF_MT_AUDIO_NUM_CHANNELS) > 2 && SUCCEEDED(IMFMediaType_GetItem(mediatype, &MF_MT_AUDIO_CHANNEL_MASK, NULL))) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 3425c4e35f96..d42aee20b2cf 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -5932,15 +5932,13 @@ static void test_MFCreateWaveFormatExFromMFMediaType(void) WORD format_tag; UINT32 size; WORD size_field; - BOOL todo; - BOOL todo_size; } wave_fmt_tests[] = { { &MFAudioFormat_PCM, WAVE_FORMAT_PCM, sizeof(WAVEFORMATEX), 0, }, { &MFAudioFormat_Float, WAVE_FORMAT_IEEE_FLOAT, sizeof(WAVEFORMATEX), 0, }, - { &MFAudioFormat_MP3, WAVE_FORMAT_MPEGLAYER3, sizeof(WAVEFORMATEX), 0, TRUE, }, - { &DUMMY_GUID3, WAVE_FORMAT_EXTENSIBLE, sizeof(WAVEFORMATEXTENSIBLE), 22, TRUE, TRUE, }, + { &MFAudioFormat_MP3, WAVE_FORMAT_MPEGLAYER3, sizeof(WAVEFORMATEX), 0, }, + { &DUMMY_GUID3, WAVE_FORMAT_EXTENSIBLE, sizeof(WAVEFORMATEXTENSIBLE), 22, }, }; WAVEFORMATEXTENSIBLE *format_ext; IMFMediaType *mediatype; @@ -5973,30 +5971,23 @@ static void test_MFCreateWaveFormatExFromMFMediaType(void) ok(hr == S_OK, "Failed to set attribute, hr %#lx.\n", hr); hr = MFCreateWaveFormatExFromMFMediaType(mediatype, &format, &size, MFWaveFormatExConvertFlag_Normal); - todo_wine_if(wave_fmt_tests[i].todo) ok(hr == S_OK, "Failed to create format, hr %#lx.\n", hr); ok(format != NULL, "Expected format structure.\n"); - todo_wine_if(wave_fmt_tests[i].todo_size) ok(size == wave_fmt_tests[i].size, "Unexpected size %u.\n", size); - todo_wine_if(wave_fmt_tests[i].todo) ok(format->wFormatTag == wave_fmt_tests[i].format_tag, "Expected tag %u, got %u.\n", wave_fmt_tests[i].format_tag, format->wFormatTag); ok(format->nChannels == 0, "Unexpected number of channels, %u.\n", format->nChannels); ok(format->nSamplesPerSec == 0, "Unexpected sample rate, %lu.\n", format->nSamplesPerSec); ok(format->nAvgBytesPerSec == 0, "Unexpected average data rate rate, %lu.\n", format->nAvgBytesPerSec); ok(format->nBlockAlign == 0, "Unexpected alignment, %u.\n", format->nBlockAlign); ok(format->wBitsPerSample == 0, "Unexpected sample size, %u.\n", format->wBitsPerSample); - todo_wine_if(wave_fmt_tests[i].todo_size) ok(format->cbSize == wave_fmt_tests[i].size_field, "Unexpected size field, %u.\n", format->cbSize); CoTaskMemFree(format); hr = MFCreateWaveFormatExFromMFMediaType(mediatype, (WAVEFORMATEX **)&format_ext, &size, MFWaveFormatExConvertFlag_ForceExtensible); - todo_wine_if(wave_fmt_tests[i].todo) ok(hr == S_OK, "Failed to create format, hr %#lx.\n", hr); ok(format_ext != NULL, "Expected format structure.\n"); - todo_wine_if(wave_fmt_tests[i].todo) ok(size == sizeof(*format_ext), "Unexpected size %u.\n", size); - todo_wine_if(wave_fmt_tests[i].todo) ok(format_ext->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE, "Unexpected tag.\n"); ok(format_ext->Format.nChannels == 0, "Unexpected number of channels, %u.\n", format_ext->Format.nChannels); ok(format_ext->Format.nSamplesPerSec == 0, "Unexpected sample rate, %lu.\n", format_ext->Format.nSamplesPerSec); @@ -6004,15 +5995,12 @@ static void test_MFCreateWaveFormatExFromMFMediaType(void) format_ext->Format.nAvgBytesPerSec); ok(format_ext->Format.nBlockAlign == 0, "Unexpected alignment, %u.\n", format_ext->Format.nBlockAlign); ok(format_ext->Format.wBitsPerSample == 0, "Unexpected sample size, %u.\n", format_ext->Format.wBitsPerSample); - todo_wine_if(wave_fmt_tests[i].todo) ok(format_ext->Format.cbSize == sizeof(*format_ext) - sizeof(format_ext->Format), "Unexpected size field, %u.\n", format_ext->Format.cbSize); CoTaskMemFree(format_ext); hr = MFCreateWaveFormatExFromMFMediaType(mediatype, &format, &size, MFWaveFormatExConvertFlag_ForceExtensible + 1); - todo_wine_if(wave_fmt_tests[i].todo) ok(hr == S_OK, "Failed to create format, hr %#lx.\n", hr); - todo_wine_if(wave_fmt_tests[i].todo_size) ok(size == wave_fmt_tests[i].size, "Unexpected size %u.\n", size); CoTaskMemFree(format); winetest_pop_context(); @@ -8231,7 +8219,6 @@ static void test_MFInitMediaTypeFromWaveFormatEx(void) hr = IMFMediaType_DeleteItem(mediatype, &MF_MT_USER_DATA); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = MFCreateWaveFormatExFromMFMediaType(mediatype, (WAVEFORMATEX **)&wfx, &size, 0); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); if (hr == S_OK) { From 90924a43ad6d889928a74e8fd7a4401784c5edb4 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Mon, 3 Mar 2025 20:19:26 +1100 Subject: [PATCH 1243/2542] winedmo: Call avformat_find_stream_info for the mp3 format. Required to obtain the number of channels. (cherry picked from commit 0f1f40e864f47de29dce17af81f7795bbfb288dc) CW-Bug-Id: #24502 --- dlls/winedmo/unix_demuxer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/winedmo/unix_demuxer.c b/dlls/winedmo/unix_demuxer.c index 808e3410d751..24681e2d5df5 100644 --- a/dlls/winedmo/unix_demuxer.c +++ b/dlls/winedmo/unix_demuxer.c @@ -256,7 +256,8 @@ NTSTATUS demuxer_create( void *arg ) } format = demuxer->ctx->iformat; - if ((params->duration = get_context_duration( demuxer->ctx )) == AV_NOPTS_VALUE) + if ((params->duration = get_context_duration( demuxer->ctx )) == AV_NOPTS_VALUE || + strstr( format->name, "mp3" )) { if ((ret = avformat_find_stream_info( demuxer->ctx, NULL )) < 0) { From 2f34c6365f80a49358b5acc6afe4adf8eb422525 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Tue, 4 Mar 2025 11:29:08 +1100 Subject: [PATCH 1244/2542] mp3dmod: Return S_OK in Allocate/Free Resources. MS documentation states: "If the DMO does not support this method, the method returns S_OK" https://learn.microsoft.com/en-us/previous-versions/windows/desktop/api/mediaobj/nf-mediaobj-imediaobject-allocatestreamingresources https://learn.microsoft.com/en-us/previous-versions/windows/desktop/api/mediaobj/nf-mediaobj-imediaobject-freestreamingresources (cherry picked from commit 94796cd8ba8bcb5411e0ae1c001b7f5ad7b11dce) CW-Bug-Id: #24502 --- dlls/mp3dmod/mp3dmod.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index 55a5b2f59336..5be79f9c1a4f 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -421,16 +421,16 @@ static HRESULT WINAPI MediaObject_Discontinuity(IMediaObject *iface, DWORD index static HRESULT WINAPI MediaObject_AllocateStreamingResources(IMediaObject *iface) { - FIXME("(%p)->() stub!\n", iface); + TRACE("(%p)->()\n", iface); - return E_NOTIMPL; + return S_OK; } static HRESULT WINAPI MediaObject_FreeStreamingResources(IMediaObject *iface) { - FIXME("(%p)->() stub!\n", iface); + TRACE("(%p)->()\n", iface); - return E_NOTIMPL; + return S_OK; } static HRESULT WINAPI MediaObject_GetInputStatus(IMediaObject *iface, DWORD index, DWORD *flags) From de857db005a5334326029f6deb6267dfb69ee73c Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Tue, 4 Mar 2025 11:35:01 +1100 Subject: [PATCH 1245/2542] mp3dmod/tests: Add test for 32-bit sample size. (cherry picked from commit 7b6a65bbf4829ca601958bf2e03714fbf6dca61f) CW-Bug-Id: #24502 --- dlls/mp3dmod/tests/mp3dmod.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/mp3dmod/tests/mp3dmod.c b/dlls/mp3dmod/tests/mp3dmod.c index 107533e63169..5eb888ad663d 100644 --- a/dlls/mp3dmod/tests/mp3dmod.c +++ b/dlls/mp3dmod/tests/mp3dmod.c @@ -746,6 +746,16 @@ static void test_media_types(void) check_dmo_media_type(&mt, &output_mt); MoFreeMediaType(&mt); + /* Windows accepts 32 bits per sample but does not enumerate it */ + output_format.nChannels = 1; + output_format.wBitsPerSample = 32; + output_format.nBlockAlign = 4; + output_format.nSamplesPerSec = 48000; + output_format.nAvgBytesPerSec = 192000; + hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + IMediaObject_Release(dmo); } From 576ee6eef5ee394f8bc4d3acd98f9bccb982065a Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Tue, 4 Mar 2025 12:11:12 +1100 Subject: [PATCH 1246/2542] mp3dmod: Add support for 32-bit sample size. (cherry picked from commit 362259abf5df09f919e8e12ee2115ff1d41781f8) CW-Bug-Id: #24502 --- dlls/mp3dmod/mp3dmod.c | 2 ++ dlls/mp3dmod/tests/mp3dmod.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index 5be79f9c1a4f..6e88c1905aec 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -289,6 +289,8 @@ static HRESULT WINAPI MediaObject_SetOutputType(IMediaObject *iface, DWORD index enc = MPG123_ENC_UNSIGNED_8; else if (format->wBitsPerSample == 16) enc = MPG123_ENC_SIGNED_16; + else if (format->wBitsPerSample == 32) + enc = MPG123_ENC_FLOAT_32; else { ERR("Cannot decode to bit depth %u.\n", format->wBitsPerSample); diff --git a/dlls/mp3dmod/tests/mp3dmod.c b/dlls/mp3dmod/tests/mp3dmod.c index 5eb888ad663d..116da0e5bf78 100644 --- a/dlls/mp3dmod/tests/mp3dmod.c +++ b/dlls/mp3dmod/tests/mp3dmod.c @@ -753,7 +753,6 @@ static void test_media_types(void) output_format.nSamplesPerSec = 48000; output_format.nAvgBytesPerSec = 192000; hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); IMediaObject_Release(dmo); From 8673d83cc1f66fcae35e6e5563e4f477904fe5d9 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Tue, 4 Mar 2025 11:29:18 +1100 Subject: [PATCH 1247/2542] mp3dmod/tests: Test different output sample rates. (cherry picked from commit 82aa93ff5c77d77ded25b07dc6dcf7d740875ccc) CW-Bug-Id: #24502 --- dlls/mp3dmod/tests/mp3dmod.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/dlls/mp3dmod/tests/mp3dmod.c b/dlls/mp3dmod/tests/mp3dmod.c index 116da0e5bf78..b27d6f82a348 100644 --- a/dlls/mp3dmod/tests/mp3dmod.c +++ b/dlls/mp3dmod/tests/mp3dmod.c @@ -746,6 +746,35 @@ static void test_media_types(void) check_dmo_media_type(&mt, &output_mt); MoFreeMediaType(&mt); + output_format.nSamplesPerSec = 24000; + output_format.nAvgBytesPerSec = 24000; + hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + output_format.nSamplesPerSec = 12000; + output_format.nAvgBytesPerSec = 12000; + hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + output_format.nSamplesPerSec = 6000; + output_format.nAvgBytesPerSec = 6000; + hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); + todo_wine + ok(hr == DMO_E_TYPE_NOT_ACCEPTED, "Got hr %#lx.\n", hr); + + output_format.nSamplesPerSec = 12000; + output_format.nAvgBytesPerSec = 6000; + hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); + todo_wine + ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); + + output_format.nSamplesPerSec = 48000; + output_format.nAvgBytesPerSec = 48000; + output_format.nChannels = 2; + hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); + todo_wine + ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); + /* Windows accepts 32 bits per sample but does not enumerate it */ output_format.nChannels = 1; output_format.wBitsPerSample = 32; From f6478a7f41985321640e4892bb17af1bf25932ec Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Tue, 4 Mar 2025 11:29:19 +1100 Subject: [PATCH 1248/2542] mp3dmod: Return error if requested output format values don't agree. If the requested output type has a sample rate that doesn't equal the average bytes per second when multiplied by the block alignment, then Windows returns E_INVALIDARG. Block alignment must also be the number of channels multiplied by the bytes per sample (bytes per sample being the requested bits per sample divided by 8). (cherry picked from commit 9105662708b8da35df9d8aa150a5292ca252534a) CW-Bug-Id: #24502 --- dlls/mp3dmod/mp3dmod.c | 4 ++++ dlls/mp3dmod/tests/mp3dmod.c | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index 6e88c1905aec..b69228865ade 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -297,6 +297,10 @@ static HRESULT WINAPI MediaObject_SetOutputType(IMediaObject *iface, DWORD index return DMO_E_TYPE_NOT_ACCEPTED; } + if (format->nChannels * format->wBitsPerSample/8 != format->nBlockAlign + || format->nSamplesPerSec * format->nBlockAlign != format->nAvgBytesPerSec) + return E_INVALIDARG; + if (!(flags & DMO_SET_TYPEF_TEST_ONLY)) { err = mpg123_format(This->mh, format->nSamplesPerSec, format->nChannels, enc); diff --git a/dlls/mp3dmod/tests/mp3dmod.c b/dlls/mp3dmod/tests/mp3dmod.c index b27d6f82a348..7667fa112ee2 100644 --- a/dlls/mp3dmod/tests/mp3dmod.c +++ b/dlls/mp3dmod/tests/mp3dmod.c @@ -765,14 +765,12 @@ static void test_media_types(void) output_format.nSamplesPerSec = 12000; output_format.nAvgBytesPerSec = 6000; hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); - todo_wine ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); output_format.nSamplesPerSec = 48000; output_format.nAvgBytesPerSec = 48000; output_format.nChannels = 2; hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); - todo_wine ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); /* Windows accepts 32 bits per sample but does not enumerate it */ From cbd59e2ac0de3e9777b3f7bd4fc94b9016451013 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Tue, 4 Mar 2025 11:29:20 +1100 Subject: [PATCH 1249/2542] mp3dmod: Only allow 1/2 and 1/4 subsampling. MS doc says: "The Windows Media MP3 decoder supports, but does not enumerate, the following output media types. - An output type that has half the sampling rate of the input type. - An output type that has one fourth the sampling rate of the input type" https://learn.microsoft.com/en-us/windows/win32/medfound/windows-media-mp3-decoder (cherry picked from commit 42f190c9d6d7645d1d1781878fae6147b7bb8aae) CW-Bug-Id: #24502 --- dlls/mp3dmod/mp3dmod.c | 12 +++++++++++- dlls/mp3dmod/tests/mp3dmod.c | 1 - 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index b69228865ade..9055f63cf675 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -261,7 +261,7 @@ static HRESULT WINAPI MediaObject_SetInputType(IMediaObject *iface, DWORD index, static HRESULT WINAPI MediaObject_SetOutputType(IMediaObject *iface, DWORD index, const DMO_MEDIA_TYPE *type, DWORD flags) { struct mp3_decoder *This = impl_from_IMediaObject(iface); - WAVEFORMATEX *format; + WAVEFORMATEX *format, *in_format; long enc; int err; @@ -301,6 +301,16 @@ static HRESULT WINAPI MediaObject_SetOutputType(IMediaObject *iface, DWORD index || format->nSamplesPerSec * format->nBlockAlign != format->nAvgBytesPerSec) return E_INVALIDARG; + in_format = (WAVEFORMATEX *)This->intype.pbFormat; + + if (format->nSamplesPerSec != in_format->nSamplesPerSec && + format->nSamplesPerSec*2 != in_format->nSamplesPerSec && + format->nSamplesPerSec*4 != in_format->nSamplesPerSec) + { + ERR("Cannot decode to %lu samples per second (input %lu).\n", format->nSamplesPerSec, in_format->nSamplesPerSec); + return DMO_E_TYPE_NOT_ACCEPTED; + } + if (!(flags & DMO_SET_TYPEF_TEST_ONLY)) { err = mpg123_format(This->mh, format->nSamplesPerSec, format->nChannels, enc); diff --git a/dlls/mp3dmod/tests/mp3dmod.c b/dlls/mp3dmod/tests/mp3dmod.c index 7667fa112ee2..46ea79c3d58a 100644 --- a/dlls/mp3dmod/tests/mp3dmod.c +++ b/dlls/mp3dmod/tests/mp3dmod.c @@ -759,7 +759,6 @@ static void test_media_types(void) output_format.nSamplesPerSec = 6000; output_format.nAvgBytesPerSec = 6000; hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); - todo_wine ok(hr == DMO_E_TYPE_NOT_ACCEPTED, "Got hr %#lx.\n", hr); output_format.nSamplesPerSec = 12000; From 4e58ecd70dbc12dc91c9682af218fa8275207870 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Tue, 4 Mar 2025 11:29:20 +1100 Subject: [PATCH 1250/2542] mp3dmod/tests: Add test for nChannels = 0 on input. (cherry picked from commit c75418cf929fd241e3289e3d351d12870276bdae) CW-Bug-Id: #24502 --- dlls/mp3dmod/tests/mp3dmod.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/mp3dmod/tests/mp3dmod.c b/dlls/mp3dmod/tests/mp3dmod.c index 46ea79c3d58a..fc9e99d3833e 100644 --- a/dlls/mp3dmod/tests/mp3dmod.c +++ b/dlls/mp3dmod/tests/mp3dmod.c @@ -781,6 +781,11 @@ static void test_media_types(void) hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, DMO_SET_TYPEF_TEST_ONLY); ok(hr == S_OK, "Got hr %#lx.\n", hr); + mp3fmt.wfx.nChannels = 0; + hr = IMediaObject_SetInputType(dmo, 0, &input_mt, DMO_SET_TYPEF_TEST_ONLY); + todo_wine + ok(hr == DMO_E_TYPE_NOT_ACCEPTED, "Got hr %#lx.\n", hr); + IMediaObject_Release(dmo); } From f63be7e3a7f4229721d90fe963d9cc4f7f2d6a81 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Tue, 4 Mar 2025 11:29:21 +1100 Subject: [PATCH 1251/2542] mp3dmod: Ensure nChannels is greater than zero on input. (cherry picked from commit 169116be28d9d017f1d2ad28513dd3798876770c) CW-Bug-Id: #24502 --- dlls/mp3dmod/mp3dmod.c | 6 ++++++ dlls/mp3dmod/tests/mp3dmod.c | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index 9055f63cf675..211d4ac63a9f 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -228,6 +228,7 @@ static HRESULT WINAPI MediaObject_GetOutputType(IMediaObject *iface, DWORD index static HRESULT WINAPI MediaObject_SetInputType(IMediaObject *iface, DWORD index, const DMO_MEDIA_TYPE *type, DWORD flags) { struct mp3_decoder *dmo = impl_from_IMediaObject(iface); + const WAVEFORMATEX *format; TRACE("iface %p, index %lu, type %p, flags %#lx.\n", iface, index, type, flags); @@ -247,6 +248,11 @@ static HRESULT WINAPI MediaObject_SetInputType(IMediaObject *iface, DWORD index, || !IsEqualGUID(&type->formattype, &WMFORMAT_WaveFormatEx)) return DMO_E_TYPE_NOT_ACCEPTED; + format = (WAVEFORMATEX *) type->pbFormat; + + if (!format->nChannels) + return DMO_E_TYPE_NOT_ACCEPTED; + if (!(flags & DMO_SET_TYPEF_TEST_ONLY)) { if (dmo->intype_set) diff --git a/dlls/mp3dmod/tests/mp3dmod.c b/dlls/mp3dmod/tests/mp3dmod.c index fc9e99d3833e..655224da7caa 100644 --- a/dlls/mp3dmod/tests/mp3dmod.c +++ b/dlls/mp3dmod/tests/mp3dmod.c @@ -783,7 +783,6 @@ static void test_media_types(void) mp3fmt.wfx.nChannels = 0; hr = IMediaObject_SetInputType(dmo, 0, &input_mt, DMO_SET_TYPEF_TEST_ONLY); - todo_wine ok(hr == DMO_E_TYPE_NOT_ACCEPTED, "Got hr %#lx.\n", hr); IMediaObject_Release(dmo); From 4cc6b86fb5049a2199809075e0c18e53578881c2 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Tue, 4 Mar 2025 09:39:13 +1100 Subject: [PATCH 1252/2542] mf/tests: Test different length user_data against aac decoder. (cherry picked from commit 2b18383a8b74051ff3735368da5447536d77a3e2) CW-Bug-Id: #24502 --- dlls/mf/tests/transform.c | 131 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index b8a78e949d00..1f9d1cd56323 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -728,6 +728,7 @@ static void check_mft_set_input_type_(int line, IMFTransform *transform, const s init_media_type(media_type, attributes, -1); hr = IMFTransform_SetInputType(transform, 0, media_type, MFT_SET_TYPE_TEST_ONLY); + todo_wine_if(todo) ok_(__FILE__, line)(hr == expect_hr, "SetInputType returned %#lx.\n", hr); hr = IMFTransform_SetInputType(transform, 0, media_type, 0); todo_wine_if(todo) @@ -2881,6 +2882,135 @@ static void test_aac_decoder_channels(const struct attribute_desc *input_type_de CoUninitialize(); } +static void test_aac_decoder_user_data(void) +{ + /* https://wiki.multimedia.cx/index.php/MPEG-4_Audio */ + static const BYTE aac_raw_codec_data[] = {0x12, 0x08}; /* short form of 1 channel 44.1 Khz */ + static const BYTE aac_raw_codec_data_long[] = {0x17, 0x80, 0x56, 0x22, 0x08}; /* long form of 1 channel 44.1 Khz */ + static const BYTE aac_raw_codec_data_48khz[] = {0x11, 0x90}; /* short form of 1 channel 48 Khz */ + static const struct attribute_desc raw_aac_input_type_desc[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio, .required = TRUE), + ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_RAW_AAC1, .required = TRUE), + ATTR_UINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, 44100, .required = TRUE), + ATTR_UINT32(MF_MT_AUDIO_NUM_CHANNELS, 1), + ATTR_BLOB(MF_MT_USER_DATA, aac_raw_codec_data, sizeof(aac_raw_codec_data), .required = TRUE), + {0}, + }; + static const struct attribute_desc raw_aac_input_type_desc_long[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio, .required = TRUE), + ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_RAW_AAC1, .required = TRUE), + ATTR_UINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, 44100, .required = TRUE), + ATTR_UINT32(MF_MT_AUDIO_NUM_CHANNELS, 1), + ATTR_BLOB(MF_MT_USER_DATA, aac_raw_codec_data_long, sizeof(aac_raw_codec_data_long), .required = TRUE), + {0}, + }; + static const struct attribute_desc raw_aac_input_type_desc_48khz[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio, .required = TRUE), + ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_RAW_AAC1, .required = TRUE), + ATTR_UINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, 48000, .required = TRUE), + ATTR_UINT32(MF_MT_AUDIO_NUM_CHANNELS, 1), + ATTR_BLOB(MF_MT_USER_DATA, aac_raw_codec_data_48khz, sizeof(aac_raw_codec_data_48khz), .required = TRUE), + {0}, + }; + static const struct attribute_desc raw_aac_input_type_desc_mismatch[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio, .required = TRUE), + ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_RAW_AAC1, .required = TRUE), + ATTR_UINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, 44100, .required = TRUE), + ATTR_UINT32(MF_MT_AUDIO_NUM_CHANNELS, 1), + ATTR_BLOB(MF_MT_USER_DATA, aac_raw_codec_data_48khz, sizeof(aac_raw_codec_data_48khz), .required = TRUE), + {0}, + }; + static const struct attribute_desc aac_input_type_desc[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio, .required = TRUE), + ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_AAC, .required = TRUE), + ATTR_UINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, 44100, .required = TRUE), + ATTR_BLOB(MF_MT_USER_DATA, test_aac_codec_data, sizeof(test_aac_codec_data), .required = TRUE), + ATTR_UINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, 16), + ATTR_UINT32(MF_MT_AUDIO_NUM_CHANNELS, 1), + ATTR_UINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 12000), + ATTR_UINT32(MF_MT_AAC_AUDIO_PROFILE_LEVEL_INDICATION, 41), + ATTR_UINT32(MF_MT_AAC_PAYLOAD_TYPE, 0), + {0}, + }; + + static struct { + const char *name; + const struct attribute_desc *desc; + HRESULT exp_result; + BOOL todo; + BOOL todo_short; + } tests[] = { + { "aac", aac_input_type_desc, S_OK, FALSE, TRUE }, + { "raw aac", raw_aac_input_type_desc, S_OK, FALSE, TRUE }, + { "raw aac long", raw_aac_input_type_desc_long, S_OK, FALSE, TRUE }, + { "raw aac 48Khz", raw_aac_input_type_desc_48khz, S_OK, FALSE, TRUE }, + { "raw aac mismatch", raw_aac_input_type_desc_mismatch, MF_E_INVALIDMEDIATYPE, TRUE }, + }; + + const struct attribute_desc *input_type_desc; + struct attribute_desc input_desc[64]; + unsigned int user_data_index = ~0u; + IMFTransform *transform; + ULONG ret, i, j; + HRESULT hr; + + winetest_push_context("aacdec user_data"); + hr = CoInitialize(NULL); + ok(hr == S_OK, "got %#lx.\n", hr); + + if (FAILED(hr = CoCreateInstance(&CLSID_MSAACDecMFT, NULL, CLSCTX_INPROC_SERVER, + &IID_IMFTransform, (void **)&transform))) + { + win_skip("AAC decoder transform is not available.\n"); + goto failed; + } + + for (i = 0; i < ARRAY_SIZE(tests); i++) + { + winetest_push_context("%s", tests[i].name); + user_data_index = ~0u; + input_type_desc = tests[i].desc; + for (j = 0; j < ARRAY_SIZE(input_desc); j++) + { + input_desc[j] = input_type_desc[j]; + if (!input_desc[j].key) + break; + if (IsEqualGUID(input_desc[j].key, &MF_MT_USER_DATA)) + user_data_index = j; + } + + ok(user_data_index != ~0u, "Could not find MF_MT_USER_DATA.\n"); + ok(i < ARRAY_SIZE(input_desc), "Too many attributes.\n"); + + /* confirm standard input result */ + check_mft_set_input_type_(__LINE__, transform, input_desc, tests[i].exp_result, tests[i].todo); + + if (tests[i].exp_result == S_OK) + { + /* confirm shorter fails */ + input_desc[user_data_index].value.blob.cbSize = input_type_desc[user_data_index].value.blob.cbSize - 1; + check_mft_set_input_type_(__LINE__, transform, input_desc, MF_E_INVALIDMEDIATYPE, tests[i].todo_short); + + /* confirm longer is OK */ + input_desc[user_data_index].value.blob.cbSize = input_type_desc[user_data_index].value.blob.cbSize + 1; + check_mft_set_input_type(transform, input_desc, S_OK); + } + winetest_pop_context(); + } + + ret = IMFTransform_Release(transform); + ok(!ret, "got %lu.\n", ret); + +failed: + winetest_pop_context(); + CoUninitialize(); +} + static void test_aac_decoder(void) { static const BYTE aac_raw_codec_data[] = {0x12, 0x08}; @@ -10303,6 +10433,7 @@ START_TEST(transform) test_sample_copier_output_processing(); test_aac_encoder(); test_aac_decoder(); + test_aac_decoder_user_data(); test_wma_encoder(); test_wma_decoder(); test_wma_decoder_dmo_input_type(); From 53d87b863bf394d00a2491978f8d6f3f01787dea Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Tue, 4 Mar 2025 09:37:00 +1100 Subject: [PATCH 1253/2542] winegstreamer: Validate the value of cbSize in aac decoder. (cherry picked from commit 030507a383ef0655729410ed8df3050c805b2332) CW-Bug-Id: #24502 --- dlls/mf/tests/transform.c | 4 ++-- dlls/winegstreamer/audio_decoder.c | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 1f9d1cd56323..507c58906d3a 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -2946,9 +2946,9 @@ static void test_aac_decoder_user_data(void) BOOL todo_short; } tests[] = { { "aac", aac_input_type_desc, S_OK, FALSE, TRUE }, - { "raw aac", raw_aac_input_type_desc, S_OK, FALSE, TRUE }, + { "raw aac", raw_aac_input_type_desc, S_OK }, { "raw aac long", raw_aac_input_type_desc_long, S_OK, FALSE, TRUE }, - { "raw aac 48Khz", raw_aac_input_type_desc_48khz, S_OK, FALSE, TRUE }, + { "raw aac 48Khz", raw_aac_input_type_desc_48khz, S_OK }, { "raw aac mismatch", raw_aac_input_type_desc_mismatch, MF_E_INVALIDMEDIATYPE, TRUE }, }; diff --git a/dlls/winegstreamer/audio_decoder.c b/dlls/winegstreamer/audio_decoder.c index a2b0dbeb6413..3b7ad5d1793b 100644 --- a/dlls/winegstreamer/audio_decoder.c +++ b/dlls/winegstreamer/audio_decoder.c @@ -32,6 +32,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mfplat); WINE_DECLARE_DEBUG_CHANNEL(winediag); +#define CBSIZE(x) (sizeof(x) - sizeof(WAVEFORMATEX)) + #define NEXT_WAVEFORMATEXTENSIBLE(format) (WAVEFORMATEXTENSIBLE *)((BYTE *)(&(format)->Format + 1) + (format)->Format.cbSize) static WAVEFORMATEXTENSIBLE const audio_decoder_output_types[] = @@ -356,7 +358,9 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM if (!count) return MF_E_INVALIDMEDIATYPE; - if (wfx.Format.nChannels >= ARRAY_SIZE(default_channel_mask) || !wfx.Format.nSamplesPerSec || !wfx.Format.cbSize) + if (wfx.Format.nChannels >= ARRAY_SIZE(default_channel_mask) || !wfx.Format.nSamplesPerSec + /* 2 is the minimum size of AudioSpecificConfig() */ + || wfx.Format.cbSize < 2 + CBSIZE(WAVEFORMATEXTENSIBLE)) return MF_E_INVALIDMEDIATYPE; if (flags & MFT_SET_TYPE_TEST_ONLY) return S_OK; From 2ea665baceb452398e7c36d9b45dbe6212c36825 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Fri, 28 Feb 2025 15:11:56 +1100 Subject: [PATCH 1254/2542] mp3dmod: Implement an IMFTransform interface. (cherry picked from commit 1d802ac6e63ada348d5e99a6a468149e65a33046) CW-Bug-Id: #24502 --- dlls/mf/tests/mf_test.h | 2 + dlls/mf/tests/topology.c | 5 +- dlls/mf/tests/transform.c | 14 +- dlls/mp3dmod/Makefile.in | 2 +- dlls/mp3dmod/mp3dmod.c | 545 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 558 insertions(+), 10 deletions(-) diff --git a/dlls/mf/tests/mf_test.h b/dlls/mf/tests/mf_test.h index a4f330efbcb7..f6f281939f7b 100644 --- a/dlls/mf/tests/mf_test.h +++ b/dlls/mf/tests/mf_test.h @@ -101,6 +101,7 @@ struct buffer_desc RECT compare_rect; dump_cb dump; SIZE size; + BOOL todo_data; }; struct sample_desc @@ -115,6 +116,7 @@ struct sample_desc BOOL todo_length; BOOL todo_duration; BOOL todo_time; + BOOL todo_data; }; #define check_mf_sample_collection(a, b, c) check_mf_sample_collection_(__FILE__, __LINE__, a, b, c, FALSE) diff --git a/dlls/mf/tests/topology.c b/dlls/mf/tests/topology.c index 4b2e83d7ee40..9070098a60a9 100644 --- a/dlls/mf/tests/topology.c +++ b/dlls/mf/tests/topology.c @@ -2268,7 +2268,7 @@ static void test_topology_loader(void) ATTR_UINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, 44100), ATTR_UINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 2 * 4 * 44100), ATTR_UINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, 4 * 8), - ATTR_UINT32(MF_MT_AUDIO_CHANNEL_MASK, 3), + ATTR_UINT32(MF_MT_AUDIO_CHANNEL_MASK, 3, .todo = TRUE), ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1), }; static const media_type_desc video_i420_1280 = @@ -2457,14 +2457,12 @@ static void test_topology_loader(void) .input_type = &audio_mp3_44100, .output_type = &audio_pcm_44100, .sink_method = MF_CONNECT_ALLOW_DECODER, .source_method = -1, .current_input = &audio_mp3_44100, .expected_result = S_OK, .decoder_class = CLSID_CMP3DecMediaObject, - .flags = LOADER_TODO, }, { /* MP3 -> PCM, need both decoder and converter */ .input_type = &audio_mp3_44100, .output_type = &audio_float_48000, .sink_method = MF_CONNECT_ALLOW_DECODER, .source_method = -1, .current_input = &audio_mp3_44100, .decoded_type = &audio_float_44100_stereo, .expected_result = S_OK, .decoder_class = CLSID_CMP3DecMediaObject, .converter_class = CLSID_CResamplerMediaObject, - .flags = LOADER_TODO, }, { @@ -2776,7 +2774,6 @@ todo_wine { hr = IMFTopology_GetNodeCount(full_topology, &node_count); ok(hr == S_OK, "Failed to get node count, hr %#lx.\n", hr); - todo_wine_if(IsEqualGUID(&test->decoder_class, &CLSID_CMP3DecMediaObject)) ok(node_count == count, "Unexpected node count %u.\n", node_count); hr = IMFTopologyNode_GetTopoNodeID(src_node, &node_id); diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 507c58906d3a..439d8ee9d54b 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -1345,7 +1345,7 @@ static DWORD check_mf_media_buffer_(const char *file, int line, IMFMediaBuffer * if (*expect_data) { if (*expect_data_len < length) - todo_wine_if(expect->todo_length) + todo_wine_if(expect->todo_length || expect->todo_data) ok_(file, line)(0, "missing %#lx bytes\n", length - *expect_data_len); else if (!expect->compare) diff = compare_bytes(data, &length, NULL, NULL, *expect_data); @@ -1430,6 +1430,7 @@ static DWORD check_mf_sample_(const char *file, int line, IMFSample *sample, con todo_wine_if(expect->todo_length) ok_(file, line)(total_length == expect_length, "got total length %#lx\n", total_length); + todo_wine_if(expect->todo_data) ok_(file, line)(!*expect_data || *expect_data_len >= expect_length, "missing %#lx data\n", expect_length - *expect_data_len); @@ -9120,8 +9121,9 @@ static void test_mp3_decoder(void) const struct buffer_desc output_buffer_desc[] = { - {.length = 0x9c0, .compare = compare_pcm16}, + {.length = 0x9c0, .compare = compare_pcm16, .todo_length = TRUE}, {.length = mp3dec_block_size, .compare = compare_pcm16}, + {.length = mp3dec_block_size, .compare = compare_pcm16, .todo_data = TRUE}, }; const struct attribute_desc output_sample_attributes[] = { @@ -9135,16 +9137,19 @@ static void test_mp3_decoder(void) .attributes = output_sample_attributes + 0, .sample_time = 0, .sample_duration = 282993, .buffer_count = 1, .buffers = output_buffer_desc + 0, + .todo_length = TRUE, .todo_duration = TRUE, }, { .attributes = output_sample_attributes + 0, .sample_time = 282993, .sample_duration = 522449, .buffer_count = 1, .buffers = output_buffer_desc + 1, .repeat_count = 18, + .todo_time = TRUE, }, { .attributes = output_sample_attributes + 1, /* not MFT_OUTPUT_DATA_BUFFER_INCOMPLETE */ .sample_time = 10209524, .sample_duration = 522449, - .buffer_count = 1, .buffers = output_buffer_desc + 1, + .buffer_count = 1, .buffers = output_buffer_desc + 2, + .todo_time = TRUE, .todo_data = TRUE, }, }; @@ -9198,9 +9203,7 @@ static void test_mp3_decoder(void) ok(ret == 0, "Release returned %lu\n", ret); winetest_pop_context(); } - todo_wine ok(hr == MF_E_NO_MORE_TYPES, "GetInputAvailableType returned %#lx\n", hr); - todo_wine ok(i == ARRAY_SIZE(expect_available_inputs), "%lu input media types\n", i); /* setting output media type first doesn't work */ @@ -9295,6 +9298,7 @@ static void test_mp3_decoder(void) else { ret = check_mf_sample_collection(output_samples, output_sample_desc, L"mp3decdata.bin"); + todo_wine ok(ret == 0, "got %lu%% diff\n", ret); } IMFCollection_Release(output_samples); diff --git a/dlls/mp3dmod/Makefile.in b/dlls/mp3dmod/Makefile.in index ff2f2f241162..254174d4d319 100644 --- a/dlls/mp3dmod/Makefile.in +++ b/dlls/mp3dmod/Makefile.in @@ -1,5 +1,5 @@ MODULE = mp3dmod.dll -IMPORTS = $(MPG123_PE_LIBS) dmoguids msdmo ole32 uuid wmcodecdspuuid kernelbase +IMPORTS = $(MPG123_PE_LIBS) dmoguids mfplat mfuuid msdmo ole32 uuid wmcodecdspuuid kernelbase EXTRAINCL = $(MPG123_PE_CFLAGS) EXTRADEFS = -DMPG123_NO_LARGENAME diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index 211d4ac63a9f..82da02bfaeec 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -30,6 +30,9 @@ #include "dmo.h" #include "rpcproxy.h" #include "wmcodecdsp.h" +#include "mfapi.h" +#include "mferror.h" +#include "mftransform.h" #include "wine/debug.h" #include "initguid.h" @@ -44,6 +47,7 @@ struct mp3_decoder { IUnknown IUnknown_inner; IMediaObject IMediaObject_iface; + IMFTransform IMFTransform_iface; IUnknown *outer; LONG ref; mpg123_handle *mh; @@ -53,6 +57,8 @@ struct mp3_decoder IMediaBuffer *buffer; REFERENCE_TIME timestamp; + + BOOL draining; }; static inline struct mp3_decoder *impl_from_IUnknown(IUnknown *iface) @@ -70,6 +76,8 @@ static HRESULT WINAPI Unknown_QueryInterface(IUnknown *iface, REFIID iid, void * *obj = &This->IUnknown_inner; else if (IsEqualGUID(iid, &IID_IMediaObject)) *obj = &This->IMediaObject_iface; + else if (IsEqualGUID(iid, &IID_IMFTransform)) + *obj = &This->IMFTransform_iface; else { FIXME("no interface for %s\n", debugstr_guid(iid)); @@ -634,6 +642,532 @@ static const IMediaObjectVtbl MediaObject_vtbl = { MediaObject_Lock, }; +static HRESULT convert_dmo_to_mf_error(HRESULT dmo_error) +{ + switch (dmo_error) + { + case DMO_E_INVALIDSTREAMINDEX: + return MF_E_INVALIDSTREAMNUMBER; + + case DMO_E_INVALIDTYPE: + case DMO_E_TYPE_NOT_ACCEPTED: + return MF_E_INVALIDMEDIATYPE; + + case DMO_E_TYPE_NOT_SET: + return MF_E_TRANSFORM_TYPE_NOT_SET; + + case DMO_E_NOTACCEPTING: + return MF_E_NOTACCEPTING; + + case DMO_E_NO_MORE_ITEMS: + return MF_E_NO_MORE_TYPES; + } + + return dmo_error; +} + +static inline struct mp3_decoder *impl_from_IMFTransform(IMFTransform *iface) +{ + return CONTAINING_RECORD(iface, struct mp3_decoder, IMFTransform_iface); +} + +static HRESULT WINAPI MFTransform_QueryInterface(IMFTransform *iface, REFIID iid, void **obj) +{ + struct mp3_decoder *decoder = impl_from_IMFTransform(iface); + return IUnknown_QueryInterface(decoder->outer, iid, obj); +} + +static ULONG WINAPI MFTransform_AddRef(IMFTransform *iface) +{ + struct mp3_decoder *decoder = impl_from_IMFTransform(iface); + return IUnknown_AddRef(decoder->outer); +} + +static ULONG WINAPI MFTransform_Release(IMFTransform *iface) +{ + struct mp3_decoder *decoder = impl_from_IMFTransform(iface); + return IUnknown_Release(decoder->outer); +} + +static HRESULT WINAPI MFTransform_GetStreamLimits(IMFTransform *iface, DWORD *input_minimum, + DWORD *input_maximum, DWORD *output_minimum, DWORD *output_maximum) +{ + struct mp3_decoder *decoder = impl_from_IMFTransform(iface); + + TRACE("iface %p, input_minimum %p, input_maximum %p, output_minimum %p, output_maximum %p.\n", + iface, input_minimum, input_maximum, output_minimum, output_maximum); + IMediaObject_GetStreamCount(&decoder->IMediaObject_iface, input_minimum, output_minimum); + *input_maximum = *input_minimum; + *output_maximum = *output_minimum; + return S_OK; +} + +static HRESULT WINAPI MFTransform_GetStreamCount(IMFTransform *iface, DWORD *inputs, DWORD *outputs) +{ + struct mp3_decoder *decoder = impl_from_IMFTransform(iface); + + TRACE("iface %p, inputs %p, outputs %p.\n", iface, inputs, outputs); + IMediaObject_GetStreamCount(&decoder->IMediaObject_iface, inputs, outputs); + return S_OK; +} + +static HRESULT WINAPI MFTransform_GetStreamIDs(IMFTransform *iface, DWORD input_size, DWORD *inputs, + DWORD output_size, DWORD *outputs) +{ + FIXME("iface %p, input_size %lu, inputs %p, output_size %lu, outputs %p stub!\n", iface, + input_size, inputs, output_size, outputs); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MFTransform_GetInputStreamInfo(IMFTransform *iface, DWORD id, MFT_INPUT_STREAM_INFO *info) +{ + struct mp3_decoder *decoder = impl_from_IMFTransform(iface); + HRESULT hr; + + TRACE("iface %p, id %#lx, info %p.\n", iface, id, info); + + memset(info, 0, sizeof(*info)); + + /* Doc says: If not implemented, assume zero latency. */ + if (FAILED(hr = IMediaObject_GetInputMaxLatency(&decoder->IMediaObject_iface, id, &info->hnsMaxLatency)) && hr != E_NOTIMPL) + return convert_dmo_to_mf_error(hr); + + if (FAILED(hr = IMediaObject_GetInputStreamInfo(&decoder->IMediaObject_iface, id, &info->dwFlags))) + return convert_dmo_to_mf_error(hr); + + if (FAILED(hr = IMediaObject_GetInputSizeInfo(&decoder->IMediaObject_iface, id, &info->cbSize, &info->cbMaxLookahead, &info->cbAlignment))) + return convert_dmo_to_mf_error(hr); + + return S_OK; +} + +static HRESULT WINAPI MFTransform_GetOutputStreamInfo(IMFTransform *iface, DWORD id, MFT_OUTPUT_STREAM_INFO *info) +{ + struct mp3_decoder *decoder = impl_from_IMFTransform(iface); + HRESULT hr; + + TRACE("iface %p, id %#lx, info %p.\n", iface, id, info); + + memset(info, 0, sizeof(*info)); + + if (FAILED(hr = IMediaObject_GetOutputStreamInfo(&decoder->IMediaObject_iface, id, &info->dwFlags))) + return convert_dmo_to_mf_error(hr); + + if (FAILED(hr = IMediaObject_GetOutputSizeInfo(&decoder->IMediaObject_iface, id, &info->cbSize, &info->cbAlignment))) + return convert_dmo_to_mf_error(hr); + + return S_OK; +} + +static HRESULT WINAPI MFTransform_GetAttributes(IMFTransform *iface, IMFAttributes **attributes) +{ + TRACE("iface %p, attributes %p.\n", iface, attributes); + return E_NOTIMPL; +} + +static HRESULT WINAPI MFTransform_GetInputStreamAttributes(IMFTransform *iface, DWORD id, IMFAttributes **attributes) +{ + TRACE("iface %p, id %#lx, attributes %p.\n", iface, id, attributes); + return E_NOTIMPL; +} + +static HRESULT WINAPI MFTransform_GetOutputStreamAttributes(IMFTransform *iface, DWORD id, IMFAttributes **attributes) +{ + TRACE("iface %p, id %#lx, attributes %p.\n", iface, id, attributes); + return E_NOTIMPL; +} + +static HRESULT WINAPI MFTransform_DeleteInputStream(IMFTransform *iface, DWORD id) +{ + TRACE("iface %p, id %#lx.\n", iface, id); + return E_NOTIMPL; +} + +static HRESULT WINAPI MFTransform_AddInputStreams(IMFTransform *iface, DWORD streams, DWORD *ids) +{ + TRACE("iface %p, streams %lu, ids %p.\n", iface, streams, ids); + return E_NOTIMPL; +} + +static HRESULT WINAPI MFTransform_GetInputAvailableType(IMFTransform *iface, DWORD id, DWORD index, + IMFMediaType **type) +{ + struct mp3_decoder *decoder = impl_from_IMFTransform(iface); + DMO_MEDIA_TYPE pt; + HRESULT hr; + + TRACE("iface %p, id %#lx, index %#lx, type %p.\n", iface, id, index, type); + + if (FAILED(hr = IMediaObject_GetInputType(&decoder->IMediaObject_iface, id, index, &pt))) + return convert_dmo_to_mf_error(hr); + + if (FAILED(hr = MFCreateMediaType(type))) + return hr; + + return MFInitMediaTypeFromAMMediaType(*type, (AM_MEDIA_TYPE*)&pt); +} + +static HRESULT WINAPI MFTransform_GetOutputAvailableType(IMFTransform *iface, DWORD id, DWORD index, + IMFMediaType **type) +{ + struct mp3_decoder *decoder = impl_from_IMFTransform(iface); + UINT32 bps, block_align, num_channels; + const WAVEFORMATEX *input_format; + HRESULT hr; + + TRACE("iface %p, id %#lx, index %#lx, type %p.\n", iface, id, index, type); + + if (id) + return MF_E_INVALIDSTREAMNUMBER; + + if (!decoder->intype_set) + return MF_E_TRANSFORM_TYPE_NOT_SET; + + input_format = (WAVEFORMATEX *)decoder->intype.pbFormat; + + if (index >= 6 || (input_format->nChannels != 2 && index >= 3)) + return MF_E_NO_MORE_TYPES; + + if (FAILED(hr = MFCreateMediaType(type))) + return hr; + + if (FAILED(hr = IMFMediaType_SetGUID(*type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio))) + goto fail; + + if (FAILED(hr = IMFMediaType_SetGUID(*type, &MF_MT_SUBTYPE, index % 3 ? &MFAudioFormat_PCM : &MFAudioFormat_Float))) + goto fail; + + if (index % 3 == 0) + bps = 32; + else if (index % 3 == 1) + bps = 16; + else + bps = 8; + + num_channels = index / 3 ? 1 : input_format->nChannels; + block_align = bps/8 * num_channels; + + if (FAILED(hr = IMFMediaType_SetUINT32(*type, &MF_MT_AUDIO_BITS_PER_SAMPLE, bps))) + goto fail; + + if (FAILED(hr = IMFMediaType_SetUINT32(*type, &MF_MT_AUDIO_NUM_CHANNELS, num_channels))) + goto fail; + + if (FAILED(hr = IMFMediaType_SetUINT32(*type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, input_format->nSamplesPerSec))) + goto fail; + + if (FAILED(hr = IMFMediaType_SetUINT32(*type, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, input_format->nSamplesPerSec * block_align))) + goto fail; + + if (FAILED(hr = IMFMediaType_SetUINT32(*type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, block_align))) + goto fail; + + if (FAILED(hr = IMFMediaType_SetUINT32(*type, &MF_MT_ALL_SAMPLES_INDEPENDENT, 1))) + goto fail; + + return S_OK; + +fail: + IMFMediaType_Release(*type); + return hr; +} +static HRESULT WINAPI MFTransform_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) +{ + struct mp3_decoder *decoder = impl_from_IMFTransform(iface); + DMO_MEDIA_TYPE mt; + HRESULT hr; + + TRACE("iface %p, id %#lx, type %p, flags %#lx.\n", iface, id, type, flags); + + if (!type) + flags |= DMO_SET_TYPEF_CLEAR; + else if (FAILED(hr = MFInitAMMediaTypeFromMFMediaType(type, GUID_NULL, (AM_MEDIA_TYPE*)&mt))) + return hr; + + hr = IMediaObject_SetInputType(&decoder->IMediaObject_iface, id, &mt, flags); + + if (hr == S_FALSE) + return MF_E_INVALIDMEDIATYPE; + else if (FAILED(hr)) + return convert_dmo_to_mf_error(hr); + + return S_OK; +} + +static HRESULT WINAPI MFTransform_SetOutputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) +{ + struct mp3_decoder *decoder = impl_from_IMFTransform(iface); + DMO_MEDIA_TYPE mt; + HRESULT hr; + + TRACE("iface %p, id %#lx, type %p, flags %#lx.\n", iface, id, type, flags); + + if (!type) + flags |= DMO_SET_TYPEF_CLEAR; + else if (FAILED(hr = MFInitAMMediaTypeFromMFMediaType(type, GUID_NULL, (AM_MEDIA_TYPE*)&mt))) + return hr; + + hr = IMediaObject_SetOutputType(&decoder->IMediaObject_iface, id, &mt, flags); + + if (hr == S_FALSE) + return MF_E_INVALIDMEDIATYPE; + else if (FAILED(hr)) + return convert_dmo_to_mf_error(hr); + + return S_OK; +} + +static HRESULT WINAPI MFTransform_GetInputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **out) +{ + struct mp3_decoder *decoder = impl_from_IMFTransform(iface); + DMO_MEDIA_TYPE mt; + HRESULT hr; + + TRACE("iface %p, id %#lx, out %p.\n", iface, id, out); + + if (FAILED(hr = IMediaObject_GetInputCurrentType(&decoder->IMediaObject_iface, id, &mt))) + return convert_dmo_to_mf_error(hr); + + if (FAILED(hr = MFCreateMediaType(out))) + return hr; + + return MFInitMediaTypeFromAMMediaType(*out, (AM_MEDIA_TYPE*)&mt); +} + +static HRESULT WINAPI MFTransform_GetOutputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **out) +{ + struct mp3_decoder *decoder = impl_from_IMFTransform(iface); + DMO_MEDIA_TYPE mt; + HRESULT hr; + + TRACE("iface %p, id %#lx, out %p.\n", iface, id, out); + + if (FAILED(hr = IMediaObject_GetOutputCurrentType(&decoder->IMediaObject_iface, id, &mt))) + return convert_dmo_to_mf_error(hr); + + if (FAILED(hr = MFCreateMediaType(out))) + return hr; + + return MFInitMediaTypeFromAMMediaType(*out, (AM_MEDIA_TYPE*)&mt); +} + +static HRESULT WINAPI MFTransform_GetInputStatus(IMFTransform *iface, DWORD id, DWORD *flags) +{ + + FIXME("iface %p, id %#lx, flags %p stub!\n", iface, id, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI MFTransform_GetOutputStatus(IMFTransform *iface, DWORD *flags) +{ + FIXME("iface %p, flags %p stub!\n", iface, flags); + return E_NOTIMPL; +} + +static HRESULT WINAPI MFTransform_SetOutputBounds(IMFTransform *iface, LONGLONG lower, LONGLONG upper) +{ + FIXME("iface %p, lower %I64d, upper %I64d stub!\n", iface, lower, upper); + return E_NOTIMPL; +} + +static HRESULT WINAPI MFTransform_ProcessEvent(IMFTransform *iface, DWORD id, IMFMediaEvent *event) +{ + FIXME("iface %p, id %#lx, event %p stub!\n", iface, id, event); + return E_NOTIMPL; +} + +static HRESULT WINAPI MFTransform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_TYPE message, ULONG_PTR param) +{ + struct mp3_decoder *decoder = impl_from_IMFTransform(iface); + HRESULT hr; + + TRACE("iface %p, message %#x, param %p stub!\n", iface, message, (void *)param); + + switch(message) + { + case MFT_MESSAGE_COMMAND_FLUSH: + if (FAILED(hr = IMediaObject_Flush(&decoder->IMediaObject_iface))) + return convert_dmo_to_mf_error(hr); + break; + case MFT_MESSAGE_COMMAND_DRAIN: + decoder->draining = TRUE; + break; + + case MFT_MESSAGE_NOTIFY_BEGIN_STREAMING: + case MFT_MESSAGE_NOTIFY_START_OF_STREAM: + if (FAILED(hr = IMediaObject_AllocateStreamingResources(&decoder->IMediaObject_iface))) + return convert_dmo_to_mf_error(hr); + break; + + case MFT_MESSAGE_NOTIFY_END_OF_STREAM: + case MFT_MESSAGE_NOTIFY_END_STREAMING: + if (FAILED(hr = IMediaObject_FreeStreamingResources(&decoder->IMediaObject_iface))) + return convert_dmo_to_mf_error(hr); + break; + + default: + FIXME("message %#x stub!\n", message); + break; + } + + return S_OK; +} + +static HRESULT WINAPI MFTransform_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags) +{ + struct mp3_decoder *decoder = impl_from_IMFTransform(iface); + LONGLONG sample_time, duration; + IMediaBuffer *dmo_buffer; + IMFMediaBuffer *buffer; + UINT32 discontinuity; + HRESULT hr; + + TRACE("iface %p, id %#lx, sample %p, flags %#lx.\n", iface, id, sample, flags); + + if (decoder->draining) + return MF_E_NOTACCEPTING; + + if (SUCCEEDED(IMFSample_GetUINT32(sample, &MFSampleExtension_Discontinuity, &discontinuity)) && discontinuity) + { + if (FAILED(hr = IMediaObject_Discontinuity(&decoder->IMediaObject_iface, id))) + return convert_dmo_to_mf_error(hr); + } + + if (FAILED(hr = IMFSample_ConvertToContiguousBuffer(sample, &buffer))) + return hr; + + hr = MFCreateLegacyMediaBufferOnMFMediaBuffer(sample, buffer, 0, &dmo_buffer); + IMFMediaBuffer_Release(buffer); + if (FAILED(hr)) + return hr; + + flags = 0; + + if (SUCCEEDED(IMFSample_GetSampleTime(sample, &sample_time))) + flags |= DMO_INPUT_DATA_BUFFERF_TIME; + + if (SUCCEEDED(IMFSample_GetSampleDuration(sample, &duration))) + flags |= DMO_INPUT_DATA_BUFFERF_TIMELENGTH; + + hr = IMediaObject_ProcessInput(&decoder->IMediaObject_iface, id, dmo_buffer, flags, sample_time, duration); + IMediaBuffer_Release(dmo_buffer); + if (FAILED(hr)) + return convert_dmo_to_mf_error(hr); + + return S_OK; +} + +static HRESULT WINAPI MFTransform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count, + MFT_OUTPUT_DATA_BUFFER *samples, DWORD *status) +{ + struct mp3_decoder *decoder = impl_from_IMFTransform(iface); + DMO_OUTPUT_DATA_BUFFER *dmo_output; + IMFMediaBuffer *buffer; + HRESULT hr; + int i; + + TRACE("iface %p, flags %#lx, count %lu, samples %p, status %p.\n", iface, flags, count, samples, status); + + if (count > 1) + { + FIXME("Multiple buffers not handled.\n"); + return E_INVALIDARG; + } + + dmo_output = calloc(count, sizeof(*dmo_output)); + if (!dmo_output) + return E_OUTOFMEMORY; + + for (i = 0; i < count; i++) + { + if (FAILED(hr = IMFSample_ConvertToContiguousBuffer(samples[i].pSample, &buffer))) + goto fail; + + hr = MFCreateLegacyMediaBufferOnMFMediaBuffer(samples[i].pSample, buffer, 0, &dmo_output[i].pBuffer); + IMFMediaBuffer_Release(buffer); + if (FAILED(hr)) + goto fail; + } + + hr = IMediaObject_ProcessOutput(&decoder->IMediaObject_iface, flags, count, dmo_output, status); + + for (i = 0; i < count; i++) + IMediaBuffer_Release(dmo_output[i].pBuffer); + + if (FAILED(hr)) + { + free(dmo_output); + return convert_dmo_to_mf_error(hr); + } + + for (i = 0; i < count; i++) + { + if (dmo_output[i].dwStatus & DMO_OUTPUT_DATA_BUFFERF_SYNCPOINT) + IMFSample_SetUINT32(samples[i].pSample, &MFSampleExtension_CleanPoint, 1); + + if (dmo_output[i].dwStatus & DMO_OUTPUT_DATA_BUFFERF_TIME) + IMFSample_SetSampleTime(samples[i].pSample, dmo_output[i].rtTimestamp); + + if (dmo_output[i].dwStatus & DMO_OUTPUT_DATA_BUFFERF_TIMELENGTH) + IMFSample_SetSampleDuration(samples[i].pSample, dmo_output[i].rtTimelength); + + if (dmo_output[i].dwStatus & DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE) + samples[i].dwStatus |= MFT_OUTPUT_DATA_BUFFER_INCOMPLETE; + } + + free(dmo_output); + + if (hr == S_FALSE) + { + decoder->draining = FALSE; + return MF_E_TRANSFORM_NEED_MORE_INPUT; + } + + return S_OK; + +fail: + for (i = 0; i < count; i++) + { + if (dmo_output[i].pBuffer) + IMediaBuffer_Release(dmo_output[i].pBuffer); + } + free(dmo_output); + + return hr; +} + +static const IMFTransformVtbl IMFTransform_vtbl = +{ + MFTransform_QueryInterface, + MFTransform_AddRef, + MFTransform_Release, + MFTransform_GetStreamLimits, + MFTransform_GetStreamCount, + MFTransform_GetStreamIDs, + MFTransform_GetInputStreamInfo, + MFTransform_GetOutputStreamInfo, + MFTransform_GetAttributes, + MFTransform_GetInputStreamAttributes, + MFTransform_GetOutputStreamAttributes, + MFTransform_DeleteInputStream, + MFTransform_AddInputStreams, + MFTransform_GetInputAvailableType, + MFTransform_GetOutputAvailableType, + MFTransform_SetInputType, + MFTransform_SetOutputType, + MFTransform_GetInputCurrentType, + MFTransform_GetOutputCurrentType, + MFTransform_GetInputStatus, + MFTransform_GetOutputStatus, + MFTransform_SetOutputBounds, + MFTransform_ProcessEvent, + MFTransform_ProcessMessage, + MFTransform_ProcessInput, + MFTransform_ProcessOutput, +}; + static HRESULT create_mp3_decoder(IUnknown *outer, REFIID iid, void **obj) { struct mp3_decoder *This; @@ -645,6 +1179,7 @@ static HRESULT create_mp3_decoder(IUnknown *outer, REFIID iid, void **obj) This->IUnknown_inner.lpVtbl = &Unknown_vtbl; This->IMediaObject_iface.lpVtbl = &MediaObject_vtbl; + This->IMFTransform_iface.lpVtbl = &IMFTransform_vtbl; This->ref = 1; This->outer = outer ? outer : &This->IUnknown_inner; @@ -733,6 +1268,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **obj) */ HRESULT WINAPI DllRegisterServer(void) { + MFT_REGISTER_TYPE_INFO mf_in, mf_out; DMO_PARTIAL_MEDIATYPE in, out; HRESULT hr; @@ -740,9 +1276,16 @@ HRESULT WINAPI DllRegisterServer(void) in.subtype = WMMEDIASUBTYPE_MP3; out.type = WMMEDIATYPE_Audio; out.subtype = WMMEDIASUBTYPE_PCM; + mf_in.guidMajorType = MFMediaType_Audio; + mf_in.guidSubtype = MFAudioFormat_MP3; + mf_out.guidMajorType = MFMediaType_Audio; + mf_out.guidSubtype = MFAudioFormat_PCM; hr = DMORegister(L"MP3 Decoder DMO", &CLSID_CMP3DecMediaObject, &DMOCATEGORY_AUDIO_DECODER, 0, 1, &in, 1, &out); if (FAILED(hr)) return hr; + hr = MFTRegister(CLSID_CMP3DecMediaObject, MFT_CATEGORY_AUDIO_DECODER, (LPWSTR) L"MP3 Decoder MFT", + 0, 1, &mf_in, 1, &mf_out, NULL); + if (FAILED(hr)) return hr; return __wine_register_resources(); } @@ -756,6 +1299,8 @@ HRESULT WINAPI DllUnregisterServer(void) hr = DMOUnregister(&CLSID_CMP3DecMediaObject, &DMOCATEGORY_AUDIO_DECODER); if (FAILED(hr)) return hr; + hr = MFTUnregister(CLSID_CMP3DecMediaObject); + if (FAILED(hr)) return hr; return __wine_unregister_resources(); } From 17bffba3c82f93a70c64c7b0ae86382b2d552557 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Fri, 28 Feb 2025 14:45:07 +1100 Subject: [PATCH 1255/2542] mfsrcsnk: Register the MP3 Byte Stream Handler class. (cherry picked from commit 464347a6023e0ca99bdafdd3c9cdaf3049d0d916) CW-Bug-Id: #24502 --- dlls/mfsrcsnk/factory.c | 2 ++ dlls/mfsrcsnk/media_source.c | 26 ++++++++++++++++++++++++++ dlls/mfsrcsnk/media_source.h | 1 + dlls/mfsrcsnk/mfsrcsnk.idl | 7 +++++++ dlls/mfsrcsnk/mfsrcsnk.rgs | 13 +++++++++++++ dlls/mp3dmod/mp3dmod.c | 2 ++ include/wine/mfinternal.idl | 1 + 7 files changed, 52 insertions(+) diff --git a/dlls/mfsrcsnk/factory.c b/dlls/mfsrcsnk/factory.c index c0a02d5fa9de..d8fe4268feb2 100644 --- a/dlls/mfsrcsnk/factory.c +++ b/dlls/mfsrcsnk/factory.c @@ -33,6 +33,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out) return IClassFactory_QueryInterface(&avi_byte_stream_plugin_factory, riid, out); if (IsEqualGUID(clsid, &CLSID_WAVByteStreamPlugin)) return IClassFactory_QueryInterface(&wav_byte_stream_plugin_factory, riid, out); + if (IsEqualGUID(clsid, &CLSID_MP3ByteStreamPlugin)) + return IClassFactory_QueryInterface(&mp3_byte_stream_plugin_factory, riid, out); if (IsEqualGUID(clsid, &CLSID_MFWAVESinkClassFactory)) return IClassFactory_QueryInterface(wave_sink_class_factory, riid, out); diff --git a/dlls/mfsrcsnk/media_source.c b/dlls/mfsrcsnk/media_source.c index a5ec3beba811..6ef8a3f8f4cb 100644 --- a/dlls/mfsrcsnk/media_source.c +++ b/dlls/mfsrcsnk/media_source.c @@ -2085,3 +2085,29 @@ static const IClassFactoryVtbl wav_byte_stream_plugin_factory_vtbl = }; IClassFactory wav_byte_stream_plugin_factory = {&wav_byte_stream_plugin_factory_vtbl}; + +static HRESULT WINAPI mp3_byte_stream_plugin_factory_CreateInstance(IClassFactory *iface, + IUnknown *outer, REFIID riid, void **out) +{ + NTSTATUS status; + + if ((status = winedmo_demuxer_check("audio/mp3")) || use_gst_byte_stream_handler()) + { + static const GUID CLSID_GStreamerByteStreamHandler = {0x317df618,0x5e5a,0x468a,{0x9f,0x15,0xd8,0x27,0xa9,0xa0,0x81,0x62}}; + if (status) WARN("Unsupported demuxer, status %#lx.\n", status); + return CoCreateInstance(&CLSID_GStreamerByteStreamHandler, outer, CLSCTX_INPROC_SERVER, riid, out); + } + + return byte_stream_plugin_create(outer, riid, out); +} + +static const IClassFactoryVtbl mp3_byte_stream_plugin_factory_vtbl = +{ + class_factory_QueryInterface, + class_factory_AddRef, + class_factory_Release, + mp3_byte_stream_plugin_factory_CreateInstance, + class_factory_LockServer, +}; + +IClassFactory mp3_byte_stream_plugin_factory = {&mp3_byte_stream_plugin_factory_vtbl}; diff --git a/dlls/mfsrcsnk/media_source.h b/dlls/mfsrcsnk/media_source.h index 1e6c90ea7d5b..7703e7634ec0 100644 --- a/dlls/mfsrcsnk/media_source.h +++ b/dlls/mfsrcsnk/media_source.h @@ -24,3 +24,4 @@ extern IClassFactory asf_byte_stream_plugin_factory; extern IClassFactory avi_byte_stream_plugin_factory; extern IClassFactory mpeg4_byte_stream_plugin_factory; extern IClassFactory wav_byte_stream_plugin_factory; +extern IClassFactory mp3_byte_stream_plugin_factory; diff --git a/dlls/mfsrcsnk/mfsrcsnk.idl b/dlls/mfsrcsnk/mfsrcsnk.idl index 10b41769060c..e6473b355e92 100644 --- a/dlls/mfsrcsnk/mfsrcsnk.idl +++ b/dlls/mfsrcsnk/mfsrcsnk.idl @@ -38,3 +38,10 @@ coclass MFWAVESinkClassFactory { } uuid(42c9b9f5-16fc-47ef-af22-da05f7c842e3) ] coclass WAVByteStreamPlugin {} + +[ + helpstring("MP3 Byte Stream Handler"), + threading(both), + uuid(a82e50ba-8e92-41eb-9df2-433f50ec2993) +] +coclass MP3ByteStreamPlugin {} diff --git a/dlls/mfsrcsnk/mfsrcsnk.rgs b/dlls/mfsrcsnk/mfsrcsnk.rgs index c8272189273b..dcdcb165db12 100644 --- a/dlls/mfsrcsnk/mfsrcsnk.rgs +++ b/dlls/mfsrcsnk/mfsrcsnk.rgs @@ -37,6 +37,19 @@ HKLM { val '{42c9b9f5-16fc-47ef-af22-da05f7c842e3}' = s 'WAV Byte Stream Handler' } + + '.mp3' + { + val '{a82e50ba-8e92-41eb-9df2-433f50ec2993}' = s 'MP3 Byte Stream Handler' + } + 'audio/mp3' + { + val '{a82e50ba-8e92-41eb-9df2-433f50ec2993}' = s 'MP3 Byte Stream Handler' + } + 'audio/x-mp3' + { + val '{a82e50ba-8e92-41eb-9df2-433f50ec2993}' = s 'MP3 Byte Stream Handler' + } } } } diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index 82da02bfaeec..bf518f38f39c 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -872,6 +872,7 @@ static HRESULT WINAPI MFTransform_GetOutputAvailableType(IMFTransform *iface, DW IMFMediaType_Release(*type); return hr; } + static HRESULT WINAPI MFTransform_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) { struct mp3_decoder *decoder = impl_from_IMFTransform(iface); @@ -991,6 +992,7 @@ static HRESULT WINAPI MFTransform_ProcessMessage(IMFTransform *iface, MFT_MESSAG if (FAILED(hr = IMediaObject_Flush(&decoder->IMediaObject_iface))) return convert_dmo_to_mf_error(hr); break; + case MFT_MESSAGE_COMMAND_DRAIN: decoder->draining = TRUE; break; diff --git a/include/wine/mfinternal.idl b/include/wine/mfinternal.idl index 3fc915c04377..0b77eaefab1a 100644 --- a/include/wine/mfinternal.idl +++ b/include/wine/mfinternal.idl @@ -71,3 +71,4 @@ cpp_quote("DEFINE_GUID(CLSID_AsfByteStreamPlugin, 0x41457294, 0x644c, 0x4298, 0x cpp_quote("DEFINE_GUID(CLSID_AVIByteStreamPlugin, 0x7afa253e, 0xf823, 0x42f6, 0xa5, 0xd9, 0x71, 0x4b, 0xde, 0x46, 0x74, 0x12);") cpp_quote("DEFINE_GUID(CLSID_MPEG4ByteStreamHandlerPlugin, 0x271c3902, 0x6095, 0x4c45, 0xa2, 0x2f, 0x20, 0x09, 0x18, 0x16, 0xee, 0x9e);") cpp_quote("DEFINE_GUID(CLSID_WAVByteStreamPlugin, 0x42c9b9f5, 0x16fc, 0x47ef, 0xaf, 0x22, 0xda, 0x05, 0xf7, 0xc8, 0x42, 0xe3);") +cpp_quote("DEFINE_GUID(CLSID_MP3ByteStreamPlugin, 0xa82e50ba, 0x8e92, 0x41eb, 0x9d, 0xf2, 0x43, 0x3f, 0x50, 0xec, 0x29, 0x93);") From 5599fbaaa4bb2d4cc56445e7c4ac0488f87dd8c5 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Thu, 5 Dec 2024 09:21:18 +1100 Subject: [PATCH 1256/2542] mfplat: Add mp3 resolver hint. (cherry picked from commit 4cb856a95de0d28947fe59a98296682a7444894e) CW-Bug-Id: #24502 --- dlls/mfplat/main.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index a5fd332b0dec..0a7c294294e4 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -6208,14 +6208,18 @@ static HRESULT resolver_create_bytestream_handler(IMFByteStream *stream, DWORD f static HRESULT resolver_get_bytestream_url_hint(IMFByteStream *stream, WCHAR const **url) { - static const unsigned char asfmagic[] = {0x30,0x26,0xb2,0x75,0x8e,0x66,0xcf,0x11,0xa6,0xd9,0x00,0xaa,0x00,0x62,0xce,0x6c}; - static const unsigned char wavmagic[] = { 'R', 'I', 'F', 'F',0x00,0x00,0x00,0x00, 'W', 'A', 'V', 'E', 'f', 'm', 't', ' '}; - static const unsigned char wavmask[] = {0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; - static const unsigned char isommagic[] = {0x00,0x00,0x00,0x00, 'f', 't', 'y', 'p', 'i', 's', 'o', 'm',0x00,0x00,0x00,0x00}; - static const unsigned char mp4_magic[] = {0x00,0x00,0x00,0x00, 'f', 't', 'y', 'p', 'M', 'S', 'N', 'V',0x00,0x00,0x00,0x00}; - static const unsigned char mp42magic[] = {0x00,0x00,0x00,0x00, 'f', 't', 'y', 'p', 'm', 'p', '4', '2',0x00,0x00,0x00,0x00}; - static const unsigned char mp4vmagic[] = {0x00,0x00,0x00,0x00, 'f', 't', 'y', 'p', 'M', '4', 'V', ' ',0x00,0x00,0x00,0x00}; - static const unsigned char mp4mask[] = {0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00}; + static const unsigned char asfmagic[] = {0x30,0x26,0xb2,0x75,0x8e,0x66,0xcf,0x11,0xa6,0xd9,0x00,0xaa,0x00,0x62,0xce,0x6c}; + static const unsigned char wavmagic[] = { 'R', 'I', 'F', 'F',0x00,0x00,0x00,0x00, 'W', 'A', 'V', 'E', 'f', 'm', 't', ' '}; + static const unsigned char wavmask[] = {0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; + static const unsigned char isommagic[] = {0x00,0x00,0x00,0x00, 'f', 't', 'y', 'p', 'i', 's', 'o', 'm',0x00,0x00,0x00,0x00}; + static const unsigned char mp4_magic[] = {0x00,0x00,0x00,0x00, 'f', 't', 'y', 'p', 'M', 'S', 'N', 'V',0x00,0x00,0x00,0x00}; + static const unsigned char mp42magic[] = {0x00,0x00,0x00,0x00, 'f', 't', 'y', 'p', 'm', 'p', '4', '2',0x00,0x00,0x00,0x00}; + static const unsigned char mp4vmagic[] = {0x00,0x00,0x00,0x00, 'f', 't', 'y', 'p', 'M', '4', 'V', ' ',0x00,0x00,0x00,0x00}; + static const unsigned char mp4mask[] = {0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00}; + static const unsigned char mp3magic[] = {0xff,0xf2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; + static const unsigned char mp3mask[] = {0xff,0xf6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; + static const unsigned char idv2_3_magic[] = {'I','D','3',0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; + static const unsigned char idv2_3_mask[] = {0xff,0xff,0xff,0xff,0x00,0x1f,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00}; static const struct stream_content_url_hint { const unsigned char *magic; @@ -6230,6 +6234,8 @@ static HRESULT resolver_get_bytestream_url_hint(IMFByteStream *stream, WCHAR con { mp42magic, L".mp4", mp4mask }, { mp4_magic, L".mp4", mp4mask }, { mp4vmagic, L".m4v", mp4mask }, + { mp3magic, L".mp3", mp3mask }, + { idv2_3_magic, L".mp3", idv2_3_mask }, }; unsigned char buffer[4 * sizeof(unsigned int)], pattern[4 * sizeof(unsigned int)]; IMFAttributes *attributes; From f06f2491f22b39ca3a3e44fbf99b1d88a47c0ddf Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Mon, 24 Feb 2025 18:37:56 -0600 Subject: [PATCH 1257/2542] wined3d: Interpret Y'CbCr values as being from the reduced range. (cherry picked from commit 7db5113ccc71ff72b1daabf8415ede10b3392a11) CW-Bug-Id: #24721 --- dlls/wined3d/glsl_shader.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index b3c28dfdba87..d325c0fe472c 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -12692,7 +12692,14 @@ static void glsl_blitter_generate_yuv_shader(struct wined3d_string_buffer *buffe { enum complex_fixup complex_fixup = get_complex_fixup(args->fixup); - shader_addline(buffer, "const vec4 yuv_coef = vec4(1.403, -0.344, -0.714, 1.770);\n"); + /* Drivers disagree on whether the Y'CbCr components should be interpreted + * as being in the [0,255] range (NVidia, but this is configurable) or the + * reduced [16,235]/[16,240] range (AMD, WARP). + * The game Locoland plays back video inside a black frame, the background + * of which only matches the frame if the reduced range is used, so we side + * with the reduced range here. */ + + shader_addline(buffer, "const vec4 yuv_coef = vec4(1.596, -0.392, -0.813, 2.017);\n"); shader_addline(buffer, "float luminance;\n"); shader_addline(buffer, "vec2 texcoord;\n"); shader_addline(buffer, "vec2 chroma;\n"); @@ -12734,6 +12741,7 @@ static void glsl_blitter_generate_yuv_shader(struct wined3d_string_buffer *buffe * http://www.fourcc.org/fccyvrgb.php. Note that the chroma * ranges from -0.5 to 0.5. */ shader_addline(buffer, "\n chroma.xy -= 0.5;\n"); + shader_addline(buffer, " luminance = (luminance - 0.063) * 1.164;\n"); shader_addline(buffer, " %s.x = luminance + chroma.x * yuv_coef.x;\n", output); shader_addline(buffer, " %s.y = luminance + chroma.y * yuv_coef.y + chroma.x * yuv_coef.z;\n", output); From 7d53ebe6ed955cf413bfb657dfdbcde8a3b4c2c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 10 Mar 2025 14:25:42 +0100 Subject: [PATCH 1258/2542] winex11: Initialize _NET_ACTIVE_WINDOW on thread init. CW-Bug-Id: #24999 --- dlls/winex11.drv/event.c | 2 +- dlls/winex11.drv/window.c | 12 ++++++++++++ dlls/winex11.drv/x11drv.h | 2 ++ dlls/winex11.drv/x11drv_main.c | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 7ae5d1e56b09..d2d6031d597b 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1301,7 +1301,7 @@ static void get_window_mwm_hints( Display *display, Window window, MwmHints *hin } } -static Window get_net_active_window( Display *display, char **name ) +Window get_net_active_window( Display *display, char **name ) { unsigned long count, remaining; Window window = None, *value; diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 9cb742923108..ad879e0f5175 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1935,10 +1935,22 @@ void net_active_window_notify( unsigned long serial, Window value, Time time ) received = wine_dbg_sprintf( "_NET_ACTIVE_WINDOW %p/%lx serial %lu time %lu", hwnd, value, serial, time ); expected = *expect_serial ? wine_dbg_sprintf( ", expected %p/%lx serial %lu", expect_hwnd, *pending, *expect_serial ) : ""; + + if (hwnd == (HWND)-1) value = root_window; handle_state_change( serial, expect_serial, sizeof(value), &value, desired, pending, current, expected, "", received, NULL ); } +void net_active_window_init( struct x11drv_thread_data *data ) +{ + Window window = get_net_active_window( data->display, &data->active_window ); + + if (hwnd_from_window( data->display, window ) == (HWND)-1) window = root_window; + data->desired_net_active_window = window; + data->pending_net_active_window = window; + data->current_net_active_window = window; +} + void set_net_active_window( HWND hwnd, HWND previous ) { struct x11drv_thread_data *data = x11drv_thread_data(); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 5e8bfc126025..51711281f8a8 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -702,6 +702,8 @@ extern void window_configure_notify( struct x11drv_win_data *data, unsigned long extern BOOL get_window_name( Display *display, Window window, char **name ); extern void set_net_active_window( HWND hwnd, HWND previous ); extern void net_active_window_notify( unsigned long serial, Window window, Time time ); +extern Window get_net_active_window( Display *display, char **name ); +extern void net_active_window_init( struct x11drv_thread_data *data ); extern void net_supported_init( struct x11drv_thread_data *data ); extern void net_supporting_wm_check_init( struct x11drv_thread_data *data ); extern BOOL is_netwm_supported( Atom atom ); diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index decdf6317393..5f4ad6ea907b 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -866,6 +866,7 @@ struct x11drv_thread_data *x11drv_init_thread_data(void) x11drv_xinput2_init( data ); net_supported_init( data ); net_supporting_wm_check_init( data ); + net_active_window_init( data ); return data; } From c091154ad473460e5d428fcd5d38c8f0a066be87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 10 Mar 2025 14:41:38 +0100 Subject: [PATCH 1259/2542] winex11: Change pending swp_flags when activating a window that is being mapped. CW-Bug-Id: #24999 --- dlls/winex11.drv/window.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index ad879e0f5175..622702c14646 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1951,6 +1951,18 @@ void net_active_window_init( struct x11drv_thread_data *data ) data->current_net_active_window = window; } +static BOOL window_set_pending_activate( HWND hwnd ) +{ + struct x11drv_win_data *data; + BOOL pending; + + if (!(data = get_win_data( hwnd ))) return FALSE; + if ((pending = !!data->wm_state_serial)) data->pending_state.swp_flags &= ~SWP_NOACTIVATE; + release_win_data( data ); + + return pending; +} + void set_net_active_window( HWND hwnd, HWND previous ) { struct x11drv_thread_data *data = x11drv_thread_data(); @@ -1958,9 +1970,9 @@ void set_net_active_window( HWND hwnd, HWND previous ) XEvent xev; if (!is_netwm_supported( x11drv_atom(_NET_ACTIVE_WINDOW) )) return; - if (window_has_pending_wm_state( hwnd, -1 )) return; if (!(window = X11DRV_get_whole_window( hwnd ))) return; if (data->pending_net_active_window == window) return; + if (window_set_pending_activate( hwnd )) return; xev.xclient.type = ClientMessage; xev.xclient.window = window; From a4750220cb46b185004489063363170eeb2fd31f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20K=C3=B6lbl?= Date: Wed, 19 Feb 2025 14:12:27 +0100 Subject: [PATCH 1260/2542] wine.inf: Add VC runtime version key. The Unreal engine bootstrapper relies on this to detect VC presence since version 5.3. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56695 CW-Bug-Id: #24615 (cherry picked from commit 1f947b1c62c4f6fdfad4da812567cf33c904c1eb) --- loader/wine.inf.in | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 415c5e458f2b..df2915ac2ba1 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -73,6 +73,7 @@ AddReg=\ SteamClient,\ Tapi,\ ThemeManager,\ + VCRuntime.ntx86,\ LicenseInformation [DefaultInstall.NT] @@ -99,6 +100,7 @@ AddReg=\ SteamClient,\ Tapi,\ ThemeManager,\ + VCRuntime.ntx86,\ VersionInfo,\ LicenseInformation,\ NVIDIANGX, \ @@ -129,6 +131,7 @@ AddReg=\ SteamClient64,\ Tapi,\ ThemeManager,\ + VCRuntime.ntamd64,\ VersionInfo,\ LicenseInformation,\ NVIDIANGX, \ @@ -160,6 +163,8 @@ AddReg=\ SteamClient64,\ Tapi,\ ThemeManager,\ + VCRuntime.ntamd64,\ + VCRuntime.ntarm64,\ VersionInfo,\ LicenseInformation @@ -178,6 +183,8 @@ AddReg=\ SteamClient64,\ Packages.wow64,\ Tapi,\ + VCRuntime.ntamd64,\ + VCRuntime.ntx86,\ VersionInfo,\ LicenseInformation,\ NVIDIANGX, \ @@ -2217,6 +2224,30 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"LongDistanceRule",," 8WFG" HKLM,%CurrentVersion%\Telephony\Country List\998,"Name",,"Uzbekistan" HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" +[VCRuntime.ntamd64] +HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64,"Bld",0x10003,0x00008681 +HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64,"Installed",0x10003,0x00000001 +HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64,"Major",0x10003,0x0000000e +HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64,"Minor",0x10003,0x0000002a +HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64,"Rbld",0x10003,0x00000000 +HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64,"Version",2,"14.42.34433.0" + +[VCRuntime.ntarm64] +HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\arm64,"Bld",0x10003,0x00008681 +HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\arm64,"Installed",0x10003,0x00000001 +HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\arm64,"Major",0x10003,0x0000000e +HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\arm64,"Minor",0x10003,0x0000002a +HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\arm64,"Rbld",0x10003,0x00000000 +HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\arm64,"Version",2,"14.42.34433.0" + +[VCRuntime.ntx86] +HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86,"Bld",0x10003,0x00008681 +HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86,"Installed",0x10003,0x00000001 +HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86,"Major",0x10003,0x0000000e +HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86,"Minor",0x10003,0x0000002a +HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86,"Rbld",0x10003,0x00000000 +HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86,"Version",2,"14.42.34433.0" + [RegisterDllsSection] ;;some dlls have to be registered first 11,,shell32.dll,1 From faaff4ec937d8d8f4c0d5cc8654b624d1373e134 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 10 Mar 2025 11:42:23 -0600 Subject: [PATCH 1261/2542] setupapi: Fix buffer size passed to SetupDiGetDeviceInstanceIdW() in get_device_id_list(). CW-Bug-Id: #24963 --- dlls/setupapi/devinst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index a457dd40541c..4238cee4111c 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -4538,7 +4538,7 @@ static CONFIGRET get_device_id_list(const WCHAR *filter, WCHAR *buffer, ULONG *l p = buffer; for (i = 0; SetupDiEnumDeviceInfo(set, i, &device); ++i) { - ret = SetupDiGetDeviceInstanceIdW(set, &device, id, sizeof(id), NULL); + ret = SetupDiGetDeviceInstanceIdW(set, &device, id, sizeof(id) / sizeof(*id), NULL); if (!ret) continue; id_len = wcslen(id) + 1; needed += id_len; From 2f6a6f9c82b08b695a3f8a4f332a270776e59c7e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 10 Mar 2025 11:43:06 -0600 Subject: [PATCH 1262/2542] setupapi: Increase id buffer size in get_device_id_list(). CW-Bug-Id: #24963 --- dlls/setupapi/devinst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 4238cee4111c..008dff413ffb 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -4492,8 +4492,8 @@ static CONFIGRET get_device_id_list(const WCHAR *filter, WCHAR *buffer, ULONG *l GUID guid, *pguid = NULL; unsigned int i, id_len; ULONG query_flags = 0; + WCHAR id[256]; HDEVINFO set; - WCHAR id[64]; ULONG needed; WCHAR *p; From 0b84d99c823c9b76105b7ed6e0dd4e6a6ae7b1bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 11 Mar 2025 14:23:20 +0100 Subject: [PATCH 1263/2542] win32u: Don't set foreground window if window is minimized. CW-Bug-Id: #24956 (cherry picked from commit c67bfdbeba1860c891e53c64379f5e86d8e8b664) --- dlls/win32u/window.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 00c61ecc9b91..9f42dfa5942d 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -3892,10 +3892,11 @@ BOOL set_window_pos( WINDOWPOS *winpos, int parent_x, int parent_y ) if (!(winpos->flags & (SWP_NOACTIVATE|SWP_HIDEWINDOW))) { + UINT style = get_window_long( winpos->hwnd, GWL_STYLE ); /* child windows get WM_CHILDACTIVATE message */ - if ((get_window_long( winpos->hwnd, GWL_STYLE ) & (WS_CHILD | WS_POPUP)) == WS_CHILD) + if ((style & (WS_CHILD | WS_POPUP)) == WS_CHILD) send_message( winpos->hwnd, WM_CHILDACTIVATE, 0, 0 ); - else + else if (!(style & WS_MINIMIZE)) set_foreground_window( winpos->hwnd, FALSE ); } From fb927b83093dbbea9ee7850eb06cf5aeb051327a Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 11 Mar 2025 19:44:43 -0600 Subject: [PATCH 1264/2542] win32u: Prevent remote drawing to ULW layered window. CW-Bug-Id: #24991 --- dlls/win32u/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 9f42dfa5942d..20ba9049e753 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -2136,7 +2136,7 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru extra_rects[0] = extra_rects[1] = new_rects->visible; if (new_surface) { - extra_rects[1] = new_surface->rect; + extra_rects[1] = is_layered ? dummy_surface.rect : new_surface->rect; OffsetRect( &extra_rects[1], new_rects->visible.left, new_rects->visible.top ); } if (valid_rects) extra_rects[2] = valid_rects[0]; From ec67118b7d1c24e0eacf4c5dca798770bd4d0c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 11 Mar 2025 12:31:45 +0100 Subject: [PATCH 1265/2542] HACK: winex11: Always request NET_WM_STATE_MAXIMIZED with NET_WM_STATE_FULLSCREEN. In order not to be suprised by the reply when KWin automatically adds it. CW-Bug-Id: #25008 --- dlls/winex11.drv/window.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 622702c14646..d175a2e8128f 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1258,6 +1258,11 @@ static void window_set_net_wm_state( struct x11drv_win_data *data, UINT new_stat */ if (X11DRV_HasWindowManager( "steamcompmgr" )) new_state &= ~fullscreen_mask; + /* KWin sometimes combines NET_WM_STATE_FULLSCREEN with NET_WM_STATE_MAXIMIZED, but sometimes doesn't. + * Make sure we request both at the same time, so we don't get unexpected value when NET_WM_STATE_MAXIMIZED is added. + */ + if (X11DRV_HasWindowManager( "KWin" ) && (new_state & (1 << NET_WM_STATE_FULLSCREEN))) new_state |= (1 << NET_WM_STATE_MAXIMIZED); + new_state &= x11drv_thread_data()->net_wm_state_mask; data->desired_state.net_wm_state = new_state; if (!data->whole_window) return; /* no window, nothing to update */ @@ -1496,6 +1501,11 @@ UINT get_window_net_wm_state( Display *display, Window window ) if (!maximized_horz) new_state &= ~(1 << NET_WM_STATE_MAXIMIZED); + /* KWin sometimes combines NET_WM_STATE_FULLSCREEN with NET_WM_STATE_MAXIMIZED, but sometimes doesn't. + * Make sure both are always set in replies, so we don't change the win32 state unnecessarily. + */ + if (X11DRV_HasWindowManager( "KWin" ) && (new_state & (1 << NET_WM_STATE_FULLSCREEN))) new_state |= (1 << NET_WM_STATE_MAXIMIZED); + return new_state; } From c9dd81dd42f66ff621a15b0d1b4183e3ff840b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 12 Mar 2025 16:24:12 +0100 Subject: [PATCH 1266/2542] winex11: Compute new window style from current_state consistently. CW-Bug-Id: #25022 --- dlls/winex11.drv/window.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index d175a2e8128f..bafb7fb3fe2b 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1721,7 +1721,7 @@ static UINT window_update_client_state( struct x11drv_win_data *data ) if ((old_style & WS_MINIMIZE) && !(new_style & WS_MINIMIZE)) { - if ((old_style & WS_CAPTION) == WS_CAPTION && (data->current_state.net_wm_state & (1 << NET_WM_STATE_MAXIMIZED))) + if ((old_style & WS_CAPTION) == WS_CAPTION && (new_style & WS_MAXIMIZE)) { if ((old_style & WS_MAXIMIZEBOX) && !(old_style & WS_DISABLED)) { @@ -1751,7 +1751,7 @@ static UINT window_update_client_state( struct x11drv_win_data *data ) static UINT window_update_client_config( struct x11drv_win_data *data ) { static const UINT fullscreen_mask = (1 << NET_WM_STATE_MAXIMIZED) | (1 << NET_WM_STATE_FULLSCREEN); - UINT old_style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ), flags; + UINT old_style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ), new_style, flags; RECT rect, old_rect = data->rects.window, new_rect; if (!data->managed) return 0; /* unmanaged windows are managed by the Win32 side */ @@ -1761,14 +1761,19 @@ static UINT window_update_client_config( struct x11drv_win_data *data ) if (data->net_wm_state_serial) return 0; /* another _NET_WM_STATE update is pending, wait for it to complete */ if (data->configure_serial) return 0; /* another config update is pending, wait for it to complete */ + new_style = old_style & ~(WS_VISIBLE | WS_MINIMIZE | WS_MAXIMIZE); + if (data->current_state.wm_state != WithdrawnState) new_style |= WS_VISIBLE; + if (data->current_state.wm_state == IconicState) new_style |= WS_MINIMIZE; + if (data->current_state.net_wm_state & (1 << NET_WM_STATE_MAXIMIZED)) new_style |= WS_MAXIMIZE; + if ((old_style & WS_CAPTION) == WS_CAPTION || !data->is_fullscreen) { - if ((data->current_state.net_wm_state & (1 << NET_WM_STATE_MAXIMIZED)) && !(old_style & WS_MAXIMIZE)) + if ((new_style & WS_MAXIMIZE) && !(old_style & WS_MAXIMIZE)) { TRACE( "window %p/%lx is maximized\n", data->hwnd, data->whole_window ); return SC_MAXIMIZE; } - if (!(data->current_state.net_wm_state & (1 << NET_WM_STATE_MAXIMIZED)) && (old_style & WS_MAXIMIZE)) + if (!(new_style & WS_MAXIMIZE) && (old_style & WS_MAXIMIZE)) { TRACE( "window %p/%lx is no longer maximized\n", data->hwnd, data->whole_window ); return SC_RESTORE; From a1ed3d04a75ba91b1169e97de733fac19af6d705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 12 Mar 2025 16:28:17 +0100 Subject: [PATCH 1267/2542] HACK: winex11: Ignore fullscreen windows maximize changes with KWin. CW-Bug-Id: #25022 --- dlls/winex11.drv/window.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index bafb7fb3fe2b..9852158add82 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1719,6 +1719,12 @@ static UINT window_update_client_state( struct x11drv_win_data *data ) if (data->current_state.wm_state == IconicState) new_style |= WS_MINIMIZE; if (data->current_state.net_wm_state & (1 << NET_WM_STATE_MAXIMIZED)) new_style |= WS_MAXIMIZE; + /* KWin sometimes combines NET_WM_STATE_FULLSCREEN with NET_WM_STATE_MAXIMIZED, but sometimes doesn't. + * Don't feeding back the maximized state to the Win32 side when windows are fullscreen. + */ + if (X11DRV_HasWindowManager( "KWin" ) && data->current_state.net_wm_state & (1 << NET_WM_STATE_FULLSCREEN)) + new_style = (new_style & ~WS_MAXIMIZE) | (old_style & WS_MAXIMIZE); + if ((old_style & WS_MINIMIZE) && !(new_style & WS_MINIMIZE)) { if ((old_style & WS_CAPTION) == WS_CAPTION && (new_style & WS_MAXIMIZE)) @@ -1766,6 +1772,12 @@ static UINT window_update_client_config( struct x11drv_win_data *data ) if (data->current_state.wm_state == IconicState) new_style |= WS_MINIMIZE; if (data->current_state.net_wm_state & (1 << NET_WM_STATE_MAXIMIZED)) new_style |= WS_MAXIMIZE; + /* KWin sometimes combines NET_WM_STATE_FULLSCREEN with NET_WM_STATE_MAXIMIZED, but sometimes doesn't. + * Don't feeding back the maximized state to the Win32 side when windows are fullscreen. + */ + if (X11DRV_HasWindowManager( "KWin" ) && data->current_state.net_wm_state & (1 << NET_WM_STATE_FULLSCREEN)) + new_style = (new_style & ~WS_MAXIMIZE) | (old_style & WS_MAXIMIZE); + if ((old_style & WS_CAPTION) == WS_CAPTION || !data->is_fullscreen) { if ((new_style & WS_MAXIMIZE) && !(old_style & WS_MAXIMIZE)) From 088163a9a866621c664e77a81c44530a97205967 Mon Sep 17 00:00:00 2001 From: Raphael Riemann Date: Fri, 7 Mar 2025 15:12:21 +0100 Subject: [PATCH 1268/2542] kernelbase: Add WerRegisterCustomMetadata stub. Microsoft Flight Simulator 2024 needs this since SU1. (cherry picked from commit 9329843456750372e771d4967190374554d20523) CW-Bug-Id: #25025 --- dlls/kernel32/kernel32.spec | 2 ++ dlls/kernelbase/debug.c | 20 ++++++++++++++++++++ dlls/kernelbase/kernelbase.spec | 2 ++ include/werapi.h | 2 ++ 4 files changed, 26 insertions(+) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index e21041ae9eef..fff2d8e46784 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -1630,10 +1630,12 @@ @ stdcall WakeAllConditionVariable(ptr) NTDLL.RtlWakeAllConditionVariable @ stdcall WakeConditionVariable(ptr) NTDLL.RtlWakeConditionVariable @ stdcall -import WerGetFlags(ptr ptr) +@ stdcall -import WerRegisterCustomMetadata(wstr wstr) @ stdcall -import WerRegisterFile(wstr long long) @ stdcall -import WerRegisterMemoryBlock(ptr long) @ stdcall -import WerRegisterRuntimeExceptionModule(wstr ptr) @ stdcall -import WerSetFlags(long) +@ stdcall -import WerUnregisterCustomMetadata(wstr) @ stdcall -import WerUnregisterFile(wstr) @ stdcall -import WerUnregisterMemoryBlock(ptr) @ stdcall -import WerUnregisterRuntimeExceptionModule(wstr ptr) diff --git a/dlls/kernelbase/debug.c b/dlls/kernelbase/debug.c index 0b6c4f3dd7fd..6d24abc80ad7 100644 --- a/dlls/kernelbase/debug.c +++ b/dlls/kernelbase/debug.c @@ -781,6 +781,16 @@ HRESULT WINAPI /* DECLSPEC_HOTPATCH */ WerGetFlags( HANDLE process, DWORD *flags } +/*********************************************************************** + * WerRegisterCustomMetadata (kernelbase.@) + */ +HRESULT WINAPI /* DECLSPEC_HOTPATCH */ WerRegisterCustomMetadata( const WCHAR *key, const WCHAR *value ) +{ + FIXME( "(%s, %s) stub\n", debugstr_w(key), debugstr_w(value) ); + return S_OK; +} + + /*********************************************************************** * WerRegisterFile (kernelbase.@) */ @@ -822,6 +832,16 @@ HRESULT WINAPI /* DECLSPEC_HOTPATCH */ WerSetFlags( DWORD flags ) } +/*********************************************************************** + * WerUnregisterCustomMetadata (kernelbase.@) + */ +HRESULT WINAPI /* DECLSPEC_HOTPATCH */ WerUnregisterCustomMetadata( const WCHAR *key ) +{ + FIXME( "(%s) stub\n", debugstr_w(key)); + return S_OK; +} + + /*********************************************************************** * WerUnregisterFile (kernelbase.@) */ diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index d6b11b49f4c4..89320a8180c2 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -1754,10 +1754,12 @@ @ stdcall WakeByAddressSingle(ptr) ntdll.RtlWakeAddressSingle @ stdcall WakeConditionVariable(ptr) ntdll.RtlWakeConditionVariable @ stdcall WerGetFlags(ptr ptr) +@ stdcall WerRegisterCustomMetadata(wstr wstr) @ stdcall WerRegisterFile(wstr long long) @ stdcall WerRegisterMemoryBlock(ptr long) @ stdcall WerRegisterRuntimeExceptionModule(wstr ptr) @ stdcall WerSetFlags(long) +@ stdcall WerUnregisterCustomMetadata(wstr) @ stdcall WerUnregisterFile(wstr) @ stdcall WerUnregisterMemoryBlock(ptr) @ stdcall WerUnregisterRuntimeExceptionModule(wstr ptr) diff --git a/include/werapi.h b/include/werapi.h index 30ba6cd95058..344cecbd8140 100644 --- a/include/werapi.h +++ b/include/werapi.h @@ -175,6 +175,7 @@ typedef struct _WER_EXCEPTION_INFORMATION HRESULT WINAPI WerAddExcludedApplication(PCWSTR, BOOL); HRESULT WINAPI WerGetFlags(HANDLE process, DWORD *flags); +HRESULT WINAPI WerRegisterCustomMetadata(PCWSTR key, PCWSTR value); HRESULT WINAPI WerRegisterFile(PCWSTR file, WER_REGISTER_FILE_TYPE regfiletype, DWORD flags); HRESULT WINAPI WerRegisterMemoryBlock(void *block, DWORD size); HRESULT WINAPI WerRegisterRuntimeExceptionModule(PCWSTR callbackdll, void *context); @@ -186,6 +187,7 @@ HRESULT WINAPI WerReportSetParameter(HREPORT, DWORD, PCWSTR, PCWSTR); HRESULT WINAPI WerReportSetUIOption(HREPORT, WER_REPORT_UI, PCWSTR); HRESULT WINAPI WerReportSubmit(HREPORT, WER_CONSENT, DWORD, PWER_SUBMIT_RESULT); HRESULT WINAPI WerSetFlags(DWORD flags); +HRESULT WINAPI WerUnregisterCustomMetadata(PCWSTR key); HRESULT WINAPI WerUnregisterFile(PCWSTR file); HRESULT WINAPI WerUnregisterMemoryBlock(void *block); HRESULT WINAPI WerUnregisterRuntimeExceptionModule(PCWSTR callbackdll, void *context); From bb2d2cd12e8c123b86da42d8073a333d22a270f7 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Tue, 4 Mar 2025 17:39:20 +1000 Subject: [PATCH 1269/2542] mfplat: Do not zero-init memory buffers. This takes significant time for videos with a large frame size, which can delay audio sampling enough to cause samples to be dropped. CW-Bug-Id: #24914 --- dlls/mfplat/buffer.c | 1 - 1 file changed, 1 deletion(-) diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c index f3eb7f9222eb..76894d311751 100644 --- a/dlls/mfplat/buffer.c +++ b/dlls/mfplat/buffer.c @@ -1353,7 +1353,6 @@ static HRESULT memory_buffer_init(struct buffer *buffer, DWORD max_length, DWORD if (!(buffer->data = _aligned_malloc(max_length, alignment))) return E_OUTOFMEMORY; - memset(buffer->data, 0, max_length); buffer->IMFMediaBuffer_iface.lpVtbl = vtbl; buffer->refcount = 1; From d829f74044d43ea82e70a54d5dd3f330b0eec509 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 13 Mar 2025 14:03:09 -0600 Subject: [PATCH 1270/2542] win32u: Represent raw monitor dpi as rational value. Otherwise virtual display mode conversion results in inaccurate coordinates and introduces artefacting. CW-Bug-Id: #25029 --- dlls/win32u/clipping.c | 6 ++--- dlls/win32u/dce.c | 42 +++++++++++++++--------------- dlls/win32u/sysparams.c | 49 +++++++++++++++++++++++++---------- dlls/win32u/win32u_private.h | 8 +++--- dlls/win32u/window.c | 50 ++++++++++++++++++------------------ 5 files changed, 90 insertions(+), 65 deletions(-) diff --git a/dlls/win32u/clipping.c b/dlls/win32u/clipping.c index 1b2f2d881d0d..166baf1566ad 100644 --- a/dlls/win32u/clipping.c +++ b/dlls/win32u/clipping.c @@ -477,12 +477,12 @@ INT WINAPI NtGdiGetRandomRgn( HDC hDC, HRGN hRgn, INT iCode ) if (ret > 0 && (iCode & NTGDI_RGN_MONITOR_DPI)) { HWND hwnd = NtUserWindowFromDC( hDC ); - UINT raw_dpi; + UINT raw_dpi_num, raw_dpi_den; HRGN region; - get_win_monitor_dpi( hwnd, &raw_dpi ); + get_win_monitor_dpi( hwnd, &raw_dpi_num, &raw_dpi_den ); NtGdiOffsetRgn( hRgn, -dc->attr->vis_rect.left, -dc->attr->vis_rect.top ); - region = map_dpi_region( hRgn, get_dpi_for_window( hwnd ), raw_dpi ); + region = map_dpi_region( hRgn, get_dpi_for_window( hwnd ) * raw_dpi_den, raw_dpi_num ); NtGdiCombineRgn( hRgn, region, 0, RGN_COPY ); NtGdiDeleteObjectApp( region ); } diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index f715fcbb15b1..5db2d1b156af 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -145,7 +145,7 @@ struct scaled_surface struct window_surface header; struct window_surface *target_surface; UINT dpi_from; - UINT dpi_to; + UINT dpi_to_num, dpi_to_den; }; static struct scaled_surface *get_scaled_surface( struct window_surface *window_surface ) @@ -156,7 +156,7 @@ static struct scaled_surface *get_scaled_surface( struct window_surface *window_ static void scaled_surface_set_clip( struct window_surface *window_surface, const RECT *rects, UINT count ) { struct scaled_surface *surface = get_scaled_surface( window_surface ); - HRGN hrgn = map_dpi_region( window_surface->clip_region, surface->dpi_from, surface->dpi_to ); + HRGN hrgn = map_dpi_region( window_surface->clip_region, surface->dpi_from * surface->dpi_to_den, surface->dpi_to_num ); window_surface_set_clip( surface->target_surface, hrgn ); if (hrgn) NtGdiDeleteObjectApp( hrgn ); } @@ -174,7 +174,7 @@ static BOOL scaled_surface_flush( struct window_surface *window_surface, const R src.right = (src.right + 7) & ~7; src.bottom = (src.bottom + 7) & ~7; - dst = map_dpi_rect( src, surface->dpi_from, surface->dpi_to ); + dst = map_dpi_rect( src, surface->dpi_from * surface->dpi_to_den, surface->dpi_to_num ); hdc_dst = NtGdiCreateCompatibleDC( 0 ); hdc_src = NtGdiCreateCompatibleDC( 0 ); @@ -198,7 +198,7 @@ static BOOL scaled_surface_flush( struct window_surface *window_surface, const R if (shape_changed) { - HRGN hrgn = map_dpi_region( window_surface->shape_region, surface->dpi_from, surface->dpi_to ); + HRGN hrgn = map_dpi_region( window_surface->shape_region, surface->dpi_from * surface->dpi_to_den, surface->dpi_to_num ); window_surface_set_shape( surface->target_surface, hrgn ); if (hrgn) NtGdiDeleteObjectApp( hrgn ); @@ -223,15 +223,16 @@ static const struct window_surface_funcs scaled_surface_funcs = scaled_surface_destroy }; -static void scaled_surface_set_target( struct scaled_surface *surface, struct window_surface *target, UINT dpi_to ) +static void scaled_surface_set_target( struct scaled_surface *surface, struct window_surface *target, UINT dpi_to_num, UINT dpi_to_den ) { if (surface->target_surface) window_surface_release( surface->target_surface ); window_surface_add_ref( (surface->target_surface = target) ); - surface->dpi_to = dpi_to; + surface->dpi_to_num = dpi_to_num; + surface->dpi_to_den = dpi_to_den; } -static struct window_surface *scaled_surface_create( HWND hwnd, const RECT *surface_rect, UINT dpi_from, UINT dpi_to, - struct window_surface *target_surface ) +static struct window_surface *scaled_surface_create( HWND hwnd, const RECT *surface_rect, UINT dpi_from, UINT dpi_to_num, + UINT dpi_to_den, struct window_surface *target_surface ) { char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; BITMAPINFO *info = (BITMAPINFO *)buffer; @@ -251,7 +252,7 @@ static struct window_surface *scaled_surface_create( HWND hwnd, const RECT *surf { surface = get_scaled_surface( window_surface ); surface->dpi_from = dpi_from; - scaled_surface_set_target( surface, target_surface, dpi_to ); + scaled_surface_set_target( surface, target_surface, dpi_to_num, dpi_to_den ); } return window_surface; @@ -269,7 +270,7 @@ static RECT get_surface_rect( RECT rect ) return rect; } -void create_window_surface( HWND hwnd, BOOL create_layered, const RECT *surface_rect, UINT monitor_dpi, +void create_window_surface( HWND hwnd, BOOL create_layered, const RECT *surface_rect, UINT monitor_dpi_num, UINT monitor_dpi_den, struct window_surface **window_surface ) { struct window_surface *previous, *driver_surface; @@ -277,8 +278,8 @@ void create_window_surface( HWND hwnd, BOOL create_layered, const RECT *surface_ RECT monitor_rect; - monitor_rect = get_surface_rect( map_dpi_rect( *surface_rect, dpi, monitor_dpi ) ); - if ((driver_surface = get_driver_window_surface( *window_surface, monitor_dpi ))) + monitor_rect = get_surface_rect( map_dpi_rect( *surface_rect, dpi * monitor_dpi_den, monitor_dpi_num ) ); + if ((driver_surface = get_driver_window_surface( *window_surface, monitor_dpi_num, monitor_dpi_den ))) { /* reuse the underlying driver surface only if it also matches the target monitor rect */ if (EqualRect( &driver_surface->rect, &monitor_rect )) window_surface_add_ref( driver_surface ); @@ -296,7 +297,7 @@ void create_window_surface( HWND hwnd, BOOL create_layered, const RECT *surface_ return; } - if (!driver_surface || dpi == monitor_dpi) + if (!driver_surface || dpi * monitor_dpi_den == monitor_dpi_num) { if (*window_surface) window_surface_release( *window_surface ); *window_surface = driver_surface; @@ -307,21 +308,22 @@ void create_window_surface( HWND hwnd, BOOL create_layered, const RECT *surface_ if ((previous = *window_surface) && previous->funcs == &scaled_surface_funcs) { struct scaled_surface *surface = get_scaled_surface( previous ); - scaled_surface_set_target( surface, driver_surface, monitor_dpi ); + scaled_surface_set_target( surface, driver_surface, monitor_dpi_num, monitor_dpi_den ); window_surface_release( driver_surface ); return; } if (previous) window_surface_release( previous ); - *window_surface = scaled_surface_create( hwnd, surface_rect, dpi, monitor_dpi, driver_surface ); + *window_surface = scaled_surface_create( hwnd, surface_rect, dpi, monitor_dpi_num, monitor_dpi_den, driver_surface ); window_surface_release( driver_surface ); } -struct window_surface *get_driver_window_surface( struct window_surface *surface, UINT monitor_dpi ) +struct window_surface *get_driver_window_surface( struct window_surface *surface, UINT monitor_dpi_num, UINT monitor_dpi_den ) { if (!surface || surface == &dummy_surface) return surface; if (surface->funcs != &scaled_surface_funcs) return surface; - if (get_scaled_surface( surface )->dpi_to != monitor_dpi) return &dummy_surface; + if (get_scaled_surface( surface )->dpi_to_num != monitor_dpi_num + || get_scaled_surface( surface )->dpi_to_den != monitor_dpi_den) return &dummy_surface; return get_scaled_surface( surface )->target_surface; } @@ -831,7 +833,7 @@ static void update_visible_region( struct dce *dce ) DWORD paint_flags = 0; size_t size = 256; RECT win_rect, top_rect; - UINT raw_dpi; + UINT raw_dpi_num, raw_dpi_den; WND *win; /* don't clip siblings if using parent clip region */ @@ -895,7 +897,7 @@ static void update_visible_region( struct dce *dce ) RECT window_rect, toplevel_rect; UINT dpi; - get_win_monitor_dpi( top_win, &raw_dpi ); + get_win_monitor_dpi( top_win, &raw_dpi_num, &raw_dpi_den ); dpi = get_dpi_for_window( top_win ); window_rect = map_rect_virt_to_raw( win_rect, dpi ); @@ -903,7 +905,7 @@ static void update_visible_region( struct dce *dce ) user_driver->pGetDC( dce->hdc, dce->hwnd, top_win, &window_rect, &toplevel_rect, flags ); SetRectEmpty( &top_rect ); - set_visible_region( dce->hdc, vis_rgn, &win_rect, &top_rect, NULL, dpi, raw_dpi ); + set_visible_region( dce->hdc, vis_rgn, &win_rect, &top_rect, NULL, dpi * raw_dpi_den, raw_dpi_num ); } } diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index d156dd46dacf..d4ab2ea68a19 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1921,11 +1921,27 @@ static BOOL is_monitor_primary( struct monitor *monitor ) return !!(source->state_flags & DISPLAY_DEVICE_PRIMARY_DEVICE); } +static UINT gcd( UINT a, UINT b ) +{ + int r; + + while (1) + { + if (!a) return b; + if (!b) return a; + r = a % b; + a = b; + b = r; + } +} + /* display_lock must be held */ static void monitor_virt_to_raw_ratio( struct monitor *monitor, UINT *num, UINT *den ) { struct source *source = monitor->source; + if (!num || !den) return; + *num = *den = 1; if (!source) return; @@ -2732,7 +2748,7 @@ static UINT get_monitor_dpi( HMONITOR handle, UINT type, UINT *x, UINT *y ) /********************************************************************** * get_win_monitor_dpi */ -UINT get_win_monitor_dpi( HWND hwnd, UINT *raw_dpi ) +UINT get_win_monitor_dpi( HWND hwnd, UINT *raw_dpi_num, UINT *raw_dpi_den ) { UINT dpi = NTUSER_DPI_CONTEXT_GET_DPI( get_window_dpi_awareness_context( hwnd ) ); HWND parent = get_parent( hwnd ); @@ -2745,7 +2761,7 @@ UINT get_win_monitor_dpi( HWND hwnd, UINT *raw_dpi ) return 0; } - if (win == WND_DESKTOP) return monitor_dpi_from_rect( rect, get_thread_dpi(), raw_dpi ); + if (win == WND_DESKTOP) return monitor_dpi_from_rect( rect, get_thread_dpi(), raw_dpi_num, raw_dpi_den ); if (win == WND_OTHER_PROCESS) { if (!get_window_rect( hwnd, &rect, dpi )) return 0; @@ -2754,7 +2770,7 @@ UINT get_win_monitor_dpi( HWND hwnd, UINT *raw_dpi ) else if ((parent = win->parent) && parent != get_desktop_window()) { release_win_ptr( win ); - return get_win_monitor_dpi( parent, raw_dpi ); + return get_win_monitor_dpi( parent, raw_dpi_num, raw_dpi_den ); } else { @@ -2762,7 +2778,7 @@ UINT get_win_monitor_dpi( HWND hwnd, UINT *raw_dpi ) release_win_ptr( win ); } - return monitor_dpi_from_rect( rect, dpi, raw_dpi ); + return monitor_dpi_from_rect( rect, dpi, raw_dpi_num, raw_dpi_den ); } /* keep in sync with user32 */ @@ -2915,7 +2931,7 @@ POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to ) */ static POINT point_win_to_phys_dpi( HWND hwnd, POINT pt ) { - UINT raw_dpi, dpi = get_win_monitor_dpi( hwnd, &raw_dpi ); + UINT dpi = get_win_monitor_dpi( hwnd, NULL, NULL ); return map_dpi_point( pt, get_dpi_for_window( hwnd ), dpi ); } @@ -2924,7 +2940,7 @@ static POINT point_win_to_phys_dpi( HWND hwnd, POINT pt ) */ POINT point_phys_to_win_dpi( HWND hwnd, POINT pt ) { - UINT raw_dpi, dpi = get_win_monitor_dpi( hwnd, &raw_dpi ); + UINT dpi = get_win_monitor_dpi( hwnd, NULL, NULL ); return map_dpi_point( pt, dpi, get_dpi_for_window( hwnd ) ); } @@ -2933,8 +2949,8 @@ POINT point_phys_to_win_dpi( HWND hwnd, POINT pt ) */ POINT point_thread_to_win_dpi( HWND hwnd, POINT pt ) { - UINT dpi = get_thread_dpi(), raw_dpi; - if (!dpi) dpi = get_win_monitor_dpi( hwnd, &raw_dpi ); + UINT dpi = get_thread_dpi(); + if (!dpi) dpi = get_win_monitor_dpi( hwnd, NULL, NULL ); return map_dpi_point( pt, dpi, get_dpi_for_window( hwnd )); } @@ -2943,8 +2959,8 @@ POINT point_thread_to_win_dpi( HWND hwnd, POINT pt ) */ RECT rect_thread_to_win_dpi( HWND hwnd, RECT rect ) { - UINT dpi = get_thread_dpi(), raw_dpi; - if (!dpi) dpi = get_win_monitor_dpi( hwnd, &raw_dpi ); + UINT dpi = get_thread_dpi(); + if (!dpi) dpi = get_win_monitor_dpi( hwnd, NULL, NULL ); return map_dpi_rect( rect, dpi, get_dpi_for_window( hwnd ) ); } @@ -4368,16 +4384,23 @@ MONITORINFO monitor_info_from_rect( RECT rect, UINT dpi ) return info; } -UINT monitor_dpi_from_rect( RECT rect, UINT dpi, UINT *raw_dpi ) +UINT monitor_dpi_from_rect( RECT rect, UINT dpi, UINT *raw_dpi_num, UINT *raw_dpi_den ) { struct monitor *monitor; - UINT ret = system_dpi, x, y; + UINT ret = system_dpi, x, y, d; if (!lock_display_devices( FALSE )) return 0; if ((monitor = get_monitor_from_rect( rect, MONITOR_DEFAULTTONEAREST, dpi, MDT_DEFAULT ))) { - *raw_dpi = monitor_get_dpi( monitor, MDT_RAW_DPI, &x, &y ); ret = monitor_get_dpi( monitor, MDT_DEFAULT, &x, &y ); + if (raw_dpi_num && raw_dpi_den) + { + monitor_virt_to_raw_ratio( monitor, raw_dpi_num, raw_dpi_den ); + *raw_dpi_num *= ret; + d = gcd( *raw_dpi_num, *raw_dpi_den ); + *raw_dpi_num /= d; + *raw_dpi_den /= d; + } } unlock_display_devices(); diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index b1fe3771b2fa..683ddfa5e1fa 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -44,9 +44,9 @@ extern ULONG_PTR set_icon_param( HICON handle, const struct free_icon_params *pa /* dce.c */ extern struct window_surface dummy_surface; -extern void create_window_surface( HWND hwnd, BOOL create_layered, const RECT *surface_rect, UINT monitor_dpi, +extern void create_window_surface( HWND hwnd, BOOL create_layered, const RECT *surface_rect, UINT monitor_dpi_num, UINT monitor_dpi_den, struct window_surface **window_surface ); -extern struct window_surface *get_driver_window_surface( struct window_surface *surface, UINT monitor_dpi ); +extern struct window_surface *get_driver_window_surface( struct window_surface *surface, UINT monitor_dpi_num, UINT monitor_dpi_den ); extern void erase_now( HWND hwnd, UINT rdw_flags ); extern void flush_window_surfaces( BOOL idle ); extern void move_window_bits( HWND hwnd, const struct window_rects *rects, const RECT *valid_rects ); @@ -167,7 +167,7 @@ extern LONG get_char_dimensions( HDC hdc, TEXTMETRICW *metric, int *height ); extern HBITMAP get_display_bitmap(void); extern INT get_display_depth( UNICODE_STRING *name ); extern RECT get_display_rect( const WCHAR *display ); -extern UINT get_win_monitor_dpi( HWND hwnd, UINT *raw_dpi ); +extern UINT get_win_monitor_dpi( HWND hwnd, UINT *raw_dpi_num, UINT *raw_dpi_den ); extern RECT get_primary_monitor_rect( UINT dpi ); extern DWORD get_process_layout(void); extern COLORREF get_sys_color( int index ); @@ -194,7 +194,7 @@ extern RECT rect_thread_to_win_dpi( HWND hwnd, RECT rect ); extern HMONITOR monitor_from_window( HWND hwnd, UINT flags, UINT dpi ); extern MONITORINFO monitor_info_from_rect( RECT rect, UINT dpi ); extern MONITORINFO monitor_info_from_window( HWND hwnd, UINT flags ); -extern UINT monitor_dpi_from_rect( RECT rect, UINT dpi, UINT *raw_dpi ); +extern UINT monitor_dpi_from_rect( RECT rect, UINT dpi, UINT *raw_dpi_num, UINT *raw_dpi_den ); extern BOOL update_display_cache( BOOL force ); extern void reset_monitor_update_serial(void); extern void user_lock(void); diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 20ba9049e753..ef2dfa520c49 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -907,7 +907,7 @@ UINT get_window_dpi_awareness_context( HWND hwnd ) UINT get_dpi_for_window( HWND hwnd ) { WND *win; - UINT raw_dpi, context = 0; + UINT context = 0; if (!(win = get_win_ptr( hwnd ))) { @@ -917,7 +917,7 @@ UINT get_dpi_for_window( HWND hwnd ) if (win == WND_DESKTOP) { RECT rect = {0}; - return monitor_dpi_from_rect( rect, get_thread_dpi(), &raw_dpi ); + return monitor_dpi_from_rect( rect, get_thread_dpi(), NULL, NULL ); } if (win != WND_OTHER_PROCESS) { @@ -934,7 +934,7 @@ UINT get_dpi_for_window( HWND hwnd ) SERVER_END_REQ; } - if (NTUSER_DPI_CONTEXT_IS_MONITOR_AWARE( context )) return get_win_monitor_dpi( hwnd, &raw_dpi ); + if (NTUSER_DPI_CONTEXT_IS_MONITOR_AWARE( context )) return get_win_monitor_dpi( hwnd, NULL, NULL ); return NTUSER_DPI_CONTEXT_GET_DPI( context ); } @@ -1996,7 +1996,7 @@ static struct window_surface *get_window_surface( HWND hwnd, UINT swp_flags, BOO HWND parent = NtUserGetAncestor( hwnd, GA_PARENT ); struct window_surface *new_surface; struct window_rects monitor_rects; - UINT raw_dpi, style, ex_style; + UINT raw_dpi_num, raw_dpi_den, style, ex_style; RECT dummy; HRGN shape; @@ -2005,14 +2005,14 @@ static struct window_surface *get_window_surface( HWND hwnd, UINT swp_flags, BOO is_child = parent && parent != NtUserGetDesktopWindow(); is_opengl = window_has_client_surface( hwnd, TRUE ); - if (is_child) get_win_monitor_dpi( parent, &raw_dpi ); - else monitor_dpi_from_rect( rects->window, get_thread_dpi(), &raw_dpi ); + if (is_child) get_win_monitor_dpi( parent, &raw_dpi_num, &raw_dpi_den ); + else monitor_dpi_from_rect( rects->window, get_thread_dpi(), &raw_dpi_num, &raw_dpi_den ); if (get_window_region( hwnd, FALSE, &shape, &dummy )) shaped = FALSE; else if ((shaped = !!shape)) NtGdiDeleteObjectApp( shape ); rects->visible = rects->window; - if (is_child) monitor_rects = map_dpi_window_rects( *rects, get_thread_dpi(), raw_dpi ); + if (is_child) monitor_rects = map_dpi_window_rects( *rects, get_thread_dpi() * raw_dpi_den, raw_dpi_num ); else monitor_rects = map_window_rects_virt_to_raw( *rects, get_thread_dpi() ); if (!user_driver->pWindowPosChanging( hwnd, swp_flags, shaped, &monitor_rects )) needs_surface = FALSE; @@ -2044,7 +2044,7 @@ static struct window_surface *get_window_surface( HWND hwnd, UINT swp_flags, BOO new_surface = NULL; } else if (needs_surface) - create_window_surface( hwnd, create_layered, surface_rect, raw_dpi, &new_surface ); + create_window_surface( hwnd, create_layered, surface_rect, raw_dpi_num, raw_dpi_den, &new_surface ); else if (new_surface && new_surface != &dummy_surface) { window_surface_release( new_surface ); @@ -2097,14 +2097,14 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru struct window_rects old_rects; RECT extra_rects[3]; struct window_surface *old_surface; - UINT raw_dpi, monitor_dpi; + UINT raw_dpi_num, raw_dpi_den, monitor_dpi; is_layered = new_surface && new_surface->alpha_mask; is_fullscreen = is_window_rect_full_screen( &new_rects->visible, get_thread_dpi() ); is_child = parent && parent != NtUserGetDesktopWindow(); - if (is_child) monitor_dpi = get_win_monitor_dpi( parent, &raw_dpi ); - else monitor_dpi = monitor_dpi_from_rect( new_rects->window, get_thread_dpi(), &raw_dpi ); + if (is_child) monitor_dpi = get_win_monitor_dpi( parent, &raw_dpi_num, &raw_dpi_den ); + else monitor_dpi = monitor_dpi_from_rect( new_rects->window, get_thread_dpi(), &raw_dpi_num, &raw_dpi_den ); get_window_rects( hwnd, COORDS_PARENT, &old_rects, get_thread_dpi() ); if (IsRectEmpty( &valid_rects[0] ) || is_layered) valid_rects = NULL; @@ -2120,7 +2120,7 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru valid_rects = NULL; } - if (is_child) monitor_rects = map_dpi_window_rects( *new_rects, get_thread_dpi(), raw_dpi ); + if (is_child) monitor_rects = map_dpi_window_rects( *new_rects, get_thread_dpi() * raw_dpi_den, raw_dpi_num ); else monitor_rects = map_window_rects_virt_to_raw( *new_rects, get_thread_dpi() ); SERVER_START_REQ( set_window_pos ) @@ -2239,7 +2239,7 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru if (owner_hint) owner_hint = NtUserGetAncestor(owner_hint, GA_ROOT); user_driver->pWindowPosChanged( hwnd, insert_after, owner_hint, swp_flags, is_fullscreen, &monitor_rects, - get_driver_window_surface( new_surface, raw_dpi ) ); + get_driver_window_surface( new_surface, raw_dpi_num, raw_dpi_den ) ); update_children_window_state( hwnd ); vulkan_update_surfaces( hwnd ); @@ -2388,13 +2388,13 @@ int WINAPI NtUserSetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) { UINT swp_flags = SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE; - UINT raw_dpi; + UINT raw_dpi_num, raw_dpi_den; HRGN monitor_hrgn; if (!redraw) swp_flags |= SWP_NOREDRAW; - get_win_monitor_dpi( hwnd, &raw_dpi ); - monitor_hrgn = map_dpi_region( hrgn, get_thread_dpi(), raw_dpi ); + get_win_monitor_dpi( hwnd, &raw_dpi_num, &raw_dpi_den ); + monitor_hrgn = map_dpi_region( hrgn, get_thread_dpi() * raw_dpi_den, raw_dpi_num ); user_driver->pSetWindowRgn( hwnd, monitor_hrgn, redraw ); if (monitor_hrgn) NtGdiDeleteObjectApp( monitor_hrgn ); @@ -2622,10 +2622,10 @@ HWND window_from_point( HWND hwnd, POINT pt, INT *hittest ) int i, res; HWND ret, *list; POINT win_pt; - UINT dpi, raw_dpi; + UINT dpi; if (!hwnd) hwnd = get_desktop_window(); - if (!(dpi = get_thread_dpi())) dpi = get_win_monitor_dpi( hwnd, &raw_dpi ); + if (!(dpi = get_thread_dpi())) dpi = get_win_monitor_dpi( hwnd, NULL, NULL ); *hittest = HTNOWHERE; @@ -3170,7 +3170,7 @@ static BOOL get_windows_offset( HWND hwnd_from, HWND hwnd_to, UINT dpi, BOOL *mi if (win == WND_OTHER_PROCESS) goto other_process; if (win != WND_DESKTOP) { - UINT raw_dpi, dpi_from = dpi ? dpi : get_win_monitor_dpi( hwnd_from, &raw_dpi ); + UINT dpi_from = dpi ? dpi : get_win_monitor_dpi( hwnd_from, NULL, NULL ); if (win->dwExStyle & WS_EX_LAYOUTRTL) { mirror_from = TRUE; @@ -3207,7 +3207,7 @@ static BOOL get_windows_offset( HWND hwnd_from, HWND hwnd_to, UINT dpi, BOOL *mi if (win == WND_OTHER_PROCESS) goto other_process; if (win != WND_DESKTOP) { - UINT raw_dpi, dpi_to = dpi ? dpi : get_win_monitor_dpi( hwnd_to, &raw_dpi ); + UINT dpi_to = dpi ? dpi : get_win_monitor_dpi( hwnd_to, NULL, NULL ); POINT pt = { 0, 0 }; if (win->dwExStyle & WS_EX_LAYOUTRTL) { @@ -3394,9 +3394,9 @@ static void dump_winpos_flags( UINT flags ) static void map_dpi_winpos( WINDOWPOS *winpos ) { RECT rect = {winpos->x, winpos->y, winpos->x + winpos->cx, winpos->y + winpos->cy}; - UINT raw_dpi, dpi_from = get_thread_dpi(), dpi_to = get_dpi_for_window( winpos->hwnd ); + UINT dpi_from = get_thread_dpi(), dpi_to = get_dpi_for_window( winpos->hwnd ); - if (!dpi_from) dpi_from = get_win_monitor_dpi( winpos->hwnd, &raw_dpi ); + if (!dpi_from) dpi_from = get_win_monitor_dpi( winpos->hwnd, NULL, NULL ); rect = map_dpi_rect( rect, dpi_from, dpi_to ); winpos->x = rect.left; winpos->y = rect.top; @@ -5517,7 +5517,7 @@ static void map_dpi_create_struct( CREATESTRUCTW *cs, UINT dpi_to ) if (!dpi_from || !dpi_to) { - UINT raw_dpi, mon_dpi = monitor_dpi_from_rect( rect, get_thread_dpi(), &raw_dpi ); + UINT mon_dpi = monitor_dpi_from_rect( rect, get_thread_dpi(), NULL, NULL ); if (!dpi_from) dpi_from = mon_dpi; else dpi_to = mon_dpi; } @@ -6100,8 +6100,8 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) case NtUserCallHwndParam_GetWinMonitorDpi: { - UINT raw_dpi, dpi = get_win_monitor_dpi( hwnd, &raw_dpi ); - return param == MDT_EFFECTIVE_DPI ? dpi : raw_dpi; + UINT raw_dpi_num, raw_dpi_den, dpi = get_win_monitor_dpi( hwnd, &raw_dpi_num, &raw_dpi_den ); + return param == MDT_EFFECTIVE_DPI ? dpi : (raw_dpi_num + raw_dpi_den / 2) / raw_dpi_den; } case NtUserCallHwndParam_SetRawWindowPos: From a940830d2b0e7f4e617c5f6a5420f2761267de6e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 13 Mar 2025 18:37:06 -0600 Subject: [PATCH 1271/2542] winex11.drv: Use map_rect_virt_to_raw() instead of relying on monitor raw dpi. Coordinate convertion using raw monitor dpi is inaccurate. CW-Bug-Id: #25029 --- dlls/win32u/sysparams.c | 16 ++++++++++++++++ dlls/winex11.drv/opengl.c | 11 +++++++---- dlls/winex11.drv/vulkan.c | 11 +++++++---- include/wine/gdi_driver.h | 2 ++ 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index d4ab2ea68a19..40293ce58eb4 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -2708,6 +2708,22 @@ RECT map_rect_virt_to_raw( RECT rect, UINT dpi_from ) return rect; } +RECT map_rect_virt_to_raw_for_monitor( HMONITOR handle, RECT rect, UINT dpi_from ) +{ + struct monitor *monitor; + UINT num, den, x, y; + + if (!lock_display_devices( FALSE )) return rect; + if ((monitor = get_monitor_from_handle( handle ))) + { + monitor_virt_to_raw_ratio( monitor, &num, &den ); + rect = map_dpi_rect( rect, dpi_from * den, monitor_get_dpi( monitor, MDT_DEFAULT, &x, &y ) * num ); + } + unlock_display_devices(); + + return rect; +} + /* map (absolute) window rects from MDT_DEFAULT to MDT_RAW_DPI coordinates */ struct window_rects map_window_rects_virt_to_raw( struct window_rects rects, UINT dpi_from ) { diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index c18f62364733..27751477d213 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -3207,12 +3207,13 @@ static BOOL glxdrv_wglShareLists(struct wgl_context *org, struct wgl_context *de static void present_gl_drawable( HWND hwnd, HDC hdc, struct gl_drawable *gl, BOOL flush, BOOL gl_finish ) { - HWND toplevel = NtUserGetAncestor( hwnd, GA_ROOT ); struct window_surface *surface; struct x11drv_win_data *data; Drawable window, drawable; RECT rect_dst, rect; + HWND toplevel; HRGN region; + UINT dpi; if (!gl) return; switch (gl->type) @@ -3251,10 +3252,12 @@ static void present_gl_drawable( HWND hwnd, HDC hdc, struct gl_drawable *gl, BOO if (gl_finish) pglFinish(); if (flush) XFlush( gdi_display ); - NtUserGetClientRect( hwnd, &rect_dst, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); - NtUserMapWindowPoints( hwnd, toplevel, (POINT *)&rect_dst, 2, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); + toplevel = NtUserGetAncestor( hwnd, GA_ROOT ); + dpi = NtUserGetDpiForWindow( hwnd ); + NtUserGetClientRect( hwnd, &rect_dst, dpi ); + NtUserMapWindowPoints( hwnd, toplevel, (POINT *)&rect_dst, 2, dpi ); if (IsRectEmpty( &rect_dst ) || IsRectEmpty( &gl->rect )) return; - + rect_dst = map_rect_virt_to_raw_for_monitor( NtUserMonitorFromWindow( toplevel, MONITOR_DEFAULTTONEAREST ), rect_dst, dpi ); if ((data = get_win_data( toplevel ))) { OffsetRect( &rect_dst, data->rects.client.left - data->rects.visible.left, diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index bd5768f37052..7da56d75a1d3 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -308,12 +308,13 @@ static int force_present_to_surface(void) static void X11DRV_vulkan_surface_presented( HWND hwnd, void *private, VkResult result ) { struct x11drv_vulkan_surface *surface = private; - HWND toplevel = NtUserGetAncestor( hwnd, GA_ROOT ); struct window_surface *win_surface; struct x11drv_win_data *data; RECT rect_dst, rect; Drawable window; + HWND toplevel; HRGN region; + UINT dpi; HDC hdc; vulkan_surface_update_size( hwnd, surface ); @@ -332,10 +333,12 @@ static void X11DRV_vulkan_surface_presented( HWND hwnd, void *private, VkResult return; } - NtUserGetClientRect( hwnd, &rect_dst, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); - NtUserMapWindowPoints( hwnd, toplevel, (POINT *)&rect_dst, 2, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); + toplevel = NtUserGetAncestor( hwnd, GA_ROOT ); + dpi = NtUserGetDpiForWindow( hwnd ); + NtUserGetClientRect( hwnd, &rect_dst, dpi ); + NtUserMapWindowPoints( hwnd, toplevel, (POINT *)&rect_dst, 2, dpi ); if (IsRectEmpty( &rect_dst ) || IsRectEmpty( &surface->rect )) return; - + rect_dst = map_rect_virt_to_raw_for_monitor( NtUserMonitorFromWindow( toplevel, MONITOR_DEFAULTTONEAREST ), rect_dst, dpi ); if ((data = get_win_data( toplevel ))) { OffsetRect( &rect_dst, data->rects.client.left - data->rects.visible.left, diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index 3b3c6a068369..fd7af6b0de9c 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -84,6 +84,8 @@ static inline RECT visible_rect_from_window( struct window_rects *rects, RECT wi return rect; } +W32KAPI RECT map_rect_virt_to_raw_for_monitor( HMONITOR monitor, RECT rect, UINT dpi_from ); + typedef struct gdi_physdev { const struct gdi_dc_funcs *funcs; From b73c2ddb87c22a85aa2c2624adc01b9417edf91e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 14 Mar 2025 09:41:24 -0600 Subject: [PATCH 1272/2542] winex11.drv: Don't deny setting to unmanaged state in window_set_managed(). Or in a way it is currently handled in create_whole_window() unmanaged state can never be set. --- dlls/winex11.drv/window.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 9852158add82..66e79a6b44c7 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1656,11 +1656,6 @@ static void window_set_managed( struct x11drv_win_data *data, BOOL new_managed, if (!data->whole_window) return; /* no window, nothing to update */ if (old_managed == new_managed && old_embedded == new_embedded) return; /* states are the same, nothing to update */ - if (!new_managed) - { - ERR( "Changing window to unmanaged is not supported\n" ); - return; - } window_set_wm_state( data, WithdrawnState, 0 ); /* no WM_STATE is pending, requested immediately */ From cfeabdb40f031eb28eb18da106851a898d3ac576 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 10 Mar 2025 14:30:08 -0600 Subject: [PATCH 1273/2542] ntdll/tests: Test NtCreateUserProcess() with limited access rights. (cherry picked from commit e67177dae7afe9d4485b609e7844ec42f3c5bd0f) CW-Bug-Id: #24983 --- dlls/ntdll/tests/thread.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/dlls/ntdll/tests/thread.c b/dlls/ntdll/tests/thread.c index a7ccf51e5e28..567a94a583d5 100644 --- a/dlls/ntdll/tests/thread.c +++ b/dlls/ntdll/tests/thread.c @@ -204,6 +204,44 @@ static void test_errno(void) ok( val == 0xbeef, "wrong value %x\n", val ); } +static void test_NtCreateUserProcess(void) +{ + RTL_USER_PROCESS_PARAMETERS *params; + PS_CREATE_INFO create_info; + PS_ATTRIBUTE_LIST ps_attr; + WCHAR path[MAX_PATH + 4]; + HANDLE process, thread; + UNICODE_STRING imageW; + NTSTATUS status; + + lstrcpyW( path, L"\\??\\" ); + GetModuleFileNameW( NULL, path + 4, MAX_PATH ); + + RtlInitUnicodeString( &imageW, path ); + + memset( &ps_attr, 0, sizeof(ps_attr) ); + ps_attr.Attributes[0].Attribute = PS_ATTRIBUTE_IMAGE_NAME; + ps_attr.Attributes[0].Size = lstrlenW(path) * sizeof(WCHAR); + ps_attr.Attributes[0].ValuePtr = path; + ps_attr.TotalLength = sizeof(ps_attr); + + status = RtlCreateProcessParametersEx( ¶ms, &imageW, NULL, NULL, + NULL, NULL, NULL, NULL, + NULL, NULL, PROCESS_PARAMS_FLAG_NORMALIZED ); + ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status ); + + memset( &create_info, 0, sizeof(create_info) ); + create_info.Size = sizeof(create_info); + status = NtCreateUserProcess( &process, &thread, PROCESS_TERMINATE, SYNCHRONIZE, + NULL, NULL, 0, THREAD_CREATE_FLAGS_CREATE_SUSPENDED, params, + &create_info, &ps_attr ); + todo_wine ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status ); + status = NtTerminateProcess( process, 0 ); + todo_wine ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status ); + CloseHandle( process ); + CloseHandle( thread ); +} + START_TEST(thread) { init_function_pointers(); @@ -211,4 +249,5 @@ START_TEST(thread) test_dbg_hidden_thread_creation(); test_unique_teb(); test_errno(); + test_NtCreateUserProcess(); } From 2691108c0619661761bec977e8227aa54d6b9aa4 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Mon, 10 Mar 2025 14:49:30 -0600 Subject: [PATCH 1274/2542] ntdll: Do not fail NtCreateUserProcess() if requested access doesn't have PROCESS_CREATE_THREAD. (cherry picked from commit 10bb431e0d0760d72921106c7607d66808b939bb) CW-Bug-Id: #24983 --- dlls/ntdll/tests/thread.c | 4 ++-- server/thread.c | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/tests/thread.c b/dlls/ntdll/tests/thread.c index 567a94a583d5..f7806e0fe621 100644 --- a/dlls/ntdll/tests/thread.c +++ b/dlls/ntdll/tests/thread.c @@ -235,9 +235,9 @@ static void test_NtCreateUserProcess(void) status = NtCreateUserProcess( &process, &thread, PROCESS_TERMINATE, SYNCHRONIZE, NULL, NULL, 0, THREAD_CREATE_FLAGS_CREATE_SUSPENDED, params, &create_info, &ps_attr ); - todo_wine ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status ); + ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status ); status = NtTerminateProcess( process, 0 ); - todo_wine ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status ); + ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status ); CloseHandle( process ); CloseHandle( thread ); } diff --git a/server/thread.c b/server/thread.c index fd281ee05e1a..31b208939ac8 100644 --- a/server/thread.c +++ b/server/thread.c @@ -1508,7 +1508,7 @@ DECL_HANDLER(new_thread) const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, NULL ); int request_fd = thread_get_inflight_fd( current, req->request_fd ); - if (!(process = get_process_from_handle( req->process, PROCESS_CREATE_THREAD ))) + if (!(process = get_process_from_handle( req->process, 0 ))) { if (request_fd != -1) close( request_fd ); return; @@ -1534,6 +1534,12 @@ DECL_HANDLER(new_thread) set_error( STATUS_INVALID_HANDLE ); goto done; } + else if (!(get_handle_access( current->process, req->process ) & PROCESS_CREATE_THREAD)) + { + close( request_fd ); + set_error( STATUS_ACCESS_DENIED ); + goto done; + } if ((thread = create_thread( request_fd, process, sd ))) { From d4aefcc6a61da1d1ee792c41366bd4a388b3db5c Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 12 Mar 2025 19:49:55 -0600 Subject: [PATCH 1275/2542] ntdll: Properly set context control registers from the other thread on wow64. (cherry picked from commit 7ef95229913cf004d002459fe9e53307344479f2) CW-Bug-Id: #24983 --- dlls/ntdll/unix/signal_x86_64.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index b4309a8ca2e7..3ead6ac4e9be 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -2551,6 +2551,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext ) { struct syscall_frame *frame = amd64_thread_data()->syscall_frame; ULONG64 saved_compaction = 0; + I386_CONTEXT *wow_context; struct xcontext *context; context = (struct xcontext *)(((ULONG_PTR)RSP_sig(ucontext) - 128 /* red zone */ - sizeof(*context)) & ~15); @@ -2575,6 +2576,13 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext ) context->c.ContextFlags &= ~0x40; frame->restore_flags |= 0x40; } + if ((wow_context = get_cpu_area( IMAGE_FILE_MACHINE_I386 )) + && (wow_context->ContextFlags & CONTEXT_I386_CONTROL) == CONTEXT_I386_CONTROL) + { + WOW64_CPURESERVED *cpu = NtCurrentTeb()->TlsSlots[WOW64_TLS_CPURESERVED]; + + cpu->Flags |= WOW64_CPURESERVED_FLAG_RESET_STATE; + } NtSetContextThread( GetCurrentThread(), &context->c ); } else From b38ada617d6c866f8aeb4d8536a7f8a9e329c59e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 12 Mar 2025 19:50:48 -0600 Subject: [PATCH 1276/2542] ntdll/tests: Test first trap address when setting trap flag in various ways. (cherry picked from commit 2c7b47ee5ddea46e7bab2ba36a615da15c1b8ad4) CW-Bug-Id: #24983 --- dlls/ntdll/tests/exception.c | 143 +++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 82be444e6f0c..b9029d4b9f59 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -304,6 +304,147 @@ static void test_hwbpt_in_syscall(void) RemoveVectoredExceptionHandler(handler); TlsFree(ind); } + +static void *test_single_step_exc_address; +static int test_single_step_address_test; +static volatile LONG test_single_step_address_thread_wait; +static HANDLE test_single_step_address_signal, test_single_step_address_wait; + +static LONG CALLBACK test_single_step_address_handler(EXCEPTION_POINTERS *info) +{ + EXCEPTION_RECORD *rec = info->ExceptionRecord; + + test_single_step_exc_address = rec->ExceptionAddress; + ok(rec->ExceptionCode == EXCEPTION_SINGLE_STEP, "got %#lx, address %p.\n", rec->ExceptionCode, rec->ExceptionAddress); + ExitThread(0); + ok(0, "got here.\n"); + return EXCEPTION_CONTINUE_SEARCH; +} + +static DWORD WINAPI test_single_step_address_thread(void *dummy) +{ + CONTEXT c; + + memset( code_mem, 0x90 /* nop */, 3 ); + + if (test_single_step_address_test == 1) do + { + InterlockedIncrement(&test_single_step_address_thread_wait); + } while (1); + + if (test_single_step_address_test == 3) + { + SignalObjectAndWait(test_single_step_address_signal, test_single_step_address_wait, INFINITE, FALSE); + ok(0, "got here.\n"); + } + + c.ContextFlags = CONTEXT_FULL; + GetThreadContext(GetCurrentThread(), &c); +#ifdef __x86_64__ + c.Rip = (ULONG_PTR)code_mem; +#else + c.Eip = (ULONG_PTR)code_mem; +#endif + c.EFlags |= 0x100; + if (test_single_step_address_test == 2) + NtContinue( &c, FALSE ); + else + SetThreadContext(GetCurrentThread(), &c); + ok(0, "got here.\n"); + return 0; +} + +static void test_single_step_address_run(void *handler, int test) +{ + HANDLE thread; + CONTEXT c; + + winetest_push_context("test %d", test); + + test_single_step_address_signal = CreateEventW(NULL, FALSE, FALSE, NULL); + test_single_step_address_wait = CreateEventW(NULL, FALSE, FALSE, NULL); + + test_single_step_exc_address = NULL; + test_single_step_address_test = test; + test_single_step_address_thread_wait = 0; + thread = CreateThread(NULL, 0, test_single_step_address_thread, NULL, 0, NULL); + + switch (test) + { + case 1: + case 3: + if (test == 1) + { + while (!test_single_step_address_thread_wait) + Sleep(10); + } + else + { + WaitForSingleObject(test_single_step_address_signal, INFINITE); + } + SuspendThread(thread); + c.ContextFlags = CONTEXT_FULL; + GetThreadContext(thread, &c); +#ifdef __x86_64__ + c.Rip = (ULONG_PTR)code_mem; +#else + c.Eip = (ULONG_PTR)code_mem; +#endif + c.EFlags |= 0x100; + SetThreadContext(thread, &c); + ResumeThread(thread); + if (test == 3) + SetEvent(test_single_step_address_wait); + break; + } + + WaitForSingleObject(thread, INFINITE); + CloseHandle(thread); + CloseHandle(test_single_step_address_signal); + CloseHandle(test_single_step_address_wait); + + /* Vectored handler stays referenced because it execution ends with TerminateThread() and it never returns, + * decrement its reference count each time. */ + pRtlRemoveVectoredExceptionHandler(handler); + winetest_pop_context(); +} + +static void test_single_step_address(void) +{ + void *handler; + + handler = pRtlAddVectoredExceptionHandler(TRUE, test_single_step_address_handler); + ok(!!handler, "got NULL.\n"); + memset( code_mem, 0x90 /* nop */, 3 ); + + test_single_step_address_run(handler, 0); + + if (is_wow64) + ok(test_single_step_exc_address == (char *)code_mem + 1, "got %p, expected %p.\n", + test_single_step_exc_address, (char *)code_mem + 1); + else + todo_wine ok(test_single_step_exc_address == code_mem, "got %p, expected %p.\n", test_single_step_exc_address, code_mem); + + + test_single_step_address_run(handler, 1); + ok(test_single_step_exc_address == (char *)code_mem + 1, "got %p, expected %p.\n", test_single_step_exc_address, + (char *)code_mem + 1); + + test_single_step_address_run(handler, 2); + + ok(test_single_step_exc_address == (char *)code_mem + 1, "got %p, expected %p.\n", test_single_step_exc_address, + (char *)code_mem + 1); + + test_single_step_address_run(handler, 3); + + if (is_wow64) + ok(test_single_step_exc_address == (char *)code_mem + 1, "got %p, expected %p.\n", + test_single_step_exc_address, (char *)code_mem + 1); + else + todo_wine ok(test_single_step_exc_address == code_mem, "got %p, expected %p.\n", test_single_step_exc_address, code_mem); + + pRtlRemoveVectoredExceptionHandler(handler); +} #endif #ifdef __i386__ @@ -12017,6 +12158,7 @@ START_TEST(exception) test_set_live_context(); test_hwbpt_in_syscall(); test_instrumentation_callback(); + test_single_step_address(); #elif defined(__x86_64__) @@ -12049,6 +12191,7 @@ START_TEST(exception) test_hwbpt_in_syscall(); test_instrumentation_callback(); test_direct_syscalls(); + test_single_step_address(); #elif defined(__aarch64__) From 1495efb93854cf2d520bd6043b0322733c82c884 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 12 Mar 2025 19:57:24 -0600 Subject: [PATCH 1277/2542] ntdll: Fix setting trap flag with CONTEXT_CONTROL and instrumentation callback on x64. (cherry picked from commit 50481d06d2763b02793f8d5362b512015987011f) CW-Bug-Id: #24983 --- dlls/ntdll/tests/exception.c | 4 ++-- dlls/ntdll/unix/signal_x86_64.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index b9029d4b9f59..5dfc720b3bf7 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -423,7 +423,7 @@ static void test_single_step_address(void) ok(test_single_step_exc_address == (char *)code_mem + 1, "got %p, expected %p.\n", test_single_step_exc_address, (char *)code_mem + 1); else - todo_wine ok(test_single_step_exc_address == code_mem, "got %p, expected %p.\n", test_single_step_exc_address, code_mem); + ok(test_single_step_exc_address == code_mem, "got %p, expected %p.\n", test_single_step_exc_address, code_mem); test_single_step_address_run(handler, 1); @@ -441,7 +441,7 @@ static void test_single_step_address(void) ok(test_single_step_exc_address == (char *)code_mem + 1, "got %p, expected %p.\n", test_single_step_exc_address, (char *)code_mem + 1); else - todo_wine ok(test_single_step_exc_address == code_mem, "got %p, expected %p.\n", test_single_step_exc_address, code_mem); + ok(test_single_step_exc_address == code_mem, "got %p, expected %p.\n", test_single_step_exc_address, code_mem); pRtlRemoveVectoredExceptionHandler(handler); } diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 3ead6ac4e9be..e82b57093186 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -3316,6 +3316,9 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "jnz 1f\n\t" /* CONTEXT_CONTROL */ "movq (%rsp),%rcx\n\t" /* frame->rip */ + "pushq %r11\n\t" + /* make sure that if trap flag is set the trap happens on the first instruction after iret */ + "popfq\n\t" "iretq\n" /* CONTEXT_INTEGER */ "1:\tmovq 0x00(%rcx),%rax\n\t" @@ -3339,6 +3342,9 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "testl $0x2,%edx\n\t" /* CONTEXT_INTEGER */ "jnz 1b\n\t" "xchgq %r10,(%rsp)\n\t" + "pushq %r11\n\t" + /* make sure that if trap flag is set the trap happens on the first instruction after iret */ + "popfq\n\t" "iretq\n\t" /* pop rbp-based kernel stack cfi */ From 3dbb625348e15c356dd8f01bafb7f462cf46f6cf Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Tue, 18 Mar 2025 17:55:21 +0800 Subject: [PATCH 1278/2542] HACK: win32u: Avoid resizing exclusive fullscreen windows. This is similar to "HACK: win32u: Avoid moving fullscreen windows to arbitrary positions" CW-Bug-Id: #25036 --- dlls/win32u/window.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index ef2dfa520c49..8a4d705efeb9 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -3433,6 +3433,32 @@ static BOOL calc_winpos( WINDOWPOS *winpos, struct window_rects *old_rects, stru } else { + const char *sgi = getenv( "SteamGameId" ); + + /* CW-Bug-Id: #25036 Escape from Monkey Islandâ„¢ (730830) Alt+Tab shifts game downward + * when opened via config launcher. + * + * The game calls ShowWindow(hwnd, SW_RESTORE) whenever WM_ACTIVATE or WM_SYSCOMMAND + * SC_RESTORE messages are received. And the game is created with a size of 648x514. + * The multiple ShowWindow(hwnd, SW_RESTORE) calls will restore its exclusive + * fullscreen from 640x480 to 648x514. However, moving or resizing exclusive fullscreen + * windows on Windows are not allowed. Due to the missing support for exclusive + * fullscreen on Wine, work around it by forcing fullscreen here. + */ + if (sgi && (!strcmp( sgi, "730830" )) + && !(win->dwStyle & WS_MINIMIZE) && win->parent == get_desktop_window() + && is_window_rect_full_screen( &old_rects->visible, get_thread_dpi() )) + { + RECT rect = {winpos->x, winpos->y, + winpos->x + new_rects->window.right - new_rects->window.left, + winpos->y + new_rects->window.bottom - new_rects->window.top}; + MONITORINFO info = monitor_info_from_rect( rect, get_thread_dpi() ); + WARN( "Forcing fullscreen window %p size from %s to %s\n", winpos->hwnd, + wine_dbgstr_rect(&rect), wine_dbgstr_rect(&info.rcMonitor) ); + winpos->cx = info.rcMonitor.right - info.rcMonitor.left; + winpos->cy = info.rcMonitor.bottom - info.rcMonitor.top; + } + new_rects->window.right = new_rects->window.left + winpos->cx; new_rects->window.bottom = new_rects->window.top + winpos->cy; } From dfe45c50b5f71eb3827fe2277f35a2b75d828608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 18 Mar 2025 11:18:51 +0100 Subject: [PATCH 1279/2542] HACK: winex11: Ignore KWin-originated maximized window state changes. When changing decorations / config / fullscreen state all around the same time it is possible that a window will briefly not be fullscreen while KWin still sets it maximized because of its window config. Ignore all maximized window changes from KWin, as they are completely unmanageable. CW-Bug-Id: #25046 --- dlls/winex11.drv/window.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 66e79a6b44c7..9270740b3c1c 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1715,10 +1715,9 @@ static UINT window_update_client_state( struct x11drv_win_data *data ) if (data->current_state.net_wm_state & (1 << NET_WM_STATE_MAXIMIZED)) new_style |= WS_MAXIMIZE; /* KWin sometimes combines NET_WM_STATE_FULLSCREEN with NET_WM_STATE_MAXIMIZED, but sometimes doesn't. - * Don't feeding back the maximized state to the Win32 side when windows are fullscreen. + * Don't feed back the maximized state to the Win32 side as it confuses many applications. */ - if (X11DRV_HasWindowManager( "KWin" ) && data->current_state.net_wm_state & (1 << NET_WM_STATE_FULLSCREEN)) - new_style = (new_style & ~WS_MAXIMIZE) | (old_style & WS_MAXIMIZE); + if (X11DRV_HasWindowManager( "KWin" )) new_style = (new_style & ~WS_MAXIMIZE) | (old_style & WS_MAXIMIZE); if ((old_style & WS_MINIMIZE) && !(new_style & WS_MINIMIZE)) { @@ -1768,10 +1767,9 @@ static UINT window_update_client_config( struct x11drv_win_data *data ) if (data->current_state.net_wm_state & (1 << NET_WM_STATE_MAXIMIZED)) new_style |= WS_MAXIMIZE; /* KWin sometimes combines NET_WM_STATE_FULLSCREEN with NET_WM_STATE_MAXIMIZED, but sometimes doesn't. - * Don't feeding back the maximized state to the Win32 side when windows are fullscreen. + * Don't feed back the maximized state to the Win32 side as it confuses many applications. */ - if (X11DRV_HasWindowManager( "KWin" ) && data->current_state.net_wm_state & (1 << NET_WM_STATE_FULLSCREEN)) - new_style = (new_style & ~WS_MAXIMIZE) | (old_style & WS_MAXIMIZE); + if (X11DRV_HasWindowManager( "KWin" )) new_style = (new_style & ~WS_MAXIMIZE) | (old_style & WS_MAXIMIZE); if ((old_style & WS_CAPTION) == WS_CAPTION || !data->is_fullscreen) { From f4c503bc50a7eba94d677dbefa9366b8ccea53b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 18 Mar 2025 11:29:14 +0100 Subject: [PATCH 1280/2542] HACK: winex11: Only wait for _NET_WM_STATE changes on KWin when in NormalState. This otherwise delays initial _NET_WM_STATE changes when window is still withdrawn, making it more likely to get fullscreen / maximized states fail to stick with KWin as state/config are applied on map. CW-Bug-Id: #25046 --- dlls/winex11.drv/window.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 9270740b3c1c..adcfcdfce9ad 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1271,7 +1271,9 @@ static void window_set_net_wm_state( struct x11drv_win_data *data, UINT new_stat if (old_state == new_state) return; /* states are the same, nothing to update */ /* On KWin wait for _NET_WM_STATE changes to complete when they touch maximized / fullscreen states */ - if (X11DRV_HasWindowManager( "KWin" ) && data->net_wm_state_serial && (old_state ^ new_state) & fullscreen_mask) return; + if (X11DRV_HasWindowManager( "KWin" ) && data->pending_state.wm_state == NormalState && + data->net_wm_state_serial && (old_state ^ new_state) & fullscreen_mask) + return; if (data->pending_state.wm_state == IconicState) return; /* window is iconic, don't update its state now */ if (data->pending_state.wm_state == WithdrawnState) /* set the _NET_WM_STATE atom directly */ From 9b4b2a4dc1df1df2e00974d3b9031b1452194547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 18 Mar 2025 11:52:51 +0100 Subject: [PATCH 1281/2542] HACK: winex11: Ignore other _NET_WM_STATE bits during KWin sticky fullscreen hack. Sometimes we get unexpected values as NET_WM_STATE_ABOVE gets randomly changed by KWin. We might need to track bits independently but it is a larger change. CW-Bug-Id: #25046 --- dlls/winex11.drv/window.c | 4 ++++ dlls/winex11.drv/x11drv.h | 1 + 2 files changed, 5 insertions(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index adcfcdfce9ad..5b3d228f2300 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1367,6 +1367,7 @@ static void window_set_config( struct x11drv_win_data *data, const RECT *new_rec if (data->wm_state_serial) return; /* another WM_STATE update is pending, wait for it to complete */ if (data->net_wm_state_serial) return; /* another _NET_WM_STATE update is pending, wait for it to complete */ WARN( "window %p/%lx is maximized/fullscreen, temporarily restoring\n", data->hwnd, data->whole_window ); + data->net_wm_state_hack = 1; net_wm_state = data->pending_state.net_wm_state; window_set_net_wm_state( data, net_wm_state & ~fullscreen_mask ); } @@ -1904,6 +1905,8 @@ void window_net_wm_state_notify( struct x11drv_win_data *data, unsigned long ser unsigned long *expect_serial = &data->net_wm_state_serial; const char *expected, *received, *prefix; + if (data->net_wm_state_hack) pending = desired = &value; + prefix = wine_dbg_sprintf( "window %p/%lx ", data->hwnd, data->whole_window ); received = wine_dbg_sprintf( "_NET_WM_STATE %#x/%lu", value, serial ); expected = *expect_serial ? wine_dbg_sprintf( ", expected %#x/%lu", *pending, *expect_serial ) : ""; @@ -1911,6 +1914,7 @@ void window_net_wm_state_notify( struct x11drv_win_data *data, unsigned long ser if (!handle_state_change( serial, expect_serial, sizeof(value), &value, desired, pending, current, expected, prefix, received, NULL )) return; + data->net_wm_state_hack = 0; /* send any pending changes from the desired state */ window_set_wm_state( data, data->desired_state.wm_state, data->desired_state.swp_flags ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 51711281f8a8..3412e863799d 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -664,6 +664,7 @@ struct x11drv_win_data UINT is_fullscreen : 1; /* is the window visible rect fullscreen */ UINT is_offscreen : 1; /* has been moved offscreen by the window manager */ UINT parent_invalid : 1; /* is the parent host window possibly invalid */ + UINT net_wm_state_hack : 1; /* hacking around KWin sticky fullscreen windows */ Window embedder; /* window id of embedder */ Pixmap icon_pixmap; Pixmap icon_mask; From 22bb981569c779e88c57526e3356fa147c60fd23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 18 Mar 2025 14:08:33 +0100 Subject: [PATCH 1282/2542] HACK: winex11: Don't change MWM functions either with Mutter. CW-Bug-Id: #25046 --- dlls/winex11.drv/window.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 5b3d228f2300..8512b57aeb9a 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -985,6 +985,12 @@ static void set_mwm_hints( struct x11drv_win_data *data, UINT style, UINT ex_sty } } + /* MWM functions changes can interacts with NET_WM_STATE changes with Mutter and may end + * up with unexpected NET_WM_STATE replies. We don't decorate windows with Mutter, there's + * no need to control MWM functions either. + */ + if (X11DRV_HasWindowManager( "Mutter" )) mwm_hints.functions = MWM_FUNC_ALL; + mwm_hints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS; mwm_hints.input_mode = 0; mwm_hints.status = 0; From e8e66c002da31c9f54b96f0a61362d7a703a4746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 18 Mar 2025 18:40:21 +0100 Subject: [PATCH 1283/2542] HACK: winex11: Don't set window size hints with KWin for more games. --- dlls/winex11.drv/window.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 8512b57aeb9a..47627b12b4bf 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -460,6 +460,11 @@ static inline BOOL is_window_resizable( struct x11drv_win_data *data, DWORD styl if ((sgi = getenv( "SteamGameId" )) && !strcmp( sgi, "2708320" ) && !wcscmp( class_name, UnityWndClassW )) return TRUE; + + /* Some games fail to get proper fullscreen window size with KWin if we set window size hints, + * as the windows may briefly not be covering the entire screen when they becomes fullscreen. + */ + if (sgi && !strcmp( sgi, "2552430" )) return TRUE; } /* Metacity needs the window to be resizable to make it fullscreen */ return data->is_fullscreen; From 4ac59724c9a14b7b38cfd812cbf65553fafea205 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 18 Mar 2025 14:57:14 -0600 Subject: [PATCH 1284/2542] winex11.drv: fshack: Init default fshack gamma. CW-Bug-ID: #25035 --- dlls/winex11.drv/opengl.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 27751477d213..0049447f1e37 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1196,6 +1196,7 @@ static const char *fs_hack_gamma_frag_shader_src = static WORD gamma_ramp_i[GAMMA_RAMP_SIZE * 3]; static float gamma_ramp[GAMMA_RAMP_SIZE * 4]; +static pthread_once_t gamma_init_once = PTHREAD_ONCE_INIT; static LONG gamma_serial; /* Return whether integer scaling is on */ @@ -1211,8 +1212,24 @@ BOOL fs_hack_is_integer(void) return is_int; } +static void init_default_gamma(void) +{ + unsigned int i; + + for (i = 0; i < GAMMA_RAMP_SIZE; ++i) + { + gamma_ramp_i[i] = gamma_ramp_i[i + GAMMA_RAMP_SIZE] = gamma_ramp_i[i + 2 * GAMMA_RAMP_SIZE] = + i * 65535 / (GAMMA_RAMP_SIZE - 1); + + gamma_ramp[i * 4] = gamma_ramp_i[i] / 65535.f; + gamma_ramp[i * 4 + 1] = gamma_ramp_i[i + GAMMA_RAMP_SIZE] / 65535.f; + gamma_ramp[i * 4 + 2] = gamma_ramp_i[i + 2 * GAMMA_RAMP_SIZE] / 65535.f; + } +} + BOOL fs_hack_get_gamma_ramp( PHYSDEV dev, void *data ) { + pthread_once( &gamma_init_once, init_default_gamma ); memcpy( data, gamma_ramp_i, sizeof(gamma_ramp_i) ); return TRUE; } @@ -1221,6 +1238,8 @@ BOOL fs_hack_set_gamma_ramp( PHYSDEV dev, void *data ) { const WORD *ramp = data; int i; + + pthread_once( &gamma_init_once, init_default_gamma ); if (memcmp( gamma_ramp_i, ramp, sizeof(gamma_ramp_i) ) == 0) { /* identical */ From 7a966056a91c63b41dec15fa1fe8ebb796c9df53 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 18 Mar 2025 15:48:30 -0600 Subject: [PATCH 1285/2542] winex11.drv: HACK: Force GL fshack on XWayland / NVidia. CW-Bug-Id: #25035 --- dlls/winex11.drv/opengl.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 0049447f1e37..66c109facc6e 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -317,6 +317,8 @@ enum glx_swap_control_method GLX_SWAP_CONTROL_MESA }; +static const char *gl_renderer; + /* X context to associate a struct gl_drawable to an hwnd */ static XContext gl_hwnd_context; /* X context to associate a struct gl_drawable to a pbuffer hdc */ @@ -541,7 +543,6 @@ static BOOL X11DRV_WineGL_InitOpenglInfo(void) int screen = DefaultScreen(gdi_display); Window win = 0, root = 0; const char *gl_version; - const char *gl_renderer; const char* str; BOOL glx_direct; XVisualInfo *vis; @@ -590,7 +591,7 @@ static BOOL X11DRV_WineGL_InitOpenglInfo(void) "installed correctly\n", is_win64 ? "64-bit" : "32-bit" ); goto done; } - gl_renderer = (const char *)opengl_funcs.gl.p_glGetString(GL_RENDERER); + gl_renderer = strdup( (const char *)opengl_funcs.gl.p_glGetString(GL_RENDERER) ); gl_version = (const char *)opengl_funcs.gl.p_glGetString(GL_VERSION); str = (const char *) opengl_funcs.gl.p_glGetString(GL_EXTENSIONS); glExtensions = malloc( strlen(str) + sizeof(legacy_extensions) ); @@ -1845,6 +1846,13 @@ BOOL enable_fullscreen_hack( HWND hwnd, BOOL check_gamma ) if (disable_fshack) return FALSE; if (NtUserGetDpiForWindow( hwnd ) != NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI )) return TRUE; /* needs DPI scaling */ + if (check_gamma && X11DRV_HasWindowManager( "xwayland" ) && gl_renderer && strstr( gl_renderer, "NVIDIA" )) + { + /* Force fshack on XWayland / NVidia because drawing to front buffer doesn't get presented there and fshack works + * that around as a side effect. */ + TRACE( "Forcing fshack on xwayland / NVIDIA.\n" ); + return TRUE; + } return check_gamma && ReadNoFence( &gamma_serial ); } From bc98674a58f886eb251377b366e8416ed37c556e Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 19 Mar 2025 09:02:25 -0400 Subject: [PATCH 1286/2542] tabtip: Allow opening/closing the steam OSK via window messages. CW-Bug-Id: #25039 --- programs/tabtip/tabtip.c | 77 ++++++++++++++++++++++++---------------- 1 file changed, 47 insertions(+), 30 deletions(-) diff --git a/programs/tabtip/tabtip.c b/programs/tabtip/tabtip.c index f641ef34d208..3fcdb2d86f36 100644 --- a/programs/tabtip/tabtip.c +++ b/programs/tabtip/tabtip.c @@ -34,6 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(tabtip); +#define WM_TABTIP_OSK_TOGGLE (WM_USER + 1) static BOOL keyboard_up; static BOOL use_steam_osk; static unsigned int steam_app_id; @@ -107,9 +108,16 @@ static const char *get_str_from_id_pair(int id, const struct str_id_pair *id_pai return ""; } +static void tabtip_toggle_steam_osk(BOOL raise, const RECT *rect); static const WCHAR tabtip_window_class_name[] = L"IPTip_Main_Window"; static LRESULT CALLBACK tabtip_win_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { + /* Try to invoke the OSK. */ + if (msg == WM_TABTIP_OSK_TOGGLE) + { + tabtip_toggle_steam_osk((BOOL)wparam, NULL); + } + return DefWindowProcW(hwnd, msg, wparam, lparam); } @@ -181,11 +189,48 @@ static ULONG WINAPI FocusChangedHandler_Release(IUIAutomationFocusChangedEventHa return 1; } +static void tabtip_toggle_steam_osk(BOOL raise, const RECT *rect) +{ + struct osk_link_data link_data = { 0 }; + + if (!use_steam_osk) + return; + + if (raise) + { + osk_link_init(&link_data, L"steam://open/keyboard"); + /* Requested in CW-Bug-Id: #21613. */ + if (steam_app_id) osk_link_add_int_arg(&link_data, L"AppID", steam_app_id); + if (rect && (rect->left || rect->top || rect->right || rect->bottom)) + { + osk_link_add_int_arg(&link_data, L"XPosition", rect->left); + osk_link_add_int_arg(&link_data, L"YPosition", rect->top); + osk_link_add_int_arg(&link_data, L"Width", (rect->right - rect->left)); + osk_link_add_int_arg(&link_data, L"Height", (rect->bottom - rect->top)); + osk_link_add_int_arg(&link_data, L"Mode", 0); + } + + WINE_TRACE("Keyboard up!\n"); + keyboard_up = TRUE; + } + else if (!raise && keyboard_up) + { + osk_link_init(&link_data, L"steam://close/keyboard"); + /* Requested in CW-Bug-Id: #21613. */ + if (steam_app_id) osk_link_add_int_arg(&link_data, L"AppID", steam_app_id); + + WINE_TRACE("Keyboard down!\n"); + keyboard_up = FALSE; + } + + if (link_data.link_buf_pos && (link_data.link_buf_pos != link_data.link_buf)) + ShellExecuteW(NULL, NULL, link_data.link_buf, NULL, NULL, SW_SHOWNOACTIVATE); +} + static HRESULT WINAPI FocusChangedHandler_HandleFocusChangedEvent(IUIAutomationFocusChangedEventHandler *iface, IUIAutomationElement *sender) { BOOL is_readonly, has_kbd_focus; - struct osk_link_data link_data = { 0 }; RECT rect = { 0 }; BSTR name = NULL; int control_type; @@ -216,35 +261,7 @@ static HRESULT WINAPI FocusChangedHandler_HandleFocusChangedEvent(IUIAutomationF is_readonly = ((V_VT(&v) == VT_BOOL) && (V_BOOL(&v) == VARIANT_TRUE)); VariantClear(&v); - if (use_steam_osk && (control_type == UIA_EditControlTypeId) && has_kbd_focus && !is_readonly) - { - osk_link_init(&link_data, L"steam://open/keyboard"); - /* Requested in CW-Bug-Id: #21613. */ - if (steam_app_id) osk_link_add_int_arg(&link_data, L"AppID", steam_app_id); - if (rect.left || rect.top || rect.right || rect.bottom) - { - osk_link_add_int_arg(&link_data, L"XPosition", rect.left); - osk_link_add_int_arg(&link_data, L"YPosition", rect.top); - osk_link_add_int_arg(&link_data, L"Width", (rect.right - rect.left)); - osk_link_add_int_arg(&link_data, L"Height", (rect.bottom - rect.top)); - osk_link_add_int_arg(&link_data, L"Mode", 0); - } - - WINE_TRACE("Keyboard up!\n"); - keyboard_up = TRUE; - } - else if (keyboard_up) - { - osk_link_init(&link_data, L"steam://close/keyboard"); - /* Requested in CW-Bug-Id: #21613. */ - if (steam_app_id) osk_link_add_int_arg(&link_data, L"AppID", steam_app_id); - - WINE_TRACE("Keyboard down!\n"); - keyboard_up = FALSE; - } - - if (use_steam_osk && link_data.link_buf_pos && (link_data.link_buf_pos != link_data.link_buf)) - ShellExecuteW(NULL, NULL, link_data.link_buf, NULL, NULL, SW_SHOWNOACTIVATE); + tabtip_toggle_steam_osk(((control_type == UIA_EditControlTypeId) && has_kbd_focus && !is_readonly), &rect); WINE_TRACE("name %s, control_type %d (%s), rect %s, has_kbd_focus %d, is_readonly %d\n", wine_dbgstr_w(name), control_type, get_str_for_id(control_type, uia_control_type_id_strs), wine_dbgstr_rect(&rect), From 43ad1d5abcf1a3bd41aa634f070732887c3a25c8 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 19 Mar 2025 09:05:07 -0400 Subject: [PATCH 1287/2542] windows.ui: HACK: Implement IInputPane2::Try{Show,Hide} via tabtip. Now that this interface is stubbed, Ubisoft Connect is using these methods to open the OSK. CW-Bug-Id: #25039 --- dlls/windows.ui/Makefile.in | 2 +- dlls/windows.ui/inputpane.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/dlls/windows.ui/Makefile.in b/dlls/windows.ui/Makefile.in index 953991cafba2..d489d6937398 100644 --- a/dlls/windows.ui/Makefile.in +++ b/dlls/windows.ui/Makefile.in @@ -1,5 +1,5 @@ MODULE = windows.ui.dll -IMPORTS = combase advapi32 +IMPORTS = combase advapi32 user32 SOURCES = \ classes.idl \ diff --git a/dlls/windows.ui/inputpane.c b/dlls/windows.ui/inputpane.c index 9a34f041d5c1..6626d4be2cd0 100644 --- a/dlls/windows.ui/inputpane.c +++ b/dlls/windows.ui/inputpane.c @@ -30,6 +30,8 @@ struct inputpane IInputPane IInputPane_iface; IInputPane2 IInputPane2_iface; LONG ref; + + HWND tabtip_hwnd; }; static inline struct inputpane *impl_from_IInputPane( IInputPane *iface ) @@ -155,16 +157,28 @@ static const struct IInputPaneVtbl inputpane_vtbl = DEFINE_IINSPECTABLE( inputpane2, IInputPane2, struct inputpane, IInputPane_iface ); +#define WM_TABTIP_OSK_TOGGLE (WM_USER + 1) static HRESULT WINAPI inputpane2_TryShow( IInputPane2 *iface, boolean *result ) { + struct inputpane *impl = impl_from_IInputPane2( iface ); + FIXME( "iface %p, result %p stub!\n", iface, result ); + *result = FALSE; + + PostMessageW(impl->tabtip_hwnd, WM_TABTIP_OSK_TOGGLE, TRUE, 0); + return S_OK; } static HRESULT WINAPI inputpane2_TryHide( IInputPane2 *iface, boolean *result ) { + struct inputpane *impl = impl_from_IInputPane2( iface ); + FIXME( "iface %p, result %p stub!\n", iface, result ); + + PostMessageW(impl->tabtip_hwnd, WM_TABTIP_OSK_TOGGLE, FALSE, 0); + return S_OK; } @@ -285,6 +299,8 @@ static HRESULT WINAPI factory_ActivateInstance( IActivationFactory *iface, IInsp impl->IInputPane2_iface.lpVtbl = &inputpane2_vtbl; impl->ref = 1; + impl->tabtip_hwnd = FindWindowW(L"IPTip_Main_Window", L"Input"); + *instance = (IInspectable *)&impl->IInputPane_iface; return S_OK; } From a14052f40d93cd43f792c2198f54330338d953fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Tue, 11 Feb 2025 22:38:13 +0200 Subject: [PATCH 1288/2542] mshtml: Clear the documents list when detaching inner window. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So we don't traverse them again later; they could have been destroyed, but they don't get removed from the list since script_global is set to NULL (which could also be destroyed first). Signed-off-by: Gabriel Ivăncescu (cherry picked from commit 684b0f6d88509a8fa454f943c53e0af0055cfacf) --- dlls/mshtml/htmlwindow.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 31255e7cebce..b56c6a327ccb 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -128,6 +128,7 @@ static void detach_inner_window(HTMLInnerWindow *window) LIST_FOR_EACH_ENTRY(doc_iter, &window->documents, HTMLDocumentNode, script_global_entry) doc_iter->script_global = NULL; + list_init(&window->documents); if(doc) detach_document_node(doc); From 6ee218260b83f596ee4063bfbc472f2aab2b0c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Tue, 11 Feb 2025 22:38:13 +0200 Subject: [PATCH 1289/2542] jscript: Use as_jsdisp where object is known to be a jsdisp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu (cherry picked from commit f15864dff0d485dea83f70ec48d219b30efdb636) --- dlls/jscript/engine.c | 4 ++-- dlls/jscript/jsutils.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index c95fcace84ab..d36567826dc9 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -1840,7 +1840,7 @@ static HRESULT interp_carray_set(script_ctx_t *ctx) array = stack_top(ctx); assert(is_object_instance(array)); - hres = jsdisp_propput_idx(to_jsdisp(get_object(array)), index, value); + hres = jsdisp_propput_idx(as_jsdisp(get_object(array)), index, value); jsval_release(value); return hres; } @@ -1887,7 +1887,7 @@ static HRESULT interp_obj_prop(script_ctx_t *ctx) jsdisp_t *func; assert(is_object_instance(val)); - func = to_jsdisp(get_object(val)); + func = as_jsdisp(get_object(val)); desc.mask = desc.flags; if(type == PROPERTY_DEFINITION_GETTER) { diff --git a/dlls/jscript/jsutils.c b/dlls/jscript/jsutils.c index cb139977a840..2c6516e06bbd 100644 --- a/dlls/jscript/jsutils.c +++ b/dlls/jscript/jsutils.c @@ -293,7 +293,7 @@ HRESULT variant_to_jsval(script_ctx_t *ctx, VARIANT *var, jsval_t *r) hres = IWineJSDispatchHost_GetJSDispatch(disp_host, &jsdisp_iface); IWineJSDispatchHost_Release(disp_host); if(SUCCEEDED(hres)) { - jsdisp_t *jsdisp = to_jsdisp((IDispatch *)jsdisp_iface); + jsdisp_t *jsdisp = as_jsdisp((IDispatch *)jsdisp_iface); if(jsdisp->ctx == ctx) { *r = jsval_obj(jsdisp); return S_OK; From fa8e64a8793259bb936ebb0cb6d328b74bef38c3 Mon Sep 17 00:00:00 2001 From: Austin English Date: Sun, 19 Jan 2025 13:37:43 -0600 Subject: [PATCH 1290/2542] mshtml: Add registry association for .log files. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=25872 (cherry picked from commit 4c6fae3d5c3a6ce801cbf20996b62d9b9cf3b32a) --- dlls/mshtml/mshtml.inf | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/mshtml/mshtml.inf b/dlls/mshtml/mshtml.inf index 3e05d849fe37..f2c60748c5fe 100644 --- a/dlls/mshtml/mshtml.inf +++ b/dlls/mshtml/mshtml.inf @@ -278,6 +278,7 @@ HKCR,".tiff","Content Type",,"image/tiff" HKCR,"MIME\Database\Content Type\text/plain","CLSID",,"%CLSID_HTMLDocument%" HKCR,"MIME\Database\Content Type\text/plain","Extension",,".txt" HKCR,"MIME\Database\Content Type\text/plain","Encoding",1,07,00,00,00 +HKCR,".log",,,"txtfile" HKCR,".txt",,,"txtfile" HKCR,".txt","Content Type",,"text/plain" From 3380887c19c40343705f04151b56cfbec784b0a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:04 +0200 Subject: [PATCH 1291/2542] mshtml: Keep the link from the inner window to the outer window even when detached. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Until the outer window is actually unlinked. Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/htmlanchor.c | 4 ++-- dlls/mshtml/htmldoc.c | 20 ++++++++++---------- dlls/mshtml/htmlform.c | 2 +- dlls/mshtml/htmlframe.c | 2 +- dlls/mshtml/htmlstorage.c | 1 - dlls/mshtml/htmlwindow.c | 25 ++++++++++++++++++++----- dlls/mshtml/mshtml_private.h | 8 ++++++++ dlls/mshtml/mutation.c | 2 +- dlls/mshtml/navigate.c | 8 ++++---- dlls/mshtml/nsevents.c | 6 +++--- dlls/mshtml/olecmd.c | 2 +- dlls/mshtml/script.c | 6 +++--- dlls/mshtml/tests/events.c | 3 --- 13 files changed, 54 insertions(+), 35 deletions(-) diff --git a/dlls/mshtml/htmlanchor.c b/dlls/mshtml/htmlanchor.c index 6f328b8173cf..15d2c50cf176 100644 --- a/dlls/mshtml/htmlanchor.c +++ b/dlls/mshtml/htmlanchor.c @@ -49,7 +49,7 @@ static HRESULT navigate_href_new_window(HTMLElement *element, nsAString *href_st IUri *uri; HRESULT hres; - if(!element->node.doc->window->base.outer_window) + if(is_detached_window(element->node.doc->window)) return S_OK; nsAString_GetData(href_str, &href); @@ -114,7 +114,7 @@ static HRESULT navigate_href(HTMLElement *element, nsAString *href_str, nsAStrin const PRUnichar *href; HRESULT hres; - if(!element->node.doc->window->base.outer_window) + if(is_detached_window(element->node.doc->window)) return S_OK; window = get_target_window(element->node.doc->window->base.outer_window, target_str, &use_new_window); diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 6ae7ccb36e41..ffd594291f3e 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -816,7 +816,7 @@ static HRESULT WINAPI HTMLDocument_get_frames(IHTMLDocument2 *iface, IHTMLFrames /* Not implemented by IE */ return E_NOTIMPL; } - if(!This->window->base.outer_window) + if(is_detached_window(This->window)) return E_FAIL; return IHTMLWindow2_get_frames(&This->window->base.outer_window->base.IHTMLWindow2_iface, p); } @@ -1000,7 +1000,7 @@ static HRESULT WINAPI HTMLDocument_put_URL(IHTMLDocument2 *iface, BSTR v) TRACE("(%p)->(%s)\n", This, debugstr_w(v)); - if(!This->window || !This->window->base.outer_window) { + if(!This->window || is_detached_window(This->window)) { FIXME("No window available\n"); return E_FAIL; } @@ -1015,7 +1015,7 @@ static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p) TRACE("(%p)->(%p)\n", iface, p); - if(This->window && !This->window->base.outer_window) { + if(This->window && is_detached_window(This->window)) { WARN("detached document\n"); return E_FAIL; } @@ -1064,7 +1064,7 @@ static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p) return E_NOTIMPL; } - if(This->window && (!This->window->base.outer_window || !This->window->base.outer_window->uri)) + if(This->window && (is_detached_window(This->window) || !This->window->base.outer_window->uri)) return E_FAIL; nsAString_Init(&nsstr, NULL); @@ -1094,7 +1094,7 @@ static HRESULT WINAPI HTMLDocument_put_cookie(IHTMLDocument2 *iface, BSTR v) if(!This->window) return S_OK; - if(!This->window->base.outer_window) + if(is_detached_window(This->window)) return E_FAIL; bret = InternetSetCookieExW(This->window->base.outer_window->url, NULL, v, 0, 0); @@ -1118,7 +1118,7 @@ static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p) *p = NULL; return S_OK; } - if(!This->window->base.outer_window) + if(is_detached_window(This->window)) return E_FAIL; size = 0; @@ -1367,7 +1367,7 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT *pomWindowResult = NULL; - if(!This->window || !This->window->base.outer_window) + if(!This->window || is_detached_window(This->window)) return E_FAIL; if(!This->dom_document) { @@ -2224,7 +2224,7 @@ static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, I TRACE("(%p)->(%p)\n", This, p); if(This->window) { - if(!This->window->base.outer_window) + if(is_detached_window(This->window)) return E_FAIL; if(This->window->base.outer_window->readystate == READYSTATE_UNINITIALIZED) { *p = NULL; @@ -4493,7 +4493,7 @@ static void HTMLDocumentNode_on_advise(IUnknown *iface, cp_static_data_t *cp) { HTMLDocumentNode *This = CONTAINING_RECORD((IHTMLDocument2*)iface, HTMLDocumentNode, IHTMLDocument2_iface); - if(This->window && This->window->base.outer_window) + if(This->window && !is_detached_window(This->window)) update_doc_cp_events(This, cp); } @@ -5589,7 +5589,7 @@ static HRESULT HTMLDocumentNode_location_hook(DispatchEx *dispex, WORD flags, DI if(!(flags & DISPATCH_PROPERTYPUT) || !This->window) return S_FALSE; - if(!This->window->base.outer_window) + if(is_detached_window(This->window)) return E_FAIL; return IWineJSDispatchHost_InvokeEx(&This->window->event_target.dispex.IWineJSDispatchHost_iface, diff --git a/dlls/mshtml/htmlform.c b/dlls/mshtml/htmlform.c index 153133493f67..1b90a7bd0e1c 100644 --- a/dlls/mshtml/htmlform.c +++ b/dlls/mshtml/htmlform.c @@ -519,7 +519,7 @@ static HRESULT WINAPI HTMLFormElement_submit(IHTMLFormElement *iface) if(This->element.node.doc) { HTMLDocumentNode *doc = This->element.node.doc; - if(doc->window && doc->window->base.outer_window) + if(doc->window && !is_detached_window(doc->window)) this_window = doc->window->base.outer_window; } if(!this_window) { diff --git a/dlls/mshtml/htmlframe.c b/dlls/mshtml/htmlframe.c index 193be9f63232..62a826ffbaec 100644 --- a/dlls/mshtml/htmlframe.c +++ b/dlls/mshtml/htmlframe.c @@ -79,7 +79,7 @@ static HRESULT WINAPI HTMLFrameBase_put_src(IHTMLFrameBase *iface, BSTR v) TRACE("(%p)->(%s)\n", This, debugstr_w(v)); - if(!This->content_window || !This->element.node.doc || !This->element.node.doc->window || !This->element.node.doc->window->base.outer_window) { + if(!This->content_window || !This->element.node.doc || !This->element.node.doc->window || is_detached_window(This->element.node.doc->window)) { nsAString nsstr; nsresult nsres; diff --git a/dlls/mshtml/htmlstorage.c b/dlls/mshtml/htmlstorage.c index 8fb5679089a9..98c1202e315a 100644 --- a/dlls/mshtml/htmlstorage.c +++ b/dlls/mshtml/htmlstorage.c @@ -332,7 +332,6 @@ static HRESULT send_storage_event(HTMLStorage *storage, BSTR key, BSTR old_value ctx.url = NULL; - /* FIXME: Events are actually sent to the current window on native, even if we're detached. */ if(!window->base.outer_window) goto done; diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index b56c6a327ccb..07ad4d882334 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -111,6 +111,10 @@ static void detach_inner_window(HTMLInnerWindow *window) HTMLOuterWindow *outer_window = window->base.outer_window; HTMLDocumentNode *doc = window->doc, *doc_iter; + /* Check if already detached */ + if(!list_empty(&window->outer_window_entry)) + return; + while(!list_empty(&window->children)) { HTMLOuterWindow *child = LIST_ENTRY(list_tail(&window->children), HTMLOuterWindow, sibling_entry); @@ -138,11 +142,13 @@ static void detach_inner_window(HTMLInnerWindow *window) abort_window_bindings(window); release_script_hosts(window); unlink_ref(&window->jscript); - window->base.outer_window = NULL; - if(outer_window && outer_window->base.inner_window == window) { - outer_window->base.inner_window = NULL; - IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface); + if(outer_window) { + list_add_tail(&outer_window->detached_inner_windows, &window->outer_window_entry); + if(outer_window->base.inner_window == window) { + outer_window->base.inner_window = NULL; + IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface); + } } } @@ -3779,6 +3785,7 @@ static void HTMLWindow_destructor(DispatchEx *dispex) HTMLInnerWindow *This = impl_from_DispatchEx(dispex); unsigned i; + list_remove(&This->outer_window_entry); VariantClear(&This->performance); for(i = 0; i < This->global_prop_cnt; i++) @@ -4318,6 +4325,12 @@ static nsresult NSAPI outer_window_unlink(void *p) unlink_ref(&window->window_proxy); wine_rb_remove(&window_map, &window->entry); } + while(!list_empty(&window->detached_inner_windows)) { + HTMLInnerWindow *inner_window = LIST_ENTRY(list_head(&window->detached_inner_windows), HTMLInnerWindow, outer_window_entry); + list_remove(&inner_window->outer_window_entry); + list_init(&inner_window->outer_window_entry); + inner_window->base.outer_window = NULL; + } return NS_OK; } @@ -4396,6 +4409,7 @@ static HRESULT create_inner_window(HTMLOuterWindow *outer_window, IMoniker *mon, list_init(&window->script_hosts); list_init(&window->bindings); list_init(&window->script_queue); + list_init(&window->outer_window_entry); window->base.outer_window = outer_window; window->base.inner_window = window; @@ -4431,6 +4445,7 @@ HRESULT create_outer_window(GeckoBrowser *browser, mozIDOMWindowProxy *mozwindow window->base.inner_window = NULL; window->browser = browser; list_add_head(&browser->outer_windows, &window->browser_entry); + list_init(&window->detached_inner_windows); ccref_init(&window->ccref, 1); mozIDOMWindowProxy_AddRef(mozwindow); @@ -4483,7 +4498,7 @@ HRESULT create_pending_window(HTMLOuterWindow *outer_window, nsChannelBSC *chann if(outer_window->pending_window) { abort_window_bindings(outer_window->pending_window); - outer_window->pending_window->base.outer_window = NULL; + list_add_tail(&outer_window->detached_inner_windows, &outer_window->pending_window->outer_window_entry); IHTMLWindow2_Release(&outer_window->pending_window->base.IHTMLWindow2_iface); } diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index d8600e984330..75f5f783b176 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -754,6 +754,7 @@ struct HTMLOuterWindow { struct list sibling_entry; struct wine_rb_entry entry; + struct list detached_inner_windows; }; struct HTMLInnerWindow { @@ -818,6 +819,8 @@ struct HTMLInnerWindow { ULONGLONG load_event_start_time; ULONGLONG load_event_end_time; ULONGLONG first_paint_time; + + struct list outer_window_entry; }; typedef enum { @@ -1313,6 +1316,11 @@ static inline BOOL is_main_content_window(HTMLOuterWindow *window) return window->browser && window == window->browser->content_window; } +static inline BOOL is_detached_window(HTMLInnerWindow *window) +{ + return !list_empty(&window->outer_window_entry) || !window->base.outer_window; +} + struct HTMLAttributeCollection { DispatchEx dispex; IHTMLAttributeCollection IHTMLAttributeCollection_iface; diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c index a135ea080fbf..5aa8cf50ed21 100644 --- a/dlls/mshtml/mutation.c +++ b/dlls/mshtml/mutation.c @@ -447,7 +447,7 @@ static void set_document_mode(HTMLDocumentNode *doc, compat_mode_t document_mode TRACE("%p: %d\n", doc, document_mode); - max_compat_mode = doc->window && doc->window->base.outer_window + max_compat_mode = doc->window && !is_detached_window(doc->window) ? get_max_compat_mode(doc->window->base.outer_window->uri) : COMPAT_MODE_IE11; if(max_compat_mode < document_mode) { diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index 90ca22ea8b1c..f05bf0be9c6d 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -578,7 +578,7 @@ static HRESULT WINAPI BindCallbackRedirect_Redirect(IBindCallbackRedirect *iface TRACE("(%p)->(%s %p)\n", This, debugstr_w(url), vbCancel); - if(This->window && This->window->base.outer_window && (browser = This->window->base.outer_window->browser) + if(This->window && !is_detached_window(This->window) && (browser = This->window->base.outer_window->browser) && browser->doc->doc_object_service) { if(is_main_content_window(This->window->base.outer_window)) { hres = IHTMLWindow2_get_name(&This->window->base.IHTMLWindow2_iface, &frame_name); @@ -1269,7 +1269,7 @@ static nsresult NSAPI nsAsyncVerifyRedirectCallback_OnRedirectVerifyCallback(nsI ERR("AddRequest failed: %08lx\n", nsres); } - if(This->bsc->is_doc_channel && This->bsc->bsc.window && This->bsc->bsc.window->base.outer_window) { + if(This->bsc->is_doc_channel && This->bsc->bsc.window && !is_detached_window(This->bsc->bsc.window)) { IUri *uri = nsuri_get_uri(This->nschannel->uri); if(uri) { @@ -1445,7 +1445,7 @@ static void handle_navigation_error(nsChannelBSC *This, DWORD result) BSTR unk; HRESULT hres; - if(!This->is_doc_channel || !This->bsc.window || !This->bsc.window->base.outer_window + if(!This->is_doc_channel || !This->bsc.window || is_detached_window(This->bsc.window) || !This->bsc.window->base.outer_window->browser) return; @@ -1644,7 +1644,7 @@ static void handle_extern_mime_navigation(nsChannelBSC *This) VARIANT flags; HRESULT hres; - if(!This->bsc.window || !This->bsc.window->base.outer_window || !This->bsc.window->base.outer_window->browser) + if(!This->bsc.window || is_detached_window(This->bsc.window) || !This->bsc.window->base.outer_window->browser) return; doc_obj = This->bsc.window->base.outer_window->browser->doc; diff --git a/dlls/mshtml/nsevents.c b/dlls/mshtml/nsevents.c index 5d52cf4f17a5..ee0e04f1aa9f 100644 --- a/dlls/mshtml/nsevents.c +++ b/dlls/mshtml/nsevents.c @@ -316,7 +316,7 @@ static nsresult handle_load(HTMLDocumentNode *doc, nsIDOMEvent *event) TRACE("(%p)\n", doc); - if(!doc->window || !doc->window->base.outer_window) + if(!doc->window || is_detached_window(doc->window)) return NS_ERROR_FAILURE; if(doc->doc_obj && doc->doc_obj->doc_node == doc) { doc_obj = doc->doc_obj; @@ -328,7 +328,7 @@ static nsresult handle_load(HTMLDocumentNode *doc, nsIDOMEvent *event) handle_docobj_load(doc_obj); doc->window->dom_complete_time = get_time_stamp(); - if(doc->window->base.outer_window) + if(!is_detached_window(doc->window)) set_ready_state(doc->window->base.outer_window, READYSTATE_COMPLETE); if(doc_obj) { @@ -339,7 +339,7 @@ static nsresult handle_load(HTMLDocumentNode *doc, nsIDOMEvent *event) update_title(doc_obj); - if(doc_obj->doc_object_service && doc->window->base.outer_window && !(doc->window->base.outer_window->load_flags & BINDING_REFRESH)) + if(doc_obj->doc_object_service && !is_detached_window(doc->window) && !(doc->window->base.outer_window->load_flags & BINDING_REFRESH)) IDocObjectService_FireDocumentComplete(doc_obj->doc_object_service, &doc->window->base.outer_window->base.IHTMLWindow2_iface, 0); diff --git a/dlls/mshtml/olecmd.c b/dlls/mshtml/olecmd.c index 650c44c9d2ba..8d0eafee812c 100644 --- a/dlls/mshtml/olecmd.c +++ b/dlls/mshtml/olecmd.c @@ -490,7 +490,7 @@ static HRESULT exec_refresh(HTMLDocumentNode *doc, DWORD nCmdexecopt, VARIANT *p } } - if(!doc->window || !doc->window->base.outer_window) + if(!doc->window || is_detached_window(doc->window)) return E_UNEXPECTED; return reload_page(doc->window->base.outer_window); diff --git a/dlls/mshtml/script.c b/dlls/mshtml/script.c index 3ad1da8cf3ca..a6ebb4a266d1 100644 --- a/dlls/mshtml/script.c +++ b/dlls/mshtml/script.c @@ -419,7 +419,7 @@ static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPC if(wcscmp(pstrName, L"window")) return DISP_E_MEMBERNOTFOUND; - if(!This->window || !This->window->base.outer_window) + if(!This->window || is_detached_window(This->window)) return E_FAIL; if(dispex_compat_mode(&This->window->event_target.dispex) >= COMPAT_MODE_IE9) @@ -565,7 +565,7 @@ static HRESULT WINAPI ActiveScriptSiteWindow_GetWindow(IActiveScriptSiteWindow * TRACE("(%p)->(%p)\n", This, phwnd); - if(!This->window || !This->window->base.outer_window) + if(!This->window || is_detached_window(This->window)) return E_UNEXPECTED; *phwnd = This->window->base.outer_window->browser->doc->hwnd; @@ -1433,7 +1433,7 @@ static ScriptHost *get_script_host(HTMLInnerWindow *window, const GUID *guid) void initialize_script_global(HTMLInnerWindow *script_global) { - if(!script_global->base.outer_window) + if(is_detached_window(script_global)) return; get_script_host(script_global, &CLSID_JScript); } diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c index 135b5ab40603..bdfbb6c6b788 100644 --- a/dlls/mshtml/tests/events.c +++ b/dlls/mshtml/tests/events.c @@ -4138,7 +4138,6 @@ static void test_window_refs(IHTMLDocument2 *doc) hres = IOmHistory_get_length(history, &length); ok(hres == S_OK, "get_length failed: %08lx\n", hres); - todo_wine ok(length == 42, "length = %d\n", length); IOmHistory_Release(history); } @@ -4403,9 +4402,7 @@ static void test_doc_obj(IHTMLDocument2 *doc) ok(doc_node != doc_node2, "doc_node == doc_node2\n"); hres = IHTMLDocument2_get_parentWindow(doc_node, &window2); - todo_wine ok(hres == S_OK, "get_parentWindow failed: %08lx\n", hres); - todo_wine ok(window == window2, "window != window2\n"); if(hres == S_OK) IHTMLWindow2_Release(window2); From 14ef41246680a43ea92d4285fdf82fcbde124593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:04 +0200 Subject: [PATCH 1292/2542] jscript: Obtain the jsdisp for host objects in other contexts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/jsutils.c | 9 ++------- dlls/mshtml/tests/documentmode.js | 1 - dlls/mshtml/tests/es5.js | 10 ++++++++++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/dlls/jscript/jsutils.c b/dlls/jscript/jsutils.c index 2c6516e06bbd..1d6fa06a993f 100644 --- a/dlls/jscript/jsutils.c +++ b/dlls/jscript/jsutils.c @@ -293,13 +293,8 @@ HRESULT variant_to_jsval(script_ctx_t *ctx, VARIANT *var, jsval_t *r) hres = IWineJSDispatchHost_GetJSDispatch(disp_host, &jsdisp_iface); IWineJSDispatchHost_Release(disp_host); if(SUCCEEDED(hres)) { - jsdisp_t *jsdisp = as_jsdisp((IDispatch *)jsdisp_iface); - if(jsdisp->ctx == ctx) { - *r = jsval_obj(jsdisp); - return S_OK; - }else { - jsdisp_release(jsdisp); - } + *r = jsval_obj(as_jsdisp((IDispatch *)jsdisp_iface)); + return S_OK; } } } diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 164f5e2bce40..5bbd8b098f64 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -2300,7 +2300,6 @@ async_test("storage events", function() { return; } var s = Object.prototype.toString.call(e); - todo_wine_if(e.target != window && e.target != document). ok(s === "[object StorageEvent]", "Object.toString = " + s); ok(e.key === key, "key = " + e.key + ", expected " + key); ok(e.oldValue === oldValue, "oldValue = " + e.oldValue + ", expected " + oldValue); diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index 40458c103c9d..02d83b607ca5 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -2848,6 +2848,7 @@ async_test("script_global", function() { todo_wine. ok(doc instanceof Object, "created doc is not an instance of Object"); ok(doc.implementation instanceof Object, "created doc.implementation is not an instance of Object"); + ok(doc.implementation instanceof DOMImplementation, "created doc.implementation is not an instance of DOMImplementation"); document.body.innerHTML = ""; var iframe = document.createElement("iframe"); @@ -2858,10 +2859,19 @@ async_test("script_global", function() { var doc = iframe.contentWindow.document; ok(!(doc instanceof Object), "doc is an instance of Object"); ok(!(doc.implementation instanceof Object), "doc.implementation is an instance of Object"); + ok(!(doc.implementation instanceof DOMImplementation), "doc.implementation is an instance of DOMImplementation"); + ok(doc.implementation instanceof iframe.contentWindow.DOMImplementation, "doc.implementation is not an instance of iframe's DOMImplementation"); doc = doc.implementation.createHTMLDocument("test"); ok(!(doc instanceof Object), "created iframe doc is an instance of Object"); ok(!(doc.implementation instanceof Object), "created iframe doc.implementation is an instance of Object"); + ok(!(doc.implementation instanceof DOMImplementation), "created iframe doc.implementation is an instance of DOMImplementation"); + ok(doc.implementation instanceof iframe.contentWindow.DOMImplementation, "created iframe doc.implementation is not an instance of iframe's DOMImplementation"); + + var r = Object.prototype.toString.call(iframe.contentWindow); + ok(r === "[object Window]", "iframe's Window toString = " + r); + r = Object.prototype.toString.call(iframe.contentWindow.DOMImplementation); + ok(r === "[object DOMImplementation]", "iframe's DOMImplementation toString = " + r); next_test(); }); From c0cbf2eceaa433b2353c13b7fa1b5d1a9ed450fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:04 +0200 Subject: [PATCH 1293/2542] mshtml: Release the node if there's no script global when handling events. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/nsevents.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/mshtml/nsevents.c b/dlls/mshtml/nsevents.c index ee0e04f1aa9f..342615a9e67c 100644 --- a/dlls/mshtml/nsevents.c +++ b/dlls/mshtml/nsevents.c @@ -441,8 +441,12 @@ static nsresult handle_htmlevent(HTMLDocumentNode *doc, nsIDOMEvent *nsevent) }else { hres = get_node(nsnode, TRUE, &node); nsIDOMNode_Release(nsnode); - if(FAILED(hres) || !node->doc->script_global) + if(FAILED(hres)) + return NS_OK; + if(!node->doc->script_global) { + IHTMLDOMNode_Release(&node->IHTMLDOMNode_iface); return NS_OK; + } target = &node->event_target; } From f4c6f9d56346934540bedaa67af5032ff53458ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:04 +0200 Subject: [PATCH 1294/2542] jscript: Get rid of the funcprot argument. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/function.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 5330bbae21f4..848ee657dc20 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -709,7 +709,7 @@ static const builtin_info_t FunctionInst_info = { }; static HRESULT create_function(script_ctx_t *ctx, const builtin_info_t *builtin_info, const function_vtbl_t *vtbl, size_t size, - DWORD flags, BOOL funcprot, jsdisp_t *prototype, void **ret) + DWORD flags, jsdisp_t *prototype, void **ret) { FunctionInstance *function; HRESULT hres; @@ -718,7 +718,7 @@ static HRESULT create_function(script_ctx_t *ctx, const builtin_info_t *builtin_ if(!function) return E_OUTOFMEMORY; - if(funcprot) + if(prototype) hres = init_dispex(&function->dispex, ctx, builtin_info, prototype); else if(builtin_info) hres = init_dispex_from_constr(&function->dispex, ctx, builtin_info, ctx->function_constr); @@ -779,7 +779,7 @@ HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc, if(!ctx->function_constr) return E_UNEXPECTED; - hres = create_function(ctx, builtin_info, &NativeFunctionVtbl, sizeof(NativeFunction), flags, FALSE, NULL, (void**)&function); + hres = create_function(ctx, builtin_info, &NativeFunctionVtbl, sizeof(NativeFunction), flags, NULL, (void**)&function); if(FAILED(hres)) return hres; @@ -957,7 +957,7 @@ HRESULT create_source_function(script_ctx_t *ctx, bytecode_t *code, function_cod HRESULT hres; hres = create_function(ctx, &InterpretedFunction_info, &InterpretedFunctionVtbl, sizeof(InterpretedFunction), - PROPF_CONSTR, FALSE, NULL, (void**)&function); + PROPF_CONSTR, NULL, (void**)&function); if(FAILED(hres)) return hres; @@ -1078,7 +1078,7 @@ HRESULT create_host_function(script_ctx_t *ctx, const struct property_info *desc return E_UNEXPECTED; hres = create_function(ctx, &HostFunction_info, &HostFunctionVtbl, sizeof(HostFunction), PROPF_METHOD, - FALSE, NULL, (void**)&function); + NULL, (void**)&function); if(FAILED(hres)) return hres; @@ -1194,7 +1194,7 @@ HRESULT init_host_constructor(script_ctx_t *ctx, IWineJSDispatchHost *host_const HRESULT hres; hres = create_function(ctx, &HostConstructor_info, &HostConstructorVtbl, sizeof(*function), PROPF_METHOD, - FALSE, NULL, (void**)&function); + NULL, (void**)&function); if(FAILED(hres)) return hres; function->host_iface = host_constr; @@ -1322,7 +1322,7 @@ static HRESULT create_bind_function(script_ctx_t *ctx, FunctionInstance *target, HRESULT hres; hres = create_function(ctx, &BindFunction_info, &BindFunctionVtbl, FIELD_OFFSET(BindFunction, args[argc]), PROPF_METHOD, - FALSE, NULL, (void**)&function); + NULL, (void**)&function); if(FAILED(hres)) return hres; @@ -1479,7 +1479,7 @@ HRESULT init_function_constr(script_ctx_t *ctx, jsdisp_t *object_prototype) HRESULT hres; hres = create_function(ctx, &Function_info, &NativeFunctionVtbl, sizeof(NativeFunction), PROPF_CONSTR, - TRUE, object_prototype, (void**)&prot); + object_prototype, (void**)&prot); if(FAILED(hres)) return hres; @@ -1487,7 +1487,7 @@ HRESULT init_function_constr(script_ctx_t *ctx, jsdisp_t *object_prototype) prot->name = L"prototype"; hres = create_function(ctx, &FunctionInst_info, &NativeFunctionVtbl, sizeof(NativeFunction), PROPF_CONSTR|1, - TRUE, &prot->function.dispex, (void**)&constr); + &prot->function.dispex, (void**)&constr); if(SUCCEEDED(hres)) { constr->proc = FunctionConstr_value; constr->name = L"Function"; From 3cf0569d7d0fc57bc5f3f3d2a9cbc2bd46ee318a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:04 +0200 Subject: [PATCH 1295/2542] jscript: Don't leak when popping (u)int values off the stack. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/engine.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index d36567826dc9..243b922c8f14 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -142,12 +142,24 @@ static HRESULT stack_pop_object(script_ctx_t *ctx, IDispatch **r) static inline HRESULT stack_pop_int(script_ctx_t *ctx, INT *r) { - return to_int32(ctx, stack_pop(ctx), r); + jsval_t v; + HRESULT hres; + + v = stack_pop(ctx); + hres = to_int32(ctx, v, r); + jsval_release(v); + return hres; } static inline HRESULT stack_pop_uint(script_ctx_t *ctx, UINT32 *r) { - return to_uint32(ctx, stack_pop(ctx), r); + jsval_t v; + HRESULT hres; + + v = stack_pop(ctx); + hres = to_uint32(ctx, v, r); + jsval_release(v); + return hres; } static inline unsigned local_off(call_frame_t *frame, int ref) From a9ec8d819bad98dd52301971d5cec8f7d73e2e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:04 +0200 Subject: [PATCH 1296/2542] jscript: Don't leak when return value of host constructor is not used. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/function.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 848ee657dc20..11ff98612462 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -1142,8 +1142,8 @@ static HRESULT HostConstructor_call(script_ctx_t *ctx, FunctionInstance *func, j if(SUCCEEDED(hres)) { V_VT(&ret) = VT_EMPTY; - hres = IWineJSDispatchHost_Construct(function->host_iface, ctx->lcid, flags, &dp, &ret, &ei, - &ctx->jscaller->IServiceProvider_iface); + hres = IWineJSDispatchHost_Construct(function->host_iface, ctx->lcid, flags, &dp, r ? &ret : NULL, + &ei, &ctx->jscaller->IServiceProvider_iface); if(hres == DISP_E_EXCEPTION) handle_dispatch_exception(ctx, &ei); if(SUCCEEDED(hres) && r) { From 98c1cd02665dccb5118dd9be472dac82d70912cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:04 +0200 Subject: [PATCH 1297/2542] mshtml: Use the object's prototype itself first when looking through the chain. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, the first prototype was simply skipped, since prototype_id would point to the *second* prototype (first one is implicitly assumed to be the object's dispex). Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/dispex.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 77eec0499128..7e85d41b4fd8 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -1375,6 +1375,11 @@ HRESULT dispex_get_chain_builtin_id(DispatchEx *dispex, const WCHAR *name, DWORD assert(compat_mode >= COMPAT_MODE_IE9); + hres = get_builtin_id(info, name, flags, pid); + if(hres != DISP_E_UNKNOWNNAME) + return hres; + info = info->desc->prototype_info[compat_mode - COMPAT_MODE_IE9]; + for(;;) { hres = get_builtin_id(info, name, flags, pid); if(hres != DISP_E_UNKNOWNNAME) From ce5442de6b0bfa6bae1fe26859e40637b5d5ed47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:04 +0200 Subject: [PATCH 1298/2542] mshtml: Validate builtin host functions in IE9+ using prototype_id rather than tid where possible. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/dispex.c | 6 +++--- dlls/jscript/function.c | 6 +++--- dlls/jscript/jsdisp.idl | 4 ++-- dlls/mshtml/dispex.c | 34 +++++++++++++++++++++---------- dlls/mshtml/htmldoc.c | 2 +- dlls/mshtml/htmlstorage.c | 2 +- dlls/mshtml/htmlwindow.c | 8 ++++---- dlls/mshtml/pluginhost.c | 2 +- dlls/mshtml/tests/documentmode.js | 14 +++++++++++++ 9 files changed, 52 insertions(+), 26 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index d5ed3adf4fb0..98cd608cab09 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -275,7 +275,7 @@ static HRESULT update_external_prop(jsdisp_t *obj, const WCHAR *name, dispex_pro if(desc->name) name = desc->name; - if(!desc->iid) { + if(!desc->prototype_id) { if(!prop && !(prop = alloc_prop(obj, name, PROP_DELETED, 0))) return E_OUTOFMEMORY; prop->type = PROP_EXTERN; @@ -497,7 +497,7 @@ HRESULT jsdisp_index_lookup(jsdisp_t *obj, const WCHAR *name, unsigned length, s desc->flags |= PROPF_WRITABLE; desc->name = NULL; desc->index = idx; - desc->iid = 0; + desc->prototype_id = 0; return S_OK; } @@ -512,7 +512,7 @@ HRESULT jsdisp_next_index(jsdisp_t *obj, unsigned length, unsigned id, struct pr desc->flags |= PROPF_WRITABLE; desc->name = NULL; desc->index = desc->id; - desc->iid = 0; + desc->prototype_id = 0; return S_OK; } diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 11ff98612462..cbb076abc33d 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -67,7 +67,7 @@ typedef struct { FunctionInstance function; const WCHAR *name; UINT32 id; - UINT32 iid; + INT32 prototype_id; UINT32 flags; } HostFunction; @@ -1023,7 +1023,7 @@ static HRESULT HostFunction_call(script_ctx_t *ctx, FunctionInstance *func, jsva if(SUCCEEDED(hres)) { V_VT(&retv) = VT_EMPTY; - hres = IWineJSDispatchHost_CallFunction(obj, function->id, function->iid, function->flags, &dp, + hres = IWineJSDispatchHost_CallFunction(obj, function->id, function->prototype_id, function->flags, &dp, r ? &retv : NULL, &ei, &ctx->jscaller->IServiceProvider_iface); if(hres == DISP_E_EXCEPTION) handle_dispatch_exception(ctx, &ei); @@ -1084,7 +1084,7 @@ HRESULT create_host_function(script_ctx_t *ctx, const struct property_info *desc function->name = desc->name; function->id = desc->id; - function->iid = desc->iid; + function->prototype_id = desc->prototype_id; function->flags = flags; *ret = &function->function.dispex; return S_OK; diff --git a/dlls/jscript/jsdisp.idl b/dlls/jscript/jsdisp.idl index 5f1384bce782..ce1d71bab6a8 100644 --- a/dlls/jscript/jsdisp.idl +++ b/dlls/jscript/jsdisp.idl @@ -27,7 +27,7 @@ struct property_info UINT32 flags; const WCHAR *name; UINT32 index; - UINT32 iid; + INT32 prototype_id; }; const unsigned int PROPF_METHOD = 0x0100; @@ -69,7 +69,7 @@ interface IWineJSDispatchHost : IDispatchEx HRESULT SetProperty(DISPID id, LCID lcid, VARIANT *v, EXCEPINFO *ei, IServiceProvider *caller); HRESULT DeleteProperty(DISPID id); HRESULT ConfigureProperty(DISPID id, UINT32 flags); - HRESULT CallFunction(DISPID id, UINT32 iid, DWORD flags, DISPPARAMS *dp, VARIANT *ret, EXCEPINFO *ei, IServiceProvider *caller); + HRESULT CallFunction(DISPID id, INT32 prototype_id, DWORD flags, DISPPARAMS *dp, VARIANT *ret, EXCEPINFO *ei, IServiceProvider *caller); HRESULT Construct(LCID lcid, DWORD flags, DISPPARAMS *dp, VARIANT *ret, EXCEPINFO *ei, IServiceProvider *caller); HRESULT GetOuterDispatch(IWineJSDispatchHost **ret); HRESULT ToString(BSTR *str); diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 7e85d41b4fd8..c411cef0c9c7 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -1075,7 +1075,7 @@ static HRESULT function_apply(func_disp_t *func, DISPPARAMS *dp, LCID lcid, VARI } } - hres = IWineJSDispatchHost_CallFunction(this_iface, func->info->id, func->info->tid, DISPATCH_METHOD, ¶ms, res, ei, caller); + hres = IWineJSDispatchHost_CallFunction(this_iface, func->info->id, -func->info->tid, DISPATCH_METHOD, ¶ms, res, ei, caller); fail: while(argc--) @@ -1102,7 +1102,7 @@ static HRESULT function_call(func_disp_t *func, DISPPARAMS *dp, LCID lcid, VARIA if(FAILED(hres)) return CTL_E_ILLEGALFUNCTIONCALL; - hres = IWineJSDispatchHost_CallFunction(this_iface, func->info->id, func->info->tid, DISPATCH_METHOD, ¶ms, res, ei, caller); + hres = IWineJSDispatchHost_CallFunction(this_iface, func->info->id, -func->info->tid, DISPATCH_METHOD, ¶ms, res, ei, caller); IWineJSDispatchHost_Release(this_iface); return (hres == E_UNEXPECTED) ? CTL_E_ILLEGALFUNCTIONCALL : hres; } @@ -1179,7 +1179,7 @@ static HRESULT function_get_prop_desc(DispatchEx *dispex, DISPID id, struct prop desc->id = id; desc->flags = 0; desc->name = function_props[idx].name; - desc->iid = 0; + desc->prototype_id = 0; return S_OK; } @@ -2578,7 +2578,7 @@ HRESULT dispex_index_prop_desc(DispatchEx *dispex, DISPID id, struct property_in desc->flags |= PROPF_ENUMERABLE; desc->name = NULL; desc->index = id - MSHTML_DISPID_CUSTOM_MIN; - desc->iid = 0; + desc->prototype_id = 0; return S_OK; } @@ -2598,18 +2598,18 @@ static HRESULT get_host_property_descriptor(DispatchEx *This, DISPID id, struct desc->flags = PROPF_CONFIGURABLE; desc->name = func->name; if(func->func_disp_idx >= 0) { - desc->iid = func->tid; + desc->prototype_id = This->info->desc->id ? This->info->desc->id : -func->tid; desc->flags |= PROPF_METHOD | PROPF_WRITABLE; }else { if(func->func_disp_idx == -1) desc->flags |= PROPF_ENUMERABLE; if(This->info->is_prototype) { - desc->iid = func->tid; + desc->prototype_id = This->info->desc->id ? This->info->desc->id : -func->tid; if(func->put_vtbl_off) desc->flags |= PROPF_WRITABLE; }else { desc->flags |= PROPF_WRITABLE; - desc->iid = 0; + desc->prototype_id = 0; } } break; @@ -2618,7 +2618,7 @@ static HRESULT get_host_property_descriptor(DispatchEx *This, DISPID id, struct dynamic_prop_t *prop = &This->dynamic_data->props[id - DISPID_DYNPROP_0]; desc->flags = prop->flags & PROPF_PUBLIC_MASK; desc->name = prop->name; - desc->iid = 0; + desc->prototype_id = 0; break; } case DISPEXPROP_CUSTOM: @@ -2705,19 +2705,31 @@ static HRESULT WINAPI JSDispatchHost_ConfigureProperty(IWineJSDispatchHost *ifac return S_OK; } -static HRESULT WINAPI JSDispatchHost_CallFunction(IWineJSDispatchHost *iface, DISPID id, UINT32 iid, DWORD flags, +static HRESULT WINAPI JSDispatchHost_CallFunction(IWineJSDispatchHost *iface, DISPID id, INT32 prototype_id, DWORD flags, DISPPARAMS *dp, VARIANT *ret, EXCEPINFO *ei, IServiceProvider *caller) { DispatchEx *This = impl_from_IWineJSDispatchHost(iface); + dispex_static_data_t *desc = This->info->desc; func_info_t *func; HRESULT hres; - TRACE("%s (%p)->(%lx %x %lx %p %p %p %p)\n", This->info->name, This, id, iid, flags, dp, ret, ei, caller); + TRACE("%s (%p)->(%lx %d %lx %p %p %p %p)\n", This->info->name, This, id, prototype_id, flags, dp, ret, ei, caller); hres = get_builtin_func(This->info, id, &func); - if(FAILED(hres) || func->tid != iid) + if(FAILED(hres)) return E_UNEXPECTED; + if(prototype_id <= 0) { + if(func->tid != -prototype_id) + return E_UNEXPECTED; + }else if(prototype_id != desc->id) { + while(prototype_id != desc->prototype_id) { + if(!desc->prototype_id) + return E_UNEXPECTED; + desc = object_descriptors[desc->prototype_id]; + } + } + switch(flags) { case DISPATCH_METHOD: assert(func->func_disp_idx >= 0); diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index ffd594291f3e..056d6cbacf65 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5528,7 +5528,7 @@ static HRESULT HTMLDocumentNode_get_prop_desc(DispatchEx *dispex, DISPID id, str desc->name = This->elem_vars[idx]; desc->id = id; desc->flags = PROPF_WRITABLE | PROPF_CONFIGURABLE | PROPF_ENUMERABLE; - desc->iid = 0; + desc->prototype_id = 0; return S_OK; } diff --git a/dlls/mshtml/htmlstorage.c b/dlls/mshtml/htmlstorage.c index 98c1202e315a..263e2479a820 100644 --- a/dlls/mshtml/htmlstorage.c +++ b/dlls/mshtml/htmlstorage.c @@ -1273,7 +1273,7 @@ static HRESULT HTMLStorage_get_prop_desc(DispatchEx *dispex, DISPID id, struct p desc->name = This->props[id - MSHTML_DISPID_CUSTOM_MIN]; desc->id = id; desc->flags = PROPF_WRITABLE | PROPF_CONFIGURABLE | PROPF_ENUMERABLE; - desc->iid = 0; + desc->prototype_id = 0; return S_OK; } diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 07ad4d882334..7856a9d97be2 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3498,13 +3498,13 @@ static HRESULT WINAPI WindowDispEx_ConfigureProperty(IWineJSDispatchHost *iface, return IWineJSDispatchHost_ConfigureProperty(&This->base.inner_window->event_target.dispex.IWineJSDispatchHost_iface, id, flags); } -static HRESULT WINAPI WindowDispEx_CallFunction(IWineJSDispatchHost *iface, DISPID id, UINT32 iid, DWORD flags, DISPPARAMS *dp, - VARIANT *ret, EXCEPINFO *ei, IServiceProvider *caller) +static HRESULT WINAPI WindowDispEx_CallFunction(IWineJSDispatchHost *iface, DISPID id, INT32 prototype_id, DWORD flags, + DISPPARAMS *dp, VARIANT *ret, EXCEPINFO *ei, IServiceProvider *caller) { HTMLOuterWindow *This = impl_from_IWineJSDispatchHost(iface); return IWineJSDispatchHost_CallFunction(&This->base.inner_window->event_target.dispex.IWineJSDispatchHost_iface, - id, iid, flags, dp, ret, ei, caller); + id, prototype_id, flags, dp, ret, ei, caller); } static HRESULT WINAPI WindowDispEx_Construct(IWineJSDispatchHost *iface, LCID lcid, DWORD flags, DISPPARAMS *dp, VARIANT *ret, @@ -4048,7 +4048,7 @@ HRESULT HTMLWindow_get_prop_desc(DispatchEx *dispex, DISPID id, struct property_ desc->name = prop->name; desc->id = id; desc->flags = PROPF_WRITABLE | PROPF_CONFIGURABLE; - desc->iid = 0; + desc->prototype_id = 0; switch(prop->type) { case GLOBAL_SCRIPTVAR: { diff --git a/dlls/mshtml/pluginhost.c b/dlls/mshtml/pluginhost.c index c4a580ea4eb9..03959266f1f2 100644 --- a/dlls/mshtml/pluginhost.c +++ b/dlls/mshtml/pluginhost.c @@ -835,7 +835,7 @@ HRESULT HTMLPluginContainer_get_prop_desc(DispatchEx *dispex, DISPID id, struct desc->id = id; desc->flags = 0; desc->name = plugin_container->props[id - MSHTML_DISPID_CUSTOM_MIN]->name; - desc->iid = 0; + desc->prototype_id = 0; return S_OK; } diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 5bbd8b098f64..d304fbadd62d 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -3131,6 +3131,13 @@ sync_test("__proto__", function() { ok(e.number === 0xa13b6 - 0x80000000 && e.name === "TypeError", "changing __proto__ on non-extensible object threw exception " + e.number + " (" + e.name + ")"); } + + obj = document.createElement("img"); + obj.__proto__ = ctor.prototype; + document.body.setAttribute.call(obj, "height", "101"); + r = document.body.getAttribute.call(obj, "height"); + ok(r === "101", "getAttribute(height) = " + r); + ok(!("getAttribute" in obj), "getAttribute exposed in obj"); }); sync_test("__defineGetter__", function() { @@ -3750,6 +3757,13 @@ sync_test("prototypes", function() { check(Attr.prototype, Node.prototype, "attr prototype"); check(document.createDocumentFragment(), DocumentFragment.prototype, "fragment"); check(DocumentFragment.prototype, Node.prototype, "fragment prototype"); + + try { + HTMLAreaElement.prototype.toString.call(document.createElement("a")); + ok(false, "Area element's toString on Anchor element didn't fail"); + } catch(e) { + ok(e.number == 0xffff - 0x80000000, "Area element's toString on Anchor element threw exception " + e.number); + } }); sync_test("prototype props", function() { From c56e21ceaeb07c3bdc6029f70f0ac321b210ffe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:04 +0200 Subject: [PATCH 1299/2542] mshtml: Move Image constructor to the window rather than the prototype. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/htmlimg.c | 4 +-- dlls/mshtml/htmlwindow.c | 60 ++++++++++++++++--------------- dlls/mshtml/mshtml_private.h | 9 +++-- dlls/mshtml/tests/documentmode.js | 16 +++++++++ 4 files changed, 56 insertions(+), 33 deletions(-) diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c index f6a4b992ab62..b4fd5de07b58 100644 --- a/dlls/mshtml/htmlimg.c +++ b/dlls/mshtml/htmlimg.c @@ -885,7 +885,7 @@ static dispex_static_data_t HTMLImageElementFactory_dispex = { .iface_tids = HTMLImageElementFactory_iface_tids, }; -HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow *window, HTMLImageElementFactory **ret_val) +HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow *window, DispatchEx **ret_val) { HTMLImageElementFactory *ret; @@ -900,6 +900,6 @@ HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow *window, HTMLImageElement init_dispatch(&ret->dispex, &HTMLImageElementFactory_dispex, window, dispex_compat_mode(&window->event_target.dispex)); - *ret_val = ret; + *ret_val = &ret->dispex; return S_OK; } diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 7856a9d97be2..c0f8aa3feaf0 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -683,18 +683,13 @@ static HRESULT WINAPI HTMLWindow2_get_Image(IHTMLWindow2 *iface, IHTMLImageEleme TRACE("(%p)->(%p)\n", This, p); - if(!window->image_factory) { - HRESULT hres; - - hres = HTMLImageElementFactory_Create(window, &window->image_factory); + if(!window->constructors[CTOR_IMAGE]) { + HRESULT hres = HTMLImageElementFactory_Create(window, &window->constructors[CTOR_IMAGE]); if(FAILED(hres)) return hres; } - *p = &window->image_factory->IHTMLImageElementFactory_iface; - IHTMLImageElementFactory_AddRef(*p); - - return S_OK; + return IWineJSDispatchHost_QueryInterface(&window->constructors[CTOR_IMAGE]->IWineJSDispatchHost_iface, &IID_IHTMLImageElementFactory, (void**)p); } static HRESULT WINAPI HTMLWindow2_get_location(IHTMLWindow2 *iface, IHTMLLocation **p) @@ -3707,8 +3702,6 @@ static void HTMLWindow_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCa note_cc_edge((nsISupports*)&This->doc->node.IHTMLDOMNode_iface, "doc", cb); if(This->console) note_cc_edge((nsISupports*)This->console, "console", cb); - if(This->image_factory) - note_cc_edge((nsISupports*)&This->image_factory->IHTMLImageElementFactory_iface, "image_factory", cb); if(This->option_factory) note_cc_edge((nsISupports*)&This->option_factory->IHTMLOptionElementFactory_iface, "option_factory", cb); if(This->screen) @@ -3749,11 +3742,6 @@ static void HTMLWindow_unlink(DispatchEx *dispex) release_event_target(&This->event_target); - if(This->image_factory) { - HTMLImageElementFactory *image_factory = This->image_factory; - This->image_factory = NULL; - IHTMLImageElementFactory_Release(&image_factory->IHTMLImageElementFactory_iface); - } if(This->option_factory) { HTMLOptionElementFactory *option_factory = This->option_factory; This->option_factory = NULL; @@ -3833,23 +3821,35 @@ static HRESULT HTMLWindow_find_dispid(DispatchEx *dispex, const WCHAR *name, DWO if(dispex_compat_mode(dispex) >= COMPAT_MODE_IE9) { const WCHAR **constr_name = bsearch(&name, constructor_names, ARRAYSIZE(constructor_names) , sizeof(constructor_names[0]), cmp_name); + DispatchEx *constr = NULL; + if(constr_name) { prototype_id_t id = constr_name - constructor_names + 1; compat_mode_t compat_mode = dispex_compat_mode(dispex); - DispatchEx *constr; - VARIANT v; if(compat_mode >= object_descriptors[id]->min_compat_mode && (!object_descriptors[id]->max_compat_mode || compat_mode <= object_descriptors[id]->max_compat_mode)) { hres = get_constructor(This, id, &constr); if(FAILED(hres)) return hres; - - V_VT(&v) = VT_DISPATCH; - V_DISPATCH(&v) = (IDispatch *)&constr->IWineJSDispatchHost_iface; - return dispex_define_property(&This->event_target.dispex, name, PROPF_WRITABLE | PROPF_CONFIGURABLE, &v, dispid); + } + }else { + if(!wcscmp(name, L"Image")) { + if(!This->constructors[CTOR_IMAGE]) { + hres = HTMLImageElementFactory_Create(This, &This->constructors[CTOR_IMAGE]); + if(FAILED(hres)) + return hres; + } + constr = This->constructors[CTOR_IMAGE]; } } + + if(constr) { + VARIANT v; + V_VT(&v) = VT_DISPATCH; + V_DISPATCH(&v) = (IDispatch *)&constr->IWineJSDispatchHost_iface; + return dispex_define_property(&This->event_target.dispex, name, PROPF_WRITABLE | PROPF_CONFIGURABLE, &v, dispid); + } } hres = get_frame_by_name(This->base.outer_window, name, FALSE, &frame); @@ -4194,15 +4194,18 @@ static HRESULT IHTMLWindow6_postMessage_hook(DispatchEx *dispex, WORD flags, DIS static void HTMLWindow_init_dispex_info(dispex_data_t *info, compat_mode_t compat_mode) { - static const dispex_hook_t window2_hooks[] = { - {DISPID_IHTMLWINDOW2_LOCATION, IHTMLWindow2_location_hook}, - {DISPID_UNKNOWN} - }; static const dispex_hook_t window2_ie11_hooks[] = { - {DISPID_IHTMLWINDOW2_LOCATION, IHTMLWindow2_location_hook}, - {DISPID_IHTMLWINDOW2_EXECSCRIPT, NULL}, + {DISPID_IHTMLWINDOW2_EXECSCRIPT}, + + /* IE9+ */ + {DISPID_IHTMLWINDOW2_IMAGE}, + + /* Common for all modes */ + {DISPID_IHTMLWINDOW2_LOCATION, IHTMLWindow2_location_hook}, {DISPID_UNKNOWN} }; + const dispex_hook_t *const window2_ie9_hooks = window2_ie11_hooks + 1; + const dispex_hook_t *const window2_hooks = window2_ie9_hooks + 1; static const dispex_hook_t window3_hooks[] = { {DISPID_IHTMLWINDOW3_SETTIMEOUT, IHTMLWindow3_setTimeout_hook}, {DISPID_UNKNOWN} @@ -4234,7 +4237,8 @@ static void HTMLWindow_init_dispex_info(dispex_data_t *info, compat_mode_t compa dispex_info_add_interface(info, IHTMLWindow5_tid, NULL); dispex_info_add_interface(info, IHTMLWindow4_tid, compat_mode >= COMPAT_MODE_IE11 ? window4_ie11_hooks : NULL); dispex_info_add_interface(info, IHTMLWindow3_tid, compat_mode >= COMPAT_MODE_IE11 ? window3_ie11_hooks : window3_hooks); - dispex_info_add_interface(info, IHTMLWindow2_tid, compat_mode >= COMPAT_MODE_IE11 ? window2_ie11_hooks : window2_hooks); + dispex_info_add_interface(info, IHTMLWindow2_tid, compat_mode >= COMPAT_MODE_IE11 ? window2_ie11_hooks : + compat_mode >= COMPAT_MODE_IE9 ? window2_ie9_hooks : window2_hooks); EventTarget_init_dispex_info(info, compat_mode); } diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 75f5f783b176..9218c52a5066 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -510,6 +510,10 @@ typedef enum { ALL_PROTOTYPES #undef X PROT_LAST, + + /* Extra constructors without new prototypes */ + CTOR_IMAGE = PROT_LAST, + CTOR_LAST } prototype_id_t; struct dispex_static_data_t { @@ -771,7 +775,6 @@ struct HTMLInnerWindow { IHTMLEventObj *event; - HTMLImageElementFactory *image_factory; HTMLOptionElementFactory *option_factory; IHTMLScreen *screen; OmHistory *history; @@ -801,7 +804,7 @@ struct HTMLInnerWindow { ULONG redirect_count; DispatchEx *prototypes[PROT_LAST]; - DispatchEx *constructors[PROT_LAST]; + DispatchEx *constructors[CTOR_LAST]; ULONGLONG navigation_start_time; ULONGLONG unload_event_start_time; @@ -1171,7 +1174,7 @@ HRESULT update_window_doc(HTMLInnerWindow*); HTMLOuterWindow *mozwindow_to_window(const mozIDOMWindowProxy*); void get_top_window(HTMLOuterWindow*,HTMLOuterWindow**); HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow*,HTMLOptionElementFactory**); -HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow*,HTMLImageElementFactory**); +HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow*,DispatchEx**); HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow*,DispatchEx**); HRESULT create_location(HTMLOuterWindow*,HTMLLocation**); HRESULT create_navigator(HTMLInnerWindow*,IOmNavigator**); diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index d304fbadd62d..e9a2f0172d0a 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -3995,3 +3995,19 @@ sync_test("prototype props", function() { check(Text, [ "removeNode", "replaceNode", "replaceWholeText", "splitText", "swapNode", "wholeText" ], [ "replaceWholeText", "wholeText" ]); check(UIEvent, [ "detail", "initUIEvent", "view" ], null, [ "deviceSessionId" ]); }); + +sync_test("constructors", function() { + var v = document.documentMode, i, r; + if(v < 9) + return; + + var ctors = [ "Image", "MutationObserver", "XMLHttpRequest" ]; + for(i = 0; i < ctors.length; i++) { + r = ctors[i]; + if(!(r in window)) + continue; + ok(window.hasOwnProperty(r), r + " not prop of window"); + ok(!Object.getPrototypeOf(window).hasOwnProperty(r), r + " is a prop of window's prototype"); + } + ok(window.Image.prototype === window.HTMLImageElement.prototype, "Image.prototype != HTMLImageElement.prototype"); +}); From 828f91eacfd703f02a9a0ae6d564088d947e29b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:04 +0200 Subject: [PATCH 1300/2542] mshtml: Move Option constructor to the window rather than the prototype. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/htmlselect.c | 4 ++-- dlls/mshtml/htmlwindow.c | 28 ++++++++++++---------------- dlls/mshtml/mshtml_private.h | 4 ++-- dlls/mshtml/tests/documentmode.js | 3 ++- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c index 2d02589db382..1436c959ca06 100644 --- a/dlls/mshtml/htmlselect.c +++ b/dlls/mshtml/htmlselect.c @@ -531,7 +531,7 @@ static dispex_static_data_t HTMLOptionElementFactory_dispex = { .iface_tids = HTMLOptionElementFactory_iface_tids, }; -HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow *window, HTMLOptionElementFactory **ret_ptr) +HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow *window, DispatchEx **ret_ptr) { HTMLOptionElementFactory *ret; @@ -546,7 +546,7 @@ HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow *window, HTMLOptionEleme init_dispatch(&ret->dispex, &HTMLOptionElementFactory_dispex, window, dispex_compat_mode(&window->event_target.dispex)); - *ret_ptr = ret; + *ret_ptr = &ret->dispex; return S_OK; } diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index c0f8aa3feaf0..97155058fff1 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -1236,18 +1236,13 @@ static HRESULT WINAPI HTMLWindow2_get_Option(IHTMLWindow2 *iface, IHTMLOptionEle TRACE("(%p)->(%p)\n", This, p); - if(!window->option_factory) { - HRESULT hres; - - hres = HTMLOptionElementFactory_Create(window, &window->option_factory); + if(!window->constructors[CTOR_OPTION]) { + HRESULT hres = HTMLOptionElementFactory_Create(window, &window->constructors[CTOR_OPTION]); if(FAILED(hres)) return hres; } - *p = &window->option_factory->IHTMLOptionElementFactory_iface; - IHTMLOptionElementFactory_AddRef(*p); - - return S_OK; + return IWineJSDispatchHost_QueryInterface(&window->constructors[CTOR_OPTION]->IWineJSDispatchHost_iface, &IID_IHTMLOptionElementFactory, (void**)p); } static HRESULT WINAPI HTMLWindow2_focus(IHTMLWindow2 *iface) @@ -3702,8 +3697,6 @@ static void HTMLWindow_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCa note_cc_edge((nsISupports*)&This->doc->node.IHTMLDOMNode_iface, "doc", cb); if(This->console) note_cc_edge((nsISupports*)This->console, "console", cb); - if(This->option_factory) - note_cc_edge((nsISupports*)&This->option_factory->IHTMLOptionElementFactory_iface, "option_factory", cb); if(This->screen) note_cc_edge((nsISupports*)This->screen, "screen", cb); if(This->history) @@ -3742,11 +3735,6 @@ static void HTMLWindow_unlink(DispatchEx *dispex) release_event_target(&This->event_target); - if(This->option_factory) { - HTMLOptionElementFactory *option_factory = This->option_factory; - This->option_factory = NULL; - IHTMLOptionElementFactory_Release(&option_factory->IHTMLOptionElementFactory_iface); - } unlink_ref(&This->screen); if(This->history) { OmHistory *history = This->history; @@ -3841,6 +3829,13 @@ static HRESULT HTMLWindow_find_dispid(DispatchEx *dispex, const WCHAR *name, DWO return hres; } constr = This->constructors[CTOR_IMAGE]; + }else if(!wcscmp(name, L"Option")) { + if(!This->constructors[CTOR_OPTION]) { + hres = HTMLOptionElementFactory_Create(This, &This->constructors[CTOR_OPTION]); + if(FAILED(hres)) + return hres; + } + constr = This->constructors[CTOR_OPTION]; } } @@ -4199,13 +4194,14 @@ static void HTMLWindow_init_dispex_info(dispex_data_t *info, compat_mode_t compa /* IE9+ */ {DISPID_IHTMLWINDOW2_IMAGE}, + {DISPID_IHTMLWINDOW2_OPTION}, /* Common for all modes */ {DISPID_IHTMLWINDOW2_LOCATION, IHTMLWindow2_location_hook}, {DISPID_UNKNOWN} }; const dispex_hook_t *const window2_ie9_hooks = window2_ie11_hooks + 1; - const dispex_hook_t *const window2_hooks = window2_ie9_hooks + 1; + const dispex_hook_t *const window2_hooks = window2_ie9_hooks + 2; static const dispex_hook_t window3_hooks[] = { {DISPID_IHTMLWINDOW3_SETTIMEOUT, IHTMLWindow3_setTimeout_hook}, {DISPID_UNKNOWN} diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 9218c52a5066..be9e91aa462f 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -513,6 +513,7 @@ typedef enum { /* Extra constructors without new prototypes */ CTOR_IMAGE = PROT_LAST, + CTOR_OPTION, CTOR_LAST } prototype_id_t; @@ -775,7 +776,6 @@ struct HTMLInnerWindow { IHTMLEventObj *event; - HTMLOptionElementFactory *option_factory; IHTMLScreen *screen; OmHistory *history; IOmNavigator *navigator; @@ -1173,7 +1173,7 @@ HRESULT create_outer_window(GeckoBrowser*,mozIDOMWindowProxy*,HTMLOuterWindow*,H HRESULT update_window_doc(HTMLInnerWindow*); HTMLOuterWindow *mozwindow_to_window(const mozIDOMWindowProxy*); void get_top_window(HTMLOuterWindow*,HTMLOuterWindow**); -HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow*,HTMLOptionElementFactory**); +HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow*,DispatchEx**); HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow*,DispatchEx**); HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow*,DispatchEx**); HRESULT create_location(HTMLOuterWindow*,HTMLLocation**); diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index e9a2f0172d0a..7b0152a6ecd9 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -4001,7 +4001,7 @@ sync_test("constructors", function() { if(v < 9) return; - var ctors = [ "Image", "MutationObserver", "XMLHttpRequest" ]; + var ctors = [ "Image", "MutationObserver", "Option", "XMLHttpRequest" ]; for(i = 0; i < ctors.length; i++) { r = ctors[i]; if(!(r in window)) @@ -4010,4 +4010,5 @@ sync_test("constructors", function() { ok(!Object.getPrototypeOf(window).hasOwnProperty(r), r + " is a prop of window's prototype"); } ok(window.Image.prototype === window.HTMLImageElement.prototype, "Image.prototype != HTMLImageElement.prototype"); + ok(window.Option.prototype === window.HTMLOptionElement.prototype, "Option.prototype != HTMLOptionElement.prototype"); }); From ca259360cfaab085a063a462f07a11e1313c5943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:04 +0200 Subject: [PATCH 1301/2542] mshtml: Ignore setting non-writable external props. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/dispex.c | 2 ++ dlls/mshtml/tests/documentmode.js | 25 ++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 98cd608cab09..7208f87e651a 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -659,6 +659,8 @@ static HRESULT prop_put(jsdisp_t *This, dispex_prop_t *prop, jsval_t val) TRACE("no prop_put\n"); return S_OK; } + if(!(prop->flags & PROPF_WRITABLE)) + return S_OK; hres = This->builtin_info->prop_put(This, prop->u.id, val); if(hres != S_FALSE) return hres; diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 7b0152a6ecd9..44e503ab4741 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -3997,7 +3997,7 @@ sync_test("prototype props", function() { }); sync_test("constructors", function() { - var v = document.documentMode, i, r; + var v = document.documentMode, i, r, old; if(v < 9) return; @@ -4011,4 +4011,27 @@ sync_test("constructors", function() { } ok(window.Image.prototype === window.HTMLImageElement.prototype, "Image.prototype != HTMLImageElement.prototype"); ok(window.Option.prototype === window.HTMLOptionElement.prototype, "Option.prototype != HTMLOptionElement.prototype"); + + r = Object.getOwnPropertyDescriptor(HTMLMetaElement, "prototype"); + ok(r.value === HTMLMetaElement.prototype, "HTMLMetaElement.prototype value = " + r.value); + ok(!("get" in r), "HTMLMetaElement.prototype has getter"); + ok(!("set" in r), "HTMLMetaElement.prototype has setter"); + ok(r.writable === false, "HTMLMetaElement.prototype writable = " + r.writable); + ok(r.enumerable === false, "HTMLMetaElement.prototype enumerable = " + r.enumerable); + ok(r.configurable === false, "HTMLMetaElement.prototype configurable = " + r.configurable); + + old = HTMLMetaElement.prototype; + HTMLMetaElement.prototype = Object.prototype; + ok(HTMLMetaElement.prototype === old, "HTMLMetaElement.prototype = " + HTMLMetaElement.prototype); + + r = (delete HTMLMetaElement.prototype); + ok(r === false, "delete HTMLMetaElement.prototype returned " + r); + ok(HTMLMetaElement.hasOwnProperty("prototype"), "prototype not a prop anymore of HTMLMetaElement"); + + old = window.HTMLMetaElement; + r = (delete window.HTMLMetaElement); + ok(r === true, "delete HTMLMetaElement returned " + r); + todo_wine. + ok(!window.hasOwnProperty("HTMLMetaElement"), "HTMLMetaElement still a property of window"); + window.HTMLMetaElement = old; }); From 17e72c14364da61d8f5b1e93811ed2ed763192c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:04 +0200 Subject: [PATCH 1302/2542] mshtml: Don't redefine deleted props in dispex_define_property. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/dispex.c | 8 ++++++++ dlls/mshtml/htmlwindow.c | 4 +++- dlls/mshtml/tests/documentmode.js | 1 - 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index c411cef0c9c7..6ca75bef8ddc 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -800,6 +800,14 @@ HRESULT dispex_define_property(DispatchEx *dispex, const WCHAR *name, DWORD flag dynamic_prop_t *prop; HRESULT hres; + if(flags & PROPF_CONFIGURABLE) { + prop = NULL; + hres = get_dynamic_prop(dispex, name, 0, &prop); + assert(FAILED(hres)); + if(prop) + return hres; + } + hres = alloc_dynamic_prop(dispex, name, NULL, &prop); if(FAILED(hres)) return hres; diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 97155058fff1..3de9fde5f1a8 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3843,7 +3843,9 @@ static HRESULT HTMLWindow_find_dispid(DispatchEx *dispex, const WCHAR *name, DWO VARIANT v; V_VT(&v) = VT_DISPATCH; V_DISPATCH(&v) = (IDispatch *)&constr->IWineJSDispatchHost_iface; - return dispex_define_property(&This->event_target.dispex, name, PROPF_WRITABLE | PROPF_CONFIGURABLE, &v, dispid); + hres = dispex_define_property(&This->event_target.dispex, name, PROPF_WRITABLE | PROPF_CONFIGURABLE, &v, dispid); + if(hres != DISP_E_UNKNOWNNAME) + return hres; } } diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 44e503ab4741..459ea22b50c6 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -4031,7 +4031,6 @@ sync_test("constructors", function() { old = window.HTMLMetaElement; r = (delete window.HTMLMetaElement); ok(r === true, "delete HTMLMetaElement returned " + r); - todo_wine. ok(!window.hasOwnProperty("HTMLMetaElement"), "HTMLMetaElement still a property of window"); window.HTMLMetaElement = old; }); From 7929a412735ff43c7b614c01c524677cf4f4bdf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:04 +0200 Subject: [PATCH 1303/2542] mshtml: Don't expose "create" from Image constructor in IE9+ modes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/htmlimg.c | 11 ++++++----- dlls/mshtml/tests/documentmode.js | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c index b4fd5de07b58..a194737aa704 100644 --- a/dlls/mshtml/htmlimg.c +++ b/dlls/mshtml/htmlimg.c @@ -864,10 +864,11 @@ static HRESULT HTMLImageElementFactory_value(DispatchEx *dispex, LCID lcid, return S_OK; } -static const tid_t HTMLImageElementFactory_iface_tids[] = { - IHTMLImageElementFactory_tid, - 0 -}; +static void HTMLImageElementFactory_init_dispex_info(dispex_data_t *info, compat_mode_t mode) +{ + if(mode < COMPAT_MODE_IE9) + dispex_info_add_interface(info, IHTMLImageElementFactory_tid, NULL); +} static const dispex_static_data_vtbl_t HTMLImageElementFactory_dispex_vtbl = { .query_interface = HTMLImageElementFactory_query_interface, @@ -882,7 +883,7 @@ static dispex_static_data_t HTMLImageElementFactory_dispex = { .constructor_id = PROT_HTMLImageElement, .vtbl = &HTMLImageElementFactory_dispex_vtbl, .disp_tid = IHTMLImageElementFactory_tid, - .iface_tids = HTMLImageElementFactory_iface_tids, + .init_info = HTMLImageElementFactory_init_dispex_info, }; HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow *window, DispatchEx **ret_val) diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 459ea22b50c6..8019e8400462 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -906,6 +906,20 @@ sync_test("style_props", function() { } }); +sync_test("constructor props", function() { + function test_exposed(constructor, prop, expect) { + if(expect) + ok(prop in window[constructor], prop + " not found in " + constructor + " constructor."); + else + ok(!(prop in window[constructor]), prop + " found in " + constructor + " constructor."); + } + var v = document.documentMode; + + test_exposed("Image", "create", v < 9); + test_exposed("XMLHttpRequest", "create", true); + if(v >= 11) test_exposed("MutationObserver", "create", false); +}); + sync_test("createElement_inline_attr", function() { var v = document.documentMode, e, s; From e628ef8cc1b572a15d8230d3f1250a563c5474d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:05 +0200 Subject: [PATCH 1304/2542] mshtml: Don't expose "create" from Option constructor in IE9+ modes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/htmlselect.c | 11 ++++++----- dlls/mshtml/tests/documentmode.js | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c index 1436c959ca06..efeed61bf9ab 100644 --- a/dlls/mshtml/htmlselect.c +++ b/dlls/mshtml/htmlselect.c @@ -510,10 +510,11 @@ static HRESULT HTMLOptionElementFactory_value(DispatchEx *dispex, LCID lcid, return S_OK; } -static const tid_t HTMLOptionElementFactory_iface_tids[] = { - IHTMLOptionElementFactory_tid, - 0 -}; +static void HTMLImageElementFactory_init_dispex_info(dispex_data_t *info, compat_mode_t mode) +{ + if(mode < COMPAT_MODE_IE9) + dispex_info_add_interface(info, IHTMLOptionElementFactory_tid, NULL); +} static const dispex_static_data_vtbl_t HTMLOptionElementFactory_dispex_vtbl = { .query_interface = HTMLOptionElementFactory_query_interface, @@ -528,7 +529,7 @@ static dispex_static_data_t HTMLOptionElementFactory_dispex = { .constructor_id = PROT_HTMLOptionElement, .vtbl = &HTMLOptionElementFactory_dispex_vtbl, .disp_tid = IHTMLOptionElementFactory_tid, - .iface_tids = HTMLOptionElementFactory_iface_tids, + .init_info = HTMLImageElementFactory_init_dispex_info, }; HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow *window, DispatchEx **ret_ptr) diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 8019e8400462..a9b455473592 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -916,6 +916,7 @@ sync_test("constructor props", function() { var v = document.documentMode; test_exposed("Image", "create", v < 9); + test_exposed("Option", "create", v < 9); test_exposed("XMLHttpRequest", "create", true); if(v >= 11) test_exposed("MutationObserver", "create", false); }); From 0b40cb61e233bd9b5167f035af4329fec39f293f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:05 +0200 Subject: [PATCH 1305/2542] mshtml: Expose "arguments" from host functions in IE9+ modes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/function.c | 6 ++++++ dlls/mshtml/tests/documentmode.js | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index cbb076abc33d..726c644d7c9b 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -975,10 +975,16 @@ HRESULT create_source_function(script_ctx_t *ctx, bytecode_t *code, function_cod return S_OK; } +static const builtin_prop_t HostFunction_props[] = { + {L"arguments", NULL, 0, Function_get_arguments}, +}; + static const builtin_info_t HostFunction_info = { .class = JSCLASS_FUNCTION, .call = Function_value, .destructor = Function_destructor, + .props_cnt = ARRAY_SIZE(HostFunction_props), + .props = HostFunction_props, .gc_traverse = Function_gc_traverse }; diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index a9b455473592..0b0aefb7bc5b 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -387,12 +387,19 @@ sync_test("builtin_obj", function() { window.toString.call(null); ok(false, "expected exception calling window.toString with null context"); }catch(ex) {} + + ok(!Object.hasOwnProperty.call(f, "arguments"), "arguments is a prop of createElement"); + ok(!Object.hasOwnProperty.call(f, "caller"), "caller is a prop of createElement"); + ok(!Object.hasOwnProperty.call(f, "length"), "length is a prop of createElement"); }else { ok(Object.getPrototypeOf(f) === Function.prototype, "unexpected document.createElement prototype"); e = window.toString.call(null); ok(e === "[object Window]", "window.toString with null context = " + e); e = window.toString.call(external.nullDisp); ok(e === "[object Window]", "window.toString with nullDisp context = " + e); + + ok(f.hasOwnProperty("arguments"), "arguments not a prop of createElement"); + ok(!f.hasOwnProperty("length"), "length is a prop of createElement"); } e = 0; @@ -4027,6 +4034,9 @@ sync_test("constructors", function() { ok(window.Image.prototype === window.HTMLImageElement.prototype, "Image.prototype != HTMLImageElement.prototype"); ok(window.Option.prototype === window.HTMLOptionElement.prototype, "Option.prototype != HTMLOptionElement.prototype"); + ok(XMLHttpRequest.create.hasOwnProperty("arguments"), "arguments not a prop of XMLHttpRequest.create"); + ok(!XMLHttpRequest.create.hasOwnProperty("length"), "length is a prop of XMLHttpRequest.create"); + r = Object.getOwnPropertyDescriptor(HTMLMetaElement, "prototype"); ok(r.value === HTMLMetaElement.prototype, "HTMLMetaElement.prototype value = " + r.value); ok(!("get" in r), "HTMLMetaElement.prototype has getter"); From b68a5e2bb395d08978fae238acf6dfc69b577c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:05 +0200 Subject: [PATCH 1306/2542] mshtml: Expose "caller" from host functions in IE9+ modes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/function.c | 1 + dlls/mshtml/tests/documentmode.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 726c644d7c9b..61b644ad6ae5 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -977,6 +977,7 @@ HRESULT create_source_function(script_ctx_t *ctx, bytecode_t *code, function_cod static const builtin_prop_t HostFunction_props[] = { {L"arguments", NULL, 0, Function_get_arguments}, + {L"caller", NULL, 0, Function_get_caller}, }; static const builtin_info_t HostFunction_info = { diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 0b0aefb7bc5b..bd6e899d92c1 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -399,6 +399,7 @@ sync_test("builtin_obj", function() { ok(e === "[object Window]", "window.toString with nullDisp context = " + e); ok(f.hasOwnProperty("arguments"), "arguments not a prop of createElement"); + ok(f.hasOwnProperty("caller"), "caller not a prop of createElement"); ok(!f.hasOwnProperty("length"), "length is a prop of createElement"); } @@ -4035,6 +4036,7 @@ sync_test("constructors", function() { ok(window.Option.prototype === window.HTMLOptionElement.prototype, "Option.prototype != HTMLOptionElement.prototype"); ok(XMLHttpRequest.create.hasOwnProperty("arguments"), "arguments not a prop of XMLHttpRequest.create"); + ok(XMLHttpRequest.create.hasOwnProperty("caller"), "caller not a prop of XMLHttpRequest.create"); ok(!XMLHttpRequest.create.hasOwnProperty("length"), "length is a prop of XMLHttpRequest.create"); r = Object.getOwnPropertyDescriptor(HTMLMetaElement, "prototype"); From 2bb9417711a918f7ce6a3aa16a28a092cbc176a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:05 +0200 Subject: [PATCH 1307/2542] mshtml: Expose "arguments" and "caller" from host constructors in IE9+ modes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/function.c | 2 ++ dlls/mshtml/tests/documentmode.js | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 61b644ad6ae5..aa836c460b4a 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -1123,6 +1123,8 @@ static const builtin_info_t HostConstructor_info = { .release = HostConstructor_release, .call = Function_value, .destructor = Function_destructor, + .props_cnt = ARRAY_SIZE(HostFunction_props), + .props = HostFunction_props, .gc_traverse = Function_gc_traverse, .lookup_prop = HostConstructor_lookup_prop, }; diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index bd6e899d92c1..a543ca6ce6f3 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -4031,6 +4031,11 @@ sync_test("constructors", function() { continue; ok(window.hasOwnProperty(r), r + " not prop of window"); ok(!Object.getPrototypeOf(window).hasOwnProperty(r), r + " is a prop of window's prototype"); + + ok(window[r].hasOwnProperty("arguments"), "arguments not a prop of " + r); + ok(window[r].hasOwnProperty("caller"), "caller not a prop of " + r); + ok(window[r].hasOwnProperty("prototype"), "prototype not a prop of " + r); + ok(!window[r].hasOwnProperty("length"), "length is a prop of " + r); } ok(window.Image.prototype === window.HTMLImageElement.prototype, "Image.prototype != HTMLImageElement.prototype"); ok(window.Option.prototype === window.HTMLOptionElement.prototype, "Option.prototype != HTMLOptionElement.prototype"); From 3fdd8d1097be35b6939ea48360485e619e92967b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:05 +0200 Subject: [PATCH 1308/2542] mshtml: Make sure manually created document dispex info is initialized in IE9+ modes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise, the prototype and all the related info may never be initialized, as the script can simply access properties of the object without interacting with the object's methods and so ensure_real_info never ends up called. Note that we can't do this from within create_document_node, as that will break if it's a document created from update_window_doc (the window's doc is not set at that point, since it's being created, and ensure_real_info needs it). Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/omnavigator.c | 8 +++++++- dlls/mshtml/tests/es5.js | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 6b255d4cd54b..8dd785e72ba4 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -113,6 +113,7 @@ static HRESULT WINAPI HTMLDOMImplementation2_createHTMLDocument(IHTMLDOMImplemen { HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation2(iface); HTMLDocumentNode *new_document_node; + compat_mode_t compat_mode; nsIDOMDocument *doc; nsAString title_str; nsresult nsres; @@ -131,12 +132,17 @@ static HRESULT WINAPI HTMLDOMImplementation2_createHTMLDocument(IHTMLDOMImplemen return E_FAIL; } + compat_mode = dispex_compat_mode(&This->dispex); hres = create_document_node(doc, This->doc->browser, NULL, This->doc->script_global, - dispex_compat_mode(&This->dispex), &new_document_node); + compat_mode, &new_document_node); nsIDOMDocument_Release(doc); if(FAILED(hres)) return hres; + /* make sure dispex info is initialized for the prototype */ + if(compat_mode >= COMPAT_MODE_IE9) + dispex_compat_mode(&new_document_node->node.event_target.dispex); + *new_document = &new_document_node->IHTMLDocument7_iface; return S_OK; } diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index 02d83b607ca5..295ea8d2b22b 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -2845,7 +2845,6 @@ async_test("script_global", function() { // Created documents share script global, so their objects are instances of Object from // the current script context. var doc = document.implementation.createHTMLDocument("test"); - todo_wine. ok(doc instanceof Object, "created doc is not an instance of Object"); ok(doc.implementation instanceof Object, "created doc.implementation is not an instance of Object"); ok(doc.implementation instanceof DOMImplementation, "created doc.implementation is not an instance of DOMImplementation"); From 5ca32eb12979c7b1bc7bf2a78d82c73abed2e814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:05 +0200 Subject: [PATCH 1309/2542] mshtml/tests: Test iframe window navigation resetting props. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/tests/dom.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/mshtml/tests/dom.js b/dlls/mshtml/tests/dom.js index 256cab60d7ca..300e22cd6841 100644 --- a/dlls/mshtml/tests/dom.js +++ b/dlls/mshtml/tests/dom.js @@ -147,9 +147,18 @@ async_test("iframe_location", function() { iframe.onload = function() { ok(iframe.contentWindow.location.pathname === "/emptyfile", "path = " + iframe.contentWindow.location.pathname); + ok(iframe.contentWindow.Image !== undefined, "Image is undefined"); + ok(iframe.contentWindow.VBArray !== undefined, "VBArray is undefined"); + iframe.contentWindow.Image = undefined; + iframe.contentWindow.VBArray = undefined; + iframe.contentWindow.foobar = 1234; iframe.onload = function () { ok(iframe.contentWindow.location.pathname === "/empty/file", "path = " + iframe.contentWindow.location.pathname); + ok(iframe.contentWindow.Image !== undefined, "Image is undefined (2)"); + ok(iframe.contentWindow.VBArray !== undefined, "VBArray is undefined (2)"); + ok(!Object.prototype.hasOwnProperty.call(iframe.contentWindow, "foobar"), + "contentWindow has foobar"); next_test(); } iframe.src = "empty/file"; From 188443cee2d699529b8aa53fb556bed295f78679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:05 +0200 Subject: [PATCH 1310/2542] mshtml: Fill the props in the host method instead of enumerating next prop. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No-op, but this describes the intent better, as we're not enumerating enumerable props only, we're filling them for enumeration done on jscript side (this is not called during enumeration itself, but as a prequel), and will be needed later. Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/dispex.c | 100 ++++++++++++++++++++------------------- dlls/jscript/function.c | 16 +++---- dlls/jscript/jscript.h | 4 +- dlls/jscript/jsdisp.idl | 3 +- dlls/jscript/string.c | 22 ++++----- dlls/mshtml/dispex.c | 45 +++++++++++------- dlls/mshtml/htmlwindow.c | 7 ++- 7 files changed, 107 insertions(+), 90 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 7208f87e651a..92d6b3968b22 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -501,21 +501,6 @@ HRESULT jsdisp_index_lookup(jsdisp_t *obj, const WCHAR *name, unsigned length, s return S_OK; } -HRESULT jsdisp_next_index(jsdisp_t *obj, unsigned length, unsigned id, struct property_info *desc) -{ - if(id + 1 == length) - return S_FALSE; - - desc->id = id + 1; - desc->flags = PROPF_ENUMERABLE; - if(obj->builtin_info->prop_put) - desc->flags |= PROPF_WRITABLE; - desc->name = NULL; - desc->index = desc->id; - desc->prototype_id = 0; - return S_OK; -} - static IDispatch *get_this(DISPPARAMS *dp) { DWORD i; @@ -748,34 +733,12 @@ HRESULT builtin_set_const(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) static HRESULT fill_props(jsdisp_t *obj) { - dispex_prop_t *prop; HRESULT hres; - if(obj->builtin_info->next_prop) { - struct property_info desc; - unsigned id = ~0; - WCHAR buf[12]; - - for(;;) { - hres = obj->builtin_info->next_prop(obj, id, &desc); - if(FAILED(hres)) - return hres; - if(hres == S_FALSE) - break; - - if(!desc.name) { - swprintf(buf, ARRAYSIZE(buf), L"%u", desc.index); - desc.name = buf; - } - - prop = lookup_dispex_prop(obj, string_hash(desc.name), desc.name, FALSE); - if(!prop) { - hres = update_external_prop(obj, desc.name, NULL, &desc, &prop); - if(FAILED(hres)) - return hres; - } - id = desc.id; - } + if(obj->builtin_info->fill_props) { + hres = obj->builtin_info->fill_props(obj); + if(FAILED(hres)) + return hres; } return S_OK; @@ -2404,6 +2367,25 @@ static HRESULT WINAPI WineJSDispatch_GetPropertyFlags(IWineJSDispatch *iface, DI return S_OK; } +static HRESULT WINAPI WineJSDispatch_UpdateProperty(IWineJSDispatch *iface, struct property_info *desc) +{ + jsdisp_t *This = impl_from_IWineJSDispatch(iface); + const WCHAR *name = desc->name; + dispex_prop_t *prop; + HRESULT hres = S_OK; + WCHAR buf[12]; + + if(!name) { + swprintf(buf, ARRAYSIZE(buf), L"%u", desc->index); + name = buf; + } + + if(!(prop = lookup_dispex_prop(This, string_hash(name), name, FALSE))) + hres = update_external_prop(This, name, NULL, desc, &prop); + + return hres; +} + static HRESULT WINAPI WineJSDispatch_GetScriptGlobal(IWineJSDispatch *iface, IWineJSDispatchHost **ret) { jsdisp_t *This = impl_from_IWineJSDispatch(iface); @@ -2437,6 +2419,7 @@ static IWineJSDispatchVtbl DispatchExVtbl = { DispatchEx_GetNameSpaceParent, WineJSDispatch_Free, WineJSDispatch_GetPropertyFlags, + WineJSDispatch_UpdateProperty, WineJSDispatch_GetScriptGlobal, }; @@ -3072,6 +3055,27 @@ HRESULT disp_delete(IDispatch *disp, DISPID id, BOOL *ret) return S_OK; } +HRESULT jsdisp_fill_indices(jsdisp_t *obj, unsigned length) +{ + struct property_info desc; + HRESULT hres; + + desc.flags = PROPF_ENUMERABLE; + if(obj->builtin_info->prop_put) + desc.flags |= PROPF_WRITABLE; + desc.name = NULL; + desc.prototype_id = 0; + + for(desc.index = 0; desc.index < length; desc.index++) { + desc.id = desc.index; + hres = WineJSDispatch_UpdateProperty(&obj->IWineJSDispatch_iface, &desc); + if(FAILED(hres)) + return hres; + } + + return S_OK; +} + HRESULT jsdisp_next_prop(jsdisp_t *obj, DISPID id, enum jsdisp_enum_type enum_type, DISPID *ret) { dispex_prop_t *iter; @@ -3507,25 +3511,25 @@ static HRESULT HostObject_prop_put(jsdisp_t *jsdisp, unsigned idx, jsval_t v) return hres; } -static HRESULT HostObject_next_prop(jsdisp_t *jsdisp, unsigned id, struct property_info *desc) +static HRESULT HostObject_prop_delete(jsdisp_t *jsdisp, unsigned id) { HostObject *This = HostObject_from_jsdisp(jsdisp); - return IWineJSDispatchHost_NextProperty(This->host_iface, id, desc); + return IWineJSDispatchHost_DeleteProperty(This->host_iface, id); } -static HRESULT HostObject_prop_delete(jsdisp_t *jsdisp, unsigned id) +static HRESULT HostObject_prop_config(jsdisp_t *jsdisp, unsigned id, unsigned flags) { HostObject *This = HostObject_from_jsdisp(jsdisp); - return IWineJSDispatchHost_DeleteProperty(This->host_iface, id); + return IWineJSDispatchHost_ConfigureProperty(This->host_iface, id, flags); } -static HRESULT HostObject_prop_config(jsdisp_t *jsdisp, unsigned id, unsigned flags) +static HRESULT HostObject_fill_props(jsdisp_t *jsdisp) { HostObject *This = HostObject_from_jsdisp(jsdisp); - return IWineJSDispatchHost_ConfigureProperty(This->host_iface, id, flags); + return IWineJSDispatchHost_FillProperties(This->host_iface); } static HRESULT HostObject_to_string(jsdisp_t *jsdisp, jsstr_t **ret) @@ -3550,9 +3554,9 @@ static const builtin_info_t HostObject_info = { .lookup_prop = HostObject_lookup_prop, .prop_get = HostObject_prop_get, .prop_put = HostObject_prop_put, - .next_prop = HostObject_next_prop, .prop_delete = HostObject_prop_delete, .prop_config = HostObject_prop_config, + .fill_props = HostObject_fill_props, .to_string = HostObject_to_string, }; diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index aa836c460b4a..bdc8834be41f 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -136,12 +136,6 @@ static HRESULT Arguments_lookup_prop(jsdisp_t *jsdisp, const WCHAR *name, unsign return jsdisp_index_lookup(&arguments->jsdisp, name, arguments->argc, desc); } -static HRESULT Arguments_next_prop(jsdisp_t *jsdisp, unsigned id, struct property_info *desc) -{ - ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); - return jsdisp_next_index(&arguments->jsdisp, arguments->argc, id, desc); -} - static jsval_t *get_argument_ref(ArgumentsInstance *arguments, unsigned idx) { if(arguments->buf) @@ -178,6 +172,12 @@ static HRESULT Arguments_prop_put(jsdisp_t *jsdisp, unsigned idx, jsval_t val) return S_OK; } +static HRESULT Arguments_fill_props(jsdisp_t *jsdisp) +{ + ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); + return jsdisp_fill_indices(&arguments->jsdisp, arguments->argc); +} + static HRESULT Arguments_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op op, jsdisp_t *jsdisp) { ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); @@ -239,9 +239,9 @@ static const builtin_info_t Arguments_info = { .props = Arguments_props, .destructor = Arguments_destructor, .lookup_prop = Arguments_lookup_prop, - .next_prop = Arguments_next_prop, .prop_get = Arguments_prop_get, .prop_put = Arguments_prop_put, + .fill_props = Arguments_fill_props, .gc_traverse = Arguments_gc_traverse }; @@ -250,9 +250,9 @@ static const builtin_info_t Arguments_ES5_info = { .call = Arguments_value, .destructor = Arguments_destructor, .lookup_prop = Arguments_lookup_prop, - .next_prop = Arguments_next_prop, .prop_get = Arguments_prop_get, .prop_put = Arguments_prop_put, + .fill_props = Arguments_fill_props, .gc_traverse = Arguments_gc_traverse }; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index e9207c231d8f..ee6a6454281c 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -184,11 +184,11 @@ typedef struct { ULONG (*release)(jsdisp_t*); void (*on_put)(jsdisp_t*,const WCHAR*); HRESULT (*lookup_prop)(jsdisp_t*,const WCHAR*,unsigned,struct property_info*); - HRESULT (*next_prop)(jsdisp_t*,unsigned,struct property_info*); HRESULT (*prop_get)(jsdisp_t*,unsigned,jsval_t*); HRESULT (*prop_put)(jsdisp_t*,unsigned,jsval_t); HRESULT (*prop_delete)(jsdisp_t*,unsigned); HRESULT (*prop_config)(jsdisp_t*,unsigned,unsigned); + HRESULT (*fill_props)(jsdisp_t*); HRESULT (*to_string)(jsdisp_t*,jsstr_t**); HRESULT (*gc_traverse)(struct gc_ctx*,enum gc_traverse_op,jsdisp_t*); } builtin_info_t; @@ -263,7 +263,7 @@ HRESULT jsdisp_get_idx_id(jsdisp_t*,DWORD,DISPID*); HRESULT disp_delete(IDispatch*,DISPID,BOOL*); HRESULT disp_delete_name(script_ctx_t*,IDispatch*,jsstr_t*,BOOL*); HRESULT jsdisp_index_lookup(jsdisp_t*,const WCHAR*,unsigned,struct property_info*); -HRESULT jsdisp_next_index(jsdisp_t*,unsigned,unsigned,struct property_info*); +HRESULT jsdisp_fill_indices(jsdisp_t*,unsigned); HRESULT jsdisp_delete_idx(jsdisp_t*,DWORD); HRESULT jsdisp_get_own_property(jsdisp_t*,const WCHAR*,BOOL,property_desc_t*); HRESULT jsdisp_define_property(jsdisp_t*,const WCHAR*,property_desc_t*); diff --git a/dlls/jscript/jsdisp.idl b/dlls/jscript/jsdisp.idl index ce1d71bab6a8..64c5eae7da96 100644 --- a/dlls/jscript/jsdisp.idl +++ b/dlls/jscript/jsdisp.idl @@ -52,6 +52,7 @@ interface IWineJSDispatch : IDispatchEx { void Free(); HRESULT GetPropertyFlags(DISPID id, UINT32 *ret); + HRESULT UpdateProperty(struct property_info *desc); HRESULT GetScriptGlobal(IWineJSDispatchHost **ret); } @@ -64,13 +65,13 @@ interface IWineJSDispatchHost : IDispatchEx { HRESULT GetJSDispatch(IWineJSDispatch **ret); HRESULT LookupProperty(const WCHAR *name, DWORD flags, struct property_info *desc); - HRESULT NextProperty(DISPID id, struct property_info *desc); HRESULT GetProperty(DISPID id, LCID lcid, VARIANT *r, EXCEPINFO *ei, IServiceProvider *caller); HRESULT SetProperty(DISPID id, LCID lcid, VARIANT *v, EXCEPINFO *ei, IServiceProvider *caller); HRESULT DeleteProperty(DISPID id); HRESULT ConfigureProperty(DISPID id, UINT32 flags); HRESULT CallFunction(DISPID id, INT32 prototype_id, DWORD flags, DISPPARAMS *dp, VARIANT *ret, EXCEPINFO *ei, IServiceProvider *caller); HRESULT Construct(LCID lcid, DWORD flags, DISPPARAMS *dp, VARIANT *ret, EXCEPINFO *ei, IServiceProvider *caller); + HRESULT FillProperties(); HRESULT GetOuterDispatch(IWineJSDispatchHost **ret); HRESULT ToString(BSTR *str); } diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index 968b74f9602a..42a2c697fbc4 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -1517,16 +1517,6 @@ static HRESULT String_lookup_prop(jsdisp_t *jsdisp, const WCHAR *name, unsigned return jsdisp_index_lookup(&string->dispex, name, jsstr_length(string->str), desc); } -static HRESULT String_next_prop(jsdisp_t *jsdisp, unsigned id, struct property_info *desc) -{ - StringInstance *string = string_from_jsdisp(jsdisp); - - if(string->dispex.ctx->version < 2) - return S_FALSE; - - return jsdisp_next_index(&string->dispex, jsstr_length(string->str), id, desc); -} - static HRESULT String_prop_get(jsdisp_t *jsdisp, unsigned idx, jsval_t *r) { StringInstance *string = string_from_jsdisp(jsdisp); @@ -1542,6 +1532,16 @@ static HRESULT String_prop_get(jsdisp_t *jsdisp, unsigned idx, jsval_t *r) return S_OK; } +static HRESULT String_fill_props(jsdisp_t *jsdisp) +{ + StringInstance *string = string_from_jsdisp(jsdisp); + + if(string->dispex.ctx->version < 2) + return S_OK; + + return jsdisp_fill_indices(&string->dispex, jsstr_length(string->str)); +} + static const builtin_prop_t String_props[] = { {L"anchor", String_anchor, PROPF_METHOD|1}, {L"big", String_big, PROPF_METHOD}, @@ -1596,8 +1596,8 @@ static const builtin_info_t StringInst_info = { .props = StringInst_props, .destructor = String_destructor, .lookup_prop = String_lookup_prop, - .next_prop = String_next_prop, .prop_get = String_prop_get, + .fill_props = String_fill_props, }; /* ECMA-262 3rd Edition 15.5.3.2 */ diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 6ca75bef8ddc..69669a37d006 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -2652,21 +2652,6 @@ static HRESULT WINAPI JSDispatchHost_LookupProperty(IWineJSDispatchHost *iface, return get_host_property_descriptor(This, id, desc); } -static HRESULT WINAPI JSDispatchHost_NextProperty(IWineJSDispatchHost *iface, DISPID id, struct property_info *desc) -{ - DispatchEx *This = impl_from_IWineJSDispatchHost(iface); - DISPID next; - HRESULT hres; - - TRACE("%s (%p)->(%lx)\n", This->info->name, This, id); - - hres = dispex_next_id(This, id, TRUE, &next); - if(hres != S_OK) - return hres; - - return get_host_property_descriptor(This, next, desc); -} - static HRESULT WINAPI JSDispatchHost_GetProperty(IWineJSDispatchHost *iface, DISPID id, LCID lcid, VARIANT *r, EXCEPINFO *ei, IServiceProvider *caller) { @@ -2766,6 +2751,34 @@ static HRESULT WINAPI JSDispatchHost_Construct(IWineJSDispatchHost *iface, LCID return dispex_prop_call(This, DISPID_VALUE, lcid, flags, dp, ret, ei, caller); } +static HRESULT WINAPI JSDispatchHost_FillProperties(IWineJSDispatchHost *iface) +{ + DispatchEx *This = impl_from_IWineJSDispatchHost(iface); + DISPID id = DISPID_STARTENUM; + struct property_info desc; + HRESULT hres; + + TRACE("%s (%p)->(%lx)\n", This->info->name, This, id); + + for(;;) { + hres = dispex_next_id(This, id, TRUE, &id); + if(FAILED(hres)) + return hres; + if(hres == S_FALSE) + break; + + hres = get_host_property_descriptor(This, id, &desc); + if(FAILED(hres)) + return hres; + + hres = IWineJSDispatch_UpdateProperty(This->jsdisp, &desc); + if(FAILED(hres)) + return hres; + } + + return S_OK; +} + static HRESULT WINAPI JSDispatchHost_GetOuterDispatch(IWineJSDispatchHost *iface, IWineJSDispatchHost **ret) { DispatchEx *This = impl_from_IWineJSDispatchHost(iface); @@ -2801,13 +2814,13 @@ static IWineJSDispatchHostVtbl JSDispatchHostVtbl = { DispatchEx_GetNameSpaceParent, JSDispatchHost_GetJSDispatch, JSDispatchHost_LookupProperty, - JSDispatchHost_NextProperty, JSDispatchHost_GetProperty, JSDispatchHost_SetProperty, JSDispatchHost_DeleteProperty, JSDispatchHost_ConfigureProperty, JSDispatchHost_CallFunction, JSDispatchHost_Construct, + JSDispatchHost_FillProperties, JSDispatchHost_GetOuterDispatch, JSDispatchHost_ToString, }; diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 3de9fde5f1a8..41e4792fae62 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3448,12 +3448,11 @@ static HRESULT WINAPI WindowDispEx_LookupProperty(IWineJSDispatchHost *iface, co name, flags, desc); } -static HRESULT WINAPI WindowDispEx_NextProperty(IWineJSDispatchHost *iface, DISPID id, struct property_info *desc) +static HRESULT WINAPI WindowDispEx_FillProperties(IWineJSDispatchHost *iface) { HTMLOuterWindow *This = impl_from_IWineJSDispatchHost(iface); - return IWineJSDispatchHost_NextProperty(&This->base.inner_window->event_target.dispex.IWineJSDispatchHost_iface, - id, desc); + return IWineJSDispatchHost_FillProperties(&This->base.inner_window->event_target.dispex.IWineJSDispatchHost_iface); } static HRESULT WINAPI WindowDispEx_GetProperty(IWineJSDispatchHost *iface, DISPID id, LCID lcid, VARIANT *r, @@ -3540,13 +3539,13 @@ static const IWineJSDispatchHostVtbl WindowDispExVtbl = { WindowDispEx_GetNameSpaceParent, WindowDispEx_GetJSDispatch, WindowDispEx_LookupProperty, - WindowDispEx_NextProperty, WindowDispEx_GetProperty, WindowDispEx_SetProperty, WindowDispEx_DeleteProperty, WindowDispEx_ConfigureProperty, WindowDispEx_CallFunction, WindowDispEx_Construct, + WindowDispEx_FillProperties, WindowDispEx_GetOuterDispatch, WindowDispEx_ToString, }; From e40b081a1c3c5a8e91c4467962222d1bb8932ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:05 +0200 Subject: [PATCH 1311/2542] mshtml: Only fill the external props once, unless they are volatile. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/dispex.c | 5 +++++ dlls/jscript/jscript.h | 9 +++++---- dlls/mshtml/dispex.c | 10 ++++++++-- dlls/mshtml/htmldoc.c | 6 ++++++ dlls/mshtml/htmlstorage.c | 6 ++++++ dlls/mshtml/htmlwindow.c | 6 ++++++ dlls/mshtml/mshtml_private.h | 3 +++ 7 files changed, 39 insertions(+), 6 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 92d6b3968b22..9d75a9141eac 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -735,10 +735,15 @@ static HRESULT fill_props(jsdisp_t *obj) { HRESULT hres; + if(obj->props_filled) + return S_OK; + if(obj->builtin_info->fill_props) { hres = obj->builtin_info->fill_props(obj); if(FAILED(hres)) return hres; + if(hres == S_OK) + obj->props_filled = TRUE; } return S_OK; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index ee6a6454281c..841d15f99bea 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -198,10 +198,11 @@ struct jsdisp_t { LONG ref; - BOOLEAN has_weak_refs; - BOOLEAN extensible; - BOOLEAN gc_marked; - BOOLEAN is_constructor; + BOOLEAN is_constructor : 1; + BOOLEAN has_weak_refs : 1; + BOOLEAN props_filled : 1; + BOOLEAN extensible : 1; + BOOLEAN gc_marked : 1; DWORD buf_size; DWORD prop_cnt; diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 69669a37d006..4fbac7e05274 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -2755,11 +2755,17 @@ static HRESULT WINAPI JSDispatchHost_FillProperties(IWineJSDispatchHost *iface) { DispatchEx *This = impl_from_IWineJSDispatchHost(iface); DISPID id = DISPID_STARTENUM; + HRESULT hres, retval = S_OK; struct property_info desc; - HRESULT hres; TRACE("%s (%p)->(%lx)\n", This->info->name, This, id); + if(This->info->vtbl->fill_props) { + retval = This->info->vtbl->fill_props(This); + if(FAILED(retval)) + return retval; + } + for(;;) { hres = dispex_next_id(This, id, TRUE, &id); if(FAILED(hres)) @@ -2776,7 +2782,7 @@ static HRESULT WINAPI JSDispatchHost_FillProperties(IWineJSDispatchHost *iface) return hres; } - return S_OK; + return retval; } static HRESULT WINAPI JSDispatchHost_GetOuterDispatch(IWineJSDispatchHost *iface, IWineJSDispatchHost **ret) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 056d6cbacf65..04a60577cd26 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5532,6 +5532,11 @@ static HRESULT HTMLDocumentNode_get_prop_desc(DispatchEx *dispex, DISPID id, str return S_OK; } +static HRESULT HTMLDocumentNode_fill_props(DispatchEx *dispex) +{ + return S_FALSE; +} + static HTMLInnerWindow *HTMLDocumentNode_get_script_global(DispatchEx *dispex, dispex_static_data_t **dispex_data) { HTMLDocumentNode *This = impl_from_DispatchEx(dispex); @@ -5640,6 +5645,7 @@ static const event_target_vtbl_t HTMLDocument_event_target_vtbl = { .invoke = HTMLDocumentNode_invoke, .disp_invoke = HTMLDocumentNode_disp_invoke, .next_dispid = HTMLDocumentNode_next_dispid, + .fill_props = HTMLDocumentNode_fill_props, .get_script_global = HTMLDocumentNode_get_script_global, }, .get_gecko_target = HTMLDocumentNode_get_gecko_target, diff --git a/dlls/mshtml/htmlstorage.c b/dlls/mshtml/htmlstorage.c index 263e2479a820..740fc91ce8e0 100644 --- a/dlls/mshtml/htmlstorage.c +++ b/dlls/mshtml/htmlstorage.c @@ -1277,6 +1277,11 @@ static HRESULT HTMLStorage_get_prop_desc(DispatchEx *dispex, DISPID id, struct p return S_OK; } +static HRESULT HTMLStorage_fill_props(DispatchEx *dispex) +{ + return S_FALSE; +} + static const dispex_static_data_vtbl_t Storage_dispex_vtbl = { .query_interface = HTMLStorage_query_interface, .destructor = HTMLStorage_destructor, @@ -1287,6 +1292,7 @@ static const dispex_static_data_vtbl_t Storage_dispex_vtbl = { .delete = HTMLStorage_delete, .next_dispid = HTMLStorage_next_dispid, .get_prop_desc = HTMLStorage_get_prop_desc, + .fill_props = HTMLStorage_fill_props, }; static const tid_t HTMLStorage_iface_tids[] = { diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 41e4792fae62..5e58725fc54f 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -4062,6 +4062,11 @@ HRESULT HTMLWindow_get_prop_desc(DispatchEx *dispex, DISPID id, struct property_ return hres; } +static HRESULT HTMLWindow_fill_props(DispatchEx *dispex) +{ + return S_FALSE; +} + static HTMLInnerWindow *HTMLWindow_get_script_global(DispatchEx *dispex, dispex_static_data_t **dispex_data) { HTMLInnerWindow *This = impl_from_DispatchEx(dispex); @@ -4258,6 +4263,7 @@ static const event_target_vtbl_t HTMLWindow_event_target_vtbl = { .delete = HTMLWindow_delete, .next_dispid = HTMLWindow_next_dispid, .get_prop_desc = HTMLWindow_get_prop_desc, + .fill_props = HTMLWindow_fill_props, .get_script_global = HTMLWindow_get_script_global, .get_outer_iface = HTMLWindow_get_outer_iface, }, diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index be9e91aa462f..875cf25957cf 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -400,6 +400,9 @@ typedef struct { HRESULT (*next_dispid)(DispatchEx*,DISPID,DISPID*); HRESULT (*get_prop_desc)(DispatchEx*,DISPID,struct property_info*); + /* Used when the object has props it has to fill prior to enumeration, or if it's volatile to not cache it (return S_FALSE then) */ + HRESULT (*fill_props)(DispatchEx*); + /* Similar to invoke, but allows overriding all dispids */ HRESULT (*disp_invoke)(DispatchEx*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*); From 89a831da8ef15517629d0d9f7e1ccd1b11090f63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:05 +0200 Subject: [PATCH 1312/2542] mshtml: Properly fill the prototype's "constructor" prop. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prevent its existence from being flaky during getOwnPropertyNames. Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/dispex.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 4fbac7e05274..cc1c7a47efcf 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -3046,9 +3046,16 @@ static HRESULT prototype_find_dispid(DispatchEx *dispex, const WCHAR *name, DWOR return hres; } +static HRESULT prototype_fill_props(DispatchEx *dispex) +{ + DISPID dispid; + return dispex_get_id(dispex, L"constructor", 0, &dispid); +} + static const dispex_static_data_vtbl_t prototype_dispex_vtbl = { .destructor = prototype_destructor, .find_dispid = prototype_find_dispid, + .fill_props = prototype_fill_props, }; HRESULT get_prototype(HTMLInnerWindow *script_global, prototype_id_t id, DispatchEx **ret) From 850c833f3efa215dea457b7197170c8166da8925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:05 +0200 Subject: [PATCH 1313/2542] mshtml: Properly fill the constructor's "prototype" prop. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prevent its existence from being flaky during getOwnPropertyNames. Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/dispex.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index cc1c7a47efcf..b6cd8be28eba 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -3145,6 +3145,12 @@ static HRESULT constructor_find_dispid(DispatchEx *dispex, const WCHAR *name, DW return hres; } +static HRESULT constructor_fill_props(DispatchEx *dispex) +{ + DISPID dispid; + return dispex_get_id(dispex, L"prototype", 0, &dispid); +} + static const char *constructor_get_name(DispatchEx *dispex) { struct constructor *constr = constr_from_DispatchEx(dispex); @@ -3154,6 +3160,7 @@ static const char *constructor_get_name(DispatchEx *dispex) static const dispex_static_data_vtbl_t constructor_dispex_vtbl = { .destructor = constructor_destructor, .find_dispid = constructor_find_dispid, + .fill_props = constructor_fill_props, .get_name = constructor_get_name, }; From c8487a1be7cc71d7fcdf299221d6ac31a242baec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:05 +0200 Subject: [PATCH 1314/2542] mshtml: Properly fill the window's constructors. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/htmlwindow.c | 21 ++++++ dlls/mshtml/mshtml_private.h | 3 +- dlls/mshtml/tests/documentmode.js | 117 ++++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+), 1 deletion(-) diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 5e58725fc54f..ae2ca605fad6 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -4064,6 +4064,27 @@ HRESULT HTMLWindow_get_prop_desc(DispatchEx *dispex, DISPID id, struct property_ static HRESULT HTMLWindow_fill_props(DispatchEx *dispex) { + HTMLInnerWindow *This = impl_from_DispatchEx(dispex); + DISPID dispid; + HRESULT hres; + unsigned i; + + if(!This->static_props_filled) { + hres = dispex_get_id(&This->event_target.dispex, L"Image", 0, &dispid); + if(SUCCEEDED(hres)) + hres = dispex_get_id(&This->event_target.dispex, L"Option", 0, &dispid); + if(FAILED(hres)) + return hres; + + for(i = 0; i < ARRAYSIZE(constructor_names); i++) { + hres = dispex_get_id(&This->event_target.dispex, constructor_names[i], 0, &dispid); + if(FAILED(hres) && hres != DISP_E_UNKNOWNNAME) + return hres; + } + + This->static_props_filled = TRUE; + } + return S_FALSE; } diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 875cf25957cf..692e884da3c8 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -786,7 +786,8 @@ struct HTMLInnerWindow { IHTMLStorage *local_storage; IWineMSHTMLConsole *console; - BOOL performance_initialized; + BOOLEAN static_props_filled; + BOOLEAN performance_initialized; VARIANT performance; unsigned blocking_depth; diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index a543ca6ce6f3..f61a9aef9254 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -83,6 +83,123 @@ if(window.addEventListener) { document.attachEvent("onunload", function() { ok(false, "unload fired on document"); }); } +sync_test("window own props", function() { + if(!Object.getOwnPropertyNames) + return; + + test_own_props(window, "window", [ + ["ANGLE_instanced_arrays",11], "ActiveXObject", ["AesGcmEncryptResult",11], ["AnimationEvent",10], ["ApplicationCache",10], "Array", ["ArrayBuffer",10], "Attr", + "Audio", ["AudioTrack",10], ["AudioTrackList",10], "BeforeUnloadEvent", ["Blob",10], "BookmarkCollection", "Boolean", "CDATASection", "CSSFontFaceRule", "CSSImportRule", + ["CSSKeyframeRule",10], ["CSSKeyframesRule",10], "CSSMediaRule", "CSSNamespaceRule", "CSSPageRule", "CSSRule", "CSSRuleList", "CSSStyleDeclaration", "CSSStyleRule", + "CSSStyleSheet", "CanvasGradient", "CanvasPattern", "CanvasPixelArray", "CanvasRenderingContext2D", "CharacterData", "ClientRect", "ClientRectList", ["CloseEvent",10], + "CollectGarbage", "Comment", "CompositionEvent", ["Console",10], "ControlRangeCollection", "Coordinates", ["Crypto",11], ["CryptoOperation",11], "CustomEvent", + ["DOMError",10], "DOMException", "DOMImplementation", "DOMParser", ["DOMSettableTokenList",10], ["DOMStringList",10], ["DOMStringMap",11], ["DOMTokenList",10], + "DataTransfer", ["DataView",10], "Date", "Debug", ["DeviceAcceleration",11], ["DeviceMotionEvent",11], ["DeviceOrientationEvent",11], ["DeviceRotationRate",11], + "Document", "DocumentFragment", "DocumentType", "DragEvent", ["EXT_texture_filter_anisotropic",11], "Element", "Enumerator", "Error", ["ErrorEvent",10], "EvalError", + "Event", "EventException", ["File",10], ["FileList",10], ["FileReader",10], ["Float32Array",10], ["Float64Array",10], "FocusEvent", ["FormData",10], "Function", + "Geolocation", ["HTMLAllCollection",11], "HTMLAnchorElement", "HTMLAppletElement", "HTMLAreaElement", "HTMLAreasCollection", "HTMLAudioElement", "HTMLBGSoundElement", + "HTMLBRElement", "HTMLBaseElement", "HTMLBaseFontElement", "HTMLBlockElement", "HTMLBodyElement", "HTMLButtonElement", "HTMLCanvasElement", "HTMLCollection", + "HTMLDDElement", "HTMLDListElement", "HTMLDTElement", ["HTMLDataListElement",10], "HTMLDirectoryElement", "HTMLDivElement", ["HTMLDocument",11], "HTMLElement", + "HTMLEmbedElement", "HTMLFieldSetElement", "HTMLFontElement", "HTMLFormElement", "HTMLFrameElement", "HTMLFrameSetElement", "HTMLHRElement", "HTMLHeadElement", + "HTMLHeadingElement", "HTMLHtmlElement", "HTMLIFrameElement", "HTMLImageElement", "HTMLInputElement", "HTMLIsIndexElement", "HTMLLIElement", "HTMLLabelElement", + "HTMLLegendElement", "HTMLLinkElement", "HTMLMapElement", "HTMLMarqueeElement", "HTMLMediaElement", "HTMLMenuElement", "HTMLMetaElement", "HTMLModElement", + "HTMLNextIdElement", "HTMLOListElement", "HTMLObjectElement", "HTMLOptGroupElement", "HTMLOptionElement", "HTMLParagraphElement", "HTMLParamElement", "HTMLPhraseElement", + "HTMLPreElement", ["HTMLProgressElement",10], "HTMLQuoteElement", "HTMLScriptElement", "HTMLSelectElement", "HTMLSourceElement", "HTMLSpanElement", "HTMLStyleElement", + "HTMLTableCaptionElement", "HTMLTableCellElement", "HTMLTableColElement", "HTMLTableDataCellElement", "HTMLTableElement", "HTMLTableHeaderCellElement", + "HTMLTableRowElement", "HTMLTableSectionElement", "HTMLTextAreaElement", "HTMLTitleElement", ["HTMLTrackElement",10], "HTMLUListElement", "HTMLUnknownElement", + "HTMLVideoElement", "History", ["IDBCursor",10], ["IDBCursorWithValue",10], ["IDBDatabase",10], ["IDBFactory",10], ["IDBIndex",10], ["IDBKeyRange",10], + ["IDBObjectStore",10], ["IDBOpenDBRequest",10], ["IDBRequest",10], ["IDBTransaction",10], ["IDBVersionChangeEvent",10], "Image", "ImageData", "Infinity", + ["Int16Array",10], ["Int32Array",10], ["Int8Array",10], ["Intl",11], "JSON", ["Key",11], ["KeyOperation",11], ["KeyPair",11], "KeyboardEvent", "Location", + "MSBehaviorUrnsCollection", ["MSBlobBuilder",10], ["MSCSSMatrix",10], "MSCSSProperties", "MSCSSRuleList", "MSCompatibleInfo", "MSCompatibleInfoCollection", + "MSCurrentStyleCSSProperties", "MSEventObj", ["MSGesture",10], ["MSGestureEvent",10], ["MSGraphicsTrust",11], ["MSInputMethodContext",11], ["MSManipulationEvent",10], + ["MSMediaKeyError",11], ["MSMediaKeyMessageEvent",11], ["MSMediaKeyNeededEvent",11], ["MSMediaKeySession",11], ["MSMediaKeys",11], "MSMimeTypesCollection", + ["MSNamespaceInfo",0,9], ["MSNamespaceInfoCollection",0,9], "MSPluginsCollection", ["MSPointerEvent",10], ["MSPopupWindow",0,10], ["MSRangeCollection",10], + ["MSSelection",0,10], "MSSiteModeEvent", ["MSStream",10], ["MSStreamReader",10], "MSStyleCSSProperties", ["Map",11], "Math", "MediaError", "MediaList", + ["MediaQueryList",10], ["MediaSource",11], ["MessageChannel",10], "MessageEvent", ["MessagePort",10], ["MimeType",11], ["MimeTypeArray",11], "MouseEvent", + "MouseWheelEvent", "MutationEvent", ["MutationObserver",11], ["MutationRecord",11], "NaN", "NamedNodeMap", "Navigator", "Node", "NodeFilter", "NodeIterator", "NodeList", + "Number", ["OES_element_index_uint",11], ["OES_standard_derivatives",11], ["OES_texture_float",11], ["OES_texture_float_linear",11], "Object", "Option", + ["PageTransitionEvent",11], "Performance", "PerformanceEntry", "PerformanceMark", "PerformanceMeasure", "PerformanceNavigation", ["PerformanceNavigationTiming",11], + "PerformanceResourceTiming", "PerformanceTiming", ["Plugin",11], ["PluginArray",11], ["PointerEvent",11], ["PopStateEvent",10], "Position", "PositionError", + "ProcessingInstruction", ["ProgressEvent",10], "Range", "RangeError", "RangeException", "ReferenceError", "RegExp", "SVGAElement", "SVGAngle", "SVGAnimatedAngle", + "SVGAnimatedBoolean", "SVGAnimatedEnumeration", "SVGAnimatedInteger", "SVGAnimatedLength", "SVGAnimatedLengthList", "SVGAnimatedNumber", "SVGAnimatedNumberList", + "SVGAnimatedPreserveAspectRatio", "SVGAnimatedRect", "SVGAnimatedString", "SVGAnimatedTransformList", "SVGCircleElement", "SVGClipPathElement", + ["SVGComponentTransferFunctionElement",10], "SVGDefsElement", "SVGDescElement", "SVGElement", "SVGElementInstance", "SVGElementInstanceList", "SVGEllipseElement", + "SVGException", ["SVGFEBlendElement",10], ["SVGFEColorMatrixElement",10], ["SVGFEComponentTransferElement",10], ["SVGFECompositeElement",10], + ["SVGFEConvolveMatrixElement",10], ["SVGFEDiffuseLightingElement",10], ["SVGFEDisplacementMapElement",10], ["SVGFEDistantLightElement",10], ["SVGFEFloodElement",10], + ["SVGFEFuncAElement",10], ["SVGFEFuncBElement",10], ["SVGFEFuncGElement",10], ["SVGFEFuncRElement",10], ["SVGFEGaussianBlurElement",10], ["SVGFEImageElement",10], + ["SVGFEMergeElement",10], ["SVGFEMergeNodeElement",10], ["SVGFEMorphologyElement",10], ["SVGFEOffsetElement",10], ["SVGFEPointLightElement",10], + ["SVGFESpecularLightingElement",10], ["SVGFESpotLightElement",10], ["SVGFETileElement",10], ["SVGFETurbulenceElement",10], ["SVGFilterElement",10], "SVGGElement", + "SVGGradientElement", "SVGImageElement", "SVGLength", "SVGLengthList", "SVGLineElement", "SVGLinearGradientElement", "SVGMarkerElement", "SVGMaskElement", "SVGMatrix", + "SVGMetadataElement", "SVGNumber", "SVGNumberList", "SVGPathElement", "SVGPathSeg", "SVGPathSegArcAbs", "SVGPathSegArcRel", "SVGPathSegClosePath", "SVGPathSegCurvetoCubicAbs", + "SVGPathSegCurvetoCubicRel", "SVGPathSegCurvetoCubicSmoothAbs", "SVGPathSegCurvetoCubicSmoothRel", "SVGPathSegCurvetoQuadraticAbs", "SVGPathSegCurvetoQuadraticRel", + "SVGPathSegCurvetoQuadraticSmoothAbs", "SVGPathSegCurvetoQuadraticSmoothRel", "SVGPathSegLinetoAbs", "SVGPathSegLinetoHorizontalAbs", "SVGPathSegLinetoHorizontalRel", + "SVGPathSegLinetoRel", "SVGPathSegLinetoVerticalAbs", "SVGPathSegLinetoVerticalRel", "SVGPathSegList", "SVGPathSegMovetoAbs", "SVGPathSegMovetoRel", "SVGPatternElement", + "SVGPoint", "SVGPointList", "SVGPolygonElement", "SVGPolylineElement", "SVGPreserveAspectRatio", "SVGRadialGradientElement", "SVGRect", "SVGRectElement", "SVGSVGElement", + "SVGScriptElement", "SVGStopElement", "SVGStringList", "SVGStyleElement", "SVGSwitchElement", "SVGSymbolElement", "SVGTSpanElement", "SVGTextContentElement", "SVGTextElement", + "SVGTextPathElement", "SVGTextPositioningElement", "SVGTitleElement", "SVGTransform", "SVGTransformList", "SVGUnitTypes", "SVGUseElement", "SVGViewElement", "SVGZoomAndPan", + "SVGZoomEvent", "Screen", "ScriptEngine", "ScriptEngineBuildVersion", "ScriptEngineMajorVersion", "ScriptEngineMinorVersion", "Selection", ["Set",11], ["SourceBuffer",11], + ["SourceBufferList",11], "Storage", "StorageEvent", "String", "StyleMedia", "StyleSheet", "StyleSheetList", "StyleSheetPageList", ["SubtleCrypto",11], "SyntaxError", "Text", + "TextEvent", "TextMetrics", "TextRange", "TextRangeCollection", ["TextTrack",10], ["TextTrackCue",10], ["TextTrackCueList",10], ["TextTrackList",10], "TimeRanges", + ["TrackEvent",10], ["TransitionEvent",10], "TreeWalker", "TypeError", "UIEvent", "URIError", ["URL",10], ["Uint16Array",10], ["Uint32Array",10], ["Uint8Array",10], + ["Uint8ClampedArray",11], "VBArray", ["ValidityState",10], ["VideoPlaybackQuality",11], ["WEBGL_compressed_texture_s3tc",11], ["WEBGL_debug_renderer_info",11], ["WeakMap",11], + ["WebGLActiveInfo",11], ["WebGLBuffer",11], ["WebGLContextEvent",11], ["WebGLFramebuffer",11], ["WebGLObject",11], ["WebGLProgram",11], ["WebGLRenderbuffer",11], + ["WebGLRenderingContext",11], ["WebGLShader",11], ["WebGLShaderPrecisionFormat",11], ["WebGLTexture",11], ["WebGLUniformLocation",11], ["WebSocket",10], "WheelEvent", "Window", + ["Worker",10], ["XDomainRequest",0,10], ["XMLDocument",11], "XMLHttpRequest", ["XMLHttpRequestEventTarget",10], "XMLSerializer", "async_test", "broken", + "compat_version", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "escape", "eval", "file_prefix", "format_message", "func_scope_val", "func_scope_val2", + "guard", "isFinite", "isNaN", "next_test", "ok", "pagehide_fired", "pageshow_fired", "parseFloat", "parseInt", "ready_states", "reportSuccess", "run_tests", "svg_ns", + "sync_test", "test_name", "test_own_props", "tests", "todo_wine", "todo_wine_if", "trace", "undefined", "unescape", "win_skip" + ], [ + "ActiveXObject", ["AesGcmEncryptResult",11], ["ANGLE_instanced_arrays",11], ["AnimationEvent",10], ["ApplicationCache",10], "Array", ["ArrayBuffer",10], "Audio", ["AudioTrack",10], + ["AudioTrackList",10], "BeforeUnloadEvent", ["Blob",10], "BookmarkCollection", "Boolean", "CanvasGradient", "CanvasPattern", "CanvasPixelArray", "CanvasRenderingContext2D", + "CDATASection", ["CloseEvent",10], "CollectGarbage", "CompositionEvent", "ControlRangeCollection", "Coordinates", ["Crypto",11], ["CryptoOperation",11], "CSSFontFaceRule", + "CSSImportRule", ["CSSKeyframeRule",10], ["CSSKeyframesRule",10], "CSSMediaRule", "CSSNamespaceRule", "CSSPageRule", "CSSRuleList", "DataTransfer", ["DataView",10], "Date", "Debug", + ["DeviceAcceleration",11], ["DeviceMotionEvent",11], ["DeviceOrientationEvent",11], ["DeviceRotationRate",11], ["DOMError",10], "DOMException", "DOMParser", + ["DOMSettableTokenList",10], ["DOMStringList",10], ["DOMStringMap",11], "DragEvent", "Enumerator", "Error", ["ErrorEvent",10], "EvalError", "EventException", + ["EXT_texture_filter_anisotropic",11], ["File",10], ["FileList",10], ["FileReader",10], ["Float32Array",10], ["Float64Array",10], "FocusEvent", ["FormData",10], "Function", + "Geolocation", ["HTMLAllCollection",11], "HTMLAppletElement", "HTMLAreasCollection", "HTMLAudioElement", "HTMLBaseElement", "HTMLBaseFontElement", "HTMLBGSoundElement", + "HTMLBlockElement", "HTMLBRElement", "HTMLCanvasElement", ["HTMLDataListElement",10], "HTMLDDElement", "HTMLDirectoryElement", "HTMLDivElement", "HTMLDListElement", "HTMLDTElement", + "HTMLFieldSetElement", "HTMLFontElement", "HTMLFrameSetElement", "HTMLHeadingElement", "HTMLHRElement", "HTMLIsIndexElement", "HTMLLegendElement", "HTMLLIElement", "HTMLMapElement", + "HTMLMarqueeElement", "HTMLMediaElement", "HTMLMenuElement", "HTMLModElement", "HTMLNextIdElement", "HTMLOListElement", "HTMLOptGroupElement", "HTMLParagraphElement", + "HTMLParamElement", "HTMLPhraseElement", "HTMLPreElement", ["HTMLProgressElement",10], "HTMLQuoteElement", "HTMLSourceElement", "HTMLSpanElement", "HTMLTableCaptionElement", + "HTMLTableColElement", "HTMLTableHeaderCellElement", "HTMLTableSectionElement", ["HTMLTrackElement",10], "HTMLUListElement", "HTMLVideoElement", ["IDBCursor",10], + ["IDBCursorWithValue",10], ["IDBDatabase",10], ["IDBFactory",10], ["IDBIndex",10], ["IDBKeyRange",10], ["IDBObjectStore",10], ["IDBOpenDBRequest",10], ["IDBRequest",10], + ["IDBTransaction",10], ["IDBVersionChangeEvent",10], "ImageData", "Infinity", ["Int16Array",10], ["Int32Array",10], ["Int8Array",10], ["Intl",11], "JSON", ["Key",11], + ["KeyOperation",11], ["KeyPair",11], "Location", ["Map",11], "Math", "MediaError", "MediaList", ["MediaSource",11], ["MessageChannel",10], ["MessagePort",10], ["MimeType",11], + ["MimeTypeArray",9,10], "MouseWheelEvent", "MSBehaviorUrnsCollection", ["MSBlobBuilder",10], "MSCompatibleInfo", "MSCompatibleInfoCollection", ["MSCSSMatrix",10], ["MSGesture",10], + ["MSGestureEvent",10], ["MSGraphicsTrust",11], ["MSInputMethodContext",11], ["MSManipulationEvent",10], ["MSMediaKeyError",11], ["MSMediaKeyMessageEvent",11], + ["MSMediaKeyNeededEvent",11], ["MSMediaKeys",11], ["MSMediaKeySession",11], "MSMimeTypesCollection", ["MSNamespaceInfo",0,9], "MSPluginsCollection", ["MSPointerEvent",10], + ["MSPopupWindow",0,10], ["MSRangeCollection",10], "MSSiteModeEvent", ["MSStream",10], ["MSStreamReader",10], "MutationEvent", ["MutationRecord",11], "NaN", "NodeFilter", + "NodeIterator", "Number", "Object", ["OES_element_index_uint",11], ["OES_standard_derivatives",11], ["OES_texture_float",11], ["OES_texture_float_linear",11], "PerformanceEntry", + "PerformanceMark", "PerformanceMeasure", ["PerformanceNavigationTiming",11], "PerformanceResourceTiming", ["Plugin",11], ["PluginArray",9,10], ["PointerEvent",11], + ["PopStateEvent",10], "Position", "PositionError", "ProcessingInstruction", "RangeError", "RangeException", "ReferenceError", "RegExp", "ScriptEngine", "ScriptEngineBuildVersion", + "ScriptEngineMajorVersion", "ScriptEngineMinorVersion", "Selection", ["Set",11], ["SourceBuffer",11], ["SourceBufferList",11], "String", "StyleMedia", "StyleSheetPageList", + ["SubtleCrypto",11], "SVGAElement", "SVGAngle", "SVGAnimatedAngle", "SVGAnimatedBoolean", "SVGAnimatedEnumeration", "SVGAnimatedInteger", "SVGAnimatedLength", "SVGAnimatedLengthList", + "SVGAnimatedNumber", "SVGAnimatedNumberList", "SVGAnimatedPreserveAspectRatio", "SVGAnimatedRect", "SVGAnimatedString", "SVGAnimatedTransformList", "SVGClipPathElement", + ["SVGComponentTransferFunctionElement",10], "SVGDefsElement", "SVGDescElement", "SVGElementInstance", "SVGElementInstanceList", "SVGEllipseElement", "SVGException", + ["SVGFEBlendElement",10], ["SVGFEColorMatrixElement",10], ["SVGFEComponentTransferElement",10], ["SVGFECompositeElement",10], ["SVGFEConvolveMatrixElement",10], + ["SVGFEDiffuseLightingElement",10], ["SVGFEDisplacementMapElement",10], ["SVGFEDistantLightElement",10], ["SVGFEFloodElement",10], ["SVGFEFuncAElement",10], ["SVGFEFuncBElement",10], + ["SVGFEFuncGElement",10], ["SVGFEFuncRElement",10], ["SVGFEGaussianBlurElement",10], ["SVGFEImageElement",10], ["SVGFEMergeElement",10], ["SVGFEMergeNodeElement",10], + ["SVGFEMorphologyElement",10], ["SVGFEOffsetElement",10], ["SVGFEPointLightElement",10], ["SVGFESpecularLightingElement",10], ["SVGFESpotLightElement",10], ["SVGFETileElement",10], + ["SVGFETurbulenceElement",10], ["SVGFilterElement",10], "SVGGElement", "SVGGradientElement", "SVGImageElement", "SVGLength", "SVGLengthList", "SVGLinearGradientElement", + "SVGLineElement", "SVGMarkerElement", "SVGMaskElement", "SVGMatrix", "SVGMetadataElement", "SVGNumber", "SVGNumberList", "SVGPathElement", "SVGPathSeg", "SVGPathSegArcAbs", + "SVGPathSegArcRel", "SVGPathSegClosePath", "SVGPathSegCurvetoCubicAbs", "SVGPathSegCurvetoCubicRel", "SVGPathSegCurvetoCubicSmoothAbs", "SVGPathSegCurvetoCubicSmoothRel", + "SVGPathSegCurvetoQuadraticAbs", "SVGPathSegCurvetoQuadraticRel", "SVGPathSegCurvetoQuadraticSmoothAbs", "SVGPathSegCurvetoQuadraticSmoothRel", "SVGPathSegLinetoAbs", + "SVGPathSegLinetoHorizontalAbs", "SVGPathSegLinetoHorizontalRel", "SVGPathSegLinetoRel", "SVGPathSegLinetoVerticalAbs", "SVGPathSegLinetoVerticalRel", "SVGPathSegList", + "SVGPathSegMovetoAbs", "SVGPathSegMovetoRel", "SVGPatternElement", "SVGPoint", "SVGPointList", "SVGPolygonElement", "SVGPolylineElement", "SVGPreserveAspectRatio", + "SVGRadialGradientElement", "SVGRect", "SVGRectElement", "SVGScriptElement", "SVGStopElement", "SVGStringList", "SVGStyleElement", "SVGSwitchElement", "SVGSymbolElement", + "SVGTextElement", "SVGTextPathElement", "SVGTitleElement", "SVGTransform", "SVGTransformList", "SVGUnitTypes", "SVGUseElement", "SVGViewElement", "SVGZoomAndPan", "SVGZoomEvent", + "SyntaxError", "TextEvent", "TextMetrics", "TextRangeCollection", ["TextTrack",10], ["TextTrackCue",10], ["TextTrackCueList",10], ["TextTrackList",10], "TimeRanges", + ["TrackEvent",10], ["TransitionEvent",10], "TreeWalker", "TypeError", ["Uint16Array",10], ["Uint32Array",10], ["Uint8Array",10], ["Uint8ClampedArray",11], "URIError", + ["URL",10], ["ValidityState",10], "VBArray", ["VideoPlaybackQuality",11], ["WeakMap",11], ["WebGLActiveInfo",11], ["WebGLBuffer",11], ["WebGLContextEvent",11], ["WebGLFramebuffer",11], + ["WebGLObject",11], ["WebGLProgram",11], ["WebGLRenderbuffer",11], ["WebGLRenderingContext",11], ["WebGLShader",11], ["WebGLShaderPrecisionFormat",11], ["WebGLTexture",11], + ["WebGLUniformLocation",11], ["WEBGL_compressed_texture_s3tc",11], ["WEBGL_debug_renderer_info",11], ["WebSocket",10], "WheelEvent", ["Worker",10], ["XDomainRequest",9,10], + ["XMLDocument",11], ["XMLHttpRequestEventTarget",10], "XMLSerializer", "async_test", "broken", "compat_version", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", + "escape", "eval", "file_prefix", "format_message", "func_scope_val", "func_scope_val2", "guard", "isFinite", "isNaN", "next_test", "ok", "pagehide_fired", "pageshow_fired", + "parseFloat", "parseInt", "ready_states", "reportSuccess", "run_tests", "svg_ns", "sync_test", "test_name", "test_own_props", "tests", "todo_wine", "todo_wine_if", "trace", + "undefined", "unescape", "win_skip" + ]); +}); + sync_test("performance timing", function() { ok(performance.timing.domInteractive >= performance.timing.domLoading, "domInteractive < domLoading"); ok(performance.timing.domContentLoadedEventStart >= performance.timing.domInteractive, "domContentLoadedEventStart < domInteractive"); From 03e480aed591d83085e83bc4b8e84c43301aa634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:05 +0200 Subject: [PATCH 1315/2542] mshtml: Properly fill the window's script vars. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fdexEnumAll is useless. Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/dispex.c | 22 +++++++++++++++++++ dlls/jscript/jscript.c | 7 ++++++ dlls/jscript/jscript.h | 1 + dlls/jscript/jsdisp.idl | 1 + dlls/jscript/tests/run.c | 44 ++++++++++++++++++++++++++++++++++++++ dlls/mshtml/htmlwindow.c | 4 ++++ dlls/mshtml/tests/script.c | 25 +++++++++++++++++++++- 7 files changed, 103 insertions(+), 1 deletion(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 9d75a9141eac..577fe9677150 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -3607,3 +3607,25 @@ IWineJSDispatchHost *get_host_dispatch(IDispatch *disp) IWineJSDispatchHost_GetOuterDispatch(host_obj->host_iface, &ret); return ret; } + +HRESULT fill_globals(script_ctx_t *ctx, IWineJSDispatchHost *script_global) +{ + jsdisp_t *global = ctx->global; + DISPID id = DISPID_STARTENUM; + struct property_info desc; + HRESULT hres; + + for(;;) { + hres = jsdisp_next_prop(global, id, JSDISP_ENUM_OWN, &id); + if(hres == S_FALSE) + break; + if(FAILED(hres)) + return hres; + + hres = IWineJSDispatchHost_LookupProperty(script_global, get_prop(global, id)->name, fdexNameCaseSensitive, &desc); + if(FAILED(hres)) + return hres; + } + + return S_OK; +} diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c index c42109b41434..5c14385adbb0 100644 --- a/dlls/jscript/jscript.c +++ b/dlls/jscript/jscript.c @@ -1465,12 +1465,19 @@ static HRESULT WINAPI WineJScript_InitHostConstructor(IWineJScript *iface, IWine return init_host_constructor(This->ctx, constr, prototype, ret); } +static HRESULT WINAPI WineJScript_FillGlobals(IWineJScript *iface, IWineJSDispatchHost *script_global) +{ + JScript *This = impl_from_IWineJScript(iface); + return fill_globals(This->ctx, script_global); +} + static const IWineJScriptVtbl WineJScriptVtbl = { WineJScript_QueryInterface, WineJScript_AddRef, WineJScript_Release, WineJScript_InitHostObject, WineJScript_InitHostConstructor, + WineJScript_FillGlobals, }; HRESULT create_jscript_object(BOOL is_encode, REFIID riid, void **ppv) diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 841d15f99bea..859727f7b383 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -243,6 +243,7 @@ HRESULT init_dispex(jsdisp_t*,script_ctx_t*,const builtin_info_t*,jsdisp_t*); HRESULT init_dispex_from_constr(jsdisp_t*,script_ctx_t*,const builtin_info_t*,jsdisp_t*); HRESULT init_host_object(script_ctx_t*,IWineJSDispatchHost*,IWineJSDispatch*,UINT32,IWineJSDispatch**); HRESULT init_host_constructor(script_ctx_t*,IWineJSDispatchHost*,IWineJSDispatch*,IWineJSDispatch**); +HRESULT fill_globals(script_ctx_t*,IWineJSDispatchHost*); HRESULT disp_call(script_ctx_t*,IDispatch*,DISPID,WORD,unsigned,jsval_t*,jsval_t*); HRESULT disp_call_name(script_ctx_t*,IDispatch*,const WCHAR*,WORD,unsigned,jsval_t*,jsval_t*); diff --git a/dlls/jscript/jsdisp.idl b/dlls/jscript/jsdisp.idl index 64c5eae7da96..b2c7ec679579 100644 --- a/dlls/jscript/jsdisp.idl +++ b/dlls/jscript/jsdisp.idl @@ -85,4 +85,5 @@ interface IWineJScript : IUnknown { HRESULT InitHostObject(IWineJSDispatchHost *host_obj, IWineJSDispatch *prototype, UINT32 flags, IWineJSDispatch **ret); HRESULT InitHostConstructor(IWineJSDispatchHost *constr, IWineJSDispatch *prototype, IWineJSDispatch **ret); + HRESULT FillGlobals(IWineJSDispatchHost *script_global); } diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c index 106fd8c99d45..5d555b05eb0f 100644 --- a/dlls/jscript/tests/run.c +++ b/dlls/jscript/tests/run.c @@ -3720,6 +3720,49 @@ static void test_members(void) IActiveScript_Release(script); } +static void test_enum(void) +{ + DISPID id = DISPID_STARTENUM; + IActiveScriptParse *parser; + IActiveScript *engine; + IDispatchEx *dispex; + IDispatch *disp; + HRESULT hres; + + engine = create_script(); + + hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres); + + hres = IActiveScriptParse_InitNew(parser); + ok(hres == S_OK, "InitNew failed: %08lx\n", hres); + IActiveScriptParse_Release(parser); + + hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite); + ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres); + + hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres); + + hres = IActiveScript_GetScriptDispatch(engine, NULL, &disp); + ok(hres == S_OK, "GetScriptDispatch failed: %08lx\n", hres); + ok(disp != NULL, "script disp == NULL\n"); + + hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres); + IDispatch_Release(disp); + + hres = IDispatchEx_GetNextDispID(dispex, 0, id, &id); + ok(hres == S_FALSE, "GetNextDispID returned: %08lx\n", hres); + + id = DISPID_STARTENUM; + hres = IDispatchEx_GetNextDispID(dispex, fdexEnumAll, id, &id); + ok(hres == S_FALSE, "GetNextDispID returned: %08lx\n", hres); + + IDispatchEx_Release(dispex); + close_script(engine); +} + static void test_destructors(void) { static const WCHAR cyclic_refs[] = L"(function() {\n" @@ -4379,6 +4422,7 @@ static BOOL run_tests(void) test_script_exprs(); test_invokeex(); test_members(); + test_enum(); test_destructors(); test_eval(); test_error_reports(); diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index ae2ca605fad6..cfd72461045a 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -4085,6 +4085,10 @@ static HRESULT HTMLWindow_fill_props(DispatchEx *dispex) This->static_props_filled = TRUE; } + hres = IWineJScript_FillGlobals(This->jscript, &This->event_target.dispex.IWineJSDispatchHost_iface); + if(FAILED(hres)) + return hres; + return S_FALSE; } diff --git a/dlls/mshtml/tests/script.c b/dlls/mshtml/tests/script.c index f454de86711a..2c0c907a9f4d 100644 --- a/dlls/mshtml/tests/script.c +++ b/dlls/mshtml/tests/script.c @@ -319,11 +319,15 @@ static BSTR get_mime_type_display_name(const WCHAR *content_type) static void test_sp_caller(IServiceProvider *sp) { + BOOL seen_doc, seen_undefined; IOleCommandTarget *cmdtarget; IServiceProvider *caller; IHTMLWindow2 *window; + IDispatchEx *dispex; HRESULT hres; VARIANT var; + DISPID id; + BSTR str; hres = IServiceProvider_QueryService(sp, &SID_GetCaller, &IID_IServiceProvider, (void**)&caller); ok(hres == S_OK, "QueryService(SID_GetCaller) returned: %08lx\n", hres); @@ -343,8 +347,27 @@ static void test_sp_caller(IServiceProvider *sp) hres = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IHTMLWindow2, (void**)&window); ok(hres == S_OK, "QueryInterface(IHTMLWindow2) failed: %08lx\n", hres); ok(window != NULL, "window is NULL\n"); - IHTMLWindow2_Release(window); VariantClear(&var); + + hres = IHTMLWindow2_QueryInterface(window, &IID_IDispatchEx, (void**)&dispex); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres); + IHTMLWindow2_Release(window); + + for(id = DISPID_STARTENUM, seen_doc = FALSE, seen_undefined = FALSE;;) { + hres = IDispatchEx_GetNextDispID(dispex, fdexEnumAll, id, &id); + if(hres == S_FALSE) break; + ok(hres == S_OK, "GetNextDispID failed: %08lx\n", hres); + + hres = IDispatchEx_GetMemberName(dispex, id, &str); + ok(hres == S_OK, "GetMemberName failed: %08lx\n", hres); + if(!wcscmp(str, L"document")) seen_doc = TRUE; + if(!wcscmp(str, L"undefined")) seen_undefined = TRUE; + SysFreeString(str); + } + ok(seen_doc, "document was not enumerated from window\n"); + ok(!seen_undefined, "undefined was enumerated from window\n"); + + IDispatchEx_Release(dispex); } static void test_script_vars(unsigned argc, VARIANTARG *argv) From febb08a38e1830bf74a3603ef387fb8f690b8a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:06 +0200 Subject: [PATCH 1316/2542] mshtml: Enumerate all own custom props if requested. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Even if the props are not enumerable. Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/dispex.c | 2 +- dlls/mshtml/htmldoc.c | 2 +- dlls/mshtml/htmlstorage.c | 2 +- dlls/mshtml/htmlwindow.c | 5 +- dlls/mshtml/mshtml_private.h | 2 +- dlls/mshtml/tests/documentmode.js | 87 +++++++++++++++---------------- 6 files changed, 48 insertions(+), 52 deletions(-) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index b6cd8be28eba..3f6c29c97bde 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -2535,7 +2535,7 @@ HRESULT dispex_next_id(DispatchEx *dispex, DISPID id, BOOL enum_all_own_props, D } if(dispex->info->vtbl->next_dispid) { - hres = dispex->info->vtbl->next_dispid(dispex, id, ret); + hres = dispex->info->vtbl->next_dispid(dispex, id, enum_all_own_props, ret); if(hres != S_FALSE) return hres; } diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 04a60577cd26..5476941176da 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5446,7 +5446,7 @@ static HRESULT HTMLDocumentNode_disp_invoke(DispatchEx *dispex, DISPID id, LCID return S_FALSE; } -static HRESULT HTMLDocumentNode_next_dispid(DispatchEx *dispex, DISPID id, DISPID *pid) +static HRESULT HTMLDocumentNode_next_dispid(DispatchEx *dispex, DISPID id, BOOL enum_all_own_props, DISPID *pid) { DWORD idx = (id == DISPID_STARTENUM) ? 0 : id - MSHTML_DISPID_CUSTOM_MIN + 1; HTMLDocumentNode *This = impl_from_DispatchEx(dispex); diff --git a/dlls/mshtml/htmlstorage.c b/dlls/mshtml/htmlstorage.c index 740fc91ce8e0..d4b68314d536 100644 --- a/dlls/mshtml/htmlstorage.c +++ b/dlls/mshtml/htmlstorage.c @@ -1179,7 +1179,7 @@ static HRESULT HTMLStorage_delete(DispatchEx *dispex, DISPID id) return HTMLStorage_removeItem(&This->IHTMLStorage_iface, This->props[idx]); } -static HRESULT HTMLStorage_next_dispid(DispatchEx *dispex, DISPID id, DISPID *pid) +static HRESULT HTMLStorage_next_dispid(DispatchEx *dispex, DISPID id, BOOL enum_all_own_props, DISPID *pid) { DWORD idx = (id == DISPID_STARTENUM) ? 0 : id - MSHTML_DISPID_CUSTOM_MIN + 1; HTMLStorage *This = impl_from_DispatchEx(dispex); diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index cfd72461045a..89852d7f246f 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -4016,12 +4016,13 @@ static HRESULT HTMLWindow_delete(DispatchEx *dispex, DISPID id) return hres; } -static HRESULT HTMLWindow_next_dispid(DispatchEx *dispex, DISPID id, DISPID *pid) +static HRESULT HTMLWindow_next_dispid(DispatchEx *dispex, DISPID id, BOOL enum_all_own_props, DISPID *pid) { DWORD idx = (id == DISPID_STARTENUM) ? 0 : id - MSHTML_DISPID_CUSTOM_MIN + 1; HTMLInnerWindow *This = impl_from_DispatchEx(dispex); - while(idx < This->global_prop_cnt && This->global_props[idx].type != GLOBAL_DISPEXVAR) + while(idx < This->global_prop_cnt && This->global_props[idx].type != GLOBAL_DISPEXVAR && + (!enum_all_own_props || This->global_props[idx].type != GLOBAL_SCRIPTVAR || global_prop_still_exists(This, &This->global_props[idx]) != S_OK)) idx++; if(idx >= This->global_prop_cnt) return S_FALSE; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 692e884da3c8..c412a732ecaa 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -397,7 +397,7 @@ typedef struct { /* These are called when the object implements GetMemberName, InvokeEx, DeleteMemberByDispID and GetNextDispID for custom props */ HRESULT (*invoke)(DispatchEx*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*); HRESULT (*delete)(DispatchEx*,DISPID); - HRESULT (*next_dispid)(DispatchEx*,DISPID,DISPID*); + HRESULT (*next_dispid)(DispatchEx*,DISPID,BOOL,DISPID*); HRESULT (*get_prop_desc)(DispatchEx*,DISPID,struct property_info*); /* Used when the object has props it has to fill prior to enumeration, or if it's volatile to not cache it (return S_FALSE then) */ diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index f61a9aef9254..123b04b1bb50 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -149,54 +149,49 @@ sync_test("window own props", function() { "guard", "isFinite", "isNaN", "next_test", "ok", "pagehide_fired", "pageshow_fired", "parseFloat", "parseInt", "ready_states", "reportSuccess", "run_tests", "svg_ns", "sync_test", "test_name", "test_own_props", "tests", "todo_wine", "todo_wine_if", "trace", "undefined", "unescape", "win_skip" ], [ - "ActiveXObject", ["AesGcmEncryptResult",11], ["ANGLE_instanced_arrays",11], ["AnimationEvent",10], ["ApplicationCache",10], "Array", ["ArrayBuffer",10], "Audio", ["AudioTrack",10], - ["AudioTrackList",10], "BeforeUnloadEvent", ["Blob",10], "BookmarkCollection", "Boolean", "CanvasGradient", "CanvasPattern", "CanvasPixelArray", "CanvasRenderingContext2D", - "CDATASection", ["CloseEvent",10], "CollectGarbage", "CompositionEvent", "ControlRangeCollection", "Coordinates", ["Crypto",11], ["CryptoOperation",11], "CSSFontFaceRule", - "CSSImportRule", ["CSSKeyframeRule",10], ["CSSKeyframesRule",10], "CSSMediaRule", "CSSNamespaceRule", "CSSPageRule", "CSSRuleList", "DataTransfer", ["DataView",10], "Date", "Debug", - ["DeviceAcceleration",11], ["DeviceMotionEvent",11], ["DeviceOrientationEvent",11], ["DeviceRotationRate",11], ["DOMError",10], "DOMException", "DOMParser", - ["DOMSettableTokenList",10], ["DOMStringList",10], ["DOMStringMap",11], "DragEvent", "Enumerator", "Error", ["ErrorEvent",10], "EvalError", "EventException", - ["EXT_texture_filter_anisotropic",11], ["File",10], ["FileList",10], ["FileReader",10], ["Float32Array",10], ["Float64Array",10], "FocusEvent", ["FormData",10], "Function", - "Geolocation", ["HTMLAllCollection",11], "HTMLAppletElement", "HTMLAreasCollection", "HTMLAudioElement", "HTMLBaseElement", "HTMLBaseFontElement", "HTMLBGSoundElement", + ["AesGcmEncryptResult",11], ["ANGLE_instanced_arrays",11], ["AnimationEvent",10], ["ApplicationCache",10], ["ArrayBuffer",9,9], "Audio", ["AudioTrack",10], ["AudioTrackList",10], + "BeforeUnloadEvent", ["Blob",10], "BookmarkCollection", "CanvasGradient", "CanvasPattern", "CanvasPixelArray", "CanvasRenderingContext2D", "CDATASection", ["CloseEvent",10], + "CollectGarbage", "CompositionEvent", "ControlRangeCollection", "Coordinates", ["Crypto",11], ["CryptoOperation",11], "CSSFontFaceRule", "CSSImportRule", ["CSSKeyframeRule",10], + ["CSSKeyframesRule",10], "CSSMediaRule", "CSSNamespaceRule", "CSSPageRule", "CSSRuleList", "DataTransfer", ["DataView",9,9], "Debug", ["DeviceAcceleration",11], ["DeviceMotionEvent",11], + ["DeviceOrientationEvent",11], ["DeviceRotationRate",11], ["DOMError",10], "DOMException", "DOMParser", ["DOMSettableTokenList",10], ["DOMStringList",10], ["DOMStringMap",11], "DragEvent", + ["ErrorEvent",10], "EventException", ["EXT_texture_filter_anisotropic",11], ["File",10], ["FileList",10], ["FileReader",10], ["Float32Array",10], ["Float64Array",10], "FocusEvent", + ["FormData",10], "Geolocation", ["HTMLAllCollection",11], "HTMLAppletElement", "HTMLAreasCollection", "HTMLAudioElement", "HTMLBaseElement", "HTMLBaseFontElement", "HTMLBGSoundElement", "HTMLBlockElement", "HTMLBRElement", "HTMLCanvasElement", ["HTMLDataListElement",10], "HTMLDDElement", "HTMLDirectoryElement", "HTMLDivElement", "HTMLDListElement", "HTMLDTElement", "HTMLFieldSetElement", "HTMLFontElement", "HTMLFrameSetElement", "HTMLHeadingElement", "HTMLHRElement", "HTMLIsIndexElement", "HTMLLegendElement", "HTMLLIElement", "HTMLMapElement", - "HTMLMarqueeElement", "HTMLMediaElement", "HTMLMenuElement", "HTMLModElement", "HTMLNextIdElement", "HTMLOListElement", "HTMLOptGroupElement", "HTMLParagraphElement", - "HTMLParamElement", "HTMLPhraseElement", "HTMLPreElement", ["HTMLProgressElement",10], "HTMLQuoteElement", "HTMLSourceElement", "HTMLSpanElement", "HTMLTableCaptionElement", - "HTMLTableColElement", "HTMLTableHeaderCellElement", "HTMLTableSectionElement", ["HTMLTrackElement",10], "HTMLUListElement", "HTMLVideoElement", ["IDBCursor",10], - ["IDBCursorWithValue",10], ["IDBDatabase",10], ["IDBFactory",10], ["IDBIndex",10], ["IDBKeyRange",10], ["IDBObjectStore",10], ["IDBOpenDBRequest",10], ["IDBRequest",10], - ["IDBTransaction",10], ["IDBVersionChangeEvent",10], "ImageData", "Infinity", ["Int16Array",10], ["Int32Array",10], ["Int8Array",10], ["Intl",11], "JSON", ["Key",11], - ["KeyOperation",11], ["KeyPair",11], "Location", ["Map",11], "Math", "MediaError", "MediaList", ["MediaSource",11], ["MessageChannel",10], ["MessagePort",10], ["MimeType",11], - ["MimeTypeArray",9,10], "MouseWheelEvent", "MSBehaviorUrnsCollection", ["MSBlobBuilder",10], "MSCompatibleInfo", "MSCompatibleInfoCollection", ["MSCSSMatrix",10], ["MSGesture",10], - ["MSGestureEvent",10], ["MSGraphicsTrust",11], ["MSInputMethodContext",11], ["MSManipulationEvent",10], ["MSMediaKeyError",11], ["MSMediaKeyMessageEvent",11], - ["MSMediaKeyNeededEvent",11], ["MSMediaKeys",11], ["MSMediaKeySession",11], "MSMimeTypesCollection", ["MSNamespaceInfo",0,9], "MSPluginsCollection", ["MSPointerEvent",10], - ["MSPopupWindow",0,10], ["MSRangeCollection",10], "MSSiteModeEvent", ["MSStream",10], ["MSStreamReader",10], "MutationEvent", ["MutationRecord",11], "NaN", "NodeFilter", - "NodeIterator", "Number", "Object", ["OES_element_index_uint",11], ["OES_standard_derivatives",11], ["OES_texture_float",11], ["OES_texture_float_linear",11], "PerformanceEntry", - "PerformanceMark", "PerformanceMeasure", ["PerformanceNavigationTiming",11], "PerformanceResourceTiming", ["Plugin",11], ["PluginArray",9,10], ["PointerEvent",11], - ["PopStateEvent",10], "Position", "PositionError", "ProcessingInstruction", "RangeError", "RangeException", "ReferenceError", "RegExp", "ScriptEngine", "ScriptEngineBuildVersion", - "ScriptEngineMajorVersion", "ScriptEngineMinorVersion", "Selection", ["Set",11], ["SourceBuffer",11], ["SourceBufferList",11], "String", "StyleMedia", "StyleSheetPageList", - ["SubtleCrypto",11], "SVGAElement", "SVGAngle", "SVGAnimatedAngle", "SVGAnimatedBoolean", "SVGAnimatedEnumeration", "SVGAnimatedInteger", "SVGAnimatedLength", "SVGAnimatedLengthList", - "SVGAnimatedNumber", "SVGAnimatedNumberList", "SVGAnimatedPreserveAspectRatio", "SVGAnimatedRect", "SVGAnimatedString", "SVGAnimatedTransformList", "SVGClipPathElement", - ["SVGComponentTransferFunctionElement",10], "SVGDefsElement", "SVGDescElement", "SVGElementInstance", "SVGElementInstanceList", "SVGEllipseElement", "SVGException", - ["SVGFEBlendElement",10], ["SVGFEColorMatrixElement",10], ["SVGFEComponentTransferElement",10], ["SVGFECompositeElement",10], ["SVGFEConvolveMatrixElement",10], - ["SVGFEDiffuseLightingElement",10], ["SVGFEDisplacementMapElement",10], ["SVGFEDistantLightElement",10], ["SVGFEFloodElement",10], ["SVGFEFuncAElement",10], ["SVGFEFuncBElement",10], - ["SVGFEFuncGElement",10], ["SVGFEFuncRElement",10], ["SVGFEGaussianBlurElement",10], ["SVGFEImageElement",10], ["SVGFEMergeElement",10], ["SVGFEMergeNodeElement",10], - ["SVGFEMorphologyElement",10], ["SVGFEOffsetElement",10], ["SVGFEPointLightElement",10], ["SVGFESpecularLightingElement",10], ["SVGFESpotLightElement",10], ["SVGFETileElement",10], - ["SVGFETurbulenceElement",10], ["SVGFilterElement",10], "SVGGElement", "SVGGradientElement", "SVGImageElement", "SVGLength", "SVGLengthList", "SVGLinearGradientElement", - "SVGLineElement", "SVGMarkerElement", "SVGMaskElement", "SVGMatrix", "SVGMetadataElement", "SVGNumber", "SVGNumberList", "SVGPathElement", "SVGPathSeg", "SVGPathSegArcAbs", - "SVGPathSegArcRel", "SVGPathSegClosePath", "SVGPathSegCurvetoCubicAbs", "SVGPathSegCurvetoCubicRel", "SVGPathSegCurvetoCubicSmoothAbs", "SVGPathSegCurvetoCubicSmoothRel", - "SVGPathSegCurvetoQuadraticAbs", "SVGPathSegCurvetoQuadraticRel", "SVGPathSegCurvetoQuadraticSmoothAbs", "SVGPathSegCurvetoQuadraticSmoothRel", "SVGPathSegLinetoAbs", - "SVGPathSegLinetoHorizontalAbs", "SVGPathSegLinetoHorizontalRel", "SVGPathSegLinetoRel", "SVGPathSegLinetoVerticalAbs", "SVGPathSegLinetoVerticalRel", "SVGPathSegList", - "SVGPathSegMovetoAbs", "SVGPathSegMovetoRel", "SVGPatternElement", "SVGPoint", "SVGPointList", "SVGPolygonElement", "SVGPolylineElement", "SVGPreserveAspectRatio", - "SVGRadialGradientElement", "SVGRect", "SVGRectElement", "SVGScriptElement", "SVGStopElement", "SVGStringList", "SVGStyleElement", "SVGSwitchElement", "SVGSymbolElement", - "SVGTextElement", "SVGTextPathElement", "SVGTitleElement", "SVGTransform", "SVGTransformList", "SVGUnitTypes", "SVGUseElement", "SVGViewElement", "SVGZoomAndPan", "SVGZoomEvent", - "SyntaxError", "TextEvent", "TextMetrics", "TextRangeCollection", ["TextTrack",10], ["TextTrackCue",10], ["TextTrackCueList",10], ["TextTrackList",10], "TimeRanges", - ["TrackEvent",10], ["TransitionEvent",10], "TreeWalker", "TypeError", ["Uint16Array",10], ["Uint32Array",10], ["Uint8Array",10], ["Uint8ClampedArray",11], "URIError", - ["URL",10], ["ValidityState",10], "VBArray", ["VideoPlaybackQuality",11], ["WeakMap",11], ["WebGLActiveInfo",11], ["WebGLBuffer",11], ["WebGLContextEvent",11], ["WebGLFramebuffer",11], - ["WebGLObject",11], ["WebGLProgram",11], ["WebGLRenderbuffer",11], ["WebGLRenderingContext",11], ["WebGLShader",11], ["WebGLShaderPrecisionFormat",11], ["WebGLTexture",11], - ["WebGLUniformLocation",11], ["WEBGL_compressed_texture_s3tc",11], ["WEBGL_debug_renderer_info",11], ["WebSocket",10], "WheelEvent", ["Worker",10], ["XDomainRequest",9,10], - ["XMLDocument",11], ["XMLHttpRequestEventTarget",10], "XMLSerializer", "async_test", "broken", "compat_version", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", - "escape", "eval", "file_prefix", "format_message", "func_scope_val", "func_scope_val2", "guard", "isFinite", "isNaN", "next_test", "ok", "pagehide_fired", "pageshow_fired", - "parseFloat", "parseInt", "ready_states", "reportSuccess", "run_tests", "svg_ns", "sync_test", "test_name", "test_own_props", "tests", "todo_wine", "todo_wine_if", "trace", - "undefined", "unescape", "win_skip" + "HTMLMarqueeElement", "HTMLMediaElement", "HTMLMenuElement", "HTMLModElement", "HTMLNextIdElement", "HTMLOListElement", "HTMLOptGroupElement", "HTMLParagraphElement", "HTMLParamElement", + "HTMLPhraseElement", "HTMLPreElement", ["HTMLProgressElement",10], "HTMLQuoteElement", "HTMLSourceElement", "HTMLSpanElement", "HTMLTableCaptionElement", "HTMLTableColElement", + "HTMLTableHeaderCellElement", "HTMLTableSectionElement", ["HTMLTrackElement",10], "HTMLUListElement", "HTMLVideoElement", ["IDBCursor",10], ["IDBCursorWithValue",10], ["IDBDatabase",10], + ["IDBFactory",10], ["IDBIndex",10], ["IDBKeyRange",10], ["IDBObjectStore",10], ["IDBOpenDBRequest",10], ["IDBRequest",10], ["IDBTransaction",10], ["IDBVersionChangeEvent",10], + "ImageData", ["Int16Array",10], ["Int32Array",10], ["Int8Array",10], ["Intl",11], ["Key",11], ["KeyOperation",11], ["KeyPair",11], "Location", "MediaError", "MediaList", ["MediaSource",11], + ["MessageChannel",10], ["MessagePort",10], ["MimeType",11], ["MimeTypeArray",9,10], "MouseWheelEvent", "MSBehaviorUrnsCollection", ["MSBlobBuilder",10], "MSCompatibleInfo", + "MSCompatibleInfoCollection", ["MSCSSMatrix",10], ["MSGesture",10], ["MSGestureEvent",10], ["MSGraphicsTrust",11], ["MSInputMethodContext",11], ["MSManipulationEvent",10], + ["MSMediaKeyError",11], ["MSMediaKeyMessageEvent",11], ["MSMediaKeyNeededEvent",11], ["MSMediaKeys",11], ["MSMediaKeySession",11], "MSMimeTypesCollection", ["MSNamespaceInfo",0,9], + "MSPluginsCollection", ["MSPointerEvent",10], ["MSPopupWindow",0,10], ["MSRangeCollection",10], "MSSiteModeEvent", ["MSStream",10], ["MSStreamReader",10], "MutationEvent", + ["MutationRecord",11], "NodeFilter", "NodeIterator", ["OES_element_index_uint",11], ["OES_standard_derivatives",11], ["OES_texture_float",11], ["OES_texture_float_linear",11], + "PerformanceEntry", "PerformanceMark", "PerformanceMeasure", ["PerformanceNavigationTiming",11], "PerformanceResourceTiming", ["Plugin",11], ["PluginArray",9,10], ["PointerEvent",11], + ["PopStateEvent",10], "Position", "PositionError", "ProcessingInstruction", "RangeException", "RegExpError", "ScriptEngine", "ScriptEngineBuildVersion", "ScriptEngineMajorVersion", + "ScriptEngineMinorVersion", "Selection", ["SourceBuffer",11], ["SourceBufferList",11], "StyleMedia", "StyleSheetPageList", ["SubtleCrypto",11], "SVGAElement", "SVGAngle", "SVGAnimatedAngle", + "SVGAnimatedBoolean", "SVGAnimatedEnumeration", "SVGAnimatedInteger", "SVGAnimatedLength", "SVGAnimatedLengthList", "SVGAnimatedNumber", "SVGAnimatedNumberList", + "SVGAnimatedPreserveAspectRatio", "SVGAnimatedRect", "SVGAnimatedString", "SVGAnimatedTransformList", "SVGClipPathElement", ["SVGComponentTransferFunctionElement",10], "SVGDefsElement", + "SVGDescElement", "SVGElementInstance", "SVGElementInstanceList", "SVGEllipseElement", "SVGException", ["SVGFEBlendElement",10], ["SVGFEColorMatrixElement",10], + ["SVGFEComponentTransferElement",10], ["SVGFECompositeElement",10], ["SVGFEConvolveMatrixElement",10], ["SVGFEDiffuseLightingElement",10], ["SVGFEDisplacementMapElement",10], + ["SVGFEDistantLightElement",10], ["SVGFEFloodElement",10], ["SVGFEFuncAElement",10], ["SVGFEFuncBElement",10], ["SVGFEFuncGElement",10], ["SVGFEFuncRElement",10], + ["SVGFEGaussianBlurElement",10], ["SVGFEImageElement",10], ["SVGFEMergeElement",10], ["SVGFEMergeNodeElement",10], ["SVGFEMorphologyElement",10], ["SVGFEOffsetElement",10], + ["SVGFEPointLightElement",10], ["SVGFESpecularLightingElement",10], ["SVGFESpotLightElement",10], ["SVGFETileElement",10], ["SVGFETurbulenceElement",10], ["SVGFilterElement",10], + "SVGGElement", "SVGGradientElement", "SVGImageElement", "SVGLength", "SVGLengthList", "SVGLinearGradientElement", "SVGLineElement", "SVGMarkerElement", "SVGMaskElement", "SVGMatrix", + "SVGMetadataElement", "SVGNumber", "SVGNumberList", "SVGPathElement", "SVGPathSeg", "SVGPathSegArcAbs", "SVGPathSegArcRel", "SVGPathSegClosePath", "SVGPathSegCurvetoCubicAbs", + "SVGPathSegCurvetoCubicRel", "SVGPathSegCurvetoCubicSmoothAbs", "SVGPathSegCurvetoCubicSmoothRel", "SVGPathSegCurvetoQuadraticAbs", "SVGPathSegCurvetoQuadraticRel", + "SVGPathSegCurvetoQuadraticSmoothAbs", "SVGPathSegCurvetoQuadraticSmoothRel", "SVGPathSegLinetoAbs", "SVGPathSegLinetoHorizontalAbs", "SVGPathSegLinetoHorizontalRel", + "SVGPathSegLinetoRel", "SVGPathSegLinetoVerticalAbs", "SVGPathSegLinetoVerticalRel", "SVGPathSegList", "SVGPathSegMovetoAbs", "SVGPathSegMovetoRel", "SVGPatternElement", "SVGPoint", + "SVGPointList", "SVGPolygonElement", "SVGPolylineElement", "SVGPreserveAspectRatio", "SVGRadialGradientElement", "SVGRect", "SVGRectElement", "SVGScriptElement", "SVGStopElement", + "SVGStringList", "SVGStyleElement", "SVGSwitchElement", "SVGSymbolElement", "SVGTextElement", "SVGTextPathElement", "SVGTitleElement", "SVGTransform", "SVGTransformList", "SVGUnitTypes", + "SVGUseElement", "SVGViewElement", "SVGZoomAndPan", "SVGZoomEvent", "TextEvent", "TextMetrics", "TextRangeCollection", ["TextTrack",10], ["TextTrackCue",10], ["TextTrackCueList",10], + ["TextTrackList",10], "TimeRanges", ["TrackEvent",10], ["TransitionEvent",10], "TreeWalker", ["Uint16Array",10], ["Uint32Array",10], ["Uint8Array",10], ["Uint8ClampedArray",11], ["URL",10], + ["ValidityState",10], ["VideoPlaybackQuality",11], ["WebGLActiveInfo",11], ["WebGLBuffer",11], ["WebGLContextEvent",11], ["WebGLFramebuffer",11], ["WebGLObject",11], ["WebGLProgram",11], + ["WebGLRenderbuffer",11], ["WebGLRenderingContext",11], ["WebGLShader",11], ["WebGLShaderPrecisionFormat",11], ["WebGLTexture",11], ["WebGLUniformLocation",11], + ["WEBGL_compressed_texture_s3tc",11], ["WEBGL_debug_renderer_info",11], ["WebSocket",10], "WheelEvent", ["Worker",10], ["XDomainRequest",9,10], ["XMLDocument",11], + ["XMLHttpRequestEventTarget",10], "XMLSerializer", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "escape", "eval", "isFinite", "isNaN", "parseFloat", "parseInt", + "unescape" ]); }); From d43f2ed0a08d58b4dcf8e3078630717b635b61b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:06 +0200 Subject: [PATCH 1317/2542] jscript: Properly fill the builtin props. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/dispex.c | 13 ++++- dlls/mshtml/tests/documentmode.js | 80 +++++++++++++++---------------- dlls/mshtml/tests/es5.js | 1 - 3 files changed, 50 insertions(+), 44 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 577fe9677150..68e44677a78d 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -733,19 +733,28 @@ HRESULT builtin_set_const(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) static HRESULT fill_props(jsdisp_t *obj) { + dispex_prop_t *prop; HRESULT hres; + DWORD i; if(obj->props_filled) return S_OK; + for(i = 0; i < obj->builtin_info->props_cnt; i++) { + hres = find_prop_name(obj, string_hash(obj->builtin_info->props[i].name), obj->builtin_info->props[i].name, FALSE, NULL, &prop); + if(FAILED(hres)) + return hres; + } + hres = S_OK; + if(obj->builtin_info->fill_props) { hres = obj->builtin_info->fill_props(obj); if(FAILED(hres)) return hres; - if(hres == S_OK) - obj->props_filled = TRUE; } + if(hres == S_OK) + obj->props_filled = TRUE; return S_OK; } diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 123b04b1bb50..9f77b07f4e23 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -151,47 +151,45 @@ sync_test("window own props", function() { ], [ ["AesGcmEncryptResult",11], ["ANGLE_instanced_arrays",11], ["AnimationEvent",10], ["ApplicationCache",10], ["ArrayBuffer",9,9], "Audio", ["AudioTrack",10], ["AudioTrackList",10], "BeforeUnloadEvent", ["Blob",10], "BookmarkCollection", "CanvasGradient", "CanvasPattern", "CanvasPixelArray", "CanvasRenderingContext2D", "CDATASection", ["CloseEvent",10], - "CollectGarbage", "CompositionEvent", "ControlRangeCollection", "Coordinates", ["Crypto",11], ["CryptoOperation",11], "CSSFontFaceRule", "CSSImportRule", ["CSSKeyframeRule",10], - ["CSSKeyframesRule",10], "CSSMediaRule", "CSSNamespaceRule", "CSSPageRule", "CSSRuleList", "DataTransfer", ["DataView",9,9], "Debug", ["DeviceAcceleration",11], ["DeviceMotionEvent",11], - ["DeviceOrientationEvent",11], ["DeviceRotationRate",11], ["DOMError",10], "DOMException", "DOMParser", ["DOMSettableTokenList",10], ["DOMStringList",10], ["DOMStringMap",11], "DragEvent", - ["ErrorEvent",10], "EventException", ["EXT_texture_filter_anisotropic",11], ["File",10], ["FileList",10], ["FileReader",10], ["Float32Array",10], ["Float64Array",10], "FocusEvent", - ["FormData",10], "Geolocation", ["HTMLAllCollection",11], "HTMLAppletElement", "HTMLAreasCollection", "HTMLAudioElement", "HTMLBaseElement", "HTMLBaseFontElement", "HTMLBGSoundElement", - "HTMLBlockElement", "HTMLBRElement", "HTMLCanvasElement", ["HTMLDataListElement",10], "HTMLDDElement", "HTMLDirectoryElement", "HTMLDivElement", "HTMLDListElement", "HTMLDTElement", - "HTMLFieldSetElement", "HTMLFontElement", "HTMLFrameSetElement", "HTMLHeadingElement", "HTMLHRElement", "HTMLIsIndexElement", "HTMLLegendElement", "HTMLLIElement", "HTMLMapElement", - "HTMLMarqueeElement", "HTMLMediaElement", "HTMLMenuElement", "HTMLModElement", "HTMLNextIdElement", "HTMLOListElement", "HTMLOptGroupElement", "HTMLParagraphElement", "HTMLParamElement", - "HTMLPhraseElement", "HTMLPreElement", ["HTMLProgressElement",10], "HTMLQuoteElement", "HTMLSourceElement", "HTMLSpanElement", "HTMLTableCaptionElement", "HTMLTableColElement", - "HTMLTableHeaderCellElement", "HTMLTableSectionElement", ["HTMLTrackElement",10], "HTMLUListElement", "HTMLVideoElement", ["IDBCursor",10], ["IDBCursorWithValue",10], ["IDBDatabase",10], - ["IDBFactory",10], ["IDBIndex",10], ["IDBKeyRange",10], ["IDBObjectStore",10], ["IDBOpenDBRequest",10], ["IDBRequest",10], ["IDBTransaction",10], ["IDBVersionChangeEvent",10], - "ImageData", ["Int16Array",10], ["Int32Array",10], ["Int8Array",10], ["Intl",11], ["Key",11], ["KeyOperation",11], ["KeyPair",11], "Location", "MediaError", "MediaList", ["MediaSource",11], - ["MessageChannel",10], ["MessagePort",10], ["MimeType",11], ["MimeTypeArray",9,10], "MouseWheelEvent", "MSBehaviorUrnsCollection", ["MSBlobBuilder",10], "MSCompatibleInfo", - "MSCompatibleInfoCollection", ["MSCSSMatrix",10], ["MSGesture",10], ["MSGestureEvent",10], ["MSGraphicsTrust",11], ["MSInputMethodContext",11], ["MSManipulationEvent",10], - ["MSMediaKeyError",11], ["MSMediaKeyMessageEvent",11], ["MSMediaKeyNeededEvent",11], ["MSMediaKeys",11], ["MSMediaKeySession",11], "MSMimeTypesCollection", ["MSNamespaceInfo",0,9], - "MSPluginsCollection", ["MSPointerEvent",10], ["MSPopupWindow",0,10], ["MSRangeCollection",10], "MSSiteModeEvent", ["MSStream",10], ["MSStreamReader",10], "MutationEvent", - ["MutationRecord",11], "NodeFilter", "NodeIterator", ["OES_element_index_uint",11], ["OES_standard_derivatives",11], ["OES_texture_float",11], ["OES_texture_float_linear",11], - "PerformanceEntry", "PerformanceMark", "PerformanceMeasure", ["PerformanceNavigationTiming",11], "PerformanceResourceTiming", ["Plugin",11], ["PluginArray",9,10], ["PointerEvent",11], - ["PopStateEvent",10], "Position", "PositionError", "ProcessingInstruction", "RangeException", "RegExpError", "ScriptEngine", "ScriptEngineBuildVersion", "ScriptEngineMajorVersion", - "ScriptEngineMinorVersion", "Selection", ["SourceBuffer",11], ["SourceBufferList",11], "StyleMedia", "StyleSheetPageList", ["SubtleCrypto",11], "SVGAElement", "SVGAngle", "SVGAnimatedAngle", - "SVGAnimatedBoolean", "SVGAnimatedEnumeration", "SVGAnimatedInteger", "SVGAnimatedLength", "SVGAnimatedLengthList", "SVGAnimatedNumber", "SVGAnimatedNumberList", - "SVGAnimatedPreserveAspectRatio", "SVGAnimatedRect", "SVGAnimatedString", "SVGAnimatedTransformList", "SVGClipPathElement", ["SVGComponentTransferFunctionElement",10], "SVGDefsElement", - "SVGDescElement", "SVGElementInstance", "SVGElementInstanceList", "SVGEllipseElement", "SVGException", ["SVGFEBlendElement",10], ["SVGFEColorMatrixElement",10], - ["SVGFEComponentTransferElement",10], ["SVGFECompositeElement",10], ["SVGFEConvolveMatrixElement",10], ["SVGFEDiffuseLightingElement",10], ["SVGFEDisplacementMapElement",10], - ["SVGFEDistantLightElement",10], ["SVGFEFloodElement",10], ["SVGFEFuncAElement",10], ["SVGFEFuncBElement",10], ["SVGFEFuncGElement",10], ["SVGFEFuncRElement",10], - ["SVGFEGaussianBlurElement",10], ["SVGFEImageElement",10], ["SVGFEMergeElement",10], ["SVGFEMergeNodeElement",10], ["SVGFEMorphologyElement",10], ["SVGFEOffsetElement",10], - ["SVGFEPointLightElement",10], ["SVGFESpecularLightingElement",10], ["SVGFESpotLightElement",10], ["SVGFETileElement",10], ["SVGFETurbulenceElement",10], ["SVGFilterElement",10], - "SVGGElement", "SVGGradientElement", "SVGImageElement", "SVGLength", "SVGLengthList", "SVGLinearGradientElement", "SVGLineElement", "SVGMarkerElement", "SVGMaskElement", "SVGMatrix", - "SVGMetadataElement", "SVGNumber", "SVGNumberList", "SVGPathElement", "SVGPathSeg", "SVGPathSegArcAbs", "SVGPathSegArcRel", "SVGPathSegClosePath", "SVGPathSegCurvetoCubicAbs", - "SVGPathSegCurvetoCubicRel", "SVGPathSegCurvetoCubicSmoothAbs", "SVGPathSegCurvetoCubicSmoothRel", "SVGPathSegCurvetoQuadraticAbs", "SVGPathSegCurvetoQuadraticRel", - "SVGPathSegCurvetoQuadraticSmoothAbs", "SVGPathSegCurvetoQuadraticSmoothRel", "SVGPathSegLinetoAbs", "SVGPathSegLinetoHorizontalAbs", "SVGPathSegLinetoHorizontalRel", - "SVGPathSegLinetoRel", "SVGPathSegLinetoVerticalAbs", "SVGPathSegLinetoVerticalRel", "SVGPathSegList", "SVGPathSegMovetoAbs", "SVGPathSegMovetoRel", "SVGPatternElement", "SVGPoint", - "SVGPointList", "SVGPolygonElement", "SVGPolylineElement", "SVGPreserveAspectRatio", "SVGRadialGradientElement", "SVGRect", "SVGRectElement", "SVGScriptElement", "SVGStopElement", - "SVGStringList", "SVGStyleElement", "SVGSwitchElement", "SVGSymbolElement", "SVGTextElement", "SVGTextPathElement", "SVGTitleElement", "SVGTransform", "SVGTransformList", "SVGUnitTypes", - "SVGUseElement", "SVGViewElement", "SVGZoomAndPan", "SVGZoomEvent", "TextEvent", "TextMetrics", "TextRangeCollection", ["TextTrack",10], ["TextTrackCue",10], ["TextTrackCueList",10], - ["TextTrackList",10], "TimeRanges", ["TrackEvent",10], ["TransitionEvent",10], "TreeWalker", ["Uint16Array",10], ["Uint32Array",10], ["Uint8Array",10], ["Uint8ClampedArray",11], ["URL",10], - ["ValidityState",10], ["VideoPlaybackQuality",11], ["WebGLActiveInfo",11], ["WebGLBuffer",11], ["WebGLContextEvent",11], ["WebGLFramebuffer",11], ["WebGLObject",11], ["WebGLProgram",11], - ["WebGLRenderbuffer",11], ["WebGLRenderingContext",11], ["WebGLShader",11], ["WebGLShaderPrecisionFormat",11], ["WebGLTexture",11], ["WebGLUniformLocation",11], - ["WEBGL_compressed_texture_s3tc",11], ["WEBGL_debug_renderer_info",11], ["WebSocket",10], "WheelEvent", ["Worker",10], ["XDomainRequest",9,10], ["XMLDocument",11], - ["XMLHttpRequestEventTarget",10], "XMLSerializer", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "escape", "eval", "isFinite", "isNaN", "parseFloat", "parseInt", - "unescape" + "CompositionEvent", "ControlRangeCollection", "Coordinates", ["Crypto",11], ["CryptoOperation",11], "CSSFontFaceRule", "CSSImportRule", ["CSSKeyframeRule",10], ["CSSKeyframesRule",10], + "CSSMediaRule", "CSSNamespaceRule", "CSSPageRule", "CSSRuleList", "DataTransfer", ["DataView",9,9], "Debug", ["DeviceAcceleration",11], ["DeviceMotionEvent",11], + ["DeviceOrientationEvent",11], ["DeviceRotationRate",11], ["DOMError",10], "DOMException", "DOMParser", ["DOMSettableTokenList",10], ["DOMStringList",10], ["DOMStringMap",11], + "DragEvent", ["ErrorEvent",10], "EventException", ["EXT_texture_filter_anisotropic",11], ["File",10], ["FileList",10], ["FileReader",10], ["Float32Array",10], ["Float64Array",10], + "FocusEvent", ["FormData",10], "Geolocation", "GetObject", ["HTMLAllCollection",11], "HTMLAppletElement", "HTMLAreasCollection", "HTMLAudioElement", "HTMLBaseElement", + "HTMLBaseFontElement", "HTMLBGSoundElement", "HTMLBlockElement", "HTMLBRElement", "HTMLCanvasElement", ["HTMLDataListElement",10], "HTMLDDElement", "HTMLDirectoryElement", + "HTMLDivElement", "HTMLDListElement", "HTMLDTElement", "HTMLFieldSetElement", "HTMLFontElement", "HTMLFrameSetElement", "HTMLHeadingElement", "HTMLHRElement", "HTMLIsIndexElement", + "HTMLLegendElement", "HTMLLIElement", "HTMLMapElement", "HTMLMarqueeElement", "HTMLMediaElement", "HTMLMenuElement", "HTMLModElement", "HTMLNextIdElement", "HTMLOListElement", + "HTMLOptGroupElement", "HTMLParagraphElement", "HTMLParamElement", "HTMLPhraseElement", "HTMLPreElement", ["HTMLProgressElement",10], "HTMLQuoteElement", "HTMLSourceElement", + "HTMLSpanElement", "HTMLTableCaptionElement", "HTMLTableColElement", "HTMLTableHeaderCellElement", "HTMLTableSectionElement", ["HTMLTrackElement",10], "HTMLUListElement", + "HTMLVideoElement", ["IDBCursor",10], ["IDBCursorWithValue",10], ["IDBDatabase",10], ["IDBFactory",10], ["IDBIndex",10], ["IDBKeyRange",10], ["IDBObjectStore",10], ["IDBOpenDBRequest",10], + ["IDBRequest",10], ["IDBTransaction",10], ["IDBVersionChangeEvent",10], "ImageData", ["Int16Array",10], ["Int32Array",10], ["Int8Array",10], ["Intl",11], ["Key",11], ["KeyOperation",11], + ["KeyPair",11], "Location", "MediaError", "MediaList", ["MediaSource",11], ["MessageChannel",10], ["MessagePort",10], ["MimeType",11], ["MimeTypeArray",9,10], "MouseWheelEvent", + "MSBehaviorUrnsCollection", ["MSBlobBuilder",10], "MSCompatibleInfo", "MSCompatibleInfoCollection", ["MSCSSMatrix",10], ["MSGesture",10], ["MSGestureEvent",10], ["MSGraphicsTrust",11], + ["MSInputMethodContext",11], ["MSManipulationEvent",10], ["MSMediaKeyError",11], ["MSMediaKeyMessageEvent",11], ["MSMediaKeyNeededEvent",11], ["MSMediaKeys",11], ["MSMediaKeySession",11], + "MSMimeTypesCollection", ["MSNamespaceInfo",0,9], "MSPluginsCollection", ["MSPointerEvent",10], ["MSPopupWindow",0,10], ["MSRangeCollection",10], "MSSiteModeEvent", ["MSStream",10], + ["MSStreamReader",10], "MutationEvent", ["MutationRecord",11], "NodeFilter", "NodeIterator", ["OES_element_index_uint",11], ["OES_standard_derivatives",11], ["OES_texture_float",11], + ["OES_texture_float_linear",11], "PerformanceEntry", "PerformanceMark", "PerformanceMeasure", ["PerformanceNavigationTiming",11], "PerformanceResourceTiming", ["Plugin",11], + ["PluginArray",9,10], ["PointerEvent",11], ["PopStateEvent",10], "Position", "PositionError", "ProcessingInstruction", "RangeException", "RegExpError", "Selection", ["SourceBuffer",11], + ["SourceBufferList",11], "StyleMedia", "StyleSheetPageList", ["SubtleCrypto",11], "SVGAElement", "SVGAngle", "SVGAnimatedAngle", "SVGAnimatedBoolean", "SVGAnimatedEnumeration", + "SVGAnimatedInteger", "SVGAnimatedLength", "SVGAnimatedLengthList", "SVGAnimatedNumber", "SVGAnimatedNumberList", "SVGAnimatedPreserveAspectRatio", "SVGAnimatedRect", "SVGAnimatedString", + "SVGAnimatedTransformList", "SVGClipPathElement", ["SVGComponentTransferFunctionElement",10], "SVGDefsElement", "SVGDescElement", "SVGElementInstance", "SVGElementInstanceList", + "SVGEllipseElement", "SVGException", ["SVGFEBlendElement",10], ["SVGFEColorMatrixElement",10], ["SVGFEComponentTransferElement",10], ["SVGFECompositeElement",10], + ["SVGFEConvolveMatrixElement",10], ["SVGFEDiffuseLightingElement",10], ["SVGFEDisplacementMapElement",10], ["SVGFEDistantLightElement",10], ["SVGFEFloodElement",10], ["SVGFEFuncAElement",10], + ["SVGFEFuncBElement",10], ["SVGFEFuncGElement",10], ["SVGFEFuncRElement",10], ["SVGFEGaussianBlurElement",10], ["SVGFEImageElement",10], ["SVGFEMergeElement",10], ["SVGFEMergeNodeElement",10], + ["SVGFEMorphologyElement",10], ["SVGFEOffsetElement",10], ["SVGFEPointLightElement",10], ["SVGFESpecularLightingElement",10], ["SVGFESpotLightElement",10], ["SVGFETileElement",10], + ["SVGFETurbulenceElement",10], ["SVGFilterElement",10], "SVGGElement", "SVGGradientElement", "SVGImageElement", "SVGLength", "SVGLengthList", "SVGLinearGradientElement", "SVGLineElement", + "SVGMarkerElement", "SVGMaskElement", "SVGMatrix", "SVGMetadataElement", "SVGNumber", "SVGNumberList", "SVGPathElement", "SVGPathSeg", "SVGPathSegArcAbs", "SVGPathSegArcRel", + "SVGPathSegClosePath", "SVGPathSegCurvetoCubicAbs", "SVGPathSegCurvetoCubicRel", "SVGPathSegCurvetoCubicSmoothAbs", "SVGPathSegCurvetoCubicSmoothRel", "SVGPathSegCurvetoQuadraticAbs", + "SVGPathSegCurvetoQuadraticRel", "SVGPathSegCurvetoQuadraticSmoothAbs", "SVGPathSegCurvetoQuadraticSmoothRel", "SVGPathSegLinetoAbs", "SVGPathSegLinetoHorizontalAbs", + "SVGPathSegLinetoHorizontalRel", "SVGPathSegLinetoRel", "SVGPathSegLinetoVerticalAbs", "SVGPathSegLinetoVerticalRel", "SVGPathSegList", "SVGPathSegMovetoAbs", "SVGPathSegMovetoRel", + "SVGPatternElement", "SVGPoint", "SVGPointList", "SVGPolygonElement", "SVGPolylineElement", "SVGPreserveAspectRatio", "SVGRadialGradientElement", "SVGRect", "SVGRectElement", + "SVGScriptElement", "SVGStopElement", "SVGStringList", "SVGStyleElement", "SVGSwitchElement", "SVGSymbolElement", "SVGTextElement", "SVGTextPathElement", "SVGTitleElement", + "SVGTransform", "SVGTransformList", "SVGUnitTypes", "SVGUseElement", "SVGViewElement", "SVGZoomAndPan", "SVGZoomEvent", "TextEvent", "TextMetrics", "TextRangeCollection", ["TextTrack",10], + ["TextTrackCue",10], ["TextTrackCueList",10], ["TextTrackList",10], "TimeRanges", ["TrackEvent",10], ["TransitionEvent",10], "TreeWalker", ["Uint16Array",10], ["Uint32Array",10], + ["Uint8Array",10], ["Uint8ClampedArray",11], ["URL",10], ["ValidityState",10], ["VideoPlaybackQuality",11], ["WebGLActiveInfo",11], ["WebGLBuffer",11], ["WebGLContextEvent",11], + ["WebGLFramebuffer",11], ["WebGLObject",11], ["WebGLProgram",11], ["WebGLRenderbuffer",11], ["WebGLRenderingContext",11], ["WebGLShader",11], ["WebGLShaderPrecisionFormat",11], + ["WebGLTexture",11], ["WebGLUniformLocation",11], ["WEBGL_compressed_texture_s3tc",11], ["WEBGL_debug_renderer_info",11], ["WebSocket",10], "WheelEvent", ["Worker",10], + ["XDomainRequest",9,10], ["XMLDocument",11], ["XMLHttpRequestEventTarget",10], "XMLSerializer" ]); }); diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index 295ea8d2b22b..fdefc083c2c1 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -1356,7 +1356,6 @@ sync_test("getOwnPropertyNames", function() { ok(names === "defined,test", "names = " + names); names = Object.getOwnPropertyNames([]).sort().join(); - todo_wine. ok(names === "length", "names = " + names); ok(Object.getOwnPropertyNames.length === 1, "Object.getOwnPropertyNames.length = " + Object.getOwnPropertyNames.length); From e0e59c024f82c81d169614f52879b070866843a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:06 +0200 Subject: [PATCH 1318/2542] jscript: Simplify get_flags to only check whether it's enumerable. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- It's the only thing it was used for anyway. --- dlls/jscript/dispex.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 68e44677a78d..153f3a552449 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -108,7 +108,7 @@ static inline BOOL is_function_prop(dispex_prop_t *prop) return ret; } -static DWORD get_flags(jsdisp_t *This, dispex_prop_t *prop) +static BOOL is_enumerable(jsdisp_t *This, dispex_prop_t *prop) { if(prop->type == PROP_PROTREF) { dispex_prop_t *parent = NULL; @@ -118,13 +118,13 @@ static DWORD get_flags(jsdisp_t *This, dispex_prop_t *prop) if(!parent || parent->type == PROP_DELETED) { prop->type = PROP_DELETED; - return 0; + return FALSE; } - return get_flags(This->prototype, parent); + return is_enumerable(This->prototype, parent); } - return prop->flags; + return !!(prop->flags & PROPF_ENUMERABLE); } static const builtin_prop_t *find_builtin_prop(jsdisp_t *This, const WCHAR *name, BOOL case_insens) @@ -3117,7 +3117,7 @@ HRESULT jsdisp_next_prop(jsdisp_t *obj, DISPID id, enum jsdisp_enum_type enum_ty continue; if(enum_type != JSDISP_ENUM_ALL && iter->type == PROP_PROTREF) continue; - if(enum_type != JSDISP_ENUM_OWN && !(get_flags(obj, iter) & PROPF_ENUMERABLE)) + if(enum_type != JSDISP_ENUM_OWN && !is_enumerable(obj, iter)) continue; *ret = prop_to_id(obj, iter); return S_OK; From f5e13052a9963e0af331525bd279c0771c82813e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:06 +0200 Subject: [PATCH 1319/2542] jscript: Move filling the PROTREF into a helper. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/dispex.c | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 153f3a552449..96f4406ed3ce 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -758,9 +758,29 @@ static HRESULT fill_props(jsdisp_t *obj) return S_OK; } +static HRESULT fill_protref(jsdisp_t *This, unsigned hash, const WCHAR *name, DWORD ref) +{ + dispex_prop_t *prop; + HRESULT hres; + + hres = find_prop_name(This, hash, name, FALSE, NULL, &prop); + if(FAILED(hres)) + return hres; + if(prop) { + if(prop->type != PROP_DELETED) + return S_OK; + prop->type = PROP_PROTREF; + prop->flags = 0; + prop->u.ref = ref; + }else if(!alloc_protref(This, name, ref)) { + return E_OUTOFMEMORY; + } + return S_OK; +} + static HRESULT fill_protrefs(jsdisp_t *This) { - dispex_prop_t *iter, *prop; + dispex_prop_t *iter; HRESULT hres; hres = fill_props(This); @@ -775,20 +795,9 @@ static HRESULT fill_protrefs(jsdisp_t *This) return hres; for(iter = This->prototype->props; iter < This->prototype->props+This->prototype->prop_cnt; iter++) { - hres = find_prop_name(This, iter->hash, iter->name, FALSE, NULL, &prop); - if(FAILED(hres)) + hres = fill_protref(This, iter->hash, iter->name, iter - This->prototype->props); + if(hres != S_OK) return hres; - if(!prop || prop->type==PROP_DELETED) { - if(prop) { - prop->type = PROP_PROTREF; - prop->flags = 0; - prop->u.ref = iter - This->prototype->props; - }else { - prop = alloc_protref(This, iter->name, iter - This->prototype->props); - if(!prop) - return E_OUTOFMEMORY; - } - } } return S_OK; From 1aad210158870cf1062cd97ab23a9988569f47ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:06 +0200 Subject: [PATCH 1320/2542] jscript: Return props as their DISPID when looked up by name. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit is_dispex_prop_id will be more interesting later when we'll also have indexed props, for now it only avoids DISPID_VALUE (or "no prop") so it's still useful. Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/dispex.c | 251 ++++++++++++++++++++++------------------- dlls/jscript/jscript.h | 5 + 2 files changed, 139 insertions(+), 117 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 96f4406ed3ce..43add94779d2 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -60,6 +60,11 @@ struct _dispex_prop_t { int bucket_next; }; +static inline DWORD prop_id_to_idx(DISPID id) +{ + return id - 1; +} + static void fix_protref_prop(jsdisp_t *jsdisp, dispex_prop_t *prop) { DWORD ref; @@ -351,17 +356,15 @@ static HRESULT find_external_prop(jsdisp_t *This, const WCHAR *name, BOOL case_i } static HRESULT find_prop_name(jsdisp_t *This, unsigned hash, const WCHAR *name, BOOL case_insens, - dispex_prop_t *prop, dispex_prop_t **ret) + dispex_prop_t *prop, DISPID *ret) { const builtin_prop_t *builtin; HRESULT hres; if(!prop) prop = lookup_dispex_prop(This, hash, name, case_insens); - if(prop && prop->type != PROP_DELETED && prop->type != PROP_EXTERN) { - *ret = prop; - return S_OK; - } + if(prop && prop->type != PROP_DELETED && prop->type != PROP_EXTERN) + goto ret; if(!prop && (builtin = find_builtin_prop(This, name, case_insens))) { unsigned flags = builtin->flags; @@ -380,8 +383,7 @@ static HRESULT find_prop_name(jsdisp_t *This, unsigned hash, const WCHAR *name, prop->type = PROP_JSVAL; prop->u.val = jsval_obj(obj); - *ret = prop; - return S_OK; + goto ret; }else if(builtin->setter) flags |= PROPF_WRITABLE; flags &= PROPF_ENUMERABLE | PROPF_WRITABLE | PROPF_CONFIGURABLE; @@ -390,92 +392,108 @@ static HRESULT find_prop_name(jsdisp_t *This, unsigned hash, const WCHAR *name, return E_OUTOFMEMORY; prop->u.p = builtin; - *ret = prop; - return S_OK; + goto ret; } - return find_external_prop(This, name, case_insens, prop, ret); + hres = find_external_prop(This, name, case_insens, prop, &prop); + if(FAILED(hres)) + return hres; + if(!prop) { + *ret = 0; + return S_FALSE; + } + +ret: + *ret = prop_to_id(This, prop); + return prop->type != PROP_DELETED ? S_OK : S_FALSE; } static HRESULT find_prop_name_prot(jsdisp_t *This, unsigned hash, const WCHAR *name, BOOL case_insens, - dispex_prop_t *own_prop, dispex_prop_t **ret) + dispex_prop_t *own_prop, DISPID *ret) { dispex_prop_t *prot_prop = NULL; HRESULT hres; - hres = find_prop_name(This, hash, name, case_insens, own_prop, &own_prop); + hres = find_prop_name(This, hash, name, case_insens, own_prop, ret); if(FAILED(hres)) return hres; - if(own_prop) { - if(own_prop->type == PROP_PROTREF) { + + if(is_dispex_prop_id(*ret)) { + own_prop = &This->props[prop_id_to_idx(*ret)]; + if(hres == S_OK) { + if(own_prop->type != PROP_PROTREF) + return S_OK; prot_prop = &This->prototype->props[own_prop->u.ref]; - }else if(own_prop->type != PROP_DELETED) { - *ret = own_prop; - return S_OK; } } if(This->prototype) { - hres = find_prop_name_prot(This->prototype, hash, name, case_insens, prot_prop, &prot_prop); + hres = find_prop_name_prot(This->prototype, hash, name, case_insens, prot_prop, ret); if(FAILED(hres)) return hres; - if(prot_prop && prot_prop->type != PROP_DELETED) { + if(hres == S_OK) { + DWORD ref = prop_id_to_idx(*ret); + + prot_prop = &This->prototype->props[ref]; + if(own_prop && case_insens && wcscmp(prot_prop->name, own_prop->name)) { - hres = find_prop_name(This, prot_prop->hash, prot_prop->name, FALSE, NULL, &own_prop); + hres = find_prop_name(This, prot_prop->hash, prot_prop->name, FALSE, NULL, ret); if(FAILED(hres)) return hres; - if(own_prop && own_prop->type != PROP_DELETED) { - *ret = own_prop; + if(hres == S_OK) return S_OK; - } + own_prop = is_dispex_prop_id(*ret) ? &This->props[prop_id_to_idx(*ret)] : NULL; } if(own_prop) { own_prop->type = PROP_PROTREF; - own_prop->u.ref = prot_prop - This->prototype->props; - }else { - own_prop = alloc_protref(This, prot_prop->name, prot_prop - This->prototype->props); - if(!own_prop) - return E_OUTOFMEMORY; + own_prop->u.ref = ref; + }else if(!(own_prop = alloc_protref(This, prot_prop->name, ref))) { + return E_OUTOFMEMORY; } }else if(own_prop) { own_prop->type = PROP_DELETED; } } - *ret = own_prop; - return S_OK; + if(!own_prop) { + *ret = 0; + return S_FALSE; + } + + *ret = prop_to_id(This, own_prop); + return own_prop->type != PROP_DELETED ? S_OK : S_FALSE; } -static HRESULT ensure_prop_name(jsdisp_t *This, const WCHAR *name, DWORD create_flags, BOOL case_insens, dispex_prop_t **ret) +static HRESULT ensure_prop_name(jsdisp_t *This, const WCHAR *name, DWORD create_flags, BOOL case_insens, DISPID *ret) { dispex_prop_t *prop; HRESULT hres; - hres = find_prop_name_prot(This, string_hash(name), name, case_insens, NULL, &prop); - if(SUCCEEDED(hres) && (!prop || prop->type == PROP_DELETED)) { - TRACE("creating prop %s flags %lx\n", debugstr_w(name), create_flags); + hres = find_prop_name_prot(This, string_hash(name), name, case_insens, NULL, ret); + if(hres != S_FALSE) + return hres; - if(!prop) { - prop = alloc_prop(This, name, PROP_DELETED, 0); - if(!prop) - return E_OUTOFMEMORY; - } + if(is_dispex_prop_id(*ret)) + prop = &This->props[prop_id_to_idx(*ret)]; + else { + if(!(prop = alloc_prop(This, name, PROP_JSVAL, create_flags))) + return E_OUTOFMEMORY; + *ret = prop_to_id(This, prop); + } - if(This->builtin_info->lookup_prop) { - struct property_info desc; - hres = This->builtin_info->lookup_prop(This, name, fdexNameEnsure, &desc); - if(hres == S_OK) - return update_external_prop(This, name, prop, &desc, ret); - } + TRACE("creating prop %s flags %lx\n", debugstr_w(name), create_flags); - hres = S_OK; - prop->type = PROP_JSVAL; - prop->flags = create_flags; - prop->u.val = jsval_undefined(); + if(This->builtin_info->lookup_prop) { + struct property_info desc; + hres = This->builtin_info->lookup_prop(This, name, fdexNameEnsure, &desc); + if(hres == S_OK) + return update_external_prop(This, name, prop, &desc, &prop); } - *ret = prop; - return hres; + prop->type = PROP_JSVAL; + prop->flags = create_flags; + prop->u.val = jsval_undefined(); + return S_OK; } HRESULT jsdisp_index_lookup(jsdisp_t *obj, const WCHAR *name, unsigned length, struct property_info *desc) @@ -733,15 +751,15 @@ HRESULT builtin_set_const(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) static HRESULT fill_props(jsdisp_t *obj) { - dispex_prop_t *prop; HRESULT hres; + DISPID id; DWORD i; if(obj->props_filled) return S_OK; for(i = 0; i < obj->builtin_info->props_cnt; i++) { - hres = find_prop_name(obj, string_hash(obj->builtin_info->props[i].name), obj->builtin_info->props[i].name, FALSE, NULL, &prop); + hres = find_prop_name(obj, string_hash(obj->builtin_info->props[i].name), obj->builtin_info->props[i].name, FALSE, NULL, &id); if(FAILED(hres)) return hres; } @@ -760,15 +778,14 @@ static HRESULT fill_props(jsdisp_t *obj) static HRESULT fill_protref(jsdisp_t *This, unsigned hash, const WCHAR *name, DWORD ref) { - dispex_prop_t *prop; HRESULT hres; + DISPID id; - hres = find_prop_name(This, hash, name, FALSE, NULL, &prop); - if(FAILED(hres)) + hres = find_prop_name(This, hash, name, FALSE, NULL, &id); + if(hres != S_FALSE) return hres; - if(prop) { - if(prop->type != PROP_DELETED) - return S_OK; + if(is_dispex_prop_id(id)) { + dispex_prop_t *prop = &This->props[prop_id_to_idx(id)]; prop->type = PROP_PROTREF; prop->flags = 0; prop->u.ref = ref; @@ -2234,8 +2251,10 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IWineJSDispatch *iface, DISPID id, LCI return leave_script(This->ctx, hres); } -static HRESULT delete_prop(jsdisp_t *obj, dispex_prop_t *prop, BOOL *ret) +static HRESULT delete_prop(jsdisp_t *obj, DISPID id, BOOL *ret) { + dispex_prop_t *prop = &obj->props[prop_id_to_idx(id)]; + if(prop->type == PROP_PROTREF || prop->type == PROP_DELETED) { *ret = TRUE; return S_OK; @@ -2276,7 +2295,7 @@ static HRESULT delete_prop(jsdisp_t *obj, dispex_prop_t *prop, BOOL *ret) static HRESULT WINAPI DispatchEx_DeleteMemberByName(IWineJSDispatch *iface, BSTR bstrName, DWORD grfdex) { jsdisp_t *This = impl_from_IWineJSDispatch(iface); - dispex_prop_t *prop; + DISPID id; BOOL b; HRESULT hres; @@ -2285,15 +2304,15 @@ static HRESULT WINAPI DispatchEx_DeleteMemberByName(IWineJSDispatch *iface, BSTR if(grfdex & ~(fdexNameCaseSensitive|fdexNameCaseInsensitive|fdexNameEnsure|fdexNameImplicit|FDEX_VERSION_MASK)) FIXME("Unsupported grfdex %lx\n", grfdex); - hres = find_prop_name(This, string_hash(bstrName), bstrName, grfdex & fdexNameCaseInsensitive, NULL, &prop); + hres = find_prop_name(This, string_hash(bstrName), bstrName, grfdex & fdexNameCaseInsensitive, NULL, &id); if(FAILED(hres)) return hres; - if(!prop) { + if(hres != S_OK) { TRACE("not found\n"); return S_OK; } - return delete_prop(This, prop, &b); + return delete_prop(This, id, &b); } static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IWineJSDispatch *iface, DISPID id) @@ -2310,7 +2329,7 @@ static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IWineJSDispatch *iface, DI return DISP_E_MEMBERNOTFOUND; } - return delete_prop(This, prop, &b); + return delete_prop(This, prop_to_id(This, prop), &b); } static HRESULT WINAPI DispatchEx_GetMemberProperties(IWineJSDispatch *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex) @@ -2520,14 +2539,14 @@ HRESULT create_dispex(script_ctx_t *ctx, const builtin_info_t *builtin_info, jsd HRESULT init_dispex_from_constr(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *constr) { jsdisp_t *prot = NULL; - dispex_prop_t *prop; HRESULT hres; + DISPID id; - hres = find_prop_name_prot(constr, string_hash(L"prototype"), L"prototype", FALSE, NULL, &prop); - if(SUCCEEDED(hres) && prop && prop->type!=PROP_DELETED) { + hres = find_prop_name_prot(constr, string_hash(L"prototype"), L"prototype", FALSE, NULL, &id); + if(hres == S_OK) { jsval_t val; - hres = prop_get(constr, to_disp(constr), prop, &val); + hres = prop_get(constr, to_disp(constr), &constr->props[prop_id_to_idx(id)], &val); if(FAILED(hres)) { ERR("Could not get prototype\n"); return hres; @@ -2557,22 +2576,16 @@ jsdisp_t *iface_to_jsdisp(IDispatch *iface) HRESULT jsdisp_get_id(jsdisp_t *jsdisp, const WCHAR *name, DWORD flags, DISPID *id) { - dispex_prop_t *prop; HRESULT hres; if(jsdisp->extensible && (flags & fdexNameEnsure)) hres = ensure_prop_name(jsdisp, name, PROPF_ENUMERABLE | PROPF_CONFIGURABLE | PROPF_WRITABLE, - flags & fdexNameCaseInsensitive, &prop); + flags & fdexNameCaseInsensitive, id); else - hres = find_prop_name_prot(jsdisp, string_hash(name), name, flags & fdexNameCaseInsensitive, NULL, &prop); - if(FAILED(hres)) + hres = find_prop_name_prot(jsdisp, string_hash(name), name, flags & fdexNameCaseInsensitive, NULL, id); + if(hres != S_FALSE) return hres; - if(prop && prop->type!=PROP_DELETED) { - *id = prop_to_id(jsdisp, prop); - return S_OK; - } - TRACE("not found %s\n", debugstr_w(name)); *id = DISPID_UNKNOWN; return DISP_E_UNKNOWNNAME; @@ -2622,17 +2635,14 @@ HRESULT jsdisp_call(jsdisp_t *disp, DISPID id, WORD flags, unsigned argc, jsval_ HRESULT jsdisp_call_name(jsdisp_t *disp, const WCHAR *name, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { - dispex_prop_t *prop; HRESULT hres; + DISPID id; - hres = find_prop_name_prot(disp, string_hash(name), name, FALSE, NULL, &prop); - if(FAILED(hres)) - return hres; - - if(!prop || prop->type == PROP_DELETED) - return JS_E_INVALID_PROPERTY; + hres = find_prop_name_prot(disp, string_hash(name), name, FALSE, NULL, &id); + if(hres != S_OK) + return FAILED(hres) ? hres : JS_E_INVALID_PROPERTY; - return invoke_prop_func(disp, to_disp(disp), prop, flags, argc, argv, r, &disp->ctx->jscaller->IServiceProvider_iface); + return invoke_prop_func(disp, to_disp(disp), &disp->props[prop_id_to_idx(id)], flags, argc, argv, r, &disp->ctx->jscaller->IServiceProvider_iface); } static HRESULT disp_invoke(script_ctx_t *ctx, IDispatch *disp, DISPID id, WORD flags, DISPPARAMS *params, VARIANT *r, @@ -2849,19 +2859,19 @@ HRESULT disp_call_value_with_caller(script_ctx_t *ctx, IDispatch *disp, jsval_t HRESULT jsdisp_propput(jsdisp_t *obj, const WCHAR *name, DWORD flags, BOOL throw, jsval_t val) { - dispex_prop_t *prop; HRESULT hres; + DISPID id; if(obj->extensible) - hres = ensure_prop_name(obj, name, flags, FALSE, &prop); + hres = ensure_prop_name(obj, name, flags, FALSE, &id); else - hres = find_prop_name(obj, string_hash(name), name, FALSE, NULL, &prop); + hres = find_prop_name(obj, string_hash(name), name, FALSE, NULL, &id); if(FAILED(hres)) return hres; - if(!prop || (prop->type == PROP_DELETED && !obj->extensible)) + if(hres != S_OK && (!id || !obj->extensible)) return throw ? JS_E_INVALID_ACTION : S_OK; - return prop_put(obj, prop, val); + return prop_put(obj, &obj->props[prop_id_to_idx(id)], val); } HRESULT jsdisp_propput_name(jsdisp_t *obj, const WCHAR *name, jsval_t val) @@ -2953,39 +2963,39 @@ HRESULT disp_propput_name(script_ctx_t *ctx, IDispatch *disp, const WCHAR *name, HRESULT jsdisp_propget_name(jsdisp_t *obj, const WCHAR *name, jsval_t *val) { - dispex_prop_t *prop; HRESULT hres; + DISPID id; - hres = find_prop_name_prot(obj, string_hash(name), name, FALSE, NULL, &prop); + hres = find_prop_name_prot(obj, string_hash(name), name, FALSE, NULL, &id); if(FAILED(hres)) return hres; - if(!prop || prop->type==PROP_DELETED) { + if(hres != S_OK) { *val = jsval_undefined(); return S_OK; } - return prop_get(obj, to_disp(obj), prop, val); + return prop_get(obj, to_disp(obj), &obj->props[prop_id_to_idx(id)], val); } HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r) { WCHAR name[12]; - dispex_prop_t *prop; HRESULT hres; + DISPID id; swprintf(name, ARRAY_SIZE(name), L"%d", idx); - hres = find_prop_name_prot(obj, string_hash(name), name, FALSE, NULL, &prop); + hres = find_prop_name_prot(obj, string_hash(name), name, FALSE, NULL, &id); if(FAILED(hres)) return hres; - if(!prop || prop->type==PROP_DELETED) { + if(hres != S_OK) { *r = jsval_undefined(); return DISP_E_UNKNOWNNAME; } - return prop_get(obj, to_disp(obj), prop, r); + return prop_get(obj, to_disp(obj), &obj->props[prop_id_to_idx(id)], r); } HRESULT jsdisp_propget(jsdisp_t *jsdisp, DISPID id, jsval_t *val) @@ -3027,17 +3037,17 @@ HRESULT disp_propget(script_ctx_t *ctx, IDispatch *disp, DISPID id, jsval_t *val HRESULT jsdisp_delete_idx(jsdisp_t *obj, DWORD idx) { WCHAR buf[12]; - dispex_prop_t *prop; + DISPID id; BOOL b; HRESULT hres; swprintf(buf, ARRAY_SIZE(buf), L"%d", idx); - hres = find_prop_name(obj, string_hash(buf), buf, FALSE, NULL, &prop); - if(FAILED(hres) || !prop) - return hres; + hres = find_prop_name(obj, string_hash(buf), buf, FALSE, NULL, &id); + if(hres != S_OK) + return FAILED(hres) ? hres : S_OK; - hres = delete_prop(obj, prop, &b); + hres = delete_prop(obj, id, &b); if(FAILED(hres)) return hres; return b ? S_OK : JS_E_INVALID_ACTION; @@ -3055,7 +3065,7 @@ HRESULT disp_delete(IDispatch *disp, DISPID id, BOOL *ret) prop = get_prop(jsdisp, id); if(prop) - hres = delete_prop(jsdisp, prop, ret); + hres = delete_prop(jsdisp, prop_to_id(jsdisp, prop), ret); else hres = DISP_E_MEMBERNOTFOUND; @@ -3147,8 +3157,8 @@ HRESULT disp_delete_name(script_ctx_t *ctx, IDispatch *disp, jsstr_t *name, BOOL jsdisp = iface_to_jsdisp(disp); if(jsdisp) { - dispex_prop_t *prop; const WCHAR *ptr; + DISPID id; ptr = jsstr_flatten(name); if(!ptr) { @@ -3156,10 +3166,10 @@ HRESULT disp_delete_name(script_ctx_t *ctx, IDispatch *disp, jsstr_t *name, BOOL return E_OUTOFMEMORY; } - hres = find_prop_name(jsdisp, string_hash(ptr), ptr, FALSE, NULL, &prop); - if(prop) { - hres = delete_prop(jsdisp, prop, ret); - }else { + hres = find_prop_name(jsdisp, string_hash(ptr), ptr, FALSE, NULL, &id); + if(hres == S_OK) + hres = delete_prop(jsdisp, id, ret); + else { *ret = TRUE; hres = S_OK; } @@ -3202,13 +3212,15 @@ HRESULT jsdisp_get_own_property(jsdisp_t *obj, const WCHAR *name, BOOL flags_onl { dispex_prop_t *prop; HRESULT hres; + DISPID id; - hres = find_prop_name(obj, string_hash(name), name, FALSE, NULL, &prop); + hres = find_prop_name(obj, string_hash(name), name, FALSE, NULL, &id); if(FAILED(hres)) return hres; - if(!prop) + if(hres != S_OK) return DISP_E_UNKNOWNNAME; + prop = &obj->props[prop_id_to_idx(id)]; memset(desc, 0, sizeof(*desc)); @@ -3246,16 +3258,21 @@ HRESULT jsdisp_define_property(jsdisp_t *obj, const WCHAR *name, property_desc_t { dispex_prop_t *prop; HRESULT hres; + DISPID id; - hres = find_prop_name(obj, string_hash(name), name, FALSE, NULL, &prop); + hres = find_prop_name(obj, string_hash(name), name, FALSE, NULL, &id); if(FAILED(hres)) return hres; - if((!prop || prop->type == PROP_DELETED || prop->type == PROP_PROTREF) && !obj->extensible) + if(hres == S_OK) { + prop = &obj->props[prop_id_to_idx(id)]; + if((prop->type == PROP_DELETED || prop->type == PROP_PROTREF) && !obj->extensible) + return throw_error(obj->ctx, JS_E_OBJECT_NONEXTENSIBLE, name); + }else if(!obj->extensible) { return throw_error(obj->ctx, JS_E_OBJECT_NONEXTENSIBLE, name); - - if(!prop && !(prop = alloc_prop(obj, name, PROP_DELETED, 0))) - return E_OUTOFMEMORY; + }else if(!(prop = alloc_prop(obj, name, PROP_DELETED, 0))) { + return E_OUTOFMEMORY; + } if(prop->type == PROP_DELETED || prop->type == PROP_PROTREF) { prop->flags = desc->flags; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 859727f7b383..e8fe3d1d3b1a 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -225,6 +225,11 @@ static inline IDispatchEx *to_dispex(jsdisp_t *jsdisp) return (IDispatchEx *)&jsdisp->IWineJSDispatch_iface; } +static inline BOOL is_dispex_prop_id(DISPID id) +{ + return id > 0; +} + jsdisp_t *as_jsdisp(IDispatch*); jsdisp_t *to_jsdisp(IDispatch*); IWineJSDispatchHost *get_host_dispatch(IDispatch*); From 09574b987eb70df06e2044aaa871d14ab4ca62e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:06 +0200 Subject: [PATCH 1321/2542] jscript: Use DISPID when retrieving or referring to props. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/dispex.c | 135 ++++++++++++++++++++++-------------------- 1 file changed, 70 insertions(+), 65 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 43add94779d2..cddff9cfd668 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -30,6 +30,11 @@ static const GUID GUID_JScriptTypeInfo = {0xc59c6b12,0xf6c1,0x11cf,{0x88,0x35,0x #define FDEX_VERSION_MASK 0xf0000000 #define GOLDEN_RATIO 0x9E3779B9U +typedef enum { + INVALID_PROP, + DISPEX_PROP, +} prop_kind_t; + typedef enum { PROP_JSVAL, PROP_BUILTIN, @@ -89,15 +94,17 @@ static inline DISPID prop_to_id(jsdisp_t *This, dispex_prop_t *prop) return prop - This->props + 1; } -static inline dispex_prop_t *get_prop(jsdisp_t *This, DISPID id) +static inline prop_kind_t prop_kind(jsdisp_t *This, DISPID id) { - DWORD idx = id - 1; + DWORD idx = prop_id_to_idx(id); if(idx >= This->prop_cnt) - return NULL; + return INVALID_PROP; fix_protref_prop(This, &This->props[idx]); - return This->props[idx].type == PROP_DELETED ? NULL : &This->props[idx]; + if(This->props[idx].type == PROP_DELETED) + return INVALID_PROP; + return DISPEX_PROP; } static inline BOOL is_function_prop(dispex_prop_t *prop) @@ -570,8 +577,9 @@ static HRESULT convert_params(script_ctx_t *ctx, const DISPPARAMS *dp, jsval_t * return S_OK; } -static HRESULT prop_get(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t *prop, jsval_t *r) +static HRESULT prop_get(jsdisp_t *This, IDispatch *jsthis, DISPID id, jsval_t *r) { + dispex_prop_t *prop = &This->props[prop_id_to_idx(id)]; jsdisp_t *prop_obj = This; HRESULT hres; @@ -613,8 +621,9 @@ static HRESULT prop_get(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t *prop, return hres; } -static HRESULT prop_put(jsdisp_t *This, dispex_prop_t *prop, jsval_t val) +static HRESULT prop_put(jsdisp_t *This, DISPID id, jsval_t val) { + dispex_prop_t *prop = &This->props[prop_id_to_idx(id)]; HRESULT hres; if(prop->type == PROP_PROTREF) { @@ -688,9 +697,10 @@ static HRESULT prop_put(jsdisp_t *This, dispex_prop_t *prop, jsval_t val) return S_OK; } -static HRESULT invoke_prop_func(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t *prop, WORD flags, +static HRESULT invoke_prop_func(jsdisp_t *This, IDispatch *jsthis, DISPID id, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r, IServiceProvider *caller) { + dispex_prop_t *prop = &This->props[prop_id_to_idx(id)]; HRESULT hres; switch(prop->type) { @@ -698,7 +708,7 @@ static HRESULT invoke_prop_func(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t return JS_E_FUNCTION_EXPECTED; case PROP_PROTREF: return invoke_prop_func(This->prototype, jsthis ? jsthis : to_disp(This), - This->prototype->props+prop->u.ref, flags, argc, argv, r, caller); + prop->u.ref + 1, flags, argc, argv, r, caller); case PROP_JSVAL: { if(!is_object_instance(prop->u.val)) { FIXME("value %s is not a function\n", debugstr_jsval(prop->u.val)); @@ -715,7 +725,7 @@ static HRESULT invoke_prop_func(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t case PROP_EXTERN: { jsval_t val; - hres = prop_get(This, jsthis ? jsthis : to_disp(This), prop, &val); + hres = prop_get(This, jsthis ? jsthis : to_disp(This), id, &val); if(FAILED(hres)) return hres; @@ -2140,7 +2150,6 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IWineJSDispatch *iface, DISPID id, LCI { jsdisp_t *This = impl_from_IWineJSDispatch(iface); IServiceProvider *prev_caller; - dispex_prop_t *prop; jsexcept_t ei; HRESULT hres; @@ -2149,8 +2158,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IWineJSDispatch *iface, DISPID id, LCI if(pvarRes) V_VT(pvarRes) = VT_EMPTY; - prop = get_prop(This, id); - if(!prop && id != DISPID_VALUE) { + if(prop_kind(This, id) == INVALID_PROP && id != DISPID_VALUE) { TRACE("invalid id\n"); return DISP_E_MEMBERNOTFOUND; } @@ -2177,8 +2185,8 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IWineJSDispatch *iface, DISPID id, LCI break; passed_this = get_this(pdp); - if(prop) - hres = invoke_prop_func(This, passed_this, prop, wFlags, argc, argv, pvarRes ? &r : NULL, pspCaller); + if(id != DISPID_VALUE) + hres = invoke_prop_func(This, passed_this, id, wFlags, argc, argv, pvarRes ? &r : NULL, pspCaller); else hres = jsdisp_call_value(This, passed_this ? jsval_disp(passed_this) : jsval_undefined(), wFlags, argc, argv, pvarRes ? &r : NULL); @@ -2195,8 +2203,8 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IWineJSDispatch *iface, DISPID id, LCI case DISPATCH_PROPERTYGET: { jsval_t r; - if(prop) - hres = prop_get(This, to_disp(This), prop, &r); + if(id != DISPID_VALUE) + hres = prop_get(This, to_disp(This), id, &r); else { hres = to_primitive(This->ctx, jsval_obj(This), &r, NO_HINT); if(hres == JS_E_TO_PRIMITIVE) @@ -2215,7 +2223,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IWineJSDispatch *iface, DISPID id, LCI jsval_t val; DWORD i; - if(!prop) { + if(id == DISPID_VALUE) { hres = DISP_E_MEMBERNOTFOUND; break; } @@ -2235,7 +2243,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IWineJSDispatch *iface, DISPID id, LCI if(FAILED(hres)) break; - hres = prop_put(This, prop, val); + hres = prop_put(This, id, val); jsval_release(val); break; } @@ -2318,29 +2326,25 @@ static HRESULT WINAPI DispatchEx_DeleteMemberByName(IWineJSDispatch *iface, BSTR static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IWineJSDispatch *iface, DISPID id) { jsdisp_t *This = impl_from_IWineJSDispatch(iface); - dispex_prop_t *prop; BOOL b; TRACE("(%p)->(%lx)\n", This, id); - prop = get_prop(This, id); - if(!prop) { + if(prop_kind(This, id) == INVALID_PROP) { WARN("invalid id\n"); return DISP_E_MEMBERNOTFOUND; } - return delete_prop(This, prop_to_id(This, prop), &b); + return delete_prop(This, id, &b); } static HRESULT WINAPI DispatchEx_GetMemberProperties(IWineJSDispatch *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex) { jsdisp_t *This = impl_from_IWineJSDispatch(iface); - dispex_prop_t *prop; TRACE("(%p)->(%lx %lx %p)\n", This, id, grfdexFetch, pgrfdex); - prop = get_prop(This, id); - if(!prop) + if(prop_kind(This, id) == INVALID_PROP) return DISP_E_MEMBERNOTFOUND; *pgrfdex = 0; @@ -2355,17 +2359,17 @@ static HRESULT WINAPI DispatchEx_GetMemberProperties(IWineJSDispatch *iface, DIS static HRESULT WINAPI DispatchEx_GetMemberName(IWineJSDispatch *iface, DISPID id, BSTR *pbstrName) { jsdisp_t *This = impl_from_IWineJSDispatch(iface); - dispex_prop_t *prop; TRACE("(%p)->(%lx %p)\n", This, id, pbstrName); - prop = get_prop(This, id); - if(!prop) + switch(prop_kind(This, id)) { + case DISPEX_PROP: + if(!(*pbstrName = SysAllocString(This->props[prop_id_to_idx(id)].name))) + return E_OUTOFMEMORY; + break; + default: return DISP_E_MEMBERNOTFOUND; - - *pbstrName = SysAllocString(prop->name); - if(!*pbstrName) - return E_OUTOFMEMORY; + } return S_OK; } @@ -2400,12 +2404,20 @@ static void WINAPI WineJSDispatch_Free(IWineJSDispatch *iface) static HRESULT WINAPI WineJSDispatch_GetPropertyFlags(IWineJSDispatch *iface, DISPID id, UINT32 *ret) { jsdisp_t *This = impl_from_IWineJSDispatch(iface); - dispex_prop_t *prop = get_prop(This, id); - if(!prop || prop->type == PROP_DELETED || prop->type == PROP_PROTREF) + switch(prop_kind(This, id)) { + case DISPEX_PROP: { + dispex_prop_t *prop = &This->props[prop_id_to_idx(id)]; + + if(prop->type == PROP_PROTREF) + return DISP_E_MEMBERNOTFOUND; + *ret = prop->flags & PROPF_PUBLIC_MASK; + break; + } + default: return DISP_E_MEMBERNOTFOUND; + } - *ret = prop->flags & PROPF_PUBLIC_MASK; return S_OK; } @@ -2546,7 +2558,7 @@ HRESULT init_dispex_from_constr(jsdisp_t *dispex, script_ctx_t *ctx, const built if(hres == S_OK) { jsval_t val; - hres = prop_get(constr, to_disp(constr), &constr->props[prop_id_to_idx(id)], &val); + hres = prop_get(constr, to_disp(constr), id, &val); if(FAILED(hres)) { ERR("Could not get prototype\n"); return hres; @@ -2624,13 +2636,10 @@ HRESULT jsdisp_call_value(jsdisp_t *jsfunc, jsval_t vthis, WORD flags, unsigned HRESULT jsdisp_call(jsdisp_t *disp, DISPID id, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { - dispex_prop_t *prop; - - prop = get_prop(disp, id); - if(!prop) + if(prop_kind(disp, id) == INVALID_PROP) return DISP_E_MEMBERNOTFOUND; - return invoke_prop_func(disp, to_disp(disp), prop, flags, argc, argv, r, &disp->ctx->jscaller->IServiceProvider_iface); + return invoke_prop_func(disp, to_disp(disp), id, flags, argc, argv, r, &disp->ctx->jscaller->IServiceProvider_iface); } HRESULT jsdisp_call_name(jsdisp_t *disp, const WCHAR *name, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) @@ -2642,7 +2651,7 @@ HRESULT jsdisp_call_name(jsdisp_t *disp, const WCHAR *name, WORD flags, unsigned if(hres != S_OK) return FAILED(hres) ? hres : JS_E_INVALID_PROPERTY; - return invoke_prop_func(disp, to_disp(disp), &disp->props[prop_id_to_idx(id)], flags, argc, argv, r, &disp->ctx->jscaller->IServiceProvider_iface); + return invoke_prop_func(disp, to_disp(disp), id, flags, argc, argv, r, &disp->ctx->jscaller->IServiceProvider_iface); } static HRESULT disp_invoke(script_ctx_t *ctx, IDispatch *disp, DISPID id, WORD flags, DISPPARAMS *params, VARIANT *r, @@ -2871,7 +2880,7 @@ HRESULT jsdisp_propput(jsdisp_t *obj, const WCHAR *name, DWORD flags, BOOL throw if(hres != S_OK && (!id || !obj->extensible)) return throw ? JS_E_INVALID_ACTION : S_OK; - return prop_put(obj, &obj->props[prop_id_to_idx(id)], val); + return prop_put(obj, id, val); } HRESULT jsdisp_propput_name(jsdisp_t *obj, const WCHAR *name, jsval_t val) @@ -2894,11 +2903,8 @@ HRESULT disp_propput(script_ctx_t *ctx, IDispatch *disp, DISPID id, jsval_t val) jsdisp = iface_to_jsdisp(disp); if(jsdisp && jsdisp->ctx == ctx) { - dispex_prop_t *prop; - - prop = get_prop(jsdisp, id); - if(prop) - hres = prop_put(jsdisp, prop, val); + if(prop_kind(jsdisp, id) != INVALID_PROP) + hres = prop_put(jsdisp, id, val); else hres = DISP_E_MEMBERNOTFOUND; @@ -2975,7 +2981,7 @@ HRESULT jsdisp_propget_name(jsdisp_t *obj, const WCHAR *name, jsval_t *val) return S_OK; } - return prop_get(obj, to_disp(obj), &obj->props[prop_id_to_idx(id)], val); + return prop_get(obj, to_disp(obj), id, val); } HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r) @@ -2995,18 +3001,15 @@ HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r) return DISP_E_UNKNOWNNAME; } - return prop_get(obj, to_disp(obj), &obj->props[prop_id_to_idx(id)], r); + return prop_get(obj, to_disp(obj), id, r); } HRESULT jsdisp_propget(jsdisp_t *jsdisp, DISPID id, jsval_t *val) { - dispex_prop_t *prop; - - prop = get_prop(jsdisp, id); - if(!prop) + if(prop_kind(jsdisp, id) == INVALID_PROP) return DISP_E_MEMBERNOTFOUND; - return prop_get(jsdisp, to_disp(jsdisp), prop, val); + return prop_get(jsdisp, to_disp(jsdisp), id, val); } HRESULT disp_propget(script_ctx_t *ctx, IDispatch *disp, DISPID id, jsval_t *val) @@ -3061,11 +3064,8 @@ HRESULT disp_delete(IDispatch *disp, DISPID id, BOOL *ret) jsdisp = iface_to_jsdisp(disp); if(jsdisp) { - dispex_prop_t *prop; - - prop = get_prop(jsdisp, id); - if(prop) - hres = delete_prop(jsdisp, prop_to_id(jsdisp, prop), ret); + if(prop_kind(jsdisp, id) != INVALID_PROP) + hres = delete_prop(jsdisp, id, ret); else hres = DISP_E_MEMBERNOTFOUND; @@ -3231,7 +3231,7 @@ HRESULT jsdisp_get_own_property(jsdisp_t *obj, const WCHAR *name, BOOL flags_onl desc->mask |= PROPF_WRITABLE; desc->explicit_value = TRUE; if(!flags_only) { - hres = prop_get(obj, to_disp(obj), prop, &desc->value); + hres = prop_get(obj, to_disp(obj), id, &desc->value); if(FAILED(hres)) return hres; } @@ -3474,12 +3474,17 @@ BOOL jsdisp_is_frozen(jsdisp_t *obj, BOOL sealed) HRESULT jsdisp_get_prop_name(jsdisp_t *obj, DISPID id, jsstr_t **r) { - dispex_prop_t *prop = get_prop(obj, id); + const WCHAR *name; - if(!prop) + switch(prop_kind(obj, id)) { + case DISPEX_PROP: + name = obj->props[prop_id_to_idx(id)].name; + break; + default: return DISP_E_MEMBERNOTFOUND; + } - *r = jsstr_alloc(prop->name); + *r = jsstr_alloc(name); return *r ? S_OK : E_OUTOFMEMORY; } @@ -3657,7 +3662,7 @@ HRESULT fill_globals(script_ctx_t *ctx, IWineJSDispatchHost *script_global) if(FAILED(hres)) return hres; - hres = IWineJSDispatchHost_LookupProperty(script_global, get_prop(global, id)->name, fdexNameCaseSensitive, &desc); + hres = IWineJSDispatchHost_LookupProperty(script_global, global->props[prop_id_to_idx(id)].name, fdexNameCaseSensitive, &desc); if(FAILED(hres)) return hres; } From c4e524b79872373ecda4d0918227bd3d06eebe5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:06 +0200 Subject: [PATCH 1322/2542] jscript: Make prop_get method able to override and operate on all DISPIDs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- get_extern_prop_idx is temporary, until indexed props are implemented without prop storage. --- dlls/jscript/dispex.c | 38 ++++++++++++++++++++++++++++++-------- dlls/jscript/engine.c | 5 ++++- dlls/jscript/function.c | 6 +++++- dlls/jscript/jscript.h | 3 ++- dlls/jscript/string.c | 6 +++++- 5 files changed, 46 insertions(+), 12 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index cddff9cfd668..5315c494cebd 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -579,13 +579,23 @@ static HRESULT convert_params(script_ctx_t *ctx, const DISPPARAMS *dp, jsval_t * static HRESULT prop_get(jsdisp_t *This, IDispatch *jsthis, DISPID id, jsval_t *r) { - dispex_prop_t *prop = &This->props[prop_id_to_idx(id)]; jsdisp_t *prop_obj = This; + dispex_prop_t *prop; HRESULT hres; - while(prop->type == PROP_PROTREF) { + for(;;) { + if(prop_obj->builtin_info->prop_get) { + hres = prop_obj->builtin_info->prop_get(prop_obj, id, r); + if(hres != S_FALSE) + return hres; + } + + prop = &prop_obj->props[prop_id_to_idx(id)]; + if(prop->type != PROP_PROTREF) + break; + prop_obj = prop_obj->prototype; - prop = prop_obj->props + prop->u.ref; + id = prop->u.ref + 1; } switch(prop->type) { @@ -604,11 +614,9 @@ static HRESULT prop_get(jsdisp_t *This, IDispatch *jsthis, DISPID id, jsval_t *r hres = S_OK; } break; - case PROP_EXTERN: - hres = prop_obj->builtin_info->prop_get(prop_obj, prop->u.id, r); - break; default: ERR("type %d\n", prop->type); + assert(0); return E_FAIL; } @@ -3517,15 +3525,19 @@ static HRESULT HostObject_lookup_prop(jsdisp_t *jsdisp, const WCHAR *name, unsig return IWineJSDispatchHost_LookupProperty(This->host_iface, name, flags, desc); } -static HRESULT HostObject_prop_get(jsdisp_t *jsdisp, unsigned idx, jsval_t *r) +static HRESULT HostObject_prop_get(jsdisp_t *jsdisp, DISPID id, jsval_t *r) { + dispex_prop_t *prop = &jsdisp->props[prop_id_to_idx(id)]; HostObject *This = HostObject_from_jsdisp(jsdisp); EXCEPINFO ei = { 0 }; VARIANT v; HRESULT hres; + if(prop->type != PROP_EXTERN) + return S_FALSE; + V_VT(&v) = VT_EMPTY; - hres = IWineJSDispatchHost_GetProperty(This->host_iface, idx, jsdisp->ctx->lcid, &v, &ei, + hres = IWineJSDispatchHost_GetProperty(This->host_iface, prop->u.id, jsdisp->ctx->lcid, &v, &ei, &jsdisp->ctx->jscaller->IServiceProvider_iface); if(hres == DISP_E_EXCEPTION) handle_dispatch_exception(jsdisp->ctx, &ei); @@ -3669,3 +3681,13 @@ HRESULT fill_globals(script_ctx_t *ctx, IWineJSDispatchHost *script_global) return S_OK; } + +BOOL get_extern_prop_idx(jsdisp_t *jsdisp, DISPID id, unsigned *ret) +{ + dispex_prop_t *prop = &jsdisp->props[prop_id_to_idx(id)]; + + if(prop->type != PROP_EXTERN) + return FALSE; + *ret = prop->u.id; + return TRUE; +} diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 243b922c8f14..b308d1254a7b 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -497,10 +497,13 @@ static HRESULT scope_lookup_prop(jsdisp_t *jsdisp, const WCHAR *name, unsigned f return jsdisp_index_lookup(&scope->dispex, name, scope->detached_vars->argc, desc); } -static HRESULT scope_prop_get(jsdisp_t *dispex, unsigned idx, jsval_t *r) +static HRESULT scope_prop_get(jsdisp_t *dispex, DISPID id, jsval_t *r) { scope_chain_t *scope = scope_from_dispex(dispex); + unsigned idx; + if(!get_extern_prop_idx(dispex, id, &idx)) + return S_FALSE; return jsval_copy(scope->detached_vars->var[idx], r); } diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index bdc8834be41f..ab93e9f13e9c 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -145,9 +145,13 @@ static jsval_t *get_argument_ref(ArgumentsInstance *arguments, unsigned idx) return arguments->scope->detached_vars->var + idx; } -static HRESULT Arguments_prop_get(jsdisp_t *jsdisp, unsigned idx, jsval_t *r) +static HRESULT Arguments_prop_get(jsdisp_t *jsdisp, DISPID id, jsval_t *r) { ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); + unsigned idx; + + if(!get_extern_prop_idx(jsdisp, id, &idx)) + return S_FALSE; TRACE("%p[%u]\n", arguments, idx); diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index e8fe3d1d3b1a..c3597eb423c8 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -184,7 +184,7 @@ typedef struct { ULONG (*release)(jsdisp_t*); void (*on_put)(jsdisp_t*,const WCHAR*); HRESULT (*lookup_prop)(jsdisp_t*,const WCHAR*,unsigned,struct property_info*); - HRESULT (*prop_get)(jsdisp_t*,unsigned,jsval_t*); + HRESULT (*prop_get)(jsdisp_t*,DISPID,jsval_t*); HRESULT (*prop_put)(jsdisp_t*,unsigned,jsval_t); HRESULT (*prop_delete)(jsdisp_t*,unsigned); HRESULT (*prop_config)(jsdisp_t*,unsigned,unsigned); @@ -233,6 +233,7 @@ static inline BOOL is_dispex_prop_id(DISPID id) jsdisp_t *as_jsdisp(IDispatch*); jsdisp_t *to_jsdisp(IDispatch*); IWineJSDispatchHost *get_host_dispatch(IDispatch*); +BOOL get_extern_prop_idx(jsdisp_t*,DISPID,unsigned*); jsdisp_t *jsdisp_addref(jsdisp_t*); ULONG jsdisp_release(jsdisp_t*); diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index 42a2c697fbc4..cc9af0956ec2 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -1517,11 +1517,15 @@ static HRESULT String_lookup_prop(jsdisp_t *jsdisp, const WCHAR *name, unsigned return jsdisp_index_lookup(&string->dispex, name, jsstr_length(string->str), desc); } -static HRESULT String_prop_get(jsdisp_t *jsdisp, unsigned idx, jsval_t *r) +static HRESULT String_prop_get(jsdisp_t *jsdisp, DISPID id, jsval_t *r) { StringInstance *string = string_from_jsdisp(jsdisp); + unsigned idx; jsstr_t *ret; + if(!get_extern_prop_idx(jsdisp, id, &idx)) + return S_FALSE; + ret = jsstr_substr(string->str, idx, 1); if(!ret) return E_OUTOFMEMORY; From fced89577a93e271a9843ffeefc2da26dfe3f9ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:06 +0200 Subject: [PATCH 1323/2542] jscript: Make prop_put method able to override and operate on all DISPIDs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/dispex.c | 55 ++++++++++++++++++++++------------------- dlls/jscript/engine.c | 8 ++++-- dlls/jscript/function.c | 10 +++++--- dlls/jscript/jscript.h | 6 ++--- dlls/jscript/string.c | 14 +++++++++-- 5 files changed, 57 insertions(+), 36 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 5315c494cebd..2d30486b2493 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -503,7 +503,7 @@ static HRESULT ensure_prop_name(jsdisp_t *This, const WCHAR *name, DWORD create_ return S_OK; } -HRESULT jsdisp_index_lookup(jsdisp_t *obj, const WCHAR *name, unsigned length, struct property_info *desc) +HRESULT jsdisp_index_lookup(jsdisp_t *obj, const WCHAR *name, unsigned length, unsigned flags, struct property_info *desc) { const WCHAR *ptr; unsigned idx = 0; @@ -517,9 +517,7 @@ HRESULT jsdisp_index_lookup(jsdisp_t *obj, const WCHAR *name, unsigned length, s return DISP_E_UNKNOWNNAME; desc->id = idx; - desc->flags = PROPF_ENUMERABLE; - if(obj->builtin_info->prop_put) - desc->flags |= PROPF_WRITABLE; + desc->flags = flags; desc->name = NULL; desc->index = idx; desc->prototype_id = 0; @@ -631,9 +629,16 @@ static HRESULT prop_get(jsdisp_t *This, IDispatch *jsthis, DISPID id, jsval_t *r static HRESULT prop_put(jsdisp_t *This, DISPID id, jsval_t val) { - dispex_prop_t *prop = &This->props[prop_id_to_idx(id)]; + dispex_prop_t *prop; HRESULT hres; + if(This->builtin_info->prop_put) { + hres = This->builtin_info->prop_put(This, id, val); + if(hres != S_FALSE) + return hres; + } + + prop = &This->props[prop_id_to_idx(id)]; if(prop->type == PROP_PROTREF) { dispex_prop_t *prop_iter = prop; jsdisp_t *prototype_iter = This; @@ -674,22 +679,9 @@ static HRESULT prop_put(jsdisp_t *This, DISPID id, jsval_t val) return S_OK; } return jsdisp_call_value(prop->u.accessor.setter, jsval_obj(This), DISPATCH_METHOD, 1, &val, NULL); - case PROP_EXTERN: - if(!This->builtin_info->prop_put) { - TRACE("no prop_put\n"); - return S_OK; - } - if(!(prop->flags & PROPF_WRITABLE)) - return S_OK; - hres = This->builtin_info->prop_put(This, prop->u.id, val); - if(hres != S_FALSE) - return hres; - prop->type = PROP_JSVAL; - prop->flags = PROPF_ENUMERABLE | PROPF_CONFIGURABLE | PROPF_WRITABLE; - prop->u.val = jsval_undefined(); - break; default: ERR("type %d\n", prop->type); + assert(0); return E_FAIL; } @@ -3096,14 +3088,12 @@ HRESULT disp_delete(IDispatch *disp, DISPID id, BOOL *ret) return S_OK; } -HRESULT jsdisp_fill_indices(jsdisp_t *obj, unsigned length) +HRESULT jsdisp_fill_indices(jsdisp_t *obj, unsigned length, unsigned flags) { struct property_info desc; HRESULT hres; - desc.flags = PROPF_ENUMERABLE; - if(obj->builtin_info->prop_put) - desc.flags |= PROPF_WRITABLE; + desc.flags = flags; desc.name = NULL; desc.prototype_id = 0; @@ -3549,23 +3539,36 @@ static HRESULT HostObject_prop_get(jsdisp_t *jsdisp, DISPID id, jsval_t *r) return hres; } -static HRESULT HostObject_prop_put(jsdisp_t *jsdisp, unsigned idx, jsval_t v) +static HRESULT HostObject_prop_put(jsdisp_t *jsdisp, DISPID id, jsval_t v) { + dispex_prop_t *prop = &jsdisp->props[prop_id_to_idx(id)]; HostObject *This = HostObject_from_jsdisp(jsdisp); EXCEPINFO ei = { 0 }; VARIANT var; HRESULT hres; + if(prop->type != PROP_EXTERN) + return S_FALSE; + + if(!(prop->flags & PROPF_WRITABLE)) + return S_OK; + hres = jsval_to_variant(v, &var); if(FAILED(hres)) return hres; - hres = IWineJSDispatchHost_SetProperty(This->host_iface, idx, jsdisp->ctx->lcid, &var, &ei, + hres = IWineJSDispatchHost_SetProperty(This->host_iface, prop->u.id, jsdisp->ctx->lcid, &var, &ei, &jsdisp->ctx->jscaller->IServiceProvider_iface); if(hres == DISP_E_EXCEPTION) handle_dispatch_exception(jsdisp->ctx, &ei); VariantClear(&var); - return hres; + if(hres != S_FALSE) + return hres; + + prop->type = PROP_JSVAL; + prop->flags = PROPF_ENUMERABLE | PROPF_CONFIGURABLE | PROPF_WRITABLE; + prop->u.val = jsval_undefined(); + return jsval_copy(v, &prop->u.val); } static HRESULT HostObject_prop_delete(jsdisp_t *jsdisp, unsigned id) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index b308d1254a7b..f7b1d455ca5c 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -494,7 +494,7 @@ static HRESULT scope_lookup_prop(jsdisp_t *jsdisp, const WCHAR *name, unsigned f { scope_chain_t *scope = scope_from_dispex(jsdisp); - return jsdisp_index_lookup(&scope->dispex, name, scope->detached_vars->argc, desc); + return jsdisp_index_lookup(&scope->dispex, name, scope->detached_vars->argc, PROPF_ENUMERABLE | PROPF_WRITABLE, desc); } static HRESULT scope_prop_get(jsdisp_t *dispex, DISPID id, jsval_t *r) @@ -507,12 +507,16 @@ static HRESULT scope_prop_get(jsdisp_t *dispex, DISPID id, jsval_t *r) return jsval_copy(scope->detached_vars->var[idx], r); } -static HRESULT scope_prop_put(jsdisp_t *dispex, unsigned idx, jsval_t val) +static HRESULT scope_prop_put(jsdisp_t *dispex, DISPID id, jsval_t val) { scope_chain_t *scope = scope_from_dispex(dispex); jsval_t copy, *ref; + unsigned idx; HRESULT hres; + if(!get_extern_prop_idx(dispex, id, &idx)) + return S_FALSE; + hres = jsval_copy(val, ©); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index ab93e9f13e9c..b6e109bdd2aa 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -133,7 +133,7 @@ static void Arguments_destructor(jsdisp_t *jsdisp) static HRESULT Arguments_lookup_prop(jsdisp_t *jsdisp, const WCHAR *name, unsigned flags, struct property_info *desc) { ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); - return jsdisp_index_lookup(&arguments->jsdisp, name, arguments->argc, desc); + return jsdisp_index_lookup(&arguments->jsdisp, name, arguments->argc, PROPF_ENUMERABLE | PROPF_WRITABLE, desc); } static jsval_t *get_argument_ref(ArgumentsInstance *arguments, unsigned idx) @@ -158,12 +158,16 @@ static HRESULT Arguments_prop_get(jsdisp_t *jsdisp, DISPID id, jsval_t *r) return jsval_copy(*get_argument_ref(arguments, idx), r); } -static HRESULT Arguments_prop_put(jsdisp_t *jsdisp, unsigned idx, jsval_t val) +static HRESULT Arguments_prop_put(jsdisp_t *jsdisp, DISPID id, jsval_t val) { ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); jsval_t copy, *ref; + unsigned idx; HRESULT hres; + if(!get_extern_prop_idx(jsdisp, id, &idx)) + return S_FALSE; + TRACE("%p[%u] = %s\n", arguments, idx, debugstr_jsval(val)); hres = jsval_copy(val, ©); @@ -179,7 +183,7 @@ static HRESULT Arguments_prop_put(jsdisp_t *jsdisp, unsigned idx, jsval_t val) static HRESULT Arguments_fill_props(jsdisp_t *jsdisp) { ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); - return jsdisp_fill_indices(&arguments->jsdisp, arguments->argc); + return jsdisp_fill_indices(&arguments->jsdisp, arguments->argc, PROPF_ENUMERABLE | PROPF_WRITABLE); } static HRESULT Arguments_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op op, jsdisp_t *jsdisp) diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index c3597eb423c8..aa40b3804a05 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -185,7 +185,7 @@ typedef struct { void (*on_put)(jsdisp_t*,const WCHAR*); HRESULT (*lookup_prop)(jsdisp_t*,const WCHAR*,unsigned,struct property_info*); HRESULT (*prop_get)(jsdisp_t*,DISPID,jsval_t*); - HRESULT (*prop_put)(jsdisp_t*,unsigned,jsval_t); + HRESULT (*prop_put)(jsdisp_t*,DISPID,jsval_t); HRESULT (*prop_delete)(jsdisp_t*,unsigned); HRESULT (*prop_config)(jsdisp_t*,unsigned,unsigned); HRESULT (*fill_props)(jsdisp_t*); @@ -270,8 +270,8 @@ HRESULT jsdisp_get_id(jsdisp_t*,const WCHAR*,DWORD,DISPID*); HRESULT jsdisp_get_idx_id(jsdisp_t*,DWORD,DISPID*); HRESULT disp_delete(IDispatch*,DISPID,BOOL*); HRESULT disp_delete_name(script_ctx_t*,IDispatch*,jsstr_t*,BOOL*); -HRESULT jsdisp_index_lookup(jsdisp_t*,const WCHAR*,unsigned,struct property_info*); -HRESULT jsdisp_fill_indices(jsdisp_t*,unsigned); +HRESULT jsdisp_index_lookup(jsdisp_t*,const WCHAR*,unsigned,unsigned,struct property_info*); +HRESULT jsdisp_fill_indices(jsdisp_t*,unsigned,unsigned); HRESULT jsdisp_delete_idx(jsdisp_t*,DWORD); HRESULT jsdisp_get_own_property(jsdisp_t*,const WCHAR*,BOOL,property_desc_t*); HRESULT jsdisp_define_property(jsdisp_t*,const WCHAR*,property_desc_t*); diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index cc9af0956ec2..b64a28c90b39 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -1514,7 +1514,7 @@ static HRESULT String_lookup_prop(jsdisp_t *jsdisp, const WCHAR *name, unsigned if(string->dispex.ctx->version < 2) return DISP_E_UNKNOWNNAME; - return jsdisp_index_lookup(&string->dispex, name, jsstr_length(string->str), desc); + return jsdisp_index_lookup(&string->dispex, name, jsstr_length(string->str), PROPF_ENUMERABLE, desc); } static HRESULT String_prop_get(jsdisp_t *jsdisp, DISPID id, jsval_t *r) @@ -1536,6 +1536,15 @@ static HRESULT String_prop_get(jsdisp_t *jsdisp, DISPID id, jsval_t *r) return S_OK; } +static HRESULT String_prop_put(jsdisp_t *jsdisp, DISPID id, jsval_t val) +{ + unsigned idx; + + if(!get_extern_prop_idx(jsdisp, id, &idx)) + return S_FALSE; + return S_OK; +} + static HRESULT String_fill_props(jsdisp_t *jsdisp) { StringInstance *string = string_from_jsdisp(jsdisp); @@ -1543,7 +1552,7 @@ static HRESULT String_fill_props(jsdisp_t *jsdisp) if(string->dispex.ctx->version < 2) return S_OK; - return jsdisp_fill_indices(&string->dispex, jsstr_length(string->str)); + return jsdisp_fill_indices(&string->dispex, jsstr_length(string->str), PROPF_ENUMERABLE); } static const builtin_prop_t String_props[] = { @@ -1601,6 +1610,7 @@ static const builtin_info_t StringInst_info = { .destructor = String_destructor, .lookup_prop = String_lookup_prop, .prop_get = String_prop_get, + .prop_put = String_prop_put, .fill_props = String_fill_props, }; From 68e8f1b199e14f0a1c053e8c70ec117dc5e8755d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:06 +0200 Subject: [PATCH 1324/2542] jscript: Make prop_delete method able to override and operate on all DISPIDs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/dispex.c | 52 +++++++++++++++++++++++++----------------- dlls/jscript/jscript.h | 2 +- 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 2d30486b2493..2fce9846434a 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -2261,8 +2261,18 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IWineJSDispatch *iface, DISPID id, LCI static HRESULT delete_prop(jsdisp_t *obj, DISPID id, BOOL *ret) { - dispex_prop_t *prop = &obj->props[prop_id_to_idx(id)]; + dispex_prop_t *prop; + HRESULT hres; + + if(obj->builtin_info->prop_delete) { + hres = obj->builtin_info->prop_delete(obj, id); + if(hres != S_FALSE) { + *ret = TRUE; + return hres; + } + } + prop = &obj->props[prop_id_to_idx(id)]; if(prop->type == PROP_PROTREF || prop->type == PROP_DELETED) { *ret = TRUE; return S_OK; @@ -2285,14 +2295,6 @@ static HRESULT delete_prop(jsdisp_t *obj, DISPID id, BOOL *ret) if(prop->u.accessor.setter) jsdisp_release(prop->u.accessor.setter); break; - case PROP_EXTERN: - if(obj->builtin_info->prop_delete) { - HRESULT hres; - hres = obj->builtin_info->prop_delete(obj, prop->u.id); - if(FAILED(hres)) - return hres; - } - break; default: break; } @@ -3337,16 +3339,16 @@ HRESULT jsdisp_define_property(jsdisp_t *obj, const WCHAR *name, property_desc_t } } if(desc->explicit_value) { - if(prop->type == PROP_JSVAL) - jsval_release(prop->u.val); - else { - if(prop->type == PROP_EXTERN && obj->builtin_info->prop_delete) { - hres = obj->builtin_info->prop_delete(obj, prop->u.id); - if(FAILED(hres)) - return hres; - } - prop->type = PROP_JSVAL; - } + DWORD flags = prop->flags; + BOOL tmp; + + prop->flags |= PROPF_CONFIGURABLE; + hres = delete_prop(obj, prop_to_id(obj, prop), &tmp); + prop->flags = flags; + if(FAILED(hres)) + return hres; + + prop->type = PROP_JSVAL; hres = jsval_copy(desc->value, &prop->u.val); if(FAILED(hres)) { prop->u.val = jsval_undefined(); @@ -3571,11 +3573,19 @@ static HRESULT HostObject_prop_put(jsdisp_t *jsdisp, DISPID id, jsval_t v) return jsval_copy(v, &prop->u.val); } -static HRESULT HostObject_prop_delete(jsdisp_t *jsdisp, unsigned id) +static HRESULT HostObject_prop_delete(jsdisp_t *jsdisp, DISPID id) { + dispex_prop_t *prop = &jsdisp->props[prop_id_to_idx(id)]; HostObject *This = HostObject_from_jsdisp(jsdisp); + HRESULT hres; + + if(prop->type != PROP_EXTERN || !(prop->flags & PROPF_CONFIGURABLE)) + return S_FALSE; - return IWineJSDispatchHost_DeleteProperty(This->host_iface, id); + hres = IWineJSDispatchHost_DeleteProperty(This->host_iface, prop->u.id); + if(SUCCEEDED(hres)) + prop->type = PROP_DELETED; + return hres; } static HRESULT HostObject_prop_config(jsdisp_t *jsdisp, unsigned id, unsigned flags) diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index aa40b3804a05..ba7eb3ab6900 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -186,7 +186,7 @@ typedef struct { HRESULT (*lookup_prop)(jsdisp_t*,const WCHAR*,unsigned,struct property_info*); HRESULT (*prop_get)(jsdisp_t*,DISPID,jsval_t*); HRESULT (*prop_put)(jsdisp_t*,DISPID,jsval_t); - HRESULT (*prop_delete)(jsdisp_t*,unsigned); + HRESULT (*prop_delete)(jsdisp_t*,DISPID); HRESULT (*prop_config)(jsdisp_t*,unsigned,unsigned); HRESULT (*fill_props)(jsdisp_t*); HRESULT (*to_string)(jsdisp_t*,jsstr_t**); From f820052ccf334cd76c2789dca55fd53c7eb9274b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:06 +0200 Subject: [PATCH 1325/2542] jscript: Introduce prop_get_desc method to override descriptor retrieval by DISPID. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/dispex.c | 54 ++++++++++++++++++++++++++++++------------ dlls/jscript/engine.c | 29 ++++++++++++++++++----- dlls/jscript/jscript.h | 1 + dlls/jscript/string.c | 33 +++++++++++++++++++------- 4 files changed, 88 insertions(+), 29 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 2fce9846434a..09c9017a2b9f 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -3220,15 +3220,21 @@ HRESULT jsdisp_get_own_property(jsdisp_t *obj, const WCHAR *name, BOOL flags_onl if(hres != S_OK) return DISP_E_UNKNOWNNAME; - prop = &obj->props[prop_id_to_idx(id)]; - memset(desc, 0, sizeof(*desc)); + desc->mask = PROPF_ENUMERABLE | PROPF_WRITABLE | PROPF_CONFIGURABLE; + if(obj->builtin_info->prop_get_desc) { + hres = obj->builtin_info->prop_get_desc(obj, id, flags_only, desc); + if(hres != S_FALSE) { + desc->explicit_value = TRUE; + return hres; + } + } + + prop = &obj->props[prop_id_to_idx(id)]; switch(prop->type) { case PROP_BUILTIN: case PROP_JSVAL: - case PROP_EXTERN: - desc->mask |= PROPF_WRITABLE; desc->explicit_value = TRUE; if(!flags_only) { hres = prop_get(obj, to_disp(obj), id, &desc->value); @@ -3237,6 +3243,7 @@ HRESULT jsdisp_get_own_property(jsdisp_t *obj, const WCHAR *name, BOOL flags_onl } break; case PROP_ACCESSOR: + desc->mask = PROPF_ENUMERABLE | PROPF_CONFIGURABLE; desc->explicit_getter = desc->explicit_setter = TRUE; if(!flags_only) { desc->getter = prop->u.accessor.getter @@ -3250,7 +3257,6 @@ HRESULT jsdisp_get_own_property(jsdisp_t *obj, const WCHAR *name, BOOL flags_onl } desc->flags = prop->flags & (PROPF_ENUMERABLE | PROPF_WRITABLE | PROPF_CONFIGURABLE); - desc->mask |= PROPF_ENUMERABLE | PROPF_CONFIGURABLE; return S_OK; } @@ -3588,6 +3594,23 @@ static HRESULT HostObject_prop_delete(jsdisp_t *jsdisp, DISPID id) return hres; } +static HRESULT HostObject_prop_get_desc(jsdisp_t *jsdisp, DISPID id, BOOL flags_only, property_desc_t *desc) +{ + dispex_prop_t *prop = &jsdisp->props[prop_id_to_idx(id)]; + + if(prop->type != PROP_EXTERN) + return S_FALSE; + + if(!flags_only) { + HRESULT hres = HostObject_prop_get(jsdisp, id, &desc->value); + if(hres != S_OK) + return hres; + } + + desc->flags = prop->flags & (PROPF_ENUMERABLE | PROPF_WRITABLE | PROPF_CONFIGURABLE); + return S_OK; +} + static HRESULT HostObject_prop_config(jsdisp_t *jsdisp, unsigned id, unsigned flags) { HostObject *This = HostObject_from_jsdisp(jsdisp); @@ -3618,16 +3641,17 @@ static HRESULT HostObject_to_string(jsdisp_t *jsdisp, jsstr_t **ret) } static const builtin_info_t HostObject_info = { - .class = JSCLASS_HOST, - .addref = HostObject_addref, - .release = HostObject_release, - .lookup_prop = HostObject_lookup_prop, - .prop_get = HostObject_prop_get, - .prop_put = HostObject_prop_put, - .prop_delete = HostObject_prop_delete, - .prop_config = HostObject_prop_config, - .fill_props = HostObject_fill_props, - .to_string = HostObject_to_string, + .class = JSCLASS_HOST, + .addref = HostObject_addref, + .release = HostObject_release, + .lookup_prop = HostObject_lookup_prop, + .prop_get = HostObject_prop_get, + .prop_put = HostObject_prop_put, + .prop_delete = HostObject_prop_delete, + .prop_get_desc = HostObject_prop_get_desc, + .prop_config = HostObject_prop_config, + .fill_props = HostObject_fill_props, + .to_string = HostObject_to_string, }; HRESULT init_host_object(script_ctx_t *ctx, IWineJSDispatchHost *host_iface, IWineJSDispatch *prototype_iface, diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index f7b1d455ca5c..143612c39889 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -527,6 +527,22 @@ static HRESULT scope_prop_put(jsdisp_t *dispex, DISPID id, jsval_t val) return S_OK; } +static HRESULT scope_prop_get_desc(jsdisp_t *dispex, DISPID id, BOOL flags_only, property_desc_t *desc) +{ + unsigned idx; + + if(!flags_only) { + HRESULT hres = scope_prop_get(dispex, id, &desc->value); + if(hres != S_OK) + return hres; + }else if(!get_extern_prop_idx(dispex, id, &idx)) { + return S_FALSE; + } + + desc->flags = PROPF_ENUMERABLE | PROPF_WRITABLE; + return S_OK; +} + static HRESULT scope_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op op, jsdisp_t *dispex) { scope_chain_t *scope = scope_from_dispex(dispex); @@ -563,12 +579,13 @@ static HRESULT scope_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op op, } static const builtin_info_t scope_info = { - JSCLASS_NONE, - .destructor = scope_destructor, - .lookup_prop = scope_lookup_prop, - .prop_get = scope_prop_get, - .prop_put = scope_prop_put, - .gc_traverse = scope_gc_traverse + .class = JSCLASS_NONE, + .destructor = scope_destructor, + .lookup_prop = scope_lookup_prop, + .prop_get = scope_prop_get, + .prop_put = scope_prop_put, + .prop_get_desc = scope_prop_get_desc, + .gc_traverse = scope_gc_traverse }; static HRESULT scope_push(script_ctx_t *ctx, scope_chain_t *scope, IDispatch *obj, scope_chain_t **ret) diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index ba7eb3ab6900..8f110d666863 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -187,6 +187,7 @@ typedef struct { HRESULT (*prop_get)(jsdisp_t*,DISPID,jsval_t*); HRESULT (*prop_put)(jsdisp_t*,DISPID,jsval_t); HRESULT (*prop_delete)(jsdisp_t*,DISPID); + HRESULT (*prop_get_desc)(jsdisp_t*,DISPID,BOOL,property_desc_t*); HRESULT (*prop_config)(jsdisp_t*,unsigned,unsigned); HRESULT (*fill_props)(jsdisp_t*); HRESULT (*to_string)(jsdisp_t*,jsstr_t**); diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index b64a28c90b39..93face9d78c8 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -1545,6 +1545,22 @@ static HRESULT String_prop_put(jsdisp_t *jsdisp, DISPID id, jsval_t val) return S_OK; } +static HRESULT String_prop_get_desc(jsdisp_t *jsdisp, DISPID id, BOOL flags_only, property_desc_t *desc) +{ + unsigned idx; + + if(!flags_only) { + HRESULT hres = String_prop_get(jsdisp, id, &desc->value); + if(hres != S_OK) + return hres; + }else if(!get_extern_prop_idx(jsdisp, id, &idx)) { + return S_FALSE; + } + + desc->flags = PROPF_ENUMERABLE; + return S_OK; +} + static HRESULT String_fill_props(jsdisp_t *jsdisp) { StringInstance *string = string_from_jsdisp(jsdisp); @@ -1604,14 +1620,15 @@ static const builtin_prop_t StringInst_props[] = { }; static const builtin_info_t StringInst_info = { - .class = JSCLASS_STRING, - .props_cnt = ARRAY_SIZE(StringInst_props), - .props = StringInst_props, - .destructor = String_destructor, - .lookup_prop = String_lookup_prop, - .prop_get = String_prop_get, - .prop_put = String_prop_put, - .fill_props = String_fill_props, + .class = JSCLASS_STRING, + .props_cnt = ARRAY_SIZE(StringInst_props), + .props = StringInst_props, + .destructor = String_destructor, + .lookup_prop = String_lookup_prop, + .prop_get = String_prop_get, + .prop_put = String_prop_put, + .prop_get_desc = String_prop_get_desc, + .fill_props = String_fill_props, }; /* ECMA-262 3rd Edition 15.5.3.2 */ From 0efa284115ea721992533469db6f3e2fde473acd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:06 +0200 Subject: [PATCH 1326/2542] jscript: Introduce prop_define method to override prop definition by DISPID. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- This is actually a no-op now, but is needed for indexed props change. --- dlls/jscript/dispex.c | 12 +++++- dlls/jscript/function.c | 92 +++++++++++++++++++++++++++++++--------- dlls/jscript/jscript.h | 1 + dlls/mshtml/tests/es5.js | 10 +++++ 4 files changed, 94 insertions(+), 21 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 09c9017a2b9f..93df27e3ae7d 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -3276,8 +3276,16 @@ HRESULT jsdisp_define_property(jsdisp_t *obj, const WCHAR *name, property_desc_t return throw_error(obj->ctx, JS_E_OBJECT_NONEXTENSIBLE, name); }else if(!obj->extensible) { return throw_error(obj->ctx, JS_E_OBJECT_NONEXTENSIBLE, name); - }else if(!(prop = alloc_prop(obj, name, PROP_DELETED, 0))) { - return E_OUTOFMEMORY; + }else { + if(!(prop = alloc_prop(obj, name, PROP_DELETED, 0))) + return E_OUTOFMEMORY; + id = prop_to_id(obj, prop); + } + + if(obj->builtin_info->prop_define) { + hres = obj->builtin_info->prop_define(obj, id, desc); + if(hres != S_FALSE) + return hres; } if(prop->type == PROP_DELETED || prop->type == PROP_PROTREF) { diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index b6e109bdd2aa..e0114f527d4e 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -81,6 +81,7 @@ typedef struct { jsval_t *buf; scope_chain_t *scope; unsigned argc; + BYTE readonly_flags[]; } ArgumentsInstance; static HRESULT create_bind_function(script_ctx_t*,FunctionInstance*,jsval_t,unsigned,jsval_t*,jsdisp_t**r); @@ -170,6 +171,9 @@ static HRESULT Arguments_prop_put(jsdisp_t *jsdisp, DISPID id, jsval_t val) TRACE("%p[%u] = %s\n", arguments, idx, debugstr_jsval(val)); + if(arguments->readonly_flags[idx / 8] & (1u << idx % 8)) + return S_OK; + hres = jsval_copy(val, ©); if(FAILED(hres)) return hres; @@ -180,6 +184,52 @@ static HRESULT Arguments_prop_put(jsdisp_t *jsdisp, DISPID id, jsval_t val) return S_OK; } +static HRESULT Arguments_prop_get_desc(jsdisp_t *jsdisp, DISPID id, BOOL flags_only, property_desc_t *desc) +{ + ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); + unsigned idx; + + if(!get_extern_prop_idx(jsdisp, id, &idx)) + return S_FALSE; + + if(!flags_only) { + HRESULT hres = Arguments_prop_get(jsdisp, id, &desc->value); + if(hres != S_OK) + return hres; + } + + desc->flags = PROPF_ENUMERABLE; + if(!(arguments->readonly_flags[idx / 8] & (1u << idx % 8))) + desc->flags |= PROPF_WRITABLE; + + return S_OK; +} + +static HRESULT Arguments_prop_define(jsdisp_t *jsdisp, DISPID id, const property_desc_t *desc) +{ + ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); + unsigned idx; + HRESULT hres; + + if(!get_extern_prop_idx(jsdisp, id, &idx)) + return S_FALSE; + + /* Need to keep track of props made read-only when going from writable to non-writable */ + if((desc->mask & PROPF_WRITABLE) && !(desc->flags & PROPF_WRITABLE) && !(arguments->readonly_flags[idx / 8] & (1u << idx % 8)) && + ((desc->mask & desc->flags & (PROPF_CONFIGURABLE | PROPF_ENUMERABLE)) == (desc->mask & PROPF_ENUMERABLE))) { + if(desc->explicit_value) { + hres = Arguments_prop_put(jsdisp, id, desc->value); + if(FAILED(hres)) + return hres; + } + arguments->readonly_flags[idx / 8] |= 1u << idx % 8; + return S_OK; + } + + /* Delegate the rest to the generic prop define */ + return S_FALSE; +} + static HRESULT Arguments_fill_props(jsdisp_t *jsdisp) { ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); @@ -241,27 +291,31 @@ static const builtin_prop_t Arguments_props[] = { }; static const builtin_info_t Arguments_info = { - .class = JSCLASS_ARGUMENTS, - .call = Arguments_value, - .props_cnt = ARRAY_SIZE(Arguments_props), - .props = Arguments_props, - .destructor = Arguments_destructor, - .lookup_prop = Arguments_lookup_prop, - .prop_get = Arguments_prop_get, - .prop_put = Arguments_prop_put, - .fill_props = Arguments_fill_props, - .gc_traverse = Arguments_gc_traverse + .class = JSCLASS_ARGUMENTS, + .call = Arguments_value, + .props_cnt = ARRAY_SIZE(Arguments_props), + .props = Arguments_props, + .destructor = Arguments_destructor, + .lookup_prop = Arguments_lookup_prop, + .prop_get = Arguments_prop_get, + .prop_put = Arguments_prop_put, + .prop_get_desc = Arguments_prop_get_desc, + .prop_define = Arguments_prop_define, + .fill_props = Arguments_fill_props, + .gc_traverse = Arguments_gc_traverse }; static const builtin_info_t Arguments_ES5_info = { - .class = JSCLASS_ARGUMENTS, - .call = Arguments_value, - .destructor = Arguments_destructor, - .lookup_prop = Arguments_lookup_prop, - .prop_get = Arguments_prop_get, - .prop_put = Arguments_prop_put, - .fill_props = Arguments_fill_props, - .gc_traverse = Arguments_gc_traverse + .class = JSCLASS_ARGUMENTS, + .call = Arguments_value, + .destructor = Arguments_destructor, + .lookup_prop = Arguments_lookup_prop, + .prop_get = Arguments_prop_get, + .prop_put = Arguments_prop_put, + .prop_get_desc = Arguments_prop_get_desc, + .prop_define = Arguments_prop_define, + .fill_props = Arguments_fill_props, + .gc_traverse = Arguments_gc_traverse }; HRESULT setup_arguments_object(script_ctx_t *ctx, call_frame_t *frame) @@ -269,7 +323,7 @@ HRESULT setup_arguments_object(script_ctx_t *ctx, call_frame_t *frame) ArgumentsInstance *args; HRESULT hres; - args = calloc(1, sizeof(*args)); + args = calloc(1, FIELD_OFFSET(ArgumentsInstance, readonly_flags[(frame->argc + 7) / 8])); if(!args) return E_OUTOFMEMORY; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 8f110d666863..8f11f9aa6d8a 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -188,6 +188,7 @@ typedef struct { HRESULT (*prop_put)(jsdisp_t*,DISPID,jsval_t); HRESULT (*prop_delete)(jsdisp_t*,DISPID); HRESULT (*prop_get_desc)(jsdisp_t*,DISPID,BOOL,property_desc_t*); + HRESULT (*prop_define)(jsdisp_t*,DISPID,const property_desc_t*); HRESULT (*prop_config)(jsdisp_t*,unsigned,unsigned); HRESULT (*fill_props)(jsdisp_t*); HRESULT (*to_string)(jsdisp_t*,jsstr_t**); diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index fdefc083c2c1..19c995314eb6 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -865,6 +865,16 @@ sync_test("defineProperty", function() { test_accessor_prop_desc(child.prototype, "funcprop_prot", desc); ok(obj.funcprop_prot(100) === 10, "obj.funcprop_prot() = " + obj.funcprop_prot(100)); + (function() { + ok(arguments.length === 3, "arguments.length = " + arguments.length); + ok(arguments[0] === 1, "arguments[0] = " + arguments[0]); + ok(arguments[1] === 2, "arguments[1] = " + arguments[1]); + ok(arguments[2] === 3, "arguments[2] = " + arguments[2]); + Object.defineProperty(arguments, "1", {value: "foobar", writable: false, enumerable: true, configurable: false}); + test_own_data_prop_desc(arguments, "1", false, true, false); + ok(arguments[1] === "foobar", "arguments[1] after defineProperty = " + arguments[1]); + })(1, 2, 3); + expect_exception(function() { Object.defineProperty(null, "funcprop", desc); }, JS_E_OBJECT_EXPECTED); From ea452cab597a9d4e08c189213225d868d7c36bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:06 +0200 Subject: [PATCH 1327/2542] jscript: Implement indexed properties without allocating PROP_EXTERN storage. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Other than just an optimization, this is also needed for Typed Arrays. Note that we assume a lot of things about indexed props which hold, such as them being non-configurable and always of fixed length, otherwise this would have been impossible. Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/dispex.c | 296 +++++++++++++++++++++++++--------------- dlls/jscript/engine.c | 24 ++-- dlls/jscript/function.c | 39 +++--- dlls/jscript/jscript.h | 19 ++- dlls/jscript/string.c | 36 ++--- 5 files changed, 237 insertions(+), 177 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 93df27e3ae7d..d138e22f9a76 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -33,6 +33,7 @@ static const GUID GUID_JScriptTypeInfo = {0xc59c6b12,0xf6c1,0x11cf,{0x88,0x35,0x typedef enum { INVALID_PROP, DISPEX_PROP, + INDEXED_PROP, } prop_kind_t; typedef enum { @@ -79,7 +80,12 @@ static void fix_protref_prop(jsdisp_t *jsdisp, dispex_prop_t *prop) ref = prop->u.ref; while((jsdisp = jsdisp->prototype)) { - if(ref >= jsdisp->prop_cnt || jsdisp->props[ref].type == PROP_DELETED) + if(ref >= jsdisp->prop_cnt) { + if(jsdisp->builtin_info->indexed_len && indexed_prop_id_to_idx(ref + 1) < jsdisp->builtin_info->indexed_len(jsdisp)) + return; + break; + } + if(jsdisp->props[ref].type == PROP_DELETED) break; if(jsdisp->props[ref].type != PROP_PROTREF) return; @@ -99,7 +105,7 @@ static inline prop_kind_t prop_kind(jsdisp_t *This, DISPID id) DWORD idx = prop_id_to_idx(id); if(idx >= This->prop_cnt) - return INVALID_PROP; + return This->builtin_info->indexed_len && indexed_prop_id_to_idx(id) < This->builtin_info->indexed_len(This) ? INDEXED_PROP : INVALID_PROP; fix_protref_prop(This, &This->props[idx]); if(This->props[idx].type == PROP_DELETED) @@ -127,6 +133,8 @@ static BOOL is_enumerable(jsdisp_t *This, dispex_prop_t *prop) if(prop->u.ref < This->prototype->prop_cnt) parent = &This->prototype->props[prop->u.ref]; + else if(This->prototype->builtin_info->indexed_len && indexed_prop_id_to_idx(prop->u.ref + 1) < This->prototype->builtin_info->indexed_len(This->prototype)) + return TRUE; if(!parent || parent->type == PROP_DELETED) { prop->type = PROP_DELETED; @@ -368,8 +376,23 @@ static HRESULT find_prop_name(jsdisp_t *This, unsigned hash, const WCHAR *name, const builtin_prop_t *builtin; HRESULT hres; - if(!prop) + if(!prop) { + if(This->builtin_info->indexed_len) { + unsigned idx = 0, len = This->builtin_info->indexed_len(This); + const WCHAR *ptr; + + for(ptr = name; is_digit(*ptr); ptr++) { + idx = idx * 10 + (*ptr - '0'); + if(idx >= len) + break; + } + if(idx < len && !*ptr) { + *ret = indexed_prop_idx_to_id(idx); + return S_OK; + } + } prop = lookup_dispex_prop(This, hash, name, case_insens); + } if(prop && prop->type != PROP_DELETED && prop->type != PROP_EXTERN) goto ret; @@ -430,8 +453,13 @@ static HRESULT find_prop_name_prot(jsdisp_t *This, unsigned hash, const WCHAR *n if(hres == S_OK) { if(own_prop->type != PROP_PROTREF) return S_OK; + if(is_indexed_prop_id(own_prop->u.ref + 1)) + goto ret; prot_prop = &This->prototype->props[own_prop->u.ref]; } + }else if(is_indexed_prop_id(*ret)) { + /* indexed props can't be PROTREFs or DELETED */ + return S_OK; } if(This->prototype) { @@ -441,20 +469,23 @@ static HRESULT find_prop_name_prot(jsdisp_t *This, unsigned hash, const WCHAR *n if(hres == S_OK) { DWORD ref = prop_id_to_idx(*ret); - prot_prop = &This->prototype->props[ref]; + if(is_dispex_prop_id(*ret)) { + prot_prop = &This->prototype->props[ref]; + name = prot_prop->name; - if(own_prop && case_insens && wcscmp(prot_prop->name, own_prop->name)) { - hres = find_prop_name(This, prot_prop->hash, prot_prop->name, FALSE, NULL, ret); - if(FAILED(hres)) - return hres; - if(hres == S_OK) - return S_OK; - own_prop = is_dispex_prop_id(*ret) ? &This->props[prop_id_to_idx(*ret)] : NULL; + if(own_prop && case_insens && wcscmp(name, own_prop->name)) { + hres = find_prop_name(This, prot_prop->hash, name, FALSE, NULL, ret); + if(FAILED(hres)) + return hres; + if(hres == S_OK) + return S_OK; + own_prop = is_dispex_prop_id(*ret) ? &This->props[prop_id_to_idx(*ret)] : NULL; + } } if(own_prop) { own_prop->type = PROP_PROTREF; own_prop->u.ref = ref; - }else if(!(own_prop = alloc_protref(This, prot_prop->name, ref))) { + }else if(!(own_prop = alloc_protref(This, name, ref))) { return E_OUTOFMEMORY; } }else if(own_prop) { @@ -467,6 +498,7 @@ static HRESULT find_prop_name_prot(jsdisp_t *This, unsigned hash, const WCHAR *n return S_FALSE; } +ret: *ret = prop_to_id(This, own_prop); return own_prop->type != PROP_DELETED ? S_OK : S_FALSE; } @@ -503,27 +535,6 @@ static HRESULT ensure_prop_name(jsdisp_t *This, const WCHAR *name, DWORD create_ return S_OK; } -HRESULT jsdisp_index_lookup(jsdisp_t *obj, const WCHAR *name, unsigned length, unsigned flags, struct property_info *desc) -{ - const WCHAR *ptr; - unsigned idx = 0; - - for(ptr = name; is_digit(*ptr); ptr++) { - idx = idx * 10 + (*ptr - '0'); - if (idx >= length) - return DISP_E_UNKNOWNNAME; - } - if(*ptr) - return DISP_E_UNKNOWNNAME; - - desc->id = idx; - desc->flags = flags; - desc->name = NULL; - desc->index = idx; - desc->prototype_id = 0; - return S_OK; -} - static IDispatch *get_this(DISPPARAMS *dp) { DWORD i; @@ -644,6 +655,8 @@ static HRESULT prop_put(jsdisp_t *This, DISPID id, jsval_t val) jsdisp_t *prototype_iter = This; do { + if(!is_dispex_prop_id(prop_iter->u.ref + 1)) + break; prototype_iter = prototype_iter->prototype; prop_iter = prototype_iter->props + prop_iter->u.ref; } while(prop_iter->type == PROP_PROTREF); @@ -700,57 +713,58 @@ static HRESULT prop_put(jsdisp_t *This, DISPID id, jsval_t val) static HRESULT invoke_prop_func(jsdisp_t *This, IDispatch *jsthis, DISPID id, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r, IServiceProvider *caller) { - dispex_prop_t *prop = &This->props[prop_id_to_idx(id)]; HRESULT hres; + jsval_t val; - switch(prop->type) { - case PROP_BUILTIN: - return JS_E_FUNCTION_EXPECTED; - case PROP_PROTREF: - return invoke_prop_func(This->prototype, jsthis ? jsthis : to_disp(This), - prop->u.ref + 1, flags, argc, argv, r, caller); - case PROP_JSVAL: { - if(!is_object_instance(prop->u.val)) { - FIXME("value %s is not a function\n", debugstr_jsval(prop->u.val)); - return JS_E_FUNCTION_EXPECTED; - } - - TRACE("call %s %p\n", debugstr_w(prop->name), get_object(prop->u.val)); + if(is_dispex_prop_id(id)) { + dispex_prop_t *prop = &This->props[prop_id_to_idx(id)]; - return disp_call_value_with_caller(This->ctx, get_object(prop->u.val), - jsval_disp(jsthis ? jsthis : to_disp(This)), - flags, argc, argv, r, caller); - } - case PROP_ACCESSOR: - case PROP_EXTERN: { - jsval_t val; + switch(prop->type) { + case PROP_BUILTIN: + return JS_E_FUNCTION_EXPECTED; + case PROP_PROTREF: + return invoke_prop_func(This->prototype, jsthis ? jsthis : to_disp(This), + prop->u.ref + 1, flags, argc, argv, r, caller); + case PROP_JSVAL: { + if(!is_object_instance(prop->u.val)) { + FIXME("value %s is not a function\n", debugstr_jsval(prop->u.val)); + return JS_E_FUNCTION_EXPECTED; + } - hres = prop_get(This, jsthis ? jsthis : to_disp(This), id, &val); - if(FAILED(hres)) - return hres; + TRACE("call %s %p\n", debugstr_w(prop->name), get_object(prop->u.val)); - if(is_object_instance(val)) { - jsdisp_t *jsfunc = to_jsdisp(get_object(val)); - if(!jsfunc || is_class(jsfunc, JSCLASS_FUNCTION)) - hres = disp_call_value_with_caller(This->ctx, get_object(val), - jsval_disp(jsthis ? jsthis : to_disp(This)), - flags, argc, argv, r, caller); - else - hres = JS_E_INVALID_PROPERTY; - }else { - WARN("value %s is not a function\n", debugstr_jsval(val)); - hres = JS_E_FUNCTION_EXPECTED; + return disp_call_value_with_caller(This->ctx, get_object(prop->u.val), + jsval_disp(jsthis ? jsthis : to_disp(This)), + flags, argc, argv, r, caller); + } + case PROP_ACCESSOR: + case PROP_EXTERN: + break; + default: + assert(0); + break; } + } - jsval_release(val); + hres = prop_get(This, jsthis ? jsthis : to_disp(This), id, &val); + if(FAILED(hres)) return hres; - } - case PROP_DELETED: - assert(0); - break; + + if(is_object_instance(val)) { + jsdisp_t *jsfunc = to_jsdisp(get_object(val)); + if(!jsfunc || is_class(jsfunc, JSCLASS_FUNCTION)) + hres = disp_call_value_with_caller(This->ctx, get_object(val), + jsval_disp(jsthis ? jsthis : to_disp(This)), + flags, argc, argv, r, caller); + else + hres = JS_E_INVALID_PROPERTY; + }else { + WARN("value %s is not a function\n", debugstr_jsval(val)); + hres = JS_E_FUNCTION_EXPECTED; } - return E_FAIL; + jsval_release(val); + return hres; } HRESULT builtin_set_const(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) @@ -821,6 +835,18 @@ static HRESULT fill_protrefs(jsdisp_t *This) if(FAILED(hres)) return hres; + if(This->prototype->builtin_info->indexed_len) { + unsigned i, len = This->prototype->builtin_info->indexed_len(This->prototype); + WCHAR buf[11]; + + for(i = 0; i < len; i++) { + swprintf(buf, ARRAY_SIZE(buf), L"%u", i); + hres = fill_protref(This, string_hash(buf), buf, prop_id_to_idx(indexed_prop_idx_to_id(i))); + if(hres != S_OK) + return hres; + } + } + for(iter = This->prototype->props; iter < This->prototype->props+This->prototype->prop_cnt; iter++) { hres = fill_protref(This, iter->hash, iter->name, iter - This->prototype->props); if(hres != S_OK) @@ -2272,6 +2298,12 @@ static HRESULT delete_prop(jsdisp_t *obj, DISPID id, BOOL *ret) } } + if(is_indexed_prop_id(id)) { + /* indexed props are not configurable */ + *ret = FALSE; + return S_OK; + } + prop = &obj->props[prop_id_to_idx(id)]; if(prop->type == PROP_PROTREF || prop->type == PROP_DELETED) { *ret = TRUE; @@ -2361,6 +2393,7 @@ static HRESULT WINAPI DispatchEx_GetMemberProperties(IWineJSDispatch *iface, DIS static HRESULT WINAPI DispatchEx_GetMemberName(IWineJSDispatch *iface, DISPID id, BSTR *pbstrName) { jsdisp_t *This = impl_from_IWineJSDispatch(iface); + WCHAR buf[11]; TRACE("(%p)->(%lx %p)\n", This, id, pbstrName); @@ -2369,6 +2402,11 @@ static HRESULT WINAPI DispatchEx_GetMemberName(IWineJSDispatch *iface, DISPID id if(!(*pbstrName = SysAllocString(This->props[prop_id_to_idx(id)].name))) return E_OUTOFMEMORY; break; + case INDEXED_PROP: + swprintf(buf, ARRAY_SIZE(buf), L"%u", indexed_prop_id_to_idx(id)); + if(!(*pbstrName = SysAllocString(buf))) + return E_OUTOFMEMORY; + break; default: return DISP_E_MEMBERNOTFOUND; } @@ -2416,6 +2454,14 @@ static HRESULT WINAPI WineJSDispatch_GetPropertyFlags(IWineJSDispatch *iface, DI *ret = prop->flags & PROPF_PUBLIC_MASK; break; } + case INDEXED_PROP: { + property_desc_t prop_desc; + + if(This->builtin_info->prop_get_desc(This, id, TRUE, &prop_desc) != S_OK) + return DISP_E_MEMBERNOTFOUND; + *ret = prop_desc.flags & PROPF_PUBLIC_MASK; + break; + } default: return DISP_E_MEMBERNOTFOUND; } @@ -3090,37 +3136,28 @@ HRESULT disp_delete(IDispatch *disp, DISPID id, BOOL *ret) return S_OK; } -HRESULT jsdisp_fill_indices(jsdisp_t *obj, unsigned length, unsigned flags) -{ - struct property_info desc; - HRESULT hres; - - desc.flags = flags; - desc.name = NULL; - desc.prototype_id = 0; - - for(desc.index = 0; desc.index < length; desc.index++) { - desc.id = desc.index; - hres = WineJSDispatch_UpdateProperty(&obj->IWineJSDispatch_iface, &desc); - if(FAILED(hres)) - return hres; - } - - return S_OK; -} - HRESULT jsdisp_next_prop(jsdisp_t *obj, DISPID id, enum jsdisp_enum_type enum_type, DISPID *ret) { dispex_prop_t *iter; - DWORD idx = id; + BOOL fill = FALSE; HRESULT hres; + DWORD idx; - if(id == DISPID_STARTENUM || idx >= obj->prop_cnt) { + id = (id == DISPID_STARTENUM) ? indexed_prop_idx_to_id(0) : id + 1; + if(is_indexed_prop_id(id)) { + if(obj->builtin_info->indexed_len && indexed_prop_id_to_idx(id) < obj->builtin_info->indexed_len(obj)) { + *ret = id; + return S_OK; + } + fill = TRUE; + id = 1; + } + idx = prop_id_to_idx(id); + + if(fill || idx >= obj->prop_cnt) { hres = (enum_type == JSDISP_ENUM_ALL) ? fill_protrefs(obj) : fill_props(obj); if(FAILED(hres)) return hres; - if(id == DISPID_STARTENUM) - idx = 0; if(idx >= obj->prop_cnt) return S_FALSE; } @@ -3260,6 +3297,45 @@ HRESULT jsdisp_get_own_property(jsdisp_t *obj, const WCHAR *name, BOOL flags_onl return S_OK; } +static HRESULT define_existing_indexed_prop(jsdisp_t *obj, const WCHAR *name, DISPID id, const property_desc_t *desc) +{ + property_desc_t prop_desc; + HRESULT hres; + jsval_t val; + BOOL eq; + + TRACE("existing indexed prop %s desc flags %x desc mask %x\n", debugstr_w(name), desc->flags, desc->mask); + + if((desc->mask & desc->flags & (PROPF_CONFIGURABLE | PROPF_ENUMERABLE)) != (desc->mask & PROPF_ENUMERABLE)) + return throw_error(obj->ctx, JS_E_NONCONFIGURABLE_REDEFINED, name); + + if(desc->explicit_value || (desc->mask & PROPF_WRITABLE)) { + if(obj->builtin_info->prop_get_desc(obj, id, TRUE, &prop_desc) == S_OK && !(prop_desc.flags & PROPF_WRITABLE)) { + if(desc->mask & desc->flags & PROPF_WRITABLE) + return throw_error(obj->ctx, JS_E_NONWRITABLE_MODIFIED, name); + if(desc->explicit_value) { + hres = obj->builtin_info->prop_get(obj, id, &val); + if(FAILED(hres)) + return hres; + hres = jsval_strict_equal(desc->value, val, &eq); + jsval_release(val); + if(FAILED(hres)) + return hres; + if(!eq) + return throw_error(obj->ctx, JS_E_NONWRITABLE_MODIFIED, name); + } + }else if(desc->explicit_value) { + hres = obj->builtin_info->prop_put(obj, id, desc->value); + if(FAILED(hres)) + return hres; + } + }else if(desc->explicit_getter || desc->explicit_setter) { + return throw_error(obj->ctx, JS_E_NONCONFIGURABLE_REDEFINED, name); + } + + return S_OK; +} + HRESULT jsdisp_define_property(jsdisp_t *obj, const WCHAR *name, property_desc_t *desc) { dispex_prop_t *prop; @@ -3271,6 +3347,15 @@ HRESULT jsdisp_define_property(jsdisp_t *obj, const WCHAR *name, property_desc_t return hres; if(hres == S_OK) { + if(is_indexed_prop_id(id)) { + if(obj->builtin_info->prop_define) { + hres = obj->builtin_info->prop_define(obj, id, desc); + if(hres != S_FALSE) + return hres; + } + return define_existing_indexed_prop(obj, name, id, desc); + } + prop = &obj->props[prop_id_to_idx(id)]; if((prop->type == PROP_DELETED || prop->type == PROP_PROTREF) && !obj->extensible) return throw_error(obj->ctx, JS_E_OBJECT_NONEXTENSIBLE, name); @@ -3442,7 +3527,7 @@ HRESULT jsdisp_change_prototype(jsdisp_t *obj, jsdisp_t *proto) static void set_prop_flags(jsdisp_t *obj, dispex_prop_t *prop, UINT32 flags) { - if(prop->type == PROP_EXTERN && obj->builtin_info->prop_config) { + if(prop->type == PROP_EXTERN) { HRESULT hres = obj->builtin_info->prop_config(obj, prop->u.id, flags); if(hres != S_OK) return; @@ -3489,11 +3574,16 @@ BOOL jsdisp_is_frozen(jsdisp_t *obj, BOOL sealed) HRESULT jsdisp_get_prop_name(jsdisp_t *obj, DISPID id, jsstr_t **r) { const WCHAR *name; + WCHAR buf[11]; switch(prop_kind(obj, id)) { case DISPEX_PROP: name = obj->props[prop_id_to_idx(id)].name; break; + case INDEXED_PROP: + swprintf(buf, ARRAY_SIZE(buf), L"%u", indexed_prop_id_to_idx(id)); + name = buf; + break; default: return DISP_E_MEMBERNOTFOUND; } @@ -3726,13 +3816,3 @@ HRESULT fill_globals(script_ctx_t *ctx, IWineJSDispatchHost *script_global) return S_OK; } - -BOOL get_extern_prop_idx(jsdisp_t *jsdisp, DISPID id, unsigned *ret) -{ - dispex_prop_t *prop = &jsdisp->props[prop_id_to_idx(id)]; - - if(prop->type != PROP_EXTERN) - return FALSE; - *ret = prop->u.id; - return TRUE; -} diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 143612c39889..7cbfd2835a63 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -490,38 +490,32 @@ static void scope_destructor(jsdisp_t *dispex) IDispatch_Release(scope->obj); } -static HRESULT scope_lookup_prop(jsdisp_t *jsdisp, const WCHAR *name, unsigned flags, struct property_info *desc) +static unsigned scope_indexed_len(jsdisp_t *dispex) { - scope_chain_t *scope = scope_from_dispex(jsdisp); - - return jsdisp_index_lookup(&scope->dispex, name, scope->detached_vars->argc, PROPF_ENUMERABLE | PROPF_WRITABLE, desc); + return scope_from_dispex(dispex)->detached_vars->argc; } static HRESULT scope_prop_get(jsdisp_t *dispex, DISPID id, jsval_t *r) { - scope_chain_t *scope = scope_from_dispex(dispex); - unsigned idx; - - if(!get_extern_prop_idx(dispex, id, &idx)) + if(!is_indexed_prop_id(id)) return S_FALSE; - return jsval_copy(scope->detached_vars->var[idx], r); + return jsval_copy(scope_from_dispex(dispex)->detached_vars->var[indexed_prop_id_to_idx(id)], r); } static HRESULT scope_prop_put(jsdisp_t *dispex, DISPID id, jsval_t val) { scope_chain_t *scope = scope_from_dispex(dispex); jsval_t copy, *ref; - unsigned idx; HRESULT hres; - if(!get_extern_prop_idx(dispex, id, &idx)) + if(!is_indexed_prop_id(id)) return S_FALSE; hres = jsval_copy(val, ©); if(FAILED(hres)) return hres; - ref = &scope->detached_vars->var[idx]; + ref = &scope->detached_vars->var[indexed_prop_id_to_idx(id)]; jsval_release(*ref); *ref = copy; return S_OK; @@ -529,13 +523,11 @@ static HRESULT scope_prop_put(jsdisp_t *dispex, DISPID id, jsval_t val) static HRESULT scope_prop_get_desc(jsdisp_t *dispex, DISPID id, BOOL flags_only, property_desc_t *desc) { - unsigned idx; - if(!flags_only) { HRESULT hres = scope_prop_get(dispex, id, &desc->value); if(hres != S_OK) return hres; - }else if(!get_extern_prop_idx(dispex, id, &idx)) { + }else if(!is_indexed_prop_id(id)) { return S_FALSE; } @@ -581,7 +573,7 @@ static HRESULT scope_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op op, static const builtin_info_t scope_info = { .class = JSCLASS_NONE, .destructor = scope_destructor, - .lookup_prop = scope_lookup_prop, + .indexed_len = scope_indexed_len, .prop_get = scope_prop_get, .prop_put = scope_prop_put, .prop_get_desc = scope_prop_get_desc, diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index e0114f527d4e..42289efe036e 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -131,12 +131,6 @@ static void Arguments_destructor(jsdisp_t *jsdisp) scope_release(arguments->scope); } -static HRESULT Arguments_lookup_prop(jsdisp_t *jsdisp, const WCHAR *name, unsigned flags, struct property_info *desc) -{ - ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); - return jsdisp_index_lookup(&arguments->jsdisp, name, arguments->argc, PROPF_ENUMERABLE | PROPF_WRITABLE, desc); -} - static jsval_t *get_argument_ref(ArgumentsInstance *arguments, unsigned idx) { if(arguments->buf) @@ -146,17 +140,21 @@ static jsval_t *get_argument_ref(ArgumentsInstance *arguments, unsigned idx) return arguments->scope->detached_vars->var + idx; } +static unsigned Arguments_indexed_len(jsdisp_t *jsdisp) +{ + return arguments_from_jsdisp(jsdisp)->argc; +} + static HRESULT Arguments_prop_get(jsdisp_t *jsdisp, DISPID id, jsval_t *r) { ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); - unsigned idx; - if(!get_extern_prop_idx(jsdisp, id, &idx)) + if(!is_indexed_prop_id(id)) return S_FALSE; - TRACE("%p[%u]\n", arguments, idx); + TRACE("%p[%u]\n", arguments, indexed_prop_id_to_idx(id)); - return jsval_copy(*get_argument_ref(arguments, idx), r); + return jsval_copy(*get_argument_ref(arguments, indexed_prop_id_to_idx(id)), r); } static HRESULT Arguments_prop_put(jsdisp_t *jsdisp, DISPID id, jsval_t val) @@ -166,8 +164,9 @@ static HRESULT Arguments_prop_put(jsdisp_t *jsdisp, DISPID id, jsval_t val) unsigned idx; HRESULT hres; - if(!get_extern_prop_idx(jsdisp, id, &idx)) + if(!is_indexed_prop_id(id)) return S_FALSE; + idx = indexed_prop_id_to_idx(id); TRACE("%p[%u] = %s\n", arguments, idx, debugstr_jsval(val)); @@ -189,8 +188,9 @@ static HRESULT Arguments_prop_get_desc(jsdisp_t *jsdisp, DISPID id, BOOL flags_o ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); unsigned idx; - if(!get_extern_prop_idx(jsdisp, id, &idx)) + if(!is_indexed_prop_id(id)) return S_FALSE; + idx = indexed_prop_id_to_idx(id); if(!flags_only) { HRESULT hres = Arguments_prop_get(jsdisp, id, &desc->value); @@ -211,8 +211,9 @@ static HRESULT Arguments_prop_define(jsdisp_t *jsdisp, DISPID id, const property unsigned idx; HRESULT hres; - if(!get_extern_prop_idx(jsdisp, id, &idx)) + if(!is_indexed_prop_id(id)) return S_FALSE; + idx = indexed_prop_id_to_idx(id); /* Need to keep track of props made read-only when going from writable to non-writable */ if((desc->mask & PROPF_WRITABLE) && !(desc->flags & PROPF_WRITABLE) && !(arguments->readonly_flags[idx / 8] & (1u << idx % 8)) && @@ -230,12 +231,6 @@ static HRESULT Arguments_prop_define(jsdisp_t *jsdisp, DISPID id, const property return S_FALSE; } -static HRESULT Arguments_fill_props(jsdisp_t *jsdisp) -{ - ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); - return jsdisp_fill_indices(&arguments->jsdisp, arguments->argc, PROPF_ENUMERABLE | PROPF_WRITABLE); -} - static HRESULT Arguments_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op op, jsdisp_t *jsdisp) { ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); @@ -296,12 +291,11 @@ static const builtin_info_t Arguments_info = { .props_cnt = ARRAY_SIZE(Arguments_props), .props = Arguments_props, .destructor = Arguments_destructor, - .lookup_prop = Arguments_lookup_prop, + .indexed_len = Arguments_indexed_len, .prop_get = Arguments_prop_get, .prop_put = Arguments_prop_put, .prop_get_desc = Arguments_prop_get_desc, .prop_define = Arguments_prop_define, - .fill_props = Arguments_fill_props, .gc_traverse = Arguments_gc_traverse }; @@ -309,12 +303,11 @@ static const builtin_info_t Arguments_ES5_info = { .class = JSCLASS_ARGUMENTS, .call = Arguments_value, .destructor = Arguments_destructor, - .lookup_prop = Arguments_lookup_prop, + .indexed_len = Arguments_indexed_len, .prop_get = Arguments_prop_get, .prop_put = Arguments_prop_put, .prop_get_desc = Arguments_prop_get_desc, .prop_define = Arguments_prop_define, - .fill_props = Arguments_fill_props, .gc_traverse = Arguments_gc_traverse }; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 8f11f9aa6d8a..94a67b9fb4e6 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -183,6 +183,7 @@ typedef struct { ULONG (*addref)(jsdisp_t*); ULONG (*release)(jsdisp_t*); void (*on_put)(jsdisp_t*,const WCHAR*); + unsigned (*indexed_len)(jsdisp_t*); HRESULT (*lookup_prop)(jsdisp_t*,const WCHAR*,unsigned,struct property_info*); HRESULT (*prop_get)(jsdisp_t*,DISPID,jsval_t*); HRESULT (*prop_put)(jsdisp_t*,DISPID,jsval_t); @@ -232,10 +233,24 @@ static inline BOOL is_dispex_prop_id(DISPID id) return id > 0; } +static inline BOOL is_indexed_prop_id(DISPID id) +{ + return id < 0; +} + +static inline unsigned indexed_prop_id_to_idx(DISPID id) +{ + return (unsigned)id - 0x80000000u; +} + +static inline DISPID indexed_prop_idx_to_id(unsigned idx) +{ + return idx + 0x80000000u; +} + jsdisp_t *as_jsdisp(IDispatch*); jsdisp_t *to_jsdisp(IDispatch*); IWineJSDispatchHost *get_host_dispatch(IDispatch*); -BOOL get_extern_prop_idx(jsdisp_t*,DISPID,unsigned*); jsdisp_t *jsdisp_addref(jsdisp_t*); ULONG jsdisp_release(jsdisp_t*); @@ -272,8 +287,6 @@ HRESULT jsdisp_get_id(jsdisp_t*,const WCHAR*,DWORD,DISPID*); HRESULT jsdisp_get_idx_id(jsdisp_t*,DWORD,DISPID*); HRESULT disp_delete(IDispatch*,DISPID,BOOL*); HRESULT disp_delete_name(script_ctx_t*,IDispatch*,jsstr_t*,BOOL*); -HRESULT jsdisp_index_lookup(jsdisp_t*,const WCHAR*,unsigned,unsigned,struct property_info*); -HRESULT jsdisp_fill_indices(jsdisp_t*,unsigned,unsigned); HRESULT jsdisp_delete_idx(jsdisp_t*,DWORD); HRESULT jsdisp_get_own_property(jsdisp_t*,const WCHAR*,BOOL,property_desc_t*); HRESULT jsdisp_define_property(jsdisp_t*,const WCHAR*,property_desc_t*); diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index 93face9d78c8..f02af5b65175 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -1501,7 +1501,7 @@ static void String_destructor(jsdisp_t *dispex) jsstr_release(This->str); } -static HRESULT String_lookup_prop(jsdisp_t *jsdisp, const WCHAR *name, unsigned flags, struct property_info *desc) +static unsigned String_indexed_len(jsdisp_t *jsdisp) { StringInstance *string = string_from_jsdisp(jsdisp); @@ -1512,25 +1512,24 @@ static HRESULT String_lookup_prop(jsdisp_t *jsdisp, const WCHAR *name, unsigned * properly. */ if(string->dispex.ctx->version < 2) - return DISP_E_UNKNOWNNAME; + return 0; - return jsdisp_index_lookup(&string->dispex, name, jsstr_length(string->str), PROPF_ENUMERABLE, desc); + return jsstr_length(string->str); } static HRESULT String_prop_get(jsdisp_t *jsdisp, DISPID id, jsval_t *r) { StringInstance *string = string_from_jsdisp(jsdisp); - unsigned idx; jsstr_t *ret; - if(!get_extern_prop_idx(jsdisp, id, &idx)) + if(!is_indexed_prop_id(id)) return S_FALSE; - ret = jsstr_substr(string->str, idx, 1); + ret = jsstr_substr(string->str, indexed_prop_id_to_idx(id), 1); if(!ret) return E_OUTOFMEMORY; - TRACE("%p[%u] = %s\n", string, idx, debugstr_jsstr(ret)); + TRACE("%p[%u] = %s\n", string, indexed_prop_id_to_idx(id), debugstr_jsstr(ret)); *r = jsval_string(ret); return S_OK; @@ -1538,22 +1537,16 @@ static HRESULT String_prop_get(jsdisp_t *jsdisp, DISPID id, jsval_t *r) static HRESULT String_prop_put(jsdisp_t *jsdisp, DISPID id, jsval_t val) { - unsigned idx; - - if(!get_extern_prop_idx(jsdisp, id, &idx)) - return S_FALSE; - return S_OK; + return is_indexed_prop_id(id) ? S_OK : S_FALSE; } static HRESULT String_prop_get_desc(jsdisp_t *jsdisp, DISPID id, BOOL flags_only, property_desc_t *desc) { - unsigned idx; - if(!flags_only) { HRESULT hres = String_prop_get(jsdisp, id, &desc->value); if(hres != S_OK) return hres; - }else if(!get_extern_prop_idx(jsdisp, id, &idx)) { + }else if(!is_indexed_prop_id(id)) { return S_FALSE; } @@ -1561,16 +1554,6 @@ static HRESULT String_prop_get_desc(jsdisp_t *jsdisp, DISPID id, BOOL flags_only return S_OK; } -static HRESULT String_fill_props(jsdisp_t *jsdisp) -{ - StringInstance *string = string_from_jsdisp(jsdisp); - - if(string->dispex.ctx->version < 2) - return S_OK; - - return jsdisp_fill_indices(&string->dispex, jsstr_length(string->str), PROPF_ENUMERABLE); -} - static const builtin_prop_t String_props[] = { {L"anchor", String_anchor, PROPF_METHOD|1}, {L"big", String_big, PROPF_METHOD}, @@ -1624,11 +1607,10 @@ static const builtin_info_t StringInst_info = { .props_cnt = ARRAY_SIZE(StringInst_props), .props = StringInst_props, .destructor = String_destructor, - .lookup_prop = String_lookup_prop, + .indexed_len = String_indexed_len, .prop_get = String_prop_get, .prop_put = String_prop_put, .prop_get_desc = String_prop_get_desc, - .fill_props = String_fill_props, }; /* ECMA-262 3rd Edition 15.5.3.2 */ From 8dbb12eace3e3118314b6b2855b91098ef3d73eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:06 +0200 Subject: [PATCH 1328/2542] jscript: Add initial implementation of Typed Arrays. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Typed Arrays have special properties (even according to the spec); they override all positive indices, and operations on them must be special cased. Presumably (on native) this is done for performance reasons, as they are used as actual data arrays which are expected to perform well with many elements (e.g. using them to store and manipulate an image). The spec is even stricter, where any number is intercepted, but for us it's simpler since native doesn't follow the spec here. Note that even the behavior is special; defining an indexed prop on a typed array for indices out of bounds of the array doesn't do anything, although it does throw if flags don't match (since it's not configurable). Redefining an index within bounds throws if flags don't match, but otherwise acts like a normal setter (coerces it into the underlying data type), which is NOT how defineProperty usually works. delete always returns false, even for out of bounds indices, despite them not being props (hasOwnProperty returns false), which is another special case that, thankfully, actually makes our design simpler. The prototype is also not consulted for any positive indices, but is for negative (unlike the spec says, native differs here), i.e. the positive indices behavior is completely overridden, even for those out of bounds. Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/arraybuf.c | 374 ++++++++++++++++++++++++++++++ dlls/jscript/dispex.c | 11 +- dlls/jscript/error.c | 3 + dlls/jscript/jscript.h | 19 +- dlls/jscript/jscript.rc | 3 + dlls/jscript/object.c | 8 + dlls/jscript/resource.h | 3 + dlls/mshtml/tests/documentmode.js | 8 +- dlls/mshtml/tests/es5.js | 197 +++++++++++++++- 9 files changed, 618 insertions(+), 8 deletions(-) diff --git a/dlls/jscript/arraybuf.c b/dlls/jscript/arraybuf.c index fc01773338f3..457518cd3987 100644 --- a/dlls/jscript/arraybuf.c +++ b/dlls/jscript/arraybuf.c @@ -39,6 +39,14 @@ typedef struct { DWORD size; } DataViewInstance; +typedef struct { + jsdisp_t dispex; + + ArrayBufferInstance *buffer; + DWORD offset; + DWORD length; +} TypedArrayInstance; + static inline ArrayBufferInstance *arraybuf_from_jsdisp(jsdisp_t *jsdisp) { return CONTAINING_RECORD(jsdisp, ArrayBufferInstance, dispex); @@ -49,6 +57,11 @@ static inline DataViewInstance *dataview_from_jsdisp(jsdisp_t *jsdisp) return CONTAINING_RECORD(jsdisp, DataViewInstance, dispex); } +static inline TypedArrayInstance *typedarr_from_jsdisp(jsdisp_t *jsdisp) +{ + return CONTAINING_RECORD(jsdisp, TypedArrayInstance, dispex); +} + static inline ArrayBufferInstance *arraybuf_this(jsval_t vthis) { jsdisp_t *jsdisp = is_object_instance(vthis) ? to_jsdisp(get_object(vthis)) : NULL; @@ -684,6 +697,330 @@ static const builtin_info_t DataViewConstr_info = { .call = Function_value, }; +#define TYPEDARRAY_LIST \ +X(Int8Array, JSCLASS_INT8ARRAY, INT8, to_int32, INT) \ +X(Int16Array, JSCLASS_INT16ARRAY, INT16, to_int32, INT) \ +X(Int32Array, JSCLASS_INT32ARRAY, INT32, to_int32, INT) \ +X(Uint8Array, JSCLASS_UINT8ARRAY, UINT8, to_int32, INT) \ +X(Uint16Array, JSCLASS_UINT16ARRAY, UINT16, to_int32, INT) \ +X(Uint32Array, JSCLASS_UINT32ARRAY, UINT32, to_int32, INT) \ +X(Float32Array, JSCLASS_FLOAT32ARRAY, float, to_number, double) \ +X(Float64Array, JSCLASS_FLOAT64ARRAY, double, to_number, double) + +#define TYPEDARRAY_INDEX(JSCLASS) ((JSCLASS) - FIRST_TYPEDARRAY_JSCLASS) + +#define X(NAME, JSCLASS, TYPE, CONVERT, NUM_TYPE) [TYPEDARRAY_INDEX(JSCLASS)] = L"" #NAME, +static const WCHAR *const TypedArray_name[] = { TYPEDARRAY_LIST }; +#undef X + +#define X(NAME, JSCLASS, TYPE, CONVERT, NUM_TYPE) [TYPEDARRAY_INDEX(JSCLASS)] = sizeof(TYPE), +static const unsigned TypedArray_elem_size[] = { TYPEDARRAY_LIST }; +#undef X + +static inline TypedArrayInstance *typedarr_this(jsval_t vthis, jsclass_t jsclass) +{ + jsdisp_t *jsdisp = is_object_instance(vthis) ? to_jsdisp(get_object(vthis)) : NULL; + return (jsdisp && is_class(jsdisp, jsclass)) ? typedarr_from_jsdisp(jsdisp) : NULL; +} + +static HRESULT TypedArray_get_buffer(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) +{ + TRACE("%p\n", jsthis); + + *r = jsval_obj(jsdisp_addref(&typedarr_from_jsdisp(jsthis)->buffer->dispex)); + return S_OK; +} + +static HRESULT TypedArray_get_byteLength(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) +{ + TRACE("%p\n", jsthis); + + *r = jsval_number(typedarr_from_jsdisp(jsthis)->length * TypedArray_elem_size[TYPEDARRAY_INDEX(jsthis->builtin_info->class)]); + return S_OK; +} + +static HRESULT TypedArray_get_byteOffset(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) +{ + TRACE("%p\n", jsthis); + + *r = jsval_number(typedarr_from_jsdisp(jsthis)->offset); + return S_OK; +} + +static HRESULT TypedArray_get_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) +{ + TRACE("%p\n", jsthis); + + *r = jsval_number(typedarr_from_jsdisp(jsthis)->length); + return S_OK; +} + +static HRESULT TypedArray_set(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, + jsval_t *r, jsclass_t jsclass) +{ + TypedArrayInstance *typedarr; + + FIXME("not implemented\n"); + + if(!(typedarr = typedarr_this(vthis, jsclass))) + return JS_E_NOT_TYPEDARRAY; + return E_NOTIMPL; +} + +static HRESULT TypedArray_subarray(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, + jsval_t *r, jsclass_t jsclass) +{ + TypedArrayInstance *typedarr; + + FIXME("not implemented\n"); + + if(!(typedarr = typedarr_this(vthis, jsclass))) + return JS_E_NOT_TYPEDARRAY; + return E_NOTIMPL; +} + +static void TypedArray_destructor(jsdisp_t *dispex) +{ + TypedArrayInstance *typedarr = typedarr_from_jsdisp(dispex); + if(typedarr->buffer) + jsdisp_release(&typedarr->buffer->dispex); +} + +static unsigned TypedArray_indexed_len(jsdisp_t *dispex) +{ + /* Typed Arrays override every positive index */ + return INT_MAX; +} + +static HRESULT TypedArray_prop_get_desc(jsdisp_t *dispex, DISPID id, BOOL flags_only, property_desc_t *desc) +{ + TypedArrayInstance *typedarr = typedarr_from_jsdisp(dispex); + + if(!is_indexed_prop_id(id)) + return S_FALSE; + + if(indexed_prop_id_to_idx(id) >= typedarr->length) + return DISP_E_UNKNOWNNAME; + + if(!flags_only) { + HRESULT hres = dispex->builtin_info->prop_get(dispex, id, &desc->value); + if(hres != S_OK) + return hres; + } + + desc->flags = PROPF_ENUMERABLE | PROPF_WRITABLE; + return S_OK; +} + +static HRESULT TypedArray_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op op, jsdisp_t *dispex) +{ + TypedArrayInstance *typedarr = typedarr_from_jsdisp(dispex); + return gc_process_linked_obj(gc_ctx, op, dispex, &typedarr->buffer->dispex, (void**)&typedarr->buffer); +} + +static const builtin_prop_t TypedArrayInst_props[] = { + {L"buffer", NULL, 0, TypedArray_get_buffer}, + {L"byteLength", NULL, 0, TypedArray_get_byteLength}, + {L"byteOffset", NULL, 0, TypedArray_get_byteOffset}, + {L"length", NULL, 0, TypedArray_get_length}, +}; + +#define X(NAME, JSCLASS, TYPE, CONVERT, NUM_TYPE) \ +static HRESULT NAME ##_prop_get(jsdisp_t *dispex, DISPID id, jsval_t *r) \ +{ \ + TypedArrayInstance *typedarr = typedarr_from_jsdisp(dispex); \ + unsigned idx = indexed_prop_id_to_idx(id); \ + \ + if(!is_indexed_prop_id(id)) \ + return S_FALSE; \ + \ + TRACE("%p[%u]\n", typedarr, idx); \ + \ + if(idx >= typedarr->length) \ + *r = jsval_undefined(); \ + else \ + *r = jsval_number(*(TYPE*)&typedarr->buffer->buf[typedarr->offset + idx * sizeof(TYPE)]); \ + return S_OK; \ +} \ + \ +static HRESULT NAME ##_prop_put(jsdisp_t *dispex, DISPID id, jsval_t val) \ +{ \ + TypedArrayInstance *typedarr = typedarr_from_jsdisp(dispex); \ + unsigned idx = indexed_prop_id_to_idx(id); \ + HRESULT hres; \ + NUM_TYPE n; \ + \ + if(!is_indexed_prop_id(id)) \ + return S_FALSE; \ + \ + TRACE("%p[%u] = %s\n", typedarr, idx, debugstr_jsval(val)); \ + \ + if(idx >= typedarr->length) \ + return S_OK; \ + \ + hres = CONVERT(typedarr->dispex.ctx, val, &n); \ + if(SUCCEEDED(hres)) \ + *(TYPE*)&typedarr->buffer->buf[typedarr->offset + idx * sizeof(TYPE)] = n; \ + return hres; \ +} \ + \ +static HRESULT NAME ##_set(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) \ +{ \ + return TypedArray_set(ctx, vthis, flags, argc, argv, r, JSCLASS); \ +} \ + \ +static HRESULT NAME ##_subarray(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) \ +{ \ + return TypedArray_subarray(ctx, vthis, flags, argc, argv, r, JSCLASS); \ +} \ + \ +static const builtin_prop_t NAME ##_props[] = { \ + {L"buffer", NULL, 0, TypedArray_get_buffer}, \ + {L"byteLength", NULL, 0, TypedArray_get_byteLength}, \ + {L"byteOffset", NULL, 0, TypedArray_get_byteOffset}, \ + {L"length", NULL, 0, TypedArray_get_length}, \ + {L"set", NAME ##_set, PROPF_METHOD|2}, \ + {L"subarray", NAME ##_subarray, PROPF_METHOD|2}, \ +}; +TYPEDARRAY_LIST +#undef X + +#define X(NAME, JSCLASS, TYPE, CONVERT, NUM_TYPE) \ +[TYPEDARRAY_INDEX(JSCLASS)] = \ +{ \ + .class = JSCLASS, \ + .props_cnt = ARRAY_SIZE(NAME ##_props), \ + .props = NAME ##_props, \ + .destructor = TypedArray_destructor, \ + .indexed_len = TypedArray_indexed_len, \ + .prop_get = NAME ##_prop_get, \ + .prop_put = NAME ##_prop_put, \ + .prop_get_desc = TypedArray_prop_get_desc, \ + .gc_traverse = TypedArray_gc_traverse, \ +}, +static const builtin_info_t TypedArray_info[] = { TYPEDARRAY_LIST }; +#undef X + +#define X(NAME, JSCLASS, TYPE, CONVERT, NUM_TYPE) \ +[TYPEDARRAY_INDEX(JSCLASS)] = \ +{ \ + .class = JSCLASS, \ + .props_cnt = ARRAY_SIZE(TypedArrayInst_props), \ + .props = TypedArrayInst_props, \ + .destructor = TypedArray_destructor, \ + .indexed_len = TypedArray_indexed_len, \ + .prop_get = NAME ##_prop_get, \ + .prop_put = NAME ##_prop_put, \ + .prop_get_desc = TypedArray_prop_get_desc, \ + .gc_traverse = TypedArray_gc_traverse, \ +}, +static const builtin_info_t TypedArrayInst_info[] = { TYPEDARRAY_LIST }; +#undef X + +static HRESULT create_typedarr(script_ctx_t *ctx, jsclass_t jsclass, ArrayBufferInstance *buffer, DWORD offset, DWORD length, jsdisp_t **ret) +{ + TypedArrayInstance *typedarr; + HRESULT hres; + + if(!(typedarr = calloc(1, sizeof(TypedArrayInstance)))) + return E_OUTOFMEMORY; + + hres = init_dispex_from_constr(&typedarr->dispex, ctx, &TypedArrayInst_info[TYPEDARRAY_INDEX(jsclass)], + ctx->typedarr_constr[TYPEDARRAY_INDEX(jsclass)]); + if(FAILED(hres)) { + free(typedarr); + return hres; + } + + jsdisp_addref(&buffer->dispex); + typedarr->buffer = buffer; + typedarr->offset = offset; + typedarr->length = length; + + *ret = &typedarr->dispex; + return S_OK; +} + +static HRESULT TypedArrayConstr_value(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, + jsval_t *r, jsclass_t jsclass) +{ + const unsigned typedarr_idx = TYPEDARRAY_INDEX(jsclass); + unsigned elem_size = TypedArray_elem_size[typedarr_idx]; + ArrayBufferInstance *buffer = NULL; + DWORD offset = 0, length = 0; + jsdisp_t *typedarr; + HRESULT hres; + double n; + + TRACE("\n"); + + switch(flags) { + case DISPATCH_METHOD: + case DISPATCH_CONSTRUCT: { + if(argc) { + if(is_object_instance(argv[0])) { + jsdisp_t *obj = to_jsdisp(get_object(argv[0])); + + if(!obj) + return JS_E_TYPEDARRAY_BAD_CTOR_ARG; + + FIXME("Construction from object not implemented\n"); + return E_NOTIMPL; + }else if(is_number(argv[0])) { + hres = to_integer(ctx, argv[0], &n); + if(FAILED(hres)) + return hres; + if(n < 0.0) + return JS_E_TYPEDARRAY_INVALID_OFFSLEN; + if(n * elem_size > (UINT_MAX - FIELD_OFFSET(ArrayBufferInstance, buf[0]))) + return E_OUTOFMEMORY; + length = n; + }else + return JS_E_TYPEDARRAY_BAD_CTOR_ARG; + } + + if(!r) + return S_OK; + + if(!buffer) { + hres = create_arraybuf(ctx, length * elem_size, &buffer); + if(FAILED(hres)) + return hres; + } + + hres = create_typedarr(ctx, jsclass, buffer, offset, length, &typedarr); + jsdisp_release(&buffer->dispex); + if(FAILED(hres)) + return hres; + + *r = jsval_obj(typedarr); + break; + } + default: + FIXME("unimplemented flags: %x\n", flags); + return E_NOTIMPL; + } + + return S_OK; +} + +#define X(NAME, JSCLASS, TYPE, CONVERT, NUM_TYPE) \ +static HRESULT NAME ## Constr_value(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) \ +{ \ + return TypedArrayConstr_value(ctx, vthis, flags, argc, argv, r, JSCLASS); \ +} +TYPEDARRAY_LIST +#undef X + +#define X(NAME, JSCLASS, TYPE, CONVERT, NUM_TYPE) [TYPEDARRAY_INDEX(JSCLASS)] = NAME ## Constr_value, +static const builtin_invoke_t TypedArray_constr[] = { TYPEDARRAY_LIST }; +#undef X + +static const builtin_info_t TypedArrayConstr_info = { + .class = JSCLASS_FUNCTION, + .call = Function_value, +}; + HRESULT init_arraybuf_constructors(script_ctx_t *ctx) { static const struct { @@ -695,6 +1032,7 @@ HRESULT init_arraybuf_constructors(script_ctx_t *ctx) { L"byteOffset", DataView_get_byteOffset }, }; ArrayBufferInstance *arraybuf; + TypedArrayInstance *typedarr; DataViewInstance *view; property_desc_t desc; HRESULT hres; @@ -766,6 +1104,42 @@ HRESULT init_arraybuf_constructors(script_ctx_t *ctx) hres = jsdisp_define_data_property(ctx->global, L"DataView", PROPF_CONFIGURABLE | PROPF_WRITABLE, jsval_obj(ctx->dataview_constr)); + if(FAILED(hres)) + return hres; + + for(i = 0; i < ARRAY_SIZE(TypedArray_info); i++) { + if(!(typedarr = calloc(1, sizeof(TypedArrayInstance)))) + return E_OUTOFMEMORY; + + hres = create_arraybuf(ctx, 0, &typedarr->buffer); + if(FAILED(hres)) { + free(typedarr); + return hres; + } + + hres = init_dispex(&typedarr->dispex, ctx, &TypedArray_info[i], ctx->object_prototype); + if(FAILED(hres)) { + jsdisp_release(&typedarr->buffer->dispex); + free(typedarr); + return hres; + } + + hres = create_builtin_constructor(ctx, TypedArray_constr[i], TypedArray_name[i], &TypedArrayConstr_info, + PROPF_CONSTR|1, &typedarr->dispex, &ctx->typedarr_constr[i]); + jsdisp_release(&typedarr->dispex); + if(FAILED(hres)) + return hres; + + hres = jsdisp_define_data_property(ctx->typedarr_constr[i], L"BYTES_PER_ELEMENT", 0, + jsval_number(TypedArray_elem_size[i])); + if(FAILED(hres)) + return hres; + + hres = jsdisp_define_data_property(ctx->global, TypedArray_name[i], PROPF_CONFIGURABLE | PROPF_WRITABLE, + jsval_obj(ctx->typedarr_constr[i])); + if(FAILED(hres)) + return hres; + } return hres; } diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index d138e22f9a76..680de8deb83e 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -836,10 +836,14 @@ static HRESULT fill_protrefs(jsdisp_t *This) return hres; if(This->prototype->builtin_info->indexed_len) { - unsigned i, len = This->prototype->builtin_info->indexed_len(This->prototype); + jsdisp_t *prot = This->prototype; + unsigned i, len = This->prototype->builtin_info->indexed_len(prot); + property_desc_t desc; WCHAR buf[11]; for(i = 0; i < len; i++) { + if(prot->builtin_info->prop_get_desc(prot, indexed_prop_idx_to_id(i), TRUE, &desc) != S_OK) + break; swprintf(buf, ARRAY_SIZE(buf), L"%u", i); hres = fill_protref(This, string_hash(buf), buf, prop_id_to_idx(indexed_prop_idx_to_id(i))); if(hres != S_OK) @@ -3145,7 +3149,10 @@ HRESULT jsdisp_next_prop(jsdisp_t *obj, DISPID id, enum jsdisp_enum_type enum_ty id = (id == DISPID_STARTENUM) ? indexed_prop_idx_to_id(0) : id + 1; if(is_indexed_prop_id(id)) { - if(obj->builtin_info->indexed_len && indexed_prop_id_to_idx(id) < obj->builtin_info->indexed_len(obj)) { + property_desc_t desc; + + if(obj->builtin_info->indexed_len && indexed_prop_id_to_idx(id) < obj->builtin_info->indexed_len(obj) && + obj->builtin_info->prop_get_desc(obj, id, TRUE, &desc) == S_OK) { *ret = id; return S_OK; } diff --git a/dlls/jscript/error.c b/dlls/jscript/error.c index 3ff40a1e1e7b..e6e8f70d808f 100644 --- a/dlls/jscript/error.c +++ b/dlls/jscript/error.c @@ -495,6 +495,8 @@ jsdisp_t *create_builtin_error(script_ctx_t *ctx) case JS_E_OBJECT_NONEXTENSIBLE: case JS_E_NONCONFIGURABLE_REDEFINED: case JS_E_NONWRITABLE_MODIFIED: + case JS_E_TYPEDARRAY_BAD_CTOR_ARG: + case JS_E_NOT_TYPEDARRAY: case JS_E_NOT_DATAVIEW: case JS_E_DATAVIEW_NO_ARGUMENT: case JS_E_WRONG_THIS: @@ -509,6 +511,7 @@ jsdisp_t *create_builtin_error(script_ctx_t *ctx) case JS_E_FRACTION_DIGITS_OUT_OF_RANGE: case JS_E_PRECISION_OUT_OF_RANGE: case JS_E_INVALID_LENGTH: + case JS_E_TYPEDARRAY_INVALID_OFFSLEN: case JS_E_DATAVIEW_INVALID_ACCESS: case JS_E_DATAVIEW_INVALID_OFFSET: constr = ctx->range_error_constr; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 94a67b9fb4e6..97da2dba587e 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -113,12 +113,25 @@ typedef enum { JSCLASS_JSON, JSCLASS_ARRAYBUFFER, JSCLASS_DATAVIEW, + JSCLASS_INT8ARRAY, + JSCLASS_INT16ARRAY, + JSCLASS_INT32ARRAY, + JSCLASS_UINT8ARRAY, + JSCLASS_UINT16ARRAY, + JSCLASS_UINT32ARRAY, + JSCLASS_FLOAT32ARRAY, + JSCLASS_FLOAT64ARRAY, JSCLASS_MAP, JSCLASS_SET, JSCLASS_WEAKMAP, JSCLASS_HOST, + + FIRST_TYPEDARRAY_JSCLASS = JSCLASS_INT8ARRAY, + LAST_TYPEDARRAY_JSCLASS = JSCLASS_FLOAT64ARRAY, } jsclass_t; +enum { NUM_TYPEDARRAY_TYPES = LAST_TYPEDARRAY_JSCLASS - FIRST_TYPEDARRAY_JSCLASS + 1 }; + jsdisp_t *iface_to_jsdisp(IDispatch*); typedef HRESULT (*builtin_invoke_t)(script_ctx_t*,jsval_t,WORD,unsigned,jsval_t*,jsval_t*); @@ -452,11 +465,12 @@ struct _script_ctx_t { jsdisp_t *vbarray_constr; jsdisp_t *arraybuf_constr; jsdisp_t *dataview_constr; + jsdisp_t *typedarr_constr[LAST_TYPEDARRAY_JSCLASS - FIRST_TYPEDARRAY_JSCLASS + 1]; jsdisp_t *map_prototype; jsdisp_t *set_prototype; jsdisp_t *weakmap_prototype; }; - jsdisp_t *global_objects[25]; + jsdisp_t *global_objects[25 + LAST_TYPEDARRAY_JSCLASS - FIRST_TYPEDARRAY_JSCLASS + 1]; }; }; C_ASSERT(RTL_SIZEOF_THROUGH_FIELD(script_ctx_t, weakmap_prototype) == RTL_SIZEOF_THROUGH_FIELD(script_ctx_t, global_objects)); @@ -593,6 +607,9 @@ static inline HRESULT disp_call_value(script_ctx_t *ctx, IDispatch *disp, jsval_ #define JS_E_OBJECT_NONEXTENSIBLE MAKE_JSERROR(IDS_OBJECT_NONEXTENSIBLE) #define JS_E_NONCONFIGURABLE_REDEFINED MAKE_JSERROR(IDS_NONCONFIGURABLE_REDEFINED) #define JS_E_NONWRITABLE_MODIFIED MAKE_JSERROR(IDS_NONWRITABLE_MODIFIED) +#define JS_E_TYPEDARRAY_BAD_CTOR_ARG MAKE_JSERROR(IDS_TYPEDARRAY_BAD_CTOR_ARG) +#define JS_E_NOT_TYPEDARRAY MAKE_JSERROR(IDS_NOT_TYPEDARRAY) +#define JS_E_TYPEDARRAY_INVALID_OFFSLEN MAKE_JSERROR(IDS_TYPEDARRAY_INVALID_OFFSLEN) #define JS_E_NOT_DATAVIEW MAKE_JSERROR(IDS_NOT_DATAVIEW) #define JS_E_DATAVIEW_NO_ARGUMENT MAKE_JSERROR(IDS_DATAVIEW_NO_ARGUMENT) #define JS_E_DATAVIEW_INVALID_ACCESS MAKE_JSERROR(IDS_DATAVIEW_INVALID_ACCESS) diff --git a/dlls/jscript/jscript.rc b/dlls/jscript/jscript.rc index 438aaad4c358..d4846fb3cee4 100644 --- a/dlls/jscript/jscript.rc +++ b/dlls/jscript/jscript.rc @@ -77,6 +77,9 @@ STRINGTABLE IDS_OBJECT_NONEXTENSIBLE "Cannot define property '|': object is not extensible" IDS_NONCONFIGURABLE_REDEFINED "Cannot redefine non-configurable property '|'" IDS_NONWRITABLE_MODIFIED "Cannot modify non-writable property '|'" + IDS_NOT_TYPEDARRAY "'this' is not a typed array object" + IDS_TYPEDARRAY_BAD_CTOR_ARG "Typed array constructor argument is invalid" + IDS_TYPEDARRAY_INVALID_OFFSLEN "Invalid offset/length when creating typed array" IDS_NOT_DATAVIEW "'this' is not a DataView object" IDS_DATAVIEW_NO_ARGUMENT "Required argument offset or value in DataView method is not specified" IDS_DATAVIEW_INVALID_ACCESS "DataView operation access beyond specified buffer length" diff --git a/dlls/jscript/object.c b/dlls/jscript/object.c index feeff5c294af..a2d0998007a5 100644 --- a/dlls/jscript/object.c +++ b/dlls/jscript/object.c @@ -53,6 +53,14 @@ static HRESULT Object_toString(script_ctx_t *ctx, jsval_t vthis, WORD flags, uns L"[object Object]", L"[object ArrayBuffer]", L"[object Object]", + L"[object Int8Array]", + L"[object Int16Array]", + L"[object Int32Array]", + L"[object Uint8Array]", + L"[object Uint16Array]", + L"[object Uint32Array]", + L"[object Float32Array]", + L"[object Float64Array]", L"[object Object]", L"[object Object]", L"[object Object]", diff --git a/dlls/jscript/resource.h b/dlls/jscript/resource.h index 640cc01cff9f..fd21452aa770 100644 --- a/dlls/jscript/resource.h +++ b/dlls/jscript/resource.h @@ -75,6 +75,9 @@ #define IDS_OBJECT_NONEXTENSIBLE 0x13D5 #define IDS_NONCONFIGURABLE_REDEFINED 0x13D6 #define IDS_NONWRITABLE_MODIFIED 0x13D7 +#define IDS_TYPEDARRAY_BAD_CTOR_ARG 0x13DA +#define IDS_NOT_TYPEDARRAY 0x13DB +#define IDS_TYPEDARRAY_INVALID_OFFSLEN 0x13DC #define IDS_NOT_DATAVIEW 0x13DF #define IDS_DATAVIEW_NO_ARGUMENT 0x13E0 #define IDS_DATAVIEW_INVALID_ACCESS 0x13E1 diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 9f77b07f4e23..cacf24745c31 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -154,7 +154,7 @@ sync_test("window own props", function() { "CompositionEvent", "ControlRangeCollection", "Coordinates", ["Crypto",11], ["CryptoOperation",11], "CSSFontFaceRule", "CSSImportRule", ["CSSKeyframeRule",10], ["CSSKeyframesRule",10], "CSSMediaRule", "CSSNamespaceRule", "CSSPageRule", "CSSRuleList", "DataTransfer", ["DataView",9,9], "Debug", ["DeviceAcceleration",11], ["DeviceMotionEvent",11], ["DeviceOrientationEvent",11], ["DeviceRotationRate",11], ["DOMError",10], "DOMException", "DOMParser", ["DOMSettableTokenList",10], ["DOMStringList",10], ["DOMStringMap",11], - "DragEvent", ["ErrorEvent",10], "EventException", ["EXT_texture_filter_anisotropic",11], ["File",10], ["FileList",10], ["FileReader",10], ["Float32Array",10], ["Float64Array",10], + "DragEvent", ["ErrorEvent",10], "EventException", ["EXT_texture_filter_anisotropic",11], ["File",10], ["FileList",10], ["FileReader",10], ["Float32Array",9,9], ["Float64Array",9,9], "FocusEvent", ["FormData",10], "Geolocation", "GetObject", ["HTMLAllCollection",11], "HTMLAppletElement", "HTMLAreasCollection", "HTMLAudioElement", "HTMLBaseElement", "HTMLBaseFontElement", "HTMLBGSoundElement", "HTMLBlockElement", "HTMLBRElement", "HTMLCanvasElement", ["HTMLDataListElement",10], "HTMLDDElement", "HTMLDirectoryElement", "HTMLDivElement", "HTMLDListElement", "HTMLDTElement", "HTMLFieldSetElement", "HTMLFontElement", "HTMLFrameSetElement", "HTMLHeadingElement", "HTMLHRElement", "HTMLIsIndexElement", @@ -162,7 +162,7 @@ sync_test("window own props", function() { "HTMLOptGroupElement", "HTMLParagraphElement", "HTMLParamElement", "HTMLPhraseElement", "HTMLPreElement", ["HTMLProgressElement",10], "HTMLQuoteElement", "HTMLSourceElement", "HTMLSpanElement", "HTMLTableCaptionElement", "HTMLTableColElement", "HTMLTableHeaderCellElement", "HTMLTableSectionElement", ["HTMLTrackElement",10], "HTMLUListElement", "HTMLVideoElement", ["IDBCursor",10], ["IDBCursorWithValue",10], ["IDBDatabase",10], ["IDBFactory",10], ["IDBIndex",10], ["IDBKeyRange",10], ["IDBObjectStore",10], ["IDBOpenDBRequest",10], - ["IDBRequest",10], ["IDBTransaction",10], ["IDBVersionChangeEvent",10], "ImageData", ["Int16Array",10], ["Int32Array",10], ["Int8Array",10], ["Intl",11], ["Key",11], ["KeyOperation",11], + ["IDBRequest",10], ["IDBTransaction",10], ["IDBVersionChangeEvent",10], "ImageData", ["Int16Array",9,9], ["Int32Array",9,9], ["Int8Array",9,9], ["Intl",11], ["Key",11], ["KeyOperation",11], ["KeyPair",11], "Location", "MediaError", "MediaList", ["MediaSource",11], ["MessageChannel",10], ["MessagePort",10], ["MimeType",11], ["MimeTypeArray",9,10], "MouseWheelEvent", "MSBehaviorUrnsCollection", ["MSBlobBuilder",10], "MSCompatibleInfo", "MSCompatibleInfoCollection", ["MSCSSMatrix",10], ["MSGesture",10], ["MSGestureEvent",10], ["MSGraphicsTrust",11], ["MSInputMethodContext",11], ["MSManipulationEvent",10], ["MSMediaKeyError",11], ["MSMediaKeyMessageEvent",11], ["MSMediaKeyNeededEvent",11], ["MSMediaKeys",11], ["MSMediaKeySession",11], @@ -185,8 +185,8 @@ sync_test("window own props", function() { "SVGPatternElement", "SVGPoint", "SVGPointList", "SVGPolygonElement", "SVGPolylineElement", "SVGPreserveAspectRatio", "SVGRadialGradientElement", "SVGRect", "SVGRectElement", "SVGScriptElement", "SVGStopElement", "SVGStringList", "SVGStyleElement", "SVGSwitchElement", "SVGSymbolElement", "SVGTextElement", "SVGTextPathElement", "SVGTitleElement", "SVGTransform", "SVGTransformList", "SVGUnitTypes", "SVGUseElement", "SVGViewElement", "SVGZoomAndPan", "SVGZoomEvent", "TextEvent", "TextMetrics", "TextRangeCollection", ["TextTrack",10], - ["TextTrackCue",10], ["TextTrackCueList",10], ["TextTrackList",10], "TimeRanges", ["TrackEvent",10], ["TransitionEvent",10], "TreeWalker", ["Uint16Array",10], ["Uint32Array",10], - ["Uint8Array",10], ["Uint8ClampedArray",11], ["URL",10], ["ValidityState",10], ["VideoPlaybackQuality",11], ["WebGLActiveInfo",11], ["WebGLBuffer",11], ["WebGLContextEvent",11], + ["TextTrackCue",10], ["TextTrackCueList",10], ["TextTrackList",10], "TimeRanges", ["TrackEvent",10], ["TransitionEvent",10], "TreeWalker", ["Uint16Array",9,9], ["Uint32Array",9,9], + ["Uint8Array",9,9], ["Uint8ClampedArray",11], ["URL",10], ["ValidityState",10], ["VideoPlaybackQuality",11], ["WebGLActiveInfo",11], ["WebGLBuffer",11], ["WebGLContextEvent",11], ["WebGLFramebuffer",11], ["WebGLObject",11], ["WebGLProgram",11], ["WebGLRenderbuffer",11], ["WebGLRenderingContext",11], ["WebGLShader",11], ["WebGLShaderPrecisionFormat",11], ["WebGLTexture",11], ["WebGLUniformLocation",11], ["WEBGL_compressed_texture_s3tc",11], ["WEBGL_debug_renderer_info",11], ["WebSocket",10], "WheelEvent", ["Worker",10], ["XDomainRequest",9,10], ["XMLDocument",11], ["XMLHttpRequestEventTarget",10], "XMLSerializer" diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index 19c995314eb6..bdbdb2eb106a 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -33,6 +33,9 @@ var JS_E_INVALID_LENGTH = 0x800a13a5; var JS_E_INVALID_WRITABLE_PROP_DESC = 0x800a13ac; var JS_E_NONCONFIGURABLE_REDEFINED = 0x800a13d6; var JS_E_NONWRITABLE_MODIFIED = 0x800a13d7; +var JS_E_TYPEDARRAY_BAD_CTOR_ARG = 0x800a13da; +var JS_E_NOT_TYPEDARRAY = 0x800a13db; +var JS_E_TYPEDARRAY_INVALID_OFFSLEN = 0x800a13dc; var JS_E_NOT_DATAVIEW = 0x800a13df; var JS_E_DATAVIEW_NO_ARGUMENT = 0x800a13e0; var JS_E_DATAVIEW_INVALID_ACCESS = 0x800a13e1; @@ -1757,7 +1760,7 @@ sync_test("RegExp", function() { }); sync_test("ArrayBuffers & Views", function() { - var i, r, buf, buf2, view, view2, arr; + var i, r, buf, buf2, view, view2, arr, arr2; var types = [ [ "Int8", 1 ], @@ -2100,6 +2103,190 @@ sync_test("ArrayBuffers & Views", function() { ok(r === undefined, "buf.slice(-9) view(1).setFloat64(0, 11.875) returned " + r); r = view2.getFloat64(0); ok(r === 11.875, "buf.slice(-9) view(1).getFloat64(0) returned " + r); + + for(i = 0; i < types.length; i++) { + var arrType = types[i][0] + "Array", typeSz = types[i][1]; + test_own_props(arrType, [ "BYTES_PER_ELEMENT" ]); + test_not_own_props(arrType, [ "from", "of" ]); + test_own_props(arrType + ".prototype", [ "buffer", "byteLength", "byteOffset", "length", "set", "subarray" ]); + test_not_own_props(arrType + ".prototype", [ + "at", "copyWithin", "entries", "every", "fill", "filter", "find", "findIndex", "forEach", + "includes", "indexOf", "join", "keys", "lastIndexOf", "map", "reduce", "reduceRight", + "reverse", "slice", "some", "sort", "toLocaleString", "toString", "values" + ]); + + arr = eval(arrType); + test_own_data_prop_desc(arr, "BYTES_PER_ELEMENT", false, false, false); + ok(arr.BYTES_PER_ELEMENT === typeSz, arrType + ".BYTES_PER_ELEMENT = " + arr.BYTES_PER_ELEMENT); + r = arr.length; + ok(r === 1, arrType + ".length = " + r); + r = arr.prototype.set.length; + ok(r === 2, arrType + ".prototype.set.length = " + r); + r = arr.prototype.subarray.length; + ok(r === 2, arrType + ".prototype.subarray.length = " + r); + + r = eval("Object.getPrototypeOf(" + arrType + ")"); + ok(r === Function.prototype, arrType + "'s prototype is not Function.prototype: " + r); + r = eval("Object.getPrototypeOf(" + arrType + ".prototype)"); + ok(r === Object.prototype, arrType + ".prototype's prototype is not Object.prototype: " + r); + r = eval("Object.prototype.toString.call(new " + arrType + "(3))"); + ok(r === "[object " + arrType + "]", "Object toString(new " + arrType + "(3)) = " + r); + r = eval(arrType + ".prototype"); + test_own_data_prop_desc(r, "byteLength", false, false, false); + test_own_data_prop_desc(r, "byteOffset", false, false, false); + test_own_data_prop_desc(r, "length", false, false, false); + test_own_data_prop_desc(r, "buffer", false, false, false); + + try { + eval("new " + arrType + "(-1)"); + ok(false, "new " + arrType + "(-1) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_OFFSLEN, "new " + arrType + "(-1) threw " + n); + } + try { + eval("new " + arrType + "('9')"); + ok(false, "new " + arrType + "('9') did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_BAD_CTOR_ARG, "new " + arrType + "('9') threw " + n); + } + try { + eval("new " + arrType + "(null)"); + ok(false, "new " + arrType + "(null) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_BAD_CTOR_ARG, "new " + arrType + "(null) threw " + n); + } + + arr = eval("new " + arrType + "()"); + ok(arr.byteLength === 0, arrType + "().byteLength = " + arr.byteLength); + ok(arr.byteOffset === 0, arrType + "().byteOffset = " + arr.byteOffset); + ok(arr.length === 0, arrType + "().length = " + arr.length); + ok(arr.buffer.byteLength === 0, arrType + "().buffer.byteLength = " + arr.buffer.byteLength); + test_readonly(arr, "byteLength", 0); + test_readonly(arr, "byteOffset", 0); + test_readonly(arr, "length", 0); + test_own_data_prop_desc(arr, "byteLength", false, false, false); + test_own_data_prop_desc(arr, "byteOffset", false, false, false); + test_own_data_prop_desc(arr, "length", false, false, false); + test_own_data_prop_desc(arr, "buffer", false, false, false); + + Object.freeze(arr); + ok(Object.isFrozen(arr) === true, arrType + "() not frozen"); + + arr = eval(arrType + "(9.1)"); + ok(arr.byteLength === 9 * typeSz, arrType + "(9.1).byteLength = " + arr.byteLength); + ok(arr.byteOffset === 0, arrType + "(9.1).byteOffset = " + arr.byteOffset); + ok(arr.length === 9, arrType + "(9.1).length = " + arr.length); + ok(arr.buffer.byteLength === arr.byteLength, arrType + "(9.1).buffer.byteLength = " + arr.buffer.byteLength); + for(var j = 0; j < 9; j++) + ok(arr[j] === 0, "arr[" + j + "] = " + arr[j]); + arr[5] = 42; + ok(arr[5] === 42, arrType + "(9.1)[5] = " + arr[5]); + arr[9] = 50; + ok(arr[9] === undefined, arrType + "(9.1)[9] = " + arr[9]); + + eval(arrType + ".prototype[6] = 'foo'"); + r = eval(arrType + ".prototype[6]"); + ok(r === undefined, arrType + ".prototype[6] = " + r); + ok(arr[6] === 0, arrType + "(9.1)[6] after set in prototype = " + arr[6]); + arr[6] = 0; + ok(Object.prototype.hasOwnProperty.call(arr, "6"), "'6' not a property of " + arrType + "(9.1)[6]"); + test_own_data_prop_desc(arr, "6", true, true, false); + r = (delete arr[6]); + ok(r === false, "delete " + arrType + "(9.1)[6] returned " + r); + try { + Object.defineProperty(arr, "6", {writable: false, enumerable: false, configurable: true, value: 10}); + ok(false, "redefining " + arrType + "(9.1)[6] with different flags did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NONCONFIGURABLE_REDEFINED, "redefining " + arrType + "(9.1)[6] with different flags threw " + n); + } + Object.defineProperty(arr, "6", {writable: true, enumerable: true, configurable: false, value: 10}); + ok(arr[6] === 10, arrType + "(9.1)[6] after definition = " + arr[6]); + Object.defineProperty(arr, "6", {writable: true, enumerable: true, configurable: false, value: "foo"}); + if(arrType.substr(0, 5) === "Float") + ok(arr[6] !== arr[6] /* NaN */, arrType + "(9.1)[6] after definition to string = " + arr[6]); + else + ok(arr[6] === 0, arrType + "(9.1)[6] after definition to string = " + arr[6]); + + eval(arrType + ".prototype[100] = 'foobar'"); + r = eval(arrType + ".prototype[100]"); + ok(r === undefined, arrType + ".prototype[100] = " + r); + ok(arr[100] === undefined, arrType + "(9.1)[100] after set in prototype = " + arr[100]); + arr[100] = 0; + ok(arr[100] === undefined, arrType + "(9.1)[100] after set to zero = " + arr[100]); + ok(!Object.prototype.hasOwnProperty.call(arr, "100"), "'100' is a property of " + arrType + "(9.1)[100]"); + r = (delete arr[100]); + ok(r === false, "delete " + arrType + "(9.1)[100] returned " + r); + try { + Object.defineProperty(arr, "100", {writable: false, enumerable: false, configurable: true, value: 10}); + ok(false, "redefining " + arrType + "(9.1)[100] with different flags did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NONCONFIGURABLE_REDEFINED, "redefining " + arrType + "(9.1)[100] with different flags threw " + n); + } + Object.defineProperty(arr, "100", {writable: true, enumerable: true, configurable: false, value: 10}); + ok(arr[100] === undefined, arrType + "(9.1)[100] after defined to 10 = " + arr[100]); + ok(!Object.prototype.hasOwnProperty.call(arr, "100"), "'100' is a property of " + arrType + "(9.1)[100] after definition"); + ok(arr[100] === undefined, arrType + "(9.1)[100] after definition = " + arr[100]); + + r = 0; + for(var idx in arr) { + ok(idx === ""+r, arrType + "(9.1) enum idx " + r + " = " + idx); + r++; + } + ok(r === 9, arrType + "(9.1) enum did " + r + " iterations"); + + eval(arrType + ".prototype[-1] = 'barfoo'"); + r = eval(arrType + ".prototype[-1]"); + ok(r === "barfoo", arrType + ".prototype[-1] = " + r); + ok(arr[-1] === "barfoo", arrType + "(9.1)[-1] after set in prototype = " + arr[-1]); + + eval(arrType + ".prototype.foo = 'bar'"); + r = eval(arrType + ".prototype.foo = 'bar'"); + ok(r === "bar", arrType + ".prototype.foo = " + r); + ok(arr.foo === "bar", arrType + "(9.1).foo after set in prototype = " + arr.foo); + Object.freeze(arr); + ok(Object.isFrozen(arr) === true, arrType + "(9.1) not frozen"); + arr = eval(arrType + ".prototype"); + delete arr[-1]; + delete arr.foo; + } + + arr = new Int16Array(2); + arr[0] = 65535; + arr[1] = -65535; + ok(arr[0] == -1, "16-bit arr[0] after overflow = " + arr[0]); + ok(arr[1] == 1, "16-bit arr[1] after overflow = " + arr[1]); + + arr = new Uint8Array(2); + arr[0] = -2; + arr[1] = 258; + ok(arr[0] == 254, "8-bit arr[0] after overflow = " + arr[0]); + ok(arr[1] == 2, "8-bit arr[1] after overflow = " + arr[1]); + + arr = new Int8Array(); + arr2 = new Int32Array(); + + /* methods are incompatible, even though thrown error is not explicit */ + ok(Uint16Array.prototype.subarray !== Int32Array.prototype.subarray, "Uint16Array and Int32Array have same subarray methods"); + ok(Int8Array.prototype.set !== Float32Array.prototype.set, "Int8Array and Float32Array have same set methods"); + try { + Uint8Array.prototype.set.call(arr, [12, 50]); + ok(false, "calling Uint8Array's set with Int8Array context did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_TYPEDARRAY, "calling Uint8Array's set with Int8Array context threw " + n); + } + try { + Uint32Array.prototype.subarray.call(arr2, 0); + ok(false, "calling Uint32Array's subarray with Int32Array context did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_TYPEDARRAY, "calling Uint32Array's subarray with Int32Array context threw " + n); + } }); sync_test("builtin_context", function() { @@ -2196,7 +2383,12 @@ sync_test("globals override", function() { "Error", "escape", "EvalError", + "Float32Array", + "Float64Array", "Function", + "Int8Array", + "Int16Array", + "Int32Array", "isFinite", "isNaN", "JSON", @@ -2216,6 +2408,9 @@ sync_test("globals override", function() { "String", "SyntaxError", "TypeError", + "Uint8Array", + "Uint16Array", + "Uint32Array", "unescape", "URIError", "VBArray", From fa100fb9eb6bd9684d2e2ee1876d4648a105c392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:06 +0200 Subject: [PATCH 1329/2542] jscript: Implement Typed Array construction on ArrayBuffers. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/arraybuf.c | 34 ++++++++++++++++++++++-- dlls/mshtml/tests/es5.js | 57 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 2 deletions(-) diff --git a/dlls/jscript/arraybuf.c b/dlls/jscript/arraybuf.c index 457518cd3987..52321fec37e5 100644 --- a/dlls/jscript/arraybuf.c +++ b/dlls/jscript/arraybuf.c @@ -964,8 +964,38 @@ static HRESULT TypedArrayConstr_value(script_ctx_t *ctx, jsval_t vthis, WORD fla if(!obj) return JS_E_TYPEDARRAY_BAD_CTOR_ARG; - FIXME("Construction from object not implemented\n"); - return E_NOTIMPL; + if(obj->builtin_info->class == JSCLASS_ARRAYBUFFER) { + buffer = arraybuf_from_jsdisp(obj); + if(argc > 1) { + hres = to_integer(ctx, argv[1], &n); + if(FAILED(hres)) + return hres; + if(n < 0.0 || n > buffer->size) + return JS_E_TYPEDARRAY_INVALID_OFFSLEN; + offset = n; + if(offset % elem_size) + return JS_E_TYPEDARRAY_INVALID_OFFSLEN; + } + if(argc > 2 && !is_undefined(argv[2])) { + hres = to_integer(ctx, argv[2], &n); + if(FAILED(hres)) + return hres; + if(n < 0.0 || n > UINT_MAX) + return JS_E_TYPEDARRAY_INVALID_OFFSLEN; + length = n; + if(offset + length * elem_size > buffer->size) + return JS_E_TYPEDARRAY_INVALID_OFFSLEN; + }else { + length = buffer->size - offset; + if(length % elem_size) + return JS_E_TYPEDARRAY_INVALID_OFFSLEN; + length /= elem_size; + } + jsdisp_addref(&buffer->dispex); + }else { + FIXME("Construction from object not implemented\n"); + return E_NOTIMPL; + } }else if(is_number(argv[0])) { hres = to_integer(ctx, argv[0], &n); if(FAILED(hres)) diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index bdbdb2eb106a..debbd60eb2e4 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -2137,6 +2137,7 @@ sync_test("ArrayBuffers & Views", function() { test_own_data_prop_desc(r, "length", false, false, false); test_own_data_prop_desc(r, "buffer", false, false, false); + buf = ArrayBuffer(34); try { eval("new " + arrType + "(-1)"); ok(false, "new " + arrType + "(-1) did not throw exception"); @@ -2144,6 +2145,27 @@ sync_test("ArrayBuffers & Views", function() { var n = ex.number >>> 0; ok(n === JS_E_TYPEDARRAY_INVALID_OFFSLEN, "new " + arrType + "(-1) threw " + n); } + try { + eval("new " + arrType + "(buf, -1)"); + ok(false, "new " + arrType + "(buf, -1) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_OFFSLEN, "new " + arrType + "(buf, -1) threw " + n); + } + try { + eval("new " + arrType + "(buf, 36)"); + ok(false, "new " + arrType + "(buf, 36) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_OFFSLEN, "new " + arrType + "(buf, 36) threw " + n); + } + try { + eval("new " + arrType + "(buf, 32, 4)"); + ok(false, "new " + arrType + "(buf, 32, 4) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_OFFSLEN, "new " + arrType + "(buf, 32, 4) threw " + n); + } try { eval("new " + arrType + "('9')"); ok(false, "new " + arrType + "('9') did not throw exception"); @@ -2158,6 +2180,26 @@ sync_test("ArrayBuffers & Views", function() { var n = ex.number >>> 0; ok(n === JS_E_TYPEDARRAY_BAD_CTOR_ARG, "new " + arrType + "(null) threw " + n); } + if(typeSz > 1) { + /* test misalignment */ + var a = typeSz >>> 1; + try { + eval("new " + arrType + "(buf, a, 1)"); + ok(false, "new " + arrType + "(buf, " + a + ", 1) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_OFFSLEN, "new " + arrType + "(buf, " + a + ", 1) threw " + n); + } + a += typeSz; + var b = new ArrayBuffer(a); + try { + eval("new " + arrType + "(b)"); + ok(false, "new " + arrType + "(new ArrayBuffer(" + a + ")) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_OFFSLEN, "new " + arrType + "(new ArrayBuffer(" + a + ")) threw " + n); + } + } arr = eval("new " + arrType + "()"); ok(arr.byteLength === 0, arrType + "().byteLength = " + arr.byteLength); @@ -2253,6 +2295,21 @@ sync_test("ArrayBuffers & Views", function() { arr = eval(arrType + ".prototype"); delete arr[-1]; delete arr.foo; + + name = arrType + "(buf, " + typeSz + ", 2)"; + arr = eval(name); + ok(arr.byteLength === 2 * typeSz, name + ".byteLength = " + arr.byteLength); + ok(arr.byteOffset === typeSz, name + ".byteOffset = " + arr.byteOffset); + ok(arr.length === 2, name + ".length = " + arr.length); + ok(arr.buffer === buf, name + ".buffer = " + arr.buffer); + view = DataView(buf); + view["set" + types[i][0]](typeSz, 10, true); + ok(arr[0] === 10, "arr[0] after DataView(buf).set" + types[i][0] + " = " + arr[0]); + arr[0] = 12; + r = view["get" + types[i][0]](typeSz, true); + ok(r === 12, "DataView(buf).get" + types[i][0] + " after arr[0] set = " + r); + Object.freeze(arr); + ok(Object.isFrozen(arr) === true, name + " not frozen"); } arr = new Int16Array(2); From d2edaec52c5813081fae2b5987b8de571cbdbb10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:07 +0200 Subject: [PATCH 1330/2542] jscript: Implement ArrayBuffer.isView. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/arraybuf.c | 15 +++++++++++++-- dlls/jscript/jscript.h | 2 ++ dlls/mshtml/tests/es5.js | 13 +++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/dlls/jscript/arraybuf.c b/dlls/jscript/arraybuf.c index 52321fec37e5..12d44b88e0a8 100644 --- a/dlls/jscript/arraybuf.c +++ b/dlls/jscript/arraybuf.c @@ -171,9 +171,20 @@ static HRESULT create_arraybuf(script_ctx_t *ctx, DWORD size, ArrayBufferInstanc static HRESULT ArrayBufferConstr_isView(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { - FIXME("not implemented\n"); + BOOL ret = FALSE; + jsdisp_t *obj; - return E_NOTIMPL; + TRACE("\n"); + + if(!r) + return S_OK; + + if(argc && is_object_instance(argv[0]) && (obj = to_jsdisp(get_object(argv[0]))) && + obj->builtin_info->class >= FIRST_VIEW_JSCLASS && obj->builtin_info->class <= LAST_VIEW_JSCLASS) + ret = TRUE; + + *r = jsval_bool(ret); + return S_OK; } static HRESULT ArrayBufferConstr_value(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 97da2dba587e..bfbb7f740b47 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -128,6 +128,8 @@ typedef enum { FIRST_TYPEDARRAY_JSCLASS = JSCLASS_INT8ARRAY, LAST_TYPEDARRAY_JSCLASS = JSCLASS_FLOAT64ARRAY, + FIRST_VIEW_JSCLASS = JSCLASS_DATAVIEW, + LAST_VIEW_JSCLASS = JSCLASS_FLOAT64ARRAY, } jsclass_t; enum { NUM_TYPEDARRAY_TYPES = LAST_TYPEDARRAY_JSCLASS - FIRST_TYPEDARRAY_JSCLASS + 1 }; diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index debbd60eb2e4..dc2d7a162bd8 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -1836,6 +1836,13 @@ sync_test("ArrayBuffers & Views", function() { test_readonly(buf, "byteLength", 10); test_own_data_prop_desc(buf, "byteLength", false, false, false); + ok(ArrayBuffer.isView() === false, "ArrayBuffer.isView() returned true"); + ok(ArrayBuffer.isView([]) === false, "ArrayBuffer.isView([]) returned true"); + ok(ArrayBuffer.isView({}) === false, "ArrayBuffer.isView({}) returned true"); + ok(ArrayBuffer.isView(undefined) === false, "ArrayBuffer.isView(undefined) returned true"); + ok(ArrayBuffer.isView(null) === false, "ArrayBuffer.isView(null) returned true"); + ok(ArrayBuffer.isView(buf) === false, "ArrayBuffer.isView(ArrayBuffer) returned true"); + test_own_props("DataView.prototype", [ "buffer", "byteLength", "byteOffset", "getInt8", "setInt8", "getUint8", "setUint8", @@ -1956,6 +1963,9 @@ sync_test("ArrayBuffers & Views", function() { ok(view.byteLength === 10, "DataView(buf).byteLength = " + view.byteLength); ok(view.byteOffset === 0, "DataView(buf).byteOffset = " + view.byteOffset); + ok(ArrayBuffer.isView(DataView) === false, "ArrayBuffer.isView(DataView) returned true"); + ok(ArrayBuffer.isView(view) === true, "ArrayBuffer.isView(DataView(buf)) returned false"); + for(i = 0; i < 10; i++) { r = view.getInt8(i); ok(r === 0, "view byte " + i + " = " + r); @@ -2090,6 +2100,8 @@ sync_test("ArrayBuffers & Views", function() { ok(buf2.byteLength === 9, "buf.slice(-9).byteLength = " + buf2.byteLength); view2 = DataView(buf2, 1); ok(view2.byteLength === 8, "buf.slice(-9) view(1).byteLength = " + view2.byteLength); + ok(ArrayBuffer.isView(buf2) === false, "ArrayBuffer.isView(buf.slice(-9)) returned true"); + ok(ArrayBuffer.isView(view2) === true, "ArrayBuffer.isView(DataView(buf.slice(-9))) returned false"); r = view2.getUint32(0); ok(r === 4294967040, "buf.slice(-9) view(1).getUint32(0) returned " + r); @@ -2214,6 +2226,7 @@ sync_test("ArrayBuffers & Views", function() { test_own_data_prop_desc(arr, "length", false, false, false); test_own_data_prop_desc(arr, "buffer", false, false, false); + ok(ArrayBuffer.isView(arr) === true, "ArrayBuffer.isView(" + arrType + "()) returned false"); Object.freeze(arr); ok(Object.isFrozen(arr) === true, arrType + "() not frozen"); From 57ba6b55b5180ee13570da19b0ec47451500d048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:07 +0200 Subject: [PATCH 1331/2542] jscript: Implement Typed Array construction from objects. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- fill_typedarr_data_from_object will also be used for 'set'. --- dlls/jscript/arraybuf.c | 66 ++++++++++++++++++++++++++++++++++++++-- dlls/mshtml/tests/es5.js | 47 +++++++++++++++++++++++++++- 2 files changed, 110 insertions(+), 3 deletions(-) diff --git a/dlls/jscript/arraybuf.c b/dlls/jscript/arraybuf.c index 12d44b88e0a8..9cec7296eb1f 100644 --- a/dlls/jscript/arraybuf.c +++ b/dlls/jscript/arraybuf.c @@ -18,6 +18,7 @@ #include +#include #include "jscript.h" @@ -766,6 +767,40 @@ static HRESULT TypedArray_get_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_ return S_OK; } +static HRESULT fill_typedarr_data_from_object(script_ctx_t *ctx, BYTE *data, jsdisp_t *obj, DWORD length, jsclass_t jsclass) +{ + HRESULT hres = S_OK; + jsval_t val; + UINT32 i; + + switch(jsclass) { +#define X(NAME, JSCLASS, TYPE, CONVERT, NUM_TYPE) \ + case JSCLASS: \ + for(i = 0; i < length; i++) { \ + NUM_TYPE n; \ + \ + hres = jsdisp_get_idx(obj, i, &val); \ + if(FAILED(hres)) { \ + if(hres != DISP_E_UNKNOWNNAME) \ + break; \ + val = jsval_undefined(); \ + } \ + \ + hres = CONVERT(ctx, val, &n); \ + jsval_release(val); \ + if(FAILED(hres)) \ + break; \ + *(TYPE*)&data[i * sizeof(TYPE)] = n; \ + } \ + break; + TYPEDARRAY_LIST + DEFAULT_UNREACHABLE; +#undef X + } + + return hres; +} + static HRESULT TypedArray_set(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r, jsclass_t jsclass) { @@ -1004,8 +1039,35 @@ static HRESULT TypedArrayConstr_value(script_ctx_t *ctx, jsval_t vthis, WORD fla } jsdisp_addref(&buffer->dispex); }else { - FIXME("Construction from object not implemented\n"); - return E_NOTIMPL; + jsval_t val; + UINT32 len; + DWORD size; + + hres = jsdisp_propget_name(obj, L"length", &val); + if(FAILED(hres)) + return hres; + if(is_undefined(val)) + return JS_E_TYPEDARRAY_BAD_CTOR_ARG; + + hres = to_uint32(ctx, val, &len); + jsval_release(val); + if(FAILED(hres)) + return hres; + + length = len; + size = length * elem_size; + if(size < length || size > (UINT_MAX - FIELD_OFFSET(ArrayBufferInstance, buf[0]))) + return E_OUTOFMEMORY; + + hres = create_arraybuf(ctx, size, &buffer); + if(FAILED(hres)) + return hres; + + hres = fill_typedarr_data_from_object(ctx, buffer->buf, obj, length, jsclass); + if(FAILED(hres)) { + jsdisp_release(&buffer->dispex); + return hres; + } } }else if(is_number(argv[0])) { hres = to_integer(ctx, argv[0], &n); diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index dc2d7a162bd8..c4320435be11 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -2192,6 +2192,13 @@ sync_test("ArrayBuffers & Views", function() { var n = ex.number >>> 0; ok(n === JS_E_TYPEDARRAY_BAD_CTOR_ARG, "new " + arrType + "(null) threw " + n); } + try { + eval("new " + arrType + "({})"); + ok(false, "new " + arrType + "({}) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_BAD_CTOR_ARG, "new " + arrType + "({}) threw " + n); + } if(typeSz > 1) { /* test misalignment */ var a = typeSz >>> 1; @@ -2309,6 +2316,23 @@ sync_test("ArrayBuffers & Views", function() { delete arr[-1]; delete arr.foo; + arr2 = { length: 4 }; + arr2[0] = 1.5; + arr2[1] = '3'; + arr2[3] = 12; + var name = arrType + "(array-like object)"; + arr = eval(arrType + "(arr2)"); + ok(arr.byteLength === 4 * typeSz, name + ".byteLength = " + arr.byteLength); + ok(arr.byteOffset === 0, name + ".byteOffset = " + arr.byteOffset); + ok(arr.length === 4, name + ".length = " + arr.length); + if(isNaN(arr[2])) { + ok(arr[0] === 1.5, name + "[0] = " + arr[0]); + ok(arr[1] === 3, name + "[1] = " + arr[1]); + ok(arr[3] === 12, name + "[3] = " + arr[3]); + }else + for(var j = 0; j < 4; j++) + ok(arr[j] === [1, 3, 0, 12][j], name + "[" + j + "] = " + arr[j]); + name = arrType + "(buf, " + typeSz + ", 2)"; arr = eval(name); ok(arr.byteLength === 2 * typeSz, name + ".byteLength = " + arr.byteLength); @@ -2323,7 +2347,28 @@ sync_test("ArrayBuffers & Views", function() { ok(r === 12, "DataView(buf).get" + types[i][0] + " after arr[0] set = " + r); Object.freeze(arr); ok(Object.isFrozen(arr) === true, name + " not frozen"); - } + + arr2 = eval(arrType + "(arr)"); + ok(arr2.byteLength === arr.byteLength, name + " copy.byteLength = " + arr2.byteLength); + ok(arr2.byteOffset === 0, name + " copy.byteOffset = " + arr2.byteOffset); + ok(arr2.length === arr.length, name + " copy.length = " + arr2.length); + ok(arr2.buffer !== arr.buffer, name + " copy.buffer = " + arr2.buffer); + } + + arr = new Float32Array(3); + arr[0] = 1.125; + arr[1] = 2.25; + arr[2] = 3.375; + arr2 = new Uint16Array(arr); + ok(arr[0] === 1.125, "arr[0] = " + arr[0]); + ok(arr[1] === 2.25, "arr[1] = " + arr[1]); + ok(arr[2] === 3.375, "arr[2] = " + arr[2]); + ok(arr2[0] === 1, "arr2[0] = " + arr2[0]); + ok(arr2[1] === 2, "arr2[1] = " + arr2[1]); + ok(arr2[2] === 3, "arr2[2] = " + arr2[2]); + arr2[0] = 100; + ok(arr[0] === 1.125, "arr[0] after arr2[0] changed = " + arr[0]); + ok(arr2[0] === 100, "arr2[0] after change = " + arr2[0]); arr = new Int16Array(2); arr[0] = 65535; From 6d510e059356ec4b0865194b766f55cdfda76eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:07 +0200 Subject: [PATCH 1332/2542] jscript: Implement 'subarray' for Typed Arrays. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/arraybuf.c | 44 ++++++++++++++++++++++++++++++-- dlls/jscript/error.c | 1 + dlls/jscript/jscript.h | 1 + dlls/jscript/jscript.rc | 1 + dlls/jscript/resource.h | 1 + dlls/mshtml/tests/es5.js | 55 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 101 insertions(+), 2 deletions(-) diff --git a/dlls/jscript/arraybuf.c b/dlls/jscript/arraybuf.c index 9cec7296eb1f..a941c83fedba 100644 --- a/dlls/jscript/arraybuf.c +++ b/dlls/jscript/arraybuf.c @@ -735,6 +735,8 @@ static inline TypedArrayInstance *typedarr_this(jsval_t vthis, jsclass_t jsclass return (jsdisp && is_class(jsdisp, jsclass)) ? typedarr_from_jsdisp(jsdisp) : NULL; } +static HRESULT create_typedarr(script_ctx_t*,jsclass_t,ArrayBufferInstance*,DWORD,DWORD,jsdisp_t**); + static HRESULT TypedArray_get_buffer(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) { TRACE("%p\n", jsthis); @@ -817,12 +819,50 @@ static HRESULT TypedArray_subarray(script_ctx_t *ctx, jsval_t vthis, WORD flags, jsval_t *r, jsclass_t jsclass) { TypedArrayInstance *typedarr; + DWORD begin = 0, end; + jsdisp_t *obj; + HRESULT hres; + double n; - FIXME("not implemented\n"); + TRACE("\n"); if(!(typedarr = typedarr_this(vthis, jsclass))) return JS_E_NOT_TYPEDARRAY; - return E_NOTIMPL; + if(!argc) + return JS_E_TYPEDARRAY_INVALID_SUBARRAY; + if(!r) + return S_OK; + + hres = to_integer(ctx, argv[0], &n); + if(FAILED(hres)) + return hres; + end = typedarr->length; + if(n < 0.0) + n += typedarr->length; + if(n >= 0.0) + begin = n < typedarr->length ? n : typedarr->length; + + if(argc > 1 && !is_undefined(argv[1])) { + hres = to_integer(ctx, argv[1], &n); + if(FAILED(hres)) + return hres; + if(n < 0.0) + n += typedarr->length; + if(n >= 0.0) { + end = n < typedarr->length ? n : typedarr->length; + end = end < begin ? begin : end; + }else + end = begin; + } + + hres = create_typedarr(ctx, jsclass, typedarr->buffer, + typedarr->offset + begin * TypedArray_elem_size[TYPEDARRAY_INDEX(jsclass)], + end - begin, &obj); + if(FAILED(hres)) + return hres; + + *r = jsval_obj(obj); + return S_OK; } static void TypedArray_destructor(jsdisp_t *dispex) diff --git a/dlls/jscript/error.c b/dlls/jscript/error.c index e6e8f70d808f..49e61aa6a6f3 100644 --- a/dlls/jscript/error.c +++ b/dlls/jscript/error.c @@ -512,6 +512,7 @@ jsdisp_t *create_builtin_error(script_ctx_t *ctx) case JS_E_PRECISION_OUT_OF_RANGE: case JS_E_INVALID_LENGTH: case JS_E_TYPEDARRAY_INVALID_OFFSLEN: + case JS_E_TYPEDARRAY_INVALID_SUBARRAY: case JS_E_DATAVIEW_INVALID_ACCESS: case JS_E_DATAVIEW_INVALID_OFFSET: constr = ctx->range_error_constr; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index bfbb7f740b47..3541dab21d7f 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -612,6 +612,7 @@ static inline HRESULT disp_call_value(script_ctx_t *ctx, IDispatch *disp, jsval_ #define JS_E_TYPEDARRAY_BAD_CTOR_ARG MAKE_JSERROR(IDS_TYPEDARRAY_BAD_CTOR_ARG) #define JS_E_NOT_TYPEDARRAY MAKE_JSERROR(IDS_NOT_TYPEDARRAY) #define JS_E_TYPEDARRAY_INVALID_OFFSLEN MAKE_JSERROR(IDS_TYPEDARRAY_INVALID_OFFSLEN) +#define JS_E_TYPEDARRAY_INVALID_SUBARRAY MAKE_JSERROR(IDS_TYPEDARRAY_INVALID_SUBARRAY) #define JS_E_NOT_DATAVIEW MAKE_JSERROR(IDS_NOT_DATAVIEW) #define JS_E_DATAVIEW_NO_ARGUMENT MAKE_JSERROR(IDS_DATAVIEW_NO_ARGUMENT) #define JS_E_DATAVIEW_INVALID_ACCESS MAKE_JSERROR(IDS_DATAVIEW_INVALID_ACCESS) diff --git a/dlls/jscript/jscript.rc b/dlls/jscript/jscript.rc index d4846fb3cee4..b890178945f9 100644 --- a/dlls/jscript/jscript.rc +++ b/dlls/jscript/jscript.rc @@ -80,6 +80,7 @@ STRINGTABLE IDS_NOT_TYPEDARRAY "'this' is not a typed array object" IDS_TYPEDARRAY_BAD_CTOR_ARG "Typed array constructor argument is invalid" IDS_TYPEDARRAY_INVALID_OFFSLEN "Invalid offset/length when creating typed array" + IDS_TYPEDARRAY_INVALID_SUBARRAY "Invalid begin/end value in typed array subarray method" IDS_NOT_DATAVIEW "'this' is not a DataView object" IDS_DATAVIEW_NO_ARGUMENT "Required argument offset or value in DataView method is not specified" IDS_DATAVIEW_INVALID_ACCESS "DataView operation access beyond specified buffer length" diff --git a/dlls/jscript/resource.h b/dlls/jscript/resource.h index fd21452aa770..449e6c4c5c93 100644 --- a/dlls/jscript/resource.h +++ b/dlls/jscript/resource.h @@ -78,6 +78,7 @@ #define IDS_TYPEDARRAY_BAD_CTOR_ARG 0x13DA #define IDS_NOT_TYPEDARRAY 0x13DB #define IDS_TYPEDARRAY_INVALID_OFFSLEN 0x13DC +#define IDS_TYPEDARRAY_INVALID_SUBARRAY 0x13DD #define IDS_NOT_DATAVIEW 0x13DF #define IDS_DATAVIEW_NO_ARGUMENT 0x13E0 #define IDS_DATAVIEW_INVALID_ACCESS 0x13E1 diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index c4320435be11..2f79ca6dff82 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -36,6 +36,7 @@ var JS_E_NONWRITABLE_MODIFIED = 0x800a13d7; var JS_E_TYPEDARRAY_BAD_CTOR_ARG = 0x800a13da; var JS_E_NOT_TYPEDARRAY = 0x800a13db; var JS_E_TYPEDARRAY_INVALID_OFFSLEN = 0x800a13dc; +var JS_E_TYPEDARRAY_INVALID_SUBARRAY = 0x800a13dd; var JS_E_NOT_DATAVIEW = 0x800a13df; var JS_E_DATAVIEW_NO_ARGUMENT = 0x800a13e0; var JS_E_DATAVIEW_INVALID_ACCESS = 0x800a13e1; @@ -2353,6 +2354,60 @@ sync_test("ArrayBuffers & Views", function() { ok(arr2.byteOffset === 0, name + " copy.byteOffset = " + arr2.byteOffset); ok(arr2.length === arr.length, name + " copy.length = " + arr2.length); ok(arr2.buffer !== arr.buffer, name + " copy.buffer = " + arr2.buffer); + arr2 = arr.subarray(undefined, "1"); + ok(arr2.byteLength === typeSz, name + " subarray(undefined, '1').byteLength = " + arr2.byteLength); + ok(arr2.byteOffset === arr.byteOffset, name + " subarray(undefined, '1').byteOffset = " + arr2.byteOffset); + ok(arr2.length === 1, name + " subarray(undefined, '1').length = " + arr2.length); + ok(arr2.buffer === arr.buffer, name + " subarray(undefined, '1').buffer = " + arr2.buffer); + + name = arrType + "(10)"; + arr = eval(name); + try { + arr.subarray.call(null, 0); + ok(false, arrType + ": calling subarray with null context did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_TYPEDARRAY, arrType + ": calling subarray with null context threw " + n); + } + try { + arr.subarray.call({}, 0); + ok(false, arrType + ": calling subarray with an object context did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_TYPEDARRAY, arrType + ": calling subarray with an object context threw " + n); + } + try { + arr.subarray(); + ok(false, name + " subarray() did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_SUBARRAY, name + " subarray() threw " + n); + } + arr2 = arr.subarray(4); + ok(arr2.byteLength === 6 * typeSz, name + ".subarray(4).byteLength = " + arr2.byteLength); + ok(arr2.byteOffset === 4 * typeSz, name + ".subarray(4).byteOffset = " + arr2.byteOffset); + ok(arr2.length === 6, name + ".subarray(4).length = " + arr2.length); + ok(arr2.buffer === arr.buffer, name + ".subarray(4).buffer = " + arr2.buffer); + arr2 = arr.subarray(4, 2); + ok(arr2.byteLength === 0, name + ".subarray(4, 2).byteLength = " + arr2.byteLength); + ok(arr2.byteOffset === 4 * typeSz, name + ".subarray(4, 2).byteOffset = " + arr2.byteOffset); + ok(arr2.length === 0, name + ".subarray(4, 2).length = " + arr2.length); + ok(arr2.buffer === arr.buffer, name + ".subarray(4, 2).buffer = " + arr2.buffer); + arr2 = arr.subarray(-3, 100); + ok(arr2.byteLength === 3 * typeSz, name + ".subarray(-3, 100).byteLength = " + arr2.byteLength); + ok(arr2.byteOffset === 7 * typeSz, name + ".subarray(-3, 100).byteOffset = " + arr2.byteOffset); + ok(arr2.length === 3, name + ".subarray(-3, 100).length = " + arr2.length); + ok(arr2.buffer === arr.buffer, name + ".subarray(-3, 100).buffer = " + arr2.buffer); + arr2 = arr.subarray(42, -1); + ok(arr2.byteLength === 0, name + ".subarray(42, -1).byteLength = " + arr2.byteLength); + ok(arr2.byteOffset === 10 * typeSz, name + ".subarray(42, -1).byteOffset = " + arr2.byteOffset); + ok(arr2.length === 0, name + ".subarray(42, -1).length = " + arr2.length); + ok(arr2.buffer === arr.buffer, name + ".subarray(42, -1).buffer = " + arr2.buffer); + arr2 = arr.subarray(2, -3); + ok(arr2.byteLength === 5 * typeSz, name + ".subarray(2, -3).byteLength = " + arr2.byteLength); + ok(arr2.byteOffset === 2 * typeSz, name + ".subarray(2, -3).byteOffset = " + arr2.byteOffset); + ok(arr2.length === 5, name + ".subarray(2, -3).length = " + arr2.length); + ok(arr2.buffer === arr.buffer, name + ".subarray(2, -3).buffer = " + arr2.buffer); } arr = new Float32Array(3); From a95ac28a6e7cdd2bcc6f334a98a33d026c2beeee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:07 +0200 Subject: [PATCH 1333/2542] jscript: Implement 'set' for Typed Arrays. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/arraybuf.c | 75 ++++++++++++++++++++++++++++++- dlls/jscript/error.c | 1 + dlls/jscript/jscript.h | 1 + dlls/jscript/jscript.rc | 1 + dlls/jscript/resource.h | 1 + dlls/mshtml/tests/es5.js | 97 +++++++++++++++++++++++++++++++++++++++- 6 files changed, 172 insertions(+), 4 deletions(-) diff --git a/dlls/jscript/arraybuf.c b/dlls/jscript/arraybuf.c index a941c83fedba..8928cbde0041 100644 --- a/dlls/jscript/arraybuf.c +++ b/dlls/jscript/arraybuf.c @@ -806,13 +806,84 @@ static HRESULT fill_typedarr_data_from_object(script_ctx_t *ctx, BYTE *data, jsd static HRESULT TypedArray_set(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r, jsclass_t jsclass) { + const unsigned elem_size = TypedArray_elem_size[TYPEDARRAY_INDEX(jsclass)]; TypedArrayInstance *typedarr; + DWORD begin = 0, size; + BYTE *dest, *data; + IDispatch *disp; + jsdisp_t *obj; + HRESULT hres; + jsval_t val; + UINT32 len; + double n; - FIXME("not implemented\n"); + TRACE("\n"); if(!(typedarr = typedarr_this(vthis, jsclass))) return JS_E_NOT_TYPEDARRAY; - return E_NOTIMPL; + if(!argc) + return JS_E_TYPEDARRAY_INVALID_SOURCE; + + hres = to_object(ctx, argv[0], &disp); + if(FAILED(hres)) + return JS_E_TYPEDARRAY_INVALID_SOURCE; + + if(!(obj = to_jsdisp(disp))) { + FIXME("Non-JS array object\n"); + hres = JS_E_TYPEDARRAY_INVALID_SOURCE; + goto done; + } + + hres = jsdisp_propget_name(obj, L"length", &val); + if(FAILED(hres)) + goto done; + + hres = to_uint32(ctx, val, &len); + jsval_release(val); + if(FAILED(hres)) + goto done; + + if(argc > 1) { + hres = to_integer(ctx, argv[1], &n); + if(FAILED(hres)) + goto done; + if(n < 0.0 || n > typedarr->length) { + hres = JS_E_TYPEDARRAY_INVALID_OFFSLEN; + goto done; + } + begin = n; + } + + if(len > typedarr->length - begin) { + hres = JS_E_TYPEDARRAY_INVALID_OFFSLEN; + goto done; + } + size = len * elem_size; + dest = data = &typedarr->buffer->buf[typedarr->offset + begin * elem_size]; + + /* If they overlap, make a temporary copy */ + if(obj->builtin_info->class >= FIRST_TYPEDARRAY_JSCLASS && obj->builtin_info->class <= LAST_TYPEDARRAY_JSCLASS) { + TypedArrayInstance *src_arr = typedarr_from_jsdisp(obj); + const BYTE *src = src_arr->buffer->buf + src_arr->offset; + + if(dest < src + len * TypedArray_elem_size[TYPEDARRAY_INDEX(obj->builtin_info->class)] && + dest + size > src) { + if(!(data = malloc(size))) { + hres = E_OUTOFMEMORY; + goto done; + } + } + } + + hres = fill_typedarr_data_from_object(ctx, data, obj, len, jsclass); + if(SUCCEEDED(hres) && dest != data) { + memcpy(dest, data, size); + free(data); + } + +done: + IDispatch_Release(disp); + return hres; } static HRESULT TypedArray_subarray(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, diff --git a/dlls/jscript/error.c b/dlls/jscript/error.c index 49e61aa6a6f3..681dd0c64348 100644 --- a/dlls/jscript/error.c +++ b/dlls/jscript/error.c @@ -497,6 +497,7 @@ jsdisp_t *create_builtin_error(script_ctx_t *ctx) case JS_E_NONWRITABLE_MODIFIED: case JS_E_TYPEDARRAY_BAD_CTOR_ARG: case JS_E_NOT_TYPEDARRAY: + case JS_E_TYPEDARRAY_INVALID_SOURCE: case JS_E_NOT_DATAVIEW: case JS_E_DATAVIEW_NO_ARGUMENT: case JS_E_WRONG_THIS: diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 3541dab21d7f..2e8edc631447 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -613,6 +613,7 @@ static inline HRESULT disp_call_value(script_ctx_t *ctx, IDispatch *disp, jsval_ #define JS_E_NOT_TYPEDARRAY MAKE_JSERROR(IDS_NOT_TYPEDARRAY) #define JS_E_TYPEDARRAY_INVALID_OFFSLEN MAKE_JSERROR(IDS_TYPEDARRAY_INVALID_OFFSLEN) #define JS_E_TYPEDARRAY_INVALID_SUBARRAY MAKE_JSERROR(IDS_TYPEDARRAY_INVALID_SUBARRAY) +#define JS_E_TYPEDARRAY_INVALID_SOURCE MAKE_JSERROR(IDS_TYPEDARRAY_INVALID_SOURCE) #define JS_E_NOT_DATAVIEW MAKE_JSERROR(IDS_NOT_DATAVIEW) #define JS_E_DATAVIEW_NO_ARGUMENT MAKE_JSERROR(IDS_DATAVIEW_NO_ARGUMENT) #define JS_E_DATAVIEW_INVALID_ACCESS MAKE_JSERROR(IDS_DATAVIEW_INVALID_ACCESS) diff --git a/dlls/jscript/jscript.rc b/dlls/jscript/jscript.rc index b890178945f9..7d11a7e09329 100644 --- a/dlls/jscript/jscript.rc +++ b/dlls/jscript/jscript.rc @@ -81,6 +81,7 @@ STRINGTABLE IDS_TYPEDARRAY_BAD_CTOR_ARG "Typed array constructor argument is invalid" IDS_TYPEDARRAY_INVALID_OFFSLEN "Invalid offset/length when creating typed array" IDS_TYPEDARRAY_INVALID_SUBARRAY "Invalid begin/end value in typed array subarray method" + IDS_TYPEDARRAY_INVALID_SOURCE "Invalid source in typed array set" IDS_NOT_DATAVIEW "'this' is not a DataView object" IDS_DATAVIEW_NO_ARGUMENT "Required argument offset or value in DataView method is not specified" IDS_DATAVIEW_INVALID_ACCESS "DataView operation access beyond specified buffer length" diff --git a/dlls/jscript/resource.h b/dlls/jscript/resource.h index 449e6c4c5c93..d694abc07cd9 100644 --- a/dlls/jscript/resource.h +++ b/dlls/jscript/resource.h @@ -79,6 +79,7 @@ #define IDS_NOT_TYPEDARRAY 0x13DB #define IDS_TYPEDARRAY_INVALID_OFFSLEN 0x13DC #define IDS_TYPEDARRAY_INVALID_SUBARRAY 0x13DD +#define IDS_TYPEDARRAY_INVALID_SOURCE 0x13DE #define IDS_NOT_DATAVIEW 0x13DF #define IDS_DATAVIEW_NO_ARGUMENT 0x13E0 #define IDS_DATAVIEW_INVALID_ACCESS 0x13E1 diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index 2f79ca6dff82..81c661e74fbf 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -37,6 +37,7 @@ var JS_E_TYPEDARRAY_BAD_CTOR_ARG = 0x800a13da; var JS_E_NOT_TYPEDARRAY = 0x800a13db; var JS_E_TYPEDARRAY_INVALID_OFFSLEN = 0x800a13dc; var JS_E_TYPEDARRAY_INVALID_SUBARRAY = 0x800a13dd; +var JS_E_TYPEDARRAY_INVALID_SOURCE = 0x800a13de; var JS_E_NOT_DATAVIEW = 0x800a13df; var JS_E_DATAVIEW_NO_ARGUMENT = 0x800a13e0; var JS_E_DATAVIEW_INVALID_ACCESS = 0x800a13e1; @@ -2408,6 +2409,87 @@ sync_test("ArrayBuffers & Views", function() { ok(arr2.byteOffset === 2 * typeSz, name + ".subarray(2, -3).byteOffset = " + arr2.byteOffset); ok(arr2.length === 5, name + ".subarray(2, -3).length = " + arr2.length); ok(arr2.buffer === arr.buffer, name + ".subarray(2, -3).buffer = " + arr2.buffer); + + try { + arr.set.call(null, [1]); + ok(false, arrType + ": calling set with null context did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_TYPEDARRAY, arrType + ": calling set with null context threw " + n); + } + try { + arr.set.call({}, [1]); + ok(false, arrType + ": calling set with an object context did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_NOT_TYPEDARRAY, arrType + ": calling set with an object context threw " + n); + } + try { + arr.set(); + ok(false, name + ".set() did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_SOURCE, name + ".set() threw " + n); + } + try { + arr.set(null); + ok(false, name + ".set(null) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_SOURCE, name + ".set(null) threw " + n); + } + try { + arr.set([1,2,3], 8); + ok(false, name + ".set([1,2,3], 8) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_OFFSLEN, name + ".set([1,2,3], 8) threw " + n); + } + try { + arr.set([99], -3); + ok(false, name + ".set([99], -3) did not throw exception"); + }catch(ex) { + var n = ex.number >>> 0; + ok(n === JS_E_TYPEDARRAY_INVALID_OFFSLEN, name + ".set([99], -3) threw " + n); + } + + r = arr.set(5); + ok(r === undefined, name + ".set(5) returned " + r); + for(var j = 0; j < 10; j++) + ok(arr[j] === 0, name + ".set(5): arr[" + j + "] = " + arr[j]); + + r = arr.set({}); + ok(r === undefined, name + ".set({}) returned " + r); + for(var j = 0; j < 10; j++) + ok(arr[j] === 0, name + ".set({}): arr[" + j + "] = " + arr[j]); + + r = arr.set("12"); + ok(r === undefined, name + ".set('12') returned " + r); + for(var j = 0; j < 10; j++) + ok(arr[j] === [ 1, 2, 0, 0, 0, 0, 0, 0, 0, 0 ][j], name + ".set('12'): arr[" + j + "] = " + arr[j]); + + arr2 = { length: 2 }; + arr2[0] = 9; + arr2[1] = 7; + r = arr.set(arr2); + ok(r === undefined, name + ".set(array-like obj) returned " + r); + for(var j = 0; j < 10; j++) + ok(arr[j] === [ 9, 7, 0, 0, 0, 0, 0, 0, 0, 0 ][j], name + ".set(array-like obj): arr[" + j + "] = " + arr[j]); + + r = arr.set([12, 10, 11], 3); + ok(r === undefined, name + ".set([12, 10, 11], 3) returned " + r); + for(var j = 0; j < 10; j++) + ok(arr[j] === [ 9, 7, 0, 12, 10, 11, 0, 0, 0, 0 ][j], name + ".set([12, 10, 11], 3): arr[" + j + "] = " + arr[j]); + + r = arr.set(arr.subarray(4, 6), 5); + ok(r === undefined, name + ".set(arr.subarray(4, 2), 5) returned " + r); + for(var j = 0; j < 10; j++) + ok(arr[j] === [ 9, 7, 0, 12, 10, 10, 11, 0, 0, 0 ][j], name + ".set(arr.subarray(4, 2), 5): arr[" + j + "] = " + arr[j]); + + r = arr.set(arr.subarray(3, 7), 2); + ok(r === undefined, name + ".set(arr.subarray(3, 7), 2) returned " + r); + for(var j = 0; j < 10; j++) + ok(arr[j] === [ 9, 7, 12, 10, 10, 11, 11, 0, 0, 0 ][j], name + ".set(arr.subarray(3, 7), 2): arr[" + j + "] = " + arr[j]); } arr = new Float32Array(3); @@ -2437,8 +2519,19 @@ sync_test("ArrayBuffers & Views", function() { ok(arr[0] == 254, "8-bit arr[0] after overflow = " + arr[0]); ok(arr[1] == 2, "8-bit arr[1] after overflow = " + arr[1]); - arr = new Int8Array(); - arr2 = new Int32Array(); + arr = new Int8Array(12); + arr.set([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]); + for(var j = 0; j < 12; j++) + ok(arr[j] === j + 1, "sequential arr[" + j + "] = " + arr[j]); + arr2 = new Int32Array(arr.buffer); + ok(arr2.buffer === arr.buffer, "arr2.buffer = " + arr2.buffer); + for(var j = 0; j < 3; j++) + ok(arr2[j] === [ 0x04030201, 0x08070605, 0x0c0b0a09 ][j], "sequential 32-bit arr[" + j + "] = " + arr2[j]); + + /* test overlap */ + arr2.set(arr.subarray(1, 4)); + for(var j = 0; j < 3; j++) + ok(arr2[j] === j + 2, "arr with overlap[" + j + "] = " + arr[j]); /* methods are incompatible, even though thrown error is not explicit */ ok(Uint16Array.prototype.subarray !== Int32Array.prototype.subarray, "Uint16Array and Int32Array have same subarray methods"); From f58255984c4c4e792edc2570c1e40673561865ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:07 +0200 Subject: [PATCH 1334/2542] jscript: Implement Uint8ClampedArray. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/arraybuf.c | 18 ++++++++++++++++++ dlls/jscript/jscript.h | 1 + dlls/jscript/object.c | 1 + dlls/mshtml/tests/documentmode.js | 2 +- dlls/mshtml/tests/es5.js | 13 +++++++++++++ 5 files changed, 34 insertions(+), 1 deletion(-) diff --git a/dlls/jscript/arraybuf.c b/dlls/jscript/arraybuf.c index 8928cbde0041..176431e86bb9 100644 --- a/dlls/jscript/arraybuf.c +++ b/dlls/jscript/arraybuf.c @@ -17,6 +17,7 @@ */ +#include #include #include @@ -709,11 +710,28 @@ static const builtin_info_t DataViewConstr_info = { .call = Function_value, }; +static HRESULT clamped_u8(script_ctx_t *ctx, jsval_t v, UINT8 *ret) +{ + HRESULT hres; + double n; + + hres = to_number(ctx, v, &n); + if(FAILED(hres)) + return hres; + + if(!isfinite(n)) + *ret = (n == INFINITY ? 255 : 0); + else + *ret = (n >= 255.0 ? 255 : n <= 0 ? 0 : lround(n)); + return S_OK; +} + #define TYPEDARRAY_LIST \ X(Int8Array, JSCLASS_INT8ARRAY, INT8, to_int32, INT) \ X(Int16Array, JSCLASS_INT16ARRAY, INT16, to_int32, INT) \ X(Int32Array, JSCLASS_INT32ARRAY, INT32, to_int32, INT) \ X(Uint8Array, JSCLASS_UINT8ARRAY, UINT8, to_int32, INT) \ +X(Uint8ClampedArray, JSCLASS_UINT8CLAMPEDARRAY, UINT8, clamped_u8, UINT8) \ X(Uint16Array, JSCLASS_UINT16ARRAY, UINT16, to_int32, INT) \ X(Uint32Array, JSCLASS_UINT32ARRAY, UINT32, to_int32, INT) \ X(Float32Array, JSCLASS_FLOAT32ARRAY, float, to_number, double) \ diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 2e8edc631447..6a7a0ad35c62 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -117,6 +117,7 @@ typedef enum { JSCLASS_INT16ARRAY, JSCLASS_INT32ARRAY, JSCLASS_UINT8ARRAY, + JSCLASS_UINT8CLAMPEDARRAY, JSCLASS_UINT16ARRAY, JSCLASS_UINT32ARRAY, JSCLASS_FLOAT32ARRAY, diff --git a/dlls/jscript/object.c b/dlls/jscript/object.c index a2d0998007a5..99e04215ff4c 100644 --- a/dlls/jscript/object.c +++ b/dlls/jscript/object.c @@ -57,6 +57,7 @@ static HRESULT Object_toString(script_ctx_t *ctx, jsval_t vthis, WORD flags, uns L"[object Int16Array]", L"[object Int32Array]", L"[object Uint8Array]", + L"[object Uint8ClampedArray]", L"[object Uint16Array]", L"[object Uint32Array]", L"[object Float32Array]", diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index cacf24745c31..5a3d8986bb1e 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -186,7 +186,7 @@ sync_test("window own props", function() { "SVGScriptElement", "SVGStopElement", "SVGStringList", "SVGStyleElement", "SVGSwitchElement", "SVGSymbolElement", "SVGTextElement", "SVGTextPathElement", "SVGTitleElement", "SVGTransform", "SVGTransformList", "SVGUnitTypes", "SVGUseElement", "SVGViewElement", "SVGZoomAndPan", "SVGZoomEvent", "TextEvent", "TextMetrics", "TextRangeCollection", ["TextTrack",10], ["TextTrackCue",10], ["TextTrackCueList",10], ["TextTrackList",10], "TimeRanges", ["TrackEvent",10], ["TransitionEvent",10], "TreeWalker", ["Uint16Array",9,9], ["Uint32Array",9,9], - ["Uint8Array",9,9], ["Uint8ClampedArray",11], ["URL",10], ["ValidityState",10], ["VideoPlaybackQuality",11], ["WebGLActiveInfo",11], ["WebGLBuffer",11], ["WebGLContextEvent",11], + ["Uint8Array",9,9], ["Uint8ClampedArray",9,10], ["URL",10], ["ValidityState",10], ["VideoPlaybackQuality",11], ["WebGLActiveInfo",11], ["WebGLBuffer",11], ["WebGLContextEvent",11], ["WebGLFramebuffer",11], ["WebGLObject",11], ["WebGLProgram",11], ["WebGLRenderbuffer",11], ["WebGLRenderingContext",11], ["WebGLShader",11], ["WebGLShaderPrecisionFormat",11], ["WebGLTexture",11], ["WebGLUniformLocation",11], ["WEBGL_compressed_texture_s3tc",11], ["WEBGL_debug_renderer_info",11], ["WebSocket",10], "WheelEvent", ["Worker",10], ["XDomainRequest",9,10], ["XMLDocument",11], ["XMLHttpRequestEventTarget",10], "XMLSerializer" diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index 81c661e74fbf..ab2cc411a208 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -2550,6 +2550,18 @@ sync_test("ArrayBuffers & Views", function() { var n = ex.number >>> 0; ok(n === JS_E_NOT_TYPEDARRAY, "calling Uint32Array's subarray with Int32Array context threw " + n); } + + /* clamped array */ + arr = new Uint8ClampedArray(7); + arr2 = new Uint8Array(7); + arr.set ([42, -1, 999, 0.9, NaN, Infinity, -Infinity]); + arr2.set([42, -1, 999, 0.9, NaN, Infinity, -Infinity]); + for(var j = 0; j < 7; j++) { + ok(arr[j] === [42, 0, 255, 1, 0, 255, 0][j], "clamped arr[" + j + "] = " + arr[j]); + ok(arr2[j] === [42, 255, 231, 0, 0, 0, 0][j], "non-clamped arr[" + j + "] = " + arr2[j]); + } + r = Object.prototype.toString.call(arr); + ok(r === "[object Uint8ClampedArray]", "Object toString for Uint8ClampedArray = " + r); }); sync_test("builtin_context", function() { @@ -2672,6 +2684,7 @@ sync_test("globals override", function() { "SyntaxError", "TypeError", "Uint8Array", + "Uint8ClampedArray", "Uint16Array", "Uint32Array", "unescape", From af7795e2d1f8c1c2b0c5f1f9701c030cb3529ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:07 +0200 Subject: [PATCH 1335/2542] jscript: Release the dispex prop using a helper. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/dispex.c | 61 ++++++++++++++----------------------------- 1 file changed, 20 insertions(+), 41 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 680de8deb83e..3d9ce973f33a 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -264,6 +264,23 @@ static dispex_prop_t *alloc_protref(jsdisp_t *This, const WCHAR *name, DWORD ref return ret; } +static void release_prop(dispex_prop_t *prop) +{ + switch(prop->type) { + case PROP_JSVAL: + jsval_release(prop->u.val); + break; + case PROP_ACCESSOR: + if(prop->u.accessor.getter) + jsdisp_release(prop->u.accessor.getter); + if(prop->u.accessor.setter) + jsdisp_release(prop->u.accessor.setter); + break; + default: + break; + } +} + static dispex_prop_t *lookup_dispex_prop(jsdisp_t *obj, unsigned hash, const WCHAR *name, BOOL case_insens) { unsigned bucket, pos, prev = ~0; @@ -865,21 +882,7 @@ static void unlink_jsdisp(jsdisp_t *jsdisp) dispex_prop_t *prop = jsdisp->props, *end; for(end = prop + jsdisp->prop_cnt; prop < end; prop++) { - switch(prop->type) { - case PROP_DELETED: - continue; - case PROP_JSVAL: - jsval_release(prop->u.val); - break; - case PROP_ACCESSOR: - if(prop->u.accessor.getter) - jsdisp_release(prop->u.accessor.getter); - if(prop->u.accessor.setter) - jsdisp_release(prop->u.accessor.setter); - break; - default: - break; - } + release_prop(prop); prop->type = PROP_DELETED; } @@ -1919,19 +1922,7 @@ static void jsdisp_free(jsdisp_t *obj) } for(prop = obj->props; prop < obj->props+obj->prop_cnt; prop++) { - switch(prop->type) { - case PROP_JSVAL: - jsval_release(prop->u.val); - break; - case PROP_ACCESSOR: - if(prop->u.accessor.getter) - jsdisp_release(prop->u.accessor.getter); - if(prop->u.accessor.setter) - jsdisp_release(prop->u.accessor.setter); - break; - default: - break; - }; + release_prop(prop); free(prop->name); } free(obj->props); @@ -2321,19 +2312,7 @@ static HRESULT delete_prop(jsdisp_t *obj, DISPID id, BOOL *ret) *ret = TRUE; - switch(prop->type) { - case PROP_JSVAL: - jsval_release(prop->u.val); - break; - case PROP_ACCESSOR: - if(prop->u.accessor.getter) - jsdisp_release(prop->u.accessor.getter); - if(prop->u.accessor.setter) - jsdisp_release(prop->u.accessor.setter); - break; - default: - break; - } + release_prop(prop); prop->type = PROP_DELETED; return S_OK; } From 1f42816720b9df9eba06f45fcdfded1a24f7ff5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:07 +0200 Subject: [PATCH 1336/2542] mshtml/tests: Add more detailed tests for volatile storage props. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/tests/dom.js | 161 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) diff --git a/dlls/mshtml/tests/dom.js b/dlls/mshtml/tests/dom.js index 300e22cd6841..8c2206361e42 100644 --- a/dlls/mshtml/tests/dom.js +++ b/dlls/mshtml/tests/dom.js @@ -609,6 +609,13 @@ sync_test("storage", function() { ok(item === "42", "'foobar' item = " + item); item = sessionStorage["foobar"]; ok(item === "42", "[foobar] item = " + item); + + var desc = Object.getOwnPropertyDescriptor(sessionStorage, "foobar"); + ok(desc.value === "42", "foobar desc.value = " + desc.value); + ok(desc.writable === true, "foobar desc.writable = " + desc.writable); + ok(desc.enumerable === true, "foobar desc.enumerable = " + desc.enumerable); + ok(desc.configurable === true, "foobar desc.configurable = " + desc.configurable); + sessionStorage.removeItem("foobar"); item = sessionStorage["foobar"]; ok(item === undefined, "[foobar] item after removal = " + item); @@ -620,6 +627,160 @@ sync_test("storage", function() { ok(item === "true", "[barfoo] item = " + item); item = sessionStorage.getItem("barfoo"); ok(item === "true", "'barfoo' item = " + item); + + Object.defineProperty(sessionStorage, "barfoo", {writable: false, enumerable: false, configurable: false, value: 1234}); + desc = Object.getOwnPropertyDescriptor(sessionStorage, "barfoo"); + todo_wine. + ok(desc.value === "1234", "barfoo desc.value = " + desc.value); + todo_wine. + ok(desc.writable === true, "barfoo desc.writable = " + desc.writable); + todo_wine. + ok(desc.enumerable === true, "barfoo desc.enumerable = " + desc.enumerable); + todo_wine. + ok(desc.configurable === true, "barfoo desc.configurable = " + desc.configurable); + + item = sessionStorage.barfoo; + todo_wine. + ok(item === "1234", "'barfoo' prop after defineProperty = " + item); + item = sessionStorage.getItem("barfoo"); + todo_wine. + ok(item === "1234", "'barfoo' item after defineProperty = " + item); + + sessionStorage.barfoo = 4321; + item = sessionStorage.barfoo; + todo_wine. + ok(item === "4321", "'barfoo' prop after re-set = " + item); + item = sessionStorage.getItem("barfoo"); + todo_wine. + ok(item === "4321", "'barfoo' item after re-set = " + item); + + todo_wine. + ok((delete sessionStorage.barfoo) === true, "delete sessionStorage.barfoo returned false"); + todo_wine. + ok(!("barfoo" in sessionStorage), "barfoo in sessionStorage after defined prop deleted"); + todo_wine. + ok(!Object.prototype.hasOwnProperty.call(sessionStorage, "barfoo"), "barfoo prop of sessionStorage after defined prop deleted"); + item = sessionStorage.barfoo; + todo_wine. + ok(item === undefined, "[barfoo] item after second delete = " + item); + item = sessionStorage.getItem("barfoo"); + ok(item === null, "'barfoo' item after second delete = " + item); + + Object.defineProperty(sessionStorage, "winetest", {enumerable: false, configurable: true, + get: function() { return 42; }, set: function() { item = 1234; } }); + desc = Object.getOwnPropertyDescriptor(sessionStorage, "winetest"); + ok(desc.get() === 42, "winetest desc.get() = " + desc.get()); + ok(desc.enumerable === false, "winetest desc.enumerable = " + desc.enumerable); + ok(desc.configurable === true, "winetest desc.configurable = " + desc.configurable); + + item = sessionStorage.winetest; + ok(item === 42, "'winetest' prop = " + item); + item = sessionStorage.getItem("winetest"); + ok(item === null, "'winetest' item = " + item); + + sessionStorage.winetest = 0; + ok(item === 1234, "'winetest' item after setter = " + item); + + sessionStorage.setItem("winetest", "test"); + item = sessionStorage.winetest; + todo_wine. + ok(item === "test", "'winetest' prop after setItem = " + item); + item = sessionStorage.getItem("winetest"); + ok(item === "test", "'winetest' item after setItem = " + item); + + desc = Object.getOwnPropertyDescriptor(sessionStorage, "winetest"); + ok(desc.get() === 42, "winetest desc.get() after setItem = " + desc.get()); + ok(desc.enumerable === false, "winetest desc.enumerable after setItem = " + desc.enumerable); + ok(desc.configurable === true, "winetest desc.configurable after setItem = " + desc.configurable); + + item = sessionStorage.winetest; + todo_wine. + ok(item === "test", "'winetest' prop before second setter = " + item); + sessionStorage.winetest = 0; + ok(item === 1234, "'winetest' item after second setter = " + item); + item = sessionStorage.winetest; + todo_wine. + ok(item === "test", "'winetest' prop after second setter = " + item); + + sessionStorage.removeItem("winetest"); + item = sessionStorage.winetest; + ok(item === 42, "'winetest' prop after removeItem = " + item); + item = sessionStorage.getItem("winetest"); + ok(item === null, "'winetest' item after removeItem = " + item); + + sessionStorage.setItem("winetest", "wine"); + item = sessionStorage.winetest; + todo_wine. + ok(item === "wine", "'winetest' prop after second setItem = " + item); + item = sessionStorage.getItem("winetest"); + ok(item === "wine", "'winetest' item after second setItem = " + item); + + ok((delete sessionStorage.winetest) === true, "delete sessionStorage.winetest returned false"); + ok("winetest" in sessionStorage, "'winetest' not in sessionStorage after delete"); + ok(Object.prototype.hasOwnProperty.call(sessionStorage, "winetest"), "'winetest' not prop of sessionStorage after delete"); + item = sessionStorage.winetest; + todo_wine. + ok(item === 42, "'winetest' item after delete = " + item); + item = sessionStorage.getItem("winetest"); + todo_wine. + ok(item === null, "'winetest' item after delete = " + item); + + ok((delete sessionStorage.winetest) === true, "second delete sessionStorage.winetest returned false"); + todo_wine. + ok("winetest" in sessionStorage, "'winetest' not in sessionStorage after second delete"); + todo_wine. + ok(Object.prototype.hasOwnProperty.call(sessionStorage, "winetest"), "'winetest' not prop of sessionStorage after second delete"); + item = sessionStorage.winetest; + todo_wine. + ok(item === 42, "'winetest' item after second delete = " + item); + item = sessionStorage.getItem("winetest"); + ok(item === null, "'winetest' item after second delete = " + item); + + Object.defineProperty(sessionStorage, "nonconf", {enumerable: false, configurable: false, + get: function() { return 1; }, set: function() {} }); + desc = Object.getOwnPropertyDescriptor(sessionStorage, "nonconf"); + ok(desc.get() === 1, "nonconf desc.get() = " + desc.get()); + ok(desc.enumerable === false, "nonconf desc.enumerable = " + desc.enumerable); + ok(desc.configurable === false, "nonconf desc.configurable = " + desc.configurable); + + sessionStorage.setItem("nonconf", "test"); + item = sessionStorage.nonconf; + todo_wine. + ok(item === "test", "'nonconf' prop after setItem = " + item); + item = sessionStorage.getItem("nonconf"); + ok(item === "test", "'nonconf' item after setItem = " + item); + + desc = Object.getOwnPropertyDescriptor(sessionStorage, "nonconf"); + ok(desc.get() === 1, "nonconf desc.get() after setItem = " + desc.get()); + ok(desc.enumerable === false, "nonconf desc.enumerable after setItem = " + desc.enumerable); + ok(desc.configurable === false, "nonconf desc.configurable after setItem = " + desc.configurable); + + todo_wine. + ok((delete sessionStorage.nonconf) === true, "delete sessionStorage.nonconf returned false"); + ok("nonconf" in sessionStorage, "'nonconf' not in sessionStorage after delete"); + ok(Object.prototype.hasOwnProperty.call(sessionStorage, "nonconf"), "'nonconf' not prop of sessionStorage after delete"); + item = sessionStorage.nonconf; + ok(item === 1, "'nonconf' item after delete = " + item); + item = sessionStorage.getItem("nonconf"); + todo_wine. + ok(item === null, "'nonconf' item after delete = " + item); + + sessionStorage.setItem("protoprop", "1111"); + item = sessionStorage.protoprop; + ok(item === "1111", "'protoprop' = " + item); + + var obj = Object.create(sessionStorage); + ok("protoprop" in obj, "'protoprop' not in object with sessionStorage prototype"); + ok(!Object.prototype.hasOwnProperty.call(obj, "protoprop"), "'protoprop' prop of object with sessionStorage prototype"); + item = obj.protoprop; + ok(item === "1111", "'protoprop' on obj = " + item); + + var name = null; + for(name in obj) + ok(name === "protoprop", "got " + name + " prop enumerating"); + ok(name === "protoprop", "protoprop not enumerated"); + + sessionStorage.clear(); }); async_test("animation", function() { From cbf6abaf9bd0ceae1316585573007a239607eafe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:07 +0200 Subject: [PATCH 1337/2542] mshtml: Override props with items if available, for localStorage/sessionStorage. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/dispex.c | 59 +++++++++++++++++++++++++++++++----- dlls/jscript/jsdisp.idl | 1 + dlls/mshtml/dispex.c | 24 +++++++++++++++ dlls/mshtml/htmlstorage.c | 24 +++++++++++++++ dlls/mshtml/htmlwindow.c | 7 +++++ dlls/mshtml/mshtml_private.h | 3 ++ dlls/mshtml/tests/dom.js | 24 --------------- 7 files changed, 111 insertions(+), 31 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 3d9ce973f33a..622e29ee39d1 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -3615,14 +3615,17 @@ static HRESULT HostObject_prop_get(jsdisp_t *jsdisp, DISPID id, jsval_t *r) VARIANT v; HRESULT hres; - if(prop->type != PROP_EXTERN) - return S_FALSE; + hres = IWineJSDispatchHost_OverrideProperty(This->host_iface, prop->name, NULL, &v); + if(hres == S_FALSE) { + if(prop->type != PROP_EXTERN) + return S_FALSE; - V_VT(&v) = VT_EMPTY; - hres = IWineJSDispatchHost_GetProperty(This->host_iface, prop->u.id, jsdisp->ctx->lcid, &v, &ei, - &jsdisp->ctx->jscaller->IServiceProvider_iface); - if(hres == DISP_E_EXCEPTION) - handle_dispatch_exception(jsdisp->ctx, &ei); + V_VT(&v) = VT_EMPTY; + hres = IWineJSDispatchHost_GetProperty(This->host_iface, prop->u.id, jsdisp->ctx->lcid, &v, &ei, + &jsdisp->ctx->jscaller->IServiceProvider_iface); + if(hres == DISP_E_EXCEPTION) + handle_dispatch_exception(jsdisp->ctx, &ei); + } if(FAILED(hres)) return hres; @@ -3669,6 +3672,10 @@ static HRESULT HostObject_prop_delete(jsdisp_t *jsdisp, DISPID id) HostObject *This = HostObject_from_jsdisp(jsdisp); HRESULT hres; + hres = IWineJSDispatchHost_OverrideProperty(This->host_iface, prop->name, NULL, NULL); + if(hres != S_FALSE) + return hres; + if(prop->type != PROP_EXTERN || !(prop->flags & PROPF_CONFIGURABLE)) return S_FALSE; @@ -3695,6 +3702,43 @@ static HRESULT HostObject_prop_get_desc(jsdisp_t *jsdisp, DISPID id, BOOL flags_ return S_OK; } +static HRESULT HostObject_prop_define(jsdisp_t *jsdisp, DISPID id, const property_desc_t *desc) +{ + dispex_prop_t *prop = &jsdisp->props[prop_id_to_idx(id)]; + HostObject *This = HostObject_from_jsdisp(jsdisp); + struct property_info info; + EXCEPINFO ei = { 0 }; + HRESULT hres; + VARIANT var; + + /* Only defining values can be overridden */ + if(!desc->explicit_value) + return S_FALSE; + + hres = IWineJSDispatchHost_OverrideProperty(This->host_iface, prop->name, &info, NULL); + if(hres != S_OK) + return hres; + if(info.prototype_id) + return S_FALSE; + + hres = jsval_to_variant(desc->value, &var); + if(FAILED(hres)) + return hres; + + hres = IWineJSDispatchHost_SetProperty(This->host_iface, info.id, jsdisp->ctx->lcid, &var, &ei, + &jsdisp->ctx->jscaller->IServiceProvider_iface); + if(hres == DISP_E_EXCEPTION) + handle_dispatch_exception(jsdisp->ctx, &ei); + VariantClear(&var); + if(hres == S_OK) { + release_prop(prop); + prop->type = PROP_EXTERN; + prop->u.id = info.id; + prop->flags = info.flags & PROPF_ALL; + } + return hres; +} + static HRESULT HostObject_prop_config(jsdisp_t *jsdisp, unsigned id, unsigned flags) { HostObject *This = HostObject_from_jsdisp(jsdisp); @@ -3733,6 +3777,7 @@ static const builtin_info_t HostObject_info = { .prop_put = HostObject_prop_put, .prop_delete = HostObject_prop_delete, .prop_get_desc = HostObject_prop_get_desc, + .prop_define = HostObject_prop_define, .prop_config = HostObject_prop_config, .fill_props = HostObject_fill_props, .to_string = HostObject_to_string, diff --git a/dlls/jscript/jsdisp.idl b/dlls/jscript/jsdisp.idl index b2c7ec679579..0cd0fa573692 100644 --- a/dlls/jscript/jsdisp.idl +++ b/dlls/jscript/jsdisp.idl @@ -65,6 +65,7 @@ interface IWineJSDispatchHost : IDispatchEx { HRESULT GetJSDispatch(IWineJSDispatch **ret); HRESULT LookupProperty(const WCHAR *name, DWORD flags, struct property_info *desc); + HRESULT OverrideProperty(const WCHAR *name, struct property_info *get_desc, VARIANT *get_value); HRESULT GetProperty(DISPID id, LCID lcid, VARIANT *r, EXCEPINFO *ei, IServiceProvider *caller); HRESULT SetProperty(DISPID id, LCID lcid, VARIANT *v, EXCEPINFO *ei, IServiceProvider *caller); HRESULT DeleteProperty(DISPID id); diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 3f6c29c97bde..747569aba068 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -2652,6 +2652,29 @@ static HRESULT WINAPI JSDispatchHost_LookupProperty(IWineJSDispatchHost *iface, return get_host_property_descriptor(This, id, desc); } +static HRESULT WINAPI JSDispatchHost_OverrideProperty(IWineJSDispatchHost *iface, const WCHAR *name, + struct property_info *get_desc, VARIANT *get_value) +{ + DispatchEx *This = impl_from_IWineJSDispatchHost(iface); + HRESULT hres; + DISPID id; + + if(!This->info->vtbl->override) + return S_FALSE; + + TRACE("%s (%p)->(%s %p)\n", This->info->name, This, debugstr_w(name), get_value); + + if(get_desc) { + hres = dispex_get_id(This, name, fdexNameCaseSensitive, &id); + if(FAILED(hres)) + return (hres == DISP_E_UNKNOWNNAME) ? S_FALSE : hres; + + return get_host_property_descriptor(This, id, get_desc); + } + + return This->info->vtbl->override(This, name, get_value); +} + static HRESULT WINAPI JSDispatchHost_GetProperty(IWineJSDispatchHost *iface, DISPID id, LCID lcid, VARIANT *r, EXCEPINFO *ei, IServiceProvider *caller) { @@ -2820,6 +2843,7 @@ static IWineJSDispatchHostVtbl JSDispatchHostVtbl = { DispatchEx_GetNameSpaceParent, JSDispatchHost_GetJSDispatch, JSDispatchHost_LookupProperty, + JSDispatchHost_OverrideProperty, JSDispatchHost_GetProperty, JSDispatchHost_SetProperty, JSDispatchHost_DeleteProperty, diff --git a/dlls/mshtml/htmlstorage.c b/dlls/mshtml/htmlstorage.c index d4b68314d536..e40575ab4246 100644 --- a/dlls/mshtml/htmlstorage.c +++ b/dlls/mshtml/htmlstorage.c @@ -1277,6 +1277,29 @@ static HRESULT HTMLStorage_get_prop_desc(DispatchEx *dispex, DISPID id, struct p return S_OK; } +static HRESULT HTMLStorage_override(DispatchEx *dispex, const WCHAR *name, VARIANT *get_value) +{ + HTMLStorage *This = impl_from_DispatchEx(dispex); + BSTR bstrName; + HRESULT hres; + + if(!(bstrName = SysAllocString(name))) + return E_OUTOFMEMORY; + + if(get_value) { + hres = HTMLStorage_getItem(&This->IHTMLStorage_iface, bstrName, get_value); + if(SUCCEEDED(hres)) + hres = (V_VT(get_value) != VT_NULL) ? S_OK : S_FALSE; + }else { + hres = HTMLStorage_removeItem(&This->IHTMLStorage_iface, bstrName); + if(SUCCEEDED(hres)) + hres = S_OK; + } + + SysFreeString(bstrName); + return hres; +} + static HRESULT HTMLStorage_fill_props(DispatchEx *dispex) { return S_FALSE; @@ -1292,6 +1315,7 @@ static const dispex_static_data_vtbl_t Storage_dispex_vtbl = { .delete = HTMLStorage_delete, .next_dispid = HTMLStorage_next_dispid, .get_prop_desc = HTMLStorage_get_prop_desc, + .override = HTMLStorage_override, .fill_props = HTMLStorage_fill_props, }; diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 89852d7f246f..4f1be358dbe3 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3448,6 +3448,12 @@ static HRESULT WINAPI WindowDispEx_LookupProperty(IWineJSDispatchHost *iface, co name, flags, desc); } +static HRESULT WINAPI WindowDispEx_OverrideProperty(IWineJSDispatchHost *iface, const WCHAR *name, + struct property_info *get_desc, VARIANT *get_value) +{ + return S_FALSE; +} + static HRESULT WINAPI WindowDispEx_FillProperties(IWineJSDispatchHost *iface) { HTMLOuterWindow *This = impl_from_IWineJSDispatchHost(iface); @@ -3539,6 +3545,7 @@ static const IWineJSDispatchHostVtbl WindowDispExVtbl = { WindowDispEx_GetNameSpaceParent, WindowDispEx_GetJSDispatch, WindowDispEx_LookupProperty, + WindowDispEx_OverrideProperty, WindowDispEx_GetProperty, WindowDispEx_SetProperty, WindowDispEx_DeleteProperty, diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index c412a732ecaa..eff6308e6178 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -400,6 +400,9 @@ typedef struct { HRESULT (*next_dispid)(DispatchEx*,DISPID,BOOL,DISPID*); HRESULT (*get_prop_desc)(DispatchEx*,DISPID,struct property_info*); + /* Used when the object wants to override existing props get/delete operations (by name) */ + HRESULT (*override)(DispatchEx*,const WCHAR*,VARIANT*); + /* Used when the object has props it has to fill prior to enumeration, or if it's volatile to not cache it (return S_FALSE then) */ HRESULT (*fill_props)(DispatchEx*); diff --git a/dlls/mshtml/tests/dom.js b/dlls/mshtml/tests/dom.js index 8c2206361e42..05b7f0f69e11 100644 --- a/dlls/mshtml/tests/dom.js +++ b/dlls/mshtml/tests/dom.js @@ -630,38 +630,26 @@ sync_test("storage", function() { Object.defineProperty(sessionStorage, "barfoo", {writable: false, enumerable: false, configurable: false, value: 1234}); desc = Object.getOwnPropertyDescriptor(sessionStorage, "barfoo"); - todo_wine. ok(desc.value === "1234", "barfoo desc.value = " + desc.value); - todo_wine. ok(desc.writable === true, "barfoo desc.writable = " + desc.writable); - todo_wine. ok(desc.enumerable === true, "barfoo desc.enumerable = " + desc.enumerable); - todo_wine. ok(desc.configurable === true, "barfoo desc.configurable = " + desc.configurable); item = sessionStorage.barfoo; - todo_wine. ok(item === "1234", "'barfoo' prop after defineProperty = " + item); item = sessionStorage.getItem("barfoo"); - todo_wine. ok(item === "1234", "'barfoo' item after defineProperty = " + item); sessionStorage.barfoo = 4321; item = sessionStorage.barfoo; - todo_wine. ok(item === "4321", "'barfoo' prop after re-set = " + item); item = sessionStorage.getItem("barfoo"); - todo_wine. ok(item === "4321", "'barfoo' item after re-set = " + item); - todo_wine. ok((delete sessionStorage.barfoo) === true, "delete sessionStorage.barfoo returned false"); - todo_wine. ok(!("barfoo" in sessionStorage), "barfoo in sessionStorage after defined prop deleted"); - todo_wine. ok(!Object.prototype.hasOwnProperty.call(sessionStorage, "barfoo"), "barfoo prop of sessionStorage after defined prop deleted"); item = sessionStorage.barfoo; - todo_wine. ok(item === undefined, "[barfoo] item after second delete = " + item); item = sessionStorage.getItem("barfoo"); ok(item === null, "'barfoo' item after second delete = " + item); @@ -683,7 +671,6 @@ sync_test("storage", function() { sessionStorage.setItem("winetest", "test"); item = sessionStorage.winetest; - todo_wine. ok(item === "test", "'winetest' prop after setItem = " + item); item = sessionStorage.getItem("winetest"); ok(item === "test", "'winetest' item after setItem = " + item); @@ -694,12 +681,10 @@ sync_test("storage", function() { ok(desc.configurable === true, "winetest desc.configurable after setItem = " + desc.configurable); item = sessionStorage.winetest; - todo_wine. ok(item === "test", "'winetest' prop before second setter = " + item); sessionStorage.winetest = 0; ok(item === 1234, "'winetest' item after second setter = " + item); item = sessionStorage.winetest; - todo_wine. ok(item === "test", "'winetest' prop after second setter = " + item); sessionStorage.removeItem("winetest"); @@ -710,7 +695,6 @@ sync_test("storage", function() { sessionStorage.setItem("winetest", "wine"); item = sessionStorage.winetest; - todo_wine. ok(item === "wine", "'winetest' prop after second setItem = " + item); item = sessionStorage.getItem("winetest"); ok(item === "wine", "'winetest' item after second setItem = " + item); @@ -719,19 +703,14 @@ sync_test("storage", function() { ok("winetest" in sessionStorage, "'winetest' not in sessionStorage after delete"); ok(Object.prototype.hasOwnProperty.call(sessionStorage, "winetest"), "'winetest' not prop of sessionStorage after delete"); item = sessionStorage.winetest; - todo_wine. ok(item === 42, "'winetest' item after delete = " + item); item = sessionStorage.getItem("winetest"); - todo_wine. ok(item === null, "'winetest' item after delete = " + item); ok((delete sessionStorage.winetest) === true, "second delete sessionStorage.winetest returned false"); - todo_wine. ok("winetest" in sessionStorage, "'winetest' not in sessionStorage after second delete"); - todo_wine. ok(Object.prototype.hasOwnProperty.call(sessionStorage, "winetest"), "'winetest' not prop of sessionStorage after second delete"); item = sessionStorage.winetest; - todo_wine. ok(item === 42, "'winetest' item after second delete = " + item); item = sessionStorage.getItem("winetest"); ok(item === null, "'winetest' item after second delete = " + item); @@ -745,7 +724,6 @@ sync_test("storage", function() { sessionStorage.setItem("nonconf", "test"); item = sessionStorage.nonconf; - todo_wine. ok(item === "test", "'nonconf' prop after setItem = " + item); item = sessionStorage.getItem("nonconf"); ok(item === "test", "'nonconf' item after setItem = " + item); @@ -755,14 +733,12 @@ sync_test("storage", function() { ok(desc.enumerable === false, "nonconf desc.enumerable after setItem = " + desc.enumerable); ok(desc.configurable === false, "nonconf desc.configurable after setItem = " + desc.configurable); - todo_wine. ok((delete sessionStorage.nonconf) === true, "delete sessionStorage.nonconf returned false"); ok("nonconf" in sessionStorage, "'nonconf' not in sessionStorage after delete"); ok(Object.prototype.hasOwnProperty.call(sessionStorage, "nonconf"), "'nonconf' not prop of sessionStorage after delete"); item = sessionStorage.nonconf; ok(item === 1, "'nonconf' item after delete = " + item); item = sessionStorage.getItem("nonconf"); - todo_wine. ok(item === null, "'nonconf' item after delete = " + item); sessionStorage.setItem("protoprop", "1111"); From 9b1ff18d9efe3118090cbb81117ca1c56d64837b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:07 +0200 Subject: [PATCH 1338/2542] mshtml: Override form element props by name, if needed. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/htmlform.c | 28 +++++++++++++++- dlls/mshtml/tests/documentmode.js | 54 +++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/dlls/mshtml/htmlform.c b/dlls/mshtml/htmlform.c index 1b90a7bd0e1c..a6df90f2ceb4 100644 --- a/dlls/mshtml/htmlform.c +++ b/dlls/mshtml/htmlform.c @@ -868,6 +868,31 @@ static HRESULT HTMLFormElement_invoke(DispatchEx *dispex, DISPID id, LCID lcid, return S_OK; } +static HRESULT HTMLFormElement_override(DispatchEx *dispex, const WCHAR *name, VARIANT *get_value) +{ + HTMLFormElement *This = impl_from_DispatchEx(dispex); + IDispatch *ret; + HRESULT hres; + DISPID id; + + if(get_value) { + hres = HTMLFormElement_get_dispid(&This->element.node.event_target.dispex, (WCHAR*)name, 0, &id); + if(FAILED(hres)) + return (hres == DISP_E_UNKNOWNNAME) ? S_FALSE : hres; + hres = htmlform_item(This, id - MSHTML_DISPID_CUSTOM_MIN, &ret); + if(FAILED(hres)) + return hres; + if(ret) { + V_VT(get_value) = VT_DISPATCH; + V_DISPATCH(get_value) = ret; + }else { + V_VT(get_value) = VT_NULL; + } + } + + return S_OK; +} + static HRESULT HTMLFormElement_handle_event(DispatchEx *dispex, DOMEvent *event, BOOL *prevent_default) { HTMLFormElement *This = impl_from_DispatchEx(dispex); @@ -896,7 +921,8 @@ static const event_target_vtbl_t HTMLFormElement_event_target_vtbl = { .unlink = HTMLFormElement_unlink, .get_dispid = HTMLFormElement_get_dispid, .get_prop_desc = dispex_index_prop_desc, - .invoke = HTMLFormElement_invoke + .invoke = HTMLFormElement_invoke, + .override = HTMLFormElement_override, }, HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES, .handle_event = HTMLFormElement_handle_event diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 5a3d8986bb1e..a843dd1063af 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -3612,6 +3612,7 @@ async_test("postMessage", function() { }); sync_test("form", function() { + var v = document.documentMode; document.body.innerHTML = ""; var form = document.createElement("form"); document.body.appendChild(form); @@ -3623,6 +3624,59 @@ sync_test("form", function() { ok(typeof(form[1]) === "object", "form[1] = " + form[1]); form.innerHTML = ""; ok(form[0] === "test", "form[0] = " + form[0]); + + if(v >= 9) { + var setval; + function getter() { return 42; } + function setter(v) { setval = v + 1; } + + Object.defineProperty(form, "0", { get: getter, set: setter, configurable: true, enumerable: false }); + var desc = Object.getOwnPropertyDescriptor(form, "0"); + ok(desc.value === undefined, "value = " + desc.value); + ok(desc.get === getter, "get = " + desc.get); + ok(desc.set === setter, "set = " + desc.set); + ok(desc.writable === undefined, "writable = " + desc.writable); + ok(desc.enumerable === false, "enumerable = " + desc.enumerable); + ok(desc.configurable === true, "configurable = " + desc.configurable); + ok(form[0] === 42, "form[0] = " + form[0]); + form[0] = 1336; + ok(setval === 1337, "setval = " + setval); + + form.innerHTML = ""; + ok(form.length === 2, "form.length = " + form.length); + ok(typeof(form[0]) === "object", "form[0] = " + form[0]); + form[0] = 32; + ok(setval === 33, "setval = " + setval); + + desc = Object.getOwnPropertyDescriptor(form, "0"); + ok(desc.value === undefined, "[0] value = " + desc.value); + ok(desc.get === getter, "[0] get = " + desc.get); + ok(desc.set === setter, "[0] set = " + desc.set); + ok(desc.writable === undefined, "[0] writable = " + desc.writable); + ok(desc.enumerable === false, "[0] enumerable = " + desc.enumerable); + ok(desc.configurable === true, "[0] configurable = " + desc.configurable); + + desc = Object.getOwnPropertyDescriptor(form, "1"); + ok(typeof(desc.value) === "object", "[1] value = " + desc.value); + ok(desc.get === undefined, "[1] get = " + desc.get); + ok(desc.set === undefined, "[1] set = " + desc.set); + ok(desc.writable === true, "[1] writable = " + desc.writable); + todo_wine. + ok(desc.enumerable === true, "[1] enumerable = " + desc.enumerable); + ok(desc.configurable === true, "[1] configurable = " + desc.configurable); + + form.innerHTML = ""; + desc = Object.getOwnPropertyDescriptor(form, "0"); + ok(desc.value === undefined, "value = " + desc.value); + ok(desc.get === getter, "get = " + desc.get); + ok(desc.set === setter, "set = " + desc.set); + ok(desc.writable === undefined, "writable = " + desc.writable); + ok(desc.enumerable === false, "enumerable = " + desc.enumerable); + ok(desc.configurable === true, "configurable = " + desc.configurable); + ok(form[0] === 42, "form[0] = " + form[0]); + form[0] = 100; + ok(setval === 101, "setval = " + setval); + } }); function test_own_props(obj, name, props, todos, flaky) { From aafb738064414d21b9a7be54b225efd710c977bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Wed, 19 Mar 2025 23:39:07 +0200 Subject: [PATCH 1339/2542] jscript: Do existing prop lookups for external props only on objects with volatile props. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And for non-volatile objects, don't even use them to store new props; instead just create normal jscript props. Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/dispex.c | 6 ++- dlls/jscript/jscript.h | 1 + dlls/jscript/jsdisp.idl | 3 +- dlls/mshtml/htmlcurstyle.c | 1 + dlls/mshtml/htmldoc.c | 3 ++ dlls/mshtml/htmlelem.c | 3 ++ dlls/mshtml/htmlelemcol.c | 1 + dlls/mshtml/htmlform.c | 1 + dlls/mshtml/htmlframe.c | 2 + dlls/mshtml/htmlnode.c | 1 + dlls/mshtml/htmlselect.c | 1 + dlls/mshtml/htmlstorage.c | 1 + dlls/mshtml/htmlstyle.c | 2 + dlls/mshtml/htmlstylesheet.c | 2 + dlls/mshtml/htmlwindow.c | 1 + dlls/mshtml/tests/documentmode.js | 64 +++++++++++++++++++++++++++++++ 16 files changed, 90 insertions(+), 3 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 622e29ee39d1..f6031b961bf4 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -359,7 +359,7 @@ static HRESULT update_external_prop(jsdisp_t *obj, const WCHAR *name, dispex_pro static HRESULT find_external_prop(jsdisp_t *This, const WCHAR *name, BOOL case_insens, dispex_prop_t *prop, dispex_prop_t **ret) { - if(This->builtin_info->lookup_prop) { + if((!prop || prop->type != PROP_EXTERN || This->has_volatile_props) && This->builtin_info->lookup_prop) { struct property_info desc; HRESULT hres; @@ -539,7 +539,7 @@ static HRESULT ensure_prop_name(jsdisp_t *This, const WCHAR *name, DWORD create_ TRACE("creating prop %s flags %lx\n", debugstr_w(name), create_flags); - if(This->builtin_info->lookup_prop) { + if(This->has_volatile_props && This->builtin_info->lookup_prop) { struct property_info desc; hres = This->builtin_info->lookup_prop(This, name, fdexNameEnsure, &desc); if(hres == S_OK) @@ -3806,6 +3806,8 @@ HRESULT init_host_object(script_ctx_t *ctx, IWineJSDispatchHost *host_iface, IWi host_obj->host_iface = host_iface; if(flags & HOSTOBJ_CONSTRUCTOR) host_obj->jsdisp.is_constructor = TRUE; + if(flags & HOSTOBJ_VOLATILE_PROPS) + host_obj->jsdisp.has_volatile_props = TRUE; *ret = &host_obj->jsdisp.IWineJSDispatch_iface; return S_OK; } diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 6a7a0ad35c62..818119f37c82 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -217,6 +217,7 @@ struct jsdisp_t { LONG ref; + BOOLEAN has_volatile_props : 1; BOOLEAN is_constructor : 1; BOOLEAN has_weak_refs : 1; BOOLEAN props_filled : 1; diff --git a/dlls/jscript/jsdisp.idl b/dlls/jscript/jsdisp.idl index 0cd0fa573692..20d0a391bc3d 100644 --- a/dlls/jscript/jsdisp.idl +++ b/dlls/jscript/jsdisp.idl @@ -39,7 +39,8 @@ const unsigned int PROPF_CONFIGURABLE = 0x1000; const unsigned int PROPF_PUBLIC_MASK = PROPF_ENUMERABLE | PROPF_WRITABLE | PROPF_CONFIGURABLE; -const unsigned int HOSTOBJ_CONSTRUCTOR = 0x0001; +const unsigned int HOSTOBJ_CONSTRUCTOR = 0x0001; +const unsigned int HOSTOBJ_VOLATILE_PROPS = 0x0002; interface IWineJSDispatchHost; diff --git a/dlls/mshtml/htmlcurstyle.c b/dlls/mshtml/htmlcurstyle.c index ffccceb2457f..0fd6707be6b7 100644 --- a/dlls/mshtml/htmlcurstyle.c +++ b/dlls/mshtml/htmlcurstyle.c @@ -1201,6 +1201,7 @@ dispex_static_data_t MSCurrentStyleCSSProperties_dispex = { .disp_tid = DispHTMLCurrentStyle_tid, .iface_tids = MSCurrentStyleCSSProperties_iface_tids, .init_info = MSCurrentStyleCSSProperties_init_dispex_info, + .js_flags = HOSTOBJ_VOLATILE_PROPS }; HRESULT HTMLCurrentStyle_Create(HTMLElement *elem, IHTMLCurrentStyle **p) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 5476941176da..3e90d544c9bc 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5770,6 +5770,7 @@ dispex_static_data_t Document_dispex = { .disp_tid = DispHTMLDocument_tid, .iface_tids = HTMLDocumentNode_iface_tids, .init_info = HTMLDocumentNode_init_dispex_info, + .js_flags = HOSTOBJ_VOLATILE_PROPS }; dispex_static_data_t HTMLDocument_dispex = { @@ -5779,6 +5780,7 @@ dispex_static_data_t HTMLDocument_dispex = { .disp_tid = DispHTMLDocument_tid, .iface_tids = HTMLDocumentNode_iface_tids, .init_info = HTMLDocumentNode_init_dispex_info, + .js_flags = HOSTOBJ_VOLATILE_PROPS, .min_compat_mode = COMPAT_MODE_IE11, }; @@ -5912,6 +5914,7 @@ dispex_static_data_t DocumentFragment_dispex = { .disp_tid = DispHTMLDocument_tid, .iface_tids = DocumentFragment_iface_tids, .init_info = DocumentFragment_init_dispex_info, + .js_flags = HOSTOBJ_VOLATILE_PROPS }; static HRESULT create_document_fragment(nsIDOMNode *nsnode, HTMLDocumentNode *doc_node, HTMLDocumentNode **ret) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index fcd8c969a015..0a043b0eb442 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -1129,6 +1129,7 @@ dispex_static_data_t ClientRectList_dispex = { .vtbl = &HTMLRectCollection_dispex_vtbl, .disp_tid = IHTMLRectCollection_tid, .iface_tids = ClientRectList_iface_tids, + .js_flags = HOSTOBJ_VOLATILE_PROPS }; DISPEX_IDISPATCH_IMPL(HTMLElement, IHTMLElement, @@ -7211,6 +7212,7 @@ dispex_static_data_t DOMTokenList_dispex = { .vtbl = &token_list_dispex_vtbl, .disp_tid = IWineDOMTokenList_tid, .iface_tids = DOMTokenList_tids, + .js_flags = HOSTOBJ_VOLATILE_PROPS, .min_compat_mode = COMPAT_MODE_IE10, }; @@ -8268,6 +8270,7 @@ dispex_static_data_t NamedNodeMap_dispex = { .vtbl = &HTMLAttributeCollection_dispex_vtbl, .disp_tid = DispHTMLAttributeCollection_tid, .iface_tids = NamedNodeMap_iface_tids, + .js_flags = HOSTOBJ_VOLATILE_PROPS }; HRESULT HTMLElement_get_attr_col(HTMLDOMNode *iface, HTMLAttributeCollection **ac) diff --git a/dlls/mshtml/htmlelemcol.c b/dlls/mshtml/htmlelemcol.c index dd7ffeea2222..fe36dd31063e 100644 --- a/dlls/mshtml/htmlelemcol.c +++ b/dlls/mshtml/htmlelemcol.c @@ -579,6 +579,7 @@ dispex_static_data_t HTMLCollection_dispex = { .vtbl = &HTMLElementColection_dispex_vtbl, .disp_tid = DispHTMLElementCollection_tid, .iface_tids = HTMLCollection_iface_tids, + .js_flags = HOSTOBJ_VOLATILE_PROPS }; static void create_all_list(HTMLDOMNode *elem, elem_vector_t *buf) diff --git a/dlls/mshtml/htmlform.c b/dlls/mshtml/htmlform.c index a6df90f2ceb4..f5f50f9258fb 100644 --- a/dlls/mshtml/htmlform.c +++ b/dlls/mshtml/htmlform.c @@ -940,6 +940,7 @@ dispex_static_data_t HTMLFormElement_dispex = { .disp_tid = DispHTMLFormElement_tid, .iface_tids = HTMLFormElement_iface_tids, .init_info = HTMLElement_init_dispex_info, + .js_flags = HOSTOBJ_VOLATILE_PROPS }; HRESULT HTMLFormElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem) diff --git a/dlls/mshtml/htmlframe.c b/dlls/mshtml/htmlframe.c index 62a826ffbaec..09cae4f42ee7 100644 --- a/dlls/mshtml/htmlframe.c +++ b/dlls/mshtml/htmlframe.c @@ -934,6 +934,7 @@ dispex_static_data_t HTMLFrameElement_dispex = { .disp_tid = DispHTMLFrameElement_tid, .iface_tids = HTMLFrameElement_iface_tids, .init_info = HTMLElement_init_dispex_info, + .js_flags = HOSTOBJ_VOLATILE_PROPS }; HRESULT HTMLFrameElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem) @@ -1371,6 +1372,7 @@ dispex_static_data_t HTMLIFrameElement_dispex = { .disp_tid = DispHTMLIFrame_tid, .iface_tids = HTMLIFrameElement_iface_tids, .init_info = HTMLElement_init_dispex_info, + .js_flags = HOSTOBJ_VOLATILE_PROPS }; HRESULT HTMLIFrame_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem) diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index c39159d9b43d..196c600a631f 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -390,6 +390,7 @@ dispex_static_data_t NodeList_dispex = { .disp_tid = DispDOMChildrenCollection_tid, .iface_tids = NodeList_iface_tids, .init_info = HTMLDOMNode_init_dispex_info, + .js_flags = HOSTOBJ_VOLATILE_PROPS }; HRESULT create_child_collection(nsIDOMNodeList *nslist, DispatchEx *owner, IHTMLDOMChildrenCollection **ret) diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c index efeed61bf9ab..8801e90edeed 100644 --- a/dlls/mshtml/htmlselect.c +++ b/dlls/mshtml/htmlselect.c @@ -1305,6 +1305,7 @@ dispex_static_data_t HTMLSelectElement_dispex = { .disp_tid = DispHTMLSelectElement_tid, .iface_tids = HTMLSelectElement_tids, .init_info = HTMLElement_init_dispex_info, + .js_flags = HOSTOBJ_VOLATILE_PROPS }; HRESULT HTMLSelectElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem) diff --git a/dlls/mshtml/htmlstorage.c b/dlls/mshtml/htmlstorage.c index e40575ab4246..6f2d842852bc 100644 --- a/dlls/mshtml/htmlstorage.c +++ b/dlls/mshtml/htmlstorage.c @@ -1328,6 +1328,7 @@ dispex_static_data_t Storage_dispex = { .vtbl = &Storage_dispex_vtbl, .disp_tid = IHTMLStorage_tid, .iface_tids = HTMLStorage_iface_tids, + .js_flags = HOSTOBJ_VOLATILE_PROPS }; static HRESULT build_session_origin(IUri *uri, BSTR hostname, BSTR *ret) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 36d685bf3d19..a44c1b151d41 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -9778,6 +9778,7 @@ dispex_static_data_t MSStyleCSSProperties_dispex = { .disp_tid = DispHTMLStyle_tid, .iface_tids = MSStyleCSSProperties_iface_tids, .init_info = MSStyleCSSProperties_init_dispex_info, + .js_flags = HOSTOBJ_VOLATILE_PROPS }; static HRESULT get_style_from_elem(HTMLElement *elem, nsIDOMCSSStyleDeclaration **ret) @@ -9922,6 +9923,7 @@ dispex_static_data_t CSSStyleDeclaration_dispex = { .vtbl = &CSSStyleDeclaration_dispex_vtbl, .disp_tid = DispHTMLW3CComputedStyle_tid, .init_info = CSSStyleDeclaration_init_dispex_info, + .js_flags = HOSTOBJ_VOLATILE_PROPS }; HRESULT create_computed_style(nsIDOMCSSStyleDeclaration *nsstyle, DispatchEx *owner, IHTMLCSSStyleDeclaration **p) diff --git a/dlls/mshtml/htmlstylesheet.c b/dlls/mshtml/htmlstylesheet.c index 1f040e515e23..e463a50fa82d 100644 --- a/dlls/mshtml/htmlstylesheet.c +++ b/dlls/mshtml/htmlstylesheet.c @@ -377,6 +377,7 @@ dispex_static_data_t MSCSSRuleList_dispex = { .vtbl = &MSCSSRuleList_dispex_vtbl, .disp_tid = DispHTMLStyleSheetRulesCollection_tid, .iface_tids = MSCSSRuleList_iface_tids, + .js_flags = HOSTOBJ_VOLATILE_PROPS }; static HRESULT create_style_sheet_rules_collection(nsIDOMCSSRuleList *nslist, DispatchEx *owner, @@ -739,6 +740,7 @@ dispex_static_data_t StyleSheetList_dispex = { .vtbl = &StyleSheetList_dispex_vtbl, .disp_tid = DispHTMLStyleSheetsCollection_tid, .iface_tids = StyleSheetList_iface_tids, + .js_flags = HOSTOBJ_VOLATILE_PROPS }; HRESULT create_style_sheet_collection(nsIDOMStyleSheetList *nslist, HTMLDocumentNode *doc, diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 4f1be358dbe3..7a33368d1586 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -4310,6 +4310,7 @@ dispex_static_data_t Window_dispex = { .vtbl = &HTMLWindow_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLWindow2_tid, .init_info = HTMLWindow_init_dispex_info, + .js_flags = HOSTOBJ_VOLATILE_PROPS }; static nsresult NSAPI outer_window_traverse(void *ccp, void *p, nsCycleCollectionTraversalCallback *cb) diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index a843dd1063af..1931b6f1c0ca 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -3679,6 +3679,70 @@ sync_test("form", function() { } }); +sync_test("indexed hostobj props", function() { + var v = document.documentMode; + if(v < 9) + return; + function getter() { return 42; } + + function check(obj, value, overridden) { + var name = Object.prototype.toString.call(obj).slice(8, -1); + if(value === null) + ok(typeof(obj[0]) === "object", name + "[0] = " + obj[0]); + else + ok(obj[0] === value, name + "[0] post-del = " + obj[0]); + + Object.defineProperty(obj, "0", { get: getter, set: undefined, configurable: true, enumerable: false }); + var desc = Object.getOwnPropertyDescriptor(obj, "0"); + ok(desc.value === undefined, name + "[0] value = " + desc.value); + ok(desc.get === getter, name + "[0] get = " + desc.get); + ok(desc.set === undefined, name + "[0] set = " + desc.set); + ok(desc.writable === undefined, name + "[0] writable = " + desc.writable); + ok(desc.enumerable === false, name + "[0] enumerable = " + desc.enumerable); + ok(desc.configurable === true, name + "[0] configurable = " + desc.configurable); + + if(!overridden) + ok(obj[0] === 42, name + "[0] = " + obj[0]); + else if(value === null) + ok(typeof(obj[0]) === "object", name + "[0] = " + obj[0]); + else + ok(obj[0] === value, name + "[0] = " + obj[0]); + + delete obj["0"]; + desc = Object.getOwnPropertyDescriptor(obj, "0"); + if(value === null) + ok(typeof(desc.value) === "object", name + "[0] value post-del = " + desc.value); + else + ok(desc.value === value, name + "[0] value post-del = " + desc.value); + ok(desc.get === undefined, name + "[0] get post-del = " + desc.get); + ok(desc.set === undefined, name + "[0] set post-del = " + desc.set); + ok(desc.writable === true, name + "[0] writable post-del = " + desc.writable); + todo_wine. + ok(desc.enumerable === true, name + "[0] enumerable post-del = " + desc.enumerable); + ok(desc.configurable === true, name + "[0] configurable post-del = " + desc.configurable); + if(value === null) + ok(typeof(obj[0]) === "object", name + "[0] post-del = " + obj[0]); + else + ok(obj[0] === value, name + "[0] post-del = " + obj[0]); + ok(obj.hasOwnProperty("0"), "0 not a prop of " + name); + } + + document.body.innerHTML = ""; + var e = document.createElement("select"); + e.innerHTML = '